[libterralib] 14/24: Imported Upstream version 4.0.0

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Sat Aug 1 23:04:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository libterralib.

commit cae8437a83c9b035effb755d4e5de795b3b419d9
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sun Aug 2 00:54:34 2015 +0200

    Imported Upstream version 4.0.0
---
 build/cmake/README                                 |    74 +
 build/cmake/common/common.txt                      |     1 +
 build/cmake/dxflib/CMakeLists.txt                  |    13 +
 build/cmake/libjpeg/CMakeLists.txt                 |    25 +
 build/cmake/libspl/CMakeLists.txt                  |    13 +
 build/cmake/qwt/CMakeLists.txt                     |    35 +
 build/cmake/shapelib/CMakeLists.txt                |    13 +
 build/cmake/stat/CMakeLists.txt                    |    30 +
 build/cmake/te_ado/CMakeLists.txt                  |    13 +
 build/cmake/te_apputils/CMakeLists.txt             |    13 +
 build/cmake/te_dxf/CMakeLists.txt                  |    17 +
 build/cmake/te_firebird/CMakeLists.txt             |    13 +
 build/cmake/te_functions/CMakeLists.txt            |    13 +
 build/cmake/te_mysql/CMakeLists.txt                |    13 +
 build/cmake/te_oracle/CMakeLists.txt               |    13 +
 build/cmake/te_postgresql/CMakeLists.txt           |    13 +
 build/cmake/te_qwt/CMakeLists.txt                  |    13 +
 build/cmake/te_shapelib/CMakeLists.txt             |    13 +
 build/cmake/te_spl/CMakeLists.txt                  |    13 +
 build/cmake/te_utils/CMakeLists.txt                |    13 +
 build/cmake/terraView/CMakeLists.txt               |   190 +
 build/cmake/terraViewCore/CMakeLists.txt           |    13 +
 build/cmake/terralib/CMakeLists.txt                |    39 +
 build/cmake/terralibdtm/CMakeLists.txt             |    13 +
 build/cmake/terralibpdi/CMakeLists.txt             |    22 +
 build/cmake/tiff/CMakeLists.txt                    |    24 +
 build/qt/Firebird/Firebird.pro                     |    25 +
 build/qt/Makefile                                  |    81 +
 build/qt/MySQL/MySQL.pro                           |    27 +
 build/qt/Oracle/Oracle.pro                         |    40 +
 build/qt/PostgreSQL/PostgreSQL.pro                 |    31 +
 build/qt/appUtils/appUtils.pro                     |    91 +
 build/qt/config.pri                                |    57 +
 build/qt/config_win32-g++.pri                      |     4 +
 build/qt/config_win32-msvc.pri                     |    24 +
 build/qt/dxflib/dxflib.pro                         |    31 +
 build/qt/image_processing/image_processing.pro     |   266 +
 build/qt/libjpeg/libjpeg.pro                       |    84 +
 build/qt/libspl/libspl.pro                         |    40 +
 build/qt/qwt/qwt.pro                               |   164 +
 build/qt/shapelib/shapelib.pro                     |    14 +
 build/qt/stat/stat.pro                             |    44 +
 build/qt/te_dxf/te_dxf.pro                         |    39 +
 build/qt/te_functions/te_functions.pro             |    40 +
 build/qt/te_gdal/te_gdal.pro                       |    78 +
 build/qt/te_qwt/te_qwt.pro                         |    32 +
 build/qt/te_shapelib/te_shapelib.pro               |    24 +
 build/qt/te_spl/te_spl.pro                         |    34 +
 build/qt/te_utils/te_utils.pro                     |    25 +
 build/qt/terraView.pro                             |     4 +
 build/qt/terraView/terraView.pro                   |    67 +
 build/qt/terraViewCore/terraViewCore.pro           |   297 +
 build/qt/terralib.pro                              |    36 +
 build/qt/terralib/terralib.pro                     |   256 +
 build/qt/tiff/tiff.pro                             |    93 +
 build/qt/utilities.pro                             |     8 +
 build/qt4/Firebird/Firebird.pro                    |    48 +
 build/qt4/MySQL/MySQL.pro                          |    52 +
 build/qt4/Oracle/Oracle.pro                        |    71 +
 build/qt4/PostgreSQL/PostgreSQL.pro                |    55 +
 build/qt4/config.pri                               |    39 +
 build/qt4/config_win32-g++.pri                     |     4 +
 build/qt4/config_win32-msvc.pri                    |    24 +
 build/qt4/dxflib/dxflib.pro                        |    30 +
 build/qt4/image_processing/image_processing.pro    |   264 +
 build/qt4/install_cfg.pri                          |    41 +
 build/qt4/libjpeg/libjpeg.pro                      |    92 +
 build/qt4/libspl/libspl.pro                        |    39 +
 build/qt4/shapelib/shapelib.pro                    |    20 +
 build/qt4/stat/stat.pro                            |    45 +
 build/qt4/te_dxf/te_dxf.pro                        |    33 +
 build/qt4/te_functions/te_functions.pro            |    55 +
 build/qt4/te_gdal/te_gdal.pro                      |    78 +
 build/qt4/te_shapelib/te_shapelib.pro              |    32 +
 build/qt4/te_spl/te_spl.pro                        |    34 +
 build/qt4/te_utils/te_utils.pro                    |    40 +
 build/qt4/terralib.pro                             |    35 +
 build/qt4/terralib/br.org.terralib.pro             |    23 +
 build/qt4/terralib/extension.xml                   |    45 +
 build/qt4/terralib/terralib.pro                    |   285 +
 build/qt4/tiff/tiff.pro                            |   107 +
 build/win32-msvc2003/dxf/dxf.vcproj                |   171 +
 build/win32-msvc2003/libjpeg/libjpeg.vcproj        |   352 +
 build/win32-msvc2003/libspl/libspl.vcproj          |   185 +
 build/win32-msvc2003/qwt/qwt.vcproj                |   910 +
 build/win32-msvc2003/shapelib/shapelib.vcproj      |   148 +
 build/win32-msvc2003/stat/stat.vcproj              |   248 +
 build/win32-msvc2003/te_ado/te_ado.vcproj          |   182 +
 .../win32-msvc2003/te_apputils/te_apputils.vcproj  |   749 +
 build/win32-msvc2003/te_dxf/te_dxf.vcproj          |   181 +
 .../win32-msvc2003/te_firebird/te_firebird.vcproj  |   179 +
 .../te_functions/te_functions.vcproj               |   242 +
 build/win32-msvc2003/te_gdal/te_gdal.vcproj        |   190 +
 build/win32-msvc2003/te_mysql/te_mysql.vcproj      |   164 +
 build/win32-msvc2003/te_oracle/te_oracle.vcproj    |   188 +
 .../te_postgresql/te_postgresql.vcproj             |   182 +
 build/win32-msvc2003/te_qwt/te_qwt.vcproj          |   255 +
 .../win32-msvc2003/te_shapelib/te_shapelib.vcproj  |   170 +
 build/win32-msvc2003/te_spl/te_spl.vcproj          |   188 +
 build/win32-msvc2003/te_utils/te_utils.vcproj      |   194 +
 build/win32-msvc2003/terraView/terraView.sln       |   232 +
 build/win32-msvc2003/terraView/terraView.vcproj    |   176 +
 build/win32-msvc2003/terraViewCore/.imgcol         |     1 +
 .../terraViewCore/terraViewCore.vcproj             |  3619 +
 build/win32-msvc2003/terralib/terralib.sln         |   130 +
 build/win32-msvc2003/terralib/terralib.vcproj      |   938 +
 .../win32-msvc2003/terralibdtm/terralibdtm.vcproj  |   186 +
 .../win32-msvc2003/terralibpdi/terralibpdi.vcproj  |   793 +
 build/win32-msvc2003/tiff/tiff.vcproj              |   376 +
 build/win32-msvc2005/dxf/dxf.vcproj                |   235 +
 build/win32-msvc2005/libjpeg/libjpeg.vcproj        |   474 +
 build/win32-msvc2005/libspl/libspl.vcproj          |   267 +
 build/win32-msvc2005/qwt/qwt.vcproj                |  1143 +
 build/win32-msvc2005/shapelib/shapelib.vcproj      |   217 +
 build/win32-msvc2005/stat/stat.vcproj              |   345 +
 build/win32-msvc2005/te_ado/te_ado.vcproj          |   258 +
 .../win32-msvc2005/te_apputils/te_apputils.vcproj  |   937 +
 build/win32-msvc2005/te_dxf/te_dxf.vcproj          |   256 +
 .../win32-msvc2005/te_firebird/te_firebird.vcproj  |   253 +
 .../te_functions/te_functions.vcproj               |   337 +
 build/win32-msvc2005/te_gdal/te_gdal.vcproj        |   267 +
 build/win32-msvc2005/te_mysql/te_mysql.vcproj      |   233 +
 build/win32-msvc2005/te_oracle/te_oracle.vcproj    |   265 +
 .../te_postgresql/te_postgresql.vcproj             |   257 +
 build/win32-msvc2005/te_qwt/te_qwt.vcproj          |   340 +
 .../win32-msvc2005/te_shapelib/te_shapelib.vcproj  |   241 +
 build/win32-msvc2005/te_spl/te_spl.vcproj          |   265 +
 build/win32-msvc2005/te_utils/te_utils.vcproj      |   273 +
 build/win32-msvc2005/terraView/terraView.sln       |   224 +
 build/win32-msvc2005/terraView/terraView.vcproj    |   228 +
 build/win32-msvc2005/terraViewCore/.imgcol         |     1 +
 .../terraViewCore/terraViewCore.vcproj             |  4411 +
 build/win32-msvc2005/terralib/terralib.sln         |   124 +
 build/win32-msvc2005/terralib/terralib.vcproj      |  1268 +
 .../win32-msvc2005/terralibdtm/terralibdtm.vcproj  |   186 +
 .../win32-msvc2005/terralibpdi/terralibpdi.vcproj  |  1071 +
 build/win32-msvc2005/tiff/tiff.vcproj              |   520 +
 dependencies/linux/DSDK/lib/libgdal.a              |   Bin 0 -> 5369194 bytes
 dependencies/linux/DSDK/lib/libltidsdk.a           |   Bin 0 -> 3896770 bytes
 dependencies/linux/Firebird/lib/libfbembed.so      |   Bin 0 -> 2587392 bytes
 dependencies/linux/Firebird/lib/libicudata.so.30   |   Bin 0 -> 1103596 bytes
 dependencies/linux/Firebird/lib/libicui18n.so.30   |   Bin 0 -> 317296 bytes
 dependencies/linux/Firebird/lib/libicuuc.so.30     |   Bin 0 -> 812376 bytes
 dependencies/linux/MySQL/lib/libmysqlclient.a      |   Bin 0 -> 1506542 bytes
 dependencies/linux/Oracle/lib/libclntsh.so.10.1    |   Bin 0 -> 12579912 bytes
 dependencies/linux/Oracle/lib/libnnz10.so          |   Bin 0 -> 2121817 bytes
 dependencies/linux/Oracle/lib/libociei.so          |   Bin 0 -> 70659429 bytes
 dependencies/linux/PostgreSQL/lib/libpq.a          |   Bin 0 -> 137152 bytes
 dependencies/linux/opengl/lib/libGL.so             |   Bin 0 -> 428204 bytes
 dependencies/linux/opengl/lib/libGLU.so            |   Bin 0 -> 574024 bytes
 dependencies/linux/opengl/lib/libdrm.so            |   Bin 0 -> 27952 bytes
 examples/Debug/ijl15.dll                           |   Bin
 examples/Debug/libMySQL.dll                        |   Bin 925696 -> 1302528 bytes
 examples/Debug/libpq.dll                           |   Bin 90112 -> 154758 bytes
 examples/Debug/msjava.dll                          |   Bin
 examples/Debug/oci.dll                             |   Bin 97280 -> 188416 bytes
 examples/Debug/zlib.dll                            |   Bin
 examples/Debug/zlib1.dll                           |   Bin 65024 -> 75264 bytes
 examples/Makefile                                  |    54 +-
 examples/Readme                                    |   286 +-
 examples/{Debug => Release}/ijl15.dll              |   Bin
 examples/Release/libMySQL.dll                      |   Bin 0 -> 1302528 bytes
 examples/Release/libpq.dll                         |   Bin 0 -> 154758 bytes
 examples/Release/oci.dll                           |   Bin 0 -> 188416 bytes
 examples/{Debug => Release}/zlib.dll               |   Bin
 examples/addGeomRepresentation/.cdtproject         |    34 +-
 examples/addGeomRepresentation/.project            |   208 +-
 examples/addGeomRepresentation/Makefile            |    58 +-
 .../addGeomRepresentation.cpp                      |   200 +-
 .../addGeomRepresentation.dsp                      |   228 +-
 .../addGeomRepresentation.dsw                      |    88 +-
 .../addGeomRepresentation.pro                      |    41 +-
 .../addGeomRepresentation.sln                      |     0
 .../addGeomRepresentation.vcproj                   |   322 +-
 examples/base/base.pro                             |   139 +-
 examples/convertCoordinates/.cdtproject            |    34 +-
 examples/convertCoordinates/.project               |   208 +-
 examples/convertCoordinates/Makefile               |    60 +-
 examples/convertCoordinates/convertCoordinates.cpp |   136 +-
 examples/convertCoordinates/convertCoordinates.dsp |   212 +-
 examples/convertCoordinates/convertCoordinates.dsw |    88 +-
 examples/convertCoordinates/convertCoordinates.pro |    12 +-
 examples/convertCoordinates/convertCoordinates.sln |     0
 .../convertCoordinates/convertCoordinates.vcproj   |   308 +-
 examples/copyLayer/.cdtproject                     |    34 +-
 examples/copyLayer/.project                        |   208 +-
 examples/copyLayer/Makefile                        |    58 +-
 examples/copyLayer/copyLayer.cpp                   |   176 +-
 examples/copyLayer/copyLayer.dsp                   |   244 +-
 examples/copyLayer/copyLayer.dsw                   |    88 +-
 examples/copyLayer/copyLayer.pro                   |    20 +-
 examples/copyLayer/copyLayer.sln                   |     0
 examples/copyLayer/copyLayer.vcproj                |   406 +-
 examples/createCoverage/createCoverage.cpp         |   628 +-
 examples/createCoverage/createCoverage.pro         |     5 +
 examples/createDatabase/.cdtproject                |    34 +-
 examples/createDatabase/.project                   |   208 +-
 examples/createDatabase/Makefile                   |    56 +-
 examples/createDatabase/createDatabase.cpp         |   128 +-
 examples/createDatabase/createDatabase.dsp         |   228 +-
 examples/createDatabase/createDatabase.dsw         |    58 +-
 examples/createDatabase/createDatabase.pro         |    16 +-
 examples/createDatabase/createDatabase.sln         |   100 +-
 examples/createDatabase/createDatabase.vcproj      |   272 +-
 examples/createLayer/.cdtproject                   |    34 +-
 examples/createLayer/.project                      |   208 +-
 examples/createLayer/Makefile                      |    60 +-
 examples/createLayer/createLayer.cpp               |   598 +-
 examples/createLayer/createLayer.dsp               |   228 +-
 examples/createLayer/createLayer.dsw               |    88 +-
 examples/createLayer/createLayer.pro               |    15 +-
 examples/createLayer/createLayer.sln               |     0
 examples/createLayer/createLayer.vcproj            |   377 +-
 examples/createProximityMatrix/.cdtproject         |    17 +
 examples/createProximityMatrix/.project            |   104 +
 examples/createProximityMatrix/Makefile            |    14 +
 .../createProximityMatrix.cpp                      |   123 +
 .../createProximityMatrix.dsp                      |   114 +
 .../createProximityMatrix.dsw                      |    47 +
 .../createProximityMatrix.pro                      |     7 +
 .../createProximityMatrix.sln                      |    45 +
 .../createProximityMatrix.vcproj                   |   177 +
 examples/createSTElementSet/.cdtproject            |    34 +-
 examples/createSTElementSet/.project               |   208 +-
 examples/createSTElementSet/Makefile               |    58 +-
 examples/createSTElementSet/createSTElementSet.cpp |   206 +-
 examples/createSTElementSet/createSTElementSet.dsp |   228 +-
 examples/createSTElementSet/createSTElementSet.dsw |    94 +-
 examples/createSTElementSet/createSTElementSet.pro |    14 +-
 examples/createSTElementSet/createSTElementSet.sln |     0
 .../createSTElementSet/createSTElementSet.vcproj   |   322 +-
 examples/createSTElementSetFromLayer/.cdtproject   |    34 +-
 examples/createSTElementSetFromLayer/.project      |   208 +-
 examples/createSTElementSetFromLayer/Makefile      |    58 +-
 .../createSTElementSetFromLayer.cpp                |   274 +-
 .../createSTElementSetFromLayer.dsp                |   228 +-
 .../createSTElementSetFromLayer.dsw                |    94 +-
 .../createSTElementSetFromLayer.pro                |    17 +-
 .../createSTElementSetFromLayer.sln                |     0
 .../createSTElementSetFromLayer.vcproj             |   383 +-
 .../createSTElementSetFromShapeFile/.cdtproject    |    17 +
 examples/createSTElementSetFromShapeFile/.project  |   104 +
 examples/createSTElementSetFromShapeFile/Makefile  |    17 +
 .../createSTElementSetFromShapeFile.cpp            |    91 +
 .../createSTElementSetFromShapeFile.dsp            |   130 +
 .../createSTElementSetFromShapeFile.dsw            |    65 +
 .../createSTElementSetFromShapeFile.pro            |     8 +
 .../createSTElementSetFromShapeFile.vcproj         |   191 +
 .../createSTElementSetFromShapefile.sln            |    48 +
 examples/createSTElementSetFromTheme/.cdtproject   |    17 +
 examples/createSTElementSetFromTheme/.project      |   104 +
 examples/createSTElementSetFromTheme/Makefile      |    14 +
 .../createSTElementSetFromTheme.cpp                |   144 +
 .../createSTElementSetFromTheme.dsp                |   114 +
 .../createSTElementSetFromTheme.dsw                |    47 +
 .../createSTElementSetFromTheme.pro                |     8 +
 .../createSTElementSetFromTheme.sln                |    45 +
 .../createSTElementSetFromTheme.vcproj             |   177 +
 examples/createTIN/.cvsignore                      |    13 +
 examples/createTIN/Makefile                        |    14 +
 examples/createTIN/createTIN.cpp                   |   173 +
 examples/createTIN/createTIN.pro                   |     7 +
 examples/createTIN/createTIN.sln                   |    49 +
 examples/createTIN/createTIN.vcproj                |   158 +
 examples/createTable/.cdtproject                   |    34 +-
 examples/createTable/.project                      |   208 +-
 examples/createTable/Makefile                      |    58 +-
 examples/createTable/createTable.cpp               |   422 +-
 examples/createTable/createTable.dsp               |   228 +-
 examples/createTable/createTable.dsw               |    94 +-
 examples/createTable/createTable.pro               |    15 +-
 examples/createTable/createTable.sln               |     0
 examples/createTable/createTable.vcproj            |   272 +-
 examples/createTheme/.cdtproject                   |    34 +-
 examples/createTheme/.project                      |   208 +-
 examples/createTheme/Makefile                      |    60 +-
 examples/createTheme/createTheme.cpp               |   396 +-
 examples/createTheme/createTheme.dsp               |   228 +-
 examples/createTheme/createTheme.dsw               |    94 +-
 examples/createTheme/createTheme.pro               |    13 +-
 examples/createTheme/createTheme.sln               |     0
 examples/createTheme/createTheme.vcproj            |   322 +-
 examples/data/BairroBH.MID                         |   480 +-
 examples/data/BairroBH.MIF                         | 38378 ++++-----
 examples/data/BairrosPoA.dbf                       |   Bin
 examples/data/BairrosPoA.shp                       |   Bin
 examples/data/BairrosPoA.shx                       |   Bin
 examples/data/BairrosRecife.mid                    |   188 +-
 examples/data/BairrosRecife.mif                    | 27772 +++----
 examples/data/BairrosRecife2.csv                   |   188 +-
 examples/data/BrasiliaPol.dbf                      |   Bin 474 -> 477 bytes
 examples/data/BrasiliaPol.shp                      |   Bin 364 -> 366 bytes
 examples/data/BrasiliaPol.shx                      |   Bin 108 -> 109 bytes
 examples/data/Brasilia_RGB.tif                     |   Bin
 examples/data/Cadastro_Escolas.geo                 |   402 +-
 examples/data/Cadastro_Escolas.tab                 |   472 +-
 examples/data/Distritos.mid                        |   192 +-
 examples/data/Distritos.mif                        | 82192 +++++++++----------
 examples/data/EstadosBrasil.dbf                    |   Bin
 examples/data/EstadosBrasil.shp                    |   Bin
 examples/data/EstadosBrasil.shx                    |   Bin
 examples/data/Mapa_Distritos_SP.dbf                |   Bin 12705 -> 12706 bytes
 examples/data/Mapa_Distritos_SP.shp                |   Bin
 examples/data/Mapa_Distritos_SP.shx                |   Bin
 examples/data/Mapa_Drenagem_SP.dbf                 |   Bin 3409 -> 3410 bytes
 examples/data/Mapa_Drenagem_SP.shp                 |   Bin
 examples/data/Mapa_Drenagem_SP.shx                 |   Bin
 examples/data/OcorrenciasBH.csv                    | 13004 +--
 examples/data/OcorrenciasPoA.dbf                   |   Bin
 examples/data/OcorrenciasPoA.shp                   |   Bin
 examples/data/OcorrenciasPoA.shx                   |   Bin
 examples/data/SOCEC.dbf                            |   Bin
 examples/data/elevation.raw                        |   Bin
 examples/data/nat1.tif                             |   Bin
 examples/data/nat2.tif                             |   Bin
 examples/data/sampa.jpg                            |   Bin
 examples/data/samples.spr                          | 45754 +++++------
 examples/data/sp_589x703.raw                       |     0
 examples/databaseQuery/.cdtproject                 |    34 +-
 examples/databaseQuery/.project                    |   208 +-
 examples/databaseQuery/Makefile                    |    58 +-
 examples/databaseQuery/databaseQuery.cpp           |   282 +-
 examples/databaseQuery/databaseQuery.dsp           |   228 +-
 examples/databaseQuery/databaseQuery.dsw           |    94 +-
 examples/databaseQuery/databaseQuery.pro           |    16 +-
 examples/databaseQuery/databaseQuery.sln           |     0
 examples/databaseQuery/databaseQuery.vcproj        |   272 +-
 examples/databaseSQLQuery/.cdtproject              |    34 +-
 examples/databaseSQLQuery/.project                 |   208 +-
 examples/databaseSQLQuery/Makefile                 |    58 +-
 examples/databaseSQLQuery/databaseSQLQuery.cpp     |   276 +-
 examples/databaseSQLQuery/databaseSQLQuery.dsp     |   228 +-
 examples/databaseSQLQuery/databaseSQLQuery.dsw     |    94 +-
 examples/databaseSQLQuery/databaseSQLQuery.pro     |    16 +-
 examples/databaseSQLQuery/databaseSQLQuery.sln     |   100 +-
 examples/databaseSQLQuery/databaseSQLQuery.vcproj  |   272 +-
 examples/examples.pro                              |    41 +
 examples/examples.sln                              |   757 +-
 examples/image_processing/.cvsignore               |     3 +
 examples/image_processing/Makefile                 |    72 +-
 examples/image_processing/bin/.cvsignore           |     9 +
 .../image_processing/bin/run_all_tests_unix.sh     |    96 +-
 examples/image_processing/image_processing.pro     |    14 +-
 examples/image_processing/image_processing.sln     |   704 +-
 examples/image_processing/readme.txt               |     0
 examples/image_processing/resources/.cvsignore     |     1 +
 examples/image_processing/resources/b3spline.flr   |     6 +
 examples/image_processing/resources/cbers2b.srf    |  1994 +
 .../resources/cbers2b_blue_crop.tif                |   Bin 0 -> 132707 bytes
 .../resources/cbers2b_green_crop.tif               |   Bin 0 -> 132707 bytes
 .../resources/cbers2b_red_crop.tif                 |   Bin 0 -> 132707 bytes
 .../image_processing/resources/cbers_b2_crop.tif   |   Bin
 .../image_processing/resources/cbers_b2_crop_A.tif |   Bin
 .../resources/cbers_b2_crop_B_contraste.tif        |   Bin
 .../image_processing/resources/cbers_b2_crop_C.tif |   Bin
 .../resources/cbers_b2_crop_contraste.tif          |   Bin
 .../cbers_b2_crop_contraste_halfsampled.tif        |   Bin
 .../resources/cbers_rgb342_crop1.tif               |   Bin
 .../resources/cbers_rgb342_crop1_chip0_0.tif       |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip0_250.tif     |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip0_500.tif     |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip0_750.tif     |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip250_0.tif     |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip250_250.tif   |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip250_500.tif   |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip250_750.tif   |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip500_0.tif     |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip500_250.tif   |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip500_500.tif   |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_chip500_750.tif   |   Bin 0 -> 189977 bytes
 .../resources/cbers_rgb342_crop1_cropA.tif         |   Bin 0 -> 1496522 bytes
 .../resources/cbers_rgb342_crop1_cropB.tif         |   Bin 0 -> 1582802 bytes
 .../resources/cbers_rgb342_crop1_halfsampled.tif   |   Bin 665042 -> 676076 bytes
 .../cbers_rgb342_crop1_halfsampled_cropA.tif       |   Bin 0 -> 425960 bytes
 .../cbers_rgb342_crop1_halfsampled_cropB.tif       |   Bin 0 -> 378686 bytes
 .../resources/cbers_rgb342_crop2.tif               |   Bin
 .../resources/cbers_rgb342_crop3.tif               |   Bin
 examples/image_processing/resources/ikonos.srf     |   139 +
 examples/image_processing/resources/pattern1.tif   |   Bin 0 -> 1000486 bytes
 examples/image_processing/resources/quickbird.srf  |   162 +
 examples/image_processing/resources/spot5.srf      |   182 +
 examples/image_processing/resources/triangle.flr   |     4 +
 examples/image_processing/run_all_tests_unix.sh    |   102 +-
 examples/image_processing/source/.cvsignore        |     2 +
 .../source/TePDIArithmetic/.cvsignore              |    13 +
 .../source/TePDIArithmetic/TePDIArithmetic.pro     |    18 +-
 .../TePDIArithmetic/TePDIArithmetic_test.cpp       |   657 +-
 .../TePDIArithmetic/TePDIArithmetic_test.vcproj    |   292 +-
 .../source/TePDIBDFilter/.cvsignore                |    13 +
 .../source/TePDIBDFilter/TePDIBDFilter.pro         |    14 +-
 .../source/TePDIBDFilter/TePDIBDFilter_test.cpp    |   220 +-
 .../source/TePDIBDFilter/TePDIBDFilter_test.vcproj |   292 +-
 .../source/TePDIBlender/.cvsignore                 |    13 +
 .../source/TePDIBlender/TePDIBlender.pro           |     7 +
 .../source/TePDIBlender/TePDIBlender_test.cpp      |   671 +
 .../source/TePDIBlender/TePDIBlender_test.vcproj   |   146 +
 .../source/TePDIBlending/TePDIBlending.pro         |     7 -
 .../source/TePDIBlending/TePDIBlending_test.cpp    |   411 -
 .../source/TePDIBlending/TePDIBlending_test.vcproj |   146 -
 .../source/TePDIClassification/.cvsignore          |    13 +
 .../TePDIClassification/TePDIClassification.pro    |    16 +-
 .../TePDIClassification_test.cpp                   |   489 +-
 .../TePDIClassification_test.vcproj                |   292 +-
 .../source/TePDIColorTransform/.cvsignore          |    13 +
 .../TePDIColorTransform/TePDIColorTransform.pro    |    10 +-
 .../TePDIColorTransform_test.cpp                   |   604 +-
 .../TePDIColorTransform_test.vcproj                |   292 +-
 .../source/TePDIContrast/.cvsignore                |    13 +
 .../source/TePDIContrast/TePDIContrast.pro         |    12 +-
 .../source/TePDIContrast/TePDIContrast_test.cpp    |  1082 +-
 .../source/TePDIContrast/TePDIContrast_test.vcproj |   292 +-
 .../source/TePDICorrelationMatching/.cvsignore     |    13 +
 .../TePDICorrelationMatching.pro                   |    14 +-
 .../TePDICorrelationMatching_test.cpp              |  1074 +-
 .../TePDICorrelationMatching_test.vcproj           |   292 +-
 .../TePDIDecorrelationEnhancement/.cvsignore       |    13 +
 .../TePDIDecorrelationEnhancement.pro              |    10 +-
 .../TePDIDecorrelationEnhancement_test.cpp         |   169 +-
 .../TePDIDecorrelationEnhancement_test.vcproj      |   292 +-
 .../source/TePDIFilterMask/.cvsignore              |    13 +
 .../source/TePDIFilterMask/TePDIFilterMask.pro     |     8 +-
 .../TePDIFilterMask/TePDIFilterMask_test.cpp       |   342 +-
 .../TePDIFilterMask/TePDIFilterMask_test.vcproj    |   292 +-
 .../image_processing/source/TePDIFusion/.cvsignore |    13 +
 .../source/TePDIFusion/TePDIFusion.pro             |    12 +-
 .../source/TePDIFusion/TePDIFusion_test.cpp        |   912 +-
 .../source/TePDIFusion/TePDIFusion_test.vcproj     |   292 +-
 .../source/TePDIHaralick/.cvsignore                |    13 +
 .../source/TePDIHaralick/TePDIHaralick.pro         |    10 +-
 .../source/TePDIHaralick/TePDIHaralick_test.cpp    |   214 +-
 .../source/TePDIHaralick/TePDIHaralick_test.vcproj |   292 +-
 .../source/TePDIHistogram/.cvsignore               |    13 +
 .../source/TePDIHistogram/TePDIHistogram.pro       |     8 +-
 .../source/TePDIHistogram/TePDIHistogram_test.cpp  |  2311 +-
 .../TePDIHistogram/TePDIHistogram_test.vcproj      |   292 +-
 .../source/TePDIInterpolator/.cvsignore            |    13 +
 .../source/TePDIInterpolator/TePDIInterpolator.pro |    10 +-
 .../TePDIInterpolator/TePDIInterpolator_test.cpp   |   444 +-
 .../TePDIInterpolator_test.vcproj                  |   292 +-
 .../source/TePDIJointHistogram/.cvsignore          |    13 +
 .../TePDIJointHistogram/TePDIJointHistogram.pro    |     8 +-
 .../TePDIJointHistogram_test.cpp                   |   702 +-
 .../TePDIJointHistogram_test.vcproj                |   292 +-
 .../source/TePDILinearFilter/.cvsignore            |    13 +
 .../source/TePDILinearFilter/TePDILinearFilter.pro |    16 +-
 .../TePDILinearFilter/TePDILinearFilter_test.cpp   |   444 +-
 .../TePDILinearFilter_test.vcproj                  |   292 +-
 .../source/TePDIMIMatching/.cvsignore              |    13 +
 .../source/TePDIMIMatching/TePDIMIMatching.pro     |    14 +-
 .../TePDIMIMatching/TePDIMIMatching_test.cpp       |  1486 +-
 .../TePDIMIMatching/TePDIMIMatching_test.vcproj    |   292 +-
 .../source/TePDIMMIOMatching/.cvsignore            |    13 +
 .../source/TePDIMMIOMatching/TePDIMMIOMatching.pro |    14 +-
 .../TePDIMMIOMatching/TePDIMMIOMatching_test.cpp   |  2040 +-
 .../TePDIMMIOMatching_test.vcproj                  |   292 +-
 .../source/TePDIMathFunctions/.cvsignore           |    13 +
 .../TePDIMathFunctions/TePDIMathFunctions.pro      |     8 +-
 .../TePDIMathFunctions/TePDIMathFunctions_test.cpp |   234 +-
 .../TePDIMathFunctions_test.vcproj                 |   292 +-
 .../image_processing/source/TePDIMatrix/.cvsignore |    13 +
 .../source/TePDIMatrix/TePDIMatrix.pro             |    10 +-
 .../source/TePDIMatrix/TePDIMatrix_test.cpp        |   406 +-
 .../source/TePDIMatrix/TePDIMatrix_test.vcproj     |   292 +-
 .../source/TePDIMatrixFunctions/.cvsignore         |    13 +
 .../TePDIMatrixFunctions/TePDIMatrixFunctions.pro  |    10 +-
 .../TePDIMatrixFunctions_test.cpp                  |   244 +-
 .../TePDIMatrixFunctions_test.vcproj               |   292 +-
 .../source/TePDIMixModel/.cvsignore                |    13 +
 .../source/TePDIMixModel/TePDIMixModel.pro         |    14 +-
 .../source/TePDIMixModel/TePDIMixModel_test.cpp    |   360 +-
 .../source/TePDIMixModel/TePDIMixModel_test.vcproj |   292 +-
 .../source/TePDIMorfFilter/.cvsignore              |    13 +
 .../source/TePDIMorfFilter/TePDIMorfFilter.pro     |    16 +-
 .../TePDIMorfFilter/TePDIMorfFilter_test.cpp       |  1538 +-
 .../TePDIMorfFilter/TePDIMorfFilter_test.vcproj    |   292 +-
 .../image_processing/source/TePDIMosaic/.cvsignore |    13 +
 .../source/TePDIMosaic/TePDIMosaic.pro             |    12 +-
 .../source/TePDIMosaic/TePDIMosaic_test.cpp        |   846 +-
 .../source/TePDIMosaic/TePDIMosaic_test.vcproj     |   292 +-
 .../source/TePDIOFMatching/.cvsignore              |    13 +
 .../source/TePDIOFMatching/TePDIOFMatching.pro     |    14 +-
 .../TePDIOFMatching/TePDIOFMatching_test.cpp       |  1867 +-
 .../TePDIOFMatching/TePDIOFMatching_test.vcproj    |   292 +-
 .../source/TePDIPIManager/.cvsignore               |    13 +
 .../source/TePDIPIManager/TePDIPIManager.pro       |    10 +-
 .../source/TePDIPIManager/TePDIPIManager_test.cpp  |   129 +-
 .../TePDIPIManager/TePDIPIManager_test.vcproj      |   292 +-
 .../source/TePDIParallelSegmenter/.cvsignore       |    13 +
 .../TePDIParallelSegmenter.pro                     |     8 +
 .../TePDIParallelSegmenter.vcproj                  |   146 +
 .../TePDIParallelSegmenter_test.cpp                |   199 +
 .../source/TePDIParameters/.cvsignore              |    13 +
 .../source/TePDIParameters/TePDIParameters.pro     |     8 +-
 .../TePDIParameters/TePDIParameters_test.cpp       |   138 +-
 .../TePDIParameters/TePDIParameters_test.vcproj    |   292 +-
 .../source/TePDIPrincipalComponents/.cvsignore     |    13 +
 .../TePDIPrincipalComponents.pro                   |    12 +-
 .../TePDIPrincipalComponents_test.cpp              |   344 +-
 .../TePDIPrincipalComponents_test.vcproj           |   292 +-
 .../source/TePDIRadarFilters/.cvsignore            |    13 +
 .../source/TePDIRadarFilters/TePDIRadarFilters.pro |    12 +-
 .../TePDIRadarFilters/TePDIRadarFilters_test.cpp   |   582 +-
 .../TePDIRadarFilters_test.vcproj                  |   292 +-
 .../source/TePDIRaster2Vector/.cvsignore           |    13 +
 .../TePDIRaster2Vector/TePDIRaster2Vector.pro      |    22 +-
 .../TePDIRaster2Vector/TePDIRaster2Vector_test.cpp |  1140 +-
 .../TePDIRaster2Vector_test.vcproj                 |   292 +-
 .../source/TePDIRegister/.cvsignore                |    13 +
 .../source/TePDIRegister/TePDIRegister.pro         |    12 +-
 .../source/TePDIRegister/TePDIRegister_test.cpp    |   276 +-
 .../source/TePDIRegister/TePDIRegister_test.vcproj |   292 +-
 .../source/TePDIRgbPalette/.cvsignore              |    13 +
 .../source/TePDIRgbPalette/TePDIRgbPalette.pro     |     8 +-
 .../TePDIRgbPalette/TePDIRgbPalette_test.cpp       |    68 +-
 .../TePDIRgbPalette/TePDIRgbPalette_test.vcproj    |   292 +-
 .../source/TePDISegmentation/.cvsignore            |    13 +
 .../source/TePDISegmentation/TePDISegmentation.pro |    14 +-
 .../TePDISegmentation/TePDISegmentation_test.cpp   |   670 +-
 .../TePDISegmentation_test.vcproj                  |   292 +-
 .../source/TePDISensorSimulator/.cvsignore         |    13 +
 .../TePDISensorSimulator/TePDISensorSimulator.pro  |    12 +-
 .../TePDISensorSimulator_test.cpp                  |   134 +-
 .../TePDISensorSimulator_test.vcproj               |   292 +-
 .../source/TePDIStatistic/.cvsignore               |    13 +
 .../source/TePDIStatistic/TePDIStatistic.pro       |    10 +-
 .../source/TePDIStatistic/TePDIStatistic_test.cpp  |   698 +-
 .../TePDIStatistic/TePDIStatistic_test.vcproj      |   292 +-
 .../image_processing/source/TePDIUtils/.cvsignore  |    13 +
 .../source/TePDIUtils/TePDIUtils.pro               |    24 +-
 .../source/TePDIUtils/TePDIUtils_test.cpp          |  2085 +-
 .../source/TePDIUtils/TePDIUtils_test.vcproj       |   292 +-
 .../source/TePDIWavelets/.cvsignore                |    13 +
 .../source/TePDIWavelets/TePDIWavelets.pro         |    12 +-
 .../source/TePDIWavelets/TePDIWavelets_test.cpp    |   643 +-
 .../source/TePDIWavelets/TePDIWavelets_test.vcproj |   292 +-
 examples/image_processing/source/base/.cvsignore   |    11 +
 .../source/base/TePDIExamplesBase.hpp              |    32 +-
 examples/image_processing/source/base/base.pro     |    82 +-
 examples/image_processing/source/source.pro        |    83 +-
 examples/importCSV/.cdtproject                     |    34 +-
 examples/importCSV/.project                        |   208 +-
 examples/importCSV/Makefile                        |    60 +-
 examples/importCSV/importCSV.cpp                   |   404 +-
 examples/importCSV/importCSV.dsp                   |   252 +-
 examples/importCSV/importCSV.dsw                   |    94 +-
 examples/importCSV/importCSV.pro                   |    21 +-
 examples/importCSV/importCSV.sln                   |     0
 examples/importCSV/importCSV.vcproj                |   331 +-
 examples/importDBF/.cdtproject                     |    34 +-
 examples/importDBF/.project                        |   208 +-
 examples/importDBF/Makefile                        |    72 +-
 examples/importDBF/importDBF.cpp                   |   180 +-
 examples/importDBF/importDBF.dsp                   |   244 +-
 examples/importDBF/importDBF.dsw                   |   124 +-
 examples/importDBF/importDBF.pro                   |    19 +-
 examples/importDBF/importDBF.sln                   |     0
 examples/importDBF/importDBF.vcproj                |   328 +-
 examples/importGeoTab/.cdtproject                  |    34 +-
 examples/importGeoTab/.project                     |   216 +-
 examples/importGeoTab/Makefile                     |    58 +-
 examples/importGeoTab/importGeoTab.cpp             |   250 +-
 examples/importGeoTab/importGeoTab.dsp             |   244 +-
 examples/importGeoTab/importGeoTab.dsw             |    94 +-
 examples/importGeoTab/importGeoTab.pro             |    19 +-
 examples/importGeoTab/importGeoTab.sln             |     0
 examples/importGeoTab/importGeoTab.vcproj          |   328 +-
 examples/importGridData/.cdtproject                |    34 +-
 examples/importGridData/.project                   |   208 +-
 examples/importGridData/Makefile                   |    60 +-
 examples/importGridData/importGridData.cpp         |   250 +-
 examples/importGridData/importGridData.dsp         |   228 +-
 examples/importGridData/importGridData.dsw         |   124 +-
 examples/importGridData/importGridData.pro         |    15 +-
 examples/importGridData/importGridData.sln         |     0
 examples/importGridData/importGridData.vcproj      |   322 +-
 examples/importJPEG/.cdtproject                    |    34 +-
 examples/importJPEG/.project                       |   208 +-
 examples/importJPEG/Makefile                       |    58 +-
 examples/importJPEG/importJPEG.cpp                 |   236 +-
 examples/importJPEG/importJPEG.dsp                 |   228 +-
 examples/importJPEG/importJPEG.dsw                 |   124 +-
 examples/importJPEG/importJPEG.pro                 |    18 +-
 examples/importJPEG/importJPEG.sln                 |     0
 examples/importJPEG/importJPEG.vcproj              |   322 +-
 examples/importMIDMIF/.cdtproject                  |    34 +-
 examples/importMIDMIF/.project                     |   208 +-
 examples/importMIDMIF/Makefile                     |    56 +-
 examples/importMIDMIF/importMIDMIF.cpp             |   240 +-
 examples/importMIDMIF/importMIDMIF.dsp             |   260 +-
 examples/importMIDMIF/importMIDMIF.dsw             |    94 +-
 examples/importMIDMIF/importMIDMIF.pro             |    20 +-
 examples/importMIDMIF/importMIDMIF.sln             |     0
 examples/importMIDMIF/importMIDMIF.vcproj          |   334 +-
 examples/importShape/.cdtproject                   |    34 +-
 examples/importShape/.project                      |   208 +-
 examples/importShape/Makefile                      |    64 +-
 examples/importShape/importShape.cpp               |   264 +-
 examples/importShape/importShape.dsp               |   252 +-
 examples/importShape/importShape.dsw               |   124 +-
 examples/importShape/importShape.pro               |    21 +-
 examples/importShape/importShape.sln               |     0
 examples/importShape/importShape.vcproj            |   328 +-
 examples/mosaicTIFFImages/.cdtproject              |    34 +-
 examples/mosaicTIFFImages/.project                 |   208 +-
 examples/mosaicTIFFImages/Makefile                 |    64 +-
 examples/mosaicTIFFImages/mosaicTIFFImages.cpp     |   268 +-
 examples/mosaicTIFFImages/mosaicTIFFImages.dsp     |   228 +-
 examples/mosaicTIFFImages/mosaicTIFFImages.dsw     |    58 +-
 examples/mosaicTIFFImages/mosaicTIFFImages.pro     |    18 +-
 examples/mosaicTIFFImages/mosaicTIFFImages.sln     |     0
 examples/mosaicTIFFImages/mosaicTIFFImages.vcproj  |   328 +-
 .../proxMatrixAndSpatialStatistics/.cdtproject     |    34 +-
 examples/proxMatrixAndSpatialStatistics/.project   |   208 +-
 examples/proxMatrixAndSpatialStatistics/Makefile   |    64 +-
 .../proxMatrixAndSpatialStatistics.cpp             |   308 +-
 .../proxMatrixAndSpatialStatistics.dsp             |   244 +-
 .../proxMatrixAndSpatialStatistics.dsw             |    88 +-
 .../proxMatrixAndSpatialStatistics.pro             |    15 +-
 .../proxMatrixAndSpatialStatistics.sln             |     0
 .../proxMatrixAndSpatialStatistics.vcproj          |   380 +-
 examples/querierFromLayer/.cdtproject              |    34 +-
 examples/querierFromLayer/.project                 |   208 +-
 examples/querierFromLayer/Makefile                 |    58 +-
 examples/querierFromLayer/querierFromLayer.cpp     |   240 +-
 examples/querierFromLayer/querierFromLayer.dsp     |   228 +-
 examples/querierFromLayer/querierFromLayer.dsw     |    94 +-
 examples/querierFromLayer/querierFromLayer.pro     |    15 +-
 examples/querierFromLayer/querierFromLayer.sln     |     0
 examples/querierFromLayer/querierFromLayer.vcproj  |   379 +-
 examples/querierFromTheme/.cdtproject              |    34 +-
 examples/querierFromTheme/.project                 |   208 +-
 examples/querierFromTheme/Makefile                 |    58 +-
 examples/querierFromTheme/querierFromTheme.cpp     |   266 +-
 examples/querierFromTheme/querierFromTheme.dsp     |   228 +-
 examples/querierFromTheme/querierFromTheme.dsw     |    94 +-
 examples/querierFromTheme/querierFromTheme.pro     |    15 +-
 examples/querierFromTheme/querierFromTheme.sln     |     0
 examples/querierFromTheme/querierFromTheme.vcproj  |   379 +-
 examples/querierGroupChronon/.cdtproject           |    17 +
 examples/querierGroupChronon/.project              |   104 +
 examples/querierGroupChronon/Makefile              |    15 +
 .../querierGroupChronon/querierGroupChronon.cpp    |   137 +
 .../querierGroupChronon/querierGroupChronon.dsp    |   114 +
 .../querierGroupChronon/querierGroupChronon.dsw    |    47 +
 .../querierGroupChronon/querierGroupChronon.pro    |     6 +
 .../querierGroupChronon/querierGroupChronon.sln    |    21 +
 .../querierGroupChronon/querierGroupChronon.vcproj |   177 +
 examples/querierGroupElement/.cdtproject           |    17 +
 examples/querierGroupElement/.project              |   104 +
 examples/querierGroupElement/Makefile              |    14 +
 .../querierGroupElement/querierGroupElement.cpp    |   122 +
 .../querierGroupElement/querierGroupElement.dsp    |   114 +
 .../querierGroupElement/querierGroupElement.dsw    |    47 +
 .../querierGroupElement/querierGroupElement.pro    |     6 +
 .../querierGroupElement/querierGroupElement.sln    |    21 +
 .../querierGroupElement/querierGroupElement.vcproj |   177 +
 examples/querierGroupSpatialRest/.cdtproject       |    17 +
 examples/querierGroupSpatialRest/.project          |   104 +
 examples/querierGroupSpatialRest/Makefile          |    14 +
 .../querierGroupSpatialRest.cpp                    |   159 +
 .../querierGroupSpatialRest.dsp                    |   114 +
 .../querierGroupSpatialRest.dsw                    |    47 +
 .../querierGroupSpatialRest.pro                    |     6 +
 .../querierGroupSpatialRest.sln                    |    21 +
 .../querierGroupSpatialRest.vcproj                 |   177 +
 examples/querierWithSpatialRestBox/.cdtproject     |    17 +
 examples/querierWithSpatialRestBox/.project        |   104 +
 examples/querierWithSpatialRestBox/Makefile        |    14 +
 .../querierWithSpatialRestBox.cpp                  |   112 +
 .../querierWithSpatialRestBox.dsp                  |   114 +
 .../querierWithSpatialRestBox.dsw                  |    47 +
 .../querierWithSpatialRestBox.pro                  |     6 +
 .../querierWithSpatialRestBox.sln                  |    21 +
 .../querierWithSpatialRestBox.vcproj               |   177 +
 .../querierWithSpatialRestGeometry/.cdtproject     |    17 +
 examples/querierWithSpatialRestGeometry/.project   |   104 +
 examples/querierWithSpatialRestGeometry/Makefile   |    14 +
 .../querierWithSpatialRestGeometry.cpp             |   151 +
 .../querierWithSpatialRestGeometry.dsp             |   114 +
 .../querierWithSpatialRestGeometry.dsw             |    47 +
 .../querierWithSpatialRestGeometry.pro             |     6 +
 .../querierWithSpatialRestGeometry.sln             |    21 +
 .../querierWithSpatialRestGeometry.vcproj          |   177 +
 examples/rasterSlicing/.cdtproject                 |    34 +-
 examples/rasterSlicing/.project                    |   208 +-
 examples/rasterSlicing/Makefile                    |    58 +-
 examples/rasterSlicing/rasterSlicing.cpp           |   402 +-
 examples/rasterSlicing/rasterSlicing.dsp           |   228 +-
 examples/rasterSlicing/rasterSlicing.dsw           |    58 +-
 examples/rasterSlicing/rasterSlicing.pro           |    16 +-
 examples/rasterSlicing/rasterSlicing.sln           |     0
 examples/rasterSlicing/rasterSlicing.vcproj        |   322 +-
 examples/spatialQuery/.cdtproject                  |    34 +-
 examples/spatialQuery/.project                     |   208 +-
 examples/spatialQuery/Makefile                     |    60 +-
 examples/spatialQuery/spatialQuery.cpp             |   372 +-
 examples/spatialQuery/spatialQuery.dsp             |   252 +-
 examples/spatialQuery/spatialQuery.dsw             |   124 +-
 examples/spatialQuery/spatialQuery.pro             |    20 +-
 examples/spatialQuery/spatialQuery.sln             |     0
 examples/spatialQuery/spatialQuery.vcproj          |   349 +-
 examples/spatialQueryAndBuffer/.cdtproject         |    34 +-
 examples/spatialQueryAndBuffer/.project            |   208 +-
 examples/spatialQueryAndBuffer/Makefile            |    58 +-
 .../spatialQueryAndBuffer.cpp                      |   220 +-
 .../spatialQueryAndBuffer.dsp                      |   252 +-
 .../spatialQueryAndBuffer.dsw                      |   124 +-
 .../spatialQueryAndBuffer.pro                      |    21 +-
 .../spatialQueryAndBuffer.sln                      |     0
 .../spatialQueryAndBuffer.vcproj                   |   343 +-
 examples/themeGrouping/.cdtproject                 |    34 +-
 examples/themeGrouping/.project                    |   208 +-
 examples/themeGrouping/Makefile                    |    58 +-
 examples/themeGrouping/themeGrouping.cpp           |   242 +-
 examples/themeGrouping/themeGrouping.dsp           |   228 +-
 examples/themeGrouping/themeGrouping.dsw           |    94 +-
 examples/themeGrouping/themeGrouping.pro           |    15 +-
 examples/themeGrouping/themeGrouping.sln           |     0
 examples/themeGrouping/themeGrouping.vcproj        |   377 +-
 src/DSDK/include/base/lt_cacheStatus.h             |    28 +
 src/DSDK/include/base/lt_encryptStatus.h           |    63 +
 src/DSDK/include/base/lti_bbbImageReader.h         |   154 +
 src/DSDK/include/base/lti_bbbImageWriter.h         |    71 +
 src/DSDK/include/base/lti_coreStatus.h             |   142 +
 src/DSDK/include/base/lti_delegates.h              |    97 +
 src/DSDK/include/base/lti_geoCoord.h               |   393 +
 src/DSDK/include/base/lti_geoFileImageWriter.h     |   173 +
 src/DSDK/include/base/lti_geoImageReader.h         |    71 +
 src/DSDK/include/base/lti_image.h                  |   672 +
 src/DSDK/include/base/lti_imageFilter.h            |   114 +
 src/DSDK/include/base/lti_imageReader.h            |    87 +
 src/DSDK/include/base/lti_imageStage.h             |   414 +
 src/DSDK/include/base/lti_imageStageManager.h      |    84 +
 src/DSDK/include/base/lti_imageWriter.h            |   276 +
 src/DSDK/include/base/lti_navigator.h              |   393 +
 src/DSDK/include/base/lti_pixel.h                  |   444 +
 src/DSDK/include/base/lti_pixelLookupTable.h       |   142 +
 src/DSDK/include/base/lti_rawImageReader.h         |   308 +
 src/DSDK/include/base/lti_rawImageWriter.h         |   104 +
 src/DSDK/include/base/lti_sample.h                 |   220 +
 src/DSDK/include/base/lti_scene.h                  |   488 +
 src/DSDK/include/base/lti_sceneBuffer.h            |   642 +
 src/DSDK/include/base/lti_types.h                  |   194 +
 src/DSDK/include/base/lti_utils.h                  |   202 +
 src/DSDK/include/base/lti_version.h                |    22 +
 src/DSDK/include/base/mg2_status.h                 |   332 +
 src/DSDK/include/base/mg3_status.h                 |   215 +
 src/DSDK/include/c_api/lt_ioCStream.h              |   212 +
 src/DSDK/include/c_api/ltic_api.h                  |   462 +
 src/DSDK/include/filters/lti_bandSelectFilter.h    |   208 +
 src/DSDK/include/filters/lti_colorTransformer.h    |   101 +
 src/DSDK/include/filters/lti_cropFilter.h          |   100 +
 src/DSDK/include/filters/lti_datatypeTransformer.h |    84 +
 src/DSDK/include/filters/lti_dynamicRangeFilter.h  |   148 +
 src/DSDK/include/filters/lti_embeddedImage.h       |   148 +
 src/DSDK/include/filters/lti_filtersStatus.h       |    99 +
 src/DSDK/include/filters/lti_mosaicFilter.h        |   184 +
 src/DSDK/include/filters/lti_multiresFilter.h      |   161 +
 src/DSDK/include/filters/lti_staticZoomFilter.h    |    79 +
 src/DSDK/include/filters/lti_statisticsFilter.h    |    95 +
 src/DSDK/include/filters/lti_translationFilter.h   |    80 +
 src/DSDK/include/filters/lti_viewerImageFilter.h   |    94 +
 src/DSDK/include/filters/lti_watermarkFilter.h     |    97 +
 src/DSDK/include/j2k_readers/J2KImageReader.h      |   304 +
 src/DSDK/include/j2k_readers/NITFImageManager.h    |   246 +
 src/DSDK/include/j2k_readers/NITFImageReader.h     |   170 +
 src/DSDK/include/j2k_readers/j2k_types.h           |    73 +
 src/DSDK/include/j2k_readers/lti_j2kStatus.h       |   160 +
 src/DSDK/include/j2k_readers/lti_nitfStatus.h      |   111 +
 src/DSDK/include/j2k_readers/nitf_types.h          |    73 +
 src/DSDK/include/metadata/lti_geoMetadataStatus.h  |    62 +
 src/DSDK/include/metadata/lti_metadataDatabase.h   |   269 +
 src/DSDK/include/metadata/lti_metadataDumper.h     |   109 +
 src/DSDK/include/metadata/lti_metadataReader.h     |    89 +
 src/DSDK/include/metadata/lti_metadataRecord.h     |   331 +
 src/DSDK/include/metadata/lti_metadataStatus.h     |    47 +
 src/DSDK/include/metadata/lti_metadataTypes.h      |   187 +
 src/DSDK/include/metadata/lti_metadataUtils.h      |    82 +
 src/DSDK/include/metadata/lti_metadataWriter.h     |    90 +
 .../mrsid_readers/MG3CompositeImageReader.h        |   272 +
 src/DSDK/include/mrsid_readers/MrSIDImageReader.h  |   184 +
 .../include/mrsid_readers/MrSIDImageReaderBase.h   |   235 +
 .../include/mrsid_readers/MrSIDPasswordDelegate.h  |   171 +
 .../include/mrsid_readers/lti_mrsidReadersStatus.h |    67 +
 src/DSDK/include/support/lt_base.h                 |    30 +
 src/DSDK/include/support/lt_define.h               |   154 +
 src/DSDK/include/support/lt_fileSpec.h             |   251 +
 src/DSDK/include/support/lt_ioBufferedStream.h     |    79 +
 src/DSDK/include/support/lt_ioCallbackStream.h     |   121 +
 .../include/support/lt_ioCallbackStreamTypes.h     |   133 +
 src/DSDK/include/support/lt_ioDynamicMemStream.h   |   196 +
 src/DSDK/include/support/lt_ioFile64Stream.h       |   242 +
 src/DSDK/include/support/lt_ioFileStream.h         |   249 +
 src/DSDK/include/support/lt_ioMemStream.h          |    91 +
 src/DSDK/include/support/lt_ioStatus.h             |    55 +
 src/DSDK/include/support/lt_ioStreamInf.h          |   218 +
 src/DSDK/include/support/lt_ioSubStream.h          |   233 +
 src/DSDK/include/support/lt_lib_io.h               |    63 +
 src/DSDK/include/support/lt_platform.h             |   223 +
 src/DSDK/include/support/lt_status.h               |   151 +
 src/DSDK/include/support/lt_system.h               |    94 +
 src/DSDK/include/support/lt_types.h                |   146 +
 src/DSDK/include/support/lt_utilStatus.h           |   125 +
 src/DSDK/include/support/lt_utilStatusData.h       |   169 +
 src/DSDK/include/support/lt_utilStatusStrings.h    |    86 +
 src/DSDK/include/writers/BMPImageWriter.h          |   102 +
 src/DSDK/include/writers/GeoTIFFImageWriter.h      |    57 +
 src/DSDK/include/writers/JpegImageWriter.h         |    94 +
 src/DSDK/include/writers/PNGImageWriter.h          |    75 +
 src/DSDK/include/writers/TIFFImageWriter.h         |    91 +
 src/DSDK/include/writers/lti_writersStatus.h       |   104 +
 src/appUtils/TeAppTheme.cpp                        |   519 +
 src/appUtils/TeAppTheme.h                          |   325 +
 src/appUtils/TeAppUtilsDefines.h                   |    49 +
 src/appUtils/TeApplicationUtils.cpp                |  3383 +
 src/appUtils/TeApplicationUtils.h                  |   644 +
 src/appUtils/TePlotTheme.h                         |  2680 +
 src/appUtils/TePlotView.h                          |    45 +
 src/appUtils/ui/animation.ui                       |   366 +
 src/appUtils/ui/animation.ui.h                     |   241 +
 src/appUtils/ui/help.ui                            |   368 +
 src/appUtils/ui/help.ui.h                          |   204 +
 src/appUtils/ui/mediaDescription.ui                |   226 +
 src/appUtils/ui/mediaDescription.ui.h              |    54 +
 src/appUtils/ui/urlWindow.ui                       |   246 +
 src/appUtils/ui/urlWindow.ui.h                     |    51 +
 src/dxflib/dl_attributes.h                         |   182 +
 src/dxflib/dl_codes.h                              |   542 +
 src/dxflib/dl_creationadapter.h                    |   102 +
 src/dxflib/dl_creationinterface.h                  |   266 +
 src/dxflib/dl_dxf.cpp                              |  5070 ++
 src/dxflib/dl_dxf.h                                |   430 +
 src/dxflib/dl_entities.h                           |  1451 +
 src/dxflib/dl_exception.h                          |    55 +
 src/dxflib/dl_extrusion.h                          |   144 +
 src/dxflib/dl_writer.h                             |   618 +
 src/dxflib/dl_writer_ascii.cpp                     |   153 +
 src/dxflib/dl_writer_ascii.h                       |    75 +
 src/libjpeg/ansi2knr.c                             |   693 +
 src/libjpeg/cderror.h                              |   132 +
 src/libjpeg/cdjpeg.h                               |   184 +
 src/libjpeg/ckconfig.c                             |   402 +
 src/libjpeg/jcapimin.c                             |   280 +
 src/libjpeg/jcapistd.c                             |   161 +
 src/libjpeg/jccoefct.c                             |   449 +
 src/libjpeg/jccolor.c                              |   459 +
 src/libjpeg/jcdctmgr.c                             |   387 +
 src/libjpeg/jchuff.c                               |   909 +
 src/libjpeg/jchuff.h                               |    47 +
 src/libjpeg/jcinit.c                               |    72 +
 src/libjpeg/jcmainct.c                             |   293 +
 src/libjpeg/jcmarker.c                             |   664 +
 src/libjpeg/jcmaster.c                             |   590 +
 src/libjpeg/jcomapi.c                              |   106 +
 src/libjpeg/jconfig.h                              |    45 +
 src/libjpeg/jcparam.c                              |   610 +
 src/libjpeg/jcphuff.c                              |   833 +
 src/libjpeg/jcprepct.c                             |   354 +
 src/libjpeg/jcsample.c                             |   519 +
 src/libjpeg/jctrans.c                              |   388 +
 src/libjpeg/jdapimin.c                             |   395 +
 src/libjpeg/jdapistd.c                             |   275 +
 src/libjpeg/jdatadst.c                             |   151 +
 src/libjpeg/jdatasrc.c                             |   212 +
 src/libjpeg/jdcoefct.c                             |   736 +
 src/libjpeg/jdcolor.c                              |   396 +
 src/libjpeg/jdct.h                                 |   176 +
 src/libjpeg/jddctmgr.c                             |   269 +
 src/libjpeg/jdhuff.c                               |   651 +
 src/libjpeg/jdhuff.h                               |   201 +
 src/libjpeg/jdinput.c                              |   381 +
 src/libjpeg/jdmainct.c                             |   512 +
 src/libjpeg/jdmarker.c                             |  1360 +
 src/libjpeg/jdmaster.c                             |   557 +
 src/libjpeg/jdmerge.c                              |   400 +
 src/libjpeg/jdphuff.c                              |   668 +
 src/libjpeg/jdpostct.c                             |   290 +
 src/libjpeg/jdsample.c                             |   478 +
 src/libjpeg/jdtrans.c                              |   143 +
 src/libjpeg/jerror.c                               |   252 +
 src/libjpeg/jerror.h                               |   291 +
 src/libjpeg/jfdctflt.c                             |   168 +
 src/libjpeg/jfdctfst.c                             |   224 +
 src/libjpeg/jfdctint.c                             |   283 +
 src/libjpeg/jidctflt.c                             |   242 +
 src/libjpeg/jidctfst.c                             |   368 +
 src/libjpeg/jidctint.c                             |   389 +
 src/libjpeg/jidctred.c                             |   398 +
 src/libjpeg/jinclude.h                             |    91 +
 src/libjpeg/jmemansi.c                             |   167 +
 src/libjpeg/jmemmgr.c                              |  1118 +
 src/libjpeg/jmemname.c                             |   276 +
 src/libjpeg/jmemnobs.c                             |   109 +
 src/libjpeg/jmemsys.h                              |   198 +
 src/libjpeg/jmorecfg.h                             |   363 +
 src/libjpeg/jpegint.h                              |   392 +
 src/libjpeg/jpeglib.h                              |  1096 +
 src/libjpeg/jpegtran.c                             |   504 +
 src/libjpeg/jquant1.c                              |   856 +
 src/libjpeg/jquant2.c                              |  1310 +
 src/libjpeg/jutils.c                               |   179 +
 src/libjpeg/jversion.h                             |    14 +
 src/libjpeg/rdbmp.c                                |   439 +
 src/libjpeg/rdcolmap.c                             |   253 +
 src/libjpeg/rdgif.c                                |    38 +
 src/libjpeg/rdjpgcom.c                             |   496 +
 src/libjpeg/rdppm.c                                |   458 +
 src/libjpeg/rdrle.c                                |   387 +
 src/libjpeg/rdswitch.c                             |   332 +
 src/libjpeg/rdtarga.c                              |   500 +
 src/libjpeg/transupp.c                             |   928 +
 src/libjpeg/transupp.h                             |   135 +
 src/libjpeg/wrbmp.c                                |   442 +
 src/libjpeg/wrgif.c                                |   399 +
 src/libjpeg/wrjpgcom.c                             |   583 +
 src/libjpeg/wrppm.c                                |   268 +
 src/libjpeg/wrrle.c                                |   305 +
 src/libjpeg/wrtarga.c                              |   253 +
 src/libspl/include/spl_mutex.h                     |   141 +
 src/libspl/include/spl_platform.h                  |   122 +
 src/libspl/include/spl_pluginargs.h                |   153 +
 src/libspl/include/spl_plugininfo.h                |   259 +
 src/libspl/include/spl_pluginserver.h              |   289 +
 src/libspl/include/spl_pluginserver_linux.h        |   173 +
 src/libspl/include/spl_pluginserver_solaris.h      |   173 +
 src/libspl/include/spl_pluginserver_win32.h        |   186 +
 src/libspl/include/spl_threadlock.h                |   132 +
 src/libspl/include/spl_typedefs.h                  |    94 +
 src/libspl/source/spl_mutex.cpp                    |   143 +
 src/libspl/source/spl_pluginargs.cpp               |   157 +
 src/libspl/source/spl_plugininfo.cpp               |   423 +
 src/libspl/source/spl_pluginserver.cpp             |    95 +
 src/libspl/source/spl_pluginserver_linux.cpp       |   466 +
 src/libspl/source/spl_pluginserver_solaris.cpp     |   476 +
 src/libspl/source/spl_pluginserver_win32.cpp       |   450 +
 src/libspl/source/spl_threadlock.cpp               |    84 +
 src/libspl/spl.h                                   |   264 +
 src/qwt/include/qwt.h                              |    22 +
 src/qwt/include/qwt_abstract_scale.h               |    67 +
 src/qwt/include/qwt_abstract_scale_draw.h          |   141 +
 src/qwt/include/qwt_abstract_slider.h              |   182 +
 src/qwt/include/qwt_analog_clock.h                 |    85 +
 src/qwt/include/qwt_array.h                        |    29 +
 src/qwt/include/qwt_arrow_button.h                 |    54 +
 src/qwt/include/qwt_compass.h                      |    80 +
 src/qwt/include/qwt_compass_rose.h                 |    70 +
 src/qwt/include/qwt_counter.h                      |   153 +
 src/qwt/include/qwt_data.h                         |   159 +
 src/qwt/include/qwt_dial.h                         |   209 +
 src/qwt/include/qwt_dial_needle.h                  |   195 +
 src/qwt/include/qwt_double_interval.h              |   151 +
 src/qwt/include/qwt_double_range.h                 |    88 +
 src/qwt/include/qwt_double_rect.h                  |   440 +
 src/qwt/include/qwt_dyngrid_layout.h               |   101 +
 src/qwt/include/qwt_event_pattern.h                |   219 +
 src/qwt/include/qwt_global.h                       |    65 +
 src/qwt/include/qwt_interval_data.h                |    70 +
 src/qwt/include/qwt_knob.h                         |    96 +
 src/qwt/include/qwt_layout_metrics.h               |   153 +
 src/qwt/include/qwt_legend.h                       |   124 +
 src/qwt/include/qwt_legend_item.h                  |   109 +
 src/qwt/include/qwt_math.h                         |   175 +
 src/qwt/include/qwt_paint_buffer.h                 |    65 +
 src/qwt/include/qwt_painter.h                      |   140 +
 src/qwt/include/qwt_picker.h                       |   377 +
 src/qwt/include/qwt_picker_machine.h               |   152 +
 src/qwt/include/qwt_plot.h                         |   318 +
 src/qwt/include/qwt_plot_canvas.h                  |   117 +
 src/qwt/include/qwt_plot_curve.h                   |   260 +
 src/qwt/include/qwt_plot_dict.h                    |    51 +
 src/qwt/include/qwt_plot_grid.h                    |    87 +
 src/qwt/include/qwt_plot_item.h                    |   109 +
 src/qwt/include/qwt_plot_layout.h                  |    87 +
 src/qwt/include/qwt_plot_marker.h                  |   103 +
 src/qwt/include/qwt_plot_picker.h                  |   122 +
 src/qwt/include/qwt_plot_printfilter.h             |    79 +
 src/qwt/include/qwt_plot_zoomer.h                  |   127 +
 src/qwt/include/qwt_rect.h                         |    50 +
 src/qwt/include/qwt_round_scale_draw.h             |    72 +
 src/qwt/include/qwt_scale_div.h                    |   132 +
 src/qwt/include/qwt_scale_draw.h                   |   107 +
 src/qwt/include/qwt_scale_engine.h                 |   180 +
 src/qwt/include/qwt_scale_map.h                    |   167 +
 src/qwt/include/qwt_scale_widget.h                 |   105 +
 src/qwt/include/qwt_slider.h                       |   117 +
 src/qwt/include/qwt_spline.h                       |    82 +
 src/qwt/include/qwt_symbol.h                       |    66 +
 src/qwt/include/qwt_text.h                         |   112 +
 src/qwt/include/qwt_text_engine.h                  |   121 +
 src/qwt/include/qwt_text_label.h                   |    72 +
 src/qwt/include/qwt_thermo.h                       |   168 +
 src/qwt/include/qwt_wheel.h                        |    79 +
 src/qwt/qwt_abstract_scale.cpp                     |   300 +
 src/qwt/qwt_abstract_scale_draw.cpp                |   397 +
 src/qwt/qwt_abstract_slider.cpp                    |   565 +
 src/qwt/qwt_analog_clock.cpp                       |   213 +
 src/qwt/qwt_arrow_button.cpp                       |   362 +
 src/qwt/qwt_compass.cpp                            |   287 +
 src/qwt/qwt_compass_rose.cpp                       |   238 +
 src/qwt/qwt_counter.cpp                            |   603 +
 src/qwt/qwt_data.cpp                               |   294 +
 src/qwt/qwt_dial.cpp                               |  1216 +
 src/qwt/qwt_dial_needle.cpp                        |   546 +
 src/qwt/qwt_double_interval.cpp                    |   149 +
 src/qwt/qwt_double_range.cpp                       |   389 +
 src/qwt/qwt_double_rect.cpp                        |   592 +
 src/qwt/qwt_dyngrid_layout.cpp                     |   691 +
 src/qwt/qwt_event_pattern.cpp                      |   288 +
 src/qwt/qwt_interval_data.cpp                      |    74 +
 src/qwt/qwt_knob.cpp                               |   524 +
 src/qwt/qwt_layout_metrics.cpp                     |   309 +
 src/qwt/qwt_legend.cpp                             |   595 +
 src/qwt/qwt_legend_item.cpp                        |   459 +
 src/qwt/qwt_math.cpp                               |    47 +
 src/qwt/qwt_paint_buffer.cpp                       |   201 +
 src/qwt/qwt_painter.cpp                            |   545 +
 src/qwt/qwt_picker.cpp                             |  1294 +
 src/qwt/qwt_picker_machine.cpp                     |   371 +
 src/qwt/qwt_plot.cpp                               |   839 +
 src/qwt/qwt_plot_axis.cpp                          |   603 +
 src/qwt/qwt_plot_canvas.cpp                        |   355 +
 src/qwt/qwt_plot_curve.cpp                         |  1469 +
 src/qwt/qwt_plot_dict.cpp                          |   185 +
 src/qwt/qwt_plot_grid.cpp                          |   349 +
 src/qwt/qwt_plot_item.cpp                          |   295 +
 src/qwt/qwt_plot_layout.cpp                        |  1165 +
 src/qwt/qwt_plot_marker.cpp                        |   386 +
 src/qwt/qwt_plot_picker.cpp                        |   405 +
 src/qwt/qwt_plot_print.cpp                         |   487 +
 src/qwt/qwt_plot_printfilter.cpp                   |   593 +
 src/qwt/qwt_plot_zoomer.cpp                        |   637 +
 src/qwt/qwt_rect.cpp                               |   157 +
 src/qwt/qwt_round_scale_draw.cpp                   |   392 +
 src/qwt/qwt_scale_div.cpp                          |   146 +
 src/qwt/qwt_scale_draw.cpp                         |   833 +
 src/qwt/qwt_scale_engine.cpp                       |   916 +
 src/qwt/qwt_scale_map.cpp                          |   251 +
 src/qwt/qwt_scale_widget.cpp                       |   707 +
 src/qwt/qwt_slider.cpp                             |   796 +
 src/qwt/qwt_spline.cpp                             |   381 +
 src/qwt/qwt_symbol.cpp                             |   265 +
 src/qwt/qwt_text.cpp                               |   389 +
 src/qwt/qwt_text_engine.cpp                        |   314 +
 src/qwt/qwt_text_label.cpp                         |   304 +
 src/qwt/qwt_thermo.cpp                             |   810 +
 src/qwt/qwt_wheel.cpp                              |   637 +
 src/shapelib/dbfopen.c                             |  1539 +
 src/shapelib/shapefil.h                            |   493 +
 src/shapelib/shpopen.c                             |  1869 +
 src/terralib/drivers/DXF/TeDXFDriver.cpp           |   107 +
 src/terralib/drivers/DXF/TeDXFDriver.h             |    92 +
 src/terralib/drivers/DXF/TeDXFDriverFactory.cpp    |    28 +
 src/terralib/drivers/DXF/TeDXFDriverFactory.h      |    28 +
 src/terralib/drivers/DXF/tedxfdefines.h            |    15 +
 src/terralib/drivers/DXF/tedxflayer.cpp            |    58 +
 src/terralib/drivers/DXF/tedxflayer.h              |    90 +
 src/terralib/drivers/DXF/tedxfvisitor.cpp          |    81 +
 src/terralib/drivers/DXF/tedxfvisitor.h            |    89 +
 src/terralib/drivers/Firebird/TeFirebird.cpp       |  3597 +
 src/terralib/drivers/Firebird/TeFirebird.h         |   316 +
 src/terralib/drivers/Firebird/TeFirebirdDefines.h  |    49 +
 src/terralib/drivers/Firebird/ibpp/core/_dpb.cpp   |   119 +
 src/terralib/drivers/Firebird/ibpp/core/_ibpp.cpp  |   369 +
 src/terralib/drivers/Firebird/ibpp/core/_ibpp.h    |  1414 +
 src/terralib/drivers/Firebird/ibpp/core/_ibs.cpp   |   108 +
 src/terralib/drivers/Firebird/ibpp/core/_rb.cpp    |   204 +
 src/terralib/drivers/Firebird/ibpp/core/_spb.cpp   |   134 +
 src/terralib/drivers/Firebird/ibpp/core/_tpb.cpp   |    99 +
 .../drivers/Firebird/ibpp/core/all_in_one.cpp      |    56 +
 src/terralib/drivers/Firebird/ibpp/core/array.cpp  |  1046 +
 src/terralib/drivers/Firebird/ibpp/core/blob.cpp   |   380 +
 .../drivers/Firebird/ibpp/core/database.cpp        |   481 +
 src/terralib/drivers/Firebird/ibpp/core/date.cpp   |   209 +
 src/terralib/drivers/Firebird/ibpp/core/dbkey.cpp  |   120 +
 src/terralib/drivers/Firebird/ibpp/core/events.cpp |   372 +
 .../drivers/Firebird/ibpp/core/exception.cpp       |   351 +
 src/terralib/drivers/Firebird/ibpp/core/ibase.h    |  2714 +
 src/terralib/drivers/Firebird/ibpp/core/iberror.h  |  1613 +
 src/terralib/drivers/Firebird/ibpp/core/ibpp.h     |   930 +
 src/terralib/drivers/Firebird/ibpp/core/row.cpp    |  1580 +
 .../drivers/Firebird/ibpp/core/service.cpp         |   774 +
 .../drivers/Firebird/ibpp/core/statement.cpp       |  1306 +
 src/terralib/drivers/Firebird/ibpp/core/time.cpp   |   208 +
 .../drivers/Firebird/ibpp/core/transaction.cpp     |   409 +
 src/terralib/drivers/Firebird/ibpp/core/user.cpp   |    70 +
 src/terralib/drivers/GL/amesa.h                    |    65 +
 src/terralib/drivers/GL/directfbgl.h               |    89 +
 src/terralib/drivers/GL/dmesa.h                    |   160 +
 src/terralib/drivers/GL/dri_interface.h            |   477 +
 src/terralib/drivers/GL/fxmesa.h                   |   103 +
 src/terralib/drivers/GL/ggimesa.h                  |    85 +
 src/terralib/drivers/GL/gl.h                       |  2323 +
 src/terralib/drivers/GL/gl_mangle.h                |  1474 +
 src/terralib/drivers/GL/glcore.h                   |   499 +
 src/terralib/drivers/GL/glext.h                    |  6495 ++
 src/terralib/drivers/GL/glfbdev.h                  |   148 +
 src/terralib/drivers/GL/glu.h                      |   340 +
 src/terralib/drivers/GL/glu_mangle.h               |    86 +
 src/terralib/drivers/GL/glut.h                     |   748 +
 src/terralib/drivers/GL/glutf90.h                  |    81 +
 src/terralib/drivers/GL/glx.h                      |   486 +
 src/terralib/drivers/GL/glx_mangle.h               |    55 +
 src/terralib/drivers/GL/glxext.h                   |   693 +
 src/terralib/drivers/GL/glxint.h                   |   129 +
 src/terralib/drivers/GL/glxmd.h                    |    58 +
 src/terralib/drivers/GL/glxproto.h                 |  2527 +
 src/terralib/drivers/GL/glxtokens.h                |   286 +
 src/terralib/drivers/GL/internal/dri_interface.h   |   477 +
 src/terralib/drivers/GL/internal/glcore.h          |   499 +
 src/terralib/drivers/GL/mesa_wgl.h                 |   132 +
 src/terralib/drivers/GL/mglmesa.h                  |    79 +
 src/terralib/drivers/GL/osmesa.h                   |   289 +
 src/terralib/drivers/GL/svgamesa.h                 |    97 +
 src/terralib/drivers/GL/uglglutshapes.h            |    45 +
 src/terralib/drivers/GL/uglmesa.h                  |   155 +
 src/terralib/drivers/GL/vms_x_fix.h                |   880 +
 src/terralib/drivers/GL/wmesa.h                    |   141 +
 src/terralib/drivers/GL/xmesa.h                    |   390 +
 src/terralib/drivers/GL/xmesa_x.h                  |    85 +
 src/terralib/drivers/GL/xmesa_xf86.h               |   165 +
 src/terralib/drivers/GTM/TeGTM.cpp                 |  2026 +
 src/terralib/drivers/GTM/TeGTM.h                   |  1688 +
 src/terralib/drivers/MrSID/TeDecoderMrSID.cpp      |   524 +-
 src/terralib/drivers/MrSID/TeDecoderMrSID.h        |   290 +-
 src/terralib/drivers/MrSID/TeMrSID.cpp             |  1120 +-
 src/terralib/drivers/MrSID/TeMrSID.h               |   420 +-
 src/terralib/drivers/MySQL/TeMySQL.cpp             |  5756 +-
 src/terralib/drivers/MySQL/TeMySQL.h               |   584 +-
 src/terralib/drivers/MySQL/TeMySQLDefines.h        |    49 +
 .../drivers/MySQL/include/config-netware.h         |   137 +
 src/terralib/drivers/MySQL/include/config-os2.h    |   835 +
 src/terralib/drivers/MySQL/include/config-win.h    |   436 +
 src/terralib/drivers/MySQL/include/errmsg.h        |   102 +
 src/terralib/drivers/MySQL/include/libmysql.def    |   154 +
 src/terralib/drivers/MySQL/include/libmysqld.def   |   159 +
 src/terralib/drivers/MySQL/include/m_ctype.h       |   478 +
 src/terralib/drivers/MySQL/include/m_string.h      |   262 +
 src/terralib/drivers/MySQL/include/my_alloc.h      |    52 +
 src/terralib/drivers/MySQL/include/my_dbug.h       |   101 +
 src/terralib/drivers/MySQL/include/my_getopt.h     |    77 +
 src/terralib/drivers/MySQL/include/my_global.h     |  1276 +
 src/terralib/drivers/MySQL/include/my_list.h       |    46 +
 src/terralib/drivers/MySQL/include/my_pthread.h    |   711 +
 src/terralib/drivers/MySQL/include/my_sys.h        |   903 +
 src/terralib/drivers/MySQL/include/mysql.h         |   839 +
 src/terralib/drivers/MySQL/include/mysql_com.h     |   444 +
 src/terralib/drivers/MySQL/include/mysql_embed.h   |    32 +
 src/terralib/drivers/MySQL/include/mysql_time.h    |    56 +
 src/terralib/drivers/MySQL/include/mysql_version.h |    29 +
 src/terralib/drivers/MySQL/include/mysqld_ername.h |   456 +
 src/terralib/drivers/MySQL/include/mysqld_error.h  |   458 +
 src/terralib/drivers/MySQL/include/raid.h          |   159 +
 src/terralib/drivers/MySQL/include/typelib.h       |    34 +
 src/terralib/drivers/Oracle/OCI/include/cdemodp0.h |   109 +
 src/terralib/drivers/Oracle/OCI/include/kusapi.h   |   775 +
 src/terralib/drivers/Oracle/OCI/include/kustags.h  |  1034 +
 src/terralib/drivers/Oracle/OCI/include/nzerror.h  |   644 +
 src/terralib/drivers/Oracle/OCI/include/nzt.h      |  2750 +
 src/terralib/drivers/Oracle/OCI/include/occi.h     |    78 +
 src/terralib/drivers/Oracle/OCI/include/occiAQ.h   |   374 +
 .../drivers/Oracle/OCI/include/occiCommon.h        |   872 +
 .../drivers/Oracle/OCI/include/occiControl.h       |  2060 +
 src/terralib/drivers/Oracle/OCI/include/occiData.h |   936 +
 .../drivers/Oracle/OCI/include/occiObjects.h       |   990 +
 src/terralib/drivers/Oracle/OCI/include/oci.h      |  2366 +
 src/terralib/drivers/Oracle/OCI/include/oci1.h     |   183 +
 src/terralib/drivers/Oracle/OCI/include/oci8dp.h   |   315 +
 src/terralib/drivers/Oracle/OCI/include/ociap.h    | 10240 +++
 src/terralib/drivers/Oracle/OCI/include/ociapr.h   |   157 +
 src/terralib/drivers/Oracle/OCI/include/ocidef.h   |   888 +
 src/terralib/drivers/Oracle/OCI/include/ocidem.h   |   112 +
 src/terralib/drivers/Oracle/OCI/include/ocidfn.h   |   253 +
 src/terralib/drivers/Oracle/OCI/include/ociextp.h  |   281 +
 src/terralib/drivers/Oracle/OCI/include/ocikp.h    | 10223 +++
 src/terralib/drivers/Oracle/OCI/include/ocikpr.h   |   168 +
 src/terralib/drivers/Oracle/OCI/include/ocixad.h   |   316 +
 src/terralib/drivers/Oracle/OCI/include/ocixmldb.h |   139 +
 src/terralib/drivers/Oracle/OCI/include/odci.h     |   657 +
 src/terralib/drivers/Oracle/OCI/include/oratypes.h |   295 +
 src/terralib/drivers/Oracle/OCI/include/ori.h      |  2094 +
 src/terralib/drivers/Oracle/OCI/include/orid.h     |   372 +
 src/terralib/drivers/Oracle/OCI/include/orl.h      |  3628 +
 src/terralib/drivers/Oracle/OCI/include/oro.h      |   883 +
 src/terralib/drivers/Oracle/OCI/include/ort.h      |  2593 +
 src/terralib/drivers/Oracle/TeOCIConnect.cpp       |   456 +
 src/terralib/drivers/Oracle/TeOCIConnect.h         |   136 +
 src/terralib/drivers/Oracle/TeOCICursor.cpp        |  1391 +
 src/terralib/drivers/Oracle/TeOCICursor.h          |   300 +
 src/terralib/drivers/Oracle/TeOCIOracle.cpp        |  3589 +
 src/terralib/drivers/Oracle/TeOCIOracle.h          |   352 +
 src/terralib/drivers/Oracle/TeOCISDO.cpp           |  3097 +
 src/terralib/drivers/Oracle/TeOCISDO.h             |  1310 +
 src/terralib/drivers/Oracle/TeOracleDefines.h      |    49 +
 src/terralib/drivers/Oracle/TeOracleSpatial.cpp    |  3588 +
 src/terralib/drivers/Oracle/TeOracleSpatial.h      |   325 +
 src/terralib/drivers/Oracle/ociap.h                | 10093 +++
 src/terralib/drivers/PAMDecoder/TeDecoderPAM.cpp   |   590 +-
 src/terralib/drivers/PAMDecoder/TeDecoderPAM.h     |   170 +-
 src/terralib/drivers/PostgreSQL/TePGInterface.cpp  |  5098 +-
 src/terralib/drivers/PostgreSQL/TePGInterface.h    |  1030 +-
 src/terralib/drivers/PostgreSQL/TePGUtils.cpp      |  1180 +-
 src/terralib/drivers/PostgreSQL/TePGUtils.h        |   218 +-
 src/terralib/drivers/PostgreSQL/TePostGIS.cpp      |  3507 +-
 src/terralib/drivers/PostgreSQL/TePostGIS.h        |   504 +-
 src/terralib/drivers/PostgreSQL/TePostgreSQL.cpp   |  8735 +-
 src/terralib/drivers/PostgreSQL/TePostgreSQL.h     |   937 +-
 .../drivers/PostgreSQL/TePostgreSQLDefines.h       |    49 +
 .../drivers/PostgreSQL/includepg/ecpg_informix.h   |    90 +
 .../drivers/PostgreSQL/includepg/ecpgerrno.h       |    77 +
 .../drivers/PostgreSQL/includepg/ecpglib.h         |    94 +
 .../drivers/PostgreSQL/includepg/ecpgtype.h        |    93 +
 .../drivers/PostgreSQL/includepg/libpq-fe.h        |   503 +
 .../drivers/PostgreSQL/includepg/pg_config.h       |   685 +
 .../PostgreSQL/includepg/pg_config_manual.h        |   229 +
 .../drivers/PostgreSQL/includepg/pg_config_os.h    |   244 +
 .../drivers/PostgreSQL/includepg/pgtypes_date.h    |    27 +
 .../drivers/PostgreSQL/includepg/pgtypes_error.h   |    15 +
 .../PostgreSQL/includepg/pgtypes_interval.h        |    30 +
 .../drivers/PostgreSQL/includepg/pgtypes_numeric.h |    68 +
 .../PostgreSQL/includepg/pgtypes_timestamp.h       |    33 +
 .../drivers/PostgreSQL/includepg/postgres_ext.h    |    69 +
 .../drivers/PostgreSQL/includepg/sql3types.h       |    48 +
 src/terralib/drivers/PostgreSQL/includepg/sqlca.h  |    66 +
 src/terralib/drivers/PostgreSQL/readme.txt         |    88 +-
 src/terralib/drivers/ado/TeAdoDB.cpp               |  4970 ++
 src/terralib/drivers/ado/TeAdoDB.h                 |   315 +
 src/terralib/drivers/ado/TeAdoDefines.h            |    49 +
 src/terralib/drivers/ado/TeAdoOracle.cpp           |  2838 +
 src/terralib/drivers/ado/TeAdoOracle.h             |   214 +
 src/terralib/drivers/ado/TeAdoSqlServer.cpp        |  2135 +
 src/terralib/drivers/ado/TeAdoSqlServer.h          |   183 +
 src/terralib/drivers/ado/TeAdoSqlServerSpatial.cpp |  1582 +
 src/terralib/drivers/ado/TeAdoSqlServerSpatial.h   |   328 +
 src/terralib/drivers/gdal/TeGDALDecoder.cpp        |    87 +
 src/terralib/drivers/gdal/TeGDALDecoder.h          |    92 +
 src/terralib/drivers/gdal/TeGDALDefines.h          |    14 +
 src/terralib/drivers/gdal/TeGDALUtils.cpp          |   104 +
 src/terralib/drivers/gdal/TeGDALUtils.h            |    83 +
 src/terralib/drivers/gdal/TeOGRDriver.cpp          |   123 +
 src/terralib/drivers/gdal/TeOGRDriver.h            |    97 +
 src/terralib/drivers/gdal/TeOGRDriverFactory.cpp   |    27 +
 src/terralib/drivers/gdal/TeOGRDriverFactory.h     |    59 +
 src/terralib/drivers/gdal/TeOGRUtils.cpp           |   219 +
 src/terralib/drivers/gdal/TeOGRUtils.h             |    95 +
 src/terralib/drivers/libjpeg/TeLibJpegWrapper.cpp  |   432 +-
 src/terralib/drivers/libjpeg/TeLibJpegWrapper.h    |   194 +-
 src/terralib/drivers/libjpeg/jmemdst.c             |   314 +-
 src/terralib/drivers/libjpeg/jmemdstsrc.h          |   136 +-
 src/terralib/drivers/libjpeg/jmemsrc.c             |   188 +-
 .../drivers/qt/TeAddressNotifyFunctorWindow.h      |   168 +-
 src/terralib/drivers/qt/TeDecoderQtImage.cpp       |   250 +-
 src/terralib/drivers/qt/TeDecoderQtImage.h         |   150 +-
 src/terralib/drivers/qt/TeGUIUtils.cpp             |   543 +-
 src/terralib/drivers/qt/TeGUIUtils.h               |   122 +-
 src/terralib/drivers/qt/TeInitRasterQtDecoder.cpp  |    20 +-
 src/terralib/drivers/qt/TeQtAnimaThread.cpp        |   234 +-
 src/terralib/drivers/qt/TeQtAnimaThread.h          |    99 +-
 src/terralib/drivers/qt/TeQtBigTable.cpp           |   316 +-
 src/terralib/drivers/qt/TeQtBigTable.h             |   104 +-
 src/terralib/drivers/qt/TeQtCanvas.cpp             |  6909 +-
 src/terralib/drivers/qt/TeQtCanvas.h               |   838 +-
 src/terralib/drivers/qt/TeQtChartItem.cpp          |   174 +-
 src/terralib/drivers/qt/TeQtChartItem.h            |   126 +-
 src/terralib/drivers/qt/TeQtCheckListItem.cpp      |   194 +-
 src/terralib/drivers/qt/TeQtCheckListItem.h        |   162 +-
 src/terralib/drivers/qt/TeQtColorBar.cpp           |  2200 +-
 src/terralib/drivers/qt/TeQtColorBar.h             |   239 +-
 src/terralib/drivers/qt/TeQtDataSource.h           |    50 +-
 src/terralib/drivers/qt/TeQtDatabaseItem.cpp       |    80 +-
 src/terralib/drivers/qt/TeQtDatabaseItem.h         |   102 +-
 src/terralib/drivers/qt/TeQtDatabaseItemFCT.cpp    |    40 -
 src/terralib/drivers/qt/TeQtDatabaseItemFCT.h      |    52 -
 src/terralib/drivers/qt/TeQtDatabasesListView.cpp  |   584 +-
 src/terralib/drivers/qt/TeQtDatabasesListView.h    |   195 +-
 .../drivers/qt/TeQtDatabasesListViewFCT.cpp        |   326 -
 src/terralib/drivers/qt/TeQtDatabasesListViewFCT.h |    98 -
 src/terralib/drivers/qt/TeQtFrame.cpp              |   118 +-
 src/terralib/drivers/qt/TeQtFrame.h                |   112 +-
 src/terralib/drivers/qt/TeQtGLWidget.cpp           |  2806 +-
 src/terralib/drivers/qt/TeQtGLWidget.h             |   305 +-
 src/terralib/drivers/qt/TeQtGraph.cpp              |   568 +-
 src/terralib/drivers/qt/TeQtGraph.h                |   166 +-
 src/terralib/drivers/qt/TeQtGrid.cpp               |  5883 +-
 src/terralib/drivers/qt/TeQtGrid.h                 |   508 +-
 src/terralib/drivers/qt/TeQtGridSource.cpp         |  1264 +-
 src/terralib/drivers/qt/TeQtGridSource.h           |   175 +-
 src/terralib/drivers/qt/TeQtLatEdit.cpp            |   260 +-
 src/terralib/drivers/qt/TeQtLatEdit.h              |    46 +-
 src/terralib/drivers/qt/TeQtLayerItem.cpp          |    86 +-
 src/terralib/drivers/qt/TeQtLayerItem.h            |    98 +-
 src/terralib/drivers/qt/TeQtLayerItemFCT.cpp       |    44 -
 src/terralib/drivers/qt/TeQtLayerItemFCT.h         |    49 -
 src/terralib/drivers/qt/TeQtLegendItem.cpp         |   702 +-
 src/terralib/drivers/qt/TeQtLegendItem.h           |   146 +-
 src/terralib/drivers/qt/TeQtLegendSource.cpp       |  1696 +-
 src/terralib/drivers/qt/TeQtLegendSource.h         |   130 +-
 src/terralib/drivers/qt/TeQtLongEdit.cpp           |   258 +-
 src/terralib/drivers/qt/TeQtLongEdit.h             |    46 +-
 src/terralib/drivers/qt/TeQtMethods.cpp            |   906 +-
 src/terralib/drivers/qt/TeQtMethods.h              |   154 +-
 src/terralib/drivers/qt/TeQtProgress.h             |   278 +-
 src/terralib/drivers/qt/TeQtShowMedia.cpp          |  4079 +-
 src/terralib/drivers/qt/TeQtShowMedia.h            |   180 +-
 src/terralib/drivers/qt/TeQtTable.cpp              |   628 +-
 src/terralib/drivers/qt/TeQtTable.h                |   140 +-
 src/terralib/drivers/qt/TeQtTerraStat.cpp          |  2552 +-
 src/terralib/drivers/qt/TeQtTerraStat.h            |   419 +-
 src/terralib/drivers/qt/TeQtTextEdit.cpp           |  1724 +-
 src/terralib/drivers/qt/TeQtTextEdit.h             |   303 +-
 src/terralib/drivers/qt/TeQtThemeItem.cpp          |   424 +-
 src/terralib/drivers/qt/TeQtThemeItem.h            |   128 +-
 src/terralib/drivers/qt/TeQtThemeItemFCT.cpp       |   197 -
 src/terralib/drivers/qt/TeQtThemeItemFCT.h         |    59 -
 src/terralib/drivers/qt/TeQtViewItem.cpp           |   150 +-
 src/terralib/drivers/qt/TeQtViewItem.h             |   116 +-
 src/terralib/drivers/qt/TeQtViewItemFCT.cpp        |    50 -
 src/terralib/drivers/qt/TeQtViewItemFCT.h          |    54 -
 src/terralib/drivers/qt/TeQtViewsListView.cpp      |  1842 +-
 src/terralib/drivers/qt/TeQtViewsListView.h        |   275 +-
 src/terralib/drivers/qt/TeQtViewsListViewFCT.cpp   |   885 -
 src/terralib/drivers/qt/TeQtViewsListViewFCT.h     |   154 -
 src/terralib/drivers/qt/TeWaitCursor.cpp           |   118 +-
 src/terralib/drivers/qt/TeWaitCursor.h             |   106 +-
 src/terralib/drivers/qt/resultVisual.h             |    74 +-
 src/terralib/drivers/qwt/TeQwtDefines.h            |    56 +
 src/terralib/drivers/qwt/TeQwtPlot.cpp             |    82 +-
 src/terralib/drivers/qwt/TeQwtPlot.h               |   102 +-
 src/terralib/drivers/qwt/TeQwtPlotCurve.cpp        |   106 +-
 src/terralib/drivers/qwt/TeQwtPlotCurve.h          |    94 +-
 src/terralib/drivers/qwt/TeQwtPlotPicker.cpp       |   450 +-
 src/terralib/drivers/qwt/TeQwtPlotPicker.h         |   146 +-
 src/terralib/drivers/qwt/TeQwtPlotZoomer.cpp       |   384 +-
 src/terralib/drivers/qwt/TeQwtPlotZoomer.h         |   118 +-
 src/terralib/drivers/shapelib/TeDriverSHPDBF.cpp   |  5011 +-
 src/terralib/drivers/shapelib/TeDriverSHPDBF.h     |   561 +-
 src/terralib/drivers/shapelib/TeExportDBF.cpp      |   570 +-
 src/terralib/drivers/shapelib/TeExportSHP.cpp      |  1326 +-
 src/terralib/drivers/shapelib/TeImportDBF.cpp      |   882 +-
 src/terralib/drivers/shapelib/TeImportSHP.cpp      |  2740 +-
 src/terralib/drivers/shapelib/TeQuerierSHP.cpp     |   210 +-
 src/terralib/drivers/shapelib/TeQuerierSHP.h       |   236 +-
 src/terralib/drivers/shapelib/TeSHPDefines.h       |    56 +
 .../drivers/shapelib/TeSHPDriverFactory.cpp        |    36 +
 src/terralib/drivers/shapelib/TeSHPDriverFactory.h |    27 +
 .../drivers/shapelib/TeSTEFunctionsSHP.cpp         |   252 +-
 src/terralib/drivers/shapelib/TeSTEFunctionsSHP.h  |   176 +-
 src/terralib/drivers/spl/PluginInfo.h              |   119 +
 src/terralib/drivers/spl/PluginMetadata.cpp        |     9 +
 src/terralib/drivers/spl/PluginMetadata.h          |    66 +
 src/terralib/drivers/spl/PluginParameters.cpp      |   225 +
 src/terralib/drivers/spl/PluginParameters.h        |   555 +
 src/terralib/drivers/spl/PluginsManager.cpp        |   213 +
 src/terralib/drivers/spl/PluginsManager.h          |   133 +
 .../drivers/spl/PluginsParametersContainer.h       |   462 +
 src/terralib/drivers/spl/PluginsSignal.cpp         |     7 +
 src/terralib/drivers/spl/PluginsSignal.h           |    78 +
 src/terralib/drivers/spl/TeSPLDefines.h            |    54 +
 src/terralib/dtm/TeDTMAlgorithm.cpp                |   146 +-
 src/terralib/dtm/TeDTMAlgorithm.h                  |   294 +-
 src/terralib/dtm/TeDTMDefines.h                    |   146 +-
 src/terralib/dtm/TeDTMParameters.cpp               |    24 +-
 src/terralib/dtm/TeDTMParameters.h                 |   128 +-
 src/terralib/functions/TeAddressLocator.cpp        |  6714 +-
 src/terralib/functions/TeAddressLocator.h          |   850 +-
 src/terralib/functions/TeCellAlgorithms.cpp        |  3675 +-
 src/terralib/functions/TeCellAlgorithms.h          |   750 +-
 src/terralib/functions/TeCoordAlgorithms.cpp       |   200 +-
 src/terralib/functions/TeCoordAlgorithms.h         |   112 +-
 src/terralib/functions/TeDriverBNA.h               |   158 +-
 src/terralib/functions/TeDriverCSV.h               |   232 +-
 src/terralib/functions/TeDriverMIDMIF.h            |   240 +-
 src/terralib/functions/TeDriverSPRING.h            |   234 +-
 src/terralib/functions/TeExportCSV.cpp             |   366 +-
 src/terralib/functions/TeExportMIF.cpp             |  1128 +-
 src/terralib/functions/TeExportSPR.cpp             |   984 +-
 src/terralib/functions/TeFunctionsDefines.h        |    49 +
 .../functions/TeGeoProcessingFunctions.cpp         |  7233 +-
 src/terralib/functions/TeGeoProcessingFunctions.h  |   341 +-
 src/terralib/functions/TeImportBNA.cpp             |  1030 +-
 src/terralib/functions/TeImportCSV.cpp             |   566 +-
 src/terralib/functions/TeImportExport.h            |    76 +-
 src/terralib/functions/TeImportGeo.cpp             |   952 +-
 src/terralib/functions/TeImportMIF.cpp             |  1828 +-
 src/terralib/functions/TeImportSPR.cpp             |   448 +-
 src/terralib/functions/TeImportSPR.h               |    34 +-
 src/terralib/functions/TeInterpolation.cpp         |   738 +-
 src/terralib/functions/TeInterpolation.h           |   712 +-
 src/terralib/functions/TeLayerFunctions.cpp        |  2290 +-
 src/terralib/functions/TeLayerFunctions.h          |   417 +-
 src/terralib/functions/TeMIFProjection.cpp         |   682 +-
 src/terralib/functions/TeMIFProjection.h           |    84 +-
 src/terralib/functions/TeMemoryZonal.cpp           |   180 +-
 src/terralib/functions/TeMemoryZonal.h             |    98 +-
 src/terralib/functions/TeRasterIteratorSet.h       |   212 +-
 src/terralib/functions/TeSPRFile.cpp               |   622 +-
 src/terralib/functions/TeSPRFile.h                 |   374 +-
 src/terralib/functions/TeSimilarity.cpp            |   146 +-
 src/terralib/functions/TeThemeFunctions.cpp        |   524 +-
 src/terralib/functions/TeThemeFunctions.h          |    99 +-
 src/terralib/image_processing/.cvsignore           |     4 +
 src/terralib/image_processing/TePDIAlgorithm.cpp   |   308 +-
 src/terralib/image_processing/TePDIAlgorithm.hpp   |   447 +-
 .../image_processing/TePDIAlgorithmFactory.cpp     |    22 +-
 .../image_processing/TePDIAlgorithmFactory.hpp     |   186 +-
 src/terralib/image_processing/TePDIArithmetic.cpp  |  1333 +-
 src/terralib/image_processing/TePDIArithmetic.hpp  |   425 +-
 .../image_processing/TePDIArithmeticFactory.cpp    |    50 +-
 .../image_processing/TePDIArithmeticFactory.hpp    |   138 +-
 src/terralib/image_processing/TePDIBDFilter.cpp    |   908 +-
 src/terralib/image_processing/TePDIBDFilter.hpp    |   232 +-
 .../image_processing/TePDIBDFilterFactory.cpp      |    48 +-
 .../image_processing/TePDIBDFilterFactory.hpp      |   134 +-
 src/terralib/image_processing/TePDIBaatz.cpp       |  2835 +-
 src/terralib/image_processing/TePDIBaatz.hpp       |   454 +-
 .../image_processing/TePDIBatchGeoMosaic.cpp       |   977 +-
 .../image_processing/TePDIBatchGeoMosaic.hpp       |   318 +-
 .../TePDIBatchGeoMosaicFactory.cpp                 |    26 -
 .../TePDIBatchGeoMosaicFactory.hpp                 |    69 -
 .../image_processing/TePDIBlendStratFactory.cpp    |    12 -
 .../image_processing/TePDIBlendStratFactory.hpp    |    67 -
 src/terralib/image_processing/TePDIBlender.cpp     |   562 +
 src/terralib/image_processing/TePDIBlender.hpp     |   274 +
 src/terralib/image_processing/TePDIBlending.cpp    |  1094 -
 src/terralib/image_processing/TePDIBlending.hpp    |   197 -
 .../image_processing/TePDIBlendingFactory.cpp      |    26 -
 .../image_processing/TePDIBlendingFactory.hpp      |    67 -
 .../image_processing/TePDIBlendingStrategy.cpp     |    22 -
 .../image_processing/TePDIBlendingStrategy.hpp     |    71 -
 .../image_processing/TePDIBufferedFilter.cpp       |   346 +-
 .../image_processing/TePDIBufferedFilter.hpp       |   304 +-
 src/terralib/image_processing/TePDICluster.cpp     |   698 +-
 src/terralib/image_processing/TePDICluster.hpp     |   570 +-
 .../image_processing/TePDIColorTransform.cpp       |  1211 +-
 .../image_processing/TePDIColorTransform.hpp       |   304 +-
 .../TePDIColorTransformFactory.cpp                 |    48 +-
 .../TePDIColorTransformFactory.hpp                 |   134 +-
 src/terralib/image_processing/TePDIContrast.cpp    |  3502 +-
 src/terralib/image_processing/TePDIContrast.hpp    |   828 +-
 .../image_processing/TePDIContrastFactory.cpp      |    48 +-
 .../image_processing/TePDIContrastFactory.hpp      |   134 +-
 .../image_processing/TePDICorrelationMatching.cpp  |  2314 +-
 .../image_processing/TePDICorrelationMatching.hpp  |   455 +-
 .../TePDIDecorrelationEnhancement.cpp              |   340 +-
 .../TePDIDecorrelationEnhancement.hpp              |   176 +-
 src/terralib/image_processing/TePDIDefines.hpp     |   261 +-
 src/terralib/image_processing/TePDIEMClas.cpp      |   856 +-
 src/terralib/image_processing/TePDIEMClas.hpp      |   284 +-
 .../image_processing/TePDIEMClasFactory.cpp        |    50 +-
 .../image_processing/TePDIEMClasFactory.hpp        |   136 +-
 src/terralib/image_processing/TePDIEspecData.cpp   |   190 +-
 src/terralib/image_processing/TePDIEspecData.hpp   |   135 +-
 .../image_processing/TePDIEuclidianBlendSF.cpp     |    20 -
 .../image_processing/TePDIEuclidianBlendSF.hpp     |    67 -
 .../TePDIEuclidianBlendStrategy.cpp                |   988 -
 .../TePDIEuclidianBlendStrategy.hpp                |   169 -
 src/terralib/image_processing/TePDIFilterMask.cpp  |  1314 +-
 src/terralib/image_processing/TePDIFilterMask.hpp  |   691 +-
 src/terralib/image_processing/TePDIFusion.cpp      |    51 -
 src/terralib/image_processing/TePDIFusion.hpp      |    96 -
 .../image_processing/TePDIFusionFactory.cpp        |    26 -
 .../image_processing/TePDIFusionFactory.hpp        |    67 -
 .../image_processing/TePDIFusionIndexes.cpp        |   688 +
 .../image_processing/TePDIFusionIndexes.hpp        |   195 +
 .../image_processing/TePDIGarguetFusion.cpp        |   323 +
 .../image_processing/TePDIGarguetFusion.hpp        |   105 +
 .../image_processing/TePDIGarguetFusionSF.cpp      |    21 -
 .../image_processing/TePDIGarguetFusionSF.hpp      |    70 -
 .../TePDIGarguetFusionStrategy.cpp                 |   329 -
 .../TePDIGarguetFusionStrategy.hpp                 |   133 -
 .../image_processing/TePDIGeneralizedIHSFusion.cpp |   411 +
 .../image_processing/TePDIGeneralizedIHSFusion.hpp |   111 +
 src/terralib/image_processing/TePDIGeoMosaic.cpp   |   882 +-
 src/terralib/image_processing/TePDIGeoMosaic.hpp   |   252 +-
 .../image_processing/TePDIGeoMosaicFactory.cpp     |    26 -
 .../image_processing/TePDIGeoMosaicFactory.hpp     |    68 -
 src/terralib/image_processing/TePDIHaralick.cpp    |  1182 +-
 src/terralib/image_processing/TePDIHaralick.hpp    |   638 +-
 src/terralib/image_processing/TePDIHistogram.cpp   |  2397 +-
 src/terralib/image_processing/TePDIHistogram.hpp   |   650 +-
 src/terralib/image_processing/TePDIIHSFusion.cpp   |   380 +
 src/terralib/image_processing/TePDIIHSFusion.hpp   |    76 +
 src/terralib/image_processing/TePDIIHSFusionSF.cpp |    21 -
 src/terralib/image_processing/TePDIIHSFusionSF.hpp |    70 -
 .../image_processing/TePDIIHSFusionStrategy.cpp    |   317 -
 .../image_processing/TePDIIHSFusionStrategy.hpp    |    92 -
 .../image_processing/TePDIIHSWaveletFusion.cpp     |   478 +
 .../image_processing/TePDIIHSWaveletFusion.hpp     |   145 +
 .../image_processing/TePDIInterpolator.cpp         |   741 +-
 .../image_processing/TePDIInterpolator.hpp         |   587 +-
 src/terralib/image_processing/TePDIIsosegClas.cpp  |   794 +-
 src/terralib/image_processing/TePDIIsosegClas.hpp  |   290 +-
 .../image_processing/TePDIIsosegClasFactory.cpp    |    50 +-
 .../image_processing/TePDIIsosegClasFactory.hpp    |   136 +-
 .../image_processing/TePDIJointHistogram.cpp       |  2009 +-
 .../image_processing/TePDIJointHistogram.hpp       |   388 +-
 src/terralib/image_processing/TePDIKMeansClas.cpp  |   698 +-
 src/terralib/image_processing/TePDIKMeansClas.hpp  |   416 +-
 .../image_processing/TePDIKMeansClasFactory.cpp    |    50 +-
 .../image_processing/TePDIKMeansClasFactory.hpp    |   136 +-
 src/terralib/image_processing/TePDILevelRemap.cpp  |  1040 +-
 src/terralib/image_processing/TePDILevelRemap.hpp  |   366 +-
 .../image_processing/TePDILinearFilter.cpp         |   746 +-
 .../image_processing/TePDILinearFilter.hpp         |   192 +-
 .../image_processing/TePDILinearFilterFactory.cpp  |    50 +-
 .../image_processing/TePDILinearFilterFactory.hpp  |   134 +-
 src/terralib/image_processing/TePDIMIMatching.cpp  |  2476 +-
 src/terralib/image_processing/TePDIMIMatching.hpp  |   380 +-
 .../image_processing/TePDIMMIOMatching.cpp         |  5901 +-
 .../image_processing/TePDIMMIOMatching.hpp         |  1099 +-
 .../image_processing/TePDIMallatWavelets.cpp       |  4049 +-
 .../image_processing/TePDIMallatWavelets.hpp       |   970 +-
 .../image_processing/TePDIMathFunctions.cpp        |    62 +-
 .../image_processing/TePDIMathFunctions.hpp        |   160 +-
 src/terralib/image_processing/TePDIMatrix.hpp      |  1688 +-
 .../image_processing/TePDIMatrixFunctions.cpp      |   280 +-
 .../image_processing/TePDIMatrixFunctions.hpp      |   184 +-
 src/terralib/image_processing/TePDIMixModel.cpp    |    84 +-
 src/terralib/image_processing/TePDIMixModel.hpp    |   196 +-
 .../image_processing/TePDIMixModelComponent.cpp    |   104 +-
 .../image_processing/TePDIMixModelComponent.hpp    |   179 +-
 .../TePDIMixModelComponentList.cpp                 |   164 +-
 .../TePDIMixModelComponentList.hpp                 |   218 +-
 .../image_processing/TePDIMixModelFactory.cpp      |    42 +-
 .../image_processing/TePDIMixModelFactory.hpp      |   118 +-
 .../image_processing/TePDIMixModelSpectralBand.cpp |    88 +-
 .../image_processing/TePDIMixModelSpectralBand.hpp |   199 +-
 .../TePDIMixModelSpectralBandList.cpp              |   116 +-
 .../TePDIMixModelSpectralBandList.hpp              |   170 +-
 .../image_processing/TePDIMixModelStratFactory.cpp |    24 +-
 .../image_processing/TePDIMixModelStratFactory.hpp |   132 +-
 .../image_processing/TePDIMixModelStrategy.cpp     |    44 +-
 .../image_processing/TePDIMixModelStrategy.hpp     |   144 +-
 src/terralib/image_processing/TePDIMorfFilter.cpp  |  2670 +-
 src/terralib/image_processing/TePDIMorfFilter.hpp  |   276 +-
 .../image_processing/TePDIMorfFilterFactory.cpp    |    48 +-
 .../image_processing/TePDIMorfFilterFactory.hpp    |   134 +-
 .../image_processing/TePDIMtxDoubleAdpt.hpp        |   283 +-
 src/terralib/image_processing/TePDINoBlendSF.cpp   |    20 -
 src/terralib/image_processing/TePDINoBlendSF.hpp   |    67 -
 .../image_processing/TePDINoBlendStrategy.cpp      |   265 -
 .../image_processing/TePDINoBlendStrategy.hpp      |   116 -
 src/terralib/image_processing/TePDIOFMatching.cpp  |  5131 +-
 src/terralib/image_processing/TePDIOFMatching.hpp  |   693 +-
 .../image_processing/TePDIPCAWaveletFusion.cpp     |   386 +
 .../image_processing/TePDIPCAWaveletFusion.hpp     |   138 +
 src/terralib/image_processing/TePDIPIManager.cpp   |   368 +-
 src/terralib/image_processing/TePDIPIManager.hpp   |   299 +-
 .../TePDIPIManagerGlobalSettings.hpp               |   196 +-
 .../image_processing/TePDIParaSegBaatzStrategy.cpp |   170 +
 .../image_processing/TePDIParaSegBaatzStrategy.hpp |    98 +
 .../TePDIParaSegBaatzStrategyFactory.cpp           |    24 +
 .../TePDIParaSegBaatzStrategyFactory.hpp           |    49 +
 .../TePDIParaSegRegGrowStrategy.cpp                |   449 +
 .../TePDIParaSegRegGrowStrategy.hpp                |   290 +
 .../TePDIParaSegRegGrowStrategyFactory.cpp         |    24 +
 .../TePDIParaSegRegGrowStrategyFactory.hpp         |    49 +
 .../image_processing/TePDIParaSegSegment.cpp       |    12 +
 .../image_processing/TePDIParaSegSegment.hpp       |    55 +
 .../image_processing/TePDIParaSegSegmentsBlock.cpp |    57 +
 .../image_processing/TePDIParaSegSegmentsBlock.hpp |    92 +
 .../image_processing/TePDIParaSegStrategy.cpp      |    43 +
 .../image_processing/TePDIParaSegStrategy.hpp      |   174 +
 .../TePDIParaSegStrategyFactory.cpp                |    14 +
 .../TePDIParaSegStrategyFactory.hpp                |    59 +
 .../TePDIParaSegStrategyFactoryParams.cpp          |    16 +
 .../TePDIParaSegStrategyFactoryParams.hpp          |    54 +
 .../TePDIParaSegStrategyParams.cpp                 |    13 +
 .../TePDIParaSegStrategyParams.hpp                 |    65 +
 .../image_processing/TePDIParallelSegmenter.cpp    |   973 +
 .../image_processing/TePDIParallelSegmenter.hpp    |   266 +
 src/terralib/image_processing/TePDIParameters.cpp  |   130 +-
 src/terralib/image_processing/TePDIParameters.hpp  |   353 +-
 .../image_processing/TePDIPrincipalComponents.cpp  |   842 +-
 .../image_processing/TePDIPrincipalComponents.hpp  |   228 +-
 .../TePDIPrincipalComponentsFactory.cpp            |    48 +-
 .../TePDIPrincipalComponentsFactory.hpp            |   136 +-
 .../TePDIPrincipalComponentsFusion.cpp             |   505 +-
 .../TePDIPrincipalComponentsFusion.hpp             |   202 +-
 .../image_processing/TePDIPrincoMixModelSF.cpp     |    42 +-
 .../image_processing/TePDIPrincoMixModelSF.hpp     |   118 +-
 .../TePDIPrincoMixModelStrategy.cpp                |  1143 +-
 .../TePDIPrincoMixModelStrategy.hpp                |   190 +-
 src/terralib/image_processing/TePDIRadarFilter.cpp |    38 +-
 src/terralib/image_processing/TePDIRadarFilter.hpp |   141 +-
 .../image_processing/TePDIRadarFrostFilter.cpp     |   790 +-
 .../image_processing/TePDIRadarFrostFilter.hpp     |   216 +-
 .../TePDIRadarFrostFilterFactory.cpp               |    48 +-
 .../TePDIRadarFrostFilterFactory.hpp               |   134 +-
 .../image_processing/TePDIRadarGammaFilter.cpp     |   394 +
 .../image_processing/TePDIRadarGammaFilter.hpp     |   125 +
 .../image_processing/TePDIRadarKuanFilter.cpp      |  1340 +-
 .../image_processing/TePDIRadarKuanFilter.hpp      |   268 +-
 .../TePDIRadarKuanFilterFactory.cpp                |    48 +-
 .../TePDIRadarKuanFilterFactory.hpp                |   134 +-
 .../image_processing/TePDIRadarLeeFilter.cpp       |  1344 +-
 .../image_processing/TePDIRadarLeeFilter.hpp       |   268 +-
 .../TePDIRadarLeeFilterFactory.cpp                 |    48 +-
 .../TePDIRadarLeeFilterFactory.hpp                 |   134 +-
 .../image_processing/TePDIRaster2Vector.cpp        |  1772 +-
 .../image_processing/TePDIRaster2Vector.hpp        |   630 +-
 .../image_processing/TePDIRaster2VectorFactory.cpp |    48 +-
 .../image_processing/TePDIRaster2VectorFactory.hpp |   134 +-
 .../image_processing/TePDIRasterRUBuffer.cpp       |   292 +-
 .../image_processing/TePDIRasterRUBuffer.hpp       |   175 +-
 src/terralib/image_processing/TePDIRegGrowSeg.cpp  |  1996 +-
 src/terralib/image_processing/TePDIRegGrowSeg.hpp  |  1511 +-
 .../image_processing/TePDIRegGrowSegFactory.cpp    |    52 +-
 .../image_processing/TePDIRegGrowSegFactory.hpp    |   136 +-
 src/terralib/image_processing/TePDIRegion.cpp      |    86 +-
 src/terralib/image_processing/TePDIRegion.hpp      |   344 +-
 src/terralib/image_processing/TePDIRegister.cpp    |   679 +-
 src/terralib/image_processing/TePDIRegister.hpp    |   230 +-
 .../image_processing/TePDIRegisterFactory.cpp      |    52 +-
 .../image_processing/TePDIRegisterFactory.hpp      |   136 +-
 src/terralib/image_processing/TePDIRgbPalette.cpp  |    24 +-
 src/terralib/image_processing/TePDIRgbPalette.hpp  |   133 +-
 .../image_processing/TePDIRgbPaletteFunctions.cpp  |   114 +-
 .../image_processing/TePDIRgbPaletteFunctions.hpp  |    90 +-
 .../image_processing/TePDIRgbPaletteNode.hpp       |   189 +-
 .../image_processing/TePDISAMClassifier.cpp        |   392 +
 .../image_processing/TePDISAMClassifier.hpp        |   238 +
 .../image_processing/TePDISensorSimulator.cpp      |   518 +-
 .../image_processing/TePDISensorSimulator.hpp      |   214 +-
 .../TePDISensorSimulatorFactory.cpp                |    54 +-
 .../TePDISensorSimulatorFactory.hpp                |   136 +-
 src/terralib/image_processing/TePDIStatistic.cpp   |  2369 +-
 src/terralib/image_processing/TePDIStatistic.hpp   |  1018 +-
 src/terralib/image_processing/TePDIStrategy.cpp    |    70 +-
 src/terralib/image_processing/TePDIStrategy.hpp    |   238 +-
 .../image_processing/TePDIStrategyFactory.cpp      |    22 +-
 .../image_processing/TePDIStrategyFactory.hpp      |   152 +-
 src/terralib/image_processing/TePDITPMosaic.cpp    |   540 +
 src/terralib/image_processing/TePDITPMosaic.hpp    |   137 +
 src/terralib/image_processing/TePDITileIndexer.hpp |   242 +
 src/terralib/image_processing/TePDITypes.hpp       |   272 +-
 src/terralib/image_processing/TePDIUtils.cpp       |  3422 +-
 src/terralib/image_processing/TePDIUtils.hpp       |  1377 +-
 .../image_processing/TePDIVenturaFusion.cpp        |   527 +
 .../image_processing/TePDIVenturaFusion.hpp        |   121 +
 .../image_processing/TePDIVenturaFusionSF.cpp      |    21 -
 .../image_processing/TePDIVenturaFusionSF.hpp      |    70 -
 .../TePDIVenturaFusionStrategy.cpp                 |   522 -
 .../TePDIVenturaFusionStrategy.hpp                 |   143 -
 .../image_processing/TePDIWaveletAtrous.cpp        |   762 +-
 .../image_processing/TePDIWaveletAtrous.hpp        |   251 +-
 .../image_processing/TePDIWaveletAtrousFusion.cpp  |   414 +
 .../image_processing/TePDIWaveletAtrousFusion.hpp  |   142 +
 .../image_processing/TePDIWiSpeRFusion.cpp         |   516 +
 .../image_processing/TePDIWiSpeRFusion.hpp         |   153 +
 .../image_processing/data_structs/TeTileIndexer.h  |   242 -
 src/terralib/kernel/Gra_algo.h                     |   390 +-
 src/terralib/kernel/Te2ndDegPolinomialGT.cpp       |   245 +
 src/terralib/kernel/Te2ndDegPolinomialGT.h         |    69 +
 .../kernel/Te2ndDegPolinomialGTFactory.cpp         |    48 +
 src/terralib/kernel/Te2ndDegPolinomialGTFactory.h  |    60 +
 src/terralib/kernel/TeAbstractFactory.h            |   290 +-
 src/terralib/kernel/TeAbstractTheme.cpp            |  2623 +-
 src/terralib/kernel/TeAbstractTheme.h              |  1413 +-
 src/terralib/kernel/TeAffineGT.cpp                 |   503 +-
 src/terralib/kernel/TeAffineGT.h                   |   225 +-
 src/terralib/kernel/TeAffineGTFactory.cpp          |    96 +-
 src/terralib/kernel/TeAffineGTFactory.h            |   142 +-
 src/terralib/kernel/TeAgnostic.cpp                 |    28 +-
 src/terralib/kernel/TeAgnostic.h                   |   794 +-
 src/terralib/kernel/TeAsciiFile.cpp                |   771 +-
 src/terralib/kernel/TeAsciiFile.h                  |   279 +-
 src/terralib/kernel/TeAssertions.h                 |    70 +-
 src/terralib/kernel/TeAttribute.h                  |   372 +-
 src/terralib/kernel/TeBaseSTInstance.h             |  1104 +-
 src/terralib/kernel/TeBaseSTInstanceSet.h          |  2432 +-
 src/terralib/kernel/TeBlockLoader.cpp              |   342 +-
 src/terralib/kernel/TeBlockLoader.h                |   188 +-
 src/terralib/kernel/TeBox.cpp                      |   426 +-
 src/terralib/kernel/TeBox.h                        |   436 +-
 src/terralib/kernel/TeBufferRegion.cpp             |  2146 +-
 src/terralib/kernel/TeBufferRegion.h               |   312 +-
 src/terralib/kernel/TeCentroid.cpp                 |   832 +-
 src/terralib/kernel/TeCommunicator.h               |   822 +-
 src/terralib/kernel/TeComposite.h                  |   368 +-
 .../kernel/TeComputeAttributeStrategies.cpp        |   924 +-
 src/terralib/kernel/TeComputeAttributeStrategies.h |  2110 +-
 src/terralib/kernel/TeConsoleErrorMessage.cpp      |   102 +-
 src/terralib/kernel/TeConsoleErrorMessage.h        |   136 +-
 src/terralib/kernel/TeCoord2D.h                    |   326 +-
 src/terralib/kernel/TeCounted.h                    |   154 +-
 src/terralib/kernel/TeCoverage.h                   |   754 +-
 src/terralib/kernel/TeCoverageDecoder.h            |   370 +-
 src/terralib/kernel/TeCoverageDecoderCacheLRU.h    |   378 +-
 src/terralib/kernel/TeCoverageDecoderDatabase.h    |   780 +-
 src/terralib/kernel/TeCoverageImport.h             |  1354 +-
 src/terralib/kernel/TeCoverageImportUtils.cpp      |   570 +-
 src/terralib/kernel/TeCoverageImportUtils.h        |    94 +-
 src/terralib/kernel/TeCoverageInterpolator.h       |   202 +-
 src/terralib/kernel/TeCoverageInterpolatorNN.h     |   510 +-
 src/terralib/kernel/TeCoverageParams.h             |   496 +-
 src/terralib/kernel/TeCoverageUtils.cpp            |   584 +-
 src/terralib/kernel/TeCoverageUtils.h              |   110 +-
 src/terralib/kernel/TeDBConnectionsPool.cpp        |  1051 +-
 src/terralib/kernel/TeDBConnectionsPool.h          |   151 +-
 src/terralib/kernel/TeDataTypes.h                  |   371 +-
 src/terralib/kernel/TeDatabase.cpp                 | 20562 ++---
 src/terralib/kernel/TeDatabase.h                   |  3520 +-
 src/terralib/kernel/TeDatabaseFactory.cpp          |    72 +-
 src/terralib/kernel/TeDatabaseFactory.h            |   116 +-
 src/terralib/kernel/TeDatabaseFactoryParams.cpp    |   154 +-
 src/terralib/kernel/TeDatabaseFactoryParams.h      |   142 +-
 src/terralib/kernel/TeDatabaseIndex.cpp            |    39 +
 src/terralib/kernel/TeDatabaseIndex.h              |    93 +
 src/terralib/kernel/TeDatum.cpp                    |  1052 +-
 src/terralib/kernel/TeDatum.h                      |   322 +-
 src/terralib/kernel/TeDecoder.h                    |   428 +-
 src/terralib/kernel/TeDecoderASCIIGrid.cpp         |   832 +-
 src/terralib/kernel/TeDecoderASCIIGrid.h           |   194 +-
 src/terralib/kernel/TeDecoderDatabase.cpp          |  1105 +-
 src/terralib/kernel/TeDecoderDatabase.h            |   326 +-
 src/terralib/kernel/TeDecoderFile.cpp              |   722 +-
 src/terralib/kernel/TeDecoderFile.h                |   168 +-
 src/terralib/kernel/TeDecoderJPEG.cpp              |   480 +-
 src/terralib/kernel/TeDecoderJPEG.h                |   169 +-
 src/terralib/kernel/TeDecoderMemory.cpp            |  1182 +-
 src/terralib/kernel/TeDecoderMemory.h              |   558 +-
 src/terralib/kernel/TeDecoderMemoryMap.cpp         |   860 +-
 src/terralib/kernel/TeDecoderMemoryMap.h           |   188 +-
 src/terralib/kernel/TeDecoderSPR.cpp               |   804 +-
 src/terralib/kernel/TeDecoderSPR.h                 |   160 +-
 src/terralib/kernel/TeDecoderSmartMem.cpp          |   985 +-
 src/terralib/kernel/TeDecoderSmartMem.h            |   955 +-
 src/terralib/kernel/TeDecoderTIFF.cpp              |  2445 +-
 src/terralib/kernel/TeDecoderTIFF.h                |   370 +-
 src/terralib/kernel/TeDecoderVirtualMemory.cpp     |  1009 +-
 src/terralib/kernel/TeDecoderVirtualMemory.h       |   482 +-
 src/terralib/kernel/TeDefines.h                    |   476 +-
 src/terralib/kernel/TeErrorLog.cpp                 |   368 +-
 src/terralib/kernel/TeErrorLog.h                   |   284 +-
 src/terralib/kernel/TeErrorMessage.cpp             |    66 +-
 src/terralib/kernel/TeErrorMessage.h               |   220 +-
 src/terralib/kernel/TeException.cpp                |   104 +-
 src/terralib/kernel/TeException.h                  |   144 +-
 src/terralib/kernel/TeExternalTheme.cpp            |  2994 +-
 src/terralib/kernel/TeExternalTheme.h              |   813 +-
 src/terralib/kernel/TeFactory.h                    |   290 +-
 src/terralib/kernel/TeFileTheme.cpp                |  1055 +-
 src/terralib/kernel/TeFileTheme.h                  |   435 +-
 src/terralib/kernel/TeFragmentation.cpp            |  1332 +-
 src/terralib/kernel/TeFragmentation.h              |   122 +-
 src/terralib/kernel/TeFunctionCallThreadJob.cpp    |    50 +-
 src/terralib/kernel/TeFunctionCallThreadJob.h      |   135 +-
 src/terralib/kernel/TeGDriverFactory.cpp           |    30 +
 src/terralib/kernel/TeGDriverFactory.h             |    38 +
 src/terralib/kernel/TeGTFactory.cpp                |    64 +-
 src/terralib/kernel/TeGTFactory.h                  |   156 +-
 src/terralib/kernel/TeGTParams.cpp                 |   255 +-
 src/terralib/kernel/TeGTParams.h                   |   533 +-
 src/terralib/kernel/TeGeneralizedProxMatrix.h      |  1260 +-
 src/terralib/kernel/TeGeoDataDriver.h              |   151 +-
 src/terralib/kernel/TeGeometricTransformation.cpp  |  3030 +-
 src/terralib/kernel/TeGeometricTransformation.h    |  1015 +-
 src/terralib/kernel/TeGeometry.cpp                 |   292 +-
 src/terralib/kernel/TeGeometry.h                   |  1962 +-
 src/terralib/kernel/TeGeometryAlgorithms.cpp       |  5760 +-
 src/terralib/kernel/TeGeometryAlgorithms.h         |  2062 +-
 src/terralib/kernel/TeGraph.cpp                    |  3114 +-
 src/terralib/kernel/TeGraph.h                      |   364 +-
 src/terralib/kernel/TeGridIndex.h                  |   826 +-
 src/terralib/kernel/TeGroupingAlgorithms.cpp       |   224 +-
 src/terralib/kernel/TeGroupingAlgorithms.h         |   562 +-
 src/terralib/kernel/TeImportRaster.cpp             |  1885 +-
 src/terralib/kernel/TeImportRaster.h               |   216 +-
 src/terralib/kernel/TeInitRasterDecoders.cpp       |   132 +-
 src/terralib/kernel/TeInitRasterDecoders.h         |    74 +-
 src/terralib/kernel/TeIntersector.cpp              |  2112 +-
 src/terralib/kernel/TeIntersector.h                |   428 +-
 src/terralib/kernel/TeKdTree.h                     |  2380 +-
 src/terralib/kernel/TeLayer.cpp                    |  3276 +-
 src/terralib/kernel/TeLayer.h                      |   935 +-
 src/terralib/kernel/TeLegendEntry.cpp              |   348 +-
 src/terralib/kernel/TeLegendEntry.h                |   336 +-
 src/terralib/kernel/TeMappedMemory.cpp             |   842 +-
 src/terralib/kernel/TeMappedMemory.h               |   464 +-
 src/terralib/kernel/TeMatrix.cpp                   |  3178 +-
 src/terralib/kernel/TeMatrix.h                     |   426 +-
 src/terralib/kernel/TeMeasure.h                    |   118 +-
 src/terralib/kernel/TeMetaModelCache.cpp           |    80 +-
 src/terralib/kernel/TeMetaModelCache.h             |   236 +-
 src/terralib/kernel/TeMultiContainer.h             |  1283 +-
 src/terralib/kernel/TeMultiGeometry.cpp            |   534 +-
 src/terralib/kernel/TeMultiGeometry.h              |   322 +-
 src/terralib/kernel/TeMutex.cpp                    |   118 +-
 src/terralib/kernel/TeMutex.h                      |   359 +-
 src/terralib/kernel/TeNeighbours.cpp               |   442 +-
 src/terralib/kernel/TeNeighbours.h                 |   414 +-
 src/terralib/kernel/TeNetwork.cpp                  |  1156 +-
 src/terralib/kernel/TeNetwork.h                    |   320 +-
 src/terralib/kernel/TeOverlay.cpp                  |  1526 +-
 src/terralib/kernel/TeOverlay.h                    |   428 +-
 src/terralib/kernel/TeOverlayUtils.cpp             |  2444 +-
 src/terralib/kernel/TeOverlayUtils.h               |   344 +-
 src/terralib/kernel/TePieBar.h                     |   634 +-
 src/terralib/kernel/TePolygonSetProperties.cpp     |   710 +
 src/terralib/kernel/TePolygonSetProperties.h       |   246 +
 src/terralib/kernel/TePrecision.h                  |   122 +-
 src/terralib/kernel/TeProgress.cpp                 |    74 +-
 src/terralib/kernel/TeProgress.h                   |   134 +-
 src/terralib/kernel/TeProgressBase.h               |   152 +-
 src/terralib/kernel/TeProject.cpp                  |   584 +-
 src/terralib/kernel/TeProject.h                    |   352 +-
 src/terralib/kernel/TeProjection.cpp               |  4877 +-
 src/terralib/kernel/TeProjection.h                 |  1578 +-
 src/terralib/kernel/TeProjectiveGT.cpp             |  1181 +-
 src/terralib/kernel/TeProjectiveGT.h               |   246 +-
 src/terralib/kernel/TeProjectiveGTFactory.cpp      |    98 +-
 src/terralib/kernel/TeProjectiveGTFactory.h        |   134 +-
 src/terralib/kernel/TePrototype.h                  |   166 +-
 .../kernel/TeProxMatrixConstructionStrategy.cpp    |  2414 +-
 .../kernel/TeProxMatrixConstructionStrategy.h      |  1080 +-
 src/terralib/kernel/TeProxMatrixImplementation.cpp |   996 +-
 src/terralib/kernel/TeProxMatrixImplementation.h   |   430 +-
 src/terralib/kernel/TeProxMatrixSlicingStrategy.h  |   226 +-
 src/terralib/kernel/TeProxMatrixStrategies.cpp     |   592 +-
 src/terralib/kernel/TeProxMatrixWeightsStrategy.h  |   336 +-
 src/terralib/kernel/TeQuerier.cpp                  |   408 +-
 src/terralib/kernel/TeQuerier.h                    |   308 +-
 src/terralib/kernel/TeQuerierDB.cpp                |  1073 +-
 src/terralib/kernel/TeQuerierDB.h                  |   244 +-
 src/terralib/kernel/TeQuerierDBStr1.cpp            |  2357 +-
 src/terralib/kernel/TeQuerierDBStr1.h              |   246 +-
 src/terralib/kernel/TeQuerierDBStr2.cpp            |   700 +-
 src/terralib/kernel/TeQuerierDBStr2.h              |   212 +-
 src/terralib/kernel/TeQuerierDBStr3.cpp            |   842 +-
 src/terralib/kernel/TeQuerierDBStr3.h              |   224 +-
 src/terralib/kernel/TeQuerierImpl.cpp              |   288 +-
 src/terralib/kernel/TeQuerierImpl.h                |   244 +-
 src/terralib/kernel/TeQuerierParams.cpp            |   572 +-
 src/terralib/kernel/TeQuerierParams.h              |   466 +-
 src/terralib/kernel/TeRTree.h                      |  1960 +-
 src/terralib/kernel/TeRaster.cpp                   |  2099 +-
 src/terralib/kernel/TeRaster.h                     |  1062 +-
 src/terralib/kernel/TeRasterMemManager.cpp         |   971 +-
 src/terralib/kernel/TeRasterMemManager.h           |   525 +-
 src/terralib/kernel/TeRasterParams.cpp             |  1793 +-
 src/terralib/kernel/TeRasterParams.h               |  1016 +-
 src/terralib/kernel/TeRasterRemap.cpp              |  1173 +-
 src/terralib/kernel/TeRasterRemap.h                |   267 +-
 src/terralib/kernel/TeRasterTransform.cpp          |   296 +-
 src/terralib/kernel/TeRasterTransform.h            |   901 +-
 src/terralib/kernel/TeRedBlackTree.h               |  1526 +-
 src/terralib/kernel/TeRepresentation.cpp           |    68 +-
 src/terralib/kernel/TeRepresentation.h             |   156 +-
 src/terralib/kernel/TeSTEFunctionsDB.h             |   864 +-
 src/terralib/kernel/TeSTElementSet.cpp             |   512 +-
 src/terralib/kernel/TeSTElementSet.h               |   250 +-
 src/terralib/kernel/TeSTEvent.cpp                  |   414 +-
 src/terralib/kernel/TeSTEvent.h                    |   264 +-
 src/terralib/kernel/TeSTInstance.cpp               |   706 +-
 src/terralib/kernel/TeSTInstance.h                 |   348 +-
 src/terralib/kernel/TeSemaphore.cpp                |   131 +
 src/terralib/kernel/TeSemaphore.h                  |   143 +
 src/terralib/kernel/TeSharedPtr.h                  |   845 +-
 src/terralib/kernel/TeSingleton.h                  |   134 +-
 src/terralib/kernel/TeSlice.h                      |   154 +-
 src/terralib/kernel/TeSparseMatrix.h               |   548 +-
 src/terralib/kernel/TeSpatialOperations.cpp        |  3326 +-
 src/terralib/kernel/TeSpatialOperations.h          |   566 +-
 src/terralib/kernel/TeStatistics.h                 |  1400 +-
 src/terralib/kernel/TeStdFile.cpp                  |   120 +-
 src/terralib/kernel/TeStdFile.h                    |   168 +-
 src/terralib/kernel/TeStdIOProgress.cpp            |   156 +-
 src/terralib/kernel/TeStdIOProgress.h              |   142 +-
 src/terralib/kernel/TeTable.cpp                    |   752 +-
 src/terralib/kernel/TeTable.h                      |   794 +-
 src/terralib/kernel/TeTempFilesRemover.cpp         |   266 +-
 src/terralib/kernel/TeTempFilesRemover.h           |   186 +-
 src/terralib/kernel/TeTemporalSeries.cpp           |   580 +-
 src/terralib/kernel/TeTemporalSeries.h             |   384 +-
 src/terralib/kernel/TeTheme.cpp                    |  5098 +-
 src/terralib/kernel/TeTheme.h                      |   905 +-
 src/terralib/kernel/TeThread.cpp                   |   562 +-
 src/terralib/kernel/TeThread.h                     |   305 +-
 src/terralib/kernel/TeThreadDatatypes.h            |   126 +-
 src/terralib/kernel/TeThreadFunctor.cpp            |   152 +-
 src/terralib/kernel/TeThreadFunctor.h              |   267 +-
 src/terralib/kernel/TeThreadJob.cpp                |    18 +-
 src/terralib/kernel/TeThreadJob.h                  |   114 +-
 src/terralib/kernel/TeThreadJobsManager.cpp        |   686 +-
 src/terralib/kernel/TeThreadJobsManager.h          |   290 +-
 src/terralib/kernel/TeThreadParameters.h           |    81 +-
 src/terralib/kernel/TeThreadSignal.cpp             |   384 +-
 src/terralib/kernel/TeThreadSignal.h               |   283 +-
 src/terralib/kernel/TeTime.cpp                     |  1306 +-
 src/terralib/kernel/TeTime.h                       |   306 +-
 src/terralib/kernel/TeTimeInterval.cpp             |   362 +-
 src/terralib/kernel/TeTimeInterval.h               |   338 +-
 src/terralib/kernel/TeTin.cpp                      |  4873 +-
 src/terralib/kernel/TeTin.h                        |  1112 +-
 src/terralib/kernel/TeUtils.cpp                    |  2125 +-
 src/terralib/kernel/TeUtils.h                      |   700 +-
 src/terralib/kernel/TeVectorRemap.cpp              |   312 +-
 src/terralib/kernel/TeVectorRemap.h                |   172 +-
 src/terralib/kernel/TeVersion.h                    |    74 +-
 src/terralib/kernel/TeView.h                       |   466 +-
 src/terralib/kernel/TeViewNode.cpp                 |   734 +-
 src/terralib/kernel/TeViewNode.h                   |   815 +-
 src/terralib/kernel/TeViewTreeIterator.cpp         |   280 +-
 src/terralib/kernel/TeViewTreeIterator.h           |   386 +-
 src/terralib/kernel/TeViewTreeUtils.cpp            |   208 +-
 src/terralib/kernel/TeViewTreeUtils.h              |    78 +-
 src/terralib/kernel/TeVisual.cpp                   |   516 +-
 src/terralib/kernel/TeVisual.h                     |   738 +-
 src/terralib/kernel/checkvec.h                     |   142 +-
 src/terralib/kernel/dynpq.h                        |   380 +-
 src/terralib/kernel/gra_util.h                     |   518 +-
 src/terralib/kernel/graph.h                        |   758 +-
 src/terralib/kernel/lexTemporal.cpp                |  3854 +-
 src/terralib/kernel/showseq.h                      |    46 +-
 src/terralib/kernel/yyTemporal.cpp                 |   990 +-
 src/terralib/kernel/yyTemporal.h                   |    70 +-
 src/terralib/stat/TeBayesFunctions.cpp             |   180 +-
 src/terralib/stat/TeBayesFunctions.h               |   416 +-
 src/terralib/stat/TeKMeansGrouping.h               |   324 +-
 src/terralib/stat/TeKernelFunctions.cpp            |   132 +-
 src/terralib/stat/TeKernelFunctions.h              |  1364 +-
 src/terralib/stat/TeKernelParams.h                 |   224 +-
 src/terralib/stat/TeMSVFactory.cpp                 |   326 +-
 src/terralib/stat/TeMSVFactory.h                   |   386 +-
 src/terralib/stat/TeSemivarModelFactory.cpp        |   396 +-
 src/terralib/stat/TeSemivarModelFactory.h          |   312 +-
 src/terralib/stat/TeSkaterArvore.cpp               |   124 +-
 src/terralib/stat/TeSkaterArvore.h                 |    40 +-
 src/terralib/stat/TeSkaterFunctions.cpp            |   686 +-
 src/terralib/stat/TeSkaterFunctions.h              |   226 +-
 src/terralib/stat/TeSkaterGrafo.cpp                |   154 +-
 src/terralib/stat/TeSkaterGrafo.h                  |   376 +-
 src/terralib/stat/TeSpatialStatistics.h            |  1592 +-
 src/terralib/stat/TeStatDataStructures.cpp         |   214 +-
 src/terralib/stat/TeStatDataStructures.h           |   944 +-
 src/terralib/stat/TeStatDefines.h                  |   112 +-
 src/terralib/stat/TeTreeMinimum.cpp                |   780 +-
 src/terralib/stat/TeTreeMinimum.h                  |   174 +-
 src/terralib/stat/erro.h                           |    12 +-
 src/terralib/stat/filaDouble.cpp                   |   116 +-
 src/terralib/stat/filaDouble.h                     |    60 +-
 src/terralib/stat/filaInt.cpp                      |   116 +-
 src/terralib/stat/filaInt.h                        |    62 +-
 src/terralib/stat/filaR.cpp                        |   158 +-
 src/terralib/stat/filaR.h                          |    76 +-
 src/terralib/stat/hash.cpp                         |   118 +-
 src/terralib/stat/hash.h                           |    66 +-
 src/terralib/stat/heap.cpp                         |   250 +-
 src/terralib/stat/heap.h                           |    76 +-
 src/terralib/stat/lista.cpp                        |   234 +-
 src/terralib/stat/lista.h                          |    66 +-
 src/terralib/stat/mtrand.cpp                       |    50 +
 src/terralib/stat/mtrand.h                         |   153 +
 src/terralib/utils/TeColorUtils.cpp                |  1500 +-
 src/terralib/utils/TeColorUtils.h                  |   186 +-
 src/terralib/utils/TeDatabaseUtils.cpp             |  2010 +-
 src/terralib/utils/TeDatabaseUtils.h               |   246 +-
 src/terralib/utils/TeUpdateDBVersion.cpp           |  3378 +-
 src/terralib/utils/TeUpdateDBVersion.h             |   136 +-
 src/terralib/utils/TeUtilsDefines.h                |    49 +
 src/terralib/utils/TeWKBGeometryDecoder.cpp        |   844 +-
 src/terralib/utils/TeWKBGeometryDecoder.h          |   218 +-
 src/terralib/utils/TeWKTGeometryDecoder.cpp        |   150 +
 src/terralib/utils/TeWKTGeometryDecoder.h          |    97 +
 src/terralib/utils/mtrand.cpp                      |    50 +
 src/terralib/utils/mtrand.h                        |   156 +
 src/tiff/cpl_csv.c                                 |  1016 +
 src/tiff/cpl_csv.h                                 |    83 +
 src/tiff/cpl_serv.c                                |   596 +
 src/tiff/cpl_serv.h                                |   276 +
 src/tiff/csv/README                                |    38 +
 src/tiff/csv/alias.csv                             |  2001 +
 src/tiff/csv/area.csv                              |  1751 +
 src/tiff/csv/codes.csv                             |    84 +
 src/tiff/csv/compd_cs.c                            |    12 +
 src/tiff/csv/compd_cs.csv                          |     9 +
 src/tiff/csv/coordinate_axis.csv                   |    75 +
 src/tiff/csv/coordinate_axis_name.csv              |    29 +
 src/tiff/csv/coordinate_operation.csv              |  2020 +
 src/tiff/csv/coordinate_operation_method.csv       |  1513 +
 src/tiff/csv/coordinate_operation_parameter.csv    |    99 +
 .../csv/coordinate_operation_parameter_value.csv   |  8406 ++
 src/tiff/csv/coordinate_operation_path.csv         |   336 +
 src/tiff/csv/coordinate_reference_system.csv       |  2609 +
 src/tiff/csv/coordinate_system.csv                 |    38 +
 src/tiff/csv/datum.csv                             |   332 +
 src/tiff/csv/deprecation.csv                       |   276 +
 src/tiff/csv/ellips_alias.c                        |    10 +
 src/tiff/csv/ellips_alias.csv                      |     7 +
 src/tiff/csv/ellipsoid.c                           |    42 +
 src/tiff/csv/ellipsoid.csv                         |    39 +
 src/tiff/csv/gcs.csv                               |   278 +
 src/tiff/csv/gdatum_alias.c                        |    11 +
 src/tiff/csv/gdatum_alias.csv                      |     8 +
 src/tiff/csv/geod_datum.c                          |   213 +
 src/tiff/csv/geod_datum.csv                        |   210 +
 src/tiff/csv/geod_trf.c                            |   492 +
 src/tiff/csv/geod_trf.csv                          |   489 +
 src/tiff/csv/horiz_cs.c                            |  1496 +
 src/tiff/csv/horiz_cs.csv                          |  1493 +
 src/tiff/csv/naming_system.csv                     |    13 +
 src/tiff/csv/p_meridian.c                          |    17 +
 src/tiff/csv/p_meridian.csv                        |    14 +
 src/tiff/csv/pcs.csv                               |  2251 +
 src/tiff/csv/prime_meridian.csv                    |    14 +
 src/tiff/csv/projop_wparm.csv                      |  1083 +
 src/tiff/csv/stateplane.csv                        |   258 +
 src/tiff/csv/trf_method.c                          |   205 +
 src/tiff/csv/trf_method.csv                        |   984 +
 src/tiff/csv/trf_nonpolynomial.c                   |  1082 +
 src/tiff/csv/trf_nonpolynomial.csv                 |  1079 +
 src/tiff/csv/trf_path.c                            |   568 +
 src/tiff/csv/trf_path.csv                          |   565 +
 src/tiff/csv/unit_of_measure.csv                   |    64 +
 src/tiff/csv/uom_an_alias.c                        |     5 +
 src/tiff/csv/uom_an_alias.csv                      |     2 +
 src/tiff/csv/uom_angle.c                           |    18 +
 src/tiff/csv/uom_angle.csv                         |    15 +
 src/tiff/csv/uom_le_alias.c                        |    27 +
 src/tiff/csv/uom_le_alias.csv                      |    24 +
 src/tiff/csv/uom_length.c                          |    39 +
 src/tiff/csv/uom_length.csv                        |    36 +
 src/tiff/csv/uom_sc_alias.c                        |     4 +
 src/tiff/csv/uom_sc_alias.csv                      |     1 +
 src/tiff/csv/uom_scale.c                           |     6 +
 src/tiff/csv/uom_scale.csv                         |     3 +
 src/tiff/csv/version_history.csv                   |    23 +
 src/tiff/csv/vert_cs.c                             |    31 +
 src/tiff/csv/vert_cs.csv                           |    28 +
 src/tiff/csv/vert_datum.c                          |    32 +
 src/tiff/csv/vert_datum.csv                        |    29 +
 src/tiff/csv/vert_offset.c                         |     5 +
 src/tiff/csv/vert_offset.csv                       |     2 +
 src/tiff/epsg_datum.inc                            |   174 +
 src/tiff/epsg_ellipse.inc                          |    48 +
 src/tiff/epsg_gcs.inc                              |   193 +
 src/tiff/epsg_pcs.inc                              |  1012 +
 src/tiff/epsg_pm.inc                               |    22 +
 src/tiff/epsg_proj.inc                             |   443 +
 src/tiff/epsg_units.inc                            |    35 +
 src/tiff/epsg_vertcs.inc                           |    46 +
 src/tiff/fax3sm.c                                  |  1046 +
 src/tiff/geo_config.h                              |    24 +
 src/tiff/geo_ctrans.inc                            |    91 +
 src/tiff/geo_extra.c                               |   747 +
 src/tiff/geo_free.c                                |    62 +
 src/tiff/geo_get.c                                 |   176 +
 src/tiff/geo_keyp.h                                |    98 +
 src/tiff/geo_names.c                               |   175 +
 src/tiff/geo_new.c                                 |   242 +
 src/tiff/geo_normalize.c                           |  2402 +
 src/tiff/geo_normalize.h                           |   238 +
 src/tiff/geo_print.c                               |   517 +
 src/tiff/geo_set.c                                 |   262 +
 src/tiff/geo_tiffp.c                               |   140 +
 src/tiff/geo_tiffp.h                               |   114 +
 src/tiff/geo_trans.c                               |   334 +
 src/tiff/geo_write.c                               |   193 +
 src/tiff/geokeys.h                                 |    54 +
 src/tiff/geokeys.inc                               |    76 +
 src/tiff/geonames.h                                |   146 +
 src/tiff/geotiff.h                                 |   117 +
 src/tiff/geotiff_proj4.c                           |   716 +
 src/tiff/geotiffio.h                               |    16 +
 src/tiff/geovalues.h                               |   120 +
 src/tiff/port.h                                    |    32 +
 src/tiff/t4.h                                      |   285 +
 src/tiff/tif_aux.c                                 |   267 +
 src/tiff/tif_close.c                               |   119 +
 src/tiff/tif_codec.c                               |   150 +
 src/tiff/tif_color.c                               |   275 +
 src/tiff/tif_compress.c                            |   286 +
 src/tiff/tif_config.h                              |    45 +
 src/tiff/tif_dir.c                                 |  1350 +
 src/tiff/tif_dir.h                                 |   199 +
 src/tiff/tif_dirinfo.c                             |   846 +
 src/tiff/tif_dirread.c                             |  1789 +
 src/tiff/tif_dirwrite.c                            |  1243 +
 src/tiff/tif_dumpmode.c                            |   117 +
 src/tiff/tif_error.c                               |    73 +
 src/tiff/tif_extension.c                           |   111 +
 src/tiff/tif_fax3.c                                |  1566 +
 src/tiff/tif_fax3.h                                |   525 +
 src/tiff/tif_fax3sm.c                              |  1253 +
 src/tiff/tif_flush.c                               |    67 +
 src/tiff/tif_getimage.c                            |  2598 +
 src/tiff/tif_jpeg.c                                |  1942 +
 src/tiff/tif_luv.c                                 |  1606 +
 src/tiff/tif_lzw.c                                 |  1084 +
 src/tiff/tif_machdep.c                             |   186 +
 src/tiff/tif_next.c                                |   144 +
 src/tiff/tif_open.c                                |   683 +
 src/tiff/tif_packbits.c                            |   293 +
 src/tiff/tif_pixarlog.c                            |  1342 +
 src/tiff/tif_predict.c                             |   626 +
 src/tiff/tif_predict.h                             |    64 +
 src/tiff/tif_print.c                               |   639 +
 src/tiff/tif_read.c                                |   650 +
 src/tiff/tif_strip.c                               |   294 +
 src/tiff/tif_swab.c                                |   235 +
 src/tiff/tif_thunder.c                             |   158 +
 src/tiff/tif_tile.c                                |   273 +
 src/tiff/tif_unix.c                                |   293 +
 src/tiff/tif_version.c                             |    33 +
 src/tiff/tif_warning.c                             |    74 +
 src/tiff/tif_win32.c                               |   393 +
 src/tiff/tif_write.c                               |   725 +
 src/tiff/tif_zip.c                                 |   378 +
 src/tiff/tiff.h                                    |   647 +
 src/tiff/tiffcomp.h                                |   221 +
 src/tiff/tiffconf.h                                |   101 +
 src/tiff/tiffio.h                                  |   517 +
 src/tiff/tiffiop.h                                 |   323 +
 src/tiff/tiffvers.h                                |     9 +
 src/tiff/uvcode.h                                  |   173 +
 src/tiff/xtiff.c                                   |   198 +
 src/tiff/xtiffio.h                                 |    72 +
 src/tiff/xtiffiop.h                                |    90 +
 src/zlib/zconf.h                                   |   332 +
 src/zlib/zlib.h                                    |  1357 +
 terralibx/image_processing/Makefile                |    21 -
 terralibx/image_processing/terralibpdi.pro         |   264 -
 terralibx/stat/Makefile                            |    21 -
 terralibx/stat/stat.pro                            |    67 -
 terralibx/terralib/Makefile                        |    44 -
 terralibx/terralib/terralib.pro                    |   270 -
 2126 files changed, 752440 insertions(+), 370115 deletions(-)

diff --git a/build/cmake/README b/build/cmake/README
new file mode 100644
index 0000000..e97acf4
--- /dev/null
+++ b/build/cmake/README
@@ -0,0 +1,74 @@
+Why cmake ?
+
+- Its mature and many projects are using it including kde, blender, QGis and many others.
+
+- It can generate project files for many IDEs (Visual Studio, Eclipse). So maybe
+  this can remove some duplication
+
+- It allows using -jx without rerunning make.
+
+I feel its easier to customize than qmake - Maybe that's because I don't know
+qmake too well. Having parallel builds which fail on failure only is important
+to me.
+
+TODO:
+  - test Windows
+  - add more library paths. In particular add paths to the libs which ship with this
+    repo - I think they should be shipped independently or both: i686 and
+    x86_64 versions should be shipped
+  - write code doing a usuful install ?
+  - make some dependencies such as Oracel optional
+  - think about reusing libraries shipping with linux systems - so don't build
+    them here or document why there is a local copy.
+
+usage: type into your shell
+
+  cd TOP_DIR_OF_REPO
+
+  # out of source build:
+  mkdir build-terraView; cd build-terraView
+
+  # configure, build then run:
+  cmake ../cmake/terraView \
+  && make -j $NUM_CORES \
+  && ./terraView
+
+
+similar to terraView you can create build directories for all libraries manually
+Why cmake ?
+
+- Its mature and many projects are using it including kde, blender, QGis and many others.
+
+- It can generate project files for many IDEs (Visual Studio, Eclipse). So maybe
+  this can remove some duplication
+
+- It allows using -jx without rerunning make.
+
+I feel its easier to customize than qmake - Maybe that's because I don't know
+qmake too well. Having parallel builds which fail on failure only is important
+to me.
+
+TODO:
+  - test Windows
+  - add more library paths. In particular add paths to the libs which ship with this
+    repo - I think they should be shipped independently or both: i686 and
+    x86_64 versions should be shipped
+  - write code doing a usuful install ?
+  - make some dependencies such as Oracel optional
+  - think about reusing libraries shipping with linux systems - so don't build
+    them here or document why there is a local copy.
+
+usage: type into your shell
+
+  cd TOP_DIR_OF_REPO
+
+  # out of source build:
+  mkdir build-terraView; cd build-terraView
+
+  # configure, build then run:
+  cmake ../cmake/terraView \
+  && make -j $NUM_CORES \
+  && ./terraView
+
+
+similar to terraView you can create build directories for all libraries manually
diff --git a/build/cmake/common/common.txt b/build/cmake/common/common.txt
new file mode 100644
index 0000000..3f4ea08
--- /dev/null
+++ b/build/cmake/common/common.txt
@@ -0,0 +1 @@
+file(GLOB DRIVER_INCLUDES $(TERRALIB_DIR)/src/terralib/drivers/*)
diff --git a/build/cmake/dxflib/CMakeLists.txt b/build/cmake/dxflib/CMakeLists.txt
new file mode 100644
index 0000000..0e0127a
--- /dev/null
+++ b/build/cmake/dxflib/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "dxflib")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/dxflib)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/libjpeg/CMakeLists.txt b/build/cmake/libjpeg/CMakeLists.txt
new file mode 100644
index 0000000..15bd0b4
--- /dev/null
+++ b/build/cmake/libjpeg/CMakeLists.txt
@@ -0,0 +1,25 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "libjpeg")
+
+project(${LIB_NAME} C)
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/libjpeg)
+
+file(GLOB SRCS ${ROOT}/*.c)
+
+
+# these files are present but are not used
+list(REMOVE_ITEM SRCS
+  ${ROOT}/ansi2knr.c
+  ${ROOT}/ckconfig.c
+  ${ROOT}/jmemansi.c
+  ${ROOT}/jmemname.c
+  ${ROOT}/jpegtran.c
+  ${ROOT}/rdjpgcom.c
+  ${ROOT}/wrjpgcom.c
+)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/libspl/CMakeLists.txt b/build/cmake/libspl/CMakeLists.txt
new file mode 100644
index 0000000..b81621e
--- /dev/null
+++ b/build/cmake/libspl/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "libspl")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/libspl)
+
+file(GLOB SRCS ${ROOT}/source/*.cpp)
+
+include_directories(${ROOT}/include)
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/qwt/CMakeLists.txt b/build/cmake/qwt/CMakeLists.txt
new file mode 100644
index 0000000..75e70fc
--- /dev/null
+++ b/build/cmake/qwt/CMakeLists.txt
@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "qwt")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/qwt)
+
+find_package(Qt3 REQUIRED)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+file(GLOB HDRS ${ROOT}/include/*.h)
+
+# note: according to the .pro file the following files can be exculded if
+# you're interested in the plot widget only:
+# qwt_abstract_slider.cpp
+# qwt_abstract_scale.cpp
+# qwt_arrow_button.cpp
+# qwt_analog_clock.cpp
+# qwt_compass.cpp
+# qwt_compass_rose.cpp
+# qwt_counter.cpp
+# qwt_dial.cpp
+# qwt_dial_needle.cpp
+# qwt_double_range.cpp
+# qwt_knob.cpp
+# qwt_slider.cpp
+# qwt_thermo.cpp
+# qwt_wheel.cpp
+
+qt_wrap_cpp(${LIB_NAME} SRCS ${HDRS})
+
+include_directories(${ROOT}/include)
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/shapelib/CMakeLists.txt b/build/cmake/shapelib/CMakeLists.txt
new file mode 100644
index 0000000..d39fd54
--- /dev/null
+++ b/build/cmake/shapelib/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "shapelib")
+
+project(${LIB_NAME} C)
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/shapelib)
+
+file(GLOB SRCS ${ROOT}/*.c)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/stat/CMakeLists.txt b/build/cmake/stat/CMakeLists.txt
new file mode 100644
index 0000000..f7a1470
--- /dev/null
+++ b/build/cmake/stat/CMakeLists.txt
@@ -0,0 +1,30 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "stat")
+
+project(${LIB_NAME})
+
+# dependencies
+add_subdirectory(../libjpeg ./build-of-libjpeg)
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/terralib/stat)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(
+  ../../src/terralib/kernel
+)
+
+# these files are present but are not used
+list(REMOVE_ITEM SRCS
+  ${ROOT}/TeMSVFactory.cpp
+  ${ROOT}/TeSemivarModelFactory.cpp
+  ${ROOT}/TeTreeMinimum.cpp
+  ${ROOT}/hash.cpp
+  ${ROOT}/mtrand.cpp
+)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
+target_link_libraries(${LIB_NAME} libjpeg)
diff --git a/build/cmake/te_ado/CMakeLists.txt b/build/cmake/te_ado/CMakeLists.txt
new file mode 100644
index 0000000..3721317
--- /dev/null
+++ b/build/cmake/te_ado/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_ado")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_ado)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_apputils/CMakeLists.txt b/build/cmake/te_apputils/CMakeLists.txt
new file mode 100644
index 0000000..c302735
--- /dev/null
+++ b/build/cmake/te_apputils/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_apputils")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_apputils)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_dxf/CMakeLists.txt b/build/cmake/te_dxf/CMakeLists.txt
new file mode 100644
index 0000000..56e4068
--- /dev/null
+++ b/build/cmake/te_dxf/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_dxfDXF")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/terralib/drivers/DXF)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(
+  ${ROOT}
+  ../../src/terralib/kernel
+  ../../src/dxflib
+)
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_firebird/CMakeLists.txt b/build/cmake/te_firebird/CMakeLists.txt
new file mode 100644
index 0000000..b15c8e4
--- /dev/null
+++ b/build/cmake/te_firebird/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_firebird")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_firebird)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_functions/CMakeLists.txt b/build/cmake/te_functions/CMakeLists.txt
new file mode 100644
index 0000000..83a2cc2
--- /dev/null
+++ b/build/cmake/te_functions/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_function")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_function)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_mysql/CMakeLists.txt b/build/cmake/te_mysql/CMakeLists.txt
new file mode 100644
index 0000000..78a50fc
--- /dev/null
+++ b/build/cmake/te_mysql/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_mysql")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_mysql)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_oracle/CMakeLists.txt b/build/cmake/te_oracle/CMakeLists.txt
new file mode 100644
index 0000000..cafbe29
--- /dev/null
+++ b/build/cmake/te_oracle/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_oracle")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_oracle)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_postgresql/CMakeLists.txt b/build/cmake/te_postgresql/CMakeLists.txt
new file mode 100644
index 0000000..b442b4c
--- /dev/null
+++ b/build/cmake/te_postgresql/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_postgresql")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_postgresql)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_qwt/CMakeLists.txt b/build/cmake/te_qwt/CMakeLists.txt
new file mode 100644
index 0000000..49880ed
--- /dev/null
+++ b/build/cmake/te_qwt/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_qwt")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_qwt)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_shapelib/CMakeLists.txt b/build/cmake/te_shapelib/CMakeLists.txt
new file mode 100644
index 0000000..40d4edf
--- /dev/null
+++ b/build/cmake/te_shapelib/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_shapelib")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_shapelib)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_spl/CMakeLists.txt b/build/cmake/te_spl/CMakeLists.txt
new file mode 100644
index 0000000..0a25980
--- /dev/null
+++ b/build/cmake/te_spl/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_spl")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_spl)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/te_utils/CMakeLists.txt b/build/cmake/te_utils/CMakeLists.txt
new file mode 100644
index 0000000..b138009
--- /dev/null
+++ b/build/cmake/te_utils/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "te_utils")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/te_utils)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/terraView/CMakeLists.txt b/build/cmake/terraView/CMakeLists.txt
new file mode 100644
index 0000000..d6ada56
--- /dev/null
+++ b/build/cmake/terraView/CMakeLists.txt
@@ -0,0 +1,190 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(terraView)
+
+set(QT_MT_REQUIRED,TRUE)
+
+find_package(Qt3 REQUIRED)
+
+include(../common/common.txt)
+
+# INCLUDES:
+include_directories(
+  $(TERRALIB_DIR)/terraView
+  $(TERRALIB_DIR)/terraView/ui
+  $(TERRALIB_DIR)/src/terralib/kernel
+  $(TERRALIB_DIR)/src/terralib/functions
+  $(TERRALIB_DIR)/src/terralib/utils
+  $(TERRALIB_DIR)/src/terralib/stat # add library instead?
+  $(TERRALIB_DIR)/src/terralib/image_processing
+  $(TERRALIB_DIR)/src/shapelib     # add library instead?
+  $(TERRALIB_DIR)/src/qwt/include  # add library instead?
+  $(TERRALIB_DIR)/src/libspl # add libspl instead ?
+  $(TERRALIB_DIR)/src/terralib/drivers/Oracle/OCI/include
+  ${DRIVER_INCLUDES}
+)
+
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+  include_directories($(TERRALIB_DIR)/terraView/linux/ui)
+  add_definitions(-DQT_THREAD_SUPPORT) # should QT_MT_REQUIRED be enough?
+
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+
+# firebird
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+  add_definitions(-DIBPP_LINUX)
+# TODO set for other targets:IBPP_WINDOWS/IBPP_LINUX/IBPP_DARWIN
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+file(GLOB SRCS $(TERRALIB_DIR)/terraView/*.cpp)
+
+# TODO make drivers such as oracle optional
+list(APPEND SRCS
+    $(TERRALIB_DIR)/src/terralib/drivers/Firebird/ibpp/core/all_in_one.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/Firebird/TeFirebird.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/MySQL/TeMySQL.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/Oracle/TeOCIConnect.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/Oracle/TeOCICursor.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/Oracle/TeOCIOracle.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/Oracle/TeOCISDO.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/Oracle/TeOracleSpatial.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/PostgreSQL/TePGInterface.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/PostgreSQL/TePGUtils.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/PostgreSQL/TePostGIS.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/PostgreSQL/TePostgreSQL.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeDecoderQtImage.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeGUIUtils.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtAnimaThread.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtBigTable.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtCanvas.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtChartItem.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtCheckListItem.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtColorBar.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtDatabaseItem.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtDatabasesListView.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtFrame.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtGLWidget.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtGraph.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtGrid.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtGridSource.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtLayerItem.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtLegendItem.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtLegendSource.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtMethods.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtShowMedia.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtTable.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtTerraStat.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtTextEdit.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtThemeItem.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtViewItem.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtViewsListView.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qt/TeWaitCursor.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qwt/TeQwtPlot.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qwt/TeQwtPlotCurve.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qwt/TeQwtPlotPicker.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/qwt/TeQwtPlotZoomer.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/shapelib/TeDriverSHPDBF.cpp
+    $(TERRALIB_DIR)/src/terralib/drivers/shapelib/TeSHPDriverFactory.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeAddressLocator.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeCellAlgorithms.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeCoordAlgorithms.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeExportCSV.cpp 
+    $(TERRALIB_DIR)/src/terralib/functions/TeExportMIF.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeExportSPR.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeGeoProcessingFunctions.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeImportBNA.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeImportCSV.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeImportGeo.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeImportMIF.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeLayerFunctions.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeMIFProjection.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeSimilarity.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeSPRFile.cpp
+    $(TERRALIB_DIR)/src/terralib/functions/TeThemeFunctions.cpp
+    $(TERRALIB_DIR)/src/terralib/kernel/TeDBConnectionsPool.cpp
+    $(TERRALIB_DIR)/src/terralib/kernel/TeExternalTheme.cpp
+    $(TERRALIB_DIR)/src/terralib/kernel/TeRasterParams.cpp
+    $(TERRALIB_DIR)/src/terralib/stat/TeMSVFactory.cpp
+    $(TERRALIB_DIR)/src/terralib/stat/TeSemivarModelFactory.cpp
+    $(TERRALIB_DIR)/src/terralib/utils/mtrand.cpp
+    $(TERRALIB_DIR)/src/terralib/utils/TeColorUtils.cpp
+    $(TERRALIB_DIR)/src/terralib/utils/TeDatabaseUtils.cpp
+    $(TERRALIB_DIR)/src/terralib/utils/TeUpdateDBVersion.cpp
+)
+
+
+# QT UI:
+SET(QT_UIC_EXECUTABLE,uic)
+SET(QT_MOC_EXECUTABLE,moc)
+file(GLOB UI_FILES $(TERRALIB_DIR)/terraView/ui/*.ui)
+QT_WRAP_UI(terraView HDRS TERRAVIEW_UI_SRCS ${UI_FILES} )
+
+file(GLOB MOC_HDRS_DRIVER_QWT $(TERRALIB_DIR)/src/terralib/drivers/qwt/*.h)
+
+QT_WRAP_CPP(terraView SRCS
+  $(TERRALIB_DIR)/terraView/terraView.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtBigTable.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtCanvas.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtColorBar.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtDatabasesListView.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtDataSource.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtFrame.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtGLWidget.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtGrid.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtGridSource.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtLegendSource.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtMethods.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtProgress.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtShowMedia.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtTerraStat.h
+  $(TERRALIB_DIR)/src/terralib/drivers/qt/TeQtViewsListView.h
+
+  ${MOC_HDRS_DRIVER_QWT}
+)
+# QT_WRAP_CPP(terraView SRCS ${HDRS_TO_MOC})
+
+# so that the compliler will find ui generated header files (HDRS)
+# There must be a better way to accomplish this
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+# terraView executable:
+add_executable(terraView ${SRCS} ${TERRAVIEW_UI_SRCS})
+
+MACRO(ADD_SHIPPED_LIB name)
+  add_subdirectory(../${name} ${CMAKE_CURRENT_BINARY_DIR}/../build-${name})
+  list(APPEND LIBS ${name})
+ENDMACRO()
+
+ADD_SHIPPED_LIB(stat)
+ADD_SHIPPED_LIB(terralib)
+ADD_SHIPPED_LIB(dxflib)
+ADD_SHIPPED_LIB(tiff)
+ADD_SHIPPED_LIB(shapelib)
+ADD_SHIPPED_LIB(TeDXF)
+ADD_SHIPPED_LIB(libspl)
+ADD_SHIPPED_LIB(qwt) # TODO: allow using external qwt library?
+ADD_SHIPPED_LIB(terralibpdi)
+
+# SET_TARGET_PROPERTIES(project_test PROPERTIES LINKER_LANGUAGE C)
+
+# libraries: also see ADD_SHIPPED_LIB calls
+target_link_libraries(terraView ${QT_LIBRARIES} ${LIBS}
+  clntsh crypt ltidsdk gdal terralibpdi GL GLU 
+
+  drm
+  # make these optional: (TODO make optional)
+
+  # mysql
+  mysqlclient 
+  # Firebird
+  fbembed
+  # Postgresql (Postgis) ?
+  pq 
+  # Oracle
+  nnz11 
+) 
+
+# for testing only: copy pixmaps into build directory so that terraView finds
+# them:
+
+file(GLOB BMPS $(TERRALIB_DIR)/terraView/ui/images/*)
+file(COPY ${BMPS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/build/cmake/terraViewCore/CMakeLists.txt b/build/cmake/terraViewCore/CMakeLists.txt
new file mode 100644
index 0000000..7592f41
--- /dev/null
+++ b/build/cmake/terraViewCore/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "terraViewCore")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/terraViewCore)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/terralib/CMakeLists.txt b/build/cmake/terralib/CMakeLists.txt
new file mode 100644
index 0000000..e26ebc0
--- /dev/null
+++ b/build/cmake/terralib/CMakeLists.txt
@@ -0,0 +1,39 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "terralib")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/terralib/kernel)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+list(APPEND SRCS
+  ${ROOT}/../drivers/libjpeg/TeLibJpegWrapper.cpp
+  ${ROOT}/../drivers/libjpeg/jmemdst.c
+  ${ROOT}/../drivers/libjpeg/jmemsrc.c
+)
+
+# these files are present but are not used
+list(REMOVE_ITEM SRCS
+  ${ROOT}/TeBlockLoader.cpp
+  ${ROOT}/TeConsoleErrorMessage.cpp
+  ${ROOT}/TeCoverageImportUtils.cpp
+  ${ROOT}/TeCoverageUtils.cpp
+  ${ROOT}/TeViewTreeIterator.cpp
+  ${ROOT}/TeViewTreeUtils.cpp
+)
+
+# TODO
+# ${ROOT}/TeGraph.cpp not listed in .pro but still required? Is this the place to compile it?
+
+include_directories(
+  $(TERRALIB_DIR)/src/terralib/kernel
+
+  # TODO: this must be separate projects ?
+  $(TERRALIB_DIR)/src/tiff
+  ${DRIVER_INCLUDES}
+  $(TERRALIB_DIR)/src/terralib/drivers/libjpeg
+)
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/terralibdtm/CMakeLists.txt b/build/cmake/terralibdtm/CMakeLists.txt
new file mode 100644
index 0000000..2ff604a
--- /dev/null
+++ b/build/cmake/terralibdtm/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "terralibdtm")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/terralibdtm)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+include_directories(${ROOT})
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
diff --git a/build/cmake/terralibpdi/CMakeLists.txt b/build/cmake/terralibpdi/CMakeLists.txt
new file mode 100644
index 0000000..0ad006b
--- /dev/null
+++ b/build/cmake/terralibpdi/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 2.8)
+
+SET(LIB_NAME "terralibpdi")
+
+project(${LIB_NAME})
+
+SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/terralib/image_processing)
+
+file(GLOB SRCS ${ROOT}/*.cpp)
+
+# these files are present but are not used
+list(REMOVE_ITEM SRCS
+  ${ROOT}/TePDIRasterRUBuffer.cpp
+)
+
+include_directories(
+  ${ROOT}
+  $(TERRALIB_DIR)/src/terralib/kernel
+)
+
+add_library(${LIB_NAME} SHARED ${SRCS} )
+target_link_libraries(${LIB_NAME})
diff --git a/build/cmake/tiff/CMakeLists.txt b/build/cmake/tiff/CMakeLists.txt
new file mode 100644
index 0000000..2b756e2
--- /dev/null
+++ b/build/cmake/tiff/CMakeLists.txt
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(tiff C)
+
+SET(TIFF_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/$(TERRALIB_DIR)/src/tiff)
+
+file(GLOB SRCS ${TIFF_ROOT}/*.c)
+
+# don't know much about this file, was not used by the qmake build system and
+# would cause duplicate symbols
+list(REMOVE_ITEM SRCS ${TIFF_ROOT}/fax3sm.c)
+
+# only keep the tif_OS.c version we need for this OS target:
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+  list(REMOVE_ITEM SRCS ${TIFF_ROOT}/tif_win32.c)
+ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Window")
+  list(REMOVE_ITEM SRCS ${TIFF_ROOT}/tif_unix.c)
+ELSE()
+  MESSAGE(FATAL_ERROR "OS not yet supported? Which tif_* version should be used?")
+ENDIF()
+
+include_directories(${TIFF_ROOT})
+
+add_library(tiff SHARED ${SRCS} )
diff --git a/build/qt/Firebird/Firebird.pro b/build/qt/Firebird/Firebird.pro
new file mode 100644
index 0000000..085f8dd
--- /dev/null
+++ b/build/qt/Firebird/Firebird.pro
@@ -0,0 +1,25 @@
+CONFIG += dll
+TARGET = te_firebird
+TEMPLATE = lib
+include (../config.pri)
+
+DEFINES += TLFIREBIRD_AS_DLL
+
+LIBS += -lterralib 
+unix:LIBS += -L$${TERRALIBPATH}/dependencies/linux/Firebird/lib \
+		-lfbembed
+
+win32:DEFINES += IBPP_WINDOWS
+unix:DEFINES += IBPP_LINUX
+
+INCLUDEPATH += $$TERRALIBPATH/src/terralib/drivers/Firebird  
+
+HEADERS += $$TERRALIBPATH/src/terralib/drivers/Firebird/ibpp/core/_ibpp.h \
+	  $$TERRALIBPATH/src/terralib/drivers/Firebird/ibpp/core/ibase.h \
+	  $$TERRALIBPATH/src/terralib/drivers/Firebird/ibpp/core/iberror.h \
+	  $$TERRALIBPATH/src/terralib/drivers/Firebird/ibpp/core/ibpp.h \
+	  $$TERRALIBPATH/src/terralib/drivers/Firebird/TeFirebird.h \
+	  $$TERRALIBPATH/src/terralib/drivers/Firebird/TeFirebirdDefines.h 
+
+SOURCES += $$TERRALIBPATH/src/terralib/drivers/Firebird/TeFirebird.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/Firebird/ibpp/core/all_in_one.cpp 
diff --git a/build/qt/Makefile b/build/qt/Makefile
new file mode 100644
index 0000000..578d141
--- /dev/null
+++ b/build/qt/Makefile
@@ -0,0 +1,81 @@
+all: release
+
+debug: install_deps_dbg qmake_dbg build_dbg
+
+release: install_deps qmake build
+
+
+#Debug config
+#----------------
+install_deps_dbg:
+	mkdir -p ../../Debug/linux-g++
+	cd ../../Debug/linux-g++; rm -f libclntsh.so; ln -s ../../dependencies/linux/Oracle/lib/libclntsh.so.10.1 libclntsh.so
+	cd ../../Debug/linux-g++; rm -f libclntsh.so.10.1; ln -s ../../dependencies/linux/Oracle/lib/libclntsh.so.10.1 libclntsh.so.10.1
+	cd ../../Debug/linux-g++; rm -f libnnz10.so; ln -s ../../dependencies/linux/Oracle/lib/libnnz10.so libnnz10.so
+	cd ../../Debug/linux-g++; rm -f libpq.a; ln -s ../../dependencies/linux/PostgreSQL/lib/libpq.a libpq.a
+	cd ../../Debug/linux-g++; rm -f libmysqlclient.a; ln -s ../../dependencies/linux/MySQL/lib/libmysqlclient.a libmysqlclient.a
+	cd ../../Debug/linux-g++; rm -f libGL.so; ln -s ../../dependencies/linux/opengl/lib/libGL.so libGL.so
+	cd ../../Debug/linux-g++; rm -f libGL.so.1; ln -s ../../dependencies/linux/opengl/lib/libGL.so libGL.so.1
+	cd ../../Debug/linux-g++; rm -f libGLU.so; ln -s ../../dependencies/linux/opengl/lib/libGLU.so libGLU.so
+	cd ../../Debug/linux-g++; rm -f libGLU.so.1; ln -s ../../dependencies/linux/opengl/lib/libGLU.so libGLU.so.1
+	cd ../../Debug/linux-g++; rm -f libdrm.so; ln -s ../../dependencies/linux/opengl/lib/libdrm.so libdrm.so
+	cd ../../Debug/linux-g++; rm -f libdrm.so.2; ln -s ../../dependencies/linux/opengl/lib/libdrm.so libdrm.so.2
+	cd ../../Debug/linux-g++; rm -f libfbembed.so; ln -s ../../dependencies/linux/Firebird/lib/libfbembed.so libfbembed.so
+	cd ../../Debug/linux-g++; rm -f libfbembed.so.2; ln -s ../../dependencies/linux/Firebird/lib/libfbembed.so libfbembed.so.2
+	cd ../../Debug/linux-g++; rm -f libfbembed.so.2.0.3; ln -s ../../dependencies/linux/Firebird/lib/libfbembed.so libfbembed.so.2.0.3
+	cd ../../Debug/linux-g++; rm -f libicudata.so; ln -s ../../dependencies/linux/Firebird/lib/libicudata.so.30 libicudata.so
+	cd ../../Debug/linux-g++; rm -f libicudata.so.30; ln -s ../../dependencies/linux/Firebird/lib/libicudata.so.30 libicudata.so.30
+	cd ../../Debug/linux-g++; rm -f libicudata.so.30.0; ln -s ../../dependencies/linux/Firebird/lib/libicudata.so.30 libicudata.so.30.0
+	cd ../../Debug/linux-g++; rm -f libicui18n.so.30; ln -s ../../dependencies/linux/Firebird/lib/libicui18n.so.30 libicui18n.so.30
+	cd ../../Debug/linux-g++; rm -f libicui18n.so; ln -s ../../dependencies/linux/Firebird/lib/libicui18n.so.30 libicui18n.so
+	cd ../../Debug/linux-g++; rm -f libicui18n.so.30.0; ln -s ../../dependencies/linux/Firebird/lib/libicui18n.so.30 libicui18n.so.30.0
+	cd ../../Debug/linux-g++; rm -f libicuuc.so; ln -s ../../dependencies/linux/Firebird/lib/libicuuc.so.30 libicuuc.so
+	cd ../../Debug/linux-g++; rm -f libicuuc.so.30; ln -s ../../dependencies/linux/Firebird/lib/libicuuc.so.30 libicuuc.so.30
+	cd ../../Debug/linux-g++; rm -f libicuuc.so.30.0; ln -s ../../dependencies/linux/Firebird/lib/libicuuc.so.30 libicuuc.so.30.0
+
+qmake_dbg:
+	qmake terraView.pro MAKEFILE=Makefile.Debug TE_PROJECT_TYPE=DEBUG TEDRIVERS=ALLDRIVERS
+	
+build_dbg:
+	make -f Makefile.Debug && make -f Makefile.Debug install
+	
+clean_debug:
+	make -f Makefile.Debug distclean; rm -rf ../../../Debug
+
+#Release config
+#---------------
+install_deps:
+	mkdir -p ../../Release/linux-g++
+	cd ../../Release/linux-g++; rm -f libclntsh.so; ln -s ../../dependencies/linux/Oracle/lib/libclntsh.so.10.1 libclntsh.so
+	cd ../../Release/linux-g++; rm -f libclntsh.so.10.1; ln -s ../../dependencies/linux/Oracle/lib/libclntsh.so.10.1 libclntsh.so.10.1
+	cd ../../Release/linux-g++; rm -f libnnz10.so; ln -s ../../dependencies/linux/Oracle/lib/libnnz10.so libnnz10.so
+	cd ../../Release/linux-g++; rm -f libpq.a; ln -s ../../dependencies/linux/PostgreSQL/lib/libpq.a libpq.a
+	cd ../../Release/linux-g++; rm -f libmysqlclient.a; ln -s ../../dependencies/linux/MySQL/lib/libmysqlclient.a libmysqlclient.a
+	cd ../../Release/linux-g++; rm -f libGL.so; ln -s ../../dependencies/linux/opengl/lib/libGL.so libGL.so
+	cd ../../Release/linux-g++; rm -f libGL.so.1; ln -s ../../dependencies/linux/opengl/lib/libGL.so libGL.so.1
+	cd ../../Release/linux-g++; rm -f libGLU.so; ln -s ../../dependencies/linux/opengl/lib/libGLU.so libGLU.so
+	cd ../../Release/linux-g++; rm -f libGLU.so.1; ln -s ../../dependencies/linux/opengl/lib/libGLU.so libGLU.so.1
+	cd ../../Release/linux-g++; rm -f libdrm.so; ln -s ../../dependencies/linux/opengl/lib/libdrm.so libdrm.so
+	cd ../../Release/linux-g++; rm -f libdrm.so.2; ln -s ../../dependencies/linux/opengl/lib/libdrm.so libdrm.so.2
+	cd ../../Release/linux-g++; rm -f libfbembed.so; ln -s ../../dependencies/linux/Firebird/lib/libfbembed.so libfbembed.so
+	cd ../../Release/linux-g++; rm -f libfbembed.so.2; ln -s ../../dependencies/linux/Firebird/lib/libfbembed.so libfbembed.so.2
+	cd ../../Release/linux-g++; rm -f libfbembed.so.2.0.3; ln -s ../../dependencies/linux/Firebird/lib/libfbembed.so libfbembed.so.2.0.3
+	cd ../../Release/linux-g++; rm -f libicudata.so; ln -s ../../dependencies/linux/Firebird/lib/libicudata.so.30 libicudata.so
+	cd ../../Release/linux-g++; rm -f libicudata.so.30; ln -s ../../dependencies/linux/Firebird/lib/libicudata.so.30 libicudata.so.30
+	cd ../../Release/linux-g++; rm -f libicudata.so.30.0; ln -s ../../dependencies/linux/Firebird/lib/libicudata.so.30 libicudata.so.30.0
+	cd ../../Release/linux-g++; rm -f libicui18n.so; ln -s ../../dependencies/linux/Firebird/lib/libicui18n.so.30 libicui18n.so
+	cd ../../Release/linux-g++; rm -f libicui18n.so.30; ln -s ../../dependencies/linux/Firebird/lib/libicui18n.so.30 libicui18n.so.30
+	cd ../../Release/linux-g++; rm -f libicui18n.so.30.0; ln -s ../../dependencies/linux/Firebird/lib/libicui18n.so.30 libicui18n.so.30.0
+	cd ../../Release/linux-g++; rm -f libicuuc.so; ln -s ../../dependencies/linux/Firebird/lib/libicuuc.so.30 libicuuc.so
+	cd ../../Release/linux-g++; rm -f libicuuc.so.30; ln -s ../../dependencies/linux/Firebird/lib/libicuuc.so.30 libicuuc.so.30
+	cd ../../Release/linux-g++; rm -f libicuuc.so.30.0; ln -s ../../dependencies/linux/Firebird/lib/libicuuc.so.30 libicuuc.so.30.0
+
+qmake:
+	qmake terraView.pro MAKEFILE=Makefile.Release TEDRIVERS=ALLDRIVERS
+	
+build:
+	make -f Makefile.Release && make -f Makefile.Release install
+	
+clean:
+	make -f Makefile.Release distclean; rm -rf ../../Release
+
diff --git a/build/qt/MySQL/MySQL.pro b/build/qt/MySQL/MySQL.pro
new file mode 100644
index 0000000..731edad
--- /dev/null
+++ b/build/qt/MySQL/MySQL.pro
@@ -0,0 +1,27 @@
+CONFIG += dll
+TARGET = te_mysql
+
+include (../config.pri)
+
+DEFINES += TLMYSQL_AS_DLL
+
+LIBS += -lterralib 
+
+win32 {
+    !win32-g++ {
+	    QMAKE_LIBDIR += $$TERRALIBPATH/dependencies/win32/MySQL/lib/ms
+	    LIBS += -llibmysql
+    }
+    else:LIBS += -L$$TERRALIBPATH/dependencies/win32/MySQL/lib/mingw -lmysql_mingw
+}
+
+unix:LIBS += -L$${TERRALIBPATH}/dependencies/linux/MySQL/lib \
+		-lmysqlclient
+
+INCLUDEPATH += $$TERRALIBPATH/src/terralib/drivers/MySQL  \
+	      $$TERRALIBPATH/src/terralib/drivers/MySQL/include
+
+HEADERS += $$TERRALIBPATH/src/terralib/drivers/MySQL/TeMySQL.h \
+	$$TERRALIBPATH/src/terralib/drivers/MySQL/TeMySQLDefines.h 
+
+SOURCES += $$TERRALIBPATH/src/terralib/drivers/MySQL/TeMySQL.cpp
\ No newline at end of file
diff --git a/build/qt/Oracle/Oracle.pro b/build/qt/Oracle/Oracle.pro
new file mode 100644
index 0000000..84490cd
--- /dev/null
+++ b/build/qt/Oracle/Oracle.pro
@@ -0,0 +1,40 @@
+CONFIG += dll
+TARGET = te_oracle
+
+include (../config.pri)
+
+DEFINES += TLORACLE_AS_DLL
+
+LIBS += -lterralib 
+
+win32 {
+     !win32-g++:QMAKE_LIBDIR += $$TERRALIBPATH/dependencies/win32/Oracle/lib
+     else:LIBS += -L$$TERRALIBPATH/dependencies/win32/Oracle/lib
+
+     LIBS += -loci
+}
+
+unix:LIBS += -L$${TERRALIBPATH}/dependencies/linux/Oracle/lib \
+		-lclntsh -lnnz10
+
+INCLUDEPATH += $$TERRALIBPATH/src/terralib/drivers/Oracle  \
+	      $$TERRALIBPATH/src/terralib/drivers/Oracle/OCI/include
+
+HEADERS += $$TERRALIBPATH/src/terralib/drivers/Oracle/TeOracleSpatial.h \
+	$$TERRALIBPATH/src/terralib/drivers/Oracle/TeOCIOracle.h \
+	$$TERRALIBPATH/src/terralib/drivers/Oracle/TeOCIConnect.h \
+	$$TERRALIBPATH/src/terralib/drivers/Oracle/TeOCICursor.h \
+	$$TERRALIBPATH/src/terralib/drivers/Oracle/TeOCISDO.h \
+	$$TERRALIBPATH/src/terralib/drivers/Oracle/TeOracleDefines.h 
+
+SOURCES += $$TERRALIBPATH/src/terralib/drivers/Oracle/TeOracleSpatial.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/Oracle/TeOCIOracle.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/Oracle/TeOCIConnect.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/Oracle/TeOCICursor.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/Oracle/TeOCISDO.cpp 
+
+unix {
+	create_link.commands = cd $${TERRALIBPATH}/dependencies/linux/Oracle/lib/ && ln -sf libclntsh.so.10.1 libclntsh.so
+	QMAKE_EXTRA_UNIX_TARGETS += create_link
+	PRE_TARGETDEPS += create_link
+}
\ No newline at end of file
diff --git a/build/qt/PostgreSQL/PostgreSQL.pro b/build/qt/PostgreSQL/PostgreSQL.pro
new file mode 100644
index 0000000..ced19e2
--- /dev/null
+++ b/build/qt/PostgreSQL/PostgreSQL.pro
@@ -0,0 +1,31 @@
+CONFIG += dll
+TARGET = te_postgresql
+
+include (../config.pri)
+
+DEFINES += TLPOSTGRESQL_AS_DLL
+
+LIBS += -lterralib 
+
+win32 {
+	win32-g++:LIBS += -L$$TERRALIBPATH/dependencies/win32/PostgreSQL/lib \
+			   		-lwsock32
+	else:QMAKE_LIBDIR += $$$$TERRALIBPATH/dependencies/win32/PostgreSQL/lib
+	LIBS += -llibpq
+}
+unix:LIBS += -L$${TERRALIBPATH}/dependencies/linux/PostgreSQL/lib \
+		-lpq -lcrypt
+
+INCLUDEPATH += $$TERRALIBPATH/src/terralib/drivers/PostgreSQL  \
+	      $$TERRALIBPATH/src/terralib/drivers/PostgreSQL/includepg
+
+HEADERS += $$TERRALIBPATH/src/terralib/drivers/PostgreSQL/TePGInterface.h \
+	$$TERRALIBPATH/src/terralib/drivers/PostgreSQL/TePGUtils.h \
+	$$TERRALIBPATH/src/terralib/drivers/PostgreSQL/TePostgreSQL.h \
+	$$TERRALIBPATH/src/terralib/drivers/PostgreSQL/TePostGIS.h \ 
+	$$TERRALIBPATH/src/terralib/drivers/PostgreSQL/TePostgreSQLDefines.h  
+
+SOURCES += $$TERRALIBPATH/src/terralib/drivers/PostgreSQL/TePGInterface.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/PostgreSQL/TePGUtils.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/PostgreSQL/TePostgreSQL.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/PostgreSQL/TePostGIS.cpp 
\ No newline at end of file
diff --git a/build/qt/appUtils/appUtils.pro b/build/qt/appUtils/appUtils.pro
new file mode 100644
index 0000000..9d793f8
--- /dev/null
+++ b/build/qt/appUtils/appUtils.pro
@@ -0,0 +1,91 @@
+CONFIG += dll
+TARGET = te_apputils
+
+include (../config.pri)
+
+# Directory definitions
+UTILSSRC = $$TERRALIBPATH/src/appUtils
+QTDRVSRC = $$TERRALIBPATH/src/terralib/drivers/qt
+debug:TEOUT = $$TERRALIBPATH/Debug
+release:TEOUT = $$TERRALIBPATH/Release
+# --------------------
+CONFIG += qt
+DEFINES += TLAPPUTILS_AS_DLL
+
+MOC_DIR = $$TERRALIBPATH/moc/appUtils
+UI_DIR = $$TERRALIBPATH/ui/appUtils
+
+win32 {
+	!win32-g++:QMAKE_LIBDIR += $$TEOUT/te_utils \
+								$$TEOUT/stat
+	LIBS += -lopengl32 -lglu32
+	DEFINES	+= UNICODE
+}
+unix:LIBS += -lGL -lGLU 
+LIBS += -lterralib -lte_utils -lstat
+
+INCLUDEPATH += $$UTILSSRC \
+			$$QTDRVSRC \
+			$$TERRALIBPATH/src/terralib/utils \
+			$$TERRALIBPATH/src/terralib/stat \
+			$$TERRALIBPATH/terraView/ui
+
+HEADERS += $$UTILSSRC/TeAppUtilsDefines.h \
+		$$UTILSSRC/TeAppTheme.h \
+		$$UTILSSRC/TeApplicationUtils.h \
+		$$UTILSSRC/TePlotTheme.h \
+		$$UTILSSRC/TePlotView.h \
+		$$QTDRVSRC/TeQtAnimaThread.h \
+		$$QTDRVSRC/TeQtCanvas.h \
+		$$QTDRVSRC/TeQtChartItem.h \
+		$$QTDRVSRC/TeQtCheckListItem.h \
+		$$QTDRVSRC/TeQtColorBar.h \
+		$$QTDRVSRC/TeQtDatabaseItem.h \
+		$$QTDRVSRC/TeQtDatabasesListView.h \
+		$$QTDRVSRC/TeQtFrame.h \
+		$$QTDRVSRC/TeQtGLWidget.h \
+		$$QTDRVSRC/TeQtDataSource.h \
+		$$QTDRVSRC/TeQtGrid.h \
+		$$QTDRVSRC/TeQtLayerItem.h \
+		$$QTDRVSRC/TeQtLegendItem.h \
+		$$QTDRVSRC/TeQtLegendSource.h \
+		$$QTDRVSRC/TeQtShowMedia.h \
+		$$QTDRVSRC/TeQtBigTable.h \
+		$$QTDRVSRC/TeQtTable.h \
+		$$QTDRVSRC/TeQtTextEdit.h \
+		$$QTDRVSRC/TeQtThemeItem.h \
+		$$QTDRVSRC/TeQtViewItem.h \
+		$$QTDRVSRC/TeQtViewsListView.h \
+		$$QTDRVSRC/TeWaitCursor.h \
+		$$QTDRVSRC/TeGUIUtils.h \
+		$$QTDRVSRC/TeQtProgress.h \
+		$$QTDRVSRC/TeDecoderQtImage.h 
+SOURCES += $$UTILSSRC/TeAppTheme.cpp \
+		$$UTILSSRC/TeApplicationUtils.cpp \
+		$$QTDRVSRC/TeQtAnimaThread.cpp \
+		$$QTDRVSRC/TeQtCanvas.cpp \
+		$$QTDRVSRC/TeQtChartItem.cpp \
+		$$QTDRVSRC/TeQtCheckListItem.cpp \
+		$$QTDRVSRC/TeQtColorBar.cpp \
+		$$QTDRVSRC/TeQtDatabaseItem.cpp \
+		$$QTDRVSRC/TeQtDatabasesListView.cpp \
+		$$QTDRVSRC/TeQtFrame.cpp \
+		$$QTDRVSRC/TeQtGLWidget.cpp \
+		$$QTDRVSRC/TeQtGrid.cpp \
+		$$QTDRVSRC/TeQtLayerItem.cpp \
+		$$QTDRVSRC/TeQtLegendItem.cpp \
+		$$QTDRVSRC/TeQtLegendSource.cpp \
+		$$QTDRVSRC/TeQtShowMedia.cpp \
+		$$QTDRVSRC/TeQtBigTable.cpp \
+		$$QTDRVSRC/TeQtTable.cpp \
+		$$QTDRVSRC/TeQtTextEdit.cpp \
+		$$QTDRVSRC/TeQtThemeItem.cpp \
+		$$QTDRVSRC/TeQtViewItem.cpp \
+		$$QTDRVSRC/TeQtViewsListView.cpp \
+		$$QTDRVSRC/TeWaitCursor.cpp \
+		$$QTDRVSRC/TeGUIUtils.cpp \
+		$$QTDRVSRC/TeDecoderQtImage.cpp 
+FORMS += $$UTILSSRC/ui/animation.ui \
+		$$UTILSSRC/ui/help.ui \
+		$$UTILSSRC/ui/mediaDescription.ui \
+		$$UTILSSRC/ui/urlWindow.ui
\ No newline at end of file
diff --git a/build/qt/config.pri b/build/qt/config.pri
new file mode 100644
index 0000000..69f416c
--- /dev/null
+++ b/build/qt/config.pri
@@ -0,0 +1,57 @@
+#Defining paths
+#-----------------------------
+isEmpty(TERRALIBPATH) {
+  # Trying to get it from the user environment variable with the same name
+  TERRALIBPATH = $$(TERRALIB_DIR)
+  
+  # The default - if none of previews attempts succeed
+  isEmpty(TERRALIBPATH) {
+	 TERRALIBPATH = ../../..
+  } 
+}
+#-----------------------------
+TEMPLATE = lib
+VERSION = 3.6.1
+CONFIG	+= warn_on \
+		rtti \
+		exceptions \
+		thread 
+CONFIG -= qt		
+LANGUAGE	= C++
+#------------------------------
+# Configure to debug or release
+#------------------------------
+isEmpty(TE_PROJECT_TYPE) {
+  # Trying to get it from the user environment variable with the same name
+  TE_PROJECT_TYPE = $$(TE_PROJECT_TYPE)
+
+  # The default - if none of previews attempts succeed
+  isEmpty(TE_PROJECT_TYPE) {
+    TE_PROJECT_TYPE=RELEASE
+  }
+}
+contains(TE_PROJECT_TYPE , DEBUG) {
+    CONFIG += debug
+    CONFIG -= release
+}
+contains(TE_PROJECT_TYPE , RELEASE) {
+    CONFIG += release
+    CONFIG -= debug
+}
+#-----------------------------
+#Dependencies definitions
+#-----------------------------
+BUILDLOC = Debug
+debug:DEFINES = _DEBUG
+release {
+	DEFINES = NDEBUG
+	BUILDLOC = Release
+}
+unix:DESTDIR = $$TERRALIBPATH/$$BUILDLOC/linux-g++
+OBJECTS_DIR = $$DESTDIR/obj/$$TARGET
+LIBS += -L$$DESTDIR 
+INCLUDEPATH += $$TERRALIBPATH/src/terralib/kernel
+win32 {
+	win32-g++:include(config_win32-g++.pri)
+	else:include(config_win32-msvc.pri)
+}
\ No newline at end of file
diff --git a/build/qt/config_win32-g++.pri b/build/qt/config_win32-g++.pri
new file mode 100644
index 0000000..aea0ede
--- /dev/null
+++ b/build/qt/config_win32-g++.pri
@@ -0,0 +1,4 @@
+DEFINES += WIN32
+DESTDIR = $$TERRALIBPATH/$$BUILDLOC/win32-g++
+OBJECTS_DIR = $$DESTDIR/obj/$$TARGET
+LIBS += -L$$DESTDIR
\ No newline at end of file
diff --git a/build/qt/config_win32-msvc.pri b/build/qt/config_win32-msvc.pri
new file mode 100644
index 0000000..c266597
--- /dev/null
+++ b/build/qt/config_win32-msvc.pri
@@ -0,0 +1,24 @@
+DEFINES += WIN32
+DESTDIR = $$TERRALIBPATH/$$BUILDLOC/$$TARGET
+OBJECTS_DIR = $$DESTDIR
+CONFIG -= incremental
+QMAKE_LIBDIR += $$TERRALIBPATH/$$BUILDLOC/terralib
+debug {
+	contains(CONFIG, dll) {
+		 QMAKE_CFLAGS_MT_DLLDBG += -MDd
+		 QMAKE_CXXFLAGS_MT_DLLDBG += -MDd -Od -Fd$$OBJECTS_DIR/
+	}
+}
+release {
+	contains(CONFIG, dll) {
+		 QMAKE_CFLAGS_MT_DLL += -O2
+		 QMAKE_CXXFLAGS_MT_DLL += -O2 -Fd$$OBJECTS_DIR/
+	}
+}
+QMAKE_LFLAGS += /IMPLIB:$(OutDir)/$(ProjectName).lib
+QMAKE_LFLAGS -= /NOLOGO 
+QMAKE_LFLAGS += /PDB:$(OutDir)/$(ProjectName).pdb
+QMAKE_CFLAGS += /GS -wd4100
+QMAKE_CXXFLAGS += /GS -wd4100
+QMAKE_CFLAGS_DEBUG += -RTC1 
+QMAKE_CXXFLAGS_DEBUG += -RTC1 
diff --git a/build/qt/dxflib/dxflib.pro b/build/qt/dxflib/dxflib.pro
new file mode 100644
index 0000000..602597d
--- /dev/null
+++ b/build/qt/dxflib/dxflib.pro
@@ -0,0 +1,31 @@
+TARGET = dxf
+CONFIG += warn_on rtti exceptions
+win32:CONFIG += staticlib
+unix:CONFIG += dll
+
+include (../config.pri)
+
+SRCPATH = $$TERRALIBPATH/src/dxflib
+
+win32-msvc {
+  DEFINES += _CRT_SECURE_NO_DEPRECATE
+}
+
+macx {
+  QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.5.sdk
+  CONFIG+=x86 ppc
+}
+
+INCLUDEPATH += $$SRCPATH
+HEADERS += $$SRCPATH/dl_attributes.h\
+    $$SRCPATH/dl_codes.h\
+    $$SRCPATH/dl_creationadapter.h\
+    $$SRCPATH/dl_creationinterface.h\
+    $$SRCPATH/dl_dxf.h\
+    $$SRCPATH/dl_entities.h\
+    $$SRCPATH/dl_exception.h\
+    $$SRCPATH/dl_extrusion.h\
+    $$SRCPATH/dl_writer.h\
+    $$SRCPATH/dl_writer_ascii.h
+SOURCES += $$SRCPATH/dl_dxf.cpp\
+    $$SRCPATH/dl_writer_ascii.cpp
diff --git a/build/qt/image_processing/image_processing.pro b/build/qt/image_processing/image_processing.pro
new file mode 100644
index 0000000..ae6333a
--- /dev/null
+++ b/build/qt/image_processing/image_processing.pro
@@ -0,0 +1,266 @@
+TARGET  = terralibpdi
+CONFIG += dll 
+include (../config.pri)
+TERRALIB_SRC_DIR = $$TERRALIBPATH/src
+LIBPDI_SRC_DIR = $$TERRALIB_SRC_DIR/terralib/image_processing
+DEFINES += PDI_AS_DLL
+
+LIBS += -ljpeg -lterralib
+
+win32 {
+	win32-g++:LIBS += -L../../../dependencies/win32/zlib/lib 
+	else:QMAKE_LIBDIR += ../../../dependencies/win32/zlib/lib
+	LIBS += -lzlibdll
+}
+unix:LIBS += -lz -lpthread
+LIBS += -lterralibtiff
+INCLUDEPATH = \
+  $$TERRALIB_SRC_DIR/terralib/kernel \
+  $$TERRALIB_SRC_DIR/terralib/functions \
+  $$TERRALIB_SRC_DIR/tiff \
+  $$LIBPDI_SRC_DIR \
+  $$LIBPDI_SRC_DIR/data_structs
+INCLUDEPATH = \
+  $$TERRALIB_SRC_DIR/terralib/kernel \
+  $$TERRALIB_SRC_DIR/terralib/functions \
+  $$TERRALIB_SRC_DIR/tiff \
+  $$LIBPDI_SRC_DIR \
+  $$LIBPDI_SRC_DIR/data_structs
+
+HEADERS = \
+          $$LIBPDI_SRC_DIR/TePDITileIndexer.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMatrix.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMatrixFunctions.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMathFunctions.hpp \
+          $$LIBPDI_SRC_DIR/TePDIUtils.hpp \
+          $$LIBPDI_SRC_DIR/TePDITypes.hpp \
+          $$LIBPDI_SRC_DIR/TePDIPIManager.hpp \
+          $$LIBPDI_SRC_DIR/TePDIHistogram.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRgbPaletteNode.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRgbPalette.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRgbPaletteFunctions.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParameters.hpp \
+          $$LIBPDI_SRC_DIR/TePDIAlgorithm.hpp \
+          $$LIBPDI_SRC_DIR/TePDIAlgorithmFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIStatistic.hpp \
+          $$LIBPDI_SRC_DIR/TePDILevelRemap.hpp \
+          $$LIBPDI_SRC_DIR/TePDIContrast.hpp \
+          $$LIBPDI_SRC_DIR/TePDIContrastFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIFilterMask.hpp \
+          $$LIBPDI_SRC_DIR/TePDIBufferedFilter.hpp \
+          $$LIBPDI_SRC_DIR/TePDILinearFilter.hpp \
+          $$LIBPDI_SRC_DIR/TePDILinearFilterFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIBDFilter.hpp \
+          $$LIBPDI_SRC_DIR/TePDIBDFilterFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMorfFilter.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMorfFilterFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarFilter.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarLeeFilter.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarLeeFilterFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarKuanFilter.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarKuanFilterFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarFrostFilter.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarFrostFilterFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIArithmetic.hpp \
+          $$LIBPDI_SRC_DIR/TePDIArithmeticFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRaster2Vector.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRaster2VectorFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIColorTransform.hpp \
+          $$LIBPDI_SRC_DIR/TePDIColorTransformFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIPrincipalComponents.hpp \
+          $$LIBPDI_SRC_DIR/TePDIPrincipalComponentsFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMallatWavelets.hpp \
+          $$LIBPDI_SRC_DIR/TePDIGeoMosaic.hpp \
+          $$LIBPDI_SRC_DIR/TePDIBatchGeoMosaic.hpp \
+          $$LIBPDI_SRC_DIR/TePDIStrategy.hpp \
+          $$LIBPDI_SRC_DIR/TePDIStrategyFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIGarguetFusion.hpp \
+          $$LIBPDI_SRC_DIR/TePDIVenturaFusion.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRegGrowSeg.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRegGrowSegFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRegister.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRegisterFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIInterpolator.hpp \
+          $$LIBPDI_SRC_DIR/TePDIEspecData.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRegion.hpp \
+          $$LIBPDI_SRC_DIR/TePDICluster.hpp \
+          $$LIBPDI_SRC_DIR/TePDIIsosegClas.hpp \
+          $$LIBPDI_SRC_DIR/TePDIIsosegClasFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIHaralick.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelComponent.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelComponentList.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModel.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelSpectralBand.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelSpectralBandList.hpp \
+          $$LIBPDI_SRC_DIR/TePDIPrincoMixModelSF.hpp \
+          $$LIBPDI_SRC_DIR/TePDIPrincoMixModelStrategy.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelStrategy.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelStratFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIKMeansClas.hpp \
+          $$LIBPDI_SRC_DIR/TePDIKMeansClasFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIEMClas.hpp \
+          $$LIBPDI_SRC_DIR/TePDIEMClasFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDISensorSimulatorFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDISensorSimulator.hpp \
+          $$LIBPDI_SRC_DIR/TePDIPIManagerGlobalSettings.hpp \
+          $$LIBPDI_SRC_DIR/TePDIOFMatching.hpp \
+          $$LIBPDI_SRC_DIR/TePDIPrincipalComponentsFusion.hpp \
+          $$LIBPDI_SRC_DIR/TePDIDecorrelationEnhancement.hpp \
+          $$LIBPDI_SRC_DIR/TePDICorrelationMatching.hpp \
+          $$LIBPDI_SRC_DIR/TePDIBaatz.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMIMatching.hpp \
+          $$LIBPDI_SRC_DIR/TePDIJointHistogram.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMtxDoubleAdpt.hpp \
+          $$LIBPDI_SRC_DIR/TePDIMMIOMatching.hpp \
+          $$LIBPDI_SRC_DIR/TePDIIHSFusion.hpp \
+          $$LIBPDI_SRC_DIR/TePDIFusionIndexes.hpp \
+          $$LIBPDI_SRC_DIR/TePDIGeneralizedIHSFusion.hpp \
+          $$LIBPDI_SRC_DIR/TePDIIHSWaveletFusion.hpp \
+          $$LIBPDI_SRC_DIR/TePDIPCAWaveletFusion.hpp \ 
+          $$LIBPDI_SRC_DIR/TePDIWaveletAtrousFusion.hpp \
+          $$LIBPDI_SRC_DIR/TePDIWiSpeRFusion.hpp \
+          $$LIBPDI_SRC_DIR/TePDIWaveletAtrous.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParallelSegmenter.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegStrategy.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegStrategyFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegSegment.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegSegmentsBlock.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegStrategyFactoryParams.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegRegGrowStrategy.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegRegGrowStrategyFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegBaatzStrategy.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegBaatzStrategyFactory.hpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegStrategyParams.hpp \
+          $$LIBPDI_SRC_DIR/TePDIBlender.hpp \
+          $$LIBPDI_SRC_DIR/TePDITPMosaic.hpp \
+          $$LIBPDI_SRC_DIR/TePDISAMClassifier.hpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarGammaFilter.hpp
+
+
+SOURCES = \
+          $$LIBPDI_SRC_DIR/TePDIMathFunctions.cpp \
+          $$LIBPDI_SRC_DIR/TePDIUtils.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMatrixFunctions.cpp \
+          $$LIBPDI_SRC_DIR/TePDIPIManager.cpp \
+          $$LIBPDI_SRC_DIR/TePDIHistogram.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRgbPalette.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRgbPaletteFunctions.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParameters.cpp \
+          $$LIBPDI_SRC_DIR/TePDIAlgorithm.cpp \
+          $$LIBPDI_SRC_DIR/TePDIAlgorithmFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIStatistic.cpp \
+          $$LIBPDI_SRC_DIR/TePDILevelRemap.cpp \
+          $$LIBPDI_SRC_DIR/TePDIContrast.cpp \
+          $$LIBPDI_SRC_DIR/TePDIContrastFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIFilterMask.cpp \
+          $$LIBPDI_SRC_DIR/TePDIBufferedFilter.cpp \
+          $$LIBPDI_SRC_DIR/TePDILinearFilter.cpp \
+          $$LIBPDI_SRC_DIR/TePDILinearFilterFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIBDFilter.cpp \
+          $$LIBPDI_SRC_DIR/TePDIBDFilterFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMorfFilter.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMorfFilterFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarFilter.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarLeeFilter.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarLeeFilterFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarKuanFilter.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarKuanFilterFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarFrostFilter.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarFrostFilterFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIArithmetic.cpp \
+          $$LIBPDI_SRC_DIR/TePDIArithmeticFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRaster2Vector.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRaster2VectorFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIColorTransform.cpp \
+          $$LIBPDI_SRC_DIR/TePDIColorTransformFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIPrincipalComponents.cpp \
+          $$LIBPDI_SRC_DIR/TePDIPrincipalComponentsFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMallatWavelets.cpp \
+          $$LIBPDI_SRC_DIR/TePDIGeoMosaic.cpp \
+          $$LIBPDI_SRC_DIR/TePDIBatchGeoMosaic.cpp \
+          $$LIBPDI_SRC_DIR/TePDIStrategy.cpp \
+          $$LIBPDI_SRC_DIR/TePDIStrategyFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIGarguetFusion.cpp \
+          $$LIBPDI_SRC_DIR/TePDIVenturaFusion.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRegGrowSeg.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRegGrowSegFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRegister.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRegisterFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIInterpolator.cpp \
+          $$LIBPDI_SRC_DIR/TePDIEspecData.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRegion.cpp \
+          $$LIBPDI_SRC_DIR/TePDICluster.cpp \
+          $$LIBPDI_SRC_DIR/TePDIIsosegClas.cpp \
+          $$LIBPDI_SRC_DIR/TePDIIsosegClasFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIHaralick.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelComponent.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelComponentList.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModel.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelSpectralBand.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelSpectralBandList.cpp \
+          $$LIBPDI_SRC_DIR/TePDIPrincoMixModelSF.cpp \
+          $$LIBPDI_SRC_DIR/TePDIPrincoMixModelStrategy.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelStrategy.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMixModelStratFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIKMeansClas.cpp \
+          $$LIBPDI_SRC_DIR/TePDIKMeansClasFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIEMClas.cpp \
+          $$LIBPDI_SRC_DIR/TePDIEMClasFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDISensorSimulatorFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDISensorSimulator.cpp \
+          $$LIBPDI_SRC_DIR/TePDIOFMatching.cpp \
+          $$LIBPDI_SRC_DIR/TePDIPrincipalComponentsFusion.cpp \
+          $$LIBPDI_SRC_DIR/TePDIDecorrelationEnhancement.cpp \
+          $$LIBPDI_SRC_DIR/TePDICorrelationMatching.cpp \
+          $$LIBPDI_SRC_DIR/TePDIBaatz.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMIMatching.cpp \
+          $$LIBPDI_SRC_DIR/TePDIJointHistogram.cpp \
+          $$LIBPDI_SRC_DIR/TePDIMMIOMatching.cpp \
+          $$LIBPDI_SRC_DIR/TePDIIHSFusion.cpp \
+          $$LIBPDI_SRC_DIR/TePDIFusionIndexes.cpp \
+          $$LIBPDI_SRC_DIR/TePDIGeneralizedIHSFusion.cpp \
+          $$LIBPDI_SRC_DIR/TePDIIHSWaveletFusion.cpp \
+          $$LIBPDI_SRC_DIR/TePDIPCAWaveletFusion.cpp \ 
+          $$LIBPDI_SRC_DIR/TePDIWaveletAtrousFusion.cpp \
+          $$LIBPDI_SRC_DIR/TePDIWiSpeRFusion.cpp \
+          $$LIBPDI_SRC_DIR/TePDIWaveletAtrous.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegSegment.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegSegmentsBlock.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegStrategyParams.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegStrategy.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParallelSegmenter.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegRegGrowStrategy.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegBaatzStrategy.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegStrategyFactoryParams.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegStrategyFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegRegGrowStrategyFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIParaSegBaatzStrategyFactory.cpp \
+          $$LIBPDI_SRC_DIR/TePDIBlender.cpp \
+          $$LIBPDI_SRC_DIR/TePDITPMosaic.cpp \
+          $$LIBPDI_SRC_DIR/TePDISAMClassifier.cpp \
+          $$LIBPDI_SRC_DIR/TePDIRadarGammaFilter.cpp
+
+win32 {
+  !win32-g++ {
+	  CONFIG += staticlib console
+
+	  DEFINES += WIN32 __WIN32__
+
+	  TEMPLATE = vclib
+	  
+	  LIBS =
+  }
+  
+  USE_TERRALIB_STL = yes
+  contains( QMAKESPEC , win32-msvc.net ) {
+    USE_TERRALIB_STL = no
+  }
+  equals( USE_TERRALIB_STL , yes ) {
+    INCLUDEPATH = $$TERRALIB_SRC_DIR/STLport $$INCLUDEPATH
+    message( "TerraLib internal STL will be used" )
+  }    
+}
+
+
diff --git a/build/qt/libjpeg/libjpeg.pro b/build/qt/libjpeg/libjpeg.pro
new file mode 100644
index 0000000..50d0f4c
--- /dev/null
+++ b/build/qt/libjpeg/libjpeg.pro
@@ -0,0 +1,84 @@
+TARGET = jpeg
+CONFIG += staticlib 
+win32:DEFINES += UNICODE \
+    _LIB
+include (../config.pri)
+
+SRCPATH = $$TERRALIBPATH/src/libjpeg
+
+INCLUDEPATH += $$SRCPATH
+HEADERS += $$SRCPATH/cderror.h \
+    $$SRCPATH/cdjpeg.h \
+    $$SRCPATH/jchuff.h \
+    $$SRCPATH/jconfig.h \
+    $$SRCPATH/jdct.h \
+    $$SRCPATH/jdhuff.h \
+    $$SRCPATH/jerror.h \
+    $$SRCPATH/jinclude.h \
+    $$SRCPATH/jmemsys.h \
+    $$SRCPATH/jmorecfg.h \
+    $$SRCPATH/jpegint.h \
+    $$SRCPATH/jpeglib.h \
+    $$SRCPATH/jversion.h \
+    $$SRCPATH/transupp.h
+SOURCES +=  $$SRCPATH/jcapimin.c \
+	$$SRCPATH/jcapistd.c \
+	$$SRCPATH/jccoefct.c \
+	$$SRCPATH/jccolor.c \
+	$$SRCPATH/jcdctmgr.c \
+	$$SRCPATH/jchuff.c \
+	$$SRCPATH/jcinit.c \
+	$$SRCPATH/jcmainct.c \
+	$$SRCPATH/jcmarker.c \
+	$$SRCPATH/jcmaster.c \
+	$$SRCPATH/jcomapi.c \
+	$$SRCPATH/jcparam.c \
+	$$SRCPATH/jcphuff.c \
+	$$SRCPATH/jcprepct.c \
+	$$SRCPATH/jcsample.c \
+	$$SRCPATH/jctrans.c \
+	$$SRCPATH/jdapimin.c \
+	$$SRCPATH/jdapistd.c \
+	$$SRCPATH/jdatadst.c \
+	$$SRCPATH/jdatasrc.c \
+	$$SRCPATH/jdcoefct.c \
+	$$SRCPATH/jdcolor.c \
+	$$SRCPATH/jddctmgr.c \
+	$$SRCPATH/jdhuff.c \
+	$$SRCPATH/jdinput.c \
+	$$SRCPATH/jdmainct.c \
+	$$SRCPATH/jdmarker.c \
+	$$SRCPATH/jdmaster.c \
+	$$SRCPATH/jdmerge.c \
+	$$SRCPATH/jdphuff.c \
+	$$SRCPATH/jdpostct.c \
+	$$SRCPATH/jdsample.c \
+	$$SRCPATH/jdtrans.c \
+	$$SRCPATH/jerror.c \
+	$$SRCPATH/jfdctflt.c \
+	$$SRCPATH/jfdctfst.c \
+	$$SRCPATH/jfdctint.c \
+	$$SRCPATH/jidctflt.c \
+	$$SRCPATH/jidctfst.c \
+	$$SRCPATH/jidctint.c \
+	$$SRCPATH/jidctred.c \
+	$$SRCPATH/jmemmgr.c \
+	$$SRCPATH/jmemnobs.c \
+	$$SRCPATH/jquant1.c \
+	$$SRCPATH/jquant2.c \
+	$$SRCPATH/jutils.c \
+	$$SRCPATH/rdbmp.c \
+	$$SRCPATH/rdcolmap.c \
+	$$SRCPATH/rdgif.c \
+	$$SRCPATH/rdppm.c \
+	$$SRCPATH/rdrle.c \
+	$$SRCPATH/rdswitch.c \
+	$$SRCPATH/rdtarga.c \
+	$$SRCPATH/transupp.c \
+	$$SRCPATH/wrbmp.c \
+	$$SRCPATH/wrgif.c \
+	$$SRCPATH/wrppm.c \
+	$$SRCPATH/wrrle.c \
+	$$SRCPATH/wrtarga.c 
+
+
diff --git a/build/qt/libspl/libspl.pro b/build/qt/libspl/libspl.pro
new file mode 100644
index 0000000..4a61c3c
--- /dev/null
+++ b/build/qt/libspl/libspl.pro
@@ -0,0 +1,40 @@
+#win32 {
+#  error( "To build LibSPL for Windows use the Visual Studio project file." )
+#}
+
+TARGET  = spl
+include (../config.pri)
+
+LIBSPLPATH = $$TERRALIBPATH/src/libspl
+
+win32 {
+	DEFINES += _LIB \
+			SPL_MAKE_DLL
+	win32-g++:DEFINES -= UNICODE
+	win32-g++:DEFINES += __GNUC__	
+}
+unix:LIBS += -lpthread
+INCLUDEPATH = $$LIBSPLPATH $$LIBSPLPATH/include
+MOC_DIR = temp
+UI_DIR = temp
+HEADERS = \
+  $$LIBSPLPATH/spl.h \
+  $$LIBSPLPATH/include/spl_pluginargs.h \
+  $$LIBSPLPATH/include/spl_pluginserver_linux.h \
+  $$LIBSPLPATH/include/spl_pluginserver_solaris.h \
+  $$LIBSPLPATH/include/spl_pluginserver_win32.h \
+  $$LIBSPLPATH/include/spl_threadlock.h \
+  $$LIBSPLPATH/include/spl_mutex.h \
+  $$LIBSPLPATH/include/spl_plugininfo.h \
+  $$LIBSPLPATH/include/spl_typedefs.h \
+  $$LIBSPLPATH/include/spl_platform.h \
+  $$LIBSPLPATH/include/spl_pluginserver.h 
+SOURCES = \
+  $$LIBSPLPATH/source/spl_pluginserver.cpp \
+  $$LIBSPLPATH/source/spl_pluginserver_linux.cpp \
+  $$LIBSPLPATH/source/spl_pluginserver_solaris.cpp \
+  $$LIBSPLPATH/source/spl_pluginserver_win32.cpp \
+  $$LIBSPLPATH/source/spl_pluginargs.cpp \
+  $$LIBSPLPATH/source/spl_mutex.cpp \
+  $$LIBSPLPATH/source/spl_threadlock.cpp \
+  $$LIBSPLPATH/source/spl_plugininfo.cpp
diff --git a/build/qt/qwt/qwt.pro b/build/qt/qwt/qwt.pro
new file mode 100644
index 0000000..0c606f0
--- /dev/null
+++ b/build/qt/qwt/qwt.pro
@@ -0,0 +1,164 @@
+# -*- mode: sh -*- ###########################
+# Qwt Widget Library
+# Copyright (C) 1997   Josef Wilgen
+# Copyright (C) 2002   Uwe Rathmann
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the Qwt License, Version 1.0
+##############################################
+
+# pro file for building the makefile for qwt
+#
+# Please read the instructions in INSTALL, if you don�t know
+# how to use it.
+#
+# HEADERS/SOURCES are separated into plot
+# relevant files and others. If you are 
+# interested in QwtPlot only, you can remove
+# the lists at the end of this file.
+
+TARGET            = qwt
+
+VERSION      = 5.0.0
+
+# Only one of the following flags is allowed !
+#CONFIG           += qtopia
+
+CONFIG           += dll
+include (../config.pri)
+
+QWTPATH = $$TERRALIBPATH/src/qwt
+
+CONFIG           += thread
+CONFIG           += warn_on 
+
+# Only one of the following flags is allowed !
+CONFIG           += qt
+
+INCLUDEPATH      += $$QWTPATH/include
+DEPENDPATH       += $$QWTPATH/include $$QWTPATH
+
+win32:dll:DEFINES    += QT_DLL QWT_DLL QWT_MAKEDLL
+MOC_DIR = $$TERRALIBPATH/moc/qwt
+HEADERS = \
+    $$QWTPATH/include/qwt.h \
+    $$QWTPATH/include/qwt_abstract_scale_draw.h \
+    $$QWTPATH/include/qwt_array.h \
+    $$QWTPATH/include/qwt_data.h \
+    $$QWTPATH/include/qwt_double_interval.h \
+    $$QWTPATH/include/qwt_double_rect.h \
+    $$QWTPATH/include/qwt_dyngrid_layout.h \
+    $$QWTPATH/include/qwt_event_pattern.h \
+    $$QWTPATH/include/qwt_global.h \
+    $$QWTPATH/include/qwt_interval_data.h \
+    $$QWTPATH/include/qwt_layout_metrics.h \
+    $$QWTPATH/include/qwt_legend.h \
+    $$QWTPATH/include/qwt_legend_item.h \
+    $$QWTPATH/include/qwt_math.h \
+    $$QWTPATH/include/qwt_painter.h \
+    $$QWTPATH/include/qwt_paint_buffer.h \
+    $$QWTPATH/include/qwt_picker.h \
+    $$QWTPATH/include/qwt_picker_machine.h \
+    $$QWTPATH/include/qwt_plot.h \
+    $$QWTPATH/include/qwt_plot_curve.h \
+    $$QWTPATH/include/qwt_plot_dict.h \
+    $$QWTPATH/include/qwt_plot_grid.h \
+    $$QWTPATH/include/qwt_plot_layout.h \
+    $$QWTPATH/include/qwt_plot_marker.h \
+    $$QWTPATH/include/qwt_plot_printfilter.h \
+    $$QWTPATH/include/qwt_plot_item.h \
+    $$QWTPATH/include/qwt_plot_canvas.h \
+    $$QWTPATH/include/qwt_plot_picker.h \
+    $$QWTPATH/include/qwt_plot_zoomer.h \
+    $$QWTPATH/include/qwt_rect.h \
+    $$QWTPATH/include/qwt_round_scale_draw.h \
+    $$QWTPATH/include/qwt_scale_widget.h \
+    $$QWTPATH/include/qwt_scale_div.h \
+    $$QWTPATH/include/qwt_scale_draw.h \
+    $$QWTPATH/include/qwt_scale_engine.h \
+    $$QWTPATH/include/qwt_scale_map.h \
+    $$QWTPATH/include/qwt_spline.h \
+    $$QWTPATH/include/qwt_symbol.h \
+    $$QWTPATH/include/qwt_text_engine.h \
+    $$QWTPATH/include/qwt_text_label.h \
+    $$QWTPATH/include/qwt_text.h
+
+SOURCES = \
+    $$QWTPATH/qwt_abstract_scale_draw.cpp \
+    $$QWTPATH/qwt_data.cpp \
+    $$QWTPATH/qwt_double_interval.cpp \
+    $$QWTPATH/qwt_double_rect.cpp \
+    $$QWTPATH/qwt_dyngrid_layout.cpp \
+    $$QWTPATH/qwt_event_pattern.cpp \
+    $$QWTPATH/qwt_interval_data.cpp \
+    $$QWTPATH/qwt_layout_metrics.cpp \
+    $$QWTPATH/qwt_legend.cpp \
+    $$QWTPATH/qwt_legend_item.cpp \
+    $$QWTPATH/qwt_math.cpp \
+    $$QWTPATH/qwt_painter.cpp \
+    $$QWTPATH/qwt_paint_buffer.cpp \
+    $$QWTPATH/qwt_picker.cpp \
+    $$QWTPATH/qwt_picker_machine.cpp \
+    $$QWTPATH/qwt_plot.cpp \
+    $$QWTPATH/qwt_plot_axis.cpp \
+    $$QWTPATH/qwt_plot_curve.cpp \
+    $$QWTPATH/qwt_plot_dict.cpp \
+    $$QWTPATH/qwt_plot_grid.cpp \
+    $$QWTPATH/qwt_plot_item.cpp \
+    $$QWTPATH/qwt_plot_print.cpp \
+    $$QWTPATH/qwt_plot_marker.cpp \
+    $$QWTPATH/qwt_plot_layout.cpp \
+    $$QWTPATH/qwt_plot_printfilter.cpp \
+    $$QWTPATH/qwt_plot_canvas.cpp \
+    $$QWTPATH/qwt_plot_picker.cpp \
+    $$QWTPATH/qwt_plot_zoomer.cpp \
+    $$QWTPATH/qwt_rect.cpp \
+    $$QWTPATH/qwt_round_scale_draw.cpp \
+    $$QWTPATH/qwt_scale_widget.cpp \
+    $$QWTPATH/qwt_scale_div.cpp \
+    $$QWTPATH/qwt_scale_draw.cpp \
+    $$QWTPATH/qwt_scale_engine.cpp \
+    $$QWTPATH/qwt_scale_map.cpp \
+    $$QWTPATH/qwt_spline.cpp \
+    $$QWTPATH/qwt_symbol.cpp \
+    $$QWTPATH/qwt_text_engine.cpp \
+    $$QWTPATH/qwt_text_label.cpp \
+    $$QWTPATH/qwt_text.cpp 
+ 
+##############################################
+# If you are interested in the plot widget
+# only, you can remove the following 
+# HEADERS/SOURCES lists.
+##############################################
+
+HEADERS += \
+    $$QWTPATH/include/qwt_abstract_slider.h \
+    $$QWTPATH/include/qwt_abstract_scale.h \
+    $$QWTPATH/include/qwt_arrow_button.h \
+    $$QWTPATH/include/qwt_analog_clock.h \
+    $$QWTPATH/include/qwt_compass.h \
+    $$QWTPATH/include/qwt_compass_rose.h \
+    $$QWTPATH/include/qwt_counter.h \
+    $$QWTPATH/include/qwt_dial.h \
+    $$QWTPATH/include/qwt_dial_needle.h \
+    $$QWTPATH/include/qwt_double_range.h \
+    $$QWTPATH/include/qwt_knob.h \
+    $$QWTPATH/include/qwt_slider.h \
+    $$QWTPATH/include/qwt_thermo.h \
+    $$QWTPATH/include/qwt_wheel.h
+
+SOURCES += \
+    $$QWTPATH/qwt_abstract_slider.cpp \
+    $$QWTPATH/qwt_abstract_scale.cpp \
+    $$QWTPATH/qwt_arrow_button.cpp \
+    $$QWTPATH/qwt_analog_clock.cpp \
+    $$QWTPATH/qwt_compass.cpp \
+    $$QWTPATH/qwt_compass_rose.cpp \
+    $$QWTPATH/qwt_counter.cpp \
+    $$QWTPATH/qwt_dial.cpp \
+    $$QWTPATH/qwt_dial_needle.cpp \
+    $$QWTPATH/qwt_double_range.cpp \
+    $$QWTPATH/qwt_knob.cpp \
+    $$QWTPATH/qwt_slider.cpp \
+    $$QWTPATH/qwt_thermo.cpp \
+    $$QWTPATH/qwt_wheel.cpp
diff --git a/build/qt/shapelib/shapelib.pro b/build/qt/shapelib/shapelib.pro
new file mode 100644
index 0000000..5320643
--- /dev/null
+++ b/build/qt/shapelib/shapelib.pro
@@ -0,0 +1,14 @@
+TARGET  = shapelib
+CONFIG += dll
+win32:DEFINES += _USRDLL \
+    SHAPELIB_DLLEXPORT
+include (../config.pri)
+
+SHPPATH = $$TERRALIBPATH/src/shapelib
+
+SOURCES = $$SHPPATH/dbfopen.c \
+    	$$SHPPATH/shpopen.c
+HEADERS = $$SHPPATH/shapefil.h
+
+
+
diff --git a/build/qt/stat/stat.pro b/build/qt/stat/stat.pro
new file mode 100644
index 0000000..bcaee0d
--- /dev/null
+++ b/build/qt/stat/stat.pro
@@ -0,0 +1,44 @@
+CONFIG += dll 
+TARGET = stat
+
+include (../config.pri)
+
+DEFINES += STAT_AS_DLL
+
+INCLUDEPATH += $$TERRALIBPATH/src/terralib/stat
+
+LIBS += -lterralib
+
+SOURCES	+= $$TERRALIBPATH/src/terralib/stat/filaDouble.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/filaInt.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/filaR.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/heap.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/lista.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/TeBayesFunctions.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/TeKernelFunctions.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/TeSkaterArvore.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/TeSkaterFunctions.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/TeSkaterGrafo.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/TeStatDataStructures.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/TeSemivarModelFactory.cpp \
+	  $$TERRALIBPATH/src/terralib/stat/TeMSVFactory.cpp 
+
+HEADERS	+= $$TERRALIBPATH/src/terralib/stat/erro.h \
+	  $$TERRALIBPATH/src/terralib/stat/filaDouble.h \
+	  $$TERRALIBPATH/src/terralib/stat/filaInt.h \
+	  $$TERRALIBPATH/src/terralib/stat/filaR.h \
+	  $$TERRALIBPATH/src/terralib/stat/heap.h \
+	  $$TERRALIBPATH/src/terralib/stat/lista.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeBayesFunctions.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeKernelFunctions.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeKernelParams.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeKMeansGrouping.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeSkaterArvore.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeSkaterFunctions.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeSkaterGrafo.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeSpatialStatistics.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeStatDataStructures.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeSemivarModelFactory.h \
+	  $$TERRALIBPATH/src/terralib/stat/TeMSVFactory.h \
+          $$TERRALIBPATH/src/terralib/stat/TeStatDefines.h 
+
diff --git a/build/qt/te_dxf/te_dxf.pro b/build/qt/te_dxf/te_dxf.pro
new file mode 100644
index 0000000..4358bfe
--- /dev/null
+++ b/build/qt/te_dxf/te_dxf.pro
@@ -0,0 +1,39 @@
+#-----------------------------------
+#Project definitions
+#-----------------------------------
+TARGET = te_dxf
+CONFIG	+= dll
+
+include (../config.pri)
+
+#Path definitions
+#----------------------------------
+INCPATH= $$TERRALIBPATH/src/terralib/drivers/DXF
+SRCPATH = $$INCPATH
+
+DEFINES += TEDXF_EXPORTS
+#---------------
+# Project files
+#---------------
+INCLUDEPATH	+= $$TERRALIBPATH/src/terralib/kernel \
+		$$TERRALIBPATH/src/dxflib \
+		$$TERRALIBPATH/src/terralib/drivers/DXF
+HEADERS	+= $$INCPATH/tedxfdefines.h \
+	$$INCPATH/tedxflayer.h \
+	$$INCPATH/tedxfvisitor.h \
+	$$INCPATH/TeDXFDriver.h \
+	$$INCPATH/TeDXFDriverFactory.h
+SOURCES	+= $$SRCPATH/tedxflayer.cpp \
+	$$SRCPATH/tedxfvisitor.cpp \
+	$$SRCPATH/TeDXFDriver.cpp \
+	$$SRCPATH/TeDXFDriverFactory.cpp 
+	
+win32 {
+	!win32-g++ {
+		debug:QMAKE_LIBDIR += $$TERRALIBPATH/Debug/dxflib \
+				$$TERRALIBPATH/Debug/terralib
+		release:QMAKE_LIBDIR += $$TERRALIBPATH/Release/dxflib \
+				$$TERRALIBPATH/Release/terralib
+	}
+}
+LIBS += -ldxf -lterralib
\ No newline at end of file
diff --git a/build/qt/te_functions/te_functions.pro b/build/qt/te_functions/te_functions.pro
new file mode 100644
index 0000000..674828b
--- /dev/null
+++ b/build/qt/te_functions/te_functions.pro
@@ -0,0 +1,40 @@
+CONFIG += dll
+TARGET = te_functions
+
+include (../config.pri)
+
+DEFINES += TLFUNCTIONS_AS_DLL
+
+LIBS += -lterralib
+
+INCLUDEPATH += $$TERRALIBPATH/src/terralib/functions
+
+HEADERS += $$TERRALIBPATH/src/terralib/functions/TeFunctionsDefines.h \
+	$$TERRALIBPATH/src/terralib/functions/TeCoordAlgorithms.h \
+	$$TERRALIBPATH/src/terralib/functions/TeSPRFile.h \
+	$$TERRALIBPATH/src/terralib/functions/TeDriverMIDMIF.h \
+	$$TERRALIBPATH/src/terralib/functions/TeDriverSPRING.h \
+	$$TERRALIBPATH/src/terralib/functions/TeGeoProcessingFunctions.h \
+	$$TERRALIBPATH/src/terralib/functions/TeCellAlgorithms.h \
+	$$TERRALIBPATH/src/terralib/functions/TeAddressLocator.h \
+	$$TERRALIBPATH/src/terralib/functions/TeDriverBNA.h \
+	$$TERRALIBPATH/src/terralib/functions/TeDriverCSV.h \
+	$$TERRALIBPATH/src/terralib/functions/TeLayerFunctions.h \
+	$$TERRALIBPATH/src/terralib/functions/TeMIFProjection.h \
+	$$TERRALIBPATH/src/terralib/functions/TeThemeFunctions.h 
+SOURCES += $$TERRALIBPATH/src/terralib/functions/TeCoordAlgorithms.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeSimilarity.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeSPRFile.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeExportMIF.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeExportSPR.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeGeoProcessingFunctions.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeCellAlgorithms.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeAddressLocator.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeImportBNA.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeImportCSV.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeImportGeo.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeImportMIF.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeLayerFunctions.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeMIFProjection.cpp \
+	$$TERRALIBPATH/src/terralib/functions/TeExportCSV.cpp \ 
+	$$TERRALIBPATH/src/terralib/functions/TeThemeFunctions.cpp 
diff --git a/build/qt/te_gdal/te_gdal.pro b/build/qt/te_gdal/te_gdal.pro
new file mode 100644
index 0000000..9befa5d
--- /dev/null
+++ b/build/qt/te_gdal/te_gdal.pro
@@ -0,0 +1,78 @@
+#Path definitions
+#----------------------------------
+INCPATH= ../../../src/terralib/drivers/gdal
+SRCPATH = $$INCPATH
+#-----------------------------------
+#Project definitions
+#-----------------------------------
+TEMPLATE = lib
+TARGET = te_gdal
+CONFIG	+= warn_on \
+		rtti \
+		exceptions \
+		thread \
+		dll
+CONFIG -= qt
+LANGUAGE	= C++
+#------------------------------
+# Configure to debug or release
+#------------------------------
+isEmpty(TE_PROJECT_TYPE) {
+    TE_PROJECT_TYPE=RELEASE
+}
+contains(TE_PROJECT_TYPE , DEBUG) {
+    CONFIG -= release
+    CONFIG += debug
+}
+contains(TE_PROJECT_TYPE , RELEASE) {
+    CONFIG -= debug
+    CONFIG += release
+}
+
+include (../config.pri)
+
+OBJECTS_DIR = $$OBJECTS_DIR/te_gdal
+
+DEFINES += TEGDAL_EXPORTS
+#---------------
+# Project files
+#---------------
+INCLUDEPATH	+= ../../../src/terralib/kernel \
+			   ../../../src/terralib/utils \
+			   ../../../src/terralib/drivers/gdal \
+			   ../../../../thirdparty/gdal-1.7.2/gcore \
+			   ../../../../thirdparty/gdal-1.7.2/port \
+			   ../../../../thirdparty/gdal-1.7.2/ogr \
+			   ../../../../thirdparty/gdal-1.7.2/ogr/ogrsf_frmts
+			   
+HEADERS	+= $$INCPATH/TeOGRDriver.h \
+		   $$INCPATH/TeOGRDriverFactory.h \
+		   $$INCPATH/TeOGRUtils.h \
+		   $$INCPATH/TeGDALDefines.h \
+		   $$INCPATH/TeGDALUtils.h \
+		   $$INCPATH/TeGDALDecoder.h
+		   
+SOURCES	+= $$SRCPATH/TeOGRDriver.cpp \
+		   $$SRCPATH/TeOGRDriverFactory.cpp \
+		   $$INCPATH/TeOGRUtils.cpp \
+		   $$INCPATH/TeGDALUtils.cpp \
+		   $$INCPATH/TeGDALDecoder.cpp
+unix {
+	debug:LIBS += -L../../Debug 
+	release:LIBS += -L../../Release 
+}
+win32 {
+	!win32-g++ {
+		debug:QMAKE_LIBDIR += ../../../../thirdparty/gdal-1.7.2 \
+							  ../../../Debug/terralib \
+							  ../../../Debug/te_utils
+		release:QMAKE_LIBDIR += ../../../../thirdparty/gdal-1.7.2 \
+								../../../Release/terralib \
+								../../../Release/te_utils
+	}
+	else {
+		debug:LIBS += -L../../Debug
+		release:LIBS += -L../../Release
+	}			
+}
+LIBS += -lgdal_i -lterralib -lte_utils
\ No newline at end of file
diff --git a/build/qt/te_qwt/te_qwt.pro b/build/qt/te_qwt/te_qwt.pro
new file mode 100644
index 0000000..340b389
--- /dev/null
+++ b/build/qt/te_qwt/te_qwt.pro
@@ -0,0 +1,32 @@
+TARGET = te_qwt
+
+include (../config.pri)
+
+CONFIG += dll qt
+
+DEFINES += TLQWT_AS_DLL
+
+win32 {
+     !win32-g++ {
+	  debug:QMAKE_LIBDIR += $$TERRALIBPATH/Debug/qwt
+	  release:QMAKE_LIBDIR += $$TERRALIBPATH/Release/qwt
+     }
+}
+
+UI_DIR = $$TERRALIBPATH/ui/qwt
+MOC_DIR = $$TERRALIBPATH/moc/qwt
+
+LIBS += -lqwt -lterralib 
+
+INCLUDEPATH += $$TERRALIBPATH/src/terralib/drivers/qwt  \
+	      $$TERRALIBPATH/src/qwt/include
+
+HEADERS += $$TERRALIBPATH/src/terralib/drivers/qwt/TeQwtPlot.h \
+	$$TERRALIBPATH/src/terralib/drivers/qwt/TeQwtPlotCurve.h \
+	$$TERRALIBPATH/src/terralib/drivers/qwt/TeQwtPlotPicker.h \
+	$$TERRALIBPATH/src/terralib/drivers/qwt/TeQwtPlotZoomer.h \
+	$$TERRALIBPATH/src/terralib/drivers/qwt/TeQwtDefines.h 
+SOURCES += $$TERRALIBPATH/src/terralib/drivers/qwt/TeQwtPlot.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/qwt/TeQwtPlotCurve.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/qwt/TeQwtPlotPicker.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/qwt/TeQwtPlotZoomer.cpp
\ No newline at end of file
diff --git a/build/qt/te_shapelib/te_shapelib.pro b/build/qt/te_shapelib/te_shapelib.pro
new file mode 100644
index 0000000..2229015
--- /dev/null
+++ b/build/qt/te_shapelib/te_shapelib.pro
@@ -0,0 +1,24 @@
+CONFIG += dll
+TARGET = te_shapelib
+
+include (../config.pri)
+
+DEFINES += TLSHP_AS_DLL
+
+win32 {
+     !win32-g++ {
+	  debug:QMAKE_LIBDIR += $$TERRALIBPATH/Debug/shapelib
+	  release:QMAKE_LIBDIR += $$TERRALIBPATH/Release/shapelib
+     }
+}
+
+LIBS += -lshapelib -lterralib 
+
+INCLUDEPATH += $$TERRALIBPATH/src/terralib/shapelib  \
+	      $$TERRALIBPATH/src/shapelib
+
+HEADERS += $$TERRALIBPATH/src/terralib/drivers/shapelib/TeDriverSHPDBF.h \
+	$$TERRALIBPATH/src/terralib/drivers/shapelib/TeSHPDriverFactory.h \
+	$$TERRALIBPATH/src/terralib/drivers/shapelib/TeSHPDefines.h 
+SOURCES += $$TERRALIBPATH/src/terralib/drivers/shapelib/TeDriverSHPDBF.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/shapelib/TeSHPDriverFactory.cpp 
\ No newline at end of file
diff --git a/build/qt/te_spl/te_spl.pro b/build/qt/te_spl/te_spl.pro
new file mode 100644
index 0000000..746f253
--- /dev/null
+++ b/build/qt/te_spl/te_spl.pro
@@ -0,0 +1,34 @@
+CONFIG += dll
+TARGET = te_spl
+include (../config.pri)
+DEFINES += TLSPL_AS_DLL
+
+CONFIG += qt
+
+TESPLSRC = $$TERRALIBPATH/src/terralib/drivers/spl
+
+INCLUDEPATH += $$TESPLSRC \
+			$$TERRALIBPATH/src/libspl 
+debug:SPLLIBDIR = $$TERRALIBPATH/Debug
+release:SPLLIBDIR = $$TERRALIBPATH/Release
+unix:LIBS += -lspl
+win32 {
+	win32-g++:LIBS += -lspl
+	else {
+		QMAKE_LIBDIR += $$SPLLIBDIR/libspl
+		LIBS += -llibspl
+	}
+}
+LIBS += -lterralib
+HEADERS += $$TESPLSRC/TeSPLDefines.h \
+		$$TESPLSRC/PluginInfo.h \
+		$$TESPLSRC/PluginMetadata.h \
+		$$TESPLSRC/PluginParameters.h \
+		$$TESPLSRC/PluginsManager.h \
+		$$TESPLSRC/PluginsParametersContainer.h \
+		$$TESPLSRC/PluginsSignal.h
+
+SOURCES += $$TESPLSRC/PluginMetadata.cpp \
+		$$TESPLSRC/PluginParameters.cpp \
+		$$TESPLSRC/PluginsManager.cpp \
+		$$TESPLSRC/PluginsSignal.cpp
\ No newline at end of file
diff --git a/build/qt/te_utils/te_utils.pro b/build/qt/te_utils/te_utils.pro
new file mode 100644
index 0000000..e15448a
--- /dev/null
+++ b/build/qt/te_utils/te_utils.pro
@@ -0,0 +1,25 @@
+CONFIG += dll
+TARGET = te_utils
+
+include (../config.pri)
+
+DEFINES += TLUTILS_AS_DLL
+
+LIBS += -lterralib -lte_functions
+
+INCLUDEPATH += $$TERRALIBPATH/src/terralib/utils \
+	      $$TERRALIBPATH/src/terralib/functions
+
+HEADERS += $$TERRALIBPATH/src/terralib/utils/TeUtilsDefines.h \
+	$$TERRALIBPATH/src/terralib/utils/TeColorUtils.h \
+	$$TERRALIBPATH/src/terralib/utils/TeDatabaseUtils.h \
+	$$TERRALIBPATH/src/terralib/utils/mtrand.h \
+	$$TERRALIBPATH/src/terralib/utils/TeUpdateDBVersion.h \ 
+	$$TERRALIBPATH/src/terralib/utils/TeWKBGeometryDecoder.h \
+	$$TERRALIBPATH/src/terralib/utils/TeWKTGeometryDecoder.h
+SOURCES += $$TERRALIBPATH/src/terralib/utils/TeColorUtils.cpp \
+	$$TERRALIBPATH/src/terralib/utils/TeDatabaseUtils.cpp \
+	$$TERRALIBPATH/src/terralib/utils/mtrand.cpp \
+	$$TERRALIBPATH/src/terralib/utils/TeUpdateDBVersion.cpp \
+	$$TERRALIBPATH/src/terralib/utils/TeWKBGeometryDecoder.cpp \
+	$$TERRALIBPATH/src/terralib/utils/TeWKTGeometryDecoder.cpp
diff --git a/build/qt/terraView.pro b/build/qt/terraView.pro
new file mode 100644
index 0000000..ae79ef2
--- /dev/null
+++ b/build/qt/terraView.pro
@@ -0,0 +1,4 @@
+include (./utilities.pro)
+
+SUBDIRS += ./terraViewCore \
+		./terraView
\ No newline at end of file
diff --git a/build/qt/terraView/terraView.pro b/build/qt/terraView/terraView.pro
new file mode 100644
index 0000000..bec019e
--- /dev/null
+++ b/build/qt/terraView/terraView.pro
@@ -0,0 +1,67 @@
+TARGET = terraView
+CONFIG += dll
+include (../config.pri)
+CONFIG += qt
+
+TEMPLATE = app
+
+win32 {
+      win32-g++ {
+		CONFIG -= dll
+#		CONFIG += 
+      }
+	  else {
+	    debug:QMAKE_LIBDIR += $$TERRALIBPATH/Debug/terraViewCore \
+				$$TERRALIBPATH/Debug/te_dxf \
+				$$TERRALIBPATH/Debug/te_shapelib \
+				$$TERRALIBPATH/Debug/terralib 
+	    release {
+		   QMAKE_LIBDIR += $$TERRALIBPATH/Release/terraViewCore \
+		   $$TERRALIBPATH/Release/te_dxf \
+		   $$TERRALIBPATH/Release/te_shapelib \
+		   $$TERRALIBPATH/Release/terralib 
+ 	    
+	           CONFIG += windows
+        }
+      }
+
+      DEFINES += UNICODE
+}
+
+unix:LIBS += -lclntsh -lnnz10  -licudata -licuuc -licui18n -lfbembed
+
+LIBS += -ldxf -lshapelib -lterralibtiff -lterralibpdi -lstat -lqwt -lte_functions -lspl -lte_utils -lte_qwt -lte_spl -lte_mysql -lte_postgresql \
+	-lte_oracle -lte_firebird -lte_dxf -lte_shapelib -lterralib -lterraViewCore -lte_apputils
+
+INCLUDEPATH += $$TERRALIBPATH/terraView \
+	      $$TERRALIBPATH/src/qwt/include \
+	      $$TERRALIBPATH/src/terralib/drivers/qwt \
+	      $$TERRALIBPATH/src/terralib/drivers/shapelib \
+	      $$TERRALIBPATH/src/terralib/drivers/spl \
+	      $$TERRALIBPATH/src/terralib/drivers/DXF \
+	      $$TERRALIBPATH/src/terralib/kernel \
+	      $$TERRALIBPATH/src/terralib/utils \
+	      $$TERRALIBPATH/src/terralib/functions \
+	      $$TERRALIBPATH/src/terralib/stat \
+	      $$TERRALIBPATH/src/shapelib \
+	      $$TERRALIBPATH/src/zlib \
+	      $$TERRALIBPATH/src/libspl \
+	      $$TERRALIBPATH/ui/terraView \
+	      $$TERRALIBPATH/src/terralib/drivers/qt \
+	      $$TERRALIBPATH/src/terralib/drivers/MySQL \
+	      $$TERRALIBPATH/src/terralib/drivers/MySQL/include \ 
+	      $$TERRALIBPATH/src/terralib/drivers/Oracle \
+	      $$TERRALIBPATH/src/terralib/drivers/Oracle/OCI/include \
+	      $$TERRALIBPATH/src/terralib/drivers/PostgreSQL \
+	      $$TERRALIBPATH/src/terralib/drivers/PostgreSQL/includepg \
+	      $$TERRALIBPATH/src/terralib/drivers/Firebird \
+	      $$TERRALIBPATH/src/terralib/image_processing \
+	      $$TERRALIBPATH/src/appUtils
+#unix:INCLUDEPATH += ./linux/ui 
+
+SOURCES += $$TERRALIBPATH/terraView/main.cpp 
+
+trans.path = $$DESTDIR
+trans.files = $$TERRALIBPATH/terraView/*.qm
+
+INSTALLS += trans
diff --git a/build/qt/terraViewCore/terraViewCore.pro b/build/qt/terraViewCore/terraViewCore.pro
new file mode 100644
index 0000000..c693dc7
--- /dev/null
+++ b/build/qt/terraViewCore/terraViewCore.pro
@@ -0,0 +1,297 @@
+TARGET = terraViewCore
+
+CONFIG += dll
+include (../config.pri)
+CONFIG += qt
+
+DEFINES += TVIEW_AS_DLL
+
+TRANSLATIONS =  \
+	$$TERRALIBPATH/terraView/terraView_pt.ts \
+	$$TERRALIBPATH/terraView/terraView_es.ts
+
+isEmpty(TEDBDRIVERS) {
+    TEDBDRIVERS = ALLDRIVERS
+}
+
+DLGPATH = $$TERRALIBPATH/terraView/ui
+IMGPATH = $$DLGPATH/images
+
+win32 {
+     DEFINES += IBPP_WINDOWS \
+		UNICODE
+     
+     win32-g++ {
+		 debug {
+			LIBS += -L$$TERRALIBPATH/dependencies/win32/DSDK/Debug/lib \
+					-L$$TERRALIBPATH/dependencies/win32/DSDK/3rd-party/lib/Debug
+		 }
+		 release {
+			LIBS += -L$$TERRALIBPATH/dependencies/win32/DSDK/Release/lib \
+					-L$$TERRALIBPATH/dependencies/win32/DSDK/3rd-party/lib/Release
+		 }
+     }
+     else {
+	
+		INCLUDEPATH += $$TERRALIBPATH/src/terralib/drivers/ado
+
+		TEOUT = $$TERRALIBPATH/$$BUILDLOC
+		QMAKE_LIBDIR += $$TEOUT/qwt \
+			   $$TEOUT/terralib \
+			   $$TEOUT/stat \
+			   $$TEOUT/tiff \
+			   $$TEOUT/shapelib \
+			   $$TEOUT/libjpeg \
+			   $$TEOUT/libspl \
+			   $$TEOUT/terralibpdi \
+			   $$TEOUT/te_utils \
+			   $$TEOUT/te_functions \
+			   $$TEOUT/te_qwt \
+			   $$TEOUT/te_shapelib \
+			   $$TEOUT/te_apputils \
+			   $$TEOUT/stat \
+			   $$TEOUT/te_ado
+		debug:QMAKE_LIBDIR += $$TERRALIBPATH/dependencies/win32/DSDK/Debug/lib \
+				   $$TERRALIBPATH/dependencies/win32/DSDK/3rd-party/lib/Debug
+		release:QMAKE_LIBDIR += $$TERRALIBPATH/dependencies/win32/DSDK/Release/lib \
+				   $$TERRALIBPATH/dependencies/win32/DSDK/3rd-party/lib/Release
+	
+	        # Database drivers
+		contains(TEDBDRIVERS, ALLDRIVERS) {
+		    QMAKE_LIBDIR += $$TEOUT/te_mysql \
+			            $$TEOUT/te_postgresql \
+				    $$TEOUT/te_oracle \
+				    $$TEOUT/te_firebird
+	    }
+		else {
+		}
+		
+		LIBS += -llibjpeg -ltiff -lte_ado
+    }
+}
+unix {
+     DEFINES += IBPP_LINUX
+	 LIBS += -lterralibtiff -ljpeg 
+}
+
+UI_DIR = $$TERRALIBPATH/ui/terraView
+MOC_DIR = $$TERRALIBPATH/moc/terraView
+
+LIBS += -lterralib -lterralibpdi -lstat -lshapelib \
+	-lqwt -lte_functions -lte_utils -lte_qwt -lte_shapelib -lte_apputils -lte_spl
+
+win32:LIBS += -lopengl32 -lglu32 -llti_dsdk_dll -lgdalogr
+
+contains(TEDBDRIVERS, ALLDRIVERS):LIBS += -lte_mysql -lte_postgresql -lte_oracle -lte_firebird
+else {
+}
+	
+INCLUDEPATH += $$TERRALIBPATH/terraView \
+	      $$TERRALIBPATH/src/qwt/include \
+	      $$TERRALIBPATH/src/terralib/drivers/qwt \
+	      $$TERRALIBPATH/src/terralib/drivers/shapelib \
+	      $$TERRALIBPATH/src/terralib/drivers/spl \
+	      $$TERRALIBPATH/src/terralib/kernel \
+	      $$TERRALIBPATH/src/terralib/utils \
+	      $$TERRALIBPATH/src/terralib/functions \
+	      $$TERRALIBPATH/src/terralib/stat \
+	      $$TERRALIBPATH/src/shapelib \
+	      $$TERRALIBPATH/src/zlib \
+	      $$TERRALIBPATH/src/libspl \
+	      $$TERRALIBPATH/src/terralib/drivers/qt \
+	      $$TERRALIBPATH/src/terralib/drivers/MySQL \
+	      $$TERRALIBPATH/src/terralib/drivers/MySQL/include \ 
+	      $$TERRALIBPATH/src/terralib/drivers/Oracle \
+	      $$TERRALIBPATH/src/terralib/drivers/Oracle/OCI/include \
+	      $$TERRALIBPATH/src/terralib/drivers/PostgreSQL \
+	      $$TERRALIBPATH/src/terralib/drivers/PostgreSQL/includepg \
+	      $$TERRALIBPATH/src/terralib/drivers/Firebird \
+	      $$TERRALIBPATH/src/terralib/image_processing \
+	      $$TERRALIBPATH/src/appUtils \
+	      $$TERRALIBPATH/ui/appUtils 
+
+HEADERS += $$TERRALIBPATH/terraView/TViewDefines.h \
+	$$TERRALIBPATH/terraView/PluginSupportFunctions.h \
+	$$TERRALIBPATH/terraView/terraView.h \
+    $$TERRALIBPATH/terraView/TViewAbstractPlugin.h \
+	$$TERRALIBPATH/src/terralib/drivers/qt/TeQtMethods.h \
+	$$TERRALIBPATH/src/terralib/drivers/qt/TeQtTerraStat.h 
+SOURCES += $$TERRALIBPATH/terraView/PluginSupportFunctions.cpp \
+	$$TERRALIBPATH/terraView/terraView.cpp \
+    $$TERRALIBPATH/terraView/TViewAbstractPlugin.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/qt/TeQtMethods.cpp \
+	$$TERRALIBPATH/src/terralib/drivers/qt/TeQtTerraStat.cpp 
+ 
+FORMS += $$DLGPATH/addColumn.ui \
+	$$DLGPATH/addressChoiceWindow.ui \
+	$$DLGPATH/addressLocatorWindow.ui \
+	$$DLGPATH/addressNameSeparator.ui \
+	$$DLGPATH/addTheme.ui \
+	$$DLGPATH/addView.ui \
+	$$DLGPATH/anaesp.ui \
+	$$DLGPATH/bayesWindow.ui \
+	$$DLGPATH/changeColData.ui \
+	$$DLGPATH/changeColumnName.ui \
+	$$DLGPATH/changeColumnType.ui \
+	$$DLGPATH/changeMinMax.ui \
+	$$DLGPATH/connectView.ui \
+	$$DLGPATH/contrast.ui \
+	$$DLGPATH/createBuffersWindow.ui \
+	$$DLGPATH/countComputing.ui \
+	$$DLGPATH/createCells.ui \
+	$$DLGPATH/createLayerFromTheme.ui \
+	$$DLGPATH/createProxMatrix.ui \
+	$$DLGPATH/createTable.ui \
+	$$DLGPATH/createTextRepresentation.ui \
+	$$DLGPATH/createThemeFromTheme.ui \
+	$$DLGPATH/database.ui \
+	$$DLGPATH/databaseProp.ui \
+	$$DLGPATH/display.ui \
+	$$DLGPATH/displaySize.ui \
+	$$DLGPATH/exportWindow.ui \
+	$$DLGPATH/generateSamplePoints.ui \
+	$$DLGPATH/geoOpAdd.ui \
+	$$DLGPATH/geoOpAggregation.ui \
+	$$DLGPATH/geoOpAssignDataLocationCollect.ui \
+	$$DLGPATH/geoOpAssignDataLocationDistribute.ui \
+	$$DLGPATH/geoOpOverlayDifference.ui \
+	$$DLGPATH/geoOpOverlayIntersection.ui \
+	$$DLGPATH/geoOpOverlayUnion.ui \
+	$$DLGPATH/geographicalGrid.ui \
+	$$DLGPATH/graphic.ui \
+	$$DLGPATH/graphic3DWindow.ui \
+	$$DLGPATH/graphicConfigurationWindow.ui \
+	$$DLGPATH/graphicParams.ui \
+	$$DLGPATH/histogramBuildForm.ui \
+	$$DLGPATH/import.ui \
+	$$DLGPATH/importRasterSimple.ui \
+	$$DLGPATH/importTable.ui \
+	$$DLGPATH/importTbl.ui \
+	$$DLGPATH/importTablePoints.ui \
+	$$DLGPATH/importTblPoints.ui \
+	$$DLGPATH/insertPoint.ui \
+	$$DLGPATH/insertText.ui \
+	$$DLGPATH/insertSymbol.ui \
+	$$DLGPATH/kernelRatioWindow.ui \
+	$$DLGPATH/kernelWindow.ui \
+	$$DLGPATH/layerProp.ui \
+	$$DLGPATH/lbsDefinition.ui \
+	$$DLGPATH/legendWindow.ui \
+	$$DLGPATH/linkExtTable.ui \
+	$$DLGPATH/localBayesWindow.ui \
+	$$DLGPATH/pieBarChart.ui \
+	$$DLGPATH/printFileResolution.ui \
+	$$DLGPATH/projection.ui \
+	$$DLGPATH/query.ui \
+	$$DLGPATH/rasterColorCompositionWindow.ui \
+	$$DLGPATH/rasterImportWizard.ui \
+	$$DLGPATH/rasterSlicingWindow.ui \
+	$$DLGPATH/rasterTransparency.ui \
+	$$DLGPATH/removeTable.ui \
+	$$DLGPATH/saveAndLoadColorBarWindow.ui \
+	$$DLGPATH/saveAsTable.ui \
+	$$DLGPATH/saveRaster.ui \
+	$$DLGPATH/saveTableAsTxt.ui \
+	$$DLGPATH/saveThemeToFileWindow.ui \
+	$$DLGPATH/selThemeTables.ui \
+	$$DLGPATH/selectProxMatrix.ui \
+	$$DLGPATH/selectTextRepresentation.ui \
+	$$DLGPATH/semivar.ui \
+	$$DLGPATH/skaterWindow.ui \
+	$$DLGPATH/spatializationWindow.ui \
+	$$DLGPATH/spatialQuery.ui \
+	$$DLGPATH/statistic.ui \
+	$$DLGPATH/tableProp.ui \
+	$$DLGPATH/telayer_metadata.ui \
+	$$DLGPATH/terraViewBase.ui \
+	$$DLGPATH/textRep.ui \
+	$$DLGPATH/themeProp.ui \
+	$$DLGPATH/themeVis.ui \
+	$$DLGPATH/viewProp.ui \
+	$$DLGPATH/visual.ui \
+	$$DLGPATH/exportLayersThemes.ui 
+IMAGES += $$IMGPATH/addressDictionary.png \
+	$$IMGPATH/addressLayer.png \
+	$$IMGPATH/addressReferenceLayer.png \
+	$$IMGPATH/addressTable.png \
+	$$IMGPATH/and.bmp \
+	$$IMGPATH/area.bmp \
+	$$IMGPATH/buffer.bmp \
+	$$IMGPATH/bufferNoUnion.bmp \
+	$$IMGPATH/bufferUnion.bmp \
+	$$IMGPATH/clearColor.bmp \
+	$$IMGPATH/closeDB.bmp \
+	$$IMGPATH/containLin.bmp \
+	$$IMGPATH/containLinPol.bmp \
+	$$IMGPATH/containLinPon.bmp \
+	$$IMGPATH/containPol.bmp \
+	$$IMGPATH/convexHull.bmp \
+	$$IMGPATH/coverByPol.bmp \
+	$$IMGPATH/coverLinPol.bmp \
+	$$IMGPATH/coverPol.bmp \
+	$$IMGPATH/crossLin.bmp \
+	$$IMGPATH/crossLinPol.bmp \
+	$$IMGPATH/database.bmp \
+	$$IMGPATH/databasesTree.bmp \
+	$$IMGPATH/disjointLin.bmp \
+	$$IMGPATH/disjointLinPol.bmp \
+	$$IMGPATH/disjointLinPon.bmp \
+	$$IMGPATH/disjointPol.bmp \
+	$$IMGPATH/disjointPonPol.bmp \
+	$$IMGPATH/display.bmp \
+	$$IMGPATH/distance.bmp \
+	$$IMGPATH/distMeter.bmp \
+	$$IMGPATH/draw.bmp \
+	$$IMGPATH/edit.xpm \
+	$$IMGPATH/equalLin.bmp \
+	$$IMGPATH/equalPol.bmp \
+	$$IMGPATH/graphic.bmp \
+	$$IMGPATH/graphicConfig.bmp \
+	$$IMGPATH/graphicCursor.bmp \
+	$$IMGPATH/grid.bmp \
+	$$IMGPATH/help.bmp \
+	$$IMGPATH/import.bmp \
+	$$IMGPATH/infoCursor.bmp \
+	$$IMGPATH/infolayer.bmp \
+	$$IMGPATH/insideAndOutside.png \
+	$$IMGPATH/invertColor1.bmp \
+	$$IMGPATH/invertSelection.bmp \
+	$$IMGPATH/isContainLin.bmp \
+	$$IMGPATH/isContainLinPol.bmp \
+	$$IMGPATH/isContainPol.bmp \
+	$$IMGPATH/isContainPonPol.bmp \
+	$$IMGPATH/left.bmp \
+	$$IMGPATH/length.bmp \
+	$$IMGPATH/minus.bmp \
+	$$IMGPATH/nearstNeigh.bmp \
+	$$IMGPATH/nextDisplay.bmp \
+	$$IMGPATH/nonEdit.xpm \
+	$$IMGPATH/onlyInside.png \
+	$$IMGPATH/onlyOutside.png \
+	$$IMGPATH/openfile.bmp \
+	$$IMGPATH/or.bmp \
+	$$IMGPATH/overlapLin.bmp \
+	$$IMGPATH/overlapPol.bmp \
+	$$IMGPATH/panCursor.bmp \
+	$$IMGPATH/pointer.bmp \
+	$$IMGPATH/previousDisplay.bmp \
+	$$IMGPATH/print.bmp \
+	$$IMGPATH/promote.bmp \
+	$$IMGPATH/reset.bmp \
+	$$IMGPATH/right.bmp \
+	$$IMGPATH/table.bmp \
+	$$IMGPATH/terralib.bmp \
+	$$IMGPATH/theme.bmp \
+	$$IMGPATH/tileWindows.bmp \
+	$$IMGPATH/touchLin.bmp \
+	$$IMGPATH/touchLinPol.bmp \
+	$$IMGPATH/touchLinPon.bmp \
+	$$IMGPATH/touchPol.bmp \
+	$$IMGPATH/touchPonPol.bmp \
+	$$IMGPATH/unselect.bmp \
+	$$IMGPATH/view.bmp \
+	$$IMGPATH/viewsTree.bmp \
+	$$IMGPATH/xor.bmp \
+	$$IMGPATH/zoomCursor.bmp \
+	$$IMGPATH/zoomIn.bmp \
+	$$IMGPATH/zoomOut.bmp
\ No newline at end of file
diff --git a/build/qt/terralib.pro b/build/qt/terralib.pro
new file mode 100644
index 0000000..429fc16
--- /dev/null
+++ b/build/qt/terralib.pro
@@ -0,0 +1,36 @@
+#-------------------------------------------
+# To configure compilation, you can select values for TEDRIVERS variable. TEDRIVERS = ALLDRIVERS compile full terralib drivers.
+# Other values are HAS_FIREBIRD, HAS_MYSQL, HAS_ORACLE, HAS_POSTGRESQL, HAS_QWT, HAS_SHP, HAS_SPL, HAS_PDI.
+# To customize drivers you can use for example: TEDRIVERS="HAS_ORACLE HAS_QWT ..." 
+#-------------------------------------------
+TEMPLATE = subdirs
+
+SUBDIRS = ./libjpeg \
+		./shapelib \
+		./tiff \
+		./terralib \
+		./image_processing
+
+contains(TEDRIVERS, ALLDRIVERS) {
+	SUBDIRS += ./Firebird \
+			./MySQL \
+			./Oracle \
+			./PostgreSQL \
+			./qwt \
+			./te_qwt \
+			./te_shapelib \
+			./libspl \
+			./te_spl \
+			./dxflib \
+			./te_dxf
+}
+else {
+	contains(TEDRIVERS, HAS_FIREBIRD):SUBDIRS += ./Firebird
+	contains(TEDRIVERS, HAS_MYSQL):SUBDIRS += ./MySQL
+	contains(TEDRIVERS, HAS_ORACLE):SUBDIRS += ./Oracle
+	contains(TEDRIVERS, HAS_POSTGRESQL):SUBDIRS += ./PostgreSQL
+	contains(TEDRIVERS, HAS_QWT):SUBDIRS += ./qwt ./te_qwt
+	contains(TEDRIVERS, HAS_SHP):SUBDIRS += ./te_shapelib
+	contains(TEDRIVERS, HAS_SPL):SUBDIRS += ./libspl ./te_spl
+	contains(TEDRIVERS, HAS_DXF):SUBDIRS += ./dxflib ./te_dxf
+} 
diff --git a/build/qt/terralib/terralib.pro b/build/qt/terralib/terralib.pro
new file mode 100644
index 0000000..c550a92
--- /dev/null
+++ b/build/qt/terralib/terralib.pro
@@ -0,0 +1,256 @@
+TARGET  = terralib
+CONFIG += dll
+include (../config.pri)
+DEFINES += _USRDLL \
+			TL_AS_DLL
+win32-g++ {
+	LIBS += -L$$TERRALIBPATH/dependencies/win32/zlib/lib \
+		-lzlibdll
+}				
+unix:LIBS += -lpthread -lz
+LIBS += -ljpeg -lterralibtiff
+INCLUDEPATH	= $$TERRALIBPATH/src/terralib/kernel \
+	$$TERRALIBPATH/src/terralib/functions \
+	$$TERRALIBPATH/src/terralib/utils \
+	$$TERRALIBPATH/src/tiff \
+	$$TERRALIBPATH/src/zlib \
+	$$TERRALIBPATH/src/terralib/drivers/libjpeg \
+	$$TERRALIBPATH/src/libjpeg
+HEADERS	+= 	$$TERRALIBPATH/src/terralib/kernel/checkvec.h \
+			$$TERRALIBPATH/src/terralib/kernel/dynpq.h \
+			$$TERRALIBPATH/src/terralib/kernel/Gra_algo.h \
+			$$TERRALIBPATH/src/terralib/kernel/graph.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeAbstractFactory.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeAbstractTheme.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeAffineGT.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeAffineGTFactory.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeAgnostic.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeAsciiFile.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeAttribute.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeBox.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeBufferRegion.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeComposite.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeCommunicator.h \      
+			$$TERRALIBPATH/src/terralib/kernel/TeComputeAttributeStrategies.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeCoord2D.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeCounted.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDatabase.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDataTypes.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDatum.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDBConnectionsPool.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoder.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderASCIIGrid.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderDatabase.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderFile.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderJPEG.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderMemory.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderMemoryMap.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderSPR.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderTIFF.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderVirtualMemory.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderSmartMem.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDefines.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeErrorLog.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeErrorMessage.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeException.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeExternalTheme.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeFactory.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeFragmentation.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeFileTheme.h \	
+			$$TERRALIBPATH/src/terralib/kernel/TeGeneralizedProxMatrix.h \
+			 $$TERRALIBPATH/src/terralib/kernel/TeGDriverFactory.h \
+			 $$TERRALIBPATH/src/terralib/kernel/TeGeometricTransformation.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeGeometry.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeGeometryAlgorithms.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeGTParams.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeGTFactory.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeGroupingAlgorithms.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeImportRaster.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeIntersector.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeLayer.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeLegendEntry.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeMatrix.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeMeasure.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeMetaModelCache.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeMultiGeometry.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeNeighbours.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeNetwork.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeOverlay.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeOverlayUtils.h \
+			$$TERRALIBPATH/src/terralib/kernel/TePrecision.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeProgress.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeProgressBase.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeProject.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeProjection.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeProjectiveGT.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeProjectiveGTFactory.h \
+			$$TERRALIBPATH/src/terralib/kernel/TePrototype.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeProxMatrixConstructionStrategy.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeProxMatrixImplementation.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeProxMatrixSlicingStrategy.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeProxMatrixWeightsStrategy.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerier.h\
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierDB.h\
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierDBStr1.h\
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierDBStr2.h\
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierDBStr3.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierImpl.h\
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierParams.h\
+			$$TERRALIBPATH/src/terralib/kernel/TeRaster.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeRasterParams.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeRasterRemap.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeRasterTransform.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeRedBlackTree.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeRepresentation.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeSharedPtr.h \      
+			$$TERRALIBPATH/src/terralib/kernel/TeSingleton.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeSlice.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeSpatialOperations.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeStatistics.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeStdFile.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeSTEFunctionsDB.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeBaseSTInstance.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeBaseSTInstanceSet.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeSTElementSet.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeSTEvent.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeSTInstance.h\
+			$$TERRALIBPATH/src/terralib/kernel/TeTable.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeTemporalSeries.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeTheme.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeTime.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeTimeInterval.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeTin.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeUtils.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeVectorRemap.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeView.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeViewNode.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeVisual.h \
+			$$TERRALIBPATH/src/terralib/kernel/yyTemporal.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeRasterMemManager.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeMutex.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeThreadParameters.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeThread.h \
+      $$TERRALIBPATH/src/terralib/kernel/TeThreadFunctor.h \   
+      $$TERRALIBPATH/src/terralib/kernel/TeThreadSignal.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeDatabaseFactoryParams.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeMappedMemory.h \
+			$$TERRALIBPATH/src/terralib/drivers/libjpeg/TeLibJpegWrapper.h \
+			$$TERRALIBPATH/src/terralib/drivers/libjpeg/jmemdstsrc.h \
+			$$TERRALIBPATH/src/terralib/kernel/TeMultiContainer.h \
+      $$TERRALIBPATH/src/terralib/kernel/TeStdIOProgress.h \
+      $$TERRALIBPATH/src/terralib/kernel/TeThreadJobsManager.h \
+      $$TERRALIBPATH/src/terralib/kernel/TeThreadJob.h \
+      $$TERRALIBPATH/src/terralib/kernel/TeFunctionCallThreadJob.h \
+      $$TERRALIBPATH/src/terralib/kernel/TeTempFilesRemover.h \
+      $$TERRALIBPATH/src/terralib/kernel/TeSemaphore.h \
+      $$TERRALIBPATH/src/terralib/kernel/TePolygonSetProperties.h \
+      $$TERRALIBPATH/src/terralib/kernel/Te2ndDegPolinomialGT.h \
+      $$TERRALIBPATH/src/terralib/kernel/Te2ndDegPolinomialGTFactory.h \
+	  $$TERRALIBPATH/src/terralib/kernel/TeDatabaseIndex.h
+SOURCES	+=	\
+			$$TERRALIBPATH/src/terralib/kernel/lexTemporal.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeAbstractTheme.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeAffineGT.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeAffineGTFactory.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeAgnostic.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeAsciiFile.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeBox.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeBufferRegion.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeCentroid.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeComputeAttributeStrategies.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDatabase.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDatabaseFactory.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDatum.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDBConnectionsPool.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderASCIIGrid.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderDatabase.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderFile.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderJPEG.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderMemory.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderMemoryMap.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderSPR.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderTIFF.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderVirtualMemory.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDecoderSmartMem.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeErrorLog.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeErrorMessage.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeException.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeExternalTheme.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeFragmentation.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeFileTheme.cpp \	
+			$$TERRALIBPATH/src/terralib/kernel/TeGDriverFactory.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeGeometricTransformation.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeGeometry.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeGeometryAlgorithms.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeGTParams.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeGTFactory.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeGroupingAlgorithms.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeImportRaster.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeInitRasterDecoders.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeIntersector.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeLayer.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeLegendEntry.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeMatrix.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeMetaModelCache.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeMultiGeometry.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeNeighbours.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeNetwork.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeOverlay.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeOverlayUtils.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeProgress.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeProject.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeProjection.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeProjectiveGT.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeProjectiveGTFactory.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeProxMatrixConstructionStrategy.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeProxMatrixImplementation.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeProxMatrixStrategies.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerier.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierDB.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierDBStr1.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierDBStr2.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierDBStr3.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierImpl.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeQuerierParams.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeRaster.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeRasterParams.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeRasterRemap.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeRasterTransform.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeRepresentation.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeSpatialOperations.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeStdFile.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeSTElementSet.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeSTEvent.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeSTInstance.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeTable.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeTemporalSeries.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeTheme.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeTime.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeTimeInterval.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeTin.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeUtils.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeVectorRemap.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeViewNode.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeVisual.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/yyTemporal.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeDatabaseFactoryParams.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeMappedMemory.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeRasterMemManager.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeMutex.cpp \
+			$$TERRALIBPATH/src/terralib/kernel/TeThread.cpp \
+      $$TERRALIBPATH/src/terralib/kernel/TeThreadFunctor.cpp \   
+      $$TERRALIBPATH/src/terralib/kernel/TeThreadSignal.cpp \
+			$$TERRALIBPATH/src/terralib/drivers/libjpeg/TeLibJpegWrapper.cpp \
+			$$TERRALIBPATH/src/terralib/drivers/libjpeg/jmemdst.c \
+			$$TERRALIBPATH/src/terralib/drivers/libjpeg/jmemsrc.c \
+      $$TERRALIBPATH/src/terralib/kernel/TeStdIOProgress.cpp \
+      $$TERRALIBPATH/src/terralib/kernel/TeThreadJobsManager.cpp \
+      $$TERRALIBPATH/src/terralib/kernel/TeThreadJob.cpp \
+      $$TERRALIBPATH/src/terralib/kernel/TeFunctionCallThreadJob.cpp \
+      $$TERRALIBPATH/src/terralib/kernel/TeTempFilesRemover.cpp \
+      $$TERRALIBPATH/src/terralib/kernel/TeSemaphore.cpp \
+      $$TERRALIBPATH/src/terralib/kernel/TePolygonSetProperties.cpp \
+      $$TERRALIBPATH/src/terralib/kernel/Te2ndDegPolinomialGT.cpp \
+      $$TERRALIBPATH/src/terralib/kernel/Te2ndDegPolinomialGTFactory.cpp \
+	  $$TERRALIBPATH/src/terralib/kernel/TeDatabaseIndex.cpp
+      
diff --git a/build/qt/tiff/tiff.pro b/build/qt/tiff/tiff.pro
new file mode 100644
index 0000000..2129785
--- /dev/null
+++ b/build/qt/tiff/tiff.pro
@@ -0,0 +1,93 @@
+TARGET  = terralibtiff
+CONFIG += dll 
+win32:DEFINES += WIN32 \
+    _WINDOWS \
+    _USRDLL \
+    _BUILD_AS_DLL
+include (../config.pri)
+
+TIFFPATH = $$TERRALIBPATH/src/tiff
+win32-g++:LIBS += -L$$TERRALIBPATH/dependencies/win32/zlib/lib -lzlibdll
+unix:LIBS += -lz
+LIBS += -ljpeg
+
+INCLUDEPATH	+= $$TERRALIBPATH/src/libjpeg \
+		   $$TERRALIBPATH/src/zlib
+HEADERS += $$TIFFPATH/cpl_csv.h \
+    $$TIFFPATH/cpl_serv.h \
+    $$TIFFPATH/geo_config.h \
+    $$TIFFPATH/geo_keyp.h \
+    $$TIFFPATH/geo_normalize.h \
+    $$TIFFPATH/geo_tiffp.h \
+    $$TIFFPATH/geokeys.h \
+    $$TIFFPATH/geonames.h \
+    $$TIFFPATH/geotiff.h \
+    $$TIFFPATH/geotiffio.h \
+    $$TIFFPATH/geovalues.h \
+    $$TIFFPATH/port.h \
+    $$TIFFPATH/t4.h \
+    $$TIFFPATH/tif_config.h \
+    $$TIFFPATH/tif_dir.h \
+    $$TIFFPATH/tif_fax3.h \
+    $$TIFFPATH/tif_predict.h \
+    $$TIFFPATH/tiff.h \
+    $$TIFFPATH/tiffcomp.h \
+    $$TIFFPATH/tiffconf.h \
+    $$TIFFPATH/tiffio.h \
+    $$TIFFPATH/tiffiop.h \
+    $$TIFFPATH/tiffvers.h \
+    $$TIFFPATH/uvcode.h \
+    $$TIFFPATH/xtiffio.h \
+    $$TIFFPATH/xtiffiop.h
+SOURCES += $$TIFFPATH/cpl_csv.c \
+    $$TIFFPATH/cpl_serv.c \
+    $$TIFFPATH/geo_extra.c \
+    $$TIFFPATH/geo_free.c \
+    $$TIFFPATH/geo_get.c \
+    $$TIFFPATH/geo_names.c \
+    $$TIFFPATH/geo_new.c \
+    $$TIFFPATH/geo_normalize.c \
+    $$TIFFPATH/geo_print.c \
+    $$TIFFPATH/geo_set.c \
+    $$TIFFPATH/geo_tiffp.c \
+    $$TIFFPATH/geo_trans.c \
+    $$TIFFPATH/geo_write.c \
+    $$TIFFPATH/geotiff_proj4.c \
+    $$TIFFPATH/tif_aux.c \
+    $$TIFFPATH/tif_close.c \
+    $$TIFFPATH/tif_codec.c \
+    $$TIFFPATH/tif_color.c \
+    $$TIFFPATH/tif_compress.c \
+    $$TIFFPATH/tif_dir.c \
+    $$TIFFPATH/tif_dirinfo.c \
+    $$TIFFPATH/tif_dirread.c \
+    $$TIFFPATH/tif_dirwrite.c \
+    $$TIFFPATH/tif_dumpmode.c \
+    $$TIFFPATH/tif_error.c \
+    $$TIFFPATH/tif_extension.c \
+    $$TIFFPATH/tif_fax3.c \
+    $$TIFFPATH/tif_fax3sm.c \
+    $$TIFFPATH/tif_flush.c \
+    $$TIFFPATH/tif_getimage.c \
+    $$TIFFPATH/tif_jpeg.c \
+    $$TIFFPATH/tif_luv.c \
+    $$TIFFPATH/tif_lzw.c \
+    $$TIFFPATH/tif_machdep.c \
+    $$TIFFPATH/tif_next.c \
+    $$TIFFPATH/tif_open.c \
+    $$TIFFPATH/tif_packbits.c \
+    $$TIFFPATH/tif_pixarlog.c \
+    $$TIFFPATH/tif_predict.c \
+    $$TIFFPATH/tif_print.c \
+    $$TIFFPATH/tif_read.c \
+    $$TIFFPATH/tif_strip.c \
+    $$TIFFPATH/tif_swab.c \
+    $$TIFFPATH/tif_thunder.c \
+    $$TIFFPATH/tif_tile.c \
+    $$TIFFPATH/tif_version.c \
+    $$TIFFPATH/tif_warning.c \
+    $$TIFFPATH/tif_write.c \
+    $$TIFFPATH/tif_zip.c \
+    $$TIFFPATH/xtiff.c
+win32:SOURCES += $$TIFFPATH/tif_win32.c 
+unix:SOURCES += $$TIFFPATH/tif_unix.c
diff --git a/build/qt/utilities.pro b/build/qt/utilities.pro
new file mode 100644
index 0000000..427f673
--- /dev/null
+++ b/build/qt/utilities.pro
@@ -0,0 +1,8 @@
+include(./terralib.pro)
+
+TEMPLATE = subdirs
+
+SUBDIRS += ./stat \
+		./te_functions \
+		./te_utils \
+		./appUtils
\ No newline at end of file
diff --git a/build/qt4/Firebird/Firebird.pro b/build/qt4/Firebird/Firebird.pro
new file mode 100644
index 0000000..bcfc342
--- /dev/null
+++ b/build/qt4/Firebird/Firebird.pro
@@ -0,0 +1,48 @@
+CONFIG += dll
+TARGET = te_firebird
+include (../config.pri)
+# Path definitions
+# ----------------------------------------------------------
+FBSRCPATH = $${TERRALIBPATH}/src/terralib/drivers/Firebird
+FBDEP = $${TERRALIBPATH}/dependencies
+win32:FBDEP = $${FBDEP}/win32
+unix:FBDEP = $${FBDEP}/linux
+FBDEP = $${FBDEP}/Firebird
+# ----------------------------------------------------------
+DEFINES += TLFIREBIRD_AS_DLL
+LIBS += -lterralib 
+unix:LIBS += -L$${FBDEP}/lib \
+		-lfbembed
+win32:DEFINES += IBPP_WINDOWS
+unix:DEFINES += IBPP_LINUX
+INCLUDEPATH += $${FBSRCPATH}
+HEADERS += $${FBSRCPATH}/ibpp/core/_ibpp.h \
+          $${FBSRCPATH}/ibpp/core/ibase.h \
+          $${FBSRCPATH}/ibpp/core/iberror.h \
+          $${FBSRCPATH}/ibpp/core/ibpp.h \
+          $${FBSRCPATH}/TeFirebird.h \
+          $${FBSRCPATH}/TeFirebirdDefines.h
+SOURCES += $${FBSRCPATH}/TeFirebird.cpp \
+        $${FBSRCPATH}/ibpp/core/all_in_one.cpp
+include (../install_cfg.pri)
+CONFIG(copy_dir_files) {
+    #Firebird dependencies install
+    ibpp.path = $${DEPLOY_DIR}/include/Firebird/ibpp/core
+    ibpp.files = $${FBSRCPATH}/ibpp/core/*.h
+
+    include.path = $${DEPLOY_DIR}/include/Firebird
+    include.files = $${FBSRCPATH}/*.h
+
+    INSTALLS += ibpp include
+}
+unix {
+    cop_dps.commands = cp -f $${FBDEP}/lib/* $${target.path} && \
+                       cd $${target.path} && ln -sf libicudata.so.30 libicudata.so && ln -sf libicui18n.so.30 libicui18n.so &&  ln -sf libicuuc.so.30 libicuuc.so
+    QMAKE_EXTRA_TARGETS += cop_dps
+    POST_TARGETDEPS += cop_dps
+}
+win32 {
+    bin.files = $${FBDEP}/bin/*.dll
+    bin.path = $${DEPLOY_DIR}/bin
+    INSTALLS += bin
+}
diff --git a/build/qt4/MySQL/MySQL.pro b/build/qt4/MySQL/MySQL.pro
new file mode 100644
index 0000000..371d21f
--- /dev/null
+++ b/build/qt4/MySQL/MySQL.pro
@@ -0,0 +1,52 @@
+CONFIG += dll
+TARGET = te_mysql
+
+include (../config.pri)
+# Path definitions
+# ----------------------------------------------------------
+MSQLSRCPATH = $${TERRALIBPATH}/src/terralib/drivers/MySQL
+MSQLDEPPATH = $${TERRALIBPATH}/dependencies
+unix:MSQLDEPPATH = $${MSQLDEPPATH}/linux
+win32:MSQLDEPPATH = $${MSQLDEPPATH}/win32
+MSQLDEPPATH = $${MSQLDEPPATH}/MySQL
+# ----------------------------------------------------------
+
+DEFINES += TLMYSQL_AS_DLL
+
+LIBS += -lterralib 
+
+win32 {
+    !win32-g++ {
+            QMAKE_LIBDIR += $${MSQLDEPPATH}/lib/ms
+	    LIBS += -llibmysql
+    }
+    else:LIBS += -L$${MSQLDEPPATH}/lib/mingw -lmysql_mingw
+}
+
+unix:LIBS += -L$${MSQLDEPPATH}/lib \
+		-lmysqlclient
+
+INCLUDEPATH += $${TERRALIBPATH}/src/terralib/drivers/MySQL  \
+	      $${TERRALIBPATH}/src/terralib/drivers/MySQL/include
+
+HEADERS += $${MSQLSRCPATH}/TeMySQL.h \
+        $${MSQLSRCPATH}/TeMySQLDefines.h
+
+SOURCES += $${MSQLSRCPATH}/TeMySQL.cpp
+
+include (../install_cfg.pri)
+
+CONFIG(copy_dir_files) {
+    msql.path = $${DEPLOY_DIR}/include/MySQL/include
+    msql.files = $${MSQLSRCPATH}/include/*.h
+
+    include.path = $${DEPLOY_DIR}/include/MySQL
+    include.files = $${MSQLSRCPATH}/*.h
+
+    INSTALLS += msql include
+}
+win32 {
+    bin.files = $${MSQLDEPPATH}/bin/*.dll
+    bin.path = $${DEPLOY_DIR}/bin
+    INSTALLS += bin
+}
diff --git a/build/qt4/Oracle/Oracle.pro b/build/qt4/Oracle/Oracle.pro
new file mode 100644
index 0000000..202654e
--- /dev/null
+++ b/build/qt4/Oracle/Oracle.pro
@@ -0,0 +1,71 @@
+CONFIG += dll
+TARGET = te_oracle
+
+include (../config.pri)
+# Path definitions
+# ----------------------------------------------------------
+ORSRCPATH = $${TERRALIBPATH}/src/terralib/drivers/Oracle
+ORDEP = $${TERRALIBPATH}/dependencies
+win32:ORDEP = $${ORDEP}/win32
+unix:ORDEP = $${ORDEP}/linux
+ORDEP = $${ORDEP}/Oracle
+# ----------------------------------------------------------
+
+DEFINES += TLORACLE_AS_DLL
+
+LIBS += -lterralib 
+
+win32 {
+     !win32-g++:QMAKE_LIBDIR += $${ORDEP}/lib
+     else:LIBS += -L$${ORDEP}/lib
+
+     LIBS += -loci
+}
+
+unix:LIBS += -L$${ORDEP}/lib \
+		-lclntsh -lnnz10 -lociei
+
+INCLUDEPATH += $${ORSRCPATH}  \
+              $${ORSRCPATH}/OCI/include
+
+HEADERS += $${ORSRCPATH}/TeOracleSpatial.h \
+        $${ORSRCPATH}/TeOCIOracle.h \
+        $${ORSRCPATH}/TeOCIConnect.h \
+        $${ORSRCPATH}/TeOCICursor.h \
+        $${ORSRCPATH}/TeOCISDO.h \
+        $${ORSRCPATH}/TeOracleDefines.h
+
+SOURCES += $${ORSRCPATH}/TeOracleSpatial.cpp \
+        $${ORSRCPATH}/TeOCIOracle.cpp \
+        $${ORSRCPATH}/TeOCIConnect.cpp \
+        $${ORSRCPATH}/TeOCICursor.cpp \
+        $${ORSRCPATH}/TeOCISDO.cpp
+
+unix {
+    create_link.commands = cd $${ORDEP}/lib/ && ln -sf libclntsh.so.10.1 libclntsh.so
+    QMAKE_EXTRA_TARGETS += create_link
+    PRE_TARGETDEPS += create_link
+}
+
+include (../install_cfg.pri)
+
+CONFIG(copy_dir_files) {
+    ora.path = $${DEPLOY_DIR}/include/Oracle/OCI/include
+    ora.files = $${ORSRCPATH}/OCI/include/*.h
+
+    include.path = $${DEPLOY_DIR}/include/Oracle
+    include.files = $${ORSRCPATH}/*.h
+
+    INSTALLS += ora include
+}
+#Oracle dependencies install
+unix {
+    cop_dps.commands = cp -f $${ORDEP}/lib/* $${target.path}
+    QMAKE_EXTRA_TARGETS += cop_dps
+    POST_TARGETDEPS += cop_dps
+}
+win32 {
+    bin.files = $${ORDEP}/bin/*.dll
+    bin.path = $${DEPLOY_DIR}/bin
+    INSTALLS += bin
+}
diff --git a/build/qt4/PostgreSQL/PostgreSQL.pro b/build/qt4/PostgreSQL/PostgreSQL.pro
new file mode 100644
index 0000000..2a6d5d6
--- /dev/null
+++ b/build/qt4/PostgreSQL/PostgreSQL.pro
@@ -0,0 +1,55 @@
+CONFIG += dll
+TARGET = te_postgresql
+
+include (../config.pri)
+# Path definitions
+# ----------------------------------------------------------
+PGSRCPATH = $${TERRALIBPATH}/src/terralib/drivers/PostgreSQL
+PGDEP = $${TERRALIBPATH}/dependencies
+win32:PGDEP = $${PGDEP}/win32
+unix:PGDEP = $${PGDEP}/linux
+PGDEP = $${PGDEP}/PostgreSQL
+# ----------------------------------------------------------
+
+DEFINES += TLPOSTGRESQL_AS_DLL
+
+LIBS += -lterralib 
+
+win32 {
+    win32-g++:LIBS += -L$${PGDEP}/lib -lwsock32
+    else:QMAKE_LIBDIR += $${PGDEP}/lib
+    LIBS += -llibpq
+}
+unix:LIBS += -L$${PGDEP}/lib -lpq -lcrypt
+
+INCLUDEPATH += $${PGSRCPATH}  \
+              $${PGSRCPATH}/includepg
+
+HEADERS += $${PGSRCPATH}/TePGInterface.h \
+        $${PGSRCPATH}/TePGUtils.h \
+        $${PGSRCPATH}/TePostgreSQL.h \
+        $${PGSRCPATH}/TePostGIS.h \
+        $${PGSRCPATH}/TePostgreSQLDefines.h
+
+SOURCES += $${PGSRCPATH}/TePGInterface.cpp \
+        $${PGSRCPATH}/TePGUtils.cpp \
+        $${PGSRCPATH}/TePostgreSQL.cpp \
+        $${PGSRCPATH}/TePostGIS.cpp
+	
+include (../install_cfg.pri)
+
+CONFIG(copy_dir_files) {
+    psql.path = $${DEPLOY_DIR}/include/PostgreSQL/includepg
+    psql.files = $${PGSRCPATH}/includepg/*.h
+
+    include.path = $${DEPLOY_DIR}/include/PostgreSQL
+    include.files = $${PGSRCPATH}/*.h
+
+    INSTALLS += psql include
+}
+#PostgreSQL dependencies install
+win32 {
+    bin.files = $${PGDEP}/bin/*.dll
+    bin.path = $${DEPLOY_DIR}/bin
+    INSTALLS += bin
+}
diff --git a/build/qt4/config.pri b/build/qt4/config.pri
new file mode 100644
index 0000000..7b998ea
--- /dev/null
+++ b/build/qt4/config.pri
@@ -0,0 +1,39 @@
+#Defining paths
+#-----------------------------
+isEmpty(TERRALIBPATH) {
+  # Trying to get it from the user environment variable with the same name
+  TERRALIBPATH = $$(TERRALIB_DIR)
+  
+  # The default - if none of previews attempts succeed
+  isEmpty(TERRALIBPATH):TERRALIBPATH = ../../..
+}
+#-----------------------------
+TEMPLATE = lib
+unix:VERSION = 3.6.1
+CONFIG	+= warn_on \
+        rtti \
+        exceptions \
+        thread \
+        debug_and_release
+CONFIG -= qt
+LANGUAGE	= C++
+#-----------------------------
+#Dependencies definitions
+#-----------------------------
+CONFIG(debug, debug|release) {
+    DEFINES += _DEBUG
+    BUILDLOC = Debug
+}
+CONFIG(release, debug|release) {
+    DEFINES += NDEBUG
+    BUILDLOC = Release
+}
+DEFINES -= UNICODE
+unix:DESTDIR = $${TERRALIBPATH}/$${BUILDLOC}/linux-g++
+OBJECTS_DIR = $${DESTDIR}/obj/$${TARGET}
+unix:LIBS += -L$${DESTDIR} 
+INCLUDEPATH += $${TERRALIBPATH}/src/terralib/kernel
+win32 {
+    win32-g++:include(config_win32-g++.pri)
+    else:include(config_win32-msvc.pri)
+}
diff --git a/build/qt4/config_win32-g++.pri b/build/qt4/config_win32-g++.pri
new file mode 100644
index 0000000..a065aba
--- /dev/null
+++ b/build/qt4/config_win32-g++.pri
@@ -0,0 +1,4 @@
+DEFINES += WIN32 _WINDOWS
+DESTDIR = $${TERRALIBPATH}/$${BUILDLOC}/win32-g++
+OBJECTS_DIR = $${DESTDIR}/obj/$${TARGET}
+LIBS += -L$${DESTDIR}
diff --git a/build/qt4/config_win32-msvc.pri b/build/qt4/config_win32-msvc.pri
new file mode 100644
index 0000000..0f98d14
--- /dev/null
+++ b/build/qt4/config_win32-msvc.pri
@@ -0,0 +1,24 @@
+DEFINES += WIN32 _WINDOWS
+DESTDIR = $${TERRALIBPATH}/$${BUILDLOC}/win32-msvc
+OBJECTS_DIR = $${DESTDIR}
+CONFIG -= incremental
+QMAKE_LIBDIR += $${TERRALIBPATH}/$${BUILDLOC}/win32-msvc
+CONFIG(debug, debug|release){
+	contains(CONFIG, dll) {
+		 QMAKE_CFLAGS_MT_DLLDBG += -MDd
+		 QMAKE_CXXFLAGS_MT_DLLDBG += -MDd -Od -Fd$${OBJECTS_DIR}/
+	}
+}
+CONFIG(release, debug|release) {
+	contains(CONFIG, dll) {
+		 QMAKE_CFLAGS_MT_DLL += -O2
+		 QMAKE_CXXFLAGS_MT_DLL += -O2 -Fd$${OBJECTS_DIR}/
+	}
+}
+QMAKE_LFLAGS += /IMPLIB:$(OutDir)/$(ProjectName).lib
+QMAKE_LFLAGS -= /NOLOGO 
+QMAKE_LFLAGS += /PDB:$(OutDir)/$(ProjectName).pdb
+QMAKE_CFLAGS += /GS -wd4100
+QMAKE_CXXFLAGS += /GS -wd4100
+QMAKE_CFLAGS_DEBUG += -RTC1 
+QMAKE_CXXFLAGS_DEBUG += -RTC1 
diff --git a/build/qt4/dxflib/dxflib.pro b/build/qt4/dxflib/dxflib.pro
new file mode 100644
index 0000000..e69e58e
--- /dev/null
+++ b/build/qt4/dxflib/dxflib.pro
@@ -0,0 +1,30 @@
+TARGET = dxf
+win32:CONFIG += staticlib
+unix:CONFIG += dll
+
+include (../config.pri)
+
+SRCPATH = $${TERRALIBPATH}/src/dxflib
+
+win32-msvc:DEFINES += _CRT_SECURE_NO_DEPRECATE
+
+macx {
+  QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.5.sdk
+  CONFIG+=x86 ppc
+}
+
+INCLUDEPATH += $${SRCPATH}
+HEADERS += $${SRCPATH}/dl_attributes.h\
+    $${SRCPATH}/dl_codes.h\
+    $${SRCPATH}/dl_creationadapter.h\
+    $${SRCPATH}/dl_creationinterface.h\
+    $${SRCPATH}/dl_dxf.h\
+    $${SRCPATH}/dl_entities.h\
+    $${SRCPATH}/dl_exception.h\
+    $${SRCPATH}/dl_extrusion.h\
+    $${SRCPATH}/dl_writer.h\
+    $${SRCPATH}/dl_writer_ascii.h
+SOURCES += $${SRCPATH}/dl_dxf.cpp\
+    $${SRCPATH}/dl_writer_ascii.cpp
+
+include (../install_cfg.pri)
diff --git a/build/qt4/image_processing/image_processing.pro b/build/qt4/image_processing/image_processing.pro
new file mode 100644
index 0000000..e12bc33
--- /dev/null
+++ b/build/qt4/image_processing/image_processing.pro
@@ -0,0 +1,264 @@
+TARGET  = terralibpdi
+CONFIG += dll 
+include (../config.pri)
+TERRALIB_SRC_DIR = $${TERRALIBPATH}/src
+LIBPDI_SRC_DIR = $${TERRALIB_SRC_DIR}/terralib/image_processing
+DEFINES += PDI_AS_DLL
+
+LIBS += -ljpeg -lterralib
+
+win32 {
+	win32-g++:LIBS += -L../../../dependencies/win32/zlib/lib 
+	else:QMAKE_LIBDIR += ../../../dependencies/win32/zlib/lib
+	LIBS += -lzlibdll
+}
+unix:LIBS += -lz -lpthread
+LIBS += -lterralibtiff
+INCLUDEPATH = \
+  $${TERRALIB_SRC_DIR}/terralib/kernel \
+  $${TERRALIB_SRC_DIR}/terralib/functions \
+  $${TERRALIB_SRC_DIR}/tiff \
+  $${LIBPDI_SRC_DIR} \
+  $${LIBPDI_SRC_DIR}/data_structs
+INCLUDEPATH = \
+  $${TERRALIB_SRC_DIR}/terralib/kernel \
+  $${TERRALIB_SRC_DIR}/terralib/functions \
+  $${TERRALIB_SRC_DIR}/tiff \
+  $${LIBPDI_SRC_DIR} \
+  $${LIBPDI_SRC_DIR}/data_structs
+
+HEADERS = \
+          $${LIBPDI_SRC_DIR}/TePDITileIndexer.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMatrix.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMatrixFunctions.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMathFunctions.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIUtils.hpp \
+          $${LIBPDI_SRC_DIR}/TePDITypes.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIPIManager.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIHistogram.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRgbPaletteNode.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRgbPalette.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRgbPaletteFunctions.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParameters.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIAlgorithm.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIAlgorithmFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIStatistic.hpp \
+          $${LIBPDI_SRC_DIR}/TePDILevelRemap.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIContrast.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIContrastFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIFilterMask.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIBufferedFilter.hpp \
+          $${LIBPDI_SRC_DIR}/TePDILinearFilter.hpp \
+          $${LIBPDI_SRC_DIR}/TePDILinearFilterFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIBDFilter.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIBDFilterFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMorfFilter.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMorfFilterFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarFilter.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarLeeFilter.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarLeeFilterFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarKuanFilter.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarKuanFilterFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarFrostFilter.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarFrostFilterFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIArithmetic.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIArithmeticFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRaster2Vector.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRaster2VectorFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIColorTransform.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIColorTransformFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIPrincipalComponents.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIPrincipalComponentsFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMallatWavelets.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIGeoMosaic.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIBatchGeoMosaic.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIStrategy.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIStrategyFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIGarguetFusion.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIVenturaFusion.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRegGrowSeg.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRegGrowSegFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRegister.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRegisterFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIInterpolator.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIEspecData.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRegion.hpp \
+          $${LIBPDI_SRC_DIR}/TePDICluster.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIIsosegClas.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIIsosegClasFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIHaralick.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelComponent.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelComponentList.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModel.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelSpectralBand.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelSpectralBandList.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIPrincoMixModelSF.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIPrincoMixModelStrategy.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelStrategy.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelStratFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIKMeansClas.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIKMeansClasFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIEMClas.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIEMClasFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDISensorSimulatorFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDISensorSimulator.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIPIManagerGlobalSettings.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIOFMatching.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIPrincipalComponentsFusion.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIDecorrelationEnhancement.hpp \
+          $${LIBPDI_SRC_DIR}/TePDICorrelationMatching.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIBaatz.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMIMatching.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIJointHistogram.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMtxDoubleAdpt.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIMMIOMatching.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIIHSFusion.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIFusionIndexes.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIGeneralizedIHSFusion.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIIHSWaveletFusion.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIPCAWaveletFusion.hpp \ 
+          $${LIBPDI_SRC_DIR}/TePDIWaveletAtrousFusion.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIWiSpeRFusion.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIWaveletAtrous.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParallelSegmenter.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegStrategy.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegStrategyFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegSegment.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegSegmentsBlock.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegStrategyFactoryParams.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegRegGrowStrategy.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegRegGrowStrategyFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegBaatzStrategy.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegBaatzStrategyFactory.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegStrategyParams.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIBlender.hpp \
+          $${LIBPDI_SRC_DIR}/TePDITPMosaic.hpp \
+          $${LIBPDI_SRC_DIR}/TePDISAMClassifier.hpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarGammaFilter.hpp
+
+
+SOURCES = \
+          $${LIBPDI_SRC_DIR}/TePDIMathFunctions.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIUtils.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMatrixFunctions.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIPIManager.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIHistogram.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRgbPalette.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRgbPaletteFunctions.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParameters.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIAlgorithm.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIAlgorithmFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIStatistic.cpp \
+          $${LIBPDI_SRC_DIR}/TePDILevelRemap.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIContrast.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIContrastFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIFilterMask.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIBufferedFilter.cpp \
+          $${LIBPDI_SRC_DIR}/TePDILinearFilter.cpp \
+          $${LIBPDI_SRC_DIR}/TePDILinearFilterFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIBDFilter.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIBDFilterFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMorfFilter.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMorfFilterFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarFilter.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarLeeFilter.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarLeeFilterFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarKuanFilter.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarKuanFilterFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarFrostFilter.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarFrostFilterFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIArithmetic.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIArithmeticFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRaster2Vector.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRaster2VectorFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIColorTransform.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIColorTransformFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIPrincipalComponents.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIPrincipalComponentsFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMallatWavelets.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIGeoMosaic.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIBatchGeoMosaic.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIStrategy.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIStrategyFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIGarguetFusion.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIVenturaFusion.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRegGrowSeg.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRegGrowSegFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRegister.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRegisterFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIInterpolator.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIEspecData.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRegion.cpp \
+          $${LIBPDI_SRC_DIR}/TePDICluster.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIIsosegClas.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIIsosegClasFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIHaralick.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelComponent.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelComponentList.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModel.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelSpectralBand.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelSpectralBandList.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIPrincoMixModelSF.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIPrincoMixModelStrategy.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelStrategy.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMixModelStratFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIKMeansClas.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIKMeansClasFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIEMClas.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIEMClasFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDISensorSimulatorFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDISensorSimulator.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIOFMatching.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIPrincipalComponentsFusion.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIDecorrelationEnhancement.cpp \
+          $${LIBPDI_SRC_DIR}/TePDICorrelationMatching.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIBaatz.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMIMatching.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIJointHistogram.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIMMIOMatching.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIIHSFusion.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIFusionIndexes.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIGeneralizedIHSFusion.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIIHSWaveletFusion.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIPCAWaveletFusion.cpp \ 
+          $${LIBPDI_SRC_DIR}/TePDIWaveletAtrousFusion.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIWiSpeRFusion.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIWaveletAtrous.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegSegment.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegSegmentsBlock.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegStrategyParams.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegStrategy.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParallelSegmenter.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegRegGrowStrategy.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegBaatzStrategy.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegStrategyFactoryParams.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegStrategyFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegRegGrowStrategyFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIParaSegBaatzStrategyFactory.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIBlender.cpp \
+          $${LIBPDI_SRC_DIR}/TePDITPMosaic.cpp \
+          $${LIBPDI_SRC_DIR}/TePDISAMClassifier.cpp \
+          $${LIBPDI_SRC_DIR}/TePDIRadarGammaFilter.cpp
+
+win32 {
+  !win32-g++ {
+	  CONFIG += staticlib console
+
+	  DEFINES += WIN32 __WIN32__
+
+	  TEMPLATE = vclib
+  }
+  
+  USE_TERRALIB_STL = yes
+  contains( QMAKESPEC , win32-msvc.net ) {
+    USE_TERRALIB_STL = no
+  }
+  equals( USE_TERRALIB_STL , yes ) {
+    INCLUDEPATH = $${TERRALIB_SRC_DIR}/STLport $${INCLUDEPATH}
+    message( "TerraLib internal STL will be used" )
+  }    
+}
+
+include (../install_cfg.pri)
diff --git a/build/qt4/install_cfg.pri b/build/qt4/install_cfg.pri
new file mode 100644
index 0000000..76f0732
--- /dev/null
+++ b/build/qt4/install_cfg.pri
@@ -0,0 +1,41 @@
+#--------------------------------------------------------------
+# Installing configurations
+# You can choose the path where the the package will be copied.
+# To do so set the $DEPLOY_DIR to the path desired.
+# Ex : 'qmake DEPLOY_DIR=/home/usr/terralib'(This will copy
+# headers and binaries to the folder '/home/usr/terralib').
+# Note: use 'install' as argument on make command.
+# Note: you can choose to copy also directories. To do so add
+# the option CONFIG+=copy_dir_files to qmake command.
+#--------------------------------------------------------------
+isEmpty(DEPLOY_DIR) {
+    DEPLOY_DIR = $${TERRALIBPATH}/br.org.terralib
+    unix:DEPLOY_DIR = $${DEPLOY_DIR}/linux-g++
+    win32 {
+        win32-g++:DEPLOY_DIR = $${DEPLOY_DIR}/win32-g++
+        else:DEPLOY_DIR = $${DEPLOY_DIR}/win32-msvc
+    }
+}
+win32 {
+    win32-g++ {
+        IDIR = $${DESTDIR}/$${TARGET}.dll
+        ODIR = $${DEPLOY_DIR}/bin
+
+        IDIR = $$replace(IDIR, /, \)
+        ODIR = $$replace(ODIR, /, \)
+
+        mdir.commands = $(CHK_DIR_EXISTS) $${ODIR} $(MKDIR) $${ODIR}
+        dst.commands = $${QMAKE_COPY} \"$${IDIR}\" \"$${ODIR}\"
+
+        QMAKE_EXTRA_TARGETS += mdir dst
+        target.depends = mdir dst
+    }
+    else:DLLDESTDIR = $${DEPLOY_DIR}/bin
+}
+!CONFIG(copy_dir_files) {
+    headers.files = $${HEADERS}
+    headers.path = $${DEPLOY_DIR}/include
+    INSTALLS += headers
+}
+target.path = $${DEPLOY_DIR}/lib
+INSTALLS += target
diff --git a/build/qt4/libjpeg/libjpeg.pro b/build/qt4/libjpeg/libjpeg.pro
new file mode 100644
index 0000000..cc4efca
--- /dev/null
+++ b/build/qt4/libjpeg/libjpeg.pro
@@ -0,0 +1,92 @@
+TARGET = jpeg
+win32 {
+	win32-g++:CONFIG += dll
+	else:CONFIG += staticlib
+	DEFINES += _LIB
+}
+unix:CONFIG += staticlib
+include (../config.pri)
+# Path definitions
+SRCPATH = $${TERRALIBPATH}/src/libjpeg
+#-------------------------------------
+INCLUDEPATH += $${SRCPATH}
+HEADERS += $${SRCPATH}/cderror.h \
+    $${SRCPATH}/cdjpeg.h \
+    $${SRCPATH}/jchuff.h \
+    $${SRCPATH}/jconfig.h \
+    $${SRCPATH}/jdct.h \
+    $${SRCPATH}/jdhuff.h \
+    $${SRCPATH}/jerror.h \
+    $${SRCPATH}/jinclude.h \
+    $${SRCPATH}/jmemsys.h \
+    $${SRCPATH}/jmorecfg.h \
+    $${SRCPATH}/jpegint.h \
+    $${SRCPATH}/jpeglib.h \
+    $${SRCPATH}/jversion.h \
+    $${SRCPATH}/transupp.h
+SOURCES +=  $${SRCPATH}/jcapimin.c \
+	$${SRCPATH}/jcapistd.c \
+	$${SRCPATH}/jccoefct.c \
+	$${SRCPATH}/jccolor.c \
+	$${SRCPATH}/jcdctmgr.c \
+	$${SRCPATH}/jchuff.c \
+	$${SRCPATH}/jcinit.c \
+	$${SRCPATH}/jcmainct.c \
+	$${SRCPATH}/jcmarker.c \
+	$${SRCPATH}/jcmaster.c \
+	$${SRCPATH}/jcomapi.c \
+	$${SRCPATH}/jcparam.c \
+	$${SRCPATH}/jcphuff.c \
+	$${SRCPATH}/jcprepct.c \
+	$${SRCPATH}/jcsample.c \
+	$${SRCPATH}/jctrans.c \
+	$${SRCPATH}/jdapimin.c \
+	$${SRCPATH}/jdapistd.c \
+	$${SRCPATH}/jdatadst.c \
+	$${SRCPATH}/jdatasrc.c \
+	$${SRCPATH}/jdcoefct.c \
+	$${SRCPATH}/jdcolor.c \
+	$${SRCPATH}/jddctmgr.c \
+	$${SRCPATH}/jdhuff.c \
+	$${SRCPATH}/jdinput.c \
+	$${SRCPATH}/jdmainct.c \
+	$${SRCPATH}/jdmarker.c \
+	$${SRCPATH}/jdmaster.c \
+	$${SRCPATH}/jdmerge.c \
+	$${SRCPATH}/jdphuff.c \
+	$${SRCPATH}/jdpostct.c \
+	$${SRCPATH}/jdsample.c \
+	$${SRCPATH}/jdtrans.c \
+	$${SRCPATH}/jerror.c \
+	$${SRCPATH}/jfdctflt.c \
+	$${SRCPATH}/jfdctfst.c \
+	$${SRCPATH}/jfdctint.c \
+	$${SRCPATH}/jidctflt.c \
+	$${SRCPATH}/jidctfst.c \
+	$${SRCPATH}/jidctint.c \
+	$${SRCPATH}/jidctred.c \
+	$${SRCPATH}/jmemmgr.c \
+	$${SRCPATH}/jmemnobs.c \
+	$${SRCPATH}/jquant1.c \
+	$${SRCPATH}/jquant2.c \
+	$${SRCPATH}/jutils.c \
+	$${SRCPATH}/rdbmp.c \
+	$${SRCPATH}/rdcolmap.c \
+	$${SRCPATH}/rdgif.c \
+	$${SRCPATH}/rdppm.c \
+	$${SRCPATH}/rdrle.c \
+	$${SRCPATH}/rdswitch.c \
+	$${SRCPATH}/rdtarga.c \
+	$${SRCPATH}/transupp.c \
+	$${SRCPATH}/wrbmp.c \
+	$${SRCPATH}/wrgif.c \
+	$${SRCPATH}/wrppm.c \
+	$${SRCPATH}/wrrle.c \
+	$${SRCPATH}/wrtarga.c 
+include (../install_cfg.pri)
+CONFIG(copy_dir_files) {
+    JPPATH = $${TERRALIBPATH}/src/libjpeg
+    include.path = $${DEPLOY_DIR}/include/libjpeg
+    include.files = $${JPPATH}/*.h
+    INSTALLS += include
+}
diff --git a/build/qt4/libspl/libspl.pro b/build/qt4/libspl/libspl.pro
new file mode 100644
index 0000000..961a107
--- /dev/null
+++ b/build/qt4/libspl/libspl.pro
@@ -0,0 +1,39 @@
+#win32 {
+#  error( "To build LibSPL for Windows use the Visual Studio project file." )
+#}
+
+TARGET  = spl
+include (../config.pri)
+
+LIBSPLPATH = $${TERRALIBPATH}/src/libspl
+
+win32 {
+	DEFINES += _LIB \
+			SPL_MAKE_DLL
+	win32-g++:DEFINES -= UNICODE
+}
+unix:LIBS += -lpthread
+INCLUDEPATH = $${LIBSPLPATH} $${LIBSPLPATH}/include
+HEADERS = \
+  $${LIBSPLPATH}/spl.h \
+  $${LIBSPLPATH}/include/spl_pluginargs.h \
+  $${LIBSPLPATH}/include/spl_pluginserver_linux.h \
+  $${LIBSPLPATH}/include/spl_pluginserver_solaris.h \
+  $${LIBSPLPATH}/include/spl_pluginserver_win32.h \
+  $${LIBSPLPATH}/include/spl_threadlock.h \
+  $${LIBSPLPATH}/include/spl_mutex.h \
+  $${LIBSPLPATH}/include/spl_plugininfo.h \
+  $${LIBSPLPATH}/include/spl_typedefs.h \
+  $${LIBSPLPATH}/include/spl_platform.h \
+  $${LIBSPLPATH}/include/spl_pluginserver.h 
+SOURCES = \
+  $${LIBSPLPATH}/source/spl_pluginserver.cpp \
+  $${LIBSPLPATH}/source/spl_pluginserver_linux.cpp \
+  $${LIBSPLPATH}/source/spl_pluginserver_solaris.cpp \
+  $${LIBSPLPATH}/source/spl_pluginserver_win32.cpp \
+  $${LIBSPLPATH}/source/spl_pluginargs.cpp \
+  $${LIBSPLPATH}/source/spl_mutex.cpp \
+  $${LIBSPLPATH}/source/spl_threadlock.cpp \
+  $${LIBSPLPATH}/source/spl_plugininfo.cpp
+
+  include (../install_cfg.pri)
\ No newline at end of file
diff --git a/build/qt4/shapelib/shapelib.pro b/build/qt4/shapelib/shapelib.pro
new file mode 100644
index 0000000..5c16132
--- /dev/null
+++ b/build/qt4/shapelib/shapelib.pro
@@ -0,0 +1,20 @@
+TARGET  = shapelib
+CONFIG += dll
+win32:DEFINES += _USRDLL \
+    SHAPELIB_DLLEXPORT
+include (../config.pri)
+
+SHPPATH = $${TERRALIBPATH}/src/shapelib
+
+SOURCES = $${SHPPATH}/dbfopen.c \
+    	$${SHPPATH}/shpopen.c
+HEADERS = $${SHPPATH}/shapefil.h
+
+include (../install_cfg.pri)
+
+CONFIG(copy_dir_files) {
+    include.path = $${DEPLOY_DIR}/include/shapelib/include
+    include.files = $${SHPPATH}/*.h
+
+    INSTALLS += include
+}
diff --git a/build/qt4/stat/stat.pro b/build/qt4/stat/stat.pro
new file mode 100644
index 0000000..0c3851a
--- /dev/null
+++ b/build/qt4/stat/stat.pro
@@ -0,0 +1,45 @@
+CONFIG += dll 
+TARGET = stat
+
+include (../config.pri)
+
+DEFINES += STAT_AS_DLL
+
+INCLUDEPATH += $${TERRALIBPATH}/src/terralib/stat
+
+LIBS += -lterralib
+
+SOURCES	+= $${TERRALIBPATH}/src/terralib/stat/filaDouble.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/filaInt.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/filaR.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/heap.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/lista.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/TeBayesFunctions.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/TeKernelFunctions.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/TeSkaterArvore.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/TeSkaterFunctions.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/TeSkaterGrafo.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/TeStatDataStructures.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/TeSemivarModelFactory.cpp \
+	  $${TERRALIBPATH}/src/terralib/stat/TeMSVFactory.cpp 
+
+HEADERS	+= $${TERRALIBPATH}/src/terralib/stat/erro.h \
+	  $${TERRALIBPATH}/src/terralib/stat/filaDouble.h \
+	  $${TERRALIBPATH}/src/terralib/stat/filaInt.h \
+	  $${TERRALIBPATH}/src/terralib/stat/filaR.h \
+	  $${TERRALIBPATH}/src/terralib/stat/heap.h \
+	  $${TERRALIBPATH}/src/terralib/stat/lista.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeBayesFunctions.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeKernelFunctions.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeKernelParams.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeKMeansGrouping.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeSkaterArvore.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeSkaterFunctions.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeSkaterGrafo.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeSpatialStatistics.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeStatDataStructures.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeSemivarModelFactory.h \
+	  $${TERRALIBPATH}/src/terralib/stat/TeMSVFactory.h \
+          $${TERRALIBPATH}/src/terralib/stat/TeStatDefines.h 
+
+include (../install_cfg.pri)
\ No newline at end of file
diff --git a/build/qt4/te_dxf/te_dxf.pro b/build/qt4/te_dxf/te_dxf.pro
new file mode 100644
index 0000000..f3e41c5
--- /dev/null
+++ b/build/qt4/te_dxf/te_dxf.pro
@@ -0,0 +1,33 @@
+#-----------------------------------
+#Project definitions
+#-----------------------------------
+TARGET = te_dxf
+CONFIG	+= dll
+
+include (../config.pri)
+
+#Path definitions
+#----------------------------------
+INCPATH= $${TERRALIBPATH}/src/terralib/drivers/DXF
+SRCPATH = $${INCPATH}
+
+DEFINES += TEDXF_EXPORTS
+#---------------
+# Project files
+#---------------
+INCLUDEPATH	+= $${TERRALIBPATH}/src/terralib/kernel \
+                $${TERRALIBPATH}/src/dxflib \
+                $${TERRALIBPATH}/src/terralib/drivers/DXF
+HEADERS	+= $${INCPATH}/tedxfdefines.h \
+	$${INCPATH}/tedxflayer.h \
+	$${INCPATH}/tedxfvisitor.h \
+	$${INCPATH}/TeDXFDriver.h \
+	$${INCPATH}/TeDXFDriverFactory.h
+SOURCES	+= $${SRCPATH}/tedxflayer.cpp \
+	$${SRCPATH}/tedxfvisitor.cpp \
+	$${SRCPATH}/TeDXFDriver.cpp \
+	$${SRCPATH}/TeDXFDriverFactory.cpp 
+	
+LIBS += -ldxf -lterralib
+
+include (../install_cfg.pri)
diff --git a/build/qt4/te_functions/te_functions.pro b/build/qt4/te_functions/te_functions.pro
new file mode 100644
index 0000000..6d7ee56
--- /dev/null
+++ b/build/qt4/te_functions/te_functions.pro
@@ -0,0 +1,55 @@
+CONFIG += dll
+TARGET = te_functions
+
+include (../config.pri)
+
+# Path definitions
+# ----------------------------------------------------------
+FCSRCPATH = $${TERRALIBPATH}/src/terralib/functions
+# ----------------------------------------------------------
+
+
+DEFINES += TLFUNCTIONS_AS_DLL
+
+LIBS += -lterralib
+
+INCLUDEPATH += $${FCSRCPATH}
+
+HEADERS += $${FCSRCPATH}/TeFunctionsDefines.h \
+        $${FCSRCPATH}/TeCoordAlgorithms.h \
+        $${FCSRCPATH}/TeSPRFile.h \
+        $${FCSRCPATH}/TeDriverMIDMIF.h \
+        $${FCSRCPATH}/TeDriverSPRING.h \
+        $${FCSRCPATH}/TeGeoProcessingFunctions.h \
+        $${FCSRCPATH}/TeCellAlgorithms.h \
+        $${FCSRCPATH}/TeAddressLocator.h \
+        $${FCSRCPATH}/TeDriverBNA.h \
+        $${FCSRCPATH}/TeDriverCSV.h \
+        $${FCSRCPATH}/TeLayerFunctions.h \
+        $${FCSRCPATH}/TeMIFProjection.h \
+        $${FCSRCPATH}/TeThemeFunctions.h
+SOURCES += $${FCSRCPATH}/TeCoordAlgorithms.cpp \
+        $${FCSRCPATH}/TeSimilarity.cpp \
+        $${FCSRCPATH}/TeSPRFile.cpp \
+        $${FCSRCPATH}/TeExportMIF.cpp \
+        $${FCSRCPATH}/TeExportSPR.cpp \
+        $${FCSRCPATH}/TeGeoProcessingFunctions.cpp \
+        $${FCSRCPATH}/TeCellAlgorithms.cpp \
+        $${FCSRCPATH}/TeAddressLocator.cpp \
+        $${FCSRCPATH}/TeImportBNA.cpp \
+        $${FCSRCPATH}/TeImportCSV.cpp \
+        $${FCSRCPATH}/TeImportGeo.cpp \
+        $${FCSRCPATH}/TeImportMIF.cpp \
+        $${FCSRCPATH}/TeLayerFunctions.cpp \
+        $${FCSRCPATH}/TeMIFProjection.cpp \
+        $${FCSRCPATH}/TeExportCSV.cpp \
+        $${FCSRCPATH}/TeThemeFunctions.cpp
+
+include (../install_cfg.pri)
+
+CONFIG(copy_dir_files) {
+    include.path = $${DEPLOY_DIR}/include/terralib/functions
+    include.files = $${HEADERS}
+
+    INSTALLS += include
+}
diff --git a/build/qt4/te_gdal/te_gdal.pro b/build/qt4/te_gdal/te_gdal.pro
new file mode 100644
index 0000000..9befa5d
--- /dev/null
+++ b/build/qt4/te_gdal/te_gdal.pro
@@ -0,0 +1,78 @@
+#Path definitions
+#----------------------------------
+INCPATH= ../../../src/terralib/drivers/gdal
+SRCPATH = $$INCPATH
+#-----------------------------------
+#Project definitions
+#-----------------------------------
+TEMPLATE = lib
+TARGET = te_gdal
+CONFIG	+= warn_on \
+		rtti \
+		exceptions \
+		thread \
+		dll
+CONFIG -= qt
+LANGUAGE	= C++
+#------------------------------
+# Configure to debug or release
+#------------------------------
+isEmpty(TE_PROJECT_TYPE) {
+    TE_PROJECT_TYPE=RELEASE
+}
+contains(TE_PROJECT_TYPE , DEBUG) {
+    CONFIG -= release
+    CONFIG += debug
+}
+contains(TE_PROJECT_TYPE , RELEASE) {
+    CONFIG -= debug
+    CONFIG += release
+}
+
+include (../config.pri)
+
+OBJECTS_DIR = $$OBJECTS_DIR/te_gdal
+
+DEFINES += TEGDAL_EXPORTS
+#---------------
+# Project files
+#---------------
+INCLUDEPATH	+= ../../../src/terralib/kernel \
+			   ../../../src/terralib/utils \
+			   ../../../src/terralib/drivers/gdal \
+			   ../../../../thirdparty/gdal-1.7.2/gcore \
+			   ../../../../thirdparty/gdal-1.7.2/port \
+			   ../../../../thirdparty/gdal-1.7.2/ogr \
+			   ../../../../thirdparty/gdal-1.7.2/ogr/ogrsf_frmts
+			   
+HEADERS	+= $$INCPATH/TeOGRDriver.h \
+		   $$INCPATH/TeOGRDriverFactory.h \
+		   $$INCPATH/TeOGRUtils.h \
+		   $$INCPATH/TeGDALDefines.h \
+		   $$INCPATH/TeGDALUtils.h \
+		   $$INCPATH/TeGDALDecoder.h
+		   
+SOURCES	+= $$SRCPATH/TeOGRDriver.cpp \
+		   $$SRCPATH/TeOGRDriverFactory.cpp \
+		   $$INCPATH/TeOGRUtils.cpp \
+		   $$INCPATH/TeGDALUtils.cpp \
+		   $$INCPATH/TeGDALDecoder.cpp
+unix {
+	debug:LIBS += -L../../Debug 
+	release:LIBS += -L../../Release 
+}
+win32 {
+	!win32-g++ {
+		debug:QMAKE_LIBDIR += ../../../../thirdparty/gdal-1.7.2 \
+							  ../../../Debug/terralib \
+							  ../../../Debug/te_utils
+		release:QMAKE_LIBDIR += ../../../../thirdparty/gdal-1.7.2 \
+								../../../Release/terralib \
+								../../../Release/te_utils
+	}
+	else {
+		debug:LIBS += -L../../Debug
+		release:LIBS += -L../../Release
+	}			
+}
+LIBS += -lgdal_i -lterralib -lte_utils
\ No newline at end of file
diff --git a/build/qt4/te_shapelib/te_shapelib.pro b/build/qt4/te_shapelib/te_shapelib.pro
new file mode 100644
index 0000000..49e0d2d
--- /dev/null
+++ b/build/qt4/te_shapelib/te_shapelib.pro
@@ -0,0 +1,32 @@
+CONFIG += dll
+TARGET = te_shapelib
+
+include (../config.pri)
+
+# Path definitions
+# ----------------------------------------------------------
+SHPSRCPATH = $${TERRALIBPATH}/src/terralib/drivers/shapelib
+# ----------------------------------------------------------
+
+DEFINES += TLSHP_AS_DLL
+
+LIBS += -lshapelib -lterralib 
+
+INCLUDEPATH += $${SHPSRCPATH}  \
+	      $${TERRALIBPATH}/src/shapelib
+
+HEADERS += $${SHPSRCPATH}/TeDriverSHPDBF.h \
+        $${SHPSRCPATH}/TeSHPDriverFactory.h \
+        $${SHPSRCPATH}/TeSHPDefines.h
+SOURCES += $${SHPSRCPATH}/TeDriverSHPDBF.cpp \
+        $${SHPSRCPATH}/TeSHPDriverFactory.cpp
+	
+include (../install_cfg.pri)	
+
+CONFIG(copy_dir_files)
+{
+    include.path = $${DEPLOY_DIR}/include/shapelib
+    include.files = $${HEADERS}
+
+    INSTALLS += include
+}
diff --git a/build/qt4/te_spl/te_spl.pro b/build/qt4/te_spl/te_spl.pro
new file mode 100644
index 0000000..5c6993f
--- /dev/null
+++ b/build/qt4/te_spl/te_spl.pro
@@ -0,0 +1,34 @@
+CONFIG += dll
+TARGET = te_spl
+include (../config.pri)
+DEFINES += TLSPL_AS_DLL
+
+CONFIG += qt
+
+TESPLSRC = $${TERRALIBPATH}/src/terralib/drivers/spl
+
+INCLUDEPATH += $${TESPLSRC} \
+			$${TERRALIBPATH}/src/libspl 
+
+unix:LIBS += -lspl
+win32 {
+	win32-g++:LIBS += -lspl
+	else {
+		LIBS += -llibspl
+	}
+}
+LIBS += -lterralib
+HEADERS += $${TESPLSRC}/TeSPLDefines.h \
+		$${TESPLSRC}/PluginInfo.h \
+		$${TESPLSRC}/PluginMetadata.h \
+		$${TESPLSRC}/PluginParameters.h \
+		$${TESPLSRC}/PluginsManager.h \
+		$${TESPLSRC}/PluginsParametersContainer.h \
+		$${TESPLSRC}/PluginsSignal.h
+
+SOURCES += $${TESPLSRC}/PluginMetadata.cpp \
+		$${TESPLSRC}/PluginParameters.cpp \
+		$${TESPLSRC}/PluginsManager.cpp \
+		$${TESPLSRC}/PluginsSignal.cpp
+
+include (../install_cfg.pri)		
\ No newline at end of file
diff --git a/build/qt4/te_utils/te_utils.pro b/build/qt4/te_utils/te_utils.pro
new file mode 100644
index 0000000..fb2e507
--- /dev/null
+++ b/build/qt4/te_utils/te_utils.pro
@@ -0,0 +1,40 @@
+CONFIG += dll
+TARGET = te_utils
+
+include (../config.pri)
+
+# Path definitions
+# ----------------------------------------------------------
+UTSRCPATH = $${TERRALIBPATH}/src/terralib/utils
+# ----------------------------------------------------------
+
+DEFINES += TLUTILS_AS_DLL
+
+LIBS += -lterralib -lte_functions 
+win32-g++:LIBS += -lws2_32
+
+INCLUDEPATH += $${UTSRCPATH} \
+	      $${TERRALIBPATH}/src/terralib/functions
+
+HEADERS += $${UTSRCPATH}/TeUtilsDefines.h \
+        $${UTSRCPATH}/TeColorUtils.h \
+        $${UTSRCPATH}/TeDatabaseUtils.h \
+        $${UTSRCPATH}/mtrand.h \
+        $${UTSRCPATH}/TeUpdateDBVersion.h \
+        $${UTSRCPATH}/TeWKBGeometryDecoder.h \
+        $${UTSRCPATH}/TeWKTGeometryDecoder.h
+SOURCES += $${UTSRCPATH}/TeColorUtils.cpp \
+        $${UTSRCPATH}/TeDatabaseUtils.cpp \
+        $${UTSRCPATH}/mtrand.cpp \
+        $${UTSRCPATH}/TeUpdateDBVersion.cpp \
+        $${UTSRCPATH}/TeWKBGeometryDecoder.cpp \
+        $${UTSRCPATH}/TeWKTGeometryDecoder.cpp
+
+include (../install_cfg.pri)
+
+CONFIG(copy_dir_files) {
+    include.path = $${DEPLOY_DIR}/include/terralib/utils
+    include.files = $${HEADERS}
+
+    INSTALLS += include
+}
diff --git a/build/qt4/terralib.pro b/build/qt4/terralib.pro
new file mode 100644
index 0000000..4b59473
--- /dev/null
+++ b/build/qt4/terralib.pro
@@ -0,0 +1,35 @@
+#-------------------------------------------
+# To configure compilation, you can select values for TEDRIVERS variable. TEDRIVERS = ALLDRIVERS compile full terralib drivers.
+# Other values are HAS_FIREBIRD, HAS_MYSQL, HAS_ORACLE, HAS_POSTGRESQL, HAS_QWT, HAS_SHP, HAS_SPL, HAS_PDI.
+# To customize drivers you can use for example: TEDRIVERS="HAS_ORACLE HAS_QWT ..." 
+#-------------------------------------------
+TEMPLATE = subdirs
+CONFIG += ordered
+SUBDIRS = ./libjpeg \
+        ./shapelib \
+        ./tiff \
+        ./terralib \
+        ./te_functions \
+        ./te_utils
+contains(TEDRIVERS, ALLDRIVERS) {
+	SUBDIRS += ./Firebird \
+            ./MySQL \
+            ./Oracle \
+            ./PostgreSQL \
+            ./te_shapelib \
+            ./libspl \
+            ./te_spl \
+            ./dxflib \
+            ./te_dxf
+}
+else {
+    contains(TEDRIVERS, HAS_PDI):SUBDIRS += ./image_processing
+    contains(TEDRIVERS, HAS_FIREBIRD):SUBDIRS += ./Firebird
+    contains(TEDRIVERS, HAS_MYSQL):SUBDIRS += ./MySQL
+    contains(TEDRIVERS, HAS_ORACLE):SUBDIRS += ./Oracle
+    contains(TEDRIVERS, HAS_POSTGRESQL):SUBDIRS += ./PostgreSQL
+    contains(TEDRIVERS, HAS_QWT):SUBDIRS += ./qwt ./te_qwt
+    contains(TEDRIVERS, HAS_SHP):SUBDIRS += ./te_shapelib
+    contains(TEDRIVERS, HAS_SPL):SUBDIRS += ./libspl ./te_spl
+    contains(TEDRIVERS, HAS_DXF):SUBDIRS += ./dxflib ./te_dxf
+}
diff --git a/build/qt4/terralib/br.org.terralib.pro b/build/qt4/terralib/br.org.terralib.pro
new file mode 100644
index 0000000..d78880b
--- /dev/null
+++ b/build/qt4/terralib/br.org.terralib.pro
@@ -0,0 +1,23 @@
+#------------------------------------------------
+# General
+#------------------------------------------------
+EXTENSION_ID = br.org.terralib
+EXTENSION_VERSION = 3.6.1
+include(../extension.pri)
+#------------------------------------------------
+# Specific Settings
+#------------------------------------------------
+QT -= core gui
+
+QMAKE_POST_LINK = $$collectGarbage(org)
+#------------------------------------------------
+# Extensions
+#------------------------------------------------
+
+unix {
+    make_links.commands = cd lib && ln -sf libclntsh.so.10.1 libclntsh.so \
+                    && ln -sf libicudata.so.30 libicudata.so && ln -sf libicui18n.so.30 libicui18n.so \
+					&& ln -sf libicuuc.so.30 libicuuc.so
+	QMAKE_EXTRA_UNIX_TARGETS += make_links
+	POST_TARGETDEPS += make_links
+}
diff --git a/build/qt4/terralib/extension.xml b/build/qt4/terralib/extension.xml
new file mode 100644
index 0000000..2b23e6c
--- /dev/null
+++ b/build/qt4/terralib/extension.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extension xmlns="urn:br:mil:eb:cortex"
+	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	   xsi:schemaLocation="urn:br:mil:eb:cortex ../platform.xsd">
+
+	<info id="br.org.terralib" version="3.6.1">
+
+		<title>
+			TerraLib
+		</title>
+
+		<description>
+			TerraLib is a c++ software library for manage spatial data. It supports Firebird, MySQL, Oracle and PostgreSQL databases.
+		</description>
+
+	</info>
+
+	<fileName os="win32">libeay32</fileName>
+	<fileName os="win32">libiconv-2</fileName>
+	<fileName os="win32">libintl-2</fileName>
+	<fileName os="win32">ssleay32</fileName>
+	<fileName os="win32">zlib</fileName>
+	<fileName os="win32">zlib1</fileName>
+	<fileName os="win32">libmysql</fileName>
+	<fileName os="win32">libpq</fileName>
+	<fileName os="win32">oci</fileName>
+	<fileName os="unix">icudata</fileName>
+	<fileName os="unix">icuuc</fileName>
+	<fileName os="unix">icui18n</fileName>
+	<fileName os="unix">fbembed</fileName>
+<!--	<fileName os="unix">clntsh</fileName>
+	<fileName os="unix">ociei</fileName> 
+	<fileName os="unix">nnz10</fileName> -->
+	<fileName>shapelib</fileName>
+	<fileName>jpeg</fileName>
+	<fileName>terralibtiff</fileName>
+	<fileName>terralib</fileName>
+	<fileName>te_firebird</fileName>
+	<fileName>te_mysql</fileName>
+	<fileName>te_oracle</fileName>
+	<fileName>te_postgresql</fileName>
+	<fileName>te_functions</fileName>
+	<fileName>te_utils</fileName>
+	<fileName>te_shapelib</fileName>
+</extension>
diff --git a/build/qt4/terralib/terralib.pro b/build/qt4/terralib/terralib.pro
new file mode 100644
index 0000000..4e6c625
--- /dev/null
+++ b/build/qt4/terralib/terralib.pro
@@ -0,0 +1,285 @@
+TARGET  = terralib
+CONFIG += dll
+include (../config.pri)
+# Path definitions
+# ----------------------------------------------------------
+TESRCPATH = $${TERRALIBPATH}/src/terralib
+TEKERNELPATH = $${TESRCPATH}/kernel
+TEDEP = $${TERRALIBPATH}/dependencies/win32/zlib
+# ----------------------------------------------------------
+
+DEFINES += _USRDLL TL_AS_DLL
+win32 {
+    win32-g++:LIBS += -L$${TEDEP}/lib
+    else:QMAKE_LIBDIR += $${TEDEP}/lib
+    LIBS += -lzlibdll
+}
+unix:LIBS += -lpthread -lz
+LIBS += -ljpeg -lterralibtiff
+INCLUDEPATH	= $${TEKERNELPATH} \
+        $${TESRCPATH}/functions \
+        $${TESRCPATH}/utils \
+	$${TERRALIBPATH}/src/tiff \
+	$${TERRALIBPATH}/src/zlib \
+        $${TESRCPATH}/drivers/libjpeg \
+	$${TERRALIBPATH}/src/libjpeg
+HEADERS	+= $${TEKERNELPATH}/checkvec.h \
+        $${TEKERNELPATH}/dynpq.h \
+        $${TEKERNELPATH}/Gra_algo.h \
+        $${TEKERNELPATH}/graph.h \
+        $${TEKERNELPATH}/TeAbstractFactory.h \
+        $${TEKERNELPATH}/TeAbstractTheme.h \
+        $${TEKERNELPATH}/TeAffineGT.h \
+        $${TEKERNELPATH}/TeAffineGTFactory.h \
+        $${TEKERNELPATH}/TeAgnostic.h \
+        $${TEKERNELPATH}/TeAsciiFile.h \
+        $${TEKERNELPATH}/TeAttribute.h \
+        $${TEKERNELPATH}/TeBox.h \
+        $${TEKERNELPATH}/TeBufferRegion.h \
+        $${TEKERNELPATH}/TeComposite.h \
+        $${TEKERNELPATH}/TeCommunicator.h \
+        $${TEKERNELPATH}/TeComputeAttributeStrategies.h \
+        $${TEKERNELPATH}/TeCoord2D.h \
+        $${TEKERNELPATH}/TeCounted.h \
+        $${TEKERNELPATH}/TeDatabase.h \
+        $${TEKERNELPATH}/TeDatabaseFactory.h \
+        $${TEKERNELPATH}/TeDataTypes.h \
+        $${TEKERNELPATH}/TeDatum.h \
+        $${TEKERNELPATH}/TeDBConnectionsPool.h \
+        $${TEKERNELPATH}/TeDecoder.h \
+        $${TEKERNELPATH}/TeDecoderASCIIGrid.h \
+        $${TEKERNELPATH}/TeDecoderDatabase.h \
+        $${TEKERNELPATH}/TeDecoderFile.h \
+        $${TEKERNELPATH}/TeDecoderJPEG.h \
+        $${TEKERNELPATH}/TeDecoderMemory.h \
+        $${TEKERNELPATH}/TeDecoderMemoryMap.h \
+        $${TEKERNELPATH}/TeDecoderSPR.h \
+        $${TEKERNELPATH}/TeDecoderTIFF.h \
+        $${TEKERNELPATH}/TeDecoderVirtualMemory.h \
+        $${TEKERNELPATH}/TeDecoderSmartMem.h \
+        $${TEKERNELPATH}/TeDefines.h \
+        $${TEKERNELPATH}/TeErrorLog.h \
+        $${TEKERNELPATH}/TeErrorMessage.h \
+        $${TEKERNELPATH}/TeException.h \
+        $${TEKERNELPATH}/TeExternalTheme.h \
+        $${TEKERNELPATH}/TeFactory.h \
+        $${TEKERNELPATH}/TeFragmentation.h \
+        $${TEKERNELPATH}/TeFileTheme.h \
+        $${TEKERNELPATH}/TeGeneralizedProxMatrix.h \
+        $${TEKERNELPATH}/TeGDriverFactory.h \
+        $${TEKERNELPATH}/TeGeoDataDriver.h \
+        $${TEKERNELPATH}/TeGeometricTransformation.h \
+        $${TEKERNELPATH}/TeGeometry.h \
+        $${TEKERNELPATH}/TeGeometryAlgorithms.h \
+        $${TEKERNELPATH}/TeGTParams.h \
+        $${TEKERNELPATH}/TeGTFactory.h \
+        $${TEKERNELPATH}/TeGroupingAlgorithms.h \
+        $${TEKERNELPATH}/TeImportRaster.h \
+        $${TEKERNELPATH}/TeIntersector.h \
+        $${TEKERNELPATH}/TeLayer.h \
+        $${TEKERNELPATH}/TeLegendEntry.h \
+        $${TEKERNELPATH}/TeMatrix.h \
+        $${TEKERNELPATH}/TeMeasure.h \
+        $${TEKERNELPATH}/TeMetaModelCache.h \
+        $${TEKERNELPATH}/TeMultiGeometry.h \
+        $${TEKERNELPATH}/TeNeighbours.h \
+        $${TEKERNELPATH}/TeNetwork.h \
+        $${TEKERNELPATH}/TeOverlay.h \
+        $${TEKERNELPATH}/TeOverlayUtils.h \
+        $${TEKERNELPATH}/TePrecision.h \
+        $${TEKERNELPATH}/TeProgress.h \
+        $${TEKERNELPATH}/TeProgressBase.h \
+        $${TEKERNELPATH}/TeProject.h \
+        $${TEKERNELPATH}/TeProjection.h \
+        $${TEKERNELPATH}/TeProjectiveGT.h \
+        $${TEKERNELPATH}/TeProjectiveGTFactory.h \
+        $${TEKERNELPATH}/TePrototype.h \
+        $${TEKERNELPATH}/TeProxMatrixConstructionStrategy.h \
+        $${TEKERNELPATH}/TeProxMatrixImplementation.h \
+        $${TEKERNELPATH}/TeProxMatrixSlicingStrategy.h \
+        $${TEKERNELPATH}/TeProxMatrixWeightsStrategy.h \
+        $${TEKERNELPATH}/TeQuerier.h\
+        $${TEKERNELPATH}/TeQuerierDB.h\
+        $${TEKERNELPATH}/TeQuerierDBStr1.h\
+        $${TEKERNELPATH}/TeQuerierDBStr2.h\
+        $${TEKERNELPATH}/TeQuerierDBStr3.h \
+        $${TEKERNELPATH}/TeQuerierImpl.h\
+        $${TEKERNELPATH}/TeQuerierParams.h\
+        $${TEKERNELPATH}/TeRaster.h \
+        $${TEKERNELPATH}/TeRasterParams.h \
+        $${TEKERNELPATH}/TeRasterRemap.h \
+        $${TEKERNELPATH}/TeRasterTransform.h \
+        $${TEKERNELPATH}/TeRedBlackTree.h \
+        $${TEKERNELPATH}/TeRepresentation.h \
+        $${TEKERNELPATH}/TeSharedPtr.h \
+        $${TEKERNELPATH}/TeSingleton.h \
+        $${TEKERNELPATH}/TeSlice.h \
+        $${TEKERNELPATH}/TeSpatialOperations.h \
+        $${TEKERNELPATH}/TeStatistics.h \
+        $${TEKERNELPATH}/TeStdFile.h \
+        $${TEKERNELPATH}/TeSTEFunctionsDB.h \
+        $${TEKERNELPATH}/TeBaseSTInstance.h \
+        $${TEKERNELPATH}/TeBaseSTInstanceSet.h \
+        $${TEKERNELPATH}/TeRTree.h \
+        $${TEKERNELPATH}/TeSTElementSet.h \
+        $${TEKERNELPATH}/TeSTEvent.h \
+        $${TEKERNELPATH}/TeSTInstance.h\
+        $${TEKERNELPATH}/TeTable.h \
+        $${TEKERNELPATH}/TeTemporalSeries.h \
+        $${TEKERNELPATH}/TeTheme.h \
+        $${TEKERNELPATH}/TeTime.h \
+        $${TEKERNELPATH}/TeTimeInterval.h \
+        $${TEKERNELPATH}/TeTin.h \
+        $${TEKERNELPATH}/TeUtils.h \
+        $${TEKERNELPATH}/TeVectorRemap.h \
+        $${TEKERNELPATH}/TeView.h \
+        $${TEKERNELPATH}/TeViewNode.h \
+        $${TEKERNELPATH}/TeVisual.h \
+        $${TEKERNELPATH}/yyTemporal.h \
+        $${TEKERNELPATH}/TeRasterMemManager.h \
+        $${TEKERNELPATH}/TeMutex.h \
+        $${TEKERNELPATH}/TeThreadParameters.h \
+        $${TEKERNELPATH}/TeThread.h \
+        $${TEKERNELPATH}/TeThreadFunctor.h \
+        $${TEKERNELPATH}/TeThreadSignal.h \
+        $${TEKERNELPATH}/TeDatabaseFactoryParams.h \
+        $${TEKERNELPATH}/TeMappedMemory.h \
+        $${TESRCPATH}/drivers/libjpeg/TeLibJpegWrapper.h \
+        $${TESRCPATH}/drivers/libjpeg/jmemdstsrc.h \
+        $${TEKERNELPATH}/TeMultiContainer.h \
+        $${TEKERNELPATH}/TeStdIOProgress.h \
+        $${TEKERNELPATH}/TeThreadJobsManager.h \
+        $${TEKERNELPATH}/TeThreadJob.h \
+        $${TEKERNELPATH}/TeFunctionCallThreadJob.h \
+        $${TEKERNELPATH}/TeTempFilesRemover.h \
+        $${TEKERNELPATH}/TeSemaphore.h \
+        $${TEKERNELPATH}/TePolygonSetProperties.h \
+        $${TEKERNELPATH}/Te2ndDegPolinomialGT.h \
+        $${TEKERNELPATH}/Te2ndDegPolinomialGTFactory.h \
+        $${TEKERNELPATH}/TeDatabaseIndex.h
+SOURCES	+= $${TEKERNELPATH}/lexTemporal.cpp \
+    $${TEKERNELPATH}/TeAbstractTheme.cpp \
+    $${TEKERNELPATH}/TeAffineGT.cpp \
+    $${TEKERNELPATH}/TeAffineGTFactory.cpp \
+    $${TEKERNELPATH}/TeAgnostic.cpp \
+    $${TEKERNELPATH}/TeAsciiFile.cpp \
+    $${TEKERNELPATH}/TeBox.cpp \
+    $${TEKERNELPATH}/TeBufferRegion.cpp \
+    $${TEKERNELPATH}/TeCentroid.cpp \
+    $${TEKERNELPATH}/TeComputeAttributeStrategies.cpp \
+    $${TEKERNELPATH}/TeDatabase.cpp \
+    $${TEKERNELPATH}/TeDatabaseFactory.cpp \
+    $${TEKERNELPATH}/TeDatum.cpp \
+    $${TEKERNELPATH}/TeDBConnectionsPool.cpp \
+    $${TEKERNELPATH}/TeDecoderASCIIGrid.cpp \
+    $${TEKERNELPATH}/TeDecoderDatabase.cpp \
+    $${TEKERNELPATH}/TeDecoderFile.cpp \
+    $${TEKERNELPATH}/TeDecoderJPEG.cpp \
+    $${TEKERNELPATH}/TeDecoderMemory.cpp \
+    $${TEKERNELPATH}/TeDecoderMemoryMap.cpp \
+    $${TEKERNELPATH}/TeDecoderSPR.cpp \
+    $${TEKERNELPATH}/TeDecoderTIFF.cpp \
+    $${TEKERNELPATH}/TeDecoderVirtualMemory.cpp \
+    $${TEKERNELPATH}/TeDecoderSmartMem.cpp \
+    $${TEKERNELPATH}/TeErrorLog.cpp \
+    $${TEKERNELPATH}/TeErrorMessage.cpp \
+    $${TEKERNELPATH}/TeException.cpp \
+    $${TEKERNELPATH}/TeExternalTheme.cpp \
+    $${TEKERNELPATH}/TeFragmentation.cpp \
+    $${TEKERNELPATH}/TeFileTheme.cpp \
+    $${TEKERNELPATH}/TeGDriverFactory.cpp \
+    $${TEKERNELPATH}/TeGeometricTransformation.cpp \
+    $${TEKERNELPATH}/TeGeometry.cpp \
+    $${TEKERNELPATH}/TeGeometryAlgorithms.cpp \
+    $${TEKERNELPATH}/TeGTParams.cpp \
+    $${TEKERNELPATH}/TeGTFactory.cpp \
+    $${TEKERNELPATH}/TeGroupingAlgorithms.cpp \
+    $${TEKERNELPATH}/TeImportRaster.cpp \
+    $${TEKERNELPATH}/TeInitRasterDecoders.cpp \
+    $${TEKERNELPATH}/TeIntersector.cpp \
+    $${TEKERNELPATH}/TeLayer.cpp \
+    $${TEKERNELPATH}/TeLegendEntry.cpp \
+    $${TEKERNELPATH}/TeMatrix.cpp \
+    $${TEKERNELPATH}/TeMetaModelCache.cpp \
+    $${TEKERNELPATH}/TeMultiGeometry.cpp \
+    $${TEKERNELPATH}/TeNeighbours.cpp \
+    $${TEKERNELPATH}/TeNetwork.cpp \
+    $${TEKERNELPATH}/TeOverlay.cpp \
+    $${TEKERNELPATH}/TeOverlayUtils.cpp \
+    $${TEKERNELPATH}/TeProgress.cpp \
+    $${TEKERNELPATH}/TeProject.cpp \
+    $${TEKERNELPATH}/TeProjection.cpp \
+    $${TEKERNELPATH}/TeProjectiveGT.cpp \
+    $${TEKERNELPATH}/TeProjectiveGTFactory.cpp \
+    $${TEKERNELPATH}/TeProxMatrixConstructionStrategy.cpp \
+    $${TEKERNELPATH}/TeProxMatrixImplementation.cpp \
+    $${TEKERNELPATH}/TeProxMatrixStrategies.cpp \
+    $${TEKERNELPATH}/TeQuerier.cpp \
+    $${TEKERNELPATH}/TeQuerierDB.cpp \
+    $${TEKERNELPATH}/TeQuerierDBStr1.cpp \
+    $${TEKERNELPATH}/TeQuerierDBStr2.cpp \
+    $${TEKERNELPATH}/TeQuerierDBStr3.cpp \
+    $${TEKERNELPATH}/TeQuerierImpl.cpp \
+    $${TEKERNELPATH}/TeQuerierParams.cpp \
+    $${TEKERNELPATH}/TeRaster.cpp \
+    $${TEKERNELPATH}/TeRasterParams.cpp \
+    $${TEKERNELPATH}/TeRasterRemap.cpp \
+    $${TEKERNELPATH}/TeRasterTransform.cpp \
+    $${TEKERNELPATH}/TeRepresentation.cpp \
+    $${TEKERNELPATH}/TeSpatialOperations.cpp \
+    $${TEKERNELPATH}/TeStdFile.cpp \
+    $${TEKERNELPATH}/TeSTElementSet.cpp \
+    $${TEKERNELPATH}/TeSTEvent.cpp \
+    $${TEKERNELPATH}/TeSTInstance.cpp \
+    $${TEKERNELPATH}/TeTable.cpp \
+    $${TEKERNELPATH}/TeTemporalSeries.cpp \
+    $${TEKERNELPATH}/TeTheme.cpp \
+    $${TEKERNELPATH}/TeTime.cpp \
+    $${TEKERNELPATH}/TeTimeInterval.cpp \
+    $${TEKERNELPATH}/TeTin.cpp \
+    $${TEKERNELPATH}/TeUtils.cpp \
+    $${TEKERNELPATH}/TeVectorRemap.cpp \
+    $${TEKERNELPATH}/TeViewNode.cpp \
+    $${TEKERNELPATH}/TeVisual.cpp \
+    $${TEKERNELPATH}/yyTemporal.cpp \
+    $${TEKERNELPATH}/TeDatabaseFactoryParams.cpp \
+    $${TEKERNELPATH}/TeMappedMemory.cpp \
+    $${TEKERNELPATH}/TeRasterMemManager.cpp \
+    $${TEKERNELPATH}/TeMutex.cpp \
+    $${TEKERNELPATH}/TeThread.cpp \
+    $${TEKERNELPATH}/TeThreadFunctor.cpp \
+    $${TEKERNELPATH}/TeThreadSignal.cpp \
+    $${TESRCPATH}/drivers/libjpeg/TeLibJpegWrapper.cpp \
+    $${TESRCPATH}/drivers/libjpeg/jmemdst.c \
+    $${TESRCPATH}/drivers/libjpeg/jmemsrc.c \
+    $${TEKERNELPATH}/TeStdIOProgress.cpp \
+    $${TEKERNELPATH}/TeThreadJobsManager.cpp \
+    $${TEKERNELPATH}/TeThreadJob.cpp \
+    $${TEKERNELPATH}/TeFunctionCallThreadJob.cpp \
+    $${TEKERNELPATH}/TeTempFilesRemover.cpp \
+    $${TEKERNELPATH}/TeSemaphore.cpp \
+    $${TEKERNELPATH}/TePolygonSetProperties.cpp \
+    $${TEKERNELPATH}/Te2ndDegPolinomialGT.cpp \
+    $${TEKERNELPATH}/Te2ndDegPolinomialGTFactory.cpp \
+    $${TEKERNELPATH}/TeDatabaseIndex.cpp
+
+include (../install_cfg.pri)
+
+CONFIG(copy_dir_files) {
+    include.path = $${DEPLOY_DIR}/include/terralib
+    include.files = $${HEADERS}
+
+    INSTALLS += include
+}
+
+win32 {
+    bin.path = $${DEPLOY_DIR}/bin
+    bin.files = $${TEDEP}/bin/*.dll
+
+    INSTALLS += bin
+}
+
+prj.files = ./br.org.terralib.pro ./extension.xml
+prj.path = $${DEPLOY_DIR}
+
+INSTALLS += prj      
diff --git a/build/qt4/tiff/tiff.pro b/build/qt4/tiff/tiff.pro
new file mode 100644
index 0000000..f8bbb62
--- /dev/null
+++ b/build/qt4/tiff/tiff.pro
@@ -0,0 +1,107 @@
+TARGET  = terralibtiff
+CONFIG += dll 
+win32:DEFINES += WIN32 \
+    _WINDOWS \
+    _USRDLL \
+    _BUILD_AS_DLL
+include (../config.pri)
+
+TIFFPATH = $${TERRALIBPATH}/src/tiff
+win32 {
+	win32-g++:LIBS += -L$${TERRALIBPATH}/dependencies/win32/zlib/lib
+	else:QMAKE_LIBDIR += $${TERRALIBPATH}/dependencies/win32/zlib/lib
+	
+	LIBS += -lzlibdll
+}
+unix:LIBS += -lz
+LIBS += -ljpeg
+
+INCLUDEPATH	+= $${TERRALIBPATH}/src/libjpeg \
+		   $${TERRALIBPATH}/src/zlib
+HEADERS += $${TIFFPATH}/cpl_csv.h \
+    $${TIFFPATH}/cpl_serv.h \
+    $${TIFFPATH}/geo_config.h \
+    $${TIFFPATH}/geo_keyp.h \
+    $${TIFFPATH}/geo_normalize.h \
+    $${TIFFPATH}/geo_tiffp.h \
+    $${TIFFPATH}/geokeys.h \
+    $${TIFFPATH}/geonames.h \
+    $${TIFFPATH}/geotiff.h \
+    $${TIFFPATH}/geotiffio.h \
+    $${TIFFPATH}/geovalues.h \
+    $${TIFFPATH}/port.h \
+    $${TIFFPATH}/t4.h \
+    $${TIFFPATH}/tif_config.h \
+    $${TIFFPATH}/tif_dir.h \
+    $${TIFFPATH}/tif_fax3.h \
+    $${TIFFPATH}/tif_predict.h \
+    $${TIFFPATH}/tiff.h \
+    $${TIFFPATH}/tiffcomp.h \
+    $${TIFFPATH}/tiffconf.h \
+    $${TIFFPATH}/tiffio.h \
+    $${TIFFPATH}/tiffiop.h \
+    $${TIFFPATH}/tiffvers.h \
+    $${TIFFPATH}/uvcode.h \
+    $${TIFFPATH}/xtiffio.h \
+    $${TIFFPATH}/xtiffiop.h
+SOURCES += $${TIFFPATH}/cpl_csv.c \
+    $${TIFFPATH}/cpl_serv.c \
+    $${TIFFPATH}/geo_extra.c \
+    $${TIFFPATH}/geo_free.c \
+    $${TIFFPATH}/geo_get.c \
+    $${TIFFPATH}/geo_names.c \
+    $${TIFFPATH}/geo_new.c \
+    $${TIFFPATH}/geo_normalize.c \
+    $${TIFFPATH}/geo_print.c \
+    $${TIFFPATH}/geo_set.c \
+    $${TIFFPATH}/geo_tiffp.c \
+    $${TIFFPATH}/geo_trans.c \
+    $${TIFFPATH}/geo_write.c \
+    $${TIFFPATH}/geotiff_proj4.c \
+    $${TIFFPATH}/tif_aux.c \
+    $${TIFFPATH}/tif_close.c \
+    $${TIFFPATH}/tif_codec.c \
+    $${TIFFPATH}/tif_color.c \
+    $${TIFFPATH}/tif_compress.c \
+    $${TIFFPATH}/tif_dir.c \
+    $${TIFFPATH}/tif_dirinfo.c \
+    $${TIFFPATH}/tif_dirread.c \
+    $${TIFFPATH}/tif_dirwrite.c \
+    $${TIFFPATH}/tif_dumpmode.c \
+    $${TIFFPATH}/tif_error.c \
+    $${TIFFPATH}/tif_extension.c \
+    $${TIFFPATH}/tif_fax3.c \
+    $${TIFFPATH}/tif_fax3sm.c \
+    $${TIFFPATH}/tif_flush.c \
+    $${TIFFPATH}/tif_getimage.c \
+    $${TIFFPATH}/tif_jpeg.c \
+    $${TIFFPATH}/tif_luv.c \
+    $${TIFFPATH}/tif_lzw.c \
+    $${TIFFPATH}/tif_machdep.c \
+    $${TIFFPATH}/tif_next.c \
+    $${TIFFPATH}/tif_open.c \
+    $${TIFFPATH}/tif_packbits.c \
+    $${TIFFPATH}/tif_pixarlog.c \
+    $${TIFFPATH}/tif_predict.c \
+    $${TIFFPATH}/tif_print.c \
+    $${TIFFPATH}/tif_read.c \
+    $${TIFFPATH}/tif_strip.c \
+    $${TIFFPATH}/tif_swab.c \
+    $${TIFFPATH}/tif_thunder.c \
+    $${TIFFPATH}/tif_tile.c \
+    $${TIFFPATH}/tif_version.c \
+    $${TIFFPATH}/tif_warning.c \
+    $${TIFFPATH}/tif_write.c \
+    $${TIFFPATH}/tif_zip.c \
+    $${TIFFPATH}/xtiff.c
+win32:SOURCES += $${TIFFPATH}/tif_win32.c 
+unix:SOURCES += $${TIFFPATH}/tif_unix.c
+
+include (../install_cfg.pri)
+
+CONFIG(copy_dir_files) {
+    include.path = $${DEPLOY_DIR}/include/tiff
+    include.files = $${HEADERS}
+
+    INSTALLS += include
+}
diff --git a/build/win32-msvc2003/dxf/dxf.vcproj b/build/win32-msvc2003/dxf/dxf.vcproj
new file mode 100644
index 0000000..c70813f
--- /dev/null
+++ b/build/win32-msvc2003/dxf/dxf.vcproj
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="dxf"
+	ProjectGUID="{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\dxflib"
+			IntermediateDirectory="..\..\..\Debug\dxflib"
+			ConfigurationType="4"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories="..\..\..\src\dxflib"
+				PreprocessorDefinitions="UNICODE,WIN32,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\..\..\Debug\dxflib\dxf.lib"
+				SuppressStartupBanner="TRUE"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\dxflib"
+			IntermediateDirectory="..\..\..\Release\dxflib"
+			ConfigurationType="4"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="1"
+				AdditionalIncludeDirectories="..\..\..\src\dxflib"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,UNICODE,WIN32,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\..\..\Release\dxflib\dxf.lib"
+				SuppressStartupBanner="TRUE"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_dxf.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_writer_ascii.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_attributes.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_codes.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_creationadapter.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_creationinterface.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_dxf.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_entities.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_exception.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_extrusion.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_writer.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_writer_ascii.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/libjpeg/libjpeg.vcproj b/build/win32-msvc2003/libjpeg/libjpeg.vcproj
new file mode 100644
index 0000000..40a94ae
--- /dev/null
+++ b/build/win32-msvc2003/libjpeg/libjpeg.vcproj
@@ -0,0 +1,352 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="libjpeg"
+	ProjectGUID="{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\libjpeg"
+			IntermediateDirectory="..\..\..\Debug\libjpeg"
+			ConfigurationType="4"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\libjpeg"
+				PreprocessorDefinitions="WIN32;_DEBUG;UNICODE;_LIB"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName).lib"
+				SuppressStartupBanner="TRUE"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\libjpeg"
+			IntermediateDirectory="..\..\..\Release\libjpeg"
+			ConfigurationType="4"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories="..\..\..\src\libjpeg"
+				PreprocessorDefinitions="WIN32;NDEBUG;UNICODE;_LIB"
+				StringPooling="FALSE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName).lib"
+				SuppressStartupBanner="TRUE"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcapimin.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcapistd.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jccoefct.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jccolor.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcdctmgr.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jchuff.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcinit.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcmainct.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcmarker.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcmaster.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcomapi.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcparam.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcphuff.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcprepct.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcsample.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jctrans.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdapimin.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdapistd.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdatadst.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdatasrc.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdcoefct.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdcolor.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jddctmgr.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdhuff.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdinput.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdmainct.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdmarker.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdmaster.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdmerge.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdphuff.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdpostct.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdsample.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdtrans.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jerror.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jfdctflt.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jfdctfst.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jfdctint.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jidctflt.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jidctfst.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jidctint.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jidctred.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jmemmgr.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jmemnobs.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jquant1.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jquant2.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jutils.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdbmp.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdcolmap.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdgif.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdppm.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdrle.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdswitch.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdtarga.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\transupp.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrbmp.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrgif.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrjpgcom.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrppm.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrrle.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrtarga.c">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\libjpeg\cderror.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jchuff.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jconfig.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdct.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdhuff.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jerror.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jinclude.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jmemsys.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jmorecfg.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jpegint.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jpeglib.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jversion.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\transupp.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/libspl/libspl.vcproj b/build/win32-msvc2003/libspl/libspl.vcproj
new file mode 100644
index 0000000..88574e2
--- /dev/null
+++ b/build/win32-msvc2003/libspl/libspl.vcproj
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="libspl"
+	ProjectGUID="{1A9CF14C-46CC-450C-B62E-5354751C53F0}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\libspl"
+			IntermediateDirectory="..\..\..\Debug\libspl"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\libspl;..\..\..\src\libspl\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;SPL_MAKE_DLL"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4311"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\libspl"
+			IntermediateDirectory="..\..\..\Release\libspl"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\libspl;..\..\..\src\libspl\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;SPL_MAKE_DLL"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4311"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\..\$(ProjectName).dll"
+				LinkIncremental="1"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_mutex.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_pluginargs.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_plugininfo.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_pluginserver.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_pluginserver_linux.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_pluginserver_win32.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_threadlock.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_mutex.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_platform.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_pluginargs.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_plugininfo.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_pluginserver.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_pluginserver_linux.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_pluginserver_win32.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_threadlock.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_typedefs.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/qwt/qwt.vcproj b/build/win32-msvc2003/qwt/qwt.vcproj
new file mode 100644
index 0000000..e55c195
--- /dev/null
+++ b/build/win32-msvc2003/qwt/qwt.vcproj
@@ -0,0 +1,910 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="qwt"
+	ProjectGUID="{4AED2E04-C11A-40BE-9F3A-331C7261F35C}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\qwt"
+			IntermediateDirectory="..\..\..\Release\qwt"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\qwt\include;"$(QTDIR)\include""
+				PreprocessorDefinitions="QT_NO_DEBUG;NDEBUG;_WINDOWS;UNICODE;WIN32;QT_DLL;QWT_DLL;QWT_MAKEDLL;QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(QTDIR)\lib\qt.lib"
+				OutputFile="..\..\..\Release\qwt.dll"
+				LinkIncremental="1"
+				ImportLibrary="..\..\..\Release\qwt\qwt.lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\qwt"
+			IntermediateDirectory="..\..\..\Debug\qwt"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\qwt\include;"$(QTDIR)\include""
+				PreprocessorDefinitions="QT_NO_DEBUG;_DEBUG;_WINDOWS;UNICODE;WIN32;QT_DLL;QWT_DLL;QWT_MAKEDLL;QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="FALSE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(QTDIR)\lib\qt.lib"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_abstract_scale.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_abstract_scale_draw.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_abstract_slider.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_analog_clock.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_arrow_button.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_compass.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_compass_rose.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_counter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_data.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_dial.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_dial_needle.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_double_interval.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_double_range.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_double_rect.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_dyngrid_layout.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_event_pattern.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_interval_data.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_knob.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_layout_metrics.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_legend.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_legend_item.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_math.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_paint_buffer.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_painter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_picker.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_picker_machine.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_axis.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_canvas.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_curve.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_dict.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_grid.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_item.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_layout.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_marker.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_picker.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_print.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_printfilter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_zoomer.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_rect.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_round_scale_draw.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_scale_div.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_scale_draw.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_scale_engine.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_scale_map.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_scale_widget.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_slider.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_spline.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_symbol.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_text.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_text_engine.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_text_label.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_thermo.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_wheel.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_abstract_scale.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_abstract_scale_draw.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_abstract_slider.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_abstract_slider.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_abstract_slider.h -o ..\..\..\moc\qwt\moc_qwt_abstract_slider.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_abstract_slider.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_abstract_slider.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_abstract_slider.h -o ..\..\..\moc\qwt\moc_qwt_abstract_slider.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_abstract_slider.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_analog_clock.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_analog_clock.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_analog_clock.h -o ..\..\..\moc\qwt\moc_qwt_analog_clock.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_analog_clock.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_analog_clock.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_analog_clock.h -o ..\..\..\moc\qwt\moc_qwt_analog_clock.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_analog_clock.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_array.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_arrow_button.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_compass.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_compass.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_compass.h -o ..\..\..\moc\qwt\moc_qwt_compass.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_compass.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_compass.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_compass.h -o ..\..\..\moc\qwt\moc_qwt_compass.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_compass.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_compass_rose.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_counter.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_counter.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_counter.h -o ..\..\..\moc\qwt\moc_qwt_counter.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_counter.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_counter.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_counter.h -o ..\..\..\moc\qwt\moc_qwt_counter.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_counter.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_data.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_dial.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_dial.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_dial.h -o ..\..\..\moc\qwt\moc_qwt_dial.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_dial.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_dial.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_dial.h -o ..\..\..\moc\qwt\moc_qwt_dial.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_dial.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_dial_needle.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_double_interval.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_double_range.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_double_rect.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_dyngrid_layout.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_dyngrid_layout.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_dyngrid_layout.h -o ..\..\..\moc\qwt\moc_qwt_dyngrid_layout.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_dyngrid_layout.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_dyngrid_layout.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_dyngrid_layout.h -o ..\..\..\moc\qwt\moc_qwt_dyngrid_layout.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_dyngrid_layout.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_event_pattern.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_global.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_interval_data.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_knob.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_knob.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_knob.h -o ..\..\..\moc\qwt\moc_qwt_knob.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_knob.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_knob.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_knob.h -o ..\..\..\moc\qwt\moc_qwt_knob.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_knob.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_layout_metrics.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_legend.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_legend.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_legend.h -o ..\..\..\moc\qwt\moc_qwt_legend.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_legend.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_legend.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_legend.h -o ..\..\..\moc\qwt\moc_qwt_legend.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_legend.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_legend_item.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_legend_item.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_legend_item.h -o ..\..\..\moc\qwt\moc_qwt_legend_item.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_legend_item.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_legend_item.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_legend_item.h -o ..\..\..\moc\qwt\moc_qwt_legend_item.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_legend_item.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_math.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_paint_buffer.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_painter.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_picker.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_picker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_picker.h -o ..\..\..\moc\qwt\moc_qwt_picker.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_picker.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_picker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_picker.h -o ..\..\..\moc\qwt\moc_qwt_picker.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_picker.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_picker_machine.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot.h -o ..\..\..\moc\qwt\moc_qwt_plot.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot.h -o ..\..\..\moc\qwt\moc_qwt_plot.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_canvas.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_canvas.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_canvas.h -o ..\..\..\moc\qwt\moc_qwt_plot_canvas.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_canvas.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_canvas.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_canvas.h -o ..\..\..\moc\qwt\moc_qwt_plot_canvas.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_canvas.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_curve.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_dict.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_grid.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_item.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_layout.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_marker.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_picker.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_picker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_picker.h -o ..\..\..\moc\qwt\moc_qwt_plot_picker.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_picker.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_picker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_picker.h -o ..\..\..\moc\qwt\moc_qwt_plot_picker.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_picker.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_printfilter.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_zoomer.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_zoomer.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_zoomer.h -o ..\..\..\moc\qwt\moc_qwt_plot_zoomer.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_zoomer.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_zoomer.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_zoomer.h -o ..\..\..\moc\qwt\moc_qwt_plot_zoomer.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_zoomer.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_rect.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_round_scale_draw.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_scale_div.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_scale_draw.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_scale_engine.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_scale_map.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_scale_widget.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_scale_widget.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_scale_widget.h -o ..\..\..\moc\qwt\moc_qwt_scale_widget.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_scale_widget.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_scale_widget.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_scale_widget.h -o ..\..\..\moc\qwt\moc_qwt_scale_widget.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_scale_widget.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_slider.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_slider.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_slider.h -o ..\..\..\moc\qwt\moc_qwt_slider.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_slider.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_slider.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_slider.h -o ..\..\..\moc\qwt\moc_qwt_slider.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_slider.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_spline.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_symbol.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_text.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_text_engine.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_text_label.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_text_label.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_text_label.h -o ..\..\..\moc\qwt\moc_qwt_text_label.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_text_label.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_text_label.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_text_label.h -o ..\..\..\moc\qwt\moc_qwt_text_label.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_text_label.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_thermo.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_thermo.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_thermo.h -o ..\..\..\moc\qwt\moc_qwt_thermo.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_thermo.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_thermo.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_thermo.h -o ..\..\..\moc\qwt\moc_qwt_thermo.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_thermo.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_wheel.h">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_wheel.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_wheel.h -o ..\..\..\moc\qwt\moc_qwt_wheel.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_wheel.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_wheel.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_wheel.h -o ..\..\..\moc\qwt\moc_qwt_wheel.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_wheel.cpp"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated MOC Files"
+			Filter="cpp;c;cxx;moc">
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_abstract_slider.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_analog_clock.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_compass.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_counter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_dial.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_dyngrid_layout.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_knob.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_legend.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_legend_item.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_picker.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_plot.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_plot_canvas.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_plot_picker.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_plot_zoomer.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_scale_widget.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_slider.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_text_label.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_thermo.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_wheel.cpp">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/shapelib/shapelib.vcproj b/build/win32-msvc2003/shapelib/shapelib.vcproj
new file mode 100644
index 0000000..bfa6d6e
--- /dev/null
+++ b/build/win32-msvc2003/shapelib/shapelib.vcproj
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="shapelib"
+	ProjectGUID="{C4A3E074-08E5-4197-ABB7-06611BAC269D}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\shapelib"
+			IntermediateDirectory="..\..\..\Debug\shapelib"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SHAPELIB_DLLEXPORT"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\shapelib"
+			IntermediateDirectory="..\..\..\Release\shapelib"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SHAPELIB_DLLEXPORT"
+				MinimalRebuild="FALSE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\..\$(ProjectName).dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="0"
+				EnableCOMDATFolding="0"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath="..\..\..\src\shapelib\dbfopen.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\shapelib\shpopen.c">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath="..\..\..\src\shapelib\shapefil.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/stat/stat.vcproj b/build/win32-msvc2003/stat/stat.vcproj
new file mode 100644
index 0000000..53ba2e2
--- /dev/null
+++ b/build/win32-msvc2003/stat/stat.vcproj
@@ -0,0 +1,248 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="stat"
+	ProjectGUID="{45D098C2-1280-461A-A73B-1333F95C916C}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\stat"
+			IntermediateDirectory="..\..\..\Debug\stat"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\stat"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,STAT_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\stat.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\stat"
+			IntermediateDirectory="..\..\..\Release\stat"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\stat"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,STAT_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\stat.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\../Release/terralib"
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaDouble.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaInt.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaR.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\heap.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\lista.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeBayesFunctions.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeKernelFunctions.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeMSVFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSemivarModelFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterArvore.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterFunctions.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterGrafo.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeStatDataStructures.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\stat\erro.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaDouble.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaInt.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaR.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\heap.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\lista.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeBayesFunctions.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeKernelFunctions.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeKernelParams.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeKMeansGrouping.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeMSVFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSemivarModelFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterArvore.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterFunctions.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterGrafo.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSpatialStatistics.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeStatDataStructures.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeStatDefines.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_ado/te_ado.vcproj b/build/win32-msvc2003/te_ado/te_ado.vcproj
new file mode 100644
index 0000000..893af56
--- /dev/null
+++ b/build/win32-msvc2003/te_ado/te_ado.vcproj
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_ado"
+	ProjectGUID="{f615229c-247c-4df2-92c4-b891bc27bd9b}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_ado"
+			IntermediateDirectory="..\..\..\Debug\te_ado"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\ado;..\..\..\src\terralib\utils;..\..\..\dependencies\win32\ado;..\..\..\dependencies\win32\ado\bin"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,WIN32,TLADO_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib te_utils.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_ado.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\../Debug/terralib;..\..\..\Debug\te_utils"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_ado"
+			IntermediateDirectory="..\..\..\Release\te_ado"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\ado;..\..\..\src\terralib\utils;..\..\..\dependencies\win32\ado;..\..\..\dependencies\win32\ado\bin"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,WIN32,TLADO_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib te_utils.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_ado.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\..\Release\terralib;..\..\..\Release\te_utils"
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoDB.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoOracle.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoSqlServer.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoSqlServerSpatial.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoDB.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoOracle.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoSqlServer.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoSqlServerSpatial.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_apputils/te_apputils.vcproj b/build/win32-msvc2003/te_apputils/te_apputils.vcproj
new file mode 100644
index 0000000..c54a1b1
--- /dev/null
+++ b/build/win32-msvc2003/te_apputils/te_apputils.vcproj
@@ -0,0 +1,749 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_apputils"
+	ProjectGUID="{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_apputils"
+			IntermediateDirectory="..\..\..\Debug\te_apputils"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\appUtils;..\..\..\src\terralib\drivers\qt;..\..\..\src\terralib\utils;..\..\..\src\terralib\stat;..\..\..\terraView\ui;"$(QTDIR)\include";..\..\..\ui\;..\..\..\src\appUtils\ui;..\..\..\moc\"
+				PreprocessorDefinitions="_WINDOWS;_DEBUG;WIN32;TLAPPUTILS_AS_DLL;QT_DLL;QT_THREAD_SUPPORT;UNICODE"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib terralib.lib te_utils.lib stat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib glu32.lib opengl32.lib"
+				OutputFile="..\..\..\Debug\te_apputils.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/stat";"..\..\../Debug/te_utils";"$(QTDIR)\lib""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_apputils"
+			IntermediateDirectory="..\..\..\Release\te_apputils"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\appUtils;..\..\..\src\terralib\drivers\qt;..\..\..\src\terralib\utils;..\..\..\src\terralib\stat;..\..\..\terraView\ui;"$(QTDIR)\include";..\..\..\ui\;..\..\..\src\appUtils\ui;..\..\..\moc\"
+				PreprocessorDefinitions="QT_NO_DEBUG;NDEBUG;_WINDOWS;WIN32;TLAPPUTILS_AS_DLL;QT_DLL;QT_THREAD_SUPPORT;UNICODE"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib terralib.lib te_utils.lib stat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib glu32.lib opengl32.lib"
+				OutputFile="..\..\..\Release\te_apputils.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/stat";"..\..\../Release/te_utils";"$(QTDIR)\lib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\animation.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\help.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\mediaDescription.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TeApplicationUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TeAppTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeDecoderQtImage.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeGUIUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtAnimaThread.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtBigTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtCanvas.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtChartItem.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtCheckListItem.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtColorBar.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtDatabaseItem.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtFrame.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtGLWidget.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtGrid.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLayerItem.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLegendItem.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLegendSource.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtShowMedia.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTextEdit.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtThemeItem.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtViewItem.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtViewsListView.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeWaitCursor.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\urlWindow.ui.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\appUtils\TeApplicationUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TeAppTheme.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TeAppUtilsDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeDecoderQtImage.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeGUIUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TePlotTheme.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TePlotView.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtAnimaThread.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtBigTable.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtBigTable.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtBigTable.h -o ..\..\..\moc\moc_TeQtBigTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtBigTable.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtBigTable.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtBigTable.h -o ..\..\..\moc\moc_TeQtBigTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtBigTable.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtCanvas.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtCanvas.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtCanvas.h -o ..\..\..\moc\moc_TeQtCanvas.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtCanvas.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtCanvas.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtCanvas.h -o ..\..\..\moc\moc_TeQtCanvas.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtCanvas.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtChartItem.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtCheckListItem.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtColorBar.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtColorBar.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtColorBar.h -o ..\..\..\moc\moc_TeQtColorBar.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtColorBar.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtColorBar.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtColorBar.h -o ..\..\..\moc\moc_TeQtColorBar.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtColorBar.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtDatabaseItem.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.h -o ..\..\..\moc\moc_TeQtDatabasesListView.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtDatabasesListView.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.h -o ..\..\..\moc\moc_TeQtDatabasesListView.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtDatabasesListView.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtDataSource.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtDataSource.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtDataSource.h -o ..\..\..\moc\moc_TeQtDataSource.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtDataSource.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtDataSource.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtDataSource.h -o ..\..\..\moc\moc_TeQtDataSource.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtDataSource.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtFrame.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtFrame.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtFrame.h -o ..\..\..\moc\moc_TeQtFrame.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtFrame.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtFrame.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtFrame.h -o ..\..\..\moc\moc_TeQtFrame.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtFrame.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtGLWidget.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtGLWidget.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtGLWidget.h -o ..\..\..\moc\moc_TeQtGLWidget.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtGLWidget.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtGLWidget.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtGLWidget.h -o ..\..\..\moc\moc_TeQtGLWidget.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtGLWidget.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtGrid.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtGrid.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtGrid.h -o ..\..\..\moc\moc_TeQtGrid.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtGrid.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtGrid.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtGrid.h -o ..\..\..\moc\moc_TeQtGrid.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtGrid.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLayerItem.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLegendItem.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLegendSource.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtLegendSource.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtLegendSource.h -o ..\..\..\moc\moc_TeQtLegendSource.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtLegendSource.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtLegendSource.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtLegendSource.h -o ..\..\..\moc\moc_TeQtLegendSource.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtLegendSource.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtProgress.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtProgress.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtProgress.h -o ..\..\..\moc\moc_TeQtProgress.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtProgress.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtProgress.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtProgress.h -o ..\..\..\moc\moc_TeQtProgress.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtProgress.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtShowMedia.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtShowMedia.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtShowMedia.h -o ..\..\..\moc\moc_TeQtShowMedia.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtShowMedia.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtShowMedia.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtShowMedia.h -o ..\..\..\moc\moc_TeQtShowMedia.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtShowMedia.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTable.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTextEdit.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtThemeItem.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtViewItem.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtViewsListView.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtViewsListView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtViewsListView.h -o ..\..\..\moc\moc_TeQtViewsListView.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtViewsListView.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtViewsListView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtViewsListView.h -o ..\..\..\moc\moc_TeQtViewsListView.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtViewsListView.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeWaitCursor.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated MOC Files"
+			Filter="cpp;c;cxx;moc">
+			<File
+				RelativePath="..\..\..\moc\moc_animation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_help.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_mediaDescription.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtBigTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtCanvas.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtColorBar.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtDatabasesListView.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtDataSource.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtFrame.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtGLWidget.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtGrid.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtLegendSource.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtProgress.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtShowMedia.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtViewsListView.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_urlWindow.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated UI Files"
+			Filter="cpp;c;cxx;h;hpp;hxx;">
+			<File
+				RelativePath="..\..\..\ui\animation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\animation.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\help.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\help.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\mediaDescription.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\mediaDescription.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\urlWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\urlWindow.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Forms"
+			Filter="ui"
+			ParseFiles="FALSE">
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\animation.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\animation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\animation.ui -o ..\..\..\ui\animation.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\animation.ui -i animation.h -o ..\..\..\ui\animation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\animation.h -o ..\..\..\moc\moc_animation.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\animation.h;..\..\..\ui\animation.cpp;..\..\..\moc\moc_animation.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\animation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\animation.ui -o ..\..\..\ui\animation.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\animation.ui -i animation.h -o ..\..\..\ui\animation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\animation.h -o ..\..\..\moc\moc_animation.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\animation.h;..\..\..\ui\animation.cpp;..\..\..\moc\moc_animation.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\help.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\help.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\help.ui -o ..\..\..\ui\help.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\help.ui -i help.h -o ..\..\..\ui\help.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\help.h -o ..\..\..\moc\moc_help.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\help.h;..\..\..\ui\help.cpp;..\..\..\moc\moc_help.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\help.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\help.ui -o ..\..\..\ui\help.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\help.ui -i help.h -o ..\..\..\ui\help.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\help.h -o ..\..\..\moc\moc_help.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\help.h;..\..\..\ui\help.cpp;..\..\..\moc\moc_help.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\mediaDescription.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\mediaDescription.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\mediaDescription.ui -o ..\..\..\ui\mediaDescription.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\mediaDescription.ui -i mediaDescription.h -o ..\..\..\ui\mediaDescription.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\mediaDescription.h -o ..\..\..\moc\moc_mediaDescription.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\mediaDescription.h;..\..\..\ui\mediaDescription.cpp;..\..\..\moc\moc_mediaDescription.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\mediaDescription.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\mediaDescription.ui -o ..\..\..\ui\mediaDescription.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\mediaDescription.ui -i mediaDescription.h -o ..\..\..\ui\mediaDescription.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\mediaDescription.h -o ..\..\..\moc\moc_mediaDescription.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\mediaDescription.h;..\..\..\ui\mediaDescription.cpp;..\..\..\moc\moc_mediaDescription.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\urlWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\urlWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\urlWindow.ui -o ..\..\..\ui\urlWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\urlWindow.ui -i urlWindow.h -o ..\..\..\ui\urlWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\urlWindow.h -o ..\..\..\moc\moc_urlWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\urlWindow.h;..\..\..\ui\urlWindow.cpp;..\..\..\moc\moc_urlWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\urlWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\urlWindow.ui -o ..\..\..\ui\urlWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\urlWindow.ui -i urlWindow.h -o ..\..\..\ui\urlWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\urlWindow.h -o ..\..\..\moc\moc_urlWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\urlWindow.h;..\..\..\ui\urlWindow.cpp;..\..\..\moc\moc_urlWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_dxf/te_dxf.vcproj b/build/win32-msvc2003/te_dxf/te_dxf.vcproj
new file mode 100644
index 0000000..a5b3681
--- /dev/null
+++ b/build/win32-msvc2003/te_dxf/te_dxf.vcproj
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_dxf"
+	ProjectGUID="{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_dxf"
+			IntermediateDirectory="..\..\..\Debug\te_dxf"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=""..\..\..\src\terralib\kernel";"..\..\..\src\dxflib";"..\..\..\src\terralib\drivers\DXF""
+				PreprocessorDefinitions="_WINDOWS;UNICODE;WIN32;TEDXF_EXPORTS;QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="dxf.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_dxf.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories=""..\..\../Debug/dxflib";"..\..\../Debug/terralib""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="..\..\..\Debug\te_dxf\te_dxf.pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="..\..\..\Debug\te_dxf\te_dxf.lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_dxf"
+			IntermediateDirectory="..\..\..\Release\te_dxf"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="1"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\dxflib;..\..\..\src\terralib\drivers\DXF"
+				PreprocessorDefinitions="QT_NO_DEBUG;NDEBUG;_WINDOWS;UNICODE;WIN32;TEDXF_EXPORTS;QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="dxf.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_dxf.dll"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories=""..\..\../Release/dxflib";"..\..\../Release/terralib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile=""
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\TeDXFDriver.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\TeDXFDriverFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\tedxflayer.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\tedxfvisitor.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\tedxfdefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\TeDXFDriver.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\TeDXFDriverFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\tedxflayer.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\tedxfvisitor.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_firebird/te_firebird.vcproj b/build/win32-msvc2003/te_firebird/te_firebird.vcproj
new file mode 100644
index 0000000..dcb3cb9
--- /dev/null
+++ b/build/win32-msvc2003/te_firebird/te_firebird.vcproj
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_firebird"
+	ProjectGUID="{DC4338DD-BAE5-487D-9688-573DE607CDFD}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_firebird"
+			IntermediateDirectory="..\..\..\Debug\te_firebird"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\Firebird"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLFIREBIRD_AS_DLL,IBPP_WINDOWS,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_firebird.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\../Debug/terralib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_firebird"
+			IntermediateDirectory="..\..\..\Release\te_firebird"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\Firebird"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLFIREBIRD_AS_DLL,IBPP_WINDOWS,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_firebird.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\../Release/terralib"
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\ibpp\core\all_in_one.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\TeFirebird.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\ibpp\core\_ibpp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\ibpp\core\ibase.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\ibpp\core\iberror.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\ibpp\core\ibpp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\TeFirebird.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\TeFirebirdDefines.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_functions/te_functions.vcproj b/build/win32-msvc2003/te_functions/te_functions.vcproj
new file mode 100644
index 0000000..be33ba3
--- /dev/null
+++ b/build/win32-msvc2003/te_functions/te_functions.vcproj
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_functions"
+	ProjectGUID="{877A1388-B3CA-481A-9BFB-C7178EC68D0B}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_functions"
+			IntermediateDirectory="..\..\..\Debug\te_functions"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions"
+				PreprocessorDefinitions="_WINDOWS;_DEBUG;WIN32;TLFUNCTIONS_AS_DLL;QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_functions.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_functions"
+			IntermediateDirectory="..\..\..\Release\te_functions"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLFUNCTIONS_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_functions.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\../Release/terralib"
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeAddressLocator.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeCellAlgorithms.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeCoordAlgorithms.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeExportCSV.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeExportMIF.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeExportSPR.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeGeoProcessingFunctions.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeImportBNA.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeImportCSV.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeImportGeo.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeImportMIF.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeLayerFunctions.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeMIFProjection.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeSimilarity.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeSPRFile.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeThemeFunctions.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeAddressLocator.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeCellAlgorithms.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeCoordAlgorithms.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeDriverBNA.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeDriverCSV.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeDriverMIDMIF.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeDriverSPRING.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeFunctionsDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeGeoProcessingFunctions.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeLayerFunctions.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeMIFProjection.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeSPRFile.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeThemeFunctions.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_gdal/te_gdal.vcproj b/build/win32-msvc2003/te_gdal/te_gdal.vcproj
new file mode 100644
index 0000000..1c10514
--- /dev/null
+++ b/build/win32-msvc2003/te_gdal/te_gdal.vcproj
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_gdal"
+	ProjectGUID="{5ECB35FB-BC2C-474A-90E0-33BBA989C14E}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_gdal\"
+			IntermediateDirectory="..\..\..\Debug\te_gdal\"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel,..\..\..\src\terralib\kernel,..\..\..\src\terralib\utils,..\..\..\src\terralib\drivers\gdal,..\..\..\..\thirdparty\gdal-1.7.2\gcore,..\..\..\..\thirdparty\gdal-1.7.2\port,..\..\..\..\thirdparty\gdal-1.7.2\ogr,..\..\..\..\thirdparty\gdal-1.7.2\ogr\ogrsf_frmts,D:\TerraView\terralib\build\qt\te_gdal,C:\Qt\3.2.0\mkspecs\win32-msvc.net"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,WIN32,TEGDAL_EXPORTS,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\..\..\Debug\te_gdal\"
+				ObjectFile="..\..\..\Debug\te_gdal\"
+				ProgramDataBaseFileName="..\..\..\Debug\te_gdal\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="gdal_i.lib terralib.lib te_utils.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_gdal.dll"
+				Version="3.61"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Debug/terralib;../../../Debug/te_utils;"../../../../thirdparty/gdal-1.7.2""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_gdal\"
+			IntermediateDirectory="..\..\..\Release\te_gdal\"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel,..\..\..\src\terralib\kernel,..\..\..\src\terralib\utils,..\..\..\src\terralib\drivers\gdal,..\..\..\..\thirdparty\gdal-1.7.2\gcore,..\..\..\..\thirdparty\gdal-1.7.2\port,..\..\..\..\thirdparty\gdal-1.7.2\ogr,..\..\..\..\thirdparty\gdal-1.7.2\ogr\ogrsf_frmts,D:\TerraView\terralib\build\qt\te_gdal,C:\Qt\3.2.0\mkspecs\win32-msvc.net"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,WIN32,TEGDAL_EXPORTS,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\..\..\Release\te_gdal\"
+				ObjectFile="..\..\..\Release\te_gdal\"
+				ProgramDataBaseFileName="..\..\..\Release\te_gdal\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="gdal_i.lib terralib.lib te_utils.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_gdal.dll"
+				Version="3.61"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Release/terralib;../../../Release/te_utils;"../../../../thirdparty/gdal-1.7.2""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeGDALDecoder.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeGDALUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRDriver.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRDriverFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRUtils.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeGDALDecoder.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeGDALDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeGDALUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRDriver.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRDriverFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRUtils.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_mysql/te_mysql.vcproj b/build/win32-msvc2003/te_mysql/te_mysql.vcproj
new file mode 100644
index 0000000..6b5b74d
--- /dev/null
+++ b/build/win32-msvc2003/te_mysql/te_mysql.vcproj
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_mysql"
+	ProjectGUID="{31C5E1F3-85BD-4580-973D-CA344342DD36}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_mysql"
+			IntermediateDirectory="..\..\..\Debug\te_mysql"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\MySQL;..\..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLMYSQL_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib libmysql.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_mysql.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Debug\terralib";"..\..\..\dependencies\win32\MySQL\lib\ms""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_mysql"
+			IntermediateDirectory="..\..\..\Release\te_mysql"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\MySQL;..\..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLMYSQL_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib libmysql.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_mysql.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Release\terralib";"..\..\..\dependencies\win32\MySQL\lib\ms""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\MySQL\TeMySQL.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\MySQL\TeMySQLDefines.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_oracle/te_oracle.vcproj b/build/win32-msvc2003/te_oracle/te_oracle.vcproj
new file mode 100644
index 0000000..ca0c0cf
--- /dev/null
+++ b/build/win32-msvc2003/te_oracle/te_oracle.vcproj
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_oracle"
+	ProjectGUID="{EE0E1B28-F969-4F8C-8D18-B31250403089}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_oracle"
+			IntermediateDirectory="..\..\..\Debug\te_oracle"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\Oracle;..\..\..\src\terralib\drivers\Oracle\OCI\include"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLORACLE_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib Oci.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_oracle.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Debug\terralib";"..\..\..\dependencies\win32\Oracle\lib""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_oracle"
+			IntermediateDirectory="..\..\..\Release\te_oracle"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\Oracle;..\..\..\src\terralib\drivers\Oracle\OCI\include"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLORACLE_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib Oci.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_oracle.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Release\terralib";"..\..\..\dependencies\win32\Oracle\lib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCIConnect.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCICursor.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCIOracle.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCISDO.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOracleSpatial.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCIConnect.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCICursor.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCIOracle.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCISDO.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOracleDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOracleSpatial.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_postgresql/te_postgresql.vcproj b/build/win32-msvc2003/te_postgresql/te_postgresql.vcproj
new file mode 100644
index 0000000..f75a274
--- /dev/null
+++ b/build/win32-msvc2003/te_postgresql/te_postgresql.vcproj
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_postgresql"
+	ProjectGUID="{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_postgresql"
+			IntermediateDirectory="..\..\..\Debug\te_postgresql"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\PostgreSQL;..\..\..\src\terralib\drivers\PostgreSQL\includepg"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLPOSTGRESQL_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib libpq.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_postgresql.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Debug\terralib";"..\..\..\dependencies\win32\PostgreSQL\lib""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_postgresql"
+			IntermediateDirectory="..\..\..\Release\te_postgresql"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\PostgreSQL;..\..\..\src\terralib\drivers\PostgreSQL\includepg"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLPOSTGRESQL_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib libpq.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_postgresql.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Release\terralib";"..\..\..\dependencies\win32\PostgreSQL\lib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePGInterface.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePGUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePostGIS.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePostgreSQL.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePGInterface.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePGUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePostGIS.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePostgreSQL.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePostgreSQLDefines.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_qwt/te_qwt.vcproj b/build/win32-msvc2003/te_qwt/te_qwt.vcproj
new file mode 100644
index 0000000..2fb3e88
--- /dev/null
+++ b/build/win32-msvc2003/te_qwt/te_qwt.vcproj
@@ -0,0 +1,255 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_qwt"
+	ProjectGUID="{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_qwt"
+			IntermediateDirectory="..\..\..\Debug\te_qwt"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\qwt;..\..\..\src\qwt\include;"$(QTDIR)\include";..\..\..\ui\terraView\;..\..\..\moc\terraView\"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLQWT_AS_DLL,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib qwt.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_qwt.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/qwt";"$(QTDIR)\lib""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_qwt"
+			IntermediateDirectory="..\..\..\Release\te_qwt"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\qwt;..\..\..\src\qwt\include;"$(QTDIR)\include";..\..\..\ui\terraView\;..\..\..\moc\terraView\"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLQWT_AS_DLL,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib qwt.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_qwt.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/qwt";"$(QTDIR)\lib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlot.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotCurve.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlot.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlot.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlot.h -o ..\..\..\moc\terraView\moc_TeQwtPlot.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlot.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlot.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlot.h -o ..\..\..\moc\terraView\moc_TeQwtPlot.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlot.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotCurve.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.h -o ..\..\..\moc\terraView\moc_TeQwtPlotPicker.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlotPicker.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.h -o ..\..\..\moc\terraView\moc_TeQwtPlotPicker.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlotPicker.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.h -o ..\..\..\moc\terraView\moc_TeQwtPlotZoomer.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlotZoomer.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.h -o ..\..\..\moc\terraView\moc_TeQwtPlotZoomer.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlotZoomer.cpp"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated MOC Files"
+			Filter="cpp;c;cxx;moc">
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_TeQwtPlot.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_TeQwtPlotPicker.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_TeQwtPlotZoomer.cpp">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_shapelib/te_shapelib.vcproj b/build/win32-msvc2003/te_shapelib/te_shapelib.vcproj
new file mode 100644
index 0000000..2a6ec58
--- /dev/null
+++ b/build/win32-msvc2003/te_shapelib/te_shapelib.vcproj
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_shapelib"
+	ProjectGUID="{18CAE353-F7DD-4FDA-971A-48D856DA0635}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_shapelib"
+			IntermediateDirectory="..\..\..\Debug\te_shapelib"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\shapelib;..\..\..\src\shapelib"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLSHP_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="shapelib.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_shapelib.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/shapelib""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_shapelib"
+			IntermediateDirectory="..\..\..\Release\te_shapelib"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\shapelib;..\..\..\src\shapelib"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLSHP_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="shapelib.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_shapelib.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/shapelib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\shapelib\TeDriverSHPDBF.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\shapelib\TeSHPDriverFactory.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\shapelib\TeDriverSHPDBF.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\shapelib\TeSHPDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\shapelib\TeSHPDriverFactory.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_spl/te_spl.vcproj b/build/win32-msvc2003/te_spl/te_spl.vcproj
new file mode 100644
index 0000000..c2b7c22
--- /dev/null
+++ b/build/win32-msvc2003/te_spl/te_spl.vcproj
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_spl"
+	ProjectGUID="{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_spl"
+			IntermediateDirectory="..\..\..\Debug\te_spl"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\spl;..\..\..\src\libspl;"$(QTDIR)\include""
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,WIN32,TLSPL_AS_DLL,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib libspl.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_spl.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/libspl";"$(QTDIR)\lib""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_spl"
+			IntermediateDirectory="..\..\..\Release\te_spl"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\spl;..\..\..\src\libspl;"$(QTDIR)\include""
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,WIN32,TLSPL_AS_DLL,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib libspl.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_spl.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/libspl";"$(QTDIR)\lib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginMetadata.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginParameters.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginsManager.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginsSignal.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginInfo.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginMetadata.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginParameters.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginsManager.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginsParametersContainer.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginsSignal.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\TeSPLDefines.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/te_utils/te_utils.vcproj b/build/win32-msvc2003/te_utils/te_utils.vcproj
new file mode 100644
index 0000000..2a76ab3
--- /dev/null
+++ b/build/win32-msvc2003/te_utils/te_utils.vcproj
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="te_utils"
+	ProjectGUID="{6F8DD2AE-66D4-442A-B204-114A1EF99335}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_utils"
+			IntermediateDirectory="..\..\..\Debug\te_utils"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\utils;..\..\..\src\terralib\functions"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLUTILS_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib te_functions.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_utils.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/te_functions""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_utils"
+			IntermediateDirectory="..\..\..\Release\te_utils"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\utils;..\..\..\src\terralib\functions"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLUTILS_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib te_functions.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_utils.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/te_functions""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\utils\mtrand.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeColorUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeDatabaseUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeUpdateDBVersion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeWKBGeometryDecoder.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeWKTGeometryDecoder.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\utils\mtrand.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeColorUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeDatabaseUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeUpdateDBVersion.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeUtilsDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeWKBGeometryDecoder.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeWKTGeometryDecoder.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/terraView/terraView.sln b/build/win32-msvc2003/terraView/terraView.sln
new file mode 100644
index 0000000..4d42c77
--- /dev/null
+++ b/build/win32-msvc2003/terraView/terraView.sln
@@ -0,0 +1,232 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dxf", "..\dxf\dxf.vcproj", "{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_firebird", "..\te_firebird\te_firebird.vcproj", "{DC4338DD-BAE5-487D-9688-573DE607CDFD}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralibpdi", "..\terralibpdi\terralibpdi.vcproj", "{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspl", "..\libspl\libspl.vcproj", "{1A9CF14C-46CC-450C-B62E-5354751C53F0}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_mysql", "..\te_mysql\te_mysql.vcproj", "{31C5E1F3-85BD-4580-973D-CA344342DD36}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_oracle", "..\te_oracle\te_oracle.vcproj", "{EE0E1B28-F969-4F8C-8D18-B31250403089}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_postgresql", "..\te_postgresql\te_postgresql.vcproj", "{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qwt", "..\qwt\qwt.vcproj", "{4AED2E04-C11A-40BE-9F3A-331C7261F35C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapelib", "..\shapelib\shapelib.vcproj", "{C4A3E074-08E5-4197-ABB7-06611BAC269D}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stat", "..\stat\stat.vcproj", "{45D098C2-1280-461A-A73B-1333F95C916C}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_functions", "..\te_functions\te_functions.vcproj", "{0628C83D-0867-4CF9-A0A6-B34038CB2F87}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_qwt", "..\te_qwt\te_qwt.vcproj", "{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}"
+	ProjectSection(ProjectDependencies) = postProject
+		{4AED2E04-C11A-40BE-9F3A-331C7261F35C} = {4AED2E04-C11A-40BE-9F3A-331C7261F35C}
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_shapelib", "..\te_shapelib\te_shapelib.vcproj", "{18CAE353-F7DD-4FDA-971A-48D856DA0635}"
+	ProjectSection(ProjectDependencies) = postProject
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D} = {C4A3E074-08E5-4197-ABB7-06611BAC269D}
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_utils", "..\te_utils\te_utils.vcproj", "{6F8DD2AE-66D4-442A-B204-114A1EF99335}"
+	ProjectSection(ProjectDependencies) = postProject
+		{0628C83D-0867-4CF9-A0A6-B34038CB2F87} = {0628C83D-0867-4CF9-A0A6-B34038CB2F87}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_dxf", "..\te_dxf\te_dxf.vcproj", "{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4} = {5AC793EF-07E3-44DA-AE88-E8D6546A73E4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\terralib\terralib.vcproj", "{1253197A-5710-4924-9706-6449C0C32FE9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D} = {C4A3E074-08E5-4197-ABB7-06611BAC269D}
+		{DD1ADACD-7990-4793-9952-25197394954A} = {DD1ADACD-7990-4793-9952-25197394954A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\tiff\tiff.vcproj", "{DD1ADACD-7990-4793-9952-25197394954A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terraView", "terraView.vcproj", "{1632841E-001E-4357-83C4-C44B0DAAEA20}"
+	ProjectSection(ProjectDependencies) = postProject
+		{83E97E90-A12D-4909-9E61-8E3719F8FCBA} = {83E97E90-A12D-4909-9E61-8E3719F8FCBA}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terraViewCore", "..\terraViewCore\terraViewCore.vcproj", "{83E97E90-A12D-4909-9E61-8E3719F8FCBA}"
+	ProjectSection(ProjectDependencies) = postProject
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83} = {56D7AA1F-BA95-4B48-843A-D264BEFF4E83}
+		{EE0E1B28-F969-4F8C-8D18-B31250403089} = {EE0E1B28-F969-4F8C-8D18-B31250403089}
+		{0628C83D-0867-4CF9-A0A6-B34038CB2F87} = {0628C83D-0867-4CF9-A0A6-B34038CB2F87}
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635} = {18CAE353-F7DD-4FDA-971A-48D856DA0635}
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A} = {BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}
+		{2A804C6A-0669-4D88-8FBC-BFD56AFA9105} = {2A804C6A-0669-4D88-8FBC-BFD56AFA9105}
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6} = {3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}
+		{3C010977-5C10-47DA-9D9E-9DA82A4FEE7E} = {3C010977-5C10-47DA-9D9E-9DA82A4FEE7E}
+		{BCC66EA6-824F-42D7-AB3F-46AFF3F18829} = {BCC66EA6-824F-42D7-AB3F-46AFF3F18829}
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4} = {1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD} = {DC4338DD-BAE5-487D-9688-573DE607CDFD}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_apputils", "..\te_apputils\te_apputils.vcproj", "{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335} = {6F8DD2AE-66D4-442A-B204-114A1EF99335}
+		{45D098C2-1280-461A-A73B-1333F95C916C} = {45D098C2-1280-461A-A73B-1333F95C916C}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_spl", "..\te_spl\te_spl.vcproj", "{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1A9CF14C-46CC-450C-B62E-5354751C53F0} = {1A9CF14C-46CC-450C-B62E-5354751C53F0}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_ado", "..\te_ado\te_ado.vcproj", "{3C010977-5C10-47DA-9D9E-9DA82A4FEE7E}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4} = {1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Debug.ActiveCfg = Debug|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Debug.Build.0 = Debug|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Release.ActiveCfg = Release|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Release.Build.0 = Release|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Debug.ActiveCfg = Debug|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Debug.Build.0 = Debug|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Release.ActiveCfg = Release|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Release.Build.0 = Release|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Debug.ActiveCfg = Debug|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Debug.Build.0 = Debug|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Release.ActiveCfg = Release|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Release.Build.0 = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
+		{1A9CF14C-46CC-450C-B62E-5354751C53F0}.Debug.ActiveCfg = Debug|Win32
+		{1A9CF14C-46CC-450C-B62E-5354751C53F0}.Debug.Build.0 = Debug|Win32
+		{1A9CF14C-46CC-450C-B62E-5354751C53F0}.Release.ActiveCfg = Release|Win32
+		{1A9CF14C-46CC-450C-B62E-5354751C53F0}.Release.Build.0 = Release|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Debug.ActiveCfg = Debug|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Debug.Build.0 = Debug|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Release.ActiveCfg = Release|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Release.Build.0 = Release|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Debug.ActiveCfg = Debug|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Debug.Build.0 = Debug|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Release.ActiveCfg = Release|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Release.Build.0 = Release|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Debug.ActiveCfg = Debug|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Debug.Build.0 = Debug|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Release.ActiveCfg = Release|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Release.Build.0 = Release|Win32
+		{4AED2E04-C11A-40BE-9F3A-331C7261F35C}.Debug.ActiveCfg = Debug|Win32
+		{4AED2E04-C11A-40BE-9F3A-331C7261F35C}.Debug.Build.0 = Debug|Win32
+		{4AED2E04-C11A-40BE-9F3A-331C7261F35C}.Release.ActiveCfg = Release|Win32
+		{4AED2E04-C11A-40BE-9F3A-331C7261F35C}.Release.Build.0 = Release|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Debug.ActiveCfg = Debug|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Debug.Build.0 = Debug|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Release.ActiveCfg = Release|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Release.Build.0 = Release|Win32
+		{45D098C2-1280-461A-A73B-1333F95C916C}.Debug.ActiveCfg = Debug|Win32
+		{45D098C2-1280-461A-A73B-1333F95C916C}.Debug.Build.0 = Debug|Win32
+		{45D098C2-1280-461A-A73B-1333F95C916C}.Release.ActiveCfg = Release|Win32
+		{45D098C2-1280-461A-A73B-1333F95C916C}.Release.Build.0 = Release|Win32
+		{0628C83D-0867-4CF9-A0A6-B34038CB2F87}.Debug.ActiveCfg = Debug|Win32
+		{0628C83D-0867-4CF9-A0A6-B34038CB2F87}.Debug.Build.0 = Debug|Win32
+		{0628C83D-0867-4CF9-A0A6-B34038CB2F87}.Release.ActiveCfg = Release|Win32
+		{0628C83D-0867-4CF9-A0A6-B34038CB2F87}.Release.Build.0 = Release|Win32
+		{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}.Debug.ActiveCfg = Debug|Win32
+		{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}.Debug.Build.0 = Debug|Win32
+		{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}.Release.ActiveCfg = Release|Win32
+		{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}.Release.Build.0 = Release|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Debug.ActiveCfg = Debug|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Debug.Build.0 = Debug|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Release.ActiveCfg = Release|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Release.Build.0 = Release|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Debug.ActiveCfg = Debug|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Debug.Build.0 = Debug|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Release.ActiveCfg = Release|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Release.Build.0 = Release|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Debug.ActiveCfg = Debug|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Debug.Build.0 = Debug|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Release.ActiveCfg = Release|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Release.Build.0 = Release|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Debug.ActiveCfg = Debug|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Debug.Build.0 = Debug|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Release.ActiveCfg = Release|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Release.Build.0 = Release|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Debug.ActiveCfg = Debug|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Debug.Build.0 = Debug|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Release.ActiveCfg = Release|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Release.Build.0 = Release|Win32
+		{1632841E-001E-4357-83C4-C44B0DAAEA20}.Debug.ActiveCfg = Debug|Win32
+		{1632841E-001E-4357-83C4-C44B0DAAEA20}.Debug.Build.0 = Debug|Win32
+		{1632841E-001E-4357-83C4-C44B0DAAEA20}.Release.ActiveCfg = Release|Win32
+		{1632841E-001E-4357-83C4-C44B0DAAEA20}.Release.Build.0 = Release|Win32
+		{83E97E90-A12D-4909-9E61-8E3719F8FCBA}.Debug.ActiveCfg = Debug|Win32
+		{83E97E90-A12D-4909-9E61-8E3719F8FCBA}.Debug.Build.0 = Debug|Win32
+		{83E97E90-A12D-4909-9E61-8E3719F8FCBA}.Release.ActiveCfg = Release|Win32
+		{83E97E90-A12D-4909-9E61-8E3719F8FCBA}.Release.Build.0 = Release|Win32
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}.Debug.ActiveCfg = Debug|Win32
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}.Debug.Build.0 = Debug|Win32
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}.Release.ActiveCfg = Release|Win32
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}.Release.Build.0 = Release|Win32
+		{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}.Debug.ActiveCfg = Debug|Win32
+		{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}.Debug.Build.0 = Debug|Win32
+		{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}.Release.ActiveCfg = Release|Win32
+		{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}.Release.Build.0 = Release|Win32
+		{3C010977-5C10-47DA-9D9E-9DA82A4FEE7E}.Debug.ActiveCfg = Debug|Win32
+		{3C010977-5C10-47DA-9D9E-9DA82A4FEE7E}.Debug.Build.0 = Debug|Win32
+		{3C010977-5C10-47DA-9D9E-9DA82A4FEE7E}.Release.ActiveCfg = Release|Win32
+		{3C010977-5C10-47DA-9D9E-9DA82A4FEE7E}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/build/win32-msvc2003/terraView/terraView.vcproj b/build/win32-msvc2003/terraView/terraView.vcproj
new file mode 100644
index 0000000..6f6fdd9
--- /dev/null
+++ b/build/win32-msvc2003/terraView/terraView.vcproj
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="terraView"
+	ProjectGUID="{1632841E-001E-4357-83C4-C44B0DAAEA20}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\terraView"
+			IntermediateDirectory="..\..\..\Debug\terraView"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories=""..\..\..\src\terralib\kernel";"..\..\..\terraView";"..\..\..\src\qwt\include";"..\..\..\src\terralib\drivers\qwt";"..\..\..\src\terralib\drivers\shapelib";"..\..\..\src\terralib\drivers\DXF";"..\..\..\src\terralib\utils";"..\..\..\src\terralib\functions";"..\..\..\src\terralib\stat";"..\..\..\src\shapelib";"..\..\..\src\zlib";"..\..\..\src\ [...]
+				PreprocessorDefinitions="_WINDOWS;_DEBUG;WIN32;QT_DLL;QT_THREAD_SUPPORT;UNICODE"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib qtmain.lib te_dxf.lib te_shapelib.lib terralib.lib terraViewCore.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\terraView.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/terraViewCore";"..\..\../Debug/te_dxf";"..\..\../Debug/te_shapelib";"$(QTDIR)\lib""
+				IgnoreDefaultLibraryNames="msvcrt.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress=""
+				ImportLibrary=""/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copying dependencies..\..\..."
+				CommandLine="copy ..\..\..\dependencies\win32\ado\bin\*.dll ..\..\..\Debug
+copy ..\..\..\dependencies\win32\Oracle\bin\*.dll ..\..\..\Debug
+copy ..\..\..\dependencies\win32\MySQL\bin\*.dll ..\..\..\Debug
+copy ..\..\..\dependencies\win32\PostgreSQL\bin\*.dll ..\..\..\Debug
+copy ..\..\..\dependencies\win32\zlib\bin\*.dll ..\..\..\Debug
+copy ..\..\..\dependencies\win32\DSDK\Debug\bin\*.dll ..\..\..\Debug
+if not exist ..\..\..\Debug\plugins mkdir ..\..\..\Debug\plugins
+"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\terraView"
+			IntermediateDirectory="..\..\..\Release\terraView"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="1"
+				AdditionalIncludeDirectories=""..\..\..\src\terralib\kernel";.;"..\..\..\src\qwt\include";"..\..\..\src\terralib\drivers\qwt";"..\..\..\src\terralib\drivers\shapelib";"..\..\..\src\terralib\drivers\DXF";"..\..\..\src\terralib\utils";"..\..\..\src\terralib\functions";"..\..\..\src\terralib\stat";"..\..\..\src\shapelib";"..\..\..\src\zlib";"..\..\..\src\libspl";ui;"..\..\. [...]
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,WIN32,UNICODE,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib qtmain.lib te_dxf.lib te_shapelib.lib terralib.lib terraViewCore.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\terraView.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Release\terralib";"..\..\..\Release\terraViewCore";"..\..\..\Release\te_dxf";"..\..\..\Release\te_shapelib";"$(QTDIR)\lib""
+				IgnoreDefaultLibraryNames=""
+				DelayLoadDLLs=""
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copying dependencies..\..\..."
+				CommandLine="copy ..\..\..\dependencies\win32\ado\bin\*.dll ..\..\..\Release
+copy ..\..\..\dependencies\win32\Oracle\bin\*.dll ..\..\..\Release
+copy ..\..\..\dependencies\win32\MySQL\bin\*.dll ..\..\..\Release
+copy ..\..\..\dependencies\win32\PostgreSQL\bin\*.dll ..\..\..\Release
+copy ..\..\..\dependencies\win32\zlib\bin\*.dll ..\..\..\Release
+copy ..\..\..\dependencies\win32\DSDK\Release\bin\*.dll ..\..\..\Release
+if not exist ..\..\..\Release\plugins mkdir ..\..\..\Release\plugins
+"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\terraView\main.cpp">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/terraViewCore/.imgcol b/build/win32-msvc2003/terraViewCore/.imgcol
new file mode 100644
index 0000000..209eef0
--- /dev/null
+++ b/build/win32-msvc2003/terraViewCore/.imgcol
@@ -0,0 +1 @@
+../../../terraView/ui/images/addressDictionary.png ../../../terraView/ui/images/addressLayer.png ../../../terraView/ui/images/addressReferenceLayer.png ../../../terraView/ui/images/addressTable.png ../../../terraView/ui/images/and.bmp ../../../terraView/ui/images/area.bmp ../../../terraView/ui/images/buffer.bmp ../../../terraView/ui/images/bufferNoUnion.bmp ../../../terraView/ui/images/bufferUnion.bmp ../../../terraView/ui/images/clearColor.bmp ../../../terraView/ui/images/closeDB.bmp .. [...]
diff --git a/build/win32-msvc2003/terraViewCore/terraViewCore.vcproj b/build/win32-msvc2003/terraViewCore/terraViewCore.vcproj
new file mode 100644
index 0000000..ed04225
--- /dev/null
+++ b/build/win32-msvc2003/terraViewCore/terraViewCore.vcproj
@@ -0,0 +1,3619 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="terraViewCore"
+	ProjectGUID="{f48c5f57-666a-4aa1-997b-a6132b4ae4e0}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\terraViewCore"
+			IntermediateDirectory="..\..\..\Debug\terraViewCore"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=""..\..\..\src\terralib\kernel";"..\..\..\src\terralib\drivers\ado";"..\..\..\terraView";"..\..\..\src\qwt\include";"..\..\..\src\terralib\drivers\qwt";"..\..\..\src\terralib\drivers\spl";"..\..\..\src\terralib\drivers\shapelib";"..\..\..\src\terralib\utils";"..\..\..\src\terralib\functions";"..\..\..\src\terralib\stat";"..\..\..\src\shapelib";&qu [...]
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,WIN32,TVIEW_AS_DLL,IBPP_WINDOWS,UNICODE,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib te_spl.lib libjpeg.lib tiff.lib terralib.lib terralibpdi.lib stat.lib shapelib.lib qwt.lib te_functions.lib te_utils.lib te_qwt.lib te_shapelib.lib te_apputils.lib opengl32.lib glu32.lib lti_dsdk_dll.lib gdalogr.lib te_mysql.lib te_postgresql.lib te_oracle.lib te_firebird.lib te_ado.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\terraViewCore.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/qwt";"..\..\../Debug/stat";"..\..\../Debug/tiff";"..\..\../Debug/shapelib";"..\..\../Debug/libjpeg";"..\..\../Debug/te_spl";"..\..\../Debug/terralibpdi";"..\..\../Debug/te_utils";"..\..\../Debug/te_functions";"..\..\../Debug/te_qwt";"..\..\../Debug/te_shapelib";"..\..\../Debug/te_apputils&q [...]
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"
+				Description="Generate imagecollection"
+				CommandLine="$(QTDIR)\bin\uic.exe -embed terraViewCore -f .imgcol -o qmake_image_collection.cpp"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\terraViewCore"
+			IntermediateDirectory="..\..\..\Release\terraViewCore"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="1"
+				AdditionalIncludeDirectories=""..\..\..\src\terralib\kernel";"..\..\..\src\terralib\drivers\ado";"..\..\..\terraView";"..\..\..\src\qwt\include";"..\..\..\src\terralib\drivers\qwt";"..\..\..\src\terralib\drivers\spl";"..\..\..\src\terralib\drivers\shapelib";"..\..\..\src\terralib\utils";"..\..\..\src\terralib\functions";"..\..\..\src\terralib\stat";"..\..\..\src\shapelib";&qu [...]
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,WIN32,TVIEW_AS_DLL,IBPP_WINDOWS,UNICODE,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib libspl.lib libjpeg.lib tiff.lib terralib.lib terralibpdi.lib stat.lib shapelib.lib qwt.lib te_functions.lib te_utils.lib te_qwt.lib te_shapelib.lib te_apputils.lib opengl32.lib glu32.lib lti_dsdk_dll.lib gdalogr.lib te_mysql.lib te_postgresql.lib te_oracle.lib te_firebird.lib te_ado.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\terraViewCore.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/qwt";"..\..\../Release/stat";"..\..\../Release/tiff";"..\..\../Release/shapelib";"..\..\../Release/libjpeg";"..\..\../Release/libspl";"..\..\../Release/terralibpdi";"..\..\../Release/te_utils";"..\..\../Release/te_functions";"..\..\../Release/te_qwt";"..\..\../Release/te_shapelib";"..\. [...]
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"
+				Description="Generate imagecollection"
+				CommandLine="$(QTDIR)\bin\uic.exe -embed terraViewCore -f .imgcol -o qmake_image_collection.cpp"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\terraView\ui\addColumn.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressChoiceWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressLocatorWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressNameSeparator.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addTheme.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addView.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\anaesp.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\bayesWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColData.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColumnName.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColumnType.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeMinMax.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\connectView.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\contrast.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\countComputing.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createBuffersWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createCells.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createLayerFromTheme.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createProxMatrix.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createTable.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createTextRepresentation.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createThemeFromTheme.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\database.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\display.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\displaySize.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\exportLayersThemes.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\exportWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\generateSamplePoints.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geographicalGrid.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAdd.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAggregation.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayDifference.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayIntersection.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayUnion.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphic.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphic3DWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphicConfigurationWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphicParams.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\histogramBuildForm.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\import.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importRasterSimple.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTable.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTablePoints.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTbl.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTblPoints.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertPoint.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertSymbol.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertText.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\kernelRatioWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\kernelWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\layerProp.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\lbsDefinition.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\legendWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\linkExtTable.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\localBayesWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\pieBarChart.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\PluginSupportFunctions.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\printFileResolution.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\projection.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\query.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterColorCompositionWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterImportWizard.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterSlicingWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterTransparency.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\removeTable.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveAsTable.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveRaster.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveTableAsTxt.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveThemeToFileWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selectProxMatrix.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selectTextRepresentation.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selThemeTables.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\semivar.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\skaterWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\spatializationWindow.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\spatialQuery.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\statistic.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\tableProp.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\telayer_metadata.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtMethods.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTerraStat.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\terraView.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\terraViewBase.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\textRep.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\themeVis.ui.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\TViewAbstractPlugin.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\visual.ui.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\PluginSupportFunctions.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtMethods.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtMethods.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtMethods.h -o ..\..\..\moc\terraView\moc_TeQtMethods.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQtMethods.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtMethods.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtMethods.h -o ..\..\..\moc\terraView\moc_TeQtMethods.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQtMethods.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTerraStat.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtTerraStat.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtTerraStat.h -o ..\..\..\moc\terraView\moc_TeQtTerraStat.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQtTerraStat.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtTerraStat.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtTerraStat.h -o ..\..\..\moc\terraView\moc_TeQtTerraStat.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQtTerraStat.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\terraView\terraView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\terraView\terraView.h -o ..\..\..\moc\terraView\moc_terraView.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_terraView.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\terraView\terraView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\terraView\terraView.h -o ..\..\..\moc\terraView\moc_terraView.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_terraView.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\TViewAbstractPlugin.h">
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\TViewDefines.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated MOC Files"
+			Filter="cpp;c;cxx;moc">
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addColumn.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addressChoiceWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addressLocatorWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addressNameSeparator.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addView.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_anaesp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_bayesWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_changeColData.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_changeColumnName.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_changeColumnType.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_changeMinMax.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_connectView.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_contrast.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_countComputing.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createBuffersWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createCells.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createLayerFromTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createProxMatrix.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createTextRepresentation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createThemeFromTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_database.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_databaseProp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_display.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_displaySize.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_exportLayersThemes.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_exportWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_generateSamplePoints.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geographicalGrid.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpAdd.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpAggregation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpAssignDataLocationCollect.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpAssignDataLocationDistribute.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpOverlayDifference.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpOverlayIntersection.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpOverlayUnion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_graphic.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_graphic3DWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_graphicConfigurationWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_graphicParams.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_histogramBuildForm.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_import.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_importRasterSimple.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_importTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_importTablePoints.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_importTbl.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_importTblPoints.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_insertPoint.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_insertSymbol.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_insertText.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_kernelRatioWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_kernelWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_layerProp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_lbsDefinition.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_legendWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_linkExtTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_localBayesWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_pieBarChart.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_printFileResolution.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_projection.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_query.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_rasterColorCompositionWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_rasterImportWizard.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_rasterSlicingWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_rasterTransparency.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_removeTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_saveAndLoadColorBarWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_saveAsTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_saveRaster.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_saveTableAsTxt.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_saveThemeToFileWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_selectProxMatrix.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_selectTextRepresentation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_selThemeTables.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_semivar.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_skaterWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_spatializationWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_spatialQuery.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_statistic.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_tableProp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_telayer_metadata.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_TeQtMethods.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_TeQtTerraStat.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_terraView.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_terraViewBase.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_textRep.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_themeProp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_themeVis.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_viewProp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_visual.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated UI Files"
+			Filter="cpp;c;cxx;h;hpp;hxx;">
+			<File
+				RelativePath="..\..\..\ui\terraView\addColumn.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addColumn.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressChoiceWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressChoiceWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressLocatorWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressLocatorWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressNameSeparator.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressNameSeparator.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addTheme.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addView.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addView.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\anaesp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\anaesp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\bayesWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\bayesWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColData.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColData.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColumnName.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColumnName.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColumnType.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColumnType.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeMinMax.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeMinMax.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\connectView.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\connectView.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\contrast.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\contrast.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\countComputing.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\countComputing.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createBuffersWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createBuffersWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createCells.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createCells.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createLayerFromTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createLayerFromTheme.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createProxMatrix.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createProxMatrix.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createTable.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createTextRepresentation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createTextRepresentation.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createThemeFromTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createThemeFromTheme.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\database.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\database.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\databaseProp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\databaseProp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\display.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\display.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\displaySize.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\displaySize.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\exportLayersThemes.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\exportLayersThemes.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\exportWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\exportWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\generateSamplePoints.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\generateSamplePoints.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geographicalGrid.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geographicalGrid.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAdd.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAdd.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAggregation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAggregation.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAssignDataLocationCollect.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayDifference.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayDifference.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayIntersection.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayIntersection.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayUnion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayUnion.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphic.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphic.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphic3DWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphic3DWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphicConfigurationWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphicConfigurationWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphicParams.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphicParams.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\histogramBuildForm.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\histogramBuildForm.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\import.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\import.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importRasterSimple.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importRasterSimple.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTable.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTablePoints.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTablePoints.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTbl.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTbl.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTblPoints.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTblPoints.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertPoint.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertPoint.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertSymbol.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertSymbol.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertText.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertText.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\kernelRatioWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\kernelRatioWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\kernelWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\kernelWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\layerProp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\layerProp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\lbsDefinition.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\lbsDefinition.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\legendWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\legendWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\linkExtTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\linkExtTable.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\localBayesWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\localBayesWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\pieBarChart.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\pieBarChart.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\printFileResolution.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\printFileResolution.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\projection.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\projection.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\query.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\query.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterColorCompositionWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterColorCompositionWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterImportWizard.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterImportWizard.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterSlicingWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterSlicingWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterTransparency.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterTransparency.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\removeTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\removeTable.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveAndLoadColorBarWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveAndLoadColorBarWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveAsTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveAsTable.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveRaster.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveRaster.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveTableAsTxt.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveTableAsTxt.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveThemeToFileWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveThemeToFileWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selectProxMatrix.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selectProxMatrix.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selectTextRepresentation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selectTextRepresentation.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selThemeTables.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selThemeTables.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\semivar.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\semivar.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\skaterWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\skaterWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\spatializationWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\spatializationWindow.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\spatialQuery.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\spatialQuery.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\statistic.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\statistic.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\tableProp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\tableProp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\telayer_metadata.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\telayer_metadata.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\terraViewBase.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\terraViewBase.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\textRep.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\textRep.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\themeProp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\themeProp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\themeVis.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\themeVis.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\viewProp.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\viewProp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\visual.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\visual.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Forms"
+			Filter="ui"
+			ParseFiles="FALSE">
+			<File
+				RelativePath="..\..\..\terraView\ui\addColumn.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addColumn.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addColumn.ui -o ..\..\..\ui\terraView\addColumn.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addColumn.ui -i addColumn.h -o ..\..\..\ui\terraView\addColumn.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addColumn.h -o ..\..\..\moc\terraView\moc_addColumn.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addColumn.h;..\..\..\ui\terraView\addColumn.cpp;..\..\..\moc\terraView\moc_addColumn.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addColumn.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addColumn.ui -o ..\..\..\ui\terraView\addColumn.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addColumn.ui -i addColumn.h -o ..\..\..\ui\terraView\addColumn.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addColumn.h -o ..\..\..\moc\terraView\moc_addColumn.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addColumn.h;..\..\..\ui\terraView\addColumn.cpp;..\..\..\moc\terraView\moc_addColumn.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressChoiceWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressChoiceWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressChoiceWindow.ui -o ..\..\..\ui\terraView\addressChoiceWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressChoiceWindow.ui -i addressChoiceWindow.h -o ..\..\..\ui\terraView\addressChoiceWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressChoiceWindow.h -o ..\..\..\moc\terraView\moc_addressChoiceWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressChoiceWindow.h;..\..\..\ui\terraView\addressChoiceWindow.cpp;..\..\..\moc\terraView\moc_addressChoiceWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressChoiceWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressChoiceWindow.ui -o ..\..\..\ui\terraView\addressChoiceWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressChoiceWindow.ui -i addressChoiceWindow.h -o ..\..\..\ui\terraView\addressChoiceWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressChoiceWindow.h -o ..\..\..\moc\terraView\moc_addressChoiceWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressChoiceWindow.h;..\..\..\ui\terraView\addressChoiceWindow.cpp;..\..\..\moc\terraView\moc_addressChoiceWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressLocatorWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressLocatorWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressLocatorWindow.ui -o ..\..\..\ui\terraView\addressLocatorWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressLocatorWindow.ui -i addressLocatorWindow.h -o ..\..\..\ui\terraView\addressLocatorWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressLocatorWindow.h -o ..\..\..\moc\terraView\moc_addressLocatorWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressLocatorWindow.h;..\..\..\ui\terraView\addressLocatorWindow.cpp;..\..\..\moc\terraView\moc_addressLocatorWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressLocatorWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressLocatorWindow.ui -o ..\..\..\ui\terraView\addressLocatorWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressLocatorWindow.ui -i addressLocatorWindow.h -o ..\..\..\ui\terraView\addressLocatorWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressLocatorWindow.h -o ..\..\..\moc\terraView\moc_addressLocatorWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressLocatorWindow.h;..\..\..\ui\terraView\addressLocatorWindow.cpp;..\..\..\moc\terraView\moc_addressLocatorWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressNameSeparator.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressNameSeparator.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressNameSeparator.ui -o ..\..\..\ui\terraView\addressNameSeparator.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressNameSeparator.ui -i addressNameSeparator.h -o ..\..\..\ui\terraView\addressNameSeparator.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressNameSeparator.h -o ..\..\..\moc\terraView\moc_addressNameSeparator.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressNameSeparator.h;..\..\..\ui\terraView\addressNameSeparator.cpp;..\..\..\moc\terraView\moc_addressNameSeparator.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressNameSeparator.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressNameSeparator.ui -o ..\..\..\ui\terraView\addressNameSeparator.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressNameSeparator.ui -i addressNameSeparator.h -o ..\..\..\ui\terraView\addressNameSeparator.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressNameSeparator.h -o ..\..\..\moc\terraView\moc_addressNameSeparator.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressNameSeparator.h;..\..\..\ui\terraView\addressNameSeparator.cpp;..\..\..\moc\terraView\moc_addressNameSeparator.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addTheme.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addTheme.ui -o ..\..\..\ui\terraView\addTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addTheme.ui -i addTheme.h -o ..\..\..\ui\terraView\addTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addTheme.h -o ..\..\..\moc\terraView\moc_addTheme.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addTheme.h;..\..\..\ui\terraView\addTheme.cpp;..\..\..\moc\terraView\moc_addTheme.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addTheme.ui -o ..\..\..\ui\terraView\addTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addTheme.ui -i addTheme.h -o ..\..\..\ui\terraView\addTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addTheme.h -o ..\..\..\moc\terraView\moc_addTheme.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addTheme.h;..\..\..\ui\terraView\addTheme.cpp;..\..\..\moc\terraView\moc_addTheme.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addView.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addView.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addView.ui -o ..\..\..\ui\terraView\addView.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addView.ui -i addView.h -o ..\..\..\ui\terraView\addView.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addView.h -o ..\..\..\moc\terraView\moc_addView.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addView.h;..\..\..\ui\terraView\addView.cpp;..\..\..\moc\terraView\moc_addView.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addView.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addView.ui -o ..\..\..\ui\terraView\addView.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addView.ui -i addView.h -o ..\..\..\ui\terraView\addView.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addView.h -o ..\..\..\moc\terraView\moc_addView.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addView.h;..\..\..\ui\terraView\addView.cpp;..\..\..\moc\terraView\moc_addView.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\anaesp.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\anaesp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\anaesp.ui -o ..\..\..\ui\terraView\anaesp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\anaesp.ui -i anaesp.h -o ..\..\..\ui\terraView\anaesp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\anaesp.h -o ..\..\..\moc\terraView\moc_anaesp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\anaesp.h;..\..\..\ui\terraView\anaesp.cpp;..\..\..\moc\terraView\moc_anaesp.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\anaesp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\anaesp.ui -o ..\..\..\ui\terraView\anaesp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\anaesp.ui -i anaesp.h -o ..\..\..\ui\terraView\anaesp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\anaesp.h -o ..\..\..\moc\terraView\moc_anaesp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\anaesp.h;..\..\..\ui\terraView\anaesp.cpp;..\..\..\moc\terraView\moc_anaesp.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\bayesWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\bayesWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\bayesWindow.ui -o ..\..\..\ui\terraView\bayesWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\bayesWindow.ui -i bayesWindow.h -o ..\..\..\ui\terraView\bayesWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\bayesWindow.h -o ..\..\..\moc\terraView\moc_bayesWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\bayesWindow.h;..\..\..\ui\terraView\bayesWindow.cpp;..\..\..\moc\terraView\moc_bayesWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\bayesWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\bayesWindow.ui -o ..\..\..\ui\terraView\bayesWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\bayesWindow.ui -i bayesWindow.h -o ..\..\..\ui\terraView\bayesWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\bayesWindow.h -o ..\..\..\moc\terraView\moc_bayesWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\bayesWindow.h;..\..\..\ui\terraView\bayesWindow.cpp;..\..\..\moc\terraView\moc_bayesWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColData.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColData.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColData.ui -o ..\..\..\ui\terraView\changeColData.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColData.ui -i changeColData.h -o ..\..\..\ui\terraView\changeColData.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColData.h -o ..\..\..\moc\terraView\moc_changeColData.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColData.h;..\..\..\ui\terraView\changeColData.cpp;..\..\..\moc\terraView\moc_changeColData.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColData.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColData.ui -o ..\..\..\ui\terraView\changeColData.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColData.ui -i changeColData.h -o ..\..\..\ui\terraView\changeColData.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColData.h -o ..\..\..\moc\terraView\moc_changeColData.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColData.h;..\..\..\ui\terraView\changeColData.cpp;..\..\..\moc\terraView\moc_changeColData.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColumnName.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColumnName.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnName.ui -o ..\..\..\ui\terraView\changeColumnName.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnName.ui -i changeColumnName.h -o ..\..\..\ui\terraView\changeColumnName.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColumnName.h -o ..\..\..\moc\terraView\moc_changeColumnName.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColumnName.h;..\..\..\ui\terraView\changeColumnName.cpp;..\..\..\moc\terraView\moc_changeColumnName.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColumnName.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnName.ui -o ..\..\..\ui\terraView\changeColumnName.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnName.ui -i changeColumnName.h -o ..\..\..\ui\terraView\changeColumnName.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColumnName.h -o ..\..\..\moc\terraView\moc_changeColumnName.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColumnName.h;..\..\..\ui\terraView\changeColumnName.cpp;..\..\..\moc\terraView\moc_changeColumnName.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColumnType.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColumnType.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnType.ui -o ..\..\..\ui\terraView\changeColumnType.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnType.ui -i changeColumnType.h -o ..\..\..\ui\terraView\changeColumnType.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColumnType.h -o ..\..\..\moc\terraView\moc_changeColumnType.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColumnType.h;..\..\..\ui\terraView\changeColumnType.cpp;..\..\..\moc\terraView\moc_changeColumnType.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColumnType.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnType.ui -o ..\..\..\ui\terraView\changeColumnType.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnType.ui -i changeColumnType.h -o ..\..\..\ui\terraView\changeColumnType.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColumnType.h -o ..\..\..\moc\terraView\moc_changeColumnType.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColumnType.h;..\..\..\ui\terraView\changeColumnType.cpp;..\..\..\moc\terraView\moc_changeColumnType.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeMinMax.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeMinMax.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeMinMax.ui -o ..\..\..\ui\terraView\changeMinMax.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeMinMax.ui -i changeMinMax.h -o ..\..\..\ui\terraView\changeMinMax.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeMinMax.h -o ..\..\..\moc\terraView\moc_changeMinMax.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeMinMax.h;..\..\..\ui\terraView\changeMinMax.cpp;..\..\..\moc\terraView\moc_changeMinMax.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeMinMax.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeMinMax.ui -o ..\..\..\ui\terraView\changeMinMax.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeMinMax.ui -i changeMinMax.h -o ..\..\..\ui\terraView\changeMinMax.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeMinMax.h -o ..\..\..\moc\terraView\moc_changeMinMax.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeMinMax.h;..\..\..\ui\terraView\changeMinMax.cpp;..\..\..\moc\terraView\moc_changeMinMax.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\connectView.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\connectView.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\connectView.ui -o ..\..\..\ui\terraView\connectView.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\connectView.ui -i connectView.h -o ..\..\..\ui\terraView\connectView.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\connectView.h -o ..\..\..\moc\terraView\moc_connectView.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\connectView.h;..\..\..\ui\terraView\connectView.cpp;..\..\..\moc\terraView\moc_connectView.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\connectView.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\connectView.ui -o ..\..\..\ui\terraView\connectView.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\connectView.ui -i connectView.h -o ..\..\..\ui\terraView\connectView.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\connectView.h -o ..\..\..\moc\terraView\moc_connectView.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\connectView.h;..\..\..\ui\terraView\connectView.cpp;..\..\..\moc\terraView\moc_connectView.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\contrast.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\contrast.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\contrast.ui -o ..\..\..\ui\terraView\contrast.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\contrast.ui -i contrast.h -o ..\..\..\ui\terraView\contrast.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\contrast.h -o ..\..\..\moc\terraView\moc_contrast.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\contrast.h;..\..\..\ui\terraView\contrast.cpp;..\..\..\moc\terraView\moc_contrast.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\contrast.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\contrast.ui -o ..\..\..\ui\terraView\contrast.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\contrast.ui -i contrast.h -o ..\..\..\ui\terraView\contrast.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\contrast.h -o ..\..\..\moc\terraView\moc_contrast.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\contrast.h;..\..\..\ui\terraView\contrast.cpp;..\..\..\moc\terraView\moc_contrast.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\countComputing.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\countComputing.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\countComputing.ui -o ..\..\..\ui\terraView\countComputing.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\countComputing.ui -i countComputing.h -o ..\..\..\ui\terraView\countComputing.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\countComputing.h -o ..\..\..\moc\terraView\moc_countComputing.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\countComputing.h;..\..\..\ui\terraView\countComputing.cpp;..\..\..\moc\terraView\moc_countComputing.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\countComputing.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\countComputing.ui -o ..\..\..\ui\terraView\countComputing.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\countComputing.ui -i countComputing.h -o ..\..\..\ui\terraView\countComputing.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\countComputing.h -o ..\..\..\moc\terraView\moc_countComputing.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\countComputing.h;..\..\..\ui\terraView\countComputing.cpp;..\..\..\moc\terraView\moc_countComputing.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createBuffersWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createBuffersWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createBuffersWindow.ui -o ..\..\..\ui\terraView\createBuffersWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createBuffersWindow.ui -i createBuffersWindow.h -o ..\..\..\ui\terraView\createBuffersWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createBuffersWindow.h -o ..\..\..\moc\terraView\moc_createBuffersWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createBuffersWindow.h;..\..\..\ui\terraView\createBuffersWindow.cpp;..\..\..\moc\terraView\moc_createBuffersWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createBuffersWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createBuffersWindow.ui -o ..\..\..\ui\terraView\createBuffersWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createBuffersWindow.ui -i createBuffersWindow.h -o ..\..\..\ui\terraView\createBuffersWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createBuffersWindow.h -o ..\..\..\moc\terraView\moc_createBuffersWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createBuffersWindow.h;..\..\..\ui\terraView\createBuffersWindow.cpp;..\..\..\moc\terraView\moc_createBuffersWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createCells.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createCells.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createCells.ui -o ..\..\..\ui\terraView\createCells.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createCells.ui -i createCells.h -o ..\..\..\ui\terraView\createCells.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createCells.h -o ..\..\..\moc\terraView\moc_createCells.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createCells.h;..\..\..\ui\terraView\createCells.cpp;..\..\..\moc\terraView\moc_createCells.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createCells.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createCells.ui -o ..\..\..\ui\terraView\createCells.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createCells.ui -i createCells.h -o ..\..\..\ui\terraView\createCells.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createCells.h -o ..\..\..\moc\terraView\moc_createCells.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createCells.h;..\..\..\ui\terraView\createCells.cpp;..\..\..\moc\terraView\moc_createCells.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createLayerFromTheme.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createLayerFromTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createLayerFromTheme.ui -o ..\..\..\ui\terraView\createLayerFromTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createLayerFromTheme.ui -i createLayerFromTheme.h -o ..\..\..\ui\terraView\createLayerFromTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createLayerFromTheme.h -o ..\..\..\moc\terraView\moc_createLayerFromTheme.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createLayerFromTheme.h;..\..\..\ui\terraView\createLayerFromTheme.cpp;..\..\..\moc\terraView\moc_createLayerFromTheme.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createLayerFromTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createLayerFromTheme.ui -o ..\..\..\ui\terraView\createLayerFromTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createLayerFromTheme.ui -i createLayerFromTheme.h -o ..\..\..\ui\terraView\createLayerFromTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createLayerFromTheme.h -o ..\..\..\moc\terraView\moc_createLayerFromTheme.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createLayerFromTheme.h;..\..\..\ui\terraView\createLayerFromTheme.cpp;..\..\..\moc\terraView\moc_createLayerFromTheme.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createProxMatrix.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createProxMatrix.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createProxMatrix.ui -o ..\..\..\ui\terraView\createProxMatrix.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createProxMatrix.ui -i createProxMatrix.h -o ..\..\..\ui\terraView\createProxMatrix.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createProxMatrix.h -o ..\..\..\moc\terraView\moc_createProxMatrix.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createProxMatrix.h;..\..\..\ui\terraView\createProxMatrix.cpp;..\..\..\moc\terraView\moc_createProxMatrix.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createProxMatrix.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createProxMatrix.ui -o ..\..\..\ui\terraView\createProxMatrix.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createProxMatrix.ui -i createProxMatrix.h -o ..\..\..\ui\terraView\createProxMatrix.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createProxMatrix.h -o ..\..\..\moc\terraView\moc_createProxMatrix.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createProxMatrix.h;..\..\..\ui\terraView\createProxMatrix.cpp;..\..\..\moc\terraView\moc_createProxMatrix.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createTable.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTable.ui -o ..\..\..\ui\terraView\createTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTable.ui -i createTable.h -o ..\..\..\ui\terraView\createTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createTable.h -o ..\..\..\moc\terraView\moc_createTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createTable.h;..\..\..\ui\terraView\createTable.cpp;..\..\..\moc\terraView\moc_createTable.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTable.ui -o ..\..\..\ui\terraView\createTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTable.ui -i createTable.h -o ..\..\..\ui\terraView\createTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createTable.h -o ..\..\..\moc\terraView\moc_createTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createTable.h;..\..\..\ui\terraView\createTable.cpp;..\..\..\moc\terraView\moc_createTable.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createTextRepresentation.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createTextRepresentation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTextRepresentation.ui -o ..\..\..\ui\terraView\createTextRepresentation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTextRepresentation.ui -i createTextRepresentation.h -o ..\..\..\ui\terraView\createTextRepresentation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createTextRepresentation.h -o ..\..\..\moc\terraView\moc_createTextRepresentation.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createTextRepresentation.h;..\..\..\ui\terraView\createTextRepresentation.cpp;..\..\..\moc\terraView\moc_createTextRepresentation.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createTextRepresentation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTextRepresentation.ui -o ..\..\..\ui\terraView\createTextRepresentation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTextRepresentation.ui -i createTextRepresentation.h -o ..\..\..\ui\terraView\createTextRepresentation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createTextRepresentation.h -o ..\..\..\moc\terraView\moc_createTextRepresentation.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createTextRepresentation.h;..\..\..\ui\terraView\createTextRepresentation.cpp;..\..\..\moc\terraView\moc_createTextRepresentation.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createThemeFromTheme.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createThemeFromTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createThemeFromTheme.ui -o ..\..\..\ui\terraView\createThemeFromTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createThemeFromTheme.ui -i createThemeFromTheme.h -o ..\..\..\ui\terraView\createThemeFromTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createThemeFromTheme.h -o ..\..\..\moc\terraView\moc_createThemeFromTheme.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createThemeFromTheme.h;..\..\..\ui\terraView\createThemeFromTheme.cpp;..\..\..\moc\terraView\moc_createThemeFromTheme.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createThemeFromTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createThemeFromTheme.ui -o ..\..\..\ui\terraView\createThemeFromTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createThemeFromTheme.ui -i createThemeFromTheme.h -o ..\..\..\ui\terraView\createThemeFromTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createThemeFromTheme.h -o ..\..\..\moc\terraView\moc_createThemeFromTheme.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createThemeFromTheme.h;..\..\..\ui\terraView\createThemeFromTheme.cpp;..\..\..\moc\terraView\moc_createThemeFromTheme.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\database.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\database.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\database.ui -o ..\..\..\ui\terraView\database.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\database.ui -i database.h -o ..\..\..\ui\terraView\database.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\database.h -o ..\..\..\moc\terraView\moc_database.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\database.h;..\..\..\ui\terraView\database.cpp;..\..\..\moc\terraView\moc_database.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\database.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\database.ui -o ..\..\..\ui\terraView\database.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\database.ui -i database.h -o ..\..\..\ui\terraView\database.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\database.h -o ..\..\..\moc\terraView\moc_database.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\database.h;..\..\..\ui\terraView\database.cpp;..\..\..\moc\terraView\moc_database.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\databaseProp.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\databaseProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\databaseProp.ui -o ..\..\..\ui\terraView\databaseProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\databaseProp.ui -i databaseProp.h -o ..\..\..\ui\terraView\databaseProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\databaseProp.h -o ..\..\..\moc\terraView\moc_databaseProp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\databaseProp.h;..\..\..\ui\terraView\databaseProp.cpp;..\..\..\moc\terraView\moc_databaseProp.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\databaseProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\databaseProp.ui -o ..\..\..\ui\terraView\databaseProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\databaseProp.ui -i databaseProp.h -o ..\..\..\ui\terraView\databaseProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\databaseProp.h -o ..\..\..\moc\terraView\moc_databaseProp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\databaseProp.h;..\..\..\ui\terraView\databaseProp.cpp;..\..\..\moc\terraView\moc_databaseProp.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\display.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\display.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\display.ui -o ..\..\..\ui\terraView\display.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\display.ui -i display.h -o ..\..\..\ui\terraView\display.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\display.h -o ..\..\..\moc\terraView\moc_display.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\display.h;..\..\..\ui\terraView\display.cpp;..\..\..\moc\terraView\moc_display.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\display.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\display.ui -o ..\..\..\ui\terraView\display.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\display.ui -i display.h -o ..\..\..\ui\terraView\display.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\display.h -o ..\..\..\moc\terraView\moc_display.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\display.h;..\..\..\ui\terraView\display.cpp;..\..\..\moc\terraView\moc_display.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\displaySize.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\displaySize.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\displaySize.ui -o ..\..\..\ui\terraView\displaySize.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\displaySize.ui -i displaySize.h -o ..\..\..\ui\terraView\displaySize.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\displaySize.h -o ..\..\..\moc\terraView\moc_displaySize.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\displaySize.h;..\..\..\ui\terraView\displaySize.cpp;..\..\..\moc\terraView\moc_displaySize.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\displaySize.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\displaySize.ui -o ..\..\..\ui\terraView\displaySize.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\displaySize.ui -i displaySize.h -o ..\..\..\ui\terraView\displaySize.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\displaySize.h -o ..\..\..\moc\terraView\moc_displaySize.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\displaySize.h;..\..\..\ui\terraView\displaySize.cpp;..\..\..\moc\terraView\moc_displaySize.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\exportLayersThemes.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\exportLayersThemes.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportLayersThemes.ui -o ..\..\..\ui\terraView\exportLayersThemes.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportLayersThemes.ui -i exportLayersThemes.h -o ..\..\..\ui\terraView\exportLayersThemes.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\exportLayersThemes.h -o ..\..\..\moc\terraView\moc_exportLayersThemes.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\exportLayersThemes.h;..\..\..\ui\terraView\exportLayersThemes.cpp;..\..\..\moc\terraView\moc_exportLayersThemes.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\exportLayersThemes.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportLayersThemes.ui -o ..\..\..\ui\terraView\exportLayersThemes.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportLayersThemes.ui -i exportLayersThemes.h -o ..\..\..\ui\terraView\exportLayersThemes.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\exportLayersThemes.h -o ..\..\..\moc\terraView\moc_exportLayersThemes.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\exportLayersThemes.h;..\..\..\ui\terraView\exportLayersThemes.cpp;..\..\..\moc\terraView\moc_exportLayersThemes.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\exportWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\exportWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportWindow.ui -o ..\..\..\ui\terraView\exportWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportWindow.ui -i exportWindow.h -o ..\..\..\ui\terraView\exportWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\exportWindow.h -o ..\..\..\moc\terraView\moc_exportWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\exportWindow.h;..\..\..\ui\terraView\exportWindow.cpp;..\..\..\moc\terraView\moc_exportWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\exportWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportWindow.ui -o ..\..\..\ui\terraView\exportWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportWindow.ui -i exportWindow.h -o ..\..\..\ui\terraView\exportWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\exportWindow.h -o ..\..\..\moc\terraView\moc_exportWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\exportWindow.h;..\..\..\ui\terraView\exportWindow.cpp;..\..\..\moc\terraView\moc_exportWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\generateSamplePoints.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\generateSamplePoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\generateSamplePoints.ui -o ..\..\..\ui\terraView\generateSamplePoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\generateSamplePoints.ui -i generateSamplePoints.h -o ..\..\..\ui\terraView\generateSamplePoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\generateSamplePoints.h -o ..\..\..\moc\terraView\moc_generateSamplePoints.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\generateSamplePoints.h;..\..\..\ui\terraView\generateSamplePoints.cpp;..\..\..\moc\terraView\moc_generateSamplePoints.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\generateSamplePoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\generateSamplePoints.ui -o ..\..\..\ui\terraView\generateSamplePoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\generateSamplePoints.ui -i generateSamplePoints.h -o ..\..\..\ui\terraView\generateSamplePoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\generateSamplePoints.h -o ..\..\..\moc\terraView\moc_generateSamplePoints.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\generateSamplePoints.h;..\..\..\ui\terraView\generateSamplePoints.cpp;..\..\..\moc\terraView\moc_generateSamplePoints.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geographicalGrid.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geographicalGrid.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geographicalGrid.ui -o ..\..\..\ui\terraView\geographicalGrid.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geographicalGrid.ui -i geographicalGrid.h -o ..\..\..\ui\terraView\geographicalGrid.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geographicalGrid.h -o ..\..\..\moc\terraView\moc_geographicalGrid.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geographicalGrid.h;..\..\..\ui\terraView\geographicalGrid.cpp;..\..\..\moc\terraView\moc_geographicalGrid.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geographicalGrid.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geographicalGrid.ui -o ..\..\..\ui\terraView\geographicalGrid.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geographicalGrid.ui -i geographicalGrid.h -o ..\..\..\ui\terraView\geographicalGrid.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geographicalGrid.h -o ..\..\..\moc\terraView\moc_geographicalGrid.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geographicalGrid.h;..\..\..\ui\terraView\geographicalGrid.cpp;..\..\..\moc\terraView\moc_geographicalGrid.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAdd.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAdd.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAdd.ui -o ..\..\..\ui\terraView\geoOpAdd.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAdd.ui -i geoOpAdd.h -o ..\..\..\ui\terraView\geoOpAdd.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAdd.h -o ..\..\..\moc\terraView\moc_geoOpAdd.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAdd.h;..\..\..\ui\terraView\geoOpAdd.cpp;..\..\..\moc\terraView\moc_geoOpAdd.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAdd.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAdd.ui -o ..\..\..\ui\terraView\geoOpAdd.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAdd.ui -i geoOpAdd.h -o ..\..\..\ui\terraView\geoOpAdd.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAdd.h -o ..\..\..\moc\terraView\moc_geoOpAdd.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAdd.h;..\..\..\ui\terraView\geoOpAdd.cpp;..\..\..\moc\terraView\moc_geoOpAdd.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAggregation.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAggregation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAggregation.ui -o ..\..\..\ui\terraView\geoOpAggregation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAggregation.ui -i geoOpAggregation.h -o ..\..\..\ui\terraView\geoOpAggregation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAggregation.h -o ..\..\..\moc\terraView\moc_geoOpAggregation.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAggregation.h;..\..\..\ui\terraView\geoOpAggregation.cpp;..\..\..\moc\terraView\moc_geoOpAggregation.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAggregation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAggregation.ui -o ..\..\..\ui\terraView\geoOpAggregation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAggregation.ui -i geoOpAggregation.h -o ..\..\..\ui\terraView\geoOpAggregation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAggregation.h -o ..\..\..\moc\terraView\moc_geoOpAggregation.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAggregation.h;..\..\..\ui\terraView\geoOpAggregation.cpp;..\..\..\moc\terraView\moc_geoOpAggregation.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui -o ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui -i geoOpAssignDataLocationCollect.h -o ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h -o ..\..\..\moc\terraView\moc_geoOpAssignDataLocationCollect.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h;..\..\..\ui\terraView\geoOpAssignDataLocationCollect.cpp;..\..\..\moc\terraView\moc_geoOpAssignDataLocationCollect.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui -o ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui -i geoOpAssignDataLocationCollect.h -o ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h -o ..\..\..\moc\terraView\moc_geoOpAssignDataLocationCollect.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h;..\..\..\ui\terraView\geoOpAssignDataLocationCollect.cpp;..\..\..\moc\terraView\moc_geoOpAssignDataLocationCollect.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui -o ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui -i geoOpAssignDataLocationDistribute.h -o ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h -o ..\..\..\moc\terraView\moc_geoOpAssignDataLoca [...]
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h;..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.cpp;..\..\..\moc\terraView\moc_geoOpAssignDataLocationDistribute.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui -o ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui -i geoOpAssignDataLocationDistribute.h -o ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h -o ..\..\..\moc\terraView\moc_geoOpAssignDataLoca [...]
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h;..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.cpp;..\..\..\moc\terraView\moc_geoOpAssignDataLocationDistribute.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayDifference.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayDifference.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayDifference.ui -o ..\..\..\ui\terraView\geoOpOverlayDifference.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayDifference.ui -i geoOpOverlayDifference.h -o ..\..\..\ui\terraView\geoOpOverlayDifference.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayDifference.h -o ..\..\..\moc\terraView\moc_geoOpOverlayDifference.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayDifference.h;..\..\..\ui\terraView\geoOpOverlayDifference.cpp;..\..\..\moc\terraView\moc_geoOpOverlayDifference.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayDifference.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayDifference.ui -o ..\..\..\ui\terraView\geoOpOverlayDifference.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayDifference.ui -i geoOpOverlayDifference.h -o ..\..\..\ui\terraView\geoOpOverlayDifference.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayDifference.h -o ..\..\..\moc\terraView\moc_geoOpOverlayDifference.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayDifference.h;..\..\..\ui\terraView\geoOpOverlayDifference.cpp;..\..\..\moc\terraView\moc_geoOpOverlayDifference.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayIntersection.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayIntersection.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayIntersection.ui -o ..\..\..\ui\terraView\geoOpOverlayIntersection.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayIntersection.ui -i geoOpOverlayIntersection.h -o ..\..\..\ui\terraView\geoOpOverlayIntersection.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayIntersection.h -o ..\..\..\moc\terraView\moc_geoOpOverlayIntersection.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayIntersection.h;..\..\..\ui\terraView\geoOpOverlayIntersection.cpp;..\..\..\moc\terraView\moc_geoOpOverlayIntersection.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayIntersection.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayIntersection.ui -o ..\..\..\ui\terraView\geoOpOverlayIntersection.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayIntersection.ui -i geoOpOverlayIntersection.h -o ..\..\..\ui\terraView\geoOpOverlayIntersection.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayIntersection.h -o ..\..\..\moc\terraView\moc_geoOpOverlayIntersection.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayIntersection.h;..\..\..\ui\terraView\geoOpOverlayIntersection.cpp;..\..\..\moc\terraView\moc_geoOpOverlayIntersection.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayUnion.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayUnion.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayUnion.ui -o ..\..\..\ui\terraView\geoOpOverlayUnion.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayUnion.ui -i geoOpOverlayUnion.h -o ..\..\..\ui\terraView\geoOpOverlayUnion.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayUnion.h -o ..\..\..\moc\terraView\moc_geoOpOverlayUnion.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayUnion.h;..\..\..\ui\terraView\geoOpOverlayUnion.cpp;..\..\..\moc\terraView\moc_geoOpOverlayUnion.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayUnion.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayUnion.ui -o ..\..\..\ui\terraView\geoOpOverlayUnion.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayUnion.ui -i geoOpOverlayUnion.h -o ..\..\..\ui\terraView\geoOpOverlayUnion.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayUnion.h -o ..\..\..\moc\terraView\moc_geoOpOverlayUnion.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayUnion.h;..\..\..\ui\terraView\geoOpOverlayUnion.cpp;..\..\..\moc\terraView\moc_geoOpOverlayUnion.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphic.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphic.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic.ui -o ..\..\..\ui\terraView\graphic.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic.ui -i graphic.h -o ..\..\..\ui\terraView\graphic.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphic.h -o ..\..\..\moc\terraView\moc_graphic.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphic.h;..\..\..\ui\terraView\graphic.cpp;..\..\..\moc\terraView\moc_graphic.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphic.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic.ui -o ..\..\..\ui\terraView\graphic.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic.ui -i graphic.h -o ..\..\..\ui\terraView\graphic.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphic.h -o ..\..\..\moc\terraView\moc_graphic.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphic.h;..\..\..\ui\terraView\graphic.cpp;..\..\..\moc\terraView\moc_graphic.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphic3DWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphic3DWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic3DWindow.ui -o ..\..\..\ui\terraView\graphic3DWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic3DWindow.ui -i graphic3DWindow.h -o ..\..\..\ui\terraView\graphic3DWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphic3DWindow.h -o ..\..\..\moc\terraView\moc_graphic3DWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphic3DWindow.h;..\..\..\ui\terraView\graphic3DWindow.cpp;..\..\..\moc\terraView\moc_graphic3DWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphic3DWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic3DWindow.ui -o ..\..\..\ui\terraView\graphic3DWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic3DWindow.ui -i graphic3DWindow.h -o ..\..\..\ui\terraView\graphic3DWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphic3DWindow.h -o ..\..\..\moc\terraView\moc_graphic3DWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphic3DWindow.h;..\..\..\ui\terraView\graphic3DWindow.cpp;..\..\..\moc\terraView\moc_graphic3DWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphicConfigurationWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphicConfigurationWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicConfigurationWindow.ui -o ..\..\..\ui\terraView\graphicConfigurationWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicConfigurationWindow.ui -i graphicConfigurationWindow.h -o ..\..\..\ui\terraView\graphicConfigurationWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphicConfigurationWindow.h -o ..\..\..\moc\terraView\moc_graphicConfigurationWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphicConfigurationWindow.h;..\..\..\ui\terraView\graphicConfigurationWindow.cpp;..\..\..\moc\terraView\moc_graphicConfigurationWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphicConfigurationWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicConfigurationWindow.ui -o ..\..\..\ui\terraView\graphicConfigurationWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicConfigurationWindow.ui -i graphicConfigurationWindow.h -o ..\..\..\ui\terraView\graphicConfigurationWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphicConfigurationWindow.h -o ..\..\..\moc\terraView\moc_graphicConfigurationWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphicConfigurationWindow.h;..\..\..\ui\terraView\graphicConfigurationWindow.cpp;..\..\..\moc\terraView\moc_graphicConfigurationWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphicParams.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphicParams.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicParams.ui -o ..\..\..\ui\terraView\graphicParams.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicParams.ui -i graphicParams.h -o ..\..\..\ui\terraView\graphicParams.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphicParams.h -o ..\..\..\moc\terraView\moc_graphicParams.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphicParams.h;..\..\..\ui\terraView\graphicParams.cpp;..\..\..\moc\terraView\moc_graphicParams.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphicParams.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicParams.ui -o ..\..\..\ui\terraView\graphicParams.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicParams.ui -i graphicParams.h -o ..\..\..\ui\terraView\graphicParams.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphicParams.h -o ..\..\..\moc\terraView\moc_graphicParams.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphicParams.h;..\..\..\ui\terraView\graphicParams.cpp;..\..\..\moc\terraView\moc_graphicParams.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\histogramBuildForm.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\histogramBuildForm.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\histogramBuildForm.ui -o ..\..\..\ui\terraView\histogramBuildForm.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\histogramBuildForm.ui -i histogramBuildForm.h -o ..\..\..\ui\terraView\histogramBuildForm.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\histogramBuildForm.h -o ..\..\..\moc\terraView\moc_histogramBuildForm.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\histogramBuildForm.h;..\..\..\ui\terraView\histogramBuildForm.cpp;..\..\..\moc\terraView\moc_histogramBuildForm.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\histogramBuildForm.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\histogramBuildForm.ui -o ..\..\..\ui\terraView\histogramBuildForm.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\histogramBuildForm.ui -i histogramBuildForm.h -o ..\..\..\ui\terraView\histogramBuildForm.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\histogramBuildForm.h -o ..\..\..\moc\terraView\moc_histogramBuildForm.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\histogramBuildForm.h;..\..\..\ui\terraView\histogramBuildForm.cpp;..\..\..\moc\terraView\moc_histogramBuildForm.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\import.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\import.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\import.ui -o ..\..\..\ui\terraView\import.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\import.ui -i import.h -o ..\..\..\ui\terraView\import.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\import.h -o ..\..\..\moc\terraView\moc_import.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\import.h;..\..\..\ui\terraView\import.cpp;..\..\..\moc\terraView\moc_import.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\import.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\import.ui -o ..\..\..\ui\terraView\import.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\import.ui -i import.h -o ..\..\..\ui\terraView\import.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\import.h -o ..\..\..\moc\terraView\moc_import.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\import.h;..\..\..\ui\terraView\import.cpp;..\..\..\moc\terraView\moc_import.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importRasterSimple.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importRasterSimple.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importRasterSimple.ui -o ..\..\..\ui\terraView\importRasterSimple.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importRasterSimple.ui -i importRasterSimple.h -o ..\..\..\ui\terraView\importRasterSimple.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importRasterSimple.h -o ..\..\..\moc\terraView\moc_importRasterSimple.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importRasterSimple.h;..\..\..\ui\terraView\importRasterSimple.cpp;..\..\..\moc\terraView\moc_importRasterSimple.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importRasterSimple.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importRasterSimple.ui -o ..\..\..\ui\terraView\importRasterSimple.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importRasterSimple.ui -i importRasterSimple.h -o ..\..\..\ui\terraView\importRasterSimple.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importRasterSimple.h -o ..\..\..\moc\terraView\moc_importRasterSimple.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importRasterSimple.h;..\..\..\ui\terraView\importRasterSimple.cpp;..\..\..\moc\terraView\moc_importRasterSimple.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTable.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTable.ui -o ..\..\..\ui\terraView\importTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTable.ui -i importTable.h -o ..\..\..\ui\terraView\importTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTable.h -o ..\..\..\moc\terraView\moc_importTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTable.h;..\..\..\ui\terraView\importTable.cpp;..\..\..\moc\terraView\moc_importTable.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTable.ui -o ..\..\..\ui\terraView\importTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTable.ui -i importTable.h -o ..\..\..\ui\terraView\importTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTable.h -o ..\..\..\moc\terraView\moc_importTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTable.h;..\..\..\ui\terraView\importTable.cpp;..\..\..\moc\terraView\moc_importTable.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTablePoints.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTablePoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTablePoints.ui -o ..\..\..\ui\terraView\importTablePoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTablePoints.ui -i importTablePoints.h -o ..\..\..\ui\terraView\importTablePoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTablePoints.h -o ..\..\..\moc\terraView\moc_importTablePoints.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTablePoints.h;..\..\..\ui\terraView\importTablePoints.cpp;..\..\..\moc\terraView\moc_importTablePoints.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTablePoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTablePoints.ui -o ..\..\..\ui\terraView\importTablePoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTablePoints.ui -i importTablePoints.h -o ..\..\..\ui\terraView\importTablePoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTablePoints.h -o ..\..\..\moc\terraView\moc_importTablePoints.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTablePoints.h;..\..\..\ui\terraView\importTablePoints.cpp;..\..\..\moc\terraView\moc_importTablePoints.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTbl.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTbl.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTbl.ui -o ..\..\..\ui\terraView\importTbl.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTbl.ui -i importTbl.h -o ..\..\..\ui\terraView\importTbl.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTbl.h -o ..\..\..\moc\terraView\moc_importTbl.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTbl.h;..\..\..\ui\terraView\importTbl.cpp;..\..\..\moc\terraView\moc_importTbl.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTbl.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTbl.ui -o ..\..\..\ui\terraView\importTbl.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTbl.ui -i importTbl.h -o ..\..\..\ui\terraView\importTbl.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTbl.h -o ..\..\..\moc\terraView\moc_importTbl.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTbl.h;..\..\..\ui\terraView\importTbl.cpp;..\..\..\moc\terraView\moc_importTbl.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTblPoints.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTblPoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTblPoints.ui -o ..\..\..\ui\terraView\importTblPoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTblPoints.ui -i importTblPoints.h -o ..\..\..\ui\terraView\importTblPoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTblPoints.h -o ..\..\..\moc\terraView\moc_importTblPoints.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTblPoints.h;..\..\..\ui\terraView\importTblPoints.cpp;..\..\..\moc\terraView\moc_importTblPoints.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTblPoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTblPoints.ui -o ..\..\..\ui\terraView\importTblPoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTblPoints.ui -i importTblPoints.h -o ..\..\..\ui\terraView\importTblPoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTblPoints.h -o ..\..\..\moc\terraView\moc_importTblPoints.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTblPoints.h;..\..\..\ui\terraView\importTblPoints.cpp;..\..\..\moc\terraView\moc_importTblPoints.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertPoint.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertPoint.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertPoint.ui -o ..\..\..\ui\terraView\insertPoint.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertPoint.ui -i insertPoint.h -o ..\..\..\ui\terraView\insertPoint.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertPoint.h -o ..\..\..\moc\terraView\moc_insertPoint.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertPoint.h;..\..\..\ui\terraView\insertPoint.cpp;..\..\..\moc\terraView\moc_insertPoint.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertPoint.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertPoint.ui -o ..\..\..\ui\terraView\insertPoint.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertPoint.ui -i insertPoint.h -o ..\..\..\ui\terraView\insertPoint.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertPoint.h -o ..\..\..\moc\terraView\moc_insertPoint.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertPoint.h;..\..\..\ui\terraView\insertPoint.cpp;..\..\..\moc\terraView\moc_insertPoint.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertSymbol.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertSymbol.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertSymbol.ui -o ..\..\..\ui\terraView\insertSymbol.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertSymbol.ui -i insertSymbol.h -o ..\..\..\ui\terraView\insertSymbol.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertSymbol.h -o ..\..\..\moc\terraView\moc_insertSymbol.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertSymbol.h;..\..\..\ui\terraView\insertSymbol.cpp;..\..\..\moc\terraView\moc_insertSymbol.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertSymbol.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertSymbol.ui -o ..\..\..\ui\terraView\insertSymbol.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertSymbol.ui -i insertSymbol.h -o ..\..\..\ui\terraView\insertSymbol.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertSymbol.h -o ..\..\..\moc\terraView\moc_insertSymbol.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertSymbol.h;..\..\..\ui\terraView\insertSymbol.cpp;..\..\..\moc\terraView\moc_insertSymbol.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertText.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertText.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertText.ui -o ..\..\..\ui\terraView\insertText.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertText.ui -i insertText.h -o ..\..\..\ui\terraView\insertText.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertText.h -o ..\..\..\moc\terraView\moc_insertText.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertText.h;..\..\..\ui\terraView\insertText.cpp;..\..\..\moc\terraView\moc_insertText.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertText.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertText.ui -o ..\..\..\ui\terraView\insertText.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertText.ui -i insertText.h -o ..\..\..\ui\terraView\insertText.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertText.h -o ..\..\..\moc\terraView\moc_insertText.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertText.h;..\..\..\ui\terraView\insertText.cpp;..\..\..\moc\terraView\moc_insertText.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\kernelRatioWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\kernelRatioWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelRatioWindow.ui -o ..\..\..\ui\terraView\kernelRatioWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelRatioWindow.ui -i kernelRatioWindow.h -o ..\..\..\ui\terraView\kernelRatioWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\kernelRatioWindow.h -o ..\..\..\moc\terraView\moc_kernelRatioWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\kernelRatioWindow.h;..\..\..\ui\terraView\kernelRatioWindow.cpp;..\..\..\moc\terraView\moc_kernelRatioWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\kernelRatioWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelRatioWindow.ui -o ..\..\..\ui\terraView\kernelRatioWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelRatioWindow.ui -i kernelRatioWindow.h -o ..\..\..\ui\terraView\kernelRatioWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\kernelRatioWindow.h -o ..\..\..\moc\terraView\moc_kernelRatioWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\kernelRatioWindow.h;..\..\..\ui\terraView\kernelRatioWindow.cpp;..\..\..\moc\terraView\moc_kernelRatioWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\kernelWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\kernelWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelWindow.ui -o ..\..\..\ui\terraView\kernelWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelWindow.ui -i kernelWindow.h -o ..\..\..\ui\terraView\kernelWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\kernelWindow.h -o ..\..\..\moc\terraView\moc_kernelWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\kernelWindow.h;..\..\..\ui\terraView\kernelWindow.cpp;..\..\..\moc\terraView\moc_kernelWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\kernelWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelWindow.ui -o ..\..\..\ui\terraView\kernelWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelWindow.ui -i kernelWindow.h -o ..\..\..\ui\terraView\kernelWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\kernelWindow.h -o ..\..\..\moc\terraView\moc_kernelWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\kernelWindow.h;..\..\..\ui\terraView\kernelWindow.cpp;..\..\..\moc\terraView\moc_kernelWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\layerProp.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\layerProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\layerProp.ui -o ..\..\..\ui\terraView\layerProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\layerProp.ui -i layerProp.h -o ..\..\..\ui\terraView\layerProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\layerProp.h -o ..\..\..\moc\terraView\moc_layerProp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\layerProp.h;..\..\..\ui\terraView\layerProp.cpp;..\..\..\moc\terraView\moc_layerProp.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\layerProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\layerProp.ui -o ..\..\..\ui\terraView\layerProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\layerProp.ui -i layerProp.h -o ..\..\..\ui\terraView\layerProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\layerProp.h -o ..\..\..\moc\terraView\moc_layerProp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\layerProp.h;..\..\..\ui\terraView\layerProp.cpp;..\..\..\moc\terraView\moc_layerProp.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\lbsDefinition.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\lbsDefinition.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\lbsDefinition.ui -o ..\..\..\ui\terraView\lbsDefinition.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\lbsDefinition.ui -i lbsDefinition.h -o ..\..\..\ui\terraView\lbsDefinition.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\lbsDefinition.h -o ..\..\..\moc\terraView\moc_lbsDefinition.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\lbsDefinition.h;..\..\..\ui\terraView\lbsDefinition.cpp;..\..\..\moc\terraView\moc_lbsDefinition.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\lbsDefinition.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\lbsDefinition.ui -o ..\..\..\ui\terraView\lbsDefinition.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\lbsDefinition.ui -i lbsDefinition.h -o ..\..\..\ui\terraView\lbsDefinition.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\lbsDefinition.h -o ..\..\..\moc\terraView\moc_lbsDefinition.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\lbsDefinition.h;..\..\..\ui\terraView\lbsDefinition.cpp;..\..\..\moc\terraView\moc_lbsDefinition.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\legendWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\legendWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\legendWindow.ui -o ..\..\..\ui\terraView\legendWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\legendWindow.ui -i legendWindow.h -o ..\..\..\ui\terraView\legendWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\legendWindow.h -o ..\..\..\moc\terraView\moc_legendWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\legendWindow.h;..\..\..\ui\terraView\legendWindow.cpp;..\..\..\moc\terraView\moc_legendWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\legendWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\legendWindow.ui -o ..\..\..\ui\terraView\legendWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\legendWindow.ui -i legendWindow.h -o ..\..\..\ui\terraView\legendWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\legendWindow.h -o ..\..\..\moc\terraView\moc_legendWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\legendWindow.h;..\..\..\ui\terraView\legendWindow.cpp;..\..\..\moc\terraView\moc_legendWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\linkExtTable.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\linkExtTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\linkExtTable.ui -o ..\..\..\ui\terraView\linkExtTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\linkExtTable.ui -i linkExtTable.h -o ..\..\..\ui\terraView\linkExtTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\linkExtTable.h -o ..\..\..\moc\terraView\moc_linkExtTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\linkExtTable.h;..\..\..\ui\terraView\linkExtTable.cpp;..\..\..\moc\terraView\moc_linkExtTable.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\linkExtTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\linkExtTable.ui -o ..\..\..\ui\terraView\linkExtTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\linkExtTable.ui -i linkExtTable.h -o ..\..\..\ui\terraView\linkExtTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\linkExtTable.h -o ..\..\..\moc\terraView\moc_linkExtTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\linkExtTable.h;..\..\..\ui\terraView\linkExtTable.cpp;..\..\..\moc\terraView\moc_linkExtTable.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\localBayesWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\localBayesWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\localBayesWindow.ui -o ..\..\..\ui\terraView\localBayesWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\localBayesWindow.ui -i localBayesWindow.h -o ..\..\..\ui\terraView\localBayesWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\localBayesWindow.h -o ..\..\..\moc\terraView\moc_localBayesWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\localBayesWindow.h;..\..\..\ui\terraView\localBayesWindow.cpp;..\..\..\moc\terraView\moc_localBayesWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\localBayesWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\localBayesWindow.ui -o ..\..\..\ui\terraView\localBayesWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\localBayesWindow.ui -i localBayesWindow.h -o ..\..\..\ui\terraView\localBayesWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\localBayesWindow.h -o ..\..\..\moc\terraView\moc_localBayesWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\localBayesWindow.h;..\..\..\ui\terraView\localBayesWindow.cpp;..\..\..\moc\terraView\moc_localBayesWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\pieBarChart.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\pieBarChart.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\pieBarChart.ui -o ..\..\..\ui\terraView\pieBarChart.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\pieBarChart.ui -i pieBarChart.h -o ..\..\..\ui\terraView\pieBarChart.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\pieBarChart.h -o ..\..\..\moc\terraView\moc_pieBarChart.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\pieBarChart.h;..\..\..\ui\terraView\pieBarChart.cpp;..\..\..\moc\terraView\moc_pieBarChart.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\pieBarChart.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\pieBarChart.ui -o ..\..\..\ui\terraView\pieBarChart.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\pieBarChart.ui -i pieBarChart.h -o ..\..\..\ui\terraView\pieBarChart.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\pieBarChart.h -o ..\..\..\moc\terraView\moc_pieBarChart.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\pieBarChart.h;..\..\..\ui\terraView\pieBarChart.cpp;..\..\..\moc\terraView\moc_pieBarChart.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\printFileResolution.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\printFileResolution.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\printFileResolution.ui -o ..\..\..\ui\terraView\printFileResolution.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\printFileResolution.ui -i printFileResolution.h -o ..\..\..\ui\terraView\printFileResolution.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\printFileResolution.h -o ..\..\..\moc\terraView\moc_printFileResolution.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\printFileResolution.h;..\..\..\ui\terraView\printFileResolution.cpp;..\..\..\moc\terraView\moc_printFileResolution.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\printFileResolution.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\printFileResolution.ui -o ..\..\..\ui\terraView\printFileResolution.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\printFileResolution.ui -i printFileResolution.h -o ..\..\..\ui\terraView\printFileResolution.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\printFileResolution.h -o ..\..\..\moc\terraView\moc_printFileResolution.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\printFileResolution.h;..\..\..\ui\terraView\printFileResolution.cpp;..\..\..\moc\terraView\moc_printFileResolution.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\projection.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\projection.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\projection.ui -o ..\..\..\ui\terraView\projection.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\projection.ui -i projection.h -o ..\..\..\ui\terraView\projection.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\projection.h -o ..\..\..\moc\terraView\moc_projection.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\projection.h;..\..\..\ui\terraView\projection.cpp;..\..\..\moc\terraView\moc_projection.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\projection.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\projection.ui -o ..\..\..\ui\terraView\projection.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\projection.ui -i projection.h -o ..\..\..\ui\terraView\projection.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\projection.h -o ..\..\..\moc\terraView\moc_projection.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\projection.h;..\..\..\ui\terraView\projection.cpp;..\..\..\moc\terraView\moc_projection.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\query.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\query.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\query.ui -o ..\..\..\ui\terraView\query.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\query.ui -i query.h -o ..\..\..\ui\terraView\query.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\query.h -o ..\..\..\moc\terraView\moc_query.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\query.h;..\..\..\ui\terraView\query.cpp;..\..\..\moc\terraView\moc_query.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\query.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\query.ui -o ..\..\..\ui\terraView\query.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\query.ui -i query.h -o ..\..\..\ui\terraView\query.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\query.h -o ..\..\..\moc\terraView\moc_query.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\query.h;..\..\..\ui\terraView\query.cpp;..\..\..\moc\terraView\moc_query.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterColorCompositionWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterColorCompositionWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterColorCompositionWindow.ui -o ..\..\..\ui\terraView\rasterColorCompositionWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterColorCompositionWindow.ui -i rasterColorCompositionWindow.h -o ..\..\..\ui\terraView\rasterColorCompositionWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterColorCompositionWindow.h -o ..\..\..\moc\terraView\moc_rasterColorCompositionWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterColorCompositionWindow.h;..\..\..\ui\terraView\rasterColorCompositionWindow.cpp;..\..\..\moc\terraView\moc_rasterColorCompositionWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterColorCompositionWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterColorCompositionWindow.ui -o ..\..\..\ui\terraView\rasterColorCompositionWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterColorCompositionWindow.ui -i rasterColorCompositionWindow.h -o ..\..\..\ui\terraView\rasterColorCompositionWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterColorCompositionWindow.h -o ..\..\..\moc\terraView\moc_rasterColorCompositionWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterColorCompositionWindow.h;..\..\..\ui\terraView\rasterColorCompositionWindow.cpp;..\..\..\moc\terraView\moc_rasterColorCompositionWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterImportWizard.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterImportWizard.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterImportWizard.ui -o ..\..\..\ui\terraView\rasterImportWizard.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterImportWizard.ui -i rasterImportWizard.h -o ..\..\..\ui\terraView\rasterImportWizard.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterImportWizard.h -o ..\..\..\moc\terraView\moc_rasterImportWizard.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterImportWizard.h;..\..\..\ui\terraView\rasterImportWizard.cpp;..\..\..\moc\terraView\moc_rasterImportWizard.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterImportWizard.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterImportWizard.ui -o ..\..\..\ui\terraView\rasterImportWizard.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterImportWizard.ui -i rasterImportWizard.h -o ..\..\..\ui\terraView\rasterImportWizard.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterImportWizard.h -o ..\..\..\moc\terraView\moc_rasterImportWizard.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterImportWizard.h;..\..\..\ui\terraView\rasterImportWizard.cpp;..\..\..\moc\terraView\moc_rasterImportWizard.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterSlicingWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterSlicingWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterSlicingWindow.ui -o ..\..\..\ui\terraView\rasterSlicingWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterSlicingWindow.ui -i rasterSlicingWindow.h -o ..\..\..\ui\terraView\rasterSlicingWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterSlicingWindow.h -o ..\..\..\moc\terraView\moc_rasterSlicingWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterSlicingWindow.h;..\..\..\ui\terraView\rasterSlicingWindow.cpp;..\..\..\moc\terraView\moc_rasterSlicingWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterSlicingWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterSlicingWindow.ui -o ..\..\..\ui\terraView\rasterSlicingWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterSlicingWindow.ui -i rasterSlicingWindow.h -o ..\..\..\ui\terraView\rasterSlicingWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterSlicingWindow.h -o ..\..\..\moc\terraView\moc_rasterSlicingWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterSlicingWindow.h;..\..\..\ui\terraView\rasterSlicingWindow.cpp;..\..\..\moc\terraView\moc_rasterSlicingWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterTransparency.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterTransparency.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterTransparency.ui -o ..\..\..\ui\terraView\rasterTransparency.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterTransparency.ui -i rasterTransparency.h -o ..\..\..\ui\terraView\rasterTransparency.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterTransparency.h -o ..\..\..\moc\terraView\moc_rasterTransparency.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterTransparency.h;..\..\..\ui\terraView\rasterTransparency.cpp;..\..\..\moc\terraView\moc_rasterTransparency.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterTransparency.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterTransparency.ui -o ..\..\..\ui\terraView\rasterTransparency.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterTransparency.ui -i rasterTransparency.h -o ..\..\..\ui\terraView\rasterTransparency.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterTransparency.h -o ..\..\..\moc\terraView\moc_rasterTransparency.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterTransparency.h;..\..\..\ui\terraView\rasterTransparency.cpp;..\..\..\moc\terraView\moc_rasterTransparency.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\removeTable.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\removeTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\removeTable.ui -o ..\..\..\ui\terraView\removeTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\removeTable.ui -i removeTable.h -o ..\..\..\ui\terraView\removeTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\removeTable.h -o ..\..\..\moc\terraView\moc_removeTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\removeTable.h;..\..\..\ui\terraView\removeTable.cpp;..\..\..\moc\terraView\moc_removeTable.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\removeTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\removeTable.ui -o ..\..\..\ui\terraView\removeTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\removeTable.ui -i removeTable.h -o ..\..\..\ui\terraView\removeTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\removeTable.h -o ..\..\..\moc\terraView\moc_removeTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\removeTable.h;..\..\..\ui\terraView\removeTable.cpp;..\..\..\moc\terraView\moc_removeTable.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui -o ..\..\..\ui\terraView\saveAndLoadColorBarWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui -i saveAndLoadColorBarWindow.h -o ..\..\..\ui\terraView\saveAndLoadColorBarWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveAndLoadColorBarWindow.h -o ..\..\..\moc\terraView\moc_saveAndLoadColorBarWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveAndLoadColorBarWindow.h;..\..\..\ui\terraView\saveAndLoadColorBarWindow.cpp;..\..\..\moc\terraView\moc_saveAndLoadColorBarWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui -o ..\..\..\ui\terraView\saveAndLoadColorBarWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui -i saveAndLoadColorBarWindow.h -o ..\..\..\ui\terraView\saveAndLoadColorBarWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveAndLoadColorBarWindow.h -o ..\..\..\moc\terraView\moc_saveAndLoadColorBarWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveAndLoadColorBarWindow.h;..\..\..\ui\terraView\saveAndLoadColorBarWindow.cpp;..\..\..\moc\terraView\moc_saveAndLoadColorBarWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveAsTable.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveAsTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAsTable.ui -o ..\..\..\ui\terraView\saveAsTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAsTable.ui -i saveAsTable.h -o ..\..\..\ui\terraView\saveAsTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveAsTable.h -o ..\..\..\moc\terraView\moc_saveAsTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveAsTable.h;..\..\..\ui\terraView\saveAsTable.cpp;..\..\..\moc\terraView\moc_saveAsTable.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveAsTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAsTable.ui -o ..\..\..\ui\terraView\saveAsTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAsTable.ui -i saveAsTable.h -o ..\..\..\ui\terraView\saveAsTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveAsTable.h -o ..\..\..\moc\terraView\moc_saveAsTable.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveAsTable.h;..\..\..\ui\terraView\saveAsTable.cpp;..\..\..\moc\terraView\moc_saveAsTable.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveRaster.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveRaster.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveRaster.ui -o ..\..\..\ui\terraView\saveRaster.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveRaster.ui -i saveRaster.h -o ..\..\..\ui\terraView\saveRaster.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveRaster.h -o ..\..\..\moc\terraView\moc_saveRaster.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveRaster.h;..\..\..\ui\terraView\saveRaster.cpp;..\..\..\moc\terraView\moc_saveRaster.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveRaster.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveRaster.ui -o ..\..\..\ui\terraView\saveRaster.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveRaster.ui -i saveRaster.h -o ..\..\..\ui\terraView\saveRaster.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveRaster.h -o ..\..\..\moc\terraView\moc_saveRaster.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveRaster.h;..\..\..\ui\terraView\saveRaster.cpp;..\..\..\moc\terraView\moc_saveRaster.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveTableAsTxt.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveTableAsTxt.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveTableAsTxt.ui -o ..\..\..\ui\terraView\saveTableAsTxt.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveTableAsTxt.ui -i saveTableAsTxt.h -o ..\..\..\ui\terraView\saveTableAsTxt.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveTableAsTxt.h -o ..\..\..\moc\terraView\moc_saveTableAsTxt.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveTableAsTxt.h;..\..\..\ui\terraView\saveTableAsTxt.cpp;..\..\..\moc\terraView\moc_saveTableAsTxt.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveTableAsTxt.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveTableAsTxt.ui -o ..\..\..\ui\terraView\saveTableAsTxt.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveTableAsTxt.ui -i saveTableAsTxt.h -o ..\..\..\ui\terraView\saveTableAsTxt.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveTableAsTxt.h -o ..\..\..\moc\terraView\moc_saveTableAsTxt.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveTableAsTxt.h;..\..\..\ui\terraView\saveTableAsTxt.cpp;..\..\..\moc\terraView\moc_saveTableAsTxt.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveThemeToFileWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveThemeToFileWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveThemeToFileWindow.ui -o ..\..\..\ui\terraView\saveThemeToFileWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveThemeToFileWindow.ui -i saveThemeToFileWindow.h -o ..\..\..\ui\terraView\saveThemeToFileWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveThemeToFileWindow.h -o ..\..\..\moc\terraView\moc_saveThemeToFileWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveThemeToFileWindow.h;..\..\..\ui\terraView\saveThemeToFileWindow.cpp;..\..\..\moc\terraView\moc_saveThemeToFileWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveThemeToFileWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveThemeToFileWindow.ui -o ..\..\..\ui\terraView\saveThemeToFileWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveThemeToFileWindow.ui -i saveThemeToFileWindow.h -o ..\..\..\ui\terraView\saveThemeToFileWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveThemeToFileWindow.h -o ..\..\..\moc\terraView\moc_saveThemeToFileWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveThemeToFileWindow.h;..\..\..\ui\terraView\saveThemeToFileWindow.cpp;..\..\..\moc\terraView\moc_saveThemeToFileWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selectProxMatrix.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selectProxMatrix.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectProxMatrix.ui -o ..\..\..\ui\terraView\selectProxMatrix.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectProxMatrix.ui -i selectProxMatrix.h -o ..\..\..\ui\terraView\selectProxMatrix.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selectProxMatrix.h -o ..\..\..\moc\terraView\moc_selectProxMatrix.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selectProxMatrix.h;..\..\..\ui\terraView\selectProxMatrix.cpp;..\..\..\moc\terraView\moc_selectProxMatrix.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selectProxMatrix.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectProxMatrix.ui -o ..\..\..\ui\terraView\selectProxMatrix.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectProxMatrix.ui -i selectProxMatrix.h -o ..\..\..\ui\terraView\selectProxMatrix.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selectProxMatrix.h -o ..\..\..\moc\terraView\moc_selectProxMatrix.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selectProxMatrix.h;..\..\..\ui\terraView\selectProxMatrix.cpp;..\..\..\moc\terraView\moc_selectProxMatrix.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selectTextRepresentation.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selectTextRepresentation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectTextRepresentation.ui -o ..\..\..\ui\terraView\selectTextRepresentation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectTextRepresentation.ui -i selectTextRepresentation.h -o ..\..\..\ui\terraView\selectTextRepresentation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selectTextRepresentation.h -o ..\..\..\moc\terraView\moc_selectTextRepresentation.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selectTextRepresentation.h;..\..\..\ui\terraView\selectTextRepresentation.cpp;..\..\..\moc\terraView\moc_selectTextRepresentation.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selectTextRepresentation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectTextRepresentation.ui -o ..\..\..\ui\terraView\selectTextRepresentation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectTextRepresentation.ui -i selectTextRepresentation.h -o ..\..\..\ui\terraView\selectTextRepresentation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selectTextRepresentation.h -o ..\..\..\moc\terraView\moc_selectTextRepresentation.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selectTextRepresentation.h;..\..\..\ui\terraView\selectTextRepresentation.cpp;..\..\..\moc\terraView\moc_selectTextRepresentation.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selThemeTables.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selThemeTables.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selThemeTables.ui -o ..\..\..\ui\terraView\selThemeTables.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selThemeTables.ui -i selThemeTables.h -o ..\..\..\ui\terraView\selThemeTables.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selThemeTables.h -o ..\..\..\moc\terraView\moc_selThemeTables.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selThemeTables.h;..\..\..\ui\terraView\selThemeTables.cpp;..\..\..\moc\terraView\moc_selThemeTables.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selThemeTables.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selThemeTables.ui -o ..\..\..\ui\terraView\selThemeTables.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selThemeTables.ui -i selThemeTables.h -o ..\..\..\ui\terraView\selThemeTables.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selThemeTables.h -o ..\..\..\moc\terraView\moc_selThemeTables.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selThemeTables.h;..\..\..\ui\terraView\selThemeTables.cpp;..\..\..\moc\terraView\moc_selThemeTables.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\semivar.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\semivar.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\semivar.ui -o ..\..\..\ui\terraView\semivar.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\semivar.ui -i semivar.h -o ..\..\..\ui\terraView\semivar.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\semivar.h -o ..\..\..\moc\terraView\moc_semivar.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\semivar.h;..\..\..\ui\terraView\semivar.cpp;..\..\..\moc\terraView\moc_semivar.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\semivar.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\semivar.ui -o ..\..\..\ui\terraView\semivar.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\semivar.ui -i semivar.h -o ..\..\..\ui\terraView\semivar.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\semivar.h -o ..\..\..\moc\terraView\moc_semivar.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\semivar.h;..\..\..\ui\terraView\semivar.cpp;..\..\..\moc\terraView\moc_semivar.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\skaterWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\skaterWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\skaterWindow.ui -o ..\..\..\ui\terraView\skaterWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\skaterWindow.ui -i skaterWindow.h -o ..\..\..\ui\terraView\skaterWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\skaterWindow.h -o ..\..\..\moc\terraView\moc_skaterWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\skaterWindow.h;..\..\..\ui\terraView\skaterWindow.cpp;..\..\..\moc\terraView\moc_skaterWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\skaterWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\skaterWindow.ui -o ..\..\..\ui\terraView\skaterWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\skaterWindow.ui -i skaterWindow.h -o ..\..\..\ui\terraView\skaterWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\skaterWindow.h -o ..\..\..\moc\terraView\moc_skaterWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\skaterWindow.h;..\..\..\ui\terraView\skaterWindow.cpp;..\..\..\moc\terraView\moc_skaterWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\spatializationWindow.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\spatializationWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatializationWindow.ui -o ..\..\..\ui\terraView\spatializationWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatializationWindow.ui -i spatializationWindow.h -o ..\..\..\ui\terraView\spatializationWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\spatializationWindow.h -o ..\..\..\moc\terraView\moc_spatializationWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\spatializationWindow.h;..\..\..\ui\terraView\spatializationWindow.cpp;..\..\..\moc\terraView\moc_spatializationWindow.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\spatializationWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatializationWindow.ui -o ..\..\..\ui\terraView\spatializationWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatializationWindow.ui -i spatializationWindow.h -o ..\..\..\ui\terraView\spatializationWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\spatializationWindow.h -o ..\..\..\moc\terraView\moc_spatializationWindow.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\spatializationWindow.h;..\..\..\ui\terraView\spatializationWindow.cpp;..\..\..\moc\terraView\moc_spatializationWindow.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\spatialQuery.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\spatialQuery.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatialQuery.ui -o ..\..\..\ui\terraView\spatialQuery.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatialQuery.ui -i spatialQuery.h -o ..\..\..\ui\terraView\spatialQuery.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\spatialQuery.h -o ..\..\..\moc\terraView\moc_spatialQuery.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\spatialQuery.h;..\..\..\ui\terraView\spatialQuery.cpp;..\..\..\moc\terraView\moc_spatialQuery.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\spatialQuery.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatialQuery.ui -o ..\..\..\ui\terraView\spatialQuery.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatialQuery.ui -i spatialQuery.h -o ..\..\..\ui\terraView\spatialQuery.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\spatialQuery.h -o ..\..\..\moc\terraView\moc_spatialQuery.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\spatialQuery.h;..\..\..\ui\terraView\spatialQuery.cpp;..\..\..\moc\terraView\moc_spatialQuery.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\statistic.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\statistic.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\statistic.ui -o ..\..\..\ui\terraView\statistic.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\statistic.ui -i statistic.h -o ..\..\..\ui\terraView\statistic.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\statistic.h -o ..\..\..\moc\terraView\moc_statistic.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\statistic.h;..\..\..\ui\terraView\statistic.cpp;..\..\..\moc\terraView\moc_statistic.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\statistic.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\statistic.ui -o ..\..\..\ui\terraView\statistic.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\statistic.ui -i statistic.h -o ..\..\..\ui\terraView\statistic.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\statistic.h -o ..\..\..\moc\terraView\moc_statistic.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\statistic.h;..\..\..\ui\terraView\statistic.cpp;..\..\..\moc\terraView\moc_statistic.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\tableProp.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\tableProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\tableProp.ui -o ..\..\..\ui\terraView\tableProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\tableProp.ui -i tableProp.h -o ..\..\..\ui\terraView\tableProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\tableProp.h -o ..\..\..\moc\terraView\moc_tableProp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\tableProp.h;..\..\..\ui\terraView\tableProp.cpp;..\..\..\moc\terraView\moc_tableProp.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\tableProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\tableProp.ui -o ..\..\..\ui\terraView\tableProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\tableProp.ui -i tableProp.h -o ..\..\..\ui\terraView\tableProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\tableProp.h -o ..\..\..\moc\terraView\moc_tableProp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\tableProp.h;..\..\..\ui\terraView\tableProp.cpp;..\..\..\moc\terraView\moc_tableProp.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\telayer_metadata.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\telayer_metadata.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\telayer_metadata.ui -o ..\..\..\ui\terraView\telayer_metadata.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\telayer_metadata.ui -i telayer_metadata.h -o ..\..\..\ui\terraView\telayer_metadata.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\telayer_metadata.h -o ..\..\..\moc\terraView\moc_telayer_metadata.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\telayer_metadata.h;..\..\..\ui\terraView\telayer_metadata.cpp;..\..\..\moc\terraView\moc_telayer_metadata.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\telayer_metadata.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\telayer_metadata.ui -o ..\..\..\ui\terraView\telayer_metadata.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\telayer_metadata.ui -i telayer_metadata.h -o ..\..\..\ui\terraView\telayer_metadata.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\telayer_metadata.h -o ..\..\..\moc\terraView\moc_telayer_metadata.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\telayer_metadata.h;..\..\..\ui\terraView\telayer_metadata.cpp;..\..\..\moc\terraView\moc_telayer_metadata.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\terraViewBase.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\terraViewBase.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\terraViewBase.ui -o ..\..\..\ui\terraView\terraViewBase.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\terraViewBase.ui -i terraViewBase.h -o ..\..\..\ui\terraView\terraViewBase.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\terraViewBase.h -o ..\..\..\moc\terraView\moc_terraViewBase.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\terraViewBase.h;..\..\..\ui\terraView\terraViewBase.cpp;..\..\..\moc\terraView\moc_terraViewBase.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\terraViewBase.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\terraViewBase.ui -o ..\..\..\ui\terraView\terraViewBase.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\terraViewBase.ui -i terraViewBase.h -o ..\..\..\ui\terraView\terraViewBase.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\terraViewBase.h -o ..\..\..\moc\terraView\moc_terraViewBase.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\terraViewBase.h;..\..\..\ui\terraView\terraViewBase.cpp;..\..\..\moc\terraView\moc_terraViewBase.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\textRep.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\textRep.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\textRep.ui -o ..\..\..\ui\terraView\textRep.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\textRep.ui -i textRep.h -o ..\..\..\ui\terraView\textRep.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\textRep.h -o ..\..\..\moc\terraView\moc_textRep.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\textRep.h;..\..\..\ui\terraView\textRep.cpp;..\..\..\moc\terraView\moc_textRep.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\textRep.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\textRep.ui -o ..\..\..\ui\terraView\textRep.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\textRep.ui -i textRep.h -o ..\..\..\ui\terraView\textRep.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\textRep.h -o ..\..\..\moc\terraView\moc_textRep.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\textRep.h;..\..\..\ui\terraView\textRep.cpp;..\..\..\moc\terraView\moc_textRep.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\themeProp.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\themeProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeProp.ui -o ..\..\..\ui\terraView\themeProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeProp.ui -i themeProp.h -o ..\..\..\ui\terraView\themeProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\themeProp.h -o ..\..\..\moc\terraView\moc_themeProp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\themeProp.h;..\..\..\ui\terraView\themeProp.cpp;..\..\..\moc\terraView\moc_themeProp.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\themeProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeProp.ui -o ..\..\..\ui\terraView\themeProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeProp.ui -i themeProp.h -o ..\..\..\ui\terraView\themeProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\themeProp.h -o ..\..\..\moc\terraView\moc_themeProp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\themeProp.h;..\..\..\ui\terraView\themeProp.cpp;..\..\..\moc\terraView\moc_themeProp.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\themeVis.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\themeVis.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeVis.ui -o ..\..\..\ui\terraView\themeVis.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeVis.ui -i themeVis.h -o ..\..\..\ui\terraView\themeVis.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\themeVis.h -o ..\..\..\moc\terraView\moc_themeVis.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\themeVis.h;..\..\..\ui\terraView\themeVis.cpp;..\..\..\moc\terraView\moc_themeVis.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\themeVis.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeVis.ui -o ..\..\..\ui\terraView\themeVis.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeVis.ui -i themeVis.h -o ..\..\..\ui\terraView\themeVis.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\themeVis.h -o ..\..\..\moc\terraView\moc_themeVis.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\themeVis.h;..\..\..\ui\terraView\themeVis.cpp;..\..\..\moc\terraView\moc_themeVis.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\viewProp.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\viewProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\viewProp.ui -o ..\..\..\ui\terraView\viewProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\viewProp.ui -i viewProp.h -o ..\..\..\ui\terraView\viewProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\viewProp.h -o ..\..\..\moc\terraView\moc_viewProp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\viewProp.h;..\..\..\ui\terraView\viewProp.cpp;..\..\..\moc\terraView\moc_viewProp.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\viewProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\viewProp.ui -o ..\..\..\ui\terraView\viewProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\viewProp.ui -i viewProp.h -o ..\..\..\ui\terraView\viewProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\viewProp.h -o ..\..\..\moc\terraView\moc_viewProp.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\viewProp.h;..\..\..\ui\terraView\viewProp.cpp;..\..\..\moc\terraView\moc_viewProp.cpp"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\visual.ui">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\visual.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\visual.ui -o ..\..\..\ui\terraView\visual.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\visual.ui -i visual.h -o ..\..\..\ui\terraView\visual.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\visual.h -o ..\..\..\moc\terraView\moc_visual.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\visual.h;..\..\..\ui\terraView\visual.cpp;..\..\..\moc\terraView\moc_visual.cpp"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\visual.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\visual.ui -o ..\..\..\ui\terraView\visual.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\visual.ui -i visual.h -o ..\..\..\ui\terraView\visual.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\visual.h -o ..\..\..\moc\terraView\moc_visual.cpp
+"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\visual.h;..\..\..\ui\terraView\visual.cpp;..\..\..\moc\terraView\moc_visual.cpp"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Translations Files"
+			Filter="ts"
+			ParseFiles="FALSE">
+			<File
+				RelativePath="../terraView_pt.ts">
+			</File>
+			<File
+				RelativePath="../terraView_sp.ts">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resources"
+			Filter="cpp;ico;png;jpg;jpeg;gif;xpm;bmp;rc;ts"
+			ParseFiles="FALSE">
+			<File
+				RelativePath="../ui/images/addressDictionary.png">
+			</File>
+			<File
+				RelativePath="../ui/images/addressLayer.png">
+			</File>
+			<File
+				RelativePath="../ui/images/addressReferenceLayer.png">
+			</File>
+			<File
+				RelativePath="../ui/images/addressTable.png">
+			</File>
+			<File
+				RelativePath="../ui/images/and.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/area.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/buffer.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/bufferNoUnion.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/bufferUnion.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/clearColor.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/closeDB.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/containLin.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/containLinPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/containLinPon.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/containPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/convexHull.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/coverByPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/coverLinPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/coverPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/crossLin.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/crossLinPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/database.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/databasesTree.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/disjointLin.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/disjointLinPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/disjointLinPon.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/disjointPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/disjointPonPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/display.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/distance.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/distMeter.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/draw.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/edit.xpm">
+			</File>
+			<File
+				RelativePath="../ui/images/equalLin.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/equalPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/graphic.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/graphicConfig.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/graphicCursor.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/grid.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/help.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/import.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/infoCursor.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/infolayer.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/insideAndOutside.png">
+			</File>
+			<File
+				RelativePath="../ui/images/invertColor1.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/invertSelection.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/isContainLin.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/isContainLinPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/isContainPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/isContainPonPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/left.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/length.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/minus.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/nearstNeigh.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/nextDisplay.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/nonEdit.xpm">
+			</File>
+			<File
+				RelativePath="../ui/images/onlyInside.png">
+			</File>
+			<File
+				RelativePath="../ui/images/onlyOutside.png">
+			</File>
+			<File
+				RelativePath="../ui/images/openfile.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/or.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/overlapLin.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/overlapPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/panCursor.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/pointer.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/previousDisplay.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/print.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/promote.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/reset.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/right.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/table.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/terralib.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/theme.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/tileWindows.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/touchLin.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/touchLinPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/touchLinPon.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/touchPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/touchPonPol.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/unselect.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/view.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/viewsTree.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/xor.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/zoomCursor.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/zoomIn.bmp">
+			</File>
+			<File
+				RelativePath="../ui/images/zoomOut.bmp">
+			</File>
+			<File
+				RelativePath="qmake_image_collection.cpp">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/terralib/terralib.sln b/build/win32-msvc2003/terralib/terralib.sln
new file mode 100644
index 0000000..15b2efd
--- /dev/null
+++ b/build/win32-msvc2003/terralib/terralib.sln
@@ -0,0 +1,130 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\tiff\tiff.vcproj", "{DD1ADACD-7990-4793-9952-25197394954A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dxf", "..\dxf\dxf.vcproj", "{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapelib", "..\shapelib\shapelib.vcproj", "{C4A3E074-08E5-4197-ABB7-06611BAC269D}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "terralib.vcproj", "{1253197A-5710-4924-9706-6449C0C32FE9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D} = {C4A3E074-08E5-4197-ABB7-06611BAC269D}
+		{DD1ADACD-7990-4793-9952-25197394954A} = {DD1ADACD-7990-4793-9952-25197394954A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_ado", "..\te_ado\te_ado.vcproj", "{F615229C-247C-4DF2-92C4-B891BC27BD9B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335} = {6F8DD2AE-66D4-442A-B204-114A1EF99335}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_utils", "..\te_utils\te_utils.vcproj", "{6F8DD2AE-66D4-442A-B204-114A1EF99335}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_functions", "..\te_functions\te_functions.vcproj", "{877A1388-B3CA-481A-9BFB-C7178EC68D0B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_dxf", "..\te_dxf\te_dxf.vcproj", "{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4} = {5AC793EF-07E3-44DA-AE88-E8D6546A73E4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_firebird", "..\te_firebird\te_firebird.vcproj", "{DC4338DD-BAE5-487D-9688-573DE607CDFD}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_mysql", "..\te_mysql\te_mysql.vcproj", "{31C5E1F3-85BD-4580-973D-CA344342DD36}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_oracle", "..\te_oracle\te_oracle.vcproj", "{EE0E1B28-F969-4F8C-8D18-B31250403089}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_postgresql", "..\te_postgresql\te_postgresql.vcproj", "{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Debug.ActiveCfg = Debug|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Debug.Build.0 = Debug|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Release.ActiveCfg = Release|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Release.Build.0 = Release|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Debug.ActiveCfg = Debug|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Debug.Build.0 = Debug|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Release.ActiveCfg = Release|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Release.Build.0 = Release|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Debug.ActiveCfg = Debug|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Debug.Build.0 = Debug|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Release.ActiveCfg = Release|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Release.Build.0 = Release|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Debug.ActiveCfg = Debug|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Debug.Build.0 = Debug|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Release.ActiveCfg = Release|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Release.Build.0 = Release|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Debug.ActiveCfg = Debug|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Debug.Build.0 = Debug|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Release.ActiveCfg = Release|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Release.Build.0 = Release|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Debug.ActiveCfg = Debug|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Debug.Build.0 = Debug|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Release.ActiveCfg = Release|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Release.Build.0 = Release|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Debug.ActiveCfg = Debug|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Debug.Build.0 = Debug|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Release.ActiveCfg = Release|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Release.Build.0 = Release|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Debug.ActiveCfg = Debug|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Debug.Build.0 = Debug|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Release.ActiveCfg = Release|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Release.Build.0 = Release|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Debug.ActiveCfg = Debug|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Debug.Build.0 = Debug|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Release.ActiveCfg = Release|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Release.Build.0 = Release|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Debug.ActiveCfg = Debug|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Debug.Build.0 = Debug|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Release.ActiveCfg = Release|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Release.Build.0 = Release|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Debug.ActiveCfg = Debug|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Debug.Build.0 = Debug|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Release.ActiveCfg = Release|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Release.Build.0 = Release|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Debug.ActiveCfg = Debug|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Debug.Build.0 = Debug|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Release.ActiveCfg = Release|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/build/win32-msvc2003/terralib/terralib.vcproj b/build/win32-msvc2003/terralib/terralib.vcproj
new file mode 100644
index 0000000..1eb3369
--- /dev/null
+++ b/build/win32-msvc2003/terralib/terralib.vcproj
@@ -0,0 +1,938 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="terralib"
+	ProjectGUID="{1253197A-5710-4924-9706-6449C0C32FE9}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\terralib"
+			IntermediateDirectory="..\..\..\Debug\terralib"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\functions;..\..\..\src\terralib\drivers\libjpeg;..\..\..\src\terralib\kernel;..\..\..\src\terralib\utils;..\..\..\src\tiff;..\..\..\src\libjpeg;..\..\..\src\zlib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TL_AS_DLL"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\..\..\dependencies\win32\zlib\lib\zlibdll.lib ..\..\..\Debug\libjpeg\libjpeg.lib $(OutDir)\..\tiff\tiff.lib"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\terralib"
+			IntermediateDirectory="..\..\..\Release\terralib"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\functions;..\..\..\src\terralib\drivers\libjpeg;..\..\..\src\terralib\kernel;..\..\..\src\terralib\utils;..\..\..\src\tiff;..\..\..\src\libjpeg;..\..\..\src\zlib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TL_AS_DLL"
+				MinimalRebuild="FALSE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\..\..\dependencies\win32\zlib\lib\zlibdll.lib ..\..\..\Release\libjpeg\libjpeg.lib $(OutDir)\..\tiff\tiff.lib"
+				OutputFile="$(OutDir)/../$(ProjectName).dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="FALSE"
+				ProgramDatabaseFile=""
+				SubSystem="2"
+				OptimizeReferences="0"
+				EnableCOMDATFolding="0"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\libjpeg\jmemdst.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\libjpeg\jmemsrc.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\lexTemporal.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\Te2ndDegPolinomialGT.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\Te2ndDegPolinomialGTFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAbstractTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAffineGT.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAffineGTFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAgnostic.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAsciiFile.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBlockLoader.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBox.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBufferRegion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCentroid.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeComputeAttributeStrategies.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageImportUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabase.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseFactoryParams.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseIndex.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatum.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDBConnectionsPool.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderASCIIGrid.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderDatabase.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderFile.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderJPEG.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderMemory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderMemoryMap.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderSmartMem.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderSPR.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderTIFF.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderVirtualMemory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeErrorLog.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeErrorMessage.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeException.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeExternalTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFileTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFragmentation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFunctionCallThreadJob.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGDriverFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometricTransformation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometry.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometryAlgorithms.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGroupingAlgorithms.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGTFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGTParams.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeImportRaster.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeInitRasterDecoders.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeIntersector.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeLayer.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeLegendEntry.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\libjpeg\TeLibJpegWrapper.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMappedMemory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMatrix.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMetaModelCache.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMultiGeometry.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMutex.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeNeighbours.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeNetwork.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeOverlay.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeOverlayUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TePolygonSetProperties.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProgress.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProject.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjection.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjectiveGT.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjectiveGTFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixConstructionStrategy.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixImplementation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixStrategies.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerier.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDB.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr1.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr2.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr3.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierImpl.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierParams.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRaster.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterMemManager.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterParams.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterRemap.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterTransform.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRepresentation.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSemaphore.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSpatialOperations.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeStdFile.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeStdIOProgress.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTElementSet.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTEvent.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTInstance.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTable.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTempFilesRemover.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTemporalSeries.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTheme.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThread.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadFunctor.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadJob.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadJobsManager.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadSignal.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTime.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTimeInterval.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTin.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeVectorRemap.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeViewNode.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeVisual.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\yyTemporal.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\checkvec.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\dynpq.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\Gra_algo.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\graph.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\libjpeg\jmemdstsrc.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\Te2ndDegPolinomialGT.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\Te2ndDegPolinomialGTFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAbstractFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAbstractTheme.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAffineGT.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAffineGTFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAgnostic.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAsciiFile.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAssertions.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAttribute.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBaseSTInstance.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBaseSTInstanceSet.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBlockLoader.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBox.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBufferRegion.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCommunicator.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeComposite.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeComputeAttributeStrategies.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoord2D.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCounted.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverage.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageDecoder.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageDecoderCacheLRU.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageDecoderDatabase.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageImport.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageImportUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageInterpolator.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageInterpolatorNN.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageParams.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabase.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseFactoryParams.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseIndex.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDataTypes.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatum.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDBConnectionsPool.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoder.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderASCIIGrid.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderDatabase.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderFile.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderJPEG.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderMemory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderMemoryMap.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderSmartMem.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderSPR.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderTIFF.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderVirtualMemory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeErrorLog.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeErrorMessage.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeException.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeExternalTheme.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFileTheme.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFragmentation.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFunctionCallThreadJob.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGDriverFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeneralizedProxMatrix.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometricTransformation.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometry.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometryAlgorithms.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGraph.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGridIndex.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGroupingAlgorithms.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGTFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGTParams.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeImportRaster.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeInitRasterDecoders.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeIntersector.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeKdTree.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeLayer.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeLegendEntry.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\libjpeg\TeLibJpegWrapper.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMappedMemory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMatrix.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMeasure.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMetaModelCache.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMultiContainer.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMultiGeometry.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMutex.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeNeighbours.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeNetwork.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeOverlay.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeOverlayUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TePieBar.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TePolygonSetProperties.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TePrecision.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProgress.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProgressBase.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProject.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjection.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjectiveGT.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjectiveGTFactory.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TePrototype.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixConstructionStrategy.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixImplementation.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixSlicingStrategy.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixWeightsStrategy.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerier.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDB.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr1.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr2.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr3.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierImpl.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierParams.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRaster.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterMemManager.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterParams.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterRemap.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterTransform.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRedBlackTree.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRepresentation.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRTree.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSemaphore.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSharedPtr.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSingleton.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSlice.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSparseMatrix.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSpatialOperations.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeStatistics.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeStdFile.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeStdIOProgress.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTEFunctionsDB.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTElementSet.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTEvent.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTInstance.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTable.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTempFilesRemover.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTemporalSeries.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTheme.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThread.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadDatatypes.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadFunctor.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadJob.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadJobsManager.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadParameters.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadSignal.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTime.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTimeInterval.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTin.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeVectorRemap.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeVersion.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeView.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeViewNode.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeViewTreeIterator.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeViewTreeUtils.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeVisual.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\yyTemporal.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/terralibdtm/terralibdtm.vcproj b/build/win32-msvc2003/terralibdtm/terralibdtm.vcproj
new file mode 100644
index 0000000..7805dc9
--- /dev/null
+++ b/build/win32-msvc2003/terralibdtm/terralibdtm.vcproj
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="terralibdtm"
+	ProjectGUID="{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\terralibdtm"
+			IntermediateDirectory="..\..\..\Release\terralibdtm"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 "
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories="..\..\..\src\tiff;..\..\..\src\shapelib;..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions;..\..\..\src\terralib\image_processing;..\..\..\src\terralib\image_processing\data_structs;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;UNICODE;__WIN32__;PDI_AS_DLL"
+				StringPooling="FALSE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="FALSE"
+				RuntimeTypeInfo="TRUE"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(OutDir)\..\terralib\terralib.lib"
+				OutputFile="$(OutDir)/../$(ProjectName).dll"
+				LinkIncremental="1"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\terralibdtm"
+			IntermediateDirectory="..\..\..\Debug\terralibdtm"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 "
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\tiff;..\..\..\src\shapelib;..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions;..\..\..\src\terralib\dtm;..\..\..\src\terralib\image_processing"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;UNICODE;__WIN32__;DTM_AS_DLL"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				RuntimeTypeInfo="TRUE"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				CompileAs="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\..\..\Debug\libspl\libspl.lib ..\..\..\Debug\terralibpdi\terralibpdi.lib ..\..\..\Debug\terralib\terralib.lib ..\..\..\terralibw/zlib/zlibdll.lib"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTM.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMAlgorithm.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMDerive.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMInterpolator.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMParameters.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTM.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMAlgorithm.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMDerive.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMInterpolator.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMParameters.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+		<Filter
+			Name="Generated"
+			Filter="moc">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/terralibpdi/terralibpdi.vcproj b/build/win32-msvc2003/terralibpdi/terralibpdi.vcproj
new file mode 100644
index 0000000..509a367
--- /dev/null
+++ b/build/win32-msvc2003/terralibpdi/terralibpdi.vcproj
@@ -0,0 +1,793 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="terralibpdi"
+	ProjectGUID="{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\terralibpdi"
+			IntermediateDirectory="..\..\..\Release\terralibpdi"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 "
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories="..\..\..\src\tiff;..\..\..\src\shapelib;..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions;..\..\..\src\terralib\image_processing;..\..\..\src\terralib\image_processing\data_structs;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;UNICODE;__WIN32__;PDI_AS_DLL"
+				StringPooling="FALSE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="FALSE"
+				RuntimeTypeInfo="TRUE"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(OutDir)\..\terralib\terralib.lib"
+				OutputFile="$(OutDir)/../$(ProjectName).dll"
+				LinkIncremental="1"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\terralibpdi"
+			IntermediateDirectory="..\..\..\Debug\terralibpdi"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 "
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\tiff;..\..\..\src\shapelib;..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions;..\..\..\src\terralib\image_processing;..\..\..\src\terralib\image_processing\data_structs"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;UNICODE;__WIN32__;PDI_AS_DLL;PDIAGN_DEBUG_MODE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				RuntimeTypeInfo="TRUE"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				CompileAs="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(OutDir)\..\terralib\terralib.lib"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIAlgorithm.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIAlgorithmFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIArithmetic.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIArithmeticFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBaatz.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBatchGeoMosaic.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBDFilter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBDFilterFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBlender.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBufferedFilter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDICluster.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIColorTransform.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIColorTransformFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIContrast.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIContrastFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDICorrelationMatching.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIDecorrelationEnhancement.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEMClas.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEMClasFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEspecData.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIFilterMask.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIFusionIndexes.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGarguetFusion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGeneralizedIHSFusion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGeoMosaic.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIHaralick.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIHistogram.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIHSFusion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIHSWaveletFusion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIInterpolator.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIsosegClas.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIsosegClasFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIJointHistogram.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIKMeansClas.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIKMeansClasFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILevelRemap.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILinearFilter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILinearFilterFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMallatWavelets.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMathFunctions.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMatrixFunctions.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMIMatching.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModel.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelComponent.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelComponentList.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelSpectralBand.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelSpectralBandList.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelStrategy.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelStratFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMMIOMatching.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMorfFilter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMorfFilterFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIOFMatching.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParallelSegmenter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParameters.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegBaatzStrategy.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegBaatzStrategyFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegRegGrowStrategy.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegRegGrowStrategyFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegSegment.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegSegmentsBlock.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategy.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyFactoryParams.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyParams.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPCAWaveletFusion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPIManager.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponents.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponentsFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponentsFusion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincoMixModelSF.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincoMixModelStrategy.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFilter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFrostFilter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFrostFilterFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarGammaFilter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarKuanFilter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarKuanFilterFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarLeeFilter.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarLeeFilterFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRaster2Vector.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRaster2VectorFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRasterRUBuffer.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegGrowSeg.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegGrowSegFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegister.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegisterFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRgbPalette.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRgbPaletteFunctions.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISAMClassifier.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISensorSimulator.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISensorSimulatorFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStatistic.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStrategy.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStrategyFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDITPMosaic.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIUtils.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIVenturaFusion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWaveletAtrous.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWaveletAtrousFusion.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWiSpeRFusion.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIAlgorithm.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIAlgorithmFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIArithmetic.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIArithmeticFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBaatz.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBatchGeoMosaic.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBDFilter.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBDFilterFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBlender.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBufferedFilter.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDICluster.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIColorTransform.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIColorTransformFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIContrast.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIContrastFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDICorrelationMatching.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIDecorrelationEnhancement.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIDefines.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEMClas.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEMClasFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEspecData.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIFilterMask.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIFusionIndexes.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGarguetFusion.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGeneralizedIHSFusion.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGeoMosaic.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIHaralick.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIHistogram.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIHSFusion.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIHSWaveletFusion.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIInterpolator.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIsosegClas.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIsosegClasFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIJointHistogram.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIKMeansClas.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIKMeansClasFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILevelRemap.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILinearFilter.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILinearFilterFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMallatWavelets.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMathFunctions.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMatrix.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMatrixFunctions.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMIMatching.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModel.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelComponent.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelComponentList.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelSpectralBand.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelSpectralBandList.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelStrategy.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelStratFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMMIOMatching.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMorfFilter.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMorfFilterFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMtxDoubleAdpt.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIOFMatching.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParallelSegmenter.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParameters.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegBaatzStrategy.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegBaatzStrategyFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegRegGrowStrategy.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegRegGrowStrategyFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegSegment.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegSegmentsBlock.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategy.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyFactoryParams.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyParams.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPCAWaveletFusion.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPIManager.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPIManagerGlobalSettings.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponents.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponentsFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponentsFusion.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincoMixModelSF.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincoMixModelStrategy.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFilter.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFrostFilter.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFrostFilterFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarGammaFilter.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarKuanFilter.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarKuanFilterFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarLeeFilter.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarLeeFilterFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRaster2Vector.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRaster2VectorFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRasterRUBuffer.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegGrowSeg.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegGrowSegFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegion.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegister.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegisterFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRgbPalette.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRgbPaletteFunctions.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRgbPaletteNode.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISAMClassifier.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISensorSimulator.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISensorSimulatorFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStatistic.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStrategy.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStrategyFactory.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDITileIndexer.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDITPMosaic.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDITypes.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIUtils.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIVenturaFusion.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWaveletAtrous.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWaveletAtrousFusion.hpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWiSpeRFusion.hpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+		<Filter
+			Name="Generated"
+			Filter="moc">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2003/tiff/tiff.vcproj b/build/win32-msvc2003/tiff/tiff.vcproj
new file mode 100644
index 0000000..f62c3d8
--- /dev/null
+++ b/build/win32-msvc2003/tiff/tiff.vcproj
@@ -0,0 +1,376 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="tiff"
+	ProjectGUID="{DD1ADACD-7990-4793-9952-25197394954A}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\tiff"
+			IntermediateDirectory="..\..\..\Debug\tiff"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\zlib;..\..\..\src\libjpeg"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILD_AS_DLL"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\..\..\Debug\libjpeg\libjpeg.lib ..\..\..\dependencies\win32\zlib\lib\zlibdll.lib"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\tiff"
+			IntermediateDirectory="..\..\..\Release\tiff"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\src\zlib;..\..\..\src\libjpeg"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILD_AS_DLL"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(OutDir)\..\libjpeg\libjpeg.lib ..\..\..\dependencies\win32\zlib\lib\zlibdll.lib"
+				OutputFile="$(OutDir)/../$(ProjectName).dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="0"
+				EnableCOMDATFolding="0"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath="..\..\..\src\tiff\cpl_csv.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\cpl_serv.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_extra.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_free.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_get.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_names.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_new.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_normalize.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_print.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_set.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_tiffp.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_trans.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_write.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geotiff_proj4.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_aux.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_close.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_codec.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_color.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_compress.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dir.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dirinfo.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dirread.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dirwrite.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dumpmode.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_error.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_extension.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_fax3.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_fax3sm.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_flush.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_getimage.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_jpeg.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_luv.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_lzw.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_machdep.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_next.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_open.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_packbits.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_pixarlog.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_predict.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_print.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_read.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_strip.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_swab.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_thunder.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_tile.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_version.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_warning.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_win32.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_write.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_zip.c">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\xtiff.c">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath="..\..\..\src\tiff\cpl_csv.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\cpl_serv.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_config.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_keyp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_normalize.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_tiffp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geokeys.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geokeys.inc">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geonames.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geotiff.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geotiffio.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geovalues.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\port.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\t4.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_config.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dir.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_fax3.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_predict.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiff.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiffcomp.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiffconf.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiffio.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiffiop.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiffvers.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\uvcode.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\xtiffio.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\xtiffiop.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/dxf/dxf.vcproj b/build/win32-msvc2005/dxf/dxf.vcproj
new file mode 100644
index 0000000..a938395
--- /dev/null
+++ b/build/win32-msvc2005/dxf/dxf.vcproj
@@ -0,0 +1,235 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="dxf"
+	ProjectGUID="{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\dxflib"
+			IntermediateDirectory="..\..\..\Debug\dxflib"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories="..\..\..\src\dxflib"
+				PreprocessorDefinitions="UNICODE,WIN32,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="false"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\..\..\Debug\dxflib\dxf.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\dxflib"
+			IntermediateDirectory="..\..\..\Release\dxflib"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="1"
+				AdditionalIncludeDirectories="..\..\..\src\dxflib"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,UNICODE,WIN32,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\..\..\Release\dxflib\dxf.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_dxf.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_writer_ascii.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_attributes.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_codes.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_creationadapter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_creationinterface.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_dxf.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_entities.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_exception.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_extrusion.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_writer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\dxflib\dl_writer_ascii.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/libjpeg/libjpeg.vcproj b/build/win32-msvc2005/libjpeg/libjpeg.vcproj
new file mode 100644
index 0000000..7e90c54
--- /dev/null
+++ b/build/win32-msvc2005/libjpeg/libjpeg.vcproj
@@ -0,0 +1,474 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="libjpeg"
+	ProjectGUID="{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\libjpeg"
+			IntermediateDirectory="..\..\..\Debug\libjpeg"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\libjpeg"
+				PreprocessorDefinitions="WIN32;_DEBUG;UNICODE;_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName).lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\libjpeg"
+			IntermediateDirectory="..\..\..\Release\libjpeg"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories="..\..\..\src\libjpeg"
+				PreprocessorDefinitions="WIN32;NDEBUG;UNICODE;_LIB"
+				StringPooling="false"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="false"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName).lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcapimin.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcapistd.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jccoefct.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jccolor.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcdctmgr.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jchuff.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcinit.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcmainct.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcmarker.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcmaster.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcomapi.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcparam.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcphuff.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcprepct.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jcsample.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jctrans.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdapimin.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdapistd.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdatadst.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdatasrc.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdcoefct.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdcolor.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jddctmgr.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdhuff.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdinput.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdmainct.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdmarker.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdmaster.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdmerge.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdphuff.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdpostct.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdsample.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdtrans.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jerror.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jfdctflt.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jfdctfst.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jfdctint.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jidctflt.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jidctfst.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jidctint.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jidctred.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jmemmgr.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jmemnobs.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jquant1.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jquant2.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jutils.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdbmp.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdcolmap.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdgif.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdppm.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdrle.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdswitch.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\rdtarga.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\transupp.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrbmp.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrgif.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrjpgcom.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrppm.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrrle.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\wrtarga.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\libjpeg\cderror.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jchuff.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jconfig.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdct.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jdhuff.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jerror.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jinclude.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jmemsys.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jmorecfg.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jpegint.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jpeglib.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\jversion.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libjpeg\transupp.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/libspl/libspl.vcproj b/build/win32-msvc2005/libspl/libspl.vcproj
new file mode 100644
index 0000000..7be74d5
--- /dev/null
+++ b/build/win32-msvc2005/libspl/libspl.vcproj
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="libspl"
+	ProjectGUID="{1A9CF14C-46CC-450C-B62E-5354751C53F0}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\libspl"
+			IntermediateDirectory="..\..\..\Debug\libspl"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\libspl;..\..\..\src\libspl\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;SPL_MAKE_DLL"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4311"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\libspl"
+			IntermediateDirectory="..\..\..\Release\libspl"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\libspl;..\..\..\src\libspl\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;SPL_MAKE_DLL"
+				RuntimeLibrary="2"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4311"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\..\$(ProjectName).dll"
+				LinkIncremental="1"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_mutex.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_pluginargs.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_plugininfo.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_pluginserver.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_pluginserver_linux.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_pluginserver_win32.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\source\spl_threadlock.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_mutex.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_platform.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_pluginargs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_plugininfo.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_pluginserver.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_pluginserver_linux.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_pluginserver_win32.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_threadlock.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\libspl\include\spl_typedefs.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/qwt/qwt.vcproj b/build/win32-msvc2005/qwt/qwt.vcproj
new file mode 100644
index 0000000..bd23e7c
--- /dev/null
+++ b/build/win32-msvc2005/qwt/qwt.vcproj
@@ -0,0 +1,1143 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="qwt"
+	ProjectGUID="{4AED2E04-C11A-40BE-9F3A-331C7261F35C}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\qwt"
+			IntermediateDirectory="..\..\..\Release\qwt"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\qwt\include;"$(QTDIR)\include""
+				PreprocessorDefinitions="QT_NO_DEBUG;NDEBUG;_WINDOWS;UNICODE;WIN32;QT_DLL;QWT_DLL;QWT_MAKEDLL;QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(QTDIR)\lib\qt.lib"
+				OutputFile="..\..\..\Release\qwt.dll"
+				LinkIncremental="1"
+				ImportLibrary="..\..\..\Release\qwt\qwt.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\qwt"
+			IntermediateDirectory="..\..\..\Debug\qwt"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\qwt\include;"$(QTDIR)\include""
+				PreprocessorDefinitions="QT_NO_DEBUG;_DEBUG;_WINDOWS;UNICODE;WIN32;QT_DLL;QWT_DLL;QWT_MAKEDLL;QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="false"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(QTDIR)\lib\qt.lib"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_abstract_scale.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_abstract_scale_draw.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_abstract_slider.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_analog_clock.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_arrow_button.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_compass.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_compass_rose.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_counter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_data.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_dial.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_dial_needle.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_double_interval.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_double_range.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_double_rect.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_dyngrid_layout.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_event_pattern.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_interval_data.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_knob.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_layout_metrics.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_legend.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_legend_item.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_math.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_paint_buffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_painter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_picker.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_picker_machine.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_axis.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_canvas.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_curve.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_dict.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_grid.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_item.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_layout.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_marker.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_picker.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_print.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_printfilter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_plot_zoomer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_rect.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_round_scale_draw.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_scale_div.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_scale_draw.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_scale_engine.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_scale_map.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_scale_widget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_slider.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_spline.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_symbol.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_text.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_text_engine.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_text_label.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_thermo.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\qwt_wheel.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_abstract_scale.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_abstract_scale_draw.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_abstract_slider.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_abstract_slider.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_abstract_slider.h -o ..\..\..\moc\qwt\moc_qwt_abstract_slider.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_abstract_slider.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_abstract_slider.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_abstract_slider.h -o ..\..\..\moc\qwt\moc_qwt_abstract_slider.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_abstract_slider.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_analog_clock.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_analog_clock.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_analog_clock.h -o ..\..\..\moc\qwt\moc_qwt_analog_clock.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_analog_clock.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_analog_clock.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_analog_clock.h -o ..\..\..\moc\qwt\moc_qwt_analog_clock.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_analog_clock.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_array.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_arrow_button.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_compass.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_compass.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_compass.h -o ..\..\..\moc\qwt\moc_qwt_compass.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_compass.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_compass.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_compass.h -o ..\..\..\moc\qwt\moc_qwt_compass.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_compass.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_compass_rose.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_counter.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_counter.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_counter.h -o ..\..\..\moc\qwt\moc_qwt_counter.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_counter.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_counter.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_counter.h -o ..\..\..\moc\qwt\moc_qwt_counter.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_counter.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_data.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_dial.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_dial.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_dial.h -o ..\..\..\moc\qwt\moc_qwt_dial.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_dial.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_dial.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_dial.h -o ..\..\..\moc\qwt\moc_qwt_dial.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_dial.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_dial_needle.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_double_interval.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_double_range.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_double_rect.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_dyngrid_layout.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_dyngrid_layout.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_dyngrid_layout.h -o ..\..\..\moc\qwt\moc_qwt_dyngrid_layout.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_dyngrid_layout.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_dyngrid_layout.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_dyngrid_layout.h -o ..\..\..\moc\qwt\moc_qwt_dyngrid_layout.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_dyngrid_layout.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_event_pattern.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_global.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_interval_data.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_knob.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_knob.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_knob.h -o ..\..\..\moc\qwt\moc_qwt_knob.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_knob.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_knob.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_knob.h -o ..\..\..\moc\qwt\moc_qwt_knob.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_knob.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_layout_metrics.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_legend.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_legend.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_legend.h -o ..\..\..\moc\qwt\moc_qwt_legend.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_legend.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_legend.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_legend.h -o ..\..\..\moc\qwt\moc_qwt_legend.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_legend.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_legend_item.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_legend_item.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_legend_item.h -o ..\..\..\moc\qwt\moc_qwt_legend_item.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_legend_item.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_legend_item.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_legend_item.h -o ..\..\..\moc\qwt\moc_qwt_legend_item.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_legend_item.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_math.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_paint_buffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_painter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_picker.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_picker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_picker.h -o ..\..\..\moc\qwt\moc_qwt_picker.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_picker.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_picker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_picker.h -o ..\..\..\moc\qwt\moc_qwt_picker.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_picker.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_picker_machine.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot.h -o ..\..\..\moc\qwt\moc_qwt_plot.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot.h -o ..\..\..\moc\qwt\moc_qwt_plot.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_canvas.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_canvas.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_canvas.h -o ..\..\..\moc\qwt\moc_qwt_plot_canvas.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_canvas.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_canvas.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_canvas.h -o ..\..\..\moc\qwt\moc_qwt_plot_canvas.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_canvas.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_curve.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_dict.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_grid.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_item.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_layout.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_marker.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_picker.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_picker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_picker.h -o ..\..\..\moc\qwt\moc_qwt_plot_picker.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_picker.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_picker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_picker.h -o ..\..\..\moc\qwt\moc_qwt_plot_picker.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_picker.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_printfilter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_plot_zoomer.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_zoomer.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_zoomer.h -o ..\..\..\moc\qwt\moc_qwt_plot_zoomer.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_zoomer.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_plot_zoomer.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_plot_zoomer.h -o ..\..\..\moc\qwt\moc_qwt_plot_zoomer.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_plot_zoomer.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_rect.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_round_scale_draw.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_scale_div.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_scale_draw.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_scale_engine.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_scale_map.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_scale_widget.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_scale_widget.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_scale_widget.h -o ..\..\..\moc\qwt\moc_qwt_scale_widget.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_scale_widget.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_scale_widget.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_scale_widget.h -o ..\..\..\moc\qwt\moc_qwt_scale_widget.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_scale_widget.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_slider.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_slider.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_slider.h -o ..\..\..\moc\qwt\moc_qwt_slider.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_slider.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_slider.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_slider.h -o ..\..\..\moc\qwt\moc_qwt_slider.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_slider.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_spline.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_symbol.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_text.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_text_engine.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_text_label.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_text_label.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_text_label.h -o ..\..\..\moc\qwt\moc_qwt_text_label.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_text_label.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_text_label.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_text_label.h -o ..\..\..\moc\qwt\moc_qwt_text_label.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_text_label.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_thermo.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_thermo.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_thermo.h -o ..\..\..\moc\qwt\moc_qwt_thermo.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_thermo.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_thermo.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_thermo.h -o ..\..\..\moc\qwt\moc_qwt_thermo.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_thermo.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\qwt\include\qwt_wheel.h"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_wheel.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_wheel.h -o ..\..\..\moc\qwt\moc_qwt_wheel.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_wheel.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\qwt\include\qwt_wheel.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\qwt\include\qwt_wheel.h -o ..\..\..\moc\qwt\moc_qwt_wheel.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\qwt\moc_qwt_wheel.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated MOC Files"
+			Filter="cpp;c;cxx;moc"
+			>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_abstract_slider.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_analog_clock.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_compass.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_counter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_dial.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_dyngrid_layout.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_knob.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_legend.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_legend_item.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_picker.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_plot.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_plot_canvas.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_plot_picker.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_plot_zoomer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_scale_widget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_slider.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_text_label.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_thermo.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\qwt\moc_qwt_wheel.cpp"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/shapelib/shapelib.vcproj b/build/win32-msvc2005/shapelib/shapelib.vcproj
new file mode 100644
index 0000000..e0e33d4
--- /dev/null
+++ b/build/win32-msvc2005/shapelib/shapelib.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="shapelib"
+	ProjectGUID="{C4A3E074-08E5-4197-ABB7-06611BAC269D}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\shapelib"
+			IntermediateDirectory="..\..\..\Debug\shapelib"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SHAPELIB_DLLEXPORT"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\shapelib"
+			IntermediateDirectory="..\..\..\Release\shapelib"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SHAPELIB_DLLEXPORT"
+				MinimalRebuild="false"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)\..\$(ProjectName).dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="0"
+				EnableCOMDATFolding="0"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\..\src\shapelib\dbfopen.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\shapelib\shpopen.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\..\..\src\shapelib\shapefil.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/stat/stat.vcproj b/build/win32-msvc2005/stat/stat.vcproj
new file mode 100644
index 0000000..915a4a1
--- /dev/null
+++ b/build/win32-msvc2005/stat/stat.vcproj
@@ -0,0 +1,345 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="stat"
+	ProjectGUID="{45D098C2-1280-461A-A73B-1333F95C916C}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\stat"
+			IntermediateDirectory="..\..\..\Debug\stat"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\stat"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,STAT_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\stat.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\stat"
+			IntermediateDirectory="..\..\..\Release\stat"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\stat"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,STAT_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\stat.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\../Release/terralib"
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaDouble.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaInt.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaR.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\heap.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\lista.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeBayesFunctions.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeKernelFunctions.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeMSVFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSemivarModelFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterArvore.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterFunctions.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterGrafo.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeStatDataStructures.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\erro.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaDouble.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaInt.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\filaR.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\heap.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\lista.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeBayesFunctions.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeKernelFunctions.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeKernelParams.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeKMeansGrouping.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeMSVFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSemivarModelFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterArvore.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterFunctions.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSkaterGrafo.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeSpatialStatistics.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeStatDataStructures.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\stat\TeStatDefines.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_ado/te_ado.vcproj b/build/win32-msvc2005/te_ado/te_ado.vcproj
new file mode 100644
index 0000000..580302f
--- /dev/null
+++ b/build/win32-msvc2005/te_ado/te_ado.vcproj
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_ado"
+	ProjectGUID="{F615229C-247C-4DF2-92C4-B891BC27BD9B}"
+	RootNamespace="te_ado"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_ado"
+			IntermediateDirectory="..\..\..\Debug\te_ado"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\ado;..\..\..\src\terralib\utils;..\..\..\dependencies\win32\ado;..\..\..\dependencies\win32\ado\bin"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,WIN32,TLADO_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib te_utils.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_ado.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\../Debug/terralib;..\..\../Debug/te_utils"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_ado"
+			IntermediateDirectory="..\..\..\Release\te_ado"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\ado;..\..\..\src\terralib\utils;..\..\..\dependencies\win32\ado;..\..\..\dependencies\win32\ado\bin"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,WIN32,TLADO_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib te_utils.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_ado.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\..\Release\terralib;..\..\..\Release\te_utils"
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoDB.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoOracle.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoSqlServer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoSqlServerSpatial.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoDB.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoDefines.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoOracle.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoSqlServer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\ado\TeAdoSqlServerSpatial.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_apputils/te_apputils.vcproj b/build/win32-msvc2005/te_apputils/te_apputils.vcproj
new file mode 100644
index 0000000..e63d04c
--- /dev/null
+++ b/build/win32-msvc2005/te_apputils/te_apputils.vcproj
@@ -0,0 +1,937 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_apputils"
+	ProjectGUID="{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_apputils"
+			IntermediateDirectory="..\..\..\Debug\te_apputils"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\appUtils;..\..\..\src\terralib\drivers\qt;..\..\..\src\terralib\utils;..\..\..\src\terralib\stat;..\..\..\terraView\ui;"$(QTDIR)\include";..\..\..\ui\;..\..\..\src\appUtils\ui;..\..\..\moc\"
+				PreprocessorDefinitions="_WINDOWS;_DEBUG;WIN32;TLAPPUTILS_AS_DLL;QT_DLL;QT_THREAD_SUPPORT;UNICODE"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib terralib.lib te_utils.lib stat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib glu32.lib opengl32.lib"
+				OutputFile="..\..\..\Debug\te_apputils.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/stat";"..\..\../Debug/te_utils";"$(QTDIR)\lib""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_apputils"
+			IntermediateDirectory="..\..\..\Release\te_apputils"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\appUtils;..\..\..\src\terralib\drivers\qt;..\..\..\src\terralib\utils;..\..\..\src\terralib\stat;..\..\..\terraView\ui;"$(QTDIR)\include";..\..\..\ui\;..\..\..\src\appUtils\ui;..\..\..\moc\"
+				PreprocessorDefinitions="QT_NO_DEBUG;NDEBUG;_WINDOWS;WIN32;TLAPPUTILS_AS_DLL;QT_DLL;QT_THREAD_SUPPORT;UNICODE"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib terralib.lib te_utils.lib stat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib glu32.lib opengl32.lib"
+				OutputFile="..\..\..\Release\te_apputils.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/stat";"..\..\../Release/te_utils";"$(QTDIR)\lib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\animation.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\help.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\mediaDescription.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TeApplicationUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TeAppTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeDecoderQtImage.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeGUIUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtAnimaThread.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtBigTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtCanvas.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtChartItem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtCheckListItem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtColorBar.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtDatabaseItem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtFrame.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtGLWidget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtGrid.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLayerItem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLegendItem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLegendSource.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtShowMedia.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTextEdit.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtThemeItem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtViewItem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtViewsListView.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeWaitCursor.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\urlWindow.ui.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\appUtils\TeApplicationUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TeAppTheme.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TeAppUtilsDefines.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeDecoderQtImage.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeGUIUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TePlotTheme.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\TePlotView.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtAnimaThread.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtBigTable.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtBigTable.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtBigTable.h -o ..\..\..\moc\moc_TeQtBigTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtBigTable.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtBigTable.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtBigTable.h -o ..\..\..\moc\moc_TeQtBigTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtBigTable.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtCanvas.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtCanvas.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtCanvas.h -o ..\..\..\moc\moc_TeQtCanvas.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtCanvas.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtCanvas.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtCanvas.h -o ..\..\..\moc\moc_TeQtCanvas.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtCanvas.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtChartItem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtCheckListItem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtColorBar.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtColorBar.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtColorBar.h -o ..\..\..\moc\moc_TeQtColorBar.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtColorBar.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtColorBar.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtColorBar.h -o ..\..\..\moc\moc_TeQtColorBar.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtColorBar.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtDatabaseItem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.h -o ..\..\..\moc\moc_TeQtDatabasesListView.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtDatabasesListView.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtDatabasesListView.h -o ..\..\..\moc\moc_TeQtDatabasesListView.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtDatabasesListView.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtDataSource.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtDataSource.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtDataSource.h -o ..\..\..\moc\moc_TeQtDataSource.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtDataSource.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtDataSource.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtDataSource.h -o ..\..\..\moc\moc_TeQtDataSource.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtDataSource.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtFrame.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtFrame.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtFrame.h -o ..\..\..\moc\moc_TeQtFrame.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtFrame.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtFrame.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtFrame.h -o ..\..\..\moc\moc_TeQtFrame.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtFrame.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtGLWidget.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtGLWidget.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtGLWidget.h -o ..\..\..\moc\moc_TeQtGLWidget.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtGLWidget.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtGLWidget.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtGLWidget.h -o ..\..\..\moc\moc_TeQtGLWidget.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtGLWidget.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtGrid.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtGrid.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtGrid.h -o ..\..\..\moc\moc_TeQtGrid.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtGrid.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtGrid.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtGrid.h -o ..\..\..\moc\moc_TeQtGrid.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtGrid.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLayerItem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLegendItem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtLegendSource.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtLegendSource.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtLegendSource.h -o ..\..\..\moc\moc_TeQtLegendSource.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtLegendSource.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtLegendSource.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtLegendSource.h -o ..\..\..\moc\moc_TeQtLegendSource.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtLegendSource.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtProgress.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtProgress.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtProgress.h -o ..\..\..\moc\moc_TeQtProgress.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtProgress.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtProgress.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtProgress.h -o ..\..\..\moc\moc_TeQtProgress.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtProgress.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtShowMedia.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtShowMedia.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtShowMedia.h -o ..\..\..\moc\moc_TeQtShowMedia.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtShowMedia.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtShowMedia.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtShowMedia.h -o ..\..\..\moc\moc_TeQtShowMedia.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtShowMedia.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTextEdit.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtThemeItem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtViewItem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtViewsListView.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtViewsListView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtViewsListView.h -o ..\..\..\moc\moc_TeQtViewsListView.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtViewsListView.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtViewsListView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtViewsListView.h -o ..\..\..\moc\moc_TeQtViewsListView.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\moc_TeQtViewsListView.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeWaitCursor.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated MOC Files"
+			Filter="cpp;c;cxx;moc"
+			>
+			<File
+				RelativePath="..\..\..\moc\moc_animation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_help.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_mediaDescription.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtBigTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtCanvas.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtColorBar.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtDatabasesListView.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtDataSource.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtFrame.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtGLWidget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtGrid.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtLegendSource.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtProgress.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtShowMedia.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_TeQtViewsListView.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\moc_urlWindow.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated UI Files"
+			Filter="cpp;c;cxx;h;hpp;hxx;"
+			>
+			<File
+				RelativePath="..\..\..\ui\animation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\animation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\help.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\help.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\mediaDescription.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\mediaDescription.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\urlWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\urlWindow.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Forms"
+			Filter="ui"
+			ParseFiles="false"
+			>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\animation.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\animation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\animation.ui -o ..\..\..\ui\animation.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\animation.ui -i animation.h -o ..\..\..\ui\animation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\animation.h -o ..\..\..\moc\moc_animation.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\animation.h;..\..\..\ui\animation.cpp;..\..\..\moc\moc_animation.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\animation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\animation.ui -o ..\..\..\ui\animation.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\animation.ui -i animation.h -o ..\..\..\ui\animation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\animation.h -o ..\..\..\moc\moc_animation.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\animation.h;..\..\..\ui\animation.cpp;..\..\..\moc\moc_animation.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\help.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\help.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\help.ui -o ..\..\..\ui\help.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\help.ui -i help.h -o ..\..\..\ui\help.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\help.h -o ..\..\..\moc\moc_help.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\help.h;..\..\..\ui\help.cpp;..\..\..\moc\moc_help.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\help.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\help.ui -o ..\..\..\ui\help.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\help.ui -i help.h -o ..\..\..\ui\help.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\help.h -o ..\..\..\moc\moc_help.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\help.h;..\..\..\ui\help.cpp;..\..\..\moc\moc_help.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\mediaDescription.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\mediaDescription.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\mediaDescription.ui -o ..\..\..\ui\mediaDescription.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\mediaDescription.ui -i mediaDescription.h -o ..\..\..\ui\mediaDescription.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\mediaDescription.h -o ..\..\..\moc\moc_mediaDescription.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\mediaDescription.h;..\..\..\ui\mediaDescription.cpp;..\..\..\moc\moc_mediaDescription.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\mediaDescription.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\mediaDescription.ui -o ..\..\..\ui\mediaDescription.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\mediaDescription.ui -i mediaDescription.h -o ..\..\..\ui\mediaDescription.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\mediaDescription.h -o ..\..\..\moc\moc_mediaDescription.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\mediaDescription.h;..\..\..\ui\mediaDescription.cpp;..\..\..\moc\moc_mediaDescription.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\appUtils\ui\urlWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\urlWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\urlWindow.ui -o ..\..\..\ui\urlWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\urlWindow.ui -i urlWindow.h -o ..\..\..\ui\urlWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\urlWindow.h -o ..\..\..\moc\moc_urlWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\urlWindow.h;..\..\..\ui\urlWindow.cpp;..\..\..\moc\moc_urlWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\src\appUtils\ui\urlWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\urlWindow.ui -o ..\..\..\ui\urlWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\src\appUtils\ui\urlWindow.ui -i urlWindow.h -o ..\..\..\ui\urlWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\urlWindow.h -o ..\..\..\moc\moc_urlWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\urlWindow.h;..\..\..\ui\urlWindow.cpp;..\..\..\moc\moc_urlWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_dxf/te_dxf.vcproj b/build/win32-msvc2005/te_dxf/te_dxf.vcproj
new file mode 100644
index 0000000..de33419
--- /dev/null
+++ b/build/win32-msvc2005/te_dxf/te_dxf.vcproj
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_dxf"
+	ProjectGUID="{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_dxf"
+			IntermediateDirectory="..\..\..\Debug\te_dxf"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=""..\..\..\src\terralib\kernel";"..\..\..\src\dxflib";"..\..\..\src\terralib\drivers\DXF""
+				PreprocessorDefinitions="_WINDOWS;UNICODE;WIN32;TEDXF_EXPORTS;QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="false"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="dxf.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_dxf.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories=""..\..\../Debug/dxflib";"..\..\../Debug/terralib""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="..\..\..\Debug\te_dxf\te_dxf.pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="..\..\..\Debug\te_dxf\te_dxf.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_dxf"
+			IntermediateDirectory="..\..\..\Release\te_dxf"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="1"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\dxflib;..\..\..\src\terralib\drivers\DXF"
+				PreprocessorDefinitions="QT_NO_DEBUG;NDEBUG;_WINDOWS;UNICODE;WIN32;TEDXF_EXPORTS;QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="dxf.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_dxf.dll"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories=""..\..\../Release/dxflib";"..\..\../Release/terralib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile=""
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\TeDXFDriver.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\TeDXFDriverFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\tedxflayer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\tedxfvisitor.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\tedxfdefines.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\TeDXFDriver.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\TeDXFDriverFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\tedxflayer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\DXF\tedxfvisitor.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_firebird/te_firebird.vcproj b/build/win32-msvc2005/te_firebird/te_firebird.vcproj
new file mode 100644
index 0000000..cd32163
--- /dev/null
+++ b/build/win32-msvc2005/te_firebird/te_firebird.vcproj
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_firebird"
+	ProjectGUID="{DC4338DD-BAE5-487D-9688-573DE607CDFD}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_firebird"
+			IntermediateDirectory="..\..\..\Debug\te_firebird"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\Firebird"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLFIREBIRD_AS_DLL,IBPP_WINDOWS,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_firebird.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\../Debug/terralib"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_firebird"
+			IntermediateDirectory="..\..\..\Release\te_firebird"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\Firebird"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLFIREBIRD_AS_DLL,IBPP_WINDOWS,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_firebird.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\../Release/terralib"
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\ibpp\core\all_in_one.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\TeFirebird.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\ibpp\core\_ibpp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\ibpp\core\ibase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\ibpp\core\iberror.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\ibpp\core\ibpp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\TeFirebird.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Firebird\TeFirebirdDefines.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_functions/te_functions.vcproj b/build/win32-msvc2005/te_functions/te_functions.vcproj
new file mode 100644
index 0000000..473496b
--- /dev/null
+++ b/build/win32-msvc2005/te_functions/te_functions.vcproj
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_functions"
+	ProjectGUID="{877A1388-B3CA-481A-9BFB-C7178EC68D0B}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_functions"
+			IntermediateDirectory="..\..\..\Debug\te_functions"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions"
+				PreprocessorDefinitions="_WINDOWS;_DEBUG;WIN32;TLFUNCTIONS_AS_DLL;QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_functions.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_functions"
+			IntermediateDirectory="..\..\..\Release\te_functions"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLFUNCTIONS_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_functions.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\../Release/terralib"
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeAddressLocator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeCellAlgorithms.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeCoordAlgorithms.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeExportCSV.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeExportMIF.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeExportSPR.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeGeoProcessingFunctions.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeImportBNA.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeImportCSV.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeImportGeo.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeImportMIF.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeLayerFunctions.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeMIFProjection.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeSimilarity.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeSPRFile.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeThemeFunctions.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeAddressLocator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeCellAlgorithms.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeCoordAlgorithms.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeDriverBNA.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeDriverCSV.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeDriverMIDMIF.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeDriverSPRING.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeFunctionsDefines.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeGeoProcessingFunctions.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeLayerFunctions.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeMIFProjection.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeSPRFile.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\functions\TeThemeFunctions.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_gdal/te_gdal.vcproj b/build/win32-msvc2005/te_gdal/te_gdal.vcproj
new file mode 100644
index 0000000..616fdd2
--- /dev/null
+++ b/build/win32-msvc2005/te_gdal/te_gdal.vcproj
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_gdal"
+	ProjectGUID="{5ECB35FB-BC2C-474A-90E0-33BBA989C14E}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_gdal\"
+			IntermediateDirectory="..\..\..\Debug\te_gdal\"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel,..\..\..\src\terralib\kernel,..\..\..\src\terralib\utils,..\..\..\src\terralib\drivers\gdal,..\..\..\..\thirdparty\gdal-1.7.2\gcore,..\..\..\..\thirdparty\gdal-1.7.2\port,..\..\..\..\thirdparty\gdal-1.7.2\ogr,..\..\..\..\thirdparty\gdal-1.7.2\ogr\ogrsf_frmts,D:\TerraView\terralib\build\qt\te_gdal,C:\Qt\3.2.0\mkspecs\win32-msvc.net"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,WIN32,TEGDAL_EXPORTS,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="..\..\..\Debug\te_gdal\"
+				ObjectFile="..\..\..\Debug\te_gdal\"
+				ProgramDataBaseFileName="..\..\..\Debug\te_gdal\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="gdal_i.lib terralib.lib te_utils.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_gdal.dll"
+				Version="3.61"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Debug/terralib;../../../Debug/te_utils;"../../../../thirdparty/gdal-1.7.2""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_gdal\"
+			IntermediateDirectory="..\..\..\Release\te_gdal\"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel,..\..\..\src\terralib\kernel,..\..\..\src\terralib\utils,..\..\..\src\terralib\drivers\gdal,..\..\..\..\thirdparty\gdal-1.7.2\gcore,..\..\..\..\thirdparty\gdal-1.7.2\port,..\..\..\..\thirdparty\gdal-1.7.2\ogr,..\..\..\..\thirdparty\gdal-1.7.2\ogr\ogrsf_frmts,D:\TerraView\terralib\build\qt\te_gdal,C:\Qt\3.2.0\mkspecs\win32-msvc.net"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,WIN32,TEGDAL_EXPORTS,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="..\..\..\Release\te_gdal\"
+				ObjectFile="..\..\..\Release\te_gdal\"
+				ProgramDataBaseFileName="..\..\..\Release\te_gdal\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="gdal_i.lib terralib.lib te_utils.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_gdal.dll"
+				Version="3.61"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Release/terralib;../../../Release/te_utils;"../../../../thirdparty/gdal-1.7.2""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeGDALDecoder.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeGDALUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRDriver.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRDriverFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRUtils.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeGDALDecoder.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeGDALDefines.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeGDALUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRDriver.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRDriverFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\gdal\TeOGRUtils.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_mysql/te_mysql.vcproj b/build/win32-msvc2005/te_mysql/te_mysql.vcproj
new file mode 100644
index 0000000..6f253c9
--- /dev/null
+++ b/build/win32-msvc2005/te_mysql/te_mysql.vcproj
@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_mysql"
+	ProjectGUID="{31C5E1F3-85BD-4580-973D-CA344342DD36}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_mysql"
+			IntermediateDirectory="..\..\..\Debug\te_mysql"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\MySQL;..\..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLMYSQL_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib libmysql.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_mysql.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Debug\terralib";"..\..\..\dependencies\win32\MySQL\lib\ms""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_mysql"
+			IntermediateDirectory="..\..\..\Release\te_mysql"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\MySQL;..\..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLMYSQL_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib libmysql.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_mysql.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Release\terralib";"..\..\..\dependencies\win32\MySQL\lib\ms""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\MySQL\TeMySQL.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\MySQL\TeMySQL.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\MySQL\TeMySQLDefines.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_oracle/te_oracle.vcproj b/build/win32-msvc2005/te_oracle/te_oracle.vcproj
new file mode 100644
index 0000000..1b96738
--- /dev/null
+++ b/build/win32-msvc2005/te_oracle/te_oracle.vcproj
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_oracle"
+	ProjectGUID="{EE0E1B28-F969-4F8C-8D18-B31250403089}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_oracle"
+			IntermediateDirectory="..\..\..\Debug\te_oracle"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\Oracle;..\..\..\src\terralib\drivers\Oracle\OCI\include"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLORACLE_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib Oci.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_oracle.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Debug\terralib";"..\..\..\dependencies\win32\Oracle\lib""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_oracle"
+			IntermediateDirectory="..\..\..\Release\te_oracle"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\Oracle;..\..\..\src\terralib\drivers\Oracle\OCI\include"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLORACLE_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib Oci.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_oracle.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Release\terralib";"..\..\..\dependencies\win32\Oracle\lib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCIConnect.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCICursor.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCIOracle.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCISDO.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOracleSpatial.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCIConnect.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCICursor.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCIOracle.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOCISDO.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOracleDefines.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\Oracle\TeOracleSpatial.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_postgresql/te_postgresql.vcproj b/build/win32-msvc2005/te_postgresql/te_postgresql.vcproj
new file mode 100644
index 0000000..10f1b58
--- /dev/null
+++ b/build/win32-msvc2005/te_postgresql/te_postgresql.vcproj
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_postgresql"
+	ProjectGUID="{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_postgresql"
+			IntermediateDirectory="..\..\..\Debug\te_postgresql"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\PostgreSQL;..\..\..\src\terralib\drivers\PostgreSQL\includepg"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLPOSTGRESQL_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib libpq.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_postgresql.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Debug\terralib";"..\..\..\dependencies\win32\PostgreSQL\lib""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_postgresql"
+			IntermediateDirectory="..\..\..\Release\te_postgresql"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\PostgreSQL;..\..\..\src\terralib\drivers\PostgreSQL\includepg"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLPOSTGRESQL_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib libpq.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_postgresql.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Release\terralib";"..\..\..\dependencies\win32\PostgreSQL\lib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePGInterface.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePGUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePostGIS.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePostgreSQL.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePGInterface.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePGUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePostGIS.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePostgreSQL.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\PostgreSQL\TePostgreSQLDefines.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_qwt/te_qwt.vcproj b/build/win32-msvc2005/te_qwt/te_qwt.vcproj
new file mode 100644
index 0000000..7dd6738
--- /dev/null
+++ b/build/win32-msvc2005/te_qwt/te_qwt.vcproj
@@ -0,0 +1,340 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_qwt"
+	ProjectGUID="{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_qwt"
+			IntermediateDirectory="..\..\..\Debug\te_qwt"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\qwt;..\..\..\src\qwt\include;"$(QTDIR)\include";..\..\..\ui\terraView\;..\..\..\moc\terraView\"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLQWT_AS_DLL,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib qwt.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_qwt.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/qwt";"$(QTDIR)\lib""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_qwt"
+			IntermediateDirectory="..\..\..\Release\te_qwt"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\qwt;..\..\..\src\qwt\include;"$(QTDIR)\include";..\..\..\ui\terraView\;..\..\..\moc\terraView\"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLQWT_AS_DLL,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib qwt.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_qwt.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/qwt";"$(QTDIR)\lib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlot.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotCurve.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtDefines.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlot.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlot.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlot.h -o ..\..\..\moc\terraView\moc_TeQwtPlot.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlot.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlot.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlot.h -o ..\..\..\moc\terraView\moc_TeQwtPlot.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlot.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotCurve.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.h -o ..\..\..\moc\terraView\moc_TeQwtPlotPicker.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlotPicker.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlotPicker.h -o ..\..\..\moc\terraView\moc_TeQwtPlotPicker.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlotPicker.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.h -o ..\..\..\moc\terraView\moc_TeQwtPlotZoomer.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlotZoomer.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qwt\TeQwtPlotZoomer.h -o ..\..\..\moc\terraView\moc_TeQwtPlotZoomer.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQwtPlotZoomer.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated MOC Files"
+			Filter="cpp;c;cxx;moc"
+			>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_TeQwtPlot.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_TeQwtPlotPicker.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_TeQwtPlotZoomer.cpp"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_shapelib/te_shapelib.vcproj b/build/win32-msvc2005/te_shapelib/te_shapelib.vcproj
new file mode 100644
index 0000000..0e42493
--- /dev/null
+++ b/build/win32-msvc2005/te_shapelib/te_shapelib.vcproj
@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_shapelib"
+	ProjectGUID="{18CAE353-F7DD-4FDA-971A-48D856DA0635}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_shapelib"
+			IntermediateDirectory="..\..\..\Debug\te_shapelib"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\shapelib;..\..\..\src\shapelib"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLSHP_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="shapelib.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_shapelib.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/shapelib""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)\$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_shapelib"
+			IntermediateDirectory="..\..\..\Release\te_shapelib"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\shapelib;..\..\..\src\shapelib"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLSHP_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="shapelib.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_shapelib.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/shapelib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\shapelib\TeDriverSHPDBF.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\shapelib\TeSHPDriverFactory.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\shapelib\TeDriverSHPDBF.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\shapelib\TeSHPDefines.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\shapelib\TeSHPDriverFactory.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_spl/te_spl.vcproj b/build/win32-msvc2005/te_spl/te_spl.vcproj
new file mode 100644
index 0000000..865cacc
--- /dev/null
+++ b/build/win32-msvc2005/te_spl/te_spl.vcproj
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_spl"
+	ProjectGUID="{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_spl"
+			IntermediateDirectory="..\..\..\Debug\te_spl"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\spl;..\..\..\src\libspl;"$(QTDIR)\include""
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,WIN32,TLSPL_AS_DLL,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib libspl.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_spl.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/libspl";"$(QTDIR)\lib""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_spl"
+			IntermediateDirectory="..\..\..\Release\te_spl"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\drivers\spl;..\..\..\src\libspl;"$(QTDIR)\include""
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,WIN32,TLSPL_AS_DLL,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib libspl.lib terralib.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_spl.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/libspl";"$(QTDIR)\lib""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginMetadata.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginParameters.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginsManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginsSignal.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginInfo.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginMetadata.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginParameters.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginsManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginsParametersContainer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\PluginsSignal.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\spl\TeSPLDefines.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/te_utils/te_utils.vcproj b/build/win32-msvc2005/te_utils/te_utils.vcproj
new file mode 100644
index 0000000..1b889a0
--- /dev/null
+++ b/build/win32-msvc2005/te_utils/te_utils.vcproj
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="te_utils"
+	ProjectGUID="{6F8DD2AE-66D4-442A-B204-114A1EF99335}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\te_utils"
+			IntermediateDirectory="..\..\..\Debug\te_utils"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\utils;..\..\..\src\terralib\functions"
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,_WINDOWS,WIN32,TLUTILS_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib te_functions.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Debug\te_utils.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/te_functions""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\te_utils"
+			IntermediateDirectory="..\..\..\Release\te_utils"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\kernel;..\..\..\src\terralib\utils;..\..\..\src\terralib\functions"
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,_WINDOWS,WIN32,TLUTILS_AS_DLL,QT_DLL"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="terralib.lib te_functions.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\te_utils.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/te_functions""
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\mtrand.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeColorUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeDatabaseUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeUpdateDBVersion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeWKBGeometryDecoder.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeWKTGeometryDecoder.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\mtrand.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeColorUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeDatabaseUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeUpdateDBVersion.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeUtilsDefines.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeWKBGeometryDecoder.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\utils\TeWKTGeometryDecoder.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/terraView/terraView.sln b/build/win32-msvc2005/terraView/terraView.sln
new file mode 100644
index 0000000..3e1fc94
--- /dev/null
+++ b/build/win32-msvc2005/terraView/terraView.sln
@@ -0,0 +1,224 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dxf", "..\dxf\dxf.vcproj", "{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_firebird", "..\te_firebird\te_firebird.vcproj", "{DC4338DD-BAE5-487D-9688-573DE607CDFD}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralibpdi", "..\terralibpdi\terralibpdi.vcproj", "{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspl", "..\libspl\libspl.vcproj", "{1A9CF14C-46CC-450C-B62E-5354751C53F0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_mysql", "..\te_mysql\te_mysql.vcproj", "{31C5E1F3-85BD-4580-973D-CA344342DD36}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_oracle", "..\te_oracle\te_oracle.vcproj", "{EE0E1B28-F969-4F8C-8D18-B31250403089}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_postgresql", "..\te_postgresql\te_postgresql.vcproj", "{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qwt", "..\qwt\qwt.vcproj", "{4AED2E04-C11A-40BE-9F3A-331C7261F35C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapelib", "..\shapelib\shapelib.vcproj", "{C4A3E074-08E5-4197-ABB7-06611BAC269D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stat", "..\stat\stat.vcproj", "{45D098C2-1280-461A-A73B-1333F95C916C}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_functions", "..\te_functions\te_functions.vcproj", "{877A1388-B3CA-481A-9BFB-C7178EC68D0B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_qwt", "..\te_qwt\te_qwt.vcproj", "{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}"
+	ProjectSection(ProjectDependencies) = postProject
+		{4AED2E04-C11A-40BE-9F3A-331C7261F35C} = {4AED2E04-C11A-40BE-9F3A-331C7261F35C}
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_shapelib", "..\te_shapelib\te_shapelib.vcproj", "{18CAE353-F7DD-4FDA-971A-48D856DA0635}"
+	ProjectSection(ProjectDependencies) = postProject
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D} = {C4A3E074-08E5-4197-ABB7-06611BAC269D}
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_utils", "..\te_utils\te_utils.vcproj", "{6F8DD2AE-66D4-442A-B204-114A1EF99335}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_dxf", "..\te_dxf\te_dxf.vcproj", "{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4} = {5AC793EF-07E3-44DA-AE88-E8D6546A73E4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\terralib\terralib.vcproj", "{1253197A-5710-4924-9706-6449C0C32FE9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D} = {C4A3E074-08E5-4197-ABB7-06611BAC269D}
+		{DD1ADACD-7990-4793-9952-25197394954A} = {DD1ADACD-7990-4793-9952-25197394954A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\tiff\tiff.vcproj", "{DD1ADACD-7990-4793-9952-25197394954A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terraView", "terraView.vcproj", "{1632841E-001E-4357-83C4-C44B0DAAEA20}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F48C5F57-666A-4AA1-997B-A6132B4AE4E0} = {F48C5F57-666A-4AA1-997B-A6132B4AE4E0}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terraViewCore", "..\terraViewCore\terraViewCore.vcproj", "{F48C5F57-666A-4AA1-997B-A6132B4AE4E0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83} = {56D7AA1F-BA95-4B48-843A-D264BEFF4E83}
+		{EE0E1B28-F969-4F8C-8D18-B31250403089} = {EE0E1B28-F969-4F8C-8D18-B31250403089}
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635} = {18CAE353-F7DD-4FDA-971A-48D856DA0635}
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A} = {BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}
+		{2A804C6A-0669-4D88-8FBC-BFD56AFA9105} = {2A804C6A-0669-4D88-8FBC-BFD56AFA9105}
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6} = {3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}
+		{BCC66EA6-824F-42D7-AB3F-46AFF3F18829} = {BCC66EA6-824F-42D7-AB3F-46AFF3F18829}
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4} = {1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD} = {DC4338DD-BAE5-487D-9688-573DE607CDFD}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B} = {F615229C-247C-4DF2-92C4-B891BC27BD9B}
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_apputils", "..\te_apputils\te_apputils.vcproj", "{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335} = {6F8DD2AE-66D4-442A-B204-114A1EF99335}
+		{45D098C2-1280-461A-A73B-1333F95C916C} = {45D098C2-1280-461A-A73B-1333F95C916C}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_spl", "..\te_spl\te_spl.vcproj", "{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+		{1A9CF14C-46CC-450C-B62E-5354751C53F0} = {1A9CF14C-46CC-450C-B62E-5354751C53F0}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_ado", "..\te_ado\te_ado.vcproj", "{F615229C-247C-4DF2-92C4-B891BC27BD9B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4} = {1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Debug|Win32.Build.0 = Debug|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Release|Win32.ActiveCfg = Release|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Release|Win32.Build.0 = Release|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Debug|Win32.Build.0 = Debug|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Release|Win32.ActiveCfg = Release|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Release|Win32.Build.0 = Release|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Debug|Win32.ActiveCfg = Debug|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Debug|Win32.Build.0 = Debug|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Release|Win32.ActiveCfg = Release|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Release|Win32.Build.0 = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug|Win32.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release|Win32.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release|Win32.Build.0 = Release|Win32
+		{1A9CF14C-46CC-450C-B62E-5354751C53F0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1A9CF14C-46CC-450C-B62E-5354751C53F0}.Debug|Win32.Build.0 = Debug|Win32
+		{1A9CF14C-46CC-450C-B62E-5354751C53F0}.Release|Win32.ActiveCfg = Release|Win32
+		{1A9CF14C-46CC-450C-B62E-5354751C53F0}.Release|Win32.Build.0 = Release|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Debug|Win32.ActiveCfg = Debug|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Debug|Win32.Build.0 = Debug|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Release|Win32.ActiveCfg = Release|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Release|Win32.Build.0 = Release|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Debug|Win32.Build.0 = Debug|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Release|Win32.ActiveCfg = Release|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Release|Win32.Build.0 = Release|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Debug|Win32.Build.0 = Debug|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Release|Win32.ActiveCfg = Release|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Release|Win32.Build.0 = Release|Win32
+		{4AED2E04-C11A-40BE-9F3A-331C7261F35C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4AED2E04-C11A-40BE-9F3A-331C7261F35C}.Debug|Win32.Build.0 = Debug|Win32
+		{4AED2E04-C11A-40BE-9F3A-331C7261F35C}.Release|Win32.ActiveCfg = Release|Win32
+		{4AED2E04-C11A-40BE-9F3A-331C7261F35C}.Release|Win32.Build.0 = Release|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Debug|Win32.Build.0 = Debug|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Release|Win32.ActiveCfg = Release|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Release|Win32.Build.0 = Release|Win32
+		{45D098C2-1280-461A-A73B-1333F95C916C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{45D098C2-1280-461A-A73B-1333F95C916C}.Debug|Win32.Build.0 = Debug|Win32
+		{45D098C2-1280-461A-A73B-1333F95C916C}.Release|Win32.ActiveCfg = Release|Win32
+		{45D098C2-1280-461A-A73B-1333F95C916C}.Release|Win32.Build.0 = Release|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Debug|Win32.Build.0 = Debug|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Release|Win32.ActiveCfg = Release|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Release|Win32.Build.0 = Release|Win32
+		{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}.Debug|Win32.Build.0 = Debug|Win32
+		{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}.Release|Win32.ActiveCfg = Release|Win32
+		{2A804C6A-0669-4D88-8FBC-BFD56AFA9105}.Release|Win32.Build.0 = Release|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Debug|Win32.ActiveCfg = Debug|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Debug|Win32.Build.0 = Debug|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Release|Win32.ActiveCfg = Release|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Release|Win32.Build.0 = Release|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Debug|Win32.Build.0 = Debug|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Release|Win32.ActiveCfg = Release|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Release|Win32.Build.0 = Release|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Debug|Win32.Build.0 = Debug|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Release|Win32.ActiveCfg = Release|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Release|Win32.Build.0 = Release|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Debug|Win32.Build.0 = Debug|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Release|Win32.ActiveCfg = Release|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Release|Win32.Build.0 = Release|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Debug|Win32.Build.0 = Debug|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Release|Win32.ActiveCfg = Release|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Release|Win32.Build.0 = Release|Win32
+		{1632841E-001E-4357-83C4-C44B0DAAEA20}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1632841E-001E-4357-83C4-C44B0DAAEA20}.Debug|Win32.Build.0 = Debug|Win32
+		{1632841E-001E-4357-83C4-C44B0DAAEA20}.Release|Win32.ActiveCfg = Release|Win32
+		{1632841E-001E-4357-83C4-C44B0DAAEA20}.Release|Win32.Build.0 = Release|Win32
+		{F48C5F57-666A-4AA1-997B-A6132B4AE4E0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F48C5F57-666A-4AA1-997B-A6132B4AE4E0}.Debug|Win32.Build.0 = Debug|Win32
+		{F48C5F57-666A-4AA1-997B-A6132B4AE4E0}.Release|Win32.ActiveCfg = Release|Win32
+		{F48C5F57-666A-4AA1-997B-A6132B4AE4E0}.Release|Win32.Build.0 = Release|Win32
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}.Debug|Win32.Build.0 = Debug|Win32
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}.Release|Win32.ActiveCfg = Release|Win32
+		{1F8E1FC8-113E-4BD3-A54D-6F74E2D2EFC4}.Release|Win32.Build.0 = Release|Win32
+		{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}.Debug|Win32.Build.0 = Debug|Win32
+		{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}.Release|Win32.ActiveCfg = Release|Win32
+		{BCC66EA6-824F-42D7-AB3F-46AFF3F18829}.Release|Win32.Build.0 = Release|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Debug|Win32.Build.0 = Debug|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Release|Win32.ActiveCfg = Release|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/build/win32-msvc2005/terraView/terraView.vcproj b/build/win32-msvc2005/terraView/terraView.vcproj
new file mode 100644
index 0000000..90797e2
--- /dev/null
+++ b/build/win32-msvc2005/terraView/terraView.vcproj
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="terraView"
+	ProjectGUID="{1632841E-001E-4357-83C4-C44B0DAAEA20}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\terraView"
+			IntermediateDirectory="..\..\..\Debug\terraView"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="0"
+				AdditionalIncludeDirectories=""..\..\..\src\terralib\kernel";"..\..\..\terraView";"..\..\..\src\qwt\include";"..\..\..\src\terralib\drivers\qwt";"..\..\..\src\terralib\drivers\shapelib";"..\..\..\src\terralib\drivers\DXF";"..\..\..\src\terralib\utils";"..\..\..\src\terralib\functions";"..\..\..\src\terralib\stat";"..\..\..\src\shapelib";"..\..\..\src\zlib";"..\..\..\src\ [...]
+				PreprocessorDefinitions="_WINDOWS;_DEBUG;WIN32;QT_DLL;QT_THREAD_SUPPORT;UNICODE"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="false"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib qtmain.lib te_dxf.lib te_shapelib.lib terralib.lib terraViewCore.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib $(NOINHERIT)"
+				OutputFile="..\..\..\Debug\terraView.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/terraViewCore";"..\..\../Debug/te_dxf";"..\..\../Debug/te_shapelib";"$(QTDIR)\lib""
+				IgnoreDefaultLibraryNames="msvcrt.lib"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="1"
+				BaseAddress=""
+				ImportLibrary=""
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copying dependencies..\..\..."
+				CommandLine="copy ..\..\..\dependencies\win32\ado\bin\*.dll ..\..\..\Debug&#x0D;&#x0A;copy ..\..\..\dependencies\win32\Oracle\bin\*.dll ..\..\..\Debug&#x0D;&#x0A;copy ..\..\..\dependencies\win32\MySQL\bin\*.dll ..\..\..\Debug&#x0D;&#x0A;copy ..\..\..\dependencies\win32\PostgreSQL\bin\*.dll ..\..\..\Debug&#x0D;&#x0A;copy ..\..\..\dependencies\win32\zlib\bin\*.dll ..\..\..\Debug&#x0D;&#x0A;copy ..\..\..\dependencies\win32\DSDK\Debug\bin\*.dll ..\..\..\Debug&#x0D;&#x0A;if not exist ..\. [...]
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\terraView"
+			IntermediateDirectory="..\..\..\Release\terraView"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="1"
+				AdditionalIncludeDirectories=""..\..\..\src\terralib\kernel";.;"..\..\..\src\qwt\include";"..\..\..\src\terralib\drivers\qwt";"..\..\..\src\terralib\drivers\shapelib";"..\..\..\src\terralib\drivers\DXF";"..\..\..\src\terralib\utils";"..\..\..\src\terralib\functions";"..\..\..\src\terralib\stat";"..\..\..\src\shapelib";"..\..\..\src\zlib";"..\..\..\src\libspl";ui;"..\..\. [...]
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,WIN32,UNICODE,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib qtmain.lib te_dxf.lib te_shapelib.lib terralib.lib terraViewCore.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\terraView.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\..\Release\terralib";"..\..\..\Release\terraViewCore";"..\..\..\Release\te_dxf";"..\..\..\Release\te_shapelib";"$(QTDIR)\lib""
+				IgnoreDefaultLibraryNames=""
+				DelayLoadDLLs=""
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copying dependencies..\..\..."
+				CommandLine="copy ..\..\..\dependencies\win32\ado\bin\*.dll ..\..\..\Release&#x0D;&#x0A;copy ..\..\..\dependencies\win32\Oracle\bin\*.dll ..\..\..\Release&#x0D;&#x0A;copy ..\..\..\dependencies\win32\MySQL\bin\*.dll ..\..\..\Release&#x0D;&#x0A;copy ..\..\..\dependencies\win32\PostgreSQL\bin\*.dll ..\..\..\Release&#x0D;&#x0A;copy ..\..\..\dependencies\win32\zlib\bin\*.dll ..\..\..\Release&#x0D;&#x0A;copy ..\..\..\dependencies\win32\DSDK\Release\bin\*.dll ..\..\..\Release&#x0D;&#x0A;cop [...]
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\terraView\main.cpp"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/terraViewCore/.imgcol b/build/win32-msvc2005/terraViewCore/.imgcol
new file mode 100644
index 0000000..209eef0
--- /dev/null
+++ b/build/win32-msvc2005/terraViewCore/.imgcol
@@ -0,0 +1 @@
+../../../terraView/ui/images/addressDictionary.png ../../../terraView/ui/images/addressLayer.png ../../../terraView/ui/images/addressReferenceLayer.png ../../../terraView/ui/images/addressTable.png ../../../terraView/ui/images/and.bmp ../../../terraView/ui/images/area.bmp ../../../terraView/ui/images/buffer.bmp ../../../terraView/ui/images/bufferNoUnion.bmp ../../../terraView/ui/images/bufferUnion.bmp ../../../terraView/ui/images/clearColor.bmp ../../../terraView/ui/images/closeDB.bmp .. [...]
diff --git a/build/win32-msvc2005/terraViewCore/terraViewCore.vcproj b/build/win32-msvc2005/terraViewCore/terraViewCore.vcproj
new file mode 100644
index 0000000..22efcf7
--- /dev/null
+++ b/build/win32-msvc2005/terraViewCore/terraViewCore.vcproj
@@ -0,0 +1,4411 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="terraViewCore"
+	ProjectGUID="{F48C5F57-666A-4AA1-997B-A6132B4AE4E0}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\terraViewCore"
+			IntermediateDirectory="..\..\..\Debug\terraViewCore"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				Description="Generate imagecollection"
+				CommandLine="$(QTDIR)\bin\uic.exe -embed terraViewCore -f .imgcol -o qmake_image_collection.cpp"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=""..\..\..\src\terralib\kernel";"..\..\..\src\terralib\drivers\ado";"..\..\..\terraView";"..\..\..\src\qwt\include";"..\..\..\src\terralib\drivers\qwt";"..\..\..\src\terralib\drivers\spl";"..\..\..\src\terralib\drivers\shapelib";"..\..\..\src\terralib\utils";"..\..\..\src\terralib\functions";"..\..\..\src\terralib\stat";"..\..\..\src\shapelib";&qu [...]
+				PreprocessorDefinitions="_WINDOWS,_DEBUG,WIN32,TVIEW_AS_DLL,IBPP_WINDOWS,UNICODE,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib te_spl.lib libjpeg.lib tiff.lib terralib.lib terralibpdi.lib stat.lib shapelib.lib qwt.lib te_functions.lib te_utils.lib te_qwt.lib te_shapelib.lib te_apputils.lib opengl32.lib glu32.lib lti_dsdk_dll.lib gdalogr.lib te_mysql.lib te_postgresql.lib te_oracle.lib te_firebird.lib te_ado.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib $(NOINHERIT)"
+				OutputFile="..\..\..\Debug\terraViewCore.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Debug/terralib";"..\..\../Debug/qwt";"..\..\../Debug/stat";"..\..\../Debug/tiff";"..\..\../Debug/shapelib";"..\..\../Debug/libjpeg";"..\..\../Debug/te_spl";"..\..\../Debug/terralibpdi";"..\..\../Debug/te_utils";"..\..\../Debug/te_functions";"..\..\../Debug/te_qwt";"..\..\../Debug/te_shapelib";"..\..\../Debug/te_apputils&q [...]
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\terraViewCore"
+			IntermediateDirectory="..\..\..\Release\terraViewCore"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				Description="Generate imagecollection"
+				CommandLine="$(QTDIR)\bin\uic.exe -embed terraViewCore -f .imgcol -o qmake_image_collection.cpp"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="1"
+				AdditionalIncludeDirectories=""..\..\..\src\terralib\kernel";"..\..\..\src\terralib\drivers\ado";"..\..\..\terraView";"..\..\..\src\qwt\include";"..\..\..\src\terralib\drivers\qwt";"..\..\..\src\terralib\drivers\spl";"..\..\..\src\terralib\drivers\shapelib";"..\..\..\src\terralib\utils";"..\..\..\src\terralib\functions";"..\..\..\src\terralib\stat";"..\..\..\src\shapelib";&qu [...]
+				PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,_WINDOWS,NDEBUG,WIN32,TVIEW_AS_DLL,IBPP_WINDOWS,UNICODE,QT_DLL,QT_THREAD_SUPPORT"
+				GeneratePreprocessedFile="0"
+				ExceptionHandling="1"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="true"
+				RuntimeTypeInfo="true"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="0"
+				DisableSpecificWarnings="4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="qt.lib libspl.lib libjpeg.lib tiff.lib terralib.lib terralibpdi.lib stat.lib shapelib.lib qwt.lib te_functions.lib te_utils.lib te_qwt.lib te_shapelib.lib te_apputils.lib opengl32.lib glu32.lib lti_dsdk_dll.lib gdalogr.lib te_mysql.lib te_postgresql.lib te_oracle.lib te_firebird.lib te_ado.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\..\..\Release\terraViewCore.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""..\..\../Release/terralib";"..\..\../Release/qwt";"..\..\../Release/stat";"..\..\../Release/tiff";"..\..\../Release/shapelib";"..\..\../Release/libjpeg";"..\..\../Release/libspl";"..\..\../Release/terralibpdi";"..\..\../Release/te_utils";"..\..\../Release/te_functions";"..\..\../Release/te_qwt";"..\..\../Release/te_shapelib";"..\. [...]
+				DelayLoadDLLs="comdlg32.dll,oleaut32.dll,winmm.dll,wsock32.dll,winspool.dll"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				BaseAddress="0x39D00000"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\terraView\ui\addColumn.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressChoiceWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressLocatorWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressNameSeparator.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addTheme.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addView.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\anaesp.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\bayesWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColData.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColumnName.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColumnType.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeMinMax.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\connectView.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\contrast.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\countComputing.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createBuffersWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createCells.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createLayerFromTheme.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createProxMatrix.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createTable.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createTextRepresentation.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createThemeFromTheme.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\database.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\display.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\displaySize.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\exportLayersThemes.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\exportWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\generateSamplePoints.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geographicalGrid.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAdd.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAggregation.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayDifference.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayIntersection.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayUnion.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphic.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphic3DWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphicConfigurationWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphicParams.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\histogramBuildForm.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\import.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importRasterSimple.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTable.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTablePoints.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTbl.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTblPoints.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertPoint.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertSymbol.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertText.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\kernelRatioWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\kernelWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\layerProp.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\lbsDefinition.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\legendWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\linkExtTable.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\localBayesWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\pieBarChart.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\PluginSupportFunctions.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\printFileResolution.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\projection.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\query.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterColorCompositionWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterImportWizard.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterSlicingWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterTransparency.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\removeTable.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveAsTable.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveRaster.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveTableAsTxt.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveThemeToFileWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selectProxMatrix.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selectTextRepresentation.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selThemeTables.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\semivar.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\skaterWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\spatializationWindow.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\spatialQuery.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\statistic.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\tableProp.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\telayer_metadata.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtMethods.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTerraStat.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\terraView.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\terraViewBase.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\textRep.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\themeVis.ui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\TViewAbstractPlugin.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\visual.ui.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\PluginSupportFunctions.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtMethods.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtMethods.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtMethods.h -o ..\..\..\moc\terraView\moc_TeQtMethods.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQtMethods.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtMethods.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtMethods.h -o ..\..\..\moc\terraView\moc_TeQtMethods.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQtMethods.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\qt\TeQtTerraStat.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtTerraStat.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtTerraStat.h -o ..\..\..\moc\terraView\moc_TeQtTerraStat.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQtTerraStat.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\src\terralib\drivers\qt\TeQtTerraStat.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\src\terralib\drivers\qt\TeQtTerraStat.h -o ..\..\..\moc\terraView\moc_TeQtTerraStat.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_TeQtTerraStat.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\terraView\terraView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\terraView\terraView.h -o ..\..\..\moc\terraView\moc_terraView.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_terraView.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Moc'ing ..\..\..\terraView\terraView.h..."
+						CommandLine="$(QTDIR)\bin\moc.exe ..\..\..\terraView\terraView.h -o ..\..\..\moc\terraView\moc_terraView.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+						Outputs="..\..\..\moc\terraView\moc_terraView.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\TViewAbstractPlugin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\TViewDefines.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated MOC Files"
+			Filter="cpp;c;cxx;moc"
+			>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addColumn.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addressChoiceWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addressLocatorWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addressNameSeparator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_addView.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_anaesp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_bayesWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_changeColData.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_changeColumnName.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_changeColumnType.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_changeMinMax.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_connectView.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_contrast.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_countComputing.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createBuffersWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createCells.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createLayerFromTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createProxMatrix.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createTextRepresentation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_createThemeFromTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_database.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_databaseProp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_display.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_displaySize.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_exportLayersThemes.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_exportWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_generateSamplePoints.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geographicalGrid.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpAdd.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpAggregation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpAssignDataLocationCollect.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpAssignDataLocationDistribute.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpOverlayDifference.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpOverlayIntersection.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_geoOpOverlayUnion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_graphic.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_graphic3DWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_graphicConfigurationWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_graphicParams.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_histogramBuildForm.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_import.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_importRasterSimple.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_importTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_importTablePoints.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_importTbl.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_importTblPoints.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_insertPoint.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_insertSymbol.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_insertText.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_kernelRatioWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_kernelWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_layerProp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_lbsDefinition.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_legendWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_linkExtTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_localBayesWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_pieBarChart.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_printFileResolution.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_projection.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_query.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_rasterColorCompositionWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_rasterImportWizard.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_rasterSlicingWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_rasterTransparency.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_removeTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_saveAndLoadColorBarWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_saveAsTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_saveRaster.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_saveTableAsTxt.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_saveThemeToFileWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_selectProxMatrix.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_selectTextRepresentation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_selThemeTables.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_semivar.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_skaterWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_spatializationWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_spatialQuery.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_statistic.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_tableProp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_telayer_metadata.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_TeQtMethods.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_TeQtTerraStat.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_terraView.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_terraViewBase.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_textRep.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_themeProp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_themeVis.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_viewProp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\moc\terraView\moc_visual.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Generated UI Files"
+			Filter="cpp;c;cxx;h;hpp;hxx;"
+			>
+			<File
+				RelativePath="..\..\..\ui\terraView\addColumn.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addColumn.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressChoiceWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressChoiceWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressLocatorWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressLocatorWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressNameSeparator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addressNameSeparator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addTheme.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addView.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\addView.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\anaesp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\anaesp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\bayesWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\bayesWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColData.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColData.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColumnName.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColumnName.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColumnType.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeColumnType.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeMinMax.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\changeMinMax.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\connectView.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\connectView.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\contrast.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\contrast.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\countComputing.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\countComputing.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createBuffersWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createBuffersWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createCells.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createCells.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createLayerFromTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createLayerFromTheme.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createProxMatrix.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createProxMatrix.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createTable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createTextRepresentation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createTextRepresentation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createThemeFromTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\createThemeFromTheme.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\database.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\database.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\databaseProp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\databaseProp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\display.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\display.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\displaySize.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\displaySize.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\exportLayersThemes.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\exportLayersThemes.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\exportWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\exportWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\generateSamplePoints.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\generateSamplePoints.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geographicalGrid.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geographicalGrid.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAdd.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAdd.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAggregation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAggregation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAssignDataLocationCollect.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayDifference.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayDifference.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayIntersection.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayIntersection.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayUnion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\geoOpOverlayUnion.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphic.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphic.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphic3DWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphic3DWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphicConfigurationWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphicConfigurationWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphicParams.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\graphicParams.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\histogramBuildForm.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\histogramBuildForm.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\import.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\import.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importRasterSimple.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importRasterSimple.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTablePoints.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTablePoints.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTbl.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTbl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTblPoints.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\importTblPoints.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertPoint.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertPoint.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertSymbol.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertSymbol.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertText.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\insertText.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\kernelRatioWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\kernelRatioWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\kernelWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\kernelWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\layerProp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\layerProp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\lbsDefinition.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\lbsDefinition.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\legendWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\legendWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\linkExtTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\linkExtTable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\localBayesWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\localBayesWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\pieBarChart.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\pieBarChart.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\printFileResolution.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\printFileResolution.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\projection.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\projection.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\query.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\query.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterColorCompositionWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterColorCompositionWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterImportWizard.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterImportWizard.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterSlicingWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterSlicingWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterTransparency.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\rasterTransparency.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\removeTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\removeTable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveAndLoadColorBarWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveAndLoadColorBarWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveAsTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveAsTable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveRaster.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveRaster.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveTableAsTxt.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveTableAsTxt.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveThemeToFileWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\saveThemeToFileWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selectProxMatrix.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selectProxMatrix.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selectTextRepresentation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selectTextRepresentation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selThemeTables.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\selThemeTables.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\semivar.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\semivar.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\skaterWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\skaterWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\spatializationWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\spatializationWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\spatialQuery.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\spatialQuery.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\statistic.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\statistic.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\tableProp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\tableProp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\telayer_metadata.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\telayer_metadata.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\terraViewBase.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\terraViewBase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\textRep.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\textRep.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\themeProp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\themeProp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\themeVis.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\themeVis.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\viewProp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\viewProp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\visual.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ui\terraView\visual.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Forms"
+			Filter="ui"
+			ParseFiles="false"
+			>
+			<File
+				RelativePath="..\..\..\terraView\ui\addColumn.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addColumn.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addColumn.ui -o ..\..\..\ui\terraView\addColumn.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addColumn.ui -i addColumn.h -o ..\..\..\ui\terraView\addColumn.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addColumn.h -o ..\..\..\moc\terraView\moc_addColumn.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addColumn.h;..\..\..\ui\terraView\addColumn.cpp;..\..\..\moc\terraView\moc_addColumn.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addColumn.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addColumn.ui -o ..\..\..\ui\terraView\addColumn.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addColumn.ui -i addColumn.h -o ..\..\..\ui\terraView\addColumn.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addColumn.h -o ..\..\..\moc\terraView\moc_addColumn.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addColumn.h;..\..\..\ui\terraView\addColumn.cpp;..\..\..\moc\terraView\moc_addColumn.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressChoiceWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressChoiceWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressChoiceWindow.ui -o ..\..\..\ui\terraView\addressChoiceWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressChoiceWindow.ui -i addressChoiceWindow.h -o ..\..\..\ui\terraView\addressChoiceWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressChoiceWindow.h -o ..\..\..\moc\terraView\moc_addressChoiceWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressChoiceWindow.h;..\..\..\ui\terraView\addressChoiceWindow.cpp;..\..\..\moc\terraView\moc_addressChoiceWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressChoiceWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressChoiceWindow.ui -o ..\..\..\ui\terraView\addressChoiceWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressChoiceWindow.ui -i addressChoiceWindow.h -o ..\..\..\ui\terraView\addressChoiceWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressChoiceWindow.h -o ..\..\..\moc\terraView\moc_addressChoiceWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressChoiceWindow.h;..\..\..\ui\terraView\addressChoiceWindow.cpp;..\..\..\moc\terraView\moc_addressChoiceWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressLocatorWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressLocatorWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressLocatorWindow.ui -o ..\..\..\ui\terraView\addressLocatorWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressLocatorWindow.ui -i addressLocatorWindow.h -o ..\..\..\ui\terraView\addressLocatorWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressLocatorWindow.h -o ..\..\..\moc\terraView\moc_addressLocatorWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressLocatorWindow.h;..\..\..\ui\terraView\addressLocatorWindow.cpp;..\..\..\moc\terraView\moc_addressLocatorWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressLocatorWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressLocatorWindow.ui -o ..\..\..\ui\terraView\addressLocatorWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressLocatorWindow.ui -i addressLocatorWindow.h -o ..\..\..\ui\terraView\addressLocatorWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressLocatorWindow.h -o ..\..\..\moc\terraView\moc_addressLocatorWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressLocatorWindow.h;..\..\..\ui\terraView\addressLocatorWindow.cpp;..\..\..\moc\terraView\moc_addressLocatorWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addressNameSeparator.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressNameSeparator.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressNameSeparator.ui -o ..\..\..\ui\terraView\addressNameSeparator.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressNameSeparator.ui -i addressNameSeparator.h -o ..\..\..\ui\terraView\addressNameSeparator.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressNameSeparator.h -o ..\..\..\moc\terraView\moc_addressNameSeparator.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressNameSeparator.h;..\..\..\ui\terraView\addressNameSeparator.cpp;..\..\..\moc\terraView\moc_addressNameSeparator.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addressNameSeparator.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressNameSeparator.ui -o ..\..\..\ui\terraView\addressNameSeparator.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addressNameSeparator.ui -i addressNameSeparator.h -o ..\..\..\ui\terraView\addressNameSeparator.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addressNameSeparator.h -o ..\..\..\moc\terraView\moc_addressNameSeparator.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addressNameSeparator.h;..\..\..\ui\terraView\addressNameSeparator.cpp;..\..\..\moc\terraView\moc_addressNameSeparator.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addTheme.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addTheme.ui -o ..\..\..\ui\terraView\addTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addTheme.ui -i addTheme.h -o ..\..\..\ui\terraView\addTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addTheme.h -o ..\..\..\moc\terraView\moc_addTheme.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addTheme.h;..\..\..\ui\terraView\addTheme.cpp;..\..\..\moc\terraView\moc_addTheme.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addTheme.ui -o ..\..\..\ui\terraView\addTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addTheme.ui -i addTheme.h -o ..\..\..\ui\terraView\addTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addTheme.h -o ..\..\..\moc\terraView\moc_addTheme.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addTheme.h;..\..\..\ui\terraView\addTheme.cpp;..\..\..\moc\terraView\moc_addTheme.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\addView.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addView.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addView.ui -o ..\..\..\ui\terraView\addView.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addView.ui -i addView.h -o ..\..\..\ui\terraView\addView.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addView.h -o ..\..\..\moc\terraView\moc_addView.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addView.h;..\..\..\ui\terraView\addView.cpp;..\..\..\moc\terraView\moc_addView.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\addView.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addView.ui -o ..\..\..\ui\terraView\addView.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\addView.ui -i addView.h -o ..\..\..\ui\terraView\addView.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\addView.h -o ..\..\..\moc\terraView\moc_addView.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\addView.h;..\..\..\ui\terraView\addView.cpp;..\..\..\moc\terraView\moc_addView.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\anaesp.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\anaesp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\anaesp.ui -o ..\..\..\ui\terraView\anaesp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\anaesp.ui -i anaesp.h -o ..\..\..\ui\terraView\anaesp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\anaesp.h -o ..\..\..\moc\terraView\moc_anaesp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\anaesp.h;..\..\..\ui\terraView\anaesp.cpp;..\..\..\moc\terraView\moc_anaesp.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\anaesp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\anaesp.ui -o ..\..\..\ui\terraView\anaesp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\anaesp.ui -i anaesp.h -o ..\..\..\ui\terraView\anaesp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\anaesp.h -o ..\..\..\moc\terraView\moc_anaesp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\anaesp.h;..\..\..\ui\terraView\anaesp.cpp;..\..\..\moc\terraView\moc_anaesp.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\bayesWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\bayesWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\bayesWindow.ui -o ..\..\..\ui\terraView\bayesWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\bayesWindow.ui -i bayesWindow.h -o ..\..\..\ui\terraView\bayesWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\bayesWindow.h -o ..\..\..\moc\terraView\moc_bayesWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\bayesWindow.h;..\..\..\ui\terraView\bayesWindow.cpp;..\..\..\moc\terraView\moc_bayesWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\bayesWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\bayesWindow.ui -o ..\..\..\ui\terraView\bayesWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\bayesWindow.ui -i bayesWindow.h -o ..\..\..\ui\terraView\bayesWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\bayesWindow.h -o ..\..\..\moc\terraView\moc_bayesWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\bayesWindow.h;..\..\..\ui\terraView\bayesWindow.cpp;..\..\..\moc\terraView\moc_bayesWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColData.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColData.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColData.ui -o ..\..\..\ui\terraView\changeColData.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColData.ui -i changeColData.h -o ..\..\..\ui\terraView\changeColData.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColData.h -o ..\..\..\moc\terraView\moc_changeColData.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColData.h;..\..\..\ui\terraView\changeColData.cpp;..\..\..\moc\terraView\moc_changeColData.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColData.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColData.ui -o ..\..\..\ui\terraView\changeColData.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColData.ui -i changeColData.h -o ..\..\..\ui\terraView\changeColData.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColData.h -o ..\..\..\moc\terraView\moc_changeColData.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColData.h;..\..\..\ui\terraView\changeColData.cpp;..\..\..\moc\terraView\moc_changeColData.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColumnName.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColumnName.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnName.ui -o ..\..\..\ui\terraView\changeColumnName.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnName.ui -i changeColumnName.h -o ..\..\..\ui\terraView\changeColumnName.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColumnName.h -o ..\..\..\moc\terraView\moc_changeColumnName.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColumnName.h;..\..\..\ui\terraView\changeColumnName.cpp;..\..\..\moc\terraView\moc_changeColumnName.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColumnName.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnName.ui -o ..\..\..\ui\terraView\changeColumnName.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnName.ui -i changeColumnName.h -o ..\..\..\ui\terraView\changeColumnName.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColumnName.h -o ..\..\..\moc\terraView\moc_changeColumnName.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColumnName.h;..\..\..\ui\terraView\changeColumnName.cpp;..\..\..\moc\terraView\moc_changeColumnName.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeColumnType.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColumnType.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnType.ui -o ..\..\..\ui\terraView\changeColumnType.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnType.ui -i changeColumnType.h -o ..\..\..\ui\terraView\changeColumnType.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColumnType.h -o ..\..\..\moc\terraView\moc_changeColumnType.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColumnType.h;..\..\..\ui\terraView\changeColumnType.cpp;..\..\..\moc\terraView\moc_changeColumnType.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeColumnType.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnType.ui -o ..\..\..\ui\terraView\changeColumnType.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeColumnType.ui -i changeColumnType.h -o ..\..\..\ui\terraView\changeColumnType.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeColumnType.h -o ..\..\..\moc\terraView\moc_changeColumnType.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeColumnType.h;..\..\..\ui\terraView\changeColumnType.cpp;..\..\..\moc\terraView\moc_changeColumnType.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\changeMinMax.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeMinMax.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeMinMax.ui -o ..\..\..\ui\terraView\changeMinMax.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeMinMax.ui -i changeMinMax.h -o ..\..\..\ui\terraView\changeMinMax.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeMinMax.h -o ..\..\..\moc\terraView\moc_changeMinMax.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeMinMax.h;..\..\..\ui\terraView\changeMinMax.cpp;..\..\..\moc\terraView\moc_changeMinMax.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\changeMinMax.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeMinMax.ui -o ..\..\..\ui\terraView\changeMinMax.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\changeMinMax.ui -i changeMinMax.h -o ..\..\..\ui\terraView\changeMinMax.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\changeMinMax.h -o ..\..\..\moc\terraView\moc_changeMinMax.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\changeMinMax.h;..\..\..\ui\terraView\changeMinMax.cpp;..\..\..\moc\terraView\moc_changeMinMax.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\connectView.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\connectView.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\connectView.ui -o ..\..\..\ui\terraView\connectView.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\connectView.ui -i connectView.h -o ..\..\..\ui\terraView\connectView.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\connectView.h -o ..\..\..\moc\terraView\moc_connectView.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\connectView.h;..\..\..\ui\terraView\connectView.cpp;..\..\..\moc\terraView\moc_connectView.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\connectView.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\connectView.ui -o ..\..\..\ui\terraView\connectView.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\connectView.ui -i connectView.h -o ..\..\..\ui\terraView\connectView.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\connectView.h -o ..\..\..\moc\terraView\moc_connectView.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\connectView.h;..\..\..\ui\terraView\connectView.cpp;..\..\..\moc\terraView\moc_connectView.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\contrast.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\contrast.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\contrast.ui -o ..\..\..\ui\terraView\contrast.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\contrast.ui -i contrast.h -o ..\..\..\ui\terraView\contrast.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\contrast.h -o ..\..\..\moc\terraView\moc_contrast.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\contrast.h;..\..\..\ui\terraView\contrast.cpp;..\..\..\moc\terraView\moc_contrast.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\contrast.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\contrast.ui -o ..\..\..\ui\terraView\contrast.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\contrast.ui -i contrast.h -o ..\..\..\ui\terraView\contrast.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\contrast.h -o ..\..\..\moc\terraView\moc_contrast.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\contrast.h;..\..\..\ui\terraView\contrast.cpp;..\..\..\moc\terraView\moc_contrast.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\countComputing.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\countComputing.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\countComputing.ui -o ..\..\..\ui\terraView\countComputing.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\countComputing.ui -i countComputing.h -o ..\..\..\ui\terraView\countComputing.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\countComputing.h -o ..\..\..\moc\terraView\moc_countComputing.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\countComputing.h;..\..\..\ui\terraView\countComputing.cpp;..\..\..\moc\terraView\moc_countComputing.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\countComputing.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\countComputing.ui -o ..\..\..\ui\terraView\countComputing.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\countComputing.ui -i countComputing.h -o ..\..\..\ui\terraView\countComputing.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\countComputing.h -o ..\..\..\moc\terraView\moc_countComputing.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\countComputing.h;..\..\..\ui\terraView\countComputing.cpp;..\..\..\moc\terraView\moc_countComputing.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createBuffersWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createBuffersWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createBuffersWindow.ui -o ..\..\..\ui\terraView\createBuffersWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createBuffersWindow.ui -i createBuffersWindow.h -o ..\..\..\ui\terraView\createBuffersWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createBuffersWindow.h -o ..\..\..\moc\terraView\moc_createBuffersWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createBuffersWindow.h;..\..\..\ui\terraView\createBuffersWindow.cpp;..\..\..\moc\terraView\moc_createBuffersWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createBuffersWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createBuffersWindow.ui -o ..\..\..\ui\terraView\createBuffersWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createBuffersWindow.ui -i createBuffersWindow.h -o ..\..\..\ui\terraView\createBuffersWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createBuffersWindow.h -o ..\..\..\moc\terraView\moc_createBuffersWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createBuffersWindow.h;..\..\..\ui\terraView\createBuffersWindow.cpp;..\..\..\moc\terraView\moc_createBuffersWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createCells.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createCells.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createCells.ui -o ..\..\..\ui\terraView\createCells.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createCells.ui -i createCells.h -o ..\..\..\ui\terraView\createCells.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createCells.h -o ..\..\..\moc\terraView\moc_createCells.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createCells.h;..\..\..\ui\terraView\createCells.cpp;..\..\..\moc\terraView\moc_createCells.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createCells.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createCells.ui -o ..\..\..\ui\terraView\createCells.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createCells.ui -i createCells.h -o ..\..\..\ui\terraView\createCells.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createCells.h -o ..\..\..\moc\terraView\moc_createCells.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createCells.h;..\..\..\ui\terraView\createCells.cpp;..\..\..\moc\terraView\moc_createCells.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createLayerFromTheme.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createLayerFromTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createLayerFromTheme.ui -o ..\..\..\ui\terraView\createLayerFromTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createLayerFromTheme.ui -i createLayerFromTheme.h -o ..\..\..\ui\terraView\createLayerFromTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createLayerFromTheme.h -o ..\..\..\moc\terraView\moc_createLayerFromTheme.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createLayerFromTheme.h;..\..\..\ui\terraView\createLayerFromTheme.cpp;..\..\..\moc\terraView\moc_createLayerFromTheme.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createLayerFromTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createLayerFromTheme.ui -o ..\..\..\ui\terraView\createLayerFromTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createLayerFromTheme.ui -i createLayerFromTheme.h -o ..\..\..\ui\terraView\createLayerFromTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createLayerFromTheme.h -o ..\..\..\moc\terraView\moc_createLayerFromTheme.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createLayerFromTheme.h;..\..\..\ui\terraView\createLayerFromTheme.cpp;..\..\..\moc\terraView\moc_createLayerFromTheme.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createProxMatrix.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createProxMatrix.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createProxMatrix.ui -o ..\..\..\ui\terraView\createProxMatrix.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createProxMatrix.ui -i createProxMatrix.h -o ..\..\..\ui\terraView\createProxMatrix.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createProxMatrix.h -o ..\..\..\moc\terraView\moc_createProxMatrix.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createProxMatrix.h;..\..\..\ui\terraView\createProxMatrix.cpp;..\..\..\moc\terraView\moc_createProxMatrix.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createProxMatrix.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createProxMatrix.ui -o ..\..\..\ui\terraView\createProxMatrix.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createProxMatrix.ui -i createProxMatrix.h -o ..\..\..\ui\terraView\createProxMatrix.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createProxMatrix.h -o ..\..\..\moc\terraView\moc_createProxMatrix.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createProxMatrix.h;..\..\..\ui\terraView\createProxMatrix.cpp;..\..\..\moc\terraView\moc_createProxMatrix.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createTable.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTable.ui -o ..\..\..\ui\terraView\createTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTable.ui -i createTable.h -o ..\..\..\ui\terraView\createTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createTable.h -o ..\..\..\moc\terraView\moc_createTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createTable.h;..\..\..\ui\terraView\createTable.cpp;..\..\..\moc\terraView\moc_createTable.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTable.ui -o ..\..\..\ui\terraView\createTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTable.ui -i createTable.h -o ..\..\..\ui\terraView\createTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createTable.h -o ..\..\..\moc\terraView\moc_createTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createTable.h;..\..\..\ui\terraView\createTable.cpp;..\..\..\moc\terraView\moc_createTable.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createTextRepresentation.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createTextRepresentation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTextRepresentation.ui -o ..\..\..\ui\terraView\createTextRepresentation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTextRepresentation.ui -i createTextRepresentation.h -o ..\..\..\ui\terraView\createTextRepresentation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createTextRepresentation.h -o ..\..\..\moc\terraView\moc_createTextRepresentation.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createTextRepresentation.h;..\..\..\ui\terraView\createTextRepresentation.cpp;..\..\..\moc\terraView\moc_createTextRepresentation.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createTextRepresentation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTextRepresentation.ui -o ..\..\..\ui\terraView\createTextRepresentation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createTextRepresentation.ui -i createTextRepresentation.h -o ..\..\..\ui\terraView\createTextRepresentation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createTextRepresentation.h -o ..\..\..\moc\terraView\moc_createTextRepresentation.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createTextRepresentation.h;..\..\..\ui\terraView\createTextRepresentation.cpp;..\..\..\moc\terraView\moc_createTextRepresentation.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\createThemeFromTheme.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createThemeFromTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createThemeFromTheme.ui -o ..\..\..\ui\terraView\createThemeFromTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createThemeFromTheme.ui -i createThemeFromTheme.h -o ..\..\..\ui\terraView\createThemeFromTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createThemeFromTheme.h -o ..\..\..\moc\terraView\moc_createThemeFromTheme.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createThemeFromTheme.h;..\..\..\ui\terraView\createThemeFromTheme.cpp;..\..\..\moc\terraView\moc_createThemeFromTheme.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\createThemeFromTheme.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createThemeFromTheme.ui -o ..\..\..\ui\terraView\createThemeFromTheme.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\createThemeFromTheme.ui -i createThemeFromTheme.h -o ..\..\..\ui\terraView\createThemeFromTheme.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\createThemeFromTheme.h -o ..\..\..\moc\terraView\moc_createThemeFromTheme.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\createThemeFromTheme.h;..\..\..\ui\terraView\createThemeFromTheme.cpp;..\..\..\moc\terraView\moc_createThemeFromTheme.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\database.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\database.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\database.ui -o ..\..\..\ui\terraView\database.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\database.ui -i database.h -o ..\..\..\ui\terraView\database.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\database.h -o ..\..\..\moc\terraView\moc_database.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\database.h;..\..\..\ui\terraView\database.cpp;..\..\..\moc\terraView\moc_database.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\database.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\database.ui -o ..\..\..\ui\terraView\database.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\database.ui -i database.h -o ..\..\..\ui\terraView\database.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\database.h -o ..\..\..\moc\terraView\moc_database.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\database.h;..\..\..\ui\terraView\database.cpp;..\..\..\moc\terraView\moc_database.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\databaseProp.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\databaseProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\databaseProp.ui -o ..\..\..\ui\terraView\databaseProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\databaseProp.ui -i databaseProp.h -o ..\..\..\ui\terraView\databaseProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\databaseProp.h -o ..\..\..\moc\terraView\moc_databaseProp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\databaseProp.h;..\..\..\ui\terraView\databaseProp.cpp;..\..\..\moc\terraView\moc_databaseProp.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\databaseProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\databaseProp.ui -o ..\..\..\ui\terraView\databaseProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\databaseProp.ui -i databaseProp.h -o ..\..\..\ui\terraView\databaseProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\databaseProp.h -o ..\..\..\moc\terraView\moc_databaseProp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\databaseProp.h;..\..\..\ui\terraView\databaseProp.cpp;..\..\..\moc\terraView\moc_databaseProp.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\display.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\display.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\display.ui -o ..\..\..\ui\terraView\display.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\display.ui -i display.h -o ..\..\..\ui\terraView\display.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\display.h -o ..\..\..\moc\terraView\moc_display.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\display.h;..\..\..\ui\terraView\display.cpp;..\..\..\moc\terraView\moc_display.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\display.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\display.ui -o ..\..\..\ui\terraView\display.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\display.ui -i display.h -o ..\..\..\ui\terraView\display.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\display.h -o ..\..\..\moc\terraView\moc_display.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\display.h;..\..\..\ui\terraView\display.cpp;..\..\..\moc\terraView\moc_display.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\displaySize.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\displaySize.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\displaySize.ui -o ..\..\..\ui\terraView\displaySize.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\displaySize.ui -i displaySize.h -o ..\..\..\ui\terraView\displaySize.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\displaySize.h -o ..\..\..\moc\terraView\moc_displaySize.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\displaySize.h;..\..\..\ui\terraView\displaySize.cpp;..\..\..\moc\terraView\moc_displaySize.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\displaySize.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\displaySize.ui -o ..\..\..\ui\terraView\displaySize.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\displaySize.ui -i displaySize.h -o ..\..\..\ui\terraView\displaySize.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\displaySize.h -o ..\..\..\moc\terraView\moc_displaySize.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\displaySize.h;..\..\..\ui\terraView\displaySize.cpp;..\..\..\moc\terraView\moc_displaySize.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\exportLayersThemes.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\exportLayersThemes.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportLayersThemes.ui -o ..\..\..\ui\terraView\exportLayersThemes.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportLayersThemes.ui -i exportLayersThemes.h -o ..\..\..\ui\terraView\exportLayersThemes.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\exportLayersThemes.h -o ..\..\..\moc\terraView\moc_exportLayersThemes.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\exportLayersThemes.h;..\..\..\ui\terraView\exportLayersThemes.cpp;..\..\..\moc\terraView\moc_exportLayersThemes.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\exportLayersThemes.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportLayersThemes.ui -o ..\..\..\ui\terraView\exportLayersThemes.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportLayersThemes.ui -i exportLayersThemes.h -o ..\..\..\ui\terraView\exportLayersThemes.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\exportLayersThemes.h -o ..\..\..\moc\terraView\moc_exportLayersThemes.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\exportLayersThemes.h;..\..\..\ui\terraView\exportLayersThemes.cpp;..\..\..\moc\terraView\moc_exportLayersThemes.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\exportWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\exportWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportWindow.ui -o ..\..\..\ui\terraView\exportWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportWindow.ui -i exportWindow.h -o ..\..\..\ui\terraView\exportWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\exportWindow.h -o ..\..\..\moc\terraView\moc_exportWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\exportWindow.h;..\..\..\ui\terraView\exportWindow.cpp;..\..\..\moc\terraView\moc_exportWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\exportWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportWindow.ui -o ..\..\..\ui\terraView\exportWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\exportWindow.ui -i exportWindow.h -o ..\..\..\ui\terraView\exportWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\exportWindow.h -o ..\..\..\moc\terraView\moc_exportWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\exportWindow.h;..\..\..\ui\terraView\exportWindow.cpp;..\..\..\moc\terraView\moc_exportWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\generateSamplePoints.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\generateSamplePoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\generateSamplePoints.ui -o ..\..\..\ui\terraView\generateSamplePoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\generateSamplePoints.ui -i generateSamplePoints.h -o ..\..\..\ui\terraView\generateSamplePoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\generateSamplePoints.h -o ..\..\..\moc\terraView\moc_generateSamplePoints.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\generateSamplePoints.h;..\..\..\ui\terraView\generateSamplePoints.cpp;..\..\..\moc\terraView\moc_generateSamplePoints.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\generateSamplePoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\generateSamplePoints.ui -o ..\..\..\ui\terraView\generateSamplePoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\generateSamplePoints.ui -i generateSamplePoints.h -o ..\..\..\ui\terraView\generateSamplePoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\generateSamplePoints.h -o ..\..\..\moc\terraView\moc_generateSamplePoints.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\generateSamplePoints.h;..\..\..\ui\terraView\generateSamplePoints.cpp;..\..\..\moc\terraView\moc_generateSamplePoints.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geographicalGrid.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geographicalGrid.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geographicalGrid.ui -o ..\..\..\ui\terraView\geographicalGrid.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geographicalGrid.ui -i geographicalGrid.h -o ..\..\..\ui\terraView\geographicalGrid.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geographicalGrid.h -o ..\..\..\moc\terraView\moc_geographicalGrid.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geographicalGrid.h;..\..\..\ui\terraView\geographicalGrid.cpp;..\..\..\moc\terraView\moc_geographicalGrid.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geographicalGrid.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geographicalGrid.ui -o ..\..\..\ui\terraView\geographicalGrid.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geographicalGrid.ui -i geographicalGrid.h -o ..\..\..\ui\terraView\geographicalGrid.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geographicalGrid.h -o ..\..\..\moc\terraView\moc_geographicalGrid.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geographicalGrid.h;..\..\..\ui\terraView\geographicalGrid.cpp;..\..\..\moc\terraView\moc_geographicalGrid.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAdd.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAdd.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAdd.ui -o ..\..\..\ui\terraView\geoOpAdd.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAdd.ui -i geoOpAdd.h -o ..\..\..\ui\terraView\geoOpAdd.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAdd.h -o ..\..\..\moc\terraView\moc_geoOpAdd.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAdd.h;..\..\..\ui\terraView\geoOpAdd.cpp;..\..\..\moc\terraView\moc_geoOpAdd.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAdd.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAdd.ui -o ..\..\..\ui\terraView\geoOpAdd.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAdd.ui -i geoOpAdd.h -o ..\..\..\ui\terraView\geoOpAdd.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAdd.h -o ..\..\..\moc\terraView\moc_geoOpAdd.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAdd.h;..\..\..\ui\terraView\geoOpAdd.cpp;..\..\..\moc\terraView\moc_geoOpAdd.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAggregation.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAggregation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAggregation.ui -o ..\..\..\ui\terraView\geoOpAggregation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAggregation.ui -i geoOpAggregation.h -o ..\..\..\ui\terraView\geoOpAggregation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAggregation.h -o ..\..\..\moc\terraView\moc_geoOpAggregation.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAggregation.h;..\..\..\ui\terraView\geoOpAggregation.cpp;..\..\..\moc\terraView\moc_geoOpAggregation.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAggregation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAggregation.ui -o ..\..\..\ui\terraView\geoOpAggregation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAggregation.ui -i geoOpAggregation.h -o ..\..\..\ui\terraView\geoOpAggregation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAggregation.h -o ..\..\..\moc\terraView\moc_geoOpAggregation.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAggregation.h;..\..\..\ui\terraView\geoOpAggregation.cpp;..\..\..\moc\terraView\moc_geoOpAggregation.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui -o ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui -i geoOpAssignDataLocationCollect.h -o ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h -o ..\..\..\moc\terraView\moc_geoOpAssignDataLocationCollect.cpp&#x [...]
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h;..\..\..\ui\terraView\geoOpAssignDataLocationCollect.cpp;..\..\..\moc\terraView\moc_geoOpAssignDataLocationCollect.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui -o ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationCollect.ui -i geoOpAssignDataLocationCollect.h -o ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h -o ..\..\..\moc\terraView\moc_geoOpAssignDataLocationCollect.cpp&#x [...]
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAssignDataLocationCollect.h;..\..\..\ui\terraView\geoOpAssignDataLocationCollect.cpp;..\..\..\moc\terraView\moc_geoOpAssignDataLocationCollect.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui -o ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui -i geoOpAssignDataLocationDistribute.h -o ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h -o ..\..\..\moc\terraView\moc_geoOpAssignDataLoca [...]
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h;..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.cpp;..\..\..\moc\terraView\moc_geoOpAssignDataLocationDistribute.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui -o ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpAssignDataLocationDistribute.ui -i geoOpAssignDataLocationDistribute.h -o ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h -o ..\..\..\moc\terraView\moc_geoOpAssignDataLoca [...]
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.h;..\..\..\ui\terraView\geoOpAssignDataLocationDistribute.cpp;..\..\..\moc\terraView\moc_geoOpAssignDataLocationDistribute.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayDifference.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayDifference.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayDifference.ui -o ..\..\..\ui\terraView\geoOpOverlayDifference.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayDifference.ui -i geoOpOverlayDifference.h -o ..\..\..\ui\terraView\geoOpOverlayDifference.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayDifference.h -o ..\..\..\moc\terraView\moc_geoOpOverlayDifference.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayDifference.h;..\..\..\ui\terraView\geoOpOverlayDifference.cpp;..\..\..\moc\terraView\moc_geoOpOverlayDifference.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayDifference.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayDifference.ui -o ..\..\..\ui\terraView\geoOpOverlayDifference.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayDifference.ui -i geoOpOverlayDifference.h -o ..\..\..\ui\terraView\geoOpOverlayDifference.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayDifference.h -o ..\..\..\moc\terraView\moc_geoOpOverlayDifference.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayDifference.h;..\..\..\ui\terraView\geoOpOverlayDifference.cpp;..\..\..\moc\terraView\moc_geoOpOverlayDifference.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayIntersection.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayIntersection.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayIntersection.ui -o ..\..\..\ui\terraView\geoOpOverlayIntersection.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayIntersection.ui -i geoOpOverlayIntersection.h -o ..\..\..\ui\terraView\geoOpOverlayIntersection.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayIntersection.h -o ..\..\..\moc\terraView\moc_geoOpOverlayIntersection.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayIntersection.h;..\..\..\ui\terraView\geoOpOverlayIntersection.cpp;..\..\..\moc\terraView\moc_geoOpOverlayIntersection.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayIntersection.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayIntersection.ui -o ..\..\..\ui\terraView\geoOpOverlayIntersection.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayIntersection.ui -i geoOpOverlayIntersection.h -o ..\..\..\ui\terraView\geoOpOverlayIntersection.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayIntersection.h -o ..\..\..\moc\terraView\moc_geoOpOverlayIntersection.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayIntersection.h;..\..\..\ui\terraView\geoOpOverlayIntersection.cpp;..\..\..\moc\terraView\moc_geoOpOverlayIntersection.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\geoOpOverlayUnion.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayUnion.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayUnion.ui -o ..\..\..\ui\terraView\geoOpOverlayUnion.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayUnion.ui -i geoOpOverlayUnion.h -o ..\..\..\ui\terraView\geoOpOverlayUnion.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayUnion.h -o ..\..\..\moc\terraView\moc_geoOpOverlayUnion.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayUnion.h;..\..\..\ui\terraView\geoOpOverlayUnion.cpp;..\..\..\moc\terraView\moc_geoOpOverlayUnion.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\geoOpOverlayUnion.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayUnion.ui -o ..\..\..\ui\terraView\geoOpOverlayUnion.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\geoOpOverlayUnion.ui -i geoOpOverlayUnion.h -o ..\..\..\ui\terraView\geoOpOverlayUnion.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\geoOpOverlayUnion.h -o ..\..\..\moc\terraView\moc_geoOpOverlayUnion.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\geoOpOverlayUnion.h;..\..\..\ui\terraView\geoOpOverlayUnion.cpp;..\..\..\moc\terraView\moc_geoOpOverlayUnion.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphic.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphic.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic.ui -o ..\..\..\ui\terraView\graphic.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic.ui -i graphic.h -o ..\..\..\ui\terraView\graphic.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphic.h -o ..\..\..\moc\terraView\moc_graphic.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphic.h;..\..\..\ui\terraView\graphic.cpp;..\..\..\moc\terraView\moc_graphic.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphic.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic.ui -o ..\..\..\ui\terraView\graphic.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic.ui -i graphic.h -o ..\..\..\ui\terraView\graphic.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphic.h -o ..\..\..\moc\terraView\moc_graphic.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphic.h;..\..\..\ui\terraView\graphic.cpp;..\..\..\moc\terraView\moc_graphic.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphic3DWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphic3DWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic3DWindow.ui -o ..\..\..\ui\terraView\graphic3DWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic3DWindow.ui -i graphic3DWindow.h -o ..\..\..\ui\terraView\graphic3DWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphic3DWindow.h -o ..\..\..\moc\terraView\moc_graphic3DWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphic3DWindow.h;..\..\..\ui\terraView\graphic3DWindow.cpp;..\..\..\moc\terraView\moc_graphic3DWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphic3DWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic3DWindow.ui -o ..\..\..\ui\terraView\graphic3DWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphic3DWindow.ui -i graphic3DWindow.h -o ..\..\..\ui\terraView\graphic3DWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphic3DWindow.h -o ..\..\..\moc\terraView\moc_graphic3DWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphic3DWindow.h;..\..\..\ui\terraView\graphic3DWindow.cpp;..\..\..\moc\terraView\moc_graphic3DWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphicConfigurationWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphicConfigurationWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicConfigurationWindow.ui -o ..\..\..\ui\terraView\graphicConfigurationWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicConfigurationWindow.ui -i graphicConfigurationWindow.h -o ..\..\..\ui\terraView\graphicConfigurationWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphicConfigurationWindow.h -o ..\..\..\moc\terraView\moc_graphicConfigurationWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphicConfigurationWindow.h;..\..\..\ui\terraView\graphicConfigurationWindow.cpp;..\..\..\moc\terraView\moc_graphicConfigurationWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphicConfigurationWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicConfigurationWindow.ui -o ..\..\..\ui\terraView\graphicConfigurationWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicConfigurationWindow.ui -i graphicConfigurationWindow.h -o ..\..\..\ui\terraView\graphicConfigurationWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphicConfigurationWindow.h -o ..\..\..\moc\terraView\moc_graphicConfigurationWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphicConfigurationWindow.h;..\..\..\ui\terraView\graphicConfigurationWindow.cpp;..\..\..\moc\terraView\moc_graphicConfigurationWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\graphicParams.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphicParams.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicParams.ui -o ..\..\..\ui\terraView\graphicParams.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicParams.ui -i graphicParams.h -o ..\..\..\ui\terraView\graphicParams.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphicParams.h -o ..\..\..\moc\terraView\moc_graphicParams.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphicParams.h;..\..\..\ui\terraView\graphicParams.cpp;..\..\..\moc\terraView\moc_graphicParams.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\graphicParams.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicParams.ui -o ..\..\..\ui\terraView\graphicParams.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\graphicParams.ui -i graphicParams.h -o ..\..\..\ui\terraView\graphicParams.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\graphicParams.h -o ..\..\..\moc\terraView\moc_graphicParams.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\graphicParams.h;..\..\..\ui\terraView\graphicParams.cpp;..\..\..\moc\terraView\moc_graphicParams.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\histogramBuildForm.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\histogramBuildForm.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\histogramBuildForm.ui -o ..\..\..\ui\terraView\histogramBuildForm.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\histogramBuildForm.ui -i histogramBuildForm.h -o ..\..\..\ui\terraView\histogramBuildForm.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\histogramBuildForm.h -o ..\..\..\moc\terraView\moc_histogramBuildForm.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\histogramBuildForm.h;..\..\..\ui\terraView\histogramBuildForm.cpp;..\..\..\moc\terraView\moc_histogramBuildForm.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\histogramBuildForm.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\histogramBuildForm.ui -o ..\..\..\ui\terraView\histogramBuildForm.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\histogramBuildForm.ui -i histogramBuildForm.h -o ..\..\..\ui\terraView\histogramBuildForm.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\histogramBuildForm.h -o ..\..\..\moc\terraView\moc_histogramBuildForm.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\histogramBuildForm.h;..\..\..\ui\terraView\histogramBuildForm.cpp;..\..\..\moc\terraView\moc_histogramBuildForm.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\import.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\import.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\import.ui -o ..\..\..\ui\terraView\import.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\import.ui -i import.h -o ..\..\..\ui\terraView\import.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\import.h -o ..\..\..\moc\terraView\moc_import.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\import.h;..\..\..\ui\terraView\import.cpp;..\..\..\moc\terraView\moc_import.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\import.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\import.ui -o ..\..\..\ui\terraView\import.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\import.ui -i import.h -o ..\..\..\ui\terraView\import.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\import.h -o ..\..\..\moc\terraView\moc_import.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\import.h;..\..\..\ui\terraView\import.cpp;..\..\..\moc\terraView\moc_import.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importRasterSimple.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importRasterSimple.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importRasterSimple.ui -o ..\..\..\ui\terraView\importRasterSimple.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importRasterSimple.ui -i importRasterSimple.h -o ..\..\..\ui\terraView\importRasterSimple.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importRasterSimple.h -o ..\..\..\moc\terraView\moc_importRasterSimple.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importRasterSimple.h;..\..\..\ui\terraView\importRasterSimple.cpp;..\..\..\moc\terraView\moc_importRasterSimple.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importRasterSimple.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importRasterSimple.ui -o ..\..\..\ui\terraView\importRasterSimple.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importRasterSimple.ui -i importRasterSimple.h -o ..\..\..\ui\terraView\importRasterSimple.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importRasterSimple.h -o ..\..\..\moc\terraView\moc_importRasterSimple.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importRasterSimple.h;..\..\..\ui\terraView\importRasterSimple.cpp;..\..\..\moc\terraView\moc_importRasterSimple.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTable.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTable.ui -o ..\..\..\ui\terraView\importTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTable.ui -i importTable.h -o ..\..\..\ui\terraView\importTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTable.h -o ..\..\..\moc\terraView\moc_importTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTable.h;..\..\..\ui\terraView\importTable.cpp;..\..\..\moc\terraView\moc_importTable.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTable.ui -o ..\..\..\ui\terraView\importTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTable.ui -i importTable.h -o ..\..\..\ui\terraView\importTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTable.h -o ..\..\..\moc\terraView\moc_importTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTable.h;..\..\..\ui\terraView\importTable.cpp;..\..\..\moc\terraView\moc_importTable.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTablePoints.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTablePoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTablePoints.ui -o ..\..\..\ui\terraView\importTablePoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTablePoints.ui -i importTablePoints.h -o ..\..\..\ui\terraView\importTablePoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTablePoints.h -o ..\..\..\moc\terraView\moc_importTablePoints.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTablePoints.h;..\..\..\ui\terraView\importTablePoints.cpp;..\..\..\moc\terraView\moc_importTablePoints.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTablePoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTablePoints.ui -o ..\..\..\ui\terraView\importTablePoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTablePoints.ui -i importTablePoints.h -o ..\..\..\ui\terraView\importTablePoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTablePoints.h -o ..\..\..\moc\terraView\moc_importTablePoints.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTablePoints.h;..\..\..\ui\terraView\importTablePoints.cpp;..\..\..\moc\terraView\moc_importTablePoints.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTbl.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTbl.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTbl.ui -o ..\..\..\ui\terraView\importTbl.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTbl.ui -i importTbl.h -o ..\..\..\ui\terraView\importTbl.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTbl.h -o ..\..\..\moc\terraView\moc_importTbl.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTbl.h;..\..\..\ui\terraView\importTbl.cpp;..\..\..\moc\terraView\moc_importTbl.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTbl.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTbl.ui -o ..\..\..\ui\terraView\importTbl.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTbl.ui -i importTbl.h -o ..\..\..\ui\terraView\importTbl.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTbl.h -o ..\..\..\moc\terraView\moc_importTbl.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTbl.h;..\..\..\ui\terraView\importTbl.cpp;..\..\..\moc\terraView\moc_importTbl.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\importTblPoints.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTblPoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTblPoints.ui -o ..\..\..\ui\terraView\importTblPoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTblPoints.ui -i importTblPoints.h -o ..\..\..\ui\terraView\importTblPoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTblPoints.h -o ..\..\..\moc\terraView\moc_importTblPoints.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTblPoints.h;..\..\..\ui\terraView\importTblPoints.cpp;..\..\..\moc\terraView\moc_importTblPoints.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\importTblPoints.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTblPoints.ui -o ..\..\..\ui\terraView\importTblPoints.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\importTblPoints.ui -i importTblPoints.h -o ..\..\..\ui\terraView\importTblPoints.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\importTblPoints.h -o ..\..\..\moc\terraView\moc_importTblPoints.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\importTblPoints.h;..\..\..\ui\terraView\importTblPoints.cpp;..\..\..\moc\terraView\moc_importTblPoints.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertPoint.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertPoint.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertPoint.ui -o ..\..\..\ui\terraView\insertPoint.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertPoint.ui -i insertPoint.h -o ..\..\..\ui\terraView\insertPoint.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertPoint.h -o ..\..\..\moc\terraView\moc_insertPoint.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertPoint.h;..\..\..\ui\terraView\insertPoint.cpp;..\..\..\moc\terraView\moc_insertPoint.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertPoint.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertPoint.ui -o ..\..\..\ui\terraView\insertPoint.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertPoint.ui -i insertPoint.h -o ..\..\..\ui\terraView\insertPoint.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertPoint.h -o ..\..\..\moc\terraView\moc_insertPoint.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertPoint.h;..\..\..\ui\terraView\insertPoint.cpp;..\..\..\moc\terraView\moc_insertPoint.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertSymbol.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertSymbol.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertSymbol.ui -o ..\..\..\ui\terraView\insertSymbol.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertSymbol.ui -i insertSymbol.h -o ..\..\..\ui\terraView\insertSymbol.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertSymbol.h -o ..\..\..\moc\terraView\moc_insertSymbol.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertSymbol.h;..\..\..\ui\terraView\insertSymbol.cpp;..\..\..\moc\terraView\moc_insertSymbol.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertSymbol.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertSymbol.ui -o ..\..\..\ui\terraView\insertSymbol.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertSymbol.ui -i insertSymbol.h -o ..\..\..\ui\terraView\insertSymbol.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertSymbol.h -o ..\..\..\moc\terraView\moc_insertSymbol.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertSymbol.h;..\..\..\ui\terraView\insertSymbol.cpp;..\..\..\moc\terraView\moc_insertSymbol.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\insertText.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertText.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertText.ui -o ..\..\..\ui\terraView\insertText.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertText.ui -i insertText.h -o ..\..\..\ui\terraView\insertText.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertText.h -o ..\..\..\moc\terraView\moc_insertText.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertText.h;..\..\..\ui\terraView\insertText.cpp;..\..\..\moc\terraView\moc_insertText.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\insertText.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertText.ui -o ..\..\..\ui\terraView\insertText.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\insertText.ui -i insertText.h -o ..\..\..\ui\terraView\insertText.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\insertText.h -o ..\..\..\moc\terraView\moc_insertText.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\insertText.h;..\..\..\ui\terraView\insertText.cpp;..\..\..\moc\terraView\moc_insertText.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\kernelRatioWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\kernelRatioWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelRatioWindow.ui -o ..\..\..\ui\terraView\kernelRatioWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelRatioWindow.ui -i kernelRatioWindow.h -o ..\..\..\ui\terraView\kernelRatioWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\kernelRatioWindow.h -o ..\..\..\moc\terraView\moc_kernelRatioWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\kernelRatioWindow.h;..\..\..\ui\terraView\kernelRatioWindow.cpp;..\..\..\moc\terraView\moc_kernelRatioWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\kernelRatioWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelRatioWindow.ui -o ..\..\..\ui\terraView\kernelRatioWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelRatioWindow.ui -i kernelRatioWindow.h -o ..\..\..\ui\terraView\kernelRatioWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\kernelRatioWindow.h -o ..\..\..\moc\terraView\moc_kernelRatioWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\kernelRatioWindow.h;..\..\..\ui\terraView\kernelRatioWindow.cpp;..\..\..\moc\terraView\moc_kernelRatioWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\kernelWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\kernelWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelWindow.ui -o ..\..\..\ui\terraView\kernelWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelWindow.ui -i kernelWindow.h -o ..\..\..\ui\terraView\kernelWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\kernelWindow.h -o ..\..\..\moc\terraView\moc_kernelWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\kernelWindow.h;..\..\..\ui\terraView\kernelWindow.cpp;..\..\..\moc\terraView\moc_kernelWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\kernelWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelWindow.ui -o ..\..\..\ui\terraView\kernelWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\kernelWindow.ui -i kernelWindow.h -o ..\..\..\ui\terraView\kernelWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\kernelWindow.h -o ..\..\..\moc\terraView\moc_kernelWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\kernelWindow.h;..\..\..\ui\terraView\kernelWindow.cpp;..\..\..\moc\terraView\moc_kernelWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\layerProp.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\layerProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\layerProp.ui -o ..\..\..\ui\terraView\layerProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\layerProp.ui -i layerProp.h -o ..\..\..\ui\terraView\layerProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\layerProp.h -o ..\..\..\moc\terraView\moc_layerProp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\layerProp.h;..\..\..\ui\terraView\layerProp.cpp;..\..\..\moc\terraView\moc_layerProp.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\layerProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\layerProp.ui -o ..\..\..\ui\terraView\layerProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\layerProp.ui -i layerProp.h -o ..\..\..\ui\terraView\layerProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\layerProp.h -o ..\..\..\moc\terraView\moc_layerProp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\layerProp.h;..\..\..\ui\terraView\layerProp.cpp;..\..\..\moc\terraView\moc_layerProp.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\lbsDefinition.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\lbsDefinition.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\lbsDefinition.ui -o ..\..\..\ui\terraView\lbsDefinition.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\lbsDefinition.ui -i lbsDefinition.h -o ..\..\..\ui\terraView\lbsDefinition.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\lbsDefinition.h -o ..\..\..\moc\terraView\moc_lbsDefinition.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\lbsDefinition.h;..\..\..\ui\terraView\lbsDefinition.cpp;..\..\..\moc\terraView\moc_lbsDefinition.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\lbsDefinition.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\lbsDefinition.ui -o ..\..\..\ui\terraView\lbsDefinition.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\lbsDefinition.ui -i lbsDefinition.h -o ..\..\..\ui\terraView\lbsDefinition.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\lbsDefinition.h -o ..\..\..\moc\terraView\moc_lbsDefinition.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\lbsDefinition.h;..\..\..\ui\terraView\lbsDefinition.cpp;..\..\..\moc\terraView\moc_lbsDefinition.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\legendWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\legendWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\legendWindow.ui -o ..\..\..\ui\terraView\legendWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\legendWindow.ui -i legendWindow.h -o ..\..\..\ui\terraView\legendWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\legendWindow.h -o ..\..\..\moc\terraView\moc_legendWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\legendWindow.h;..\..\..\ui\terraView\legendWindow.cpp;..\..\..\moc\terraView\moc_legendWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\legendWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\legendWindow.ui -o ..\..\..\ui\terraView\legendWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\legendWindow.ui -i legendWindow.h -o ..\..\..\ui\terraView\legendWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\legendWindow.h -o ..\..\..\moc\terraView\moc_legendWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\legendWindow.h;..\..\..\ui\terraView\legendWindow.cpp;..\..\..\moc\terraView\moc_legendWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\linkExtTable.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\linkExtTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\linkExtTable.ui -o ..\..\..\ui\terraView\linkExtTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\linkExtTable.ui -i linkExtTable.h -o ..\..\..\ui\terraView\linkExtTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\linkExtTable.h -o ..\..\..\moc\terraView\moc_linkExtTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\linkExtTable.h;..\..\..\ui\terraView\linkExtTable.cpp;..\..\..\moc\terraView\moc_linkExtTable.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\linkExtTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\linkExtTable.ui -o ..\..\..\ui\terraView\linkExtTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\linkExtTable.ui -i linkExtTable.h -o ..\..\..\ui\terraView\linkExtTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\linkExtTable.h -o ..\..\..\moc\terraView\moc_linkExtTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\linkExtTable.h;..\..\..\ui\terraView\linkExtTable.cpp;..\..\..\moc\terraView\moc_linkExtTable.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\localBayesWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\localBayesWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\localBayesWindow.ui -o ..\..\..\ui\terraView\localBayesWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\localBayesWindow.ui -i localBayesWindow.h -o ..\..\..\ui\terraView\localBayesWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\localBayesWindow.h -o ..\..\..\moc\terraView\moc_localBayesWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\localBayesWindow.h;..\..\..\ui\terraView\localBayesWindow.cpp;..\..\..\moc\terraView\moc_localBayesWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\localBayesWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\localBayesWindow.ui -o ..\..\..\ui\terraView\localBayesWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\localBayesWindow.ui -i localBayesWindow.h -o ..\..\..\ui\terraView\localBayesWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\localBayesWindow.h -o ..\..\..\moc\terraView\moc_localBayesWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\localBayesWindow.h;..\..\..\ui\terraView\localBayesWindow.cpp;..\..\..\moc\terraView\moc_localBayesWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\pieBarChart.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\pieBarChart.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\pieBarChart.ui -o ..\..\..\ui\terraView\pieBarChart.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\pieBarChart.ui -i pieBarChart.h -o ..\..\..\ui\terraView\pieBarChart.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\pieBarChart.h -o ..\..\..\moc\terraView\moc_pieBarChart.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\pieBarChart.h;..\..\..\ui\terraView\pieBarChart.cpp;..\..\..\moc\terraView\moc_pieBarChart.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\pieBarChart.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\pieBarChart.ui -o ..\..\..\ui\terraView\pieBarChart.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\pieBarChart.ui -i pieBarChart.h -o ..\..\..\ui\terraView\pieBarChart.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\pieBarChart.h -o ..\..\..\moc\terraView\moc_pieBarChart.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\pieBarChart.h;..\..\..\ui\terraView\pieBarChart.cpp;..\..\..\moc\terraView\moc_pieBarChart.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\printFileResolution.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\printFileResolution.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\printFileResolution.ui -o ..\..\..\ui\terraView\printFileResolution.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\printFileResolution.ui -i printFileResolution.h -o ..\..\..\ui\terraView\printFileResolution.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\printFileResolution.h -o ..\..\..\moc\terraView\moc_printFileResolution.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\printFileResolution.h;..\..\..\ui\terraView\printFileResolution.cpp;..\..\..\moc\terraView\moc_printFileResolution.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\printFileResolution.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\printFileResolution.ui -o ..\..\..\ui\terraView\printFileResolution.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\printFileResolution.ui -i printFileResolution.h -o ..\..\..\ui\terraView\printFileResolution.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\printFileResolution.h -o ..\..\..\moc\terraView\moc_printFileResolution.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\printFileResolution.h;..\..\..\ui\terraView\printFileResolution.cpp;..\..\..\moc\terraView\moc_printFileResolution.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\projection.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\projection.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\projection.ui -o ..\..\..\ui\terraView\projection.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\projection.ui -i projection.h -o ..\..\..\ui\terraView\projection.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\projection.h -o ..\..\..\moc\terraView\moc_projection.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\projection.h;..\..\..\ui\terraView\projection.cpp;..\..\..\moc\terraView\moc_projection.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\projection.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\projection.ui -o ..\..\..\ui\terraView\projection.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\projection.ui -i projection.h -o ..\..\..\ui\terraView\projection.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\projection.h -o ..\..\..\moc\terraView\moc_projection.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\projection.h;..\..\..\ui\terraView\projection.cpp;..\..\..\moc\terraView\moc_projection.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\query.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\query.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\query.ui -o ..\..\..\ui\terraView\query.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\query.ui -i query.h -o ..\..\..\ui\terraView\query.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\query.h -o ..\..\..\moc\terraView\moc_query.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\query.h;..\..\..\ui\terraView\query.cpp;..\..\..\moc\terraView\moc_query.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\query.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\query.ui -o ..\..\..\ui\terraView\query.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\query.ui -i query.h -o ..\..\..\ui\terraView\query.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\query.h -o ..\..\..\moc\terraView\moc_query.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\query.h;..\..\..\ui\terraView\query.cpp;..\..\..\moc\terraView\moc_query.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterColorCompositionWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterColorCompositionWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterColorCompositionWindow.ui -o ..\..\..\ui\terraView\rasterColorCompositionWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterColorCompositionWindow.ui -i rasterColorCompositionWindow.h -o ..\..\..\ui\terraView\rasterColorCompositionWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterColorCompositionWindow.h -o ..\..\..\moc\terraView\moc_rasterColorCompositionWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterColorCompositionWindow.h;..\..\..\ui\terraView\rasterColorCompositionWindow.cpp;..\..\..\moc\terraView\moc_rasterColorCompositionWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterColorCompositionWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterColorCompositionWindow.ui -o ..\..\..\ui\terraView\rasterColorCompositionWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterColorCompositionWindow.ui -i rasterColorCompositionWindow.h -o ..\..\..\ui\terraView\rasterColorCompositionWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterColorCompositionWindow.h -o ..\..\..\moc\terraView\moc_rasterColorCompositionWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterColorCompositionWindow.h;..\..\..\ui\terraView\rasterColorCompositionWindow.cpp;..\..\..\moc\terraView\moc_rasterColorCompositionWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterImportWizard.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterImportWizard.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterImportWizard.ui -o ..\..\..\ui\terraView\rasterImportWizard.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterImportWizard.ui -i rasterImportWizard.h -o ..\..\..\ui\terraView\rasterImportWizard.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterImportWizard.h -o ..\..\..\moc\terraView\moc_rasterImportWizard.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterImportWizard.h;..\..\..\ui\terraView\rasterImportWizard.cpp;..\..\..\moc\terraView\moc_rasterImportWizard.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterImportWizard.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterImportWizard.ui -o ..\..\..\ui\terraView\rasterImportWizard.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterImportWizard.ui -i rasterImportWizard.h -o ..\..\..\ui\terraView\rasterImportWizard.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterImportWizard.h -o ..\..\..\moc\terraView\moc_rasterImportWizard.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterImportWizard.h;..\..\..\ui\terraView\rasterImportWizard.cpp;..\..\..\moc\terraView\moc_rasterImportWizard.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterSlicingWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterSlicingWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterSlicingWindow.ui -o ..\..\..\ui\terraView\rasterSlicingWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterSlicingWindow.ui -i rasterSlicingWindow.h -o ..\..\..\ui\terraView\rasterSlicingWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterSlicingWindow.h -o ..\..\..\moc\terraView\moc_rasterSlicingWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterSlicingWindow.h;..\..\..\ui\terraView\rasterSlicingWindow.cpp;..\..\..\moc\terraView\moc_rasterSlicingWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterSlicingWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterSlicingWindow.ui -o ..\..\..\ui\terraView\rasterSlicingWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterSlicingWindow.ui -i rasterSlicingWindow.h -o ..\..\..\ui\terraView\rasterSlicingWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterSlicingWindow.h -o ..\..\..\moc\terraView\moc_rasterSlicingWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterSlicingWindow.h;..\..\..\ui\terraView\rasterSlicingWindow.cpp;..\..\..\moc\terraView\moc_rasterSlicingWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\rasterTransparency.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterTransparency.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterTransparency.ui -o ..\..\..\ui\terraView\rasterTransparency.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterTransparency.ui -i rasterTransparency.h -o ..\..\..\ui\terraView\rasterTransparency.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterTransparency.h -o ..\..\..\moc\terraView\moc_rasterTransparency.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterTransparency.h;..\..\..\ui\terraView\rasterTransparency.cpp;..\..\..\moc\terraView\moc_rasterTransparency.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\rasterTransparency.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterTransparency.ui -o ..\..\..\ui\terraView\rasterTransparency.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\rasterTransparency.ui -i rasterTransparency.h -o ..\..\..\ui\terraView\rasterTransparency.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\rasterTransparency.h -o ..\..\..\moc\terraView\moc_rasterTransparency.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\rasterTransparency.h;..\..\..\ui\terraView\rasterTransparency.cpp;..\..\..\moc\terraView\moc_rasterTransparency.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\removeTable.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\removeTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\removeTable.ui -o ..\..\..\ui\terraView\removeTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\removeTable.ui -i removeTable.h -o ..\..\..\ui\terraView\removeTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\removeTable.h -o ..\..\..\moc\terraView\moc_removeTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\removeTable.h;..\..\..\ui\terraView\removeTable.cpp;..\..\..\moc\terraView\moc_removeTable.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\removeTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\removeTable.ui -o ..\..\..\ui\terraView\removeTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\removeTable.ui -i removeTable.h -o ..\..\..\ui\terraView\removeTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\removeTable.h -o ..\..\..\moc\terraView\moc_removeTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\removeTable.h;..\..\..\ui\terraView\removeTable.cpp;..\..\..\moc\terraView\moc_removeTable.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui -o ..\..\..\ui\terraView\saveAndLoadColorBarWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui -i saveAndLoadColorBarWindow.h -o ..\..\..\ui\terraView\saveAndLoadColorBarWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveAndLoadColorBarWindow.h -o ..\..\..\moc\terraView\moc_saveAndLoadColorBarWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveAndLoadColorBarWindow.h;..\..\..\ui\terraView\saveAndLoadColorBarWindow.cpp;..\..\..\moc\terraView\moc_saveAndLoadColorBarWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui -o ..\..\..\ui\terraView\saveAndLoadColorBarWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAndLoadColorBarWindow.ui -i saveAndLoadColorBarWindow.h -o ..\..\..\ui\terraView\saveAndLoadColorBarWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveAndLoadColorBarWindow.h -o ..\..\..\moc\terraView\moc_saveAndLoadColorBarWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveAndLoadColorBarWindow.h;..\..\..\ui\terraView\saveAndLoadColorBarWindow.cpp;..\..\..\moc\terraView\moc_saveAndLoadColorBarWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveAsTable.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveAsTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAsTable.ui -o ..\..\..\ui\terraView\saveAsTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAsTable.ui -i saveAsTable.h -o ..\..\..\ui\terraView\saveAsTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveAsTable.h -o ..\..\..\moc\terraView\moc_saveAsTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveAsTable.h;..\..\..\ui\terraView\saveAsTable.cpp;..\..\..\moc\terraView\moc_saveAsTable.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveAsTable.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAsTable.ui -o ..\..\..\ui\terraView\saveAsTable.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveAsTable.ui -i saveAsTable.h -o ..\..\..\ui\terraView\saveAsTable.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveAsTable.h -o ..\..\..\moc\terraView\moc_saveAsTable.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveAsTable.h;..\..\..\ui\terraView\saveAsTable.cpp;..\..\..\moc\terraView\moc_saveAsTable.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveRaster.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveRaster.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveRaster.ui -o ..\..\..\ui\terraView\saveRaster.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveRaster.ui -i saveRaster.h -o ..\..\..\ui\terraView\saveRaster.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveRaster.h -o ..\..\..\moc\terraView\moc_saveRaster.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveRaster.h;..\..\..\ui\terraView\saveRaster.cpp;..\..\..\moc\terraView\moc_saveRaster.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveRaster.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveRaster.ui -o ..\..\..\ui\terraView\saveRaster.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveRaster.ui -i saveRaster.h -o ..\..\..\ui\terraView\saveRaster.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveRaster.h -o ..\..\..\moc\terraView\moc_saveRaster.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveRaster.h;..\..\..\ui\terraView\saveRaster.cpp;..\..\..\moc\terraView\moc_saveRaster.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveTableAsTxt.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveTableAsTxt.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveTableAsTxt.ui -o ..\..\..\ui\terraView\saveTableAsTxt.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveTableAsTxt.ui -i saveTableAsTxt.h -o ..\..\..\ui\terraView\saveTableAsTxt.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveTableAsTxt.h -o ..\..\..\moc\terraView\moc_saveTableAsTxt.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveTableAsTxt.h;..\..\..\ui\terraView\saveTableAsTxt.cpp;..\..\..\moc\terraView\moc_saveTableAsTxt.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveTableAsTxt.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveTableAsTxt.ui -o ..\..\..\ui\terraView\saveTableAsTxt.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveTableAsTxt.ui -i saveTableAsTxt.h -o ..\..\..\ui\terraView\saveTableAsTxt.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveTableAsTxt.h -o ..\..\..\moc\terraView\moc_saveTableAsTxt.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveTableAsTxt.h;..\..\..\ui\terraView\saveTableAsTxt.cpp;..\..\..\moc\terraView\moc_saveTableAsTxt.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\saveThemeToFileWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveThemeToFileWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveThemeToFileWindow.ui -o ..\..\..\ui\terraView\saveThemeToFileWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveThemeToFileWindow.ui -i saveThemeToFileWindow.h -o ..\..\..\ui\terraView\saveThemeToFileWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveThemeToFileWindow.h -o ..\..\..\moc\terraView\moc_saveThemeToFileWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveThemeToFileWindow.h;..\..\..\ui\terraView\saveThemeToFileWindow.cpp;..\..\..\moc\terraView\moc_saveThemeToFileWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\saveThemeToFileWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveThemeToFileWindow.ui -o ..\..\..\ui\terraView\saveThemeToFileWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\saveThemeToFileWindow.ui -i saveThemeToFileWindow.h -o ..\..\..\ui\terraView\saveThemeToFileWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\saveThemeToFileWindow.h -o ..\..\..\moc\terraView\moc_saveThemeToFileWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\saveThemeToFileWindow.h;..\..\..\ui\terraView\saveThemeToFileWindow.cpp;..\..\..\moc\terraView\moc_saveThemeToFileWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selectProxMatrix.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selectProxMatrix.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectProxMatrix.ui -o ..\..\..\ui\terraView\selectProxMatrix.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectProxMatrix.ui -i selectProxMatrix.h -o ..\..\..\ui\terraView\selectProxMatrix.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selectProxMatrix.h -o ..\..\..\moc\terraView\moc_selectProxMatrix.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selectProxMatrix.h;..\..\..\ui\terraView\selectProxMatrix.cpp;..\..\..\moc\terraView\moc_selectProxMatrix.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selectProxMatrix.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectProxMatrix.ui -o ..\..\..\ui\terraView\selectProxMatrix.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectProxMatrix.ui -i selectProxMatrix.h -o ..\..\..\ui\terraView\selectProxMatrix.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selectProxMatrix.h -o ..\..\..\moc\terraView\moc_selectProxMatrix.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selectProxMatrix.h;..\..\..\ui\terraView\selectProxMatrix.cpp;..\..\..\moc\terraView\moc_selectProxMatrix.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selectTextRepresentation.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selectTextRepresentation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectTextRepresentation.ui -o ..\..\..\ui\terraView\selectTextRepresentation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectTextRepresentation.ui -i selectTextRepresentation.h -o ..\..\..\ui\terraView\selectTextRepresentation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selectTextRepresentation.h -o ..\..\..\moc\terraView\moc_selectTextRepresentation.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selectTextRepresentation.h;..\..\..\ui\terraView\selectTextRepresentation.cpp;..\..\..\moc\terraView\moc_selectTextRepresentation.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selectTextRepresentation.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectTextRepresentation.ui -o ..\..\..\ui\terraView\selectTextRepresentation.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selectTextRepresentation.ui -i selectTextRepresentation.h -o ..\..\..\ui\terraView\selectTextRepresentation.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selectTextRepresentation.h -o ..\..\..\moc\terraView\moc_selectTextRepresentation.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selectTextRepresentation.h;..\..\..\ui\terraView\selectTextRepresentation.cpp;..\..\..\moc\terraView\moc_selectTextRepresentation.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\selThemeTables.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selThemeTables.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selThemeTables.ui -o ..\..\..\ui\terraView\selThemeTables.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selThemeTables.ui -i selThemeTables.h -o ..\..\..\ui\terraView\selThemeTables.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selThemeTables.h -o ..\..\..\moc\terraView\moc_selThemeTables.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selThemeTables.h;..\..\..\ui\terraView\selThemeTables.cpp;..\..\..\moc\terraView\moc_selThemeTables.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\selThemeTables.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selThemeTables.ui -o ..\..\..\ui\terraView\selThemeTables.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\selThemeTables.ui -i selThemeTables.h -o ..\..\..\ui\terraView\selThemeTables.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\selThemeTables.h -o ..\..\..\moc\terraView\moc_selThemeTables.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\selThemeTables.h;..\..\..\ui\terraView\selThemeTables.cpp;..\..\..\moc\terraView\moc_selThemeTables.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\semivar.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\semivar.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\semivar.ui -o ..\..\..\ui\terraView\semivar.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\semivar.ui -i semivar.h -o ..\..\..\ui\terraView\semivar.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\semivar.h -o ..\..\..\moc\terraView\moc_semivar.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\semivar.h;..\..\..\ui\terraView\semivar.cpp;..\..\..\moc\terraView\moc_semivar.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\semivar.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\semivar.ui -o ..\..\..\ui\terraView\semivar.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\semivar.ui -i semivar.h -o ..\..\..\ui\terraView\semivar.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\semivar.h -o ..\..\..\moc\terraView\moc_semivar.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\semivar.h;..\..\..\ui\terraView\semivar.cpp;..\..\..\moc\terraView\moc_semivar.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\skaterWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\skaterWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\skaterWindow.ui -o ..\..\..\ui\terraView\skaterWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\skaterWindow.ui -i skaterWindow.h -o ..\..\..\ui\terraView\skaterWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\skaterWindow.h -o ..\..\..\moc\terraView\moc_skaterWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\skaterWindow.h;..\..\..\ui\terraView\skaterWindow.cpp;..\..\..\moc\terraView\moc_skaterWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\skaterWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\skaterWindow.ui -o ..\..\..\ui\terraView\skaterWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\skaterWindow.ui -i skaterWindow.h -o ..\..\..\ui\terraView\skaterWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\skaterWindow.h -o ..\..\..\moc\terraView\moc_skaterWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\skaterWindow.h;..\..\..\ui\terraView\skaterWindow.cpp;..\..\..\moc\terraView\moc_skaterWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\spatializationWindow.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\spatializationWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatializationWindow.ui -o ..\..\..\ui\terraView\spatializationWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatializationWindow.ui -i spatializationWindow.h -o ..\..\..\ui\terraView\spatializationWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\spatializationWindow.h -o ..\..\..\moc\terraView\moc_spatializationWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\spatializationWindow.h;..\..\..\ui\terraView\spatializationWindow.cpp;..\..\..\moc\terraView\moc_spatializationWindow.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\spatializationWindow.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatializationWindow.ui -o ..\..\..\ui\terraView\spatializationWindow.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatializationWindow.ui -i spatializationWindow.h -o ..\..\..\ui\terraView\spatializationWindow.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\spatializationWindow.h -o ..\..\..\moc\terraView\moc_spatializationWindow.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\spatializationWindow.h;..\..\..\ui\terraView\spatializationWindow.cpp;..\..\..\moc\terraView\moc_spatializationWindow.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\spatialQuery.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\spatialQuery.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatialQuery.ui -o ..\..\..\ui\terraView\spatialQuery.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatialQuery.ui -i spatialQuery.h -o ..\..\..\ui\terraView\spatialQuery.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\spatialQuery.h -o ..\..\..\moc\terraView\moc_spatialQuery.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\spatialQuery.h;..\..\..\ui\terraView\spatialQuery.cpp;..\..\..\moc\terraView\moc_spatialQuery.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\spatialQuery.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatialQuery.ui -o ..\..\..\ui\terraView\spatialQuery.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\spatialQuery.ui -i spatialQuery.h -o ..\..\..\ui\terraView\spatialQuery.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\spatialQuery.h -o ..\..\..\moc\terraView\moc_spatialQuery.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\spatialQuery.h;..\..\..\ui\terraView\spatialQuery.cpp;..\..\..\moc\terraView\moc_spatialQuery.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\statistic.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\statistic.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\statistic.ui -o ..\..\..\ui\terraView\statistic.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\statistic.ui -i statistic.h -o ..\..\..\ui\terraView\statistic.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\statistic.h -o ..\..\..\moc\terraView\moc_statistic.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\statistic.h;..\..\..\ui\terraView\statistic.cpp;..\..\..\moc\terraView\moc_statistic.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\statistic.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\statistic.ui -o ..\..\..\ui\terraView\statistic.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\statistic.ui -i statistic.h -o ..\..\..\ui\terraView\statistic.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\statistic.h -o ..\..\..\moc\terraView\moc_statistic.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\statistic.h;..\..\..\ui\terraView\statistic.cpp;..\..\..\moc\terraView\moc_statistic.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\tableProp.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\tableProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\tableProp.ui -o ..\..\..\ui\terraView\tableProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\tableProp.ui -i tableProp.h -o ..\..\..\ui\terraView\tableProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\tableProp.h -o ..\..\..\moc\terraView\moc_tableProp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\tableProp.h;..\..\..\ui\terraView\tableProp.cpp;..\..\..\moc\terraView\moc_tableProp.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\tableProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\tableProp.ui -o ..\..\..\ui\terraView\tableProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\tableProp.ui -i tableProp.h -o ..\..\..\ui\terraView\tableProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\tableProp.h -o ..\..\..\moc\terraView\moc_tableProp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\tableProp.h;..\..\..\ui\terraView\tableProp.cpp;..\..\..\moc\terraView\moc_tableProp.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\telayer_metadata.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\telayer_metadata.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\telayer_metadata.ui -o ..\..\..\ui\terraView\telayer_metadata.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\telayer_metadata.ui -i telayer_metadata.h -o ..\..\..\ui\terraView\telayer_metadata.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\telayer_metadata.h -o ..\..\..\moc\terraView\moc_telayer_metadata.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\telayer_metadata.h;..\..\..\ui\terraView\telayer_metadata.cpp;..\..\..\moc\terraView\moc_telayer_metadata.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\telayer_metadata.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\telayer_metadata.ui -o ..\..\..\ui\terraView\telayer_metadata.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\telayer_metadata.ui -i telayer_metadata.h -o ..\..\..\ui\terraView\telayer_metadata.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\telayer_metadata.h -o ..\..\..\moc\terraView\moc_telayer_metadata.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\telayer_metadata.h;..\..\..\ui\terraView\telayer_metadata.cpp;..\..\..\moc\terraView\moc_telayer_metadata.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\terraViewBase.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\terraViewBase.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\terraViewBase.ui -o ..\..\..\ui\terraView\terraViewBase.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\terraViewBase.ui -i terraViewBase.h -o ..\..\..\ui\terraView\terraViewBase.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\terraViewBase.h -o ..\..\..\moc\terraView\moc_terraViewBase.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\terraViewBase.h;..\..\..\ui\terraView\terraViewBase.cpp;..\..\..\moc\terraView\moc_terraViewBase.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\terraViewBase.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\terraViewBase.ui -o ..\..\..\ui\terraView\terraViewBase.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\terraViewBase.ui -i terraViewBase.h -o ..\..\..\ui\terraView\terraViewBase.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\terraViewBase.h -o ..\..\..\moc\terraView\moc_terraViewBase.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\terraViewBase.h;..\..\..\ui\terraView\terraViewBase.cpp;..\..\..\moc\terraView\moc_terraViewBase.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\textRep.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\textRep.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\textRep.ui -o ..\..\..\ui\terraView\textRep.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\textRep.ui -i textRep.h -o ..\..\..\ui\terraView\textRep.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\textRep.h -o ..\..\..\moc\terraView\moc_textRep.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\textRep.h;..\..\..\ui\terraView\textRep.cpp;..\..\..\moc\terraView\moc_textRep.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\textRep.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\textRep.ui -o ..\..\..\ui\terraView\textRep.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\textRep.ui -i textRep.h -o ..\..\..\ui\terraView\textRep.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\textRep.h -o ..\..\..\moc\terraView\moc_textRep.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\textRep.h;..\..\..\ui\terraView\textRep.cpp;..\..\..\moc\terraView\moc_textRep.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\themeProp.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\themeProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeProp.ui -o ..\..\..\ui\terraView\themeProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeProp.ui -i themeProp.h -o ..\..\..\ui\terraView\themeProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\themeProp.h -o ..\..\..\moc\terraView\moc_themeProp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\themeProp.h;..\..\..\ui\terraView\themeProp.cpp;..\..\..\moc\terraView\moc_themeProp.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\themeProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeProp.ui -o ..\..\..\ui\terraView\themeProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeProp.ui -i themeProp.h -o ..\..\..\ui\terraView\themeProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\themeProp.h -o ..\..\..\moc\terraView\moc_themeProp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\themeProp.h;..\..\..\ui\terraView\themeProp.cpp;..\..\..\moc\terraView\moc_themeProp.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\themeVis.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\themeVis.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeVis.ui -o ..\..\..\ui\terraView\themeVis.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeVis.ui -i themeVis.h -o ..\..\..\ui\terraView\themeVis.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\themeVis.h -o ..\..\..\moc\terraView\moc_themeVis.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\themeVis.h;..\..\..\ui\terraView\themeVis.cpp;..\..\..\moc\terraView\moc_themeVis.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\themeVis.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeVis.ui -o ..\..\..\ui\terraView\themeVis.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\themeVis.ui -i themeVis.h -o ..\..\..\ui\terraView\themeVis.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\themeVis.h -o ..\..\..\moc\terraView\moc_themeVis.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\themeVis.h;..\..\..\ui\terraView\themeVis.cpp;..\..\..\moc\terraView\moc_themeVis.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\viewProp.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\viewProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\viewProp.ui -o ..\..\..\ui\terraView\viewProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\viewProp.ui -i viewProp.h -o ..\..\..\ui\terraView\viewProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\viewProp.h -o ..\..\..\moc\terraView\moc_viewProp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\viewProp.h;..\..\..\ui\terraView\viewProp.cpp;..\..\..\moc\terraView\moc_viewProp.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\viewProp.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\viewProp.ui -o ..\..\..\ui\terraView\viewProp.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\viewProp.ui -i viewProp.h -o ..\..\..\ui\terraView\viewProp.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\viewProp.h -o ..\..\..\moc\terraView\moc_viewProp.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\viewProp.h;..\..\..\ui\terraView\viewProp.cpp;..\..\..\moc\terraView\moc_viewProp.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\terraView\ui\visual.ui"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\visual.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\visual.ui -o ..\..\..\ui\terraView\visual.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\visual.ui -i visual.h -o ..\..\..\ui\terraView\visual.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\visual.h -o ..\..\..\moc\terraView\moc_visual.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\visual.h;..\..\..\ui\terraView\visual.cpp;..\..\..\moc\terraView\moc_visual.cpp"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Uic'ing ..\..\..\terraView\ui\visual.ui..."
+						CommandLine="$(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\visual.ui -o ..\..\..\ui\terraView\visual.h && $(QTDIR)\bin\uic.exe ..\..\..\terraView\ui\visual.ui -i visual.h -o ..\..\..\ui\terraView\visual.cpp && $(QTDIR)\bin\moc.exe ..\..\..\ui\terraView\visual.h -o ..\..\..\moc\terraView\moc_visual.cpp&#x0D;&#x0A;"
+						AdditionalDependencies="$(QTDIR)\bin\moc.exe;$(QTDIR)\bin\uic.exe"
+						Outputs="..\..\..\ui\terraView\visual.h;..\..\..\ui\terraView\visual.cpp;..\..\..\moc\terraView\moc_visual.cpp"
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Translations Files"
+			Filter="ts"
+			ParseFiles="false"
+			>
+			<File
+				RelativePath="..\..\../terraView/terraView_pt.ts"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/terraView_sp.ts"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resources"
+			Filter="cpp;ico;png;jpg;jpeg;gif;xpm;bmp;rc;ts"
+			ParseFiles="false"
+			>
+			<File
+				RelativePath="..\..\../terraView/ui/images/addressDictionary.png"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/addressLayer.png"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/addressReferenceLayer.png"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/addressTable.png"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/and.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/area.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/buffer.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/bufferNoUnion.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/bufferUnion.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/clearColor.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/closeDB.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/containLin.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/containLinPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/containLinPon.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/containPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/convexHull.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/coverByPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/coverLinPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/coverPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/crossLin.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/crossLinPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/database.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/databasesTree.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/disjointLin.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/disjointLinPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/disjointLinPon.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/disjointPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/disjointPonPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/display.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/distance.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/distMeter.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/draw.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/edit.xpm"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/equalLin.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/equalPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/graphic.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/graphicConfig.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/graphicCursor.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/grid.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/help.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/import.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/infoCursor.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/infolayer.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/insideAndOutside.png"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/invertColor1.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/invertSelection.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/isContainLin.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/isContainLinPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/isContainPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/isContainPonPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/left.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/length.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/minus.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/nearstNeigh.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/nextDisplay.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/nonEdit.xpm"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/onlyInside.png"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/onlyOutside.png"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/openfile.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/or.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/overlapLin.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/overlapPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/panCursor.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/pointer.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/previousDisplay.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/print.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/promote.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/reset.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/right.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/table.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/terralib.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/theme.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/tileWindows.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/touchLin.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/touchLinPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/touchLinPon.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/touchPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/touchPonPol.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/unselect.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/view.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/viewsTree.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/xor.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/zoomCursor.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/zoomIn.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\../terraView/ui/images/zoomOut.bmp"
+				>
+			</File>
+			<File
+				RelativePath="qmake_image_collection.cpp"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/terralib/terralib.sln b/build/win32-msvc2005/terralib/terralib.sln
new file mode 100644
index 0000000..63d26e0
--- /dev/null
+++ b/build/win32-msvc2005/terralib/terralib.sln
@@ -0,0 +1,124 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "terralib.vcproj", "{1253197A-5710-4924-9706-6449C0C32FE9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{DD1ADACD-7990-4793-9952-25197394954A} = {DD1ADACD-7990-4793-9952-25197394954A}
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D} = {C4A3E074-08E5-4197-ABB7-06611BAC269D}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\tiff\tiff.vcproj", "{DD1ADACD-7990-4793-9952-25197394954A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapelib", "..\shapelib\shapelib.vcproj", "{C4A3E074-08E5-4197-ABB7-06611BAC269D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_ado", "..\te_ado\te_ado.vcproj", "{F615229C-247C-4DF2-92C4-B891BC27BD9B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335} = {6F8DD2AE-66D4-442A-B204-114A1EF99335}
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_dxf", "..\te_dxf\te_dxf.vcproj", "{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4} = {5AC793EF-07E3-44DA-AE88-E8D6546A73E4}
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_firebird", "..\te_firebird\te_firebird.vcproj", "{DC4338DD-BAE5-487D-9688-573DE607CDFD}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_functions", "..\te_functions\te_functions.vcproj", "{877A1388-B3CA-481A-9BFB-C7178EC68D0B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_mysql", "..\te_mysql\te_mysql.vcproj", "{31C5E1F3-85BD-4580-973D-CA344342DD36}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_oracle", "..\te_oracle\te_oracle.vcproj", "{EE0E1B28-F969-4F8C-8D18-B31250403089}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_postgresql", "..\te_postgresql\te_postgresql.vcproj", "{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dxf", "..\dxf\dxf.vcproj", "{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_utils", "..\te_utils\te_utils.vcproj", "{6F8DD2AE-66D4-442A-B204-114A1EF99335}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Debug|Win32.Build.0 = Debug|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Release|Win32.ActiveCfg = Release|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Release|Win32.Build.0 = Release|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Debug|Win32.Build.0 = Debug|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Release|Win32.ActiveCfg = Release|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Release|Win32.Build.0 = Release|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Debug|Win32.Build.0 = Debug|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Release|Win32.ActiveCfg = Release|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Release|Win32.Build.0 = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug|Win32.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release|Win32.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release|Win32.Build.0 = Release|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Debug|Win32.Build.0 = Debug|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Release|Win32.ActiveCfg = Release|Win32
+		{F615229C-247C-4DF2-92C4-B891BC27BD9B}.Release|Win32.Build.0 = Release|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Debug|Win32.Build.0 = Debug|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Release|Win32.ActiveCfg = Release|Win32
+		{BE757F60-0368-4A50-AAC7-FFA4A2D5E29A}.Release|Win32.Build.0 = Release|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Debug|Win32.Build.0 = Debug|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Release|Win32.ActiveCfg = Release|Win32
+		{DC4338DD-BAE5-487D-9688-573DE607CDFD}.Release|Win32.Build.0 = Release|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Debug|Win32.Build.0 = Debug|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Release|Win32.ActiveCfg = Release|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Release|Win32.Build.0 = Release|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Debug|Win32.ActiveCfg = Debug|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Debug|Win32.Build.0 = Debug|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Release|Win32.ActiveCfg = Release|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Release|Win32.Build.0 = Release|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Debug|Win32.Build.0 = Debug|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Release|Win32.ActiveCfg = Release|Win32
+		{EE0E1B28-F969-4F8C-8D18-B31250403089}.Release|Win32.Build.0 = Release|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Debug|Win32.Build.0 = Debug|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Release|Win32.ActiveCfg = Release|Win32
+		{3A2BFE73-56BA-498F-BB11-A1E90D6A63B6}.Release|Win32.Build.0 = Release|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Debug|Win32.Build.0 = Debug|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Release|Win32.ActiveCfg = Release|Win32
+		{5AC793EF-07E3-44DA-AE88-E8D6546A73E4}.Release|Win32.Build.0 = Release|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Debug|Win32.Build.0 = Debug|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Release|Win32.ActiveCfg = Release|Win32
+		{6F8DD2AE-66D4-442A-B204-114A1EF99335}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/build/win32-msvc2005/terralib/terralib.vcproj b/build/win32-msvc2005/terralib/terralib.vcproj
new file mode 100644
index 0000000..21a8a87
--- /dev/null
+++ b/build/win32-msvc2005/terralib/terralib.vcproj
@@ -0,0 +1,1268 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="terralib"
+	ProjectGUID="{1253197A-5710-4924-9706-6449C0C32FE9}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\terralib"
+			IntermediateDirectory="..\..\..\Debug\terralib"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\functions;..\..\..\src\terralib\drivers\libjpeg;..\..\..\src\terralib\kernel;..\..\..\src\terralib\utils;..\..\..\src\tiff;..\..\..\src\libjpeg;..\..\..\src\zlib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TL_AS_DLL"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\..\..\dependencies\win32\zlib\lib\zlibdll.lib ..\..\..\Debug\libjpeg\libjpeg.lib $(OutDir)\..\tiff\tiff.lib"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\terralib"
+			IntermediateDirectory="..\..\..\Release\terralib"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				AdditionalIncludeDirectories="..\..\..\src\terralib\functions;..\..\..\src\terralib\drivers\libjpeg;..\..\..\src\terralib\kernel;..\..\..\src\terralib\utils;..\..\..\src\tiff;..\..\..\src\libjpeg;..\..\..\src\zlib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TL_AS_DLL"
+				MinimalRebuild="false"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\..\..\dependencies\win32\zlib\lib\zlibdll.lib ..\..\..\Release\libjpeg\libjpeg.lib $(OutDir)\..\tiff\tiff.lib"
+				OutputFile="$(OutDir)/../$(ProjectName).dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="false"
+				ProgramDatabaseFile=""
+				SubSystem="2"
+				OptimizeReferences="0"
+				EnableCOMDATFolding="0"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\libjpeg\jmemdst.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\libjpeg\jmemsrc.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\lexTemporal.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\Te2ndDegPolinomialGT.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\Te2ndDegPolinomialGTFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAbstractTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAffineGT.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAffineGTFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAgnostic.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAsciiFile.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBlockLoader.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBox.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBufferRegion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCentroid.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeComputeAttributeStrategies.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageImportUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabase.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseFactoryParams.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseIndex.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatum.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDBConnectionsPool.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderASCIIGrid.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderDatabase.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderFile.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderJPEG.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderMemory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderMemoryMap.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderSmartMem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderSPR.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderTIFF.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderVirtualMemory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeErrorLog.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeErrorMessage.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeException.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeExternalTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFileTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFragmentation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFunctionCallThreadJob.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGDriverFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometricTransformation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometry.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometryAlgorithms.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGroupingAlgorithms.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGTFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGTParams.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeImportRaster.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeInitRasterDecoders.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeIntersector.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeLayer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeLegendEntry.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\libjpeg\TeLibJpegWrapper.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMappedMemory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMatrix.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMetaModelCache.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMultiGeometry.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMutex.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeNeighbours.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeNetwork.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeOverlay.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeOverlayUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TePolygonSetProperties.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProgress.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProject.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjection.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjectiveGT.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjectiveGTFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixConstructionStrategy.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixImplementation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixStrategies.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerier.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDB.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr1.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr2.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr3.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierImpl.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierParams.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRaster.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterMemManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterParams.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterRemap.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterTransform.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRepresentation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSemaphore.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSpatialOperations.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeStdFile.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeStdIOProgress.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTElementSet.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTEvent.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTInstance.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTempFilesRemover.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTemporalSeries.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTheme.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThread.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadFunctor.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadJob.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadJobsManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadSignal.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTime.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTimeInterval.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTin.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeVectorRemap.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeViewNode.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeVisual.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\yyTemporal.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\checkvec.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\dynpq.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\Gra_algo.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\graph.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\libjpeg\jmemdstsrc.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\Te2ndDegPolinomialGT.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\Te2ndDegPolinomialGTFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAbstractFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAbstractTheme.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAffineGT.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAffineGTFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAgnostic.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAsciiFile.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAssertions.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeAttribute.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBaseSTInstance.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBaseSTInstanceSet.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBlockLoader.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBox.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeBufferRegion.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCommunicator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeComposite.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeComputeAttributeStrategies.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoord2D.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCounted.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverage.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageDecoder.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageDecoderCacheLRU.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageDecoderDatabase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageImport.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageImportUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageInterpolator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageInterpolatorNN.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageParams.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeCoverageUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseFactoryParams.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatabaseIndex.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDataTypes.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDatum.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDBConnectionsPool.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoder.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderASCIIGrid.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderDatabase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderFile.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderJPEG.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderMemory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderMemoryMap.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderSmartMem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderSPR.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderTIFF.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDecoderVirtualMemory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeDefines.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeErrorLog.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeErrorMessage.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeException.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeExternalTheme.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFileTheme.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFragmentation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeFunctionCallThreadJob.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGDriverFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeneralizedProxMatrix.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometricTransformation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometry.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGeometryAlgorithms.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGraph.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGridIndex.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGroupingAlgorithms.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGTFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeGTParams.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeImportRaster.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeInitRasterDecoders.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeIntersector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeKdTree.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeLayer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeLegendEntry.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\drivers\libjpeg\TeLibJpegWrapper.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMappedMemory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMatrix.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMeasure.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMetaModelCache.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMultiContainer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMultiGeometry.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeMutex.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeNeighbours.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeNetwork.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeOverlay.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeOverlayUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TePieBar.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TePolygonSetProperties.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TePrecision.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProgress.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProgressBase.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjection.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjectiveGT.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProjectiveGTFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TePrototype.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixConstructionStrategy.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixImplementation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixSlicingStrategy.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeProxMatrixWeightsStrategy.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerier.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDB.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr1.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr2.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierDBStr3.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierImpl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeQuerierParams.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRaster.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterMemManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterParams.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterRemap.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRasterTransform.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRedBlackTree.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRepresentation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeRTree.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSemaphore.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSharedPtr.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSingleton.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSlice.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSparseMatrix.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSpatialOperations.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeStatistics.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeStdFile.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeStdIOProgress.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTEFunctionsDB.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTElementSet.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTEvent.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeSTInstance.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTempFilesRemover.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTemporalSeries.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTheme.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThread.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadDatatypes.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadFunctor.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadJob.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadJobsManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadParameters.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeThreadSignal.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTime.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTimeInterval.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeTin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeVectorRemap.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeVersion.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeView.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeViewNode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeViewTreeIterator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeViewTreeUtils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\TeVisual.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\kernel\yyTemporal.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/terralibdtm/terralibdtm.vcproj b/build/win32-msvc2005/terralibdtm/terralibdtm.vcproj
new file mode 100644
index 0000000..7805dc9
--- /dev/null
+++ b/build/win32-msvc2005/terralibdtm/terralibdtm.vcproj
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="terralibdtm"
+	ProjectGUID="{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\terralibdtm"
+			IntermediateDirectory="..\..\..\Release\terralibdtm"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 "
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories="..\..\..\src\tiff;..\..\..\src\shapelib;..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions;..\..\..\src\terralib\image_processing;..\..\..\src\terralib\image_processing\data_structs;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;UNICODE;__WIN32__;PDI_AS_DLL"
+				StringPooling="FALSE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="FALSE"
+				RuntimeTypeInfo="TRUE"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(OutDir)\..\terralib\terralib.lib"
+				OutputFile="$(OutDir)/../$(ProjectName).dll"
+				LinkIncremental="1"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\terralibdtm"
+			IntermediateDirectory="..\..\..\Debug\terralibdtm"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 "
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\tiff;..\..\..\src\shapelib;..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions;..\..\..\src\terralib\dtm;..\..\..\src\terralib\image_processing"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;UNICODE;__WIN32__;DTM_AS_DLL"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				RuntimeTypeInfo="TRUE"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"
+				CompileAs="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\..\..\Debug\libspl\libspl.lib ..\..\..\Debug\terralibpdi\terralibpdi.lib ..\..\..\Debug\terralib\terralib.lib ..\..\..\terralibw/zlib/zlibdll.lib"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTM.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMAlgorithm.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMDerive.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMInterpolator.cpp">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMParameters.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTM.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMAlgorithm.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMDefines.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMDerive.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMInterpolator.h">
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\dtm\TeDTMParameters.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+		<Filter
+			Name="Generated"
+			Filter="moc">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/terralibpdi/terralibpdi.vcproj b/build/win32-msvc2005/terralibpdi/terralibpdi.vcproj
new file mode 100644
index 0000000..b94988f
--- /dev/null
+++ b/build/win32-msvc2005/terralibpdi/terralibpdi.vcproj
@@ -0,0 +1,1071 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="terralibpdi"
+	ProjectGUID="{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\terralibpdi"
+			IntermediateDirectory="..\..\..\Release\terralibpdi"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 "
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories="..\..\..\src\tiff;..\..\..\src\shapelib;..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions;..\..\..\src\terralib\image_processing;..\..\..\src\terralib\image_processing\data_structs;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;UNICODE;__WIN32__;PDI_AS_DLL"
+				StringPooling="false"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="false"
+				RuntimeTypeInfo="true"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="2"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(OutDir)\..\terralib\terralib.lib"
+				OutputFile="$(OutDir)/../$(ProjectName).dll"
+				LinkIncremental="1"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\terralibpdi"
+			IntermediateDirectory="..\..\..\Debug\terralibpdi"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 "
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\tiff;..\..\..\src\shapelib;..\..\..\src\terralib\kernel;..\..\..\src\terralib\functions;..\..\..\src\terralib\image_processing;..\..\..\src\terralib\image_processing\data_structs"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;UNICODE;__WIN32__;PDI_AS_DLL;PDIAGN_DEBUG_MODE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				RuntimeTypeInfo="true"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+				CompileAs="2"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(OutDir)\..\terralib\terralib.lib"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIAlgorithm.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIAlgorithmFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIArithmetic.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIArithmeticFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBaatz.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBatchGeoMosaic.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBDFilter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBDFilterFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBlender.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBufferedFilter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDICluster.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIColorTransform.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIColorTransformFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIContrast.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIContrastFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDICorrelationMatching.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIDecorrelationEnhancement.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEMClas.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEMClasFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEspecData.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIFilterMask.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIFusionIndexes.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGarguetFusion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGeneralizedIHSFusion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGeoMosaic.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIHaralick.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIHistogram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIHSFusion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIHSWaveletFusion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIInterpolator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIsosegClas.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIsosegClasFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIJointHistogram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIKMeansClas.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIKMeansClasFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILevelRemap.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILinearFilter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILinearFilterFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMallatWavelets.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMathFunctions.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMatrixFunctions.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMIMatching.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModel.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelComponent.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelComponentList.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelSpectralBand.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelSpectralBandList.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelStrategy.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelStratFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMMIOMatching.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMorfFilter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMorfFilterFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIOFMatching.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParallelSegmenter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParameters.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegBaatzStrategy.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegBaatzStrategyFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegRegGrowStrategy.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegRegGrowStrategyFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegSegment.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegSegmentsBlock.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategy.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyFactoryParams.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyParams.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPCAWaveletFusion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPIManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponents.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponentsFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponentsFusion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincoMixModelSF.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincoMixModelStrategy.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFilter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFrostFilter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFrostFilterFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarGammaFilter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarKuanFilter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarKuanFilterFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarLeeFilter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarLeeFilterFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRaster2Vector.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRaster2VectorFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRasterRUBuffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegGrowSeg.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegGrowSegFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegister.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegisterFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRgbPalette.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRgbPaletteFunctions.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISAMClassifier.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISensorSimulator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISensorSimulatorFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStatistic.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStrategy.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStrategyFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDITPMosaic.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIUtils.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIVenturaFusion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWaveletAtrous.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWaveletAtrousFusion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWiSpeRFusion.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIAlgorithm.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIAlgorithmFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIArithmetic.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIArithmeticFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBaatz.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBatchGeoMosaic.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBDFilter.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBDFilterFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBlender.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIBufferedFilter.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDICluster.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIColorTransform.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIColorTransformFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIContrast.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIContrastFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDICorrelationMatching.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIDecorrelationEnhancement.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIDefines.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEMClas.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEMClasFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIEspecData.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIFilterMask.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIFusionIndexes.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGarguetFusion.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGeneralizedIHSFusion.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIGeoMosaic.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIHaralick.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIHistogram.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIHSFusion.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIHSWaveletFusion.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIInterpolator.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIsosegClas.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIIsosegClasFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIJointHistogram.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIKMeansClas.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIKMeansClasFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILevelRemap.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILinearFilter.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDILinearFilterFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMallatWavelets.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMathFunctions.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMatrix.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMatrixFunctions.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMIMatching.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModel.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelComponent.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelComponentList.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelSpectralBand.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelSpectralBandList.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelStrategy.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMixModelStratFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMMIOMatching.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMorfFilter.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMorfFilterFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIMtxDoubleAdpt.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIOFMatching.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParallelSegmenter.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParameters.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegBaatzStrategy.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegBaatzStrategyFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegRegGrowStrategy.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegRegGrowStrategyFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegSegment.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegSegmentsBlock.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategy.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyFactoryParams.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIParaSegStrategyParams.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPCAWaveletFusion.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPIManager.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPIManagerGlobalSettings.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponents.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponentsFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincipalComponentsFusion.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincoMixModelSF.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIPrincoMixModelStrategy.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFilter.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFrostFilter.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarFrostFilterFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarGammaFilter.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarKuanFilter.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarKuanFilterFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarLeeFilter.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRadarLeeFilterFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRaster2Vector.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRaster2VectorFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRasterRUBuffer.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegGrowSeg.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegGrowSegFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegion.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegister.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRegisterFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRgbPalette.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRgbPaletteFunctions.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIRgbPaletteNode.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISAMClassifier.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISensorSimulator.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDISensorSimulatorFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStatistic.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStrategy.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIStrategyFactory.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDITileIndexer.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDITPMosaic.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDITypes.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIUtils.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIVenturaFusion.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWaveletAtrous.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWaveletAtrousFusion.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\terralib\image_processing\TePDIWiSpeRFusion.hpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+		<Filter
+			Name="Generated"
+			Filter="moc"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/build/win32-msvc2005/tiff/tiff.vcproj b/build/win32-msvc2005/tiff/tiff.vcproj
new file mode 100644
index 0000000..535e6d6
--- /dev/null
+++ b/build/win32-msvc2005/tiff/tiff.vcproj
@@ -0,0 +1,520 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="tiff"
+	ProjectGUID="{DD1ADACD-7990-4793-9952-25197394954A}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Debug\tiff"
+			IntermediateDirectory="..\..\..\Debug\tiff"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\zlib;..\..\..\src\libjpeg"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILD_AS_DLL"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\..\..\Debug\libjpeg\libjpeg.lib ..\..\..\dependencies\win32\zlib\lib\zlibdll.lib"
+				OutputFile="$(OutDir)\..\$(ProjectName)_d.dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Release\tiff"
+			IntermediateDirectory="..\..\..\Release\tiff"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\src\zlib;..\..\..\src\libjpeg"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILD_AS_DLL"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				AssemblerListingLocation="$(OutDir)\"
+				ObjectFile="$(OutDir)\"
+				ProgramDataBaseFileName="$(OutDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="$(OutDir)\..\libjpeg\libjpeg.lib ..\..\..\dependencies\win32\zlib\lib\zlibdll.lib"
+				OutputFile="$(OutDir)/../$(ProjectName).dll"
+				LinkIncremental="1"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="0"
+				EnableCOMDATFolding="0"
+				ImportLibrary="$(OutDir)/$(ProjectName).lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\..\src\tiff\cpl_csv.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\cpl_serv.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_extra.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_free.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_get.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_names.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_new.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_normalize.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_print.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_set.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_tiffp.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_trans.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_write.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geotiff_proj4.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_aux.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_close.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_codec.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_color.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_compress.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dir.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dirinfo.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dirread.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dirwrite.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dumpmode.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_error.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_extension.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_fax3.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_fax3sm.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_flush.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_getimage.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_jpeg.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_luv.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_lzw.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_machdep.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_next.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_open.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_packbits.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_pixarlog.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_predict.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_print.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_read.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_strip.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_swab.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_thunder.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_tile.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_version.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_warning.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_win32.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_write.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_zip.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\xtiff.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\..\..\src\tiff\cpl_csv.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\cpl_serv.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_config.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_keyp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_normalize.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geo_tiffp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geokeys.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geokeys.inc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geonames.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geotiff.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geotiffio.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\geovalues.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\port.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\t4.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_config.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_dir.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_fax3.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tif_predict.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiff.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiffcomp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiffconf.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiffio.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiffiop.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\tiffvers.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\uvcode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\xtiffio.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\tiff\xtiffiop.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/dependencies/linux/DSDK/lib/libgdal.a b/dependencies/linux/DSDK/lib/libgdal.a
new file mode 100644
index 0000000..1449dc9
Binary files /dev/null and b/dependencies/linux/DSDK/lib/libgdal.a differ
diff --git a/dependencies/linux/DSDK/lib/libltidsdk.a b/dependencies/linux/DSDK/lib/libltidsdk.a
new file mode 100644
index 0000000..e4805be
Binary files /dev/null and b/dependencies/linux/DSDK/lib/libltidsdk.a differ
diff --git a/dependencies/linux/Firebird/lib/libfbembed.so b/dependencies/linux/Firebird/lib/libfbembed.so
new file mode 100644
index 0000000..39972b2
Binary files /dev/null and b/dependencies/linux/Firebird/lib/libfbembed.so differ
diff --git a/dependencies/linux/Firebird/lib/libicudata.so.30 b/dependencies/linux/Firebird/lib/libicudata.so.30
new file mode 100644
index 0000000..9071c3a
Binary files /dev/null and b/dependencies/linux/Firebird/lib/libicudata.so.30 differ
diff --git a/dependencies/linux/Firebird/lib/libicui18n.so.30 b/dependencies/linux/Firebird/lib/libicui18n.so.30
new file mode 100644
index 0000000..860df02
Binary files /dev/null and b/dependencies/linux/Firebird/lib/libicui18n.so.30 differ
diff --git a/dependencies/linux/Firebird/lib/libicuuc.so.30 b/dependencies/linux/Firebird/lib/libicuuc.so.30
new file mode 100644
index 0000000..801d930
Binary files /dev/null and b/dependencies/linux/Firebird/lib/libicuuc.so.30 differ
diff --git a/dependencies/linux/MySQL/lib/libmysqlclient.a b/dependencies/linux/MySQL/lib/libmysqlclient.a
new file mode 100644
index 0000000..f5d1e1e
Binary files /dev/null and b/dependencies/linux/MySQL/lib/libmysqlclient.a differ
diff --git a/dependencies/linux/Oracle/lib/libclntsh.so.10.1 b/dependencies/linux/Oracle/lib/libclntsh.so.10.1
new file mode 100644
index 0000000..b920eda
Binary files /dev/null and b/dependencies/linux/Oracle/lib/libclntsh.so.10.1 differ
diff --git a/dependencies/linux/Oracle/lib/libnnz10.so b/dependencies/linux/Oracle/lib/libnnz10.so
new file mode 100644
index 0000000..1094693
Binary files /dev/null and b/dependencies/linux/Oracle/lib/libnnz10.so differ
diff --git a/dependencies/linux/Oracle/lib/libociei.so b/dependencies/linux/Oracle/lib/libociei.so
new file mode 100644
index 0000000..61b24d6
Binary files /dev/null and b/dependencies/linux/Oracle/lib/libociei.so differ
diff --git a/dependencies/linux/PostgreSQL/lib/libpq.a b/dependencies/linux/PostgreSQL/lib/libpq.a
new file mode 100644
index 0000000..185da7d
Binary files /dev/null and b/dependencies/linux/PostgreSQL/lib/libpq.a differ
diff --git a/dependencies/linux/opengl/lib/libGL.so b/dependencies/linux/opengl/lib/libGL.so
new file mode 100644
index 0000000..21295f1
Binary files /dev/null and b/dependencies/linux/opengl/lib/libGL.so differ
diff --git a/dependencies/linux/opengl/lib/libGLU.so b/dependencies/linux/opengl/lib/libGLU.so
new file mode 100644
index 0000000..1ddbdd2
Binary files /dev/null and b/dependencies/linux/opengl/lib/libGLU.so differ
diff --git a/dependencies/linux/opengl/lib/libdrm.so b/dependencies/linux/opengl/lib/libdrm.so
new file mode 100644
index 0000000..421def6
Binary files /dev/null and b/dependencies/linux/opengl/lib/libdrm.so differ
diff --git a/examples/Debug/ijl15.dll b/examples/Debug/ijl15.dll
old mode 100755
new mode 100644
diff --git a/examples/Debug/libMySQL.dll b/examples/Debug/libMySQL.dll
old mode 100755
new mode 100644
index de2c2d2..21439d9
Binary files a/examples/Debug/libMySQL.dll and b/examples/Debug/libMySQL.dll differ
diff --git a/examples/Debug/libpq.dll b/examples/Debug/libpq.dll
old mode 100755
new mode 100644
index 6e95daa..1e2962c
Binary files a/examples/Debug/libpq.dll and b/examples/Debug/libpq.dll differ
diff --git a/examples/Debug/msjava.dll b/examples/Debug/msjava.dll
old mode 100755
new mode 100644
diff --git a/examples/Debug/oci.dll b/examples/Debug/oci.dll
old mode 100755
new mode 100644
index 59be9f8..ba03f6f
Binary files a/examples/Debug/oci.dll and b/examples/Debug/oci.dll differ
diff --git a/examples/Debug/zlib.dll b/examples/Debug/zlib.dll
old mode 100755
new mode 100644
diff --git a/examples/Debug/zlib1.dll b/examples/Debug/zlib1.dll
old mode 100755
new mode 100644
index e93cdb9..31996cd
Binary files a/examples/Debug/zlib1.dll and b/examples/Debug/zlib1.dll differ
diff --git a/examples/Makefile b/examples/Makefile
old mode 100755
new mode 100644
index 50fb840..dab4d8b
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -1,45 +1,9 @@
-
-SUBDIRS = \
-	createDatabase \
-	createLayer \
-	createTable \
-	importMIDMIF \
-	importShape \
-	importDBF \
-	importJPEG \
-	copyLayer \
-	importGeoTab \
-	convertCoordinates \
-	databaseQuery \
-	databaseSQLQuery \
-	spatialQuery \
-	addGeomRepresentation \
-	createTheme \
-	themeGrouping \
-	createSTElementSet \
-	mosaicTIFFImages \
-	importCSV \
-	importGridData \
-	rasterSlicing \
-	querierFromTheme \
-	proxMatrixAndSpatialStatistics \
-	spatialQueryAndBuffer \
-	querierFromLayer \
-	createSTElementSetFromLayer \
-	image_processing
-
-all:
-	@for i in $(SUBDIRS); do \
-	( cd $$i; make; ); done
-
-debug:
-	@for i in $(SUBDIRS); do \
-	( cd $$i; make debug; ); done
-
-clean:
-	@for i in $(SUBDIRS); do \
-	( cd $$i; make clean; ); done
-
-clean_debug:
-	@for i in $(SUBDIRS); do \
-	( cd $$i; make clean_debug; ); done
+all: release
+
+debug: tlib_dbg build_dbg
+
+tlib_dbg:
+	cd ../build/qt; qmake utilities.pro TEDRIVERS="HAS_MYSQL HAS_SHP" MAKEFILE=Makefile.Debug TE_PROJECT_TYPE=DEBUG; make -f Makefile.Debug;
+	
+build_dbg:
+	qmake MAKEFILE=Makefile.Debug TE_PROJECT_TYPE=DEBUG; make -f Makefile.Debug
\ No newline at end of file
diff --git a/examples/Readme b/examples/Readme
old mode 100755
new mode 100644
index 09a3c45..effb255
--- a/examples/Readme
+++ b/examples/Readme
@@ -1,143 +1,143 @@
-TerraLib Examples
-=================
-
-Each one of the items below corresponds to a directory that contains the  source files that
-implement some operation using TerraLib. 
-
-The data used in the examples can be found in the "data" directory.
-
-Each directory also has some compilation/linking files. 
-
-For Windows users these files are Microsoft Visual .NET 2003 solution and project files (*.sln, *.vcproj).
-The executables are generated in the directory Release/Debug
-
-For Linux users there are Makefiles and .pro files used by qmake. The executables are generated in each directory 
-that contains the example.
-
-Some of the examples depend on the execution of others. So we recommend that they
-should be run in the order proposed bellow.
-
-1. createDatabase
-Illustrates how to create a TerraLib database, creating all of the tables that
-make up the TerraLib data model.
-
-2. createLayer
-Illustrates how to create a layer with vector data in memory and save it in a
-TerraLib database already created.
-
-3. createTable
-Illustrates how to create an attribute table in memory and save it in a TerraLib
-database already created.
-
-4. importMIDMIF
-Illustrates how to import a vector data file in the MapInfo format(MID/MIF)for a
-TerraLib database already created.
-Source Data: Distritos.mid, Distritos.mif
-
-5. importShape
-Illustrates how to import a vector data file in the Shapefile format for a TerraLib
-database already created.
-Source Data: EstadosBrasil.shp, EstadosBrasil.shx, EstadosBrasil.dbf
-
-6. importDBF
-Illustrates how to import an attribute table in the DBF format as an external table
-for a TerraLib database already created.
-Source Data: SOCEC.dbf
-
-7. importJPEG
-Illustrates how to import an image in the JPEG format for a TerraLib database already
-created.
-Source Data: sampa.jpg
-
-8. copyLayer
-Illustrates how to copy a layer of a TerraLib database changing the projection of its
-geometries.
-It depends on the layer created in the item 4 (importMIDMIF).
-
-9. importGeoTab
-Illustrates how to import a vector data file in the SPRING format for a TerraLib
-database already created.
-Source Data: Cadastro_Escolas.geo, Cadastro_Escolas.tab
-
-10. convertCoordinates
-Illustrates how to use the TeProjection class to make the conversion between two
-different projections.
-
-11. databaseQuery
-It illustrates how to use the TeDatabase class to submit queries on geometries tables
-of a TerraLib database.
-It depends on the layer created in the item 4 (importMIDMIF).
-
-12. databaseSQLQuery
-Illustrates how to query geometries tables through explicit SQL queries on a TerraLib
-database.
-It depends on the layer created in the item 4 (importMIDMIF).
-
-13. spatialQuery
-Illustrates how to make spatial queries on the layers of a TerraLib database.
-Imports the shapefiles Mada_Distritos_SP, Mapa_Drenagem_SP and Mapa_Industrias_SP.
-
-14. addGeomRepresentation
-Illustrates how to add a point representation (centroids) to a layer with polygon
-representation.
-It depends on the layer created in the item 4 (importMIDMIF).
-
-15. createTheme
-Illustrates how to create views and themes from layers of a Terralib database,
-without restriction and with restriction on its attributes.
-It depends on the layer created in the item 4 (importMIDMIF).
-
-16. themeGrouping
-Illustrates how to create a grouping on a theme created in a TerraLib database.
-It depends on the theme created in the item 15 (createTheme).
-
-17. createSTElementSet
-Illustrates how to create a Spatial Temporal Element Set, out of a theme created
-in a TerraLib database.
-It depends on the theme created in the item 15 (createTheme).
-
-18. mosaicTIFFImages
-Illustrates how to import two TIFF files to the same layer in a TerraLib database,
-generating a mosaic of images.
-It depends on the files nat1.tif and nat2.tif.
-
-19. importCSV
-Illustrates how to import a MIF / MIF file to a new layer in a TerraLib database
-and how to import a second attribute table from a CSV file.
-It depends on the files BairrosRecife.MIF BairrosRecife.MID and BairrosRecife2.csv
-
-20. importGridData
-Illustrates how to import grid data in raw format for a TerraLib database already
-created.
-Source Data: elevation.raw
-
-21. rasterSlicing
-Illustrates how to group the values of a raster data in a set of classes.
-It depends on the layer created in example 20 (importGridData).
-
-22. querierFromTheme
-Illustrates how to use a querier from theme.
-It depends on the theme created in the item 15 (createTheme).
-
-23.proxMatrixAndSpatialStatistics
-Illustrates how to build a proximity matrix and how to calculate some spatial analysis index.
-It depends on the layer created in the item 4 (importMIDMIF)
-
-24. spatialQueryAndBuffer
-Illustrates how to do some spatial queries involving objects with points, lines and polygon geometries,
-and to generate a buffer operation.
-It depends on the layers create in the item 13 (spatialQuery).
-
-25. querierFromLayer
-Illustrates how to use a querier from layer.
-Requires the layer CadastroEscolas created in the item 9 (importGeoTab).
-
-26. createSTElementSetFromLayer
-Illustrates how to create a new Spatial Temporal Element Set (STElementSet) from a layer. 
-It uses the same input files used in the item 5 (importShape).
- 
-27. image_processing
-This directory contains a set of testing routines for image processing
-algorithms from TerraLib - LibPDI ( image_processing ).
-This routines can be used as examples for using the tested classes.
-
+TerraLib Examples
+=================
+
+Each one of the items below corresponds to a directory that contains the  source files that
+implement some operation using TerraLib. 
+
+The data used in the examples can be found in the "data" directory.
+
+Each directory also has some compilation/linking files. 
+
+For Windows users these files are Microsoft Visual .NET 2003 solution and project files (*.sln, *.vcproj).
+The executables are generated in the directory Release/Debug
+
+For Linux users there are Makefiles and .pro files used by qmake. The executables are generated in each directory 
+that contains the example.
+
+Some of the examples depend on the execution of others. So we recommend that they
+should be run in the order proposed bellow.
+
+1. createDatabase
+Illustrates how to create a TerraLib database, creating all of the tables that
+make up the TerraLib data model.
+
+2. createLayer
+Illustrates how to create a layer with vector data in memory and save it in a
+TerraLib database already created.
+
+3. createTable
+Illustrates how to create an attribute table in memory and save it in a TerraLib
+database already created.
+
+4. importMIDMIF
+Illustrates how to import a vector data file in the MapInfo format(MID/MIF)for a
+TerraLib database already created.
+Source Data: Distritos.mid, Distritos.mif
+
+5. importShape
+Illustrates how to import a vector data file in the Shapefile format for a TerraLib
+database already created.
+Source Data: EstadosBrasil.shp, EstadosBrasil.shx, EstadosBrasil.dbf
+
+6. importDBF
+Illustrates how to import an attribute table in the DBF format as an external table
+for a TerraLib database already created.
+Source Data: SOCEC.dbf
+
+7. importJPEG
+Illustrates how to import an image in the JPEG format for a TerraLib database already
+created.
+Source Data: sampa.jpg
+
+8. copyLayer
+Illustrates how to copy a layer of a TerraLib database changing the projection of its
+geometries.
+It depends on the layer created in the item 4 (importMIDMIF).
+
+9. importGeoTab
+Illustrates how to import a vector data file in the SPRING format for a TerraLib
+database already created.
+Source Data: Cadastro_Escolas.geo, Cadastro_Escolas.tab
+
+10. convertCoordinates
+Illustrates how to use the TeProjection class to make the conversion between two
+different projections.
+
+11. databaseQuery
+It illustrates how to use the TeDatabase class to submit queries on geometries tables
+of a TerraLib database.
+It depends on the layer created in the item 4 (importMIDMIF).
+
+12. databaseSQLQuery
+Illustrates how to query geometries tables through explicit SQL queries on a TerraLib
+database.
+It depends on the layer created in the item 4 (importMIDMIF).
+
+13. spatialQuery
+Illustrates how to make spatial queries on the layers of a TerraLib database.
+Imports the shapefiles Mada_Distritos_SP, Mapa_Drenagem_SP and Mapa_Industrias_SP.
+
+14. addGeomRepresentation
+Illustrates how to add a point representation (centroids) to a layer with polygon
+representation.
+It depends on the layer created in the item 4 (importMIDMIF).
+
+15. createTheme
+Illustrates how to create views and themes from layers of a Terralib database,
+without restriction and with restriction on its attributes.
+It depends on the layer created in the item 4 (importMIDMIF).
+
+16. themeGrouping
+Illustrates how to create a grouping on a theme created in a TerraLib database.
+It depends on the theme created in the item 15 (createTheme).
+
+17. createSTElementSet
+Illustrates how to create a Spatial Temporal Element Set, out of a theme created
+in a TerraLib database.
+It depends on the theme created in the item 15 (createTheme).
+
+18. mosaicTIFFImages
+Illustrates how to import two TIFF files to the same layer in a TerraLib database,
+generating a mosaic of images.
+It depends on the files nat1.tif and nat2.tif.
+
+19. importCSV
+Illustrates how to import a MIF / MIF file to a new layer in a TerraLib database
+and how to import a second attribute table from a CSV file.
+It depends on the files BairrosRecife.MIF BairrosRecife.MID and BairrosRecife2.csv
+
+20. importGridData
+Illustrates how to import grid data in raw format for a TerraLib database already
+created.
+Source Data: elevation.raw
+
+21. rasterSlicing
+Illustrates how to group the values of a raster data in a set of classes.
+It depends on the layer created in example 20 (importGridData).
+
+22. querierFromTheme
+Illustrates how to use a querier from theme.
+It depends on the theme created in the item 15 (createTheme).
+
+23.proxMatrixAndSpatialStatistics
+Illustrates how to build a proximity matrix and how to calculate some spatial analysis index.
+It depends on the layer created in the item 4 (importMIDMIF)
+
+24. spatialQueryAndBuffer
+Illustrates how to do some spatial queries involving objects with points, lines and polygon geometries,
+and to generate a buffer operation.
+It depends on the layers create in the item 13 (spatialQuery).
+
+25. querierFromLayer
+Illustrates how to use a querier from layer.
+Requires the layer CadastroEscolas created in the item 9 (importGeoTab).
+
+26. createSTElementSetFromLayer
+Illustrates how to create a new Spatial Temporal Element Set (STElementSet) from a layer. 
+It uses the same input files used in the item 5 (importShape).
+ 
+27. image_processing
+This directory contains a set of testing routines for image processing
+algorithms from TerraLib - LibPDI ( image_processing ).
+This routines can be used as examples for using the tested classes.
+
diff --git a/examples/Debug/ijl15.dll b/examples/Release/ijl15.dll
old mode 100755
new mode 100644
similarity index 100%
copy from examples/Debug/ijl15.dll
copy to examples/Release/ijl15.dll
diff --git a/examples/Release/libMySQL.dll b/examples/Release/libMySQL.dll
new file mode 100644
index 0000000..21439d9
Binary files /dev/null and b/examples/Release/libMySQL.dll differ
diff --git a/examples/Release/libpq.dll b/examples/Release/libpq.dll
new file mode 100644
index 0000000..1e2962c
Binary files /dev/null and b/examples/Release/libpq.dll differ
diff --git a/examples/Release/oci.dll b/examples/Release/oci.dll
new file mode 100644
index 0000000..ba03f6f
Binary files /dev/null and b/examples/Release/oci.dll differ
diff --git a/examples/Debug/zlib.dll b/examples/Release/zlib.dll
old mode 100755
new mode 100644
similarity index 100%
copy from examples/Debug/zlib.dll
copy to examples/Release/zlib.dll
diff --git a/examples/addGeomRepresentation/.cdtproject b/examples/addGeomRepresentation/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/addGeomRepresentation/.cdtproject
+++ b/examples/addGeomRepresentation/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/addGeomRepresentation/.project b/examples/addGeomRepresentation/.project
old mode 100755
new mode 100644
index 04ee9ca..ce3ef2e
--- a/examples/addGeomRepresentation/.project
+++ b/examples/addGeomRepresentation/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>addGeomRepresentation</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>addGeomRepresentation</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/addGeomRepresentation/Makefile b/examples/addGeomRepresentation/Makefile
old mode 100755
new mode 100644
index a8493ab..f453044
--- a/examples/addGeomRepresentation/Makefile
+++ b/examples/addGeomRepresentation/Makefile
@@ -1,30 +1,30 @@
-all: addGeomRepresentation
-
-debug: addGeomRepresentation_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-	
-addGeomRepresentation: terralib
-	qmake -o makeAddGeomRepresentation addGeomRepresentation.pro; make -f makeAddGeomRepresentation
-
-addGeomRepresentation_dbg: terralib_dbg
-	qmake -o makeAddGeomRepresentation.debug addGeomRepresentation.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeAddGeomRepresentation.debug
-
-clean:
-	if \
-		test -f makeAddGeomRepresentation; \
-	then \
-		make -f makeAddGeomRepresentation distclean; rm -f makeAddGeomRepresentation; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeAddGeomRepresentation.debug; \
-	then \
-		make -f makeAddGeomRepresentation.debug distclean; rm -f makeAddGeomRepresentation.debug; \
+all: addGeomRepresentation
+
+debug: addGeomRepresentation_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+	
+addGeomRepresentation: terralib
+	qmake -o makeAddGeomRepresentation addGeomRepresentation.pro; make -f makeAddGeomRepresentation
+
+addGeomRepresentation_dbg: terralib_dbg
+	qmake -o makeAddGeomRepresentation.debug addGeomRepresentation.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeAddGeomRepresentation.debug
+
+clean:
+	if \
+		test -f makeAddGeomRepresentation; \
+	then \
+		make -f makeAddGeomRepresentation distclean; rm -f makeAddGeomRepresentation; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeAddGeomRepresentation.debug; \
+	then \
+		make -f makeAddGeomRepresentation.debug distclean; rm -f makeAddGeomRepresentation.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/addGeomRepresentation/addGeomRepresentation.cpp b/examples/addGeomRepresentation/addGeomRepresentation.cpp
old mode 100755
new mode 100644
index 931557a..56ef747
--- a/examples/addGeomRepresentation/addGeomRepresentation.cpp
+++ b/examples/addGeomRepresentation/addGeomRepresentation.cpp
@@ -1,100 +1,100 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows an example of how to create a point representation
-	(centroid of polygons) to a layer in a TerraLib database.
-
-	Author: Lubia Vinhas  
-*/
-
-#include "TeMySQL.h"
-
-int main()
-{
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to the DB320RC1 MySQL database
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
-
-	TeLayer* distritos = new TeLayer("Distritos");
-	if (!db->loadLayer(distritos))
-	{
-		cout << "Fail to load layer \"Distritos\": " << db->errorMessage() << endl << endl;
-		db->close();
-		delete db;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Check whether the table of points to be generated 
-	// already exists in the database
-	string pointsTableName = distritos->tableName(TePOINTS);
-	if (pointsTableName.empty() == false)
-	{
-		if (db->tableExist(pointsTableName))
-		{
-			cout << "The table of points \"" << pointsTableName << "\" already exists in the database!\n\n";  
-			db->close();
-			delete db;
-			cout << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-	}
-
-	TeRepresentation* repPol = distritos->getRepresentation(TePOLYGONS);
-	TePointSet centroids; 	//generate centroids
-	if (db->centroid(repPol->tableName_, TePOLYGONS, centroids) == false)
-	{
-		cout << "Fail to create centroids: " << db->errorMessage();  
-		db->close();
-		delete db;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	 //  Add new representation to the layer
-	distritos->addPoints(centroids);
-	cout << "Centroids created!\n\n";  
-
-	db->close();
-	delete db;
-	cout << "Press Enter\n";
-	getchar();
-	return 0;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows an example of how to create a point representation
+	(centroid of polygons) to a layer in a TerraLib database.
+
+	Author: Lubia Vinhas  
+*/
+
+#include "TeMySQL.h"
+
+int main()
+{
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+
+	TeLayer* distritos = new TeLayer("Distritos");
+	if (!db->loadLayer(distritos))
+	{
+		cout << "Fail to load layer \"Distritos\": " << db->errorMessage() << endl << endl;
+		db->close();
+		delete db;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Check whether the table of points to be generated 
+	// already exists in the database
+	string pointsTableName = distritos->tableName(TePOINTS);
+	if (pointsTableName.empty() == false)
+	{
+		if (db->tableExist(pointsTableName))
+		{
+			cout << "The table of points \"" << pointsTableName << "\" already exists in the database!\n\n";  
+			db->close();
+			delete db;
+			cout << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+	}
+
+	TeRepresentation* repPol = distritos->getRepresentation(TePOLYGONS);
+	TePointSet centroids; 	//generate centroids
+	if (db->centroid(repPol->tableName_, TePOLYGONS, centroids) == false)
+	{
+		cout << "Fail to create centroids: " << db->errorMessage();  
+		db->close();
+		delete db;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	 //  Add new representation to the layer
+	distritos->addPoints(centroids);
+	cout << "Centroids created!\n\n";  
+
+	db->close();
+	delete db;
+	cout << "Press Enter\n";
+	getchar();
+	return 0;
+}
diff --git a/examples/addGeomRepresentation/addGeomRepresentation.dsp b/examples/addGeomRepresentation/addGeomRepresentation.dsp
old mode 100755
new mode 100644
index 07b62ba..e3efde6
--- a/examples/addGeomRepresentation/addGeomRepresentation.dsp
+++ b/examples/addGeomRepresentation/addGeomRepresentation.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="addGeomRepresentation" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=addGeomRepresentation - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "addGeomRepresentation.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "addGeomRepresentation.mak" CFG="addGeomRepresentation - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "addGeomRepresentation - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "addGeomRepresentation - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "addGeomRepresentation - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src\terralib\drivers\PostgreSQL" /I "..\..\src\terralib\drivers\PostgreSQL\includepg" /I "..\..\src\terralib\drivers\PostgreSQ [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/addGeomRepresentation.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "addGeomRepresentation - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src\terralib\drive [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/addGeomRepresentation.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "addGeomRepresentation - Win32 Release"
-# Name "addGeomRepresentation - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\addGeomRepresentation.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="addGeomRepresentation" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=addGeomRepresentation - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "addGeomRepresentation.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "addGeomRepresentation.mak" CFG="addGeomRepresentation - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "addGeomRepresentation - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "addGeomRepresentation - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "addGeomRepresentation - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src\terralib\drivers\PostgreSQL" /I "..\..\src\terralib\drivers\PostgreSQL\includepg" /I "..\..\src\terralib\drivers\PostgreSQ [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/addGeomRepresentation.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "addGeomRepresentation - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src\terralib\drive [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/addGeomRepresentation.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "addGeomRepresentation - Win32 Release"
+# Name "addGeomRepresentation - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\addGeomRepresentation.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/addGeomRepresentation/addGeomRepresentation.dsw b/examples/addGeomRepresentation/addGeomRepresentation.dsw
old mode 100755
new mode 100644
index 8b0d711..7a65185
--- a/examples/addGeomRepresentation/addGeomRepresentation.dsw
+++ b/examples/addGeomRepresentation/addGeomRepresentation.dsw
@@ -1,44 +1,44 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "addGeomRepresentation"=.\addGeomRepresentation.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "addGeomRepresentation"=.\addGeomRepresentation.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/addGeomRepresentation/addGeomRepresentation.pro b/examples/addGeomRepresentation/addGeomRepresentation.pro
old mode 100755
new mode 100644
index 5e7b01c..a7a910c
--- a/examples/addGeomRepresentation/addGeomRepresentation.pro
+++ b/examples/addGeomRepresentation/addGeomRepresentation.pro
@@ -1,22 +1,19 @@
-include( ../base/base.pro )
-
-
-SOURCES	+= \
-	addGeomRepresentation.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
-
-
-
- 
-
-
-
-
-
-
-
-
+TARGET = addGeomRepresentation
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	addGeomRepresentation.cpp
+	
+
+
+
+ 
+
+
+
+
+
+
+
+
diff --git a/examples/addGeomRepresentation/addGeomRepresentation.sln b/examples/addGeomRepresentation/addGeomRepresentation.sln
old mode 100755
new mode 100644
diff --git a/examples/addGeomRepresentation/addGeomRepresentation.vcproj b/examples/addGeomRepresentation/addGeomRepresentation.vcproj
old mode 100755
new mode 100644
index d90f9ac..0cd6966
--- a/examples/addGeomRepresentation/addGeomRepresentation.vcproj
+++ b/examples/addGeomRepresentation/addGeomRepresentation.vcproj
@@ -1,164 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="addGeomRepresentation"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\addGeomRepresentation.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\addGeomRepresentation.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="addGeomRepresentation.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="addGeomRepresentation"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\addGeomRepresentation.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\addGeomRepresentation.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="addGeomRepresentation.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/base/base.pro b/examples/base/base.pro
index 186eb87..2a3131a 100644
--- a/examples/base/base.pro
+++ b/examples/base/base.pro
@@ -1,83 +1,56 @@
-TEMPLATE = app
-
-# Define your mysql client path
-MYSQL_CLIENT = /usr/local/mysql/lib
-
-# =====================================================================
-# From this point do not change this pro file
-# =====================================================================
-
-CONFIG = warn_on thread rtti exceptions 
-
-# Configure to debug or release
-#-------------------------------------------------
-isEmpty(TE_PROJECT_TYPE) {
-	TE_PROJECT_TYPE=RELEASE
-}
-
-contains(TE_PROJECT_TYPE , DEBUG) {
-    CONFIG -= release
-    CONFIG += debug
-}
-
-contains(TE_PROJECT_TYPE , RELEASE) {
-    CONFIG += release
-}
-#-------------------------------------------------
-
-
-INCLUDEPATH = \
-  . \
-  .. \
-  ../../src/terralib/kernel \
-  ../../src/terralib/functions \
-  ../../src/terralib/stat \
-  ../../src/terralib/utils \
-  ../../src/terralib/drivers/shapelib \
-  ../../src/terralib/drivers/MySQL \
-  ../../src/terralib/drivers/MySQL/include \
-  ../../src/terralib/drivers/shapelib \
-  ../../src/shapelib \
-  ../../src/zlib \
-  ../../src/tiff \
-  $$INCLUDEPATH
-
-unix {
-  OBJECTS_DIR = .obj
-
-  release {
-     LIBS += -L../../terralibx/Release
-  }
-  debug {
-     LIBS += -L../../terralibx/Debug
-  }
-
-  LIBS += \
-    -L/usr/local/lib \
-    -L/usr/lib \
-    -L$$MYSQL_CLIENT \
-    -ljpeg \
-    -lshapelib \
-    -lz \
-    -lterralibtiff \
-    -lcrypt \
-    -L/usr/lib/mysql -L/usr/local/lib/mysql -L/usr/local/mysql -lmysqlclient \
-    -lterralib \
-    -lstat
-}
-
-win32 {
-  CONFIG += console
-  DESTDIR = ../Debug
-  OBJECTS_DIR = ../Debug
-  LIBS += \
-    ../../terralibw/shapelib/Debug/shapelib.lib \
-    ../../terralibw/stat/Debug/stat.lib \
-    ../../terralibw/terralib/Debug/terralib.lib \
-    ../../terralibw/tiff/Debug/tiff.lib \
-    ../../terralibw/libjpeg/Debug/libjpeg.lib \
-    ../../terralibw/OracleSpatial/Oci/Oci.lib \
-    ../../terralibw/MySQL/libMySQL.lib \
-    ../../terralibw/PostgreSQL/libpq.lib 
-}
- 
+TERRALIBPATH = ../..
+
+include ($$TERRALIBPATH/build/qt/config.pri)
+
+TEMPLATE = app
+
+# Define your mysql client path
+unix:MYSQL_CLIENT = $$TERRALIBPATH/dependencies/linux/MySQL/lib
+win32 {
+	win32-g++:MYSQL_CLIENT=$$TERRALIBPATH/dependencies/win32/MySQL/lib/mingw
+	else:MYSQL_CLIENT=$$TERRALIBPATH/dependencies/win32/MySQL/lib/ms
+}
+
+INCLUDEPATH = \
+  . \
+  .. \
+  $$TERRALIBPATH/src/terralib/kernel \
+  $$TERRALIBPATH/src/terralib/functions \
+  $$TERRALIBPATH/src/terralib/stat \
+  $$TERRALIBPATH/src/terralib/utils \
+  $$TERRALIBPATH/src/terralib/drivers/shapelib \
+  $$TERRALIBPATH/src/terralib/drivers/MySQL \
+  $$TERRALIBPATH/src/terralib/drivers/MySQL/include \
+  $$TERRALIBPATH/src/terralib/drivers/shapelib \
+  $$TERRALIBPATH/src/shapelib \
+  $$TERRALIBPATH/src/zlib \
+  $$TERRALIBPATH/src/tiff \
+  $$INCLUDEPATH
+
+debug:CONFIGOUT = Debug
+release:CONFIGOUT = Release
+
+unix {
+  LIBS += \
+    -L/usr/local/lib \
+    -L/usr/lib \
+    -L$$MYSQL_CLIENT \
+    -ljpeg \
+    -lshapelib \
+    -lz \
+    -lterralibtiff \
+    -lcrypt \
+    -lterralib \
+    -lstat
+  DESTDIR = linux-g++
+}
+
+win32 {
+	win32-g++:DESTDIR = win32-g++
+}
+ 
+LIBS += -ljpeg -lshapelib -lterralibtiff -lterralib -lstat -lte_mysql
+unix:LIBS += -lz -lcrypt
+
+DESTDIR = $$TERRALIBPATH/$$CONFIGOUT/examples/$$DESTDIR/$$TARGET
+ 
\ No newline at end of file
diff --git a/examples/convertCoordinates/.cdtproject b/examples/convertCoordinates/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/convertCoordinates/.cdtproject
+++ b/examples/convertCoordinates/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/convertCoordinates/.project b/examples/convertCoordinates/.project
old mode 100755
new mode 100644
index f020624..2404df9
--- a/examples/convertCoordinates/.project
+++ b/examples/convertCoordinates/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>convertCoordinates</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>convertCoordinates</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/convertCoordinates/Makefile b/examples/convertCoordinates/Makefile
old mode 100755
new mode 100644
index e1ab44e..8e077b4
--- a/examples/convertCoordinates/Makefile
+++ b/examples/convertCoordinates/Makefile
@@ -1,31 +1,31 @@
-all: convertCoordinates
-
-debug: convertCoordinates_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-	
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-convertCoordinates: terralib
-	qmake -o makeConvertCoordinates convertCoordinates.pro; \
-	make -f makeConvertCoordinates
-
-convertCoordinates_dbg: terralib_dbg
-	qmake -o makeConvertCoordinates.debug convertCoordinates.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeConvertCoordinates.debug
-
-clean:
-	if \
-		test -f makeConvertCoordinates; \
-	then \
-		make -f makeConvertCoordinates distclean; rm -f makeConvertCoordinates; \
-	fi
-	
-	clean_debug:
-	if \
-		test -f makeConvertCoordinates.debug; \
-	then \
-		make -f makeConvertCoordinates.debug distclean; rm -f makeConvertCoordinates.debug; \
+all: convertCoordinates
+
+debug: convertCoordinates_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+	
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+convertCoordinates: terralib
+	qmake -o makeConvertCoordinates convertCoordinates.pro; \
+	make -f makeConvertCoordinates
+
+convertCoordinates_dbg: terralib_dbg
+	qmake -o makeConvertCoordinates.debug convertCoordinates.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeConvertCoordinates.debug
+
+clean:
+	if \
+		test -f makeConvertCoordinates; \
+	then \
+		make -f makeConvertCoordinates distclean; rm -f makeConvertCoordinates; \
+	fi
+	
+	clean_debug:
+	if \
+		test -f makeConvertCoordinates.debug; \
+	then \
+		make -f makeConvertCoordinates.debug distclean; rm -f makeConvertCoordinates.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/convertCoordinates/convertCoordinates.cpp b/examples/convertCoordinates/convertCoordinates.cpp
old mode 100755
new mode 100644
index 029ca91..18d46d0
--- a/examples/convertCoordinates/convertCoordinates.cpp
+++ b/examples/convertCoordinates/convertCoordinates.cpp
@@ -1,68 +1,68 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/* 
-        This file showns an example of how to convert coordinates from a projection to another.
-
-        Author: Lubia Vinhas  
-*/
-
-#include <TeProjection.h>
-#include <iostream>
-
-int main()
-{
-	TeDatum dSAD69 = TeDatumFactory::make("SAD69");		// SAD69 Spheroid
-
-	TeDatum dWGS84 = TeDatumFactory::make("WGS84");		// WGS84 Spheroid
-
-	TeUtm* pUTM = new TeUtm(dSAD69,-45.0*TeCDR);		// Origin latitude of -45.0
-														// TeCDR means "Convert to Degrees from Radians"
-
-	TePolyconic* pPolyconic = new TePolyconic(dWGS84,-45.0*TeCDR);	// Origin latitude of -45.0
-																																			// TeCDR means "Converte Degrees from Radians"
-	TeCoord2D pt1(340033.47, 7391306.21);		// Original coordinate in UTM
-
-	// Conversion from the UTM to the Polyconic projection
-	pUTM->setDestinationProjection(pPolyconic);
-
-	TeCoord2D ll = pUTM->PC2LL(pt1);			// Convert to Lat Long
-	TeCoord2D pt2 = pPolyconic->LL2PC(ll);		// Convert to output projection
-
-	printf("UTM -> Polyconic \n");
-	printf("(%.4f, %.4f) -> ",pt1.x(), pt1.y());
-	printf("(%.4f, %.4f) \n",pt2.x(), pt2.y());
-
-	// Conversion from the Polyconic to the UTM projection
-	pPolyconic->setDestinationProjection(pUTM);
-	ll = pPolyconic->PC2LL(pt2);
-	pt1 = pUTM->LL2PC(ll);
-
-	printf("\nPolyconic -> UTM \n");
-	printf("(%.4f, %.4f) -> ",pt2.x(), pt2.y());
-	printf("(%.4f, %.4f) \n",pt1.x(), pt1.y());
-
-	cout << "\nPress Enter\n" ;
-	cout.flush();
-	getchar();
-	return 0;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+        This file showns an example of how to convert coordinates from a projection to another.
+
+        Author: Lubia Vinhas  
+*/
+
+#include <TeProjection.h>
+#include <iostream>
+
+int main()
+{
+	TeDatum dSAD69 = TeDatumFactory::make("SAD69");		// SAD69 Spheroid
+
+	TeDatum dWGS84 = TeDatumFactory::make("WGS84");		// WGS84 Spheroid
+
+	TeUtm* pUTM = new TeUtm(dSAD69,-45.0*TeCDR);		// Origin latitude of -45.0
+														// TeCDR means "Convert to Degrees from Radians"
+
+	TePolyconic* pPolyconic = new TePolyconic(dWGS84,-45.0*TeCDR);	// Origin latitude of -45.0
+																																			// TeCDR means "Converte Degrees from Radians"
+	TeCoord2D pt1(340033.47, 7391306.21);		// Original coordinate in UTM
+
+	// Conversion from the UTM to the Polyconic projection
+	pUTM->setDestinationProjection(pPolyconic);
+
+	TeCoord2D ll = pUTM->PC2LL(pt1);			// Convert to Lat Long
+	TeCoord2D pt2 = pPolyconic->LL2PC(ll);		// Convert to output projection
+
+	printf("UTM -> Polyconic \n");
+	printf("(%.4f, %.4f) -> ",pt1.x(), pt1.y());
+	printf("(%.4f, %.4f) \n",pt2.x(), pt2.y());
+
+	// Conversion from the Polyconic to the UTM projection
+	pPolyconic->setDestinationProjection(pUTM);
+	ll = pPolyconic->PC2LL(pt2);
+	pt1 = pUTM->LL2PC(ll);
+
+	printf("\nPolyconic -> UTM \n");
+	printf("(%.4f, %.4f) -> ",pt2.x(), pt2.y());
+	printf("(%.4f, %.4f) \n",pt1.x(), pt1.y());
+
+	cout << "\nPress Enter\n" ;
+	cout.flush();
+	getchar();
+	return 0;
+}
diff --git a/examples/convertCoordinates/convertCoordinates.dsp b/examples/convertCoordinates/convertCoordinates.dsp
old mode 100755
new mode 100644
index e5cff49..1cafc35
--- a/examples/convertCoordinates/convertCoordinates.dsp
+++ b/examples/convertCoordinates/convertCoordinates.dsp
@@ -1,106 +1,106 @@
-# Microsoft Developer Studio Project File - Name="convertCoordinates" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=convertCoordinates - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "convertCoordinates.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "convertCoordinates.mak" CFG="convertCoordinates - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "convertCoordinates - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "convertCoordinates - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "convertCoordinates - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include"  /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" / [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\tiff\Release\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /ma [...]
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "convertCoordinates - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\in [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\tiff\Debug\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /m [...]
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "convertCoordinates - Win32 Release"
-# Name "convertCoordinates - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\convertCoordinates.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="convertCoordinates" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=convertCoordinates - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "convertCoordinates.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "convertCoordinates.mak" CFG="convertCoordinates - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "convertCoordinates - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "convertCoordinates - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "convertCoordinates - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include"  /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" / [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\tiff\Release\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /ma [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "convertCoordinates - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\in [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\tiff\Debug\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /m [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "convertCoordinates - Win32 Release"
+# Name "convertCoordinates - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\convertCoordinates.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/convertCoordinates/convertCoordinates.dsw b/examples/convertCoordinates/convertCoordinates.dsw
old mode 100755
new mode 100644
index 28c69e9..3c0c5ba
--- a/examples/convertCoordinates/convertCoordinates.dsw
+++ b/examples/convertCoordinates/convertCoordinates.dsw
@@ -1,44 +1,44 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "convertCoordinates"=.\convertCoordinates.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "convertCoordinates"=.\convertCoordinates.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/convertCoordinates/convertCoordinates.pro b/examples/convertCoordinates/convertCoordinates.pro
old mode 100755
new mode 100644
index 45e2e5f..3ee72ab
--- a/examples/convertCoordinates/convertCoordinates.pro
+++ b/examples/convertCoordinates/convertCoordinates.pro
@@ -1,5 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	convertCoordinates.cpp 
-
+TARGET = convertCoordinates
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	convertCoordinates.cpp 
+
diff --git a/examples/convertCoordinates/convertCoordinates.sln b/examples/convertCoordinates/convertCoordinates.sln
old mode 100755
new mode 100644
diff --git a/examples/convertCoordinates/convertCoordinates.vcproj b/examples/convertCoordinates/convertCoordinates.vcproj
old mode 100755
new mode 100644
index 14583a6..f435182
--- a/examples/convertCoordinates/convertCoordinates.vcproj
+++ b/examples/convertCoordinates/convertCoordinates.vcproj
@@ -1,154 +1,154 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="convertCoordinates"
-	ProjectGUID="{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\convertCoordinates.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\convertCoordinates.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="convertCoordinates.cpp">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="convertCoordinates"
+	ProjectGUID="{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="."
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\convertCoordinates.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\convertCoordinates.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="convertCoordinates.cpp">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/copyLayer/.cdtproject b/examples/copyLayer/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/copyLayer/.cdtproject
+++ b/examples/copyLayer/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/copyLayer/.project b/examples/copyLayer/.project
old mode 100755
new mode 100644
index 3dc526b..bd8dae0
--- a/examples/copyLayer/.project
+++ b/examples/copyLayer/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>copyLayer</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>copyLayer</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/copyLayer/Makefile b/examples/copyLayer/Makefile
old mode 100755
new mode 100644
index 4f30efc..ad0561b
--- a/examples/copyLayer/Makefile
+++ b/examples/copyLayer/Makefile
@@ -1,30 +1,30 @@
-all: copyLayer
-
-debug: copyLayer_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-	
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-copyLayer: terralib
-	qmake -o makeCopyLayer copyLayer.pro; make -f makeCopyLayer
-
-copyLayer_dbg: terralib_dbg
-	qmake -o makeCopyLayer.debug copyLayer.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeCopyLayer.debug;	
-
-clean:
-	if \
-		test -f makeCopyLayer; \
-	then \
-		make -f makeCopyLayer distclean; rm -f makeCopyLayer; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeCopyLayer.debug; \
-	then \
-		make -f makeCopyLayer.debug distclean; rm -f makeCopyLayer.debug; \
+all: copyLayer
+
+debug: copyLayer_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+	
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+copyLayer: terralib
+	qmake -o makeCopyLayer copyLayer.pro; make -f makeCopyLayer
+
+copyLayer_dbg: terralib_dbg
+	qmake -o makeCopyLayer.debug copyLayer.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeCopyLayer.debug;	
+
+clean:
+	if \
+		test -f makeCopyLayer; \
+	then \
+		make -f makeCopyLayer distclean; rm -f makeCopyLayer; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeCopyLayer.debug; \
+	then \
+		make -f makeCopyLayer.debug distclean; rm -f makeCopyLayer.debug; \
 	fi	
\ No newline at end of file
diff --git a/examples/copyLayer/copyLayer.cpp b/examples/copyLayer/copyLayer.cpp
old mode 100755
new mode 100644
index b31c630..1f4c13d
--- a/examples/copyLayer/copyLayer.cpp
+++ b/examples/copyLayer/copyLayer.cpp
@@ -1,88 +1,88 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/* 
-	This file shows an example of how to duplicate a layer changing its projection.
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeMySQL.h>
-#include <TeLayerFunctions.h>
-
-int main()
-{
-	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to a MySQL database 
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	cout << "Database \"" << dbname << "\" connected on MySQL \"localhost\" server!" << endl << endl;
-
-	// Load the layer Distritos by its name 
-	TeLayer* layer1 = new TeLayer("Distritos");
-	if (!db->loadLayer(layer1))                
-	{                                                                                               
-		cout << "The layer \"Distritos\" could not be loaded from the database!\n\n";
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Layer \"" << layer1->name() << "\" retrieved!" << endl;
-
-	// Show the layer projection
-	TeProjection* proj1 = layer1->projection();
-	cout << "Projection/Datum of the layer \"Distritos\": " << proj1->name();
-	cout << "/" << proj1->datum().name() << endl <<endl; 
-
-	// Create a different projection
-	TeDatum sad69 = TeDatumFactory::make("SAD69");
-	TeProjection* proj2 = new TeLatLong(sad69);
-
-	// Create a layer with a different projection
-	TeLayer* layer2 = new TeLayer("Distritos_LL", db, proj2);
-
-	// Copy the layer doing a remapping of its geometries
-	bool res = TeCopyLayerToLayer(layer1, layer2);
-
-	if (res)
-		cout << "Layer \"Distritos\" was successfully copied to layer \"Distritos_LL\"\n\n";
-	else
-		cout << "Fail to remap layer!\n\n";
-
-	db->close();
-	cout << "Press Enter\n";
-	getchar();
-	return 0;
-} 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+	This file shows an example of how to duplicate a layer changing its projection.
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeMySQL.h>
+#include <TeLayerFunctions.h>
+
+int main()
+{
+	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to a MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	cout << "Database \"" << dbname << "\" connected on MySQL \"localhost\" server!" << endl << endl;
+
+	// Load the layer Distritos by its name 
+	TeLayer* layer1 = new TeLayer("Distritos");
+	if (!db->loadLayer(layer1))                
+	{                                                                                               
+		cout << "The layer \"Distritos\" could not be loaded from the database!\n\n";
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Layer \"" << layer1->name() << "\" retrieved!" << endl;
+
+	// Show the layer projection
+	TeProjection* proj1 = layer1->projection();
+	cout << "Projection/Datum of the layer \"Distritos\": " << proj1->name();
+	cout << "/" << proj1->datum().name() << endl <<endl; 
+
+	// Create a different projection
+	TeDatum sad69 = TeDatumFactory::make("SAD69");
+	TeProjection* proj2 = new TeLatLong(sad69);
+
+	// Create a layer with a different projection
+	TeLayer* layer2 = new TeLayer("Distritos_LL", db, proj2);
+
+	// Copy the layer doing a remapping of its geometries
+	bool res = TeCopyLayerToLayer(layer1, layer2);
+
+	if (res)
+		cout << "Layer \"Distritos\" was successfully copied to layer \"Distritos_LL\"\n\n";
+	else
+		cout << "Fail to remap layer!\n\n";
+
+	db->close();
+	cout << "Press Enter\n";
+	getchar();
+	return 0;
+} 
diff --git a/examples/copyLayer/copyLayer.dsp b/examples/copyLayer/copyLayer.dsp
old mode 100755
new mode 100644
index 9bd9399..18cac30
--- a/examples/copyLayer/copyLayer.dsp
+++ b/examples/copyLayer/copyLayer.dsp
@@ -1,122 +1,122 @@
-# Microsoft Developer Studio Project File - Name="copyLayer" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=copyLayer - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "copyLayer.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "copyLayer.mak" CFG="copyLayer - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "copyLayer - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "copyLayer - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "copyLayer - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/copyLayer.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "copyLayer - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include"  /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\i [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/copyLayer.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "copyLayer - Win32 Release"
-# Name "copyLayer - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\copyLayer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeLayerFunctions.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeLayerFunctions.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="copyLayer" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=copyLayer - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "copyLayer.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "copyLayer.mak" CFG="copyLayer - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "copyLayer - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "copyLayer - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "copyLayer - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/copyLayer.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "copyLayer - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include"  /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\i [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/copyLayer.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "copyLayer - Win32 Release"
+# Name "copyLayer - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\copyLayer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeLayerFunctions.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeLayerFunctions.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/copyLayer/copyLayer.dsw b/examples/copyLayer/copyLayer.dsw
old mode 100755
new mode 100644
index 3cd0221..1747d68
--- a/examples/copyLayer/copyLayer.dsw
+++ b/examples/copyLayer/copyLayer.dsw
@@ -1,44 +1,44 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "copyLayer"=.\copyLayer.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "copyLayer"=.\copyLayer.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/copyLayer/copyLayer.pro b/examples/copyLayer/copyLayer.pro
old mode 100755
new mode 100644
index 193353d..2264450
--- a/examples/copyLayer/copyLayer.pro
+++ b/examples/copyLayer/copyLayer.pro
@@ -1,11 +1,9 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  copyLayer.cpp \
-  ../../src/terralib/functions/TeLayerFunctions.cpp \
-  ../../src/terralib/drivers/MySQL/TeMySQL.cpp \
-  ../../src/terralib/utils/TeDatabaseUtils.cpp
-
-HEADERS += \
-  ../../src/terralib/functions/TeLayerFunctions.h \
-  ../../src/terralib/drivers/MySQL/TeMySQL.h
+TARGET = copyLayer
+
+include( ../base/base.pro )
+
+LIBS += -lte_utils -lte_functions
+
+SOURCES += \
+  copyLayer.cpp 
+
diff --git a/examples/copyLayer/copyLayer.sln b/examples/copyLayer/copyLayer.sln
old mode 100755
new mode 100644
diff --git a/examples/copyLayer/copyLayer.vcproj b/examples/copyLayer/copyLayer.vcproj
old mode 100755
new mode 100644
index 8242f63..a37c8f3
--- a/examples/copyLayer/copyLayer.vcproj
+++ b/examples/copyLayer/copyLayer.vcproj
@@ -1,229 +1,177 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="copyLayer"
-	ProjectGUID="{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}"
-	SccProjectName=""
-	SccLocalPath="">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\\src\terralib\utils;.;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				PrecompiledHeaderFile=".\Release/copyLayer.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="../Release/copyLayer.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				ProgramDatabaseFile=".\Release/copyLayer.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Release/copyLayer.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\utils;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				PrecompiledHeaderFile=".\Debug/copyLayer.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="../Debug/copyLayer.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=".\Debug/copyLayer.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Debug/copyLayer.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="copyLayer.cpp">
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\utils\TeDatabaseUtils.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\functions\TeLayerFunctions.cpp">
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\utils\TeDatabaseUtils.h">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\functions\TeLayerFunctions.h">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="copyLayer"
+	ProjectGUID="{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\\src\terralib\utils;.;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/copyLayer.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../Release/te_functions/te_functions.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="../Release/copyLayer.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/copyLayer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/copyLayer.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\utils;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/copyLayer.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../Debug/te_functions/te_functions.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="../Debug/copyLayer.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/copyLayer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/copyLayer.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="copyLayer.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/createCoverage/createCoverage.cpp b/examples/createCoverage/createCoverage.cpp
index 8d5ce19..822195a 100644
--- a/examples/createCoverage/createCoverage.cpp
+++ b/examples/createCoverage/createCoverage.cpp
@@ -1,314 +1,314 @@
-#include "TeDatabase.h"
-#include "TeAdoDB.h"
-#include "TeBlockLoader.h"
-#include "TeCoverage.h"
-#include "TeCoverageDecoder.h"
-#include "TeCoverageImport.h"
-
-void printGeom(TePoint& point)
-{
-    std::cout << "(" << point.location().x() << "," << point.location().y() << ")";
-}
-
-void printGeom(TeLine2D& line)
-{
-    std::cout << "(line id = " << line.geomId() << ")";
-}
-
-void printGeom(TePolygon& poly)
-{
-    std::cout << "(polygon id = " << poly.geomId() << ")";
-}
-
-template <class T>
-void testCoverage(std::string& databaseFile, std::string& coverageLayerName, std::string& coverageId, std::string& srcLayerName, std::vector<std::string>& columns)
-{
-    std::cout << "Entered testCoverage." << std::endl;
-
-    // Connect to the database
-	TeDatabase* myDB = new TeAdo();
-	bool connected = myDB->connect("", "", "", databaseFile, 0);
-    myDB->loadLayerSet(true);
-
-    // Setup coverage layer
-    TeLayer* layer = NULL;
-    try
-    {
-        // Check if coverage layer exists
-        if (myDB->layerExist(coverageLayerName))
-        {
-            std::cout << "> Layer '" << coverageLayerName << "' found on database." << std::endl;
-
-            std::vector<std::string> coverageIds;
-            layer = new TeLayer(coverageLayerName, myDB);
-            TeRetrieveCoverageIds(layer, coverageIds);
-
-            // Check if coverage is in the coverage layer
-            if (find(coverageIds.begin(), coverageIds.end(), coverageId) != coverageIds.end())
-            {
-                std::cout << "> Coverage '" << coverageId << "' found on layer '" << layer->name() << "'." << std::endl;
-            }
-            else
-            {
-                std::string errorMsg = "Coverage '" + coverageId + "' not found on layer '" + layer->name() + "'.";
-                throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-            }
-        }
-        else
-        {
-            std::cout << "> Layer '" << coverageLayerName << "' not found on database." << std::endl;
-
-            // Check if source layer exists
-            if (myDB->layerExist(srcLayerName))
-            {
-                std::cout << "> Source layer '" << srcLayerName << "' found on database." << std::endl;
-
-                // Import from source layer
-                TeLayer* srcLayer = new TeLayer(srcLayerName, myDB);
-                layer = TeCoverageImportLayer<T>(myDB, coverageLayerName, srcLayer, columns, coverageId);
-                
-                if (layer)
-                {
-                    std::cout << "> Imported coverage data from source layer '" << srcLayerName << "'." << std::endl;
-                }
-                else
-                {
-                    std::string errorMsg = "Couldn't import coverage data from source layer '" + srcLayerName + "'.";
-                    throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-                }
-            }
-            else
-            {
-                std::string errorMsg = "Source layer '" + srcLayerName + "' not found on database.";
-                throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-            }
-        }
-    }
-    catch(TeException e)
-    {
-        std::cout << "Error: " << e.message() << std::endl;
-        return;
-    }
-
-    // Setup coverage parameters
-    TeCoverageParams coverageParams = TeCoverageParams(myDB, layer->id(), coverageId);
-    coverageParams.setPersistenceType(TePERSISTENCE_DATABASE_CACHELRU);
-
-    // Create and initialize coverage
-    TeCoverage<T> coverage = TeCoverage<T>(coverageParams);
-    coverage.init();
-    std::cout << "> Coverage '" << coverageParams.getCoverageId() << "' created and initialized." << std::endl;
-    std::cout << "Coverage bounding box: (" << coverage.box().x1() << ", " << coverage.box().y1() << ", " << coverage.box().x2() << ", " << coverage.box().y2() << ") " << std::endl;
-    std::vector<TeCoverageDimension> dimensions = coverage.getParameters().getDimensions();
-    std::cout << "Coverage dimensions: ";
-    for (std::vector<TeCoverageDimension>::iterator it = dimensions.begin(); it != dimensions.end(); ++it)
-    {
-        std::cout << "{" << it->dimension_id << ": " << it->name << "}, ";
-    }
-    std::cout << std::endl;
-
-    unsigned int numDimensions = dimensions.size();
-
-    // ============================= TEST 1 ===================================
-
-    std::cout << "-------------------------------------------" << std::endl;
-    std::cout << "> (Test 1: Spatial selection)" << std::endl;
-
-    // Ask the user for a selection box
-    std::cout << "Enter box coordinates for the spatial query" << std::endl;
-
-    double x1, y1, x2, y2;
-    std::cout << "lower x: ";
-    std::cin >> x1;
-    std::cout << "lower y: ";
-    std::cin >> y1;
-    std::cout << "upper x: ";
-    std::cin >> x2;
-    std::cout << "upper y: ";
-    std::cin >> y2;
-    TeBox box(x1, y1, x2, y2);
-    TePolygon poly = TeMakePolygon(box);
-
-    TeCoverage<T>::iterator itSamples = coverage.begin(poly);
-    TeCoverage<T>::iterator endSamples = coverage.end(poly);
-
-    std::cout << "> Result of spatial query:" << std::endl;
-
-    // Iterate and print geometries and values
-    while (itSamples != endSamples) {
-
-        printGeom(*itSamples);
-
-        std::cout << ": {";
-        for (unsigned int i = 0; i < numDimensions; ++i)
-        {
-            std::cout << itSamples[i] << ", ";
-        }
-        std::cout << "}" << std::endl;
-        itSamples++;
-    }
-
-    // ============================= TEST 2 ===================================
-
-    std::cout << "-------------------------------------------" << std::endl;
-    std::cout << "> (Test 2: Interpolated value)" << std::endl;
-
-    // Ask the user for an arbitrary position
-    std::cout << "Enter arbitrary coordinate for interpolating" << std::endl;
-    double x, y;
-    std::cout << "x: ";
-    std::cin >> x;
-    std::cout << "y: ";
-    std::cin >> y;
-
-    // Get interpolated value
-    TeCoord2D location = TeCoord2D(x, y);
-    std::vector<double> values;
-    coverage.evaluate(location, values);
-    std::cout << "> Result of interpolation:" << std::endl;
-    std::cout << "(" << x << ", " << y << ")";
-    std::cout << ": {";
-    for (unsigned int i = 0; i < numDimensions; ++i)
-    {
-        std::cout << values[i] << ", ";
-    }
-    std::cout << "}" << std::endl;
-
-    // ============================= TEST 3 ===================================
-    
-    // Create raster and fill with interpolated coverage data
-    std::cout << "-------------------------------------------" << std::endl;
-    std::cout << "> (Test 3: Fill Raster with interpolated data)" << std::endl;
-
-    std::cout << "Enter parameters for filling raster" << std::endl;
-    int nRows, nCols, srcDimension;
-    std::cout << "Number of rows: ";
-    std::cin >> nRows;
-    std::cout << "Number of columns: ";
-    std::cin >> nCols;
-    std::cout << "ID of coverage dimension to be read: ";
-    std::cin >> srcDimension;
-
-    // Create raster projection and get coverage projection
-    TeProjection* rasterProj = new TeLatLong(TeDatumFactory::make("SAD69"));
-    TeProjection* coverageProj = coverage.getParameters().getProjection();
-    coverageProj->setDestinationProjection(rasterProj);
-
-    // Get coverage box coordinates
-    TeCoord2D lowerLeft = TeCoord2D(coverage.box().x1(), coverage.box().y1());
-    TeCoord2D upperRight = TeCoord2D(coverage.box().x2(), coverage.box().y2());
-
-    // Convert to intermediate projection
-    lowerLeft = coverageProj->PC2LL(lowerLeft);
-    upperRight = coverageProj->PC2LL(upperRight);
-
-    // Convert to raster projection
-    lowerLeft = rasterProj->LL2PC(lowerLeft);
-    upperRight = rasterProj->LL2PC(upperRight);
-
-    TeBox rasterBox = TeBox(lowerLeft, upperRight); // Raster bounding box
-
-    // Set raster params and create raster in memory
-    TeRasterParams rasterParams;
-    rasterParams.nBands(1);
-    rasterParams.projection(rasterProj);
-    rasterParams.setDataType(TeDOUBLE);
-    rasterParams.decoderIdentifier_ = "MEM";
-    rasterParams.mode_ = 'c';
-    rasterParams.boundingBoxLinesColumns(rasterBox.x1(),
-                                         rasterBox.y1(),
-                                         rasterBox.x2(),
-                                         rasterBox.y2(),
-                                         nRows, nCols);
-    TeRaster* rasterMem = new TeRaster(rasterParams);
-    rasterMem->init();
-    if (!rasterMem->status())
-    {
-        cout << "Falha ao criar raster em memoria." << endl;
-    }
-
-    // Fill coverage with interpolated values from the coverage, counting time
-    time_t when;
-    int beginTime = time(&when);
-    coverage.evaluate(*rasterMem, 0, srcDimension);
-    int endTime = time(&when);
-
-    // Show contents of the raster
-    for (TeRaster::iterator it = rasterMem->begin(); it != rasterMem->end(); it++)
-    {
-        TeCoord2D pixelCoord = rasterMem->index2Coord(TeCoord2D(it.currentColumn(), it.currentLine()));
-        double val = 0;
-        rasterMem->getElement(it.currentColumn(), it.currentLine(), val);
-        std::cout << "coord(" << it.currentColumn() << "," << it.currentLine() << ") = (" << pixelCoord.x() << "," << pixelCoord.y() << "): value = [" << val << "]" << std::endl;
-    }
-
-    // Show time spent in raster interpolation
-    std::cout << "Completed interpolation of " << nRows << "x" << nCols << " raster in " << (endTime - beginTime) << "s." << std::endl;
-
-	// Close database connection
-	myDB->close();
-}
-
-void main(int argc, char* argv[])
-{
-    std::cout << "This application will test some coverage functions.\n"
-            << "What support representation do you want for the coverage?\n"
-            << "(1=Point, 2=Line, 3=Polygon): ";
-
-    int coverageType = -1;
-    std::cin >> coverageType;
-
-    std::string databaseFile, coverageLayerName, coverageId, srcLayerName;
-    std::vector<std::string> columns;
-
-    switch (coverageType)
-    {
-    case 1:
-        // Database location
-        databaseFile = ".\\cidades.mdb";
-
-        // Information about coverage to be created/accessed
-        coverageLayerName = "CidadesCoverageLayer";
-        coverageId = "CidadesCoverage";
-
-        // Information about source for importing
-        srcLayerName = "CIDADES_point";
-        columns.push_back("MD_LONGITU");
-        columns.push_back("MD_LATITUD");
-
-        testCoverage<TePoint>(databaseFile, coverageLayerName, coverageId, srcLayerName, columns);
-        break;
-
-    case 2:
-        // Database location
-        databaseFile = ".\\sergipe.mdb";
-
-        // Information about coverage to be created/accessed
-        coverageLayerName = "AltimetriaCoverageLayer";
-        coverageId = "AltimetriaCoverage";
-
-        // Information about source for importing
-        srcLayerName = "Altimetria_lin";
-        columns.push_back("COTA");
-        columns.push_back("LENGTH");
-
-        testCoverage<TeLine2D>(databaseFile, coverageLayerName, coverageId, srcLayerName, columns);
-        break;
-
-    case 3:
-        // Database location
-        databaseFile = ".\\sergipe.mdb";
-
-        // Information about coverage to be created/accessed
-        coverageLayerName = "UsoDoSoloCoverageLayer";
-        coverageId = "UsoDoSoloCoverage";
-
-        // Information about source for importing
-        srcLayerName = "UsodoSolo_pol";
-        columns.push_back("AREA");
-        columns.push_back("PERIMETER");
-
-        testCoverage<TePolygon>(databaseFile, coverageLayerName, coverageId, srcLayerName, columns);
-        break;
-    }
-}
+#include "TeDatabase.h"
+#include "TeAdoDB.h"
+#include "TeBlockLoader.h"
+#include "TeCoverage.h"
+#include "TeCoverageDecoder.h"
+#include "TeCoverageImport.h"
+
+void printGeom(TePoint& point)
+{
+    std::cout << "(" << point.location().x() << "," << point.location().y() << ")";
+}
+
+void printGeom(TeLine2D& line)
+{
+    std::cout << "(line id = " << line.geomId() << ")";
+}
+
+void printGeom(TePolygon& poly)
+{
+    std::cout << "(polygon id = " << poly.geomId() << ")";
+}
+
+template <class T>
+void testCoverage(std::string& databaseFile, std::string& coverageLayerName, std::string& coverageId, std::string& srcLayerName, std::vector<std::string>& columns)
+{
+    std::cout << "Entered testCoverage." << std::endl;
+
+    // Connect to the database
+	TeDatabase* myDB = new TeAdo();
+	bool connected = myDB->connect("", "", "", databaseFile, 0);
+    myDB->loadLayerSet(true);
+
+    // Setup coverage layer
+    TeLayer* layer = NULL;
+    try
+    {
+        // Check if coverage layer exists
+        if (myDB->layerExist(coverageLayerName))
+        {
+            std::cout << "> Layer '" << coverageLayerName << "' found on database." << std::endl;
+
+            std::vector<std::string> coverageIds;
+            layer = new TeLayer(coverageLayerName, myDB);
+            TeRetrieveCoverageIds(layer, coverageIds);
+
+            // Check if coverage is in the coverage layer
+            if (find(coverageIds.begin(), coverageIds.end(), coverageId) != coverageIds.end())
+            {
+                std::cout << "> Coverage '" << coverageId << "' found on layer '" << layer->name() << "'." << std::endl;
+            }
+            else
+            {
+                std::string errorMsg = "Coverage '" + coverageId + "' not found on layer '" + layer->name() + "'.";
+                throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+            }
+        }
+        else
+        {
+            std::cout << "> Layer '" << coverageLayerName << "' not found on database." << std::endl;
+
+            // Check if source layer exists
+            if (myDB->layerExist(srcLayerName))
+            {
+                std::cout << "> Source layer '" << srcLayerName << "' found on database." << std::endl;
+
+                // Import from source layer
+                TeLayer* srcLayer = new TeLayer(srcLayerName, myDB);
+                layer = TeCoverageImportLayer<T>(myDB, coverageLayerName, srcLayer, columns, coverageId);
+                
+                if (layer)
+                {
+                    std::cout << "> Imported coverage data from source layer '" << srcLayerName << "'." << std::endl;
+                }
+                else
+                {
+                    std::string errorMsg = "Couldn't import coverage data from source layer '" + srcLayerName + "'.";
+                    throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+                }
+            }
+            else
+            {
+                std::string errorMsg = "Source layer '" + srcLayerName + "' not found on database.";
+                throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+            }
+        }
+    }
+    catch(TeException e)
+    {
+        std::cout << "Error: " << e.message() << std::endl;
+        return;
+    }
+
+    // Setup coverage parameters
+    TeCoverageParams coverageParams = TeCoverageParams(myDB, layer->id(), coverageId);
+    coverageParams.setPersistenceType(TePERSISTENCE_DATABASE_CACHELRU);
+
+    // Create and initialize coverage
+    TeCoverage<T> coverage = TeCoverage<T>(coverageParams);
+    coverage.init();
+    std::cout << "> Coverage '" << coverageParams.getCoverageId() << "' created and initialized." << std::endl;
+    std::cout << "Coverage bounding box: (" << coverage.box().x1() << ", " << coverage.box().y1() << ", " << coverage.box().x2() << ", " << coverage.box().y2() << ") " << std::endl;
+    std::vector<TeCoverageDimension> dimensions = coverage.getParameters().getDimensions();
+    std::cout << "Coverage dimensions: ";
+    for (std::vector<TeCoverageDimension>::iterator it = dimensions.begin(); it != dimensions.end(); ++it)
+    {
+        std::cout << "{" << it->dimension_id << ": " << it->name << "}, ";
+    }
+    std::cout << std::endl;
+
+    unsigned int numDimensions = dimensions.size();
+
+    // ============================= TEST 1 ===================================
+
+    std::cout << "-------------------------------------------" << std::endl;
+    std::cout << "> (Test 1: Spatial selection)" << std::endl;
+
+    // Ask the user for a selection box
+    std::cout << "Enter box coordinates for the spatial query" << std::endl;
+
+    double x1, y1, x2, y2;
+    std::cout << "lower x: ";
+    std::cin >> x1;
+    std::cout << "lower y: ";
+    std::cin >> y1;
+    std::cout << "upper x: ";
+    std::cin >> x2;
+    std::cout << "upper y: ";
+    std::cin >> y2;
+    TeBox box(x1, y1, x2, y2);
+    TePolygon poly = TeMakePolygon(box);
+
+    TeCoverage<T>::iterator itSamples = coverage.begin(poly);
+    TeCoverage<T>::iterator endSamples = coverage.end(poly);
+
+    std::cout << "> Result of spatial query:" << std::endl;
+
+    // Iterate and print geometries and values
+    while (itSamples != endSamples) {
+
+        printGeom(*itSamples);
+
+        std::cout << ": {";
+        for (unsigned int i = 0; i < numDimensions; ++i)
+        {
+            std::cout << itSamples[i] << ", ";
+        }
+        std::cout << "}" << std::endl;
+        itSamples++;
+    }
+
+    // ============================= TEST 2 ===================================
+
+    std::cout << "-------------------------------------------" << std::endl;
+    std::cout << "> (Test 2: Interpolated value)" << std::endl;
+
+    // Ask the user for an arbitrary position
+    std::cout << "Enter arbitrary coordinate for interpolating" << std::endl;
+    double x, y;
+    std::cout << "x: ";
+    std::cin >> x;
+    std::cout << "y: ";
+    std::cin >> y;
+
+    // Get interpolated value
+    TeCoord2D location = TeCoord2D(x, y);
+    std::vector<double> values;
+    coverage.evaluate(location, values);
+    std::cout << "> Result of interpolation:" << std::endl;
+    std::cout << "(" << x << ", " << y << ")";
+    std::cout << ": {";
+    for (unsigned int i = 0; i < numDimensions; ++i)
+    {
+        std::cout << values[i] << ", ";
+    }
+    std::cout << "}" << std::endl;
+
+    // ============================= TEST 3 ===================================
+    
+    // Create raster and fill with interpolated coverage data
+    std::cout << "-------------------------------------------" << std::endl;
+    std::cout << "> (Test 3: Fill Raster with interpolated data)" << std::endl;
+
+    std::cout << "Enter parameters for filling raster" << std::endl;
+    int nRows, nCols, srcDimension;
+    std::cout << "Number of rows: ";
+    std::cin >> nRows;
+    std::cout << "Number of columns: ";
+    std::cin >> nCols;
+    std::cout << "ID of coverage dimension to be read: ";
+    std::cin >> srcDimension;
+
+    // Create raster projection and get coverage projection
+    TeProjection* rasterProj = new TeLatLong(TeDatumFactory::make("SAD69"));
+    TeProjection* coverageProj = coverage.getParameters().getProjection();
+    coverageProj->setDestinationProjection(rasterProj);
+
+    // Get coverage box coordinates
+    TeCoord2D lowerLeft = TeCoord2D(coverage.box().x1(), coverage.box().y1());
+    TeCoord2D upperRight = TeCoord2D(coverage.box().x2(), coverage.box().y2());
+
+    // Convert to intermediate projection
+    lowerLeft = coverageProj->PC2LL(lowerLeft);
+    upperRight = coverageProj->PC2LL(upperRight);
+
+    // Convert to raster projection
+    lowerLeft = rasterProj->LL2PC(lowerLeft);
+    upperRight = rasterProj->LL2PC(upperRight);
+
+    TeBox rasterBox = TeBox(lowerLeft, upperRight); // Raster bounding box
+
+    // Set raster params and create raster in memory
+    TeRasterParams rasterParams;
+    rasterParams.nBands(1);
+    rasterParams.projection(rasterProj);
+    rasterParams.setDataType(TeDOUBLE);
+    rasterParams.decoderIdentifier_ = "MEM";
+    rasterParams.mode_ = 'c';
+    rasterParams.boundingBoxLinesColumns(rasterBox.x1(),
+                                         rasterBox.y1(),
+                                         rasterBox.x2(),
+                                         rasterBox.y2(),
+                                         nRows, nCols);
+    TeRaster* rasterMem = new TeRaster(rasterParams);
+    rasterMem->init();
+    if (!rasterMem->status())
+    {
+        cout << "Falha ao criar raster em memoria." << endl;
+    }
+
+    // Fill coverage with interpolated values from the coverage, counting time
+    time_t when;
+    int beginTime = time(&when);
+    coverage.evaluate(*rasterMem, 0, srcDimension);
+    int endTime = time(&when);
+
+    // Show contents of the raster
+    for (TeRaster::iterator it = rasterMem->begin(); it != rasterMem->end(); it++)
+    {
+        TeCoord2D pixelCoord = rasterMem->index2Coord(TeCoord2D(it.currentColumn(), it.currentLine()));
+        double val = 0;
+        rasterMem->getElement(it.currentColumn(), it.currentLine(), val);
+        std::cout << "coord(" << it.currentColumn() << "," << it.currentLine() << ") = (" << pixelCoord.x() << "," << pixelCoord.y() << "): value = [" << val << "]" << std::endl;
+    }
+
+    // Show time spent in raster interpolation
+    std::cout << "Completed interpolation of " << nRows << "x" << nCols << " raster in " << (endTime - beginTime) << "s." << std::endl;
+
+	// Close database connection
+	myDB->close();
+}
+
+void main(int argc, char* argv[])
+{
+    std::cout << "This application will test some coverage functions.\n"
+            << "What support representation do you want for the coverage?\n"
+            << "(1=Point, 2=Line, 3=Polygon): ";
+
+    int coverageType = -1;
+    std::cin >> coverageType;
+
+    std::string databaseFile, coverageLayerName, coverageId, srcLayerName;
+    std::vector<std::string> columns;
+
+    switch (coverageType)
+    {
+    case 1:
+        // Database location
+        databaseFile = ".\\cidades.mdb";
+
+        // Information about coverage to be created/accessed
+        coverageLayerName = "CidadesCoverageLayer";
+        coverageId = "CidadesCoverage";
+
+        // Information about source for importing
+        srcLayerName = "CIDADES_point";
+        columns.push_back("MD_LONGITU");
+        columns.push_back("MD_LATITUD");
+
+        testCoverage<TePoint>(databaseFile, coverageLayerName, coverageId, srcLayerName, columns);
+        break;
+
+    case 2:
+        // Database location
+        databaseFile = ".\\sergipe.mdb";
+
+        // Information about coverage to be created/accessed
+        coverageLayerName = "AltimetriaCoverageLayer";
+        coverageId = "AltimetriaCoverage";
+
+        // Information about source for importing
+        srcLayerName = "Altimetria_lin";
+        columns.push_back("COTA");
+        columns.push_back("LENGTH");
+
+        testCoverage<TeLine2D>(databaseFile, coverageLayerName, coverageId, srcLayerName, columns);
+        break;
+
+    case 3:
+        // Database location
+        databaseFile = ".\\sergipe.mdb";
+
+        // Information about coverage to be created/accessed
+        coverageLayerName = "UsoDoSoloCoverageLayer";
+        coverageId = "UsoDoSoloCoverage";
+
+        // Information about source for importing
+        srcLayerName = "UsodoSolo_pol";
+        columns.push_back("AREA");
+        columns.push_back("PERIMETER");
+
+        testCoverage<TePolygon>(databaseFile, coverageLayerName, coverageId, srcLayerName, columns);
+        break;
+    }
+}
diff --git a/examples/createCoverage/createCoverage.pro b/examples/createCoverage/createCoverage.pro
new file mode 100644
index 0000000..0a840a8
--- /dev/null
+++ b/examples/createCoverage/createCoverage.pro
@@ -0,0 +1,5 @@
+TARGET = createCoverage
+
+include (../base/base.pro)
+
+SOURCES += createCoverage.cpp
diff --git a/examples/createDatabase/.cdtproject b/examples/createDatabase/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/createDatabase/.cdtproject
+++ b/examples/createDatabase/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/createDatabase/.project b/examples/createDatabase/.project
old mode 100755
new mode 100644
index 431ee19..17c184c
--- a/examples/createDatabase/.project
+++ b/examples/createDatabase/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>createDatabase</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>createDatabase</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/createDatabase/Makefile b/examples/createDatabase/Makefile
old mode 100755
new mode 100644
index 4db6120..2187f80
--- a/examples/createDatabase/Makefile
+++ b/examples/createDatabase/Makefile
@@ -1,29 +1,29 @@
-all: createDatabase
-
-debug: createDB_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-createDatabase: terralib
-	qmake -o makeCreateDatabase createDatabase.pro; make -f makeCreateDatabase
-
-createDB_dbg: terralib_dbg
-	qmake -o makeCreateDatabase.debug createDatabase.pro TE_PROJECT_TYPE=DEBUG; make -f makeCreateDatabase.debug
-
-clean:
-	if \
-		test -f makeCreateDatabase; \
-	then \
-		make -f makeCreateDatabase distclean; rm -f makeCreateDatabase; \
-	fi
-
-clean_debug:
-	if \
-		test -f makeCreateDatabase.debug; \
-	then \
-		make -f makeCreateDatabase.debug distclean; rm -f makeCreateDatabase.debug; \
+all: createDatabase
+
+debug: createDB_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+createDatabase: terralib
+	qmake -o makeCreateDatabase createDatabase.pro; make -f makeCreateDatabase
+
+createDB_dbg: terralib_dbg
+	qmake -o makeCreateDatabase.debug createDatabase.pro TE_PROJECT_TYPE=DEBUG; make -f makeCreateDatabase.debug
+
+clean:
+	if \
+		test -f makeCreateDatabase; \
+	then \
+		make -f makeCreateDatabase distclean; rm -f makeCreateDatabase; \
+	fi
+
+clean_debug:
+	if \
+		test -f makeCreateDatabase.debug; \
+	then \
+		make -f makeCreateDatabase.debug distclean; rm -f makeCreateDatabase.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/createDatabase/createDatabase.cpp b/examples/createDatabase/createDatabase.cpp
old mode 100755
new mode 100644
index 28c1d6f..49d53ac
--- a/examples/createDatabase/createDatabase.cpp
+++ b/examples/createDatabase/createDatabase.cpp
@@ -1,64 +1,64 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/* 
-	This file shows an example of how to create a TerraLib database called "DB320RC1"
-	in an MySQL DBMS Server running in the local machine, supposing there is an
-	user called "root" with no password.
-
-	Author: Lubia Vinhas  
-*/
-
-#include "TeMySQL.h"
-
-int main()
-{
-	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Creates a new database
-	TeDatabase* db = new TeMySQL();
-	if (db->newDatabase(dbname, user, password, host) == false)
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "The database \"" << dbname;
-	cout << "\" was created successfully in the MySQL server located in \"" << host;
-	cout << "\" for the user named \"" << user << "\" !"  << endl;
-
-	// Close database
-	db->close();
-	delete db;
-	cout << endl << "Press Enter\n";
-	getchar();
-	return 0;
-}
-
-
-
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+	This file shows an example of how to create a TerraLib database called "DB320RC1"
+	in an MySQL DBMS Server running in the local machine, supposing there is an
+	user called "root" with no password.
+
+	Author: Lubia Vinhas  
+*/
+
+#include "TeMySQL.h"
+
+int main()
+{
+	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Creates a new database
+	TeDatabase* db = new TeMySQL();
+	if (db->newDatabase(dbname, user, password, host) == false)
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "The database \"" << dbname;
+	cout << "\" was created successfully in the MySQL server located in \"" << host;
+	cout << "\" for the user named \"" << user << "\" !"  << endl;
+
+	// Close database
+	db->close();
+	delete db;
+	cout << endl << "Press Enter\n";
+	getchar();
+	return 0;
+}
+
+
+
+ 
diff --git a/examples/createDatabase/createDatabase.dsp b/examples/createDatabase/createDatabase.dsp
old mode 100755
new mode 100644
index a7edf53..d34a190
--- a/examples/createDatabase/createDatabase.dsp
+++ b/examples/createDatabase/createDatabase.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="createDatabase" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=createDatabase - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "createDatabase.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "createDatabase.mak" CFG="createDatabase - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "createDatabase - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "createDatabase - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "createDatabase - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createDatabase.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "createDatabase - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\in [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createDatabase.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "createDatabase - Win32 Release"
-# Name "createDatabase - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\createDatabase.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="createDatabase" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=createDatabase - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "createDatabase.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "createDatabase.mak" CFG="createDatabase - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "createDatabase - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "createDatabase - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "createDatabase - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createDatabase.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "createDatabase - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\in [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createDatabase.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "createDatabase - Win32 Release"
+# Name "createDatabase - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\createDatabase.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/createDatabase/createDatabase.dsw b/examples/createDatabase/createDatabase.dsw
old mode 100755
new mode 100644
index 2a6a1fb..1203ae6
--- a/examples/createDatabase/createDatabase.dsw
+++ b/examples/createDatabase/createDatabase.dsw
@@ -1,29 +1,29 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "createDatabase"=.\createDatabase.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "createDatabase"=.\createDatabase.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/createDatabase/createDatabase.pro b/examples/createDatabase/createDatabase.pro
old mode 100755
new mode 100644
index ce03277..af553ca
--- a/examples/createDatabase/createDatabase.pro
+++ b/examples/createDatabase/createDatabase.pro
@@ -1,9 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	createDatabase.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
+TARGET = createDatabase
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	createDatabase.cpp
+	
diff --git a/examples/createDatabase/createDatabase.sln b/examples/createDatabase/createDatabase.sln
old mode 100755
new mode 100644
index 0e3836c..c50cb0b
--- a/examples/createDatabase/createDatabase.sln
+++ b/examples/createDatabase/createDatabase.sln
@@ -1,50 +1,50 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createDatabase", "createDatabase.vcproj", "{94BFC951-F445-444C-96B9-F65C27CE30CA}"
-	ProjectSection(ProjectDependencies) = postProject
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
-		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E} = {5E26C3A1-28D3-40FA-A3F5-115180C98E0E}
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2} = {70DF8CB8-3CDB-4040-A832-A2FDC05758C2}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\..\terralibw\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\..\terralibw\terralib\terralib.vcproj", "{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\terralibw\tiff\tiff.vcproj", "{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfiguration) = preSolution
-		Debug = Debug
-		Release = Release
-	EndGlobalSection
-	GlobalSection(ProjectDependencies) = postSolution
-	EndGlobalSection
-	GlobalSection(ProjectConfiguration) = postSolution
-		{94BFC951-F445-444C-96B9-F65C27CE30CA}.Debug.ActiveCfg = Debug|Win32
-		{94BFC951-F445-444C-96B9-F65C27CE30CA}.Debug.Build.0 = Debug|Win32
-		{94BFC951-F445-444C-96B9-F65C27CE30CA}.Release.ActiveCfg = Release|Win32
-		{94BFC951-F445-444C-96B9-F65C27CE30CA}.Release.Build.0 = Release|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.ActiveCfg = Debug|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.Build.0 = Debug|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.ActiveCfg = Release|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.Build.0 = Release|Win32
-		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.ActiveCfg = Debug|Win32
-		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.Build.0 = Debug|Win32
-		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.ActiveCfg = Release|Win32
-		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-	EndGlobalSection
-	GlobalSection(ExtensibilityAddIns) = postSolution
-	EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createDatabase", "createDatabase.vcproj", "{94BFC951-F445-444C-96B9-F65C27CE30CA}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E} = {5E26C3A1-28D3-40FA-A3F5-115180C98E0E}
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2} = {70DF8CB8-3CDB-4040-A832-A2FDC05758C2}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\..\terralibw\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\..\terralibw\terralib\terralib.vcproj", "{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\terralibw\tiff\tiff.vcproj", "{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectDependencies) = postSolution
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{94BFC951-F445-444C-96B9-F65C27CE30CA}.Debug.ActiveCfg = Debug|Win32
+		{94BFC951-F445-444C-96B9-F65C27CE30CA}.Debug.Build.0 = Debug|Win32
+		{94BFC951-F445-444C-96B9-F65C27CE30CA}.Release.ActiveCfg = Release|Win32
+		{94BFC951-F445-444C-96B9-F65C27CE30CA}.Release.Build.0 = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.ActiveCfg = Debug|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.Build.0 = Debug|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.ActiveCfg = Release|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.Build.0 = Release|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.ActiveCfg = Debug|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.Build.0 = Debug|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.ActiveCfg = Release|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/createDatabase/createDatabase.vcproj b/examples/createDatabase/createDatabase.vcproj
old mode 100755
new mode 100644
index fb85883..599cdcb
--- a/examples/createDatabase/createDatabase.vcproj
+++ b/examples/createDatabase/createDatabase.vcproj
@@ -1,139 +1,133 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="createDatabase"
-	ProjectGUID="{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\createDatabase.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				RuntimeLibrary="2"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\createDatabase.exe"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath=".\createDatabase.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="createDatabase"
+	ProjectGUID="{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="."
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\createDatabase.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="."
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				RuntimeLibrary="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\createDatabase.exe"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath=".\createDatabase.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/createLayer/.cdtproject b/examples/createLayer/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/createLayer/.cdtproject
+++ b/examples/createLayer/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/createLayer/.project b/examples/createLayer/.project
old mode 100755
new mode 100644
index eba638a..7e43359
--- a/examples/createLayer/.project
+++ b/examples/createLayer/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>createLayer</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>createLayer</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/createLayer/Makefile b/examples/createLayer/Makefile
old mode 100755
new mode 100644
index 83717c9..7dfc30f
--- a/examples/createLayer/Makefile
+++ b/examples/createLayer/Makefile
@@ -1,30 +1,30 @@
-all: createLayer
-
-debug: createLayer_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-	
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-createLayer: terralib
-	qmake -o makeCreateLayer createLayer.pro; make -f makeCreateLayer
-
-createLayer_dbg: terralib_dbg
-	qmake -o makeCreateLayer.debug createLayer.pro TE_PROJECT_TYPE=DEBUG; make -f makeCreateLayer.debug
-	
-clean:
-	if \
-		test -f makeCreateLayer; \
-	then \
-		make -f makeCreateLayer distclean; rm -f makeCreateLayer; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeCreateLayer.debug; \
-	then \
-		make -f makeCreateLayer.debug distclean; rm -f makeCreateLayer.debug; \
-	fi
-
+all: createLayer
+
+debug: createLayer_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+	
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+createLayer: terralib
+	qmake -o makeCreateLayer createLayer.pro; make -f makeCreateLayer
+
+createLayer_dbg: terralib_dbg
+	qmake -o makeCreateLayer.debug createLayer.pro TE_PROJECT_TYPE=DEBUG; make -f makeCreateLayer.debug
+	
+clean:
+	if \
+		test -f makeCreateLayer; \
+	then \
+		make -f makeCreateLayer distclean; rm -f makeCreateLayer; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeCreateLayer.debug; \
+	then \
+		make -f makeCreateLayer.debug distclean; rm -f makeCreateLayer.debug; \
+	fi
+
diff --git a/examples/createLayer/createLayer.cpp b/examples/createLayer/createLayer.cpp
old mode 100755
new mode 100644
index b0eb98d..6404c00
--- a/examples/createLayer/createLayer.cpp
+++ b/examples/createLayer/createLayer.cpp
@@ -1,299 +1,299 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows an example of how to create a layer in a MySQL TerraLib database,
-	and insert some vectorial data in this new layer. 
-	
-	Author: Lubia Vinhas  
-*/
-
-#include <TeMySQL.h>
-
-
-int main()
-{
-	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Opens a connection to a database accessible though ADO
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";
-
-	// Creates a projection
-	TeDatum mDatum = TeDatumFactory::make("SAD69");
-	TeProjection* pUTM = new TeUtm(mDatum,0.0);
-
-	// Create a new layer called "TesteLayer"
-	string layerName = "TesteLayer";
-	if (db->layerExist(layerName))
-	{
-		cout << "There is already a layer named \"TesteLayer\" in the TerraLib database!\n\n";
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	TeLayer* layer = new TeLayer(layerName, db, pUTM);
-	if (layer->id() <= 0)      // layer wasn�t created properly
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Add the geometry representation LINES and store it in a table called "TesteLayerLines"
-	if (!layer->addGeometry(TeLINES, "TesteLayerLines"))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Create a set of lines
-	TeLine2D reta;
-	reta.add(TeCoord2D(500,500));
-	reta.add(TeCoord2D(600,500));
-	reta.add(TeCoord2D(700,500));
-	reta.objectId("reta");
-
-	TeLine2D ele;
-	ele.add(TeCoord2D(500,600));
-	ele.add(TeCoord2D(600,600));
-	ele.add(TeCoord2D(700,700));
-	ele.add(TeCoord2D(800,600));
-	ele.add(TeCoord2D(900,600));
-	ele.objectId("ele");
-
-	TeLineSet ls;
-	ls.add(reta);
-	ls.add(ele);
-
-	// Add the line set to the layer
-	if (!layer->addLines(ls))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	else
-		cout << "Lines inserted to the new layer!\n";
-
-	// Creates a set of  polygons
-	// A simple polygon
-	TeLine2D line;
-	line.add(TeCoord2D(900,900));
-	line.add(TeCoord2D(900,1000));
-	line.add(TeCoord2D(1000,1000));
-	line.add(TeCoord2D(1000,900));
-	line.add(TeCoord2D(900,900));
-
-	TeLinearRing r1(line);
-	TePolygon poly1;
-	poly1.add(r1);
-	poly1.objectId("spoli");
-
-	// A polygon with a hole
-	TeLine2D line2;
-	line2.add(TeCoord2D(200,200));
-	line2.add(TeCoord2D(200,400));
-	line2.add(TeCoord2D(400,400));
-	line2.add(TeCoord2D(400,200));
-	line2.add(TeCoord2D(200,200));
-
-	TeLinearRing r2(line2);
-
-	TeLine2D line3;
-	line3.add(TeCoord2D(250,250));
-	line3.add(TeCoord2D(250,300));
-	line3.add(TeCoord2D(300,300));
-	line3.add(TeCoord2D(300,250));
-	line3.add(TeCoord2D(250,250));
-
-	TeLinearRing r3(line3);
-
-	TePolygon poly2;
-	poly2.add(r2);
-	poly2.add(r3);
-	poly2.objectId("cpoli");
-
-	TePolygonSet ps;
-	ps.add(poly1);
-	ps.add(poly2);
-
-	// Add the polygon set to the layer
-	// As addGeometry wasn�t called before, the table of polygons will have a default name
-	if (!layer->addPolygons(ps))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	else
-		cout << "Polygons inserted in the new layer!\n";
-
-	// Create a set of points
-	TePoint p1(40,40);
-	p1.objectId("ponto1");
-	TePoint p2(65,65);
-	p2.objectId("ponto2");
-
-	TePointSet pos;
-	pos.add(p1);
-	pos.add(p2);
-
-	// Add the point set to the layer
-	// As addGeometry wasn�t called before, the table of points will have a default name
-	if (!layer->addPoints(pos))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	else
-		cout << "Points inserted in the new layer!\n";
-
-	// Create an attribute table
-	// Define a list of attributes
-	TeAttributeList attList;
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.numChar_ = 16;
-	at.rep_.name_ = "object_id";
-	at.rep_.isPrimaryKey_ = true;
-	attList.push_back(at);
-
-	at.rep_.type_ = TeSTRING;       // a string attribute
-	at.rep_.numChar_ = 255;
-	at.rep_.name_ = "nome";
-	at.rep_.isPrimaryKey_ = false;
-	attList.push_back(at);  
-
-	at.rep_.type_ = TeREAL; // a float attribute
-	at.rep_.name_ = "val1";
-	at.rep_.decimals_ = 3;
-	at.rep_.isPrimaryKey_ = false;
-	attList.push_back(at);  
-
-	at.rep_.type_ = TeINT;          // an integer attribute
-	at.rep_.name_ = "val2";
-	at.rep_.isPrimaryKey_ = false;
-	attList.push_back(at);  
-
-	// Create an attribute table associated to the new layer, called "TesteLayerAttr"
-	TeTable attTable("TesteLayerAttr", attList, "object_id", "object_id");		// creates a table in memory
-	if (!layer->createAttributeTable(attTable))
-	{
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Each row is related to one of the geometries by its objetc_id
-	TeTableRow row;
-	row.push_back("reta");
-	row.push_back("An straight line");
-	row.push_back("11.1");
-	row.push_back("11");
-	attTable.add(row);
-	row.clear();
-
-	row.push_back("ele");
-	row.push_back("A mountain shaped line");
-	row.push_back("22.2");
-	row.push_back("22");
-	attTable.add(row);
-	row.clear();
-
-	row.push_back("spoli");
-	row.push_back("A simple polygon");
-	row.push_back("33.3");
-	row.push_back("33");
-	attTable.add(row);
-
-	row.clear();
-	row.push_back("ponto1");
-	row.push_back("A point");
-	row.push_back("55.5");
-	row.push_back("55");
-	attTable.add(row);
-	row.clear();
-
-	row.push_back("ponto2");
-	row.push_back("Another point");
-	row.push_back("66.6");
-	row.push_back("66");
-	attTable.add(row);
-	row.clear();
-
-	row.push_back("cpoli");
-	row.push_back("A polygon with hole");
-	row.push_back("44.4");
-	row.push_back("44");
-	attTable.add(row);
-	row.clear();
-
-	// Saves the table in the database
-	if (!layer->saveAttributeTable( attTable ))
-	{
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	else
-		cout << "Objects inserted in the new layer!\n\n";
-
-	// Close database
-	db->close();
-	cout << "Press Enter\n";
-	cout.flush();
-	getchar();
-	return 0;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows an example of how to create a layer in a MySQL TerraLib database,
+	and insert some vectorial data in this new layer. 
+	
+	Author: Lubia Vinhas  
+*/
+
+#include <TeMySQL.h>
+
+
+int main()
+{
+	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Opens a connection to a database accessible though ADO
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";
+
+	// Creates a projection
+	TeDatum mDatum = TeDatumFactory::make("SAD69");
+	TeProjection* pUTM = new TeUtm(mDatum,0.0);
+
+	// Create a new layer called "TesteLayer"
+	string layerName = "TesteLayer";
+	if (db->layerExist(layerName))
+	{
+		cout << "There is already a layer named \"TesteLayer\" in the TerraLib database!\n\n";
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	TeLayer* layer = new TeLayer(layerName, db, pUTM);
+	if (layer->id() <= 0)      // layer wasn�t created properly
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Add the geometry representation LINES and store it in a table called "TesteLayerLines"
+	if (!layer->addGeometry(TeLINES, "TesteLayerLines"))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Create a set of lines
+	TeLine2D reta;
+	reta.add(TeCoord2D(500,500));
+	reta.add(TeCoord2D(600,500));
+	reta.add(TeCoord2D(700,500));
+	reta.objectId("reta");
+
+	TeLine2D ele;
+	ele.add(TeCoord2D(500,600));
+	ele.add(TeCoord2D(600,600));
+	ele.add(TeCoord2D(700,700));
+	ele.add(TeCoord2D(800,600));
+	ele.add(TeCoord2D(900,600));
+	ele.objectId("ele");
+
+	TeLineSet ls;
+	ls.add(reta);
+	ls.add(ele);
+
+	// Add the line set to the layer
+	if (!layer->addLines(ls))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	else
+		cout << "Lines inserted to the new layer!\n";
+
+	// Creates a set of  polygons
+	// A simple polygon
+	TeLine2D line;
+	line.add(TeCoord2D(900,900));
+	line.add(TeCoord2D(900,1000));
+	line.add(TeCoord2D(1000,1000));
+	line.add(TeCoord2D(1000,900));
+	line.add(TeCoord2D(900,900));
+
+	TeLinearRing r1(line);
+	TePolygon poly1;
+	poly1.add(r1);
+	poly1.objectId("spoli");
+
+	// A polygon with a hole
+	TeLine2D line2;
+	line2.add(TeCoord2D(200,200));
+	line2.add(TeCoord2D(200,400));
+	line2.add(TeCoord2D(400,400));
+	line2.add(TeCoord2D(400,200));
+	line2.add(TeCoord2D(200,200));
+
+	TeLinearRing r2(line2);
+
+	TeLine2D line3;
+	line3.add(TeCoord2D(250,250));
+	line3.add(TeCoord2D(250,300));
+	line3.add(TeCoord2D(300,300));
+	line3.add(TeCoord2D(300,250));
+	line3.add(TeCoord2D(250,250));
+
+	TeLinearRing r3(line3);
+
+	TePolygon poly2;
+	poly2.add(r2);
+	poly2.add(r3);
+	poly2.objectId("cpoli");
+
+	TePolygonSet ps;
+	ps.add(poly1);
+	ps.add(poly2);
+
+	// Add the polygon set to the layer
+	// As addGeometry wasn�t called before, the table of polygons will have a default name
+	if (!layer->addPolygons(ps))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	else
+		cout << "Polygons inserted in the new layer!\n";
+
+	// Create a set of points
+	TePoint p1(40,40);
+	p1.objectId("ponto1");
+	TePoint p2(65,65);
+	p2.objectId("ponto2");
+
+	TePointSet pos;
+	pos.add(p1);
+	pos.add(p2);
+
+	// Add the point set to the layer
+	// As addGeometry wasn�t called before, the table of points will have a default name
+	if (!layer->addPoints(pos))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	else
+		cout << "Points inserted in the new layer!\n";
+
+	// Create an attribute table
+	// Define a list of attributes
+	TeAttributeList attList;
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.numChar_ = 16;
+	at.rep_.name_ = "object_id";
+	at.rep_.isPrimaryKey_ = true;
+	attList.push_back(at);
+
+	at.rep_.type_ = TeSTRING;       // a string attribute
+	at.rep_.numChar_ = 255;
+	at.rep_.name_ = "nome";
+	at.rep_.isPrimaryKey_ = false;
+	attList.push_back(at);  
+
+	at.rep_.type_ = TeREAL; // a float attribute
+	at.rep_.name_ = "val1";
+	at.rep_.decimals_ = 3;
+	at.rep_.isPrimaryKey_ = false;
+	attList.push_back(at);  
+
+	at.rep_.type_ = TeINT;          // an integer attribute
+	at.rep_.name_ = "val2";
+	at.rep_.isPrimaryKey_ = false;
+	attList.push_back(at);  
+
+	// Create an attribute table associated to the new layer, called "TesteLayerAttr"
+	TeTable attTable("TesteLayerAttr", attList, "object_id", "object_id");		// creates a table in memory
+	if (!layer->createAttributeTable(attTable))
+	{
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Each row is related to one of the geometries by its objetc_id
+	TeTableRow row;
+	row.push_back("reta");
+	row.push_back("An straight line");
+	row.push_back("11.1");
+	row.push_back("11");
+	attTable.add(row);
+	row.clear();
+
+	row.push_back("ele");
+	row.push_back("A mountain shaped line");
+	row.push_back("22.2");
+	row.push_back("22");
+	attTable.add(row);
+	row.clear();
+
+	row.push_back("spoli");
+	row.push_back("A simple polygon");
+	row.push_back("33.3");
+	row.push_back("33");
+	attTable.add(row);
+
+	row.clear();
+	row.push_back("ponto1");
+	row.push_back("A point");
+	row.push_back("55.5");
+	row.push_back("55");
+	attTable.add(row);
+	row.clear();
+
+	row.push_back("ponto2");
+	row.push_back("Another point");
+	row.push_back("66.6");
+	row.push_back("66");
+	attTable.add(row);
+	row.clear();
+
+	row.push_back("cpoli");
+	row.push_back("A polygon with hole");
+	row.push_back("44.4");
+	row.push_back("44");
+	attTable.add(row);
+	row.clear();
+
+	// Saves the table in the database
+	if (!layer->saveAttributeTable( attTable ))
+	{
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	else
+		cout << "Objects inserted in the new layer!\n\n";
+
+	// Close database
+	db->close();
+	cout << "Press Enter\n";
+	cout.flush();
+	getchar();
+	return 0;
+}
+
diff --git a/examples/createLayer/createLayer.dsp b/examples/createLayer/createLayer.dsp
old mode 100755
new mode 100644
index d02414d..191ab90
--- a/examples/createLayer/createLayer.dsp
+++ b/examples/createLayer/createLayer.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="createLayer" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=createLayer - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "createLayer.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "createLayer.mak" CFG="createLayer - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "createLayer - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "createLayer - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "createLayer - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createLayer.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "createLayer - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\in [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createLayer.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "createLayer - Win32 Release"
-# Name "createLayer - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\createLayer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="createLayer" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=createLayer - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "createLayer.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "createLayer.mak" CFG="createLayer - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "createLayer - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "createLayer - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "createLayer - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createLayer.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "createLayer - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\in [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createLayer.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "createLayer - Win32 Release"
+# Name "createLayer - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\createLayer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/createLayer/createLayer.dsw b/examples/createLayer/createLayer.dsw
old mode 100755
new mode 100644
index 8d21e03..4cb71af
--- a/examples/createLayer/createLayer.dsw
+++ b/examples/createLayer/createLayer.dsw
@@ -1,44 +1,44 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "createLayer"=.\createLayer.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "createLayer"=.\createLayer.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/createLayer/createLayer.pro b/examples/createLayer/createLayer.pro
old mode 100755
new mode 100644
index d92f83c..7afa7bc
--- a/examples/createLayer/createLayer.pro
+++ b/examples/createLayer/createLayer.pro
@@ -1,9 +1,6 @@
-include( ../base/base.pro )
-
-
-SOURCES	+= \
-	createLayer.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
+TARGET = createLayer
+
+include( ../base/base.pro )
+
+
+SOURCES	+= createLayer.cpp 
diff --git a/examples/createLayer/createLayer.sln b/examples/createLayer/createLayer.sln
old mode 100755
new mode 100644
diff --git a/examples/createLayer/createLayer.vcproj b/examples/createLayer/createLayer.vcproj
old mode 100755
new mode 100644
index ad291ab..c5f89a5
--- a/examples/createLayer/createLayer.vcproj
+++ b/examples/createLayer/createLayer.vcproj
@@ -1,200 +1,177 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="createLayer"
-	ProjectGUID="{60593B0C-8CD8-4157-95EC-0185FBAD9268}"
-	SccProjectName=""
-	SccLocalPath="">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				PrecompiledHeaderFile=".\Debug/createLayer.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="../Debug/createLayer.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=".\Debug/createLayer.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Debug/createLayer.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				PrecompiledHeaderFile=".\Release/createLayer.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="../Release/createLayer.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				ProgramDatabaseFile=".\Release/createLayer.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Release/createLayer.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="createLayer.cpp">
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="createLayer"
+	ProjectGUID="{60593B0C-8CD8-4157-95EC-0185FBAD9268}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/createLayer.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="../Debug/createLayer.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/createLayer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/createLayer.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/createLayer.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="../Release/createLayer.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/createLayer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/createLayer.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="createLayer.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/createProximityMatrix/.cdtproject b/examples/createProximityMatrix/.cdtproject
new file mode 100644
index 0000000..6a7b054
--- /dev/null
+++ b/examples/createProximityMatrix/.cdtproject
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/createProximityMatrix/.project b/examples/createProximityMatrix/.project
new file mode 100644
index 0000000..c15ed7b
--- /dev/null
+++ b/examples/createProximityMatrix/.project
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>createProximityMatrix</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/createProximityMatrix/Makefile b/examples/createProximityMatrix/Makefile
new file mode 100644
index 0000000..c752109
--- /dev/null
+++ b/examples/createProximityMatrix/Makefile
@@ -0,0 +1,14 @@
+all: createProximityMatrix
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+createProximityMatrix: terralib 
+	qmake -o makeCreateProximityMatrix createProximityMatrix.pro; make -f makeCreateProximityMatrix
+
+clean:
+	if \
+		test -f makeCreateProximityMatrix; \
+	then \
+		make -f makeCreateProximityMatrix distclean; rm -f makeCreateProximityMatrix; \
+	fi
\ No newline at end of file
diff --git a/examples/createProximityMatrix/createProximityMatrix.cpp b/examples/createProximityMatrix/createProximityMatrix.cpp
new file mode 100644
index 0000000..d411425
--- /dev/null
+++ b/examples/createProximityMatrix/createProximityMatrix.cpp
@@ -0,0 +1,123 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+   This file illustrates an example of how to create a proximity matrix from a 
+   Spatial Temporal Element Set (STElementSet). 
+   In this example, the distance strategy is used to construct the matrix.   
+
+   Author: Karine Reis   
+*/
+
+#include <TeSTElementSet.h>
+#include <TeSTEFunctionsDB.h>
+#include <TeGeneralizedProxMatrix.h>
+#include <TeMySQL.h>
+
+int main()
+{	
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+		
+	
+	// Opens a connection to a TerraLib database 
+    // Loads a layer named Distritos
+	TeLayer* DistritosSP =  new TeLayer("Distritos");
+	if (!db->loadLayer(DistritosSP))
+	{
+	    cout << "Fail to load the layer!" << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+        return 1;
+	}
+
+    
+	// Creates a STElementSet from DistritosSP layer 
+	TeSTElementSet steSet(DistritosSP);
+
+	// Builds the STElementSet with geometries
+	vector<string> attrs;
+	if(!TeSTOSetBuildDB(&steSet, true, false, attrs))
+	{
+		cout << "Error! " << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	
+	// Shows how many elements the elementSet has
+	cout << "Number of elements: " <<  steSet.numElements() << endl;
+
+	
+	//Create prox matrix strategies		
+	TeProxMatrixLocalDistanceStrategy<TeSTElementSet>   sc_dist (&steSet, TePOLYGONS, 12000.00);
+	TeGeneralizedProxMatrix<TeSTElementSet> proxMat(&sc_dist); 
+
+	// Builds the proximity matrix
+	if(!proxMat.constructMatrix())
+	{
+		cout << "Error building proximity matrix! " << endl;
+		getchar();
+		db->close ();
+		return 0;
+	}
+
+	// Shows the neighbours of each object from proxMat
+	TeSTElementSet::iterator it = steSet.begin();
+	while ( it != steSet.end())
+	{
+		cout<< " The neighbours of the element  "<< (*it).objectId() << " are: " << endl;
+			
+		// Gets the neighbours of an element
+		TeNeighboursMap neighbors = proxMat.getMapNeighbours((*it).objectId());
+		TeNeighboursMap::iterator itN = neighbors.begin();
+		while (itN != neighbors.end())
+		{
+			cout<< "         "<<(*itN).first << endl;
+			++itN;
+		}
+		cout << endl;
+		++it;
+	}
+
+	
+	db->close();
+	cout << endl << "Press Enter\n";
+	getchar();
+	return 0;
+}
diff --git a/examples/createProximityMatrix/createProximityMatrix.dsp b/examples/createProximityMatrix/createProximityMatrix.dsp
new file mode 100644
index 0000000..e93fdbb
--- /dev/null
+++ b/examples/createProximityMatrix/createProximityMatrix.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="createProximityMatrix" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=createProximityMatrix - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "createProximityMatrix.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "createProximityMatrix.mak" CFG="createProximityMatrix - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "createProximityMatrix - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "createProximityMatrix - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "createProximityMatrix - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createProximityMatrix.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "createProximityMatrix - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\in [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createProximityMatrix.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "createProximityMatrix - Win32 Release"
+# Name "createProximityMatrix - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\createProximityMatrix.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/createProximityMatrix/createProximityMatrix.dsw b/examples/createProximityMatrix/createProximityMatrix.dsw
new file mode 100644
index 0000000..91cd5cb
--- /dev/null
+++ b/examples/createProximityMatrix/createProximityMatrix.dsw
@@ -0,0 +1,47 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "createProximityMatrix"=.\createProximityMatrix.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/createProximityMatrix/createProximityMatrix.pro b/examples/createProximityMatrix/createProximityMatrix.pro
new file mode 100644
index 0000000..dbc1c4e
--- /dev/null
+++ b/examples/createProximityMatrix/createProximityMatrix.pro
@@ -0,0 +1,7 @@
+TARGET = createProximityMatrix
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	createProximityMatrix.cpp 
+
diff --git a/examples/createProximityMatrix/createProximityMatrix.sln b/examples/createProximityMatrix/createProximityMatrix.sln
new file mode 100644
index 0000000..ddf2cec
--- /dev/null
+++ b/examples/createProximityMatrix/createProximityMatrix.sln
@@ -0,0 +1,45 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createProximityMatrix", "createProximityMatrix.vcproj", "{F9836EAB-9138-4D83-87E8-37FCB0704AC7}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\..\terralibw\terralib\terralib.vcproj", "{F6FE4C5D-54E9-4F24-92B1-66A78C65EA3F}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\terralibw\tiff\tiff.vcproj", "{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\..\terralibw\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{F9836EAB-9138-4D83-87E8-37FCB0704AC7}.Debug.ActiveCfg = Debug|Win32
+		{F9836EAB-9138-4D83-87E8-37FCB0704AC7}.Debug.Build.0 = Debug|Win32
+		{F9836EAB-9138-4D83-87E8-37FCB0704AC7}.Release.ActiveCfg = Release|Win32
+		{F9836EAB-9138-4D83-87E8-37FCB0704AC7}.Release.Build.0 = Release|Win32
+		{F6FE4C5D-54E9-4F24-92B1-66A78C65EA3F}.Debug.ActiveCfg = Debug|Win32
+		{F6FE4C5D-54E9-4F24-92B1-66A78C65EA3F}.Debug.Build.0 = Debug|Win32
+		{F6FE4C5D-54E9-4F24-92B1-66A78C65EA3F}.Release.ActiveCfg = Release|Win32
+		{F6FE4C5D-54E9-4F24-92B1-66A78C65EA3F}.Release.Build.0 = Release|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.ActiveCfg = Debug|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.Build.0 = Debug|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.ActiveCfg = Release|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.Build.0 = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/createProximityMatrix/createProximityMatrix.vcproj b/examples/createProximityMatrix/createProximityMatrix.vcproj
new file mode 100644
index 0000000..8705ce8
--- /dev/null
+++ b/examples/createProximityMatrix/createProximityMatrix.vcproj
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="createProximityMatrix"
+	ProjectGUID="{766E52C5-4D16-483C-A2B1-48388BC89232}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/createProximityMatrix.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="../Debug/createProximityMatrix.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/createProximityMatrix.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/createProximityMatrix.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..;.;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/createProximityMatrix.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="../Release/createProximityMatrix.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/createProximityMatrix.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/createProximityMatrix.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="createProximityMatrix.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/createSTElementSet/.cdtproject b/examples/createSTElementSet/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/createSTElementSet/.cdtproject
+++ b/examples/createSTElementSet/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/createSTElementSet/.project b/examples/createSTElementSet/.project
old mode 100755
new mode 100644
index 6fb5fcc..153ad7b
--- a/examples/createSTElementSet/.project
+++ b/examples/createSTElementSet/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>createSTElementSet</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>createSTElementSet</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/createSTElementSet/Makefile b/examples/createSTElementSet/Makefile
old mode 100755
new mode 100644
index 93f8d6d..0574c19
--- a/examples/createSTElementSet/Makefile
+++ b/examples/createSTElementSet/Makefile
@@ -1,30 +1,30 @@
-all: createSTElementSet
-
-debug: createSTElementSet_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-createSTElementSet: terralib
-	qmake -o makeCreateSTElementSet createSTElementSet.pro; make -f makeCreateSTElementSet
-
-createSTElementSet_dbg: terralib_dbg
-	qmake -o makeCreateSTElementSet.debug createSTElementSet.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeCreateSTElementSet.debug
-
-clean:
-	if \
-		test -f makeCreateSTElementSet; \
-	then \
-		make -f makeCreateSTElementSet distclean; rm -f makeCreateSTElementSet; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeCreateSTElementSet.debug; \
-	then \
-		make -f makeCreateSTElementSet.debug distclean; rm -f makeCreateSTElementSet.debug; \
+all: createSTElementSet
+
+debug: createSTElementSet_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+createSTElementSet: terralib
+	qmake -o makeCreateSTElementSet createSTElementSet.pro; make -f makeCreateSTElementSet
+
+createSTElementSet_dbg: terralib_dbg
+	qmake -o makeCreateSTElementSet.debug createSTElementSet.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeCreateSTElementSet.debug
+
+clean:
+	if \
+		test -f makeCreateSTElementSet; \
+	then \
+		make -f makeCreateSTElementSet distclean; rm -f makeCreateSTElementSet; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeCreateSTElementSet.debug; \
+	then \
+		make -f makeCreateSTElementSet.debug distclean; rm -f makeCreateSTElementSet.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/createSTElementSet/createSTElementSet.cpp b/examples/createSTElementSet/createSTElementSet.cpp
old mode 100755
new mode 100644
index 4541284..6fb7de3
--- a/examples/createSTElementSet/createSTElementSet.cpp
+++ b/examples/createSTElementSet/createSTElementSet.cpp
@@ -1,103 +1,103 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-   This file illustrates an example of how to create a new Spatial Temporal Element 
-   Set (STElementSet) from a theme. A Spatial Temporal Element Set can be created 
-   from a layer or from a theme.
-   In this example the STElementSet is created from a layer and is filled only
-   with attributes.
-
-   Author: Karine Reis   
-*/
-
-#include <TeQuerierParams.h>
-#include <TeQuerier.h>
-#include <TeMySQL.h>
-
-int main()
-{	
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to the DB320RC1 MySQL database 
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
-	
-	// Load a previously created theme named DistritosSaoPaulo.
-	// This theme was created on a layer of the metropolitan districts of Sao Paulo city
-	TeTheme* trmsp = new TeTheme("DistritosSaoPaulo");
-	if (!db->loadTheme(trmsp))
-	{
-		cout << "Fail to load the theme \"DistritosSaoPaulo\": " << db->errorMessage() << endl;
-		db->close();
-		cout << endl << "Press Enter\n";
-		getchar();
-	        return 1;
-	}
-
-	// Defines the attributes that will be kept in the STElementSet. 
-	// The attribute name must be in the format "table_name.attribute_name"
-	vector<string> attrs;
-	attrs.push_back("Distritos.Nome_Distrito");
-	attrs.push_back("Distritos.Pop2000");
-
-	// Define the parameters of the querier
-	TeQuerierParams qpar(false, attrs);
-	qpar.setParams(trmsp);
-
-	// Define a querier to the database
-	TeQuerier qdb(qpar);
-	qdb.loadInstances();
-
-	// Show how many instances the querier found
-	cout << "Number of instances: " << qdb.numElemInstances() << endl;
-
-	// Loop through all of the instances
-	TeSTInstance steInstance;
-	while (qdb.fetchInstance(steInstance))
-	{
-		string nome, pop;
-		steInstance.getPropertyValue("Nome_distrito", nome);
-		steInstance.getPropertyValue("Pop2000", pop);
-		
-		cout << " Object Identifier :  "<< steInstance.objectId() << endl; 
-		cout << " Nome Distrito     :  "<< nome  << endl; 
-		cout << " Pop2000           :  "<< pop  << endl << endl; 
-	}
-
-	db->close();
-	cout << endl << "Press Enter\n";
-	getchar();
-	return 0;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+   This file illustrates an example of how to create a new Spatial Temporal Element 
+   Set (STElementSet) from a theme. A Spatial Temporal Element Set can be created 
+   from a layer or from a theme.
+   In this example the STElementSet is created from a layer and is filled only
+   with attributes.
+
+   Author: Karine Reis   
+*/
+
+#include <TeQuerierParams.h>
+#include <TeQuerier.h>
+#include <TeMySQL.h>
+
+int main()
+{	
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+	
+	// Load a previously created theme named DistritosSaoPaulo.
+	// This theme was created on a layer of the metropolitan districts of Sao Paulo city
+	TeTheme* trmsp = new TeTheme("DistritosSaoPaulo");
+	if (!db->loadTheme(trmsp))
+	{
+		cout << "Fail to load the theme \"DistritosSaoPaulo\": " << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+	        return 1;
+	}
+
+	// Defines the attributes that will be kept in the STElementSet. 
+	// The attribute name must be in the format "table_name.attribute_name"
+	vector<string> attrs;
+	attrs.push_back("Distritos.Nome_Distrito");
+	attrs.push_back("Distritos.Pop2000");
+
+	// Define the parameters of the querier
+	TeQuerierParams qpar(false, attrs);
+	qpar.setParams(trmsp);
+
+	// Define a querier to the database
+	TeQuerier qdb(qpar);
+	qdb.loadInstances();
+
+	// Show how many instances the querier found
+	cout << "Number of instances: " << qdb.numElemInstances() << endl;
+
+	// Loop through all of the instances
+	TeSTInstance steInstance;
+	while (qdb.fetchInstance(steInstance))
+	{
+		string nome, pop;
+		steInstance.getPropertyValue("Nome_distrito", nome);
+		steInstance.getPropertyValue("Pop2000", pop);
+		
+		cout << " Object Identifier :  "<< steInstance.objectId() << endl; 
+		cout << " Nome Distrito     :  "<< nome  << endl; 
+		cout << " Pop2000           :  "<< pop  << endl << endl; 
+	}
+
+	db->close();
+	cout << endl << "Press Enter\n";
+	getchar();
+	return 0;
+}
diff --git a/examples/createSTElementSet/createSTElementSet.dsp b/examples/createSTElementSet/createSTElementSet.dsp
old mode 100755
new mode 100644
index a6ad148..ad25ba6
--- a/examples/createSTElementSet/createSTElementSet.dsp
+++ b/examples/createSTElementSet/createSTElementSet.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="createSTElementSet" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=createSTElementSet - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "createSTElementSet.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "createSTElementSet.mak" CFG="createSTElementSet - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "createSTElementSet - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "createSTElementSet - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "createSTElementSet - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createSTElementSet.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "createSTElementSet - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createSTElementSet.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "createSTElementSet - Win32 Release"
-# Name "createSTElementSet - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\createSTElementSet.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="createSTElementSet" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=createSTElementSet - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "createSTElementSet.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "createSTElementSet.mak" CFG="createSTElementSet - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "createSTElementSet - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "createSTElementSet - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "createSTElementSet - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createSTElementSet.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "createSTElementSet - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createSTElementSet.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "createSTElementSet - Win32 Release"
+# Name "createSTElementSet - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\createSTElementSet.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/createSTElementSet/createSTElementSet.dsw b/examples/createSTElementSet/createSTElementSet.dsw
old mode 100755
new mode 100644
index 0cc332a..9b9caed
--- a/examples/createSTElementSet/createSTElementSet.dsw
+++ b/examples/createSTElementSet/createSTElementSet.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "createSTElementSet"=.\createSTElementSet.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "createSTElementSet"=.\createSTElementSet.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/createSTElementSet/createSTElementSet.pro b/examples/createSTElementSet/createSTElementSet.pro
old mode 100755
new mode 100644
index 1b70907..314395e
--- a/examples/createSTElementSet/createSTElementSet.pro
+++ b/examples/createSTElementSet/createSTElementSet.pro
@@ -1,8 +1,6 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	createSTElementSet.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
+TARGET = createSTElementSet
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	createSTElementSet.cpp 
diff --git a/examples/createSTElementSet/createSTElementSet.sln b/examples/createSTElementSet/createSTElementSet.sln
old mode 100755
new mode 100644
diff --git a/examples/createSTElementSet/createSTElementSet.vcproj b/examples/createSTElementSet/createSTElementSet.vcproj
old mode 100755
new mode 100644
index 9a5dfd0..4a861e8
--- a/examples/createSTElementSet/createSTElementSet.vcproj
+++ b/examples/createSTElementSet/createSTElementSet.vcproj
@@ -1,164 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="createSTElementSet"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\createSTElementSet.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\createSTElementSet.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="createSTElementSet.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="createSTElementSet"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\createSTElementSet.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\createSTElementSet.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="createSTElementSet.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/createSTElementSetFromLayer/.cdtproject b/examples/createSTElementSetFromLayer/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/createSTElementSetFromLayer/.cdtproject
+++ b/examples/createSTElementSetFromLayer/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/createSTElementSetFromLayer/.project b/examples/createSTElementSetFromLayer/.project
old mode 100755
new mode 100644
index 04c5800..6c8d94c
--- a/examples/createSTElementSetFromLayer/.project
+++ b/examples/createSTElementSetFromLayer/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>createSTElementSetFromLayer</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>createSTElementSetFromLayer</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/createSTElementSetFromLayer/Makefile b/examples/createSTElementSetFromLayer/Makefile
old mode 100755
new mode 100644
index d150f79..184d05f
--- a/examples/createSTElementSetFromLayer/Makefile
+++ b/examples/createSTElementSetFromLayer/Makefile
@@ -1,30 +1,30 @@
-all: createSTElementSetFromLayer
-
-debug: createSTElementSetFromLayer_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-createSTElementSetFromLayer: terralib
-	qmake -o makeCreateSTElementSetFromLayer createSTElementSetFromLayer.pro; make -f makeCreateSTElementSetFromLayer
-
-createSTElementSetFromLayer_dbg: terralib_dbg
-	qmake -o makeCreateSTElementSetFromLayer.debug createSTElementSetFromLayer.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeCreateSTElementSetFromLayer.debug
-
-clean:
-	if \
-		test -f makeCreateSTElementSetFromLayer; \
-	then \
-		make -f makeCreateSTElementSetFromLayer distclean; rm -f makeCreateSTElementSetFromLayer; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeCreateSTElementSetFromLayer.debug; \
-	then \
-		make -f makeCreateSTElementSetFromLayer.debug distclean; rm -f makeCreateSTElementSetFromLayer.debug; \
+all: createSTElementSetFromLayer
+
+debug: createSTElementSetFromLayer_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+createSTElementSetFromLayer: terralib
+	qmake -o makeCreateSTElementSetFromLayer createSTElementSetFromLayer.pro; make -f makeCreateSTElementSetFromLayer
+
+createSTElementSetFromLayer_dbg: terralib_dbg
+	qmake -o makeCreateSTElementSetFromLayer.debug createSTElementSetFromLayer.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeCreateSTElementSetFromLayer.debug
+
+clean:
+	if \
+		test -f makeCreateSTElementSetFromLayer; \
+	then \
+		make -f makeCreateSTElementSetFromLayer distclean; rm -f makeCreateSTElementSetFromLayer; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeCreateSTElementSetFromLayer.debug; \
+	then \
+		make -f makeCreateSTElementSetFromLayer.debug distclean; rm -f makeCreateSTElementSetFromLayer.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.cpp b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.cpp
old mode 100755
new mode 100644
index 284d32f..102f756
--- a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.cpp
+++ b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.cpp
@@ -1,137 +1,137 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-   This file illustrates an example of how to create a new Spatial Temporal Element 
-   Set (STElementSet) from a layer. A Spatial Temporal Element Set can be created 
-   from a layer or from a theme.
-   In this example the STElementSet is created from a layer and is filled only
-   with some attributes.
-
-   Author: Karine Reis   
-*/
-
-#include <TeSTElementSet.h>
-#include <TeSTEFunctionsDB.h>
-#include <TeMySQL.h>
-#include <TeDriverSHPDBF.h>
-
-
-int main()
-{	
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to the DB320RC1 MySQL database 
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
-	
-	//Verify if there is the layer "EstadosBrasil"
-	string layerName = "EstadosBrasil";
-	if (!db->layerExist(layerName))
-	{
-		// Create a new layer in the database
-		TeDatum sad69 = TeDatumFactory::make("SAD69");
-		TePolyconic* proj = new TePolyconic(sad69, -54);
-
-		TeLayer* layer = new TeLayer(layerName, db, proj);
-		string filename = "../data/EstadosBrasil.shp";	// Shapefile path
-		string tablename = "EstadosBrasil";	// Name of the attribute table
-
-		if (TeImportShape(layer, filename, tablename))
-			cout << "The shapefile \"EstadosBrasil.shp\" was imported successfully into the TerraLib database!\n" << endl;
-		else
-			cout << "Error: Fail to import the shapefile \"EstadosBrasil.shp\"!\n" << endl;
-
-	}
-	
-	// Loads the layer
-	TeLayer* estados = new TeLayer("EstadosBrasil");
-	if (!db->loadLayer(estados))
-	{
-	    cout << "Fail to load the layer \"EstadosBrasil\": " << db->errorMessage() << endl;
-		db->close();
-		cout << endl << "Press Enter\n";
-		getchar();
-        return 1;
-	}
-
-	// Creates a elementSet from the layer "estados"
-	TeSTElementSet steSet (estados);
-
-	// Defines what attributes will be kept in the elementSet. 
-	// The attribute name must be in the format "table_name.attribute_name"
-	vector<string> attrs;
-	attrs.push_back("EstadosBrasil.NOME_UF");
-	attrs.push_back("EstadosBrasil.CAPITAL");
-
-	// Fills the elementSet without geometries and with the 
-	// attributes NOME_UF and CAPITAL 
-	bool loadGeometries = false;
-	bool loadAllAttributes = false;
-	if(!TeSTOSetBuildDB(&steSet, loadGeometries, loadAllAttributes, attrs))
-	{
-		cout << "Error! " << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Prints the number of elements of the elementSet
-	cout << "Number of elements: " << steSet.numElements() << endl;
-
-	//Traverse all instances of the set using iterator
-	TeSTElementSet::iterator it = steSet.begin();
-	while ( it != steSet.end())
-	{
-		TeSTInstance st = (*it);
-
-		string desc;
-		// returns the attributes
-		TePropertyVector vectp = st.getPropertyVector();
-
-		cout << "Id: " << st.objectId() << " ---------------- " << endl;
-		for (unsigned int i=0; i<vectp.size(); i++)
-		{
-			cout << vectp[i].attr_.rep_.name_ << "  =  ";
-			cout << vectp[i].value_ << endl;
-		}
-		cout << endl;
-		++it;
-	}
-
-	db->close();
-	cout << endl << "Press Enter\n";
-	getchar();
-	return 0;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+   This file illustrates an example of how to create a new Spatial Temporal Element 
+   Set (STElementSet) from a layer. A Spatial Temporal Element Set can be created 
+   from a layer or from a theme.
+   In this example the STElementSet is created from a layer and is filled only
+   with some attributes.
+
+   Author: Karine Reis   
+*/
+
+#include <TeSTElementSet.h>
+#include <TeSTEFunctionsDB.h>
+#include <TeMySQL.h>
+#include <TeDriverSHPDBF.h>
+
+
+int main()
+{	
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+	
+	//Verify if there is the layer "EstadosBrasil"
+	string layerName = "EstadosBrasil";
+	if (!db->layerExist(layerName))
+	{
+		// Create a new layer in the database
+		TeDatum sad69 = TeDatumFactory::make("SAD69");
+		TePolyconic* proj = new TePolyconic(sad69, -54);
+
+		TeLayer* layer = new TeLayer(layerName, db, proj);
+		string filename = "../data/EstadosBrasil.shp";	// Shapefile path
+		string tablename = "EstadosBrasil";	// Name of the attribute table
+
+		if (TeImportShape(layer, filename, tablename))
+			cout << "The shapefile \"EstadosBrasil.shp\" was imported successfully into the TerraLib database!\n" << endl;
+		else
+			cout << "Error: Fail to import the shapefile \"EstadosBrasil.shp\"!\n" << endl;
+
+	}
+	
+	// Loads the layer
+	TeLayer* estados = new TeLayer("EstadosBrasil");
+	if (!db->loadLayer(estados))
+	{
+	    cout << "Fail to load the layer \"EstadosBrasil\": " << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+        return 1;
+	}
+
+	// Creates a elementSet from the layer "estados"
+	TeSTElementSet steSet (estados);
+
+	// Defines what attributes will be kept in the elementSet. 
+	// The attribute name must be in the format "table_name.attribute_name"
+	vector<string> attrs;
+	attrs.push_back("EstadosBrasil.NOME_UF");
+	attrs.push_back("EstadosBrasil.CAPITAL");
+
+	// Fills the elementSet without geometries and with the 
+	// attributes NOME_UF and CAPITAL 
+	bool loadGeometries = false;
+	bool loadAllAttributes = false;
+	if(!TeSTOSetBuildDB(&steSet, loadGeometries, loadAllAttributes, attrs))
+	{
+		cout << "Error! " << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Prints the number of elements of the elementSet
+	cout << "Number of elements: " << steSet.numElements() << endl;
+
+	//Traverse all instances of the set using iterator
+	TeSTElementSet::iterator it = steSet.begin();
+	while ( it != steSet.end())
+	{
+		TeSTInstance st = (*it);
+
+		string desc;
+		// returns the attributes
+		TePropertyVector vectp = st.getPropertyVector();
+
+		cout << "Id: " << st.objectId() << " ---------------- " << endl;
+		for (unsigned int i=0; i<vectp.size(); i++)
+		{
+			cout << vectp[i].attr_.rep_.name_ << "  =  ";
+			cout << vectp[i].value_ << endl;
+		}
+		cout << endl;
+		++it;
+	}
+
+	db->close();
+	cout << endl << "Press Enter\n";
+	getchar();
+	return 0;
+}
diff --git a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.dsp b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.dsp
old mode 100755
new mode 100644
index 878e4c4..4fd615b
--- a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.dsp
+++ b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="createSTElementSetFromLayer" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=createSTElementSetFromLayer - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "createSTElementSetFromLayer.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "createSTElementSetFromLayer.mak" CFG="createSTElementSetFromLayer - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "createSTElementSetFromLayer - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "createSTElementSetFromLayer - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "createSTElementSetFromLayer - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createSTElementSetFromLayer.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "createSTElementSetFromLayer - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createSTElementSetFromLayer.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "createSTElementSetFromLayer - Win32 Release"
-# Name "createSTElementSetFromLayer - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\createSTElementSetFromLayer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="createSTElementSetFromLayer" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=createSTElementSetFromLayer - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "createSTElementSetFromLayer.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "createSTElementSetFromLayer.mak" CFG="createSTElementSetFromLayer - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "createSTElementSetFromLayer - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "createSTElementSetFromLayer - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "createSTElementSetFromLayer - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createSTElementSetFromLayer.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "createSTElementSetFromLayer - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createSTElementSetFromLayer.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "createSTElementSetFromLayer - Win32 Release"
+# Name "createSTElementSetFromLayer - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\createSTElementSetFromLayer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.dsw b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.dsw
old mode 100755
new mode 100644
index bee2f9f..007b246
--- a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.dsw
+++ b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "createSTElementSetFromLayer"=.\createSTElementSetFromLayer.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "createSTElementSetFromLayer"=.\createSTElementSetFromLayer.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.pro b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.pro
old mode 100755
new mode 100644
index 207cf2a..2ed71f4
--- a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.pro
+++ b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.pro
@@ -1,10 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	createSTElementSetFromLayer.cpp \
-	../../src/terralib/drivers/shapelib/TeDriverSHPDBF.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp 
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-
+include( ../base/base.pro )
+
+LIBS += -lte_shapelib
+
+SOURCES	+= \
+	createSTElementSetFromLayer.cpp 
+
diff --git a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.sln b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.sln
old mode 100755
new mode 100644
diff --git a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.vcproj b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.vcproj
old mode 100755
new mode 100644
index 7d319f4..5888a67
--- a/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.vcproj
+++ b/examples/createSTElementSetFromLayer/createSTElementSetFromLayer.vcproj
@@ -1,206 +1,177 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="createSTElementSetFromLayer"
-	ProjectGUID="{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}"
-	SccProjectName=""
-	SccLocalPath="">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\shapelib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				PrecompiledHeaderFile=".\Release/createSTElementSetFromLayer.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="../Release/createSTElementSetFromLayer.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				ProgramDatabaseFile=".\Release/createSTElementSetFromLayer.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Release/createSTElementSetFromLayer.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\terralib\drivers\shapelib;..\..\src\shapelib"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				PrecompiledHeaderFile=".\Debug/createSTElementSetFromLayer.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Debug/createSTElementSetFromLayer.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=".\Debug/createSTElementSetFromLayer.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Debug/createSTElementSetFromLayer.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="createSTElementSetFromLayer.cpp">
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\shapelib\TeImportDBF.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\shapelib\TeImportSHP.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="createSTElementSetFromLayer"
+	ProjectGUID="{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\shapelib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/createSTElementSetFromLayer.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../Release/te_shapelib/te_shapelib.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/createSTElementSetFromLayer.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/createSTElementSetFromLayer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/createSTElementSetFromLayer.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\terralib\drivers\shapelib;..\..\src\shapelib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/createSTElementSetFromLayer.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../Debug/te_shapelib/te_shapelib.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/createSTElementSetFromLayer.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/createSTElementSetFromLayer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/createSTElementSetFromLayer.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="createSTElementSetFromLayer.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/createSTElementSetFromShapeFile/.cdtproject b/examples/createSTElementSetFromShapeFile/.cdtproject
new file mode 100644
index 0000000..6a7b054
--- /dev/null
+++ b/examples/createSTElementSetFromShapeFile/.cdtproject
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/createSTElementSetFromShapeFile/.project b/examples/createSTElementSetFromShapeFile/.project
new file mode 100644
index 0000000..43a0561
--- /dev/null
+++ b/examples/createSTElementSetFromShapeFile/.project
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>createSTElementSetFromShapeFile</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/createSTElementSetFromShapeFile/Makefile b/examples/createSTElementSetFromShapeFile/Makefile
new file mode 100644
index 0000000..5b8ea6e
--- /dev/null
+++ b/examples/createSTElementSetFromShapeFile/Makefile
@@ -0,0 +1,17 @@
+all: createSTElementSetFromShapeFile
+
+shapelib:
+	cd ../../terralibx/shapelib; make
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+createSTElementSetFromShapeFile: shapelib terralib
+	qmake -o makeCreateSTElementSetFromShapeFile createSTElementSetFromShapeFile.pro; make -f makeCreateSTElementSetFromShapeFile
+
+clean:
+	if \
+		test -f makeCreateSTElementSetFromShapeFile; \
+	then \
+		make -f makeCreateSTElementSetFromShapeFile distclean; rm -f makeCreateSTElementSetFromShapeFile; \
+	fi
\ No newline at end of file
diff --git a/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.cpp b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.cpp
new file mode 100644
index 0000000..f39020b
--- /dev/null
+++ b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.cpp
@@ -0,0 +1,91 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+   This file illustrates an example of how to create a new Spatial Temporal Element 
+   Set (STElementSet) from a shapefile. 
+
+   Author: Karine Reis Ferreira 
+*/
+
+
+#include <TeSTElementSet.h>
+#include <TeSTEFunctionsSHP.h>
+
+int
+main()
+{
+	
+	// shape file name with its path 
+	string filename = "../../examples/data/EstadosBrasil.shp";
+	
+	TeSTElementSet  steSet;
+
+	// fills the element set from shape file
+	if (!TeSTOSetBuildSHP(steSet,filename))
+	{
+		cout << "Erro\n";
+		return 1;
+	}
+	
+	// prints the number of elements of the element set
+	cout << "Number of elements: " << steSet.numElements() << endl;
+
+	TeSTElementSet::iterator it = steSet.begin();
+	while ( it != steSet.end())
+	{
+		TeSTInstance st = (*it);
+
+		string desc;
+		// returns the attributes
+		TePropertyVector vectp = st.getPropertyVector();
+
+		cout << "Id: " << st.objectId() << "\nProperties:\n "; 
+		for (unsigned int i=0; i<vectp.size(); i++)
+		{
+			cout << vectp[i].attr_.rep_.name_ << "  =  ";
+			cout << vectp[i].value_ << endl;
+		}
+
+		if (st.hasPolygons())
+		{
+			const TePolygonSet& ps = st.getPolygons();
+			cout << "Geometry of " << ps.size() << " polygon(s).\n";
+		}
+		if (st.hasLines())
+		{
+			const TeLineSet& ls = st.getLines();
+			cout << "Geometry of " << ls.size() << " line(s).\n";
+		}
+		if (st.hasPoints())
+		{
+			const TePointSet& pts = st.getPoints();
+			cout << "Geometry of " << pts.size() << " point(s).\n";
+		}
+		cout << endl;
+		++it;
+	}
+	cout << "End\n";
+	cout.flush();
+	getchar();
+	return 0;
+}
diff --git a/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.dsp b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.dsp
new file mode 100644
index 0000000..3e7e86e
--- /dev/null
+++ b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.dsp
@@ -0,0 +1,130 @@
+# Microsoft Developer Studio Project File - Name="createSTElementSetFromShapeFile" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=createSTElementSetFromShapeFile - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "createSTElementSetFromShapeFile.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "createSTElementSetFromShapeFile.mak" CFG="createSTElementSetFromShapeFile - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "createSTElementSetFromShapeFile - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "createSTElementSetFromShapeFile - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "createSTElementSetFromShapeFile - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createSTElementSetFromShapeFile.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "createSTElementSetFromShapeFile - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createSTE [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "createSTElementSetFromShapeFile - Win32 Release"
+# Name "createSTElementSetFromShapeFile - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\createSTElementSetFromShapeFile.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportDBF.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeSTEFunctionsSHP.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportExport.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeSTEFunctionsSHP.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.dsw b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.dsw
new file mode 100644
index 0000000..72c34fa
--- /dev/null
+++ b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.dsw
@@ -0,0 +1,65 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "createSTElementSetFromShapeFile"=.\createSTElementSetFromShapeFile.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name shapelib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "shapelib"=..\..\terralibw\shapelib\shapelib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name shapelib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.pro b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.pro
new file mode 100644
index 0000000..60d156b
--- /dev/null
+++ b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.pro
@@ -0,0 +1,8 @@
+TARGET = createSTElementSetFromShapeFile
+
+include( ../base/base.pro )
+
+LIBS += -lte_shapelib
+
+SOURCES	+= \
+	createSTElementSetFromShapeFile.cpp
diff --git a/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.vcproj b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.vcproj
new file mode 100644
index 0000000..7e5272d
--- /dev/null
+++ b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapeFile.vcproj
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="createSTElementSetFromShapeFile"
+	ProjectGUID="{8A50877F-C2AD-42EB-962E-D22682C99294}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release"
+			IntermediateDirectory="..\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\terralib\drivers\shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/createSTElementSetFromShapeFile.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
+				OutputFile="../Release/createSTElementSetFromShapeFile.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/createSTElementSetFromShapeFile.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/createSTElementSetFromShapeFile.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug"
+			IntermediateDirectory="..\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib;..\..\src\terralib\drivers\shapelib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/createSTElementSetFromShapeFile.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
+				OutputFile="../Debug/createSTElementSetFromShapeFile.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/createSTElementSetFromShapeFile.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/createSTElementSetFromShapeFile.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="createSTElementSetFromShapeFile.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\terralib\drivers\shapelib\TeImportDBF.cpp">
+			</File>
+			<File
+				RelativePath="..\..\src\terralib\drivers\shapelib\TeImportSHP.cpp">
+			</File>
+			<File
+				RelativePath="..\..\src\terralib\drivers\shapelib\TeQuerierSHP.cpp">
+			</File>
+			<File
+				RelativePath="..\..\src\terralib\drivers\shapelib\TeSTEFunctionsSHP.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="..\..\src\terralib\drivers\shapelib\TeQuerierSHP.h">
+			</File>
+			<File
+				RelativePath="..\..\src\terralib\drivers\shapelib\TeSTEFunctionsSHP.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapefile.sln b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapefile.sln
new file mode 100644
index 0000000..ed1dbfa
--- /dev/null
+++ b/examples/createSTElementSetFromShapeFile/createSTElementSetFromShapefile.sln
@@ -0,0 +1,48 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createSTElementSetFromShapeFile", "createSTElementSetFromShapeFile.vcproj", "{9105022E-2AF0-4CFA-9DCE-572645B92D99}"
+	ProjectSection(ProjectDependencies) = postProject
+		{64902697-D930-4419-B7B2-FAB55E65A9B3} = {64902697-D930-4419-B7B2-FAB55E65A9B3}
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2} = {70DF8CB8-3CDB-4040-A832-A2FDC05758C2}
+		{F0BAF3F5-B6BB-43BA-9202-71ABBED4F212} = {F0BAF3F5-B6BB-43BA-9202-71ABBED4F212}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\..\terralibw\terralib\terralib.vcproj", "{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\terralibw\tiff\tiff.vcproj", "{F0BAF3F5-B6BB-43BA-9202-71ABBED4F212}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapelib", "..\..\terralibw\shapelib\shapelib.vcproj", "{64902697-D930-4419-B7B2-FAB55E65A9B3}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{9105022E-2AF0-4CFA-9DCE-572645B92D99}.Debug.ActiveCfg = Debug|Win32
+		{9105022E-2AF0-4CFA-9DCE-572645B92D99}.Debug.Build.0 = Debug|Win32
+		{9105022E-2AF0-4CFA-9DCE-572645B92D99}.Release.ActiveCfg = Release|Win32
+		{9105022E-2AF0-4CFA-9DCE-572645B92D99}.Release.Build.0 = Release|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.ActiveCfg = Debug|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.Build.0 = Debug|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.ActiveCfg = Release|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.Build.0 = Release|Win32
+		{F0BAF3F5-B6BB-43BA-9202-71ABBED4F212}.Debug.ActiveCfg = Debug|Win32
+		{F0BAF3F5-B6BB-43BA-9202-71ABBED4F212}.Debug.Build.0 = Debug|Win32
+		{F0BAF3F5-B6BB-43BA-9202-71ABBED4F212}.Release.ActiveCfg = Release|Win32
+		{F0BAF3F5-B6BB-43BA-9202-71ABBED4F212}.Release.Build.0 = Release|Win32
+		{64902697-D930-4419-B7B2-FAB55E65A9B3}.Debug.ActiveCfg = Debug|Win32
+		{64902697-D930-4419-B7B2-FAB55E65A9B3}.Debug.Build.0 = Debug|Win32
+		{64902697-D930-4419-B7B2-FAB55E65A9B3}.Release.ActiveCfg = Release|Win32
+		{64902697-D930-4419-B7B2-FAB55E65A9B3}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/createSTElementSetFromTheme/.cdtproject b/examples/createSTElementSetFromTheme/.cdtproject
new file mode 100644
index 0000000..6a7b054
--- /dev/null
+++ b/examples/createSTElementSetFromTheme/.cdtproject
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/createSTElementSetFromTheme/.project b/examples/createSTElementSetFromTheme/.project
new file mode 100644
index 0000000..3b19ebe
--- /dev/null
+++ b/examples/createSTElementSetFromTheme/.project
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>createSTElementSetFromTheme</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/createSTElementSetFromTheme/Makefile b/examples/createSTElementSetFromTheme/Makefile
new file mode 100644
index 0000000..5fc280d
--- /dev/null
+++ b/examples/createSTElementSetFromTheme/Makefile
@@ -0,0 +1,14 @@
+all: createSTElementSetFromTheme
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+createSTElementSetFromTheme: terralib
+	qmake -o makeCreateSTElementSetFromTheme createSTElementSetFromTheme.pro; make -f makeCreateSTElementSetFromTheme
+
+clean:
+	if \
+		test -f makeCreateSTElementSetFromTheme; \
+	then \
+		make -f makeCreateSTElementSetFromTheme distclean; rm -f makeCreateSTElementSetFromTheme; \
+	fi
\ No newline at end of file
diff --git a/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.cpp b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.cpp
new file mode 100644
index 0000000..1b70733
--- /dev/null
+++ b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.cpp
@@ -0,0 +1,144 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+   This file illustrates an example of how to create a new Spatial Temporal Element 
+   Set (STElementSet) from a theme. A Spatial Temporal Element Set can be created 
+   from a layer or from a theme.
+   This example creates a theme with spatial and attribute restrictions and fills 
+   a STElementSet from this created theme with all attributes and geometries.
+
+   Author: Karine Reis   
+*/
+
+#include <TeSTElementSet.h>
+#include <TeSTEFunctionsDB.h>
+#include <TeMySQL.h>
+
+int main()
+{	
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+	
+	// Loads the layer
+	TeLayer* bairrosPA =  new TeLayer("BairrosPoA");
+	if (!db->loadLayer(bairrosPA))
+	{
+	    cout << "Fail to load the layer!" << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+        return 1;
+	}
+
+	// Loads the geometry of Santo Antonio district (id = 48)
+	TePolygonSet ps;
+	bairrosPA->loadGeometrySet("48", ps);
+		
+	// Loads a layer named OcorrenciaPoA 
+	TeLayer* OcorrenciaPoA =  new TeLayer("OcorrenciasPoA");
+	if (!db->loadLayer(OcorrenciaPoA))
+	{
+	    cout << "Fail to load the layer!" << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+        return 1;
+	}
+
+	// Create a theme with retrictions from Ocorrencias layer, in memory
+	TeTheme* Ocorrencias = new TeTheme("Ocorrencias", OcorrenciaPoA);
+	TeAttrTableVector attrTables;
+	OcorrenciaPoA->getAttrTables(attrTables);
+	Ocorrencias->setAttTables(attrTables);
+	
+	//spatial restriction: within Santo Antonio district
+	Ocorrencias->setSpatialRest (&ps, TePOINTS, TeWITHIN);
+	//attribute restriction: type "amea�a"
+	Ocorrencias->attributeRest(" EVENTO = 'Amea�a' ");
+
+	// Creates a elementSet from theme 
+	TeSTElementSet  steSet(Ocorrencias);
+
+	// Builds the elementSet with geometries and all attributes	
+	bool loadGeometries = true;
+	bool loadAllAttributes = true;
+	vector<string>  attrs;
+	if(!TeSTOSetBuildDB(&steSet, loadGeometries, loadAllAttributes, attrs))
+	{
+		cout << "Error! " << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	
+	// Shows how many elements the elementSet has
+	cout << "Number of elements: " <<  steSet.numElements() << endl;
+
+	// Traverse all instances using iterator 
+	TeSTElementSet::iterator it = steSet.begin();
+	while ( it != steSet.end())
+	{
+		TeSTInstance st = (*it);
+
+		//Gets attribute value
+		string event;
+		st.getPropertyValue("EVENTO", event);
+		
+		cout << " Object Identifier :  " << st.objectId() << endl; 
+		cout << " Event	  :  " << event  << endl ; 
+				
+		//Gets geometry
+		if(st.hasPoints())
+		{
+			TePointSet pset;
+			st.getGeometry (pset);
+			cout<< "     point id: "<< pset[0].objectId ()	 << endl;
+			for(unsigned int j=0; j<pset.size (); ++j)
+			{
+				string point =  Te2String(pset[j].location().x(), 7) +";"+  Te2String(pset[j].location().y(), 7);
+				cout<< "		point: " << " ("+ point + ") " <<endl << endl;
+			}
+		}
+		++it;
+	}
+
+	db->close();
+	cout << endl << "Press Enter\n";
+	getchar();
+	return 0;
+}
diff --git a/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.dsp b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.dsp
new file mode 100644
index 0000000..c7a188b
--- /dev/null
+++ b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="createSTElementSetFromTheme" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=createSTElementSetFromTheme - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "createSTElementSetFromTheme.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "createSTElementSetFromTheme.mak" CFG="createSTElementSetFromTheme - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "createSTElementSetFromTheme - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "createSTElementSetFromTheme - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "createSTElementSetFromTheme - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createSTElementSetFromTheme.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "createSTElementSetFromTheme - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createSTElementSetFromTheme.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "createSTElementSetFromTheme - Win32 Release"
+# Name "createSTElementSetFromTheme - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\createSTElementSetFromTheme.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.dsw b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.dsw
new file mode 100644
index 0000000..f72c181
--- /dev/null
+++ b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.dsw
@@ -0,0 +1,47 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "createSTElementSetFromTheme"=.\createSTElementSetFromTheme.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.pro b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.pro
new file mode 100644
index 0000000..6a1a2eb
--- /dev/null
+++ b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.pro
@@ -0,0 +1,8 @@
+TARGET = createSTElementSetFromTheme
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	createSTElementSetFromTheme.cpp 
+
+
diff --git a/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.sln b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.sln
new file mode 100644
index 0000000..53f4ba9
--- /dev/null
+++ b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.sln
@@ -0,0 +1,45 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createSTElementSetFromTheme", "createSTElementSetFromTheme.vcproj", "{9105022E-2AF0-4CFA-9DCE-572645B92D99}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\..\terralibw\terralib\terralib.vcproj", "{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\terralibw\tiff\tiff.vcproj", "{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\..\terralibw\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{9105022E-2AF0-4CFA-9DCE-572645B92D99}.Debug.ActiveCfg = Debug|Win32
+		{9105022E-2AF0-4CFA-9DCE-572645B92D99}.Debug.Build.0 = Debug|Win32
+		{9105022E-2AF0-4CFA-9DCE-572645B92D99}.Release.ActiveCfg = Release|Win32
+		{9105022E-2AF0-4CFA-9DCE-572645B92D99}.Release.Build.0 = Release|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.ActiveCfg = Debug|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.Build.0 = Debug|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.ActiveCfg = Release|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.Build.0 = Release|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.ActiveCfg = Debug|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.Build.0 = Debug|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.ActiveCfg = Release|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.Build.0 = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.vcproj b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.vcproj
new file mode 100644
index 0000000..02ab03b
--- /dev/null
+++ b/examples/createSTElementSetFromTheme/createSTElementSetFromTheme.vcproj
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="createSTElementSetFromTheme"
+	ProjectGUID="{1BB59FDE-040E-4273-A0E1-2826608FFB95}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/createSTElementSetFromTheme.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/createSTElementSetFromTheme.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/createSTElementSetFromTheme.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/createSTElementSetFromTheme.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/createSTElementSetFromTheme.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/createSTElementSetFromTheme.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/createSTElementSetFromTheme.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/createSTElementSetFromTheme.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="createSTElementSetFromTheme.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/createTIN/.cvsignore b/examples/createTIN/.cvsignore
new file mode 100644
index 0000000..51a7891
--- /dev/null
+++ b/examples/createTIN/.cvsignore
@@ -0,0 +1,13 @@
+*.bak
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/createTIN/Makefile b/examples/createTIN/Makefile
new file mode 100644
index 0000000..a74f861
--- /dev/null
+++ b/examples/createTIN/Makefile
@@ -0,0 +1,14 @@
+all: createTIN
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+convertCoordinates: terralib
+	qmake -o createTIN createTIN.pro; make -f createTIN
+
+clean:
+	if \
+		test -f createTIN; \
+	then \
+		make -f createTIN distclean; rm -f createTIN; \
+	fi
\ No newline at end of file
diff --git a/examples/createTIN/createTIN.cpp b/examples/createTIN/createTIN.cpp
new file mode 100644
index 0000000..7d62d84
--- /dev/null
+++ b/examples/createTIN/createTIN.cpp
@@ -0,0 +1,173 @@
+// TestAkima.cpp : Defines the entry point for the console application.
+//
+
+#include <iostream>
+#include <fstream>
+
+#include "TeTin.h"
+#include "TeAsciiFile.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeRaster.h"
+#include "TeDefines.h"
+
+//Read samples file in ASCII Spring format
+void readSamplesFromSPRFile(TeSampleSet& sampleSet, const std::string& fileName)
+{
+	TeAsciiFile	pFile (fileName);
+
+	while (pFile.isNotAtEOF())
+	{
+		std::string geoId;
+		std::string repType = pFile.readString ();
+		pFile.findNewLine();
+		if (repType == "POINT3D")
+		{
+			geoId = pFile.readString ();
+			while ( pFile.isNotAtEOF() && geoId != "END" )
+			{
+				double x = atof ( geoId.c_str() );
+				geoId = pFile.readString ();
+				if ( pFile.isNotAtEOF() && geoId != "END" )
+				{
+					double y = atof ( geoId.c_str() );
+					geoId = pFile.readString ();
+					if ( pFile.isNotAtEOF() && geoId != "END" )
+					{
+						double z = atof ( geoId.c_str() );
+						sampleSet.add ( TeSample(TeCoord2D(x, y), z) );
+						geoId = pFile.readString ();
+					}
+				}
+			}
+		}
+	}
+}
+
+//Read contour lines file in ASCII Spring format
+void readContoursFromSPRFile (TeContourLineSet& contourSet, const std::string& fileName)
+{
+	TeAsciiFile	pFile (fileName);
+	//cout.precision(6);
+	while (pFile.isNotAtEOF())
+	{
+		std::string geoId;
+		std::string repType = pFile.readString ();
+		pFile.findNewLine();
+		if (repType == "LINE3D")
+		{
+			geoId = pFile.readString ();
+			if (geoId == "HEIGHT")
+			{
+				geoId = pFile.readString ();
+                double z = atof ( geoId.c_str() );
+				//cout << z << endl;
+				TeLine2D line;
+				geoId = pFile.readString ();
+				while ( pFile.isNotAtEOF() && geoId != "END" )
+				{
+					double x = atof ( geoId.c_str() );
+					geoId = pFile.readString ();
+					if ( pFile.isNotAtEOF() && geoId != "END" )
+					{
+						double y = atof ( geoId.c_str() );
+						line.add ( TeCoord2D(x, y) );
+						//cout << x << " " << y << endl;
+						geoId = pFile.readString ();
+					}
+				}
+				//TeLineSimplify(TeLine2D& ptlist, double snap, double maxdist)
+//				TeLineSimplify(line, 10, 50);
+				TeContourLine cLine (line, z);
+				contourSet.add(cLine);
+			}
+		}
+	}
+}
+
+void writeTriangleEdgesSPRFile (const std::string& name, TeTin& tin)
+{
+	fstream sprcfile;
+	sprcfile.open ( name.c_str(), ios::out );
+	sprcfile << "LINES" << "\n";
+	sprcfile << "INFO" << "\n";
+	sprcfile << "UNITS Metros" << "\n";
+	sprcfile << "INFO_END" << "\n";
+	sprcfile.precision(10);
+
+	TeTin::TeTinTriangleIterator ti;
+	for (ti = tin.triangleBegin(); ti != tin.triangleEnd(); ti++)
+	{
+		TeCoord2D pt[3];
+		tin.trianglePoints(*ti, pt[0], pt[1], pt[2]);
+		sprcfile << pt[0].x() << " " << pt[0].y() << " " << "\n";
+		sprcfile << pt[1].x() << " " << pt[1].y() << " " << "\n";
+		sprcfile << pt[2].x() << " " << pt[2].y() << " " << "\n";
+		sprcfile << pt[0].x() << " " << pt[0].y() << " " << "\n";
+		sprcfile << "END" << "\n";
+	}
+	sprcfile << "END" << "\n";
+	sprcfile.close ();
+}
+
+int main(int argc, char* argv[])
+{
+//	1. Read samples
+//	1.1 Read XYZ samples from SPRING file
+	TeSampleSet samples;
+	readSamplesFromSPRFile( samples, "..\\data\\samples.spr" );
+
+//	1.2 Read cntour lines from SPRING file
+	TeContourLineSet contours;
+	readContoursFromSPRFile( contours, "..\\data\\samples.spr"  );
+
+//	2. Create Original TIN
+	TeBox tinBox( samples.box() );
+	updateBox(tinBox, contours.box() );
+
+	TeTin tt;
+	tt.createInitialTriangles (tinBox);
+
+//	2.1. Set precision used for building TIN
+	double tol = TePrecision::instance().precision(); // Save old precision
+	double tinPrecision = tinBox.width() / 1.e6; // 1.e6th of deltaX
+	TePrecision::instance().setPrecision(tinPrecision);
+
+//	2.2. Insert samples in TIN
+	TeSampleSet::iterator si;
+	for (si = samples.begin(); si != samples.end(); si++)
+	{
+		double x = (*si).location().x();
+		double y = (*si).location().y();
+		double z = (*si).value();
+		tt.insertPoint (x, y, z);
+	}
+
+	TeContourLineSet::iterator ci;
+	for (ci = contours.begin(); ci != contours.end(); ci++)
+	{
+		TeContourLine line ( *ci );
+
+		//TeLineSimplify(TeLine2D& ptlist, double snap, double maxdist)
+		TeLineSimplify(line, tinPrecision*400., tinPrecision*2000);
+
+		double z = (*ci).value();
+		TeContourLine::iterator li;
+		for (li = line.begin(); li != line.end(); li++)
+		{
+			double x = (*li).x();
+			double y = (*li).y();
+			tt.insertPoint (x, y, z);
+		}
+	}
+
+
+//	2.3. Fix edge triangles TIN
+	tt.convexize();
+
+	writeTriangleEdgesSPRFile (string("..\\data\\tin.spr" ), tt);
+
+	TePrecision::instance().setPrecision(tol);
+
+	return 0;
+}
+
diff --git a/examples/createTIN/createTIN.pro b/examples/createTIN/createTIN.pro
new file mode 100644
index 0000000..72bd7fd
--- /dev/null
+++ b/examples/createTIN/createTIN.pro
@@ -0,0 +1,7 @@
+TARGET = createTIN
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	createTIN.cpp 
+
diff --git a/examples/createTIN/createTIN.sln b/examples/createTIN/createTIN.sln
new file mode 100644
index 0000000..24db5f8
--- /dev/null
+++ b/examples/createTIN/createTIN.sln
@@ -0,0 +1,49 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\..\terralibw\terralib\terralib.vcproj", "{99BC87CA-140D-4A99-803C-DF078430A6C8}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E} = {5E26C3A1-28D3-40FA-A3F5-115180C98E0E}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\..\terralibw\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\terralibw\tiff\tiff.vcproj", "{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createTIN", "createTIN.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectDependencies) = postSolution
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Debug.ActiveCfg = Debug|Win32
+		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Debug.Build.0 = Debug|Win32
+		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Release.ActiveCfg = Release|Win32
+		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Release.Build.0 = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.ActiveCfg = Debug|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.Build.0 = Debug|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.ActiveCfg = Release|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/createTIN/createTIN.vcproj b/examples/createTIN/createTIN.vcproj
new file mode 100644
index 0000000..5f7b0d3
--- /dev/null
+++ b/examples/createTIN/createTIN.vcproj
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="createTIN"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\createTIN.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\createTIN.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="createTIN.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/createTable/.cdtproject b/examples/createTable/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/createTable/.cdtproject
+++ b/examples/createTable/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/createTable/.project b/examples/createTable/.project
old mode 100755
new mode 100644
index 5c5761f..14387a4
--- a/examples/createTable/.project
+++ b/examples/createTable/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>createTable</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>createTable</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/createTable/Makefile b/examples/createTable/Makefile
old mode 100755
new mode 100644
index 7662135..79228cc
--- a/examples/createTable/Makefile
+++ b/examples/createTable/Makefile
@@ -1,29 +1,29 @@
-all: createTable
-
-debug: createTable_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-createTable:  terralib 
-	qmake -o makeCreateTable createTable.pro; make -f makeCreateTable
-
-createTable_dbg: terralib_dbg
-	qmake -o makeCreateTable.debug createTable.pro TE_PROJECT_TYPE=DEBUG; make -f makeCreateTable.debug
-
-clean:
-	if \
-		test -f makeCreateTable; \
-	then \
-		make -f makeCreateTable distclean; rm -f makeCreateTable; \
-	fi
-	
-	clean_debug:
-	if \
-		test -f makeCreateTable.debug; \
-	then \
-		make -f makeCreateTable.debug distclean; rm -f makeCreateTable.debug; \
-	fi
+all: createTable
+
+debug: createTable_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+createTable:  terralib 
+	qmake -o makeCreateTable createTable.pro; make -f makeCreateTable
+
+createTable_dbg: terralib_dbg
+	qmake -o makeCreateTable.debug createTable.pro TE_PROJECT_TYPE=DEBUG; make -f makeCreateTable.debug
+
+clean:
+	if \
+		test -f makeCreateTable; \
+	then \
+		make -f makeCreateTable distclean; rm -f makeCreateTable; \
+	fi
+	
+	clean_debug:
+	if \
+		test -f makeCreateTable.debug; \
+	then \
+		make -f makeCreateTable.debug distclean; rm -f makeCreateTable.debug; \
+	fi
diff --git a/examples/createTable/createTable.cpp b/examples/createTable/createTable.cpp
old mode 100755
new mode 100644
index dea9266..560cd65
--- a/examples/createTable/createTable.cpp
+++ b/examples/createTable/createTable.cpp
@@ -1,211 +1,211 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/* 
-	This file illustrates how to execute some operations relative to attribute tables
-	in a MySQL TerraLib database:
-	 - how to create an attribute table;
-	 - how to add some columns;
-	 - how to insert same data into it;
-	 - how to retrieve some rows using an SQL.
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeTable.h>
-#include <TeMySQL.h>
-
-int main()
-{
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to the DB320RC1 MySQL database 
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
-
-	// Create a table called "TesteTable"
-	string tableName = "TesteTable";
-	if (db->tableExist(tableName))
-	{
-		cout << "There is already a table named \"TesteTable\" in the TerraLib database!\n";
-		cout << "Some data will be retrieved from the table already created:\n\n";
-	}
-	else
-	{
-		// 1) Create a table
-
-		TeAttributeList attList;	
-		TeAttribute at;
-		at.rep_.name_= "IntCol";	
-		at.rep_.type_ = TeINT;	
-		at.rep_.isPrimaryKey_ = true;
-
-		attList.push_back(at);
-
-		if (!db->createTable(tableName, attList))
-		{
-			cout << "Fail to create the table: " << db->errorMessage() << endl;
-			db->close();
-			cout << endl << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-
-		//2)  Add new columns to the table
-
-		TeAttribute atr;
-		atr.rep_.name_= "TimeCol";
-		atr.rep_.type_ = TeDATETIME;
-		atr.dateTimeFormat_ = "DDsMMsYYYYsHHsmmsSS";
-		atr.dateChronon_ = TeSECOND;
-		atr.timeSeparator_ = ":";
-		atr.dateSeparator_ = "/";
-		attList.push_back(atr);
-
-		if (!db->addColumn(tableName, atr.rep_))
-		{
-			cout << "Fail to add the column \"TimeCol\" to the table: " << db->errorMessage() << endl;
-			db->close();
-			cout << endl << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-
-		atr.rep_.name_= "RealCol";
-		atr.rep_.type_ = TeREAL;
-		atr.rep_.numChar_ = 15;
-		atr.rep_.decimals_ = 4;
-		attList.push_back(atr);
-
-		if (!db->addColumn(tableName, atr.rep_))
-		{
-			cout << "Fail to add the column \"RealCol\" to the table: " << db->errorMessage() << endl;
-			db->close();
-			cout << endl << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-
-		atr.rep_.name_= "StringCol";
-		atr.rep_.type_ = TeSTRING;
-		atr.rep_.numChar_ = 10;
-		attList.push_back(atr);
-
-		if (!db->addColumn(tableName, atr.rep_))
-		{
-			cout << "Fail to add the column \"StringCol\" to the table: " << db->errorMessage() << endl;
-			db->close();
-			cout << endl << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-		
-		//3) Add two new rows to the table 
-
-		TeTable table(tableName, attList, "");		// creates a table in memory
-
-		TeTableRow row1;							// fill some rows
-		row1.push_back("1");
-		row1.push_back("25/4/2003 07:14");
-		row1.push_back("15.23");
-		row1.push_back("object1");
-		table.add(row1);
-
-		TeTableRow row2;
-		row2.push_back("2");
-		row2.push_back("01/03/1975 21:30:15");
-		row2.push_back("56.87");
-		row2.push_back("object2");
-		table.add(row2);
-
-		if (!db->insertTable(table))				// save the table into the database
-		{
-			cout << "Fail to save the table: " << db->errorMessage() << endl;
-			db->close();
-			cout << endl << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-	}
-
-	//	4) Retrieve some data from the table using a SQL query 
-	TeDatabasePortal* portal = db->getPortal();
-	if (!portal)
-	{
-		cout << "Fail to get a portal fom the database: " << db->errorMessage() << endl;
-		db->close();
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	string sql = "SELECT * FROM " + tableName;
-
-	if (portal->query(sql) == false)
-	{
-		cout << "Fail to submit the query: " << db->errorMessage() << endl;
-		delete portal;
-		db->close();
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Retrieve the attributes from the table
-	int count = 1;
-	while (portal->fetchRow())
-	{
-		cout << "Row : " << count << endl;
-		int intAttribute = atoi(portal->getData(0));
-		cout << "Integer attribute: " << intAttribute << endl;
-
-		TeTime t = portal->getDate(1);
-		cout << "Time attribute: " ;
-		cout << t.getDateTime("DDsMMsYYYYsHHsmmsSS") << " or " << t.getDateTime("YYYYsMMsDDsHHsmmsSS") << endl;
-
-		cout << "Double attribute: " ;
-		double d = portal->getDouble(2);
-		cout << d << endl;
-
-		cout << "String attribute: ";
-		string x = portal->getData(3);
-		cout << x << endl << endl;
-		count++;
-	}
-
-	delete portal;
-	db->close();
-	cout << endl << "Press Enter\n";
-	getchar();
-	return 0;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+	This file illustrates how to execute some operations relative to attribute tables
+	in a MySQL TerraLib database:
+	 - how to create an attribute table;
+	 - how to add some columns;
+	 - how to insert same data into it;
+	 - how to retrieve some rows using an SQL.
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeTable.h>
+#include <TeMySQL.h>
+
+int main()
+{
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+
+	// Create a table called "TesteTable"
+	string tableName = "TesteTable";
+	if (db->tableExist(tableName))
+	{
+		cout << "There is already a table named \"TesteTable\" in the TerraLib database!\n";
+		cout << "Some data will be retrieved from the table already created:\n\n";
+	}
+	else
+	{
+		// 1) Create a table
+
+		TeAttributeList attList;	
+		TeAttribute at;
+		at.rep_.name_= "IntCol";	
+		at.rep_.type_ = TeINT;	
+		at.rep_.isPrimaryKey_ = true;
+
+		attList.push_back(at);
+
+		if (!db->createTable(tableName, attList))
+		{
+			cout << "Fail to create the table: " << db->errorMessage() << endl;
+			db->close();
+			cout << endl << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+
+		//2)  Add new columns to the table
+
+		TeAttribute atr;
+		atr.rep_.name_= "TimeCol";
+		atr.rep_.type_ = TeDATETIME;
+		atr.dateTimeFormat_ = "DDsMMsYYYYsHHsmmsSS";
+		atr.dateChronon_ = TeSECOND;
+		atr.timeSeparator_ = ":";
+		atr.dateSeparator_ = "/";
+		attList.push_back(atr);
+
+		if (!db->addColumn(tableName, atr.rep_))
+		{
+			cout << "Fail to add the column \"TimeCol\" to the table: " << db->errorMessage() << endl;
+			db->close();
+			cout << endl << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+
+		atr.rep_.name_= "RealCol";
+		atr.rep_.type_ = TeREAL;
+		atr.rep_.numChar_ = 15;
+		atr.rep_.decimals_ = 4;
+		attList.push_back(atr);
+
+		if (!db->addColumn(tableName, atr.rep_))
+		{
+			cout << "Fail to add the column \"RealCol\" to the table: " << db->errorMessage() << endl;
+			db->close();
+			cout << endl << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+
+		atr.rep_.name_= "StringCol";
+		atr.rep_.type_ = TeSTRING;
+		atr.rep_.numChar_ = 10;
+		attList.push_back(atr);
+
+		if (!db->addColumn(tableName, atr.rep_))
+		{
+			cout << "Fail to add the column \"StringCol\" to the table: " << db->errorMessage() << endl;
+			db->close();
+			cout << endl << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+		
+		//3) Add two new rows to the table 
+
+		TeTable table(tableName, attList, "");		// creates a table in memory
+
+		TeTableRow row1;							// fill some rows
+		row1.push_back("1");
+		row1.push_back("25/4/2003 07:14");
+		row1.push_back("15.23");
+		row1.push_back("object1");
+		table.add(row1);
+
+		TeTableRow row2;
+		row2.push_back("2");
+		row2.push_back("01/03/1975 21:30:15");
+		row2.push_back("56.87");
+		row2.push_back("object2");
+		table.add(row2);
+
+		if (!db->insertTable(table))				// save the table into the database
+		{
+			cout << "Fail to save the table: " << db->errorMessage() << endl;
+			db->close();
+			cout << endl << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+	}
+
+	//	4) Retrieve some data from the table using a SQL query 
+	TeDatabasePortal* portal = db->getPortal();
+	if (!portal)
+	{
+		cout << "Fail to get a portal fom the database: " << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	string sql = "SELECT * FROM " + tableName;
+
+	if (portal->query(sql) == false)
+	{
+		cout << "Fail to submit the query: " << db->errorMessage() << endl;
+		delete portal;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Retrieve the attributes from the table
+	int count = 1;
+	while (portal->fetchRow())
+	{
+		cout << "Row : " << count << endl;
+		int intAttribute = atoi(portal->getData(0));
+		cout << "Integer attribute: " << intAttribute << endl;
+
+		TeTime t = portal->getDate(1);
+		cout << "Time attribute: " ;
+		cout << t.getDateTime("DDsMMsYYYYsHHsmmsSS") << " or " << t.getDateTime("YYYYsMMsDDsHHsmmsSS") << endl;
+
+		cout << "Double attribute: " ;
+		double d = portal->getDouble(2);
+		cout << d << endl;
+
+		cout << "String attribute: ";
+		string x = portal->getData(3);
+		cout << x << endl << endl;
+		count++;
+	}
+
+	delete portal;
+	db->close();
+	cout << endl << "Press Enter\n";
+	getchar();
+	return 0;
+}
diff --git a/examples/createTable/createTable.dsp b/examples/createTable/createTable.dsp
old mode 100755
new mode 100644
index 3f8ac08..b334c24
--- a/examples/createTable/createTable.dsp
+++ b/examples/createTable/createTable.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="createTable" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=createTable - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "createTable.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "createTable.mak" CFG="createTable - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "createTable - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "createTable - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "createTable - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createTable.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "createTable - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createTable.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "createTable - Win32 Release"
-# Name "createTable - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\createTable.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="createTable" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=createTable - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "createTable.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "createTable.mak" CFG="createTable - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "createTable - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "createTable - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "createTable - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createTable.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "createTable - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createTable.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "createTable - Win32 Release"
+# Name "createTable - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\createTable.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/createTable/createTable.dsw b/examples/createTable/createTable.dsw
old mode 100755
new mode 100644
index ace9880..4d4a40f
--- a/examples/createTable/createTable.dsw
+++ b/examples/createTable/createTable.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "createTable"=.\createTable.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "createTable"=.\createTable.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/createTable/createTable.pro b/examples/createTable/createTable.pro
old mode 100755
new mode 100644
index ea74e02..19b0886
--- a/examples/createTable/createTable.pro
+++ b/examples/createTable/createTable.pro
@@ -1,9 +1,6 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	createTable.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-
+TARGET = createTable
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	createTable.cpp
diff --git a/examples/createTable/createTable.sln b/examples/createTable/createTable.sln
old mode 100755
new mode 100644
diff --git a/examples/createTable/createTable.vcproj b/examples/createTable/createTable.vcproj
old mode 100755
new mode 100644
index c8ab969..57ee16c
--- a/examples/createTable/createTable.vcproj
+++ b/examples/createTable/createTable.vcproj
@@ -1,139 +1,133 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="createTable"
-	ProjectGUID="{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\createTable.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				RuntimeLibrary="2"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\createTable.exe"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath=".\createTable.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="createTable"
+	ProjectGUID="{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="."
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\createTable.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="."
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				RuntimeLibrary="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\createTable.exe"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath=".\createTable.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/createTheme/.cdtproject b/examples/createTheme/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/createTheme/.cdtproject
+++ b/examples/createTheme/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/createTheme/.project b/examples/createTheme/.project
old mode 100755
new mode 100644
index e25381a..050c54f
--- a/examples/createTheme/.project
+++ b/examples/createTheme/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>createTheme</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>createTheme</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/createTheme/Makefile b/examples/createTheme/Makefile
old mode 100755
new mode 100644
index 64bc7f2..877a039
--- a/examples/createTheme/Makefile
+++ b/examples/createTheme/Makefile
@@ -1,31 +1,31 @@
-all: createTheme
-
-debug: createTheme_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-	
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-createTheme: terralib
-	qmake -o makeCreateTheme createTheme.pro; make -f makeCreateTheme
-
-
-createTheme_dbg: terralib_dbg
-	qmake -o makeCreateTheme.debug createTheme.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeCreateTheme.debug
-
-clean:
-	if \
-		test -f makeCreateTheme; \
-	then \
-		make -f makeCreateTheme distclean; rm -f makeCreateTheme; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeCreateTheme.debug; \
-	then \
-		make -f makeCreateTheme.debug distclean; rm -f makeCreateTheme.debug; \
+all: createTheme
+
+debug: createTheme_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+	
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+createTheme: terralib
+	qmake -o makeCreateTheme createTheme.pro; make -f makeCreateTheme
+
+
+createTheme_dbg: terralib_dbg
+	qmake -o makeCreateTheme.debug createTheme.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeCreateTheme.debug
+
+clean:
+	if \
+		test -f makeCreateTheme; \
+	then \
+		make -f makeCreateTheme distclean; rm -f makeCreateTheme; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeCreateTheme.debug; \
+	then \
+		make -f makeCreateTheme.debug distclean; rm -f makeCreateTheme.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/createTheme/createTheme.cpp b/examples/createTheme/createTheme.cpp
old mode 100755
new mode 100644
index cc08e1b..6daf9c1
--- a/examples/createTheme/createTheme.cpp
+++ b/examples/createTheme/createTheme.cpp
@@ -1,198 +1,198 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file illustrates how to create themes in a TerraLib database
-
-	Authors: Karine Reis Ferreira and Lubia Vinhas  
-*/
-
-#include <TeLegendEntry.h>
-#include <TeMySQL.h>
-
-
-int main()
-{
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to the DB320RC1 MySQL database 
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
-
-	// Load the layer "Distritos" which contains data of the districts of the Sao Paulo city
-	TeLayer* dist = new TeLayer("Distritos");
-	if (!db->loadLayer(dist))
-	{
-		cout << "Fail to load the layer \"Distritos\": " << db->errorMessage() << endl;
-		db->close();
-		delete db;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	TeProjection* proj = TeProjectionFactory::make(dist->projection()->params()); 
-
-	// Create a view with the same projection of the layer
-	string viewName = "SaoPaulo";
-
-	// Check whether there is a view with this name in the datatabase
-	if (db->viewExist(viewName) == true)
-	{
-		cout << "There is already a view named \"SaoPaulo\" in the database\n";
-		db->close();
-		delete db;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	TeView* view = new TeView(viewName, user); 
-	view->projection(proj);
-	if (!db->insertView(view))		// save the view in the database
-	{
-		cout << "Fail to insert the view \"SaoPaulo\" into the database: " << db->errorMessage() << endl;
-		db->close();
-		delete db;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Create a theme that will contain all of the objects of the layer (no restrictions applied)
-	TeTheme* theme = new TeTheme("DistritosSaoPaulo", dist);
-	view->add(theme);
-		
-	// Set a default visual for the geometries of the objects of the layer 
-	// Polygons will be set with the blue color
-	TeColor color;
-	color.init(0,0,255);
-	TeVisual* polygonVisual = TeVisualFactory::make("tevisual");
-	polygonVisual->color(color); 
-
-	// Points will be set with the red color
-	color.init(255,0,0);
-	TeVisual* pointVisual = TeVisualFactory::make("tevisual");
-	pointVisual->color(color);
-   	pointVisual->style(TePtTypeX);
-
-    theme->setVisualDefault(polygonVisual, TePOLYGONS);
-    theme->setVisualDefault(pointVisual, TePOINTS);
-
-	// Set all of the geometrical representations to be visible
-	int allRep = dist->geomRep();
-	theme->visibleRep(allRep);
-
-	// Set the attribute tables of the theme equal the tables of the layer 
-	theme->setAttTables(dist->attrTables());
-
-	// Save the theme in the database
-    if (!theme->save())	
-    {
-		cout << "Fail to save the theme \"DistritosSaoPaulo\" in the database: " << db->errorMessage() << endl;
-		db->close();
-		delete db;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Build the collection of objects associated to the theme
-	if (!theme->buildCollection())
-	{
-		cout << "Fail to build the theme \"DistritosSaoPaulo\": " << db->errorMessage() << endl;
-		db->close();
-		delete db;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "The theme \"DistritosSaoPaulo\" was created without restrictions!\n";
-
-	// Create a theme with the following attribute restriction:
-	// Districts with population higher than 100,000 people
-	TeTheme* themeRest = new TeTheme("Pop91GT100000", dist);
-	themeRest->setAttTables (dist->attrTables());
-	
-	// Set the attribute restriction
-	string restAttr = " Pop91 > 100000 ";
-	themeRest->attributeRest(restAttr);
-
-	// Set all of the geometrical representations to be visible
-	themeRest->visibleRep(allRep);
-
-	TeVisual* polygonVisual2 = TeVisualFactory::make("tevisual");
-	polygonVisual2->color(color); 
-
-   	TeVisual* pointVisual2 = TeVisualFactory::make("tevisual");
-	pointVisual2->color(color);
-   	pointVisual2->style(TePtTypeX);
-
-	// Set the visual
-	themeRest->setVisualDefault(polygonVisual2, TePOLYGONS);
-	themeRest->setVisualDefault(pointVisual2, TePOINTS);
-
-	// Insert the theme into the view
-	view->add(themeRest);
-
-	// Save the theme in the database
-	if (!themeRest->save())
-    {
-		cout << "Fail to save the theme \"Pop91GT100000\" in the database: " << db->errorMessage() << endl;
-		db->close();
-		delete db;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Build the collection of objects associated to the theme
-	if (!themeRest->buildCollection())
-	{
-		cout << "Fail to build the theme \"Pop91GT100000\": " << db->errorMessage() << endl;
-		db->close();
-		delete db;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	cout << "The theme  \"Pop91GT100000\" was created with attribute restrictions!\n\n";
-	delete db;
-	cout << endl << "Press Enter\n";
-   	getchar();
-	return 0;
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file illustrates how to create themes in a TerraLib database
+
+	Authors: Karine Reis Ferreira and Lubia Vinhas  
+*/
+
+#include <TeLegendEntry.h>
+#include <TeMySQL.h>
+
+
+int main()
+{
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+
+	// Load the layer "Distritos" which contains data of the districts of the Sao Paulo city
+	TeLayer* dist = new TeLayer("Distritos");
+	if (!db->loadLayer(dist))
+	{
+		cout << "Fail to load the layer \"Distritos\": " << db->errorMessage() << endl;
+		db->close();
+		delete db;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	TeProjection* proj = TeProjectionFactory::make(dist->projection()->params()); 
+
+	// Create a view with the same projection of the layer
+	string viewName = "SaoPaulo";
+
+	// Check whether there is a view with this name in the datatabase
+	if (db->viewExist(viewName) == true)
+	{
+		cout << "There is already a view named \"SaoPaulo\" in the database\n";
+		db->close();
+		delete db;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	TeView* view = new TeView(viewName, user); 
+	view->projection(proj);
+	if (!db->insertView(view))		// save the view in the database
+	{
+		cout << "Fail to insert the view \"SaoPaulo\" into the database: " << db->errorMessage() << endl;
+		db->close();
+		delete db;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Create a theme that will contain all of the objects of the layer (no restrictions applied)
+	TeTheme* theme = new TeTheme("DistritosSaoPaulo", dist);
+	view->add(theme);
+		
+	// Set a default visual for the geometries of the objects of the layer 
+	// Polygons will be set with the blue color
+	TeColor color;
+	color.init(0,0,255);
+	TeVisual* polygonVisual = TeVisualFactory::make("tevisual");
+	polygonVisual->color(color); 
+
+	// Points will be set with the red color
+	color.init(255,0,0);
+	TeVisual* pointVisual = TeVisualFactory::make("tevisual");
+	pointVisual->color(color);
+   	pointVisual->style(TePtTypeX);
+
+    theme->setVisualDefault(polygonVisual, TePOLYGONS);
+    theme->setVisualDefault(pointVisual, TePOINTS);
+
+	// Set all of the geometrical representations to be visible
+	int allRep = dist->geomRep();
+	theme->visibleRep(allRep);
+
+	// Set the attribute tables of the theme equal the tables of the layer 
+	theme->setAttTables(dist->attrTables());
+
+	// Save the theme in the database
+    if (!theme->save())	
+    {
+		cout << "Fail to save the theme \"DistritosSaoPaulo\" in the database: " << db->errorMessage() << endl;
+		db->close();
+		delete db;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Build the collection of objects associated to the theme
+	if (!theme->buildCollection())
+	{
+		cout << "Fail to build the theme \"DistritosSaoPaulo\": " << db->errorMessage() << endl;
+		db->close();
+		delete db;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "The theme \"DistritosSaoPaulo\" was created without restrictions!\n";
+
+	// Create a theme with the following attribute restriction:
+	// Districts with population higher than 100,000 people
+	TeTheme* themeRest = new TeTheme("Pop91GT100000", dist);
+	themeRest->setAttTables (dist->attrTables());
+	
+	// Set the attribute restriction
+	string restAttr = " Pop91 > 100000 ";
+	themeRest->attributeRest(restAttr);
+
+	// Set all of the geometrical representations to be visible
+	themeRest->visibleRep(allRep);
+
+	TeVisual* polygonVisual2 = TeVisualFactory::make("tevisual");
+	polygonVisual2->color(color); 
+
+   	TeVisual* pointVisual2 = TeVisualFactory::make("tevisual");
+	pointVisual2->color(color);
+   	pointVisual2->style(TePtTypeX);
+
+	// Set the visual
+	themeRest->setVisualDefault(polygonVisual2, TePOLYGONS);
+	themeRest->setVisualDefault(pointVisual2, TePOINTS);
+
+	// Insert the theme into the view
+	view->add(themeRest);
+
+	// Save the theme in the database
+	if (!themeRest->save())
+    {
+		cout << "Fail to save the theme \"Pop91GT100000\" in the database: " << db->errorMessage() << endl;
+		db->close();
+		delete db;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Build the collection of objects associated to the theme
+	if (!themeRest->buildCollection())
+	{
+		cout << "Fail to build the theme \"Pop91GT100000\": " << db->errorMessage() << endl;
+		db->close();
+		delete db;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	cout << "The theme  \"Pop91GT100000\" was created with attribute restrictions!\n\n";
+	delete db;
+	cout << endl << "Press Enter\n";
+   	getchar();
+	return 0;
+}
+
+
diff --git a/examples/createTheme/createTheme.dsp b/examples/createTheme/createTheme.dsp
old mode 100755
new mode 100644
index 33a9547..dd9b057
--- a/examples/createTheme/createTheme.dsp
+++ b/examples/createTheme/createTheme.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="createTheme" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=createTheme - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "createTheme.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "createTheme.mak" CFG="createTheme - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "createTheme - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "createTheme - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "createTheme - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createTheme.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "createTheme - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createTheme.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "createTheme - Win32 Release"
-# Name "createTheme - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\createTheme.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="createTheme" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=createTheme - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "createTheme.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "createTheme.mak" CFG="createTheme - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "createTheme - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "createTheme - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "createTheme - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/createTheme.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "createTheme - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/createTheme.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "createTheme - Win32 Release"
+# Name "createTheme - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\createTheme.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/createTheme/createTheme.dsw b/examples/createTheme/createTheme.dsw
old mode 100755
new mode 100644
index ddd8628..9e631db
--- a/examples/createTheme/createTheme.dsw
+++ b/examples/createTheme/createTheme.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "createTheme"=.\createTheme.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "createTheme"=.\createTheme.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/createTheme/createTheme.pro b/examples/createTheme/createTheme.pro
old mode 100755
new mode 100644
index dd2b76e..000bacd
--- a/examples/createTheme/createTheme.pro
+++ b/examples/createTheme/createTheme.pro
@@ -1,6 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	createTheme.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
+TARGET = createTheme
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	createTheme.cpp 
+
diff --git a/examples/createTheme/createTheme.sln b/examples/createTheme/createTheme.sln
old mode 100755
new mode 100644
diff --git a/examples/createTheme/createTheme.vcproj b/examples/createTheme/createTheme.vcproj
old mode 100755
new mode 100644
index c514614..73a4f73
--- a/examples/createTheme/createTheme.vcproj
+++ b/examples/createTheme/createTheme.vcproj
@@ -1,164 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="createTheme"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\application;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\createTheme.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\application;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\createTheme.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="createTheme.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="createTheme"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\application;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\createTheme.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\application;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\createTheme.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="createTheme.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/data/BairroBH.MID b/examples/data/BairroBH.MID
old mode 100755
new mode 100644
index c903dae..2deb9a2
--- a/examples/data/BairroBH.MID
+++ b/examples/data/BairroBH.MID
@@ -1,240 +1,240 @@
-"AARAO REIS","600",5415
-"AEROPORTO","830",5906
-"ALIPIO DE MELO","602",11683
-"ALTO BARROCA","822",8633
-"ALTO DOS CAICARAS","603",1283
-"ALTO DOS PINHEIROS","604",1991
-"ALVARO CAMARGOS","605",2828
-"ALVORADA","606",4711
-"ANCHIETA","607",12883
-"APARECIDA","608",6935
-"APARECIDA - SETIMA SECAO","821",6533
-"BAIRRO DA GRACA","609",5767
-"BAIRRO DAS INDUSTRIAS","610",17922
-"BAIRRO DAS MANSOES","611",591
-"BALEIA","612",4507
-"BANDEIRANTES","742",4303
-"BARREIRO DE BAIXO","613",24944
-"BARREIRO DE CIMA","614",15573
-"BARRO PRETO","617",6551
-"BARROCA","616",3665
-"BELVEDERE","618",2453
-"BETANIA","619",19660
-"BOA VISTA","620",18471
-"BOM JESUS","621",4190
-"BONFIM","622",5116
-"BRAUNAS","652",1234
-"BURITIS","623",4462
-"C.H. CONFISCO","835",2184
-"CABANA","624",18752
-"CACHOEIRINHA","625",15640
-"CAETANO FURQUIM","626",6930
-"CAICARA","628",13847
-"CAICARA ADELAIDE","627",10237
-"CALAFATE","629",5541
-"CALIFORNIA","630",6028
-"CAMARGOS","631",3494
-"CAMPO ALEGRE","632",2073
-"CANAA","634",1889
-"CAPITAO EDUARDO","906",469
-"CARDOSO","635",18057
-"CARLOS PRATES","636",19998
-"CARMO","637",3175
-"CASA BRANCA","638",1349
-"CASTELO","639",5783
-"CENTRO","642",16304
-"CEU AZUL","643",20843
-"CIDADE JARDIM","644",2376
-"CIDADE NOVA","645",17820
-"COLEGIO BATISTA","646",2290
-"CONCORDIA","647",12231
-"CONJUNTO CALIFORNIA","648",4026
-"CONJUNTO CALIFORNIA 2","649",1796
-"CONJUNTO CELSO MACHADO","650",2139
-"CONJUNTO ITACOLOMI","651",883
-"CONJUNTO SANTA MARIA","769",826
-"COPACABANA","828",6592
-"COQUEIROS","654",10528
-"CORACAO DE JESUS","655",5593
-"CORACAO EUCARISTICO","656",7434
-"CRUZEIRO","657",7944
-"DOM BOSCO","658",6980
-"DOM CABRAL","659",5671
-"DOM JOAQUIM","660",4641
-"DOM SILVERIO","661",6125
-"DONA CLARA","662",3615
-"DURVAL DE BARROS","663",2583
-"ENGENHO NOGUEIRA","664",2016
-"ERMELINDA","665",2317
-"ESPLANADA","666",8850
-"ESTORIL","667",2881
-"ESTRELA DALVA","668",6680
-"ETELVINA CARNEIRO","669",939
-"EUROPA","670",10648
-"EYMARD","671",6673
-"FILADELFIA","676",4498
-"FLAVIO MARQUES LISBOA","677",5457
-"FLORAMAR","678",17914
-"FLORESTA","679",17753
-"FREI EUSTAQUIO","680",5004
-"FREI LEOPOLDO","615",2630
-"FUNCIONARIOS","681",18575
-"GAMELEIRA","682",5295
-"GARCAS","807",317
-"GLALIJA","683",2161
-"GLORIA","684",20053
-"GORDURAS","685",8361
-"GOVERNADOR BENEDITO VALADARES","601",3276
-"GRAJAU","686",7117
-"GUARANI","687",6144
-"GUTIERREZ","689",17077
-"HAVAI","690",6052
-"HELIOPOLIS","691",3030
-"HORTO","692",9664
-"INCONFIDENCIA","693",3019
-"INDEPENDENCIA","694",12517
-"INDUSTRIAL RODRIGUES DA CUNHA","695",2903
-"INSTITUTO AGRONOMICO","696",7836
-"IPANEMA","697",3800
-"IPIRANGA","698",11449
-"ITAPUA","699",7571
-"JAQUELINE","700",8488
-"JARAGUA","701",3647
-"JARDIM AMERICA","702",23627
-"JARDIM ATLANTICO","653",3999
-"JARDIM DOS COMERCIARIOS","703",14312
-"JARDIM FELICIDADE","834",14749
-"JARDIM MONTANHES","704",15071
-"JARDIM VITORIA","831",7799
-"JARDINOPOLIS","705",2290
-"JATOBA","706",36127
-"JOAO PINHEIRO","707",11150
-"JULIANA","688",4235
-"LAGOA","708",5162
-"LAGOINHA","710",7426
-"LAGOINHA (VENDA NOVA)","709",6855
-"LEBLON","711",18784
-"LETICIA","712",9146
-"LIBERDADE","713",5588
-"LINDEIA","714",17370
-"LOURDES","715",16035
-"LUXEMBURGO","716",5903
-"MAGNESITA","717",6232
-"MANGABEIRAS","718",4391
-"MANTIQUEIRA","719",19969
-"MARAJO","720",2642
-"MARIA GORETTI","771",3106
-"MARIA HELENA","721",2155
-"MARIA VIRGINIA","816",1957
-"MARIZE","675",3232
-"MILIONARIOS","722",9420
-"MINAS BRASIL","723",1754
-"MINAS CAIXA","724",11040
-"MINASLANDIA","725",2699
-"MONSENHOR MESSIAS","726",4607
-"MORRO DAS PEDRAS","672",15234
-"MORRO DO PAPAGAIO","825",14244
-"NOVA BARROCA","727",4655
-"NOVA CACHOEIRINHA","824",8405
-"NOVA CINTRA","728",5894
-"NOVA ESPERANCA","729",4142
-"NOVA FLORESTA","730",4253
-"NOVA GAMELEIRA","731",9294
-"NOVA GRANADA","732",4094
-"NOVA PAMPULHA","733",780
-"NOVA SUISSA","734",17113
-"NOVA VISTA","735",8432
-"NOVO SAO LUCAS","736",5110
-"OLARIA","833",4363
-"OLHOS D AGUA","737",3041
-"OURO PRETO","738",10221
-"PADRE EUSTAQUIO","739",28325
-"PALMARES","740",3482
-"PALMEIRAS","741",8299
-"PAQUETA","743",1799
-"PARAISO","744",10230
-"PARQUE DAS MANGABEIRAS","902",2358
-"PATROCINIO","745",1813
-"PAULO VI","905",4491
-"PEDREIRA PRADO LOPES","746",9361
-"PEDRO II","747",5730
-"PINDORAMA","748",5736
-"PIRAJA","749",5405
-"PLANALTO","750",13614
-"POMPEIA","751",8099
-"PONGELUPE","823",2008
-"PRADO","752",10166
-"PRIMAVERA","753",1107
-"PRIMEIRO DE MAIO","754",13544
-"PROVIDENCIA","756",12493
-"REGINA","757",4758
-"RENASCENCA","758",9378
-"RIBEIRO DE ABREU","759",20162
-"RIO BRANCO","818",6602
-"SAGRADA FAMILIA","760",32291
-"SALGADO FILHO","761",10861
-"SANTA AMELIA","762",8524
-"SANTA BRANCA","829",4500
-"SANTA CRUZ","763",5061
-"SANTA CRUZ (BARREIRO DE CIMA)","764",4406
-"SANTA EFIGENIA","765",23850
-"SANTA HELENA","766",6244
-"SANTA INES","767",8628
-"SANTA LUCIA","768",6891
-"SANTA MARIA","770",5566
-"SANTA MONICA","772",27689
-"SANTA ROSA","773",5004
-"SANTA TEREZA","774",10241
-"SANTA TEREZINHA","775",12676
-"SANTO AGOSTINHO","776",7537
-"SANTO ANDRE","777",11267
-"SANTO ANTONIO","778",21915
-"SAO BENTO","779",4531
-"SAO BERNARDO","780",13174
-"SAO CRISTOVAO","781",6349
-"SAO FRANCISCO","782",5729
-"SAO GABRIEL","783",35801
-"SAO GERALDO","784",20297
-"SAO JOAO BATISTA","786",10276
-"SAO JOAO BATISTA (VENDA NOVA)","785",13265
-"SAO JOSE","640",1093
-"SAO JOSE","787",12673
-"SAO LUCAS","788",5724
-"SAO LUIZ","641",4516
-"SAO MARCOS","789",11181
-"SAO PAULO","791",12121
-"SAO PAULO (VENDA NOVA)","790",32100
-"SAO PEDRO","792",5236
-"SAO SALVADOR","793",11371
-"SAO TOMAZ","794",6053
-"SARANDI","795",10233
-"SAUDADE","796",13820
-"SERRA","797",21538
-"SERRA VERDE","799",14019
-"SERRANO","798",8112
-"SION","801",18816
-"SOLIMOES","802",1583
-"SUMARE","674",2821
-"TAQUARIL","803",13804
-"TEIXEIRA DIAS","804",8458
-"TIROL","805",20474
-"TREVO","827",341
-"TUPI","806",24555
-"UFMG","633",211
-"UNIAO","808",13047
-"UNIVERSITARIO","809",3684
-"VALE DO JATOBA","832",8412
-"VENDA NOVA","810",18170
-"VERA CRUZ","811",22051
-"VILA BRASILIA","812",10920
-"VILA CAFEZAL","826",29008
-"VILA CEMIG","673",3334
-"VILA CLORIS","813",3621
-"VILA OESTE","814",4863
-"VILA PARIS","815",4134
-"VILA VIRGINIA","817",1738
-"VISTA ALEGRE","819",17227
-"WASHINGTON PIRES","755",1225
-"XANGRILA","820",194
-"ZONA RURAL","901",2709
-"ZONA RURAL - SERRA DO CURRAL","903",13577
+"AARAO REIS","600",5415
+"AEROPORTO","830",5906
+"ALIPIO DE MELO","602",11683
+"ALTO BARROCA","822",8633
+"ALTO DOS CAICARAS","603",1283
+"ALTO DOS PINHEIROS","604",1991
+"ALVARO CAMARGOS","605",2828
+"ALVORADA","606",4711
+"ANCHIETA","607",12883
+"APARECIDA","608",6935
+"APARECIDA - SETIMA SECAO","821",6533
+"BAIRRO DA GRACA","609",5767
+"BAIRRO DAS INDUSTRIAS","610",17922
+"BAIRRO DAS MANSOES","611",591
+"BALEIA","612",4507
+"BANDEIRANTES","742",4303
+"BARREIRO DE BAIXO","613",24944
+"BARREIRO DE CIMA","614",15573
+"BARRO PRETO","617",6551
+"BARROCA","616",3665
+"BELVEDERE","618",2453
+"BETANIA","619",19660
+"BOA VISTA","620",18471
+"BOM JESUS","621",4190
+"BONFIM","622",5116
+"BRAUNAS","652",1234
+"BURITIS","623",4462
+"C.H. CONFISCO","835",2184
+"CABANA","624",18752
+"CACHOEIRINHA","625",15640
+"CAETANO FURQUIM","626",6930
+"CAICARA","628",13847
+"CAICARA ADELAIDE","627",10237
+"CALAFATE","629",5541
+"CALIFORNIA","630",6028
+"CAMARGOS","631",3494
+"CAMPO ALEGRE","632",2073
+"CANAA","634",1889
+"CAPITAO EDUARDO","906",469
+"CARDOSO","635",18057
+"CARLOS PRATES","636",19998
+"CARMO","637",3175
+"CASA BRANCA","638",1349
+"CASTELO","639",5783
+"CENTRO","642",16304
+"CEU AZUL","643",20843
+"CIDADE JARDIM","644",2376
+"CIDADE NOVA","645",17820
+"COLEGIO BATISTA","646",2290
+"CONCORDIA","647",12231
+"CONJUNTO CALIFORNIA","648",4026
+"CONJUNTO CALIFORNIA 2","649",1796
+"CONJUNTO CELSO MACHADO","650",2139
+"CONJUNTO ITACOLOMI","651",883
+"CONJUNTO SANTA MARIA","769",826
+"COPACABANA","828",6592
+"COQUEIROS","654",10528
+"CORACAO DE JESUS","655",5593
+"CORACAO EUCARISTICO","656",7434
+"CRUZEIRO","657",7944
+"DOM BOSCO","658",6980
+"DOM CABRAL","659",5671
+"DOM JOAQUIM","660",4641
+"DOM SILVERIO","661",6125
+"DONA CLARA","662",3615
+"DURVAL DE BARROS","663",2583
+"ENGENHO NOGUEIRA","664",2016
+"ERMELINDA","665",2317
+"ESPLANADA","666",8850
+"ESTORIL","667",2881
+"ESTRELA DALVA","668",6680
+"ETELVINA CARNEIRO","669",939
+"EUROPA","670",10648
+"EYMARD","671",6673
+"FILADELFIA","676",4498
+"FLAVIO MARQUES LISBOA","677",5457
+"FLORAMAR","678",17914
+"FLORESTA","679",17753
+"FREI EUSTAQUIO","680",5004
+"FREI LEOPOLDO","615",2630
+"FUNCIONARIOS","681",18575
+"GAMELEIRA","682",5295
+"GARCAS","807",317
+"GLALIJA","683",2161
+"GLORIA","684",20053
+"GORDURAS","685",8361
+"GOVERNADOR BENEDITO VALADARES","601",3276
+"GRAJAU","686",7117
+"GUARANI","687",6144
+"GUTIERREZ","689",17077
+"HAVAI","690",6052
+"HELIOPOLIS","691",3030
+"HORTO","692",9664
+"INCONFIDENCIA","693",3019
+"INDEPENDENCIA","694",12517
+"INDUSTRIAL RODRIGUES DA CUNHA","695",2903
+"INSTITUTO AGRONOMICO","696",7836
+"IPANEMA","697",3800
+"IPIRANGA","698",11449
+"ITAPUA","699",7571
+"JAQUELINE","700",8488
+"JARAGUA","701",3647
+"JARDIM AMERICA","702",23627
+"JARDIM ATLANTICO","653",3999
+"JARDIM DOS COMERCIARIOS","703",14312
+"JARDIM FELICIDADE","834",14749
+"JARDIM MONTANHES","704",15071
+"JARDIM VITORIA","831",7799
+"JARDINOPOLIS","705",2290
+"JATOBA","706",36127
+"JOAO PINHEIRO","707",11150
+"JULIANA","688",4235
+"LAGOA","708",5162
+"LAGOINHA","710",7426
+"LAGOINHA (VENDA NOVA)","709",6855
+"LEBLON","711",18784
+"LETICIA","712",9146
+"LIBERDADE","713",5588
+"LINDEIA","714",17370
+"LOURDES","715",16035
+"LUXEMBURGO","716",5903
+"MAGNESITA","717",6232
+"MANGABEIRAS","718",4391
+"MANTIQUEIRA","719",19969
+"MARAJO","720",2642
+"MARIA GORETTI","771",3106
+"MARIA HELENA","721",2155
+"MARIA VIRGINIA","816",1957
+"MARIZE","675",3232
+"MILIONARIOS","722",9420
+"MINAS BRASIL","723",1754
+"MINAS CAIXA","724",11040
+"MINASLANDIA","725",2699
+"MONSENHOR MESSIAS","726",4607
+"MORRO DAS PEDRAS","672",15234
+"MORRO DO PAPAGAIO","825",14244
+"NOVA BARROCA","727",4655
+"NOVA CACHOEIRINHA","824",8405
+"NOVA CINTRA","728",5894
+"NOVA ESPERANCA","729",4142
+"NOVA FLORESTA","730",4253
+"NOVA GAMELEIRA","731",9294
+"NOVA GRANADA","732",4094
+"NOVA PAMPULHA","733",780
+"NOVA SUISSA","734",17113
+"NOVA VISTA","735",8432
+"NOVO SAO LUCAS","736",5110
+"OLARIA","833",4363
+"OLHOS D AGUA","737",3041
+"OURO PRETO","738",10221
+"PADRE EUSTAQUIO","739",28325
+"PALMARES","740",3482
+"PALMEIRAS","741",8299
+"PAQUETA","743",1799
+"PARAISO","744",10230
+"PARQUE DAS MANGABEIRAS","902",2358
+"PATROCINIO","745",1813
+"PAULO VI","905",4491
+"PEDREIRA PRADO LOPES","746",9361
+"PEDRO II","747",5730
+"PINDORAMA","748",5736
+"PIRAJA","749",5405
+"PLANALTO","750",13614
+"POMPEIA","751",8099
+"PONGELUPE","823",2008
+"PRADO","752",10166
+"PRIMAVERA","753",1107
+"PRIMEIRO DE MAIO","754",13544
+"PROVIDENCIA","756",12493
+"REGINA","757",4758
+"RENASCENCA","758",9378
+"RIBEIRO DE ABREU","759",20162
+"RIO BRANCO","818",6602
+"SAGRADA FAMILIA","760",32291
+"SALGADO FILHO","761",10861
+"SANTA AMELIA","762",8524
+"SANTA BRANCA","829",4500
+"SANTA CRUZ","763",5061
+"SANTA CRUZ (BARREIRO DE CIMA)","764",4406
+"SANTA EFIGENIA","765",23850
+"SANTA HELENA","766",6244
+"SANTA INES","767",8628
+"SANTA LUCIA","768",6891
+"SANTA MARIA","770",5566
+"SANTA MONICA","772",27689
+"SANTA ROSA","773",5004
+"SANTA TEREZA","774",10241
+"SANTA TEREZINHA","775",12676
+"SANTO AGOSTINHO","776",7537
+"SANTO ANDRE","777",11267
+"SANTO ANTONIO","778",21915
+"SAO BENTO","779",4531
+"SAO BERNARDO","780",13174
+"SAO CRISTOVAO","781",6349
+"SAO FRANCISCO","782",5729
+"SAO GABRIEL","783",35801
+"SAO GERALDO","784",20297
+"SAO JOAO BATISTA","786",10276
+"SAO JOAO BATISTA (VENDA NOVA)","785",13265
+"SAO JOSE","640",1093
+"SAO JOSE","787",12673
+"SAO LUCAS","788",5724
+"SAO LUIZ","641",4516
+"SAO MARCOS","789",11181
+"SAO PAULO","791",12121
+"SAO PAULO (VENDA NOVA)","790",32100
+"SAO PEDRO","792",5236
+"SAO SALVADOR","793",11371
+"SAO TOMAZ","794",6053
+"SARANDI","795",10233
+"SAUDADE","796",13820
+"SERRA","797",21538
+"SERRA VERDE","799",14019
+"SERRANO","798",8112
+"SION","801",18816
+"SOLIMOES","802",1583
+"SUMARE","674",2821
+"TAQUARIL","803",13804
+"TEIXEIRA DIAS","804",8458
+"TIROL","805",20474
+"TREVO","827",341
+"TUPI","806",24555
+"UFMG","633",211
+"UNIAO","808",13047
+"UNIVERSITARIO","809",3684
+"VALE DO JATOBA","832",8412
+"VENDA NOVA","810",18170
+"VERA CRUZ","811",22051
+"VILA BRASILIA","812",10920
+"VILA CAFEZAL","826",29008
+"VILA CEMIG","673",3334
+"VILA CLORIS","813",3621
+"VILA OESTE","814",4863
+"VILA PARIS","815",4134
+"VILA VIRGINIA","817",1738
+"VISTA ALEGRE","819",17227
+"WASHINGTON PIRES","755",1225
+"XANGRILA","820",194
+"ZONA RURAL","901",2709
+"ZONA RURAL - SERRA DO CURRAL","903",13577
diff --git a/examples/data/BairroBH.MIF b/examples/data/BairroBH.MIF
old mode 100755
new mode 100644
index 5b56394..d304308
--- a/examples/data/BairroBH.MIF
+++ b/examples/data/BairroBH.MIF
@@ -1,19189 +1,19189 @@
-Version 300
-Charset "WindowsLatin1"
-Delimiter ","
-Index 1
-CoordSys Earth Projection 8, 92, "m", -45, 0, 0.9996, 500000, 10000000 Bounds (-7745874.38492, 1999.40969607) (8745874.38492, 19998000.5903)
-Columns 3
-  nobai Char(49)
-  CDBAI Char(3)
-  pop_estim Integer
-Data
-
-Region  1
-  52
-612711.24 804892.23
-612676.53 804879.46
-612547.32 804802.54
-612474.15 804736.89
-612413.58 804792.38
-612399.6 804829.51
-612386.73 804890.97
-612371.78 804967.65
-612296.55 804950.28
-612263.04 804940.9
-612179.37 804712.57
-612077.61 804705.82
-612071.82 804784.91
-612060.73 804800.83
-611969.81 804934.62
-611957.32 804961.32
-611790.26 805226.43
-611868.61 805222.34
-611914.97 805215.41
-611959.74 805209.02
-612031.68 805199.96
-612066.31 805222.87
-612124.38 805275.99
-612175.26 805329.52
-612232.82 805388.14
-612261.59 805416.38
-612289.76 805420.21
-612344.19 805422.78
-612401.81 805428.38
-612467.29 805432.37
-612553.35 805441.71
-612678.58 805450.77
-612769.71 805430.12
-612858.17 805381.63
-613234.2 805154.47
-613218.29 805144.82
-613165.6 805112.29
-613120.12 805081.43
-613080.04 805048.94
-613042.28 804998.19
-613032.7 804979.95
-612987.38 804818.92
-612967.61 804822.29
-612942.39 804822.28
-612905.42 804819.88
-612877.94 804818.92
-612853.35 804818.43
-612839.85 804837.24
-612844.67 804862.31
-612824.42 804893.16
-612778.5 804900.67
-612711.24 804892.23
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612512.05 805109.6
-Region  1
-  138
-608916.5 804023.17
-608727.71 804535.57
-608280.43 804976.11
-608267.23 805019.36
-608268.14 805060.33
-608276.11 805146.6
-608281.79 805231.96
-608285.89 805281.13
-608290.22 805339.63
-608295.23 805410.19
-608317.08 805450.25
-608343.49 805483.03
-608353.95 805502.12
-608371.25 805508.95
-608497.82 805472.52
-608731.38 805401
-608928.52 805350.47
-608976.78 805539.87
-609210.34 805476.11
-609209.63 805449.75
-609214.7 805422.42
-609222.85 805382.01
-609207.37 805350.6
-609192.35 805323.74
-609186.43 805306.89
-609179.83 805294.4
-609203.05 805283.93
-609255.86 805252.51
-609315.05 805205.16
-609341.44 805195.14
-609374.22 805192.86
-609369.67 805155.02
-609454.81 805134.54
-609523.1 805121.79
-609607.39 805106.52
-609733.96 805090
-609861.18 805077.29
-609900.44 805089.92
-609973.82 805152.79
-610054.41 805194.23
-610110.86 805202.88
-610140 805202.88
-610124.07 805151.43
-610099.81 805072.1
-610346.57 804987.83
-610464.94 804992.2
-610632.15 804898.9
-610683 804868.29
-610697.22 804857.93
-610721.33 804838.4
-610805.44 804748.99
-610844 804730.43
-611023.33 804657.88
-611382.27 804517.55
-611396.73 804561.67
-611568.97 804480.02
-611605.13 804462.67
-611709.26 804412.53
-611741.81 804441.45
-611756.75 804430.85
-611769.53 804421.93
-611781.1 804413.49
-611806.13 804396.81
-611826.05 804383.47
-611839.79 804400.28
-611816.17 804371.18
-611792.9 804356.35
-611756.99 804347.19
-611720.34 804342.37
-611673.72 804332.65
-611665.04 804309.5
-611648.16 804271.41
-611633.7 804240.06
-611614.41 804197.62
-611596.56 804153.25
-611588.36 804132.51
-611562.32 804124.8
-611542.55 804119.97
-611525.67 804114.19
-611504.21 804107.19
-611491.67 804102.37
-611475.28 804097.06
-611460.33 804092.24
-611448.75 804088.38
-611434.29 804083.56
-611399.57 804075.41
-611395.23 804110.61
-611396.68 804136.17
-611394.75 804164.14
-611394.27 804191.63
-611391.61 804232.38
-611388.23 804278.19
-611387.27 804325.46
-611373.77 804323.04
-611237.76 803938.43
-611173.87 803966.3
-611064.41 804006.84
-610954.97 804057.51
-610927.75 804059.42
-610902.44 804064.5
-610800.59 804113.26
-610686.72 804168.36
-610638.62 804178.51
-610596.24 804201.31
-610526.63 804214.63
-610486.07 804216.22
-610408.57 804245.18
-610252.51 804326.86
-610164.71 804261.46
-610072.57 804312.08
-609932.05 804393.5
-609814.23 804475.8
-609758.68 804514.33
-609751.81 804489.54
-609746.74 804469.23
-609580.84 804530.93
-609517.44 804557.42
-609492.71 804562.24
-609447.44 804550.68
-609403.61 804541.53
-609369.9 804525.15
-609403.85 804163.77
-609216.03 803973.06
-609211.94 803938.65
-609209.53 803898.68
-609136.33 803928.06
-609079.51 803954.06
-609037.13 803905.9
-609066.26 803823.83
-609074.93 803792.05
-609071.08 803771.34
-609057.6 803749.67
-609043.15 803729.44
-609028.22 803703.43
-609016.18 803730.89
-608993.06 803798.31
-608922.76 804007.76
-608916.5 804023.17
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609754.23 804682.77
-Region  1
-  69
-603925.58 800180.38
-603931.33 800239.97
-603938.89 800297.21
-603960.32 800405.92
-603980.85 800501.62
-604004.24 800608.71
-604021.47 800697.34
-604034.4 800760.74
-604066.4 800914.04
-604068.52 800927.89
-604641.63 800402.4
-604717.44 800338.6
-604758.21 800306.51
-604855.81 800254.89
-604818.28 800175.73
-604784.45 800107.63
-604765.36 800065.56
-604746.05 800000.28
-604723.06 799925.67
-604676.62 799771.92
-604659.27 799700.05
-604634.75 799618.7
-604610.89 799582.26
-604577.92 799557.53
-604516.74 799531.49
-604502.21 799524.32
-604548.63 799429.3
-604621.88 799405.99
-604710.16 799380.02
-604722.4 799294.55
-604744.53 799130.12
-604824.36 799054.63
-604806.35 798871.75
-604863.62 798816.21
-604838.89 798787.57
-604819.15 798764.38
-604798.76 798742.26
-604790.52 798723.16
-604790.95 798700.6
-604759.71 798686.28
-604738.02 798677.17
-604727.61 798671.97
-604679.01 798727.5
-604631.29 798767.85
-604423.24 798855.26
-604393.11 798878.94
-604369.43 798914.45
-604307.02 799053.27
-604298.09 799081.15
-604151.09 799398.74
-604101.76 799513.96
-604089.98 799530.56
-604076.02 799548.84
-604029.34 799577.42
-603968.37 799603.78
-603929.63 799619.34
-603899.78 799640.61
-603885.65 799656.67
-603876.44 799664.93
-603855.8 799723.35
-603833.73 799826.09
-603826.27 799874.15
-603819.21 799915.62
-603806.14 799971.03
-603798.82 800007.63
-603835.42 800036.9
-603875.67 800075.06
-603904.15 800112.43
-603925.58 800180.38
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604352.15 799829.41
-Region  1
-  20
-608017.05 795860.74
-608286.33 795846.18
-608304.77 795846.18
-608726.4 795929.63
-608755.03 795763.22
-608668.17 795446.5
-608607.32 795433.32
-608462.44 795398.35
-608284.4 795354.71
-607822.28 795240.98
-607724.01 795391.11
-607697.09 795435.98
-607665.07 795516.03
-607650.29 795586.62
-607655.63 795686.08
-607659.96 795810.28
-607656.08 795918.96
-607678.4 795911.2
-607777.86 795880.63
-608017.05 795860.74
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608170.23 795613.77
-Region  1
-  28
-608045.21 799290.88
-608104.1 799248.45
-608121.72 799258.18
-608158 799254.71
-608192.64 799268.13
-608227.28 799303.63
-608196.54 799147.76
-608159.3 799132.17
-608119.89 799110.93
-608085.06 799098.29
-607959.7 799038.66
-607883.49 799004.02
-607881.33 799062.04
-607849.29 799013.11
-607813.14 798962.21
-607811.19 798927.32
-607787.81 798916.93
-607770.92 798910
-607678.27 798868.87
-607651.86 798855.01
-607650.72 798892.91
-607650.25 798958.63
-607649.47 798996.84
-607648.17 799102.92
-607676.75 799109.41
-607858.38 799246.06
-607985.89 799337.64
-608045.21 799290.88
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607901.58 799120.1
-Region  1
-  124
-604282.24 796153.99
-604377.36 796086.2
-604445.11 796037.46
-604408.91 795986.98
-604385.24 795953.48
-604375.11 795921.68
-604364.28 795886.48
-604347.78 795826.79
-604327.59 795795.08
-604316.82 795776.72
-604283.9 795753.3
-604256.67 795732.41
-604226.91 795706.45
-604215.44 795675.24
-604214.4 795644.87
-604215.1 795610.67
-604217.89 795553.77
-604219.63 795513.98
-604218.41 795489.36
-604174.78 795532.99
-604147.21 795561.62
-604098.35 795606.64
-604035.87 795647.83
-603972.35 795670.52
-603954.55 795674.36
-603933.78 795681.12
-603918.07 795683.91
-603838.49 795684.61
-603709.7 795669.95
-603622.97 795654.06
-603482.28 795647.03
-603396.55 795676.4
-603298.75 795739.12
-603154.81 795843.25
-603037.05 795881.61
-602961.98 795882.28
-602892.97 795865.56
-602827.14 795841.04
-602785.65 795821.36
-602729.34 795792.63
-602528.08 795670.13
-601865.86 795232.56
-601875.2 795319.19
-601879.45 795409.22
-602086.68 795502.65
-602108.34 795528.55
-602234.88 795616.03
-602244.23 795638.11
-602244.65 795674.2
-602224.69 795708.17
-602200.69 795791.17
-602161.2 795869.3
-602140.6 795909.46
-602098.56 795989.29
-602082.21 796022.59
-602057.16 796103.7
-602057.8 796138.76
-602063.32 796176.55
-602070.96 796233.46
-602078.81 796261.7
-602100.9 796316.05
-602130.4 796384.66
-602192.61 796510.18
-602231.68 796580.25
-602361.41 796685.77
-602431.06 796694.68
-602474.37 796689.16
-602493.48 796743.94
-602397.93 796799.15
-602302.18 796903.82
-602270.33 796930.99
-602280.1 796964.12
-602342.52 796912.73
-602489.87 796827.38
-602557.82 796805.3
-602677.36 796769.42
-602895.78 796705.19
-602974.51 796679.78
-603030.18 796663.69
-603108.28 796639.77
-603109.53 796556.42
-603119.69 796378.26
-603127.07 796352.67
-603224.44 796238.18
-603301.18 796151.93
-603354.91 796109.6
-603434.49 796066.21
-603408.88 796016.87
-603383.91 795976.02
-603346.24 795930.54
-603314.02 795895.34
-603342.17 795850.04
-603365.02 795814.11
-603397.19 795776.86
-603432.54 795770.72
-603478.47 795774.11
-603506.41 795788.92
-603527.37 795818.13
-603574.8 795917.97
-603590.89 795953.95
-603600.62 795984.85
-603605.92 796002.03
-603569.72 796068.01
-603591.52 796079.87
-603632.8 796104.63
-603693.55 796140.55
-603755.99 796173.99
-603795.79 796191.75
-603820.35 796215.25
-603847.23 796244.46
-603860.57 796258.48
-603870.15 796267.2
-603971.37 796296.39
-603985.97 796264
-603992.96 796260.83
-603997.49 796256.84
-604000.64 796254.84
-604016.33 796245.91
-604035.38 796228.13
-604093.48 796244.32
-604111.26 796272.9
-604173.81 796232.89
-604225.72 796193.68
-604282.24 796153.99
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603010.9 796093.07
-Region  1
-  58
-603754.53 797528.56
-603744.72 797566.48
-603786.95 797646.5
-603802.51 797756.67
-603803.78 797818.67
-603742.82 797850.42
-603783.46 797848.87
-603860.61 797890.46
-603904.11 797943.17
-603911.41 797958.39
-603922.21 797980.93
-603929.19 797999.03
-603932.37 798007.92
-603936.81 798018.4
-603939.99 798028.24
-603943.48 798040.63
-603977.13 798070.47
-604024.76 798024.43
-604053.05 797978.38
-604073.02 797939.34
-604077.78 797903.14
-604101.81 797876.11
-604114.51 797864.04
-604135.1 797842.04
-604153.85 797826.23
-604204.42 797779.97
-604244.8 797740.38
-604191.08 797730.58
-604159.34 797723.13
-604174.24 797707.84
-604187.18 797696.08
-604197.39 797686.28
-604216.21 797669.03
-604222.29 797663.33
-604229.34 797657.06
-604238.35 797649.22
-604243.84 797644.12
-604260.7 797630.01
-604287.86 797609.34
-604280.24 797594.52
-604233.47 797533.99
-604165.61 797470.38
-604160.5 797460.38
-604126.64 797426.33
-604089.17 797366
-604051.07 797308.85
-603990.75 797295.52
-603956.46 797298.69
-603933.6 797303.77
-603901.85 797312.03
-603875.18 797327.27
-603854.22 797349.49
-603827.55 797354.57
-603789.55 797350.19
-603753.26 797349.49
-603693.57 797403.47
-603721.51 797472.05
-603754.53 797528.56
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603977.82 797631.45
-Region  1
-  59
-614846.87 802270.79
-614856.35 802317.82
-614858.95 802364.44
-614857.22 802443.18
-614850.85 802504.56
-614835.51 802581.86
-614801.63 802743.12
-614806.84 802798
-614813.79 802802.18
-614838.11 802803.92
-614860.11 802726.9
-614879.22 802663.21
-614941.47 802691.88
-615005.74 802716.78
-615041.35 802731.54
-615069.14 802741.38
-615096.36 802751.86
-615121.83 802757.65
-615181.47 802746.07
-615260.51 802729.02
-615327.1 802716.86
-615331.73 802679.8
-615346.78 802642.17
-615379.21 802591.79
-615409.32 802606.27
-615429.58 802613.22
-615455.06 802623.06
-615481.41 802632
-615508.91 802568.58
-615519.33 802510.1
-615522.81 802424.41
-615530.34 802382.14
-615522.23 802308.02
-615512.97 802253.01
-615493.28 802235.64
-615424.38 802198.58
-615407.87 802187.29
-615362.13 802107.38
-615413.08 802082.49
-615361.55 802007.21
-615359.53 801986.08
-615341 801958.86
-615295.26 801900.38
-615258.78 801847.69
-615217.98 801793.84
-615168.19 801786.55
-615124.12 801803.99
-615064.82 801847.12
-614936.41 801903.24
-614775.01 801939.05
-614703.66 801981.23
-614723.69 801991.04
-614751.55 802004.58
-614792.08 802056.69
-614801.93 802077.54
-614806.27 802102.11
-614820.77 802149.96
-614833.77 802208.96
-614846.87 802270.79
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 615135.75 802300.57
-Region  1
-  42
-612692.29 793449.16
-612630.05 793435.51
-612576.54 793402.02
-612483.82 793344.23
-612414.18 793298.68
-612346.55 793277.09
-612279.24 793286.29
-612136.88 793314.08
-612101.64 793309
-611860.96 793947.03
-611896.98 794073.48
-612042.44 794612.37
-612109.11 794445.47
-612106.46 794420.99
-612089.77 794355.97
-612131.32 794343.71
-612181.72 794311.7
-612184.44 794296.03
-612308.72 794239.55
-612346.8 794183.01
-612434.31 794142.47
-612495.85 794107.08
-612550.29 794048.49
-612556.05 794033.49
-612573.76 794008.03
-612709.53 793881.16
-612739.53 793853.09
-612754.91 793866.93
-612783.76 793895.78
-612785.68 793793.86
-612801.83 793816.93
-612827.22 793833.09
-612901.83 793828.86
-612931.45 793816.55
-612949.53 793780.78
-612890.3 793750.01
-612852.22 793719.62
-612825.33 793677.45
-612825.49 793560.45
-612792.79 793490.59
-612746.58 793462.18
-612692.29 793449.16
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612312.8 793804.7
-Region  1
-  52
-609675.48 799987.34
-609597.92 799951.29
-609606.06 799843.8
-609527.1 799839.9
-609141.9 799768.55
-609129.08 799836.55
-609127.49 799836.23
-609072.4 800120.73
-609195.97 800274.02
-609272.98 800382.23
-609313.13 800447.28
-609347.54 800496.82
-609385.62 800538.8
-609409.12 800561.03
-609433.32 800582.28
-609495.72 800632.98
-609524.51 800659.71
-609630.83 800659.6
-609682.44 800666.25
-609719.15 800695.15
-609748.51 800711.9
-609767.09 800715.8
-609808.15 800713.5
-609838.65 800708.04
-609848.17 800691.39
-609866.39 800666.14
-609876.55 800653.76
-609898.97 800616.45
-609951.77 800534.27
-609961.37 800520.73
-609968.99 800505.8
-609975.98 800489.61
-609982.33 800471.83
-609989.63 800449.29
-609992.81 800435.32
-609995.66 800417.54
-609997.23 800398.9
-609999.94 800369.81
-609998.9 800342.36
-609995.79 800315.42
-609991.65 800293.66
-609977.66 800238.23
-609971.34 800206.34
-609966.01 800183.57
-609960.45 800153.43
-609958.76 800137.98
-609957.73 800124.52
-609957.36 800115.13
-609908.94 800085.19
-609898.71 800089.1
-609783.95 800036.08
-609675.48 799987.34
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609547.02 800238.65
-Region  1
-  64
-609010.03 800456.56
-609060.72 800407.82
-609086.07 800336.17
-609145.03 800215.29
-609072.4 800120.73
-608987.59 800037.38
-608953.96 800000.82
-608921.78 799930.63
-608889.61 799866.78
-608865.67 799820.9
-608840.32 799782.88
-608680.45 799841.37
-608561.05 799890.77
-608536.17 799904.74
-608440.63 799975.91
-608438.68 800062.67
-608401.28 800173.67
-608362.71 800227.15
-608457.22 800329.26
-608464.83 800338.85
-608447.97 800355.37
-608412.28 800388.75
-608382.87 800413.87
-608395.09 800424.77
-608485.48 800524.34
-608585.45 800634.84
-608511.92 800701.43
-608498.72 800715.39
-608509.33 800735.4
-608508.73 800761.97
-608495.46 800777.8
-608480.32 800817.66
-608462.88 800838.47
-608448.09 800861.96
-608420.27 800885.39
-608384.11 800931.99
-608394.37 800943.39
-608365.86 800977.6
-608363.2 800990.14
-608370.05 801004.2
-608370.43 801040.3
-608447.19 801073.74
-608571.84 801115.17
-608785.94 801189.83
-608996.76 801256.5
-608934.53 801182.21
-608907.23 801148.55
-608855.16 801094.58
-608828.49 801063.46
-608810.07 801042.12
-608837.37 801018.73
-608796.74 800988.53
-608752.05 800957.97
-608738.77 800937.9
-608731.94 800912.55
-608731.94 800886.23
-608748.03 800801.91
-608824.55 800726.85
-608886.72 800662.26
-608901.34 800638.37
-608933.28 800575.74
-608949.85 800509.94
-608961.77 800488.24
-609010.03 800456.56
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608711.26 800440.68
-Region  1
-  69
-612222.84 799151.62
-612209.18 799081.44
-612186.64 799038.26
-612155.37 799002.48
-612115.67 798970.73
-612028.03 798934.85
-611915.51 798900.25
-611829.34 798868.79
-611782.83 798852.38
-611723.1 799028.37
-611683.17 799148.47
-611659.04 799221.5
-611636.65 799286.46
-611625.06 799326.03
-611623.47 799413.99
-611618.86 799438.61
-611602.81 799465.77
-611567.25 799526.35
-611548.68 799562.57
-611517.42 799640.34
-611493.39 799700.73
-611466.82 799730.04
-611439.07 799748.8
-611410.55 799775.37
-611393.74 799803.51
-611387.68 799836.99
-611391.98 799932.34
-611402.53 799915.15
-611409.56 799899.91
-611426.95 799858.31
-611452.36 799806.63
-611480.5 799778.11
-611572.72 799739.81
-611597.14 799700.13
-611604.18 799652.84
-611613.16 799626.66
-611630.75 799598.13
-611662.79 799564.14
-611702.07 799564.25
-611808.37 799585.36
-611813.45 799599.82
-611899.23 799646.9
-611939.48 799669.18
-611963.31 799680.12
-611974.26 799686.76
-612035.61 799703.18
-612088.8 799716.41
-612138 799730.14
-612165.5 799740.25
-612173.6 799745.26
-612171.45 799753.01
-612165.85 799767.21
-612141.75 799811.98
-612113.33 799864.93
-612099.13 799904.11
-612123.92 799905.92
-612173.94 799892.64
-612204.3 799892.7
-612239.59 799899.67
-612298.99 799915.69
-612304.65 799887.75
-612312.86 799865.08
-612325.36 799827.18
-612328.88 799770.12
-612318.09 799680.29
-612303.8 799612.97
-612273.32 799442.82
-612249.51 799276.73
-612222.84 799151.62
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611955.94 799378.49
-Region  1
-  175
-604487.77 793061.44
-604548.09 793043.03
-604643.62 793004.4
-604734.15 792979.53
-604798.28 792957.94
-604878.41 792928.48
-604921.47 792912.85
-604947.51 792908.41
-604941.79 792889.36
-604931.63 792823.95
-604968.46 792827.13
-604998.31 792827.76
-605031.33 792829.03
-605026.25 792804.27
-605018.63 792768.07
-605010.43 792731.69
-604940.26 792754.23
-604887.56 792752.33
-604817.71 792691.68
-604895.5 792528.79
-604877.41 792398.6
-604833.59 792362.1
-604871.69 792351.27
-604904.71 792289.11
-604946.62 792289.11
-604933.92 792207.83
-604897.09 792188.78
-604902.17 792164.65
-604935.19 792165.92
-604975.83 792112.58
-605005.04 792099.88
-605041.17 792105.16
-605066.15 792092.47
-605103.82 792083.79
-605154.2 792084.28
-605184.68 792077.93
-605193.57 792070.94
-605196.32 792056.76
-605187.01 792046.7
-605163.3 792056.65
-605155.47 792055.38
-605148.06 792037.17
-605183.83 792001.83
-605159.28 791988.28
-605138.75 791974.52
-605137.05 791964.79
-605173.46 791943.2
-605174.52 791929.65
-605170.71 791914.41
-605164.99 791904.67
-605160.76 791893.24
-605148.48 791866.36
-605211.02 791815.01
-605297.49 791745.34
-605431.37 791635.87
-605481.01 791590.2
-605549.69 791515.55
-605608.64 791439.27
-605658.59 791362.15
-605711.4 791281.99
-605770.88 791189.79
-605819.77 791096.23
-605858.47 790927.44
-605880.53 790820.69
-605914.51 790740.51
-605964.99 790680.45
-605998.43 790656.59
-606054.95 790628.44
-606158.14 790585.72
-606033.66 790429.92
-605958.57 790404.18
-605894.86 790398.04
-605861.4 790407.7
-605813.13 790386.37
-605805.01 790387.17
-605798.44 790373.2
-605800.14 790356.48
-605758.44 790343.35
-605754.63 790351.61
-605750.83 790358.56
-605743.2 790377.59
-605727.01 790397.59
-605711.77 790409.66
-605673.67 790418.87
-605622.24 790430.93
-605601.6 790447.44
-605584.77 790479.51
-605536.19 790561.79
-605512.38 790569.72
-605473.01 790569.72
-605430.46 790590.99
-605334.58 790646.87
-605329.5 790665.6
-605312.35 790664.02
-605271.4 790661.81
-605256.79 790668.8
-605241.23 790703.41
-605223.45 790742.78
-605210.12 790755.16
-605184.72 790778.66
-605149.16 790811.37
-605106.3 790850.74
-605065.34 790888.49
-605093.28 790928.82
-605055.5 790954.85
-605030.73 790973.9
-604993.9 791001.88
-604942.46 791059.35
-604930.4 791081.26
-604855.79 791286.42
-604781.49 791494.7
-604805.3 791501.69
-604832.92 791508.99
-604858.64 791515.34
-604893.24 791522.65
-604924.99 791529.95
-604945.95 791533.76
-604975.79 791541.38
-605012.94 791549.64
-605018.34 791660.19
-604972.92 791778.04
-604913.23 791910.76
-604713.52 791734.26
-604641.44 791791.7
-604630.65 791802.5
-604622.07 791827.93
-604590.63 791932.7
-604557.61 792039.09
-604526.49 792144.21
-604524.31 792191.66
-604522.68 792227.71
-604477.55 792235.35
-604412.15 792246.78
-604353.73 792258.84
-604248.95 792277.89
-604168.01 792293.52
-604194.98 792477.92
-604221.06 792552.14
-604242.65 792586.43
-604287.73 792576.9
-604409.02 792557.22
-604462.99 792550.23
-604509.98 792541.98
-604479.5 792589.6
-604440.77 792646.12
-604358.06 792733.45
-604205.82 792761.02
-604247 792856.13
-603541.73 792708.49
-603535.38 792700.24
-603423.95 792677.01
-603406.17 792687.17
-603314.74 792771.62
-603276.01 792802.1
-603219.49 792864.33
-603187.11 792939.26
-603189.01 793009.74
-603204.25 793088.48
-603261.59 793180.23
-603346.4 793224.53
-603435.63 793235.28
-603527.39 793227.68
-603619.15 793211.22
-603710.28 793199.2
-603775.28 793197.97
-603925.14 793218.93
-603993.72 793219.56
-604210.89 793146.54
-604283.28 793121.77
-604292.79 793118.59
-604299.77 793115.42
-604308.03 793110.34
-604377.24 793090.65
-604374.7 793097.64
-604487.77 793061.44
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604793.23 791945.3
-Region  1
-  52
-609459.87 791813.23
-609454.25 791709.36
-609461.23 791660.81
-609400.27 791650.65
-609387.57 791582.7
-609377.41 791575.72
-609355.19 791545.24
-609325.98 791508.41
-609296.77 791482.37
-609277.72 791472.85
-609256.76 791480.47
-609244.06 791498.88
-609232.63 791482.37
-609222.47 791467.77
-609214.85 791455.07
-609033.06 791439.49
-608885.11 791330.59
-608905.75 791287.73
-608862.25 791271.54
-608828.28 791282.97
-608742.87 791362.98
-608615.55 791487.47
-608610.79 791516.37
-608622.4 791606.13
-608563.41 791672.51
-608511.34 791781.74
-608706.28 791870.34
-608683.11 791923.05
-608736.76 791937.33
-608789.47 791970.67
-608833.92 792023.66
-608877.73 792010.01
-608908.53 792010.33
-608973.94 792015.41
-609012.36 792015.4
-609030.77 792021.75
-609046.65 792032.86
-609071.73 792049.38
-609056.81 792065.22
-609048.87 792076.65
-609037.44 792121.1
-609094.15 792134.09
-609105.13 792135.65
-609169.27 792139.46
-609224.2 792130.26
-609265.34 792113.9
-609317.1 792080.56
-609360.6 792031.35
-609450.46 792057.7
-609472.2 792006.42
-609475.21 791908.12
-609459.87 791813.23
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609024.61 791733.53
-Region  1
-  123
-614878.82 796162.9
-615175.36 796495.68
-615216 796537.91
-615256.32 796579.82
-615172.18 796556.01
-615162.34 796563.31
-615151.86 796582.68
-615115.04 796618.24
-615116.47 796724.56
-615109.32 796891.63
-615092.81 796917.07
-615147.42 796926.28
-615203.93 796935.49
-615238.22 796972.32
-615262.04 796943.74
-615294.11 796873.22
-615321.8 796799.53
-615357.04 796754.76
-615489.42 796780.46
-615499.6 796931.62
-615501.19 796953.21
-615504.05 796972.26
-615505.63 796988.77
-615507.74 797003.12
-615513.25 797095.45
-615536.75 797105.92
-615563.73 797117.35
-615592.63 797129.74
-615648.19 797143.71
-615691.26 797132.34
-615755.44 797092.3
-615799.85 797079.48
-615881.15 797085
-616011.01 797097.54
-616052.62 797087.34
-616080.32 797069.37
-616109.95 797026.13
-616119.48 796963.9
-616101.41 796910.16
-616075.27 796869.87
-616034.63 796784.14
-616043.74 796731.02
-616051.14 796702.86
-616057.49 796678.73
-616063.84 796660.35
-616072.73 796637.49
-616101.94 796550.5
-616044.15 796393.6
-616513.17 796181.05
-616552.4 796134.85
-616593.51 796066.49
-616646.03 796017.76
-616636.02 796003.67
-616585.42 795931.11
-616596.85 795836.23
-616612.5 795720.29
-616657.15 795663.77
-616698.64 795612.31
-616765.1 795531.25
-616779.49 795531.61
-616872.62 795531.39
-616927.23 795530.33
-616961.31 795531.17
-617008.52 795527.27
-616973.04 795453.21
-616921.12 795400.03
-616867.29 795325.97
-616812.84 795263.3
-616753.95 795204.43
-616676.06 795118.96
-616615.27 795040.47
-616590.56 794969.57
-616593.07 794911.97
-616621.53 794848.05
-616663.91 794794.89
-616697.75 794769.96
-616728.17 794756.44
-616755.82 794735.86
-616703.7 794652.44
-616577.42 794614.34
-616510.59 794668.88
-616438.76 794667.95
-616426.78 794689.46
-616405.63 794693.58
-616313.24 794722.05
-616186.65 794731.52
-616016.4 794765.68
-615967.68 794795.42
-615955.67 794842.89
-615936.08 794937.2
-615896.88 795038.47
-615811.46 795117.57
-615700.09 795183.39
-615437.67 794783.49
-615296.7 794902.87
-615125.55 795050.77
-615116.03 795096.49
-615108.26 795125.07
-615085.29 795212.61
-615034.49 795230.39
-614977.34 795253.25
-615001.37 795316.21
-614985.56 795338.99
-614956.39 795406.19
-614830.02 795705.27
-614588.08 795561.83
-614576.02 795545.32
-614472.51 795483.09
-614316.94 795512.93
-614189.3 795507.21
-614189.3 795528.17
-614187.98 795986.72
-614271.8 795987.99
-614325.14 795982.91
-614335.93 795978.47
-614361.33 795979.74
-614398.43 795981.36
-614444.01 795989.6
-614493.37 795988.34
-614566.8 796001.64
-614661.75 796008.62
-614751.22 796043.24
-614878.82 796162.9
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 615690.6 795803.9
-Region  1
-  158
-604366.78 804044.43
-604471.39 804148.41
-604298.09 804342.62
-604294.09 804350.98
-604363.18 804390.25
-604399.54 804430.98
-604470.26 804550.46
-604493.9 804584.64
-604535.71 804597.73
-604736.97 804625.18
-604807.52 804633.55
-604843.53 804623.36
-604874.98 804603.18
-604901.89 804563.9
-604909.52 804541.72
-604924.61 804493.2
-604943.52 804433.19
-604947.52 804376.84
-604937.34 804311.74
-604930.79 804274.28
-604899.98 804104.2
-604910.78 804023.62
-604983.87 803725.41
-604981.33 803664.72
-605106.78 803609.06
-605307.02 803714.61
-605341.5 803818.84
-605294.13 803862.04
-605259.24 803906.91
-605250.1 803954.27
-605260.07 804001.62
-605282.5 804058.95
-605290.4 804180.67
-605302.86 804366.77
-605309.51 804394.19
-605324.47 804409.98
-605337.76 804418.28
-605352.71 804429.92
-605384.92 804455.25
-605439.63 804494.43
-605483.85 804533.23
-605523.04 804581.72
-605550.19 804634.49
-605592.49 804781.49
-605605.26 804825.77
-605628.57 804850.55
-605655.73 804858.7
-605684.05 804853.65
-605707.33 804835.81
-605721.3 804788.47
-605728.29 804727.55
-605755.84 804680.6
-605790.37 804649.56
-605823.15 804632.27
-605864.28 804624.9
-605971.76 804641.97
-606056.15 804660.81
-606110.47 804673.62
-606157.03 804683.71
-606198.16 804683.71
-606249.96 804668.42
-606291.08 804642.03
-606334.54 804603.23
-606364.03 804563.66
-606374.31 804520.8
-606377.41 804451.73
-606392.74 804421.28
-606424.95 804398
-606462.19 804390.24
-606499.44 804400.33
-606521.95 804416.24
-606540.33 804431.78
-606568.51 804469.39
-606616.82 804491.73
-606677.34 804481.65
-606770.85 804411.8
-606825.17 804365.63
-606846.32 804330.09
-606854.47 804293.23
-606843.41 804243.8
-606730.7 804023.57
-606679.68 803922.1
-606641.84 803825.27
-606647.66 803787.24
-606665.12 803759.31
-606656.59 803720.12
-606647.9 803682.85
-606635.35 803632.66
-606625.42 803581.43
-606610.78 803523.41
-606604.95 803473.26
-606605.03 803427.74
-606614.19 803398.73
-606646.08 803329.73
-606497.89 803102.08
-606375.57 802865.27
-606266.06 802882.25
-606205.45 802904.07
-606151.32 802926.95
-606074.48 802960.93
-606036.57 802980.01
-605992.66 802999.35
-605962.86 803012.42
-605940.91 803036.47
-605918.43 803022.35
-605880.79 803003.01
-605815.45 802970.6
-605788.78 802964.33
-605722.57 802979.61
-605613.39 803005.36
-605513.02 803025.75
-605501 803009.02
-605361.71 803029.15
-605303.16 803035.94
-605268.66 803037.51
-605267.09 803045.35
-605255.07 803064.17
-605234.68 803100.76
-605215.86 803131.61
-605157.31 803102.33
-605149.2 803057.11
-605149.73 803024.7
-605168.02 802978.18
-605176.91 802953.61
-605166.45 802930.6
-605142.93 802945.76
-604978.78 803051.88
-604931.74 803101.55
-604496.31 802887.67
-604431.69 803016.92
-604416.3 803049.54
-604359.68 803023.08
-604320.29 803002.15
-604288.9 802983.07
-604188.88 803185.22
-604146.41 803173.52
-604097.79 803180.91
-604051.01 803165.52
-604005.47 803144.6
-603962.39 803122.44
-603919.3 803092.28
-603887.91 803069.51
-603852.22 803039.96
-603824.52 803019.04
-603798.36 802998.42
-603784.82 802996.57
-603773.12 802986.73
-603746.66 803010.73
-603726.35 803032.89
-603694.96 803063.05
-603663.25 803094.74
-604547.04 803934.26
-604516.71 803972.24
-604476.23 804001.36
-604436.37 804016.56
-604402.2 804025.44
-604378.15 804028.61
-604366.78 804044.43
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605479.21 803744.22
-Region  1
-  229
-603174.97 791627.83
-603266.43 791732.62
-603336.92 791844.39
-603375.03 791935.21
-603375.97 791959.04
-603323.57 792132.75
-603300.4 792190.22
-603306.11 792237.85
-603421.7 792359.79
-603430.59 792432.82
-603296.31 792603.34
-603406.17 792687.17
-603423.95 792677.01
-603535.38 792700.24
-603541.73 792708.49
-604247 792856.13
-604205.82 792761.02
-604358.06 792733.45
-604440.77 792646.12
-604479.5 792589.6
-604509.98 792541.98
-604462.99 792550.23
-604409.02 792557.22
-604287.73 792576.9
-604242.65 792586.43
-604221.06 792552.14
-604194.98 792477.92
-604168.01 792293.52
-604248.95 792277.89
-604353.73 792258.84
-604412.15 792246.78
-604477.55 792235.35
-604522.68 792227.71
-604524.31 792191.66
-604526.49 792144.21
-604557.61 792039.09
-604590.63 791932.7
-604622.07 791827.93
-604630.65 791802.5
-604641.44 791791.7
-604713.52 791734.26
-604913.23 791910.76
-604972.92 791778.04
-605018.34 791660.19
-605012.94 791549.64
-604975.79 791541.38
-604945.95 791533.76
-604924.99 791529.95
-604893.24 791522.65
-604858.64 791515.34
-604832.92 791508.99
-604805.3 791501.69
-604781.49 791494.7
-604855.79 791286.42
-604930.4 791081.26
-604845.98 791040.7
-604271.3 790718.45
-604242.09 790748.3
-604193.19 790748.3
-604157.31 790733.05
-604131.91 790741.31
-604092.07 790671.94
-604055.08 790591.45
-604015.07 790481.91
-603989.7 790377.14
-603963.03 790207.59
-603653.82 790031.88
-603556.42 790420.75
-602988.37 790293.74
-603005.3 790207.59
-602967.75 790198.02
-602919.89 790188.45
-602855.1 790180.35
-602846.26 790172.99
-602805.38 790144.64
-602722.91 790192.5
-602634.55 790244.78
-602551.35 790308.1
-602439.43 790275.7
-602432.8 790305.89
-602419.92 790373.26
-602399.31 790462.36
-602388.26 790512.43
-602250.57 790481.5
-602270.84 790386.88
-602326.06 790157.15
-602367.3 790118.86
-602359.93 790102.67
-602256.85 790084.26
-602189.11 790068.06
-602150.52 790059.94
-602260.62 789554.65
-602176.63 789505.63
-602103.29 789478.96
-602054.08 789457.08
-601975.02 789486.29
-601911.2 789509.15
-601823.58 789537.7
-601683.88 789499.28
-601631.81 789482.42
-601585.14 789464.64
-601520.37 789448.13
-601462.26 789436.7
-601413.05 789426.23
-601335.1 789389.72
-601290.84 789358
-601201.94 789281.48
-601195.59 789265.61
-601177.81 789300.85
-601157.8 789315.46
-601140.66 789321.49
-601125.1 789327.2
-601154.95 789335.46
-601182.55 789360.58
-601188.28 789371.34
-601198.13 789385.94
-601198.13 789402.45
-601195.59 789424.68
-601183.52 789472.31
-601160.97 789539.3
-601161.29 789559.94
-601171.13 789592.01
-601167.01 789607.57
-601141.29 789626.63
-601073.35 789681.24
-601049.22 789707.6
-601041.28 789728.23
-601044.08 789742.87
-601043.19 789751.09
-601047.63 789769.51
-601044.46 789774.91
-601043.47 789795.4
-601041.57 789811.86
-601046 789831.73
-601048.54 789845.7
-601052.04 789862.84
-601055.53 789883.16
-601110.92 789903.97
-601104.57 789923.33
-601102.03 789947.15
-601104.89 789975.41
-601113.78 789989.38
-601136.32 790015.73
-601097.91 790022.08
-601070.14 790019.48
-600944.84 789980.44
-600912.45 789963.29
-600856.79 789915.64
-600814.02 789883.27
-600765.11 789862.31
-600725.74 789861.04
-600655.85 789888.38
-600562.2 789934.42
-600611.74 790039.21
-600619.99 790081.76
-600617.45 790116.06
-600628.86 790142.07
-600629.54 790128.04
-600719.07 790086.21
-600784.16 790071.9
-600850.21 790071.9
-600934.04 790089.04
-601012.79 790128.42
-601053.44 790160.81
-601097.26 790211.62
-601153.47 790302.15
-601304.31 790546.99
-601334.79 790610.5
-601397.99 790796.29
-601445.62 790859.8
-601517.38 790911.24
-601606.62 790939.51
-601698.71 790936.97
-601711.41 790945.23
-601708.23 791000.48
-601687.91 791029.7
-601705.69 791048.11
-601723.16 791044.66
-601758.73 791028.15
-601776.51 791039.58
-601805.72 791076.41
-601834.3 791084.67
-601849.55 791082.13
-601871.77 791070.7
-601892.73 791073.24
-601921.95 791113.88
-601965.77 791139.92
-601986.73 791172.95
-601996.25 791215.5
-602012.13 791259.95
-602037.53 791259.95
-602068.02 791271.39
-602125.49 791290.15
-602145.18 791318.73
-602158.52 791349.22
-602176.3 791372.72
-602223.93 791388.59
-602258.23 791389.23
-602278.55 791380.97
-602303.32 791372.72
-602328.39 791375.32
-602344.6 791408.28
-602362.38 791407.01
-602387.88 791383.54
-602440.81 791395.9
-602482.73 791411.14
-602535.44 791445.44
-602583.45 791462.01
-602631.55 791490.48
-602678.97 791520.38
-602737.08 791547.39
-602782.81 791555.66
-602796.78 791562.63
-602827.9 791563.9
-602869.18 791559.45
-602880.61 791562.63
-602899.03 791562.63
-602913.64 791561.99
-602922.53 791559.45
-602935.87 791559.45
-602949.2 791557.55
-602965.72 791559.45
-602981.59 791554.37
-603019.7 791552.47
-603043.2 791556.28
-603067.33 791564.53
-603111.79 791583.59
-603123.85 791598.19
-603174.97 791627.83
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603056.04 791013.06
-Region  1
-  99
-604789.14 789148.97
-604711.04 789220.76
-604566.57 789049.27
-604541.81 789001.33
-604203.99 789091.23
-603926.18 789106.77
-603899.51 789107.4
-603806.11 789455.12
-603800.4 789473.22
-603797.22 789484.97
-603856.91 789511.96
-603842.31 789431.95
-603963.27 789497.35
-604307.63 789681.07
-604820.4 789957.34
-604810.88 790026.84
-604792.78 790151.62
-604791.19 790227.86
-604784.83 790244.06
-604804.83 790387.29
-604826.84 790480.81
-604861.67 790620.73
-604884.53 790666.13
-604910.38 790725.64
-604907.84 790803.76
-604890.71 790874.52
-604877.38 790946.6
-604867.85 790993.31
-604845.98 791040.7
-604930.4 791081.26
-604942.46 791059.35
-604993.9 791001.88
-605030.73 790973.9
-605055.5 790954.85
-605093.28 790928.82
-605065.34 790888.49
-605106.3 790850.74
-605149.16 790811.37
-605184.72 790778.66
-605210.12 790755.16
-605223.45 790742.78
-605241.23 790703.41
-605256.79 790668.8
-605271.4 790661.81
-605312.35 790664.02
-605329.5 790665.6
-605334.58 790646.87
-605430.46 790590.99
-605473.01 790569.72
-605512.38 790569.72
-605536.19 790561.79
-605584.77 790479.51
-605601.6 790447.44
-605622.24 790430.93
-605673.67 790418.87
-605711.77 790409.66
-605727.01 790397.59
-605743.2 790377.59
-605750.83 790358.56
-605754.63 790351.61
-605758.44 790343.35
-605789.55 790270.96
-605801.94 790232.44
-605815.15 790194.5
-605944.69 790107.19
-605966.28 790084.33
-605975.03 790004.3
-605984.71 789866.34
-605973.28 789839.99
-605911.69 789781.88
-605840.3 789714.83
-605804.42 789678.63
-605847.28 789558.93
-605879.03 789504.01
-605955.23 789438.27
-605927.74 789400.51
-605902.41 789364.43
-605871.38 789309.35
-605840.97 789251.12
-605807.56 789226.84
-605746.92 789203.34
-605698.98 789183.66
-605633.57 789162.98
-605516.41 789114.72
-605487.2 789115.97
-605434.5 789132.48
-605373.22 789159.47
-605300.83 789191.54
-605289.57 789054.6
-605254.33 789029.68
-605212.36 789001.01
-605139.55 788947.2
-605107.28 788924.78
-605005.36 788854.61
-604996.78 788842.87
-604951.06 788988.61
-604937.09 789011.15
-604863.12 789078.49
-604789.14 789148.97
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605064.43 789757.31
-Region  1
-  27
-609056.02 796409.29
-609267.23 797215.74
-609270.34 797227.62
-609271.61 797232.45
-609273.26 797238.75
-609360.23 797274.01
-609360.24 797274.01
-609360.26 797274.02
-609432.33 797303.24
-609512.36 797335.69
-609512.41 797335.71
-609536.47 797345.46
-609541.84 797345.36
-609718.25 797342.19
-609718.28 797342.19
-609721.17 797342.14
-610050.46 797317.15
-610101.36 797313.29
-610129.65 797311.15
-610396.51 796849.49
-610445.47 796767.66
-610364.34 796720.1
-609200.43 796041.44
-609187.49 796032.42
-609186.66 796035.38
-609186.35 796036.26
-609056.02 796409.29
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609665.33 796785.33
-Region  1
-  30
-608286.33 795846.18
-608017.05 795860.74
-607777.86 795880.63
-607678.4 795911.2
-607656.08 795918.96
-607635.94 795927.94
-607627.21 795982.28
-607664.36 796092.06
-607663.64 796118
-607662.2 796138.18
-607657.16 796309.69
-607696.07 796320.5
-607753.36 796332.38
-607810.29 796306.44
-607880.19 796268.97
-607911.18 796267.52
-607945.77 796138.53
-607994.77 796104.66
-608029.36 796082.32
-608035.85 796088.81
-608046.66 796107.54
-608063.23 796139.25
-608075.48 796165.2
-608087.01 796224.29
-608042.34 796306.44
-608147.55 796335.99
-608188.62 796271.13
-608201.59 796258.16
-608304.77 795846.18
-608286.33 795846.18
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607951.35 796064.08
-Region  1
-  111
-610975.76 792025.47
-611024.47 792073.78
-611045.17 792131.49
-611043.66 792191.8
-611017.08 792256.53
-610981.04 792286.4
-610928.94 792309.03
-610813.53 792326.34
-610618.19 792352.94
-610556.42 792369.91
-610505.5 792405.55
-610476.49 792451.14
-610463.25 792519.37
-610492.62 792601.04
-610689.13 792836.04
-610723.74 792824.61
-610837.4 792910.33
-610847.88 792905.89
-610866.61 792874.14
-610945.2 792827.62
-610989.97 792806.98
-611026.48 792803.81
-611048.39 792805.72
-611110.31 792759.12
-611170.43 792718.61
-611223.83 792677.57
-611314 792669
-611376.23 792650.27
-611406.86 792661.53
-611526.37 792754.4
-611628.29 792821.06
-611606.07 792910.28
-611685.3 792894.88
-611752.29 792880.26
-611716.69 792779.63
-611792.25 792738.67
-611841.46 792851.39
-611861.78 792825.67
-611877.98 792794.87
-611903.86 792711.84
-611920.69 792679.78
-611958.79 792637.86
-612005.01 792589.12
-612019.3 792538
-611995.49 792462.12
-611983.89 792382.57
-611941.15 792285.25
-611887.17 792040.63
-612025.6 792038.73
-611978.3 791896.48
-611918.29 791957.45
-611843.04 791837.73
-611790.34 791793.26
-611781.13 791715.16
-611811.93 791645.28
-611799.55 791611.29
-611765.26 791602.72
-611747.8 791609.07
-611695.41 791642.09
-611854.16 791436.37
-612049.1 791434.47
-611924.96 791332.22
-611906.58 791222.68
-611890.38 791207.44
-611862.13 791211.57
-611844.35 791220.46
-611769.41 791228.08
-611731.63 791211.25
-611704.25 791114.33
-611660.07 791061.36
-611658.49 791037.55
-611651.5 791016.27
-611623.65 790991.21
-611558.25 790961.04
-611537.29 790960.41
-611474.99 790997.55
-611437.99 791030.69
-611340.01 791070.86
-611273.02 791074.04
-611216.18 791052.13
-611045.88 790956.4
-610917.94 790891.86
-610790.38 790774.05
-610627.18 790610.78
-610582.86 790562.66
-610517.75 790481.14
-610501.09 790467.73
-610491.75 790442.95
-610473.06 790409.64
-610471.84 790393.39
-610448.48 790346.06
-610424.1 790316
-610405.82 790291.22
-610306.09 790215.05
-610261.17 790156.26
-610245.15 790130.96
-610221.49 790067.22
-610189.91 790116.34
-610138.54 790169.6
-610099.79 790215.73
-610078.85 790267.39
-610081.39 790329.62
-610140.13 790525.48
-610196.5 790718.36
-610199.32 790825.1
-610231.85 790910.99
-610567.76 791819.43
-610596.27 791871.02
-610645.32 791908.14
-610933.83 792003.52
-610975.76 792025.47
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611098.07 791696.71
-Region  1
-  132
-606721.71 793362.33
-606768.52 793293.34
-606793.94 793257.4
-606817.44 793218.98
-606506.54 792862.58
-606584.33 792757.48
-606601.47 792724.11
-606641.79 792617.7
-606678.62 792547.53
-606694.93 792511.83
-606708.26 792481.99
-606744.06 792413.9
-606745.49 792388.94
-606749.05 792351.85
-606746.2 792296.23
-606738.35 792255.57
-606720.16 792204.58
-606699.48 792175.34
-606583.22 792079.77
-606318.21 791904.04
-606317.57 791829.14
-606328.36 791727.51
-606333.44 791669.09
-606332.17 791631.63
-606287.09 791513.59
-606278.52 791480.25
-606321.07 791450.09
-606355.99 791423.1
-606298.48 791376.39
-606062.26 791187.8
-605955.57 791087.34
-605911.76 791060.03
-605875.94 791035.71
-605961.03 790960.46
-605858.47 790927.44
-605819.77 791096.23
-605770.88 791189.79
-605711.4 791281.99
-605658.59 791362.15
-605608.64 791439.27
-605549.69 791515.55
-605481.01 791590.2
-605431.37 791635.87
-605297.49 791745.34
-605211.02 791815.01
-605148.48 791866.36
-605160.76 791893.24
-605164.99 791904.67
-605170.71 791914.41
-605174.52 791929.65
-605173.46 791943.2
-605137.05 791964.79
-605138.75 791974.52
-605159.28 791988.28
-605183.83 792001.83
-605148.06 792037.17
-605155.47 792055.38
-605163.3 792056.65
-605187.01 792046.7
-605196.32 792056.76
-605193.57 792070.94
-605184.68 792077.93
-605154.2 792084.28
-605103.82 792083.79
-605066.15 792092.47
-605041.17 792105.16
-605005.04 792099.88
-604975.83 792112.58
-604935.19 792165.92
-604902.17 792164.65
-604897.09 792188.78
-604933.92 792207.83
-604946.62 792289.11
-604904.71 792289.11
-604871.69 792351.27
-604833.59 792362.1
-604877.41 792398.6
-604895.5 792528.79
-604817.71 792691.68
-604887.56 792752.33
-604940.26 792754.23
-605010.43 792731.69
-605018.63 792768.07
-605026.25 792804.27
-605031.33 792829.03
-604998.31 792827.76
-604968.46 792827.13
-604931.63 792823.95
-604941.79 792889.36
-604947.51 792908.41
-605031.45 792911.35
-605108.8 792939.52
-605153.88 792970.64
-605191 793002.73
-605235.46 793041.47
-605280.55 793092.28
-605331.99 793145.62
-605477.41 793205.95
-605541.87 793210.08
-605602.84 793210.08
-605664.44 793211.99
-605740.64 793218.34
-605818.12 793233.58
-605901.95 793268.51
-605960.79 793313.89
-606008.08 793351.26
-606050.04 793383.68
-606094.66 793421.82
-606132.42 793453.86
-606188.67 793511.26
-606220.71 793558.56
-606244.57 793623.67
-606237.49 793689.02
-606216.13 793752.72
-606183.52 793804.02
-606148.48 793837.19
-606010.26 793934.49
-606040.74 793983.7
-606329.14 793849.57
-606387.56 793823.85
-606474.77 793737.3
-606510.96 793716.98
-606568.11 793714.44
-606577 793700.47
-606560.81 793670.31
-606565.57 793657.29
-606575.41 793633.79
-606601.39 793614.35
-606611.55 793555.16
-606631.55 793496.45
-606653.77 793460.57
-606721.71 793362.33
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605891.86 792461.58
-Region  1
-  72
-615754.36 800435.37
-615832.84 800427.71
-616204.04 800506.18
-616203.56 800476.04
-616189.21 800430.59
-616194.95 800349.25
-616204.28 800214.1
-616246.86 800204.53
-616246.51 800159.14
-616245.94 800153.35
-616244.88 800137.68
-616245.34 800130.28
-616220.66 800061.76
-616222.54 800025.73
-616179.99 799914.28
-616161.9 799866.02
-616124.21 799787.6
-616041.54 799815.15
-616021.81 799759.26
-616008.19 799713.82
-615931.68 799699.53
-615881.51 799717
-615876.43 799739.86
-615867.9 799769.36
-615860.06 799803.4
-615866.81 799822.46
-615886.95 799872.34
-615906.52 799937.28
-615902.54 799938.01
-615788.29 799979.12
-615779.63 799990.37
-615746.75 800085.14
-615671.01 800066.1
-615591.39 800015.04
-615542.49 799983.45
-615456.37 799914.64
-615437.96 799901.02
-615416.18 799884.27
-615055.78 799796.55
-614707.04 799306.85
-614642.09 799354.24
-614583.67 799354.24
-614534.77 799326.3
-614482.29 799275.33
-614434.76 799229.17
-614463.31 799279.77
-614483 799333.53
-614486.88 799395.53
-614488.08 799451.12
-614467.14 799509.76
-614443.68 799544.1
-614414.57 799578.24
-614337.09 799628.92
-614285.36 799654.67
-614238.04 799684.82
-614170.8 799726.57
-614121.82 799777.79
-614106.99 799812.24
-614087.85 799862.95
-614078.76 799889.74
-614077.81 799904.57
-614411.46 800172.25
-614460.97 800227.99
-614537.04 800323.2
-614571.71 800382.28
-614727.67 800332.52
-614795.61 800309.08
-614776.47 800244.97
-614778.86 800232.53
-615224.27 800324.85
-615636.67 800410.97
-615754.36 800435.37
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 615134.59 799996.79
-Region  1
-  29
-609626.53 799456.79
-609259.34 799386.37
-609215 799391.25
-609198.65 799472.44
-609181.82 799557.5
-609168.17 799629.15
-609140.64 799768.32
-609527.1 799839.9
-609606.06 799843.8
-609597.75 799953.48
-609912.63 800095.8
-609956.5 800116.28
-609967.22 800003.19
-609949.67 799980.77
-609900.93 799933
-609862.91 799896.93
-609838.54 799872.56
-609820.99 799856.96
-609838.54 799779.95
-609850.24 799708.79
-609860.96 799661.02
-609856.09 799613.25
-609852.39 799558.92
-609806.25 799555.8
-609772.95 799554.41
-609736.65 799553.3
-609702.27 799550.31
-609622.79 799547.27
-609626.53 799456.79
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609547.1 799701.09
-Region  1
-  40
-609977.59 798430.62
-610349.98 798233.01
-610781.51 798002.88
-610752.99 797972.24
-610690.5 797956.47
-610638.02 797949.49
-610619.02 797927.72
-610586.34 797893.13
-610569.18 797875.43
-610553.37 797857.53
-610458.47 797853.5
-610331.97 797859.67
-610219.9 797864.95
-610157.54 797868.49
-610104.16 797860.32
-610038.93 797829.38
-609956 797785.37
-609870.21 797756.23
-609770.13 797726.92
-609709.8 797725.42
-609628.37 797732.5
-609562.74 797749.93
-609513.3 797783.55
-609476.95 797841.72
-609460.06 797877.39
-609427.79 797941.83
-609386.54 798023.68
-609314.77 798166.8
-609269.96 798221.4
-609223.39 798255.72
-609141.56 798300.26
-609026.36 798363.44
-609039.43 798385.23
-609104.37 798482.7
-609127.52 798518.11
-609193.84 798617.41
-609267.77 798492.3
-609794.22 798505.1
-609842.29 798504.94
-609977.59 798430.62
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609836.99 798138.18
-Region  1
-  136
-603740.77 805799.57
-604404.28 805677.04
-604440.74 805674.5
-604472.96 805683.82
-604522.99 805749.11
-604591.67 805848.32
-604702.34 805517.2
-604749.83 805431.56
-604793.07 805353.55
-604793.07 805352.71
-604808.33 805306.92
-604872.78 805246.71
-604918.14 805203.89
-604974.11 805158.1
-605058.05 805114.01
-605178.46 805048.72
-605210.92 804998.68
-605205.28 804947.43
-605117.13 804758.83
-605069.98 804734.23
-605003.87 804750.12
-604938.83 804789.78
-604882.99 804805.89
-604778.73 804822.37
-604713.78 804827.86
-604580.04 804807.25
-604488.63 804797.24
-604397.17 804768.17
-604318.07 804742.28
-604264.38 804745.64
-604219.32 804761.46
-604193.43 804763.37
-604168.99 804752.35
-604156.04 804734.61
-604151.48 804711.87
-604163.47 804682.15
-604197.5 804630.86
-604199.42 804597.78
-604182.64 804561.83
-604154.83 804515.7
-604133.37 804477.52
-604118.1 804448.79
-604113.01 804419.71
-604127.56 804384.07
-604163.55 804341.53
-604185.37 804325.89
-604216.28 804319.71
-604294.09 804350.98
-604298.09 804342.62
-604471.39 804148.41
-604366.78 804044.43
-604378.15 804028.61
-604402.2 804025.44
-604436.37 804016.56
-604476.23 804001.36
-604516.71 803972.24
-604547.04 803934.26
-603663.25 803094.74
-603604.32 803040.44
-603564 803015.86
-603528.6 803003.07
-603486.31 802995.2
-603429.28 802994.22
-603361.42 802994.22
-603294.55 802992.25
-603262.1 802995.2
-603213.92 803006.02
-603175.57 803015.86
-603017.24 803143.69
-602769.4 803382.68
-602747.77 803474.14
-602746.78 803506.59
-602745.8 803527.24
-602741.87 803544.94
-602734.98 803563.63
-602723.18 803626.56
-602713.35 803670.82
-602710.42 803723.94
-602739.92 803787.86
-602780.75 803830.64
-602822.05 803858.17
-602874.17 803868.99
-602890.89 803867.02
-602935.14 803895.54
-602970.54 804000.77
-602989.23 804034.2
-603025.61 804068.62
-603060.03 804066.65
-603085 804064.07
-603129.86 804033.22
-603184.93 803930.94
-603230.16 803867.02
-603251.8 803830.64
-603299 803840.47
-603330.47 803885.71
-603374.72 803952.58
-603406.46 803986.72
-603436.17 804026.83
-603478.45 804115.34
-603446.98 804161.56
-603413.55 804205.81
-603381.1 804248.1
-603357.49 804283.5
-603325.04 804337.59
-603298.49 804376.92
-603398.11 804391.63
-603478.52 804406.14
-603580.42 804397.86
-603803.5 804430.78
-603840 804440.75
-603865.52 804450.77
-603845.1 804474.28
-603551.08 804725.59
-603314.71 804936.79
-603230.34 805010.14
-603173.53 805060.16
-603121.81 805102.56
-603064.87 805166.17
-603035.32 805227.21
-603025.99 805245.01
-603050.58 805256.04
-603374.04 805382.39
-603152.75 805939.36
-603148.77 805949.36
-603449.63 806093.46
-603454.97 806083.46
-603473.62 806048.53
-603493.86 806032.7
-603512.83 806016.24
-603550.15 805995.98
-603569.76 805987.74
-603600.11 805955.46
-603630.23 805910.13
-603675.68 805840.58
-603701.85 805813.72
-603740.77 805799.57
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603828.12 804538.39
-Region  1
-  69
-607834.8 789884.27
-607441.1 789809.65
-607384.91 789816.95
-607344.73 789800.3
-607090.48 789835.06
-607046.98 789790.93
-606780.84 789931.75
-606856.72 790022.89
-606816.71 790043.5
-606709.72 790200.99
-606742.41 790291.96
-606757.34 790358.95
-606844.07 790748.64
-606951.38 790793.41
-607052.36 790837.23
-607015.83 790870.57
-607009.17 790909.97
-607031.07 790952.51
-607067.27 791013.78
-607095.84 791067.76
-607096.82 791112.84
-607051.39 791149.99
-606999 791157.58
-607039.96 791227.75
-607065.68 791266.17
-607131.09 791263
-607172.36 791264.27
-607205.11 791260.97
-607189.51 791307.77
-607216.81 791324.63
-607282.85 791357.01
-607352.7 791388.76
-607371.11 791396.38
-607389.84 791426.86
-607412.7 791447.83
-607428.89 791458.63
-607451.43 791467.2
-607482.87 791473.87
-607534.3 791483.71
-607538.43 791526.56
-607547 791563.07
-607557.16 791620.54
-607570.82 791693.25
-607591.77 791813.56
-607594.94 791924.01
-608271.39 791975.44
-608299.38 791888.28
-608320.34 791864.14
-608366.7 791857.48
-608427.98 791859.06
-608456.87 791850.17
-608482.91 791832.07
-608497.16 791817.53
-608511.34 791781.74
-608563.41 791672.51
-608622.4 791606.13
-608610.79 791516.37
-608615.55 791487.47
-608621.58 791441.12
-608627.3 791395.39
-608629.83 791376.69
-608652.02 791219.93
-608659.64 791148.81
-608511.08 791065.86
-608450.09 791162.15
-608227.84 790894.81
-608629.82 790219.61
-608167.54 790000.16
-607834.8 789884.27
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607731.57 790804.15
-Region  1
-  25
-603126.4 802871.3
-602818.6 802723.79
-602811.72 802715.93
-602809.75 802715.93
-602793.03 802749.36
-602763.53 802784.76
-602710.43 802817.21
-602558.01 802886.05
-602478.84 802882.63
-602414.93 802914.09
-602516.71 803078.79
-602562.93 803162.39
-602605.21 803231.23
-602634.72 803282.37
-602663.24 803330.55
-602706.51 803403.33
-602747.77 803474.14
-602769.4 803382.68
-603017.24 803143.69
-603175.57 803015.86
-603129.35 802964.72
-603123.45 802923.42
-603124.43 802900.8
-603123.45 802886.05
-603126.4 802871.3
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 602798.84 803037.38
-Region  1
-  67
-604533.92 794044.44
-604547.26 794081.28
-604538.37 794124.47
-604523.12 794145.11
-604384.25 794168.93
-604253.55 794189.25
-604113.1 794218.5
-604095.32 794222.95
-604479.93 794831.8
-604564.4 794772.42
-604536.14 794733.36
-604498.99 794688.91
-604485.97 794666.05
-604472.15 794619.52
-604470.72 794571.71
-604497.71 794529.16
-604562.49 794474.23
-604634.1 794401.01
-604703.32 794418.15
-604757.78 794457.38
-604834.31 794518.66
-604914.97 794477.07
-604955.46 794458.84
-604999.91 794502.34
-605039.29 794479.16
-605120.9 794469.95
-605129.3 794430.2
-605131.84 794420.99
-604974.53 794215.55
-605011.2 794204.96
-605051.53 794195.59
-605012.73 794129.1
-604990.93 794090.6
-604975.45 794060.25
-604973.69 794055.37
-604909.14 794072.52
-604871.67 794047.76
-604857.28 794007.96
-604864.27 793878.72
-604897.09 793818.59
-604975.62 793667.09
-605011.39 793649.73
-605054.58 793653.33
-605076.59 793636.19
-605122.31 793640.84
-605194.07 793571.17
-605286.68 793489.76
-605238.42 793431.65
-605176.02 793401.3
-605084.25 793439.09
-604948.49 793485.57
-604889.43 793518.91
-604862.82 793533.59
-604821.07 793593.72
-604785.02 793668.4
-604756.85 793763.59
-604725.56 793764.6
-604628.24 793775.02
-604613.48 793773.91
-604577.59 793799.95
-604543.62 793781.85
-604508.37 793756.45
-604467.72 793783.44
-604453.91 793793.43
-604467.71 793838.5
-604477.4 793909.17
-604533.92 794044.44
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604693.77 794126.66
-Region  1
-  92
-610518.38 801303.38
-610714.63 801226.77
-610850.84 801174.05
-610941.65 801180.51
-610981.46 801182.05
-611003.84 801166.55
-611015.89 801133.41
-611116.5 801144.03
-611196.87 801147.4
-611335.02 801167.2
-611281.66 801060.46
-611278 801026.63
-611278.43 800968.09
-611283.59 800916.45
-611211.5 800884.32
-611192.99 800922.2
-611087.97 800905.84
-610950.82 800883.41
-610879.67 800872.07
-610783.9 800819.69
-610701.8 800738.37
-610626.36 800665.27
-610645.9 800616.8
-610665.84 800569.49
-610683.24 800527.45
-610716.47 800444.96
-610697.7 800426.98
-610669.36 800419.74
-610658.99 800323.34
-610649.61 800237.72
-610643.55 800193.71
-610615.02 800126.08
-610610.72 800103.41
-610602.12 800085.43
-610611.5 799990.04
-610618.34 799958.19
-610633.98 799933.56
-610653.91 799916.36
-610687.53 799910.5
-610688.71 799872.58
-610688.71 799837.39
-610627.72 799844.43
-610574.95 799850.68
-610556.57 799852.64
-610532.34 799854.98
-610440.47 799877.27
-610415.33 799884.78
-610338.81 799876.52
-610282.93 799862.52
-610253.09 799844.74
-610242.93 799824.42
-610207.37 799848.57
-610182.92 799865.71
-610132.94 799894.98
-610095.9 799917.41
-610066.65 799934.95
-610049.25 799950.17
-609992.42 799938.1
-609967.22 800003.19
-609956.5 800116.28
-609960.39 800163.07
-609969.17 800202.06
-609997.75 800326.15
-609997.75 800400.43
-609985.64 800465.03
-609953.97 800529.15
-609838.89 800708
-609813.63 800768.39
-609808.55 800830.54
-609836.11 800929.28
-609879.3 801068.67
-609892.99 801129.65
-609892.36 801193.37
-609871.58 801275.63
-609829.31 801393.96
-609739.85 801657.67
-609735.1 801674.65
-609959.7 801971.07
-609990.83 802033.47
-610013.02 802110.45
-610038.49 802197.47
-610066.68 802129.69
-610139.22 801966.05
-610394.87 802094.3
-610409.07 802042.22
-610406.68 802005.86
-610445.64 801778.01
-610438.32 801644.18
-610363.22 801470.53
-610331.37 801400.38
-610367.52 801363.79
-610518.38 801303.38
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610317.77 800934.73
-Region  1
-  120
-616755.31 799397.96
-616768.8 799375.89
-616783.08 799352.07
-616791.97 799330.48
-616802.45 799310.16
-616803.4 799267.61
-616812.29 799235.55
-616821.07 799179.86
-616833.88 799153.31
-616841.5 799119.02
-616847.22 799099.63
-616854.52 799085.02
-616863.1 799076.77
-616905.32 799064.38
-616938.03 799065.97
-616968.19 799074.23
-617111.39 799092.33
-617127.26 799093.29
-617137.74 799085.67
-617153.3 799050.42
-617159.01 799017.08
-617153.3 799005.02
-617134.67 799006.1
-617139.97 798964.64
-617152.02 798955.97
-617126.83 798912.47
-617116.35 798853.28
-617097.8 798826.46
-617078.76 798782.58
-617060.19 798761.61
-617057.18 798740.49
-617069.11 798705.21
-617093.94 798591.91
-617053.32 798547.42
-617060.79 798531.99
-617115.27 798535.85
-617164.69 798556.82
-617190.49 798531.99
-617196.38 798510.47
-617186.26 798486.12
-617191.68 798467.95
-617177.22 798446.02
-617171.43 798423.6
-617165.77 798406.4
-617224.11 798375.07
-617281.24 798359.16
-617284.13 798349.03
-617262.56 798312.74
-617290.76 798292.73
-617316.07 798284.06
-617331.5 798273.69
-617332.83 798251.43
-617345.36 798232.87
-617373.57 798241.79
-617380.8 798255.29
-617388.03 798252.88
-617395.26 798208.28
-617409.72 798190.69
-617433.47 798183.8
-617485.3 798160.9
-617533.64 798116.7
-617577.39 798070.8
-617635.48 798029.82
-617644.88 797994.62
-617587.27 797993.42
-617521.7 797982.33
-617482.93 797972.41
-617440.5 797959.15
-617380.99 797951.58
-617335.43 797965.53
-617282.29 797990.23
-617204.45 798001.02
-617161.99 797964.98
-617048.2 797869.77
-616555.12 797636.95
-616527.82 797587.14
-616505.91 797545.86
-616409.07 797619.84
-616395.07 797672.45
-616372.55 797788.42
-616359.85 797853.41
-616350.96 797889.71
-616372.55 797938.33
-616417.72 798067.85
-616446.31 798151.98
-616465.38 798210.81
-616475.42 798270.11
-616470.97 798355.55
-616455.41 798405.08
-616432.14 798460.73
-616405.65 798535.4
-616386.83 798614.94
-616369.68 798702.28
-616380.48 798709.9
-616398.58 798751.5
-616333.81 798788.93
-616259.83 798838.15
-616196.96 798877.52
-616137.59 798915.3
-616145.36 798929.04
-616198.72 799016.66
-616214.44 799044.13
-616198.24 799120.65
-616166.05 799273.2
-616150.28 799318.76
-616122.82 799449.45
-616113.93 799472.95
-616112.66 799482.48
-616190.7 799521.65
-616260.52 799549.69
-616280.86 799567.83
-616296.25 799541.44
-616671.2 799626.66
-616698.14 799633.8
-616723.42 799587.62
-616731.12 799548.04
-616713.53 799515.61
-616716.28 799482.07
-616741.02 799432.04
-616755.31 799397.96
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 616725.83 798592.17
-Region  1
-  135
-608501.68 798601.09
-607699.22 798592.87
-607684.77 798653.61
-607665.49 798731.8
-607652.94 798786.36
-607651.86 798855.01
-607678.27 798868.87
-607770.92 798910
-607787.81 798916.93
-607811.19 798927.32
-607813.14 798962.21
-607849.29 799013.11
-607881.33 799062.04
-607883.49 799004.02
-607959.7 799038.66
-608085.06 799098.29
-608119.89 799110.93
-608159.3 799132.17
-608196.54 799147.76
-608227.28 799303.63
-608192.64 799268.13
-608158 799254.71
-608121.72 799258.18
-608104.1 799248.45
-608045.21 799290.88
-607985.89 799337.64
-607858.38 799246.06
-607676.75 799109.41
-607648.17 799102.92
-607516.55 799095.99
-607449.87 799086.9
-607364.83 799079.32
-607336.7 799099.23
-607317.43 799069.59
-607295.36 799042.76
-607225.02 799094.27
-607154.89 799147.72
-607085.53 799183.37
-607058.23 799198.61
-607027.11 799214.49
-607002.97 799227.83
-606985.83 799237.35
-606958.52 799251.96
-606936.93 799268.47
-606911.53 799237.99
-606906.45 799202.43
-606903.27 799157.97
-606791.5 799227.19
-606781.28 799235.48
-606767.82 799235.48
-606758.39 799249.83
-606783.52 799287.97
-606788.91 799321.63
-606791.6 799356.18
-606800.57 799407.33
-606757.95 799397.01
-606730.13 799395.22
-606707.69 799396.56
-606690.19 799397.01
-606667.31 799398.81
-606627.37 799414.96
-606646.67 799446.82
-606691.61 799526.85
-606725.65 799593.04
-606799.89 799738.24
-606856.62 799839.42
-606910.52 799936.81
-606944.9 799985.23
-606968.21 800020.03
-607005.55 800057.4
-607090.66 800127.38
-607162.52 800167.1
-607223.99 800199.25
-607291.13 800233.29
-607369.62 800274.9
-607440.95 800320.92
-607506.26 800384.08
-607574.02 800432.84
-607641.2 800495.43
-607715.34 800561.19
-607837.23 800647.9
-607873.74 800681.32
-607927.99 800715.91
-607955.9 800732.57
-607963.46 800724.06
-608045.26 800632.77
-608109.56 800555.23
-608155.9 800496.61
-608185.21 800434.2
-608215.47 800350.98
-608248.09 800300.38
-608293.48 800266.34
-608362.71 800227.15
-608401.28 800173.67
-608438.68 800062.67
-608440.63 799975.91
-608536.17 799904.74
-608561.05 799890.77
-608680.45 799841.37
-608840.32 799782.88
-608804.99 799691.02
-608790.37 799614
-608791.58 799533.82
-608781.83 799456.81
-608767.94 799408.31
-608721.14 799321.55
-608678.25 799275.24
-608634.38 799241.12
-608603.19 799223.09
-608603.94 799206.27
-608605.89 799104.39
-608641.47 799105.37
-608745.29 799107.81
-608735.06 799014.71
-608725.8 798953.29
-608721.41 798909.42
-608711.52 798829.09
-608706.07 798793.14
-608632.23 798805.09
-608596.79 798807.64
-608543 798818.42
-608503.12 798822.87
-608461.65 798825.67
-608483.98 798785.63
-608494.87 798768.2
-608507.81 798744.11
-608522.79 798720.41
-608535.59 798697.26
-608507.54 798681.47
-608483.44 798668.54
-608468.46 798660.1
-608480.44 798640.22
-608489.43 798623.61
-608494.6 798614.35
-608501.68 798601.09
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607836.58 799593.41
-Region  1
-  62
-607651.86 798855.01
-607652.94 798786.36
-607665.49 798731.8
-607684.77 798653.61
-607699.22 798592.87
-607712.91 798540.59
-607739.98 798430.4
-607623.07 798401.82
-607593.84 798395.57
-607571.76 798389.94
-607647.76 798114.29
-607653.6 798091.57
-607508.55 798053.9
-607452.69 798059.53
-607399.86 798062.56
-607390.77 798099.8
-607384.92 798116.02
-607378.86 798135.07
-607329.06 798134.21
-607294.85 798135.07
-607299.62 798246.35
-607302.64 798414.81
-607017.94 798417.6
-606874.62 798425.39
-606750.52 798451.42
-606754.99 798574.63
-606761.34 798721.97
-606764.19 798807.42
-606766.1 798933.79
-606756.26 798967.1
-606722.6 799012.19
-606698.46 799036.32
-606666.08 799101.09
-606648.22 799135.09
-606701.41 799177.14
-606758.39 799249.83
-606767.82 799235.48
-606781.28 799235.48
-606791.5 799227.19
-606903.27 799157.97
-606906.45 799202.43
-606911.53 799237.99
-606936.93 799268.47
-606958.52 799251.96
-606985.83 799237.35
-607002.97 799227.83
-607027.11 799214.49
-607058.23 799198.61
-607085.53 799183.37
-607154.89 799147.72
-607225.02 799094.27
-607295.36 799042.76
-607317.43 799069.59
-607336.7 799099.23
-607364.83 799079.32
-607449.87 799086.9
-607516.55 799095.99
-607648.17 799102.92
-607649.47 798996.84
-607650.25 798958.63
-607650.72 798892.91
-607651.86 798855.01
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607226.3 798712.48
-Region  1
-  75
-607254.24 796698.42
-607329.17 796728.9
-607414.27 796749.18
-607471.42 796764.74
-607554.93 796794.28
-607636.84 796832.38
-607793.36 796916.44
-607848.13 796969.77
-607884.88 797034.62
-607917.31 797084.35
-607964.38 797175.46
-608026.98 797228.93
-608062.16 797103.8
-608096.75 796969.77
-608122.69 796921.48
-608150.07 796929.41
-608170.25 796925.09
-608134.94 796798.98
-608140.71 796754.3
-608189.34 796740.24
-608187.18 796727.27
-608179.98 796704.93
-608173.49 796678.99
-608179.98 796643.68
-608235.11 796425.69
-608248.8 796360.12
-608231.14 796355.44
-608203.76 796348.96
-608147.55 796335.99
-608042.34 796306.44
-608087.01 796224.29
-608075.48 796165.2
-608063.23 796139.25
-608046.66 796107.54
-608035.85 796088.81
-608029.36 796082.32
-607994.77 796104.66
-607945.77 796138.53
-607911.18 796267.52
-607880.19 796268.97
-607810.29 796306.44
-607753.36 796332.38
-607696.07 796320.5
-607657.16 796309.69
-607662.2 796138.18
-607641.3 796155.47
-607607.43 796205.19
-607590.14 796270.77
-607563.48 796281.58
-607532.49 796207.36
-607176.14 796278.31
-607155.24 796278.31
-607064.44 796334.52
-607028.5 796471.92
-606717.98 796537.83
-606657.34 796544.18
-606570.66 796533.71
-606505.26 796501.33
-606456.36 796450.52
-606422.08 796399.1
-606392.23 796414.98
-606347.15 796473.4
-606320.48 796530.56
-606300.79 796599.14
-606269.8 796673.28
-606253.8 796703.58
-606296.4 796739.11
-606374.14 796774.06
-606530.11 796788.97
-606614.16 796765.8
-606824.67 796695.58
-606944.37 796663.83
-607042.79 796660.02
-607183.44 796683.19
-607254.24 796698.42
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607482.92 796580.34
-Region  1
-  188
-603698.09 797108.93
-603772.24 797073.97
-603769.17 797067.85
-603755.88 797041.3
-603736.75 797000.29
-603694.84 796951.39
-603650.99 796861.78
-603626.22 796782.4
-603609.72 796725.92
-603600.2 796690.36
-603611.9 796632.07
-603657.23 796588.43
-603708.66 796556.62
-603761.1 796532.6
-603782.76 796535.31
-604167.34 796684.44
-604172.42 796673.64
-604179.4 796664.75
-604067.9 796417.63
-604016.33 796245.91
-604000.64 796254.84
-603997.49 796256.84
-603992.96 796260.83
-603985.97 796264
-603971.37 796296.39
-603870.15 796267.2
-603860.57 796258.48
-603847.23 796244.46
-603820.35 796215.25
-603795.79 796191.75
-603755.99 796173.99
-603693.55 796140.55
-603632.8 796104.63
-603591.52 796079.87
-603569.72 796068.01
-603605.92 796002.03
-603600.62 795984.85
-603590.89 795953.95
-603574.8 795917.97
-603527.37 795818.13
-603506.41 795788.92
-603478.47 795774.11
-603432.54 795770.72
-603397.19 795776.86
-603365.02 795814.11
-603342.17 795850.04
-603314.02 795895.34
-603346.24 795930.54
-603383.91 795976.02
-603408.88 796016.87
-603434.49 796066.21
-603354.91 796109.6
-603301.18 796151.93
-603224.44 796238.18
-603127.07 796352.67
-603119.69 796378.26
-603109.53 796556.42
-603108.28 796639.77
-603030.18 796663.69
-602974.51 796679.78
-602895.78 796705.19
-602677.36 796769.42
-602557.82 796805.3
-602489.87 796827.38
-602342.52 796912.73
-602280.1 796964.12
-602276.28 796968.36
-602270.14 796971.96
-602287.97 796993.62
-602300.71 797009.33
-602316.85 797028.86
-602342.75 797058.58
-602374.59 797092.97
-602406.01 797123.54
-602458.66 797119.3
-602513.76 797118.71
-602563.5 797143.26
-602584.88 797175.22
-602598.42 797215.22
-602602.23 797239.58
-602607.1 797276.41
-602608.37 797297.15
-602609.85 797313.66
-602614.95 797376.23
-602621.78 797389.9
-602680.07 797435.94
-602724.53 797473.73
-602755.65 797507.39
-602776.13 797540.26
-602784.38 797561.86
-602788.83 797574.24
-602793.91 797598.69
-602806.61 797627.59
-602809.94 797656.99
-602818.68 797721.81
-602969.83 797987.91
-603133.06 798213.04
-603362.8 798364.38
-603488.55 798405.35
-603512.05 798378.99
-603539.67 798365.34
-603588.89 798361.84
-603607.94 798326.93
-603666.05 798136.72
-603685.04 798118.11
-603691.08 798111.43
-603695.84 798106.35
-603699.97 798102.54
-603706 798096.51
-603714.57 798086.03
-603737.75 798061.26
-603764.41 798044.75
-603868.23 798024.12
-603943.48 798040.63
-603939.99 798028.24
-603936.81 798018.4
-603932.37 798007.92
-603929.19 797999.03
-603922.21 797980.93
-603911.41 797958.39
-603904.11 797943.17
-603860.61 797890.46
-603783.46 797848.87
-603742.82 797850.42
-603803.78 797818.67
-603802.51 797756.67
-603786.95 797646.5
-603744.72 797566.48
-603754.53 797528.56
-603721.51 797472.05
-603693.57 797403.47
-603753.26 797349.49
-603789.55 797350.19
-603827.55 797354.57
-603854.22 797349.49
-603875.18 797327.27
-603901.85 797312.03
-603933.6 797303.77
-603956.46 797298.69
-603990.75 797295.52
-604051.07 797308.85
-604089.17 797366
-604126.64 797426.33
-604160.5 797460.38
-604137.68 797386.32
-604101.87 797233.29
-604141.24 797153.28
-604151.72 797135.82
-604116.79 797067.23
-604100.61 797014.87
-604063.45 797095.18
-604040.28 797137.45
-604020.9 797173.96
-603974.54 797261.6
-603919.63 797232.02
-603964.38 797150.46
-603902.14 797132.64
-603821.74 797124.86
-603788.19 797105.87
-603772.49 797074.48
-603698.13 797109.17
-603694.36 797111.08
-603713.37 797130.92
-603720.56 797238.02
-603682.86 797257.46
-603653.22 797263.39
-603602.8 797274.84
-603552.17 797275.47
-603492.03 797268.49
-603439.02 797260.85
-603377.22 797244.73
-603329.35 797230.49
-603303.78 797221.82
-603301.66 797209.33
-603306.53 797191.76
-603310.97 797176.53
-603324.73 797150.91
-603360.72 797144.72
-603433.32 797136.47
-603500.63 797129.27
-603560.32 797122.46
-603593.98 797119.71
-603625.73 797116.95
-603693.5 797110.48
-603698.03 797108.96
-603698.05 797108.95
-603698.07 797108.94
-603698.09 797108.93
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603311.29 797168.24
-Region  1
-  62
-602585.49 794303.08
-602547.38 794301.2
-602509.05 794331.19
-602479.06 794336.61
-602450.73 794340.77
-602433.65 794354.94
-602365.34 794380.76
-602295.15 794394.32
-602293.48 794438.48
-602283.48 794458.89
-602272.24 794469.72
-602262.66 794480.14
-602246.83 794498.88
-602222.25 794523.46
-602192.05 794557.04
-602174.14 794575.79
-602153.94 794643.09
-602134.36 794704.74
-602098.74 794819.96
-602070 794915.77
-602082.91 794920.77
-602141.23 794934.51
-602194.23 794926.35
-602254.36 794914.97
-602324.52 794899.11
-602362.84 794891.61
-602407.41 794883.28
-602444.89 794875.74
-602466.26 794866.64
-602511.94 794845.38
-602555.16 794827.75
-602604.69 794804.67
-602678.56 794796
-602726.4 794788.8
-602784.39 794780.55
-602798.57 794768.7
-602810.63 794741.18
-602812.11 794714.52
-603025.88 794687.02
-603101.87 794679.4
-603053.9 794273.19
-603084.7 794266.34
-603152.26 794268.84
-603214.28 794270.12
-603262.92 794272.84
-603261.29 794248.73
-603261.11 794244.81
-603277.56 794225.82
-603292.75 794210
-603302.62 794199.17
-603311.37 794190.42
-603323.03 794180.84
-603190.15 794133.76
-603028.93 794121.68
-602989.57 794146.85
-602943.33 794183.51
-602898.54 794199.94
-602833.14 794203.28
-602785.24 794241.19
-602759.2 794241.84
-602614.65 794294.75
-602585.49 794303.08
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 602650.89 794538.13
-Region  1
-  24
-610478.51 806853.55
-610451.45 806764.68
-610302.34 806646.63
-610176.09 806676.39
-610107.57 806697.73
-610094.2 806745.74
-610078.24 806790.6
-610076.88 806829.33
-610077.15 806856.06
-610078.1 806897.38
-610083.77 806913.15
-610097.74 806946.04
-610105.85 806957.93
-610114.85 806970.2
-610130.12 806987.93
-610303.19 807204.24
-610457.73 807380.62
-610490.76 807344.39
-610508.35 807318.28
-610524.87 807263.39
-610539.26 807162.14
-610534.2 807084.6
-610502.76 806953.5
-610478.51 806853.55
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610325.7 806968.08
-Region  1
-  84
-610000.22 809630.78
-610179.74 812529.46
-610168.22 812532.2
-610150.73 812548.43
-610102.16 812575.9
-610099.07 812605.6
-610102.16 812632.2
-610089.78 812651.39
-610060.08 812668.71
-610024.2 812686.65
-609985.83 812707.69
-609947.47 812726.87
-609917.15 812747.29
-609893.02 812768.33
-609866.42 812801.74
-609851.31 812831.68
-609838.57 812853.1
-609830.23 812877.26
-609819.39 812905.07
-609876.95 812936.52
-609933.36 812946.21
-610053.34 812898.13
-610101.45 812945.07
-610224.77 812929.97
-610241.01 812919.43
-610304.83 812896.63
-610379.47 812875.55
-610443.86 812870.99
-610473.48 812864.16
-610491.72 812839.09
-610497.42 812828.83
-610511.09 812802.05
-610504.82 812758.18
-610493.43 812734.81
-610481.46 812710.31
-610457.8 812581.25
-610438.42 812551.05
-610325.01 812345.93
-610317.03 812307.75
-610314.75 812259.89
-610316.76 812239.09
-610315.05 812217.44
-610323.03 812171.86
-610296.22 812051.63
-610254.06 811980.98
-610258.62 811886.4
-610284.26 811806.63
-610325.54 811725.43
-610354.03 811643.38
-610334.34 811597.51
-610321.8 811519.45
-610304.14 811468.73
-610277.93 811260.76
-610290.24 811204.24
-610315.06 811128.45
-610390.11 811051.76
-610427.3 810983.22
-610491.59 810885.99
-610519.21 810849.65
-610551.29 810721.53
-610595.71 810663.38
-610648.31 810630.44
-610700.38 810604.4
-610755.1 810577.84
-610740.23 810552.34
-610728.54 810523.11
-610719.27 810408.62
-610711.3 810325.2
-610691.38 810267.56
-610656.31 810223.99
-610620.72 810196.89
-610581.93 810179.36
-610423.6 810115.6
-610337 810083.19
-610279.62 810047.06
-610243.49 809985.96
-610227.4 809918.05
-610212.89 809873.63
-610197.48 809843.7
-610132.19 809788.39
-610060.56 809733.99
-610038.17 809665.92
-609998.85 809612.29
-610000.22 809630.78
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610269.65 811208.28
-Region  1
-  39
-618796.43 806979.58
-618779.92 806888.14
-618691.1 806705.43
-618586.09 806489.76
-618642.76 806458.76
-618688.48 806463.84
-618744.36 806347
-618750.71 806278.42
-618713.88 806176.82
-618349.39 806547.66
-618208.42 806477.81
-618177.94 806551.47
-618337.96 806639.1
-618541.16 806518.45
-618505.6 806454.95
-618523.38 806402.88
-618585.75 806490.34
-618691.4 806707.61
-618660.54 806726.85
-618623.71 806687.48
-618560.21 806723.04
-618548.78 806792.89
-618501.79 806799.24
-618397.65 806861.47
-618397.65 806963.07
-618419.24 807017.68
-618424.32 807093.88
-618463.69 807142.14
-618518.3 807255.17
-618534.81 807242.47
-618529.73 807330.1
-618563.11 807462.45
-618604.95 807454.48
-618531.53 807329.11
-618623.71 807267.87
-618694.83 807211.99
-618749.44 807142.14
-618781.19 807071.02
-618796.43 806979.58
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 618574.67 806824.02
-Region  1
-  98
-604338.38 787582.99
-603781.88 787427.05
-603705.03 787389.58
-603664.7 787351.79
-603633.9 787307.97
-603613.9 787270.5
-603601.2 787244.78
-603591.04 787220.65
-603581.52 787196.2
-603552.95 787193.34
-603433.25 787300.02
-603391.66 787397.2
-603357.69 787474.68
-603335.78 787513.38
-603296.73 787558.79
-603262.13 787614.95
-603229.11 787670.2
-603182.75 787727.98
-603135.13 787760.36
-603127.69 787729.17
-602800.35 787575.79
-602641.1 787581.93
-602595.7 787584.5
-602592.21 787594.98
-602575.38 787626.42
-602568.71 787638.8
-602560 787649.8
-602644.78 787693.94
-602775.9 787753.63
-603001.79 787849.8
-602923.37 787893.94
-602888.13 787913.94
-602838.92 787939.66
-602753.2 787992.68
-602703.03 788008.51
-602694.14 788037.69
-602662.39 788130.41
-602677.49 788167.87
-602700.98 788296.78
-602725.11 788305.99
-602699.71 788377.73
-602657.49 788441.56
-602665.19 788467.69
-602676.22 788529.51
-603030.9 788632.62
-603059.79 788641.15
-603167.42 788670.68
-603215.69 788684.67
-603249.98 788562.11
-603282.99 788454.43
-603924.36 788661.11
-603969.45 788653.47
-603993.26 788645.54
-604006.6 788631.25
-604015.49 788614.1
-604023.74 788574.1
-603974.85 788553.09
-603983.74 788532.77
-604007.55 788501.02
-604073.27 788439.43
-604248.22 788440.34
-604258.7 788406.05
-604269.04 788395.76
-604293.08 788362.85
-604325.06 788346
-604358.4 788339.65
-604417.77 788323.14
-604457.77 788329.49
-604490.16 788350.43
-604554.61 788327.57
-604564.77 788318.05
-604588.9 788299.95
-604589.86 788290.2
-604572.29 788284.69
-604564.25 788274.73
-604537.16 788259.7
-604534.83 788245.73
-604544.78 788229.43
-604583.94 788211.44
-604605.32 788208.45
-604620.35 788193.21
-604620.14 788181.36
-604594.1 788174.37
-604595.48 788163.46
-604619.52 788154.86
-604635.82 788111.95
-604652.96 788092.63
-604685.02 788032.79
-604597.09 787999.06
-604550.1 787942.12
-604530.9 787921.08
-604491.02 787896.39
-604459.31 787881.01
-604428.83 787873.39
-604377.71 787873.7
-604346.28 787764.14
-604347.23 787612.1
-604338.38 787582.99
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603594.59 788031.96
-Region  1
-  83
-609513.3 797783.55
-609562.74 797749.93
-609628.37 797732.5
-609709.8 797725.42
-609770.13 797726.92
-609870.21 797756.23
-609956 797785.37
-610038.93 797829.38
-610104.16 797860.32
-610157.54 797868.49
-610219.9 797864.95
-610331.97 797859.67
-610458.47 797853.5
-610553.37 797857.53
-610624.36 797800.2
-610660.37 797744.98
-610632.61 797722.27
-610631.77 797721.28
-610631.76 797721.27
-610312.77 797346.95
-610303.95 797342.41
-610303.94 797342.41
-610295.21 797337.92
-610295.19 797337.91
-610228.59 797303.64
-610141.32 797310.26
-610137.4 797310.56
-610129.65 797311.15
-610101.36 797313.29
-610050.46 797317.15
-609721.17 797342.14
-609718.28 797342.19
-609718.25 797342.19
-609541.84 797345.36
-609536.47 797345.46
-609512.41 797335.71
-609512.36 797335.69
-609432.33 797303.24
-609360.26 797274.02
-609360.24 797274.01
-609360.23 797274.01
-609273.26 797238.75
-609271.61 797232.45
-609270.34 797227.62
-609267.23 797215.74
-609258.44 797212.05
-609101.56 797154.13
-608960.15 797175.03
-608831.65 797204.11
-608765.53 797253.82
-608694.71 797258.51
-608582.44 797335.17
-608519.61 797359.55
-608446.46 797355.33
-608314 797314.33
-608181.06 797218.38
-608062.16 797103.8
-608026.98 797228.93
-607956.31 797550.18
-607849.83 797990.5
-607893.13 798006.57
-608127.21 798093.01
-608212.99 798143.39
-608337.45 798220.41
-608418.34 798271.07
-608466.68 798301.74
-608510.72 798324.33
-608563.92 798345.82
-608623.44 798364.13
-608734.4 798399.98
-608817.46 798411.42
-608888.68 798407.16
-608946.96 798395.18
-609026.36 798363.44
-609141.56 798300.26
-609223.39 798255.72
-609269.96 798221.4
-609314.77 798166.8
-609386.54 798023.68
-609427.79 797941.83
-609460.06 797877.39
-609476.95 797841.72
-609513.3 797783.55
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609035.79 797715.38
-Region  1
-  8
-612042.44 794612.37
-611896.98 794073.48
-611517.67 794169.95
-611529.6 794224.95
-611692.15 794859.51
-611959.77 794883.85
-612120.89 794904.17
-612042.44 794612.37
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611812.98 794502.19
-Region  1
-  21
-616671.2 799626.66
-616296.25 799541.44
-616280.86 799567.83
-616434.73 800081.34
-616471.76 800112.11
-616508.2 800122.36
-616538.03 800107.49
-616560.03 800095.98
-616585.49 800063.17
-616647.06 799989.5
-616662.45 799952.11
-616676.75 799889.44
-616687.74 799821.82
-616674 799797.08
-616656.96 799775.09
-616668.5 799744.3
-616681.4 799725.89
-616685.79 799700.6
-616683.05 799672.02
-616698.14 799633.8
-616671.2 799626.66
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 616502.58 799807.2
-Region  1
-  127
-604516.67 802005.15
-604673.04 802066.06
-604733.53 802093.61
-604795.26 802140.52
-604844.64 802200.6
-604866.04 802264.79
-604874.27 802345.44
-604854.1 802480
-604876.76 802452.81
-604900 802428.4
-605078.88 802356.5
-605096.14 802362.82
-605140.43 802395.04
-605180.98 802424.08
-605213.19 802445.94
-605268.98 802427.53
-605301.19 802384.39
-605344.91 802320.55
-605397.82 802244.62
-605461.89 802151.24
-605493.15 802073.35
-605521.67 801999.28
-605529.16 801920.35
-605505.1 801786.2
-605498.05 801731.96
-605496.03 801671.22
-605494.88 801629.17
-605491.42 801573.28
-605489.12 801530.65
-605343.45 800790.35
-605355.7 800678.81
-605394.57 800540.44
-605405.37 800543.94
-605420.29 800547.11
-605495.85 800560.45
-605555.86 800569.66
-605563.79 800517.56
-605576.49 800451.55
-605586.02 800423.61
-605607.92 800371.86
-605662.85 800395.35
-605689.2 800406.15
-605713.97 800415.67
-605736.18 800367.46
-605746.02 800347.14
-605760.31 800316.66
-605788.89 800299.2
-605818.55 800281.9
-605871.12 800252.21
-605899.06 800243
-605930.81 800206.17
-605903.5 800178.23
-605886.99 800163.62
-605835.56 800178.86
-605811.11 800188.07
-605762.53 800182.67
-605773.01 800151.88
-605787.62 800122.03
-605798.1 800099.8
-605811.75 800073.77
-605820.64 800049.94
-605828.58 800030.25
-605839.38 800006.12
-605840.01 799985.8
-605822.13 799959.03
-605793.86 799905.18
-605751.68 799898
-605737.77 799895.31
-605735.53 799859.86
-605732.84 799834.28
-605730.59 799809.15
-605720.93 799739.38
-605710.61 799649.19
-605672.91 799703.48
-605655.86 799720.98
-605628.49 799718.29
-605590.35 799713.8
-605580.92 799703.48
-605575.99 799685.98
-605567.46 799663.1
-605561.18 799638.87
-605546.59 799585.25
-605523.93 799490.34
-605522.59 799408.22
-605548.85 799290.43
-605556.16 799192.25
-605540.98 799189.24
-605418.48 799199.11
-605325.39 799206.07
-605252.25 799222.67
-605169.91 799237.7
-605096.77 799260.14
-605009.27 799284.37
-604710.16 799380.02
-604621.88 799405.99
-604548.63 799429.3
-604502.21 799524.32
-604516.74 799531.49
-604577.92 799557.53
-604610.89 799582.26
-604634.75 799618.7
-604659.27 799700.05
-604676.62 799771.92
-604723.06 799925.67
-604746.05 800000.28
-604765.36 800065.56
-604784.45 800107.63
-604818.28 800175.73
-604855.81 800254.89
-604758.21 800306.51
-604717.44 800338.6
-604641.63 800402.4
-604068.52 800927.89
-604121.71 801165.66
-604132.87 801558.43
-604150.78 801637.8
-604187.03 801703.08
-604210.42 801742.47
-604232.57 801777.55
-604255.96 801815.71
-604288.58 801871.11
-604315.97 801903.44
-604344.49 801926.3
-604400.23 801959.8
-604441.52 801974.84
-604468.01 801985.29
-604516.67 802005.15
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604982 800833.23
-Region  1
-  49
-610396.51 796849.49
-610129.65 797311.15
-610137.4 797310.56
-610141.32 797310.26
-610228.59 797303.64
-610295.19 797337.91
-610295.21 797337.92
-610303.94 797342.41
-610303.95 797342.41
-610312.77 797346.95
-610631.76 797721.27
-610631.77 797721.28
-610632.61 797722.27
-610660.37 797744.98
-610784.42 797846.47
-610895.94 797914.74
-610954.26 797934.59
-611008.97 797939.4
-611054.7 797924.12
-611077.59 797916.47
-611087.59 797913.13
-611279.6 797714.87
-611615.08 797617.44
-611615.09 797617.44
-611618.55 797616.43
-611754.38 797695.33
-611747.51 797640.44
-611734.97 797597.8
-611731.33 797568.17
-611703.51 797451.9
-611666.53 797339.3
-611638.65 797248.78
-611633.55 797157.64
-611643.01 797067.76
-611670.83 796997.5
-611730.94 796934.21
-611825.87 796913.34
-611868.61 796937.4
-611914.93 796854.82
-611894.42 796844.33
-611899.19 796788.51
-611766.04 796286.36
-611762.54 796273.77
-611356.52 796376.94
-611321.54 796387.43
-610600.74 796581.61
-610409.8 796630.57
-610445.47 796767.66
-610396.51 796849.49
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611082.25 797086.06
-Region  1
-  183
-604501.94 807272.23
-604430.43 807260.47
-604442.65 807279.93
-604457.59 807299.84
-604468.9 807316.58
-604484.74 807340.57
-604362.09 807316.58
-604345.8 807322.02
-604332.23 807352.79
-604300.55 807352.34
-604249.86 807355.05
-604142.6 807379.91
-604049.38 807404.8
-603952.53 807438.29
-603887.6 807461.15
-603823.34 807479.25
-603729.67 807500.06
-603696.18 807509.56
-603659.08 807522.69
-603672.2 807562.06
-603695.73 807642.6
-603718.82 807737.6
-603718.93 807823.64
-603764.59 807886.25
-603812.09 807907.11
-603886.15 807907.7
-603994.46 807967.75
-604023.62 807998.1
-604030 808034.79
-604050.27 808049.33
-604145.28 808099.27
-604166.85 808139.75
-604148.57 808196.06
-604120.21 808294.14
-604080.44 808385.89
-604036.87 808468.16
-604007.23 808552.95
-603990.82 808590.29
-604004.84 808665.57
-603987.82 808724.41
-603966.98 808762.38
-603926.54 808821.24
-603913.35 808902.86
-603943.19 808972.44
-604004.07 809057.82
-604031.97 809100.19
-604055.47 809162.81
-604167.61 809244.37
-604194.13 809256.19
-604211.09 809263.25
-604240.77 809237.81
-604226.22 809249.17
-604255.94 809220.06
-604277.52 809184.1
-604301.55 809143.82
-604324.88 809191.87
-604365.4 809171.93
-604411.58 809142.81
-604432.47 809135.21
-604453.97 809120.65
-604454.56 809092.64
-604450.32 809054.47
-604467.28 809050.23
-604525.23 809043.17
-604583.19 809036.1
-604617.82 809028.32
-604628.42 809021.26
-604621.35 809007.12
-604612.87 808990.16
-604610.04 808973.9
-604619.94 808954.12
-604666.58 808924.43
-604707.58 808894.69
-604743.62 808877.79
-604756.34 808925.14
-604793.09 808964.72
-604819.24 809010.66
-604834.08 809054.47
-604839.43 809083.15
-604779.42 809212.86
-604768.69 809236.27
-604774.41 809258.41
-604804.82 809290.02
-604837.15 809333.66
-604863.72 809324.16
-604900.41 809295.04
-604913.07 809293.14
-604929.57 809336.15
-604941.59 809333.61
-604963.1 809325.38
-605006.81 809298.14
-605157.61 809399.87
-605006.81 809298.14
-605096.7 809242.63
-605169.68 809194.25
-605159.82 809175.36
-605145.87 809150.06
-605135.09 809134.25
-605130.65 809120.97
-605145.18 809100.09
-605217.92 809043.75
-605282.43 808988.68
-605333.4 808950.86
-605368.73 808920.47
-605424.57 808877.36
-605454.46 808832.98
-605492.07 808780.78
-605478.28 808760.04
-605489.23 808704.56
-605502.66 808644.49
-605516.09 808570.99
-605542.95 808527.17
-605594.54 808479.82
-605638.94 808445.2
-605666.11 808404.69
-605660.33 808340.17
-605629.52 808213.79
-605503.72 808197.53
-605523.51 808121.91
-605497.71 808112.31
-605475.1 808111.6
-605454.6 808113.72
-605454.6 808091.81
-605461.67 808005.59
-605368.38 807993.57
-605335.16 807969.55
-605330.22 807947.64
-605335.52 807848.98
-605315.73 807846.16
-605300.18 807844.04
-605289.4 807839.92
-605269.79 807825.66
-605292.98 807579.27
-605299.18 807436.03
-605262.34 807427.44
-605265.78 807414.35
-605279.9 807351.37
-605292.98 807285.95
-605309.5 807188.98
-605332.22 806994.78
-605151.8 806974.81
-605073.64 806967.59
-605079.15 806928.33
-605089.47 806843.63
-604940.68 806880.36
-604840.87 806902.16
-604814.02 806914.56
-604787.16 806930.4
-604758.92 806942.79
-604753.76 806930.76
-604643.22 806738.31
-604624.63 806688.73
-604632.89 806568.22
-604620.5 806484.89
-604508.94 806608.16
-604457.98 806628.13
-604407.02 806632.95
-604340.22 806628.13
-604256.89 806639.15
-604252.84 806553.62
-604251.04 806470.1
-604246.22 806376.45
-604132.35 806377.8
-604133.62 806416.71
-604104.01 806413.96
-604014.15 806410.49
-604010.71 806456.63
-603970.77 806527.56
-603905.46 806655.66
-603866.96 806746.78
-603853.78 806835.99
-603859.55 806894.83
-603893.19 806971.36
-603929.96 807011.83
-603993.94 807052.92
-604091.48 807097.79
-604207.36 807134.43
-604318.8 807160.94
-604466.33 807193.13
-604507.82 807199.82
-604514.61 807201.18
-604507.82 807229.69
-604501.94 807272.23
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604649.37 807950.47
-Region  1
-  36
-609923.45 795453.85
-610085.28 795410.24
-610158.17 795390.6
-610273.88 795359.41
-610288.59 795355.45
-610160.8 794944.94
-610151.5 794877.14
-610140.07 794808.88
-610121.34 794779.67
-610097.04 794747.44
-610042.25 794677.14
-610033.36 794659.36
-610021.3 794633.64
-610003.52 794634.59
-609944.46 794637.45
-609854.93 794643.8
-609770.87 794647.4
-609771.51 794630.88
-609756.9 794622.63
-609668.89 794588.79
-609650.79 794590.06
-609601.51 794590.98
-609578.99 794602.24
-609545.7 794643.04
-609513.8 794681.03
-609522.25 794711.51
-609518.49 794767.79
-609508.88 794880.14
-609524.82 794982.43
-609556.95 795148.23
-609597.99 795334.69
-609626.83 795404.31
-609680.3 795519.21
-609695.98 795515.15
-609696.4 795515.04
-609923.45 795453.85
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609858.46 795048.8
-Region  1
-  93
-612204.3 799892.7
-612173.94 799892.64
-612123.92 799905.92
-612099.13 799904.11
-612113.33 799864.93
-612141.75 799811.98
-612165.85 799767.21
-612171.45 799753.01
-612173.6 799745.26
-612165.5 799740.25
-612138 799730.14
-612088.8 799716.41
-612035.61 799703.18
-611974.26 799686.76
-611978.72 799703.65
-611983.82 799735.92
-611991.06 799762.18
-611997.12 799781.84
-611987.74 799803.73
-611902.55 799840.85
-611884.76 799882.05
-611837.48 799976.62
-611842.57 800017.33
-611848.77 800056.11
-611860.02 800177.69
-611866.05 800228.49
-611870.56 800264.87
-611874.86 800304.9
-611857.21 800315.24
-611831.38 800328.58
-611807.27 800342.79
-611810.72 800390.57
-611815.02 800422.86
-611786.62 800440.08
-611747.01 800464.18
-611756.65 800528.88
-611757.07 800542.37
-611982.41 800618.48
-612040.28 800722.76
-612071.95 800781.4
-612124.73 800880.67
-612120.82 800933.84
-612097.49 801026.49
-612079.38 801095.61
-612096.39 801087.88
-612112.59 801078.67
-612154.18 801062.16
-612202.12 801049.14
-612262.73 801046.65
-612330.35 801051.83
-612401.5 801103.43
-612434.33 801078.8
-612467.55 801051.96
-612498.99 801025.61
-612533.91 801007.54
-612581.54 800999.29
-612640.56 800997.1
-612681.87 800977.06
-612708.08 800955.19
-612755.03 800915.43
-612765.88 800906.74
-612805.35 800845.75
-612860.96 800811.66
-612909.31 800779.97
-612980.15 800732.99
-612995.52 800754.37
-613061.06 800707.96
-613049.71 800690.62
-613182.49 800607.09
-613186.13 800580.4
-613173.59 800531.19
-613146.55 800447.41
-613155.34 800419.2
-613146.55 800399.48
-613135.32 800379.46
-613126.67 800367.19
-613096.71 800304.11
-613056.15 800226.25
-613034.17 800157.98
-612983.11 800070.72
-612932.34 800014.75
-612872.22 799980.93
-612820.94 799972.14
-612752.54 799970.97
-612706.61 799971.19
-612576.45 799936.79
-612519.98 799922.14
-612450.03 799903.38
-612312.86 799865.08
-612304.65 799887.75
-612298.99 799915.69
-612239.59 799899.67
-612204.3 799892.7
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612441.74 800413.96
-Region  1
-  20
-611580.4 798459.32
-611580.85 798142.82
-611389.82 798144.64
-611251.89 798145.32
-611194.9 798144.41
-611189.99 798181.88
-611177.57 798262.5
-611157.29 798416.92
-611114.66 798563.5
-611161.62 798533.86
-611205.85 798502.86
-611232.75 798492.37
-611260.56 798491.46
-611282.44 798496.02
-611304.1 798504.91
-611327.81 798514.03
-611346.5 798520.41
-611367.48 798514.49
-611480.55 798485.31
-611580.4 798459.32
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611367.5 798327.2
-Region  1
-  43
-611782.83 798852.38
-611495.18 798748.59
-611392.55 798716.02
-611054.01 798770.98
-610933.86 798792.93
-610779.06 799024.33
-610589.85 799319.74
-610624.38 799488.64
-610658.99 799504.51
-610698.7 799522.64
-610644.41 799587.1
-610550.1 799658.54
-610534.29 799824.88
-610532.34 799854.98
-610556.57 799852.64
-610574.95 799850.68
-610627.72 799844.43
-610688.71 799837.39
-610682.5 799812.22
-610677.74 799785.23
-610707.13 799766.02
-610755.99 799732.36
-610843.18 799674.1
-610903.96 799630.12
-610945.07 799591.54
-610991.42 799627.1
-611031.75 799641.7
-611134.3 799669.66
-611285.88 799704.64
-611466.82 799730.04
-611493.39 799700.73
-611517.42 799640.34
-611548.68 799562.57
-611567.25 799526.35
-611602.81 799465.77
-611618.86 799438.61
-611623.47 799413.99
-611625.06 799326.03
-611636.65 799286.46
-611659.04 799221.5
-611683.17 799148.47
-611723.1 799028.37
-611782.83 798852.38
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611164.83 799245.06
-Region  1
-  30
-603821.74 797124.86
-603902.14 797132.64
-603964.38 797150.46
-603919.63 797232.02
-603974.54 797261.6
-604020.9 797173.96
-604040.28 797137.45
-604063.45 797095.18
-604100.61 797014.87
-604100.96 796996.76
-604103.2 796986.68
-604150.19 796765.72
-604167.34 796684.44
-603782.76 796535.31
-603761.1 796532.6
-603708.66 796556.62
-603657.23 796588.43
-603611.9 796632.07
-603600.2 796690.36
-603609.72 796725.92
-603626.22 796782.4
-603650.99 796861.78
-603694.84 796951.39
-603736.75 797000.29
-603755.88 797041.3
-603769.17 797067.85
-603772.24 797073.97
-603772.49 797074.48
-603788.19 797105.87
-603821.74 797124.86
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603887.46 796841.34
-Region  1
-  31
-603693.5 797110.48
-603625.73 797116.95
-603593.98 797119.71
-603560.32 797122.46
-603500.63 797129.27
-603433.32 797136.47
-603360.72 797144.72
-603324.73 797150.91
-603310.97 797176.53
-603306.53 797191.76
-603301.66 797209.33
-603303.78 797221.82
-603329.35 797230.49
-603377.22 797244.73
-603439.02 797260.85
-603492.03 797268.49
-603552.17 797275.47
-603602.8 797274.84
-603653.22 797263.39
-603682.86 797257.46
-603720.56 797238.02
-603713.37 797130.92
-603694.36 797111.08
-603698.13 797109.17
-603772.49 797074.48
-603772.24 797073.97
-603698.09 797108.93
-603698.07 797108.94
-603698.05 797108.95
-603698.03 797108.96
-603693.5 797110.48
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603530.73 797194.72
-Region  1
-  32
-604066.4 800914.04
-604034.4 800760.74
-604021.47 800697.34
-604004.24 800608.71
-603965.46 800615.48
-603931 800624.72
-603878.25 800637.18
-603835.41 800646.38
-603792.19 800659.37
-603743.43 800649.9
-603713.73 800646.87
-603693.42 800643.8
-603670.65 800641.95
-603671.58 800671.22
-603670.96 800722.92
-603662.34 800772.16
-603648.8 800800.47
-603637.72 800842.32
-603626.95 800876.46
-603615.88 800906.62
-603611.57 800922.01
-603604.18 800936.16
-603491.55 800930.01
-603528.78 801103.88
-603540.48 801153.12
-603568.81 801220.02
-603610.61 801237.71
-603627.71 801242.13
-604057.47 801174.67
-604121.71 801165.66
-604068.52 800927.89
-604066.4 800914.04
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603819.45 800953.76
-Region  1
-  29
-603960.32 800405.92
-603938.89 800297.21
-603931.33 800239.97
-603925.58 800180.38
-603904.15 800112.43
-603875.67 800075.06
-603835.42 800036.9
-603798.82 800007.63
-603776.61 800087.34
-603752.57 800153.72
-603724.86 800205.99
-603668.94 800264.01
-603639.41 800291.98
-603641.5 800304.53
-603642.03 800346.34
-603642.55 800412.19
-603658.56 800480.45
-603670.65 800641.95
-603693.42 800643.8
-603713.73 800646.87
-603743.43 800649.9
-603792.19 800659.37
-603835.41 800646.38
-603878.25 800637.18
-603931 800624.72
-603965.46 800615.48
-604004.24 800608.71
-603980.85 800501.62
-603960.32 800405.92
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603813.08 800388.27
-Region  1
-  28
-608948.41 793545.77
-608961.1 793467.46
-608955.39 793367.76
-608943.32 793339.19
-608947.13 793292.83
-609002.78 793209.48
-609051.49 793141.13
-608995.65 793163.6
-608953.74 793149
-608910.78 793131.25
-608896.18 793162.05
-608855.95 793245.52
-608811.88 793330.93
-608759.81 793442.06
-608785.21 793452.22
-608756.68 793491.74
-608709.25 793610.73
-608667.45 793699.13
-608680.47 793703.25
-608695.71 793707.06
-608714.44 793712.46
-608725.24 793716.59
-608730.95 793717.54
-608741.43 793720.4
-608750 793707.06
-608890.02 793633.7
-608918.28 793616.24
-608948.41 793545.77
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608857.31 793447.2
-Region  1
-  45
-606077.61 806011.73
-605745.81 806310.32
-605394.95 806113.23
-605352.68 806152.3
-605319.61 806148.91
-605305.19 806157.39
-605248.91 806380.45
-605200.01 806589.11
-605164.2 806844.55
-605415.9 806621.76
-606703.67 806756.72
-606726.4 806783.58
-606729.84 806808.37
-606762.34 806812.99
-606824.96 806769.94
-606880.64 806752.83
-606876.65 806742.83
-606864.76 806712.98
-606839.42 806695.91
-606795.72 806673.16
-606757.69 806640.91
-606729.17 806604.87
-606720.25 806559.32
-606725.26 806517.56
-606776.99 806400.02
-606774.64 806341.32
-606753.51 806240.36
-606732.27 806052.55
-606714.43 805960.19
-606690.48 805739.82
-606682.65 805631.03
-606646.65 805491.73
-606634.85 805506.57
-606610.42 805538.27
-606536.55 805597
-606481.46 805646.65
-606437.85 805597.74
-606368.3 805698.97
-606289.79 805808.47
-606185.81 805936.56
-606150.87 805922.12
-606115.91 805908.01
-606111.09 805955.52
-606095.25 805982.38
-606077.61 806011.73
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606141.58 806308.87
-Region  1
-  61
-602586.14 798507.59
-602557.24 798487.9
-602516.6 798466.64
-602484.21 798399.97
-602445.48 798338.04
-602443.58 798310.42
-602444.21 798266.28
-602347.06 798230.09
-602202.47 798177.56
-602081.31 798126.18
-602060.35 798116.65
-601973.99 798086.81
-602035.59 798175.71
-602038.13 798260.16
-602022.25 798326.84
-602017.81 798400.49
-602005.75 798423.35
-601946.06 798483.04
-601914.95 798554.79
-601949.87 798744.02
-602061 798781.48
-602021.8 798874.63
-601997.67 798912.73
-601955.12 799055.61
-601971.63 799193.35
-601968.46 799209.23
-601995.27 799270.96
-602035.03 799356.26
-602008.36 799437.56
-602209.5 799503.89
-602182.95 799587.21
-602383.14 799649.15
-602372.08 799614.12
-602444.71 799546.65
-602509.6 799501.68
-602593.11 799437.33
-602728.23 799328
-602781.69 799284.49
-602803.62 799253.34
-602806.96 799246.06
-602811.09 799238.43
-602877.16 799203.26
-602957.1 799168.36
-603054.22 799121.36
-603041.69 799088.05
-603001.17 798972.1
-602979.1 798908.73
-602951.16 798884.28
-602927.02 798872.21
-602860.34 798867.13
-602827.15 798869.43
-602753.01 798872.87
-602801.28 798810.95
-602834.62 798772.53
-602839.06 798750.94
-602877.96 798676.13
-602897.65 798631.04
-602827.47 798613.26
-602766.68 798599.32
-602657.59 798543.79
-602586.14 798507.59
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 602389.85 798906.04
-Region  1
-  48
-610073.61 794046.78
-610002.33 794005.36
-609958.2 793974.24
-609989.62 793921.84
-610001.05 793898.03
-609951.84 793835.8
-609903.9 793773.25
-609828.33 793922.79
-609733.4 793925.02
-609703.88 793921.19
-609674.67 793904.36
-609657.52 793871.66
-609610.53 793815.14
-609595.92 793835.78
-609570.53 793871.38
-609553.06 793923.14
-609557.19 793978.07
-609564.37 794005.86
-609622.65 794074.6
-609602.97 794094.92
-609561.06 794132.71
-609581.06 794162.23
-609601.83 794188.43
-609603.73 794293.52
-609644.42 794310.98
-609644.42 794335.75
-609649.64 794456.25
-609650.79 794590.06
-609668.89 794588.79
-609756.9 794622.63
-609771.51 794630.88
-609770.87 794647.4
-609854.93 794643.8
-609944.46 794637.45
-610003.52 794634.59
-610021.3 794633.64
-610021.62 794578.71
-610069.8 794516.06
-610088.49 794473.78
-610085.58 794425.55
-610063.42 794385.67
-610019.9 794340.76
-609996.6 794287.58
-609992.79 794218.68
-610003.59 794165.03
-610024.71 794123.62
-610059.32 794068.37
-610073.61 794046.78
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609822.33 794242.14
-Region  1
-  32
-605239.41 796179.88
-605890.43 796943.85
-606048.37 797132.45
-606052.17 797114.08
-606058.08 797085.44
-606062.09 797066.05
-606064.25 797055.61
-606073.01 797041.43
-606073.02 797041.42
-606103.48 796992.15
-606162.85 796975.84
-606241.28 796960.92
-606250.16 796848.48
-606222.64 796809.69
-606266.04 796777.67
-606257.93 796768.69
-606247.45 796749
-606239.19 796729.01
-606222.97 796700.49
-606193.2 796661.87
-606157.4 796611.8
-606021.83 796394.35
-605983.59 796272.52
-605734.65 796118.73
-605681.63 796085.93
-605658.77 796065.05
-605587.01 795964.79
-605481.97 796007.66
-605419.2 796039.54
-605357.83 796076.84
-605231.07 796169.79
-605239.41 796179.88
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605792.64 796500.08
-Region  1
-  32
-612410.34 794953.98
-613034.19 793881.37
-613061.38 793835.57
-613005.18 793808.73
-612949.53 793780.78
-612931.45 793816.55
-612901.83 793828.86
-612827.22 793833.09
-612801.83 793816.93
-612785.68 793793.86
-612783.76 793895.78
-612754.91 793866.93
-612739.53 793853.09
-612709.53 793881.16
-612573.76 794008.03
-612556.05 794033.49
-612550.29 794048.49
-612495.85 794107.08
-612434.31 794142.47
-612346.8 794183.01
-612308.72 794239.55
-612184.44 794296.03
-612181.72 794311.7
-612131.32 794343.71
-612089.77 794355.97
-612106.46 794420.99
-612109.11 794445.47
-612042.44 794612.37
-612120.89 794904.17
-612386.84 794937.71
-612397.3 794944.95
-612410.34 794953.98
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612489.17 794390.91
-Region  1
-  59
-604729.38 797111.07
-604484.23 796924.33
-604474.23 796916.71
-604291.77 796774.81
-604206.03 796702.41
-604189.56 796681.26
-604179.4 796664.75
-604172.42 796673.64
-604167.34 796684.44
-604150.19 796765.72
-604103.2 796986.68
-604100.96 796996.76
-604100.61 797014.87
-604116.79 797067.23
-604151.72 797135.82
-604141.24 797153.28
-604101.87 797233.29
-604137.68 797386.32
-604160.5 797460.38
-604165.61 797470.38
-604233.47 797533.99
-604280.24 797594.52
-604287.86 797609.34
-604293.63 797618.64
-604314.4 797632.76
-604314.01 797657.06
-604311.47 797690.98
-604319.68 797706.27
-604354.96 797761.55
-604390.24 797819.18
-604412.78 797856.99
-604441.78 797913.05
-604462.76 797950.48
-604487.06 797989.29
-604510.98 797969.69
-604522.74 797961.06
-604538.42 797954.01
-604584.67 797936.37
-604674.61 797900.21
-604815.28 797840.81
-604885.62 797804.87
-604994.59 797805.32
-605030.98 797784.12
-605098.2 797737.87
-605132.58 797729.83
-605164.74 797734.3
-605201.36 797748.14
-605244.23 797764.22
-605304.52 797785.21
-605367.04 797793.25
-605364.36 797748.14
-605349.62 797697.68
-605257.41 797574.66
-605220.79 797535.81
-605151.74 797454.32
-605012.66 797316.51
-604892.09 797233.25
-604818.01 797174.37
-604729.38 797111.07
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604605.94 797408.49
-Region  1
-  39
-605890.43 796943.85
-605239.41 796179.88
-605231.07 796169.79
-605166.16 796220.67
-605120.98 796265.84
-605078.44 796311.02
-605027.76 796374.82
-604971.18 796459.91
-604951.88 796478.33
-604867.02 796557.07
-604768.55 796639.73
-604699.25 796682.72
-604658.02 796761.23
-604609.11 796835.58
-604543.54 796886.67
-604474.23 796916.71
-604484.23 796924.33
-604729.38 797111.07
-604818.01 797174.37
-604892.09 797233.25
-605012.66 797316.51
-605151.74 797454.32
-605220.79 797535.81
-605257.41 797574.66
-605285.1 797513.93
-605314.16 797449.4
-605326.54 797396.69
-605332.58 797284.91
-605417.67 797320.79
-605447.51 797307.46
-605459.89 797330.6
-605429.09 797403.63
-605446.24 797435.7
-605457.67 797442.05
-605573.89 797282.05
-605625 797192.51
-605721.52 797094.08
-605836.78 796990.21
-605890.43 796943.85
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605211.08 796876.74
-Region  1
-  59
-613828.84 801483.22
-613777.73 801403.88
-613691.25 801275.75
-613669.61 801291.62
-613605.65 801319.27
-613547.43 801333.85
-613395.83 801381.3
-613342.45 801417.8
-613278.37 801474.52
-613182.48 801640.05
-613159.77 801684.54
-613137.07 801719.83
-613096.57 801788.75
-613056.98 801823.43
-612987.64 801844.29
-612971.99 801859.33
-612872 801908.46
-612862 801913.72
-612928.41 802072.6
-612935.07 802088.16
-612943.01 802109.11
-612948.09 802124.67
-612955.4 802140.21
-612964.29 802158.62
-612969.68 802174.5
-612980.8 802190.69
-612986.2 802204.99
-613077.63 802133.86
-613168.75 802095.77
-613183.36 802093.3
-613232.89 802088.22
-613317.34 802080.92
-613351.95 802079.02
-613396.72 802070.44
-613441.17 802051.71
-613465.93 802026.94
-613565.64 801932.58
-613655.61 802078.17
-613687.28 802157
-613709.17 802148.92
-613741.18 802144.54
-613764.59 802161.28
-613816.81 802195.98
-613847.47 802214.85
-613872.74 802231.35
-613913.84 802259.65
-613958.31 802204.4
-614010.19 802131.97
-614046.41 802080.22
-614136.62 801940.47
-614173.46 801884.39
-614172.36 801884.39
-614172.36 801885.49
-614100.33 801809.07
-614049.75 801752.44
-614005.77 801702.96
-613922.48 801607.04
-613866.4 801530.07
-613828.84 801483.22
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613552.13 801800.38
-Region  1
-  62
-614615.1 804517.23
-614611.61 804661.09
-614637.83 804649.14
-614678.99 804627.56
-614712.52 804615.61
-614763.97 804591.71
-614796.99 804575.9
-614846.78 804565.61
-614915.82 804564.94
-614962.46 804573.07
-614999.64 804583.36
-615052.08 804606.27
-615100.21 804641.45
-615146.85 804691.08
-615187.18 804761.65
-615209.42 804837.04
-615239.29 805011.98
-615267.18 804990.4
-615326.26 804932.31
-615316.97 804881.19
-615328.25 804855.3
-615387.17 804798.01
-615367.92 804752.54
-615345.01 804704.07
-615351.48 804687.31
-615337.54 804672.7
-615297.71 804648.14
-615298.38 804617.6
-615306.17 804579.61
-615317.62 804494.45
-615309.66 804432.71
-615303.68 804401.84
-615302.19 804362.14
-615295.55 804330.27
-615300.19 804274.33
-615368.46 804215.91
-615431 804143.84
-615442.75 804114.31
-615392.27 804113.04
-615304.64 804054.61
-615272.82 804048.62
-614746.55 803936.55
-614641.16 803921.78
-614629.22 803920.12
-614620.59 803918.46
-614117.87 803873.01
-614080.19 803904.72
-614048.32 803916.67
-614018.12 803925.3
-613999.53 803932.94
-613981.1 803955
-614025.42 804024.56
-614052.18 804069.33
-614075.54 804110.54
-614119.52 804137.55
-614155.37 804132.57
-614185.24 804127.92
-614233.04 804149.83
-614323.82 804207.4
-614489.29 804380.8
-614560.83 804456
-614615.1 804517.23
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 614811.93 804268.77
-Region  1
-  52
-611116.02 803411.38
-611009.44 803397.88
-610757.88 803346.52
-610715.79 803386.35
-610708.1 803420.62
-610703.94 803435.35
-610675.44 803556.4
-610605.56 803557.89
-610546.08 803578.8
-610473.2 803609.45
-610254.91 803702.81
-610267.16 803734.47
-610276.12 803759.26
-610283.43 803775.81
-610335.68 803882.58
-610375.27 803952.2
-610418.12 804001.48
-610482.78 804203.67
-610486.07 804216.22
-610526.63 804214.63
-610596.24 804201.31
-610638.62 804178.51
-610686.72 804168.36
-610800.59 804113.26
-610902.44 804064.5
-610927.75 804059.42
-610954.97 804057.51
-611064.41 804006.84
-611173.87 803966.3
-611237.76 803938.43
-611373.77 804323.04
-611387.27 804325.46
-611388.23 804278.19
-611391.61 804232.38
-611394.27 804191.63
-611394.75 804164.14
-611396.68 804136.17
-611395.23 804110.61
-611399.57 804075.41
-611529.79 803864.7
-611592.96 803889.77
-611575.6 803817.44
-611734.51 803916.05
-611802.02 803906.88
-611838.19 803870.23
-611861.82 803792.58
-611396.64 803355.97
-611342.52 803374.22
-611298.8 803391.57
-611244.3 803409.9
-611211.51 803419.1
-611116.02 803411.38
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611017.21 803763.33
-Region  1
-  30
-598372.94 790866.12
-598306.78 790893.36
-598247.85 790910.04
-598097.43 790855.56
-598076.88 790871.1
-598116.22 790988.13
-598046.31 791010.85
-598110.71 791205.9
-598280.46 791183.54
-598723.93 791084.55
-598786.2 791105.45
-598837.56 791109.6
-598837.56 791103.7
-598841.04 791099.14
-598764.59 791013.74
-598717.61 790959.52
-598700.37 790935.62
-598659.79 790892.25
-598639.85 790861.52
-598662.71 790810.72
-598683.03 790765
-598606.17 790751.65
-598571.88 790724.98
-598546.48 790699.58
-598520.25 790672.15
-598502.46 790657.14
-598491.9 790649.91
-598453.27 790698.53
-598399.06 790842.77
-598372.94 790866.12
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 598416.39 790980.17
-Region  1
-  125
-607090.66 800127.38
-607005.55 800057.4
-606968.21 800020.03
-606944.9 799985.23
-606910.52 799936.81
-606856.62 799839.42
-606799.89 799738.24
-606725.65 799593.04
-606691.61 799526.85
-606646.67 799446.82
-606627.37 799414.96
-606613.07 799389.56
-606605.77 799374.64
-606541 799394.36
-606485.26 799411.01
-606433.73 799426.85
-606392.9 799437.17
-606360.98 799443.26
-606341.3 799446.43
-606319.07 799443.57
-606304.15 799438.81
-606287.32 799481.04
-606274.59 799502.86
-606261.42 799528.71
-606245.05 799554.5
-606249.09 799572.45
-606254.47 799601.62
-606260.76 799626.75
-606371.38 799712.23
-606387.98 799732.42
-606405.03 799768.77
-606414 799814.09
-606419.38 799881.4
-606426.56 799964.42
-606421.09 800024.9
-606414.74 800052.84
-606391.24 800106.82
-606363.93 800177.31
-606351.87 800216.68
-606339.49 800248.17
-606324.25 800272.93
-606458.24 800380.9
-606520.48 800425.35
-606517.31 800444.4
-606505.24 800492.03
-606489.68 800546.99
-606480.79 800586.36
-606483.97 800596.52
-606466.82 800607.32
-606466.19 800621.92
-606459.2 800650.5
-606447.13 800682.89
-606435.7 800709.56
-606421.1 800738.14
-606430.27 800758.81
-606450.92 800750.24
-606453.8 800722.01
-606456.1 800705.88
-606468.2 800686.87
-606489.96 800687.06
-606536.31 800694.04
-606583.94 800698.49
-606597.67 800712.97
-606604.89 800835.65
-606641.51 800841.38
-606645.9 800930.53
-606617.99 800972.05
-606609.35 800980.69
-606596.1 800991.06
-606581.69 800998.55
-606534.45 801022.75
-606535.6 801037.15
-606537.05 801128.5
-606541.66 801238.53
-606573.34 801293.84
-606589.19 801343.65
-606604.17 801431.22
-606612.23 801477.31
-606623.47 801527.72
-606651.7 801623.35
-606660.34 801749.52
-606668.4 801797.91
-606689.14 801838.24
-606729.22 801892.81
-606787.85 801976.5
-606819.52 802022.83
-606828.98 802035.6
-606831.34 802205.33
-606832.89 802250.44
-606967.26 802248.04
-607000.49 802212.88
-607046.24 802170.98
-607056.57 802176.55
-607063.85 802179.88
-607070.82 802183.82
-607096.29 802200.8
-607153.31 802119.64
-607154.97 802014.89
-607159.23 801937.34
-607233.45 801606.83
-607260.87 801475.39
-607282.11 801351.61
-607324.69 801208.71
-607354.01 801142.52
-607400.34 801085.78
-607489.23 801038.5
-607663.7 800982.21
-607752.59 800943.44
-607813.11 800895.22
-607863.23 800836.59
-607919.96 800770.39
-607955.9 800732.57
-607927.99 800715.91
-607873.74 800681.32
-607837.23 800647.9
-607715.34 800561.19
-607641.2 800495.43
-607574.02 800432.84
-607506.26 800384.08
-607440.95 800320.92
-607369.62 800274.9
-607291.13 800233.29
-607223.99 800199.25
-607162.52 800167.1
-607090.66 800127.38
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606960.87 800777.78
-Region  1
-  41
-609060.72 800407.82
-609010.03 800456.56
-608961.77 800488.24
-608949.85 800509.94
-608933.28 800575.74
-608901.34 800638.37
-608886.72 800662.26
-608824.55 800726.85
-608748.03 800801.91
-608731.94 800886.23
-608731.94 800912.55
-608738.77 800937.9
-608752.05 800957.97
-608796.74 800988.53
-608837.37 801018.73
-608810.07 801042.12
-608828.49 801063.46
-608855.16 801094.58
-608907.23 801148.55
-608925.64 801132.68
-608953.58 801106.64
-608935.17 801064.1
-608952.95 801059.02
-608984.98 801056.18
-609016.45 801068.54
-609065.27 801098.16
-609082.93 801083.25
-609074.23 801055.84
-609069.74 801005.82
-609109.89 800901.22
-609143.27 800822.63
-609142.8 800716.42
-609206 800588.07
-609251.3 800512.74
-609313.13 800447.28
-609272.98 800382.23
-609195.97 800274.02
-609072.4 800120.73
-609145.03 800215.29
-609086.07 800336.17
-609060.72 800407.82
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609015.77 800713.88
-Region  1
-  45
-615119.27 798565.21
-614982.73 798259.75
-614601.96 798190.07
-614119.96 798258.97
-614077.67 798358.91
-614052.7 798437.27
-614051.54 798516.36
-614061.11 798582.15
-614107.38 798689.27
-614144.87 798735.7
-614021.2 798750.99
-614011.2 798754.79
-614425.83 799219.17
-614434.76 799229.17
-614482.29 799275.33
-614534.77 799326.3
-614583.67 799354.24
-614642.09 799354.24
-614707.04 799306.85
-614720.52 799280.3
-614723.03 799172.24
-614729.52 799142.75
-614759.68 799098.77
-614788.16 799076.99
-614871.92 799051.86
-614926.79 799037.62
-614975.46 799026
-615046.58 799008.86
-615109.45 798993.55
-615222.48 798966.88
-615280.9 798946.56
-615316.47 798907.13
-615366.98 798788.8
-615401.56 798771.24
-615409.81 798742.67
-615414.89 798726.79
-615422.51 798703.93
-615418.71 798684.89
-615387.59 798655.67
-615367.27 798632.81
-615352.02 798618.84
-615339.96 798562.32
-615319.95 798473.77
-615307.25 798479.48
-615119.27 798565.21
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 614658.47 798696.42
-Region  1
-  98
-608485.65 793140.1
-608524.39 793134.1
-608623.13 793088.7
-608670.76 793100.13
-608821.25 793093.46
-608910.78 793131.25
-608953.74 793149
-608995.65 793163.6
-609051.49 793141.13
-609107.16 793048.72
-609168.81 792948.9
-609183.73 792875.22
-609133.88 792693.65
-609132.61 792641.89
-609143.4 792564.45
-609156.73 792476.21
-609177.05 792422.87
-609258.99 792314.26
-609346.45 792207.1
-609411.09 792120.89
-609450.46 792057.7
-609360.6 792031.35
-609317.1 792080.56
-609265.34 792113.9
-609224.2 792130.26
-609169.27 792139.46
-609105.13 792135.65
-609094.15 792134.09
-609037.44 792121.1
-609048.87 792076.65
-609056.81 792065.22
-609071.73 792049.38
-609046.65 792032.86
-609030.77 792021.75
-609012.36 792015.4
-608973.94 792015.41
-608908.53 792010.33
-608877.73 792010.01
-608833.92 792023.66
-608789.47 791970.67
-608736.76 791937.33
-608683.11 791923.05
-608706.28 791870.34
-608511.34 791781.74
-608497.16 791817.53
-608482.91 791832.07
-608456.87 791850.17
-608427.98 791859.06
-608366.7 791857.48
-608320.34 791864.14
-608299.38 791888.28
-608271.39 791975.44
-608273.3 792011.95
-608292.66 792014.82
-608297.11 792037.36
-608265.99 792092.29
-608244.4 792113.88
-608232.97 792128.48
-608205.03 792173.25
-608202.18 792184.68
-608204.4 792195.16
-608231.7 792213.89
-608238.17 792280.03
-608230.87 792309.24
-608216.9 792335.6
-608182.61 792354.33
-608165.15 792380.68
-608148.95 792415.61
-608099.74 792475.95
-608059.1 792516.59
-608060.68 792521.98
-608071.16 792528.34
-608085.13 792564.85
-608103.92 792633.38
-608072.35 792677.66
-608029.49 792735.12
-607978.69 792781.16
-607935.51 792819.26
-607876.65 792872.58
-607719.1 793019.46
-607755.61 793046.45
-607746.72 793078.52
-607728.73 793101.37
-607764.6 793138.84
-607775.34 793113.07
-608124.01 793253.49
-608147.19 793264.92
-608179.57 793161.73
-608222.76 793122.67
-608267.89 793092.28
-608296.1 793064.88
-608318 793045.83
-608311.02 793091.87
-608300.54 793132.82
-608369.76 793151.24
-608439.61 793165.82
-608445.01 793137.56
-608485.65 793140.1
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608591.72 792577.33
-Region  1
-  66
-608271.39 791975.44
-607594.94 791924.01
-607540.97 791922.43
-607488.58 791916.73
-607456.51 791930.7
-607435.24 791894.5
-607401.91 791871.35
-607339.68 791856.74
-607253.63 791872.3
-607157.11 791869.46
-607064.4 791846.6
-607078.78 791940.11
-607089.48 792036.16
-607105.99 792119.35
-607140.28 792224.32
-607151.39 792293.05
-607170.1 792410.42
-607172.02 792456.62
-607183.43 792515.49
-607182.6 792666.54
-607217.53 792672.58
-607263.56 792693.84
-607288.64 792708.12
-607321.66 792724.95
-607361.35 792731.94
-607409.29 792706.22
-607446.44 792707.17
-607517.24 792710.35
-607525.18 792654.46
-607528.42 792592.76
-607534.86 792538.47
-607600.9 792511.17
-607613.6 792502.28
-607653.28 792524.18
-607734.25 792494.02
-607787.9 792454.65
-607817.43 792448.93
-607826.98 792414.8
-607846.98 792402.26
-607913.02 792442.27
-607941.62 792419.11
-607953.05 792419.11
-607987.34 792426.73
-608014.96 792443.88
-608034.97 792472.45
-608039.73 792496.27
-608049.57 792511.51
-608059.1 792516.59
-608099.74 792475.95
-608148.95 792415.61
-608165.15 792380.68
-608182.61 792354.33
-608216.9 792335.6
-608230.87 792309.24
-608238.17 792280.03
-608231.7 792213.89
-608204.4 792195.16
-608202.18 792184.68
-608205.03 792173.25
-608232.97 792128.48
-608244.4 792113.88
-608265.99 792092.29
-608297.11 792037.36
-608292.66 792014.82
-608273.3 792011.95
-608271.39 791975.44
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607613.83 792231.96
-Region  1
-  51
-611575.67 809277.92
-611601.06 809292.42
-611626.45 809319.62
-611648.21 809345.01
-611681.76 809343.2
-611708.05 809343.2
-611739.79 809342.29
-611765.18 809339.57
-611801.44 809339.57
-611872.63 809335.61
-611923.41 809333.79
-611976 809323.82
-611979.62 809302.96
-612024.92 808792.02
-612017.32 808788.23
-611958.32 808804.74
-611850.87 808809.76
-611795.56 808809.76
-611774.71 808812.48
-611742.07 808823.36
-611718.16 808831.53
-611703.4 808839.61
-611681.89 808844.05
-611627.44 808842.18
-611621.86 808779.39
-611614 808690.99
-611520.83 808685.54
-611516.81 808705.66
-611513.43 808767.58
-611509.95 808796.16
-611504.51 808838.78
-611502.7 808883.21
-611499.07 808939.42
-611419.28 808864.16
-611378.07 808871.39
-611335.03 808870.78
-611302.75 808876.49
-611281.25 808894.21
-611255.3 808901.18
-611223.03 808911.95
-611198.94 808935.61
-611256.06 809002.71
-611269.66 809039.89
-611283.26 809107.89
-611302.3 809158.66
-611321.34 809176.8
-611392.07 809204
-611433.77 809220.32
-611484.55 809238.46
-611538.05 809262.03
-611575.67 809277.92
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611667.36 809046.53
-Region  1
-  95
-607773 810132.63
-607782 810173.47
-607777.5 810231.95
-607737.36 810334.4
-607709.67 810396.7
-607687.94 810465.2
-607671.87 810507.44
-607670.77 810519.45
-607727.96 810538.71
-607734.3 810543.77
-607760.63 810583.27
-607774.28 810613.11
-607810.35 810641.79
-607991.75 810779.17
-607969.6 810654.57
-608119.12 810619.27
-608132.62 810627.92
-608246.14 810536.54
-608289.75 810579.46
-608321.59 810563.54
-608365.2 810592.61
-608385.28 810645.22
-608451.48 810539.01
-608464.89 810522.7
-608561.8 810603
-608578.41 810641.76
-608599.87 810659.76
-608631.71 810681.22
-608666.32 810700.6
-608704.22 810717.29
-608714.22 810710.56
-608775.7 810669.18
-608811.12 810635.63
-608846.53 810604.62
-608868.03 810584.37
-608883.84 810564.75
-608892.68 810540.07
-608879.87 810511.28
-608868.1 810481.51
-608854.95 810442.06
-608841.8 810418.52
-608830.03 810406.75
-608826.07 810394.61
-608827.96 810380.69
-608842.74 810330.33
-608889.03 810257.8
-608862.78 810243.29
-608846.2 810230.86
-608824.78 810210.13
-608806.13 810175.6
-608781.63 810128.44
-608764.76 810088.91
-608746.84 810044.64
-608733.66 810013.02
-608712.58 809983.5
-608688.34 809965.06
-608667.78 809935.54
-608653.03 809906.56
-608634.05 809871.77
-608614.02 809840.68
-608584.51 809813.27
-608551.39 809796.92
-608519.68 809791.66
-608487.45 809789.99
-608458.28 809796.68
-608427.71 809711.83
-608391.35 809677.67
-608366.58 809658.69
-608339.7 809638.14
-608319.15 809617.06
-608302.81 809596.5
-608289.63 809583.85
-608270.13 809562.24
-608235.87 809525.35
-608203.72 809490.04
-608156.28 809436.81
-608049.29 809507.43
-607999.8 809537.81
-607959.21 809565.02
-607936.37 809588.56
-607914.91 809613.48
-607890.68 809652.93
-607874.76 809650.86
-607817.99 809637.01
-607782.69 809681.32
-607763.86 809709.98
-607731.12 809738.41
-607683.36 809778.56
-607652.9 809802.1
-607582.3 809848.48
-607636.98 809925.31
-607683.71 809994.19
-607723.16 810051.64
-607746.7 810086.25
-607773 810132.63
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608226.42 810147.25
-Region  1
-  40
-613749.53 803345.94
-613716.42 803260.38
-613684.12 803138.48
-613672.54 803098.52
-613640.88 803009.83
-613644.38 802916.45
-613442.67 802872.15
-613420.09 802890.1
-613389.98 802913.84
-613366.82 802928.9
-613337.29 802950.32
-613288.08 802987.38
-613200.92 803049.59
-613134.91 802929.19
-613059.06 802896.19
-612961.79 803397.67
-612969.89 803452.68
-612919.17 803476.8
-613055.01 803551.62
-613146.94 803598.16
-613273.73 803659.74
-613362.55 803706.24
-613418.32 803733.46
-613484.54 803763.12
-613543.62 803786.69
-613608.18 803807.06
-613679.88 803824.32
-613760.87 803838.26
-613834.23 803846.96
-613945.09 803856.92
-614118.36 803873.52
-614120.19 803807.62
-614122.18 803746.88
-614138.53 803729.13
-614159.93 803708.19
-614172.74 803695.63
-614180.47 803688.62
-614190.86 803678.22
-613745.06 803370.02
-613749.53 803345.94
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613495.14 803405.54
-Region  1
-  89
-602285.18 797543.89
-602290.89 797519.12
-602337.25 797461.97
-602362.02 797440.8
-602401.38 797411.38
-602418.31 797396.78
-602428.26 797385.35
-602454.93 797367.99
-602472.92 797375.61
-602478 797397.41
-602482.87 797434.45
-602520.12 797347.87
-602545.93 797312.81
-602584.45 797260.32
-602602.23 797239.58
-602598.42 797215.22
-602584.88 797175.22
-602563.5 797143.26
-602513.76 797118.71
-602458.66 797119.3
-602406.01 797123.54
-602374.59 797092.97
-602342.75 797058.58
-602316.85 797028.86
-602300.71 797009.33
-602287.97 796993.62
-602270.14 796971.96
-602224.88 797010.69
-602192.62 797037.19
-602147.68 797074.64
-602101.01 797111.51
-602064.97 797142.38
-602018.31 797180.97
-601983.75 797208.62
-601948.61 797238
-601908.2 797268.02
-601882.94 797281.21
-601854.14 797293.3
-601793.08 797315.19
-601886.97 797507.59
-601864.51 797524.88
-601844.65 797536.68
-601821.03 797550.51
-601795.68 797553.97
-601772.84 797560.37
-601757.83 797588.98
-601747.6 797625.54
-601755.24 797705.69
-601777.29 797733.79
-601829.59 797776.59
-601844.08 797802.32
-601847.97 797866.73
-601847.54 797885.32
-601848.4 797905.2
-601870.45 797890.5
-601878.66 797884.02
-601886.01 797877.97
-601894.22 797869.75
-601912.38 797847.27
-601901.14 797812.26
-601889.68 797786.53
-601866.77 797744.17
-601843.43 797701.37
-601818.35 797655.98
-601829.16 797642.58
-601840.67 797640.05
-601856.83 797641.28
-601873.25 797651.66
-601906.97 797695.75
-601931.61 797721.69
-601941.42 797725.4
-601954.96 797722.55
-602047.9 797680.19
-602061.3 797779.62
-602077.51 797817.88
-602102.58 797869.75
-602111.43 797888.12
-602149.04 797897.2
-602220.8 797920.98
-602255.82 797934.81
-602294.29 797945.18
-602278.73 797909.74
-602252.36 797853.54
-602235.93 797818.09
-602220.37 797785.24
-602229.3 797768.64
-602240.09 797733.71
-602262.95 797644.18
-602285.18 797543.89
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 602150.63 797425.48
-Region  1
-  82
-604203.99 789091.23
-604541.81 789001.33
-604566.57 789049.27
-604711.04 789220.76
-604789.14 789148.97
-604863.12 789078.49
-604937.09 789011.15
-604951.06 788988.61
-604996.78 788842.87
-605134.9 788781.59
-605261.58 788700.6
-605324.13 788669.14
-605338.42 788658.03
-605382.55 788588.5
-605400.97 788545.95
-605413.99 788521.52
-605427.32 788493.9
-605446.69 788452.62
-605468.28 788402.14
-605518.12 788409.79
-605569.24 788419.31
-605617.18 788430.11
-605629.25 788407.25
-605648.62 788370.41
-605671.79 788328.5
-605733.71 788213.23
-605774.98 788133.26
-605721.64 788130.4
-605704.81 788122.78
-605689.89 788111.67
-605671.48 788083.69
-605611.16 788053.53
-605549.24 788026.54
-605491.78 788097.98
-605456.54 788143.1
-605412.41 788198.99
-605381.7 788245.28
-605372.72 788288.8
-605387.01 788325.93
-605215.24 788344.67
-605171.1 788404.36
-605120.62 788452.63
-605065.38 788492.95
-604990.13 788539.3
-604950.76 788562.16
-604905.23 788588.27
-604864.72 788615.18
-604834.24 788617.69
-604730.1 788624.36
-604691.36 788584.99
-604648.82 788502.43
-604609.13 788425.28
-604597.71 788403.06
-604581.92 788374.88
-604554.61 788327.57
-604490.16 788350.43
-604457.77 788329.49
-604417.77 788323.14
-604358.4 788339.65
-604325.06 788346
-604293.08 788362.85
-604269.04 788395.76
-604258.7 788406.05
-604248.22 788440.34
-604073.27 788439.43
-604007.55 788501.02
-603983.74 788532.77
-603974.85 788553.09
-604023.74 788574.1
-604015.49 788614.1
-604006.6 788631.25
-603993.26 788645.54
-603969.45 788653.47
-603924.36 788661.11
-603932.3 788666.83
-603934.84 788673.18
-603940.55 788684.29
-603971.03 788692.86
-604007.76 788705.87
-603899.51 789107.4
-603926.18 789106.77
-604203.99 789091.23
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604696.44 788677.63
-Region  1
-  82
-610994.52 806714.04
-610976.2 806812.55
-610950.3 806882.34
-610929.27 806921.15
-610894.22 807002.12
-610877.72 807050.03
-610839.86 807148.75
-610823.5 807227.84
-610810.31 807303.13
-610800.91 807381.59
-610814.91 807443.58
-610859.94 807545.39
-610916.34 807540.67
-611036.58 807590.85
-611065.18 807631.35
-611218.84 807775.69
-611369.4 807908.36
-611416.82 807935.44
-611461.04 807959.29
-611513.14 807977.82
-611557.48 807996.78
-611606.23 808006.87
-611642.16 808016.17
-611679.92 808024.12
-611737.06 808006.24
-611777.31 807985.86
-611874.85 807945.77
-611875.76 807917.66
-611877.34 807713.25
-611912.25 807564.81
-611984.19 807455.57
-612016.43 807447.81
-612068.39 807359.6
-612053.47 807348.95
-612099.83 807227.44
-611980.2 807136.56
-611862.96 807131.23
-611944.5 806787.59
-611998.15 806679.13
-612002.86 806670.67
-612007.66 806657.35
-612041.1 806592.44
-612069.47 806517.19
-612067.08 806483.89
-612053.58 806407.09
-612045.5 806350.43
-612050.29 806274.87
-612071.08 806149.53
-612101.72 806118.35
-612156.61 806079.99
-612265.25 806019.2
-612324.09 805983.12
-612384.96 805941.14
-612399.88 805918.14
-612418.53 805883.5
-612427.06 805845.67
-612371.64 805841.94
-612339.13 805831.28
-612216.57 805760.94
-612099.59 805690.31
-611979.71 805614.81
-611795.33 805517.3
-611785.21 805528.49
-611782.54 805555.66
-611755.1 805617.74
-611751.37 805653.97
-611692.23 805663.56
-611642.68 805683.8
-611620.84 805709.91
-611609.94 805752.26
-611601.13 806134.52
-611521.21 806130.79
-611426.38 806177.68
-611301.18 806074.85
-611073.69 806276.23
-611049.72 806323.12
-611033.2 806369.47
-611020.62 806429.95
-611016.3 806512.83
-611008.83 806584.13
-611001.77 806649.59
-610994.52 806714.04
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611553.42 806838.7
-Region  1
-  102
-612097.89 798438.95
-612167.2 798383.78
-612259.98 798313.35
-612347.52 798244.5
-612394.02 798151.94
-612432.56 798074.2
-612486.36 798034.99
-612544.26 798001.71
-612632.94 797964.54
-612663.04 797958.62
-612744.19 797961.35
-612740.55 797921.68
-612738.27 797907.55
-612735.31 797892.8
-612706.13 797894.17
-612676.04 797895.54
-612624.06 797898.27
-612612.67 797802.98
-612604.46 797734.13
-612602.18 797715.89
-612597.16 797680.33
-612593.97 797653.43
-612572.09 797653.43
-612569.35 797616.95
-612563.42 797577.74
-612540.17 797579.11
-612489.1 797587.32
-612459.47 797574.55
-612438.95 797568.62
-612403.39 797543.55
-612509.85 797394.67
-612404.75 797334.37
-612501.86 797166.47
-612502.35 797165.63
-612502.83 797164.79
-612549.01 797084.94
-612576.29 797037.77
-612575.72 797037.73
-612458.25 797060.59
-612418.88 797058.05
-612364.9 797033.28
-612267.11 796987.56
-612153.95 796980.3
-612131.73 797002.91
-612017.03 796992.71
-611965.5 796980.78
-611885.59 796945.74
-611868.61 796937.4
-611825.87 796913.34
-611730.94 796934.21
-611670.83 796997.5
-611643.01 797067.76
-611633.55 797157.64
-611638.65 797248.78
-611666.53 797339.3
-611703.51 797451.9
-611731.33 797568.17
-611734.97 797597.8
-611747.51 797640.44
-611754.38 797695.33
-611618.55 797616.43
-611615.09 797617.44
-611615.08 797617.44
-611279.6 797714.87
-611087.59 797913.13
-611077.59 797916.47
-611054.7 797924.12
-611060.01 797931.73
-611105.13 797998.74
-611135.88 798000.34
-611169.51 798000.32
-611212.47 798001.71
-611200.16 798091.07
-611194.9 798144.41
-611251.89 798145.32
-611389.82 798144.64
-611580.85 798142.82
-611580.4 798459.32
-611480.55 798485.31
-611367.48 798514.49
-611346.5 798520.41
-611327.81 798514.03
-611304.1 798504.91
-611282.44 798496.02
-611260.56 798491.46
-611232.75 798492.37
-611205.85 798502.86
-611161.62 798533.86
-611114.66 798563.5
-611092.77 798638.76
-611054.01 798770.98
-611392.55 798716.02
-611495.18 798748.59
-611782.83 798852.38
-611829.34 798868.79
-611915.51 798900.25
-611928.05 798854.92
-611955.86 798755.53
-611972.05 798709.26
-612004.88 798629.47
-612075.32 798469.21
-612097.89 798438.95
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611903.78 797880.65
-Region  1
-  61
-604423.24 798855.26
-604631.29 798767.85
-604679.01 798727.5
-604727.61 798671.97
-604766 798603.63
-604850.39 798403.79
-604594.35 798440
-604542.41 798446.59
-604519.4 798441.87
-604464.14 798388.96
-604451.6 798387.39
-604485.49 798254.69
-604510.97 798178.66
-604520.19 798137.69
-604515.1 798078.5
-604496.08 798035.94
-604487.06 797989.29
-604462.76 797950.48
-604441.78 797913.05
-604412.78 797856.99
-604390.24 797819.18
-604354.96 797761.55
-604319.68 797706.27
-604311.47 797690.98
-604314.01 797657.06
-604314.4 797632.76
-604293.63 797618.64
-604287.86 797609.34
-604260.7 797630.01
-604243.84 797644.12
-604238.35 797649.22
-604229.34 797657.06
-604222.29 797663.33
-604216.21 797669.03
-604197.39 797686.28
-604187.18 797696.08
-604174.24 797707.84
-604159.34 797723.13
-604191.08 797730.58
-604244.8 797740.38
-604204.42 797779.97
-604153.85 797826.23
-604135.1 797842.04
-604114.51 797864.04
-604101.81 797876.11
-604077.78 797903.14
-604073.02 797939.34
-604053.05 797978.38
-604116.1 798006.61
-604092.29 798048.2
-604119.45 798122.78
-604306.78 798582.97
-604128.16 798658.36
-604085.93 798775.84
-604150.64 798931.22
-604221.45 799108.41
-604298.09 799081.15
-604307.02 799053.27
-604369.43 798914.45
-604393.11 798878.94
-604423.24 798855.26
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604367.49 798397.82
-Region  1
-  59
-611097.39 809452.46
-611097.39 809486.01
-611076.53 809546.76
-611039.36 809635.62
-611046.61 809665.54
-611144.99 810017.79
-611184.9 810041.16
-611214.66 810050.01
-611234.28 810045.57
-611248.82 810032.91
-611264.62 810004.44
-611274.07 809958.25
-611270.84 809891.83
-611266.37 809850.08
-611272.01 809793.78
-611277.05 809775.43
-611350.81 809657.86
-611588.37 809973.39
-611619.2 809909.01
-611676.58 809882.79
-611718.48 809874.11
-611800.09 809851.45
-611833.64 809841.47
-611869 809841.47
-611740.24 809623.81
-611740.24 809570.32
-611678.13 809440.22
-611682.67 809413.92
-611765.18 809339.57
-611739.79 809342.29
-611708.05 809343.2
-611681.76 809343.2
-611648.21 809345.01
-611626.45 809319.62
-611601.06 809292.42
-611575.67 809277.92
-611538.05 809262.03
-611484.55 809238.46
-611433.77 809220.32
-611392.07 809204
-611321.34 809176.8
-611302.3 809158.66
-611283.26 809107.89
-611269.66 809039.89
-611256.06 809002.71
-611198.94 808935.61
-611189.61 808914.71
-611183.27 808916.86
-611168.73 808931.41
-611144.72 808964.32
-611128.29 808986.48
-611107.41 808989.02
-611064.74 809000.9
-611040.26 809076.15
-611002.18 809179.52
-611035.96 809208.72
-611045.25 809261.56
-611063.29 809330.17
-611097.39 809452.46
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611366.04 809516.79
-Region  1
-  35
-612627.29 795734.74
-612476.97 795141.57
-612476.96 795141.53
-612476.94 795141.43
-612476.85 795141.09
-612437.9 794987.39
-612433.5 794970.02
-612423.28 794962.94
-612423.28 794962.95
-612410.34 794953.98
-612397.3 794944.95
-612386.84 794937.71
-612120.89 794904.17
-611959.77 794883.85
-611692.15 794859.51
-611683.12 794858.69
-611447.42 794837.26
-611447.21 794837.24
-611321.14 794825.77
-611229.67 794817.46
-611227.96 794817.3
-611209.69 794815.64
-611000.71 794871.73
-610957.01 794883.46
-610964.47 794905.01
-611356.52 796376.94
-611762.54 796273.77
-612842.35 795983.71
-612749.68 795876.43
-612749.62 795876.36
-612749.56 795876.29
-612729.07 795852.56
-612641.71 795751.43
-612638.47 795747.68
-612627.29 795734.74
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611823.95 795542
-Region  1
-  113
-605706.05 795244.08
-605671.11 795215.3
-605644.39 795169.06
-605597.12 795190.64
-605562.18 795205.03
-605528.27 795138.23
-605501.55 795100.21
-605482.03 795075.55
-605440.42 795029.82
-605400.34 794990.77
-605359.24 794956.86
-605310.94 794918.84
-605242.1 794886.98
-605223.6 794877.74
-605171.19 794859.24
-605104.4 794842.8
-605060.21 794836.63
-605065.35 794763.67
-605036.58 794758.53
-605019.11 794746.2
-605001.64 794733.87
-604982.12 794718.46
-604969.78 794707.15
-604950.26 794694.82
-604917.38 794678.38
-604875.25 794665.02
-604851.15 794652.38
-604733.5 794745.28
-604596 794852.56
-604604.89 794904.64
-604626.96 794967.64
-604645.31 795017.95
-604631.02 795042.4
-604712.62 795091.01
-604788.5 795112.92
-604861.53 795115.46
-604840.89 795157.37
-604784.38 795181.82
-604691.67 795201.85
-604598.32 795209.79
-604620.23 795219.95
-604633.56 795225.35
-604695.12 795263.28
-604756.53 795266.79
-604876.94 795294.21
-604980.01 795345.08
-605095.6 795432.15
-605223.67 795556.7
-605368.17 795679.73
-605436.14 795767
-605476.93 795816.55
-605576.92 795949
-605579.99 795953.83
-605587.01 795964.79
-605658.77 796065.05
-605681.63 796085.93
-605734.65 796118.73
-605983.59 796272.52
-606021.83 796394.35
-606157.4 796611.8
-606193.2 796661.87
-606222.97 796700.49
-606239.19 796729.01
-606253.8 796703.58
-606269.8 796673.28
-606300.79 796599.14
-606320.48 796530.56
-606347.15 796473.4
-606392.23 796414.98
-606422.08 796399.1
-606456.36 796450.52
-606505.26 796501.33
-606570.66 796533.71
-606657.34 796544.18
-606717.98 796537.83
-606740.2 796434.69
-606794.18 796198.8
-606725.28 796169.59
-606663.05 796137.84
-606576.37 796083.86
-606540.49 796028.94
-606492.87 795951.78
-606462.71 795893.97
-606484.02 795779.57
-606500.45 795702.35
-606544.3 795608.74
-606538.27 795567.15
-606502.07 795501.76
-606457.94 795426.54
-606382.05 795309.34
-606316.02 795209.95
-606263.63 795140.74
-606243.23 795068.72
-606231.81 794997.83
-606226.72 794942.76
-606121.73 794977.41
-605939.84 795042.15
-605945.49 795046.77
-605967.07 795075.55
-605981.45 795110.49
-605975.29 795137.2
-605968.09 795161.87
-605950.62 795195.78
-605929.04 795222.5
-605920.82 795227.64
-605889.99 795247.16
-605876.64 795254.35
-605845.81 795264.63
-605830.39 795266.68
-605802.65 795268.74
-605772.84 795267.71
-605745.1 795258.46
-605706.05 795244.08
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605804.48 795614.98
-Region  1
-  82
-605200.01 806589.11
-605248.91 806380.45
-605305.19 806157.39
-605305.19 806141.28
-605296.31 806111.18
-605309.02 806066.24
-605324.29 805999.25
-605352.27 805883.93
-605352.27 805850.86
-605329.89 805809.7
-605285.72 805776.67
-605261.98 805735.12
-605261.98 805692.72
-605278.93 805655.42
-605329.81 805619.8
-605368.81 805574.86
-605383.65 805537.98
-605381.11 805494.73
-605303.1 805293.77
-605279.36 805263.25
-605249.68 805247.13
-605214.6 805241.63
-605136.91 805240.35
-605090.55 805257.51
-605011.47 805291.08
-604946.55 805323.03
-604901.61 805344.23
-604906.87 805362.5
-604942.06 805461.3
-604970.62 805527.08
-604978.91 805573.89
-604951.09 805599.21
-604922 805618.84
-604891.49 805658.95
-604867.39 805691.32
-604844.66 805760.18
-604823.31 805834.55
-604823.31 805861.41
-604835.03 805920.66
-604854.3 805993.63
-604837.08 806036.33
-604787.5 806099.69
-604661.82 806260.45
-604610.52 806324.8
-604580.91 806364.74
-604554.74 806368.87
-604540.96 806347.52
-604521.34 806304.52
-604488.97 806267.34
-604460.05 806247.37
-604430.44 806234.97
-604402.2 806229.46
-604375 806227.7
-604348.14 806239.41
-604298.56 806230.45
-604247.6 806218.06
-604255.17 806271.77
-604246.22 806376.45
-604251.04 806470.1
-604252.84 806553.62
-604256.89 806639.15
-604340.22 806628.13
-604407.02 806632.95
-604457.98 806628.13
-604508.94 806608.16
-604620.5 806484.89
-604632.89 806568.22
-604624.63 806688.73
-604643.22 806738.31
-604753.76 806930.76
-604758.92 806942.79
-604787.16 806930.4
-604814.02 806914.56
-604840.87 806902.16
-604940.68 806880.36
-605089.47 806843.63
-605079.15 806928.33
-605073.64 806967.59
-605151.8 806974.81
-605161.44 806882.53
-605164.2 806844.55
-605200.01 806589.11
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604937.34 806176.05
-Region  1
-  46
-603582.75 794507.53
-603622.95 794530.87
-603674.06 794543.54
-603719.78 794548.62
-603784.68 794555.67
-603845.51 794568.3
-603862.02 794569.57
-603905.2 794581
-603936.32 794597.51
-603964.89 794609.58
-603990.93 794541.63
-604032.84 794445.11
-604054.24 794368.98
-604054.68 794292.16
-604041.98 794209.61
-604064.84 794181
-603838.15 794046.38
-603797.53 793742.87
-603720.67 793750.43
-603692.74 793821.73
-603644.56 793873.15
-603621.71 793885.77
-603606.48 793898.51
-603590.51 793930.96
-603571.11 793956.84
-603527.78 794022.29
-603499.45 794070.61
-603464.46 794132.68
-603391.14 794174.76
-603354.48 794185.59
-603323.03 794180.84
-603311.37 794190.42
-603302.62 794199.17
-603292.75 794210
-603277.56 794225.82
-603261.11 794244.81
-603261.29 794248.73
-603262.92 794272.84
-603289.38 794275.38
-603322.19 794286.81
-603353.54 794301.15
-603387.73 794330.27
-603433.32 794373.96
-603477.02 794423.97
-603526.22 794471.61
-603582.75 794507.53
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603720.07 794237.54
-Region  1
-  96
-602951.16 798884.28
-602979.1 798908.73
-603001.17 798972.1
-603041.69 799088.05
-603054.22 799121.36
-603063.81 799129.62
-603068.87 799135.21
-603080.59 799147.47
-603106.7 799175.71
-603131.91 799207.55
-603185.72 799274.14
-603246.98 799272.01
-603298.4 799276.81
-603365.35 799257.35
-603411.72 799248.46
-603432.67 799252.59
-603462.84 799269.74
-603503.64 799311.51
-603545.24 799359.77
-603598.75 799400.56
-603646.38 799433.59
-603707.35 799475.18
-603704.17 799519
-603722.27 799512.02
-603774.98 799489.79
-603847.39 799462.16
-603890.57 799440.57
-603919.94 799404.51
-603936.77 799341.32
-603941.22 799287.65
-603947.41 799224.9
-603968.68 799176.96
-603992.98 799141.27
-604019.65 799104.12
-604058.87 799037.28
-604069.82 798845.94
-604078.3 798817.12
-604085.93 798775.84
-604128.16 798658.36
-604306.78 798582.97
-604119.45 798122.78
-604092.29 798048.2
-604116.1 798006.61
-604053.05 797978.38
-604024.76 798024.43
-603977.13 798070.47
-603943.48 798040.63
-603868.23 798024.12
-603764.41 798044.75
-603737.75 798061.26
-603714.57 798086.03
-603706 798096.51
-603699.97 798102.54
-603695.84 798106.35
-603691.08 798111.43
-603685.04 798118.11
-603666.05 798136.72
-603607.94 798326.93
-603588.89 798361.84
-603539.67 798365.34
-603512.05 798378.99
-603488.55 798405.35
-603362.8 798364.38
-603133.06 798213.04
-602969.83 797987.91
-602818.68 797721.81
-602803.44 797732.38
-602752 797779.05
-602713.89 797813.35
-602684.85 797838.27
-602511.84 797994.81
-602501.36 798004.97
-602487.71 798017.67
-602465.8 798035.77
-602441.67 798011.32
-602441.67 798044.66
-602444.21 798266.28
-602443.58 798310.42
-602445.48 798338.04
-602484.21 798399.97
-602516.6 798466.64
-602557.24 798487.9
-602586.14 798507.59
-602657.59 798543.79
-602766.68 798599.32
-602827.47 798613.26
-602897.65 798631.04
-602877.96 798676.13
-602839.06 798750.94
-602834.62 798772.53
-602801.28 798810.95
-602753.01 798872.87
-602827.15 798869.43
-602860.34 798867.13
-602927.02 798872.21
-602951.16 798884.28
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603400.59 798612.54
-Region  1
-  488
-617923.15 808064.91
-617999.3 808047.86
-618078 808048.02
-618103.46 808051.34
-618249.24 808049.91
-618255.55 808051.97
-618344.54 808097.13
-618379.3 808119.04
-618444.82 808076.1
-618466.3 808050.43
-618486.44 808010.58
-618506.04 807955.41
-618506.37 807903.53
-618501.3 807810
-618505.95 807785.42
-618494.56 807731.47
-618494.9 807652.12
-618501.43 807571.43
-618513.28 807520.19
-618563.11 807462.45
-618529.73 807330.1
-618534.81 807242.47
-618518.3 807255.17
-618463.69 807142.14
-618424.32 807093.88
-618419.24 807017.68
-618397.65 806963.07
-618397.65 806861.47
-618501.79 806799.24
-618548.78 806792.89
-618560.21 806723.04
-618623.71 806687.48
-618660.54 806726.85
-618691.4 806707.61
-618585.75 806490.34
-618523.38 806402.88
-618505.6 806454.95
-618541.16 806518.45
-618337.96 806639.1
-618177.94 806551.47
-618208.42 806477.81
-618349.39 806547.66
-618713.88 806176.82
-618750.71 806278.42
-618744.36 806347
-618688.48 806463.84
-618642.76 806458.76
-618586.09 806489.76
-618691.1 806705.43
-618779.92 806888.14
-618796.43 806979.58
-618781.19 807071.02
-618749.44 807142.14
-618694.83 807211.99
-618623.71 807267.87
-618531.53 807329.11
-618604.95 807454.48
-618772.74 807451.6
-618886.29 807456.66
-618934.11 807461.75
-618990.25 807451.84
-619015.04 807443.21
-619099.06 807431.4
-619160.82 807413.91
-619191.26 807398.7
-619205.2 807396.49
-619233.87 807364.31
-619253.8 807311.85
-619253.69 807289.36
-619238.31 807238.73
-619199.57 807190.69
-619173.12 807143.21
-619167.81 807128.16
-619098.2 807059.92
-619081.6 807040.66
-619036.35 806999.83
-618997.29 806949.71
-618939.51 806890.61
-618907.42 806863.83
-618875.17 806835.84
-618847.17 806803.84
-618826.84 806744.78
-618828.35 806716.59
-618891.66 806586.83
-618920.37 806540.49
-619006.9 806383.64
-619028.47 806315.41
-619114.99 806247.34
-619158.11 806170.82
-619182.15 806134.71
-619178.03 806110.54
-619130.65 806071.98
-618950.04 805984.71
-618902.24 805970.43
-618871.06 805954.36
-618723.27 805939.53
-618679.46 805911.37
-618653.91 805877.31
-618629.88 805799.94
-618615.32 805765.32
-618595.54 805693.63
-618584.55 805628.59
-618595.26 805528.36
-618613.94 805412.99
-618624.37 805365.21
-618632.89 805308.62
-618637.69 805269.23
-618648.41 805232.97
-618765.56 805091.93
-618794.95 805028.2
-618802.62 804957.7
-618833.3 804880.77
-618873.53 804801.32
-618924.31 804698.24
-618961.76 804656.25
-619011.05 804617.53
-619073.9 804587.86
-619113.63 804554.17
-619206.66 804524
-619247.14 804497.6
-619296.42 804446.81
-619330.62 804393.5
-619389.71 804331.84
-619476.7 804272
-619517.43 804247.86
-619587.84 804190.03
-619655.56 804125.41
-619709.36 804035.4
-619746.01 803942.13
-619787.25 803889.33
-619763.11 803864.19
-619606.73 804010.01
-619570.52 804017.56
-619525.77 804012.53
-619428.22 803941.13
-619359.33 803937.61
-619263.57 804030.48
-619206.21 804099.27
-619148.89 804125.92
-619094.08 804122.4
-619011.11 804053.01
-618941.96 803997.37
-618879.1 803946.58
-618841.39 803929.98
-618799.65 803928.48
-618758.92 803941.05
-618745.04 803942.18
-618726.99 803906.12
-618722.46 803869.41
-618711.37 803846.66
-618714.92 803814.1
-618714.92 803786.94
-618694.81 803763.79
-618674.43 803742.99
-618664.36 803712.56
-618641.75 803698.74
-618615.1 803675.61
-618550.23 803630.35
-618523.68 803590.53
-618488.21 803572.83
-618465 803552.61
-618448.9 803520.98
-618436.33 803503.84
-618398.62 803480.2
-618359.39 803464.11
-618321.68 803439.47
-618318.36 803404.63
-618319.42 803382.4
-618301.82 803372.34
-618225.88 803347.7
-618201.24 803321.55
-618187.16 803300.43
-618168.05 803269.25
-618152.21 803255.95
-618107.96 803238.35
-618085.84 803222.76
-618069.24 803208.18
-618054.66 803188.57
-618041.58 803164.43
-618022.98 803133.76
-618009.9 803109.62
-617997.59 803089.82
-617966.91 803083.29
-617933.72 803083.29
-617905.56 803061.16
-617899.53 803034.01
-617897.01 802999.81
-617852.53 802939.23
-617832.24 802915.2
-617799.93 802894.34
-617759.4 802882.97
-617721.26 802865.37
-617685.56 802849.28
-617651.36 802824.64
-617631.25 802803.52
-617622.55 802783.72
-617594.66 802750.2
-617571.66 802735.95
-617508.8 802769.14
-617483.32 802801.5
-617469.08 802839.54
-617458.52 802875.74
-617434.88 802922.01
-617374.04 802946.65
-617356.68 802976.13
-617306.43 803076.8
-617297.62 803117.29
-617300.82 803145.76
-617271.84 803256.49
-617257.33 803294.46
-617191.55 803333.09
-617134 803379.3
-617104.29 803412.85
-617065.32 803418.92
-617001.77 803431.88
-616961.97 803436.03
-616858.27 803404.54
-616815.15 803387.09
-616725.83 803279.97
-616710.9 803268.17
-616637.6 803267.57
-616592.03 803272.03
-616486.34 803291.06
-616427.99 803287.85
-616300.15 803284.59
-616264.9 803277.4
-616249.16 803243.86
-616234.09 803172.67
-616210.65 803147.51
-616146.64 803096.17
-616020.19 803043.97
-615955.84 803065.88
-615882.59 803076.49
-615809.16 803122.87
-615789.99 803135.53
-615770.06 803148.86
-615746.32 803166.81
-615753.26 803191.13
-615770.63 803211.4
-615770.06 803225.3
-615756.16 803252.51
-615780.48 803352.68
-615761.89 803418.86
-615741.69 803475.17
-615713.89 803523.26
-615663.3 803572.63
-615625 803597.82
-615553.31 803636.33
-615485.43 803661.74
-615508.66 803715.85
-615505.68 803790.87
-615487.09 803855.93
-615492.13 803859.89
-615569.71 803921.26
-615478.81 803990.16
-615442.92 804008.1
-615418.87 804023.72
-615382.36 804046.96
-615336.22 804044.3
-615272.82 804048.62
-615304.64 804054.61
-615339.24 804061.9
-615617.23 804128.32
-615686.52 804145.92
-615771.01 804169.15
-616036.05 804243.81
-616080.73 804258.21
-616118.91 804270.33
-616142.69 804277.88
-616172.65 804301.01
-616203.29 804325.68
-616237.02 804357.36
-616262.4 804382.97
-616285.84 804405.04
-616309.5 804426.64
-616354.54 804378.17
-616358.77 804374.27
-616362.67 804369.07
-616367.54 804365.82
-616372.74 804362.24
-616376.64 804357.37
-616376.64 804348.91
-616387.37 804335.59
-616398.75 804327.14
-616418.53 804311.91
-616438.54 804296.34
-616451.6 804281.89
-616479.4 804255.21
-616581.69 804237.97
-616642.83 804211.85
-616679.52 804197.95
-616707.87 804182.38
-616740.67 804164.59
-616770.13 804147.92
-616809.6 804137.35
-616855.2 804142.61
-616935.04 804170.63
-616960.25 804083.78
-616961.65 803998.34
-616974.26 803936.71
-616982.16 803860.6
-617023.28 803817
-617042.89 803769.39
-617080.35 803742.1
-617133.8 803677.01
-617170.55 803663.67
-617332.83 803730.81
-617327.03 803751.12
-617302.36 803809.1
-617324.53 803824.91
-617346.69 803838.82
-617469.94 803955.49
-617508.35 803965.47
-617533.9 804002.58
-617530.45 804020.25
-617541.97 804036
-617576.16 804035.23
-617625.33 803992.59
-617618.42 803976.84
-617659.54 803985.44
-617728.29 804084.79
-617746.92 804117.23
-617748.46 804182.92
-617725.6 804221.96
-617710.23 804269.21
-617711.96 804317.86
-617712.34 804384.7
-617695.63 804433.34
-617666.82 804475.6
-617630.33 804531.39
-617580.12 804601.89
-617547.86 804624.93
-617456.46 804653.35
-617340.87 804735.92
-617251.2 804804.47
-617222.2 804843.12
-617199.93 804930.3
-617178.42 804963.71
-617135.8 804989.06
-617094.71 804937.21
-617076.08 804903.29
-616856.8 804940.92
-616734.3 804947.07
-616754.27 804869.49
-616744.86 804857.34
-616736.8 804830.46
-616668.44 804782.84
-616602.96 804736.54
-616481.61 804761.89
-616488.33 804837.72
-616497.05 804954.49
-616505.35 805029.13
-616534.94 805150.29
-616676.76 805435.97
-616707.4 805505.24
-616733.49 805574.54
-616759.71 805682.88
-616763.33 805745.76
-616765.04 805838.11
-616771.45 805915.29
-616778.46 805961.46
-616792.45 806027.25
-616782.01 806095.91
-616765.96 806108.39
-616702.94 806189.25
-616667.87 806220.17
-616661.92 806239.79
-616637.55 806276.65
-616605.44 806301.62
-616614.95 806345.02
-616627.44 806391.39
-616642.3 806438.36
-616670.95 806457.02
-616696.35 806469.62
-616672.22 806505.18
-616660.79 806557.25
-616660.79 806620.75
-617149.74 806564.87
-616869.07 806949.68
-616330.59 807086.84
-616278.52 806751.56
-616175.73 806731.84
-616132.3 806778.74
-616094.63 806846.28
-616060.89 806887.76
-616017.75 806902.14
-615932.03 806896.61
-615887.78 806915.41
-615859.02 806949.7
-615843.54 807007.22
-615823.08 807051.88
-615803.48 807072.77
-615774.38 807091.76
-615730.99 807096.54
-615684.49 807094.33
-615654.75 807099.4
-615626.28 807117.13
-615594.09 807159.86
-615583.58 807243.94
-615563.66 807287.64
-615534.35 807316.4
-615488.44 807334.65
-615429.8 807373.93
-615410.45 807410.44
-615434.17 807441.74
-615456.99 807475.89
-615527.93 807522.04
-615546.94 807539.11
-615569.77 807580.85
-615579.3 807616.28
-615574.91 807661.19
-615559.76 807697.26
-615529.4 807727
-615392.12 807806.14
-615382.63 807816.9
-615383.34 807890.28
-615382.09 807906.73
-615369.44 807921.29
-615295.43 807964.97
-615269.54 808032.04
-615249.3 808051.66
-615229.68 808056.1
-615206.88 808043.45
-615189.15 808033.34
-615173.32 808032.08
-615154.97 808037.78
-615143.59 808049.18
-615144.24 808065.62
-615151.22 808083.97
-615168.23 808113.18
-615174.05 808123.18
-615197.23 808116.45
-615260.98 808092.56
-615346.91 808053.34
-615497.03 808046.26
-615562.9 808058.84
-615617.39 808086.38
-615707.22 808148.06
-615743.75 808161.83
-615778.48 808160.04
-615793.15 808154.35
-615808.72 808146.57
-615818.45 808139.33
-615840.59 808115.91
-615873.47 808080.47
-615907.61 808041.23
-615951.19 807986.14
-615990.42 807945.57
-616033.66 807926.85
-616074.24 807927.74
-616096.08 807935.76
-616124.61 807958.5
-616141.11 807983.91
-616252.16 808154.71
-616288.09 808191.84
-616340.17 808228.48
-616446.95 808249.63
-616533.89 808265.23
-616589.18 808299.12
-616781.8 808545.18
-616790.27 808556.77
-616825.32 808567.22
-616869.63 808550.9
-616916.28 808548.57
-616951.26 808566.06
-616966.92 808595.97
-616971.09 808678.01
-616997.91 808717.66
-617023.57 808738.65
-617078.37 808744.48
-617165.44 808732.85
-617211.32 808735.15
-617271.96 808740.98
-617362.59 808747.6
-617407.23 808780.63
-617512.18 808812.12
-617698.41 808906.92
-617713.69 808807.92
-617732.4 808680.71
-617734.4 808598.31
-617737.39 808469.44
-617742.59 808410.43
-617739.38 808343.97
-617743.59 808308.33
-617753 808275.46
-617801.82 808178.87
-617863.48 808117.63
-617923.15 808064.91
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 617461.01 805855.05
-Region  1
-  44
-602949.44 795149.64
-602938.39 795123.23
-603032.33 794965.51
-603061.86 794962.86
-603044.28 794825.51
-603025.88 794687.02
-602812.11 794714.52
-602810.63 794741.18
-602798.57 794768.7
-602784.39 794780.55
-602726.4 794788.8
-602678.56 794796
-602604.69 794804.67
-602555.16 794827.75
-602511.94 794845.38
-602466.26 794866.64
-602444.89 794875.74
-602407.41 794883.28
-602362.84 794891.61
-602324.52 794899.11
-602254.36 794914.97
-602194.23 794926.35
-602141.23 794934.51
-602082.91 794920.77
-602070 794915.77
-602052.28 794971.38
-602041.24 795002.8
-602017.46 795081.79
-601996.23 795142.94
-601862.04 795209.19
-601865.86 795232.56
-602528.08 795670.13
-602524.27 795646.08
-602524.87 795610.83
-602468.13 795573.16
-602445.49 795540.57
-602441.25 795507.74
-602437.87 795464.99
-602465.17 795465.41
-602577.14 795473.05
-602686.52 795478.91
-602830.03 795486.53
-602934.19 795204.84
-602949.44 795149.64
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 602522.37 795141.76
-Region  1
-  42
-608237.86 794727.66
-608191.51 794772.12
-608185.16 794778.47
-608176.76 794786.07
-608104.64 794858.21
-608082.7 794893.03
-608024.11 794994.96
-607986.27 795061.91
-607940.17 795129.1
-607822.28 795240.98
-608284.4 795354.71
-608462.44 795398.35
-608607.32 795433.32
-608668.17 795446.5
-608522.78 794890.13
-608791.81 794819.05
-608788.3 794805.25
-608775.39 794764.82
-608764.59 794727.57
-608751.26 794731.38
-608685.84 794747.23
-608613.67 794765.22
-608598.27 794707.01
-608588.16 794666.94
-608545.71 794490.52
-608533.59 794454.67
-608526.6 794434.03
-608510.73 794394.98
-608405 794339.42
-608355.83 794298.39
-608314.14 794258.81
-608315.19 794247.59
-608301.44 794264.95
-608289.79 794280.82
-608281.02 794310.73
-608216.91 794563.49
-608182.94 794554.28
-608150.55 794546.98
-608133.66 794623.39
-608110.55 794712.11
-608201.67 794674.96
-608237.86 794727.66
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608340 794929.45
-Region  1
-  49
-612427.06 805845.67
-612618.37 805870.71
-612791.29 805814.58
-612913.32 805766.08
-612949.56 805759.16
-612948.76 805726.41
-612998.31 805642.75
-613047.34 805609.71
-613152.85 805537.23
-613198.42 805505.1
-613229.86 805481.51
-613261.83 805445.81
-613316.72 805337.1
-613315.92 805319.24
-613306.86 805293.13
-613288.2 805254.27
-613266.36 805192.42
-613234.2 805154.47
-612858.17 805381.63
-612769.71 805430.12
-612678.58 805450.77
-612553.35 805441.71
-612467.29 805432.37
-612401.81 805428.38
-612344.19 805422.78
-612289.76 805420.21
-612261.59 805416.38
-612232.82 805388.14
-612175.26 805329.52
-612124.38 805275.99
-612066.31 805222.87
-612031.68 805199.96
-611959.74 805209.02
-611914.97 805215.41
-611868.61 805222.34
-611790.26 805226.43
-611795.59 805272.26
-611790.81 805331.59
-611773.76 805383.81
-611755.37 805445.89
-611763.89 805487.46
-611777.75 805503.44
-611795.33 805517.3
-611979.71 805614.81
-612099.59 805690.31
-612216.57 805760.94
-612339.13 805831.28
-612371.64 805841.94
-612427.06 805845.67
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612519.9 805526.83
-Region  1
-  53
-609277.95 795863.12
-609536.93 795558.01
-609674.64 795520.9
-609674.68 795520.89
-609678.24 795519.93
-609680.35 795519.36
-609626.83 795404.31
-609597.99 795334.69
-609556.95 795148.23
-609524.82 794982.43
-609508.88 794880.14
-609518.49 794767.79
-609522.25 794711.51
-609513.8 794681.03
-609476.75 794631.31
-609436.42 794610.21
-609306.04 794580.66
-609262.89 794559.56
-609218.88 794508.23
-609215.42 794353.29
-609197.32 794308.21
-609111.21 794246.99
-609086.75 794257.47
-609045.16 794271.76
-609033.89 794309.36
-609017.69 794364.3
-609002.45 794415.1
-608993.11 794438.91
-608986.44 794461.48
-608981.68 794471.64
-608978.51 794481.48
-609053.75 794586.55
-609068.99 794586.55
-609095.66 794643.06
-609021.79 794666.58
-608964.42 794679.72
-608914.47 794695.39
-608883.14 794709.55
-608844.61 794746.17
-608810.95 794807.15
-608791.81 794819.05
-608522.78 794890.13
-608668.17 795446.5
-608755.03 795763.22
-608726.4 795929.63
-608820.53 795950.01
-608933.57 795976.21
-609033.04 795998.26
-609184.42 796030.28
-609187.49 796032.42
-609213.55 795938.99
-609277.84 795863.25
-609277.95 795863.12
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609099.76 795223.21
-Region  1
-  52
-607615.44 793398.53
-606929.51 793063.99
-606817.44 793218.98
-606793.94 793257.4
-606768.52 793293.34
-606721.71 793362.33
-606653.77 793460.57
-606631.55 793496.45
-606611.55 793555.16
-606601.39 793614.35
-606575.41 793633.79
-606593.03 793645.48
-606619.82 793662.06
-606631.3 793677.37
-606646.61 793659.51
-606667.02 793644.21
-606681.05 793636.55
-606710.39 793632.72
-606723.15 793631.45
-606737.18 793636.55
-606797.13 793655.69
-606854.54 793674.82
-606915.77 793699.06
-606937.45 793701.61
-606971.9 793704.16
-607003.79 793709.26
-607012.72 793687.58
-607022.92 793656.96
-607154.31 793700.33
-607192.58 793707.99
-607215.54 793710.54
-607235.95 793710.54
-607253.81 793718.19
-607286.97 793752.63
-607299.73 793767.94
-607315.04 793789.63
-607322.69 793802.38
-607336.72 793826.62
-607349.48 793838.1
-607382.65 793878.92
-607397.88 793899.09
-607422.32 793846.7
-607439.79 793771.09
-607445.31 793732.71
-607461.74 793653.59
-607474.37 793592.2
-607514.73 793552.64
-607564.26 793532
-607594.11 793494.54
-607599.64 793450.43
-607612.4 793408.53
-607615.44 793398.53
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607105.04 793460.81
-Region  1
-  63
-611467.61 805203.94
-611370.62 805153.32
-611322.13 805132.53
-611282.16 805124.54
-611233.67 805121.87
-611196.9 805131.47
-611171.05 805147.19
-611139.29 805156.35
-611094.85 805159.98
-611059.68 805169.57
-611079.39 805227.12
-611102.84 805260.16
-611093.25 805271.89
-611084.41 805306.32
-611035.43 805307.83
-611002.39 805320.62
-610844.1 805408.01
-610808.93 805395.76
-610776.43 805411.21
-610791.08 805443.45
-610811.86 805498.33
-610845.97 805562.81
-610858.76 805592.66
-610875.81 805615.57
-610891.52 805665.95
-610894.72 805714.98
-610883.8 805763.74
-610871.55 805795.71
-610859.29 805835.68
-610848.63 805881.18
-610865.94 805981.61
-610942.29 806050.4
-610968.24 806104.15
-610997.49 806157.92
-611014 806193.97
-611026.72 806243.95
-611033.2 806369.47
-611049.72 806323.12
-611073.69 806276.23
-611301.18 806074.85
-611426.38 806177.68
-611521.21 806130.79
-611601.13 806134.52
-611609.94 805752.26
-611620.84 805709.91
-611642.68 805683.8
-611692.23 805663.56
-611751.37 805653.97
-611755.1 805617.74
-611782.54 805555.66
-611785.21 805528.49
-611795.33 805517.3
-611777.75 805503.44
-611763.89 805487.46
-611755.37 805445.89
-611773.76 805383.81
-611790.81 805331.59
-611795.59 805272.26
-611790.26 805226.43
-611711.41 805235.13
-611593.64 805245.26
-611554.21 805242.06
-611467.61 805203.94
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611285.96 805657.67
-Region  1
-  49
-613142.25 798426.02
-613462.12 798372.11
-613608.36 798348.96
-613615.26 798399.54
-613574.77 798488.13
-613537.5 798551.37
-613601.31 798586.38
-613653.54 798624.51
-613631.52 798662.34
-613826.03 798570
-614011.2 798754.79
-614021.2 798750.99
-614144.87 798735.7
-614107.38 798689.27
-614061.11 798582.15
-614051.54 798516.36
-614052.7 798437.27
-614077.67 798358.91
-614119.96 798258.97
-614198.47 798095.49
-614114.17 798055.93
-614079.57 798058.59
-614040.84 798071.6
-613943.2 798111.37
-613955.27 798078.35
-613965.07 798058.35
-613970.78 798043.74
-613978.76 798027.55
-613990.83 797999.61
-614006.43 797953.69
-614009.25 797946.35
-613878.54 797893.57
-613901.69 797827.51
-613257.15 797568.02
-612593.97 797653.43
-612597.16 797680.33
-612602.18 797715.89
-612604.46 797734.13
-612612.67 797802.98
-612624.06 797898.27
-612676.04 797895.54
-612706.13 797894.17
-612735.31 797892.8
-612738.27 797907.55
-612740.55 797921.68
-612744.19 797961.35
-612892.83 797970.47
-613067.15 797981.57
-613142.25 798426.02
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613469.32 798066.56
-Region  1
-  63
-605181.54 798006.53
-605132.6 798009.96
-605050.31 798019.55
-604998.38 798027.94
-604964.82 798046.72
-604926.88 798081.07
-604896.92 798117.82
-604880.74 798153.15
-604880.74 798204.29
-604886.62 798268.6
-604887.49 798295.93
-604856.47 798391.64
-604850.39 798403.79
-604766 798603.63
-604727.61 798671.97
-604738.02 798677.17
-604759.71 798686.28
-604790.95 798700.6
-604790.52 798723.16
-604798.76 798742.26
-604819.15 798764.38
-604838.89 798787.57
-604863.62 798816.21
-604806.35 798871.75
-604824.36 799054.63
-604885.1 798999.52
-604941.94 798948.76
-604958.86 798922.29
-604975.56 798860.47
-605032.62 798627.28
-605041.94 798594.52
-605126.77 798616.39
-605164.08 798614.66
-605187.51 798598.16
-605218.1 798564.94
-605294.46 798482.5
-605290.99 798468.62
-605281.44 798458.64
-605264.95 798458.21
-605239.35 798476.86
-605225.04 798486.84
-605206.38 798506.37
-605186.03 798522.69
-605163.43 798531.1
-605133.48 798531.13
-605108.97 798516.13
-605092.92 798495.34
-605085.98 798465.4
-605085.98 798438.5
-605095.96 798401.62
-605124.46 798359.68
-605267.59 798256.08
-605291.92 798120.48
-605292.56 798114.77
-605293.19 798105.56
-605292.59 798094.41
-605296.58 798050.87
-605311.76 797995.34
-605314.96 797978.97
-605322.95 797957.39
-605282.6 797982.96
-605249.84 797999.34
-605181.54 798006.53
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605009.02 798427.64
-Region  1
-  56
-601351.95 785668.74
-601344.01 785716.82
-601336.43 785756.16
-601320.37 785773.29
-601249.62 785789.54
-601222.18 785816.61
-601198 785833.22
-601157.57 785849.1
-601108.12 785863.9
-601031.96 785888.44
-601001.28 785893.51
-600856.17 785911.56
-600820.8 785916.62
-600795.17 785920.59
-600799.14 785964.99
-600803.65 786003.78
-600817.36 786109.54
-600811.04 786145.13
-600795.88 786242.95
-600755.09 786298.08
-600805.86 786309.29
-601321.44 786462.75
-601892.48 786612.91
-601941.48 786684.13
-602018.32 786627.61
-602222.18 786485.36
-602376.18 786371.37
-602485.06 786287.22
-602044.35 785736.06
-602122.32 785675.62
-602162.82 785646.51
-602236.11 785590.66
-602046.23 785327.48
-602079.74 785230.64
-602071.5 785207.85
-602048.78 785191.22
-602009.41 785178.52
-602007.51 785189.95
-601984.65 785255.35
-601852.35 785060.46
-601833.72 785041.83
-601795.44 785063.69
-601758.11 785120.02
-601722.05 785165.59
-601680.3 785219.38
-601648.03 785265.59
-601613.87 785307.36
-601584.13 785343.43
-601566.42 785385.84
-601530.36 785428.87
-601481.01 785466.85
-601448.7 785481.08
-601405.38 785528.01
-601377.24 785558.62
-601369.02 785610.51
-601351.95 785668.74
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 601674.2 785985.02
-Region  1
-  66
-616304.96 808541.6
-616347.96 808506.78
-616396.67 808478.92
-616411.24 808490.3
-616427.72 808506.74
-616458.13 808530.13
-616501.83 808547.19
-616553.09 808537.04
-616599.94 808546.51
-616647.46 808583.81
-616693.72 808619.21
-616719.05 808626.79
-616744.33 808600.21
-616776.57 808562.23
-616790.27 808556.77
-616781.8 808545.18
-616589.18 808299.12
-616533.89 808265.23
-616446.95 808249.63
-616340.17 808228.48
-616288.09 808191.84
-616252.16 808154.71
-616141.11 807983.91
-616124.61 807958.5
-616096.08 807935.76
-616074.24 807927.74
-616033.66 807926.85
-615990.42 807945.57
-615951.19 807986.14
-615907.61 808041.23
-615873.47 808080.47
-615840.59 808115.91
-615818.45 808139.33
-615808.72 808146.57
-615793.15 808154.35
-615788.96 808207.05
-615778.18 808317.84
-615793.15 808353.77
-615777.88 808430.18
-615770.69 808503.24
-615756.32 808518.81
-615753.92 808551.15
-615734.76 808573.9
-615715.6 808640.97
-615721.58 808668.52
-615692.84 808742.77
-615665.29 808791.88
-615696.43 808843.38
-615738.79 808878.25
-615796.4 808885.18
-615846.39 808871.24
-615918.57 808881.96
-615954.14 808876.51
-615965.7 808874.74
-615965.46 808870.12
-615962.86 808815.71
-616000.78 808764.45
-616049.48 808734.69
-616081.74 808716.33
-616103.87 808696.07
-616160.21 808704.26
-616203.89 808703.61
-616229.18 808685.25
-616234.19 808641.59
-616267.66 808579.58
-616304.96 808541.6
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 616112.36 808421.49
-Region  1
-  87
-613473.66 799558.01
-613378.74 799580.83
-613260.55 799591.68
-613166.73 799611.94
-613087.01 799638.56
-613025.62 799653.14
-612953.4 799670.16
-612896.38 799696.7
-612909.36 799744.13
-612951.82 799856.26
-612962.72 799887.8
-612964.98 799914.84
-612990.78 799955.5
-613026.35 800110.68
-613034.17 800157.98
-613056.15 800226.25
-613096.71 800304.11
-613126.67 800367.19
-613135.32 800379.46
-613146.55 800399.48
-613155.34 800419.2
-613227.43 800560.9
-613261.69 800625.42
-613286.46 800688.67
-613311.71 800756.51
-613340.78 800837.96
-613358.13 800861.04
-613391.76 800902.3
-613469.5 800980.53
-613550.47 801066.75
-613621.75 801168.42
-613691.25 801275.75
-613785.3 801242.86
-613758.68 801198.23
-613796.47 801130.77
-613841.45 800793.49
-613868.72 800600.68
-613870.89 800559.3
-613864.19 800519.59
-613836.44 800431.56
-613827.12 800397.35
-613811.81 800346.16
-613798.89 800295.45
-613799.59 800255.98
-613820.64 800160.29
-613848.15 800042.84
-613865.38 799967.72
-613888.11 799874.19
-613916.58 799754.35
-613984.04 799830.9
-614077.81 799904.57
-614078.76 799889.74
-614087.85 799862.95
-614106.99 799812.24
-614121.82 799777.79
-614170.8 799726.57
-614238.04 799684.82
-614285.36 799654.67
-614337.09 799628.92
-614414.57 799578.24
-614443.68 799544.1
-614467.14 799509.76
-614488.08 799451.12
-614486.88 799395.53
-614483 799333.53
-614463.31 799279.77
-614434.76 799229.17
-614425.83 799219.17
-614011.2 798754.79
-613826.03 798570
-613631.52 798662.34
-613614.01 798705.82
-613600.18 798750.15
-613552.75 798943.82
-613556.14 798998.57
-613567.43 799029.63
-613586.63 799189.96
-613600.75 799275.79
-613602.49 799320.7
-613612.32 799368.68
-613641.68 799421.19
-613687.42 799460.72
-613620.79 799459.02
-613597.64 799469.19
-613595.95 799485.56
-613572.8 799540.33
-613473.66 799558.01
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613685.86 799828.12
-Region  1
-  47
-605030.98 797784.12
-604994.59 797805.32
-604885.62 797804.87
-604815.28 797840.81
-604674.61 797900.21
-604584.67 797936.37
-604538.42 797954.01
-604522.74 797961.06
-604510.98 797969.69
-604487.06 797989.29
-604496.08 798035.94
-604515.1 798078.5
-604520.19 798137.69
-604510.97 798178.66
-604485.49 798254.69
-604451.6 798387.39
-604464.14 798388.96
-604519.4 798441.87
-604542.41 798446.59
-604594.35 798440
-604850.39 798403.79
-604856.47 798391.64
-604887.49 798295.93
-604886.62 798268.6
-604880.74 798204.29
-604880.74 798153.15
-604896.92 798117.82
-604926.88 798081.07
-604964.82 798046.72
-604998.38 798027.94
-605050.31 798019.55
-605132.6 798009.96
-605181.54 798006.53
-605249.84 797999.34
-605282.6 797982.96
-605322.95 797957.39
-605344.12 797902.66
-605362.33 797840.8
-605365.46 797816.69
-605367.04 797793.25
-605304.52 797785.21
-605244.23 797764.22
-605201.36 797748.14
-605164.74 797734.3
-605132.58 797729.83
-605098.2 797737.87
-605030.98 797784.12
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604840.19 798065.49
-Region  1
-  46
-611382.37 801255.86
-611421.18 801312.79
-611464.36 801418.43
-611501.85 801531.02
-611562.86 801639.93
-611574.49 801666.71
-611610.72 801731.01
-611662.8 801774.48
-612248.3 802014.91
-612204.83 801861.41
-612184.23 801789.66
-612147.1 801666.5
-612084.13 801469.99
-612054.86 801353.59
-612047.14 801258.06
-612055.9 801176.45
-612067.23 801123.3
-612079.38 801095.61
-612097.49 801026.49
-612120.82 800933.84
-612124.73 800880.67
-612071.95 800781.4
-612040.28 800722.76
-611982.41 800618.48
-611757.07 800542.37
-611423.05 800439.43
-611430.8 800490.66
-611433.81 800530.69
-611417.22 800544.26
-611396.13 800583
-611397.21 800660.27
-611398.93 800713.65
-611391.18 800734.75
-611369.04 800759.07
-611339.34 800784.03
-611325.13 800805.56
-611314.37 800853.33
-611296.07 800888.04
-611283.59 800916.45
-611278.43 800968.09
-611278 801026.63
-611281.66 801060.46
-611335.02 801167.2
-611349.23 801193.89
-611361.28 801214.97
-611382.37 801255.86
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611753.44 801179.48
-Region  1
-  17
-608251.51 805983.13
-608711.29 806982.56
-608719.03 807007.96
-608872.05 807211.06
-608926 807117.86
-609661.27 806143.08
-609893.46 805919.58
-609885.73 805906.92
-609699.75 805604.81
-609624.86 805507.22
-609587.99 805477.17
-609514.69 805440.75
-609413.62 805427.59
-609210.34 805476.11
-608976.78 805539.87
-608149.75 805763.47
-608251.51 805983.13
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609010.6 806140.12
-Region  1
-  129
-611859.28 810753.6
-611917.01 810663.94
-611944.71 810637.08
-611978.61 810619.31
-612008.4 810593.67
-612044.93 810583.18
-612184.98 810498.82
-612310.95 810499.45
-612342.84 810492.69
-612404.66 810467.58
-612474.25 810447.95
-612567.68 810442.7
-612625.83 810445.43
-612660.78 810436.3
-612692.8 810416.85
-612735.1 810368.41
-612746.02 810347
-612767.71 810301.09
-612794.79 810282.62
-612937.66 810195.2
-612962.95 810172.2
-612995.38 810101.13
-612976.48 810081.18
-612948.45 810066.93
-612904.15 810075.17
-612886.22 810088.53
-612860.4 810072.23
-612762.4 810111.39
-612627.77 810125.54
-612578.66 810096.54
-612522.43 810048.78
-612497.07 810016.52
-612453.27 809881.8
-612435.43 809767.31
-612444.18 809653.43
-612449.79 809562.34
-612463.06 809539.56
-612478.22 809511.08
-612477.55 809476.29
-612463.6 809454.15
-612435.73 809432.03
-612328.71 809380.03
-611976 809323.82
-611923.41 809333.79
-611872.63 809335.61
-611801.44 809339.57
-611765.18 809339.57
-611682.67 809413.92
-611678.13 809440.22
-611740.24 809570.32
-611740.24 809623.81
-611869 809841.47
-611833.64 809841.47
-611800.09 809851.45
-611718.48 809874.11
-611676.58 809882.79
-611619.2 809909.01
-611588.37 809973.39
-611350.81 809657.86
-611277.05 809775.43
-611272.01 809793.78
-611266.37 809850.08
-611270.84 809891.83
-611274.07 809958.25
-611264.62 810004.44
-611248.82 810032.91
-611234.28 810045.57
-611214.66 810050.01
-611184.9 810041.16
-611144.99 810017.79
-611046.61 809665.54
-610907.88 809703.62
-610834.44 809710.88
-610774.6 809744.42
-610704.78 809759.84
-610692.09 809747.15
-610606.68 809749.8
-610585.81 809759.93
-610582.02 809775.11
-610599.15 809852.77
-610535.68 809889.04
-610501.22 809852.77
-610464.05 809815.6
-610396.05 809738.53
-610386.07 809732.18
-610366.13 809741.25
-610345.27 809754.85
-610318.98 809772.98
-610293.59 809788.39
-610270.92 809803.81
-610249.74 809818.92
-610219.24 809843.7
-610197.48 809843.7
-610212.89 809873.63
-610227.4 809918.05
-610243.49 809985.96
-610279.62 810047.06
-610337 810083.19
-610423.6 810115.6
-610581.93 810179.36
-610620.72 810196.89
-610656.31 810223.99
-610691.38 810267.56
-610711.3 810325.2
-610719.27 810408.62
-610728.54 810523.11
-610740.23 810552.34
-610755.1 810577.84
-610780.08 810565.62
-610832.16 810552.18
-610891.55 810545.52
-610963.15 810463.93
-611013.65 810432.29
-611054.72 810430.63
-611136.87 810462.27
-611259.79 810447.55
-611284.21 810476.97
-611305.31 810589.65
-611326.69 810653.75
-611357.69 810697.7
-611398.03 810771.15
-611431.2 810830.35
-611466.68 810849.87
-611532.81 810857.22
-611609.74 810876.65
-611724.01 810881.79
-611765.67 810870.77
-611811.13 810836.19
-611859.28 810753.6
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611646.54 810102.21
-Region  1
-  41
-609943.25 803673.69
-609548.33 803856.88
-609533.88 803840.02
-609252.61 803957.86
-609216.03 803973.06
-609403.85 804163.77
-609369.9 804525.15
-609403.61 804541.53
-609447.44 804550.68
-609492.71 804562.24
-609517.44 804557.42
-609580.84 804530.93
-609746.74 804469.23
-609751.81 804489.54
-609758.68 804514.33
-609814.23 804475.8
-609932.05 804393.5
-610072.57 804312.08
-610164.71 804261.46
-610252.51 804326.86
-610408.57 804245.18
-610486.07 804216.22
-610482.78 804203.67
-610418.12 804001.48
-610375.27 803952.2
-610335.68 803882.58
-610283.43 803775.81
-610276.12 803759.26
-610267.16 803734.47
-610254.91 803702.81
-610241.77 803708.19
-610227.43 803721.33
-610141.12 803796.89
-610103.79 803830.94
-610079.75 803867.79
-610046.6 803932
-609992.1 803976.67
-609975.08 803926.49
-609952.08 803845.25
-609948.65 803765.66
-609943.25 803673.69
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609839.53 804116.56
-Region  1
-  114
-607728.59 794654.98
-607785.52 794577.76
-607835.96 794476.42
-607874.04 794354.52
-607884.19 794278.61
-607885.24 794162.23
-607887.99 794066.15
-607893.53 793914.91
-607912.68 793861.22
-607962.63 793777.83
-608019.04 793689.28
-608047.94 793625.04
-608065.3 793563.45
-608084.45 793486.87
-608455.72 793562.76
-608477.4 793628.64
-608518.89 793702.24
-608631.08 793753.03
-608647.38 793755.57
-608667.45 793699.13
-608709.25 793610.73
-608756.68 793491.74
-608785.21 793452.22
-608759.81 793442.06
-608811.88 793330.93
-608855.95 793245.52
-608896.18 793162.05
-608910.78 793131.25
-608821.25 793093.46
-608670.76 793100.13
-608623.13 793088.7
-608524.39 793134.1
-608485.65 793140.1
-608445.01 793137.56
-608439.61 793165.82
-608369.76 793151.24
-608300.54 793132.82
-608311.02 793091.87
-608318 793045.83
-608296.1 793064.88
-608267.89 793092.28
-608222.76 793122.67
-608179.57 793161.73
-608147.19 793264.92
-608124.01 793253.49
-607775.34 793113.07
-607764.6 793138.84
-607759.84 793171.54
-607774.12 793249.68
-607772.54 793270.95
-607751.58 793296.39
-607648.08 793343.06
-607624.58 793361.16
-607615.44 793398.53
-607612.4 793408.53
-607599.64 793450.43
-607594.11 793494.54
-607564.26 793532
-607514.73 793552.64
-607474.37 793592.2
-607461.74 793653.59
-607445.31 793732.71
-607439.79 793771.09
-607422.32 793846.7
-607397.88 793899.09
-607386.13 793919.41
-607392.16 794002.59
-607388.03 794086.78
-607377.55 794119.15
-607308.97 794247.1
-607286.2 794281.17
-607260.9 794295.59
-607126.71 794280.53
-607099.65 794284.18
-607063.78 794307.24
-607043.6 794337.98
-606944.16 794336.87
-606907.81 794498.09
-606902.04 794522.11
-606860.21 794697.26
-606814.45 794898.9
-606801.13 794929.06
-606787.06 794969.8
-606754.57 795107.08
-606787.55 795092.52
-606837.03 795075.06
-606836.31 795092.86
-606824.17 795164.56
-606755.78 795371.68
-606732.79 795447.56
-606731.33 795474.24
-606742.97 795496.55
-606766.74 795515.46
-606784.68 795439.8
-606868.11 795487.33
-607000.52 795562.99
-606991.78 795444.17
-607031.07 795298.67
-607052.64 795211.12
-607075.44 795128.66
-607088.29 795083.31
-607160.56 795122.11
-607235.02 795165.02
-607289.83 795197.04
-607415.47 795179.57
-607431.71 795179.33
-607568.05 795163.32
-607560.77 795126.93
-607554.95 795092.97
-607553.49 795019.71
-607559.76 794949.96
-607593.41 794859.99
-607666 794746.76
-607728.59 794654.98
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607648.26 794166.49
-Region  1
-  151
-606289.79 805808.47
-606368.3 805698.97
-606437.85 805597.74
-606481.46 805646.65
-606536.55 805597
-606610.42 805538.27
-606634.85 805506.57
-606646.65 805491.73
-606642.38 805471.73
-606778.74 805421.46
-606891.06 805484.34
-606949.33 805510.88
-607029.12 805532.35
-607086.73 805538.65
-607113.42 805537.84
-607128.57 805495.84
-607140.62 805450.05
-607142.68 805419.75
-607170.12 805412.71
-607241.85 805386.01
-607289.37 805362.59
-607341.7 805340.55
-607396.11 805336.42
-607451.54 805356.79
-607517.66 805386.4
-607569.58 805414.02
-607562.98 805505.28
-607561.16 805555.35
-607569.81 805567.18
-607697.7 805814.24
-607714.08 805847.92
-607716.82 805877.05
-607713.86 805935.04
-607709.76 806001.94
-607709.76 806083.87
-607870.21 806158.15
-608231.02 805991.32
-608251.51 805983.13
-608149.75 805763.47
-608976.78 805539.87
-608928.52 805350.47
-608731.38 805401
-608497.82 805472.52
-608371.25 805508.95
-608353.95 805502.12
-608343.49 805483.03
-608317.08 805450.25
-608295.23 805410.19
-608290.22 805339.63
-608285.89 805281.13
-608281.79 805231.96
-608276.11 805146.6
-608268.14 805060.33
-608267.23 805019.36
-608280.43 804976.11
-608247.88 805013.65
-608239.68 805034.14
-608229.67 805094.24
-608219.42 805182.34
-608209.86 805257.46
-608202.36 805331.43
-608182.78 805417.47
-608158.2 805459.36
-608116.97 805493.28
-608026.37 805536.98
-607984.94 805547
-607928.04 805532.43
-607892.53 805504.2
-607867.03 805461.41
-607868.87 805416.01
-607876.44 805377.45
-607897.79 805296.19
-607891.59 805262.44
-607875.06 805232.14
-607817.22 805180.49
-607749.04 805120.58
-607721.5 805084.82
-607691.2 805025.59
-607682.24 804976.7
-607668.47 804774.93
-607647.81 804738.05
-607625.43 804716.7
-607591 804681.58
-607577.91 804665.74
-607566.9 804656.79
-607555.88 804647.84
-607545.55 804642.33
-607535.22 804640.95
-607524.89 804647.84
-607517.66 804659.92
-607531.43 804681.96
-607557.6 804718.46
-607519.03 804755.64
-607486.32 804788.37
-607457.4 804820.05
-607434.67 804842.78
-607421.59 804866.19
-607418.84 804893.05
-607426.41 804924.73
-607469.8 804993.59
-607473.93 805025.96
-607460.84 805061.77
-607435.36 805085.87
-607396.11 805092.76
-607350.66 805077.61
-607326.56 805036.98
-607300.39 804982.57
-607272.15 804960.54
-607244.61 804955.03
-607137.18 804988.77
-607072.1 805007.7
-607033.54 805001.5
-606971.44 804974.38
-606809.04 804894.76
-606775.64 804866.2
-606747.41 804808.35
-606672.34 804763.59
-606623.03 804760.72
-606575.93 804778.05
-606507.07 804825.57
-606440.96 804888.23
-606371.06 804935.39
-606323.55 804993.92
-606270.52 805070.36
-606125.56 805189.84
-606089.75 805235.98
-606027.08 805329.63
-606000.91 805357.18
-605898.3 805428.8
-605833.32 805472.86
-605792.21 805497.56
-605737.82 805534.28
-605635.06 805583.34
-605560.45 805622.35
-605512.96 805672.37
-605479.89 805713.07
-605468.87 805752.08
-605469.72 805834.33
-605466.74 805940.74
-605450.63 805985.68
-605428.29 806039.93
-605403.55 806094.64
-605394.95 806113.23
-605745.81 806310.32
-606077.61 806011.73
-606095.25 805982.38
-606111.09 805955.52
-606115.91 805908.01
-606150.87 805922.12
-606185.81 805936.56
-606289.79 805808.47
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606966 805487.41
-Region  1
-  116
-607523.78 810777
-607414.21 810884.01
-607381.84 810932.34
-607381.84 810932.34
-607437.89 811012.46
-607439.39 811053.31
-607407.19 811132.18
-607390.38 811163.94
-607367.96 811196.32
-607357.37 811213.76
-607346.16 811233.69
-607338.07 811246.77
-607328.72 811261.09
-607321.25 811271.05
-607312.53 811283.51
-607302.57 811299.7
-607288.25 811319.63
-607273.3 811340.8
-607249.01 811375.05
-607229.71 811401.21
-607215.67 811424.52
-607193.45 811409.91
-607188.37 811422.61
-607176.61 811444.17
-607159.79 811465.76
-607138.83 811482.27
-607102.95 811521.64
-607078.51 811553.68
-606996.59 811684.79
-607006.27 811784.04
-607040.88 811912
-607050.09 811997.38
-607028.5 812025.95
-607045.64 812081.2
-607020.88 812078.96
-607042.55 812133.85
-607053.14 812169.35
-607056.88 812215.43
-607051.9 812249.06
-607044.38 812285.98
-607161.12 812332.75
-607236.48 812357.38
-607284.59 812356.09
-607333.95 812345.31
-607381.41 812335.17
-607412.38 812299.09
-607415.49 812258.6
-607442.67 812223.15
-607484.4 812188.34
-607542.6 812157.94
-607587.51 812138.3
-607615.32 812102.86
-607648.81 812052.23
-607696.2 811987.04
-607746.15 811946.53
-607804.99 811918.66
-607856.23 811893.96
-607899.84 811845.22
-607918.15 811802.82
-607947.18 811736.38
-607985.09 811677.52
-608073.2 811664.82
-608095.54 811630.57
-608127.57 811579.18
-608161.82 811523.32
-608185.66 811483.85
-608213.92 811431.45
-608251.29 811369.79
-608297.37 811295.43
-608353.97 811292.45
-608420.25 811295.43
-608489.51 811294.69
-608532.71 811296.18
-608561.01 811305.86
-608574.03 811298.03
-608586.69 811274.95
-608595.63 811251.12
-608615.74 811224.3
-608643.29 811193.77
-608672.34 811152.06
-608693.19 811105.14
-608718.15 811049.65
-608736.77 811001.25
-608739.01 810958.79
-608737.52 810926.77
-608727.83 810885.81
-608715.47 810854.96
-608694.71 810807.89
-608676.71 810757.36
-608687.15 810738.17
-608704.22 810717.29
-608666.32 810700.6
-608631.71 810681.22
-608599.87 810659.76
-608578.41 810641.76
-608561.8 810603
-608464.89 810522.7
-608451.48 810539.01
-608385.28 810645.22
-608365.2 810592.61
-608321.59 810563.54
-608289.75 810579.46
-608246.14 810536.54
-608132.62 810627.92
-608119.12 810619.27
-607969.6 810654.57
-607991.75 810779.17
-607810.35 810641.79
-607774.28 810613.11
-607760.63 810583.27
-607734.3 810543.77
-607727.96 810538.71
-607670.77 810519.45
-607620.94 810659.42
-607577.09 810726.68
-607523.78 810777
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607796.34 811343.79
-Region  1
-  55
-612099.83 807227.44
-612053.47 807348.95
-612068.39 807359.6
-612016.43 807447.81
-611984.19 807455.57
-611912.25 807564.81
-611877.34 807713.25
-611875.76 807917.66
-611874.85 807945.77
-611931.85 807928.73
-611964.38 807909.59
-612010.85 807899.41
-612055.07 807877.05
-612083.89 807853.2
-612197.18 807901.4
-612366.25 807653.17
-612379.58 807626.11
-612391.51 807606.73
-612413.87 807599.28
-612447.16 807591.83
-612480.45 807590.34
-612514.24 807587.85
-612585.29 807574.93
-612630.51 807557.05
-612672.47 807514.59
-612684.39 807509.62
-612695.82 807505.15
-612709.73 807433.6
-612733.09 807359.06
-612761.91 807298.94
-612792.96 807237.58
-612811.42 807189.9
-612830.36 807137.39
-612844.24 807100.06
-612869.52 807059.56
-612880.25 807024.76
-612887.66 806965.53
-612895.95 806936.5
-612914.33 806920.37
-612978.23 806888.07
-613002.27 806869.72
-613052.86 806826.04
-613088.3 806814.64
-613118.04 806803.24
-613135.11 806782.36
-613141.92 806756.07
-613134.45 806731.18
-613113.72 806757.73
-613074.95 806760.88
-612710.99 806771.8
-611998.15 806679.13
-611944.5 806787.59
-611862.96 807131.23
-611980.2 807136.56
-612099.83 807227.44
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612352.16 807209.11
-Region  1
-  149
-606044.05 798724.21
-606093.91 798759.13
-606030.4 798778.19
-605994.5 798803.33
-605939.57 798843.34
-605890.04 798888.77
-605863.06 798920.52
-605827.5 798961.16
-605779.87 799008.19
-605707.8 799077.72
-605669.82 799122.08
-605643.99 799154.54
-605625.37 799167.17
-605589.68 799188.13
-605556.16 799192.25
-605548.85 799290.43
-605522.59 799408.22
-605523.93 799490.34
-605546.59 799585.25
-605561.18 799638.87
-605567.46 799663.1
-605575.99 799685.98
-605580.92 799703.48
-605590.35 799713.8
-605628.49 799718.29
-605655.86 799720.98
-605672.91 799703.48
-605710.61 799649.19
-605720.93 799739.38
-605730.59 799809.15
-605732.84 799834.28
-605735.53 799859.86
-605737.77 799895.31
-605751.68 799898
-605793.86 799905.18
-605822.13 799959.03
-605840.01 799985.8
-605839.38 800006.12
-605828.58 800030.25
-605820.64 800049.94
-605811.75 800073.77
-605798.1 800099.8
-605787.62 800122.03
-605773.01 800151.88
-605762.53 800182.67
-605811.11 800188.07
-605835.56 800178.86
-605886.99 800163.62
-605903.5 800178.23
-605930.81 800206.17
-605944.46 800228.08
-605952.73 800240.53
-605955.27 800260.22
-605952.09 800326.27
-605990.83 800384.7
-606012.11 800396.41
-606038.15 800394.5
-606102.29 800386.25
-606173.41 800352.59
-606233.75 800324.01
-606297.89 800293.53
-606324.25 800272.93
-606339.49 800248.17
-606351.87 800216.68
-606363.93 800177.31
-606391.24 800106.82
-606414.74 800052.84
-606421.09 800024.9
-606426.56 799964.42
-606419.38 799881.4
-606414 799814.09
-606405.03 799768.77
-606387.98 799732.42
-606371.38 799712.23
-606260.76 799626.75
-606254.47 799601.62
-606249.09 799572.45
-606245.05 799554.5
-606261.42 799528.71
-606274.59 799502.86
-606287.32 799481.04
-606304.15 799438.81
-606319.07 799443.57
-606341.3 799446.43
-606360.98 799443.26
-606392.9 799437.17
-606433.73 799426.85
-606485.26 799411.01
-606541 799394.36
-606605.77 799374.64
-606613.07 799389.56
-606627.37 799414.96
-606667.31 799398.81
-606690.19 799397.01
-606707.69 799396.56
-606730.13 799395.22
-606757.95 799397.01
-606800.57 799407.33
-606791.6 799356.18
-606788.91 799321.63
-606783.52 799287.97
-606758.39 799249.83
-606701.41 799177.14
-606648.22 799135.09
-606666.08 799101.09
-606698.46 799036.32
-606722.6 799012.19
-606756.26 798967.1
-606766.1 798933.79
-606764.19 798807.42
-606761.34 798721.97
-606754.99 798574.63
-606750.52 798451.42
-606747.34 798393.64
-606652.73 798348.55
-606599.39 798321.25
-606529.54 798283.15
-606536.54 798268.22
-606543.55 798256.52
-606562.66 798223.29
-606538.89 798070.84
-606514.99 797912.68
-606459.1 797987.33
-606442.28 798020
-606410.22 798081.6
-606401.96 798083.19
-606349.89 798190.51
-606334.97 798193.05
-606275.6 798316.25
-606280.68 798346.42
-606306.08 798354.35
-606292.75 798395
-606287.16 798404.74
-606287.99 798429.01
-606282.27 798433.14
-606272.84 798467.66
-606255.49 798506.71
-606249.63 798531.68
-606253.06 798560.16
-606229.88 798571.59
-606203.21 798572.86
-606199.4 798566.51
-606173.37 798556.66
-606173.05 798582.07
-606140.03 798603.02
-606117.81 798645.57
-606089.1 798675.3
-606072.95 798693.72
-606044.05 798724.21
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606193.9 799263.83
-Region  1
-  82
-617533.9 804002.58
-617508.35 803965.47
-617469.94 803955.49
-617346.69 803838.82
-617324.53 803824.91
-617302.36 803809.1
-617327.03 803751.12
-617332.83 803730.81
-617170.55 803663.67
-617134.56 803674.7
-617080.35 803742.1
-617042.89 803769.39
-617023.28 803817
-616982.16 803860.6
-616974.26 803936.71
-616961.65 803998.34
-616960.25 804083.78
-616935.04 804170.63
-616855.2 804142.61
-616809.6 804137.35
-616770.13 804147.92
-616740.67 804164.59
-616707.87 804182.38
-616679.52 804197.95
-616642.83 804211.85
-616581.69 804237.97
-616479.4 804255.21
-616451.6 804281.89
-616438.54 804296.34
-616418.53 804311.91
-616398.75 804327.14
-616387.37 804335.59
-616376.64 804348.91
-616376.64 804357.37
-616372.74 804362.24
-616367.54 804365.82
-616362.67 804369.07
-616358.77 804374.27
-616354.54 804378.17
-616309.5 804426.64
-616394 804508.86
-616431.84 804562.03
-616450.5 804602.51
-616461.26 804628.24
-616469.32 804658.58
-616477.58 804732.12
-616481.61 804761.89
-616602.96 804736.54
-616668.44 804782.84
-616736.8 804830.46
-616744.29 804856.82
-616754.27 804869.49
-616734.3 804947.07
-616856.8 804940.92
-617076.08 804903.29
-617094.71 804937.21
-617135.8 804989.06
-617178.42 804963.71
-617199.93 804930.3
-617222.2 804843.12
-617251.2 804804.47
-617340.87 804735.92
-617456.46 804653.35
-617547.86 804624.93
-617580.12 804601.89
-617630.33 804531.39
-617666.82 804475.6
-617695.63 804433.34
-617712.34 804384.7
-617711.96 804317.86
-617710.23 804269.21
-617725.6 804221.96
-617748.46 804182.92
-617746.92 804117.23
-617728.29 804084.79
-617659.54 803985.44
-617618.42 803976.84
-617625.33 803992.59
-617576.16 804035.23
-617541.97 804036
-617530.45 804020.25
-617533.9 804002.58
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 617086.51 804375.3
-Region  1
-  62
-604479.93 794831.8
-604095.32 794222.95
-604064.84 794181
-604041.98 794209.61
-604054.68 794292.16
-604054.24 794368.98
-604032.84 794445.11
-603990.93 794541.63
-603964.89 794609.58
-603952.19 794711.18
-604016.96 794796.91
-604089.5 794832.21
-604124.27 794835.64
-604260.31 794838.56
-604288.89 794857.61
-604313.31 794882.35
-604313.22 794882.28
-604335.13 794923.87
-604355.5 794976.9
-604370.95 794998.82
-604412.58 795078.37
-604463.42 795136.19
-604598.32 795209.79
-604691.67 795201.85
-604784.38 795181.82
-604840.89 795157.37
-604861.53 795115.46
-604788.5 795112.92
-604712.62 795091.01
-604631.02 795042.4
-604645.31 795017.95
-604626.96 794967.64
-604604.89 794904.64
-604596 794852.56
-604733.5 794745.28
-604851.15 794652.38
-604881 794628.24
-604902.91 794612.68
-604921.96 794595.54
-604935.93 794584.42
-604948.32 794574.58
-604960.86 794564.58
-604977.37 794550.6
-605030.4 794555.05
-605016.74 794528.06
-605006.26 794510.28
-604999.91 794502.34
-604955.46 794458.84
-604914.97 794477.07
-604834.31 794518.66
-604757.78 794457.38
-604703.32 794418.15
-604634.1 794401.01
-604562.49 794474.23
-604497.71 794529.16
-604470.72 794571.71
-604472.15 794619.52
-604485.97 794666.05
-604498.99 794688.91
-604536.14 794733.36
-604564.4 794772.42
-604479.93 794831.8
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604173.96 794695.4
-Region  1
-  189
-599825.71 788435.97
-599762.82 788648.03
-599735.99 788767.33
-599740.43 788821.94
-599814.56 788866.79
-599890.88 788916.47
-599927.4 788948.22
-600079.3 789043.31
-600239.64 789098.24
-600487.24 789178.25
-600517.72 789096.96
-600522.17 789080.44
-600539.37 789082.62
-600582.29 789092.92
-600623.14 789097.79
-600662.08 789122.77
-600691.51 789131.02
-600726.43 789156.85
-600749.93 789184.36
-600782.53 789200.24
-600849.21 789228.39
-600879.26 789178.19
-600917.58 789132.26
-600968.17 789088.87
-600989.76 789092.68
-601018.34 789094.37
-601052.2 789096.07
-601077.81 789074.25
-601092.84 789066
-601109.65 789068.14
-601126.74 789081.44
-601188.34 789105.91
-601211.84 789006.42
-601222 788946.52
-601238.09 788945.88
-601303.17 788989.38
-601379.06 789041.77
-601426.68 789072.56
-601474.63 789107.17
-601485.1 789099.87
-601548.11 789027
-601589.7 788982.86
-601637.96 788934.28
-601756.71 788933.64
-601796.71 788903.77
-601854.81 788851.38
-601887.52 788807.57
-601934.19 788726.6
-601958.95 788676.08
-601968.48 788662.11
-602022.23 788751.79
-602069.72 788807.5
-602181.84 788893.6
-602295.19 788979.01
-602360.6 789029.21
-602400.61 789064.45
-602465.37 789079.39
-602571.42 789102.89
-602594.91 789089.87
-602636.82 789058.12
-602704.81 789000.93
-602814.67 788913.93
-602850.55 788883.1
-602891.19 788854.52
-602915.01 788863.73
-602971.52 788892.62
-603030.9 788632.62
-602676.22 788529.51
-602665.19 788467.69
-602657.49 788441.56
-602699.71 788377.73
-602725.11 788305.99
-602700.98 788296.78
-602677.49 788167.87
-602662.39 788130.41
-602694.14 788037.69
-602703.03 788008.51
-602753.2 787992.68
-602838.92 787939.66
-602888.13 787913.94
-602923.37 787893.94
-603001.79 787849.8
-602775.9 787753.63
-602644.78 787693.94
-602560 787649.8
-602568.71 787638.8
-602575.38 787626.42
-602592.21 787594.98
-602595.7 787584.5
-602641.1 787581.93
-602800.35 787575.79
-603127.69 787729.17
-603135.13 787760.36
-603182.75 787727.98
-603229.11 787670.2
-603262.13 787614.95
-603296.73 787558.79
-603335.78 787513.38
-603357.69 787474.68
-603391.66 787397.2
-603433.25 787300.02
-603552.95 787193.34
-603581.52 787196.2
-603605.65 787162.83
-603604.06 787153.62
-603662.16 787048.18
-603732.65 786987.22
-603792.66 786931.66
-603819.71 786882.29
-603820.34 786879.12
-603832.35 786844.31
-603808.92 786820.89
-603790.57 786821.52
-603776 786800.63
-603748.15 786786.07
-603721.55 786745.55
-603693.69 786737.32
-603650.65 786722.12
-603596.21 786708.82
-603563.93 786699.96
-603543.67 786681.6
-603505.68 786663.87
-603486.06 786660.7
-603477.19 786650.57
-603454.41 786642.34
-603418.97 786661.33
-603353.78 786673.34
-603272.13 786669.53
-603225.3 786685.35
-603205.04 786680.28
-603187.31 786665.72
-603142.37 786653.06
-603113.88 786642.29
-603089.83 786642.29
-603065.14 786640.39
-603027.79 786624.56
-602994.88 786619.49
-602934.74 786602.39
-602898.66 786601.12
-602875.87 786590.99
-602861.94 786575.8
-602739.77 786532.1
-602715.72 786528.3
-602701.15 786506.78
-602678.36 786494.12
-602606.19 786455.5
-602546.02 786451.05
-602481.88 786444.06
-602447.59 786431.36
-602420.92 786407.23
-602400.6 786390.72
-602376.18 786371.37
-602222.18 786485.36
-602018.32 786627.61
-601941.48 786684.13
-601892.48 786612.91
-601321.44 786462.75
-600805.86 786309.29
-600755.09 786298.08
-600683.77 786395.87
-600594.54 786555.2
-600590.8 786599.16
-600568.38 786643.74
-600473.23 786755.99
-600458.12 786799.13
-600467.15 786800.69
-601207.17 786885.06
-601022.17 787562.68
-601512.71 787615.02
-601425.08 787809.42
-600980.58 787757.7
-601008.92 787619.22
-600188.68 787552.79
-600182.33 787552.79
-600143.39 787596.98
-600111 787628.73
-600048.77 787689.9
-600017.01 787732.82
-599974.25 787755.68
-599947.36 787788.66
-599935.51 787826.97
-599931.06 787878
-599922.59 787910.59
-599888.3 788004.99
-599833.88 788122.02
-599819.27 788169.43
-599828.14 788222.67
-599830.26 788289.35
-599825.71 788435.97
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 601663.6 787800.87
-Region  1
-  75
-604834.35 795667.02
-604779.53 795657.81
-604719.88 795642.46
-604666.37 795631.93
-604614.26 795620.91
-604550.94 795610.92
-604502.38 795601.86
-604418.67 795633.69
-604350.69 795656.54
-604285.07 795637.35
-604243.97 795620.37
-604215.1 795610.67
-604214.4 795644.87
-604215.44 795675.24
-604226.91 795706.45
-604256.67 795732.41
-604283.9 795753.3
-604316.82 795776.72
-604327.59 795795.08
-604347.78 795826.79
-604364.28 795886.48
-604375.11 795921.68
-604385.24 795953.48
-604408.91 795986.98
-604445.11 796037.46
-604377.36 796086.2
-604282.24 796153.99
-604225.72 796193.68
-604173.81 796232.89
-604111.26 796272.9
-604093.48 796244.32
-604035.38 796228.13
-604016.33 796245.91
-604067.9 796417.63
-604179.4 796664.75
-604189.56 796681.26
-604206.03 796702.41
-604291.77 796774.81
-604474.23 796916.71
-604543.54 796886.67
-604609.11 796835.58
-604658.02 796761.23
-604699.25 796682.72
-604768.55 796639.73
-604867.02 796557.07
-604951.88 796478.33
-604971.18 796459.91
-605027.76 796374.82
-605078.44 796311.02
-605120.98 796265.84
-605166.16 796220.67
-605231.07 796169.79
-605357.83 796076.84
-605419.2 796039.54
-605481.97 796007.66
-605587.01 795964.79
-605579.99 795953.83
-605576.92 795949
-605476.93 795816.55
-605436.14 795767
-605353.59 795797.76
-605288.4 795820.54
-605258.48 795827.1
-605192.48 795801.89
-605124.49 795806.72
-605074.47 795808.48
-605042.03 795811.1
-605016.59 795810.67
-605016.59 795789.61
-605015.28 795753.21
-604997.29 795739.17
-604963.96 795714.61
-604931.5 795690.93
-604887.86 795680.62
-604834.35 795667.02
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604692.27 796185.13
-Region  1
-  74
-610955.11 808688.58
-610515.18 808691.97
-610474.64 808664.15
-610302.47 808737.43
-610302.47 808737.43
-610312.29 808749.58
-610329.22 808775.96
-610342.92 808811.59
-610349.43 808852.35
-610346.69 808903.05
-610323.73 808966.01
-610295.65 809007.24
-610255.58 809052.11
-610202.48 809101.78
-610168.41 809129.7
-610105 809190.08
-610048.14 809279.32
-609996.72 809357.23
-609998.85 809612.29
-610038.17 809665.92
-610060.56 809733.99
-610132.19 809788.39
-610197.48 809843.7
-610219.24 809843.7
-610249.74 809818.92
-610270.92 809803.81
-610293.59 809788.39
-610318.98 809772.98
-610345.27 809754.85
-610366.13 809741.25
-610386.07 809732.18
-610396.05 809738.53
-610464.05 809815.6
-610501.22 809852.77
-610535.68 809889.04
-610599.15 809852.77
-610582.02 809775.11
-610585.81 809759.93
-610606.68 809749.8
-610692.09 809747.15
-610704.78 809759.84
-610774.6 809744.42
-610834.44 809710.88
-610907.88 809703.62
-611046.61 809665.54
-611039.36 809635.62
-611076.53 809546.76
-611097.39 809486.01
-611097.39 809452.46
-611063.29 809330.17
-611045.25 809261.56
-611035.96 809208.72
-611002.18 809179.52
-611040.26 809076.15
-611064.74 809000.9
-611107.41 808989.02
-611128.29 808986.48
-611144.72 808964.32
-611168.73 808931.41
-611183.27 808916.86
-611189.61 808914.71
-611198.94 808935.61
-611223.03 808911.95
-611255.3 808901.18
-611281.25 808894.21
-611302.75 808876.49
-611335.03 808870.78
-611378.07 808871.39
-611419.28 808864.16
-611353.09 808799.79
-611257.15 808769.41
-611230.68 808746.29
-611184.44 808648.37
-610955.11 808688.58
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610617.98 809244.47
-Region  1
-  61
-604425.44 809400.5
-604446.39 809449.84
-604463.58 809528.28
-604479.49 809593.44
-604501.68 809625.69
-604623.47 809726.83
-604677.7 809776.15
-604716.77 809786.48
-604905.7 809771.55
-604902.95 809706.94
-604983.06 809611.48
-605099.44 809502.79
-605097.34 809461.38
-605157.61 809399.87
-605006.81 809298.14
-604963.1 809325.38
-604941.59 809333.61
-604929.57 809336.15
-604913.07 809293.14
-604900.41 809295.04
-604863.72 809324.16
-604837.15 809333.66
-604804.82 809290.02
-604774.41 809258.41
-604768.69 809236.27
-604779.42 809212.86
-604839.43 809083.15
-604834.08 809054.47
-604819.24 809010.66
-604793.09 808964.72
-604756.34 808925.14
-604743.62 808877.79
-604707.58 808894.69
-604666.58 808924.43
-604619.94 808954.12
-604610.04 808973.9
-604612.87 808990.16
-604621.35 809007.12
-604628.42 809021.26
-604617.82 809028.32
-604583.19 809036.1
-604525.23 809043.17
-604467.28 809050.23
-604450.32 809054.47
-604454.56 809092.64
-604453.97 809120.65
-604432.47 809135.21
-604411.58 809142.81
-604365.4 809171.93
-604324.88 809191.87
-604301.55 809143.82
-604277.52 809184.1
-604255.94 809220.06
-604226.22 809249.17
-604240.77 809237.81
-604211.09 809263.25
-604237.24 809270.32
-604286 809287.99
-604348.2 809315.55
-604393.74 809359.4
-604425.44 809400.5
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604695.71 809376.5
-Region  1
-  65
-610781.51 798002.88
-610349.98 798233.01
-610188.89 798320.38
-610210.12 798339.77
-610218.01 798346.74
-610254.87 798381.17
-610275.2 798400.58
-610316.15 798439.72
-610290.36 798463.07
-610258.05 798499.01
-610258.05 798529.96
-610261.54 798578.35
-610264.88 798624.15
-610265.34 798651.02
-610255.33 798688.34
-610234.39 798709.27
-610167.35 798731.11
-610176.3 798738.84
-610189.35 798744.91
-610201.18 798749.46
-610216.35 798755.83
-610231.51 798761.29
-610256.39 798763.41
-610290.67 798748.85
-610331.32 798730.95
-610355.89 798718.51
-610397.45 798766.14
-610421.15 798788.56
-610448.5 798812.72
-610500.48 798849.2
-610569.78 798878.83
-610594.61 798892.66
-610629.52 798930.41
-610671.01 798963.69
-610725.72 798989.23
-610779.06 799024.33
-610933.86 798792.93
-611054.01 798770.98
-611092.77 798638.76
-611114.66 798563.5
-611157.29 798416.92
-611177.57 798262.5
-611189.99 798181.88
-611194.9 798144.41
-611200.16 798091.07
-611212.47 798001.71
-611169.51 798000.32
-611135.88 798000.34
-611105.13 797998.74
-611060.01 797931.73
-611054.7 797924.12
-611008.97 797939.4
-610954.26 797934.59
-610895.94 797914.74
-610784.42 797846.47
-610660.37 797744.98
-610624.36 797800.2
-610553.37 797857.53
-610569.18 797875.43
-610586.34 797893.13
-610619.02 797927.72
-610638.02 797949.49
-610690.5 797956.47
-610752.99 797972.24
-610781.51 798002.88
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610738.65 798411.14
-Region  1
-  51
-604817.85 810463.99
-605681.3 810183.82
-605712.81 810174.65
-605781.56 810135.69
-605838.28 810109.33
-605885.78 810105.33
-605872.6 810084.71
-605849 810005.43
-605817.13 810005.93
-605781.5 809926.58
-605770.33 809893.93
-605748.92 809829.7
-605727.51 809801.32
-605704.61 809779.41
-605703.5 809752.05
-605660.05 809726.83
-605603.29 809657.63
-605593.58 809665.02
-605544.79 809612.74
-605512.07 809575.53
-605474.77 809544.38
-605452.63 809539.05
-605431.72 809537
-605403.84 809531.67
-605435.82 809497.64
-605455.09 809472.22
-605443.61 809468.12
-605422.29 809466.07
-605389.08 809461.97
-605252.15 809446.01
-605230.23 809454.82
-605204.81 809479.42
-605195.79 809517.55
-605169.34 809580.86
-605168.09 809436.23
-605099.44 809502.79
-604983.06 809611.48
-604902.95 809706.94
-604905.7 809771.55
-604716.77 809786.48
-604677.7 809776.15
-604701.28 809800.29
-604718.51 809829.8
-604720.27 809870.58
-604740.79 810201.3
-604741.06 810254.2
-604725.15 810271.66
-604683.06 810396.89
-604740.55 810460.02
-604779.56 810476.96
-604817.85 810463.99
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605220.85 809964.73
-Region  1
-  45
-605549.66 807841.92
-606147.21 807902.31
-606121.25 807948.6
-606209.33 807913.64
-606235.55 807880.4
-606264.53 807823.86
-606309.05 807753.19
-606357.82 807675.45
-606393.74 807618.6
-606402 807543.33
-606416.79 807476.33
-606422.88 807399.77
-606466.12 807327.5
-606492.62 807257.89
-606520.38 807190.18
-606532.35 807144.63
-606546.87 807108.56
-606578.45 807059.83
-606624.58 806992.11
-606671.35 806938.94
-606706.11 806894
-606729.48 806856.03
-606762.34 806812.99
-606729.84 806808.37
-606726.4 806783.58
-606703.67 806756.72
-605415.9 806621.76
-605164.2 806844.55
-605161.44 806882.53
-605151.8 806974.81
-605332.22 806994.78
-605309.5 807188.98
-605292.98 807285.95
-605279.9 807351.37
-605265.78 807414.35
-605262.34 807427.44
-605299.18 807436.03
-605292.98 807579.27
-605269.79 807825.66
-605289.4 807839.92
-605300.18 807844.04
-605315.73 807846.16
-605335.52 807848.98
-605544.71 807870.89
-605549.66 807841.92
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605884.83 807234.71
-Region  1
-  81
-607102.65 809940.33
-607128.72 809954.36
-607151.64 809969.83
-607177.42 809991.03
-607206.64 810012.23
-607219.82 810023.12
-607215.24 810028.84
-607193.47 810061.5
-607187.16 810072.96
-607176.85 810080.41
-607215.24 810170.36
-607182.01 810186.98
-607166.54 810195.57
-607149.92 810199.58
-607099.9 810409.31
-607178.56 810477.12
-607158.12 810694.35
-607381.84 810932.34
-607381.84 810932.34
-607414.21 810884.01
-607523.78 810777
-607577.09 810726.68
-607620.94 810659.42
-607670.77 810519.45
-607671.87 810507.44
-607687.94 810465.2
-607709.67 810396.7
-607737.36 810334.4
-607777.5 810231.95
-607782 810173.47
-607773 810132.63
-607746.7 810086.25
-607723.16 810051.64
-607683.71 809994.19
-607636.98 809925.31
-607582.3 809848.48
-607652.9 809802.1
-607683.36 809778.56
-607731.12 809738.41
-607763.86 809709.98
-607782.69 809681.32
-607817.99 809637.01
-607829.07 809616.94
-607796.54 809612.09
-607753.62 809610.02
-607707.24 809610.02
-607647.01 809610.02
-607610.33 809606.56
-607535.57 809579.56
-607462.88 809545.64
-607408.54 809511.35
-607238.25 809392.98
-606851.18 809107.72
-606840.15 808990.46
-606821.71 808990.28
-606617.94 809073.74
-606620.9 809090.32
-606626.01 809149.57
-606631.46 809169.19
-606641.14 809188.35
-606667.5 809242.77
-606678.67 809266.55
-606736.25 809390.02
-606767.77 809459.92
-606767.77 809476.53
-606631.41 809451.32
-606608.49 809446.74
-606590.73 809445.02
-606591.3 809457.48
-606597.03 809463.35
-606619.95 809482.26
-606617.08 809510.33
-606614.22 809569.35
-606622.24 809575.65
-606657.76 809606.59
-606672.95 809612.03
-606742.37 809924.13
-606799.42 809935.88
-606853.11 809946.9
-606862.51 809952.24
-607102.65 809940.33
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607236.37 809923.59
-Region  1
-  41
-609972.53 803028.68
-609959.17 802969.21
-609940.09 802904.69
-609917.78 802831.97
-609918.74 802815.32
-609946.12 802761.36
-609978.14 802714.61
-610007.6 802677.75
-610022.52 802652.74
-610029.67 802626.88
-610027.7 802604.13
-609977.96 802639.71
-609927.52 802668.29
-609888.82 802691.25
-609823.8 802727.37
-609794.32 802754.83
-609658.62 802802.5
-609634.05 802784.2
-609616.24 802750.49
-609428.65 802549.41
-609028.22 803703.43
-609043.15 803729.44
-609057.6 803749.67
-609071.08 803771.34
-609074.93 803792.05
-609066.26 803823.83
-609037.13 803905.9
-609079.51 803954.06
-609136.33 803928.06
-609209.53 803898.68
-609211.94 803938.65
-609216.03 803973.06
-609252.61 803957.86
-609533.88 803840.02
-609548.33 803856.88
-609943.25 803673.69
-609957.14 803519.81
-609965.13 803428.54
-609957.93 803161.96
-609971.39 803082.86
-609972.53 803028.68
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609538.86 803317.76
-Region  1
-  51
-600091.28 790263.68
-599995.06 790178.88
-599944.89 790155.39
-599892.18 790139.51
-599822.32 790137.6
-599779.45 790144.25
-599613.06 790200.77
-599507.63 790202.04
-599407.92 790165.84
-599385.06 790195.69
-599274.24 790308.43
-599182.15 790361.15
-599075.44 790407.51
-599010.67 790432.27
-598968.76 790457.04
-598898.28 790509.11
-598833.51 790550.38
-598787.17 790580.85
-598754.15 790612.6
-598717.32 790702.77
-598698.27 790731.98
-598683.03 790765
-598662.71 790810.72
-598639.85 790861.52
-598659.79 790892.25
-598700.37 790935.62
-598717.61 790959.52
-598764.59 791013.74
-598841.04 791099.14
-598837.56 791103.7
-598837.56 791109.6
-598921.79 791137.69
-599009.69 791206.81
-599055.87 791268.83
-599128.35 791262.92
-599221.99 791265.98
-599373.58 791304.67
-599532.49 791281.44
-599734 791185.06
-599998.08 791130.68
-599960.31 790995.89
-600647.19 790187.83
-600628.86 790142.07
-600621.84 790150.3
-600479.64 790246.25
-600418.67 790289.44
-600352.94 790315.76
-600302.13 790324.02
-600236.08 790322.11
-600166.86 790308.14
-600091.28 790263.68
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 599532.45 790707.5
-Region  1
-  24
-610092.97 795436.65
-610409.8 796630.57
-610600.74 796581.61
-611321.54 796387.43
-611356.52 796376.94
-610964.47 794905.01
-610957.01 794883.46
-610875.49 794905.34
-610875.4 794905.36
-610768.27 794934.12
-610681.61 794960.77
-610681.59 794960.78
-610681.54 794960.8
-610681.5 794960.81
-610681.47 794960.82
-610559.48 794998.34
-610558.47 794998.65
-610355.98 795337.29
-610288.59 795355.45
-610273.88 795359.41
-610158.17 795390.6
-610085.28 795410.24
-610086.66 795414.99
-610092.97 795436.65
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610721.55 795806.17
-Region  1
-  51
-609190.7 793604.19
-609155.14 793614.01
-609095.45 793615.91
-608981.78 793614.33
-608933.84 793613.07
-608918.28 793616.24
-608890.02 793633.7
-608750 793707.06
-608741.43 793720.4
-608741.74 793801.35
-608768.58 793934.25
-608810.18 794003.74
-608977.68 794165.54
-609088.82 794233.81
-609111.21 794246.99
-609197.32 794308.21
-609215.42 794353.29
-609218.88 794508.23
-609262.89 794559.56
-609306.04 794580.66
-609436.42 794610.21
-609476.75 794631.31
-609513.8 794681.03
-609545.7 794643.04
-609578.99 794602.24
-609601.51 794590.98
-609650.79 794590.06
-609649.64 794456.25
-609644.42 794335.75
-609644.42 794310.98
-609603.73 794293.52
-609601.83 794188.43
-609581.06 794162.23
-609561.06 794132.71
-609602.97 794094.92
-609622.65 794074.6
-609564.37 794005.86
-609557.19 793978.07
-609553.06 793923.14
-609570.53 793871.38
-609595.92 793835.78
-609610.53 793815.14
-609635.31 793774.8
-609637.39 793708.62
-609606.27 793659.94
-609550.17 793586.26
-609544.54 793576.58
-609530.21 793561.73
-609499.47 793546.36
-609406.6 793522.59
-609190.7 793604.19
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609269.26 794021.25
-Region  1
-  34
-604253.55 794189.25
-604384.25 794168.93
-604523.12 794145.11
-604538.37 794124.47
-604547.26 794081.28
-604533.92 794044.44
-604477.4 793909.17
-604467.71 793838.5
-604453.91 793793.43
-604431.68 793758.18
-604417.07 793752.46
-604377.06 793740.08
-604378.01 793697.53
-604369.28 793653.84
-604359.44 793630.97
-604344.2 793623.35
-604320.38 793616.68
-604314.5 793590.78
-604329.43 793565.37
-604356.27 793534.43
-604372.13 793500.73
-604372.6 793465.94
-604358.63 793437.37
-604324.02 793413.87
-604138.41 793397.84
-604100.63 793378.15
-604003.93 793443.41
-603827.69 793664.12
-603797.53 793742.87
-603838.15 794046.38
-604064.84 794181
-604095.32 794222.95
-604113.1 794218.5
-604253.55 794189.25
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604154.11 793827.73
-Region  1
-  141
-613793.24 792410.3
-613604.41 792354.73
-613505 792234.17
-613472.17 792217.95
-613443.96 792201.31
-613375.57 792177.47
-613350.91 792156.74
-613329.76 792148
-613270.39 792136.58
-613222.45 792094.27
-613216.24 792063.81
-613198.63 792034.06
-613148.71 792021.93
-613100.22 792016.59
-613065.29 792003.89
-613023.38 791958.8
-612950.36 791942.29
-612919.88 791911.18
-612811.93 791874.35
-612732.55 791829.9
-612617.62 791720.68
-612537.95 791667.66
-612478.9 791621.94
-612394.12 791600.67
-612303.95 791557.49
-612270.3 791516.85
-612169.97 791454.62
-612049.1 791434.47
-611854.16 791436.37
-611695.41 791642.09
-611747.8 791609.07
-611765.26 791602.72
-611799.55 791611.29
-611811.93 791645.28
-611781.13 791715.16
-611790.34 791793.26
-611843.04 791837.73
-611918.29 791957.45
-611978.3 791896.48
-612025.6 792038.73
-611887.17 792040.63
-611941.15 792285.25
-611983.89 792382.57
-611995.49 792462.12
-612019.3 792538
-612005.01 792589.12
-611958.79 792637.86
-611920.69 792679.78
-611903.86 792711.84
-611877.98 792794.87
-611861.78 792825.67
-611841.46 792851.39
-611849.72 792871.08
-611875.73 792921.82
-611912.24 792924.04
-612008.13 792990.72
-612028.61 793030.24
-612035.91 793107.08
-612043.05 793200.9
-612047.35 793237.25
-612061 793274.71
-612101.64 793309
-612136.88 793314.08
-612279.24 793286.29
-612346.55 793277.09
-612414.18 793298.68
-612483.82 793344.23
-612576.54 793402.02
-612630.05 793435.51
-612692.29 793449.16
-612746.58 793462.18
-612792.79 793490.59
-612825.49 793560.45
-612825.33 793677.45
-612852.22 793719.62
-612890.3 793750.01
-612949.53 793780.78
-613005.18 793808.73
-613061.38 793835.57
-613147.26 793857.04
-613217.39 793877.55
-613262.23 793954.84
-613278.2 794048.34
-613298.32 794121.58
-613339.92 794188.84
-613403.4 794245.27
-613494.11 794272.7
-613682.62 794255.45
-613703.42 794248.37
-613789.27 794248.37
-613863.19 794250.04
-613885.76 794240.74
-613904.34 794219.06
-613937.09 794138.97
-613962.75 794102.68
-614005.43 794074.57
-614045.23 794001.09
-614044.1 793876.07
-614104.9 793762.12
-614140.01 793315.25
-614505.35 793007.99
-614490.36 793005.28
-614480.66 792979.67
-614469.97 792964.51
-614436.9 792953.44
-614399.07 792927.89
-614393.02 792925.71
-614345.06 792865.9
-614304.04 792816.67
-614299.19 792782.28
-614299.81 792775.82
-614291.61 792758.17
-614272.15 792744.8
-614238.58 792714.96
-614232.78 792706.06
-614225.82 792681.57
-614220.94 792673.97
-614209.32 792662.35
-614195.75 792651.29
-614171.88 792633.02
-614167.32 792629.6
-614157.25 792623.13
-614129.9 792608.21
-614114.86 792605.85
-614103.49 792600.4
-614099.62 792596.53
-614093.17 792587.5
-614084.85 792568.3
-614063.22 792542.07
-614040.34 792535.98
-614022.14 792519.88
-614001.13 792501.61
-613967.81 792498.37
-613947.97 792492.59
-613928.82 792483.76
-613882.89 792481.08
-613850.7 792461.81
-613839.14 792454.85
-613826.12 792431.9
-613818.66 792425.56
-613793.24 792410.3
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613056.29 792860.51
-Region  1
-  115
-607102.65 809940.33
-606862.51 809952.24
-606285.1 809983.3
-606259.89 809986.16
-606255.59 810021.4
-606235.55 810063.29
-606202.88 810092.44
-606174.24 810097.03
-606088.7 810097.9
-605937.34 810100.75
-605885.78 810105.33
-605838.28 810109.33
-605781.56 810135.69
-605712.81 810174.65
-605857.51 810793.14
-605817.12 810799.73
-605856.65 811009.42
-605766.97 811025.99
-605752.43 811033.5
-605792.98 811081.23
-605803.24 811164.38
-605790.66 811216.96
-605829.67 811398.65
-605828.12 811485.33
-605811.18 811518.7
-605770.63 811672.68
-605777.82 811695.77
-605828.89 811789.96
-605867.12 811950.37
-605876.87 811999.13
-605876.87 812037.11
-605881.74 812052.75
-605886.36 812104.08
-605899.2 812116.4
-605911 812112.8
-606003.9 812071.74
-606009.03 812064.56
-606040.34 812001.43
-606098.34 811974.74
-606136.32 811968.58
-606184.31 811989.9
-606241.8 812026.86
-606401.42 812088.96
-606487.65 812115.65
-606562.84 812203.68
-606611.08 812246.8
-606624.43 812251.93
-606677.81 812249.87
-606752.23 812260.65
-606779.17 812281.93
-606823.83 812298.86
-606847.67 812323.94
-606877.68 812341.87
-606885.11 812343.92
-606892.61 812344.05
-606930.49 812341.13
-606939.52 812337.44
-606959.98 812320.52
-606983.75 812295.85
-607004.09 812281.49
-607025.39 812275.96
-607044.38 812285.98
-607051.9 812249.06
-607056.88 812215.43
-607053.14 812169.35
-607042.55 812133.85
-607020.88 812078.96
-607045.64 812081.2
-607028.5 812025.95
-607050.09 811997.38
-607040.88 811912
-607006.27 811784.04
-606996.59 811684.79
-607078.51 811553.68
-607102.95 811521.64
-607138.83 811482.27
-607159.79 811465.76
-607176.61 811444.17
-607188.37 811422.61
-607193.45 811409.91
-607215.67 811424.52
-607229.71 811401.21
-607249.01 811375.05
-607273.3 811340.8
-607288.25 811319.63
-607302.57 811299.7
-607312.53 811283.51
-607321.25 811271.05
-607328.72 811261.09
-607338.07 811246.77
-607346.16 811233.69
-607357.37 811213.76
-607367.96 811196.32
-607390.38 811163.94
-607407.19 811132.18
-607439.39 811053.31
-607437.89 811012.46
-607381.84 810932.34
-607158.12 810694.35
-607178.56 810477.12
-607099.9 810409.31
-607149.92 810199.58
-607166.54 810195.57
-607182.01 810186.98
-607215.24 810170.36
-607176.85 810080.41
-607187.16 810072.96
-607193.47 810061.5
-607215.24 810028.84
-607219.82 810023.12
-607206.64 810012.23
-607177.42 809991.03
-607151.64 809969.83
-607128.72 809954.36
-607102.65 809940.33
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606525.69 811049.13
-Region  1
-  39
-606967.62 792921.42
-607013.31 792868.03
-607053.65 792825.17
-607093.34 792775
-607109.22 792783.89
-607121.28 792790.56
-607133.35 792797.86
-607144.78 792804.53
-607155.25 792772.46
-607161.96 792744.65
-607167.68 792713.54
-607182.6 792666.54
-607128.31 792634.79
-607084.81 792610.98
-607036.87 792584.27
-607007.02 792567.76
-606941.3 792530.93
-606908.28 792512.52
-606874.95 792494.42
-606845.42 792481.4
-606813.99 792540.46
-606788.59 792525.53
-606764.78 792511.83
-606743.82 792500.72
-606726.04 792490.56
-606716.52 792485.8
-606708.26 792481.99
-606694.93 792511.83
-606678.62 792547.53
-606641.79 792617.7
-606601.47 792724.11
-606584.33 792757.48
-606506.54 792862.58
-606817.44 793218.98
-606929.51 793063.99
-606968.88 793014.18
-607017.46 792950.32
-606973.97 792934.76
-606967.62 792921.42
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606829.86 792805.92
-Region  1
-  36
-614620.59 803918.46
-614733.44 803266.83
-614706.55 803257.2
-614658.42 803235.29
-614630.54 803223.34
-614646.74 803192.04
-614635.85 803192.8
-614617.76 803176.37
-614603.15 803126.58
-614594.19 803079.78
-614570.96 803097.7
-614557.35 803107.66
-614513.2 803139.53
-614501.97 803154.38
-614472.04 803192.64
-614446.82 803226.16
-614417.77 803211.4
-614402.84 803247.25
-614393.76 803279.85
-614375.4 803320.19
-614359.8 803351.49
-614339.26 803393.78
-614314.24 803440.29
-614285.61 803496.51
-614256.61 803555.97
-614220.74 803621.37
-614205.12 803651.39
-614190.86 803678.22
-614180.47 803688.62
-614172.74 803695.63
-614159.93 803708.19
-614138.53 803729.13
-614122.18 803746.88
-614120.19 803807.62
-614118.36 803873.52
-614620.59 803918.46
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 614462.53 803571.49
-Region  1
-  29
-605681.3 810183.82
-604817.85 810463.99
-604779.56 810476.96
-604807.79 810488.77
-604845 810509.52
-604876.3 810521.32
-604901.97 810526.46
-604978.96 810530.56
-605036.96 810565.46
-605162.19 810674.79
-605226.09 810709.42
-605401.63 810781.28
-605434.99 810792.57
-605457.57 810794.63
-605581.01 810786.15
-605605.65 810798.46
-605665.7 810868.27
-605695.21 810952.18
-605736.78 811014.28
-605740.62 811021.18
-605745.24 811026.83
-605749.86 811030.42
-605752.43 811033.5
-605766.97 811025.99
-605856.65 811009.42
-605817.12 810799.73
-605857.51 810793.14
-605712.81 810174.65
-605681.3 810183.82
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605466.81 810552.02
-Region  1
-  39
-611858.41 802723.22
-611768.07 802665.93
-611720.98 802633.33
-611741.35 802607.97
-611750.86 802581.71
-611618.64 802536.88
-611580.6 802520.58
-611559.32 802505.19
-611543.47 802491.15
-611524.9 802459
-611430.26 802468.05
-611413.22 802593.61
-611400.19 802733.13
-611393.74 802793.99
-611392.22 802817.89
-611395.89 802840.05
-611408.02 802923.55
-611449.88 802986.8
-611488.8 803036.03
-611552.61 803124.72
-611577.91 803163.47
-611589.76 803180.76
-611602.89 803203.18
-611743.75 803112.55
-611836.91 803049.44
-611904.38 803010.95
-611916.61 803005.06
-611950.57 802967.93
-611971.85 802976.99
-611992.69 802985.07
-612014.43 802994.12
-612020.01 802977.14
-612042.04 802919.48
-612052.45 802903.18
-612137.13 802816.69
-612039.32 802810.35
-611997.2 802801.75
-611918.65 802766.39
-611858.41 802723.22
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611670.59 802834
-Region  1
-  71
-610955.11 808688.58
-611184.44 808648.37
-611230.68 808746.29
-611257.15 808769.41
-611353.09 808799.79
-611419.28 808864.16
-611499.07 808939.42
-611502.7 808883.21
-611504.51 808838.78
-611509.95 808796.16
-611513.43 808767.58
-611516.81 808705.66
-611520.83 808685.54
-611499.07 808665.6
-611490.91 808645.65
-611478.46 808608.81
-611416.1 808494.69
-611387.99 808438.48
-611386.18 808401.3
-611341.75 808318.79
-611378.24 808301.37
-611369.63 808266.92
-611379.31 808197.67
-611406.64 808158.28
-611451.86 808087.72
-611470.74 808076.3
-611514.96 808070.33
-611547.26 808072.82
-611578.06 808062.38
-611594.46 808070.33
-611611.85 808111.08
-611662.03 808169.71
-611702.78 808181.14
-611717.28 808151.33
-611718.53 808136.78
-611715.98 808114.01
-611706.47 808098.83
-611709.61 808070.36
-611741.04 808043.01
-611777.31 807985.86
-611737.06 808006.24
-611679.92 808024.12
-611642.16 808016.17
-611606.23 808006.87
-611557.48 807996.78
-611513.14 807977.82
-611461.04 807959.29
-611416.82 807935.44
-611369.4 807908.36
-611218.84 807775.69
-611065.18 807631.35
-611036.58 807590.85
-610916.34 807540.67
-610859.94 807545.39
-610799.8 807595.6
-610763.14 807625.89
-610737.39 807652.72
-610729.42 807689.38
-610717.73 807726.04
-610711.89 807739.85
-610665.92 807751.13
-610608.28 807758.98
-610550.93 807790.34
-610210.72 808551.4
-610196.68 808585.79
-610213.78 808611.14
-610252.46 808663.64
-610302.47 808737.43
-610474.64 808664.15
-610515.18 808691.97
-610955.11 808688.58
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610917.13 808237.38
-Region  1
-  33
-604307.63 789681.07
-603963.27 789497.35
-603842.31 789431.95
-603856.91 789511.96
-603797.22 789484.97
-603656.45 790021.88
-603653.82 790031.88
-603963.03 790207.59
-603989.7 790377.14
-604015.07 790481.91
-604055.08 790591.45
-604092.07 790671.94
-604131.91 790741.31
-604157.31 790733.05
-604193.19 790748.3
-604242.09 790748.3
-604271.3 790718.45
-604845.98 791040.7
-604867.85 790993.31
-604877.38 790946.6
-604890.71 790874.52
-604907.84 790803.76
-604910.38 790725.64
-604884.53 790666.13
-604861.67 790620.73
-604826.84 790480.81
-604804.83 790387.29
-604784.83 790244.06
-604791.19 790227.86
-604792.78 790151.62
-604810.88 790026.84
-604820.4 789957.34
-604307.63 789681.07
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604324.82 790213.98
-Region  1
-  22
-606048.37 797132.45
-605890.43 796943.85
-605836.78 796990.21
-605721.52 797094.08
-605625 797192.51
-605573.89 797282.05
-605457.67 797442.05
-605473.58 797454.06
-605503.11 797475.97
-605551.37 797508.67
-605605.98 797542.36
-605659.63 797556.96
-605724.4 797551.88
-605782.18 797530.65
-605849.49 797506.2
-605922.84 797479.53
-605977.76 797435.06
-605991.73 797393.15
-606001.57 797322.96
-606046.02 797219.46
-606049.01 797139.44
-606048.37 797132.45
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605788.41 797290.2
-Region  1
-  48
-609055.88 808985.64
-608966.38 809012.11
-608868.35 809017.38
-608802.99 809023.18
-608740.8 809042.15
-608679.13 809081.15
-608644.88 809111.2
-608596.65 809150.98
-608536.04 809195.25
-608618.79 809289.07
-608953.7 809762.6
-608966.35 809770.5
-609030.7 809642.52
-609440.95 809996.32
-609467.82 809942.04
-609483.1 809908.32
-609495.75 809887.76
-609525.26 809867.21
-609618.01 809825.05
-609704.97 809749.16
-609759.05 809700.21
-609818.01 809649.23
-609865.95 809614.76
-609925.91 809532.26
-609948.78 809524.26
-609961.41 809491.99
-609968.95 809434.42
-609981.56 809389.5
-609996.72 809357.23
-609989.89 809260.37
-609982.77 809177.31
-609980.03 809108.47
-609993.56 809027.74
-610018.61 808949.08
-610046.99 808868.72
-610074.79 808789.63
-610027.88 808734.29
-609979.39 808846.56
-609931.43 808879.23
-609808.62 808932.46
-609756.97 808909.8
-609706.64 808868.99
-609530.08 808678.2
-609450.23 808747
-609379.07 808801.81
-609314.77 808839.23
-609231.5 808888.78
-609055.88 808985.64
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609371.74 809310.12
-Region  1
-  37
-612356.75 804434.09
-611839.79 804400.28
-611826.05 804383.47
-611806.13 804396.81
-611781.1 804413.49
-611769.53 804421.93
-611756.75 804430.85
-611741.81 804441.45
-611709.26 804412.53
-611605.13 804462.67
-611568.97 804480.02
-611774.54 804912.3
-611816.11 804920.29
-611839.55 804926.15
-611855.54 804930.42
-611869.4 804932.55
-611882.19 804936.81
-611896.57 804945.34
-611902.44 804935.75
-611957.32 804961.32
-611969.81 804934.62
-612060.73 804800.83
-612071.82 804784.91
-612077.61 804705.82
-612179.37 804712.57
-612263.04 804940.9
-612296.55 804950.28
-612371.78 804967.65
-612386.73 804890.97
-612399.6 804829.51
-612413.58 804792.38
-612474.15 804736.89
-612457.28 804715.67
-612417.38 804646.14
-612390.86 804601.06
-612380.14 804510.31
-612356.75 804434.09
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612024.14 804647.38
-Region  1
-  34
-607597.08 797900.34
-606753.8 797924.82
-606697.81 797966.19
-606648.14 798056.7
-606538.89 798070.84
-606562.66 798223.29
-606543.55 798256.52
-606536.54 798268.22
-606529.54 798283.15
-606599.39 798321.25
-606652.73 798348.55
-606747.34 798393.64
-606750.52 798451.42
-606874.62 798425.39
-607017.94 798417.6
-607302.64 798414.81
-607299.62 798246.35
-607294.85 798135.07
-607329.06 798134.21
-607378.86 798135.07
-607384.92 798116.02
-607390.77 798099.8
-607399.86 798062.56
-607452.69 798059.53
-607508.55 798053.9
-607653.6 798091.57
-607657.5 798078.58
-607666.16 798042.64
-607677.85 797979.85
-607681.52 797968.75
-607684.34 797961.15
-607690.83 797945.13
-607694.73 797935.61
-607597.08 797900.34
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607039.26 798143.64
-Region  1
-  72
-608286.4 794218.34
-608315.19 794247.59
-608314.14 794258.81
-608355.83 794298.39
-608405 794339.42
-608510.73 794394.98
-608526.6 794434.03
-608533.59 794454.67
-608545.71 794490.52
-608588.16 794666.94
-608598.27 794707.01
-608613.67 794765.22
-608685.84 794747.23
-608751.26 794731.38
-608764.59 794727.57
-608775.39 794764.82
-608788.3 794805.25
-608791.81 794819.05
-608810.95 794807.15
-608844.61 794746.17
-608883.14 794709.55
-608914.47 794695.39
-608964.42 794679.72
-609021.79 794666.58
-609095.66 794643.06
-609068.99 794586.55
-609053.75 794586.55
-608978.51 794481.48
-608981.68 794471.64
-608986.44 794461.48
-608993.11 794438.91
-609002.45 794415.1
-609017.69 794364.3
-609033.89 794309.36
-609045.16 794271.76
-609086.75 794257.47
-609111.21 794246.99
-609088.82 794233.81
-608977.68 794165.54
-608810.18 794003.74
-608768.58 793934.25
-608741.74 793801.35
-608741.43 793720.4
-608730.95 793717.54
-608725.24 793716.59
-608714.44 793712.46
-608695.71 793707.06
-608680.47 793703.25
-608667.45 793699.13
-608647.38 793755.57
-608631.08 793753.03
-608518.89 793702.24
-608477.4 793628.64
-608455.72 793562.76
-608084.45 793486.87
-608065.3 793563.45
-608047.94 793625.04
-608019.04 793689.28
-607962.63 793777.83
-607912.68 793861.22
-607996.61 793906.02
-608005.71 793900.94
-608101.6 793899.45
-608089.11 793928.87
-608044.24 793943.27
-608022.86 794003.76
-608007.84 794042.5
-608074.51 794079.33
-608157.07 794124.43
-608201.31 794148.77
-608238.14 794171.35
-608286.4 794218.34
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608533.32 794106.87
-Region  1
-  67
-610400.36 793003.22
-610398.31 793060.84
-610364.65 793157.99
-610348.46 793159.58
-610324.33 793167.84
-610295.89 793207.77
-610267.7 793269.18
-610240.71 793327.28
-610215.31 793338.39
-610189.27 793334.89
-610166.73 793322.51
-610013.07 793317.66
-609910.84 793322.16
-609924.49 793329.47
-609945.76 793342.11
-610047.36 793417.36
-610059.89 793441.93
-610105.14 793506.52
-610152.13 793583.36
-610164.51 793624.96
-610256.27 793683.7
-610272.64 793661.6
-610295.96 793630.04
-610322 793621.78
-610345.42 793618.57
-610387.4 793652.92
-610542.66 793648.79
-610603.62 793646.9
-610669.98 793645.31
-610755.12 793644.35
-610767.19 793662.13
-610760.84 793694.2
-610740.2 793724.05
-610708.45 793806.6
-610710.51 793868.98
-610714.96 793957.57
-610740.04 794004.88
-610807.67 793951.22
-610901.33 793884.54
-610930.05 793858.15
-610951.64 793822.17
-610957.35 793810.1
-610965.4 793790.42
-610968.07 793766.72
-610939.67 793736.41
-610961.18 793708.26
-610937.88 793653.88
-610949.37 793626.51
-610957.33 793563.41
-610949.54 793535.29
-610958.01 793497.98
-610985.7 793442.21
-610984.16 793404.51
-610953.57 793352.74
-610915.5 793289.27
-610914.53 793239.46
-610913.76 793179.07
-610920.68 793142.15
-610778.82 792942.88
-610747.07 792937.8
-610721.67 792933.04
-610662.93 792919.08
-610609.59 792915.9
-610557.84 792922.57
-610513.71 792938.13
-610467.67 792960.99
-610400.36 793003.22
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610588.33 793393.03
-Region  1
-  66
-606929.51 793063.99
-607615.44 793398.53
-607624.58 793361.16
-607648.08 793343.06
-607751.58 793296.39
-607772.54 793270.95
-607774.12 793249.68
-607759.84 793171.54
-607764.6 793138.84
-607728.73 793101.37
-607746.72 793078.52
-607755.61 793046.45
-607719.1 793019.46
-607876.65 792872.58
-607935.51 792819.26
-607978.69 792781.16
-608029.49 792735.12
-608072.35 792677.66
-608103.92 792633.38
-608085.13 792564.85
-608071.16 792528.34
-608060.68 792521.98
-608059.1 792516.59
-608049.57 792511.51
-608039.73 792496.27
-608034.97 792472.45
-608014.96 792443.88
-607987.34 792426.73
-607953.05 792419.11
-607941.62 792419.11
-607913.02 792442.27
-607846.98 792402.26
-607826.98 792414.8
-607817.43 792448.93
-607787.9 792454.65
-607734.25 792494.02
-607653.28 792524.18
-607613.6 792502.28
-607600.9 792511.17
-607534.86 792538.47
-607528.42 792592.76
-607525.18 792654.46
-607517.24 792710.35
-607446.44 792707.17
-607409.29 792706.22
-607361.35 792731.94
-607321.66 792724.95
-607288.64 792708.12
-607263.56 792693.84
-607217.53 792672.58
-607182.6 792666.54
-607167.68 792713.54
-607161.96 792744.65
-607155.25 792772.46
-607144.78 792804.53
-607133.35 792797.86
-607121.28 792790.56
-607109.22 792783.89
-607093.34 792775
-607053.65 792825.17
-607013.31 792868.03
-606967.62 792921.42
-606973.97 792934.76
-607017.46 792950.32
-606968.88 793014.18
-606929.51 793063.99
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607538.49 792893.99
-Region  1
-  49
-609879.3 801068.67
-609836.11 800929.28
-609808.55 800830.54
-609813.63 800768.39
-609838.89 800708
-609808.15 800713.5
-609767.09 800715.8
-609748.51 800711.9
-609719.15 800695.15
-609682.44 800666.25
-609630.83 800659.6
-609524.51 800659.71
-609495.72 800632.98
-609433.32 800582.28
-609409.12 800561.03
-609385.62 800538.8
-609347.54 800496.82
-609313.13 800447.28
-609251.3 800512.74
-609206 800588.07
-609142.8 800716.42
-609143.27 800822.63
-609109.89 800901.22
-609069.74 801005.82
-609074.23 801055.84
-609082.93 801083.25
-609065.27 801098.16
-609016.45 801068.54
-608984.98 801056.18
-608952.95 801059.02
-608935.17 801064.1
-608953.58 801106.64
-608925.64 801132.68
-608907.23 801148.55
-608934.53 801182.21
-608996.76 801256.5
-609085.66 801293.33
-609217.86 801333.94
-609305.37 801363.3
-609481.98 801424.2
-609545.37 801454.77
-609607.98 801510.8
-609735.1 801674.65
-609739.85 801657.67
-609829.31 801393.96
-609871.58 801275.63
-609892.36 801193.37
-609892.99 801129.65
-609879.3 801068.67
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609467.76 801046.44
-Region  1
-  77
-605601.54 793714.4
-605578.68 793690.58
-605524.06 793631.52
-605446.1 793548.82
-605410.53 793507.54
-605361.94 793454.52
-605345.43 793438.64
-605315.58 793459.91
-605286.68 793489.76
-605194.07 793571.17
-605122.31 793640.84
-605076.59 793636.19
-605054.58 793653.33
-605011.39 793649.73
-604975.62 793667.09
-604897.09 793818.59
-604864.27 793878.72
-604857.28 794007.96
-604871.67 794047.76
-604909.14 794072.52
-604973.69 794055.37
-605007.56 794049.02
-605049.68 794036.54
-605100.26 794029.98
-605159.52 794027.89
-605322.08 794031.44
-605366.32 794053.24
-605423.47 794095.78
-605469.4 794131.13
-605496.59 794150.94
-605533.42 794176.53
-605567.29 794201.72
-605597.77 794226.27
-605638.41 794257.17
-605669.11 794276.84
-605698.95 794298.01
-605718.64 794300.97
-605736.2 794301.6
-605787.83 794266.06
-605836.54 794230.13
-605877.39 794202.61
-605929.25 794165.99
-605950.64 794142.23
-605946.44 794095.82
-605947.82 794066.07
-605951.31 794050.19
-605955.33 794034.19
-605959.46 794017.68
-605964.54 794002.12
-605972.48 793986.56
-605979.46 793973.22
-605987.72 793959.25
-606010.26 793934.49
-606148.48 793837.19
-606183.52 793804.02
-606216.13 793752.72
-606237.49 793689.02
-606244.57 793623.67
-606220.71 793558.56
-606188.67 793511.26
-606132.42 793453.86
-606094.66 793421.82
-606050.04 793383.68
-606008.08 793351.26
-605960.79 793313.89
-605943.63 793335.24
-605913.5 793377.58
-605869.25 793437.84
-605836.69 793480.61
-605846.85 793558.41
-605867.49 793733
-605803.98 793776.19
-605767.46 793756.82
-605704.59 793743.48
-605646.95 793734.72
-605616.46 793734.08
-605601.54 793714.4
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605581.82 793826.98
-Region  1
-  28
-608678.25 799275.24
-608721.14 799321.55
-608767.94 799408.31
-608781.83 799456.81
-608791.58 799533.82
-608790.37 799614
-608804.99 799691.02
-608840.32 799782.88
-608865.67 799820.9
-608889.61 799866.78
-608921.78 799930.63
-608953.96 800000.82
-608987.59 800037.38
-609072.4 800120.73
-609140.64 799768.32
-609168.17 799629.15
-609181.82 799557.5
-609198.65 799472.44
-609215 799391.25
-609280.53 799126.82
-608765.28 799110.24
-608745.29 799107.81
-608641.47 799105.37
-608605.89 799104.39
-608603.94 799206.27
-608603.19 799223.09
-608634.38 799241.12
-608678.25 799275.24
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608973.15 799478.78
-Region  1
-  50
-611860.02 800177.69
-611848.77 800056.11
-611842.57 800017.33
-611837.48 799976.62
-611884.76 799882.05
-611902.55 799840.85
-611987.74 799803.73
-611997.12 799781.84
-611991.06 799762.18
-611983.82 799735.92
-611978.72 799703.65
-611974.26 799686.76
-611963.31 799680.12
-611939.48 799669.18
-611899.23 799646.9
-611813.45 799599.82
-611808.37 799585.36
-611702.07 799564.25
-611662.79 799564.14
-611630.75 799598.13
-611613.16 799626.66
-611604.18 799652.84
-611597.14 799700.13
-611572.72 799739.81
-611480.5 799778.11
-611452.36 799806.63
-611426.95 799858.31
-611409.56 799899.91
-611402.53 799915.15
-611391.98 799932.34
-611392.17 800023.13
-611393.54 800067.53
-611396.27 800121.85
-611400.38 800210.76
-611406.24 800273.67
-611414.44 800349.02
-611423.05 800439.43
-611757.07 800542.37
-611756.65 800528.88
-611747.01 800464.18
-611786.62 800440.08
-611815.02 800422.86
-611810.72 800390.57
-611807.27 800342.79
-611831.38 800328.58
-611857.21 800315.24
-611874.86 800304.9
-611870.56 800264.87
-611866.05 800228.49
-611860.02 800177.69
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611659.44 800043.55
-Region  1
-  126
-606043.81 794756.25
-605960.2 794651.85
-605951.73 794533.44
-606044.86 794439.48
-606088.46 794395.46
-606092.9 794342.97
-606055.57 794266.73
-606017.56 794186.97
-606002.96 794158.05
-606001.05 794132.34
-606000.73 794105.98
-606031.53 793991.64
-606040.74 793983.7
-606010.26 793934.49
-605987.72 793959.25
-605979.46 793973.22
-605972.48 793986.56
-605964.54 794002.12
-605959.46 794017.68
-605955.33 794034.19
-605951.31 794050.19
-605947.82 794066.07
-605946.44 794095.82
-605950.64 794142.23
-605929.25 794165.99
-605877.39 794202.61
-605836.54 794230.13
-605787.83 794266.06
-605736.2 794301.6
-605718.64 794300.97
-605698.95 794298.01
-605669.11 794276.84
-605638.41 794257.17
-605597.77 794226.27
-605567.29 794201.72
-605533.42 794176.53
-605496.59 794150.94
-605469.4 794131.13
-605423.47 794095.78
-605366.32 794053.24
-605358.91 794068.48
-605351.5 794079.66
-605349.81 794106.97
-605356.15 794129.85
-605363.77 794152.07
-605380.82 794177.39
-605398.49 794198.42
-605363.14 794183.61
-605333.93 794179.16
-605308.11 794179.37
-605400.59 794320.49
-605440.6 794408.32
-605435.31 794415.1
-605420.49 794395.86
-605335.82 794455.12
-605328.23 794490.89
-605301.22 794523.39
-605278.4 794532.56
-605247.22 794531.33
-605215.84 794522.78
-605200.96 794508.31
-605178.67 794483.14
-605131.84 794420.99
-605129.3 794430.2
-605120.9 794469.95
-605039.29 794479.16
-604999.91 794502.34
-605006.26 794510.28
-605016.74 794528.06
-605030.4 794555.05
-604977.37 794550.6
-604960.86 794564.58
-604948.32 794574.58
-604935.93 794584.42
-604921.96 794595.54
-604902.91 794612.68
-604881 794628.24
-604851.15 794652.38
-604875.25 794665.02
-604917.38 794678.38
-604950.26 794694.82
-604969.78 794707.15
-604982.12 794718.46
-605001.64 794733.87
-605019.11 794746.2
-605036.58 794758.53
-605065.35 794763.67
-605060.21 794836.63
-605104.4 794842.8
-605171.19 794859.24
-605223.6 794877.74
-605242.1 794886.98
-605310.94 794918.84
-605359.24 794956.86
-605400.34 794990.77
-605440.42 795029.82
-605482.03 795075.55
-605501.55 795100.21
-605528.27 795138.23
-605562.18 795205.03
-605597.12 795190.64
-605644.39 795169.06
-605671.11 795215.3
-605706.05 795244.08
-605745.1 795258.46
-605772.84 795267.71
-605802.65 795268.74
-605830.39 795266.68
-605845.81 795264.63
-605876.64 795254.35
-605889.99 795247.16
-605920.82 795227.64
-605929.04 795222.5
-605950.62 795195.78
-605968.09 795161.87
-605975.29 795137.2
-605981.45 795110.49
-605967.07 795075.55
-605945.49 795046.77
-605939.84 795042.15
-606121.73 794977.41
-606226.72 794942.76
-606214.24 794890.26
-606211.47 794865.08
-606109.86 794808.58
-606043.81 794756.25
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605624.78 794678.27
-Region  1
-  54
-608216.91 794563.49
-608281.02 794310.73
-608289.79 794280.82
-608301.44 794264.95
-608315.19 794247.59
-608286.4 794218.34
-608238.14 794171.35
-608201.31 794148.77
-608157.07 794124.43
-608074.51 794079.33
-608007.84 794042.5
-608022.86 794003.76
-608044.24 793943.27
-608089.11 793928.87
-608101.6 793899.45
-608005.71 793900.94
-607996.61 793906.02
-607912.68 793861.22
-607893.53 793914.91
-607887.99 794066.15
-607885.24 794162.23
-607884.19 794278.61
-607874.04 794354.52
-607835.96 794476.42
-607785.52 794577.76
-607728.59 794654.98
-607666 794746.76
-607593.41 794859.99
-607559.76 794949.96
-607553.49 795019.71
-607554.95 795092.97
-607637.43 795146.82
-607649.56 795172.05
-607667.99 795186.61
-607700.01 795199.22
-607713.33 795282.43
-607738.56 795256.23
-607763.29 795224.23
-607822.28 795240.98
-607940.17 795129.1
-607986.27 795061.91
-608024.11 794994.96
-608082.7 794893.03
-608104.64 794858.21
-608176.76 794786.07
-608185.16 794778.47
-608191.51 794772.12
-608237.86 794727.66
-608201.67 794674.96
-608110.55 794712.11
-608133.66 794623.39
-608150.55 794546.98
-608182.94 794554.28
-608216.91 794563.49
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607935.93 794625.17
-Region  1
-  62
-602929.39 806601.71
-603026.47 806783.58
-603128.41 806869.26
-603159.47 806949.46
-603163.36 806959.5
-603173.47 806957.18
-603232.34 806961.58
-603306.44 806993.81
-603367.93 807063.37
-603403.44 807114.59
-603390.85 807165.85
-603363.78 807285.43
-603336.11 807431.59
-603340.62 807490.43
-603374.19 807511.29
-603495.1 807520.71
-603607.49 807524.5
-603642.33 807524.5
-603659.08 807522.69
-603696.18 807509.56
-603729.67 807500.06
-603823.34 807479.25
-603887.6 807461.15
-603952.53 807438.29
-604049.38 807404.8
-604142.6 807379.91
-604249.86 807355.05
-604300.55 807352.34
-604332.23 807352.79
-604345.8 807322.02
-604362.09 807316.58
-604484.74 807340.57
-604468.9 807316.58
-604457.59 807299.84
-604442.65 807279.93
-604430.43 807260.47
-604501.94 807272.23
-604507.82 807229.69
-604514.61 807201.18
-604507.82 807199.82
-604466.33 807193.13
-604318.8 807160.94
-604207.36 807134.43
-604091.48 807097.79
-603993.94 807052.92
-603929.96 807011.83
-603893.19 806971.36
-603859.55 806894.83
-603853.78 806835.99
-603866.96 806746.78
-603812.92 806684.97
-603750.01 806651.03
-603686.65 806619.8
-603664.48 806600.8
-603634.61 806523.86
-603594.78 806531.1
-603552.24 806540.6
-603459.97 806261.74
-603449.63 806093.46
-603148.77 805949.36
-602904.8 806561.85
-602929.39 806601.71
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603540.01 806857.79
-Region  1
-  95
-606754.57 795107.08
-606787.06 794969.8
-606801.13 794929.06
-606814.45 794898.9
-606860.21 794697.26
-606902.04 794522.11
-606907.81 794498.09
-606862.65 794535.88
-606808.21 794583.92
-606745.6 794635.64
-606690.51 794718.27
-606673.22 794738.13
-606646.63 794750.94
-606525.8 794757.94
-606469.49 794794.32
-606397.31 794821.41
-606300.58 794818.09
-606239.41 794846.45
-606214.24 794890.26
-606226.72 794942.76
-606231.81 794997.83
-606243.23 795068.72
-606263.63 795140.74
-606316.02 795209.95
-606382.05 795309.34
-606457.94 795426.54
-606502.07 795501.76
-606538.27 795567.15
-606544.3 795608.74
-606500.45 795702.35
-606484.02 795779.57
-606462.71 795893.97
-606492.87 795951.78
-606540.49 796028.94
-606576.37 796083.86
-606663.05 796137.84
-606725.28 796169.59
-606794.18 796198.8
-606740.2 796434.69
-606717.98 796537.83
-607028.5 796471.92
-607064.44 796334.52
-607155.24 796278.31
-607176.14 796278.31
-607532.49 796207.36
-607563.48 796281.58
-607590.14 796270.77
-607607.43 796205.19
-607641.3 796155.47
-607662.2 796138.18
-607663.64 796118
-607664.36 796092.06
-607627.21 795982.28
-607635.94 795927.94
-607656.08 795918.96
-607659.96 795810.28
-607655.63 795686.08
-607650.29 795586.62
-607665.07 795516.03
-607697.09 795435.98
-607724.01 795391.11
-607822.28 795240.98
-607763.29 795224.23
-607738.56 795256.23
-607713.33 795282.43
-607700.01 795199.22
-607667.99 795186.61
-607649.56 795172.05
-607637.43 795146.82
-607554.95 795092.97
-607560.77 795126.93
-607568.05 795163.32
-607431.71 795179.33
-607415.47 795179.57
-607289.83 795197.04
-607235.02 795165.02
-607160.56 795122.11
-607088.29 795083.31
-607075.44 795128.66
-607052.64 795211.12
-607031.07 795298.67
-606991.78 795444.17
-607000.52 795562.99
-606868.11 795487.33
-606784.68 795439.8
-606766.74 795515.46
-606742.97 795496.55
-606731.33 795474.24
-606732.79 795447.56
-606755.78 795371.68
-606824.17 795164.56
-606836.31 795092.86
-606837.03 795075.06
-606787.55 795092.52
-606754.57 795107.08
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607000.52 795606.63
-Region  1
-  48
-614879.39 800944.38
-614986.88 800896.27
-615106.74 800912.22
-615224.94 800910.57
-615340.95 800840.19
-615477.02 800851.43
-615527.6 800870.12
-615622.72 800850.33
-615659.55 800761.26
-615765.62 800663.34
-615823.98 800612.15
-615835.47 800602.58
-615909.62 800617.41
-615905.79 800662.86
-615937.37 800707.35
-615961.99 800774.57
-616012.22 800825.29
-616070.11 800826.72
-616141.39 800783.19
-616214.59 800747.3
-616207.42 800602.34
-616205.25 800511.2
-616204.04 800506.18
-615832.84 800427.71
-615754.36 800435.37
-615636.67 800410.97
-615224.27 800324.85
-614778.86 800232.53
-614776.47 800244.97
-614795.61 800309.08
-614727.67 800332.52
-614571.71 800382.28
-614596.53 800492.79
-614603.57 800578.54
-614605.6 800645.87
-614575.63 800754.43
-614564.64 800830.3
-614549.79 800884.18
-614575.63 800812.16
-614610.82 800794.56
-614658.1 800799.51
-614696.04 800838
-614723.53 800845.15
-614744.42 800840.75
-614772.46 800824.8
-614813.14 800828.65
-614843.66 800916.89
-614879.39 800944.38
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 615280.7 800598.9
-Region  1
-  31
-613632.92 796134.95
-613737.44 796105.19
-613943.72 795984.84
-614156.23 795978.47
-614187.98 795986.72
-614189.3 795528.17
-614189.3 795507.21
-614142.31 795509.12
-614026.74 795505.31
-614034.25 795367.97
-614037.4 795319.86
-614038.66 795304.67
-613990.67 795233
-613974.79 795222.53
-613913.3 795222.37
-613843.68 795221.1
-613674.69 795228.67
-613541.11 795528.28
-613515.71 795591.78
-613436.33 795687.99
-613444.59 795713.71
-613497.61 795705.77
-613489.78 795798.58
-613461.16 795829.59
-613430.39 795880.41
-613461.4 795888.99
-613496.7 795900.44
-613451.85 795972.01
-613473.34 796007.79
-613515.56 796168.35
-613632.92 796134.95
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613812.83 795692.53
-Region  1
-  57
-601975.02 789486.29
-602054.08 789457.08
-602103.29 789478.96
-602176.63 789505.63
-602194.56 789483.01
-602226.3 789436.69
-602269.34 789372.62
-602309.34 789309.75
-602348.21 789182.58
-602337.1 789163.22
-602408.86 789124.48
-602443.15 789107.02
-602458.71 789088.6
-602465.37 789079.39
-602400.61 789064.45
-602360.6 789029.21
-602295.19 788979.01
-602181.84 788893.6
-602069.72 788807.5
-602022.23 788751.79
-601968.48 788662.11
-601958.95 788676.08
-601934.19 788726.6
-601887.52 788807.57
-601854.81 788851.38
-601796.71 788903.77
-601756.71 788933.64
-601637.96 788934.28
-601589.7 788982.86
-601548.11 789027
-601485.1 789099.87
-601474.63 789107.17
-601426.68 789072.56
-601379.06 789041.77
-601303.17 788989.38
-601238.09 788945.88
-601222 788946.52
-601211.84 789006.42
-601188.34 789105.91
-601150.58 789222.13
-601125.1 789327.2
-601140.66 789321.49
-601157.8 789315.46
-601177.81 789300.85
-601195.59 789265.61
-601201.94 789281.48
-601290.84 789358
-601335.1 789389.72
-601413.05 789426.23
-601462.26 789436.7
-601520.37 789448.13
-601585.14 789464.64
-601631.81 789482.42
-601683.88 789499.28
-601823.58 789537.7
-601911.2 789509.15
-601975.02 789486.29
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 601816.08 789178.69
-Region  1
-  101
-608312.24 787960.41
-608222.18 787963.39
-608205.99 788003.4
-608069.46 788041.53
-608018.34 788045.97
-607979.29 788040.89
-607931.35 788066.29
-607819.27 788113.58
-607020.11 787632.27
-606715.72 787720.21
-606690.63 787727.93
-606757.79 787795.86
-606787.51 787825.39
-607238.52 788283.86
-607170.45 788363.9
-607180.58 788382.26
-607204.64 788396.82
-607232.49 788403.78
-607282.5 788427.21
-607324.92 788446.21
-607364.17 788482.29
-607357.85 788500.01
-607265.48 788598.11
-607221.19 788648.11
-607190.2 788696.84
-607173.13 788741.78
-607246.57 788796.22
-607308.61 788823.45
-607383.31 788852.58
-607443.44 788865.88
-607483.94 788858.92
-607557.99 788829.18
-607665.58 788804.51
-607758.62 788793.13
-607818.75 788800.1
-607870.66 788809.6
-607901.67 788814.04
-607920.65 788795.05
-607928.87 788770.37
-607945.95 788746.95
-607974.43 788727.33
-608010.5 788716.58
-608054.81 788727.35
-608118.11 788736.22
-608156.72 788745.72
-608199.13 788755.22
-608225.73 788778.01
-608245.35 788791.94
-608276.37 788792.57
-608316.24 788789.41
-608352.32 788789.42
-608375.75 788812.84
-608386.51 788833.1
-608396.66 788891.97
-608394.78 788925.51
-608361.24 788938.17
-608337.19 788966.65
-608304.3 789002.09
-608274.56 789033.1
-608249.88 789048.92
-608190.39 789051.44
-608169.51 789080.55
-608172.69 789121.06
-608180.3 789159.68
-608192.97 789183.1
-608210.7 789200.82
-608228.42 789211.59
-608255.01 789214.75
-608156.9 789212.21
-608059.43 789205.87
-607987.9 789200.16
-607937.98 789421.69
-608723.67 789957.29
-608828.71 789871.85
-608914.14 789833.89
-608988.19 789818.07
-609032.49 789799.09
-609087.54 789752.26
-609130.56 789712.39
-609251.44 789667.47
-609132.31 789326.28
-609132.93 789302.86
-609057.05 789205.24
-608993.64 789111.65
-608952.63 789043.51
-608789.68 788771.76
-608765.61 788726.82
-608701.04 788617.86
-608627.06 788502.11
-608573.47 788422.35
-608502.01 788323.22
-608436.6 788236.17
-608365.14 788138.55
-608333.44 788088.73
-608320.11 788043.17
-608312.78 788013.4
-608311.4 788005.32
-608313.18 787952.79
-608314.21 787858.88
-608313.59 787858.68
-608312.24 787960.41
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607494.84 788794.79
-Region  1
-  150
-606604.89 800835.65
-606597.67 800712.97
-606583.94 800698.49
-606536.31 800694.04
-606489.96 800687.06
-606468.2 800686.87
-606456.1 800705.88
-606453.8 800722.01
-606450.92 800750.24
-606430.27 800758.81
-606421.1 800738.14
-606435.7 800709.56
-606447.13 800682.89
-606459.2 800650.5
-606466.19 800621.92
-606466.82 800607.32
-606483.97 800596.52
-606480.79 800586.36
-606489.68 800546.99
-606505.24 800492.03
-606517.31 800444.4
-606520.48 800425.35
-606458.24 800380.9
-606324.25 800272.93
-606297.89 800293.53
-606233.75 800324.01
-606173.41 800352.59
-606102.29 800386.25
-606038.15 800394.5
-606012.11 800396.41
-605990.83 800384.7
-605952.09 800326.27
-605955.27 800260.22
-605952.73 800240.53
-605944.46 800228.08
-605930.81 800206.17
-605899.06 800243
-605871.12 800252.21
-605818.55 800281.9
-605788.89 800299.2
-605760.31 800316.66
-605746.02 800347.14
-605736.18 800367.46
-605713.97 800415.67
-605689.2 800406.15
-605662.85 800395.35
-605607.92 800371.86
-605586.02 800423.61
-605576.49 800451.55
-605563.79 800517.56
-605555.86 800569.66
-605495.85 800560.45
-605420.29 800547.11
-605405.37 800543.94
-605394.57 800540.44
-605355.7 800678.81
-605343.45 800790.35
-605489.12 801530.65
-605491.42 801573.28
-605953.46 801356.72
-606202.33 801371.07
-606186.78 801429.83
-606164.89 801507.03
-606149.62 801606.39
-606139.25 801639.23
-606123.99 801667.69
-606102.59 801713.77
-606100.95 801749.99
-606096.83 801804.3
-606061.44 801838.05
-606019.47 801858.62
-605976.68 801867.67
-605978.73 801989.91
-605910.42 801985.8
-605842.11 801985.8
-605804.25 801993.2
-605744.17 802017.89
-605600.97 802083.73
-605726.07 802462.33
-605736.77 802499.37
-605801.79 802471.39
-605834.71 802400.61
-605887.79 802299.79
-605929.76 802219.14
-605961.86 802191.15
-605984.08 802185.39
-606020.29 802186.17
-606030.17 802210.08
-606051.57 802267.69
-606263.45 802871.8
-606266.06 802882.25
-606375.57 802865.27
-606497.89 803102.08
-606646.08 803329.73
-606659.95 803315.35
-606681.38 803297.58
-606709.61 803274.06
-606727.48 803256.83
-606758.75 803230.67
-606755.09 803109.91
-606754.4 803002.72
-606752.95 802922.3
-606786.18 802919.89
-606867.33 802915.33
-606867.82 802800.71
-606921.75 802688.02
-606920.79 802653.83
-606912.12 802624.45
-606986.53 802470.56
-606945.59 802423.37
-606931.87 802407.22
-606983.88 802353.76
-607010.51 802325.41
-607040.71 802295.49
-607067.67 802267.55
-607095.4 802205.07
-607147.88 802206.48
-607096.29 802200.8
-607070.82 802183.82
-607063.85 802179.88
-607056.57 802176.55
-607046.24 802170.98
-607000.49 802212.88
-606967.26 802248.04
-606832.89 802250.44
-606831.34 802205.33
-606828.98 802035.6
-606819.52 802022.83
-606787.85 801976.5
-606729.22 801892.81
-606689.14 801838.24
-606668.4 801797.91
-606660.34 801749.52
-606651.7 801623.35
-606623.47 801527.72
-606612.23 801477.31
-606604.17 801431.22
-606589.19 801343.65
-606573.34 801293.84
-606541.66 801238.53
-606537.05 801128.5
-606535.6 801037.15
-606534.45 801022.75
-606581.69 800998.55
-606596.1 800991.06
-606609.35 800980.69
-606617.99 800972.05
-606645.9 800930.53
-606641.51 800841.38
-606604.89 800835.65
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606205.27 801600.42
-Region  1
-  125
-606530.11 796788.97
-606374.14 796774.06
-606296.4 796739.11
-606253.8 796703.58
-606239.19 796729.01
-606247.45 796749
-606257.93 796768.69
-606266.04 796777.67
-606222.64 796809.69
-606250.16 796848.48
-606241.28 796960.92
-606162.85 796975.84
-606103.48 796992.15
-606073.02 797041.42
-606064.25 797055.61
-606062.09 797066.05
-606058.08 797085.44
-606052.17 797114.08
-606048.37 797132.45
-606049.01 797139.44
-606046.02 797219.46
-606001.57 797322.96
-605991.73 797393.15
-605977.76 797435.06
-605922.84 797479.53
-605849.49 797506.2
-605782.18 797530.65
-605724.4 797551.88
-605659.63 797556.96
-605605.98 797542.36
-605551.37 797508.67
-605503.11 797475.97
-605473.58 797454.06
-605457.67 797442.05
-605446.24 797435.7
-605429.09 797403.63
-605459.89 797330.6
-605447.51 797307.46
-605417.67 797320.79
-605332.58 797284.91
-605326.54 797396.69
-605314.16 797449.4
-605285.1 797513.93
-605257.41 797574.66
-605349.62 797697.68
-605364.36 797748.14
-605367.04 797793.25
-605365.46 797816.69
-605362.33 797840.8
-605344.12 797902.66
-605322.95 797957.39
-605314.96 797978.97
-605311.76 797995.34
-605296.58 798050.87
-605292.59 798094.41
-605293.19 798105.56
-605292.56 798114.77
-605291.92 798120.48
-605313.67 798198.46
-605334.48 798247.84
-605357.34 798284.04
-605372.9 798301.19
-605419.74 798343.58
-605471.82 798381.37
-605544.69 798435.15
-605598.36 798471.99
-605656.79 798513.9
-605728.08 798570.62
-606030.4 798778.19
-606093.91 798759.13
-606044.05 798724.21
-606072.95 798693.72
-606089.1 798675.3
-606117.81 798645.57
-606140.03 798603.02
-606173.05 798582.07
-606173.37 798556.66
-606199.4 798566.51
-606203.21 798572.86
-606229.88 798571.59
-606253.06 798560.16
-606249.63 798531.68
-606255.49 798506.71
-606272.84 798467.66
-606282.27 798433.14
-606287.99 798429.01
-606287.16 798404.74
-606292.75 798395
-606306.08 798354.35
-606280.68 798346.42
-606275.6 798316.25
-606334.97 798193.05
-606349.89 798190.51
-606401.96 798083.19
-606410.22 798081.6
-606442.28 798020
-606459.1 797987.33
-606514.99 797912.68
-606538.89 798070.84
-606648.14 798056.7
-606697.81 797966.19
-606753.8 797924.82
-607597.08 797900.34
-607694.73 797935.61
-607781.33 797965.48
-607849.83 797990.5
-607956.31 797550.18
-608026.98 797228.93
-607964.38 797175.46
-607917.31 797084.35
-607884.88 797034.62
-607848.13 796969.77
-607793.36 796916.44
-607636.84 796832.38
-607554.93 796794.28
-607471.42 796764.74
-607414.27 796749.18
-607329.17 796728.9
-607254.24 796698.42
-607183.44 796683.19
-607042.79 796660.02
-606944.37 796663.83
-606824.67 796695.58
-606614.16 796765.8
-606530.11 796788.97
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606622.85 797570.72
-Region  1
-  62
-611272.15 802077.31
-611280.56 802105.1
-611126.86 802194.96
-610982.54 802277.37
-610953.8 802294.96
-611008.1 802386.1
-611033.77 802430.32
-611064.94 802485.2
-611090.01 802530.6
-611112.37 802570.58
-611004.64 802550.25
-610948.4 802541.44
-610938.23 802552.28
-610911.81 802649.85
-610905.71 802674.25
-611392.22 802817.89
-611393.74 802793.99
-611400.19 802733.13
-611413.22 802593.61
-611430.26 802468.05
-611524.9 802459
-611543.47 802491.15
-611559.32 802505.19
-611580.6 802520.58
-611618.64 802536.88
-611750.86 802581.71
-611741.35 802607.97
-611720.98 802633.33
-611768.07 802665.93
-611858.41 802723.22
-611918.65 802766.39
-611997.2 802801.75
-612039.32 802810.35
-612137.13 802816.69
-612157.5 802794.5
-612194.64 802753.75
-612215.01 802715.26
-612250.79 802691.71
-612281.35 802576
-612311.24 802502.64
-612327.31 802440.83
-612333.65 802358.87
-612317.8 802243.81
-612248.3 802014.91
-611662.8 801774.48
-611610.72 801731.01
-611574.49 801666.71
-611501.36 801641.1
-611449.43 801622.15
-611416.63 801610.81
-611369 801613.99
-611328.67 801633.68
-611293.74 801669.88
-611336.92 801679.4
-611394.08 801694.96
-611393.13 801714.65
-611385.98 801808.52
-611378.84 801918.57
-611373.6 801963.47
-611357.72 801989.2
-611326.13 802021.43
-611272.15 802077.31
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611679.53 802293.6
-Region  1
-  116
-606583.22 792079.77
-606699.48 792175.34
-606720.16 792204.58
-606738.35 792255.57
-606746.2 792296.23
-606749.05 792351.85
-606745.49 792388.94
-606744.06 792413.9
-606708.26 792481.99
-606716.52 792485.8
-606726.04 792490.56
-606743.82 792500.72
-606764.78 792511.83
-606788.59 792525.53
-606813.99 792540.46
-606845.42 792481.4
-606874.95 792494.42
-606908.28 792512.52
-606941.3 792530.93
-607007.02 792567.76
-607036.87 792584.27
-607084.81 792610.98
-607128.31 792634.79
-607182.6 792666.54
-607183.43 792515.49
-607172.02 792456.62
-607170.1 792410.42
-607151.39 792293.05
-607140.28 792224.32
-607105.99 792119.35
-607089.48 792036.16
-607078.78 791940.11
-607064.4 791846.6
-607157.11 791869.46
-607253.63 791872.3
-607339.68 791856.74
-607401.91 791871.35
-607435.24 791894.5
-607456.51 791930.7
-607488.58 791916.73
-607540.97 791922.43
-607594.94 791924.01
-607591.77 791813.56
-607570.82 791693.25
-607557.16 791620.54
-607547 791563.07
-607538.43 791526.56
-607534.3 791483.71
-607482.87 791473.87
-607451.43 791467.2
-607428.89 791458.63
-607412.7 791447.83
-607389.84 791426.86
-607371.11 791396.38
-607352.7 791388.76
-607282.85 791357.01
-607216.81 791324.63
-607189.51 791307.77
-607205.11 791260.97
-607172.36 791264.27
-607131.09 791263
-607065.68 791266.17
-607039.96 791227.75
-606999 791157.58
-607051.39 791149.99
-607096.82 791112.84
-607095.84 791067.76
-607067.27 791013.78
-607031.07 790952.51
-607009.17 790909.97
-607015.83 790870.57
-607052.36 790837.23
-606951.38 790793.41
-606844.07 790748.64
-606757.34 790358.95
-606742.41 790291.96
-606685.77 790303.72
-606640.65 790313.9
-606598.01 790324.35
-606611.37 790385.22
-606601.21 790430.95
-606598.03 790457.93
-606594.86 790479.84
-606582.47 790475.05
-606542.78 790461.4
-606474.06 790560.31
-606451.51 790604.44
-606372.46 790671.13
-606277.52 790696.21
-606242.6 790698.12
-606179.73 790660.01
-606166.36 790615.72
-606161.49 790601.96
-606158.14 790585.72
-606054.95 790628.44
-605998.43 790656.59
-605964.99 790680.45
-605914.51 790740.51
-605880.53 790820.69
-605858.47 790927.44
-605961.03 790960.46
-605875.94 791035.71
-605911.76 791060.03
-605955.57 791087.34
-606062.26 791187.8
-606298.48 791376.39
-606355.99 791423.1
-606321.07 791450.09
-606278.52 791480.25
-606287.09 791513.59
-606332.17 791631.63
-606333.44 791669.09
-606328.36 791727.51
-606317.57 791829.14
-606318.21 791904.04
-606583.22 792079.77
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606730.28 791424.24
-Region  1
-  57
-605197.47 802712.88
-605736.77 802499.37
-605726.07 802462.33
-605600.97 802083.73
-605744.17 802017.89
-605804.25 801993.2
-605842.11 801985.8
-605910.42 801985.8
-605978.73 801989.91
-605976.68 801867.67
-606019.47 801858.62
-606061.44 801838.05
-606096.83 801804.3
-606100.95 801749.99
-606102.59 801713.77
-606123.99 801667.69
-606139.25 801639.23
-606149.62 801606.39
-606164.89 801507.03
-606186.78 801429.83
-606202.33 801371.07
-605953.46 801356.72
-605491.42 801573.28
-605494.88 801629.17
-605496.03 801671.22
-605498.05 801731.96
-605505.1 801786.2
-605529.16 801920.35
-605521.67 801999.28
-605493.15 802073.35
-605461.89 802151.24
-605397.82 802244.62
-605344.91 802320.55
-605301.19 802384.39
-605268.98 802427.53
-605213.19 802445.94
-605180.98 802424.08
-605140.43 802395.04
-605096.14 802362.82
-605078.88 802356.5
-604900 802428.4
-604876.76 802452.81
-604854.1 802480
-604848.01 802523.91
-604842.26 802578.27
-604837.81 802684.65
-604833.02 802720.31
-604864.08 802734.11
-604906.07 802747.34
-605001.44 802789.73
-605020.78 802796.52
-605035.42 802804.89
-605047.96 802787.11
-605062.08 802771.95
-605085.08 802759.93
-605115.4 802746.86
-605197.47 802712.88
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605568.21 802069.14
-Region  1
-  54
-615175.36 796495.68
-614878.82 796162.9
-614751.22 796043.24
-614661.75 796008.62
-614566.8 796001.64
-614493.37 795988.34
-614444.01 795989.6
-614398.43 795981.36
-614361.33 795979.74
-614335.93 795978.47
-614325.14 795982.91
-614323.87 795994.34
-614316.25 796024.19
-614291.48 796074.35
-614258.46 796128.96
-614224.68 796190.26
-614218.67 796287.11
-614241.83 796324.26
-614337.72 796422.05
-614349.79 796455.71
-614338.48 796502.58
-614235.89 796588.25
-614177.22 796600.13
-614045.66 796619.74
-614012.18 796648.53
-613987.82 796701.99
-614713.69 796781.16
-614662.94 797266.24
-614646.46 797422.02
-614642.22 797456.94
-614637.9 797489.34
-614665.09 797462.48
-614702.18 797416.02
-614795.81 797380.73
-614845.5 797356.98
-614907.08 797317.73
-614921.64 797303.34
-614935.14 797287.9
-615054.06 797163.56
-615144.71 797072.87
-615230.92 796976.78
-615238.22 796972.32
-615203.93 796935.49
-615147.42 796926.28
-615092.81 796917.07
-615109.32 796891.63
-615116.47 796724.56
-615115.04 796618.24
-615151.86 796582.68
-615162.34 796563.31
-615172.18 796556.01
-615256.32 796579.82
-615216 796537.91
-615175.36 796495.68
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 614709.24 796609.83
-Region  1
-  126
-614514.98 794648.74
-614577.21 794691.26
-614644.52 794735.07
-614680.08 794755.39
-614718.81 794778.25
-614749.59 794802.01
-614734.35 795035.69
-614728.68 795097.76
-614820.12 795099.03
-614897.59 795100.93
-614957.28 795100.93
-615067.13 795102.84
-615125.55 795050.77
-615296.7 794902.87
-615437.67 794783.49
-615700.09 795183.39
-615811.46 795117.57
-615896.88 795038.47
-615936.08 794937.2
-615955.67 794842.89
-615967.68 794795.42
-616016.4 794765.68
-616186.65 794731.52
-616313.24 794722.05
-616405.63 794693.58
-616426.78 794689.46
-616438.76 794667.95
-616381.3 794595.13
-616353.85 794551.65
-616387.2 794501.11
-616373.68 794467.62
-616304.19 794387.89
-616288.23 794273.9
-616250.89 794193.24
-616251.51 794131.48
-616235.92 794104.76
-616185.84 794096.16
-616138.57 794133.33
-616112.76 794141.01
-616092.79 794158.83
-616049.03 794152.83
-616020.76 794134.71
-615893.87 794071.72
-615870.84 794024.4
-615853.33 794006.88
-615836.12 794005.04
-615819 794020.1
-615805.79 794044.68
-615775.68 794033.31
-615777.34 794011.03
-615764.13 793998.44
-615726.96 793967.71
-615721.12 793943.13
-615713.94 793928.84
-615672.15 793900.88
-615631.6 793881.52
-615617.46 793871.08
-615611.63 793845.88
-615615.31 793803.79
-615612.87 793780.74
-615608.26 793754.62
-615591.67 793735.57
-615554.18 793709.15
-615534.52 793697.78
-615520.69 793675.04
-615488.59 793644.47
-615474.45 793635.25
-615418.53 793584.86
-615384.32 793570.89
-615305.98 793581.33
-615285.7 793580.1
-615232.85 793521.11
-615211.2 793505.9
-615194.61 793504.05
-615165.12 793482.24
-615139.92 793468.72
-615108.89 793464.72
-615058.19 793461.96
-615006.12 793446.44
-614991.37 793435.38
-614973.55 793398.82
-614956.04 793375.16
-614913.2 793337.83
-614897.84 793298.81
-614888.62 793274.23
-614877.74 793246.42
-614829.5 793229.83
-614792.02 793180.67
-614774.51 793130.58
-614719.49 793091.31
-614673.27 793064.72
-614650.03 793062.07
-614632.21 793047.02
-614607.32 793037.18
-614585.5 793015.98
-614568.91 793005.84
-614505.35 793007.99
-614140.01 793315.25
-614104.9 793762.12
-614044.1 793876.07
-614045.23 794001.09
-614005.43 794074.57
-613962.75 794102.68
-613937.09 794138.97
-613904.34 794219.06
-613885.76 794240.74
-613863.19 794250.04
-613789.27 794248.37
-613703.42 794248.37
-613682.62 794255.45
-613578.19 794352.36
-613566.04 794432.95
-613674.25 794459.44
-613756.16 794489.29
-613813.95 794477.86
-613871.09 794467.71
-614000 794442.94
-614106.68 794423.26
-614231.77 794399.13
-614298.45 794434.69
-614335.27 794470.28
-614377.18 794493.77
-614497.83 794510.92
-614544.82 794532.51
-614570.86 794568.07
-614514.98 794648.74
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 615028.52 794173.94
-Region  1
-  37
-604974.53 794215.55
-605131.84 794420.99
-605178.67 794483.14
-605200.96 794508.31
-605215.84 794522.78
-605247.22 794531.33
-605278.4 794532.56
-605301.22 794523.39
-605328.23 794490.89
-605335.82 794455.12
-605420.49 794395.86
-605435.31 794415.1
-605440.6 794408.32
-605400.59 794320.49
-605308.11 794179.37
-605333.93 794179.16
-605363.14 794183.61
-605398.49 794198.42
-605380.82 794177.39
-605363.77 794152.07
-605356.15 794129.85
-605349.81 794106.97
-605351.5 794079.66
-605358.91 794068.48
-605366.32 794053.24
-605322.08 794031.44
-605159.52 794027.89
-605100.26 794029.98
-605049.68 794036.54
-605007.56 794049.02
-604973.69 794055.37
-604975.45 794060.25
-604990.93 794090.6
-605012.73 794129.1
-605051.53 794195.59
-605011.2 794204.96
-604974.53 794215.55
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605208.06 794251
-Region  1
-  37
-616627.44 806391.39
-616614.95 806345.02
-616605.44 806301.62
-616637.55 806276.65
-616661.92 806239.79
-616667.87 806220.17
-616702.94 806189.25
-616765.96 806108.39
-616782.01 806095.91
-616792.45 806027.25
-616778.46 805961.46
-616771.45 805915.29
-616765.04 805838.11
-616763.33 805745.76
-616759.71 805682.88
-616740.71 805692.38
-616706.68 805709.09
-616666.18 805722.39
-616618.08 805730
-616572.51 805735.09
-616540.25 805755.98
-616467.51 805815.48
-616355.59 805931.29
-616262.63 806023.7
-616093.49 806167
-616349.92 806654.27
-616278.52 806751.56
-616330.59 807086.84
-616869.07 806949.68
-617149.74 806564.87
-616660.79 806620.75
-616660.79 806557.25
-616672.22 806505.18
-616696.35 806469.62
-616670.95 806457.02
-616642.3 806438.36
-616627.44 806391.39
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 616548.22 806436.98
-Region  1
-  44
-610349.98 798233.01
-609977.59 798430.62
-609842.29 798504.94
-609794.22 798505.1
-609787.22 799131.61
-609809.37 799133.47
-609824.38 799133.88
-609843.8 799131.75
-609898.85 799132.25
-610002.91 799197.47
-610092.85 799254.65
-610104.08 799232.51
-610140.2 799139.3
-610128.67 799112
-610182.98 799004.59
-610199.36 798978.2
-610223.32 798946.65
-610253.96 798916.01
-610277.48 798890.71
-610235.61 798880.7
-610202.55 798864.92
-610208.01 798845.2
-610213.92 798822.87
-610231.51 798761.29
-610216.35 798755.83
-610201.18 798749.46
-610189.35 798744.91
-610176.3 798738.84
-610167.35 798731.11
-610234.39 798709.27
-610255.33 798688.34
-610265.34 798651.02
-610264.88 798624.15
-610261.54 798578.35
-610258.05 798529.96
-610258.05 798499.01
-610290.36 798463.07
-610316.15 798439.72
-610275.2 798400.58
-610254.87 798381.17
-610218.01 798346.74
-610210.12 798339.77
-610188.89 798320.38
-610349.98 798233.01
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610024.55 798770.02
-Region  1
-  58
-608337.45 798220.41
-608212.99 798143.39
-608127.21 798093.01
-607893.13 798006.57
-607849.83 797990.5
-607781.33 797965.48
-607694.73 797935.61
-607690.83 797945.13
-607684.34 797961.15
-607681.52 797968.75
-607677.85 797979.85
-607666.16 798042.64
-607657.5 798078.58
-607653.6 798091.57
-607647.76 798114.29
-607571.76 798389.94
-607593.84 798395.57
-607623.07 798401.82
-607739.98 798430.4
-607712.91 798540.59
-607699.22 798592.87
-608501.68 798601.09
-608494.6 798614.35
-608489.43 798623.61
-608480.44 798640.22
-608468.46 798660.1
-608483.44 798668.54
-608507.54 798681.47
-608535.59 798697.26
-608522.79 798720.41
-608507.81 798744.11
-608494.87 798768.2
-608483.98 798785.63
-608461.65 798825.67
-608503.12 798822.87
-608543 798818.42
-608596.79 798807.64
-608632.23 798805.09
-608706.07 798793.14
-608731.13 798788.79
-608765.57 798783.5
-608883.77 798788.94
-608885.94 798568.09
-608931.03 798568.31
-608963.57 798554.33
-609104.37 798482.7
-609039.43 798385.23
-609026.36 798363.44
-608946.96 798395.18
-608888.68 798407.16
-608817.46 798411.42
-608734.4 798399.98
-608623.44 798364.13
-608563.92 798345.82
-608510.72 798324.33
-608466.68 798301.74
-608418.34 798271.07
-608337.45 798220.41
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608241.53 798404.5
-Region  1
-  86
-602511.84 797994.81
-602684.85 797838.27
-602713.89 797813.35
-602752 797779.05
-602803.44 797732.38
-602818.68 797721.81
-602809.94 797656.99
-602806.61 797627.59
-602793.91 797598.69
-602788.83 797574.24
-602784.38 797561.86
-602776.13 797540.26
-602755.65 797507.39
-602724.53 797473.73
-602680.07 797435.94
-602621.78 797389.9
-602614.95 797376.23
-602609.85 797313.66
-602608.37 797297.15
-602607.1 797276.41
-602602.23 797239.58
-602584.45 797260.32
-602545.93 797312.81
-602520.12 797347.87
-602482.87 797434.45
-602478 797397.41
-602472.92 797375.61
-602454.93 797367.99
-602428.26 797385.35
-602418.31 797396.78
-602401.38 797411.38
-602362.02 797440.8
-602337.25 797461.97
-602290.89 797519.12
-602285.18 797543.89
-602262.95 797644.18
-602240.09 797733.71
-602229.3 797768.64
-602220.37 797785.24
-602235.93 797818.09
-602252.36 797853.54
-602278.73 797909.74
-602294.29 797945.18
-602255.82 797934.81
-602220.8 797920.98
-602149.04 797897.2
-602111.43 797888.12
-602102.58 797869.75
-602077.51 797817.88
-602061.3 797779.62
-602047.9 797680.19
-601954.96 797722.55
-601941.42 797725.4
-601931.61 797721.69
-601906.97 797695.75
-601873.25 797651.66
-601856.83 797641.28
-601840.67 797640.05
-601829.16 797642.58
-601818.35 797655.98
-601843.43 797701.37
-601866.77 797744.17
-601889.68 797786.53
-601901.14 797812.26
-601912.38 797847.27
-601894.22 797869.75
-601886.01 797877.97
-601878.66 797884.02
-601870.45 797890.5
-601848.4 797905.2
-601852.92 797978.9
-601877.56 797998.79
-601916.74 798022.78
-601964.12 798073.22
-601973.99 798086.81
-602060.35 798116.65
-602081.31 798126.18
-602202.47 798177.56
-602347.06 798230.09
-602444.21 798266.28
-602441.67 798044.66
-602441.67 798011.32
-602465.8 798035.77
-602487.71 798017.67
-602501.36 798004.97
-602511.84 797994.81
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 602363.24 797793.9
-Region  1
-  45
-614375.4 803320.19
-614393.76 803279.85
-614402.84 803247.25
-614417.77 803211.4
-614446.82 803226.16
-614472.04 803192.64
-614501.97 803154.38
-614513.2 803139.53
-614557.35 803107.66
-614570.96 803097.7
-614594.19 803079.78
-614594.52 803071.15
-614600.42 803044.39
-614609.68 802985.91
-614591.45 802974.03
-614548.6 802950.29
-614512.12 802942.18
-614484.91 802941.02
-614455.95 802943.92
-614399.5 802950.01
-614396.03 802981.28
-614160.95 802958.12
-614132.22 802933.73
-614045.69 802908.59
-614003.74 802890.67
-613950.35 802869.57
-613844.13 802891.92
-613776.82 802905.82
-613696.34 802922.5
-613644.38 802916.45
-613640.88 803009.83
-613672.54 803098.52
-613684.12 803138.48
-613716.42 803260.38
-613749.53 803345.94
-613745.06 803370.02
-614190.86 803678.22
-614205.12 803651.39
-614220.74 803621.37
-614256.61 803555.97
-614285.61 803496.51
-614314.24 803440.29
-614339.26 803393.78
-614359.8 803351.49
-614375.4 803320.19
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 614083.75 803200.32
-Region  1
-  89
-609893.46 805919.58
-609661.27 806143.08
-608926 807117.86
-608872.05 807211.06
-608951.84 807272.63
-609013.28 807310.86
-609069.04 807343.41
-609116.84 807376.68
-609162.7 807400.92
-609229.63 807433.6
-609276.01 807456.79
-609349.54 807497.08
-609384.33 807532.39
-609419.11 807577.72
-609474.98 807649.93
-609532.17 807722.91
-609583.3 807787.21
-609648.39 807875.45
-609705.84 807954.51
-609731.66 807954.51
-609751.42 807893.94
-609758.54 807871.24
-609767.18 807835.73
-609805.45 807718.92
-609865.53 807422.14
-609873.29 807362.54
-609865.77 807296.4
-609849.78 807254.94
-609971.43 807217.31
-609976.34 807210.21
-609989.7 807191.94
-610008.25 807165.48
-610106.67 807017.93
-610130.12 806987.93
-610114.85 806970.2
-610105.85 806957.93
-610097.74 806946.04
-610083.77 806913.15
-610078.1 806897.38
-610077.15 806856.06
-610076.88 806829.33
-610078.24 806790.6
-610094.2 806745.74
-610107.57 806697.73
-610176.09 806676.39
-610302.34 806646.63
-610451.45 806764.68
-610478.51 806853.55
-610502.76 806953.5
-610534.2 807084.6
-610539.26 807162.14
-610524.87 807263.39
-610508.35 807318.28
-610490.76 807344.39
-610457.73 807380.62
-610471.58 807396.08
-610545.86 807419.04
-610595.26 807438.63
-610668.14 807465.89
-610724.7 807504.24
-610800.31 807524.02
-610859.94 807545.39
-610814.91 807443.58
-610800.91 807381.59
-610810.31 807303.13
-610823.5 807227.84
-610839.86 807148.75
-610877.72 807050.03
-610894.22 807002.12
-610929.27 806921.15
-610950.3 806882.34
-610976.2 806812.55
-610994.52 806714.04
-611001.77 806649.59
-611008.83 806584.13
-611016.3 806512.83
-611020.62 806429.95
-611033.2 806369.47
-611026.72 806243.95
-611014 806193.97
-610997.49 806157.92
-610968.24 806104.15
-610942.29 806050.4
-610865.94 805981.61
-610761.23 805931.99
-610207.84 805800.62
-610193.73 805814.3
-610094.02 805720.96
-609893.46 805919.58
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610047.37 806718.97
-Region  1
-  50
-615164.91 797967.27
-615119.29 797933.13
-615093.92 797891.39
-615081.18 797826.79
-615075.46 797769.01
-615070.38 797743.61
-615038.61 797705.41
-615003.07 797659.86
-614972.59 797630.01
-614892.17 797531.51
-614866.09 797475.11
-614883.55 797429.39
-614948.95 797342.71
-614954.98 797310.96
-614935.14 797287.9
-614921.64 797303.34
-614907.08 797317.73
-614845.5 797356.98
-614795.81 797380.73
-614702.18 797416.02
-614665.09 797462.48
-614637.9 797489.34
-614620.77 797650.59
-614622.03 797691.58
-614627.11 797716.35
-614674.67 797730.27
-614710.94 797738.58
-614697.6 797805.26
-614681.73 797881.47
-614590.91 797871.94
-614505.81 797866.86
-614342.29 797916.73
-614320.06 797912.92
-614292.45 797911.34
-614198.47 798095.49
-614119.96 798258.97
-614601.96 798190.07
-614982.73 798259.75
-615119.27 798565.21
-615307.25 798479.48
-615319.95 798473.77
-615307.25 798396.92
-615294.49 798324.66
-615285.34 798278.51
-615276.45 798228.98
-615261.97 798141.83
-615246.06 798074.15
-615240.89 798036.56
-615198.34 797999.73
-615164.91 797967.27
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 614811.38 797990.12
-Region  1
-  52
-603781.88 787427.05
-604338.38 787582.99
-604323.93 787235.51
-604431.28 787271.65
-604444.57 787260.89
-604469.22 787179.87
-604465.42 787164.68
-604377.42 787119.73
-604343.57 787097.13
-604303.35 787070.98
-604289.59 787063.47
-604324.52 787020.93
-604342.93 786996.16
-604351.82 786964.41
-604353.41 786940.91
-604358.8 786877.73
-604359.44 786857.09
-604359.76 786842.8
-604359.12 786823.43
-604366.11 786788.83
-604382.61 786727.24
-604408.32 786625.95
-604415.63 786590.38
-604417.21 786550.06
-604410.23 786518.3
-604396.89 786495.76
-604345.46 786479.88
-604286.65 786454.47
-604243.61 786435.48
-604224.49 786430.67
-604192.42 786472.9
-604171.15 786513.23
-604123.21 786567.87
-604029.23 786636.14
-603905.72 786716.15
-603837.9 786834.31
-603832.35 786844.31
-603820.34 786879.12
-603819.71 786882.29
-603792.66 786931.66
-603732.65 786987.22
-603662.16 787048.18
-603604.06 787153.62
-603605.65 787162.83
-603581.52 787196.2
-603591.04 787220.65
-603601.2 787244.78
-603613.9 787270.5
-603633.9 787307.97
-603664.7 787351.79
-603705.03 787389.58
-603781.88 787427.05
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604069.88 787054.99
-Region  1
-  42
-608140.71 796754.3
-608134.94 796798.98
-608170.25 796925.09
-608150.07 796929.41
-608122.69 796921.48
-608096.75 796969.77
-608062.16 797103.8
-608181.06 797218.38
-608314 797314.33
-608446.46 797355.33
-608519.61 797359.55
-608582.44 797335.17
-608694.71 797258.51
-608765.53 797253.82
-608831.65 797204.11
-608960.15 797175.03
-609101.56 797154.13
-609258.44 797212.05
-609267.23 797215.74
-609056.02 796409.29
-609186.35 796036.26
-609186.66 796035.38
-609187.49 796032.42
-609184.42 796030.28
-609033.04 795998.26
-608933.57 795976.21
-608820.53 795950.01
-608726.4 795929.63
-608304.77 795846.18
-608201.59 796258.16
-608188.62 796271.13
-608147.55 796335.99
-608203.76 796348.96
-608231.14 796355.44
-608248.8 796360.12
-608235.11 796425.69
-608179.98 796643.68
-608173.49 796678.99
-608179.98 796704.93
-608187.18 796727.27
-608189.34 796740.24
-608140.71 796754.3
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608644 796625.62
-Region  1
-  34
-604058.87 799037.28
-604019.65 799104.12
-603992.98 799141.27
-603968.68 799176.96
-603947.41 799224.9
-603941.22 799287.65
-603936.77 799341.32
-603919.94 799404.51
-603890.57 799440.57
-603847.39 799462.16
-603774.98 799489.79
-603722.27 799512.02
-603704.17 799519
-603685.28 799538.19
-603704.65 799603.64
-603720.52 799628.73
-603792.92 799665.88
-603876.44 799664.93
-603885.65 799656.67
-603899.78 799640.61
-603929.63 799619.34
-603968.37 799603.78
-604029.34 799577.42
-604076.02 799548.84
-604089.98 799530.56
-604101.76 799513.96
-604151.09 799398.74
-604298.09 799081.15
-604221.45 799108.41
-604150.64 798931.22
-604085.93 798775.84
-604078.3 798817.12
-604069.82 798845.94
-604058.87 799037.28
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604021.55 799319.12
-Region  1
-  64
-611836.91 803049.44
-611743.75 803112.55
-611602.89 803203.18
-611618.26 803232.97
-611592.49 803249.77
-611550.26 803274.61
-611396.64 803355.97
-611861.82 803792.58
-611838.19 803870.23
-611802.02 803906.88
-611734.51 803916.05
-611575.6 803817.44
-611592.96 803889.77
-611529.79 803864.7
-611399.57 804075.41
-611434.29 804083.56
-611448.75 804088.38
-611460.33 804092.24
-611475.28 804097.06
-611491.67 804102.37
-611504.21 804107.19
-611525.67 804114.19
-611542.55 804119.97
-611562.32 804124.8
-611588.36 804132.51
-611596.56 804153.25
-611614.41 804197.62
-611633.7 804240.06
-611648.16 804271.41
-611665.04 804309.5
-611673.72 804332.65
-611720.34 804342.37
-611756.99 804347.19
-611774.92 804341.83
-611787.08 804344.95
-611807.35 804353.16
-611839.79 804400.28
-612356.75 804434.09
-612351.85 804418.26
-612319.5 804328.88
-612244.41 804146.74
-612203.22 804053.08
-612124.68 803857.46
-612301.74 803835.72
-612306.49 803739.99
-612296.76 803712.12
-612304 803613.86
-612327.55 803554.54
-612417.88 803563.35
-612438.26 803532.11
-612309.89 803295.5
-612373.74 803241.16
-612410.41 803271.04
-612481.06 803316.78
-612563.24 803365.88
-612527.92 803285.74
-612531.55 803254.97
-612014.43 802994.12
-611992.69 802985.07
-611971.85 802976.99
-611950.57 802967.93
-611916.61 803005.06
-611904.38 803010.95
-611836.91 803049.44
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611955.73 803697.81
-Region  1
-  61
-612124.68 803857.46
-612203.22 804053.08
-612244.41 804146.74
-612319.5 804328.88
-612351.85 804418.26
-612356.75 804434.09
-612380.14 804510.31
-612390.86 804601.06
-612417.38 804646.14
-612457.28 804715.67
-612474.15 804736.89
-612547.32 804802.54
-612676.53 804879.46
-612711.24 804892.23
-612778.5 804900.67
-612824.42 804893.16
-612844.67 804862.31
-612839.85 804837.24
-612853.35 804818.43
-612877.94 804818.92
-612905.42 804819.88
-612942.39 804822.28
-612967.61 804822.29
-612987.38 804818.92
-612958.93 804728.28
-612785.14 804182.62
-612964.88 804103.62
-612960.63 804072.61
-612988.13 804069.36
-613024.21 804053.29
-613049.49 804022.91
-613273.73 803659.74
-613146.94 803598.16
-613055.01 803551.62
-613060.9 803560.58
-613063.16 803566.91
-613069.5 803583.22
-613071.77 803596.8
-613068.61 803627.49
-613050.91 803646.47
-613005.99 803661.05
-612987.32 803671.31
-612979.62 803683.99
-612810.72 803675.39
-612814.79 803591.62
-612811.17 803554.03
-612792.15 803519.17
-612762.49 803491.79
-612563.24 803365.88
-612481.06 803316.78
-612410.41 803271.04
-612373.74 803241.16
-612309.89 803295.5
-612438.26 803532.11
-612417.88 803563.35
-612327.55 803554.54
-612304 803613.86
-612296.76 803712.12
-612306.49 803739.99
-612301.74 803835.72
-612124.68 803857.46
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612643.74 804070.02
-Region  1
-  57
-598713.45 789929.46
-598689.48 789982.78
-598691.6 790006.81
-598702.57 790045.81
-598710.64 790072.63
-598696.44 790129.71
-598662.99 790260.34
-598627.65 790355.01
-598653.67 790403.64
-598654.23 790436.44
-598640.33 790470.91
-598585.85 790535.39
-598515.25 790619.34
-598491.9 790649.91
-598502.46 790657.14
-598520.25 790672.15
-598546.48 790699.58
-598571.88 790724.98
-598606.17 790751.65
-598683.03 790765
-598698.27 790731.98
-598717.32 790702.77
-598754.15 790612.6
-598787.17 790580.85
-598833.51 790550.38
-598898.28 790509.11
-598968.76 790457.04
-599010.67 790432.27
-599075.44 790407.51
-599182.15 790361.15
-599274.24 790308.43
-599385.06 790195.69
-599407.92 790165.84
-599327.26 790100.43
-599241.97 789947.46
-599186.73 789834.46
-599149.58 789759.21
-599134.97 789737.62
-599090.84 789646.77
-599081.31 789551.51
-599056.85 789548.99
-599055.27 789562.01
-599048.92 789611.81
-599045.76 789659.14
-598949.1 789726.68
-598931.53 789680.6
-598899.97 789624.43
-598896.53 789637.39
-598883.99 789657.53
-598875.36 789667.35
-598852.64 789698.27
-598834.34 789722.26
-598819.19 789742.45
-598808.46 789755.7
-598742.35 789914.52
-598726.93 789925.9
-598713.45 789929.46
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 598938.84 790163.14
-Region  1
-  65
-610643.55 800193.71
-610649.61 800237.72
-610658.99 800323.34
-610669.36 800419.74
-610697.7 800426.98
-610716.47 800444.96
-610683.24 800527.45
-610665.84 800569.49
-610645.9 800616.8
-610626.36 800665.27
-610701.8 800738.37
-610783.9 800819.69
-610879.67 800872.07
-610950.82 800883.41
-611087.97 800905.84
-611192.99 800922.2
-611211.5 800884.32
-611283.59 800916.45
-611296.07 800888.04
-611314.37 800853.33
-611325.13 800805.56
-611339.34 800784.03
-611369.04 800759.07
-611391.18 800734.75
-611398.93 800713.65
-611397.21 800660.27
-611396.13 800583
-611417.22 800544.26
-611433.81 800530.69
-611430.8 800490.66
-611423.05 800439.43
-611414.44 800349.02
-611406.24 800273.67
-611400.38 800210.76
-611396.27 800121.85
-611393.54 800067.53
-611392.17 800023.13
-611391.98 799932.34
-611387.68 799836.99
-611393.74 799803.51
-611410.55 799775.37
-611439.07 799748.8
-611466.82 799730.04
-611285.88 799704.64
-611134.3 799669.66
-611031.75 799641.7
-610991.42 799627.1
-610945.07 799591.54
-610903.96 799630.12
-610843.18 799674.1
-610755.99 799732.36
-610707.13 799766.02
-610677.74 799785.23
-610682.5 799812.22
-610688.71 799837.39
-610688.71 799872.58
-610687.53 799910.5
-610653.91 799916.36
-610633.98 799933.56
-610618.34 799958.19
-610611.5 799990.04
-610602.12 800085.43
-610610.72 800103.41
-610615.02 800126.08
-610643.55 800193.71
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611034 800267.98
-Region  1
-  138
-616132.3 806778.74
-616175.73 806731.84
-616278.52 806751.56
-616349.92 806654.27
-616093.49 806167
-616038.74 806066.63
-616003.71 805996.61
-615975.81 805951.08
-615958.66 805895.42
-615949.98 805846.81
-615945.89 805777.13
-615917.62 805735.65
-615707.75 805622.83
-615548.47 805537.38
-615477.13 805484.3
-615472.15 805446.97
-615176 805524.95
-615103.41 805544.47
-615050.32 805559.4
-615025.43 805566.04
-615001.25 805565.64
-615012.16 805590.09
-615018.8 805616.64
-615030.43 805635.84
-615041.88 805688.98
-615027.35 805718.08
-614998.25 805732.64
-614962.17 805740.25
-614903.31 805741.54
-614791.92 805756.78
-614765.34 805767.54
-614743.83 805782.1
-614736.33 805802.88
-614728.86 805836.9
-614718.9 805908.24
-614685.11 805934.59
-614662.99 805960.54
-614638.97 805999.14
-614633.32 806052.91
-614634.02 806119.97
-614653.05 806152.22
-614658.14 806180.68
-614656.26 806201.56
-614638.56 806221.18
-614608.18 806234.48
-614581.62 806256
-614562.94 806287.36
-614564.6 806434.19
-614500.73 806443.31
-614510.68 806471.52
-614522.29 806504.7
-614536.83 806533.34
-614669.56 806651.96
-614878.61 806983.78
-614891.46 807050.57
-614886.49 807105.32
-614860.77 807170.85
-614785.69 807264.99
-614750.02 807312.28
-614720.4 807364.83
-614695.74 807453.8
-614703.02 807544.38
-614725.66 807610.3
-614764.67 807663.88
-614830.18 807744.76
-614918.11 807855.36
-614905.98 807863.04
-614854.4 807857.58
-614819.63 807864.86
-614798.2 807902.88
-614800.62 807939.27
-614806.28 807962.32
-614832.76 808016.71
-614830.74 808040.57
-614766.44 808083.44
-614884.12 808547.67
-615018.38 808510.47
-615037.7 808508.5
-615042.77 808518.62
-615033.93 808537.6
-615007.37 808562.28
-614984.61 808591.39
-614985.91 808624.29
-615002.41 808663.5
-615127.7 808621.69
-615111.81 808561.6
-615114.32 808533.13
-615194.88 808510.26
-615237.59 808367.97
-615174.05 808123.18
-615168.23 808113.18
-615151.22 808083.97
-615144.24 808065.62
-615143.59 808049.18
-615154.97 808037.78
-615173.32 808032.08
-615189.15 808033.34
-615206.88 808043.45
-615229.68 808056.1
-615249.3 808051.66
-615269.54 808032.04
-615295.43 807964.97
-615369.44 807921.29
-615382.09 807906.73
-615383.34 807890.28
-615382.63 807816.9
-615392.12 807806.14
-615529.4 807727
-615559.76 807697.26
-615574.91 807661.19
-615579.3 807616.28
-615569.77 807580.85
-615546.94 807539.11
-615527.93 807522.04
-615456.99 807475.89
-615434.17 807441.74
-615410.45 807410.44
-615429.8 807373.93
-615488.44 807334.65
-615534.35 807316.4
-615563.66 807287.64
-615583.58 807243.94
-615594.09 807159.86
-615626.28 807117.13
-615654.75 807099.4
-615684.49 807094.33
-615730.99 807096.54
-615774.38 807091.76
-615803.48 807072.77
-615823.08 807051.88
-615843.54 807007.22
-615859.02 806949.7
-615887.78 806915.41
-615932.03 806896.61
-616017.75 806902.14
-616060.89 806887.76
-616094.63 806846.28
-616132.3 806778.74
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 615308.94 806746.68
-Region  1
-  37
-607242.45 808795.44
-607231.62 808762.94
-607513.73 808753.17
-607671.58 808749.14
-607652.88 808742.77
-607578.78 808721.31
-607402.73 808661.3
-607338.49 808625.5
-607258.21 808560.5
-607206.38 808491.67
-607174.94 808420.71
-607106.77 808219.54
-606918.55 808238.23
-606842.71 808243.54
-606796.44 808249.11
-606672.34 808261.39
-606611.59 808280.93
-606527.73 808308.98
-606469 808328.12
-606400.69 808351.61
-606312.59 808359.2
-606213.4 808337.88
-606176.64 808386.43
-606160.98 808446.47
-606132.26 808590.91
-606415.07 808845.88
-606423.55 808872.03
-606472.31 808920.79
-606515.42 808961.79
-606592.81 809038.41
-606612.02 809025.79
-606615.86 809054.81
-606617.94 809073.74
-606821.71 808990.28
-606840.15 808990.46
-606840.95 808956.47
-607242.45 808795.44
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606761.99 808608.31
-Region  1
-  81
-612432.56 798074.2
-612394.02 798151.94
-612347.52 798244.5
-612259.98 798313.35
-612167.2 798383.78
-612097.89 798438.95
-612075.32 798469.21
-612004.88 798629.47
-611972.05 798709.26
-611955.86 798755.53
-611928.05 798854.92
-611915.51 798900.25
-612028.03 798934.85
-612115.67 798970.73
-612155.37 799002.48
-612186.64 799038.26
-612209.18 799081.44
-612222.84 799151.62
-612249.51 799276.73
-612273.32 799442.82
-612303.8 799612.97
-612318.09 799680.29
-612328.88 799770.12
-612325.36 799827.18
-612312.86 799865.08
-612450.03 799903.38
-612519.98 799922.14
-612576.45 799936.79
-612706.61 799971.19
-612752.54 799970.97
-612820.94 799972.14
-612872.22 799980.93
-612932.34 800014.75
-612983.11 800070.72
-613034.17 800157.98
-613026.35 800110.68
-612990.78 799955.5
-612964.98 799914.84
-612962.72 799887.8
-612951.82 799856.26
-612909.36 799744.13
-612896.38 799696.7
-612953.4 799670.16
-613025.62 799653.14
-613087.01 799638.56
-613166.73 799611.94
-613260.55 799591.68
-613378.74 799580.83
-613473.66 799558.01
-613572.8 799540.33
-613595.95 799485.56
-613597.64 799469.19
-613620.79 799459.02
-613687.42 799460.72
-613641.68 799421.19
-613612.32 799368.68
-613602.49 799320.7
-613600.75 799275.79
-613586.63 799189.96
-613567.43 799029.63
-613556.14 798998.57
-613552.75 798943.82
-613600.18 798750.15
-613614.01 798705.82
-613631.52 798662.34
-613653.54 798624.51
-613601.31 798586.38
-613537.5 798551.37
-613574.77 798488.13
-613615.26 798399.54
-613608.36 798348.96
-613462.12 798372.11
-613142.25 798426.02
-613067.15 797981.57
-612892.83 797970.47
-612744.19 797961.35
-612663.04 797958.62
-612632.94 797964.54
-612544.26 798001.71
-612486.36 798034.99
-612432.56 798074.2
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612818.92 798946.66
-Region  1
-  80
-606797.13 793655.69
-606737.18 793636.55
-606723.15 793631.45
-606710.39 793632.72
-606681.05 793636.55
-606667.02 793644.21
-606646.61 793659.51
-606631.3 793677.37
-606619.82 793662.06
-606593.03 793645.48
-606575.41 793633.79
-606565.57 793657.29
-606560.81 793670.31
-606577 793700.47
-606568.11 793714.44
-606510.96 793716.98
-606474.77 793737.3
-606387.56 793823.85
-606329.14 793849.57
-606040.74 793983.7
-606031.53 793991.64
-606000.73 794105.98
-606001.05 794132.34
-606002.96 794158.05
-606017.56 794186.97
-606055.57 794266.73
-606092.9 794342.97
-606088.46 794395.46
-606044.86 794439.48
-605951.73 794533.44
-605960.2 794651.85
-606043.81 794756.25
-606109.86 794808.58
-606211.47 794865.08
-606214.24 794890.26
-606239.41 794846.45
-606300.58 794818.09
-606397.31 794821.41
-606469.49 794794.32
-606525.8 794757.94
-606646.63 794750.94
-606673.22 794738.13
-606690.51 794718.27
-606745.6 794635.64
-606808.21 794583.92
-606862.65 794535.88
-606907.81 794498.09
-606944.16 794336.87
-607043.6 794337.98
-607063.78 794307.24
-607099.65 794284.18
-607126.71 794280.53
-607260.9 794295.59
-607286.2 794281.17
-607308.97 794247.1
-607377.55 794119.15
-607388.03 794086.78
-607392.16 794002.59
-607386.13 793919.41
-607397.88 793899.09
-607382.65 793878.92
-607349.48 793838.1
-607336.72 793826.62
-607322.69 793802.38
-607315.04 793789.63
-607299.73 793767.94
-607286.97 793752.63
-607253.81 793718.19
-607235.95 793710.54
-607215.54 793710.54
-607192.58 793707.99
-607154.31 793700.33
-607022.92 793656.96
-607012.72 793687.58
-607003.79 793709.26
-606971.9 793704.16
-606937.45 793701.61
-606915.77 793699.06
-606854.54 793674.82
-606797.13 793655.69
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606627.37 794202.76
-Region  1
-  73
-607666.97 806259.51
-607703.61 806161.93
-607709.76 806083.87
-607709.76 806001.94
-607713.86 805935.04
-607716.82 805877.05
-607714.08 805847.92
-607697.7 805814.24
-607569.81 805567.18
-607561.16 805555.35
-607562.98 805505.28
-607569.58 805414.02
-607517.66 805386.4
-607451.54 805356.79
-607396.11 805336.42
-607341.7 805340.55
-607289.37 805362.59
-607241.85 805386.01
-607170.12 805412.71
-607142.68 805419.75
-607140.62 805450.05
-607128.57 805495.84
-607113.42 805537.84
-607086.73 805538.65
-607029.12 805532.35
-606949.33 805510.88
-606891.06 805484.34
-606778.74 805421.46
-606642.38 805471.73
-606646.65 805491.73
-606682.65 805631.03
-606690.48 805739.82
-606714.43 805960.19
-606732.27 806052.55
-606753.51 806240.36
-606774.64 806341.32
-606776.99 806400.02
-606725.26 806517.56
-606720.25 806559.32
-606729.17 806604.87
-606757.69 806640.91
-606795.72 806673.16
-606839.42 806695.91
-606864.76 806712.98
-606876.65 806742.83
-606880.64 806752.83
-606959.12 806747.1
-607054.07 806750.21
-607142.51 806765.54
-607230.17 806777.28
-607291.22 806809.37
-607322.53 806844.59
-607368.7 806870.41
-607414.1 806900.94
-607455.18 806956.12
-607489.62 806992.12
-607567.1 807026.56
-607659.46 807050.04
-607751.03 807071.17
-607746.34 807034.39
-607746.34 806996.04
-607746.62 806978.38
-607748.44 806955.17
-607757.54 806920.67
-607768.47 806859.59
-607780.21 806824.49
-607794.19 806758.99
-607799.19 806696.63
-607787.59 806607.71
-607755.95 806449.54
-607731.14 806350.54
-607704.29 806297.74
-607666.97 806259.51
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607248.74 806160.89
-Region  1
-  37
-608711.29 806982.56
-608251.51 805983.13
-608231.02 805991.32
-607870.21 806158.15
-607709.76 806083.87
-607703.61 806161.93
-607666.97 806259.51
-607704.29 806297.74
-607731.14 806350.54
-607755.95 806449.54
-607787.59 806607.71
-607799.19 806696.63
-607794.19 806758.99
-607780.21 806824.49
-607768.47 806859.59
-607757.54 806920.67
-607748.44 806955.17
-607746.62 806978.38
-607746.34 806996.04
-607883.62 806960.63
-607921.85 806963.36
-607976.92 806966.55
-608062.26 806974.92
-608241.59 806991.3
-608349.91 807289.81
-608365.39 807277.53
-608479.63 807187.41
-608518.77 807176.94
-608554.73 807180.58
-608592.05 807185.13
-608665.1 807191.27
-608675.57 807147.58
-608683.76 807112.53
-608689.68 807088.86
-608709.47 807010.33
-608719.03 807007.96
-608711.29 806982.56
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608182.48 806624.35
-Region  1
-  55
-610681.43 802061.74
-610559.7 802116.25
-610454.42 802167.38
-610420.89 802182.58
-610401.43 802195.25
-610379.87 802186.27
-610387.98 802117.54
-610394.87 802094.3
-610139.22 801966.05
-610066.68 802129.69
-610038.49 802197.47
-610068.26 802265.97
-610121.37 802351.88
-610186.95 802454.71
-610226.26 802503.69
-610264.84 802536
-610324.88 802567.56
-610376 802578.65
-610448.34 802586.37
-610534.73 802589.21
-610606.55 802594.63
-610649.24 802604.79
-610706.29 802621.5
-610905.71 802674.25
-610911.81 802649.85
-610938.23 802552.28
-610948.4 802541.44
-611004.64 802550.25
-611112.37 802570.58
-611090.01 802530.6
-611064.94 802485.2
-611033.77 802430.32
-611008.1 802386.1
-610953.8 802294.96
-610982.54 802277.37
-611126.86 802194.96
-611280.56 802105.1
-611272.15 802077.31
-611326.13 802021.43
-611357.72 801989.2
-611373.6 801963.47
-611378.84 801918.57
-611385.98 801808.52
-611393.13 801714.65
-611394.08 801694.96
-611336.92 801679.4
-611293.74 801669.88
-611252.68 801709.56
-611190.71 801759.57
-611126.82 801796.93
-611003.32 801859.13
-610876.98 801950.79
-610815.92 801994.94
-610774.6 802016.33
-610681.43 802061.74
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610728.1 802224.9
-Region  1
-  20
-603302.86 789119.79
-603532.11 789273.8
-603773.41 789437.03
-603806.11 789455.12
-603899.51 789107.4
-604007.76 788705.87
-603971.03 788692.86
-603940.55 788684.29
-603934.84 788673.18
-603932.3 788666.83
-603924.36 788661.11
-603282.99 788454.43
-603249.98 788562.11
-603215.69 788684.67
-603167.42 788670.68
-603059.79 788641.15
-603030.9 788632.62
-602971.52 788892.62
-603009.94 788916.44
-603302.86 789119.79
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603529.16 788900.8
-Region  1
-  97
-613515.56 796168.35
-613065.97 796290.42
-613049.31 796226.01
-613047.65 796219.59
-613037.92 796206.01
-612851.8 795994.65
-612842.35 795983.71
-611762.54 796273.77
-611766.04 796286.36
-611899.19 796788.51
-611894.42 796844.33
-611914.93 796854.82
-611868.61 796937.4
-611885.59 796945.74
-611965.5 796980.78
-612017.03 796992.71
-612131.73 797002.91
-612153.95 796980.3
-612267.11 796987.56
-612364.9 797033.28
-612418.88 797058.05
-612458.25 797060.59
-612575.72 797037.73
-612576.29 797037.77
-612649.39 797043.46
-612738.29 797083.46
-612812.58 797122.2
-612952.92 797228.24
-613052.15 797294.93
-613118.19 797320.33
-613191.85 797309.53
-613255.99 797275.24
-613348.06 797207.3
-613564.6 797124.74
-613629.84 797118.05
-613682.38 797135.78
-613756.28 797184.56
-613829.07 797232.31
-613904.2 797280.65
-614002.3 797340.34
-614034.33 797424.79
-614086.16 797501.67
-614157.79 797596.6
-614208.17 797667.31
-614223.9 797698.76
-614244.19 797745.61
-614239.11 797818.63
-614208 797895.47
-614125.45 797991.35
-614056.23 798043.42
-613990.83 798075.17
-613955.27 798078.35
-613943.2 798111.37
-614040.84 798071.6
-614079.57 798058.59
-614114.17 798055.93
-614198.47 798095.49
-614292.45 797911.34
-614320.06 797912.92
-614342.29 797916.73
-614505.81 797866.86
-614590.91 797871.94
-614681.73 797881.47
-614697.6 797805.26
-614710.94 797738.58
-614674.67 797730.27
-614627.11 797716.35
-614622.03 797691.58
-614620.77 797650.59
-614637.9 797489.34
-614642.22 797456.94
-614646.46 797422.02
-614662.94 797266.24
-614713.69 796781.16
-613987.82 796701.99
-614012.18 796648.53
-614045.66 796619.74
-614177.22 796600.13
-614235.89 796588.25
-614338.48 796502.58
-614349.79 796455.71
-614337.72 796422.05
-614241.83 796324.26
-614218.67 796287.11
-614224.68 796190.26
-614258.46 796128.96
-614291.48 796074.35
-614316.25 796024.19
-614323.87 795994.34
-614325.14 795982.91
-614271.8 795987.99
-614187.98 795986.72
-614156.23 795978.47
-613943.72 795984.84
-613737.44 796105.19
-613632.92 796134.95
-613515.56 796168.35
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613375.09 796765.84
-Region  1
-  19
-603656.45 790021.88
-603797.22 789484.97
-603800.4 789473.22
-603806.11 789455.12
-603773.41 789437.03
-603532.11 789273.8
-603302.86 789119.79
-603293.97 789142.02
-603229.11 789305.8
-603099.22 789659.61
-603006.78 789927.79
-602935.35 790140.59
-602919.89 790188.45
-602967.75 790198.02
-603005.3 790207.59
-602988.37 790293.74
-603556.42 790420.75
-603653.82 790031.88
-603656.45 790021.88
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603375.5 789820.02
-Region  1
-  57
-614380.73 801199.31
-614377.99 801092.73
-614412.62 801055.35
-614463.62 801029.07
-614499.49 800985.52
-614518.73 800954.73
-614533.03 800923.95
-614549.79 800884.18
-614564.64 800830.3
-614575.63 800754.43
-614605.6 800645.87
-614603.57 800578.54
-614596.53 800492.79
-614571.71 800382.28
-614537.04 800323.2
-614460.97 800227.99
-614411.46 800172.25
-614077.81 799904.57
-613984.04 799830.9
-613916.58 799754.35
-613888.11 799874.19
-613865.38 799967.72
-613848.15 800042.84
-613820.64 800160.29
-613799.59 800255.98
-613798.89 800295.45
-613811.81 800346.16
-613827.12 800397.35
-613836.44 800431.56
-613864.19 800519.59
-613870.89 800559.3
-613868.72 800600.68
-613841.45 800793.49
-613796.47 801130.77
-613758.68 801198.23
-613785.3 801242.86
-613691.25 801275.75
-613777.73 801403.88
-613828.84 801483.22
-613866.4 801530.07
-613922.48 801607.04
-614005.77 801702.96
-614049.75 801752.44
-614100.33 801809.07
-614172.36 801885.49
-614185.55 801862.95
-614252.63 801759.59
-614250.43 801750.23
-614289.47 801680.41
-614330.15 801591.34
-614323.01 801551.75
-614300.25 801490.36
-614303.21 801437.37
-614315.86 801360.95
-614336.75 801308.72
-614367.54 801234.5
-614380.73 801199.31
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 614139.89 800798.67
-Region  1
-  123
-610567.76 791819.43
-610231.85 790910.99
-610199.32 790825.1
-610050.24 790895.11
-610010.41 790919.72
-609984.06 790932.42
-609953.26 790954.01
-609924.05 790976.87
-609897.55 790994.88
-609869.07 791018.93
-609760.87 791088.54
-609651.4 791171.44
-609524.1 791287.12
-609377.41 791462.69
-609214.85 791455.07
-609222.47 791467.77
-609232.63 791482.37
-609244.06 791498.88
-609256.76 791480.47
-609277.72 791472.85
-609296.77 791482.37
-609325.98 791508.41
-609355.19 791545.24
-609377.41 791575.72
-609387.57 791582.7
-609400.27 791650.65
-609461.23 791660.81
-609454.25 791709.36
-609459.87 791813.23
-609475.21 791908.12
-609472.2 792006.42
-609450.46 792057.7
-609411.09 792120.89
-609346.45 792207.1
-609396.7 792250.75
-609411.08 792269.49
-609426.33 792323.47
-609417.56 792369.03
-609398.82 792397.93
-609342.47 792469.87
-609462.16 792560.36
-609517.72 792491.78
-609544.72 792449.84
-609565.52 792401.74
-609575.21 792332.35
-609580.61 792300.17
-609596.49 792284.29
-609688.25 792245.24
-609759.69 792215.69
-609804.14 792197.59
-609797.15 792235.37
-609787.31 792278.87
-609819.55 792265.22
-609868.91 792246.8
-609861.29 792280.12
-609853.67 792311.24
-609843.83 792349.98
-609833.35 792395.7
-609853.03 792406.21
-609876.85 792419.23
-609899.39 792433.2
-609902.56 792465.59
-609907.64 792505.59
-609911.45 792546.21
-609916.53 792598.92
-609923.83 792684
-609906.38 792767.47
-609900.34 792798.58
-609894.63 792831.29
-609974.64 792832.56
-609974 792873.83
-609973.05 792939.89
-609973.05 793003.39
-609973.05 793073.88
-609973.06 793161.21
-609957.18 793162.48
-609923.53 793162.16
-609891.78 793163.11
-609892.73 793239.98
-609958.45 793239.34
-610040.69 793239.66
-610073.39 793239.64
-610107.04 793239.64
-610133.71 793232.33
-610160.38 793217.41
-610166.73 793322.51
-610189.27 793334.89
-610215.31 793338.39
-610240.71 793327.28
-610267.7 793269.18
-610295.89 793207.77
-610324.33 793167.84
-610348.46 793159.58
-610364.65 793157.99
-610398.31 793060.84
-610400.36 793003.22
-610467.67 792960.99
-610513.71 792938.13
-610557.84 792922.57
-610609.59 792915.9
-610662.93 792919.08
-610721.67 792933.04
-610747.07 792937.8
-610778.82 792942.88
-610689.13 792836.04
-610492.62 792601.04
-610463.25 792519.37
-610476.49 792451.14
-610505.5 792405.55
-610556.42 792369.91
-610618.19 792352.94
-610813.53 792326.34
-610928.94 792309.03
-610981.04 792286.4
-611017.08 792256.53
-611043.66 792191.8
-611045.17 792131.49
-611024.47 792073.78
-610975.76 792025.47
-610933.83 792003.52
-610645.32 791908.14
-610596.27 791871.02
-610567.76 791819.43
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610102.47 792024.54
-Region  1
-  47
-603482.28 795647.03
-603622.97 795654.06
-603709.7 795669.95
-603838.49 795684.61
-603918.07 795683.91
-603888.63 794997.02
-603776.87 795028.14
-603770.21 795044.09
-603729.05 795065.89
-603673.81 795065.25
-603642.06 795049.38
-603556.97 795060.16
-603438.86 795029.68
-603327.1 795016.98
-603221.05 795041.75
-603179.65 795012.7
-603146.84 794997.04
-603137.1 795019.9
-603125.46 795012.92
-603084.17 794979.65
-603073.39 794971.85
-603061.86 794962.86
-603032.33 794965.51
-602938.39 795123.23
-602949.44 795149.64
-602934.19 795204.84
-602830.03 795486.53
-602686.52 795478.91
-602577.14 795473.05
-602465.17 795465.41
-602437.87 795464.99
-602441.25 795507.74
-602445.49 795540.57
-602468.13 795573.16
-602524.87 795610.83
-602524.27 795646.08
-602528.08 795670.13
-602729.34 795792.63
-602785.65 795821.36
-602827.14 795841.04
-602892.97 795865.56
-602961.98 795882.28
-603037.05 795881.61
-603154.81 795843.25
-603298.75 795739.12
-603396.55 795676.4
-603482.28 795647.03
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603272.83 795428.52
-Region  1
-  133
-606546.87 807108.56
-606532.35 807144.63
-606520.38 807190.18
-606492.62 807257.89
-606466.12 807327.5
-606422.88 807399.77
-606416.79 807476.33
-606402 807543.33
-606393.74 807618.6
-606357.82 807675.45
-606309.05 807753.19
-606264.53 807823.86
-606235.55 807880.4
-606209.33 807913.64
-606121.25 807948.6
-606147.21 807902.31
-605549.66 807841.92
-605544.71 807870.89
-605335.52 807848.98
-605330.22 807947.64
-605335.16 807969.55
-605368.38 807993.57
-605461.67 808005.59
-605454.6 808091.81
-605454.6 808113.72
-605475.1 808111.6
-605497.71 808112.31
-605523.51 808121.91
-605503.72 808197.53
-605629.52 808213.79
-605660.33 808340.17
-605666.11 808404.69
-605638.94 808445.2
-605594.54 808479.82
-605542.95 808527.17
-605516.09 808570.99
-605502.66 808644.49
-605489.23 808704.56
-605478.28 808760.04
-605492.07 808780.78
-605732.35 808832.41
-605759.21 808837.36
-605785.36 808840.19
-605807.26 808827.46
-605870.87 808785.06
-605865.92 808813.33
-605855.19 808878.35
-605851.41 808899.86
-605859.02 808914.41
-605885.65 808952.35
-605898.32 808972.59
-605907.83 808987.13
-605985.72 808966.32
-605985.72 808982.58
-606000.27 809001.01
-606170.89 808991.76
-606236.61 808986.82
-606281.14 808983.28
-606337.68 809006.61
-606362.41 809015.79
-606400.93 808890.41
-606415.07 808845.88
-606132.26 808590.91
-606160.98 808446.47
-606176.64 808386.43
-606213.4 808337.88
-606312.59 808359.2
-606400.69 808351.61
-606469 808328.12
-606527.73 808308.98
-606611.59 808280.93
-606672.34 808261.39
-606796.44 808249.11
-606842.71 808243.54
-606918.55 808238.23
-607106.77 808219.54
-607174.94 808420.71
-607206.38 808491.67
-607258.21 808560.5
-607338.49 808625.5
-607402.73 808661.3
-607578.78 808721.31
-607652.88 808742.77
-607671.58 808749.14
-607751.25 808744.67
-607797.87 808734.65
-607752.95 808684.34
-607696.87 808621.46
-607652.03 808573.66
-607647.78 808502.7
-607640.75 808381.83
-607638.86 808249.91
-607659.25 808209.12
-607690.11 808160.72
-607824.54 807939.76
-607882.53 807841.82
-607922.47 807778.52
-607994.9 807657.22
-608038.87 807555.89
-608084.34 807453.92
-608139.18 807362.64
-608195.16 807364
-608247.51 807362.18
-608349.91 807289.81
-608241.59 806991.3
-608062.26 806974.92
-607976.92 806966.55
-607921.85 806963.36
-607883.62 806960.63
-607746.34 806996.04
-607746.34 807034.39
-607751.03 807071.17
-607659.46 807050.04
-607567.1 807026.56
-607489.62 806992.12
-607455.18 806956.12
-607414.1 806900.94
-607368.7 806870.41
-607322.53 806844.59
-607291.22 806809.37
-607230.17 806777.28
-607142.51 806765.54
-607054.07 806750.21
-606959.12 806747.1
-606880.64 806752.83
-606824.96 806769.94
-606762.34 806812.99
-606729.48 806856.03
-606706.11 806894
-606671.35 806938.94
-606624.58 806992.11
-606578.45 807059.83
-606546.87 807108.56
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 606896.73 807815.75
-Region  1
-  56
-609965.13 803428.54
-609957.14 803519.81
-609943.25 803673.69
-609948.65 803765.66
-609952.08 803845.25
-609975.08 803926.49
-609992.1 803976.67
-610046.6 803932
-610079.75 803867.79
-610103.79 803830.94
-610141.12 803796.89
-610227.43 803721.33
-610241.77 803708.19
-610254.91 803702.81
-610473.2 803609.45
-610546.08 803578.8
-610605.56 803557.89
-610675.44 803556.4
-610703.94 803435.35
-610708.1 803420.62
-610715.79 803386.35
-610757.88 803346.52
-610794.09 803187.31
-610805.46 803133.68
-610822.69 803069.36
-610808.19 803059.51
-610789.14 803045.9
-610658.64 802961.82
-610546.56 802888.49
-610523.02 802893.47
-610485.23 802902.44
-610436.56 802900.2
-610400.05 802891.87
-610369.95 802871.37
-610321.76 802840.13
-610280.45 802813.87
-610254.51 802801.7
-610170.28 802797.22
-610164.04 802780.73
-610143.23 802747.11
-610127.61 802705.28
-610122.36 802688.26
-610119.62 802679.22
-610036.6 802657.99
-610022.52 802652.74
-610007.6 802677.75
-609978.14 802714.61
-609946.12 802761.36
-609918.74 802815.32
-609917.78 802831.97
-609940.09 802904.69
-609959.17 802969.21
-609972.53 803028.68
-609971.39 803082.86
-609957.93 803161.96
-609965.13 803428.54
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610294.57 803263.83
-Region  1
-  53
-612593.97 797653.43
-613257.15 797568.02
-613901.69 797827.51
-613878.54 797893.57
-614009.25 797946.35
-614006.43 797953.69
-613990.83 797999.61
-613978.76 798027.55
-613970.78 798043.74
-613965.07 798058.35
-613955.27 798078.35
-613990.83 798075.17
-614056.23 798043.42
-614125.45 797991.35
-614208 797895.47
-614239.11 797818.63
-614244.19 797745.61
-614223.9 797698.76
-614208.17 797667.31
-614157.79 797596.6
-614086.16 797501.67
-614034.33 797424.79
-614002.3 797340.34
-613904.2 797280.65
-613829.07 797232.31
-613756.28 797184.56
-613682.38 797135.78
-613629.84 797118.05
-613564.6 797124.74
-613348.06 797207.3
-613255.99 797275.24
-613191.85 797309.53
-613118.19 797320.33
-613052.15 797294.93
-612952.92 797228.24
-612812.58 797122.2
-612738.29 797083.46
-612649.39 797043.46
-612576.29 797037.77
-612549.01 797084.94
-612502.35 797165.63
-612501.86 797166.47
-612404.75 797334.37
-612509.85 797394.67
-612403.39 797543.55
-612438.95 797568.62
-612459.47 797574.55
-612489.1 797587.32
-612540.17 797579.11
-612563.42 797577.74
-612569.35 797616.95
-612572.09 797653.43
-612593.97 797653.43
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613365.03 797472.66
-Region  1
-  100
-604837.81 802684.65
-604842.26 802578.27
-604848.01 802523.91
-604854.1 802480
-604874.27 802345.44
-604866.04 802264.79
-604844.64 802200.6
-604795.26 802140.52
-604733.53 802093.61
-604673.04 802066.06
-604516.67 802005.15
-604492.92 802036.11
-604444.54 802109.53
-604401.83 802173.95
-604357.88 802233.63
-604228.58 802286.31
-604169.49 802267.23
-604070.79 802238.34
-604034.7 802227.22
-604014.39 802221.69
-603969.46 802283.23
-603636.66 802748.96
-603603.2 802791.82
-603573.71 802824.24
-603580.36 802844.68
-603697.61 802862.69
-603773.12 802986.73
-603784.82 802996.57
-603798.36 802998.42
-603824.52 803019.04
-603852.22 803039.96
-603887.91 803069.51
-603919.3 803092.28
-603962.39 803122.44
-604005.47 803144.6
-604051.01 803165.52
-604097.79 803180.91
-604146.41 803173.52
-604188.88 803185.22
-604288.9 802983.07
-604320.29 803002.15
-604359.68 803023.08
-604416.3 803049.54
-604431.69 803016.92
-604496.31 802887.67
-604931.74 803101.55
-604978.78 803051.88
-605142.93 802945.76
-605166.45 802930.6
-605176.91 802953.61
-605168.02 802978.18
-605149.73 803024.7
-605149.2 803057.11
-605157.31 803102.33
-605215.86 803131.61
-605234.68 803100.76
-605255.07 803064.17
-605267.09 803045.35
-605268.66 803037.51
-605303.16 803035.94
-605361.71 803029.15
-605501 803009.02
-605513.02 803025.75
-605613.39 803005.36
-605722.57 802979.61
-605788.78 802964.33
-605815.45 802970.6
-605880.79 803003.01
-605918.43 803022.35
-605940.91 803036.47
-605962.86 803012.42
-605992.66 802999.35
-606036.57 802980.01
-606074.48 802960.93
-606151.32 802926.95
-606205.45 802904.07
-606266.06 802882.25
-606263.45 802871.8
-606051.57 802267.69
-606030.17 802210.08
-606020.29 802186.17
-605984.08 802185.39
-605961.86 802191.15
-605929.76 802219.14
-605887.79 802299.79
-605834.71 802400.61
-605801.79 802471.39
-605736.77 802499.37
-605197.47 802712.88
-605115.4 802746.86
-605085.08 802759.93
-605062.08 802771.95
-605047.96 802787.11
-605035.42 802804.89
-605020.78 802796.52
-605001.44 802789.73
-604906.07 802747.34
-604864.08 802734.11
-604833.02 802720.31
-604837.81 802684.65
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604836.35 802677.09
-Region  1
-  21
-610409.8 796630.57
-610092.97 795436.65
-610086.66 795414.99
-610085.28 795410.24
-609923.45 795453.85
-609696.71 795514.96
-609696.4 795515.04
-609682.69 795518.73
-609680.35 795519.36
-609678.24 795519.93
-609674.68 795520.89
-609674.64 795520.9
-609536.93 795558.01
-609277.95 795863.12
-609277.84 795863.25
-609213.55 795938.99
-609187.49 796032.42
-609200.43 796041.44
-610364.34 796720.1
-610445.47 796767.66
-610409.8 796630.57
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609861.22 796017.31
-Region  1
-  45
-608765.28 799110.24
-609280.53 799126.82
-609215 799391.25
-609259.34 799386.37
-609626.53 799456.79
-609622.79 799547.27
-609702.27 799550.31
-609736.65 799553.3
-609772.95 799554.41
-609806.25 799555.8
-609852.39 799558.92
-609847.88 799505.5
-609844.41 799460.75
-609881.53 799507.23
-609905.46 799516.25
-609941.54 799514.52
-609976.66 799496.43
-610008.21 799442.43
-610055.08 799345.17
-610078.29 799289.84
-610092.85 799254.65
-610002.91 799197.47
-609898.85 799132.25
-609843.8 799131.75
-609824.38 799133.88
-609809.37 799133.47
-609787.22 799131.61
-609794.22 798505.1
-609267.77 798492.3
-609193.84 798617.41
-609127.52 798518.11
-609104.37 798482.7
-608963.57 798554.33
-608931.03 798568.31
-608885.94 798568.09
-608883.77 798788.94
-608765.57 798783.5
-608731.13 798788.79
-608706.07 798793.14
-608711.52 798829.09
-608721.41 798909.42
-608725.8 798953.29
-608735.06 799014.71
-608745.29 799107.81
-608765.28 799110.24
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609414.03 798979.15
-Region  1
-  65
-610559.48 794998.34
-610681.5 794960.81
-610681.54 794960.8
-610681.59 794960.78
-610681.61 794960.77
-610768.27 794934.12
-610875.4 794905.36
-610875.49 794905.34
-610957.01 794883.46
-611000.71 794871.73
-611209.69 794815.64
-611227.96 794817.3
-611229.67 794817.46
-611033.95 794075.11
-610999.9 794023.18
-610972.59 793985.92
-610901.33 793884.54
-610807.67 793951.22
-610740.04 794004.88
-610714.96 793957.57
-610710.51 793868.98
-610708.45 793806.6
-610740.2 793724.05
-610760.84 793694.2
-610767.19 793662.13
-610755.12 793644.35
-610669.98 793645.31
-610603.62 793646.9
-610542.66 793648.79
-610387.4 793652.92
-610345.42 793618.57
-610322 793621.78
-610295.96 793630.04
-610272.64 793661.6
-610256.27 793683.7
-610164.51 793624.96
-610166.42 793656.07
-610172.14 793756.41
-610185.97 793778.68
-610187.9 793845.14
-610151.85 793914.76
-610073.61 794046.78
-610059.32 794068.37
-610024.71 794123.62
-610003.59 794165.03
-609992.79 794218.68
-609996.6 794287.58
-610019.9 794340.76
-610063.42 794385.67
-610085.58 794425.55
-610088.49 794473.78
-610069.8 794516.06
-610021.62 794578.71
-610021.3 794633.64
-610033.36 794659.36
-610042.25 794677.14
-610097.04 794747.44
-610121.34 794779.67
-610140.07 794808.88
-610151.5 794877.14
-610160.8 794944.94
-610288.59 795355.45
-610355.98 795337.29
-610558.47 794998.65
-610559.48 794998.34
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610548.32 794412.86
-Region  1
-  86
-609718.41 793322.99
-609750.82 793322.8
-609910.84 793322.16
-610013.07 793317.66
-610166.73 793322.51
-610160.38 793217.41
-610133.71 793232.33
-610107.04 793239.64
-610073.39 793239.64
-610040.69 793239.66
-609958.45 793239.34
-609892.73 793239.98
-609891.78 793163.11
-609923.53 793162.16
-609957.18 793162.48
-609973.06 793161.21
-609973.05 793073.88
-609973.05 793003.39
-609973.05 792939.89
-609974 792873.83
-609974.64 792832.56
-609894.63 792831.29
-609900.34 792798.58
-609906.38 792767.47
-609923.83 792684
-609916.53 792598.92
-609911.45 792546.21
-609907.64 792505.59
-609902.56 792465.59
-609899.39 792433.2
-609876.85 792419.23
-609853.03 792406.21
-609833.35 792395.7
-609843.83 792349.98
-609853.67 792311.24
-609861.29 792280.12
-609868.91 792246.8
-609819.55 792265.22
-609787.31 792278.87
-609797.15 792235.37
-609804.14 792197.59
-609759.69 792215.69
-609688.25 792245.24
-609596.49 792284.29
-609580.61 792300.17
-609575.21 792332.35
-609565.52 792401.74
-609544.72 792449.84
-609517.72 792491.78
-609462.16 792560.36
-609342.47 792469.87
-609398.82 792397.93
-609417.56 792369.03
-609426.33 792323.47
-609411.08 792269.49
-609396.7 792250.75
-609346.45 792207.1
-609258.99 792314.26
-609177.05 792422.87
-609156.73 792476.21
-609143.4 792564.45
-609132.61 792641.89
-609133.88 792693.65
-609183.73 792875.22
-609168.81 792948.9
-609107.16 793048.72
-609051.49 793141.13
-609002.78 793209.48
-608947.13 793292.83
-608943.32 793339.19
-608955.39 793367.76
-608961.1 793467.46
-608948.41 793545.77
-608918.28 793616.24
-608933.84 793613.07
-608981.78 793614.33
-609095.45 793615.91
-609155.14 793614.01
-609190.7 793604.19
-609406.6 793522.59
-609499.47 793546.36
-609530.21 793561.73
-609544.54 793576.58
-609574.3 793534.83
-609659.06 793409.48
-609718.41 793322.99
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609492.45 792961.13
-Region  1
-  69
-610193.73 805814.3
-610207.84 805800.62
-610761.23 805931.99
-610865.94 805981.61
-610848.63 805881.18
-610859.29 805835.68
-610871.55 805795.71
-610883.8 805763.74
-610894.72 805714.98
-610891.52 805665.95
-610875.81 805615.57
-610858.76 805592.66
-610845.97 805562.81
-610811.86 805498.33
-610791.08 805443.45
-610776.43 805411.21
-610808.93 805395.76
-610844.1 805408.01
-611002.39 805320.62
-611035.43 805307.83
-611084.41 805306.32
-611093.25 805271.89
-611102.84 805260.16
-611079.39 805227.12
-611059.68 805169.57
-611094.85 805159.98
-611139.29 805156.35
-611171.05 805147.19
-611196.9 805131.47
-611233.67 805121.87
-611282.16 805124.54
-611322.13 805132.53
-611370.62 805153.32
-611467.61 805203.94
-611554.21 805242.06
-611593.64 805245.26
-611711.41 805235.13
-611790.26 805226.43
-611957.32 804961.32
-611902.44 804935.75
-611896.57 804945.34
-611882.19 804936.81
-611869.4 804932.55
-611855.54 804930.42
-611839.55 804926.15
-611816.11 804920.29
-611774.54 804912.3
-611568.97 804480.02
-611396.73 804561.67
-611382.27 804517.55
-611023.33 804657.88
-610844 804730.43
-610805.44 804748.99
-610721.33 804838.4
-610697.22 804857.93
-610683 804868.29
-610632.15 804898.9
-610464.94 804992.2
-610346.57 804987.83
-610099.81 805072.1
-610124.07 805151.43
-610140 805202.88
-610151.84 805297.47
-610166.82 805371.49
-610143.71 805366.36
-610102.22 805628.99
-610092.2 805700.02
-610094.02 805720.96
-610193.73 805814.3
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610898.57 805181.48
-Region  1
-  70
-610282.93 799862.52
-610338.81 799876.52
-610415.33 799884.78
-610440.47 799877.27
-610532.34 799854.98
-610534.29 799824.88
-610550.1 799658.54
-610644.41 799587.1
-610698.7 799522.64
-610658.99 799504.51
-610624.38 799488.64
-610589.85 799319.74
-610779.06 799024.33
-610725.72 798989.23
-610671.01 798963.69
-610629.52 798930.41
-610594.61 798892.66
-610569.78 798878.83
-610500.48 798849.2
-610448.5 798812.72
-610421.15 798788.56
-610397.45 798766.14
-610355.89 798718.51
-610331.32 798730.95
-610290.67 798748.85
-610256.39 798763.41
-610231.51 798761.29
-610213.92 798822.87
-610208.01 798845.2
-610202.55 798864.92
-610235.61 798880.7
-610277.48 798890.71
-610253.96 798916.01
-610223.32 798946.65
-610199.36 798978.2
-610182.98 799004.59
-610128.67 799112
-610140.2 799139.3
-610104.08 799232.51
-610092.85 799254.65
-610078.29 799289.84
-610055.08 799345.17
-610008.21 799442.43
-609976.66 799496.43
-609941.54 799514.52
-609905.46 799516.25
-609881.53 799507.23
-609844.41 799460.75
-609847.88 799505.5
-609852.39 799558.92
-609856.09 799613.25
-609860.96 799661.02
-609850.24 799708.79
-609838.54 799779.95
-609820.99 799856.96
-609838.54 799872.56
-609862.91 799896.93
-609900.93 799933
-609949.67 799980.77
-609967.22 800003.19
-609992.42 799938.1
-610049.25 799950.17
-610066.65 799934.95
-610095.9 799917.41
-610132.94 799894.98
-610182.92 799865.71
-610207.37 799848.57
-610242.93 799824.42
-610253.09 799844.74
-610282.93 799862.52
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610302.18 799401.54
-Region  1
-  73
-609959.7 801971.07
-609735.1 801674.65
-609607.98 801510.8
-609545.37 801454.77
-609481.98 801424.2
-609305.37 801363.3
-609217.86 801333.94
-609085.66 801293.33
-608996.76 801256.5
-608785.94 801189.83
-608571.84 801115.17
-608447.19 801073.74
-608370.43 801040.3
-608338.12 801055.88
-608338.12 801068.04
-608343.44 801080.58
-608382.59 801130.37
-608437.69 801158.87
-608458.41 801174.25
-608466.01 801190.59
-608461.83 801250.25
-608457.43 801317.33
-608452.11 801349.64
-608460.24 801369.61
-608455.68 801412.18
-608467.84 801477.55
-608466.32 801536.85
-608432.11 801601.46
-608407.03 801663.8
-608402.41 801699.92
-608407.49 801729.13
-608420.19 801755.8
-608434.16 801785.01
-608450.67 801829.46
-608468.36 801872.94
-608494.95 801882.42
-608538.3 801898.04
-608587.83 801843.43
-608628.47 801807.87
-608653.87 801785.01
-609171.37 802336.92
-609020.02 802475
-609026.76 802512.56
-609034.47 802540.98
-609053.25 802562.17
-609076.61 802570.11
-609115.62 802561.44
-609144.99 802541.7
-609176.78 802519.55
-609236.5 802481.02
-609285.14 802447.79
-609351.6 802418.41
-609423.6 802424.77
-609466.7 802430.45
-609428.65 802549.41
-609616.24 802750.49
-609634.05 802784.2
-609658.62 802802.5
-609794.32 802754.83
-609823.8 802727.37
-609888.82 802691.25
-609927.52 802668.29
-609977.96 802639.71
-610027.7 802604.13
-610028.58 802565.8
-610014.55 802494.97
-610070.33 802426.25
-610121.37 802351.88
-610068.26 802265.97
-610038.49 802197.47
-610013.02 802110.45
-609990.83 802033.47
-609959.7 801971.07
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609273.83 801908.22
-Region  1
-  174
-613342.23 805375.22
-613966.89 805614.13
-614298.72 806107.69
-614439.34 806252.52
-614500.73 806443.31
-614564.6 806434.19
-614562.94 806287.36
-614581.62 806256
-614608.18 806234.48
-614638.56 806221.18
-614656.26 806201.56
-614658.14 806180.68
-614653.05 806152.22
-614634.02 806119.97
-614633.32 806052.91
-614638.97 805999.14
-614662.99 805960.54
-614685.11 805934.59
-614718.9 805908.24
-614728.86 805836.9
-614736.33 805802.88
-614743.83 805782.1
-614765.34 805767.54
-614791.92 805756.78
-614903.31 805741.54
-614962.17 805740.25
-614998.25 805732.64
-615027.35 805718.08
-615041.88 805688.98
-615030.43 805635.84
-615018.8 805616.64
-615012.16 805590.09
-615001.25 805565.64
-615025.43 805566.04
-615050.32 805559.4
-615103.41 805544.47
-615176 805524.95
-615472.15 805446.97
-615477.13 805484.3
-615548.47 805537.38
-615707.75 805622.83
-615917.62 805735.65
-615945.89 805777.13
-615949.98 805846.81
-615958.66 805895.42
-615975.81 805951.08
-616003.71 805996.61
-616038.74 806066.63
-616093.49 806167
-616262.63 806023.7
-616355.59 805931.29
-616467.51 805815.48
-616540.25 805755.98
-616572.51 805735.09
-616618.08 805730
-616666.18 805722.39
-616706.68 805709.09
-616740.71 805692.38
-616759.71 805682.88
-616733.49 805574.54
-616707.4 805505.24
-616676.76 805435.97
-616534.94 805150.29
-616505.35 805029.13
-616497.05 804954.49
-616488.33 804837.72
-616481.61 804761.89
-616477.58 804732.12
-616469.32 804658.58
-616461.26 804628.24
-616450.5 804602.51
-616431.84 804562.03
-616394 804508.86
-616309.5 804426.64
-616285.84 804405.04
-616262.4 804382.97
-616237.02 804357.36
-616203.29 804325.68
-616172.65 804301.01
-616142.69 804277.88
-616118.91 804270.33
-616080.73 804258.21
-616036.05 804243.81
-615771.01 804169.15
-615686.52 804145.92
-615617.23 804128.32
-615339.24 804061.9
-615304.64 804054.61
-615392.27 804113.04
-615442.75 804114.31
-615431 804143.84
-615368.46 804215.91
-615300.19 804274.33
-615295.55 804330.27
-615302.19 804362.14
-615303.68 804401.84
-615309.66 804432.71
-615317.62 804494.45
-615306.17 804579.61
-615298.38 804617.6
-615297.71 804648.14
-615337.54 804672.7
-615351.48 804687.31
-615345.01 804704.07
-615367.92 804752.54
-615387.17 804798.01
-615328.25 804855.3
-615316.97 804881.19
-615326.26 804932.31
-615267.18 804990.4
-615239.29 805011.98
-615209.42 804837.04
-615187.18 804761.65
-615146.85 804691.08
-615100.21 804641.45
-615052.08 804606.27
-614999.64 804583.36
-614962.46 804573.07
-614915.82 804564.94
-614846.78 804565.61
-614796.99 804575.9
-614763.97 804591.71
-614712.52 804615.61
-614678.99 804627.56
-614637.83 804649.14
-614611.61 804661.09
-614615.1 804517.23
-614560.83 804456
-614489.29 804380.8
-614323.82 804207.4
-614233.04 804149.83
-614185.24 804127.92
-614155.37 804132.57
-614119.52 804137.55
-614075.54 804110.54
-614052.18 804069.33
-614025.42 804024.56
-613981.1 803955
-613999.53 803932.94
-614018.12 803925.3
-614048.32 803916.67
-614080.19 803904.72
-614118.36 803873.52
-613945.09 803856.92
-613834.23 803846.96
-613760.87 803838.26
-613679.88 803824.32
-613608.18 803807.06
-613543.62 803786.69
-613484.54 803763.12
-613418.32 803733.46
-613362.55 803706.24
-613273.73 803659.74
-613049.49 804022.91
-613024.21 804053.29
-612988.13 804069.36
-612960.63 804072.61
-612964.88 804103.62
-612785.14 804182.62
-612958.93 804728.28
-612987.38 804818.92
-613032.7 804979.95
-613042.28 804998.19
-613080.04 805048.94
-613120.12 805081.43
-613165.6 805112.29
-613218.29 805144.82
-613234.2 805154.47
-613266.36 805192.42
-613288.2 805254.27
-613306.86 805293.13
-613315.92 805319.24
-613316.72 805337.1
-613342.23 805375.22
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 614724.22 804955.63
-Region  1
-  73
-616122.82 799449.45
-616150.28 799318.76
-616166.05 799273.2
-616198.24 799120.65
-616214.44 799044.13
-616198.72 799016.66
-616145.36 798929.04
-616137.59 798915.3
-616077.27 798941.02
-616030.81 798945.55
-615977.66 798962.66
-615910.57 798980.35
-615868.66 798981.3
-615820.72 798954.32
-615784.52 798897.16
-615748.65 798819.39
-615535.54 798768.07
-615401.56 798771.24
-615366.98 798788.8
-615316.47 798907.13
-615280.9 798946.56
-615222.48 798966.88
-615109.45 798993.55
-615046.58 799008.86
-614975.46 799026
-614926.79 799037.62
-614871.92 799051.86
-614788.16 799076.99
-614759.68 799098.77
-614729.52 799142.75
-614723.03 799172.24
-614720.52 799280.3
-614707.04 799306.85
-615055.78 799796.55
-615416.18 799884.27
-615437.96 799901.02
-615456.37 799914.64
-615542.49 799983.45
-615591.39 800015.04
-615671.01 800066.1
-615746.75 800085.14
-615779.63 799990.37
-615788.29 799979.12
-615902.54 799938.01
-615906.52 799937.28
-615886.95 799872.34
-615866.81 799822.46
-615860.06 799803.4
-615867.9 799769.36
-615876.43 799739.86
-615881.51 799717
-615931.68 799699.53
-616008.19 799713.82
-616021.81 799759.26
-616041.54 799815.15
-616124.21 799787.6
-616161.9 799866.02
-616179.99 799914.28
-616222.54 800025.73
-616220.66 800061.76
-616245.34 800130.28
-616252.28 800091.63
-616265.24 800062.01
-616295.32 800023.84
-616322.4 800010.65
-616394.17 800023.03
-616434.73 800081.34
-616280.86 799567.83
-616260.52 799549.69
-616190.7 799521.65
-616112.66 799482.48
-616113.93 799472.95
-616122.82 799449.45
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 615562.85 799407.57
-Region  1
-  47
-611196.87 801147.4
-611116.5 801144.03
-611015.89 801133.41
-611003.84 801166.55
-610981.46 801182.05
-610941.65 801180.51
-610850.84 801174.05
-610714.63 801226.77
-610518.38 801303.38
-610367.52 801363.79
-610331.37 801400.38
-610363.22 801470.53
-610438.32 801644.18
-610445.64 801778.01
-610406.68 802005.86
-610409.07 802042.22
-610394.87 802094.3
-610387.98 802117.54
-610379.87 802186.27
-610401.43 802195.25
-610420.89 802182.58
-610454.42 802167.38
-610559.7 802116.25
-610681.43 802061.74
-610774.6 802016.33
-610815.92 801994.94
-610876.98 801950.79
-611003.32 801859.13
-611126.82 801796.93
-611190.71 801759.57
-611252.68 801709.56
-611293.74 801669.88
-611328.67 801633.68
-611369 801613.99
-611416.63 801610.81
-611449.43 801622.15
-611501.36 801641.1
-611574.49 801666.71
-611562.86 801639.93
-611501.85 801531.02
-611464.36 801418.43
-611421.18 801312.79
-611382.37 801255.86
-611361.28 801214.97
-611349.23 801193.89
-611335.02 801167.2
-611196.87 801147.4
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610875.36 801577.18
-Region  1
-  81
-608038.87 807555.89
-607994.9 807657.22
-607922.47 807778.52
-607882.53 807841.82
-607824.54 807939.76
-607690.11 808160.72
-607659.25 808209.12
-607638.86 808249.91
-607640.75 808381.83
-607647.78 808502.7
-607652.03 808573.66
-607696.87 808621.46
-607752.95 808684.34
-607797.87 808734.65
-607905.92 808703.03
-608030.57 808645.35
-608131.76 808591.59
-608186.05 808548.9
-608221.89 808516.75
-608338.37 808558.38
-608445.1 808620.8
-608504.66 808641.35
-608568.96 808656.64
-608865.17 808381.98
-608939.48 808348.25
-609000.1 808319.79
-609043.05 808260.49
-609028.82 808243.1
-609009.32 808221.49
-609021.44 808198.83
-609021.44 808161.41
-609015.64 808096.58
-609016.17 808044.93
-609003.78 807996.73
-608989.03 807953.51
-608984.81 807920.83
-608987.45 807881.83
-608977.17 807855.77
-608953.98 807838.38
-608921.83 807835.74
-608833.81 807857.35
-608833.28 807838.38
-608835.92 807826.26
-608841.19 807813.61
-608850.15 807799.9
-608868.07 807785.67
-608888.1 807778.29
-608920.25 807769.33
-608932.37 807753
-608919.19 807720.85
-608852.52 807648.89
-609019.34 807516.34
-609064.14 807508.44
-609115.79 807501.59
-609169.02 807491.05
-609249.66 807471.54
-609276.01 807456.79
-609229.63 807433.6
-609162.7 807400.92
-609116.84 807376.68
-609069.04 807343.41
-609013.28 807310.86
-608951.84 807272.63
-608872.05 807211.06
-608719.03 807007.96
-608709.47 807010.33
-608689.68 807088.86
-608683.76 807112.53
-608675.57 807147.58
-608665.1 807191.27
-608592.05 807185.13
-608554.73 807180.58
-608518.77 807176.94
-608479.63 807187.41
-608365.39 807277.53
-608349.91 807289.81
-608247.51 807362.18
-608195.16 807364
-608139.18 807362.64
-608084.34 807453.92
-608038.87 807555.89
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608398.99 807959.41
-Region  1
-  8
-608993.06 803798.31
-607875.29 803403.91
-607844.46 803395.24
-607744.77 803362.49
-607739.96 803615.34
-608916.5 804023.17
-608922.76 804007.76
-608993.06 803798.31
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608346.71 803696.9
-Region  1
-  63
-606030.4 798778.19
-605728.08 798570.62
-605656.79 798513.9
-605598.36 798471.99
-605544.69 798435.15
-605471.82 798381.37
-605419.74 798343.58
-605372.9 798301.19
-605357.34 798284.04
-605334.48 798247.84
-605313.67 798198.46
-605291.92 798120.48
-605267.59 798256.08
-605124.46 798359.68
-605095.96 798401.62
-605085.98 798438.5
-605085.98 798465.4
-605092.92 798495.34
-605108.97 798516.13
-605133.48 798531.13
-605163.43 798531.1
-605186.03 798522.69
-605206.38 798506.37
-605225.04 798486.84
-605239.35 798476.86
-605264.95 798458.21
-605281.44 798458.64
-605290.99 798468.62
-605294.46 798482.5
-605218.1 798564.94
-605187.51 798598.16
-605164.08 798614.66
-605126.77 798616.39
-605041.94 798594.52
-605032.62 798627.28
-604975.56 798860.47
-604958.86 798922.29
-604941.94 798948.76
-604885.1 798999.52
-604824.36 799054.63
-604744.53 799130.12
-604722.4 799294.55
-604710.16 799380.02
-605009.27 799284.37
-605096.77 799260.14
-605169.91 799237.7
-605252.25 799222.67
-605325.39 799206.07
-605418.48 799199.11
-605540.98 799189.24
-605556.16 799192.25
-605589.68 799188.13
-605625.37 799167.17
-605643.99 799154.54
-605669.82 799122.08
-605707.8 799077.72
-605779.87 799008.19
-605827.5 798961.16
-605863.06 798920.52
-605890.04 798888.77
-605939.57 798843.34
-605994.5 798803.33
-606030.4 798778.19
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605342.81 798844.12
-Region  1
-  42
-613318.17 795364.78
-612697.83 795750.05
-612641.71 795751.43
-612729.07 795852.56
-612747.63 795874.05
-612749.56 795876.29
-612749.62 795876.36
-612842.35 795983.71
-612851.8 795994.65
-613037.92 796206.01
-613047.65 796219.59
-613049.31 796226.01
-613065.97 796290.42
-613515.56 796168.35
-613473.34 796007.79
-613451.85 795972.01
-613496.7 795900.44
-613461.4 795888.99
-613430.39 795880.41
-613367.89 795868
-613334.01 795876.11
-613299.19 795909.51
-613276.78 795941.96
-613249.11 795989.19
-613224.78 796034.04
-613221.44 796051.69
-613226.21 796076.02
-613234.32 796104.65
-613242.91 796142.34
-613199.49 796153.79
-613136.04 796172.39
-613106.94 796101.79
-613082.13 796045.49
-613144.63 795941.48
-613314.41 795703.87
-613397.92 795575.27
-613414.43 795552.73
-613399.47 795536.25
-613370.29 795501.33
-613355.05 795495.3
-613338.18 795421.94
-613318.17 795364.78
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613123.08 795849.26
-Region  1
-  112
-607761.4 804265.59
-607826.9 804272.81
-607909.73 804296.89
-607972.82 804316.64
-608011.34 804332.53
-608044.34 804361.65
-608065.05 804412.7
-608079.73 804479.93
-608090.81 804532.42
-608113.34 804624.07
-608124.35 804670.21
-608138.82 804740.45
-608158.65 804816.95
-608184.14 804862.48
-608203.49 804891.42
-608240.37 804929.21
-608280.43 804976.11
-608727.71 804535.57
-608916.5 804023.17
-607739.96 803615.34
-607744.77 803362.49
-607844.46 803395.24
-608068.17 802768.36
-607263.44 802611.88
-607210.8 802531.55
-607147.88 802206.48
-607095.4 802205.07
-607067.67 802267.55
-607040.71 802295.49
-607010.51 802325.41
-606983.88 802353.76
-606931.87 802407.22
-606945.59 802423.37
-606986.53 802470.56
-606912.12 802624.45
-606920.79 802653.83
-606921.75 802688.02
-606867.82 802800.71
-606867.33 802915.33
-606786.18 802919.89
-606752.95 802922.3
-606754.4 803002.72
-606755.09 803109.91
-606758.75 803230.67
-606727.48 803256.83
-606709.61 803274.06
-606681.38 803297.58
-606659.95 803315.35
-606646.08 803329.73
-606614.19 803398.73
-606605.03 803427.74
-606604.95 803473.26
-606610.78 803523.41
-606625.42 803581.43
-606635.35 803632.66
-606647.9 803682.85
-606656.59 803720.12
-606665.12 803759.31
-606683.36 803749.22
-606715.17 803741.07
-606741.56 803744.95
-606761.35 803756.2
-606782.3 803774.44
-606802.09 803800.05
-606823.82 803825.27
-606846.32 803849.33
-606863.47 803870.43
-606887.16 803895.73
-606919.82 803929.72
-606939.08 803940.79
-606959.31 803935.98
-606979.53 803904.19
-606975.2 803858.44
-607006.98 803819.43
-607044.07 803775.13
-607079.22 803739.49
-607110.29 803701.66
-607148.33 803651.57
-607180.6 803607.27
-607234.15 803478
-607253.08 803440.42
-607273.79 803411.05
-607303.16 803397.56
-607335.91 803394.67
-607372.51 803408.16
-607406.71 803435.61
-607419.23 803462.58
-607418.75 803499.18
-607400.71 803543.71
-607379.98 803573.07
-607342.59 803634.21
-607296.9 803716.85
-607261.75 803778.5
-607231.89 803833.4
-607199.14 803888.3
-607180.92 803934.81
-607157.57 803993.03
-607135.57 804043.8
-607130.76 804092.44
-607142.31 804134.82
-607168.32 804181.54
-607195.05 804223.7
-607220.58 804261.27
-607255.25 804310.87
-607292.82 804333.51
-607340.98 804339.29
-607390.58 804319.54
-607449.33 804295.94
-607493.39 804289.43
-607578.64 804282.69
-607684.34 804272.81
-607761.4 804265.59
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 607654.2 803633.54
-Region  1
-  77
-614835.51 802581.86
-614850.85 802504.56
-614857.22 802443.18
-614858.95 802364.44
-614856.35 802317.82
-614846.87 802270.79
-614833.77 802208.96
-614820.77 802149.96
-614806.27 802102.11
-614801.93 802077.54
-614792.08 802056.69
-614751.55 802004.58
-614723.69 801991.04
-614703.66 801981.23
-614638.06 801972.15
-614585.66 801967.19
-614520.81 801957.35
-614485.49 801957.35
-614439.17 801958.51
-614412.07 801949.82
-614380.18 801946.52
-614333.45 801939.37
-614277.92 801931.13
-614235.58 801922.33
-614196.55 801904.19
-614173.46 801884.39
-614136.62 801940.47
-614046.41 802080.22
-614010.19 802131.97
-613958.31 802204.4
-613913.84 802259.65
-613880.82 802310.19
-613850.66 802358.6
-613813.45 802434.51
-613660.16 802441.58
-613644.34 802465.9
-613688.12 802490.15
-613692.5 802517.09
-613593.15 802591.85
-613510.48 802633.76
-613503.07 802707.18
-613455.41 802762.14
-613442.1 802776.61
-613428.78 802791.67
-613432.83 802806.72
-613442.67 802872.15
-613644.38 802916.45
-613696.34 802922.5
-613776.82 802905.82
-613844.13 802891.92
-613950.35 802869.57
-614003.74 802890.67
-614045.69 802908.59
-614132.22 802933.73
-614160.95 802958.12
-614396.03 802981.28
-614399.5 802950.01
-614455.95 802943.92
-614484.91 802941.02
-614512.12 802942.18
-614548.6 802950.29
-614591.45 802974.03
-614609.68 802985.91
-614600.42 803044.39
-614594.52 803071.15
-614594.19 803079.78
-614603.15 803126.58
-614617.76 803176.37
-614635.85 803192.8
-614646.74 803192.04
-614630.54 803223.34
-614658.42 803235.29
-614706.55 803257.2
-614733.44 803266.83
-614806.84 802798
-614801.63 802743.12
-614835.51 802581.86
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 614285.24 802525.19
-Region  1
-  97
-612014.43 802994.12
-612531.55 803254.97
-612527.92 803285.74
-612563.24 803365.88
-612762.49 803491.79
-612792.15 803519.17
-612811.17 803554.03
-612814.79 803591.62
-612810.72 803675.39
-612979.62 803683.99
-612987.32 803671.31
-613005.99 803661.05
-613050.91 803646.47
-613068.61 803627.49
-613071.77 803596.8
-613069.5 803583.22
-613063.16 803566.91
-613060.9 803560.58
-613055.01 803551.62
-612919.17 803476.8
-612969.89 803452.68
-612961.79 803397.67
-613059.06 802896.19
-613134.91 802929.19
-613200.92 803049.59
-613288.08 802987.38
-613337.29 802950.32
-613366.82 802928.9
-613389.98 802913.84
-613420.09 802890.1
-613442.67 802872.15
-613432.83 802806.72
-613428.78 802791.67
-613442.1 802776.61
-613455.41 802762.14
-613503.07 802707.18
-613510.48 802633.76
-613593.15 802591.85
-613692.5 802517.09
-613688.12 802490.15
-613644.34 802465.9
-613660.16 802441.58
-613813.45 802434.51
-613850.66 802358.6
-613880.82 802310.19
-613913.84 802259.65
-613872.74 802231.35
-613847.47 802214.85
-613816.81 802195.98
-613764.59 802161.28
-613741.18 802144.54
-613709.17 802148.92
-613687.28 802157
-613655.61 802078.17
-613565.64 801932.58
-613465.93 802026.94
-613441.17 802051.71
-613396.72 802070.44
-613351.95 802079.02
-613317.34 802080.92
-613232.89 802088.22
-613183.36 802093.3
-613168.75 802095.77
-613077.63 802133.86
-612986.2 802204.99
-612980.8 802190.69
-612969.68 802174.5
-612964.29 802158.62
-612955.4 802140.21
-612948.09 802124.67
-612943.01 802109.11
-612935.07 802088.16
-612928.41 802072.6
-612862 801913.72
-612836.39 801923.16
-612760.57 801914.87
-612691.51 801887.86
-612524.1 801697.89
-612477.74 801648.99
-612241.29 801763.85
-612184.23 801789.66
-612204.83 801861.41
-612248.3 802014.91
-612317.8 802243.81
-612333.65 802358.87
-612327.31 802440.83
-612311.24 802502.64
-612281.35 802576
-612250.79 802691.71
-612215.01 802715.26
-612194.64 802753.75
-612157.5 802794.5
-612137.13 802816.69
-612052.45 802903.18
-612042.04 802919.48
-612020.01 802977.14
-612014.43 802994.12
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612856.63 802582.78
-Region  1
-  112
-606170.89 808991.76
-606000.27 809001.01
-605985.72 808982.58
-605985.72 808966.32
-605907.83 808987.13
-605898.32 808972.59
-605885.65 808952.35
-605859.02 808914.41
-605851.41 808899.86
-605855.19 808878.35
-605865.92 808813.33
-605870.87 808785.06
-605807.26 808827.46
-605785.36 808840.19
-605759.21 808837.36
-605732.35 808832.41
-605492.07 808780.78
-605454.46 808832.98
-605424.57 808877.36
-605368.73 808920.47
-605333.4 808950.86
-605282.43 808988.68
-605217.92 809043.75
-605145.18 809100.09
-605130.65 809120.97
-605135.09 809134.25
-605145.87 809150.06
-605159.82 809175.36
-605169.68 809194.25
-605096.7 809242.63
-605006.81 809298.14
-605157.61 809399.87
-605097.34 809461.38
-605099.44 809502.79
-605168.09 809436.23
-605169.34 809580.86
-605195.79 809517.55
-605204.81 809479.42
-605230.23 809454.82
-605252.15 809446.01
-605389.08 809461.97
-605422.29 809466.07
-605443.61 809468.12
-605455.09 809472.22
-605435.82 809497.64
-605403.84 809531.67
-605431.72 809537
-605452.63 809539.05
-605474.77 809544.38
-605512.07 809575.53
-605544.79 809612.74
-605593.58 809665.02
-605603.29 809657.63
-605660.05 809726.83
-605703.5 809752.05
-605704.61 809779.41
-605727.51 809801.32
-605748.92 809829.7
-605770.33 809893.93
-605781.5 809926.58
-605817.13 810005.93
-605849 810005.43
-605872.6 810084.71
-605885.78 810105.33
-605937.34 810100.75
-606088.7 810097.9
-606174.24 810097.03
-606202.88 810092.44
-606235.55 810063.29
-606255.59 810021.4
-606259.89 809986.16
-606285.1 809983.3
-606862.51 809952.24
-607102.65 809940.33
-606862.51 809952.24
-606853.11 809946.9
-606799.42 809935.88
-606742.37 809924.13
-606672.95 809612.03
-606657.76 809606.59
-606622.24 809575.65
-606614.22 809569.35
-606617.08 809510.33
-606619.95 809482.26
-606597.03 809463.35
-606591.3 809457.48
-606590.73 809445.02
-606608.49 809446.74
-606631.41 809451.32
-606767.77 809476.53
-606767.77 809459.92
-606736.25 809390.02
-606678.67 809266.55
-606667.5 809242.77
-606641.14 809188.35
-606631.46 809169.19
-606626.01 809149.57
-606620.9 809090.32
-606617.94 809073.74
-606615.86 809054.81
-606612.02 809025.79
-606592.81 809038.41
-606515.42 808961.79
-606472.31 808920.79
-606423.55 808872.03
-606415.07 808845.88
-606400.93 808890.41
-606362.41 809015.79
-606337.68 809006.61
-606281.14 808983.28
-606236.61 808986.82
-606170.89 808991.76
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605987.79 809421.54
-Region  1
-  31
-611033.95 794075.11
-611229.67 794817.46
-611321.14 794825.77
-611447.06 794837.22
-611447.21 794837.24
-611447.42 794837.26
-611683.12 794858.69
-611692.15 794859.51
-611529.6 794224.95
-611517.67 794169.95
-611440.73 793940.9
-611383.48 793852.16
-611358.9 793818.52
-611337.91 793785.13
-611320.74 793763.18
-611255.38 793778.93
-611250.6 793812.38
-611222.12 793813.64
-611121.29 793830.46
-611089.37 793808.93
-611064.37 793823.54
-611027.41 793805.66
-610968.07 793766.72
-610965.4 793790.42
-610957.35 793810.1
-610951.64 793822.17
-610930.05 793858.15
-610901.33 793884.54
-610972.59 793985.92
-610999.9 794023.18
-611033.95 794075.11
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611318.38 794316.76
-Region  1
-  63
-603545.24 799359.77
-603503.64 799311.51
-603462.84 799269.74
-603432.67 799252.59
-603411.72 799248.46
-603365.35 799257.35
-603298.4 799276.81
-603246.98 799272.01
-603185.72 799274.14
-603131.91 799207.55
-603106.7 799175.71
-603080.59 799147.47
-603068.87 799135.21
-603063.81 799129.62
-603054.22 799121.36
-602957.1 799168.36
-602877.16 799203.26
-602811.09 799238.43
-602806.96 799246.06
-602803.62 799253.34
-602781.69 799284.49
-602728.23 799328
-602593.11 799437.33
-602509.6 799501.68
-602444.71 799546.65
-602372.08 799614.12
-602383.14 799649.15
-602372.08 799684.91
-602356.97 799738
-602554.76 799801.05
-602528.31 799887.44
-602727.67 799949.59
-602672.02 800121.84
-603072.2 800250.71
-603048.68 800330.17
-603050.77 800346.37
-603255.17 800310.3
-603307.18 800298.01
-603404.46 800284.4
-603494.88 800287.01
-603540.88 800287.01
-603595.76 800287.01
-603639.41 800291.98
-603668.94 800264.01
-603724.86 800205.99
-603752.57 800153.72
-603776.61 800087.34
-603798.82 800007.63
-603806.14 799971.03
-603819.21 799915.62
-603826.27 799874.15
-603833.73 799826.09
-603855.8 799723.35
-603876.44 799664.93
-603792.92 799665.88
-603720.52 799628.73
-603704.65 799603.64
-603685.28 799538.19
-603704.17 799519
-603707.35 799475.18
-603646.38 799433.59
-603598.75 799400.56
-603545.24 799359.77
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603163.15 799757.21
-Region  1
-  38
-609861.18 805077.29
-609733.96 805090
-609607.39 805106.52
-609523.1 805121.79
-609454.81 805134.54
-609369.67 805155.02
-609374.22 805192.86
-609341.44 805195.14
-609315.05 805205.16
-609255.86 805252.51
-609203.05 805283.93
-609179.83 805294.4
-609186.43 805306.89
-609192.35 805323.74
-609207.37 805350.6
-609222.85 805382.01
-609214.7 805422.42
-609209.63 805449.75
-609210.34 805476.11
-609413.62 805427.59
-609514.69 805440.75
-609587.99 805477.17
-609624.86 805507.22
-609699.75 805604.81
-609885.73 805906.92
-609893.46 805919.58
-610094.02 805720.96
-610092.2 805700.02
-610102.22 805628.99
-610143.71 805366.36
-610166.82 805371.49
-610151.84 805297.47
-610140 805202.88
-610110.86 805202.88
-610054.41 805194.23
-609973.82 805152.79
-609900.44 805089.92
-609861.18 805077.29
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609761.16 805403.61
-Region  1
-  46
-603636.66 802748.96
-603969.46 802283.23
-603449.54 801903.15
-603445.36 801894.78
-603095.38 801786.01
-603085.69 801782.68
-603130.12 801851.39
-603024.52 801989.4
-602972.24 802050.56
-602951.6 802075.92
-602905.07 802138.13
-602878.41 802171.58
-602846 802212.88
-602826.66 802238.5
-602803.13 802275.61
-602786.54 802305.43
-602727.24 802464.89
-602769.72 802518.64
-602813.68 802658.89
-602811.72 802715.93
-602818.6 802723.79
-603126.4 802871.3
-603123.45 802886.05
-603124.43 802900.8
-603123.45 802923.42
-603129.35 802964.72
-603175.57 803015.86
-603213.92 803006.02
-603262.1 802995.2
-603294.55 802992.25
-603361.42 802994.22
-603429.28 802994.22
-603486.31 802995.2
-603528.6 803003.07
-603564 803015.86
-603604.32 803040.44
-603663.25 803094.74
-603694.96 803063.05
-603726.35 803032.89
-603746.66 803010.73
-603773.12 802986.73
-603697.61 802862.69
-603580.36 802844.68
-603573.71 802824.24
-603603.2 802791.82
-603636.66 802748.96
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603322.18 802437.6
-Region  1
-  92
-615881.15 797085
-615799.85 797079.48
-615755.44 797092.3
-615691.26 797132.34
-615648.19 797143.71
-615592.63 797129.74
-615563.73 797117.35
-615536.75 797105.92
-615513.25 797095.45
-615507.74 797003.12
-615505.63 796988.77
-615504.05 796972.26
-615501.19 796953.21
-615499.6 796931.62
-615489.42 796780.46
-615357.04 796754.76
-615321.8 796799.53
-615294.11 796873.22
-615262.04 796943.74
-615238.22 796972.32
-615230.92 796976.78
-615144.71 797072.87
-615054.06 797163.56
-614935.14 797287.9
-614954.98 797310.96
-614948.95 797342.71
-614883.55 797429.39
-614866.09 797475.11
-614892.17 797531.51
-614972.59 797630.01
-615662.84 797779.82
-615694.38 797636.58
-615888.69 797679.13
-615855.35 797827.74
-616365.89 797936.74
-616372.55 797938.33
-616350.96 797889.71
-616359.85 797853.41
-616372.55 797788.42
-616395.07 797672.45
-616409.07 797619.84
-616505.91 797545.86
-616527.82 797587.14
-616555.12 797636.95
-617048.2 797869.77
-617056.26 797851.91
-617063.71 797832.81
-617000.57 797800.87
-617012.95 797772.3
-616994.54 797754.83
-616993.59 797733.88
-616988.23 797712.01
-616969.46 797531.94
-616949.75 797381.46
-616896.41 797357.76
-616904.88 797318.16
-616916.52 797278.58
-616978.53 797282.83
-617032.3 797275.84
-617088.17 797232.5
-617096.18 797163.93
-617166.23 796846.3
-617089.39 796845.21
-617045.15 796843.09
-616967.05 796857.12
-616890.64 796871.94
-616811.68 796886.33
-616785.86 796895.01
-616644.03 797042.6
-616605.71 797083.66
-616528.23 797162.83
-616411.82 797284.31
-616377.74 797318.81
-616277.83 797363.75
-616236.97 797367.77
-616189.98 797358.88
-616101.93 797310.63
-616135.78 797234.81
-616162.27 797181.08
-616199.49 797141.43
-616207.11 797108.62
-616198.43 797043.7
-616198.43 797012.37
-616210.28 796994.38
-616215.57 796979.14
-616174.93 796957.77
-616119.48 796963.9
-616109.95 797026.13
-616080.32 797069.37
-616052.62 797087.34
-616011.01 797097.54
-615881.15 797085
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 616015.31 797378.59
-Region  1
-  45
-613427.79 795096.34
-613480.74 795078.74
-613545.73 795060.19
-613567.41 795058.86
-613623.61 795026.12
-613698.39 795035.41
-613792.02 795042.28
-613894.24 795053.34
-613965.93 795060.86
-614003.17 794684.29
-613566.04 794432.95
-613578.19 794352.36
-613682.62 794255.45
-613494.11 794272.7
-613403.4 794245.27
-613339.92 794188.84
-613298.32 794121.58
-613278.2 794048.34
-613262.23 793954.84
-613217.39 793877.55
-613147.26 793857.04
-613061.38 793835.57
-613034.19 793881.37
-612410.34 794953.98
-612423.28 794962.94
-612433.5 794970.02
-612437.9 794987.39
-612476.85 795141.09
-612476.94 795141.43
-612476.96 795141.53
-612476.97 795141.57
-612477.01 795141.71
-612627.29 795734.74
-612638.47 795747.68
-612641.71 795751.43
-612697.83 795750.05
-613318.17 795364.78
-613288.33 795261.91
-613343.89 795280.01
-613330.24 795226.03
-613321.03 795191.11
-613389.93 795130.47
-613396.6 795130.18
-613391.52 795104.14
-613427.79 795096.34
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613117.15 794817.38
-Region  1
-  125
-608883.84 810564.75
-608868.03 810584.37
-608846.53 810604.62
-608811.12 810635.63
-608775.7 810669.18
-608714.22 810710.56
-608704.22 810717.29
-608687.15 810738.17
-608676.71 810757.36
-608694.71 810807.89
-608715.47 810854.96
-608727.83 810885.81
-608737.52 810926.77
-608739.01 810958.79
-608736.77 811001.25
-608718.15 811049.65
-608693.19 811105.14
-608672.34 811152.06
-608643.29 811193.77
-608615.74 811224.3
-608595.63 811251.12
-608586.69 811274.95
-608574.03 811298.03
-608561.01 811305.86
-608554.31 811352.78
-608537.88 811499.96
-608540.73 811534.71
-608555.54 811567.75
-608558.52 811631.04
-608501.66 811707.04
-608351.28 811865.17
-608358.79 811941.38
-608394.52 812030.63
-608405.34 812053.99
-608453.77 812095.58
-608469.39 812126.06
-608492.18 812124.92
-608582.2 812160.24
-608663.92 812227.75
-608685.6 812259
-608747.13 812380.36
-608779.04 812412.84
-608791.57 812450.44
-608856.8 812507.76
-608894.41 812514.59
-608930.31 812497.5
-608972.47 812519.15
-609016.34 812508.9
-609042.55 812522.57
-609067.32 812748.48
-609141.67 812812.01
-609280.12 812821.12
-609359.89 812793.21
-609429.97 812806.31
-609498.91 812838.22
-609608.3 812859.3
-609640.77 812863.85
-609672.11 812838.79
-609700.03 812837.08
-609819.39 812905.07
-609830.23 812877.26
-609838.57 812853.1
-609851.31 812831.68
-609866.42 812801.74
-609893.02 812768.33
-609917.15 812747.29
-609947.47 812726.87
-609985.83 812707.69
-610024.2 812686.65
-610060.08 812668.71
-610089.78 812651.39
-610102.16 812632.2
-610099.07 812605.6
-610102.16 812575.9
-610150.73 812548.43
-610168.22 812532.2
-610179.74 812529.46
-610000.22 809630.78
-609998.85 809612.29
-609996.72 809357.23
-609981.56 809389.5
-609968.95 809434.42
-609961.41 809491.99
-609948.78 809524.26
-609925.91 809532.26
-609865.95 809614.76
-609818.01 809649.23
-609759.05 809700.21
-609704.97 809749.16
-609618.01 809825.05
-609525.26 809867.21
-609495.75 809887.76
-609483.1 809908.32
-609467.82 809942.04
-609440.95 809996.32
-609030.7 809642.52
-608966.35 809770.5
-608948.96 809808.98
-608925.77 809844.29
-608901.53 809871.17
-608880.65 809897.35
-608858.84 809920.56
-608835.65 809939.53
-608861.11 809977.07
-608841.44 809991.18
-608813.51 810010.69
-608808.24 810042.84
-608811.67 810058.34
-608764.76 810088.91
-608781.63 810128.44
-608806.13 810175.6
-608824.78 810210.13
-608846.2 810230.86
-608862.78 810243.29
-608889.03 810257.8
-608842.74 810330.33
-608827.96 810380.69
-608826.07 810394.61
-608830.03 810406.75
-608841.8 810418.52
-608854.95 810442.06
-608868.1 810481.51
-608879.87 810511.28
-608892.68 810540.07
-608883.84 810564.75
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609396.71 811328.99
-Region  1
-  72
-603297.42 801493.83
-603212.21 801560.22
-603157.84 801611.45
-603081.47 801771.31
-603085.69 801782.68
-603095.38 801786.01
-603445.36 801894.78
-603449.54 801903.15
-603969.46 802283.23
-604014.39 802221.69
-604034.7 802227.22
-604070.79 802238.34
-604169.49 802267.23
-604228.58 802286.31
-604357.88 802233.63
-604401.83 802173.95
-604444.54 802109.53
-604492.92 802036.11
-604516.67 802005.15
-604468.01 801985.29
-604441.52 801974.84
-604400.23 801959.8
-604344.49 801926.3
-604315.97 801903.44
-604288.58 801871.11
-604255.96 801815.71
-604232.57 801777.55
-604210.42 801742.47
-604187.03 801703.08
-604150.78 801637.8
-604132.87 801558.43
-604121.71 801165.66
-604057.47 801174.67
-603651.26 801262.67
-603605.1 801256.52
-603557.76 801223.56
-603540.48 801153.12
-603528.78 801103.88
-603491.55 800930.01
-603604.18 800936.16
-603611.57 800922.01
-603615.88 800906.62
-603626.95 800876.46
-603637.72 800842.32
-603648.8 800800.47
-603662.34 800772.16
-603670.96 800722.92
-603671.58 800671.22
-603670.65 800641.95
-603658.56 800480.45
-603642.55 800412.19
-603642.03 800346.34
-603641.5 800304.53
-603639.41 800291.98
-603595.76 800287.01
-603540.88 800287.01
-603494.88 800287.01
-603404.46 800284.4
-603307.18 800298.01
-603255.17 800310.3
-603050.77 800346.37
-603060.7 800380.35
-603199.96 800766.93
-603222.7 800835.15
-603234.2 801017.07
-603242.29 801113.52
-603254.83 801154.29
-603283.56 801194.55
-603360.41 801305.89
-603346.29 801349.81
-603318.59 801432.92
-603297.42 801493.83
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603680.45 801401.37
-Region  1
-  65
-610984.16 793404.51
-610985.7 793442.21
-610958.01 793497.98
-610949.54 793535.29
-610957.33 793563.41
-610949.37 793626.51
-610937.88 793653.88
-610961.18 793708.26
-610939.67 793736.41
-610968.07 793766.72
-611027.41 793805.66
-611064.37 793823.54
-611089.37 793808.93
-611121.29 793830.46
-611222.12 793813.64
-611250.6 793812.38
-611255.38 793778.93
-611320.74 793763.18
-611337.91 793785.13
-611358.9 793818.52
-611383.48 793852.16
-611440.73 793940.9
-611517.67 794169.95
-611896.98 794073.48
-611860.96 793947.03
-612101.64 793309
-612061 793274.71
-612047.35 793237.25
-612043.05 793200.9
-612035.91 793107.08
-612028.61 793030.24
-612008.13 792990.72
-611912.24 792924.04
-611875.73 792921.82
-611849.72 792871.08
-611841.46 792851.39
-611792.25 792738.67
-611716.69 792779.63
-611752.29 792880.26
-611685.3 792894.88
-611606.07 792910.28
-611628.29 792821.06
-611526.37 792754.4
-611406.86 792661.53
-611376.23 792650.27
-611314 792669
-611223.83 792677.57
-611170.43 792718.61
-611110.31 792759.12
-611048.39 792805.72
-611026.48 792803.81
-610989.97 792806.98
-610945.2 792827.62
-610866.61 792874.14
-610847.88 792905.89
-610837.4 792910.33
-610723.74 792824.61
-610689.13 792836.04
-610778.82 792942.88
-610920.68 793142.15
-610913.76 793179.07
-610914.53 793239.46
-610915.5 793289.27
-610953.57 793352.74
-610984.16 793404.51
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 611470.62 793350.38
-Region  1
-  52
-612366.25 807653.17
-612197.18 807901.4
-612083.89 807853.2
-612055.07 807877.05
-612161.9 808010.21
-612254.7 808154.88
-612271.82 808185.24
-612429.45 808268.11
-612463.31 808297.9
-612497.62 808303.77
-612520.19 808337.18
-612549.53 808335.82
-612564.88 808308.28
-612563.53 808277.14
-612573.46 808245.08
-612594.68 808222.06
-612605.51 808191.81
-612590.39 808174.47
-612595.35 808154.61
-612608.9 808148.74
-612648.17 808155.06
-612640.76 808081.95
-612641.98 808038.94
-612647.65 808016.79
-612657.76 807998.44
-612686.22 807973.12
-612716.58 807942.75
-612743.14 807921.86
-612760.21 807897.18
-612787.46 807857.81
-612773.46 807829.83
-612779.33 807769.79
-612773.46 807722.11
-612767.96 807680.54
-612778.35 807656.7
-612794.14 807637.79
-612790.3 807596.68
-612756.94 807567.76
-612719.17 807543.41
-612699.8 807522.54
-612695.82 807505.15
-612684.39 807509.62
-612672.47 807514.59
-612630.51 807557.05
-612585.29 807574.93
-612514.24 807587.85
-612480.45 807590.34
-612447.16 807591.83
-612413.87 807599.28
-612391.51 807606.73
-612379.58 807626.11
-612366.25 807653.17
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612481.05 807905.21
-Region  1
-  38
-608585.45 800634.84
-608485.48 800524.34
-608395.09 800424.77
-608382.87 800413.87
-608412.28 800388.75
-608447.97 800355.37
-608464.83 800338.85
-608457.22 800329.26
-608362.71 800227.15
-608293.48 800266.34
-608248.09 800300.38
-608215.47 800350.98
-608185.21 800434.2
-608155.9 800496.61
-608109.56 800555.23
-608045.26 800632.77
-607963.46 800724.06
-607996.63 800748.32
-608059.36 800804.59
-608126.53 800862.13
-608211.21 800931.15
-608271.73 800985.05
-608370.43 801040.3
-608370.05 801004.2
-608363.2 800990.14
-608365.86 800977.6
-608394.37 800943.39
-608384.11 800931.99
-608420.27 800885.39
-608448.09 800861.96
-608462.88 800838.47
-608480.32 800817.66
-608495.46 800777.8
-608508.73 800761.97
-608509.33 800735.4
-608498.72 800715.39
-608511.92 800701.43
-608585.45 800634.84
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608292.24 800644.99
-Region  1
-  191
-618080.5 795941.46
-618037.05 795915.08
-617968.57 795841.89
-617921.23 795831.02
-617902.99 795810.07
-617897.37 795760.58
-617722.51 795605.86
-617678.82 795560.28
-617656.02 795523.57
-617652.34 795499.25
-617604.74 795488.75
-617585.1 795451.4
-617566.1 795420.38
-617519.88 795371
-617459.73 795331.75
-617428.85 795311.82
-617388.19 795284.27
-617357.46 795223.74
-617348.34 795172.36
-617304.49 795118.43
-617281.99 795099.42
-617186.15 795081.96
-617170.63 795083.51
-617144.44 795138.39
-617061.54 795146.24
-617012.71 795118.83
-616966.57 795084.83
-616915.92 795031.65
-616895.15 794998.54
-616763.8 794950.02
-616749.66 794918.98
-616775.17 794882.73
-616779.77 794871.67
-616765.33 794852.62
-616744.94 794829.71
-616725.85 794814.36
-616728.17 794756.44
-616697.75 794769.96
-616663.91 794794.89
-616621.53 794848.05
-616593.07 794911.97
-616590.56 794969.57
-616615.27 795040.47
-616676.06 795118.96
-616753.95 795204.43
-616812.84 795263.3
-616867.29 795325.97
-616921.12 795400.03
-616973.04 795453.21
-617008.52 795527.27
-616961.31 795531.17
-616927.23 795530.33
-616872.62 795531.39
-616779.49 795531.61
-616765.1 795531.25
-616698.64 795612.31
-616657.15 795663.77
-616612.5 795720.29
-616596.85 795836.23
-616585.42 795931.11
-616636.02 796003.67
-616646.03 796017.76
-616593.51 796066.49
-616552.4 796134.85
-616513.17 796181.05
-616044.15 796393.6
-616101.94 796550.5
-616072.73 796637.49
-616063.84 796660.35
-616057.49 796678.73
-616051.14 796702.86
-616043.74 796731.02
-616034.63 796784.14
-616075.27 796869.87
-616101.41 796910.16
-616119.48 796963.9
-616174.93 796957.77
-616215.57 796979.14
-616210.28 796994.38
-616198.43 797012.37
-616198.43 797043.7
-616207.11 797108.62
-616199.49 797141.43
-616162.27 797181.08
-616135.78 797234.81
-616101.93 797310.63
-616189.98 797358.88
-616236.97 797367.77
-616277.83 797363.75
-616377.74 797318.81
-616411.82 797284.31
-616528.23 797162.83
-616605.71 797083.66
-616644.03 797042.6
-616785.86 796895.01
-616811.68 796886.33
-616890.64 796871.94
-616967.05 796857.12
-617045.15 796843.09
-617089.39 796845.21
-617166.23 796846.3
-617096.18 797163.93
-617088.17 797232.5
-617032.3 797275.84
-616978.53 797282.83
-616916.52 797278.58
-616904.88 797318.16
-616896.41 797357.76
-616949.75 797381.46
-616969.46 797531.94
-616988.23 797712.01
-616993.59 797733.88
-616994.54 797754.83
-617012.95 797772.3
-617000.57 797800.87
-617063.71 797832.81
-617056.26 797851.91
-617048.2 797869.77
-617161.99 797964.98
-617204.45 798001.02
-617282.29 797990.23
-617335.43 797965.53
-617380.99 797951.58
-617440.5 797959.15
-617482.93 797972.41
-617521.7 797982.33
-617587.27 797993.42
-617644.88 797994.62
-617628.01 797951.72
-617600.77 797912.66
-617626.42 797816.84
-617645.04 797785.04
-617641.16 797776.11
-617606.64 797757.88
-617601.6 797745.86
-617610.52 797712.89
-617610.72 797685.17
-617619.64 797674.31
-617617.31 797657.24
-617616.54 797644.44
-617639.81 797639.4
-617653 797643.28
-617671.61 797655.3
-617679.37 797655.3
-617693.33 797642.12
-617734.84 797614.58
-617739.49 797582.77
-617755.19 797574.43
-617767.61 797570.55
-617770.71 797518.18
-617782.35 797491.41
-617815.9 797454.36
-617848.1 797413.23
-617856.24 797389.18
-617846.55 797369.39
-617858.96 797352.32
-617918.9 797320.29
-617926.66 797306.32
-617946.06 797294.3
-617946.45 797284.98
-617959.64 797290.03
-617990.48 797266.93
-618016.48 797228.91
-618047.91 797186.61
-618099.51 797210.67
-618233.56 797098.34
-618232.79 797052.55
-618271.98 796981.55
-618265.96 796926.6
-618277.21 796889.35
-618277.21 796841.24
-618274.3 796788.3
-618290.21 796727.78
-618301.66 796646.9
-618374.02 796562.09
-618395.75 796497.68
-618376.16 796418.71
-618361.8 796392.72
-618327.07 796374.31
-618321.64 796334.34
-618319.31 796294.38
-618324.55 796206.48
-618323.38 796163.8
-618274.11 796156.82
-618248.89 796144.01
-618211.25 796102.11
-618181.18 796061.15
-618184.68 796008
-618144.71 795962.99
-618118.53 795949.61
-618080.5 795941.46
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 617256.44 796504.65
-Region  1
-  49
-603006.78 789927.79
-603099.22 789659.61
-603229.11 789305.8
-603293.97 789142.02
-603302.86 789119.79
-603009.94 788916.44
-602971.52 788892.62
-602915.01 788863.73
-602891.19 788854.52
-602850.55 788883.1
-602814.67 788913.93
-602704.81 789000.93
-602636.82 789058.12
-602594.91 789089.87
-602571.42 789102.89
-602465.37 789079.39
-602458.71 789088.6
-602443.15 789107.02
-602408.86 789124.48
-602337.1 789163.22
-602348.21 789182.58
-602309.34 789309.75
-602269.34 789372.62
-602226.3 789436.69
-602194.56 789483.01
-602176.63 789505.63
-602260.62 789554.65
-602150.52 790059.94
-602189.11 790068.06
-602256.85 790084.26
-602359.93 790102.67
-602367.3 790118.86
-602326.06 790157.15
-602270.84 790386.88
-602250.57 790481.5
-602388.26 790512.43
-602399.31 790462.36
-602419.92 790373.26
-602432.8 790305.89
-602439.43 790275.7
-602551.35 790308.1
-602634.55 790244.78
-602722.91 790192.5
-602805.38 790144.64
-602846.26 790172.99
-602855.1 790180.35
-602919.89 790188.45
-602935.35 790140.59
-603006.78 789927.79
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 602688 789606.2
-Region  1
-  160
-598876.92 788917.84
-598880.32 788962.71
-598868.21 789001.68
-598864.3 789063.44
-598834.06 789118.92
-598809.97 789164.21
-598797.09 789192.28
-598826.3 789218.32
-598889.49 789262.45
-598909.49 789290.39
-598924.73 789322.46
-598932.98 789365.96
-598927.07 789424.22
-598918.24 789490.92
-598908.72 789563.32
-598899.97 789624.43
-598931.53 789680.6
-598949.1 789726.68
-599045.76 789659.14
-599048.92 789611.81
-599055.27 789562.01
-599056.85 789548.99
-599081.31 789551.51
-599090.84 789646.77
-599134.97 789737.62
-599149.58 789759.21
-599186.73 789834.46
-599241.97 789947.46
-599327.26 790100.43
-599407.92 790165.84
-599507.63 790202.04
-599613.06 790200.77
-599779.45 790144.25
-599822.32 790137.6
-599892.18 790139.51
-599944.89 790155.39
-599995.06 790178.88
-600091.28 790263.68
-600166.86 790308.14
-600236.08 790322.11
-600302.13 790324.02
-600352.94 790315.76
-600418.67 790289.44
-600479.64 790246.25
-600621.84 790150.3
-600628.86 790142.07
-600617.45 790116.06
-600619.99 790081.76
-600611.74 790039.21
-600562.2 789934.42
-600655.85 789888.38
-600725.74 789861.04
-600765.11 789862.31
-600814.02 789883.27
-600856.79 789915.64
-600912.45 789963.29
-600944.84 789980.44
-601070.14 790019.48
-601097.91 790022.08
-601136.32 790015.73
-601113.78 789989.38
-601104.89 789975.41
-601102.03 789947.15
-601104.57 789923.33
-601110.92 789903.97
-601055.53 789883.16
-601052.04 789862.84
-601048.54 789845.7
-601046 789831.73
-601041.57 789811.86
-601043.47 789795.4
-601044.46 789774.91
-601047.63 789769.51
-601043.19 789751.09
-601044.08 789742.87
-601041.28 789728.23
-601049.22 789707.6
-601073.35 789681.24
-601141.29 789626.63
-601167.01 789607.57
-601171.13 789592.01
-601161.29 789559.94
-601160.97 789539.3
-601183.52 789472.31
-601195.59 789424.68
-601198.13 789402.45
-601198.13 789385.94
-601188.28 789371.34
-601182.55 789360.58
-601154.95 789335.46
-601125.1 789327.2
-601150.58 789222.13
-601188.34 789105.91
-601126.74 789081.44
-601109.65 789068.14
-601092.84 789066
-601077.81 789074.25
-601052.2 789096.07
-601018.34 789094.37
-600989.76 789092.68
-600968.17 789088.87
-600917.58 789132.26
-600879.26 789178.19
-600849.21 789228.39
-600782.53 789200.24
-600749.93 789184.36
-600726.43 789156.85
-600691.51 789131.02
-600662.08 789122.77
-600623.14 789097.79
-600582.29 789092.92
-600539.37 789082.62
-600522.17 789080.44
-600517.72 789096.96
-600487.24 789178.25
-600239.64 789098.24
-600079.3 789043.31
-599927.4 788948.22
-599890.88 788916.47
-599814.56 788866.79
-599740.43 788821.94
-599735.99 788767.33
-599762.82 788648.03
-599825.71 788435.97
-599830.26 788289.35
-599828.14 788222.67
-599806.13 788226.91
-599783.91 788227.96
-599758.72 788226.48
-599736.2 788230.76
-599713.16 788245.38
-599691.73 788270.61
-599663.79 788305.34
-599630.05 788371.76
-599632.15 788413.92
-599634.15 788450.17
-599639.45 788503.57
-599589.07 788537.1
-599464.99 788617.74
-599450.17 788620.95
-599402.2 788607.46
-599361.34 788593.64
-599319.68 788582.02
-599297.94 788575.54
-599261.28 788591.56
-599223.23 788603.98
-599189.28 788616.07
-599149.62 788606.66
-599126.19 788602.05
-599073.81 788590.12
-599058.19 788590.52
-599047.77 788601.74
-599026.64 788681.8
-598996.39 788693.61
-598965.35 788706.03
-598899.25 788732.53
-598858.19 788747.95
-598881.12 788881.06
-598881.72 788902.49
-598876.92 788917.84
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 599914.66 789443.59
-Region  1
-  74
-604348.14 806239.41
-604375 806227.7
-604402.2 806229.46
-604430.44 806234.97
-604460.05 806247.37
-604488.97 806267.34
-604521.34 806304.52
-604540.96 806347.52
-604554.74 806368.87
-604580.91 806364.74
-604610.52 806324.8
-604661.82 806260.45
-604787.5 806099.69
-604837.08 806036.33
-604854.3 805993.63
-604835.03 805920.66
-604823.31 805861.41
-604823.31 805834.55
-604844.66 805760.18
-604867.39 805691.32
-604891.49 805658.95
-604922 805618.84
-604951.09 805599.21
-604978.91 805573.89
-604970.62 805527.08
-604942.06 805461.3
-604906.87 805362.5
-604901.61 805344.23
-604857.51 805367.97
-604827.84 805367.97
-604804.09 805348.47
-604808.33 805306.92
-604793.07 805352.71
-604793.07 805353.55
-604749.83 805431.56
-604702.34 805517.2
-604591.67 805848.32
-604522.99 805749.11
-604472.96 805683.82
-604440.74 805674.5
-604404.28 805677.04
-603740.77 805799.57
-603701.85 805813.72
-603675.68 805840.58
-603630.23 805910.13
-603600.11 805955.46
-603569.76 805987.74
-603550.15 805995.98
-603512.83 806016.24
-603493.86 806032.7
-603473.62 806048.53
-603454.97 806083.46
-603449.63 806093.46
-603459.97 806261.74
-603552.24 806540.6
-603594.78 806531.1
-603634.61 806523.86
-603664.48 806600.8
-603686.65 806619.8
-603750.01 806651.03
-603812.92 806684.97
-603866.96 806746.78
-603905.46 806655.66
-603970.77 806527.56
-604010.71 806456.63
-604014.15 806410.49
-604104.01 806413.96
-604133.62 806416.71
-604132.35 806377.8
-604246.22 806376.45
-604255.17 806271.77
-604247.6 806218.06
-604298.56 806230.45
-604348.14 806239.41
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604165.01 806057.47
-Region  1
-  90
-612399.88 805918.14
-612384.96 805941.14
-612324.09 805983.12
-612265.25 806019.2
-612156.61 806079.99
-612101.72 806118.35
-612071.08 806149.53
-612050.29 806274.87
-612045.5 806350.43
-612053.58 806407.09
-612067.08 806483.89
-612069.47 806517.19
-612041.1 806592.44
-612007.66 806657.35
-612002.86 806670.67
-611998.15 806679.13
-612710.99 806771.8
-613074.95 806760.88
-613113.72 806757.73
-613134.45 806731.18
-613109.57 806668.13
-613102.93 806602.6
-613113.72 806576.05
-613156.43 806578.02
-613240.64 806570.25
-613317.79 806576.05
-613421.48 806600.11
-613466.28 806625.83
-613535.13 806662.33
-613551.31 806694.25
-613566.24 806726.6
-613582 806772.23
-613578.68 806817.85
-613601.91 806852.7
-613610.21 806872.6
-613647.54 806890.85
-613715.56 806852.7
-613767.41 806867.18
-613881.06 806943.5
-613947.42 806985.81
-613970.65 806986.63
-613998.03 806967.56
-614022.91 806935.2
-614035.36 806909.49
-614085.96 806928.57
-614086.79 806974.19
-614087.37 807014.72
-614092.6 807067.1
-614096.74 807110.24
-614100.89 807159.18
-614113.34 807186.56
-614125.36 807210.2
-614144.55 807227.88
-614164.82 807249.38
-614207.26 807275.93
-614250.95 807291.72
-614298.44 807303.72
-614340.22 807321.36
-614377.55 807335.46
-614408.62 807344.79
-614439.01 807347.31
-614234.49 806650.9
-614280.5 806556.56
-614315.34 806476.93
-614351.01 806398.95
-614409.08 806413.88
-614456.46 806429.39
-614491.61 806459.94
-614522.29 806504.7
-614510.68 806471.52
-614500.73 806443.31
-614439.34 806252.52
-614298.72 806107.69
-613966.89 805614.13
-613342.23 805375.22
-613316.72 805337.1
-613261.83 805445.81
-613229.86 805481.51
-613198.42 805505.1
-613152.85 805537.23
-613047.34 805609.71
-612998.31 805642.75
-612948.76 805726.41
-612949.56 805759.16
-612913.32 805766.08
-612791.29 805814.58
-612618.37 805870.71
-612427.06 805845.67
-612418.53 805883.5
-612399.88 805918.14
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613334.14 806264.58
-Region  1
-  76
-609171.37 802336.92
-608653.87 801785.01
-608628.47 801807.87
-608587.83 801843.43
-608538.3 801898.04
-608494.95 801882.42
-608468.36 801872.94
-608450.67 801829.46
-608434.16 801785.01
-608420.19 801755.8
-608407.49 801729.13
-608402.41 801699.92
-608407.03 801663.8
-608432.11 801601.46
-608466.32 801536.85
-608467.84 801477.55
-608455.68 801412.18
-608460.24 801369.61
-608452.11 801349.64
-608457.43 801317.33
-608461.83 801250.25
-608466.01 801190.59
-608458.41 801174.25
-608437.69 801158.87
-608382.59 801130.37
-608343.44 801080.58
-608338.12 801068.04
-608338.12 801055.88
-608370.43 801040.3
-608271.73 800985.05
-608211.21 800931.15
-608126.53 800862.13
-608059.36 800804.59
-607996.63 800748.32
-607963.46 800724.06
-607955.9 800732.57
-607919.96 800770.39
-607863.23 800836.59
-607813.11 800895.22
-607752.59 800943.44
-607663.7 800982.21
-607489.23 801038.5
-607400.34 801085.78
-607354.01 801142.52
-607324.69 801208.71
-607282.11 801351.61
-607260.87 801475.39
-607233.45 801606.83
-607159.23 801937.34
-607154.97 802014.89
-607153.31 802119.64
-607096.29 802200.8
-607147.88 802206.48
-607210.8 802531.55
-607263.44 802611.88
-608068.17 802768.36
-607844.46 803395.24
-607875.29 803403.91
-608993.06 803798.31
-609016.18 803730.89
-609028.22 803703.43
-609428.65 802549.41
-609466.7 802430.45
-609423.6 802424.77
-609351.6 802418.41
-609285.14 802447.79
-609236.5 802481.02
-609176.78 802519.55
-609144.99 802541.7
-609115.62 802561.44
-609076.61 802570.11
-609053.25 802562.17
-609034.47 802540.98
-609026.76 802512.56
-609020.02 802475
-609171.37 802336.92
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608217.67 802309.68
-Region  1
-  70
-613550.47 801066.75
-613469.5 800980.53
-613391.76 800902.3
-613358.13 800861.04
-613340.78 800837.96
-613311.71 800756.51
-613286.46 800688.67
-613261.69 800625.42
-613227.43 800560.9
-613155.34 800419.2
-613146.55 800447.41
-613173.59 800531.19
-613186.13 800580.4
-613182.49 800607.09
-613049.71 800690.62
-613061.06 800707.96
-612995.52 800754.37
-612980.15 800732.99
-612909.31 800779.97
-612860.96 800811.66
-612805.35 800845.75
-612765.88 800906.74
-612755.03 800915.43
-612708.08 800955.19
-612681.87 800977.06
-612640.56 800997.1
-612581.54 800999.29
-612533.91 801007.54
-612498.99 801025.61
-612467.55 801051.96
-612434.33 801078.8
-612401.5 801103.43
-612330.35 801051.83
-612262.73 801046.65
-612202.12 801049.14
-612154.18 801062.16
-612112.59 801078.67
-612096.39 801087.88
-612079.38 801095.61
-612067.23 801123.3
-612055.9 801176.45
-612047.14 801258.06
-612054.86 801353.59
-612084.13 801469.99
-612147.1 801666.5
-612184.23 801789.66
-612241.29 801763.85
-612477.74 801648.99
-612524.1 801697.89
-612691.51 801887.86
-612760.57 801914.87
-612836.39 801923.16
-612862 801913.72
-612872 801908.46
-612971.99 801859.33
-612987.64 801844.29
-613056.98 801823.43
-613096.57 801788.75
-613137.07 801719.83
-613159.77 801684.54
-613182.48 801640.05
-613278.37 801474.52
-613342.45 801417.8
-613395.83 801381.3
-613547.43 801333.85
-613605.65 801319.27
-613669.61 801291.62
-613691.25 801275.75
-613621.75 801168.42
-613550.47 801066.75
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 612833.04 801294.54
-Region  1
-  61
-611392.22 802817.89
-610905.71 802674.25
-610706.29 802621.5
-610649.24 802604.79
-610606.55 802594.63
-610534.73 802589.21
-610448.34 802586.37
-610376 802578.65
-610324.88 802567.56
-610264.84 802536
-610226.26 802503.69
-610186.95 802454.71
-610121.37 802351.88
-610070.33 802426.25
-610014.55 802494.97
-610028.58 802565.8
-610027.7 802604.13
-610029.67 802626.88
-610022.52 802652.74
-610036.6 802657.99
-610119.62 802679.22
-610122.36 802688.26
-610127.61 802705.28
-610143.23 802747.11
-610164.04 802780.73
-610170.28 802797.22
-610254.51 802801.7
-610280.45 802813.87
-610321.76 802840.13
-610369.95 802871.37
-610400.05 802891.87
-610436.56 802900.2
-610485.23 802902.44
-610523.02 802893.47
-610546.56 802888.49
-610658.64 802961.82
-610789.14 803045.9
-610808.19 803059.51
-610822.69 803069.36
-610805.46 803133.68
-610794.09 803187.31
-610757.88 803346.52
-611009.44 803397.88
-611116.02 803411.38
-611211.51 803419.1
-611244.3 803409.9
-611298.8 803391.57
-611342.52 803374.22
-611396.64 803355.97
-611550.26 803274.61
-611592.49 803249.77
-611618.26 803232.97
-611602.89 803203.18
-611589.76 803180.76
-611577.91 803163.47
-611552.61 803124.72
-611488.8 803036.03
-611449.88 802986.8
-611408.02 802923.55
-611395.89 802840.05
-611392.22 802817.89
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610883.78 802946.02
-Region  1
-  23
-601022.17 787562.68
-601207.17 786885.06
-600467.15 786800.69
-600458.12 786799.13
-600458.43 786832.15
-600448.78 786900.67
-600442.23 786959.24
-600434.45 787043.64
-600424.48 787142.74
-600419.81 787184.79
-600398.32 787222.79
-600373.4 787267.64
-600318.27 787320.57
-600248.51 787386.59
-600226.39 787421.16
-600194 787530.48
-600182.33 787552.79
-600188.68 787552.79
-601008.92 787619.22
-600980.58 787757.7
-601425.08 787809.42
-601512.71 787615.02
-601022.17 787562.68
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 600801.76 787289.54
-Region  1
-  187
-608049.29 809507.43
-608156.28 809436.81
-608203.72 809490.04
-608235.87 809525.35
-608270.13 809562.24
-608289.63 809583.85
-608302.81 809596.5
-608319.15 809617.06
-608339.7 809638.14
-608366.58 809658.69
-608391.35 809677.67
-608427.71 809711.83
-608458.28 809796.68
-608487.45 809789.99
-608519.68 809791.66
-608551.39 809796.92
-608584.51 809813.27
-608614.02 809840.68
-608634.05 809871.77
-608653.03 809906.56
-608667.78 809935.54
-608688.34 809965.06
-608712.58 809983.5
-608733.66 810013.02
-608746.84 810044.64
-608764.76 810088.91
-608811.67 810058.34
-608808.24 810042.84
-608813.51 810010.69
-608841.44 809991.18
-608861.11 809977.07
-608835.65 809939.53
-608858.84 809920.56
-608880.65 809897.35
-608901.53 809871.17
-608925.77 809844.29
-608948.96 809808.98
-608966.35 809770.5
-608953.7 809762.6
-608618.79 809289.07
-608536.04 809195.25
-608596.65 809150.98
-608644.88 809111.2
-608679.13 809081.15
-608740.8 809042.15
-608802.99 809023.18
-608868.35 809017.38
-608966.38 809012.11
-609055.88 808985.64
-609231.5 808888.78
-609314.77 808839.23
-609379.07 808801.81
-609450.23 808747
-609530.08 808678.2
-609706.64 808868.99
-609756.97 808909.8
-609808.62 808932.46
-609931.43 808879.23
-609979.39 808846.56
-610027.88 808734.29
-610074.79 808789.63
-610046.99 808868.72
-610018.61 808949.08
-609993.56 809027.74
-609980.03 809108.47
-609982.77 809177.31
-609989.89 809260.37
-609996.72 809357.23
-610048.14 809279.32
-610105 809190.08
-610168.41 809129.7
-610202.48 809101.78
-610255.58 809052.11
-610295.65 809007.24
-610323.73 808966.01
-610346.69 808903.05
-610349.43 808852.35
-610342.92 808811.59
-610329.22 808775.96
-610312.29 808749.58
-610302.47 808737.43
-610252.46 808663.64
-610213.78 808611.14
-610196.68 808585.79
-610210.72 808551.4
-610550.93 807790.34
-610554.17 807762.21
-610477.61 807755.8
-610438.68 807757.57
-610411.73 807755.8
-610391.54 807751.55
-610342.45 807743.07
-610265.21 807734.88
-610252.55 807733.63
-610197.09 807749.96
-610159.37 807758.46
-610113.15 807755.8
-610070.82 807753.96
-610022.86 807750.28
-609977.53 807750.8
-609948.02 807756.07
-609902.69 807780.32
-609885.56 807786.91
-609808.09 807815.37
-609774.35 807830.13
-609767.18 807835.73
-609758.54 807871.24
-609751.42 807893.94
-609731.66 807954.51
-609705.84 807954.51
-609648.39 807875.45
-609583.3 807787.21
-609532.17 807722.91
-609474.98 807649.93
-609419.11 807577.72
-609384.33 807532.39
-609349.54 807497.08
-609276.01 807456.79
-609249.66 807471.54
-609169.02 807491.05
-609115.79 807501.59
-609064.14 807508.44
-609019.34 807516.34
-608852.52 807648.89
-608919.19 807720.85
-608932.37 807753
-608920.25 807769.33
-608888.1 807778.29
-608868.07 807785.67
-608850.15 807799.9
-608841.19 807813.61
-608835.92 807826.26
-608833.28 807838.38
-608833.81 807857.35
-608921.83 807835.74
-608953.98 807838.38
-608977.17 807855.77
-608987.45 807881.83
-608984.81 807920.83
-608989.03 807953.51
-609003.78 807996.73
-609016.17 808044.93
-609015.64 808096.58
-609021.44 808161.41
-609021.44 808198.83
-609009.32 808221.49
-609028.82 808243.1
-609043.05 808260.49
-609000.1 808319.79
-608939.48 808348.25
-608865.17 808381.98
-608568.96 808656.64
-608504.66 808641.35
-608445.1 808620.8
-608338.37 808558.38
-608221.89 808516.75
-608186.05 808548.9
-608131.76 808591.59
-608030.57 808645.35
-607905.92 808703.03
-607797.87 808734.65
-607751.25 808744.67
-607671.58 808749.14
-607513.73 808753.17
-607231.62 808762.94
-607242.45 808795.44
-606840.95 808956.47
-606840.15 808990.46
-606851.18 809107.72
-607238.25 809392.98
-607408.54 809511.35
-607462.88 809545.64
-607535.57 809579.56
-607610.33 809606.56
-607647.01 809610.02
-607707.24 809610.02
-607753.62 809610.02
-607796.54 809612.09
-607829.07 809616.94
-607817.99 809637.01
-607874.76 809650.86
-607890.68 809652.93
-607914.91 809613.48
-607936.37 809588.56
-607959.21 809565.02
-607999.8 809537.81
-608049.29 809507.43
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 608852.72 808711.19
-Region  1
-  59
-616365.89 797936.74
-615855.35 797827.74
-615888.69 797679.13
-615694.38 797636.58
-615662.84 797779.82
-614972.59 797630.01
-615003.07 797659.86
-615038.61 797705.41
-615070.38 797743.61
-615075.46 797769.01
-615081.18 797826.79
-615093.92 797891.39
-615119.29 797933.13
-615164.91 797967.27
-615198.34 797999.73
-615240.89 798036.56
-615246.06 798074.15
-615261.97 798141.83
-615276.45 798228.98
-615285.34 798278.51
-615294.49 798324.66
-615307.25 798396.92
-615319.95 798473.77
-615339.96 798562.32
-615352.02 798618.84
-615367.27 798632.81
-615387.59 798655.67
-615418.71 798684.89
-615422.51 798703.93
-615414.89 798726.79
-615409.81 798742.67
-615401.56 798771.24
-615535.54 798768.07
-615748.65 798819.39
-615784.52 798897.16
-615820.72 798954.32
-615868.66 798981.3
-615910.57 798980.35
-615977.66 798962.66
-616030.81 798945.55
-616077.27 798941.02
-616137.59 798915.3
-616196.96 798877.52
-616259.83 798838.15
-616333.81 798788.93
-616398.58 798751.5
-616380.48 798709.9
-616369.68 798702.28
-616386.83 798614.94
-616405.65 798535.4
-616432.14 798460.73
-616455.41 798405.08
-616470.97 798355.55
-616475.42 798270.11
-616465.38 798210.81
-616446.31 798151.98
-616417.72 798067.85
-616372.55 797938.33
-616365.89 797936.74
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 615812.97 798284.9
-Region  1
-  65
-614733.44 803266.83
-614620.59 803918.46
-614629.22 803920.12
-614641.16 803921.78
-614746.55 803936.55
-615272.82 804048.62
-615336.22 804044.3
-615382.36 804046.96
-615418.87 804023.72
-615442.92 804008.1
-615478.81 803990.16
-615569.71 803921.26
-615492.13 803859.89
-615487.09 803855.93
-615505.68 803790.87
-615508.66 803715.85
-615485.43 803661.74
-615553.31 803636.33
-615625 803597.82
-615663.3 803572.63
-615713.89 803523.26
-615741.69 803475.17
-615761.89 803418.86
-615780.48 803352.68
-615756.16 803252.51
-615770.06 803225.3
-615770.63 803211.4
-615753.26 803191.13
-615746.32 803166.81
-615711.86 803135.26
-615684.07 803098.78
-615641.22 803057.67
-615588.98 802960.64
-615578.11 802927.39
-615570 802892.65
-615592.58 802877.59
-615607.64 802855.59
-615607.34 802762.03
-615585.34 802689.65
-615566.23 802665.91
-615509.45 802641.82
-615493.27 802637.53
-615493.27 802637.53
-615481.41 802632
-615455.06 802623.06
-615429.58 802613.22
-615409.32 802606.27
-615379.21 802591.79
-615346.78 802642.17
-615331.73 802679.8
-615327.1 802716.86
-615260.51 802729.02
-615181.47 802746.07
-615121.83 802757.65
-615096.36 802751.86
-615069.14 802741.38
-615041.35 802731.54
-615005.74 802716.78
-614941.47 802691.88
-614879.22 802663.21
-614860.11 802726.9
-614838.11 802803.92
-614813.79 802802.18
-614806.84 802798
-614733.44 803266.83
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 615189.54 803356.25
-Region  1
-  100
-614316.94 795512.93
-614472.51 795483.09
-614576.02 795545.32
-614588.08 795561.83
-614830.02 795705.27
-614956.39 795406.19
-614985.56 795338.99
-615001.37 795316.21
-614977.34 795253.25
-615034.49 795230.39
-615085.29 795212.61
-615108.26 795125.07
-615116.03 795096.49
-615125.55 795050.77
-615067.13 795102.84
-614957.28 795100.93
-614897.59 795100.93
-614820.12 795099.03
-614728.68 795097.76
-614734.35 795035.69
-614749.59 794802.01
-614718.81 794778.25
-614680.08 794755.39
-614644.52 794735.07
-614577.21 794691.26
-614514.98 794648.74
-614570.86 794568.07
-614544.82 794532.51
-614497.83 794510.92
-614377.18 794493.77
-614335.27 794470.28
-614298.45 794434.69
-614231.77 794399.13
-614106.68 794423.26
-614000 794442.94
-613871.09 794467.71
-613813.95 794477.86
-613756.16 794489.29
-613674.25 794459.44
-613566.04 794432.95
-614003.17 794684.29
-613965.93 795060.86
-613894.24 795053.34
-613792.02 795042.28
-613698.39 795035.41
-613623.61 795026.12
-613567.41 795058.86
-613545.73 795060.19
-613480.74 795078.74
-613427.79 795096.34
-613391.52 795104.14
-613396.6 795130.18
-613389.93 795130.47
-613321.03 795191.11
-613330.24 795226.03
-613343.89 795280.01
-613288.33 795261.91
-613318.17 795364.78
-613338.18 795421.94
-613355.05 795495.3
-613370.29 795501.33
-613399.47 795536.25
-613414.43 795552.73
-613397.92 795575.27
-613314.41 795703.87
-613144.63 795941.48
-613082.13 796045.49
-613106.94 796101.79
-613136.04 796172.39
-613199.49 796153.79
-613242.91 796142.34
-613234.32 796104.65
-613226.21 796076.02
-613221.44 796051.69
-613224.78 796034.04
-613249.11 795989.19
-613276.78 795941.96
-613299.19 795909.51
-613334.01 795876.11
-613367.89 795868
-613430.39 795880.41
-613461.16 795829.59
-613489.78 795798.58
-613497.61 795705.77
-613444.59 795713.71
-613436.33 795687.99
-613515.71 795591.78
-613541.11 795528.28
-613674.69 795228.67
-613843.68 795221.1
-613913.3 795222.37
-613974.79 795222.53
-613990.67 795233
-614038.66 795304.67
-614037.4 795319.86
-614034.25 795367.97
-614026.74 795505.31
-614142.31 795509.12
-614189.3 795507.21
-614316.94 795512.93
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 614189.49 795135.53
-Region  1
-  35
-605382.55 788588.5
-605338.42 788658.03
-605324.13 788669.14
-605261.58 788700.6
-605134.9 788781.59
-604996.78 788842.87
-605005.36 788854.61
-605107.28 788924.78
-605139.55 788947.2
-605212.36 789001.01
-605254.33 789029.68
-605289.57 789054.6
-605309.22 789030.77
-605323.86 789013.8
-605336.21 788998.87
-605355.58 788975.99
-605402.88 788900.74
-605442.89 788898.52
-605487.65 788888.39
-605528.29 788874.74
-605559.41 788840.45
-605590.25 788781.71
-605637.56 788702.33
-605643.91 788687.41
-605660.41 788594.69
-605631.18 788488.37
-605617.18 788430.11
-605569.24 788419.31
-605518.12 788409.79
-605468.28 788402.14
-605446.69 788452.62
-605427.32 788493.9
-605413.99 788521.52
-605400.97 788545.95
-605382.55 788588.5
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605391.36 788738.97
-Region  1
-  50
-609873.29 807362.54
-609865.53 807422.14
-609805.45 807718.92
-609767.18 807835.73
-609774.35 807830.13
-609808.09 807815.37
-609885.56 807786.91
-609902.69 807780.32
-609948.02 807756.07
-609977.53 807750.8
-610022.86 807750.28
-610070.82 807753.96
-610113.15 807755.8
-610159.37 807758.46
-610197.09 807749.96
-610252.55 807733.63
-610265.21 807734.88
-610342.45 807743.07
-610391.54 807751.55
-610411.73 807755.8
-610438.68 807757.57
-610477.61 807755.8
-610554.17 807762.21
-610550.93 807790.34
-610608.28 807758.98
-610665.92 807751.13
-610711.89 807739.85
-610717.73 807726.04
-610729.42 807689.38
-610737.39 807652.72
-610763.14 807625.89
-610799.8 807595.6
-610859.94 807545.39
-610800.31 807524.02
-610724.7 807504.24
-610668.14 807465.89
-610595.26 807438.63
-610545.86 807419.04
-610471.58 807396.08
-610457.73 807380.62
-610303.19 807204.24
-610130.12 806987.93
-610106.67 807017.93
-610008.25 807165.48
-609989.7 807191.94
-609976.34 807210.21
-609971.43 807217.31
-609849.78 807254.94
-609865.77 807296.4
-609873.29 807362.54
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 610234.43 807491.85
-Region  1
-  68
-603888.63 794997.02
-603918.07 795683.91
-603933.78 795681.12
-603954.55 795674.36
-603972.35 795670.52
-604035.87 795647.83
-604098.35 795606.64
-604147.21 795561.62
-604174.78 795532.99
-604218.41 795489.36
-604219.63 795513.98
-604217.89 795553.77
-604215.1 795610.67
-604243.97 795620.37
-604285.07 795637.35
-604350.69 795656.54
-604418.67 795633.69
-604502.38 795601.86
-604550.94 795610.92
-604614.26 795620.91
-604666.37 795631.93
-604719.88 795642.46
-604779.53 795657.81
-604834.35 795667.02
-604887.86 795680.62
-604931.5 795690.93
-604963.96 795714.61
-604997.29 795739.17
-605015.28 795753.21
-605016.59 795789.61
-605016.59 795810.67
-605042.03 795811.1
-605074.47 795808.48
-605124.49 795806.72
-605192.48 795801.89
-605258.48 795827.1
-605288.4 795820.54
-605353.59 795797.76
-605436.14 795767
-605368.17 795679.73
-605223.67 795556.7
-605095.6 795432.15
-604980.01 795345.08
-604876.94 795294.21
-604756.53 795266.79
-604695.12 795263.28
-604633.56 795225.35
-604620.23 795219.95
-604598.32 795209.79
-604463.42 795136.19
-604412.58 795078.37
-604370.95 794998.82
-604355.5 794976.9
-604335.13 794923.87
-604313.22 794882.28
-604288.89 794857.61
-604260.31 794838.56
-604150.98 794858.19
-604056.1 794899.36
-604026.98 794911.4
-604002.88 794920.94
-603980.29 794930.98
-603964.72 794937.51
-603943.64 794947.05
-603918.78 794956.33
-603900.03 794961.41
-603888.23 794968.18
-603888.63 794997.02
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604488.93 795381.06
-Region  1
-  36
-609659.06 793409.48
-609574.3 793534.83
-609544.54 793576.58
-609550.17 793586.26
-609606.27 793659.94
-609637.39 793708.62
-609635.31 793774.8
-609610.53 793815.14
-609657.52 793871.66
-609674.67 793904.36
-609703.88 793921.19
-609733.4 793925.02
-609828.33 793922.79
-609903.9 793773.25
-609951.84 793835.8
-610001.05 793898.03
-609989.62 793921.84
-609958.2 793974.24
-610002.33 794005.36
-610073.61 794046.78
-610151.85 793914.76
-610187.9 793845.14
-610185.97 793778.68
-610172.14 793756.41
-610166.42 793656.07
-610164.51 793624.96
-610152.13 793583.36
-610105.14 793506.52
-610059.89 793441.93
-610047.36 793417.36
-609945.76 793342.11
-609924.49 793329.47
-609910.84 793322.16
-609750.82 793322.8
-609718.41 793322.99
-609659.06 793409.48
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 609884.14 793650.19
-Region  1
-  58
-604056.1 794899.36
-604150.98 794858.19
-604260.31 794838.56
-604124.27 794835.64
-604089.5 794832.21
-604016.96 794796.91
-603952.19 794711.18
-603964.89 794609.58
-603936.32 794597.51
-603905.2 794581
-603862.02 794569.57
-603845.51 794568.3
-603784.68 794555.67
-603719.78 794548.62
-603674.06 794543.54
-603622.95 794530.87
-603582.75 794507.53
-603526.22 794471.61
-603477.02 794423.97
-603433.32 794373.96
-603387.73 794330.27
-603353.54 794301.15
-603322.19 794286.81
-603289.38 794275.38
-603262.92 794272.84
-603214.28 794270.12
-603152.26 794268.84
-603084.7 794266.34
-603053.9 794273.19
-603101.87 794679.4
-603025.88 794687.02
-603044.28 794825.51
-603061.86 794962.86
-603073.39 794971.85
-603084.17 794979.65
-603125.46 795012.92
-603137.1 795019.9
-603146.84 794997.04
-603179.65 795012.7
-603221.05 795041.75
-603327.1 795016.98
-603438.86 795029.68
-603556.97 795060.16
-603642.06 795049.38
-603673.81 795065.25
-603729.05 795065.89
-603770.21 795044.09
-603776.87 795028.14
-603888.63 794997.02
-603888.23 794968.18
-603900.03 794961.41
-603918.78 794956.33
-603943.64 794947.05
-603964.72 794937.51
-603980.29 794930.98
-604002.88 794920.94
-604026.98 794911.4
-604056.1 794899.36
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 603478.02 794720.45
-Region  1
-  113
-604862.82 793533.59
-604889.43 793518.91
-604948.49 793485.57
-605084.25 793439.09
-605176.02 793401.3
-605238.42 793431.65
-605286.68 793489.76
-605315.58 793459.91
-605345.43 793438.64
-605361.94 793454.52
-605410.53 793507.54
-605446.1 793548.82
-605524.06 793631.52
-605578.68 793690.58
-605601.54 793714.4
-605616.46 793734.08
-605646.95 793734.72
-605704.59 793743.48
-605767.46 793756.82
-605803.98 793776.19
-605867.49 793733
-605846.85 793558.41
-605836.69 793480.61
-605869.25 793437.84
-605913.5 793377.58
-605943.63 793335.24
-605960.79 793313.89
-605901.95 793268.51
-605818.12 793233.58
-605740.64 793218.34
-605664.44 793211.99
-605602.84 793210.08
-605541.87 793210.08
-605477.41 793205.95
-605331.99 793145.62
-605280.55 793092.28
-605235.46 793041.47
-605191 793002.73
-605153.88 792970.64
-605108.8 792939.52
-605031.45 792911.35
-604947.51 792908.41
-604921.47 792912.85
-604878.41 792928.48
-604798.28 792957.94
-604734.15 792979.53
-604643.62 793004.4
-604548.09 793043.03
-604487.77 793061.44
-604374.7 793097.64
-604371.53 793108.43
-604367.75 793120.5
-604362.67 793130.02
-604355.69 793140.18
-604348.7 793154.15
-604338.54 793171.3
-604330.29 793189.71
-604305.78 793211.19
-604295.02 793206.13
-604236.29 793222.74
-604171.52 793243.69
-604128.34 793253.85
-604090.88 793258.3
-604059.13 793283.06
-604036.84 793296.64
-604027.38 793318.63
-604005.15 793345.94
-603984.83 793361.18
-603970.23 793377.69
-603958.8 793389.12
-603940.38 793398.64
-603923.24 793408.8
-603874.98 793429.76
-603838.78 793443.73
-603770.2 793445
-603735.91 793471.03
-603702.26 793495.8
-603713.69 793540.25
-603716.69 793587.15
-603747.34 793719.95
-603720.67 793750.43
-603797.53 793742.87
-603827.69 793664.12
-604003.93 793443.41
-604100.63 793378.15
-604138.41 793397.84
-604324.02 793413.87
-604358.63 793437.37
-604372.6 793465.94
-604372.13 793500.73
-604356.27 793534.43
-604329.43 793565.37
-604314.5 793590.78
-604320.38 793616.68
-604344.2 793623.35
-604359.44 793630.97
-604369.28 793653.84
-604378.01 793697.53
-604377.06 793740.08
-604417.07 793752.46
-604431.68 793758.18
-604453.91 793793.43
-604467.72 793783.44
-604508.37 793756.45
-604543.62 793781.85
-604577.59 793799.95
-604613.48 793773.91
-604628.24 793775.02
-604725.56 793764.6
-604756.85 793763.59
-604785.02 793668.4
-604821.07 793593.72
-604862.82 793533.59
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 604916.87 793360.87
-Region  1
-  28
-598751.15 789320.53
-598725.52 789361.68
-598698.53 789417.54
-598702.98 789437.86
-598728.7 789496.96
-598743.3 789542.68
-598759.43 789597.1
-598777.47 789657
-598799.02 789726.96
-598808.46 789755.7
-598819.19 789742.45
-598834.34 789722.26
-598852.64 789698.27
-598875.36 789667.35
-598883.99 789657.53
-598896.53 789637.39
-598899.97 789624.43
-598908.72 789563.32
-598918.24 789490.92
-598927.07 789424.22
-598932.98 789365.96
-598924.73 789322.46
-598909.49 789290.39
-598889.49 789262.45
-598826.3 789218.32
-598797.09 789192.28
-598772.64 789264.99
-598751.15 789320.53
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 598825.55 789457.37
-Region  1
-  16
-602904.8 806561.85
-603148.77 805949.36
-603152.75 805939.36
-603374.04 805382.39
-603050.58 805256.04
-603025.99 805245.01
-602667.91 806118.53
-602673.01 806141.94
-602687.62 806186.85
-602680.69 806207.1
-602656.05 806245.7
-602666.21 806274.17
-602715.63 806306.41
-602757.26 806332.06
-602809.83 806409.23
-602904.8 806561.85
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 602992.17 805848.76
-Region  1
-  323
-614884.12 808547.67
-614766.44 808083.44
-614830.74 808040.57
-614832.76 808016.71
-614806.28 807962.32
-614800.62 807939.27
-614798.2 807902.88
-614819.63 807864.86
-614854.4 807857.58
-614905.98 807863.04
-614918.11 807855.36
-614830.18 807744.76
-614764.67 807663.88
-614725.66 807610.3
-614703.02 807544.38
-614695.74 807453.8
-614720.4 807364.83
-614750.02 807312.28
-614785.69 807264.99
-614860.77 807170.85
-614886.49 807105.32
-614891.46 807050.57
-614878.61 806983.78
-614669.56 806651.96
-614536.83 806533.34
-614522.29 806504.7
-614491.61 806459.94
-614456.46 806429.39
-614409.08 806413.88
-614351.01 806398.95
-614315.34 806476.93
-614280.5 806556.56
-614234.49 806650.9
-614439.01 807347.31
-614408.62 807344.79
-614377.55 807335.46
-614340.22 807321.36
-614298.44 807303.72
-614250.95 807291.72
-614207.26 807275.93
-614164.82 807249.38
-614144.55 807227.88
-614125.36 807210.2
-614113.34 807186.56
-614100.89 807159.18
-614096.74 807110.24
-614092.6 807067.1
-614087.37 807014.72
-614086.79 806974.19
-614085.96 806928.57
-614035.36 806909.49
-614022.91 806935.2
-613998.03 806967.56
-613970.65 806986.63
-613947.42 806985.81
-613881.06 806943.5
-613767.41 806867.18
-613715.56 806852.7
-613647.54 806890.85
-613610.21 806872.6
-613601.91 806852.7
-613578.68 806817.85
-613582 806772.23
-613566.24 806726.6
-613551.31 806694.25
-613535.13 806662.33
-613466.28 806625.83
-613421.48 806600.11
-613317.79 806576.05
-613240.64 806570.25
-613156.43 806578.02
-613113.72 806576.05
-613102.93 806602.6
-613109.57 806668.13
-613134.45 806731.18
-613141.92 806756.07
-613135.11 806782.36
-613118.04 806803.24
-613088.3 806814.64
-613052.86 806826.04
-613002.27 806869.72
-612978.23 806888.07
-612914.33 806920.37
-612895.95 806936.5
-612887.66 806965.53
-612880.25 807024.76
-612869.52 807059.56
-612844.24 807100.06
-612830.36 807137.39
-612811.42 807189.9
-612792.96 807237.58
-612761.91 807298.94
-612733.09 807359.06
-612709.73 807433.6
-612695.82 807505.15
-612699.8 807522.54
-612719.17 807543.41
-612756.94 807567.76
-612790.3 807596.68
-612794.14 807637.79
-612778.35 807656.7
-612767.96 807680.54
-612773.46 807722.11
-612779.33 807769.79
-612773.46 807829.83
-612787.46 807857.81
-612760.21 807897.18
-612743.14 807921.86
-612716.58 807942.75
-612686.22 807973.12
-612657.76 807998.44
-612647.65 808016.79
-612641.98 808038.94
-612640.76 808081.95
-612648.17 808155.06
-612608.9 808148.74
-612595.35 808154.61
-612590.39 808174.47
-612605.51 808191.81
-612594.68 808222.06
-612573.46 808245.08
-612563.53 808277.14
-612564.88 808308.28
-612549.53 808335.82
-612520.19 808337.18
-612497.62 808303.77
-612463.31 808297.9
-612429.45 808268.11
-612271.82 808185.24
-612254.7 808154.88
-612161.9 808010.21
-612055.07 807877.05
-612010.85 807899.41
-611964.38 807909.59
-611931.85 807928.73
-611874.85 807945.77
-611777.31 807985.86
-611741.04 808043.01
-611709.61 808070.36
-611706.47 808098.83
-611715.98 808114.01
-611718.53 808136.78
-611717.28 808151.33
-611702.78 808181.14
-611662.03 808169.71
-611611.85 808111.08
-611594.46 808070.33
-611578.06 808062.38
-611547.26 808072.82
-611514.96 808070.33
-611470.74 808076.3
-611451.86 808087.72
-611406.64 808158.28
-611379.31 808197.67
-611369.63 808266.92
-611378.24 808301.37
-611341.75 808318.79
-611386.18 808401.3
-611387.99 808438.48
-611416.1 808494.69
-611478.46 808608.81
-611490.91 808645.65
-611499.07 808665.6
-611520.83 808685.54
-611614 808690.99
-611621.86 808779.39
-611627.44 808842.18
-611681.89 808844.05
-611703.4 808839.61
-611718.16 808831.53
-611742.07 808823.36
-611774.71 808812.48
-611795.56 808809.76
-611850.87 808809.76
-611958.32 808804.74
-612017.32 808788.23
-612024.92 808792.02
-611979.62 809302.96
-611976 809323.82
-612328.71 809380.03
-612435.73 809432.03
-612463.6 809454.15
-612477.55 809476.29
-612478.22 809511.08
-612463.06 809539.56
-612449.79 809562.34
-612444.18 809653.43
-612435.43 809767.31
-612453.27 809881.8
-612497.07 810016.52
-612522.43 810048.78
-612578.66 810096.54
-612627.77 810125.54
-612762.4 810111.39
-612860.4 810072.23
-612886.22 810088.53
-612904.15 810075.17
-612948.45 810066.93
-612976.48 810081.18
-612995.38 810101.13
-613021.41 810082.86
-613035.9 810079.93
-613082.3 810090.21
-613107.91 810105.96
-613137.51 810153.38
-613186.92 810239.63
-613198.98 810336.35
-613313.27 810450.86
-613324.6 810471.5
-613378.15 810516.37
-613527.86 810559.22
-613541.83 810554.36
-613597.36 810605.68
-613627.41 810614.36
-613721.69 810630.13
-613739.04 810639.65
-613801.9 810640.5
-613898.51 810655.21
-613905.29 810652.46
-613907.52 810608.33
-613993.95 810538.38
-614044.11 810462.61
-614059.93 810407.59
-614069.64 810358.91
-614089.33 810335.1
-614142.67 810259.75
-614176.75 810202.17
-614209.36 810115.2
-614226.03 810049.24
-614265.17 809991.26
-614288.36 809985.46
-614326.05 809993.43
-614355.76 810017.35
-614411.93 810012.63
-614435.85 810025.68
-614546.74 810011.18
-614602.55 810001.76
-614677.2 810031.48
-614735.18 810064.09
-614810.55 810044.52
-614815.63 810024.23
-614815.63 809977.12
-614858.39 809979.29
-614877.57 809972.4
-614909.69 809976.07
-614956.57 809905
-615009.48 809860.06
-615033.4 809860.06
-615123.27 809888.33
-615175.45 809931.09
-615201.54 809979.65
-615224.73 810012.99
-615295.04 810073.14
-615336.69 810098.15
-615378.73 810095.97
-615545.42 810009
-615558 809934.98
-615555.2 809824.97
-615512.8 809731.41
-615512.8 809679.95
-615506.27 809599.5
-615488.88 809584.28
-615475.11 809550.21
-615450.47 809525.57
-615448.64 809473.74
-615439.94 809432.43
-615421.82 809407.06
-615471.04 809348.36
-615483.42 809284.58
-615537.06 809275.16
-615619.68 809272.26
-615711 809253.41
-615797.25 809200.5
-615896.25 809192.39
-615911.83 809124.46
-615945.8 809003.36
-615958.85 808970.02
-615965.37 808945.38
-615968.06 808920.1
-615965.7 808874.74
-615954.14 808876.51
-615918.57 808881.96
-615846.39 808871.24
-615796.4 808885.18
-615738.79 808878.25
-615696.43 808843.38
-615665.29 808791.88
-615692.84 808742.77
-615721.58 808668.52
-615715.6 808640.97
-615734.76 808573.9
-615753.92 808551.15
-615756.32 808518.81
-615770.69 808503.24
-615777.88 808430.18
-615793.15 808353.77
-615778.18 808317.84
-615788.96 808207.05
-615793.15 808154.35
-615778.48 808160.04
-615743.75 808161.83
-615707.22 808148.06
-615617.39 808086.38
-615562.9 808058.84
-615497.03 808046.26
-615346.91 808053.34
-615260.98 808092.56
-615210.74 808114.9
-615174.05 808123.18
-615237.59 808367.97
-615194.88 808510.26
-615114.32 808533.13
-615111.81 808561.6
-615127.7 808621.69
-615002.41 808663.5
-614985.91 808624.29
-614984.61 808591.39
-615007.37 808562.28
-615033.93 808537.6
-615042.77 808518.62
-615037.7 808508.5
-615018.38 808510.47
-614884.12 808547.67
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 613755.9 808654.74
-Region  1
-  689
-608222.18 787963.39
-608312.24 787960.41
-608313.59 787858.68
-608207.84 787787.45
-608148.35 787741.28
-608111.71 787716.45
-608075.69 787699.19
-608019.68 787658.63
-608000.46 787642.13
-607951.71 787631.23
-607922.95 787628.81
-607888.29 787615.95
-607848.32 787578.7
-607759.08 787512
-607697.35 787470.87
-607657.46 787444.28
-607640.34 787437.77
-607613.09 787428.57
-607551.08 787407.33
-607486.27 787381.59
-607416.75 787353.6
-607363 787331.24
-607311.94 787319.96
-607208.49 787279.65
-607189.7 787259.73
-607129.65 787158.54
-607091.64 787105.65
-607060.02 787034.81
-606997.8 787009.35
-606889.03 786918.58
-606821.11 786884.85
-606788.22 786848.21
-606775.93 786807.91
-606742.29 786778.78
-606690.55 786731.35
-606664.06 786721.59
-606631.76 786723.46
-606592.69 786703.74
-606584.99 786679.83
-606572.51 786658.05
-606548.74 786621.25
-606503.9 786559.23
-606480.38 786543.32
-606450.91 786531.1
-606452.77 786514.64
-606451.54 786498.31
-606407.65 786468.92
-606371.92 786454.71
-606354.4 786437.19
-606345.37 786421.79
-606350.15 786409.32
-606379.35 786386.75
-606391.83 786373.48
-606397.67 786352.5
-606387.58 786298.87
-606379.09 786278.43
-606369.78 786245.56
-606372.7 786209.71
-606383.33 786175.98
-606378.84 786161.44
-606371.97 786143.89
-606359.39 786121.01
-606364.54 786081.92
-606359.58 786062.85
-606350.08 786050.85
-606292.04 786006.91
-606275.14 785985.05
-606244.41 785968.92
-606216.85 785929.58
-606218.61 785864.12
-606204.26 785826.27
-606187.25 785805.13
-606145.47 785779.28
-606079.68 785711.97
-606078.03 785648.9
-606066.97 785590.88
-606012.16 785484.82
-605991.15 785447.09
-605978.07 785435.41
-605965.16 785413.54
-605862.37 785361.92
-605796.4 785301.05
-605787.61 785269.8
-605788.04 785242.24
-605791.85 785201.44
-605781.84 785155.83
-605723.9 785136.56
-605713.82 785125.01
-605709.03 785100.31
-605695.2 785072.58
-605644.64 785041.53
-605604.7 785024.82
-605565.93 785024.91
-605500.62 785034.11
-605447.48 785047.1
-605426.83 785039.23
-605403.05 785019.97
-605381.12 785014.98
-605377.06 785003.43
-605357.52 784989.17
-605355.25 784965.29
-605327.3 784934.98
-605342.11 784901.4
-605388.62 784851.54
-605400.6 784816.67
-605399.3 784795.99
-605396.22 784738.24
-605377.19 784707.22
-605354.03 784669.52
-605338.05 784639.17
-605318.83 784524.81
-605225.59 784438.7
-605111.83 784388.22
-605093.04 784366.61
-605088.5 784357.1
-605087.42 784352.78
-605069.07 784308.94
-605043.63 784266.33
-604869.44 784074.12
-604812.21 784038.18
-604814.61 784000.75
-604790.3 783943.6
-604794.3 783908.92
-604808.45 783887.24
-604813.42 783836.46
-604808.78 783802.43
-604811.92 783772.09
-604793.66 783696.76
-604793.76 783637.28
-604782.31 783615.02
-604760.16 783594.42
-604750.87 783579.29
-604712.94 783536.65
-604674.05 783499.48
-604665.84 783476.14
-604670.27 783459.16
-604698.57 783447.92
-604735.18 783391.87
-604787.68 783370.69
-604887.46 783364.44
-604953.12 783352.57
-604973.42 783341.98
-604983.78 783322.11
-604983.57 783263.8
-604935.84 783227.95
-604913.03 783207.97
-604863.11 783152.54
-604814.53 783098.76
-604759.02 783017.23
-604702.2 782946.55
-604677.91 782895.37
-604679.65 782847.66
-604674.44 782807.76
-604693.52 782740.11
-604744.7 782623.01
-604751.64 782596.99
-604751.64 782563.16
-604738.63 782522.39
-604707.83 782471.32
-604637.58 782435.88
-604585.68 782408.67
-604560.99 782378.92
-604517.44 782353.02
-604485.02 782254.88
-604432.48 782168.82
-604394.49 782089.71
-604378.66 782028.95
-604345.76 782001.04
-604315.38 781942.3
-604267.11 781867.1
-604257.11 781858.08
-604173.59 781873.43
-604084.98 781855.56
-603995.74 781861.02
-603930.73 781837.98
-603868.19 781820.7
-603749.56 781749.25
-603664.12 781730.27
-603606.53 781722.04
-603555.9 781721.41
-603507.17 781709.39
-603459.07 781699.9
-603351.49 781700.54
-603243.22 781659.17
-603205.74 781659.17
-603181.26 781698.65
-603146.46 781728.39
-603121.15 781770.16
-603103.44 781816.36
-603085.73 781865.1
-603077.1 781897.2
-603007.28 781960.66
-602966.15 781991.68
-602903.9 782056.23
-602846.17 782104.85
-602800.38 782131.55
-602762.42 782176.48
-602723.07 782204.74
-602713.07 782211.93
-602659.79 782227.41
-602663.34 782245.09
-602689.67 782275.21
-602712.45 782300.53
-602725.13 782333.21
-602744.37 782376.77
-602740.32 782422.35
-602733.23 782475.02
-602746.4 782531.74
-602759.98 782608.1
-602759.86 782666.21
-602768.21 782714.37
-602804.18 782775.38
-602831.15 782811.35
-602894.09 782859.51
-602951.89 782916.67
-602983.35 782954.56
-603017.63 782987.18
-603060.67 783032.11
-603095.44 783053.13
-603170.58 783072.4
-603212.97 783084.6
-603248.01 783097.29
-603267.56 783132.13
-603286.83 783180.3
-603316.05 783202.49
-603385.41 783227.53
-603436.79 783265.43
-603487.9 783332.08
-603498.04 783389.04
-603511.98 783454.85
-603532.24 783499.15
-603553.13 783530.16
-603595.75 783586.21
-603608.59 783619
-603617.58 783706.99
-603625.29 783724.97
-603619.51 783789.2
-603575.84 783838.01
-603550.15 783893.89
-603541.48 783936.56
-603479.82 784001.42
-603361.65 784072.72
-603295.5 784110.61
-603227.73 784121.16
-603142.96 784166.76
-603083.72 784269.38
-602940.65 784265.06
-602792.29 784270.19
-602765.31 784287.53
-602737.7 784333.78
-602717.14 784471.22
-602692.1 784515.54
-602538.91 784541.54
-602500.71 784554.07
-602468.59 784640.14
-602411.75 784659.71
-602312.2 784728.44
-602188.25 784806.15
-602133.66 784833.77
-602039.56 784882.88
-601934.88 784941.97
-601884.46 784970.54
-601833.72 785041.83
-601852.35 785060.46
-601984.65 785255.35
-602007.51 785189.95
-602009.41 785178.52
-602048.78 785191.22
-602071.5 785207.85
-602079.74 785230.64
-602046.23 785327.48
-602236.11 785590.66
-602162.82 785646.51
-602122.32 785675.62
-602044.35 785736.06
-602485.06 786287.22
-602376.18 786371.37
-602400.6 786390.72
-602420.92 786407.23
-602447.59 786431.36
-602481.88 786444.06
-602546.02 786451.05
-602606.19 786455.5
-602678.36 786494.12
-602701.15 786506.78
-602715.72 786528.3
-602739.77 786532.1
-602861.94 786575.8
-602875.87 786590.99
-602898.66 786601.12
-602934.74 786602.39
-602994.88 786619.49
-603027.79 786624.56
-603065.14 786640.39
-603089.83 786642.29
-603113.88 786642.29
-603142.37 786653.06
-603187.31 786665.72
-603205.04 786680.28
-603225.3 786685.35
-603272.13 786669.53
-603353.78 786673.34
-603418.97 786661.33
-603454.41 786642.34
-603477.19 786650.57
-603486.06 786660.7
-603505.68 786663.87
-603543.67 786681.6
-603563.93 786699.96
-603596.21 786708.82
-603650.65 786722.12
-603693.69 786737.32
-603721.55 786745.55
-603748.15 786786.07
-603776 786800.63
-603790.57 786821.52
-603808.92 786820.89
-603832.35 786844.31
-603837.9 786834.31
-603905.72 786716.15
-604029.23 786636.14
-604123.21 786567.87
-604171.15 786513.23
-604192.42 786472.9
-604224.49 786430.67
-604243.61 786435.48
-604286.65 786454.47
-604345.46 786479.88
-604396.89 786495.76
-604410.23 786518.3
-604417.21 786550.06
-604415.63 786590.38
-604408.32 786625.95
-604382.61 786727.24
-604366.11 786788.83
-604359.12 786823.43
-604359.76 786842.8
-604359.44 786857.09
-604358.8 786877.73
-604353.41 786940.91
-604351.82 786964.41
-604342.93 786996.16
-604324.52 787020.93
-604289.59 787063.47
-604303.35 787070.98
-604343.57 787097.13
-604377.42 787119.73
-604465.42 787164.68
-604469.22 787179.87
-604444.57 787260.89
-604431.28 787271.65
-604323.93 787235.51
-604338.38 787582.99
-604347.23 787612.1
-604346.28 787764.14
-604377.71 787873.7
-604428.83 787873.39
-604459.31 787881.01
-604491.02 787896.39
-604530.9 787921.08
-604550.1 787942.12
-604597.09 787999.06
-604685.02 788032.79
-604652.96 788092.63
-604635.82 788111.95
-604619.52 788154.86
-604595.48 788163.46
-604594.1 788174.37
-604620.14 788181.36
-604620.35 788193.21
-604605.32 788208.45
-604583.94 788211.44
-604544.78 788229.43
-604534.83 788245.73
-604537.16 788259.7
-604564.25 788274.73
-604572.29 788284.69
-604589.86 788290.2
-604588.9 788299.95
-604564.77 788318.05
-604554.61 788327.57
-604581.92 788374.88
-604597.71 788403.06
-604609.13 788425.28
-604648.82 788502.43
-604691.36 788584.99
-604730.1 788624.36
-604834.24 788617.69
-604864.72 788615.18
-604905.23 788588.27
-604950.76 788562.16
-604990.13 788539.3
-605065.38 788492.95
-605120.62 788452.63
-605171.1 788404.36
-605215.24 788344.67
-605387.01 788325.93
-605372.72 788288.8
-605381.7 788245.28
-605412.41 788198.99
-605456.54 788143.1
-605491.78 788097.98
-605549.24 788026.54
-605611.16 788053.53
-605671.48 788083.69
-605689.89 788111.67
-605704.81 788122.78
-605721.64 788130.4
-605774.98 788133.26
-605733.71 788213.23
-605671.79 788328.5
-605648.62 788370.41
-605629.25 788407.25
-605617.18 788430.11
-605631.18 788488.37
-605660.41 788594.69
-605643.91 788687.41
-605637.56 788702.33
-605590.25 788781.71
-605559.41 788840.45
-605528.29 788874.74
-605487.65 788888.39
-605442.89 788898.52
-605402.88 788900.74
-605355.58 788975.99
-605336.21 788998.87
-605323.86 789013.8
-605309.22 789030.77
-605289.57 789054.6
-605300.83 789191.54
-605373.22 789159.47
-605434.5 789132.48
-605487.2 789115.97
-605516.41 789114.72
-605633.57 789162.98
-605698.98 789183.66
-605746.92 789203.34
-605807.56 789226.84
-605840.97 789251.12
-605871.38 789309.35
-605902.41 789364.43
-605927.74 789400.51
-605955.23 789438.27
-605879.03 789504.01
-605847.28 789558.93
-605804.42 789678.63
-605840.3 789714.83
-605911.69 789781.88
-605973.28 789839.99
-605984.71 789866.34
-605975.03 790004.3
-605966.28 790084.33
-605944.69 790107.19
-605815.15 790194.5
-605801.94 790232.44
-605789.55 790270.96
-605758.44 790343.35
-605800.14 790356.48
-605798.44 790373.2
-605805.01 790387.17
-605813.13 790386.37
-605861.4 790407.7
-605894.86 790398.04
-605958.57 790404.18
-606033.66 790429.92
-606158.14 790585.72
-606161.49 790601.96
-606166.36 790615.72
-606179.73 790660.01
-606242.6 790698.12
-606277.52 790696.21
-606372.46 790671.13
-606451.51 790604.44
-606474.06 790560.31
-606542.78 790461.4
-606582.47 790475.05
-606594.86 790479.84
-606598.03 790457.93
-606601.21 790430.95
-606611.37 790385.22
-606598.01 790324.35
-606640.65 790313.9
-606685.77 790303.72
-606742.41 790291.96
-606709.72 790200.99
-606816.71 790043.5
-606856.72 790022.89
-606780.84 789931.75
-607046.98 789790.93
-607090.48 789835.06
-607344.73 789800.3
-607384.91 789816.95
-607441.1 789809.65
-607834.8 789884.27
-608167.54 790000.16
-608629.82 790219.61
-608227.84 790894.81
-608450.09 791162.15
-608511.08 791065.86
-608659.64 791148.81
-608652.02 791219.93
-608629.83 791376.69
-608627.3 791395.39
-608621.58 791441.12
-608615.55 791487.47
-608742.87 791362.98
-608828.28 791282.97
-608862.25 791271.54
-608905.75 791287.73
-608885.11 791330.59
-609033.06 791439.49
-609214.85 791455.07
-609377.41 791462.69
-609524.1 791287.12
-609651.4 791171.44
-609760.87 791088.54
-609869.07 791018.93
-609897.55 790994.88
-609924.05 790976.87
-609953.26 790954.01
-609984.06 790932.42
-610010.41 790919.72
-610050.24 790895.11
-610199.32 790825.1
-610196.5 790718.36
-610140.13 790525.48
-610081.39 790329.62
-610078.85 790267.39
-610099.79 790215.73
-610138.54 790169.6
-610189.91 790116.34
-610221.49 790067.22
-610193.8 790035.8
-610156.12 790001.34
-610126.3 789949.42
-610161.58 789888.88
-610141.62 789847.08
-610125.51 789829.16
-610058.68 789810.52
-610023.67 789760.07
-610033.79 789704.96
-610015.81 789676.89
-609995.14 789664.41
-609919.96 789645.21
-609901.99 789631.22
-609882.02 789584.63
-609858.73 789513.95
-609844.89 789465.76
-609781.1 789432.35
-609756.08 789398.55
-609629.09 789310.96
-609595.93 789274.05
-609534.92 789269.67
-609479.53 789254.89
-609426.75 789222.52
-609335.32 789174.41
-609327.1 789156.41
-609343.77 789143.9
-609345.13 789135.86
-609336.8 789098.97
-609311.79 789082.89
-609275.95 789028.02
-609161.13 788995.57
-609127.47 788946.24
-609126.74 788880.88
-609147.89 788834.05
-609154.87 788772.68
-609167.79 788708.7
-609167.27 788687.38
-609154.04 788653.07
-609119.55 788636.74
-609089.91 788635.51
-609041.77 788658.44
-609008.06 788664.39
-608987.79 788657.18
-608960.54 788628.78
-608935.67 788581.6
-608918.35 788524.4
-608911.03 788503.23
-608902.44 788460.97
-608898.93 788449.48
-608876.8 788431.83
-608787.39 788294.48
-608721.23 788209.53
-608656.84 788170.76
-608587.34 788087.93
-608549.82 788015.61
-608492.2 787969.04
-608441.66 787926.64
-608390.19 787911.04
-608314.21 787858.76
-608314.21 787858.88
-608313.18 787952.79
-608311.4 788005.32
-608312.78 788013.4
-608320.11 788043.17
-608333.44 788088.73
-608365.14 788138.55
-608436.6 788236.17
-608502.01 788323.22
-608573.47 788422.35
-608627.06 788502.11
-608701.04 788617.86
-608765.61 788726.82
-608789.68 788771.76
-608952.63 789043.51
-608993.64 789111.65
-609057.05 789205.24
-609132.93 789302.86
-609132.31 789326.28
-609251.44 789667.47
-609130.56 789712.39
-609087.54 789752.26
-609032.49 789799.09
-608988.19 789818.07
-608914.14 789833.89
-608828.71 789871.85
-608723.67 789957.29
-607937.98 789421.69
-607987.9 789200.16
-608059.43 789205.87
-608156.9 789212.21
-608255.01 789214.75
-608228.42 789211.59
-608210.7 789200.82
-608192.97 789183.1
-608180.3 789159.68
-608172.69 789121.06
-608169.51 789080.55
-608190.39 789051.44
-608249.88 789048.92
-608274.56 789033.1
-608304.3 789002.09
-608337.19 788966.65
-608361.24 788938.17
-608394.78 788925.51
-608396.66 788891.97
-608386.51 788833.1
-608375.75 788812.84
-608352.32 788789.42
-608316.24 788789.41
-608276.37 788792.57
-608245.35 788791.94
-608225.73 788778.01
-608199.13 788755.22
-608156.72 788745.72
-608118.11 788736.22
-608054.81 788727.35
-608010.5 788716.58
-607974.43 788727.33
-607945.95 788746.95
-607928.87 788770.37
-607920.65 788795.05
-607901.67 788814.04
-607870.66 788809.6
-607818.75 788800.1
-607758.62 788793.13
-607665.58 788804.51
-607557.99 788829.18
-607483.94 788858.92
-607443.44 788865.88
-607383.31 788852.58
-607308.61 788823.45
-607246.57 788796.22
-607173.13 788741.78
-607190.2 788696.84
-607221.19 788648.11
-607265.48 788598.11
-607357.85 788500.01
-607364.17 788482.29
-607324.92 788446.21
-607282.5 788427.21
-607232.49 788403.78
-607204.64 788396.82
-607180.58 788382.26
-607170.45 788363.9
-607238.52 788283.86
-606787.51 787825.39
-606757.79 787795.86
-606690.63 787727.93
-606715.72 787720.21
-607020.11 787632.27
-607819.27 788113.58
-607931.35 788066.29
-607979.29 788040.89
-608018.34 788045.97
-608069.46 788041.53
-608205.99 788003.4
-608222.18 787963.39
-    Pen (1,2,16711935) 
-    Brush (1,0,16777215)
-    Center 605541.26 786761.23
+Version 300
+Charset "WindowsLatin1"
+Delimiter ","
+Index 1
+CoordSys Earth Projection 8, 92, "m", -45, 0, 0.9996, 500000, 10000000 Bounds (-7745874.38492, 1999.40969607) (8745874.38492, 19998000.5903)
+Columns 3
+  nobai Char(49)
+  CDBAI Char(3)
+  pop_estim Integer
+Data
+
+Region  1
+  52
+612711.24 804892.23
+612676.53 804879.46
+612547.32 804802.54
+612474.15 804736.89
+612413.58 804792.38
+612399.6 804829.51
+612386.73 804890.97
+612371.78 804967.65
+612296.55 804950.28
+612263.04 804940.9
+612179.37 804712.57
+612077.61 804705.82
+612071.82 804784.91
+612060.73 804800.83
+611969.81 804934.62
+611957.32 804961.32
+611790.26 805226.43
+611868.61 805222.34
+611914.97 805215.41
+611959.74 805209.02
+612031.68 805199.96
+612066.31 805222.87
+612124.38 805275.99
+612175.26 805329.52
+612232.82 805388.14
+612261.59 805416.38
+612289.76 805420.21
+612344.19 805422.78
+612401.81 805428.38
+612467.29 805432.37
+612553.35 805441.71
+612678.58 805450.77
+612769.71 805430.12
+612858.17 805381.63
+613234.2 805154.47
+613218.29 805144.82
+613165.6 805112.29
+613120.12 805081.43
+613080.04 805048.94
+613042.28 804998.19
+613032.7 804979.95
+612987.38 804818.92
+612967.61 804822.29
+612942.39 804822.28
+612905.42 804819.88
+612877.94 804818.92
+612853.35 804818.43
+612839.85 804837.24
+612844.67 804862.31
+612824.42 804893.16
+612778.5 804900.67
+612711.24 804892.23
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612512.05 805109.6
+Region  1
+  138
+608916.5 804023.17
+608727.71 804535.57
+608280.43 804976.11
+608267.23 805019.36
+608268.14 805060.33
+608276.11 805146.6
+608281.79 805231.96
+608285.89 805281.13
+608290.22 805339.63
+608295.23 805410.19
+608317.08 805450.25
+608343.49 805483.03
+608353.95 805502.12
+608371.25 805508.95
+608497.82 805472.52
+608731.38 805401
+608928.52 805350.47
+608976.78 805539.87
+609210.34 805476.11
+609209.63 805449.75
+609214.7 805422.42
+609222.85 805382.01
+609207.37 805350.6
+609192.35 805323.74
+609186.43 805306.89
+609179.83 805294.4
+609203.05 805283.93
+609255.86 805252.51
+609315.05 805205.16
+609341.44 805195.14
+609374.22 805192.86
+609369.67 805155.02
+609454.81 805134.54
+609523.1 805121.79
+609607.39 805106.52
+609733.96 805090
+609861.18 805077.29
+609900.44 805089.92
+609973.82 805152.79
+610054.41 805194.23
+610110.86 805202.88
+610140 805202.88
+610124.07 805151.43
+610099.81 805072.1
+610346.57 804987.83
+610464.94 804992.2
+610632.15 804898.9
+610683 804868.29
+610697.22 804857.93
+610721.33 804838.4
+610805.44 804748.99
+610844 804730.43
+611023.33 804657.88
+611382.27 804517.55
+611396.73 804561.67
+611568.97 804480.02
+611605.13 804462.67
+611709.26 804412.53
+611741.81 804441.45
+611756.75 804430.85
+611769.53 804421.93
+611781.1 804413.49
+611806.13 804396.81
+611826.05 804383.47
+611839.79 804400.28
+611816.17 804371.18
+611792.9 804356.35
+611756.99 804347.19
+611720.34 804342.37
+611673.72 804332.65
+611665.04 804309.5
+611648.16 804271.41
+611633.7 804240.06
+611614.41 804197.62
+611596.56 804153.25
+611588.36 804132.51
+611562.32 804124.8
+611542.55 804119.97
+611525.67 804114.19
+611504.21 804107.19
+611491.67 804102.37
+611475.28 804097.06
+611460.33 804092.24
+611448.75 804088.38
+611434.29 804083.56
+611399.57 804075.41
+611395.23 804110.61
+611396.68 804136.17
+611394.75 804164.14
+611394.27 804191.63
+611391.61 804232.38
+611388.23 804278.19
+611387.27 804325.46
+611373.77 804323.04
+611237.76 803938.43
+611173.87 803966.3
+611064.41 804006.84
+610954.97 804057.51
+610927.75 804059.42
+610902.44 804064.5
+610800.59 804113.26
+610686.72 804168.36
+610638.62 804178.51
+610596.24 804201.31
+610526.63 804214.63
+610486.07 804216.22
+610408.57 804245.18
+610252.51 804326.86
+610164.71 804261.46
+610072.57 804312.08
+609932.05 804393.5
+609814.23 804475.8
+609758.68 804514.33
+609751.81 804489.54
+609746.74 804469.23
+609580.84 804530.93
+609517.44 804557.42
+609492.71 804562.24
+609447.44 804550.68
+609403.61 804541.53
+609369.9 804525.15
+609403.85 804163.77
+609216.03 803973.06
+609211.94 803938.65
+609209.53 803898.68
+609136.33 803928.06
+609079.51 803954.06
+609037.13 803905.9
+609066.26 803823.83
+609074.93 803792.05
+609071.08 803771.34
+609057.6 803749.67
+609043.15 803729.44
+609028.22 803703.43
+609016.18 803730.89
+608993.06 803798.31
+608922.76 804007.76
+608916.5 804023.17
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609754.23 804682.77
+Region  1
+  69
+603925.58 800180.38
+603931.33 800239.97
+603938.89 800297.21
+603960.32 800405.92
+603980.85 800501.62
+604004.24 800608.71
+604021.47 800697.34
+604034.4 800760.74
+604066.4 800914.04
+604068.52 800927.89
+604641.63 800402.4
+604717.44 800338.6
+604758.21 800306.51
+604855.81 800254.89
+604818.28 800175.73
+604784.45 800107.63
+604765.36 800065.56
+604746.05 800000.28
+604723.06 799925.67
+604676.62 799771.92
+604659.27 799700.05
+604634.75 799618.7
+604610.89 799582.26
+604577.92 799557.53
+604516.74 799531.49
+604502.21 799524.32
+604548.63 799429.3
+604621.88 799405.99
+604710.16 799380.02
+604722.4 799294.55
+604744.53 799130.12
+604824.36 799054.63
+604806.35 798871.75
+604863.62 798816.21
+604838.89 798787.57
+604819.15 798764.38
+604798.76 798742.26
+604790.52 798723.16
+604790.95 798700.6
+604759.71 798686.28
+604738.02 798677.17
+604727.61 798671.97
+604679.01 798727.5
+604631.29 798767.85
+604423.24 798855.26
+604393.11 798878.94
+604369.43 798914.45
+604307.02 799053.27
+604298.09 799081.15
+604151.09 799398.74
+604101.76 799513.96
+604089.98 799530.56
+604076.02 799548.84
+604029.34 799577.42
+603968.37 799603.78
+603929.63 799619.34
+603899.78 799640.61
+603885.65 799656.67
+603876.44 799664.93
+603855.8 799723.35
+603833.73 799826.09
+603826.27 799874.15
+603819.21 799915.62
+603806.14 799971.03
+603798.82 800007.63
+603835.42 800036.9
+603875.67 800075.06
+603904.15 800112.43
+603925.58 800180.38
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604352.15 799829.41
+Region  1
+  20
+608017.05 795860.74
+608286.33 795846.18
+608304.77 795846.18
+608726.4 795929.63
+608755.03 795763.22
+608668.17 795446.5
+608607.32 795433.32
+608462.44 795398.35
+608284.4 795354.71
+607822.28 795240.98
+607724.01 795391.11
+607697.09 795435.98
+607665.07 795516.03
+607650.29 795586.62
+607655.63 795686.08
+607659.96 795810.28
+607656.08 795918.96
+607678.4 795911.2
+607777.86 795880.63
+608017.05 795860.74
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608170.23 795613.77
+Region  1
+  28
+608045.21 799290.88
+608104.1 799248.45
+608121.72 799258.18
+608158 799254.71
+608192.64 799268.13
+608227.28 799303.63
+608196.54 799147.76
+608159.3 799132.17
+608119.89 799110.93
+608085.06 799098.29
+607959.7 799038.66
+607883.49 799004.02
+607881.33 799062.04
+607849.29 799013.11
+607813.14 798962.21
+607811.19 798927.32
+607787.81 798916.93
+607770.92 798910
+607678.27 798868.87
+607651.86 798855.01
+607650.72 798892.91
+607650.25 798958.63
+607649.47 798996.84
+607648.17 799102.92
+607676.75 799109.41
+607858.38 799246.06
+607985.89 799337.64
+608045.21 799290.88
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607901.58 799120.1
+Region  1
+  124
+604282.24 796153.99
+604377.36 796086.2
+604445.11 796037.46
+604408.91 795986.98
+604385.24 795953.48
+604375.11 795921.68
+604364.28 795886.48
+604347.78 795826.79
+604327.59 795795.08
+604316.82 795776.72
+604283.9 795753.3
+604256.67 795732.41
+604226.91 795706.45
+604215.44 795675.24
+604214.4 795644.87
+604215.1 795610.67
+604217.89 795553.77
+604219.63 795513.98
+604218.41 795489.36
+604174.78 795532.99
+604147.21 795561.62
+604098.35 795606.64
+604035.87 795647.83
+603972.35 795670.52
+603954.55 795674.36
+603933.78 795681.12
+603918.07 795683.91
+603838.49 795684.61
+603709.7 795669.95
+603622.97 795654.06
+603482.28 795647.03
+603396.55 795676.4
+603298.75 795739.12
+603154.81 795843.25
+603037.05 795881.61
+602961.98 795882.28
+602892.97 795865.56
+602827.14 795841.04
+602785.65 795821.36
+602729.34 795792.63
+602528.08 795670.13
+601865.86 795232.56
+601875.2 795319.19
+601879.45 795409.22
+602086.68 795502.65
+602108.34 795528.55
+602234.88 795616.03
+602244.23 795638.11
+602244.65 795674.2
+602224.69 795708.17
+602200.69 795791.17
+602161.2 795869.3
+602140.6 795909.46
+602098.56 795989.29
+602082.21 796022.59
+602057.16 796103.7
+602057.8 796138.76
+602063.32 796176.55
+602070.96 796233.46
+602078.81 796261.7
+602100.9 796316.05
+602130.4 796384.66
+602192.61 796510.18
+602231.68 796580.25
+602361.41 796685.77
+602431.06 796694.68
+602474.37 796689.16
+602493.48 796743.94
+602397.93 796799.15
+602302.18 796903.82
+602270.33 796930.99
+602280.1 796964.12
+602342.52 796912.73
+602489.87 796827.38
+602557.82 796805.3
+602677.36 796769.42
+602895.78 796705.19
+602974.51 796679.78
+603030.18 796663.69
+603108.28 796639.77
+603109.53 796556.42
+603119.69 796378.26
+603127.07 796352.67
+603224.44 796238.18
+603301.18 796151.93
+603354.91 796109.6
+603434.49 796066.21
+603408.88 796016.87
+603383.91 795976.02
+603346.24 795930.54
+603314.02 795895.34
+603342.17 795850.04
+603365.02 795814.11
+603397.19 795776.86
+603432.54 795770.72
+603478.47 795774.11
+603506.41 795788.92
+603527.37 795818.13
+603574.8 795917.97
+603590.89 795953.95
+603600.62 795984.85
+603605.92 796002.03
+603569.72 796068.01
+603591.52 796079.87
+603632.8 796104.63
+603693.55 796140.55
+603755.99 796173.99
+603795.79 796191.75
+603820.35 796215.25
+603847.23 796244.46
+603860.57 796258.48
+603870.15 796267.2
+603971.37 796296.39
+603985.97 796264
+603992.96 796260.83
+603997.49 796256.84
+604000.64 796254.84
+604016.33 796245.91
+604035.38 796228.13
+604093.48 796244.32
+604111.26 796272.9
+604173.81 796232.89
+604225.72 796193.68
+604282.24 796153.99
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603010.9 796093.07
+Region  1
+  58
+603754.53 797528.56
+603744.72 797566.48
+603786.95 797646.5
+603802.51 797756.67
+603803.78 797818.67
+603742.82 797850.42
+603783.46 797848.87
+603860.61 797890.46
+603904.11 797943.17
+603911.41 797958.39
+603922.21 797980.93
+603929.19 797999.03
+603932.37 798007.92
+603936.81 798018.4
+603939.99 798028.24
+603943.48 798040.63
+603977.13 798070.47
+604024.76 798024.43
+604053.05 797978.38
+604073.02 797939.34
+604077.78 797903.14
+604101.81 797876.11
+604114.51 797864.04
+604135.1 797842.04
+604153.85 797826.23
+604204.42 797779.97
+604244.8 797740.38
+604191.08 797730.58
+604159.34 797723.13
+604174.24 797707.84
+604187.18 797696.08
+604197.39 797686.28
+604216.21 797669.03
+604222.29 797663.33
+604229.34 797657.06
+604238.35 797649.22
+604243.84 797644.12
+604260.7 797630.01
+604287.86 797609.34
+604280.24 797594.52
+604233.47 797533.99
+604165.61 797470.38
+604160.5 797460.38
+604126.64 797426.33
+604089.17 797366
+604051.07 797308.85
+603990.75 797295.52
+603956.46 797298.69
+603933.6 797303.77
+603901.85 797312.03
+603875.18 797327.27
+603854.22 797349.49
+603827.55 797354.57
+603789.55 797350.19
+603753.26 797349.49
+603693.57 797403.47
+603721.51 797472.05
+603754.53 797528.56
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603977.82 797631.45
+Region  1
+  59
+614846.87 802270.79
+614856.35 802317.82
+614858.95 802364.44
+614857.22 802443.18
+614850.85 802504.56
+614835.51 802581.86
+614801.63 802743.12
+614806.84 802798
+614813.79 802802.18
+614838.11 802803.92
+614860.11 802726.9
+614879.22 802663.21
+614941.47 802691.88
+615005.74 802716.78
+615041.35 802731.54
+615069.14 802741.38
+615096.36 802751.86
+615121.83 802757.65
+615181.47 802746.07
+615260.51 802729.02
+615327.1 802716.86
+615331.73 802679.8
+615346.78 802642.17
+615379.21 802591.79
+615409.32 802606.27
+615429.58 802613.22
+615455.06 802623.06
+615481.41 802632
+615508.91 802568.58
+615519.33 802510.1
+615522.81 802424.41
+615530.34 802382.14
+615522.23 802308.02
+615512.97 802253.01
+615493.28 802235.64
+615424.38 802198.58
+615407.87 802187.29
+615362.13 802107.38
+615413.08 802082.49
+615361.55 802007.21
+615359.53 801986.08
+615341 801958.86
+615295.26 801900.38
+615258.78 801847.69
+615217.98 801793.84
+615168.19 801786.55
+615124.12 801803.99
+615064.82 801847.12
+614936.41 801903.24
+614775.01 801939.05
+614703.66 801981.23
+614723.69 801991.04
+614751.55 802004.58
+614792.08 802056.69
+614801.93 802077.54
+614806.27 802102.11
+614820.77 802149.96
+614833.77 802208.96
+614846.87 802270.79
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 615135.75 802300.57
+Region  1
+  42
+612692.29 793449.16
+612630.05 793435.51
+612576.54 793402.02
+612483.82 793344.23
+612414.18 793298.68
+612346.55 793277.09
+612279.24 793286.29
+612136.88 793314.08
+612101.64 793309
+611860.96 793947.03
+611896.98 794073.48
+612042.44 794612.37
+612109.11 794445.47
+612106.46 794420.99
+612089.77 794355.97
+612131.32 794343.71
+612181.72 794311.7
+612184.44 794296.03
+612308.72 794239.55
+612346.8 794183.01
+612434.31 794142.47
+612495.85 794107.08
+612550.29 794048.49
+612556.05 794033.49
+612573.76 794008.03
+612709.53 793881.16
+612739.53 793853.09
+612754.91 793866.93
+612783.76 793895.78
+612785.68 793793.86
+612801.83 793816.93
+612827.22 793833.09
+612901.83 793828.86
+612931.45 793816.55
+612949.53 793780.78
+612890.3 793750.01
+612852.22 793719.62
+612825.33 793677.45
+612825.49 793560.45
+612792.79 793490.59
+612746.58 793462.18
+612692.29 793449.16
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612312.8 793804.7
+Region  1
+  52
+609675.48 799987.34
+609597.92 799951.29
+609606.06 799843.8
+609527.1 799839.9
+609141.9 799768.55
+609129.08 799836.55
+609127.49 799836.23
+609072.4 800120.73
+609195.97 800274.02
+609272.98 800382.23
+609313.13 800447.28
+609347.54 800496.82
+609385.62 800538.8
+609409.12 800561.03
+609433.32 800582.28
+609495.72 800632.98
+609524.51 800659.71
+609630.83 800659.6
+609682.44 800666.25
+609719.15 800695.15
+609748.51 800711.9
+609767.09 800715.8
+609808.15 800713.5
+609838.65 800708.04
+609848.17 800691.39
+609866.39 800666.14
+609876.55 800653.76
+609898.97 800616.45
+609951.77 800534.27
+609961.37 800520.73
+609968.99 800505.8
+609975.98 800489.61
+609982.33 800471.83
+609989.63 800449.29
+609992.81 800435.32
+609995.66 800417.54
+609997.23 800398.9
+609999.94 800369.81
+609998.9 800342.36
+609995.79 800315.42
+609991.65 800293.66
+609977.66 800238.23
+609971.34 800206.34
+609966.01 800183.57
+609960.45 800153.43
+609958.76 800137.98
+609957.73 800124.52
+609957.36 800115.13
+609908.94 800085.19
+609898.71 800089.1
+609783.95 800036.08
+609675.48 799987.34
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609547.02 800238.65
+Region  1
+  64
+609010.03 800456.56
+609060.72 800407.82
+609086.07 800336.17
+609145.03 800215.29
+609072.4 800120.73
+608987.59 800037.38
+608953.96 800000.82
+608921.78 799930.63
+608889.61 799866.78
+608865.67 799820.9
+608840.32 799782.88
+608680.45 799841.37
+608561.05 799890.77
+608536.17 799904.74
+608440.63 799975.91
+608438.68 800062.67
+608401.28 800173.67
+608362.71 800227.15
+608457.22 800329.26
+608464.83 800338.85
+608447.97 800355.37
+608412.28 800388.75
+608382.87 800413.87
+608395.09 800424.77
+608485.48 800524.34
+608585.45 800634.84
+608511.92 800701.43
+608498.72 800715.39
+608509.33 800735.4
+608508.73 800761.97
+608495.46 800777.8
+608480.32 800817.66
+608462.88 800838.47
+608448.09 800861.96
+608420.27 800885.39
+608384.11 800931.99
+608394.37 800943.39
+608365.86 800977.6
+608363.2 800990.14
+608370.05 801004.2
+608370.43 801040.3
+608447.19 801073.74
+608571.84 801115.17
+608785.94 801189.83
+608996.76 801256.5
+608934.53 801182.21
+608907.23 801148.55
+608855.16 801094.58
+608828.49 801063.46
+608810.07 801042.12
+608837.37 801018.73
+608796.74 800988.53
+608752.05 800957.97
+608738.77 800937.9
+608731.94 800912.55
+608731.94 800886.23
+608748.03 800801.91
+608824.55 800726.85
+608886.72 800662.26
+608901.34 800638.37
+608933.28 800575.74
+608949.85 800509.94
+608961.77 800488.24
+609010.03 800456.56
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608711.26 800440.68
+Region  1
+  69
+612222.84 799151.62
+612209.18 799081.44
+612186.64 799038.26
+612155.37 799002.48
+612115.67 798970.73
+612028.03 798934.85
+611915.51 798900.25
+611829.34 798868.79
+611782.83 798852.38
+611723.1 799028.37
+611683.17 799148.47
+611659.04 799221.5
+611636.65 799286.46
+611625.06 799326.03
+611623.47 799413.99
+611618.86 799438.61
+611602.81 799465.77
+611567.25 799526.35
+611548.68 799562.57
+611517.42 799640.34
+611493.39 799700.73
+611466.82 799730.04
+611439.07 799748.8
+611410.55 799775.37
+611393.74 799803.51
+611387.68 799836.99
+611391.98 799932.34
+611402.53 799915.15
+611409.56 799899.91
+611426.95 799858.31
+611452.36 799806.63
+611480.5 799778.11
+611572.72 799739.81
+611597.14 799700.13
+611604.18 799652.84
+611613.16 799626.66
+611630.75 799598.13
+611662.79 799564.14
+611702.07 799564.25
+611808.37 799585.36
+611813.45 799599.82
+611899.23 799646.9
+611939.48 799669.18
+611963.31 799680.12
+611974.26 799686.76
+612035.61 799703.18
+612088.8 799716.41
+612138 799730.14
+612165.5 799740.25
+612173.6 799745.26
+612171.45 799753.01
+612165.85 799767.21
+612141.75 799811.98
+612113.33 799864.93
+612099.13 799904.11
+612123.92 799905.92
+612173.94 799892.64
+612204.3 799892.7
+612239.59 799899.67
+612298.99 799915.69
+612304.65 799887.75
+612312.86 799865.08
+612325.36 799827.18
+612328.88 799770.12
+612318.09 799680.29
+612303.8 799612.97
+612273.32 799442.82
+612249.51 799276.73
+612222.84 799151.62
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611955.94 799378.49
+Region  1
+  175
+604487.77 793061.44
+604548.09 793043.03
+604643.62 793004.4
+604734.15 792979.53
+604798.28 792957.94
+604878.41 792928.48
+604921.47 792912.85
+604947.51 792908.41
+604941.79 792889.36
+604931.63 792823.95
+604968.46 792827.13
+604998.31 792827.76
+605031.33 792829.03
+605026.25 792804.27
+605018.63 792768.07
+605010.43 792731.69
+604940.26 792754.23
+604887.56 792752.33
+604817.71 792691.68
+604895.5 792528.79
+604877.41 792398.6
+604833.59 792362.1
+604871.69 792351.27
+604904.71 792289.11
+604946.62 792289.11
+604933.92 792207.83
+604897.09 792188.78
+604902.17 792164.65
+604935.19 792165.92
+604975.83 792112.58
+605005.04 792099.88
+605041.17 792105.16
+605066.15 792092.47
+605103.82 792083.79
+605154.2 792084.28
+605184.68 792077.93
+605193.57 792070.94
+605196.32 792056.76
+605187.01 792046.7
+605163.3 792056.65
+605155.47 792055.38
+605148.06 792037.17
+605183.83 792001.83
+605159.28 791988.28
+605138.75 791974.52
+605137.05 791964.79
+605173.46 791943.2
+605174.52 791929.65
+605170.71 791914.41
+605164.99 791904.67
+605160.76 791893.24
+605148.48 791866.36
+605211.02 791815.01
+605297.49 791745.34
+605431.37 791635.87
+605481.01 791590.2
+605549.69 791515.55
+605608.64 791439.27
+605658.59 791362.15
+605711.4 791281.99
+605770.88 791189.79
+605819.77 791096.23
+605858.47 790927.44
+605880.53 790820.69
+605914.51 790740.51
+605964.99 790680.45
+605998.43 790656.59
+606054.95 790628.44
+606158.14 790585.72
+606033.66 790429.92
+605958.57 790404.18
+605894.86 790398.04
+605861.4 790407.7
+605813.13 790386.37
+605805.01 790387.17
+605798.44 790373.2
+605800.14 790356.48
+605758.44 790343.35
+605754.63 790351.61
+605750.83 790358.56
+605743.2 790377.59
+605727.01 790397.59
+605711.77 790409.66
+605673.67 790418.87
+605622.24 790430.93
+605601.6 790447.44
+605584.77 790479.51
+605536.19 790561.79
+605512.38 790569.72
+605473.01 790569.72
+605430.46 790590.99
+605334.58 790646.87
+605329.5 790665.6
+605312.35 790664.02
+605271.4 790661.81
+605256.79 790668.8
+605241.23 790703.41
+605223.45 790742.78
+605210.12 790755.16
+605184.72 790778.66
+605149.16 790811.37
+605106.3 790850.74
+605065.34 790888.49
+605093.28 790928.82
+605055.5 790954.85
+605030.73 790973.9
+604993.9 791001.88
+604942.46 791059.35
+604930.4 791081.26
+604855.79 791286.42
+604781.49 791494.7
+604805.3 791501.69
+604832.92 791508.99
+604858.64 791515.34
+604893.24 791522.65
+604924.99 791529.95
+604945.95 791533.76
+604975.79 791541.38
+605012.94 791549.64
+605018.34 791660.19
+604972.92 791778.04
+604913.23 791910.76
+604713.52 791734.26
+604641.44 791791.7
+604630.65 791802.5
+604622.07 791827.93
+604590.63 791932.7
+604557.61 792039.09
+604526.49 792144.21
+604524.31 792191.66
+604522.68 792227.71
+604477.55 792235.35
+604412.15 792246.78
+604353.73 792258.84
+604248.95 792277.89
+604168.01 792293.52
+604194.98 792477.92
+604221.06 792552.14
+604242.65 792586.43
+604287.73 792576.9
+604409.02 792557.22
+604462.99 792550.23
+604509.98 792541.98
+604479.5 792589.6
+604440.77 792646.12
+604358.06 792733.45
+604205.82 792761.02
+604247 792856.13
+603541.73 792708.49
+603535.38 792700.24
+603423.95 792677.01
+603406.17 792687.17
+603314.74 792771.62
+603276.01 792802.1
+603219.49 792864.33
+603187.11 792939.26
+603189.01 793009.74
+603204.25 793088.48
+603261.59 793180.23
+603346.4 793224.53
+603435.63 793235.28
+603527.39 793227.68
+603619.15 793211.22
+603710.28 793199.2
+603775.28 793197.97
+603925.14 793218.93
+603993.72 793219.56
+604210.89 793146.54
+604283.28 793121.77
+604292.79 793118.59
+604299.77 793115.42
+604308.03 793110.34
+604377.24 793090.65
+604374.7 793097.64
+604487.77 793061.44
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604793.23 791945.3
+Region  1
+  52
+609459.87 791813.23
+609454.25 791709.36
+609461.23 791660.81
+609400.27 791650.65
+609387.57 791582.7
+609377.41 791575.72
+609355.19 791545.24
+609325.98 791508.41
+609296.77 791482.37
+609277.72 791472.85
+609256.76 791480.47
+609244.06 791498.88
+609232.63 791482.37
+609222.47 791467.77
+609214.85 791455.07
+609033.06 791439.49
+608885.11 791330.59
+608905.75 791287.73
+608862.25 791271.54
+608828.28 791282.97
+608742.87 791362.98
+608615.55 791487.47
+608610.79 791516.37
+608622.4 791606.13
+608563.41 791672.51
+608511.34 791781.74
+608706.28 791870.34
+608683.11 791923.05
+608736.76 791937.33
+608789.47 791970.67
+608833.92 792023.66
+608877.73 792010.01
+608908.53 792010.33
+608973.94 792015.41
+609012.36 792015.4
+609030.77 792021.75
+609046.65 792032.86
+609071.73 792049.38
+609056.81 792065.22
+609048.87 792076.65
+609037.44 792121.1
+609094.15 792134.09
+609105.13 792135.65
+609169.27 792139.46
+609224.2 792130.26
+609265.34 792113.9
+609317.1 792080.56
+609360.6 792031.35
+609450.46 792057.7
+609472.2 792006.42
+609475.21 791908.12
+609459.87 791813.23
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609024.61 791733.53
+Region  1
+  123
+614878.82 796162.9
+615175.36 796495.68
+615216 796537.91
+615256.32 796579.82
+615172.18 796556.01
+615162.34 796563.31
+615151.86 796582.68
+615115.04 796618.24
+615116.47 796724.56
+615109.32 796891.63
+615092.81 796917.07
+615147.42 796926.28
+615203.93 796935.49
+615238.22 796972.32
+615262.04 796943.74
+615294.11 796873.22
+615321.8 796799.53
+615357.04 796754.76
+615489.42 796780.46
+615499.6 796931.62
+615501.19 796953.21
+615504.05 796972.26
+615505.63 796988.77
+615507.74 797003.12
+615513.25 797095.45
+615536.75 797105.92
+615563.73 797117.35
+615592.63 797129.74
+615648.19 797143.71
+615691.26 797132.34
+615755.44 797092.3
+615799.85 797079.48
+615881.15 797085
+616011.01 797097.54
+616052.62 797087.34
+616080.32 797069.37
+616109.95 797026.13
+616119.48 796963.9
+616101.41 796910.16
+616075.27 796869.87
+616034.63 796784.14
+616043.74 796731.02
+616051.14 796702.86
+616057.49 796678.73
+616063.84 796660.35
+616072.73 796637.49
+616101.94 796550.5
+616044.15 796393.6
+616513.17 796181.05
+616552.4 796134.85
+616593.51 796066.49
+616646.03 796017.76
+616636.02 796003.67
+616585.42 795931.11
+616596.85 795836.23
+616612.5 795720.29
+616657.15 795663.77
+616698.64 795612.31
+616765.1 795531.25
+616779.49 795531.61
+616872.62 795531.39
+616927.23 795530.33
+616961.31 795531.17
+617008.52 795527.27
+616973.04 795453.21
+616921.12 795400.03
+616867.29 795325.97
+616812.84 795263.3
+616753.95 795204.43
+616676.06 795118.96
+616615.27 795040.47
+616590.56 794969.57
+616593.07 794911.97
+616621.53 794848.05
+616663.91 794794.89
+616697.75 794769.96
+616728.17 794756.44
+616755.82 794735.86
+616703.7 794652.44
+616577.42 794614.34
+616510.59 794668.88
+616438.76 794667.95
+616426.78 794689.46
+616405.63 794693.58
+616313.24 794722.05
+616186.65 794731.52
+616016.4 794765.68
+615967.68 794795.42
+615955.67 794842.89
+615936.08 794937.2
+615896.88 795038.47
+615811.46 795117.57
+615700.09 795183.39
+615437.67 794783.49
+615296.7 794902.87
+615125.55 795050.77
+615116.03 795096.49
+615108.26 795125.07
+615085.29 795212.61
+615034.49 795230.39
+614977.34 795253.25
+615001.37 795316.21
+614985.56 795338.99
+614956.39 795406.19
+614830.02 795705.27
+614588.08 795561.83
+614576.02 795545.32
+614472.51 795483.09
+614316.94 795512.93
+614189.3 795507.21
+614189.3 795528.17
+614187.98 795986.72
+614271.8 795987.99
+614325.14 795982.91
+614335.93 795978.47
+614361.33 795979.74
+614398.43 795981.36
+614444.01 795989.6
+614493.37 795988.34
+614566.8 796001.64
+614661.75 796008.62
+614751.22 796043.24
+614878.82 796162.9
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 615690.6 795803.9
+Region  1
+  158
+604366.78 804044.43
+604471.39 804148.41
+604298.09 804342.62
+604294.09 804350.98
+604363.18 804390.25
+604399.54 804430.98
+604470.26 804550.46
+604493.9 804584.64
+604535.71 804597.73
+604736.97 804625.18
+604807.52 804633.55
+604843.53 804623.36
+604874.98 804603.18
+604901.89 804563.9
+604909.52 804541.72
+604924.61 804493.2
+604943.52 804433.19
+604947.52 804376.84
+604937.34 804311.74
+604930.79 804274.28
+604899.98 804104.2
+604910.78 804023.62
+604983.87 803725.41
+604981.33 803664.72
+605106.78 803609.06
+605307.02 803714.61
+605341.5 803818.84
+605294.13 803862.04
+605259.24 803906.91
+605250.1 803954.27
+605260.07 804001.62
+605282.5 804058.95
+605290.4 804180.67
+605302.86 804366.77
+605309.51 804394.19
+605324.47 804409.98
+605337.76 804418.28
+605352.71 804429.92
+605384.92 804455.25
+605439.63 804494.43
+605483.85 804533.23
+605523.04 804581.72
+605550.19 804634.49
+605592.49 804781.49
+605605.26 804825.77
+605628.57 804850.55
+605655.73 804858.7
+605684.05 804853.65
+605707.33 804835.81
+605721.3 804788.47
+605728.29 804727.55
+605755.84 804680.6
+605790.37 804649.56
+605823.15 804632.27
+605864.28 804624.9
+605971.76 804641.97
+606056.15 804660.81
+606110.47 804673.62
+606157.03 804683.71
+606198.16 804683.71
+606249.96 804668.42
+606291.08 804642.03
+606334.54 804603.23
+606364.03 804563.66
+606374.31 804520.8
+606377.41 804451.73
+606392.74 804421.28
+606424.95 804398
+606462.19 804390.24
+606499.44 804400.33
+606521.95 804416.24
+606540.33 804431.78
+606568.51 804469.39
+606616.82 804491.73
+606677.34 804481.65
+606770.85 804411.8
+606825.17 804365.63
+606846.32 804330.09
+606854.47 804293.23
+606843.41 804243.8
+606730.7 804023.57
+606679.68 803922.1
+606641.84 803825.27
+606647.66 803787.24
+606665.12 803759.31
+606656.59 803720.12
+606647.9 803682.85
+606635.35 803632.66
+606625.42 803581.43
+606610.78 803523.41
+606604.95 803473.26
+606605.03 803427.74
+606614.19 803398.73
+606646.08 803329.73
+606497.89 803102.08
+606375.57 802865.27
+606266.06 802882.25
+606205.45 802904.07
+606151.32 802926.95
+606074.48 802960.93
+606036.57 802980.01
+605992.66 802999.35
+605962.86 803012.42
+605940.91 803036.47
+605918.43 803022.35
+605880.79 803003.01
+605815.45 802970.6
+605788.78 802964.33
+605722.57 802979.61
+605613.39 803005.36
+605513.02 803025.75
+605501 803009.02
+605361.71 803029.15
+605303.16 803035.94
+605268.66 803037.51
+605267.09 803045.35
+605255.07 803064.17
+605234.68 803100.76
+605215.86 803131.61
+605157.31 803102.33
+605149.2 803057.11
+605149.73 803024.7
+605168.02 802978.18
+605176.91 802953.61
+605166.45 802930.6
+605142.93 802945.76
+604978.78 803051.88
+604931.74 803101.55
+604496.31 802887.67
+604431.69 803016.92
+604416.3 803049.54
+604359.68 803023.08
+604320.29 803002.15
+604288.9 802983.07
+604188.88 803185.22
+604146.41 803173.52
+604097.79 803180.91
+604051.01 803165.52
+604005.47 803144.6
+603962.39 803122.44
+603919.3 803092.28
+603887.91 803069.51
+603852.22 803039.96
+603824.52 803019.04
+603798.36 802998.42
+603784.82 802996.57
+603773.12 802986.73
+603746.66 803010.73
+603726.35 803032.89
+603694.96 803063.05
+603663.25 803094.74
+604547.04 803934.26
+604516.71 803972.24
+604476.23 804001.36
+604436.37 804016.56
+604402.2 804025.44
+604378.15 804028.61
+604366.78 804044.43
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605479.21 803744.22
+Region  1
+  229
+603174.97 791627.83
+603266.43 791732.62
+603336.92 791844.39
+603375.03 791935.21
+603375.97 791959.04
+603323.57 792132.75
+603300.4 792190.22
+603306.11 792237.85
+603421.7 792359.79
+603430.59 792432.82
+603296.31 792603.34
+603406.17 792687.17
+603423.95 792677.01
+603535.38 792700.24
+603541.73 792708.49
+604247 792856.13
+604205.82 792761.02
+604358.06 792733.45
+604440.77 792646.12
+604479.5 792589.6
+604509.98 792541.98
+604462.99 792550.23
+604409.02 792557.22
+604287.73 792576.9
+604242.65 792586.43
+604221.06 792552.14
+604194.98 792477.92
+604168.01 792293.52
+604248.95 792277.89
+604353.73 792258.84
+604412.15 792246.78
+604477.55 792235.35
+604522.68 792227.71
+604524.31 792191.66
+604526.49 792144.21
+604557.61 792039.09
+604590.63 791932.7
+604622.07 791827.93
+604630.65 791802.5
+604641.44 791791.7
+604713.52 791734.26
+604913.23 791910.76
+604972.92 791778.04
+605018.34 791660.19
+605012.94 791549.64
+604975.79 791541.38
+604945.95 791533.76
+604924.99 791529.95
+604893.24 791522.65
+604858.64 791515.34
+604832.92 791508.99
+604805.3 791501.69
+604781.49 791494.7
+604855.79 791286.42
+604930.4 791081.26
+604845.98 791040.7
+604271.3 790718.45
+604242.09 790748.3
+604193.19 790748.3
+604157.31 790733.05
+604131.91 790741.31
+604092.07 790671.94
+604055.08 790591.45
+604015.07 790481.91
+603989.7 790377.14
+603963.03 790207.59
+603653.82 790031.88
+603556.42 790420.75
+602988.37 790293.74
+603005.3 790207.59
+602967.75 790198.02
+602919.89 790188.45
+602855.1 790180.35
+602846.26 790172.99
+602805.38 790144.64
+602722.91 790192.5
+602634.55 790244.78
+602551.35 790308.1
+602439.43 790275.7
+602432.8 790305.89
+602419.92 790373.26
+602399.31 790462.36
+602388.26 790512.43
+602250.57 790481.5
+602270.84 790386.88
+602326.06 790157.15
+602367.3 790118.86
+602359.93 790102.67
+602256.85 790084.26
+602189.11 790068.06
+602150.52 790059.94
+602260.62 789554.65
+602176.63 789505.63
+602103.29 789478.96
+602054.08 789457.08
+601975.02 789486.29
+601911.2 789509.15
+601823.58 789537.7
+601683.88 789499.28
+601631.81 789482.42
+601585.14 789464.64
+601520.37 789448.13
+601462.26 789436.7
+601413.05 789426.23
+601335.1 789389.72
+601290.84 789358
+601201.94 789281.48
+601195.59 789265.61
+601177.81 789300.85
+601157.8 789315.46
+601140.66 789321.49
+601125.1 789327.2
+601154.95 789335.46
+601182.55 789360.58
+601188.28 789371.34
+601198.13 789385.94
+601198.13 789402.45
+601195.59 789424.68
+601183.52 789472.31
+601160.97 789539.3
+601161.29 789559.94
+601171.13 789592.01
+601167.01 789607.57
+601141.29 789626.63
+601073.35 789681.24
+601049.22 789707.6
+601041.28 789728.23
+601044.08 789742.87
+601043.19 789751.09
+601047.63 789769.51
+601044.46 789774.91
+601043.47 789795.4
+601041.57 789811.86
+601046 789831.73
+601048.54 789845.7
+601052.04 789862.84
+601055.53 789883.16
+601110.92 789903.97
+601104.57 789923.33
+601102.03 789947.15
+601104.89 789975.41
+601113.78 789989.38
+601136.32 790015.73
+601097.91 790022.08
+601070.14 790019.48
+600944.84 789980.44
+600912.45 789963.29
+600856.79 789915.64
+600814.02 789883.27
+600765.11 789862.31
+600725.74 789861.04
+600655.85 789888.38
+600562.2 789934.42
+600611.74 790039.21
+600619.99 790081.76
+600617.45 790116.06
+600628.86 790142.07
+600629.54 790128.04
+600719.07 790086.21
+600784.16 790071.9
+600850.21 790071.9
+600934.04 790089.04
+601012.79 790128.42
+601053.44 790160.81
+601097.26 790211.62
+601153.47 790302.15
+601304.31 790546.99
+601334.79 790610.5
+601397.99 790796.29
+601445.62 790859.8
+601517.38 790911.24
+601606.62 790939.51
+601698.71 790936.97
+601711.41 790945.23
+601708.23 791000.48
+601687.91 791029.7
+601705.69 791048.11
+601723.16 791044.66
+601758.73 791028.15
+601776.51 791039.58
+601805.72 791076.41
+601834.3 791084.67
+601849.55 791082.13
+601871.77 791070.7
+601892.73 791073.24
+601921.95 791113.88
+601965.77 791139.92
+601986.73 791172.95
+601996.25 791215.5
+602012.13 791259.95
+602037.53 791259.95
+602068.02 791271.39
+602125.49 791290.15
+602145.18 791318.73
+602158.52 791349.22
+602176.3 791372.72
+602223.93 791388.59
+602258.23 791389.23
+602278.55 791380.97
+602303.32 791372.72
+602328.39 791375.32
+602344.6 791408.28
+602362.38 791407.01
+602387.88 791383.54
+602440.81 791395.9
+602482.73 791411.14
+602535.44 791445.44
+602583.45 791462.01
+602631.55 791490.48
+602678.97 791520.38
+602737.08 791547.39
+602782.81 791555.66
+602796.78 791562.63
+602827.9 791563.9
+602869.18 791559.45
+602880.61 791562.63
+602899.03 791562.63
+602913.64 791561.99
+602922.53 791559.45
+602935.87 791559.45
+602949.2 791557.55
+602965.72 791559.45
+602981.59 791554.37
+603019.7 791552.47
+603043.2 791556.28
+603067.33 791564.53
+603111.79 791583.59
+603123.85 791598.19
+603174.97 791627.83
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603056.04 791013.06
+Region  1
+  99
+604789.14 789148.97
+604711.04 789220.76
+604566.57 789049.27
+604541.81 789001.33
+604203.99 789091.23
+603926.18 789106.77
+603899.51 789107.4
+603806.11 789455.12
+603800.4 789473.22
+603797.22 789484.97
+603856.91 789511.96
+603842.31 789431.95
+603963.27 789497.35
+604307.63 789681.07
+604820.4 789957.34
+604810.88 790026.84
+604792.78 790151.62
+604791.19 790227.86
+604784.83 790244.06
+604804.83 790387.29
+604826.84 790480.81
+604861.67 790620.73
+604884.53 790666.13
+604910.38 790725.64
+604907.84 790803.76
+604890.71 790874.52
+604877.38 790946.6
+604867.85 790993.31
+604845.98 791040.7
+604930.4 791081.26
+604942.46 791059.35
+604993.9 791001.88
+605030.73 790973.9
+605055.5 790954.85
+605093.28 790928.82
+605065.34 790888.49
+605106.3 790850.74
+605149.16 790811.37
+605184.72 790778.66
+605210.12 790755.16
+605223.45 790742.78
+605241.23 790703.41
+605256.79 790668.8
+605271.4 790661.81
+605312.35 790664.02
+605329.5 790665.6
+605334.58 790646.87
+605430.46 790590.99
+605473.01 790569.72
+605512.38 790569.72
+605536.19 790561.79
+605584.77 790479.51
+605601.6 790447.44
+605622.24 790430.93
+605673.67 790418.87
+605711.77 790409.66
+605727.01 790397.59
+605743.2 790377.59
+605750.83 790358.56
+605754.63 790351.61
+605758.44 790343.35
+605789.55 790270.96
+605801.94 790232.44
+605815.15 790194.5
+605944.69 790107.19
+605966.28 790084.33
+605975.03 790004.3
+605984.71 789866.34
+605973.28 789839.99
+605911.69 789781.88
+605840.3 789714.83
+605804.42 789678.63
+605847.28 789558.93
+605879.03 789504.01
+605955.23 789438.27
+605927.74 789400.51
+605902.41 789364.43
+605871.38 789309.35
+605840.97 789251.12
+605807.56 789226.84
+605746.92 789203.34
+605698.98 789183.66
+605633.57 789162.98
+605516.41 789114.72
+605487.2 789115.97
+605434.5 789132.48
+605373.22 789159.47
+605300.83 789191.54
+605289.57 789054.6
+605254.33 789029.68
+605212.36 789001.01
+605139.55 788947.2
+605107.28 788924.78
+605005.36 788854.61
+604996.78 788842.87
+604951.06 788988.61
+604937.09 789011.15
+604863.12 789078.49
+604789.14 789148.97
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605064.43 789757.31
+Region  1
+  27
+609056.02 796409.29
+609267.23 797215.74
+609270.34 797227.62
+609271.61 797232.45
+609273.26 797238.75
+609360.23 797274.01
+609360.24 797274.01
+609360.26 797274.02
+609432.33 797303.24
+609512.36 797335.69
+609512.41 797335.71
+609536.47 797345.46
+609541.84 797345.36
+609718.25 797342.19
+609718.28 797342.19
+609721.17 797342.14
+610050.46 797317.15
+610101.36 797313.29
+610129.65 797311.15
+610396.51 796849.49
+610445.47 796767.66
+610364.34 796720.1
+609200.43 796041.44
+609187.49 796032.42
+609186.66 796035.38
+609186.35 796036.26
+609056.02 796409.29
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609665.33 796785.33
+Region  1
+  30
+608286.33 795846.18
+608017.05 795860.74
+607777.86 795880.63
+607678.4 795911.2
+607656.08 795918.96
+607635.94 795927.94
+607627.21 795982.28
+607664.36 796092.06
+607663.64 796118
+607662.2 796138.18
+607657.16 796309.69
+607696.07 796320.5
+607753.36 796332.38
+607810.29 796306.44
+607880.19 796268.97
+607911.18 796267.52
+607945.77 796138.53
+607994.77 796104.66
+608029.36 796082.32
+608035.85 796088.81
+608046.66 796107.54
+608063.23 796139.25
+608075.48 796165.2
+608087.01 796224.29
+608042.34 796306.44
+608147.55 796335.99
+608188.62 796271.13
+608201.59 796258.16
+608304.77 795846.18
+608286.33 795846.18
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607951.35 796064.08
+Region  1
+  111
+610975.76 792025.47
+611024.47 792073.78
+611045.17 792131.49
+611043.66 792191.8
+611017.08 792256.53
+610981.04 792286.4
+610928.94 792309.03
+610813.53 792326.34
+610618.19 792352.94
+610556.42 792369.91
+610505.5 792405.55
+610476.49 792451.14
+610463.25 792519.37
+610492.62 792601.04
+610689.13 792836.04
+610723.74 792824.61
+610837.4 792910.33
+610847.88 792905.89
+610866.61 792874.14
+610945.2 792827.62
+610989.97 792806.98
+611026.48 792803.81
+611048.39 792805.72
+611110.31 792759.12
+611170.43 792718.61
+611223.83 792677.57
+611314 792669
+611376.23 792650.27
+611406.86 792661.53
+611526.37 792754.4
+611628.29 792821.06
+611606.07 792910.28
+611685.3 792894.88
+611752.29 792880.26
+611716.69 792779.63
+611792.25 792738.67
+611841.46 792851.39
+611861.78 792825.67
+611877.98 792794.87
+611903.86 792711.84
+611920.69 792679.78
+611958.79 792637.86
+612005.01 792589.12
+612019.3 792538
+611995.49 792462.12
+611983.89 792382.57
+611941.15 792285.25
+611887.17 792040.63
+612025.6 792038.73
+611978.3 791896.48
+611918.29 791957.45
+611843.04 791837.73
+611790.34 791793.26
+611781.13 791715.16
+611811.93 791645.28
+611799.55 791611.29
+611765.26 791602.72
+611747.8 791609.07
+611695.41 791642.09
+611854.16 791436.37
+612049.1 791434.47
+611924.96 791332.22
+611906.58 791222.68
+611890.38 791207.44
+611862.13 791211.57
+611844.35 791220.46
+611769.41 791228.08
+611731.63 791211.25
+611704.25 791114.33
+611660.07 791061.36
+611658.49 791037.55
+611651.5 791016.27
+611623.65 790991.21
+611558.25 790961.04
+611537.29 790960.41
+611474.99 790997.55
+611437.99 791030.69
+611340.01 791070.86
+611273.02 791074.04
+611216.18 791052.13
+611045.88 790956.4
+610917.94 790891.86
+610790.38 790774.05
+610627.18 790610.78
+610582.86 790562.66
+610517.75 790481.14
+610501.09 790467.73
+610491.75 790442.95
+610473.06 790409.64
+610471.84 790393.39
+610448.48 790346.06
+610424.1 790316
+610405.82 790291.22
+610306.09 790215.05
+610261.17 790156.26
+610245.15 790130.96
+610221.49 790067.22
+610189.91 790116.34
+610138.54 790169.6
+610099.79 790215.73
+610078.85 790267.39
+610081.39 790329.62
+610140.13 790525.48
+610196.5 790718.36
+610199.32 790825.1
+610231.85 790910.99
+610567.76 791819.43
+610596.27 791871.02
+610645.32 791908.14
+610933.83 792003.52
+610975.76 792025.47
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611098.07 791696.71
+Region  1
+  132
+606721.71 793362.33
+606768.52 793293.34
+606793.94 793257.4
+606817.44 793218.98
+606506.54 792862.58
+606584.33 792757.48
+606601.47 792724.11
+606641.79 792617.7
+606678.62 792547.53
+606694.93 792511.83
+606708.26 792481.99
+606744.06 792413.9
+606745.49 792388.94
+606749.05 792351.85
+606746.2 792296.23
+606738.35 792255.57
+606720.16 792204.58
+606699.48 792175.34
+606583.22 792079.77
+606318.21 791904.04
+606317.57 791829.14
+606328.36 791727.51
+606333.44 791669.09
+606332.17 791631.63
+606287.09 791513.59
+606278.52 791480.25
+606321.07 791450.09
+606355.99 791423.1
+606298.48 791376.39
+606062.26 791187.8
+605955.57 791087.34
+605911.76 791060.03
+605875.94 791035.71
+605961.03 790960.46
+605858.47 790927.44
+605819.77 791096.23
+605770.88 791189.79
+605711.4 791281.99
+605658.59 791362.15
+605608.64 791439.27
+605549.69 791515.55
+605481.01 791590.2
+605431.37 791635.87
+605297.49 791745.34
+605211.02 791815.01
+605148.48 791866.36
+605160.76 791893.24
+605164.99 791904.67
+605170.71 791914.41
+605174.52 791929.65
+605173.46 791943.2
+605137.05 791964.79
+605138.75 791974.52
+605159.28 791988.28
+605183.83 792001.83
+605148.06 792037.17
+605155.47 792055.38
+605163.3 792056.65
+605187.01 792046.7
+605196.32 792056.76
+605193.57 792070.94
+605184.68 792077.93
+605154.2 792084.28
+605103.82 792083.79
+605066.15 792092.47
+605041.17 792105.16
+605005.04 792099.88
+604975.83 792112.58
+604935.19 792165.92
+604902.17 792164.65
+604897.09 792188.78
+604933.92 792207.83
+604946.62 792289.11
+604904.71 792289.11
+604871.69 792351.27
+604833.59 792362.1
+604877.41 792398.6
+604895.5 792528.79
+604817.71 792691.68
+604887.56 792752.33
+604940.26 792754.23
+605010.43 792731.69
+605018.63 792768.07
+605026.25 792804.27
+605031.33 792829.03
+604998.31 792827.76
+604968.46 792827.13
+604931.63 792823.95
+604941.79 792889.36
+604947.51 792908.41
+605031.45 792911.35
+605108.8 792939.52
+605153.88 792970.64
+605191 793002.73
+605235.46 793041.47
+605280.55 793092.28
+605331.99 793145.62
+605477.41 793205.95
+605541.87 793210.08
+605602.84 793210.08
+605664.44 793211.99
+605740.64 793218.34
+605818.12 793233.58
+605901.95 793268.51
+605960.79 793313.89
+606008.08 793351.26
+606050.04 793383.68
+606094.66 793421.82
+606132.42 793453.86
+606188.67 793511.26
+606220.71 793558.56
+606244.57 793623.67
+606237.49 793689.02
+606216.13 793752.72
+606183.52 793804.02
+606148.48 793837.19
+606010.26 793934.49
+606040.74 793983.7
+606329.14 793849.57
+606387.56 793823.85
+606474.77 793737.3
+606510.96 793716.98
+606568.11 793714.44
+606577 793700.47
+606560.81 793670.31
+606565.57 793657.29
+606575.41 793633.79
+606601.39 793614.35
+606611.55 793555.16
+606631.55 793496.45
+606653.77 793460.57
+606721.71 793362.33
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605891.86 792461.58
+Region  1
+  72
+615754.36 800435.37
+615832.84 800427.71
+616204.04 800506.18
+616203.56 800476.04
+616189.21 800430.59
+616194.95 800349.25
+616204.28 800214.1
+616246.86 800204.53
+616246.51 800159.14
+616245.94 800153.35
+616244.88 800137.68
+616245.34 800130.28
+616220.66 800061.76
+616222.54 800025.73
+616179.99 799914.28
+616161.9 799866.02
+616124.21 799787.6
+616041.54 799815.15
+616021.81 799759.26
+616008.19 799713.82
+615931.68 799699.53
+615881.51 799717
+615876.43 799739.86
+615867.9 799769.36
+615860.06 799803.4
+615866.81 799822.46
+615886.95 799872.34
+615906.52 799937.28
+615902.54 799938.01
+615788.29 799979.12
+615779.63 799990.37
+615746.75 800085.14
+615671.01 800066.1
+615591.39 800015.04
+615542.49 799983.45
+615456.37 799914.64
+615437.96 799901.02
+615416.18 799884.27
+615055.78 799796.55
+614707.04 799306.85
+614642.09 799354.24
+614583.67 799354.24
+614534.77 799326.3
+614482.29 799275.33
+614434.76 799229.17
+614463.31 799279.77
+614483 799333.53
+614486.88 799395.53
+614488.08 799451.12
+614467.14 799509.76
+614443.68 799544.1
+614414.57 799578.24
+614337.09 799628.92
+614285.36 799654.67
+614238.04 799684.82
+614170.8 799726.57
+614121.82 799777.79
+614106.99 799812.24
+614087.85 799862.95
+614078.76 799889.74
+614077.81 799904.57
+614411.46 800172.25
+614460.97 800227.99
+614537.04 800323.2
+614571.71 800382.28
+614727.67 800332.52
+614795.61 800309.08
+614776.47 800244.97
+614778.86 800232.53
+615224.27 800324.85
+615636.67 800410.97
+615754.36 800435.37
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 615134.59 799996.79
+Region  1
+  29
+609626.53 799456.79
+609259.34 799386.37
+609215 799391.25
+609198.65 799472.44
+609181.82 799557.5
+609168.17 799629.15
+609140.64 799768.32
+609527.1 799839.9
+609606.06 799843.8
+609597.75 799953.48
+609912.63 800095.8
+609956.5 800116.28
+609967.22 800003.19
+609949.67 799980.77
+609900.93 799933
+609862.91 799896.93
+609838.54 799872.56
+609820.99 799856.96
+609838.54 799779.95
+609850.24 799708.79
+609860.96 799661.02
+609856.09 799613.25
+609852.39 799558.92
+609806.25 799555.8
+609772.95 799554.41
+609736.65 799553.3
+609702.27 799550.31
+609622.79 799547.27
+609626.53 799456.79
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609547.1 799701.09
+Region  1
+  40
+609977.59 798430.62
+610349.98 798233.01
+610781.51 798002.88
+610752.99 797972.24
+610690.5 797956.47
+610638.02 797949.49
+610619.02 797927.72
+610586.34 797893.13
+610569.18 797875.43
+610553.37 797857.53
+610458.47 797853.5
+610331.97 797859.67
+610219.9 797864.95
+610157.54 797868.49
+610104.16 797860.32
+610038.93 797829.38
+609956 797785.37
+609870.21 797756.23
+609770.13 797726.92
+609709.8 797725.42
+609628.37 797732.5
+609562.74 797749.93
+609513.3 797783.55
+609476.95 797841.72
+609460.06 797877.39
+609427.79 797941.83
+609386.54 798023.68
+609314.77 798166.8
+609269.96 798221.4
+609223.39 798255.72
+609141.56 798300.26
+609026.36 798363.44
+609039.43 798385.23
+609104.37 798482.7
+609127.52 798518.11
+609193.84 798617.41
+609267.77 798492.3
+609794.22 798505.1
+609842.29 798504.94
+609977.59 798430.62
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609836.99 798138.18
+Region  1
+  136
+603740.77 805799.57
+604404.28 805677.04
+604440.74 805674.5
+604472.96 805683.82
+604522.99 805749.11
+604591.67 805848.32
+604702.34 805517.2
+604749.83 805431.56
+604793.07 805353.55
+604793.07 805352.71
+604808.33 805306.92
+604872.78 805246.71
+604918.14 805203.89
+604974.11 805158.1
+605058.05 805114.01
+605178.46 805048.72
+605210.92 804998.68
+605205.28 804947.43
+605117.13 804758.83
+605069.98 804734.23
+605003.87 804750.12
+604938.83 804789.78
+604882.99 804805.89
+604778.73 804822.37
+604713.78 804827.86
+604580.04 804807.25
+604488.63 804797.24
+604397.17 804768.17
+604318.07 804742.28
+604264.38 804745.64
+604219.32 804761.46
+604193.43 804763.37
+604168.99 804752.35
+604156.04 804734.61
+604151.48 804711.87
+604163.47 804682.15
+604197.5 804630.86
+604199.42 804597.78
+604182.64 804561.83
+604154.83 804515.7
+604133.37 804477.52
+604118.1 804448.79
+604113.01 804419.71
+604127.56 804384.07
+604163.55 804341.53
+604185.37 804325.89
+604216.28 804319.71
+604294.09 804350.98
+604298.09 804342.62
+604471.39 804148.41
+604366.78 804044.43
+604378.15 804028.61
+604402.2 804025.44
+604436.37 804016.56
+604476.23 804001.36
+604516.71 803972.24
+604547.04 803934.26
+603663.25 803094.74
+603604.32 803040.44
+603564 803015.86
+603528.6 803003.07
+603486.31 802995.2
+603429.28 802994.22
+603361.42 802994.22
+603294.55 802992.25
+603262.1 802995.2
+603213.92 803006.02
+603175.57 803015.86
+603017.24 803143.69
+602769.4 803382.68
+602747.77 803474.14
+602746.78 803506.59
+602745.8 803527.24
+602741.87 803544.94
+602734.98 803563.63
+602723.18 803626.56
+602713.35 803670.82
+602710.42 803723.94
+602739.92 803787.86
+602780.75 803830.64
+602822.05 803858.17
+602874.17 803868.99
+602890.89 803867.02
+602935.14 803895.54
+602970.54 804000.77
+602989.23 804034.2
+603025.61 804068.62
+603060.03 804066.65
+603085 804064.07
+603129.86 804033.22
+603184.93 803930.94
+603230.16 803867.02
+603251.8 803830.64
+603299 803840.47
+603330.47 803885.71
+603374.72 803952.58
+603406.46 803986.72
+603436.17 804026.83
+603478.45 804115.34
+603446.98 804161.56
+603413.55 804205.81
+603381.1 804248.1
+603357.49 804283.5
+603325.04 804337.59
+603298.49 804376.92
+603398.11 804391.63
+603478.52 804406.14
+603580.42 804397.86
+603803.5 804430.78
+603840 804440.75
+603865.52 804450.77
+603845.1 804474.28
+603551.08 804725.59
+603314.71 804936.79
+603230.34 805010.14
+603173.53 805060.16
+603121.81 805102.56
+603064.87 805166.17
+603035.32 805227.21
+603025.99 805245.01
+603050.58 805256.04
+603374.04 805382.39
+603152.75 805939.36
+603148.77 805949.36
+603449.63 806093.46
+603454.97 806083.46
+603473.62 806048.53
+603493.86 806032.7
+603512.83 806016.24
+603550.15 805995.98
+603569.76 805987.74
+603600.11 805955.46
+603630.23 805910.13
+603675.68 805840.58
+603701.85 805813.72
+603740.77 805799.57
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603828.12 804538.39
+Region  1
+  69
+607834.8 789884.27
+607441.1 789809.65
+607384.91 789816.95
+607344.73 789800.3
+607090.48 789835.06
+607046.98 789790.93
+606780.84 789931.75
+606856.72 790022.89
+606816.71 790043.5
+606709.72 790200.99
+606742.41 790291.96
+606757.34 790358.95
+606844.07 790748.64
+606951.38 790793.41
+607052.36 790837.23
+607015.83 790870.57
+607009.17 790909.97
+607031.07 790952.51
+607067.27 791013.78
+607095.84 791067.76
+607096.82 791112.84
+607051.39 791149.99
+606999 791157.58
+607039.96 791227.75
+607065.68 791266.17
+607131.09 791263
+607172.36 791264.27
+607205.11 791260.97
+607189.51 791307.77
+607216.81 791324.63
+607282.85 791357.01
+607352.7 791388.76
+607371.11 791396.38
+607389.84 791426.86
+607412.7 791447.83
+607428.89 791458.63
+607451.43 791467.2
+607482.87 791473.87
+607534.3 791483.71
+607538.43 791526.56
+607547 791563.07
+607557.16 791620.54
+607570.82 791693.25
+607591.77 791813.56
+607594.94 791924.01
+608271.39 791975.44
+608299.38 791888.28
+608320.34 791864.14
+608366.7 791857.48
+608427.98 791859.06
+608456.87 791850.17
+608482.91 791832.07
+608497.16 791817.53
+608511.34 791781.74
+608563.41 791672.51
+608622.4 791606.13
+608610.79 791516.37
+608615.55 791487.47
+608621.58 791441.12
+608627.3 791395.39
+608629.83 791376.69
+608652.02 791219.93
+608659.64 791148.81
+608511.08 791065.86
+608450.09 791162.15
+608227.84 790894.81
+608629.82 790219.61
+608167.54 790000.16
+607834.8 789884.27
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607731.57 790804.15
+Region  1
+  25
+603126.4 802871.3
+602818.6 802723.79
+602811.72 802715.93
+602809.75 802715.93
+602793.03 802749.36
+602763.53 802784.76
+602710.43 802817.21
+602558.01 802886.05
+602478.84 802882.63
+602414.93 802914.09
+602516.71 803078.79
+602562.93 803162.39
+602605.21 803231.23
+602634.72 803282.37
+602663.24 803330.55
+602706.51 803403.33
+602747.77 803474.14
+602769.4 803382.68
+603017.24 803143.69
+603175.57 803015.86
+603129.35 802964.72
+603123.45 802923.42
+603124.43 802900.8
+603123.45 802886.05
+603126.4 802871.3
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 602798.84 803037.38
+Region  1
+  67
+604533.92 794044.44
+604547.26 794081.28
+604538.37 794124.47
+604523.12 794145.11
+604384.25 794168.93
+604253.55 794189.25
+604113.1 794218.5
+604095.32 794222.95
+604479.93 794831.8
+604564.4 794772.42
+604536.14 794733.36
+604498.99 794688.91
+604485.97 794666.05
+604472.15 794619.52
+604470.72 794571.71
+604497.71 794529.16
+604562.49 794474.23
+604634.1 794401.01
+604703.32 794418.15
+604757.78 794457.38
+604834.31 794518.66
+604914.97 794477.07
+604955.46 794458.84
+604999.91 794502.34
+605039.29 794479.16
+605120.9 794469.95
+605129.3 794430.2
+605131.84 794420.99
+604974.53 794215.55
+605011.2 794204.96
+605051.53 794195.59
+605012.73 794129.1
+604990.93 794090.6
+604975.45 794060.25
+604973.69 794055.37
+604909.14 794072.52
+604871.67 794047.76
+604857.28 794007.96
+604864.27 793878.72
+604897.09 793818.59
+604975.62 793667.09
+605011.39 793649.73
+605054.58 793653.33
+605076.59 793636.19
+605122.31 793640.84
+605194.07 793571.17
+605286.68 793489.76
+605238.42 793431.65
+605176.02 793401.3
+605084.25 793439.09
+604948.49 793485.57
+604889.43 793518.91
+604862.82 793533.59
+604821.07 793593.72
+604785.02 793668.4
+604756.85 793763.59
+604725.56 793764.6
+604628.24 793775.02
+604613.48 793773.91
+604577.59 793799.95
+604543.62 793781.85
+604508.37 793756.45
+604467.72 793783.44
+604453.91 793793.43
+604467.71 793838.5
+604477.4 793909.17
+604533.92 794044.44
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604693.77 794126.66
+Region  1
+  92
+610518.38 801303.38
+610714.63 801226.77
+610850.84 801174.05
+610941.65 801180.51
+610981.46 801182.05
+611003.84 801166.55
+611015.89 801133.41
+611116.5 801144.03
+611196.87 801147.4
+611335.02 801167.2
+611281.66 801060.46
+611278 801026.63
+611278.43 800968.09
+611283.59 800916.45
+611211.5 800884.32
+611192.99 800922.2
+611087.97 800905.84
+610950.82 800883.41
+610879.67 800872.07
+610783.9 800819.69
+610701.8 800738.37
+610626.36 800665.27
+610645.9 800616.8
+610665.84 800569.49
+610683.24 800527.45
+610716.47 800444.96
+610697.7 800426.98
+610669.36 800419.74
+610658.99 800323.34
+610649.61 800237.72
+610643.55 800193.71
+610615.02 800126.08
+610610.72 800103.41
+610602.12 800085.43
+610611.5 799990.04
+610618.34 799958.19
+610633.98 799933.56
+610653.91 799916.36
+610687.53 799910.5
+610688.71 799872.58
+610688.71 799837.39
+610627.72 799844.43
+610574.95 799850.68
+610556.57 799852.64
+610532.34 799854.98
+610440.47 799877.27
+610415.33 799884.78
+610338.81 799876.52
+610282.93 799862.52
+610253.09 799844.74
+610242.93 799824.42
+610207.37 799848.57
+610182.92 799865.71
+610132.94 799894.98
+610095.9 799917.41
+610066.65 799934.95
+610049.25 799950.17
+609992.42 799938.1
+609967.22 800003.19
+609956.5 800116.28
+609960.39 800163.07
+609969.17 800202.06
+609997.75 800326.15
+609997.75 800400.43
+609985.64 800465.03
+609953.97 800529.15
+609838.89 800708
+609813.63 800768.39
+609808.55 800830.54
+609836.11 800929.28
+609879.3 801068.67
+609892.99 801129.65
+609892.36 801193.37
+609871.58 801275.63
+609829.31 801393.96
+609739.85 801657.67
+609735.1 801674.65
+609959.7 801971.07
+609990.83 802033.47
+610013.02 802110.45
+610038.49 802197.47
+610066.68 802129.69
+610139.22 801966.05
+610394.87 802094.3
+610409.07 802042.22
+610406.68 802005.86
+610445.64 801778.01
+610438.32 801644.18
+610363.22 801470.53
+610331.37 801400.38
+610367.52 801363.79
+610518.38 801303.38
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610317.77 800934.73
+Region  1
+  120
+616755.31 799397.96
+616768.8 799375.89
+616783.08 799352.07
+616791.97 799330.48
+616802.45 799310.16
+616803.4 799267.61
+616812.29 799235.55
+616821.07 799179.86
+616833.88 799153.31
+616841.5 799119.02
+616847.22 799099.63
+616854.52 799085.02
+616863.1 799076.77
+616905.32 799064.38
+616938.03 799065.97
+616968.19 799074.23
+617111.39 799092.33
+617127.26 799093.29
+617137.74 799085.67
+617153.3 799050.42
+617159.01 799017.08
+617153.3 799005.02
+617134.67 799006.1
+617139.97 798964.64
+617152.02 798955.97
+617126.83 798912.47
+617116.35 798853.28
+617097.8 798826.46
+617078.76 798782.58
+617060.19 798761.61
+617057.18 798740.49
+617069.11 798705.21
+617093.94 798591.91
+617053.32 798547.42
+617060.79 798531.99
+617115.27 798535.85
+617164.69 798556.82
+617190.49 798531.99
+617196.38 798510.47
+617186.26 798486.12
+617191.68 798467.95
+617177.22 798446.02
+617171.43 798423.6
+617165.77 798406.4
+617224.11 798375.07
+617281.24 798359.16
+617284.13 798349.03
+617262.56 798312.74
+617290.76 798292.73
+617316.07 798284.06
+617331.5 798273.69
+617332.83 798251.43
+617345.36 798232.87
+617373.57 798241.79
+617380.8 798255.29
+617388.03 798252.88
+617395.26 798208.28
+617409.72 798190.69
+617433.47 798183.8
+617485.3 798160.9
+617533.64 798116.7
+617577.39 798070.8
+617635.48 798029.82
+617644.88 797994.62
+617587.27 797993.42
+617521.7 797982.33
+617482.93 797972.41
+617440.5 797959.15
+617380.99 797951.58
+617335.43 797965.53
+617282.29 797990.23
+617204.45 798001.02
+617161.99 797964.98
+617048.2 797869.77
+616555.12 797636.95
+616527.82 797587.14
+616505.91 797545.86
+616409.07 797619.84
+616395.07 797672.45
+616372.55 797788.42
+616359.85 797853.41
+616350.96 797889.71
+616372.55 797938.33
+616417.72 798067.85
+616446.31 798151.98
+616465.38 798210.81
+616475.42 798270.11
+616470.97 798355.55
+616455.41 798405.08
+616432.14 798460.73
+616405.65 798535.4
+616386.83 798614.94
+616369.68 798702.28
+616380.48 798709.9
+616398.58 798751.5
+616333.81 798788.93
+616259.83 798838.15
+616196.96 798877.52
+616137.59 798915.3
+616145.36 798929.04
+616198.72 799016.66
+616214.44 799044.13
+616198.24 799120.65
+616166.05 799273.2
+616150.28 799318.76
+616122.82 799449.45
+616113.93 799472.95
+616112.66 799482.48
+616190.7 799521.65
+616260.52 799549.69
+616280.86 799567.83
+616296.25 799541.44
+616671.2 799626.66
+616698.14 799633.8
+616723.42 799587.62
+616731.12 799548.04
+616713.53 799515.61
+616716.28 799482.07
+616741.02 799432.04
+616755.31 799397.96
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 616725.83 798592.17
+Region  1
+  135
+608501.68 798601.09
+607699.22 798592.87
+607684.77 798653.61
+607665.49 798731.8
+607652.94 798786.36
+607651.86 798855.01
+607678.27 798868.87
+607770.92 798910
+607787.81 798916.93
+607811.19 798927.32
+607813.14 798962.21
+607849.29 799013.11
+607881.33 799062.04
+607883.49 799004.02
+607959.7 799038.66
+608085.06 799098.29
+608119.89 799110.93
+608159.3 799132.17
+608196.54 799147.76
+608227.28 799303.63
+608192.64 799268.13
+608158 799254.71
+608121.72 799258.18
+608104.1 799248.45
+608045.21 799290.88
+607985.89 799337.64
+607858.38 799246.06
+607676.75 799109.41
+607648.17 799102.92
+607516.55 799095.99
+607449.87 799086.9
+607364.83 799079.32
+607336.7 799099.23
+607317.43 799069.59
+607295.36 799042.76
+607225.02 799094.27
+607154.89 799147.72
+607085.53 799183.37
+607058.23 799198.61
+607027.11 799214.49
+607002.97 799227.83
+606985.83 799237.35
+606958.52 799251.96
+606936.93 799268.47
+606911.53 799237.99
+606906.45 799202.43
+606903.27 799157.97
+606791.5 799227.19
+606781.28 799235.48
+606767.82 799235.48
+606758.39 799249.83
+606783.52 799287.97
+606788.91 799321.63
+606791.6 799356.18
+606800.57 799407.33
+606757.95 799397.01
+606730.13 799395.22
+606707.69 799396.56
+606690.19 799397.01
+606667.31 799398.81
+606627.37 799414.96
+606646.67 799446.82
+606691.61 799526.85
+606725.65 799593.04
+606799.89 799738.24
+606856.62 799839.42
+606910.52 799936.81
+606944.9 799985.23
+606968.21 800020.03
+607005.55 800057.4
+607090.66 800127.38
+607162.52 800167.1
+607223.99 800199.25
+607291.13 800233.29
+607369.62 800274.9
+607440.95 800320.92
+607506.26 800384.08
+607574.02 800432.84
+607641.2 800495.43
+607715.34 800561.19
+607837.23 800647.9
+607873.74 800681.32
+607927.99 800715.91
+607955.9 800732.57
+607963.46 800724.06
+608045.26 800632.77
+608109.56 800555.23
+608155.9 800496.61
+608185.21 800434.2
+608215.47 800350.98
+608248.09 800300.38
+608293.48 800266.34
+608362.71 800227.15
+608401.28 800173.67
+608438.68 800062.67
+608440.63 799975.91
+608536.17 799904.74
+608561.05 799890.77
+608680.45 799841.37
+608840.32 799782.88
+608804.99 799691.02
+608790.37 799614
+608791.58 799533.82
+608781.83 799456.81
+608767.94 799408.31
+608721.14 799321.55
+608678.25 799275.24
+608634.38 799241.12
+608603.19 799223.09
+608603.94 799206.27
+608605.89 799104.39
+608641.47 799105.37
+608745.29 799107.81
+608735.06 799014.71
+608725.8 798953.29
+608721.41 798909.42
+608711.52 798829.09
+608706.07 798793.14
+608632.23 798805.09
+608596.79 798807.64
+608543 798818.42
+608503.12 798822.87
+608461.65 798825.67
+608483.98 798785.63
+608494.87 798768.2
+608507.81 798744.11
+608522.79 798720.41
+608535.59 798697.26
+608507.54 798681.47
+608483.44 798668.54
+608468.46 798660.1
+608480.44 798640.22
+608489.43 798623.61
+608494.6 798614.35
+608501.68 798601.09
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607836.58 799593.41
+Region  1
+  62
+607651.86 798855.01
+607652.94 798786.36
+607665.49 798731.8
+607684.77 798653.61
+607699.22 798592.87
+607712.91 798540.59
+607739.98 798430.4
+607623.07 798401.82
+607593.84 798395.57
+607571.76 798389.94
+607647.76 798114.29
+607653.6 798091.57
+607508.55 798053.9
+607452.69 798059.53
+607399.86 798062.56
+607390.77 798099.8
+607384.92 798116.02
+607378.86 798135.07
+607329.06 798134.21
+607294.85 798135.07
+607299.62 798246.35
+607302.64 798414.81
+607017.94 798417.6
+606874.62 798425.39
+606750.52 798451.42
+606754.99 798574.63
+606761.34 798721.97
+606764.19 798807.42
+606766.1 798933.79
+606756.26 798967.1
+606722.6 799012.19
+606698.46 799036.32
+606666.08 799101.09
+606648.22 799135.09
+606701.41 799177.14
+606758.39 799249.83
+606767.82 799235.48
+606781.28 799235.48
+606791.5 799227.19
+606903.27 799157.97
+606906.45 799202.43
+606911.53 799237.99
+606936.93 799268.47
+606958.52 799251.96
+606985.83 799237.35
+607002.97 799227.83
+607027.11 799214.49
+607058.23 799198.61
+607085.53 799183.37
+607154.89 799147.72
+607225.02 799094.27
+607295.36 799042.76
+607317.43 799069.59
+607336.7 799099.23
+607364.83 799079.32
+607449.87 799086.9
+607516.55 799095.99
+607648.17 799102.92
+607649.47 798996.84
+607650.25 798958.63
+607650.72 798892.91
+607651.86 798855.01
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607226.3 798712.48
+Region  1
+  75
+607254.24 796698.42
+607329.17 796728.9
+607414.27 796749.18
+607471.42 796764.74
+607554.93 796794.28
+607636.84 796832.38
+607793.36 796916.44
+607848.13 796969.77
+607884.88 797034.62
+607917.31 797084.35
+607964.38 797175.46
+608026.98 797228.93
+608062.16 797103.8
+608096.75 796969.77
+608122.69 796921.48
+608150.07 796929.41
+608170.25 796925.09
+608134.94 796798.98
+608140.71 796754.3
+608189.34 796740.24
+608187.18 796727.27
+608179.98 796704.93
+608173.49 796678.99
+608179.98 796643.68
+608235.11 796425.69
+608248.8 796360.12
+608231.14 796355.44
+608203.76 796348.96
+608147.55 796335.99
+608042.34 796306.44
+608087.01 796224.29
+608075.48 796165.2
+608063.23 796139.25
+608046.66 796107.54
+608035.85 796088.81
+608029.36 796082.32
+607994.77 796104.66
+607945.77 796138.53
+607911.18 796267.52
+607880.19 796268.97
+607810.29 796306.44
+607753.36 796332.38
+607696.07 796320.5
+607657.16 796309.69
+607662.2 796138.18
+607641.3 796155.47
+607607.43 796205.19
+607590.14 796270.77
+607563.48 796281.58
+607532.49 796207.36
+607176.14 796278.31
+607155.24 796278.31
+607064.44 796334.52
+607028.5 796471.92
+606717.98 796537.83
+606657.34 796544.18
+606570.66 796533.71
+606505.26 796501.33
+606456.36 796450.52
+606422.08 796399.1
+606392.23 796414.98
+606347.15 796473.4
+606320.48 796530.56
+606300.79 796599.14
+606269.8 796673.28
+606253.8 796703.58
+606296.4 796739.11
+606374.14 796774.06
+606530.11 796788.97
+606614.16 796765.8
+606824.67 796695.58
+606944.37 796663.83
+607042.79 796660.02
+607183.44 796683.19
+607254.24 796698.42
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607482.92 796580.34
+Region  1
+  188
+603698.09 797108.93
+603772.24 797073.97
+603769.17 797067.85
+603755.88 797041.3
+603736.75 797000.29
+603694.84 796951.39
+603650.99 796861.78
+603626.22 796782.4
+603609.72 796725.92
+603600.2 796690.36
+603611.9 796632.07
+603657.23 796588.43
+603708.66 796556.62
+603761.1 796532.6
+603782.76 796535.31
+604167.34 796684.44
+604172.42 796673.64
+604179.4 796664.75
+604067.9 796417.63
+604016.33 796245.91
+604000.64 796254.84
+603997.49 796256.84
+603992.96 796260.83
+603985.97 796264
+603971.37 796296.39
+603870.15 796267.2
+603860.57 796258.48
+603847.23 796244.46
+603820.35 796215.25
+603795.79 796191.75
+603755.99 796173.99
+603693.55 796140.55
+603632.8 796104.63
+603591.52 796079.87
+603569.72 796068.01
+603605.92 796002.03
+603600.62 795984.85
+603590.89 795953.95
+603574.8 795917.97
+603527.37 795818.13
+603506.41 795788.92
+603478.47 795774.11
+603432.54 795770.72
+603397.19 795776.86
+603365.02 795814.11
+603342.17 795850.04
+603314.02 795895.34
+603346.24 795930.54
+603383.91 795976.02
+603408.88 796016.87
+603434.49 796066.21
+603354.91 796109.6
+603301.18 796151.93
+603224.44 796238.18
+603127.07 796352.67
+603119.69 796378.26
+603109.53 796556.42
+603108.28 796639.77
+603030.18 796663.69
+602974.51 796679.78
+602895.78 796705.19
+602677.36 796769.42
+602557.82 796805.3
+602489.87 796827.38
+602342.52 796912.73
+602280.1 796964.12
+602276.28 796968.36
+602270.14 796971.96
+602287.97 796993.62
+602300.71 797009.33
+602316.85 797028.86
+602342.75 797058.58
+602374.59 797092.97
+602406.01 797123.54
+602458.66 797119.3
+602513.76 797118.71
+602563.5 797143.26
+602584.88 797175.22
+602598.42 797215.22
+602602.23 797239.58
+602607.1 797276.41
+602608.37 797297.15
+602609.85 797313.66
+602614.95 797376.23
+602621.78 797389.9
+602680.07 797435.94
+602724.53 797473.73
+602755.65 797507.39
+602776.13 797540.26
+602784.38 797561.86
+602788.83 797574.24
+602793.91 797598.69
+602806.61 797627.59
+602809.94 797656.99
+602818.68 797721.81
+602969.83 797987.91
+603133.06 798213.04
+603362.8 798364.38
+603488.55 798405.35
+603512.05 798378.99
+603539.67 798365.34
+603588.89 798361.84
+603607.94 798326.93
+603666.05 798136.72
+603685.04 798118.11
+603691.08 798111.43
+603695.84 798106.35
+603699.97 798102.54
+603706 798096.51
+603714.57 798086.03
+603737.75 798061.26
+603764.41 798044.75
+603868.23 798024.12
+603943.48 798040.63
+603939.99 798028.24
+603936.81 798018.4
+603932.37 798007.92
+603929.19 797999.03
+603922.21 797980.93
+603911.41 797958.39
+603904.11 797943.17
+603860.61 797890.46
+603783.46 797848.87
+603742.82 797850.42
+603803.78 797818.67
+603802.51 797756.67
+603786.95 797646.5
+603744.72 797566.48
+603754.53 797528.56
+603721.51 797472.05
+603693.57 797403.47
+603753.26 797349.49
+603789.55 797350.19
+603827.55 797354.57
+603854.22 797349.49
+603875.18 797327.27
+603901.85 797312.03
+603933.6 797303.77
+603956.46 797298.69
+603990.75 797295.52
+604051.07 797308.85
+604089.17 797366
+604126.64 797426.33
+604160.5 797460.38
+604137.68 797386.32
+604101.87 797233.29
+604141.24 797153.28
+604151.72 797135.82
+604116.79 797067.23
+604100.61 797014.87
+604063.45 797095.18
+604040.28 797137.45
+604020.9 797173.96
+603974.54 797261.6
+603919.63 797232.02
+603964.38 797150.46
+603902.14 797132.64
+603821.74 797124.86
+603788.19 797105.87
+603772.49 797074.48
+603698.13 797109.17
+603694.36 797111.08
+603713.37 797130.92
+603720.56 797238.02
+603682.86 797257.46
+603653.22 797263.39
+603602.8 797274.84
+603552.17 797275.47
+603492.03 797268.49
+603439.02 797260.85
+603377.22 797244.73
+603329.35 797230.49
+603303.78 797221.82
+603301.66 797209.33
+603306.53 797191.76
+603310.97 797176.53
+603324.73 797150.91
+603360.72 797144.72
+603433.32 797136.47
+603500.63 797129.27
+603560.32 797122.46
+603593.98 797119.71
+603625.73 797116.95
+603693.5 797110.48
+603698.03 797108.96
+603698.05 797108.95
+603698.07 797108.94
+603698.09 797108.93
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603311.29 797168.24
+Region  1
+  62
+602585.49 794303.08
+602547.38 794301.2
+602509.05 794331.19
+602479.06 794336.61
+602450.73 794340.77
+602433.65 794354.94
+602365.34 794380.76
+602295.15 794394.32
+602293.48 794438.48
+602283.48 794458.89
+602272.24 794469.72
+602262.66 794480.14
+602246.83 794498.88
+602222.25 794523.46
+602192.05 794557.04
+602174.14 794575.79
+602153.94 794643.09
+602134.36 794704.74
+602098.74 794819.96
+602070 794915.77
+602082.91 794920.77
+602141.23 794934.51
+602194.23 794926.35
+602254.36 794914.97
+602324.52 794899.11
+602362.84 794891.61
+602407.41 794883.28
+602444.89 794875.74
+602466.26 794866.64
+602511.94 794845.38
+602555.16 794827.75
+602604.69 794804.67
+602678.56 794796
+602726.4 794788.8
+602784.39 794780.55
+602798.57 794768.7
+602810.63 794741.18
+602812.11 794714.52
+603025.88 794687.02
+603101.87 794679.4
+603053.9 794273.19
+603084.7 794266.34
+603152.26 794268.84
+603214.28 794270.12
+603262.92 794272.84
+603261.29 794248.73
+603261.11 794244.81
+603277.56 794225.82
+603292.75 794210
+603302.62 794199.17
+603311.37 794190.42
+603323.03 794180.84
+603190.15 794133.76
+603028.93 794121.68
+602989.57 794146.85
+602943.33 794183.51
+602898.54 794199.94
+602833.14 794203.28
+602785.24 794241.19
+602759.2 794241.84
+602614.65 794294.75
+602585.49 794303.08
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 602650.89 794538.13
+Region  1
+  24
+610478.51 806853.55
+610451.45 806764.68
+610302.34 806646.63
+610176.09 806676.39
+610107.57 806697.73
+610094.2 806745.74
+610078.24 806790.6
+610076.88 806829.33
+610077.15 806856.06
+610078.1 806897.38
+610083.77 806913.15
+610097.74 806946.04
+610105.85 806957.93
+610114.85 806970.2
+610130.12 806987.93
+610303.19 807204.24
+610457.73 807380.62
+610490.76 807344.39
+610508.35 807318.28
+610524.87 807263.39
+610539.26 807162.14
+610534.2 807084.6
+610502.76 806953.5
+610478.51 806853.55
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610325.7 806968.08
+Region  1
+  84
+610000.22 809630.78
+610179.74 812529.46
+610168.22 812532.2
+610150.73 812548.43
+610102.16 812575.9
+610099.07 812605.6
+610102.16 812632.2
+610089.78 812651.39
+610060.08 812668.71
+610024.2 812686.65
+609985.83 812707.69
+609947.47 812726.87
+609917.15 812747.29
+609893.02 812768.33
+609866.42 812801.74
+609851.31 812831.68
+609838.57 812853.1
+609830.23 812877.26
+609819.39 812905.07
+609876.95 812936.52
+609933.36 812946.21
+610053.34 812898.13
+610101.45 812945.07
+610224.77 812929.97
+610241.01 812919.43
+610304.83 812896.63
+610379.47 812875.55
+610443.86 812870.99
+610473.48 812864.16
+610491.72 812839.09
+610497.42 812828.83
+610511.09 812802.05
+610504.82 812758.18
+610493.43 812734.81
+610481.46 812710.31
+610457.8 812581.25
+610438.42 812551.05
+610325.01 812345.93
+610317.03 812307.75
+610314.75 812259.89
+610316.76 812239.09
+610315.05 812217.44
+610323.03 812171.86
+610296.22 812051.63
+610254.06 811980.98
+610258.62 811886.4
+610284.26 811806.63
+610325.54 811725.43
+610354.03 811643.38
+610334.34 811597.51
+610321.8 811519.45
+610304.14 811468.73
+610277.93 811260.76
+610290.24 811204.24
+610315.06 811128.45
+610390.11 811051.76
+610427.3 810983.22
+610491.59 810885.99
+610519.21 810849.65
+610551.29 810721.53
+610595.71 810663.38
+610648.31 810630.44
+610700.38 810604.4
+610755.1 810577.84
+610740.23 810552.34
+610728.54 810523.11
+610719.27 810408.62
+610711.3 810325.2
+610691.38 810267.56
+610656.31 810223.99
+610620.72 810196.89
+610581.93 810179.36
+610423.6 810115.6
+610337 810083.19
+610279.62 810047.06
+610243.49 809985.96
+610227.4 809918.05
+610212.89 809873.63
+610197.48 809843.7
+610132.19 809788.39
+610060.56 809733.99
+610038.17 809665.92
+609998.85 809612.29
+610000.22 809630.78
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610269.65 811208.28
+Region  1
+  39
+618796.43 806979.58
+618779.92 806888.14
+618691.1 806705.43
+618586.09 806489.76
+618642.76 806458.76
+618688.48 806463.84
+618744.36 806347
+618750.71 806278.42
+618713.88 806176.82
+618349.39 806547.66
+618208.42 806477.81
+618177.94 806551.47
+618337.96 806639.1
+618541.16 806518.45
+618505.6 806454.95
+618523.38 806402.88
+618585.75 806490.34
+618691.4 806707.61
+618660.54 806726.85
+618623.71 806687.48
+618560.21 806723.04
+618548.78 806792.89
+618501.79 806799.24
+618397.65 806861.47
+618397.65 806963.07
+618419.24 807017.68
+618424.32 807093.88
+618463.69 807142.14
+618518.3 807255.17
+618534.81 807242.47
+618529.73 807330.1
+618563.11 807462.45
+618604.95 807454.48
+618531.53 807329.11
+618623.71 807267.87
+618694.83 807211.99
+618749.44 807142.14
+618781.19 807071.02
+618796.43 806979.58
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 618574.67 806824.02
+Region  1
+  98
+604338.38 787582.99
+603781.88 787427.05
+603705.03 787389.58
+603664.7 787351.79
+603633.9 787307.97
+603613.9 787270.5
+603601.2 787244.78
+603591.04 787220.65
+603581.52 787196.2
+603552.95 787193.34
+603433.25 787300.02
+603391.66 787397.2
+603357.69 787474.68
+603335.78 787513.38
+603296.73 787558.79
+603262.13 787614.95
+603229.11 787670.2
+603182.75 787727.98
+603135.13 787760.36
+603127.69 787729.17
+602800.35 787575.79
+602641.1 787581.93
+602595.7 787584.5
+602592.21 787594.98
+602575.38 787626.42
+602568.71 787638.8
+602560 787649.8
+602644.78 787693.94
+602775.9 787753.63
+603001.79 787849.8
+602923.37 787893.94
+602888.13 787913.94
+602838.92 787939.66
+602753.2 787992.68
+602703.03 788008.51
+602694.14 788037.69
+602662.39 788130.41
+602677.49 788167.87
+602700.98 788296.78
+602725.11 788305.99
+602699.71 788377.73
+602657.49 788441.56
+602665.19 788467.69
+602676.22 788529.51
+603030.9 788632.62
+603059.79 788641.15
+603167.42 788670.68
+603215.69 788684.67
+603249.98 788562.11
+603282.99 788454.43
+603924.36 788661.11
+603969.45 788653.47
+603993.26 788645.54
+604006.6 788631.25
+604015.49 788614.1
+604023.74 788574.1
+603974.85 788553.09
+603983.74 788532.77
+604007.55 788501.02
+604073.27 788439.43
+604248.22 788440.34
+604258.7 788406.05
+604269.04 788395.76
+604293.08 788362.85
+604325.06 788346
+604358.4 788339.65
+604417.77 788323.14
+604457.77 788329.49
+604490.16 788350.43
+604554.61 788327.57
+604564.77 788318.05
+604588.9 788299.95
+604589.86 788290.2
+604572.29 788284.69
+604564.25 788274.73
+604537.16 788259.7
+604534.83 788245.73
+604544.78 788229.43
+604583.94 788211.44
+604605.32 788208.45
+604620.35 788193.21
+604620.14 788181.36
+604594.1 788174.37
+604595.48 788163.46
+604619.52 788154.86
+604635.82 788111.95
+604652.96 788092.63
+604685.02 788032.79
+604597.09 787999.06
+604550.1 787942.12
+604530.9 787921.08
+604491.02 787896.39
+604459.31 787881.01
+604428.83 787873.39
+604377.71 787873.7
+604346.28 787764.14
+604347.23 787612.1
+604338.38 787582.99
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603594.59 788031.96
+Region  1
+  83
+609513.3 797783.55
+609562.74 797749.93
+609628.37 797732.5
+609709.8 797725.42
+609770.13 797726.92
+609870.21 797756.23
+609956 797785.37
+610038.93 797829.38
+610104.16 797860.32
+610157.54 797868.49
+610219.9 797864.95
+610331.97 797859.67
+610458.47 797853.5
+610553.37 797857.53
+610624.36 797800.2
+610660.37 797744.98
+610632.61 797722.27
+610631.77 797721.28
+610631.76 797721.27
+610312.77 797346.95
+610303.95 797342.41
+610303.94 797342.41
+610295.21 797337.92
+610295.19 797337.91
+610228.59 797303.64
+610141.32 797310.26
+610137.4 797310.56
+610129.65 797311.15
+610101.36 797313.29
+610050.46 797317.15
+609721.17 797342.14
+609718.28 797342.19
+609718.25 797342.19
+609541.84 797345.36
+609536.47 797345.46
+609512.41 797335.71
+609512.36 797335.69
+609432.33 797303.24
+609360.26 797274.02
+609360.24 797274.01
+609360.23 797274.01
+609273.26 797238.75
+609271.61 797232.45
+609270.34 797227.62
+609267.23 797215.74
+609258.44 797212.05
+609101.56 797154.13
+608960.15 797175.03
+608831.65 797204.11
+608765.53 797253.82
+608694.71 797258.51
+608582.44 797335.17
+608519.61 797359.55
+608446.46 797355.33
+608314 797314.33
+608181.06 797218.38
+608062.16 797103.8
+608026.98 797228.93
+607956.31 797550.18
+607849.83 797990.5
+607893.13 798006.57
+608127.21 798093.01
+608212.99 798143.39
+608337.45 798220.41
+608418.34 798271.07
+608466.68 798301.74
+608510.72 798324.33
+608563.92 798345.82
+608623.44 798364.13
+608734.4 798399.98
+608817.46 798411.42
+608888.68 798407.16
+608946.96 798395.18
+609026.36 798363.44
+609141.56 798300.26
+609223.39 798255.72
+609269.96 798221.4
+609314.77 798166.8
+609386.54 798023.68
+609427.79 797941.83
+609460.06 797877.39
+609476.95 797841.72
+609513.3 797783.55
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609035.79 797715.38
+Region  1
+  8
+612042.44 794612.37
+611896.98 794073.48
+611517.67 794169.95
+611529.6 794224.95
+611692.15 794859.51
+611959.77 794883.85
+612120.89 794904.17
+612042.44 794612.37
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611812.98 794502.19
+Region  1
+  21
+616671.2 799626.66
+616296.25 799541.44
+616280.86 799567.83
+616434.73 800081.34
+616471.76 800112.11
+616508.2 800122.36
+616538.03 800107.49
+616560.03 800095.98
+616585.49 800063.17
+616647.06 799989.5
+616662.45 799952.11
+616676.75 799889.44
+616687.74 799821.82
+616674 799797.08
+616656.96 799775.09
+616668.5 799744.3
+616681.4 799725.89
+616685.79 799700.6
+616683.05 799672.02
+616698.14 799633.8
+616671.2 799626.66
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 616502.58 799807.2
+Region  1
+  127
+604516.67 802005.15
+604673.04 802066.06
+604733.53 802093.61
+604795.26 802140.52
+604844.64 802200.6
+604866.04 802264.79
+604874.27 802345.44
+604854.1 802480
+604876.76 802452.81
+604900 802428.4
+605078.88 802356.5
+605096.14 802362.82
+605140.43 802395.04
+605180.98 802424.08
+605213.19 802445.94
+605268.98 802427.53
+605301.19 802384.39
+605344.91 802320.55
+605397.82 802244.62
+605461.89 802151.24
+605493.15 802073.35
+605521.67 801999.28
+605529.16 801920.35
+605505.1 801786.2
+605498.05 801731.96
+605496.03 801671.22
+605494.88 801629.17
+605491.42 801573.28
+605489.12 801530.65
+605343.45 800790.35
+605355.7 800678.81
+605394.57 800540.44
+605405.37 800543.94
+605420.29 800547.11
+605495.85 800560.45
+605555.86 800569.66
+605563.79 800517.56
+605576.49 800451.55
+605586.02 800423.61
+605607.92 800371.86
+605662.85 800395.35
+605689.2 800406.15
+605713.97 800415.67
+605736.18 800367.46
+605746.02 800347.14
+605760.31 800316.66
+605788.89 800299.2
+605818.55 800281.9
+605871.12 800252.21
+605899.06 800243
+605930.81 800206.17
+605903.5 800178.23
+605886.99 800163.62
+605835.56 800178.86
+605811.11 800188.07
+605762.53 800182.67
+605773.01 800151.88
+605787.62 800122.03
+605798.1 800099.8
+605811.75 800073.77
+605820.64 800049.94
+605828.58 800030.25
+605839.38 800006.12
+605840.01 799985.8
+605822.13 799959.03
+605793.86 799905.18
+605751.68 799898
+605737.77 799895.31
+605735.53 799859.86
+605732.84 799834.28
+605730.59 799809.15
+605720.93 799739.38
+605710.61 799649.19
+605672.91 799703.48
+605655.86 799720.98
+605628.49 799718.29
+605590.35 799713.8
+605580.92 799703.48
+605575.99 799685.98
+605567.46 799663.1
+605561.18 799638.87
+605546.59 799585.25
+605523.93 799490.34
+605522.59 799408.22
+605548.85 799290.43
+605556.16 799192.25
+605540.98 799189.24
+605418.48 799199.11
+605325.39 799206.07
+605252.25 799222.67
+605169.91 799237.7
+605096.77 799260.14
+605009.27 799284.37
+604710.16 799380.02
+604621.88 799405.99
+604548.63 799429.3
+604502.21 799524.32
+604516.74 799531.49
+604577.92 799557.53
+604610.89 799582.26
+604634.75 799618.7
+604659.27 799700.05
+604676.62 799771.92
+604723.06 799925.67
+604746.05 800000.28
+604765.36 800065.56
+604784.45 800107.63
+604818.28 800175.73
+604855.81 800254.89
+604758.21 800306.51
+604717.44 800338.6
+604641.63 800402.4
+604068.52 800927.89
+604121.71 801165.66
+604132.87 801558.43
+604150.78 801637.8
+604187.03 801703.08
+604210.42 801742.47
+604232.57 801777.55
+604255.96 801815.71
+604288.58 801871.11
+604315.97 801903.44
+604344.49 801926.3
+604400.23 801959.8
+604441.52 801974.84
+604468.01 801985.29
+604516.67 802005.15
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604982 800833.23
+Region  1
+  49
+610396.51 796849.49
+610129.65 797311.15
+610137.4 797310.56
+610141.32 797310.26
+610228.59 797303.64
+610295.19 797337.91
+610295.21 797337.92
+610303.94 797342.41
+610303.95 797342.41
+610312.77 797346.95
+610631.76 797721.27
+610631.77 797721.28
+610632.61 797722.27
+610660.37 797744.98
+610784.42 797846.47
+610895.94 797914.74
+610954.26 797934.59
+611008.97 797939.4
+611054.7 797924.12
+611077.59 797916.47
+611087.59 797913.13
+611279.6 797714.87
+611615.08 797617.44
+611615.09 797617.44
+611618.55 797616.43
+611754.38 797695.33
+611747.51 797640.44
+611734.97 797597.8
+611731.33 797568.17
+611703.51 797451.9
+611666.53 797339.3
+611638.65 797248.78
+611633.55 797157.64
+611643.01 797067.76
+611670.83 796997.5
+611730.94 796934.21
+611825.87 796913.34
+611868.61 796937.4
+611914.93 796854.82
+611894.42 796844.33
+611899.19 796788.51
+611766.04 796286.36
+611762.54 796273.77
+611356.52 796376.94
+611321.54 796387.43
+610600.74 796581.61
+610409.8 796630.57
+610445.47 796767.66
+610396.51 796849.49
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611082.25 797086.06
+Region  1
+  183
+604501.94 807272.23
+604430.43 807260.47
+604442.65 807279.93
+604457.59 807299.84
+604468.9 807316.58
+604484.74 807340.57
+604362.09 807316.58
+604345.8 807322.02
+604332.23 807352.79
+604300.55 807352.34
+604249.86 807355.05
+604142.6 807379.91
+604049.38 807404.8
+603952.53 807438.29
+603887.6 807461.15
+603823.34 807479.25
+603729.67 807500.06
+603696.18 807509.56
+603659.08 807522.69
+603672.2 807562.06
+603695.73 807642.6
+603718.82 807737.6
+603718.93 807823.64
+603764.59 807886.25
+603812.09 807907.11
+603886.15 807907.7
+603994.46 807967.75
+604023.62 807998.1
+604030 808034.79
+604050.27 808049.33
+604145.28 808099.27
+604166.85 808139.75
+604148.57 808196.06
+604120.21 808294.14
+604080.44 808385.89
+604036.87 808468.16
+604007.23 808552.95
+603990.82 808590.29
+604004.84 808665.57
+603987.82 808724.41
+603966.98 808762.38
+603926.54 808821.24
+603913.35 808902.86
+603943.19 808972.44
+604004.07 809057.82
+604031.97 809100.19
+604055.47 809162.81
+604167.61 809244.37
+604194.13 809256.19
+604211.09 809263.25
+604240.77 809237.81
+604226.22 809249.17
+604255.94 809220.06
+604277.52 809184.1
+604301.55 809143.82
+604324.88 809191.87
+604365.4 809171.93
+604411.58 809142.81
+604432.47 809135.21
+604453.97 809120.65
+604454.56 809092.64
+604450.32 809054.47
+604467.28 809050.23
+604525.23 809043.17
+604583.19 809036.1
+604617.82 809028.32
+604628.42 809021.26
+604621.35 809007.12
+604612.87 808990.16
+604610.04 808973.9
+604619.94 808954.12
+604666.58 808924.43
+604707.58 808894.69
+604743.62 808877.79
+604756.34 808925.14
+604793.09 808964.72
+604819.24 809010.66
+604834.08 809054.47
+604839.43 809083.15
+604779.42 809212.86
+604768.69 809236.27
+604774.41 809258.41
+604804.82 809290.02
+604837.15 809333.66
+604863.72 809324.16
+604900.41 809295.04
+604913.07 809293.14
+604929.57 809336.15
+604941.59 809333.61
+604963.1 809325.38
+605006.81 809298.14
+605157.61 809399.87
+605006.81 809298.14
+605096.7 809242.63
+605169.68 809194.25
+605159.82 809175.36
+605145.87 809150.06
+605135.09 809134.25
+605130.65 809120.97
+605145.18 809100.09
+605217.92 809043.75
+605282.43 808988.68
+605333.4 808950.86
+605368.73 808920.47
+605424.57 808877.36
+605454.46 808832.98
+605492.07 808780.78
+605478.28 808760.04
+605489.23 808704.56
+605502.66 808644.49
+605516.09 808570.99
+605542.95 808527.17
+605594.54 808479.82
+605638.94 808445.2
+605666.11 808404.69
+605660.33 808340.17
+605629.52 808213.79
+605503.72 808197.53
+605523.51 808121.91
+605497.71 808112.31
+605475.1 808111.6
+605454.6 808113.72
+605454.6 808091.81
+605461.67 808005.59
+605368.38 807993.57
+605335.16 807969.55
+605330.22 807947.64
+605335.52 807848.98
+605315.73 807846.16
+605300.18 807844.04
+605289.4 807839.92
+605269.79 807825.66
+605292.98 807579.27
+605299.18 807436.03
+605262.34 807427.44
+605265.78 807414.35
+605279.9 807351.37
+605292.98 807285.95
+605309.5 807188.98
+605332.22 806994.78
+605151.8 806974.81
+605073.64 806967.59
+605079.15 806928.33
+605089.47 806843.63
+604940.68 806880.36
+604840.87 806902.16
+604814.02 806914.56
+604787.16 806930.4
+604758.92 806942.79
+604753.76 806930.76
+604643.22 806738.31
+604624.63 806688.73
+604632.89 806568.22
+604620.5 806484.89
+604508.94 806608.16
+604457.98 806628.13
+604407.02 806632.95
+604340.22 806628.13
+604256.89 806639.15
+604252.84 806553.62
+604251.04 806470.1
+604246.22 806376.45
+604132.35 806377.8
+604133.62 806416.71
+604104.01 806413.96
+604014.15 806410.49
+604010.71 806456.63
+603970.77 806527.56
+603905.46 806655.66
+603866.96 806746.78
+603853.78 806835.99
+603859.55 806894.83
+603893.19 806971.36
+603929.96 807011.83
+603993.94 807052.92
+604091.48 807097.79
+604207.36 807134.43
+604318.8 807160.94
+604466.33 807193.13
+604507.82 807199.82
+604514.61 807201.18
+604507.82 807229.69
+604501.94 807272.23
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604649.37 807950.47
+Region  1
+  36
+609923.45 795453.85
+610085.28 795410.24
+610158.17 795390.6
+610273.88 795359.41
+610288.59 795355.45
+610160.8 794944.94
+610151.5 794877.14
+610140.07 794808.88
+610121.34 794779.67
+610097.04 794747.44
+610042.25 794677.14
+610033.36 794659.36
+610021.3 794633.64
+610003.52 794634.59
+609944.46 794637.45
+609854.93 794643.8
+609770.87 794647.4
+609771.51 794630.88
+609756.9 794622.63
+609668.89 794588.79
+609650.79 794590.06
+609601.51 794590.98
+609578.99 794602.24
+609545.7 794643.04
+609513.8 794681.03
+609522.25 794711.51
+609518.49 794767.79
+609508.88 794880.14
+609524.82 794982.43
+609556.95 795148.23
+609597.99 795334.69
+609626.83 795404.31
+609680.3 795519.21
+609695.98 795515.15
+609696.4 795515.04
+609923.45 795453.85
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609858.46 795048.8
+Region  1
+  93
+612204.3 799892.7
+612173.94 799892.64
+612123.92 799905.92
+612099.13 799904.11
+612113.33 799864.93
+612141.75 799811.98
+612165.85 799767.21
+612171.45 799753.01
+612173.6 799745.26
+612165.5 799740.25
+612138 799730.14
+612088.8 799716.41
+612035.61 799703.18
+611974.26 799686.76
+611978.72 799703.65
+611983.82 799735.92
+611991.06 799762.18
+611997.12 799781.84
+611987.74 799803.73
+611902.55 799840.85
+611884.76 799882.05
+611837.48 799976.62
+611842.57 800017.33
+611848.77 800056.11
+611860.02 800177.69
+611866.05 800228.49
+611870.56 800264.87
+611874.86 800304.9
+611857.21 800315.24
+611831.38 800328.58
+611807.27 800342.79
+611810.72 800390.57
+611815.02 800422.86
+611786.62 800440.08
+611747.01 800464.18
+611756.65 800528.88
+611757.07 800542.37
+611982.41 800618.48
+612040.28 800722.76
+612071.95 800781.4
+612124.73 800880.67
+612120.82 800933.84
+612097.49 801026.49
+612079.38 801095.61
+612096.39 801087.88
+612112.59 801078.67
+612154.18 801062.16
+612202.12 801049.14
+612262.73 801046.65
+612330.35 801051.83
+612401.5 801103.43
+612434.33 801078.8
+612467.55 801051.96
+612498.99 801025.61
+612533.91 801007.54
+612581.54 800999.29
+612640.56 800997.1
+612681.87 800977.06
+612708.08 800955.19
+612755.03 800915.43
+612765.88 800906.74
+612805.35 800845.75
+612860.96 800811.66
+612909.31 800779.97
+612980.15 800732.99
+612995.52 800754.37
+613061.06 800707.96
+613049.71 800690.62
+613182.49 800607.09
+613186.13 800580.4
+613173.59 800531.19
+613146.55 800447.41
+613155.34 800419.2
+613146.55 800399.48
+613135.32 800379.46
+613126.67 800367.19
+613096.71 800304.11
+613056.15 800226.25
+613034.17 800157.98
+612983.11 800070.72
+612932.34 800014.75
+612872.22 799980.93
+612820.94 799972.14
+612752.54 799970.97
+612706.61 799971.19
+612576.45 799936.79
+612519.98 799922.14
+612450.03 799903.38
+612312.86 799865.08
+612304.65 799887.75
+612298.99 799915.69
+612239.59 799899.67
+612204.3 799892.7
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612441.74 800413.96
+Region  1
+  20
+611580.4 798459.32
+611580.85 798142.82
+611389.82 798144.64
+611251.89 798145.32
+611194.9 798144.41
+611189.99 798181.88
+611177.57 798262.5
+611157.29 798416.92
+611114.66 798563.5
+611161.62 798533.86
+611205.85 798502.86
+611232.75 798492.37
+611260.56 798491.46
+611282.44 798496.02
+611304.1 798504.91
+611327.81 798514.03
+611346.5 798520.41
+611367.48 798514.49
+611480.55 798485.31
+611580.4 798459.32
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611367.5 798327.2
+Region  1
+  43
+611782.83 798852.38
+611495.18 798748.59
+611392.55 798716.02
+611054.01 798770.98
+610933.86 798792.93
+610779.06 799024.33
+610589.85 799319.74
+610624.38 799488.64
+610658.99 799504.51
+610698.7 799522.64
+610644.41 799587.1
+610550.1 799658.54
+610534.29 799824.88
+610532.34 799854.98
+610556.57 799852.64
+610574.95 799850.68
+610627.72 799844.43
+610688.71 799837.39
+610682.5 799812.22
+610677.74 799785.23
+610707.13 799766.02
+610755.99 799732.36
+610843.18 799674.1
+610903.96 799630.12
+610945.07 799591.54
+610991.42 799627.1
+611031.75 799641.7
+611134.3 799669.66
+611285.88 799704.64
+611466.82 799730.04
+611493.39 799700.73
+611517.42 799640.34
+611548.68 799562.57
+611567.25 799526.35
+611602.81 799465.77
+611618.86 799438.61
+611623.47 799413.99
+611625.06 799326.03
+611636.65 799286.46
+611659.04 799221.5
+611683.17 799148.47
+611723.1 799028.37
+611782.83 798852.38
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611164.83 799245.06
+Region  1
+  30
+603821.74 797124.86
+603902.14 797132.64
+603964.38 797150.46
+603919.63 797232.02
+603974.54 797261.6
+604020.9 797173.96
+604040.28 797137.45
+604063.45 797095.18
+604100.61 797014.87
+604100.96 796996.76
+604103.2 796986.68
+604150.19 796765.72
+604167.34 796684.44
+603782.76 796535.31
+603761.1 796532.6
+603708.66 796556.62
+603657.23 796588.43
+603611.9 796632.07
+603600.2 796690.36
+603609.72 796725.92
+603626.22 796782.4
+603650.99 796861.78
+603694.84 796951.39
+603736.75 797000.29
+603755.88 797041.3
+603769.17 797067.85
+603772.24 797073.97
+603772.49 797074.48
+603788.19 797105.87
+603821.74 797124.86
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603887.46 796841.34
+Region  1
+  31
+603693.5 797110.48
+603625.73 797116.95
+603593.98 797119.71
+603560.32 797122.46
+603500.63 797129.27
+603433.32 797136.47
+603360.72 797144.72
+603324.73 797150.91
+603310.97 797176.53
+603306.53 797191.76
+603301.66 797209.33
+603303.78 797221.82
+603329.35 797230.49
+603377.22 797244.73
+603439.02 797260.85
+603492.03 797268.49
+603552.17 797275.47
+603602.8 797274.84
+603653.22 797263.39
+603682.86 797257.46
+603720.56 797238.02
+603713.37 797130.92
+603694.36 797111.08
+603698.13 797109.17
+603772.49 797074.48
+603772.24 797073.97
+603698.09 797108.93
+603698.07 797108.94
+603698.05 797108.95
+603698.03 797108.96
+603693.5 797110.48
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603530.73 797194.72
+Region  1
+  32
+604066.4 800914.04
+604034.4 800760.74
+604021.47 800697.34
+604004.24 800608.71
+603965.46 800615.48
+603931 800624.72
+603878.25 800637.18
+603835.41 800646.38
+603792.19 800659.37
+603743.43 800649.9
+603713.73 800646.87
+603693.42 800643.8
+603670.65 800641.95
+603671.58 800671.22
+603670.96 800722.92
+603662.34 800772.16
+603648.8 800800.47
+603637.72 800842.32
+603626.95 800876.46
+603615.88 800906.62
+603611.57 800922.01
+603604.18 800936.16
+603491.55 800930.01
+603528.78 801103.88
+603540.48 801153.12
+603568.81 801220.02
+603610.61 801237.71
+603627.71 801242.13
+604057.47 801174.67
+604121.71 801165.66
+604068.52 800927.89
+604066.4 800914.04
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603819.45 800953.76
+Region  1
+  29
+603960.32 800405.92
+603938.89 800297.21
+603931.33 800239.97
+603925.58 800180.38
+603904.15 800112.43
+603875.67 800075.06
+603835.42 800036.9
+603798.82 800007.63
+603776.61 800087.34
+603752.57 800153.72
+603724.86 800205.99
+603668.94 800264.01
+603639.41 800291.98
+603641.5 800304.53
+603642.03 800346.34
+603642.55 800412.19
+603658.56 800480.45
+603670.65 800641.95
+603693.42 800643.8
+603713.73 800646.87
+603743.43 800649.9
+603792.19 800659.37
+603835.41 800646.38
+603878.25 800637.18
+603931 800624.72
+603965.46 800615.48
+604004.24 800608.71
+603980.85 800501.62
+603960.32 800405.92
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603813.08 800388.27
+Region  1
+  28
+608948.41 793545.77
+608961.1 793467.46
+608955.39 793367.76
+608943.32 793339.19
+608947.13 793292.83
+609002.78 793209.48
+609051.49 793141.13
+608995.65 793163.6
+608953.74 793149
+608910.78 793131.25
+608896.18 793162.05
+608855.95 793245.52
+608811.88 793330.93
+608759.81 793442.06
+608785.21 793452.22
+608756.68 793491.74
+608709.25 793610.73
+608667.45 793699.13
+608680.47 793703.25
+608695.71 793707.06
+608714.44 793712.46
+608725.24 793716.59
+608730.95 793717.54
+608741.43 793720.4
+608750 793707.06
+608890.02 793633.7
+608918.28 793616.24
+608948.41 793545.77
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608857.31 793447.2
+Region  1
+  45
+606077.61 806011.73
+605745.81 806310.32
+605394.95 806113.23
+605352.68 806152.3
+605319.61 806148.91
+605305.19 806157.39
+605248.91 806380.45
+605200.01 806589.11
+605164.2 806844.55
+605415.9 806621.76
+606703.67 806756.72
+606726.4 806783.58
+606729.84 806808.37
+606762.34 806812.99
+606824.96 806769.94
+606880.64 806752.83
+606876.65 806742.83
+606864.76 806712.98
+606839.42 806695.91
+606795.72 806673.16
+606757.69 806640.91
+606729.17 806604.87
+606720.25 806559.32
+606725.26 806517.56
+606776.99 806400.02
+606774.64 806341.32
+606753.51 806240.36
+606732.27 806052.55
+606714.43 805960.19
+606690.48 805739.82
+606682.65 805631.03
+606646.65 805491.73
+606634.85 805506.57
+606610.42 805538.27
+606536.55 805597
+606481.46 805646.65
+606437.85 805597.74
+606368.3 805698.97
+606289.79 805808.47
+606185.81 805936.56
+606150.87 805922.12
+606115.91 805908.01
+606111.09 805955.52
+606095.25 805982.38
+606077.61 806011.73
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606141.58 806308.87
+Region  1
+  61
+602586.14 798507.59
+602557.24 798487.9
+602516.6 798466.64
+602484.21 798399.97
+602445.48 798338.04
+602443.58 798310.42
+602444.21 798266.28
+602347.06 798230.09
+602202.47 798177.56
+602081.31 798126.18
+602060.35 798116.65
+601973.99 798086.81
+602035.59 798175.71
+602038.13 798260.16
+602022.25 798326.84
+602017.81 798400.49
+602005.75 798423.35
+601946.06 798483.04
+601914.95 798554.79
+601949.87 798744.02
+602061 798781.48
+602021.8 798874.63
+601997.67 798912.73
+601955.12 799055.61
+601971.63 799193.35
+601968.46 799209.23
+601995.27 799270.96
+602035.03 799356.26
+602008.36 799437.56
+602209.5 799503.89
+602182.95 799587.21
+602383.14 799649.15
+602372.08 799614.12
+602444.71 799546.65
+602509.6 799501.68
+602593.11 799437.33
+602728.23 799328
+602781.69 799284.49
+602803.62 799253.34
+602806.96 799246.06
+602811.09 799238.43
+602877.16 799203.26
+602957.1 799168.36
+603054.22 799121.36
+603041.69 799088.05
+603001.17 798972.1
+602979.1 798908.73
+602951.16 798884.28
+602927.02 798872.21
+602860.34 798867.13
+602827.15 798869.43
+602753.01 798872.87
+602801.28 798810.95
+602834.62 798772.53
+602839.06 798750.94
+602877.96 798676.13
+602897.65 798631.04
+602827.47 798613.26
+602766.68 798599.32
+602657.59 798543.79
+602586.14 798507.59
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 602389.85 798906.04
+Region  1
+  48
+610073.61 794046.78
+610002.33 794005.36
+609958.2 793974.24
+609989.62 793921.84
+610001.05 793898.03
+609951.84 793835.8
+609903.9 793773.25
+609828.33 793922.79
+609733.4 793925.02
+609703.88 793921.19
+609674.67 793904.36
+609657.52 793871.66
+609610.53 793815.14
+609595.92 793835.78
+609570.53 793871.38
+609553.06 793923.14
+609557.19 793978.07
+609564.37 794005.86
+609622.65 794074.6
+609602.97 794094.92
+609561.06 794132.71
+609581.06 794162.23
+609601.83 794188.43
+609603.73 794293.52
+609644.42 794310.98
+609644.42 794335.75
+609649.64 794456.25
+609650.79 794590.06
+609668.89 794588.79
+609756.9 794622.63
+609771.51 794630.88
+609770.87 794647.4
+609854.93 794643.8
+609944.46 794637.45
+610003.52 794634.59
+610021.3 794633.64
+610021.62 794578.71
+610069.8 794516.06
+610088.49 794473.78
+610085.58 794425.55
+610063.42 794385.67
+610019.9 794340.76
+609996.6 794287.58
+609992.79 794218.68
+610003.59 794165.03
+610024.71 794123.62
+610059.32 794068.37
+610073.61 794046.78
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609822.33 794242.14
+Region  1
+  32
+605239.41 796179.88
+605890.43 796943.85
+606048.37 797132.45
+606052.17 797114.08
+606058.08 797085.44
+606062.09 797066.05
+606064.25 797055.61
+606073.01 797041.43
+606073.02 797041.42
+606103.48 796992.15
+606162.85 796975.84
+606241.28 796960.92
+606250.16 796848.48
+606222.64 796809.69
+606266.04 796777.67
+606257.93 796768.69
+606247.45 796749
+606239.19 796729.01
+606222.97 796700.49
+606193.2 796661.87
+606157.4 796611.8
+606021.83 796394.35
+605983.59 796272.52
+605734.65 796118.73
+605681.63 796085.93
+605658.77 796065.05
+605587.01 795964.79
+605481.97 796007.66
+605419.2 796039.54
+605357.83 796076.84
+605231.07 796169.79
+605239.41 796179.88
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605792.64 796500.08
+Region  1
+  32
+612410.34 794953.98
+613034.19 793881.37
+613061.38 793835.57
+613005.18 793808.73
+612949.53 793780.78
+612931.45 793816.55
+612901.83 793828.86
+612827.22 793833.09
+612801.83 793816.93
+612785.68 793793.86
+612783.76 793895.78
+612754.91 793866.93
+612739.53 793853.09
+612709.53 793881.16
+612573.76 794008.03
+612556.05 794033.49
+612550.29 794048.49
+612495.85 794107.08
+612434.31 794142.47
+612346.8 794183.01
+612308.72 794239.55
+612184.44 794296.03
+612181.72 794311.7
+612131.32 794343.71
+612089.77 794355.97
+612106.46 794420.99
+612109.11 794445.47
+612042.44 794612.37
+612120.89 794904.17
+612386.84 794937.71
+612397.3 794944.95
+612410.34 794953.98
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612489.17 794390.91
+Region  1
+  59
+604729.38 797111.07
+604484.23 796924.33
+604474.23 796916.71
+604291.77 796774.81
+604206.03 796702.41
+604189.56 796681.26
+604179.4 796664.75
+604172.42 796673.64
+604167.34 796684.44
+604150.19 796765.72
+604103.2 796986.68
+604100.96 796996.76
+604100.61 797014.87
+604116.79 797067.23
+604151.72 797135.82
+604141.24 797153.28
+604101.87 797233.29
+604137.68 797386.32
+604160.5 797460.38
+604165.61 797470.38
+604233.47 797533.99
+604280.24 797594.52
+604287.86 797609.34
+604293.63 797618.64
+604314.4 797632.76
+604314.01 797657.06
+604311.47 797690.98
+604319.68 797706.27
+604354.96 797761.55
+604390.24 797819.18
+604412.78 797856.99
+604441.78 797913.05
+604462.76 797950.48
+604487.06 797989.29
+604510.98 797969.69
+604522.74 797961.06
+604538.42 797954.01
+604584.67 797936.37
+604674.61 797900.21
+604815.28 797840.81
+604885.62 797804.87
+604994.59 797805.32
+605030.98 797784.12
+605098.2 797737.87
+605132.58 797729.83
+605164.74 797734.3
+605201.36 797748.14
+605244.23 797764.22
+605304.52 797785.21
+605367.04 797793.25
+605364.36 797748.14
+605349.62 797697.68
+605257.41 797574.66
+605220.79 797535.81
+605151.74 797454.32
+605012.66 797316.51
+604892.09 797233.25
+604818.01 797174.37
+604729.38 797111.07
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604605.94 797408.49
+Region  1
+  39
+605890.43 796943.85
+605239.41 796179.88
+605231.07 796169.79
+605166.16 796220.67
+605120.98 796265.84
+605078.44 796311.02
+605027.76 796374.82
+604971.18 796459.91
+604951.88 796478.33
+604867.02 796557.07
+604768.55 796639.73
+604699.25 796682.72
+604658.02 796761.23
+604609.11 796835.58
+604543.54 796886.67
+604474.23 796916.71
+604484.23 796924.33
+604729.38 797111.07
+604818.01 797174.37
+604892.09 797233.25
+605012.66 797316.51
+605151.74 797454.32
+605220.79 797535.81
+605257.41 797574.66
+605285.1 797513.93
+605314.16 797449.4
+605326.54 797396.69
+605332.58 797284.91
+605417.67 797320.79
+605447.51 797307.46
+605459.89 797330.6
+605429.09 797403.63
+605446.24 797435.7
+605457.67 797442.05
+605573.89 797282.05
+605625 797192.51
+605721.52 797094.08
+605836.78 796990.21
+605890.43 796943.85
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605211.08 796876.74
+Region  1
+  59
+613828.84 801483.22
+613777.73 801403.88
+613691.25 801275.75
+613669.61 801291.62
+613605.65 801319.27
+613547.43 801333.85
+613395.83 801381.3
+613342.45 801417.8
+613278.37 801474.52
+613182.48 801640.05
+613159.77 801684.54
+613137.07 801719.83
+613096.57 801788.75
+613056.98 801823.43
+612987.64 801844.29
+612971.99 801859.33
+612872 801908.46
+612862 801913.72
+612928.41 802072.6
+612935.07 802088.16
+612943.01 802109.11
+612948.09 802124.67
+612955.4 802140.21
+612964.29 802158.62
+612969.68 802174.5
+612980.8 802190.69
+612986.2 802204.99
+613077.63 802133.86
+613168.75 802095.77
+613183.36 802093.3
+613232.89 802088.22
+613317.34 802080.92
+613351.95 802079.02
+613396.72 802070.44
+613441.17 802051.71
+613465.93 802026.94
+613565.64 801932.58
+613655.61 802078.17
+613687.28 802157
+613709.17 802148.92
+613741.18 802144.54
+613764.59 802161.28
+613816.81 802195.98
+613847.47 802214.85
+613872.74 802231.35
+613913.84 802259.65
+613958.31 802204.4
+614010.19 802131.97
+614046.41 802080.22
+614136.62 801940.47
+614173.46 801884.39
+614172.36 801884.39
+614172.36 801885.49
+614100.33 801809.07
+614049.75 801752.44
+614005.77 801702.96
+613922.48 801607.04
+613866.4 801530.07
+613828.84 801483.22
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613552.13 801800.38
+Region  1
+  62
+614615.1 804517.23
+614611.61 804661.09
+614637.83 804649.14
+614678.99 804627.56
+614712.52 804615.61
+614763.97 804591.71
+614796.99 804575.9
+614846.78 804565.61
+614915.82 804564.94
+614962.46 804573.07
+614999.64 804583.36
+615052.08 804606.27
+615100.21 804641.45
+615146.85 804691.08
+615187.18 804761.65
+615209.42 804837.04
+615239.29 805011.98
+615267.18 804990.4
+615326.26 804932.31
+615316.97 804881.19
+615328.25 804855.3
+615387.17 804798.01
+615367.92 804752.54
+615345.01 804704.07
+615351.48 804687.31
+615337.54 804672.7
+615297.71 804648.14
+615298.38 804617.6
+615306.17 804579.61
+615317.62 804494.45
+615309.66 804432.71
+615303.68 804401.84
+615302.19 804362.14
+615295.55 804330.27
+615300.19 804274.33
+615368.46 804215.91
+615431 804143.84
+615442.75 804114.31
+615392.27 804113.04
+615304.64 804054.61
+615272.82 804048.62
+614746.55 803936.55
+614641.16 803921.78
+614629.22 803920.12
+614620.59 803918.46
+614117.87 803873.01
+614080.19 803904.72
+614048.32 803916.67
+614018.12 803925.3
+613999.53 803932.94
+613981.1 803955
+614025.42 804024.56
+614052.18 804069.33
+614075.54 804110.54
+614119.52 804137.55
+614155.37 804132.57
+614185.24 804127.92
+614233.04 804149.83
+614323.82 804207.4
+614489.29 804380.8
+614560.83 804456
+614615.1 804517.23
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 614811.93 804268.77
+Region  1
+  52
+611116.02 803411.38
+611009.44 803397.88
+610757.88 803346.52
+610715.79 803386.35
+610708.1 803420.62
+610703.94 803435.35
+610675.44 803556.4
+610605.56 803557.89
+610546.08 803578.8
+610473.2 803609.45
+610254.91 803702.81
+610267.16 803734.47
+610276.12 803759.26
+610283.43 803775.81
+610335.68 803882.58
+610375.27 803952.2
+610418.12 804001.48
+610482.78 804203.67
+610486.07 804216.22
+610526.63 804214.63
+610596.24 804201.31
+610638.62 804178.51
+610686.72 804168.36
+610800.59 804113.26
+610902.44 804064.5
+610927.75 804059.42
+610954.97 804057.51
+611064.41 804006.84
+611173.87 803966.3
+611237.76 803938.43
+611373.77 804323.04
+611387.27 804325.46
+611388.23 804278.19
+611391.61 804232.38
+611394.27 804191.63
+611394.75 804164.14
+611396.68 804136.17
+611395.23 804110.61
+611399.57 804075.41
+611529.79 803864.7
+611592.96 803889.77
+611575.6 803817.44
+611734.51 803916.05
+611802.02 803906.88
+611838.19 803870.23
+611861.82 803792.58
+611396.64 803355.97
+611342.52 803374.22
+611298.8 803391.57
+611244.3 803409.9
+611211.51 803419.1
+611116.02 803411.38
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611017.21 803763.33
+Region  1
+  30
+598372.94 790866.12
+598306.78 790893.36
+598247.85 790910.04
+598097.43 790855.56
+598076.88 790871.1
+598116.22 790988.13
+598046.31 791010.85
+598110.71 791205.9
+598280.46 791183.54
+598723.93 791084.55
+598786.2 791105.45
+598837.56 791109.6
+598837.56 791103.7
+598841.04 791099.14
+598764.59 791013.74
+598717.61 790959.52
+598700.37 790935.62
+598659.79 790892.25
+598639.85 790861.52
+598662.71 790810.72
+598683.03 790765
+598606.17 790751.65
+598571.88 790724.98
+598546.48 790699.58
+598520.25 790672.15
+598502.46 790657.14
+598491.9 790649.91
+598453.27 790698.53
+598399.06 790842.77
+598372.94 790866.12
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 598416.39 790980.17
+Region  1
+  125
+607090.66 800127.38
+607005.55 800057.4
+606968.21 800020.03
+606944.9 799985.23
+606910.52 799936.81
+606856.62 799839.42
+606799.89 799738.24
+606725.65 799593.04
+606691.61 799526.85
+606646.67 799446.82
+606627.37 799414.96
+606613.07 799389.56
+606605.77 799374.64
+606541 799394.36
+606485.26 799411.01
+606433.73 799426.85
+606392.9 799437.17
+606360.98 799443.26
+606341.3 799446.43
+606319.07 799443.57
+606304.15 799438.81
+606287.32 799481.04
+606274.59 799502.86
+606261.42 799528.71
+606245.05 799554.5
+606249.09 799572.45
+606254.47 799601.62
+606260.76 799626.75
+606371.38 799712.23
+606387.98 799732.42
+606405.03 799768.77
+606414 799814.09
+606419.38 799881.4
+606426.56 799964.42
+606421.09 800024.9
+606414.74 800052.84
+606391.24 800106.82
+606363.93 800177.31
+606351.87 800216.68
+606339.49 800248.17
+606324.25 800272.93
+606458.24 800380.9
+606520.48 800425.35
+606517.31 800444.4
+606505.24 800492.03
+606489.68 800546.99
+606480.79 800586.36
+606483.97 800596.52
+606466.82 800607.32
+606466.19 800621.92
+606459.2 800650.5
+606447.13 800682.89
+606435.7 800709.56
+606421.1 800738.14
+606430.27 800758.81
+606450.92 800750.24
+606453.8 800722.01
+606456.1 800705.88
+606468.2 800686.87
+606489.96 800687.06
+606536.31 800694.04
+606583.94 800698.49
+606597.67 800712.97
+606604.89 800835.65
+606641.51 800841.38
+606645.9 800930.53
+606617.99 800972.05
+606609.35 800980.69
+606596.1 800991.06
+606581.69 800998.55
+606534.45 801022.75
+606535.6 801037.15
+606537.05 801128.5
+606541.66 801238.53
+606573.34 801293.84
+606589.19 801343.65
+606604.17 801431.22
+606612.23 801477.31
+606623.47 801527.72
+606651.7 801623.35
+606660.34 801749.52
+606668.4 801797.91
+606689.14 801838.24
+606729.22 801892.81
+606787.85 801976.5
+606819.52 802022.83
+606828.98 802035.6
+606831.34 802205.33
+606832.89 802250.44
+606967.26 802248.04
+607000.49 802212.88
+607046.24 802170.98
+607056.57 802176.55
+607063.85 802179.88
+607070.82 802183.82
+607096.29 802200.8
+607153.31 802119.64
+607154.97 802014.89
+607159.23 801937.34
+607233.45 801606.83
+607260.87 801475.39
+607282.11 801351.61
+607324.69 801208.71
+607354.01 801142.52
+607400.34 801085.78
+607489.23 801038.5
+607663.7 800982.21
+607752.59 800943.44
+607813.11 800895.22
+607863.23 800836.59
+607919.96 800770.39
+607955.9 800732.57
+607927.99 800715.91
+607873.74 800681.32
+607837.23 800647.9
+607715.34 800561.19
+607641.2 800495.43
+607574.02 800432.84
+607506.26 800384.08
+607440.95 800320.92
+607369.62 800274.9
+607291.13 800233.29
+607223.99 800199.25
+607162.52 800167.1
+607090.66 800127.38
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606960.87 800777.78
+Region  1
+  41
+609060.72 800407.82
+609010.03 800456.56
+608961.77 800488.24
+608949.85 800509.94
+608933.28 800575.74
+608901.34 800638.37
+608886.72 800662.26
+608824.55 800726.85
+608748.03 800801.91
+608731.94 800886.23
+608731.94 800912.55
+608738.77 800937.9
+608752.05 800957.97
+608796.74 800988.53
+608837.37 801018.73
+608810.07 801042.12
+608828.49 801063.46
+608855.16 801094.58
+608907.23 801148.55
+608925.64 801132.68
+608953.58 801106.64
+608935.17 801064.1
+608952.95 801059.02
+608984.98 801056.18
+609016.45 801068.54
+609065.27 801098.16
+609082.93 801083.25
+609074.23 801055.84
+609069.74 801005.82
+609109.89 800901.22
+609143.27 800822.63
+609142.8 800716.42
+609206 800588.07
+609251.3 800512.74
+609313.13 800447.28
+609272.98 800382.23
+609195.97 800274.02
+609072.4 800120.73
+609145.03 800215.29
+609086.07 800336.17
+609060.72 800407.82
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609015.77 800713.88
+Region  1
+  45
+615119.27 798565.21
+614982.73 798259.75
+614601.96 798190.07
+614119.96 798258.97
+614077.67 798358.91
+614052.7 798437.27
+614051.54 798516.36
+614061.11 798582.15
+614107.38 798689.27
+614144.87 798735.7
+614021.2 798750.99
+614011.2 798754.79
+614425.83 799219.17
+614434.76 799229.17
+614482.29 799275.33
+614534.77 799326.3
+614583.67 799354.24
+614642.09 799354.24
+614707.04 799306.85
+614720.52 799280.3
+614723.03 799172.24
+614729.52 799142.75
+614759.68 799098.77
+614788.16 799076.99
+614871.92 799051.86
+614926.79 799037.62
+614975.46 799026
+615046.58 799008.86
+615109.45 798993.55
+615222.48 798966.88
+615280.9 798946.56
+615316.47 798907.13
+615366.98 798788.8
+615401.56 798771.24
+615409.81 798742.67
+615414.89 798726.79
+615422.51 798703.93
+615418.71 798684.89
+615387.59 798655.67
+615367.27 798632.81
+615352.02 798618.84
+615339.96 798562.32
+615319.95 798473.77
+615307.25 798479.48
+615119.27 798565.21
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 614658.47 798696.42
+Region  1
+  98
+608485.65 793140.1
+608524.39 793134.1
+608623.13 793088.7
+608670.76 793100.13
+608821.25 793093.46
+608910.78 793131.25
+608953.74 793149
+608995.65 793163.6
+609051.49 793141.13
+609107.16 793048.72
+609168.81 792948.9
+609183.73 792875.22
+609133.88 792693.65
+609132.61 792641.89
+609143.4 792564.45
+609156.73 792476.21
+609177.05 792422.87
+609258.99 792314.26
+609346.45 792207.1
+609411.09 792120.89
+609450.46 792057.7
+609360.6 792031.35
+609317.1 792080.56
+609265.34 792113.9
+609224.2 792130.26
+609169.27 792139.46
+609105.13 792135.65
+609094.15 792134.09
+609037.44 792121.1
+609048.87 792076.65
+609056.81 792065.22
+609071.73 792049.38
+609046.65 792032.86
+609030.77 792021.75
+609012.36 792015.4
+608973.94 792015.41
+608908.53 792010.33
+608877.73 792010.01
+608833.92 792023.66
+608789.47 791970.67
+608736.76 791937.33
+608683.11 791923.05
+608706.28 791870.34
+608511.34 791781.74
+608497.16 791817.53
+608482.91 791832.07
+608456.87 791850.17
+608427.98 791859.06
+608366.7 791857.48
+608320.34 791864.14
+608299.38 791888.28
+608271.39 791975.44
+608273.3 792011.95
+608292.66 792014.82
+608297.11 792037.36
+608265.99 792092.29
+608244.4 792113.88
+608232.97 792128.48
+608205.03 792173.25
+608202.18 792184.68
+608204.4 792195.16
+608231.7 792213.89
+608238.17 792280.03
+608230.87 792309.24
+608216.9 792335.6
+608182.61 792354.33
+608165.15 792380.68
+608148.95 792415.61
+608099.74 792475.95
+608059.1 792516.59
+608060.68 792521.98
+608071.16 792528.34
+608085.13 792564.85
+608103.92 792633.38
+608072.35 792677.66
+608029.49 792735.12
+607978.69 792781.16
+607935.51 792819.26
+607876.65 792872.58
+607719.1 793019.46
+607755.61 793046.45
+607746.72 793078.52
+607728.73 793101.37
+607764.6 793138.84
+607775.34 793113.07
+608124.01 793253.49
+608147.19 793264.92
+608179.57 793161.73
+608222.76 793122.67
+608267.89 793092.28
+608296.1 793064.88
+608318 793045.83
+608311.02 793091.87
+608300.54 793132.82
+608369.76 793151.24
+608439.61 793165.82
+608445.01 793137.56
+608485.65 793140.1
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608591.72 792577.33
+Region  1
+  66
+608271.39 791975.44
+607594.94 791924.01
+607540.97 791922.43
+607488.58 791916.73
+607456.51 791930.7
+607435.24 791894.5
+607401.91 791871.35
+607339.68 791856.74
+607253.63 791872.3
+607157.11 791869.46
+607064.4 791846.6
+607078.78 791940.11
+607089.48 792036.16
+607105.99 792119.35
+607140.28 792224.32
+607151.39 792293.05
+607170.1 792410.42
+607172.02 792456.62
+607183.43 792515.49
+607182.6 792666.54
+607217.53 792672.58
+607263.56 792693.84
+607288.64 792708.12
+607321.66 792724.95
+607361.35 792731.94
+607409.29 792706.22
+607446.44 792707.17
+607517.24 792710.35
+607525.18 792654.46
+607528.42 792592.76
+607534.86 792538.47
+607600.9 792511.17
+607613.6 792502.28
+607653.28 792524.18
+607734.25 792494.02
+607787.9 792454.65
+607817.43 792448.93
+607826.98 792414.8
+607846.98 792402.26
+607913.02 792442.27
+607941.62 792419.11
+607953.05 792419.11
+607987.34 792426.73
+608014.96 792443.88
+608034.97 792472.45
+608039.73 792496.27
+608049.57 792511.51
+608059.1 792516.59
+608099.74 792475.95
+608148.95 792415.61
+608165.15 792380.68
+608182.61 792354.33
+608216.9 792335.6
+608230.87 792309.24
+608238.17 792280.03
+608231.7 792213.89
+608204.4 792195.16
+608202.18 792184.68
+608205.03 792173.25
+608232.97 792128.48
+608244.4 792113.88
+608265.99 792092.29
+608297.11 792037.36
+608292.66 792014.82
+608273.3 792011.95
+608271.39 791975.44
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607613.83 792231.96
+Region  1
+  51
+611575.67 809277.92
+611601.06 809292.42
+611626.45 809319.62
+611648.21 809345.01
+611681.76 809343.2
+611708.05 809343.2
+611739.79 809342.29
+611765.18 809339.57
+611801.44 809339.57
+611872.63 809335.61
+611923.41 809333.79
+611976 809323.82
+611979.62 809302.96
+612024.92 808792.02
+612017.32 808788.23
+611958.32 808804.74
+611850.87 808809.76
+611795.56 808809.76
+611774.71 808812.48
+611742.07 808823.36
+611718.16 808831.53
+611703.4 808839.61
+611681.89 808844.05
+611627.44 808842.18
+611621.86 808779.39
+611614 808690.99
+611520.83 808685.54
+611516.81 808705.66
+611513.43 808767.58
+611509.95 808796.16
+611504.51 808838.78
+611502.7 808883.21
+611499.07 808939.42
+611419.28 808864.16
+611378.07 808871.39
+611335.03 808870.78
+611302.75 808876.49
+611281.25 808894.21
+611255.3 808901.18
+611223.03 808911.95
+611198.94 808935.61
+611256.06 809002.71
+611269.66 809039.89
+611283.26 809107.89
+611302.3 809158.66
+611321.34 809176.8
+611392.07 809204
+611433.77 809220.32
+611484.55 809238.46
+611538.05 809262.03
+611575.67 809277.92
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611667.36 809046.53
+Region  1
+  95
+607773 810132.63
+607782 810173.47
+607777.5 810231.95
+607737.36 810334.4
+607709.67 810396.7
+607687.94 810465.2
+607671.87 810507.44
+607670.77 810519.45
+607727.96 810538.71
+607734.3 810543.77
+607760.63 810583.27
+607774.28 810613.11
+607810.35 810641.79
+607991.75 810779.17
+607969.6 810654.57
+608119.12 810619.27
+608132.62 810627.92
+608246.14 810536.54
+608289.75 810579.46
+608321.59 810563.54
+608365.2 810592.61
+608385.28 810645.22
+608451.48 810539.01
+608464.89 810522.7
+608561.8 810603
+608578.41 810641.76
+608599.87 810659.76
+608631.71 810681.22
+608666.32 810700.6
+608704.22 810717.29
+608714.22 810710.56
+608775.7 810669.18
+608811.12 810635.63
+608846.53 810604.62
+608868.03 810584.37
+608883.84 810564.75
+608892.68 810540.07
+608879.87 810511.28
+608868.1 810481.51
+608854.95 810442.06
+608841.8 810418.52
+608830.03 810406.75
+608826.07 810394.61
+608827.96 810380.69
+608842.74 810330.33
+608889.03 810257.8
+608862.78 810243.29
+608846.2 810230.86
+608824.78 810210.13
+608806.13 810175.6
+608781.63 810128.44
+608764.76 810088.91
+608746.84 810044.64
+608733.66 810013.02
+608712.58 809983.5
+608688.34 809965.06
+608667.78 809935.54
+608653.03 809906.56
+608634.05 809871.77
+608614.02 809840.68
+608584.51 809813.27
+608551.39 809796.92
+608519.68 809791.66
+608487.45 809789.99
+608458.28 809796.68
+608427.71 809711.83
+608391.35 809677.67
+608366.58 809658.69
+608339.7 809638.14
+608319.15 809617.06
+608302.81 809596.5
+608289.63 809583.85
+608270.13 809562.24
+608235.87 809525.35
+608203.72 809490.04
+608156.28 809436.81
+608049.29 809507.43
+607999.8 809537.81
+607959.21 809565.02
+607936.37 809588.56
+607914.91 809613.48
+607890.68 809652.93
+607874.76 809650.86
+607817.99 809637.01
+607782.69 809681.32
+607763.86 809709.98
+607731.12 809738.41
+607683.36 809778.56
+607652.9 809802.1
+607582.3 809848.48
+607636.98 809925.31
+607683.71 809994.19
+607723.16 810051.64
+607746.7 810086.25
+607773 810132.63
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608226.42 810147.25
+Region  1
+  40
+613749.53 803345.94
+613716.42 803260.38
+613684.12 803138.48
+613672.54 803098.52
+613640.88 803009.83
+613644.38 802916.45
+613442.67 802872.15
+613420.09 802890.1
+613389.98 802913.84
+613366.82 802928.9
+613337.29 802950.32
+613288.08 802987.38
+613200.92 803049.59
+613134.91 802929.19
+613059.06 802896.19
+612961.79 803397.67
+612969.89 803452.68
+612919.17 803476.8
+613055.01 803551.62
+613146.94 803598.16
+613273.73 803659.74
+613362.55 803706.24
+613418.32 803733.46
+613484.54 803763.12
+613543.62 803786.69
+613608.18 803807.06
+613679.88 803824.32
+613760.87 803838.26
+613834.23 803846.96
+613945.09 803856.92
+614118.36 803873.52
+614120.19 803807.62
+614122.18 803746.88
+614138.53 803729.13
+614159.93 803708.19
+614172.74 803695.63
+614180.47 803688.62
+614190.86 803678.22
+613745.06 803370.02
+613749.53 803345.94
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613495.14 803405.54
+Region  1
+  89
+602285.18 797543.89
+602290.89 797519.12
+602337.25 797461.97
+602362.02 797440.8
+602401.38 797411.38
+602418.31 797396.78
+602428.26 797385.35
+602454.93 797367.99
+602472.92 797375.61
+602478 797397.41
+602482.87 797434.45
+602520.12 797347.87
+602545.93 797312.81
+602584.45 797260.32
+602602.23 797239.58
+602598.42 797215.22
+602584.88 797175.22
+602563.5 797143.26
+602513.76 797118.71
+602458.66 797119.3
+602406.01 797123.54
+602374.59 797092.97
+602342.75 797058.58
+602316.85 797028.86
+602300.71 797009.33
+602287.97 796993.62
+602270.14 796971.96
+602224.88 797010.69
+602192.62 797037.19
+602147.68 797074.64
+602101.01 797111.51
+602064.97 797142.38
+602018.31 797180.97
+601983.75 797208.62
+601948.61 797238
+601908.2 797268.02
+601882.94 797281.21
+601854.14 797293.3
+601793.08 797315.19
+601886.97 797507.59
+601864.51 797524.88
+601844.65 797536.68
+601821.03 797550.51
+601795.68 797553.97
+601772.84 797560.37
+601757.83 797588.98
+601747.6 797625.54
+601755.24 797705.69
+601777.29 797733.79
+601829.59 797776.59
+601844.08 797802.32
+601847.97 797866.73
+601847.54 797885.32
+601848.4 797905.2
+601870.45 797890.5
+601878.66 797884.02
+601886.01 797877.97
+601894.22 797869.75
+601912.38 797847.27
+601901.14 797812.26
+601889.68 797786.53
+601866.77 797744.17
+601843.43 797701.37
+601818.35 797655.98
+601829.16 797642.58
+601840.67 797640.05
+601856.83 797641.28
+601873.25 797651.66
+601906.97 797695.75
+601931.61 797721.69
+601941.42 797725.4
+601954.96 797722.55
+602047.9 797680.19
+602061.3 797779.62
+602077.51 797817.88
+602102.58 797869.75
+602111.43 797888.12
+602149.04 797897.2
+602220.8 797920.98
+602255.82 797934.81
+602294.29 797945.18
+602278.73 797909.74
+602252.36 797853.54
+602235.93 797818.09
+602220.37 797785.24
+602229.3 797768.64
+602240.09 797733.71
+602262.95 797644.18
+602285.18 797543.89
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 602150.63 797425.48
+Region  1
+  82
+604203.99 789091.23
+604541.81 789001.33
+604566.57 789049.27
+604711.04 789220.76
+604789.14 789148.97
+604863.12 789078.49
+604937.09 789011.15
+604951.06 788988.61
+604996.78 788842.87
+605134.9 788781.59
+605261.58 788700.6
+605324.13 788669.14
+605338.42 788658.03
+605382.55 788588.5
+605400.97 788545.95
+605413.99 788521.52
+605427.32 788493.9
+605446.69 788452.62
+605468.28 788402.14
+605518.12 788409.79
+605569.24 788419.31
+605617.18 788430.11
+605629.25 788407.25
+605648.62 788370.41
+605671.79 788328.5
+605733.71 788213.23
+605774.98 788133.26
+605721.64 788130.4
+605704.81 788122.78
+605689.89 788111.67
+605671.48 788083.69
+605611.16 788053.53
+605549.24 788026.54
+605491.78 788097.98
+605456.54 788143.1
+605412.41 788198.99
+605381.7 788245.28
+605372.72 788288.8
+605387.01 788325.93
+605215.24 788344.67
+605171.1 788404.36
+605120.62 788452.63
+605065.38 788492.95
+604990.13 788539.3
+604950.76 788562.16
+604905.23 788588.27
+604864.72 788615.18
+604834.24 788617.69
+604730.1 788624.36
+604691.36 788584.99
+604648.82 788502.43
+604609.13 788425.28
+604597.71 788403.06
+604581.92 788374.88
+604554.61 788327.57
+604490.16 788350.43
+604457.77 788329.49
+604417.77 788323.14
+604358.4 788339.65
+604325.06 788346
+604293.08 788362.85
+604269.04 788395.76
+604258.7 788406.05
+604248.22 788440.34
+604073.27 788439.43
+604007.55 788501.02
+603983.74 788532.77
+603974.85 788553.09
+604023.74 788574.1
+604015.49 788614.1
+604006.6 788631.25
+603993.26 788645.54
+603969.45 788653.47
+603924.36 788661.11
+603932.3 788666.83
+603934.84 788673.18
+603940.55 788684.29
+603971.03 788692.86
+604007.76 788705.87
+603899.51 789107.4
+603926.18 789106.77
+604203.99 789091.23
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604696.44 788677.63
+Region  1
+  82
+610994.52 806714.04
+610976.2 806812.55
+610950.3 806882.34
+610929.27 806921.15
+610894.22 807002.12
+610877.72 807050.03
+610839.86 807148.75
+610823.5 807227.84
+610810.31 807303.13
+610800.91 807381.59
+610814.91 807443.58
+610859.94 807545.39
+610916.34 807540.67
+611036.58 807590.85
+611065.18 807631.35
+611218.84 807775.69
+611369.4 807908.36
+611416.82 807935.44
+611461.04 807959.29
+611513.14 807977.82
+611557.48 807996.78
+611606.23 808006.87
+611642.16 808016.17
+611679.92 808024.12
+611737.06 808006.24
+611777.31 807985.86
+611874.85 807945.77
+611875.76 807917.66
+611877.34 807713.25
+611912.25 807564.81
+611984.19 807455.57
+612016.43 807447.81
+612068.39 807359.6
+612053.47 807348.95
+612099.83 807227.44
+611980.2 807136.56
+611862.96 807131.23
+611944.5 806787.59
+611998.15 806679.13
+612002.86 806670.67
+612007.66 806657.35
+612041.1 806592.44
+612069.47 806517.19
+612067.08 806483.89
+612053.58 806407.09
+612045.5 806350.43
+612050.29 806274.87
+612071.08 806149.53
+612101.72 806118.35
+612156.61 806079.99
+612265.25 806019.2
+612324.09 805983.12
+612384.96 805941.14
+612399.88 805918.14
+612418.53 805883.5
+612427.06 805845.67
+612371.64 805841.94
+612339.13 805831.28
+612216.57 805760.94
+612099.59 805690.31
+611979.71 805614.81
+611795.33 805517.3
+611785.21 805528.49
+611782.54 805555.66
+611755.1 805617.74
+611751.37 805653.97
+611692.23 805663.56
+611642.68 805683.8
+611620.84 805709.91
+611609.94 805752.26
+611601.13 806134.52
+611521.21 806130.79
+611426.38 806177.68
+611301.18 806074.85
+611073.69 806276.23
+611049.72 806323.12
+611033.2 806369.47
+611020.62 806429.95
+611016.3 806512.83
+611008.83 806584.13
+611001.77 806649.59
+610994.52 806714.04
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611553.42 806838.7
+Region  1
+  102
+612097.89 798438.95
+612167.2 798383.78
+612259.98 798313.35
+612347.52 798244.5
+612394.02 798151.94
+612432.56 798074.2
+612486.36 798034.99
+612544.26 798001.71
+612632.94 797964.54
+612663.04 797958.62
+612744.19 797961.35
+612740.55 797921.68
+612738.27 797907.55
+612735.31 797892.8
+612706.13 797894.17
+612676.04 797895.54
+612624.06 797898.27
+612612.67 797802.98
+612604.46 797734.13
+612602.18 797715.89
+612597.16 797680.33
+612593.97 797653.43
+612572.09 797653.43
+612569.35 797616.95
+612563.42 797577.74
+612540.17 797579.11
+612489.1 797587.32
+612459.47 797574.55
+612438.95 797568.62
+612403.39 797543.55
+612509.85 797394.67
+612404.75 797334.37
+612501.86 797166.47
+612502.35 797165.63
+612502.83 797164.79
+612549.01 797084.94
+612576.29 797037.77
+612575.72 797037.73
+612458.25 797060.59
+612418.88 797058.05
+612364.9 797033.28
+612267.11 796987.56
+612153.95 796980.3
+612131.73 797002.91
+612017.03 796992.71
+611965.5 796980.78
+611885.59 796945.74
+611868.61 796937.4
+611825.87 796913.34
+611730.94 796934.21
+611670.83 796997.5
+611643.01 797067.76
+611633.55 797157.64
+611638.65 797248.78
+611666.53 797339.3
+611703.51 797451.9
+611731.33 797568.17
+611734.97 797597.8
+611747.51 797640.44
+611754.38 797695.33
+611618.55 797616.43
+611615.09 797617.44
+611615.08 797617.44
+611279.6 797714.87
+611087.59 797913.13
+611077.59 797916.47
+611054.7 797924.12
+611060.01 797931.73
+611105.13 797998.74
+611135.88 798000.34
+611169.51 798000.32
+611212.47 798001.71
+611200.16 798091.07
+611194.9 798144.41
+611251.89 798145.32
+611389.82 798144.64
+611580.85 798142.82
+611580.4 798459.32
+611480.55 798485.31
+611367.48 798514.49
+611346.5 798520.41
+611327.81 798514.03
+611304.1 798504.91
+611282.44 798496.02
+611260.56 798491.46
+611232.75 798492.37
+611205.85 798502.86
+611161.62 798533.86
+611114.66 798563.5
+611092.77 798638.76
+611054.01 798770.98
+611392.55 798716.02
+611495.18 798748.59
+611782.83 798852.38
+611829.34 798868.79
+611915.51 798900.25
+611928.05 798854.92
+611955.86 798755.53
+611972.05 798709.26
+612004.88 798629.47
+612075.32 798469.21
+612097.89 798438.95
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611903.78 797880.65
+Region  1
+  61
+604423.24 798855.26
+604631.29 798767.85
+604679.01 798727.5
+604727.61 798671.97
+604766 798603.63
+604850.39 798403.79
+604594.35 798440
+604542.41 798446.59
+604519.4 798441.87
+604464.14 798388.96
+604451.6 798387.39
+604485.49 798254.69
+604510.97 798178.66
+604520.19 798137.69
+604515.1 798078.5
+604496.08 798035.94
+604487.06 797989.29
+604462.76 797950.48
+604441.78 797913.05
+604412.78 797856.99
+604390.24 797819.18
+604354.96 797761.55
+604319.68 797706.27
+604311.47 797690.98
+604314.01 797657.06
+604314.4 797632.76
+604293.63 797618.64
+604287.86 797609.34
+604260.7 797630.01
+604243.84 797644.12
+604238.35 797649.22
+604229.34 797657.06
+604222.29 797663.33
+604216.21 797669.03
+604197.39 797686.28
+604187.18 797696.08
+604174.24 797707.84
+604159.34 797723.13
+604191.08 797730.58
+604244.8 797740.38
+604204.42 797779.97
+604153.85 797826.23
+604135.1 797842.04
+604114.51 797864.04
+604101.81 797876.11
+604077.78 797903.14
+604073.02 797939.34
+604053.05 797978.38
+604116.1 798006.61
+604092.29 798048.2
+604119.45 798122.78
+604306.78 798582.97
+604128.16 798658.36
+604085.93 798775.84
+604150.64 798931.22
+604221.45 799108.41
+604298.09 799081.15
+604307.02 799053.27
+604369.43 798914.45
+604393.11 798878.94
+604423.24 798855.26
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604367.49 798397.82
+Region  1
+  59
+611097.39 809452.46
+611097.39 809486.01
+611076.53 809546.76
+611039.36 809635.62
+611046.61 809665.54
+611144.99 810017.79
+611184.9 810041.16
+611214.66 810050.01
+611234.28 810045.57
+611248.82 810032.91
+611264.62 810004.44
+611274.07 809958.25
+611270.84 809891.83
+611266.37 809850.08
+611272.01 809793.78
+611277.05 809775.43
+611350.81 809657.86
+611588.37 809973.39
+611619.2 809909.01
+611676.58 809882.79
+611718.48 809874.11
+611800.09 809851.45
+611833.64 809841.47
+611869 809841.47
+611740.24 809623.81
+611740.24 809570.32
+611678.13 809440.22
+611682.67 809413.92
+611765.18 809339.57
+611739.79 809342.29
+611708.05 809343.2
+611681.76 809343.2
+611648.21 809345.01
+611626.45 809319.62
+611601.06 809292.42
+611575.67 809277.92
+611538.05 809262.03
+611484.55 809238.46
+611433.77 809220.32
+611392.07 809204
+611321.34 809176.8
+611302.3 809158.66
+611283.26 809107.89
+611269.66 809039.89
+611256.06 809002.71
+611198.94 808935.61
+611189.61 808914.71
+611183.27 808916.86
+611168.73 808931.41
+611144.72 808964.32
+611128.29 808986.48
+611107.41 808989.02
+611064.74 809000.9
+611040.26 809076.15
+611002.18 809179.52
+611035.96 809208.72
+611045.25 809261.56
+611063.29 809330.17
+611097.39 809452.46
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611366.04 809516.79
+Region  1
+  35
+612627.29 795734.74
+612476.97 795141.57
+612476.96 795141.53
+612476.94 795141.43
+612476.85 795141.09
+612437.9 794987.39
+612433.5 794970.02
+612423.28 794962.94
+612423.28 794962.95
+612410.34 794953.98
+612397.3 794944.95
+612386.84 794937.71
+612120.89 794904.17
+611959.77 794883.85
+611692.15 794859.51
+611683.12 794858.69
+611447.42 794837.26
+611447.21 794837.24
+611321.14 794825.77
+611229.67 794817.46
+611227.96 794817.3
+611209.69 794815.64
+611000.71 794871.73
+610957.01 794883.46
+610964.47 794905.01
+611356.52 796376.94
+611762.54 796273.77
+612842.35 795983.71
+612749.68 795876.43
+612749.62 795876.36
+612749.56 795876.29
+612729.07 795852.56
+612641.71 795751.43
+612638.47 795747.68
+612627.29 795734.74
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611823.95 795542
+Region  1
+  113
+605706.05 795244.08
+605671.11 795215.3
+605644.39 795169.06
+605597.12 795190.64
+605562.18 795205.03
+605528.27 795138.23
+605501.55 795100.21
+605482.03 795075.55
+605440.42 795029.82
+605400.34 794990.77
+605359.24 794956.86
+605310.94 794918.84
+605242.1 794886.98
+605223.6 794877.74
+605171.19 794859.24
+605104.4 794842.8
+605060.21 794836.63
+605065.35 794763.67
+605036.58 794758.53
+605019.11 794746.2
+605001.64 794733.87
+604982.12 794718.46
+604969.78 794707.15
+604950.26 794694.82
+604917.38 794678.38
+604875.25 794665.02
+604851.15 794652.38
+604733.5 794745.28
+604596 794852.56
+604604.89 794904.64
+604626.96 794967.64
+604645.31 795017.95
+604631.02 795042.4
+604712.62 795091.01
+604788.5 795112.92
+604861.53 795115.46
+604840.89 795157.37
+604784.38 795181.82
+604691.67 795201.85
+604598.32 795209.79
+604620.23 795219.95
+604633.56 795225.35
+604695.12 795263.28
+604756.53 795266.79
+604876.94 795294.21
+604980.01 795345.08
+605095.6 795432.15
+605223.67 795556.7
+605368.17 795679.73
+605436.14 795767
+605476.93 795816.55
+605576.92 795949
+605579.99 795953.83
+605587.01 795964.79
+605658.77 796065.05
+605681.63 796085.93
+605734.65 796118.73
+605983.59 796272.52
+606021.83 796394.35
+606157.4 796611.8
+606193.2 796661.87
+606222.97 796700.49
+606239.19 796729.01
+606253.8 796703.58
+606269.8 796673.28
+606300.79 796599.14
+606320.48 796530.56
+606347.15 796473.4
+606392.23 796414.98
+606422.08 796399.1
+606456.36 796450.52
+606505.26 796501.33
+606570.66 796533.71
+606657.34 796544.18
+606717.98 796537.83
+606740.2 796434.69
+606794.18 796198.8
+606725.28 796169.59
+606663.05 796137.84
+606576.37 796083.86
+606540.49 796028.94
+606492.87 795951.78
+606462.71 795893.97
+606484.02 795779.57
+606500.45 795702.35
+606544.3 795608.74
+606538.27 795567.15
+606502.07 795501.76
+606457.94 795426.54
+606382.05 795309.34
+606316.02 795209.95
+606263.63 795140.74
+606243.23 795068.72
+606231.81 794997.83
+606226.72 794942.76
+606121.73 794977.41
+605939.84 795042.15
+605945.49 795046.77
+605967.07 795075.55
+605981.45 795110.49
+605975.29 795137.2
+605968.09 795161.87
+605950.62 795195.78
+605929.04 795222.5
+605920.82 795227.64
+605889.99 795247.16
+605876.64 795254.35
+605845.81 795264.63
+605830.39 795266.68
+605802.65 795268.74
+605772.84 795267.71
+605745.1 795258.46
+605706.05 795244.08
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605804.48 795614.98
+Region  1
+  82
+605200.01 806589.11
+605248.91 806380.45
+605305.19 806157.39
+605305.19 806141.28
+605296.31 806111.18
+605309.02 806066.24
+605324.29 805999.25
+605352.27 805883.93
+605352.27 805850.86
+605329.89 805809.7
+605285.72 805776.67
+605261.98 805735.12
+605261.98 805692.72
+605278.93 805655.42
+605329.81 805619.8
+605368.81 805574.86
+605383.65 805537.98
+605381.11 805494.73
+605303.1 805293.77
+605279.36 805263.25
+605249.68 805247.13
+605214.6 805241.63
+605136.91 805240.35
+605090.55 805257.51
+605011.47 805291.08
+604946.55 805323.03
+604901.61 805344.23
+604906.87 805362.5
+604942.06 805461.3
+604970.62 805527.08
+604978.91 805573.89
+604951.09 805599.21
+604922 805618.84
+604891.49 805658.95
+604867.39 805691.32
+604844.66 805760.18
+604823.31 805834.55
+604823.31 805861.41
+604835.03 805920.66
+604854.3 805993.63
+604837.08 806036.33
+604787.5 806099.69
+604661.82 806260.45
+604610.52 806324.8
+604580.91 806364.74
+604554.74 806368.87
+604540.96 806347.52
+604521.34 806304.52
+604488.97 806267.34
+604460.05 806247.37
+604430.44 806234.97
+604402.2 806229.46
+604375 806227.7
+604348.14 806239.41
+604298.56 806230.45
+604247.6 806218.06
+604255.17 806271.77
+604246.22 806376.45
+604251.04 806470.1
+604252.84 806553.62
+604256.89 806639.15
+604340.22 806628.13
+604407.02 806632.95
+604457.98 806628.13
+604508.94 806608.16
+604620.5 806484.89
+604632.89 806568.22
+604624.63 806688.73
+604643.22 806738.31
+604753.76 806930.76
+604758.92 806942.79
+604787.16 806930.4
+604814.02 806914.56
+604840.87 806902.16
+604940.68 806880.36
+605089.47 806843.63
+605079.15 806928.33
+605073.64 806967.59
+605151.8 806974.81
+605161.44 806882.53
+605164.2 806844.55
+605200.01 806589.11
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604937.34 806176.05
+Region  1
+  46
+603582.75 794507.53
+603622.95 794530.87
+603674.06 794543.54
+603719.78 794548.62
+603784.68 794555.67
+603845.51 794568.3
+603862.02 794569.57
+603905.2 794581
+603936.32 794597.51
+603964.89 794609.58
+603990.93 794541.63
+604032.84 794445.11
+604054.24 794368.98
+604054.68 794292.16
+604041.98 794209.61
+604064.84 794181
+603838.15 794046.38
+603797.53 793742.87
+603720.67 793750.43
+603692.74 793821.73
+603644.56 793873.15
+603621.71 793885.77
+603606.48 793898.51
+603590.51 793930.96
+603571.11 793956.84
+603527.78 794022.29
+603499.45 794070.61
+603464.46 794132.68
+603391.14 794174.76
+603354.48 794185.59
+603323.03 794180.84
+603311.37 794190.42
+603302.62 794199.17
+603292.75 794210
+603277.56 794225.82
+603261.11 794244.81
+603261.29 794248.73
+603262.92 794272.84
+603289.38 794275.38
+603322.19 794286.81
+603353.54 794301.15
+603387.73 794330.27
+603433.32 794373.96
+603477.02 794423.97
+603526.22 794471.61
+603582.75 794507.53
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603720.07 794237.54
+Region  1
+  96
+602951.16 798884.28
+602979.1 798908.73
+603001.17 798972.1
+603041.69 799088.05
+603054.22 799121.36
+603063.81 799129.62
+603068.87 799135.21
+603080.59 799147.47
+603106.7 799175.71
+603131.91 799207.55
+603185.72 799274.14
+603246.98 799272.01
+603298.4 799276.81
+603365.35 799257.35
+603411.72 799248.46
+603432.67 799252.59
+603462.84 799269.74
+603503.64 799311.51
+603545.24 799359.77
+603598.75 799400.56
+603646.38 799433.59
+603707.35 799475.18
+603704.17 799519
+603722.27 799512.02
+603774.98 799489.79
+603847.39 799462.16
+603890.57 799440.57
+603919.94 799404.51
+603936.77 799341.32
+603941.22 799287.65
+603947.41 799224.9
+603968.68 799176.96
+603992.98 799141.27
+604019.65 799104.12
+604058.87 799037.28
+604069.82 798845.94
+604078.3 798817.12
+604085.93 798775.84
+604128.16 798658.36
+604306.78 798582.97
+604119.45 798122.78
+604092.29 798048.2
+604116.1 798006.61
+604053.05 797978.38
+604024.76 798024.43
+603977.13 798070.47
+603943.48 798040.63
+603868.23 798024.12
+603764.41 798044.75
+603737.75 798061.26
+603714.57 798086.03
+603706 798096.51
+603699.97 798102.54
+603695.84 798106.35
+603691.08 798111.43
+603685.04 798118.11
+603666.05 798136.72
+603607.94 798326.93
+603588.89 798361.84
+603539.67 798365.34
+603512.05 798378.99
+603488.55 798405.35
+603362.8 798364.38
+603133.06 798213.04
+602969.83 797987.91
+602818.68 797721.81
+602803.44 797732.38
+602752 797779.05
+602713.89 797813.35
+602684.85 797838.27
+602511.84 797994.81
+602501.36 798004.97
+602487.71 798017.67
+602465.8 798035.77
+602441.67 798011.32
+602441.67 798044.66
+602444.21 798266.28
+602443.58 798310.42
+602445.48 798338.04
+602484.21 798399.97
+602516.6 798466.64
+602557.24 798487.9
+602586.14 798507.59
+602657.59 798543.79
+602766.68 798599.32
+602827.47 798613.26
+602897.65 798631.04
+602877.96 798676.13
+602839.06 798750.94
+602834.62 798772.53
+602801.28 798810.95
+602753.01 798872.87
+602827.15 798869.43
+602860.34 798867.13
+602927.02 798872.21
+602951.16 798884.28
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603400.59 798612.54
+Region  1
+  488
+617923.15 808064.91
+617999.3 808047.86
+618078 808048.02
+618103.46 808051.34
+618249.24 808049.91
+618255.55 808051.97
+618344.54 808097.13
+618379.3 808119.04
+618444.82 808076.1
+618466.3 808050.43
+618486.44 808010.58
+618506.04 807955.41
+618506.37 807903.53
+618501.3 807810
+618505.95 807785.42
+618494.56 807731.47
+618494.9 807652.12
+618501.43 807571.43
+618513.28 807520.19
+618563.11 807462.45
+618529.73 807330.1
+618534.81 807242.47
+618518.3 807255.17
+618463.69 807142.14
+618424.32 807093.88
+618419.24 807017.68
+618397.65 806963.07
+618397.65 806861.47
+618501.79 806799.24
+618548.78 806792.89
+618560.21 806723.04
+618623.71 806687.48
+618660.54 806726.85
+618691.4 806707.61
+618585.75 806490.34
+618523.38 806402.88
+618505.6 806454.95
+618541.16 806518.45
+618337.96 806639.1
+618177.94 806551.47
+618208.42 806477.81
+618349.39 806547.66
+618713.88 806176.82
+618750.71 806278.42
+618744.36 806347
+618688.48 806463.84
+618642.76 806458.76
+618586.09 806489.76
+618691.1 806705.43
+618779.92 806888.14
+618796.43 806979.58
+618781.19 807071.02
+618749.44 807142.14
+618694.83 807211.99
+618623.71 807267.87
+618531.53 807329.11
+618604.95 807454.48
+618772.74 807451.6
+618886.29 807456.66
+618934.11 807461.75
+618990.25 807451.84
+619015.04 807443.21
+619099.06 807431.4
+619160.82 807413.91
+619191.26 807398.7
+619205.2 807396.49
+619233.87 807364.31
+619253.8 807311.85
+619253.69 807289.36
+619238.31 807238.73
+619199.57 807190.69
+619173.12 807143.21
+619167.81 807128.16
+619098.2 807059.92
+619081.6 807040.66
+619036.35 806999.83
+618997.29 806949.71
+618939.51 806890.61
+618907.42 806863.83
+618875.17 806835.84
+618847.17 806803.84
+618826.84 806744.78
+618828.35 806716.59
+618891.66 806586.83
+618920.37 806540.49
+619006.9 806383.64
+619028.47 806315.41
+619114.99 806247.34
+619158.11 806170.82
+619182.15 806134.71
+619178.03 806110.54
+619130.65 806071.98
+618950.04 805984.71
+618902.24 805970.43
+618871.06 805954.36
+618723.27 805939.53
+618679.46 805911.37
+618653.91 805877.31
+618629.88 805799.94
+618615.32 805765.32
+618595.54 805693.63
+618584.55 805628.59
+618595.26 805528.36
+618613.94 805412.99
+618624.37 805365.21
+618632.89 805308.62
+618637.69 805269.23
+618648.41 805232.97
+618765.56 805091.93
+618794.95 805028.2
+618802.62 804957.7
+618833.3 804880.77
+618873.53 804801.32
+618924.31 804698.24
+618961.76 804656.25
+619011.05 804617.53
+619073.9 804587.86
+619113.63 804554.17
+619206.66 804524
+619247.14 804497.6
+619296.42 804446.81
+619330.62 804393.5
+619389.71 804331.84
+619476.7 804272
+619517.43 804247.86
+619587.84 804190.03
+619655.56 804125.41
+619709.36 804035.4
+619746.01 803942.13
+619787.25 803889.33
+619763.11 803864.19
+619606.73 804010.01
+619570.52 804017.56
+619525.77 804012.53
+619428.22 803941.13
+619359.33 803937.61
+619263.57 804030.48
+619206.21 804099.27
+619148.89 804125.92
+619094.08 804122.4
+619011.11 804053.01
+618941.96 803997.37
+618879.1 803946.58
+618841.39 803929.98
+618799.65 803928.48
+618758.92 803941.05
+618745.04 803942.18
+618726.99 803906.12
+618722.46 803869.41
+618711.37 803846.66
+618714.92 803814.1
+618714.92 803786.94
+618694.81 803763.79
+618674.43 803742.99
+618664.36 803712.56
+618641.75 803698.74
+618615.1 803675.61
+618550.23 803630.35
+618523.68 803590.53
+618488.21 803572.83
+618465 803552.61
+618448.9 803520.98
+618436.33 803503.84
+618398.62 803480.2
+618359.39 803464.11
+618321.68 803439.47
+618318.36 803404.63
+618319.42 803382.4
+618301.82 803372.34
+618225.88 803347.7
+618201.24 803321.55
+618187.16 803300.43
+618168.05 803269.25
+618152.21 803255.95
+618107.96 803238.35
+618085.84 803222.76
+618069.24 803208.18
+618054.66 803188.57
+618041.58 803164.43
+618022.98 803133.76
+618009.9 803109.62
+617997.59 803089.82
+617966.91 803083.29
+617933.72 803083.29
+617905.56 803061.16
+617899.53 803034.01
+617897.01 802999.81
+617852.53 802939.23
+617832.24 802915.2
+617799.93 802894.34
+617759.4 802882.97
+617721.26 802865.37
+617685.56 802849.28
+617651.36 802824.64
+617631.25 802803.52
+617622.55 802783.72
+617594.66 802750.2
+617571.66 802735.95
+617508.8 802769.14
+617483.32 802801.5
+617469.08 802839.54
+617458.52 802875.74
+617434.88 802922.01
+617374.04 802946.65
+617356.68 802976.13
+617306.43 803076.8
+617297.62 803117.29
+617300.82 803145.76
+617271.84 803256.49
+617257.33 803294.46
+617191.55 803333.09
+617134 803379.3
+617104.29 803412.85
+617065.32 803418.92
+617001.77 803431.88
+616961.97 803436.03
+616858.27 803404.54
+616815.15 803387.09
+616725.83 803279.97
+616710.9 803268.17
+616637.6 803267.57
+616592.03 803272.03
+616486.34 803291.06
+616427.99 803287.85
+616300.15 803284.59
+616264.9 803277.4
+616249.16 803243.86
+616234.09 803172.67
+616210.65 803147.51
+616146.64 803096.17
+616020.19 803043.97
+615955.84 803065.88
+615882.59 803076.49
+615809.16 803122.87
+615789.99 803135.53
+615770.06 803148.86
+615746.32 803166.81
+615753.26 803191.13
+615770.63 803211.4
+615770.06 803225.3
+615756.16 803252.51
+615780.48 803352.68
+615761.89 803418.86
+615741.69 803475.17
+615713.89 803523.26
+615663.3 803572.63
+615625 803597.82
+615553.31 803636.33
+615485.43 803661.74
+615508.66 803715.85
+615505.68 803790.87
+615487.09 803855.93
+615492.13 803859.89
+615569.71 803921.26
+615478.81 803990.16
+615442.92 804008.1
+615418.87 804023.72
+615382.36 804046.96
+615336.22 804044.3
+615272.82 804048.62
+615304.64 804054.61
+615339.24 804061.9
+615617.23 804128.32
+615686.52 804145.92
+615771.01 804169.15
+616036.05 804243.81
+616080.73 804258.21
+616118.91 804270.33
+616142.69 804277.88
+616172.65 804301.01
+616203.29 804325.68
+616237.02 804357.36
+616262.4 804382.97
+616285.84 804405.04
+616309.5 804426.64
+616354.54 804378.17
+616358.77 804374.27
+616362.67 804369.07
+616367.54 804365.82
+616372.74 804362.24
+616376.64 804357.37
+616376.64 804348.91
+616387.37 804335.59
+616398.75 804327.14
+616418.53 804311.91
+616438.54 804296.34
+616451.6 804281.89
+616479.4 804255.21
+616581.69 804237.97
+616642.83 804211.85
+616679.52 804197.95
+616707.87 804182.38
+616740.67 804164.59
+616770.13 804147.92
+616809.6 804137.35
+616855.2 804142.61
+616935.04 804170.63
+616960.25 804083.78
+616961.65 803998.34
+616974.26 803936.71
+616982.16 803860.6
+617023.28 803817
+617042.89 803769.39
+617080.35 803742.1
+617133.8 803677.01
+617170.55 803663.67
+617332.83 803730.81
+617327.03 803751.12
+617302.36 803809.1
+617324.53 803824.91
+617346.69 803838.82
+617469.94 803955.49
+617508.35 803965.47
+617533.9 804002.58
+617530.45 804020.25
+617541.97 804036
+617576.16 804035.23
+617625.33 803992.59
+617618.42 803976.84
+617659.54 803985.44
+617728.29 804084.79
+617746.92 804117.23
+617748.46 804182.92
+617725.6 804221.96
+617710.23 804269.21
+617711.96 804317.86
+617712.34 804384.7
+617695.63 804433.34
+617666.82 804475.6
+617630.33 804531.39
+617580.12 804601.89
+617547.86 804624.93
+617456.46 804653.35
+617340.87 804735.92
+617251.2 804804.47
+617222.2 804843.12
+617199.93 804930.3
+617178.42 804963.71
+617135.8 804989.06
+617094.71 804937.21
+617076.08 804903.29
+616856.8 804940.92
+616734.3 804947.07
+616754.27 804869.49
+616744.86 804857.34
+616736.8 804830.46
+616668.44 804782.84
+616602.96 804736.54
+616481.61 804761.89
+616488.33 804837.72
+616497.05 804954.49
+616505.35 805029.13
+616534.94 805150.29
+616676.76 805435.97
+616707.4 805505.24
+616733.49 805574.54
+616759.71 805682.88
+616763.33 805745.76
+616765.04 805838.11
+616771.45 805915.29
+616778.46 805961.46
+616792.45 806027.25
+616782.01 806095.91
+616765.96 806108.39
+616702.94 806189.25
+616667.87 806220.17
+616661.92 806239.79
+616637.55 806276.65
+616605.44 806301.62
+616614.95 806345.02
+616627.44 806391.39
+616642.3 806438.36
+616670.95 806457.02
+616696.35 806469.62
+616672.22 806505.18
+616660.79 806557.25
+616660.79 806620.75
+617149.74 806564.87
+616869.07 806949.68
+616330.59 807086.84
+616278.52 806751.56
+616175.73 806731.84
+616132.3 806778.74
+616094.63 806846.28
+616060.89 806887.76
+616017.75 806902.14
+615932.03 806896.61
+615887.78 806915.41
+615859.02 806949.7
+615843.54 807007.22
+615823.08 807051.88
+615803.48 807072.77
+615774.38 807091.76
+615730.99 807096.54
+615684.49 807094.33
+615654.75 807099.4
+615626.28 807117.13
+615594.09 807159.86
+615583.58 807243.94
+615563.66 807287.64
+615534.35 807316.4
+615488.44 807334.65
+615429.8 807373.93
+615410.45 807410.44
+615434.17 807441.74
+615456.99 807475.89
+615527.93 807522.04
+615546.94 807539.11
+615569.77 807580.85
+615579.3 807616.28
+615574.91 807661.19
+615559.76 807697.26
+615529.4 807727
+615392.12 807806.14
+615382.63 807816.9
+615383.34 807890.28
+615382.09 807906.73
+615369.44 807921.29
+615295.43 807964.97
+615269.54 808032.04
+615249.3 808051.66
+615229.68 808056.1
+615206.88 808043.45
+615189.15 808033.34
+615173.32 808032.08
+615154.97 808037.78
+615143.59 808049.18
+615144.24 808065.62
+615151.22 808083.97
+615168.23 808113.18
+615174.05 808123.18
+615197.23 808116.45
+615260.98 808092.56
+615346.91 808053.34
+615497.03 808046.26
+615562.9 808058.84
+615617.39 808086.38
+615707.22 808148.06
+615743.75 808161.83
+615778.48 808160.04
+615793.15 808154.35
+615808.72 808146.57
+615818.45 808139.33
+615840.59 808115.91
+615873.47 808080.47
+615907.61 808041.23
+615951.19 807986.14
+615990.42 807945.57
+616033.66 807926.85
+616074.24 807927.74
+616096.08 807935.76
+616124.61 807958.5
+616141.11 807983.91
+616252.16 808154.71
+616288.09 808191.84
+616340.17 808228.48
+616446.95 808249.63
+616533.89 808265.23
+616589.18 808299.12
+616781.8 808545.18
+616790.27 808556.77
+616825.32 808567.22
+616869.63 808550.9
+616916.28 808548.57
+616951.26 808566.06
+616966.92 808595.97
+616971.09 808678.01
+616997.91 808717.66
+617023.57 808738.65
+617078.37 808744.48
+617165.44 808732.85
+617211.32 808735.15
+617271.96 808740.98
+617362.59 808747.6
+617407.23 808780.63
+617512.18 808812.12
+617698.41 808906.92
+617713.69 808807.92
+617732.4 808680.71
+617734.4 808598.31
+617737.39 808469.44
+617742.59 808410.43
+617739.38 808343.97
+617743.59 808308.33
+617753 808275.46
+617801.82 808178.87
+617863.48 808117.63
+617923.15 808064.91
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 617461.01 805855.05
+Region  1
+  44
+602949.44 795149.64
+602938.39 795123.23
+603032.33 794965.51
+603061.86 794962.86
+603044.28 794825.51
+603025.88 794687.02
+602812.11 794714.52
+602810.63 794741.18
+602798.57 794768.7
+602784.39 794780.55
+602726.4 794788.8
+602678.56 794796
+602604.69 794804.67
+602555.16 794827.75
+602511.94 794845.38
+602466.26 794866.64
+602444.89 794875.74
+602407.41 794883.28
+602362.84 794891.61
+602324.52 794899.11
+602254.36 794914.97
+602194.23 794926.35
+602141.23 794934.51
+602082.91 794920.77
+602070 794915.77
+602052.28 794971.38
+602041.24 795002.8
+602017.46 795081.79
+601996.23 795142.94
+601862.04 795209.19
+601865.86 795232.56
+602528.08 795670.13
+602524.27 795646.08
+602524.87 795610.83
+602468.13 795573.16
+602445.49 795540.57
+602441.25 795507.74
+602437.87 795464.99
+602465.17 795465.41
+602577.14 795473.05
+602686.52 795478.91
+602830.03 795486.53
+602934.19 795204.84
+602949.44 795149.64
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 602522.37 795141.76
+Region  1
+  42
+608237.86 794727.66
+608191.51 794772.12
+608185.16 794778.47
+608176.76 794786.07
+608104.64 794858.21
+608082.7 794893.03
+608024.11 794994.96
+607986.27 795061.91
+607940.17 795129.1
+607822.28 795240.98
+608284.4 795354.71
+608462.44 795398.35
+608607.32 795433.32
+608668.17 795446.5
+608522.78 794890.13
+608791.81 794819.05
+608788.3 794805.25
+608775.39 794764.82
+608764.59 794727.57
+608751.26 794731.38
+608685.84 794747.23
+608613.67 794765.22
+608598.27 794707.01
+608588.16 794666.94
+608545.71 794490.52
+608533.59 794454.67
+608526.6 794434.03
+608510.73 794394.98
+608405 794339.42
+608355.83 794298.39
+608314.14 794258.81
+608315.19 794247.59
+608301.44 794264.95
+608289.79 794280.82
+608281.02 794310.73
+608216.91 794563.49
+608182.94 794554.28
+608150.55 794546.98
+608133.66 794623.39
+608110.55 794712.11
+608201.67 794674.96
+608237.86 794727.66
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608340 794929.45
+Region  1
+  49
+612427.06 805845.67
+612618.37 805870.71
+612791.29 805814.58
+612913.32 805766.08
+612949.56 805759.16
+612948.76 805726.41
+612998.31 805642.75
+613047.34 805609.71
+613152.85 805537.23
+613198.42 805505.1
+613229.86 805481.51
+613261.83 805445.81
+613316.72 805337.1
+613315.92 805319.24
+613306.86 805293.13
+613288.2 805254.27
+613266.36 805192.42
+613234.2 805154.47
+612858.17 805381.63
+612769.71 805430.12
+612678.58 805450.77
+612553.35 805441.71
+612467.29 805432.37
+612401.81 805428.38
+612344.19 805422.78
+612289.76 805420.21
+612261.59 805416.38
+612232.82 805388.14
+612175.26 805329.52
+612124.38 805275.99
+612066.31 805222.87
+612031.68 805199.96
+611959.74 805209.02
+611914.97 805215.41
+611868.61 805222.34
+611790.26 805226.43
+611795.59 805272.26
+611790.81 805331.59
+611773.76 805383.81
+611755.37 805445.89
+611763.89 805487.46
+611777.75 805503.44
+611795.33 805517.3
+611979.71 805614.81
+612099.59 805690.31
+612216.57 805760.94
+612339.13 805831.28
+612371.64 805841.94
+612427.06 805845.67
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612519.9 805526.83
+Region  1
+  53
+609277.95 795863.12
+609536.93 795558.01
+609674.64 795520.9
+609674.68 795520.89
+609678.24 795519.93
+609680.35 795519.36
+609626.83 795404.31
+609597.99 795334.69
+609556.95 795148.23
+609524.82 794982.43
+609508.88 794880.14
+609518.49 794767.79
+609522.25 794711.51
+609513.8 794681.03
+609476.75 794631.31
+609436.42 794610.21
+609306.04 794580.66
+609262.89 794559.56
+609218.88 794508.23
+609215.42 794353.29
+609197.32 794308.21
+609111.21 794246.99
+609086.75 794257.47
+609045.16 794271.76
+609033.89 794309.36
+609017.69 794364.3
+609002.45 794415.1
+608993.11 794438.91
+608986.44 794461.48
+608981.68 794471.64
+608978.51 794481.48
+609053.75 794586.55
+609068.99 794586.55
+609095.66 794643.06
+609021.79 794666.58
+608964.42 794679.72
+608914.47 794695.39
+608883.14 794709.55
+608844.61 794746.17
+608810.95 794807.15
+608791.81 794819.05
+608522.78 794890.13
+608668.17 795446.5
+608755.03 795763.22
+608726.4 795929.63
+608820.53 795950.01
+608933.57 795976.21
+609033.04 795998.26
+609184.42 796030.28
+609187.49 796032.42
+609213.55 795938.99
+609277.84 795863.25
+609277.95 795863.12
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609099.76 795223.21
+Region  1
+  52
+607615.44 793398.53
+606929.51 793063.99
+606817.44 793218.98
+606793.94 793257.4
+606768.52 793293.34
+606721.71 793362.33
+606653.77 793460.57
+606631.55 793496.45
+606611.55 793555.16
+606601.39 793614.35
+606575.41 793633.79
+606593.03 793645.48
+606619.82 793662.06
+606631.3 793677.37
+606646.61 793659.51
+606667.02 793644.21
+606681.05 793636.55
+606710.39 793632.72
+606723.15 793631.45
+606737.18 793636.55
+606797.13 793655.69
+606854.54 793674.82
+606915.77 793699.06
+606937.45 793701.61
+606971.9 793704.16
+607003.79 793709.26
+607012.72 793687.58
+607022.92 793656.96
+607154.31 793700.33
+607192.58 793707.99
+607215.54 793710.54
+607235.95 793710.54
+607253.81 793718.19
+607286.97 793752.63
+607299.73 793767.94
+607315.04 793789.63
+607322.69 793802.38
+607336.72 793826.62
+607349.48 793838.1
+607382.65 793878.92
+607397.88 793899.09
+607422.32 793846.7
+607439.79 793771.09
+607445.31 793732.71
+607461.74 793653.59
+607474.37 793592.2
+607514.73 793552.64
+607564.26 793532
+607594.11 793494.54
+607599.64 793450.43
+607612.4 793408.53
+607615.44 793398.53
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607105.04 793460.81
+Region  1
+  63
+611467.61 805203.94
+611370.62 805153.32
+611322.13 805132.53
+611282.16 805124.54
+611233.67 805121.87
+611196.9 805131.47
+611171.05 805147.19
+611139.29 805156.35
+611094.85 805159.98
+611059.68 805169.57
+611079.39 805227.12
+611102.84 805260.16
+611093.25 805271.89
+611084.41 805306.32
+611035.43 805307.83
+611002.39 805320.62
+610844.1 805408.01
+610808.93 805395.76
+610776.43 805411.21
+610791.08 805443.45
+610811.86 805498.33
+610845.97 805562.81
+610858.76 805592.66
+610875.81 805615.57
+610891.52 805665.95
+610894.72 805714.98
+610883.8 805763.74
+610871.55 805795.71
+610859.29 805835.68
+610848.63 805881.18
+610865.94 805981.61
+610942.29 806050.4
+610968.24 806104.15
+610997.49 806157.92
+611014 806193.97
+611026.72 806243.95
+611033.2 806369.47
+611049.72 806323.12
+611073.69 806276.23
+611301.18 806074.85
+611426.38 806177.68
+611521.21 806130.79
+611601.13 806134.52
+611609.94 805752.26
+611620.84 805709.91
+611642.68 805683.8
+611692.23 805663.56
+611751.37 805653.97
+611755.1 805617.74
+611782.54 805555.66
+611785.21 805528.49
+611795.33 805517.3
+611777.75 805503.44
+611763.89 805487.46
+611755.37 805445.89
+611773.76 805383.81
+611790.81 805331.59
+611795.59 805272.26
+611790.26 805226.43
+611711.41 805235.13
+611593.64 805245.26
+611554.21 805242.06
+611467.61 805203.94
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611285.96 805657.67
+Region  1
+  49
+613142.25 798426.02
+613462.12 798372.11
+613608.36 798348.96
+613615.26 798399.54
+613574.77 798488.13
+613537.5 798551.37
+613601.31 798586.38
+613653.54 798624.51
+613631.52 798662.34
+613826.03 798570
+614011.2 798754.79
+614021.2 798750.99
+614144.87 798735.7
+614107.38 798689.27
+614061.11 798582.15
+614051.54 798516.36
+614052.7 798437.27
+614077.67 798358.91
+614119.96 798258.97
+614198.47 798095.49
+614114.17 798055.93
+614079.57 798058.59
+614040.84 798071.6
+613943.2 798111.37
+613955.27 798078.35
+613965.07 798058.35
+613970.78 798043.74
+613978.76 798027.55
+613990.83 797999.61
+614006.43 797953.69
+614009.25 797946.35
+613878.54 797893.57
+613901.69 797827.51
+613257.15 797568.02
+612593.97 797653.43
+612597.16 797680.33
+612602.18 797715.89
+612604.46 797734.13
+612612.67 797802.98
+612624.06 797898.27
+612676.04 797895.54
+612706.13 797894.17
+612735.31 797892.8
+612738.27 797907.55
+612740.55 797921.68
+612744.19 797961.35
+612892.83 797970.47
+613067.15 797981.57
+613142.25 798426.02
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613469.32 798066.56
+Region  1
+  63
+605181.54 798006.53
+605132.6 798009.96
+605050.31 798019.55
+604998.38 798027.94
+604964.82 798046.72
+604926.88 798081.07
+604896.92 798117.82
+604880.74 798153.15
+604880.74 798204.29
+604886.62 798268.6
+604887.49 798295.93
+604856.47 798391.64
+604850.39 798403.79
+604766 798603.63
+604727.61 798671.97
+604738.02 798677.17
+604759.71 798686.28
+604790.95 798700.6
+604790.52 798723.16
+604798.76 798742.26
+604819.15 798764.38
+604838.89 798787.57
+604863.62 798816.21
+604806.35 798871.75
+604824.36 799054.63
+604885.1 798999.52
+604941.94 798948.76
+604958.86 798922.29
+604975.56 798860.47
+605032.62 798627.28
+605041.94 798594.52
+605126.77 798616.39
+605164.08 798614.66
+605187.51 798598.16
+605218.1 798564.94
+605294.46 798482.5
+605290.99 798468.62
+605281.44 798458.64
+605264.95 798458.21
+605239.35 798476.86
+605225.04 798486.84
+605206.38 798506.37
+605186.03 798522.69
+605163.43 798531.1
+605133.48 798531.13
+605108.97 798516.13
+605092.92 798495.34
+605085.98 798465.4
+605085.98 798438.5
+605095.96 798401.62
+605124.46 798359.68
+605267.59 798256.08
+605291.92 798120.48
+605292.56 798114.77
+605293.19 798105.56
+605292.59 798094.41
+605296.58 798050.87
+605311.76 797995.34
+605314.96 797978.97
+605322.95 797957.39
+605282.6 797982.96
+605249.84 797999.34
+605181.54 798006.53
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605009.02 798427.64
+Region  1
+  56
+601351.95 785668.74
+601344.01 785716.82
+601336.43 785756.16
+601320.37 785773.29
+601249.62 785789.54
+601222.18 785816.61
+601198 785833.22
+601157.57 785849.1
+601108.12 785863.9
+601031.96 785888.44
+601001.28 785893.51
+600856.17 785911.56
+600820.8 785916.62
+600795.17 785920.59
+600799.14 785964.99
+600803.65 786003.78
+600817.36 786109.54
+600811.04 786145.13
+600795.88 786242.95
+600755.09 786298.08
+600805.86 786309.29
+601321.44 786462.75
+601892.48 786612.91
+601941.48 786684.13
+602018.32 786627.61
+602222.18 786485.36
+602376.18 786371.37
+602485.06 786287.22
+602044.35 785736.06
+602122.32 785675.62
+602162.82 785646.51
+602236.11 785590.66
+602046.23 785327.48
+602079.74 785230.64
+602071.5 785207.85
+602048.78 785191.22
+602009.41 785178.52
+602007.51 785189.95
+601984.65 785255.35
+601852.35 785060.46
+601833.72 785041.83
+601795.44 785063.69
+601758.11 785120.02
+601722.05 785165.59
+601680.3 785219.38
+601648.03 785265.59
+601613.87 785307.36
+601584.13 785343.43
+601566.42 785385.84
+601530.36 785428.87
+601481.01 785466.85
+601448.7 785481.08
+601405.38 785528.01
+601377.24 785558.62
+601369.02 785610.51
+601351.95 785668.74
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 601674.2 785985.02
+Region  1
+  66
+616304.96 808541.6
+616347.96 808506.78
+616396.67 808478.92
+616411.24 808490.3
+616427.72 808506.74
+616458.13 808530.13
+616501.83 808547.19
+616553.09 808537.04
+616599.94 808546.51
+616647.46 808583.81
+616693.72 808619.21
+616719.05 808626.79
+616744.33 808600.21
+616776.57 808562.23
+616790.27 808556.77
+616781.8 808545.18
+616589.18 808299.12
+616533.89 808265.23
+616446.95 808249.63
+616340.17 808228.48
+616288.09 808191.84
+616252.16 808154.71
+616141.11 807983.91
+616124.61 807958.5
+616096.08 807935.76
+616074.24 807927.74
+616033.66 807926.85
+615990.42 807945.57
+615951.19 807986.14
+615907.61 808041.23
+615873.47 808080.47
+615840.59 808115.91
+615818.45 808139.33
+615808.72 808146.57
+615793.15 808154.35
+615788.96 808207.05
+615778.18 808317.84
+615793.15 808353.77
+615777.88 808430.18
+615770.69 808503.24
+615756.32 808518.81
+615753.92 808551.15
+615734.76 808573.9
+615715.6 808640.97
+615721.58 808668.52
+615692.84 808742.77
+615665.29 808791.88
+615696.43 808843.38
+615738.79 808878.25
+615796.4 808885.18
+615846.39 808871.24
+615918.57 808881.96
+615954.14 808876.51
+615965.7 808874.74
+615965.46 808870.12
+615962.86 808815.71
+616000.78 808764.45
+616049.48 808734.69
+616081.74 808716.33
+616103.87 808696.07
+616160.21 808704.26
+616203.89 808703.61
+616229.18 808685.25
+616234.19 808641.59
+616267.66 808579.58
+616304.96 808541.6
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 616112.36 808421.49
+Region  1
+  87
+613473.66 799558.01
+613378.74 799580.83
+613260.55 799591.68
+613166.73 799611.94
+613087.01 799638.56
+613025.62 799653.14
+612953.4 799670.16
+612896.38 799696.7
+612909.36 799744.13
+612951.82 799856.26
+612962.72 799887.8
+612964.98 799914.84
+612990.78 799955.5
+613026.35 800110.68
+613034.17 800157.98
+613056.15 800226.25
+613096.71 800304.11
+613126.67 800367.19
+613135.32 800379.46
+613146.55 800399.48
+613155.34 800419.2
+613227.43 800560.9
+613261.69 800625.42
+613286.46 800688.67
+613311.71 800756.51
+613340.78 800837.96
+613358.13 800861.04
+613391.76 800902.3
+613469.5 800980.53
+613550.47 801066.75
+613621.75 801168.42
+613691.25 801275.75
+613785.3 801242.86
+613758.68 801198.23
+613796.47 801130.77
+613841.45 800793.49
+613868.72 800600.68
+613870.89 800559.3
+613864.19 800519.59
+613836.44 800431.56
+613827.12 800397.35
+613811.81 800346.16
+613798.89 800295.45
+613799.59 800255.98
+613820.64 800160.29
+613848.15 800042.84
+613865.38 799967.72
+613888.11 799874.19
+613916.58 799754.35
+613984.04 799830.9
+614077.81 799904.57
+614078.76 799889.74
+614087.85 799862.95
+614106.99 799812.24
+614121.82 799777.79
+614170.8 799726.57
+614238.04 799684.82
+614285.36 799654.67
+614337.09 799628.92
+614414.57 799578.24
+614443.68 799544.1
+614467.14 799509.76
+614488.08 799451.12
+614486.88 799395.53
+614483 799333.53
+614463.31 799279.77
+614434.76 799229.17
+614425.83 799219.17
+614011.2 798754.79
+613826.03 798570
+613631.52 798662.34
+613614.01 798705.82
+613600.18 798750.15
+613552.75 798943.82
+613556.14 798998.57
+613567.43 799029.63
+613586.63 799189.96
+613600.75 799275.79
+613602.49 799320.7
+613612.32 799368.68
+613641.68 799421.19
+613687.42 799460.72
+613620.79 799459.02
+613597.64 799469.19
+613595.95 799485.56
+613572.8 799540.33
+613473.66 799558.01
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613685.86 799828.12
+Region  1
+  47
+605030.98 797784.12
+604994.59 797805.32
+604885.62 797804.87
+604815.28 797840.81
+604674.61 797900.21
+604584.67 797936.37
+604538.42 797954.01
+604522.74 797961.06
+604510.98 797969.69
+604487.06 797989.29
+604496.08 798035.94
+604515.1 798078.5
+604520.19 798137.69
+604510.97 798178.66
+604485.49 798254.69
+604451.6 798387.39
+604464.14 798388.96
+604519.4 798441.87
+604542.41 798446.59
+604594.35 798440
+604850.39 798403.79
+604856.47 798391.64
+604887.49 798295.93
+604886.62 798268.6
+604880.74 798204.29
+604880.74 798153.15
+604896.92 798117.82
+604926.88 798081.07
+604964.82 798046.72
+604998.38 798027.94
+605050.31 798019.55
+605132.6 798009.96
+605181.54 798006.53
+605249.84 797999.34
+605282.6 797982.96
+605322.95 797957.39
+605344.12 797902.66
+605362.33 797840.8
+605365.46 797816.69
+605367.04 797793.25
+605304.52 797785.21
+605244.23 797764.22
+605201.36 797748.14
+605164.74 797734.3
+605132.58 797729.83
+605098.2 797737.87
+605030.98 797784.12
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604840.19 798065.49
+Region  1
+  46
+611382.37 801255.86
+611421.18 801312.79
+611464.36 801418.43
+611501.85 801531.02
+611562.86 801639.93
+611574.49 801666.71
+611610.72 801731.01
+611662.8 801774.48
+612248.3 802014.91
+612204.83 801861.41
+612184.23 801789.66
+612147.1 801666.5
+612084.13 801469.99
+612054.86 801353.59
+612047.14 801258.06
+612055.9 801176.45
+612067.23 801123.3
+612079.38 801095.61
+612097.49 801026.49
+612120.82 800933.84
+612124.73 800880.67
+612071.95 800781.4
+612040.28 800722.76
+611982.41 800618.48
+611757.07 800542.37
+611423.05 800439.43
+611430.8 800490.66
+611433.81 800530.69
+611417.22 800544.26
+611396.13 800583
+611397.21 800660.27
+611398.93 800713.65
+611391.18 800734.75
+611369.04 800759.07
+611339.34 800784.03
+611325.13 800805.56
+611314.37 800853.33
+611296.07 800888.04
+611283.59 800916.45
+611278.43 800968.09
+611278 801026.63
+611281.66 801060.46
+611335.02 801167.2
+611349.23 801193.89
+611361.28 801214.97
+611382.37 801255.86
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611753.44 801179.48
+Region  1
+  17
+608251.51 805983.13
+608711.29 806982.56
+608719.03 807007.96
+608872.05 807211.06
+608926 807117.86
+609661.27 806143.08
+609893.46 805919.58
+609885.73 805906.92
+609699.75 805604.81
+609624.86 805507.22
+609587.99 805477.17
+609514.69 805440.75
+609413.62 805427.59
+609210.34 805476.11
+608976.78 805539.87
+608149.75 805763.47
+608251.51 805983.13
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609010.6 806140.12
+Region  1
+  129
+611859.28 810753.6
+611917.01 810663.94
+611944.71 810637.08
+611978.61 810619.31
+612008.4 810593.67
+612044.93 810583.18
+612184.98 810498.82
+612310.95 810499.45
+612342.84 810492.69
+612404.66 810467.58
+612474.25 810447.95
+612567.68 810442.7
+612625.83 810445.43
+612660.78 810436.3
+612692.8 810416.85
+612735.1 810368.41
+612746.02 810347
+612767.71 810301.09
+612794.79 810282.62
+612937.66 810195.2
+612962.95 810172.2
+612995.38 810101.13
+612976.48 810081.18
+612948.45 810066.93
+612904.15 810075.17
+612886.22 810088.53
+612860.4 810072.23
+612762.4 810111.39
+612627.77 810125.54
+612578.66 810096.54
+612522.43 810048.78
+612497.07 810016.52
+612453.27 809881.8
+612435.43 809767.31
+612444.18 809653.43
+612449.79 809562.34
+612463.06 809539.56
+612478.22 809511.08
+612477.55 809476.29
+612463.6 809454.15
+612435.73 809432.03
+612328.71 809380.03
+611976 809323.82
+611923.41 809333.79
+611872.63 809335.61
+611801.44 809339.57
+611765.18 809339.57
+611682.67 809413.92
+611678.13 809440.22
+611740.24 809570.32
+611740.24 809623.81
+611869 809841.47
+611833.64 809841.47
+611800.09 809851.45
+611718.48 809874.11
+611676.58 809882.79
+611619.2 809909.01
+611588.37 809973.39
+611350.81 809657.86
+611277.05 809775.43
+611272.01 809793.78
+611266.37 809850.08
+611270.84 809891.83
+611274.07 809958.25
+611264.62 810004.44
+611248.82 810032.91
+611234.28 810045.57
+611214.66 810050.01
+611184.9 810041.16
+611144.99 810017.79
+611046.61 809665.54
+610907.88 809703.62
+610834.44 809710.88
+610774.6 809744.42
+610704.78 809759.84
+610692.09 809747.15
+610606.68 809749.8
+610585.81 809759.93
+610582.02 809775.11
+610599.15 809852.77
+610535.68 809889.04
+610501.22 809852.77
+610464.05 809815.6
+610396.05 809738.53
+610386.07 809732.18
+610366.13 809741.25
+610345.27 809754.85
+610318.98 809772.98
+610293.59 809788.39
+610270.92 809803.81
+610249.74 809818.92
+610219.24 809843.7
+610197.48 809843.7
+610212.89 809873.63
+610227.4 809918.05
+610243.49 809985.96
+610279.62 810047.06
+610337 810083.19
+610423.6 810115.6
+610581.93 810179.36
+610620.72 810196.89
+610656.31 810223.99
+610691.38 810267.56
+610711.3 810325.2
+610719.27 810408.62
+610728.54 810523.11
+610740.23 810552.34
+610755.1 810577.84
+610780.08 810565.62
+610832.16 810552.18
+610891.55 810545.52
+610963.15 810463.93
+611013.65 810432.29
+611054.72 810430.63
+611136.87 810462.27
+611259.79 810447.55
+611284.21 810476.97
+611305.31 810589.65
+611326.69 810653.75
+611357.69 810697.7
+611398.03 810771.15
+611431.2 810830.35
+611466.68 810849.87
+611532.81 810857.22
+611609.74 810876.65
+611724.01 810881.79
+611765.67 810870.77
+611811.13 810836.19
+611859.28 810753.6
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611646.54 810102.21
+Region  1
+  41
+609943.25 803673.69
+609548.33 803856.88
+609533.88 803840.02
+609252.61 803957.86
+609216.03 803973.06
+609403.85 804163.77
+609369.9 804525.15
+609403.61 804541.53
+609447.44 804550.68
+609492.71 804562.24
+609517.44 804557.42
+609580.84 804530.93
+609746.74 804469.23
+609751.81 804489.54
+609758.68 804514.33
+609814.23 804475.8
+609932.05 804393.5
+610072.57 804312.08
+610164.71 804261.46
+610252.51 804326.86
+610408.57 804245.18
+610486.07 804216.22
+610482.78 804203.67
+610418.12 804001.48
+610375.27 803952.2
+610335.68 803882.58
+610283.43 803775.81
+610276.12 803759.26
+610267.16 803734.47
+610254.91 803702.81
+610241.77 803708.19
+610227.43 803721.33
+610141.12 803796.89
+610103.79 803830.94
+610079.75 803867.79
+610046.6 803932
+609992.1 803976.67
+609975.08 803926.49
+609952.08 803845.25
+609948.65 803765.66
+609943.25 803673.69
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609839.53 804116.56
+Region  1
+  114
+607728.59 794654.98
+607785.52 794577.76
+607835.96 794476.42
+607874.04 794354.52
+607884.19 794278.61
+607885.24 794162.23
+607887.99 794066.15
+607893.53 793914.91
+607912.68 793861.22
+607962.63 793777.83
+608019.04 793689.28
+608047.94 793625.04
+608065.3 793563.45
+608084.45 793486.87
+608455.72 793562.76
+608477.4 793628.64
+608518.89 793702.24
+608631.08 793753.03
+608647.38 793755.57
+608667.45 793699.13
+608709.25 793610.73
+608756.68 793491.74
+608785.21 793452.22
+608759.81 793442.06
+608811.88 793330.93
+608855.95 793245.52
+608896.18 793162.05
+608910.78 793131.25
+608821.25 793093.46
+608670.76 793100.13
+608623.13 793088.7
+608524.39 793134.1
+608485.65 793140.1
+608445.01 793137.56
+608439.61 793165.82
+608369.76 793151.24
+608300.54 793132.82
+608311.02 793091.87
+608318 793045.83
+608296.1 793064.88
+608267.89 793092.28
+608222.76 793122.67
+608179.57 793161.73
+608147.19 793264.92
+608124.01 793253.49
+607775.34 793113.07
+607764.6 793138.84
+607759.84 793171.54
+607774.12 793249.68
+607772.54 793270.95
+607751.58 793296.39
+607648.08 793343.06
+607624.58 793361.16
+607615.44 793398.53
+607612.4 793408.53
+607599.64 793450.43
+607594.11 793494.54
+607564.26 793532
+607514.73 793552.64
+607474.37 793592.2
+607461.74 793653.59
+607445.31 793732.71
+607439.79 793771.09
+607422.32 793846.7
+607397.88 793899.09
+607386.13 793919.41
+607392.16 794002.59
+607388.03 794086.78
+607377.55 794119.15
+607308.97 794247.1
+607286.2 794281.17
+607260.9 794295.59
+607126.71 794280.53
+607099.65 794284.18
+607063.78 794307.24
+607043.6 794337.98
+606944.16 794336.87
+606907.81 794498.09
+606902.04 794522.11
+606860.21 794697.26
+606814.45 794898.9
+606801.13 794929.06
+606787.06 794969.8
+606754.57 795107.08
+606787.55 795092.52
+606837.03 795075.06
+606836.31 795092.86
+606824.17 795164.56
+606755.78 795371.68
+606732.79 795447.56
+606731.33 795474.24
+606742.97 795496.55
+606766.74 795515.46
+606784.68 795439.8
+606868.11 795487.33
+607000.52 795562.99
+606991.78 795444.17
+607031.07 795298.67
+607052.64 795211.12
+607075.44 795128.66
+607088.29 795083.31
+607160.56 795122.11
+607235.02 795165.02
+607289.83 795197.04
+607415.47 795179.57
+607431.71 795179.33
+607568.05 795163.32
+607560.77 795126.93
+607554.95 795092.97
+607553.49 795019.71
+607559.76 794949.96
+607593.41 794859.99
+607666 794746.76
+607728.59 794654.98
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607648.26 794166.49
+Region  1
+  151
+606289.79 805808.47
+606368.3 805698.97
+606437.85 805597.74
+606481.46 805646.65
+606536.55 805597
+606610.42 805538.27
+606634.85 805506.57
+606646.65 805491.73
+606642.38 805471.73
+606778.74 805421.46
+606891.06 805484.34
+606949.33 805510.88
+607029.12 805532.35
+607086.73 805538.65
+607113.42 805537.84
+607128.57 805495.84
+607140.62 805450.05
+607142.68 805419.75
+607170.12 805412.71
+607241.85 805386.01
+607289.37 805362.59
+607341.7 805340.55
+607396.11 805336.42
+607451.54 805356.79
+607517.66 805386.4
+607569.58 805414.02
+607562.98 805505.28
+607561.16 805555.35
+607569.81 805567.18
+607697.7 805814.24
+607714.08 805847.92
+607716.82 805877.05
+607713.86 805935.04
+607709.76 806001.94
+607709.76 806083.87
+607870.21 806158.15
+608231.02 805991.32
+608251.51 805983.13
+608149.75 805763.47
+608976.78 805539.87
+608928.52 805350.47
+608731.38 805401
+608497.82 805472.52
+608371.25 805508.95
+608353.95 805502.12
+608343.49 805483.03
+608317.08 805450.25
+608295.23 805410.19
+608290.22 805339.63
+608285.89 805281.13
+608281.79 805231.96
+608276.11 805146.6
+608268.14 805060.33
+608267.23 805019.36
+608280.43 804976.11
+608247.88 805013.65
+608239.68 805034.14
+608229.67 805094.24
+608219.42 805182.34
+608209.86 805257.46
+608202.36 805331.43
+608182.78 805417.47
+608158.2 805459.36
+608116.97 805493.28
+608026.37 805536.98
+607984.94 805547
+607928.04 805532.43
+607892.53 805504.2
+607867.03 805461.41
+607868.87 805416.01
+607876.44 805377.45
+607897.79 805296.19
+607891.59 805262.44
+607875.06 805232.14
+607817.22 805180.49
+607749.04 805120.58
+607721.5 805084.82
+607691.2 805025.59
+607682.24 804976.7
+607668.47 804774.93
+607647.81 804738.05
+607625.43 804716.7
+607591 804681.58
+607577.91 804665.74
+607566.9 804656.79
+607555.88 804647.84
+607545.55 804642.33
+607535.22 804640.95
+607524.89 804647.84
+607517.66 804659.92
+607531.43 804681.96
+607557.6 804718.46
+607519.03 804755.64
+607486.32 804788.37
+607457.4 804820.05
+607434.67 804842.78
+607421.59 804866.19
+607418.84 804893.05
+607426.41 804924.73
+607469.8 804993.59
+607473.93 805025.96
+607460.84 805061.77
+607435.36 805085.87
+607396.11 805092.76
+607350.66 805077.61
+607326.56 805036.98
+607300.39 804982.57
+607272.15 804960.54
+607244.61 804955.03
+607137.18 804988.77
+607072.1 805007.7
+607033.54 805001.5
+606971.44 804974.38
+606809.04 804894.76
+606775.64 804866.2
+606747.41 804808.35
+606672.34 804763.59
+606623.03 804760.72
+606575.93 804778.05
+606507.07 804825.57
+606440.96 804888.23
+606371.06 804935.39
+606323.55 804993.92
+606270.52 805070.36
+606125.56 805189.84
+606089.75 805235.98
+606027.08 805329.63
+606000.91 805357.18
+605898.3 805428.8
+605833.32 805472.86
+605792.21 805497.56
+605737.82 805534.28
+605635.06 805583.34
+605560.45 805622.35
+605512.96 805672.37
+605479.89 805713.07
+605468.87 805752.08
+605469.72 805834.33
+605466.74 805940.74
+605450.63 805985.68
+605428.29 806039.93
+605403.55 806094.64
+605394.95 806113.23
+605745.81 806310.32
+606077.61 806011.73
+606095.25 805982.38
+606111.09 805955.52
+606115.91 805908.01
+606150.87 805922.12
+606185.81 805936.56
+606289.79 805808.47
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606966 805487.41
+Region  1
+  116
+607523.78 810777
+607414.21 810884.01
+607381.84 810932.34
+607381.84 810932.34
+607437.89 811012.46
+607439.39 811053.31
+607407.19 811132.18
+607390.38 811163.94
+607367.96 811196.32
+607357.37 811213.76
+607346.16 811233.69
+607338.07 811246.77
+607328.72 811261.09
+607321.25 811271.05
+607312.53 811283.51
+607302.57 811299.7
+607288.25 811319.63
+607273.3 811340.8
+607249.01 811375.05
+607229.71 811401.21
+607215.67 811424.52
+607193.45 811409.91
+607188.37 811422.61
+607176.61 811444.17
+607159.79 811465.76
+607138.83 811482.27
+607102.95 811521.64
+607078.51 811553.68
+606996.59 811684.79
+607006.27 811784.04
+607040.88 811912
+607050.09 811997.38
+607028.5 812025.95
+607045.64 812081.2
+607020.88 812078.96
+607042.55 812133.85
+607053.14 812169.35
+607056.88 812215.43
+607051.9 812249.06
+607044.38 812285.98
+607161.12 812332.75
+607236.48 812357.38
+607284.59 812356.09
+607333.95 812345.31
+607381.41 812335.17
+607412.38 812299.09
+607415.49 812258.6
+607442.67 812223.15
+607484.4 812188.34
+607542.6 812157.94
+607587.51 812138.3
+607615.32 812102.86
+607648.81 812052.23
+607696.2 811987.04
+607746.15 811946.53
+607804.99 811918.66
+607856.23 811893.96
+607899.84 811845.22
+607918.15 811802.82
+607947.18 811736.38
+607985.09 811677.52
+608073.2 811664.82
+608095.54 811630.57
+608127.57 811579.18
+608161.82 811523.32
+608185.66 811483.85
+608213.92 811431.45
+608251.29 811369.79
+608297.37 811295.43
+608353.97 811292.45
+608420.25 811295.43
+608489.51 811294.69
+608532.71 811296.18
+608561.01 811305.86
+608574.03 811298.03
+608586.69 811274.95
+608595.63 811251.12
+608615.74 811224.3
+608643.29 811193.77
+608672.34 811152.06
+608693.19 811105.14
+608718.15 811049.65
+608736.77 811001.25
+608739.01 810958.79
+608737.52 810926.77
+608727.83 810885.81
+608715.47 810854.96
+608694.71 810807.89
+608676.71 810757.36
+608687.15 810738.17
+608704.22 810717.29
+608666.32 810700.6
+608631.71 810681.22
+608599.87 810659.76
+608578.41 810641.76
+608561.8 810603
+608464.89 810522.7
+608451.48 810539.01
+608385.28 810645.22
+608365.2 810592.61
+608321.59 810563.54
+608289.75 810579.46
+608246.14 810536.54
+608132.62 810627.92
+608119.12 810619.27
+607969.6 810654.57
+607991.75 810779.17
+607810.35 810641.79
+607774.28 810613.11
+607760.63 810583.27
+607734.3 810543.77
+607727.96 810538.71
+607670.77 810519.45
+607620.94 810659.42
+607577.09 810726.68
+607523.78 810777
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607796.34 811343.79
+Region  1
+  55
+612099.83 807227.44
+612053.47 807348.95
+612068.39 807359.6
+612016.43 807447.81
+611984.19 807455.57
+611912.25 807564.81
+611877.34 807713.25
+611875.76 807917.66
+611874.85 807945.77
+611931.85 807928.73
+611964.38 807909.59
+612010.85 807899.41
+612055.07 807877.05
+612083.89 807853.2
+612197.18 807901.4
+612366.25 807653.17
+612379.58 807626.11
+612391.51 807606.73
+612413.87 807599.28
+612447.16 807591.83
+612480.45 807590.34
+612514.24 807587.85
+612585.29 807574.93
+612630.51 807557.05
+612672.47 807514.59
+612684.39 807509.62
+612695.82 807505.15
+612709.73 807433.6
+612733.09 807359.06
+612761.91 807298.94
+612792.96 807237.58
+612811.42 807189.9
+612830.36 807137.39
+612844.24 807100.06
+612869.52 807059.56
+612880.25 807024.76
+612887.66 806965.53
+612895.95 806936.5
+612914.33 806920.37
+612978.23 806888.07
+613002.27 806869.72
+613052.86 806826.04
+613088.3 806814.64
+613118.04 806803.24
+613135.11 806782.36
+613141.92 806756.07
+613134.45 806731.18
+613113.72 806757.73
+613074.95 806760.88
+612710.99 806771.8
+611998.15 806679.13
+611944.5 806787.59
+611862.96 807131.23
+611980.2 807136.56
+612099.83 807227.44
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612352.16 807209.11
+Region  1
+  149
+606044.05 798724.21
+606093.91 798759.13
+606030.4 798778.19
+605994.5 798803.33
+605939.57 798843.34
+605890.04 798888.77
+605863.06 798920.52
+605827.5 798961.16
+605779.87 799008.19
+605707.8 799077.72
+605669.82 799122.08
+605643.99 799154.54
+605625.37 799167.17
+605589.68 799188.13
+605556.16 799192.25
+605548.85 799290.43
+605522.59 799408.22
+605523.93 799490.34
+605546.59 799585.25
+605561.18 799638.87
+605567.46 799663.1
+605575.99 799685.98
+605580.92 799703.48
+605590.35 799713.8
+605628.49 799718.29
+605655.86 799720.98
+605672.91 799703.48
+605710.61 799649.19
+605720.93 799739.38
+605730.59 799809.15
+605732.84 799834.28
+605735.53 799859.86
+605737.77 799895.31
+605751.68 799898
+605793.86 799905.18
+605822.13 799959.03
+605840.01 799985.8
+605839.38 800006.12
+605828.58 800030.25
+605820.64 800049.94
+605811.75 800073.77
+605798.1 800099.8
+605787.62 800122.03
+605773.01 800151.88
+605762.53 800182.67
+605811.11 800188.07
+605835.56 800178.86
+605886.99 800163.62
+605903.5 800178.23
+605930.81 800206.17
+605944.46 800228.08
+605952.73 800240.53
+605955.27 800260.22
+605952.09 800326.27
+605990.83 800384.7
+606012.11 800396.41
+606038.15 800394.5
+606102.29 800386.25
+606173.41 800352.59
+606233.75 800324.01
+606297.89 800293.53
+606324.25 800272.93
+606339.49 800248.17
+606351.87 800216.68
+606363.93 800177.31
+606391.24 800106.82
+606414.74 800052.84
+606421.09 800024.9
+606426.56 799964.42
+606419.38 799881.4
+606414 799814.09
+606405.03 799768.77
+606387.98 799732.42
+606371.38 799712.23
+606260.76 799626.75
+606254.47 799601.62
+606249.09 799572.45
+606245.05 799554.5
+606261.42 799528.71
+606274.59 799502.86
+606287.32 799481.04
+606304.15 799438.81
+606319.07 799443.57
+606341.3 799446.43
+606360.98 799443.26
+606392.9 799437.17
+606433.73 799426.85
+606485.26 799411.01
+606541 799394.36
+606605.77 799374.64
+606613.07 799389.56
+606627.37 799414.96
+606667.31 799398.81
+606690.19 799397.01
+606707.69 799396.56
+606730.13 799395.22
+606757.95 799397.01
+606800.57 799407.33
+606791.6 799356.18
+606788.91 799321.63
+606783.52 799287.97
+606758.39 799249.83
+606701.41 799177.14
+606648.22 799135.09
+606666.08 799101.09
+606698.46 799036.32
+606722.6 799012.19
+606756.26 798967.1
+606766.1 798933.79
+606764.19 798807.42
+606761.34 798721.97
+606754.99 798574.63
+606750.52 798451.42
+606747.34 798393.64
+606652.73 798348.55
+606599.39 798321.25
+606529.54 798283.15
+606536.54 798268.22
+606543.55 798256.52
+606562.66 798223.29
+606538.89 798070.84
+606514.99 797912.68
+606459.1 797987.33
+606442.28 798020
+606410.22 798081.6
+606401.96 798083.19
+606349.89 798190.51
+606334.97 798193.05
+606275.6 798316.25
+606280.68 798346.42
+606306.08 798354.35
+606292.75 798395
+606287.16 798404.74
+606287.99 798429.01
+606282.27 798433.14
+606272.84 798467.66
+606255.49 798506.71
+606249.63 798531.68
+606253.06 798560.16
+606229.88 798571.59
+606203.21 798572.86
+606199.4 798566.51
+606173.37 798556.66
+606173.05 798582.07
+606140.03 798603.02
+606117.81 798645.57
+606089.1 798675.3
+606072.95 798693.72
+606044.05 798724.21
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606193.9 799263.83
+Region  1
+  82
+617533.9 804002.58
+617508.35 803965.47
+617469.94 803955.49
+617346.69 803838.82
+617324.53 803824.91
+617302.36 803809.1
+617327.03 803751.12
+617332.83 803730.81
+617170.55 803663.67
+617134.56 803674.7
+617080.35 803742.1
+617042.89 803769.39
+617023.28 803817
+616982.16 803860.6
+616974.26 803936.71
+616961.65 803998.34
+616960.25 804083.78
+616935.04 804170.63
+616855.2 804142.61
+616809.6 804137.35
+616770.13 804147.92
+616740.67 804164.59
+616707.87 804182.38
+616679.52 804197.95
+616642.83 804211.85
+616581.69 804237.97
+616479.4 804255.21
+616451.6 804281.89
+616438.54 804296.34
+616418.53 804311.91
+616398.75 804327.14
+616387.37 804335.59
+616376.64 804348.91
+616376.64 804357.37
+616372.74 804362.24
+616367.54 804365.82
+616362.67 804369.07
+616358.77 804374.27
+616354.54 804378.17
+616309.5 804426.64
+616394 804508.86
+616431.84 804562.03
+616450.5 804602.51
+616461.26 804628.24
+616469.32 804658.58
+616477.58 804732.12
+616481.61 804761.89
+616602.96 804736.54
+616668.44 804782.84
+616736.8 804830.46
+616744.29 804856.82
+616754.27 804869.49
+616734.3 804947.07
+616856.8 804940.92
+617076.08 804903.29
+617094.71 804937.21
+617135.8 804989.06
+617178.42 804963.71
+617199.93 804930.3
+617222.2 804843.12
+617251.2 804804.47
+617340.87 804735.92
+617456.46 804653.35
+617547.86 804624.93
+617580.12 804601.89
+617630.33 804531.39
+617666.82 804475.6
+617695.63 804433.34
+617712.34 804384.7
+617711.96 804317.86
+617710.23 804269.21
+617725.6 804221.96
+617748.46 804182.92
+617746.92 804117.23
+617728.29 804084.79
+617659.54 803985.44
+617618.42 803976.84
+617625.33 803992.59
+617576.16 804035.23
+617541.97 804036
+617530.45 804020.25
+617533.9 804002.58
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 617086.51 804375.3
+Region  1
+  62
+604479.93 794831.8
+604095.32 794222.95
+604064.84 794181
+604041.98 794209.61
+604054.68 794292.16
+604054.24 794368.98
+604032.84 794445.11
+603990.93 794541.63
+603964.89 794609.58
+603952.19 794711.18
+604016.96 794796.91
+604089.5 794832.21
+604124.27 794835.64
+604260.31 794838.56
+604288.89 794857.61
+604313.31 794882.35
+604313.22 794882.28
+604335.13 794923.87
+604355.5 794976.9
+604370.95 794998.82
+604412.58 795078.37
+604463.42 795136.19
+604598.32 795209.79
+604691.67 795201.85
+604784.38 795181.82
+604840.89 795157.37
+604861.53 795115.46
+604788.5 795112.92
+604712.62 795091.01
+604631.02 795042.4
+604645.31 795017.95
+604626.96 794967.64
+604604.89 794904.64
+604596 794852.56
+604733.5 794745.28
+604851.15 794652.38
+604881 794628.24
+604902.91 794612.68
+604921.96 794595.54
+604935.93 794584.42
+604948.32 794574.58
+604960.86 794564.58
+604977.37 794550.6
+605030.4 794555.05
+605016.74 794528.06
+605006.26 794510.28
+604999.91 794502.34
+604955.46 794458.84
+604914.97 794477.07
+604834.31 794518.66
+604757.78 794457.38
+604703.32 794418.15
+604634.1 794401.01
+604562.49 794474.23
+604497.71 794529.16
+604470.72 794571.71
+604472.15 794619.52
+604485.97 794666.05
+604498.99 794688.91
+604536.14 794733.36
+604564.4 794772.42
+604479.93 794831.8
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604173.96 794695.4
+Region  1
+  189
+599825.71 788435.97
+599762.82 788648.03
+599735.99 788767.33
+599740.43 788821.94
+599814.56 788866.79
+599890.88 788916.47
+599927.4 788948.22
+600079.3 789043.31
+600239.64 789098.24
+600487.24 789178.25
+600517.72 789096.96
+600522.17 789080.44
+600539.37 789082.62
+600582.29 789092.92
+600623.14 789097.79
+600662.08 789122.77
+600691.51 789131.02
+600726.43 789156.85
+600749.93 789184.36
+600782.53 789200.24
+600849.21 789228.39
+600879.26 789178.19
+600917.58 789132.26
+600968.17 789088.87
+600989.76 789092.68
+601018.34 789094.37
+601052.2 789096.07
+601077.81 789074.25
+601092.84 789066
+601109.65 789068.14
+601126.74 789081.44
+601188.34 789105.91
+601211.84 789006.42
+601222 788946.52
+601238.09 788945.88
+601303.17 788989.38
+601379.06 789041.77
+601426.68 789072.56
+601474.63 789107.17
+601485.1 789099.87
+601548.11 789027
+601589.7 788982.86
+601637.96 788934.28
+601756.71 788933.64
+601796.71 788903.77
+601854.81 788851.38
+601887.52 788807.57
+601934.19 788726.6
+601958.95 788676.08
+601968.48 788662.11
+602022.23 788751.79
+602069.72 788807.5
+602181.84 788893.6
+602295.19 788979.01
+602360.6 789029.21
+602400.61 789064.45
+602465.37 789079.39
+602571.42 789102.89
+602594.91 789089.87
+602636.82 789058.12
+602704.81 789000.93
+602814.67 788913.93
+602850.55 788883.1
+602891.19 788854.52
+602915.01 788863.73
+602971.52 788892.62
+603030.9 788632.62
+602676.22 788529.51
+602665.19 788467.69
+602657.49 788441.56
+602699.71 788377.73
+602725.11 788305.99
+602700.98 788296.78
+602677.49 788167.87
+602662.39 788130.41
+602694.14 788037.69
+602703.03 788008.51
+602753.2 787992.68
+602838.92 787939.66
+602888.13 787913.94
+602923.37 787893.94
+603001.79 787849.8
+602775.9 787753.63
+602644.78 787693.94
+602560 787649.8
+602568.71 787638.8
+602575.38 787626.42
+602592.21 787594.98
+602595.7 787584.5
+602641.1 787581.93
+602800.35 787575.79
+603127.69 787729.17
+603135.13 787760.36
+603182.75 787727.98
+603229.11 787670.2
+603262.13 787614.95
+603296.73 787558.79
+603335.78 787513.38
+603357.69 787474.68
+603391.66 787397.2
+603433.25 787300.02
+603552.95 787193.34
+603581.52 787196.2
+603605.65 787162.83
+603604.06 787153.62
+603662.16 787048.18
+603732.65 786987.22
+603792.66 786931.66
+603819.71 786882.29
+603820.34 786879.12
+603832.35 786844.31
+603808.92 786820.89
+603790.57 786821.52
+603776 786800.63
+603748.15 786786.07
+603721.55 786745.55
+603693.69 786737.32
+603650.65 786722.12
+603596.21 786708.82
+603563.93 786699.96
+603543.67 786681.6
+603505.68 786663.87
+603486.06 786660.7
+603477.19 786650.57
+603454.41 786642.34
+603418.97 786661.33
+603353.78 786673.34
+603272.13 786669.53
+603225.3 786685.35
+603205.04 786680.28
+603187.31 786665.72
+603142.37 786653.06
+603113.88 786642.29
+603089.83 786642.29
+603065.14 786640.39
+603027.79 786624.56
+602994.88 786619.49
+602934.74 786602.39
+602898.66 786601.12
+602875.87 786590.99
+602861.94 786575.8
+602739.77 786532.1
+602715.72 786528.3
+602701.15 786506.78
+602678.36 786494.12
+602606.19 786455.5
+602546.02 786451.05
+602481.88 786444.06
+602447.59 786431.36
+602420.92 786407.23
+602400.6 786390.72
+602376.18 786371.37
+602222.18 786485.36
+602018.32 786627.61
+601941.48 786684.13
+601892.48 786612.91
+601321.44 786462.75
+600805.86 786309.29
+600755.09 786298.08
+600683.77 786395.87
+600594.54 786555.2
+600590.8 786599.16
+600568.38 786643.74
+600473.23 786755.99
+600458.12 786799.13
+600467.15 786800.69
+601207.17 786885.06
+601022.17 787562.68
+601512.71 787615.02
+601425.08 787809.42
+600980.58 787757.7
+601008.92 787619.22
+600188.68 787552.79
+600182.33 787552.79
+600143.39 787596.98
+600111 787628.73
+600048.77 787689.9
+600017.01 787732.82
+599974.25 787755.68
+599947.36 787788.66
+599935.51 787826.97
+599931.06 787878
+599922.59 787910.59
+599888.3 788004.99
+599833.88 788122.02
+599819.27 788169.43
+599828.14 788222.67
+599830.26 788289.35
+599825.71 788435.97
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 601663.6 787800.87
+Region  1
+  75
+604834.35 795667.02
+604779.53 795657.81
+604719.88 795642.46
+604666.37 795631.93
+604614.26 795620.91
+604550.94 795610.92
+604502.38 795601.86
+604418.67 795633.69
+604350.69 795656.54
+604285.07 795637.35
+604243.97 795620.37
+604215.1 795610.67
+604214.4 795644.87
+604215.44 795675.24
+604226.91 795706.45
+604256.67 795732.41
+604283.9 795753.3
+604316.82 795776.72
+604327.59 795795.08
+604347.78 795826.79
+604364.28 795886.48
+604375.11 795921.68
+604385.24 795953.48
+604408.91 795986.98
+604445.11 796037.46
+604377.36 796086.2
+604282.24 796153.99
+604225.72 796193.68
+604173.81 796232.89
+604111.26 796272.9
+604093.48 796244.32
+604035.38 796228.13
+604016.33 796245.91
+604067.9 796417.63
+604179.4 796664.75
+604189.56 796681.26
+604206.03 796702.41
+604291.77 796774.81
+604474.23 796916.71
+604543.54 796886.67
+604609.11 796835.58
+604658.02 796761.23
+604699.25 796682.72
+604768.55 796639.73
+604867.02 796557.07
+604951.88 796478.33
+604971.18 796459.91
+605027.76 796374.82
+605078.44 796311.02
+605120.98 796265.84
+605166.16 796220.67
+605231.07 796169.79
+605357.83 796076.84
+605419.2 796039.54
+605481.97 796007.66
+605587.01 795964.79
+605579.99 795953.83
+605576.92 795949
+605476.93 795816.55
+605436.14 795767
+605353.59 795797.76
+605288.4 795820.54
+605258.48 795827.1
+605192.48 795801.89
+605124.49 795806.72
+605074.47 795808.48
+605042.03 795811.1
+605016.59 795810.67
+605016.59 795789.61
+605015.28 795753.21
+604997.29 795739.17
+604963.96 795714.61
+604931.5 795690.93
+604887.86 795680.62
+604834.35 795667.02
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604692.27 796185.13
+Region  1
+  74
+610955.11 808688.58
+610515.18 808691.97
+610474.64 808664.15
+610302.47 808737.43
+610302.47 808737.43
+610312.29 808749.58
+610329.22 808775.96
+610342.92 808811.59
+610349.43 808852.35
+610346.69 808903.05
+610323.73 808966.01
+610295.65 809007.24
+610255.58 809052.11
+610202.48 809101.78
+610168.41 809129.7
+610105 809190.08
+610048.14 809279.32
+609996.72 809357.23
+609998.85 809612.29
+610038.17 809665.92
+610060.56 809733.99
+610132.19 809788.39
+610197.48 809843.7
+610219.24 809843.7
+610249.74 809818.92
+610270.92 809803.81
+610293.59 809788.39
+610318.98 809772.98
+610345.27 809754.85
+610366.13 809741.25
+610386.07 809732.18
+610396.05 809738.53
+610464.05 809815.6
+610501.22 809852.77
+610535.68 809889.04
+610599.15 809852.77
+610582.02 809775.11
+610585.81 809759.93
+610606.68 809749.8
+610692.09 809747.15
+610704.78 809759.84
+610774.6 809744.42
+610834.44 809710.88
+610907.88 809703.62
+611046.61 809665.54
+611039.36 809635.62
+611076.53 809546.76
+611097.39 809486.01
+611097.39 809452.46
+611063.29 809330.17
+611045.25 809261.56
+611035.96 809208.72
+611002.18 809179.52
+611040.26 809076.15
+611064.74 809000.9
+611107.41 808989.02
+611128.29 808986.48
+611144.72 808964.32
+611168.73 808931.41
+611183.27 808916.86
+611189.61 808914.71
+611198.94 808935.61
+611223.03 808911.95
+611255.3 808901.18
+611281.25 808894.21
+611302.75 808876.49
+611335.03 808870.78
+611378.07 808871.39
+611419.28 808864.16
+611353.09 808799.79
+611257.15 808769.41
+611230.68 808746.29
+611184.44 808648.37
+610955.11 808688.58
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610617.98 809244.47
+Region  1
+  61
+604425.44 809400.5
+604446.39 809449.84
+604463.58 809528.28
+604479.49 809593.44
+604501.68 809625.69
+604623.47 809726.83
+604677.7 809776.15
+604716.77 809786.48
+604905.7 809771.55
+604902.95 809706.94
+604983.06 809611.48
+605099.44 809502.79
+605097.34 809461.38
+605157.61 809399.87
+605006.81 809298.14
+604963.1 809325.38
+604941.59 809333.61
+604929.57 809336.15
+604913.07 809293.14
+604900.41 809295.04
+604863.72 809324.16
+604837.15 809333.66
+604804.82 809290.02
+604774.41 809258.41
+604768.69 809236.27
+604779.42 809212.86
+604839.43 809083.15
+604834.08 809054.47
+604819.24 809010.66
+604793.09 808964.72
+604756.34 808925.14
+604743.62 808877.79
+604707.58 808894.69
+604666.58 808924.43
+604619.94 808954.12
+604610.04 808973.9
+604612.87 808990.16
+604621.35 809007.12
+604628.42 809021.26
+604617.82 809028.32
+604583.19 809036.1
+604525.23 809043.17
+604467.28 809050.23
+604450.32 809054.47
+604454.56 809092.64
+604453.97 809120.65
+604432.47 809135.21
+604411.58 809142.81
+604365.4 809171.93
+604324.88 809191.87
+604301.55 809143.82
+604277.52 809184.1
+604255.94 809220.06
+604226.22 809249.17
+604240.77 809237.81
+604211.09 809263.25
+604237.24 809270.32
+604286 809287.99
+604348.2 809315.55
+604393.74 809359.4
+604425.44 809400.5
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604695.71 809376.5
+Region  1
+  65
+610781.51 798002.88
+610349.98 798233.01
+610188.89 798320.38
+610210.12 798339.77
+610218.01 798346.74
+610254.87 798381.17
+610275.2 798400.58
+610316.15 798439.72
+610290.36 798463.07
+610258.05 798499.01
+610258.05 798529.96
+610261.54 798578.35
+610264.88 798624.15
+610265.34 798651.02
+610255.33 798688.34
+610234.39 798709.27
+610167.35 798731.11
+610176.3 798738.84
+610189.35 798744.91
+610201.18 798749.46
+610216.35 798755.83
+610231.51 798761.29
+610256.39 798763.41
+610290.67 798748.85
+610331.32 798730.95
+610355.89 798718.51
+610397.45 798766.14
+610421.15 798788.56
+610448.5 798812.72
+610500.48 798849.2
+610569.78 798878.83
+610594.61 798892.66
+610629.52 798930.41
+610671.01 798963.69
+610725.72 798989.23
+610779.06 799024.33
+610933.86 798792.93
+611054.01 798770.98
+611092.77 798638.76
+611114.66 798563.5
+611157.29 798416.92
+611177.57 798262.5
+611189.99 798181.88
+611194.9 798144.41
+611200.16 798091.07
+611212.47 798001.71
+611169.51 798000.32
+611135.88 798000.34
+611105.13 797998.74
+611060.01 797931.73
+611054.7 797924.12
+611008.97 797939.4
+610954.26 797934.59
+610895.94 797914.74
+610784.42 797846.47
+610660.37 797744.98
+610624.36 797800.2
+610553.37 797857.53
+610569.18 797875.43
+610586.34 797893.13
+610619.02 797927.72
+610638.02 797949.49
+610690.5 797956.47
+610752.99 797972.24
+610781.51 798002.88
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610738.65 798411.14
+Region  1
+  51
+604817.85 810463.99
+605681.3 810183.82
+605712.81 810174.65
+605781.56 810135.69
+605838.28 810109.33
+605885.78 810105.33
+605872.6 810084.71
+605849 810005.43
+605817.13 810005.93
+605781.5 809926.58
+605770.33 809893.93
+605748.92 809829.7
+605727.51 809801.32
+605704.61 809779.41
+605703.5 809752.05
+605660.05 809726.83
+605603.29 809657.63
+605593.58 809665.02
+605544.79 809612.74
+605512.07 809575.53
+605474.77 809544.38
+605452.63 809539.05
+605431.72 809537
+605403.84 809531.67
+605435.82 809497.64
+605455.09 809472.22
+605443.61 809468.12
+605422.29 809466.07
+605389.08 809461.97
+605252.15 809446.01
+605230.23 809454.82
+605204.81 809479.42
+605195.79 809517.55
+605169.34 809580.86
+605168.09 809436.23
+605099.44 809502.79
+604983.06 809611.48
+604902.95 809706.94
+604905.7 809771.55
+604716.77 809786.48
+604677.7 809776.15
+604701.28 809800.29
+604718.51 809829.8
+604720.27 809870.58
+604740.79 810201.3
+604741.06 810254.2
+604725.15 810271.66
+604683.06 810396.89
+604740.55 810460.02
+604779.56 810476.96
+604817.85 810463.99
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605220.85 809964.73
+Region  1
+  45
+605549.66 807841.92
+606147.21 807902.31
+606121.25 807948.6
+606209.33 807913.64
+606235.55 807880.4
+606264.53 807823.86
+606309.05 807753.19
+606357.82 807675.45
+606393.74 807618.6
+606402 807543.33
+606416.79 807476.33
+606422.88 807399.77
+606466.12 807327.5
+606492.62 807257.89
+606520.38 807190.18
+606532.35 807144.63
+606546.87 807108.56
+606578.45 807059.83
+606624.58 806992.11
+606671.35 806938.94
+606706.11 806894
+606729.48 806856.03
+606762.34 806812.99
+606729.84 806808.37
+606726.4 806783.58
+606703.67 806756.72
+605415.9 806621.76
+605164.2 806844.55
+605161.44 806882.53
+605151.8 806974.81
+605332.22 806994.78
+605309.5 807188.98
+605292.98 807285.95
+605279.9 807351.37
+605265.78 807414.35
+605262.34 807427.44
+605299.18 807436.03
+605292.98 807579.27
+605269.79 807825.66
+605289.4 807839.92
+605300.18 807844.04
+605315.73 807846.16
+605335.52 807848.98
+605544.71 807870.89
+605549.66 807841.92
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605884.83 807234.71
+Region  1
+  81
+607102.65 809940.33
+607128.72 809954.36
+607151.64 809969.83
+607177.42 809991.03
+607206.64 810012.23
+607219.82 810023.12
+607215.24 810028.84
+607193.47 810061.5
+607187.16 810072.96
+607176.85 810080.41
+607215.24 810170.36
+607182.01 810186.98
+607166.54 810195.57
+607149.92 810199.58
+607099.9 810409.31
+607178.56 810477.12
+607158.12 810694.35
+607381.84 810932.34
+607381.84 810932.34
+607414.21 810884.01
+607523.78 810777
+607577.09 810726.68
+607620.94 810659.42
+607670.77 810519.45
+607671.87 810507.44
+607687.94 810465.2
+607709.67 810396.7
+607737.36 810334.4
+607777.5 810231.95
+607782 810173.47
+607773 810132.63
+607746.7 810086.25
+607723.16 810051.64
+607683.71 809994.19
+607636.98 809925.31
+607582.3 809848.48
+607652.9 809802.1
+607683.36 809778.56
+607731.12 809738.41
+607763.86 809709.98
+607782.69 809681.32
+607817.99 809637.01
+607829.07 809616.94
+607796.54 809612.09
+607753.62 809610.02
+607707.24 809610.02
+607647.01 809610.02
+607610.33 809606.56
+607535.57 809579.56
+607462.88 809545.64
+607408.54 809511.35
+607238.25 809392.98
+606851.18 809107.72
+606840.15 808990.46
+606821.71 808990.28
+606617.94 809073.74
+606620.9 809090.32
+606626.01 809149.57
+606631.46 809169.19
+606641.14 809188.35
+606667.5 809242.77
+606678.67 809266.55
+606736.25 809390.02
+606767.77 809459.92
+606767.77 809476.53
+606631.41 809451.32
+606608.49 809446.74
+606590.73 809445.02
+606591.3 809457.48
+606597.03 809463.35
+606619.95 809482.26
+606617.08 809510.33
+606614.22 809569.35
+606622.24 809575.65
+606657.76 809606.59
+606672.95 809612.03
+606742.37 809924.13
+606799.42 809935.88
+606853.11 809946.9
+606862.51 809952.24
+607102.65 809940.33
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607236.37 809923.59
+Region  1
+  41
+609972.53 803028.68
+609959.17 802969.21
+609940.09 802904.69
+609917.78 802831.97
+609918.74 802815.32
+609946.12 802761.36
+609978.14 802714.61
+610007.6 802677.75
+610022.52 802652.74
+610029.67 802626.88
+610027.7 802604.13
+609977.96 802639.71
+609927.52 802668.29
+609888.82 802691.25
+609823.8 802727.37
+609794.32 802754.83
+609658.62 802802.5
+609634.05 802784.2
+609616.24 802750.49
+609428.65 802549.41
+609028.22 803703.43
+609043.15 803729.44
+609057.6 803749.67
+609071.08 803771.34
+609074.93 803792.05
+609066.26 803823.83
+609037.13 803905.9
+609079.51 803954.06
+609136.33 803928.06
+609209.53 803898.68
+609211.94 803938.65
+609216.03 803973.06
+609252.61 803957.86
+609533.88 803840.02
+609548.33 803856.88
+609943.25 803673.69
+609957.14 803519.81
+609965.13 803428.54
+609957.93 803161.96
+609971.39 803082.86
+609972.53 803028.68
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609538.86 803317.76
+Region  1
+  51
+600091.28 790263.68
+599995.06 790178.88
+599944.89 790155.39
+599892.18 790139.51
+599822.32 790137.6
+599779.45 790144.25
+599613.06 790200.77
+599507.63 790202.04
+599407.92 790165.84
+599385.06 790195.69
+599274.24 790308.43
+599182.15 790361.15
+599075.44 790407.51
+599010.67 790432.27
+598968.76 790457.04
+598898.28 790509.11
+598833.51 790550.38
+598787.17 790580.85
+598754.15 790612.6
+598717.32 790702.77
+598698.27 790731.98
+598683.03 790765
+598662.71 790810.72
+598639.85 790861.52
+598659.79 790892.25
+598700.37 790935.62
+598717.61 790959.52
+598764.59 791013.74
+598841.04 791099.14
+598837.56 791103.7
+598837.56 791109.6
+598921.79 791137.69
+599009.69 791206.81
+599055.87 791268.83
+599128.35 791262.92
+599221.99 791265.98
+599373.58 791304.67
+599532.49 791281.44
+599734 791185.06
+599998.08 791130.68
+599960.31 790995.89
+600647.19 790187.83
+600628.86 790142.07
+600621.84 790150.3
+600479.64 790246.25
+600418.67 790289.44
+600352.94 790315.76
+600302.13 790324.02
+600236.08 790322.11
+600166.86 790308.14
+600091.28 790263.68
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 599532.45 790707.5
+Region  1
+  24
+610092.97 795436.65
+610409.8 796630.57
+610600.74 796581.61
+611321.54 796387.43
+611356.52 796376.94
+610964.47 794905.01
+610957.01 794883.46
+610875.49 794905.34
+610875.4 794905.36
+610768.27 794934.12
+610681.61 794960.77
+610681.59 794960.78
+610681.54 794960.8
+610681.5 794960.81
+610681.47 794960.82
+610559.48 794998.34
+610558.47 794998.65
+610355.98 795337.29
+610288.59 795355.45
+610273.88 795359.41
+610158.17 795390.6
+610085.28 795410.24
+610086.66 795414.99
+610092.97 795436.65
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610721.55 795806.17
+Region  1
+  51
+609190.7 793604.19
+609155.14 793614.01
+609095.45 793615.91
+608981.78 793614.33
+608933.84 793613.07
+608918.28 793616.24
+608890.02 793633.7
+608750 793707.06
+608741.43 793720.4
+608741.74 793801.35
+608768.58 793934.25
+608810.18 794003.74
+608977.68 794165.54
+609088.82 794233.81
+609111.21 794246.99
+609197.32 794308.21
+609215.42 794353.29
+609218.88 794508.23
+609262.89 794559.56
+609306.04 794580.66
+609436.42 794610.21
+609476.75 794631.31
+609513.8 794681.03
+609545.7 794643.04
+609578.99 794602.24
+609601.51 794590.98
+609650.79 794590.06
+609649.64 794456.25
+609644.42 794335.75
+609644.42 794310.98
+609603.73 794293.52
+609601.83 794188.43
+609581.06 794162.23
+609561.06 794132.71
+609602.97 794094.92
+609622.65 794074.6
+609564.37 794005.86
+609557.19 793978.07
+609553.06 793923.14
+609570.53 793871.38
+609595.92 793835.78
+609610.53 793815.14
+609635.31 793774.8
+609637.39 793708.62
+609606.27 793659.94
+609550.17 793586.26
+609544.54 793576.58
+609530.21 793561.73
+609499.47 793546.36
+609406.6 793522.59
+609190.7 793604.19
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609269.26 794021.25
+Region  1
+  34
+604253.55 794189.25
+604384.25 794168.93
+604523.12 794145.11
+604538.37 794124.47
+604547.26 794081.28
+604533.92 794044.44
+604477.4 793909.17
+604467.71 793838.5
+604453.91 793793.43
+604431.68 793758.18
+604417.07 793752.46
+604377.06 793740.08
+604378.01 793697.53
+604369.28 793653.84
+604359.44 793630.97
+604344.2 793623.35
+604320.38 793616.68
+604314.5 793590.78
+604329.43 793565.37
+604356.27 793534.43
+604372.13 793500.73
+604372.6 793465.94
+604358.63 793437.37
+604324.02 793413.87
+604138.41 793397.84
+604100.63 793378.15
+604003.93 793443.41
+603827.69 793664.12
+603797.53 793742.87
+603838.15 794046.38
+604064.84 794181
+604095.32 794222.95
+604113.1 794218.5
+604253.55 794189.25
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604154.11 793827.73
+Region  1
+  141
+613793.24 792410.3
+613604.41 792354.73
+613505 792234.17
+613472.17 792217.95
+613443.96 792201.31
+613375.57 792177.47
+613350.91 792156.74
+613329.76 792148
+613270.39 792136.58
+613222.45 792094.27
+613216.24 792063.81
+613198.63 792034.06
+613148.71 792021.93
+613100.22 792016.59
+613065.29 792003.89
+613023.38 791958.8
+612950.36 791942.29
+612919.88 791911.18
+612811.93 791874.35
+612732.55 791829.9
+612617.62 791720.68
+612537.95 791667.66
+612478.9 791621.94
+612394.12 791600.67
+612303.95 791557.49
+612270.3 791516.85
+612169.97 791454.62
+612049.1 791434.47
+611854.16 791436.37
+611695.41 791642.09
+611747.8 791609.07
+611765.26 791602.72
+611799.55 791611.29
+611811.93 791645.28
+611781.13 791715.16
+611790.34 791793.26
+611843.04 791837.73
+611918.29 791957.45
+611978.3 791896.48
+612025.6 792038.73
+611887.17 792040.63
+611941.15 792285.25
+611983.89 792382.57
+611995.49 792462.12
+612019.3 792538
+612005.01 792589.12
+611958.79 792637.86
+611920.69 792679.78
+611903.86 792711.84
+611877.98 792794.87
+611861.78 792825.67
+611841.46 792851.39
+611849.72 792871.08
+611875.73 792921.82
+611912.24 792924.04
+612008.13 792990.72
+612028.61 793030.24
+612035.91 793107.08
+612043.05 793200.9
+612047.35 793237.25
+612061 793274.71
+612101.64 793309
+612136.88 793314.08
+612279.24 793286.29
+612346.55 793277.09
+612414.18 793298.68
+612483.82 793344.23
+612576.54 793402.02
+612630.05 793435.51
+612692.29 793449.16
+612746.58 793462.18
+612792.79 793490.59
+612825.49 793560.45
+612825.33 793677.45
+612852.22 793719.62
+612890.3 793750.01
+612949.53 793780.78
+613005.18 793808.73
+613061.38 793835.57
+613147.26 793857.04
+613217.39 793877.55
+613262.23 793954.84
+613278.2 794048.34
+613298.32 794121.58
+613339.92 794188.84
+613403.4 794245.27
+613494.11 794272.7
+613682.62 794255.45
+613703.42 794248.37
+613789.27 794248.37
+613863.19 794250.04
+613885.76 794240.74
+613904.34 794219.06
+613937.09 794138.97
+613962.75 794102.68
+614005.43 794074.57
+614045.23 794001.09
+614044.1 793876.07
+614104.9 793762.12
+614140.01 793315.25
+614505.35 793007.99
+614490.36 793005.28
+614480.66 792979.67
+614469.97 792964.51
+614436.9 792953.44
+614399.07 792927.89
+614393.02 792925.71
+614345.06 792865.9
+614304.04 792816.67
+614299.19 792782.28
+614299.81 792775.82
+614291.61 792758.17
+614272.15 792744.8
+614238.58 792714.96
+614232.78 792706.06
+614225.82 792681.57
+614220.94 792673.97
+614209.32 792662.35
+614195.75 792651.29
+614171.88 792633.02
+614167.32 792629.6
+614157.25 792623.13
+614129.9 792608.21
+614114.86 792605.85
+614103.49 792600.4
+614099.62 792596.53
+614093.17 792587.5
+614084.85 792568.3
+614063.22 792542.07
+614040.34 792535.98
+614022.14 792519.88
+614001.13 792501.61
+613967.81 792498.37
+613947.97 792492.59
+613928.82 792483.76
+613882.89 792481.08
+613850.7 792461.81
+613839.14 792454.85
+613826.12 792431.9
+613818.66 792425.56
+613793.24 792410.3
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613056.29 792860.51
+Region  1
+  115
+607102.65 809940.33
+606862.51 809952.24
+606285.1 809983.3
+606259.89 809986.16
+606255.59 810021.4
+606235.55 810063.29
+606202.88 810092.44
+606174.24 810097.03
+606088.7 810097.9
+605937.34 810100.75
+605885.78 810105.33
+605838.28 810109.33
+605781.56 810135.69
+605712.81 810174.65
+605857.51 810793.14
+605817.12 810799.73
+605856.65 811009.42
+605766.97 811025.99
+605752.43 811033.5
+605792.98 811081.23
+605803.24 811164.38
+605790.66 811216.96
+605829.67 811398.65
+605828.12 811485.33
+605811.18 811518.7
+605770.63 811672.68
+605777.82 811695.77
+605828.89 811789.96
+605867.12 811950.37
+605876.87 811999.13
+605876.87 812037.11
+605881.74 812052.75
+605886.36 812104.08
+605899.2 812116.4
+605911 812112.8
+606003.9 812071.74
+606009.03 812064.56
+606040.34 812001.43
+606098.34 811974.74
+606136.32 811968.58
+606184.31 811989.9
+606241.8 812026.86
+606401.42 812088.96
+606487.65 812115.65
+606562.84 812203.68
+606611.08 812246.8
+606624.43 812251.93
+606677.81 812249.87
+606752.23 812260.65
+606779.17 812281.93
+606823.83 812298.86
+606847.67 812323.94
+606877.68 812341.87
+606885.11 812343.92
+606892.61 812344.05
+606930.49 812341.13
+606939.52 812337.44
+606959.98 812320.52
+606983.75 812295.85
+607004.09 812281.49
+607025.39 812275.96
+607044.38 812285.98
+607051.9 812249.06
+607056.88 812215.43
+607053.14 812169.35
+607042.55 812133.85
+607020.88 812078.96
+607045.64 812081.2
+607028.5 812025.95
+607050.09 811997.38
+607040.88 811912
+607006.27 811784.04
+606996.59 811684.79
+607078.51 811553.68
+607102.95 811521.64
+607138.83 811482.27
+607159.79 811465.76
+607176.61 811444.17
+607188.37 811422.61
+607193.45 811409.91
+607215.67 811424.52
+607229.71 811401.21
+607249.01 811375.05
+607273.3 811340.8
+607288.25 811319.63
+607302.57 811299.7
+607312.53 811283.51
+607321.25 811271.05
+607328.72 811261.09
+607338.07 811246.77
+607346.16 811233.69
+607357.37 811213.76
+607367.96 811196.32
+607390.38 811163.94
+607407.19 811132.18
+607439.39 811053.31
+607437.89 811012.46
+607381.84 810932.34
+607158.12 810694.35
+607178.56 810477.12
+607099.9 810409.31
+607149.92 810199.58
+607166.54 810195.57
+607182.01 810186.98
+607215.24 810170.36
+607176.85 810080.41
+607187.16 810072.96
+607193.47 810061.5
+607215.24 810028.84
+607219.82 810023.12
+607206.64 810012.23
+607177.42 809991.03
+607151.64 809969.83
+607128.72 809954.36
+607102.65 809940.33
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606525.69 811049.13
+Region  1
+  39
+606967.62 792921.42
+607013.31 792868.03
+607053.65 792825.17
+607093.34 792775
+607109.22 792783.89
+607121.28 792790.56
+607133.35 792797.86
+607144.78 792804.53
+607155.25 792772.46
+607161.96 792744.65
+607167.68 792713.54
+607182.6 792666.54
+607128.31 792634.79
+607084.81 792610.98
+607036.87 792584.27
+607007.02 792567.76
+606941.3 792530.93
+606908.28 792512.52
+606874.95 792494.42
+606845.42 792481.4
+606813.99 792540.46
+606788.59 792525.53
+606764.78 792511.83
+606743.82 792500.72
+606726.04 792490.56
+606716.52 792485.8
+606708.26 792481.99
+606694.93 792511.83
+606678.62 792547.53
+606641.79 792617.7
+606601.47 792724.11
+606584.33 792757.48
+606506.54 792862.58
+606817.44 793218.98
+606929.51 793063.99
+606968.88 793014.18
+607017.46 792950.32
+606973.97 792934.76
+606967.62 792921.42
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606829.86 792805.92
+Region  1
+  36
+614620.59 803918.46
+614733.44 803266.83
+614706.55 803257.2
+614658.42 803235.29
+614630.54 803223.34
+614646.74 803192.04
+614635.85 803192.8
+614617.76 803176.37
+614603.15 803126.58
+614594.19 803079.78
+614570.96 803097.7
+614557.35 803107.66
+614513.2 803139.53
+614501.97 803154.38
+614472.04 803192.64
+614446.82 803226.16
+614417.77 803211.4
+614402.84 803247.25
+614393.76 803279.85
+614375.4 803320.19
+614359.8 803351.49
+614339.26 803393.78
+614314.24 803440.29
+614285.61 803496.51
+614256.61 803555.97
+614220.74 803621.37
+614205.12 803651.39
+614190.86 803678.22
+614180.47 803688.62
+614172.74 803695.63
+614159.93 803708.19
+614138.53 803729.13
+614122.18 803746.88
+614120.19 803807.62
+614118.36 803873.52
+614620.59 803918.46
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 614462.53 803571.49
+Region  1
+  29
+605681.3 810183.82
+604817.85 810463.99
+604779.56 810476.96
+604807.79 810488.77
+604845 810509.52
+604876.3 810521.32
+604901.97 810526.46
+604978.96 810530.56
+605036.96 810565.46
+605162.19 810674.79
+605226.09 810709.42
+605401.63 810781.28
+605434.99 810792.57
+605457.57 810794.63
+605581.01 810786.15
+605605.65 810798.46
+605665.7 810868.27
+605695.21 810952.18
+605736.78 811014.28
+605740.62 811021.18
+605745.24 811026.83
+605749.86 811030.42
+605752.43 811033.5
+605766.97 811025.99
+605856.65 811009.42
+605817.12 810799.73
+605857.51 810793.14
+605712.81 810174.65
+605681.3 810183.82
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605466.81 810552.02
+Region  1
+  39
+611858.41 802723.22
+611768.07 802665.93
+611720.98 802633.33
+611741.35 802607.97
+611750.86 802581.71
+611618.64 802536.88
+611580.6 802520.58
+611559.32 802505.19
+611543.47 802491.15
+611524.9 802459
+611430.26 802468.05
+611413.22 802593.61
+611400.19 802733.13
+611393.74 802793.99
+611392.22 802817.89
+611395.89 802840.05
+611408.02 802923.55
+611449.88 802986.8
+611488.8 803036.03
+611552.61 803124.72
+611577.91 803163.47
+611589.76 803180.76
+611602.89 803203.18
+611743.75 803112.55
+611836.91 803049.44
+611904.38 803010.95
+611916.61 803005.06
+611950.57 802967.93
+611971.85 802976.99
+611992.69 802985.07
+612014.43 802994.12
+612020.01 802977.14
+612042.04 802919.48
+612052.45 802903.18
+612137.13 802816.69
+612039.32 802810.35
+611997.2 802801.75
+611918.65 802766.39
+611858.41 802723.22
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611670.59 802834
+Region  1
+  71
+610955.11 808688.58
+611184.44 808648.37
+611230.68 808746.29
+611257.15 808769.41
+611353.09 808799.79
+611419.28 808864.16
+611499.07 808939.42
+611502.7 808883.21
+611504.51 808838.78
+611509.95 808796.16
+611513.43 808767.58
+611516.81 808705.66
+611520.83 808685.54
+611499.07 808665.6
+611490.91 808645.65
+611478.46 808608.81
+611416.1 808494.69
+611387.99 808438.48
+611386.18 808401.3
+611341.75 808318.79
+611378.24 808301.37
+611369.63 808266.92
+611379.31 808197.67
+611406.64 808158.28
+611451.86 808087.72
+611470.74 808076.3
+611514.96 808070.33
+611547.26 808072.82
+611578.06 808062.38
+611594.46 808070.33
+611611.85 808111.08
+611662.03 808169.71
+611702.78 808181.14
+611717.28 808151.33
+611718.53 808136.78
+611715.98 808114.01
+611706.47 808098.83
+611709.61 808070.36
+611741.04 808043.01
+611777.31 807985.86
+611737.06 808006.24
+611679.92 808024.12
+611642.16 808016.17
+611606.23 808006.87
+611557.48 807996.78
+611513.14 807977.82
+611461.04 807959.29
+611416.82 807935.44
+611369.4 807908.36
+611218.84 807775.69
+611065.18 807631.35
+611036.58 807590.85
+610916.34 807540.67
+610859.94 807545.39
+610799.8 807595.6
+610763.14 807625.89
+610737.39 807652.72
+610729.42 807689.38
+610717.73 807726.04
+610711.89 807739.85
+610665.92 807751.13
+610608.28 807758.98
+610550.93 807790.34
+610210.72 808551.4
+610196.68 808585.79
+610213.78 808611.14
+610252.46 808663.64
+610302.47 808737.43
+610474.64 808664.15
+610515.18 808691.97
+610955.11 808688.58
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610917.13 808237.38
+Region  1
+  33
+604307.63 789681.07
+603963.27 789497.35
+603842.31 789431.95
+603856.91 789511.96
+603797.22 789484.97
+603656.45 790021.88
+603653.82 790031.88
+603963.03 790207.59
+603989.7 790377.14
+604015.07 790481.91
+604055.08 790591.45
+604092.07 790671.94
+604131.91 790741.31
+604157.31 790733.05
+604193.19 790748.3
+604242.09 790748.3
+604271.3 790718.45
+604845.98 791040.7
+604867.85 790993.31
+604877.38 790946.6
+604890.71 790874.52
+604907.84 790803.76
+604910.38 790725.64
+604884.53 790666.13
+604861.67 790620.73
+604826.84 790480.81
+604804.83 790387.29
+604784.83 790244.06
+604791.19 790227.86
+604792.78 790151.62
+604810.88 790026.84
+604820.4 789957.34
+604307.63 789681.07
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604324.82 790213.98
+Region  1
+  22
+606048.37 797132.45
+605890.43 796943.85
+605836.78 796990.21
+605721.52 797094.08
+605625 797192.51
+605573.89 797282.05
+605457.67 797442.05
+605473.58 797454.06
+605503.11 797475.97
+605551.37 797508.67
+605605.98 797542.36
+605659.63 797556.96
+605724.4 797551.88
+605782.18 797530.65
+605849.49 797506.2
+605922.84 797479.53
+605977.76 797435.06
+605991.73 797393.15
+606001.57 797322.96
+606046.02 797219.46
+606049.01 797139.44
+606048.37 797132.45
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605788.41 797290.2
+Region  1
+  48
+609055.88 808985.64
+608966.38 809012.11
+608868.35 809017.38
+608802.99 809023.18
+608740.8 809042.15
+608679.13 809081.15
+608644.88 809111.2
+608596.65 809150.98
+608536.04 809195.25
+608618.79 809289.07
+608953.7 809762.6
+608966.35 809770.5
+609030.7 809642.52
+609440.95 809996.32
+609467.82 809942.04
+609483.1 809908.32
+609495.75 809887.76
+609525.26 809867.21
+609618.01 809825.05
+609704.97 809749.16
+609759.05 809700.21
+609818.01 809649.23
+609865.95 809614.76
+609925.91 809532.26
+609948.78 809524.26
+609961.41 809491.99
+609968.95 809434.42
+609981.56 809389.5
+609996.72 809357.23
+609989.89 809260.37
+609982.77 809177.31
+609980.03 809108.47
+609993.56 809027.74
+610018.61 808949.08
+610046.99 808868.72
+610074.79 808789.63
+610027.88 808734.29
+609979.39 808846.56
+609931.43 808879.23
+609808.62 808932.46
+609756.97 808909.8
+609706.64 808868.99
+609530.08 808678.2
+609450.23 808747
+609379.07 808801.81
+609314.77 808839.23
+609231.5 808888.78
+609055.88 808985.64
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609371.74 809310.12
+Region  1
+  37
+612356.75 804434.09
+611839.79 804400.28
+611826.05 804383.47
+611806.13 804396.81
+611781.1 804413.49
+611769.53 804421.93
+611756.75 804430.85
+611741.81 804441.45
+611709.26 804412.53
+611605.13 804462.67
+611568.97 804480.02
+611774.54 804912.3
+611816.11 804920.29
+611839.55 804926.15
+611855.54 804930.42
+611869.4 804932.55
+611882.19 804936.81
+611896.57 804945.34
+611902.44 804935.75
+611957.32 804961.32
+611969.81 804934.62
+612060.73 804800.83
+612071.82 804784.91
+612077.61 804705.82
+612179.37 804712.57
+612263.04 804940.9
+612296.55 804950.28
+612371.78 804967.65
+612386.73 804890.97
+612399.6 804829.51
+612413.58 804792.38
+612474.15 804736.89
+612457.28 804715.67
+612417.38 804646.14
+612390.86 804601.06
+612380.14 804510.31
+612356.75 804434.09
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612024.14 804647.38
+Region  1
+  34
+607597.08 797900.34
+606753.8 797924.82
+606697.81 797966.19
+606648.14 798056.7
+606538.89 798070.84
+606562.66 798223.29
+606543.55 798256.52
+606536.54 798268.22
+606529.54 798283.15
+606599.39 798321.25
+606652.73 798348.55
+606747.34 798393.64
+606750.52 798451.42
+606874.62 798425.39
+607017.94 798417.6
+607302.64 798414.81
+607299.62 798246.35
+607294.85 798135.07
+607329.06 798134.21
+607378.86 798135.07
+607384.92 798116.02
+607390.77 798099.8
+607399.86 798062.56
+607452.69 798059.53
+607508.55 798053.9
+607653.6 798091.57
+607657.5 798078.58
+607666.16 798042.64
+607677.85 797979.85
+607681.52 797968.75
+607684.34 797961.15
+607690.83 797945.13
+607694.73 797935.61
+607597.08 797900.34
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607039.26 798143.64
+Region  1
+  72
+608286.4 794218.34
+608315.19 794247.59
+608314.14 794258.81
+608355.83 794298.39
+608405 794339.42
+608510.73 794394.98
+608526.6 794434.03
+608533.59 794454.67
+608545.71 794490.52
+608588.16 794666.94
+608598.27 794707.01
+608613.67 794765.22
+608685.84 794747.23
+608751.26 794731.38
+608764.59 794727.57
+608775.39 794764.82
+608788.3 794805.25
+608791.81 794819.05
+608810.95 794807.15
+608844.61 794746.17
+608883.14 794709.55
+608914.47 794695.39
+608964.42 794679.72
+609021.79 794666.58
+609095.66 794643.06
+609068.99 794586.55
+609053.75 794586.55
+608978.51 794481.48
+608981.68 794471.64
+608986.44 794461.48
+608993.11 794438.91
+609002.45 794415.1
+609017.69 794364.3
+609033.89 794309.36
+609045.16 794271.76
+609086.75 794257.47
+609111.21 794246.99
+609088.82 794233.81
+608977.68 794165.54
+608810.18 794003.74
+608768.58 793934.25
+608741.74 793801.35
+608741.43 793720.4
+608730.95 793717.54
+608725.24 793716.59
+608714.44 793712.46
+608695.71 793707.06
+608680.47 793703.25
+608667.45 793699.13
+608647.38 793755.57
+608631.08 793753.03
+608518.89 793702.24
+608477.4 793628.64
+608455.72 793562.76
+608084.45 793486.87
+608065.3 793563.45
+608047.94 793625.04
+608019.04 793689.28
+607962.63 793777.83
+607912.68 793861.22
+607996.61 793906.02
+608005.71 793900.94
+608101.6 793899.45
+608089.11 793928.87
+608044.24 793943.27
+608022.86 794003.76
+608007.84 794042.5
+608074.51 794079.33
+608157.07 794124.43
+608201.31 794148.77
+608238.14 794171.35
+608286.4 794218.34
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608533.32 794106.87
+Region  1
+  67
+610400.36 793003.22
+610398.31 793060.84
+610364.65 793157.99
+610348.46 793159.58
+610324.33 793167.84
+610295.89 793207.77
+610267.7 793269.18
+610240.71 793327.28
+610215.31 793338.39
+610189.27 793334.89
+610166.73 793322.51
+610013.07 793317.66
+609910.84 793322.16
+609924.49 793329.47
+609945.76 793342.11
+610047.36 793417.36
+610059.89 793441.93
+610105.14 793506.52
+610152.13 793583.36
+610164.51 793624.96
+610256.27 793683.7
+610272.64 793661.6
+610295.96 793630.04
+610322 793621.78
+610345.42 793618.57
+610387.4 793652.92
+610542.66 793648.79
+610603.62 793646.9
+610669.98 793645.31
+610755.12 793644.35
+610767.19 793662.13
+610760.84 793694.2
+610740.2 793724.05
+610708.45 793806.6
+610710.51 793868.98
+610714.96 793957.57
+610740.04 794004.88
+610807.67 793951.22
+610901.33 793884.54
+610930.05 793858.15
+610951.64 793822.17
+610957.35 793810.1
+610965.4 793790.42
+610968.07 793766.72
+610939.67 793736.41
+610961.18 793708.26
+610937.88 793653.88
+610949.37 793626.51
+610957.33 793563.41
+610949.54 793535.29
+610958.01 793497.98
+610985.7 793442.21
+610984.16 793404.51
+610953.57 793352.74
+610915.5 793289.27
+610914.53 793239.46
+610913.76 793179.07
+610920.68 793142.15
+610778.82 792942.88
+610747.07 792937.8
+610721.67 792933.04
+610662.93 792919.08
+610609.59 792915.9
+610557.84 792922.57
+610513.71 792938.13
+610467.67 792960.99
+610400.36 793003.22
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610588.33 793393.03
+Region  1
+  66
+606929.51 793063.99
+607615.44 793398.53
+607624.58 793361.16
+607648.08 793343.06
+607751.58 793296.39
+607772.54 793270.95
+607774.12 793249.68
+607759.84 793171.54
+607764.6 793138.84
+607728.73 793101.37
+607746.72 793078.52
+607755.61 793046.45
+607719.1 793019.46
+607876.65 792872.58
+607935.51 792819.26
+607978.69 792781.16
+608029.49 792735.12
+608072.35 792677.66
+608103.92 792633.38
+608085.13 792564.85
+608071.16 792528.34
+608060.68 792521.98
+608059.1 792516.59
+608049.57 792511.51
+608039.73 792496.27
+608034.97 792472.45
+608014.96 792443.88
+607987.34 792426.73
+607953.05 792419.11
+607941.62 792419.11
+607913.02 792442.27
+607846.98 792402.26
+607826.98 792414.8
+607817.43 792448.93
+607787.9 792454.65
+607734.25 792494.02
+607653.28 792524.18
+607613.6 792502.28
+607600.9 792511.17
+607534.86 792538.47
+607528.42 792592.76
+607525.18 792654.46
+607517.24 792710.35
+607446.44 792707.17
+607409.29 792706.22
+607361.35 792731.94
+607321.66 792724.95
+607288.64 792708.12
+607263.56 792693.84
+607217.53 792672.58
+607182.6 792666.54
+607167.68 792713.54
+607161.96 792744.65
+607155.25 792772.46
+607144.78 792804.53
+607133.35 792797.86
+607121.28 792790.56
+607109.22 792783.89
+607093.34 792775
+607053.65 792825.17
+607013.31 792868.03
+606967.62 792921.42
+606973.97 792934.76
+607017.46 792950.32
+606968.88 793014.18
+606929.51 793063.99
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607538.49 792893.99
+Region  1
+  49
+609879.3 801068.67
+609836.11 800929.28
+609808.55 800830.54
+609813.63 800768.39
+609838.89 800708
+609808.15 800713.5
+609767.09 800715.8
+609748.51 800711.9
+609719.15 800695.15
+609682.44 800666.25
+609630.83 800659.6
+609524.51 800659.71
+609495.72 800632.98
+609433.32 800582.28
+609409.12 800561.03
+609385.62 800538.8
+609347.54 800496.82
+609313.13 800447.28
+609251.3 800512.74
+609206 800588.07
+609142.8 800716.42
+609143.27 800822.63
+609109.89 800901.22
+609069.74 801005.82
+609074.23 801055.84
+609082.93 801083.25
+609065.27 801098.16
+609016.45 801068.54
+608984.98 801056.18
+608952.95 801059.02
+608935.17 801064.1
+608953.58 801106.64
+608925.64 801132.68
+608907.23 801148.55
+608934.53 801182.21
+608996.76 801256.5
+609085.66 801293.33
+609217.86 801333.94
+609305.37 801363.3
+609481.98 801424.2
+609545.37 801454.77
+609607.98 801510.8
+609735.1 801674.65
+609739.85 801657.67
+609829.31 801393.96
+609871.58 801275.63
+609892.36 801193.37
+609892.99 801129.65
+609879.3 801068.67
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609467.76 801046.44
+Region  1
+  77
+605601.54 793714.4
+605578.68 793690.58
+605524.06 793631.52
+605446.1 793548.82
+605410.53 793507.54
+605361.94 793454.52
+605345.43 793438.64
+605315.58 793459.91
+605286.68 793489.76
+605194.07 793571.17
+605122.31 793640.84
+605076.59 793636.19
+605054.58 793653.33
+605011.39 793649.73
+604975.62 793667.09
+604897.09 793818.59
+604864.27 793878.72
+604857.28 794007.96
+604871.67 794047.76
+604909.14 794072.52
+604973.69 794055.37
+605007.56 794049.02
+605049.68 794036.54
+605100.26 794029.98
+605159.52 794027.89
+605322.08 794031.44
+605366.32 794053.24
+605423.47 794095.78
+605469.4 794131.13
+605496.59 794150.94
+605533.42 794176.53
+605567.29 794201.72
+605597.77 794226.27
+605638.41 794257.17
+605669.11 794276.84
+605698.95 794298.01
+605718.64 794300.97
+605736.2 794301.6
+605787.83 794266.06
+605836.54 794230.13
+605877.39 794202.61
+605929.25 794165.99
+605950.64 794142.23
+605946.44 794095.82
+605947.82 794066.07
+605951.31 794050.19
+605955.33 794034.19
+605959.46 794017.68
+605964.54 794002.12
+605972.48 793986.56
+605979.46 793973.22
+605987.72 793959.25
+606010.26 793934.49
+606148.48 793837.19
+606183.52 793804.02
+606216.13 793752.72
+606237.49 793689.02
+606244.57 793623.67
+606220.71 793558.56
+606188.67 793511.26
+606132.42 793453.86
+606094.66 793421.82
+606050.04 793383.68
+606008.08 793351.26
+605960.79 793313.89
+605943.63 793335.24
+605913.5 793377.58
+605869.25 793437.84
+605836.69 793480.61
+605846.85 793558.41
+605867.49 793733
+605803.98 793776.19
+605767.46 793756.82
+605704.59 793743.48
+605646.95 793734.72
+605616.46 793734.08
+605601.54 793714.4
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605581.82 793826.98
+Region  1
+  28
+608678.25 799275.24
+608721.14 799321.55
+608767.94 799408.31
+608781.83 799456.81
+608791.58 799533.82
+608790.37 799614
+608804.99 799691.02
+608840.32 799782.88
+608865.67 799820.9
+608889.61 799866.78
+608921.78 799930.63
+608953.96 800000.82
+608987.59 800037.38
+609072.4 800120.73
+609140.64 799768.32
+609168.17 799629.15
+609181.82 799557.5
+609198.65 799472.44
+609215 799391.25
+609280.53 799126.82
+608765.28 799110.24
+608745.29 799107.81
+608641.47 799105.37
+608605.89 799104.39
+608603.94 799206.27
+608603.19 799223.09
+608634.38 799241.12
+608678.25 799275.24
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608973.15 799478.78
+Region  1
+  50
+611860.02 800177.69
+611848.77 800056.11
+611842.57 800017.33
+611837.48 799976.62
+611884.76 799882.05
+611902.55 799840.85
+611987.74 799803.73
+611997.12 799781.84
+611991.06 799762.18
+611983.82 799735.92
+611978.72 799703.65
+611974.26 799686.76
+611963.31 799680.12
+611939.48 799669.18
+611899.23 799646.9
+611813.45 799599.82
+611808.37 799585.36
+611702.07 799564.25
+611662.79 799564.14
+611630.75 799598.13
+611613.16 799626.66
+611604.18 799652.84
+611597.14 799700.13
+611572.72 799739.81
+611480.5 799778.11
+611452.36 799806.63
+611426.95 799858.31
+611409.56 799899.91
+611402.53 799915.15
+611391.98 799932.34
+611392.17 800023.13
+611393.54 800067.53
+611396.27 800121.85
+611400.38 800210.76
+611406.24 800273.67
+611414.44 800349.02
+611423.05 800439.43
+611757.07 800542.37
+611756.65 800528.88
+611747.01 800464.18
+611786.62 800440.08
+611815.02 800422.86
+611810.72 800390.57
+611807.27 800342.79
+611831.38 800328.58
+611857.21 800315.24
+611874.86 800304.9
+611870.56 800264.87
+611866.05 800228.49
+611860.02 800177.69
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611659.44 800043.55
+Region  1
+  126
+606043.81 794756.25
+605960.2 794651.85
+605951.73 794533.44
+606044.86 794439.48
+606088.46 794395.46
+606092.9 794342.97
+606055.57 794266.73
+606017.56 794186.97
+606002.96 794158.05
+606001.05 794132.34
+606000.73 794105.98
+606031.53 793991.64
+606040.74 793983.7
+606010.26 793934.49
+605987.72 793959.25
+605979.46 793973.22
+605972.48 793986.56
+605964.54 794002.12
+605959.46 794017.68
+605955.33 794034.19
+605951.31 794050.19
+605947.82 794066.07
+605946.44 794095.82
+605950.64 794142.23
+605929.25 794165.99
+605877.39 794202.61
+605836.54 794230.13
+605787.83 794266.06
+605736.2 794301.6
+605718.64 794300.97
+605698.95 794298.01
+605669.11 794276.84
+605638.41 794257.17
+605597.77 794226.27
+605567.29 794201.72
+605533.42 794176.53
+605496.59 794150.94
+605469.4 794131.13
+605423.47 794095.78
+605366.32 794053.24
+605358.91 794068.48
+605351.5 794079.66
+605349.81 794106.97
+605356.15 794129.85
+605363.77 794152.07
+605380.82 794177.39
+605398.49 794198.42
+605363.14 794183.61
+605333.93 794179.16
+605308.11 794179.37
+605400.59 794320.49
+605440.6 794408.32
+605435.31 794415.1
+605420.49 794395.86
+605335.82 794455.12
+605328.23 794490.89
+605301.22 794523.39
+605278.4 794532.56
+605247.22 794531.33
+605215.84 794522.78
+605200.96 794508.31
+605178.67 794483.14
+605131.84 794420.99
+605129.3 794430.2
+605120.9 794469.95
+605039.29 794479.16
+604999.91 794502.34
+605006.26 794510.28
+605016.74 794528.06
+605030.4 794555.05
+604977.37 794550.6
+604960.86 794564.58
+604948.32 794574.58
+604935.93 794584.42
+604921.96 794595.54
+604902.91 794612.68
+604881 794628.24
+604851.15 794652.38
+604875.25 794665.02
+604917.38 794678.38
+604950.26 794694.82
+604969.78 794707.15
+604982.12 794718.46
+605001.64 794733.87
+605019.11 794746.2
+605036.58 794758.53
+605065.35 794763.67
+605060.21 794836.63
+605104.4 794842.8
+605171.19 794859.24
+605223.6 794877.74
+605242.1 794886.98
+605310.94 794918.84
+605359.24 794956.86
+605400.34 794990.77
+605440.42 795029.82
+605482.03 795075.55
+605501.55 795100.21
+605528.27 795138.23
+605562.18 795205.03
+605597.12 795190.64
+605644.39 795169.06
+605671.11 795215.3
+605706.05 795244.08
+605745.1 795258.46
+605772.84 795267.71
+605802.65 795268.74
+605830.39 795266.68
+605845.81 795264.63
+605876.64 795254.35
+605889.99 795247.16
+605920.82 795227.64
+605929.04 795222.5
+605950.62 795195.78
+605968.09 795161.87
+605975.29 795137.2
+605981.45 795110.49
+605967.07 795075.55
+605945.49 795046.77
+605939.84 795042.15
+606121.73 794977.41
+606226.72 794942.76
+606214.24 794890.26
+606211.47 794865.08
+606109.86 794808.58
+606043.81 794756.25
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605624.78 794678.27
+Region  1
+  54
+608216.91 794563.49
+608281.02 794310.73
+608289.79 794280.82
+608301.44 794264.95
+608315.19 794247.59
+608286.4 794218.34
+608238.14 794171.35
+608201.31 794148.77
+608157.07 794124.43
+608074.51 794079.33
+608007.84 794042.5
+608022.86 794003.76
+608044.24 793943.27
+608089.11 793928.87
+608101.6 793899.45
+608005.71 793900.94
+607996.61 793906.02
+607912.68 793861.22
+607893.53 793914.91
+607887.99 794066.15
+607885.24 794162.23
+607884.19 794278.61
+607874.04 794354.52
+607835.96 794476.42
+607785.52 794577.76
+607728.59 794654.98
+607666 794746.76
+607593.41 794859.99
+607559.76 794949.96
+607553.49 795019.71
+607554.95 795092.97
+607637.43 795146.82
+607649.56 795172.05
+607667.99 795186.61
+607700.01 795199.22
+607713.33 795282.43
+607738.56 795256.23
+607763.29 795224.23
+607822.28 795240.98
+607940.17 795129.1
+607986.27 795061.91
+608024.11 794994.96
+608082.7 794893.03
+608104.64 794858.21
+608176.76 794786.07
+608185.16 794778.47
+608191.51 794772.12
+608237.86 794727.66
+608201.67 794674.96
+608110.55 794712.11
+608133.66 794623.39
+608150.55 794546.98
+608182.94 794554.28
+608216.91 794563.49
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607935.93 794625.17
+Region  1
+  62
+602929.39 806601.71
+603026.47 806783.58
+603128.41 806869.26
+603159.47 806949.46
+603163.36 806959.5
+603173.47 806957.18
+603232.34 806961.58
+603306.44 806993.81
+603367.93 807063.37
+603403.44 807114.59
+603390.85 807165.85
+603363.78 807285.43
+603336.11 807431.59
+603340.62 807490.43
+603374.19 807511.29
+603495.1 807520.71
+603607.49 807524.5
+603642.33 807524.5
+603659.08 807522.69
+603696.18 807509.56
+603729.67 807500.06
+603823.34 807479.25
+603887.6 807461.15
+603952.53 807438.29
+604049.38 807404.8
+604142.6 807379.91
+604249.86 807355.05
+604300.55 807352.34
+604332.23 807352.79
+604345.8 807322.02
+604362.09 807316.58
+604484.74 807340.57
+604468.9 807316.58
+604457.59 807299.84
+604442.65 807279.93
+604430.43 807260.47
+604501.94 807272.23
+604507.82 807229.69
+604514.61 807201.18
+604507.82 807199.82
+604466.33 807193.13
+604318.8 807160.94
+604207.36 807134.43
+604091.48 807097.79
+603993.94 807052.92
+603929.96 807011.83
+603893.19 806971.36
+603859.55 806894.83
+603853.78 806835.99
+603866.96 806746.78
+603812.92 806684.97
+603750.01 806651.03
+603686.65 806619.8
+603664.48 806600.8
+603634.61 806523.86
+603594.78 806531.1
+603552.24 806540.6
+603459.97 806261.74
+603449.63 806093.46
+603148.77 805949.36
+602904.8 806561.85
+602929.39 806601.71
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603540.01 806857.79
+Region  1
+  95
+606754.57 795107.08
+606787.06 794969.8
+606801.13 794929.06
+606814.45 794898.9
+606860.21 794697.26
+606902.04 794522.11
+606907.81 794498.09
+606862.65 794535.88
+606808.21 794583.92
+606745.6 794635.64
+606690.51 794718.27
+606673.22 794738.13
+606646.63 794750.94
+606525.8 794757.94
+606469.49 794794.32
+606397.31 794821.41
+606300.58 794818.09
+606239.41 794846.45
+606214.24 794890.26
+606226.72 794942.76
+606231.81 794997.83
+606243.23 795068.72
+606263.63 795140.74
+606316.02 795209.95
+606382.05 795309.34
+606457.94 795426.54
+606502.07 795501.76
+606538.27 795567.15
+606544.3 795608.74
+606500.45 795702.35
+606484.02 795779.57
+606462.71 795893.97
+606492.87 795951.78
+606540.49 796028.94
+606576.37 796083.86
+606663.05 796137.84
+606725.28 796169.59
+606794.18 796198.8
+606740.2 796434.69
+606717.98 796537.83
+607028.5 796471.92
+607064.44 796334.52
+607155.24 796278.31
+607176.14 796278.31
+607532.49 796207.36
+607563.48 796281.58
+607590.14 796270.77
+607607.43 796205.19
+607641.3 796155.47
+607662.2 796138.18
+607663.64 796118
+607664.36 796092.06
+607627.21 795982.28
+607635.94 795927.94
+607656.08 795918.96
+607659.96 795810.28
+607655.63 795686.08
+607650.29 795586.62
+607665.07 795516.03
+607697.09 795435.98
+607724.01 795391.11
+607822.28 795240.98
+607763.29 795224.23
+607738.56 795256.23
+607713.33 795282.43
+607700.01 795199.22
+607667.99 795186.61
+607649.56 795172.05
+607637.43 795146.82
+607554.95 795092.97
+607560.77 795126.93
+607568.05 795163.32
+607431.71 795179.33
+607415.47 795179.57
+607289.83 795197.04
+607235.02 795165.02
+607160.56 795122.11
+607088.29 795083.31
+607075.44 795128.66
+607052.64 795211.12
+607031.07 795298.67
+606991.78 795444.17
+607000.52 795562.99
+606868.11 795487.33
+606784.68 795439.8
+606766.74 795515.46
+606742.97 795496.55
+606731.33 795474.24
+606732.79 795447.56
+606755.78 795371.68
+606824.17 795164.56
+606836.31 795092.86
+606837.03 795075.06
+606787.55 795092.52
+606754.57 795107.08
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607000.52 795606.63
+Region  1
+  48
+614879.39 800944.38
+614986.88 800896.27
+615106.74 800912.22
+615224.94 800910.57
+615340.95 800840.19
+615477.02 800851.43
+615527.6 800870.12
+615622.72 800850.33
+615659.55 800761.26
+615765.62 800663.34
+615823.98 800612.15
+615835.47 800602.58
+615909.62 800617.41
+615905.79 800662.86
+615937.37 800707.35
+615961.99 800774.57
+616012.22 800825.29
+616070.11 800826.72
+616141.39 800783.19
+616214.59 800747.3
+616207.42 800602.34
+616205.25 800511.2
+616204.04 800506.18
+615832.84 800427.71
+615754.36 800435.37
+615636.67 800410.97
+615224.27 800324.85
+614778.86 800232.53
+614776.47 800244.97
+614795.61 800309.08
+614727.67 800332.52
+614571.71 800382.28
+614596.53 800492.79
+614603.57 800578.54
+614605.6 800645.87
+614575.63 800754.43
+614564.64 800830.3
+614549.79 800884.18
+614575.63 800812.16
+614610.82 800794.56
+614658.1 800799.51
+614696.04 800838
+614723.53 800845.15
+614744.42 800840.75
+614772.46 800824.8
+614813.14 800828.65
+614843.66 800916.89
+614879.39 800944.38
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 615280.7 800598.9
+Region  1
+  31
+613632.92 796134.95
+613737.44 796105.19
+613943.72 795984.84
+614156.23 795978.47
+614187.98 795986.72
+614189.3 795528.17
+614189.3 795507.21
+614142.31 795509.12
+614026.74 795505.31
+614034.25 795367.97
+614037.4 795319.86
+614038.66 795304.67
+613990.67 795233
+613974.79 795222.53
+613913.3 795222.37
+613843.68 795221.1
+613674.69 795228.67
+613541.11 795528.28
+613515.71 795591.78
+613436.33 795687.99
+613444.59 795713.71
+613497.61 795705.77
+613489.78 795798.58
+613461.16 795829.59
+613430.39 795880.41
+613461.4 795888.99
+613496.7 795900.44
+613451.85 795972.01
+613473.34 796007.79
+613515.56 796168.35
+613632.92 796134.95
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613812.83 795692.53
+Region  1
+  57
+601975.02 789486.29
+602054.08 789457.08
+602103.29 789478.96
+602176.63 789505.63
+602194.56 789483.01
+602226.3 789436.69
+602269.34 789372.62
+602309.34 789309.75
+602348.21 789182.58
+602337.1 789163.22
+602408.86 789124.48
+602443.15 789107.02
+602458.71 789088.6
+602465.37 789079.39
+602400.61 789064.45
+602360.6 789029.21
+602295.19 788979.01
+602181.84 788893.6
+602069.72 788807.5
+602022.23 788751.79
+601968.48 788662.11
+601958.95 788676.08
+601934.19 788726.6
+601887.52 788807.57
+601854.81 788851.38
+601796.71 788903.77
+601756.71 788933.64
+601637.96 788934.28
+601589.7 788982.86
+601548.11 789027
+601485.1 789099.87
+601474.63 789107.17
+601426.68 789072.56
+601379.06 789041.77
+601303.17 788989.38
+601238.09 788945.88
+601222 788946.52
+601211.84 789006.42
+601188.34 789105.91
+601150.58 789222.13
+601125.1 789327.2
+601140.66 789321.49
+601157.8 789315.46
+601177.81 789300.85
+601195.59 789265.61
+601201.94 789281.48
+601290.84 789358
+601335.1 789389.72
+601413.05 789426.23
+601462.26 789436.7
+601520.37 789448.13
+601585.14 789464.64
+601631.81 789482.42
+601683.88 789499.28
+601823.58 789537.7
+601911.2 789509.15
+601975.02 789486.29
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 601816.08 789178.69
+Region  1
+  101
+608312.24 787960.41
+608222.18 787963.39
+608205.99 788003.4
+608069.46 788041.53
+608018.34 788045.97
+607979.29 788040.89
+607931.35 788066.29
+607819.27 788113.58
+607020.11 787632.27
+606715.72 787720.21
+606690.63 787727.93
+606757.79 787795.86
+606787.51 787825.39
+607238.52 788283.86
+607170.45 788363.9
+607180.58 788382.26
+607204.64 788396.82
+607232.49 788403.78
+607282.5 788427.21
+607324.92 788446.21
+607364.17 788482.29
+607357.85 788500.01
+607265.48 788598.11
+607221.19 788648.11
+607190.2 788696.84
+607173.13 788741.78
+607246.57 788796.22
+607308.61 788823.45
+607383.31 788852.58
+607443.44 788865.88
+607483.94 788858.92
+607557.99 788829.18
+607665.58 788804.51
+607758.62 788793.13
+607818.75 788800.1
+607870.66 788809.6
+607901.67 788814.04
+607920.65 788795.05
+607928.87 788770.37
+607945.95 788746.95
+607974.43 788727.33
+608010.5 788716.58
+608054.81 788727.35
+608118.11 788736.22
+608156.72 788745.72
+608199.13 788755.22
+608225.73 788778.01
+608245.35 788791.94
+608276.37 788792.57
+608316.24 788789.41
+608352.32 788789.42
+608375.75 788812.84
+608386.51 788833.1
+608396.66 788891.97
+608394.78 788925.51
+608361.24 788938.17
+608337.19 788966.65
+608304.3 789002.09
+608274.56 789033.1
+608249.88 789048.92
+608190.39 789051.44
+608169.51 789080.55
+608172.69 789121.06
+608180.3 789159.68
+608192.97 789183.1
+608210.7 789200.82
+608228.42 789211.59
+608255.01 789214.75
+608156.9 789212.21
+608059.43 789205.87
+607987.9 789200.16
+607937.98 789421.69
+608723.67 789957.29
+608828.71 789871.85
+608914.14 789833.89
+608988.19 789818.07
+609032.49 789799.09
+609087.54 789752.26
+609130.56 789712.39
+609251.44 789667.47
+609132.31 789326.28
+609132.93 789302.86
+609057.05 789205.24
+608993.64 789111.65
+608952.63 789043.51
+608789.68 788771.76
+608765.61 788726.82
+608701.04 788617.86
+608627.06 788502.11
+608573.47 788422.35
+608502.01 788323.22
+608436.6 788236.17
+608365.14 788138.55
+608333.44 788088.73
+608320.11 788043.17
+608312.78 788013.4
+608311.4 788005.32
+608313.18 787952.79
+608314.21 787858.88
+608313.59 787858.68
+608312.24 787960.41
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607494.84 788794.79
+Region  1
+  150
+606604.89 800835.65
+606597.67 800712.97
+606583.94 800698.49
+606536.31 800694.04
+606489.96 800687.06
+606468.2 800686.87
+606456.1 800705.88
+606453.8 800722.01
+606450.92 800750.24
+606430.27 800758.81
+606421.1 800738.14
+606435.7 800709.56
+606447.13 800682.89
+606459.2 800650.5
+606466.19 800621.92
+606466.82 800607.32
+606483.97 800596.52
+606480.79 800586.36
+606489.68 800546.99
+606505.24 800492.03
+606517.31 800444.4
+606520.48 800425.35
+606458.24 800380.9
+606324.25 800272.93
+606297.89 800293.53
+606233.75 800324.01
+606173.41 800352.59
+606102.29 800386.25
+606038.15 800394.5
+606012.11 800396.41
+605990.83 800384.7
+605952.09 800326.27
+605955.27 800260.22
+605952.73 800240.53
+605944.46 800228.08
+605930.81 800206.17
+605899.06 800243
+605871.12 800252.21
+605818.55 800281.9
+605788.89 800299.2
+605760.31 800316.66
+605746.02 800347.14
+605736.18 800367.46
+605713.97 800415.67
+605689.2 800406.15
+605662.85 800395.35
+605607.92 800371.86
+605586.02 800423.61
+605576.49 800451.55
+605563.79 800517.56
+605555.86 800569.66
+605495.85 800560.45
+605420.29 800547.11
+605405.37 800543.94
+605394.57 800540.44
+605355.7 800678.81
+605343.45 800790.35
+605489.12 801530.65
+605491.42 801573.28
+605953.46 801356.72
+606202.33 801371.07
+606186.78 801429.83
+606164.89 801507.03
+606149.62 801606.39
+606139.25 801639.23
+606123.99 801667.69
+606102.59 801713.77
+606100.95 801749.99
+606096.83 801804.3
+606061.44 801838.05
+606019.47 801858.62
+605976.68 801867.67
+605978.73 801989.91
+605910.42 801985.8
+605842.11 801985.8
+605804.25 801993.2
+605744.17 802017.89
+605600.97 802083.73
+605726.07 802462.33
+605736.77 802499.37
+605801.79 802471.39
+605834.71 802400.61
+605887.79 802299.79
+605929.76 802219.14
+605961.86 802191.15
+605984.08 802185.39
+606020.29 802186.17
+606030.17 802210.08
+606051.57 802267.69
+606263.45 802871.8
+606266.06 802882.25
+606375.57 802865.27
+606497.89 803102.08
+606646.08 803329.73
+606659.95 803315.35
+606681.38 803297.58
+606709.61 803274.06
+606727.48 803256.83
+606758.75 803230.67
+606755.09 803109.91
+606754.4 803002.72
+606752.95 802922.3
+606786.18 802919.89
+606867.33 802915.33
+606867.82 802800.71
+606921.75 802688.02
+606920.79 802653.83
+606912.12 802624.45
+606986.53 802470.56
+606945.59 802423.37
+606931.87 802407.22
+606983.88 802353.76
+607010.51 802325.41
+607040.71 802295.49
+607067.67 802267.55
+607095.4 802205.07
+607147.88 802206.48
+607096.29 802200.8
+607070.82 802183.82
+607063.85 802179.88
+607056.57 802176.55
+607046.24 802170.98
+607000.49 802212.88
+606967.26 802248.04
+606832.89 802250.44
+606831.34 802205.33
+606828.98 802035.6
+606819.52 802022.83
+606787.85 801976.5
+606729.22 801892.81
+606689.14 801838.24
+606668.4 801797.91
+606660.34 801749.52
+606651.7 801623.35
+606623.47 801527.72
+606612.23 801477.31
+606604.17 801431.22
+606589.19 801343.65
+606573.34 801293.84
+606541.66 801238.53
+606537.05 801128.5
+606535.6 801037.15
+606534.45 801022.75
+606581.69 800998.55
+606596.1 800991.06
+606609.35 800980.69
+606617.99 800972.05
+606645.9 800930.53
+606641.51 800841.38
+606604.89 800835.65
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606205.27 801600.42
+Region  1
+  125
+606530.11 796788.97
+606374.14 796774.06
+606296.4 796739.11
+606253.8 796703.58
+606239.19 796729.01
+606247.45 796749
+606257.93 796768.69
+606266.04 796777.67
+606222.64 796809.69
+606250.16 796848.48
+606241.28 796960.92
+606162.85 796975.84
+606103.48 796992.15
+606073.02 797041.42
+606064.25 797055.61
+606062.09 797066.05
+606058.08 797085.44
+606052.17 797114.08
+606048.37 797132.45
+606049.01 797139.44
+606046.02 797219.46
+606001.57 797322.96
+605991.73 797393.15
+605977.76 797435.06
+605922.84 797479.53
+605849.49 797506.2
+605782.18 797530.65
+605724.4 797551.88
+605659.63 797556.96
+605605.98 797542.36
+605551.37 797508.67
+605503.11 797475.97
+605473.58 797454.06
+605457.67 797442.05
+605446.24 797435.7
+605429.09 797403.63
+605459.89 797330.6
+605447.51 797307.46
+605417.67 797320.79
+605332.58 797284.91
+605326.54 797396.69
+605314.16 797449.4
+605285.1 797513.93
+605257.41 797574.66
+605349.62 797697.68
+605364.36 797748.14
+605367.04 797793.25
+605365.46 797816.69
+605362.33 797840.8
+605344.12 797902.66
+605322.95 797957.39
+605314.96 797978.97
+605311.76 797995.34
+605296.58 798050.87
+605292.59 798094.41
+605293.19 798105.56
+605292.56 798114.77
+605291.92 798120.48
+605313.67 798198.46
+605334.48 798247.84
+605357.34 798284.04
+605372.9 798301.19
+605419.74 798343.58
+605471.82 798381.37
+605544.69 798435.15
+605598.36 798471.99
+605656.79 798513.9
+605728.08 798570.62
+606030.4 798778.19
+606093.91 798759.13
+606044.05 798724.21
+606072.95 798693.72
+606089.1 798675.3
+606117.81 798645.57
+606140.03 798603.02
+606173.05 798582.07
+606173.37 798556.66
+606199.4 798566.51
+606203.21 798572.86
+606229.88 798571.59
+606253.06 798560.16
+606249.63 798531.68
+606255.49 798506.71
+606272.84 798467.66
+606282.27 798433.14
+606287.99 798429.01
+606287.16 798404.74
+606292.75 798395
+606306.08 798354.35
+606280.68 798346.42
+606275.6 798316.25
+606334.97 798193.05
+606349.89 798190.51
+606401.96 798083.19
+606410.22 798081.6
+606442.28 798020
+606459.1 797987.33
+606514.99 797912.68
+606538.89 798070.84
+606648.14 798056.7
+606697.81 797966.19
+606753.8 797924.82
+607597.08 797900.34
+607694.73 797935.61
+607781.33 797965.48
+607849.83 797990.5
+607956.31 797550.18
+608026.98 797228.93
+607964.38 797175.46
+607917.31 797084.35
+607884.88 797034.62
+607848.13 796969.77
+607793.36 796916.44
+607636.84 796832.38
+607554.93 796794.28
+607471.42 796764.74
+607414.27 796749.18
+607329.17 796728.9
+607254.24 796698.42
+607183.44 796683.19
+607042.79 796660.02
+606944.37 796663.83
+606824.67 796695.58
+606614.16 796765.8
+606530.11 796788.97
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606622.85 797570.72
+Region  1
+  62
+611272.15 802077.31
+611280.56 802105.1
+611126.86 802194.96
+610982.54 802277.37
+610953.8 802294.96
+611008.1 802386.1
+611033.77 802430.32
+611064.94 802485.2
+611090.01 802530.6
+611112.37 802570.58
+611004.64 802550.25
+610948.4 802541.44
+610938.23 802552.28
+610911.81 802649.85
+610905.71 802674.25
+611392.22 802817.89
+611393.74 802793.99
+611400.19 802733.13
+611413.22 802593.61
+611430.26 802468.05
+611524.9 802459
+611543.47 802491.15
+611559.32 802505.19
+611580.6 802520.58
+611618.64 802536.88
+611750.86 802581.71
+611741.35 802607.97
+611720.98 802633.33
+611768.07 802665.93
+611858.41 802723.22
+611918.65 802766.39
+611997.2 802801.75
+612039.32 802810.35
+612137.13 802816.69
+612157.5 802794.5
+612194.64 802753.75
+612215.01 802715.26
+612250.79 802691.71
+612281.35 802576
+612311.24 802502.64
+612327.31 802440.83
+612333.65 802358.87
+612317.8 802243.81
+612248.3 802014.91
+611662.8 801774.48
+611610.72 801731.01
+611574.49 801666.71
+611501.36 801641.1
+611449.43 801622.15
+611416.63 801610.81
+611369 801613.99
+611328.67 801633.68
+611293.74 801669.88
+611336.92 801679.4
+611394.08 801694.96
+611393.13 801714.65
+611385.98 801808.52
+611378.84 801918.57
+611373.6 801963.47
+611357.72 801989.2
+611326.13 802021.43
+611272.15 802077.31
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611679.53 802293.6
+Region  1
+  116
+606583.22 792079.77
+606699.48 792175.34
+606720.16 792204.58
+606738.35 792255.57
+606746.2 792296.23
+606749.05 792351.85
+606745.49 792388.94
+606744.06 792413.9
+606708.26 792481.99
+606716.52 792485.8
+606726.04 792490.56
+606743.82 792500.72
+606764.78 792511.83
+606788.59 792525.53
+606813.99 792540.46
+606845.42 792481.4
+606874.95 792494.42
+606908.28 792512.52
+606941.3 792530.93
+607007.02 792567.76
+607036.87 792584.27
+607084.81 792610.98
+607128.31 792634.79
+607182.6 792666.54
+607183.43 792515.49
+607172.02 792456.62
+607170.1 792410.42
+607151.39 792293.05
+607140.28 792224.32
+607105.99 792119.35
+607089.48 792036.16
+607078.78 791940.11
+607064.4 791846.6
+607157.11 791869.46
+607253.63 791872.3
+607339.68 791856.74
+607401.91 791871.35
+607435.24 791894.5
+607456.51 791930.7
+607488.58 791916.73
+607540.97 791922.43
+607594.94 791924.01
+607591.77 791813.56
+607570.82 791693.25
+607557.16 791620.54
+607547 791563.07
+607538.43 791526.56
+607534.3 791483.71
+607482.87 791473.87
+607451.43 791467.2
+607428.89 791458.63
+607412.7 791447.83
+607389.84 791426.86
+607371.11 791396.38
+607352.7 791388.76
+607282.85 791357.01
+607216.81 791324.63
+607189.51 791307.77
+607205.11 791260.97
+607172.36 791264.27
+607131.09 791263
+607065.68 791266.17
+607039.96 791227.75
+606999 791157.58
+607051.39 791149.99
+607096.82 791112.84
+607095.84 791067.76
+607067.27 791013.78
+607031.07 790952.51
+607009.17 790909.97
+607015.83 790870.57
+607052.36 790837.23
+606951.38 790793.41
+606844.07 790748.64
+606757.34 790358.95
+606742.41 790291.96
+606685.77 790303.72
+606640.65 790313.9
+606598.01 790324.35
+606611.37 790385.22
+606601.21 790430.95
+606598.03 790457.93
+606594.86 790479.84
+606582.47 790475.05
+606542.78 790461.4
+606474.06 790560.31
+606451.51 790604.44
+606372.46 790671.13
+606277.52 790696.21
+606242.6 790698.12
+606179.73 790660.01
+606166.36 790615.72
+606161.49 790601.96
+606158.14 790585.72
+606054.95 790628.44
+605998.43 790656.59
+605964.99 790680.45
+605914.51 790740.51
+605880.53 790820.69
+605858.47 790927.44
+605961.03 790960.46
+605875.94 791035.71
+605911.76 791060.03
+605955.57 791087.34
+606062.26 791187.8
+606298.48 791376.39
+606355.99 791423.1
+606321.07 791450.09
+606278.52 791480.25
+606287.09 791513.59
+606332.17 791631.63
+606333.44 791669.09
+606328.36 791727.51
+606317.57 791829.14
+606318.21 791904.04
+606583.22 792079.77
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606730.28 791424.24
+Region  1
+  57
+605197.47 802712.88
+605736.77 802499.37
+605726.07 802462.33
+605600.97 802083.73
+605744.17 802017.89
+605804.25 801993.2
+605842.11 801985.8
+605910.42 801985.8
+605978.73 801989.91
+605976.68 801867.67
+606019.47 801858.62
+606061.44 801838.05
+606096.83 801804.3
+606100.95 801749.99
+606102.59 801713.77
+606123.99 801667.69
+606139.25 801639.23
+606149.62 801606.39
+606164.89 801507.03
+606186.78 801429.83
+606202.33 801371.07
+605953.46 801356.72
+605491.42 801573.28
+605494.88 801629.17
+605496.03 801671.22
+605498.05 801731.96
+605505.1 801786.2
+605529.16 801920.35
+605521.67 801999.28
+605493.15 802073.35
+605461.89 802151.24
+605397.82 802244.62
+605344.91 802320.55
+605301.19 802384.39
+605268.98 802427.53
+605213.19 802445.94
+605180.98 802424.08
+605140.43 802395.04
+605096.14 802362.82
+605078.88 802356.5
+604900 802428.4
+604876.76 802452.81
+604854.1 802480
+604848.01 802523.91
+604842.26 802578.27
+604837.81 802684.65
+604833.02 802720.31
+604864.08 802734.11
+604906.07 802747.34
+605001.44 802789.73
+605020.78 802796.52
+605035.42 802804.89
+605047.96 802787.11
+605062.08 802771.95
+605085.08 802759.93
+605115.4 802746.86
+605197.47 802712.88
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605568.21 802069.14
+Region  1
+  54
+615175.36 796495.68
+614878.82 796162.9
+614751.22 796043.24
+614661.75 796008.62
+614566.8 796001.64
+614493.37 795988.34
+614444.01 795989.6
+614398.43 795981.36
+614361.33 795979.74
+614335.93 795978.47
+614325.14 795982.91
+614323.87 795994.34
+614316.25 796024.19
+614291.48 796074.35
+614258.46 796128.96
+614224.68 796190.26
+614218.67 796287.11
+614241.83 796324.26
+614337.72 796422.05
+614349.79 796455.71
+614338.48 796502.58
+614235.89 796588.25
+614177.22 796600.13
+614045.66 796619.74
+614012.18 796648.53
+613987.82 796701.99
+614713.69 796781.16
+614662.94 797266.24
+614646.46 797422.02
+614642.22 797456.94
+614637.9 797489.34
+614665.09 797462.48
+614702.18 797416.02
+614795.81 797380.73
+614845.5 797356.98
+614907.08 797317.73
+614921.64 797303.34
+614935.14 797287.9
+615054.06 797163.56
+615144.71 797072.87
+615230.92 796976.78
+615238.22 796972.32
+615203.93 796935.49
+615147.42 796926.28
+615092.81 796917.07
+615109.32 796891.63
+615116.47 796724.56
+615115.04 796618.24
+615151.86 796582.68
+615162.34 796563.31
+615172.18 796556.01
+615256.32 796579.82
+615216 796537.91
+615175.36 796495.68
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 614709.24 796609.83
+Region  1
+  126
+614514.98 794648.74
+614577.21 794691.26
+614644.52 794735.07
+614680.08 794755.39
+614718.81 794778.25
+614749.59 794802.01
+614734.35 795035.69
+614728.68 795097.76
+614820.12 795099.03
+614897.59 795100.93
+614957.28 795100.93
+615067.13 795102.84
+615125.55 795050.77
+615296.7 794902.87
+615437.67 794783.49
+615700.09 795183.39
+615811.46 795117.57
+615896.88 795038.47
+615936.08 794937.2
+615955.67 794842.89
+615967.68 794795.42
+616016.4 794765.68
+616186.65 794731.52
+616313.24 794722.05
+616405.63 794693.58
+616426.78 794689.46
+616438.76 794667.95
+616381.3 794595.13
+616353.85 794551.65
+616387.2 794501.11
+616373.68 794467.62
+616304.19 794387.89
+616288.23 794273.9
+616250.89 794193.24
+616251.51 794131.48
+616235.92 794104.76
+616185.84 794096.16
+616138.57 794133.33
+616112.76 794141.01
+616092.79 794158.83
+616049.03 794152.83
+616020.76 794134.71
+615893.87 794071.72
+615870.84 794024.4
+615853.33 794006.88
+615836.12 794005.04
+615819 794020.1
+615805.79 794044.68
+615775.68 794033.31
+615777.34 794011.03
+615764.13 793998.44
+615726.96 793967.71
+615721.12 793943.13
+615713.94 793928.84
+615672.15 793900.88
+615631.6 793881.52
+615617.46 793871.08
+615611.63 793845.88
+615615.31 793803.79
+615612.87 793780.74
+615608.26 793754.62
+615591.67 793735.57
+615554.18 793709.15
+615534.52 793697.78
+615520.69 793675.04
+615488.59 793644.47
+615474.45 793635.25
+615418.53 793584.86
+615384.32 793570.89
+615305.98 793581.33
+615285.7 793580.1
+615232.85 793521.11
+615211.2 793505.9
+615194.61 793504.05
+615165.12 793482.24
+615139.92 793468.72
+615108.89 793464.72
+615058.19 793461.96
+615006.12 793446.44
+614991.37 793435.38
+614973.55 793398.82
+614956.04 793375.16
+614913.2 793337.83
+614897.84 793298.81
+614888.62 793274.23
+614877.74 793246.42
+614829.5 793229.83
+614792.02 793180.67
+614774.51 793130.58
+614719.49 793091.31
+614673.27 793064.72
+614650.03 793062.07
+614632.21 793047.02
+614607.32 793037.18
+614585.5 793015.98
+614568.91 793005.84
+614505.35 793007.99
+614140.01 793315.25
+614104.9 793762.12
+614044.1 793876.07
+614045.23 794001.09
+614005.43 794074.57
+613962.75 794102.68
+613937.09 794138.97
+613904.34 794219.06
+613885.76 794240.74
+613863.19 794250.04
+613789.27 794248.37
+613703.42 794248.37
+613682.62 794255.45
+613578.19 794352.36
+613566.04 794432.95
+613674.25 794459.44
+613756.16 794489.29
+613813.95 794477.86
+613871.09 794467.71
+614000 794442.94
+614106.68 794423.26
+614231.77 794399.13
+614298.45 794434.69
+614335.27 794470.28
+614377.18 794493.77
+614497.83 794510.92
+614544.82 794532.51
+614570.86 794568.07
+614514.98 794648.74
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 615028.52 794173.94
+Region  1
+  37
+604974.53 794215.55
+605131.84 794420.99
+605178.67 794483.14
+605200.96 794508.31
+605215.84 794522.78
+605247.22 794531.33
+605278.4 794532.56
+605301.22 794523.39
+605328.23 794490.89
+605335.82 794455.12
+605420.49 794395.86
+605435.31 794415.1
+605440.6 794408.32
+605400.59 794320.49
+605308.11 794179.37
+605333.93 794179.16
+605363.14 794183.61
+605398.49 794198.42
+605380.82 794177.39
+605363.77 794152.07
+605356.15 794129.85
+605349.81 794106.97
+605351.5 794079.66
+605358.91 794068.48
+605366.32 794053.24
+605322.08 794031.44
+605159.52 794027.89
+605100.26 794029.98
+605049.68 794036.54
+605007.56 794049.02
+604973.69 794055.37
+604975.45 794060.25
+604990.93 794090.6
+605012.73 794129.1
+605051.53 794195.59
+605011.2 794204.96
+604974.53 794215.55
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605208.06 794251
+Region  1
+  37
+616627.44 806391.39
+616614.95 806345.02
+616605.44 806301.62
+616637.55 806276.65
+616661.92 806239.79
+616667.87 806220.17
+616702.94 806189.25
+616765.96 806108.39
+616782.01 806095.91
+616792.45 806027.25
+616778.46 805961.46
+616771.45 805915.29
+616765.04 805838.11
+616763.33 805745.76
+616759.71 805682.88
+616740.71 805692.38
+616706.68 805709.09
+616666.18 805722.39
+616618.08 805730
+616572.51 805735.09
+616540.25 805755.98
+616467.51 805815.48
+616355.59 805931.29
+616262.63 806023.7
+616093.49 806167
+616349.92 806654.27
+616278.52 806751.56
+616330.59 807086.84
+616869.07 806949.68
+617149.74 806564.87
+616660.79 806620.75
+616660.79 806557.25
+616672.22 806505.18
+616696.35 806469.62
+616670.95 806457.02
+616642.3 806438.36
+616627.44 806391.39
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 616548.22 806436.98
+Region  1
+  44
+610349.98 798233.01
+609977.59 798430.62
+609842.29 798504.94
+609794.22 798505.1
+609787.22 799131.61
+609809.37 799133.47
+609824.38 799133.88
+609843.8 799131.75
+609898.85 799132.25
+610002.91 799197.47
+610092.85 799254.65
+610104.08 799232.51
+610140.2 799139.3
+610128.67 799112
+610182.98 799004.59
+610199.36 798978.2
+610223.32 798946.65
+610253.96 798916.01
+610277.48 798890.71
+610235.61 798880.7
+610202.55 798864.92
+610208.01 798845.2
+610213.92 798822.87
+610231.51 798761.29
+610216.35 798755.83
+610201.18 798749.46
+610189.35 798744.91
+610176.3 798738.84
+610167.35 798731.11
+610234.39 798709.27
+610255.33 798688.34
+610265.34 798651.02
+610264.88 798624.15
+610261.54 798578.35
+610258.05 798529.96
+610258.05 798499.01
+610290.36 798463.07
+610316.15 798439.72
+610275.2 798400.58
+610254.87 798381.17
+610218.01 798346.74
+610210.12 798339.77
+610188.89 798320.38
+610349.98 798233.01
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610024.55 798770.02
+Region  1
+  58
+608337.45 798220.41
+608212.99 798143.39
+608127.21 798093.01
+607893.13 798006.57
+607849.83 797990.5
+607781.33 797965.48
+607694.73 797935.61
+607690.83 797945.13
+607684.34 797961.15
+607681.52 797968.75
+607677.85 797979.85
+607666.16 798042.64
+607657.5 798078.58
+607653.6 798091.57
+607647.76 798114.29
+607571.76 798389.94
+607593.84 798395.57
+607623.07 798401.82
+607739.98 798430.4
+607712.91 798540.59
+607699.22 798592.87
+608501.68 798601.09
+608494.6 798614.35
+608489.43 798623.61
+608480.44 798640.22
+608468.46 798660.1
+608483.44 798668.54
+608507.54 798681.47
+608535.59 798697.26
+608522.79 798720.41
+608507.81 798744.11
+608494.87 798768.2
+608483.98 798785.63
+608461.65 798825.67
+608503.12 798822.87
+608543 798818.42
+608596.79 798807.64
+608632.23 798805.09
+608706.07 798793.14
+608731.13 798788.79
+608765.57 798783.5
+608883.77 798788.94
+608885.94 798568.09
+608931.03 798568.31
+608963.57 798554.33
+609104.37 798482.7
+609039.43 798385.23
+609026.36 798363.44
+608946.96 798395.18
+608888.68 798407.16
+608817.46 798411.42
+608734.4 798399.98
+608623.44 798364.13
+608563.92 798345.82
+608510.72 798324.33
+608466.68 798301.74
+608418.34 798271.07
+608337.45 798220.41
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608241.53 798404.5
+Region  1
+  86
+602511.84 797994.81
+602684.85 797838.27
+602713.89 797813.35
+602752 797779.05
+602803.44 797732.38
+602818.68 797721.81
+602809.94 797656.99
+602806.61 797627.59
+602793.91 797598.69
+602788.83 797574.24
+602784.38 797561.86
+602776.13 797540.26
+602755.65 797507.39
+602724.53 797473.73
+602680.07 797435.94
+602621.78 797389.9
+602614.95 797376.23
+602609.85 797313.66
+602608.37 797297.15
+602607.1 797276.41
+602602.23 797239.58
+602584.45 797260.32
+602545.93 797312.81
+602520.12 797347.87
+602482.87 797434.45
+602478 797397.41
+602472.92 797375.61
+602454.93 797367.99
+602428.26 797385.35
+602418.31 797396.78
+602401.38 797411.38
+602362.02 797440.8
+602337.25 797461.97
+602290.89 797519.12
+602285.18 797543.89
+602262.95 797644.18
+602240.09 797733.71
+602229.3 797768.64
+602220.37 797785.24
+602235.93 797818.09
+602252.36 797853.54
+602278.73 797909.74
+602294.29 797945.18
+602255.82 797934.81
+602220.8 797920.98
+602149.04 797897.2
+602111.43 797888.12
+602102.58 797869.75
+602077.51 797817.88
+602061.3 797779.62
+602047.9 797680.19
+601954.96 797722.55
+601941.42 797725.4
+601931.61 797721.69
+601906.97 797695.75
+601873.25 797651.66
+601856.83 797641.28
+601840.67 797640.05
+601829.16 797642.58
+601818.35 797655.98
+601843.43 797701.37
+601866.77 797744.17
+601889.68 797786.53
+601901.14 797812.26
+601912.38 797847.27
+601894.22 797869.75
+601886.01 797877.97
+601878.66 797884.02
+601870.45 797890.5
+601848.4 797905.2
+601852.92 797978.9
+601877.56 797998.79
+601916.74 798022.78
+601964.12 798073.22
+601973.99 798086.81
+602060.35 798116.65
+602081.31 798126.18
+602202.47 798177.56
+602347.06 798230.09
+602444.21 798266.28
+602441.67 798044.66
+602441.67 798011.32
+602465.8 798035.77
+602487.71 798017.67
+602501.36 798004.97
+602511.84 797994.81
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 602363.24 797793.9
+Region  1
+  45
+614375.4 803320.19
+614393.76 803279.85
+614402.84 803247.25
+614417.77 803211.4
+614446.82 803226.16
+614472.04 803192.64
+614501.97 803154.38
+614513.2 803139.53
+614557.35 803107.66
+614570.96 803097.7
+614594.19 803079.78
+614594.52 803071.15
+614600.42 803044.39
+614609.68 802985.91
+614591.45 802974.03
+614548.6 802950.29
+614512.12 802942.18
+614484.91 802941.02
+614455.95 802943.92
+614399.5 802950.01
+614396.03 802981.28
+614160.95 802958.12
+614132.22 802933.73
+614045.69 802908.59
+614003.74 802890.67
+613950.35 802869.57
+613844.13 802891.92
+613776.82 802905.82
+613696.34 802922.5
+613644.38 802916.45
+613640.88 803009.83
+613672.54 803098.52
+613684.12 803138.48
+613716.42 803260.38
+613749.53 803345.94
+613745.06 803370.02
+614190.86 803678.22
+614205.12 803651.39
+614220.74 803621.37
+614256.61 803555.97
+614285.61 803496.51
+614314.24 803440.29
+614339.26 803393.78
+614359.8 803351.49
+614375.4 803320.19
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 614083.75 803200.32
+Region  1
+  89
+609893.46 805919.58
+609661.27 806143.08
+608926 807117.86
+608872.05 807211.06
+608951.84 807272.63
+609013.28 807310.86
+609069.04 807343.41
+609116.84 807376.68
+609162.7 807400.92
+609229.63 807433.6
+609276.01 807456.79
+609349.54 807497.08
+609384.33 807532.39
+609419.11 807577.72
+609474.98 807649.93
+609532.17 807722.91
+609583.3 807787.21
+609648.39 807875.45
+609705.84 807954.51
+609731.66 807954.51
+609751.42 807893.94
+609758.54 807871.24
+609767.18 807835.73
+609805.45 807718.92
+609865.53 807422.14
+609873.29 807362.54
+609865.77 807296.4
+609849.78 807254.94
+609971.43 807217.31
+609976.34 807210.21
+609989.7 807191.94
+610008.25 807165.48
+610106.67 807017.93
+610130.12 806987.93
+610114.85 806970.2
+610105.85 806957.93
+610097.74 806946.04
+610083.77 806913.15
+610078.1 806897.38
+610077.15 806856.06
+610076.88 806829.33
+610078.24 806790.6
+610094.2 806745.74
+610107.57 806697.73
+610176.09 806676.39
+610302.34 806646.63
+610451.45 806764.68
+610478.51 806853.55
+610502.76 806953.5
+610534.2 807084.6
+610539.26 807162.14
+610524.87 807263.39
+610508.35 807318.28
+610490.76 807344.39
+610457.73 807380.62
+610471.58 807396.08
+610545.86 807419.04
+610595.26 807438.63
+610668.14 807465.89
+610724.7 807504.24
+610800.31 807524.02
+610859.94 807545.39
+610814.91 807443.58
+610800.91 807381.59
+610810.31 807303.13
+610823.5 807227.84
+610839.86 807148.75
+610877.72 807050.03
+610894.22 807002.12
+610929.27 806921.15
+610950.3 806882.34
+610976.2 806812.55
+610994.52 806714.04
+611001.77 806649.59
+611008.83 806584.13
+611016.3 806512.83
+611020.62 806429.95
+611033.2 806369.47
+611026.72 806243.95
+611014 806193.97
+610997.49 806157.92
+610968.24 806104.15
+610942.29 806050.4
+610865.94 805981.61
+610761.23 805931.99
+610207.84 805800.62
+610193.73 805814.3
+610094.02 805720.96
+609893.46 805919.58
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610047.37 806718.97
+Region  1
+  50
+615164.91 797967.27
+615119.29 797933.13
+615093.92 797891.39
+615081.18 797826.79
+615075.46 797769.01
+615070.38 797743.61
+615038.61 797705.41
+615003.07 797659.86
+614972.59 797630.01
+614892.17 797531.51
+614866.09 797475.11
+614883.55 797429.39
+614948.95 797342.71
+614954.98 797310.96
+614935.14 797287.9
+614921.64 797303.34
+614907.08 797317.73
+614845.5 797356.98
+614795.81 797380.73
+614702.18 797416.02
+614665.09 797462.48
+614637.9 797489.34
+614620.77 797650.59
+614622.03 797691.58
+614627.11 797716.35
+614674.67 797730.27
+614710.94 797738.58
+614697.6 797805.26
+614681.73 797881.47
+614590.91 797871.94
+614505.81 797866.86
+614342.29 797916.73
+614320.06 797912.92
+614292.45 797911.34
+614198.47 798095.49
+614119.96 798258.97
+614601.96 798190.07
+614982.73 798259.75
+615119.27 798565.21
+615307.25 798479.48
+615319.95 798473.77
+615307.25 798396.92
+615294.49 798324.66
+615285.34 798278.51
+615276.45 798228.98
+615261.97 798141.83
+615246.06 798074.15
+615240.89 798036.56
+615198.34 797999.73
+615164.91 797967.27
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 614811.38 797990.12
+Region  1
+  52
+603781.88 787427.05
+604338.38 787582.99
+604323.93 787235.51
+604431.28 787271.65
+604444.57 787260.89
+604469.22 787179.87
+604465.42 787164.68
+604377.42 787119.73
+604343.57 787097.13
+604303.35 787070.98
+604289.59 787063.47
+604324.52 787020.93
+604342.93 786996.16
+604351.82 786964.41
+604353.41 786940.91
+604358.8 786877.73
+604359.44 786857.09
+604359.76 786842.8
+604359.12 786823.43
+604366.11 786788.83
+604382.61 786727.24
+604408.32 786625.95
+604415.63 786590.38
+604417.21 786550.06
+604410.23 786518.3
+604396.89 786495.76
+604345.46 786479.88
+604286.65 786454.47
+604243.61 786435.48
+604224.49 786430.67
+604192.42 786472.9
+604171.15 786513.23
+604123.21 786567.87
+604029.23 786636.14
+603905.72 786716.15
+603837.9 786834.31
+603832.35 786844.31
+603820.34 786879.12
+603819.71 786882.29
+603792.66 786931.66
+603732.65 786987.22
+603662.16 787048.18
+603604.06 787153.62
+603605.65 787162.83
+603581.52 787196.2
+603591.04 787220.65
+603601.2 787244.78
+603613.9 787270.5
+603633.9 787307.97
+603664.7 787351.79
+603705.03 787389.58
+603781.88 787427.05
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604069.88 787054.99
+Region  1
+  42
+608140.71 796754.3
+608134.94 796798.98
+608170.25 796925.09
+608150.07 796929.41
+608122.69 796921.48
+608096.75 796969.77
+608062.16 797103.8
+608181.06 797218.38
+608314 797314.33
+608446.46 797355.33
+608519.61 797359.55
+608582.44 797335.17
+608694.71 797258.51
+608765.53 797253.82
+608831.65 797204.11
+608960.15 797175.03
+609101.56 797154.13
+609258.44 797212.05
+609267.23 797215.74
+609056.02 796409.29
+609186.35 796036.26
+609186.66 796035.38
+609187.49 796032.42
+609184.42 796030.28
+609033.04 795998.26
+608933.57 795976.21
+608820.53 795950.01
+608726.4 795929.63
+608304.77 795846.18
+608201.59 796258.16
+608188.62 796271.13
+608147.55 796335.99
+608203.76 796348.96
+608231.14 796355.44
+608248.8 796360.12
+608235.11 796425.69
+608179.98 796643.68
+608173.49 796678.99
+608179.98 796704.93
+608187.18 796727.27
+608189.34 796740.24
+608140.71 796754.3
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608644 796625.62
+Region  1
+  34
+604058.87 799037.28
+604019.65 799104.12
+603992.98 799141.27
+603968.68 799176.96
+603947.41 799224.9
+603941.22 799287.65
+603936.77 799341.32
+603919.94 799404.51
+603890.57 799440.57
+603847.39 799462.16
+603774.98 799489.79
+603722.27 799512.02
+603704.17 799519
+603685.28 799538.19
+603704.65 799603.64
+603720.52 799628.73
+603792.92 799665.88
+603876.44 799664.93
+603885.65 799656.67
+603899.78 799640.61
+603929.63 799619.34
+603968.37 799603.78
+604029.34 799577.42
+604076.02 799548.84
+604089.98 799530.56
+604101.76 799513.96
+604151.09 799398.74
+604298.09 799081.15
+604221.45 799108.41
+604150.64 798931.22
+604085.93 798775.84
+604078.3 798817.12
+604069.82 798845.94
+604058.87 799037.28
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604021.55 799319.12
+Region  1
+  64
+611836.91 803049.44
+611743.75 803112.55
+611602.89 803203.18
+611618.26 803232.97
+611592.49 803249.77
+611550.26 803274.61
+611396.64 803355.97
+611861.82 803792.58
+611838.19 803870.23
+611802.02 803906.88
+611734.51 803916.05
+611575.6 803817.44
+611592.96 803889.77
+611529.79 803864.7
+611399.57 804075.41
+611434.29 804083.56
+611448.75 804088.38
+611460.33 804092.24
+611475.28 804097.06
+611491.67 804102.37
+611504.21 804107.19
+611525.67 804114.19
+611542.55 804119.97
+611562.32 804124.8
+611588.36 804132.51
+611596.56 804153.25
+611614.41 804197.62
+611633.7 804240.06
+611648.16 804271.41
+611665.04 804309.5
+611673.72 804332.65
+611720.34 804342.37
+611756.99 804347.19
+611774.92 804341.83
+611787.08 804344.95
+611807.35 804353.16
+611839.79 804400.28
+612356.75 804434.09
+612351.85 804418.26
+612319.5 804328.88
+612244.41 804146.74
+612203.22 804053.08
+612124.68 803857.46
+612301.74 803835.72
+612306.49 803739.99
+612296.76 803712.12
+612304 803613.86
+612327.55 803554.54
+612417.88 803563.35
+612438.26 803532.11
+612309.89 803295.5
+612373.74 803241.16
+612410.41 803271.04
+612481.06 803316.78
+612563.24 803365.88
+612527.92 803285.74
+612531.55 803254.97
+612014.43 802994.12
+611992.69 802985.07
+611971.85 802976.99
+611950.57 802967.93
+611916.61 803005.06
+611904.38 803010.95
+611836.91 803049.44
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611955.73 803697.81
+Region  1
+  61
+612124.68 803857.46
+612203.22 804053.08
+612244.41 804146.74
+612319.5 804328.88
+612351.85 804418.26
+612356.75 804434.09
+612380.14 804510.31
+612390.86 804601.06
+612417.38 804646.14
+612457.28 804715.67
+612474.15 804736.89
+612547.32 804802.54
+612676.53 804879.46
+612711.24 804892.23
+612778.5 804900.67
+612824.42 804893.16
+612844.67 804862.31
+612839.85 804837.24
+612853.35 804818.43
+612877.94 804818.92
+612905.42 804819.88
+612942.39 804822.28
+612967.61 804822.29
+612987.38 804818.92
+612958.93 804728.28
+612785.14 804182.62
+612964.88 804103.62
+612960.63 804072.61
+612988.13 804069.36
+613024.21 804053.29
+613049.49 804022.91
+613273.73 803659.74
+613146.94 803598.16
+613055.01 803551.62
+613060.9 803560.58
+613063.16 803566.91
+613069.5 803583.22
+613071.77 803596.8
+613068.61 803627.49
+613050.91 803646.47
+613005.99 803661.05
+612987.32 803671.31
+612979.62 803683.99
+612810.72 803675.39
+612814.79 803591.62
+612811.17 803554.03
+612792.15 803519.17
+612762.49 803491.79
+612563.24 803365.88
+612481.06 803316.78
+612410.41 803271.04
+612373.74 803241.16
+612309.89 803295.5
+612438.26 803532.11
+612417.88 803563.35
+612327.55 803554.54
+612304 803613.86
+612296.76 803712.12
+612306.49 803739.99
+612301.74 803835.72
+612124.68 803857.46
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612643.74 804070.02
+Region  1
+  57
+598713.45 789929.46
+598689.48 789982.78
+598691.6 790006.81
+598702.57 790045.81
+598710.64 790072.63
+598696.44 790129.71
+598662.99 790260.34
+598627.65 790355.01
+598653.67 790403.64
+598654.23 790436.44
+598640.33 790470.91
+598585.85 790535.39
+598515.25 790619.34
+598491.9 790649.91
+598502.46 790657.14
+598520.25 790672.15
+598546.48 790699.58
+598571.88 790724.98
+598606.17 790751.65
+598683.03 790765
+598698.27 790731.98
+598717.32 790702.77
+598754.15 790612.6
+598787.17 790580.85
+598833.51 790550.38
+598898.28 790509.11
+598968.76 790457.04
+599010.67 790432.27
+599075.44 790407.51
+599182.15 790361.15
+599274.24 790308.43
+599385.06 790195.69
+599407.92 790165.84
+599327.26 790100.43
+599241.97 789947.46
+599186.73 789834.46
+599149.58 789759.21
+599134.97 789737.62
+599090.84 789646.77
+599081.31 789551.51
+599056.85 789548.99
+599055.27 789562.01
+599048.92 789611.81
+599045.76 789659.14
+598949.1 789726.68
+598931.53 789680.6
+598899.97 789624.43
+598896.53 789637.39
+598883.99 789657.53
+598875.36 789667.35
+598852.64 789698.27
+598834.34 789722.26
+598819.19 789742.45
+598808.46 789755.7
+598742.35 789914.52
+598726.93 789925.9
+598713.45 789929.46
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 598938.84 790163.14
+Region  1
+  65
+610643.55 800193.71
+610649.61 800237.72
+610658.99 800323.34
+610669.36 800419.74
+610697.7 800426.98
+610716.47 800444.96
+610683.24 800527.45
+610665.84 800569.49
+610645.9 800616.8
+610626.36 800665.27
+610701.8 800738.37
+610783.9 800819.69
+610879.67 800872.07
+610950.82 800883.41
+611087.97 800905.84
+611192.99 800922.2
+611211.5 800884.32
+611283.59 800916.45
+611296.07 800888.04
+611314.37 800853.33
+611325.13 800805.56
+611339.34 800784.03
+611369.04 800759.07
+611391.18 800734.75
+611398.93 800713.65
+611397.21 800660.27
+611396.13 800583
+611417.22 800544.26
+611433.81 800530.69
+611430.8 800490.66
+611423.05 800439.43
+611414.44 800349.02
+611406.24 800273.67
+611400.38 800210.76
+611396.27 800121.85
+611393.54 800067.53
+611392.17 800023.13
+611391.98 799932.34
+611387.68 799836.99
+611393.74 799803.51
+611410.55 799775.37
+611439.07 799748.8
+611466.82 799730.04
+611285.88 799704.64
+611134.3 799669.66
+611031.75 799641.7
+610991.42 799627.1
+610945.07 799591.54
+610903.96 799630.12
+610843.18 799674.1
+610755.99 799732.36
+610707.13 799766.02
+610677.74 799785.23
+610682.5 799812.22
+610688.71 799837.39
+610688.71 799872.58
+610687.53 799910.5
+610653.91 799916.36
+610633.98 799933.56
+610618.34 799958.19
+610611.5 799990.04
+610602.12 800085.43
+610610.72 800103.41
+610615.02 800126.08
+610643.55 800193.71
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611034 800267.98
+Region  1
+  138
+616132.3 806778.74
+616175.73 806731.84
+616278.52 806751.56
+616349.92 806654.27
+616093.49 806167
+616038.74 806066.63
+616003.71 805996.61
+615975.81 805951.08
+615958.66 805895.42
+615949.98 805846.81
+615945.89 805777.13
+615917.62 805735.65
+615707.75 805622.83
+615548.47 805537.38
+615477.13 805484.3
+615472.15 805446.97
+615176 805524.95
+615103.41 805544.47
+615050.32 805559.4
+615025.43 805566.04
+615001.25 805565.64
+615012.16 805590.09
+615018.8 805616.64
+615030.43 805635.84
+615041.88 805688.98
+615027.35 805718.08
+614998.25 805732.64
+614962.17 805740.25
+614903.31 805741.54
+614791.92 805756.78
+614765.34 805767.54
+614743.83 805782.1
+614736.33 805802.88
+614728.86 805836.9
+614718.9 805908.24
+614685.11 805934.59
+614662.99 805960.54
+614638.97 805999.14
+614633.32 806052.91
+614634.02 806119.97
+614653.05 806152.22
+614658.14 806180.68
+614656.26 806201.56
+614638.56 806221.18
+614608.18 806234.48
+614581.62 806256
+614562.94 806287.36
+614564.6 806434.19
+614500.73 806443.31
+614510.68 806471.52
+614522.29 806504.7
+614536.83 806533.34
+614669.56 806651.96
+614878.61 806983.78
+614891.46 807050.57
+614886.49 807105.32
+614860.77 807170.85
+614785.69 807264.99
+614750.02 807312.28
+614720.4 807364.83
+614695.74 807453.8
+614703.02 807544.38
+614725.66 807610.3
+614764.67 807663.88
+614830.18 807744.76
+614918.11 807855.36
+614905.98 807863.04
+614854.4 807857.58
+614819.63 807864.86
+614798.2 807902.88
+614800.62 807939.27
+614806.28 807962.32
+614832.76 808016.71
+614830.74 808040.57
+614766.44 808083.44
+614884.12 808547.67
+615018.38 808510.47
+615037.7 808508.5
+615042.77 808518.62
+615033.93 808537.6
+615007.37 808562.28
+614984.61 808591.39
+614985.91 808624.29
+615002.41 808663.5
+615127.7 808621.69
+615111.81 808561.6
+615114.32 808533.13
+615194.88 808510.26
+615237.59 808367.97
+615174.05 808123.18
+615168.23 808113.18
+615151.22 808083.97
+615144.24 808065.62
+615143.59 808049.18
+615154.97 808037.78
+615173.32 808032.08
+615189.15 808033.34
+615206.88 808043.45
+615229.68 808056.1
+615249.3 808051.66
+615269.54 808032.04
+615295.43 807964.97
+615369.44 807921.29
+615382.09 807906.73
+615383.34 807890.28
+615382.63 807816.9
+615392.12 807806.14
+615529.4 807727
+615559.76 807697.26
+615574.91 807661.19
+615579.3 807616.28
+615569.77 807580.85
+615546.94 807539.11
+615527.93 807522.04
+615456.99 807475.89
+615434.17 807441.74
+615410.45 807410.44
+615429.8 807373.93
+615488.44 807334.65
+615534.35 807316.4
+615563.66 807287.64
+615583.58 807243.94
+615594.09 807159.86
+615626.28 807117.13
+615654.75 807099.4
+615684.49 807094.33
+615730.99 807096.54
+615774.38 807091.76
+615803.48 807072.77
+615823.08 807051.88
+615843.54 807007.22
+615859.02 806949.7
+615887.78 806915.41
+615932.03 806896.61
+616017.75 806902.14
+616060.89 806887.76
+616094.63 806846.28
+616132.3 806778.74
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 615308.94 806746.68
+Region  1
+  37
+607242.45 808795.44
+607231.62 808762.94
+607513.73 808753.17
+607671.58 808749.14
+607652.88 808742.77
+607578.78 808721.31
+607402.73 808661.3
+607338.49 808625.5
+607258.21 808560.5
+607206.38 808491.67
+607174.94 808420.71
+607106.77 808219.54
+606918.55 808238.23
+606842.71 808243.54
+606796.44 808249.11
+606672.34 808261.39
+606611.59 808280.93
+606527.73 808308.98
+606469 808328.12
+606400.69 808351.61
+606312.59 808359.2
+606213.4 808337.88
+606176.64 808386.43
+606160.98 808446.47
+606132.26 808590.91
+606415.07 808845.88
+606423.55 808872.03
+606472.31 808920.79
+606515.42 808961.79
+606592.81 809038.41
+606612.02 809025.79
+606615.86 809054.81
+606617.94 809073.74
+606821.71 808990.28
+606840.15 808990.46
+606840.95 808956.47
+607242.45 808795.44
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606761.99 808608.31
+Region  1
+  81
+612432.56 798074.2
+612394.02 798151.94
+612347.52 798244.5
+612259.98 798313.35
+612167.2 798383.78
+612097.89 798438.95
+612075.32 798469.21
+612004.88 798629.47
+611972.05 798709.26
+611955.86 798755.53
+611928.05 798854.92
+611915.51 798900.25
+612028.03 798934.85
+612115.67 798970.73
+612155.37 799002.48
+612186.64 799038.26
+612209.18 799081.44
+612222.84 799151.62
+612249.51 799276.73
+612273.32 799442.82
+612303.8 799612.97
+612318.09 799680.29
+612328.88 799770.12
+612325.36 799827.18
+612312.86 799865.08
+612450.03 799903.38
+612519.98 799922.14
+612576.45 799936.79
+612706.61 799971.19
+612752.54 799970.97
+612820.94 799972.14
+612872.22 799980.93
+612932.34 800014.75
+612983.11 800070.72
+613034.17 800157.98
+613026.35 800110.68
+612990.78 799955.5
+612964.98 799914.84
+612962.72 799887.8
+612951.82 799856.26
+612909.36 799744.13
+612896.38 799696.7
+612953.4 799670.16
+613025.62 799653.14
+613087.01 799638.56
+613166.73 799611.94
+613260.55 799591.68
+613378.74 799580.83
+613473.66 799558.01
+613572.8 799540.33
+613595.95 799485.56
+613597.64 799469.19
+613620.79 799459.02
+613687.42 799460.72
+613641.68 799421.19
+613612.32 799368.68
+613602.49 799320.7
+613600.75 799275.79
+613586.63 799189.96
+613567.43 799029.63
+613556.14 798998.57
+613552.75 798943.82
+613600.18 798750.15
+613614.01 798705.82
+613631.52 798662.34
+613653.54 798624.51
+613601.31 798586.38
+613537.5 798551.37
+613574.77 798488.13
+613615.26 798399.54
+613608.36 798348.96
+613462.12 798372.11
+613142.25 798426.02
+613067.15 797981.57
+612892.83 797970.47
+612744.19 797961.35
+612663.04 797958.62
+612632.94 797964.54
+612544.26 798001.71
+612486.36 798034.99
+612432.56 798074.2
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612818.92 798946.66
+Region  1
+  80
+606797.13 793655.69
+606737.18 793636.55
+606723.15 793631.45
+606710.39 793632.72
+606681.05 793636.55
+606667.02 793644.21
+606646.61 793659.51
+606631.3 793677.37
+606619.82 793662.06
+606593.03 793645.48
+606575.41 793633.79
+606565.57 793657.29
+606560.81 793670.31
+606577 793700.47
+606568.11 793714.44
+606510.96 793716.98
+606474.77 793737.3
+606387.56 793823.85
+606329.14 793849.57
+606040.74 793983.7
+606031.53 793991.64
+606000.73 794105.98
+606001.05 794132.34
+606002.96 794158.05
+606017.56 794186.97
+606055.57 794266.73
+606092.9 794342.97
+606088.46 794395.46
+606044.86 794439.48
+605951.73 794533.44
+605960.2 794651.85
+606043.81 794756.25
+606109.86 794808.58
+606211.47 794865.08
+606214.24 794890.26
+606239.41 794846.45
+606300.58 794818.09
+606397.31 794821.41
+606469.49 794794.32
+606525.8 794757.94
+606646.63 794750.94
+606673.22 794738.13
+606690.51 794718.27
+606745.6 794635.64
+606808.21 794583.92
+606862.65 794535.88
+606907.81 794498.09
+606944.16 794336.87
+607043.6 794337.98
+607063.78 794307.24
+607099.65 794284.18
+607126.71 794280.53
+607260.9 794295.59
+607286.2 794281.17
+607308.97 794247.1
+607377.55 794119.15
+607388.03 794086.78
+607392.16 794002.59
+607386.13 793919.41
+607397.88 793899.09
+607382.65 793878.92
+607349.48 793838.1
+607336.72 793826.62
+607322.69 793802.38
+607315.04 793789.63
+607299.73 793767.94
+607286.97 793752.63
+607253.81 793718.19
+607235.95 793710.54
+607215.54 793710.54
+607192.58 793707.99
+607154.31 793700.33
+607022.92 793656.96
+607012.72 793687.58
+607003.79 793709.26
+606971.9 793704.16
+606937.45 793701.61
+606915.77 793699.06
+606854.54 793674.82
+606797.13 793655.69
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606627.37 794202.76
+Region  1
+  73
+607666.97 806259.51
+607703.61 806161.93
+607709.76 806083.87
+607709.76 806001.94
+607713.86 805935.04
+607716.82 805877.05
+607714.08 805847.92
+607697.7 805814.24
+607569.81 805567.18
+607561.16 805555.35
+607562.98 805505.28
+607569.58 805414.02
+607517.66 805386.4
+607451.54 805356.79
+607396.11 805336.42
+607341.7 805340.55
+607289.37 805362.59
+607241.85 805386.01
+607170.12 805412.71
+607142.68 805419.75
+607140.62 805450.05
+607128.57 805495.84
+607113.42 805537.84
+607086.73 805538.65
+607029.12 805532.35
+606949.33 805510.88
+606891.06 805484.34
+606778.74 805421.46
+606642.38 805471.73
+606646.65 805491.73
+606682.65 805631.03
+606690.48 805739.82
+606714.43 805960.19
+606732.27 806052.55
+606753.51 806240.36
+606774.64 806341.32
+606776.99 806400.02
+606725.26 806517.56
+606720.25 806559.32
+606729.17 806604.87
+606757.69 806640.91
+606795.72 806673.16
+606839.42 806695.91
+606864.76 806712.98
+606876.65 806742.83
+606880.64 806752.83
+606959.12 806747.1
+607054.07 806750.21
+607142.51 806765.54
+607230.17 806777.28
+607291.22 806809.37
+607322.53 806844.59
+607368.7 806870.41
+607414.1 806900.94
+607455.18 806956.12
+607489.62 806992.12
+607567.1 807026.56
+607659.46 807050.04
+607751.03 807071.17
+607746.34 807034.39
+607746.34 806996.04
+607746.62 806978.38
+607748.44 806955.17
+607757.54 806920.67
+607768.47 806859.59
+607780.21 806824.49
+607794.19 806758.99
+607799.19 806696.63
+607787.59 806607.71
+607755.95 806449.54
+607731.14 806350.54
+607704.29 806297.74
+607666.97 806259.51
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607248.74 806160.89
+Region  1
+  37
+608711.29 806982.56
+608251.51 805983.13
+608231.02 805991.32
+607870.21 806158.15
+607709.76 806083.87
+607703.61 806161.93
+607666.97 806259.51
+607704.29 806297.74
+607731.14 806350.54
+607755.95 806449.54
+607787.59 806607.71
+607799.19 806696.63
+607794.19 806758.99
+607780.21 806824.49
+607768.47 806859.59
+607757.54 806920.67
+607748.44 806955.17
+607746.62 806978.38
+607746.34 806996.04
+607883.62 806960.63
+607921.85 806963.36
+607976.92 806966.55
+608062.26 806974.92
+608241.59 806991.3
+608349.91 807289.81
+608365.39 807277.53
+608479.63 807187.41
+608518.77 807176.94
+608554.73 807180.58
+608592.05 807185.13
+608665.1 807191.27
+608675.57 807147.58
+608683.76 807112.53
+608689.68 807088.86
+608709.47 807010.33
+608719.03 807007.96
+608711.29 806982.56
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608182.48 806624.35
+Region  1
+  55
+610681.43 802061.74
+610559.7 802116.25
+610454.42 802167.38
+610420.89 802182.58
+610401.43 802195.25
+610379.87 802186.27
+610387.98 802117.54
+610394.87 802094.3
+610139.22 801966.05
+610066.68 802129.69
+610038.49 802197.47
+610068.26 802265.97
+610121.37 802351.88
+610186.95 802454.71
+610226.26 802503.69
+610264.84 802536
+610324.88 802567.56
+610376 802578.65
+610448.34 802586.37
+610534.73 802589.21
+610606.55 802594.63
+610649.24 802604.79
+610706.29 802621.5
+610905.71 802674.25
+610911.81 802649.85
+610938.23 802552.28
+610948.4 802541.44
+611004.64 802550.25
+611112.37 802570.58
+611090.01 802530.6
+611064.94 802485.2
+611033.77 802430.32
+611008.1 802386.1
+610953.8 802294.96
+610982.54 802277.37
+611126.86 802194.96
+611280.56 802105.1
+611272.15 802077.31
+611326.13 802021.43
+611357.72 801989.2
+611373.6 801963.47
+611378.84 801918.57
+611385.98 801808.52
+611393.13 801714.65
+611394.08 801694.96
+611336.92 801679.4
+611293.74 801669.88
+611252.68 801709.56
+611190.71 801759.57
+611126.82 801796.93
+611003.32 801859.13
+610876.98 801950.79
+610815.92 801994.94
+610774.6 802016.33
+610681.43 802061.74
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610728.1 802224.9
+Region  1
+  20
+603302.86 789119.79
+603532.11 789273.8
+603773.41 789437.03
+603806.11 789455.12
+603899.51 789107.4
+604007.76 788705.87
+603971.03 788692.86
+603940.55 788684.29
+603934.84 788673.18
+603932.3 788666.83
+603924.36 788661.11
+603282.99 788454.43
+603249.98 788562.11
+603215.69 788684.67
+603167.42 788670.68
+603059.79 788641.15
+603030.9 788632.62
+602971.52 788892.62
+603009.94 788916.44
+603302.86 789119.79
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603529.16 788900.8
+Region  1
+  97
+613515.56 796168.35
+613065.97 796290.42
+613049.31 796226.01
+613047.65 796219.59
+613037.92 796206.01
+612851.8 795994.65
+612842.35 795983.71
+611762.54 796273.77
+611766.04 796286.36
+611899.19 796788.51
+611894.42 796844.33
+611914.93 796854.82
+611868.61 796937.4
+611885.59 796945.74
+611965.5 796980.78
+612017.03 796992.71
+612131.73 797002.91
+612153.95 796980.3
+612267.11 796987.56
+612364.9 797033.28
+612418.88 797058.05
+612458.25 797060.59
+612575.72 797037.73
+612576.29 797037.77
+612649.39 797043.46
+612738.29 797083.46
+612812.58 797122.2
+612952.92 797228.24
+613052.15 797294.93
+613118.19 797320.33
+613191.85 797309.53
+613255.99 797275.24
+613348.06 797207.3
+613564.6 797124.74
+613629.84 797118.05
+613682.38 797135.78
+613756.28 797184.56
+613829.07 797232.31
+613904.2 797280.65
+614002.3 797340.34
+614034.33 797424.79
+614086.16 797501.67
+614157.79 797596.6
+614208.17 797667.31
+614223.9 797698.76
+614244.19 797745.61
+614239.11 797818.63
+614208 797895.47
+614125.45 797991.35
+614056.23 798043.42
+613990.83 798075.17
+613955.27 798078.35
+613943.2 798111.37
+614040.84 798071.6
+614079.57 798058.59
+614114.17 798055.93
+614198.47 798095.49
+614292.45 797911.34
+614320.06 797912.92
+614342.29 797916.73
+614505.81 797866.86
+614590.91 797871.94
+614681.73 797881.47
+614697.6 797805.26
+614710.94 797738.58
+614674.67 797730.27
+614627.11 797716.35
+614622.03 797691.58
+614620.77 797650.59
+614637.9 797489.34
+614642.22 797456.94
+614646.46 797422.02
+614662.94 797266.24
+614713.69 796781.16
+613987.82 796701.99
+614012.18 796648.53
+614045.66 796619.74
+614177.22 796600.13
+614235.89 796588.25
+614338.48 796502.58
+614349.79 796455.71
+614337.72 796422.05
+614241.83 796324.26
+614218.67 796287.11
+614224.68 796190.26
+614258.46 796128.96
+614291.48 796074.35
+614316.25 796024.19
+614323.87 795994.34
+614325.14 795982.91
+614271.8 795987.99
+614187.98 795986.72
+614156.23 795978.47
+613943.72 795984.84
+613737.44 796105.19
+613632.92 796134.95
+613515.56 796168.35
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613375.09 796765.84
+Region  1
+  19
+603656.45 790021.88
+603797.22 789484.97
+603800.4 789473.22
+603806.11 789455.12
+603773.41 789437.03
+603532.11 789273.8
+603302.86 789119.79
+603293.97 789142.02
+603229.11 789305.8
+603099.22 789659.61
+603006.78 789927.79
+602935.35 790140.59
+602919.89 790188.45
+602967.75 790198.02
+603005.3 790207.59
+602988.37 790293.74
+603556.42 790420.75
+603653.82 790031.88
+603656.45 790021.88
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603375.5 789820.02
+Region  1
+  57
+614380.73 801199.31
+614377.99 801092.73
+614412.62 801055.35
+614463.62 801029.07
+614499.49 800985.52
+614518.73 800954.73
+614533.03 800923.95
+614549.79 800884.18
+614564.64 800830.3
+614575.63 800754.43
+614605.6 800645.87
+614603.57 800578.54
+614596.53 800492.79
+614571.71 800382.28
+614537.04 800323.2
+614460.97 800227.99
+614411.46 800172.25
+614077.81 799904.57
+613984.04 799830.9
+613916.58 799754.35
+613888.11 799874.19
+613865.38 799967.72
+613848.15 800042.84
+613820.64 800160.29
+613799.59 800255.98
+613798.89 800295.45
+613811.81 800346.16
+613827.12 800397.35
+613836.44 800431.56
+613864.19 800519.59
+613870.89 800559.3
+613868.72 800600.68
+613841.45 800793.49
+613796.47 801130.77
+613758.68 801198.23
+613785.3 801242.86
+613691.25 801275.75
+613777.73 801403.88
+613828.84 801483.22
+613866.4 801530.07
+613922.48 801607.04
+614005.77 801702.96
+614049.75 801752.44
+614100.33 801809.07
+614172.36 801885.49
+614185.55 801862.95
+614252.63 801759.59
+614250.43 801750.23
+614289.47 801680.41
+614330.15 801591.34
+614323.01 801551.75
+614300.25 801490.36
+614303.21 801437.37
+614315.86 801360.95
+614336.75 801308.72
+614367.54 801234.5
+614380.73 801199.31
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 614139.89 800798.67
+Region  1
+  123
+610567.76 791819.43
+610231.85 790910.99
+610199.32 790825.1
+610050.24 790895.11
+610010.41 790919.72
+609984.06 790932.42
+609953.26 790954.01
+609924.05 790976.87
+609897.55 790994.88
+609869.07 791018.93
+609760.87 791088.54
+609651.4 791171.44
+609524.1 791287.12
+609377.41 791462.69
+609214.85 791455.07
+609222.47 791467.77
+609232.63 791482.37
+609244.06 791498.88
+609256.76 791480.47
+609277.72 791472.85
+609296.77 791482.37
+609325.98 791508.41
+609355.19 791545.24
+609377.41 791575.72
+609387.57 791582.7
+609400.27 791650.65
+609461.23 791660.81
+609454.25 791709.36
+609459.87 791813.23
+609475.21 791908.12
+609472.2 792006.42
+609450.46 792057.7
+609411.09 792120.89
+609346.45 792207.1
+609396.7 792250.75
+609411.08 792269.49
+609426.33 792323.47
+609417.56 792369.03
+609398.82 792397.93
+609342.47 792469.87
+609462.16 792560.36
+609517.72 792491.78
+609544.72 792449.84
+609565.52 792401.74
+609575.21 792332.35
+609580.61 792300.17
+609596.49 792284.29
+609688.25 792245.24
+609759.69 792215.69
+609804.14 792197.59
+609797.15 792235.37
+609787.31 792278.87
+609819.55 792265.22
+609868.91 792246.8
+609861.29 792280.12
+609853.67 792311.24
+609843.83 792349.98
+609833.35 792395.7
+609853.03 792406.21
+609876.85 792419.23
+609899.39 792433.2
+609902.56 792465.59
+609907.64 792505.59
+609911.45 792546.21
+609916.53 792598.92
+609923.83 792684
+609906.38 792767.47
+609900.34 792798.58
+609894.63 792831.29
+609974.64 792832.56
+609974 792873.83
+609973.05 792939.89
+609973.05 793003.39
+609973.05 793073.88
+609973.06 793161.21
+609957.18 793162.48
+609923.53 793162.16
+609891.78 793163.11
+609892.73 793239.98
+609958.45 793239.34
+610040.69 793239.66
+610073.39 793239.64
+610107.04 793239.64
+610133.71 793232.33
+610160.38 793217.41
+610166.73 793322.51
+610189.27 793334.89
+610215.31 793338.39
+610240.71 793327.28
+610267.7 793269.18
+610295.89 793207.77
+610324.33 793167.84
+610348.46 793159.58
+610364.65 793157.99
+610398.31 793060.84
+610400.36 793003.22
+610467.67 792960.99
+610513.71 792938.13
+610557.84 792922.57
+610609.59 792915.9
+610662.93 792919.08
+610721.67 792933.04
+610747.07 792937.8
+610778.82 792942.88
+610689.13 792836.04
+610492.62 792601.04
+610463.25 792519.37
+610476.49 792451.14
+610505.5 792405.55
+610556.42 792369.91
+610618.19 792352.94
+610813.53 792326.34
+610928.94 792309.03
+610981.04 792286.4
+611017.08 792256.53
+611043.66 792191.8
+611045.17 792131.49
+611024.47 792073.78
+610975.76 792025.47
+610933.83 792003.52
+610645.32 791908.14
+610596.27 791871.02
+610567.76 791819.43
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610102.47 792024.54
+Region  1
+  47
+603482.28 795647.03
+603622.97 795654.06
+603709.7 795669.95
+603838.49 795684.61
+603918.07 795683.91
+603888.63 794997.02
+603776.87 795028.14
+603770.21 795044.09
+603729.05 795065.89
+603673.81 795065.25
+603642.06 795049.38
+603556.97 795060.16
+603438.86 795029.68
+603327.1 795016.98
+603221.05 795041.75
+603179.65 795012.7
+603146.84 794997.04
+603137.1 795019.9
+603125.46 795012.92
+603084.17 794979.65
+603073.39 794971.85
+603061.86 794962.86
+603032.33 794965.51
+602938.39 795123.23
+602949.44 795149.64
+602934.19 795204.84
+602830.03 795486.53
+602686.52 795478.91
+602577.14 795473.05
+602465.17 795465.41
+602437.87 795464.99
+602441.25 795507.74
+602445.49 795540.57
+602468.13 795573.16
+602524.87 795610.83
+602524.27 795646.08
+602528.08 795670.13
+602729.34 795792.63
+602785.65 795821.36
+602827.14 795841.04
+602892.97 795865.56
+602961.98 795882.28
+603037.05 795881.61
+603154.81 795843.25
+603298.75 795739.12
+603396.55 795676.4
+603482.28 795647.03
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603272.83 795428.52
+Region  1
+  133
+606546.87 807108.56
+606532.35 807144.63
+606520.38 807190.18
+606492.62 807257.89
+606466.12 807327.5
+606422.88 807399.77
+606416.79 807476.33
+606402 807543.33
+606393.74 807618.6
+606357.82 807675.45
+606309.05 807753.19
+606264.53 807823.86
+606235.55 807880.4
+606209.33 807913.64
+606121.25 807948.6
+606147.21 807902.31
+605549.66 807841.92
+605544.71 807870.89
+605335.52 807848.98
+605330.22 807947.64
+605335.16 807969.55
+605368.38 807993.57
+605461.67 808005.59
+605454.6 808091.81
+605454.6 808113.72
+605475.1 808111.6
+605497.71 808112.31
+605523.51 808121.91
+605503.72 808197.53
+605629.52 808213.79
+605660.33 808340.17
+605666.11 808404.69
+605638.94 808445.2
+605594.54 808479.82
+605542.95 808527.17
+605516.09 808570.99
+605502.66 808644.49
+605489.23 808704.56
+605478.28 808760.04
+605492.07 808780.78
+605732.35 808832.41
+605759.21 808837.36
+605785.36 808840.19
+605807.26 808827.46
+605870.87 808785.06
+605865.92 808813.33
+605855.19 808878.35
+605851.41 808899.86
+605859.02 808914.41
+605885.65 808952.35
+605898.32 808972.59
+605907.83 808987.13
+605985.72 808966.32
+605985.72 808982.58
+606000.27 809001.01
+606170.89 808991.76
+606236.61 808986.82
+606281.14 808983.28
+606337.68 809006.61
+606362.41 809015.79
+606400.93 808890.41
+606415.07 808845.88
+606132.26 808590.91
+606160.98 808446.47
+606176.64 808386.43
+606213.4 808337.88
+606312.59 808359.2
+606400.69 808351.61
+606469 808328.12
+606527.73 808308.98
+606611.59 808280.93
+606672.34 808261.39
+606796.44 808249.11
+606842.71 808243.54
+606918.55 808238.23
+607106.77 808219.54
+607174.94 808420.71
+607206.38 808491.67
+607258.21 808560.5
+607338.49 808625.5
+607402.73 808661.3
+607578.78 808721.31
+607652.88 808742.77
+607671.58 808749.14
+607751.25 808744.67
+607797.87 808734.65
+607752.95 808684.34
+607696.87 808621.46
+607652.03 808573.66
+607647.78 808502.7
+607640.75 808381.83
+607638.86 808249.91
+607659.25 808209.12
+607690.11 808160.72
+607824.54 807939.76
+607882.53 807841.82
+607922.47 807778.52
+607994.9 807657.22
+608038.87 807555.89
+608084.34 807453.92
+608139.18 807362.64
+608195.16 807364
+608247.51 807362.18
+608349.91 807289.81
+608241.59 806991.3
+608062.26 806974.92
+607976.92 806966.55
+607921.85 806963.36
+607883.62 806960.63
+607746.34 806996.04
+607746.34 807034.39
+607751.03 807071.17
+607659.46 807050.04
+607567.1 807026.56
+607489.62 806992.12
+607455.18 806956.12
+607414.1 806900.94
+607368.7 806870.41
+607322.53 806844.59
+607291.22 806809.37
+607230.17 806777.28
+607142.51 806765.54
+607054.07 806750.21
+606959.12 806747.1
+606880.64 806752.83
+606824.96 806769.94
+606762.34 806812.99
+606729.48 806856.03
+606706.11 806894
+606671.35 806938.94
+606624.58 806992.11
+606578.45 807059.83
+606546.87 807108.56
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 606896.73 807815.75
+Region  1
+  56
+609965.13 803428.54
+609957.14 803519.81
+609943.25 803673.69
+609948.65 803765.66
+609952.08 803845.25
+609975.08 803926.49
+609992.1 803976.67
+610046.6 803932
+610079.75 803867.79
+610103.79 803830.94
+610141.12 803796.89
+610227.43 803721.33
+610241.77 803708.19
+610254.91 803702.81
+610473.2 803609.45
+610546.08 803578.8
+610605.56 803557.89
+610675.44 803556.4
+610703.94 803435.35
+610708.1 803420.62
+610715.79 803386.35
+610757.88 803346.52
+610794.09 803187.31
+610805.46 803133.68
+610822.69 803069.36
+610808.19 803059.51
+610789.14 803045.9
+610658.64 802961.82
+610546.56 802888.49
+610523.02 802893.47
+610485.23 802902.44
+610436.56 802900.2
+610400.05 802891.87
+610369.95 802871.37
+610321.76 802840.13
+610280.45 802813.87
+610254.51 802801.7
+610170.28 802797.22
+610164.04 802780.73
+610143.23 802747.11
+610127.61 802705.28
+610122.36 802688.26
+610119.62 802679.22
+610036.6 802657.99
+610022.52 802652.74
+610007.6 802677.75
+609978.14 802714.61
+609946.12 802761.36
+609918.74 802815.32
+609917.78 802831.97
+609940.09 802904.69
+609959.17 802969.21
+609972.53 803028.68
+609971.39 803082.86
+609957.93 803161.96
+609965.13 803428.54
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610294.57 803263.83
+Region  1
+  53
+612593.97 797653.43
+613257.15 797568.02
+613901.69 797827.51
+613878.54 797893.57
+614009.25 797946.35
+614006.43 797953.69
+613990.83 797999.61
+613978.76 798027.55
+613970.78 798043.74
+613965.07 798058.35
+613955.27 798078.35
+613990.83 798075.17
+614056.23 798043.42
+614125.45 797991.35
+614208 797895.47
+614239.11 797818.63
+614244.19 797745.61
+614223.9 797698.76
+614208.17 797667.31
+614157.79 797596.6
+614086.16 797501.67
+614034.33 797424.79
+614002.3 797340.34
+613904.2 797280.65
+613829.07 797232.31
+613756.28 797184.56
+613682.38 797135.78
+613629.84 797118.05
+613564.6 797124.74
+613348.06 797207.3
+613255.99 797275.24
+613191.85 797309.53
+613118.19 797320.33
+613052.15 797294.93
+612952.92 797228.24
+612812.58 797122.2
+612738.29 797083.46
+612649.39 797043.46
+612576.29 797037.77
+612549.01 797084.94
+612502.35 797165.63
+612501.86 797166.47
+612404.75 797334.37
+612509.85 797394.67
+612403.39 797543.55
+612438.95 797568.62
+612459.47 797574.55
+612489.1 797587.32
+612540.17 797579.11
+612563.42 797577.74
+612569.35 797616.95
+612572.09 797653.43
+612593.97 797653.43
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613365.03 797472.66
+Region  1
+  100
+604837.81 802684.65
+604842.26 802578.27
+604848.01 802523.91
+604854.1 802480
+604874.27 802345.44
+604866.04 802264.79
+604844.64 802200.6
+604795.26 802140.52
+604733.53 802093.61
+604673.04 802066.06
+604516.67 802005.15
+604492.92 802036.11
+604444.54 802109.53
+604401.83 802173.95
+604357.88 802233.63
+604228.58 802286.31
+604169.49 802267.23
+604070.79 802238.34
+604034.7 802227.22
+604014.39 802221.69
+603969.46 802283.23
+603636.66 802748.96
+603603.2 802791.82
+603573.71 802824.24
+603580.36 802844.68
+603697.61 802862.69
+603773.12 802986.73
+603784.82 802996.57
+603798.36 802998.42
+603824.52 803019.04
+603852.22 803039.96
+603887.91 803069.51
+603919.3 803092.28
+603962.39 803122.44
+604005.47 803144.6
+604051.01 803165.52
+604097.79 803180.91
+604146.41 803173.52
+604188.88 803185.22
+604288.9 802983.07
+604320.29 803002.15
+604359.68 803023.08
+604416.3 803049.54
+604431.69 803016.92
+604496.31 802887.67
+604931.74 803101.55
+604978.78 803051.88
+605142.93 802945.76
+605166.45 802930.6
+605176.91 802953.61
+605168.02 802978.18
+605149.73 803024.7
+605149.2 803057.11
+605157.31 803102.33
+605215.86 803131.61
+605234.68 803100.76
+605255.07 803064.17
+605267.09 803045.35
+605268.66 803037.51
+605303.16 803035.94
+605361.71 803029.15
+605501 803009.02
+605513.02 803025.75
+605613.39 803005.36
+605722.57 802979.61
+605788.78 802964.33
+605815.45 802970.6
+605880.79 803003.01
+605918.43 803022.35
+605940.91 803036.47
+605962.86 803012.42
+605992.66 802999.35
+606036.57 802980.01
+606074.48 802960.93
+606151.32 802926.95
+606205.45 802904.07
+606266.06 802882.25
+606263.45 802871.8
+606051.57 802267.69
+606030.17 802210.08
+606020.29 802186.17
+605984.08 802185.39
+605961.86 802191.15
+605929.76 802219.14
+605887.79 802299.79
+605834.71 802400.61
+605801.79 802471.39
+605736.77 802499.37
+605197.47 802712.88
+605115.4 802746.86
+605085.08 802759.93
+605062.08 802771.95
+605047.96 802787.11
+605035.42 802804.89
+605020.78 802796.52
+605001.44 802789.73
+604906.07 802747.34
+604864.08 802734.11
+604833.02 802720.31
+604837.81 802684.65
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604836.35 802677.09
+Region  1
+  21
+610409.8 796630.57
+610092.97 795436.65
+610086.66 795414.99
+610085.28 795410.24
+609923.45 795453.85
+609696.71 795514.96
+609696.4 795515.04
+609682.69 795518.73
+609680.35 795519.36
+609678.24 795519.93
+609674.68 795520.89
+609674.64 795520.9
+609536.93 795558.01
+609277.95 795863.12
+609277.84 795863.25
+609213.55 795938.99
+609187.49 796032.42
+609200.43 796041.44
+610364.34 796720.1
+610445.47 796767.66
+610409.8 796630.57
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609861.22 796017.31
+Region  1
+  45
+608765.28 799110.24
+609280.53 799126.82
+609215 799391.25
+609259.34 799386.37
+609626.53 799456.79
+609622.79 799547.27
+609702.27 799550.31
+609736.65 799553.3
+609772.95 799554.41
+609806.25 799555.8
+609852.39 799558.92
+609847.88 799505.5
+609844.41 799460.75
+609881.53 799507.23
+609905.46 799516.25
+609941.54 799514.52
+609976.66 799496.43
+610008.21 799442.43
+610055.08 799345.17
+610078.29 799289.84
+610092.85 799254.65
+610002.91 799197.47
+609898.85 799132.25
+609843.8 799131.75
+609824.38 799133.88
+609809.37 799133.47
+609787.22 799131.61
+609794.22 798505.1
+609267.77 798492.3
+609193.84 798617.41
+609127.52 798518.11
+609104.37 798482.7
+608963.57 798554.33
+608931.03 798568.31
+608885.94 798568.09
+608883.77 798788.94
+608765.57 798783.5
+608731.13 798788.79
+608706.07 798793.14
+608711.52 798829.09
+608721.41 798909.42
+608725.8 798953.29
+608735.06 799014.71
+608745.29 799107.81
+608765.28 799110.24
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609414.03 798979.15
+Region  1
+  65
+610559.48 794998.34
+610681.5 794960.81
+610681.54 794960.8
+610681.59 794960.78
+610681.61 794960.77
+610768.27 794934.12
+610875.4 794905.36
+610875.49 794905.34
+610957.01 794883.46
+611000.71 794871.73
+611209.69 794815.64
+611227.96 794817.3
+611229.67 794817.46
+611033.95 794075.11
+610999.9 794023.18
+610972.59 793985.92
+610901.33 793884.54
+610807.67 793951.22
+610740.04 794004.88
+610714.96 793957.57
+610710.51 793868.98
+610708.45 793806.6
+610740.2 793724.05
+610760.84 793694.2
+610767.19 793662.13
+610755.12 793644.35
+610669.98 793645.31
+610603.62 793646.9
+610542.66 793648.79
+610387.4 793652.92
+610345.42 793618.57
+610322 793621.78
+610295.96 793630.04
+610272.64 793661.6
+610256.27 793683.7
+610164.51 793624.96
+610166.42 793656.07
+610172.14 793756.41
+610185.97 793778.68
+610187.9 793845.14
+610151.85 793914.76
+610073.61 794046.78
+610059.32 794068.37
+610024.71 794123.62
+610003.59 794165.03
+609992.79 794218.68
+609996.6 794287.58
+610019.9 794340.76
+610063.42 794385.67
+610085.58 794425.55
+610088.49 794473.78
+610069.8 794516.06
+610021.62 794578.71
+610021.3 794633.64
+610033.36 794659.36
+610042.25 794677.14
+610097.04 794747.44
+610121.34 794779.67
+610140.07 794808.88
+610151.5 794877.14
+610160.8 794944.94
+610288.59 795355.45
+610355.98 795337.29
+610558.47 794998.65
+610559.48 794998.34
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610548.32 794412.86
+Region  1
+  86
+609718.41 793322.99
+609750.82 793322.8
+609910.84 793322.16
+610013.07 793317.66
+610166.73 793322.51
+610160.38 793217.41
+610133.71 793232.33
+610107.04 793239.64
+610073.39 793239.64
+610040.69 793239.66
+609958.45 793239.34
+609892.73 793239.98
+609891.78 793163.11
+609923.53 793162.16
+609957.18 793162.48
+609973.06 793161.21
+609973.05 793073.88
+609973.05 793003.39
+609973.05 792939.89
+609974 792873.83
+609974.64 792832.56
+609894.63 792831.29
+609900.34 792798.58
+609906.38 792767.47
+609923.83 792684
+609916.53 792598.92
+609911.45 792546.21
+609907.64 792505.59
+609902.56 792465.59
+609899.39 792433.2
+609876.85 792419.23
+609853.03 792406.21
+609833.35 792395.7
+609843.83 792349.98
+609853.67 792311.24
+609861.29 792280.12
+609868.91 792246.8
+609819.55 792265.22
+609787.31 792278.87
+609797.15 792235.37
+609804.14 792197.59
+609759.69 792215.69
+609688.25 792245.24
+609596.49 792284.29
+609580.61 792300.17
+609575.21 792332.35
+609565.52 792401.74
+609544.72 792449.84
+609517.72 792491.78
+609462.16 792560.36
+609342.47 792469.87
+609398.82 792397.93
+609417.56 792369.03
+609426.33 792323.47
+609411.08 792269.49
+609396.7 792250.75
+609346.45 792207.1
+609258.99 792314.26
+609177.05 792422.87
+609156.73 792476.21
+609143.4 792564.45
+609132.61 792641.89
+609133.88 792693.65
+609183.73 792875.22
+609168.81 792948.9
+609107.16 793048.72
+609051.49 793141.13
+609002.78 793209.48
+608947.13 793292.83
+608943.32 793339.19
+608955.39 793367.76
+608961.1 793467.46
+608948.41 793545.77
+608918.28 793616.24
+608933.84 793613.07
+608981.78 793614.33
+609095.45 793615.91
+609155.14 793614.01
+609190.7 793604.19
+609406.6 793522.59
+609499.47 793546.36
+609530.21 793561.73
+609544.54 793576.58
+609574.3 793534.83
+609659.06 793409.48
+609718.41 793322.99
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609492.45 792961.13
+Region  1
+  69
+610193.73 805814.3
+610207.84 805800.62
+610761.23 805931.99
+610865.94 805981.61
+610848.63 805881.18
+610859.29 805835.68
+610871.55 805795.71
+610883.8 805763.74
+610894.72 805714.98
+610891.52 805665.95
+610875.81 805615.57
+610858.76 805592.66
+610845.97 805562.81
+610811.86 805498.33
+610791.08 805443.45
+610776.43 805411.21
+610808.93 805395.76
+610844.1 805408.01
+611002.39 805320.62
+611035.43 805307.83
+611084.41 805306.32
+611093.25 805271.89
+611102.84 805260.16
+611079.39 805227.12
+611059.68 805169.57
+611094.85 805159.98
+611139.29 805156.35
+611171.05 805147.19
+611196.9 805131.47
+611233.67 805121.87
+611282.16 805124.54
+611322.13 805132.53
+611370.62 805153.32
+611467.61 805203.94
+611554.21 805242.06
+611593.64 805245.26
+611711.41 805235.13
+611790.26 805226.43
+611957.32 804961.32
+611902.44 804935.75
+611896.57 804945.34
+611882.19 804936.81
+611869.4 804932.55
+611855.54 804930.42
+611839.55 804926.15
+611816.11 804920.29
+611774.54 804912.3
+611568.97 804480.02
+611396.73 804561.67
+611382.27 804517.55
+611023.33 804657.88
+610844 804730.43
+610805.44 804748.99
+610721.33 804838.4
+610697.22 804857.93
+610683 804868.29
+610632.15 804898.9
+610464.94 804992.2
+610346.57 804987.83
+610099.81 805072.1
+610124.07 805151.43
+610140 805202.88
+610151.84 805297.47
+610166.82 805371.49
+610143.71 805366.36
+610102.22 805628.99
+610092.2 805700.02
+610094.02 805720.96
+610193.73 805814.3
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610898.57 805181.48
+Region  1
+  70
+610282.93 799862.52
+610338.81 799876.52
+610415.33 799884.78
+610440.47 799877.27
+610532.34 799854.98
+610534.29 799824.88
+610550.1 799658.54
+610644.41 799587.1
+610698.7 799522.64
+610658.99 799504.51
+610624.38 799488.64
+610589.85 799319.74
+610779.06 799024.33
+610725.72 798989.23
+610671.01 798963.69
+610629.52 798930.41
+610594.61 798892.66
+610569.78 798878.83
+610500.48 798849.2
+610448.5 798812.72
+610421.15 798788.56
+610397.45 798766.14
+610355.89 798718.51
+610331.32 798730.95
+610290.67 798748.85
+610256.39 798763.41
+610231.51 798761.29
+610213.92 798822.87
+610208.01 798845.2
+610202.55 798864.92
+610235.61 798880.7
+610277.48 798890.71
+610253.96 798916.01
+610223.32 798946.65
+610199.36 798978.2
+610182.98 799004.59
+610128.67 799112
+610140.2 799139.3
+610104.08 799232.51
+610092.85 799254.65
+610078.29 799289.84
+610055.08 799345.17
+610008.21 799442.43
+609976.66 799496.43
+609941.54 799514.52
+609905.46 799516.25
+609881.53 799507.23
+609844.41 799460.75
+609847.88 799505.5
+609852.39 799558.92
+609856.09 799613.25
+609860.96 799661.02
+609850.24 799708.79
+609838.54 799779.95
+609820.99 799856.96
+609838.54 799872.56
+609862.91 799896.93
+609900.93 799933
+609949.67 799980.77
+609967.22 800003.19
+609992.42 799938.1
+610049.25 799950.17
+610066.65 799934.95
+610095.9 799917.41
+610132.94 799894.98
+610182.92 799865.71
+610207.37 799848.57
+610242.93 799824.42
+610253.09 799844.74
+610282.93 799862.52
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610302.18 799401.54
+Region  1
+  73
+609959.7 801971.07
+609735.1 801674.65
+609607.98 801510.8
+609545.37 801454.77
+609481.98 801424.2
+609305.37 801363.3
+609217.86 801333.94
+609085.66 801293.33
+608996.76 801256.5
+608785.94 801189.83
+608571.84 801115.17
+608447.19 801073.74
+608370.43 801040.3
+608338.12 801055.88
+608338.12 801068.04
+608343.44 801080.58
+608382.59 801130.37
+608437.69 801158.87
+608458.41 801174.25
+608466.01 801190.59
+608461.83 801250.25
+608457.43 801317.33
+608452.11 801349.64
+608460.24 801369.61
+608455.68 801412.18
+608467.84 801477.55
+608466.32 801536.85
+608432.11 801601.46
+608407.03 801663.8
+608402.41 801699.92
+608407.49 801729.13
+608420.19 801755.8
+608434.16 801785.01
+608450.67 801829.46
+608468.36 801872.94
+608494.95 801882.42
+608538.3 801898.04
+608587.83 801843.43
+608628.47 801807.87
+608653.87 801785.01
+609171.37 802336.92
+609020.02 802475
+609026.76 802512.56
+609034.47 802540.98
+609053.25 802562.17
+609076.61 802570.11
+609115.62 802561.44
+609144.99 802541.7
+609176.78 802519.55
+609236.5 802481.02
+609285.14 802447.79
+609351.6 802418.41
+609423.6 802424.77
+609466.7 802430.45
+609428.65 802549.41
+609616.24 802750.49
+609634.05 802784.2
+609658.62 802802.5
+609794.32 802754.83
+609823.8 802727.37
+609888.82 802691.25
+609927.52 802668.29
+609977.96 802639.71
+610027.7 802604.13
+610028.58 802565.8
+610014.55 802494.97
+610070.33 802426.25
+610121.37 802351.88
+610068.26 802265.97
+610038.49 802197.47
+610013.02 802110.45
+609990.83 802033.47
+609959.7 801971.07
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609273.83 801908.22
+Region  1
+  174
+613342.23 805375.22
+613966.89 805614.13
+614298.72 806107.69
+614439.34 806252.52
+614500.73 806443.31
+614564.6 806434.19
+614562.94 806287.36
+614581.62 806256
+614608.18 806234.48
+614638.56 806221.18
+614656.26 806201.56
+614658.14 806180.68
+614653.05 806152.22
+614634.02 806119.97
+614633.32 806052.91
+614638.97 805999.14
+614662.99 805960.54
+614685.11 805934.59
+614718.9 805908.24
+614728.86 805836.9
+614736.33 805802.88
+614743.83 805782.1
+614765.34 805767.54
+614791.92 805756.78
+614903.31 805741.54
+614962.17 805740.25
+614998.25 805732.64
+615027.35 805718.08
+615041.88 805688.98
+615030.43 805635.84
+615018.8 805616.64
+615012.16 805590.09
+615001.25 805565.64
+615025.43 805566.04
+615050.32 805559.4
+615103.41 805544.47
+615176 805524.95
+615472.15 805446.97
+615477.13 805484.3
+615548.47 805537.38
+615707.75 805622.83
+615917.62 805735.65
+615945.89 805777.13
+615949.98 805846.81
+615958.66 805895.42
+615975.81 805951.08
+616003.71 805996.61
+616038.74 806066.63
+616093.49 806167
+616262.63 806023.7
+616355.59 805931.29
+616467.51 805815.48
+616540.25 805755.98
+616572.51 805735.09
+616618.08 805730
+616666.18 805722.39
+616706.68 805709.09
+616740.71 805692.38
+616759.71 805682.88
+616733.49 805574.54
+616707.4 805505.24
+616676.76 805435.97
+616534.94 805150.29
+616505.35 805029.13
+616497.05 804954.49
+616488.33 804837.72
+616481.61 804761.89
+616477.58 804732.12
+616469.32 804658.58
+616461.26 804628.24
+616450.5 804602.51
+616431.84 804562.03
+616394 804508.86
+616309.5 804426.64
+616285.84 804405.04
+616262.4 804382.97
+616237.02 804357.36
+616203.29 804325.68
+616172.65 804301.01
+616142.69 804277.88
+616118.91 804270.33
+616080.73 804258.21
+616036.05 804243.81
+615771.01 804169.15
+615686.52 804145.92
+615617.23 804128.32
+615339.24 804061.9
+615304.64 804054.61
+615392.27 804113.04
+615442.75 804114.31
+615431 804143.84
+615368.46 804215.91
+615300.19 804274.33
+615295.55 804330.27
+615302.19 804362.14
+615303.68 804401.84
+615309.66 804432.71
+615317.62 804494.45
+615306.17 804579.61
+615298.38 804617.6
+615297.71 804648.14
+615337.54 804672.7
+615351.48 804687.31
+615345.01 804704.07
+615367.92 804752.54
+615387.17 804798.01
+615328.25 804855.3
+615316.97 804881.19
+615326.26 804932.31
+615267.18 804990.4
+615239.29 805011.98
+615209.42 804837.04
+615187.18 804761.65
+615146.85 804691.08
+615100.21 804641.45
+615052.08 804606.27
+614999.64 804583.36
+614962.46 804573.07
+614915.82 804564.94
+614846.78 804565.61
+614796.99 804575.9
+614763.97 804591.71
+614712.52 804615.61
+614678.99 804627.56
+614637.83 804649.14
+614611.61 804661.09
+614615.1 804517.23
+614560.83 804456
+614489.29 804380.8
+614323.82 804207.4
+614233.04 804149.83
+614185.24 804127.92
+614155.37 804132.57
+614119.52 804137.55
+614075.54 804110.54
+614052.18 804069.33
+614025.42 804024.56
+613981.1 803955
+613999.53 803932.94
+614018.12 803925.3
+614048.32 803916.67
+614080.19 803904.72
+614118.36 803873.52
+613945.09 803856.92
+613834.23 803846.96
+613760.87 803838.26
+613679.88 803824.32
+613608.18 803807.06
+613543.62 803786.69
+613484.54 803763.12
+613418.32 803733.46
+613362.55 803706.24
+613273.73 803659.74
+613049.49 804022.91
+613024.21 804053.29
+612988.13 804069.36
+612960.63 804072.61
+612964.88 804103.62
+612785.14 804182.62
+612958.93 804728.28
+612987.38 804818.92
+613032.7 804979.95
+613042.28 804998.19
+613080.04 805048.94
+613120.12 805081.43
+613165.6 805112.29
+613218.29 805144.82
+613234.2 805154.47
+613266.36 805192.42
+613288.2 805254.27
+613306.86 805293.13
+613315.92 805319.24
+613316.72 805337.1
+613342.23 805375.22
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 614724.22 804955.63
+Region  1
+  73
+616122.82 799449.45
+616150.28 799318.76
+616166.05 799273.2
+616198.24 799120.65
+616214.44 799044.13
+616198.72 799016.66
+616145.36 798929.04
+616137.59 798915.3
+616077.27 798941.02
+616030.81 798945.55
+615977.66 798962.66
+615910.57 798980.35
+615868.66 798981.3
+615820.72 798954.32
+615784.52 798897.16
+615748.65 798819.39
+615535.54 798768.07
+615401.56 798771.24
+615366.98 798788.8
+615316.47 798907.13
+615280.9 798946.56
+615222.48 798966.88
+615109.45 798993.55
+615046.58 799008.86
+614975.46 799026
+614926.79 799037.62
+614871.92 799051.86
+614788.16 799076.99
+614759.68 799098.77
+614729.52 799142.75
+614723.03 799172.24
+614720.52 799280.3
+614707.04 799306.85
+615055.78 799796.55
+615416.18 799884.27
+615437.96 799901.02
+615456.37 799914.64
+615542.49 799983.45
+615591.39 800015.04
+615671.01 800066.1
+615746.75 800085.14
+615779.63 799990.37
+615788.29 799979.12
+615902.54 799938.01
+615906.52 799937.28
+615886.95 799872.34
+615866.81 799822.46
+615860.06 799803.4
+615867.9 799769.36
+615876.43 799739.86
+615881.51 799717
+615931.68 799699.53
+616008.19 799713.82
+616021.81 799759.26
+616041.54 799815.15
+616124.21 799787.6
+616161.9 799866.02
+616179.99 799914.28
+616222.54 800025.73
+616220.66 800061.76
+616245.34 800130.28
+616252.28 800091.63
+616265.24 800062.01
+616295.32 800023.84
+616322.4 800010.65
+616394.17 800023.03
+616434.73 800081.34
+616280.86 799567.83
+616260.52 799549.69
+616190.7 799521.65
+616112.66 799482.48
+616113.93 799472.95
+616122.82 799449.45
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 615562.85 799407.57
+Region  1
+  47
+611196.87 801147.4
+611116.5 801144.03
+611015.89 801133.41
+611003.84 801166.55
+610981.46 801182.05
+610941.65 801180.51
+610850.84 801174.05
+610714.63 801226.77
+610518.38 801303.38
+610367.52 801363.79
+610331.37 801400.38
+610363.22 801470.53
+610438.32 801644.18
+610445.64 801778.01
+610406.68 802005.86
+610409.07 802042.22
+610394.87 802094.3
+610387.98 802117.54
+610379.87 802186.27
+610401.43 802195.25
+610420.89 802182.58
+610454.42 802167.38
+610559.7 802116.25
+610681.43 802061.74
+610774.6 802016.33
+610815.92 801994.94
+610876.98 801950.79
+611003.32 801859.13
+611126.82 801796.93
+611190.71 801759.57
+611252.68 801709.56
+611293.74 801669.88
+611328.67 801633.68
+611369 801613.99
+611416.63 801610.81
+611449.43 801622.15
+611501.36 801641.1
+611574.49 801666.71
+611562.86 801639.93
+611501.85 801531.02
+611464.36 801418.43
+611421.18 801312.79
+611382.37 801255.86
+611361.28 801214.97
+611349.23 801193.89
+611335.02 801167.2
+611196.87 801147.4
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610875.36 801577.18
+Region  1
+  81
+608038.87 807555.89
+607994.9 807657.22
+607922.47 807778.52
+607882.53 807841.82
+607824.54 807939.76
+607690.11 808160.72
+607659.25 808209.12
+607638.86 808249.91
+607640.75 808381.83
+607647.78 808502.7
+607652.03 808573.66
+607696.87 808621.46
+607752.95 808684.34
+607797.87 808734.65
+607905.92 808703.03
+608030.57 808645.35
+608131.76 808591.59
+608186.05 808548.9
+608221.89 808516.75
+608338.37 808558.38
+608445.1 808620.8
+608504.66 808641.35
+608568.96 808656.64
+608865.17 808381.98
+608939.48 808348.25
+609000.1 808319.79
+609043.05 808260.49
+609028.82 808243.1
+609009.32 808221.49
+609021.44 808198.83
+609021.44 808161.41
+609015.64 808096.58
+609016.17 808044.93
+609003.78 807996.73
+608989.03 807953.51
+608984.81 807920.83
+608987.45 807881.83
+608977.17 807855.77
+608953.98 807838.38
+608921.83 807835.74
+608833.81 807857.35
+608833.28 807838.38
+608835.92 807826.26
+608841.19 807813.61
+608850.15 807799.9
+608868.07 807785.67
+608888.1 807778.29
+608920.25 807769.33
+608932.37 807753
+608919.19 807720.85
+608852.52 807648.89
+609019.34 807516.34
+609064.14 807508.44
+609115.79 807501.59
+609169.02 807491.05
+609249.66 807471.54
+609276.01 807456.79
+609229.63 807433.6
+609162.7 807400.92
+609116.84 807376.68
+609069.04 807343.41
+609013.28 807310.86
+608951.84 807272.63
+608872.05 807211.06
+608719.03 807007.96
+608709.47 807010.33
+608689.68 807088.86
+608683.76 807112.53
+608675.57 807147.58
+608665.1 807191.27
+608592.05 807185.13
+608554.73 807180.58
+608518.77 807176.94
+608479.63 807187.41
+608365.39 807277.53
+608349.91 807289.81
+608247.51 807362.18
+608195.16 807364
+608139.18 807362.64
+608084.34 807453.92
+608038.87 807555.89
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608398.99 807959.41
+Region  1
+  8
+608993.06 803798.31
+607875.29 803403.91
+607844.46 803395.24
+607744.77 803362.49
+607739.96 803615.34
+608916.5 804023.17
+608922.76 804007.76
+608993.06 803798.31
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608346.71 803696.9
+Region  1
+  63
+606030.4 798778.19
+605728.08 798570.62
+605656.79 798513.9
+605598.36 798471.99
+605544.69 798435.15
+605471.82 798381.37
+605419.74 798343.58
+605372.9 798301.19
+605357.34 798284.04
+605334.48 798247.84
+605313.67 798198.46
+605291.92 798120.48
+605267.59 798256.08
+605124.46 798359.68
+605095.96 798401.62
+605085.98 798438.5
+605085.98 798465.4
+605092.92 798495.34
+605108.97 798516.13
+605133.48 798531.13
+605163.43 798531.1
+605186.03 798522.69
+605206.38 798506.37
+605225.04 798486.84
+605239.35 798476.86
+605264.95 798458.21
+605281.44 798458.64
+605290.99 798468.62
+605294.46 798482.5
+605218.1 798564.94
+605187.51 798598.16
+605164.08 798614.66
+605126.77 798616.39
+605041.94 798594.52
+605032.62 798627.28
+604975.56 798860.47
+604958.86 798922.29
+604941.94 798948.76
+604885.1 798999.52
+604824.36 799054.63
+604744.53 799130.12
+604722.4 799294.55
+604710.16 799380.02
+605009.27 799284.37
+605096.77 799260.14
+605169.91 799237.7
+605252.25 799222.67
+605325.39 799206.07
+605418.48 799199.11
+605540.98 799189.24
+605556.16 799192.25
+605589.68 799188.13
+605625.37 799167.17
+605643.99 799154.54
+605669.82 799122.08
+605707.8 799077.72
+605779.87 799008.19
+605827.5 798961.16
+605863.06 798920.52
+605890.04 798888.77
+605939.57 798843.34
+605994.5 798803.33
+606030.4 798778.19
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605342.81 798844.12
+Region  1
+  42
+613318.17 795364.78
+612697.83 795750.05
+612641.71 795751.43
+612729.07 795852.56
+612747.63 795874.05
+612749.56 795876.29
+612749.62 795876.36
+612842.35 795983.71
+612851.8 795994.65
+613037.92 796206.01
+613047.65 796219.59
+613049.31 796226.01
+613065.97 796290.42
+613515.56 796168.35
+613473.34 796007.79
+613451.85 795972.01
+613496.7 795900.44
+613461.4 795888.99
+613430.39 795880.41
+613367.89 795868
+613334.01 795876.11
+613299.19 795909.51
+613276.78 795941.96
+613249.11 795989.19
+613224.78 796034.04
+613221.44 796051.69
+613226.21 796076.02
+613234.32 796104.65
+613242.91 796142.34
+613199.49 796153.79
+613136.04 796172.39
+613106.94 796101.79
+613082.13 796045.49
+613144.63 795941.48
+613314.41 795703.87
+613397.92 795575.27
+613414.43 795552.73
+613399.47 795536.25
+613370.29 795501.33
+613355.05 795495.3
+613338.18 795421.94
+613318.17 795364.78
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613123.08 795849.26
+Region  1
+  112
+607761.4 804265.59
+607826.9 804272.81
+607909.73 804296.89
+607972.82 804316.64
+608011.34 804332.53
+608044.34 804361.65
+608065.05 804412.7
+608079.73 804479.93
+608090.81 804532.42
+608113.34 804624.07
+608124.35 804670.21
+608138.82 804740.45
+608158.65 804816.95
+608184.14 804862.48
+608203.49 804891.42
+608240.37 804929.21
+608280.43 804976.11
+608727.71 804535.57
+608916.5 804023.17
+607739.96 803615.34
+607744.77 803362.49
+607844.46 803395.24
+608068.17 802768.36
+607263.44 802611.88
+607210.8 802531.55
+607147.88 802206.48
+607095.4 802205.07
+607067.67 802267.55
+607040.71 802295.49
+607010.51 802325.41
+606983.88 802353.76
+606931.87 802407.22
+606945.59 802423.37
+606986.53 802470.56
+606912.12 802624.45
+606920.79 802653.83
+606921.75 802688.02
+606867.82 802800.71
+606867.33 802915.33
+606786.18 802919.89
+606752.95 802922.3
+606754.4 803002.72
+606755.09 803109.91
+606758.75 803230.67
+606727.48 803256.83
+606709.61 803274.06
+606681.38 803297.58
+606659.95 803315.35
+606646.08 803329.73
+606614.19 803398.73
+606605.03 803427.74
+606604.95 803473.26
+606610.78 803523.41
+606625.42 803581.43
+606635.35 803632.66
+606647.9 803682.85
+606656.59 803720.12
+606665.12 803759.31
+606683.36 803749.22
+606715.17 803741.07
+606741.56 803744.95
+606761.35 803756.2
+606782.3 803774.44
+606802.09 803800.05
+606823.82 803825.27
+606846.32 803849.33
+606863.47 803870.43
+606887.16 803895.73
+606919.82 803929.72
+606939.08 803940.79
+606959.31 803935.98
+606979.53 803904.19
+606975.2 803858.44
+607006.98 803819.43
+607044.07 803775.13
+607079.22 803739.49
+607110.29 803701.66
+607148.33 803651.57
+607180.6 803607.27
+607234.15 803478
+607253.08 803440.42
+607273.79 803411.05
+607303.16 803397.56
+607335.91 803394.67
+607372.51 803408.16
+607406.71 803435.61
+607419.23 803462.58
+607418.75 803499.18
+607400.71 803543.71
+607379.98 803573.07
+607342.59 803634.21
+607296.9 803716.85
+607261.75 803778.5
+607231.89 803833.4
+607199.14 803888.3
+607180.92 803934.81
+607157.57 803993.03
+607135.57 804043.8
+607130.76 804092.44
+607142.31 804134.82
+607168.32 804181.54
+607195.05 804223.7
+607220.58 804261.27
+607255.25 804310.87
+607292.82 804333.51
+607340.98 804339.29
+607390.58 804319.54
+607449.33 804295.94
+607493.39 804289.43
+607578.64 804282.69
+607684.34 804272.81
+607761.4 804265.59
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 607654.2 803633.54
+Region  1
+  77
+614835.51 802581.86
+614850.85 802504.56
+614857.22 802443.18
+614858.95 802364.44
+614856.35 802317.82
+614846.87 802270.79
+614833.77 802208.96
+614820.77 802149.96
+614806.27 802102.11
+614801.93 802077.54
+614792.08 802056.69
+614751.55 802004.58
+614723.69 801991.04
+614703.66 801981.23
+614638.06 801972.15
+614585.66 801967.19
+614520.81 801957.35
+614485.49 801957.35
+614439.17 801958.51
+614412.07 801949.82
+614380.18 801946.52
+614333.45 801939.37
+614277.92 801931.13
+614235.58 801922.33
+614196.55 801904.19
+614173.46 801884.39
+614136.62 801940.47
+614046.41 802080.22
+614010.19 802131.97
+613958.31 802204.4
+613913.84 802259.65
+613880.82 802310.19
+613850.66 802358.6
+613813.45 802434.51
+613660.16 802441.58
+613644.34 802465.9
+613688.12 802490.15
+613692.5 802517.09
+613593.15 802591.85
+613510.48 802633.76
+613503.07 802707.18
+613455.41 802762.14
+613442.1 802776.61
+613428.78 802791.67
+613432.83 802806.72
+613442.67 802872.15
+613644.38 802916.45
+613696.34 802922.5
+613776.82 802905.82
+613844.13 802891.92
+613950.35 802869.57
+614003.74 802890.67
+614045.69 802908.59
+614132.22 802933.73
+614160.95 802958.12
+614396.03 802981.28
+614399.5 802950.01
+614455.95 802943.92
+614484.91 802941.02
+614512.12 802942.18
+614548.6 802950.29
+614591.45 802974.03
+614609.68 802985.91
+614600.42 803044.39
+614594.52 803071.15
+614594.19 803079.78
+614603.15 803126.58
+614617.76 803176.37
+614635.85 803192.8
+614646.74 803192.04
+614630.54 803223.34
+614658.42 803235.29
+614706.55 803257.2
+614733.44 803266.83
+614806.84 802798
+614801.63 802743.12
+614835.51 802581.86
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 614285.24 802525.19
+Region  1
+  97
+612014.43 802994.12
+612531.55 803254.97
+612527.92 803285.74
+612563.24 803365.88
+612762.49 803491.79
+612792.15 803519.17
+612811.17 803554.03
+612814.79 803591.62
+612810.72 803675.39
+612979.62 803683.99
+612987.32 803671.31
+613005.99 803661.05
+613050.91 803646.47
+613068.61 803627.49
+613071.77 803596.8
+613069.5 803583.22
+613063.16 803566.91
+613060.9 803560.58
+613055.01 803551.62
+612919.17 803476.8
+612969.89 803452.68
+612961.79 803397.67
+613059.06 802896.19
+613134.91 802929.19
+613200.92 803049.59
+613288.08 802987.38
+613337.29 802950.32
+613366.82 802928.9
+613389.98 802913.84
+613420.09 802890.1
+613442.67 802872.15
+613432.83 802806.72
+613428.78 802791.67
+613442.1 802776.61
+613455.41 802762.14
+613503.07 802707.18
+613510.48 802633.76
+613593.15 802591.85
+613692.5 802517.09
+613688.12 802490.15
+613644.34 802465.9
+613660.16 802441.58
+613813.45 802434.51
+613850.66 802358.6
+613880.82 802310.19
+613913.84 802259.65
+613872.74 802231.35
+613847.47 802214.85
+613816.81 802195.98
+613764.59 802161.28
+613741.18 802144.54
+613709.17 802148.92
+613687.28 802157
+613655.61 802078.17
+613565.64 801932.58
+613465.93 802026.94
+613441.17 802051.71
+613396.72 802070.44
+613351.95 802079.02
+613317.34 802080.92
+613232.89 802088.22
+613183.36 802093.3
+613168.75 802095.77
+613077.63 802133.86
+612986.2 802204.99
+612980.8 802190.69
+612969.68 802174.5
+612964.29 802158.62
+612955.4 802140.21
+612948.09 802124.67
+612943.01 802109.11
+612935.07 802088.16
+612928.41 802072.6
+612862 801913.72
+612836.39 801923.16
+612760.57 801914.87
+612691.51 801887.86
+612524.1 801697.89
+612477.74 801648.99
+612241.29 801763.85
+612184.23 801789.66
+612204.83 801861.41
+612248.3 802014.91
+612317.8 802243.81
+612333.65 802358.87
+612327.31 802440.83
+612311.24 802502.64
+612281.35 802576
+612250.79 802691.71
+612215.01 802715.26
+612194.64 802753.75
+612157.5 802794.5
+612137.13 802816.69
+612052.45 802903.18
+612042.04 802919.48
+612020.01 802977.14
+612014.43 802994.12
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612856.63 802582.78
+Region  1
+  112
+606170.89 808991.76
+606000.27 809001.01
+605985.72 808982.58
+605985.72 808966.32
+605907.83 808987.13
+605898.32 808972.59
+605885.65 808952.35
+605859.02 808914.41
+605851.41 808899.86
+605855.19 808878.35
+605865.92 808813.33
+605870.87 808785.06
+605807.26 808827.46
+605785.36 808840.19
+605759.21 808837.36
+605732.35 808832.41
+605492.07 808780.78
+605454.46 808832.98
+605424.57 808877.36
+605368.73 808920.47
+605333.4 808950.86
+605282.43 808988.68
+605217.92 809043.75
+605145.18 809100.09
+605130.65 809120.97
+605135.09 809134.25
+605145.87 809150.06
+605159.82 809175.36
+605169.68 809194.25
+605096.7 809242.63
+605006.81 809298.14
+605157.61 809399.87
+605097.34 809461.38
+605099.44 809502.79
+605168.09 809436.23
+605169.34 809580.86
+605195.79 809517.55
+605204.81 809479.42
+605230.23 809454.82
+605252.15 809446.01
+605389.08 809461.97
+605422.29 809466.07
+605443.61 809468.12
+605455.09 809472.22
+605435.82 809497.64
+605403.84 809531.67
+605431.72 809537
+605452.63 809539.05
+605474.77 809544.38
+605512.07 809575.53
+605544.79 809612.74
+605593.58 809665.02
+605603.29 809657.63
+605660.05 809726.83
+605703.5 809752.05
+605704.61 809779.41
+605727.51 809801.32
+605748.92 809829.7
+605770.33 809893.93
+605781.5 809926.58
+605817.13 810005.93
+605849 810005.43
+605872.6 810084.71
+605885.78 810105.33
+605937.34 810100.75
+606088.7 810097.9
+606174.24 810097.03
+606202.88 810092.44
+606235.55 810063.29
+606255.59 810021.4
+606259.89 809986.16
+606285.1 809983.3
+606862.51 809952.24
+607102.65 809940.33
+606862.51 809952.24
+606853.11 809946.9
+606799.42 809935.88
+606742.37 809924.13
+606672.95 809612.03
+606657.76 809606.59
+606622.24 809575.65
+606614.22 809569.35
+606617.08 809510.33
+606619.95 809482.26
+606597.03 809463.35
+606591.3 809457.48
+606590.73 809445.02
+606608.49 809446.74
+606631.41 809451.32
+606767.77 809476.53
+606767.77 809459.92
+606736.25 809390.02
+606678.67 809266.55
+606667.5 809242.77
+606641.14 809188.35
+606631.46 809169.19
+606626.01 809149.57
+606620.9 809090.32
+606617.94 809073.74
+606615.86 809054.81
+606612.02 809025.79
+606592.81 809038.41
+606515.42 808961.79
+606472.31 808920.79
+606423.55 808872.03
+606415.07 808845.88
+606400.93 808890.41
+606362.41 809015.79
+606337.68 809006.61
+606281.14 808983.28
+606236.61 808986.82
+606170.89 808991.76
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605987.79 809421.54
+Region  1
+  31
+611033.95 794075.11
+611229.67 794817.46
+611321.14 794825.77
+611447.06 794837.22
+611447.21 794837.24
+611447.42 794837.26
+611683.12 794858.69
+611692.15 794859.51
+611529.6 794224.95
+611517.67 794169.95
+611440.73 793940.9
+611383.48 793852.16
+611358.9 793818.52
+611337.91 793785.13
+611320.74 793763.18
+611255.38 793778.93
+611250.6 793812.38
+611222.12 793813.64
+611121.29 793830.46
+611089.37 793808.93
+611064.37 793823.54
+611027.41 793805.66
+610968.07 793766.72
+610965.4 793790.42
+610957.35 793810.1
+610951.64 793822.17
+610930.05 793858.15
+610901.33 793884.54
+610972.59 793985.92
+610999.9 794023.18
+611033.95 794075.11
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611318.38 794316.76
+Region  1
+  63
+603545.24 799359.77
+603503.64 799311.51
+603462.84 799269.74
+603432.67 799252.59
+603411.72 799248.46
+603365.35 799257.35
+603298.4 799276.81
+603246.98 799272.01
+603185.72 799274.14
+603131.91 799207.55
+603106.7 799175.71
+603080.59 799147.47
+603068.87 799135.21
+603063.81 799129.62
+603054.22 799121.36
+602957.1 799168.36
+602877.16 799203.26
+602811.09 799238.43
+602806.96 799246.06
+602803.62 799253.34
+602781.69 799284.49
+602728.23 799328
+602593.11 799437.33
+602509.6 799501.68
+602444.71 799546.65
+602372.08 799614.12
+602383.14 799649.15
+602372.08 799684.91
+602356.97 799738
+602554.76 799801.05
+602528.31 799887.44
+602727.67 799949.59
+602672.02 800121.84
+603072.2 800250.71
+603048.68 800330.17
+603050.77 800346.37
+603255.17 800310.3
+603307.18 800298.01
+603404.46 800284.4
+603494.88 800287.01
+603540.88 800287.01
+603595.76 800287.01
+603639.41 800291.98
+603668.94 800264.01
+603724.86 800205.99
+603752.57 800153.72
+603776.61 800087.34
+603798.82 800007.63
+603806.14 799971.03
+603819.21 799915.62
+603826.27 799874.15
+603833.73 799826.09
+603855.8 799723.35
+603876.44 799664.93
+603792.92 799665.88
+603720.52 799628.73
+603704.65 799603.64
+603685.28 799538.19
+603704.17 799519
+603707.35 799475.18
+603646.38 799433.59
+603598.75 799400.56
+603545.24 799359.77
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603163.15 799757.21
+Region  1
+  38
+609861.18 805077.29
+609733.96 805090
+609607.39 805106.52
+609523.1 805121.79
+609454.81 805134.54
+609369.67 805155.02
+609374.22 805192.86
+609341.44 805195.14
+609315.05 805205.16
+609255.86 805252.51
+609203.05 805283.93
+609179.83 805294.4
+609186.43 805306.89
+609192.35 805323.74
+609207.37 805350.6
+609222.85 805382.01
+609214.7 805422.42
+609209.63 805449.75
+609210.34 805476.11
+609413.62 805427.59
+609514.69 805440.75
+609587.99 805477.17
+609624.86 805507.22
+609699.75 805604.81
+609885.73 805906.92
+609893.46 805919.58
+610094.02 805720.96
+610092.2 805700.02
+610102.22 805628.99
+610143.71 805366.36
+610166.82 805371.49
+610151.84 805297.47
+610140 805202.88
+610110.86 805202.88
+610054.41 805194.23
+609973.82 805152.79
+609900.44 805089.92
+609861.18 805077.29
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609761.16 805403.61
+Region  1
+  46
+603636.66 802748.96
+603969.46 802283.23
+603449.54 801903.15
+603445.36 801894.78
+603095.38 801786.01
+603085.69 801782.68
+603130.12 801851.39
+603024.52 801989.4
+602972.24 802050.56
+602951.6 802075.92
+602905.07 802138.13
+602878.41 802171.58
+602846 802212.88
+602826.66 802238.5
+602803.13 802275.61
+602786.54 802305.43
+602727.24 802464.89
+602769.72 802518.64
+602813.68 802658.89
+602811.72 802715.93
+602818.6 802723.79
+603126.4 802871.3
+603123.45 802886.05
+603124.43 802900.8
+603123.45 802923.42
+603129.35 802964.72
+603175.57 803015.86
+603213.92 803006.02
+603262.1 802995.2
+603294.55 802992.25
+603361.42 802994.22
+603429.28 802994.22
+603486.31 802995.2
+603528.6 803003.07
+603564 803015.86
+603604.32 803040.44
+603663.25 803094.74
+603694.96 803063.05
+603726.35 803032.89
+603746.66 803010.73
+603773.12 802986.73
+603697.61 802862.69
+603580.36 802844.68
+603573.71 802824.24
+603603.2 802791.82
+603636.66 802748.96
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603322.18 802437.6
+Region  1
+  92
+615881.15 797085
+615799.85 797079.48
+615755.44 797092.3
+615691.26 797132.34
+615648.19 797143.71
+615592.63 797129.74
+615563.73 797117.35
+615536.75 797105.92
+615513.25 797095.45
+615507.74 797003.12
+615505.63 796988.77
+615504.05 796972.26
+615501.19 796953.21
+615499.6 796931.62
+615489.42 796780.46
+615357.04 796754.76
+615321.8 796799.53
+615294.11 796873.22
+615262.04 796943.74
+615238.22 796972.32
+615230.92 796976.78
+615144.71 797072.87
+615054.06 797163.56
+614935.14 797287.9
+614954.98 797310.96
+614948.95 797342.71
+614883.55 797429.39
+614866.09 797475.11
+614892.17 797531.51
+614972.59 797630.01
+615662.84 797779.82
+615694.38 797636.58
+615888.69 797679.13
+615855.35 797827.74
+616365.89 797936.74
+616372.55 797938.33
+616350.96 797889.71
+616359.85 797853.41
+616372.55 797788.42
+616395.07 797672.45
+616409.07 797619.84
+616505.91 797545.86
+616527.82 797587.14
+616555.12 797636.95
+617048.2 797869.77
+617056.26 797851.91
+617063.71 797832.81
+617000.57 797800.87
+617012.95 797772.3
+616994.54 797754.83
+616993.59 797733.88
+616988.23 797712.01
+616969.46 797531.94
+616949.75 797381.46
+616896.41 797357.76
+616904.88 797318.16
+616916.52 797278.58
+616978.53 797282.83
+617032.3 797275.84
+617088.17 797232.5
+617096.18 797163.93
+617166.23 796846.3
+617089.39 796845.21
+617045.15 796843.09
+616967.05 796857.12
+616890.64 796871.94
+616811.68 796886.33
+616785.86 796895.01
+616644.03 797042.6
+616605.71 797083.66
+616528.23 797162.83
+616411.82 797284.31
+616377.74 797318.81
+616277.83 797363.75
+616236.97 797367.77
+616189.98 797358.88
+616101.93 797310.63
+616135.78 797234.81
+616162.27 797181.08
+616199.49 797141.43
+616207.11 797108.62
+616198.43 797043.7
+616198.43 797012.37
+616210.28 796994.38
+616215.57 796979.14
+616174.93 796957.77
+616119.48 796963.9
+616109.95 797026.13
+616080.32 797069.37
+616052.62 797087.34
+616011.01 797097.54
+615881.15 797085
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 616015.31 797378.59
+Region  1
+  45
+613427.79 795096.34
+613480.74 795078.74
+613545.73 795060.19
+613567.41 795058.86
+613623.61 795026.12
+613698.39 795035.41
+613792.02 795042.28
+613894.24 795053.34
+613965.93 795060.86
+614003.17 794684.29
+613566.04 794432.95
+613578.19 794352.36
+613682.62 794255.45
+613494.11 794272.7
+613403.4 794245.27
+613339.92 794188.84
+613298.32 794121.58
+613278.2 794048.34
+613262.23 793954.84
+613217.39 793877.55
+613147.26 793857.04
+613061.38 793835.57
+613034.19 793881.37
+612410.34 794953.98
+612423.28 794962.94
+612433.5 794970.02
+612437.9 794987.39
+612476.85 795141.09
+612476.94 795141.43
+612476.96 795141.53
+612476.97 795141.57
+612477.01 795141.71
+612627.29 795734.74
+612638.47 795747.68
+612641.71 795751.43
+612697.83 795750.05
+613318.17 795364.78
+613288.33 795261.91
+613343.89 795280.01
+613330.24 795226.03
+613321.03 795191.11
+613389.93 795130.47
+613396.6 795130.18
+613391.52 795104.14
+613427.79 795096.34
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613117.15 794817.38
+Region  1
+  125
+608883.84 810564.75
+608868.03 810584.37
+608846.53 810604.62
+608811.12 810635.63
+608775.7 810669.18
+608714.22 810710.56
+608704.22 810717.29
+608687.15 810738.17
+608676.71 810757.36
+608694.71 810807.89
+608715.47 810854.96
+608727.83 810885.81
+608737.52 810926.77
+608739.01 810958.79
+608736.77 811001.25
+608718.15 811049.65
+608693.19 811105.14
+608672.34 811152.06
+608643.29 811193.77
+608615.74 811224.3
+608595.63 811251.12
+608586.69 811274.95
+608574.03 811298.03
+608561.01 811305.86
+608554.31 811352.78
+608537.88 811499.96
+608540.73 811534.71
+608555.54 811567.75
+608558.52 811631.04
+608501.66 811707.04
+608351.28 811865.17
+608358.79 811941.38
+608394.52 812030.63
+608405.34 812053.99
+608453.77 812095.58
+608469.39 812126.06
+608492.18 812124.92
+608582.2 812160.24
+608663.92 812227.75
+608685.6 812259
+608747.13 812380.36
+608779.04 812412.84
+608791.57 812450.44
+608856.8 812507.76
+608894.41 812514.59
+608930.31 812497.5
+608972.47 812519.15
+609016.34 812508.9
+609042.55 812522.57
+609067.32 812748.48
+609141.67 812812.01
+609280.12 812821.12
+609359.89 812793.21
+609429.97 812806.31
+609498.91 812838.22
+609608.3 812859.3
+609640.77 812863.85
+609672.11 812838.79
+609700.03 812837.08
+609819.39 812905.07
+609830.23 812877.26
+609838.57 812853.1
+609851.31 812831.68
+609866.42 812801.74
+609893.02 812768.33
+609917.15 812747.29
+609947.47 812726.87
+609985.83 812707.69
+610024.2 812686.65
+610060.08 812668.71
+610089.78 812651.39
+610102.16 812632.2
+610099.07 812605.6
+610102.16 812575.9
+610150.73 812548.43
+610168.22 812532.2
+610179.74 812529.46
+610000.22 809630.78
+609998.85 809612.29
+609996.72 809357.23
+609981.56 809389.5
+609968.95 809434.42
+609961.41 809491.99
+609948.78 809524.26
+609925.91 809532.26
+609865.95 809614.76
+609818.01 809649.23
+609759.05 809700.21
+609704.97 809749.16
+609618.01 809825.05
+609525.26 809867.21
+609495.75 809887.76
+609483.1 809908.32
+609467.82 809942.04
+609440.95 809996.32
+609030.7 809642.52
+608966.35 809770.5
+608948.96 809808.98
+608925.77 809844.29
+608901.53 809871.17
+608880.65 809897.35
+608858.84 809920.56
+608835.65 809939.53
+608861.11 809977.07
+608841.44 809991.18
+608813.51 810010.69
+608808.24 810042.84
+608811.67 810058.34
+608764.76 810088.91
+608781.63 810128.44
+608806.13 810175.6
+608824.78 810210.13
+608846.2 810230.86
+608862.78 810243.29
+608889.03 810257.8
+608842.74 810330.33
+608827.96 810380.69
+608826.07 810394.61
+608830.03 810406.75
+608841.8 810418.52
+608854.95 810442.06
+608868.1 810481.51
+608879.87 810511.28
+608892.68 810540.07
+608883.84 810564.75
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609396.71 811328.99
+Region  1
+  72
+603297.42 801493.83
+603212.21 801560.22
+603157.84 801611.45
+603081.47 801771.31
+603085.69 801782.68
+603095.38 801786.01
+603445.36 801894.78
+603449.54 801903.15
+603969.46 802283.23
+604014.39 802221.69
+604034.7 802227.22
+604070.79 802238.34
+604169.49 802267.23
+604228.58 802286.31
+604357.88 802233.63
+604401.83 802173.95
+604444.54 802109.53
+604492.92 802036.11
+604516.67 802005.15
+604468.01 801985.29
+604441.52 801974.84
+604400.23 801959.8
+604344.49 801926.3
+604315.97 801903.44
+604288.58 801871.11
+604255.96 801815.71
+604232.57 801777.55
+604210.42 801742.47
+604187.03 801703.08
+604150.78 801637.8
+604132.87 801558.43
+604121.71 801165.66
+604057.47 801174.67
+603651.26 801262.67
+603605.1 801256.52
+603557.76 801223.56
+603540.48 801153.12
+603528.78 801103.88
+603491.55 800930.01
+603604.18 800936.16
+603611.57 800922.01
+603615.88 800906.62
+603626.95 800876.46
+603637.72 800842.32
+603648.8 800800.47
+603662.34 800772.16
+603670.96 800722.92
+603671.58 800671.22
+603670.65 800641.95
+603658.56 800480.45
+603642.55 800412.19
+603642.03 800346.34
+603641.5 800304.53
+603639.41 800291.98
+603595.76 800287.01
+603540.88 800287.01
+603494.88 800287.01
+603404.46 800284.4
+603307.18 800298.01
+603255.17 800310.3
+603050.77 800346.37
+603060.7 800380.35
+603199.96 800766.93
+603222.7 800835.15
+603234.2 801017.07
+603242.29 801113.52
+603254.83 801154.29
+603283.56 801194.55
+603360.41 801305.89
+603346.29 801349.81
+603318.59 801432.92
+603297.42 801493.83
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603680.45 801401.37
+Region  1
+  65
+610984.16 793404.51
+610985.7 793442.21
+610958.01 793497.98
+610949.54 793535.29
+610957.33 793563.41
+610949.37 793626.51
+610937.88 793653.88
+610961.18 793708.26
+610939.67 793736.41
+610968.07 793766.72
+611027.41 793805.66
+611064.37 793823.54
+611089.37 793808.93
+611121.29 793830.46
+611222.12 793813.64
+611250.6 793812.38
+611255.38 793778.93
+611320.74 793763.18
+611337.91 793785.13
+611358.9 793818.52
+611383.48 793852.16
+611440.73 793940.9
+611517.67 794169.95
+611896.98 794073.48
+611860.96 793947.03
+612101.64 793309
+612061 793274.71
+612047.35 793237.25
+612043.05 793200.9
+612035.91 793107.08
+612028.61 793030.24
+612008.13 792990.72
+611912.24 792924.04
+611875.73 792921.82
+611849.72 792871.08
+611841.46 792851.39
+611792.25 792738.67
+611716.69 792779.63
+611752.29 792880.26
+611685.3 792894.88
+611606.07 792910.28
+611628.29 792821.06
+611526.37 792754.4
+611406.86 792661.53
+611376.23 792650.27
+611314 792669
+611223.83 792677.57
+611170.43 792718.61
+611110.31 792759.12
+611048.39 792805.72
+611026.48 792803.81
+610989.97 792806.98
+610945.2 792827.62
+610866.61 792874.14
+610847.88 792905.89
+610837.4 792910.33
+610723.74 792824.61
+610689.13 792836.04
+610778.82 792942.88
+610920.68 793142.15
+610913.76 793179.07
+610914.53 793239.46
+610915.5 793289.27
+610953.57 793352.74
+610984.16 793404.51
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 611470.62 793350.38
+Region  1
+  52
+612366.25 807653.17
+612197.18 807901.4
+612083.89 807853.2
+612055.07 807877.05
+612161.9 808010.21
+612254.7 808154.88
+612271.82 808185.24
+612429.45 808268.11
+612463.31 808297.9
+612497.62 808303.77
+612520.19 808337.18
+612549.53 808335.82
+612564.88 808308.28
+612563.53 808277.14
+612573.46 808245.08
+612594.68 808222.06
+612605.51 808191.81
+612590.39 808174.47
+612595.35 808154.61
+612608.9 808148.74
+612648.17 808155.06
+612640.76 808081.95
+612641.98 808038.94
+612647.65 808016.79
+612657.76 807998.44
+612686.22 807973.12
+612716.58 807942.75
+612743.14 807921.86
+612760.21 807897.18
+612787.46 807857.81
+612773.46 807829.83
+612779.33 807769.79
+612773.46 807722.11
+612767.96 807680.54
+612778.35 807656.7
+612794.14 807637.79
+612790.3 807596.68
+612756.94 807567.76
+612719.17 807543.41
+612699.8 807522.54
+612695.82 807505.15
+612684.39 807509.62
+612672.47 807514.59
+612630.51 807557.05
+612585.29 807574.93
+612514.24 807587.85
+612480.45 807590.34
+612447.16 807591.83
+612413.87 807599.28
+612391.51 807606.73
+612379.58 807626.11
+612366.25 807653.17
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612481.05 807905.21
+Region  1
+  38
+608585.45 800634.84
+608485.48 800524.34
+608395.09 800424.77
+608382.87 800413.87
+608412.28 800388.75
+608447.97 800355.37
+608464.83 800338.85
+608457.22 800329.26
+608362.71 800227.15
+608293.48 800266.34
+608248.09 800300.38
+608215.47 800350.98
+608185.21 800434.2
+608155.9 800496.61
+608109.56 800555.23
+608045.26 800632.77
+607963.46 800724.06
+607996.63 800748.32
+608059.36 800804.59
+608126.53 800862.13
+608211.21 800931.15
+608271.73 800985.05
+608370.43 801040.3
+608370.05 801004.2
+608363.2 800990.14
+608365.86 800977.6
+608394.37 800943.39
+608384.11 800931.99
+608420.27 800885.39
+608448.09 800861.96
+608462.88 800838.47
+608480.32 800817.66
+608495.46 800777.8
+608508.73 800761.97
+608509.33 800735.4
+608498.72 800715.39
+608511.92 800701.43
+608585.45 800634.84
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608292.24 800644.99
+Region  1
+  191
+618080.5 795941.46
+618037.05 795915.08
+617968.57 795841.89
+617921.23 795831.02
+617902.99 795810.07
+617897.37 795760.58
+617722.51 795605.86
+617678.82 795560.28
+617656.02 795523.57
+617652.34 795499.25
+617604.74 795488.75
+617585.1 795451.4
+617566.1 795420.38
+617519.88 795371
+617459.73 795331.75
+617428.85 795311.82
+617388.19 795284.27
+617357.46 795223.74
+617348.34 795172.36
+617304.49 795118.43
+617281.99 795099.42
+617186.15 795081.96
+617170.63 795083.51
+617144.44 795138.39
+617061.54 795146.24
+617012.71 795118.83
+616966.57 795084.83
+616915.92 795031.65
+616895.15 794998.54
+616763.8 794950.02
+616749.66 794918.98
+616775.17 794882.73
+616779.77 794871.67
+616765.33 794852.62
+616744.94 794829.71
+616725.85 794814.36
+616728.17 794756.44
+616697.75 794769.96
+616663.91 794794.89
+616621.53 794848.05
+616593.07 794911.97
+616590.56 794969.57
+616615.27 795040.47
+616676.06 795118.96
+616753.95 795204.43
+616812.84 795263.3
+616867.29 795325.97
+616921.12 795400.03
+616973.04 795453.21
+617008.52 795527.27
+616961.31 795531.17
+616927.23 795530.33
+616872.62 795531.39
+616779.49 795531.61
+616765.1 795531.25
+616698.64 795612.31
+616657.15 795663.77
+616612.5 795720.29
+616596.85 795836.23
+616585.42 795931.11
+616636.02 796003.67
+616646.03 796017.76
+616593.51 796066.49
+616552.4 796134.85
+616513.17 796181.05
+616044.15 796393.6
+616101.94 796550.5
+616072.73 796637.49
+616063.84 796660.35
+616057.49 796678.73
+616051.14 796702.86
+616043.74 796731.02
+616034.63 796784.14
+616075.27 796869.87
+616101.41 796910.16
+616119.48 796963.9
+616174.93 796957.77
+616215.57 796979.14
+616210.28 796994.38
+616198.43 797012.37
+616198.43 797043.7
+616207.11 797108.62
+616199.49 797141.43
+616162.27 797181.08
+616135.78 797234.81
+616101.93 797310.63
+616189.98 797358.88
+616236.97 797367.77
+616277.83 797363.75
+616377.74 797318.81
+616411.82 797284.31
+616528.23 797162.83
+616605.71 797083.66
+616644.03 797042.6
+616785.86 796895.01
+616811.68 796886.33
+616890.64 796871.94
+616967.05 796857.12
+617045.15 796843.09
+617089.39 796845.21
+617166.23 796846.3
+617096.18 797163.93
+617088.17 797232.5
+617032.3 797275.84
+616978.53 797282.83
+616916.52 797278.58
+616904.88 797318.16
+616896.41 797357.76
+616949.75 797381.46
+616969.46 797531.94
+616988.23 797712.01
+616993.59 797733.88
+616994.54 797754.83
+617012.95 797772.3
+617000.57 797800.87
+617063.71 797832.81
+617056.26 797851.91
+617048.2 797869.77
+617161.99 797964.98
+617204.45 798001.02
+617282.29 797990.23
+617335.43 797965.53
+617380.99 797951.58
+617440.5 797959.15
+617482.93 797972.41
+617521.7 797982.33
+617587.27 797993.42
+617644.88 797994.62
+617628.01 797951.72
+617600.77 797912.66
+617626.42 797816.84
+617645.04 797785.04
+617641.16 797776.11
+617606.64 797757.88
+617601.6 797745.86
+617610.52 797712.89
+617610.72 797685.17
+617619.64 797674.31
+617617.31 797657.24
+617616.54 797644.44
+617639.81 797639.4
+617653 797643.28
+617671.61 797655.3
+617679.37 797655.3
+617693.33 797642.12
+617734.84 797614.58
+617739.49 797582.77
+617755.19 797574.43
+617767.61 797570.55
+617770.71 797518.18
+617782.35 797491.41
+617815.9 797454.36
+617848.1 797413.23
+617856.24 797389.18
+617846.55 797369.39
+617858.96 797352.32
+617918.9 797320.29
+617926.66 797306.32
+617946.06 797294.3
+617946.45 797284.98
+617959.64 797290.03
+617990.48 797266.93
+618016.48 797228.91
+618047.91 797186.61
+618099.51 797210.67
+618233.56 797098.34
+618232.79 797052.55
+618271.98 796981.55
+618265.96 796926.6
+618277.21 796889.35
+618277.21 796841.24
+618274.3 796788.3
+618290.21 796727.78
+618301.66 796646.9
+618374.02 796562.09
+618395.75 796497.68
+618376.16 796418.71
+618361.8 796392.72
+618327.07 796374.31
+618321.64 796334.34
+618319.31 796294.38
+618324.55 796206.48
+618323.38 796163.8
+618274.11 796156.82
+618248.89 796144.01
+618211.25 796102.11
+618181.18 796061.15
+618184.68 796008
+618144.71 795962.99
+618118.53 795949.61
+618080.5 795941.46
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 617256.44 796504.65
+Region  1
+  49
+603006.78 789927.79
+603099.22 789659.61
+603229.11 789305.8
+603293.97 789142.02
+603302.86 789119.79
+603009.94 788916.44
+602971.52 788892.62
+602915.01 788863.73
+602891.19 788854.52
+602850.55 788883.1
+602814.67 788913.93
+602704.81 789000.93
+602636.82 789058.12
+602594.91 789089.87
+602571.42 789102.89
+602465.37 789079.39
+602458.71 789088.6
+602443.15 789107.02
+602408.86 789124.48
+602337.1 789163.22
+602348.21 789182.58
+602309.34 789309.75
+602269.34 789372.62
+602226.3 789436.69
+602194.56 789483.01
+602176.63 789505.63
+602260.62 789554.65
+602150.52 790059.94
+602189.11 790068.06
+602256.85 790084.26
+602359.93 790102.67
+602367.3 790118.86
+602326.06 790157.15
+602270.84 790386.88
+602250.57 790481.5
+602388.26 790512.43
+602399.31 790462.36
+602419.92 790373.26
+602432.8 790305.89
+602439.43 790275.7
+602551.35 790308.1
+602634.55 790244.78
+602722.91 790192.5
+602805.38 790144.64
+602846.26 790172.99
+602855.1 790180.35
+602919.89 790188.45
+602935.35 790140.59
+603006.78 789927.79
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 602688 789606.2
+Region  1
+  160
+598876.92 788917.84
+598880.32 788962.71
+598868.21 789001.68
+598864.3 789063.44
+598834.06 789118.92
+598809.97 789164.21
+598797.09 789192.28
+598826.3 789218.32
+598889.49 789262.45
+598909.49 789290.39
+598924.73 789322.46
+598932.98 789365.96
+598927.07 789424.22
+598918.24 789490.92
+598908.72 789563.32
+598899.97 789624.43
+598931.53 789680.6
+598949.1 789726.68
+599045.76 789659.14
+599048.92 789611.81
+599055.27 789562.01
+599056.85 789548.99
+599081.31 789551.51
+599090.84 789646.77
+599134.97 789737.62
+599149.58 789759.21
+599186.73 789834.46
+599241.97 789947.46
+599327.26 790100.43
+599407.92 790165.84
+599507.63 790202.04
+599613.06 790200.77
+599779.45 790144.25
+599822.32 790137.6
+599892.18 790139.51
+599944.89 790155.39
+599995.06 790178.88
+600091.28 790263.68
+600166.86 790308.14
+600236.08 790322.11
+600302.13 790324.02
+600352.94 790315.76
+600418.67 790289.44
+600479.64 790246.25
+600621.84 790150.3
+600628.86 790142.07
+600617.45 790116.06
+600619.99 790081.76
+600611.74 790039.21
+600562.2 789934.42
+600655.85 789888.38
+600725.74 789861.04
+600765.11 789862.31
+600814.02 789883.27
+600856.79 789915.64
+600912.45 789963.29
+600944.84 789980.44
+601070.14 790019.48
+601097.91 790022.08
+601136.32 790015.73
+601113.78 789989.38
+601104.89 789975.41
+601102.03 789947.15
+601104.57 789923.33
+601110.92 789903.97
+601055.53 789883.16
+601052.04 789862.84
+601048.54 789845.7
+601046 789831.73
+601041.57 789811.86
+601043.47 789795.4
+601044.46 789774.91
+601047.63 789769.51
+601043.19 789751.09
+601044.08 789742.87
+601041.28 789728.23
+601049.22 789707.6
+601073.35 789681.24
+601141.29 789626.63
+601167.01 789607.57
+601171.13 789592.01
+601161.29 789559.94
+601160.97 789539.3
+601183.52 789472.31
+601195.59 789424.68
+601198.13 789402.45
+601198.13 789385.94
+601188.28 789371.34
+601182.55 789360.58
+601154.95 789335.46
+601125.1 789327.2
+601150.58 789222.13
+601188.34 789105.91
+601126.74 789081.44
+601109.65 789068.14
+601092.84 789066
+601077.81 789074.25
+601052.2 789096.07
+601018.34 789094.37
+600989.76 789092.68
+600968.17 789088.87
+600917.58 789132.26
+600879.26 789178.19
+600849.21 789228.39
+600782.53 789200.24
+600749.93 789184.36
+600726.43 789156.85
+600691.51 789131.02
+600662.08 789122.77
+600623.14 789097.79
+600582.29 789092.92
+600539.37 789082.62
+600522.17 789080.44
+600517.72 789096.96
+600487.24 789178.25
+600239.64 789098.24
+600079.3 789043.31
+599927.4 788948.22
+599890.88 788916.47
+599814.56 788866.79
+599740.43 788821.94
+599735.99 788767.33
+599762.82 788648.03
+599825.71 788435.97
+599830.26 788289.35
+599828.14 788222.67
+599806.13 788226.91
+599783.91 788227.96
+599758.72 788226.48
+599736.2 788230.76
+599713.16 788245.38
+599691.73 788270.61
+599663.79 788305.34
+599630.05 788371.76
+599632.15 788413.92
+599634.15 788450.17
+599639.45 788503.57
+599589.07 788537.1
+599464.99 788617.74
+599450.17 788620.95
+599402.2 788607.46
+599361.34 788593.64
+599319.68 788582.02
+599297.94 788575.54
+599261.28 788591.56
+599223.23 788603.98
+599189.28 788616.07
+599149.62 788606.66
+599126.19 788602.05
+599073.81 788590.12
+599058.19 788590.52
+599047.77 788601.74
+599026.64 788681.8
+598996.39 788693.61
+598965.35 788706.03
+598899.25 788732.53
+598858.19 788747.95
+598881.12 788881.06
+598881.72 788902.49
+598876.92 788917.84
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 599914.66 789443.59
+Region  1
+  74
+604348.14 806239.41
+604375 806227.7
+604402.2 806229.46
+604430.44 806234.97
+604460.05 806247.37
+604488.97 806267.34
+604521.34 806304.52
+604540.96 806347.52
+604554.74 806368.87
+604580.91 806364.74
+604610.52 806324.8
+604661.82 806260.45
+604787.5 806099.69
+604837.08 806036.33
+604854.3 805993.63
+604835.03 805920.66
+604823.31 805861.41
+604823.31 805834.55
+604844.66 805760.18
+604867.39 805691.32
+604891.49 805658.95
+604922 805618.84
+604951.09 805599.21
+604978.91 805573.89
+604970.62 805527.08
+604942.06 805461.3
+604906.87 805362.5
+604901.61 805344.23
+604857.51 805367.97
+604827.84 805367.97
+604804.09 805348.47
+604808.33 805306.92
+604793.07 805352.71
+604793.07 805353.55
+604749.83 805431.56
+604702.34 805517.2
+604591.67 805848.32
+604522.99 805749.11
+604472.96 805683.82
+604440.74 805674.5
+604404.28 805677.04
+603740.77 805799.57
+603701.85 805813.72
+603675.68 805840.58
+603630.23 805910.13
+603600.11 805955.46
+603569.76 805987.74
+603550.15 805995.98
+603512.83 806016.24
+603493.86 806032.7
+603473.62 806048.53
+603454.97 806083.46
+603449.63 806093.46
+603459.97 806261.74
+603552.24 806540.6
+603594.78 806531.1
+603634.61 806523.86
+603664.48 806600.8
+603686.65 806619.8
+603750.01 806651.03
+603812.92 806684.97
+603866.96 806746.78
+603905.46 806655.66
+603970.77 806527.56
+604010.71 806456.63
+604014.15 806410.49
+604104.01 806413.96
+604133.62 806416.71
+604132.35 806377.8
+604246.22 806376.45
+604255.17 806271.77
+604247.6 806218.06
+604298.56 806230.45
+604348.14 806239.41
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604165.01 806057.47
+Region  1
+  90
+612399.88 805918.14
+612384.96 805941.14
+612324.09 805983.12
+612265.25 806019.2
+612156.61 806079.99
+612101.72 806118.35
+612071.08 806149.53
+612050.29 806274.87
+612045.5 806350.43
+612053.58 806407.09
+612067.08 806483.89
+612069.47 806517.19
+612041.1 806592.44
+612007.66 806657.35
+612002.86 806670.67
+611998.15 806679.13
+612710.99 806771.8
+613074.95 806760.88
+613113.72 806757.73
+613134.45 806731.18
+613109.57 806668.13
+613102.93 806602.6
+613113.72 806576.05
+613156.43 806578.02
+613240.64 806570.25
+613317.79 806576.05
+613421.48 806600.11
+613466.28 806625.83
+613535.13 806662.33
+613551.31 806694.25
+613566.24 806726.6
+613582 806772.23
+613578.68 806817.85
+613601.91 806852.7
+613610.21 806872.6
+613647.54 806890.85
+613715.56 806852.7
+613767.41 806867.18
+613881.06 806943.5
+613947.42 806985.81
+613970.65 806986.63
+613998.03 806967.56
+614022.91 806935.2
+614035.36 806909.49
+614085.96 806928.57
+614086.79 806974.19
+614087.37 807014.72
+614092.6 807067.1
+614096.74 807110.24
+614100.89 807159.18
+614113.34 807186.56
+614125.36 807210.2
+614144.55 807227.88
+614164.82 807249.38
+614207.26 807275.93
+614250.95 807291.72
+614298.44 807303.72
+614340.22 807321.36
+614377.55 807335.46
+614408.62 807344.79
+614439.01 807347.31
+614234.49 806650.9
+614280.5 806556.56
+614315.34 806476.93
+614351.01 806398.95
+614409.08 806413.88
+614456.46 806429.39
+614491.61 806459.94
+614522.29 806504.7
+614510.68 806471.52
+614500.73 806443.31
+614439.34 806252.52
+614298.72 806107.69
+613966.89 805614.13
+613342.23 805375.22
+613316.72 805337.1
+613261.83 805445.81
+613229.86 805481.51
+613198.42 805505.1
+613152.85 805537.23
+613047.34 805609.71
+612998.31 805642.75
+612948.76 805726.41
+612949.56 805759.16
+612913.32 805766.08
+612791.29 805814.58
+612618.37 805870.71
+612427.06 805845.67
+612418.53 805883.5
+612399.88 805918.14
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613334.14 806264.58
+Region  1
+  76
+609171.37 802336.92
+608653.87 801785.01
+608628.47 801807.87
+608587.83 801843.43
+608538.3 801898.04
+608494.95 801882.42
+608468.36 801872.94
+608450.67 801829.46
+608434.16 801785.01
+608420.19 801755.8
+608407.49 801729.13
+608402.41 801699.92
+608407.03 801663.8
+608432.11 801601.46
+608466.32 801536.85
+608467.84 801477.55
+608455.68 801412.18
+608460.24 801369.61
+608452.11 801349.64
+608457.43 801317.33
+608461.83 801250.25
+608466.01 801190.59
+608458.41 801174.25
+608437.69 801158.87
+608382.59 801130.37
+608343.44 801080.58
+608338.12 801068.04
+608338.12 801055.88
+608370.43 801040.3
+608271.73 800985.05
+608211.21 800931.15
+608126.53 800862.13
+608059.36 800804.59
+607996.63 800748.32
+607963.46 800724.06
+607955.9 800732.57
+607919.96 800770.39
+607863.23 800836.59
+607813.11 800895.22
+607752.59 800943.44
+607663.7 800982.21
+607489.23 801038.5
+607400.34 801085.78
+607354.01 801142.52
+607324.69 801208.71
+607282.11 801351.61
+607260.87 801475.39
+607233.45 801606.83
+607159.23 801937.34
+607154.97 802014.89
+607153.31 802119.64
+607096.29 802200.8
+607147.88 802206.48
+607210.8 802531.55
+607263.44 802611.88
+608068.17 802768.36
+607844.46 803395.24
+607875.29 803403.91
+608993.06 803798.31
+609016.18 803730.89
+609028.22 803703.43
+609428.65 802549.41
+609466.7 802430.45
+609423.6 802424.77
+609351.6 802418.41
+609285.14 802447.79
+609236.5 802481.02
+609176.78 802519.55
+609144.99 802541.7
+609115.62 802561.44
+609076.61 802570.11
+609053.25 802562.17
+609034.47 802540.98
+609026.76 802512.56
+609020.02 802475
+609171.37 802336.92
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608217.67 802309.68
+Region  1
+  70
+613550.47 801066.75
+613469.5 800980.53
+613391.76 800902.3
+613358.13 800861.04
+613340.78 800837.96
+613311.71 800756.51
+613286.46 800688.67
+613261.69 800625.42
+613227.43 800560.9
+613155.34 800419.2
+613146.55 800447.41
+613173.59 800531.19
+613186.13 800580.4
+613182.49 800607.09
+613049.71 800690.62
+613061.06 800707.96
+612995.52 800754.37
+612980.15 800732.99
+612909.31 800779.97
+612860.96 800811.66
+612805.35 800845.75
+612765.88 800906.74
+612755.03 800915.43
+612708.08 800955.19
+612681.87 800977.06
+612640.56 800997.1
+612581.54 800999.29
+612533.91 801007.54
+612498.99 801025.61
+612467.55 801051.96
+612434.33 801078.8
+612401.5 801103.43
+612330.35 801051.83
+612262.73 801046.65
+612202.12 801049.14
+612154.18 801062.16
+612112.59 801078.67
+612096.39 801087.88
+612079.38 801095.61
+612067.23 801123.3
+612055.9 801176.45
+612047.14 801258.06
+612054.86 801353.59
+612084.13 801469.99
+612147.1 801666.5
+612184.23 801789.66
+612241.29 801763.85
+612477.74 801648.99
+612524.1 801697.89
+612691.51 801887.86
+612760.57 801914.87
+612836.39 801923.16
+612862 801913.72
+612872 801908.46
+612971.99 801859.33
+612987.64 801844.29
+613056.98 801823.43
+613096.57 801788.75
+613137.07 801719.83
+613159.77 801684.54
+613182.48 801640.05
+613278.37 801474.52
+613342.45 801417.8
+613395.83 801381.3
+613547.43 801333.85
+613605.65 801319.27
+613669.61 801291.62
+613691.25 801275.75
+613621.75 801168.42
+613550.47 801066.75
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 612833.04 801294.54
+Region  1
+  61
+611392.22 802817.89
+610905.71 802674.25
+610706.29 802621.5
+610649.24 802604.79
+610606.55 802594.63
+610534.73 802589.21
+610448.34 802586.37
+610376 802578.65
+610324.88 802567.56
+610264.84 802536
+610226.26 802503.69
+610186.95 802454.71
+610121.37 802351.88
+610070.33 802426.25
+610014.55 802494.97
+610028.58 802565.8
+610027.7 802604.13
+610029.67 802626.88
+610022.52 802652.74
+610036.6 802657.99
+610119.62 802679.22
+610122.36 802688.26
+610127.61 802705.28
+610143.23 802747.11
+610164.04 802780.73
+610170.28 802797.22
+610254.51 802801.7
+610280.45 802813.87
+610321.76 802840.13
+610369.95 802871.37
+610400.05 802891.87
+610436.56 802900.2
+610485.23 802902.44
+610523.02 802893.47
+610546.56 802888.49
+610658.64 802961.82
+610789.14 803045.9
+610808.19 803059.51
+610822.69 803069.36
+610805.46 803133.68
+610794.09 803187.31
+610757.88 803346.52
+611009.44 803397.88
+611116.02 803411.38
+611211.51 803419.1
+611244.3 803409.9
+611298.8 803391.57
+611342.52 803374.22
+611396.64 803355.97
+611550.26 803274.61
+611592.49 803249.77
+611618.26 803232.97
+611602.89 803203.18
+611589.76 803180.76
+611577.91 803163.47
+611552.61 803124.72
+611488.8 803036.03
+611449.88 802986.8
+611408.02 802923.55
+611395.89 802840.05
+611392.22 802817.89
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610883.78 802946.02
+Region  1
+  23
+601022.17 787562.68
+601207.17 786885.06
+600467.15 786800.69
+600458.12 786799.13
+600458.43 786832.15
+600448.78 786900.67
+600442.23 786959.24
+600434.45 787043.64
+600424.48 787142.74
+600419.81 787184.79
+600398.32 787222.79
+600373.4 787267.64
+600318.27 787320.57
+600248.51 787386.59
+600226.39 787421.16
+600194 787530.48
+600182.33 787552.79
+600188.68 787552.79
+601008.92 787619.22
+600980.58 787757.7
+601425.08 787809.42
+601512.71 787615.02
+601022.17 787562.68
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 600801.76 787289.54
+Region  1
+  187
+608049.29 809507.43
+608156.28 809436.81
+608203.72 809490.04
+608235.87 809525.35
+608270.13 809562.24
+608289.63 809583.85
+608302.81 809596.5
+608319.15 809617.06
+608339.7 809638.14
+608366.58 809658.69
+608391.35 809677.67
+608427.71 809711.83
+608458.28 809796.68
+608487.45 809789.99
+608519.68 809791.66
+608551.39 809796.92
+608584.51 809813.27
+608614.02 809840.68
+608634.05 809871.77
+608653.03 809906.56
+608667.78 809935.54
+608688.34 809965.06
+608712.58 809983.5
+608733.66 810013.02
+608746.84 810044.64
+608764.76 810088.91
+608811.67 810058.34
+608808.24 810042.84
+608813.51 810010.69
+608841.44 809991.18
+608861.11 809977.07
+608835.65 809939.53
+608858.84 809920.56
+608880.65 809897.35
+608901.53 809871.17
+608925.77 809844.29
+608948.96 809808.98
+608966.35 809770.5
+608953.7 809762.6
+608618.79 809289.07
+608536.04 809195.25
+608596.65 809150.98
+608644.88 809111.2
+608679.13 809081.15
+608740.8 809042.15
+608802.99 809023.18
+608868.35 809017.38
+608966.38 809012.11
+609055.88 808985.64
+609231.5 808888.78
+609314.77 808839.23
+609379.07 808801.81
+609450.23 808747
+609530.08 808678.2
+609706.64 808868.99
+609756.97 808909.8
+609808.62 808932.46
+609931.43 808879.23
+609979.39 808846.56
+610027.88 808734.29
+610074.79 808789.63
+610046.99 808868.72
+610018.61 808949.08
+609993.56 809027.74
+609980.03 809108.47
+609982.77 809177.31
+609989.89 809260.37
+609996.72 809357.23
+610048.14 809279.32
+610105 809190.08
+610168.41 809129.7
+610202.48 809101.78
+610255.58 809052.11
+610295.65 809007.24
+610323.73 808966.01
+610346.69 808903.05
+610349.43 808852.35
+610342.92 808811.59
+610329.22 808775.96
+610312.29 808749.58
+610302.47 808737.43
+610252.46 808663.64
+610213.78 808611.14
+610196.68 808585.79
+610210.72 808551.4
+610550.93 807790.34
+610554.17 807762.21
+610477.61 807755.8
+610438.68 807757.57
+610411.73 807755.8
+610391.54 807751.55
+610342.45 807743.07
+610265.21 807734.88
+610252.55 807733.63
+610197.09 807749.96
+610159.37 807758.46
+610113.15 807755.8
+610070.82 807753.96
+610022.86 807750.28
+609977.53 807750.8
+609948.02 807756.07
+609902.69 807780.32
+609885.56 807786.91
+609808.09 807815.37
+609774.35 807830.13
+609767.18 807835.73
+609758.54 807871.24
+609751.42 807893.94
+609731.66 807954.51
+609705.84 807954.51
+609648.39 807875.45
+609583.3 807787.21
+609532.17 807722.91
+609474.98 807649.93
+609419.11 807577.72
+609384.33 807532.39
+609349.54 807497.08
+609276.01 807456.79
+609249.66 807471.54
+609169.02 807491.05
+609115.79 807501.59
+609064.14 807508.44
+609019.34 807516.34
+608852.52 807648.89
+608919.19 807720.85
+608932.37 807753
+608920.25 807769.33
+608888.1 807778.29
+608868.07 807785.67
+608850.15 807799.9
+608841.19 807813.61
+608835.92 807826.26
+608833.28 807838.38
+608833.81 807857.35
+608921.83 807835.74
+608953.98 807838.38
+608977.17 807855.77
+608987.45 807881.83
+608984.81 807920.83
+608989.03 807953.51
+609003.78 807996.73
+609016.17 808044.93
+609015.64 808096.58
+609021.44 808161.41
+609021.44 808198.83
+609009.32 808221.49
+609028.82 808243.1
+609043.05 808260.49
+609000.1 808319.79
+608939.48 808348.25
+608865.17 808381.98
+608568.96 808656.64
+608504.66 808641.35
+608445.1 808620.8
+608338.37 808558.38
+608221.89 808516.75
+608186.05 808548.9
+608131.76 808591.59
+608030.57 808645.35
+607905.92 808703.03
+607797.87 808734.65
+607751.25 808744.67
+607671.58 808749.14
+607513.73 808753.17
+607231.62 808762.94
+607242.45 808795.44
+606840.95 808956.47
+606840.15 808990.46
+606851.18 809107.72
+607238.25 809392.98
+607408.54 809511.35
+607462.88 809545.64
+607535.57 809579.56
+607610.33 809606.56
+607647.01 809610.02
+607707.24 809610.02
+607753.62 809610.02
+607796.54 809612.09
+607829.07 809616.94
+607817.99 809637.01
+607874.76 809650.86
+607890.68 809652.93
+607914.91 809613.48
+607936.37 809588.56
+607959.21 809565.02
+607999.8 809537.81
+608049.29 809507.43
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 608852.72 808711.19
+Region  1
+  59
+616365.89 797936.74
+615855.35 797827.74
+615888.69 797679.13
+615694.38 797636.58
+615662.84 797779.82
+614972.59 797630.01
+615003.07 797659.86
+615038.61 797705.41
+615070.38 797743.61
+615075.46 797769.01
+615081.18 797826.79
+615093.92 797891.39
+615119.29 797933.13
+615164.91 797967.27
+615198.34 797999.73
+615240.89 798036.56
+615246.06 798074.15
+615261.97 798141.83
+615276.45 798228.98
+615285.34 798278.51
+615294.49 798324.66
+615307.25 798396.92
+615319.95 798473.77
+615339.96 798562.32
+615352.02 798618.84
+615367.27 798632.81
+615387.59 798655.67
+615418.71 798684.89
+615422.51 798703.93
+615414.89 798726.79
+615409.81 798742.67
+615401.56 798771.24
+615535.54 798768.07
+615748.65 798819.39
+615784.52 798897.16
+615820.72 798954.32
+615868.66 798981.3
+615910.57 798980.35
+615977.66 798962.66
+616030.81 798945.55
+616077.27 798941.02
+616137.59 798915.3
+616196.96 798877.52
+616259.83 798838.15
+616333.81 798788.93
+616398.58 798751.5
+616380.48 798709.9
+616369.68 798702.28
+616386.83 798614.94
+616405.65 798535.4
+616432.14 798460.73
+616455.41 798405.08
+616470.97 798355.55
+616475.42 798270.11
+616465.38 798210.81
+616446.31 798151.98
+616417.72 798067.85
+616372.55 797938.33
+616365.89 797936.74
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 615812.97 798284.9
+Region  1
+  65
+614733.44 803266.83
+614620.59 803918.46
+614629.22 803920.12
+614641.16 803921.78
+614746.55 803936.55
+615272.82 804048.62
+615336.22 804044.3
+615382.36 804046.96
+615418.87 804023.72
+615442.92 804008.1
+615478.81 803990.16
+615569.71 803921.26
+615492.13 803859.89
+615487.09 803855.93
+615505.68 803790.87
+615508.66 803715.85
+615485.43 803661.74
+615553.31 803636.33
+615625 803597.82
+615663.3 803572.63
+615713.89 803523.26
+615741.69 803475.17
+615761.89 803418.86
+615780.48 803352.68
+615756.16 803252.51
+615770.06 803225.3
+615770.63 803211.4
+615753.26 803191.13
+615746.32 803166.81
+615711.86 803135.26
+615684.07 803098.78
+615641.22 803057.67
+615588.98 802960.64
+615578.11 802927.39
+615570 802892.65
+615592.58 802877.59
+615607.64 802855.59
+615607.34 802762.03
+615585.34 802689.65
+615566.23 802665.91
+615509.45 802641.82
+615493.27 802637.53
+615493.27 802637.53
+615481.41 802632
+615455.06 802623.06
+615429.58 802613.22
+615409.32 802606.27
+615379.21 802591.79
+615346.78 802642.17
+615331.73 802679.8
+615327.1 802716.86
+615260.51 802729.02
+615181.47 802746.07
+615121.83 802757.65
+615096.36 802751.86
+615069.14 802741.38
+615041.35 802731.54
+615005.74 802716.78
+614941.47 802691.88
+614879.22 802663.21
+614860.11 802726.9
+614838.11 802803.92
+614813.79 802802.18
+614806.84 802798
+614733.44 803266.83
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 615189.54 803356.25
+Region  1
+  100
+614316.94 795512.93
+614472.51 795483.09
+614576.02 795545.32
+614588.08 795561.83
+614830.02 795705.27
+614956.39 795406.19
+614985.56 795338.99
+615001.37 795316.21
+614977.34 795253.25
+615034.49 795230.39
+615085.29 795212.61
+615108.26 795125.07
+615116.03 795096.49
+615125.55 795050.77
+615067.13 795102.84
+614957.28 795100.93
+614897.59 795100.93
+614820.12 795099.03
+614728.68 795097.76
+614734.35 795035.69
+614749.59 794802.01
+614718.81 794778.25
+614680.08 794755.39
+614644.52 794735.07
+614577.21 794691.26
+614514.98 794648.74
+614570.86 794568.07
+614544.82 794532.51
+614497.83 794510.92
+614377.18 794493.77
+614335.27 794470.28
+614298.45 794434.69
+614231.77 794399.13
+614106.68 794423.26
+614000 794442.94
+613871.09 794467.71
+613813.95 794477.86
+613756.16 794489.29
+613674.25 794459.44
+613566.04 794432.95
+614003.17 794684.29
+613965.93 795060.86
+613894.24 795053.34
+613792.02 795042.28
+613698.39 795035.41
+613623.61 795026.12
+613567.41 795058.86
+613545.73 795060.19
+613480.74 795078.74
+613427.79 795096.34
+613391.52 795104.14
+613396.6 795130.18
+613389.93 795130.47
+613321.03 795191.11
+613330.24 795226.03
+613343.89 795280.01
+613288.33 795261.91
+613318.17 795364.78
+613338.18 795421.94
+613355.05 795495.3
+613370.29 795501.33
+613399.47 795536.25
+613414.43 795552.73
+613397.92 795575.27
+613314.41 795703.87
+613144.63 795941.48
+613082.13 796045.49
+613106.94 796101.79
+613136.04 796172.39
+613199.49 796153.79
+613242.91 796142.34
+613234.32 796104.65
+613226.21 796076.02
+613221.44 796051.69
+613224.78 796034.04
+613249.11 795989.19
+613276.78 795941.96
+613299.19 795909.51
+613334.01 795876.11
+613367.89 795868
+613430.39 795880.41
+613461.16 795829.59
+613489.78 795798.58
+613497.61 795705.77
+613444.59 795713.71
+613436.33 795687.99
+613515.71 795591.78
+613541.11 795528.28
+613674.69 795228.67
+613843.68 795221.1
+613913.3 795222.37
+613974.79 795222.53
+613990.67 795233
+614038.66 795304.67
+614037.4 795319.86
+614034.25 795367.97
+614026.74 795505.31
+614142.31 795509.12
+614189.3 795507.21
+614316.94 795512.93
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 614189.49 795135.53
+Region  1
+  35
+605382.55 788588.5
+605338.42 788658.03
+605324.13 788669.14
+605261.58 788700.6
+605134.9 788781.59
+604996.78 788842.87
+605005.36 788854.61
+605107.28 788924.78
+605139.55 788947.2
+605212.36 789001.01
+605254.33 789029.68
+605289.57 789054.6
+605309.22 789030.77
+605323.86 789013.8
+605336.21 788998.87
+605355.58 788975.99
+605402.88 788900.74
+605442.89 788898.52
+605487.65 788888.39
+605528.29 788874.74
+605559.41 788840.45
+605590.25 788781.71
+605637.56 788702.33
+605643.91 788687.41
+605660.41 788594.69
+605631.18 788488.37
+605617.18 788430.11
+605569.24 788419.31
+605518.12 788409.79
+605468.28 788402.14
+605446.69 788452.62
+605427.32 788493.9
+605413.99 788521.52
+605400.97 788545.95
+605382.55 788588.5
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605391.36 788738.97
+Region  1
+  50
+609873.29 807362.54
+609865.53 807422.14
+609805.45 807718.92
+609767.18 807835.73
+609774.35 807830.13
+609808.09 807815.37
+609885.56 807786.91
+609902.69 807780.32
+609948.02 807756.07
+609977.53 807750.8
+610022.86 807750.28
+610070.82 807753.96
+610113.15 807755.8
+610159.37 807758.46
+610197.09 807749.96
+610252.55 807733.63
+610265.21 807734.88
+610342.45 807743.07
+610391.54 807751.55
+610411.73 807755.8
+610438.68 807757.57
+610477.61 807755.8
+610554.17 807762.21
+610550.93 807790.34
+610608.28 807758.98
+610665.92 807751.13
+610711.89 807739.85
+610717.73 807726.04
+610729.42 807689.38
+610737.39 807652.72
+610763.14 807625.89
+610799.8 807595.6
+610859.94 807545.39
+610800.31 807524.02
+610724.7 807504.24
+610668.14 807465.89
+610595.26 807438.63
+610545.86 807419.04
+610471.58 807396.08
+610457.73 807380.62
+610303.19 807204.24
+610130.12 806987.93
+610106.67 807017.93
+610008.25 807165.48
+609989.7 807191.94
+609976.34 807210.21
+609971.43 807217.31
+609849.78 807254.94
+609865.77 807296.4
+609873.29 807362.54
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 610234.43 807491.85
+Region  1
+  68
+603888.63 794997.02
+603918.07 795683.91
+603933.78 795681.12
+603954.55 795674.36
+603972.35 795670.52
+604035.87 795647.83
+604098.35 795606.64
+604147.21 795561.62
+604174.78 795532.99
+604218.41 795489.36
+604219.63 795513.98
+604217.89 795553.77
+604215.1 795610.67
+604243.97 795620.37
+604285.07 795637.35
+604350.69 795656.54
+604418.67 795633.69
+604502.38 795601.86
+604550.94 795610.92
+604614.26 795620.91
+604666.37 795631.93
+604719.88 795642.46
+604779.53 795657.81
+604834.35 795667.02
+604887.86 795680.62
+604931.5 795690.93
+604963.96 795714.61
+604997.29 795739.17
+605015.28 795753.21
+605016.59 795789.61
+605016.59 795810.67
+605042.03 795811.1
+605074.47 795808.48
+605124.49 795806.72
+605192.48 795801.89
+605258.48 795827.1
+605288.4 795820.54
+605353.59 795797.76
+605436.14 795767
+605368.17 795679.73
+605223.67 795556.7
+605095.6 795432.15
+604980.01 795345.08
+604876.94 795294.21
+604756.53 795266.79
+604695.12 795263.28
+604633.56 795225.35
+604620.23 795219.95
+604598.32 795209.79
+604463.42 795136.19
+604412.58 795078.37
+604370.95 794998.82
+604355.5 794976.9
+604335.13 794923.87
+604313.22 794882.28
+604288.89 794857.61
+604260.31 794838.56
+604150.98 794858.19
+604056.1 794899.36
+604026.98 794911.4
+604002.88 794920.94
+603980.29 794930.98
+603964.72 794937.51
+603943.64 794947.05
+603918.78 794956.33
+603900.03 794961.41
+603888.23 794968.18
+603888.63 794997.02
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604488.93 795381.06
+Region  1
+  36
+609659.06 793409.48
+609574.3 793534.83
+609544.54 793576.58
+609550.17 793586.26
+609606.27 793659.94
+609637.39 793708.62
+609635.31 793774.8
+609610.53 793815.14
+609657.52 793871.66
+609674.67 793904.36
+609703.88 793921.19
+609733.4 793925.02
+609828.33 793922.79
+609903.9 793773.25
+609951.84 793835.8
+610001.05 793898.03
+609989.62 793921.84
+609958.2 793974.24
+610002.33 794005.36
+610073.61 794046.78
+610151.85 793914.76
+610187.9 793845.14
+610185.97 793778.68
+610172.14 793756.41
+610166.42 793656.07
+610164.51 793624.96
+610152.13 793583.36
+610105.14 793506.52
+610059.89 793441.93
+610047.36 793417.36
+609945.76 793342.11
+609924.49 793329.47
+609910.84 793322.16
+609750.82 793322.8
+609718.41 793322.99
+609659.06 793409.48
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 609884.14 793650.19
+Region  1
+  58
+604056.1 794899.36
+604150.98 794858.19
+604260.31 794838.56
+604124.27 794835.64
+604089.5 794832.21
+604016.96 794796.91
+603952.19 794711.18
+603964.89 794609.58
+603936.32 794597.51
+603905.2 794581
+603862.02 794569.57
+603845.51 794568.3
+603784.68 794555.67
+603719.78 794548.62
+603674.06 794543.54
+603622.95 794530.87
+603582.75 794507.53
+603526.22 794471.61
+603477.02 794423.97
+603433.32 794373.96
+603387.73 794330.27
+603353.54 794301.15
+603322.19 794286.81
+603289.38 794275.38
+603262.92 794272.84
+603214.28 794270.12
+603152.26 794268.84
+603084.7 794266.34
+603053.9 794273.19
+603101.87 794679.4
+603025.88 794687.02
+603044.28 794825.51
+603061.86 794962.86
+603073.39 794971.85
+603084.17 794979.65
+603125.46 795012.92
+603137.1 795019.9
+603146.84 794997.04
+603179.65 795012.7
+603221.05 795041.75
+603327.1 795016.98
+603438.86 795029.68
+603556.97 795060.16
+603642.06 795049.38
+603673.81 795065.25
+603729.05 795065.89
+603770.21 795044.09
+603776.87 795028.14
+603888.63 794997.02
+603888.23 794968.18
+603900.03 794961.41
+603918.78 794956.33
+603943.64 794947.05
+603964.72 794937.51
+603980.29 794930.98
+604002.88 794920.94
+604026.98 794911.4
+604056.1 794899.36
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 603478.02 794720.45
+Region  1
+  113
+604862.82 793533.59
+604889.43 793518.91
+604948.49 793485.57
+605084.25 793439.09
+605176.02 793401.3
+605238.42 793431.65
+605286.68 793489.76
+605315.58 793459.91
+605345.43 793438.64
+605361.94 793454.52
+605410.53 793507.54
+605446.1 793548.82
+605524.06 793631.52
+605578.68 793690.58
+605601.54 793714.4
+605616.46 793734.08
+605646.95 793734.72
+605704.59 793743.48
+605767.46 793756.82
+605803.98 793776.19
+605867.49 793733
+605846.85 793558.41
+605836.69 793480.61
+605869.25 793437.84
+605913.5 793377.58
+605943.63 793335.24
+605960.79 793313.89
+605901.95 793268.51
+605818.12 793233.58
+605740.64 793218.34
+605664.44 793211.99
+605602.84 793210.08
+605541.87 793210.08
+605477.41 793205.95
+605331.99 793145.62
+605280.55 793092.28
+605235.46 793041.47
+605191 793002.73
+605153.88 792970.64
+605108.8 792939.52
+605031.45 792911.35
+604947.51 792908.41
+604921.47 792912.85
+604878.41 792928.48
+604798.28 792957.94
+604734.15 792979.53
+604643.62 793004.4
+604548.09 793043.03
+604487.77 793061.44
+604374.7 793097.64
+604371.53 793108.43
+604367.75 793120.5
+604362.67 793130.02
+604355.69 793140.18
+604348.7 793154.15
+604338.54 793171.3
+604330.29 793189.71
+604305.78 793211.19
+604295.02 793206.13
+604236.29 793222.74
+604171.52 793243.69
+604128.34 793253.85
+604090.88 793258.3
+604059.13 793283.06
+604036.84 793296.64
+604027.38 793318.63
+604005.15 793345.94
+603984.83 793361.18
+603970.23 793377.69
+603958.8 793389.12
+603940.38 793398.64
+603923.24 793408.8
+603874.98 793429.76
+603838.78 793443.73
+603770.2 793445
+603735.91 793471.03
+603702.26 793495.8
+603713.69 793540.25
+603716.69 793587.15
+603747.34 793719.95
+603720.67 793750.43
+603797.53 793742.87
+603827.69 793664.12
+604003.93 793443.41
+604100.63 793378.15
+604138.41 793397.84
+604324.02 793413.87
+604358.63 793437.37
+604372.6 793465.94
+604372.13 793500.73
+604356.27 793534.43
+604329.43 793565.37
+604314.5 793590.78
+604320.38 793616.68
+604344.2 793623.35
+604359.44 793630.97
+604369.28 793653.84
+604378.01 793697.53
+604377.06 793740.08
+604417.07 793752.46
+604431.68 793758.18
+604453.91 793793.43
+604467.72 793783.44
+604508.37 793756.45
+604543.62 793781.85
+604577.59 793799.95
+604613.48 793773.91
+604628.24 793775.02
+604725.56 793764.6
+604756.85 793763.59
+604785.02 793668.4
+604821.07 793593.72
+604862.82 793533.59
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 604916.87 793360.87
+Region  1
+  28
+598751.15 789320.53
+598725.52 789361.68
+598698.53 789417.54
+598702.98 789437.86
+598728.7 789496.96
+598743.3 789542.68
+598759.43 789597.1
+598777.47 789657
+598799.02 789726.96
+598808.46 789755.7
+598819.19 789742.45
+598834.34 789722.26
+598852.64 789698.27
+598875.36 789667.35
+598883.99 789657.53
+598896.53 789637.39
+598899.97 789624.43
+598908.72 789563.32
+598918.24 789490.92
+598927.07 789424.22
+598932.98 789365.96
+598924.73 789322.46
+598909.49 789290.39
+598889.49 789262.45
+598826.3 789218.32
+598797.09 789192.28
+598772.64 789264.99
+598751.15 789320.53
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 598825.55 789457.37
+Region  1
+  16
+602904.8 806561.85
+603148.77 805949.36
+603152.75 805939.36
+603374.04 805382.39
+603050.58 805256.04
+603025.99 805245.01
+602667.91 806118.53
+602673.01 806141.94
+602687.62 806186.85
+602680.69 806207.1
+602656.05 806245.7
+602666.21 806274.17
+602715.63 806306.41
+602757.26 806332.06
+602809.83 806409.23
+602904.8 806561.85
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 602992.17 805848.76
+Region  1
+  323
+614884.12 808547.67
+614766.44 808083.44
+614830.74 808040.57
+614832.76 808016.71
+614806.28 807962.32
+614800.62 807939.27
+614798.2 807902.88
+614819.63 807864.86
+614854.4 807857.58
+614905.98 807863.04
+614918.11 807855.36
+614830.18 807744.76
+614764.67 807663.88
+614725.66 807610.3
+614703.02 807544.38
+614695.74 807453.8
+614720.4 807364.83
+614750.02 807312.28
+614785.69 807264.99
+614860.77 807170.85
+614886.49 807105.32
+614891.46 807050.57
+614878.61 806983.78
+614669.56 806651.96
+614536.83 806533.34
+614522.29 806504.7
+614491.61 806459.94
+614456.46 806429.39
+614409.08 806413.88
+614351.01 806398.95
+614315.34 806476.93
+614280.5 806556.56
+614234.49 806650.9
+614439.01 807347.31
+614408.62 807344.79
+614377.55 807335.46
+614340.22 807321.36
+614298.44 807303.72
+614250.95 807291.72
+614207.26 807275.93
+614164.82 807249.38
+614144.55 807227.88
+614125.36 807210.2
+614113.34 807186.56
+614100.89 807159.18
+614096.74 807110.24
+614092.6 807067.1
+614087.37 807014.72
+614086.79 806974.19
+614085.96 806928.57
+614035.36 806909.49
+614022.91 806935.2
+613998.03 806967.56
+613970.65 806986.63
+613947.42 806985.81
+613881.06 806943.5
+613767.41 806867.18
+613715.56 806852.7
+613647.54 806890.85
+613610.21 806872.6
+613601.91 806852.7
+613578.68 806817.85
+613582 806772.23
+613566.24 806726.6
+613551.31 806694.25
+613535.13 806662.33
+613466.28 806625.83
+613421.48 806600.11
+613317.79 806576.05
+613240.64 806570.25
+613156.43 806578.02
+613113.72 806576.05
+613102.93 806602.6
+613109.57 806668.13
+613134.45 806731.18
+613141.92 806756.07
+613135.11 806782.36
+613118.04 806803.24
+613088.3 806814.64
+613052.86 806826.04
+613002.27 806869.72
+612978.23 806888.07
+612914.33 806920.37
+612895.95 806936.5
+612887.66 806965.53
+612880.25 807024.76
+612869.52 807059.56
+612844.24 807100.06
+612830.36 807137.39
+612811.42 807189.9
+612792.96 807237.58
+612761.91 807298.94
+612733.09 807359.06
+612709.73 807433.6
+612695.82 807505.15
+612699.8 807522.54
+612719.17 807543.41
+612756.94 807567.76
+612790.3 807596.68
+612794.14 807637.79
+612778.35 807656.7
+612767.96 807680.54
+612773.46 807722.11
+612779.33 807769.79
+612773.46 807829.83
+612787.46 807857.81
+612760.21 807897.18
+612743.14 807921.86
+612716.58 807942.75
+612686.22 807973.12
+612657.76 807998.44
+612647.65 808016.79
+612641.98 808038.94
+612640.76 808081.95
+612648.17 808155.06
+612608.9 808148.74
+612595.35 808154.61
+612590.39 808174.47
+612605.51 808191.81
+612594.68 808222.06
+612573.46 808245.08
+612563.53 808277.14
+612564.88 808308.28
+612549.53 808335.82
+612520.19 808337.18
+612497.62 808303.77
+612463.31 808297.9
+612429.45 808268.11
+612271.82 808185.24
+612254.7 808154.88
+612161.9 808010.21
+612055.07 807877.05
+612010.85 807899.41
+611964.38 807909.59
+611931.85 807928.73
+611874.85 807945.77
+611777.31 807985.86
+611741.04 808043.01
+611709.61 808070.36
+611706.47 808098.83
+611715.98 808114.01
+611718.53 808136.78
+611717.28 808151.33
+611702.78 808181.14
+611662.03 808169.71
+611611.85 808111.08
+611594.46 808070.33
+611578.06 808062.38
+611547.26 808072.82
+611514.96 808070.33
+611470.74 808076.3
+611451.86 808087.72
+611406.64 808158.28
+611379.31 808197.67
+611369.63 808266.92
+611378.24 808301.37
+611341.75 808318.79
+611386.18 808401.3
+611387.99 808438.48
+611416.1 808494.69
+611478.46 808608.81
+611490.91 808645.65
+611499.07 808665.6
+611520.83 808685.54
+611614 808690.99
+611621.86 808779.39
+611627.44 808842.18
+611681.89 808844.05
+611703.4 808839.61
+611718.16 808831.53
+611742.07 808823.36
+611774.71 808812.48
+611795.56 808809.76
+611850.87 808809.76
+611958.32 808804.74
+612017.32 808788.23
+612024.92 808792.02
+611979.62 809302.96
+611976 809323.82
+612328.71 809380.03
+612435.73 809432.03
+612463.6 809454.15
+612477.55 809476.29
+612478.22 809511.08
+612463.06 809539.56
+612449.79 809562.34
+612444.18 809653.43
+612435.43 809767.31
+612453.27 809881.8
+612497.07 810016.52
+612522.43 810048.78
+612578.66 810096.54
+612627.77 810125.54
+612762.4 810111.39
+612860.4 810072.23
+612886.22 810088.53
+612904.15 810075.17
+612948.45 810066.93
+612976.48 810081.18
+612995.38 810101.13
+613021.41 810082.86
+613035.9 810079.93
+613082.3 810090.21
+613107.91 810105.96
+613137.51 810153.38
+613186.92 810239.63
+613198.98 810336.35
+613313.27 810450.86
+613324.6 810471.5
+613378.15 810516.37
+613527.86 810559.22
+613541.83 810554.36
+613597.36 810605.68
+613627.41 810614.36
+613721.69 810630.13
+613739.04 810639.65
+613801.9 810640.5
+613898.51 810655.21
+613905.29 810652.46
+613907.52 810608.33
+613993.95 810538.38
+614044.11 810462.61
+614059.93 810407.59
+614069.64 810358.91
+614089.33 810335.1
+614142.67 810259.75
+614176.75 810202.17
+614209.36 810115.2
+614226.03 810049.24
+614265.17 809991.26
+614288.36 809985.46
+614326.05 809993.43
+614355.76 810017.35
+614411.93 810012.63
+614435.85 810025.68
+614546.74 810011.18
+614602.55 810001.76
+614677.2 810031.48
+614735.18 810064.09
+614810.55 810044.52
+614815.63 810024.23
+614815.63 809977.12
+614858.39 809979.29
+614877.57 809972.4
+614909.69 809976.07
+614956.57 809905
+615009.48 809860.06
+615033.4 809860.06
+615123.27 809888.33
+615175.45 809931.09
+615201.54 809979.65
+615224.73 810012.99
+615295.04 810073.14
+615336.69 810098.15
+615378.73 810095.97
+615545.42 810009
+615558 809934.98
+615555.2 809824.97
+615512.8 809731.41
+615512.8 809679.95
+615506.27 809599.5
+615488.88 809584.28
+615475.11 809550.21
+615450.47 809525.57
+615448.64 809473.74
+615439.94 809432.43
+615421.82 809407.06
+615471.04 809348.36
+615483.42 809284.58
+615537.06 809275.16
+615619.68 809272.26
+615711 809253.41
+615797.25 809200.5
+615896.25 809192.39
+615911.83 809124.46
+615945.8 809003.36
+615958.85 808970.02
+615965.37 808945.38
+615968.06 808920.1
+615965.7 808874.74
+615954.14 808876.51
+615918.57 808881.96
+615846.39 808871.24
+615796.4 808885.18
+615738.79 808878.25
+615696.43 808843.38
+615665.29 808791.88
+615692.84 808742.77
+615721.58 808668.52
+615715.6 808640.97
+615734.76 808573.9
+615753.92 808551.15
+615756.32 808518.81
+615770.69 808503.24
+615777.88 808430.18
+615793.15 808353.77
+615778.18 808317.84
+615788.96 808207.05
+615793.15 808154.35
+615778.48 808160.04
+615743.75 808161.83
+615707.22 808148.06
+615617.39 808086.38
+615562.9 808058.84
+615497.03 808046.26
+615346.91 808053.34
+615260.98 808092.56
+615210.74 808114.9
+615174.05 808123.18
+615237.59 808367.97
+615194.88 808510.26
+615114.32 808533.13
+615111.81 808561.6
+615127.7 808621.69
+615002.41 808663.5
+614985.91 808624.29
+614984.61 808591.39
+615007.37 808562.28
+615033.93 808537.6
+615042.77 808518.62
+615037.7 808508.5
+615018.38 808510.47
+614884.12 808547.67
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 613755.9 808654.74
+Region  1
+  689
+608222.18 787963.39
+608312.24 787960.41
+608313.59 787858.68
+608207.84 787787.45
+608148.35 787741.28
+608111.71 787716.45
+608075.69 787699.19
+608019.68 787658.63
+608000.46 787642.13
+607951.71 787631.23
+607922.95 787628.81
+607888.29 787615.95
+607848.32 787578.7
+607759.08 787512
+607697.35 787470.87
+607657.46 787444.28
+607640.34 787437.77
+607613.09 787428.57
+607551.08 787407.33
+607486.27 787381.59
+607416.75 787353.6
+607363 787331.24
+607311.94 787319.96
+607208.49 787279.65
+607189.7 787259.73
+607129.65 787158.54
+607091.64 787105.65
+607060.02 787034.81
+606997.8 787009.35
+606889.03 786918.58
+606821.11 786884.85
+606788.22 786848.21
+606775.93 786807.91
+606742.29 786778.78
+606690.55 786731.35
+606664.06 786721.59
+606631.76 786723.46
+606592.69 786703.74
+606584.99 786679.83
+606572.51 786658.05
+606548.74 786621.25
+606503.9 786559.23
+606480.38 786543.32
+606450.91 786531.1
+606452.77 786514.64
+606451.54 786498.31
+606407.65 786468.92
+606371.92 786454.71
+606354.4 786437.19
+606345.37 786421.79
+606350.15 786409.32
+606379.35 786386.75
+606391.83 786373.48
+606397.67 786352.5
+606387.58 786298.87
+606379.09 786278.43
+606369.78 786245.56
+606372.7 786209.71
+606383.33 786175.98
+606378.84 786161.44
+606371.97 786143.89
+606359.39 786121.01
+606364.54 786081.92
+606359.58 786062.85
+606350.08 786050.85
+606292.04 786006.91
+606275.14 785985.05
+606244.41 785968.92
+606216.85 785929.58
+606218.61 785864.12
+606204.26 785826.27
+606187.25 785805.13
+606145.47 785779.28
+606079.68 785711.97
+606078.03 785648.9
+606066.97 785590.88
+606012.16 785484.82
+605991.15 785447.09
+605978.07 785435.41
+605965.16 785413.54
+605862.37 785361.92
+605796.4 785301.05
+605787.61 785269.8
+605788.04 785242.24
+605791.85 785201.44
+605781.84 785155.83
+605723.9 785136.56
+605713.82 785125.01
+605709.03 785100.31
+605695.2 785072.58
+605644.64 785041.53
+605604.7 785024.82
+605565.93 785024.91
+605500.62 785034.11
+605447.48 785047.1
+605426.83 785039.23
+605403.05 785019.97
+605381.12 785014.98
+605377.06 785003.43
+605357.52 784989.17
+605355.25 784965.29
+605327.3 784934.98
+605342.11 784901.4
+605388.62 784851.54
+605400.6 784816.67
+605399.3 784795.99
+605396.22 784738.24
+605377.19 784707.22
+605354.03 784669.52
+605338.05 784639.17
+605318.83 784524.81
+605225.59 784438.7
+605111.83 784388.22
+605093.04 784366.61
+605088.5 784357.1
+605087.42 784352.78
+605069.07 784308.94
+605043.63 784266.33
+604869.44 784074.12
+604812.21 784038.18
+604814.61 784000.75
+604790.3 783943.6
+604794.3 783908.92
+604808.45 783887.24
+604813.42 783836.46
+604808.78 783802.43
+604811.92 783772.09
+604793.66 783696.76
+604793.76 783637.28
+604782.31 783615.02
+604760.16 783594.42
+604750.87 783579.29
+604712.94 783536.65
+604674.05 783499.48
+604665.84 783476.14
+604670.27 783459.16
+604698.57 783447.92
+604735.18 783391.87
+604787.68 783370.69
+604887.46 783364.44
+604953.12 783352.57
+604973.42 783341.98
+604983.78 783322.11
+604983.57 783263.8
+604935.84 783227.95
+604913.03 783207.97
+604863.11 783152.54
+604814.53 783098.76
+604759.02 783017.23
+604702.2 782946.55
+604677.91 782895.37
+604679.65 782847.66
+604674.44 782807.76
+604693.52 782740.11
+604744.7 782623.01
+604751.64 782596.99
+604751.64 782563.16
+604738.63 782522.39
+604707.83 782471.32
+604637.58 782435.88
+604585.68 782408.67
+604560.99 782378.92
+604517.44 782353.02
+604485.02 782254.88
+604432.48 782168.82
+604394.49 782089.71
+604378.66 782028.95
+604345.76 782001.04
+604315.38 781942.3
+604267.11 781867.1
+604257.11 781858.08
+604173.59 781873.43
+604084.98 781855.56
+603995.74 781861.02
+603930.73 781837.98
+603868.19 781820.7
+603749.56 781749.25
+603664.12 781730.27
+603606.53 781722.04
+603555.9 781721.41
+603507.17 781709.39
+603459.07 781699.9
+603351.49 781700.54
+603243.22 781659.17
+603205.74 781659.17
+603181.26 781698.65
+603146.46 781728.39
+603121.15 781770.16
+603103.44 781816.36
+603085.73 781865.1
+603077.1 781897.2
+603007.28 781960.66
+602966.15 781991.68
+602903.9 782056.23
+602846.17 782104.85
+602800.38 782131.55
+602762.42 782176.48
+602723.07 782204.74
+602713.07 782211.93
+602659.79 782227.41
+602663.34 782245.09
+602689.67 782275.21
+602712.45 782300.53
+602725.13 782333.21
+602744.37 782376.77
+602740.32 782422.35
+602733.23 782475.02
+602746.4 782531.74
+602759.98 782608.1
+602759.86 782666.21
+602768.21 782714.37
+602804.18 782775.38
+602831.15 782811.35
+602894.09 782859.51
+602951.89 782916.67
+602983.35 782954.56
+603017.63 782987.18
+603060.67 783032.11
+603095.44 783053.13
+603170.58 783072.4
+603212.97 783084.6
+603248.01 783097.29
+603267.56 783132.13
+603286.83 783180.3
+603316.05 783202.49
+603385.41 783227.53
+603436.79 783265.43
+603487.9 783332.08
+603498.04 783389.04
+603511.98 783454.85
+603532.24 783499.15
+603553.13 783530.16
+603595.75 783586.21
+603608.59 783619
+603617.58 783706.99
+603625.29 783724.97
+603619.51 783789.2
+603575.84 783838.01
+603550.15 783893.89
+603541.48 783936.56
+603479.82 784001.42
+603361.65 784072.72
+603295.5 784110.61
+603227.73 784121.16
+603142.96 784166.76
+603083.72 784269.38
+602940.65 784265.06
+602792.29 784270.19
+602765.31 784287.53
+602737.7 784333.78
+602717.14 784471.22
+602692.1 784515.54
+602538.91 784541.54
+602500.71 784554.07
+602468.59 784640.14
+602411.75 784659.71
+602312.2 784728.44
+602188.25 784806.15
+602133.66 784833.77
+602039.56 784882.88
+601934.88 784941.97
+601884.46 784970.54
+601833.72 785041.83
+601852.35 785060.46
+601984.65 785255.35
+602007.51 785189.95
+602009.41 785178.52
+602048.78 785191.22
+602071.5 785207.85
+602079.74 785230.64
+602046.23 785327.48
+602236.11 785590.66
+602162.82 785646.51
+602122.32 785675.62
+602044.35 785736.06
+602485.06 786287.22
+602376.18 786371.37
+602400.6 786390.72
+602420.92 786407.23
+602447.59 786431.36
+602481.88 786444.06
+602546.02 786451.05
+602606.19 786455.5
+602678.36 786494.12
+602701.15 786506.78
+602715.72 786528.3
+602739.77 786532.1
+602861.94 786575.8
+602875.87 786590.99
+602898.66 786601.12
+602934.74 786602.39
+602994.88 786619.49
+603027.79 786624.56
+603065.14 786640.39
+603089.83 786642.29
+603113.88 786642.29
+603142.37 786653.06
+603187.31 786665.72
+603205.04 786680.28
+603225.3 786685.35
+603272.13 786669.53
+603353.78 786673.34
+603418.97 786661.33
+603454.41 786642.34
+603477.19 786650.57
+603486.06 786660.7
+603505.68 786663.87
+603543.67 786681.6
+603563.93 786699.96
+603596.21 786708.82
+603650.65 786722.12
+603693.69 786737.32
+603721.55 786745.55
+603748.15 786786.07
+603776 786800.63
+603790.57 786821.52
+603808.92 786820.89
+603832.35 786844.31
+603837.9 786834.31
+603905.72 786716.15
+604029.23 786636.14
+604123.21 786567.87
+604171.15 786513.23
+604192.42 786472.9
+604224.49 786430.67
+604243.61 786435.48
+604286.65 786454.47
+604345.46 786479.88
+604396.89 786495.76
+604410.23 786518.3
+604417.21 786550.06
+604415.63 786590.38
+604408.32 786625.95
+604382.61 786727.24
+604366.11 786788.83
+604359.12 786823.43
+604359.76 786842.8
+604359.44 786857.09
+604358.8 786877.73
+604353.41 786940.91
+604351.82 786964.41
+604342.93 786996.16
+604324.52 787020.93
+604289.59 787063.47
+604303.35 787070.98
+604343.57 787097.13
+604377.42 787119.73
+604465.42 787164.68
+604469.22 787179.87
+604444.57 787260.89
+604431.28 787271.65
+604323.93 787235.51
+604338.38 787582.99
+604347.23 787612.1
+604346.28 787764.14
+604377.71 787873.7
+604428.83 787873.39
+604459.31 787881.01
+604491.02 787896.39
+604530.9 787921.08
+604550.1 787942.12
+604597.09 787999.06
+604685.02 788032.79
+604652.96 788092.63
+604635.82 788111.95
+604619.52 788154.86
+604595.48 788163.46
+604594.1 788174.37
+604620.14 788181.36
+604620.35 788193.21
+604605.32 788208.45
+604583.94 788211.44
+604544.78 788229.43
+604534.83 788245.73
+604537.16 788259.7
+604564.25 788274.73
+604572.29 788284.69
+604589.86 788290.2
+604588.9 788299.95
+604564.77 788318.05
+604554.61 788327.57
+604581.92 788374.88
+604597.71 788403.06
+604609.13 788425.28
+604648.82 788502.43
+604691.36 788584.99
+604730.1 788624.36
+604834.24 788617.69
+604864.72 788615.18
+604905.23 788588.27
+604950.76 788562.16
+604990.13 788539.3
+605065.38 788492.95
+605120.62 788452.63
+605171.1 788404.36
+605215.24 788344.67
+605387.01 788325.93
+605372.72 788288.8
+605381.7 788245.28
+605412.41 788198.99
+605456.54 788143.1
+605491.78 788097.98
+605549.24 788026.54
+605611.16 788053.53
+605671.48 788083.69
+605689.89 788111.67
+605704.81 788122.78
+605721.64 788130.4
+605774.98 788133.26
+605733.71 788213.23
+605671.79 788328.5
+605648.62 788370.41
+605629.25 788407.25
+605617.18 788430.11
+605631.18 788488.37
+605660.41 788594.69
+605643.91 788687.41
+605637.56 788702.33
+605590.25 788781.71
+605559.41 788840.45
+605528.29 788874.74
+605487.65 788888.39
+605442.89 788898.52
+605402.88 788900.74
+605355.58 788975.99
+605336.21 788998.87
+605323.86 789013.8
+605309.22 789030.77
+605289.57 789054.6
+605300.83 789191.54
+605373.22 789159.47
+605434.5 789132.48
+605487.2 789115.97
+605516.41 789114.72
+605633.57 789162.98
+605698.98 789183.66
+605746.92 789203.34
+605807.56 789226.84
+605840.97 789251.12
+605871.38 789309.35
+605902.41 789364.43
+605927.74 789400.51
+605955.23 789438.27
+605879.03 789504.01
+605847.28 789558.93
+605804.42 789678.63
+605840.3 789714.83
+605911.69 789781.88
+605973.28 789839.99
+605984.71 789866.34
+605975.03 790004.3
+605966.28 790084.33
+605944.69 790107.19
+605815.15 790194.5
+605801.94 790232.44
+605789.55 790270.96
+605758.44 790343.35
+605800.14 790356.48
+605798.44 790373.2
+605805.01 790387.17
+605813.13 790386.37
+605861.4 790407.7
+605894.86 790398.04
+605958.57 790404.18
+606033.66 790429.92
+606158.14 790585.72
+606161.49 790601.96
+606166.36 790615.72
+606179.73 790660.01
+606242.6 790698.12
+606277.52 790696.21
+606372.46 790671.13
+606451.51 790604.44
+606474.06 790560.31
+606542.78 790461.4
+606582.47 790475.05
+606594.86 790479.84
+606598.03 790457.93
+606601.21 790430.95
+606611.37 790385.22
+606598.01 790324.35
+606640.65 790313.9
+606685.77 790303.72
+606742.41 790291.96
+606709.72 790200.99
+606816.71 790043.5
+606856.72 790022.89
+606780.84 789931.75
+607046.98 789790.93
+607090.48 789835.06
+607344.73 789800.3
+607384.91 789816.95
+607441.1 789809.65
+607834.8 789884.27
+608167.54 790000.16
+608629.82 790219.61
+608227.84 790894.81
+608450.09 791162.15
+608511.08 791065.86
+608659.64 791148.81
+608652.02 791219.93
+608629.83 791376.69
+608627.3 791395.39
+608621.58 791441.12
+608615.55 791487.47
+608742.87 791362.98
+608828.28 791282.97
+608862.25 791271.54
+608905.75 791287.73
+608885.11 791330.59
+609033.06 791439.49
+609214.85 791455.07
+609377.41 791462.69
+609524.1 791287.12
+609651.4 791171.44
+609760.87 791088.54
+609869.07 791018.93
+609897.55 790994.88
+609924.05 790976.87
+609953.26 790954.01
+609984.06 790932.42
+610010.41 790919.72
+610050.24 790895.11
+610199.32 790825.1
+610196.5 790718.36
+610140.13 790525.48
+610081.39 790329.62
+610078.85 790267.39
+610099.79 790215.73
+610138.54 790169.6
+610189.91 790116.34
+610221.49 790067.22
+610193.8 790035.8
+610156.12 790001.34
+610126.3 789949.42
+610161.58 789888.88
+610141.62 789847.08
+610125.51 789829.16
+610058.68 789810.52
+610023.67 789760.07
+610033.79 789704.96
+610015.81 789676.89
+609995.14 789664.41
+609919.96 789645.21
+609901.99 789631.22
+609882.02 789584.63
+609858.73 789513.95
+609844.89 789465.76
+609781.1 789432.35
+609756.08 789398.55
+609629.09 789310.96
+609595.93 789274.05
+609534.92 789269.67
+609479.53 789254.89
+609426.75 789222.52
+609335.32 789174.41
+609327.1 789156.41
+609343.77 789143.9
+609345.13 789135.86
+609336.8 789098.97
+609311.79 789082.89
+609275.95 789028.02
+609161.13 788995.57
+609127.47 788946.24
+609126.74 788880.88
+609147.89 788834.05
+609154.87 788772.68
+609167.79 788708.7
+609167.27 788687.38
+609154.04 788653.07
+609119.55 788636.74
+609089.91 788635.51
+609041.77 788658.44
+609008.06 788664.39
+608987.79 788657.18
+608960.54 788628.78
+608935.67 788581.6
+608918.35 788524.4
+608911.03 788503.23
+608902.44 788460.97
+608898.93 788449.48
+608876.8 788431.83
+608787.39 788294.48
+608721.23 788209.53
+608656.84 788170.76
+608587.34 788087.93
+608549.82 788015.61
+608492.2 787969.04
+608441.66 787926.64
+608390.19 787911.04
+608314.21 787858.76
+608314.21 787858.88
+608313.18 787952.79
+608311.4 788005.32
+608312.78 788013.4
+608320.11 788043.17
+608333.44 788088.73
+608365.14 788138.55
+608436.6 788236.17
+608502.01 788323.22
+608573.47 788422.35
+608627.06 788502.11
+608701.04 788617.86
+608765.61 788726.82
+608789.68 788771.76
+608952.63 789043.51
+608993.64 789111.65
+609057.05 789205.24
+609132.93 789302.86
+609132.31 789326.28
+609251.44 789667.47
+609130.56 789712.39
+609087.54 789752.26
+609032.49 789799.09
+608988.19 789818.07
+608914.14 789833.89
+608828.71 789871.85
+608723.67 789957.29
+607937.98 789421.69
+607987.9 789200.16
+608059.43 789205.87
+608156.9 789212.21
+608255.01 789214.75
+608228.42 789211.59
+608210.7 789200.82
+608192.97 789183.1
+608180.3 789159.68
+608172.69 789121.06
+608169.51 789080.55
+608190.39 789051.44
+608249.88 789048.92
+608274.56 789033.1
+608304.3 789002.09
+608337.19 788966.65
+608361.24 788938.17
+608394.78 788925.51
+608396.66 788891.97
+608386.51 788833.1
+608375.75 788812.84
+608352.32 788789.42
+608316.24 788789.41
+608276.37 788792.57
+608245.35 788791.94
+608225.73 788778.01
+608199.13 788755.22
+608156.72 788745.72
+608118.11 788736.22
+608054.81 788727.35
+608010.5 788716.58
+607974.43 788727.33
+607945.95 788746.95
+607928.87 788770.37
+607920.65 788795.05
+607901.67 788814.04
+607870.66 788809.6
+607818.75 788800.1
+607758.62 788793.13
+607665.58 788804.51
+607557.99 788829.18
+607483.94 788858.92
+607443.44 788865.88
+607383.31 788852.58
+607308.61 788823.45
+607246.57 788796.22
+607173.13 788741.78
+607190.2 788696.84
+607221.19 788648.11
+607265.48 788598.11
+607357.85 788500.01
+607364.17 788482.29
+607324.92 788446.21
+607282.5 788427.21
+607232.49 788403.78
+607204.64 788396.82
+607180.58 788382.26
+607170.45 788363.9
+607238.52 788283.86
+606787.51 787825.39
+606757.79 787795.86
+606690.63 787727.93
+606715.72 787720.21
+607020.11 787632.27
+607819.27 788113.58
+607931.35 788066.29
+607979.29 788040.89
+608018.34 788045.97
+608069.46 788041.53
+608205.99 788003.4
+608222.18 787963.39
+    Pen (1,2,16711935) 
+    Brush (1,0,16777215)
+    Center 605541.26 786761.23
diff --git a/examples/data/BairrosPoA.dbf b/examples/data/BairrosPoA.dbf
old mode 100755
new mode 100644
diff --git a/examples/data/BairrosPoA.shp b/examples/data/BairrosPoA.shp
old mode 100755
new mode 100644
diff --git a/examples/data/BairrosPoA.shx b/examples/data/BairrosPoA.shx
old mode 100755
new mode 100644
diff --git a/examples/data/BairrosRecife.mid b/examples/data/BairrosRecife.mid
old mode 100755
new mode 100644
index 838bde2..646cd4f
--- a/examples/data/BairrosRecife.mid
+++ b/examples/data/BairrosRecife.mid
@@ -1,94 +1,94 @@
-261160605001
-261160605002
-261160605003
-261160605004
-261160605005
-261160605006
-261160605007
-261160605008
-261160605009
-261160605010
-261160605011
-261160605012
-261160605013
-261160605014
-261160605015
-261160605016
-261160605017
-261160605018
-261160605019
-261160605020
-261160605021
-261160605022
-261160605023
-261160605024
-261160605025
-261160605026
-261160605027
-261160605028
-261160605029
-261160605030
-261160605031
-261160605032
-261160605033
-261160605034
-261160605035
-261160605036
-261160605037
-261160605038
-261160605039
-261160605040
-261160605041
-261160605042
-261160605043
-261160605044
-261160605045
-261160605046
-261160605047
-261160605048
-261160605049
-261160605050
-261160605051
-261160605052
-261160605053
-261160605054
-261160605055
-261160605056
-261160605057
-261160605058
-261160605059
-261160605060
-261160605061
-261160605062
-261160605063
-261160605064
-261160605065
-261160605066
-261160605067
-261160605068
-261160605069
-261160605070
-261160605071
-261160605072
-261160605073
-261160605074
-261160605075
-261160605076
-261160605077
-261160605078
-261160605079
-261160605080
-261160605081
-261160605082
-261160605083
-261160605084
-261160605085
-261160605086
-261160605087
-261160605088
-261160605089
-261160605090
-261160605091
-261160605092
-261160605093
-261160605094
+261160605001
+261160605002
+261160605003
+261160605004
+261160605005
+261160605006
+261160605007
+261160605008
+261160605009
+261160605010
+261160605011
+261160605012
+261160605013
+261160605014
+261160605015
+261160605016
+261160605017
+261160605018
+261160605019
+261160605020
+261160605021
+261160605022
+261160605023
+261160605024
+261160605025
+261160605026
+261160605027
+261160605028
+261160605029
+261160605030
+261160605031
+261160605032
+261160605033
+261160605034
+261160605035
+261160605036
+261160605037
+261160605038
+261160605039
+261160605040
+261160605041
+261160605042
+261160605043
+261160605044
+261160605045
+261160605046
+261160605047
+261160605048
+261160605049
+261160605050
+261160605051
+261160605052
+261160605053
+261160605054
+261160605055
+261160605056
+261160605057
+261160605058
+261160605059
+261160605060
+261160605061
+261160605062
+261160605063
+261160605064
+261160605065
+261160605066
+261160605067
+261160605068
+261160605069
+261160605070
+261160605071
+261160605072
+261160605073
+261160605074
+261160605075
+261160605076
+261160605077
+261160605078
+261160605079
+261160605080
+261160605081
+261160605082
+261160605083
+261160605084
+261160605085
+261160605086
+261160605087
+261160605088
+261160605089
+261160605090
+261160605091
+261160605092
+261160605093
+261160605094
diff --git a/examples/data/BairrosRecife.mif b/examples/data/BairrosRecife.mif
old mode 100755
new mode 100644
index dd89723..14c493d
--- a/examples/data/BairrosRecife.mif
+++ b/examples/data/BairrosRecife.mif
@@ -1,13886 +1,13886 @@
-Version 300
-Charset "WindowsLatin1" 
-Delimiter ";"
-CoordSys Earth Projection 8, 92, Meters, -33.000000, 0.000000, 0.999600, 500000.000000, 10000000.000000 Bounds (277712.72411, 9098026.284832) (294927.38349, 9123062.304523)
-Columns 1
-  ID_ Char(16)
-Data
-Region 1
-143
-294927.383494  9110349.192930 
-294744.887076  9109866.859191 
-294715.645195  9109810.579317 
-294528.843923  9109416.636133 
-294423.835782  9109195.544709 
-294398.772343  9109166.390114 
-294368.560093  9109113.122393 
-294343.294756  9109056.845831 
-294314.726304  9108957.372220 
-294283.363436  9108883.008600 
-294275.150885  9108847.842938 
-294265.010476  9108820.711496 
-294259.921583  9108804.634483 
-294258.860435  9108795.592887 
-294252.822564  9108785.542016 
-294250.767570  9108776.499468 
-294246.739834  9108769.464047 
-294238.684365  9108755.393204 
-294231.600320  9108738.309762 
-294220.578272  9108726.245087 
-294213.539097  9108715.188737 
-294209.481470  9108704.135246 
-294205.364039  9108685.045622 
-294202.277838  9108670.979533 
-294196.195149  9108654.901549 
-294190.149841  9108643.846145 
-294185.105858  9108633.796210 
-294182.057045  9108624.752699 
-294175.966898  9108607.670192 
-294165.878952  9108587.570315 
-294160.834983  9108577.520374 
-294153.758483  9108561.441422 
-294146.674516  9108544.357951 
-294142.616929  9108533.304445 
-294137.595393  9108526.268049 
-294133.537811  9108515.214542 
-294130.421763  9108497.130371 
-294124.406392  9108490.093016 
-294120.341345  9108478.034989 
-294116.223993  9108458.945342 
-294110.178740  9108447.889916 
-294104.126019  9108435.829971 
-294100.008682  9108416.740320 
-294092.902354  9108396.643279 
-294087.836016  9108383.579769 
-294077.755650  9108364.484366 
-294069.692859  9108349.408944 
-294066.659041  9108342.374449 
-294068.519719  9108325.299573 
-294065.508316  9108321.278629 
-294056.548815  9108319.260968 
-294055.532564  9108316.246458 
-294048.471101  9108302.176504 
-294019.223996  9108244.891190 
-294014.202519  9108237.854768 
-294010.189821  9108232.828340 
-294007.156024  9108225.793837 
-294002.082272  9108211.725789 
-293996.926371  9108186.608045 
-293992.876339  9108176.559026 
-293985.837330  9108165.502605 
-293975.816814  9108154.443299 
-293973.791802  9108149.418787 
-293970.698279  9108134.348136 
-293965.639489  9108122.289114 
-293954.572885  9108104.197213 
-293945.501428  9108087.111749 
-293940.472518  9108079.070793 
-293930.392306  9108059.975325 
-293923.301074  9108041.887259 
-293920.207583  9108026.816598 
-293918.122860  9108013.755936 
-293911.054040  9107998.681420 
-293888.913499  9107961.493041 
-293881.889487  9107952.445626 
-293866.847639  9107934.349826 
-293862.827526  9107928.318856 
-293859.786317  9107920.279813 
-293852.627974  9107893.151057 
-293845.484569  9107868.031334 
-293837.407049  9107850.946792 
-293824.323070  9107828.834822 
-293814.280294  9107814.761895 
-293805.246278  9107802.698970 
-293798.155157  9107784.610861 
-293794.082837  9107771.548247 
-293788.934618  9107747.434956 
-293786.835042  9107732.365236 
-293776.687852  9107704.229026 
-293766.570520  9107680.110887 
-293751.424388  9107647.951746 
-293747.374482  9107637.902679 
-293745.289853  9107624.841990 
-293742.241238  9107615.798410 
-293729.164855  9107594.690903 
-293672.755437  9107626.780234 
-293521.281374  9107704.984071 
-293462.936145  9107744.102902 
-293364.208865  9107832.403195 
-293339.616406  9107866.532504 
-293327.869243  9107890.629294 
-293320.097410  9107914.729992 
-293300.255215  9108053.333432 
-293301.509882  9108088.492658 
-293298.637523  9108237.157915 
-293296.080829  9108294.412704 
-293293.382528  9108332.581588 
-293300.764305  9108389.846127 
-293317.493299  9108501.363570 
-293323.491394  9108639.992344 
-293320.972113  9108702.269727 
-293320.559857  9108780.621391 
-293314.169583  9108856.958177 
-293296.345196  9108999.581685 
-293290.687789  9109040.761214 
-293294.737803  9109050.810311 
-293306.858028  9109076.939513 
-293337.973511  9109118.154962 
-293383.234388  9109190.524081 
-293427.531411  9109266.910231 
-293430.557774  9109272.940255 
-293444.725586  9109307.107480 
-293454.850799  9109332.230150 
-293530.218275  9109577.404394 
-293552.419405  9109622.628964 
-293992.155865  9110483.917707 
-294014.373032  9110531.150854 
-294037.644004  9110586.421057 
-294048.853659  9110623.598579 
-294056.117705  9110664.790372 
-294060.340227  9110697.943191 
-294064.772311  9110759.222458 
-294065.213877  9110818.488906 
-294060.588682  9110864.691915 
-294057.666870  9110872.725207 
-294050.089921  9110922.943445 
-294042.505484  9110972.157169 
-294025.960977  9111019.353352 
-294001.555051  9111078.596165 
-293981.983873  9111119.762415 
-293955.530183  9111170.967203 
-294251.836018  9110921.125913 
-294927.383494  9110349.192930 
-Region 1
-84
-294065.213877  9110818.488906 
-294064.772311  9110759.222458 
-294060.340227  9110697.943191 
-294056.117705  9110664.790372 
-294048.853659  9110623.598579 
-294037.644004  9110586.421057 
-294014.373032  9110531.150854 
-293992.155865  9110483.917707 
-293552.419405  9109622.628964 
-293530.218275  9109577.404394 
-293454.850799  9109332.230150 
-293444.725586  9109307.107480 
-293430.557774  9109272.940255 
-293427.531411  9109266.910231 
-293383.234388  9109190.524081 
-293337.973511  9109118.154962 
-293306.858028  9109076.939513 
-293294.737803  9109050.810311 
-293290.687789  9109040.761214 
-293275.645665  9109022.665255 
-293270.631626  9109016.633266 
-293255.604431  9109000.546339 
-293235.630320  9108987.468101 
-293206.674215  9108969.358479 
-293161.756762  9108943.197059 
-293122.780144  9108914.027874 
-293103.755245  9108894.923404 
-293074.657661  9108857.727748 
-292854.985020  9108585.287285 
-292782.828319  9108638.455178 
-292651.255912  9108720.694981 
-292481.108432  9108828.009014 
-292466.230293  9108832.012252 
-292451.344711  9108835.010959 
-292313.160993  9108829.850311 
-292268.578511  9108848.891541 
-292219.086135  9108875.963968 
-292079.531088  9108954.176414 
-291989.371685  9108992.257477 
-291896.341889  9109045.403312 
-291823.100119  9109086.514742 
-291722.141186  9109142.665864 
-291698.741081  9109203.918009 
-291678.834731  9109334.485706 
-291675.127352  9109505.250677 
-291672.347160  9109666.975882 
-291672.451108  9109681.039292 
-291675.989645  9109756.382000 
-291686.448292  9109826.709078 
-291698.709107  9109871.924924 
-291701.350442  9109960.325484 
-291702.485447  9109979.412538 
-291686.125497  9110186.327479 
-291677.522141  9110232.526801 
-291688.521836  9110241.578574 
-291703.519400  9110253.647934 
-291721.483798  9110263.711229 
-291733.469974  9110271.759459 
-291772.380487  9110291.889008 
-291985.817523  9110392.555007 
-291996.794999  9110398.593100 
-292058.632262  9110427.785930 
-292257.109763  9110521.403789 
-292500.469791  9110636.159771 
-292594.231573  9110681.455477 
-292640.114895  9110703.600001 
-292687.993507  9110726.750944 
-292903.451486  9110831.431676 
-292913.427793  9110836.463999 
-293036.110408  9110894.845514 
-293154.810204  9110952.218239 
-293159.802112  9110955.236627 
-293355.301623  9111048.845678 
-293490.965711  9111115.274316 
-293789.205136  9111258.200908 
-293955.530183  9111170.967203 
-293981.983873  9111119.762415 
-294001.555051  9111078.596165 
-294025.960977  9111019.353352 
-294042.505484  9110972.157169 
-294050.089921  9110922.943445 
-294057.666870  9110872.725207 
-294060.588682  9110864.691915 
-294065.213877  9110818.488906 
-Region 1
-101
-292651.255912  9108720.694981 
-292782.828319  9108638.455178 
-292571.701510  9108311.777175 
-292507.344261  9108210.256601 
-292503.324267  9108204.225474 
-292495.306588  9108195.176795 
-292482.126387  9108160.005475 
-292463.087224  9108138.891540 
-292225.928155  9108054.273903 
-291735.740107  9107889.036183 
-291728.620015  9108001.535428 
-291597.432424  9108001.401703 
-291590.556709  9108147.050510 
-291625.623208  9108185.258134 
-291663.671317  9108223.468753 
-291666.689952  9108228.494439 
-291592.573826  9108285.676724 
-291532.208732  9108186.167351 
-291390.265958  9108210.130737 
-291304.913254  9108226.115618 
-291290.049921  9108232.127510 
-291275.134726  9108231.107674 
-291091.494049  9108261.054508 
-291123.747563  9108456.970162 
-291144.113558  9108523.289769 
-291168.284704  9108566.509186 
-291224.548416  9108648.937974 
-291099.545392  9108544.338955 
-290942.458182  9108401.534320 
-290838.475408  9108317.046513 
-290820.738943  9108472.729789 
-290803.172679  9108651.517370 
-290796.630020  9108707.764099 
-290795.249106  9108790.133866 
-290798.132341  9108911.684582 
-290799.400059  9108948.853380 
-290800.889839  9109016.158205 
-290802.996015  9109032.232807 
-290806.066457  9109044.290299 
-290809.181316  9109062.374994 
-290812.251764  9109074.432484 
-290815.322214  9109086.489973 
-290818.370459  9109095.533859 
-290828.472063  9109117.643869 
-290838.544065  9109135.735738 
-290849.617356  9109154.833162 
-290966.069682  9109312.663653 
-290968.072252  9109314.674763 
-290990.159800  9109344.833227 
-291077.627587  9109480.533876 
-291109.750468  9109523.761346 
-291199.073350  9109641.382044 
-291238.205580  9109691.648189 
-291349.572732  9109833.399452 
-291403.762044  9109903.771137 
-291481.997875  9110000.284674 
-291627.448641  9110181.245714 
-291639.479342  9110195.321154 
-291652.518800  9110211.406649 
-291666.522451  9110223.475023 
-291677.522141  9110232.526801 
-291686.125497  9110186.327479 
-291702.485447  9109979.412538 
-291701.350442  9109960.325484 
-291698.709107  9109871.924924 
-291686.448292  9109826.709078 
-291675.989645  9109756.382000 
-291672.451108  9109681.039292 
-291672.347160  9109666.975882 
-291675.127352  9109505.250677 
-291678.834731  9109334.485706 
-291419.856052  9109391.480679 
-291488.351725  9109245.894501 
-291520.786026  9109196.705850 
-291386.888018  9108964.524630 
-291379.812311  9108948.445030 
-291358.251622  9108855.002306 
-291347.801473  9108785.679481 
-291346.763133  9108779.651276 
-291339.168630  9108693.254451 
-291530.709568  9108656.282630 
-291513.858636  9108527.686499 
-291658.056978  9108539.887609 
-291661.402054  9108589.112605 
-291663.590076  9108616.236931 
-291668.700331  9108635.328047 
-291687.124011  9108707.672357 
-291689.378852  9108743.837443 
-291683.208365  9108850.310526 
-291782.179076  9108794.157613 
-292067.222661  9108633.722115 
-292093.367519  9108674.933761 
-292003.187745  9108844.606885 
-292079.531088  9108954.176414 
-292219.086135  9108875.963968 
-292268.578511  9108848.891541 
-292313.160993  9108829.850311 
-292451.344711  9108835.010959 
-292466.230293  9108832.012252 
-292481.108432  9108828.009014 
-292651.255912  9108720.694981 
-Region 1
-30
-291782.179076  9108794.157613 
-291683.208365  9108850.310526 
-291689.378852  9108743.837443 
-291687.124011  9108707.672357 
-291668.700331  9108635.328047 
-291663.590076  9108616.236931 
-291661.402054  9108589.112605 
-291658.056978  9108539.887609 
-291513.858636  9108527.686499 
-291530.709568  9108656.282630 
-291339.168630  9108693.254451 
-291346.763133  9108779.651276 
-291347.801473  9108785.679481 
-291358.251622  9108855.002306 
-291379.812311  9108948.445030 
-291386.888018  9108964.524630 
-291520.786026  9109196.705850 
-291488.351725  9109245.894501 
-291419.856052  9109391.480679 
-291678.834731  9109334.485706 
-291698.741081  9109203.918009 
-291722.141186  9109142.665864 
-291823.100119  9109086.514742 
-291896.341889  9109045.403312 
-291989.371685  9108992.257477 
-292079.531088  9108954.176414 
-292003.187745  9108844.606885 
-292093.367519  9108674.933761 
-292067.222661  9108633.722115 
-291782.179076  9108794.157613 
-Region 1
-59
-293212.241769  9107844.307819 
-293215.178576  9107838.283626 
-293222.008777  9107821.213610 
-293223.921952  9107811.170350 
-293224.781702  9107793.089934 
-293220.687189  9107777.013664 
-293180.758464  9107619.265447 
-293084.595260  9107651.314867 
-293033.087291  9107674.367727 
-292978.649863  9107704.449246 
-292958.907190  9107722.510952 
-292934.165566  9107736.549628 
-292904.015711  9107691.316462 
-292848.100707  9107656.102802 
-292799.737703  9107701.257923 
-292769.077650  9107721.317726 
-292748.288964  9107732.346699 
-292683.015701  9107775.475848 
-292475.735130  9107833.530608 
-292455.367874  9107767.211966 
-292420.020774  9107825.438589 
-292355.770529  9107872.586469 
-292332.096704  9107896.671139 
-292267.253560  9107998.062392 
-292225.928155  9108054.273903 
-292463.087224  9108138.891540 
-292482.126387  9108160.005475 
-292495.306588  9108195.176795 
-292503.324267  9108204.225474 
-292507.344261  9108210.256601 
-292571.701510  9108311.777175 
-292782.828319  9108638.455178 
-292854.985020  9108585.287285 
-293074.657661  9108857.727748 
-293103.755245  9108894.923404 
-293122.780144  9108914.027874 
-293161.756762  9108943.197059 
-293206.674215  9108969.358479 
-293235.630320  9108987.468101 
-293255.604431  9109000.546339 
-293270.631626  9109016.633266 
-293275.645665  9109022.665255 
-293290.687789  9109040.761214 
-293296.345196  9108999.581685 
-293314.169583  9108856.958177 
-293320.559857  9108780.621391 
-293320.972113  9108702.269727 
-293323.491394  9108639.992344 
-293317.493299  9108501.363570 
-293300.764305  9108389.846127 
-293293.382528  9108332.581588 
-293296.080829  9108294.412704 
-293298.637523  9108237.157915 
-293301.509882  9108088.492658 
-293300.255215  9108053.333432 
-293320.097410  9107914.729992 
-293327.869243  9107890.629294 
-293339.616406  9107866.532504 
-293212.241769  9107844.307819 
-Region 1
-29
-291144.113558  9108523.289769 
-291123.747563  9108456.970162 
-291091.494049  9108261.054508 
-291133.659600  9108183.749503 
-291026.234709  9108171.584401 
-290857.190936  9108159.355208 
-290867.390892  9108059.917635 
-290896.673727  9107987.622070 
-290907.978463  9107903.253554 
-290921.159918  9107803.819090 
-290929.594077  9107734.515504 
-290659.512428  9107767.384036 
-290546.465248  9107801.419973 
-290501.753161  9107937.989123 
-290474.372376  9108133.843602 
-290485.604233  9108309.647850 
-290496.972760  9108368.926899 
-290569.443173  9108357.952642 
-290582.769978  9108413.215566 
-290610.842072  9108446.394207 
-290748.236394  9108614.292972 
-290803.172679  9108651.517370 
-290820.738943  9108472.729789 
-290838.475408  9108317.046513 
-290942.458182  9108401.534320 
-291099.545392  9108544.338955 
-291224.548416  9108648.937974 
-291168.284704  9108566.509186 
-291144.113558  9108523.289769 
-Region 1
-28
-291666.689952  9108228.494439 
-291663.671317  9108223.468753 
-291625.623208  9108185.258134 
-291590.556709  9108147.050510 
-291500.406112  9108051.528726 
-291454.348229  9108005.273510 
-291429.390911  9107990.180091 
-291338.454543  9107922.783698 
-291307.126858  9107852.434800 
-291258.644791  9107746.909831 
-291205.193800  9107641.379626 
-291050.620919  9107704.505071 
-290929.594077  9107734.515504 
-290921.159918  9107803.819090 
-290907.978463  9107903.253554 
-290896.673727  9107987.622070 
-290867.390892  9108059.917635 
-290857.190936  9108159.355208 
-291026.234709  9108171.584401 
-291133.659600  9108183.749503 
-291091.494049  9108261.054508 
-291275.134726  9108231.107674 
-291290.049921  9108232.127510 
-291304.913254  9108226.115618 
-291390.265958  9108210.130737 
-291532.208732  9108186.167351 
-291592.573826  9108285.676724 
-291666.689952  9108228.494439 
-Region 1
-28
-292225.928155  9108054.273903 
-292267.253560  9107998.062392 
-292224.198949  9107954.824714 
-292139.054116  9107864.332068 
-292094.746083  9107785.934725 
-292092.728711  9107781.914604 
-292034.966615  9107631.178054 
-292029.886117  9107616.105094 
-291991.393197  9107517.623011 
-291906.234932  9107425.120549 
-291810.397007  9107366.760706 
-291723.933725  9107366.672486 
-291623.860617  9107407.755619 
-291470.431386  9107490.973835 
-291462.510337  9107494.983801 
-291223.031091  9107634.366344 
-291205.193800  9107641.379626 
-291258.644791  9107746.909831 
-291307.126858  9107852.434800 
-291338.454543  9107922.783698 
-291429.390911  9107990.180091 
-291454.348229  9108005.273510 
-291500.406112  9108051.528726 
-291590.556709  9108147.050510 
-291597.432424  9108001.401703 
-291728.620015  9108001.535428 
-291735.740107  9107889.036183 
-292225.928155  9108054.273903 
-Region 1
-58
-291881.700695  9107198.073673 
-291840.783263  9107174.927968 
-291805.895548  9107160.829069 
-291778.016523  9107153.768953 
-291754.135046  9107149.726470 
-291729.267155  9107146.687487 
-291705.415326  9107146.663097 
-291676.594362  9107146.633609 
-291622.942546  9107148.587713 
-291580.222809  9107150.552967 
-291539.490712  9107152.520221 
-291510.684534  9107154.499690 
-291474.921554  9107156.471991 
-291410.359768  9107161.428204 
-291340.813996  9107164.370140 
-291279.196614  9107164.306580 
-291218.536038  9107159.221299 
-291179.710101  9107150.140423 
-291124.931115  9107134.011308 
-291064.181783  9107116.871399 
-290748.450488  9107023.121720 
-290623.948574  9106985.823922 
-290529.335477  9106958.602413 
-290423.760814  9106927.351026 
-290355.039058  9106907.188048 
-290336.112046  9106901.140913 
-290298.265411  9106890.051154 
-290264.379344  9106876.956481 
-290226.495850  9106860.843960 
-290185.586638  9106838.701014 
-290138.692372  9106813.538088 
-290114.421900  9106891.865803 
-290104.205128  9106989.294504 
-290117.552708  9107047.571445 
-290128.809407  9107091.782725 
-290181.115820  9107177.223155 
-290232.568829  9107281.748650 
-290261.788634  9107336.024096 
-290288.976555  9107384.270184 
-290310.186739  9107430.500892 
-290341.497811  9107498.841853 
-290385.773258  9107573.223560 
-290390.794163  9107580.260537 
-290431.013170  9107643.588080 
-290469.525328  9107745.085871 
-290503.456463  9107764.207437 
-290546.465248  9107801.419973 
-290659.512428  9107767.384036 
-290929.594077  9107734.515504 
-291050.620919  9107704.505071 
-291205.193800  9107641.379626 
-291223.031091  9107634.366344 
-291462.510337  9107494.983801 
-291470.431386  9107490.973835 
-291623.860617  9107407.755619 
-291723.933725  9107366.672486 
-291810.397007  9107366.760706 
-291881.700695  9107198.073673 
-Region 1
-27
-291814.312431  9106011.663983 
-291857.706269  9105966.504984 
-291809.165648  9105987.550155 
-291472.385515  9106003.275575 
-291295.079142  9106082.449408 
-291256.365121  9106088.436380 
-291108.458112  9106111.386671 
-290970.215508  9106097.179104 
-290627.651772  9106002.394234 
-290473.301828  9105960.041231 
-290466.514862  9105983.138244 
-290469.533171  9105988.164082 
-290471.660961  9106007.252394 
-290446.692504  9106125.760533 
-290415.893910  9106262.344063 
-290361.942347  9106358.721946 
-290328.639464  9106424.985737 
-290434.212849  9106456.237646 
-290679.312180  9106540.875865 
-290899.500167  9106616.445797 
-291126.674989  9106696.039832 
-291355.845419  9106776.639115 
-291458.467987  9106811.903304 
-291512.032150  9106663.288902 
-291591.752248  9106692.502096 
-291787.178349  9106644.485429 
-291814.312431  9106011.663983 
-Region 1
-255
-293729.164855  9107594.690903 
-293727.147367  9107590.670886 
-293719.084879  9107575.595338 
-293715.020073  9107563.537225 
-293710.925436  9107547.461033 
-293707.876836  9107538.417447 
-293703.841872  9107530.377410 
-293698.813085  9107522.336401 
-293686.849904  9107517.302155 
-293683.801313  9107508.258565 
-293680.678147  9107489.169779 
-293679.632121  9107482.137170 
-293674.603346  9107474.096156 
-293666.540903  9107459.020588 
-293662.498499  9107449.976024 
-293662.468671  9107445.957945 
-293661.377910  9107432.898216 
-293659.323155  9107423.855594 
-293648.241983  9107403.754504 
-293640.194478  9107390.687966 
-293637.168278  9107384.657928 
-293631.078600  9107367.575253 
-293620.961458  9107343.457042 
-293612.899065  9107328.381454 
-293605.845408  9107315.315878 
-293600.786851  9107303.256767 
-293588.615018  9107270.095911 
-293581.539019  9107254.016766 
-293572.400852  9107227.890465 
-293544.156574  9107171.610012 
-293540.084422  9107158.547341 
-293527.972312  9107133.422613 
-293524.879082  9107118.351874 
-293521.852922  9107112.321820 
-293517.825495  9107105.286269 
-293505.795383  9107091.211256 
-293499.772878  9107083.169227 
-293497.740540  9107077.140148 
-293492.622443  9107057.044844 
-293485.472020  9107030.920457 
-293479.375025  9107012.833213 
-293476.311629  9107001.780548 
-293475.302915  9106999.770528 
-293469.258081  9106988.714928 
-293464.214514  9106978.664825 
-293460.202011  9106973.638306 
-293447.185595  9106960.566807 
-293442.179283  9106955.539306 
-293436.186608  9106951.515346 
-293432.151764  9106943.475259 
-293427.108212  9106933.425149 
-293425.023753  9106920.364413 
-293423.955455  9106910.318220 
-293422.916952  9106904.290113 
-293416.909389  9106898.257106 
-293410.901828  9106892.224097 
-293407.868256  9106885.189507 
-293401.823459  9106874.133890 
-293394.762511  9106860.063725 
-293392.730203  9106854.034635 
-293390.615973  9106836.955808 
-293386.596047  9106830.924755 
-293381.597205  9106826.901764 
-293364.337539  9106777.663520 
-293353.159910  9106744.503502 
-293338.904086  9106698.281745 
-293326.881603  9106685.211166 
-293314.881461  9106675.154148 
-293300.856488  9106660.072548 
-293284.762027  9106633.939230 
-293263.750658  9106614.832633 
-293219.814785  9106586.662650 
-293193.700488  9106549.469670 
-293150.728760  9106517.282490 
-293138.877502  9106527.315865 
-293124.897271  9106518.261324 
-293089.928119  9106493.113637 
-293076.956589  9106486.069112 
-293067.915650  9106473.001400 
-293060.892077  9106463.953760 
-293043.975093  9106460.923356 
-293036.017222  9106459.910908 
-293028.956471  9106445.840643 
-292991.791602  9106392.564208 
-292922.840032  9106341.264974 
-292885.846348  9106311.092459 
-292820.989118  9106275.869390 
-292762.094778  9106240.652191 
-292759.083656  9106236.631097 
-292752.097331  9106232.606011 
-292750.102300  9106231.599490 
-292747.113469  9106230.591970 
-292744.117207  9106228.579925 
-292740.127146  9106226.566882 
-292735.135855  9106223.548314 
-292733.133395  9106221.537266 
-292731.138365  9106220.530744 
-292728.142105  9106218.518697 
-292725.145845  9106216.506651 
-292723.143386  9106214.495602 
-292718.152097  9106211.477032 
-292713.145951  9106206.449410 
-292710.157121  9106205.441888 
-292708.154663  9106203.430839 
-292705.158405  9106201.418790 
-292702.169576  9106200.411267 
-292700.174547  9106199.404743 
-292696.184490  9106197.391694 
-292694.189461  9106196.385170 
-292691.208061  9106196.382171 
-292689.213032  9106195.375646 
-292683.227947  9106192.356071 
-292680.246546  9106192.353072 
-292677.257718  9106191.345547 
-292674.276318  9106191.342547 
-292671.287490  9106190.335021 
-292666.311061  9106189.325495 
-292663.322233  9106188.317969 
-292661.334633  9106188.315969 
-292659.347033  9106188.313968 
-292619.491051  9106174.210575 
-292573.664861  9106159.096601 
-292522.765754  9106129.914185 
-292499.871245  9106124.868462 
-292480.877705  9106109.781479 
-292458.005474  9106107.749312 
-292454.045122  9106109.754345 
-292450.069924  9106109.750324 
-292444.107127  9106109.744291 
-292431.002184  9106084.618044 
-292411.007460  9106068.525488 
-292394.023830  9106056.454050 
-292373.176319  9106059.446483 
-292366.204887  9106057.430377 
-292344.200338  9106038.322185 
-292332.200563  9106028.264812 
-292309.365457  9106031.255197 
-292290.498122  9106033.245080 
-292271.519514  9106020.167038 
-292251.613874  9106016.128727 
-292246.630047  9106014.114619 
-292244.612781  9106010.094487 
-292239.614120  9106006.071322 
-292230.669936  9106006.062226 
-292223.720764  9106007.059679 
-292213.827280  9106013.076738 
-292204.935007  9106020.099335 
-292195.011852  9106022.098278 
-292185.029367  9106016.060993 
-292179.022079  9106010.027752 
-292175.009806  9106005.001063 
-292170.982702  9105997.965316 
-292165.969217  9105991.933085 
-292161.956947  9105986.906393 
-292161.934701  9105983.892808 
-292155.971912  9105983.886733 
-292151.025166  9105986.895256 
-292148.058601  9105988.901275 
-292142.140300  9105994.922371 
-292130.214717  9105994.910216 
-292123.191396  9105985.862366 
-292110.309087  9105990.871837 
-292067.627634  9105997.859940 
-291992.855527  9105965.638860 
-291977.955957  9105966.628144 
-291905.527186  9105982.626357 
-291879.636535  9105975.568171 
-291877.648936  9105975.566133 
-291857.706269  9105966.504984 
-291814.312431  9106011.663983 
-291787.178349  9106644.485429 
-291591.752248  9106692.502096 
-291512.032150  9106663.288902 
-291458.467987  9106811.903304 
-291355.845419  9106776.639115 
-291126.674989  9106696.039832 
-290899.500167  9106616.445797 
-290679.312180  9106540.875865 
-290434.212849  9106456.237646 
-290328.639464  9106424.985737 
-290307.100042  9106469.162297 
-290265.199323  9106582.629922 
-290252.508304  9106613.756944 
-290198.467600  9106698.080332 
-290145.501665  9106793.454681 
-290138.692372  9106813.538088 
-290185.586638  9106838.701014 
-290226.495850  9106860.843960 
-290264.379344  9106876.956481 
-290298.265411  9106890.051154 
-290336.112046  9106901.140913 
-290355.039058  9106907.188048 
-290423.760814  9106927.351026 
-290529.335477  9106958.602413 
-290623.948574  9106985.823922 
-290748.450488  9107023.121720 
-291064.181783  9107116.871399 
-291124.931115  9107134.011308 
-291179.710101  9107150.140423 
-291218.536038  9107159.221299 
-291279.196614  9107164.306580 
-291340.813996  9107164.370140 
-291410.359768  9107161.428204 
-291474.921554  9107156.471991 
-291510.684534  9107154.499690 
-291539.490712  9107152.520221 
-291580.222809  9107150.552967 
-291622.942546  9107148.587713 
-291676.594362  9107146.633609 
-291705.415326  9107146.663097 
-291729.267155  9107146.687487 
-291754.135046  9107149.726470 
-291778.016523  9107153.768953 
-291805.895548  9107160.829069 
-291840.783263  9107174.927968 
-291881.700695  9107198.073673 
-291810.397007  9107366.760706 
-291906.234932  9107425.120549 
-291991.393197  9107517.623011 
-292029.886117  9107616.105094 
-292034.966615  9107631.178054 
-292092.728711  9107781.914604 
-292094.746083  9107785.934725 
-292139.054116  9107864.332068 
-292224.198949  9107954.824714 
-292267.253560  9107998.062392 
-292332.096704  9107896.671139 
-292355.770529  9107872.586469 
-292420.020774  9107825.438589 
-292455.367874  9107767.211966 
-292475.735130  9107833.530608 
-292683.015701  9107775.475848 
-292748.288964  9107732.346699 
-292769.077650  9107721.317726 
-292799.737703  9107701.257923 
-292848.100707  9107656.102802 
-292904.015711  9107691.316462 
-292934.165566  9107736.549628 
-292958.907190  9107722.510952 
-292978.649863  9107704.449246 
-293033.087291  9107674.367727 
-293084.595260  9107651.314867 
-293180.758464  9107619.265447 
-293220.687189  9107777.013664 
-293224.781702  9107793.089934 
-293223.921952  9107811.170350 
-293222.008777  9107821.213610 
-293215.178576  9107838.283626 
-293212.241769  9107844.307819 
-293339.616406  9107866.532504 
-293364.208865  9107832.403195 
-293462.936145  9107744.102902 
-293521.281374  9107704.984071 
-293672.755437  9107626.780234 
-293729.164855  9107594.690903 
-Region 1
-60
-290849.617356  9109154.833162 
-290838.544065  9109135.735738 
-290828.472063  9109117.643869 
-290818.370459  9109095.533859 
-290815.322214  9109086.489973 
-290812.251764  9109074.432484 
-290809.181316  9109062.374994 
-290806.066457  9109044.290299 
-290802.996015  9109032.232807 
-290800.889839  9109016.158205 
-290799.400059  9108948.853380 
-290798.132341  9108911.684582 
-290795.249106  9108790.133866 
-290796.630020  9108707.764099 
-290803.172679  9108651.517370 
-290748.236394  9108614.292972 
-290610.842072  9108446.394207 
-290582.769978  9108413.215566 
-290569.443173  9108357.952642 
-290496.972760  9108368.926899 
-290508.348727  9108429.210473 
-290525.255919  9108565.843950 
-290517.689452  9108618.071540 
-290469.958492  9108749.615035 
-290404.976700  9108832.923171 
-290316.030885  9108901.138305 
-290290.345391  9108922.206584 
-290242.942436  9108963.342735 
-290215.387340  9109000.481507 
-290200.634371  9109021.561194 
-290195.783209  9109037.628594 
-290179.315837  9109095.874089 
-290155.979949  9109166.166757 
-290144.637075  9109245.512751 
-290140.809321  9109265.599345 
-290132.196870  9109310.794181 
-290125.527848  9109349.963873 
-290218.040259  9109361.110413 
-290298.648256  9109375.257931 
-290376.222861  9109382.370435 
-290462.779382  9109394.514773 
-290523.435789  9109398.595850 
-290582.141420  9109407.697461 
-290613.982642  9109412.753075 
-290632.866399  9109412.772621 
-290660.732095  9109417.824086 
-290682.604896  9109418.851230 
-290699.493484  9109417.864158 
-290710.389171  9109412.852781 
-290735.191792  9109406.851239 
-290776.853361  9109395.844448 
-290807.611834  9109388.844489 
-290841.329719  9109378.833981 
-290865.116192  9109369.817749 
-290900.806987  9109357.800184 
-290928.546727  9109345.774416 
-290944.367313  9109334.740904 
-290968.072252  9109314.674763 
-290966.069682  9109312.663653 
-290849.617356  9109154.833162 
-Region 1
-158
-291199.073350  9109641.382044 
-291109.750468  9109523.761346 
-291077.627587  9109480.533876 
-290990.159800  9109344.833227 
-290968.072252  9109314.674763 
-290944.367313  9109334.740904 
-290928.546727  9109345.774416 
-290900.806987  9109357.800184 
-290865.116192  9109369.817749 
-290841.329719  9109378.833981 
-290807.611834  9109388.844489 
-290776.853361  9109395.844448 
-290735.191792  9109406.851239 
-290710.389171  9109412.852781 
-290699.493484  9109417.864158 
-290682.604896  9109418.851230 
-290660.732095  9109417.824086 
-290632.866399  9109412.772621 
-290613.982642  9109412.753075 
-290582.141420  9109407.697461 
-290523.435789  9109398.595850 
-290462.779382  9109394.514773 
-290376.222861  9109382.370435 
-290298.648256  9109375.257931 
-290218.040259  9109361.110413 
-290125.527848  9109349.963873 
-290122.634862  9109362.015206 
-290112.086350  9109414.239730 
-290101.656048  9109482.536861 
-290097.916947  9109514.677912 
-290101.327182  9109572.944223 
-290101.681879  9109621.162035 
-290101.792724  9109636.230102 
-290118.130983  9109695.514445 
-290126.392520  9109737.713330 
-290137.606194  9109775.897172 
-290152.751117  9109808.057930 
-290164.951345  9109845.238254 
-290178.101139  9109876.392382 
-290193.320071  9109918.598482 
-290199.534825  9109952.758956 
-290201.833159  9109994.951582 
-290201.149812  9110037.141102 
-290200.569997  9110093.394140 
-290199.871881  9110133.574585 
-290190.302611  9110183.791091 
-290183.485801  9110202.870054 
-290177.655495  9110220.945514 
-290163.101899  9110269.147777 
-290141.576164  9110315.333725 
-290126.867240  9110342.440709 
-290113.144813  9110368.544189 
-290098.398891  9110390.628483 
-290084.646863  9110412.713811 
-290079.736478  9110420.744934 
-290057.105805  9110451.861776 
-290040.408983  9110478.966680 
-290032.783009  9110523.158050 
-290023.021346  9110547.256594 
-290031.157460  9110572.378324 
-290079.910834  9110579.460815 
-290099.840808  9110586.513266 
-290117.768174  9110591.554565 
-290151.716452  9110612.684979 
-290171.602065  9110613.710171 
-290179.656908  9110627.781946 
-290181.844453  9110654.906505 
-290183.023297  9110680.020958 
-290179.180801  9110698.098493 
-290171.510598  9110736.262637 
-290161.756395  9110761.365739 
-290139.118278  9110791.478108 
-290109.604086  9110832.633151 
-290080.045468  9110867.760964 
-290046.592486  9110913.934544 
-290020.022923  9110950.069978 
-290042.979204  9110963.152743 
-290101.834944  9110992.345260 
-290173.663497  9111028.582836 
-290238.512500  9111061.799460 
-290258.472318  9111072.869929 
-290294.401492  9111092.997652 
-290369.234282  9111132.251529 
-290389.186749  9111142.317389 
-290392.183322  9111144.329535 
-290412.128393  9111153.390848 
-290475.998583  9111188.615092 
-290525.879865  9111213.779575 
-290552.804664  9111225.861566 
-290566.756620  9111230.898530 
-290603.516921  9111228.927210 
-290634.261809  9111219.918007 
-290686.709895  9111188.831445 
-290735.211870  9111161.758904 
-290794.594993  9111127.665770 
-290786.517617  9111110.580573 
-290772.424851  9111086.457539 
-290752.294474  9111052.283056 
-290749.283074  9111048.261869 
-290732.171544  9111019.113091 
-290707.012370  9110976.897210 
-290685.880780  9110941.717120 
-290663.747903  9110905.531458 
-290639.590196  9110864.321063 
-290633.530404  9110851.255991 
-290644.381959  9110840.217346 
-290660.128986  9110819.138460 
-290681.795018  9110792.038491 
-290699.470561  9110762.925368 
-290718.169633  9110737.831399 
-290721.114317  9110732.811789 
-290744.619897  9110685.623171 
-290766.182082  9110644.459714 
-290790.622210  9110589.235843 
-290801.362513  9110563.129179 
-290802.326777  9110559.112064 
-290816.983407  9110524.973207 
-290826.663086  9110489.824723 
-290837.351482  9110456.686326 
-290849.011538  9110420.535348 
-290857.808447  9110400.453849 
-290870.751412  9110403.480687 
-290902.600760  9110409.540457 
-290947.444972  9110425.658746 
-291004.312424  9110454.848089 
-291022.247164  9110460.893550 
-291201.104941  9110320.442422 
-291195.082205  9110312.400101 
-291171.013534  9110283.244399 
-291143.963202  9110254.085638 
-291112.863162  9110214.877477 
-291088.757528  9110180.699044 
-291077.683793  9110161.601770 
-291075.673758  9110158.586144 
-291066.602655  9110141.499959 
-291055.514114  9110120.393610 
-291039.426458  9110095.264045 
-291023.331410  9110069.129938 
-291006.272138  9110047.012934 
-290980.245607  9110021.873163 
-290956.251355  9110002.762604 
-290905.333098  9109971.570107 
-290905.296051  9109966.547440 
-290908.114721  9109944.450768 
-290914.894139  9109920.349108 
-290917.786901  9109908.297768 
-290928.490009  9109877.168455 
-290942.130319  9109840.015002 
-290951.891383  9109815.916402 
-290960.880844  9109821.952775 
-290990.875373  9109846.092130 
-290996.816478  9109843.084642 
-291039.353606  9109816.006028 
-291127.416766  9109762.856296 
-291184.773043  9109723.738435 
-291200.586241  9109711.700287 
-291238.205580  9109691.648189 
-291199.073350  9109641.382044 
-Region 1
-108
-290392.183322  9111144.329535 
-290389.186749  9111142.317389 
-290369.234282  9111132.251529 
-290294.401492  9111092.997652 
-290258.472318  9111072.869929 
-290238.512500  9111061.799460 
-290173.663497  9111028.582836 
-290101.834944  9110992.345260 
-290042.979204  9110963.152743 
-290020.022923  9110950.069978 
-290046.592486  9110913.934544 
-290080.045468  9110867.760964 
-290109.604086  9110832.633151 
-290139.118278  9110791.478108 
-290161.756395  9110761.365739 
-290171.510598  9110736.262637 
-290179.180801  9110698.098493 
-290183.023297  9110680.020958 
-290181.844453  9110654.906505 
-290179.656908  9110627.781946 
-290171.602065  9110613.710171 
-290151.716452  9110612.684979 
-290117.768174  9110591.554565 
-290099.840808  9110586.513266 
-290079.910834  9110579.460815 
-290031.157460  9110572.378324 
-290032.188337  9110577.402048 
-290030.422321  9110607.536107 
-290034.664142  9110643.703604 
-290035.887268  9110674.845305 
-290040.047775  9110699.962885 
-290042.213068  9110724.073856 
-290041.492754  9110761.240710 
-290038.621930  9110776.305669 
-290036.752415  9110792.376201 
-290024.112509  9110830.535178 
-290006.436451  9110859.648144 
-290003.499066  9110865.672265 
-289992.743439  9110889.769786 
-289983.018692  9110918.891030 
-289967.278664  9110940.974298 
-289950.566883  9110966.070142 
-289926.934610  9110996.181424 
-289909.214082  9111019.267150 
-289885.530008  9111042.346655 
-289853.887138  9111064.413317 
-289835.106098  9111078.457146 
-289808.395834  9111095.506281 
-289774.654174  9111102.502747 
-289738.917260  9111108.492573 
-289690.214981  9111108.441612 
-289645.451448  9111103.372067 
-289611.576761  9111092.286704 
-289585.660865  9111082.214197 
-289565.671593  9111067.125234 
-289560.672430  9111063.101856 
-289526.738702  9111043.980096 
-289491.781540  9111020.839097 
-289469.774941  9111001.729824 
-289462.773181  9110995.695259 
-289416.642004  9111075.004786 
-289431.720685  9111098.124920 
-289450.686484  9111109.194742 
-289501.590833  9111138.379719 
-289522.551898  9111150.456131 
-289544.477356  9111158.515415 
-289569.443689  9111174.614133 
-289593.349628  9111181.670934 
-289610.275925  9111185.706809 
-289628.203537  9111190.748258 
-289647.132466  9111196.795279 
-289661.106544  9111204.846166 
-289687.096418  9111224.964002 
-289707.078411  9111239.048345 
-289733.068322  9111259.166144 
-289754.059052  9111275.260576 
-289764.064850  9111284.311807 
-289784.069065  9111301.409721 
-289822.119255  9111339.621590 
-289836.152549  9111355.708712 
-289849.191925  9111371.794792 
-289860.236057  9111386.874256 
-289871.258014  9111398.940102 
-289878.326441  9111414.015418 
-289886.507125  9111445.164376 
-289884.696746  9111469.271220 
-289947.410551  9111482.395334 
-289961.103680  9111452.273665 
-289972.882904  9111432.195306 
-289997.435254  9111392.039618 
-290022.068939  9111362.933836 
-290041.740355  9111334.827428 
-290067.375309  9111306.727204 
-290095.940217  9111271.598306 
-290105.931267  9111278.640372 
-290125.898575  9111290.715420 
-290151.859049  9111306.814780 
-290190.799791  9111330.963784 
-290231.721021  9111354.110263 
-290273.643617  9111378.262258 
-290286.646108  9111389.325493 
-290296.407689  9111365.226891 
-290313.052706  9111331.090111 
-290325.707194  9111294.940157 
-290341.373057  9111262.811423 
-290358.982323  9111224.657525 
-290376.524924  9111177.462806 
-290392.183322  9111144.329535 
-Region 1
-58
-291374.594993  9110798.771553 
-291342.552358  9110766.594402 
-291298.471542  9110719.337172 
-291254.390821  9110672.079876 
-291241.336463  9110653.985205 
-291227.273370  9110633.880456 
-291200.163389  9110596.685539 
-291175.019009  9110556.479022 
-291153.961564  9110531.344501 
-291136.998438  9110522.286519 
-291080.160510  9110497.115513 
-291018.293797  9110463.903088 
-291022.247164  9110460.893550 
-291004.312424  9110454.848089 
-290947.444972  9110425.658746 
-290902.600760  9110409.540457 
-290870.751412  9110403.480687 
-290857.808447  9110400.453849 
-290849.011538  9110420.535348 
-290837.351482  9110456.686326 
-290826.663086  9110489.824723 
-290816.983407  9110524.973207 
-290802.326777  9110559.112064 
-290801.362513  9110563.129179 
-290790.622210  9110589.235843 
-290766.182082  9110644.459714 
-290744.619897  9110685.623171 
-290721.114317  9110732.811789 
-290718.169633  9110737.831399 
-290699.470561  9110762.925368 
-290681.795018  9110792.038491 
-290660.128986  9110819.138460 
-290644.381959  9110840.217346 
-290633.530404  9110851.255991 
-290639.590196  9110864.321063 
-290663.747903  9110905.531458 
-290685.880780  9110941.717120 
-290707.012370  9110976.897210 
-290732.171544  9111019.113091 
-290749.283074  9111048.261869 
-290752.294474  9111052.283056 
-290772.424851  9111086.457539 
-290786.517617  9111110.580573 
-290794.594993  9111127.665770 
-290833.261438  9111114.646453 
-290899.646317  9111086.587517 
-290948.199930  9111066.546530 
-291008.650811  9111042.499515 
-291038.401518  9111033.489073 
-291086.005584  9111019.474144 
-291206.966290  9110979.415992 
-291172.364373  9110869.887792 
-291223.921582  9110852.863210 
-291274.469985  9110833.828509 
-291326.093901  9110825.844604 
-291383.658965  9110814.853083 
-291389.637268  9110816.868172 
-291374.594993  9110798.771553 
-Region 1
-85
-292137.748352  9110642.831886 
-292257.109763  9110521.403789 
-292058.632262  9110427.785930 
-291996.794999  9110398.593100 
-291985.817523  9110392.555007 
-291772.380487  9110291.889008 
-291733.469974  9110271.759459 
-291721.483798  9110263.711229 
-291703.519400  9110253.647934 
-291688.521836  9110241.578574 
-291677.522141  9110232.526801 
-291666.522451  9110223.475023 
-291652.518800  9110211.406649 
-291639.479342  9110195.321154 
-291627.448641  9110181.245714 
-291481.997875  9110000.284674 
-291403.762044  9109903.771137 
-291349.572732  9109833.399452 
-291238.205580  9109691.648189 
-291200.586241  9109711.700287 
-291184.773043  9109723.738435 
-291127.416766  9109762.856296 
-291039.353606  9109816.006028 
-290996.816478  9109843.084642 
-290990.875373  9109846.092130 
-290960.880844  9109821.952775 
-290951.891383  9109815.916402 
-290942.130319  9109840.015002 
-290928.490009  9109877.168455 
-290917.786901  9109908.297768 
-290914.894139  9109920.349108 
-290908.114721  9109944.450768 
-290905.296051  9109966.547440 
-290905.333098  9109971.570107 
-290956.251355  9110002.762604 
-290980.245607  9110021.873163 
-291006.272138  9110047.012934 
-291023.331410  9110069.129938 
-291039.426458  9110095.264045 
-291055.514114  9110120.393610 
-291066.602655  9110141.499959 
-291075.673758  9110158.586144 
-291077.683793  9110161.601770 
-291088.757528  9110180.699044 
-291112.863162  9110214.877477 
-291143.963202  9110254.085638 
-291171.013534  9110283.244399 
-291195.082205  9110312.400101 
-291201.104941  9110320.442422 
-291022.247164  9110460.893550 
-291018.293797  9110463.903088 
-291080.160510  9110497.115513 
-291136.998438  9110522.286519 
-291153.961564  9110531.344501 
-291175.019009  9110556.479022 
-291200.163389  9110596.685539 
-291227.273370  9110633.880456 
-291241.336463  9110653.985205 
-291254.390821  9110672.079876 
-291298.471542  9110719.337172 
-291342.552358  9110766.594402 
-291374.594993  9110798.771553 
-291389.637268  9110816.868172 
-291404.560751  9110818.892300 
-291414.678053  9110843.011065 
-291421.724528  9110855.072453 
-291427.918194  9110886.218907 
-291445.208281  9110939.476048 
-291449.280477  9110952.538948 
-291460.235786  9110955.563565 
-291505.829432  9110938.532649 
-291577.205265  9110913.491469 
-291637.759457  9110903.507141 
-291684.413743  9110895.517829 
-291699.307514  9110893.523736 
-291757.881231  9110884.541793 
-291814.415050  9110868.526094 
-291884.781715  9110841.474441 
-291942.197748  9110810.391689 
-291988.688175  9110780.302501 
-292000.540651  9110770.269129 
-292035.126461  9110743.181591 
-292055.879413  9110727.129966 
-292098.319654  9110686.991474 
-292137.748352  9110642.831886 
-Region 1
-34
-291134.422110  9111787.984064 
-291141.253409  9111770.914071 
-291029.635629  9111596.013827 
-290979.353052  9111516.605334 
-290939.069268  9111445.243115 
-290883.498525  9111322.634468 
-290819.858155  9111183.945024 
-290794.594993  9111127.665770 
-290735.211870  9111161.758904 
-290686.709895  9111188.831445 
-290634.261809  9111219.918007 
-290643.481300  9111257.094940 
-290651.566079  9111275.184702 
-290657.714898  9111300.304162 
-290660.867133  9111323.411497 
-290642.034457  9111330.423887 
-290608.292909  9111337.420986 
-290579.498738  9111341.409558 
-290751.728623  9111648.970833 
-290805.089282  9111741.441601 
-290753.775603  9111791.615568 
-290777.867348  9111823.784948 
-290820.035410  9111881.085843 
-290857.211648  9111935.368022 
-290883.298849  9111968.543862 
-290919.325465  9112001.729767 
-290946.302786  9112020.843109 
-290992.231755  9112049.016355 
-291042.077134  9112069.157312 
-291076.968919  9112083.255943 
-291108.797221  9112086.301686 
-291112.810103  9112091.328359 
-291121.599602  9112070.242243 
-291134.422110  9111787.984064 
-Region 1
-125
-291108.797221  9112086.301686 
-291076.968919  9112083.255943 
-291042.077134  9112069.157312 
-290992.231755  9112049.016355 
-290946.302786  9112020.843109 
-290919.325465  9112001.729767 
-290883.298849  9111968.543862 
-290857.211648  9111935.368022 
-290820.035410  9111881.085843 
-290777.867348  9111823.784948 
-290753.775603  9111791.615568 
-290805.089282  9111741.441601 
-290751.728623  9111648.970833 
-290579.498738  9111341.409558 
-290608.292909  9111337.420986 
-290642.034457  9111330.423887 
-290660.867133  9111323.411497 
-290657.714898  9111300.304162 
-290651.566079  9111275.184702 
-290643.481300  9111257.094940 
-290634.261809  9111219.918007 
-290603.516921  9111228.927210 
-290566.756620  9111230.898530 
-290552.804664  9111225.861566 
-290525.879865  9111213.779575 
-290475.998583  9111188.615092 
-290412.128393  9111153.390848 
-290392.183322  9111144.329535 
-290376.524924  9111177.462806 
-290358.982323  9111224.657525 
-290341.373057  9111262.811423 
-290325.707194  9111294.940157 
-290313.052706  9111331.090111 
-290296.407689  9111365.226891 
-290286.646108  9111389.325493 
-290273.643617  9111378.262258 
-290231.721021  9111354.110263 
-290190.799791  9111330.963784 
-290151.859049  9111306.814780 
-290125.898575  9111290.715420 
-290105.931267  9111278.640372 
-290095.940217  9111271.598306 
-290067.375309  9111306.727204 
-290041.740355  9111334.827428 
-290022.068939  9111362.933836 
-289997.435254  9111392.039618 
-289972.882904  9111432.195306 
-289961.103680  9111452.273665 
-289947.410551  9111482.395334 
-289884.696746  9111469.271220 
-289874.949705  9111495.378865 
-289861.093819  9111503.400685 
-289830.392838  9111518.436671 
-289812.568598  9111527.458877 
-289798.742262  9111539.498837 
-289784.901132  9111549.529717 
-289779.983218  9111556.556305 
-289761.342449  9111589.686388 
-289740.765536  9111629.846166 
-289704.012099  9111632.821408 
-289661.346772  9111642.822165 
-289604.747896  9111785.406498 
-289639.676216  9111804.529093 
-289673.662368  9111830.682388 
-289707.596804  9111849.803878 
-289745.507026  9111868.929476 
-289776.459689  9111888.047793 
-289772.587457  9111902.107193 
-289756.765739  9111913.140559 
-289750.846458  9111919.161581 
-289751.892163  9111926.194385 
-289759.086397  9111958.346861 
-289771.479628  9112021.645194 
-289781.855438  9112080.923294 
-289791.222555  9112138.191274 
-289796.369815  9112162.305355 
-289803.608542  9112200.485033 
-289816.046370  9112269.810545 
-289819.116996  9112281.868097 
-289827.275749  9112310.003412 
-289840.818624  9112394.397997 
-289852.716445  9112390.392211 
-289873.530226  9112382.377543 
-289893.342645  9112373.357299 
-289911.167154  9112364.334990 
-289931.951302  9112352.302151 
-289954.701133  9112337.257749 
-289968.564617  9112330.240384 
-289975.514862  9112329.243043 
-289986.455708  9112330.258887 
-289992.419405  9112330.265053 
-290011.289639  9112328.275499 
-290022.223081  9112328.286797 
-290054.029455  9112328.319648 
-290076.860666  9112324.325100 
-290107.643460  9112320.338743 
-290122.515663  9112315.331435 
-290146.325990  9112309.328807 
-290175.113455  9112304.335823 
-290195.978953  9112303.352780 
-290224.788623  9112301.373374 
-290247.627193  9112298.383282 
-290298.333323  9112300.444454 
-290349.039445  9112302.505569 
-290385.852534  9112307.565965 
-290437.567415  9112311.637066 
-290481.308479  9112312.686367 
-290538.964783  9112313.749847 
-290582.720659  9112316.808117 
-290654.284763  9112316.881119 
-290696.045314  9112318.932717 
-290717.837931  9112308.909649 
-290746.521380  9112289.852854 
-290785.159083  9112272.815217 
-290789.120019  9112270.810194 
-290815.874882  9112259.787607 
-290829.752990  9112254.779080 
-290867.389253  9112236.735846 
-290902.036231  9112217.685030 
-290949.574726  9112194.629163 
-290993.152247  9112173.578295 
-291057.520787  9112141.498661 
-291114.004543  9112118.451704 
-291112.810103  9112091.328359 
-291108.797221  9112086.301686 
-Region 1
-55
-293560.092616  9113324.260277 
-293546.265389  9113202.701369 
-293528.522402  9113089.174792 
-293520.144199  9113031.909706 
-293510.974155  9113001.765648 
-293407.813245  9113029.793573 
-293396.849900  9113025.765059 
-293170.259350  9112895.965968 
-292877.785820  9112727.930179 
-292846.054315  9112737.944594 
-292830.285633  9112756.010576 
-292820.413400  9112765.041640 
-292786.125627  9112832.310879 
-292780.266489  9112846.368403 
-292797.223315  9112854.420957 
-292808.194063  9112859.454161 
-292824.156950  9112867.505739 
-292835.172513  9112878.566064 
-292843.206241  9112889.623499 
-292850.268433  9112903.693534 
-292854.333850  9112915.751639 
-292861.433398  9112934.844277 
-292861.530499  9112947.903056 
-292860.656061  9112963.974437 
-292859.841381  9112988.081989 
-292858.877310  9112992.099113 
-292856.941698  9112999.128841 
-292854.183938  9113029.261599 
-292842.458215  9113056.372143 
-292836.681248  9113081.479412 
-292835.724645  9113086.501058 
-292836.860520  9113105.587927 
-292838.908181  9113113.626021 
-292839.005289  9113126.684800 
-292833.101334  9113134.715205 
-292831.143308  9113138.731369 
-292843.123027  9113145.774550 
-292849.168915  9113156.830050 
-292853.271723  9113173.910755 
-292857.374535  9113190.991459 
-292856.417934  9113196.013105 
-292868.509738  9113218.124094 
-292871.596196  9113232.190271 
-292876.610795  9113238.222196 
-292879.622543  9113242.243159 
-292910.577100  9113261.358793 
-292903.791275  9113284.456065 
-292892.132804  9113320.607316 
-292888.358726  9113347.725550 
-292880.623763  9113376.848991 
-292871.820114  9113395.926263 
-292866.080528  9113426.056144 
-292860.363355  9113459.199589 
-293127.267117  9113396.171978 
-293560.092616  9113324.260277 
-Region 1
-73
-292879.622543  9113242.243159 
-292876.610795  9113238.222196 
-292871.596196  9113232.190271 
-292868.509738  9113218.124094 
-292856.417934  9113196.013105 
-292857.374535  9113190.991459 
-292853.271723  9113173.910755 
-292849.168915  9113156.830050 
-292843.123027  9113145.774550 
-292831.143308  9113138.731369 
-292833.101334  9113134.715205 
-292839.005289  9113126.684800 
-292838.908181  9113113.626021 
-292836.860520  9113105.587927 
-292835.724645  9113086.501058 
-292836.681248  9113081.479412 
-292842.458215  9113056.372143 
-292854.183938  9113029.261599 
-292856.941698  9112999.128841 
-292858.877310  9112992.099113 
-292859.841381  9112988.081989 
-292860.656061  9112963.974437 
-292861.530499  9112947.903056 
-292861.433398  9112934.844277 
-292854.333850  9112915.751639 
-292850.268433  9112903.693534 
-292843.206241  9112889.623499 
-292835.172513  9112878.566064 
-292824.156950  9112867.505739 
-292808.194063  9112859.454161 
-292797.223315  9112854.420957 
-292780.266489  9112846.368403 
-292786.125627  9112832.310879 
-292820.413400  9112765.041640 
-292830.285633  9112756.010576 
-292846.054315  9112737.944594 
-292771.687725  9112761.980849 
-292706.236678  9112782.007602 
-292673.503661  9112791.016426 
-292580.438409  9112840.147119 
-292487.380383  9112890.282191 
-292455.700842  9112907.328043 
-292352.740279  9112962.475818 
-292237.911640  9113025.647917 
-292192.338896  9113045.693556 
-292170.509186  9113050.694713 
-292197.614333  9113086.883954 
-292203.630249  9113093.921479 
-292315.711991  9113330.092764 
-292346.023145  9113396.420478 
-292219.042250  9113429.445396 
-292250.168331  9113471.665575 
-292382.520530  9113626.490354 
-292397.579270  9113646.595349 
-292505.001183  9113790.345583 
-292600.317573  9113776.374802 
-292608.418682  9113796.472952 
-292657.990095  9113779.444181 
-292682.569927  9113876.905881 
-292734.749473  9113943.254230 
-292753.717111  9113954.322185 
-292776.615802  9113959.366835 
-292787.302863  9113926.228170 
-292855.595306  9113486.316866 
-292860.363355  9113459.199589 
-292866.080528  9113426.056144 
-292871.820114  9113395.926263 
-292880.623763  9113376.848991 
-292888.358726  9113347.725550 
-292892.132804  9113320.607316 
-292903.791275  9113284.456065 
-292910.577100  9113261.358793 
-292879.622543  9113242.243159 
-Region 1
-76
-292877.785820  9112727.930179 
-292873.795111  9112725.917287 
-292765.007326  9112665.540948 
-292597.435455  9112586.021213 
-292469.733554  9112521.607480 
-292402.893439  9112488.393001 
-292387.932138  9112481.346723 
-292296.169081  9112438.062446 
-292232.355703  9112410.877735 
-292215.391662  9112401.820380 
-292164.484669  9112372.639218 
-292160.494012  9112370.626249 
-292098.549467  9112327.370855 
-292036.597584  9112283.110822 
-291957.674426  9112228.788670 
-291895.782343  9112192.564594 
-291840.010253  9112177.441409 
-291790.239010  9112167.346718 
-291776.309017  9112165.323816 
-291724.564792  9112157.236123 
-291707.652990  9112155.210227 
-291671.834074  9112150.151903 
-291365.552680  9112129.754854 
-291261.137168  9112122.618184 
-291195.507519  9112118.533962 
-291148.762696  9112114.468708 
-291114.004543  9112118.451704 
-291057.520787  9112141.498661 
-290993.152247  9112173.578295 
-290949.574726  9112194.629163 
-290902.036231  9112217.685030 
-290867.389253  9112236.735846 
-290829.752990  9112254.779080 
-290815.874882  9112259.787607 
-290789.120019  9112270.810194 
-290785.159083  9112272.815217 
-290746.521380  9112289.852854 
-290717.837931  9112308.909649 
-290696.045314  9112318.932717 
-290678.369404  9112348.045961 
-290666.634903  9112374.151679 
-290641.244729  9112435.401890 
-290618.695427  9112477.569002 
-290631.676109  9112485.618438 
-290725.686079  9112564.067115 
-290835.398545  9112480.802931 
-290874.051186  9112465.774254 
-290901.763761  9112584.336234 
-291009.288596  9112608.553542 
-291257.175953  9112662.042913 
-291266.136369  9112664.060955 
-291281.298338  9112698.229939 
-291353.281502  9112889.161308 
-291437.529629  9112857.100860 
-291587.184999  9112798.987937 
-291737.826390  9112739.871067 
-291764.588581  9112729.852438 
-291855.801047  9112698.802781 
-291989.596633  9112646.700164 
-292055.715545  9112850.682689 
-292065.684851  9112854.710587 
-292068.711409  9112860.740679 
-292140.429680  9113015.507039 
-292164.493281  9113043.657180 
-292170.509186  9113050.694713 
-292192.338896  9113045.693556 
-292237.911640  9113025.647917 
-292352.740279  9112962.475818 
-292455.700842  9112907.328043 
-292487.380383  9112890.282191 
-292580.438409  9112840.147119 
-292673.503661  9112791.016426 
-292706.236678  9112782.007602 
-292771.687725  9112761.980849 
-292846.054315  9112737.944594 
-292877.785820  9112727.930179 
-Region 1
-30
-291790.239010  9112167.346718 
-291783.050781  9112136.199442 
-291771.871945  9112103.039148 
-291743.565614  9112038.721651 
-291738.506671  9112026.662364 
-291721.208099  9111972.401009 
-291715.013911  9111941.254693 
-291500.064322  9111905.881448 
-291526.001016  9111784.360335 
-291441.383228  9111766.194005 
-291377.675141  9111753.071158 
-291335.878094  9111745.997423 
-291301.045986  9111739.935190 
-291264.255731  9111737.889045 
-291229.490464  9111740.867529 
-291181.863497  9111751.869180 
-291141.253409  9111770.914071 
-291134.422110  9111787.984064 
-291121.599602  9112070.242243 
-291112.810103  9112091.328359 
-291114.004543  9112118.451704 
-291148.762696  9112114.468708 
-291195.507519  9112118.533962 
-291261.137168  9112122.618184 
-291365.552680  9112129.754854 
-291671.834074  9112150.151903 
-291707.652990  9112155.210227 
-291724.564792  9112157.236123 
-291776.309017  9112165.323816 
-291790.239010  9112167.346718 
-Region 1
-33
-292210.117051  9111690.616478 
-292278.812702  9111572.151208 
-292191.909654  9111513.803272 
-292144.964597  9111482.616723 
-292054.998231  9111413.215695 
-291994.034321  9111367.951746 
-291946.050969  9111330.736770 
-291853.185239  9111272.382028 
-291688.088193  9111526.360727 
-291686.130089  9111530.376852 
-291634.106403  9111618.722631 
-291642.102414  9111624.757762 
-291658.072138  9111633.814435 
-291679.078418  9111651.916826 
-291690.160327  9111672.018324 
-291697.221921  9111686.088674 
-291701.338925  9111705.178683 
-291704.491754  9111728.285810 
-291707.808209  9111773.492555 
-291710.629085  9111886.001684 
-291711.883350  9111921.161157 
-291715.013911  9111941.254693 
-291721.208099  9111972.401009 
-291738.506671  9112026.662364 
-291743.565614  9112038.721651 
-291765.380078  9112031.711746 
-291779.354672  9112039.761827 
-291853.262978  9112088.052319 
-291892.618429  9112033.847362 
-291950.586638  9112077.099239 
-292011.532978  9111985.748421 
-292092.141730  9111865.285999 
-292210.117051  9111690.616478 
-Region 1
-77
-293355.301623  9111048.845678 
-293159.802112  9110955.236627 
-293154.810204  9110952.218239 
-293036.110408  9110894.845514 
-292913.427793  9110836.463999 
-292903.451486  9110831.431676 
-292687.993507  9110726.750944 
-292640.114895  9110703.600001 
-292594.231573  9110681.455477 
-292570.795211  9110737.685324 
-292543.316142  9110784.870536 
-292509.910853  9110837.072486 
-292445.072984  9110939.469275 
-292386.261219  9110916.307297 
-292373.270045  9111040.854637 
-292346.542876  9111189.496840 
-292375.641938  9111226.692718 
-292389.653559  9111239.765269 
-292424.671471  9111270.939834 
-292191.909654  9111513.803272 
-292278.812702  9111572.151208 
-292210.117051  9111690.616478 
-292092.141730  9111865.285999 
-292011.532978  9111985.748421 
-291950.586638  9112077.099239 
-291892.618429  9112033.847362 
-291853.262978  9112088.052319 
-291779.354672  9112039.761827 
-291765.380078  9112031.711746 
-291743.565614  9112038.721651 
-291771.871945  9112103.039148 
-291783.050781  9112136.199442 
-291790.239010  9112167.346718 
-291840.010253  9112177.441409 
-291895.782343  9112192.564594 
-291957.674426  9112228.788670 
-292036.597584  9112283.110822 
-292098.549467  9112327.370855 
-292160.494012  9112370.626249 
-292164.484669  9112372.639218 
-292215.391662  9112401.820380 
-292232.355703  9112410.877735 
-292296.169081  9112438.062446 
-292387.932138  9112481.346723 
-292402.893439  9112488.393001 
-292469.733554  9112521.607480 
-292597.435455  9112586.021213 
-292765.007326  9112665.540948 
-292873.795111  9112725.917287 
-292877.785820  9112727.930179 
-293170.259350  9112895.965968 
-293396.849900  9113025.765059 
-293407.813245  9113029.793573 
-293510.974155  9113001.765648 
-293499.786304  9112967.601620 
-293436.702758  9112771.661761 
-293381.750935  9112599.837738 
-293324.744510  9112418.970959 
-293290.113475  9112306.432340 
-293272.827944  9112254.181081 
-293265.698517  9112231.070439 
-293250.400920  9112178.821070 
-293242.113181  9112133.610026 
-293234.752141  9112079.359255 
-293218.363606  9112014.050134 
-293211.174497  9111982.903305 
-293208.947554  9111950.756747 
-293213.693028  9111920.625940 
-293230.148898  9111861.375561 
-293245.707953  9111815.182985 
-293262.231019  9111764.973289 
-293277.857275  9111727.821392 
-293278.828779  9111724.808792 
-293337.544726  9111734.910497 
-293789.205136  9111258.200908 
-293490.965711  9111115.274316 
-293355.301623  9111048.845678 
-Region 1
-75
-292375.641938  9111226.692718 
-292346.542876  9111189.496840 
-292373.270045  9111040.854637 
-292056.139789  9110762.288402 
-292035.126461  9110743.181591 
-292000.540651  9110770.269129 
-291988.688175  9110780.302501 
-291942.197748  9110810.391689 
-291884.781715  9110841.474441 
-291814.415050  9110868.526094 
-291757.881231  9110884.541793 
-291699.307514  9110893.523736 
-291684.413743  9110895.517829 
-291637.759457  9110903.507141 
-291577.205265  9110913.491469 
-291505.829432  9110938.532649 
-291460.235786  9110955.563565 
-291449.280477  9110952.538948 
-291445.208281  9110939.476048 
-291427.918194  9110886.218907 
-291421.724528  9110855.072453 
-291414.678053  9110843.011065 
-291404.560751  9110818.892300 
-291389.637268  9110816.868172 
-291383.658965  9110814.853083 
-291326.093901  9110825.844604 
-291274.469985  9110833.828509 
-291223.921582  9110852.863210 
-291172.364373  9110869.887792 
-291206.966290  9110979.415992 
-291086.005584  9111019.474144 
-291038.401518  9111033.489073 
-291008.650811  9111042.499515 
-290948.199930  9111066.546530 
-290899.646317  9111086.587517 
-290833.261438  9111114.646453 
-290794.594993  9111127.665770 
-290819.858155  9111183.945024 
-290883.498525  9111322.634468 
-290939.069268  9111445.243115 
-290979.353052  9111516.605334 
-291029.635629  9111596.013827 
-291141.253409  9111770.914071 
-291181.863497  9111751.869180 
-291229.490464  9111740.867529 
-291264.255731  9111737.889045 
-291301.045986  9111739.935190 
-291335.878094  9111745.997423 
-291377.675141  9111753.071158 
-291441.383228  9111766.194005 
-291526.001016  9111784.360335 
-291500.064322  9111905.881448 
-291715.013911  9111941.254693 
-291711.883350  9111921.161157 
-291710.629085  9111886.001684 
-291707.808209  9111773.492555 
-291704.491754  9111728.285810 
-291701.338925  9111705.178683 
-291697.221921  9111686.088674 
-291690.160327  9111672.018324 
-291679.078418  9111651.916826 
-291658.072138  9111633.814435 
-291642.102414  9111624.757762 
-291634.106403  9111618.722631 
-291686.130089  9111530.376852 
-291688.088193  9111526.360727 
-291853.185239  9111272.382028 
-291946.050969  9111330.736770 
-291994.034321  9111367.951746 
-292054.998231  9111413.215695 
-292144.964597  9111482.616723 
-292191.909654  9111513.803272 
-292424.671471  9111270.939834 
-292389.653559  9111239.765269 
-292375.641938  9111226.692718 
-Region 1
-15
-292570.795211  9110737.685324 
-292594.231573  9110681.455477 
-292500.469791  9110636.159771 
-292257.109763  9110521.403789 
-292137.748352  9110642.831886 
-292098.319654  9110686.991474 
-292055.879413  9110727.129966 
-292035.126461  9110743.181591 
-292056.139789  9110762.288402 
-292373.270045  9111040.854637 
-292386.261219  9110916.307297 
-292445.072984  9110939.469275 
-292509.910853  9110837.072486 
-292543.316142  9110784.870536 
-292570.795211  9110737.685324 
-Region 1
-261
-289102.061675  9119239.515092 
-288888.087294  9117589.854552 
-288891.002838  9117580.816761 
-288871.039954  9117569.746319 
-288993.577296  9117606.035671 
-289017.734984  9117242.419830 
-288972.742923  9117207.214842 
-288944.857348  9117200.154360 
-288922.839869  9117180.040987 
-288909.783770  9117161.945918 
-288898.767641  9117150.884680 
-288878.753137  9117132.782410 
-288858.783074  9117120.707373 
-288848.812854  9117116.678932 
-288843.827744  9117114.664710 
-288824.910983  9117110.627010 
-288807.974941  9117105.586818 
-288775.119131  9117098.521066 
-288764.214074  9117102.527905 
-288754.325281  9117109.549396 
-288747.440873  9117119.587600 
-288737.537271  9117124.600006 
-288729.495965  9117112.537264 
-288725.416106  9117098.469560 
-288724.377638  9117092.441279 
-288724.325831  9117085.409488 
-288725.164471  9117064.315145 
-288741.945068  9117048.260001 
-288752.761300  9117032.198672 
-288755.669463  9117022.156349 
-288754.549583  9117005.078113 
-288750.491936  9116994.024034 
-288747.398747  9116978.952819 
-288747.309937  9116966.898320 
-288732.354668  9116960.855605 
-288720.374175  9116953.811437 
-288710.344801  9116941.746619 
-288709.202747  9116921.654752 
-288723.980399  9116903.588478 
-288743.757920  9116889.545525 
-288772.333911  9116855.421015 
-288827.586483  9116799.224405 
-288808.381216  9116756.009555 
-288785.318190  9116728.863226 
-288763.345442  9116714.776950 
-288762.158998  9116688.657837 
-288764.087904  9116680.623568 
-288763.056855  9116675.599828 
-288765.987211  9116668.571133 
-288690.513298  9116678.538058 
-288614.920980  9116672.432186 
-288538.319812  9116664.316062 
-288490.501795  9116650.202657 
-288462.520480  9116630.082716 
-288457.483688  9116621.036632 
-288477.893025  9116557.772225 
-288516.646189  9116555.803639 
-288507.507517  9116529.676176 
-288500.423492  9116512.591674 
-288431.494102  9116466.310956 
-288369.523172  9116420.037394 
-288341.490339  9116392.885522 
-288243.335061  9116292.328772 
-288079.130419  9116131.429749 
-288002.992783  9116050.986219 
-288033.490735  9116007.823346 
-288051.154682  9115976.701349 
-288054.085141  9115969.672682 
-288060.910576  9115951.598217 
-288061.845575  9115943.562902 
-288062.773194  9115934.523041 
-288064.576774  9115909.411500 
-288061.461824  9115891.326522 
-288060.290677  9115867.216371 
-288148.917608  9115618.184726 
-288215.079812  9115423.374388 
-288223.162559  9115305.852059 
-288220.047650  9115287.767092 
-288211.940490  9115266.663232 
-288214.686418  9115234.520938 
-288214.642142  9115228.493666 
-288226.230956  9115182.297204 
-288170.794476  9115213.379193 
-288157.092126  9115242.496277 
-288165.214012  9115265.609245 
-288175.309200  9115286.715223 
-288166.495800  9115304.787572 
-288152.668000  9115316.827386 
-288126.926647  9115330.863654 
-288118.989201  9115332.864321 
-288110.050352  9115333.859388 
-288098.166312  9115339.874022 
-288090.265749  9115346.897414 
-288078.389079  9115353.916590 
-288071.489913  9115361.945580 
-288062.610069  9115370.977007 
-288051.727414  9115377.997233 
-288046.779411  9115381.005599 
-288038.871456  9115387.024440 
-288030.963498  9115393.043279 
-288024.056941  9115400.067719 
-288022.164776  9115413.124711 
-288020.250482  9115423.168063 
-288018.343563  9115434.215962 
-288016.421892  9115443.254769 
-288008.536051  9115452.287246 
-288000.628079  9115458.306084 
-287990.732047  9115464.322811 
-287985.813532  9115471.349359 
-287973.973689  9115483.391251 
-287968.039015  9115487.403104 
-287961.154561  9115497.441179 
-287952.282045  9115507.477142 
-287940.420059  9115516.505390 
-287930.531380  9115523.526655 
-287917.682729  9115533.558389 
-287901.837231  9115541.577857 
-287891.963287  9115550.608210 
-287877.097061  9115556.619635 
-287868.224513  9115566.655589 
-287866.310186  9115576.698944 
-287864.395858  9115586.742299 
-287865.471000  9115597.793373 
-287868.622695  9115620.901125 
-287869.705215  9115632.956746 
-287859.831248  9115641.987098 
-287850.973431  9115654.032147 
-287845.090339  9115665.075820 
-287843.168633  9115674.114629 
-287841.210059  9115678.130703 
-287839.244112  9115681.142229 
-287833.383134  9115695.199544 
-287830.415777  9115697.205466 
-287820.527043  9115704.226719 
-287818.583213  9115710.251887 
-287811.735565  9115725.312691 
-287806.809626  9115731.334685 
-287798.894206  9115736.348958 
-287786.052841  9115747.385222 
-287779.146198  9115754.409646 
-287776.208324  9115760.433755 
-287774.271860  9115767.463470 
-287773.381041  9115781.526075 
-287774.456178  9115792.577155 
-287778.528174  9115805.640504 
-287775.560807  9115807.646424 
-287771.614149  9115811.660381 
-287762.682556  9115813.659951 
-287755.761155  9115818.675279 
-287747.845715  9115823.689547 
-287739.937644  9115829.708362 
-287730.048867  9115836.729606 
-287719.210280  9115849.777076 
-287713.282907  9115854.793459 
-287705.389569  9115862.821366 
-287705.448542  9115870.857747 
-287706.472069  9115874.876998 
-287712.502651  9115883.924282 
-287723.503434  9115892.976860 
-287730.572297  9115908.052485 
-287732.619357  9115916.090983 
-287730.756611  9115933.166175 
-287725.941232  9115954.256381 
-287726.994255  9115962.293820 
-287731.110503  9115981.384457 
-287736.161813  9115992.439770 
-287743.208584  9116004.501746 
-287750.247985  9116015.559172 
-287750.373336  9116032.636478 
-287741.589169  9116054.727003 
-287731.810953  9116076.816470 
-287718.056554  9116098.901707 
-287693.330786  9116115.952563 
-287683.500930  9116131.010194 
-287678.626549  9116144.064022 
-287672.809728  9116164.148626 
-287665.998858  9116184.232172 
-287655.174935  9116199.288744 
-287641.302515  9116205.301206 
-287632.385581  9116209.309866 
-287614.573823  9116220.340826 
-287602.755826  9116235.396332 
-287594.884529  9116246.437883 
-287591.931871  9116250.452896 
-287576.100811  9116260.481418 
-287561.352242  9116282.565576 
-287546.625771  9116307.663378 
-287529.911187  9116332.759057 
-287516.127147  9116350.826077 
-287443.068460  9116419.056830 
-287392.600180  9116450.143651 
-287371.857673  9116468.203206 
-287349.311225  9116511.374362 
-287294.005084  9116560.537687 
-287292.031704  9116562.544657 
-287270.250852  9116574.575823 
-287269.463047  9116602.702151 
-287269.595640  9116620.784047 
-287247.925245  9116647.883458 
-287231.085173  9116655.901744 
-287213.258400  9116664.923509 
-287172.472512  9116660.861585 
-287076.048736  9116660.757993 
-286999.484034  9116657.661962 
-286957.711425  9116654.603319 
-286926.048672  9116674.660048 
-286910.209926  9116683.683855 
-286943.300966  9116722.896744 
-286982.378524  9116765.129672 
-287012.472777  9116802.330167 
-287031.625017  9116838.514320 
-287051.844986  9116884.745034 
-287053.155667  9116927.941787 
-287039.525907  9116967.104314 
-287019.961176  9117010.278636 
-287010.307653  9117049.445438 
-287000.705661  9117095.644099 
-286996.957638  9117126.780906 
-286997.149083  9117152.899232 
-287005.388831  9117192.085262 
-287014.571126  9117224.240498 
-287031.669200  9117251.381511 
-287069.804884  9117300.645013 
-287137.866041  9117364.004094 
-287211.862360  9117423.351200 
-287296.778962  9117480.700700 
-287302.772909  9117484.725256 
-287399.685017  9117551.128156 
-287416.658083  9117561.191612 
-287504.690175  9117636.625630 
-287573.812889  9117709.025768 
-287647.854564  9117774.399169 
-287650.851570  9117776.411415 
-287706.763730  9117809.620260 
-287771.578393  9117836.811166 
-287775.569489  9117838.824450 
-287854.353068  9117873.061702 
-287946.074587  9117909.321448 
-288001.964892  9117939.516202 
-288043.967658  9117973.714477 
-288073.054785  9118008.903722 
-288104.181878  9118051.126827 
-288132.504225  9118117.455846 
-288256.519771  9118489.263485 
-288286.845737  9118557.603430 
-288330.050658  9118619.929483 
-288460.630678  9118802.890074 
-288576.107680  9118959.716588 
-288640.367456  9119046.172636 
-288701.548824  9119119.566440 
-288771.707008  9119196.987443 
-288835.856298  9119268.374939 
-288909.924626  9119336.758826 
-288973.050548  9119404.126854 
-288977.969159  9119397.100146 
-289026.064868  9119448.380238 
-289068.203442  9119500.658727 
-289109.333159  9119550.927067 
-289147.643972  9119623.292161 
-289200.436938  9119772.016161 
-289102.061675  9119239.515092 
-Region 1
-305
-290675.442609  9114910.586861 
-290635.467007  9114881.415433 
-290588.518582  9114850.227882 
-290538.513927  9114808.991929 
-290516.489921  9114787.874668 
-290491.528496  9114772.781578 
-290458.563101  9114750.648698 
-290433.594286  9114734.551033 
-290396.667791  9114714.423140 
-290356.766749  9114695.296720 
-290333.800837  9114681.210067 
-290321.754081  9114665.125424 
-290309.581155  9114631.963693 
-290299.425935  9114602.822109 
-290293.239299  9114572.680024 
-290278.218024  9114557.596863 
-290252.270216  9114543.507116 
-290220.373283  9114531.420353 
-290201.442831  9114525.373926 
-290167.624690  9114522.325912 
-290143.724260  9114516.274396 
-290081.065378  9114511.187856 
-290009.527250  9114515.132908 
-289994.632119  9114517.126738 
-289968.684387  9114503.036802 
-289952.646985  9114484.938877 
-289936.572531  9114461.818261 
-289923.502321  9114441.714300 
-289902.524630  9114427.629402 
-289859.679042  9114413.522061 
-289803.013858  9114412.459363 
-289705.624432  9114415.372814 
-289637.023832  9114413.293091 
-289618.167510  9114417.291771 
-289561.739202  9114448.373999 
-289516.378066  9114497.549166 
-289493.612321  9114510.584546 
-289446.968344  9114520.581629 
-289412.185728  9114521.550167 
-289395.250710  9114516.509975 
-289357.537888  9114524.507157 
-289323.793652  9114531.503896 
-289304.870629  9114526.461606 
-289277.943806  9114514.379274 
-289258.019392  9114508.331391 
-289212.332321  9114513.306576 
-289200.404303  9114513.294173 
-289189.625621  9114534.378148 
-289183.713386  9114541.403728 
-289174.811746  9114547.421664 
-289190.878521  9114569.538093 
-289188.942295  9114576.567808 
-289178.104422  9114589.615462 
-289141.437239  9114604.645305 
-289095.897940  9114629.711215 
-289047.457906  9114665.823933 
-289043.533645  9114672.851575 
-289023.934505  9114711.003408 
-289008.096941  9114720.027691 
-288969.441558  9114735.055360 
-288964.508486  9114740.072879 
-288956.593388  9114745.087284 
-288950.636734  9114746.085598 
-288939.732216  9114750.092346 
-288929.829097  9114755.104671 
-288919.940760  9114762.126078 
-288908.020050  9114763.118156 
-288898.116923  9114768.130476 
-288887.241960  9114776.155380 
-288880.335638  9114783.179899 
-288868.474049  9114792.208303 
-288860.573712  9114799.231780 
-288855.692357  9114811.281085 
-288848.815588  9114822.323769 
-288839.876888  9114823.318952 
-288832.926206  9114824.316214 
-288823.965333  9114822.297768 
-288812.037209  9114822.285282 
-288799.100294  9114820.262668 
-288787.179558  9114821.254718 
-288779.242253  9114823.255473 
-288775.317937  9114830.283105 
-288775.362274  9114836.310359 
-288770.495672  9114850.368747 
-288769.582945  9114861.417672 
-288764.716340  9114875.476060 
-288760.843745  9114889.535489 
-288745.042998  9114903.582420 
-288735.147207  9114909.599258 
-288727.224661  9114913.609093 
-288718.322878  9114919.626971 
-288712.395743  9114924.643431 
-288705.481981  9114930.663391 
-288701.542870  9114935.681935 
-288692.655855  9114943.708895 
-288684.740686  9114948.723268 
-288676.825515  9114953.737640 
-288664.926898  9114957.743296 
-288654.022293  9114961.749992 
-288635.180344  9114967.757424 
-288625.277134  9114972.769701 
-288608.467523  9114984.806471 
-288596.561502  9114987.807569 
-288581.658661  9114988.796443 
-288571.748052  9114992.804168 
-288563.840243  9114998.823068 
-288554.938416  9115004.840923 
-288544.107638  9115018.893034 
-288535.213190  9115025.915429 
-288526.303968  9115030.928736 
-288514.427465  9115037.947992 
-288502.558341  9115045.971788 
-288483.716325  9115051.979170 
-288465.868319  9115057.987592 
-288453.019929  9115068.019420 
-288441.136018  9115074.034117 
-288428.295001  9115085.070485 
-288408.481082  9115094.090426 
-288390.633044  9115100.098825 
-288378.741731  9115105.108965 
-288362.881720  9115111.119451 
-288351.005163  9115118.138674 
-288342.103278  9115124.156499 
-288330.219332  9115130.171174 
-288317.363506  9115139.198430 
-288302.512252  9115147.219040 
-288291.607552  9115151.225667 
-288271.815707  9115163.259197 
-288257.928937  9115167.262666 
-288245.036184  9115171.267183 
-288233.159587  9115178.286383 
-288226.230956  9115182.297204 
-288214.642142  9115228.493666 
-288214.686418  9115234.520938 
-288211.940490  9115266.663232 
-288220.047650  9115287.767092 
-288223.162559  9115305.852059 
-288215.079812  9115423.374388 
-288148.917608  9115618.184726 
-288060.290677  9115867.216371 
-288061.461824  9115891.326522 
-288064.576774  9115909.411500 
-288062.773194  9115934.523041 
-288061.845575  9115943.562902 
-288060.910576  9115951.598217 
-288054.085141  9115969.672682 
-288051.154682  9115976.701349 
-288033.490735  9116007.823346 
-288002.992783  9116050.986219 
-288079.130419  9116131.429749 
-288243.335061  9116292.328772 
-288341.490339  9116392.885522 
-288369.523172  9116420.037394 
-288431.494102  9116466.310956 
-288500.423492  9116512.591674 
-288507.507517  9116529.676176 
-288516.646189  9116555.803639 
-288477.893025  9116557.772225 
-288457.483688  9116621.036632 
-288462.520480  9116630.082716 
-288490.501795  9116650.202657 
-288538.319812  9116664.316062 
-288614.920980  9116672.432186 
-288690.513298  9116678.538058 
-288765.987211  9116668.571133 
-288752.923961  9116649.471423 
-288731.099238  9116655.475956 
-288693.147751  9116631.327685 
-288682.087437  9116614.239096 
-288693.860689  9116593.156122 
-288732.428870  9116566.073802 
-288778.978983  9116543.017885 
-288800.677851  9116519.936138 
-288822.421098  9116502.881634 
-288833.148414  9116474.765824 
-288849.001354  9116467.750538 
-288882.821124  9116470.799210 
-288886.789907  9116469.798791 
-288919.623031  9116473.850946 
-288937.656502  9116492.955750 
-288945.571859  9116487.941280 
-288948.516985  9116482.921663 
-288940.401765  9116460.813534 
-288927.227508  9116426.645764 
-288929.023152  9116400.529761 
-288957.680183  9116377.455182 
-288981.463202  9116367.434473 
-289003.339557  9116368.461644 
-289039.117705  9116367.494111 
-289048.976689  9116356.454443 
-289052.664102  9116317.281485 
-289076.513700  9116316.301600 
-289096.416747  9116319.335757 
-289120.177474  9116306.301371 
-289135.014036  9116296.271363 
-289138.953171  9116291.252767 
-289146.787004  9116275.188338 
-289151.668335  9116263.138990 
-289159.620656  9116263.147194 
-289166.638186  9116271.190689 
-289181.652481  9116285.269620 
-289191.637326  9116291.307105 
-289210.561131  9116296.349266 
-289233.431470  9116297.377357 
-289253.171522  9116278.311583 
-289269.053935  9116275.314337 
-289287.020739  9116285.378138 
-289304.994959  9116296.446469 
-289331.804398  9116292.455904 
-289340.706295  9116286.437865 
-289348.540048  9116270.373418 
-289351.403602  9116254.303864 
-289346.359308  9116244.253370 
-289334.230782  9116217.118565 
-289335.158134  9116208.078738 
-289349.942735  9116191.016907 
-289355.936600  9116195.041192 
-289363.970412  9116206.099288 
-289373.992304  9116217.159424 
-289374.764030  9116187.024289 
-289364.490208  9116141.809839 
-289369.356651  9116127.751407 
-289381.403646  9116143.836281 
-289388.465645  9116157.906968 
-289401.454817  9116166.961086 
-289441.965735  9116133.853156 
-289459.517437  9116087.662760 
-289449.488153  9116075.598102 
-289437.404108  9116054.490556 
-289441.224614  9116033.399334 
-289452.158983  9116033.410559 
-289461.216455  9116048.487813 
-289475.214457  9116059.552009 
-289492.083385  9116055.551188 
-289509.820330  9116034.474237 
-289539.322567  9115991.309676 
-289567.860375  9115952.162240 
-289596.383310  9115911.005722 
-289645.714077  9115860.829723 
-289701.038561  9115814.677939 
-289739.612804  9115788.599590 
-289761.310809  9115765.517578 
-289785.990867  9115742.438604 
-289800.693567  9115714.326798 
-289827.287452  9115681.204478 
-289829.067812  9115653.079489 
-289827.962529  9115638.010430 
-289817.829460  9115611.882341 
-289823.674922  9115595.815845 
-289833.615142  9115595.825988 
-289847.501779  9115591.822040 
-289868.183372  9115565.725387 
-289896.883870  9115548.677660 
-289924.456786  9115513.547262 
-289939.374499  9115514.566985 
-289958.149580  9115499.518179 
-290003.614747  9115464.405965 
-290023.361540  9115446.344547 
-290041.335487  9115457.412627 
-290050.259383  9115454.408114 
-290059.101645  9115440.353712 
-290065.948446  9115425.292754 
-290083.877859  9115430.333606 
-290095.694733  9115415.277694 
-290116.465168  9115401.235398 
-290130.262633  9115385.176965 
-290123.067010  9115353.024786 
-290133.830462  9115329.931584 
-290160.579779  9115317.904403 
-290172.530217  9115320.930107 
-290168.769430  9115350.057579 
-290179.740709  9115355.091340 
-290190.615483  9115347.066149 
-290205.340104  9115321.967900 
-290218.262286  9115321.980996 
-290225.405991  9115347.101405 
-290232.683353  9115390.303427 
-290246.762921  9115412.417269 
-290271.635590  9115415.456017 
-290295.410276  9115404.430271 
-290305.313296  9115399.417651 
-290338.768164  9115353.243254 
-290354.501560  9115330.155047 
-290350.369540  9115309.055823 
-290362.201141  9115296.008936 
-290377.029628  9115284.974127 
-290368.483370  9115204.603405 
-290379.276374  9115185.528315 
-290404.972087  9115165.463752 
-290432.722644  9115154.441987 
-290450.570237  9115148.432844 
-290469.448977  9115147.447365 
-290506.175292  9115140.452715 
-290544.837593  9115126.428312 
-290572.439460  9115095.315822 
-290591.013493  9115053.144464 
-290590.753418  9115017.985825 
-290599.617727  9115006.944972 
-290614.587250  9115014.996236 
-290627.576199  9115024.050027 
-290647.456303  9115024.070018 
-290674.093765  9114996.974625 
-290692.823761  9114975.898428 
-290684.485249  9114923.654771 
-290675.442609  9114910.586861 
-Region 1
-113
-290721.230712  9114113.040333 
-290683.385010  9114102.956901 
-290607.738191  9114088.817127 
-290553.988755  9114078.717493 
-290512.181995  9114070.638944 
-290501.181350  9114061.587062 
-290460.353745  9114051.500399 
-290451.407882  9114051.491322 
-290337.151527  9114058.406925 
-290287.474496  9114061.369946 
-290282.497148  9114060.360350 
-290205.878632  9114049.232453 
-290162.788691  9114001.975669 
-290041.137747  9113815.008967 
-290026.064152  9113927.500708 
-289991.178350  9113914.406072 
-289973.190292  9113901.328745 
-289960.120291  9113881.224755 
-289944.001664  9113852.076867 
-289931.955314  9113835.992030 
-289918.914990  9113819.906165 
-289913.745037  9113792.778565 
-289900.593609  9113761.624638 
-289883.599622  9113748.548277 
-289866.590829  9113733.462833 
-289855.531117  9113716.374446 
-289842.394573  9113687.229561 
-289835.392274  9113681.195170 
-289830.400155  9113678.176437 
-289805.609902  9113686.187125 
-289787.799717  9113697.218590 
-289705.824988  9113768.455629 
-289700.958731  9113782.514028 
-289673.245664  9113798.557886 
-289635.644555  9113821.623224 
-289614.918937  9113841.692404 
-289587.999929  9113830.614715 
-289572.081373  9113828.589175 
-289538.248891  9113823.531480 
-289509.526935  9113837.565150 
-289495.625943  9113839.559801 
-289480.701365  9113837.535259 
-289476.718025  9113836.526596 
-289458.767098  9113828.471718 
-289419.794528  9113800.304367 
-289389.819642  9113779.178049 
-289372.892318  9113775.142320 
-289343.028406  9113769.084059 
-289304.226032  9113764.021000 
-289298.306495  9113770.042029 
-289294.367531  9113775.060588 
-289182.276379  9113806.084205 
-289170.370723  9113809.085372 
-289141.604254  9113817.091589 
-289073.218709  9113844.142489 
-289072.261674  9113849.164156 
-289116.152348  9113870.305254 
-289226.015974  9113941.741767 
-289446.308950  9114026.351502 
-289446.345949  9114031.374198 
-289447.406537  9114040.416081 
-289425.950756  9114231.254824 
-289415.697666  9114323.661099 
-289407.782699  9114328.675555 
-289379.060402  9114342.709225 
-289359.224861  9114348.715844 
-289323.729523  9114387.855760 
-289387.263988  9114376.871807 
-289398.575403  9114428.114641 
-289446.968344  9114520.581629 
-289493.612321  9114510.584546 
-289516.378066  9114497.549166 
-289561.739202  9114448.373999 
-289618.167510  9114417.291771 
-289637.023832  9114413.293091 
-289705.624432  9114415.372814 
-289803.013858  9114412.459363 
-289859.679042  9114413.522061 
-289902.524630  9114427.629402 
-289923.502321  9114441.714300 
-289936.572531  9114461.818261 
-289952.646985  9114484.938877 
-289968.684387  9114503.036802 
-289994.632119  9114517.126738 
-290009.527250  9114515.132908 
-290081.065378  9114511.187856 
-290143.724260  9114516.274396 
-290167.624690  9114522.325912 
-290201.442831  9114525.373926 
-290220.373283  9114531.420353 
-290252.270216  9114543.507116 
-290278.218024  9114557.596863 
-290293.239299  9114572.680024 
-290299.425935  9114602.822109 
-290309.581155  9114631.963693 
-290321.754081  9114665.125424 
-290333.800837  9114681.210067 
-290356.766749  9114695.296720 
-290396.667791  9114714.423140 
-290433.594286  9114734.551033 
-290458.563101  9114750.648698 
-290491.528496  9114772.781578 
-290516.489921  9114787.874668 
-290538.513927  9114808.991929 
-290647.556782  9114768.920815 
-290630.116405  9114695.572930 
-290625.999251  9114676.482807 
-290609.642121  9114615.190289 
-290619.500365  9114604.150452 
-290711.464745  9114405.347191 
-290802.886053  9114133.213093 
-290763.030074  9114120.114139 
-290721.230712  9114113.040333 
-Region 1
-61
-291530.118940  9114889.338600 
-291535.081477  9114888.338975 
-291424.036193  9114658.194024 
-291396.781386  9114601.913852 
-291391.729520  9114590.859113 
-291276.043498  9114404.907779 
-291262.898390  9114374.759047 
-291247.854627  9114356.662678 
-291218.909938  9114340.561499 
-291186.063718  9114334.501628 
-291159.337653  9114349.542808 
-291117.701744  9114364.569093 
-291094.869766  9114368.564382 
-291070.064679  9114374.566735 
-290981.614536  9114376.487296 
-290979.366313  9114341.326729 
-290971.102129  9114299.128468 
-290967.993773  9114282.048456 
-290957.905209  9114261.947875 
-290942.787251  9114233.806057 
-290914.702900  9114199.624074 
-290880.706709  9114172.467792 
-290858.757282  9114161.395970 
-290854.766478  9114159.382911 
-290826.830859  9114145.291480 
-290802.886053  9114133.213093 
-290711.464745  9114405.347191 
-290619.500365  9114604.150452 
-290609.642121  9114615.190289 
-290625.999251  9114676.482807 
-290630.116405  9114695.572930 
-290647.556782  9114768.920815 
-290538.513927  9114808.991929 
-290588.518582  9114850.227882 
-290635.467007  9114881.415433 
-290675.442609  9114910.586861 
-290684.485249  9114923.654771 
-290692.823761  9114975.898428 
-290743.674061  9114997.044494 
-290771.573083  9115006.113196 
-290804.434698  9115014.182327 
-290818.499469  9115034.286894 
-290833.588003  9115058.410574 
-290847.645366  9115077.510595 
-290861.501944  9115069.488270 
-290880.231856  9115048.412009 
-290904.970400  9115033.368892 
-290937.541943  9115002.261219 
-290941.503079  9115000.256130 
-290980.157609  9114985.226884 
-291052.563529  9114964.204128 
-291104.087895  9114942.155962 
-291143.654429  9114916.077765 
-291200.163561  9114896.043517 
-291222.031548  9114896.065245 
-291242.905533  9114896.085976 
-291247.853195  9114893.077323 
-291284.497146  9114875.032301 
-291384.697343  9114849.014053 
-291411.587408  9114856.072313 
-291530.118940  9114889.338600 
-Region 1
-91
-290031.932510  9113779.841031 
-290029.892668  9113772.807240 
-290011.771276  9113741.648265 
-289993.724014  9113720.534639 
-289968.726321  9113700.418393 
-289931.697177  9113666.226351 
-289908.465263  9113615.975995 
-289891.086169  9113550.663700 
-289890.826929  9113515.504904 
-289890.493631  9113470.300738 
-289909.706529  9113379.912886 
-289919.357404  9113340.746184 
-289939.919732  9113298.577135 
-290029.319105  9113156.026035 
-290004.403253  9113146.959636 
-289980.562849  9113148.944148 
-289978.804523  9113180.082739 
-289961.944095  9113185.088020 
-289943.073506  9113187.077637 
-289908.358657  9113197.087145 
-289887.470498  9113195.056542 
-289879.652032  9113213.130008 
-289869.845621  9113231.201423 
-289853.125837  9113255.292880 
-289837.029803  9113229.158490 
-289801.796668  9113168.850295 
-289766.615452  9113115.573813 
-289752.588880  9113100.491343 
-289717.474388  9113056.255639 
-289637.421777  9113118.453540 
-289599.784132  9113136.496032 
-289563.110830  9113150.521376 
-289525.384356  9113156.509350 
-289501.536469  9113157.489077 
-289459.774925  9113155.436546 
-289422.975834  9113152.384616 
-289418.999952  9113152.380472 
-289419.229177  9113183.521204 
-289438.181183  9113192.581736 
-289448.209639  9113204.646563 
-289459.298631  9113225.753277 
-289466.507893  9113259.914860 
-289469.719090  9113291.058684 
-289469.785655  9113300.099539 
-289466.142594  9113345.299676 
-289469.213275  9113357.357250 
-289473.292728  9113371.424936 
-289468.478182  9113392.515094 
-289466.630769  9113411.599275 
-289455.963312  9113447.751323 
-289449.234772  9113478.884810 
-289455.427944  9113510.031732 
-289488.658305  9113568.329091 
-289490.668458  9113571.344773 
-289502.788572  9113597.475174 
-289486.149856  9113632.616500 
-289469.488925  9113664.744209 
-289462.782593  9113698.891318 
-289461.943976  9113719.985610 
-289474.300902  9113778.261264 
-289480.701365  9113837.535259 
-289495.625943  9113839.559801 
-289509.526935  9113837.565150 
-289538.248891  9113823.531480 
-289572.081373  9113828.589175 
-289587.999929  9113830.614715 
-289614.918937  9113841.692404 
-289635.644555  9113821.623224 
-289673.245664  9113798.557886 
-289700.958731  9113782.514028 
-289705.824988  9113768.455629 
-289787.799717  9113697.218590 
-289805.609902  9113686.187125 
-289830.400155  9113678.176437 
-289835.392274  9113681.195170 
-289842.394573  9113687.229561 
-289855.531117  9113716.374446 
-289866.590829  9113733.462833 
-289883.599622  9113748.548277 
-289900.593609  9113761.624638 
-289913.745037  9113792.778565 
-289918.914990  9113819.906165 
-289931.955314  9113835.992030 
-289944.001664  9113852.076867 
-289960.120291  9113881.224755 
-289973.190292  9113901.328745 
-289991.178350  9113914.406072 
-290026.064152  9113927.500708 
-290041.137747  9113815.008967 
-290038.133567  9113811.992302 
-290031.932510  9113779.841031 
-Region 1
-47
-292054.178100  9114384.580256 
-291874.254493  9114248.793971 
-291886.970052  9114087.078951 
-291891.775951  9114064.984263 
-291885.782269  9114060.960297 
-291789.001289  9114011.643609 
-291771.820539  9113973.454939 
-291675.680429  9114010.527276 
-291576.304987  9114013.442551 
-291566.484352  9114029.505153 
-291562.545671  9114034.523854 
-291473.887988  9114008.318425 
-291459.231416  9114042.457590 
-291451.391244  9114057.517622 
-291411.203785  9114133.821323 
-291372.877644  9114193.050004 
-291343.318644  9114228.178874 
-291309.820872  9114268.326426 
-291271.427530  9114318.514312 
-291223.857551  9114337.552862 
-291218.909938  9114340.561499 
-291247.854627  9114356.662678 
-291262.898390  9114374.759047 
-291276.043498  9114404.907779 
-291391.729520  9114590.859113 
-291396.781386  9114601.913852 
-291424.036193  9114658.194024 
-291535.081477  9114888.338975 
-291586.717178  9114881.358245 
-291629.272731  9114856.287167 
-291706.454080  9114809.150685 
-291747.993123  9114781.064969 
-291776.729483  9114769.038961 
-291797.580981  9114766.045872 
-291803.522574  9114763.038146 
-291832.229074  9114746.994005 
-291880.673706  9114711.883342 
-291897.452243  9114695.827484 
-291923.161770  9114677.771331 
-291977.756669  9114667.779568 
-292044.174956  9114643.736046 
-292071.932048  9114633.717968 
-292127.528272  9114624.731540 
-292150.233290  9114603.658808 
-292164.052103  9114590.613549 
-292217.085532  9114504.276737 
-292054.178100  9114384.580256 
-Region 1
-44
-292764.000571  9114000.539757 
-292776.615802  9113959.366835 
-292753.717111  9113954.322185 
-292734.749473  9113943.254230 
-292682.569927  9113876.905881 
-292657.990095  9113779.444181 
-292608.418682  9113796.472952 
-292600.317573  9113776.374802 
-292505.001183  9113790.345583 
-292397.579270  9113646.595349 
-292382.520530  9113626.490354 
-292250.168331  9113471.665575 
-292091.984156  9113586.025627 
-292010.948538  9113649.230714 
-291972.235961  9113656.224295 
-291785.630575  9113691.198614 
-291771.752241  9113696.207509 
-291773.926419  9113721.322642 
-291765.271213  9113760.490357 
-291746.862511  9113824.761432 
-291749.349593  9113892.066697 
-291763.645209  9113943.311295 
-291771.820539  9113973.454939 
-291789.001289  9114011.643609 
-291885.782269  9114060.960297 
-291891.775951  9114064.984263 
-291886.970052  9114087.078951 
-291874.254493  9114248.793971 
-292054.178100  9114384.580256 
-292217.085532  9114504.276737 
-292246.569206  9114459.102178 
-292281.015279  9114412.927922 
-292315.379171  9114355.703896 
-292335.094566  9114333.623698 
-292362.784185  9114314.564789 
-292374.652224  9114306.540186 
-292472.615641  9114247.368782 
-292539.944748  9114212.275949 
-292577.514199  9114185.190387 
-292622.841171  9114131.994914 
-292653.482564  9114108.920678 
-292687.083431  9114082.835741 
-292725.579397  9114046.710365 
-292764.000571  9114000.539757 
-Region 1
-64
-292186.025248  9113400.282055 
-292140.124073  9113376.128630 
-292112.211150  9113365.051543 
-292085.284744  9113352.970887 
-292048.470916  9113347.912118 
-292036.528476  9113345.891339 
-291968.976368  9113350.847449 
-291931.272884  9113359.850969 
-291894.253585  9113193.064304 
-291892.220973  9113187.035182 
-291813.832302  9113205.039062 
-291736.169446  9113186.880823 
-291655.517301  9113167.714949 
-291651.712674  9113190.815140 
-291639.911700  9113207.880270 
-291592.581193  9113259.063803 
-291481.949467  9113352.374205 
-291420.811757  9113284.005832 
-291320.052245  9113368.285078 
-291342.120311  9113395.429211 
-291275.911309  9113447.598208 
-291239.357605  9113477.697322 
-291177.131665  9113530.874734 
-291105.077373  9113599.110084 
-291068.590326  9113638.249889 
-291016.340859  9113696.459798 
-290989.793412  9113735.609552 
-291034.827056  9113776.840222 
-291065.878200  9113809.016105 
-291076.878852  9113818.067839 
-291100.037721  9113858.271959 
-291130.176793  9113901.496610 
-291160.345676  9113948.739346 
-291199.557147  9114009.049867 
-291215.721189  9114044.224282 
-291223.948288  9114081.399812 
-291223.229568  9114118.566415 
-291219.447068  9114144.680219 
-291222.562933  9114162.764725 
-291227.629569  9114175.828565 
-291343.318644  9114228.178874 
-291372.877644  9114193.050004 
-291411.203785  9114133.821323 
-291451.391244  9114057.517622 
-291459.231416  9114042.457590 
-291473.887988  9114008.318425 
-291562.545671  9114034.523854 
-291566.484352  9114029.505153 
-291576.304987  9114013.442551 
-291675.680429  9114010.527276 
-291771.820539  9113973.454939 
-291763.645209  9113943.311295 
-291749.349593  9113892.066697 
-291746.862511  9113824.761432 
-291765.271213  9113760.490357 
-291773.926419  9113721.322642 
-291771.752241  9113696.207509 
-291785.630575  9113691.198614 
-291972.235961  9113656.224295 
-292010.948538  9113649.230714 
-292091.984156  9113586.025627 
-292250.168331  9113471.665575 
-292219.042250  9113429.445396 
-292186.025248  9113400.282055 
-Region 1
-152
-292203.630249  9113093.921479 
-292197.614333  9113086.883954 
-292170.509186  9113050.694713 
-292164.493281  9113043.657180 
-292140.429680  9113015.507039 
-292068.711409  9112860.740679 
-292065.684851  9112854.710587 
-292055.715545  9112850.682689 
-291989.596633  9112646.700164 
-291855.801047  9112698.802781 
-291764.588581  9112729.852438 
-291737.826390  9112739.871067 
-291587.184999  9112798.987937 
-291437.529629  9112857.100860 
-291353.281502  9112889.161308 
-291281.298338  9112698.229939 
-291266.136369  9112664.060955 
-291257.175953  9112662.042913 
-291009.288596  9112608.553542 
-290901.763761  9112584.336234 
-290929.617634  9112721.984260 
-290943.014276  9112786.287354 
-290845.940787  9112831.392772 
-290829.095500  9112838.407389 
-290845.280919  9112876.595715 
-290866.443587  9112915.793589 
-290840.778871  9112939.876214 
-290834.103294  9112978.041397 
-290830.313073  9113003.150680 
-290834.400285  9113018.222685 
-290797.030701  9113072.429207 
-290763.154346  9113061.345129 
-290739.135963  9113039.221238 
-290730.116087  9113029.166842 
-290724.159743  9113030.165327 
-290632.819196  9113044.135972 
-290563.316048  9113054.110566 
-290535.448007  9113049.059571 
-290525.530637  9113052.063052 
-290482.723488  9113042.978702 
-290448.951008  9113045.957845 
-290418.078832  9113037.890129 
-290422.217833  9113059.993944 
-290401.745050  9113114.217499 
-290377.815747  9113104.147797 
-290309.269257  9113109.100375 
-290306.391154  9113123.160815 
-290217.831874  9113110.011290 
-290201.386565  9113171.270637 
-290175.023781  9113235.533407 
-290156.056860  9113224.464150 
-290143.031522  9113210.387395 
-290084.209578  9113186.218325 
-290060.591430  9113218.338971 
-290034.926045  9113242.421278 
-289996.368653  9113270.508429 
-289966.675469  9113287.554864 
-289939.919732  9113298.577135 
-289919.357404  9113340.746184 
-289909.706529  9113379.912886 
-289890.493631  9113470.300738 
-289890.826929  9113515.504904 
-289891.086169  9113550.663700 
-289908.465263  9113615.975995 
-289931.697177  9113666.226351 
-289968.726321  9113700.418393 
-289993.724014  9113720.534639 
-290011.771276  9113741.648265 
-290029.892668  9113772.807240 
-290031.932510  9113779.841031 
-290038.133567  9113811.992302 
-290041.137747  9113815.008967 
-290162.788691  9114001.975669 
-290205.878632  9114049.232453 
-290282.497148  9114060.360350 
-290287.474496  9114061.369946 
-290337.151527  9114058.406925 
-290451.407882  9114051.491322 
-290460.353745  9114051.500399 
-290501.181350  9114061.587062 
-290512.181995  9114070.638944 
-290553.988755  9114078.717493 
-290607.738191  9114088.817127 
-290683.385010  9114102.956901 
-290721.230712  9114113.040333 
-290763.030074  9114120.114139 
-290802.886053  9114133.213093 
-290826.830859  9114145.291480 
-290854.766478  9114159.382911 
-290858.757282  9114161.395970 
-290880.706709  9114172.467792 
-290914.702900  9114199.624074 
-290942.787251  9114233.806057 
-290957.905209  9114261.947875 
-290967.993773  9114282.048456 
-290971.102129  9114299.128468 
-290979.366313  9114341.326729 
-290981.614536  9114376.487296 
-291070.064679  9114374.566735 
-291094.869766  9114368.564382 
-291117.701744  9114364.569093 
-291159.337653  9114349.542808 
-291186.063718  9114334.501628 
-291218.909938  9114340.561499 
-291223.857551  9114337.552862 
-291271.427530  9114318.514312 
-291309.820872  9114268.326426 
-291343.318644  9114228.178874 
-291227.629569  9114175.828565 
-291222.562933  9114162.764725 
-291219.447068  9114144.680219 
-291223.229568  9114118.566415 
-291223.948288  9114081.399812 
-291215.721189  9114044.224282 
-291199.557147  9114009.049867 
-291160.345676  9113948.739346 
-291130.176793  9113901.496610 
-291100.037721  9113858.271959 
-291076.878852  9113818.067839 
-291065.878200  9113809.016105 
-291034.827056  9113776.840222 
-290989.793412  9113735.609552 
-291016.340859  9113696.459798 
-291068.590326  9113638.249889 
-291105.077373  9113599.110084 
-291177.131665  9113530.874734 
-291239.357605  9113477.697322 
-291275.911309  9113447.598208 
-291342.120311  9113395.429211 
-291320.052245  9113368.285078 
-291420.811757  9113284.005832 
-291481.949467  9113352.374205 
-291592.581193  9113259.063803 
-291639.911700  9113207.880270 
-291651.712674  9113190.815140 
-291655.517301  9113167.714949 
-291736.169446  9113186.880823 
-291813.832302  9113205.039062 
-291892.220973  9113187.035182 
-291894.253585  9113193.064304 
-291931.272884  9113359.850969 
-291968.976368  9113350.847449 
-292036.528476  9113345.891339 
-292048.470916  9113347.912118 
-292085.284744  9113352.970887 
-292112.211150  9113365.051543 
-292140.124073  9113376.128630 
-292186.025248  9113400.282055 
-292219.042250  9113429.445396 
-292346.023145  9113396.420478 
-292315.711991  9113330.092764 
-292203.630249  9113093.921479 
-Region 1
-84
-290901.763761  9112584.336234 
-290874.051186  9112465.774254 
-290835.398545  9112480.802931 
-290725.686079  9112564.067115 
-290631.676109  9112485.618438 
-290618.695427  9112477.569002 
-290580.546962  9112560.905780 
-290527.748646  9112679.386035 
-290507.098078  9112709.500759 
-290448.617841  9112731.540632 
-290384.151550  9112750.560738 
-290292.966919  9112785.625831 
-290066.936927  9112865.755925 
-290047.131775  9112875.780821 
-290011.475070  9112892.821082 
-290002.559037  9112896.830009 
-289969.876774  9112912.868781 
-289958.972807  9112916.875651 
-289927.269663  9112930.906350 
-289890.589274  9112943.927361 
-289850.919563  9112955.940727 
-289792.334892  9112963.916370 
-289740.811544  9112985.962685 
-289737.844449  9112987.968672 
-289712.119749  9113004.014502 
-289706.185554  9113008.026473 
-289700.251357  9113012.038444 
-289693.323193  9113016.049383 
-289704.360419  9113030.124254 
-289717.474388  9113056.255639 
-289752.588880  9113100.491343 
-289766.615452  9113115.573813 
-289801.796668  9113168.850295 
-289837.029803  9113229.158490 
-289853.125837  9113255.292880 
-289869.845621  9113231.201423 
-289879.652032  9113213.130008 
-289887.470498  9113195.056542 
-289908.358657  9113197.087145 
-289943.073506  9113187.077637 
-289961.944095  9113185.088020 
-289978.804523  9113180.082739 
-289980.562849  9113148.944148 
-290004.403253  9113146.959636 
-290029.319105  9113156.026035 
-289939.919732  9113298.577135 
-289966.675469  9113287.554864 
-289996.368653  9113270.508429 
-290034.926045  9113242.421278 
-290060.591430  9113218.338971 
-290084.209578  9113186.218325 
-290143.031522  9113210.387395 
-290156.056860  9113224.464150 
-290175.023781  9113235.533407 
-290201.386565  9113171.270637 
-290217.831874  9113110.011290 
-290306.391154  9113123.160815 
-290309.269257  9113109.100375 
-290377.815747  9113104.147797 
-290401.745050  9113114.217499 
-290422.217833  9113059.993944 
-290418.078832  9113037.890129 
-290448.951008  9113045.957845 
-290482.723488  9113042.978702 
-290525.530637  9113052.063052 
-290535.448007  9113049.059571 
-290563.316048  9113054.110566 
-290632.819196  9113044.135972 
-290724.159743  9113030.165327 
-290730.116087  9113029.166842 
-290739.135963  9113039.221238 
-290763.154346  9113061.345129 
-290797.030701  9113072.429207 
-290834.400285  9113018.222685 
-290830.313073  9113003.150680 
-290834.103294  9112978.041397 
-290840.778871  9112939.876214 
-290866.443587  9112915.793589 
-290845.280919  9112876.595715 
-290829.095500  9112838.407389 
-290845.940787  9112831.392772 
-290943.014276  9112786.287354 
-290929.617634  9112721.984260 
-290901.763761  9112584.336234 
-Region 1
-104
-282859.930695  9118541.597145 
-282848.907977  9118529.529603 
-282837.834309  9118510.430045 
-282831.753102  9118494.349961 
-282824.648662  9118474.250430 
-282817.529673  9118452.141749 
-282811.346588  9118421.997631 
-282802.173875  9118390.845476 
-282791.861510  9118339.600692 
-282823.728609  9118210.048781 
-282232.132869  9118058.673124 
-282223.265719  9118069.712962 
-282220.377793  9118082.768958 
-282216.510275  9118097.832941 
-282211.670430  9118115.909487 
-282209.820199  9118134.994113 
-282204.000759  9118155.078647 
-282199.168171  9118174.159771 
-282184.532388  9118212.316182 
-282180.701175  9118232.403052 
-282173.880335  9118251.481842 
-282171.028713  9118269.560726 
-282164.236921  9118292.657825 
-282163.315433  9118302.702428 
-282159.433369  9118315.757260 
-282149.622883  9118333.827971 
-282128.906087  9118355.904142 
-282111.142592  9118373.965505 
-282094.344157  9118388.009723 
-282077.589285  9118408.081403 
-282061.792215  9118423.131361 
-282054.949526  9118439.196418 
-282036.199106  9118458.261175 
-282015.445895  9118475.314432 
-282005.591760  9118487.357666 
-281992.784281  9118503.415700 
-281989.976160  9118527.522060 
-282022.884043  9118541.624754 
-282056.749757  9118550.705700 
-282074.731217  9118562.781661 
-282087.785624  9118580.879239 
-282094.947906  9118609.015578 
-282105.157967  9118646.196611 
-282106.362760  9118675.330517 
-282111.587673  9118710.496553 
-282117.799467  9118744.659175 
-282127.030002  9118783.848176 
-282138.190701  9118815.002886 
-282158.393091  9118859.227573 
-282173.552182  9118893.400651 
-282187.789842  9118937.618322 
-282205.039023  9118985.857776 
-282225.263395  9119033.096124 
-282241.394952  9119064.256585 
-282256.539665  9119096.420448 
-282270.668453  9119125.569412 
-282291.741701  9119152.717337 
-282315.775581  9119176.854998 
-282343.720596  9119191.956094 
-282376.592690  9119201.035507 
-282398.500149  9119206.083858 
-282413.492273  9119217.151549 
-282431.459551  9119227.218128 
-282446.408038  9119232.258353 
-282467.314096  9119236.300935 
-282480.274306  9119241.338835 
-282488.227432  9119241.348080 
-282503.117715  9119238.351687 
-282528.914432  9119231.349693 
-282552.759244  9119229.368250 
-282580.580612  9119227.391410 
-282615.331836  9119221.404328 
-282649.110744  9119218.429791 
-282670.952691  9119214.436837 
-282696.778468  9119211.453053 
-282719.680068  9119216.502391 
-282736.631400  9119223.553962 
-282751.565331  9119226.584933 
-282753.407975  9119206.495766 
-282751.237659  9119181.379131 
-282752.115294  9119165.307107 
-282751.033781  9119153.251076 
-282748.899882  9119133.157306 
-282754.726361  9119114.077314 
-282756.576293  9119094.992720 
-282759.442204  9119078.922997 
-282761.284854  9119058.833830 
-282763.193034  9119047.785824 
-282764.085236  9119033.722947 
-282763.018293  9119023.676062 
-282761.871263  9119002.578870 
-282758.765092  9118985.497669 
-282781.477267  9118964.428096 
-282803.173445  9118940.343647 
-282811.989573  9118922.271681 
-282823.729839  9118896.166581 
-282835.506503  9118875.084345 
-282844.278921  9118850.984941 
-282854.981338  9118818.851252 
-282862.788740  9118798.768991 
-282870.632545  9118783.709594 
-282953.156106  9118648.188800 
-282877.985091  9118563.718469 
-282859.930695  9118541.597145 
-Region 1
-1416
-289305.633672  9120285.437156 
-289241.828346  9119992.050112 
-289200.436938  9119772.016161 
-289147.643972  9119623.292161 
-289109.333159  9119550.927067 
-289068.203442  9119500.658727 
-289026.064868  9119448.380238 
-288977.969159  9119397.100146 
-288973.050548  9119404.126854 
-288909.924626  9119336.758826 
-288835.856298  9119268.374939 
-288771.707008  9119196.987443 
-288701.548824  9119119.566440 
-288640.367456  9119046.172636 
-288576.107680  9118959.716588 
-288460.630678  9118802.890074 
-288330.050658  9118619.929483 
-288286.845737  9118557.603430 
-288256.519771  9118489.263485 
-288132.504225  9118117.455846 
-288104.181878  9118051.126827 
-288073.054785  9118008.903722 
-288043.967658  9117973.714477 
-288001.964892  9117939.516202 
-287946.074587  9117909.321448 
-287854.353068  9117873.061702 
-287775.569489  9117838.824450 
-287771.578393  9117836.811166 
-287706.763730  9117809.620260 
-287650.851570  9117776.411415 
-287647.854564  9117774.399169 
-287573.812889  9117709.025768 
-287504.690175  9117636.625630 
-287416.658083  9117561.191612 
-287399.685017  9117551.128156 
-287302.772909  9117484.725256 
-287296.778962  9117480.700700 
-287211.862360  9117423.351200 
-287137.866041  9117364.004094 
-287069.804884  9117300.645013 
-287031.669200  9117251.381511 
-287014.571126  9117224.240498 
-287005.388831  9117192.085262 
-286997.149083  9117152.899232 
-286996.957638  9117126.780906 
-287000.705661  9117095.644099 
-287010.307653  9117049.445438 
-287019.961176  9117010.278636 
-287039.525907  9116967.104314 
-287053.155667  9116927.941787 
-287051.844986  9116884.745034 
-287031.625017  9116838.514320 
-287012.472777  9116802.330167 
-286982.378524  9116765.129672 
-286943.300966  9116722.896744 
-286910.209926  9116683.683855 
-286904.194048  9116676.645557 
-286875.108751  9116641.455125 
-286860.065411  9116623.357084 
-286837.003395  9116596.209471 
-286812.954705  9116570.065317 
-286797.904060  9116550.962691 
-286771.845236  9116521.802694 
-286744.762973  9116488.623386 
-286718.726281  9116462.476999 
-286690.686801  9116434.319327 
-286673.611383  9116410.191713 
-286655.497821  9116380.035690 
-286635.344720  9116342.845619 
-286615.213708  9116308.669191 
-286590.974226  9116256.406454 
-286572.787311  9116216.204830 
-286559.622131  9116183.040482 
-286532.268406  9116112.692459 
-286507.035120  9116060.428541 
-286484.813432  9116012.186068 
-286468.688297  9115982.032068 
-286466.670821  9115978.011678 
-286437.557000  9115938.802548 
-286409.466652  9115903.612693 
-286386.390636  9115874.455581 
-286379.366230  9115865.406968 
-286355.303552  9115837.253297 
-286336.211131  9115809.105054 
-286311.139787  9115778.941145 
-286299.336034  9115796.005501 
-286285.558863  9115815.076786 
-286279.690009  9115828.129463 
-286260.957270  9115849.204402 
-286244.175910  9115865.258742 
-286225.428462  9115884.324562 
-286203.662160  9115898.364322 
-286181.859152  9115907.381295 
-286143.245360  9115928.434351 
-286122.436369  9115937.452395 
-286103.608130  9115945.468063 
-286088.748744  9115952.483546 
-286072.917312  9115962.511600 
-286055.090436  9115971.532903 
-286034.259393  9115977.537245 
-286011.469582  9115987.557615 
-285982.730121  9115999.580511 
-285953.983306  9116010.598836 
-285924.242422  9116021.616049 
-285895.502905  9116033.638901 
-285870.702919  9116040.643344 
-285840.983978  9116054.674185 
-285810.248969  9116065.690237 
-285779.528601  9116078.715388 
-285756.723997  9116086.726539 
-285733.912053  9116093.733122 
-285695.209879  9116102.731180 
-285652.480166  9116104.692885 
-285619.647033  9116100.638236 
-285598.786523  9116102.624170 
-285586.865183  9116103.615476 
-285560.040332  9116105.594765 
-285542.140003  9116104.570311 
-285524.239672  9116103.545849 
-285508.305479  9116099.509914 
-285485.361629  9116088.434307 
-285455.386166  9116067.305334 
-285442.316988  9116047.199734 
-285404.447706  9116034.098332 
-285360.643392  9116025.008476 
-285333.730702  9116014.932896 
-285303.843175  9116005.858523 
-285260.009613  9115992.750315 
-285220.159603  9115980.651072 
-285184.322409  9115973.579053 
-285141.512204  9115964.490076 
-285093.717102  9115953.386349 
-285037.026710  9115949.304447 
-284957.334120  9115926.110046 
-284872.715161  9115908.937259 
-284800.894716  9115874.701315 
-284745.987894  9115842.493476 
-284727.992633  9115828.409338 
-284712.986851  9115815.333131 
-284672.939820  9115776.110097 
-284646.941057  9115754.984952 
-284616.907685  9115725.818758 
-284580.895436  9115694.636633 
-284544.905136  9115666.468162 
-284509.879731  9115634.282521 
-284488.887868  9115618.185727 
-284474.883569  9115606.115103 
-284460.879277  9115594.044472 
-284424.867232  9115562.862171 
-284388.833344  9115528.666130 
-284362.834844  9115507.540754 
-284325.806997  9115473.343505 
-284300.809898  9115453.223781 
-284278.751202  9115427.080047 
-284251.744174  9115403.944309 
-284225.723928  9115379.805120 
-284194.660564  9115345.614542 
-284175.635157  9115326.506117 
-284159.504421  9115295.346292 
-284141.196096  9115238.065417 
-284134.940264  9115197.875868 
-284131.732179  9115166.730847 
-284116.486273  9115120.503608 
-284101.349723  9115089.344874 
-284085.233731  9115060.194122 
-284066.128357  9115030.035360 
-284040.130305  9115008.909690 
-284013.167377  9114991.801126 
-283987.264068  9114983.734804 
-283963.377979  9114979.689032 
-283933.534936  9114976.640936 
-283894.781946  9114978.605337 
-283878.891869  9114980.596112 
-283845.072657  9114977.543364 
-283833.144173  9114977.529580 
-283800.362680  9114980.505364 
-283769.561979  9114982.478856 
-283716.797747  9114971.367592 
-283691.873945  9114961.293097 
-283667.900529  9114945.192316 
-283633.007238  9114931.087972 
-283615.034474  9114920.016929 
-283600.058389  9114910.958480 
-283569.126745  9114894.849551 
-283559.135424  9114887.806003 
-283540.168651  9114876.733765 
-283527.173397  9114866.673026 
-283502.176945  9114846.552689 
-283504.245028  9114857.605287 
-283726.238849  9116136.669639 
-283721.501649  9116168.810136 
-283721.749359  9116202.965497 
-283734.006045  9116248.184854 
-283730.510667  9116314.481853 
-283724.604537  9116322.511544 
-283707.887493  9116347.606327 
-283691.141289  9116368.682830 
-283668.437923  9116390.757031 
-283644.704037  9116407.807232 
-283630.889007  9116421.855172 
-283624.003344  9116431.892851 
-283623.103974  9116444.951113 
-283626.202755  9116461.027668 
-283626.297461  9116474.087075 
-283625.376238  9116484.131628 
-283622.496007  9116498.192170 
-283608.702803  9116515.253821 
-283598.842184  9116526.292633 
-283578.097717  9116544.350828 
-283552.513963  9116580.485549 
-283539.714788  9116597.548337 
-283530.921051  9116618.633992 
-283532.126364  9116647.767677 
-283537.431834  9116693.983640 
-283547.664020  9116734.177907 
-283560.893046  9116776.384743 
-283574.486412  9116868.820065 
-283580.735084  9116908.005157 
-283597.984293  9116956.243953 
-283634.991364  9116987.427903 
-283685.959424  9117024.655205 
-283700.943612  9117034.718013 
-283708.925461  9117038.745415 
-283720.934689  9117049.809360 
-283728.960287  9117059.864172 
-283737.987266  9117070.924690 
-283745.011493  9117079.973788 
-283749.053462  9117089.019466 
-283757.115532  9117104.097113 
-283761.230425  9117123.188477 
-283766.302951  9117137.258134 
-283769.394597  9117152.330081 
-283771.477573  9117165.391752 
-283776.666791  9117195.534504 
-283776.776180  9117210.603034 
-283781.848727  9117224.672686 
-283781.928949  9117235.722940 
-283779.048780  9117249.783487 
-283777.169994  9117264.849740 
-283773.303025  9117279.913718 
-283765.547206  9117307.027968 
-283760.642383  9117316.063396 
-283746.870950  9117336.138836 
-283741.001200  9117349.191401 
-283735.138740  9117363.248534 
-283732.309606  9117384.341064 
-283734.421771  9117401.421010 
-283734.516578  9117414.480404 
-283735.569016  9117422.518093 
-283736.657920  9117435.578625 
-283737.768705  9117451.652862 
-283737.921864  9117472.748806 
-283738.981600  9117481.791062 
-283741.079194  9117496.861868 
-283741.166717  9117508.916693 
-283745.259801  9117524.994341 
-283745.391091  9117543.076577 
-283746.545655  9117565.178224 
-283744.644989  9117577.230774 
-283741.786695  9117594.305030 
-283735.931517  9117609.366738 
-283731.026671  9117618.402171 
-283727.108628  9117626.434173 
-283719.265245  9117641.493607 
-283715.354492  9117650.530177 
-283710.500696  9117666.597591 
-283705.625015  9117679.651299 
-283705.676072  9117686.683281 
-283705.778187  9117700.747244 
-283707.868504  9117714.813482 
-283708.957429  9117727.874013 
-283713.006776  9117737.924248 
-283719.058918  9117749.985893 
-283729.065586  9117759.038376 
-283738.056272  9117765.076014 
-283748.998687  9117766.093079 
-283762.930703  9117768.118116 
-283771.906801  9117772.146609 
-283780.897493  9117778.184236 
-283785.904483  9117783.212753 
-283793.937559  9117794.272083 
-283800.947350  9117801.312004 
-283813.980134  9117816.395273 
-283823.994131  9117826.452295 
-283834.037323  9117840.527586 
-283843.049929  9117849.578899 
-283855.059446  9117860.642745 
-283863.077957  9117869.692920 
-283869.130160  9117881.754530 
-283872.185457  9117891.803606 
-283874.239354  9117900.846981 
-283876.285953  9117908.885788 
-283875.364838  9117918.930333 
-283872.433617  9117925.958911 
-283870.496499  9117932.988621 
-283865.613561  9117945.037772 
-283855.752796  9117956.076694 
-283849.875747  9117968.124713 
-283845.014697  9117983.187568 
-283840.175541  9118001.264127 
-283834.320381  9118016.325850 
-283822.544365  9118037.408184 
-283731.774132  9117995.113129 
-283697.695369  9118093.521121 
-283687.768868  9118095.518905 
-283671.877709  9118097.509872 
-283657.996652  9118102.516813 
-283498.246360  9118006.900632 
-283453.209956  9118102.282319 
-283348.434736  9118047.915629 
-283328.494232  9118039.856196 
-283301.431601  9118146.308678 
-283167.109810  9118130.080944 
-283145.217473  9118127.041998 
-283079.576878  9118122.947950 
-283042.841923  9118266.558119 
-282823.728609  9118210.048781 
-282791.861510  9118339.600692 
-282802.173875  9118390.845476 
-282811.346588  9118421.997631 
-282817.529673  9118452.141749 
-282824.648662  9118474.250430 
-282831.753102  9118494.349961 
-282837.834309  9118510.430045 
-282848.907977  9118529.529603 
-282859.930695  9118541.597145 
-282877.985091  9118563.718469 
-282953.156106  9118648.188800 
-282870.632545  9118783.709594 
-282862.788740  9118798.768991 
-282854.981338  9118818.851252 
-282844.278921  9118850.984941 
-282835.506503  9118875.084345 
-282823.729839  9118896.166581 
-282811.989573  9118922.271681 
-282803.173445  9118940.343647 
-282781.477267  9118964.428096 
-282758.765092  9118985.497669 
-282761.871263  9119002.578870 
-282763.018293  9119023.676062 
-282764.085236  9119033.722947 
-282763.193034  9119047.785824 
-282761.284854  9119058.833830 
-282759.442204  9119078.922997 
-282756.576293  9119094.992720 
-282754.726361  9119114.077314 
-282748.899882  9119133.157306 
-282751.033781  9119153.251076 
-282752.115294  9119165.307107 
-282751.237659  9119181.379131 
-282753.407975  9119206.495766 
-282751.565331  9119226.584933 
-282736.631400  9119223.553962 
-282719.680068  9119216.502391 
-282696.778468  9119211.453053 
-282670.952691  9119214.436837 
-282649.110744  9119218.429791 
-282615.331836  9119221.404328 
-282580.580612  9119227.391410 
-282552.759244  9119229.368250 
-282528.914432  9119231.349693 
-282503.117715  9119238.351687 
-282488.227432  9119241.348080 
-282480.274306  9119241.338835 
-282467.314096  9119236.300935 
-282446.408038  9119232.258353 
-282431.459551  9119227.218128 
-282413.492273  9119217.151549 
-282398.500149  9119206.083858 
-282376.592690  9119201.035507 
-282343.720596  9119191.956094 
-282315.775581  9119176.854998 
-282291.741701  9119152.717337 
-282270.668453  9119125.569412 
-282256.539665  9119096.420448 
-282241.394952  9119064.256585 
-282225.263395  9119033.096124 
-282205.039023  9118985.857776 
-282187.789842  9118937.618322 
-282173.552182  9118893.400651 
-282158.393091  9118859.227573 
-282138.190701  9118815.002886 
-282127.030002  9118783.848176 
-282117.799467  9118744.659175 
-282111.587673  9118710.496553 
-282106.362760  9118675.330517 
-282105.157967  9118646.196611 
-282094.947906  9118609.015578 
-282087.785624  9118580.879239 
-282074.731217  9118562.781661 
-282056.749757  9118550.705700 
-282022.884043  9118541.624754 
-281989.976160  9118527.522060 
-281975.056979  9118526.499926 
-281957.155414  9118525.474275 
-281940.240716  9118523.445209 
-281919.378543  9118525.429763 
-281895.497686  9118522.387899 
-281892.420938  9118509.324861 
-281881.412945  9118499.266177 
-281875.433661  9118497.249983 
-281863.496867  9118496.231328 
-281852.575975  9118498.227580 
-281839.724885  9118508.258112 
-281830.901105  9118525.325389 
-281824.101865  9118547.417908 
-281823.180309  9118557.462523 
-281818.238691  9118561.474970 
-281798.406896  9118568.483543 
-281792.507428  9118577.517708 
-281786.622472  9118588.561032 
-281781.789699  9118607.642162 
-281772.965884  9118624.709438 
-281757.146861  9118636.745594 
-281740.384489  9118655.812627 
-281730.566520  9118672.878725 
-281726.648038  9118680.910659 
-281714.841794  9118697.974406 
-281703.971630  9118707.002691 
-281676.172167  9118711.992667 
-281662.297824  9118718.003678 
-281654.431809  9118730.049223 
-281654.482592  9118737.081281 
-281672.478582  9118751.166568 
-281644.686341  9118757.161111 
-281650.781737  9118775.250605 
-281638.815841  9118770.213589 
-281603.012464  9118768.162058 
-281590.959531  9118751.070067 
-281577.977750  9118743.018114 
-281566.991496  9118735.973092 
-281540.258639  9118751.009975 
-281536.383630  9118765.069384 
-281534.504144  9118780.135732 
-281534.663697  9118802.236500 
-281539.851961  9118832.379803 
-281529.867075  9118826.340536 
-281514.911506  9118820.295371 
-281500.942826  9118813.246799 
-281489.963811  9118807.206341 
-281479.057311  9118811.211686 
-281472.185367  9118823.258395 
-281475.247544  9118834.312322 
-281481.299387  9118846.374368 
-281483.352927  9118855.417953 
-281479.441641  9118864.454461 
-281470.537907  9118870.471328 
-281457.672119  9118878.492636 
-281440.735509  9118873.449669 
-281419.829598  9118869.406553 
-281401.942354  9118870.389876 
-281372.103694  9118868.345268 
-281354.223693  9118870.333153 
-281333.390266  9118876.335810 
-281316.540637  9118883.347772 
-281293.755155  9118894.370956 
-281272.979682  9118908.410243 
-281259.105202  9118914.421159 
-281245.172742  9118912.395416 
-281233.177839  9118903.339963 
-281225.195731  9118899.312157 
-281215.268821  9118901.309471 
-281196.452610  9118911.332772 
-281184.559149  9118916.341456 
-281171.671544  9118921.348952 
-281158.812915  9118930.374774 
-281158.878121  9118939.416015 
-281158.936081  9118947.452675 
-281159.037513  9118961.516828 
-281159.109965  9118971.562652 
-281158.144804  9118975.579795 
-281145.220954  9118975.564376 
-281137.325774  9118983.591545 
-281125.454019  9118991.613968 
-281120.526772  9118997.635530 
-281107.617402  9118999.629267 
-281101.616323  9118994.599232 
-281089.672119  9118992.575819 
-281070.805132  9118995.567004 
-281066.828559  9118995.562253 
-281051.923653  9118996.549016 
-281040.015662  9118999.548505 
-281031.075613  9119000.542392 
-281011.250680  9119008.555281 
-280991.461946  9119021.591080 
-280984.575354  9119031.628587 
-280977.667034  9119038.652344 
-280967.790761  9119047.681698 
-280961.847616  9119050.688310 
-280950.004769  9119062.729032 
-280948.088890  9119072.772487 
-280947.138192  9119078.798798 
-280950.185800  9119087.843620 
-280940.244341  9119087.831720 
-280929.330459  9119090.832378 
-280908.518555  9119099.848630 
-280897.698790  9119115.908871 
-280892.836660  9119130.971673 
-280892.930784  9119144.031263 
-280889.977303  9119148.046025 
-280882.074805  9119155.068584 
-280874.165063  9119161.086559 
-280869.201564  9119162.085187 
-280849.419959  9119176.125534 
-280834.543930  9119181.130577 
-280827.606608  9119184.135986 
-280810.771230  9119193.156976 
-280801.860083  9119198.169165 
-280784.045021  9119209.198124 
-280776.193161  9119223.252762 
-280775.249679  9119230.283660 
-280769.436782  9119251.372775 
-280763.580453  9119266.434384 
-280760.742765  9119286.522494 
-280754.908146  9119304.597857 
-280750.024247  9119316.646906 
-280744.160669  9119330.703931 
-280738.246422  9119337.728864 
-280729.385905  9119349.773140 
-280725.503387  9119362.827967 
-280730.604439  9119380.916456 
-280736.743081  9119405.033643 
-280724.726375  9119392.964312 
-280712.760341  9119387.927069 
-280703.798482  9119385.907158 
-280698.813239  9119383.892020 
-280681.890914  9119380.857968 
-280665.969981  9119378.829688 
-280657.000887  9119375.805182 
-280644.040707  9119370.766723 
-280636.036825  9119363.725066 
-280620.050775  9119352.655502 
-280602.163248  9119353.638562 
-280585.291576  9119357.636568 
-280563.485303  9119366.651512 
-280553.594402  9119373.671641 
-280537.760273  9119383.698343 
-280538.862938  9119398.768325 
-280537.941124  9119408.812985 
-280536.039623  9119420.865618 
-280524.203799  9119433.910866 
-280515.292566  9119438.923018 
-280506.345163  9119438.912240 
-280492.419747  9119437.890884 
-280478.508795  9119438.878696 
-280458.640138  9119440.863898 
-280443.720561  9119439.841329 
-280429.838533  9119444.847472 
-280407.001858  9119448.838227 
-280393.105357  9119451.835187 
-280384.150715  9119450.819799 
-280369.209439  9119446.783447 
-280360.247566  9119444.763467 
-280348.310453  9119443.744469 
-280336.380570  9119443.730054 
-280323.456529  9119443.714434 
-280316.504659  9119444.710609 
-280301.621219  9119448.710928 
-280298.631518  9119447.702735 
-280289.669645  9119445.682740 
-280282.659943  9119438.642214 
-280268.662230  9119427.574917 
-280262.653919  9119421.540176 
-280246.675131  9119411.475051 
-280231.704960  9119403.420297 
-280212.787075  9119399.379070 
-280206.771547  9119392.339732 
-280205.712350  9119383.297239 
-280194.661008  9119367.210587 
-280186.671628  9119362.178009 
-280178.653347  9119353.127078 
-280169.669816  9119348.093291 
-280155.701057  9119341.044297 
-280143.691712  9119329.979359 
-280130.680994  9119317.908621 
-280098.810228  9119309.833296 
-280041.141987  9119308.758650 
-280015.272272  9119305.713455 
-279994.387779  9119304.683470 
-279956.588192  9119301.623724 
-279936.640090  9119292.558210 
-279908.644894  9119270.423333 
-279880.584755  9119239.247127 
-279840.638107  9119214.083873 
-279815.654331  9119195.970914 
-279796.743747  9119192.934073 
-279771.882667  9119191.899115 
-279735.098945  9119191.854144 
-279695.361607  9119195.823855 
-279660.573389  9119196.785849 
-279631.786161  9119202.778080 
-279609.972438  9119210.788006 
-279589.188921  9119223.822098 
-279575.378911  9119238.873899 
-279562.627956  9119262.968239 
-279554.790085  9119279.031944 
-279545.950840  9119294.089839 
-279539.121541  9119312.163947 
-279525.318703  9119328.220335 
-279514.556025  9119352.317112 
-279505.760023  9119373.402554 
-279488.873724  9119375.390997 
-279470.128891  9119395.459642 
-279462.254920  9119406.500386 
-279433.575658  9119427.561409 
-279413.894294  9119455.665557 
-279409.060466  9119474.746697 
-279409.240710  9119499.861496 
-279391.439493  9119512.899207 
-279373.551756  9119513.881807 
-279360.649253  9119516.879696 
-279346.839086  9119531.931467 
-279341.998020  9119550.008017 
-279340.225951  9119580.143341 
-279333.490264  9119611.277147 
-279328.764534  9119645.427175 
-279332.878173  9119664.519318 
-279330.075900  9119689.630460 
-279315.358024  9119716.736123 
-279291.001210  9119786.022446 
-279271.420567  9119828.190885 
-279720.674826  9120919.716068 
-279649.006272  9120907.574044 
-279606.299319  9120913.549604 
-279587.496316  9120925.581707 
-279552.894523  9120952.663298 
-279513.292830  9120975.720456 
-279489.424932  9120974.686796 
-279451.732153  9120986.695835 
-279420.018960  9121000.721308 
-279404.111824  9121000.701899 
-279362.276194  9120989.600417 
-279338.364970  9120982.539129 
-279308.495791  9120976.475125 
-279282.610615  9120971.420557 
-279247.835395  9120974.391759 
-279217.123522  9120989.422913 
-279196.353598  9121004.466231 
-279171.686217  9121030.555188 
-279151.917669  9121046.604304 
-279133.172156  9121066.673005 
-279118.324086  9121075.696057 
-279099.484786  9121082.705042 
-279080.573360  9121079.668090 
-279070.602518  9121075.637518 
-279053.643436  9121067.580027 
-279030.762427  9121065.542764 
-279019.891127  9121074.570672 
-279001.080643  9121085.597994 
-278990.504947  9121135.814234 
-278979.741775  9121159.911043 
-278967.011819  9121187.019189 
-278949.202690  9121199.052319 
-278927.272553  9121190.988678 
-278922.114105  9121164.863123 
-278921.011771  9121149.792991 
-278905.111748  9121150.778016 
-278898.109084  9121144.741888 
-278884.197464  9121145.729352 
-278869.392549  9121160.779906 
-278857.555817  9121173.824942 
-278845.661420  9121178.833222 
-278805.842852  9121171.752067 
-278792.954243  9121176.759109 
-278779.971954  9121168.706417 
-278753.157290  9121172.691689 
-278738.265854  9121175.687075 
-278721.422031  9121183.702977 
-278707.589630  9121195.740937 
-278696.703814  9121202.759601 
-278681.884400  9121215.800924 
-278667.951127  9121213.774543 
-278654.940026  9121201.703431 
-278643.946152  9121193.653153 
-278629.991276  9121188.612971 
-278606.231201  9121202.647807 
-278731.220286  9121440.889096 
-278718.410863  9121456.946682 
-278845.440395  9121702.221921 
-278871.311599  9121705.267456 
-279570.061479  9123062.304523 
-279592.777067  9123041.235707 
-279594.678730  9123029.183032 
-279608.489554  9123014.130966 
-279620.311892  9122999.076502 
-279638.135826  9122989.052167 
-279653.013217  9122984.047180 
-279663.942596  9122983.055758 
-279674.871974  9122982.064333 
-279703.871306  9123005.204564 
-279727.711303  9123002.219492 
-279750.491915  9122990.191919 
-279762.386573  9122985.183315 
-279785.254026  9122985.210787 
-279803.077904  9122975.186398 
-279806.975223  9122964.140704 
-279811.874016  9122954.100792 
-279818.761279  9122944.063268 
-279829.582048  9122928.002990 
-279853.443699  9122928.031628 
-279891.202920  9122925.063185 
-279902.146747  9122926.080885 
-279919.005297  9122920.073621 
-279932.859413  9122911.049015 
-279939.746641  9122901.011480 
-279954.479115  9122875.914665 
-279968.246309  9122854.835007 
-279979.110454  9122844.802234 
-279990.976070  9122835.775238 
-280000.874942  9122829.759620 
-280012.726064  9122818.723445 
-280019.598777  9122806.676732 
-280022.509047  9122796.634433 
-280032.320994  9122778.563768 
-280035.216774  9122766.512296 
-280036.116851  9122753.453856 
-280034.012509  9122737.378086 
-280029.926952  9122722.304521 
-280022.858711  9122707.227384 
-280022.822500  9122702.204449 
-280049.456664  9122673.103568 
-280089.008515  9122643.013557 
-280105.823467  9122630.978736 
-280117.674517  9122619.942552 
-280133.495226  9122607.906536 
-280150.360862  9122602.903808 
-280169.214945  9122597.903452 
-280188.076268  9122593.907674 
-280214.913131  9122592.935144 
-280244.790637  9122600.002844 
-280269.689771  9122606.060009 
-280303.580428  9122618.155336 
-280318.530061  9122623.196034 
-280341.404512  9122624.227858 
-280357.312129  9122624.246801 
-280380.193826  9122626.283190 
-280390.121586  9122624.285851 
-280403.982749  9122616.265732 
-280412.822029  9122601.207604 
-280414.759729  9122594.177875 
-280412.706030  9122585.134246 
-280403.642011  9122569.050242 
-280396.595446  9122556.986941 
-280393.525781  9122544.928372 
-280398.359165  9122525.847174 
-280402.270817  9122516.810643 
-280409.092643  9122497.731812 
-280412.997041  9122487.690697 
-280419.876857  9122476.648545 
-280430.726309  9122464.606541 
-280451.597723  9122463.626794 
-280465.538583  9122466.657101 
-280476.467774  9122465.665520 
-280491.315845  9122456.641987 
-280498.217389  9122448.613583 
-280508.116096  9122442.597892 
-280525.975821  9122437.596232 
-280541.897861  9122439.624295 
-280554.837238  9122441.648810 
-280568.734574  9122438.651582 
-280561.637235  9122419.556223 
-280559.576273  9122409.508021 
-280556.455825  9122390.417381 
-280554.213574  9122355.254574 
-280554.191819  9122352.240822 
-280556.035225  9122332.151500 
-280566.841098  9122314.081976 
-280580.673128  9122302.043497 
-280586.587671  9122295.018492 
-280597.437038  9122282.976469 
-280604.316784  9122271.934308 
-280614.142915  9122255.872767 
-280623.947283  9122236.797475 
-280631.719698  9122211.692319 
-280637.510930  9122187.589388 
-280636.407928  9122172.519452 
-280636.320900  9122160.464446 
-280629.259869  9122146.392011 
-280616.204553  9122128.294153 
-280608.149321  9122114.220531 
-280609.970966  9122091.117462 
-280612.837584  9122075.047661 
-280611.727351  9122058.973137 
-280610.609870  9122041.894028 
-280618.447547  9122025.830134 
-280629.340366  9122019.815624 
-280651.162254  9122012.809515 
-280673.978343  9122005.804579 
-280693.811791  9121998.796093 
-280718.630789  9121993.802664 
-280733.551198  9121994.824934 
-280753.457165  9121997.862258 
-280773.392150  9122004.917905 
-280795.308305  9122010.971314 
-280811.280968  9122020.031397 
-280826.252169  9122028.085714 
-280857.043668  9122024.103852 
-280874.823345  9122008.051697 
-280882.697198  9121997.010696 
-280885.600002  9121985.963815 
-280893.415796  9121966.886154 
-280902.218536  9121946.805085 
-280912.051763  9121931.748104 
-280922.929992  9121923.724374 
-280937.785048  9121915.705342 
-280950.673456  9121910.697703 
-280957.618391  9121908.696761 
-280970.463245  9121897.661626 
-280977.299303  9121880.591951 
-280977.146883  9121859.495729 
-280976.029292  9121842.416660 
-280972.908777  9121823.326077 
-280969.817297  9121808.253822 
-280966.682276  9121787.154073 
-280972.509611  9121768.074063 
-280972.473324  9121763.051152 
-281004.186236  9121749.024594 
-281036.973172  9121746.049591 
-281061.806474  9121743.065182 
-281086.654289  9121742.089922 
-281102.641396  9121753.159077 
-281128.483413  9121752.184966 
-281141.400789  9121751.195614 
-281160.297902  9121752.222448 
-281178.258907  9121761.284750 
-281194.209725  9121767.330961 
-281215.138822  9121774.387595 
-281228.077986  9121776.411960 
-281242.018615  9121779.442070 
-281267.889680  9121782.486199 
-281281.830311  9121785.516297 
-281292.810128  9121791.556627 
-281302.861129  9121806.637008 
-281308.971648  9121826.735617 
-281308.144544  9121849.839794 
-281305.263645  9121863.900415 
-281310.372709  9121882.993273 
-281312.462836  9121897.059729 
-281320.467337  9121904.101124 
-281333.341141  9121897.084229 
-281344.190199  9121885.042099 
-281355.031986  9121871.995387 
-281365.881033  9121859.953255 
-281379.749020  9121852.937517 
-281391.635862  9121846.924025 
-281406.534379  9121844.932345 
-281423.435836  9121844.952149 
-281443.341705  9121847.989178 
-281464.249047  9121852.031940 
-281493.175439  9121865.125211 
-281514.126407  9121875.195422 
-281537.065789  9121885.267945 
-281554.990536  9121889.307174 
-281587.617461  9121864.231031 
-281597.479501  9121853.192277 
-281614.242777  9121834.125018 
-281636.956704  9121813.055562 
-281658.756408  9121803.035301 
-281675.614187  9121797.027546 
-281681.521208  9121788.997878 
-281686.375841  9121772.930425 
-281685.301638  9121761.878907 
-281687.064576  9121730.739304 
-281705.787080  9121707.656039 
-281717.717465  9121707.669950 
-281756.440291  9121700.683093 
-281776.375179  9121707.738298 
-281810.185196  9121708.782228 
-281837.108583  9121719.863812 
-281854.046336  9121724.906354 
-281878.966786  9121733.976441 
-281899.939559  9121747.060200 
-281915.926793  9121758.129021 
-281935.934501  9121775.229911 
-281953.961104  9121793.333058 
-281973.917884  9121803.401888 
-281998.874789  9121817.494775 
-282010.834305  9121821.526908 
-282030.798386  9121832.600283 
-282049.790120  9121846.686224 
-282076.699054  9121855.758479 
-282095.661678  9121865.826092 
-282123.564827  9121874.899465 
-282155.386512  9121875.940809 
-282174.312733  9121880.985507 
-282189.225732  9121881.002728 
-282209.058733  9121873.993655 
-282222.977528  9121874.009718 
-282246.838316  9121874.037245 
-282268.710702  9121874.062467 
-282288.594687  9121874.085387 
-282308.456809  9121871.094574 
-282334.233104  9121861.078602 
-282348.086292  9121852.053459 
-282357.984546  9121846.037458 
-282373.745947  9121825.964281 
-282394.471032  9121804.892248 
-282414.245636  9121789.846510 
-282429.049244  9121774.795050 
-282449.861757  9121765.777890 
-282470.659679  9121754.751574 
-282498.467992  9121750.765260 
-282522.277641  9121743.760644 
-282551.050962  9121735.757149 
-282578.837367  9121728.757072 
-282607.617953  9121721.758119 
-282625.491567  9121718.764911 
-282649.359516  9121719.796820 
-282663.300112  9121722.826479 
-282671.312019  9121730.872167 
-282685.340156  9121745.956688 
-282698.374108  9121761.040065 
-282716.386339  9121777.133694 
-282736.423453  9121798.252447 
-282751.475016  9121817.356362 
-282764.487120  9121829.425993 
-282780.408845  9121831.453305 
-282788.362410  9121831.462387 
-282801.367228  9121842.527432 
-282812.420153  9121858.613063 
-282831.390162  9121869.684902 
-282846.339599  9121874.724768 
-282861.252542  9121874.741770 
-282874.177091  9121874.756501 
-282886.056343  9121867.738097 
-282891.919318  9121853.680895 
-282894.690206  9121824.551724 
-282899.558981  9121810.493390 
-282904.427754  9121796.435055 
-282910.298019  9121783.382425 
-282913.178401  9121769.321826 
-282914.106895  9121760.281817 
-282936.863835  9121745.239298 
-282955.731596  9121742.247096 
-282976.587739  9121739.257150 
-282991.464119  9121734.251267 
-283010.280754  9121724.227049 
-283029.090078  9121713.198255 
-283035.991001  9121705.169603 
-283044.887607  9121698.147782 
-283058.777074  9121694.145322 
-283082.637659  9121694.172436 
-283099.546209  9121695.196204 
-283129.364630  9121694.225498 
-283149.255748  9121695.252632 
-283161.186036  9121695.266167 
-283184.132778  9121706.342368 
-283197.093786  9121711.379868 
-283218.044854  9121721.449224 
-283248.959760  9121734.543534 
-283272.849572  9121738.588821 
-283294.736387  9121740.622706 
-283319.671553  9121751.701074 
-283331.645698  9121757.741975 
-283346.675514  9121773.831930 
-283358.708146  9121787.909371 
-283368.796263  9121808.011974 
-283384.834924  9121826.112169 
-283403.826930  9121840.197447 
-283474.473080  9121848.313579 
-283525.352410  9121872.480306 
-283549.366633  9121893.603074 
-283564.352675  9121903.665522 
-283592.329072  9121922.783596 
-283613.302239  9121935.866427 
-283623.310021  9121944.918697 
-283637.301899  9121954.979996 
-283655.321779  9121972.077721 
-283664.306112  9121977.110595 
-283675.293470  9121984.154831 
-283694.270977  9121996.230815 
-283708.218971  9122000.264684 
-283726.158382  9122006.312137 
-283760.019544  9122014.386526 
-283785.919837  9122021.447422 
-283805.847648  9122027.497064 
-283834.715890  9122032.552132 
-283852.669962  9122040.608660 
-283869.629846  9122048.664069 
-283884.564730  9122051.694421 
-283900.501134  9122055.730443 
-283915.421373  9122056.751653 
-283958.208349  9122061.822165 
-283979.123052  9122066.868265 
-284002.048123  9122074.930264 
-284020.981769  9122080.978692 
-284032.005822  9122093.045647 
-284038.117520  9122113.143584 
-284040.186503  9122124.196011 
-284043.220376  9122131.231283 
-284062.234649  9122148.329899 
-284081.256264  9122166.433068 
-284089.283111  9122176.487555 
-284112.494068  9122223.727492 
-284120.579567  9122241.818484 
-284125.726457  9122265.933548 
-284134.820829  9122286.034766 
-284146.890477  9122305.134725 
-284170.912515  9122327.261602 
-284183.903079  9122336.317008 
-284207.807843  9122342.370836 
-284227.699154  9122343.397426 
-284242.590140  9122340.400250 
-284260.500383  9122342.429188 
-284273.461631  9122347.466309 
-284293.396940  9122354.520251 
-284331.249835  9122364.607653 
-284350.198290  9122372.665030 
-284364.168421  9122379.712345 
-284387.071675  9122384.760407 
-284398.015199  9122385.777040 
-284425.860104  9122386.812316 
-284453.682993  9122384.833888 
-284474.517136  9122378.829525 
-284498.333866  9122372.828439 
-284524.153660  9122368.838656 
-284547.985051  9122364.846672 
-284572.788613  9122357.842084 
-284597.584824  9122349.832923 
-284622.395704  9122343.832873 
-284653.157072  9122335.830241 
-284681.988767  9122335.861898 
-284704.891993  9122340.909798 
-284725.843544  9122350.978309 
-284738.819500  9122358.024407 
-284763.755193  9122369.101817 
-284784.670043  9122374.147492 
-284808.560139  9122378.191860 
-284837.421219  9122382.241654 
-284844.402632  9122385.262948 
-284867.386692  9122401.360918 
-284885.385088  9122415.444320 
-284897.425659  9122430.525755 
-284909.502976  9122450.629986 
-284915.651857  9122475.750496 
-284921.727266  9122490.825406 
-284933.819312  9122512.938742 
-284943.952369  9122539.068142 
-284948.024703  9122552.131755 
-284964.100933  9122575.253972 
-284990.111834  9122597.382453 
-285011.122353  9122615.487263 
-285030.195945  9122640.621809 
-285044.372071  9122675.796524 
-285044.467645  9122688.855791 
-285048.488566  9122694.887471 
-285054.542005  9122706.948667 
-285062.576501  9122718.007465 
-285070.611001  9122729.066260 
-285088.646360  9122748.172328 
-285099.656129  9122758.229797 
-285114.613300  9122764.273346 
-285135.623947  9122782.378067 
-285148.636851  9122794.446794 
-285165.655997  9122810.538063 
-285182.689868  9122828.638438 
-285191.696554  9122836.684603 
-285211.713059  9122854.788196 
-285222.818518  9122877.904875 
-285226.905694  9122892.977551 
-285236.980181  9122911.070357 
-285260.973563  9122929.178220 
-285276.917652  9122934.218214 
-285296.875362  9122944.285290 
-285310.831045  9122949.323121 
-285333.734586  9122954.370613 
-285352.639224  9122956.400127 
-285371.529141  9122956.420519 
-285385.448026  9122956.435540 
-285427.256206  9122963.512473 
-285446.138756  9122962.528277 
-285459.033981  9122958.523977 
-285478.837101  9122947.495273 
-285484.736065  9122938.460689 
-285494.619210  9122930.434943 
-285512.433898  9122919.404088 
-285523.318602  9122912.383965 
-285550.073746  9122900.358172 
-285573.912544  9122897.370165 
-285589.849263  9122901.405489 
-285620.772697  9122915.502386 
-285636.775719  9122928.578693 
-285649.759304  9122936.629013 
-285668.730219  9122947.699394 
-285689.674817  9122956.762787 
-285697.665291  9122961.794092 
-285713.646243  9122971.856697 
-285728.632997  9122981.918229 
-285754.526533  9122987.973246 
-285771.435382  9122988.995895 
-285796.275756  9122987.013383 
-285817.117196  9122982.012942 
-285834.953905  9122973.995640 
-285849.785881  9122962.961482 
-285858.637887  9122949.911836 
-285866.503057  9122937.865683 
-285872.320847  9122917.780969 
-285873.167623  9122897.690944 
-285883.985903  9122881.629760 
-285891.851058  9122869.583606 
-285904.709330  9122860.556425 
-285917.574968  9122852.533795 
-285935.448467  9122849.539240 
-285953.344079  9122849.558341 
-285972.226517  9122848.573942 
-285996.035713  9122841.567513 
-286001.971419  9122837.555658 
-286025.721608  9122822.512788 
-286042.549256  9122812.485262 
-286061.402169  9122807.482616 
-286084.246622  9122804.493304 
-286096.221263  9122810.533322 
-286123.094140  9122814.580095 
-286141.026604  9122819.621891 
-286160.984355  9122829.688556 
-286181.892046  9122833.728950 
-286199.750738  9122828.725193 
-286216.556200  9122815.683954 
-286237.301550  9122797.624169 
-286249.128621  9122783.573095 
-286269.881323  9122766.517855 
-286290.685666  9122756.494473 
-286316.460980  9122746.476353 
-286331.359166  9122744.483051 
-286346.190923  9122733.448778 
-286368.887664  9122710.368302 
-286380.699909  9122694.308105 
-286385.560164  9122679.245092 
-286401.371318  9122666.202758 
-286411.261588  9122659.181418 
-286422.175577  9122656.179334 
-286436.020470  9122646.148543 
-286454.836323  9122636.123006 
-286480.648432  9122631.127574 
-286497.557098  9122632.149983 
-286513.471569  9122633.171336 
-286530.402385  9122637.207385 
-286539.394428  9122643.244136 
-286557.393290  9122657.326731 
-286570.487662  9122680.445030 
-286585.511352  9122695.529014 
-286594.569886  9122710.606703 
-286613.555599  9122723.685763 
-286625.567186  9122734.748383 
-286644.493818  9122739.791023 
-286658.434704  9122742.819323 
-286683.208298  9122731.795421 
-286703.010908  9122720.766282 
-286713.895319  9122713.745931 
-286728.778667  9122709.743407 
-286741.636679  9122700.716040 
-286750.495746  9122688.670845 
-286783.141530  9122666.605212 
-286832.718100  9122648.575494 
-286842.652625  9122647.581373 
-286852.542801  9122640.559955 
-286869.421877  9122637.564028 
-286879.319438  9122631.547155 
-286898.149928  9122623.530558 
-286914.977244  9122613.502774 
-286931.789767  9122601.465889 
-286946.628686  9122591.436015 
-286964.391020  9122573.372870 
-286981.159151  9122555.308682 
-286996.947869  9122539.252548 
-287009.813164  9122531.229678 
-287025.616651  9122517.182635 
-287044.417480  9122505.147802 
-287061.252109  9122496.124531 
-287076.090962  9122486.094630 
-287093.949345  9122481.090579 
-287109.856329  9122481.107187 
-287124.791315  9122484.136394 
-287136.721552  9122484.148842 
-287157.577274  9122481.156976 
-287167.489547  9122477.149152 
-287177.372228  9122469.123137 
-287188.212104  9122456.075419 
-287200.083147  9122448.051473 
-287219.848481  9122431.999433 
-287231.667724  9122416.943651 
-287251.484823  9122407.923433 
-287267.376971  9122405.930897 
-287282.274932  9122403.937322 
-287294.227337  9122406.963375 
-287305.148560  9122404.965656 
-287327.035402  9122406.997491 
-287345.917491  9122406.012576 
-287362.811211  9122405.025588 
-287380.684308  9122402.030534 
-287409.523024  9122403.065008 
-287426.394528  9122399.064359 
-287438.258100  9122390.035819 
-287447.161327  9122384.017822 
-287456.027538  9122372.977094 
-287461.933407  9122364.946911 
-287466.815480  9122352.897513 
-287470.681160  9122337.833446 
-287488.420954  9122316.756533 
-287495.283975  9122303.704650 
-287513.119994  9122295.686826 
-287520.079256  9122295.694036 
-287539.948052  9122293.705537 
-287566.783508  9122292.728778 
-287593.633771  9122293.761095 
-287640.382437  9122296.823034 
-287660.295658  9122300.861754 
-287685.202000  9122307.919230 
-287710.086123  9122311.963056 
-287727.009401  9122314.994122 
-287753.881885  9122319.039974 
-287764.817860  9122319.051244 
-287783.736908  9122323.088880 
-287799.680830  9122328.127982 
-287814.652807  9122336.179686 
-287821.619475  9122337.191392 
-287840.590409  9122348.260810 
-287849.567672  9122352.288188 
-287867.588909  9122369.383831 
-287877.597419  9122378.434942 
-287892.673199  9122400.550224 
-287899.699178  9122409.598264 
-287909.744769  9122423.672082 
-287917.831658  9122441.762030 
-287926.838600  9122449.807560 
-287929.843385  9122452.824250 
-287937.863563  9122461.873301 
-287946.870512  9122469.918825 
-287956.849402  9122474.951737 
-287965.848942  9122481.992713 
-287972.860120  9122489.031649 
-287983.803537  9122490.047399 
-287998.723683  9122491.067221 
-288004.755516  9122500.114218 
-288008.828650  9122513.177349 
-288013.895970  9122526.241497 
-288018.963294  9122539.305643 
-288026.953839  9122544.336498 
-288030.952820  9122547.354197 
-288034.951802  9122550.371895 
-288046.956168  9122560.429528 
-288052.936102  9122562.444715 
-288078.725523  9122554.434806 
-288096.531799  9122542.398588 
-288107.363953  9122528.346170 
-288110.138794  9122500.222031 
-288099.128619  9122490.165429 
-288091.093574  9122479.107331 
-288087.072345  9122473.076010 
-288093.007762  9122469.063939 
-288107.890805  9122465.061015 
-288119.731959  9122453.018699 
-288128.508968  9122429.923369 
-288130.400894  9122416.866351 
-288133.383433  9122416.869399 
-288139.355929  9122417.880036 
-288159.313707  9122427.945768 
-288168.253906  9122426.950363 
-288184.027235  9122408.884845 
-288187.900084  9122394.825316 
-288194.792563  9122385.791541 
-288206.663351  9122377.767381 
-288212.621002  9122376.768925 
-288221.605706  9122381.800763 
-288230.620091  9122390.850766 
-288240.636080  9122400.906321 
-288258.605503  9122410.969979 
-288270.550491  9122412.991219 
-288277.517164  9122414.002850 
-288288.475396  9122417.027614 
-288299.411362  9122417.038750 
-288310.317641  9122413.031719 
-288322.121609  9122395.966660 
-288325.029922  9122385.924283 
-288333.858768  9122369.860730 
-288340.714099  9122355.804235 
-288356.799078  9122379.929406 
-288363.780590  9122382.950107 
-288382.536347  9122364.887576 
-288386.431400  9122353.841668 
-288394.340275  9122347.822508 
-288402.323383  9122351.848755 
-288409.379130  9122364.914858 
-288423.282760  9122362.919916 
-288433.135438  9122350.875526 
-288439.041103  9122342.845258 
-288447.988691  9122342.854344 
-288457.997277  9122351.905302 
-288473.941227  9122356.944149 
-288484.877168  9122356.955244 
-288498.758511  9122351.946660 
-288515.600099  9122343.927476 
-288522.433087  9122326.857347 
-288524.302622  9122310.786720 
-288523.152502  9122289.690367 
-288520.036314  9122271.605618 
-288529.918651  9122263.579377 
-288539.875245  9122265.598537 
-288557.852072  9122276.666615 
-288570.768912  9122275.675170 
-288586.579146  9122262.632262 
-288591.579725  9122266.655455 
-288596.647151  9122279.719507 
-288604.697103  9122292.786576 
-288614.846831  9122320.923750 
-288632.801408  9122328.978170 
-288636.852395  9122339.027588 
-288636.896967  9122345.054826 
-288642.943737  9122356.110793 
-288641.074247  9122372.181415 
-288641.215398  9122391.267667 
-288643.344904  9122410.355928 
-288652.389077  9122423.423984 
-288666.411573  9122437.501598 
-288683.364597  9122444.550441 
-288700.302765  9122449.590198 
-288710.214815  9122445.582075 
-288719.088100  9122435.545711 
-288726.959773  9122424.503805 
-288739.765168  9122408.444218 
-288744.661736  9122398.403841 
-288753.572162  9122393.390170 
-288765.517136  9122395.411277 
-288776.453070  9122395.422300 
-288788.427773  9122401.461556 
-288794.377963  9122399.458488 
-288807.265084  9122394.448814 
-288818.104388  9122381.400826 
-288830.961768  9122372.372993 
-288838.870569  9122366.353769 
-288858.694595  9122358.337474 
-288868.524834  9122343.279402 
-288877.435232  9122338.265712 
-288887.391840  9122340.284789 
-288904.240756  9122333.270017 
-288902.118590  9122315.186331 
-288900.011296  9122299.111720 
-288902.845131  9122279.023956 
-288919.649416  9122265.981955 
-288932.566220  9122264.990410 
-288940.482423  9122259.975714 
-288958.295730  9122248.943778 
-288978.179162  9122248.963751 
-288994.071035  9122246.970647 
-289001.022798  9122245.973095 
-289016.907230  9122242.975447 
-289035.789045  9122241.989859 
-289049.640506  9122232.962981 
-289050.471062  9122210.864155 
-289054.351062  9122197.809157 
-289064.181205  9122182.751065 
-289074.093152  9122178.742884 
-289085.029016  9122178.753846 
-289102.924065  9122178.771778 
-289116.849874  9122179.790258 
-289126.724621  9122170.759381 
-289132.600373  9122158.710910 
-289143.372579  9122136.622047 
-289166.030154  9122108.517903 
-289184.807746  9122093.468754 
-289204.646449  9122087.461424 
-289213.534432  9122079.434080 
-289224.433064  9122074.422331 
-289237.334907  9122071.421641 
-289259.109835  9122058.384525 
-289280.832662  9122038.315647 
-289301.546421  9122016.236698 
-289320.346250  9122004.201120 
-289335.251274  9122003.211465 
-289354.177608  9122008.252987 
-289376.954070  9121996.221356 
-289385.864330  9121991.207596 
-289409.642380  9121980.181480 
-289416.407990  9121954.070487 
-289411.273421  9121931.965752 
-289406.101645  9121904.838336 
-289393.970749  9121877.703979 
-289392.879834  9121864.644024 
-289400.795909  9121859.629275 
-289413.638127  9121848.592268 
-289419.469117  9121830.516572 
-289421.293693  9121808.418771 
-289427.132121  9121791.347612 
-289432.948217  9121771.262847 
-289431.812645  9121752.175680 
-289417.738137  9121731.066553 
-289404.717336  9121717.994696 
-289400.651403  9121705.936300 
-289401.571142  9121695.891934 
-289402.416465  9121675.802211 
-289401.251151  9121652.696895 
-289394.195319  9121639.630983 
-289380.187841  9121627.562654 
-289366.187811  9121616.498856 
-289363.108618  9121603.436908 
-289374.867349  9121580.344500 
-289386.618630  9121556.247555 
-289396.456001  9121542.193983 
-289410.232776  9121523.121702 
-289421.064287  9121509.069121 
-289430.961170  9121503.051832 
-289441.852203  9121497.035533 
-289456.719842  9121491.023201 
-289468.582694  9121481.994283 
-289476.468932  9121472.961397 
-289481.395039  9121466.939142 
-289479.235566  9121443.832843 
-289479.138819  9121430.773882 
-289479.064400  9121420.728527 
-289489.888427  9121405.671404 
-289496.825154  9121402.664739 
-289514.734746  9121404.691653 
-289528.667736  9121406.714597 
-289539.536401  9121397.684678 
-289546.465679  9121393.673471 
-289305.633672  9120285.437156 
-Region 1
-165
-284875.115311  9113367.414495 
-284866.089074  9113356.354074 
-284844.053326  9113333.224117 
-284824.027478  9113313.110110 
-284802.978478  9113288.976694 
-284783.946666  9113268.863796 
-284755.917854  9113241.708691 
-284748.901542  9113233.664204 
-284739.889947  9113224.612873 
-284717.868910  9113203.491953 
-284689.891206  9113183.368746 
-284664.866356  9113159.230673 
-284640.857393  9113138.107418 
-284613.851891  9113114.971588 
-284589.872123  9113097.866559 
-284568.859782  9113078.755808 
-284545.866755  9113060.647323 
-284522.895602  9113045.552521 
-284502.855452  9113023.429171 
-284487.814426  9113005.329799 
-284471.772135  9112986.224707 
-284455.700726  9112963.101338 
-284445.636986  9112946.012239 
-284436.487138  9112917.874045 
-284425.385734  9112894.756388 
-284414.160553  9112854.561083 
-284403.980359  9112821.398888 
-284394.837861  9112794.265239 
-284388.713747  9112772.157868 
-284376.596589  9112746.025332 
-284368.702922  9112754.052681 
-284360.867494  9112770.116569 
-284350.013692  9112781.154172 
-284333.159550  9112787.162039 
-284314.295584  9112790.153897 
-284295.468008  9112798.168587 
-284277.648971  9112808.193558 
-284275.733775  9112818.236936 
-284277.881885  9112840.339733 
-284276.967959  9112851.388830 
-284265.032784  9112850.370455 
-284243.143140  9112847.331430 
-284236.250700  9112856.364485 
-284224.439242  9112872.423760 
-284211.611951  9112885.468177 
-284182.924430  9112904.521569 
-284166.113867  9112916.556801 
-284149.281466  9112925.578323 
-284119.519860  9112933.580278 
-284112.649209  9112945.627029 
-284096.730750  9112943.599432 
-284073.839781  9112939.554610 
-284046.029760  9112942.535986 
-284017.225736  9112945.516189 
-283994.334763  9112941.471326 
-283967.475084  9112938.426393 
-283940.579047  9112930.358594 
-283905.701973  9112918.263232 
-283868.851463  9112908.174660 
-283835.998749  9112901.104406 
-283823.164044  9112913.144171 
-283829.295206  9112936.256251 
-283818.353985  9112935.238921 
-283790.391275  9112917.124160 
-283775.452272  9112913.088463 
-283757.582158  9112916.081272 
-283744.711087  9112923.098166 
-283717.967667  9112936.126215 
-283695.069423  9112931.076621 
-283680.108618  9112924.027179 
-283645.326015  9112924.991026 
-283633.463443  9112934.018201 
-283606.661855  9112939.009620 
-283588.900663  9112957.070943 
-283549.278767  9112976.111193 
-283515.562722  9112987.121838 
-283487.650883  9112976.038875 
-283455.842935  9112976.001516 
-283435.933921  9112971.959866 
-283412.056175  9112968.918103 
-283391.189464  9112969.898126 
-283360.469871  9112982.921318 
-283348.599952  9112990.943862 
-283353.606244  9112995.972577 
-283411.012051  9113099.510212 
-283515.899051  9113308.582556 
-283618.748309  9113510.620082 
-283620.758132  9113513.636118 
-283626.787601  9113522.684227 
-283623.900058  9113535.740170 
-283481.268407  9114017.763773 
-283404.419332  9114249.728105 
-283405.449696  9114254.752128 
-284215.242663  9114620.346581 
-284258.262932  9114658.569238 
-284300.121575  9114673.685656 
-284314.059881  9114676.715318 
-284335.899403  9114672.722124 
-284310.983019  9114663.652528 
-284291.073243  9114659.611454 
-284275.132303  9114654.570367 
-284264.132364  9114645.516712 
-284258.102583  9114636.468759 
-284251.832292  9114594.270086 
-284241.709799  9114569.144484 
-284234.583981  9114546.031440 
-284222.517180  9114526.930948 
-284215.456964  9114512.859003 
-284208.338461  9114490.750516 
-284208.251023  9114478.695705 
-284211.116520  9114462.626054 
-284243.722656  9114435.540453 
-284285.238541  9114403.442280 
-284319.796193  9114371.336093 
-284366.318524  9114344.266414 
-284414.879868  9114324.230945 
-284439.642949  9114312.204632 
-284458.405428  9114295.148645 
-284469.179264  9114273.060713 
-284475.019442  9114255.989920 
-284479.902053  9114243.940819 
-284509.525796  9114216.851684 
-284523.369156  9114206.821956 
-284535.188011  9114191.767120 
-284547.014150  9114177.716848 
-284576.506540  9114132.545507 
-284601.181947  9114108.464353 
-284633.736524  9114074.346627 
-284729.959090  9114047.333476 
-284735.915885  9114046.335716 
-284745.834147  9114043.333361 
-284774.521945  9114024.279504 
-284786.340667  9114009.224633 
-284793.233094  9114000.191483 
-284803.041888  9113982.120651 
-284806.944972  9113972.079537 
-284812.763112  9113951.995045 
-284815.570025  9113927.888896 
-284814.415485  9113905.787344 
-284811.214556  9113875.647010 
-284810.067323  9113854.550021 
-284811.916715  9113835.465562 
-284816.726248  9113813.370810 
-284821.550372  9113793.285187 
-284833.317960  9113771.198369 
-284836.168652  9113753.119609 
-284840.941693  9113726.002036 
-284841.782482  9113704.907317 
-284840.598779  9113678.787508 
-284838.377301  9113646.639177 
-284833.217589  9113620.514830 
-284830.118849  9113604.438395 
-284829.081073  9113598.409873 
-284827.955756  9113580.326576 
-284828.789269  9113558.227290 
-284837.560221  9113534.127952 
-284844.394227  9113517.058296 
-284850.168571  9113490.946426 
-284848.926541  9113456.790098 
-284849.723584  9113429.667991 
-284860.511696  9113409.589183 
-284872.315685  9113392.525202 
-284883.184028  9113383.496601 
-284880.129078  9113373.447554 
-284875.115311  9113367.414495 
-Region 1
-398
-286425.865814  9114066.314045 
-286422.773798  9114051.242420 
-286419.667120  9114034.161684 
-286411.546423  9114011.048126 
-286397.417715  9113981.900642 
-286382.251035  9113946.724716 
-286362.107037  9113910.538727 
-286341.941085  9113871.339053 
-286312.733876  9113819.070225 
-286282.562057  9113770.818485 
-286257.367637  9113723.576778 
-286232.151298  9113673.321372 
-286207.951002  9113626.080713 
-286184.788712  9113584.868475 
-286158.666455  9113546.666570 
-286139.568130  9113517.513398 
-286114.432630  9113478.307996 
-286089.297179  9113439.102570 
-286062.166467  9113398.890344 
-286033.040502  9113357.671313 
-286008.950433  9113325.498823 
-285976.813321  9113280.258168 
-285944.705551  9113239.035708 
-285913.547931  9113191.786970 
-285892.410753  9113155.599478 
-285872.267602  9113119.413081 
-285862.093627  9113087.256048 
-285843.880000  9113043.035380 
-285834.604978  9112997.820175 
-285830.241403  9112944.574068 
-285822.786205  9112876.256216 
-285821.324198  9112811.963294 
-285816.704784  9112723.557589 
-285823.289729  9112672.332873 
-285794.369288  9112659.241183 
-285770.374890  9112640.127705 
-285750.414905  9112629.055167 
-285723.635959  9112637.061420 
-285707.900410  9112660.148385 
-285686.252128  9112690.260548 
-285672.577595  9112723.395352 
-285668.682068  9112734.441034 
-285638.906477  9112740.434773 
-285609.225873  9112759.487783 
-285615.533239  9112806.708862 
-285610.672944  9112821.771665 
-285598.818220  9112831.803814 
-285578.024941  9112842.830427 
-285574.063620  9112844.835061 
-285569.035241  9112836.792964 
-285561.076061  9112835.779425 
-285546.210140  9112841.789954 
-285538.324025  9112850.822021 
-285529.451229  9112860.857527 
-285522.559092  9112869.890716 
-285508.716363  9112879.920604 
-285493.843112  9112884.926559 
-285483.004244  9112897.973496 
-285469.095747  9112898.962323 
-285454.134822  9112891.913531 
-285442.177772  9112887.881791 
-285423.343171  9112894.892350 
-285417.481513  9112908.949462 
-285416.524048  9112913.971145 
-285418.599674  9112926.028135 
-285409.697618  9112932.045380 
-285389.759447  9112923.986379 
-285370.837178  9112918.942179 
-285363.915785  9112923.957105 
-285356.000404  9112928.970905 
-285339.109923  9112929.956317 
-285337.107343  9112927.944939 
-285322.182929  9112925.918911 
-285315.290737  9112934.952081 
-285311.380505  9112943.988632 
-285302.478427  9112950.005859 
-285285.529520  9112942.954754 
-285269.603809  9112939.923019 
-285254.730494  9112944.928907 
-285244.892823  9112958.981498 
-285231.013486  9112963.988508 
-285203.152603  9112959.938640 
-285180.268963  9112956.898966 
-285170.321776  9112955.883102 
-285146.429551  9112950.833154 
-285122.522732  9112943.774065 
-285105.522756  9112929.690942 
-285095.407738  9112905.570101 
-285084.342525  9112887.475503 
-285070.433993  9112888.464209 
-285053.594567  9112896.481457 
-285049.676984  9112904.513434 
-285054.734480  9112916.573863 
-285047.834930  9112924.602441 
-285035.958136  9112931.620789 
-285014.134150  9112937.623233 
-284987.332913  9112942.615433 
-284969.433807  9112941.590447 
-284957.505932  9112941.576829 
-284946.696045  9112958.641934 
-284943.779722  9112967.679606 
-284934.877573  9112973.696775 
-284915.984460  9112972.670635 
-284902.989651  9112962.610224 
-284893.999979  9112956.572611 
-284876.057105  9112949.520201 
-284854.116399  9112939.449540 
-284850.067519  9112929.399343 
-284847.992038  9112917.342291 
-284844.915278  9112904.279536 
-284835.852712  9112888.196258 
-284824.838631  9112877.133525 
-284812.764950  9112857.028565 
-284789.735542  9112833.897372 
-284770.733134  9112817.802678 
-284752.680993  9112795.681721 
-284735.673877  9112780.593852 
-284715.743114  9112773.539074 
-284692.837682  9112767.485426 
-284675.852454  9112755.411224 
-284654.891287  9112743.332442 
-284630.970027  9112734.263916 
-284613.092835  9112736.252466 
-284597.218183  9112740.252430 
-284585.334046  9112746.266098 
-284567.493265  9112753.277464 
-284549.528647  9112743.211193 
-284536.563106  9112737.168906 
-284523.597569  9112731.126615 
-284514.637116  9112729.107170 
-284484.817494  9112729.072784 
-284470.850692  9112722.024762 
-284456.913022  9112718.995003 
-284454.983302  9112727.029245 
-284453.068146  9112737.072621 
-284436.126663  9112731.025713 
-284419.214307  9112728.997067 
-284400.335818  9112729.979819 
-284383.503545  9112739.001401 
-284376.596589  9112746.025332 
-284388.713747  9112772.157868 
-284394.837861  9112794.265239 
-284403.980359  9112821.398888 
-284414.160553  9112854.561083 
-284425.385734  9112894.756388 
-284436.487138  9112917.874045 
-284445.636986  9112946.012239 
-284455.700726  9112963.101338 
-284471.772135  9112986.224707 
-284487.814426  9113005.329799 
-284502.855452  9113023.429171 
-284522.895602  9113045.552521 
-284545.866755  9113060.647323 
-284568.859782  9113078.755808 
-284589.872123  9113097.866559 
-284613.851891  9113114.971588 
-284640.857393  9113138.107418 
-284664.866356  9113159.230673 
-284689.891206  9113183.368746 
-284717.868910  9113203.491953 
-284739.889947  9113224.612873 
-284748.901542  9113233.664204 
-284755.917854  9113241.708691 
-284783.946666  9113268.863796 
-284802.978478  9113288.976694 
-284824.027478  9113313.110110 
-284844.053326  9113333.224117 
-284866.089074  9113356.354074 
-284875.115311  9113367.414495 
-284880.129078  9113373.447554 
-284883.184028  9113383.496601 
-284872.315685  9113392.525202 
-284860.511696  9113409.589183 
-284849.723584  9113429.667991 
-284848.926541  9113456.790098 
-284850.168571  9113490.946426 
-284844.394227  9113517.058296 
-284837.560221  9113534.127952 
-284828.789269  9113558.227290 
-284827.955756  9113580.326576 
-284829.081073  9113598.409873 
-284830.118849  9113604.438395 
-284833.217589  9113620.514830 
-284838.377301  9113646.639177 
-284840.598779  9113678.787508 
-284841.782482  9113704.907317 
-284840.941693  9113726.002036 
-284836.168652  9113753.119609 
-284833.317960  9113771.198369 
-284821.550372  9113793.285187 
-284816.726248  9113813.370810 
-284811.916715  9113835.465562 
-284810.067323  9113854.550021 
-284811.214556  9113875.647010 
-284814.415485  9113905.787344 
-284815.570025  9113927.888896 
-284812.763112  9113951.995045 
-284806.944972  9113972.079537 
-284803.041888  9113982.120651 
-284793.233094  9114000.191483 
-284786.340667  9114009.224633 
-284774.521945  9114024.279504 
-284745.834147  9114043.333361 
-284735.915885  9114046.335716 
-284729.959090  9114047.333476 
-284633.736524  9114074.346627 
-284601.181947  9114108.464353 
-284576.506540  9114132.545507 
-284547.014150  9114177.716848 
-284535.188011  9114191.767120 
-284523.369156  9114206.821956 
-284509.525796  9114216.851684 
-284479.902053  9114243.940819 
-284475.019442  9114255.989920 
-284469.179264  9114273.060713 
-284458.405428  9114295.148645 
-284439.642949  9114312.204632 
-284414.879868  9114324.230945 
-284366.318524  9114344.266414 
-284319.796193  9114371.336093 
-284285.238541  9114403.442280 
-284243.722656  9114435.540453 
-284211.116520  9114462.626054 
-284208.251023  9114478.695705 
-284208.338461  9114490.750516 
-284215.456964  9114512.859003 
-284222.517180  9114526.930948 
-284234.583981  9114546.031440 
-284241.709799  9114569.144484 
-284251.832292  9114594.270086 
-284258.102583  9114636.468759 
-284264.132364  9114645.516712 
-284275.132303  9114654.570367 
-284291.073243  9114659.611454 
-284310.983019  9114663.652528 
-284335.899403  9114672.722124 
-284314.059881  9114676.715318 
-284300.121575  9114673.685656 
-284258.262932  9114658.569238 
-284215.242663  9114620.346581 
-283405.449696  9114254.752128 
-283502.176945  9114846.552689 
-283527.173397  9114866.673026 
-283540.168651  9114876.733765 
-283559.135424  9114887.806003 
-283569.126745  9114894.849551 
-283600.058389  9114910.958480 
-283615.034474  9114920.016929 
-283633.007238  9114931.087972 
-283667.900529  9114945.192316 
-283691.873945  9114961.293097 
-283716.797747  9114971.367592 
-283769.561979  9114982.478856 
-283800.362680  9114980.505364 
-283833.144173  9114977.529580 
-283845.072657  9114977.543364 
-283878.891869  9114980.596112 
-283894.781946  9114978.605337 
-283933.534936  9114976.640936 
-283963.377979  9114979.689032 
-283987.264068  9114983.734804 
-284013.167377  9114991.801126 
-284040.130305  9115008.909690 
-284066.128357  9115030.035360 
-284085.233731  9115060.194122 
-284101.349723  9115089.344874 
-284116.486273  9115120.503608 
-284131.732179  9115166.730847 
-284134.940264  9115197.875868 
-284141.196096  9115238.065417 
-284159.504421  9115295.346292 
-284175.635157  9115326.506117 
-284194.660564  9115345.614542 
-284225.723928  9115379.805120 
-284251.744174  9115403.944309 
-284278.751202  9115427.080047 
-284300.809898  9115453.223781 
-284325.806997  9115473.343505 
-284362.834844  9115507.540754 
-284388.833344  9115528.666130 
-284424.867232  9115562.862171 
-284460.879277  9115594.044472 
-284474.883569  9115606.115103 
-284488.887868  9115618.185727 
-284509.879731  9115634.282521 
-284544.905136  9115666.468162 
-284580.895436  9115694.636633 
-284616.907685  9115725.818758 
-284646.941057  9115754.984952 
-284672.939820  9115776.110097 
-284712.986851  9115815.333131 
-284727.992633  9115828.409338 
-284745.987894  9115842.493476 
-284800.894716  9115874.701315 
-284872.715161  9115908.937259 
-284957.334120  9115926.110046 
-285037.026710  9115949.304447 
-285093.717102  9115953.386349 
-285141.512204  9115964.490076 
-285184.322409  9115973.579053 
-285220.159603  9115980.651072 
-285260.009613  9115992.750315 
-285303.843175  9116005.858523 
-285333.730702  9116014.932896 
-285360.643392  9116025.008476 
-285404.447706  9116034.098332 
-285442.316988  9116047.199734 
-285455.386166  9116067.305334 
-285485.361629  9116088.434307 
-285508.305479  9116099.509914 
-285524.239672  9116103.545849 
-285542.140003  9116104.570311 
-285560.040332  9116105.594765 
-285586.865183  9116103.615476 
-285598.786523  9116102.624170 
-285619.647033  9116100.638236 
-285652.480166  9116104.692885 
-285695.209879  9116102.731180 
-285733.912053  9116093.733122 
-285756.723997  9116086.726539 
-285779.528601  9116078.715388 
-285810.248969  9116065.690237 
-285840.983978  9116054.674185 
-285870.702919  9116040.643344 
-285895.502905  9116033.638901 
-285924.242422  9116021.616049 
-285953.983306  9116010.598836 
-285982.730121  9115999.580511 
-286011.469582  9115987.557615 
-286034.259393  9115977.537245 
-286055.090436  9115971.532903 
-286072.917312  9115962.511600 
-286088.748744  9115952.483546 
-286103.608130  9115945.468063 
-286122.436369  9115937.452395 
-286143.245360  9115928.434351 
-286181.859152  9115907.381295 
-286203.662160  9115898.364322 
-286225.428462  9115884.324562 
-286244.175910  9115865.258742 
-286260.957270  9115849.204402 
-286279.690009  9115828.129463 
-286285.558863  9115815.076786 
-286299.336034  9115796.005501 
-286311.139787  9115778.941145 
-286291.075397  9115753.805446 
-286262.933918  9115711.583553 
-286253.840753  9115691.482611 
-286243.716865  9115666.357795 
-286226.561319  9115631.179763 
-286221.451697  9115612.087735 
-286216.342081  9115592.995705 
-286212.219175  9115572.900211 
-286211.063721  9115550.798885 
-286207.854162  9115519.654366 
-286207.729440  9115502.576912 
-286209.548778  9115479.474311 
-286212.310801  9115449.340911 
-286217.090245  9115423.227925 
-286218.938930  9115404.143548 
-286223.755052  9115383.053343 
-286230.522563  9115356.942546 
-286233.416636  9115344.891157 
-286240.198813  9115320.789474 
-286248.011701  9115301.711665 
-286256.789274  9115278.616726 
-286257.753962  9115274.599597 
-286264.572806  9115255.520694 
-286275.316423  9115229.414277 
-286278.129782  9115206.312775 
-286279.971118  9115186.223846 
-286281.797783  9115164.125806 
-286285.605174  9115141.025399 
-286291.407960  9115118.931737 
-286301.186862  9115096.842452 
-286302.962170  9115067.712523 
-286305.731509  9115038.583689 
-286310.518248  9115013.475267 
-286314.266942  9114982.338417 
-286318.958312  9114944.170772 
-286325.579047  9114897.968871 
-286330.373115  9114873.865007 
-286334.092465  9114838.709937 
-286338.857188  9114810.587851 
-286348.548009  9114776.443907 
-286354.292076  9114746.313807 
-286359.896769  9114697.097150 
-286365.560144  9114655.916940 
-286368.388163  9114634.824557 
-286377.902913  9114576.571284 
-286399.254326  9114369.658032 
-286416.952424  9114206.940857 
-286417.895097  9114199.910065 
-286423.529133  9114154.711644 
-286426.320483  9114128.596489 
-286428.147161  9114106.498460 
-286427.971159  9114082.389127 
-286425.865814  9114066.314045 
-Region 1
-135
-287443.375587  9115918.795675 
-287427.367799  9115904.714946 
-287398.341740  9115877.561210 
-287353.315338  9115837.331229 
-287350.318490  9115835.318928 
-287314.297427  9115803.134894 
-287281.287979  9115774.972227 
-287226.033969  9115831.167141 
-287209.179437  9115837.176250 
-287194.283541  9115839.169292 
-287183.312288  9115834.134760 
-287177.311242  9115829.105580 
-287167.275157  9115816.035709 
-287160.235918  9115804.978151 
-287152.180566  9115790.905866 
-287141.165175  9115779.844014 
-287136.187616  9115778.834102 
-287129.199900  9115774.808392 
-287115.261264  9115771.779722 
-287103.318066  9115769.757745 
-287101.329985  9115769.755599 
-287088.385390  9115766.727993 
-287078.430274  9115764.708155 
-287064.447498  9115755.652160 
-287051.436698  9115743.583580 
-287043.396103  9115731.520368 
-287035.311377  9115713.429845 
-287028.235408  9115697.349496 
-287024.126851  9115679.263268 
-287015.143727  9115674.230832 
-287007.073736  9115658.149401 
-286991.029385  9115639.045703 
-286983.990221  9115627.988100 
-286979.925819  9115615.929172 
-286979.778735  9115595.838136 
-286980.618337  9115574.743625 
-286981.244679  9115524.517110 
-286976.215672  9115516.475310 
-286954.251305  9115503.392431 
-286936.336614  9115500.359372 
-286931.359085  9115499.349428 
-286918.421924  9115497.326305 
-286891.553565  9115493.278967 
-286874.654966  9115493.260618 
-286852.771486  9115491.227758 
-286833.862761  9115488.193575 
-286819.946265  9115488.178447 
-286799.999408  9115479.115852 
-286796.008567  9115477.102421 
-286780.059906  9115471.057799 
-286759.126375  9115462.998654 
-286751.130003  9115456.962676 
-286739.164840  9115451.926920 
-286734.150577  9115445.894187 
-286673.786255  9115482.996573 
-286669.868883  9115491.028665 
-286668.992394  9115507.100438 
-286668.101212  9115521.163104 
-286666.201300  9115533.215579 
-286656.429900  9115556.309472 
-286649.596528  9115573.379295 
-286637.807652  9115592.452805 
-286625.032074  9115612.529784 
-286607.264249  9115629.587677 
-286595.431268  9115642.633860 
-286579.680884  9115663.712133 
-286563.879068  9115677.758525 
-286554.984115  9115684.780634 
-286539.145560  9115693.804251 
-286528.247826  9115698.815077 
-286513.417989  9115709.848881 
-286495.620706  9115722.888531 
-286477.816068  9115734.923622 
-286443.413760  9115788.126963 
-286426.713273  9115815.231451 
-286386.390636  9115874.455581 
-286409.466652  9115903.612693 
-286437.557000  9115938.802548 
-286466.670821  9115978.011678 
-286468.688297  9115982.032068 
-286484.813432  9116012.186068 
-286507.035120  9116060.428541 
-286532.268406  9116112.692459 
-286559.622131  9116183.040482 
-286572.787311  9116216.204830 
-286590.974226  9116256.406454 
-286615.213708  9116308.669191 
-286635.344720  9116342.845619 
-286655.497821  9116380.035690 
-286673.611383  9116410.191713 
-286690.686801  9116434.319327 
-286718.726281  9116462.476999 
-286744.762973  9116488.623386 
-286771.845236  9116521.802694 
-286797.904060  9116550.962691 
-286812.954705  9116570.065317 
-286837.003395  9116596.209471 
-286860.065411  9116623.357084 
-286875.108751  9116641.455125 
-286904.194048  9116676.645557 
-286910.209926  9116683.683855 
-286926.048672  9116674.660048 
-286957.711425  9116654.603319 
-286999.484034  9116657.661962 
-287076.048736  9116660.757993 
-287172.472512  9116660.861585 
-287213.258400  9116664.923509 
-287231.085173  9116655.901744 
-287247.925245  9116647.883458 
-287269.595640  9116620.784047 
-287269.463047  9116602.702151 
-287270.250852  9116574.575823 
-287292.031704  9116562.544657 
-287294.005084  9116560.537687 
-287266.826732  9116514.299640 
-287254.684470  9116485.154905 
-287235.532295  9116448.970846 
-287210.445289  9116416.798569 
-287223.286982  9116405.762391 
-287244.957315  9116378.663013 
-287267.562758  9116343.528298 
-287283.195084  9116306.377016 
-287290.904449  9116273.235403 
-287293.584644  9116232.052060 
-287304.305606  9116202.931848 
-287323.958259  9116171.812132 
-287339.752544  9116156.760944 
-287363.506559  9116142.722827 
-287389.138159  9116113.618590 
-287409.836332  9116089.531769 
-287429.533072  9116064.439330 
-287453.117564  9116027.296556 
-287477.688698  9115989.150293 
-287500.308549  9115956.024642 
-287443.375587  9115918.795675 
-Region 1
-166
-286878.314280  9114498.765385 
-286876.223415  9114484.699475 
-286872.115145  9114466.613183 
-286863.935345  9114435.463360 
-286859.915227  9114429.431701 
-286855.895110  9114423.400040 
-286847.840191  9114409.327612 
-286845.749346  9114395.261697 
-286848.621215  9114380.196658 
-286849.505061  9114365.129447 
-286843.430835  9114350.054634 
-286831.333804  9114326.936874 
-286825.259592  9114311.862055 
-286821.129344  9114290.762088 
-286818.752146  9114237.518588 
-286763.986251  9114224.399554 
-286721.111767  9114206.270754 
-286686.093956  9114175.091426 
-286658.004886  9114139.901482 
-286644.958044  9114122.809869 
-286626.889816  9114098.680907 
-286575.627030  9114156.888253 
-286565.767659  9114167.927424 
-286548.972235  9114181.972603 
-286544.031539  9114185.985354 
-286529.172765  9114193.000832 
-286518.282685  9114199.016128 
-286506.376585  9114202.016662 
-286490.531124  9114210.035590 
-286470.650938  9114210.013692 
-286449.791410  9114211.999801 
-286416.952424  9114206.940857 
-286399.254326  9114369.658032 
-286377.902913  9114576.571284 
-286368.388163  9114634.824557 
-286365.560144  9114655.916940 
-286359.896769  9114697.097150 
-286354.292076  9114746.313807 
-286348.548009  9114776.443907 
-286338.857188  9114810.587851 
-286334.092465  9114838.709937 
-286330.373115  9114873.865007 
-286325.579047  9114897.968871 
-286318.958312  9114944.170772 
-286314.266942  9114982.338417 
-286310.518248  9115013.475267 
-286305.731509  9115038.583689 
-286302.962170  9115067.712523 
-286301.186862  9115096.842452 
-286291.407960  9115118.931737 
-286285.605174  9115141.025399 
-286281.797783  9115164.125806 
-286279.971118  9115186.223846 
-286278.129782  9115206.312775 
-286275.316423  9115229.414277 
-286264.572806  9115255.520694 
-286257.753962  9115274.599597 
-286256.789274  9115278.616726 
-286248.011701  9115301.711665 
-286240.198813  9115320.789474 
-286233.416636  9115344.891157 
-286230.522563  9115356.942546 
-286223.755052  9115383.053343 
-286218.938930  9115404.143548 
-286217.090245  9115423.227925 
-286212.310801  9115449.340911 
-286209.548778  9115479.474311 
-286207.729440  9115502.576912 
-286207.854162  9115519.654366 
-286211.063721  9115550.798885 
-286212.219175  9115572.900211 
-286216.342081  9115592.995705 
-286221.451697  9115612.087735 
-286226.561319  9115631.179763 
-286243.716865  9115666.357795 
-286253.840753  9115691.482611 
-286262.933918  9115711.583553 
-286291.075397  9115753.805446 
-286311.139787  9115778.941145 
-286336.211131  9115809.105054 
-286355.303552  9115837.253297 
-286379.366230  9115865.406968 
-286386.390636  9115874.455581 
-286426.713273  9115815.231451 
-286443.413760  9115788.126963 
-286477.816068  9115734.923622 
-286495.620706  9115722.888531 
-286513.417989  9115709.848881 
-286528.247826  9115698.815077 
-286539.145560  9115693.804251 
-286554.984115  9115684.780634 
-286563.879068  9115677.758525 
-286579.680884  9115663.712133 
-286595.431268  9115642.633860 
-286607.264249  9115629.587677 
-286625.032074  9115612.529784 
-286637.807652  9115592.452805 
-286649.596528  9115573.379295 
-286656.429900  9115556.309472 
-286666.201300  9115533.215579 
-286668.101212  9115521.163104 
-286668.992394  9115507.100438 
-286669.868883  9115491.028665 
-286673.786255  9115482.996573 
-286734.150577  9115445.894187 
-286681.047961  9115388.577214 
-286647.133271  9115372.467475 
-286643.164481  9115373.467688 
-286631.221383  9115371.445556 
-286613.262668  9115362.385028 
-286599.280095  9115353.328836 
-286589.273660  9115344.276986 
-286580.261263  9115335.226219 
-286575.173597  9115319.147918 
-286571.035909  9115297.043378 
-286569.895010  9115276.951207 
-286555.787643  9115250.817570 
-286546.701849  9115231.721247 
-286527.536258  9115193.527500 
-286520.438553  9115174.433342 
-286517.309633  9115154.338985 
-286518.259614  9115148.312746 
-286519.165547  9115136.259181 
-286520.122870  9115131.237497 
-286530.954410  9115117.185714 
-286544.760689  9115102.132642 
-286566.533867  9115089.097385 
-286576.422751  9115082.076388 
-286589.286373  9115074.054100 
-286603.092618  9115059.001017 
-286609.999408  9115051.976752 
-286620.816217  9115035.915851 
-286631.640362  9115020.859502 
-286640.469105  9115004.796424 
-286647.331822  9114991.744833 
-286651.212460  9114978.689981 
-286655.063723  9114961.616913 
-286656.013687  9114955.590677 
-286656.963652  9114949.564441 
-286658.826865  9114932.489199 
-286663.701522  9114919.435435 
-286668.612895  9114911.404440 
-286690.356570  9114894.350937 
-286702.211408  9114884.318439 
-286724.013811  9114875.301355 
-286742.804757  9114862.262792 
-286749.733533  9114858.252178 
-286762.604404  9114851.234415 
-286774.459212  9114841.201905 
-286787.263964  9114825.143158 
-286809.942800  9114800.054278 
-286806.887281  9114790.005493 
-286801.792305  9114772.922665 
-286793.641823  9114745.791048 
-286789.511500  9114724.691089 
-286780.389056  9114700.572039 
-286789.247085  9114688.527171 
-286802.066490  9114674.477537 
-286823.765936  9114651.396689 
-286840.524660  9114632.328625 
-286861.208013  9114606.233025 
-286870.066004  9114594.188149 
-286874.874469  9114572.093408 
-286878.688917  9114549.997582 
-286879.513975  9114526.893951 
-286878.314280  9114498.765385 
-Region 1
-173
-287426.197880  9113030.719098 
-287409.167964  9113012.618817 
-287389.222265  9113003.556239 
-287368.289942  9112995.497120 
-287345.406405  9112992.458580 
-287327.536842  9112995.452749 
-287305.720748  9113002.460783 
-287286.857196  9113005.453854 
-287264.017724  9113008.442582 
-287237.202331  9113011.426961 
-287208.362249  9113009.386395 
-287187.444623  9113003.336289 
-287163.537719  9112996.278362 
-287148.606004  9112993.248409 
-287128.682366  9112987.199358 
-287131.539478  9112970.125232 
-287111.615852  9112964.076171 
-287101.632014  9112958.037979 
-287092.583424  9112943.964454 
-287088.534096  9112933.914576 
-287085.375971  9112909.802051 
-287085.199783  9112885.692790 
-287083.978236  9112854.550573 
-287085.694578  9112817.384306 
-287079.694022  9112812.355009 
-287070.696860  9112805.313338 
-287062.701017  9112799.277307 
-287056.693125  9112793.243453 
-287023.037413  9112812.292896 
-287004.232601  9112823.322259 
-286989.366991  9112829.333215 
-286968.537517  9112835.337619 
-286916.946112  9112848.340031 
-286895.107961  9112852.334206 
-286872.305171  9112860.345493 
-286846.527773  9112869.358042 
-286838.561278  9112867.340182 
-286837.537959  9112863.320873 
-286823.328866  9112823.123394 
-286820.266252  9112812.070015 
-286815.186348  9112796.996231 
-286813.139718  9112788.957608 
-286813.022367  9112772.884743 
-286811.896372  9112754.801675 
-286813.825649  9112746.767432 
-286685.764070  9112768.726167 
-286550.583206  9112768.576642 
-286453.334588  9112790.568879 
-286351.152553  9112817.578187 
-286339.742718  9112752.269847 
-286361.134166  9112686.997990 
-286403.355101  9112615.722005 
-286397.989721  9112561.470433 
-286315.971330  9112491.060736 
-286197.015230  9112398.509485 
-286083.102592  9112316.008953 
-285985.101147  9112234.530451 
-285922.364130  9112218.387142 
-285877.555124  9112207.286673 
-285851.711940  9112207.257580 
-285823.238546  9112665.300957 
-285823.289729  9112672.332873 
-285816.704784  9112723.557589 
-285821.324198  9112811.963294 
-285822.786205  9112876.256216 
-285830.241403  9112944.574068 
-285834.604978  9112997.820175 
-285843.880000  9113043.035380 
-285862.093627  9113087.256048 
-285872.267602  9113119.413081 
-285892.410753  9113155.599478 
-285913.547931  9113191.786970 
-285944.705551  9113239.035708 
-285976.813321  9113280.258168 
-286008.950433  9113325.498823 
-286033.040502  9113357.671313 
-286062.166467  9113398.890344 
-286089.297179  9113439.102570 
-286114.432630  9113478.307996 
-286139.568130  9113517.513398 
-286158.666455  9113546.666570 
-286184.788712  9113584.868475 
-286207.951002  9113626.080713 
-286232.151298  9113673.321372 
-286257.367637  9113723.576778 
-286282.562057  9113770.818485 
-286312.733876  9113819.070225 
-286341.941085  9113871.339053 
-286362.107037  9113910.538727 
-286382.251035  9113946.724716 
-286397.417715  9113981.900642 
-286411.546423  9114011.048126 
-286419.667120  9114034.161684 
-286422.773798  9114051.242420 
-286425.865814  9114066.314045 
-286427.971159  9114082.389127 
-286428.147161  9114106.498460 
-286426.320483  9114128.596489 
-286423.529133  9114154.711644 
-286417.895097  9114199.910065 
-286416.952424  9114206.940857 
-286449.791410  9114211.999801 
-286470.650938  9114210.013692 
-286490.531124  9114210.035590 
-286506.376585  9114202.016662 
-286518.282685  9114199.016128 
-286529.172765  9114193.000832 
-286544.031539  9114185.985354 
-286548.972235  9114181.972603 
-286565.767659  9114167.927424 
-286575.627030  9114156.888253 
-286626.889816  9114098.680907 
-286701.803088  9114012.372208 
-286738.258279  9113968.212191 
-286789.711509  9113936.123153 
-286861.965252  9113894.011395 
-286779.958095  9113825.612437 
-286772.981300  9113686.977468 
-286760.906576  9113666.873293 
-286743.810522  9113639.731774 
-286730.639109  9113605.562734 
-286714.515087  9113575.408624 
-286708.367707  9113550.288208 
-286705.253671  9113532.202951 
-286707.080258  9113510.104943 
-286705.932206  9113489.008209 
-286698.842213  9113470.918574 
-286688.784924  9113454.834763 
-286673.750351  9113437.740919 
-286664.657732  9113417.639974 
-286657.479759  9113387.495670 
-286656.280406  9113359.367045 
-286661.980309  9113323.209651 
-286671.714836  9113295.093078 
-286687.471956  9113275.019513 
-286708.191664  9113253.946866 
-286723.956089  9113234.877850 
-286752.612979  9113211.804840 
-286776.336592  9113193.749120 
-286803.130177  9113187.751320 
-286847.844829  9113185.791384 
-286881.691680  9113192.860381 
-286912.607954  9113206.957952 
-286931.596422  9113221.042416 
-286949.590915  9113235.125779 
-287056.659568  9113332.683847 
-287128.623233  9113387.007856 
-287131.597851  9113386.006559 
-287141.471622  9113376.976439 
-287157.301968  9113366.948273 
-287180.016755  9113346.882175 
-287198.755577  9113326.811734 
-287216.434280  9113297.699242 
-287230.070906  9113259.541450 
-287237.706884  9113216.354401 
-287245.284087  9113165.130942 
-287253.074326  9113143.039477 
-287265.849158  9113122.962533 
-287272.851107  9113128.997424 
-287280.898467  9113142.065256 
-287286.950521  9113154.126369 
-287360.732976  9113185.347510 
-287371.703525  9113190.382153 
-287378.514415  9113170.298702 
-287383.315291  9113147.199437 
-287391.120154  9113127.117067 
-287399.977788  9113115.072183 
-287406.847456  9113103.025137 
-287418.687021  9113090.983493 
-287430.511880  9113076.932746 
-287435.371528  9113061.869887 
-287435.253931  9113045.797079 
-287426.197880  9113030.719098 
-Region 1
-213
-287788.717658  9114349.068663 
-287770.729822  9114335.990356 
-287762.748323  9114331.963635 
-287756.769563  9114329.948141 
-287663.391953  9114337.884203 
-287658.399838  9114334.865216 
-287647.392157  9114324.807974 
-287629.345469  9114303.693207 
-287617.226024  9114277.562102 
-287604.016909  9114238.370782 
-287597.699607  9114190.146004 
-287602.544504  9114173.074022 
-287605.467632  9114165.040840 
-287606.432195  9114161.023715 
-287596.102120  9114107.771904 
-287591.934778  9114081.649341 
-287590.668496  9114044.479949 
-287583.511815  9114017.349618 
-287575.316999  9113984.190916 
-287581.207408  9113974.151855 
-287590.020941  9113956.079615 
-287630.428971  9113908.909739 
-287647.209164  9113892.855163 
-287661.979275  9113873.784796 
-287672.766034  9113853.705596 
-287681.542717  9113830.610607 
-287685.342063  9113806.505718 
-287685.202232  9113787.419290 
-287682.109861  9113772.347845 
-287681.064352  9113765.314932 
-287675.954564  9113746.223148 
-287665.889536  9113729.135104 
-287653.836534  9113712.044912 
-287641.812973  9113698.972910 
-287626.748583  9113677.861293 
-287613.672191  9113656.751814 
-287600.610526  9113637.651426 
-287589.485360  9113611.521333 
-287583.396363  9113594.437549 
-287578.242515  9113569.318441 
-287576.203045  9113562.284446 
-287572.109397  9113546.207356 
-287570.983009  9113528.124389 
-287574.753009  9113500.001299 
-287579.516996  9113471.879285 
-287582.241522  9113436.723274 
-287580.018187  9113404.575538 
-287572.876417  9113379.454272 
-287563.746689  9113354.330851 
-287559.711916  9113346.290151 
-287554.668452  9113336.239274 
-287542.659748  9113325.176314 
-287533.655061  9113317.130228 
-287529.620298  9113309.089522 
-287524.510668  9113289.997690 
-287524.356254  9113268.902141 
-287523.222566  9113249.814615 
-287520.034742  9113221.683984 
-287515.897059  9113199.579574 
-287520.859615  9113198.580411 
-287527.788075  9113194.569752 
-287543.706483  9113196.596085 
-287551.650981  9113195.600150 
-287572.458406  9113186.581808 
-287555.237192  9113142.363315 
-287540.327489  9113142.347159 
-287519.490664  9113147.347283 
-287498.668535  9113154.356498 
-287479.782900  9113154.336010 
-287475.829031  9113157.345347 
-287456.081727  9113175.405678 
-287434.346444  9113193.463845 
-287421.512882  9113205.504419 
-287416.587073  9113211.526324 
-287412.596443  9113209.512905 
-287408.605813  9113207.499484 
-287371.703525  9113190.382153 
-287360.732976  9113185.347510 
-287286.950521  9113154.126369 
-287280.898467  9113142.065256 
-287272.851107  9113128.997424 
-287265.849158  9113122.962533 
-287253.074326  9113143.039477 
-287245.284087  9113165.130942 
-287237.706884  9113216.354401 
-287230.070906  9113259.541450 
-287216.434280  9113297.699242 
-287198.755577  9113326.811734 
-287180.016755  9113346.882175 
-287157.301968  9113366.948273 
-287141.471622  9113376.976439 
-287131.597851  9113386.006559 
-287128.623233  9113387.007856 
-287056.659568  9113332.683847 
-286949.590915  9113235.125779 
-286931.596422  9113221.042416 
-286912.607954  9113206.957952 
-286881.691680  9113192.860381 
-286847.844829  9113185.791384 
-286803.130177  9113187.751320 
-286776.336592  9113193.749120 
-286752.612979  9113211.804840 
-286723.956089  9113234.877850 
-286708.191664  9113253.946866 
-286687.471956  9113275.019513 
-286671.714836  9113295.093078 
-286661.980309  9113323.209651 
-286656.280406  9113359.367045 
-286657.479759  9113387.495670 
-286664.657732  9113417.639974 
-286673.750351  9113437.740919 
-286688.784924  9113454.834763 
-286698.842213  9113470.918574 
-286705.932206  9113489.008209 
-286707.080258  9113510.104943 
-286705.253671  9113532.202951 
-286708.367707  9113550.288208 
-286714.515087  9113575.408624 
-286730.639109  9113605.562734 
-286743.810522  9113639.731774 
-286760.906576  9113666.873293 
-286772.981300  9113686.977468 
-286779.958095  9113825.612437 
-286861.965252  9113894.011395 
-286789.711509  9113936.123153 
-286738.258279  9113968.212191 
-286701.803088  9114012.372208 
-286626.889816  9114098.680907 
-286644.958044  9114122.809869 
-286658.004886  9114139.901482 
-286686.093956  9114175.091426 
-286721.111767  9114206.270754 
-286763.986251  9114224.399554 
-286818.752146  9114237.518588 
-286821.129344  9114290.762088 
-286825.259592  9114311.862055 
-286831.333804  9114326.936874 
-286843.430835  9114350.054634 
-286849.505061  9114365.129447 
-286848.621215  9114380.196658 
-286845.749346  9114395.261697 
-286847.840191  9114409.327612 
-286855.895110  9114423.400040 
-286859.915227  9114429.431701 
-286863.935345  9114435.463360 
-286872.115145  9114466.613183 
-286876.223415  9114484.699475 
-286878.314280  9114498.765385 
-286879.513975  9114526.893951 
-286878.688917  9114549.997582 
-286874.874469  9114572.093408 
-286870.066004  9114594.188149 
-286861.208013  9114606.233025 
-286840.524660  9114632.328625 
-286823.765936  9114651.396689 
-286802.066490  9114674.477537 
-286789.247085  9114688.527171 
-286780.389056  9114700.572039 
-286789.511500  9114724.691089 
-286793.641823  9114745.791048 
-286801.792305  9114772.922665 
-286806.887281  9114790.005493 
-286809.942800  9114800.054278 
-286819.934428  9114807.096995 
-286830.986196  9114823.181769 
-286839.983811  9114830.223395 
-286850.962123  9114836.262632 
-286877.712519  9114824.237245 
-286895.546107  9114816.220314 
-286908.424283  9114810.207071 
-286927.251878  9114802.191212 
-286942.118083  9114796.180126 
-286952.021535  9114791.168180 
-286965.886364  9114784.151453 
-286990.685396  9114777.146612 
-287001.568156  9114770.126635 
-287004.491413  9114762.093460 
-287004.462013  9114758.075251 
-286996.142385  9114707.839000 
-287004.065126  9114703.829438 
-287015.971284  9114700.828751 
-287022.900004  9114696.818106 
-287041.683423  9114682.774904 
-287048.612138  9114678.764257 
-287051.579487  9114676.758393 
-287088.313986  9114670.771026 
-287121.992901  9114654.734881 
-287148.779854  9114647.732133 
-287171.539264  9114633.693203 
-287191.382795  9114628.691994 
-287207.228200  9114620.672817 
-287210.202890  9114619.671496 
-287236.923609  9114603.627747 
-287250.788322  9114596.610956 
-287271.640543  9114593.619895 
-287288.494641  9114587.610873 
-287304.413564  9114589.637174 
-287328.291948  9114592.676615 
-287347.244407  9114601.737976 
-287361.226805  9114610.793959 
-287374.229909  9114621.857964 
-287388.175529  9114625.891186 
-287599.951842  9114633.151045 
-287612.815105  9114625.128539 
-287629.580782  9114607.064813 
-287719.358299  9114514.743435 
-287723.245964  9114502.693120 
-287728.142365  9114492.652968 
-287741.859643  9114465.545090 
-287757.807963  9114471.589430 
-287831.828187  9114399.341847 
-287810.725720  9114368.178509 
-287788.717658  9114349.068663 
-Region 1
-372
-288121.262096  9114559.372407 
-288113.236297  9114549.318488 
-288104.128019  9114527.208955 
-288099.069507  9114515.149112 
-288092.987502  9114499.070024 
-288082.929475  9114482.986701 
-288082.892614  9114477.963970 
-288082.841009  9114470.932145 
-288075.750268  9114452.842901 
-288068.689022  9114438.771840 
-288066.568322  9114420.687886 
-288070.441143  9114406.628471 
-288075.315338  9114393.574663 
-288083.075714  9114367.464928 
-288093.891813  9114351.403833 
-288101.674292  9114328.307738 
-288109.434650  9114302.198004 
-288107.254982  9114276.077683 
-288101.121427  9114252.966763 
-288097.042224  9114238.898877 
-288096.003996  9114232.870540 
-288083.980161  9114219.798722 
-288065.948107  9114200.693259 
-288050.964397  9114190.631888 
-288023.993735  9114172.521402 
-287993.061829  9114156.415741 
-287997.015035  9114017.793566 
-287997.345963  9113927.385395 
-287998.258919  9113916.336440 
-287991.175717  9113899.251697 
-287987.052405  9113879.156500 
-287984.902352  9113857.054335 
-287984.732924  9113833.949750 
-287992.485974  9113806.835488 
-288006.202969  9113779.727608 
-288012.041687  9113762.656690 
-288011.018229  9113758.637438 
-288009.972673  9113751.604545 
-287999.937001  9113738.534793 
-287988.826320  9113714.413954 
-287986.705757  9113696.329975 
-287988.649543  9113690.304821 
-287976.154547  9113612.941902 
-287979.048132  9113600.890530 
-287980.955094  9113589.842639 
-287976.868671  9113574.770168 
-287969.748740  9113552.662667 
-287965.581321  9113526.540171 
-287966.479572  9113513.482121 
-287963.394517  9113499.415258 
-287956.355614  9113488.357773 
-287942.336727  9113474.279176 
-287932.315878  9113463.218484 
-287921.197970  9113438.093054 
-287916.051346  9113413.978571 
-287908.946211  9113393.880141 
-287901.863170  9113376.795353 
-287891.754017  9113353.680069 
-287886.747294  9113348.651987 
-287884.744605  9113346.640754 
-287879.737884  9113341.612670 
-287870.703706  9113329.548474 
-287863.679581  9113320.500058 
-287860.646108  9113313.465013 
-287859.630044  9113310.450300 
-287860.535699  9113298.396792 
-287864.445381  9113289.360136 
-287873.317608  9113279.324279 
-287879.222610  9113271.294310 
-287882.160388  9113265.270229 
-287883.066039  9113253.216722 
-287869.459781  9113159.779848 
-287859.313920  9113131.641798 
-287821.579535  9113136.623853 
-287819.444403  9113116.530743 
-287813.340723  9113097.437894 
-287807.251766  9113080.354140 
-287800.220344  9113070.301152 
-287790.236424  9113064.263141 
-287779.251172  9113057.219505 
-287771.233140  9113048.169986 
-287763.185684  9113035.102270 
-287760.071330  9113017.017173 
-287759.894769  9112992.908002 
-287765.755630  9112978.850758 
-287759.806490  9112980.853416 
-287754.851325  9112982.857148 
-287722.108974  9112990.858107 
-287673.573306  9113013.910086 
-287609.133938  9113036.944807 
-287598.288425  9113048.987562 
-287563.712424  9113078.081818 
-287532.118315  9113107.179291 
-287502.504774  9113135.274357 
-287479.782900  9113154.336010 
-287498.668535  9113154.356498 
-287519.490664  9113147.347283 
-287540.327489  9113142.347159 
-287555.237192  9113142.363315 
-287572.458406  9113186.581808 
-287551.650981  9113195.600150 
-287543.706483  9113196.596085 
-287527.788075  9113194.569752 
-287520.859615  9113198.580411 
-287515.897059  9113199.579574 
-287520.034742  9113221.683984 
-287523.222566  9113249.814615 
-287524.356254  9113268.902141 
-287524.510668  9113289.997690 
-287529.620298  9113309.089522 
-287533.655061  9113317.130228 
-287542.659748  9113325.176314 
-287554.668452  9113336.239274 
-287559.711916  9113346.290151 
-287563.746689  9113354.330851 
-287572.876417  9113379.454272 
-287580.018187  9113404.575538 
-287582.241522  9113436.723274 
-287579.516996  9113471.879285 
-287574.753009  9113500.001299 
-287570.983009  9113528.124389 
-287572.109397  9113546.207356 
-287576.203045  9113562.284446 
-287578.242515  9113569.318441 
-287583.396363  9113594.437549 
-287589.485360  9113611.521333 
-287600.610526  9113637.651426 
-287613.672191  9113656.751814 
-287626.748583  9113677.861293 
-287641.812973  9113698.972910 
-287653.836534  9113712.044912 
-287665.889536  9113729.135104 
-287675.954564  9113746.223148 
-287681.064352  9113765.314932 
-287682.109861  9113772.347845 
-287685.202232  9113787.419290 
-287685.342063  9113806.505718 
-287681.542717  9113830.610607 
-287672.766034  9113853.705596 
-287661.979275  9113873.784796 
-287647.209164  9113892.855163 
-287630.428971  9113908.909739 
-287590.020941  9113956.079615 
-287581.207408  9113974.151855 
-287575.316999  9113984.190916 
-287583.511815  9114017.349618 
-287590.668496  9114044.479949 
-287591.934778  9114081.649341 
-287596.102120  9114107.771904 
-287606.432195  9114161.023715 
-287605.467632  9114165.040840 
-287602.544504  9114173.074022 
-287597.699607  9114190.146004 
-287604.016909  9114238.370782 
-287617.226024  9114277.562102 
-287629.345469  9114303.693207 
-287647.392157  9114324.807974 
-287658.399838  9114334.865216 
-287663.391953  9114337.884203 
-287756.769563  9114329.948141 
-287762.748323  9114331.963635 
-287770.729822  9114335.990356 
-287788.717658  9114349.068663 
-287810.725720  9114368.178509 
-287831.828187  9114399.341847 
-287757.807963  9114471.589430 
-287741.859643  9114465.545090 
-287728.142365  9114492.652968 
-287723.245964  9114502.693120 
-287719.358299  9114514.743435 
-287629.580782  9114607.064813 
-287612.815105  9114625.128539 
-287599.951842  9114633.151045 
-287388.175529  9114625.891186 
-287374.229909  9114621.857964 
-287361.226805  9114610.793959 
-287347.244407  9114601.737976 
-287328.291948  9114592.676615 
-287304.413564  9114589.637174 
-287288.494641  9114587.610873 
-287271.640543  9114593.619895 
-287250.788322  9114596.610956 
-287236.923609  9114603.627747 
-287210.202890  9114619.671496 
-287207.228200  9114620.672817 
-287191.382795  9114628.691994 
-287171.539264  9114633.693203 
-287148.779854  9114647.732133 
-287121.992901  9114654.734881 
-287088.313986  9114670.771026 
-287051.579487  9114676.758393 
-287048.612138  9114678.764257 
-287041.683423  9114682.774904 
-287022.900004  9114696.818106 
-287015.971284  9114700.828751 
-287004.065126  9114703.829438 
-286996.142385  9114707.839000 
-287004.462013  9114758.075251 
-287004.491413  9114762.093460 
-287001.568156  9114770.126635 
-286990.685396  9114777.146612 
-286965.886364  9114784.151453 
-286952.021535  9114791.168180 
-286942.118083  9114796.180126 
-286927.251878  9114802.191212 
-286908.424283  9114810.207071 
-286895.546107  9114816.220314 
-286877.712519  9114824.237245 
-286850.962123  9114836.262632 
-286839.983811  9114830.223395 
-286830.986196  9114823.181769 
-286819.934428  9114807.096995 
-286809.942800  9114800.054278 
-286787.263964  9114825.143158 
-286774.459212  9114841.201905 
-286762.604404  9114851.234415 
-286749.733533  9114858.252178 
-286742.804757  9114862.262792 
-286724.013811  9114875.301355 
-286702.211408  9114884.318439 
-286690.356570  9114894.350937 
-286668.612895  9114911.404440 
-286663.701522  9114919.435435 
-286658.826865  9114932.489199 
-286656.963652  9114949.564441 
-286656.013687  9114955.590677 
-286655.063723  9114961.616913 
-286651.212460  9114978.689981 
-286647.331822  9114991.744833 
-286640.469105  9115004.796424 
-286631.640362  9115020.859502 
-286620.816217  9115035.915851 
-286609.999408  9115051.976752 
-286603.092618  9115059.001017 
-286589.286373  9115074.054100 
-286576.422751  9115082.076388 
-286566.533867  9115089.097385 
-286544.760689  9115102.132642 
-286530.954410  9115117.185714 
-286520.122870  9115131.237497 
-286519.165547  9115136.259181 
-286518.259614  9115148.312746 
-286517.309633  9115154.338985 
-286520.438553  9115174.433342 
-286527.536258  9115193.527500 
-286546.701849  9115231.721247 
-286555.787643  9115250.817570 
-286569.895010  9115276.951207 
-286571.035909  9115297.043378 
-286575.173597  9115319.147918 
-286580.261263  9115335.226219 
-286589.273660  9115344.276986 
-286599.280095  9115353.328836 
-286613.262668  9115362.385028 
-286631.221383  9115371.445556 
-286643.164481  9115373.467688 
-286647.133271  9115372.467475 
-286681.047961  9115388.577214 
-286734.150577  9115445.894187 
-286739.164840  9115451.926920 
-286751.130003  9115456.962676 
-286759.126375  9115462.998654 
-286780.059906  9115471.057799 
-286796.008567  9115477.102421 
-286799.999408  9115479.115852 
-286819.946265  9115488.178447 
-286833.862761  9115488.193575 
-286852.771486  9115491.227758 
-286874.654966  9115493.260618 
-286891.553565  9115493.278967 
-286918.421924  9115497.326305 
-286931.359085  9115499.349428 
-286936.336614  9115500.359372 
-286954.251305  9115503.392431 
-286976.215672  9115516.475310 
-286981.244679  9115524.517110 
-286980.618337  9115574.743625 
-286979.778735  9115595.838136 
-286979.925819  9115615.929172 
-286983.990221  9115627.988100 
-286991.029385  9115639.045703 
-287007.073736  9115658.149401 
-287015.143727  9115674.230832 
-287024.126851  9115679.263268 
-287028.235408  9115697.349496 
-287035.311377  9115713.429845 
-287043.396103  9115731.520368 
-287051.436698  9115743.583580 
-287064.447498  9115755.652160 
-287078.430274  9115764.708155 
-287088.385390  9115766.727993 
-287101.329985  9115769.755599 
-287103.318066  9115769.757745 
-287115.261264  9115771.779722 
-287129.199900  9115774.808392 
-287136.187616  9115778.834102 
-287141.165175  9115779.844014 
-287152.180566  9115790.905866 
-287160.235918  9115804.978151 
-287167.275157  9115816.035709 
-287177.311242  9115829.105580 
-287183.312288  9115834.134760 
-287194.283541  9115839.169292 
-287209.179437  9115837.176250 
-287226.033969  9115831.167141 
-287281.287979  9115774.972227 
-287301.014159  9115753.898056 
-287328.685264  9115731.827878 
-287332.617241  9115725.804853 
-287341.526768  9115720.791717 
-287349.501160  9115723.813911 
-287354.522891  9115730.851098 
-287356.555146  9115736.880532 
-287359.632984  9115749.942881 
-287364.632630  9115753.966417 
-287371.568808  9115750.960239 
-287378.490257  9115745.944962 
-287388.327543  9115731.891940 
-287431.719059  9115684.725051 
-287470.118215  9115634.539166 
-287478.983514  9115623.498717 
-287499.652008  9115595.393719 
-287536.998062  9115537.170355 
-287582.281548  9115476.946399 
-287607.883239  9115443.823960 
-287804.095696  9115226.048416 
-287822.856861  9115208.991258 
-287850.608451  9115197.970916 
-287868.559848  9115206.026365 
-287893.521022  9115221.121045 
-287937.479268  9115251.304007 
-287952.293777  9115238.260760 
-287967.115650  9115226.222057 
-287987.850035  9115207.157866 
-288001.648368  9115191.099914 
-288011.441104  9115171.019549 
-288018.214895  9115145.913284 
-288011.227245  9115141.887704 
-287997.259325  9115134.841085 
-287975.250754  9115115.731444 
-287961.150132  9115090.602971 
-287944.936156  9115048.395077 
-287947.910843  9115047.393705 
-288031.275757  9115029.400696 
-288039.139418  9115017.354592 
-288040.876733  9114983.202130 
-288044.705322  9114963.115431 
-288056.419679  9114933.996268 
-288083.971910  9114895.853090 
-288095.745230  9114874.770295 
-288108.586304  9114863.734015 
-288123.437526  9114855.713482 
-288143.288317  9114851.716405 
-288171.076465  9114845.718665 
-288160.009542  9114827.625240 
-288146.880847  9114799.484242 
-288133.796421  9114777.370511 
-288129.724496  9114764.307191 
-288118.650240  9114745.209201 
-288116.617969  9114739.179812 
-288106.626228  9114732.137426 
-288102.591187  9114724.096831 
-288107.494880  9114715.061199 
-288133.095824  9114681.938646 
-288146.805485  9114653.826146 
-288159.609620  9114637.767139 
-288176.360284  9114617.694170 
-288187.183757  9114602.637594 
-288196.078208  9114595.615273 
-288197.042716  9114591.598145 
-288204.832524  9114569.506583 
-288121.262096  9114559.372407 
-Region 1
-326
-289398.575403  9114428.114641 
-289387.263988  9114376.871807 
-289323.729523  9114387.855760 
-289279.169759  9114410.913732 
-289246.493552  9114427.956829 
-289224.640357  9114429.943176 
-289197.883729  9114440.965204 
-289191.927125  9114441.963540 
-289164.265229  9114465.039004 
-289148.449966  9114477.076932 
-289127.783013  9114505.182331 
-289109.044880  9114525.253471 
-289084.364898  9114548.332014 
-289070.508012  9114556.353835 
-289040.732277  9114562.349983 
-289027.832413  9114565.350125 
-289019.880384  9114565.341826 
-289014.910366  9114565.336639 
-288983.146601  9114571.330677 
-288858.448924  9114645.535811 
-288841.676446  9114662.595336 
-288825.868404  9114675.637730 
-288810.045573  9114686.671036 
-288798.213544  9114699.717589 
-288777.442823  9114713.759306 
-288752.666501  9114723.778678 
-288733.905934  9114740.836094 
-288726.977422  9114744.846965 
-288706.250980  9114764.915917 
-288699.352012  9114772.944957 
-288682.527714  9114782.972647 
-288661.779074  9114800.027957 
-288642.988893  9114813.067178 
-288614.295516  9114831.118663 
-288600.475366  9114844.163096 
-288573.747819  9114859.203022 
-288544.119443  9114885.289779 
-288529.283088  9114895.319521 
-288500.641292  9114920.402763 
-288467.979103  9114939.454540 
-288450.160666  9114949.481123 
-288437.297531  9114957.503852 
-288175.096780  9114851.750156 
-288171.076465  9114845.718665 
-288143.288317  9114851.716405 
-288123.437526  9114855.713482 
-288108.586304  9114863.734015 
-288095.745230  9114874.770295 
-288083.971910  9114895.853090 
-288056.419679  9114933.996268 
-288044.705322  9114963.115431 
-288040.876733  9114983.202130 
-288039.139418  9115017.354592 
-288031.275757  9115029.400696 
-287947.910843  9115047.393705 
-287944.936156  9115048.395077 
-287961.150132  9115090.602971 
-287975.250754  9115115.731444 
-287997.259325  9115134.841085 
-288011.227245  9115141.887704 
-288018.214895  9115145.913284 
-288011.441104  9115171.019549 
-288001.648368  9115191.099914 
-287987.850035  9115207.157866 
-287967.115650  9115226.222057 
-287952.293777  9115238.260760 
-287937.479268  9115251.304007 
-287893.521022  9115221.121045 
-287868.559848  9115206.026365 
-287850.608451  9115197.970916 
-287822.856861  9115208.991258 
-287804.095696  9115226.048416 
-287607.883239  9115443.823960 
-287582.281548  9115476.946399 
-287536.998062  9115537.170355 
-287499.652008  9115595.393719 
-287478.983514  9115623.498717 
-287470.118215  9115634.539166 
-287431.719059  9115684.725051 
-287388.327543  9115731.891940 
-287378.490257  9115745.944962 
-287371.568808  9115750.960239 
-287364.632630  9115753.966417 
-287359.632984  9115749.942881 
-287356.555146  9115736.880532 
-287354.522891  9115730.851098 
-287349.501160  9115723.813911 
-287341.526768  9115720.791717 
-287332.617241  9115725.804853 
-287328.685264  9115731.827878 
-287301.014159  9115753.898056 
-287281.287979  9115774.972227 
-287314.297427  9115803.134894 
-287350.318490  9115835.318928 
-287353.315338  9115837.331229 
-287398.341740  9115877.561210 
-287427.367799  9115904.714946 
-287443.375587  9115918.795675 
-287500.308549  9115956.024642 
-287477.688698  9115989.150293 
-287453.117564  9116027.296556 
-287429.533072  9116064.439330 
-287409.836332  9116089.531769 
-287389.138159  9116113.618590 
-287363.506559  9116142.722827 
-287339.752544  9116156.760944 
-287323.958259  9116171.812132 
-287304.305606  9116202.931848 
-287293.584644  9116232.052060 
-287290.904449  9116273.235403 
-287283.195084  9116306.377016 
-287267.562758  9116343.528298 
-287244.957315  9116378.663013 
-287223.286982  9116405.762391 
-287210.445289  9116416.798569 
-287235.532295  9116448.970846 
-287254.684470  9116485.154905 
-287266.826732  9116514.299640 
-287294.005084  9116560.537687 
-287349.311225  9116511.374362 
-287371.857673  9116468.203206 
-287392.600180  9116450.143651 
-287443.068460  9116419.056830 
-287516.127147  9116350.826077 
-287529.911187  9116332.759057 
-287546.625771  9116307.663378 
-287561.352242  9116282.565576 
-287576.100811  9116260.481418 
-287591.931871  9116250.452896 
-287594.884529  9116246.437883 
-287602.755826  9116235.396332 
-287614.573823  9116220.340826 
-287632.385581  9116209.309866 
-287641.302515  9116205.301206 
-287655.174935  9116199.288744 
-287665.998858  9116184.232172 
-287672.809728  9116164.148626 
-287678.626549  9116144.064022 
-287683.500930  9116131.010194 
-287693.330786  9116115.952563 
-287718.056554  9116098.901707 
-287731.810953  9116076.816470 
-287741.589169  9116054.727003 
-287750.373336  9116032.636478 
-287750.247985  9116015.559172 
-287743.208584  9116004.501746 
-287736.161813  9115992.439770 
-287731.110503  9115981.384457 
-287726.994255  9115962.293820 
-287725.941232  9115954.256381 
-287730.756611  9115933.166175 
-287732.619357  9115916.090983 
-287730.572297  9115908.052485 
-287723.503434  9115892.976860 
-287712.502651  9115883.924282 
-287706.472069  9115874.876998 
-287705.448542  9115870.857747 
-287705.389569  9115862.821366 
-287713.282907  9115854.793459 
-287719.210280  9115849.777076 
-287730.048867  9115836.729606 
-287739.937644  9115829.708362 
-287747.845715  9115823.689547 
-287755.761155  9115818.675279 
-287762.682556  9115813.659951 
-287771.614149  9115811.660381 
-287775.560807  9115807.646424 
-287778.528174  9115805.640504 
-287774.456178  9115792.577155 
-287773.381041  9115781.526075 
-287774.271860  9115767.463470 
-287776.208324  9115760.433755 
-287779.146198  9115754.409646 
-287786.052841  9115747.385222 
-287798.894206  9115736.348958 
-287806.809626  9115731.334685 
-287811.735565  9115725.312691 
-287818.583213  9115710.251887 
-287820.527043  9115704.226719 
-287830.415777  9115697.205466 
-287833.383134  9115695.199544 
-287839.244112  9115681.142229 
-287841.210059  9115678.130703 
-287843.168633  9115674.114629 
-287845.090339  9115665.075820 
-287850.973431  9115654.032147 
-287859.831248  9115641.987098 
-287869.705215  9115632.956746 
-287868.622695  9115620.901125 
-287865.471000  9115597.793373 
-287864.395858  9115586.742299 
-287866.310186  9115576.698944 
-287868.224513  9115566.655589 
-287877.097061  9115556.619635 
-287891.963287  9115550.608210 
-287901.837231  9115541.577857 
-287917.682729  9115533.558389 
-287930.531380  9115523.526655 
-287940.420059  9115516.505390 
-287952.282045  9115507.477142 
-287961.154561  9115497.441179 
-287968.039015  9115487.403104 
-287973.973689  9115483.391251 
-287985.813532  9115471.349359 
-287990.732047  9115464.322811 
-288000.628079  9115458.306084 
-288008.536051  9115452.287246 
-288016.421892  9115443.254769 
-288018.343563  9115434.215962 
-288020.250482  9115423.168063 
-288022.164776  9115413.124711 
-288024.056941  9115400.067719 
-288030.963498  9115393.043279 
-288038.871456  9115387.024440 
-288046.779411  9115381.005599 
-288051.727414  9115377.997233 
-288062.610069  9115370.977007 
-288071.489913  9115361.945580 
-288078.389079  9115353.916590 
-288090.265749  9115346.897414 
-288098.166312  9115339.874022 
-288110.050352  9115333.859388 
-288118.989201  9115332.864321 
-288126.926647  9115330.863654 
-288152.668000  9115316.827386 
-288166.495800  9115304.787572 
-288175.309200  9115286.715223 
-288165.214012  9115265.609245 
-288157.092126  9115242.496277 
-288170.794476  9115213.379193 
-288226.230956  9115182.297204 
-288233.159587  9115178.286383 
-288245.036184  9115171.267183 
-288257.928937  9115167.262666 
-288271.815707  9115163.259197 
-288291.607552  9115151.225667 
-288302.512252  9115147.219040 
-288317.363506  9115139.198430 
-288330.219332  9115130.171174 
-288342.103278  9115124.156499 
-288351.005163  9115118.138674 
-288362.881720  9115111.119451 
-288378.741731  9115105.108965 
-288390.633044  9115100.098825 
-288408.481082  9115094.090426 
-288428.295001  9115085.070485 
-288441.136018  9115074.034117 
-288453.019929  9115068.019420 
-288465.868319  9115057.987592 
-288483.716325  9115051.979170 
-288502.558341  9115045.971788 
-288514.427465  9115037.947992 
-288526.303968  9115030.928736 
-288535.213190  9115025.915429 
-288544.107638  9115018.893034 
-288554.938416  9115004.840923 
-288563.840243  9114998.823068 
-288571.748052  9114992.804168 
-288581.658661  9114988.796443 
-288596.561502  9114987.807569 
-288608.467523  9114984.806471 
-288625.277134  9114972.769701 
-288635.180344  9114967.757424 
-288654.022293  9114961.749992 
-288664.926898  9114957.743296 
-288676.825515  9114953.737640 
-288684.740686  9114948.723268 
-288692.655855  9114943.708895 
-288701.542870  9114935.681935 
-288705.481981  9114930.663391 
-288712.395743  9114924.643431 
-288718.322878  9114919.626971 
-288727.224661  9114913.609093 
-288735.147207  9114909.599258 
-288745.042998  9114903.582420 
-288760.843745  9114889.535489 
-288764.716340  9114875.476060 
-288769.582945  9114861.417672 
-288770.495672  9114850.368747 
-288775.362274  9114836.310359 
-288775.317937  9114830.283105 
-288779.242253  9114823.255473 
-288787.179558  9114821.254718 
-288799.100294  9114820.262668 
-288812.037209  9114822.285282 
-288823.965333  9114822.297768 
-288832.926206  9114824.316214 
-288839.876888  9114823.318952 
-288848.815588  9114822.323769 
-288855.692357  9114811.281085 
-288860.573712  9114799.231780 
-288868.474049  9114792.208303 
-288880.335638  9114783.179899 
-288887.241960  9114776.155380 
-288898.116923  9114768.130476 
-288908.020050  9114763.118156 
-288919.940760  9114762.126078 
-288929.829097  9114755.104671 
-288939.732216  9114750.092346 
-288950.636734  9114746.085598 
-288956.593388  9114745.087284 
-288964.508486  9114740.072879 
-288969.441558  9114735.055360 
-289008.096941  9114720.027691 
-289023.934505  9114711.003408 
-289043.533645  9114672.851575 
-289047.457906  9114665.823933 
-289095.897940  9114629.711215 
-289141.437239  9114604.645305 
-289178.104422  9114589.615462 
-289188.942295  9114576.567808 
-289190.878521  9114569.538093 
-289174.811746  9114547.421664 
-289183.713386  9114541.403728 
-289189.625621  9114534.378148 
-289200.404303  9114513.294173 
-289212.332321  9114513.306576 
-289258.019392  9114508.331391 
-289277.943806  9114514.379274 
-289304.870629  9114526.461606 
-289323.793652  9114531.503896 
-289357.537888  9114524.507157 
-289395.250710  9114516.509975 
-289412.185728  9114521.550167 
-289446.968344  9114520.581629 
-289398.575403  9114428.114641 
-Region 1
-136
-287715.683944  9112656.338954 
-287715.632468  9112649.307109 
-287717.443916  9112625.200080 
-287719.255366  9112601.093051 
-287717.215956  9112594.059054 
-287715.169195  9112586.020508 
-287709.102448  9112571.950360 
-287704.007613  9112554.867639 
-287694.922214  9112535.771509 
-287684.842858  9112516.674299 
-287673.843066  9112507.621501 
-287662.850631  9112499.573250 
-287655.863466  9112495.547505 
-287642.868403  9112485.487992 
-287637.913279  9112487.491699 
-287620.007200  9112485.463182 
-287601.107156  9112483.433579 
-287586.175624  9112480.403736 
-287561.289739  9112475.353987 
-287546.358210  9112472.324130 
-287523.430866  9112463.258317 
-287509.434521  9112452.193124 
-287505.436616  9112449.175146 
-287495.438182  9112441.127925 
-287484.423745  9112430.065966 
-287478.371789  9112418.004865 
-287472.349225  9112409.961966 
-287468.343979  9112405.939433 
-287463.359463  9112403.924918 
-287453.441858  9112406.927741 
-287449.495386  9112410.941612 
-287446.564917  9112417.970218 
-287448.604272  9112425.004240 
-287453.698991  9112442.087017 
-287458.771674  9112456.156140 
-287461.878471  9112473.236750 
-287466.936467  9112485.296769 
-287464.977924  9112489.312807 
-287460.044828  9112494.330149 
-287446.217460  9112506.369602 
-287437.359921  9112518.414467 
-287432.426819  9112523.431807 
-287422.582651  9112536.480139 
-287414.821919  9112562.589798 
-287408.975654  9112578.656114 
-287400.147479  9112594.719181 
-287388.300659  9112605.756242 
-287376.453833  9112616.793302 
-287369.525429  9112620.803920 
-287350.713459  9112630.828838 
-287344.779021  9112634.840538 
-287337.835920  9112636.842051 
-287330.907509  9112640.852665 
-287328.970984  9112647.882355 
-287324.103963  9112661.940652 
-287320.223565  9112674.995481 
-287318.353145  9112691.066134 
-287314.538851  9112713.161926 
-287311.689149  9112731.240597 
-287309.782001  9112742.288493 
-287307.838127  9112748.313633 
-287306.924952  9112759.362613 
-287306.070540  9112778.448005 
-287305.157366  9112789.496986 
-287306.239485  9112801.552687 
-287306.305595  9112810.593649 
-287307.328952  9112814.612939 
-287144.552045  9112846.580529 
-287123.634501  9112840.530373 
-287105.662182  9112829.460710 
-287092.681770  9112821.410138 
-287085.694578  9112817.384306 
-287083.978236  9112854.550573 
-287085.199783  9112885.692790 
-287085.375971  9112909.802051 
-287088.534096  9112933.914576 
-287092.583424  9112943.964454 
-287101.632014  9112958.037979 
-287111.615852  9112964.076171 
-287131.539478  9112970.125232 
-287128.682366  9112987.199358 
-287148.606004  9112993.248409 
-287163.537719  9112996.278362 
-287187.444623  9113003.336289 
-287208.362249  9113009.386395 
-287237.202331  9113011.426961 
-287264.017724  9113008.442582 
-287286.857196  9113005.453854 
-287305.720748  9113002.460783 
-287327.536842  9112995.452749 
-287345.406405  9112992.458580 
-287368.289942  9112995.497120 
-287389.222265  9113003.556239 
-287409.167964  9113012.618817 
-287426.197880  9113030.719098 
-287435.253931  9113045.797079 
-287435.371528  9113061.869887 
-287430.511880  9113076.932746 
-287418.687021  9113090.983493 
-287406.847456  9113103.025137 
-287399.977788  9113115.072183 
-287391.120154  9113127.117067 
-287383.315291  9113147.199437 
-287378.514415  9113170.298702 
-287371.703525  9113190.382153 
-287408.605813  9113207.499484 
-287412.596443  9113209.512905 
-287416.587073  9113211.526324 
-287421.512882  9113205.504419 
-287434.346444  9113193.463845 
-287456.081727  9113175.405678 
-287475.829031  9113157.345347 
-287479.782900  9113154.336010 
-287502.504774  9113135.274357 
-287532.118315  9113107.179291 
-287563.712424  9113078.081818 
-287598.288425  9113048.987562 
-287609.133938  9113036.944807 
-287595.063835  9113015.834193 
-287599.974895  9113007.803179 
-287611.829084  9112997.770601 
-287626.650490  9112985.732151 
-287646.375581  9112964.658132 
-287657.169585  9112945.583526 
-287660.114740  9112940.564007 
-287670.901381  9112920.484851 
-287684.633163  9112895.386175 
-287696.428468  9112877.317192 
-287707.185663  9112853.219838 
-287714.018443  9112836.150028 
-287718.870629  9112820.082617 
-287717.707499  9112796.976913 
-287716.426703  9112757.798421 
-287718.098412  9112714.604958 
-287718.879113  9112685.474108 
-287715.683944  9112656.338954 
-Region 1
-185
-289827.275749  9112310.003412 
-289819.116996  9112281.868097 
-289816.046370  9112269.810545 
-289803.608542  9112200.485033 
-289796.369815  9112162.305355 
-289791.222555  9112138.191274 
-289781.855438  9112080.923294 
-289771.479628  9112021.645194 
-289759.086397  9111958.346861 
-289751.892163  9111926.194385 
-289750.846458  9111919.161581 
-289756.765739  9111913.140559 
-289772.587457  9111902.107193 
-289776.459689  9111888.047793 
-289745.507026  9111868.929476 
-289707.596804  9111849.803878 
-289673.662368  9111830.682388 
-289639.676216  9111804.529093 
-289604.747896  9111785.406498 
-289562.126728  9111801.434438 
-289547.328470  9111816.486934 
-289522.627739  9111836.551722 
-289503.868467  9111853.609128 
-289486.051403  9111863.635790 
-289343.529339  9111945.857980 
-289335.577783  9111945.849629 
-289329.577189  9111940.820660 
-289323.561825  9111933.782609 
-289310.515004  9111916.691835 
-289298.528599  9111908.642969 
-289283.560367  9111900.590962 
-289257.577538  9111881.477491 
-289241.607993  9111872.419880 
-289231.579965  9111860.354917 
-289216.523167  9111840.248384 
-289110.985782  9111680.416121 
-288861.080570  9111757.500586 
-288856.118230  9111758.499852 
-288450.508456  9111882.629966 
-288302.748859  9111928.680349 
-288245.254368  9111949.713917 
-288224.440299  9111957.727859 
-288166.953073  9111979.765891 
-287901.199028  9112064.865093 
-287924.516007  9112127.171808 
-287853.318866  9112177.321851 
-287829.493302  9112181.314230 
-287808.627544  9112182.296180 
-287767.889977  9112184.261129 
-287729.140314  9112186.228199 
-287701.338885  9112190.216202 
-287677.542682  9112198.226705 
-287653.739119  9112205.232647 
-287625.893565  9112203.193308 
-287596.965868  9112189.098271 
-287552.737350  9112257.359025 
-287572.734138  9112273.453455 
-287590.706273  9112284.522962 
-287614.656881  9112297.608039 
-287618.647426  9112299.621459 
-287627.659226  9112308.672126 
-287631.664471  9112312.694644 
-287638.681003  9112320.738599 
-287641.684939  9112323.755486 
-287642.708301  9112327.774764 
-287646.720900  9112332.801830 
-287644.799130  9112341.840619 
-287644.821181  9112344.854268 
-287639.873421  9112347.862522 
-287636.898885  9112348.863834 
-287627.010712  9112355.884889 
-287615.112561  9112359.890134 
-287600.276616  9112369.919436 
-287602.352738  9112381.976195 
-287612.395269  9112396.050691 
-287615.421260  9112402.081229 
-287624.550692  9112427.204688 
-287632.517105  9112429.222420 
-287642.471448  9112431.242308 
-287650.437862  9112433.260036 
-287659.405593  9112436.283391 
-287666.407450  9112442.318236 
-287663.477017  9112449.346849 
-287656.614834  9112462.398446 
-287651.718523  9112472.438551 
-287642.868403  9112485.487992 
-287655.863466  9112495.547505 
-287662.850631  9112499.573250 
-287673.843066  9112507.621501 
-287684.842858  9112516.674299 
-287694.922214  9112535.771509 
-287704.007613  9112554.867639 
-287709.102448  9112571.950360 
-287715.169195  9112586.020508 
-287717.215956  9112594.059054 
-287719.255366  9112601.093051 
-287717.443916  9112625.200080 
-287715.632468  9112649.307109 
-287715.683944  9112656.338954 
-287718.879113  9112685.474108 
-287718.098412  9112714.604958 
-287716.426703  9112757.798421 
-287717.707499  9112796.976913 
-287718.870629  9112820.082617 
-287714.018443  9112836.150028 
-287707.185663  9112853.219838 
-287696.428468  9112877.317192 
-287684.633163  9112895.386175 
-287670.901381  9112920.484851 
-287660.114740  9112940.564007 
-287657.169585  9112945.583526 
-287646.375581  9112964.658132 
-287626.650490  9112985.732151 
-287611.829084  9112997.770601 
-287599.974895  9113007.803179 
-287595.063835  9113015.834193 
-287609.133938  9113036.944807 
-287673.573306  9113013.910086 
-287722.108974  9112990.858107 
-287754.851325  9112982.857148 
-287759.806490  9112980.853416 
-287765.755630  9112978.850758 
-287817.368768  9112968.861047 
-287889.855333  9112958.893768 
-287956.436882  9112956.956349 
-288021.994979  9112950.999575 
-288025.963511  9112949.999298 
-288032.921325  9112950.006771 
-288087.567764  9112947.051805 
-288137.229586  9112942.082356 
-288146.167975  9112941.087395 
-288191.839149  9112934.104536 
-288251.425902  9112927.136515 
-288315.003241  9112922.181757 
-288377.571833  9112915.216762 
-288450.080089  9112908.262271 
-288512.663343  9112903.306188 
-288575.231813  9112896.340933 
-288601.052891  9112893.354744 
-288626.248762  9112940.594693 
-288650.413842  9112982.810841 
-288682.102875  9112966.771847 
-288727.692704  9112948.738481 
-288767.348187  9112934.716944 
-288804.006973  9112918.683139 
-288830.740806  9112904.647897 
-288840.658347  9112901.644768 
-288849.677863  9112911.699646 
-288874.556591  9112915.744052 
-288909.286422  9112907.744417 
-288930.085925  9112897.721004 
-288945.937728  9112890.705972 
-288952.880734  9112888.704221 
-288955.810958  9112881.675567 
-288956.708953  9112868.617563 
-288956.561305  9112848.526716 
-288952.437796  9112828.431677 
-288947.342473  9112811.349216 
-288937.255185  9112791.247884 
-288931.165910  9112774.164369 
-288927.094095  9112761.101121 
-288926.041081  9112753.063732 
-289030.921362  9112687.879553 
-289130.890584  9112630.726308 
-289156.630160  9112616.689890 
-289183.356293  9112601.649964 
-289232.928691  9112584.624938 
-289239.871630  9112582.623157 
-289289.466137  9112568.611701 
-289295.415111  9112566.608870 
-289353.955190  9112552.606726 
-289404.550949  9112539.600741 
-289460.079491  9112521.577198 
-289516.631501  9112507.572792 
-289542.429991  9112501.572514 
-289574.177416  9112493.569361 
-289602.957748  9112487.572159 
-289640.668869  9112479.575176 
-289697.205927  9112463.561493 
-289733.937835  9112457.572483 
-289777.568214  9112443.554363 
-289827.110476  9112422.510627 
-289829.053985  9112416.485461 
-289840.818624  9112394.397997 
-289827.275749  9112310.003412 
-Region 1
-240
-289161.766920  9114395.723639 
-289147.717818  9114377.627413 
-289117.609469  9114338.419246 
-289090.520136  9114304.236863 
-289060.500604  9114277.083127 
-289033.470488  9114250.937020 
-289011.417776  9114225.800628 
-288996.360014  9114205.694205 
-288967.245918  9114166.486918 
-288953.145246  9114141.358803 
-288933.971175  9114102.161885 
-288922.808196  9114071.009624 
-288911.623074  9114036.843730 
-288901.535393  9114016.742462 
-288895.460627  9114001.668072 
-288863.061960  9113921.271296 
-288855.124810  9113923.272027 
-288829.354913  9113933.290293 
-288829.295828  9113925.253952 
-288826.217845  9113912.191764 
-288826.099679  9113896.119083 
-288822.005556  9113880.042220 
-288814.922084  9113862.957678 
-288807.786927  9113838.841333 
-288796.712747  9113819.743515 
-288787.597019  9113796.629614 
-288771.479090  9113767.481123 
-288760.382799  9113745.369659 
-288756.333022  9113735.320039 
-288753.277234  9113725.271466 
-288746.142146  9113701.155097 
-288741.031952  9113682.063538 
-288731.916294  9113658.949611 
-288725.775222  9113634.834282 
-288716.600536  9113603.684000 
-288718.566361  9113600.672468 
-288729.478041  9113597.670376 
-288743.371670  9113594.671427 
-288761.211702  9113587.658495 
-288777.056379  9113579.638918 
-288780.030946  9113578.637518 
-288791.870152  9113566.595574 
-288805.653019  9113548.528467 
-288802.656305  9113546.516239 
-288796.648115  9113540.482696 
-288785.655249  9113532.434828 
-288775.671134  9113526.397090 
-288763.684293  9113518.348166 
-288753.678038  9113509.296792 
-288742.670425  9113499.239823 
-288736.677010  9113495.215355 
-288730.654072  9113487.172714 
-288728.584920  9113476.120638 
-288730.499074  9113466.077304 
-288734.438094  9113461.058785 
-288726.427201  9113453.014043 
-288695.444057  9113429.876995 
-288670.476477  9113413.778030 
-288661.508518  9113410.754938 
-288647.607552  9113412.749307 
-288622.706395  9113405.691204 
-288603.783881  9113400.648490 
-288591.848739  9113399.631314 
-288584.876123  9113397.614855 
-288596.875727  9113272.060530 
-288603.457355  9113220.836154 
-288605.216634  9113189.697393 
-288605.128117  9113177.642864 
-288604.980590  9113157.551981 
-288598.817587  9113130.422965 
-288593.685447  9113108.317722 
-288589.606292  9113094.249885 
-288589.473533  9113076.168088 
-288590.445379  9113073.155510 
-288594.354892  9113064.118830 
-288601.194692  9113048.053504 
-288613.041229  9113037.016170 
-288627.884427  9113027.991084 
-288641.726271  9113017.960397 
-288653.565412  9113005.918513 
-288650.413842  9112982.810841 
-288626.248762  9112940.594693 
-288601.052891  9112893.354744 
-288575.231813  9112896.340933 
-288512.663343  9112903.306188 
-288450.080089  9112908.262271 
-288377.571833  9112915.216762 
-288315.003241  9112922.181757 
-288251.425902  9112927.136515 
-288191.839149  9112934.104536 
-288146.167975  9112941.087395 
-288137.229586  9112942.082356 
-288087.567764  9112947.051805 
-288032.921325  9112950.006771 
-288025.963511  9112949.999298 
-288021.994979  9112950.999575 
-287956.436882  9112956.956349 
-287889.855333  9112958.893768 
-287817.368768  9112968.861047 
-287765.755630  9112978.850758 
-287759.894769  9112992.908002 
-287760.071330  9113017.017173 
-287763.185684  9113035.102270 
-287771.233140  9113048.169986 
-287779.251172  9113057.219505 
-287790.236424  9113064.263141 
-287800.220344  9113070.301152 
-287807.251766  9113080.354140 
-287813.340723  9113097.437894 
-287819.444403  9113116.530743 
-287821.579535  9113136.623853 
-287859.313920  9113131.641798 
-287869.459781  9113159.779848 
-287883.066039  9113253.216722 
-287882.160388  9113265.270229 
-287879.222610  9113271.294310 
-287873.317608  9113279.324279 
-287864.445381  9113289.360136 
-287860.535699  9113298.396792 
-287859.630044  9113310.450300 
-287860.646108  9113313.465013 
-287863.679581  9113320.500058 
-287870.703706  9113329.548474 
-287879.737884  9113341.612670 
-287884.744605  9113346.640754 
-287886.747294  9113348.651987 
-287891.754017  9113353.680069 
-287901.863170  9113376.795353 
-287908.946211  9113393.880141 
-287916.051346  9113413.978571 
-287921.197970  9113438.093054 
-287932.315878  9113463.218484 
-287942.336727  9113474.279176 
-287956.355614  9113488.357773 
-287963.394517  9113499.415258 
-287966.479572  9113513.482121 
-287965.581321  9113526.540171 
-287969.748740  9113552.662667 
-287976.868671  9113574.770168 
-287980.955094  9113589.842639 
-287979.048132  9113600.890530 
-287976.154547  9113612.941902 
-287988.649543  9113690.304821 
-287986.705757  9113696.329975 
-287988.826320  9113714.413954 
-287999.937001  9113738.534793 
-288009.972673  9113751.604545 
-288011.018229  9113758.637438 
-288012.041687  9113762.656690 
-288006.202969  9113779.727608 
-287992.485974  9113806.835488 
-287984.732924  9113833.949750 
-287984.902352  9113857.054335 
-287987.052405  9113879.156500 
-287991.175717  9113899.251697 
-287998.258919  9113916.336440 
-287997.345963  9113927.385395 
-287997.015035  9114017.793566 
-287993.061829  9114156.415741 
-288023.993735  9114172.521402 
-288050.964397  9114190.631888 
-288065.948107  9114200.693259 
-288083.980161  9114219.798722 
-288096.003996  9114232.870540 
-288097.042224  9114238.898877 
-288101.121427  9114252.966763 
-288107.254982  9114276.077683 
-288109.434650  9114302.198004 
-288101.674292  9114328.307738 
-288093.891813  9114351.403833 
-288083.075714  9114367.464928 
-288075.315338  9114393.574663 
-288070.441143  9114406.628471 
-288066.568322  9114420.687886 
-288068.689022  9114438.771840 
-288075.750268  9114452.842901 
-288082.841009  9114470.932145 
-288082.892614  9114477.963970 
-288082.929475  9114482.986701 
-288092.987502  9114499.070024 
-288099.069507  9114515.149112 
-288104.128019  9114527.208955 
-288113.236297  9114549.318488 
-288121.262096  9114559.372407 
-288204.832524  9114569.506583 
-288197.042716  9114591.598145 
-288196.078208  9114595.615273 
-288187.183757  9114602.637594 
-288176.360284  9114617.694170 
-288159.609620  9114637.767139 
-288146.805485  9114653.826146 
-288133.095824  9114681.938646 
-288107.494880  9114715.061199 
-288102.591187  9114724.096831 
-288106.626228  9114732.137426 
-288116.617969  9114739.179812 
-288118.650240  9114745.209201 
-288129.724496  9114764.307191 
-288133.796421  9114777.370511 
-288146.880847  9114799.484242 
-288160.009542  9114827.625240 
-288171.076465  9114845.718665 
-288175.096780  9114851.750156 
-288437.297531  9114957.503852 
-288450.160666  9114949.481123 
-288467.979103  9114939.454540 
-288500.641292  9114920.402763 
-288529.283088  9114895.319521 
-288544.119443  9114885.289779 
-288573.747819  9114859.203022 
-288600.475366  9114844.163096 
-288614.295516  9114831.118663 
-288642.988893  9114813.067178 
-288661.779074  9114800.027957 
-288682.527714  9114782.972647 
-288699.352012  9114772.944957 
-288706.250980  9114764.915917 
-288726.977422  9114744.846965 
-288733.905934  9114740.836094 
-288752.666501  9114723.778678 
-288777.442823  9114713.759306 
-288798.213544  9114699.717589 
-288810.045573  9114686.671036 
-288825.868404  9114675.637730 
-288841.676446  9114662.595336 
-288858.448924  9114645.535811 
-288983.146601  9114571.330677 
-289014.910366  9114565.336639 
-289019.880384  9114565.341826 
-289027.832413  9114565.350125 
-289040.732277  9114562.349983 
-289070.508012  9114556.353835 
-289084.364898  9114548.332014 
-289109.044880  9114525.253471 
-289127.783013  9114505.182331 
-289148.449966  9114477.076932 
-289164.265229  9114465.039004 
-289191.927125  9114441.963540 
-289177.804034  9114413.821926 
-289161.766920  9114395.723639 
-Region 1
-152
-289488.658305  9113568.329091 
-289455.427944  9113510.031732 
-289449.234772  9113478.884810 
-289455.963312  9113447.751323 
-289466.630769  9113411.599275 
-289468.478182  9113392.515094 
-289473.292728  9113371.424936 
-289469.213275  9113357.357250 
-289466.142594  9113345.299676 
-289469.785655  9113300.099539 
-289469.719090  9113291.058684 
-289466.507893  9113259.914860 
-289459.298631  9113225.753277 
-289448.209639  9113204.646563 
-289438.181183  9113192.581736 
-289419.229177  9113183.521204 
-289418.999952  9113152.380472 
-289404.995636  9113140.311489 
-289361.342259  9113151.315811 
-289358.367739  9113152.317239 
-289344.511288  9113160.339037 
-289329.727391  9113177.400655 
-289307.080413  9113206.508450 
-289290.293759  9113221.558905 
-289282.356761  9113223.559678 
-289261.490721  9113224.542403 
-289242.620016  9113226.531739 
-289215.804911  9113229.517289 
-289195.969783  9113235.523730 
-289178.122595  9113241.532245 
-289159.318372  9113252.562419 
-289143.503451  9113264.600252 
-289137.591325  9113271.625792 
-289127.725464  9113281.660788 
-289112.948828  9113299.726905 
-289103.134673  9113316.793688 
-289089.359382  9113335.865385 
-289080.472698  9113343.892336 
-289075.547142  9113349.914373 
-289060.748304  9113364.966857 
-289048.879677  9113372.990676 
-289035.000929  9113377.998782 
-289019.126834  9113382.000255 
-289000.196940  9113375.953172 
-288964.384199  9113371.897407 
-288942.509303  9113370.869874 
-288919.647811  9113370.845827 
-288890.829831  9113371.820033 
-288869.993206  9113376.820767 
-288853.176787  9113387.852937 
-288831.427377  9113403.902580 
-288813.683398  9113423.974578 
-288799.878414  9113439.028051 
-288784.078078  9113453.074882 
-288765.244118  9113460.086762 
-288748.368589  9113463.082561 
-288734.438094  9113461.058785 
-288730.499074  9113466.077304 
-288728.584920  9113476.120638 
-288730.654072  9113487.172714 
-288736.677010  9113495.215355 
-288742.670425  9113499.239823 
-288753.678038  9113509.296792 
-288763.684293  9113518.348166 
-288775.671134  9113526.397090 
-288785.655249  9113532.434828 
-288796.648115  9113540.482696 
-288802.656305  9113546.516239 
-288805.653019  9113548.528467 
-288791.870152  9113566.595574 
-288780.030946  9113578.637518 
-288777.056379  9113579.638918 
-288761.211702  9113587.658495 
-288743.371670  9113594.671427 
-288729.478041  9113597.670376 
-288718.566361  9113600.672468 
-288716.600536  9113603.684000 
-288725.775222  9113634.834282 
-288731.916294  9113658.949611 
-288741.031952  9113682.063538 
-288746.142146  9113701.155097 
-288753.277234  9113725.271466 
-288756.333022  9113735.320039 
-288760.382799  9113745.369659 
-288771.479090  9113767.481123 
-288787.597019  9113796.629614 
-288796.712747  9113819.743515 
-288807.786927  9113838.841333 
-288814.922084  9113862.957678 
-288822.005556  9113880.042220 
-288826.099679  9113896.119083 
-288826.217845  9113912.191764 
-288829.295828  9113925.253952 
-288829.354913  9113933.290293 
-288829.377070  9113936.303920 
-288855.124810  9113923.272027 
-288863.061960  9113921.271296 
-288895.460627  9114001.668072 
-288901.535393  9114016.742462 
-288911.623074  9114036.843730 
-288922.808196  9114071.009624 
-288933.971175  9114102.161885 
-288953.145246  9114141.358803 
-288967.245918  9114166.486918 
-288996.360014  9114205.694205 
-289011.417776  9114225.800628 
-289033.470488  9114250.937020 
-289060.500604  9114277.083127 
-289090.520136  9114304.236863 
-289117.609469  9114338.419246 
-289147.717818  9114377.627413 
-289161.766920  9114395.723639 
-289177.804034  9114413.821926 
-289191.927125  9114441.963540 
-289197.883729  9114440.965204 
-289224.640357  9114429.943176 
-289246.493552  9114427.956829 
-289279.169759  9114410.913732 
-289323.729523  9114387.855760 
-289359.224861  9114348.715844 
-289379.060402  9114342.709225 
-289407.782699  9114328.675555 
-289415.697666  9114323.661099 
-289425.950756  9114231.254824 
-289447.406537  9114040.416081 
-289446.345949  9114031.374198 
-289446.308950  9114026.351502 
-289226.015974  9113941.741767 
-289116.152348  9113870.305254 
-289072.261674  9113849.164156 
-289073.218709  9113844.142489 
-289141.604254  9113817.091589 
-289170.370723  9113809.085372 
-289182.276379  9113806.084205 
-289294.367531  9113775.060588 
-289298.306495  9113770.042029 
-289304.226032  9113764.021000 
-289343.028406  9113769.084059 
-289372.892318  9113775.142320 
-289389.819642  9113779.178049 
-289419.794528  9113800.304367 
-289458.767098  9113828.471718 
-289476.718025  9113836.526596 
-289480.701365  9113837.535259 
-289474.300902  9113778.261264 
-289461.943976  9113719.985610 
-289462.782593  9113698.891318 
-289469.488925  9113664.744209 
-289486.149856  9113632.616500 
-289502.788572  9113597.475174 
-289490.668458  9113571.344773 
-289488.658305  9113568.329091 
-Region 1
-105
-289336.286000  9113123.162748 
-289331.271796  9113117.130317 
-289312.149828  9113084.965299 
-289289.022453  9113048.777948 
-289270.901910  9113017.618478 
-289260.733139  9112986.467317 
-289260.422770  9112944.276608 
-289266.419919  9112813.693601 
-289266.390363  9112809.675438 
-289268.067957  9112767.486810 
-289266.830168  9112734.335924 
-289265.717990  9112718.262230 
-289264.672309  9112711.229403 
-289232.928691  9112584.624938 
-289183.356293  9112601.649964 
-289156.630160  9112616.689890 
-289130.890584  9112630.726308 
-289030.921362  9112687.879553 
-288926.041081  9112753.063732 
-288927.094095  9112761.101121 
-288931.165910  9112774.164369 
-288937.255185  9112791.247884 
-288947.342473  9112811.349216 
-288952.437796  9112828.431677 
-288956.561305  9112848.526716 
-288956.708953  9112868.617563 
-288955.810958  9112881.675567 
-288952.880734  9112888.704221 
-288945.937728  9112890.705972 
-288930.085925  9112897.721004 
-288909.286422  9112907.744417 
-288874.556591  9112915.744052 
-288849.677863  9112911.699646 
-288840.658347  9112901.644768 
-288830.740806  9112904.647897 
-288804.006973  9112918.683139 
-288767.348187  9112934.716944 
-288727.692704  9112948.738481 
-288682.102875  9112966.771847 
-288650.413842  9112982.810841 
-288653.565412  9113005.918513 
-288641.726271  9113017.960397 
-288627.884427  9113027.991084 
-288613.041229  9113037.016170 
-288601.194692  9113048.053504 
-288594.354892  9113064.118830 
-288590.445379  9113073.155510 
-288589.473533  9113076.168088 
-288589.606292  9113094.249885 
-288593.685447  9113108.317722 
-288598.817587  9113130.422965 
-288604.980590  9113157.551981 
-288605.128117  9113177.642864 
-288605.216634  9113189.697393 
-288603.457355  9113220.836154 
-288596.875727  9113272.060530 
-288584.876123  9113397.614855 
-288591.848739  9113399.631314 
-288603.783881  9113400.648490 
-288622.706395  9113405.691204 
-288647.607552  9113412.749307 
-288661.508518  9113410.754938 
-288670.476477  9113413.778030 
-288695.444057  9113429.876995 
-288726.427201  9113453.014043 
-288734.438094  9113461.058785 
-288748.368589  9113463.082561 
-288765.244118  9113460.086762 
-288784.078078  9113453.074882 
-288799.878414  9113439.028051 
-288813.683398  9113423.974578 
-288831.427377  9113403.902580 
-288853.176787  9113387.852937 
-288869.993206  9113376.820767 
-288890.829831  9113371.820033 
-288919.647811  9113370.845827 
-288942.509303  9113370.869874 
-288964.384199  9113371.897407 
-289000.196940  9113375.953172 
-289019.126834  9113382.000255 
-289035.000929  9113377.998782 
-289048.879677  9113372.990676 
-289060.748304  9113364.966857 
-289075.547142  9113349.914373 
-289080.472698  9113343.892336 
-289089.359382  9113335.865385 
-289103.134673  9113316.793688 
-289112.948828  9113299.726905 
-289127.725464  9113281.660788 
-289137.591325  9113271.625792 
-289143.503451  9113264.600252 
-289159.318372  9113252.562419 
-289178.122595  9113241.532245 
-289195.969783  9113235.523730 
-289215.804911  9113229.517289 
-289242.620016  9113226.531739 
-289261.490721  9113224.542403 
-289282.356761  9113223.559678 
-289290.293759  9113221.558905 
-289307.080413  9113206.508450 
-289329.727391  9113177.400655 
-289344.511288  9113160.339037 
-289358.367739  9113152.317239 
-289361.342259  9113151.315811 
-289336.286000  9113123.162748 
-Region 1
-113
-290148.265132  9112707.124089 
-290144.296712  9112708.124536 
-290131.404902  9112712.129389 
-290129.387357  9112708.109199 
-290124.350905  9112699.063260 
-290119.299641  9112688.008248 
-290114.337265  9112689.007669 
-290102.439412  9112693.013536 
-290077.634926  9112699.015165 
-290065.759283  9112706.034633 
-290039.003894  9112717.056878 
-290016.202106  9112725.069601 
-289991.442009  9112737.098410 
-289975.597908  9112745.118295 
-289960.710739  9112748.116516 
-289957.647420  9112737.063530 
-289950.519425  9112713.951993 
-289943.324811  9112681.799619 
-289929.017058  9112628.544767 
-289921.866901  9112602.419605 
-289919.812369  9112593.376714 
-289913.782016  9112584.329710 
-289899.770417  9112571.256330 
-289892.746117  9112562.208293 
-289884.742667  9112555.168301 
-289882.725152  9112551.148093 
-289876.709616  9112544.110157 
-289871.710238  9112540.086861 
-289867.727018  9112539.078207 
-289864.737754  9112538.070581 
-289855.792161  9112538.061316 
-289847.840523  9112538.053079 
-289835.913065  9112538.040721 
-289824.000406  9112540.037436 
-289812.080346  9112541.029610 
-289801.117242  9112537.000121 
-289795.116517  9112531.971246 
-289796.036480  9112521.926897 
-289800.932262  9112511.886672 
-289811.717774  9112491.807251 
-289818.564461  9112476.746397 
-289824.431990  9112463.693589 
-289823.341845  9112450.633565 
-289822.236903  9112435.564466 
-289827.110476  9112422.510627 
-289777.568214  9112443.554363 
-289733.937835  9112457.572483 
-289697.205927  9112463.561493 
-289640.668869  9112479.575176 
-289602.957748  9112487.572159 
-289574.177416  9112493.569361 
-289542.429991  9112501.572514 
-289516.631501  9112507.572792 
-289460.079491  9112521.577198 
-289404.550949  9112539.600741 
-289353.955190  9112552.606726 
-289295.415111  9112566.608870 
-289289.466137  9112568.611701 
-289239.871630  9112582.623157 
-289232.928691  9112584.624938 
-289264.672309  9112711.229403 
-289265.717990  9112718.262230 
-289266.830168  9112734.335924 
-289268.067957  9112767.486810 
-289266.390363  9112809.675438 
-289266.419919  9112813.693601 
-289260.422770  9112944.276608 
-289260.733139  9112986.467317 
-289270.901910  9113017.618478 
-289289.022453  9113048.777948 
-289312.149828  9113084.965299 
-289331.271796  9113117.130317 
-289336.286000  9113123.162748 
-289361.342259  9113151.315811 
-289404.995636  9113140.311489 
-289418.999952  9113152.380472 
-289422.975834  9113152.384616 
-289459.774925  9113155.436546 
-289501.536469  9113157.489077 
-289525.384356  9113156.509350 
-289563.110830  9113150.521376 
-289599.784132  9113136.496032 
-289637.421777  9113118.453540 
-289717.474388  9113056.255639 
-289704.360419  9113030.124254 
-289693.323193  9113016.049383 
-289700.251357  9113012.038444 
-289706.185554  9113008.026473 
-289712.119749  9113004.014502 
-289737.844449  9112987.968672 
-289740.811544  9112985.962685 
-289792.334892  9112963.916370 
-289850.919563  9112955.940727 
-289890.589274  9112943.927361 
-289927.269663  9112930.906350 
-289958.972807  9112916.875651 
-289969.876774  9112912.868781 
-290002.559037  9112896.830009 
-289998.509133  9112886.780544 
-290011.393605  9112881.771178 
-290021.311001  9112878.767811 
-290033.194099  9112872.752879 
-290043.074458  9112864.726825 
-290061.900460  9112856.709981 
-290077.722351  9112845.676452 
-290089.605431  9112839.661509 
-290104.448163  9112830.636023 
-290121.256584  9112818.598970 
-290143.057017  9112809.580630 
-290157.936770  9112805.577812 
-290177.778904  9112800.575558 
-290193.667425  9112798.582822 
-290148.265132  9112707.124089 
-Region 1
-106
-290678.369404  9112348.045961 
-290696.045314  9112318.932717 
-290654.284763  9112316.881119 
-290582.720659  9112316.808117 
-290538.964783  9112313.749847 
-290481.308479  9112312.686367 
-290437.567415  9112311.637066 
-290385.852534  9112307.565965 
-290349.039445  9112302.505569 
-290298.333323  9112300.444454 
-290247.627193  9112298.383282 
-290224.788623  9112301.373374 
-290195.978953  9112303.352780 
-290175.113455  9112304.335823 
-290146.325990  9112309.328807 
-290122.515663  9112315.331435 
-290107.643460  9112320.338743 
-290076.860666  9112324.325100 
-290054.029455  9112328.319648 
-290022.223081  9112328.286797 
-290011.289639  9112328.275499 
-289992.419405  9112330.265053 
-289986.455708  9112330.258887 
-289975.514862  9112329.243043 
-289968.564617  9112330.240384 
-289954.701133  9112337.257749 
-289931.951302  9112352.302151 
-289911.167154  9112364.334990 
-289893.342645  9112373.357299 
-289873.530226  9112382.377543 
-289852.716445  9112390.392211 
-289840.818624  9112394.397997 
-289829.053985  9112416.485461 
-289827.110476  9112422.510627 
-289822.236903  9112435.564466 
-289823.341845  9112450.633565 
-289824.431990  9112463.693589 
-289818.564461  9112476.746397 
-289811.717774  9112491.807251 
-289800.932262  9112511.886672 
-289796.036480  9112521.926897 
-289795.116517  9112531.971246 
-289801.117242  9112537.000121 
-289812.080346  9112541.029610 
-289824.000406  9112540.037436 
-289835.913065  9112538.040721 
-289847.840523  9112538.053079 
-289855.792161  9112538.061316 
-289864.737754  9112538.070581 
-289867.727018  9112539.078207 
-289871.710238  9112540.086861 
-289876.709616  9112544.110157 
-289882.725152  9112551.148093 
-289884.742667  9112555.168301 
-289892.746117  9112562.208293 
-289899.770417  9112571.256330 
-289913.782016  9112584.329710 
-289919.812369  9112593.376714 
-289921.866901  9112602.419605 
-289929.017058  9112628.544767 
-289943.324811  9112681.799619 
-289950.519425  9112713.951993 
-289957.647420  9112737.063530 
-289960.710739  9112748.116516 
-289975.597908  9112745.118295 
-289991.442009  9112737.098410 
-290016.202106  9112725.069601 
-290039.003894  9112717.056878 
-290065.759283  9112706.034633 
-290077.634926  9112699.015165 
-290102.439412  9112693.013536 
-290114.337265  9112689.007669 
-290119.299641  9112688.008248 
-290124.350905  9112699.063260 
-290129.387357  9112708.109199 
-290131.404902  9112712.129389 
-290144.296712  9112708.124536 
-290148.265132  9112707.124089 
-290193.667425  9112798.582822 
-290177.778904  9112800.575558 
-290157.936770  9112805.577812 
-290143.057017  9112809.580630 
-290121.256584  9112818.598970 
-290104.448163  9112830.636023 
-290089.605431  9112839.661509 
-290077.722351  9112845.676452 
-290061.900460  9112856.709981 
-290043.074458  9112864.726825 
-290033.194099  9112872.752879 
-290021.311001  9112878.767811 
-290011.393605  9112881.771178 
-289998.509133  9112886.780544 
-290002.559037  9112896.830009 
-290011.475070  9112892.821082 
-290047.131775  9112875.780821 
-290066.936927  9112865.755925 
-290292.966919  9112785.625831 
-290384.151550  9112750.560738 
-290448.617841  9112731.540632 
-290507.098078  9112709.500759 
-290527.748646  9112679.386035 
-290580.546962  9112560.905780 
-290618.695427  9112477.569002 
-290641.244729  9112435.401890 
-290666.634903  9112374.151679 
-290678.369404  9112348.045961 
-Region 1
-96
-289884.696746  9111469.271220 
-289886.507125  9111445.164376 
-289878.326441  9111414.015418 
-289871.258014  9111398.940102 
-289860.236057  9111386.874256 
-289849.191925  9111371.794792 
-289836.152549  9111355.708712 
-289822.119255  9111339.621590 
-289784.069065  9111301.409721 
-289764.064850  9111284.311807 
-289754.059052  9111275.260576 
-289733.068322  9111259.166144 
-289707.078411  9111239.048345 
-289687.096418  9111224.964002 
-289661.106544  9111204.846166 
-289647.132466  9111196.795279 
-289628.203537  9111190.748258 
-289610.275925  9111185.706809 
-289593.349628  9111181.670934 
-289569.443689  9111174.614133 
-289544.477356  9111158.515415 
-289522.551898  9111150.456131 
-289501.590833  9111138.379719 
-289450.686484  9111109.194742 
-289431.720685  9111098.124920 
-289416.642004  9111075.004786 
-289366.805506  9111055.866142 
-289328.057199  9111057.834338 
-289268.480724  9111065.807704 
-289197.993158  9111076.783056 
-289121.571475  9111091.770156 
-289054.080310  9111104.757546 
-288999.473281  9111112.735855 
-288935.942977  9111123.718220 
-288925.031879  9111126.720220 
-288999.150366  9111204.148209 
-289001.234089  9111217.209377 
-288969.031656  9111298.542535 
-288945.597574  9111355.776159 
-288940.701643  9111365.816312 
-288938.765390  9111372.846003 
-288931.874214  9111381.879501 
-288925.954849  9111387.900425 
-288919.026802  9111391.911206 
-288907.151199  9111398.930336 
-288765.423839  9111454.028989 
-288791.634739  9111504.283715 
-288729.628366  9111587.594172 
-288731.630986  9111589.605379 
-288740.650149  9111599.660352 
-288749.639833  9111605.697146 
-288759.652944  9111615.753172 
-288770.682113  9111628.823885 
-288781.681803  9111637.876417 
-288790.693615  9111646.926831 
-288801.693312  9111655.979357 
-288806.707251  9111662.011906 
-288809.718564  9111666.033252 
-288815.763309  9111677.089575 
-288826.814629  9111693.173897 
-288832.888876  9111708.248390 
-288837.954438  9111721.312738 
-288843.005258  9111732.367997 
-288848.078201  9111746.436885 
-288856.118230  9111758.499852 
-288861.080570  9111757.500586 
-289110.985782  9111680.416121 
-289216.523167  9111840.248384 
-289231.579965  9111860.354917 
-289241.607993  9111872.419880 
-289257.577538  9111881.477491 
-289283.560367  9111900.590962 
-289298.528599  9111908.642969 
-289310.515004  9111916.691835 
-289323.561825  9111933.782609 
-289329.577189  9111940.820660 
-289335.577783  9111945.849629 
-289343.529339  9111945.857980 
-289486.051403  9111863.635790 
-289503.868467  9111853.609128 
-289522.627739  9111836.551722 
-289547.328470  9111816.486934 
-289562.126728  9111801.434438 
-289604.747896  9111785.406498 
-289661.346772  9111642.822165 
-289704.012099  9111632.821408 
-289740.765536  9111629.846166 
-289761.342449  9111589.686388 
-289779.983218  9111556.556305 
-289784.901132  9111549.529717 
-289798.742262  9111539.498837 
-289812.568598  9111527.458877 
-289830.392838  9111518.436671 
-289861.093819  9111503.400685 
-289874.949705  9111495.378865 
-289884.696746  9111469.271220 
-Region 1
-102
-288925.031879  9111126.720220 
-288908.996333  9111108.621518 
-288905.985062  9111104.600171 
-288880.945214  9111078.455584 
-288840.098364  9111065.353096 
-288804.250642  9111056.274044 
-288791.314845  9111054.251169 
-288764.456690  9111051.208892 
-288720.731229  9111052.166721 
-288681.968031  9111052.125279 
-288631.270318  9111051.066491 
-288595.452067  9111046.005441 
-288533.828485  9111045.939371 
-288516.909606  9111042.907603 
-288490.088246  9111044.887885 
-288482.158898  9111047.892983 
-288470.253832  9111050.893810 
-288457.384278  9111057.911750 
-288440.583165  9111070.952690 
-288412.973936  9111101.059155 
-288389.318316  9111128.156250 
-288374.556539  9111148.231138 
-288371.589463  9111150.237023 
-288355.811661  9111167.297200 
-288341.020420  9111183.353898 
-288332.310518  9111215.489758 
-288338.531704  9111250.655304 
-288332.722648  9111271.744363 
-288321.855598  9111280.773516 
-288314.964286  9111289.806946 
-288305.113241  9111301.850806 
-288288.378228  9111323.932641 
-288282.502916  9111335.980780 
-288278.586040  9111344.012873 
-288261.851001  9111366.094704 
-288232.305124  9111403.230814 
-288212.617658  9111429.327612 
-288185.000725  9111458.429474 
-288169.185972  9111470.466889 
-288145.390260  9111478.477531 
-288112.678492  9111490.496694 
-288093.837748  9111496.503584 
-288083.927757  9111500.511037 
-288058.166186  9111511.533136 
-288045.369973  9111528.596483 
-288032.588460  9111547.668924 
-288012.922878  9111576.779320 
-288002.107166  9111592.840264 
-287990.297502  9111608.900132 
-287977.523302  9111628.977116 
-287965.728329  9111647.046078 
-287960.810078  9111654.072538 
-287952.961463  9111668.127608 
-287942.160419  9111686.197644 
-287936.277627  9111697.241221 
-288039.139554  9111763.652102 
-288067.095138  9111780.759462 
-288085.089191  9111794.842435 
-288099.166323  9111816.957491 
-288108.236939  9111834.044444 
-288117.336995  9111855.149583 
-288129.485136  9111885.298857 
-288143.635916  9111917.459358 
-288155.725224  9111939.572239 
-288161.791962  9111953.642318 
-288166.901553  9111972.734062 
-288166.953073  9111979.765891 
-288224.440299  9111957.727859 
-288245.254368  9111949.713917 
-288302.748859  9111928.680349 
-288450.508456  9111882.629966 
-288856.118230  9111758.499852 
-288848.078201  9111746.436885 
-288843.005258  9111732.367997 
-288837.954438  9111721.312738 
-288832.888876  9111708.248390 
-288826.814629  9111693.173897 
-288815.763309  9111677.089575 
-288809.718564  9111666.033252 
-288806.707251  9111662.011906 
-288801.693312  9111655.979357 
-288790.693615  9111646.926831 
-288781.681803  9111637.876417 
-288770.682113  9111628.823885 
-288759.652944  9111615.753172 
-288749.639833  9111605.697146 
-288740.650149  9111599.660352 
-288731.630986  9111589.605379 
-288729.628366  9111587.594172 
-288791.634739  9111504.283715 
-288765.423839  9111454.028989 
-288907.151199  9111398.930336 
-288919.026802  9111391.911206 
-288925.954849  9111387.900425 
-288931.874214  9111381.879501 
-288938.765390  9111372.846003 
-288940.701643  9111365.816312 
-288945.597574  9111355.776159 
-288969.031656  9111298.542535 
-289001.234089  9111217.209377 
-288999.150366  9111204.148209 
-288925.031879  9111126.720220 
-Region 1
-69
-289462.773181  9110995.695259 
-289443.755757  9110977.593647 
-289419.717062  9110952.455001 
-289396.694460  9110930.331007 
-289369.651911  9110902.175554 
-289336.653251  9110875.018322 
-289305.620333  9110844.849532 
-289276.575296  9110814.682813 
-289239.490419  9110772.453147 
-289197.391768  9110724.190914 
-289155.315333  9110678.942247 
-289119.268846  9110642.740737 
-289108.239907  9110629.670071 
-289084.179471  9110601.517527 
-289032.119887  9110550.230862 
-288975.135067  9110504.966071 
-288934.141398  9110471.772677 
-288893.184624  9110443.601949 
-288854.252554  9110420.456018 
-288811.403790  9110405.342144 
-288778.553095  9110398.275224 
-288741.741478  9110393.213106 
-288702.029114  9110399.197752 
-288629.620621  9110419.210783 
-288594.921935  9110431.227953 
-288589.967081  9110433.231703 
-288553.287896  9110446.251256 
-288516.638120  9110463.288968 
-288480.996944  9110482.336819 
-288425.550959  9110511.408686 
-288357.286932  9110554.530211 
-288340.493290  9110568.575626 
-288330.612940  9110576.601269 
-288324.671489  9110579.608470 
-288341.796160  9110610.767664 
-288349.857868  9110625.844447 
-288378.070214  9110678.110892 
-288404.419881  9110747.452450 
-288423.642923  9110793.681918 
-288436.769995  9110821.823120 
-288458.857131  9110851.983027 
-288480.900136  9110876.115642 
-288500.012915  9110907.276856 
-288516.129221  9110936.425763 
-288538.253289  9110971.608333 
-288559.354014  9111002.771635 
-288581.426609  9111030.922350 
-288595.452067  9111046.005441 
-288631.270318  9111051.066491 
-288681.968031  9111052.125279 
-288720.731229  9111052.166721 
-288764.456690  9111051.208892 
-288791.314845  9111054.251169 
-288804.250642  9111056.274044 
-288840.098364  9111065.353096 
-288880.945214  9111078.455584 
-288905.985062  9111104.600171 
-288908.996333  9111108.621518 
-288925.031879  9111126.720220 
-288935.942977  9111123.718220 
-288999.473281  9111112.735855 
-289054.080310  9111104.757546 
-289121.571475  9111091.770156 
-289197.993158  9111076.783056 
-289268.480724  9111065.807704 
-289328.057199  9111057.834338 
-289366.805506  9111055.866142 
-289416.642004  9111075.004786 
-289462.773181  9110995.695259 
-Region 1
-115
-288559.354014  9111002.771635 
-288538.253289  9110971.608333 
-288516.129221  9110936.425763 
-288500.012915  9110907.276856 
-288480.900136  9110876.115642 
-288458.857131  9110851.983027 
-288436.769995  9110821.823120 
-288423.642923  9110793.681918 
-288404.419881  9110747.452450 
-288378.070214  9110678.110892 
-288349.857868  9110625.844447 
-288341.796160  9110610.767664 
-288324.671489  9110579.608470 
-288301.906949  9110592.642888 
-288247.528140  9110631.761141 
-288202.043057  9110663.857198 
-288178.335978  9110683.922330 
-288144.711700  9110706.990331 
-288121.961735  9110722.033781 
-288087.350821  9110746.105225 
-288049.669885  9110758.118835 
-288029.879582  9110770.151842 
-288016.038122  9110780.182221 
-287985.329308  9110794.212439 
-287941.670030  9110804.210399 
-287903.024444  9110820.241023 
-287863.399590  9110838.279637 
-287831.652664  9110846.281392 
-287808.873115  9110857.306526 
-287747.535965  9110896.416767 
-287740.637211  9110904.445575 
-287706.180128  9110949.612357 
-287668.777901  9110999.798623 
-287656.334090  9111065.080278 
-287629.598084  9111214.727884 
-287628.736333  9111232.808705 
-287627.216036  9111432.710964 
-287616.693980  9111488.953854 
-287611.907886  9111514.062190 
-287568.142512  9111645.609499 
-287497.415461  9111760.050160 
-287373.117412  9111888.495813 
-287359.319527  9111904.553411 
-287380.633094  9111964.849330 
-287427.917027  9111906.637511 
-287461.439730  9111869.506043 
-287496.891528  9111824.340326 
-287526.504417  9111796.245451 
-287564.076214  9111769.163787 
-287705.781116  9111982.280921 
-287765.572713  9112003.441196 
-287789.486422  9112011.503460 
-287797.445406  9112012.516630 
-287869.820202  9111987.481512 
-287887.011560  9112027.681744 
-287894.108967  9112046.775694 
-287901.199028  9112064.865093 
-288166.953073  9111979.765891 
-288166.901553  9111972.734062 
-288161.791962  9111953.642318 
-288155.725224  9111939.572239 
-288143.635916  9111917.459358 
-288129.485136  9111885.298857 
-288117.336995  9111855.149583 
-288108.236939  9111834.044444 
-288099.166323  9111816.957491 
-288085.089191  9111794.842435 
-288067.095138  9111780.759462 
-288039.139554  9111763.652102 
-287936.277627  9111697.241221 
-287942.160419  9111686.197644 
-287952.961463  9111668.127608 
-287960.810078  9111654.072538 
-287965.728329  9111647.046078 
-287977.523302  9111628.977116 
-287990.297502  9111608.900132 
-288002.107166  9111592.840264 
-288012.922878  9111576.779320 
-288032.588460  9111547.668924 
-288045.369973  9111528.596483 
-288058.166186  9111511.533136 
-288083.927757  9111500.511037 
-288093.837748  9111496.503584 
-288112.678492  9111490.496694 
-288145.390260  9111478.477531 
-288169.185972  9111470.466889 
-288185.000725  9111458.429474 
-288212.617658  9111429.327612 
-288232.305124  9111403.230814 
-288261.851001  9111366.094704 
-288278.586040  9111344.012873 
-288282.502916  9111335.980780 
-288288.378228  9111323.932641 
-288305.113241  9111301.850806 
-288314.964286  9111289.806946 
-288321.855598  9111280.773516 
-288332.722648  9111271.744363 
-288338.531704  9111250.655304 
-288332.310518  9111215.489758 
-288341.020420  9111183.353898 
-288355.811661  9111167.297200 
-288371.589463  9111150.237023 
-288374.556539  9111148.231138 
-288389.318316  9111128.156250 
-288412.973936  9111101.059155 
-288440.583165  9111070.952690 
-288457.384278  9111057.911750 
-288470.253832  9111050.893810 
-288482.158898  9111047.892983 
-288490.088246  9111044.887885 
-288516.909606  9111042.907603 
-288533.828485  9111045.939371 
-288595.452067  9111046.005441 
-288581.426609  9111030.922350 
-288559.354014  9111002.771635 
-Region 1
-151
-287894.108967  9112046.775694 
-287887.011560  9112027.681744 
-287869.820202  9111987.481512 
-287797.445406  9112012.516630 
-287789.486422  9112011.503460 
-287765.572713  9112003.441196 
-287705.781116  9111982.280921 
-287564.076214  9111769.163787 
-287526.504417  9111796.245451 
-287496.891528  9111824.340326 
-287461.439730  9111869.506043 
-287427.917027  9111906.637511 
-287380.633094  9111964.849330 
-287359.319527  9111904.553411 
-287334.683568  9111933.658209 
-287279.491863  9111997.888565 
-287191.969079  9112126.374262 
-287188.037275  9112132.397215 
-287151.730416  9112196.648221 
-287144.860748  9112208.695216 
-287118.654864  9112295.057284 
-287070.390883  9112355.276975 
-286993.382435  9112426.515040 
-286947.098760  9112485.732300 
-286926.621526  9112539.955221 
-286927.061673  9112600.228434 
-286932.625773  9112681.602733 
-286873.390809  9112736.787571 
-286813.825649  9112746.767432 
-286811.896372  9112754.801675 
-286813.022367  9112772.884743 
-286813.139718  9112788.957608 
-286815.186348  9112796.996231 
-286820.266252  9112812.070015 
-286823.328866  9112823.123394 
-286837.537959  9112863.320873 
-286838.561278  9112867.340182 
-286846.527773  9112869.358042 
-286872.305171  9112860.345493 
-286895.107961  9112852.334206 
-286916.946112  9112848.340031 
-286968.537517  9112835.337619 
-286989.366991  9112829.333215 
-287004.232601  9112823.322259 
-287023.037413  9112812.292896 
-287056.693125  9112793.243453 
-287062.701017  9112799.277307 
-287070.696860  9112805.313338 
-287079.694022  9112812.355009 
-287085.694578  9112817.384306 
-287092.681770  9112821.410138 
-287105.662182  9112829.460710 
-287123.634501  9112840.530373 
-287144.552045  9112846.580529 
-287307.328952  9112814.612939 
-287306.305595  9112810.593649 
-287306.239485  9112801.552687 
-287305.157366  9112789.496986 
-287306.070540  9112778.448005 
-287306.924952  9112759.362613 
-287307.838127  9112748.313633 
-287309.782001  9112742.288493 
-287311.689149  9112731.240597 
-287314.538851  9112713.161926 
-287318.353145  9112691.066134 
-287320.223565  9112674.995481 
-287324.103963  9112661.940652 
-287328.970984  9112647.882355 
-287330.907509  9112640.852665 
-287337.835920  9112636.842051 
-287344.779021  9112634.840538 
-287350.713459  9112630.828838 
-287369.525429  9112620.803920 
-287376.453833  9112616.793302 
-287388.300659  9112605.756242 
-287400.147479  9112594.719181 
-287408.975654  9112578.656114 
-287414.821919  9112562.589798 
-287422.582651  9112536.480139 
-287432.426819  9112523.431807 
-287437.359921  9112518.414467 
-287446.217460  9112506.369602 
-287460.044828  9112494.330149 
-287464.977924  9112489.312807 
-287466.936467  9112485.296769 
-287461.878471  9112473.236750 
-287458.771674  9112456.156140 
-287453.698991  9112442.087017 
-287448.604272  9112425.004240 
-287446.564917  9112417.970218 
-287449.495386  9112410.941612 
-287453.441858  9112406.927741 
-287463.359463  9112403.924918 
-287468.343979  9112405.939433 
-287472.349225  9112409.961966 
-287478.371789  9112418.004865 
-287484.423745  9112430.065966 
-287495.438182  9112441.127925 
-287505.436616  9112449.175146 
-287509.434521  9112452.193124 
-287523.430866  9112463.258317 
-287546.358210  9112472.324130 
-287561.289739  9112475.353987 
-287586.175624  9112480.403736 
-287601.107156  9112483.433579 
-287620.007200  9112485.463182 
-287637.913279  9112487.491699 
-287642.868403  9112485.487992 
-287651.718523  9112472.438551 
-287656.614834  9112462.398446 
-287663.477017  9112449.346849 
-287666.407450  9112442.318236 
-287659.405593  9112436.283391 
-287650.437862  9112433.260036 
-287642.471448  9112431.242308 
-287632.517105  9112429.222420 
-287624.550692  9112427.204688 
-287615.421260  9112402.081229 
-287612.395269  9112396.050691 
-287602.352738  9112381.976195 
-287600.276616  9112369.919436 
-287615.112561  9112359.890134 
-287627.010712  9112355.884889 
-287636.898885  9112348.863834 
-287639.873421  9112347.862522 
-287644.821181  9112344.854268 
-287644.799130  9112341.840619 
-287646.720900  9112332.801830 
-287642.708301  9112327.774764 
-287641.684939  9112323.755486 
-287638.681003  9112320.738599 
-287631.664471  9112312.694644 
-287627.659226  9112308.672126 
-287618.647426  9112299.621459 
-287614.656881  9112297.608039 
-287590.706273  9112284.522962 
-287572.734138  9112273.453455 
-287552.737350  9112257.359025 
-287596.965868  9112189.098271 
-287625.893565  9112203.193308 
-287653.739119  9112205.232647 
-287677.542682  9112198.226705 
-287701.338885  9112190.216202 
-287729.140314  9112186.228199 
-287767.889977  9112184.261129 
-287808.627544  9112182.296180 
-287829.493302  9112181.314230 
-287853.318866  9112177.321851 
-287924.516007  9112127.171808 
-287901.199028  9112064.865093 
-287894.108967  9112046.775694 
-Region 1
-115
-290127.731185  9110189.753109 
-290074.950899  9110175.634661 
-290077.747800  9110150.524331 
-290080.448606  9110112.355012 
-290080.396862  9110105.323249 
-290086.895867  9110043.049176 
-290031.148850  9110030.936596 
-289829.187895  9110003.602752 
-289709.801833  9109987.404774 
-289560.561892  9109966.152288 
-289555.592393  9109966.147041 
-289398.386523  9109942.876506 
-289203.382984  9109915.547047 
-289064.096870  9109896.312468 
-289008.394216  9109890.225778 
-288983.524592  9109887.185593 
-288957.668432  9109885.148874 
-288939.697193  9109874.079753 
-288930.693164  9109866.033829 
-288923.713764  9109863.012751 
-288904.800190  9109858.974357 
-288885.916074  9109858.954130 
-288845.173495  9109859.915002 
-288784.560239  9109861.859047 
-288712.027496  9109864.794736 
-288654.388532  9109865.737268 
-288620.603210  9109866.705428 
-288640.893346  9109922.981383 
-288647.946339  9109936.047962 
-288651.995547  9109946.097694 
-288663.090401  9109968.209455 
-288684.315685  9110016.450071 
-288694.578611  9110060.660741 
-288696.610589  9110066.690147 
-288704.738509  9110090.807771 
-288713.911879  9110121.958273 
-288718.115725  9110153.103436 
-288716.385576  9110188.260375 
-288717.629799  9110222.415970 
-288720.795588  9110247.532793 
-288726.957843  9110274.661902 
-288734.143472  9110305.810253 
-288734.268646  9110322.887515 
-288735.402460  9110341.974931 
-288740.681291  9110384.171138 
-288741.741478  9110393.213106 
-288778.553095  9110398.275224 
-288811.403790  9110405.342144 
-288854.252554  9110420.456018 
-288893.184624  9110443.601949 
-288934.141398  9110471.772677 
-288975.135067  9110504.966071 
-289032.119887  9110550.230862 
-289084.179471  9110601.517527 
-289108.239907  9110629.670071 
-289119.268846  9110642.740737 
-289155.315333  9110678.942247 
-289197.391768  9110724.190914 
-289239.490419  9110772.453147 
-289276.575296  9110814.682813 
-289305.620333  9110844.849532 
-289336.653251  9110875.018322 
-289369.651911  9110902.175554 
-289396.694460  9110930.331007 
-289419.717062  9110952.455001 
-289443.755757  9110977.593647 
-289462.773181  9110995.695259 
-289469.774941  9111001.729824 
-289491.781540  9111020.839097 
-289526.738702  9111043.980096 
-289560.672430  9111063.101856 
-289565.671593  9111067.125234 
-289585.660865  9111082.214197 
-289611.576761  9111092.286704 
-289645.451448  9111103.372067 
-289690.214981  9111108.441612 
-289738.917260  9111108.492573 
-289774.654174  9111102.502747 
-289808.395834  9111095.506281 
-289835.106098  9111078.457146 
-289853.887138  9111064.413317 
-289885.530008  9111042.346655 
-289909.214082  9111019.267150 
-289926.934610  9110996.181424 
-289950.566883  9110966.070142 
-289967.278664  9110940.974298 
-289983.018692  9110918.891030 
-289992.743439  9110889.769786 
-290003.499066  9110865.672265 
-290006.436451  9110859.648144 
-290024.112509  9110830.535178 
-290036.752415  9110792.376201 
-290038.621930  9110776.305669 
-290041.492754  9110761.240710 
-290042.213068  9110724.073856 
-290040.047775  9110699.962885 
-290035.887268  9110674.845305 
-290034.664142  9110643.703604 
-290030.422321  9110607.536107 
-290032.188337  9110577.402048 
-290031.157460  9110572.378324 
-290023.021346  9110547.256594 
-290032.783009  9110523.158050 
-290040.408983  9110478.966680 
-290057.105805  9110451.861776 
-290079.736478  9110420.744934 
-290084.646863  9110412.713811 
-290098.398891  9110390.628483 
-290113.144813  9110368.544189 
-290126.867240  9110342.440709 
-290141.576164  9110315.333725 
-290163.101899  9110269.147777 
-290177.655495  9110220.945514 
-290183.485801  9110202.870054 
-290127.731185  9110189.753109 
-Region 1
-145
-288741.741478  9110393.213106 
-288740.681291  9110384.171138 
-288735.402460  9110341.974931 
-288734.268646  9110322.887515 
-288734.143472  9110305.810253 
-288726.957843  9110274.661902 
-288720.795588  9110247.532793 
-288717.629799  9110222.415970 
-288716.385576  9110188.260375 
-288718.115725  9110153.103436 
-288713.911879  9110121.958273 
-288704.738509  9110090.807771 
-288696.610589  9110066.690147 
-288694.578611  9110060.660741 
-288684.315685  9110016.450071 
-288663.090401  9109968.209455 
-288651.995547  9109946.097694 
-288647.946339  9109936.047962 
-288640.893346  9109922.981383 
-288620.603210  9109866.705428 
-288612.453328  9109839.574129 
-288589.152157  9109779.276744 
-288568.847476  9109720.991640 
-288546.569778  9109664.713458 
-288518.159616  9109585.324242 
-288507.955907  9109549.149828 
-288487.776501  9109507.941923 
-288397.120396  9109343.099337 
-288388.057768  9109327.016879 
-288362.872407  9109280.780734 
-288290.320390  9109145.089026 
-288210.708864  9108995.325826 
-288168.067246  9109008.338319 
-288111.525869  9109023.344670 
-288070.864608  9109035.354707 
-288016.332933  9109053.376777 
-288008.403850  9109056.381719 
-287931.042024  9109078.396862 
-287905.615137  9108999.010167 
-287877.214051  9108920.624707 
-287847.863220  9108848.265413 
-287840.751997  9108827.162205 
-287827.516126  9108783.952323 
-287802.951583  9108686.484660 
-287786.506870  9108612.130386 
-287771.224750  9108560.881858 
-287754.860826  9108497.577607 
-287709.223116  9108508.577196 
-287692.341860  9108510.567634 
-287673.458186  9108510.546767 
-287640.638237  9108507.496849 
-287618.750942  9108504.459005 
-287589.862538  9108495.386137 
-287522.095696  9108470.197451 
-287429.394092  9108432.926412 
-287343.671705  9108398.676551 
-287269.905212  9108368.458009 
-287025.732410  9108275.766790 
-287047.671723  9108422.455196 
-287048.687547  9108425.469974 
-287080.924464  9108621.392614 
-287154.458645  9108756.083916 
-287149.540450  9108763.110252 
-287090.573231  9108854.458143 
-287055.107911  9108897.614033 
-286986.157543  9108982.923442 
-286982.218560  9108987.941772 
-286948.623769  9109015.026965 
-286950.713981  9109029.092961 
-286896.474147  9109087.295995 
-286892.564407  9109096.332543 
-286878.759607  9109111.385295 
-286870.779187  9109107.358169 
-286840.881878  9109096.274654 
-286808.185731  9109110.301669 
-286734.951873  9109153.415057 
-286800.447451  9109276.043354 
-286803.480349  9109283.078586 
-286734.711156  9109256.883231 
-286591.187624  9109201.471766 
-286545.607223  9109357.125527 
-286466.935476  9109335.941352 
-286442.621321  9109409.246039 
-286413.746959  9109402.181617 
-286393.203749  9109447.363167 
-286326.699756  9109459.342654 
-286307.822851  9109460.325867 
-286225.268907  9109725.433804 
-286148.539081  9109971.461915 
-286151.579265  9109979.501760 
-286164.595155  9109992.575642 
-286189.516158  9110002.649323 
-286194.500360  9110004.664057 
-286197.467505  9110002.658310 
-286274.028429  9110006.762967 
-286611.097992  9110025.223921 
-286866.636873  9110039.573267 
-286953.122153  9110041.678715 
-286989.904334  9110042.724190 
-287039.761206  9110064.879632 
-287082.704659  9110093.054607 
-287115.899481  9110147.336902 
-287147.099230  9110200.612396 
-287168.345220  9110251.867739 
-287170.377026  9110257.897260 
-287296.091520  9110187.718156 
-287301.053772  9110186.719093 
-287404.813162  9110376.692401 
-287477.336408  9110508.367416 
-287494.460533  9110539.527078 
-287513.579870  9110571.693461 
-287585.051200  9110695.330644 
-287656.442215  9110807.917560 
-287727.613304  9110890.367774 
-287740.637211  9110904.445575 
-287747.535965  9110896.416767 
-287808.873115  9110857.306526 
-287831.652664  9110846.281392 
-287863.399590  9110838.279637 
-287903.024444  9110820.241023 
-287941.670030  9110804.210399 
-287985.329308  9110794.212439 
-288016.038122  9110780.182221 
-288029.879582  9110770.151842 
-288049.669885  9110758.118835 
-288087.350821  9110746.105225 
-288121.961735  9110722.033781 
-288144.711700  9110706.990331 
-288178.335978  9110683.922330 
-288202.043057  9110663.857198 
-288247.528140  9110631.761141 
-288301.906949  9110592.642888 
-288324.671489  9110579.608470 
-288330.612940  9110576.601269 
-288340.493290  9110568.575626 
-288357.286932  9110554.530211 
-288425.550959  9110511.408686 
-288480.996944  9110482.336819 
-288516.638120  9110463.288968 
-288553.287896  9110446.251256 
-288589.967081  9110433.231703 
-288594.921935  9110431.227953 
-288629.620621  9110419.210783 
-288702.029114  9110399.197752 
-288741.741478  9110393.213106 
-Region 1
-52
-289008.394216  9109890.225778 
-289002.283477  9109870.128535 
-288968.748197  9109769.639096 
-288956.482629  9109723.417316 
-288953.419925  9109712.364142 
-288936.111281  9109656.091586 
-288924.920697  9109620.920830 
-288916.763363  9109592.785072 
-288891.363811  9109517.417605 
-288888.286424  9109504.355330 
-288873.915506  9109442.058640 
-288855.517561  9109372.725852 
-288835.212876  9109314.440895 
-288833.195659  9109310.420579 
-288813.951168  9109261.177570 
-288784.414677  9109163.705677 
-288754.922501  9109072.261002 
-288753.899190  9109068.241750 
-288726.446434  9108983.830986 
-288710.095661  9108922.536537 
-288688.716721  9108853.200334 
-288651.030170  9108864.209500 
-288598.472144  9108880.225229 
-288556.817357  9108892.234568 
-288487.399995  9108913.254606 
-288373.353321  9108947.285052 
-288242.447092  9108986.319573 
-288210.708864  9108995.325826 
-288290.320390  9109145.089026 
-288362.872407  9109280.780734 
-288388.057768  9109327.016879 
-288397.120396  9109343.099337 
-288487.776501  9109507.941923 
-288507.955907  9109549.149828 
-288518.159616  9109585.324242 
-288546.569778  9109664.713458 
-288568.847476  9109720.991640 
-288589.152157  9109779.276744 
-288612.453328  9109839.574129 
-288620.603210  9109866.705428 
-288654.388532  9109865.737268 
-288712.027496  9109864.794736 
-288784.560239  9109861.859047 
-288845.173495  9109859.915002 
-288885.916074  9109858.954130 
-288904.800190  9109858.974357 
-288923.713764  9109863.012751 
-288930.693164  9109866.033829 
-288939.697193  9109874.079753 
-288957.668432  9109885.148874 
-288983.524592  9109887.185593 
-289008.394216  9109890.225778 
-Region 1
-109
-290508.348727  9108429.210473 
-290496.972760  9108368.926899 
-290295.499866  9108406.888370 
-290076.122119  9108442.821119 
-290062.244941  9108447.829168 
-290054.389999  9108460.879800 
-290043.523933  9108469.909138 
-290033.592672  9108470.903212 
-290019.604759  9108460.843169 
-290013.530856  9108445.768805 
-290014.502577  9108442.756236 
-289926.872828  9108419.559595 
-289831.306976  9108398.363431 
-289827.324144  9108397.354686 
-289592.388852  9108344.869771 
-289510.751986  9108325.696733 
-289483.050029  9108478.356349 
-289478.441799  9108527.573596 
-289488.844797  9108590.870299 
-289491.951703  9108607.950679 
-289499.174138  9108644.121577 
-289495.397665  9108671.239966 
-289484.583008  9108687.300997 
-289476.713109  9108698.342493 
-289440.234628  9108738.485012 
-289408.703348  9108775.619184 
-289349.594038  9108846.878110 
-289327.883492  9108867.950178 
-289295.269747  9108893.028743 
-289263.605638  9108912.081098 
-289231.904667  9108926.110723 
-289215.038196  9108930.110838 
-289199.143502  9108931.098381 
-289169.349230  9108934.080121 
-289088.992279  9108954.084793 
-288986.836097  9108983.106764 
-288946.204736  9108999.135704 
-288910.528029  9109013.160869 
-288813.363001  9109045.201481 
-288753.899190  9109068.241750 
-288754.922501  9109072.261002 
-288784.414677  9109163.705677 
-288813.951168  9109261.177570 
-288833.195659  9109310.420579 
-288835.212876  9109314.440895 
-288855.517561  9109372.725852 
-288873.915506  9109442.058640 
-288888.286424  9109504.355330 
-288891.363811  9109517.417605 
-288916.763363  9109592.785072 
-288924.920697  9109620.920830 
-288936.111281  9109656.091586 
-288953.419925  9109712.364142 
-288956.482629  9109723.417316 
-288968.748197  9109769.639096 
-289002.283477  9109870.128535 
-289008.394216  9109890.225778 
-289064.096870  9109896.312468 
-289203.382984  9109915.547047 
-289398.386523  9109942.876506 
-289555.592393  9109966.147041 
-289560.561892  9109966.152288 
-289709.801833  9109987.404774 
-289829.187895  9110003.602752 
-290031.148850  9110030.936596 
-290086.895867  9110043.049176 
-290080.396862  9110105.323249 
-290080.448606  9110112.355012 
-290077.747800  9110150.524331 
-290074.950899  9110175.634661 
-290127.731185  9110189.753109 
-290183.485801  9110202.870054 
-290190.302611  9110183.791091 
-290199.871881  9110133.574585 
-290200.569997  9110093.394140 
-290201.149812  9110037.141102 
-290201.833159  9109994.951582 
-290199.534825  9109952.758956 
-290193.320071  9109918.598482 
-290178.101139  9109876.392382 
-290164.951345  9109845.238254 
-290152.751117  9109808.057930 
-290137.606194  9109775.897172 
-290126.392520  9109737.713330 
-290118.130983  9109695.514445 
-290101.792724  9109636.230102 
-290101.681879  9109621.162035 
-290101.327182  9109572.944223 
-290097.916947  9109514.677912 
-290101.656048  9109482.536861 
-290112.086350  9109414.239730 
-290122.634862  9109362.015206 
-290125.527848  9109349.963873 
-290132.196870  9109310.794181 
-290140.809321  9109265.599345 
-290144.637075  9109245.512751 
-290155.979949  9109166.166757 
-290179.315837  9109095.874089 
-290195.783209  9109037.628594 
-290200.634371  9109021.561194 
-290215.387340  9109000.481507 
-290242.942436  9108963.342735 
-290290.345391  9108922.206584 
-290316.030885  9108901.138305 
-290404.976700  9108832.923171 
-290469.958492  9108749.615035 
-290517.689452  9108618.071540 
-290525.255919  9108565.843950 
-290508.348727  9108429.210473 
-Region 1
-88
-289551.137326  9108005.293537 
-289349.156358  9108109.549331 
-289245.920059  9108126.515831 
-289239.971619  9108128.518522 
-289182.511702  9108153.570247 
-289137.935119  9108173.613081 
-289103.260322  9108188.643847 
-289019.593308  9107892.215567 
-288962.177599  9107923.294240 
-288954.263510  9107928.308378 
-288926.516379  9107939.328312 
-288900.756949  9107950.350381 
-288800.715358  9107996.450858 
-288752.163209  9108016.489009 
-288713.527574  9108033.524261 
-288661.021925  9108056.571660 
-288622.584606  9108100.729604 
-288567.413153  9108166.969193 
-288497.311501  9108230.178885 
-288458.697590  9108250.227624 
-288419.163216  9108280.320730 
-288418.323587  9108301.415144 
-288391.481777  9108300.381344 
-288350.703765  9108296.318700 
-288316.868152  9108290.254520 
-288310.079941  9108313.351527 
-288294.361577  9108338.447860 
-288260.863641  9108378.592866 
-288224.156458  9108387.593597 
-288200.347572  9108393.594794 
-288065.408366  9108424.587723 
-287914.603554  9108460.585549 
-287854.079821  9108474.582515 
-287778.677211  9108492.581169 
-287754.860826  9108497.577607 
-287771.224750  9108560.881858 
-287786.506870  9108612.130386 
-287802.951583  9108686.484660 
-287827.516126  9108783.952323 
-287840.751997  9108827.162205 
-287847.863220  9108848.265413 
-287877.214051  9108920.624707 
-287905.615137  9108999.010167 
-287931.042024  9109078.396862 
-288008.403850  9109056.381719 
-288016.332933  9109053.376777 
-288070.864608  9109035.354707 
-288111.525869  9109023.344670 
-288168.067246  9109008.338319 
-288210.708864  9108995.325826 
-288242.447092  9108986.319573 
-288373.353321  9108947.285052 
-288487.399995  9108913.254606 
-288556.817357  9108892.234568 
-288598.472144  9108880.225229 
-288651.030170  9108864.209500 
-288688.716721  9108853.200334 
-288710.095661  9108922.536537 
-288726.446434  9108983.830986 
-288753.899190  9109068.241750 
-288813.363001  9109045.201481 
-288910.528029  9109013.160869 
-288946.204736  9108999.135704 
-288986.836097  9108983.106764 
-289088.992279  9108954.084793 
-289169.349230  9108934.080121 
-289199.143502  9108931.098381 
-289215.038196  9108930.110838 
-289231.904667  9108926.110723 
-289263.605638  9108912.081098 
-289295.269747  9108893.028743 
-289327.883492  9108867.950178 
-289349.594038  9108846.878110 
-289408.703348  9108775.619184 
-289440.234628  9108738.485012 
-289476.713109  9108698.342493 
-289484.583008  9108687.300997 
-289495.397665  9108671.239966 
-289499.174138  9108644.121577 
-289491.951703  9108607.950679 
-289488.844797  9108590.870299 
-289478.441799  9108527.573596 
-289483.050029  9108478.356349 
-289510.751986  9108325.696733 
-289541.324923  9108157.972188 
-289556.651891  9108079.634902 
-289571.927255  9107994.265830 
-289551.137326  9108005.293537 
-Region 1
-46
-290469.525328  9107745.085871 
-290451.569618  9107736.026303 
-290412.853942  9107742.012902 
-290378.386896  9107785.171516 
-290324.574522  9107900.635945 
-290263.273303  9107943.766349 
-290228.429436  9107935.693483 
-290200.365359  9107903.518995 
-290008.997871  9107693.370157 
-289918.941249  9107745.510471 
-289885.297873  9107765.565456 
-289844.749128  9107792.644823 
-289822.023289  9107810.702290 
-289803.294954  9107831.777592 
-289777.690738  9107863.895445 
-289756.106132  9107902.044758 
-289731.606282  9107949.231765 
-289721.763573  9107962.280232 
-289701.960193  9107972.304512 
-289679.131011  9107976.298369 
-289665.231779  9107978.292651 
-289576.881798  9107992.262043 
-289571.927255  9107994.265830 
-289556.651891  9108079.634902 
-289541.324923  9108157.972188 
-289510.751986  9108325.696733 
-289592.388852  9108344.869771 
-289827.324144  9108397.354686 
-289831.306976  9108398.363431 
-289926.872828  9108419.559595 
-290014.502577  9108442.756236 
-290013.530856  9108445.768805 
-290019.604759  9108460.843169 
-290033.592672  9108470.903212 
-290043.523933  9108469.909138 
-290054.389999  9108460.879800 
-290062.244941  9108447.829168 
-290076.122119  9108442.821119 
-290295.499866  9108406.888370 
-290496.972760  9108368.926899 
-290485.604233  9108309.647850 
-290474.372376  9108133.843602 
-290501.753161  9107937.989123 
-290546.465248  9107801.419973 
-290503.456463  9107764.207437 
-290469.525328  9107745.085871 
-Region 1
-65
-289182.511702  9108153.570247 
-289239.971619  9108128.518522 
-289147.440224  9107843.131029 
-289141.359361  9107827.051912 
-289086.786327  9107703.435193 
-289085.623282  9107680.329606 
-289080.639311  9107678.315159 
-289049.741639  9107666.227391 
-289012.041462  9107675.227521 
-288938.643453  9107695.238936 
-288893.014438  9107707.244014 
-288837.527709  9107730.288283 
-288810.340835  9107682.041009 
-288791.200389  9107646.861427 
-288751.911054  9107574.492044 
-288735.737570  9107537.306562 
-288732.711934  9107531.276045 
-288710.472537  9107480.020415 
-288643.133163  9107513.096897 
-288634.203199  9107515.096249 
-288627.260935  9107517.097764 
-288590.525181  9107522.080427 
-288546.883855  9107534.087302 
-288361.407858  9107585.116108 
-288298.927163  9107603.129384 
-288240.414481  9107620.142399 
-288212.784625  9107647.234674 
-288185.074040  9107663.276899 
-288066.302609  9107730.450574 
-287950.417044  9107784.568153 
-287989.940176  9107889.084090 
-288044.606220  9108025.761930 
-288082.105485  9108125.252742 
-288159.428963  9108098.214989 
-288188.830834  9108177.605943 
-288195.875976  9108189.668149 
-288201.366421  9108260.996549 
-288206.842230  9108330.315845 
-288210.971862  9108351.415716 
-288215.064796  9108367.492842 
-288224.156458  9108387.593597 
-288260.863641  9108378.592866 
-288294.361577  9108338.447860 
-288310.079941  9108313.351527 
-288316.868152  9108290.254520 
-288350.703765  9108296.318700 
-288391.481777  9108300.381344 
-288418.323587  9108301.415144 
-288419.163216  9108280.320730 
-288458.697590  9108250.227624 
-288497.311501  9108230.178885 
-288567.413153  9108166.969193 
-288622.584606  9108100.729604 
-288661.021925  9108056.571660 
-288713.527574  9108033.524261 
-288752.163209  9108016.489009 
-288800.715358  9107996.450858 
-288900.756949  9107950.350381 
-288926.516379  9107939.328312 
-288954.263510  9107928.308378 
-288962.177599  9107923.294240 
-289019.593308  9107892.215567 
-289103.260322  9108188.643847 
-289137.935119  9108173.613081 
-289182.511702  9108153.570247 
-Region 1
-89
-288210.971862  9108351.415716 
-288206.842230  9108330.315845 
-288201.366421  9108260.996549 
-288195.875976  9108189.668149 
-288188.830834  9108177.605943 
-288159.428963  9108098.214989 
-288082.105485  9108125.252742 
-288044.606220  9108025.761930 
-287989.940176  9107889.084090 
-287950.417044  9107784.568153 
-288066.302609  9107730.450574 
-288062.209838  9107714.373404 
-288024.403234  9107572.691368 
-287999.876250  9107480.246456 
-287995.812869  9107468.187467 
-287977.425071  9107399.858301 
-287948.820360  9107293.345209 
-287917.168355  9107177.787806 
-287912.001289  9107150.659434 
-287914.858268  9107133.585372 
-287921.734591  9107122.543016 
-287947.457334  9107106.498806 
-287946.038501  9107048.233770 
-287946.929765  9107034.171161 
-287948.807545  9107019.105102 
-287964.152166  9106942.776859 
-287977.589682  9106877.496475 
-287991.999039  9106809.203544 
-288013.028200  9106694.708999 
-287879.189909  9106739.765037 
-287767.157149  9106776.808650 
-287716.566532  9106789.811418 
-287645.134509  9106806.809081 
-287563.785951  9106826.809206 
-287488.393021  9106845.811315 
-287301.784648  9106877.747740 
-287242.249066  9106890.739995 
-287215.444514  9106894.728060 
-287140.986567  9106905.694325 
-287092.449000  9106791.121290 
-286803.987277  9106620.021904 
-286773.046847  9106601.904907 
-286770.109117  9106607.928866 
-286751.452392  9106639.048700 
-286727.833733  9106671.167444 
-286710.112420  9106694.251942 
-286677.665870  9106742.433434 
-286636.362210  9106802.659439 
-286586.215970  9106876.939066 
-286576.386933  9106891.996127 
-286560.638574  9106913.073748 
-286551.796076  9106927.127381 
-286456.421148  9107068.660304 
-286360.051826  9107210.192025 
-286319.785006  9107276.446421 
-286313.996873  9107300.549038 
-286310.145408  9107317.622008 
-286308.259783  9107331.683571 
-286308.376460  9107347.756522 
-286307.455525  9107357.800981 
-286507.928982  9107455.470770 
-286757.299553  9107580.317579 
-286798.932180  9107565.296401 
-286888.145875  9107533.251564 
-286962.458828  9107502.194345 
-287031.539773  9107708.204266 
-287127.982590  9107986.571926 
-287190.831565  9108155.406024 
-287191.847387  9108158.420797 
-287231.354824  9108260.928614 
-287269.905212  9108368.458009 
-287343.671705  9108398.676551 
-287429.394092  9108432.926412 
-287522.095696  9108470.197451 
-287589.862538  9108495.386137 
-287618.750942  9108504.459005 
-287640.638237  9108507.496849 
-287673.458186  9108510.546767 
-287692.341860  9108510.567634 
-287709.223116  9108508.577196 
-287754.860826  9108497.577607 
-287778.677211  9108492.581169 
-287854.079821  9108474.582515 
-287914.603554  9108460.585549 
-288065.408366  9108424.587723 
-288200.347572  9108393.594794 
-288224.156458  9108387.593597 
-288215.064796  9108367.492842 
-288210.971862  9108351.415716 
-Region 1
-67
-289012.041462  9107675.227521 
-288991.664358  9107606.897012 
-288975.387736  9107555.648039 
-288957.020536  9107490.333270 
-288951.882197  9107467.223357 
-288948.783024  9107451.147410 
-288931.056941  9107337.615518 
-288919.588071  9107264.271868 
-288910.356837  9107225.084903 
-288909.311547  9107218.052008 
-288904.187995  9107196.951165 
-288856.542357  9107204.935753 
-288843.284398  9107158.712619 
-288830.939498  9107101.440551 
-288827.766953  9107075.319118 
-288817.174714  9106985.903725 
-288804.254821  9106985.889667 
-288690.993981  9106990.788971 
-288671.552990  9106914.422819 
-288660.283039  9106868.201730 
-288628.524330  9106874.194273 
-288556.069678  9106887.174058 
-288550.113995  9106888.172080 
-288452.776634  9106896.101774 
-288371.325932  9106902.039635 
-288298.893066  9106918.032680 
-288256.267981  9106933.053896 
-288215.601209  9106944.059071 
-288184.850819  9106952.061520 
-288082.690458  9106980.075982 
-288064.889262  9106992.110825 
-288057.004490  9107001.142992 
-288014.650358  9107053.332377 
-287993.955522  9107077.418511 
-287969.219333  9107092.459289 
-287947.457334  9107106.498806 
-287921.734591  9107122.543016 
-287914.858268  9107133.585372 
-287912.001289  9107150.659434 
-287917.168355  9107177.787806 
-287948.820360  9107293.345209 
-287977.425071  9107399.858301 
-287995.812869  9107468.187467 
-287999.876250  9107480.246456 
-288024.403234  9107572.691368 
-288062.209838  9107714.373404 
-288066.302609  9107730.450574 
-288185.074040  9107663.276899 
-288212.784625  9107647.234674 
-288240.414481  9107620.142399 
-288298.927163  9107603.129384 
-288361.407858  9107585.116108 
-288546.883855  9107534.087302 
-288590.525181  9107522.080427 
-288627.260935  9107517.097764 
-288634.203199  9107515.096249 
-288643.133163  9107513.096897 
-288710.472537  9107480.020415 
-288732.711934  9107531.276045 
-288735.737570  9107537.306562 
-288751.911054  9107574.492044 
-288791.200389  9107646.861427 
-288810.340835  9107682.041009 
-288837.527709  9107730.288283 
-288893.014438  9107707.244014 
-288938.643453  9107695.238936 
-289012.041462  9107675.227521 
-Region 1
-40
-288654.286036  9106727.559736 
-288646.085781  9106693.396448 
-288641.934276  9106669.282973 
-288645.454493  9106607.005403 
-288651.831427  9106527.653794 
-288585.112807  9106509.499048 
-288352.102134  9106446.961650 
-288285.390987  9106429.810950 
-288267.465421  9106424.768476 
-288231.614297  9106414.683502 
-288197.765497  9106406.609791 
-288074.288975  9106373.323325 
-288048.576503  9106526.989803 
-288027.642658  9106654.543489 
-288013.028200  9106694.708999 
-287991.999039  9106809.203544 
-287977.589682  9106877.496475 
-287964.152166  9106942.776859 
-287948.807545  9107019.105102 
-287946.929765  9107034.171161 
-287946.038501  9107048.233770 
-287947.457334  9107106.498806 
-287969.219333  9107092.459289 
-287993.955522  9107077.418511 
-288014.650358  9107053.332377 
-288057.004490  9107001.142992 
-288064.889262  9106992.110825 
-288082.690458  9106980.075982 
-288184.850819  9106952.061520 
-288215.601209  9106944.059071 
-288256.267981  9106933.053896 
-288298.893066  9106918.032680 
-288371.325932  9106902.039635 
-288452.776634  9106896.101774 
-288550.113995  9106888.172080 
-288556.069678  9106887.174058 
-288628.524330  9106874.194273 
-288660.283039  9106868.201730 
-288685.099569  9106864.210668 
-288654.286036  9106727.559736 
-Region 1
-488
-285905.680824  9110744.691470 
-285836.873918  9110576.853278 
-285826.759389  9110552.732543 
-285778.138314  9110427.108247 
-285772.057967  9110411.028491 
-285643.407217  9110077.370270 
-285618.508094  9110070.309954 
-285407.759875  9110065.045893 
-285279.580068  9110069.921431 
-285205.057548  9110072.849329 
-284965.499588  9110069.559118 
-284847.222307  9110069.422110 
-284832.313401  9110069.404818 
-284698.118647  9110067.239836 
-284646.448936  9110069.188833 
-284626.989948  9109989.806022 
-284626.742770  9109955.650730 
-284606.289990  9109876.266728 
-284579.692084  9109771.761544 
-284558.223824  9109689.362609 
-284483.619086  9109405.989510 
-284463.203346  9109331.628146 
-284449.962941  9109287.411977 
-284418.309385  9109170.845841 
-284353.044197  9108941.729307 
-284292.553868  9108960.744752 
-284225.330999  9108873.268663 
-284154.865345  9108887.249335 
-284108.217088  9108896.235263 
-284109.174732  9108891.213584 
-284137.330736  9108798.827154 
-284143.098339  9108771.710796 
-284150.817480  9108739.573936 
-284162.512219  9108707.441777 
-284177.195898  9108676.317713 
-284194.817742  9108639.169750 
-284216.371638  9108595.999062 
-284239.942307  9108556.849002 
-284264.543104  9108522.722962 
-284325.526238  9108434.393547 
-283987.023492  9108216.002645 
-283354.863807  9107932.963540 
-281808.395172  9107240.931431 
-281758.550116  9107219.773389 
-281748.645655  9107363.415399 
-281738.669333  9107497.011567 
-281724.638380  9107619.552371 
-281720.179556  9107690.871708 
-281608.166309  9107593.288558 
-281438.148767  9107445.403718 
-281136.250457  9107200.912782 
-281130.308682  9107203.919047 
-281122.386314  9107207.927399 
-281118.518417  9107222.991222 
-281120.556418  9107230.025840 
-281128.586434  9107241.086309 
-281140.613524  9107255.165538 
-281141.664822  9107263.203492 
-281132.770091  9107270.224363 
-281117.890514  9107274.223971 
-281104.991530  9107277.221486 
-281095.110079  9107285.245690 
-281090.212406  9107295.285322 
-281082.261316  9107295.275319 
-281084.141455  9107280.208994 
-281083.090165  9107272.171036 
-281072.128721  9107268.138925 
-281065.157171  9107266.120991 
-281063.298550  9107284.201082 
-281066.330435  9107291.236954 
-281049.412844  9107288.201920 
-281041.425880  9107283.168966 
-281037.479034  9107287.182315 
-281031.587460  9107297.220692 
-281018.724328  9107305.241129 
-281004.845782  9107310.246545 
-280993.934546  9107313.246537 
-280978.025178  9107312.221907 
-280965.075952  9107308.187264 
-280960.084998  9107305.167231 
-280953.170824  9107311.185993 
-280959.184359  9107318.225636 
-280956.267253  9107327.263178 
-280947.365301  9107333.279434 
-280939.421371  9107334.273996 
-280927.444510  9107327.226828 
-280924.405468  9107319.186353 
-280920.401229  9107315.162980 
-280913.444016  9107315.154202 
-280908.445891  9107311.129573 
-280911.391694  9107306.110389 
-280912.335379  9107299.079518 
-280903.368878  9107296.054461 
-280889.504656  9107303.069023 
-280873.616798  9107305.058123 
-280862.684034  9107305.044316 
-280852.759498  9107307.040942 
-280846.846365  9107314.065536 
-280838.952623  9107322.092208 
-280828.055704  9107327.101343 
-280817.165951  9107333.115065 
-280807.241405  9107335.111682 
-280791.310509  9107331.073218 
-280779.362338  9107328.044365 
-280769.409114  9107326.022613 
-280762.480568  9107330.032173 
-280751.626645  9107341.068832 
-280746.771894  9107357.135988 
-280744.848632  9107366.174785 
-280735.010091  9107380.226473 
-280726.151099  9107392.270236 
-280718.285993  9107404.315257 
-280710.428052  9107417.364868 
-280700.610995  9107434.430324 
-280688.834820  9107455.511626 
-280667.141213  9107479.594112 
-280656.351739  9107499.672079 
-280642.580576  9107519.746268 
-280624.855326  9107542.829192 
-280616.032112  9107559.895902 
-280609.175182  9107573.951359 
-280590.441669  9107595.023836 
-280578.608082  9107608.068401 
-280566.810319  9107626.135921 
-280550.057394  9107646.206320 
-280542.242366  9107665.283470 
-280528.449616  9107682.343874 
-280522.600875  9107698.409771 
-280513.834925  9107723.513208 
-280503.989085  9107736.560288 
-280491.161541  9107749.603584 
-280468.366332  9107758.615897 
-280450.461806  9107756.584001 
-280443.497343  9107755.570575 
-280437.555435  9107758.576777 
-280424.656225  9107761.574142 
-280407.810065  9107768.584819 
-280390.906595  9107767.558756 
-280375.998088  9107767.539805 
-280357.113977  9107767.515793 
-280348.247653  9107778.554931 
-280335.441529  9107794.611973 
-280331.630647  9107817.712540 
-280329.857702  9107847.847782 
-280335.034920  9107876.987279 
-280335.271280  9107910.138825 
-280334.485092  9107939.270738 
-280329.680310  9107962.370042 
-280317.925349  9107986.465095 
-280315.108372  9108009.566928 
-280303.224471  9108015.579318 
-280285.291183  9108009.529010 
-280256.510864  9108015.519893 
-280247.673122  9108030.577399 
-280247.852157  9108055.692217 
-280251.055889  9108086.838385 
-280260.201599  9108114.978358 
-280257.391762  9108139.084788 
-280247.595907  9108159.163999 
-280232.801846  9108175.218516 
-280198.072270  9108183.210987 
-280183.149288  9108181.182820 
-280165.244573  9108179.150850 
-280133.317713  9108162.032241 
-280119.388646  9108160.005317 
-280101.498254  9108159.982505 
-280093.554127  9108160.976958 
-280079.782543  9108181.051080 
-280071.995894  9108204.146590 
-280070.093971  9108216.199178 
-280053.218938  9108219.191402 
-280035.307043  9108216.154788 
-280022.429127  9108222.165857 
-280017.559767  9108236.223827 
-280014.771278  9108263.344056 
-280009.987804  9108289.457154 
-279999.233682  9108314.558045 
-279993.441970  9108338.660687 
-279988.579755  9108353.723253 
-279973.749748  9108364.754751 
-279954.808091  9108356.693878 
-279927.800617  9108332.549324 
-279895.859371  9108313.421363 
-279882.881234  9108305.368079 
-279871.833696  9108289.280575 
-279849.803029  9108266.146907 
-279839.785196  9108255.083637 
-279825.748792  9108237.987702 
-279805.713155  9108215.861141 
-279793.721821  9108206.804498 
-279779.699755  9108191.717731 
-279756.725330  9108175.614886 
-279750.726097  9108170.584258 
-279747.722906  9108167.566646 
-279747.637095  9108155.511501 
-279747.536983  9108141.447164 
-279741.523455  9108134.407342 
-279722.646274  9108135.387698 
-279707.816239  9108146.419108 
-279698.034408  9108168.507451 
-279685.206482  9108181.550602 
-279675.260198  9108180.533239 
-279660.280004  9108170.468125 
-279649.268320  9108159.403518 
-279634.216656  9108139.292431 
-279623.176395  9108124.209430 
-279609.111520  9108103.095010 
-279600.059101  9108088.014556 
-279588.990279  9108068.913155 
-279554.060453  9108048.776433 
-279536.120031  9108041.721209 
-279513.238637  9108038.677958 
-279483.392719  9108034.621126 
-279463.485916  9108030.577096 
-279442.642350  9108034.568552 
-279419.796668  9108036.548238 
-279395.949927  9108037.522032 
-279369.071454  9108031.459777 
-279349.171791  9108028.420292 
-279328.256795  9108022.365718 
-279307.398924  9108024.347917 
-279293.526994  9108030.357503 
-279272.797628  9108050.422455 
-279252.096800  9108074.505796 
-279230.444871  9108104.615435 
-279207.806140  9108135.728382 
-279191.030936  9108152.784670 
-279162.307313  9108166.811702 
-279141.542138  9108181.853628 
-279117.730963  9108187.850290 
-279099.819051  9108184.813286 
-279074.899770  9108174.735049 
-279055.049977  9108178.727640 
-279029.336568  9108196.776871 
-279013.576586  9108216.848204 
-278999.854370  9108243.954316 
-278977.151195  9108266.025803 
-278959.446133  9108292.122145 
-278948.620023  9108307.176930 
-278924.901471  9108326.233313 
-278905.137184  9108342.281059 
-278884.400358  9108361.341307 
-278874.625192  9108384.434180 
-278861.896780  9108411.541574 
-278852.114464  9108433.629847 
-278832.414296  9108458.718983 
-278822.567771  9108471.765850 
-278796.839834  9108487.805808 
-278748.208803  9108497.788360 
-278705.519904  9108504.764839 
-278696.574570  9108504.753170 
-278691.512258  9108491.686870 
-278685.448894  9108477.614671 
-278669.546085  9108477.593915 
-278648.666518  9108476.562064 
-278625.763459  9108470.504597 
-278604.848255  9108464.449715 
-278584.955487  9108462.414529 
-278561.030005  9108452.337318 
-278549.060142  9108446.294105 
-278529.252884  9108456.314119 
-278518.469331  9108477.396458 
-278510.617673  9108491.450484 
-278489.930458  9108517.542824 
-278474.191486  9108540.627861 
-278456.429020  9108558.687279 
-278439.610599  9108569.715777 
-278424.737284  9108574.719259 
-278408.827295  9108573.693817 
-278393.896987  9108570.660466 
-278376.950331  9108563.606092 
-278359.960944  9108550.524090 
-278339.996903  9108538.442771 
-278323.057384  9108532.392974 
-278300.182780  9108530.353752 
-278265.494951  9108544.372506 
-278253.646118  9108555.407474 
-278240.803349  9108566.441134 
-278225.901519  9108567.426140 
-278216.970387  9108569.423587 
-278212.057690  9108577.453884 
-278215.146270  9108592.526863 
-278216.232753  9108605.588021 
-278210.404435  9108624.667655 
-278201.558722  9108638.720350 
-278194.985643  9108692.959817 
-278191.166539  9108715.055879 
-278189.335302  9108737.154553 
-278179.474276  9108748.192131 
-278164.586618  9108751.186340 
-278128.804975  9108751.139272 
-278111.013803  9108765.180190 
-278099.228939  9108785.256580 
-278083.496792  9108809.346155 
-278061.900653  9108847.492340 
-278057.059080  9108865.568680 
-278030.265465  9108871.560964 
-278012.331885  9108865.509762 
-277993.397253  9108858.452637 
-277976.486080  9108856.421150 
-277961.577012  9108856.401488 
-277953.675315  9108863.423237 
-277946.845818  9108881.496954 
-277937.999980  9108895.549628 
-277928.217117  9108917.637833 
-277915.402624  9108932.689866 
-277903.518032  9108938.701759 
-277887.622105  9108939.685373 
-277867.750415  9108940.663732 
-277851.847370  9108940.642728 
-277830.939058  9108935.592123 
-277814.993337  9108929.543469 
-277798.039455  9108921.484283 
-277784.074509  9108914.433638 
-277754.256303  9108914.394192 
-277739.389861  9108920.402100 
-277715.670381  9108939.458047 
-277712.724109  9108944.477133 
-279837.810353  9109930.729523 
-279985.911282  9110070.554778 
-280022.795080  9110085.670267 
-280064.619989  9110096.773639 
-280100.674783  9110134.993424 
-280131.881777  9110190.284955 
-280163.045826  9110239.548891 
-280161.481088  9110298.817317 
-280182.684164  9110345.054890 
-280209.779306  9110381.254043 
-280232.062546  9110439.547923 
-280236.440202  9110495.810062 
-280238.643393  9110525.950313 
-280279.962803  9110605.364328 
-280263.395554  9110651.554273 
-280243.031839  9110722.854003 
-280223.518517  9110774.063157 
-280154.866423  9110903.567910 
-280157.062473  9110932.703577 
-280128.517150  9110971.846368 
-280068.422918  9111047.114396 
-280021.214321  9111117.375722 
-279972.846622  9111164.530145 
-279934.275154  9111191.605229 
-279921.012177  9111283.005625 
-279942.072280  9111309.151381 
-279942.179886  9111324.220274 
-279949.209494  9111334.274979 
-279946.363855  9111353.358482 
-279944.691552  9111397.558058 
-279954.832268  9111425.699188 
-279950.106287  9111459.849077 
-279928.367770  9111477.904177 
-279953.389587  9111502.045730 
-279935.006106  9111572.343420 
-279975.074145  9111615.590991 
-280034.742098  9111619.684416 
-280045.776447  9111633.762458 
-280077.526618  9111625.765709 
-280092.623077  9111651.903834 
-280134.456716  9111664.011365 
-280173.136063  9111652.004917 
-280188.053052  9111653.028211 
-280209.935133  9111655.064816 
-280193.274335  9111688.195139 
-280193.468237  9111715.319103 
-280193.590325  9111732.397155 
-280268.053278  9111720.435465 
-280314.856932  9111732.549023 
-280335.996529  9111769.744978 
-280361.948025  9111784.846138 
-280381.806248  9111781.857207 
-280414.536013  9111771.852273 
-280426.011099  9111708.577999 
-280448.750619  9111691.528513 
-280475.494815  9111678.502340 
-280508.281980  9111676.534077 
-280531.699129  9111615.283867 
-280553.451763  9111599.237699 
-280561.324555  9111588.197128 
-280570.097869  9111564.098136 
-280578.849609  9111536.985377 
-280597.634622  9111522.944662 
-280607.466598  9111507.888210 
-280617.370466  9111502.877646 
-281032.191995  9111410.971279 
-281177.074965  9111377.999211 
-281294.176760  9111352.024563 
-281387.430193  9111327.024904 
-281433.203415  9111334.113188 
-281452.233055  9111354.228072 
-281460.379452  9111381.361612 
-281482.419885  9111405.498471 
-281521.329079  9111425.637697 
-281569.277816  9111458.847426 
-281672.162169  9111529.293516 
-281712.123219  9111557.470407 
-281699.446804  9111591.610445 
-281691.790767  9111632.788633 
-281693.109399  9111677.996077 
-281699.369087  9111719.191253 
-281718.528905  9111757.388441 
-281857.883404  9111923.312776 
-281969.180691  9111919.429670 
-281984.140997  9111926.479827 
-282000.088069  9111932.526603 
-282024.037575  9111945.615077 
-282041.987071  9111953.673405 
-282069.869184  9111960.739182 
-282102.685093  9111962.788053 
-282122.557537  9111961.807527 
-282146.391459  9111958.822640 
-282168.194047  9111949.807858 
-282185.984559  9111935.765363 
-282202.730486  9111914.689603 
-282209.551038  9111895.610992 
-282218.366776  9111877.539363 
-282228.176489  9111859.468934 
-282244.022354  9111851.451505 
-282258.903146  9111847.451191 
-282274.835742  9111851.488708 
-282278.818891  9111852.498087 
-282293.757509  9111856.534397 
-282306.729856  9111863.582041 
-282322.763675  9111881.683649 
-282343.789102  9111902.804976 
-282375.835118  9111935.994405 
-282959.854159  9112564.548310 
-283049.008197  9112660.087936 
-283065.913340  9112661.112541 
-283091.757173  9112661.143162 
-283105.680334  9112662.164220 
-283124.616974  9112669.218603 
-283151.520072  9112678.291534 
-283174.519736  9112697.405487 
-283196.481901  9112710.490804 
-283215.505621  9112729.600027 
-283229.617423  9112756.739960 
-283238.752012  9112782.869441 
-283253.879614  9112813.024252 
-283275.921678  9112837.159820 
-283285.963235  9112851.235572 
-283386.044739  9112808.157218 
-283438.530461  9112781.095748 
-283471.237884  9112768.074878 
-283502.958551  9112756.057394 
-283539.641899  9112743.041156 
-283604.983948  9112706.953561 
-283631.560238  9112670.820456 
-283638.242165  9112632.654894 
-283642.957899  9112597.500717 
-283652.636311  9112561.347797 
-283665.376573  9112536.248662 
-283686.155884  9112523.213706 
-283712.848254  9112503.153732 
-283743.487483  9112479.080120 
-283763.236430  9112461.021121 
-283800.593728  9112403.804794 
-283846.765993  9112328.516651 
-283852.642690  9112316.468780 
-283859.513367  9112304.422071 
-283904.669679  9112226.119040 
-283947.932379  9112160.873088 
-283955.796991  9112148.827537 
-283999.988122  9112074.541602 
-284042.198449  9112001.257905 
-284083.523724  9111943.041582 
-284128.933835  9111899.898420 
-284168.525450  9111876.839664 
-284200.201619  9111858.794469 
-284203.176257  9111857.793372 
-284280.422245  9111818.705409 
-284346.770805  9111784.627486 
-284364.604023  9111776.611720 
-284487.455678  9111721.503471 
-284593.365917  9111660.348015 
-284630.983650  9111639.295793 
-284649.788862  9111628.267390 
-284695.336386  9111604.210619 
-284756.721689  9111571.131068 
-284842.861186  9111525.020734 
-285019.115392  9111432.804266 
-285295.378790  9111288.464849 
-285424.103672  9111221.306705 
-285433.999395  9111215.290668 
-285458.753280  9111202.259693 
-285570.616988  9111140.104781 
-285963.620781  9110921.558100 
-285947.213732  9110852.225501 
-285905.680824  9110744.691470 
-Region 1
-223
-285851.711940  9112207.257580 
-285666.731389  9112192.985175 
-285672.347870  9111461.677304 
-285673.027855  9111418.482310 
-285674.752910  9111382.320370 
-285671.573925  9111355.193841 
-285665.354691  9111320.027438 
-285653.179076  9111285.858822 
-285636.004543  9111247.666309 
-285620.839839  9111212.489724 
-285613.685132  9111185.358659 
-285570.616988  9111140.104781 
-285458.753280  9111202.259693 
-285433.999395  9111215.290668 
-285424.103672  9111221.306705 
-285295.378790  9111288.464849 
-285019.115392  9111432.804266 
-284842.861186  9111525.020734 
-284756.721689  9111571.131068 
-284695.336386  9111604.210619 
-284649.788862  9111628.267390 
-284630.983650  9111639.295793 
-284593.365917  9111660.348015 
-284487.455678  9111721.503471 
-284364.604023  9111776.611720 
-284346.770805  9111784.627486 
-284280.422245  9111818.705409 
-284203.176257  9111857.793372 
-284200.201619  9111858.794469 
-284168.525450  9111876.839664 
-284128.933835  9111899.898420 
-284083.523724  9111943.041582 
-284042.198449  9112001.257905 
-283999.988122  9112074.541602 
-283955.796991  9112148.827537 
-283947.932379  9112160.873088 
-283904.669679  9112226.119040 
-283859.513367  9112304.422071 
-283852.642690  9112316.468780 
-283846.765993  9112328.516651 
-283800.593728  9112403.804794 
-283763.236430  9112461.021121 
-283743.487483  9112479.080120 
-283712.848254  9112503.153732 
-283686.155884  9112523.213706 
-283665.376573  9112536.248662 
-283652.636311  9112561.347797 
-283642.957899  9112597.500717 
-283638.242165  9112632.654894 
-283631.560238  9112670.820456 
-283604.983948  9112706.953561 
-283539.641899  9112743.041156 
-283502.958551  9112756.057394 
-283471.237884  9112768.074878 
-283438.530461  9112781.095748 
-283386.044739  9112808.157218 
-283285.963235  9112851.235572 
-283290.984017  9112858.273446 
-283347.460776  9112970.851231 
-283343.550108  9112979.887708 
-283344.594919  9112986.920889 
-283348.599952  9112990.943862 
-283360.469871  9112982.921318 
-283391.189464  9112969.898126 
-283412.056175  9112968.918103 
-283435.933921  9112971.959866 
-283455.842935  9112976.001516 
-283487.650883  9112976.038875 
-283515.562722  9112987.121838 
-283549.278767  9112976.111193 
-283588.900663  9112957.070943 
-283606.661855  9112939.009620 
-283633.463443  9112934.018201 
-283645.326015  9112924.991026 
-283680.108618  9112924.027179 
-283695.069423  9112931.076621 
-283717.967667  9112936.126215 
-283744.711087  9112923.098166 
-283757.582158  9112916.081272 
-283775.452272  9112913.088463 
-283790.391275  9112917.124160 
-283818.353985  9112935.238921 
-283829.295206  9112936.256251 
-283823.164044  9112913.144171 
-283835.998749  9112901.104406 
-283868.851463  9112908.174660 
-283905.701973  9112918.263232 
-283940.579047  9112930.358594 
-283967.475084  9112938.426393 
-283994.334763  9112941.471326 
-284017.225736  9112945.516189 
-284046.029760  9112942.535986 
-284073.839781  9112939.554610 
-284096.730750  9112943.599432 
-284112.649209  9112945.627029 
-284119.519860  9112933.580278 
-284149.281466  9112925.578323 
-284166.113867  9112916.556801 
-284182.924430  9112904.521569 
-284211.611951  9112885.468177 
-284224.439242  9112872.423760 
-284236.250700  9112856.364485 
-284243.143140  9112847.331430 
-284265.032784  9112850.370455 
-284276.967959  9112851.388830 
-284277.881885  9112840.339733 
-284275.733775  9112818.236936 
-284277.648971  9112808.193558 
-284295.468008  9112798.168587 
-284314.295584  9112790.153897 
-284333.159550  9112787.162039 
-284350.013692  9112781.154172 
-284360.867494  9112770.116569 
-284368.702922  9112754.052681 
-284376.596589  9112746.025332 
-284383.503545  9112739.001401 
-284400.335818  9112729.979819 
-284419.214307  9112728.997067 
-284436.126663  9112731.025713 
-284453.068146  9112737.072621 
-284454.983302  9112727.029245 
-284456.913022  9112718.995003 
-284470.850692  9112722.024762 
-284484.817494  9112729.072784 
-284514.637116  9112729.107170 
-284523.597569  9112731.126615 
-284536.563106  9112737.168906 
-284549.528647  9112743.211193 
-284567.493265  9112753.277464 
-284585.334046  9112746.266098 
-284597.218183  9112740.252430 
-284613.092835  9112736.252466 
-284630.970027  9112734.263916 
-284654.891287  9112743.332442 
-284675.852454  9112755.411224 
-284692.837682  9112767.485426 
-284715.743114  9112773.539074 
-284735.673877  9112780.593852 
-284752.680993  9112795.681721 
-284770.733134  9112817.802678 
-284789.735542  9112833.897372 
-284812.764950  9112857.028565 
-284824.838631  9112877.133525 
-284835.852712  9112888.196258 
-284844.915278  9112904.279536 
-284847.992038  9112917.342291 
-284850.067519  9112929.399343 
-284854.116399  9112939.449540 
-284876.057105  9112949.520201 
-284893.999979  9112956.572611 
-284902.989651  9112962.610224 
-284915.984460  9112972.670635 
-284934.877573  9112973.696775 
-284943.779722  9112967.679606 
-284946.696045  9112958.641934 
-284957.505932  9112941.576829 
-284969.433807  9112941.590447 
-284987.332913  9112942.615433 
-285014.134150  9112937.623233 
-285035.958136  9112931.620789 
-285047.834930  9112924.602441 
-285054.734480  9112916.573863 
-285049.676984  9112904.513434 
-285053.594567  9112896.481457 
-285070.433993  9112888.464209 
-285084.342525  9112887.475503 
-285095.407738  9112905.570101 
-285105.522756  9112929.690942 
-285122.522732  9112943.774065 
-285146.429551  9112950.833154 
-285170.321776  9112955.883102 
-285180.268963  9112956.898966 
-285203.152603  9112959.938640 
-285231.013486  9112963.988508 
-285244.892823  9112958.981498 
-285254.730494  9112944.928907 
-285269.603809  9112939.923019 
-285285.529520  9112942.954754 
-285302.478427  9112950.005859 
-285311.380505  9112943.988632 
-285315.290737  9112934.952081 
-285322.182929  9112925.918911 
-285337.107343  9112927.944939 
-285339.109923  9112929.956317 
-285356.000404  9112928.970905 
-285363.915785  9112923.957105 
-285370.837178  9112918.942179 
-285389.759447  9112923.986379 
-285409.697618  9112932.045380 
-285418.599674  9112926.028135 
-285416.524048  9112913.971145 
-285417.481513  9112908.949462 
-285423.343171  9112894.892350 
-285442.177772  9112887.881791 
-285454.134822  9112891.913531 
-285469.095747  9112898.962323 
-285483.004244  9112897.973496 
-285493.843112  9112884.926559 
-285508.716363  9112879.920604 
-285522.559092  9112869.890716 
-285529.451229  9112860.857527 
-285538.324025  9112850.822021 
-285546.210140  9112841.789954 
-285561.076061  9112835.779425 
-285569.035241  9112836.792964 
-285574.063620  9112844.835061 
-285578.024941  9112842.830427 
-285598.818220  9112831.803814 
-285610.672944  9112821.771665 
-285615.533239  9112806.708862 
-285609.225873  9112759.487783 
-285638.906477  9112740.434773 
-285668.682068  9112734.441034 
-285672.577595  9112723.395352 
-285686.252128  9112690.260548 
-285707.900410  9112660.148385 
-285723.635959  9112637.061420 
-285750.414905  9112629.055167 
-285770.374890  9112640.127705 
-285794.369288  9112659.241183 
-285823.289729  9112672.332873 
-285823.238546  9112665.300957 
-285851.711940  9112207.257580 
-Region 1
-97
-287656.442215  9110807.917560 
-287585.051200  9110695.330644 
-287513.579870  9110571.693461 
-287494.460533  9110539.527078 
-287477.336408  9110508.367416 
-287404.813162  9110376.692401 
-287301.053772  9110186.719093 
-287296.091520  9110187.718156 
-287170.377026  9110257.897260 
-287168.345220  9110251.867739 
-287147.099230  9110200.612396 
-287115.899481  9110147.336902 
-287082.704659  9110093.054607 
-287039.761206  9110064.879632 
-286989.904334  9110042.724190 
-286953.122153  9110041.678715 
-286866.636873  9110039.573267 
-286611.097992  9110025.223921 
-286274.028429  9110006.762967 
-286197.467505  9110002.658310 
-286194.500360  9110004.664057 
-286189.516158  9110002.649323 
-286164.595155  9109992.575642 
-286151.579265  9109979.501760 
-286148.539081  9109971.461915 
-286225.268907  9109725.433804 
-286182.479561  9109718.353536 
-286092.976338  9109711.220275 
-286074.077399  9109709.189738 
-285711.021860  9109670.603403 
-285740.257215  9110001.134745 
-285743.837180  9110083.512165 
-285743.866362  9110087.530410 
-285643.407217  9110077.370270 
-285772.057967  9110411.028491 
-285778.138314  9110427.108247 
-285826.759389  9110552.732543 
-285836.873918  9110576.853278 
-285905.680824  9110744.691470 
-285947.213732  9110852.225501 
-285963.620781  9110921.558100 
-285570.616988  9111140.104781 
-285613.685132  9111185.358659 
-285620.839839  9111212.489724 
-285636.004543  9111247.666309 
-285653.179076  9111285.858822 
-285665.354691  9111320.027438 
-285671.573925  9111355.193841 
-285674.752910  9111382.320370 
-285673.027855  9111418.482310 
-285672.347870  9111461.677304 
-285666.731389  9112192.985175 
-285851.711940  9112207.257580 
-285877.555124  9112207.286673 
-285922.364130  9112218.387142 
-285985.101147  9112234.530451 
-286083.102592  9112316.008953 
-286197.015230  9112398.509485 
-286315.971330  9112491.060736 
-286397.989721  9112561.470433 
-286403.355101  9112615.722005 
-286361.134166  9112686.997990 
-286339.742718  9112752.269847 
-286351.152553  9112817.578187 
-286453.334588  9112790.568879 
-286550.583206  9112768.576642 
-286685.764070  9112768.726167 
-286813.825649  9112746.767432 
-286873.390809  9112736.787571 
-286932.625773  9112681.602733 
-286927.061673  9112600.228434 
-286926.621526  9112539.955221 
-286947.098760  9112485.732300 
-286993.382435  9112426.515040 
-287070.390883  9112355.276975 
-287118.654864  9112295.057284 
-287144.860748  9112208.695216 
-287151.730416  9112196.648221 
-287188.037275  9112132.397215 
-287191.969079  9112126.374262 
-287279.491863  9111997.888565 
-287334.683568  9111933.658209 
-287359.319527  9111904.553411 
-287373.117412  9111888.495813 
-287497.415461  9111760.050160 
-287568.142512  9111645.609499 
-287611.907886  9111514.062190 
-287616.693980  9111488.953854 
-287627.216036  9111432.710964 
-287628.736333  9111232.808705 
-287629.598084  9111214.727884 
-287656.334090  9111065.080278 
-287668.777901  9110999.798623 
-287706.180128  9110949.612357 
-287740.637211  9110904.445575 
-287727.613304  9110890.367774 
-287656.442215  9110807.917560 
-Region 1
-85
-287191.847387  9108158.420797 
-287190.831565  9108155.406024 
-287127.982590  9107986.571926 
-287031.539773  9107708.204266 
-286962.458828  9107502.194345 
-286888.145875  9107533.251564 
-286798.932180  9107565.296401 
-286757.299553  9107580.317579 
-286713.679166  9107595.336476 
-286630.406429  9107624.374110 
-286543.136196  9107650.393430 
-286503.469190  9107662.402993 
-286324.894355  9107706.400061 
-286242.571115  9107729.410860 
-285940.894065  9107792.352410 
-285930.969928  9107794.350127 
-285649.314710  9108151.647318 
-285618.333389  9108265.126261 
-285598.980030  9108337.431880 
-285589.274209  9108369.566439 
-285603.210454  9108372.596159 
-285620.830929  9108335.447943 
-285634.519544  9108304.322525 
-285645.226494  9108273.193673 
-285659.952662  9108248.096775 
-285672.698336  9108224.002150 
-285688.418358  9108198.906393 
-285705.175948  9108179.839153 
-285721.955376  9108163.785597 
-285749.645617  9108144.730923 
-285778.351567  9108128.691066 
-285810.060986  9108115.668307 
-285846.754347  9108104.660357 
-285865.616174  9108101.668347 
-285984.317729  9108161.073006 
-286025.363422  9108338.925711 
-286040.774826  9108408.257412 
-286061.272423  9108493.667731 
-286076.654815  9108558.981150 
-286108.479349  9108698.650105 
-286108.501235  9108701.663784 
-286149.438951  9108864.447705 
-286154.561669  9108885.549107 
-286188.433100  9109033.256605 
-286226.265866  9109178.959406 
-286230.358284  9109195.036857 
-286262.140390  9109328.678092 
-286276.040428  9109326.684727 
-286293.053632  9109342.776787 
-286304.066908  9109353.839299 
-286317.141038  9109374.949640 
-286323.316287  9109404.088576 
-286337.369740  9109423.190911 
-286360.324519  9109436.275995 
-286393.203749  9109447.363167 
-286413.746959  9109402.181617 
-286442.621321  9109409.246039 
-286466.935476  9109335.941352 
-286545.607223  9109357.125527 
-286591.187624  9109201.471766 
-286734.711156  9109256.883231 
-286803.480349  9109283.078586 
-286800.447451  9109276.043354 
-286734.951873  9109153.415057 
-286808.185731  9109110.301669 
-286840.881878  9109096.274654 
-286870.779187  9109107.358169 
-286878.759607  9109111.385295 
-286892.564407  9109096.332543 
-286896.474147  9109087.295995 
-286950.713981  9109029.092961 
-286948.623769  9109015.026965 
-286982.218560  9108987.941772 
-286986.157543  9108982.923442 
-287055.107911  9108897.614033 
-287090.573231  9108854.458143 
-287149.540450  9108763.110252 
-287154.458645  9108756.083916 
-287080.924464  9108621.392614 
-287048.687547  9108425.469974 
-287047.671723  9108422.455196 
-287025.732410  9108275.766790 
-287269.905212  9108368.458009 
-287231.354824  9108260.928614 
-287191.847387  9108158.420797 
-Region 1
-72
-286393.203749  9109447.363167 
-286360.324519  9109436.275995 
-286337.369740  9109423.190911 
-286323.316287  9109404.088576 
-286317.141038  9109374.949640 
-286304.066908  9109353.839299 
-286293.053632  9109342.776787 
-286276.040428  9109326.684727 
-286262.140390  9109328.678092 
-286230.358284  9109195.036857 
-286226.265866  9109178.959406 
-286188.433100  9109033.256605 
-286154.561669  9108885.549107 
-286149.438951  9108864.447705 
-286108.501235  9108701.663784 
-286108.479349  9108698.650105 
-286076.654815  9108558.981150 
-286061.272423  9108493.667731 
-286040.774826  9108408.257412 
-286025.363422  9108338.925711 
-285984.317729  9108161.073006 
-285865.616174  9108101.668347 
-285846.754347  9108104.660357 
-285810.060986  9108115.668307 
-285778.351567  9108128.691066 
-285749.645617  9108144.730923 
-285721.955376  9108163.785597 
-285705.175948  9108179.839153 
-285688.418358  9108198.906393 
-285672.698336  9108224.002150 
-285659.952662  9108248.096775 
-285645.226494  9108273.193673 
-285634.519544  9108304.322525 
-285620.830929  9108335.447943 
-285603.210454  9108372.596159 
-285589.274209  9108369.566439 
-285573.692445  9108413.748882 
-285558.249020  9108477.018024 
-285534.970967  9108556.351014 
-285530.132592  9108574.427423 
-285525.279652  9108590.494705 
-285485.476720  9108721.040953 
-285472.847368  9108761.208590 
-285471.172700  9108804.402522 
-285468.489579  9108845.586182 
-285468.627942  9108864.672885 
-285468.904675  9108902.846290 
-285472.359752  9108968.146336 
-285469.815040  9109028.416696 
-285470.048109  9109060.562719 
-285471.165830  9109077.641437 
-285473.466836  9109120.839942 
-285473.911165  9109182.118293 
-285474.319093  9109238.373827 
-285476.598294  9109278.558636 
-285481.793662  9109309.705805 
-285492.879633  9109330.814195 
-285498.915933  9109340.866677 
-285507.897530  9109345.899769 
-285541.610231  9109334.888392 
-285627.905207  9109310.878100 
-285826.314402  9109259.872929 
-285852.474851  9109440.722280 
-285693.755747  9109482.732187 
-285711.021860  9109670.603403 
-286074.077399  9109709.189738 
-286092.976338  9109711.220275 
-286182.479561  9109718.353536 
-286225.268907  9109725.433804 
-286307.822851  9109460.325867 
-286326.699756  9109459.342654 
-286393.203749  9109447.363167 
-Region 1
-77
-285627.905207  9109310.878100 
-285541.610231  9109334.888392 
-285507.897530  9109345.899769 
-285498.915933  9109340.866677 
-285492.879633  9109330.814195 
-285481.793662  9109309.705805 
-285476.598294  9109278.558636 
-285474.319093  9109238.373827 
-285473.911165  9109182.118293 
-285473.466836  9109120.839942 
-285471.165830  9109077.641437 
-285470.048109  9109060.562719 
-285469.815040  9109028.416696 
-285472.359752  9108968.146336 
-285468.904675  9108902.846290 
-285468.627942  9108864.672885 
-285468.489579  9108845.586182 
-285471.172700  9108804.402522 
-285472.847368  9108761.208590 
-285485.476720  9108721.040953 
-285525.279652  9108590.494705 
-285496.500505  9108596.488856 
-285415.161571  9108618.495205 
-284843.907101  9108787.602242 
-284608.883132  9108860.660297 
-284574.161932  9108869.660648 
-284555.886813  9108816.397552 
-284532.576904  9108754.087489 
-284518.451753  9108724.938666 
-284470.229190  9108653.558235 
-284430.995409  9108588.215655 
-284386.770512  9108519.853450 
-284367.581759  9108477.639276 
-284331.518619  9108438.418862 
-284325.526238  9108434.393547 
-284264.543104  9108522.722962 
-284239.942307  9108556.849002 
-284216.371638  9108595.999062 
-284194.817742  9108639.169750 
-284177.195898  9108676.317713 
-284162.512219  9108707.441777 
-284150.817480  9108739.573936 
-284143.098339  9108771.710796 
-284137.330736  9108798.827154 
-284109.174732  9108891.213584 
-284108.217088  9108896.235263 
-284154.865345  9108887.249335 
-284225.330999  9108873.268663 
-284292.553868  9108960.744752 
-284353.044197  9108941.729307 
-284418.309385  9109170.845841 
-284449.962941  9109287.411977 
-284463.203346  9109331.628146 
-284483.619086  9109405.989510 
-284558.223824  9109689.362609 
-284579.692084  9109771.761544 
-284606.289990  9109876.266728 
-284626.742770  9109955.650730 
-284626.989948  9109989.806022 
-284646.448936  9110069.188833 
-284698.118647  9110067.239836 
-284832.313401  9110069.404818 
-284847.222307  9110069.422110 
-284965.499588  9110069.559118 
-285205.057548  9110072.849329 
-285279.580068  9110069.921431 
-285407.759875  9110065.045893 
-285618.508094  9110070.309954 
-285643.407217  9110077.370270 
-285743.866362  9110087.530410 
-285743.837180  9110083.512165 
-285740.257215  9110001.134745 
-285711.021860  9109670.603403 
-285693.755747  9109482.732187 
-285852.474851  9109440.722280 
-285826.314402  9109259.872929 
-285627.905207  9109310.878100 
-Region 1
-203
-290466.514862  9105983.138244 
-290473.301828  9105960.041231 
-290225.607957  9105927.633892 
-290219.637743  9105926.623019 
-290089.286864  9105904.384670 
-290001.780240  9105897.259644 
-289940.237814  9105907.239248 
-289933.288522  9105908.236354 
-289858.833895  9105919.206586 
-289818.212895  9105936.240155 
-289806.323995  9105941.250085 
-289783.532632  9105950.266462 
-289764.731221  9105961.296175 
-289723.999719  9105963.261552 
-289568.273065  9106004.280090 
-289493.884254  9106024.290659 
-289471.939456  9106013.217116 
-289446.004706  9106000.130184 
-289429.993386  9105985.044876 
-289413.982077  9105969.959561 
-289395.990507  9105955.876632 
-289376.961020  9105935.765359 
-289361.862680  9105909.631112 
-289347.692004  9105874.457037 
-289338.541866  9105846.320137 
-289324.407993  9105816.168764 
-289322.390971  9105812.148437 
-289308.293877  9105787.019773 
-289297.266428  9105773.948859 
-289263.109471  9105723.685027 
-289259.082798  9105716.648906 
-289254.062318  9105709.611706 
-289249.027143  9105700.565417 
-289231.934019  9105673.424386 
-289215.842071  9105647.288967 
-289207.781411  9105632.212165 
-289198.719604  9105616.129735 
-289183.599467  9105586.981741 
-289170.511038  9105563.863166 
-289168.494045  9105559.842826 
-289157.400588  9105537.730950 
-289141.294055  9105509.586392 
-289125.246303  9105489.478182 
-289105.201322  9105466.351998 
-289087.217404  9105453.273418 
-289066.259432  9105441.196122 
-289047.347815  9105437.157347 
-289015.480058  9105428.081733 
-288983.641674  9105423.024276 
-288959.768393  9105419.984578 
-288934.798549  9105402.880134 
-288900.994592  9105400.834077 
-288877.158012  9105402.817063 
-288862.199605  9105395.768914 
-288847.292568  9105395.752585 
-288832.385529  9105395.736251 
-288815.461535  9105391.699546 
-288791.588261  9105388.659751 
-288780.663768  9105389.652306 
-288742.943274  9105395.638142 
-288720.056462  9105391.594853 
-288712.084032  9105388.572477 
-288709.278661  9105412.678337 
-288689.703310  9105453.842940 
-288686.014149  9105493.015920 
-288686.608299  9105574.384256 
-288674.018889  9105619.574698 
-288644.622724  9105676.801154 
-288598.449055  9105750.081800 
-288581.715606  9105772.163277 
-288573.838448  9105782.200014 
-288535.255754  9105806.266530 
-288431.227903  9105850.351725 
-288259.693557  9105904.407526 
-288216.068185  9105918.422839 
-288157.733299  9105959.544450 
-288124.097289  9105980.602554 
-288108.159556  9105975.562172 
-288056.319829  9105953.404719 
-288035.398367  9105946.349689 
-288022.515333  9105951.358090 
-288017.560883  9105953.361671 
-288011.656547  9105961.391451 
-288008.740991  9105970.429096 
-288012.789496  9105980.479021 
-288018.796352  9105986.512950 
-288038.899774  9106017.676096 
-288043.080118  9106045.807927 
-288037.190427  9106055.846814 
-288024.322011  9106062.864324 
-288008.442834  9106065.860317 
-287996.487681  9106061.828866 
-287969.427507  9106030.657965 
-287933.357098  9105990.436126 
-287920.203173  9105958.276106 
-287903.125234  9105933.143510 
-287869.232903  9105919.042141 
-287844.416694  9105923.032648 
-287808.683096  9105929.020049 
-287785.883777  9105937.030953 
-287763.128349  9105951.069160 
-287784.166881  9105974.197160 
-287809.217311  9106002.352338 
-287837.190688  9106022.474405 
-287893.144830  9106063.723019 
-287974.010543  9106114.040114 
-288051.880296  9106162.344612 
-288109.785795  9106198.572320 
-288099.220027  9106248.787719 
-288082.867114  9106323.105720 
-288080.024830  9106342.188872 
-288074.288975  9106373.323325 
-288197.765497  9106406.609791 
-288231.614297  9106414.683502 
-288267.465421  9106424.768476 
-288285.390987  9106429.810950 
-288352.102134  9106446.961650 
-288585.112807  9106509.499048 
-288651.831427  9106527.653794 
-288645.454493  9106607.005403 
-288641.934276  9106669.282973 
-288646.085781  9106693.396448 
-288654.286036  9106727.559736 
-288685.099569  9106864.210668 
-288660.283039  9106868.201730 
-288671.552990  9106914.422819 
-288690.993981  9106990.788971 
-288804.254821  9106985.889667 
-288817.174714  9106985.903725 
-288827.766953  9107075.319118 
-288830.939498  9107101.440551 
-288843.284398  9107158.712619 
-288856.542357  9107204.935753 
-288904.187995  9107196.951165 
-288909.311547  9107218.052008 
-288910.356837  9107225.084903 
-288919.588071  9107264.271868 
-288931.056941  9107337.615518 
-288948.783024  9107451.147410 
-288951.882197  9107467.223357 
-288957.020536  9107490.333270 
-288975.387736  9107555.648039 
-288991.664358  9107606.897012 
-289012.041462  9107675.227521 
-289049.741639  9107666.227391 
-289080.639311  9107678.315159 
-289085.623282  9107680.329606 
-289086.786327  9107703.435193 
-289141.359361  9107827.051912 
-289147.440224  9107843.131029 
-289239.971619  9108128.518522 
-289245.920059  9108126.515831 
-289349.156358  9108109.549331 
-289551.137326  9108005.293537 
-289571.927255  9107994.265830 
-289576.881798  9107992.262043 
-289665.231779  9107978.292651 
-289679.131011  9107976.298369 
-289701.960193  9107972.304512 
-289721.763573  9107962.280232 
-289731.606282  9107949.231765 
-289756.106132  9107902.044758 
-289777.690738  9107863.895445 
-289803.294954  9107831.777592 
-289822.023289  9107810.702290 
-289844.749128  9107792.644823 
-289885.297873  9107765.565456 
-289918.941249  9107745.510471 
-290008.997871  9107693.370157 
-290200.365359  9107903.518995 
-290228.429436  9107935.693483 
-290263.273303  9107943.766349 
-290324.574522  9107900.635945 
-290378.386896  9107785.171516 
-290412.853942  9107742.012902 
-290451.569618  9107736.026303 
-290469.525328  9107745.085871 
-290431.013170  9107643.588080 
-290390.794163  9107580.260537 
-290385.773258  9107573.223560 
-290341.497811  9107498.841853 
-290310.186739  9107430.500892 
-290288.976555  9107384.270184 
-290261.788634  9107336.024096 
-290232.568829  9107281.748650 
-290181.115820  9107177.223155 
-290128.809407  9107091.782725 
-290117.552708  9107047.571445 
-290104.205128  9106989.294504 
-290114.421900  9106891.865803 
-290138.692372  9106813.538088 
-290145.501665  9106793.454681 
-290198.467600  9106698.080332 
-290252.508304  9106613.756944 
-290265.199323  9106582.629922 
-290307.100042  9106469.162297 
-290328.639464  9106424.985737 
-290361.942347  9106358.721946 
-290415.893910  9106262.344063 
-290446.692504  9106125.760533 
-290471.660961  9106007.252394 
-290469.533171  9105988.164082 
-290466.514862  9105983.138244 
-Region 1
-152
-288687.165610  9105378.499701 
-288664.315474  9105379.479117 
-288629.554361  9105382.454495 
-288591.716507  9105372.367441 
-288568.866360  9105373.346808 
-288538.949620  9105359.250272 
-288494.738505  9105292.901835 
-288450.520207  9105225.548774 
-288439.383218  9105197.409322 
-288429.108154  9105151.189082 
-288427.564827  9105075.846811 
-288433.073353  9105013.571374 
-288430.594896  9104946.264391 
-288430.506982  9104934.209802 
-288411.302562  9104889.988729 
-288401.196148  9104866.873085 
-288383.994033  9104824.663286 
-288383.217677  9104718.181054 
-288378.986190  9104683.017414 
-288064.832768  9104803.212836 
-287858.847572  9104902.432314 
-287746.950591  9104957.556778 
-287773.951319  9104980.691596 
-287715.427297  9105132.312155 
-287652.774238  9105262.832643 
-287627.812523  9105383.350006 
-287592.832218  9105492.806135 
-287538.362957  9105655.481280 
-287524.756565  9105697.656899 
-287522.798173  9105701.672881 
-287483.900739  9105819.160995 
-287473.202642  9105851.294430 
-287429.372238  9105837.181513 
-287393.360965  9105941.613774 
-287452.120741  9105958.757120 
-287581.588186  9105996.070575 
-287589.553392  9105998.088589 
-287650.308220  9106016.238420 
-287634.553348  9106036.311681 
-287612.791635  9106050.350947 
-287571.219246  9106073.408917 
-287549.428240  9106083.429947 
-287515.769820  9106101.474023 
-287460.495781  9106153.648367 
-287426.961545  9106188.769812 
-287417.213345  9106214.877052 
-287408.510140  9106248.017286 
-287406.880710  9106297.238197 
-287407.998827  9106314.316730 
-287398.250605  9106340.423974 
-287372.615689  9106368.522467 
-287364.745448  9106379.563631 
-287352.994908  9106403.659532 
-287347.163496  9106421.734808 
-287336.326362  9106434.781729 
-287318.525075  9106446.816275 
-287303.676042  9106454.835951 
-287293.788866  9106461.856657 
-287276.075263  9106485.945846 
-287271.179178  9106495.985803 
-287248.394052  9106506.005632 
-287219.580127  9106506.977745 
-287181.850901  9106511.957982 
-287170.940624  9106514.959328 
-287138.129416  9106512.913244 
-287109.242412  9106503.839733 
-287087.378013  9106503.815056 
-287066.595103  9106515.846158 
-287044.862168  9106533.903466 
-287004.246296  9106551.939424 
-286993.350594  9106556.949844 
-286980.430700  9106556.935234 
-286966.516966  9106556.919495 
-286951.543672  9106547.861621 
-286938.594570  9106543.828772 
-286910.876622  9106558.865610 
-286895.033613  9106566.884052 
-286882.128310  9106568.878527 
-286873.183760  9106568.868391 
-286855.323858  9106572.866340 
-286840.467370  9106579.881335 
-286830.572774  9106585.897406 
-286822.695053  9106595.933957 
-286816.812309  9106606.977320 
-286811.886905  9106612.999025 
-286803.987277  9106620.021904 
-287092.449000  9106791.121290 
-287140.986567  9106905.694325 
-287215.444514  9106894.728060 
-287242.249066  9106890.739995 
-287301.784648  9106877.747740 
-287488.393021  9106845.811315 
-287563.785951  9106826.809206 
-287645.134509  9106806.809081 
-287716.566532  9106789.811418 
-287767.157149  9106776.808650 
-287879.189909  9106739.765037 
-288013.028200  9106694.708999 
-288027.642658  9106654.543489 
-288048.576503  9106526.989803 
-288074.288975  9106373.323325 
-288080.024830  9106342.188872 
-288082.867114  9106323.105720 
-288099.220027  9106248.787719 
-288109.785795  9106198.572320 
-288051.880296  9106162.344612 
-287974.010543  9106114.040114 
-287893.144830  9106063.723019 
-287837.190688  9106022.474405 
-287809.217311  9106002.352338 
-287784.166881  9105974.197160 
-287763.128349  9105951.069160 
-287785.883777  9105937.030953 
-287808.683096  9105929.020049 
-287844.416694  9105923.032648 
-287869.232903  9105919.042141 
-287903.125234  9105933.143510 
-287920.203173  9105958.276106 
-287933.357098  9105990.436126 
-287969.427507  9106030.657965 
-287996.487681  9106061.828866 
-288008.442834  9106065.860317 
-288024.322011  9106062.864324 
-288037.190427  9106055.846814 
-288043.080118  9106045.807927 
-288038.899774  9106017.676096 
-288018.796352  9105986.512950 
-288012.789496  9105980.479021 
-288008.740991  9105970.429096 
-288011.656547  9105961.391451 
-288017.560883  9105953.361671 
-288022.515333  9105951.358090 
-288035.398367  9105946.349689 
-288056.319829  9105953.404719 
-288108.159556  9105975.562172 
-288124.097289  9105980.602554 
-288157.733299  9105959.544450 
-288216.068185  9105918.422839 
-288259.693557  9105904.407526 
-288431.227903  9105850.351725 
-288535.255754  9105806.266530 
-288573.838448  9105782.200014 
-288581.715606  9105772.163277 
-288598.449055  9105750.081800 
-288644.622724  9105676.801154 
-288674.018889  9105619.574698 
-288686.608299  9105574.384256 
-288686.014149  9105493.015920 
-288689.703310  9105453.842940 
-288709.278661  9105412.678337 
-288712.084032  9105388.572477 
-288687.165610  9105378.499701 
-Region 1
-111
-287725.167435  9104968.582315 
-287567.708676  9105044.750696 
-287406.295978  9105123.927823 
-287301.325116  9105175.041064 
-287296.728502  9105226.267752 
-287291.123478  9105275.484206 
-287283.574652  9105330.725744 
-287276.939304  9105374.918301 
-287275.002803  9105381.947940 
-287261.447283  9105431.155409 
-287255.645072  9105453.248880 
-287247.877141  9105478.353769 
-287244.946821  9105485.382285 
-287234.146323  9105503.451916 
-287229.257583  9105514.496404 
-287217.455958  9105531.560356 
-287207.663860  9105551.640221 
-287196.899846  9105574.732628 
-287169.357781  9105613.878803 
-287156.562295  9105630.941625 
-287153.588147  9105631.942805 
-287142.707272  9105638.962318 
-287112.081461  9105664.041321 
-287091.386498  9105688.127018 
-287067.037444  9105756.408670 
-287031.858499  9105838.741719 
-286931.270825  9105809.495669 
-286793.831588  9105769.157351 
-286783.227785  9105814.349986 
-286774.626208  9105861.554002 
-286759.359625  9105948.932400 
-286755.566683  9105974.041812 
-286754.915706  9106021.254889 
-286744.479648  9106089.552359 
-286734.145714  9106171.913639 
-286721.940842  9106270.345583 
-286714.486271  9106338.646457 
-286710.656845  9106358.733086 
-286787.386468  9106386.947715 
-286853.169369  9106413.140673 
-286843.457284  9106444.270661 
-286826.934312  9106495.483896 
-286802.482502  9106549.701780 
-286777.964958  9106594.878648 
-286773.046847  9106601.904907 
-286803.987277  9106620.021904 
-286811.886905  9106612.999025 
-286816.812309  9106606.977320 
-286822.695053  9106595.933957 
-286830.572774  9106585.897406 
-286840.467370  9106579.881335 
-286855.323858  9106572.866340 
-286873.183760  9106568.868391 
-286882.128310  9106568.878527 
-286895.033613  9106566.884052 
-286910.876622  9106558.865610 
-286938.594570  9106543.828772 
-286951.543672  9106547.861621 
-286966.516966  9106556.919495 
-286980.430700  9106556.935234 
-286993.350594  9106556.949844 
-287004.246296  9106551.939424 
-287044.862168  9106533.903466 
-287066.595103  9106515.846158 
-287087.378013  9106503.815056 
-287109.242412  9106503.839733 
-287138.129416  9106512.913244 
-287170.940624  9106514.959328 
-287181.850901  9106511.957982 
-287219.580127  9106506.977745 
-287248.394052  9106506.005632 
-287271.179178  9106495.985803 
-287276.075263  9106485.945846 
-287293.788866  9106461.856657 
-287303.676042  9106454.835951 
-287318.525075  9106446.816275 
-287336.326362  9106434.781729 
-287347.163496  9106421.734808 
-287352.994908  9106403.659532 
-287364.745448  9106379.563631 
-287372.615689  9106368.522467 
-287398.250605  9106340.423974 
-287407.998827  9106314.316730 
-287406.880710  9106297.238197 
-287408.510140  9106248.017286 
-287417.213345  9106214.877052 
-287426.961545  9106188.769812 
-287460.495781  9106153.648367 
-287515.769820  9106101.474023 
-287549.428240  9106083.429947 
-287571.219246  9106073.408917 
-287612.791635  9106050.350947 
-287634.553348  9106036.311681 
-287650.308220  9106016.238420 
-287589.553392  9105998.088589 
-287581.588186  9105996.070575 
-287452.120741  9105958.757120 
-287393.360965  9105941.613774 
-287429.372238  9105837.181513 
-287473.202642  9105851.294430 
-287483.900739  9105819.160995 
-287522.798173  9105701.672881 
-287524.756565  9105697.656899 
-287538.362957  9105655.481280 
-287592.832218  9105492.806135 
-287627.812523  9105383.350006 
-287652.774238  9105262.832643 
-287715.427297  9105132.312155 
-287773.951319  9104980.691596 
-287746.950591  9104957.556778 
-287725.167435  9104968.582315 
-Region 1
-166
-288378.986190  9104683.017414 
-288374.747394  9104646.849222 
-288364.465335  9104599.624362 
-288355.286930  9104567.468841 
-288355.264963  9104564.455192 
-288342.162687  9104539.327096 
-288316.133892  9104513.180078 
-288277.207878  9104490.032310 
-288212.487394  9104472.883008 
-288160.649563  9104450.725266 
-288148.665604  9104442.675551 
-288117.704622  9104421.545585 
-288091.610172  9104386.357428 
-288042.080948  9104271.784112 
-287976.498020  9104136.097257 
-287956.359243  9104099.911088 
-287922.146799  9104041.609129 
-287880.992640  9103985.308404 
-287834.898944  9103933.020232 
-287824.902734  9103924.972620 
-287782.937685  9103893.784455 
-287715.229508  9103875.626271 
-287655.610312  9103876.563478 
-287637.773475  9103883.575136 
-287585.117974  9103885.524670 
-287550.335821  9103885.485295 
-287491.703033  9103885.418859 
-287449.964427  9103885.371519 
-287445.302071  9103927.557185 
-287435.933569  9104005.901191 
-287434.983582  9104011.927393 
-287431.271215  9104048.086860 
-287430.372318  9104061.144947 
-287422.881899  9104124.422888 
-287421.011118  9104140.493513 
-287410.714529  9104227.877394 
-287401.367930  9104309.235076 
-287390.143254  9104405.658833 
-287389.251664  9104419.721476 
-287379.839369  9104492.038171 
-287368.592795  9104585.448272 
-287366.743917  9104604.532565 
-287282.710627  9104528.091715 
-287158.670680  9104416.445945 
-287143.661713  9104402.365185 
-287109.170822  9104442.507820 
-287073.146399  9104408.312119 
-286915.012321  9104254.435487 
-286894.295830  9104275.507305 
-286822.346792  9104357.797943 
-286798.670698  9104381.879995 
-286797.786205  9104396.947228 
-286751.078010  9104396.893653 
-286751.558866  9104463.194508 
-286754.726848  9104625.935238 
-286728.895422  9104626.910171 
-286727.748615  9104605.813304 
-286725.887810  9104486.269704 
-286719.065423  9104367.724948 
-286717.328635  9104265.258825 
-286718.162177  9104243.159676 
-286717.608618  9104166.813214 
-286714.936432  9104072.382407 
-286711.481711  9104007.082655 
-286708.034304  9103942.787458 
-286704.317519  9103841.323575 
-286701.543620  9103732.828915 
-286699.301249  9103697.667059 
-286695.941353  9103645.426551 
-286681.056565  9103648.423042 
-286608.525512  9103650.348451 
-286543.981017  9103657.305736 
-286494.277649  9103655.239143 
-286462.462252  9103653.193210 
-286423.719510  9103655.157436 
-286409.843003  9103660.164115 
-286383.120119  9103675.201418 
-286340.802209  9103732.411823 
-286312.440758  9103795.665727 
-286295.822825  9103833.819443 
-286241.935584  9103940.239483 
-286233.144226  9103961.324886 
-286224.367404  9103984.419412 
-286205.587279  9103998.461339 
-286190.709578  9104002.462264 
-286187.735491  9104003.463361 
-286167.309481  9104064.717371 
-286165.569107  9104098.870161 
-286164.924319  9104147.087971 
-286169.401191  9104216.407348 
-286168.242590  9104330.925070 
-286165.515734  9104366.081267 
-286155.795957  9104396.206580 
-286147.004518  9104417.291993 
-286136.218209  9104437.370536 
-286139.425032  9104468.515412 
-286148.594647  9104499.667206 
-286167.673163  9104526.812276 
-286185.779727  9104556.969864 
-286189.885849  9104575.056578 
-286201.021312  9104603.196965 
-286210.169193  9104631.335044 
-286219.280714  9104654.450312 
-286232.440204  9104687.615788 
-286286.607544  9104756.992574 
-286309.676043  9104786.151250 
-286337.815489  9104829.379492 
-286379.992012  9104889.701274 
-286435.109974  9104953.051548 
-286437.447110  9105001.272710 
-286438.477327  9105006.296654 
-286467.334131  9105011.352624 
-286493.209518  9105016.405145 
-286505.171614  9105021.441655 
-286544.090328  9105043.586503 
-286581.021460  9105065.729027 
-286592.033483  9105076.791722 
-286544.986371  9105167.147287 
-286536.129505  9105179.191728 
-286532.212546  9105187.223637 
-286502.497154  9105337.872157 
-286500.677089  9105360.974740 
-286478.562448  9105463.413555 
-286457.361439  9105554.803364 
-286440.969208  9105624.098575 
-286443.219134  9105660.264999 
-286507.955954  9105679.425717 
-286525.866599  9105682.459894 
-286546.758707  9105685.497478 
-286618.488773  9105709.688776 
-286635.405605  9105712.721768 
-286647.346041  9105714.744517 
-286736.979543  9105740.965155 
-286796.740110  9105759.115173 
-286793.831588  9105769.157351 
-286931.270825  9105809.495669 
-287031.858499  9105838.741719 
-287067.037444  9105756.408670 
-287091.386498  9105688.127018 
-287112.081461  9105664.041321 
-287142.707272  9105638.962318 
-287153.588147  9105631.942805 
-287156.562295  9105630.941625 
-287169.357781  9105613.878803 
-287196.899846  9105574.732628 
-287207.663860  9105551.640221 
-287217.455958  9105531.560356 
-287229.257583  9105514.496404 
-287234.146323  9105503.451916 
-287244.946821  9105485.382285 
-287247.877141  9105478.353769 
-287255.645072  9105453.248880 
-287261.447283  9105431.155409 
-287275.002803  9105381.947940 
-287276.939304  9105374.918301 
-287283.574652  9105330.725744 
-287291.123478  9105275.484206 
-287296.728502  9105226.267752 
-287301.325116  9105175.041064 
-287406.295978  9105123.927823 
-287567.708676  9105044.750696 
-287725.167435  9104968.582315 
-287746.950591  9104957.556778 
-287858.847572  9104902.432314 
-288064.832768  9104803.212836 
-288378.986190  9104683.017414 
-Region 1
-68
-287422.138685  9103885.339937 
-287399.311010  9103889.332203 
-287361.532896  9103887.280185 
-287340.641691  9103884.242793 
-287281.695183  9103840.980183 
-287249.784936  9103825.875622 
-287232.817810  9103815.810808 
-287215.865275  9103807.755098 
-287204.889986  9103801.715294 
-287189.895844  9103789.643613 
-287172.899576  9103775.560544 
-287126.967190  9103745.371641 
-287106.975053  9103729.276018 
-287073.011774  9103705.128012 
-287043.067354  9103687.011865 
-287005.158189  9103666.877470 
-286973.262698  9103653.781775 
-286953.321648  9103644.717963 
-286934.396234  9103638.668954 
-286912.511357  9103635.630188 
-286839.965859  9103635.546848 
-286801.230510  9103638.515951 
-286765.432784  9103635.461102 
-286728.684964  9103638.432432 
-286707.852094  9103643.431179 
-286695.941353  9103645.426551 
-286699.301249  9103697.667059 
-286701.543620  9103732.828915 
-286704.317519  9103841.323575 
-286708.034304  9103942.787458 
-286711.481711  9104007.082655 
-286714.936432  9104072.382407 
-286717.608618  9104166.813214 
-286718.162177  9104243.159676 
-286717.328635  9104265.258825 
-286719.065423  9104367.724948 
-286725.887810  9104486.269704 
-286727.748615  9104605.813304 
-286728.895422  9104626.910171 
-286754.726848  9104625.935238 
-286751.558866  9104463.194508 
-286751.078010  9104396.893653 
-286797.786205  9104396.947228 
-286798.670698  9104381.879995 
-286822.346792  9104357.797943 
-286894.295830  9104275.507305 
-286915.012321  9104254.435487 
-287073.146399  9104408.312119 
-287109.170822  9104442.507820 
-287143.661713  9104402.365185 
-287158.670680  9104416.445945 
-287282.710627  9104528.091715 
-287366.743917  9104604.532565 
-287368.592795  9104585.448272 
-287379.839369  9104492.038171 
-287389.251664  9104419.721476 
-287390.143254  9104405.658833 
-287401.367930  9104309.235076 
-287410.714529  9104227.877394 
-287421.011118  9104140.493513 
-287422.881899  9104124.422888 
-287430.372318  9104061.144947 
-287431.271215  9104048.086860 
-287434.983582  9104011.927393 
-287435.933569  9104005.901191 
-287445.302071  9103927.557185 
-287449.964427  9103885.371519 
-287422.138685  9103885.339937 
-Region 1
-296
-286507.928982  9107455.470770 
-286307.455525  9107357.800981 
-286308.376460  9107347.756522 
-286308.259783  9107331.683571 
-286310.145408  9107317.622008 
-286313.996873  9107300.549038 
-286319.785006  9107276.446421 
-286360.051826  9107210.192025 
-286456.421148  9107068.660304 
-286551.796076  9106927.127381 
-286560.638574  9106913.073748 
-286537.838424  9106921.084186 
-286518.977186  9106924.076352 
-286493.159000  9106927.060580 
-286461.348540  9106926.019758 
-286435.493878  9106923.981160 
-286413.600027  9106919.937967 
-286359.822799  9106904.808273 
-286315.991373  9106890.694436 
-286267.154277  9106871.552061 
-286202.422919  9106853.395950 
-286153.687890  9106848.317277 
-286113.926643  9106847.267067 
-286083.102748  9106845.222543 
-286048.339871  9106848.196230 
-285926.125465  9106852.073708 
-285885.392160  9106854.035835 
-285814.857875  9106857.972615 
-285666.817672  9106863.828664 
-285642.921576  9106857.773643 
-285622.993617  9106850.718654 
-285607.055617  9106845.677394 
-285595.107574  9106842.649867 
-285578.153907  9106834.593750 
-285568.179024  9106829.559395 
-285557.210292  9106824.523882 
-285548.236538  9106820.495239 
-285486.632272  9106822.432758 
-285483.279902  9106771.196516 
-285436.350820  9106741.005224 
-285385.431858  9106708.800104 
-285377.871683  9106625.413111 
-285375.687767  9106598.287541 
-285310.130144  9106603.233805 
-285251.522158  9106607.183546 
-285175.996923  9106608.099736 
-285145.136770  9106601.031689 
-285131.179314  9106594.987987 
-285115.205118  9106584.923686 
-285094.196337  9106565.812450 
-285069.284783  9106556.742201 
-285054.369798  9106555.720138 
-285040.477699  9106558.717503 
-285006.715882  9106562.696082 
-285001.724862  9106559.676543 
-284962.725250  9106526.480265 
-284903.725384  9106476.182889 
-284902.412275  9106431.980746 
-284896.391151  9106423.937180 
-284874.279860  9106389.756113 
-284857.079797  9106347.544344 
-284853.945925  9106326.444902 
-284856.767867  9106304.347925 
-284846.655338  9106280.226569 
-284824.478900  9106237.004337 
-284791.181704  9106167.650389 
-284787.133822  9106157.600007 
-284769.027148  9106127.441806 
-284682.897201  9106035.924881 
-284664.863137  9106015.812298 
-284659.763481  9105997.724163 
-284663.622866  9105981.655771 
-284665.538063  9105971.612436 
-284667.446011  9105960.564532 
-284673.895525  9105890.252944 
-284675.716502  9105867.150212 
-284668.643699  9105851.068854 
-284658.545917  9105828.956542 
-284638.444590  9105797.791303 
-284598.242030  9105735.460777 
-284527.976883  9105776.564235 
-284422.114558  9105842.739247 
-284396.412403  9105861.795287 
-284337.093522  9105904.920707 
-284265.935314  9105960.086685 
-284222.423514  9105990.171572 
-284178.933363  9106023.270146 
-284107.535962  9106045.285081 
-284099.606932  9106048.289275 
-284039.163403  9106073.330930 
-284008.412133  9106081.330560 
-283893.241952  9106097.265279 
-283797.941296  9106112.219089 
-283780.073766  9106115.211265 
-283742.336546  9106119.184054 
-283492.067806  9106143.995853 
-283488.092415  9106143.991039 
-283358.957146  9106152.875588 
-283250.685357  9106160.780588 
-283101.817103  9106189.731798 
-283067.097243  9106198.730573 
-283034.365066  9106207.731751 
-282993.689267  9106217.727775 
-282960.928204  9106222.710592 
-282903.342442  9106230.676732 
-282892.460530  9106237.695407 
-282881.607452  9106248.732395 
-282873.735930  9106259.773032 
-282784.742389  9106184.321225 
-282786.614780  9106168.250392 
-282790.539738  9106161.223212 
-282780.565185  9106156.188125 
-282772.585543  9106152.160054 
-282770.583427  9106150.148457 
-282766.550368  9106142.106943 
-282758.649999  9106149.129244 
-282745.823605  9106162.172923 
-282747.948227  9106181.262375 
-282751.102739  9106205.375945 
-282741.365986  9106233.491979 
-282725.615655  9106254.568638 
-282713.833524  9106274.645595 
-282700.078084  9106296.729271 
-282687.316489  9106318.814166 
-282671.551697  9106337.881659 
-282654.785830  9106355.943348 
-282640.987112  9106371.999537 
-282637.134167  9106389.072516 
-282646.179760  9106403.147625 
-282670.089997  9106411.213556 
-282695.995162  9106420.286490 
-282715.022605  9106440.401251 
-282720.200907  9106469.540156 
-282704.457717  9106491.621407 
-282676.658471  9106495.605587 
-282653.814104  9106497.586692 
-282626.029254  9106503.580003 
-282608.161382  9106506.571769 
-282581.298329  9106502.520472 
-282552.425945  9106495.452972 
-282526.556756  9106491.402862 
-282499.679303  9106485.342351 
-282473.802916  9106480.287627 
-282459.766440  9106463.192609 
-282452.636588  9106439.074089 
-282438.607336  9106422.983640 
-282422.604777  9106408.899899 
-282399.688413  9106400.835049 
-282374.870726  9106404.822714 
-282352.040751  9106408.812821 
-282327.201454  9106409.786716 
-282305.271757  9106400.718462 
-282293.194294  9106379.607498 
-282279.165112  9106363.516981 
-282268.095926  9106344.416398 
-282253.008142  9106319.283397 
-282242.932839  9106300.184032 
-282231.849298  9106279.074267 
-282218.799641  9106260.975782 
-282198.872135  9106253.919081 
-282175.041144  9106256.903269 
-282166.211529  9106272.965506 
-282169.322593  9106291.051692 
-282183.344521  9106306.137677 
-282193.391025  9106321.218731 
-282175.623873  9106338.274473 
-282164.691422  9106338.260925 
-282157.856707  9106355.330211 
-282146.067076  9106374.402503 
-282125.282336  9106386.431623 
-282105.397932  9106385.402389 
-282101.379332  9106379.369959 
-282099.377225  9106377.358327 
-282097.375119  9106375.346695 
-282089.409850  9106373.327664 
-282087.429322  9106374.329781 
-282084.469319  9106377.339831 
-282077.634568  9106394.409113 
-282074.768066  9106410.478745 
-282073.817360  9106416.505011 
-282075.977708  9106440.617476 
-282077.129813  9106462.719540 
-282076.322969  9106488.837471 
-282072.469799  9106505.910454 
-282047.666368  9106511.907126 
-282029.798398  9106514.898673 
-282009.899545  9106511.860242 
-282003.929170  9106510.848253 
-281980.112391  9106515.841541 
-281962.244409  9106518.833062 
-281956.216508  9106509.784395 
-281936.332035  9106508.755099 
-281910.534701  9106514.750464 
-281886.804166  9106531.798717 
-281881.928299  9106544.852128 
-281876.108887  9106564.936393 
-281890.181174  9106587.054560 
-281895.315868  9106610.166178 
-281894.516126  9106637.288714 
-281892.708139  9106662.400846 
-281891.929973  9106692.537135 
-281886.160895  9106719.653492 
-281868.429426  9106741.732098 
-281849.668123  9106758.786542 
-281826.873809  9106767.799359 
-281804.093861  9106778.821335 
-281779.304592  9106786.827073 
-281755.487620  9106791.820283 
-281731.749700  9106807.863917 
-281682.056097  9106807.801951 
-281650.137218  9106791.688896 
-281629.215611  9106784.630739 
-281607.314505  9106779.580499 
-281584.455448  9106779.551935 
-281560.580967  9106776.508358 
-281538.665499  9106769.448911 
-281513.775601  9106763.390305 
-281485.932817  9106761.346297 
-281462.043977  9106756.293491 
-281441.187020  9106758.276514 
-281426.379456  9106772.322044 
-281411.593422  9106789.381331 
-281400.797232  9106808.454774 
-281386.054257  9106831.541579 
-281366.341893  9106854.622151 
-281343.497125  9106856.602647 
-281320.602105  9106851.551022 
-281300.681534  9106845.498541 
-281277.793696  9106841.451479 
-281262.986047  9106855.496973 
-281252.196953  9106875.574987 
-281231.390144  9106884.590043 
-281221.487262  9106889.600486 
-281231.569559  9106909.704736 
-281241.630336  9106926.795219 
-281246.815038  9106956.939092 
-281231.035001  9106973.997102 
-281205.179809  9106971.955446 
-281185.273536  9106967.912099 
-281174.513092  9106992.008460 
-281183.615879  9107014.120646 
-281198.681956  9107036.240323 
-281226.725912  9107066.412926 
-281197.960793  9107074.413412 
-281176.095416  9107074.385926 
-281163.268255  9107087.429323 
-281153.494492  9107110.522350 
-281148.797775  9107148.690448 
-281155.884129  9107166.781781 
-281180.724025  9107165.808425 
-281170.878496  9107178.855577 
-281151.094125  9107191.890234 
-281136.250457  9107200.912782 
-281438.148767  9107445.403718 
-281608.166309  9107593.288558 
-281720.179556  9107690.871708 
-281724.638380  9107619.552371 
-281738.669333  9107497.011567 
-281748.645655  9107363.415399 
-281758.550116  9107219.773389 
-281808.395172  9107240.931431 
-283354.863807  9107932.963540 
-283987.023492  9108216.002645 
-284325.526238  9108434.393547 
-284331.518619  9108438.418862 
-284367.581759  9108477.639276 
-284386.770512  9108519.853450 
-284430.995409  9108588.215655 
-284470.229190  9108653.558235 
-284518.451753  9108724.938666 
-284532.576904  9108754.087489 
-284555.886813  9108816.397552 
-284574.161932  9108869.660648 
-284608.883132  9108860.660297 
-284843.907101  9108787.602242 
-285415.161571  9108618.495205 
-285496.500505  9108596.488856 
-285525.279652  9108590.494705 
-285530.132592  9108574.427423 
-285534.970967  9108556.351014 
-285558.249020  9108477.018024 
-285573.692445  9108413.748882 
-285589.274209  9108369.566439 
-285598.980030  9108337.431880 
-285618.333389  9108265.126261 
-285649.314710  9108151.647318 
-285930.969928  9107794.350127 
-285940.894065  9107792.352410 
-286242.571115  9107729.410860 
-286324.894355  9107706.400061 
-286503.469190  9107662.402993 
-286543.136196  9107650.393430 
-286630.406429  9107624.374110 
-286713.679166  9107595.336476 
-286757.299553  9107580.317579 
-286507.928982  9107455.470770 
-Region 1
-79
-283358.957146  9106152.875588 
-283353.843512  9106132.778031 
-283349.774267  9106119.713713 
-283341.700758  9106102.626261 
-283323.645472  9106079.499273 
-283317.639079  9106073.464569 
-283310.595531  9106061.401197 
-283305.539681  9106049.340238 
-283302.449873  9106034.267965 
-283296.176441  9105991.063919 
-283292.071148  9105972.976704 
-283284.933808  9105947.853823 
-283262.506365  9105869.470221 
-283247.245163  9105820.227796 
-283240.136752  9105799.123203 
-283236.045948  9105783.045126 
-283230.975736  9105768.974991 
-283203.523331  9105821.179089 
-283174.903895  9105849.272114 
-283160.053960  9105857.290552 
-283146.190649  9105864.305622 
-283134.516990  9105899.451287 
-283129.742526  9105926.568820 
-283120.754644  9105920.530440 
-283081.785543  9105891.350365 
-283033.527046  9105952.570130 
-283006.909529  9105982.674678 
-282997.035957  9105991.703732 
-282982.193146  9106000.726708 
-282942.547395  9106015.746753 
-282900.899497  9106028.755177 
-282886.020605  9106032.755234 
-282873.223115  9106049.817249 
-282874.418800  9106077.946678 
-282872.582480  9106099.040402 
-282855.679820  9106098.015125 
-282832.770812  9106090.955058 
-282815.810495  9106081.893131 
-282807.809246  9106074.851325 
-282786.729411  9106045.692919 
-282782.674745  9106034.637666 
-282781.457506  9106003.494481 
-282779.253633  9105973.354655 
-282777.107413  9105951.251464 
-282774.946787  9105927.139113 
-282773.859270  9105914.078358 
-282770.805679  9105904.028900 
-282766.808678  9105901.010278 
-282760.838396  9105899.998374 
-282756.863011  9105899.993490 
-282754.918547  9105906.018527 
-282744.087102  9105920.069212 
-282745.217839  9105939.157448 
-282747.400067  9105966.283543 
-282748.602864  9105995.417576 
-282753.781063  9106024.556490 
-282758.916039  9106047.667923 
-282774.947342  9106065.769874 
-282791.986921  9106085.882194 
-282792.167091  9106110.996679 
-282775.451792  9106136.090440 
-282766.550368  9106142.106943 
-282770.583427  9106150.148457 
-282772.585543  9106152.160054 
-282780.565185  9106156.188125 
-282790.539738  9106161.223212 
-282786.614780  9106168.250392 
-282784.742389  9106184.321225 
-282873.735930  9106259.773032 
-282881.607452  9106248.732395 
-282892.460530  9106237.695407 
-282903.342442  9106230.676732 
-282960.928204  9106222.710592 
-282993.689267  9106217.727775 
-283034.365066  9106207.731751 
-283067.097243  9106198.730573 
-283101.817103  9106189.731798 
-283250.685357  9106160.780588 
-283358.957146  9106152.875588 
-Region 1
-123
-283447.272387  9105304.123410 
-283456.813751  9105248.883810 
-283443.971371  9105121.288118 
-283434.875418  9105100.181126 
-283429.805281  9105086.111005 
-283409.979291  9105093.118828 
-283357.414771  9105108.123277 
-283337.545474  9105109.103611 
-283280.846922  9105102.002433 
-283191.316063  9105089.838187 
-283145.535184  9105080.741042 
-283127.322894  9105174.143677 
-283123.441297  9105187.198325 
-283111.868586  9105236.408049 
-282968.166762  9105292.487821 
-282978.429367  9105337.706059 
-282979.452026  9105341.725594 
-282962.672170  9105357.778129 
-282942.896389  9105371.817843 
-282940.095037  9105396.928658 
-282953.144596  9105415.026930 
-282962.182792  9105428.097427 
-282942.406986  9105442.137148 
-282918.482883  9105432.062089 
-282897.619552  9105433.041046 
-282891.692567  9105438.056619 
-282890.850041  9105459.151562 
-282881.062991  9105480.235521 
-282852.335396  9105493.259651 
-282830.499804  9105497.251101 
-282812.524293  9105485.174156 
-282803.514930  9105476.121941 
-282777.581539  9105463.030619 
-282759.663672  9105458.990285 
-282750.704740  9105456.970115 
-282747.644007  9105445.916064 
-282747.593593  9105438.884004 
-282733.528654  9105417.770690 
-282722.596460  9105417.757224 
-282711.707473  9105423.771237 
-282701.769113  9105423.758991 
-282691.845154  9105425.755903 
-282674.978741  9105429.753398 
-282668.108289  9105441.799785 
-282655.253212  9105450.825078 
-282639.409419  9105458.842110 
-282617.616993  9105468.860942 
-282596.775200  9105472.853507 
-282563.035103  9105479.843851 
-282545.210797  9105488.862982 
-282527.400878  9105499.891271 
-282524.556113  9105518.974629 
-282529.683656  9105541.081555 
-282521.884089  9105562.167936 
-282506.105003  9105579.226167 
-282498.283829  9105597.298804 
-282497.441133  9105618.393783 
-282505.571807  9105643.518139 
-282516.669624  9105666.637012 
-282531.728428  9105687.751624 
-282550.705028  9105700.834487 
-282568.666196  9105710.902371 
-282576.645740  9105714.930502 
-282590.617144  9105722.984309 
-282612.568102  9105735.066234 
-282632.545785  9105749.154857 
-282650.535792  9105763.241020 
-282667.582381  9105784.358011 
-282685.608425  9105803.467054 
-282704.657144  9105826.595629 
-282718.715045  9105846.704341 
-282734.746243  9105864.806329 
-282757.755989  9105885.930595 
-282756.863011  9105899.993490 
-282760.838396  9105899.998374 
-282766.808678  9105901.010278 
-282770.805679  9105904.028900 
-282773.859270  9105914.078358 
-282774.946787  9105927.139113 
-282777.107413  9105951.251464 
-282779.253633  9105973.354655 
-282781.457506  9106003.494481 
-282782.674745  9106034.637666 
-282786.729411  9106045.692919 
-282807.809246  9106074.851325 
-282815.810495  9106081.893131 
-282832.770812  9106090.955058 
-282855.679820  9106098.015125 
-282872.582480  9106099.040402 
-282874.418800  9106077.946678 
-282873.223115  9106049.817249 
-282886.020605  9106032.755234 
-282900.899497  9106028.755177 
-282942.547395  9106015.746753 
-282982.193146  9106000.726708 
-282997.035957  9105991.703732 
-283006.909529  9105982.674678 
-283033.527046  9105952.570130 
-283081.785543  9105891.350365 
-283120.754644  9105920.530440 
-283129.742526  9105926.568820 
-283134.516990  9105899.451287 
-283146.190649  9105864.305622 
-283160.053960  9105857.290552 
-283174.903895  9105849.272114 
-283203.523331  9105821.179089 
-283230.975736  9105768.974991 
-283243.794657  9105754.926655 
-283287.184490  9105707.764804 
-283315.746043  9105671.635130 
-283330.451559  9105643.525128 
-283341.210578  9105619.428595 
-283346.071518  9105604.365993 
-283359.869763  9105588.309700 
-283379.551628  9105561.210317 
-283386.335270  9105537.108946 
-283389.251823  9105528.071386 
-283401.897426  9105489.913200 
-283421.478193  9105448.749747 
-283436.133076  9105413.607708 
-283437.047519  9105402.558579 
-283440.799113  9105371.421552 
-283447.272387  9105304.123410 
-Region 1
-59
-284396.412403  9105861.795287 
-284392.221700  9105694.028424 
-284396.090407  9105541.339596 
-284213.647954  9105461.760910 
-284141.026113  9105451.628183 
-284086.379983  9105453.571696 
-284076.441690  9105453.559756 
-284050.602128  9105453.528702 
-283987.040416  9105459.479635 
-283943.340812  9105463.445280 
-283778.596137  9105495.392649 
-283615.838751  9105527.341876 
-283503.701595  9105550.310934 
-283478.855731  9105550.280770 
-283462.939940  9105548.252306 
-283434.075425  9105542.189832 
-283412.146104  9105533.122067 
-283389.251823  9105528.071386 
-283386.335270  9105537.108946 
-283379.551628  9105561.210317 
-283359.869763  9105588.309700 
-283346.071518  9105604.365993 
-283341.210578  9105619.428595 
-283330.451559  9105643.525128 
-283315.746043  9105671.635130 
-283287.184490  9105707.764804 
-283243.794657  9105754.926655 
-283230.975736  9105768.974991 
-283236.045948  9105783.045126 
-283240.136752  9105799.123203 
-283247.245163  9105820.227796 
-283262.506365  9105869.470221 
-283284.933808  9105947.853823 
-283292.071148  9105972.976704 
-283296.176441  9105991.063919 
-283302.449873  9106034.267965 
-283305.539681  9106049.340238 
-283310.595531  9106061.401197 
-283317.639079  9106073.464569 
-283323.645472  9106079.499273 
-283341.700758  9106102.626261 
-283349.774267  9106119.713713 
-283353.843512  9106132.778031 
-283358.957146  9106152.875588 
-283488.092415  9106143.991039 
-283492.067806  9106143.995853 
-283742.336546  9106119.184054 
-283780.073766  9106115.211265 
-283797.941296  9106112.219089 
-283893.241952  9106097.265279 
-284008.412133  9106081.330560 
-284039.163403  9106073.330930 
-284099.606932  9106048.289275 
-284107.535962  9106045.285081 
-284178.933363  9106023.270146 
-284222.423514  9105990.171572 
-284265.935314  9105960.086685 
-284337.093522  9105904.920707 
-284396.412403  9105861.795287 
-Region 1
-153
-285443.486256  9105116.645893 
-285441.375203  9105099.565952 
-285438.263079  9105081.480280 
-285425.988852  9105033.247150 
-285408.687534  9104976.971649 
-285297.678123  9105018.028003 
-285015.275008  9105133.219113 
-284814.102510  9105212.341056 
-284766.558556  9105234.384951 
-284751.694719  9105240.394663 
-284730.867950  9105246.397287 
-284720.929739  9105246.385478 
-284709.997705  9105246.372487 
-284660.205227  9105232.249427 
-284413.288661  9105169.672129 
-284264.898181  9105126.298265 
-284270.694721  9105103.200265 
-284269.635794  9105094.157928 
-284272.537681  9105083.111214 
-284276.418918  9105070.056549 
-284282.323963  9105062.027126 
-284286.248601  9105054.999891 
-284289.186654  9105048.976036 
-284293.096822  9105039.939657 
-284293.982128  9105024.872274 
-284291.929384  9105015.828746 
-284289.912812  9105011.808076 
-284287.896239  9105007.787406 
-284283.877563  9105001.755209 
-284280.867174  9104997.733346 
-284273.932148  9105000.738717 
-284266.989888  9105002.739515 
-284264.015667  9105003.740510 
-284256.065120  9105003.730970 
-284252.097080  9105004.730772 
-284250.189007  9105015.778677 
-284252.234510  9105023.817637 
-284244.312892  9105027.826384 
-284236.376806  9105029.825986 
-284227.367341  9105020.774101 
-284218.350647  9105010.717642 
-284168.471696  9104984.539068 
-284153.528267  9104979.498285 
-284144.547749  9104974.464668 
-284118.592794  9104958.360424 
-284094.632720  9104943.263127 
-284077.651070  9104931.187910 
-284079.530274  9104916.121711 
-284080.451804  9104906.077180 
-284081.402249  9104900.050939 
-284078.384655  9104895.024484 
-284068.374203  9104884.966783 
-284061.330749  9104872.903526 
-284050.348172  9104865.858340 
-284029.470800  9104864.828608 
-284008.593427  9104863.798866 
-283998.662488  9104864.791451 
-283987.766637  9104869.801128 
-283972.960550  9104883.847166 
-283956.145141  9104894.877081 
-283934.295605  9104896.859829 
-283909.515185  9104905.870981 
-283897.647166  9104913.893161 
-283877.850266  9104924.919452 
-283855.035780  9104930.919260 
-283811.213848  9104917.806893 
-283803.219963  9104911.769823 
-283798.207535  9104905.736361 
-283787.203308  9104895.677380 
-283780.224913  9104892.655232 
-283771.280547  9104892.644398 
-283760.370208  9104895.644878 
-283747.450566  9104895.629223 
-283732.557728  9104897.620304 
-283722.612319  9104896.603682 
-283709.671013  9104893.574291 
-283695.699789  9104885.520816 
-283693.704931  9104884.513830 
-283688.721398  9104882.498651 
-283684.753343  9104883.498403 
-283679.791469  9104884.496949 
-283671.855358  9104886.496451 
-283660.887254  9104881.460307 
-283653.843894  9104869.396959 
-283659.698520  9104854.335570 
-283667.591312  9104846.308620 
-283670.543890  9104842.293939 
-283671.494393  9104836.267694 
-283670.435603  9104827.225311 
-283666.481990  9104830.234211 
-283652.676823  9104845.285946 
-283637.885048  9104861.341048 
-283624.087081  9104877.397355 
-283617.094257  9104872.366027 
-283584.659111  9104922.554951 
-283563.018803  9104953.670220 
-283551.186775  9104966.715206 
-283531.497986  9104992.810007 
-283510.880303  9105027.944779 
-283486.366677  9105074.125049 
-283466.533491  9105080.128318 
-283452.605519  9105078.102228 
-283429.805281  9105086.111005 
-283434.875418  9105100.181126 
-283443.971371  9105121.288118 
-283456.813751  9105248.883810 
-283447.272387  9105304.123410 
-283440.799113  9105371.421552 
-283437.047519  9105402.558579 
-283436.133076  9105413.607708 
-283421.478193  9105448.749747 
-283401.897426  9105489.913200 
-283389.251823  9105528.071386 
-283412.146104  9105533.122067 
-283434.075425  9105542.189832 
-283462.939940  9105548.252306 
-283478.855731  9105550.280770 
-283503.701595  9105550.310934 
-283615.838751  9105527.341876 
-283778.596137  9105495.392649 
-283943.340812  9105463.445280 
-283987.040416  9105459.479635 
-284050.602128  9105453.528702 
-284076.441690  9105453.559756 
-284086.379983  9105453.571696 
-284141.026113  9105451.628183 
-284213.647954  9105461.760910 
-284396.090407  9105541.339596 
-284392.221700  9105694.028424 
-284396.412403  9105861.795287 
-284422.114558  9105842.739247 
-284527.976883  9105776.564235 
-284598.242030  9105735.460777 
-284672.366413  9105678.288851 
-284689.116606  9105658.217521 
-284714.767772  9105632.129386 
-284756.218703  9105591.996134 
-284769.037004  9105577.947489 
-284810.458842  9105533.795936 
-284894.267103  9105441.475675 
-284919.968781  9105422.419454 
-284957.429542  9105380.272264 
-285015.608198  9105317.053799 
-285067.221614  9105308.073715 
-285134.685336  9105292.080354 
-285230.998770  9105280.139094 
-285248.873001  9105278.151008 
-285346.245465  9105275.251776 
-285424.880543  9105292.421505 
-285446.817161  9105302.492783 
-285448.274721  9105229.161857 
-285447.737415  9105154.824033 
-285443.486256  9105116.645893 
-Region 1
-150
-286787.386468  9106386.947715 
-286710.656845  9106358.733086 
-286714.486271  9106338.646457 
-286721.940842  9106270.345583 
-286734.145714  9106171.913639 
-286744.479648  9106089.552359 
-286754.915706  9106021.254889 
-286755.566683  9105974.041812 
-286759.359625  9105948.932400 
-286774.626208  9105861.554002 
-286783.227785  9105814.349986 
-286793.831588  9105769.157351 
-286796.740110  9105759.115173 
-286736.979543  9105740.965155 
-286647.346041  9105714.744517 
-286635.405605  9105712.721768 
-286618.488773  9105709.688776 
-286546.758707  9105685.497478 
-286525.866599  9105682.459894 
-286507.955954  9105679.425717 
-286443.219134  9105660.264999 
-286440.969208  9105624.098575 
-286429.021508  9105621.071205 
-286391.227194  9105617.009586 
-286358.401982  9105612.953648 
-286315.653129  9105610.895369 
-286299.759279  9105611.881627 
-286273.934499  9105613.860996 
-286232.237697  9105619.840266 
-286193.566021  9105631.850306 
-286133.980374  9105637.808855 
-286102.170780  9105636.767560 
-286068.344428  9105631.705697 
-286033.480597  9105620.615287 
-285989.650549  9105606.500802 
-285954.743096  9105589.382948 
-285932.798993  9105578.307417 
-285869.948204  9105545.084206 
-285849.999052  9105535.015495 
-285840.017207  9105528.976573 
-285766.169074  9105486.699409 
-285671.363624  9105432.342994 
-285617.464814  9105400.134328 
-285601.469246  9105387.056425 
-285565.517388  9105362.905079 
-285544.560015  9105350.825905 
-285533.584423  9105344.785733 
-285477.719942  9105315.588219 
-285446.817161  9105302.492783 
-285424.880543  9105292.421505 
-285346.245465  9105275.251776 
-285248.873001  9105278.151008 
-285230.998770  9105280.139094 
-285134.685336  9105292.080354 
-285067.221614  9105308.073715 
-285015.608198  9105317.053799 
-284957.429542  9105380.272264 
-284919.968781  9105422.419454 
-284894.267103  9105441.475675 
-284810.458842  9105533.795936 
-284769.037004  9105577.947489 
-284756.218703  9105591.996134 
-284714.767772  9105632.129386 
-284689.116606  9105658.217521 
-284672.366413  9105678.288851 
-284598.242030  9105735.460777 
-284638.444590  9105797.791303 
-284658.545917  9105828.956542 
-284668.643699  9105851.068854 
-284675.716502  9105867.150212 
-284673.895525  9105890.252944 
-284667.446011  9105960.564532 
-284665.538063  9105971.612436 
-284663.622866  9105981.655771 
-284659.763481  9105997.724163 
-284664.863137  9106015.812298 
-284682.897201  9106035.924881 
-284769.027148  9106127.441806 
-284787.133822  9106157.600007 
-284791.181704  9106167.650389 
-284824.478900  9106237.004337 
-284846.655338  9106280.226569 
-284856.767867  9106304.347925 
-284853.945925  9106326.444902 
-284857.079797  9106347.544344 
-284874.279860  9106389.756113 
-284896.391151  9106423.937180 
-284902.412275  9106431.980746 
-284903.725384  9106476.182889 
-284962.725250  9106526.480265 
-285001.724862  9106559.676543 
-285006.715882  9106562.696082 
-285040.477699  9106558.717503 
-285054.369798  9106555.720138 
-285069.284783  9106556.742201 
-285094.196337  9106565.812450 
-285115.205118  9106584.923686 
-285131.179314  9106594.987987 
-285145.136770  9106601.031689 
-285175.996923  9106608.099736 
-285251.522158  9106607.183546 
-285310.130144  9106603.233805 
-285375.687767  9106598.287541 
-285377.871683  9106625.413111 
-285385.431858  9106708.800104 
-285436.350820  9106741.005224 
-285483.279902  9106771.196516 
-285486.632272  9106822.432758 
-285548.236538  9106820.495239 
-285557.210292  9106824.523882 
-285568.179024  9106829.559395 
-285578.153907  9106834.593750 
-285595.107574  9106842.649867 
-285607.055617  9106845.677394 
-285622.993617  9106850.718654 
-285642.921576  9106857.773643 
-285666.817672  9106863.828664 
-285814.857875  9106857.972615 
-285885.392160  9106854.035835 
-285926.125465  9106852.073708 
-286048.339871  9106848.196230 
-286083.102748  9106845.222543 
-286113.926643  9106847.267067 
-286153.687890  9106848.317277 
-286202.422919  9106853.395950 
-286267.154277  9106871.552061 
-286315.991373  9106890.694436 
-286359.822799  9106904.808273 
-286413.600027  9106919.937967 
-286435.493878  9106923.981160 
-286461.348540  9106926.019758 
-286493.159000  9106927.060580 
-286518.977186  9106924.076352 
-286537.838424  9106921.084186 
-286560.638574  9106913.073748 
-286576.386933  9106891.996127 
-286586.215970  9106876.939066 
-286636.362210  9106802.659439 
-286677.665870  9106742.433434 
-286710.112420  9106694.251942 
-286727.833733  9106671.167444 
-286751.452392  9106639.048700 
-286770.109117  9106607.928866 
-286773.046847  9106601.904907 
-286777.964958  9106594.878648 
-286802.482502  9106549.701780 
-286826.934312  9106495.483896 
-286843.457284  9106444.270661 
-286853.169369  9106413.140673 
-286787.386468  9106386.947715 
-Region 1
-360
-286544.090328  9105043.586503 
-286505.171614  9105021.441655 
-286493.209518  9105016.405145 
-286467.334131  9105011.352624 
-286438.477327  9105006.296654 
-286437.447110  9105001.272710 
-286435.109974  9104953.051548 
-286379.992012  9104889.701274 
-286337.815489  9104829.379492 
-286309.676043  9104786.151250 
-286286.607544  9104756.992574 
-286232.440204  9104687.615788 
-286219.280714  9104654.450312 
-286210.169193  9104631.335044 
-286201.021312  9104603.196965 
-286189.885849  9104575.056578 
-286185.779727  9104556.969864 
-286167.673163  9104526.812276 
-286148.594647  9104499.667206 
-286139.425032  9104468.515412 
-286136.218209  9104437.370536 
-286147.004518  9104417.291993 
-286155.795957  9104396.206580 
-286165.515734  9104366.081267 
-286168.242590  9104330.925070 
-286169.401191  9104216.407348 
-286164.924319  9104147.087971 
-286165.569107  9104098.870161 
-286167.309481  9104064.717371 
-286187.735491  9104003.463361 
-286176.847470  9104009.478025 
-286168.933534  9104014.491592 
-286149.304988  9104048.623585 
-286138.467839  9104061.670177 
-286122.683554  9104077.724674 
-286065.283713  9104110.808143 
-286008.819425  9104135.856216 
-285953.392449  9104166.932769 
-285920.771731  9104191.004013 
-285899.068157  9104213.078880 
-285875.376977  9104235.151419 
-285871.430866  9104239.165029 
-285817.266205  9104307.411479 
-285791.710828  9104346.559254 
-285766.068251  9104373.652259 
-285738.539730  9104414.806826 
-285721.783165  9104433.873773 
-285702.052454  9104453.941790 
-285672.550759  9104497.103143 
-285633.154575  9104546.280233 
-285606.648691  9104591.454193 
-285561.108039  9104615.510146 
-285540.288998  9104622.517617 
-285525.381953  9104622.500123 
-285508.429229  9104614.443770 
-285476.504143  9104597.328810 
-285456.599056  9104593.287191 
-285439.711665  9104594.271896 
-285418.914372  9104604.293010 
-285374.367365  9104628.349969 
-285322.080262  9104681.529947 
-285309.226085  9104690.555823 
-285286.448351  9104701.579117 
-285276.611850  9104715.631332 
-285261.820818  9104731.686821 
-285217.607364  9104664.329278 
-285167.373222  9104588.928075 
-285139.147930  9104533.643984 
-285115.949726  9104486.402278 
-285096.654299  9104429.119581 
-285083.314488  9104370.839360 
-285080.115652  9104340.698799 
-285079.992440  9104323.621149 
-285086.601141  9104275.410149 
-285110.089887  9104225.210040 
-285146.396452  9104160.961292 
-285182.673933  9104092.694269 
-285200.279499  9104053.537332 
-285218.944074  9104023.422674 
-285279.834113  9103923.038897 
-285302.408495  9103883.887832 
-285326.897912  9103834.693448 
-285328.791229  9103821.636434 
-285329.553005  9103789.491481 
-285323.307542  9103750.306334 
-285318.193624  9103730.209124 
-285288.634509  9103627.709207 
-285284.557904  9103613.640564 
-285278.276302  9103569.432558 
-285278.015384  9103533.268149 
-285279.843498  9103511.170032 
-285280.786545  9103504.139242 
-285287.525574  9103474.010479 
-285301.184808  9103438.867126 
-285333.602574  9103386.668510 
-285382.653500  9103298.325496 
-285416.035872  9103242.109774 
-285428.766441  9103216.006340 
-285468.923865  9103134.684688 
-285489.524793  9103097.540428 
-285497.322698  9103076.453945 
-285359.986877  9103049.168258 
-285293.317399  9103037.034452 
-285191.808065  9103016.822631 
-284933.080524  9102968.295174 
-284919.138805  9102964.260259 
-284928.729153  9102916.052827 
-284933.509851  9102889.939973 
-284702.492808  9102825.371095 
-284699.569350  9102833.404076 
-284637.587052  9102782.096883 
-284483.643729  9102656.341002 
-284478.703803  9102660.353289 
-284426.395427  9102710.518258 
-284424.436789  9102714.534144 
-284419.540193  9102724.573860 
-284410.762435  9102747.668208 
-284395.179987  9102791.850163 
-284367.607275  9102826.976551 
-284353.745063  9102833.991733 
-284339.882845  9102841.006911 
-284321.058994  9102849.020647 
-284297.287948  9102860.042079 
-284244.820281  9102888.106332 
-284205.170498  9102902.122178 
-284144.680334  9102920.130966 
-284045.432936  9102938.092583 
-283930.270584  9102954.025481 
-283924.315150  9102955.022792 
-283911.461003  9102964.048223 
-283894.675029  9102979.096255 
-283880.870372  9102994.147918 
-283867.051279  9103007.190429 
-283851.251838  9103021.235088 
-283831.470067  9103034.270320 
-283811.681071  9103046.300970 
-283790.855015  9103052.302949 
-283791.906486  9103060.340765 
-283788.053972  9103077.413694 
-283771.397718  9103110.544057 
-283763.577290  9103128.616708 
-283756.700158  9103139.658544 
-283743.867554  9103151.697673 
-283713.269476  9103180.792733 
-283704.404762  9103191.832137 
-283692.558701  9103202.867897 
-283685.717592  9103218.932608 
-283682.808348  9103228.974723 
-283680.885675  9103238.013476 
-283686.085318  9103270.165976 
-283691.270553  9103300.309322 
-283693.330228  9103310.357507 
-283697.435161  9103328.444727 
-283693.524923  9103337.481053 
-283680.699466  9103350.524757 
-283673.793447  9103357.548289 
-283725.737099  9103394.780692 
-283715.093936  9103434.950373 
-283706.330156  9103460.053847 
-283693.692186  9103499.216529 
-283682.148957  9103552.444485 
-283670.648989  9103611.699898 
-283661.107744  9103666.939436 
-283688.905063  9103662.955084 
-283689.236857  9103709.165562 
-283685.708902  9103771.444402 
-283686.069577  9103821.673180 
-283684.204618  9103838.748542 
-283681.374719  9103859.840995 
-283674.576847  9103881.933178 
-283668.729486  9103897.999119 
-283664.833648  9103909.044605 
-283663.991338  9103930.139482 
-283677.962218  9103938.193044 
-283677.991075  9103942.211346 
-283675.081822  9103952.253468 
-283673.173581  9103963.301377 
-283672.251925  9103973.345922 
-283677.293061  9103983.397732 
-283684.307369  9103991.442811 
-283685.423817  9104008.521804 
-283685.524824  9104022.585861 
-283683.623801  9104034.638346 
-283678.726949  9104044.678049 
-283673.801236  9104050.699450 
-283669.912610  9104062.749514 
-283662.214716  9104097.899974 
-283657.476578  9104130.040340 
-283655.618840  9104148.120279 
-283650.707545  9104156.150832 
-283642.822054  9104165.182328 
-283655.820858  9104176.248395 
-283745.270342  9104177.361801 
-283755.554803  9104225.593482 
-283760.646522  9104242.677295 
-283768.762968  9104265.792177 
-283777.822702  9104281.876239 
-283777.945415  9104298.954011 
-283778.060910  9104315.027208 
-283775.194990  9104331.096785 
-283769.390961  9104353.190190 
-283760.648818  9104381.307425 
-283757.847860  9104406.418177 
-283761.024190  9104433.545318 
-283764.121118  9104449.622135 
-283761.247976  9104464.687138 
-283760.326358  9104474.731680 
-283754.464567  9104488.788490 
-283746.680125  9104511.884061 
-283741.855452  9104531.969527 
-283742.979206  9104550.053082 
-283746.105024  9104570.148198 
-283752.118428  9104577.187458 
-283816.235056  9104648.589381 
-283830.285647  9104667.693150 
-283832.316604  9104673.723003 
-283833.375414  9104682.765376 
-283832.461041  9104693.814490 
-283824.893293  9104747.047302 
-283819.060399  9104765.122420 
-283814.235761  9104785.207890 
-283811.348200  9104798.263747 
-283807.466822  9104811.318400 
-283796.542062  9104812.309735 
-283777.673989  9104814.296009 
-283753.807945  9104812.257954 
-283740.873886  9104810.233142 
-283730.906836  9104806.202792 
-283716.942861  9104799.153892 
-283710.007804  9104802.159178 
-283686.257270  9104816.194286 
-283670.435603  9104827.225311 
-283671.494393  9104836.267694 
-283670.543890  9104842.293939 
-283667.591312  9104846.308620 
-283659.698520  9104854.335570 
-283653.843894  9104869.396959 
-283660.887254  9104881.460307 
-283671.855358  9104886.496451 
-283679.791469  9104884.496949 
-283684.753343  9104883.498403 
-283688.721398  9104882.498651 
-283693.704931  9104884.513830 
-283695.699789  9104885.520816 
-283709.671013  9104893.574291 
-283722.612319  9104896.603682 
-283732.557728  9104897.620304 
-283747.450566  9104895.629223 
-283760.370208  9104895.644878 
-283771.280547  9104892.644398 
-283780.224913  9104892.655232 
-283787.203308  9104895.677380 
-283798.207535  9104905.736361 
-283803.219963  9104911.769823 
-283811.213848  9104917.806893 
-283855.035780  9104930.919260 
-283877.850266  9104924.919452 
-283897.647166  9104913.893161 
-283909.515185  9104905.870981 
-283934.295605  9104896.859829 
-283956.145141  9104894.877081 
-283972.960550  9104883.847166 
-283987.766637  9104869.801128 
-283998.662488  9104864.791451 
-284008.593427  9104863.798866 
-284029.470800  9104864.828608 
-284050.348172  9104865.858340 
-284061.330749  9104872.903526 
-284068.374203  9104884.966783 
-284078.384655  9104895.024484 
-284081.402249  9104900.050939 
-284080.451804  9104906.077180 
-284079.530274  9104916.121711 
-284077.651070  9104931.187910 
-284094.632720  9104943.263127 
-284118.592794  9104958.360424 
-284144.547749  9104974.464668 
-284153.528267  9104979.498285 
-284168.471696  9104984.539068 
-284218.350647  9105010.717642 
-284227.367341  9105020.774101 
-284236.376806  9105029.825986 
-284244.312892  9105027.826384 
-284252.234510  9105023.817637 
-284250.189007  9105015.778677 
-284252.097080  9105004.730772 
-284256.065120  9105003.730970 
-284264.015667  9105003.740510 
-284266.989888  9105002.739515 
-284273.932148  9105000.738717 
-284280.867174  9104997.733346 
-284283.877563  9105001.755209 
-284287.896239  9105007.787406 
-284289.912812  9105011.808076 
-284291.929384  9105015.828746 
-284293.982128  9105024.872274 
-284293.096822  9105039.939657 
-284289.186654  9105048.976036 
-284286.248601  9105054.999891 
-284282.323963  9105062.027126 
-284276.418918  9105070.056549 
-284272.537681  9105083.111214 
-284269.635794  9105094.157928 
-284270.694721  9105103.200265 
-284264.898181  9105126.298265 
-284413.288661  9105169.672129 
-284660.205227  9105232.249427 
-284709.997705  9105246.372487 
-284720.929739  9105246.385478 
-284730.867950  9105246.397287 
-284751.694719  9105240.394663 
-284766.558556  9105234.384951 
-284814.102510  9105212.341056 
-285015.275008  9105133.219113 
-285297.678123  9105018.028003 
-285408.687534  9104976.971649 
-285425.988852  9105033.247150 
-285438.263079  9105081.480280 
-285441.375203  9105099.565952 
-285443.486256  9105116.645893 
-285447.737415  9105154.824033 
-285448.274721  9105229.161857 
-285446.817161  9105302.492783 
-285477.719942  9105315.588219 
-285533.584423  9105344.785733 
-285544.560015  9105350.825905 
-285565.517388  9105362.905079 
-285601.469246  9105387.056425 
-285617.464814  9105400.134328 
-285671.363624  9105432.342994 
-285766.169074  9105486.699409 
-285840.017207  9105528.976573 
-285849.999052  9105535.015495 
-285869.948204  9105545.084206 
-285932.798993  9105578.307417 
-285954.743096  9105589.382948 
-285989.650549  9105606.500802 
-286033.480597  9105620.615287 
-286068.344428  9105631.705697 
-286102.170780  9105636.767560 
-286133.980374  9105637.808855 
-286193.566021  9105631.850306 
-286232.237697  9105619.840266 
-286273.934499  9105613.860996 
-286299.759279  9105611.881627 
-286315.653129  9105610.895369 
-286358.401982  9105612.953648 
-286391.227194  9105617.009586 
-286429.021508  9105621.071205 
-286440.969208  9105624.098575 
-286457.361439  9105554.803364 
-286478.562448  9105463.413555 
-286500.677089  9105360.974740 
-286502.497154  9105337.872157 
-286532.212546  9105187.223637 
-286536.129505  9105179.191728 
-286544.986371  9105167.147287 
-286592.033483  9105076.791722 
-286581.021460  9105065.729027 
-286544.090328  9105043.586503 
-Region 1
-262
-285913.629115  9101827.277387 
-285903.401655  9101787.083088 
-285889.032499  9101723.779107 
-285854.201476  9101579.081880 
-285847.027867  9101548.936712 
-285831.694207  9101489.649751 
-285823.447182  9101448.453180 
-285819.044646  9101389.179141 
-285816.738304  9101344.975927 
-285811.044983  9101244.513534 
-285806.620811  9101182.225784 
-285805.496659  9101164.142433 
-285804.437721  9101155.100168 
-285797.989926  9101087.787227 
-285795.727164  9101049.611389 
-285791.245144  9100979.287100 
-285783.919643  9100928.046007 
-285769.616414  9100873.782947 
-285736.345695  9100807.442634 
-285716.275822  9100780.295715 
-285666.148316  9100718.958033 
-285653.106935  9100701.865015 
-285599.955041  9100634.496261 
-285558.829189  9100581.205586 
-285528.735580  9100541.991855 
-285474.575907  9100472.612535 
-285443.373008  9100417.324439 
-285428.199733  9100380.137579 
-285416.885605  9100326.882390 
-285414.847562  9100319.848033 
-285410.540054  9100273.633150 
-285408.982275  9100195.275671 
-285410.289950  9100100.848680 
-285412.743210  9100027.518806 
-285412.641983  9100013.454856 
-285413.433231  9099985.328148 
-285395.409251  9099966.219872 
-285361.276449  9099917.959995 
-285340.307565  9099903.870941 
-285308.509189  9099903.832676 
-285064.087877  9099907.556037 
-285040.210171  9099903.508913 
-285020.300049  9099898.462016 
-284994.463828  9099898.430741 
-284961.751112  9099909.441300 
-284939.076463  9099934.527869 
-284930.320846  9099960.635865 
-284896.498860  9099955.572053 
-284866.694995  9099956.540463 
-284833.982185  9099967.550945 
-284881.980709  9099871.171230 
-284897.641728  9099838.039684 
-284865.843322  9099838.001093 
-284840.957514  9099831.943500 
-284797.126464  9099816.821804 
-284767.236094  9099805.735267 
-284754.274705  9099799.692123 
-284734.371848  9099795.649651 
-284704.604125  9099801.640787 
-284680.877935  9099818.689462 
-284634.549018  9099870.870297 
-284576.410930  9099939.109723 
-284541.905288  9099977.241043 
-284527.071816  9099987.268575 
-284512.195074  9099991.268668 
-284500.277817  9099992.258678 
-284485.314555  9099984.203887 
-284465.375562  9099975.138443 
-284436.486018  9099965.057480 
-284398.494574  9099932.864933 
-284377.576323  9099925.807371 
-284360.697753  9099927.795831 
-284391.128727  9100014.225657 
-284401.282030  9100044.375019 
-284385.721476  9100091.570522 
-284368.360883  9100164.882506 
-284353.981398  9100238.198142 
-284347.270485  9100272.345136 
-284329.981910  9100355.702868 
-284349.071539  9100384.858593 
-284364.200751  9100416.018592 
-284381.245323  9100437.135275 
-284439.183723  9100479.397714 
-284556.076190  9100566.937214 
-284700.944810  9100675.606064 
-284715.922793  9100685.669859 
-284724.916805  9100692.712704 
-284804.984848  9100772.170129 
-284853.022922  9100819.442653 
-284892.030906  9100854.649454 
-284904.150627  9100881.787254 
-284909.343195  9100912.934931 
-284907.456888  9100926.996514 
-284906.520959  9100935.031876 
-284892.905009  9100976.202461 
-284867.479909  9101033.431773 
-284814.685441  9101153.915419 
-284811.834276  9101171.994089 
-284810.092421  9101206.147089 
-284799.305852  9101226.225297 
-284777.660455  9101256.336004 
-284771.799187  9101270.392790 
-284775.925810  9101291.493580 
-284785.086123  9101321.641506 
-284788.240701  9101345.754803 
-284785.331739  9101355.796909 
-284781.472386  9101371.865240 
-284770.714676  9101395.961735 
-284744.172758  9101436.112156 
-284727.445374  9101459.196875 
-284710.078176  9101531.504370 
-284703.122005  9101531.495963 
-284698.073856  9101520.439676 
-284694.984295  9101505.367506 
-284693.853323  9101486.279454 
-284688.740181  9101466.182023 
-284649.829975  9101306.409490 
-284643.730379  9101287.315411 
-284617.409577  9101219.977809 
-284591.045564  9101146.612739 
-284520.199861  9100967.714431 
-284504.998117  9100926.508839 
-284401.859719  9100955.515640 
-284366.711423  9100904.240017 
-284342.602368  9100868.046287 
-284315.533812  9100834.862614 
-284291.590671  9100821.774031 
-284287.615769  9100821.769175 
-284271.716164  9100821.749748 
-284231.081550  9100836.768550 
-284206.353731  9100852.811349 
-284190.511771  9100860.828490 
-284182.569165  9100861.823335 
-284166.655122  9100859.794726 
-284164.710913  9100865.819739 
-284149.977978  9100889.911275 
-284140.213671  9100914.008893 
-284126.481648  9100939.106219 
-284114.686624  9100957.173956 
-284099.910401  9100975.238040 
-284087.136041  9100995.313707 
-284074.361670  9101015.389372 
-284062.566609  9101033.457105 
-284046.803818  9101052.524539 
-284034.987120  9101067.578544 
-284022.234326  9101090.667929 
-284008.430146  9101105.719495 
-283995.648510  9101124.790577 
-283987.813920  9101140.854028 
-283984.875947  9101146.877822 
-283979.115279  9101174.998614 
-283976.299789  9101198.100187 
-283976.487122  9101224.219143 
-283978.683549  9101253.354261 
-283980.843954  9101277.466502 
-283982.910691  9101288.519265 
-283984.991841  9101301.581179 
-283988.153203  9101326.699210 
-283994.288582  9101350.816319 
-283998.342807  9101361.871515 
-284003.397981  9101373.932503 
-284015.459782  9101393.034033 
-284023.553843  9101413.135266 
-284034.650757  9101436.253869 
-284053.726444  9101463.400493 
-284058.788858  9101476.466042 
-284070.865136  9101497.576693 
-284081.926057  9101515.672400 
-284091.006714  9101534.770248 
-284103.090237  9101556.885457 
-284104.120030  9101561.909543 
-284110.183429  9101575.980868 
-284119.278536  9101597.087852 
-284125.392422  9101618.191191 
-284128.496239  9101635.272592 
-284129.648627  9101657.374437 
-284131.787552  9101678.472920 
-284129.886597  9101690.525384 
-284128.936119  9101696.551616 
-284123.117871  9101716.635821 
-284115.297704  9101734.708452 
-284105.518882  9101756.796955 
-284095.747264  9101779.890031 
-284089.943420  9101801.983386 
-284085.126111  9101823.073381 
-284079.300628  9101842.153014 
-284068.520816  9101863.235729 
-284061.715996  9101884.323298 
-284057.906846  9101907.423656 
-284050.129901  9101931.523736 
-284043.346702  9101955.625029 
-284043.548609  9101983.753114 
-284045.745239  9102012.888200 
-284059.866920  9102042.037837 
-284073.952562  9102066.164594 
-284085.013683  9102084.260262 
-284101.065226  9102105.375704 
-284117.123999  9102127.495711 
-284128.170728  9102143.582212 
-284141.226620  9102162.684850 
-284147.290157  9102176.756144 
-284151.315684  9102183.793000 
-284162.384087  9102202.893207 
-284176.491495  9102230.033625 
-284182.562273  9102245.109483 
-284183.714778  9102267.211310 
-284181.871579  9102287.300364 
-284178.055295  9102309.396148 
-284173.245250  9102331.490724 
-284171.301027  9102337.515748 
-284166.454899  9102354.587457 
-284164.561186  9102367.644497 
-284148.899140  9102400.776089 
-284108.019781  9102520.269596 
-284090.543304  9102577.508545 
-284122.013946  9102669.966798 
-284159.642267  9102789.555718 
-284181.996091  9102857.893238 
-284193.079183  9102879.002535 
-284205.170498  9102902.122178 
-284244.820281  9102888.106332 
-284297.287948  9102860.042079 
-284321.058994  9102849.020647 
-284339.882845  9102841.006911 
-284353.745063  9102833.991733 
-284367.607275  9102826.976551 
-284395.179987  9102791.850163 
-284410.762435  9102747.668208 
-284419.540193  9102724.573860 
-284424.436789  9102714.534144 
-284426.395427  9102710.518258 
-284478.703803  9102660.353289 
-284483.643729  9102656.341002 
-284637.587052  9102782.096883 
-284699.569350  9102833.404076 
-284702.492808  9102825.371095 
-284933.509851  9102889.939973 
-284928.729153  9102916.052827 
-284919.138805  9102964.260259 
-284933.080524  9102968.295174 
-285191.808065  9103016.822631 
-285293.317399  9103037.034452 
-285359.986877  9103049.168258 
-285497.322698  9103076.453945 
-285541.266479  9102969.018275 
-285572.472436  9102886.681479 
-285590.026656  9102840.492603 
-285596.859736  9102823.423209 
-285646.584438  9102690.880456 
-285652.438228  9102675.819020 
-285704.121201  9102539.260361 
-285728.471972  9102470.979275 
-285737.241717  9102446.880275 
-285770.398397  9102359.523017 
-285817.315173  9102251.086320 
-285837.792253  9102196.864455 
-285895.429628  9102059.308285 
-285903.067699  9102016.121397 
-285917.495142  9101949.837737 
-285919.178007  9101907.648386 
-285919.018449  9101885.547974 
-285913.629115  9101827.277387 
-Region 1
-156
-288609.815460  9099397.376816 
-288485.043414  9099456.503396 
-288374.138650  9099509.618211 
-288286.015193  9099552.713318 
-288232.444195  9099564.706810 
-288082.464618  9099573.576494 
-287759.686707  9099596.310879 
-287633.554880  9099605.206528 
-287624.604479  9099604.191658 
-287528.173809  9099598.053043 
-287461.495352  9099583.912263 
-287438.604326  9099578.863026 
-287411.731306  9099572.804615 
-287381.891792  9099568.751846 
-287355.047865  9099566.711627 
-287331.170437  9099562.665735 
-287304.304697  9099557.611812 
-287274.450647  9099551.549850 
-287250.573224  9099547.503911 
-287226.695803  9099543.457959 
-287204.791210  9099537.405188 
-287199.815536  9099536.394850 
-287181.922009  9099535.369482 
-287160.046488  9099533.334920 
-287140.151063  9099530.298103 
-287116.280914  9099527.256646 
-287089.415189  9099522.202582 
-287064.558625  9099520.164496 
-287039.716587  9099520.135513 
-287012.908975  9099523.117875 
-286990.105135  9099530.123102 
-286964.349290  9099541.143074 
-286946.550153  9099553.176886 
-286919.815120  9099566.204796 
-286902.052266  9099583.261396 
-286876.448842  9099615.377090 
-286864.626280  9099629.426977 
-286819.301553  9099682.615159 
-286788.736842  9099715.729572 
-286764.097918  9099743.828158 
-286742.381959  9099763.893747 
-286729.551112  9099775.933331 
-286716.727517  9099788.977473 
-286701.046236  9099819.095652 
-286667.558339  9099860.243015 
-286634.998759  9099892.350482 
-286613.333470  9099919.447967 
-286594.627466  9099943.535265 
-286574.913236  9099965.612269 
-286563.119519  9099983.680365 
-286549.425475  9100013.800863 
-286539.749737  9100049.953404 
-286532.989776  9100077.068394 
-286493.292692  9100084.053592 
-286441.591423  9100079.974536 
-286392.842230  9100071.880682 
-286382.890752  9100069.859845 
-286299.376655  9100063.733998 
-286092.542518  9100043.398208 
-286081.604591  9100042.380685 
-286046.803412  9100039.325742 
-285879.760628  9100025.063448 
-285869.816397  9100024.047054 
-285758.471406  9100016.882458 
-285657.063382  9100009.729455 
-285639.075486  9099995.644138 
-285478.045455  9099988.419373 
-285413.433231  9099985.328148 
-285412.641983  9100013.454856 
-285412.743210  9100027.518806 
-285410.289950  9100100.848680 
-285408.982275  9100195.275671 
-285410.540054  9100273.633150 
-285414.847562  9100319.848033 
-285416.885605  9100326.882390 
-285428.199733  9100380.137579 
-285443.373008  9100417.324439 
-285474.575907  9100472.612535 
-285528.735580  9100541.991855 
-285558.829189  9100581.205586 
-285599.955041  9100634.496261 
-285653.106935  9100701.865015 
-285666.148316  9100718.958033 
-285705.679704  9100688.868392 
-285717.705658  9100702.946510 
-285773.889652  9100777.350563 
-285883.641491  9100701.134600 
-285926.161059  9100672.052905 
-285931.100641  9100668.040537 
-285934.089026  9100669.048636 
-286112.398584  9100729.532996 
-286131.337144  9100737.591804 
-286167.509674  9100792.885018 
-286189.610725  9100826.061391 
-286208.694400  9100854.211415 
-286251.300850  9100837.184182 
-286276.063925  9100826.163241 
-286295.822139  9100810.113628 
-286305.708496  9100803.093383 
-286332.517006  9100800.111256 
-286349.410140  9100800.131119 
-286410.113758  9100812.257084 
-286419.078954  9100815.281270 
-286469.845453  9100827.395479 
-286605.186542  9100854.676915 
-286608.022441  9100834.589183 
-286615.674400  9100793.411484 
-286697.238682  9100804.556887 
-286709.851848  9100762.380434 
-286828.270550  9100785.623240 
-286839.795405  9100730.386347 
-286841.753757  9100726.370424 
-286858.348873  9100685.203156 
-286865.028692  9100647.037994 
-286864.745293  9100607.860168 
-286862.605285  9100586.762100 
-286873.861255  9100494.356509 
-286873.548819  9100451.160444 
-286871.132742  9100391.889106 
-286875.883287  9100361.758109 
-286880.750077  9100347.700067 
-286918.467107  9100341.716728 
-286931.341615  9100335.704423 
-286968.964144  9100316.661776 
-286979.829433  9100307.633469 
-286996.569701  9100286.557390 
-287008.334194  9100264.470969 
-287018.140353  9100246.400470 
-287031.797738  9100211.257094 
-287048.501610  9100185.158215 
-287079.131740  9100161.084629 
-287144.446644  9100123.992174 
-287224.615921  9100079.885034 
-287281.001868  9100044.791174 
-287307.715178  9100028.749335 
-287340.390611  9100012.714387 
-287361.236297  9100009.724867 
-287477.189295  9099830.044759 
-287568.619613  9099694.536358 
-287711.666175  9099688.673945 
-287927.236708  9099680.885174 
-287984.862878  9099679.946642 
-288013.745183  9099689.020609 
-288070.538000  9099710.181005 
-288163.263749  9099753.482298 
-288200.124728  9099766.583402 
-288217.039178  9099769.616307 
-288277.135876  9099698.362102 
-288354.139488  9099629.136170 
-288406.549019  9099594.036703 
-288471.941903  9099567.992814 
-288517.563376  9099555.990037 
-288591.979460  9099541.006197 
-288634.780431  9099551.100050 
-288622.221263  9099463.690660 
-288609.815460  9099397.376816 
-Region 1
-274
-288986.709479  9101621.853507 
-288981.631093  9101606.779766 
-288963.925484  9101495.256167 
-288930.772869  9101309.379367 
-288921.449008  9101257.132890 
-288891.343931  9101080.300223 
-288871.688226  9100973.796982 
-288861.297762  9100911.503855 
-288858.185020  9100893.418644 
-288853.968890  9100860.264089 
-288824.909594  9100690.464177 
-288821.767660  9100668.360759 
-288791.568906  9100478.468654 
-288748.036145  9100231.302602 
-288702.414563  9099970.070428 
-288657.882476  9099721.898330 
-288634.780431  9099551.100050 
-288591.979460  9099541.006197 
-288517.563376  9099555.990037 
-288471.941903  9099567.992814 
-288406.549019  9099594.036703 
-288354.139488  9099629.136170 
-288277.135876  9099698.362102 
-288217.039178  9099769.616307 
-288200.124728  9099766.583402 
-288163.263749  9099753.482298 
-288070.538000  9099710.181005 
-288013.745183  9099689.020609 
-287984.862878  9099679.946642 
-287927.236708  9099680.885174 
-287711.666175  9099688.673945 
-287568.619613  9099694.536358 
-287477.189295  9099830.044759 
-287361.236297  9100009.724867 
-287340.390611  9100012.714387 
-287307.715178  9100028.749335 
-287281.001868  9100044.791174 
-287224.615921  9100079.885034 
-287144.446644  9100123.992174 
-287079.131740  9100161.084629 
-287048.501610  9100185.158215 
-287031.797738  9100211.257094 
-287018.140353  9100246.400470 
-287008.334194  9100264.470969 
-286996.569701  9100286.557390 
-286979.829433  9100307.633469 
-286968.964144  9100316.661776 
-286931.341615  9100335.704423 
-286918.467107  9100341.716728 
-286880.750077  9100347.700067 
-286875.883287  9100361.758109 
-286871.132742  9100391.889106 
-286873.548819  9100451.160444 
-286873.861255  9100494.356509 
-286862.605285  9100586.762100 
-286864.745293  9100607.860168 
-286865.028692  9100647.037994 
-286858.348873  9100685.203156 
-286841.753757  9100726.370424 
-286839.795405  9100730.386347 
-286828.270550  9100785.623240 
-286709.851848  9100762.380434 
-286697.238682  9100804.556887 
-286615.674400  9100793.411484 
-286608.022441  9100834.589183 
-286605.186542  9100854.676915 
-286469.845453  9100827.395479 
-286419.078954  9100815.281270 
-286410.113758  9100812.257084 
-286349.410140  9100800.131119 
-286332.517006  9100800.111256 
-286305.708496  9100803.093383 
-286295.822139  9100810.113628 
-286276.063925  9100826.163241 
-286251.300850  9100837.184182 
-286208.694400  9100854.211415 
-286189.610725  9100826.061391 
-286167.509674  9100792.885018 
-286131.337144  9100737.591804 
-286112.398584  9100729.532996 
-285934.089026  9100669.048636 
-285931.100641  9100668.040537 
-285926.161059  9100672.052905 
-285883.641491  9100701.134600 
-285773.889652  9100777.350563 
-285717.705658  9100702.946510 
-285705.679704  9100688.868392 
-285666.148316  9100718.958033 
-285716.275822  9100780.295715 
-285736.345695  9100807.442634 
-285769.616414  9100873.782947 
-285783.919643  9100928.046007 
-285791.245144  9100979.287100 
-285795.727164  9101049.611389 
-285797.989926  9101087.787227 
-285804.437721  9101155.100168 
-285805.496659  9101164.142433 
-285806.620811  9101182.225784 
-285811.044983  9101244.513534 
-285816.738304  9101344.975927 
-285819.044646  9101389.179141 
-285823.447182  9101448.453180 
-285831.694207  9101489.649751 
-285847.027867  9101548.936712 
-285854.201476  9101579.081880 
-285889.032499  9101723.779107 
-285903.401655  9101787.083088 
-285913.629115  9101827.277387 
-285919.018449  9101885.547974 
-285919.178007  9101907.648386 
-285917.495142  9101949.837737 
-285903.067699  9102016.121397 
-285895.429628  9102059.308285 
-285837.792253  9102196.864455 
-285817.315173  9102251.086320 
-285770.398397  9102359.523017 
-285737.241717  9102446.880275 
-285728.471972  9102470.979275 
-285704.121201  9102539.260361 
-285652.438228  9102675.819020 
-285646.584438  9102690.880456 
-285596.859736  9102823.423209 
-285590.026656  9102840.492603 
-285572.472436  9102886.681479 
-285541.266479  9102969.018275 
-285497.322698  9103076.453945 
-285489.524793  9103097.540428 
-285468.923865  9103134.684688 
-285428.766441  9103216.006340 
-285416.035872  9103242.109774 
-285382.653500  9103298.325496 
-285333.602574  9103386.668510 
-285301.184808  9103438.867126 
-285287.525574  9103474.010479 
-285280.786545  9103504.139242 
-285279.843498  9103511.170032 
-285278.015384  9103533.268149 
-285278.276302  9103569.432558 
-285284.557904  9103613.640564 
-285288.634509  9103627.709207 
-285318.193624  9103730.209124 
-285323.307542  9103750.306334 
-285329.553005  9103789.491481 
-285328.791229  9103821.636434 
-285326.897912  9103834.693448 
-285302.408495  9103883.887832 
-285279.834113  9103923.038897 
-285218.944074  9104023.422674 
-285200.279499  9104053.537332 
-285182.673933  9104092.694269 
-285146.396452  9104160.961292 
-285110.089887  9104225.210040 
-285086.601141  9104275.410149 
-285079.992440  9104323.621149 
-285080.115652  9104340.698799 
-285083.314488  9104370.839360 
-285096.654299  9104429.119581 
-285115.949726  9104486.402278 
-285139.147930  9104533.643984 
-285167.373222  9104588.928075 
-285217.607364  9104664.329278 
-285261.820818  9104731.686821 
-285276.611850  9104715.631332 
-285286.448351  9104701.579117 
-285309.226085  9104690.555823 
-285322.080262  9104681.529947 
-285374.367365  9104628.349969 
-285418.914372  9104604.293010 
-285439.711665  9104594.271896 
-285456.599056  9104593.287191 
-285476.504143  9104597.328810 
-285508.429229  9104614.443770 
-285525.381953  9104622.500123 
-285540.288998  9104622.517617 
-285561.108039  9104615.510146 
-285606.648691  9104591.454193 
-285633.154575  9104546.280233 
-285672.550759  9104497.103143 
-285702.052454  9104453.941790 
-285721.783165  9104433.873773 
-285738.539730  9104414.806826 
-285766.068251  9104373.652259 
-285791.710828  9104346.559254 
-285817.266205  9104307.411479 
-285871.430866  9104239.165029 
-285875.376977  9104235.151419 
-285899.068157  9104213.078880 
-285920.771731  9104191.004013 
-285953.392449  9104166.932769 
-286008.819425  9104135.856216 
-286065.283713  9104110.808143 
-286122.683554  9104077.724674 
-286138.467839  9104061.670177 
-286149.304988  9104048.623585 
-286168.933534  9104014.491592 
-286176.847470  9104009.478025 
-286187.735491  9104003.463361 
-286190.709578  9104002.462264 
-286205.587279  9103998.461339 
-286224.367404  9103984.419412 
-286233.144226  9103961.324886 
-286241.935584  9103940.239483 
-286295.822825  9103833.819443 
-286312.440758  9103795.665727 
-286340.802209  9103732.411823 
-286383.120119  9103675.201418 
-286409.843003  9103660.164115 
-286423.719510  9103655.157436 
-286462.462252  9103653.193210 
-286494.277649  9103655.239143 
-286543.981017  9103657.305736 
-286608.525512  9103650.348451 
-286681.056565  9103648.423042 
-286695.941353  9103645.426551 
-286707.852094  9103643.431179 
-286728.684964  9103638.432432 
-286765.432784  9103635.461102 
-286801.230510  9103638.515951 
-286839.965859  9103635.546848 
-286912.511357  9103635.630188 
-286934.396234  9103638.668954 
-286953.321648  9103644.717963 
-286973.262698  9103653.781775 
-287005.158189  9103666.877470 
-287043.067354  9103687.011865 
-287073.011774  9103705.128012 
-287106.975053  9103729.276018 
-287126.967190  9103745.371641 
-287172.899576  9103775.560544 
-287189.895844  9103789.643613 
-287204.889986  9103801.715294 
-287215.865275  9103807.755098 
-287232.817810  9103815.810808 
-287249.784936  9103825.875622 
-287281.695183  9103840.980183 
-287340.641691  9103884.242793 
-287361.532896  9103887.280185 
-287399.311010  9103889.332203 
-287422.138685  9103885.339937 
-287449.964427  9103885.371519 
-287583.937314  9103449.550384 
-287619.340618  9103398.358677 
-287635.329508  9103273.813112 
-287656.046333  9103116.122905 
-287657.010898  9103112.105816 
-287676.682869  9102947.382618 
-287691.714476  9102827.858726 
-287700.286058  9102776.636620 
-287704.034836  9102745.499956 
-287710.764861  9102714.366677 
-287718.517820  9102687.252743 
-287732.240557  9102661.150130 
-287751.911168  9102633.045173 
-287791.354501  9102590.899002 
-287817.981264  9102562.801920 
-287877.102254  9102493.555291 
-287917.517193  9102448.396528 
-288030.862742  9102319.943016 
-288124.515553  9102216.580738 
-288176.708726  9102151.344275 
-288228.930977  9102090.125992 
-288272.289881  9102039.947673 
-288287.100863  9102026.905290 
-288309.854371  9102012.867299 
-288455.304015  9101926.640120 
-288476.077262  9101913.604388 
-288479.043824  9101911.598633 
-288521.445094  9101866.441809 
-288558.848410  9101817.261197 
-288620.049822  9101761.075435 
-288659.586656  9101731.987995 
-288733.910994  9101703.943960 
-288804.304230  9101681.922679 
-288986.709479  9101621.853507 
-Region 1
-81
-288851.902593  9103304.307533 
-288848.635605  9103265.126880 
-288854.642094  9103271.160763 
-288857.432879  9103245.045827 
-288851.563050  9103121.480974 
-288851.533749  9103117.462784 
-288835.658341  9102848.228573 
-288834.400957  9102812.063748 
-288823.956163  9102606.121492 
-288818.130865  9102488.583848 
-288814.981270  9102465.475928 
-288810.947754  9102457.435123 
-288802.895368  9102443.362609 
-288744.892650  9102393.071050 
-288665.882592  9102323.669677 
-288648.879347  9102308.582588 
-288578.871698  9102247.227370 
-288505.875723  9102184.864106 
-288351.868741  9102051.087180 
-288341.865661  9102042.035049 
-288309.854371  9102012.867299 
-288287.100863  9102026.905290 
-288272.289881  9102039.947673 
-288228.930977  9102090.125992 
-288176.708726  9102151.344275 
-288124.515553  9102216.580738 
-288030.862742  9102319.943016 
-287917.517193  9102448.396528 
-287877.102254  9102493.555291 
-287817.981264  9102562.801920 
-287791.354501  9102590.899002 
-287751.911168  9102633.045173 
-287732.240557  9102661.150130 
-287718.517820  9102687.252743 
-287710.764861  9102714.366677 
-287704.034836  9102745.499956 
-287700.286058  9102776.636620 
-287691.714476  9102827.858726 
-287676.682869  9102947.382618 
-287657.010898  9103112.105816 
-287656.046333  9103116.122905 
-287635.329508  9103273.813112 
-287619.340618  9103398.358677 
-287583.937314  9103449.550384 
-287449.964427  9103885.371519 
-287491.703033  9103885.418859 
-287550.335821  9103885.485295 
-287585.117974  9103885.524670 
-287637.773475  9103883.575136 
-287655.610312  9103876.563478 
-287715.229508  9103875.626271 
-287782.937685  9103893.784455 
-287824.902734  9103924.972620 
-287834.898944  9103933.020232 
-287880.992640  9103985.308404 
-287922.146799  9104041.609129 
-287956.359243  9104099.911088 
-288042.232956  9104019.643908 
-288098.556406  9103975.507101 
-288124.167829  9103944.394939 
-288134.887244  9103915.275191 
-288133.798393  9103902.214914 
-288131.123396  9103807.784879 
-288147.666467  9103759.585342 
-288183.105747  9103713.416045 
-288208.724308  9103683.308431 
-288211.676355  9103679.293563 
-288246.326559  9103661.250551 
-288294.969937  9103654.273116 
-288564.368420  9103666.627722 
-288645.886483  9103670.736372 
-288681.603436  9103662.739650 
-288690.503372  9103656.722273 
-288734.016576  9103627.638816 
-288775.424972  9103582.480365 
-288827.596141  9103514.229389 
-288842.282738  9103484.109447 
-288851.094688  9103466.037481 
-288857.875151  9103441.936033 
-288857.391566  9103375.635902 
-288851.902593  9103304.307533 
-Region 1
-235
-290515.118603  9102855.082557 
-290484.997347  9102812.859963 
-290441.214057  9102804.776733 
-290413.227542  9102782.646987 
-290399.131283  9102757.518553 
-290359.823818  9102682.136408 
-290296.402148  9102570.565054 
-290257.227435  9102513.264461 
-290216.109484  9102461.988904 
-290140.999030  9102382.549584 
-290132.975700  9102372.495567 
-290048.775054  9102272.955501 
-289984.669665  9102203.573053 
-289937.729530  9102171.376914 
-289829.996035  9102115.005610 
-289799.073118  9102098.899309 
-289760.156387  9102076.757037 
-289712.156742  9102035.518614 
-289672.070279  9101989.266106 
-289633.919991  9101935.983912 
-289619.831829  9101911.859603 
-289595.476406  9101842.519894 
-289574.465258  9101686.793701 
-289562.903745  9101600.390864 
-289531.064837  9101458.716179 
-289500.920469  9101276.861807 
-289496.784393  9101254.757434 
-289491.478722  9101208.542881 
-289489.352062  9101189.454332 
-289489.322747  9101185.436151 
-289457.206246  9101005.588542 
-289453.055595  9100981.475060 
-289432.280475  9100857.893990 
-289414.618481  9100752.398000 
-289404.139528  9100678.050608 
-289270.830634  9100656.807416 
-289275.317893  9100727.130086 
-289199.679822  9100710.973408 
-289223.376689  9100826.521698 
-289176.753342  9100837.519797 
-289127.126906  9100845.500892 
-289106.332386  9100855.523131 
-289082.564072  9100866.546588 
-289052.914025  9100888.613414 
-289051.065651  9100907.697604 
-289021.481413  9100938.805348 
-288871.688226  9100973.796982 
-288891.343931  9101080.300223 
-288921.449008  9101257.132890 
-288930.772869  9101309.379367 
-288963.925484  9101495.256167 
-288981.631093  9101606.779766 
-288986.709479  9101621.853507 
-288804.304230  9101681.922679 
-288733.910994  9101703.943960 
-288659.586656  9101731.987995 
-288620.049822  9101761.075435 
-288558.848410  9101817.261197 
-288521.445094  9101866.441809 
-288479.043824  9101911.598633 
-288476.077262  9101913.604388 
-288455.304015  9101926.640120 
-288309.854371  9102012.867299 
-288341.865661  9102042.035049 
-288351.868741  9102051.087180 
-288505.875723  9102184.864106 
-288578.871698  9102247.227370 
-288648.879347  9102308.582588 
-288665.882592  9102323.669677 
-288744.892650  9102393.071050 
-288802.895368  9102443.362609 
-288810.947754  9102457.435123 
-288814.981270  9102465.475928 
-288818.130865  9102488.583848 
-288823.956163  9102606.121492 
-288834.400957  9102812.063748 
-288835.658341  9102848.228573 
-288851.533749  9103117.462784 
-288851.563050  9103121.480974 
-288857.432879  9103245.045827 
-288854.642094  9103271.160763 
-288848.635605  9103265.126880 
-288851.902593  9103304.307533 
-288857.391566  9103375.635902 
-288857.875151  9103441.936033 
-288851.094688  9103466.037481 
-288842.282738  9103484.109447 
-288827.596141  9103514.229389 
-288775.424972  9103582.480365 
-288734.016576  9103627.638816 
-288690.503372  9103656.722273 
-288681.603436  9103662.739650 
-288645.886483  9103670.736372 
-288564.368420  9103666.627722 
-288294.969937  9103654.273116 
-288246.326559  9103661.250551 
-288211.676355  9103679.293563 
-288208.724308  9103683.308431 
-288183.105747  9103713.416045 
-288147.666467  9103759.585342 
-288131.123396  9103807.784879 
-288133.798393  9103902.214914 
-288134.887244  9103915.275191 
-288124.167829  9103944.394939 
-288098.556406  9103975.507101 
-288042.232956  9104019.643908 
-287956.359243  9104099.911088 
-287976.498020  9104136.097257 
-288042.080948  9104271.784112 
-288091.610172  9104386.357428 
-288117.704622  9104421.545585 
-288148.665604  9104442.675551 
-288160.649563  9104450.725266 
-288212.487394  9104472.883008 
-288277.207878  9104490.032310 
-288316.133892  9104513.180078 
-288342.162687  9104539.327096 
-288355.264963  9104564.455192 
-288355.286930  9104567.468841 
-288364.465335  9104599.624362 
-288374.747394  9104646.849222 
-288378.986190  9104683.017414 
-288383.217677  9104718.181054 
-288383.994033  9104824.663286 
-288401.196148  9104866.873085 
-288411.302562  9104889.988729 
-288430.506982  9104934.209802 
-288430.594896  9104946.264391 
-288433.073353  9105013.571374 
-288427.564827  9105075.846811 
-288429.108154  9105151.189082 
-288439.383218  9105197.409322 
-288450.520207  9105225.548774 
-288494.738505  9105292.901835 
-288538.949620  9105359.250272 
-288568.866360  9105373.346808 
-288591.716507  9105372.367441 
-288629.554361  9105382.454495 
-288664.315474  9105379.479117 
-288687.165610  9105378.499701 
-288712.084032  9105388.572477 
-288720.056462  9105391.594853 
-288742.943274  9105395.638142 
-288780.663768  9105389.652306 
-288791.588261  9105388.659751 
-288815.461535  9105391.699546 
-288832.385529  9105395.736251 
-288847.292568  9105395.752585 
-288862.199605  9105395.768914 
-288877.158012  9105402.817063 
-288900.994592  9105400.834077 
-288934.798549  9105402.880134 
-288959.768393  9105419.984578 
-288983.641674  9105423.024276 
-289015.480058  9105428.081733 
-289047.347815  9105437.157347 
-289066.259432  9105441.196122 
-289087.217404  9105453.273418 
-289105.201322  9105466.351998 
-289125.246303  9105489.478182 
-289141.294055  9105509.586392 
-289157.400588  9105537.730950 
-289168.494045  9105559.842826 
-289170.511038  9105563.863166 
-289183.599467  9105586.981741 
-289198.719604  9105616.129735 
-289207.781411  9105632.212165 
-289215.842071  9105647.288967 
-289231.934019  9105673.424386 
-289249.027143  9105700.565417 
-289254.062318  9105709.611706 
-289259.082798  9105716.648906 
-289263.109471  9105723.685027 
-289297.266428  9105773.948859 
-289308.293877  9105787.019773 
-289322.390971  9105812.148437 
-289324.407993  9105816.168764 
-289338.541866  9105846.320137 
-289347.692004  9105874.457037 
-289361.862680  9105909.631112 
-289376.961020  9105935.765359 
-289395.990507  9105955.876632 
-289413.982077  9105969.959561 
-289429.993386  9105985.044876 
-289446.004706  9106000.130184 
-289471.939456  9106013.217116 
-289493.884254  9106024.290659 
-289568.273065  9106004.280090 
-289723.999719  9105963.261552 
-289764.731221  9105961.296175 
-289783.532632  9105950.266462 
-289806.323995  9105941.250085 
-289818.212895  9105936.240155 
-289858.833895  9105919.206586 
-289933.288522  9105908.236354 
-289940.237814  9105907.239248 
-290001.780240  9105897.259644 
-290089.286864  9105904.384670 
-290219.637743  9105926.623019 
-290225.607957  9105927.633892 
-290196.276674  9105587.066634 
-290163.016235  9105388.133968 
-290145.812304  9105345.925289 
-290102.298393  9105239.398456 
-290049.163466  9105176.056121 
-289972.104115  9105102.642718 
-289866.247209  9105032.211781 
-289832.141989  9104988.980172 
-289827.128902  9104982.947578 
-289787.841490  9104910.578861 
-289763.210927  9104804.071727 
-289751.404105  9104684.519443 
-289764.552214  9104580.062091 
-289791.429354  9104450.506216 
-289876.806671  9104302.931865 
-289897.396401  9104264.781790 
-290000.396109  9104081.063175 
-290127.871260  9103847.144197 
-290140.407539  9103794.921987 
-290145.229180  9103774.836523 
-290109.697186  9103672.335980 
-290088.386919  9103612.041070 
-290090.912140  9103549.762758 
-290114.232644  9103477.461525 
-290158.627856  9103433.309903 
-290298.224347  9103362.138216 
-290370.458926  9103320.025406 
-290398.114579  9103296.950836 
-290416.649811  9103249.757734 
-290437.040042  9103048.873350 
-290448.670525  9103008.704574 
-290499.999071  9102961.546632 
-290523.443933  9102906.322551 
-290517.223856  9102871.157307 
-290515.118603  9102855.082557 
-Region 1
-379
-292413.648094  9104137.840727 
-292406.580644  9104122.765692 
-292393.469157  9104096.634745 
-292380.350279  9104069.499263 
-292370.271956  9104050.403051 
-292358.176499  9104027.286686 
-292338.093988  9103999.139524 
-292320.970540  9103967.981819 
-292309.854076  9103942.857391 
-292298.670965  9103908.692199 
-292284.588094  9103885.573755 
-292275.481399  9103863.464935 
-292241.279185  9103807.176592 
-292234.197056  9103790.092444 
-292224.074452  9103764.968993 
-292213.988883  9103744.868184 
-292207.863508  9103722.762403 
-292197.755748  9103699.647997 
-292196.732387  9103695.628857 
-292185.653105  9103675.527010 
-292172.593743  9103656.427640 
-292160.550347  9103640.342877 
-292148.484754  9103621.244519 
-292138.354853  9103595.116498 
-292130.256863  9103575.017701 
-292119.170249  9103553.911294 
-292109.106993  9103536.824027 
-292104.005064  9103518.737357 
-292100.861028  9103496.634619 
-292098.769940  9103482.569146 
-292092.629886  9103458.454265 
-292078.510307  9103430.313044 
-292069.374254  9103404.186013 
-292057.249594  9103377.051363 
-292045.206331  9103360.966540 
-292042.195517  9103356.945333 
-292032.124950  9103338.853500 
-292018.035050  9103314.730363 
-292008.936054  9103293.625957 
-291993.808067  9103263.474593 
-291986.696574  9103242.372237 
-291977.538448  9103213.231572 
-291969.396261  9103187.105524 
-291962.218243  9103156.962381 
-291956.107924  9103136.865575 
-291955.084609  9103132.846419 
-291945.985697  9103111.741984 
-291939.875396  9103091.645172 
-291931.748057  9103067.528169 
-291916.612835  9103036.372214 
-291902.471371  9103005.217282 
-291882.404496  9102979.078795 
-291864.362070  9102957.965019 
-291845.318538  9102935.845665 
-291827.246586  9102910.713739 
-291811.199069  9102890.606532 
-291799.148661  9102873.517057 
-291783.108562  9102854.414365 
-291771.036009  9102834.311281 
-291760.973095  9102817.223863 
-291754.914663  9102804.158720 
-291752.882872  9102798.129451 
-291740.795576  9102776.017287 
-291725.601519  9102736.824952 
-291713.469936  9102708.685579 
-291703.311053  9102678.539212 
-291692.173233  9102650.400865 
-291682.051316  9102625.277150 
-291671.922027  9102599.148897 
-291659.820073  9102575.027622 
-291650.728848  9102554.927596 
-291635.660517  9102532.812251 
-291618.575219  9102506.676680 
-291596.536093  9102482.544950 
-291572.502162  9102457.406584 
-291545.464945  9102429.251465 
-291529.447282  9102413.162218 
-291527.437693  9102410.146528 
-291503.389080  9102382.999038 
-291478.309876  9102350.827813 
-291462.255369  9102329.715859 
-291450.146243  9102304.589948 
-291435.998045  9102272.430196 
-291428.901820  9102253.336714 
-291420.774995  9102229.219511 
-291419.759143  9102226.204860 
-291401.599244  9102189.018221 
-291392.500866  9102167.913559 
-291379.435006  9102147.809231 
-291352.316985  9102108.604040 
-291332.243526  9102081.460593 
-291315.188112  9102059.342960 
-291304.154001  9102045.267906 
-291297.124253  9102035.215195 
-291282.071053  9102015.108715 
-291272.001186  9101997.016559 
-291253.893143  9101966.861553 
-291233.782957  9101934.695356 
-291217.684512  9101907.556037 
-291195.631187  9101881.414914 
-291181.601286  9101865.327573 
-291168.550368  9101847.232210 
-291153.497299  9101827.125657 
-291139.386372  9101799.988400 
-291126.291281  9101775.865800 
-291115.154152  9101747.727162 
-291102.059094  9101723.604547 
-291096.008426  9101711.543766 
-291086.939798  9101694.457128 
-291067.867794  9101668.319072 
-291048.788447  9101641.176467 
-291036.657709  9101613.036730 
-291025.513331  9101583.893508 
-291015.311123  9101547.719584 
-291006.154195  9101518.578472 
-290995.009873  9101489.435232 
-290985.889798  9101465.316794 
-290975.753941  9101438.183678 
-290969.644454  9101418.086565 
-290963.505522  9101393.971301 
-290952.339189  9101361.814424 
-290948.261308  9101347.746652 
-290944.190792  9101334.683416 
-290936.086579  9101313.579627 
-290924.986552  9101290.463569 
-290913.864455  9101264.333892 
-290906.746615  9101242.226618 
-290897.626665  9101218.108136 
-290893.512022  9101199.017664 
-290891.443663  9101187.965620 
-290887.277508  9101161.843382 
-290885.135555  9101140.745961 
-290876.928393  9101105.578618 
-290869.810614  9101083.471326 
-290859.601377  9101046.292765 
-290842.509882  9101019.152107 
-290823.453094  9100995.022916 
-290808.349033  9100967.884370 
-290796.240786  9100942.758096 
-290789.123089  9100920.650775 
-290779.981237  9100893.518621 
-290771.847802  9100868.396608 
-290767.674434  9100841.269794 
-290754.587279  9100818.151501 
-290737.525377  9100795.028919 
-290728.442431  9100775.933049 
-290724.379421  9100763.874301 
-290718.292266  9100746.790717 
-290712.138934  9100720.666282 
-290699.000382  9100690.516185 
-290682.910199  9100664.381018 
-290674.806296  9100643.277119 
-290665.664605  9100616.144909 
-290659.540746  9100594.038610 
-290654.410581  9100571.933382 
-290645.268926  9100544.801161 
-290633.197686  9100524.697487 
-290616.077183  9100493.538500 
-290597.006089  9100467.400048 
-290577.920320  9100439.252502 
-290566.835481  9100418.145332 
-290556.773729  9100401.057392 
-290548.662611  9100378.948903 
-290539.579864  9100359.852953 
-290535.546356  9100351.812325 
-290525.433206  9100327.692592 
-290514.289654  9100298.549075 
-290503.131428  9100267.396472 
-290492.930172  9100231.222240 
-290482.817085  9100207.102484 
-290480.785655  9100201.073084 
-290471.629538  9100171.931700 
-290461.413656  9100133.748368 
-290452.286952  9100108.625135 
-290445.154957  9100084.508599 
-290436.020935  9100058.380817 
-290428.955053  9100043.305140 
-290418.856751  9100021.194431 
-290407.742758  9099996.069013 
-290395.583711  9099963.910722 
-290387.399378  9099931.756753 
-290375.247714  9099900.602988 
-290366.055064  9099866.438844 
-290360.939889  9099846.342604 
-290352.807005  9099821.220405 
-290346.705515  9099802.127617 
-290339.529622  9099771.983790 
-290332.353744  9099741.839959 
-290324.184212  9099711.695038 
-290318.024048  9099684.565909 
-290306.858866  9099652.408639 
-290292.705368  9099619.243562 
-290282.511883  9099584.073739 
-290273.407470  9099561.964039 
-290263.236034  9099529.807830 
-290250.083626  9099497.648350 
-290237.924904  9099465.489951 
-290227.768202  9099435.342805 
-290215.668204  9099411.220727 
-290204.532544  9099383.081563 
-290191.431583  9099357.953840 
-290189.407589  9099352.928949 
-290177.248972  9099320.770511 
-290160.122078  9099288.606610 
-290144.982532  9099256.444879 
-290129.857676  9099226.292223 
-290112.745528  9099196.137371 
-290100.623687  9099169.001602 
-290085.542885  9099144.876173 
-290082.525261  9099139.850177 
-290073.435741  9099119.749474 
-290053.335387  9099088.586754 
-290032.226750  9099055.413836 
-290019.104029  9099027.272384 
-290003.986691  9098998.124188 
-289993.852300  9098970.990552 
-289980.722310  9098941.844532 
-289970.587953  9098914.710884 
-289954.440416  9098880.538837 
-289946.322703  9098857.425547 
-289942.260187  9098845.366628 
-289935.165443  9098826.272606 
-289925.980854  9098793.112769 
-289920.858780  9098772.011851 
-289913.742090  9098749.904188 
-289906.640058  9098729.805610 
-289895.446258  9098693.629924 
-289884.274453  9098660.467862 
-289874.191516  9098640.365970 
-289857.079838  9098610.210920 
-289845.024281  9098592.115901 
-289828.920936  9098563.971021 
-289819.802413  9098539.852029 
-289809.646333  9098509.704661 
-289798.481987  9098477.547095 
-289790.342511  9098451.420102 
-289772.186106  9098414.232068 
-289763.082300  9098392.122138 
-289750.982943  9098367.999799 
-289740.878202  9098344.884210 
-289725.732092  9098311.717633 
-289716.621022  9098288.603138 
-289708.510921  9098266.494290 
-289698.428187  9098246.392315 
-289689.273252  9098217.250534 
-289677.108156  9098184.087242 
-289667.997151  9098160.972724 
-289655.839410  9098128.813964 
-289644.777736  9098110.719946 
-289631.655655  9098082.578247 
-289619.600370  9098064.483108 
-289610.533314  9098047.395839 
-289596.468840  9098026.284832 
-289332.885287  9098125.438904 
-289365.339520  9098215.883845 
-289284.080234  9098245.928812 
-289261.591736  9098159.513143 
-289156.506968  9098192.544702 
-289169.694575  9098229.727537 
-289250.895809  9098464.881147 
-289321.810732  9098651.804990 
-289048.330110  9098756.974515 
-289066.588471  9098808.226626 
-289078.753435  9098841.390140 
-288997.492793  9098871.434886 
-289043.135206  9098999.062905 
-289065.499900  9099068.401330 
-289082.728291  9099114.629534 
-289108.899692  9099160.867761 
-289043.522556  9099188.921460 
-288960.266663  9099217.959504 
-288941.474699  9099229.992840 
-288928.666631  9099245.046532 
-288910.744128  9099240.003642 
-288879.925890  9099237.959834 
-288866.021876  9099238.948701 
-288847.193352  9099245.959258 
-288805.598128  9099264.998613 
-288765.018434  9099287.052711 
-288736.464927  9099323.183957 
-288715.700106  9099337.224077 
-288643.490759  9099382.346802 
-288609.815460  9099397.376816 
-288622.221263  9099463.690660 
-288634.780431  9099551.100050 
-288657.882476  9099721.898330 
-288702.414563  9099970.070428 
-288748.036145  9100231.302602 
-288791.568906  9100478.468654 
-288821.767660  9100668.360759 
-288824.909594  9100690.464177 
-288853.968890  9100860.264089 
-288858.185020  9100893.418644 
-288861.297762  9100911.503855 
-288871.688226  9100973.796982 
-289021.481413  9100938.805348 
-289051.065651  9100907.697604 
-289052.914025  9100888.613414 
-289082.564072  9100866.546588 
-289106.332386  9100855.523131 
-289127.126906  9100845.500892 
-289176.753342  9100837.519797 
-289223.376689  9100826.521698 
-289199.679822  9100710.973408 
-289275.317893  9100727.130086 
-289270.830634  9100656.807416 
-289404.139528  9100678.050608 
-289414.618481  9100752.398000 
-289432.280475  9100857.893990 
-289453.055595  9100981.475060 
-289457.206246  9101005.588542 
-289489.322747  9101185.436151 
-289489.352062  9101189.454332 
-289491.478722  9101208.542881 
-289496.784393  9101254.757434 
-289500.920469  9101276.861807 
-289531.064837  9101458.716179 
-289562.903745  9101600.390864 
-289574.465258  9101686.793701 
-289595.476406  9101842.519894 
-289619.831829  9101911.859603 
-289633.919991  9101935.983912 
-289672.070279  9101989.266106 
-289712.156742  9102035.518614 
-289760.156387  9102076.757037 
-289799.073118  9102098.899309 
-289829.996035  9102115.005610 
-289937.729530  9102171.376914 
-289984.669665  9102203.573053 
-290048.775054  9102272.955501 
-290132.975700  9102372.495567 
-290140.999030  9102382.549584 
-290216.109484  9102461.988904 
-290257.227435  9102513.264461 
-290296.402148  9102570.565054 
-290359.823818  9102682.136408 
-290399.131283  9102757.518553 
-290413.227542  9102782.646987 
-290441.214057  9102804.776733 
-290484.997347  9102812.859963 
-290515.118603  9102855.082557 
-290517.223856  9102871.157307 
-290549.119167  9102884.250371 
-290582.876802  9102880.268381 
-290615.751139  9102891.353378 
-290640.933333  9102937.588685 
-290655.184453  9102983.812294 
-290663.664671  9103056.147511 
-290688.987004  9103121.468972 
-290694.309318  9103169.692079 
-290678.954557  9103244.010919 
-290673.463571  9103308.294977 
-290689.584544  9103338.448048 
-290714.524010  9103351.533493 
-290748.252467  9103343.533152 
-290818.572638  9103311.462978 
-290842.422539  9103311.488312 
-290904.012654  9103308.540089 
-290968.760948  9103329.703808 
-291015.636609  9103352.857572 
-291033.560911  9103357.899169 
-291053.376820  9103349.883896 
-291079.979281  9103318.771649 
-291099.640252  9103289.661117 
-291121.443602  9103281.647923 
-291160.074180  9103264.611730 
-291170.983220  9103261.609657 
-291206.898164  9103280.733543 
-291219.875860  9103288.783436 
-291368.955032  9103426.560353 
-291487.014703  9103535.172871 
-291684.076363  9103711.170420 
-291720.050979  9103738.330012 
-291781.441687  9103708.258108 
-291889.548218  9103949.455882 
-291947.161563  9104081.107990 
-292043.197062  9104302.202033 
-292253.192882  9104210.001888 
-292413.648094  9104137.840727 
-Region 1
-174
-292732.113989  9105142.683814 
-292714.018168  9105114.539012 
-292690.115585  9105107.483213 
-292680.096182  9105096.423374 
-292674.934337  9105070.300666 
-292676.714081  9105042.175945 
-292682.483766  9105016.064299 
-292682.275964  9104987.937566 
-292676.090688  9104957.795744 
-292669.920266  9104929.662971 
-292664.795571  9104908.562886 
-292662.555733  9104874.406978 
-292653.404031  9104846.271176 
-292644.289444  9104823.158001 
-292637.192084  9104804.064944 
-292629.034192  9104775.930137 
-292623.820525  9104742.775718 
-292617.583430  9104705.602182 
-292610.463857  9104683.495532 
-292602.343109  9104660.383344 
-292594.207537  9104635.262098 
-292583.061012  9104606.119711 
-292572.930520  9104579.991909 
-292563.778975  9104551.856058 
-292550.615311  9104518.693522 
-292540.470037  9104490.556648 
-292533.291238  9104460.413750 
-292529.130812  9104435.296521 
-292521.010179  9104412.184296 
-292512.882141  9104388.067539 
-292502.774008  9104364.953280 
-292490.670954  9104340.832462 
-292488.631540  9104333.798742 
-292481.534368  9104314.705623 
-292471.396624  9104287.573238 
-292460.242900  9104257.426250 
-292447.064620  9104222.254587 
-292436.867637  9104187.085960 
-292420.722960  9104153.920288 
-292413.648094  9104137.840727 
-292253.192882  9104210.001888 
-292043.197062  9104302.202033 
-291947.161563  9104081.107990 
-291889.548218  9103949.455882 
-291781.441687  9103708.258108 
-291720.050979  9103738.330012 
-291684.076363  9103711.170420 
-291487.014703  9103535.172871 
-291368.955032  9103426.560353 
-291219.875860  9103288.783436 
-291206.898164  9103280.733543 
-291170.983220  9103261.609657 
-291160.074180  9103264.611730 
-291121.443602  9103281.647923 
-291099.640252  9103289.661117 
-291079.979281  9103318.771649 
-291053.376820  9103349.883896 
-291033.560911  9103357.899169 
-291015.636609  9103352.857572 
-290968.760948  9103329.703808 
-290904.012654  9103308.540089 
-290842.422539  9103311.488312 
-290818.572638  9103311.462978 
-290748.252467  9103343.533152 
-290714.524010  9103351.533493 
-290689.584544  9103338.448048 
-290673.463571  9103308.294977 
-290678.954557  9103244.010919 
-290694.309318  9103169.692079 
-290688.987004  9103121.468972 
-290663.664671  9103056.147511 
-290655.184453  9102983.812294 
-290640.933333  9102937.588685 
-290615.751139  9102891.353378 
-290582.876802  9102880.268381 
-290549.119167  9102884.250371 
-290517.223856  9102871.157307 
-290523.443933  9102906.322551 
-290499.999071  9102961.546632 
-290448.670525  9103008.704574 
-290437.040042  9103048.873350 
-290416.649811  9103249.757734 
-290398.114579  9103296.950836 
-290370.458926  9103320.025406 
-290298.224347  9103362.138216 
-290158.627856  9103433.309903 
-290114.232644  9103477.461525 
-290090.912140  9103549.762758 
-290088.386919  9103612.041070 
-290109.697186  9103672.335980 
-290145.229180  9103774.836523 
-290140.407539  9103794.921987 
-290127.871260  9103847.144197 
-290000.396109  9104081.063175 
-289897.396401  9104264.781790 
-289876.806671  9104302.931865 
-289791.429354  9104450.506216 
-289764.552214  9104580.062091 
-289751.404105  9104684.519443 
-289763.210927  9104804.071727 
-289787.841490  9104910.578861 
-289827.128902  9104982.947578 
-289832.141989  9104988.980172 
-289866.247209  9105032.211781 
-289972.104115  9105102.642718 
-290049.163466  9105176.056121 
-290102.298393  9105239.398456 
-290145.812304  9105345.925289 
-290163.016235  9105388.133968 
-290196.276674  9105587.066634 
-290225.607957  9105927.633892 
-290473.301828  9105960.041231 
-290627.651772  9106002.394234 
-290970.215508  9106097.179104 
-291108.458112  9106111.386671 
-291256.365121  9106088.436380 
-291295.079142  9106082.449408 
-291472.385515  9106003.275575 
-291809.165648  9105987.550155 
-291857.706269  9105966.504984 
-291877.648936  9105975.566133 
-291879.636535  9105975.568171 
-291905.527186  9105982.626357 
-291977.955957  9105966.628144 
-291992.855527  9105965.638860 
-292067.627634  9105997.859940 
-292110.309087  9105990.871837 
-292123.191396  9105985.862366 
-292130.214717  9105994.910216 
-292142.140300  9105994.922371 
-292148.058601  9105988.901275 
-292151.025166  9105986.895256 
-292155.971912  9105983.886733 
-292161.934701  9105983.892808 
-292161.956947  9105986.906393 
-292165.969217  9105991.933085 
-292170.982702  9105997.965316 
-292175.009806  9106005.001063 
-292179.022079  9106010.027752 
-292185.029367  9106016.060993 
-292195.011852  9106022.098278 
-292204.935007  9106020.099335 
-292213.827280  9106013.076738 
-292223.720764  9106007.059679 
-292230.669936  9106006.062226 
-292239.614120  9106006.071322 
-292244.612781  9106010.094487 
-292246.630047  9106014.114619 
-292251.613874  9106016.128727 
-292271.519514  9106020.167038 
-292290.498122  9106033.245080 
-292309.365457  9106031.255197 
-292332.200563  9106028.264812 
-292344.200338  9106038.322185 
-292369.616152  9105981.090329 
-292383.336386  9105954.986726 
-292396.099912  9105933.904751 
-292415.656744  9105890.730228 
-292460.317509  9105748.133711 
-292462.853650  9105687.865112 
-292502.983091  9105604.530664 
-292503.947196  9105600.513564 
-292511.645189  9105566.367706 
-292517.444653  9105544.274157 
-292528.109151  9105508.122268 
-292592.808364  9105387.645490 
-292606.402185  9105344.464936 
-292604.206817  9105316.336184 
-292581.631242  9105219.879497 
-292589.551793  9105215.869446 
-292614.344317  9105208.862924 
-292727.419771  9105179.846250 
-292726.344336  9105168.795462 
-292732.113989  9105142.683814 
-Region 1
-188
-293475.302915  9106999.770528 
-293490.023860  9106974.672175 
-293474.855912  9106939.499268 
-293424.040580  9106787.767597 
-293420.932539  9106770.687792 
-293411.772281  9106741.547845 
-293398.644254  9106713.408489 
-293390.537410  9106692.305685 
-293369.429177  9106660.140373 
-293351.369405  9106637.018688 
-293338.315908  9106618.924516 
-293321.257421  9106596.808316 
-293312.171727  9106577.713544 
-293309.011652  9106553.602062 
-293306.867719  9106532.505130 
-293303.700212  9106507.389124 
-293302.535206  9106484.284130 
-293298.373908  9106459.167137 
-293291.238655  9106435.051709 
-293285.052557  9106404.910130 
-293277.947096  9106384.812785 
-293275.922281  9106379.788202 
-293260.836656  9106355.664876 
-293244.772131  9106333.549599 
-293228.707624  9106311.434312 
-293215.624532  9106289.321979 
-293206.494330  9106264.200021 
-293192.372830  9106236.059550 
-293183.294734  9106217.969242 
-293175.180688  9106195.861828 
-293165.093935  9106175.761477 
-293164.893091  9106148.639355 
-293155.755524  9106122.512850 
-293139.735780  9106106.424641 
-293137.681249  9106097.381952 
-293134.618048  9106086.329226 
-293124.531348  9106066.228856 
-293115.416142  9106043.115902 
-293113.198012  9106011.973695 
-293101.108885  9105989.862283 
-293088.997464  9105964.737295 
-293088.915670  9105953.687536 
-293089.768182  9105934.602581 
-293081.646827  9105911.490601 
-293084.434882  9105885.375964 
-293069.357009  9105862.257030 
-293055.324984  9105846.170747 
-293043.243381  9105825.063825 
-293033.164236  9105805.967933 
-293021.075224  9105783.856476 
-293014.919225  9105757.732885 
-293004.832681  9105737.632456 
-292999.670492  9105711.509853 
-292990.473706  9105677.347073 
-292989.442759  9105672.323456 
-292981.314099  9105648.206909 
-292969.247464  9105629.108993 
-292962.127475  9105607.002482 
-292957.914544  9105574.853715 
-292951.773499  9105550.739146 
-292946.611387  9105524.616524 
-292934.440791  9105491.455243 
-292915.380604  9105467.327689 
-292892.323023  9105440.182551 
-292875.317299  9105425.097692 
-292860.306577  9105411.019348 
-292842.307093  9105395.933470 
-292823.343546  9105384.864683 
-292806.352718  9105371.788838 
-292797.267591  9105352.693844 
-292791.134112  9105329.583749 
-292788.983187  9105307.482186 
-292786.824842  9105284.376097 
-292780.661685  9105257.247895 
-292769.499949  9105226.096574 
-292741.473708  9105198.946293 
-292727.494006  9105189.891509 
-292727.419771  9105179.846250 
-292614.344317  9105208.862924 
-292589.551793  9105215.869446 
-292581.631242  9105219.879497 
-292604.206817  9105316.336184 
-292606.402185  9105344.464936 
-292592.808364  9105387.645490 
-292528.109151  9105508.122268 
-292517.444653  9105544.274157 
-292511.645189  9105566.367706 
-292503.947196  9105600.513564 
-292502.983091  9105604.530664 
-292462.853650  9105687.865112 
-292460.317509  9105748.133711 
-292415.656744  9105890.730228 
-292396.099912  9105933.904751 
-292383.336386  9105954.986726 
-292369.616152  9105981.090329 
-292344.200338  9106038.322185 
-292366.204887  9106057.430377 
-292373.176319  9106059.446483 
-292394.023830  9106056.454050 
-292411.007460  9106068.525488 
-292431.002184  9106084.618044 
-292444.107127  9106109.744291 
-292450.069924  9106109.750324 
-292454.045122  9106109.754345 
-292458.005474  9106107.749312 
-292480.877705  9106109.781479 
-292499.871245  9106124.868462 
-292522.765754  9106129.914185 
-292573.664861  9106159.096601 
-292619.491051  9106174.210575 
-292659.347033  9106188.313968 
-292661.334633  9106188.315969 
-292663.322233  9106188.317969 
-292666.311061  9106189.325495 
-292671.287490  9106190.335021 
-292674.276318  9106191.342547 
-292677.257718  9106191.345547 
-292680.246546  9106192.353072 
-292683.227947  9106192.356071 
-292689.213032  9106195.375646 
-292691.208061  9106196.382171 
-292694.189461  9106196.385170 
-292696.184490  9106197.391694 
-292700.174547  9106199.404743 
-292702.169576  9106200.411267 
-292705.158405  9106201.418790 
-292708.154663  9106203.430839 
-292710.157121  9106205.441888 
-292713.145951  9106206.449410 
-292718.152097  9106211.477032 
-292723.143386  9106214.495602 
-292725.145845  9106216.506651 
-292728.142105  9106218.518697 
-292731.138365  9106220.530744 
-292733.133395  9106221.537266 
-292735.135855  9106223.548314 
-292740.127146  9106226.566882 
-292744.117207  9106228.579925 
-292747.113469  9106230.591970 
-292750.102300  9106231.599490 
-292752.097331  9106232.606011 
-292759.083656  9106236.631097 
-292762.094778  9106240.652191 
-292820.989118  9106275.869390 
-292885.846348  9106311.092459 
-292922.840032  9106341.264974 
-292991.791602  9106392.564208 
-293028.956471  9106445.840643 
-293036.017222  9106459.910908 
-293043.975093  9106460.923356 
-293060.892077  9106463.953760 
-293067.915650  9106473.001400 
-293076.956589  9106486.069112 
-293089.928119  9106493.113637 
-293124.897271  9106518.261324 
-293138.877502  9106527.315865 
-293150.728760  9106517.282490 
-293193.700488  9106549.469670 
-293219.814785  9106586.662650 
-293263.750658  9106614.832633 
-293284.762027  9106633.939230 
-293300.856488  9106660.072548 
-293314.881461  9106675.154148 
-293326.881603  9106685.211166 
-293338.904086  9106698.281745 
-293353.159910  9106744.503502 
-293364.337539  9106777.663520 
-293381.597205  9106826.901764 
-293386.596047  9106830.924755 
-293390.615973  9106836.955808 
-293392.730203  9106854.034635 
-293394.762511  9106860.063725 
-293401.823459  9106874.133890 
-293407.868256  9106885.189507 
-293410.901828  9106892.224097 
-293416.909389  9106898.257106 
-293422.916952  9106904.290113 
-293423.955455  9106910.318220 
-293425.023753  9106920.364413 
-293427.108212  9106933.425149 
-293432.151764  9106943.475259 
-293436.186608  9106951.515346 
-293442.179283  9106955.539306 
-293447.185595  9106960.566807 
-293460.202011  9106973.638306 
-293464.214514  9106978.664825 
-293469.258081  9106988.714928 
-293475.302915  9106999.770528 
+Version 300
+Charset "WindowsLatin1" 
+Delimiter ";"
+CoordSys Earth Projection 8, 92, Meters, -33.000000, 0.000000, 0.999600, 500000.000000, 10000000.000000 Bounds (277712.72411, 9098026.284832) (294927.38349, 9123062.304523)
+Columns 1
+  ID_ Char(16)
+Data
+Region 1
+143
+294927.383494  9110349.192930 
+294744.887076  9109866.859191 
+294715.645195  9109810.579317 
+294528.843923  9109416.636133 
+294423.835782  9109195.544709 
+294398.772343  9109166.390114 
+294368.560093  9109113.122393 
+294343.294756  9109056.845831 
+294314.726304  9108957.372220 
+294283.363436  9108883.008600 
+294275.150885  9108847.842938 
+294265.010476  9108820.711496 
+294259.921583  9108804.634483 
+294258.860435  9108795.592887 
+294252.822564  9108785.542016 
+294250.767570  9108776.499468 
+294246.739834  9108769.464047 
+294238.684365  9108755.393204 
+294231.600320  9108738.309762 
+294220.578272  9108726.245087 
+294213.539097  9108715.188737 
+294209.481470  9108704.135246 
+294205.364039  9108685.045622 
+294202.277838  9108670.979533 
+294196.195149  9108654.901549 
+294190.149841  9108643.846145 
+294185.105858  9108633.796210 
+294182.057045  9108624.752699 
+294175.966898  9108607.670192 
+294165.878952  9108587.570315 
+294160.834983  9108577.520374 
+294153.758483  9108561.441422 
+294146.674516  9108544.357951 
+294142.616929  9108533.304445 
+294137.595393  9108526.268049 
+294133.537811  9108515.214542 
+294130.421763  9108497.130371 
+294124.406392  9108490.093016 
+294120.341345  9108478.034989 
+294116.223993  9108458.945342 
+294110.178740  9108447.889916 
+294104.126019  9108435.829971 
+294100.008682  9108416.740320 
+294092.902354  9108396.643279 
+294087.836016  9108383.579769 
+294077.755650  9108364.484366 
+294069.692859  9108349.408944 
+294066.659041  9108342.374449 
+294068.519719  9108325.299573 
+294065.508316  9108321.278629 
+294056.548815  9108319.260968 
+294055.532564  9108316.246458 
+294048.471101  9108302.176504 
+294019.223996  9108244.891190 
+294014.202519  9108237.854768 
+294010.189821  9108232.828340 
+294007.156024  9108225.793837 
+294002.082272  9108211.725789 
+293996.926371  9108186.608045 
+293992.876339  9108176.559026 
+293985.837330  9108165.502605 
+293975.816814  9108154.443299 
+293973.791802  9108149.418787 
+293970.698279  9108134.348136 
+293965.639489  9108122.289114 
+293954.572885  9108104.197213 
+293945.501428  9108087.111749 
+293940.472518  9108079.070793 
+293930.392306  9108059.975325 
+293923.301074  9108041.887259 
+293920.207583  9108026.816598 
+293918.122860  9108013.755936 
+293911.054040  9107998.681420 
+293888.913499  9107961.493041 
+293881.889487  9107952.445626 
+293866.847639  9107934.349826 
+293862.827526  9107928.318856 
+293859.786317  9107920.279813 
+293852.627974  9107893.151057 
+293845.484569  9107868.031334 
+293837.407049  9107850.946792 
+293824.323070  9107828.834822 
+293814.280294  9107814.761895 
+293805.246278  9107802.698970 
+293798.155157  9107784.610861 
+293794.082837  9107771.548247 
+293788.934618  9107747.434956 
+293786.835042  9107732.365236 
+293776.687852  9107704.229026 
+293766.570520  9107680.110887 
+293751.424388  9107647.951746 
+293747.374482  9107637.902679 
+293745.289853  9107624.841990 
+293742.241238  9107615.798410 
+293729.164855  9107594.690903 
+293672.755437  9107626.780234 
+293521.281374  9107704.984071 
+293462.936145  9107744.102902 
+293364.208865  9107832.403195 
+293339.616406  9107866.532504 
+293327.869243  9107890.629294 
+293320.097410  9107914.729992 
+293300.255215  9108053.333432 
+293301.509882  9108088.492658 
+293298.637523  9108237.157915 
+293296.080829  9108294.412704 
+293293.382528  9108332.581588 
+293300.764305  9108389.846127 
+293317.493299  9108501.363570 
+293323.491394  9108639.992344 
+293320.972113  9108702.269727 
+293320.559857  9108780.621391 
+293314.169583  9108856.958177 
+293296.345196  9108999.581685 
+293290.687789  9109040.761214 
+293294.737803  9109050.810311 
+293306.858028  9109076.939513 
+293337.973511  9109118.154962 
+293383.234388  9109190.524081 
+293427.531411  9109266.910231 
+293430.557774  9109272.940255 
+293444.725586  9109307.107480 
+293454.850799  9109332.230150 
+293530.218275  9109577.404394 
+293552.419405  9109622.628964 
+293992.155865  9110483.917707 
+294014.373032  9110531.150854 
+294037.644004  9110586.421057 
+294048.853659  9110623.598579 
+294056.117705  9110664.790372 
+294060.340227  9110697.943191 
+294064.772311  9110759.222458 
+294065.213877  9110818.488906 
+294060.588682  9110864.691915 
+294057.666870  9110872.725207 
+294050.089921  9110922.943445 
+294042.505484  9110972.157169 
+294025.960977  9111019.353352 
+294001.555051  9111078.596165 
+293981.983873  9111119.762415 
+293955.530183  9111170.967203 
+294251.836018  9110921.125913 
+294927.383494  9110349.192930 
+Region 1
+84
+294065.213877  9110818.488906 
+294064.772311  9110759.222458 
+294060.340227  9110697.943191 
+294056.117705  9110664.790372 
+294048.853659  9110623.598579 
+294037.644004  9110586.421057 
+294014.373032  9110531.150854 
+293992.155865  9110483.917707 
+293552.419405  9109622.628964 
+293530.218275  9109577.404394 
+293454.850799  9109332.230150 
+293444.725586  9109307.107480 
+293430.557774  9109272.940255 
+293427.531411  9109266.910231 
+293383.234388  9109190.524081 
+293337.973511  9109118.154962 
+293306.858028  9109076.939513 
+293294.737803  9109050.810311 
+293290.687789  9109040.761214 
+293275.645665  9109022.665255 
+293270.631626  9109016.633266 
+293255.604431  9109000.546339 
+293235.630320  9108987.468101 
+293206.674215  9108969.358479 
+293161.756762  9108943.197059 
+293122.780144  9108914.027874 
+293103.755245  9108894.923404 
+293074.657661  9108857.727748 
+292854.985020  9108585.287285 
+292782.828319  9108638.455178 
+292651.255912  9108720.694981 
+292481.108432  9108828.009014 
+292466.230293  9108832.012252 
+292451.344711  9108835.010959 
+292313.160993  9108829.850311 
+292268.578511  9108848.891541 
+292219.086135  9108875.963968 
+292079.531088  9108954.176414 
+291989.371685  9108992.257477 
+291896.341889  9109045.403312 
+291823.100119  9109086.514742 
+291722.141186  9109142.665864 
+291698.741081  9109203.918009 
+291678.834731  9109334.485706 
+291675.127352  9109505.250677 
+291672.347160  9109666.975882 
+291672.451108  9109681.039292 
+291675.989645  9109756.382000 
+291686.448292  9109826.709078 
+291698.709107  9109871.924924 
+291701.350442  9109960.325484 
+291702.485447  9109979.412538 
+291686.125497  9110186.327479 
+291677.522141  9110232.526801 
+291688.521836  9110241.578574 
+291703.519400  9110253.647934 
+291721.483798  9110263.711229 
+291733.469974  9110271.759459 
+291772.380487  9110291.889008 
+291985.817523  9110392.555007 
+291996.794999  9110398.593100 
+292058.632262  9110427.785930 
+292257.109763  9110521.403789 
+292500.469791  9110636.159771 
+292594.231573  9110681.455477 
+292640.114895  9110703.600001 
+292687.993507  9110726.750944 
+292903.451486  9110831.431676 
+292913.427793  9110836.463999 
+293036.110408  9110894.845514 
+293154.810204  9110952.218239 
+293159.802112  9110955.236627 
+293355.301623  9111048.845678 
+293490.965711  9111115.274316 
+293789.205136  9111258.200908 
+293955.530183  9111170.967203 
+293981.983873  9111119.762415 
+294001.555051  9111078.596165 
+294025.960977  9111019.353352 
+294042.505484  9110972.157169 
+294050.089921  9110922.943445 
+294057.666870  9110872.725207 
+294060.588682  9110864.691915 
+294065.213877  9110818.488906 
+Region 1
+101
+292651.255912  9108720.694981 
+292782.828319  9108638.455178 
+292571.701510  9108311.777175 
+292507.344261  9108210.256601 
+292503.324267  9108204.225474 
+292495.306588  9108195.176795 
+292482.126387  9108160.005475 
+292463.087224  9108138.891540 
+292225.928155  9108054.273903 
+291735.740107  9107889.036183 
+291728.620015  9108001.535428 
+291597.432424  9108001.401703 
+291590.556709  9108147.050510 
+291625.623208  9108185.258134 
+291663.671317  9108223.468753 
+291666.689952  9108228.494439 
+291592.573826  9108285.676724 
+291532.208732  9108186.167351 
+291390.265958  9108210.130737 
+291304.913254  9108226.115618 
+291290.049921  9108232.127510 
+291275.134726  9108231.107674 
+291091.494049  9108261.054508 
+291123.747563  9108456.970162 
+291144.113558  9108523.289769 
+291168.284704  9108566.509186 
+291224.548416  9108648.937974 
+291099.545392  9108544.338955 
+290942.458182  9108401.534320 
+290838.475408  9108317.046513 
+290820.738943  9108472.729789 
+290803.172679  9108651.517370 
+290796.630020  9108707.764099 
+290795.249106  9108790.133866 
+290798.132341  9108911.684582 
+290799.400059  9108948.853380 
+290800.889839  9109016.158205 
+290802.996015  9109032.232807 
+290806.066457  9109044.290299 
+290809.181316  9109062.374994 
+290812.251764  9109074.432484 
+290815.322214  9109086.489973 
+290818.370459  9109095.533859 
+290828.472063  9109117.643869 
+290838.544065  9109135.735738 
+290849.617356  9109154.833162 
+290966.069682  9109312.663653 
+290968.072252  9109314.674763 
+290990.159800  9109344.833227 
+291077.627587  9109480.533876 
+291109.750468  9109523.761346 
+291199.073350  9109641.382044 
+291238.205580  9109691.648189 
+291349.572732  9109833.399452 
+291403.762044  9109903.771137 
+291481.997875  9110000.284674 
+291627.448641  9110181.245714 
+291639.479342  9110195.321154 
+291652.518800  9110211.406649 
+291666.522451  9110223.475023 
+291677.522141  9110232.526801 
+291686.125497  9110186.327479 
+291702.485447  9109979.412538 
+291701.350442  9109960.325484 
+291698.709107  9109871.924924 
+291686.448292  9109826.709078 
+291675.989645  9109756.382000 
+291672.451108  9109681.039292 
+291672.347160  9109666.975882 
+291675.127352  9109505.250677 
+291678.834731  9109334.485706 
+291419.856052  9109391.480679 
+291488.351725  9109245.894501 
+291520.786026  9109196.705850 
+291386.888018  9108964.524630 
+291379.812311  9108948.445030 
+291358.251622  9108855.002306 
+291347.801473  9108785.679481 
+291346.763133  9108779.651276 
+291339.168630  9108693.254451 
+291530.709568  9108656.282630 
+291513.858636  9108527.686499 
+291658.056978  9108539.887609 
+291661.402054  9108589.112605 
+291663.590076  9108616.236931 
+291668.700331  9108635.328047 
+291687.124011  9108707.672357 
+291689.378852  9108743.837443 
+291683.208365  9108850.310526 
+291782.179076  9108794.157613 
+292067.222661  9108633.722115 
+292093.367519  9108674.933761 
+292003.187745  9108844.606885 
+292079.531088  9108954.176414 
+292219.086135  9108875.963968 
+292268.578511  9108848.891541 
+292313.160993  9108829.850311 
+292451.344711  9108835.010959 
+292466.230293  9108832.012252 
+292481.108432  9108828.009014 
+292651.255912  9108720.694981 
+Region 1
+30
+291782.179076  9108794.157613 
+291683.208365  9108850.310526 
+291689.378852  9108743.837443 
+291687.124011  9108707.672357 
+291668.700331  9108635.328047 
+291663.590076  9108616.236931 
+291661.402054  9108589.112605 
+291658.056978  9108539.887609 
+291513.858636  9108527.686499 
+291530.709568  9108656.282630 
+291339.168630  9108693.254451 
+291346.763133  9108779.651276 
+291347.801473  9108785.679481 
+291358.251622  9108855.002306 
+291379.812311  9108948.445030 
+291386.888018  9108964.524630 
+291520.786026  9109196.705850 
+291488.351725  9109245.894501 
+291419.856052  9109391.480679 
+291678.834731  9109334.485706 
+291698.741081  9109203.918009 
+291722.141186  9109142.665864 
+291823.100119  9109086.514742 
+291896.341889  9109045.403312 
+291989.371685  9108992.257477 
+292079.531088  9108954.176414 
+292003.187745  9108844.606885 
+292093.367519  9108674.933761 
+292067.222661  9108633.722115 
+291782.179076  9108794.157613 
+Region 1
+59
+293212.241769  9107844.307819 
+293215.178576  9107838.283626 
+293222.008777  9107821.213610 
+293223.921952  9107811.170350 
+293224.781702  9107793.089934 
+293220.687189  9107777.013664 
+293180.758464  9107619.265447 
+293084.595260  9107651.314867 
+293033.087291  9107674.367727 
+292978.649863  9107704.449246 
+292958.907190  9107722.510952 
+292934.165566  9107736.549628 
+292904.015711  9107691.316462 
+292848.100707  9107656.102802 
+292799.737703  9107701.257923 
+292769.077650  9107721.317726 
+292748.288964  9107732.346699 
+292683.015701  9107775.475848 
+292475.735130  9107833.530608 
+292455.367874  9107767.211966 
+292420.020774  9107825.438589 
+292355.770529  9107872.586469 
+292332.096704  9107896.671139 
+292267.253560  9107998.062392 
+292225.928155  9108054.273903 
+292463.087224  9108138.891540 
+292482.126387  9108160.005475 
+292495.306588  9108195.176795 
+292503.324267  9108204.225474 
+292507.344261  9108210.256601 
+292571.701510  9108311.777175 
+292782.828319  9108638.455178 
+292854.985020  9108585.287285 
+293074.657661  9108857.727748 
+293103.755245  9108894.923404 
+293122.780144  9108914.027874 
+293161.756762  9108943.197059 
+293206.674215  9108969.358479 
+293235.630320  9108987.468101 
+293255.604431  9109000.546339 
+293270.631626  9109016.633266 
+293275.645665  9109022.665255 
+293290.687789  9109040.761214 
+293296.345196  9108999.581685 
+293314.169583  9108856.958177 
+293320.559857  9108780.621391 
+293320.972113  9108702.269727 
+293323.491394  9108639.992344 
+293317.493299  9108501.363570 
+293300.764305  9108389.846127 
+293293.382528  9108332.581588 
+293296.080829  9108294.412704 
+293298.637523  9108237.157915 
+293301.509882  9108088.492658 
+293300.255215  9108053.333432 
+293320.097410  9107914.729992 
+293327.869243  9107890.629294 
+293339.616406  9107866.532504 
+293212.241769  9107844.307819 
+Region 1
+29
+291144.113558  9108523.289769 
+291123.747563  9108456.970162 
+291091.494049  9108261.054508 
+291133.659600  9108183.749503 
+291026.234709  9108171.584401 
+290857.190936  9108159.355208 
+290867.390892  9108059.917635 
+290896.673727  9107987.622070 
+290907.978463  9107903.253554 
+290921.159918  9107803.819090 
+290929.594077  9107734.515504 
+290659.512428  9107767.384036 
+290546.465248  9107801.419973 
+290501.753161  9107937.989123 
+290474.372376  9108133.843602 
+290485.604233  9108309.647850 
+290496.972760  9108368.926899 
+290569.443173  9108357.952642 
+290582.769978  9108413.215566 
+290610.842072  9108446.394207 
+290748.236394  9108614.292972 
+290803.172679  9108651.517370 
+290820.738943  9108472.729789 
+290838.475408  9108317.046513 
+290942.458182  9108401.534320 
+291099.545392  9108544.338955 
+291224.548416  9108648.937974 
+291168.284704  9108566.509186 
+291144.113558  9108523.289769 
+Region 1
+28
+291666.689952  9108228.494439 
+291663.671317  9108223.468753 
+291625.623208  9108185.258134 
+291590.556709  9108147.050510 
+291500.406112  9108051.528726 
+291454.348229  9108005.273510 
+291429.390911  9107990.180091 
+291338.454543  9107922.783698 
+291307.126858  9107852.434800 
+291258.644791  9107746.909831 
+291205.193800  9107641.379626 
+291050.620919  9107704.505071 
+290929.594077  9107734.515504 
+290921.159918  9107803.819090 
+290907.978463  9107903.253554 
+290896.673727  9107987.622070 
+290867.390892  9108059.917635 
+290857.190936  9108159.355208 
+291026.234709  9108171.584401 
+291133.659600  9108183.749503 
+291091.494049  9108261.054508 
+291275.134726  9108231.107674 
+291290.049921  9108232.127510 
+291304.913254  9108226.115618 
+291390.265958  9108210.130737 
+291532.208732  9108186.167351 
+291592.573826  9108285.676724 
+291666.689952  9108228.494439 
+Region 1
+28
+292225.928155  9108054.273903 
+292267.253560  9107998.062392 
+292224.198949  9107954.824714 
+292139.054116  9107864.332068 
+292094.746083  9107785.934725 
+292092.728711  9107781.914604 
+292034.966615  9107631.178054 
+292029.886117  9107616.105094 
+291991.393197  9107517.623011 
+291906.234932  9107425.120549 
+291810.397007  9107366.760706 
+291723.933725  9107366.672486 
+291623.860617  9107407.755619 
+291470.431386  9107490.973835 
+291462.510337  9107494.983801 
+291223.031091  9107634.366344 
+291205.193800  9107641.379626 
+291258.644791  9107746.909831 
+291307.126858  9107852.434800 
+291338.454543  9107922.783698 
+291429.390911  9107990.180091 
+291454.348229  9108005.273510 
+291500.406112  9108051.528726 
+291590.556709  9108147.050510 
+291597.432424  9108001.401703 
+291728.620015  9108001.535428 
+291735.740107  9107889.036183 
+292225.928155  9108054.273903 
+Region 1
+58
+291881.700695  9107198.073673 
+291840.783263  9107174.927968 
+291805.895548  9107160.829069 
+291778.016523  9107153.768953 
+291754.135046  9107149.726470 
+291729.267155  9107146.687487 
+291705.415326  9107146.663097 
+291676.594362  9107146.633609 
+291622.942546  9107148.587713 
+291580.222809  9107150.552967 
+291539.490712  9107152.520221 
+291510.684534  9107154.499690 
+291474.921554  9107156.471991 
+291410.359768  9107161.428204 
+291340.813996  9107164.370140 
+291279.196614  9107164.306580 
+291218.536038  9107159.221299 
+291179.710101  9107150.140423 
+291124.931115  9107134.011308 
+291064.181783  9107116.871399 
+290748.450488  9107023.121720 
+290623.948574  9106985.823922 
+290529.335477  9106958.602413 
+290423.760814  9106927.351026 
+290355.039058  9106907.188048 
+290336.112046  9106901.140913 
+290298.265411  9106890.051154 
+290264.379344  9106876.956481 
+290226.495850  9106860.843960 
+290185.586638  9106838.701014 
+290138.692372  9106813.538088 
+290114.421900  9106891.865803 
+290104.205128  9106989.294504 
+290117.552708  9107047.571445 
+290128.809407  9107091.782725 
+290181.115820  9107177.223155 
+290232.568829  9107281.748650 
+290261.788634  9107336.024096 
+290288.976555  9107384.270184 
+290310.186739  9107430.500892 
+290341.497811  9107498.841853 
+290385.773258  9107573.223560 
+290390.794163  9107580.260537 
+290431.013170  9107643.588080 
+290469.525328  9107745.085871 
+290503.456463  9107764.207437 
+290546.465248  9107801.419973 
+290659.512428  9107767.384036 
+290929.594077  9107734.515504 
+291050.620919  9107704.505071 
+291205.193800  9107641.379626 
+291223.031091  9107634.366344 
+291462.510337  9107494.983801 
+291470.431386  9107490.973835 
+291623.860617  9107407.755619 
+291723.933725  9107366.672486 
+291810.397007  9107366.760706 
+291881.700695  9107198.073673 
+Region 1
+27
+291814.312431  9106011.663983 
+291857.706269  9105966.504984 
+291809.165648  9105987.550155 
+291472.385515  9106003.275575 
+291295.079142  9106082.449408 
+291256.365121  9106088.436380 
+291108.458112  9106111.386671 
+290970.215508  9106097.179104 
+290627.651772  9106002.394234 
+290473.301828  9105960.041231 
+290466.514862  9105983.138244 
+290469.533171  9105988.164082 
+290471.660961  9106007.252394 
+290446.692504  9106125.760533 
+290415.893910  9106262.344063 
+290361.942347  9106358.721946 
+290328.639464  9106424.985737 
+290434.212849  9106456.237646 
+290679.312180  9106540.875865 
+290899.500167  9106616.445797 
+291126.674989  9106696.039832 
+291355.845419  9106776.639115 
+291458.467987  9106811.903304 
+291512.032150  9106663.288902 
+291591.752248  9106692.502096 
+291787.178349  9106644.485429 
+291814.312431  9106011.663983 
+Region 1
+255
+293729.164855  9107594.690903 
+293727.147367  9107590.670886 
+293719.084879  9107575.595338 
+293715.020073  9107563.537225 
+293710.925436  9107547.461033 
+293707.876836  9107538.417447 
+293703.841872  9107530.377410 
+293698.813085  9107522.336401 
+293686.849904  9107517.302155 
+293683.801313  9107508.258565 
+293680.678147  9107489.169779 
+293679.632121  9107482.137170 
+293674.603346  9107474.096156 
+293666.540903  9107459.020588 
+293662.498499  9107449.976024 
+293662.468671  9107445.957945 
+293661.377910  9107432.898216 
+293659.323155  9107423.855594 
+293648.241983  9107403.754504 
+293640.194478  9107390.687966 
+293637.168278  9107384.657928 
+293631.078600  9107367.575253 
+293620.961458  9107343.457042 
+293612.899065  9107328.381454 
+293605.845408  9107315.315878 
+293600.786851  9107303.256767 
+293588.615018  9107270.095911 
+293581.539019  9107254.016766 
+293572.400852  9107227.890465 
+293544.156574  9107171.610012 
+293540.084422  9107158.547341 
+293527.972312  9107133.422613 
+293524.879082  9107118.351874 
+293521.852922  9107112.321820 
+293517.825495  9107105.286269 
+293505.795383  9107091.211256 
+293499.772878  9107083.169227 
+293497.740540  9107077.140148 
+293492.622443  9107057.044844 
+293485.472020  9107030.920457 
+293479.375025  9107012.833213 
+293476.311629  9107001.780548 
+293475.302915  9106999.770528 
+293469.258081  9106988.714928 
+293464.214514  9106978.664825 
+293460.202011  9106973.638306 
+293447.185595  9106960.566807 
+293442.179283  9106955.539306 
+293436.186608  9106951.515346 
+293432.151764  9106943.475259 
+293427.108212  9106933.425149 
+293425.023753  9106920.364413 
+293423.955455  9106910.318220 
+293422.916952  9106904.290113 
+293416.909389  9106898.257106 
+293410.901828  9106892.224097 
+293407.868256  9106885.189507 
+293401.823459  9106874.133890 
+293394.762511  9106860.063725 
+293392.730203  9106854.034635 
+293390.615973  9106836.955808 
+293386.596047  9106830.924755 
+293381.597205  9106826.901764 
+293364.337539  9106777.663520 
+293353.159910  9106744.503502 
+293338.904086  9106698.281745 
+293326.881603  9106685.211166 
+293314.881461  9106675.154148 
+293300.856488  9106660.072548 
+293284.762027  9106633.939230 
+293263.750658  9106614.832633 
+293219.814785  9106586.662650 
+293193.700488  9106549.469670 
+293150.728760  9106517.282490 
+293138.877502  9106527.315865 
+293124.897271  9106518.261324 
+293089.928119  9106493.113637 
+293076.956589  9106486.069112 
+293067.915650  9106473.001400 
+293060.892077  9106463.953760 
+293043.975093  9106460.923356 
+293036.017222  9106459.910908 
+293028.956471  9106445.840643 
+292991.791602  9106392.564208 
+292922.840032  9106341.264974 
+292885.846348  9106311.092459 
+292820.989118  9106275.869390 
+292762.094778  9106240.652191 
+292759.083656  9106236.631097 
+292752.097331  9106232.606011 
+292750.102300  9106231.599490 
+292747.113469  9106230.591970 
+292744.117207  9106228.579925 
+292740.127146  9106226.566882 
+292735.135855  9106223.548314 
+292733.133395  9106221.537266 
+292731.138365  9106220.530744 
+292728.142105  9106218.518697 
+292725.145845  9106216.506651 
+292723.143386  9106214.495602 
+292718.152097  9106211.477032 
+292713.145951  9106206.449410 
+292710.157121  9106205.441888 
+292708.154663  9106203.430839 
+292705.158405  9106201.418790 
+292702.169576  9106200.411267 
+292700.174547  9106199.404743 
+292696.184490  9106197.391694 
+292694.189461  9106196.385170 
+292691.208061  9106196.382171 
+292689.213032  9106195.375646 
+292683.227947  9106192.356071 
+292680.246546  9106192.353072 
+292677.257718  9106191.345547 
+292674.276318  9106191.342547 
+292671.287490  9106190.335021 
+292666.311061  9106189.325495 
+292663.322233  9106188.317969 
+292661.334633  9106188.315969 
+292659.347033  9106188.313968 
+292619.491051  9106174.210575 
+292573.664861  9106159.096601 
+292522.765754  9106129.914185 
+292499.871245  9106124.868462 
+292480.877705  9106109.781479 
+292458.005474  9106107.749312 
+292454.045122  9106109.754345 
+292450.069924  9106109.750324 
+292444.107127  9106109.744291 
+292431.002184  9106084.618044 
+292411.007460  9106068.525488 
+292394.023830  9106056.454050 
+292373.176319  9106059.446483 
+292366.204887  9106057.430377 
+292344.200338  9106038.322185 
+292332.200563  9106028.264812 
+292309.365457  9106031.255197 
+292290.498122  9106033.245080 
+292271.519514  9106020.167038 
+292251.613874  9106016.128727 
+292246.630047  9106014.114619 
+292244.612781  9106010.094487 
+292239.614120  9106006.071322 
+292230.669936  9106006.062226 
+292223.720764  9106007.059679 
+292213.827280  9106013.076738 
+292204.935007  9106020.099335 
+292195.011852  9106022.098278 
+292185.029367  9106016.060993 
+292179.022079  9106010.027752 
+292175.009806  9106005.001063 
+292170.982702  9105997.965316 
+292165.969217  9105991.933085 
+292161.956947  9105986.906393 
+292161.934701  9105983.892808 
+292155.971912  9105983.886733 
+292151.025166  9105986.895256 
+292148.058601  9105988.901275 
+292142.140300  9105994.922371 
+292130.214717  9105994.910216 
+292123.191396  9105985.862366 
+292110.309087  9105990.871837 
+292067.627634  9105997.859940 
+291992.855527  9105965.638860 
+291977.955957  9105966.628144 
+291905.527186  9105982.626357 
+291879.636535  9105975.568171 
+291877.648936  9105975.566133 
+291857.706269  9105966.504984 
+291814.312431  9106011.663983 
+291787.178349  9106644.485429 
+291591.752248  9106692.502096 
+291512.032150  9106663.288902 
+291458.467987  9106811.903304 
+291355.845419  9106776.639115 
+291126.674989  9106696.039832 
+290899.500167  9106616.445797 
+290679.312180  9106540.875865 
+290434.212849  9106456.237646 
+290328.639464  9106424.985737 
+290307.100042  9106469.162297 
+290265.199323  9106582.629922 
+290252.508304  9106613.756944 
+290198.467600  9106698.080332 
+290145.501665  9106793.454681 
+290138.692372  9106813.538088 
+290185.586638  9106838.701014 
+290226.495850  9106860.843960 
+290264.379344  9106876.956481 
+290298.265411  9106890.051154 
+290336.112046  9106901.140913 
+290355.039058  9106907.188048 
+290423.760814  9106927.351026 
+290529.335477  9106958.602413 
+290623.948574  9106985.823922 
+290748.450488  9107023.121720 
+291064.181783  9107116.871399 
+291124.931115  9107134.011308 
+291179.710101  9107150.140423 
+291218.536038  9107159.221299 
+291279.196614  9107164.306580 
+291340.813996  9107164.370140 
+291410.359768  9107161.428204 
+291474.921554  9107156.471991 
+291510.684534  9107154.499690 
+291539.490712  9107152.520221 
+291580.222809  9107150.552967 
+291622.942546  9107148.587713 
+291676.594362  9107146.633609 
+291705.415326  9107146.663097 
+291729.267155  9107146.687487 
+291754.135046  9107149.726470 
+291778.016523  9107153.768953 
+291805.895548  9107160.829069 
+291840.783263  9107174.927968 
+291881.700695  9107198.073673 
+291810.397007  9107366.760706 
+291906.234932  9107425.120549 
+291991.393197  9107517.623011 
+292029.886117  9107616.105094 
+292034.966615  9107631.178054 
+292092.728711  9107781.914604 
+292094.746083  9107785.934725 
+292139.054116  9107864.332068 
+292224.198949  9107954.824714 
+292267.253560  9107998.062392 
+292332.096704  9107896.671139 
+292355.770529  9107872.586469 
+292420.020774  9107825.438589 
+292455.367874  9107767.211966 
+292475.735130  9107833.530608 
+292683.015701  9107775.475848 
+292748.288964  9107732.346699 
+292769.077650  9107721.317726 
+292799.737703  9107701.257923 
+292848.100707  9107656.102802 
+292904.015711  9107691.316462 
+292934.165566  9107736.549628 
+292958.907190  9107722.510952 
+292978.649863  9107704.449246 
+293033.087291  9107674.367727 
+293084.595260  9107651.314867 
+293180.758464  9107619.265447 
+293220.687189  9107777.013664 
+293224.781702  9107793.089934 
+293223.921952  9107811.170350 
+293222.008777  9107821.213610 
+293215.178576  9107838.283626 
+293212.241769  9107844.307819 
+293339.616406  9107866.532504 
+293364.208865  9107832.403195 
+293462.936145  9107744.102902 
+293521.281374  9107704.984071 
+293672.755437  9107626.780234 
+293729.164855  9107594.690903 
+Region 1
+60
+290849.617356  9109154.833162 
+290838.544065  9109135.735738 
+290828.472063  9109117.643869 
+290818.370459  9109095.533859 
+290815.322214  9109086.489973 
+290812.251764  9109074.432484 
+290809.181316  9109062.374994 
+290806.066457  9109044.290299 
+290802.996015  9109032.232807 
+290800.889839  9109016.158205 
+290799.400059  9108948.853380 
+290798.132341  9108911.684582 
+290795.249106  9108790.133866 
+290796.630020  9108707.764099 
+290803.172679  9108651.517370 
+290748.236394  9108614.292972 
+290610.842072  9108446.394207 
+290582.769978  9108413.215566 
+290569.443173  9108357.952642 
+290496.972760  9108368.926899 
+290508.348727  9108429.210473 
+290525.255919  9108565.843950 
+290517.689452  9108618.071540 
+290469.958492  9108749.615035 
+290404.976700  9108832.923171 
+290316.030885  9108901.138305 
+290290.345391  9108922.206584 
+290242.942436  9108963.342735 
+290215.387340  9109000.481507 
+290200.634371  9109021.561194 
+290195.783209  9109037.628594 
+290179.315837  9109095.874089 
+290155.979949  9109166.166757 
+290144.637075  9109245.512751 
+290140.809321  9109265.599345 
+290132.196870  9109310.794181 
+290125.527848  9109349.963873 
+290218.040259  9109361.110413 
+290298.648256  9109375.257931 
+290376.222861  9109382.370435 
+290462.779382  9109394.514773 
+290523.435789  9109398.595850 
+290582.141420  9109407.697461 
+290613.982642  9109412.753075 
+290632.866399  9109412.772621 
+290660.732095  9109417.824086 
+290682.604896  9109418.851230 
+290699.493484  9109417.864158 
+290710.389171  9109412.852781 
+290735.191792  9109406.851239 
+290776.853361  9109395.844448 
+290807.611834  9109388.844489 
+290841.329719  9109378.833981 
+290865.116192  9109369.817749 
+290900.806987  9109357.800184 
+290928.546727  9109345.774416 
+290944.367313  9109334.740904 
+290968.072252  9109314.674763 
+290966.069682  9109312.663653 
+290849.617356  9109154.833162 
+Region 1
+158
+291199.073350  9109641.382044 
+291109.750468  9109523.761346 
+291077.627587  9109480.533876 
+290990.159800  9109344.833227 
+290968.072252  9109314.674763 
+290944.367313  9109334.740904 
+290928.546727  9109345.774416 
+290900.806987  9109357.800184 
+290865.116192  9109369.817749 
+290841.329719  9109378.833981 
+290807.611834  9109388.844489 
+290776.853361  9109395.844448 
+290735.191792  9109406.851239 
+290710.389171  9109412.852781 
+290699.493484  9109417.864158 
+290682.604896  9109418.851230 
+290660.732095  9109417.824086 
+290632.866399  9109412.772621 
+290613.982642  9109412.753075 
+290582.141420  9109407.697461 
+290523.435789  9109398.595850 
+290462.779382  9109394.514773 
+290376.222861  9109382.370435 
+290298.648256  9109375.257931 
+290218.040259  9109361.110413 
+290125.527848  9109349.963873 
+290122.634862  9109362.015206 
+290112.086350  9109414.239730 
+290101.656048  9109482.536861 
+290097.916947  9109514.677912 
+290101.327182  9109572.944223 
+290101.681879  9109621.162035 
+290101.792724  9109636.230102 
+290118.130983  9109695.514445 
+290126.392520  9109737.713330 
+290137.606194  9109775.897172 
+290152.751117  9109808.057930 
+290164.951345  9109845.238254 
+290178.101139  9109876.392382 
+290193.320071  9109918.598482 
+290199.534825  9109952.758956 
+290201.833159  9109994.951582 
+290201.149812  9110037.141102 
+290200.569997  9110093.394140 
+290199.871881  9110133.574585 
+290190.302611  9110183.791091 
+290183.485801  9110202.870054 
+290177.655495  9110220.945514 
+290163.101899  9110269.147777 
+290141.576164  9110315.333725 
+290126.867240  9110342.440709 
+290113.144813  9110368.544189 
+290098.398891  9110390.628483 
+290084.646863  9110412.713811 
+290079.736478  9110420.744934 
+290057.105805  9110451.861776 
+290040.408983  9110478.966680 
+290032.783009  9110523.158050 
+290023.021346  9110547.256594 
+290031.157460  9110572.378324 
+290079.910834  9110579.460815 
+290099.840808  9110586.513266 
+290117.768174  9110591.554565 
+290151.716452  9110612.684979 
+290171.602065  9110613.710171 
+290179.656908  9110627.781946 
+290181.844453  9110654.906505 
+290183.023297  9110680.020958 
+290179.180801  9110698.098493 
+290171.510598  9110736.262637 
+290161.756395  9110761.365739 
+290139.118278  9110791.478108 
+290109.604086  9110832.633151 
+290080.045468  9110867.760964 
+290046.592486  9110913.934544 
+290020.022923  9110950.069978 
+290042.979204  9110963.152743 
+290101.834944  9110992.345260 
+290173.663497  9111028.582836 
+290238.512500  9111061.799460 
+290258.472318  9111072.869929 
+290294.401492  9111092.997652 
+290369.234282  9111132.251529 
+290389.186749  9111142.317389 
+290392.183322  9111144.329535 
+290412.128393  9111153.390848 
+290475.998583  9111188.615092 
+290525.879865  9111213.779575 
+290552.804664  9111225.861566 
+290566.756620  9111230.898530 
+290603.516921  9111228.927210 
+290634.261809  9111219.918007 
+290686.709895  9111188.831445 
+290735.211870  9111161.758904 
+290794.594993  9111127.665770 
+290786.517617  9111110.580573 
+290772.424851  9111086.457539 
+290752.294474  9111052.283056 
+290749.283074  9111048.261869 
+290732.171544  9111019.113091 
+290707.012370  9110976.897210 
+290685.880780  9110941.717120 
+290663.747903  9110905.531458 
+290639.590196  9110864.321063 
+290633.530404  9110851.255991 
+290644.381959  9110840.217346 
+290660.128986  9110819.138460 
+290681.795018  9110792.038491 
+290699.470561  9110762.925368 
+290718.169633  9110737.831399 
+290721.114317  9110732.811789 
+290744.619897  9110685.623171 
+290766.182082  9110644.459714 
+290790.622210  9110589.235843 
+290801.362513  9110563.129179 
+290802.326777  9110559.112064 
+290816.983407  9110524.973207 
+290826.663086  9110489.824723 
+290837.351482  9110456.686326 
+290849.011538  9110420.535348 
+290857.808447  9110400.453849 
+290870.751412  9110403.480687 
+290902.600760  9110409.540457 
+290947.444972  9110425.658746 
+291004.312424  9110454.848089 
+291022.247164  9110460.893550 
+291201.104941  9110320.442422 
+291195.082205  9110312.400101 
+291171.013534  9110283.244399 
+291143.963202  9110254.085638 
+291112.863162  9110214.877477 
+291088.757528  9110180.699044 
+291077.683793  9110161.601770 
+291075.673758  9110158.586144 
+291066.602655  9110141.499959 
+291055.514114  9110120.393610 
+291039.426458  9110095.264045 
+291023.331410  9110069.129938 
+291006.272138  9110047.012934 
+290980.245607  9110021.873163 
+290956.251355  9110002.762604 
+290905.333098  9109971.570107 
+290905.296051  9109966.547440 
+290908.114721  9109944.450768 
+290914.894139  9109920.349108 
+290917.786901  9109908.297768 
+290928.490009  9109877.168455 
+290942.130319  9109840.015002 
+290951.891383  9109815.916402 
+290960.880844  9109821.952775 
+290990.875373  9109846.092130 
+290996.816478  9109843.084642 
+291039.353606  9109816.006028 
+291127.416766  9109762.856296 
+291184.773043  9109723.738435 
+291200.586241  9109711.700287 
+291238.205580  9109691.648189 
+291199.073350  9109641.382044 
+Region 1
+108
+290392.183322  9111144.329535 
+290389.186749  9111142.317389 
+290369.234282  9111132.251529 
+290294.401492  9111092.997652 
+290258.472318  9111072.869929 
+290238.512500  9111061.799460 
+290173.663497  9111028.582836 
+290101.834944  9110992.345260 
+290042.979204  9110963.152743 
+290020.022923  9110950.069978 
+290046.592486  9110913.934544 
+290080.045468  9110867.760964 
+290109.604086  9110832.633151 
+290139.118278  9110791.478108 
+290161.756395  9110761.365739 
+290171.510598  9110736.262637 
+290179.180801  9110698.098493 
+290183.023297  9110680.020958 
+290181.844453  9110654.906505 
+290179.656908  9110627.781946 
+290171.602065  9110613.710171 
+290151.716452  9110612.684979 
+290117.768174  9110591.554565 
+290099.840808  9110586.513266 
+290079.910834  9110579.460815 
+290031.157460  9110572.378324 
+290032.188337  9110577.402048 
+290030.422321  9110607.536107 
+290034.664142  9110643.703604 
+290035.887268  9110674.845305 
+290040.047775  9110699.962885 
+290042.213068  9110724.073856 
+290041.492754  9110761.240710 
+290038.621930  9110776.305669 
+290036.752415  9110792.376201 
+290024.112509  9110830.535178 
+290006.436451  9110859.648144 
+290003.499066  9110865.672265 
+289992.743439  9110889.769786 
+289983.018692  9110918.891030 
+289967.278664  9110940.974298 
+289950.566883  9110966.070142 
+289926.934610  9110996.181424 
+289909.214082  9111019.267150 
+289885.530008  9111042.346655 
+289853.887138  9111064.413317 
+289835.106098  9111078.457146 
+289808.395834  9111095.506281 
+289774.654174  9111102.502747 
+289738.917260  9111108.492573 
+289690.214981  9111108.441612 
+289645.451448  9111103.372067 
+289611.576761  9111092.286704 
+289585.660865  9111082.214197 
+289565.671593  9111067.125234 
+289560.672430  9111063.101856 
+289526.738702  9111043.980096 
+289491.781540  9111020.839097 
+289469.774941  9111001.729824 
+289462.773181  9110995.695259 
+289416.642004  9111075.004786 
+289431.720685  9111098.124920 
+289450.686484  9111109.194742 
+289501.590833  9111138.379719 
+289522.551898  9111150.456131 
+289544.477356  9111158.515415 
+289569.443689  9111174.614133 
+289593.349628  9111181.670934 
+289610.275925  9111185.706809 
+289628.203537  9111190.748258 
+289647.132466  9111196.795279 
+289661.106544  9111204.846166 
+289687.096418  9111224.964002 
+289707.078411  9111239.048345 
+289733.068322  9111259.166144 
+289754.059052  9111275.260576 
+289764.064850  9111284.311807 
+289784.069065  9111301.409721 
+289822.119255  9111339.621590 
+289836.152549  9111355.708712 
+289849.191925  9111371.794792 
+289860.236057  9111386.874256 
+289871.258014  9111398.940102 
+289878.326441  9111414.015418 
+289886.507125  9111445.164376 
+289884.696746  9111469.271220 
+289947.410551  9111482.395334 
+289961.103680  9111452.273665 
+289972.882904  9111432.195306 
+289997.435254  9111392.039618 
+290022.068939  9111362.933836 
+290041.740355  9111334.827428 
+290067.375309  9111306.727204 
+290095.940217  9111271.598306 
+290105.931267  9111278.640372 
+290125.898575  9111290.715420 
+290151.859049  9111306.814780 
+290190.799791  9111330.963784 
+290231.721021  9111354.110263 
+290273.643617  9111378.262258 
+290286.646108  9111389.325493 
+290296.407689  9111365.226891 
+290313.052706  9111331.090111 
+290325.707194  9111294.940157 
+290341.373057  9111262.811423 
+290358.982323  9111224.657525 
+290376.524924  9111177.462806 
+290392.183322  9111144.329535 
+Region 1
+58
+291374.594993  9110798.771553 
+291342.552358  9110766.594402 
+291298.471542  9110719.337172 
+291254.390821  9110672.079876 
+291241.336463  9110653.985205 
+291227.273370  9110633.880456 
+291200.163389  9110596.685539 
+291175.019009  9110556.479022 
+291153.961564  9110531.344501 
+291136.998438  9110522.286519 
+291080.160510  9110497.115513 
+291018.293797  9110463.903088 
+291022.247164  9110460.893550 
+291004.312424  9110454.848089 
+290947.444972  9110425.658746 
+290902.600760  9110409.540457 
+290870.751412  9110403.480687 
+290857.808447  9110400.453849 
+290849.011538  9110420.535348 
+290837.351482  9110456.686326 
+290826.663086  9110489.824723 
+290816.983407  9110524.973207 
+290802.326777  9110559.112064 
+290801.362513  9110563.129179 
+290790.622210  9110589.235843 
+290766.182082  9110644.459714 
+290744.619897  9110685.623171 
+290721.114317  9110732.811789 
+290718.169633  9110737.831399 
+290699.470561  9110762.925368 
+290681.795018  9110792.038491 
+290660.128986  9110819.138460 
+290644.381959  9110840.217346 
+290633.530404  9110851.255991 
+290639.590196  9110864.321063 
+290663.747903  9110905.531458 
+290685.880780  9110941.717120 
+290707.012370  9110976.897210 
+290732.171544  9111019.113091 
+290749.283074  9111048.261869 
+290752.294474  9111052.283056 
+290772.424851  9111086.457539 
+290786.517617  9111110.580573 
+290794.594993  9111127.665770 
+290833.261438  9111114.646453 
+290899.646317  9111086.587517 
+290948.199930  9111066.546530 
+291008.650811  9111042.499515 
+291038.401518  9111033.489073 
+291086.005584  9111019.474144 
+291206.966290  9110979.415992 
+291172.364373  9110869.887792 
+291223.921582  9110852.863210 
+291274.469985  9110833.828509 
+291326.093901  9110825.844604 
+291383.658965  9110814.853083 
+291389.637268  9110816.868172 
+291374.594993  9110798.771553 
+Region 1
+85
+292137.748352  9110642.831886 
+292257.109763  9110521.403789 
+292058.632262  9110427.785930 
+291996.794999  9110398.593100 
+291985.817523  9110392.555007 
+291772.380487  9110291.889008 
+291733.469974  9110271.759459 
+291721.483798  9110263.711229 
+291703.519400  9110253.647934 
+291688.521836  9110241.578574 
+291677.522141  9110232.526801 
+291666.522451  9110223.475023 
+291652.518800  9110211.406649 
+291639.479342  9110195.321154 
+291627.448641  9110181.245714 
+291481.997875  9110000.284674 
+291403.762044  9109903.771137 
+291349.572732  9109833.399452 
+291238.205580  9109691.648189 
+291200.586241  9109711.700287 
+291184.773043  9109723.738435 
+291127.416766  9109762.856296 
+291039.353606  9109816.006028 
+290996.816478  9109843.084642 
+290990.875373  9109846.092130 
+290960.880844  9109821.952775 
+290951.891383  9109815.916402 
+290942.130319  9109840.015002 
+290928.490009  9109877.168455 
+290917.786901  9109908.297768 
+290914.894139  9109920.349108 
+290908.114721  9109944.450768 
+290905.296051  9109966.547440 
+290905.333098  9109971.570107 
+290956.251355  9110002.762604 
+290980.245607  9110021.873163 
+291006.272138  9110047.012934 
+291023.331410  9110069.129938 
+291039.426458  9110095.264045 
+291055.514114  9110120.393610 
+291066.602655  9110141.499959 
+291075.673758  9110158.586144 
+291077.683793  9110161.601770 
+291088.757528  9110180.699044 
+291112.863162  9110214.877477 
+291143.963202  9110254.085638 
+291171.013534  9110283.244399 
+291195.082205  9110312.400101 
+291201.104941  9110320.442422 
+291022.247164  9110460.893550 
+291018.293797  9110463.903088 
+291080.160510  9110497.115513 
+291136.998438  9110522.286519 
+291153.961564  9110531.344501 
+291175.019009  9110556.479022 
+291200.163389  9110596.685539 
+291227.273370  9110633.880456 
+291241.336463  9110653.985205 
+291254.390821  9110672.079876 
+291298.471542  9110719.337172 
+291342.552358  9110766.594402 
+291374.594993  9110798.771553 
+291389.637268  9110816.868172 
+291404.560751  9110818.892300 
+291414.678053  9110843.011065 
+291421.724528  9110855.072453 
+291427.918194  9110886.218907 
+291445.208281  9110939.476048 
+291449.280477  9110952.538948 
+291460.235786  9110955.563565 
+291505.829432  9110938.532649 
+291577.205265  9110913.491469 
+291637.759457  9110903.507141 
+291684.413743  9110895.517829 
+291699.307514  9110893.523736 
+291757.881231  9110884.541793 
+291814.415050  9110868.526094 
+291884.781715  9110841.474441 
+291942.197748  9110810.391689 
+291988.688175  9110780.302501 
+292000.540651  9110770.269129 
+292035.126461  9110743.181591 
+292055.879413  9110727.129966 
+292098.319654  9110686.991474 
+292137.748352  9110642.831886 
+Region 1
+34
+291134.422110  9111787.984064 
+291141.253409  9111770.914071 
+291029.635629  9111596.013827 
+290979.353052  9111516.605334 
+290939.069268  9111445.243115 
+290883.498525  9111322.634468 
+290819.858155  9111183.945024 
+290794.594993  9111127.665770 
+290735.211870  9111161.758904 
+290686.709895  9111188.831445 
+290634.261809  9111219.918007 
+290643.481300  9111257.094940 
+290651.566079  9111275.184702 
+290657.714898  9111300.304162 
+290660.867133  9111323.411497 
+290642.034457  9111330.423887 
+290608.292909  9111337.420986 
+290579.498738  9111341.409558 
+290751.728623  9111648.970833 
+290805.089282  9111741.441601 
+290753.775603  9111791.615568 
+290777.867348  9111823.784948 
+290820.035410  9111881.085843 
+290857.211648  9111935.368022 
+290883.298849  9111968.543862 
+290919.325465  9112001.729767 
+290946.302786  9112020.843109 
+290992.231755  9112049.016355 
+291042.077134  9112069.157312 
+291076.968919  9112083.255943 
+291108.797221  9112086.301686 
+291112.810103  9112091.328359 
+291121.599602  9112070.242243 
+291134.422110  9111787.984064 
+Region 1
+125
+291108.797221  9112086.301686 
+291076.968919  9112083.255943 
+291042.077134  9112069.157312 
+290992.231755  9112049.016355 
+290946.302786  9112020.843109 
+290919.325465  9112001.729767 
+290883.298849  9111968.543862 
+290857.211648  9111935.368022 
+290820.035410  9111881.085843 
+290777.867348  9111823.784948 
+290753.775603  9111791.615568 
+290805.089282  9111741.441601 
+290751.728623  9111648.970833 
+290579.498738  9111341.409558 
+290608.292909  9111337.420986 
+290642.034457  9111330.423887 
+290660.867133  9111323.411497 
+290657.714898  9111300.304162 
+290651.566079  9111275.184702 
+290643.481300  9111257.094940 
+290634.261809  9111219.918007 
+290603.516921  9111228.927210 
+290566.756620  9111230.898530 
+290552.804664  9111225.861566 
+290525.879865  9111213.779575 
+290475.998583  9111188.615092 
+290412.128393  9111153.390848 
+290392.183322  9111144.329535 
+290376.524924  9111177.462806 
+290358.982323  9111224.657525 
+290341.373057  9111262.811423 
+290325.707194  9111294.940157 
+290313.052706  9111331.090111 
+290296.407689  9111365.226891 
+290286.646108  9111389.325493 
+290273.643617  9111378.262258 
+290231.721021  9111354.110263 
+290190.799791  9111330.963784 
+290151.859049  9111306.814780 
+290125.898575  9111290.715420 
+290105.931267  9111278.640372 
+290095.940217  9111271.598306 
+290067.375309  9111306.727204 
+290041.740355  9111334.827428 
+290022.068939  9111362.933836 
+289997.435254  9111392.039618 
+289972.882904  9111432.195306 
+289961.103680  9111452.273665 
+289947.410551  9111482.395334 
+289884.696746  9111469.271220 
+289874.949705  9111495.378865 
+289861.093819  9111503.400685 
+289830.392838  9111518.436671 
+289812.568598  9111527.458877 
+289798.742262  9111539.498837 
+289784.901132  9111549.529717 
+289779.983218  9111556.556305 
+289761.342449  9111589.686388 
+289740.765536  9111629.846166 
+289704.012099  9111632.821408 
+289661.346772  9111642.822165 
+289604.747896  9111785.406498 
+289639.676216  9111804.529093 
+289673.662368  9111830.682388 
+289707.596804  9111849.803878 
+289745.507026  9111868.929476 
+289776.459689  9111888.047793 
+289772.587457  9111902.107193 
+289756.765739  9111913.140559 
+289750.846458  9111919.161581 
+289751.892163  9111926.194385 
+289759.086397  9111958.346861 
+289771.479628  9112021.645194 
+289781.855438  9112080.923294 
+289791.222555  9112138.191274 
+289796.369815  9112162.305355 
+289803.608542  9112200.485033 
+289816.046370  9112269.810545 
+289819.116996  9112281.868097 
+289827.275749  9112310.003412 
+289840.818624  9112394.397997 
+289852.716445  9112390.392211 
+289873.530226  9112382.377543 
+289893.342645  9112373.357299 
+289911.167154  9112364.334990 
+289931.951302  9112352.302151 
+289954.701133  9112337.257749 
+289968.564617  9112330.240384 
+289975.514862  9112329.243043 
+289986.455708  9112330.258887 
+289992.419405  9112330.265053 
+290011.289639  9112328.275499 
+290022.223081  9112328.286797 
+290054.029455  9112328.319648 
+290076.860666  9112324.325100 
+290107.643460  9112320.338743 
+290122.515663  9112315.331435 
+290146.325990  9112309.328807 
+290175.113455  9112304.335823 
+290195.978953  9112303.352780 
+290224.788623  9112301.373374 
+290247.627193  9112298.383282 
+290298.333323  9112300.444454 
+290349.039445  9112302.505569 
+290385.852534  9112307.565965 
+290437.567415  9112311.637066 
+290481.308479  9112312.686367 
+290538.964783  9112313.749847 
+290582.720659  9112316.808117 
+290654.284763  9112316.881119 
+290696.045314  9112318.932717 
+290717.837931  9112308.909649 
+290746.521380  9112289.852854 
+290785.159083  9112272.815217 
+290789.120019  9112270.810194 
+290815.874882  9112259.787607 
+290829.752990  9112254.779080 
+290867.389253  9112236.735846 
+290902.036231  9112217.685030 
+290949.574726  9112194.629163 
+290993.152247  9112173.578295 
+291057.520787  9112141.498661 
+291114.004543  9112118.451704 
+291112.810103  9112091.328359 
+291108.797221  9112086.301686 
+Region 1
+55
+293560.092616  9113324.260277 
+293546.265389  9113202.701369 
+293528.522402  9113089.174792 
+293520.144199  9113031.909706 
+293510.974155  9113001.765648 
+293407.813245  9113029.793573 
+293396.849900  9113025.765059 
+293170.259350  9112895.965968 
+292877.785820  9112727.930179 
+292846.054315  9112737.944594 
+292830.285633  9112756.010576 
+292820.413400  9112765.041640 
+292786.125627  9112832.310879 
+292780.266489  9112846.368403 
+292797.223315  9112854.420957 
+292808.194063  9112859.454161 
+292824.156950  9112867.505739 
+292835.172513  9112878.566064 
+292843.206241  9112889.623499 
+292850.268433  9112903.693534 
+292854.333850  9112915.751639 
+292861.433398  9112934.844277 
+292861.530499  9112947.903056 
+292860.656061  9112963.974437 
+292859.841381  9112988.081989 
+292858.877310  9112992.099113 
+292856.941698  9112999.128841 
+292854.183938  9113029.261599 
+292842.458215  9113056.372143 
+292836.681248  9113081.479412 
+292835.724645  9113086.501058 
+292836.860520  9113105.587927 
+292838.908181  9113113.626021 
+292839.005289  9113126.684800 
+292833.101334  9113134.715205 
+292831.143308  9113138.731369 
+292843.123027  9113145.774550 
+292849.168915  9113156.830050 
+292853.271723  9113173.910755 
+292857.374535  9113190.991459 
+292856.417934  9113196.013105 
+292868.509738  9113218.124094 
+292871.596196  9113232.190271 
+292876.610795  9113238.222196 
+292879.622543  9113242.243159 
+292910.577100  9113261.358793 
+292903.791275  9113284.456065 
+292892.132804  9113320.607316 
+292888.358726  9113347.725550 
+292880.623763  9113376.848991 
+292871.820114  9113395.926263 
+292866.080528  9113426.056144 
+292860.363355  9113459.199589 
+293127.267117  9113396.171978 
+293560.092616  9113324.260277 
+Region 1
+73
+292879.622543  9113242.243159 
+292876.610795  9113238.222196 
+292871.596196  9113232.190271 
+292868.509738  9113218.124094 
+292856.417934  9113196.013105 
+292857.374535  9113190.991459 
+292853.271723  9113173.910755 
+292849.168915  9113156.830050 
+292843.123027  9113145.774550 
+292831.143308  9113138.731369 
+292833.101334  9113134.715205 
+292839.005289  9113126.684800 
+292838.908181  9113113.626021 
+292836.860520  9113105.587927 
+292835.724645  9113086.501058 
+292836.681248  9113081.479412 
+292842.458215  9113056.372143 
+292854.183938  9113029.261599 
+292856.941698  9112999.128841 
+292858.877310  9112992.099113 
+292859.841381  9112988.081989 
+292860.656061  9112963.974437 
+292861.530499  9112947.903056 
+292861.433398  9112934.844277 
+292854.333850  9112915.751639 
+292850.268433  9112903.693534 
+292843.206241  9112889.623499 
+292835.172513  9112878.566064 
+292824.156950  9112867.505739 
+292808.194063  9112859.454161 
+292797.223315  9112854.420957 
+292780.266489  9112846.368403 
+292786.125627  9112832.310879 
+292820.413400  9112765.041640 
+292830.285633  9112756.010576 
+292846.054315  9112737.944594 
+292771.687725  9112761.980849 
+292706.236678  9112782.007602 
+292673.503661  9112791.016426 
+292580.438409  9112840.147119 
+292487.380383  9112890.282191 
+292455.700842  9112907.328043 
+292352.740279  9112962.475818 
+292237.911640  9113025.647917 
+292192.338896  9113045.693556 
+292170.509186  9113050.694713 
+292197.614333  9113086.883954 
+292203.630249  9113093.921479 
+292315.711991  9113330.092764 
+292346.023145  9113396.420478 
+292219.042250  9113429.445396 
+292250.168331  9113471.665575 
+292382.520530  9113626.490354 
+292397.579270  9113646.595349 
+292505.001183  9113790.345583 
+292600.317573  9113776.374802 
+292608.418682  9113796.472952 
+292657.990095  9113779.444181 
+292682.569927  9113876.905881 
+292734.749473  9113943.254230 
+292753.717111  9113954.322185 
+292776.615802  9113959.366835 
+292787.302863  9113926.228170 
+292855.595306  9113486.316866 
+292860.363355  9113459.199589 
+292866.080528  9113426.056144 
+292871.820114  9113395.926263 
+292880.623763  9113376.848991 
+292888.358726  9113347.725550 
+292892.132804  9113320.607316 
+292903.791275  9113284.456065 
+292910.577100  9113261.358793 
+292879.622543  9113242.243159 
+Region 1
+76
+292877.785820  9112727.930179 
+292873.795111  9112725.917287 
+292765.007326  9112665.540948 
+292597.435455  9112586.021213 
+292469.733554  9112521.607480 
+292402.893439  9112488.393001 
+292387.932138  9112481.346723 
+292296.169081  9112438.062446 
+292232.355703  9112410.877735 
+292215.391662  9112401.820380 
+292164.484669  9112372.639218 
+292160.494012  9112370.626249 
+292098.549467  9112327.370855 
+292036.597584  9112283.110822 
+291957.674426  9112228.788670 
+291895.782343  9112192.564594 
+291840.010253  9112177.441409 
+291790.239010  9112167.346718 
+291776.309017  9112165.323816 
+291724.564792  9112157.236123 
+291707.652990  9112155.210227 
+291671.834074  9112150.151903 
+291365.552680  9112129.754854 
+291261.137168  9112122.618184 
+291195.507519  9112118.533962 
+291148.762696  9112114.468708 
+291114.004543  9112118.451704 
+291057.520787  9112141.498661 
+290993.152247  9112173.578295 
+290949.574726  9112194.629163 
+290902.036231  9112217.685030 
+290867.389253  9112236.735846 
+290829.752990  9112254.779080 
+290815.874882  9112259.787607 
+290789.120019  9112270.810194 
+290785.159083  9112272.815217 
+290746.521380  9112289.852854 
+290717.837931  9112308.909649 
+290696.045314  9112318.932717 
+290678.369404  9112348.045961 
+290666.634903  9112374.151679 
+290641.244729  9112435.401890 
+290618.695427  9112477.569002 
+290631.676109  9112485.618438 
+290725.686079  9112564.067115 
+290835.398545  9112480.802931 
+290874.051186  9112465.774254 
+290901.763761  9112584.336234 
+291009.288596  9112608.553542 
+291257.175953  9112662.042913 
+291266.136369  9112664.060955 
+291281.298338  9112698.229939 
+291353.281502  9112889.161308 
+291437.529629  9112857.100860 
+291587.184999  9112798.987937 
+291737.826390  9112739.871067 
+291764.588581  9112729.852438 
+291855.801047  9112698.802781 
+291989.596633  9112646.700164 
+292055.715545  9112850.682689 
+292065.684851  9112854.710587 
+292068.711409  9112860.740679 
+292140.429680  9113015.507039 
+292164.493281  9113043.657180 
+292170.509186  9113050.694713 
+292192.338896  9113045.693556 
+292237.911640  9113025.647917 
+292352.740279  9112962.475818 
+292455.700842  9112907.328043 
+292487.380383  9112890.282191 
+292580.438409  9112840.147119 
+292673.503661  9112791.016426 
+292706.236678  9112782.007602 
+292771.687725  9112761.980849 
+292846.054315  9112737.944594 
+292877.785820  9112727.930179 
+Region 1
+30
+291790.239010  9112167.346718 
+291783.050781  9112136.199442 
+291771.871945  9112103.039148 
+291743.565614  9112038.721651 
+291738.506671  9112026.662364 
+291721.208099  9111972.401009 
+291715.013911  9111941.254693 
+291500.064322  9111905.881448 
+291526.001016  9111784.360335 
+291441.383228  9111766.194005 
+291377.675141  9111753.071158 
+291335.878094  9111745.997423 
+291301.045986  9111739.935190 
+291264.255731  9111737.889045 
+291229.490464  9111740.867529 
+291181.863497  9111751.869180 
+291141.253409  9111770.914071 
+291134.422110  9111787.984064 
+291121.599602  9112070.242243 
+291112.810103  9112091.328359 
+291114.004543  9112118.451704 
+291148.762696  9112114.468708 
+291195.507519  9112118.533962 
+291261.137168  9112122.618184 
+291365.552680  9112129.754854 
+291671.834074  9112150.151903 
+291707.652990  9112155.210227 
+291724.564792  9112157.236123 
+291776.309017  9112165.323816 
+291790.239010  9112167.346718 
+Region 1
+33
+292210.117051  9111690.616478 
+292278.812702  9111572.151208 
+292191.909654  9111513.803272 
+292144.964597  9111482.616723 
+292054.998231  9111413.215695 
+291994.034321  9111367.951746 
+291946.050969  9111330.736770 
+291853.185239  9111272.382028 
+291688.088193  9111526.360727 
+291686.130089  9111530.376852 
+291634.106403  9111618.722631 
+291642.102414  9111624.757762 
+291658.072138  9111633.814435 
+291679.078418  9111651.916826 
+291690.160327  9111672.018324 
+291697.221921  9111686.088674 
+291701.338925  9111705.178683 
+291704.491754  9111728.285810 
+291707.808209  9111773.492555 
+291710.629085  9111886.001684 
+291711.883350  9111921.161157 
+291715.013911  9111941.254693 
+291721.208099  9111972.401009 
+291738.506671  9112026.662364 
+291743.565614  9112038.721651 
+291765.380078  9112031.711746 
+291779.354672  9112039.761827 
+291853.262978  9112088.052319 
+291892.618429  9112033.847362 
+291950.586638  9112077.099239 
+292011.532978  9111985.748421 
+292092.141730  9111865.285999 
+292210.117051  9111690.616478 
+Region 1
+77
+293355.301623  9111048.845678 
+293159.802112  9110955.236627 
+293154.810204  9110952.218239 
+293036.110408  9110894.845514 
+292913.427793  9110836.463999 
+292903.451486  9110831.431676 
+292687.993507  9110726.750944 
+292640.114895  9110703.600001 
+292594.231573  9110681.455477 
+292570.795211  9110737.685324 
+292543.316142  9110784.870536 
+292509.910853  9110837.072486 
+292445.072984  9110939.469275 
+292386.261219  9110916.307297 
+292373.270045  9111040.854637 
+292346.542876  9111189.496840 
+292375.641938  9111226.692718 
+292389.653559  9111239.765269 
+292424.671471  9111270.939834 
+292191.909654  9111513.803272 
+292278.812702  9111572.151208 
+292210.117051  9111690.616478 
+292092.141730  9111865.285999 
+292011.532978  9111985.748421 
+291950.586638  9112077.099239 
+291892.618429  9112033.847362 
+291853.262978  9112088.052319 
+291779.354672  9112039.761827 
+291765.380078  9112031.711746 
+291743.565614  9112038.721651 
+291771.871945  9112103.039148 
+291783.050781  9112136.199442 
+291790.239010  9112167.346718 
+291840.010253  9112177.441409 
+291895.782343  9112192.564594 
+291957.674426  9112228.788670 
+292036.597584  9112283.110822 
+292098.549467  9112327.370855 
+292160.494012  9112370.626249 
+292164.484669  9112372.639218 
+292215.391662  9112401.820380 
+292232.355703  9112410.877735 
+292296.169081  9112438.062446 
+292387.932138  9112481.346723 
+292402.893439  9112488.393001 
+292469.733554  9112521.607480 
+292597.435455  9112586.021213 
+292765.007326  9112665.540948 
+292873.795111  9112725.917287 
+292877.785820  9112727.930179 
+293170.259350  9112895.965968 
+293396.849900  9113025.765059 
+293407.813245  9113029.793573 
+293510.974155  9113001.765648 
+293499.786304  9112967.601620 
+293436.702758  9112771.661761 
+293381.750935  9112599.837738 
+293324.744510  9112418.970959 
+293290.113475  9112306.432340 
+293272.827944  9112254.181081 
+293265.698517  9112231.070439 
+293250.400920  9112178.821070 
+293242.113181  9112133.610026 
+293234.752141  9112079.359255 
+293218.363606  9112014.050134 
+293211.174497  9111982.903305 
+293208.947554  9111950.756747 
+293213.693028  9111920.625940 
+293230.148898  9111861.375561 
+293245.707953  9111815.182985 
+293262.231019  9111764.973289 
+293277.857275  9111727.821392 
+293278.828779  9111724.808792 
+293337.544726  9111734.910497 
+293789.205136  9111258.200908 
+293490.965711  9111115.274316 
+293355.301623  9111048.845678 
+Region 1
+75
+292375.641938  9111226.692718 
+292346.542876  9111189.496840 
+292373.270045  9111040.854637 
+292056.139789  9110762.288402 
+292035.126461  9110743.181591 
+292000.540651  9110770.269129 
+291988.688175  9110780.302501 
+291942.197748  9110810.391689 
+291884.781715  9110841.474441 
+291814.415050  9110868.526094 
+291757.881231  9110884.541793 
+291699.307514  9110893.523736 
+291684.413743  9110895.517829 
+291637.759457  9110903.507141 
+291577.205265  9110913.491469 
+291505.829432  9110938.532649 
+291460.235786  9110955.563565 
+291449.280477  9110952.538948 
+291445.208281  9110939.476048 
+291427.918194  9110886.218907 
+291421.724528  9110855.072453 
+291414.678053  9110843.011065 
+291404.560751  9110818.892300 
+291389.637268  9110816.868172 
+291383.658965  9110814.853083 
+291326.093901  9110825.844604 
+291274.469985  9110833.828509 
+291223.921582  9110852.863210 
+291172.364373  9110869.887792 
+291206.966290  9110979.415992 
+291086.005584  9111019.474144 
+291038.401518  9111033.489073 
+291008.650811  9111042.499515 
+290948.199930  9111066.546530 
+290899.646317  9111086.587517 
+290833.261438  9111114.646453 
+290794.594993  9111127.665770 
+290819.858155  9111183.945024 
+290883.498525  9111322.634468 
+290939.069268  9111445.243115 
+290979.353052  9111516.605334 
+291029.635629  9111596.013827 
+291141.253409  9111770.914071 
+291181.863497  9111751.869180 
+291229.490464  9111740.867529 
+291264.255731  9111737.889045 
+291301.045986  9111739.935190 
+291335.878094  9111745.997423 
+291377.675141  9111753.071158 
+291441.383228  9111766.194005 
+291526.001016  9111784.360335 
+291500.064322  9111905.881448 
+291715.013911  9111941.254693 
+291711.883350  9111921.161157 
+291710.629085  9111886.001684 
+291707.808209  9111773.492555 
+291704.491754  9111728.285810 
+291701.338925  9111705.178683 
+291697.221921  9111686.088674 
+291690.160327  9111672.018324 
+291679.078418  9111651.916826 
+291658.072138  9111633.814435 
+291642.102414  9111624.757762 
+291634.106403  9111618.722631 
+291686.130089  9111530.376852 
+291688.088193  9111526.360727 
+291853.185239  9111272.382028 
+291946.050969  9111330.736770 
+291994.034321  9111367.951746 
+292054.998231  9111413.215695 
+292144.964597  9111482.616723 
+292191.909654  9111513.803272 
+292424.671471  9111270.939834 
+292389.653559  9111239.765269 
+292375.641938  9111226.692718 
+Region 1
+15
+292570.795211  9110737.685324 
+292594.231573  9110681.455477 
+292500.469791  9110636.159771 
+292257.109763  9110521.403789 
+292137.748352  9110642.831886 
+292098.319654  9110686.991474 
+292055.879413  9110727.129966 
+292035.126461  9110743.181591 
+292056.139789  9110762.288402 
+292373.270045  9111040.854637 
+292386.261219  9110916.307297 
+292445.072984  9110939.469275 
+292509.910853  9110837.072486 
+292543.316142  9110784.870536 
+292570.795211  9110737.685324 
+Region 1
+261
+289102.061675  9119239.515092 
+288888.087294  9117589.854552 
+288891.002838  9117580.816761 
+288871.039954  9117569.746319 
+288993.577296  9117606.035671 
+289017.734984  9117242.419830 
+288972.742923  9117207.214842 
+288944.857348  9117200.154360 
+288922.839869  9117180.040987 
+288909.783770  9117161.945918 
+288898.767641  9117150.884680 
+288878.753137  9117132.782410 
+288858.783074  9117120.707373 
+288848.812854  9117116.678932 
+288843.827744  9117114.664710 
+288824.910983  9117110.627010 
+288807.974941  9117105.586818 
+288775.119131  9117098.521066 
+288764.214074  9117102.527905 
+288754.325281  9117109.549396 
+288747.440873  9117119.587600 
+288737.537271  9117124.600006 
+288729.495965  9117112.537264 
+288725.416106  9117098.469560 
+288724.377638  9117092.441279 
+288724.325831  9117085.409488 
+288725.164471  9117064.315145 
+288741.945068  9117048.260001 
+288752.761300  9117032.198672 
+288755.669463  9117022.156349 
+288754.549583  9117005.078113 
+288750.491936  9116994.024034 
+288747.398747  9116978.952819 
+288747.309937  9116966.898320 
+288732.354668  9116960.855605 
+288720.374175  9116953.811437 
+288710.344801  9116941.746619 
+288709.202747  9116921.654752 
+288723.980399  9116903.588478 
+288743.757920  9116889.545525 
+288772.333911  9116855.421015 
+288827.586483  9116799.224405 
+288808.381216  9116756.009555 
+288785.318190  9116728.863226 
+288763.345442  9116714.776950 
+288762.158998  9116688.657837 
+288764.087904  9116680.623568 
+288763.056855  9116675.599828 
+288765.987211  9116668.571133 
+288690.513298  9116678.538058 
+288614.920980  9116672.432186 
+288538.319812  9116664.316062 
+288490.501795  9116650.202657 
+288462.520480  9116630.082716 
+288457.483688  9116621.036632 
+288477.893025  9116557.772225 
+288516.646189  9116555.803639 
+288507.507517  9116529.676176 
+288500.423492  9116512.591674 
+288431.494102  9116466.310956 
+288369.523172  9116420.037394 
+288341.490339  9116392.885522 
+288243.335061  9116292.328772 
+288079.130419  9116131.429749 
+288002.992783  9116050.986219 
+288033.490735  9116007.823346 
+288051.154682  9115976.701349 
+288054.085141  9115969.672682 
+288060.910576  9115951.598217 
+288061.845575  9115943.562902 
+288062.773194  9115934.523041 
+288064.576774  9115909.411500 
+288061.461824  9115891.326522 
+288060.290677  9115867.216371 
+288148.917608  9115618.184726 
+288215.079812  9115423.374388 
+288223.162559  9115305.852059 
+288220.047650  9115287.767092 
+288211.940490  9115266.663232 
+288214.686418  9115234.520938 
+288214.642142  9115228.493666 
+288226.230956  9115182.297204 
+288170.794476  9115213.379193 
+288157.092126  9115242.496277 
+288165.214012  9115265.609245 
+288175.309200  9115286.715223 
+288166.495800  9115304.787572 
+288152.668000  9115316.827386 
+288126.926647  9115330.863654 
+288118.989201  9115332.864321 
+288110.050352  9115333.859388 
+288098.166312  9115339.874022 
+288090.265749  9115346.897414 
+288078.389079  9115353.916590 
+288071.489913  9115361.945580 
+288062.610069  9115370.977007 
+288051.727414  9115377.997233 
+288046.779411  9115381.005599 
+288038.871456  9115387.024440 
+288030.963498  9115393.043279 
+288024.056941  9115400.067719 
+288022.164776  9115413.124711 
+288020.250482  9115423.168063 
+288018.343563  9115434.215962 
+288016.421892  9115443.254769 
+288008.536051  9115452.287246 
+288000.628079  9115458.306084 
+287990.732047  9115464.322811 
+287985.813532  9115471.349359 
+287973.973689  9115483.391251 
+287968.039015  9115487.403104 
+287961.154561  9115497.441179 
+287952.282045  9115507.477142 
+287940.420059  9115516.505390 
+287930.531380  9115523.526655 
+287917.682729  9115533.558389 
+287901.837231  9115541.577857 
+287891.963287  9115550.608210 
+287877.097061  9115556.619635 
+287868.224513  9115566.655589 
+287866.310186  9115576.698944 
+287864.395858  9115586.742299 
+287865.471000  9115597.793373 
+287868.622695  9115620.901125 
+287869.705215  9115632.956746 
+287859.831248  9115641.987098 
+287850.973431  9115654.032147 
+287845.090339  9115665.075820 
+287843.168633  9115674.114629 
+287841.210059  9115678.130703 
+287839.244112  9115681.142229 
+287833.383134  9115695.199544 
+287830.415777  9115697.205466 
+287820.527043  9115704.226719 
+287818.583213  9115710.251887 
+287811.735565  9115725.312691 
+287806.809626  9115731.334685 
+287798.894206  9115736.348958 
+287786.052841  9115747.385222 
+287779.146198  9115754.409646 
+287776.208324  9115760.433755 
+287774.271860  9115767.463470 
+287773.381041  9115781.526075 
+287774.456178  9115792.577155 
+287778.528174  9115805.640504 
+287775.560807  9115807.646424 
+287771.614149  9115811.660381 
+287762.682556  9115813.659951 
+287755.761155  9115818.675279 
+287747.845715  9115823.689547 
+287739.937644  9115829.708362 
+287730.048867  9115836.729606 
+287719.210280  9115849.777076 
+287713.282907  9115854.793459 
+287705.389569  9115862.821366 
+287705.448542  9115870.857747 
+287706.472069  9115874.876998 
+287712.502651  9115883.924282 
+287723.503434  9115892.976860 
+287730.572297  9115908.052485 
+287732.619357  9115916.090983 
+287730.756611  9115933.166175 
+287725.941232  9115954.256381 
+287726.994255  9115962.293820 
+287731.110503  9115981.384457 
+287736.161813  9115992.439770 
+287743.208584  9116004.501746 
+287750.247985  9116015.559172 
+287750.373336  9116032.636478 
+287741.589169  9116054.727003 
+287731.810953  9116076.816470 
+287718.056554  9116098.901707 
+287693.330786  9116115.952563 
+287683.500930  9116131.010194 
+287678.626549  9116144.064022 
+287672.809728  9116164.148626 
+287665.998858  9116184.232172 
+287655.174935  9116199.288744 
+287641.302515  9116205.301206 
+287632.385581  9116209.309866 
+287614.573823  9116220.340826 
+287602.755826  9116235.396332 
+287594.884529  9116246.437883 
+287591.931871  9116250.452896 
+287576.100811  9116260.481418 
+287561.352242  9116282.565576 
+287546.625771  9116307.663378 
+287529.911187  9116332.759057 
+287516.127147  9116350.826077 
+287443.068460  9116419.056830 
+287392.600180  9116450.143651 
+287371.857673  9116468.203206 
+287349.311225  9116511.374362 
+287294.005084  9116560.537687 
+287292.031704  9116562.544657 
+287270.250852  9116574.575823 
+287269.463047  9116602.702151 
+287269.595640  9116620.784047 
+287247.925245  9116647.883458 
+287231.085173  9116655.901744 
+287213.258400  9116664.923509 
+287172.472512  9116660.861585 
+287076.048736  9116660.757993 
+286999.484034  9116657.661962 
+286957.711425  9116654.603319 
+286926.048672  9116674.660048 
+286910.209926  9116683.683855 
+286943.300966  9116722.896744 
+286982.378524  9116765.129672 
+287012.472777  9116802.330167 
+287031.625017  9116838.514320 
+287051.844986  9116884.745034 
+287053.155667  9116927.941787 
+287039.525907  9116967.104314 
+287019.961176  9117010.278636 
+287010.307653  9117049.445438 
+287000.705661  9117095.644099 
+286996.957638  9117126.780906 
+286997.149083  9117152.899232 
+287005.388831  9117192.085262 
+287014.571126  9117224.240498 
+287031.669200  9117251.381511 
+287069.804884  9117300.645013 
+287137.866041  9117364.004094 
+287211.862360  9117423.351200 
+287296.778962  9117480.700700 
+287302.772909  9117484.725256 
+287399.685017  9117551.128156 
+287416.658083  9117561.191612 
+287504.690175  9117636.625630 
+287573.812889  9117709.025768 
+287647.854564  9117774.399169 
+287650.851570  9117776.411415 
+287706.763730  9117809.620260 
+287771.578393  9117836.811166 
+287775.569489  9117838.824450 
+287854.353068  9117873.061702 
+287946.074587  9117909.321448 
+288001.964892  9117939.516202 
+288043.967658  9117973.714477 
+288073.054785  9118008.903722 
+288104.181878  9118051.126827 
+288132.504225  9118117.455846 
+288256.519771  9118489.263485 
+288286.845737  9118557.603430 
+288330.050658  9118619.929483 
+288460.630678  9118802.890074 
+288576.107680  9118959.716588 
+288640.367456  9119046.172636 
+288701.548824  9119119.566440 
+288771.707008  9119196.987443 
+288835.856298  9119268.374939 
+288909.924626  9119336.758826 
+288973.050548  9119404.126854 
+288977.969159  9119397.100146 
+289026.064868  9119448.380238 
+289068.203442  9119500.658727 
+289109.333159  9119550.927067 
+289147.643972  9119623.292161 
+289200.436938  9119772.016161 
+289102.061675  9119239.515092 
+Region 1
+305
+290675.442609  9114910.586861 
+290635.467007  9114881.415433 
+290588.518582  9114850.227882 
+290538.513927  9114808.991929 
+290516.489921  9114787.874668 
+290491.528496  9114772.781578 
+290458.563101  9114750.648698 
+290433.594286  9114734.551033 
+290396.667791  9114714.423140 
+290356.766749  9114695.296720 
+290333.800837  9114681.210067 
+290321.754081  9114665.125424 
+290309.581155  9114631.963693 
+290299.425935  9114602.822109 
+290293.239299  9114572.680024 
+290278.218024  9114557.596863 
+290252.270216  9114543.507116 
+290220.373283  9114531.420353 
+290201.442831  9114525.373926 
+290167.624690  9114522.325912 
+290143.724260  9114516.274396 
+290081.065378  9114511.187856 
+290009.527250  9114515.132908 
+289994.632119  9114517.126738 
+289968.684387  9114503.036802 
+289952.646985  9114484.938877 
+289936.572531  9114461.818261 
+289923.502321  9114441.714300 
+289902.524630  9114427.629402 
+289859.679042  9114413.522061 
+289803.013858  9114412.459363 
+289705.624432  9114415.372814 
+289637.023832  9114413.293091 
+289618.167510  9114417.291771 
+289561.739202  9114448.373999 
+289516.378066  9114497.549166 
+289493.612321  9114510.584546 
+289446.968344  9114520.581629 
+289412.185728  9114521.550167 
+289395.250710  9114516.509975 
+289357.537888  9114524.507157 
+289323.793652  9114531.503896 
+289304.870629  9114526.461606 
+289277.943806  9114514.379274 
+289258.019392  9114508.331391 
+289212.332321  9114513.306576 
+289200.404303  9114513.294173 
+289189.625621  9114534.378148 
+289183.713386  9114541.403728 
+289174.811746  9114547.421664 
+289190.878521  9114569.538093 
+289188.942295  9114576.567808 
+289178.104422  9114589.615462 
+289141.437239  9114604.645305 
+289095.897940  9114629.711215 
+289047.457906  9114665.823933 
+289043.533645  9114672.851575 
+289023.934505  9114711.003408 
+289008.096941  9114720.027691 
+288969.441558  9114735.055360 
+288964.508486  9114740.072879 
+288956.593388  9114745.087284 
+288950.636734  9114746.085598 
+288939.732216  9114750.092346 
+288929.829097  9114755.104671 
+288919.940760  9114762.126078 
+288908.020050  9114763.118156 
+288898.116923  9114768.130476 
+288887.241960  9114776.155380 
+288880.335638  9114783.179899 
+288868.474049  9114792.208303 
+288860.573712  9114799.231780 
+288855.692357  9114811.281085 
+288848.815588  9114822.323769 
+288839.876888  9114823.318952 
+288832.926206  9114824.316214 
+288823.965333  9114822.297768 
+288812.037209  9114822.285282 
+288799.100294  9114820.262668 
+288787.179558  9114821.254718 
+288779.242253  9114823.255473 
+288775.317937  9114830.283105 
+288775.362274  9114836.310359 
+288770.495672  9114850.368747 
+288769.582945  9114861.417672 
+288764.716340  9114875.476060 
+288760.843745  9114889.535489 
+288745.042998  9114903.582420 
+288735.147207  9114909.599258 
+288727.224661  9114913.609093 
+288718.322878  9114919.626971 
+288712.395743  9114924.643431 
+288705.481981  9114930.663391 
+288701.542870  9114935.681935 
+288692.655855  9114943.708895 
+288684.740686  9114948.723268 
+288676.825515  9114953.737640 
+288664.926898  9114957.743296 
+288654.022293  9114961.749992 
+288635.180344  9114967.757424 
+288625.277134  9114972.769701 
+288608.467523  9114984.806471 
+288596.561502  9114987.807569 
+288581.658661  9114988.796443 
+288571.748052  9114992.804168 
+288563.840243  9114998.823068 
+288554.938416  9115004.840923 
+288544.107638  9115018.893034 
+288535.213190  9115025.915429 
+288526.303968  9115030.928736 
+288514.427465  9115037.947992 
+288502.558341  9115045.971788 
+288483.716325  9115051.979170 
+288465.868319  9115057.987592 
+288453.019929  9115068.019420 
+288441.136018  9115074.034117 
+288428.295001  9115085.070485 
+288408.481082  9115094.090426 
+288390.633044  9115100.098825 
+288378.741731  9115105.108965 
+288362.881720  9115111.119451 
+288351.005163  9115118.138674 
+288342.103278  9115124.156499 
+288330.219332  9115130.171174 
+288317.363506  9115139.198430 
+288302.512252  9115147.219040 
+288291.607552  9115151.225667 
+288271.815707  9115163.259197 
+288257.928937  9115167.262666 
+288245.036184  9115171.267183 
+288233.159587  9115178.286383 
+288226.230956  9115182.297204 
+288214.642142  9115228.493666 
+288214.686418  9115234.520938 
+288211.940490  9115266.663232 
+288220.047650  9115287.767092 
+288223.162559  9115305.852059 
+288215.079812  9115423.374388 
+288148.917608  9115618.184726 
+288060.290677  9115867.216371 
+288061.461824  9115891.326522 
+288064.576774  9115909.411500 
+288062.773194  9115934.523041 
+288061.845575  9115943.562902 
+288060.910576  9115951.598217 
+288054.085141  9115969.672682 
+288051.154682  9115976.701349 
+288033.490735  9116007.823346 
+288002.992783  9116050.986219 
+288079.130419  9116131.429749 
+288243.335061  9116292.328772 
+288341.490339  9116392.885522 
+288369.523172  9116420.037394 
+288431.494102  9116466.310956 
+288500.423492  9116512.591674 
+288507.507517  9116529.676176 
+288516.646189  9116555.803639 
+288477.893025  9116557.772225 
+288457.483688  9116621.036632 
+288462.520480  9116630.082716 
+288490.501795  9116650.202657 
+288538.319812  9116664.316062 
+288614.920980  9116672.432186 
+288690.513298  9116678.538058 
+288765.987211  9116668.571133 
+288752.923961  9116649.471423 
+288731.099238  9116655.475956 
+288693.147751  9116631.327685 
+288682.087437  9116614.239096 
+288693.860689  9116593.156122 
+288732.428870  9116566.073802 
+288778.978983  9116543.017885 
+288800.677851  9116519.936138 
+288822.421098  9116502.881634 
+288833.148414  9116474.765824 
+288849.001354  9116467.750538 
+288882.821124  9116470.799210 
+288886.789907  9116469.798791 
+288919.623031  9116473.850946 
+288937.656502  9116492.955750 
+288945.571859  9116487.941280 
+288948.516985  9116482.921663 
+288940.401765  9116460.813534 
+288927.227508  9116426.645764 
+288929.023152  9116400.529761 
+288957.680183  9116377.455182 
+288981.463202  9116367.434473 
+289003.339557  9116368.461644 
+289039.117705  9116367.494111 
+289048.976689  9116356.454443 
+289052.664102  9116317.281485 
+289076.513700  9116316.301600 
+289096.416747  9116319.335757 
+289120.177474  9116306.301371 
+289135.014036  9116296.271363 
+289138.953171  9116291.252767 
+289146.787004  9116275.188338 
+289151.668335  9116263.138990 
+289159.620656  9116263.147194 
+289166.638186  9116271.190689 
+289181.652481  9116285.269620 
+289191.637326  9116291.307105 
+289210.561131  9116296.349266 
+289233.431470  9116297.377357 
+289253.171522  9116278.311583 
+289269.053935  9116275.314337 
+289287.020739  9116285.378138 
+289304.994959  9116296.446469 
+289331.804398  9116292.455904 
+289340.706295  9116286.437865 
+289348.540048  9116270.373418 
+289351.403602  9116254.303864 
+289346.359308  9116244.253370 
+289334.230782  9116217.118565 
+289335.158134  9116208.078738 
+289349.942735  9116191.016907 
+289355.936600  9116195.041192 
+289363.970412  9116206.099288 
+289373.992304  9116217.159424 
+289374.764030  9116187.024289 
+289364.490208  9116141.809839 
+289369.356651  9116127.751407 
+289381.403646  9116143.836281 
+289388.465645  9116157.906968 
+289401.454817  9116166.961086 
+289441.965735  9116133.853156 
+289459.517437  9116087.662760 
+289449.488153  9116075.598102 
+289437.404108  9116054.490556 
+289441.224614  9116033.399334 
+289452.158983  9116033.410559 
+289461.216455  9116048.487813 
+289475.214457  9116059.552009 
+289492.083385  9116055.551188 
+289509.820330  9116034.474237 
+289539.322567  9115991.309676 
+289567.860375  9115952.162240 
+289596.383310  9115911.005722 
+289645.714077  9115860.829723 
+289701.038561  9115814.677939 
+289739.612804  9115788.599590 
+289761.310809  9115765.517578 
+289785.990867  9115742.438604 
+289800.693567  9115714.326798 
+289827.287452  9115681.204478 
+289829.067812  9115653.079489 
+289827.962529  9115638.010430 
+289817.829460  9115611.882341 
+289823.674922  9115595.815845 
+289833.615142  9115595.825988 
+289847.501779  9115591.822040 
+289868.183372  9115565.725387 
+289896.883870  9115548.677660 
+289924.456786  9115513.547262 
+289939.374499  9115514.566985 
+289958.149580  9115499.518179 
+290003.614747  9115464.405965 
+290023.361540  9115446.344547 
+290041.335487  9115457.412627 
+290050.259383  9115454.408114 
+290059.101645  9115440.353712 
+290065.948446  9115425.292754 
+290083.877859  9115430.333606 
+290095.694733  9115415.277694 
+290116.465168  9115401.235398 
+290130.262633  9115385.176965 
+290123.067010  9115353.024786 
+290133.830462  9115329.931584 
+290160.579779  9115317.904403 
+290172.530217  9115320.930107 
+290168.769430  9115350.057579 
+290179.740709  9115355.091340 
+290190.615483  9115347.066149 
+290205.340104  9115321.967900 
+290218.262286  9115321.980996 
+290225.405991  9115347.101405 
+290232.683353  9115390.303427 
+290246.762921  9115412.417269 
+290271.635590  9115415.456017 
+290295.410276  9115404.430271 
+290305.313296  9115399.417651 
+290338.768164  9115353.243254 
+290354.501560  9115330.155047 
+290350.369540  9115309.055823 
+290362.201141  9115296.008936 
+290377.029628  9115284.974127 
+290368.483370  9115204.603405 
+290379.276374  9115185.528315 
+290404.972087  9115165.463752 
+290432.722644  9115154.441987 
+290450.570237  9115148.432844 
+290469.448977  9115147.447365 
+290506.175292  9115140.452715 
+290544.837593  9115126.428312 
+290572.439460  9115095.315822 
+290591.013493  9115053.144464 
+290590.753418  9115017.985825 
+290599.617727  9115006.944972 
+290614.587250  9115014.996236 
+290627.576199  9115024.050027 
+290647.456303  9115024.070018 
+290674.093765  9114996.974625 
+290692.823761  9114975.898428 
+290684.485249  9114923.654771 
+290675.442609  9114910.586861 
+Region 1
+113
+290721.230712  9114113.040333 
+290683.385010  9114102.956901 
+290607.738191  9114088.817127 
+290553.988755  9114078.717493 
+290512.181995  9114070.638944 
+290501.181350  9114061.587062 
+290460.353745  9114051.500399 
+290451.407882  9114051.491322 
+290337.151527  9114058.406925 
+290287.474496  9114061.369946 
+290282.497148  9114060.360350 
+290205.878632  9114049.232453 
+290162.788691  9114001.975669 
+290041.137747  9113815.008967 
+290026.064152  9113927.500708 
+289991.178350  9113914.406072 
+289973.190292  9113901.328745 
+289960.120291  9113881.224755 
+289944.001664  9113852.076867 
+289931.955314  9113835.992030 
+289918.914990  9113819.906165 
+289913.745037  9113792.778565 
+289900.593609  9113761.624638 
+289883.599622  9113748.548277 
+289866.590829  9113733.462833 
+289855.531117  9113716.374446 
+289842.394573  9113687.229561 
+289835.392274  9113681.195170 
+289830.400155  9113678.176437 
+289805.609902  9113686.187125 
+289787.799717  9113697.218590 
+289705.824988  9113768.455629 
+289700.958731  9113782.514028 
+289673.245664  9113798.557886 
+289635.644555  9113821.623224 
+289614.918937  9113841.692404 
+289587.999929  9113830.614715 
+289572.081373  9113828.589175 
+289538.248891  9113823.531480 
+289509.526935  9113837.565150 
+289495.625943  9113839.559801 
+289480.701365  9113837.535259 
+289476.718025  9113836.526596 
+289458.767098  9113828.471718 
+289419.794528  9113800.304367 
+289389.819642  9113779.178049 
+289372.892318  9113775.142320 
+289343.028406  9113769.084059 
+289304.226032  9113764.021000 
+289298.306495  9113770.042029 
+289294.367531  9113775.060588 
+289182.276379  9113806.084205 
+289170.370723  9113809.085372 
+289141.604254  9113817.091589 
+289073.218709  9113844.142489 
+289072.261674  9113849.164156 
+289116.152348  9113870.305254 
+289226.015974  9113941.741767 
+289446.308950  9114026.351502 
+289446.345949  9114031.374198 
+289447.406537  9114040.416081 
+289425.950756  9114231.254824 
+289415.697666  9114323.661099 
+289407.782699  9114328.675555 
+289379.060402  9114342.709225 
+289359.224861  9114348.715844 
+289323.729523  9114387.855760 
+289387.263988  9114376.871807 
+289398.575403  9114428.114641 
+289446.968344  9114520.581629 
+289493.612321  9114510.584546 
+289516.378066  9114497.549166 
+289561.739202  9114448.373999 
+289618.167510  9114417.291771 
+289637.023832  9114413.293091 
+289705.624432  9114415.372814 
+289803.013858  9114412.459363 
+289859.679042  9114413.522061 
+289902.524630  9114427.629402 
+289923.502321  9114441.714300 
+289936.572531  9114461.818261 
+289952.646985  9114484.938877 
+289968.684387  9114503.036802 
+289994.632119  9114517.126738 
+290009.527250  9114515.132908 
+290081.065378  9114511.187856 
+290143.724260  9114516.274396 
+290167.624690  9114522.325912 
+290201.442831  9114525.373926 
+290220.373283  9114531.420353 
+290252.270216  9114543.507116 
+290278.218024  9114557.596863 
+290293.239299  9114572.680024 
+290299.425935  9114602.822109 
+290309.581155  9114631.963693 
+290321.754081  9114665.125424 
+290333.800837  9114681.210067 
+290356.766749  9114695.296720 
+290396.667791  9114714.423140 
+290433.594286  9114734.551033 
+290458.563101  9114750.648698 
+290491.528496  9114772.781578 
+290516.489921  9114787.874668 
+290538.513927  9114808.991929 
+290647.556782  9114768.920815 
+290630.116405  9114695.572930 
+290625.999251  9114676.482807 
+290609.642121  9114615.190289 
+290619.500365  9114604.150452 
+290711.464745  9114405.347191 
+290802.886053  9114133.213093 
+290763.030074  9114120.114139 
+290721.230712  9114113.040333 
+Region 1
+61
+291530.118940  9114889.338600 
+291535.081477  9114888.338975 
+291424.036193  9114658.194024 
+291396.781386  9114601.913852 
+291391.729520  9114590.859113 
+291276.043498  9114404.907779 
+291262.898390  9114374.759047 
+291247.854627  9114356.662678 
+291218.909938  9114340.561499 
+291186.063718  9114334.501628 
+291159.337653  9114349.542808 
+291117.701744  9114364.569093 
+291094.869766  9114368.564382 
+291070.064679  9114374.566735 
+290981.614536  9114376.487296 
+290979.366313  9114341.326729 
+290971.102129  9114299.128468 
+290967.993773  9114282.048456 
+290957.905209  9114261.947875 
+290942.787251  9114233.806057 
+290914.702900  9114199.624074 
+290880.706709  9114172.467792 
+290858.757282  9114161.395970 
+290854.766478  9114159.382911 
+290826.830859  9114145.291480 
+290802.886053  9114133.213093 
+290711.464745  9114405.347191 
+290619.500365  9114604.150452 
+290609.642121  9114615.190289 
+290625.999251  9114676.482807 
+290630.116405  9114695.572930 
+290647.556782  9114768.920815 
+290538.513927  9114808.991929 
+290588.518582  9114850.227882 
+290635.467007  9114881.415433 
+290675.442609  9114910.586861 
+290684.485249  9114923.654771 
+290692.823761  9114975.898428 
+290743.674061  9114997.044494 
+290771.573083  9115006.113196 
+290804.434698  9115014.182327 
+290818.499469  9115034.286894 
+290833.588003  9115058.410574 
+290847.645366  9115077.510595 
+290861.501944  9115069.488270 
+290880.231856  9115048.412009 
+290904.970400  9115033.368892 
+290937.541943  9115002.261219 
+290941.503079  9115000.256130 
+290980.157609  9114985.226884 
+291052.563529  9114964.204128 
+291104.087895  9114942.155962 
+291143.654429  9114916.077765 
+291200.163561  9114896.043517 
+291222.031548  9114896.065245 
+291242.905533  9114896.085976 
+291247.853195  9114893.077323 
+291284.497146  9114875.032301 
+291384.697343  9114849.014053 
+291411.587408  9114856.072313 
+291530.118940  9114889.338600 
+Region 1
+91
+290031.932510  9113779.841031 
+290029.892668  9113772.807240 
+290011.771276  9113741.648265 
+289993.724014  9113720.534639 
+289968.726321  9113700.418393 
+289931.697177  9113666.226351 
+289908.465263  9113615.975995 
+289891.086169  9113550.663700 
+289890.826929  9113515.504904 
+289890.493631  9113470.300738 
+289909.706529  9113379.912886 
+289919.357404  9113340.746184 
+289939.919732  9113298.577135 
+290029.319105  9113156.026035 
+290004.403253  9113146.959636 
+289980.562849  9113148.944148 
+289978.804523  9113180.082739 
+289961.944095  9113185.088020 
+289943.073506  9113187.077637 
+289908.358657  9113197.087145 
+289887.470498  9113195.056542 
+289879.652032  9113213.130008 
+289869.845621  9113231.201423 
+289853.125837  9113255.292880 
+289837.029803  9113229.158490 
+289801.796668  9113168.850295 
+289766.615452  9113115.573813 
+289752.588880  9113100.491343 
+289717.474388  9113056.255639 
+289637.421777  9113118.453540 
+289599.784132  9113136.496032 
+289563.110830  9113150.521376 
+289525.384356  9113156.509350 
+289501.536469  9113157.489077 
+289459.774925  9113155.436546 
+289422.975834  9113152.384616 
+289418.999952  9113152.380472 
+289419.229177  9113183.521204 
+289438.181183  9113192.581736 
+289448.209639  9113204.646563 
+289459.298631  9113225.753277 
+289466.507893  9113259.914860 
+289469.719090  9113291.058684 
+289469.785655  9113300.099539 
+289466.142594  9113345.299676 
+289469.213275  9113357.357250 
+289473.292728  9113371.424936 
+289468.478182  9113392.515094 
+289466.630769  9113411.599275 
+289455.963312  9113447.751323 
+289449.234772  9113478.884810 
+289455.427944  9113510.031732 
+289488.658305  9113568.329091 
+289490.668458  9113571.344773 
+289502.788572  9113597.475174 
+289486.149856  9113632.616500 
+289469.488925  9113664.744209 
+289462.782593  9113698.891318 
+289461.943976  9113719.985610 
+289474.300902  9113778.261264 
+289480.701365  9113837.535259 
+289495.625943  9113839.559801 
+289509.526935  9113837.565150 
+289538.248891  9113823.531480 
+289572.081373  9113828.589175 
+289587.999929  9113830.614715 
+289614.918937  9113841.692404 
+289635.644555  9113821.623224 
+289673.245664  9113798.557886 
+289700.958731  9113782.514028 
+289705.824988  9113768.455629 
+289787.799717  9113697.218590 
+289805.609902  9113686.187125 
+289830.400155  9113678.176437 
+289835.392274  9113681.195170 
+289842.394573  9113687.229561 
+289855.531117  9113716.374446 
+289866.590829  9113733.462833 
+289883.599622  9113748.548277 
+289900.593609  9113761.624638 
+289913.745037  9113792.778565 
+289918.914990  9113819.906165 
+289931.955314  9113835.992030 
+289944.001664  9113852.076867 
+289960.120291  9113881.224755 
+289973.190292  9113901.328745 
+289991.178350  9113914.406072 
+290026.064152  9113927.500708 
+290041.137747  9113815.008967 
+290038.133567  9113811.992302 
+290031.932510  9113779.841031 
+Region 1
+47
+292054.178100  9114384.580256 
+291874.254493  9114248.793971 
+291886.970052  9114087.078951 
+291891.775951  9114064.984263 
+291885.782269  9114060.960297 
+291789.001289  9114011.643609 
+291771.820539  9113973.454939 
+291675.680429  9114010.527276 
+291576.304987  9114013.442551 
+291566.484352  9114029.505153 
+291562.545671  9114034.523854 
+291473.887988  9114008.318425 
+291459.231416  9114042.457590 
+291451.391244  9114057.517622 
+291411.203785  9114133.821323 
+291372.877644  9114193.050004 
+291343.318644  9114228.178874 
+291309.820872  9114268.326426 
+291271.427530  9114318.514312 
+291223.857551  9114337.552862 
+291218.909938  9114340.561499 
+291247.854627  9114356.662678 
+291262.898390  9114374.759047 
+291276.043498  9114404.907779 
+291391.729520  9114590.859113 
+291396.781386  9114601.913852 
+291424.036193  9114658.194024 
+291535.081477  9114888.338975 
+291586.717178  9114881.358245 
+291629.272731  9114856.287167 
+291706.454080  9114809.150685 
+291747.993123  9114781.064969 
+291776.729483  9114769.038961 
+291797.580981  9114766.045872 
+291803.522574  9114763.038146 
+291832.229074  9114746.994005 
+291880.673706  9114711.883342 
+291897.452243  9114695.827484 
+291923.161770  9114677.771331 
+291977.756669  9114667.779568 
+292044.174956  9114643.736046 
+292071.932048  9114633.717968 
+292127.528272  9114624.731540 
+292150.233290  9114603.658808 
+292164.052103  9114590.613549 
+292217.085532  9114504.276737 
+292054.178100  9114384.580256 
+Region 1
+44
+292764.000571  9114000.539757 
+292776.615802  9113959.366835 
+292753.717111  9113954.322185 
+292734.749473  9113943.254230 
+292682.569927  9113876.905881 
+292657.990095  9113779.444181 
+292608.418682  9113796.472952 
+292600.317573  9113776.374802 
+292505.001183  9113790.345583 
+292397.579270  9113646.595349 
+292382.520530  9113626.490354 
+292250.168331  9113471.665575 
+292091.984156  9113586.025627 
+292010.948538  9113649.230714 
+291972.235961  9113656.224295 
+291785.630575  9113691.198614 
+291771.752241  9113696.207509 
+291773.926419  9113721.322642 
+291765.271213  9113760.490357 
+291746.862511  9113824.761432 
+291749.349593  9113892.066697 
+291763.645209  9113943.311295 
+291771.820539  9113973.454939 
+291789.001289  9114011.643609 
+291885.782269  9114060.960297 
+291891.775951  9114064.984263 
+291886.970052  9114087.078951 
+291874.254493  9114248.793971 
+292054.178100  9114384.580256 
+292217.085532  9114504.276737 
+292246.569206  9114459.102178 
+292281.015279  9114412.927922 
+292315.379171  9114355.703896 
+292335.094566  9114333.623698 
+292362.784185  9114314.564789 
+292374.652224  9114306.540186 
+292472.615641  9114247.368782 
+292539.944748  9114212.275949 
+292577.514199  9114185.190387 
+292622.841171  9114131.994914 
+292653.482564  9114108.920678 
+292687.083431  9114082.835741 
+292725.579397  9114046.710365 
+292764.000571  9114000.539757 
+Region 1
+64
+292186.025248  9113400.282055 
+292140.124073  9113376.128630 
+292112.211150  9113365.051543 
+292085.284744  9113352.970887 
+292048.470916  9113347.912118 
+292036.528476  9113345.891339 
+291968.976368  9113350.847449 
+291931.272884  9113359.850969 
+291894.253585  9113193.064304 
+291892.220973  9113187.035182 
+291813.832302  9113205.039062 
+291736.169446  9113186.880823 
+291655.517301  9113167.714949 
+291651.712674  9113190.815140 
+291639.911700  9113207.880270 
+291592.581193  9113259.063803 
+291481.949467  9113352.374205 
+291420.811757  9113284.005832 
+291320.052245  9113368.285078 
+291342.120311  9113395.429211 
+291275.911309  9113447.598208 
+291239.357605  9113477.697322 
+291177.131665  9113530.874734 
+291105.077373  9113599.110084 
+291068.590326  9113638.249889 
+291016.340859  9113696.459798 
+290989.793412  9113735.609552 
+291034.827056  9113776.840222 
+291065.878200  9113809.016105 
+291076.878852  9113818.067839 
+291100.037721  9113858.271959 
+291130.176793  9113901.496610 
+291160.345676  9113948.739346 
+291199.557147  9114009.049867 
+291215.721189  9114044.224282 
+291223.948288  9114081.399812 
+291223.229568  9114118.566415 
+291219.447068  9114144.680219 
+291222.562933  9114162.764725 
+291227.629569  9114175.828565 
+291343.318644  9114228.178874 
+291372.877644  9114193.050004 
+291411.203785  9114133.821323 
+291451.391244  9114057.517622 
+291459.231416  9114042.457590 
+291473.887988  9114008.318425 
+291562.545671  9114034.523854 
+291566.484352  9114029.505153 
+291576.304987  9114013.442551 
+291675.680429  9114010.527276 
+291771.820539  9113973.454939 
+291763.645209  9113943.311295 
+291749.349593  9113892.066697 
+291746.862511  9113824.761432 
+291765.271213  9113760.490357 
+291773.926419  9113721.322642 
+291771.752241  9113696.207509 
+291785.630575  9113691.198614 
+291972.235961  9113656.224295 
+292010.948538  9113649.230714 
+292091.984156  9113586.025627 
+292250.168331  9113471.665575 
+292219.042250  9113429.445396 
+292186.025248  9113400.282055 
+Region 1
+152
+292203.630249  9113093.921479 
+292197.614333  9113086.883954 
+292170.509186  9113050.694713 
+292164.493281  9113043.657180 
+292140.429680  9113015.507039 
+292068.711409  9112860.740679 
+292065.684851  9112854.710587 
+292055.715545  9112850.682689 
+291989.596633  9112646.700164 
+291855.801047  9112698.802781 
+291764.588581  9112729.852438 
+291737.826390  9112739.871067 
+291587.184999  9112798.987937 
+291437.529629  9112857.100860 
+291353.281502  9112889.161308 
+291281.298338  9112698.229939 
+291266.136369  9112664.060955 
+291257.175953  9112662.042913 
+291009.288596  9112608.553542 
+290901.763761  9112584.336234 
+290929.617634  9112721.984260 
+290943.014276  9112786.287354 
+290845.940787  9112831.392772 
+290829.095500  9112838.407389 
+290845.280919  9112876.595715 
+290866.443587  9112915.793589 
+290840.778871  9112939.876214 
+290834.103294  9112978.041397 
+290830.313073  9113003.150680 
+290834.400285  9113018.222685 
+290797.030701  9113072.429207 
+290763.154346  9113061.345129 
+290739.135963  9113039.221238 
+290730.116087  9113029.166842 
+290724.159743  9113030.165327 
+290632.819196  9113044.135972 
+290563.316048  9113054.110566 
+290535.448007  9113049.059571 
+290525.530637  9113052.063052 
+290482.723488  9113042.978702 
+290448.951008  9113045.957845 
+290418.078832  9113037.890129 
+290422.217833  9113059.993944 
+290401.745050  9113114.217499 
+290377.815747  9113104.147797 
+290309.269257  9113109.100375 
+290306.391154  9113123.160815 
+290217.831874  9113110.011290 
+290201.386565  9113171.270637 
+290175.023781  9113235.533407 
+290156.056860  9113224.464150 
+290143.031522  9113210.387395 
+290084.209578  9113186.218325 
+290060.591430  9113218.338971 
+290034.926045  9113242.421278 
+289996.368653  9113270.508429 
+289966.675469  9113287.554864 
+289939.919732  9113298.577135 
+289919.357404  9113340.746184 
+289909.706529  9113379.912886 
+289890.493631  9113470.300738 
+289890.826929  9113515.504904 
+289891.086169  9113550.663700 
+289908.465263  9113615.975995 
+289931.697177  9113666.226351 
+289968.726321  9113700.418393 
+289993.724014  9113720.534639 
+290011.771276  9113741.648265 
+290029.892668  9113772.807240 
+290031.932510  9113779.841031 
+290038.133567  9113811.992302 
+290041.137747  9113815.008967 
+290162.788691  9114001.975669 
+290205.878632  9114049.232453 
+290282.497148  9114060.360350 
+290287.474496  9114061.369946 
+290337.151527  9114058.406925 
+290451.407882  9114051.491322 
+290460.353745  9114051.500399 
+290501.181350  9114061.587062 
+290512.181995  9114070.638944 
+290553.988755  9114078.717493 
+290607.738191  9114088.817127 
+290683.385010  9114102.956901 
+290721.230712  9114113.040333 
+290763.030074  9114120.114139 
+290802.886053  9114133.213093 
+290826.830859  9114145.291480 
+290854.766478  9114159.382911 
+290858.757282  9114161.395970 
+290880.706709  9114172.467792 
+290914.702900  9114199.624074 
+290942.787251  9114233.806057 
+290957.905209  9114261.947875 
+290967.993773  9114282.048456 
+290971.102129  9114299.128468 
+290979.366313  9114341.326729 
+290981.614536  9114376.487296 
+291070.064679  9114374.566735 
+291094.869766  9114368.564382 
+291117.701744  9114364.569093 
+291159.337653  9114349.542808 
+291186.063718  9114334.501628 
+291218.909938  9114340.561499 
+291223.857551  9114337.552862 
+291271.427530  9114318.514312 
+291309.820872  9114268.326426 
+291343.318644  9114228.178874 
+291227.629569  9114175.828565 
+291222.562933  9114162.764725 
+291219.447068  9114144.680219 
+291223.229568  9114118.566415 
+291223.948288  9114081.399812 
+291215.721189  9114044.224282 
+291199.557147  9114009.049867 
+291160.345676  9113948.739346 
+291130.176793  9113901.496610 
+291100.037721  9113858.271959 
+291076.878852  9113818.067839 
+291065.878200  9113809.016105 
+291034.827056  9113776.840222 
+290989.793412  9113735.609552 
+291016.340859  9113696.459798 
+291068.590326  9113638.249889 
+291105.077373  9113599.110084 
+291177.131665  9113530.874734 
+291239.357605  9113477.697322 
+291275.911309  9113447.598208 
+291342.120311  9113395.429211 
+291320.052245  9113368.285078 
+291420.811757  9113284.005832 
+291481.949467  9113352.374205 
+291592.581193  9113259.063803 
+291639.911700  9113207.880270 
+291651.712674  9113190.815140 
+291655.517301  9113167.714949 
+291736.169446  9113186.880823 
+291813.832302  9113205.039062 
+291892.220973  9113187.035182 
+291894.253585  9113193.064304 
+291931.272884  9113359.850969 
+291968.976368  9113350.847449 
+292036.528476  9113345.891339 
+292048.470916  9113347.912118 
+292085.284744  9113352.970887 
+292112.211150  9113365.051543 
+292140.124073  9113376.128630 
+292186.025248  9113400.282055 
+292219.042250  9113429.445396 
+292346.023145  9113396.420478 
+292315.711991  9113330.092764 
+292203.630249  9113093.921479 
+Region 1
+84
+290901.763761  9112584.336234 
+290874.051186  9112465.774254 
+290835.398545  9112480.802931 
+290725.686079  9112564.067115 
+290631.676109  9112485.618438 
+290618.695427  9112477.569002 
+290580.546962  9112560.905780 
+290527.748646  9112679.386035 
+290507.098078  9112709.500759 
+290448.617841  9112731.540632 
+290384.151550  9112750.560738 
+290292.966919  9112785.625831 
+290066.936927  9112865.755925 
+290047.131775  9112875.780821 
+290011.475070  9112892.821082 
+290002.559037  9112896.830009 
+289969.876774  9112912.868781 
+289958.972807  9112916.875651 
+289927.269663  9112930.906350 
+289890.589274  9112943.927361 
+289850.919563  9112955.940727 
+289792.334892  9112963.916370 
+289740.811544  9112985.962685 
+289737.844449  9112987.968672 
+289712.119749  9113004.014502 
+289706.185554  9113008.026473 
+289700.251357  9113012.038444 
+289693.323193  9113016.049383 
+289704.360419  9113030.124254 
+289717.474388  9113056.255639 
+289752.588880  9113100.491343 
+289766.615452  9113115.573813 
+289801.796668  9113168.850295 
+289837.029803  9113229.158490 
+289853.125837  9113255.292880 
+289869.845621  9113231.201423 
+289879.652032  9113213.130008 
+289887.470498  9113195.056542 
+289908.358657  9113197.087145 
+289943.073506  9113187.077637 
+289961.944095  9113185.088020 
+289978.804523  9113180.082739 
+289980.562849  9113148.944148 
+290004.403253  9113146.959636 
+290029.319105  9113156.026035 
+289939.919732  9113298.577135 
+289966.675469  9113287.554864 
+289996.368653  9113270.508429 
+290034.926045  9113242.421278 
+290060.591430  9113218.338971 
+290084.209578  9113186.218325 
+290143.031522  9113210.387395 
+290156.056860  9113224.464150 
+290175.023781  9113235.533407 
+290201.386565  9113171.270637 
+290217.831874  9113110.011290 
+290306.391154  9113123.160815 
+290309.269257  9113109.100375 
+290377.815747  9113104.147797 
+290401.745050  9113114.217499 
+290422.217833  9113059.993944 
+290418.078832  9113037.890129 
+290448.951008  9113045.957845 
+290482.723488  9113042.978702 
+290525.530637  9113052.063052 
+290535.448007  9113049.059571 
+290563.316048  9113054.110566 
+290632.819196  9113044.135972 
+290724.159743  9113030.165327 
+290730.116087  9113029.166842 
+290739.135963  9113039.221238 
+290763.154346  9113061.345129 
+290797.030701  9113072.429207 
+290834.400285  9113018.222685 
+290830.313073  9113003.150680 
+290834.103294  9112978.041397 
+290840.778871  9112939.876214 
+290866.443587  9112915.793589 
+290845.280919  9112876.595715 
+290829.095500  9112838.407389 
+290845.940787  9112831.392772 
+290943.014276  9112786.287354 
+290929.617634  9112721.984260 
+290901.763761  9112584.336234 
+Region 1
+104
+282859.930695  9118541.597145 
+282848.907977  9118529.529603 
+282837.834309  9118510.430045 
+282831.753102  9118494.349961 
+282824.648662  9118474.250430 
+282817.529673  9118452.141749 
+282811.346588  9118421.997631 
+282802.173875  9118390.845476 
+282791.861510  9118339.600692 
+282823.728609  9118210.048781 
+282232.132869  9118058.673124 
+282223.265719  9118069.712962 
+282220.377793  9118082.768958 
+282216.510275  9118097.832941 
+282211.670430  9118115.909487 
+282209.820199  9118134.994113 
+282204.000759  9118155.078647 
+282199.168171  9118174.159771 
+282184.532388  9118212.316182 
+282180.701175  9118232.403052 
+282173.880335  9118251.481842 
+282171.028713  9118269.560726 
+282164.236921  9118292.657825 
+282163.315433  9118302.702428 
+282159.433369  9118315.757260 
+282149.622883  9118333.827971 
+282128.906087  9118355.904142 
+282111.142592  9118373.965505 
+282094.344157  9118388.009723 
+282077.589285  9118408.081403 
+282061.792215  9118423.131361 
+282054.949526  9118439.196418 
+282036.199106  9118458.261175 
+282015.445895  9118475.314432 
+282005.591760  9118487.357666 
+281992.784281  9118503.415700 
+281989.976160  9118527.522060 
+282022.884043  9118541.624754 
+282056.749757  9118550.705700 
+282074.731217  9118562.781661 
+282087.785624  9118580.879239 
+282094.947906  9118609.015578 
+282105.157967  9118646.196611 
+282106.362760  9118675.330517 
+282111.587673  9118710.496553 
+282117.799467  9118744.659175 
+282127.030002  9118783.848176 
+282138.190701  9118815.002886 
+282158.393091  9118859.227573 
+282173.552182  9118893.400651 
+282187.789842  9118937.618322 
+282205.039023  9118985.857776 
+282225.263395  9119033.096124 
+282241.394952  9119064.256585 
+282256.539665  9119096.420448 
+282270.668453  9119125.569412 
+282291.741701  9119152.717337 
+282315.775581  9119176.854998 
+282343.720596  9119191.956094 
+282376.592690  9119201.035507 
+282398.500149  9119206.083858 
+282413.492273  9119217.151549 
+282431.459551  9119227.218128 
+282446.408038  9119232.258353 
+282467.314096  9119236.300935 
+282480.274306  9119241.338835 
+282488.227432  9119241.348080 
+282503.117715  9119238.351687 
+282528.914432  9119231.349693 
+282552.759244  9119229.368250 
+282580.580612  9119227.391410 
+282615.331836  9119221.404328 
+282649.110744  9119218.429791 
+282670.952691  9119214.436837 
+282696.778468  9119211.453053 
+282719.680068  9119216.502391 
+282736.631400  9119223.553962 
+282751.565331  9119226.584933 
+282753.407975  9119206.495766 
+282751.237659  9119181.379131 
+282752.115294  9119165.307107 
+282751.033781  9119153.251076 
+282748.899882  9119133.157306 
+282754.726361  9119114.077314 
+282756.576293  9119094.992720 
+282759.442204  9119078.922997 
+282761.284854  9119058.833830 
+282763.193034  9119047.785824 
+282764.085236  9119033.722947 
+282763.018293  9119023.676062 
+282761.871263  9119002.578870 
+282758.765092  9118985.497669 
+282781.477267  9118964.428096 
+282803.173445  9118940.343647 
+282811.989573  9118922.271681 
+282823.729839  9118896.166581 
+282835.506503  9118875.084345 
+282844.278921  9118850.984941 
+282854.981338  9118818.851252 
+282862.788740  9118798.768991 
+282870.632545  9118783.709594 
+282953.156106  9118648.188800 
+282877.985091  9118563.718469 
+282859.930695  9118541.597145 
+Region 1
+1416
+289305.633672  9120285.437156 
+289241.828346  9119992.050112 
+289200.436938  9119772.016161 
+289147.643972  9119623.292161 
+289109.333159  9119550.927067 
+289068.203442  9119500.658727 
+289026.064868  9119448.380238 
+288977.969159  9119397.100146 
+288973.050548  9119404.126854 
+288909.924626  9119336.758826 
+288835.856298  9119268.374939 
+288771.707008  9119196.987443 
+288701.548824  9119119.566440 
+288640.367456  9119046.172636 
+288576.107680  9118959.716588 
+288460.630678  9118802.890074 
+288330.050658  9118619.929483 
+288286.845737  9118557.603430 
+288256.519771  9118489.263485 
+288132.504225  9118117.455846 
+288104.181878  9118051.126827 
+288073.054785  9118008.903722 
+288043.967658  9117973.714477 
+288001.964892  9117939.516202 
+287946.074587  9117909.321448 
+287854.353068  9117873.061702 
+287775.569489  9117838.824450 
+287771.578393  9117836.811166 
+287706.763730  9117809.620260 
+287650.851570  9117776.411415 
+287647.854564  9117774.399169 
+287573.812889  9117709.025768 
+287504.690175  9117636.625630 
+287416.658083  9117561.191612 
+287399.685017  9117551.128156 
+287302.772909  9117484.725256 
+287296.778962  9117480.700700 
+287211.862360  9117423.351200 
+287137.866041  9117364.004094 
+287069.804884  9117300.645013 
+287031.669200  9117251.381511 
+287014.571126  9117224.240498 
+287005.388831  9117192.085262 
+286997.149083  9117152.899232 
+286996.957638  9117126.780906 
+287000.705661  9117095.644099 
+287010.307653  9117049.445438 
+287019.961176  9117010.278636 
+287039.525907  9116967.104314 
+287053.155667  9116927.941787 
+287051.844986  9116884.745034 
+287031.625017  9116838.514320 
+287012.472777  9116802.330167 
+286982.378524  9116765.129672 
+286943.300966  9116722.896744 
+286910.209926  9116683.683855 
+286904.194048  9116676.645557 
+286875.108751  9116641.455125 
+286860.065411  9116623.357084 
+286837.003395  9116596.209471 
+286812.954705  9116570.065317 
+286797.904060  9116550.962691 
+286771.845236  9116521.802694 
+286744.762973  9116488.623386 
+286718.726281  9116462.476999 
+286690.686801  9116434.319327 
+286673.611383  9116410.191713 
+286655.497821  9116380.035690 
+286635.344720  9116342.845619 
+286615.213708  9116308.669191 
+286590.974226  9116256.406454 
+286572.787311  9116216.204830 
+286559.622131  9116183.040482 
+286532.268406  9116112.692459 
+286507.035120  9116060.428541 
+286484.813432  9116012.186068 
+286468.688297  9115982.032068 
+286466.670821  9115978.011678 
+286437.557000  9115938.802548 
+286409.466652  9115903.612693 
+286386.390636  9115874.455581 
+286379.366230  9115865.406968 
+286355.303552  9115837.253297 
+286336.211131  9115809.105054 
+286311.139787  9115778.941145 
+286299.336034  9115796.005501 
+286285.558863  9115815.076786 
+286279.690009  9115828.129463 
+286260.957270  9115849.204402 
+286244.175910  9115865.258742 
+286225.428462  9115884.324562 
+286203.662160  9115898.364322 
+286181.859152  9115907.381295 
+286143.245360  9115928.434351 
+286122.436369  9115937.452395 
+286103.608130  9115945.468063 
+286088.748744  9115952.483546 
+286072.917312  9115962.511600 
+286055.090436  9115971.532903 
+286034.259393  9115977.537245 
+286011.469582  9115987.557615 
+285982.730121  9115999.580511 
+285953.983306  9116010.598836 
+285924.242422  9116021.616049 
+285895.502905  9116033.638901 
+285870.702919  9116040.643344 
+285840.983978  9116054.674185 
+285810.248969  9116065.690237 
+285779.528601  9116078.715388 
+285756.723997  9116086.726539 
+285733.912053  9116093.733122 
+285695.209879  9116102.731180 
+285652.480166  9116104.692885 
+285619.647033  9116100.638236 
+285598.786523  9116102.624170 
+285586.865183  9116103.615476 
+285560.040332  9116105.594765 
+285542.140003  9116104.570311 
+285524.239672  9116103.545849 
+285508.305479  9116099.509914 
+285485.361629  9116088.434307 
+285455.386166  9116067.305334 
+285442.316988  9116047.199734 
+285404.447706  9116034.098332 
+285360.643392  9116025.008476 
+285333.730702  9116014.932896 
+285303.843175  9116005.858523 
+285260.009613  9115992.750315 
+285220.159603  9115980.651072 
+285184.322409  9115973.579053 
+285141.512204  9115964.490076 
+285093.717102  9115953.386349 
+285037.026710  9115949.304447 
+284957.334120  9115926.110046 
+284872.715161  9115908.937259 
+284800.894716  9115874.701315 
+284745.987894  9115842.493476 
+284727.992633  9115828.409338 
+284712.986851  9115815.333131 
+284672.939820  9115776.110097 
+284646.941057  9115754.984952 
+284616.907685  9115725.818758 
+284580.895436  9115694.636633 
+284544.905136  9115666.468162 
+284509.879731  9115634.282521 
+284488.887868  9115618.185727 
+284474.883569  9115606.115103 
+284460.879277  9115594.044472 
+284424.867232  9115562.862171 
+284388.833344  9115528.666130 
+284362.834844  9115507.540754 
+284325.806997  9115473.343505 
+284300.809898  9115453.223781 
+284278.751202  9115427.080047 
+284251.744174  9115403.944309 
+284225.723928  9115379.805120 
+284194.660564  9115345.614542 
+284175.635157  9115326.506117 
+284159.504421  9115295.346292 
+284141.196096  9115238.065417 
+284134.940264  9115197.875868 
+284131.732179  9115166.730847 
+284116.486273  9115120.503608 
+284101.349723  9115089.344874 
+284085.233731  9115060.194122 
+284066.128357  9115030.035360 
+284040.130305  9115008.909690 
+284013.167377  9114991.801126 
+283987.264068  9114983.734804 
+283963.377979  9114979.689032 
+283933.534936  9114976.640936 
+283894.781946  9114978.605337 
+283878.891869  9114980.596112 
+283845.072657  9114977.543364 
+283833.144173  9114977.529580 
+283800.362680  9114980.505364 
+283769.561979  9114982.478856 
+283716.797747  9114971.367592 
+283691.873945  9114961.293097 
+283667.900529  9114945.192316 
+283633.007238  9114931.087972 
+283615.034474  9114920.016929 
+283600.058389  9114910.958480 
+283569.126745  9114894.849551 
+283559.135424  9114887.806003 
+283540.168651  9114876.733765 
+283527.173397  9114866.673026 
+283502.176945  9114846.552689 
+283504.245028  9114857.605287 
+283726.238849  9116136.669639 
+283721.501649  9116168.810136 
+283721.749359  9116202.965497 
+283734.006045  9116248.184854 
+283730.510667  9116314.481853 
+283724.604537  9116322.511544 
+283707.887493  9116347.606327 
+283691.141289  9116368.682830 
+283668.437923  9116390.757031 
+283644.704037  9116407.807232 
+283630.889007  9116421.855172 
+283624.003344  9116431.892851 
+283623.103974  9116444.951113 
+283626.202755  9116461.027668 
+283626.297461  9116474.087075 
+283625.376238  9116484.131628 
+283622.496007  9116498.192170 
+283608.702803  9116515.253821 
+283598.842184  9116526.292633 
+283578.097717  9116544.350828 
+283552.513963  9116580.485549 
+283539.714788  9116597.548337 
+283530.921051  9116618.633992 
+283532.126364  9116647.767677 
+283537.431834  9116693.983640 
+283547.664020  9116734.177907 
+283560.893046  9116776.384743 
+283574.486412  9116868.820065 
+283580.735084  9116908.005157 
+283597.984293  9116956.243953 
+283634.991364  9116987.427903 
+283685.959424  9117024.655205 
+283700.943612  9117034.718013 
+283708.925461  9117038.745415 
+283720.934689  9117049.809360 
+283728.960287  9117059.864172 
+283737.987266  9117070.924690 
+283745.011493  9117079.973788 
+283749.053462  9117089.019466 
+283757.115532  9117104.097113 
+283761.230425  9117123.188477 
+283766.302951  9117137.258134 
+283769.394597  9117152.330081 
+283771.477573  9117165.391752 
+283776.666791  9117195.534504 
+283776.776180  9117210.603034 
+283781.848727  9117224.672686 
+283781.928949  9117235.722940 
+283779.048780  9117249.783487 
+283777.169994  9117264.849740 
+283773.303025  9117279.913718 
+283765.547206  9117307.027968 
+283760.642383  9117316.063396 
+283746.870950  9117336.138836 
+283741.001200  9117349.191401 
+283735.138740  9117363.248534 
+283732.309606  9117384.341064 
+283734.421771  9117401.421010 
+283734.516578  9117414.480404 
+283735.569016  9117422.518093 
+283736.657920  9117435.578625 
+283737.768705  9117451.652862 
+283737.921864  9117472.748806 
+283738.981600  9117481.791062 
+283741.079194  9117496.861868 
+283741.166717  9117508.916693 
+283745.259801  9117524.994341 
+283745.391091  9117543.076577 
+283746.545655  9117565.178224 
+283744.644989  9117577.230774 
+283741.786695  9117594.305030 
+283735.931517  9117609.366738 
+283731.026671  9117618.402171 
+283727.108628  9117626.434173 
+283719.265245  9117641.493607 
+283715.354492  9117650.530177 
+283710.500696  9117666.597591 
+283705.625015  9117679.651299 
+283705.676072  9117686.683281 
+283705.778187  9117700.747244 
+283707.868504  9117714.813482 
+283708.957429  9117727.874013 
+283713.006776  9117737.924248 
+283719.058918  9117749.985893 
+283729.065586  9117759.038376 
+283738.056272  9117765.076014 
+283748.998687  9117766.093079 
+283762.930703  9117768.118116 
+283771.906801  9117772.146609 
+283780.897493  9117778.184236 
+283785.904483  9117783.212753 
+283793.937559  9117794.272083 
+283800.947350  9117801.312004 
+283813.980134  9117816.395273 
+283823.994131  9117826.452295 
+283834.037323  9117840.527586 
+283843.049929  9117849.578899 
+283855.059446  9117860.642745 
+283863.077957  9117869.692920 
+283869.130160  9117881.754530 
+283872.185457  9117891.803606 
+283874.239354  9117900.846981 
+283876.285953  9117908.885788 
+283875.364838  9117918.930333 
+283872.433617  9117925.958911 
+283870.496499  9117932.988621 
+283865.613561  9117945.037772 
+283855.752796  9117956.076694 
+283849.875747  9117968.124713 
+283845.014697  9117983.187568 
+283840.175541  9118001.264127 
+283834.320381  9118016.325850 
+283822.544365  9118037.408184 
+283731.774132  9117995.113129 
+283697.695369  9118093.521121 
+283687.768868  9118095.518905 
+283671.877709  9118097.509872 
+283657.996652  9118102.516813 
+283498.246360  9118006.900632 
+283453.209956  9118102.282319 
+283348.434736  9118047.915629 
+283328.494232  9118039.856196 
+283301.431601  9118146.308678 
+283167.109810  9118130.080944 
+283145.217473  9118127.041998 
+283079.576878  9118122.947950 
+283042.841923  9118266.558119 
+282823.728609  9118210.048781 
+282791.861510  9118339.600692 
+282802.173875  9118390.845476 
+282811.346588  9118421.997631 
+282817.529673  9118452.141749 
+282824.648662  9118474.250430 
+282831.753102  9118494.349961 
+282837.834309  9118510.430045 
+282848.907977  9118529.529603 
+282859.930695  9118541.597145 
+282877.985091  9118563.718469 
+282953.156106  9118648.188800 
+282870.632545  9118783.709594 
+282862.788740  9118798.768991 
+282854.981338  9118818.851252 
+282844.278921  9118850.984941 
+282835.506503  9118875.084345 
+282823.729839  9118896.166581 
+282811.989573  9118922.271681 
+282803.173445  9118940.343647 
+282781.477267  9118964.428096 
+282758.765092  9118985.497669 
+282761.871263  9119002.578870 
+282763.018293  9119023.676062 
+282764.085236  9119033.722947 
+282763.193034  9119047.785824 
+282761.284854  9119058.833830 
+282759.442204  9119078.922997 
+282756.576293  9119094.992720 
+282754.726361  9119114.077314 
+282748.899882  9119133.157306 
+282751.033781  9119153.251076 
+282752.115294  9119165.307107 
+282751.237659  9119181.379131 
+282753.407975  9119206.495766 
+282751.565331  9119226.584933 
+282736.631400  9119223.553962 
+282719.680068  9119216.502391 
+282696.778468  9119211.453053 
+282670.952691  9119214.436837 
+282649.110744  9119218.429791 
+282615.331836  9119221.404328 
+282580.580612  9119227.391410 
+282552.759244  9119229.368250 
+282528.914432  9119231.349693 
+282503.117715  9119238.351687 
+282488.227432  9119241.348080 
+282480.274306  9119241.338835 
+282467.314096  9119236.300935 
+282446.408038  9119232.258353 
+282431.459551  9119227.218128 
+282413.492273  9119217.151549 
+282398.500149  9119206.083858 
+282376.592690  9119201.035507 
+282343.720596  9119191.956094 
+282315.775581  9119176.854998 
+282291.741701  9119152.717337 
+282270.668453  9119125.569412 
+282256.539665  9119096.420448 
+282241.394952  9119064.256585 
+282225.263395  9119033.096124 
+282205.039023  9118985.857776 
+282187.789842  9118937.618322 
+282173.552182  9118893.400651 
+282158.393091  9118859.227573 
+282138.190701  9118815.002886 
+282127.030002  9118783.848176 
+282117.799467  9118744.659175 
+282111.587673  9118710.496553 
+282106.362760  9118675.330517 
+282105.157967  9118646.196611 
+282094.947906  9118609.015578 
+282087.785624  9118580.879239 
+282074.731217  9118562.781661 
+282056.749757  9118550.705700 
+282022.884043  9118541.624754 
+281989.976160  9118527.522060 
+281975.056979  9118526.499926 
+281957.155414  9118525.474275 
+281940.240716  9118523.445209 
+281919.378543  9118525.429763 
+281895.497686  9118522.387899 
+281892.420938  9118509.324861 
+281881.412945  9118499.266177 
+281875.433661  9118497.249983 
+281863.496867  9118496.231328 
+281852.575975  9118498.227580 
+281839.724885  9118508.258112 
+281830.901105  9118525.325389 
+281824.101865  9118547.417908 
+281823.180309  9118557.462523 
+281818.238691  9118561.474970 
+281798.406896  9118568.483543 
+281792.507428  9118577.517708 
+281786.622472  9118588.561032 
+281781.789699  9118607.642162 
+281772.965884  9118624.709438 
+281757.146861  9118636.745594 
+281740.384489  9118655.812627 
+281730.566520  9118672.878725 
+281726.648038  9118680.910659 
+281714.841794  9118697.974406 
+281703.971630  9118707.002691 
+281676.172167  9118711.992667 
+281662.297824  9118718.003678 
+281654.431809  9118730.049223 
+281654.482592  9118737.081281 
+281672.478582  9118751.166568 
+281644.686341  9118757.161111 
+281650.781737  9118775.250605 
+281638.815841  9118770.213589 
+281603.012464  9118768.162058 
+281590.959531  9118751.070067 
+281577.977750  9118743.018114 
+281566.991496  9118735.973092 
+281540.258639  9118751.009975 
+281536.383630  9118765.069384 
+281534.504144  9118780.135732 
+281534.663697  9118802.236500 
+281539.851961  9118832.379803 
+281529.867075  9118826.340536 
+281514.911506  9118820.295371 
+281500.942826  9118813.246799 
+281489.963811  9118807.206341 
+281479.057311  9118811.211686 
+281472.185367  9118823.258395 
+281475.247544  9118834.312322 
+281481.299387  9118846.374368 
+281483.352927  9118855.417953 
+281479.441641  9118864.454461 
+281470.537907  9118870.471328 
+281457.672119  9118878.492636 
+281440.735509  9118873.449669 
+281419.829598  9118869.406553 
+281401.942354  9118870.389876 
+281372.103694  9118868.345268 
+281354.223693  9118870.333153 
+281333.390266  9118876.335810 
+281316.540637  9118883.347772 
+281293.755155  9118894.370956 
+281272.979682  9118908.410243 
+281259.105202  9118914.421159 
+281245.172742  9118912.395416 
+281233.177839  9118903.339963 
+281225.195731  9118899.312157 
+281215.268821  9118901.309471 
+281196.452610  9118911.332772 
+281184.559149  9118916.341456 
+281171.671544  9118921.348952 
+281158.812915  9118930.374774 
+281158.878121  9118939.416015 
+281158.936081  9118947.452675 
+281159.037513  9118961.516828 
+281159.109965  9118971.562652 
+281158.144804  9118975.579795 
+281145.220954  9118975.564376 
+281137.325774  9118983.591545 
+281125.454019  9118991.613968 
+281120.526772  9118997.635530 
+281107.617402  9118999.629267 
+281101.616323  9118994.599232 
+281089.672119  9118992.575819 
+281070.805132  9118995.567004 
+281066.828559  9118995.562253 
+281051.923653  9118996.549016 
+281040.015662  9118999.548505 
+281031.075613  9119000.542392 
+281011.250680  9119008.555281 
+280991.461946  9119021.591080 
+280984.575354  9119031.628587 
+280977.667034  9119038.652344 
+280967.790761  9119047.681698 
+280961.847616  9119050.688310 
+280950.004769  9119062.729032 
+280948.088890  9119072.772487 
+280947.138192  9119078.798798 
+280950.185800  9119087.843620 
+280940.244341  9119087.831720 
+280929.330459  9119090.832378 
+280908.518555  9119099.848630 
+280897.698790  9119115.908871 
+280892.836660  9119130.971673 
+280892.930784  9119144.031263 
+280889.977303  9119148.046025 
+280882.074805  9119155.068584 
+280874.165063  9119161.086559 
+280869.201564  9119162.085187 
+280849.419959  9119176.125534 
+280834.543930  9119181.130577 
+280827.606608  9119184.135986 
+280810.771230  9119193.156976 
+280801.860083  9119198.169165 
+280784.045021  9119209.198124 
+280776.193161  9119223.252762 
+280775.249679  9119230.283660 
+280769.436782  9119251.372775 
+280763.580453  9119266.434384 
+280760.742765  9119286.522494 
+280754.908146  9119304.597857 
+280750.024247  9119316.646906 
+280744.160669  9119330.703931 
+280738.246422  9119337.728864 
+280729.385905  9119349.773140 
+280725.503387  9119362.827967 
+280730.604439  9119380.916456 
+280736.743081  9119405.033643 
+280724.726375  9119392.964312 
+280712.760341  9119387.927069 
+280703.798482  9119385.907158 
+280698.813239  9119383.892020 
+280681.890914  9119380.857968 
+280665.969981  9119378.829688 
+280657.000887  9119375.805182 
+280644.040707  9119370.766723 
+280636.036825  9119363.725066 
+280620.050775  9119352.655502 
+280602.163248  9119353.638562 
+280585.291576  9119357.636568 
+280563.485303  9119366.651512 
+280553.594402  9119373.671641 
+280537.760273  9119383.698343 
+280538.862938  9119398.768325 
+280537.941124  9119408.812985 
+280536.039623  9119420.865618 
+280524.203799  9119433.910866 
+280515.292566  9119438.923018 
+280506.345163  9119438.912240 
+280492.419747  9119437.890884 
+280478.508795  9119438.878696 
+280458.640138  9119440.863898 
+280443.720561  9119439.841329 
+280429.838533  9119444.847472 
+280407.001858  9119448.838227 
+280393.105357  9119451.835187 
+280384.150715  9119450.819799 
+280369.209439  9119446.783447 
+280360.247566  9119444.763467 
+280348.310453  9119443.744469 
+280336.380570  9119443.730054 
+280323.456529  9119443.714434 
+280316.504659  9119444.710609 
+280301.621219  9119448.710928 
+280298.631518  9119447.702735 
+280289.669645  9119445.682740 
+280282.659943  9119438.642214 
+280268.662230  9119427.574917 
+280262.653919  9119421.540176 
+280246.675131  9119411.475051 
+280231.704960  9119403.420297 
+280212.787075  9119399.379070 
+280206.771547  9119392.339732 
+280205.712350  9119383.297239 
+280194.661008  9119367.210587 
+280186.671628  9119362.178009 
+280178.653347  9119353.127078 
+280169.669816  9119348.093291 
+280155.701057  9119341.044297 
+280143.691712  9119329.979359 
+280130.680994  9119317.908621 
+280098.810228  9119309.833296 
+280041.141987  9119308.758650 
+280015.272272  9119305.713455 
+279994.387779  9119304.683470 
+279956.588192  9119301.623724 
+279936.640090  9119292.558210 
+279908.644894  9119270.423333 
+279880.584755  9119239.247127 
+279840.638107  9119214.083873 
+279815.654331  9119195.970914 
+279796.743747  9119192.934073 
+279771.882667  9119191.899115 
+279735.098945  9119191.854144 
+279695.361607  9119195.823855 
+279660.573389  9119196.785849 
+279631.786161  9119202.778080 
+279609.972438  9119210.788006 
+279589.188921  9119223.822098 
+279575.378911  9119238.873899 
+279562.627956  9119262.968239 
+279554.790085  9119279.031944 
+279545.950840  9119294.089839 
+279539.121541  9119312.163947 
+279525.318703  9119328.220335 
+279514.556025  9119352.317112 
+279505.760023  9119373.402554 
+279488.873724  9119375.390997 
+279470.128891  9119395.459642 
+279462.254920  9119406.500386 
+279433.575658  9119427.561409 
+279413.894294  9119455.665557 
+279409.060466  9119474.746697 
+279409.240710  9119499.861496 
+279391.439493  9119512.899207 
+279373.551756  9119513.881807 
+279360.649253  9119516.879696 
+279346.839086  9119531.931467 
+279341.998020  9119550.008017 
+279340.225951  9119580.143341 
+279333.490264  9119611.277147 
+279328.764534  9119645.427175 
+279332.878173  9119664.519318 
+279330.075900  9119689.630460 
+279315.358024  9119716.736123 
+279291.001210  9119786.022446 
+279271.420567  9119828.190885 
+279720.674826  9120919.716068 
+279649.006272  9120907.574044 
+279606.299319  9120913.549604 
+279587.496316  9120925.581707 
+279552.894523  9120952.663298 
+279513.292830  9120975.720456 
+279489.424932  9120974.686796 
+279451.732153  9120986.695835 
+279420.018960  9121000.721308 
+279404.111824  9121000.701899 
+279362.276194  9120989.600417 
+279338.364970  9120982.539129 
+279308.495791  9120976.475125 
+279282.610615  9120971.420557 
+279247.835395  9120974.391759 
+279217.123522  9120989.422913 
+279196.353598  9121004.466231 
+279171.686217  9121030.555188 
+279151.917669  9121046.604304 
+279133.172156  9121066.673005 
+279118.324086  9121075.696057 
+279099.484786  9121082.705042 
+279080.573360  9121079.668090 
+279070.602518  9121075.637518 
+279053.643436  9121067.580027 
+279030.762427  9121065.542764 
+279019.891127  9121074.570672 
+279001.080643  9121085.597994 
+278990.504947  9121135.814234 
+278979.741775  9121159.911043 
+278967.011819  9121187.019189 
+278949.202690  9121199.052319 
+278927.272553  9121190.988678 
+278922.114105  9121164.863123 
+278921.011771  9121149.792991 
+278905.111748  9121150.778016 
+278898.109084  9121144.741888 
+278884.197464  9121145.729352 
+278869.392549  9121160.779906 
+278857.555817  9121173.824942 
+278845.661420  9121178.833222 
+278805.842852  9121171.752067 
+278792.954243  9121176.759109 
+278779.971954  9121168.706417 
+278753.157290  9121172.691689 
+278738.265854  9121175.687075 
+278721.422031  9121183.702977 
+278707.589630  9121195.740937 
+278696.703814  9121202.759601 
+278681.884400  9121215.800924 
+278667.951127  9121213.774543 
+278654.940026  9121201.703431 
+278643.946152  9121193.653153 
+278629.991276  9121188.612971 
+278606.231201  9121202.647807 
+278731.220286  9121440.889096 
+278718.410863  9121456.946682 
+278845.440395  9121702.221921 
+278871.311599  9121705.267456 
+279570.061479  9123062.304523 
+279592.777067  9123041.235707 
+279594.678730  9123029.183032 
+279608.489554  9123014.130966 
+279620.311892  9122999.076502 
+279638.135826  9122989.052167 
+279653.013217  9122984.047180 
+279663.942596  9122983.055758 
+279674.871974  9122982.064333 
+279703.871306  9123005.204564 
+279727.711303  9123002.219492 
+279750.491915  9122990.191919 
+279762.386573  9122985.183315 
+279785.254026  9122985.210787 
+279803.077904  9122975.186398 
+279806.975223  9122964.140704 
+279811.874016  9122954.100792 
+279818.761279  9122944.063268 
+279829.582048  9122928.002990 
+279853.443699  9122928.031628 
+279891.202920  9122925.063185 
+279902.146747  9122926.080885 
+279919.005297  9122920.073621 
+279932.859413  9122911.049015 
+279939.746641  9122901.011480 
+279954.479115  9122875.914665 
+279968.246309  9122854.835007 
+279979.110454  9122844.802234 
+279990.976070  9122835.775238 
+280000.874942  9122829.759620 
+280012.726064  9122818.723445 
+280019.598777  9122806.676732 
+280022.509047  9122796.634433 
+280032.320994  9122778.563768 
+280035.216774  9122766.512296 
+280036.116851  9122753.453856 
+280034.012509  9122737.378086 
+280029.926952  9122722.304521 
+280022.858711  9122707.227384 
+280022.822500  9122702.204449 
+280049.456664  9122673.103568 
+280089.008515  9122643.013557 
+280105.823467  9122630.978736 
+280117.674517  9122619.942552 
+280133.495226  9122607.906536 
+280150.360862  9122602.903808 
+280169.214945  9122597.903452 
+280188.076268  9122593.907674 
+280214.913131  9122592.935144 
+280244.790637  9122600.002844 
+280269.689771  9122606.060009 
+280303.580428  9122618.155336 
+280318.530061  9122623.196034 
+280341.404512  9122624.227858 
+280357.312129  9122624.246801 
+280380.193826  9122626.283190 
+280390.121586  9122624.285851 
+280403.982749  9122616.265732 
+280412.822029  9122601.207604 
+280414.759729  9122594.177875 
+280412.706030  9122585.134246 
+280403.642011  9122569.050242 
+280396.595446  9122556.986941 
+280393.525781  9122544.928372 
+280398.359165  9122525.847174 
+280402.270817  9122516.810643 
+280409.092643  9122497.731812 
+280412.997041  9122487.690697 
+280419.876857  9122476.648545 
+280430.726309  9122464.606541 
+280451.597723  9122463.626794 
+280465.538583  9122466.657101 
+280476.467774  9122465.665520 
+280491.315845  9122456.641987 
+280498.217389  9122448.613583 
+280508.116096  9122442.597892 
+280525.975821  9122437.596232 
+280541.897861  9122439.624295 
+280554.837238  9122441.648810 
+280568.734574  9122438.651582 
+280561.637235  9122419.556223 
+280559.576273  9122409.508021 
+280556.455825  9122390.417381 
+280554.213574  9122355.254574 
+280554.191819  9122352.240822 
+280556.035225  9122332.151500 
+280566.841098  9122314.081976 
+280580.673128  9122302.043497 
+280586.587671  9122295.018492 
+280597.437038  9122282.976469 
+280604.316784  9122271.934308 
+280614.142915  9122255.872767 
+280623.947283  9122236.797475 
+280631.719698  9122211.692319 
+280637.510930  9122187.589388 
+280636.407928  9122172.519452 
+280636.320900  9122160.464446 
+280629.259869  9122146.392011 
+280616.204553  9122128.294153 
+280608.149321  9122114.220531 
+280609.970966  9122091.117462 
+280612.837584  9122075.047661 
+280611.727351  9122058.973137 
+280610.609870  9122041.894028 
+280618.447547  9122025.830134 
+280629.340366  9122019.815624 
+280651.162254  9122012.809515 
+280673.978343  9122005.804579 
+280693.811791  9121998.796093 
+280718.630789  9121993.802664 
+280733.551198  9121994.824934 
+280753.457165  9121997.862258 
+280773.392150  9122004.917905 
+280795.308305  9122010.971314 
+280811.280968  9122020.031397 
+280826.252169  9122028.085714 
+280857.043668  9122024.103852 
+280874.823345  9122008.051697 
+280882.697198  9121997.010696 
+280885.600002  9121985.963815 
+280893.415796  9121966.886154 
+280902.218536  9121946.805085 
+280912.051763  9121931.748104 
+280922.929992  9121923.724374 
+280937.785048  9121915.705342 
+280950.673456  9121910.697703 
+280957.618391  9121908.696761 
+280970.463245  9121897.661626 
+280977.299303  9121880.591951 
+280977.146883  9121859.495729 
+280976.029292  9121842.416660 
+280972.908777  9121823.326077 
+280969.817297  9121808.253822 
+280966.682276  9121787.154073 
+280972.509611  9121768.074063 
+280972.473324  9121763.051152 
+281004.186236  9121749.024594 
+281036.973172  9121746.049591 
+281061.806474  9121743.065182 
+281086.654289  9121742.089922 
+281102.641396  9121753.159077 
+281128.483413  9121752.184966 
+281141.400789  9121751.195614 
+281160.297902  9121752.222448 
+281178.258907  9121761.284750 
+281194.209725  9121767.330961 
+281215.138822  9121774.387595 
+281228.077986  9121776.411960 
+281242.018615  9121779.442070 
+281267.889680  9121782.486199 
+281281.830311  9121785.516297 
+281292.810128  9121791.556627 
+281302.861129  9121806.637008 
+281308.971648  9121826.735617 
+281308.144544  9121849.839794 
+281305.263645  9121863.900415 
+281310.372709  9121882.993273 
+281312.462836  9121897.059729 
+281320.467337  9121904.101124 
+281333.341141  9121897.084229 
+281344.190199  9121885.042099 
+281355.031986  9121871.995387 
+281365.881033  9121859.953255 
+281379.749020  9121852.937517 
+281391.635862  9121846.924025 
+281406.534379  9121844.932345 
+281423.435836  9121844.952149 
+281443.341705  9121847.989178 
+281464.249047  9121852.031940 
+281493.175439  9121865.125211 
+281514.126407  9121875.195422 
+281537.065789  9121885.267945 
+281554.990536  9121889.307174 
+281587.617461  9121864.231031 
+281597.479501  9121853.192277 
+281614.242777  9121834.125018 
+281636.956704  9121813.055562 
+281658.756408  9121803.035301 
+281675.614187  9121797.027546 
+281681.521208  9121788.997878 
+281686.375841  9121772.930425 
+281685.301638  9121761.878907 
+281687.064576  9121730.739304 
+281705.787080  9121707.656039 
+281717.717465  9121707.669950 
+281756.440291  9121700.683093 
+281776.375179  9121707.738298 
+281810.185196  9121708.782228 
+281837.108583  9121719.863812 
+281854.046336  9121724.906354 
+281878.966786  9121733.976441 
+281899.939559  9121747.060200 
+281915.926793  9121758.129021 
+281935.934501  9121775.229911 
+281953.961104  9121793.333058 
+281973.917884  9121803.401888 
+281998.874789  9121817.494775 
+282010.834305  9121821.526908 
+282030.798386  9121832.600283 
+282049.790120  9121846.686224 
+282076.699054  9121855.758479 
+282095.661678  9121865.826092 
+282123.564827  9121874.899465 
+282155.386512  9121875.940809 
+282174.312733  9121880.985507 
+282189.225732  9121881.002728 
+282209.058733  9121873.993655 
+282222.977528  9121874.009718 
+282246.838316  9121874.037245 
+282268.710702  9121874.062467 
+282288.594687  9121874.085387 
+282308.456809  9121871.094574 
+282334.233104  9121861.078602 
+282348.086292  9121852.053459 
+282357.984546  9121846.037458 
+282373.745947  9121825.964281 
+282394.471032  9121804.892248 
+282414.245636  9121789.846510 
+282429.049244  9121774.795050 
+282449.861757  9121765.777890 
+282470.659679  9121754.751574 
+282498.467992  9121750.765260 
+282522.277641  9121743.760644 
+282551.050962  9121735.757149 
+282578.837367  9121728.757072 
+282607.617953  9121721.758119 
+282625.491567  9121718.764911 
+282649.359516  9121719.796820 
+282663.300112  9121722.826479 
+282671.312019  9121730.872167 
+282685.340156  9121745.956688 
+282698.374108  9121761.040065 
+282716.386339  9121777.133694 
+282736.423453  9121798.252447 
+282751.475016  9121817.356362 
+282764.487120  9121829.425993 
+282780.408845  9121831.453305 
+282788.362410  9121831.462387 
+282801.367228  9121842.527432 
+282812.420153  9121858.613063 
+282831.390162  9121869.684902 
+282846.339599  9121874.724768 
+282861.252542  9121874.741770 
+282874.177091  9121874.756501 
+282886.056343  9121867.738097 
+282891.919318  9121853.680895 
+282894.690206  9121824.551724 
+282899.558981  9121810.493390 
+282904.427754  9121796.435055 
+282910.298019  9121783.382425 
+282913.178401  9121769.321826 
+282914.106895  9121760.281817 
+282936.863835  9121745.239298 
+282955.731596  9121742.247096 
+282976.587739  9121739.257150 
+282991.464119  9121734.251267 
+283010.280754  9121724.227049 
+283029.090078  9121713.198255 
+283035.991001  9121705.169603 
+283044.887607  9121698.147782 
+283058.777074  9121694.145322 
+283082.637659  9121694.172436 
+283099.546209  9121695.196204 
+283129.364630  9121694.225498 
+283149.255748  9121695.252632 
+283161.186036  9121695.266167 
+283184.132778  9121706.342368 
+283197.093786  9121711.379868 
+283218.044854  9121721.449224 
+283248.959760  9121734.543534 
+283272.849572  9121738.588821 
+283294.736387  9121740.622706 
+283319.671553  9121751.701074 
+283331.645698  9121757.741975 
+283346.675514  9121773.831930 
+283358.708146  9121787.909371 
+283368.796263  9121808.011974 
+283384.834924  9121826.112169 
+283403.826930  9121840.197447 
+283474.473080  9121848.313579 
+283525.352410  9121872.480306 
+283549.366633  9121893.603074 
+283564.352675  9121903.665522 
+283592.329072  9121922.783596 
+283613.302239  9121935.866427 
+283623.310021  9121944.918697 
+283637.301899  9121954.979996 
+283655.321779  9121972.077721 
+283664.306112  9121977.110595 
+283675.293470  9121984.154831 
+283694.270977  9121996.230815 
+283708.218971  9122000.264684 
+283726.158382  9122006.312137 
+283760.019544  9122014.386526 
+283785.919837  9122021.447422 
+283805.847648  9122027.497064 
+283834.715890  9122032.552132 
+283852.669962  9122040.608660 
+283869.629846  9122048.664069 
+283884.564730  9122051.694421 
+283900.501134  9122055.730443 
+283915.421373  9122056.751653 
+283958.208349  9122061.822165 
+283979.123052  9122066.868265 
+284002.048123  9122074.930264 
+284020.981769  9122080.978692 
+284032.005822  9122093.045647 
+284038.117520  9122113.143584 
+284040.186503  9122124.196011 
+284043.220376  9122131.231283 
+284062.234649  9122148.329899 
+284081.256264  9122166.433068 
+284089.283111  9122176.487555 
+284112.494068  9122223.727492 
+284120.579567  9122241.818484 
+284125.726457  9122265.933548 
+284134.820829  9122286.034766 
+284146.890477  9122305.134725 
+284170.912515  9122327.261602 
+284183.903079  9122336.317008 
+284207.807843  9122342.370836 
+284227.699154  9122343.397426 
+284242.590140  9122340.400250 
+284260.500383  9122342.429188 
+284273.461631  9122347.466309 
+284293.396940  9122354.520251 
+284331.249835  9122364.607653 
+284350.198290  9122372.665030 
+284364.168421  9122379.712345 
+284387.071675  9122384.760407 
+284398.015199  9122385.777040 
+284425.860104  9122386.812316 
+284453.682993  9122384.833888 
+284474.517136  9122378.829525 
+284498.333866  9122372.828439 
+284524.153660  9122368.838656 
+284547.985051  9122364.846672 
+284572.788613  9122357.842084 
+284597.584824  9122349.832923 
+284622.395704  9122343.832873 
+284653.157072  9122335.830241 
+284681.988767  9122335.861898 
+284704.891993  9122340.909798 
+284725.843544  9122350.978309 
+284738.819500  9122358.024407 
+284763.755193  9122369.101817 
+284784.670043  9122374.147492 
+284808.560139  9122378.191860 
+284837.421219  9122382.241654 
+284844.402632  9122385.262948 
+284867.386692  9122401.360918 
+284885.385088  9122415.444320 
+284897.425659  9122430.525755 
+284909.502976  9122450.629986 
+284915.651857  9122475.750496 
+284921.727266  9122490.825406 
+284933.819312  9122512.938742 
+284943.952369  9122539.068142 
+284948.024703  9122552.131755 
+284964.100933  9122575.253972 
+284990.111834  9122597.382453 
+285011.122353  9122615.487263 
+285030.195945  9122640.621809 
+285044.372071  9122675.796524 
+285044.467645  9122688.855791 
+285048.488566  9122694.887471 
+285054.542005  9122706.948667 
+285062.576501  9122718.007465 
+285070.611001  9122729.066260 
+285088.646360  9122748.172328 
+285099.656129  9122758.229797 
+285114.613300  9122764.273346 
+285135.623947  9122782.378067 
+285148.636851  9122794.446794 
+285165.655997  9122810.538063 
+285182.689868  9122828.638438 
+285191.696554  9122836.684603 
+285211.713059  9122854.788196 
+285222.818518  9122877.904875 
+285226.905694  9122892.977551 
+285236.980181  9122911.070357 
+285260.973563  9122929.178220 
+285276.917652  9122934.218214 
+285296.875362  9122944.285290 
+285310.831045  9122949.323121 
+285333.734586  9122954.370613 
+285352.639224  9122956.400127 
+285371.529141  9122956.420519 
+285385.448026  9122956.435540 
+285427.256206  9122963.512473 
+285446.138756  9122962.528277 
+285459.033981  9122958.523977 
+285478.837101  9122947.495273 
+285484.736065  9122938.460689 
+285494.619210  9122930.434943 
+285512.433898  9122919.404088 
+285523.318602  9122912.383965 
+285550.073746  9122900.358172 
+285573.912544  9122897.370165 
+285589.849263  9122901.405489 
+285620.772697  9122915.502386 
+285636.775719  9122928.578693 
+285649.759304  9122936.629013 
+285668.730219  9122947.699394 
+285689.674817  9122956.762787 
+285697.665291  9122961.794092 
+285713.646243  9122971.856697 
+285728.632997  9122981.918229 
+285754.526533  9122987.973246 
+285771.435382  9122988.995895 
+285796.275756  9122987.013383 
+285817.117196  9122982.012942 
+285834.953905  9122973.995640 
+285849.785881  9122962.961482 
+285858.637887  9122949.911836 
+285866.503057  9122937.865683 
+285872.320847  9122917.780969 
+285873.167623  9122897.690944 
+285883.985903  9122881.629760 
+285891.851058  9122869.583606 
+285904.709330  9122860.556425 
+285917.574968  9122852.533795 
+285935.448467  9122849.539240 
+285953.344079  9122849.558341 
+285972.226517  9122848.573942 
+285996.035713  9122841.567513 
+286001.971419  9122837.555658 
+286025.721608  9122822.512788 
+286042.549256  9122812.485262 
+286061.402169  9122807.482616 
+286084.246622  9122804.493304 
+286096.221263  9122810.533322 
+286123.094140  9122814.580095 
+286141.026604  9122819.621891 
+286160.984355  9122829.688556 
+286181.892046  9122833.728950 
+286199.750738  9122828.725193 
+286216.556200  9122815.683954 
+286237.301550  9122797.624169 
+286249.128621  9122783.573095 
+286269.881323  9122766.517855 
+286290.685666  9122756.494473 
+286316.460980  9122746.476353 
+286331.359166  9122744.483051 
+286346.190923  9122733.448778 
+286368.887664  9122710.368302 
+286380.699909  9122694.308105 
+286385.560164  9122679.245092 
+286401.371318  9122666.202758 
+286411.261588  9122659.181418 
+286422.175577  9122656.179334 
+286436.020470  9122646.148543 
+286454.836323  9122636.123006 
+286480.648432  9122631.127574 
+286497.557098  9122632.149983 
+286513.471569  9122633.171336 
+286530.402385  9122637.207385 
+286539.394428  9122643.244136 
+286557.393290  9122657.326731 
+286570.487662  9122680.445030 
+286585.511352  9122695.529014 
+286594.569886  9122710.606703 
+286613.555599  9122723.685763 
+286625.567186  9122734.748383 
+286644.493818  9122739.791023 
+286658.434704  9122742.819323 
+286683.208298  9122731.795421 
+286703.010908  9122720.766282 
+286713.895319  9122713.745931 
+286728.778667  9122709.743407 
+286741.636679  9122700.716040 
+286750.495746  9122688.670845 
+286783.141530  9122666.605212 
+286832.718100  9122648.575494 
+286842.652625  9122647.581373 
+286852.542801  9122640.559955 
+286869.421877  9122637.564028 
+286879.319438  9122631.547155 
+286898.149928  9122623.530558 
+286914.977244  9122613.502774 
+286931.789767  9122601.465889 
+286946.628686  9122591.436015 
+286964.391020  9122573.372870 
+286981.159151  9122555.308682 
+286996.947869  9122539.252548 
+287009.813164  9122531.229678 
+287025.616651  9122517.182635 
+287044.417480  9122505.147802 
+287061.252109  9122496.124531 
+287076.090962  9122486.094630 
+287093.949345  9122481.090579 
+287109.856329  9122481.107187 
+287124.791315  9122484.136394 
+287136.721552  9122484.148842 
+287157.577274  9122481.156976 
+287167.489547  9122477.149152 
+287177.372228  9122469.123137 
+287188.212104  9122456.075419 
+287200.083147  9122448.051473 
+287219.848481  9122431.999433 
+287231.667724  9122416.943651 
+287251.484823  9122407.923433 
+287267.376971  9122405.930897 
+287282.274932  9122403.937322 
+287294.227337  9122406.963375 
+287305.148560  9122404.965656 
+287327.035402  9122406.997491 
+287345.917491  9122406.012576 
+287362.811211  9122405.025588 
+287380.684308  9122402.030534 
+287409.523024  9122403.065008 
+287426.394528  9122399.064359 
+287438.258100  9122390.035819 
+287447.161327  9122384.017822 
+287456.027538  9122372.977094 
+287461.933407  9122364.946911 
+287466.815480  9122352.897513 
+287470.681160  9122337.833446 
+287488.420954  9122316.756533 
+287495.283975  9122303.704650 
+287513.119994  9122295.686826 
+287520.079256  9122295.694036 
+287539.948052  9122293.705537 
+287566.783508  9122292.728778 
+287593.633771  9122293.761095 
+287640.382437  9122296.823034 
+287660.295658  9122300.861754 
+287685.202000  9122307.919230 
+287710.086123  9122311.963056 
+287727.009401  9122314.994122 
+287753.881885  9122319.039974 
+287764.817860  9122319.051244 
+287783.736908  9122323.088880 
+287799.680830  9122328.127982 
+287814.652807  9122336.179686 
+287821.619475  9122337.191392 
+287840.590409  9122348.260810 
+287849.567672  9122352.288188 
+287867.588909  9122369.383831 
+287877.597419  9122378.434942 
+287892.673199  9122400.550224 
+287899.699178  9122409.598264 
+287909.744769  9122423.672082 
+287917.831658  9122441.762030 
+287926.838600  9122449.807560 
+287929.843385  9122452.824250 
+287937.863563  9122461.873301 
+287946.870512  9122469.918825 
+287956.849402  9122474.951737 
+287965.848942  9122481.992713 
+287972.860120  9122489.031649 
+287983.803537  9122490.047399 
+287998.723683  9122491.067221 
+288004.755516  9122500.114218 
+288008.828650  9122513.177349 
+288013.895970  9122526.241497 
+288018.963294  9122539.305643 
+288026.953839  9122544.336498 
+288030.952820  9122547.354197 
+288034.951802  9122550.371895 
+288046.956168  9122560.429528 
+288052.936102  9122562.444715 
+288078.725523  9122554.434806 
+288096.531799  9122542.398588 
+288107.363953  9122528.346170 
+288110.138794  9122500.222031 
+288099.128619  9122490.165429 
+288091.093574  9122479.107331 
+288087.072345  9122473.076010 
+288093.007762  9122469.063939 
+288107.890805  9122465.061015 
+288119.731959  9122453.018699 
+288128.508968  9122429.923369 
+288130.400894  9122416.866351 
+288133.383433  9122416.869399 
+288139.355929  9122417.880036 
+288159.313707  9122427.945768 
+288168.253906  9122426.950363 
+288184.027235  9122408.884845 
+288187.900084  9122394.825316 
+288194.792563  9122385.791541 
+288206.663351  9122377.767381 
+288212.621002  9122376.768925 
+288221.605706  9122381.800763 
+288230.620091  9122390.850766 
+288240.636080  9122400.906321 
+288258.605503  9122410.969979 
+288270.550491  9122412.991219 
+288277.517164  9122414.002850 
+288288.475396  9122417.027614 
+288299.411362  9122417.038750 
+288310.317641  9122413.031719 
+288322.121609  9122395.966660 
+288325.029922  9122385.924283 
+288333.858768  9122369.860730 
+288340.714099  9122355.804235 
+288356.799078  9122379.929406 
+288363.780590  9122382.950107 
+288382.536347  9122364.887576 
+288386.431400  9122353.841668 
+288394.340275  9122347.822508 
+288402.323383  9122351.848755 
+288409.379130  9122364.914858 
+288423.282760  9122362.919916 
+288433.135438  9122350.875526 
+288439.041103  9122342.845258 
+288447.988691  9122342.854344 
+288457.997277  9122351.905302 
+288473.941227  9122356.944149 
+288484.877168  9122356.955244 
+288498.758511  9122351.946660 
+288515.600099  9122343.927476 
+288522.433087  9122326.857347 
+288524.302622  9122310.786720 
+288523.152502  9122289.690367 
+288520.036314  9122271.605618 
+288529.918651  9122263.579377 
+288539.875245  9122265.598537 
+288557.852072  9122276.666615 
+288570.768912  9122275.675170 
+288586.579146  9122262.632262 
+288591.579725  9122266.655455 
+288596.647151  9122279.719507 
+288604.697103  9122292.786576 
+288614.846831  9122320.923750 
+288632.801408  9122328.978170 
+288636.852395  9122339.027588 
+288636.896967  9122345.054826 
+288642.943737  9122356.110793 
+288641.074247  9122372.181415 
+288641.215398  9122391.267667 
+288643.344904  9122410.355928 
+288652.389077  9122423.423984 
+288666.411573  9122437.501598 
+288683.364597  9122444.550441 
+288700.302765  9122449.590198 
+288710.214815  9122445.582075 
+288719.088100  9122435.545711 
+288726.959773  9122424.503805 
+288739.765168  9122408.444218 
+288744.661736  9122398.403841 
+288753.572162  9122393.390170 
+288765.517136  9122395.411277 
+288776.453070  9122395.422300 
+288788.427773  9122401.461556 
+288794.377963  9122399.458488 
+288807.265084  9122394.448814 
+288818.104388  9122381.400826 
+288830.961768  9122372.372993 
+288838.870569  9122366.353769 
+288858.694595  9122358.337474 
+288868.524834  9122343.279402 
+288877.435232  9122338.265712 
+288887.391840  9122340.284789 
+288904.240756  9122333.270017 
+288902.118590  9122315.186331 
+288900.011296  9122299.111720 
+288902.845131  9122279.023956 
+288919.649416  9122265.981955 
+288932.566220  9122264.990410 
+288940.482423  9122259.975714 
+288958.295730  9122248.943778 
+288978.179162  9122248.963751 
+288994.071035  9122246.970647 
+289001.022798  9122245.973095 
+289016.907230  9122242.975447 
+289035.789045  9122241.989859 
+289049.640506  9122232.962981 
+289050.471062  9122210.864155 
+289054.351062  9122197.809157 
+289064.181205  9122182.751065 
+289074.093152  9122178.742884 
+289085.029016  9122178.753846 
+289102.924065  9122178.771778 
+289116.849874  9122179.790258 
+289126.724621  9122170.759381 
+289132.600373  9122158.710910 
+289143.372579  9122136.622047 
+289166.030154  9122108.517903 
+289184.807746  9122093.468754 
+289204.646449  9122087.461424 
+289213.534432  9122079.434080 
+289224.433064  9122074.422331 
+289237.334907  9122071.421641 
+289259.109835  9122058.384525 
+289280.832662  9122038.315647 
+289301.546421  9122016.236698 
+289320.346250  9122004.201120 
+289335.251274  9122003.211465 
+289354.177608  9122008.252987 
+289376.954070  9121996.221356 
+289385.864330  9121991.207596 
+289409.642380  9121980.181480 
+289416.407990  9121954.070487 
+289411.273421  9121931.965752 
+289406.101645  9121904.838336 
+289393.970749  9121877.703979 
+289392.879834  9121864.644024 
+289400.795909  9121859.629275 
+289413.638127  9121848.592268 
+289419.469117  9121830.516572 
+289421.293693  9121808.418771 
+289427.132121  9121791.347612 
+289432.948217  9121771.262847 
+289431.812645  9121752.175680 
+289417.738137  9121731.066553 
+289404.717336  9121717.994696 
+289400.651403  9121705.936300 
+289401.571142  9121695.891934 
+289402.416465  9121675.802211 
+289401.251151  9121652.696895 
+289394.195319  9121639.630983 
+289380.187841  9121627.562654 
+289366.187811  9121616.498856 
+289363.108618  9121603.436908 
+289374.867349  9121580.344500 
+289386.618630  9121556.247555 
+289396.456001  9121542.193983 
+289410.232776  9121523.121702 
+289421.064287  9121509.069121 
+289430.961170  9121503.051832 
+289441.852203  9121497.035533 
+289456.719842  9121491.023201 
+289468.582694  9121481.994283 
+289476.468932  9121472.961397 
+289481.395039  9121466.939142 
+289479.235566  9121443.832843 
+289479.138819  9121430.773882 
+289479.064400  9121420.728527 
+289489.888427  9121405.671404 
+289496.825154  9121402.664739 
+289514.734746  9121404.691653 
+289528.667736  9121406.714597 
+289539.536401  9121397.684678 
+289546.465679  9121393.673471 
+289305.633672  9120285.437156 
+Region 1
+165
+284875.115311  9113367.414495 
+284866.089074  9113356.354074 
+284844.053326  9113333.224117 
+284824.027478  9113313.110110 
+284802.978478  9113288.976694 
+284783.946666  9113268.863796 
+284755.917854  9113241.708691 
+284748.901542  9113233.664204 
+284739.889947  9113224.612873 
+284717.868910  9113203.491953 
+284689.891206  9113183.368746 
+284664.866356  9113159.230673 
+284640.857393  9113138.107418 
+284613.851891  9113114.971588 
+284589.872123  9113097.866559 
+284568.859782  9113078.755808 
+284545.866755  9113060.647323 
+284522.895602  9113045.552521 
+284502.855452  9113023.429171 
+284487.814426  9113005.329799 
+284471.772135  9112986.224707 
+284455.700726  9112963.101338 
+284445.636986  9112946.012239 
+284436.487138  9112917.874045 
+284425.385734  9112894.756388 
+284414.160553  9112854.561083 
+284403.980359  9112821.398888 
+284394.837861  9112794.265239 
+284388.713747  9112772.157868 
+284376.596589  9112746.025332 
+284368.702922  9112754.052681 
+284360.867494  9112770.116569 
+284350.013692  9112781.154172 
+284333.159550  9112787.162039 
+284314.295584  9112790.153897 
+284295.468008  9112798.168587 
+284277.648971  9112808.193558 
+284275.733775  9112818.236936 
+284277.881885  9112840.339733 
+284276.967959  9112851.388830 
+284265.032784  9112850.370455 
+284243.143140  9112847.331430 
+284236.250700  9112856.364485 
+284224.439242  9112872.423760 
+284211.611951  9112885.468177 
+284182.924430  9112904.521569 
+284166.113867  9112916.556801 
+284149.281466  9112925.578323 
+284119.519860  9112933.580278 
+284112.649209  9112945.627029 
+284096.730750  9112943.599432 
+284073.839781  9112939.554610 
+284046.029760  9112942.535986 
+284017.225736  9112945.516189 
+283994.334763  9112941.471326 
+283967.475084  9112938.426393 
+283940.579047  9112930.358594 
+283905.701973  9112918.263232 
+283868.851463  9112908.174660 
+283835.998749  9112901.104406 
+283823.164044  9112913.144171 
+283829.295206  9112936.256251 
+283818.353985  9112935.238921 
+283790.391275  9112917.124160 
+283775.452272  9112913.088463 
+283757.582158  9112916.081272 
+283744.711087  9112923.098166 
+283717.967667  9112936.126215 
+283695.069423  9112931.076621 
+283680.108618  9112924.027179 
+283645.326015  9112924.991026 
+283633.463443  9112934.018201 
+283606.661855  9112939.009620 
+283588.900663  9112957.070943 
+283549.278767  9112976.111193 
+283515.562722  9112987.121838 
+283487.650883  9112976.038875 
+283455.842935  9112976.001516 
+283435.933921  9112971.959866 
+283412.056175  9112968.918103 
+283391.189464  9112969.898126 
+283360.469871  9112982.921318 
+283348.599952  9112990.943862 
+283353.606244  9112995.972577 
+283411.012051  9113099.510212 
+283515.899051  9113308.582556 
+283618.748309  9113510.620082 
+283620.758132  9113513.636118 
+283626.787601  9113522.684227 
+283623.900058  9113535.740170 
+283481.268407  9114017.763773 
+283404.419332  9114249.728105 
+283405.449696  9114254.752128 
+284215.242663  9114620.346581 
+284258.262932  9114658.569238 
+284300.121575  9114673.685656 
+284314.059881  9114676.715318 
+284335.899403  9114672.722124 
+284310.983019  9114663.652528 
+284291.073243  9114659.611454 
+284275.132303  9114654.570367 
+284264.132364  9114645.516712 
+284258.102583  9114636.468759 
+284251.832292  9114594.270086 
+284241.709799  9114569.144484 
+284234.583981  9114546.031440 
+284222.517180  9114526.930948 
+284215.456964  9114512.859003 
+284208.338461  9114490.750516 
+284208.251023  9114478.695705 
+284211.116520  9114462.626054 
+284243.722656  9114435.540453 
+284285.238541  9114403.442280 
+284319.796193  9114371.336093 
+284366.318524  9114344.266414 
+284414.879868  9114324.230945 
+284439.642949  9114312.204632 
+284458.405428  9114295.148645 
+284469.179264  9114273.060713 
+284475.019442  9114255.989920 
+284479.902053  9114243.940819 
+284509.525796  9114216.851684 
+284523.369156  9114206.821956 
+284535.188011  9114191.767120 
+284547.014150  9114177.716848 
+284576.506540  9114132.545507 
+284601.181947  9114108.464353 
+284633.736524  9114074.346627 
+284729.959090  9114047.333476 
+284735.915885  9114046.335716 
+284745.834147  9114043.333361 
+284774.521945  9114024.279504 
+284786.340667  9114009.224633 
+284793.233094  9114000.191483 
+284803.041888  9113982.120651 
+284806.944972  9113972.079537 
+284812.763112  9113951.995045 
+284815.570025  9113927.888896 
+284814.415485  9113905.787344 
+284811.214556  9113875.647010 
+284810.067323  9113854.550021 
+284811.916715  9113835.465562 
+284816.726248  9113813.370810 
+284821.550372  9113793.285187 
+284833.317960  9113771.198369 
+284836.168652  9113753.119609 
+284840.941693  9113726.002036 
+284841.782482  9113704.907317 
+284840.598779  9113678.787508 
+284838.377301  9113646.639177 
+284833.217589  9113620.514830 
+284830.118849  9113604.438395 
+284829.081073  9113598.409873 
+284827.955756  9113580.326576 
+284828.789269  9113558.227290 
+284837.560221  9113534.127952 
+284844.394227  9113517.058296 
+284850.168571  9113490.946426 
+284848.926541  9113456.790098 
+284849.723584  9113429.667991 
+284860.511696  9113409.589183 
+284872.315685  9113392.525202 
+284883.184028  9113383.496601 
+284880.129078  9113373.447554 
+284875.115311  9113367.414495 
+Region 1
+398
+286425.865814  9114066.314045 
+286422.773798  9114051.242420 
+286419.667120  9114034.161684 
+286411.546423  9114011.048126 
+286397.417715  9113981.900642 
+286382.251035  9113946.724716 
+286362.107037  9113910.538727 
+286341.941085  9113871.339053 
+286312.733876  9113819.070225 
+286282.562057  9113770.818485 
+286257.367637  9113723.576778 
+286232.151298  9113673.321372 
+286207.951002  9113626.080713 
+286184.788712  9113584.868475 
+286158.666455  9113546.666570 
+286139.568130  9113517.513398 
+286114.432630  9113478.307996 
+286089.297179  9113439.102570 
+286062.166467  9113398.890344 
+286033.040502  9113357.671313 
+286008.950433  9113325.498823 
+285976.813321  9113280.258168 
+285944.705551  9113239.035708 
+285913.547931  9113191.786970 
+285892.410753  9113155.599478 
+285872.267602  9113119.413081 
+285862.093627  9113087.256048 
+285843.880000  9113043.035380 
+285834.604978  9112997.820175 
+285830.241403  9112944.574068 
+285822.786205  9112876.256216 
+285821.324198  9112811.963294 
+285816.704784  9112723.557589 
+285823.289729  9112672.332873 
+285794.369288  9112659.241183 
+285770.374890  9112640.127705 
+285750.414905  9112629.055167 
+285723.635959  9112637.061420 
+285707.900410  9112660.148385 
+285686.252128  9112690.260548 
+285672.577595  9112723.395352 
+285668.682068  9112734.441034 
+285638.906477  9112740.434773 
+285609.225873  9112759.487783 
+285615.533239  9112806.708862 
+285610.672944  9112821.771665 
+285598.818220  9112831.803814 
+285578.024941  9112842.830427 
+285574.063620  9112844.835061 
+285569.035241  9112836.792964 
+285561.076061  9112835.779425 
+285546.210140  9112841.789954 
+285538.324025  9112850.822021 
+285529.451229  9112860.857527 
+285522.559092  9112869.890716 
+285508.716363  9112879.920604 
+285493.843112  9112884.926559 
+285483.004244  9112897.973496 
+285469.095747  9112898.962323 
+285454.134822  9112891.913531 
+285442.177772  9112887.881791 
+285423.343171  9112894.892350 
+285417.481513  9112908.949462 
+285416.524048  9112913.971145 
+285418.599674  9112926.028135 
+285409.697618  9112932.045380 
+285389.759447  9112923.986379 
+285370.837178  9112918.942179 
+285363.915785  9112923.957105 
+285356.000404  9112928.970905 
+285339.109923  9112929.956317 
+285337.107343  9112927.944939 
+285322.182929  9112925.918911 
+285315.290737  9112934.952081 
+285311.380505  9112943.988632 
+285302.478427  9112950.005859 
+285285.529520  9112942.954754 
+285269.603809  9112939.923019 
+285254.730494  9112944.928907 
+285244.892823  9112958.981498 
+285231.013486  9112963.988508 
+285203.152603  9112959.938640 
+285180.268963  9112956.898966 
+285170.321776  9112955.883102 
+285146.429551  9112950.833154 
+285122.522732  9112943.774065 
+285105.522756  9112929.690942 
+285095.407738  9112905.570101 
+285084.342525  9112887.475503 
+285070.433993  9112888.464209 
+285053.594567  9112896.481457 
+285049.676984  9112904.513434 
+285054.734480  9112916.573863 
+285047.834930  9112924.602441 
+285035.958136  9112931.620789 
+285014.134150  9112937.623233 
+284987.332913  9112942.615433 
+284969.433807  9112941.590447 
+284957.505932  9112941.576829 
+284946.696045  9112958.641934 
+284943.779722  9112967.679606 
+284934.877573  9112973.696775 
+284915.984460  9112972.670635 
+284902.989651  9112962.610224 
+284893.999979  9112956.572611 
+284876.057105  9112949.520201 
+284854.116399  9112939.449540 
+284850.067519  9112929.399343 
+284847.992038  9112917.342291 
+284844.915278  9112904.279536 
+284835.852712  9112888.196258 
+284824.838631  9112877.133525 
+284812.764950  9112857.028565 
+284789.735542  9112833.897372 
+284770.733134  9112817.802678 
+284752.680993  9112795.681721 
+284735.673877  9112780.593852 
+284715.743114  9112773.539074 
+284692.837682  9112767.485426 
+284675.852454  9112755.411224 
+284654.891287  9112743.332442 
+284630.970027  9112734.263916 
+284613.092835  9112736.252466 
+284597.218183  9112740.252430 
+284585.334046  9112746.266098 
+284567.493265  9112753.277464 
+284549.528647  9112743.211193 
+284536.563106  9112737.168906 
+284523.597569  9112731.126615 
+284514.637116  9112729.107170 
+284484.817494  9112729.072784 
+284470.850692  9112722.024762 
+284456.913022  9112718.995003 
+284454.983302  9112727.029245 
+284453.068146  9112737.072621 
+284436.126663  9112731.025713 
+284419.214307  9112728.997067 
+284400.335818  9112729.979819 
+284383.503545  9112739.001401 
+284376.596589  9112746.025332 
+284388.713747  9112772.157868 
+284394.837861  9112794.265239 
+284403.980359  9112821.398888 
+284414.160553  9112854.561083 
+284425.385734  9112894.756388 
+284436.487138  9112917.874045 
+284445.636986  9112946.012239 
+284455.700726  9112963.101338 
+284471.772135  9112986.224707 
+284487.814426  9113005.329799 
+284502.855452  9113023.429171 
+284522.895602  9113045.552521 
+284545.866755  9113060.647323 
+284568.859782  9113078.755808 
+284589.872123  9113097.866559 
+284613.851891  9113114.971588 
+284640.857393  9113138.107418 
+284664.866356  9113159.230673 
+284689.891206  9113183.368746 
+284717.868910  9113203.491953 
+284739.889947  9113224.612873 
+284748.901542  9113233.664204 
+284755.917854  9113241.708691 
+284783.946666  9113268.863796 
+284802.978478  9113288.976694 
+284824.027478  9113313.110110 
+284844.053326  9113333.224117 
+284866.089074  9113356.354074 
+284875.115311  9113367.414495 
+284880.129078  9113373.447554 
+284883.184028  9113383.496601 
+284872.315685  9113392.525202 
+284860.511696  9113409.589183 
+284849.723584  9113429.667991 
+284848.926541  9113456.790098 
+284850.168571  9113490.946426 
+284844.394227  9113517.058296 
+284837.560221  9113534.127952 
+284828.789269  9113558.227290 
+284827.955756  9113580.326576 
+284829.081073  9113598.409873 
+284830.118849  9113604.438395 
+284833.217589  9113620.514830 
+284838.377301  9113646.639177 
+284840.598779  9113678.787508 
+284841.782482  9113704.907317 
+284840.941693  9113726.002036 
+284836.168652  9113753.119609 
+284833.317960  9113771.198369 
+284821.550372  9113793.285187 
+284816.726248  9113813.370810 
+284811.916715  9113835.465562 
+284810.067323  9113854.550021 
+284811.214556  9113875.647010 
+284814.415485  9113905.787344 
+284815.570025  9113927.888896 
+284812.763112  9113951.995045 
+284806.944972  9113972.079537 
+284803.041888  9113982.120651 
+284793.233094  9114000.191483 
+284786.340667  9114009.224633 
+284774.521945  9114024.279504 
+284745.834147  9114043.333361 
+284735.915885  9114046.335716 
+284729.959090  9114047.333476 
+284633.736524  9114074.346627 
+284601.181947  9114108.464353 
+284576.506540  9114132.545507 
+284547.014150  9114177.716848 
+284535.188011  9114191.767120 
+284523.369156  9114206.821956 
+284509.525796  9114216.851684 
+284479.902053  9114243.940819 
+284475.019442  9114255.989920 
+284469.179264  9114273.060713 
+284458.405428  9114295.148645 
+284439.642949  9114312.204632 
+284414.879868  9114324.230945 
+284366.318524  9114344.266414 
+284319.796193  9114371.336093 
+284285.238541  9114403.442280 
+284243.722656  9114435.540453 
+284211.116520  9114462.626054 
+284208.251023  9114478.695705 
+284208.338461  9114490.750516 
+284215.456964  9114512.859003 
+284222.517180  9114526.930948 
+284234.583981  9114546.031440 
+284241.709799  9114569.144484 
+284251.832292  9114594.270086 
+284258.102583  9114636.468759 
+284264.132364  9114645.516712 
+284275.132303  9114654.570367 
+284291.073243  9114659.611454 
+284310.983019  9114663.652528 
+284335.899403  9114672.722124 
+284314.059881  9114676.715318 
+284300.121575  9114673.685656 
+284258.262932  9114658.569238 
+284215.242663  9114620.346581 
+283405.449696  9114254.752128 
+283502.176945  9114846.552689 
+283527.173397  9114866.673026 
+283540.168651  9114876.733765 
+283559.135424  9114887.806003 
+283569.126745  9114894.849551 
+283600.058389  9114910.958480 
+283615.034474  9114920.016929 
+283633.007238  9114931.087972 
+283667.900529  9114945.192316 
+283691.873945  9114961.293097 
+283716.797747  9114971.367592 
+283769.561979  9114982.478856 
+283800.362680  9114980.505364 
+283833.144173  9114977.529580 
+283845.072657  9114977.543364 
+283878.891869  9114980.596112 
+283894.781946  9114978.605337 
+283933.534936  9114976.640936 
+283963.377979  9114979.689032 
+283987.264068  9114983.734804 
+284013.167377  9114991.801126 
+284040.130305  9115008.909690 
+284066.128357  9115030.035360 
+284085.233731  9115060.194122 
+284101.349723  9115089.344874 
+284116.486273  9115120.503608 
+284131.732179  9115166.730847 
+284134.940264  9115197.875868 
+284141.196096  9115238.065417 
+284159.504421  9115295.346292 
+284175.635157  9115326.506117 
+284194.660564  9115345.614542 
+284225.723928  9115379.805120 
+284251.744174  9115403.944309 
+284278.751202  9115427.080047 
+284300.809898  9115453.223781 
+284325.806997  9115473.343505 
+284362.834844  9115507.540754 
+284388.833344  9115528.666130 
+284424.867232  9115562.862171 
+284460.879277  9115594.044472 
+284474.883569  9115606.115103 
+284488.887868  9115618.185727 
+284509.879731  9115634.282521 
+284544.905136  9115666.468162 
+284580.895436  9115694.636633 
+284616.907685  9115725.818758 
+284646.941057  9115754.984952 
+284672.939820  9115776.110097 
+284712.986851  9115815.333131 
+284727.992633  9115828.409338 
+284745.987894  9115842.493476 
+284800.894716  9115874.701315 
+284872.715161  9115908.937259 
+284957.334120  9115926.110046 
+285037.026710  9115949.304447 
+285093.717102  9115953.386349 
+285141.512204  9115964.490076 
+285184.322409  9115973.579053 
+285220.159603  9115980.651072 
+285260.009613  9115992.750315 
+285303.843175  9116005.858523 
+285333.730702  9116014.932896 
+285360.643392  9116025.008476 
+285404.447706  9116034.098332 
+285442.316988  9116047.199734 
+285455.386166  9116067.305334 
+285485.361629  9116088.434307 
+285508.305479  9116099.509914 
+285524.239672  9116103.545849 
+285542.140003  9116104.570311 
+285560.040332  9116105.594765 
+285586.865183  9116103.615476 
+285598.786523  9116102.624170 
+285619.647033  9116100.638236 
+285652.480166  9116104.692885 
+285695.209879  9116102.731180 
+285733.912053  9116093.733122 
+285756.723997  9116086.726539 
+285779.528601  9116078.715388 
+285810.248969  9116065.690237 
+285840.983978  9116054.674185 
+285870.702919  9116040.643344 
+285895.502905  9116033.638901 
+285924.242422  9116021.616049 
+285953.983306  9116010.598836 
+285982.730121  9115999.580511 
+286011.469582  9115987.557615 
+286034.259393  9115977.537245 
+286055.090436  9115971.532903 
+286072.917312  9115962.511600 
+286088.748744  9115952.483546 
+286103.608130  9115945.468063 
+286122.436369  9115937.452395 
+286143.245360  9115928.434351 
+286181.859152  9115907.381295 
+286203.662160  9115898.364322 
+286225.428462  9115884.324562 
+286244.175910  9115865.258742 
+286260.957270  9115849.204402 
+286279.690009  9115828.129463 
+286285.558863  9115815.076786 
+286299.336034  9115796.005501 
+286311.139787  9115778.941145 
+286291.075397  9115753.805446 
+286262.933918  9115711.583553 
+286253.840753  9115691.482611 
+286243.716865  9115666.357795 
+286226.561319  9115631.179763 
+286221.451697  9115612.087735 
+286216.342081  9115592.995705 
+286212.219175  9115572.900211 
+286211.063721  9115550.798885 
+286207.854162  9115519.654366 
+286207.729440  9115502.576912 
+286209.548778  9115479.474311 
+286212.310801  9115449.340911 
+286217.090245  9115423.227925 
+286218.938930  9115404.143548 
+286223.755052  9115383.053343 
+286230.522563  9115356.942546 
+286233.416636  9115344.891157 
+286240.198813  9115320.789474 
+286248.011701  9115301.711665 
+286256.789274  9115278.616726 
+286257.753962  9115274.599597 
+286264.572806  9115255.520694 
+286275.316423  9115229.414277 
+286278.129782  9115206.312775 
+286279.971118  9115186.223846 
+286281.797783  9115164.125806 
+286285.605174  9115141.025399 
+286291.407960  9115118.931737 
+286301.186862  9115096.842452 
+286302.962170  9115067.712523 
+286305.731509  9115038.583689 
+286310.518248  9115013.475267 
+286314.266942  9114982.338417 
+286318.958312  9114944.170772 
+286325.579047  9114897.968871 
+286330.373115  9114873.865007 
+286334.092465  9114838.709937 
+286338.857188  9114810.587851 
+286348.548009  9114776.443907 
+286354.292076  9114746.313807 
+286359.896769  9114697.097150 
+286365.560144  9114655.916940 
+286368.388163  9114634.824557 
+286377.902913  9114576.571284 
+286399.254326  9114369.658032 
+286416.952424  9114206.940857 
+286417.895097  9114199.910065 
+286423.529133  9114154.711644 
+286426.320483  9114128.596489 
+286428.147161  9114106.498460 
+286427.971159  9114082.389127 
+286425.865814  9114066.314045 
+Region 1
+135
+287443.375587  9115918.795675 
+287427.367799  9115904.714946 
+287398.341740  9115877.561210 
+287353.315338  9115837.331229 
+287350.318490  9115835.318928 
+287314.297427  9115803.134894 
+287281.287979  9115774.972227 
+287226.033969  9115831.167141 
+287209.179437  9115837.176250 
+287194.283541  9115839.169292 
+287183.312288  9115834.134760 
+287177.311242  9115829.105580 
+287167.275157  9115816.035709 
+287160.235918  9115804.978151 
+287152.180566  9115790.905866 
+287141.165175  9115779.844014 
+287136.187616  9115778.834102 
+287129.199900  9115774.808392 
+287115.261264  9115771.779722 
+287103.318066  9115769.757745 
+287101.329985  9115769.755599 
+287088.385390  9115766.727993 
+287078.430274  9115764.708155 
+287064.447498  9115755.652160 
+287051.436698  9115743.583580 
+287043.396103  9115731.520368 
+287035.311377  9115713.429845 
+287028.235408  9115697.349496 
+287024.126851  9115679.263268 
+287015.143727  9115674.230832 
+287007.073736  9115658.149401 
+286991.029385  9115639.045703 
+286983.990221  9115627.988100 
+286979.925819  9115615.929172 
+286979.778735  9115595.838136 
+286980.618337  9115574.743625 
+286981.244679  9115524.517110 
+286976.215672  9115516.475310 
+286954.251305  9115503.392431 
+286936.336614  9115500.359372 
+286931.359085  9115499.349428 
+286918.421924  9115497.326305 
+286891.553565  9115493.278967 
+286874.654966  9115493.260618 
+286852.771486  9115491.227758 
+286833.862761  9115488.193575 
+286819.946265  9115488.178447 
+286799.999408  9115479.115852 
+286796.008567  9115477.102421 
+286780.059906  9115471.057799 
+286759.126375  9115462.998654 
+286751.130003  9115456.962676 
+286739.164840  9115451.926920 
+286734.150577  9115445.894187 
+286673.786255  9115482.996573 
+286669.868883  9115491.028665 
+286668.992394  9115507.100438 
+286668.101212  9115521.163104 
+286666.201300  9115533.215579 
+286656.429900  9115556.309472 
+286649.596528  9115573.379295 
+286637.807652  9115592.452805 
+286625.032074  9115612.529784 
+286607.264249  9115629.587677 
+286595.431268  9115642.633860 
+286579.680884  9115663.712133 
+286563.879068  9115677.758525 
+286554.984115  9115684.780634 
+286539.145560  9115693.804251 
+286528.247826  9115698.815077 
+286513.417989  9115709.848881 
+286495.620706  9115722.888531 
+286477.816068  9115734.923622 
+286443.413760  9115788.126963 
+286426.713273  9115815.231451 
+286386.390636  9115874.455581 
+286409.466652  9115903.612693 
+286437.557000  9115938.802548 
+286466.670821  9115978.011678 
+286468.688297  9115982.032068 
+286484.813432  9116012.186068 
+286507.035120  9116060.428541 
+286532.268406  9116112.692459 
+286559.622131  9116183.040482 
+286572.787311  9116216.204830 
+286590.974226  9116256.406454 
+286615.213708  9116308.669191 
+286635.344720  9116342.845619 
+286655.497821  9116380.035690 
+286673.611383  9116410.191713 
+286690.686801  9116434.319327 
+286718.726281  9116462.476999 
+286744.762973  9116488.623386 
+286771.845236  9116521.802694 
+286797.904060  9116550.962691 
+286812.954705  9116570.065317 
+286837.003395  9116596.209471 
+286860.065411  9116623.357084 
+286875.108751  9116641.455125 
+286904.194048  9116676.645557 
+286910.209926  9116683.683855 
+286926.048672  9116674.660048 
+286957.711425  9116654.603319 
+286999.484034  9116657.661962 
+287076.048736  9116660.757993 
+287172.472512  9116660.861585 
+287213.258400  9116664.923509 
+287231.085173  9116655.901744 
+287247.925245  9116647.883458 
+287269.595640  9116620.784047 
+287269.463047  9116602.702151 
+287270.250852  9116574.575823 
+287292.031704  9116562.544657 
+287294.005084  9116560.537687 
+287266.826732  9116514.299640 
+287254.684470  9116485.154905 
+287235.532295  9116448.970846 
+287210.445289  9116416.798569 
+287223.286982  9116405.762391 
+287244.957315  9116378.663013 
+287267.562758  9116343.528298 
+287283.195084  9116306.377016 
+287290.904449  9116273.235403 
+287293.584644  9116232.052060 
+287304.305606  9116202.931848 
+287323.958259  9116171.812132 
+287339.752544  9116156.760944 
+287363.506559  9116142.722827 
+287389.138159  9116113.618590 
+287409.836332  9116089.531769 
+287429.533072  9116064.439330 
+287453.117564  9116027.296556 
+287477.688698  9115989.150293 
+287500.308549  9115956.024642 
+287443.375587  9115918.795675 
+Region 1
+166
+286878.314280  9114498.765385 
+286876.223415  9114484.699475 
+286872.115145  9114466.613183 
+286863.935345  9114435.463360 
+286859.915227  9114429.431701 
+286855.895110  9114423.400040 
+286847.840191  9114409.327612 
+286845.749346  9114395.261697 
+286848.621215  9114380.196658 
+286849.505061  9114365.129447 
+286843.430835  9114350.054634 
+286831.333804  9114326.936874 
+286825.259592  9114311.862055 
+286821.129344  9114290.762088 
+286818.752146  9114237.518588 
+286763.986251  9114224.399554 
+286721.111767  9114206.270754 
+286686.093956  9114175.091426 
+286658.004886  9114139.901482 
+286644.958044  9114122.809869 
+286626.889816  9114098.680907 
+286575.627030  9114156.888253 
+286565.767659  9114167.927424 
+286548.972235  9114181.972603 
+286544.031539  9114185.985354 
+286529.172765  9114193.000832 
+286518.282685  9114199.016128 
+286506.376585  9114202.016662 
+286490.531124  9114210.035590 
+286470.650938  9114210.013692 
+286449.791410  9114211.999801 
+286416.952424  9114206.940857 
+286399.254326  9114369.658032 
+286377.902913  9114576.571284 
+286368.388163  9114634.824557 
+286365.560144  9114655.916940 
+286359.896769  9114697.097150 
+286354.292076  9114746.313807 
+286348.548009  9114776.443907 
+286338.857188  9114810.587851 
+286334.092465  9114838.709937 
+286330.373115  9114873.865007 
+286325.579047  9114897.968871 
+286318.958312  9114944.170772 
+286314.266942  9114982.338417 
+286310.518248  9115013.475267 
+286305.731509  9115038.583689 
+286302.962170  9115067.712523 
+286301.186862  9115096.842452 
+286291.407960  9115118.931737 
+286285.605174  9115141.025399 
+286281.797783  9115164.125806 
+286279.971118  9115186.223846 
+286278.129782  9115206.312775 
+286275.316423  9115229.414277 
+286264.572806  9115255.520694 
+286257.753962  9115274.599597 
+286256.789274  9115278.616726 
+286248.011701  9115301.711665 
+286240.198813  9115320.789474 
+286233.416636  9115344.891157 
+286230.522563  9115356.942546 
+286223.755052  9115383.053343 
+286218.938930  9115404.143548 
+286217.090245  9115423.227925 
+286212.310801  9115449.340911 
+286209.548778  9115479.474311 
+286207.729440  9115502.576912 
+286207.854162  9115519.654366 
+286211.063721  9115550.798885 
+286212.219175  9115572.900211 
+286216.342081  9115592.995705 
+286221.451697  9115612.087735 
+286226.561319  9115631.179763 
+286243.716865  9115666.357795 
+286253.840753  9115691.482611 
+286262.933918  9115711.583553 
+286291.075397  9115753.805446 
+286311.139787  9115778.941145 
+286336.211131  9115809.105054 
+286355.303552  9115837.253297 
+286379.366230  9115865.406968 
+286386.390636  9115874.455581 
+286426.713273  9115815.231451 
+286443.413760  9115788.126963 
+286477.816068  9115734.923622 
+286495.620706  9115722.888531 
+286513.417989  9115709.848881 
+286528.247826  9115698.815077 
+286539.145560  9115693.804251 
+286554.984115  9115684.780634 
+286563.879068  9115677.758525 
+286579.680884  9115663.712133 
+286595.431268  9115642.633860 
+286607.264249  9115629.587677 
+286625.032074  9115612.529784 
+286637.807652  9115592.452805 
+286649.596528  9115573.379295 
+286656.429900  9115556.309472 
+286666.201300  9115533.215579 
+286668.101212  9115521.163104 
+286668.992394  9115507.100438 
+286669.868883  9115491.028665 
+286673.786255  9115482.996573 
+286734.150577  9115445.894187 
+286681.047961  9115388.577214 
+286647.133271  9115372.467475 
+286643.164481  9115373.467688 
+286631.221383  9115371.445556 
+286613.262668  9115362.385028 
+286599.280095  9115353.328836 
+286589.273660  9115344.276986 
+286580.261263  9115335.226219 
+286575.173597  9115319.147918 
+286571.035909  9115297.043378 
+286569.895010  9115276.951207 
+286555.787643  9115250.817570 
+286546.701849  9115231.721247 
+286527.536258  9115193.527500 
+286520.438553  9115174.433342 
+286517.309633  9115154.338985 
+286518.259614  9115148.312746 
+286519.165547  9115136.259181 
+286520.122870  9115131.237497 
+286530.954410  9115117.185714 
+286544.760689  9115102.132642 
+286566.533867  9115089.097385 
+286576.422751  9115082.076388 
+286589.286373  9115074.054100 
+286603.092618  9115059.001017 
+286609.999408  9115051.976752 
+286620.816217  9115035.915851 
+286631.640362  9115020.859502 
+286640.469105  9115004.796424 
+286647.331822  9114991.744833 
+286651.212460  9114978.689981 
+286655.063723  9114961.616913 
+286656.013687  9114955.590677 
+286656.963652  9114949.564441 
+286658.826865  9114932.489199 
+286663.701522  9114919.435435 
+286668.612895  9114911.404440 
+286690.356570  9114894.350937 
+286702.211408  9114884.318439 
+286724.013811  9114875.301355 
+286742.804757  9114862.262792 
+286749.733533  9114858.252178 
+286762.604404  9114851.234415 
+286774.459212  9114841.201905 
+286787.263964  9114825.143158 
+286809.942800  9114800.054278 
+286806.887281  9114790.005493 
+286801.792305  9114772.922665 
+286793.641823  9114745.791048 
+286789.511500  9114724.691089 
+286780.389056  9114700.572039 
+286789.247085  9114688.527171 
+286802.066490  9114674.477537 
+286823.765936  9114651.396689 
+286840.524660  9114632.328625 
+286861.208013  9114606.233025 
+286870.066004  9114594.188149 
+286874.874469  9114572.093408 
+286878.688917  9114549.997582 
+286879.513975  9114526.893951 
+286878.314280  9114498.765385 
+Region 1
+173
+287426.197880  9113030.719098 
+287409.167964  9113012.618817 
+287389.222265  9113003.556239 
+287368.289942  9112995.497120 
+287345.406405  9112992.458580 
+287327.536842  9112995.452749 
+287305.720748  9113002.460783 
+287286.857196  9113005.453854 
+287264.017724  9113008.442582 
+287237.202331  9113011.426961 
+287208.362249  9113009.386395 
+287187.444623  9113003.336289 
+287163.537719  9112996.278362 
+287148.606004  9112993.248409 
+287128.682366  9112987.199358 
+287131.539478  9112970.125232 
+287111.615852  9112964.076171 
+287101.632014  9112958.037979 
+287092.583424  9112943.964454 
+287088.534096  9112933.914576 
+287085.375971  9112909.802051 
+287085.199783  9112885.692790 
+287083.978236  9112854.550573 
+287085.694578  9112817.384306 
+287079.694022  9112812.355009 
+287070.696860  9112805.313338 
+287062.701017  9112799.277307 
+287056.693125  9112793.243453 
+287023.037413  9112812.292896 
+287004.232601  9112823.322259 
+286989.366991  9112829.333215 
+286968.537517  9112835.337619 
+286916.946112  9112848.340031 
+286895.107961  9112852.334206 
+286872.305171  9112860.345493 
+286846.527773  9112869.358042 
+286838.561278  9112867.340182 
+286837.537959  9112863.320873 
+286823.328866  9112823.123394 
+286820.266252  9112812.070015 
+286815.186348  9112796.996231 
+286813.139718  9112788.957608 
+286813.022367  9112772.884743 
+286811.896372  9112754.801675 
+286813.825649  9112746.767432 
+286685.764070  9112768.726167 
+286550.583206  9112768.576642 
+286453.334588  9112790.568879 
+286351.152553  9112817.578187 
+286339.742718  9112752.269847 
+286361.134166  9112686.997990 
+286403.355101  9112615.722005 
+286397.989721  9112561.470433 
+286315.971330  9112491.060736 
+286197.015230  9112398.509485 
+286083.102592  9112316.008953 
+285985.101147  9112234.530451 
+285922.364130  9112218.387142 
+285877.555124  9112207.286673 
+285851.711940  9112207.257580 
+285823.238546  9112665.300957 
+285823.289729  9112672.332873 
+285816.704784  9112723.557589 
+285821.324198  9112811.963294 
+285822.786205  9112876.256216 
+285830.241403  9112944.574068 
+285834.604978  9112997.820175 
+285843.880000  9113043.035380 
+285862.093627  9113087.256048 
+285872.267602  9113119.413081 
+285892.410753  9113155.599478 
+285913.547931  9113191.786970 
+285944.705551  9113239.035708 
+285976.813321  9113280.258168 
+286008.950433  9113325.498823 
+286033.040502  9113357.671313 
+286062.166467  9113398.890344 
+286089.297179  9113439.102570 
+286114.432630  9113478.307996 
+286139.568130  9113517.513398 
+286158.666455  9113546.666570 
+286184.788712  9113584.868475 
+286207.951002  9113626.080713 
+286232.151298  9113673.321372 
+286257.367637  9113723.576778 
+286282.562057  9113770.818485 
+286312.733876  9113819.070225 
+286341.941085  9113871.339053 
+286362.107037  9113910.538727 
+286382.251035  9113946.724716 
+286397.417715  9113981.900642 
+286411.546423  9114011.048126 
+286419.667120  9114034.161684 
+286422.773798  9114051.242420 
+286425.865814  9114066.314045 
+286427.971159  9114082.389127 
+286428.147161  9114106.498460 
+286426.320483  9114128.596489 
+286423.529133  9114154.711644 
+286417.895097  9114199.910065 
+286416.952424  9114206.940857 
+286449.791410  9114211.999801 
+286470.650938  9114210.013692 
+286490.531124  9114210.035590 
+286506.376585  9114202.016662 
+286518.282685  9114199.016128 
+286529.172765  9114193.000832 
+286544.031539  9114185.985354 
+286548.972235  9114181.972603 
+286565.767659  9114167.927424 
+286575.627030  9114156.888253 
+286626.889816  9114098.680907 
+286701.803088  9114012.372208 
+286738.258279  9113968.212191 
+286789.711509  9113936.123153 
+286861.965252  9113894.011395 
+286779.958095  9113825.612437 
+286772.981300  9113686.977468 
+286760.906576  9113666.873293 
+286743.810522  9113639.731774 
+286730.639109  9113605.562734 
+286714.515087  9113575.408624 
+286708.367707  9113550.288208 
+286705.253671  9113532.202951 
+286707.080258  9113510.104943 
+286705.932206  9113489.008209 
+286698.842213  9113470.918574 
+286688.784924  9113454.834763 
+286673.750351  9113437.740919 
+286664.657732  9113417.639974 
+286657.479759  9113387.495670 
+286656.280406  9113359.367045 
+286661.980309  9113323.209651 
+286671.714836  9113295.093078 
+286687.471956  9113275.019513 
+286708.191664  9113253.946866 
+286723.956089  9113234.877850 
+286752.612979  9113211.804840 
+286776.336592  9113193.749120 
+286803.130177  9113187.751320 
+286847.844829  9113185.791384 
+286881.691680  9113192.860381 
+286912.607954  9113206.957952 
+286931.596422  9113221.042416 
+286949.590915  9113235.125779 
+287056.659568  9113332.683847 
+287128.623233  9113387.007856 
+287131.597851  9113386.006559 
+287141.471622  9113376.976439 
+287157.301968  9113366.948273 
+287180.016755  9113346.882175 
+287198.755577  9113326.811734 
+287216.434280  9113297.699242 
+287230.070906  9113259.541450 
+287237.706884  9113216.354401 
+287245.284087  9113165.130942 
+287253.074326  9113143.039477 
+287265.849158  9113122.962533 
+287272.851107  9113128.997424 
+287280.898467  9113142.065256 
+287286.950521  9113154.126369 
+287360.732976  9113185.347510 
+287371.703525  9113190.382153 
+287378.514415  9113170.298702 
+287383.315291  9113147.199437 
+287391.120154  9113127.117067 
+287399.977788  9113115.072183 
+287406.847456  9113103.025137 
+287418.687021  9113090.983493 
+287430.511880  9113076.932746 
+287435.371528  9113061.869887 
+287435.253931  9113045.797079 
+287426.197880  9113030.719098 
+Region 1
+213
+287788.717658  9114349.068663 
+287770.729822  9114335.990356 
+287762.748323  9114331.963635 
+287756.769563  9114329.948141 
+287663.391953  9114337.884203 
+287658.399838  9114334.865216 
+287647.392157  9114324.807974 
+287629.345469  9114303.693207 
+287617.226024  9114277.562102 
+287604.016909  9114238.370782 
+287597.699607  9114190.146004 
+287602.544504  9114173.074022 
+287605.467632  9114165.040840 
+287606.432195  9114161.023715 
+287596.102120  9114107.771904 
+287591.934778  9114081.649341 
+287590.668496  9114044.479949 
+287583.511815  9114017.349618 
+287575.316999  9113984.190916 
+287581.207408  9113974.151855 
+287590.020941  9113956.079615 
+287630.428971  9113908.909739 
+287647.209164  9113892.855163 
+287661.979275  9113873.784796 
+287672.766034  9113853.705596 
+287681.542717  9113830.610607 
+287685.342063  9113806.505718 
+287685.202232  9113787.419290 
+287682.109861  9113772.347845 
+287681.064352  9113765.314932 
+287675.954564  9113746.223148 
+287665.889536  9113729.135104 
+287653.836534  9113712.044912 
+287641.812973  9113698.972910 
+287626.748583  9113677.861293 
+287613.672191  9113656.751814 
+287600.610526  9113637.651426 
+287589.485360  9113611.521333 
+287583.396363  9113594.437549 
+287578.242515  9113569.318441 
+287576.203045  9113562.284446 
+287572.109397  9113546.207356 
+287570.983009  9113528.124389 
+287574.753009  9113500.001299 
+287579.516996  9113471.879285 
+287582.241522  9113436.723274 
+287580.018187  9113404.575538 
+287572.876417  9113379.454272 
+287563.746689  9113354.330851 
+287559.711916  9113346.290151 
+287554.668452  9113336.239274 
+287542.659748  9113325.176314 
+287533.655061  9113317.130228 
+287529.620298  9113309.089522 
+287524.510668  9113289.997690 
+287524.356254  9113268.902141 
+287523.222566  9113249.814615 
+287520.034742  9113221.683984 
+287515.897059  9113199.579574 
+287520.859615  9113198.580411 
+287527.788075  9113194.569752 
+287543.706483  9113196.596085 
+287551.650981  9113195.600150 
+287572.458406  9113186.581808 
+287555.237192  9113142.363315 
+287540.327489  9113142.347159 
+287519.490664  9113147.347283 
+287498.668535  9113154.356498 
+287479.782900  9113154.336010 
+287475.829031  9113157.345347 
+287456.081727  9113175.405678 
+287434.346444  9113193.463845 
+287421.512882  9113205.504419 
+287416.587073  9113211.526324 
+287412.596443  9113209.512905 
+287408.605813  9113207.499484 
+287371.703525  9113190.382153 
+287360.732976  9113185.347510 
+287286.950521  9113154.126369 
+287280.898467  9113142.065256 
+287272.851107  9113128.997424 
+287265.849158  9113122.962533 
+287253.074326  9113143.039477 
+287245.284087  9113165.130942 
+287237.706884  9113216.354401 
+287230.070906  9113259.541450 
+287216.434280  9113297.699242 
+287198.755577  9113326.811734 
+287180.016755  9113346.882175 
+287157.301968  9113366.948273 
+287141.471622  9113376.976439 
+287131.597851  9113386.006559 
+287128.623233  9113387.007856 
+287056.659568  9113332.683847 
+286949.590915  9113235.125779 
+286931.596422  9113221.042416 
+286912.607954  9113206.957952 
+286881.691680  9113192.860381 
+286847.844829  9113185.791384 
+286803.130177  9113187.751320 
+286776.336592  9113193.749120 
+286752.612979  9113211.804840 
+286723.956089  9113234.877850 
+286708.191664  9113253.946866 
+286687.471956  9113275.019513 
+286671.714836  9113295.093078 
+286661.980309  9113323.209651 
+286656.280406  9113359.367045 
+286657.479759  9113387.495670 
+286664.657732  9113417.639974 
+286673.750351  9113437.740919 
+286688.784924  9113454.834763 
+286698.842213  9113470.918574 
+286705.932206  9113489.008209 
+286707.080258  9113510.104943 
+286705.253671  9113532.202951 
+286708.367707  9113550.288208 
+286714.515087  9113575.408624 
+286730.639109  9113605.562734 
+286743.810522  9113639.731774 
+286760.906576  9113666.873293 
+286772.981300  9113686.977468 
+286779.958095  9113825.612437 
+286861.965252  9113894.011395 
+286789.711509  9113936.123153 
+286738.258279  9113968.212191 
+286701.803088  9114012.372208 
+286626.889816  9114098.680907 
+286644.958044  9114122.809869 
+286658.004886  9114139.901482 
+286686.093956  9114175.091426 
+286721.111767  9114206.270754 
+286763.986251  9114224.399554 
+286818.752146  9114237.518588 
+286821.129344  9114290.762088 
+286825.259592  9114311.862055 
+286831.333804  9114326.936874 
+286843.430835  9114350.054634 
+286849.505061  9114365.129447 
+286848.621215  9114380.196658 
+286845.749346  9114395.261697 
+286847.840191  9114409.327612 
+286855.895110  9114423.400040 
+286859.915227  9114429.431701 
+286863.935345  9114435.463360 
+286872.115145  9114466.613183 
+286876.223415  9114484.699475 
+286878.314280  9114498.765385 
+286879.513975  9114526.893951 
+286878.688917  9114549.997582 
+286874.874469  9114572.093408 
+286870.066004  9114594.188149 
+286861.208013  9114606.233025 
+286840.524660  9114632.328625 
+286823.765936  9114651.396689 
+286802.066490  9114674.477537 
+286789.247085  9114688.527171 
+286780.389056  9114700.572039 
+286789.511500  9114724.691089 
+286793.641823  9114745.791048 
+286801.792305  9114772.922665 
+286806.887281  9114790.005493 
+286809.942800  9114800.054278 
+286819.934428  9114807.096995 
+286830.986196  9114823.181769 
+286839.983811  9114830.223395 
+286850.962123  9114836.262632 
+286877.712519  9114824.237245 
+286895.546107  9114816.220314 
+286908.424283  9114810.207071 
+286927.251878  9114802.191212 
+286942.118083  9114796.180126 
+286952.021535  9114791.168180 
+286965.886364  9114784.151453 
+286990.685396  9114777.146612 
+287001.568156  9114770.126635 
+287004.491413  9114762.093460 
+287004.462013  9114758.075251 
+286996.142385  9114707.839000 
+287004.065126  9114703.829438 
+287015.971284  9114700.828751 
+287022.900004  9114696.818106 
+287041.683423  9114682.774904 
+287048.612138  9114678.764257 
+287051.579487  9114676.758393 
+287088.313986  9114670.771026 
+287121.992901  9114654.734881 
+287148.779854  9114647.732133 
+287171.539264  9114633.693203 
+287191.382795  9114628.691994 
+287207.228200  9114620.672817 
+287210.202890  9114619.671496 
+287236.923609  9114603.627747 
+287250.788322  9114596.610956 
+287271.640543  9114593.619895 
+287288.494641  9114587.610873 
+287304.413564  9114589.637174 
+287328.291948  9114592.676615 
+287347.244407  9114601.737976 
+287361.226805  9114610.793959 
+287374.229909  9114621.857964 
+287388.175529  9114625.891186 
+287599.951842  9114633.151045 
+287612.815105  9114625.128539 
+287629.580782  9114607.064813 
+287719.358299  9114514.743435 
+287723.245964  9114502.693120 
+287728.142365  9114492.652968 
+287741.859643  9114465.545090 
+287757.807963  9114471.589430 
+287831.828187  9114399.341847 
+287810.725720  9114368.178509 
+287788.717658  9114349.068663 
+Region 1
+372
+288121.262096  9114559.372407 
+288113.236297  9114549.318488 
+288104.128019  9114527.208955 
+288099.069507  9114515.149112 
+288092.987502  9114499.070024 
+288082.929475  9114482.986701 
+288082.892614  9114477.963970 
+288082.841009  9114470.932145 
+288075.750268  9114452.842901 
+288068.689022  9114438.771840 
+288066.568322  9114420.687886 
+288070.441143  9114406.628471 
+288075.315338  9114393.574663 
+288083.075714  9114367.464928 
+288093.891813  9114351.403833 
+288101.674292  9114328.307738 
+288109.434650  9114302.198004 
+288107.254982  9114276.077683 
+288101.121427  9114252.966763 
+288097.042224  9114238.898877 
+288096.003996  9114232.870540 
+288083.980161  9114219.798722 
+288065.948107  9114200.693259 
+288050.964397  9114190.631888 
+288023.993735  9114172.521402 
+287993.061829  9114156.415741 
+287997.015035  9114017.793566 
+287997.345963  9113927.385395 
+287998.258919  9113916.336440 
+287991.175717  9113899.251697 
+287987.052405  9113879.156500 
+287984.902352  9113857.054335 
+287984.732924  9113833.949750 
+287992.485974  9113806.835488 
+288006.202969  9113779.727608 
+288012.041687  9113762.656690 
+288011.018229  9113758.637438 
+288009.972673  9113751.604545 
+287999.937001  9113738.534793 
+287988.826320  9113714.413954 
+287986.705757  9113696.329975 
+287988.649543  9113690.304821 
+287976.154547  9113612.941902 
+287979.048132  9113600.890530 
+287980.955094  9113589.842639 
+287976.868671  9113574.770168 
+287969.748740  9113552.662667 
+287965.581321  9113526.540171 
+287966.479572  9113513.482121 
+287963.394517  9113499.415258 
+287956.355614  9113488.357773 
+287942.336727  9113474.279176 
+287932.315878  9113463.218484 
+287921.197970  9113438.093054 
+287916.051346  9113413.978571 
+287908.946211  9113393.880141 
+287901.863170  9113376.795353 
+287891.754017  9113353.680069 
+287886.747294  9113348.651987 
+287884.744605  9113346.640754 
+287879.737884  9113341.612670 
+287870.703706  9113329.548474 
+287863.679581  9113320.500058 
+287860.646108  9113313.465013 
+287859.630044  9113310.450300 
+287860.535699  9113298.396792 
+287864.445381  9113289.360136 
+287873.317608  9113279.324279 
+287879.222610  9113271.294310 
+287882.160388  9113265.270229 
+287883.066039  9113253.216722 
+287869.459781  9113159.779848 
+287859.313920  9113131.641798 
+287821.579535  9113136.623853 
+287819.444403  9113116.530743 
+287813.340723  9113097.437894 
+287807.251766  9113080.354140 
+287800.220344  9113070.301152 
+287790.236424  9113064.263141 
+287779.251172  9113057.219505 
+287771.233140  9113048.169986 
+287763.185684  9113035.102270 
+287760.071330  9113017.017173 
+287759.894769  9112992.908002 
+287765.755630  9112978.850758 
+287759.806490  9112980.853416 
+287754.851325  9112982.857148 
+287722.108974  9112990.858107 
+287673.573306  9113013.910086 
+287609.133938  9113036.944807 
+287598.288425  9113048.987562 
+287563.712424  9113078.081818 
+287532.118315  9113107.179291 
+287502.504774  9113135.274357 
+287479.782900  9113154.336010 
+287498.668535  9113154.356498 
+287519.490664  9113147.347283 
+287540.327489  9113142.347159 
+287555.237192  9113142.363315 
+287572.458406  9113186.581808 
+287551.650981  9113195.600150 
+287543.706483  9113196.596085 
+287527.788075  9113194.569752 
+287520.859615  9113198.580411 
+287515.897059  9113199.579574 
+287520.034742  9113221.683984 
+287523.222566  9113249.814615 
+287524.356254  9113268.902141 
+287524.510668  9113289.997690 
+287529.620298  9113309.089522 
+287533.655061  9113317.130228 
+287542.659748  9113325.176314 
+287554.668452  9113336.239274 
+287559.711916  9113346.290151 
+287563.746689  9113354.330851 
+287572.876417  9113379.454272 
+287580.018187  9113404.575538 
+287582.241522  9113436.723274 
+287579.516996  9113471.879285 
+287574.753009  9113500.001299 
+287570.983009  9113528.124389 
+287572.109397  9113546.207356 
+287576.203045  9113562.284446 
+287578.242515  9113569.318441 
+287583.396363  9113594.437549 
+287589.485360  9113611.521333 
+287600.610526  9113637.651426 
+287613.672191  9113656.751814 
+287626.748583  9113677.861293 
+287641.812973  9113698.972910 
+287653.836534  9113712.044912 
+287665.889536  9113729.135104 
+287675.954564  9113746.223148 
+287681.064352  9113765.314932 
+287682.109861  9113772.347845 
+287685.202232  9113787.419290 
+287685.342063  9113806.505718 
+287681.542717  9113830.610607 
+287672.766034  9113853.705596 
+287661.979275  9113873.784796 
+287647.209164  9113892.855163 
+287630.428971  9113908.909739 
+287590.020941  9113956.079615 
+287581.207408  9113974.151855 
+287575.316999  9113984.190916 
+287583.511815  9114017.349618 
+287590.668496  9114044.479949 
+287591.934778  9114081.649341 
+287596.102120  9114107.771904 
+287606.432195  9114161.023715 
+287605.467632  9114165.040840 
+287602.544504  9114173.074022 
+287597.699607  9114190.146004 
+287604.016909  9114238.370782 
+287617.226024  9114277.562102 
+287629.345469  9114303.693207 
+287647.392157  9114324.807974 
+287658.399838  9114334.865216 
+287663.391953  9114337.884203 
+287756.769563  9114329.948141 
+287762.748323  9114331.963635 
+287770.729822  9114335.990356 
+287788.717658  9114349.068663 
+287810.725720  9114368.178509 
+287831.828187  9114399.341847 
+287757.807963  9114471.589430 
+287741.859643  9114465.545090 
+287728.142365  9114492.652968 
+287723.245964  9114502.693120 
+287719.358299  9114514.743435 
+287629.580782  9114607.064813 
+287612.815105  9114625.128539 
+287599.951842  9114633.151045 
+287388.175529  9114625.891186 
+287374.229909  9114621.857964 
+287361.226805  9114610.793959 
+287347.244407  9114601.737976 
+287328.291948  9114592.676615 
+287304.413564  9114589.637174 
+287288.494641  9114587.610873 
+287271.640543  9114593.619895 
+287250.788322  9114596.610956 
+287236.923609  9114603.627747 
+287210.202890  9114619.671496 
+287207.228200  9114620.672817 
+287191.382795  9114628.691994 
+287171.539264  9114633.693203 
+287148.779854  9114647.732133 
+287121.992901  9114654.734881 
+287088.313986  9114670.771026 
+287051.579487  9114676.758393 
+287048.612138  9114678.764257 
+287041.683423  9114682.774904 
+287022.900004  9114696.818106 
+287015.971284  9114700.828751 
+287004.065126  9114703.829438 
+286996.142385  9114707.839000 
+287004.462013  9114758.075251 
+287004.491413  9114762.093460 
+287001.568156  9114770.126635 
+286990.685396  9114777.146612 
+286965.886364  9114784.151453 
+286952.021535  9114791.168180 
+286942.118083  9114796.180126 
+286927.251878  9114802.191212 
+286908.424283  9114810.207071 
+286895.546107  9114816.220314 
+286877.712519  9114824.237245 
+286850.962123  9114836.262632 
+286839.983811  9114830.223395 
+286830.986196  9114823.181769 
+286819.934428  9114807.096995 
+286809.942800  9114800.054278 
+286787.263964  9114825.143158 
+286774.459212  9114841.201905 
+286762.604404  9114851.234415 
+286749.733533  9114858.252178 
+286742.804757  9114862.262792 
+286724.013811  9114875.301355 
+286702.211408  9114884.318439 
+286690.356570  9114894.350937 
+286668.612895  9114911.404440 
+286663.701522  9114919.435435 
+286658.826865  9114932.489199 
+286656.963652  9114949.564441 
+286656.013687  9114955.590677 
+286655.063723  9114961.616913 
+286651.212460  9114978.689981 
+286647.331822  9114991.744833 
+286640.469105  9115004.796424 
+286631.640362  9115020.859502 
+286620.816217  9115035.915851 
+286609.999408  9115051.976752 
+286603.092618  9115059.001017 
+286589.286373  9115074.054100 
+286576.422751  9115082.076388 
+286566.533867  9115089.097385 
+286544.760689  9115102.132642 
+286530.954410  9115117.185714 
+286520.122870  9115131.237497 
+286519.165547  9115136.259181 
+286518.259614  9115148.312746 
+286517.309633  9115154.338985 
+286520.438553  9115174.433342 
+286527.536258  9115193.527500 
+286546.701849  9115231.721247 
+286555.787643  9115250.817570 
+286569.895010  9115276.951207 
+286571.035909  9115297.043378 
+286575.173597  9115319.147918 
+286580.261263  9115335.226219 
+286589.273660  9115344.276986 
+286599.280095  9115353.328836 
+286613.262668  9115362.385028 
+286631.221383  9115371.445556 
+286643.164481  9115373.467688 
+286647.133271  9115372.467475 
+286681.047961  9115388.577214 
+286734.150577  9115445.894187 
+286739.164840  9115451.926920 
+286751.130003  9115456.962676 
+286759.126375  9115462.998654 
+286780.059906  9115471.057799 
+286796.008567  9115477.102421 
+286799.999408  9115479.115852 
+286819.946265  9115488.178447 
+286833.862761  9115488.193575 
+286852.771486  9115491.227758 
+286874.654966  9115493.260618 
+286891.553565  9115493.278967 
+286918.421924  9115497.326305 
+286931.359085  9115499.349428 
+286936.336614  9115500.359372 
+286954.251305  9115503.392431 
+286976.215672  9115516.475310 
+286981.244679  9115524.517110 
+286980.618337  9115574.743625 
+286979.778735  9115595.838136 
+286979.925819  9115615.929172 
+286983.990221  9115627.988100 
+286991.029385  9115639.045703 
+287007.073736  9115658.149401 
+287015.143727  9115674.230832 
+287024.126851  9115679.263268 
+287028.235408  9115697.349496 
+287035.311377  9115713.429845 
+287043.396103  9115731.520368 
+287051.436698  9115743.583580 
+287064.447498  9115755.652160 
+287078.430274  9115764.708155 
+287088.385390  9115766.727993 
+287101.329985  9115769.755599 
+287103.318066  9115769.757745 
+287115.261264  9115771.779722 
+287129.199900  9115774.808392 
+287136.187616  9115778.834102 
+287141.165175  9115779.844014 
+287152.180566  9115790.905866 
+287160.235918  9115804.978151 
+287167.275157  9115816.035709 
+287177.311242  9115829.105580 
+287183.312288  9115834.134760 
+287194.283541  9115839.169292 
+287209.179437  9115837.176250 
+287226.033969  9115831.167141 
+287281.287979  9115774.972227 
+287301.014159  9115753.898056 
+287328.685264  9115731.827878 
+287332.617241  9115725.804853 
+287341.526768  9115720.791717 
+287349.501160  9115723.813911 
+287354.522891  9115730.851098 
+287356.555146  9115736.880532 
+287359.632984  9115749.942881 
+287364.632630  9115753.966417 
+287371.568808  9115750.960239 
+287378.490257  9115745.944962 
+287388.327543  9115731.891940 
+287431.719059  9115684.725051 
+287470.118215  9115634.539166 
+287478.983514  9115623.498717 
+287499.652008  9115595.393719 
+287536.998062  9115537.170355 
+287582.281548  9115476.946399 
+287607.883239  9115443.823960 
+287804.095696  9115226.048416 
+287822.856861  9115208.991258 
+287850.608451  9115197.970916 
+287868.559848  9115206.026365 
+287893.521022  9115221.121045 
+287937.479268  9115251.304007 
+287952.293777  9115238.260760 
+287967.115650  9115226.222057 
+287987.850035  9115207.157866 
+288001.648368  9115191.099914 
+288011.441104  9115171.019549 
+288018.214895  9115145.913284 
+288011.227245  9115141.887704 
+287997.259325  9115134.841085 
+287975.250754  9115115.731444 
+287961.150132  9115090.602971 
+287944.936156  9115048.395077 
+287947.910843  9115047.393705 
+288031.275757  9115029.400696 
+288039.139418  9115017.354592 
+288040.876733  9114983.202130 
+288044.705322  9114963.115431 
+288056.419679  9114933.996268 
+288083.971910  9114895.853090 
+288095.745230  9114874.770295 
+288108.586304  9114863.734015 
+288123.437526  9114855.713482 
+288143.288317  9114851.716405 
+288171.076465  9114845.718665 
+288160.009542  9114827.625240 
+288146.880847  9114799.484242 
+288133.796421  9114777.370511 
+288129.724496  9114764.307191 
+288118.650240  9114745.209201 
+288116.617969  9114739.179812 
+288106.626228  9114732.137426 
+288102.591187  9114724.096831 
+288107.494880  9114715.061199 
+288133.095824  9114681.938646 
+288146.805485  9114653.826146 
+288159.609620  9114637.767139 
+288176.360284  9114617.694170 
+288187.183757  9114602.637594 
+288196.078208  9114595.615273 
+288197.042716  9114591.598145 
+288204.832524  9114569.506583 
+288121.262096  9114559.372407 
+Region 1
+326
+289398.575403  9114428.114641 
+289387.263988  9114376.871807 
+289323.729523  9114387.855760 
+289279.169759  9114410.913732 
+289246.493552  9114427.956829 
+289224.640357  9114429.943176 
+289197.883729  9114440.965204 
+289191.927125  9114441.963540 
+289164.265229  9114465.039004 
+289148.449966  9114477.076932 
+289127.783013  9114505.182331 
+289109.044880  9114525.253471 
+289084.364898  9114548.332014 
+289070.508012  9114556.353835 
+289040.732277  9114562.349983 
+289027.832413  9114565.350125 
+289019.880384  9114565.341826 
+289014.910366  9114565.336639 
+288983.146601  9114571.330677 
+288858.448924  9114645.535811 
+288841.676446  9114662.595336 
+288825.868404  9114675.637730 
+288810.045573  9114686.671036 
+288798.213544  9114699.717589 
+288777.442823  9114713.759306 
+288752.666501  9114723.778678 
+288733.905934  9114740.836094 
+288726.977422  9114744.846965 
+288706.250980  9114764.915917 
+288699.352012  9114772.944957 
+288682.527714  9114782.972647 
+288661.779074  9114800.027957 
+288642.988893  9114813.067178 
+288614.295516  9114831.118663 
+288600.475366  9114844.163096 
+288573.747819  9114859.203022 
+288544.119443  9114885.289779 
+288529.283088  9114895.319521 
+288500.641292  9114920.402763 
+288467.979103  9114939.454540 
+288450.160666  9114949.481123 
+288437.297531  9114957.503852 
+288175.096780  9114851.750156 
+288171.076465  9114845.718665 
+288143.288317  9114851.716405 
+288123.437526  9114855.713482 
+288108.586304  9114863.734015 
+288095.745230  9114874.770295 
+288083.971910  9114895.853090 
+288056.419679  9114933.996268 
+288044.705322  9114963.115431 
+288040.876733  9114983.202130 
+288039.139418  9115017.354592 
+288031.275757  9115029.400696 
+287947.910843  9115047.393705 
+287944.936156  9115048.395077 
+287961.150132  9115090.602971 
+287975.250754  9115115.731444 
+287997.259325  9115134.841085 
+288011.227245  9115141.887704 
+288018.214895  9115145.913284 
+288011.441104  9115171.019549 
+288001.648368  9115191.099914 
+287987.850035  9115207.157866 
+287967.115650  9115226.222057 
+287952.293777  9115238.260760 
+287937.479268  9115251.304007 
+287893.521022  9115221.121045 
+287868.559848  9115206.026365 
+287850.608451  9115197.970916 
+287822.856861  9115208.991258 
+287804.095696  9115226.048416 
+287607.883239  9115443.823960 
+287582.281548  9115476.946399 
+287536.998062  9115537.170355 
+287499.652008  9115595.393719 
+287478.983514  9115623.498717 
+287470.118215  9115634.539166 
+287431.719059  9115684.725051 
+287388.327543  9115731.891940 
+287378.490257  9115745.944962 
+287371.568808  9115750.960239 
+287364.632630  9115753.966417 
+287359.632984  9115749.942881 
+287356.555146  9115736.880532 
+287354.522891  9115730.851098 
+287349.501160  9115723.813911 
+287341.526768  9115720.791717 
+287332.617241  9115725.804853 
+287328.685264  9115731.827878 
+287301.014159  9115753.898056 
+287281.287979  9115774.972227 
+287314.297427  9115803.134894 
+287350.318490  9115835.318928 
+287353.315338  9115837.331229 
+287398.341740  9115877.561210 
+287427.367799  9115904.714946 
+287443.375587  9115918.795675 
+287500.308549  9115956.024642 
+287477.688698  9115989.150293 
+287453.117564  9116027.296556 
+287429.533072  9116064.439330 
+287409.836332  9116089.531769 
+287389.138159  9116113.618590 
+287363.506559  9116142.722827 
+287339.752544  9116156.760944 
+287323.958259  9116171.812132 
+287304.305606  9116202.931848 
+287293.584644  9116232.052060 
+287290.904449  9116273.235403 
+287283.195084  9116306.377016 
+287267.562758  9116343.528298 
+287244.957315  9116378.663013 
+287223.286982  9116405.762391 
+287210.445289  9116416.798569 
+287235.532295  9116448.970846 
+287254.684470  9116485.154905 
+287266.826732  9116514.299640 
+287294.005084  9116560.537687 
+287349.311225  9116511.374362 
+287371.857673  9116468.203206 
+287392.600180  9116450.143651 
+287443.068460  9116419.056830 
+287516.127147  9116350.826077 
+287529.911187  9116332.759057 
+287546.625771  9116307.663378 
+287561.352242  9116282.565576 
+287576.100811  9116260.481418 
+287591.931871  9116250.452896 
+287594.884529  9116246.437883 
+287602.755826  9116235.396332 
+287614.573823  9116220.340826 
+287632.385581  9116209.309866 
+287641.302515  9116205.301206 
+287655.174935  9116199.288744 
+287665.998858  9116184.232172 
+287672.809728  9116164.148626 
+287678.626549  9116144.064022 
+287683.500930  9116131.010194 
+287693.330786  9116115.952563 
+287718.056554  9116098.901707 
+287731.810953  9116076.816470 
+287741.589169  9116054.727003 
+287750.373336  9116032.636478 
+287750.247985  9116015.559172 
+287743.208584  9116004.501746 
+287736.161813  9115992.439770 
+287731.110503  9115981.384457 
+287726.994255  9115962.293820 
+287725.941232  9115954.256381 
+287730.756611  9115933.166175 
+287732.619357  9115916.090983 
+287730.572297  9115908.052485 
+287723.503434  9115892.976860 
+287712.502651  9115883.924282 
+287706.472069  9115874.876998 
+287705.448542  9115870.857747 
+287705.389569  9115862.821366 
+287713.282907  9115854.793459 
+287719.210280  9115849.777076 
+287730.048867  9115836.729606 
+287739.937644  9115829.708362 
+287747.845715  9115823.689547 
+287755.761155  9115818.675279 
+287762.682556  9115813.659951 
+287771.614149  9115811.660381 
+287775.560807  9115807.646424 
+287778.528174  9115805.640504 
+287774.456178  9115792.577155 
+287773.381041  9115781.526075 
+287774.271860  9115767.463470 
+287776.208324  9115760.433755 
+287779.146198  9115754.409646 
+287786.052841  9115747.385222 
+287798.894206  9115736.348958 
+287806.809626  9115731.334685 
+287811.735565  9115725.312691 
+287818.583213  9115710.251887 
+287820.527043  9115704.226719 
+287830.415777  9115697.205466 
+287833.383134  9115695.199544 
+287839.244112  9115681.142229 
+287841.210059  9115678.130703 
+287843.168633  9115674.114629 
+287845.090339  9115665.075820 
+287850.973431  9115654.032147 
+287859.831248  9115641.987098 
+287869.705215  9115632.956746 
+287868.622695  9115620.901125 
+287865.471000  9115597.793373 
+287864.395858  9115586.742299 
+287866.310186  9115576.698944 
+287868.224513  9115566.655589 
+287877.097061  9115556.619635 
+287891.963287  9115550.608210 
+287901.837231  9115541.577857 
+287917.682729  9115533.558389 
+287930.531380  9115523.526655 
+287940.420059  9115516.505390 
+287952.282045  9115507.477142 
+287961.154561  9115497.441179 
+287968.039015  9115487.403104 
+287973.973689  9115483.391251 
+287985.813532  9115471.349359 
+287990.732047  9115464.322811 
+288000.628079  9115458.306084 
+288008.536051  9115452.287246 
+288016.421892  9115443.254769 
+288018.343563  9115434.215962 
+288020.250482  9115423.168063 
+288022.164776  9115413.124711 
+288024.056941  9115400.067719 
+288030.963498  9115393.043279 
+288038.871456  9115387.024440 
+288046.779411  9115381.005599 
+288051.727414  9115377.997233 
+288062.610069  9115370.977007 
+288071.489913  9115361.945580 
+288078.389079  9115353.916590 
+288090.265749  9115346.897414 
+288098.166312  9115339.874022 
+288110.050352  9115333.859388 
+288118.989201  9115332.864321 
+288126.926647  9115330.863654 
+288152.668000  9115316.827386 
+288166.495800  9115304.787572 
+288175.309200  9115286.715223 
+288165.214012  9115265.609245 
+288157.092126  9115242.496277 
+288170.794476  9115213.379193 
+288226.230956  9115182.297204 
+288233.159587  9115178.286383 
+288245.036184  9115171.267183 
+288257.928937  9115167.262666 
+288271.815707  9115163.259197 
+288291.607552  9115151.225667 
+288302.512252  9115147.219040 
+288317.363506  9115139.198430 
+288330.219332  9115130.171174 
+288342.103278  9115124.156499 
+288351.005163  9115118.138674 
+288362.881720  9115111.119451 
+288378.741731  9115105.108965 
+288390.633044  9115100.098825 
+288408.481082  9115094.090426 
+288428.295001  9115085.070485 
+288441.136018  9115074.034117 
+288453.019929  9115068.019420 
+288465.868319  9115057.987592 
+288483.716325  9115051.979170 
+288502.558341  9115045.971788 
+288514.427465  9115037.947992 
+288526.303968  9115030.928736 
+288535.213190  9115025.915429 
+288544.107638  9115018.893034 
+288554.938416  9115004.840923 
+288563.840243  9114998.823068 
+288571.748052  9114992.804168 
+288581.658661  9114988.796443 
+288596.561502  9114987.807569 
+288608.467523  9114984.806471 
+288625.277134  9114972.769701 
+288635.180344  9114967.757424 
+288654.022293  9114961.749992 
+288664.926898  9114957.743296 
+288676.825515  9114953.737640 
+288684.740686  9114948.723268 
+288692.655855  9114943.708895 
+288701.542870  9114935.681935 
+288705.481981  9114930.663391 
+288712.395743  9114924.643431 
+288718.322878  9114919.626971 
+288727.224661  9114913.609093 
+288735.147207  9114909.599258 
+288745.042998  9114903.582420 
+288760.843745  9114889.535489 
+288764.716340  9114875.476060 
+288769.582945  9114861.417672 
+288770.495672  9114850.368747 
+288775.362274  9114836.310359 
+288775.317937  9114830.283105 
+288779.242253  9114823.255473 
+288787.179558  9114821.254718 
+288799.100294  9114820.262668 
+288812.037209  9114822.285282 
+288823.965333  9114822.297768 
+288832.926206  9114824.316214 
+288839.876888  9114823.318952 
+288848.815588  9114822.323769 
+288855.692357  9114811.281085 
+288860.573712  9114799.231780 
+288868.474049  9114792.208303 
+288880.335638  9114783.179899 
+288887.241960  9114776.155380 
+288898.116923  9114768.130476 
+288908.020050  9114763.118156 
+288919.940760  9114762.126078 
+288929.829097  9114755.104671 
+288939.732216  9114750.092346 
+288950.636734  9114746.085598 
+288956.593388  9114745.087284 
+288964.508486  9114740.072879 
+288969.441558  9114735.055360 
+289008.096941  9114720.027691 
+289023.934505  9114711.003408 
+289043.533645  9114672.851575 
+289047.457906  9114665.823933 
+289095.897940  9114629.711215 
+289141.437239  9114604.645305 
+289178.104422  9114589.615462 
+289188.942295  9114576.567808 
+289190.878521  9114569.538093 
+289174.811746  9114547.421664 
+289183.713386  9114541.403728 
+289189.625621  9114534.378148 
+289200.404303  9114513.294173 
+289212.332321  9114513.306576 
+289258.019392  9114508.331391 
+289277.943806  9114514.379274 
+289304.870629  9114526.461606 
+289323.793652  9114531.503896 
+289357.537888  9114524.507157 
+289395.250710  9114516.509975 
+289412.185728  9114521.550167 
+289446.968344  9114520.581629 
+289398.575403  9114428.114641 
+Region 1
+136
+287715.683944  9112656.338954 
+287715.632468  9112649.307109 
+287717.443916  9112625.200080 
+287719.255366  9112601.093051 
+287717.215956  9112594.059054 
+287715.169195  9112586.020508 
+287709.102448  9112571.950360 
+287704.007613  9112554.867639 
+287694.922214  9112535.771509 
+287684.842858  9112516.674299 
+287673.843066  9112507.621501 
+287662.850631  9112499.573250 
+287655.863466  9112495.547505 
+287642.868403  9112485.487992 
+287637.913279  9112487.491699 
+287620.007200  9112485.463182 
+287601.107156  9112483.433579 
+287586.175624  9112480.403736 
+287561.289739  9112475.353987 
+287546.358210  9112472.324130 
+287523.430866  9112463.258317 
+287509.434521  9112452.193124 
+287505.436616  9112449.175146 
+287495.438182  9112441.127925 
+287484.423745  9112430.065966 
+287478.371789  9112418.004865 
+287472.349225  9112409.961966 
+287468.343979  9112405.939433 
+287463.359463  9112403.924918 
+287453.441858  9112406.927741 
+287449.495386  9112410.941612 
+287446.564917  9112417.970218 
+287448.604272  9112425.004240 
+287453.698991  9112442.087017 
+287458.771674  9112456.156140 
+287461.878471  9112473.236750 
+287466.936467  9112485.296769 
+287464.977924  9112489.312807 
+287460.044828  9112494.330149 
+287446.217460  9112506.369602 
+287437.359921  9112518.414467 
+287432.426819  9112523.431807 
+287422.582651  9112536.480139 
+287414.821919  9112562.589798 
+287408.975654  9112578.656114 
+287400.147479  9112594.719181 
+287388.300659  9112605.756242 
+287376.453833  9112616.793302 
+287369.525429  9112620.803920 
+287350.713459  9112630.828838 
+287344.779021  9112634.840538 
+287337.835920  9112636.842051 
+287330.907509  9112640.852665 
+287328.970984  9112647.882355 
+287324.103963  9112661.940652 
+287320.223565  9112674.995481 
+287318.353145  9112691.066134 
+287314.538851  9112713.161926 
+287311.689149  9112731.240597 
+287309.782001  9112742.288493 
+287307.838127  9112748.313633 
+287306.924952  9112759.362613 
+287306.070540  9112778.448005 
+287305.157366  9112789.496986 
+287306.239485  9112801.552687 
+287306.305595  9112810.593649 
+287307.328952  9112814.612939 
+287144.552045  9112846.580529 
+287123.634501  9112840.530373 
+287105.662182  9112829.460710 
+287092.681770  9112821.410138 
+287085.694578  9112817.384306 
+287083.978236  9112854.550573 
+287085.199783  9112885.692790 
+287085.375971  9112909.802051 
+287088.534096  9112933.914576 
+287092.583424  9112943.964454 
+287101.632014  9112958.037979 
+287111.615852  9112964.076171 
+287131.539478  9112970.125232 
+287128.682366  9112987.199358 
+287148.606004  9112993.248409 
+287163.537719  9112996.278362 
+287187.444623  9113003.336289 
+287208.362249  9113009.386395 
+287237.202331  9113011.426961 
+287264.017724  9113008.442582 
+287286.857196  9113005.453854 
+287305.720748  9113002.460783 
+287327.536842  9112995.452749 
+287345.406405  9112992.458580 
+287368.289942  9112995.497120 
+287389.222265  9113003.556239 
+287409.167964  9113012.618817 
+287426.197880  9113030.719098 
+287435.253931  9113045.797079 
+287435.371528  9113061.869887 
+287430.511880  9113076.932746 
+287418.687021  9113090.983493 
+287406.847456  9113103.025137 
+287399.977788  9113115.072183 
+287391.120154  9113127.117067 
+287383.315291  9113147.199437 
+287378.514415  9113170.298702 
+287371.703525  9113190.382153 
+287408.605813  9113207.499484 
+287412.596443  9113209.512905 
+287416.587073  9113211.526324 
+287421.512882  9113205.504419 
+287434.346444  9113193.463845 
+287456.081727  9113175.405678 
+287475.829031  9113157.345347 
+287479.782900  9113154.336010 
+287502.504774  9113135.274357 
+287532.118315  9113107.179291 
+287563.712424  9113078.081818 
+287598.288425  9113048.987562 
+287609.133938  9113036.944807 
+287595.063835  9113015.834193 
+287599.974895  9113007.803179 
+287611.829084  9112997.770601 
+287626.650490  9112985.732151 
+287646.375581  9112964.658132 
+287657.169585  9112945.583526 
+287660.114740  9112940.564007 
+287670.901381  9112920.484851 
+287684.633163  9112895.386175 
+287696.428468  9112877.317192 
+287707.185663  9112853.219838 
+287714.018443  9112836.150028 
+287718.870629  9112820.082617 
+287717.707499  9112796.976913 
+287716.426703  9112757.798421 
+287718.098412  9112714.604958 
+287718.879113  9112685.474108 
+287715.683944  9112656.338954 
+Region 1
+185
+289827.275749  9112310.003412 
+289819.116996  9112281.868097 
+289816.046370  9112269.810545 
+289803.608542  9112200.485033 
+289796.369815  9112162.305355 
+289791.222555  9112138.191274 
+289781.855438  9112080.923294 
+289771.479628  9112021.645194 
+289759.086397  9111958.346861 
+289751.892163  9111926.194385 
+289750.846458  9111919.161581 
+289756.765739  9111913.140559 
+289772.587457  9111902.107193 
+289776.459689  9111888.047793 
+289745.507026  9111868.929476 
+289707.596804  9111849.803878 
+289673.662368  9111830.682388 
+289639.676216  9111804.529093 
+289604.747896  9111785.406498 
+289562.126728  9111801.434438 
+289547.328470  9111816.486934 
+289522.627739  9111836.551722 
+289503.868467  9111853.609128 
+289486.051403  9111863.635790 
+289343.529339  9111945.857980 
+289335.577783  9111945.849629 
+289329.577189  9111940.820660 
+289323.561825  9111933.782609 
+289310.515004  9111916.691835 
+289298.528599  9111908.642969 
+289283.560367  9111900.590962 
+289257.577538  9111881.477491 
+289241.607993  9111872.419880 
+289231.579965  9111860.354917 
+289216.523167  9111840.248384 
+289110.985782  9111680.416121 
+288861.080570  9111757.500586 
+288856.118230  9111758.499852 
+288450.508456  9111882.629966 
+288302.748859  9111928.680349 
+288245.254368  9111949.713917 
+288224.440299  9111957.727859 
+288166.953073  9111979.765891 
+287901.199028  9112064.865093 
+287924.516007  9112127.171808 
+287853.318866  9112177.321851 
+287829.493302  9112181.314230 
+287808.627544  9112182.296180 
+287767.889977  9112184.261129 
+287729.140314  9112186.228199 
+287701.338885  9112190.216202 
+287677.542682  9112198.226705 
+287653.739119  9112205.232647 
+287625.893565  9112203.193308 
+287596.965868  9112189.098271 
+287552.737350  9112257.359025 
+287572.734138  9112273.453455 
+287590.706273  9112284.522962 
+287614.656881  9112297.608039 
+287618.647426  9112299.621459 
+287627.659226  9112308.672126 
+287631.664471  9112312.694644 
+287638.681003  9112320.738599 
+287641.684939  9112323.755486 
+287642.708301  9112327.774764 
+287646.720900  9112332.801830 
+287644.799130  9112341.840619 
+287644.821181  9112344.854268 
+287639.873421  9112347.862522 
+287636.898885  9112348.863834 
+287627.010712  9112355.884889 
+287615.112561  9112359.890134 
+287600.276616  9112369.919436 
+287602.352738  9112381.976195 
+287612.395269  9112396.050691 
+287615.421260  9112402.081229 
+287624.550692  9112427.204688 
+287632.517105  9112429.222420 
+287642.471448  9112431.242308 
+287650.437862  9112433.260036 
+287659.405593  9112436.283391 
+287666.407450  9112442.318236 
+287663.477017  9112449.346849 
+287656.614834  9112462.398446 
+287651.718523  9112472.438551 
+287642.868403  9112485.487992 
+287655.863466  9112495.547505 
+287662.850631  9112499.573250 
+287673.843066  9112507.621501 
+287684.842858  9112516.674299 
+287694.922214  9112535.771509 
+287704.007613  9112554.867639 
+287709.102448  9112571.950360 
+287715.169195  9112586.020508 
+287717.215956  9112594.059054 
+287719.255366  9112601.093051 
+287717.443916  9112625.200080 
+287715.632468  9112649.307109 
+287715.683944  9112656.338954 
+287718.879113  9112685.474108 
+287718.098412  9112714.604958 
+287716.426703  9112757.798421 
+287717.707499  9112796.976913 
+287718.870629  9112820.082617 
+287714.018443  9112836.150028 
+287707.185663  9112853.219838 
+287696.428468  9112877.317192 
+287684.633163  9112895.386175 
+287670.901381  9112920.484851 
+287660.114740  9112940.564007 
+287657.169585  9112945.583526 
+287646.375581  9112964.658132 
+287626.650490  9112985.732151 
+287611.829084  9112997.770601 
+287599.974895  9113007.803179 
+287595.063835  9113015.834193 
+287609.133938  9113036.944807 
+287673.573306  9113013.910086 
+287722.108974  9112990.858107 
+287754.851325  9112982.857148 
+287759.806490  9112980.853416 
+287765.755630  9112978.850758 
+287817.368768  9112968.861047 
+287889.855333  9112958.893768 
+287956.436882  9112956.956349 
+288021.994979  9112950.999575 
+288025.963511  9112949.999298 
+288032.921325  9112950.006771 
+288087.567764  9112947.051805 
+288137.229586  9112942.082356 
+288146.167975  9112941.087395 
+288191.839149  9112934.104536 
+288251.425902  9112927.136515 
+288315.003241  9112922.181757 
+288377.571833  9112915.216762 
+288450.080089  9112908.262271 
+288512.663343  9112903.306188 
+288575.231813  9112896.340933 
+288601.052891  9112893.354744 
+288626.248762  9112940.594693 
+288650.413842  9112982.810841 
+288682.102875  9112966.771847 
+288727.692704  9112948.738481 
+288767.348187  9112934.716944 
+288804.006973  9112918.683139 
+288830.740806  9112904.647897 
+288840.658347  9112901.644768 
+288849.677863  9112911.699646 
+288874.556591  9112915.744052 
+288909.286422  9112907.744417 
+288930.085925  9112897.721004 
+288945.937728  9112890.705972 
+288952.880734  9112888.704221 
+288955.810958  9112881.675567 
+288956.708953  9112868.617563 
+288956.561305  9112848.526716 
+288952.437796  9112828.431677 
+288947.342473  9112811.349216 
+288937.255185  9112791.247884 
+288931.165910  9112774.164369 
+288927.094095  9112761.101121 
+288926.041081  9112753.063732 
+289030.921362  9112687.879553 
+289130.890584  9112630.726308 
+289156.630160  9112616.689890 
+289183.356293  9112601.649964 
+289232.928691  9112584.624938 
+289239.871630  9112582.623157 
+289289.466137  9112568.611701 
+289295.415111  9112566.608870 
+289353.955190  9112552.606726 
+289404.550949  9112539.600741 
+289460.079491  9112521.577198 
+289516.631501  9112507.572792 
+289542.429991  9112501.572514 
+289574.177416  9112493.569361 
+289602.957748  9112487.572159 
+289640.668869  9112479.575176 
+289697.205927  9112463.561493 
+289733.937835  9112457.572483 
+289777.568214  9112443.554363 
+289827.110476  9112422.510627 
+289829.053985  9112416.485461 
+289840.818624  9112394.397997 
+289827.275749  9112310.003412 
+Region 1
+240
+289161.766920  9114395.723639 
+289147.717818  9114377.627413 
+289117.609469  9114338.419246 
+289090.520136  9114304.236863 
+289060.500604  9114277.083127 
+289033.470488  9114250.937020 
+289011.417776  9114225.800628 
+288996.360014  9114205.694205 
+288967.245918  9114166.486918 
+288953.145246  9114141.358803 
+288933.971175  9114102.161885 
+288922.808196  9114071.009624 
+288911.623074  9114036.843730 
+288901.535393  9114016.742462 
+288895.460627  9114001.668072 
+288863.061960  9113921.271296 
+288855.124810  9113923.272027 
+288829.354913  9113933.290293 
+288829.295828  9113925.253952 
+288826.217845  9113912.191764 
+288826.099679  9113896.119083 
+288822.005556  9113880.042220 
+288814.922084  9113862.957678 
+288807.786927  9113838.841333 
+288796.712747  9113819.743515 
+288787.597019  9113796.629614 
+288771.479090  9113767.481123 
+288760.382799  9113745.369659 
+288756.333022  9113735.320039 
+288753.277234  9113725.271466 
+288746.142146  9113701.155097 
+288741.031952  9113682.063538 
+288731.916294  9113658.949611 
+288725.775222  9113634.834282 
+288716.600536  9113603.684000 
+288718.566361  9113600.672468 
+288729.478041  9113597.670376 
+288743.371670  9113594.671427 
+288761.211702  9113587.658495 
+288777.056379  9113579.638918 
+288780.030946  9113578.637518 
+288791.870152  9113566.595574 
+288805.653019  9113548.528467 
+288802.656305  9113546.516239 
+288796.648115  9113540.482696 
+288785.655249  9113532.434828 
+288775.671134  9113526.397090 
+288763.684293  9113518.348166 
+288753.678038  9113509.296792 
+288742.670425  9113499.239823 
+288736.677010  9113495.215355 
+288730.654072  9113487.172714 
+288728.584920  9113476.120638 
+288730.499074  9113466.077304 
+288734.438094  9113461.058785 
+288726.427201  9113453.014043 
+288695.444057  9113429.876995 
+288670.476477  9113413.778030 
+288661.508518  9113410.754938 
+288647.607552  9113412.749307 
+288622.706395  9113405.691204 
+288603.783881  9113400.648490 
+288591.848739  9113399.631314 
+288584.876123  9113397.614855 
+288596.875727  9113272.060530 
+288603.457355  9113220.836154 
+288605.216634  9113189.697393 
+288605.128117  9113177.642864 
+288604.980590  9113157.551981 
+288598.817587  9113130.422965 
+288593.685447  9113108.317722 
+288589.606292  9113094.249885 
+288589.473533  9113076.168088 
+288590.445379  9113073.155510 
+288594.354892  9113064.118830 
+288601.194692  9113048.053504 
+288613.041229  9113037.016170 
+288627.884427  9113027.991084 
+288641.726271  9113017.960397 
+288653.565412  9113005.918513 
+288650.413842  9112982.810841 
+288626.248762  9112940.594693 
+288601.052891  9112893.354744 
+288575.231813  9112896.340933 
+288512.663343  9112903.306188 
+288450.080089  9112908.262271 
+288377.571833  9112915.216762 
+288315.003241  9112922.181757 
+288251.425902  9112927.136515 
+288191.839149  9112934.104536 
+288146.167975  9112941.087395 
+288137.229586  9112942.082356 
+288087.567764  9112947.051805 
+288032.921325  9112950.006771 
+288025.963511  9112949.999298 
+288021.994979  9112950.999575 
+287956.436882  9112956.956349 
+287889.855333  9112958.893768 
+287817.368768  9112968.861047 
+287765.755630  9112978.850758 
+287759.894769  9112992.908002 
+287760.071330  9113017.017173 
+287763.185684  9113035.102270 
+287771.233140  9113048.169986 
+287779.251172  9113057.219505 
+287790.236424  9113064.263141 
+287800.220344  9113070.301152 
+287807.251766  9113080.354140 
+287813.340723  9113097.437894 
+287819.444403  9113116.530743 
+287821.579535  9113136.623853 
+287859.313920  9113131.641798 
+287869.459781  9113159.779848 
+287883.066039  9113253.216722 
+287882.160388  9113265.270229 
+287879.222610  9113271.294310 
+287873.317608  9113279.324279 
+287864.445381  9113289.360136 
+287860.535699  9113298.396792 
+287859.630044  9113310.450300 
+287860.646108  9113313.465013 
+287863.679581  9113320.500058 
+287870.703706  9113329.548474 
+287879.737884  9113341.612670 
+287884.744605  9113346.640754 
+287886.747294  9113348.651987 
+287891.754017  9113353.680069 
+287901.863170  9113376.795353 
+287908.946211  9113393.880141 
+287916.051346  9113413.978571 
+287921.197970  9113438.093054 
+287932.315878  9113463.218484 
+287942.336727  9113474.279176 
+287956.355614  9113488.357773 
+287963.394517  9113499.415258 
+287966.479572  9113513.482121 
+287965.581321  9113526.540171 
+287969.748740  9113552.662667 
+287976.868671  9113574.770168 
+287980.955094  9113589.842639 
+287979.048132  9113600.890530 
+287976.154547  9113612.941902 
+287988.649543  9113690.304821 
+287986.705757  9113696.329975 
+287988.826320  9113714.413954 
+287999.937001  9113738.534793 
+288009.972673  9113751.604545 
+288011.018229  9113758.637438 
+288012.041687  9113762.656690 
+288006.202969  9113779.727608 
+287992.485974  9113806.835488 
+287984.732924  9113833.949750 
+287984.902352  9113857.054335 
+287987.052405  9113879.156500 
+287991.175717  9113899.251697 
+287998.258919  9113916.336440 
+287997.345963  9113927.385395 
+287997.015035  9114017.793566 
+287993.061829  9114156.415741 
+288023.993735  9114172.521402 
+288050.964397  9114190.631888 
+288065.948107  9114200.693259 
+288083.980161  9114219.798722 
+288096.003996  9114232.870540 
+288097.042224  9114238.898877 
+288101.121427  9114252.966763 
+288107.254982  9114276.077683 
+288109.434650  9114302.198004 
+288101.674292  9114328.307738 
+288093.891813  9114351.403833 
+288083.075714  9114367.464928 
+288075.315338  9114393.574663 
+288070.441143  9114406.628471 
+288066.568322  9114420.687886 
+288068.689022  9114438.771840 
+288075.750268  9114452.842901 
+288082.841009  9114470.932145 
+288082.892614  9114477.963970 
+288082.929475  9114482.986701 
+288092.987502  9114499.070024 
+288099.069507  9114515.149112 
+288104.128019  9114527.208955 
+288113.236297  9114549.318488 
+288121.262096  9114559.372407 
+288204.832524  9114569.506583 
+288197.042716  9114591.598145 
+288196.078208  9114595.615273 
+288187.183757  9114602.637594 
+288176.360284  9114617.694170 
+288159.609620  9114637.767139 
+288146.805485  9114653.826146 
+288133.095824  9114681.938646 
+288107.494880  9114715.061199 
+288102.591187  9114724.096831 
+288106.626228  9114732.137426 
+288116.617969  9114739.179812 
+288118.650240  9114745.209201 
+288129.724496  9114764.307191 
+288133.796421  9114777.370511 
+288146.880847  9114799.484242 
+288160.009542  9114827.625240 
+288171.076465  9114845.718665 
+288175.096780  9114851.750156 
+288437.297531  9114957.503852 
+288450.160666  9114949.481123 
+288467.979103  9114939.454540 
+288500.641292  9114920.402763 
+288529.283088  9114895.319521 
+288544.119443  9114885.289779 
+288573.747819  9114859.203022 
+288600.475366  9114844.163096 
+288614.295516  9114831.118663 
+288642.988893  9114813.067178 
+288661.779074  9114800.027957 
+288682.527714  9114782.972647 
+288699.352012  9114772.944957 
+288706.250980  9114764.915917 
+288726.977422  9114744.846965 
+288733.905934  9114740.836094 
+288752.666501  9114723.778678 
+288777.442823  9114713.759306 
+288798.213544  9114699.717589 
+288810.045573  9114686.671036 
+288825.868404  9114675.637730 
+288841.676446  9114662.595336 
+288858.448924  9114645.535811 
+288983.146601  9114571.330677 
+289014.910366  9114565.336639 
+289019.880384  9114565.341826 
+289027.832413  9114565.350125 
+289040.732277  9114562.349983 
+289070.508012  9114556.353835 
+289084.364898  9114548.332014 
+289109.044880  9114525.253471 
+289127.783013  9114505.182331 
+289148.449966  9114477.076932 
+289164.265229  9114465.039004 
+289191.927125  9114441.963540 
+289177.804034  9114413.821926 
+289161.766920  9114395.723639 
+Region 1
+152
+289488.658305  9113568.329091 
+289455.427944  9113510.031732 
+289449.234772  9113478.884810 
+289455.963312  9113447.751323 
+289466.630769  9113411.599275 
+289468.478182  9113392.515094 
+289473.292728  9113371.424936 
+289469.213275  9113357.357250 
+289466.142594  9113345.299676 
+289469.785655  9113300.099539 
+289469.719090  9113291.058684 
+289466.507893  9113259.914860 
+289459.298631  9113225.753277 
+289448.209639  9113204.646563 
+289438.181183  9113192.581736 
+289419.229177  9113183.521204 
+289418.999952  9113152.380472 
+289404.995636  9113140.311489 
+289361.342259  9113151.315811 
+289358.367739  9113152.317239 
+289344.511288  9113160.339037 
+289329.727391  9113177.400655 
+289307.080413  9113206.508450 
+289290.293759  9113221.558905 
+289282.356761  9113223.559678 
+289261.490721  9113224.542403 
+289242.620016  9113226.531739 
+289215.804911  9113229.517289 
+289195.969783  9113235.523730 
+289178.122595  9113241.532245 
+289159.318372  9113252.562419 
+289143.503451  9113264.600252 
+289137.591325  9113271.625792 
+289127.725464  9113281.660788 
+289112.948828  9113299.726905 
+289103.134673  9113316.793688 
+289089.359382  9113335.865385 
+289080.472698  9113343.892336 
+289075.547142  9113349.914373 
+289060.748304  9113364.966857 
+289048.879677  9113372.990676 
+289035.000929  9113377.998782 
+289019.126834  9113382.000255 
+289000.196940  9113375.953172 
+288964.384199  9113371.897407 
+288942.509303  9113370.869874 
+288919.647811  9113370.845827 
+288890.829831  9113371.820033 
+288869.993206  9113376.820767 
+288853.176787  9113387.852937 
+288831.427377  9113403.902580 
+288813.683398  9113423.974578 
+288799.878414  9113439.028051 
+288784.078078  9113453.074882 
+288765.244118  9113460.086762 
+288748.368589  9113463.082561 
+288734.438094  9113461.058785 
+288730.499074  9113466.077304 
+288728.584920  9113476.120638 
+288730.654072  9113487.172714 
+288736.677010  9113495.215355 
+288742.670425  9113499.239823 
+288753.678038  9113509.296792 
+288763.684293  9113518.348166 
+288775.671134  9113526.397090 
+288785.655249  9113532.434828 
+288796.648115  9113540.482696 
+288802.656305  9113546.516239 
+288805.653019  9113548.528467 
+288791.870152  9113566.595574 
+288780.030946  9113578.637518 
+288777.056379  9113579.638918 
+288761.211702  9113587.658495 
+288743.371670  9113594.671427 
+288729.478041  9113597.670376 
+288718.566361  9113600.672468 
+288716.600536  9113603.684000 
+288725.775222  9113634.834282 
+288731.916294  9113658.949611 
+288741.031952  9113682.063538 
+288746.142146  9113701.155097 
+288753.277234  9113725.271466 
+288756.333022  9113735.320039 
+288760.382799  9113745.369659 
+288771.479090  9113767.481123 
+288787.597019  9113796.629614 
+288796.712747  9113819.743515 
+288807.786927  9113838.841333 
+288814.922084  9113862.957678 
+288822.005556  9113880.042220 
+288826.099679  9113896.119083 
+288826.217845  9113912.191764 
+288829.295828  9113925.253952 
+288829.354913  9113933.290293 
+288829.377070  9113936.303920 
+288855.124810  9113923.272027 
+288863.061960  9113921.271296 
+288895.460627  9114001.668072 
+288901.535393  9114016.742462 
+288911.623074  9114036.843730 
+288922.808196  9114071.009624 
+288933.971175  9114102.161885 
+288953.145246  9114141.358803 
+288967.245918  9114166.486918 
+288996.360014  9114205.694205 
+289011.417776  9114225.800628 
+289033.470488  9114250.937020 
+289060.500604  9114277.083127 
+289090.520136  9114304.236863 
+289117.609469  9114338.419246 
+289147.717818  9114377.627413 
+289161.766920  9114395.723639 
+289177.804034  9114413.821926 
+289191.927125  9114441.963540 
+289197.883729  9114440.965204 
+289224.640357  9114429.943176 
+289246.493552  9114427.956829 
+289279.169759  9114410.913732 
+289323.729523  9114387.855760 
+289359.224861  9114348.715844 
+289379.060402  9114342.709225 
+289407.782699  9114328.675555 
+289415.697666  9114323.661099 
+289425.950756  9114231.254824 
+289447.406537  9114040.416081 
+289446.345949  9114031.374198 
+289446.308950  9114026.351502 
+289226.015974  9113941.741767 
+289116.152348  9113870.305254 
+289072.261674  9113849.164156 
+289073.218709  9113844.142489 
+289141.604254  9113817.091589 
+289170.370723  9113809.085372 
+289182.276379  9113806.084205 
+289294.367531  9113775.060588 
+289298.306495  9113770.042029 
+289304.226032  9113764.021000 
+289343.028406  9113769.084059 
+289372.892318  9113775.142320 
+289389.819642  9113779.178049 
+289419.794528  9113800.304367 
+289458.767098  9113828.471718 
+289476.718025  9113836.526596 
+289480.701365  9113837.535259 
+289474.300902  9113778.261264 
+289461.943976  9113719.985610 
+289462.782593  9113698.891318 
+289469.488925  9113664.744209 
+289486.149856  9113632.616500 
+289502.788572  9113597.475174 
+289490.668458  9113571.344773 
+289488.658305  9113568.329091 
+Region 1
+105
+289336.286000  9113123.162748 
+289331.271796  9113117.130317 
+289312.149828  9113084.965299 
+289289.022453  9113048.777948 
+289270.901910  9113017.618478 
+289260.733139  9112986.467317 
+289260.422770  9112944.276608 
+289266.419919  9112813.693601 
+289266.390363  9112809.675438 
+289268.067957  9112767.486810 
+289266.830168  9112734.335924 
+289265.717990  9112718.262230 
+289264.672309  9112711.229403 
+289232.928691  9112584.624938 
+289183.356293  9112601.649964 
+289156.630160  9112616.689890 
+289130.890584  9112630.726308 
+289030.921362  9112687.879553 
+288926.041081  9112753.063732 
+288927.094095  9112761.101121 
+288931.165910  9112774.164369 
+288937.255185  9112791.247884 
+288947.342473  9112811.349216 
+288952.437796  9112828.431677 
+288956.561305  9112848.526716 
+288956.708953  9112868.617563 
+288955.810958  9112881.675567 
+288952.880734  9112888.704221 
+288945.937728  9112890.705972 
+288930.085925  9112897.721004 
+288909.286422  9112907.744417 
+288874.556591  9112915.744052 
+288849.677863  9112911.699646 
+288840.658347  9112901.644768 
+288830.740806  9112904.647897 
+288804.006973  9112918.683139 
+288767.348187  9112934.716944 
+288727.692704  9112948.738481 
+288682.102875  9112966.771847 
+288650.413842  9112982.810841 
+288653.565412  9113005.918513 
+288641.726271  9113017.960397 
+288627.884427  9113027.991084 
+288613.041229  9113037.016170 
+288601.194692  9113048.053504 
+288594.354892  9113064.118830 
+288590.445379  9113073.155510 
+288589.473533  9113076.168088 
+288589.606292  9113094.249885 
+288593.685447  9113108.317722 
+288598.817587  9113130.422965 
+288604.980590  9113157.551981 
+288605.128117  9113177.642864 
+288605.216634  9113189.697393 
+288603.457355  9113220.836154 
+288596.875727  9113272.060530 
+288584.876123  9113397.614855 
+288591.848739  9113399.631314 
+288603.783881  9113400.648490 
+288622.706395  9113405.691204 
+288647.607552  9113412.749307 
+288661.508518  9113410.754938 
+288670.476477  9113413.778030 
+288695.444057  9113429.876995 
+288726.427201  9113453.014043 
+288734.438094  9113461.058785 
+288748.368589  9113463.082561 
+288765.244118  9113460.086762 
+288784.078078  9113453.074882 
+288799.878414  9113439.028051 
+288813.683398  9113423.974578 
+288831.427377  9113403.902580 
+288853.176787  9113387.852937 
+288869.993206  9113376.820767 
+288890.829831  9113371.820033 
+288919.647811  9113370.845827 
+288942.509303  9113370.869874 
+288964.384199  9113371.897407 
+289000.196940  9113375.953172 
+289019.126834  9113382.000255 
+289035.000929  9113377.998782 
+289048.879677  9113372.990676 
+289060.748304  9113364.966857 
+289075.547142  9113349.914373 
+289080.472698  9113343.892336 
+289089.359382  9113335.865385 
+289103.134673  9113316.793688 
+289112.948828  9113299.726905 
+289127.725464  9113281.660788 
+289137.591325  9113271.625792 
+289143.503451  9113264.600252 
+289159.318372  9113252.562419 
+289178.122595  9113241.532245 
+289195.969783  9113235.523730 
+289215.804911  9113229.517289 
+289242.620016  9113226.531739 
+289261.490721  9113224.542403 
+289282.356761  9113223.559678 
+289290.293759  9113221.558905 
+289307.080413  9113206.508450 
+289329.727391  9113177.400655 
+289344.511288  9113160.339037 
+289358.367739  9113152.317239 
+289361.342259  9113151.315811 
+289336.286000  9113123.162748 
+Region 1
+113
+290148.265132  9112707.124089 
+290144.296712  9112708.124536 
+290131.404902  9112712.129389 
+290129.387357  9112708.109199 
+290124.350905  9112699.063260 
+290119.299641  9112688.008248 
+290114.337265  9112689.007669 
+290102.439412  9112693.013536 
+290077.634926  9112699.015165 
+290065.759283  9112706.034633 
+290039.003894  9112717.056878 
+290016.202106  9112725.069601 
+289991.442009  9112737.098410 
+289975.597908  9112745.118295 
+289960.710739  9112748.116516 
+289957.647420  9112737.063530 
+289950.519425  9112713.951993 
+289943.324811  9112681.799619 
+289929.017058  9112628.544767 
+289921.866901  9112602.419605 
+289919.812369  9112593.376714 
+289913.782016  9112584.329710 
+289899.770417  9112571.256330 
+289892.746117  9112562.208293 
+289884.742667  9112555.168301 
+289882.725152  9112551.148093 
+289876.709616  9112544.110157 
+289871.710238  9112540.086861 
+289867.727018  9112539.078207 
+289864.737754  9112538.070581 
+289855.792161  9112538.061316 
+289847.840523  9112538.053079 
+289835.913065  9112538.040721 
+289824.000406  9112540.037436 
+289812.080346  9112541.029610 
+289801.117242  9112537.000121 
+289795.116517  9112531.971246 
+289796.036480  9112521.926897 
+289800.932262  9112511.886672 
+289811.717774  9112491.807251 
+289818.564461  9112476.746397 
+289824.431990  9112463.693589 
+289823.341845  9112450.633565 
+289822.236903  9112435.564466 
+289827.110476  9112422.510627 
+289777.568214  9112443.554363 
+289733.937835  9112457.572483 
+289697.205927  9112463.561493 
+289640.668869  9112479.575176 
+289602.957748  9112487.572159 
+289574.177416  9112493.569361 
+289542.429991  9112501.572514 
+289516.631501  9112507.572792 
+289460.079491  9112521.577198 
+289404.550949  9112539.600741 
+289353.955190  9112552.606726 
+289295.415111  9112566.608870 
+289289.466137  9112568.611701 
+289239.871630  9112582.623157 
+289232.928691  9112584.624938 
+289264.672309  9112711.229403 
+289265.717990  9112718.262230 
+289266.830168  9112734.335924 
+289268.067957  9112767.486810 
+289266.390363  9112809.675438 
+289266.419919  9112813.693601 
+289260.422770  9112944.276608 
+289260.733139  9112986.467317 
+289270.901910  9113017.618478 
+289289.022453  9113048.777948 
+289312.149828  9113084.965299 
+289331.271796  9113117.130317 
+289336.286000  9113123.162748 
+289361.342259  9113151.315811 
+289404.995636  9113140.311489 
+289418.999952  9113152.380472 
+289422.975834  9113152.384616 
+289459.774925  9113155.436546 
+289501.536469  9113157.489077 
+289525.384356  9113156.509350 
+289563.110830  9113150.521376 
+289599.784132  9113136.496032 
+289637.421777  9113118.453540 
+289717.474388  9113056.255639 
+289704.360419  9113030.124254 
+289693.323193  9113016.049383 
+289700.251357  9113012.038444 
+289706.185554  9113008.026473 
+289712.119749  9113004.014502 
+289737.844449  9112987.968672 
+289740.811544  9112985.962685 
+289792.334892  9112963.916370 
+289850.919563  9112955.940727 
+289890.589274  9112943.927361 
+289927.269663  9112930.906350 
+289958.972807  9112916.875651 
+289969.876774  9112912.868781 
+290002.559037  9112896.830009 
+289998.509133  9112886.780544 
+290011.393605  9112881.771178 
+290021.311001  9112878.767811 
+290033.194099  9112872.752879 
+290043.074458  9112864.726825 
+290061.900460  9112856.709981 
+290077.722351  9112845.676452 
+290089.605431  9112839.661509 
+290104.448163  9112830.636023 
+290121.256584  9112818.598970 
+290143.057017  9112809.580630 
+290157.936770  9112805.577812 
+290177.778904  9112800.575558 
+290193.667425  9112798.582822 
+290148.265132  9112707.124089 
+Region 1
+106
+290678.369404  9112348.045961 
+290696.045314  9112318.932717 
+290654.284763  9112316.881119 
+290582.720659  9112316.808117 
+290538.964783  9112313.749847 
+290481.308479  9112312.686367 
+290437.567415  9112311.637066 
+290385.852534  9112307.565965 
+290349.039445  9112302.505569 
+290298.333323  9112300.444454 
+290247.627193  9112298.383282 
+290224.788623  9112301.373374 
+290195.978953  9112303.352780 
+290175.113455  9112304.335823 
+290146.325990  9112309.328807 
+290122.515663  9112315.331435 
+290107.643460  9112320.338743 
+290076.860666  9112324.325100 
+290054.029455  9112328.319648 
+290022.223081  9112328.286797 
+290011.289639  9112328.275499 
+289992.419405  9112330.265053 
+289986.455708  9112330.258887 
+289975.514862  9112329.243043 
+289968.564617  9112330.240384 
+289954.701133  9112337.257749 
+289931.951302  9112352.302151 
+289911.167154  9112364.334990 
+289893.342645  9112373.357299 
+289873.530226  9112382.377543 
+289852.716445  9112390.392211 
+289840.818624  9112394.397997 
+289829.053985  9112416.485461 
+289827.110476  9112422.510627 
+289822.236903  9112435.564466 
+289823.341845  9112450.633565 
+289824.431990  9112463.693589 
+289818.564461  9112476.746397 
+289811.717774  9112491.807251 
+289800.932262  9112511.886672 
+289796.036480  9112521.926897 
+289795.116517  9112531.971246 
+289801.117242  9112537.000121 
+289812.080346  9112541.029610 
+289824.000406  9112540.037436 
+289835.913065  9112538.040721 
+289847.840523  9112538.053079 
+289855.792161  9112538.061316 
+289864.737754  9112538.070581 
+289867.727018  9112539.078207 
+289871.710238  9112540.086861 
+289876.709616  9112544.110157 
+289882.725152  9112551.148093 
+289884.742667  9112555.168301 
+289892.746117  9112562.208293 
+289899.770417  9112571.256330 
+289913.782016  9112584.329710 
+289919.812369  9112593.376714 
+289921.866901  9112602.419605 
+289929.017058  9112628.544767 
+289943.324811  9112681.799619 
+289950.519425  9112713.951993 
+289957.647420  9112737.063530 
+289960.710739  9112748.116516 
+289975.597908  9112745.118295 
+289991.442009  9112737.098410 
+290016.202106  9112725.069601 
+290039.003894  9112717.056878 
+290065.759283  9112706.034633 
+290077.634926  9112699.015165 
+290102.439412  9112693.013536 
+290114.337265  9112689.007669 
+290119.299641  9112688.008248 
+290124.350905  9112699.063260 
+290129.387357  9112708.109199 
+290131.404902  9112712.129389 
+290144.296712  9112708.124536 
+290148.265132  9112707.124089 
+290193.667425  9112798.582822 
+290177.778904  9112800.575558 
+290157.936770  9112805.577812 
+290143.057017  9112809.580630 
+290121.256584  9112818.598970 
+290104.448163  9112830.636023 
+290089.605431  9112839.661509 
+290077.722351  9112845.676452 
+290061.900460  9112856.709981 
+290043.074458  9112864.726825 
+290033.194099  9112872.752879 
+290021.311001  9112878.767811 
+290011.393605  9112881.771178 
+289998.509133  9112886.780544 
+290002.559037  9112896.830009 
+290011.475070  9112892.821082 
+290047.131775  9112875.780821 
+290066.936927  9112865.755925 
+290292.966919  9112785.625831 
+290384.151550  9112750.560738 
+290448.617841  9112731.540632 
+290507.098078  9112709.500759 
+290527.748646  9112679.386035 
+290580.546962  9112560.905780 
+290618.695427  9112477.569002 
+290641.244729  9112435.401890 
+290666.634903  9112374.151679 
+290678.369404  9112348.045961 
+Region 1
+96
+289884.696746  9111469.271220 
+289886.507125  9111445.164376 
+289878.326441  9111414.015418 
+289871.258014  9111398.940102 
+289860.236057  9111386.874256 
+289849.191925  9111371.794792 
+289836.152549  9111355.708712 
+289822.119255  9111339.621590 
+289784.069065  9111301.409721 
+289764.064850  9111284.311807 
+289754.059052  9111275.260576 
+289733.068322  9111259.166144 
+289707.078411  9111239.048345 
+289687.096418  9111224.964002 
+289661.106544  9111204.846166 
+289647.132466  9111196.795279 
+289628.203537  9111190.748258 
+289610.275925  9111185.706809 
+289593.349628  9111181.670934 
+289569.443689  9111174.614133 
+289544.477356  9111158.515415 
+289522.551898  9111150.456131 
+289501.590833  9111138.379719 
+289450.686484  9111109.194742 
+289431.720685  9111098.124920 
+289416.642004  9111075.004786 
+289366.805506  9111055.866142 
+289328.057199  9111057.834338 
+289268.480724  9111065.807704 
+289197.993158  9111076.783056 
+289121.571475  9111091.770156 
+289054.080310  9111104.757546 
+288999.473281  9111112.735855 
+288935.942977  9111123.718220 
+288925.031879  9111126.720220 
+288999.150366  9111204.148209 
+289001.234089  9111217.209377 
+288969.031656  9111298.542535 
+288945.597574  9111355.776159 
+288940.701643  9111365.816312 
+288938.765390  9111372.846003 
+288931.874214  9111381.879501 
+288925.954849  9111387.900425 
+288919.026802  9111391.911206 
+288907.151199  9111398.930336 
+288765.423839  9111454.028989 
+288791.634739  9111504.283715 
+288729.628366  9111587.594172 
+288731.630986  9111589.605379 
+288740.650149  9111599.660352 
+288749.639833  9111605.697146 
+288759.652944  9111615.753172 
+288770.682113  9111628.823885 
+288781.681803  9111637.876417 
+288790.693615  9111646.926831 
+288801.693312  9111655.979357 
+288806.707251  9111662.011906 
+288809.718564  9111666.033252 
+288815.763309  9111677.089575 
+288826.814629  9111693.173897 
+288832.888876  9111708.248390 
+288837.954438  9111721.312738 
+288843.005258  9111732.367997 
+288848.078201  9111746.436885 
+288856.118230  9111758.499852 
+288861.080570  9111757.500586 
+289110.985782  9111680.416121 
+289216.523167  9111840.248384 
+289231.579965  9111860.354917 
+289241.607993  9111872.419880 
+289257.577538  9111881.477491 
+289283.560367  9111900.590962 
+289298.528599  9111908.642969 
+289310.515004  9111916.691835 
+289323.561825  9111933.782609 
+289329.577189  9111940.820660 
+289335.577783  9111945.849629 
+289343.529339  9111945.857980 
+289486.051403  9111863.635790 
+289503.868467  9111853.609128 
+289522.627739  9111836.551722 
+289547.328470  9111816.486934 
+289562.126728  9111801.434438 
+289604.747896  9111785.406498 
+289661.346772  9111642.822165 
+289704.012099  9111632.821408 
+289740.765536  9111629.846166 
+289761.342449  9111589.686388 
+289779.983218  9111556.556305 
+289784.901132  9111549.529717 
+289798.742262  9111539.498837 
+289812.568598  9111527.458877 
+289830.392838  9111518.436671 
+289861.093819  9111503.400685 
+289874.949705  9111495.378865 
+289884.696746  9111469.271220 
+Region 1
+102
+288925.031879  9111126.720220 
+288908.996333  9111108.621518 
+288905.985062  9111104.600171 
+288880.945214  9111078.455584 
+288840.098364  9111065.353096 
+288804.250642  9111056.274044 
+288791.314845  9111054.251169 
+288764.456690  9111051.208892 
+288720.731229  9111052.166721 
+288681.968031  9111052.125279 
+288631.270318  9111051.066491 
+288595.452067  9111046.005441 
+288533.828485  9111045.939371 
+288516.909606  9111042.907603 
+288490.088246  9111044.887885 
+288482.158898  9111047.892983 
+288470.253832  9111050.893810 
+288457.384278  9111057.911750 
+288440.583165  9111070.952690 
+288412.973936  9111101.059155 
+288389.318316  9111128.156250 
+288374.556539  9111148.231138 
+288371.589463  9111150.237023 
+288355.811661  9111167.297200 
+288341.020420  9111183.353898 
+288332.310518  9111215.489758 
+288338.531704  9111250.655304 
+288332.722648  9111271.744363 
+288321.855598  9111280.773516 
+288314.964286  9111289.806946 
+288305.113241  9111301.850806 
+288288.378228  9111323.932641 
+288282.502916  9111335.980780 
+288278.586040  9111344.012873 
+288261.851001  9111366.094704 
+288232.305124  9111403.230814 
+288212.617658  9111429.327612 
+288185.000725  9111458.429474 
+288169.185972  9111470.466889 
+288145.390260  9111478.477531 
+288112.678492  9111490.496694 
+288093.837748  9111496.503584 
+288083.927757  9111500.511037 
+288058.166186  9111511.533136 
+288045.369973  9111528.596483 
+288032.588460  9111547.668924 
+288012.922878  9111576.779320 
+288002.107166  9111592.840264 
+287990.297502  9111608.900132 
+287977.523302  9111628.977116 
+287965.728329  9111647.046078 
+287960.810078  9111654.072538 
+287952.961463  9111668.127608 
+287942.160419  9111686.197644 
+287936.277627  9111697.241221 
+288039.139554  9111763.652102 
+288067.095138  9111780.759462 
+288085.089191  9111794.842435 
+288099.166323  9111816.957491 
+288108.236939  9111834.044444 
+288117.336995  9111855.149583 
+288129.485136  9111885.298857 
+288143.635916  9111917.459358 
+288155.725224  9111939.572239 
+288161.791962  9111953.642318 
+288166.901553  9111972.734062 
+288166.953073  9111979.765891 
+288224.440299  9111957.727859 
+288245.254368  9111949.713917 
+288302.748859  9111928.680349 
+288450.508456  9111882.629966 
+288856.118230  9111758.499852 
+288848.078201  9111746.436885 
+288843.005258  9111732.367997 
+288837.954438  9111721.312738 
+288832.888876  9111708.248390 
+288826.814629  9111693.173897 
+288815.763309  9111677.089575 
+288809.718564  9111666.033252 
+288806.707251  9111662.011906 
+288801.693312  9111655.979357 
+288790.693615  9111646.926831 
+288781.681803  9111637.876417 
+288770.682113  9111628.823885 
+288759.652944  9111615.753172 
+288749.639833  9111605.697146 
+288740.650149  9111599.660352 
+288731.630986  9111589.605379 
+288729.628366  9111587.594172 
+288791.634739  9111504.283715 
+288765.423839  9111454.028989 
+288907.151199  9111398.930336 
+288919.026802  9111391.911206 
+288925.954849  9111387.900425 
+288931.874214  9111381.879501 
+288938.765390  9111372.846003 
+288940.701643  9111365.816312 
+288945.597574  9111355.776159 
+288969.031656  9111298.542535 
+289001.234089  9111217.209377 
+288999.150366  9111204.148209 
+288925.031879  9111126.720220 
+Region 1
+69
+289462.773181  9110995.695259 
+289443.755757  9110977.593647 
+289419.717062  9110952.455001 
+289396.694460  9110930.331007 
+289369.651911  9110902.175554 
+289336.653251  9110875.018322 
+289305.620333  9110844.849532 
+289276.575296  9110814.682813 
+289239.490419  9110772.453147 
+289197.391768  9110724.190914 
+289155.315333  9110678.942247 
+289119.268846  9110642.740737 
+289108.239907  9110629.670071 
+289084.179471  9110601.517527 
+289032.119887  9110550.230862 
+288975.135067  9110504.966071 
+288934.141398  9110471.772677 
+288893.184624  9110443.601949 
+288854.252554  9110420.456018 
+288811.403790  9110405.342144 
+288778.553095  9110398.275224 
+288741.741478  9110393.213106 
+288702.029114  9110399.197752 
+288629.620621  9110419.210783 
+288594.921935  9110431.227953 
+288589.967081  9110433.231703 
+288553.287896  9110446.251256 
+288516.638120  9110463.288968 
+288480.996944  9110482.336819 
+288425.550959  9110511.408686 
+288357.286932  9110554.530211 
+288340.493290  9110568.575626 
+288330.612940  9110576.601269 
+288324.671489  9110579.608470 
+288341.796160  9110610.767664 
+288349.857868  9110625.844447 
+288378.070214  9110678.110892 
+288404.419881  9110747.452450 
+288423.642923  9110793.681918 
+288436.769995  9110821.823120 
+288458.857131  9110851.983027 
+288480.900136  9110876.115642 
+288500.012915  9110907.276856 
+288516.129221  9110936.425763 
+288538.253289  9110971.608333 
+288559.354014  9111002.771635 
+288581.426609  9111030.922350 
+288595.452067  9111046.005441 
+288631.270318  9111051.066491 
+288681.968031  9111052.125279 
+288720.731229  9111052.166721 
+288764.456690  9111051.208892 
+288791.314845  9111054.251169 
+288804.250642  9111056.274044 
+288840.098364  9111065.353096 
+288880.945214  9111078.455584 
+288905.985062  9111104.600171 
+288908.996333  9111108.621518 
+288925.031879  9111126.720220 
+288935.942977  9111123.718220 
+288999.473281  9111112.735855 
+289054.080310  9111104.757546 
+289121.571475  9111091.770156 
+289197.993158  9111076.783056 
+289268.480724  9111065.807704 
+289328.057199  9111057.834338 
+289366.805506  9111055.866142 
+289416.642004  9111075.004786 
+289462.773181  9110995.695259 
+Region 1
+115
+288559.354014  9111002.771635 
+288538.253289  9110971.608333 
+288516.129221  9110936.425763 
+288500.012915  9110907.276856 
+288480.900136  9110876.115642 
+288458.857131  9110851.983027 
+288436.769995  9110821.823120 
+288423.642923  9110793.681918 
+288404.419881  9110747.452450 
+288378.070214  9110678.110892 
+288349.857868  9110625.844447 
+288341.796160  9110610.767664 
+288324.671489  9110579.608470 
+288301.906949  9110592.642888 
+288247.528140  9110631.761141 
+288202.043057  9110663.857198 
+288178.335978  9110683.922330 
+288144.711700  9110706.990331 
+288121.961735  9110722.033781 
+288087.350821  9110746.105225 
+288049.669885  9110758.118835 
+288029.879582  9110770.151842 
+288016.038122  9110780.182221 
+287985.329308  9110794.212439 
+287941.670030  9110804.210399 
+287903.024444  9110820.241023 
+287863.399590  9110838.279637 
+287831.652664  9110846.281392 
+287808.873115  9110857.306526 
+287747.535965  9110896.416767 
+287740.637211  9110904.445575 
+287706.180128  9110949.612357 
+287668.777901  9110999.798623 
+287656.334090  9111065.080278 
+287629.598084  9111214.727884 
+287628.736333  9111232.808705 
+287627.216036  9111432.710964 
+287616.693980  9111488.953854 
+287611.907886  9111514.062190 
+287568.142512  9111645.609499 
+287497.415461  9111760.050160 
+287373.117412  9111888.495813 
+287359.319527  9111904.553411 
+287380.633094  9111964.849330 
+287427.917027  9111906.637511 
+287461.439730  9111869.506043 
+287496.891528  9111824.340326 
+287526.504417  9111796.245451 
+287564.076214  9111769.163787 
+287705.781116  9111982.280921 
+287765.572713  9112003.441196 
+287789.486422  9112011.503460 
+287797.445406  9112012.516630 
+287869.820202  9111987.481512 
+287887.011560  9112027.681744 
+287894.108967  9112046.775694 
+287901.199028  9112064.865093 
+288166.953073  9111979.765891 
+288166.901553  9111972.734062 
+288161.791962  9111953.642318 
+288155.725224  9111939.572239 
+288143.635916  9111917.459358 
+288129.485136  9111885.298857 
+288117.336995  9111855.149583 
+288108.236939  9111834.044444 
+288099.166323  9111816.957491 
+288085.089191  9111794.842435 
+288067.095138  9111780.759462 
+288039.139554  9111763.652102 
+287936.277627  9111697.241221 
+287942.160419  9111686.197644 
+287952.961463  9111668.127608 
+287960.810078  9111654.072538 
+287965.728329  9111647.046078 
+287977.523302  9111628.977116 
+287990.297502  9111608.900132 
+288002.107166  9111592.840264 
+288012.922878  9111576.779320 
+288032.588460  9111547.668924 
+288045.369973  9111528.596483 
+288058.166186  9111511.533136 
+288083.927757  9111500.511037 
+288093.837748  9111496.503584 
+288112.678492  9111490.496694 
+288145.390260  9111478.477531 
+288169.185972  9111470.466889 
+288185.000725  9111458.429474 
+288212.617658  9111429.327612 
+288232.305124  9111403.230814 
+288261.851001  9111366.094704 
+288278.586040  9111344.012873 
+288282.502916  9111335.980780 
+288288.378228  9111323.932641 
+288305.113241  9111301.850806 
+288314.964286  9111289.806946 
+288321.855598  9111280.773516 
+288332.722648  9111271.744363 
+288338.531704  9111250.655304 
+288332.310518  9111215.489758 
+288341.020420  9111183.353898 
+288355.811661  9111167.297200 
+288371.589463  9111150.237023 
+288374.556539  9111148.231138 
+288389.318316  9111128.156250 
+288412.973936  9111101.059155 
+288440.583165  9111070.952690 
+288457.384278  9111057.911750 
+288470.253832  9111050.893810 
+288482.158898  9111047.892983 
+288490.088246  9111044.887885 
+288516.909606  9111042.907603 
+288533.828485  9111045.939371 
+288595.452067  9111046.005441 
+288581.426609  9111030.922350 
+288559.354014  9111002.771635 
+Region 1
+151
+287894.108967  9112046.775694 
+287887.011560  9112027.681744 
+287869.820202  9111987.481512 
+287797.445406  9112012.516630 
+287789.486422  9112011.503460 
+287765.572713  9112003.441196 
+287705.781116  9111982.280921 
+287564.076214  9111769.163787 
+287526.504417  9111796.245451 
+287496.891528  9111824.340326 
+287461.439730  9111869.506043 
+287427.917027  9111906.637511 
+287380.633094  9111964.849330 
+287359.319527  9111904.553411 
+287334.683568  9111933.658209 
+287279.491863  9111997.888565 
+287191.969079  9112126.374262 
+287188.037275  9112132.397215 
+287151.730416  9112196.648221 
+287144.860748  9112208.695216 
+287118.654864  9112295.057284 
+287070.390883  9112355.276975 
+286993.382435  9112426.515040 
+286947.098760  9112485.732300 
+286926.621526  9112539.955221 
+286927.061673  9112600.228434 
+286932.625773  9112681.602733 
+286873.390809  9112736.787571 
+286813.825649  9112746.767432 
+286811.896372  9112754.801675 
+286813.022367  9112772.884743 
+286813.139718  9112788.957608 
+286815.186348  9112796.996231 
+286820.266252  9112812.070015 
+286823.328866  9112823.123394 
+286837.537959  9112863.320873 
+286838.561278  9112867.340182 
+286846.527773  9112869.358042 
+286872.305171  9112860.345493 
+286895.107961  9112852.334206 
+286916.946112  9112848.340031 
+286968.537517  9112835.337619 
+286989.366991  9112829.333215 
+287004.232601  9112823.322259 
+287023.037413  9112812.292896 
+287056.693125  9112793.243453 
+287062.701017  9112799.277307 
+287070.696860  9112805.313338 
+287079.694022  9112812.355009 
+287085.694578  9112817.384306 
+287092.681770  9112821.410138 
+287105.662182  9112829.460710 
+287123.634501  9112840.530373 
+287144.552045  9112846.580529 
+287307.328952  9112814.612939 
+287306.305595  9112810.593649 
+287306.239485  9112801.552687 
+287305.157366  9112789.496986 
+287306.070540  9112778.448005 
+287306.924952  9112759.362613 
+287307.838127  9112748.313633 
+287309.782001  9112742.288493 
+287311.689149  9112731.240597 
+287314.538851  9112713.161926 
+287318.353145  9112691.066134 
+287320.223565  9112674.995481 
+287324.103963  9112661.940652 
+287328.970984  9112647.882355 
+287330.907509  9112640.852665 
+287337.835920  9112636.842051 
+287344.779021  9112634.840538 
+287350.713459  9112630.828838 
+287369.525429  9112620.803920 
+287376.453833  9112616.793302 
+287388.300659  9112605.756242 
+287400.147479  9112594.719181 
+287408.975654  9112578.656114 
+287414.821919  9112562.589798 
+287422.582651  9112536.480139 
+287432.426819  9112523.431807 
+287437.359921  9112518.414467 
+287446.217460  9112506.369602 
+287460.044828  9112494.330149 
+287464.977924  9112489.312807 
+287466.936467  9112485.296769 
+287461.878471  9112473.236750 
+287458.771674  9112456.156140 
+287453.698991  9112442.087017 
+287448.604272  9112425.004240 
+287446.564917  9112417.970218 
+287449.495386  9112410.941612 
+287453.441858  9112406.927741 
+287463.359463  9112403.924918 
+287468.343979  9112405.939433 
+287472.349225  9112409.961966 
+287478.371789  9112418.004865 
+287484.423745  9112430.065966 
+287495.438182  9112441.127925 
+287505.436616  9112449.175146 
+287509.434521  9112452.193124 
+287523.430866  9112463.258317 
+287546.358210  9112472.324130 
+287561.289739  9112475.353987 
+287586.175624  9112480.403736 
+287601.107156  9112483.433579 
+287620.007200  9112485.463182 
+287637.913279  9112487.491699 
+287642.868403  9112485.487992 
+287651.718523  9112472.438551 
+287656.614834  9112462.398446 
+287663.477017  9112449.346849 
+287666.407450  9112442.318236 
+287659.405593  9112436.283391 
+287650.437862  9112433.260036 
+287642.471448  9112431.242308 
+287632.517105  9112429.222420 
+287624.550692  9112427.204688 
+287615.421260  9112402.081229 
+287612.395269  9112396.050691 
+287602.352738  9112381.976195 
+287600.276616  9112369.919436 
+287615.112561  9112359.890134 
+287627.010712  9112355.884889 
+287636.898885  9112348.863834 
+287639.873421  9112347.862522 
+287644.821181  9112344.854268 
+287644.799130  9112341.840619 
+287646.720900  9112332.801830 
+287642.708301  9112327.774764 
+287641.684939  9112323.755486 
+287638.681003  9112320.738599 
+287631.664471  9112312.694644 
+287627.659226  9112308.672126 
+287618.647426  9112299.621459 
+287614.656881  9112297.608039 
+287590.706273  9112284.522962 
+287572.734138  9112273.453455 
+287552.737350  9112257.359025 
+287596.965868  9112189.098271 
+287625.893565  9112203.193308 
+287653.739119  9112205.232647 
+287677.542682  9112198.226705 
+287701.338885  9112190.216202 
+287729.140314  9112186.228199 
+287767.889977  9112184.261129 
+287808.627544  9112182.296180 
+287829.493302  9112181.314230 
+287853.318866  9112177.321851 
+287924.516007  9112127.171808 
+287901.199028  9112064.865093 
+287894.108967  9112046.775694 
+Region 1
+115
+290127.731185  9110189.753109 
+290074.950899  9110175.634661 
+290077.747800  9110150.524331 
+290080.448606  9110112.355012 
+290080.396862  9110105.323249 
+290086.895867  9110043.049176 
+290031.148850  9110030.936596 
+289829.187895  9110003.602752 
+289709.801833  9109987.404774 
+289560.561892  9109966.152288 
+289555.592393  9109966.147041 
+289398.386523  9109942.876506 
+289203.382984  9109915.547047 
+289064.096870  9109896.312468 
+289008.394216  9109890.225778 
+288983.524592  9109887.185593 
+288957.668432  9109885.148874 
+288939.697193  9109874.079753 
+288930.693164  9109866.033829 
+288923.713764  9109863.012751 
+288904.800190  9109858.974357 
+288885.916074  9109858.954130 
+288845.173495  9109859.915002 
+288784.560239  9109861.859047 
+288712.027496  9109864.794736 
+288654.388532  9109865.737268 
+288620.603210  9109866.705428 
+288640.893346  9109922.981383 
+288647.946339  9109936.047962 
+288651.995547  9109946.097694 
+288663.090401  9109968.209455 
+288684.315685  9110016.450071 
+288694.578611  9110060.660741 
+288696.610589  9110066.690147 
+288704.738509  9110090.807771 
+288713.911879  9110121.958273 
+288718.115725  9110153.103436 
+288716.385576  9110188.260375 
+288717.629799  9110222.415970 
+288720.795588  9110247.532793 
+288726.957843  9110274.661902 
+288734.143472  9110305.810253 
+288734.268646  9110322.887515 
+288735.402460  9110341.974931 
+288740.681291  9110384.171138 
+288741.741478  9110393.213106 
+288778.553095  9110398.275224 
+288811.403790  9110405.342144 
+288854.252554  9110420.456018 
+288893.184624  9110443.601949 
+288934.141398  9110471.772677 
+288975.135067  9110504.966071 
+289032.119887  9110550.230862 
+289084.179471  9110601.517527 
+289108.239907  9110629.670071 
+289119.268846  9110642.740737 
+289155.315333  9110678.942247 
+289197.391768  9110724.190914 
+289239.490419  9110772.453147 
+289276.575296  9110814.682813 
+289305.620333  9110844.849532 
+289336.653251  9110875.018322 
+289369.651911  9110902.175554 
+289396.694460  9110930.331007 
+289419.717062  9110952.455001 
+289443.755757  9110977.593647 
+289462.773181  9110995.695259 
+289469.774941  9111001.729824 
+289491.781540  9111020.839097 
+289526.738702  9111043.980096 
+289560.672430  9111063.101856 
+289565.671593  9111067.125234 
+289585.660865  9111082.214197 
+289611.576761  9111092.286704 
+289645.451448  9111103.372067 
+289690.214981  9111108.441612 
+289738.917260  9111108.492573 
+289774.654174  9111102.502747 
+289808.395834  9111095.506281 
+289835.106098  9111078.457146 
+289853.887138  9111064.413317 
+289885.530008  9111042.346655 
+289909.214082  9111019.267150 
+289926.934610  9110996.181424 
+289950.566883  9110966.070142 
+289967.278664  9110940.974298 
+289983.018692  9110918.891030 
+289992.743439  9110889.769786 
+290003.499066  9110865.672265 
+290006.436451  9110859.648144 
+290024.112509  9110830.535178 
+290036.752415  9110792.376201 
+290038.621930  9110776.305669 
+290041.492754  9110761.240710 
+290042.213068  9110724.073856 
+290040.047775  9110699.962885 
+290035.887268  9110674.845305 
+290034.664142  9110643.703604 
+290030.422321  9110607.536107 
+290032.188337  9110577.402048 
+290031.157460  9110572.378324 
+290023.021346  9110547.256594 
+290032.783009  9110523.158050 
+290040.408983  9110478.966680 
+290057.105805  9110451.861776 
+290079.736478  9110420.744934 
+290084.646863  9110412.713811 
+290098.398891  9110390.628483 
+290113.144813  9110368.544189 
+290126.867240  9110342.440709 
+290141.576164  9110315.333725 
+290163.101899  9110269.147777 
+290177.655495  9110220.945514 
+290183.485801  9110202.870054 
+290127.731185  9110189.753109 
+Region 1
+145
+288741.741478  9110393.213106 
+288740.681291  9110384.171138 
+288735.402460  9110341.974931 
+288734.268646  9110322.887515 
+288734.143472  9110305.810253 
+288726.957843  9110274.661902 
+288720.795588  9110247.532793 
+288717.629799  9110222.415970 
+288716.385576  9110188.260375 
+288718.115725  9110153.103436 
+288713.911879  9110121.958273 
+288704.738509  9110090.807771 
+288696.610589  9110066.690147 
+288694.578611  9110060.660741 
+288684.315685  9110016.450071 
+288663.090401  9109968.209455 
+288651.995547  9109946.097694 
+288647.946339  9109936.047962 
+288640.893346  9109922.981383 
+288620.603210  9109866.705428 
+288612.453328  9109839.574129 
+288589.152157  9109779.276744 
+288568.847476  9109720.991640 
+288546.569778  9109664.713458 
+288518.159616  9109585.324242 
+288507.955907  9109549.149828 
+288487.776501  9109507.941923 
+288397.120396  9109343.099337 
+288388.057768  9109327.016879 
+288362.872407  9109280.780734 
+288290.320390  9109145.089026 
+288210.708864  9108995.325826 
+288168.067246  9109008.338319 
+288111.525869  9109023.344670 
+288070.864608  9109035.354707 
+288016.332933  9109053.376777 
+288008.403850  9109056.381719 
+287931.042024  9109078.396862 
+287905.615137  9108999.010167 
+287877.214051  9108920.624707 
+287847.863220  9108848.265413 
+287840.751997  9108827.162205 
+287827.516126  9108783.952323 
+287802.951583  9108686.484660 
+287786.506870  9108612.130386 
+287771.224750  9108560.881858 
+287754.860826  9108497.577607 
+287709.223116  9108508.577196 
+287692.341860  9108510.567634 
+287673.458186  9108510.546767 
+287640.638237  9108507.496849 
+287618.750942  9108504.459005 
+287589.862538  9108495.386137 
+287522.095696  9108470.197451 
+287429.394092  9108432.926412 
+287343.671705  9108398.676551 
+287269.905212  9108368.458009 
+287025.732410  9108275.766790 
+287047.671723  9108422.455196 
+287048.687547  9108425.469974 
+287080.924464  9108621.392614 
+287154.458645  9108756.083916 
+287149.540450  9108763.110252 
+287090.573231  9108854.458143 
+287055.107911  9108897.614033 
+286986.157543  9108982.923442 
+286982.218560  9108987.941772 
+286948.623769  9109015.026965 
+286950.713981  9109029.092961 
+286896.474147  9109087.295995 
+286892.564407  9109096.332543 
+286878.759607  9109111.385295 
+286870.779187  9109107.358169 
+286840.881878  9109096.274654 
+286808.185731  9109110.301669 
+286734.951873  9109153.415057 
+286800.447451  9109276.043354 
+286803.480349  9109283.078586 
+286734.711156  9109256.883231 
+286591.187624  9109201.471766 
+286545.607223  9109357.125527 
+286466.935476  9109335.941352 
+286442.621321  9109409.246039 
+286413.746959  9109402.181617 
+286393.203749  9109447.363167 
+286326.699756  9109459.342654 
+286307.822851  9109460.325867 
+286225.268907  9109725.433804 
+286148.539081  9109971.461915 
+286151.579265  9109979.501760 
+286164.595155  9109992.575642 
+286189.516158  9110002.649323 
+286194.500360  9110004.664057 
+286197.467505  9110002.658310 
+286274.028429  9110006.762967 
+286611.097992  9110025.223921 
+286866.636873  9110039.573267 
+286953.122153  9110041.678715 
+286989.904334  9110042.724190 
+287039.761206  9110064.879632 
+287082.704659  9110093.054607 
+287115.899481  9110147.336902 
+287147.099230  9110200.612396 
+287168.345220  9110251.867739 
+287170.377026  9110257.897260 
+287296.091520  9110187.718156 
+287301.053772  9110186.719093 
+287404.813162  9110376.692401 
+287477.336408  9110508.367416 
+287494.460533  9110539.527078 
+287513.579870  9110571.693461 
+287585.051200  9110695.330644 
+287656.442215  9110807.917560 
+287727.613304  9110890.367774 
+287740.637211  9110904.445575 
+287747.535965  9110896.416767 
+287808.873115  9110857.306526 
+287831.652664  9110846.281392 
+287863.399590  9110838.279637 
+287903.024444  9110820.241023 
+287941.670030  9110804.210399 
+287985.329308  9110794.212439 
+288016.038122  9110780.182221 
+288029.879582  9110770.151842 
+288049.669885  9110758.118835 
+288087.350821  9110746.105225 
+288121.961735  9110722.033781 
+288144.711700  9110706.990331 
+288178.335978  9110683.922330 
+288202.043057  9110663.857198 
+288247.528140  9110631.761141 
+288301.906949  9110592.642888 
+288324.671489  9110579.608470 
+288330.612940  9110576.601269 
+288340.493290  9110568.575626 
+288357.286932  9110554.530211 
+288425.550959  9110511.408686 
+288480.996944  9110482.336819 
+288516.638120  9110463.288968 
+288553.287896  9110446.251256 
+288589.967081  9110433.231703 
+288594.921935  9110431.227953 
+288629.620621  9110419.210783 
+288702.029114  9110399.197752 
+288741.741478  9110393.213106 
+Region 1
+52
+289008.394216  9109890.225778 
+289002.283477  9109870.128535 
+288968.748197  9109769.639096 
+288956.482629  9109723.417316 
+288953.419925  9109712.364142 
+288936.111281  9109656.091586 
+288924.920697  9109620.920830 
+288916.763363  9109592.785072 
+288891.363811  9109517.417605 
+288888.286424  9109504.355330 
+288873.915506  9109442.058640 
+288855.517561  9109372.725852 
+288835.212876  9109314.440895 
+288833.195659  9109310.420579 
+288813.951168  9109261.177570 
+288784.414677  9109163.705677 
+288754.922501  9109072.261002 
+288753.899190  9109068.241750 
+288726.446434  9108983.830986 
+288710.095661  9108922.536537 
+288688.716721  9108853.200334 
+288651.030170  9108864.209500 
+288598.472144  9108880.225229 
+288556.817357  9108892.234568 
+288487.399995  9108913.254606 
+288373.353321  9108947.285052 
+288242.447092  9108986.319573 
+288210.708864  9108995.325826 
+288290.320390  9109145.089026 
+288362.872407  9109280.780734 
+288388.057768  9109327.016879 
+288397.120396  9109343.099337 
+288487.776501  9109507.941923 
+288507.955907  9109549.149828 
+288518.159616  9109585.324242 
+288546.569778  9109664.713458 
+288568.847476  9109720.991640 
+288589.152157  9109779.276744 
+288612.453328  9109839.574129 
+288620.603210  9109866.705428 
+288654.388532  9109865.737268 
+288712.027496  9109864.794736 
+288784.560239  9109861.859047 
+288845.173495  9109859.915002 
+288885.916074  9109858.954130 
+288904.800190  9109858.974357 
+288923.713764  9109863.012751 
+288930.693164  9109866.033829 
+288939.697193  9109874.079753 
+288957.668432  9109885.148874 
+288983.524592  9109887.185593 
+289008.394216  9109890.225778 
+Region 1
+109
+290508.348727  9108429.210473 
+290496.972760  9108368.926899 
+290295.499866  9108406.888370 
+290076.122119  9108442.821119 
+290062.244941  9108447.829168 
+290054.389999  9108460.879800 
+290043.523933  9108469.909138 
+290033.592672  9108470.903212 
+290019.604759  9108460.843169 
+290013.530856  9108445.768805 
+290014.502577  9108442.756236 
+289926.872828  9108419.559595 
+289831.306976  9108398.363431 
+289827.324144  9108397.354686 
+289592.388852  9108344.869771 
+289510.751986  9108325.696733 
+289483.050029  9108478.356349 
+289478.441799  9108527.573596 
+289488.844797  9108590.870299 
+289491.951703  9108607.950679 
+289499.174138  9108644.121577 
+289495.397665  9108671.239966 
+289484.583008  9108687.300997 
+289476.713109  9108698.342493 
+289440.234628  9108738.485012 
+289408.703348  9108775.619184 
+289349.594038  9108846.878110 
+289327.883492  9108867.950178 
+289295.269747  9108893.028743 
+289263.605638  9108912.081098 
+289231.904667  9108926.110723 
+289215.038196  9108930.110838 
+289199.143502  9108931.098381 
+289169.349230  9108934.080121 
+289088.992279  9108954.084793 
+288986.836097  9108983.106764 
+288946.204736  9108999.135704 
+288910.528029  9109013.160869 
+288813.363001  9109045.201481 
+288753.899190  9109068.241750 
+288754.922501  9109072.261002 
+288784.414677  9109163.705677 
+288813.951168  9109261.177570 
+288833.195659  9109310.420579 
+288835.212876  9109314.440895 
+288855.517561  9109372.725852 
+288873.915506  9109442.058640 
+288888.286424  9109504.355330 
+288891.363811  9109517.417605 
+288916.763363  9109592.785072 
+288924.920697  9109620.920830 
+288936.111281  9109656.091586 
+288953.419925  9109712.364142 
+288956.482629  9109723.417316 
+288968.748197  9109769.639096 
+289002.283477  9109870.128535 
+289008.394216  9109890.225778 
+289064.096870  9109896.312468 
+289203.382984  9109915.547047 
+289398.386523  9109942.876506 
+289555.592393  9109966.147041 
+289560.561892  9109966.152288 
+289709.801833  9109987.404774 
+289829.187895  9110003.602752 
+290031.148850  9110030.936596 
+290086.895867  9110043.049176 
+290080.396862  9110105.323249 
+290080.448606  9110112.355012 
+290077.747800  9110150.524331 
+290074.950899  9110175.634661 
+290127.731185  9110189.753109 
+290183.485801  9110202.870054 
+290190.302611  9110183.791091 
+290199.871881  9110133.574585 
+290200.569997  9110093.394140 
+290201.149812  9110037.141102 
+290201.833159  9109994.951582 
+290199.534825  9109952.758956 
+290193.320071  9109918.598482 
+290178.101139  9109876.392382 
+290164.951345  9109845.238254 
+290152.751117  9109808.057930 
+290137.606194  9109775.897172 
+290126.392520  9109737.713330 
+290118.130983  9109695.514445 
+290101.792724  9109636.230102 
+290101.681879  9109621.162035 
+290101.327182  9109572.944223 
+290097.916947  9109514.677912 
+290101.656048  9109482.536861 
+290112.086350  9109414.239730 
+290122.634862  9109362.015206 
+290125.527848  9109349.963873 
+290132.196870  9109310.794181 
+290140.809321  9109265.599345 
+290144.637075  9109245.512751 
+290155.979949  9109166.166757 
+290179.315837  9109095.874089 
+290195.783209  9109037.628594 
+290200.634371  9109021.561194 
+290215.387340  9109000.481507 
+290242.942436  9108963.342735 
+290290.345391  9108922.206584 
+290316.030885  9108901.138305 
+290404.976700  9108832.923171 
+290469.958492  9108749.615035 
+290517.689452  9108618.071540 
+290525.255919  9108565.843950 
+290508.348727  9108429.210473 
+Region 1
+88
+289551.137326  9108005.293537 
+289349.156358  9108109.549331 
+289245.920059  9108126.515831 
+289239.971619  9108128.518522 
+289182.511702  9108153.570247 
+289137.935119  9108173.613081 
+289103.260322  9108188.643847 
+289019.593308  9107892.215567 
+288962.177599  9107923.294240 
+288954.263510  9107928.308378 
+288926.516379  9107939.328312 
+288900.756949  9107950.350381 
+288800.715358  9107996.450858 
+288752.163209  9108016.489009 
+288713.527574  9108033.524261 
+288661.021925  9108056.571660 
+288622.584606  9108100.729604 
+288567.413153  9108166.969193 
+288497.311501  9108230.178885 
+288458.697590  9108250.227624 
+288419.163216  9108280.320730 
+288418.323587  9108301.415144 
+288391.481777  9108300.381344 
+288350.703765  9108296.318700 
+288316.868152  9108290.254520 
+288310.079941  9108313.351527 
+288294.361577  9108338.447860 
+288260.863641  9108378.592866 
+288224.156458  9108387.593597 
+288200.347572  9108393.594794 
+288065.408366  9108424.587723 
+287914.603554  9108460.585549 
+287854.079821  9108474.582515 
+287778.677211  9108492.581169 
+287754.860826  9108497.577607 
+287771.224750  9108560.881858 
+287786.506870  9108612.130386 
+287802.951583  9108686.484660 
+287827.516126  9108783.952323 
+287840.751997  9108827.162205 
+287847.863220  9108848.265413 
+287877.214051  9108920.624707 
+287905.615137  9108999.010167 
+287931.042024  9109078.396862 
+288008.403850  9109056.381719 
+288016.332933  9109053.376777 
+288070.864608  9109035.354707 
+288111.525869  9109023.344670 
+288168.067246  9109008.338319 
+288210.708864  9108995.325826 
+288242.447092  9108986.319573 
+288373.353321  9108947.285052 
+288487.399995  9108913.254606 
+288556.817357  9108892.234568 
+288598.472144  9108880.225229 
+288651.030170  9108864.209500 
+288688.716721  9108853.200334 
+288710.095661  9108922.536537 
+288726.446434  9108983.830986 
+288753.899190  9109068.241750 
+288813.363001  9109045.201481 
+288910.528029  9109013.160869 
+288946.204736  9108999.135704 
+288986.836097  9108983.106764 
+289088.992279  9108954.084793 
+289169.349230  9108934.080121 
+289199.143502  9108931.098381 
+289215.038196  9108930.110838 
+289231.904667  9108926.110723 
+289263.605638  9108912.081098 
+289295.269747  9108893.028743 
+289327.883492  9108867.950178 
+289349.594038  9108846.878110 
+289408.703348  9108775.619184 
+289440.234628  9108738.485012 
+289476.713109  9108698.342493 
+289484.583008  9108687.300997 
+289495.397665  9108671.239966 
+289499.174138  9108644.121577 
+289491.951703  9108607.950679 
+289488.844797  9108590.870299 
+289478.441799  9108527.573596 
+289483.050029  9108478.356349 
+289510.751986  9108325.696733 
+289541.324923  9108157.972188 
+289556.651891  9108079.634902 
+289571.927255  9107994.265830 
+289551.137326  9108005.293537 
+Region 1
+46
+290469.525328  9107745.085871 
+290451.569618  9107736.026303 
+290412.853942  9107742.012902 
+290378.386896  9107785.171516 
+290324.574522  9107900.635945 
+290263.273303  9107943.766349 
+290228.429436  9107935.693483 
+290200.365359  9107903.518995 
+290008.997871  9107693.370157 
+289918.941249  9107745.510471 
+289885.297873  9107765.565456 
+289844.749128  9107792.644823 
+289822.023289  9107810.702290 
+289803.294954  9107831.777592 
+289777.690738  9107863.895445 
+289756.106132  9107902.044758 
+289731.606282  9107949.231765 
+289721.763573  9107962.280232 
+289701.960193  9107972.304512 
+289679.131011  9107976.298369 
+289665.231779  9107978.292651 
+289576.881798  9107992.262043 
+289571.927255  9107994.265830 
+289556.651891  9108079.634902 
+289541.324923  9108157.972188 
+289510.751986  9108325.696733 
+289592.388852  9108344.869771 
+289827.324144  9108397.354686 
+289831.306976  9108398.363431 
+289926.872828  9108419.559595 
+290014.502577  9108442.756236 
+290013.530856  9108445.768805 
+290019.604759  9108460.843169 
+290033.592672  9108470.903212 
+290043.523933  9108469.909138 
+290054.389999  9108460.879800 
+290062.244941  9108447.829168 
+290076.122119  9108442.821119 
+290295.499866  9108406.888370 
+290496.972760  9108368.926899 
+290485.604233  9108309.647850 
+290474.372376  9108133.843602 
+290501.753161  9107937.989123 
+290546.465248  9107801.419973 
+290503.456463  9107764.207437 
+290469.525328  9107745.085871 
+Region 1
+65
+289182.511702  9108153.570247 
+289239.971619  9108128.518522 
+289147.440224  9107843.131029 
+289141.359361  9107827.051912 
+289086.786327  9107703.435193 
+289085.623282  9107680.329606 
+289080.639311  9107678.315159 
+289049.741639  9107666.227391 
+289012.041462  9107675.227521 
+288938.643453  9107695.238936 
+288893.014438  9107707.244014 
+288837.527709  9107730.288283 
+288810.340835  9107682.041009 
+288791.200389  9107646.861427 
+288751.911054  9107574.492044 
+288735.737570  9107537.306562 
+288732.711934  9107531.276045 
+288710.472537  9107480.020415 
+288643.133163  9107513.096897 
+288634.203199  9107515.096249 
+288627.260935  9107517.097764 
+288590.525181  9107522.080427 
+288546.883855  9107534.087302 
+288361.407858  9107585.116108 
+288298.927163  9107603.129384 
+288240.414481  9107620.142399 
+288212.784625  9107647.234674 
+288185.074040  9107663.276899 
+288066.302609  9107730.450574 
+287950.417044  9107784.568153 
+287989.940176  9107889.084090 
+288044.606220  9108025.761930 
+288082.105485  9108125.252742 
+288159.428963  9108098.214989 
+288188.830834  9108177.605943 
+288195.875976  9108189.668149 
+288201.366421  9108260.996549 
+288206.842230  9108330.315845 
+288210.971862  9108351.415716 
+288215.064796  9108367.492842 
+288224.156458  9108387.593597 
+288260.863641  9108378.592866 
+288294.361577  9108338.447860 
+288310.079941  9108313.351527 
+288316.868152  9108290.254520 
+288350.703765  9108296.318700 
+288391.481777  9108300.381344 
+288418.323587  9108301.415144 
+288419.163216  9108280.320730 
+288458.697590  9108250.227624 
+288497.311501  9108230.178885 
+288567.413153  9108166.969193 
+288622.584606  9108100.729604 
+288661.021925  9108056.571660 
+288713.527574  9108033.524261 
+288752.163209  9108016.489009 
+288800.715358  9107996.450858 
+288900.756949  9107950.350381 
+288926.516379  9107939.328312 
+288954.263510  9107928.308378 
+288962.177599  9107923.294240 
+289019.593308  9107892.215567 
+289103.260322  9108188.643847 
+289137.935119  9108173.613081 
+289182.511702  9108153.570247 
+Region 1
+89
+288210.971862  9108351.415716 
+288206.842230  9108330.315845 
+288201.366421  9108260.996549 
+288195.875976  9108189.668149 
+288188.830834  9108177.605943 
+288159.428963  9108098.214989 
+288082.105485  9108125.252742 
+288044.606220  9108025.761930 
+287989.940176  9107889.084090 
+287950.417044  9107784.568153 
+288066.302609  9107730.450574 
+288062.209838  9107714.373404 
+288024.403234  9107572.691368 
+287999.876250  9107480.246456 
+287995.812869  9107468.187467 
+287977.425071  9107399.858301 
+287948.820360  9107293.345209 
+287917.168355  9107177.787806 
+287912.001289  9107150.659434 
+287914.858268  9107133.585372 
+287921.734591  9107122.543016 
+287947.457334  9107106.498806 
+287946.038501  9107048.233770 
+287946.929765  9107034.171161 
+287948.807545  9107019.105102 
+287964.152166  9106942.776859 
+287977.589682  9106877.496475 
+287991.999039  9106809.203544 
+288013.028200  9106694.708999 
+287879.189909  9106739.765037 
+287767.157149  9106776.808650 
+287716.566532  9106789.811418 
+287645.134509  9106806.809081 
+287563.785951  9106826.809206 
+287488.393021  9106845.811315 
+287301.784648  9106877.747740 
+287242.249066  9106890.739995 
+287215.444514  9106894.728060 
+287140.986567  9106905.694325 
+287092.449000  9106791.121290 
+286803.987277  9106620.021904 
+286773.046847  9106601.904907 
+286770.109117  9106607.928866 
+286751.452392  9106639.048700 
+286727.833733  9106671.167444 
+286710.112420  9106694.251942 
+286677.665870  9106742.433434 
+286636.362210  9106802.659439 
+286586.215970  9106876.939066 
+286576.386933  9106891.996127 
+286560.638574  9106913.073748 
+286551.796076  9106927.127381 
+286456.421148  9107068.660304 
+286360.051826  9107210.192025 
+286319.785006  9107276.446421 
+286313.996873  9107300.549038 
+286310.145408  9107317.622008 
+286308.259783  9107331.683571 
+286308.376460  9107347.756522 
+286307.455525  9107357.800981 
+286507.928982  9107455.470770 
+286757.299553  9107580.317579 
+286798.932180  9107565.296401 
+286888.145875  9107533.251564 
+286962.458828  9107502.194345 
+287031.539773  9107708.204266 
+287127.982590  9107986.571926 
+287190.831565  9108155.406024 
+287191.847387  9108158.420797 
+287231.354824  9108260.928614 
+287269.905212  9108368.458009 
+287343.671705  9108398.676551 
+287429.394092  9108432.926412 
+287522.095696  9108470.197451 
+287589.862538  9108495.386137 
+287618.750942  9108504.459005 
+287640.638237  9108507.496849 
+287673.458186  9108510.546767 
+287692.341860  9108510.567634 
+287709.223116  9108508.577196 
+287754.860826  9108497.577607 
+287778.677211  9108492.581169 
+287854.079821  9108474.582515 
+287914.603554  9108460.585549 
+288065.408366  9108424.587723 
+288200.347572  9108393.594794 
+288224.156458  9108387.593597 
+288215.064796  9108367.492842 
+288210.971862  9108351.415716 
+Region 1
+67
+289012.041462  9107675.227521 
+288991.664358  9107606.897012 
+288975.387736  9107555.648039 
+288957.020536  9107490.333270 
+288951.882197  9107467.223357 
+288948.783024  9107451.147410 
+288931.056941  9107337.615518 
+288919.588071  9107264.271868 
+288910.356837  9107225.084903 
+288909.311547  9107218.052008 
+288904.187995  9107196.951165 
+288856.542357  9107204.935753 
+288843.284398  9107158.712619 
+288830.939498  9107101.440551 
+288827.766953  9107075.319118 
+288817.174714  9106985.903725 
+288804.254821  9106985.889667 
+288690.993981  9106990.788971 
+288671.552990  9106914.422819 
+288660.283039  9106868.201730 
+288628.524330  9106874.194273 
+288556.069678  9106887.174058 
+288550.113995  9106888.172080 
+288452.776634  9106896.101774 
+288371.325932  9106902.039635 
+288298.893066  9106918.032680 
+288256.267981  9106933.053896 
+288215.601209  9106944.059071 
+288184.850819  9106952.061520 
+288082.690458  9106980.075982 
+288064.889262  9106992.110825 
+288057.004490  9107001.142992 
+288014.650358  9107053.332377 
+287993.955522  9107077.418511 
+287969.219333  9107092.459289 
+287947.457334  9107106.498806 
+287921.734591  9107122.543016 
+287914.858268  9107133.585372 
+287912.001289  9107150.659434 
+287917.168355  9107177.787806 
+287948.820360  9107293.345209 
+287977.425071  9107399.858301 
+287995.812869  9107468.187467 
+287999.876250  9107480.246456 
+288024.403234  9107572.691368 
+288062.209838  9107714.373404 
+288066.302609  9107730.450574 
+288185.074040  9107663.276899 
+288212.784625  9107647.234674 
+288240.414481  9107620.142399 
+288298.927163  9107603.129384 
+288361.407858  9107585.116108 
+288546.883855  9107534.087302 
+288590.525181  9107522.080427 
+288627.260935  9107517.097764 
+288634.203199  9107515.096249 
+288643.133163  9107513.096897 
+288710.472537  9107480.020415 
+288732.711934  9107531.276045 
+288735.737570  9107537.306562 
+288751.911054  9107574.492044 
+288791.200389  9107646.861427 
+288810.340835  9107682.041009 
+288837.527709  9107730.288283 
+288893.014438  9107707.244014 
+288938.643453  9107695.238936 
+289012.041462  9107675.227521 
+Region 1
+40
+288654.286036  9106727.559736 
+288646.085781  9106693.396448 
+288641.934276  9106669.282973 
+288645.454493  9106607.005403 
+288651.831427  9106527.653794 
+288585.112807  9106509.499048 
+288352.102134  9106446.961650 
+288285.390987  9106429.810950 
+288267.465421  9106424.768476 
+288231.614297  9106414.683502 
+288197.765497  9106406.609791 
+288074.288975  9106373.323325 
+288048.576503  9106526.989803 
+288027.642658  9106654.543489 
+288013.028200  9106694.708999 
+287991.999039  9106809.203544 
+287977.589682  9106877.496475 
+287964.152166  9106942.776859 
+287948.807545  9107019.105102 
+287946.929765  9107034.171161 
+287946.038501  9107048.233770 
+287947.457334  9107106.498806 
+287969.219333  9107092.459289 
+287993.955522  9107077.418511 
+288014.650358  9107053.332377 
+288057.004490  9107001.142992 
+288064.889262  9106992.110825 
+288082.690458  9106980.075982 
+288184.850819  9106952.061520 
+288215.601209  9106944.059071 
+288256.267981  9106933.053896 
+288298.893066  9106918.032680 
+288371.325932  9106902.039635 
+288452.776634  9106896.101774 
+288550.113995  9106888.172080 
+288556.069678  9106887.174058 
+288628.524330  9106874.194273 
+288660.283039  9106868.201730 
+288685.099569  9106864.210668 
+288654.286036  9106727.559736 
+Region 1
+488
+285905.680824  9110744.691470 
+285836.873918  9110576.853278 
+285826.759389  9110552.732543 
+285778.138314  9110427.108247 
+285772.057967  9110411.028491 
+285643.407217  9110077.370270 
+285618.508094  9110070.309954 
+285407.759875  9110065.045893 
+285279.580068  9110069.921431 
+285205.057548  9110072.849329 
+284965.499588  9110069.559118 
+284847.222307  9110069.422110 
+284832.313401  9110069.404818 
+284698.118647  9110067.239836 
+284646.448936  9110069.188833 
+284626.989948  9109989.806022 
+284626.742770  9109955.650730 
+284606.289990  9109876.266728 
+284579.692084  9109771.761544 
+284558.223824  9109689.362609 
+284483.619086  9109405.989510 
+284463.203346  9109331.628146 
+284449.962941  9109287.411977 
+284418.309385  9109170.845841 
+284353.044197  9108941.729307 
+284292.553868  9108960.744752 
+284225.330999  9108873.268663 
+284154.865345  9108887.249335 
+284108.217088  9108896.235263 
+284109.174732  9108891.213584 
+284137.330736  9108798.827154 
+284143.098339  9108771.710796 
+284150.817480  9108739.573936 
+284162.512219  9108707.441777 
+284177.195898  9108676.317713 
+284194.817742  9108639.169750 
+284216.371638  9108595.999062 
+284239.942307  9108556.849002 
+284264.543104  9108522.722962 
+284325.526238  9108434.393547 
+283987.023492  9108216.002645 
+283354.863807  9107932.963540 
+281808.395172  9107240.931431 
+281758.550116  9107219.773389 
+281748.645655  9107363.415399 
+281738.669333  9107497.011567 
+281724.638380  9107619.552371 
+281720.179556  9107690.871708 
+281608.166309  9107593.288558 
+281438.148767  9107445.403718 
+281136.250457  9107200.912782 
+281130.308682  9107203.919047 
+281122.386314  9107207.927399 
+281118.518417  9107222.991222 
+281120.556418  9107230.025840 
+281128.586434  9107241.086309 
+281140.613524  9107255.165538 
+281141.664822  9107263.203492 
+281132.770091  9107270.224363 
+281117.890514  9107274.223971 
+281104.991530  9107277.221486 
+281095.110079  9107285.245690 
+281090.212406  9107295.285322 
+281082.261316  9107295.275319 
+281084.141455  9107280.208994 
+281083.090165  9107272.171036 
+281072.128721  9107268.138925 
+281065.157171  9107266.120991 
+281063.298550  9107284.201082 
+281066.330435  9107291.236954 
+281049.412844  9107288.201920 
+281041.425880  9107283.168966 
+281037.479034  9107287.182315 
+281031.587460  9107297.220692 
+281018.724328  9107305.241129 
+281004.845782  9107310.246545 
+280993.934546  9107313.246537 
+280978.025178  9107312.221907 
+280965.075952  9107308.187264 
+280960.084998  9107305.167231 
+280953.170824  9107311.185993 
+280959.184359  9107318.225636 
+280956.267253  9107327.263178 
+280947.365301  9107333.279434 
+280939.421371  9107334.273996 
+280927.444510  9107327.226828 
+280924.405468  9107319.186353 
+280920.401229  9107315.162980 
+280913.444016  9107315.154202 
+280908.445891  9107311.129573 
+280911.391694  9107306.110389 
+280912.335379  9107299.079518 
+280903.368878  9107296.054461 
+280889.504656  9107303.069023 
+280873.616798  9107305.058123 
+280862.684034  9107305.044316 
+280852.759498  9107307.040942 
+280846.846365  9107314.065536 
+280838.952623  9107322.092208 
+280828.055704  9107327.101343 
+280817.165951  9107333.115065 
+280807.241405  9107335.111682 
+280791.310509  9107331.073218 
+280779.362338  9107328.044365 
+280769.409114  9107326.022613 
+280762.480568  9107330.032173 
+280751.626645  9107341.068832 
+280746.771894  9107357.135988 
+280744.848632  9107366.174785 
+280735.010091  9107380.226473 
+280726.151099  9107392.270236 
+280718.285993  9107404.315257 
+280710.428052  9107417.364868 
+280700.610995  9107434.430324 
+280688.834820  9107455.511626 
+280667.141213  9107479.594112 
+280656.351739  9107499.672079 
+280642.580576  9107519.746268 
+280624.855326  9107542.829192 
+280616.032112  9107559.895902 
+280609.175182  9107573.951359 
+280590.441669  9107595.023836 
+280578.608082  9107608.068401 
+280566.810319  9107626.135921 
+280550.057394  9107646.206320 
+280542.242366  9107665.283470 
+280528.449616  9107682.343874 
+280522.600875  9107698.409771 
+280513.834925  9107723.513208 
+280503.989085  9107736.560288 
+280491.161541  9107749.603584 
+280468.366332  9107758.615897 
+280450.461806  9107756.584001 
+280443.497343  9107755.570575 
+280437.555435  9107758.576777 
+280424.656225  9107761.574142 
+280407.810065  9107768.584819 
+280390.906595  9107767.558756 
+280375.998088  9107767.539805 
+280357.113977  9107767.515793 
+280348.247653  9107778.554931 
+280335.441529  9107794.611973 
+280331.630647  9107817.712540 
+280329.857702  9107847.847782 
+280335.034920  9107876.987279 
+280335.271280  9107910.138825 
+280334.485092  9107939.270738 
+280329.680310  9107962.370042 
+280317.925349  9107986.465095 
+280315.108372  9108009.566928 
+280303.224471  9108015.579318 
+280285.291183  9108009.529010 
+280256.510864  9108015.519893 
+280247.673122  9108030.577399 
+280247.852157  9108055.692217 
+280251.055889  9108086.838385 
+280260.201599  9108114.978358 
+280257.391762  9108139.084788 
+280247.595907  9108159.163999 
+280232.801846  9108175.218516 
+280198.072270  9108183.210987 
+280183.149288  9108181.182820 
+280165.244573  9108179.150850 
+280133.317713  9108162.032241 
+280119.388646  9108160.005317 
+280101.498254  9108159.982505 
+280093.554127  9108160.976958 
+280079.782543  9108181.051080 
+280071.995894  9108204.146590 
+280070.093971  9108216.199178 
+280053.218938  9108219.191402 
+280035.307043  9108216.154788 
+280022.429127  9108222.165857 
+280017.559767  9108236.223827 
+280014.771278  9108263.344056 
+280009.987804  9108289.457154 
+279999.233682  9108314.558045 
+279993.441970  9108338.660687 
+279988.579755  9108353.723253 
+279973.749748  9108364.754751 
+279954.808091  9108356.693878 
+279927.800617  9108332.549324 
+279895.859371  9108313.421363 
+279882.881234  9108305.368079 
+279871.833696  9108289.280575 
+279849.803029  9108266.146907 
+279839.785196  9108255.083637 
+279825.748792  9108237.987702 
+279805.713155  9108215.861141 
+279793.721821  9108206.804498 
+279779.699755  9108191.717731 
+279756.725330  9108175.614886 
+279750.726097  9108170.584258 
+279747.722906  9108167.566646 
+279747.637095  9108155.511501 
+279747.536983  9108141.447164 
+279741.523455  9108134.407342 
+279722.646274  9108135.387698 
+279707.816239  9108146.419108 
+279698.034408  9108168.507451 
+279685.206482  9108181.550602 
+279675.260198  9108180.533239 
+279660.280004  9108170.468125 
+279649.268320  9108159.403518 
+279634.216656  9108139.292431 
+279623.176395  9108124.209430 
+279609.111520  9108103.095010 
+279600.059101  9108088.014556 
+279588.990279  9108068.913155 
+279554.060453  9108048.776433 
+279536.120031  9108041.721209 
+279513.238637  9108038.677958 
+279483.392719  9108034.621126 
+279463.485916  9108030.577096 
+279442.642350  9108034.568552 
+279419.796668  9108036.548238 
+279395.949927  9108037.522032 
+279369.071454  9108031.459777 
+279349.171791  9108028.420292 
+279328.256795  9108022.365718 
+279307.398924  9108024.347917 
+279293.526994  9108030.357503 
+279272.797628  9108050.422455 
+279252.096800  9108074.505796 
+279230.444871  9108104.615435 
+279207.806140  9108135.728382 
+279191.030936  9108152.784670 
+279162.307313  9108166.811702 
+279141.542138  9108181.853628 
+279117.730963  9108187.850290 
+279099.819051  9108184.813286 
+279074.899770  9108174.735049 
+279055.049977  9108178.727640 
+279029.336568  9108196.776871 
+279013.576586  9108216.848204 
+278999.854370  9108243.954316 
+278977.151195  9108266.025803 
+278959.446133  9108292.122145 
+278948.620023  9108307.176930 
+278924.901471  9108326.233313 
+278905.137184  9108342.281059 
+278884.400358  9108361.341307 
+278874.625192  9108384.434180 
+278861.896780  9108411.541574 
+278852.114464  9108433.629847 
+278832.414296  9108458.718983 
+278822.567771  9108471.765850 
+278796.839834  9108487.805808 
+278748.208803  9108497.788360 
+278705.519904  9108504.764839 
+278696.574570  9108504.753170 
+278691.512258  9108491.686870 
+278685.448894  9108477.614671 
+278669.546085  9108477.593915 
+278648.666518  9108476.562064 
+278625.763459  9108470.504597 
+278604.848255  9108464.449715 
+278584.955487  9108462.414529 
+278561.030005  9108452.337318 
+278549.060142  9108446.294105 
+278529.252884  9108456.314119 
+278518.469331  9108477.396458 
+278510.617673  9108491.450484 
+278489.930458  9108517.542824 
+278474.191486  9108540.627861 
+278456.429020  9108558.687279 
+278439.610599  9108569.715777 
+278424.737284  9108574.719259 
+278408.827295  9108573.693817 
+278393.896987  9108570.660466 
+278376.950331  9108563.606092 
+278359.960944  9108550.524090 
+278339.996903  9108538.442771 
+278323.057384  9108532.392974 
+278300.182780  9108530.353752 
+278265.494951  9108544.372506 
+278253.646118  9108555.407474 
+278240.803349  9108566.441134 
+278225.901519  9108567.426140 
+278216.970387  9108569.423587 
+278212.057690  9108577.453884 
+278215.146270  9108592.526863 
+278216.232753  9108605.588021 
+278210.404435  9108624.667655 
+278201.558722  9108638.720350 
+278194.985643  9108692.959817 
+278191.166539  9108715.055879 
+278189.335302  9108737.154553 
+278179.474276  9108748.192131 
+278164.586618  9108751.186340 
+278128.804975  9108751.139272 
+278111.013803  9108765.180190 
+278099.228939  9108785.256580 
+278083.496792  9108809.346155 
+278061.900653  9108847.492340 
+278057.059080  9108865.568680 
+278030.265465  9108871.560964 
+278012.331885  9108865.509762 
+277993.397253  9108858.452637 
+277976.486080  9108856.421150 
+277961.577012  9108856.401488 
+277953.675315  9108863.423237 
+277946.845818  9108881.496954 
+277937.999980  9108895.549628 
+277928.217117  9108917.637833 
+277915.402624  9108932.689866 
+277903.518032  9108938.701759 
+277887.622105  9108939.685373 
+277867.750415  9108940.663732 
+277851.847370  9108940.642728 
+277830.939058  9108935.592123 
+277814.993337  9108929.543469 
+277798.039455  9108921.484283 
+277784.074509  9108914.433638 
+277754.256303  9108914.394192 
+277739.389861  9108920.402100 
+277715.670381  9108939.458047 
+277712.724109  9108944.477133 
+279837.810353  9109930.729523 
+279985.911282  9110070.554778 
+280022.795080  9110085.670267 
+280064.619989  9110096.773639 
+280100.674783  9110134.993424 
+280131.881777  9110190.284955 
+280163.045826  9110239.548891 
+280161.481088  9110298.817317 
+280182.684164  9110345.054890 
+280209.779306  9110381.254043 
+280232.062546  9110439.547923 
+280236.440202  9110495.810062 
+280238.643393  9110525.950313 
+280279.962803  9110605.364328 
+280263.395554  9110651.554273 
+280243.031839  9110722.854003 
+280223.518517  9110774.063157 
+280154.866423  9110903.567910 
+280157.062473  9110932.703577 
+280128.517150  9110971.846368 
+280068.422918  9111047.114396 
+280021.214321  9111117.375722 
+279972.846622  9111164.530145 
+279934.275154  9111191.605229 
+279921.012177  9111283.005625 
+279942.072280  9111309.151381 
+279942.179886  9111324.220274 
+279949.209494  9111334.274979 
+279946.363855  9111353.358482 
+279944.691552  9111397.558058 
+279954.832268  9111425.699188 
+279950.106287  9111459.849077 
+279928.367770  9111477.904177 
+279953.389587  9111502.045730 
+279935.006106  9111572.343420 
+279975.074145  9111615.590991 
+280034.742098  9111619.684416 
+280045.776447  9111633.762458 
+280077.526618  9111625.765709 
+280092.623077  9111651.903834 
+280134.456716  9111664.011365 
+280173.136063  9111652.004917 
+280188.053052  9111653.028211 
+280209.935133  9111655.064816 
+280193.274335  9111688.195139 
+280193.468237  9111715.319103 
+280193.590325  9111732.397155 
+280268.053278  9111720.435465 
+280314.856932  9111732.549023 
+280335.996529  9111769.744978 
+280361.948025  9111784.846138 
+280381.806248  9111781.857207 
+280414.536013  9111771.852273 
+280426.011099  9111708.577999 
+280448.750619  9111691.528513 
+280475.494815  9111678.502340 
+280508.281980  9111676.534077 
+280531.699129  9111615.283867 
+280553.451763  9111599.237699 
+280561.324555  9111588.197128 
+280570.097869  9111564.098136 
+280578.849609  9111536.985377 
+280597.634622  9111522.944662 
+280607.466598  9111507.888210 
+280617.370466  9111502.877646 
+281032.191995  9111410.971279 
+281177.074965  9111377.999211 
+281294.176760  9111352.024563 
+281387.430193  9111327.024904 
+281433.203415  9111334.113188 
+281452.233055  9111354.228072 
+281460.379452  9111381.361612 
+281482.419885  9111405.498471 
+281521.329079  9111425.637697 
+281569.277816  9111458.847426 
+281672.162169  9111529.293516 
+281712.123219  9111557.470407 
+281699.446804  9111591.610445 
+281691.790767  9111632.788633 
+281693.109399  9111677.996077 
+281699.369087  9111719.191253 
+281718.528905  9111757.388441 
+281857.883404  9111923.312776 
+281969.180691  9111919.429670 
+281984.140997  9111926.479827 
+282000.088069  9111932.526603 
+282024.037575  9111945.615077 
+282041.987071  9111953.673405 
+282069.869184  9111960.739182 
+282102.685093  9111962.788053 
+282122.557537  9111961.807527 
+282146.391459  9111958.822640 
+282168.194047  9111949.807858 
+282185.984559  9111935.765363 
+282202.730486  9111914.689603 
+282209.551038  9111895.610992 
+282218.366776  9111877.539363 
+282228.176489  9111859.468934 
+282244.022354  9111851.451505 
+282258.903146  9111847.451191 
+282274.835742  9111851.488708 
+282278.818891  9111852.498087 
+282293.757509  9111856.534397 
+282306.729856  9111863.582041 
+282322.763675  9111881.683649 
+282343.789102  9111902.804976 
+282375.835118  9111935.994405 
+282959.854159  9112564.548310 
+283049.008197  9112660.087936 
+283065.913340  9112661.112541 
+283091.757173  9112661.143162 
+283105.680334  9112662.164220 
+283124.616974  9112669.218603 
+283151.520072  9112678.291534 
+283174.519736  9112697.405487 
+283196.481901  9112710.490804 
+283215.505621  9112729.600027 
+283229.617423  9112756.739960 
+283238.752012  9112782.869441 
+283253.879614  9112813.024252 
+283275.921678  9112837.159820 
+283285.963235  9112851.235572 
+283386.044739  9112808.157218 
+283438.530461  9112781.095748 
+283471.237884  9112768.074878 
+283502.958551  9112756.057394 
+283539.641899  9112743.041156 
+283604.983948  9112706.953561 
+283631.560238  9112670.820456 
+283638.242165  9112632.654894 
+283642.957899  9112597.500717 
+283652.636311  9112561.347797 
+283665.376573  9112536.248662 
+283686.155884  9112523.213706 
+283712.848254  9112503.153732 
+283743.487483  9112479.080120 
+283763.236430  9112461.021121 
+283800.593728  9112403.804794 
+283846.765993  9112328.516651 
+283852.642690  9112316.468780 
+283859.513367  9112304.422071 
+283904.669679  9112226.119040 
+283947.932379  9112160.873088 
+283955.796991  9112148.827537 
+283999.988122  9112074.541602 
+284042.198449  9112001.257905 
+284083.523724  9111943.041582 
+284128.933835  9111899.898420 
+284168.525450  9111876.839664 
+284200.201619  9111858.794469 
+284203.176257  9111857.793372 
+284280.422245  9111818.705409 
+284346.770805  9111784.627486 
+284364.604023  9111776.611720 
+284487.455678  9111721.503471 
+284593.365917  9111660.348015 
+284630.983650  9111639.295793 
+284649.788862  9111628.267390 
+284695.336386  9111604.210619 
+284756.721689  9111571.131068 
+284842.861186  9111525.020734 
+285019.115392  9111432.804266 
+285295.378790  9111288.464849 
+285424.103672  9111221.306705 
+285433.999395  9111215.290668 
+285458.753280  9111202.259693 
+285570.616988  9111140.104781 
+285963.620781  9110921.558100 
+285947.213732  9110852.225501 
+285905.680824  9110744.691470 
+Region 1
+223
+285851.711940  9112207.257580 
+285666.731389  9112192.985175 
+285672.347870  9111461.677304 
+285673.027855  9111418.482310 
+285674.752910  9111382.320370 
+285671.573925  9111355.193841 
+285665.354691  9111320.027438 
+285653.179076  9111285.858822 
+285636.004543  9111247.666309 
+285620.839839  9111212.489724 
+285613.685132  9111185.358659 
+285570.616988  9111140.104781 
+285458.753280  9111202.259693 
+285433.999395  9111215.290668 
+285424.103672  9111221.306705 
+285295.378790  9111288.464849 
+285019.115392  9111432.804266 
+284842.861186  9111525.020734 
+284756.721689  9111571.131068 
+284695.336386  9111604.210619 
+284649.788862  9111628.267390 
+284630.983650  9111639.295793 
+284593.365917  9111660.348015 
+284487.455678  9111721.503471 
+284364.604023  9111776.611720 
+284346.770805  9111784.627486 
+284280.422245  9111818.705409 
+284203.176257  9111857.793372 
+284200.201619  9111858.794469 
+284168.525450  9111876.839664 
+284128.933835  9111899.898420 
+284083.523724  9111943.041582 
+284042.198449  9112001.257905 
+283999.988122  9112074.541602 
+283955.796991  9112148.827537 
+283947.932379  9112160.873088 
+283904.669679  9112226.119040 
+283859.513367  9112304.422071 
+283852.642690  9112316.468780 
+283846.765993  9112328.516651 
+283800.593728  9112403.804794 
+283763.236430  9112461.021121 
+283743.487483  9112479.080120 
+283712.848254  9112503.153732 
+283686.155884  9112523.213706 
+283665.376573  9112536.248662 
+283652.636311  9112561.347797 
+283642.957899  9112597.500717 
+283638.242165  9112632.654894 
+283631.560238  9112670.820456 
+283604.983948  9112706.953561 
+283539.641899  9112743.041156 
+283502.958551  9112756.057394 
+283471.237884  9112768.074878 
+283438.530461  9112781.095748 
+283386.044739  9112808.157218 
+283285.963235  9112851.235572 
+283290.984017  9112858.273446 
+283347.460776  9112970.851231 
+283343.550108  9112979.887708 
+283344.594919  9112986.920889 
+283348.599952  9112990.943862 
+283360.469871  9112982.921318 
+283391.189464  9112969.898126 
+283412.056175  9112968.918103 
+283435.933921  9112971.959866 
+283455.842935  9112976.001516 
+283487.650883  9112976.038875 
+283515.562722  9112987.121838 
+283549.278767  9112976.111193 
+283588.900663  9112957.070943 
+283606.661855  9112939.009620 
+283633.463443  9112934.018201 
+283645.326015  9112924.991026 
+283680.108618  9112924.027179 
+283695.069423  9112931.076621 
+283717.967667  9112936.126215 
+283744.711087  9112923.098166 
+283757.582158  9112916.081272 
+283775.452272  9112913.088463 
+283790.391275  9112917.124160 
+283818.353985  9112935.238921 
+283829.295206  9112936.256251 
+283823.164044  9112913.144171 
+283835.998749  9112901.104406 
+283868.851463  9112908.174660 
+283905.701973  9112918.263232 
+283940.579047  9112930.358594 
+283967.475084  9112938.426393 
+283994.334763  9112941.471326 
+284017.225736  9112945.516189 
+284046.029760  9112942.535986 
+284073.839781  9112939.554610 
+284096.730750  9112943.599432 
+284112.649209  9112945.627029 
+284119.519860  9112933.580278 
+284149.281466  9112925.578323 
+284166.113867  9112916.556801 
+284182.924430  9112904.521569 
+284211.611951  9112885.468177 
+284224.439242  9112872.423760 
+284236.250700  9112856.364485 
+284243.143140  9112847.331430 
+284265.032784  9112850.370455 
+284276.967959  9112851.388830 
+284277.881885  9112840.339733 
+284275.733775  9112818.236936 
+284277.648971  9112808.193558 
+284295.468008  9112798.168587 
+284314.295584  9112790.153897 
+284333.159550  9112787.162039 
+284350.013692  9112781.154172 
+284360.867494  9112770.116569 
+284368.702922  9112754.052681 
+284376.596589  9112746.025332 
+284383.503545  9112739.001401 
+284400.335818  9112729.979819 
+284419.214307  9112728.997067 
+284436.126663  9112731.025713 
+284453.068146  9112737.072621 
+284454.983302  9112727.029245 
+284456.913022  9112718.995003 
+284470.850692  9112722.024762 
+284484.817494  9112729.072784 
+284514.637116  9112729.107170 
+284523.597569  9112731.126615 
+284536.563106  9112737.168906 
+284549.528647  9112743.211193 
+284567.493265  9112753.277464 
+284585.334046  9112746.266098 
+284597.218183  9112740.252430 
+284613.092835  9112736.252466 
+284630.970027  9112734.263916 
+284654.891287  9112743.332442 
+284675.852454  9112755.411224 
+284692.837682  9112767.485426 
+284715.743114  9112773.539074 
+284735.673877  9112780.593852 
+284752.680993  9112795.681721 
+284770.733134  9112817.802678 
+284789.735542  9112833.897372 
+284812.764950  9112857.028565 
+284824.838631  9112877.133525 
+284835.852712  9112888.196258 
+284844.915278  9112904.279536 
+284847.992038  9112917.342291 
+284850.067519  9112929.399343 
+284854.116399  9112939.449540 
+284876.057105  9112949.520201 
+284893.999979  9112956.572611 
+284902.989651  9112962.610224 
+284915.984460  9112972.670635 
+284934.877573  9112973.696775 
+284943.779722  9112967.679606 
+284946.696045  9112958.641934 
+284957.505932  9112941.576829 
+284969.433807  9112941.590447 
+284987.332913  9112942.615433 
+285014.134150  9112937.623233 
+285035.958136  9112931.620789 
+285047.834930  9112924.602441 
+285054.734480  9112916.573863 
+285049.676984  9112904.513434 
+285053.594567  9112896.481457 
+285070.433993  9112888.464209 
+285084.342525  9112887.475503 
+285095.407738  9112905.570101 
+285105.522756  9112929.690942 
+285122.522732  9112943.774065 
+285146.429551  9112950.833154 
+285170.321776  9112955.883102 
+285180.268963  9112956.898966 
+285203.152603  9112959.938640 
+285231.013486  9112963.988508 
+285244.892823  9112958.981498 
+285254.730494  9112944.928907 
+285269.603809  9112939.923019 
+285285.529520  9112942.954754 
+285302.478427  9112950.005859 
+285311.380505  9112943.988632 
+285315.290737  9112934.952081 
+285322.182929  9112925.918911 
+285337.107343  9112927.944939 
+285339.109923  9112929.956317 
+285356.000404  9112928.970905 
+285363.915785  9112923.957105 
+285370.837178  9112918.942179 
+285389.759447  9112923.986379 
+285409.697618  9112932.045380 
+285418.599674  9112926.028135 
+285416.524048  9112913.971145 
+285417.481513  9112908.949462 
+285423.343171  9112894.892350 
+285442.177772  9112887.881791 
+285454.134822  9112891.913531 
+285469.095747  9112898.962323 
+285483.004244  9112897.973496 
+285493.843112  9112884.926559 
+285508.716363  9112879.920604 
+285522.559092  9112869.890716 
+285529.451229  9112860.857527 
+285538.324025  9112850.822021 
+285546.210140  9112841.789954 
+285561.076061  9112835.779425 
+285569.035241  9112836.792964 
+285574.063620  9112844.835061 
+285578.024941  9112842.830427 
+285598.818220  9112831.803814 
+285610.672944  9112821.771665 
+285615.533239  9112806.708862 
+285609.225873  9112759.487783 
+285638.906477  9112740.434773 
+285668.682068  9112734.441034 
+285672.577595  9112723.395352 
+285686.252128  9112690.260548 
+285707.900410  9112660.148385 
+285723.635959  9112637.061420 
+285750.414905  9112629.055167 
+285770.374890  9112640.127705 
+285794.369288  9112659.241183 
+285823.289729  9112672.332873 
+285823.238546  9112665.300957 
+285851.711940  9112207.257580 
+Region 1
+97
+287656.442215  9110807.917560 
+287585.051200  9110695.330644 
+287513.579870  9110571.693461 
+287494.460533  9110539.527078 
+287477.336408  9110508.367416 
+287404.813162  9110376.692401 
+287301.053772  9110186.719093 
+287296.091520  9110187.718156 
+287170.377026  9110257.897260 
+287168.345220  9110251.867739 
+287147.099230  9110200.612396 
+287115.899481  9110147.336902 
+287082.704659  9110093.054607 
+287039.761206  9110064.879632 
+286989.904334  9110042.724190 
+286953.122153  9110041.678715 
+286866.636873  9110039.573267 
+286611.097992  9110025.223921 
+286274.028429  9110006.762967 
+286197.467505  9110002.658310 
+286194.500360  9110004.664057 
+286189.516158  9110002.649323 
+286164.595155  9109992.575642 
+286151.579265  9109979.501760 
+286148.539081  9109971.461915 
+286225.268907  9109725.433804 
+286182.479561  9109718.353536 
+286092.976338  9109711.220275 
+286074.077399  9109709.189738 
+285711.021860  9109670.603403 
+285740.257215  9110001.134745 
+285743.837180  9110083.512165 
+285743.866362  9110087.530410 
+285643.407217  9110077.370270 
+285772.057967  9110411.028491 
+285778.138314  9110427.108247 
+285826.759389  9110552.732543 
+285836.873918  9110576.853278 
+285905.680824  9110744.691470 
+285947.213732  9110852.225501 
+285963.620781  9110921.558100 
+285570.616988  9111140.104781 
+285613.685132  9111185.358659 
+285620.839839  9111212.489724 
+285636.004543  9111247.666309 
+285653.179076  9111285.858822 
+285665.354691  9111320.027438 
+285671.573925  9111355.193841 
+285674.752910  9111382.320370 
+285673.027855  9111418.482310 
+285672.347870  9111461.677304 
+285666.731389  9112192.985175 
+285851.711940  9112207.257580 
+285877.555124  9112207.286673 
+285922.364130  9112218.387142 
+285985.101147  9112234.530451 
+286083.102592  9112316.008953 
+286197.015230  9112398.509485 
+286315.971330  9112491.060736 
+286397.989721  9112561.470433 
+286403.355101  9112615.722005 
+286361.134166  9112686.997990 
+286339.742718  9112752.269847 
+286351.152553  9112817.578187 
+286453.334588  9112790.568879 
+286550.583206  9112768.576642 
+286685.764070  9112768.726167 
+286813.825649  9112746.767432 
+286873.390809  9112736.787571 
+286932.625773  9112681.602733 
+286927.061673  9112600.228434 
+286926.621526  9112539.955221 
+286947.098760  9112485.732300 
+286993.382435  9112426.515040 
+287070.390883  9112355.276975 
+287118.654864  9112295.057284 
+287144.860748  9112208.695216 
+287151.730416  9112196.648221 
+287188.037275  9112132.397215 
+287191.969079  9112126.374262 
+287279.491863  9111997.888565 
+287334.683568  9111933.658209 
+287359.319527  9111904.553411 
+287373.117412  9111888.495813 
+287497.415461  9111760.050160 
+287568.142512  9111645.609499 
+287611.907886  9111514.062190 
+287616.693980  9111488.953854 
+287627.216036  9111432.710964 
+287628.736333  9111232.808705 
+287629.598084  9111214.727884 
+287656.334090  9111065.080278 
+287668.777901  9110999.798623 
+287706.180128  9110949.612357 
+287740.637211  9110904.445575 
+287727.613304  9110890.367774 
+287656.442215  9110807.917560 
+Region 1
+85
+287191.847387  9108158.420797 
+287190.831565  9108155.406024 
+287127.982590  9107986.571926 
+287031.539773  9107708.204266 
+286962.458828  9107502.194345 
+286888.145875  9107533.251564 
+286798.932180  9107565.296401 
+286757.299553  9107580.317579 
+286713.679166  9107595.336476 
+286630.406429  9107624.374110 
+286543.136196  9107650.393430 
+286503.469190  9107662.402993 
+286324.894355  9107706.400061 
+286242.571115  9107729.410860 
+285940.894065  9107792.352410 
+285930.969928  9107794.350127 
+285649.314710  9108151.647318 
+285618.333389  9108265.126261 
+285598.980030  9108337.431880 
+285589.274209  9108369.566439 
+285603.210454  9108372.596159 
+285620.830929  9108335.447943 
+285634.519544  9108304.322525 
+285645.226494  9108273.193673 
+285659.952662  9108248.096775 
+285672.698336  9108224.002150 
+285688.418358  9108198.906393 
+285705.175948  9108179.839153 
+285721.955376  9108163.785597 
+285749.645617  9108144.730923 
+285778.351567  9108128.691066 
+285810.060986  9108115.668307 
+285846.754347  9108104.660357 
+285865.616174  9108101.668347 
+285984.317729  9108161.073006 
+286025.363422  9108338.925711 
+286040.774826  9108408.257412 
+286061.272423  9108493.667731 
+286076.654815  9108558.981150 
+286108.479349  9108698.650105 
+286108.501235  9108701.663784 
+286149.438951  9108864.447705 
+286154.561669  9108885.549107 
+286188.433100  9109033.256605 
+286226.265866  9109178.959406 
+286230.358284  9109195.036857 
+286262.140390  9109328.678092 
+286276.040428  9109326.684727 
+286293.053632  9109342.776787 
+286304.066908  9109353.839299 
+286317.141038  9109374.949640 
+286323.316287  9109404.088576 
+286337.369740  9109423.190911 
+286360.324519  9109436.275995 
+286393.203749  9109447.363167 
+286413.746959  9109402.181617 
+286442.621321  9109409.246039 
+286466.935476  9109335.941352 
+286545.607223  9109357.125527 
+286591.187624  9109201.471766 
+286734.711156  9109256.883231 
+286803.480349  9109283.078586 
+286800.447451  9109276.043354 
+286734.951873  9109153.415057 
+286808.185731  9109110.301669 
+286840.881878  9109096.274654 
+286870.779187  9109107.358169 
+286878.759607  9109111.385295 
+286892.564407  9109096.332543 
+286896.474147  9109087.295995 
+286950.713981  9109029.092961 
+286948.623769  9109015.026965 
+286982.218560  9108987.941772 
+286986.157543  9108982.923442 
+287055.107911  9108897.614033 
+287090.573231  9108854.458143 
+287149.540450  9108763.110252 
+287154.458645  9108756.083916 
+287080.924464  9108621.392614 
+287048.687547  9108425.469974 
+287047.671723  9108422.455196 
+287025.732410  9108275.766790 
+287269.905212  9108368.458009 
+287231.354824  9108260.928614 
+287191.847387  9108158.420797 
+Region 1
+72
+286393.203749  9109447.363167 
+286360.324519  9109436.275995 
+286337.369740  9109423.190911 
+286323.316287  9109404.088576 
+286317.141038  9109374.949640 
+286304.066908  9109353.839299 
+286293.053632  9109342.776787 
+286276.040428  9109326.684727 
+286262.140390  9109328.678092 
+286230.358284  9109195.036857 
+286226.265866  9109178.959406 
+286188.433100  9109033.256605 
+286154.561669  9108885.549107 
+286149.438951  9108864.447705 
+286108.501235  9108701.663784 
+286108.479349  9108698.650105 
+286076.654815  9108558.981150 
+286061.272423  9108493.667731 
+286040.774826  9108408.257412 
+286025.363422  9108338.925711 
+285984.317729  9108161.073006 
+285865.616174  9108101.668347 
+285846.754347  9108104.660357 
+285810.060986  9108115.668307 
+285778.351567  9108128.691066 
+285749.645617  9108144.730923 
+285721.955376  9108163.785597 
+285705.175948  9108179.839153 
+285688.418358  9108198.906393 
+285672.698336  9108224.002150 
+285659.952662  9108248.096775 
+285645.226494  9108273.193673 
+285634.519544  9108304.322525 
+285620.830929  9108335.447943 
+285603.210454  9108372.596159 
+285589.274209  9108369.566439 
+285573.692445  9108413.748882 
+285558.249020  9108477.018024 
+285534.970967  9108556.351014 
+285530.132592  9108574.427423 
+285525.279652  9108590.494705 
+285485.476720  9108721.040953 
+285472.847368  9108761.208590 
+285471.172700  9108804.402522 
+285468.489579  9108845.586182 
+285468.627942  9108864.672885 
+285468.904675  9108902.846290 
+285472.359752  9108968.146336 
+285469.815040  9109028.416696 
+285470.048109  9109060.562719 
+285471.165830  9109077.641437 
+285473.466836  9109120.839942 
+285473.911165  9109182.118293 
+285474.319093  9109238.373827 
+285476.598294  9109278.558636 
+285481.793662  9109309.705805 
+285492.879633  9109330.814195 
+285498.915933  9109340.866677 
+285507.897530  9109345.899769 
+285541.610231  9109334.888392 
+285627.905207  9109310.878100 
+285826.314402  9109259.872929 
+285852.474851  9109440.722280 
+285693.755747  9109482.732187 
+285711.021860  9109670.603403 
+286074.077399  9109709.189738 
+286092.976338  9109711.220275 
+286182.479561  9109718.353536 
+286225.268907  9109725.433804 
+286307.822851  9109460.325867 
+286326.699756  9109459.342654 
+286393.203749  9109447.363167 
+Region 1
+77
+285627.905207  9109310.878100 
+285541.610231  9109334.888392 
+285507.897530  9109345.899769 
+285498.915933  9109340.866677 
+285492.879633  9109330.814195 
+285481.793662  9109309.705805 
+285476.598294  9109278.558636 
+285474.319093  9109238.373827 
+285473.911165  9109182.118293 
+285473.466836  9109120.839942 
+285471.165830  9109077.641437 
+285470.048109  9109060.562719 
+285469.815040  9109028.416696 
+285472.359752  9108968.146336 
+285468.904675  9108902.846290 
+285468.627942  9108864.672885 
+285468.489579  9108845.586182 
+285471.172700  9108804.402522 
+285472.847368  9108761.208590 
+285485.476720  9108721.040953 
+285525.279652  9108590.494705 
+285496.500505  9108596.488856 
+285415.161571  9108618.495205 
+284843.907101  9108787.602242 
+284608.883132  9108860.660297 
+284574.161932  9108869.660648 
+284555.886813  9108816.397552 
+284532.576904  9108754.087489 
+284518.451753  9108724.938666 
+284470.229190  9108653.558235 
+284430.995409  9108588.215655 
+284386.770512  9108519.853450 
+284367.581759  9108477.639276 
+284331.518619  9108438.418862 
+284325.526238  9108434.393547 
+284264.543104  9108522.722962 
+284239.942307  9108556.849002 
+284216.371638  9108595.999062 
+284194.817742  9108639.169750 
+284177.195898  9108676.317713 
+284162.512219  9108707.441777 
+284150.817480  9108739.573936 
+284143.098339  9108771.710796 
+284137.330736  9108798.827154 
+284109.174732  9108891.213584 
+284108.217088  9108896.235263 
+284154.865345  9108887.249335 
+284225.330999  9108873.268663 
+284292.553868  9108960.744752 
+284353.044197  9108941.729307 
+284418.309385  9109170.845841 
+284449.962941  9109287.411977 
+284463.203346  9109331.628146 
+284483.619086  9109405.989510 
+284558.223824  9109689.362609 
+284579.692084  9109771.761544 
+284606.289990  9109876.266728 
+284626.742770  9109955.650730 
+284626.989948  9109989.806022 
+284646.448936  9110069.188833 
+284698.118647  9110067.239836 
+284832.313401  9110069.404818 
+284847.222307  9110069.422110 
+284965.499588  9110069.559118 
+285205.057548  9110072.849329 
+285279.580068  9110069.921431 
+285407.759875  9110065.045893 
+285618.508094  9110070.309954 
+285643.407217  9110077.370270 
+285743.866362  9110087.530410 
+285743.837180  9110083.512165 
+285740.257215  9110001.134745 
+285711.021860  9109670.603403 
+285693.755747  9109482.732187 
+285852.474851  9109440.722280 
+285826.314402  9109259.872929 
+285627.905207  9109310.878100 
+Region 1
+203
+290466.514862  9105983.138244 
+290473.301828  9105960.041231 
+290225.607957  9105927.633892 
+290219.637743  9105926.623019 
+290089.286864  9105904.384670 
+290001.780240  9105897.259644 
+289940.237814  9105907.239248 
+289933.288522  9105908.236354 
+289858.833895  9105919.206586 
+289818.212895  9105936.240155 
+289806.323995  9105941.250085 
+289783.532632  9105950.266462 
+289764.731221  9105961.296175 
+289723.999719  9105963.261552 
+289568.273065  9106004.280090 
+289493.884254  9106024.290659 
+289471.939456  9106013.217116 
+289446.004706  9106000.130184 
+289429.993386  9105985.044876 
+289413.982077  9105969.959561 
+289395.990507  9105955.876632 
+289376.961020  9105935.765359 
+289361.862680  9105909.631112 
+289347.692004  9105874.457037 
+289338.541866  9105846.320137 
+289324.407993  9105816.168764 
+289322.390971  9105812.148437 
+289308.293877  9105787.019773 
+289297.266428  9105773.948859 
+289263.109471  9105723.685027 
+289259.082798  9105716.648906 
+289254.062318  9105709.611706 
+289249.027143  9105700.565417 
+289231.934019  9105673.424386 
+289215.842071  9105647.288967 
+289207.781411  9105632.212165 
+289198.719604  9105616.129735 
+289183.599467  9105586.981741 
+289170.511038  9105563.863166 
+289168.494045  9105559.842826 
+289157.400588  9105537.730950 
+289141.294055  9105509.586392 
+289125.246303  9105489.478182 
+289105.201322  9105466.351998 
+289087.217404  9105453.273418 
+289066.259432  9105441.196122 
+289047.347815  9105437.157347 
+289015.480058  9105428.081733 
+288983.641674  9105423.024276 
+288959.768393  9105419.984578 
+288934.798549  9105402.880134 
+288900.994592  9105400.834077 
+288877.158012  9105402.817063 
+288862.199605  9105395.768914 
+288847.292568  9105395.752585 
+288832.385529  9105395.736251 
+288815.461535  9105391.699546 
+288791.588261  9105388.659751 
+288780.663768  9105389.652306 
+288742.943274  9105395.638142 
+288720.056462  9105391.594853 
+288712.084032  9105388.572477 
+288709.278661  9105412.678337 
+288689.703310  9105453.842940 
+288686.014149  9105493.015920 
+288686.608299  9105574.384256 
+288674.018889  9105619.574698 
+288644.622724  9105676.801154 
+288598.449055  9105750.081800 
+288581.715606  9105772.163277 
+288573.838448  9105782.200014 
+288535.255754  9105806.266530 
+288431.227903  9105850.351725 
+288259.693557  9105904.407526 
+288216.068185  9105918.422839 
+288157.733299  9105959.544450 
+288124.097289  9105980.602554 
+288108.159556  9105975.562172 
+288056.319829  9105953.404719 
+288035.398367  9105946.349689 
+288022.515333  9105951.358090 
+288017.560883  9105953.361671 
+288011.656547  9105961.391451 
+288008.740991  9105970.429096 
+288012.789496  9105980.479021 
+288018.796352  9105986.512950 
+288038.899774  9106017.676096 
+288043.080118  9106045.807927 
+288037.190427  9106055.846814 
+288024.322011  9106062.864324 
+288008.442834  9106065.860317 
+287996.487681  9106061.828866 
+287969.427507  9106030.657965 
+287933.357098  9105990.436126 
+287920.203173  9105958.276106 
+287903.125234  9105933.143510 
+287869.232903  9105919.042141 
+287844.416694  9105923.032648 
+287808.683096  9105929.020049 
+287785.883777  9105937.030953 
+287763.128349  9105951.069160 
+287784.166881  9105974.197160 
+287809.217311  9106002.352338 
+287837.190688  9106022.474405 
+287893.144830  9106063.723019 
+287974.010543  9106114.040114 
+288051.880296  9106162.344612 
+288109.785795  9106198.572320 
+288099.220027  9106248.787719 
+288082.867114  9106323.105720 
+288080.024830  9106342.188872 
+288074.288975  9106373.323325 
+288197.765497  9106406.609791 
+288231.614297  9106414.683502 
+288267.465421  9106424.768476 
+288285.390987  9106429.810950 
+288352.102134  9106446.961650 
+288585.112807  9106509.499048 
+288651.831427  9106527.653794 
+288645.454493  9106607.005403 
+288641.934276  9106669.282973 
+288646.085781  9106693.396448 
+288654.286036  9106727.559736 
+288685.099569  9106864.210668 
+288660.283039  9106868.201730 
+288671.552990  9106914.422819 
+288690.993981  9106990.788971 
+288804.254821  9106985.889667 
+288817.174714  9106985.903725 
+288827.766953  9107075.319118 
+288830.939498  9107101.440551 
+288843.284398  9107158.712619 
+288856.542357  9107204.935753 
+288904.187995  9107196.951165 
+288909.311547  9107218.052008 
+288910.356837  9107225.084903 
+288919.588071  9107264.271868 
+288931.056941  9107337.615518 
+288948.783024  9107451.147410 
+288951.882197  9107467.223357 
+288957.020536  9107490.333270 
+288975.387736  9107555.648039 
+288991.664358  9107606.897012 
+289012.041462  9107675.227521 
+289049.741639  9107666.227391 
+289080.639311  9107678.315159 
+289085.623282  9107680.329606 
+289086.786327  9107703.435193 
+289141.359361  9107827.051912 
+289147.440224  9107843.131029 
+289239.971619  9108128.518522 
+289245.920059  9108126.515831 
+289349.156358  9108109.549331 
+289551.137326  9108005.293537 
+289571.927255  9107994.265830 
+289576.881798  9107992.262043 
+289665.231779  9107978.292651 
+289679.131011  9107976.298369 
+289701.960193  9107972.304512 
+289721.763573  9107962.280232 
+289731.606282  9107949.231765 
+289756.106132  9107902.044758 
+289777.690738  9107863.895445 
+289803.294954  9107831.777592 
+289822.023289  9107810.702290 
+289844.749128  9107792.644823 
+289885.297873  9107765.565456 
+289918.941249  9107745.510471 
+290008.997871  9107693.370157 
+290200.365359  9107903.518995 
+290228.429436  9107935.693483 
+290263.273303  9107943.766349 
+290324.574522  9107900.635945 
+290378.386896  9107785.171516 
+290412.853942  9107742.012902 
+290451.569618  9107736.026303 
+290469.525328  9107745.085871 
+290431.013170  9107643.588080 
+290390.794163  9107580.260537 
+290385.773258  9107573.223560 
+290341.497811  9107498.841853 
+290310.186739  9107430.500892 
+290288.976555  9107384.270184 
+290261.788634  9107336.024096 
+290232.568829  9107281.748650 
+290181.115820  9107177.223155 
+290128.809407  9107091.782725 
+290117.552708  9107047.571445 
+290104.205128  9106989.294504 
+290114.421900  9106891.865803 
+290138.692372  9106813.538088 
+290145.501665  9106793.454681 
+290198.467600  9106698.080332 
+290252.508304  9106613.756944 
+290265.199323  9106582.629922 
+290307.100042  9106469.162297 
+290328.639464  9106424.985737 
+290361.942347  9106358.721946 
+290415.893910  9106262.344063 
+290446.692504  9106125.760533 
+290471.660961  9106007.252394 
+290469.533171  9105988.164082 
+290466.514862  9105983.138244 
+Region 1
+152
+288687.165610  9105378.499701 
+288664.315474  9105379.479117 
+288629.554361  9105382.454495 
+288591.716507  9105372.367441 
+288568.866360  9105373.346808 
+288538.949620  9105359.250272 
+288494.738505  9105292.901835 
+288450.520207  9105225.548774 
+288439.383218  9105197.409322 
+288429.108154  9105151.189082 
+288427.564827  9105075.846811 
+288433.073353  9105013.571374 
+288430.594896  9104946.264391 
+288430.506982  9104934.209802 
+288411.302562  9104889.988729 
+288401.196148  9104866.873085 
+288383.994033  9104824.663286 
+288383.217677  9104718.181054 
+288378.986190  9104683.017414 
+288064.832768  9104803.212836 
+287858.847572  9104902.432314 
+287746.950591  9104957.556778 
+287773.951319  9104980.691596 
+287715.427297  9105132.312155 
+287652.774238  9105262.832643 
+287627.812523  9105383.350006 
+287592.832218  9105492.806135 
+287538.362957  9105655.481280 
+287524.756565  9105697.656899 
+287522.798173  9105701.672881 
+287483.900739  9105819.160995 
+287473.202642  9105851.294430 
+287429.372238  9105837.181513 
+287393.360965  9105941.613774 
+287452.120741  9105958.757120 
+287581.588186  9105996.070575 
+287589.553392  9105998.088589 
+287650.308220  9106016.238420 
+287634.553348  9106036.311681 
+287612.791635  9106050.350947 
+287571.219246  9106073.408917 
+287549.428240  9106083.429947 
+287515.769820  9106101.474023 
+287460.495781  9106153.648367 
+287426.961545  9106188.769812 
+287417.213345  9106214.877052 
+287408.510140  9106248.017286 
+287406.880710  9106297.238197 
+287407.998827  9106314.316730 
+287398.250605  9106340.423974 
+287372.615689  9106368.522467 
+287364.745448  9106379.563631 
+287352.994908  9106403.659532 
+287347.163496  9106421.734808 
+287336.326362  9106434.781729 
+287318.525075  9106446.816275 
+287303.676042  9106454.835951 
+287293.788866  9106461.856657 
+287276.075263  9106485.945846 
+287271.179178  9106495.985803 
+287248.394052  9106506.005632 
+287219.580127  9106506.977745 
+287181.850901  9106511.957982 
+287170.940624  9106514.959328 
+287138.129416  9106512.913244 
+287109.242412  9106503.839733 
+287087.378013  9106503.815056 
+287066.595103  9106515.846158 
+287044.862168  9106533.903466 
+287004.246296  9106551.939424 
+286993.350594  9106556.949844 
+286980.430700  9106556.935234 
+286966.516966  9106556.919495 
+286951.543672  9106547.861621 
+286938.594570  9106543.828772 
+286910.876622  9106558.865610 
+286895.033613  9106566.884052 
+286882.128310  9106568.878527 
+286873.183760  9106568.868391 
+286855.323858  9106572.866340 
+286840.467370  9106579.881335 
+286830.572774  9106585.897406 
+286822.695053  9106595.933957 
+286816.812309  9106606.977320 
+286811.886905  9106612.999025 
+286803.987277  9106620.021904 
+287092.449000  9106791.121290 
+287140.986567  9106905.694325 
+287215.444514  9106894.728060 
+287242.249066  9106890.739995 
+287301.784648  9106877.747740 
+287488.393021  9106845.811315 
+287563.785951  9106826.809206 
+287645.134509  9106806.809081 
+287716.566532  9106789.811418 
+287767.157149  9106776.808650 
+287879.189909  9106739.765037 
+288013.028200  9106694.708999 
+288027.642658  9106654.543489 
+288048.576503  9106526.989803 
+288074.288975  9106373.323325 
+288080.024830  9106342.188872 
+288082.867114  9106323.105720 
+288099.220027  9106248.787719 
+288109.785795  9106198.572320 
+288051.880296  9106162.344612 
+287974.010543  9106114.040114 
+287893.144830  9106063.723019 
+287837.190688  9106022.474405 
+287809.217311  9106002.352338 
+287784.166881  9105974.197160 
+287763.128349  9105951.069160 
+287785.883777  9105937.030953 
+287808.683096  9105929.020049 
+287844.416694  9105923.032648 
+287869.232903  9105919.042141 
+287903.125234  9105933.143510 
+287920.203173  9105958.276106 
+287933.357098  9105990.436126 
+287969.427507  9106030.657965 
+287996.487681  9106061.828866 
+288008.442834  9106065.860317 
+288024.322011  9106062.864324 
+288037.190427  9106055.846814 
+288043.080118  9106045.807927 
+288038.899774  9106017.676096 
+288018.796352  9105986.512950 
+288012.789496  9105980.479021 
+288008.740991  9105970.429096 
+288011.656547  9105961.391451 
+288017.560883  9105953.361671 
+288022.515333  9105951.358090 
+288035.398367  9105946.349689 
+288056.319829  9105953.404719 
+288108.159556  9105975.562172 
+288124.097289  9105980.602554 
+288157.733299  9105959.544450 
+288216.068185  9105918.422839 
+288259.693557  9105904.407526 
+288431.227903  9105850.351725 
+288535.255754  9105806.266530 
+288573.838448  9105782.200014 
+288581.715606  9105772.163277 
+288598.449055  9105750.081800 
+288644.622724  9105676.801154 
+288674.018889  9105619.574698 
+288686.608299  9105574.384256 
+288686.014149  9105493.015920 
+288689.703310  9105453.842940 
+288709.278661  9105412.678337 
+288712.084032  9105388.572477 
+288687.165610  9105378.499701 
+Region 1
+111
+287725.167435  9104968.582315 
+287567.708676  9105044.750696 
+287406.295978  9105123.927823 
+287301.325116  9105175.041064 
+287296.728502  9105226.267752 
+287291.123478  9105275.484206 
+287283.574652  9105330.725744 
+287276.939304  9105374.918301 
+287275.002803  9105381.947940 
+287261.447283  9105431.155409 
+287255.645072  9105453.248880 
+287247.877141  9105478.353769 
+287244.946821  9105485.382285 
+287234.146323  9105503.451916 
+287229.257583  9105514.496404 
+287217.455958  9105531.560356 
+287207.663860  9105551.640221 
+287196.899846  9105574.732628 
+287169.357781  9105613.878803 
+287156.562295  9105630.941625 
+287153.588147  9105631.942805 
+287142.707272  9105638.962318 
+287112.081461  9105664.041321 
+287091.386498  9105688.127018 
+287067.037444  9105756.408670 
+287031.858499  9105838.741719 
+286931.270825  9105809.495669 
+286793.831588  9105769.157351 
+286783.227785  9105814.349986 
+286774.626208  9105861.554002 
+286759.359625  9105948.932400 
+286755.566683  9105974.041812 
+286754.915706  9106021.254889 
+286744.479648  9106089.552359 
+286734.145714  9106171.913639 
+286721.940842  9106270.345583 
+286714.486271  9106338.646457 
+286710.656845  9106358.733086 
+286787.386468  9106386.947715 
+286853.169369  9106413.140673 
+286843.457284  9106444.270661 
+286826.934312  9106495.483896 
+286802.482502  9106549.701780 
+286777.964958  9106594.878648 
+286773.046847  9106601.904907 
+286803.987277  9106620.021904 
+286811.886905  9106612.999025 
+286816.812309  9106606.977320 
+286822.695053  9106595.933957 
+286830.572774  9106585.897406 
+286840.467370  9106579.881335 
+286855.323858  9106572.866340 
+286873.183760  9106568.868391 
+286882.128310  9106568.878527 
+286895.033613  9106566.884052 
+286910.876622  9106558.865610 
+286938.594570  9106543.828772 
+286951.543672  9106547.861621 
+286966.516966  9106556.919495 
+286980.430700  9106556.935234 
+286993.350594  9106556.949844 
+287004.246296  9106551.939424 
+287044.862168  9106533.903466 
+287066.595103  9106515.846158 
+287087.378013  9106503.815056 
+287109.242412  9106503.839733 
+287138.129416  9106512.913244 
+287170.940624  9106514.959328 
+287181.850901  9106511.957982 
+287219.580127  9106506.977745 
+287248.394052  9106506.005632 
+287271.179178  9106495.985803 
+287276.075263  9106485.945846 
+287293.788866  9106461.856657 
+287303.676042  9106454.835951 
+287318.525075  9106446.816275 
+287336.326362  9106434.781729 
+287347.163496  9106421.734808 
+287352.994908  9106403.659532 
+287364.745448  9106379.563631 
+287372.615689  9106368.522467 
+287398.250605  9106340.423974 
+287407.998827  9106314.316730 
+287406.880710  9106297.238197 
+287408.510140  9106248.017286 
+287417.213345  9106214.877052 
+287426.961545  9106188.769812 
+287460.495781  9106153.648367 
+287515.769820  9106101.474023 
+287549.428240  9106083.429947 
+287571.219246  9106073.408917 
+287612.791635  9106050.350947 
+287634.553348  9106036.311681 
+287650.308220  9106016.238420 
+287589.553392  9105998.088589 
+287581.588186  9105996.070575 
+287452.120741  9105958.757120 
+287393.360965  9105941.613774 
+287429.372238  9105837.181513 
+287473.202642  9105851.294430 
+287483.900739  9105819.160995 
+287522.798173  9105701.672881 
+287524.756565  9105697.656899 
+287538.362957  9105655.481280 
+287592.832218  9105492.806135 
+287627.812523  9105383.350006 
+287652.774238  9105262.832643 
+287715.427297  9105132.312155 
+287773.951319  9104980.691596 
+287746.950591  9104957.556778 
+287725.167435  9104968.582315 
+Region 1
+166
+288378.986190  9104683.017414 
+288374.747394  9104646.849222 
+288364.465335  9104599.624362 
+288355.286930  9104567.468841 
+288355.264963  9104564.455192 
+288342.162687  9104539.327096 
+288316.133892  9104513.180078 
+288277.207878  9104490.032310 
+288212.487394  9104472.883008 
+288160.649563  9104450.725266 
+288148.665604  9104442.675551 
+288117.704622  9104421.545585 
+288091.610172  9104386.357428 
+288042.080948  9104271.784112 
+287976.498020  9104136.097257 
+287956.359243  9104099.911088 
+287922.146799  9104041.609129 
+287880.992640  9103985.308404 
+287834.898944  9103933.020232 
+287824.902734  9103924.972620 
+287782.937685  9103893.784455 
+287715.229508  9103875.626271 
+287655.610312  9103876.563478 
+287637.773475  9103883.575136 
+287585.117974  9103885.524670 
+287550.335821  9103885.485295 
+287491.703033  9103885.418859 
+287449.964427  9103885.371519 
+287445.302071  9103927.557185 
+287435.933569  9104005.901191 
+287434.983582  9104011.927393 
+287431.271215  9104048.086860 
+287430.372318  9104061.144947 
+287422.881899  9104124.422888 
+287421.011118  9104140.493513 
+287410.714529  9104227.877394 
+287401.367930  9104309.235076 
+287390.143254  9104405.658833 
+287389.251664  9104419.721476 
+287379.839369  9104492.038171 
+287368.592795  9104585.448272 
+287366.743917  9104604.532565 
+287282.710627  9104528.091715 
+287158.670680  9104416.445945 
+287143.661713  9104402.365185 
+287109.170822  9104442.507820 
+287073.146399  9104408.312119 
+286915.012321  9104254.435487 
+286894.295830  9104275.507305 
+286822.346792  9104357.797943 
+286798.670698  9104381.879995 
+286797.786205  9104396.947228 
+286751.078010  9104396.893653 
+286751.558866  9104463.194508 
+286754.726848  9104625.935238 
+286728.895422  9104626.910171 
+286727.748615  9104605.813304 
+286725.887810  9104486.269704 
+286719.065423  9104367.724948 
+286717.328635  9104265.258825 
+286718.162177  9104243.159676 
+286717.608618  9104166.813214 
+286714.936432  9104072.382407 
+286711.481711  9104007.082655 
+286708.034304  9103942.787458 
+286704.317519  9103841.323575 
+286701.543620  9103732.828915 
+286699.301249  9103697.667059 
+286695.941353  9103645.426551 
+286681.056565  9103648.423042 
+286608.525512  9103650.348451 
+286543.981017  9103657.305736 
+286494.277649  9103655.239143 
+286462.462252  9103653.193210 
+286423.719510  9103655.157436 
+286409.843003  9103660.164115 
+286383.120119  9103675.201418 
+286340.802209  9103732.411823 
+286312.440758  9103795.665727 
+286295.822825  9103833.819443 
+286241.935584  9103940.239483 
+286233.144226  9103961.324886 
+286224.367404  9103984.419412 
+286205.587279  9103998.461339 
+286190.709578  9104002.462264 
+286187.735491  9104003.463361 
+286167.309481  9104064.717371 
+286165.569107  9104098.870161 
+286164.924319  9104147.087971 
+286169.401191  9104216.407348 
+286168.242590  9104330.925070 
+286165.515734  9104366.081267 
+286155.795957  9104396.206580 
+286147.004518  9104417.291993 
+286136.218209  9104437.370536 
+286139.425032  9104468.515412 
+286148.594647  9104499.667206 
+286167.673163  9104526.812276 
+286185.779727  9104556.969864 
+286189.885849  9104575.056578 
+286201.021312  9104603.196965 
+286210.169193  9104631.335044 
+286219.280714  9104654.450312 
+286232.440204  9104687.615788 
+286286.607544  9104756.992574 
+286309.676043  9104786.151250 
+286337.815489  9104829.379492 
+286379.992012  9104889.701274 
+286435.109974  9104953.051548 
+286437.447110  9105001.272710 
+286438.477327  9105006.296654 
+286467.334131  9105011.352624 
+286493.209518  9105016.405145 
+286505.171614  9105021.441655 
+286544.090328  9105043.586503 
+286581.021460  9105065.729027 
+286592.033483  9105076.791722 
+286544.986371  9105167.147287 
+286536.129505  9105179.191728 
+286532.212546  9105187.223637 
+286502.497154  9105337.872157 
+286500.677089  9105360.974740 
+286478.562448  9105463.413555 
+286457.361439  9105554.803364 
+286440.969208  9105624.098575 
+286443.219134  9105660.264999 
+286507.955954  9105679.425717 
+286525.866599  9105682.459894 
+286546.758707  9105685.497478 
+286618.488773  9105709.688776 
+286635.405605  9105712.721768 
+286647.346041  9105714.744517 
+286736.979543  9105740.965155 
+286796.740110  9105759.115173 
+286793.831588  9105769.157351 
+286931.270825  9105809.495669 
+287031.858499  9105838.741719 
+287067.037444  9105756.408670 
+287091.386498  9105688.127018 
+287112.081461  9105664.041321 
+287142.707272  9105638.962318 
+287153.588147  9105631.942805 
+287156.562295  9105630.941625 
+287169.357781  9105613.878803 
+287196.899846  9105574.732628 
+287207.663860  9105551.640221 
+287217.455958  9105531.560356 
+287229.257583  9105514.496404 
+287234.146323  9105503.451916 
+287244.946821  9105485.382285 
+287247.877141  9105478.353769 
+287255.645072  9105453.248880 
+287261.447283  9105431.155409 
+287275.002803  9105381.947940 
+287276.939304  9105374.918301 
+287283.574652  9105330.725744 
+287291.123478  9105275.484206 
+287296.728502  9105226.267752 
+287301.325116  9105175.041064 
+287406.295978  9105123.927823 
+287567.708676  9105044.750696 
+287725.167435  9104968.582315 
+287746.950591  9104957.556778 
+287858.847572  9104902.432314 
+288064.832768  9104803.212836 
+288378.986190  9104683.017414 
+Region 1
+68
+287422.138685  9103885.339937 
+287399.311010  9103889.332203 
+287361.532896  9103887.280185 
+287340.641691  9103884.242793 
+287281.695183  9103840.980183 
+287249.784936  9103825.875622 
+287232.817810  9103815.810808 
+287215.865275  9103807.755098 
+287204.889986  9103801.715294 
+287189.895844  9103789.643613 
+287172.899576  9103775.560544 
+287126.967190  9103745.371641 
+287106.975053  9103729.276018 
+287073.011774  9103705.128012 
+287043.067354  9103687.011865 
+287005.158189  9103666.877470 
+286973.262698  9103653.781775 
+286953.321648  9103644.717963 
+286934.396234  9103638.668954 
+286912.511357  9103635.630188 
+286839.965859  9103635.546848 
+286801.230510  9103638.515951 
+286765.432784  9103635.461102 
+286728.684964  9103638.432432 
+286707.852094  9103643.431179 
+286695.941353  9103645.426551 
+286699.301249  9103697.667059 
+286701.543620  9103732.828915 
+286704.317519  9103841.323575 
+286708.034304  9103942.787458 
+286711.481711  9104007.082655 
+286714.936432  9104072.382407 
+286717.608618  9104166.813214 
+286718.162177  9104243.159676 
+286717.328635  9104265.258825 
+286719.065423  9104367.724948 
+286725.887810  9104486.269704 
+286727.748615  9104605.813304 
+286728.895422  9104626.910171 
+286754.726848  9104625.935238 
+286751.558866  9104463.194508 
+286751.078010  9104396.893653 
+286797.786205  9104396.947228 
+286798.670698  9104381.879995 
+286822.346792  9104357.797943 
+286894.295830  9104275.507305 
+286915.012321  9104254.435487 
+287073.146399  9104408.312119 
+287109.170822  9104442.507820 
+287143.661713  9104402.365185 
+287158.670680  9104416.445945 
+287282.710627  9104528.091715 
+287366.743917  9104604.532565 
+287368.592795  9104585.448272 
+287379.839369  9104492.038171 
+287389.251664  9104419.721476 
+287390.143254  9104405.658833 
+287401.367930  9104309.235076 
+287410.714529  9104227.877394 
+287421.011118  9104140.493513 
+287422.881899  9104124.422888 
+287430.372318  9104061.144947 
+287431.271215  9104048.086860 
+287434.983582  9104011.927393 
+287435.933569  9104005.901191 
+287445.302071  9103927.557185 
+287449.964427  9103885.371519 
+287422.138685  9103885.339937 
+Region 1
+296
+286507.928982  9107455.470770 
+286307.455525  9107357.800981 
+286308.376460  9107347.756522 
+286308.259783  9107331.683571 
+286310.145408  9107317.622008 
+286313.996873  9107300.549038 
+286319.785006  9107276.446421 
+286360.051826  9107210.192025 
+286456.421148  9107068.660304 
+286551.796076  9106927.127381 
+286560.638574  9106913.073748 
+286537.838424  9106921.084186 
+286518.977186  9106924.076352 
+286493.159000  9106927.060580 
+286461.348540  9106926.019758 
+286435.493878  9106923.981160 
+286413.600027  9106919.937967 
+286359.822799  9106904.808273 
+286315.991373  9106890.694436 
+286267.154277  9106871.552061 
+286202.422919  9106853.395950 
+286153.687890  9106848.317277 
+286113.926643  9106847.267067 
+286083.102748  9106845.222543 
+286048.339871  9106848.196230 
+285926.125465  9106852.073708 
+285885.392160  9106854.035835 
+285814.857875  9106857.972615 
+285666.817672  9106863.828664 
+285642.921576  9106857.773643 
+285622.993617  9106850.718654 
+285607.055617  9106845.677394 
+285595.107574  9106842.649867 
+285578.153907  9106834.593750 
+285568.179024  9106829.559395 
+285557.210292  9106824.523882 
+285548.236538  9106820.495239 
+285486.632272  9106822.432758 
+285483.279902  9106771.196516 
+285436.350820  9106741.005224 
+285385.431858  9106708.800104 
+285377.871683  9106625.413111 
+285375.687767  9106598.287541 
+285310.130144  9106603.233805 
+285251.522158  9106607.183546 
+285175.996923  9106608.099736 
+285145.136770  9106601.031689 
+285131.179314  9106594.987987 
+285115.205118  9106584.923686 
+285094.196337  9106565.812450 
+285069.284783  9106556.742201 
+285054.369798  9106555.720138 
+285040.477699  9106558.717503 
+285006.715882  9106562.696082 
+285001.724862  9106559.676543 
+284962.725250  9106526.480265 
+284903.725384  9106476.182889 
+284902.412275  9106431.980746 
+284896.391151  9106423.937180 
+284874.279860  9106389.756113 
+284857.079797  9106347.544344 
+284853.945925  9106326.444902 
+284856.767867  9106304.347925 
+284846.655338  9106280.226569 
+284824.478900  9106237.004337 
+284791.181704  9106167.650389 
+284787.133822  9106157.600007 
+284769.027148  9106127.441806 
+284682.897201  9106035.924881 
+284664.863137  9106015.812298 
+284659.763481  9105997.724163 
+284663.622866  9105981.655771 
+284665.538063  9105971.612436 
+284667.446011  9105960.564532 
+284673.895525  9105890.252944 
+284675.716502  9105867.150212 
+284668.643699  9105851.068854 
+284658.545917  9105828.956542 
+284638.444590  9105797.791303 
+284598.242030  9105735.460777 
+284527.976883  9105776.564235 
+284422.114558  9105842.739247 
+284396.412403  9105861.795287 
+284337.093522  9105904.920707 
+284265.935314  9105960.086685 
+284222.423514  9105990.171572 
+284178.933363  9106023.270146 
+284107.535962  9106045.285081 
+284099.606932  9106048.289275 
+284039.163403  9106073.330930 
+284008.412133  9106081.330560 
+283893.241952  9106097.265279 
+283797.941296  9106112.219089 
+283780.073766  9106115.211265 
+283742.336546  9106119.184054 
+283492.067806  9106143.995853 
+283488.092415  9106143.991039 
+283358.957146  9106152.875588 
+283250.685357  9106160.780588 
+283101.817103  9106189.731798 
+283067.097243  9106198.730573 
+283034.365066  9106207.731751 
+282993.689267  9106217.727775 
+282960.928204  9106222.710592 
+282903.342442  9106230.676732 
+282892.460530  9106237.695407 
+282881.607452  9106248.732395 
+282873.735930  9106259.773032 
+282784.742389  9106184.321225 
+282786.614780  9106168.250392 
+282790.539738  9106161.223212 
+282780.565185  9106156.188125 
+282772.585543  9106152.160054 
+282770.583427  9106150.148457 
+282766.550368  9106142.106943 
+282758.649999  9106149.129244 
+282745.823605  9106162.172923 
+282747.948227  9106181.262375 
+282751.102739  9106205.375945 
+282741.365986  9106233.491979 
+282725.615655  9106254.568638 
+282713.833524  9106274.645595 
+282700.078084  9106296.729271 
+282687.316489  9106318.814166 
+282671.551697  9106337.881659 
+282654.785830  9106355.943348 
+282640.987112  9106371.999537 
+282637.134167  9106389.072516 
+282646.179760  9106403.147625 
+282670.089997  9106411.213556 
+282695.995162  9106420.286490 
+282715.022605  9106440.401251 
+282720.200907  9106469.540156 
+282704.457717  9106491.621407 
+282676.658471  9106495.605587 
+282653.814104  9106497.586692 
+282626.029254  9106503.580003 
+282608.161382  9106506.571769 
+282581.298329  9106502.520472 
+282552.425945  9106495.452972 
+282526.556756  9106491.402862 
+282499.679303  9106485.342351 
+282473.802916  9106480.287627 
+282459.766440  9106463.192609 
+282452.636588  9106439.074089 
+282438.607336  9106422.983640 
+282422.604777  9106408.899899 
+282399.688413  9106400.835049 
+282374.870726  9106404.822714 
+282352.040751  9106408.812821 
+282327.201454  9106409.786716 
+282305.271757  9106400.718462 
+282293.194294  9106379.607498 
+282279.165112  9106363.516981 
+282268.095926  9106344.416398 
+282253.008142  9106319.283397 
+282242.932839  9106300.184032 
+282231.849298  9106279.074267 
+282218.799641  9106260.975782 
+282198.872135  9106253.919081 
+282175.041144  9106256.903269 
+282166.211529  9106272.965506 
+282169.322593  9106291.051692 
+282183.344521  9106306.137677 
+282193.391025  9106321.218731 
+282175.623873  9106338.274473 
+282164.691422  9106338.260925 
+282157.856707  9106355.330211 
+282146.067076  9106374.402503 
+282125.282336  9106386.431623 
+282105.397932  9106385.402389 
+282101.379332  9106379.369959 
+282099.377225  9106377.358327 
+282097.375119  9106375.346695 
+282089.409850  9106373.327664 
+282087.429322  9106374.329781 
+282084.469319  9106377.339831 
+282077.634568  9106394.409113 
+282074.768066  9106410.478745 
+282073.817360  9106416.505011 
+282075.977708  9106440.617476 
+282077.129813  9106462.719540 
+282076.322969  9106488.837471 
+282072.469799  9106505.910454 
+282047.666368  9106511.907126 
+282029.798398  9106514.898673 
+282009.899545  9106511.860242 
+282003.929170  9106510.848253 
+281980.112391  9106515.841541 
+281962.244409  9106518.833062 
+281956.216508  9106509.784395 
+281936.332035  9106508.755099 
+281910.534701  9106514.750464 
+281886.804166  9106531.798717 
+281881.928299  9106544.852128 
+281876.108887  9106564.936393 
+281890.181174  9106587.054560 
+281895.315868  9106610.166178 
+281894.516126  9106637.288714 
+281892.708139  9106662.400846 
+281891.929973  9106692.537135 
+281886.160895  9106719.653492 
+281868.429426  9106741.732098 
+281849.668123  9106758.786542 
+281826.873809  9106767.799359 
+281804.093861  9106778.821335 
+281779.304592  9106786.827073 
+281755.487620  9106791.820283 
+281731.749700  9106807.863917 
+281682.056097  9106807.801951 
+281650.137218  9106791.688896 
+281629.215611  9106784.630739 
+281607.314505  9106779.580499 
+281584.455448  9106779.551935 
+281560.580967  9106776.508358 
+281538.665499  9106769.448911 
+281513.775601  9106763.390305 
+281485.932817  9106761.346297 
+281462.043977  9106756.293491 
+281441.187020  9106758.276514 
+281426.379456  9106772.322044 
+281411.593422  9106789.381331 
+281400.797232  9106808.454774 
+281386.054257  9106831.541579 
+281366.341893  9106854.622151 
+281343.497125  9106856.602647 
+281320.602105  9106851.551022 
+281300.681534  9106845.498541 
+281277.793696  9106841.451479 
+281262.986047  9106855.496973 
+281252.196953  9106875.574987 
+281231.390144  9106884.590043 
+281221.487262  9106889.600486 
+281231.569559  9106909.704736 
+281241.630336  9106926.795219 
+281246.815038  9106956.939092 
+281231.035001  9106973.997102 
+281205.179809  9106971.955446 
+281185.273536  9106967.912099 
+281174.513092  9106992.008460 
+281183.615879  9107014.120646 
+281198.681956  9107036.240323 
+281226.725912  9107066.412926 
+281197.960793  9107074.413412 
+281176.095416  9107074.385926 
+281163.268255  9107087.429323 
+281153.494492  9107110.522350 
+281148.797775  9107148.690448 
+281155.884129  9107166.781781 
+281180.724025  9107165.808425 
+281170.878496  9107178.855577 
+281151.094125  9107191.890234 
+281136.250457  9107200.912782 
+281438.148767  9107445.403718 
+281608.166309  9107593.288558 
+281720.179556  9107690.871708 
+281724.638380  9107619.552371 
+281738.669333  9107497.011567 
+281748.645655  9107363.415399 
+281758.550116  9107219.773389 
+281808.395172  9107240.931431 
+283354.863807  9107932.963540 
+283987.023492  9108216.002645 
+284325.526238  9108434.393547 
+284331.518619  9108438.418862 
+284367.581759  9108477.639276 
+284386.770512  9108519.853450 
+284430.995409  9108588.215655 
+284470.229190  9108653.558235 
+284518.451753  9108724.938666 
+284532.576904  9108754.087489 
+284555.886813  9108816.397552 
+284574.161932  9108869.660648 
+284608.883132  9108860.660297 
+284843.907101  9108787.602242 
+285415.161571  9108618.495205 
+285496.500505  9108596.488856 
+285525.279652  9108590.494705 
+285530.132592  9108574.427423 
+285534.970967  9108556.351014 
+285558.249020  9108477.018024 
+285573.692445  9108413.748882 
+285589.274209  9108369.566439 
+285598.980030  9108337.431880 
+285618.333389  9108265.126261 
+285649.314710  9108151.647318 
+285930.969928  9107794.350127 
+285940.894065  9107792.352410 
+286242.571115  9107729.410860 
+286324.894355  9107706.400061 
+286503.469190  9107662.402993 
+286543.136196  9107650.393430 
+286630.406429  9107624.374110 
+286713.679166  9107595.336476 
+286757.299553  9107580.317579 
+286507.928982  9107455.470770 
+Region 1
+79
+283358.957146  9106152.875588 
+283353.843512  9106132.778031 
+283349.774267  9106119.713713 
+283341.700758  9106102.626261 
+283323.645472  9106079.499273 
+283317.639079  9106073.464569 
+283310.595531  9106061.401197 
+283305.539681  9106049.340238 
+283302.449873  9106034.267965 
+283296.176441  9105991.063919 
+283292.071148  9105972.976704 
+283284.933808  9105947.853823 
+283262.506365  9105869.470221 
+283247.245163  9105820.227796 
+283240.136752  9105799.123203 
+283236.045948  9105783.045126 
+283230.975736  9105768.974991 
+283203.523331  9105821.179089 
+283174.903895  9105849.272114 
+283160.053960  9105857.290552 
+283146.190649  9105864.305622 
+283134.516990  9105899.451287 
+283129.742526  9105926.568820 
+283120.754644  9105920.530440 
+283081.785543  9105891.350365 
+283033.527046  9105952.570130 
+283006.909529  9105982.674678 
+282997.035957  9105991.703732 
+282982.193146  9106000.726708 
+282942.547395  9106015.746753 
+282900.899497  9106028.755177 
+282886.020605  9106032.755234 
+282873.223115  9106049.817249 
+282874.418800  9106077.946678 
+282872.582480  9106099.040402 
+282855.679820  9106098.015125 
+282832.770812  9106090.955058 
+282815.810495  9106081.893131 
+282807.809246  9106074.851325 
+282786.729411  9106045.692919 
+282782.674745  9106034.637666 
+282781.457506  9106003.494481 
+282779.253633  9105973.354655 
+282777.107413  9105951.251464 
+282774.946787  9105927.139113 
+282773.859270  9105914.078358 
+282770.805679  9105904.028900 
+282766.808678  9105901.010278 
+282760.838396  9105899.998374 
+282756.863011  9105899.993490 
+282754.918547  9105906.018527 
+282744.087102  9105920.069212 
+282745.217839  9105939.157448 
+282747.400067  9105966.283543 
+282748.602864  9105995.417576 
+282753.781063  9106024.556490 
+282758.916039  9106047.667923 
+282774.947342  9106065.769874 
+282791.986921  9106085.882194 
+282792.167091  9106110.996679 
+282775.451792  9106136.090440 
+282766.550368  9106142.106943 
+282770.583427  9106150.148457 
+282772.585543  9106152.160054 
+282780.565185  9106156.188125 
+282790.539738  9106161.223212 
+282786.614780  9106168.250392 
+282784.742389  9106184.321225 
+282873.735930  9106259.773032 
+282881.607452  9106248.732395 
+282892.460530  9106237.695407 
+282903.342442  9106230.676732 
+282960.928204  9106222.710592 
+282993.689267  9106217.727775 
+283034.365066  9106207.731751 
+283067.097243  9106198.730573 
+283101.817103  9106189.731798 
+283250.685357  9106160.780588 
+283358.957146  9106152.875588 
+Region 1
+123
+283447.272387  9105304.123410 
+283456.813751  9105248.883810 
+283443.971371  9105121.288118 
+283434.875418  9105100.181126 
+283429.805281  9105086.111005 
+283409.979291  9105093.118828 
+283357.414771  9105108.123277 
+283337.545474  9105109.103611 
+283280.846922  9105102.002433 
+283191.316063  9105089.838187 
+283145.535184  9105080.741042 
+283127.322894  9105174.143677 
+283123.441297  9105187.198325 
+283111.868586  9105236.408049 
+282968.166762  9105292.487821 
+282978.429367  9105337.706059 
+282979.452026  9105341.725594 
+282962.672170  9105357.778129 
+282942.896389  9105371.817843 
+282940.095037  9105396.928658 
+282953.144596  9105415.026930 
+282962.182792  9105428.097427 
+282942.406986  9105442.137148 
+282918.482883  9105432.062089 
+282897.619552  9105433.041046 
+282891.692567  9105438.056619 
+282890.850041  9105459.151562 
+282881.062991  9105480.235521 
+282852.335396  9105493.259651 
+282830.499804  9105497.251101 
+282812.524293  9105485.174156 
+282803.514930  9105476.121941 
+282777.581539  9105463.030619 
+282759.663672  9105458.990285 
+282750.704740  9105456.970115 
+282747.644007  9105445.916064 
+282747.593593  9105438.884004 
+282733.528654  9105417.770690 
+282722.596460  9105417.757224 
+282711.707473  9105423.771237 
+282701.769113  9105423.758991 
+282691.845154  9105425.755903 
+282674.978741  9105429.753398 
+282668.108289  9105441.799785 
+282655.253212  9105450.825078 
+282639.409419  9105458.842110 
+282617.616993  9105468.860942 
+282596.775200  9105472.853507 
+282563.035103  9105479.843851 
+282545.210797  9105488.862982 
+282527.400878  9105499.891271 
+282524.556113  9105518.974629 
+282529.683656  9105541.081555 
+282521.884089  9105562.167936 
+282506.105003  9105579.226167 
+282498.283829  9105597.298804 
+282497.441133  9105618.393783 
+282505.571807  9105643.518139 
+282516.669624  9105666.637012 
+282531.728428  9105687.751624 
+282550.705028  9105700.834487 
+282568.666196  9105710.902371 
+282576.645740  9105714.930502 
+282590.617144  9105722.984309 
+282612.568102  9105735.066234 
+282632.545785  9105749.154857 
+282650.535792  9105763.241020 
+282667.582381  9105784.358011 
+282685.608425  9105803.467054 
+282704.657144  9105826.595629 
+282718.715045  9105846.704341 
+282734.746243  9105864.806329 
+282757.755989  9105885.930595 
+282756.863011  9105899.993490 
+282760.838396  9105899.998374 
+282766.808678  9105901.010278 
+282770.805679  9105904.028900 
+282773.859270  9105914.078358 
+282774.946787  9105927.139113 
+282777.107413  9105951.251464 
+282779.253633  9105973.354655 
+282781.457506  9106003.494481 
+282782.674745  9106034.637666 
+282786.729411  9106045.692919 
+282807.809246  9106074.851325 
+282815.810495  9106081.893131 
+282832.770812  9106090.955058 
+282855.679820  9106098.015125 
+282872.582480  9106099.040402 
+282874.418800  9106077.946678 
+282873.223115  9106049.817249 
+282886.020605  9106032.755234 
+282900.899497  9106028.755177 
+282942.547395  9106015.746753 
+282982.193146  9106000.726708 
+282997.035957  9105991.703732 
+283006.909529  9105982.674678 
+283033.527046  9105952.570130 
+283081.785543  9105891.350365 
+283120.754644  9105920.530440 
+283129.742526  9105926.568820 
+283134.516990  9105899.451287 
+283146.190649  9105864.305622 
+283160.053960  9105857.290552 
+283174.903895  9105849.272114 
+283203.523331  9105821.179089 
+283230.975736  9105768.974991 
+283243.794657  9105754.926655 
+283287.184490  9105707.764804 
+283315.746043  9105671.635130 
+283330.451559  9105643.525128 
+283341.210578  9105619.428595 
+283346.071518  9105604.365993 
+283359.869763  9105588.309700 
+283379.551628  9105561.210317 
+283386.335270  9105537.108946 
+283389.251823  9105528.071386 
+283401.897426  9105489.913200 
+283421.478193  9105448.749747 
+283436.133076  9105413.607708 
+283437.047519  9105402.558579 
+283440.799113  9105371.421552 
+283447.272387  9105304.123410 
+Region 1
+59
+284396.412403  9105861.795287 
+284392.221700  9105694.028424 
+284396.090407  9105541.339596 
+284213.647954  9105461.760910 
+284141.026113  9105451.628183 
+284086.379983  9105453.571696 
+284076.441690  9105453.559756 
+284050.602128  9105453.528702 
+283987.040416  9105459.479635 
+283943.340812  9105463.445280 
+283778.596137  9105495.392649 
+283615.838751  9105527.341876 
+283503.701595  9105550.310934 
+283478.855731  9105550.280770 
+283462.939940  9105548.252306 
+283434.075425  9105542.189832 
+283412.146104  9105533.122067 
+283389.251823  9105528.071386 
+283386.335270  9105537.108946 
+283379.551628  9105561.210317 
+283359.869763  9105588.309700 
+283346.071518  9105604.365993 
+283341.210578  9105619.428595 
+283330.451559  9105643.525128 
+283315.746043  9105671.635130 
+283287.184490  9105707.764804 
+283243.794657  9105754.926655 
+283230.975736  9105768.974991 
+283236.045948  9105783.045126 
+283240.136752  9105799.123203 
+283247.245163  9105820.227796 
+283262.506365  9105869.470221 
+283284.933808  9105947.853823 
+283292.071148  9105972.976704 
+283296.176441  9105991.063919 
+283302.449873  9106034.267965 
+283305.539681  9106049.340238 
+283310.595531  9106061.401197 
+283317.639079  9106073.464569 
+283323.645472  9106079.499273 
+283341.700758  9106102.626261 
+283349.774267  9106119.713713 
+283353.843512  9106132.778031 
+283358.957146  9106152.875588 
+283488.092415  9106143.991039 
+283492.067806  9106143.995853 
+283742.336546  9106119.184054 
+283780.073766  9106115.211265 
+283797.941296  9106112.219089 
+283893.241952  9106097.265279 
+284008.412133  9106081.330560 
+284039.163403  9106073.330930 
+284099.606932  9106048.289275 
+284107.535962  9106045.285081 
+284178.933363  9106023.270146 
+284222.423514  9105990.171572 
+284265.935314  9105960.086685 
+284337.093522  9105904.920707 
+284396.412403  9105861.795287 
+Region 1
+153
+285443.486256  9105116.645893 
+285441.375203  9105099.565952 
+285438.263079  9105081.480280 
+285425.988852  9105033.247150 
+285408.687534  9104976.971649 
+285297.678123  9105018.028003 
+285015.275008  9105133.219113 
+284814.102510  9105212.341056 
+284766.558556  9105234.384951 
+284751.694719  9105240.394663 
+284730.867950  9105246.397287 
+284720.929739  9105246.385478 
+284709.997705  9105246.372487 
+284660.205227  9105232.249427 
+284413.288661  9105169.672129 
+284264.898181  9105126.298265 
+284270.694721  9105103.200265 
+284269.635794  9105094.157928 
+284272.537681  9105083.111214 
+284276.418918  9105070.056549 
+284282.323963  9105062.027126 
+284286.248601  9105054.999891 
+284289.186654  9105048.976036 
+284293.096822  9105039.939657 
+284293.982128  9105024.872274 
+284291.929384  9105015.828746 
+284289.912812  9105011.808076 
+284287.896239  9105007.787406 
+284283.877563  9105001.755209 
+284280.867174  9104997.733346 
+284273.932148  9105000.738717 
+284266.989888  9105002.739515 
+284264.015667  9105003.740510 
+284256.065120  9105003.730970 
+284252.097080  9105004.730772 
+284250.189007  9105015.778677 
+284252.234510  9105023.817637 
+284244.312892  9105027.826384 
+284236.376806  9105029.825986 
+284227.367341  9105020.774101 
+284218.350647  9105010.717642 
+284168.471696  9104984.539068 
+284153.528267  9104979.498285 
+284144.547749  9104974.464668 
+284118.592794  9104958.360424 
+284094.632720  9104943.263127 
+284077.651070  9104931.187910 
+284079.530274  9104916.121711 
+284080.451804  9104906.077180 
+284081.402249  9104900.050939 
+284078.384655  9104895.024484 
+284068.374203  9104884.966783 
+284061.330749  9104872.903526 
+284050.348172  9104865.858340 
+284029.470800  9104864.828608 
+284008.593427  9104863.798866 
+283998.662488  9104864.791451 
+283987.766637  9104869.801128 
+283972.960550  9104883.847166 
+283956.145141  9104894.877081 
+283934.295605  9104896.859829 
+283909.515185  9104905.870981 
+283897.647166  9104913.893161 
+283877.850266  9104924.919452 
+283855.035780  9104930.919260 
+283811.213848  9104917.806893 
+283803.219963  9104911.769823 
+283798.207535  9104905.736361 
+283787.203308  9104895.677380 
+283780.224913  9104892.655232 
+283771.280547  9104892.644398 
+283760.370208  9104895.644878 
+283747.450566  9104895.629223 
+283732.557728  9104897.620304 
+283722.612319  9104896.603682 
+283709.671013  9104893.574291 
+283695.699789  9104885.520816 
+283693.704931  9104884.513830 
+283688.721398  9104882.498651 
+283684.753343  9104883.498403 
+283679.791469  9104884.496949 
+283671.855358  9104886.496451 
+283660.887254  9104881.460307 
+283653.843894  9104869.396959 
+283659.698520  9104854.335570 
+283667.591312  9104846.308620 
+283670.543890  9104842.293939 
+283671.494393  9104836.267694 
+283670.435603  9104827.225311 
+283666.481990  9104830.234211 
+283652.676823  9104845.285946 
+283637.885048  9104861.341048 
+283624.087081  9104877.397355 
+283617.094257  9104872.366027 
+283584.659111  9104922.554951 
+283563.018803  9104953.670220 
+283551.186775  9104966.715206 
+283531.497986  9104992.810007 
+283510.880303  9105027.944779 
+283486.366677  9105074.125049 
+283466.533491  9105080.128318 
+283452.605519  9105078.102228 
+283429.805281  9105086.111005 
+283434.875418  9105100.181126 
+283443.971371  9105121.288118 
+283456.813751  9105248.883810 
+283447.272387  9105304.123410 
+283440.799113  9105371.421552 
+283437.047519  9105402.558579 
+283436.133076  9105413.607708 
+283421.478193  9105448.749747 
+283401.897426  9105489.913200 
+283389.251823  9105528.071386 
+283412.146104  9105533.122067 
+283434.075425  9105542.189832 
+283462.939940  9105548.252306 
+283478.855731  9105550.280770 
+283503.701595  9105550.310934 
+283615.838751  9105527.341876 
+283778.596137  9105495.392649 
+283943.340812  9105463.445280 
+283987.040416  9105459.479635 
+284050.602128  9105453.528702 
+284076.441690  9105453.559756 
+284086.379983  9105453.571696 
+284141.026113  9105451.628183 
+284213.647954  9105461.760910 
+284396.090407  9105541.339596 
+284392.221700  9105694.028424 
+284396.412403  9105861.795287 
+284422.114558  9105842.739247 
+284527.976883  9105776.564235 
+284598.242030  9105735.460777 
+284672.366413  9105678.288851 
+284689.116606  9105658.217521 
+284714.767772  9105632.129386 
+284756.218703  9105591.996134 
+284769.037004  9105577.947489 
+284810.458842  9105533.795936 
+284894.267103  9105441.475675 
+284919.968781  9105422.419454 
+284957.429542  9105380.272264 
+285015.608198  9105317.053799 
+285067.221614  9105308.073715 
+285134.685336  9105292.080354 
+285230.998770  9105280.139094 
+285248.873001  9105278.151008 
+285346.245465  9105275.251776 
+285424.880543  9105292.421505 
+285446.817161  9105302.492783 
+285448.274721  9105229.161857 
+285447.737415  9105154.824033 
+285443.486256  9105116.645893 
+Region 1
+150
+286787.386468  9106386.947715 
+286710.656845  9106358.733086 
+286714.486271  9106338.646457 
+286721.940842  9106270.345583 
+286734.145714  9106171.913639 
+286744.479648  9106089.552359 
+286754.915706  9106021.254889 
+286755.566683  9105974.041812 
+286759.359625  9105948.932400 
+286774.626208  9105861.554002 
+286783.227785  9105814.349986 
+286793.831588  9105769.157351 
+286796.740110  9105759.115173 
+286736.979543  9105740.965155 
+286647.346041  9105714.744517 
+286635.405605  9105712.721768 
+286618.488773  9105709.688776 
+286546.758707  9105685.497478 
+286525.866599  9105682.459894 
+286507.955954  9105679.425717 
+286443.219134  9105660.264999 
+286440.969208  9105624.098575 
+286429.021508  9105621.071205 
+286391.227194  9105617.009586 
+286358.401982  9105612.953648 
+286315.653129  9105610.895369 
+286299.759279  9105611.881627 
+286273.934499  9105613.860996 
+286232.237697  9105619.840266 
+286193.566021  9105631.850306 
+286133.980374  9105637.808855 
+286102.170780  9105636.767560 
+286068.344428  9105631.705697 
+286033.480597  9105620.615287 
+285989.650549  9105606.500802 
+285954.743096  9105589.382948 
+285932.798993  9105578.307417 
+285869.948204  9105545.084206 
+285849.999052  9105535.015495 
+285840.017207  9105528.976573 
+285766.169074  9105486.699409 
+285671.363624  9105432.342994 
+285617.464814  9105400.134328 
+285601.469246  9105387.056425 
+285565.517388  9105362.905079 
+285544.560015  9105350.825905 
+285533.584423  9105344.785733 
+285477.719942  9105315.588219 
+285446.817161  9105302.492783 
+285424.880543  9105292.421505 
+285346.245465  9105275.251776 
+285248.873001  9105278.151008 
+285230.998770  9105280.139094 
+285134.685336  9105292.080354 
+285067.221614  9105308.073715 
+285015.608198  9105317.053799 
+284957.429542  9105380.272264 
+284919.968781  9105422.419454 
+284894.267103  9105441.475675 
+284810.458842  9105533.795936 
+284769.037004  9105577.947489 
+284756.218703  9105591.996134 
+284714.767772  9105632.129386 
+284689.116606  9105658.217521 
+284672.366413  9105678.288851 
+284598.242030  9105735.460777 
+284638.444590  9105797.791303 
+284658.545917  9105828.956542 
+284668.643699  9105851.068854 
+284675.716502  9105867.150212 
+284673.895525  9105890.252944 
+284667.446011  9105960.564532 
+284665.538063  9105971.612436 
+284663.622866  9105981.655771 
+284659.763481  9105997.724163 
+284664.863137  9106015.812298 
+284682.897201  9106035.924881 
+284769.027148  9106127.441806 
+284787.133822  9106157.600007 
+284791.181704  9106167.650389 
+284824.478900  9106237.004337 
+284846.655338  9106280.226569 
+284856.767867  9106304.347925 
+284853.945925  9106326.444902 
+284857.079797  9106347.544344 
+284874.279860  9106389.756113 
+284896.391151  9106423.937180 
+284902.412275  9106431.980746 
+284903.725384  9106476.182889 
+284962.725250  9106526.480265 
+285001.724862  9106559.676543 
+285006.715882  9106562.696082 
+285040.477699  9106558.717503 
+285054.369798  9106555.720138 
+285069.284783  9106556.742201 
+285094.196337  9106565.812450 
+285115.205118  9106584.923686 
+285131.179314  9106594.987987 
+285145.136770  9106601.031689 
+285175.996923  9106608.099736 
+285251.522158  9106607.183546 
+285310.130144  9106603.233805 
+285375.687767  9106598.287541 
+285377.871683  9106625.413111 
+285385.431858  9106708.800104 
+285436.350820  9106741.005224 
+285483.279902  9106771.196516 
+285486.632272  9106822.432758 
+285548.236538  9106820.495239 
+285557.210292  9106824.523882 
+285568.179024  9106829.559395 
+285578.153907  9106834.593750 
+285595.107574  9106842.649867 
+285607.055617  9106845.677394 
+285622.993617  9106850.718654 
+285642.921576  9106857.773643 
+285666.817672  9106863.828664 
+285814.857875  9106857.972615 
+285885.392160  9106854.035835 
+285926.125465  9106852.073708 
+286048.339871  9106848.196230 
+286083.102748  9106845.222543 
+286113.926643  9106847.267067 
+286153.687890  9106848.317277 
+286202.422919  9106853.395950 
+286267.154277  9106871.552061 
+286315.991373  9106890.694436 
+286359.822799  9106904.808273 
+286413.600027  9106919.937967 
+286435.493878  9106923.981160 
+286461.348540  9106926.019758 
+286493.159000  9106927.060580 
+286518.977186  9106924.076352 
+286537.838424  9106921.084186 
+286560.638574  9106913.073748 
+286576.386933  9106891.996127 
+286586.215970  9106876.939066 
+286636.362210  9106802.659439 
+286677.665870  9106742.433434 
+286710.112420  9106694.251942 
+286727.833733  9106671.167444 
+286751.452392  9106639.048700 
+286770.109117  9106607.928866 
+286773.046847  9106601.904907 
+286777.964958  9106594.878648 
+286802.482502  9106549.701780 
+286826.934312  9106495.483896 
+286843.457284  9106444.270661 
+286853.169369  9106413.140673 
+286787.386468  9106386.947715 
+Region 1
+360
+286544.090328  9105043.586503 
+286505.171614  9105021.441655 
+286493.209518  9105016.405145 
+286467.334131  9105011.352624 
+286438.477327  9105006.296654 
+286437.447110  9105001.272710 
+286435.109974  9104953.051548 
+286379.992012  9104889.701274 
+286337.815489  9104829.379492 
+286309.676043  9104786.151250 
+286286.607544  9104756.992574 
+286232.440204  9104687.615788 
+286219.280714  9104654.450312 
+286210.169193  9104631.335044 
+286201.021312  9104603.196965 
+286189.885849  9104575.056578 
+286185.779727  9104556.969864 
+286167.673163  9104526.812276 
+286148.594647  9104499.667206 
+286139.425032  9104468.515412 
+286136.218209  9104437.370536 
+286147.004518  9104417.291993 
+286155.795957  9104396.206580 
+286165.515734  9104366.081267 
+286168.242590  9104330.925070 
+286169.401191  9104216.407348 
+286164.924319  9104147.087971 
+286165.569107  9104098.870161 
+286167.309481  9104064.717371 
+286187.735491  9104003.463361 
+286176.847470  9104009.478025 
+286168.933534  9104014.491592 
+286149.304988  9104048.623585 
+286138.467839  9104061.670177 
+286122.683554  9104077.724674 
+286065.283713  9104110.808143 
+286008.819425  9104135.856216 
+285953.392449  9104166.932769 
+285920.771731  9104191.004013 
+285899.068157  9104213.078880 
+285875.376977  9104235.151419 
+285871.430866  9104239.165029 
+285817.266205  9104307.411479 
+285791.710828  9104346.559254 
+285766.068251  9104373.652259 
+285738.539730  9104414.806826 
+285721.783165  9104433.873773 
+285702.052454  9104453.941790 
+285672.550759  9104497.103143 
+285633.154575  9104546.280233 
+285606.648691  9104591.454193 
+285561.108039  9104615.510146 
+285540.288998  9104622.517617 
+285525.381953  9104622.500123 
+285508.429229  9104614.443770 
+285476.504143  9104597.328810 
+285456.599056  9104593.287191 
+285439.711665  9104594.271896 
+285418.914372  9104604.293010 
+285374.367365  9104628.349969 
+285322.080262  9104681.529947 
+285309.226085  9104690.555823 
+285286.448351  9104701.579117 
+285276.611850  9104715.631332 
+285261.820818  9104731.686821 
+285217.607364  9104664.329278 
+285167.373222  9104588.928075 
+285139.147930  9104533.643984 
+285115.949726  9104486.402278 
+285096.654299  9104429.119581 
+285083.314488  9104370.839360 
+285080.115652  9104340.698799 
+285079.992440  9104323.621149 
+285086.601141  9104275.410149 
+285110.089887  9104225.210040 
+285146.396452  9104160.961292 
+285182.673933  9104092.694269 
+285200.279499  9104053.537332 
+285218.944074  9104023.422674 
+285279.834113  9103923.038897 
+285302.408495  9103883.887832 
+285326.897912  9103834.693448 
+285328.791229  9103821.636434 
+285329.553005  9103789.491481 
+285323.307542  9103750.306334 
+285318.193624  9103730.209124 
+285288.634509  9103627.709207 
+285284.557904  9103613.640564 
+285278.276302  9103569.432558 
+285278.015384  9103533.268149 
+285279.843498  9103511.170032 
+285280.786545  9103504.139242 
+285287.525574  9103474.010479 
+285301.184808  9103438.867126 
+285333.602574  9103386.668510 
+285382.653500  9103298.325496 
+285416.035872  9103242.109774 
+285428.766441  9103216.006340 
+285468.923865  9103134.684688 
+285489.524793  9103097.540428 
+285497.322698  9103076.453945 
+285359.986877  9103049.168258 
+285293.317399  9103037.034452 
+285191.808065  9103016.822631 
+284933.080524  9102968.295174 
+284919.138805  9102964.260259 
+284928.729153  9102916.052827 
+284933.509851  9102889.939973 
+284702.492808  9102825.371095 
+284699.569350  9102833.404076 
+284637.587052  9102782.096883 
+284483.643729  9102656.341002 
+284478.703803  9102660.353289 
+284426.395427  9102710.518258 
+284424.436789  9102714.534144 
+284419.540193  9102724.573860 
+284410.762435  9102747.668208 
+284395.179987  9102791.850163 
+284367.607275  9102826.976551 
+284353.745063  9102833.991733 
+284339.882845  9102841.006911 
+284321.058994  9102849.020647 
+284297.287948  9102860.042079 
+284244.820281  9102888.106332 
+284205.170498  9102902.122178 
+284144.680334  9102920.130966 
+284045.432936  9102938.092583 
+283930.270584  9102954.025481 
+283924.315150  9102955.022792 
+283911.461003  9102964.048223 
+283894.675029  9102979.096255 
+283880.870372  9102994.147918 
+283867.051279  9103007.190429 
+283851.251838  9103021.235088 
+283831.470067  9103034.270320 
+283811.681071  9103046.300970 
+283790.855015  9103052.302949 
+283791.906486  9103060.340765 
+283788.053972  9103077.413694 
+283771.397718  9103110.544057 
+283763.577290  9103128.616708 
+283756.700158  9103139.658544 
+283743.867554  9103151.697673 
+283713.269476  9103180.792733 
+283704.404762  9103191.832137 
+283692.558701  9103202.867897 
+283685.717592  9103218.932608 
+283682.808348  9103228.974723 
+283680.885675  9103238.013476 
+283686.085318  9103270.165976 
+283691.270553  9103300.309322 
+283693.330228  9103310.357507 
+283697.435161  9103328.444727 
+283693.524923  9103337.481053 
+283680.699466  9103350.524757 
+283673.793447  9103357.548289 
+283725.737099  9103394.780692 
+283715.093936  9103434.950373 
+283706.330156  9103460.053847 
+283693.692186  9103499.216529 
+283682.148957  9103552.444485 
+283670.648989  9103611.699898 
+283661.107744  9103666.939436 
+283688.905063  9103662.955084 
+283689.236857  9103709.165562 
+283685.708902  9103771.444402 
+283686.069577  9103821.673180 
+283684.204618  9103838.748542 
+283681.374719  9103859.840995 
+283674.576847  9103881.933178 
+283668.729486  9103897.999119 
+283664.833648  9103909.044605 
+283663.991338  9103930.139482 
+283677.962218  9103938.193044 
+283677.991075  9103942.211346 
+283675.081822  9103952.253468 
+283673.173581  9103963.301377 
+283672.251925  9103973.345922 
+283677.293061  9103983.397732 
+283684.307369  9103991.442811 
+283685.423817  9104008.521804 
+283685.524824  9104022.585861 
+283683.623801  9104034.638346 
+283678.726949  9104044.678049 
+283673.801236  9104050.699450 
+283669.912610  9104062.749514 
+283662.214716  9104097.899974 
+283657.476578  9104130.040340 
+283655.618840  9104148.120279 
+283650.707545  9104156.150832 
+283642.822054  9104165.182328 
+283655.820858  9104176.248395 
+283745.270342  9104177.361801 
+283755.554803  9104225.593482 
+283760.646522  9104242.677295 
+283768.762968  9104265.792177 
+283777.822702  9104281.876239 
+283777.945415  9104298.954011 
+283778.060910  9104315.027208 
+283775.194990  9104331.096785 
+283769.390961  9104353.190190 
+283760.648818  9104381.307425 
+283757.847860  9104406.418177 
+283761.024190  9104433.545318 
+283764.121118  9104449.622135 
+283761.247976  9104464.687138 
+283760.326358  9104474.731680 
+283754.464567  9104488.788490 
+283746.680125  9104511.884061 
+283741.855452  9104531.969527 
+283742.979206  9104550.053082 
+283746.105024  9104570.148198 
+283752.118428  9104577.187458 
+283816.235056  9104648.589381 
+283830.285647  9104667.693150 
+283832.316604  9104673.723003 
+283833.375414  9104682.765376 
+283832.461041  9104693.814490 
+283824.893293  9104747.047302 
+283819.060399  9104765.122420 
+283814.235761  9104785.207890 
+283811.348200  9104798.263747 
+283807.466822  9104811.318400 
+283796.542062  9104812.309735 
+283777.673989  9104814.296009 
+283753.807945  9104812.257954 
+283740.873886  9104810.233142 
+283730.906836  9104806.202792 
+283716.942861  9104799.153892 
+283710.007804  9104802.159178 
+283686.257270  9104816.194286 
+283670.435603  9104827.225311 
+283671.494393  9104836.267694 
+283670.543890  9104842.293939 
+283667.591312  9104846.308620 
+283659.698520  9104854.335570 
+283653.843894  9104869.396959 
+283660.887254  9104881.460307 
+283671.855358  9104886.496451 
+283679.791469  9104884.496949 
+283684.753343  9104883.498403 
+283688.721398  9104882.498651 
+283693.704931  9104884.513830 
+283695.699789  9104885.520816 
+283709.671013  9104893.574291 
+283722.612319  9104896.603682 
+283732.557728  9104897.620304 
+283747.450566  9104895.629223 
+283760.370208  9104895.644878 
+283771.280547  9104892.644398 
+283780.224913  9104892.655232 
+283787.203308  9104895.677380 
+283798.207535  9104905.736361 
+283803.219963  9104911.769823 
+283811.213848  9104917.806893 
+283855.035780  9104930.919260 
+283877.850266  9104924.919452 
+283897.647166  9104913.893161 
+283909.515185  9104905.870981 
+283934.295605  9104896.859829 
+283956.145141  9104894.877081 
+283972.960550  9104883.847166 
+283987.766637  9104869.801128 
+283998.662488  9104864.791451 
+284008.593427  9104863.798866 
+284029.470800  9104864.828608 
+284050.348172  9104865.858340 
+284061.330749  9104872.903526 
+284068.374203  9104884.966783 
+284078.384655  9104895.024484 
+284081.402249  9104900.050939 
+284080.451804  9104906.077180 
+284079.530274  9104916.121711 
+284077.651070  9104931.187910 
+284094.632720  9104943.263127 
+284118.592794  9104958.360424 
+284144.547749  9104974.464668 
+284153.528267  9104979.498285 
+284168.471696  9104984.539068 
+284218.350647  9105010.717642 
+284227.367341  9105020.774101 
+284236.376806  9105029.825986 
+284244.312892  9105027.826384 
+284252.234510  9105023.817637 
+284250.189007  9105015.778677 
+284252.097080  9105004.730772 
+284256.065120  9105003.730970 
+284264.015667  9105003.740510 
+284266.989888  9105002.739515 
+284273.932148  9105000.738717 
+284280.867174  9104997.733346 
+284283.877563  9105001.755209 
+284287.896239  9105007.787406 
+284289.912812  9105011.808076 
+284291.929384  9105015.828746 
+284293.982128  9105024.872274 
+284293.096822  9105039.939657 
+284289.186654  9105048.976036 
+284286.248601  9105054.999891 
+284282.323963  9105062.027126 
+284276.418918  9105070.056549 
+284272.537681  9105083.111214 
+284269.635794  9105094.157928 
+284270.694721  9105103.200265 
+284264.898181  9105126.298265 
+284413.288661  9105169.672129 
+284660.205227  9105232.249427 
+284709.997705  9105246.372487 
+284720.929739  9105246.385478 
+284730.867950  9105246.397287 
+284751.694719  9105240.394663 
+284766.558556  9105234.384951 
+284814.102510  9105212.341056 
+285015.275008  9105133.219113 
+285297.678123  9105018.028003 
+285408.687534  9104976.971649 
+285425.988852  9105033.247150 
+285438.263079  9105081.480280 
+285441.375203  9105099.565952 
+285443.486256  9105116.645893 
+285447.737415  9105154.824033 
+285448.274721  9105229.161857 
+285446.817161  9105302.492783 
+285477.719942  9105315.588219 
+285533.584423  9105344.785733 
+285544.560015  9105350.825905 
+285565.517388  9105362.905079 
+285601.469246  9105387.056425 
+285617.464814  9105400.134328 
+285671.363624  9105432.342994 
+285766.169074  9105486.699409 
+285840.017207  9105528.976573 
+285849.999052  9105535.015495 
+285869.948204  9105545.084206 
+285932.798993  9105578.307417 
+285954.743096  9105589.382948 
+285989.650549  9105606.500802 
+286033.480597  9105620.615287 
+286068.344428  9105631.705697 
+286102.170780  9105636.767560 
+286133.980374  9105637.808855 
+286193.566021  9105631.850306 
+286232.237697  9105619.840266 
+286273.934499  9105613.860996 
+286299.759279  9105611.881627 
+286315.653129  9105610.895369 
+286358.401982  9105612.953648 
+286391.227194  9105617.009586 
+286429.021508  9105621.071205 
+286440.969208  9105624.098575 
+286457.361439  9105554.803364 
+286478.562448  9105463.413555 
+286500.677089  9105360.974740 
+286502.497154  9105337.872157 
+286532.212546  9105187.223637 
+286536.129505  9105179.191728 
+286544.986371  9105167.147287 
+286592.033483  9105076.791722 
+286581.021460  9105065.729027 
+286544.090328  9105043.586503 
+Region 1
+262
+285913.629115  9101827.277387 
+285903.401655  9101787.083088 
+285889.032499  9101723.779107 
+285854.201476  9101579.081880 
+285847.027867  9101548.936712 
+285831.694207  9101489.649751 
+285823.447182  9101448.453180 
+285819.044646  9101389.179141 
+285816.738304  9101344.975927 
+285811.044983  9101244.513534 
+285806.620811  9101182.225784 
+285805.496659  9101164.142433 
+285804.437721  9101155.100168 
+285797.989926  9101087.787227 
+285795.727164  9101049.611389 
+285791.245144  9100979.287100 
+285783.919643  9100928.046007 
+285769.616414  9100873.782947 
+285736.345695  9100807.442634 
+285716.275822  9100780.295715 
+285666.148316  9100718.958033 
+285653.106935  9100701.865015 
+285599.955041  9100634.496261 
+285558.829189  9100581.205586 
+285528.735580  9100541.991855 
+285474.575907  9100472.612535 
+285443.373008  9100417.324439 
+285428.199733  9100380.137579 
+285416.885605  9100326.882390 
+285414.847562  9100319.848033 
+285410.540054  9100273.633150 
+285408.982275  9100195.275671 
+285410.289950  9100100.848680 
+285412.743210  9100027.518806 
+285412.641983  9100013.454856 
+285413.433231  9099985.328148 
+285395.409251  9099966.219872 
+285361.276449  9099917.959995 
+285340.307565  9099903.870941 
+285308.509189  9099903.832676 
+285064.087877  9099907.556037 
+285040.210171  9099903.508913 
+285020.300049  9099898.462016 
+284994.463828  9099898.430741 
+284961.751112  9099909.441300 
+284939.076463  9099934.527869 
+284930.320846  9099960.635865 
+284896.498860  9099955.572053 
+284866.694995  9099956.540463 
+284833.982185  9099967.550945 
+284881.980709  9099871.171230 
+284897.641728  9099838.039684 
+284865.843322  9099838.001093 
+284840.957514  9099831.943500 
+284797.126464  9099816.821804 
+284767.236094  9099805.735267 
+284754.274705  9099799.692123 
+284734.371848  9099795.649651 
+284704.604125  9099801.640787 
+284680.877935  9099818.689462 
+284634.549018  9099870.870297 
+284576.410930  9099939.109723 
+284541.905288  9099977.241043 
+284527.071816  9099987.268575 
+284512.195074  9099991.268668 
+284500.277817  9099992.258678 
+284485.314555  9099984.203887 
+284465.375562  9099975.138443 
+284436.486018  9099965.057480 
+284398.494574  9099932.864933 
+284377.576323  9099925.807371 
+284360.697753  9099927.795831 
+284391.128727  9100014.225657 
+284401.282030  9100044.375019 
+284385.721476  9100091.570522 
+284368.360883  9100164.882506 
+284353.981398  9100238.198142 
+284347.270485  9100272.345136 
+284329.981910  9100355.702868 
+284349.071539  9100384.858593 
+284364.200751  9100416.018592 
+284381.245323  9100437.135275 
+284439.183723  9100479.397714 
+284556.076190  9100566.937214 
+284700.944810  9100675.606064 
+284715.922793  9100685.669859 
+284724.916805  9100692.712704 
+284804.984848  9100772.170129 
+284853.022922  9100819.442653 
+284892.030906  9100854.649454 
+284904.150627  9100881.787254 
+284909.343195  9100912.934931 
+284907.456888  9100926.996514 
+284906.520959  9100935.031876 
+284892.905009  9100976.202461 
+284867.479909  9101033.431773 
+284814.685441  9101153.915419 
+284811.834276  9101171.994089 
+284810.092421  9101206.147089 
+284799.305852  9101226.225297 
+284777.660455  9101256.336004 
+284771.799187  9101270.392790 
+284775.925810  9101291.493580 
+284785.086123  9101321.641506 
+284788.240701  9101345.754803 
+284785.331739  9101355.796909 
+284781.472386  9101371.865240 
+284770.714676  9101395.961735 
+284744.172758  9101436.112156 
+284727.445374  9101459.196875 
+284710.078176  9101531.504370 
+284703.122005  9101531.495963 
+284698.073856  9101520.439676 
+284694.984295  9101505.367506 
+284693.853323  9101486.279454 
+284688.740181  9101466.182023 
+284649.829975  9101306.409490 
+284643.730379  9101287.315411 
+284617.409577  9101219.977809 
+284591.045564  9101146.612739 
+284520.199861  9100967.714431 
+284504.998117  9100926.508839 
+284401.859719  9100955.515640 
+284366.711423  9100904.240017 
+284342.602368  9100868.046287 
+284315.533812  9100834.862614 
+284291.590671  9100821.774031 
+284287.615769  9100821.769175 
+284271.716164  9100821.749748 
+284231.081550  9100836.768550 
+284206.353731  9100852.811349 
+284190.511771  9100860.828490 
+284182.569165  9100861.823335 
+284166.655122  9100859.794726 
+284164.710913  9100865.819739 
+284149.977978  9100889.911275 
+284140.213671  9100914.008893 
+284126.481648  9100939.106219 
+284114.686624  9100957.173956 
+284099.910401  9100975.238040 
+284087.136041  9100995.313707 
+284074.361670  9101015.389372 
+284062.566609  9101033.457105 
+284046.803818  9101052.524539 
+284034.987120  9101067.578544 
+284022.234326  9101090.667929 
+284008.430146  9101105.719495 
+283995.648510  9101124.790577 
+283987.813920  9101140.854028 
+283984.875947  9101146.877822 
+283979.115279  9101174.998614 
+283976.299789  9101198.100187 
+283976.487122  9101224.219143 
+283978.683549  9101253.354261 
+283980.843954  9101277.466502 
+283982.910691  9101288.519265 
+283984.991841  9101301.581179 
+283988.153203  9101326.699210 
+283994.288582  9101350.816319 
+283998.342807  9101361.871515 
+284003.397981  9101373.932503 
+284015.459782  9101393.034033 
+284023.553843  9101413.135266 
+284034.650757  9101436.253869 
+284053.726444  9101463.400493 
+284058.788858  9101476.466042 
+284070.865136  9101497.576693 
+284081.926057  9101515.672400 
+284091.006714  9101534.770248 
+284103.090237  9101556.885457 
+284104.120030  9101561.909543 
+284110.183429  9101575.980868 
+284119.278536  9101597.087852 
+284125.392422  9101618.191191 
+284128.496239  9101635.272592 
+284129.648627  9101657.374437 
+284131.787552  9101678.472920 
+284129.886597  9101690.525384 
+284128.936119  9101696.551616 
+284123.117871  9101716.635821 
+284115.297704  9101734.708452 
+284105.518882  9101756.796955 
+284095.747264  9101779.890031 
+284089.943420  9101801.983386 
+284085.126111  9101823.073381 
+284079.300628  9101842.153014 
+284068.520816  9101863.235729 
+284061.715996  9101884.323298 
+284057.906846  9101907.423656 
+284050.129901  9101931.523736 
+284043.346702  9101955.625029 
+284043.548609  9101983.753114 
+284045.745239  9102012.888200 
+284059.866920  9102042.037837 
+284073.952562  9102066.164594 
+284085.013683  9102084.260262 
+284101.065226  9102105.375704 
+284117.123999  9102127.495711 
+284128.170728  9102143.582212 
+284141.226620  9102162.684850 
+284147.290157  9102176.756144 
+284151.315684  9102183.793000 
+284162.384087  9102202.893207 
+284176.491495  9102230.033625 
+284182.562273  9102245.109483 
+284183.714778  9102267.211310 
+284181.871579  9102287.300364 
+284178.055295  9102309.396148 
+284173.245250  9102331.490724 
+284171.301027  9102337.515748 
+284166.454899  9102354.587457 
+284164.561186  9102367.644497 
+284148.899140  9102400.776089 
+284108.019781  9102520.269596 
+284090.543304  9102577.508545 
+284122.013946  9102669.966798 
+284159.642267  9102789.555718 
+284181.996091  9102857.893238 
+284193.079183  9102879.002535 
+284205.170498  9102902.122178 
+284244.820281  9102888.106332 
+284297.287948  9102860.042079 
+284321.058994  9102849.020647 
+284339.882845  9102841.006911 
+284353.745063  9102833.991733 
+284367.607275  9102826.976551 
+284395.179987  9102791.850163 
+284410.762435  9102747.668208 
+284419.540193  9102724.573860 
+284424.436789  9102714.534144 
+284426.395427  9102710.518258 
+284478.703803  9102660.353289 
+284483.643729  9102656.341002 
+284637.587052  9102782.096883 
+284699.569350  9102833.404076 
+284702.492808  9102825.371095 
+284933.509851  9102889.939973 
+284928.729153  9102916.052827 
+284919.138805  9102964.260259 
+284933.080524  9102968.295174 
+285191.808065  9103016.822631 
+285293.317399  9103037.034452 
+285359.986877  9103049.168258 
+285497.322698  9103076.453945 
+285541.266479  9102969.018275 
+285572.472436  9102886.681479 
+285590.026656  9102840.492603 
+285596.859736  9102823.423209 
+285646.584438  9102690.880456 
+285652.438228  9102675.819020 
+285704.121201  9102539.260361 
+285728.471972  9102470.979275 
+285737.241717  9102446.880275 
+285770.398397  9102359.523017 
+285817.315173  9102251.086320 
+285837.792253  9102196.864455 
+285895.429628  9102059.308285 
+285903.067699  9102016.121397 
+285917.495142  9101949.837737 
+285919.178007  9101907.648386 
+285919.018449  9101885.547974 
+285913.629115  9101827.277387 
+Region 1
+156
+288609.815460  9099397.376816 
+288485.043414  9099456.503396 
+288374.138650  9099509.618211 
+288286.015193  9099552.713318 
+288232.444195  9099564.706810 
+288082.464618  9099573.576494 
+287759.686707  9099596.310879 
+287633.554880  9099605.206528 
+287624.604479  9099604.191658 
+287528.173809  9099598.053043 
+287461.495352  9099583.912263 
+287438.604326  9099578.863026 
+287411.731306  9099572.804615 
+287381.891792  9099568.751846 
+287355.047865  9099566.711627 
+287331.170437  9099562.665735 
+287304.304697  9099557.611812 
+287274.450647  9099551.549850 
+287250.573224  9099547.503911 
+287226.695803  9099543.457959 
+287204.791210  9099537.405188 
+287199.815536  9099536.394850 
+287181.922009  9099535.369482 
+287160.046488  9099533.334920 
+287140.151063  9099530.298103 
+287116.280914  9099527.256646 
+287089.415189  9099522.202582 
+287064.558625  9099520.164496 
+287039.716587  9099520.135513 
+287012.908975  9099523.117875 
+286990.105135  9099530.123102 
+286964.349290  9099541.143074 
+286946.550153  9099553.176886 
+286919.815120  9099566.204796 
+286902.052266  9099583.261396 
+286876.448842  9099615.377090 
+286864.626280  9099629.426977 
+286819.301553  9099682.615159 
+286788.736842  9099715.729572 
+286764.097918  9099743.828158 
+286742.381959  9099763.893747 
+286729.551112  9099775.933331 
+286716.727517  9099788.977473 
+286701.046236  9099819.095652 
+286667.558339  9099860.243015 
+286634.998759  9099892.350482 
+286613.333470  9099919.447967 
+286594.627466  9099943.535265 
+286574.913236  9099965.612269 
+286563.119519  9099983.680365 
+286549.425475  9100013.800863 
+286539.749737  9100049.953404 
+286532.989776  9100077.068394 
+286493.292692  9100084.053592 
+286441.591423  9100079.974536 
+286392.842230  9100071.880682 
+286382.890752  9100069.859845 
+286299.376655  9100063.733998 
+286092.542518  9100043.398208 
+286081.604591  9100042.380685 
+286046.803412  9100039.325742 
+285879.760628  9100025.063448 
+285869.816397  9100024.047054 
+285758.471406  9100016.882458 
+285657.063382  9100009.729455 
+285639.075486  9099995.644138 
+285478.045455  9099988.419373 
+285413.433231  9099985.328148 
+285412.641983  9100013.454856 
+285412.743210  9100027.518806 
+285410.289950  9100100.848680 
+285408.982275  9100195.275671 
+285410.540054  9100273.633150 
+285414.847562  9100319.848033 
+285416.885605  9100326.882390 
+285428.199733  9100380.137579 
+285443.373008  9100417.324439 
+285474.575907  9100472.612535 
+285528.735580  9100541.991855 
+285558.829189  9100581.205586 
+285599.955041  9100634.496261 
+285653.106935  9100701.865015 
+285666.148316  9100718.958033 
+285705.679704  9100688.868392 
+285717.705658  9100702.946510 
+285773.889652  9100777.350563 
+285883.641491  9100701.134600 
+285926.161059  9100672.052905 
+285931.100641  9100668.040537 
+285934.089026  9100669.048636 
+286112.398584  9100729.532996 
+286131.337144  9100737.591804 
+286167.509674  9100792.885018 
+286189.610725  9100826.061391 
+286208.694400  9100854.211415 
+286251.300850  9100837.184182 
+286276.063925  9100826.163241 
+286295.822139  9100810.113628 
+286305.708496  9100803.093383 
+286332.517006  9100800.111256 
+286349.410140  9100800.131119 
+286410.113758  9100812.257084 
+286419.078954  9100815.281270 
+286469.845453  9100827.395479 
+286605.186542  9100854.676915 
+286608.022441  9100834.589183 
+286615.674400  9100793.411484 
+286697.238682  9100804.556887 
+286709.851848  9100762.380434 
+286828.270550  9100785.623240 
+286839.795405  9100730.386347 
+286841.753757  9100726.370424 
+286858.348873  9100685.203156 
+286865.028692  9100647.037994 
+286864.745293  9100607.860168 
+286862.605285  9100586.762100 
+286873.861255  9100494.356509 
+286873.548819  9100451.160444 
+286871.132742  9100391.889106 
+286875.883287  9100361.758109 
+286880.750077  9100347.700067 
+286918.467107  9100341.716728 
+286931.341615  9100335.704423 
+286968.964144  9100316.661776 
+286979.829433  9100307.633469 
+286996.569701  9100286.557390 
+287008.334194  9100264.470969 
+287018.140353  9100246.400470 
+287031.797738  9100211.257094 
+287048.501610  9100185.158215 
+287079.131740  9100161.084629 
+287144.446644  9100123.992174 
+287224.615921  9100079.885034 
+287281.001868  9100044.791174 
+287307.715178  9100028.749335 
+287340.390611  9100012.714387 
+287361.236297  9100009.724867 
+287477.189295  9099830.044759 
+287568.619613  9099694.536358 
+287711.666175  9099688.673945 
+287927.236708  9099680.885174 
+287984.862878  9099679.946642 
+288013.745183  9099689.020609 
+288070.538000  9099710.181005 
+288163.263749  9099753.482298 
+288200.124728  9099766.583402 
+288217.039178  9099769.616307 
+288277.135876  9099698.362102 
+288354.139488  9099629.136170 
+288406.549019  9099594.036703 
+288471.941903  9099567.992814 
+288517.563376  9099555.990037 
+288591.979460  9099541.006197 
+288634.780431  9099551.100050 
+288622.221263  9099463.690660 
+288609.815460  9099397.376816 
+Region 1
+274
+288986.709479  9101621.853507 
+288981.631093  9101606.779766 
+288963.925484  9101495.256167 
+288930.772869  9101309.379367 
+288921.449008  9101257.132890 
+288891.343931  9101080.300223 
+288871.688226  9100973.796982 
+288861.297762  9100911.503855 
+288858.185020  9100893.418644 
+288853.968890  9100860.264089 
+288824.909594  9100690.464177 
+288821.767660  9100668.360759 
+288791.568906  9100478.468654 
+288748.036145  9100231.302602 
+288702.414563  9099970.070428 
+288657.882476  9099721.898330 
+288634.780431  9099551.100050 
+288591.979460  9099541.006197 
+288517.563376  9099555.990037 
+288471.941903  9099567.992814 
+288406.549019  9099594.036703 
+288354.139488  9099629.136170 
+288277.135876  9099698.362102 
+288217.039178  9099769.616307 
+288200.124728  9099766.583402 
+288163.263749  9099753.482298 
+288070.538000  9099710.181005 
+288013.745183  9099689.020609 
+287984.862878  9099679.946642 
+287927.236708  9099680.885174 
+287711.666175  9099688.673945 
+287568.619613  9099694.536358 
+287477.189295  9099830.044759 
+287361.236297  9100009.724867 
+287340.390611  9100012.714387 
+287307.715178  9100028.749335 
+287281.001868  9100044.791174 
+287224.615921  9100079.885034 
+287144.446644  9100123.992174 
+287079.131740  9100161.084629 
+287048.501610  9100185.158215 
+287031.797738  9100211.257094 
+287018.140353  9100246.400470 
+287008.334194  9100264.470969 
+286996.569701  9100286.557390 
+286979.829433  9100307.633469 
+286968.964144  9100316.661776 
+286931.341615  9100335.704423 
+286918.467107  9100341.716728 
+286880.750077  9100347.700067 
+286875.883287  9100361.758109 
+286871.132742  9100391.889106 
+286873.548819  9100451.160444 
+286873.861255  9100494.356509 
+286862.605285  9100586.762100 
+286864.745293  9100607.860168 
+286865.028692  9100647.037994 
+286858.348873  9100685.203156 
+286841.753757  9100726.370424 
+286839.795405  9100730.386347 
+286828.270550  9100785.623240 
+286709.851848  9100762.380434 
+286697.238682  9100804.556887 
+286615.674400  9100793.411484 
+286608.022441  9100834.589183 
+286605.186542  9100854.676915 
+286469.845453  9100827.395479 
+286419.078954  9100815.281270 
+286410.113758  9100812.257084 
+286349.410140  9100800.131119 
+286332.517006  9100800.111256 
+286305.708496  9100803.093383 
+286295.822139  9100810.113628 
+286276.063925  9100826.163241 
+286251.300850  9100837.184182 
+286208.694400  9100854.211415 
+286189.610725  9100826.061391 
+286167.509674  9100792.885018 
+286131.337144  9100737.591804 
+286112.398584  9100729.532996 
+285934.089026  9100669.048636 
+285931.100641  9100668.040537 
+285926.161059  9100672.052905 
+285883.641491  9100701.134600 
+285773.889652  9100777.350563 
+285717.705658  9100702.946510 
+285705.679704  9100688.868392 
+285666.148316  9100718.958033 
+285716.275822  9100780.295715 
+285736.345695  9100807.442634 
+285769.616414  9100873.782947 
+285783.919643  9100928.046007 
+285791.245144  9100979.287100 
+285795.727164  9101049.611389 
+285797.989926  9101087.787227 
+285804.437721  9101155.100168 
+285805.496659  9101164.142433 
+285806.620811  9101182.225784 
+285811.044983  9101244.513534 
+285816.738304  9101344.975927 
+285819.044646  9101389.179141 
+285823.447182  9101448.453180 
+285831.694207  9101489.649751 
+285847.027867  9101548.936712 
+285854.201476  9101579.081880 
+285889.032499  9101723.779107 
+285903.401655  9101787.083088 
+285913.629115  9101827.277387 
+285919.018449  9101885.547974 
+285919.178007  9101907.648386 
+285917.495142  9101949.837737 
+285903.067699  9102016.121397 
+285895.429628  9102059.308285 
+285837.792253  9102196.864455 
+285817.315173  9102251.086320 
+285770.398397  9102359.523017 
+285737.241717  9102446.880275 
+285728.471972  9102470.979275 
+285704.121201  9102539.260361 
+285652.438228  9102675.819020 
+285646.584438  9102690.880456 
+285596.859736  9102823.423209 
+285590.026656  9102840.492603 
+285572.472436  9102886.681479 
+285541.266479  9102969.018275 
+285497.322698  9103076.453945 
+285489.524793  9103097.540428 
+285468.923865  9103134.684688 
+285428.766441  9103216.006340 
+285416.035872  9103242.109774 
+285382.653500  9103298.325496 
+285333.602574  9103386.668510 
+285301.184808  9103438.867126 
+285287.525574  9103474.010479 
+285280.786545  9103504.139242 
+285279.843498  9103511.170032 
+285278.015384  9103533.268149 
+285278.276302  9103569.432558 
+285284.557904  9103613.640564 
+285288.634509  9103627.709207 
+285318.193624  9103730.209124 
+285323.307542  9103750.306334 
+285329.553005  9103789.491481 
+285328.791229  9103821.636434 
+285326.897912  9103834.693448 
+285302.408495  9103883.887832 
+285279.834113  9103923.038897 
+285218.944074  9104023.422674 
+285200.279499  9104053.537332 
+285182.673933  9104092.694269 
+285146.396452  9104160.961292 
+285110.089887  9104225.210040 
+285086.601141  9104275.410149 
+285079.992440  9104323.621149 
+285080.115652  9104340.698799 
+285083.314488  9104370.839360 
+285096.654299  9104429.119581 
+285115.949726  9104486.402278 
+285139.147930  9104533.643984 
+285167.373222  9104588.928075 
+285217.607364  9104664.329278 
+285261.820818  9104731.686821 
+285276.611850  9104715.631332 
+285286.448351  9104701.579117 
+285309.226085  9104690.555823 
+285322.080262  9104681.529947 
+285374.367365  9104628.349969 
+285418.914372  9104604.293010 
+285439.711665  9104594.271896 
+285456.599056  9104593.287191 
+285476.504143  9104597.328810 
+285508.429229  9104614.443770 
+285525.381953  9104622.500123 
+285540.288998  9104622.517617 
+285561.108039  9104615.510146 
+285606.648691  9104591.454193 
+285633.154575  9104546.280233 
+285672.550759  9104497.103143 
+285702.052454  9104453.941790 
+285721.783165  9104433.873773 
+285738.539730  9104414.806826 
+285766.068251  9104373.652259 
+285791.710828  9104346.559254 
+285817.266205  9104307.411479 
+285871.430866  9104239.165029 
+285875.376977  9104235.151419 
+285899.068157  9104213.078880 
+285920.771731  9104191.004013 
+285953.392449  9104166.932769 
+286008.819425  9104135.856216 
+286065.283713  9104110.808143 
+286122.683554  9104077.724674 
+286138.467839  9104061.670177 
+286149.304988  9104048.623585 
+286168.933534  9104014.491592 
+286176.847470  9104009.478025 
+286187.735491  9104003.463361 
+286190.709578  9104002.462264 
+286205.587279  9103998.461339 
+286224.367404  9103984.419412 
+286233.144226  9103961.324886 
+286241.935584  9103940.239483 
+286295.822825  9103833.819443 
+286312.440758  9103795.665727 
+286340.802209  9103732.411823 
+286383.120119  9103675.201418 
+286409.843003  9103660.164115 
+286423.719510  9103655.157436 
+286462.462252  9103653.193210 
+286494.277649  9103655.239143 
+286543.981017  9103657.305736 
+286608.525512  9103650.348451 
+286681.056565  9103648.423042 
+286695.941353  9103645.426551 
+286707.852094  9103643.431179 
+286728.684964  9103638.432432 
+286765.432784  9103635.461102 
+286801.230510  9103638.515951 
+286839.965859  9103635.546848 
+286912.511357  9103635.630188 
+286934.396234  9103638.668954 
+286953.321648  9103644.717963 
+286973.262698  9103653.781775 
+287005.158189  9103666.877470 
+287043.067354  9103687.011865 
+287073.011774  9103705.128012 
+287106.975053  9103729.276018 
+287126.967190  9103745.371641 
+287172.899576  9103775.560544 
+287189.895844  9103789.643613 
+287204.889986  9103801.715294 
+287215.865275  9103807.755098 
+287232.817810  9103815.810808 
+287249.784936  9103825.875622 
+287281.695183  9103840.980183 
+287340.641691  9103884.242793 
+287361.532896  9103887.280185 
+287399.311010  9103889.332203 
+287422.138685  9103885.339937 
+287449.964427  9103885.371519 
+287583.937314  9103449.550384 
+287619.340618  9103398.358677 
+287635.329508  9103273.813112 
+287656.046333  9103116.122905 
+287657.010898  9103112.105816 
+287676.682869  9102947.382618 
+287691.714476  9102827.858726 
+287700.286058  9102776.636620 
+287704.034836  9102745.499956 
+287710.764861  9102714.366677 
+287718.517820  9102687.252743 
+287732.240557  9102661.150130 
+287751.911168  9102633.045173 
+287791.354501  9102590.899002 
+287817.981264  9102562.801920 
+287877.102254  9102493.555291 
+287917.517193  9102448.396528 
+288030.862742  9102319.943016 
+288124.515553  9102216.580738 
+288176.708726  9102151.344275 
+288228.930977  9102090.125992 
+288272.289881  9102039.947673 
+288287.100863  9102026.905290 
+288309.854371  9102012.867299 
+288455.304015  9101926.640120 
+288476.077262  9101913.604388 
+288479.043824  9101911.598633 
+288521.445094  9101866.441809 
+288558.848410  9101817.261197 
+288620.049822  9101761.075435 
+288659.586656  9101731.987995 
+288733.910994  9101703.943960 
+288804.304230  9101681.922679 
+288986.709479  9101621.853507 
+Region 1
+81
+288851.902593  9103304.307533 
+288848.635605  9103265.126880 
+288854.642094  9103271.160763 
+288857.432879  9103245.045827 
+288851.563050  9103121.480974 
+288851.533749  9103117.462784 
+288835.658341  9102848.228573 
+288834.400957  9102812.063748 
+288823.956163  9102606.121492 
+288818.130865  9102488.583848 
+288814.981270  9102465.475928 
+288810.947754  9102457.435123 
+288802.895368  9102443.362609 
+288744.892650  9102393.071050 
+288665.882592  9102323.669677 
+288648.879347  9102308.582588 
+288578.871698  9102247.227370 
+288505.875723  9102184.864106 
+288351.868741  9102051.087180 
+288341.865661  9102042.035049 
+288309.854371  9102012.867299 
+288287.100863  9102026.905290 
+288272.289881  9102039.947673 
+288228.930977  9102090.125992 
+288176.708726  9102151.344275 
+288124.515553  9102216.580738 
+288030.862742  9102319.943016 
+287917.517193  9102448.396528 
+287877.102254  9102493.555291 
+287817.981264  9102562.801920 
+287791.354501  9102590.899002 
+287751.911168  9102633.045173 
+287732.240557  9102661.150130 
+287718.517820  9102687.252743 
+287710.764861  9102714.366677 
+287704.034836  9102745.499956 
+287700.286058  9102776.636620 
+287691.714476  9102827.858726 
+287676.682869  9102947.382618 
+287657.010898  9103112.105816 
+287656.046333  9103116.122905 
+287635.329508  9103273.813112 
+287619.340618  9103398.358677 
+287583.937314  9103449.550384 
+287449.964427  9103885.371519 
+287491.703033  9103885.418859 
+287550.335821  9103885.485295 
+287585.117974  9103885.524670 
+287637.773475  9103883.575136 
+287655.610312  9103876.563478 
+287715.229508  9103875.626271 
+287782.937685  9103893.784455 
+287824.902734  9103924.972620 
+287834.898944  9103933.020232 
+287880.992640  9103985.308404 
+287922.146799  9104041.609129 
+287956.359243  9104099.911088 
+288042.232956  9104019.643908 
+288098.556406  9103975.507101 
+288124.167829  9103944.394939 
+288134.887244  9103915.275191 
+288133.798393  9103902.214914 
+288131.123396  9103807.784879 
+288147.666467  9103759.585342 
+288183.105747  9103713.416045 
+288208.724308  9103683.308431 
+288211.676355  9103679.293563 
+288246.326559  9103661.250551 
+288294.969937  9103654.273116 
+288564.368420  9103666.627722 
+288645.886483  9103670.736372 
+288681.603436  9103662.739650 
+288690.503372  9103656.722273 
+288734.016576  9103627.638816 
+288775.424972  9103582.480365 
+288827.596141  9103514.229389 
+288842.282738  9103484.109447 
+288851.094688  9103466.037481 
+288857.875151  9103441.936033 
+288857.391566  9103375.635902 
+288851.902593  9103304.307533 
+Region 1
+235
+290515.118603  9102855.082557 
+290484.997347  9102812.859963 
+290441.214057  9102804.776733 
+290413.227542  9102782.646987 
+290399.131283  9102757.518553 
+290359.823818  9102682.136408 
+290296.402148  9102570.565054 
+290257.227435  9102513.264461 
+290216.109484  9102461.988904 
+290140.999030  9102382.549584 
+290132.975700  9102372.495567 
+290048.775054  9102272.955501 
+289984.669665  9102203.573053 
+289937.729530  9102171.376914 
+289829.996035  9102115.005610 
+289799.073118  9102098.899309 
+289760.156387  9102076.757037 
+289712.156742  9102035.518614 
+289672.070279  9101989.266106 
+289633.919991  9101935.983912 
+289619.831829  9101911.859603 
+289595.476406  9101842.519894 
+289574.465258  9101686.793701 
+289562.903745  9101600.390864 
+289531.064837  9101458.716179 
+289500.920469  9101276.861807 
+289496.784393  9101254.757434 
+289491.478722  9101208.542881 
+289489.352062  9101189.454332 
+289489.322747  9101185.436151 
+289457.206246  9101005.588542 
+289453.055595  9100981.475060 
+289432.280475  9100857.893990 
+289414.618481  9100752.398000 
+289404.139528  9100678.050608 
+289270.830634  9100656.807416 
+289275.317893  9100727.130086 
+289199.679822  9100710.973408 
+289223.376689  9100826.521698 
+289176.753342  9100837.519797 
+289127.126906  9100845.500892 
+289106.332386  9100855.523131 
+289082.564072  9100866.546588 
+289052.914025  9100888.613414 
+289051.065651  9100907.697604 
+289021.481413  9100938.805348 
+288871.688226  9100973.796982 
+288891.343931  9101080.300223 
+288921.449008  9101257.132890 
+288930.772869  9101309.379367 
+288963.925484  9101495.256167 
+288981.631093  9101606.779766 
+288986.709479  9101621.853507 
+288804.304230  9101681.922679 
+288733.910994  9101703.943960 
+288659.586656  9101731.987995 
+288620.049822  9101761.075435 
+288558.848410  9101817.261197 
+288521.445094  9101866.441809 
+288479.043824  9101911.598633 
+288476.077262  9101913.604388 
+288455.304015  9101926.640120 
+288309.854371  9102012.867299 
+288341.865661  9102042.035049 
+288351.868741  9102051.087180 
+288505.875723  9102184.864106 
+288578.871698  9102247.227370 
+288648.879347  9102308.582588 
+288665.882592  9102323.669677 
+288744.892650  9102393.071050 
+288802.895368  9102443.362609 
+288810.947754  9102457.435123 
+288814.981270  9102465.475928 
+288818.130865  9102488.583848 
+288823.956163  9102606.121492 
+288834.400957  9102812.063748 
+288835.658341  9102848.228573 
+288851.533749  9103117.462784 
+288851.563050  9103121.480974 
+288857.432879  9103245.045827 
+288854.642094  9103271.160763 
+288848.635605  9103265.126880 
+288851.902593  9103304.307533 
+288857.391566  9103375.635902 
+288857.875151  9103441.936033 
+288851.094688  9103466.037481 
+288842.282738  9103484.109447 
+288827.596141  9103514.229389 
+288775.424972  9103582.480365 
+288734.016576  9103627.638816 
+288690.503372  9103656.722273 
+288681.603436  9103662.739650 
+288645.886483  9103670.736372 
+288564.368420  9103666.627722 
+288294.969937  9103654.273116 
+288246.326559  9103661.250551 
+288211.676355  9103679.293563 
+288208.724308  9103683.308431 
+288183.105747  9103713.416045 
+288147.666467  9103759.585342 
+288131.123396  9103807.784879 
+288133.798393  9103902.214914 
+288134.887244  9103915.275191 
+288124.167829  9103944.394939 
+288098.556406  9103975.507101 
+288042.232956  9104019.643908 
+287956.359243  9104099.911088 
+287976.498020  9104136.097257 
+288042.080948  9104271.784112 
+288091.610172  9104386.357428 
+288117.704622  9104421.545585 
+288148.665604  9104442.675551 
+288160.649563  9104450.725266 
+288212.487394  9104472.883008 
+288277.207878  9104490.032310 
+288316.133892  9104513.180078 
+288342.162687  9104539.327096 
+288355.264963  9104564.455192 
+288355.286930  9104567.468841 
+288364.465335  9104599.624362 
+288374.747394  9104646.849222 
+288378.986190  9104683.017414 
+288383.217677  9104718.181054 
+288383.994033  9104824.663286 
+288401.196148  9104866.873085 
+288411.302562  9104889.988729 
+288430.506982  9104934.209802 
+288430.594896  9104946.264391 
+288433.073353  9105013.571374 
+288427.564827  9105075.846811 
+288429.108154  9105151.189082 
+288439.383218  9105197.409322 
+288450.520207  9105225.548774 
+288494.738505  9105292.901835 
+288538.949620  9105359.250272 
+288568.866360  9105373.346808 
+288591.716507  9105372.367441 
+288629.554361  9105382.454495 
+288664.315474  9105379.479117 
+288687.165610  9105378.499701 
+288712.084032  9105388.572477 
+288720.056462  9105391.594853 
+288742.943274  9105395.638142 
+288780.663768  9105389.652306 
+288791.588261  9105388.659751 
+288815.461535  9105391.699546 
+288832.385529  9105395.736251 
+288847.292568  9105395.752585 
+288862.199605  9105395.768914 
+288877.158012  9105402.817063 
+288900.994592  9105400.834077 
+288934.798549  9105402.880134 
+288959.768393  9105419.984578 
+288983.641674  9105423.024276 
+289015.480058  9105428.081733 
+289047.347815  9105437.157347 
+289066.259432  9105441.196122 
+289087.217404  9105453.273418 
+289105.201322  9105466.351998 
+289125.246303  9105489.478182 
+289141.294055  9105509.586392 
+289157.400588  9105537.730950 
+289168.494045  9105559.842826 
+289170.511038  9105563.863166 
+289183.599467  9105586.981741 
+289198.719604  9105616.129735 
+289207.781411  9105632.212165 
+289215.842071  9105647.288967 
+289231.934019  9105673.424386 
+289249.027143  9105700.565417 
+289254.062318  9105709.611706 
+289259.082798  9105716.648906 
+289263.109471  9105723.685027 
+289297.266428  9105773.948859 
+289308.293877  9105787.019773 
+289322.390971  9105812.148437 
+289324.407993  9105816.168764 
+289338.541866  9105846.320137 
+289347.692004  9105874.457037 
+289361.862680  9105909.631112 
+289376.961020  9105935.765359 
+289395.990507  9105955.876632 
+289413.982077  9105969.959561 
+289429.993386  9105985.044876 
+289446.004706  9106000.130184 
+289471.939456  9106013.217116 
+289493.884254  9106024.290659 
+289568.273065  9106004.280090 
+289723.999719  9105963.261552 
+289764.731221  9105961.296175 
+289783.532632  9105950.266462 
+289806.323995  9105941.250085 
+289818.212895  9105936.240155 
+289858.833895  9105919.206586 
+289933.288522  9105908.236354 
+289940.237814  9105907.239248 
+290001.780240  9105897.259644 
+290089.286864  9105904.384670 
+290219.637743  9105926.623019 
+290225.607957  9105927.633892 
+290196.276674  9105587.066634 
+290163.016235  9105388.133968 
+290145.812304  9105345.925289 
+290102.298393  9105239.398456 
+290049.163466  9105176.056121 
+289972.104115  9105102.642718 
+289866.247209  9105032.211781 
+289832.141989  9104988.980172 
+289827.128902  9104982.947578 
+289787.841490  9104910.578861 
+289763.210927  9104804.071727 
+289751.404105  9104684.519443 
+289764.552214  9104580.062091 
+289791.429354  9104450.506216 
+289876.806671  9104302.931865 
+289897.396401  9104264.781790 
+290000.396109  9104081.063175 
+290127.871260  9103847.144197 
+290140.407539  9103794.921987 
+290145.229180  9103774.836523 
+290109.697186  9103672.335980 
+290088.386919  9103612.041070 
+290090.912140  9103549.762758 
+290114.232644  9103477.461525 
+290158.627856  9103433.309903 
+290298.224347  9103362.138216 
+290370.458926  9103320.025406 
+290398.114579  9103296.950836 
+290416.649811  9103249.757734 
+290437.040042  9103048.873350 
+290448.670525  9103008.704574 
+290499.999071  9102961.546632 
+290523.443933  9102906.322551 
+290517.223856  9102871.157307 
+290515.118603  9102855.082557 
+Region 1
+379
+292413.648094  9104137.840727 
+292406.580644  9104122.765692 
+292393.469157  9104096.634745 
+292380.350279  9104069.499263 
+292370.271956  9104050.403051 
+292358.176499  9104027.286686 
+292338.093988  9103999.139524 
+292320.970540  9103967.981819 
+292309.854076  9103942.857391 
+292298.670965  9103908.692199 
+292284.588094  9103885.573755 
+292275.481399  9103863.464935 
+292241.279185  9103807.176592 
+292234.197056  9103790.092444 
+292224.074452  9103764.968993 
+292213.988883  9103744.868184 
+292207.863508  9103722.762403 
+292197.755748  9103699.647997 
+292196.732387  9103695.628857 
+292185.653105  9103675.527010 
+292172.593743  9103656.427640 
+292160.550347  9103640.342877 
+292148.484754  9103621.244519 
+292138.354853  9103595.116498 
+292130.256863  9103575.017701 
+292119.170249  9103553.911294 
+292109.106993  9103536.824027 
+292104.005064  9103518.737357 
+292100.861028  9103496.634619 
+292098.769940  9103482.569146 
+292092.629886  9103458.454265 
+292078.510307  9103430.313044 
+292069.374254  9103404.186013 
+292057.249594  9103377.051363 
+292045.206331  9103360.966540 
+292042.195517  9103356.945333 
+292032.124950  9103338.853500 
+292018.035050  9103314.730363 
+292008.936054  9103293.625957 
+291993.808067  9103263.474593 
+291986.696574  9103242.372237 
+291977.538448  9103213.231572 
+291969.396261  9103187.105524 
+291962.218243  9103156.962381 
+291956.107924  9103136.865575 
+291955.084609  9103132.846419 
+291945.985697  9103111.741984 
+291939.875396  9103091.645172 
+291931.748057  9103067.528169 
+291916.612835  9103036.372214 
+291902.471371  9103005.217282 
+291882.404496  9102979.078795 
+291864.362070  9102957.965019 
+291845.318538  9102935.845665 
+291827.246586  9102910.713739 
+291811.199069  9102890.606532 
+291799.148661  9102873.517057 
+291783.108562  9102854.414365 
+291771.036009  9102834.311281 
+291760.973095  9102817.223863 
+291754.914663  9102804.158720 
+291752.882872  9102798.129451 
+291740.795576  9102776.017287 
+291725.601519  9102736.824952 
+291713.469936  9102708.685579 
+291703.311053  9102678.539212 
+291692.173233  9102650.400865 
+291682.051316  9102625.277150 
+291671.922027  9102599.148897 
+291659.820073  9102575.027622 
+291650.728848  9102554.927596 
+291635.660517  9102532.812251 
+291618.575219  9102506.676680 
+291596.536093  9102482.544950 
+291572.502162  9102457.406584 
+291545.464945  9102429.251465 
+291529.447282  9102413.162218 
+291527.437693  9102410.146528 
+291503.389080  9102382.999038 
+291478.309876  9102350.827813 
+291462.255369  9102329.715859 
+291450.146243  9102304.589948 
+291435.998045  9102272.430196 
+291428.901820  9102253.336714 
+291420.774995  9102229.219511 
+291419.759143  9102226.204860 
+291401.599244  9102189.018221 
+291392.500866  9102167.913559 
+291379.435006  9102147.809231 
+291352.316985  9102108.604040 
+291332.243526  9102081.460593 
+291315.188112  9102059.342960 
+291304.154001  9102045.267906 
+291297.124253  9102035.215195 
+291282.071053  9102015.108715 
+291272.001186  9101997.016559 
+291253.893143  9101966.861553 
+291233.782957  9101934.695356 
+291217.684512  9101907.556037 
+291195.631187  9101881.414914 
+291181.601286  9101865.327573 
+291168.550368  9101847.232210 
+291153.497299  9101827.125657 
+291139.386372  9101799.988400 
+291126.291281  9101775.865800 
+291115.154152  9101747.727162 
+291102.059094  9101723.604547 
+291096.008426  9101711.543766 
+291086.939798  9101694.457128 
+291067.867794  9101668.319072 
+291048.788447  9101641.176467 
+291036.657709  9101613.036730 
+291025.513331  9101583.893508 
+291015.311123  9101547.719584 
+291006.154195  9101518.578472 
+290995.009873  9101489.435232 
+290985.889798  9101465.316794 
+290975.753941  9101438.183678 
+290969.644454  9101418.086565 
+290963.505522  9101393.971301 
+290952.339189  9101361.814424 
+290948.261308  9101347.746652 
+290944.190792  9101334.683416 
+290936.086579  9101313.579627 
+290924.986552  9101290.463569 
+290913.864455  9101264.333892 
+290906.746615  9101242.226618 
+290897.626665  9101218.108136 
+290893.512022  9101199.017664 
+290891.443663  9101187.965620 
+290887.277508  9101161.843382 
+290885.135555  9101140.745961 
+290876.928393  9101105.578618 
+290869.810614  9101083.471326 
+290859.601377  9101046.292765 
+290842.509882  9101019.152107 
+290823.453094  9100995.022916 
+290808.349033  9100967.884370 
+290796.240786  9100942.758096 
+290789.123089  9100920.650775 
+290779.981237  9100893.518621 
+290771.847802  9100868.396608 
+290767.674434  9100841.269794 
+290754.587279  9100818.151501 
+290737.525377  9100795.028919 
+290728.442431  9100775.933049 
+290724.379421  9100763.874301 
+290718.292266  9100746.790717 
+290712.138934  9100720.666282 
+290699.000382  9100690.516185 
+290682.910199  9100664.381018 
+290674.806296  9100643.277119 
+290665.664605  9100616.144909 
+290659.540746  9100594.038610 
+290654.410581  9100571.933382 
+290645.268926  9100544.801161 
+290633.197686  9100524.697487 
+290616.077183  9100493.538500 
+290597.006089  9100467.400048 
+290577.920320  9100439.252502 
+290566.835481  9100418.145332 
+290556.773729  9100401.057392 
+290548.662611  9100378.948903 
+290539.579864  9100359.852953 
+290535.546356  9100351.812325 
+290525.433206  9100327.692592 
+290514.289654  9100298.549075 
+290503.131428  9100267.396472 
+290492.930172  9100231.222240 
+290482.817085  9100207.102484 
+290480.785655  9100201.073084 
+290471.629538  9100171.931700 
+290461.413656  9100133.748368 
+290452.286952  9100108.625135 
+290445.154957  9100084.508599 
+290436.020935  9100058.380817 
+290428.955053  9100043.305140 
+290418.856751  9100021.194431 
+290407.742758  9099996.069013 
+290395.583711  9099963.910722 
+290387.399378  9099931.756753 
+290375.247714  9099900.602988 
+290366.055064  9099866.438844 
+290360.939889  9099846.342604 
+290352.807005  9099821.220405 
+290346.705515  9099802.127617 
+290339.529622  9099771.983790 
+290332.353744  9099741.839959 
+290324.184212  9099711.695038 
+290318.024048  9099684.565909 
+290306.858866  9099652.408639 
+290292.705368  9099619.243562 
+290282.511883  9099584.073739 
+290273.407470  9099561.964039 
+290263.236034  9099529.807830 
+290250.083626  9099497.648350 
+290237.924904  9099465.489951 
+290227.768202  9099435.342805 
+290215.668204  9099411.220727 
+290204.532544  9099383.081563 
+290191.431583  9099357.953840 
+290189.407589  9099352.928949 
+290177.248972  9099320.770511 
+290160.122078  9099288.606610 
+290144.982532  9099256.444879 
+290129.857676  9099226.292223 
+290112.745528  9099196.137371 
+290100.623687  9099169.001602 
+290085.542885  9099144.876173 
+290082.525261  9099139.850177 
+290073.435741  9099119.749474 
+290053.335387  9099088.586754 
+290032.226750  9099055.413836 
+290019.104029  9099027.272384 
+290003.986691  9098998.124188 
+289993.852300  9098970.990552 
+289980.722310  9098941.844532 
+289970.587953  9098914.710884 
+289954.440416  9098880.538837 
+289946.322703  9098857.425547 
+289942.260187  9098845.366628 
+289935.165443  9098826.272606 
+289925.980854  9098793.112769 
+289920.858780  9098772.011851 
+289913.742090  9098749.904188 
+289906.640058  9098729.805610 
+289895.446258  9098693.629924 
+289884.274453  9098660.467862 
+289874.191516  9098640.365970 
+289857.079838  9098610.210920 
+289845.024281  9098592.115901 
+289828.920936  9098563.971021 
+289819.802413  9098539.852029 
+289809.646333  9098509.704661 
+289798.481987  9098477.547095 
+289790.342511  9098451.420102 
+289772.186106  9098414.232068 
+289763.082300  9098392.122138 
+289750.982943  9098367.999799 
+289740.878202  9098344.884210 
+289725.732092  9098311.717633 
+289716.621022  9098288.603138 
+289708.510921  9098266.494290 
+289698.428187  9098246.392315 
+289689.273252  9098217.250534 
+289677.108156  9098184.087242 
+289667.997151  9098160.972724 
+289655.839410  9098128.813964 
+289644.777736  9098110.719946 
+289631.655655  9098082.578247 
+289619.600370  9098064.483108 
+289610.533314  9098047.395839 
+289596.468840  9098026.284832 
+289332.885287  9098125.438904 
+289365.339520  9098215.883845 
+289284.080234  9098245.928812 
+289261.591736  9098159.513143 
+289156.506968  9098192.544702 
+289169.694575  9098229.727537 
+289250.895809  9098464.881147 
+289321.810732  9098651.804990 
+289048.330110  9098756.974515 
+289066.588471  9098808.226626 
+289078.753435  9098841.390140 
+288997.492793  9098871.434886 
+289043.135206  9098999.062905 
+289065.499900  9099068.401330 
+289082.728291  9099114.629534 
+289108.899692  9099160.867761 
+289043.522556  9099188.921460 
+288960.266663  9099217.959504 
+288941.474699  9099229.992840 
+288928.666631  9099245.046532 
+288910.744128  9099240.003642 
+288879.925890  9099237.959834 
+288866.021876  9099238.948701 
+288847.193352  9099245.959258 
+288805.598128  9099264.998613 
+288765.018434  9099287.052711 
+288736.464927  9099323.183957 
+288715.700106  9099337.224077 
+288643.490759  9099382.346802 
+288609.815460  9099397.376816 
+288622.221263  9099463.690660 
+288634.780431  9099551.100050 
+288657.882476  9099721.898330 
+288702.414563  9099970.070428 
+288748.036145  9100231.302602 
+288791.568906  9100478.468654 
+288821.767660  9100668.360759 
+288824.909594  9100690.464177 
+288853.968890  9100860.264089 
+288858.185020  9100893.418644 
+288861.297762  9100911.503855 
+288871.688226  9100973.796982 
+289021.481413  9100938.805348 
+289051.065651  9100907.697604 
+289052.914025  9100888.613414 
+289082.564072  9100866.546588 
+289106.332386  9100855.523131 
+289127.126906  9100845.500892 
+289176.753342  9100837.519797 
+289223.376689  9100826.521698 
+289199.679822  9100710.973408 
+289275.317893  9100727.130086 
+289270.830634  9100656.807416 
+289404.139528  9100678.050608 
+289414.618481  9100752.398000 
+289432.280475  9100857.893990 
+289453.055595  9100981.475060 
+289457.206246  9101005.588542 
+289489.322747  9101185.436151 
+289489.352062  9101189.454332 
+289491.478722  9101208.542881 
+289496.784393  9101254.757434 
+289500.920469  9101276.861807 
+289531.064837  9101458.716179 
+289562.903745  9101600.390864 
+289574.465258  9101686.793701 
+289595.476406  9101842.519894 
+289619.831829  9101911.859603 
+289633.919991  9101935.983912 
+289672.070279  9101989.266106 
+289712.156742  9102035.518614 
+289760.156387  9102076.757037 
+289799.073118  9102098.899309 
+289829.996035  9102115.005610 
+289937.729530  9102171.376914 
+289984.669665  9102203.573053 
+290048.775054  9102272.955501 
+290132.975700  9102372.495567 
+290140.999030  9102382.549584 
+290216.109484  9102461.988904 
+290257.227435  9102513.264461 
+290296.402148  9102570.565054 
+290359.823818  9102682.136408 
+290399.131283  9102757.518553 
+290413.227542  9102782.646987 
+290441.214057  9102804.776733 
+290484.997347  9102812.859963 
+290515.118603  9102855.082557 
+290517.223856  9102871.157307 
+290549.119167  9102884.250371 
+290582.876802  9102880.268381 
+290615.751139  9102891.353378 
+290640.933333  9102937.588685 
+290655.184453  9102983.812294 
+290663.664671  9103056.147511 
+290688.987004  9103121.468972 
+290694.309318  9103169.692079 
+290678.954557  9103244.010919 
+290673.463571  9103308.294977 
+290689.584544  9103338.448048 
+290714.524010  9103351.533493 
+290748.252467  9103343.533152 
+290818.572638  9103311.462978 
+290842.422539  9103311.488312 
+290904.012654  9103308.540089 
+290968.760948  9103329.703808 
+291015.636609  9103352.857572 
+291033.560911  9103357.899169 
+291053.376820  9103349.883896 
+291079.979281  9103318.771649 
+291099.640252  9103289.661117 
+291121.443602  9103281.647923 
+291160.074180  9103264.611730 
+291170.983220  9103261.609657 
+291206.898164  9103280.733543 
+291219.875860  9103288.783436 
+291368.955032  9103426.560353 
+291487.014703  9103535.172871 
+291684.076363  9103711.170420 
+291720.050979  9103738.330012 
+291781.441687  9103708.258108 
+291889.548218  9103949.455882 
+291947.161563  9104081.107990 
+292043.197062  9104302.202033 
+292253.192882  9104210.001888 
+292413.648094  9104137.840727 
+Region 1
+174
+292732.113989  9105142.683814 
+292714.018168  9105114.539012 
+292690.115585  9105107.483213 
+292680.096182  9105096.423374 
+292674.934337  9105070.300666 
+292676.714081  9105042.175945 
+292682.483766  9105016.064299 
+292682.275964  9104987.937566 
+292676.090688  9104957.795744 
+292669.920266  9104929.662971 
+292664.795571  9104908.562886 
+292662.555733  9104874.406978 
+292653.404031  9104846.271176 
+292644.289444  9104823.158001 
+292637.192084  9104804.064944 
+292629.034192  9104775.930137 
+292623.820525  9104742.775718 
+292617.583430  9104705.602182 
+292610.463857  9104683.495532 
+292602.343109  9104660.383344 
+292594.207537  9104635.262098 
+292583.061012  9104606.119711 
+292572.930520  9104579.991909 
+292563.778975  9104551.856058 
+292550.615311  9104518.693522 
+292540.470037  9104490.556648 
+292533.291238  9104460.413750 
+292529.130812  9104435.296521 
+292521.010179  9104412.184296 
+292512.882141  9104388.067539 
+292502.774008  9104364.953280 
+292490.670954  9104340.832462 
+292488.631540  9104333.798742 
+292481.534368  9104314.705623 
+292471.396624  9104287.573238 
+292460.242900  9104257.426250 
+292447.064620  9104222.254587 
+292436.867637  9104187.085960 
+292420.722960  9104153.920288 
+292413.648094  9104137.840727 
+292253.192882  9104210.001888 
+292043.197062  9104302.202033 
+291947.161563  9104081.107990 
+291889.548218  9103949.455882 
+291781.441687  9103708.258108 
+291720.050979  9103738.330012 
+291684.076363  9103711.170420 
+291487.014703  9103535.172871 
+291368.955032  9103426.560353 
+291219.875860  9103288.783436 
+291206.898164  9103280.733543 
+291170.983220  9103261.609657 
+291160.074180  9103264.611730 
+291121.443602  9103281.647923 
+291099.640252  9103289.661117 
+291079.979281  9103318.771649 
+291053.376820  9103349.883896 
+291033.560911  9103357.899169 
+291015.636609  9103352.857572 
+290968.760948  9103329.703808 
+290904.012654  9103308.540089 
+290842.422539  9103311.488312 
+290818.572638  9103311.462978 
+290748.252467  9103343.533152 
+290714.524010  9103351.533493 
+290689.584544  9103338.448048 
+290673.463571  9103308.294977 
+290678.954557  9103244.010919 
+290694.309318  9103169.692079 
+290688.987004  9103121.468972 
+290663.664671  9103056.147511 
+290655.184453  9102983.812294 
+290640.933333  9102937.588685 
+290615.751139  9102891.353378 
+290582.876802  9102880.268381 
+290549.119167  9102884.250371 
+290517.223856  9102871.157307 
+290523.443933  9102906.322551 
+290499.999071  9102961.546632 
+290448.670525  9103008.704574 
+290437.040042  9103048.873350 
+290416.649811  9103249.757734 
+290398.114579  9103296.950836 
+290370.458926  9103320.025406 
+290298.224347  9103362.138216 
+290158.627856  9103433.309903 
+290114.232644  9103477.461525 
+290090.912140  9103549.762758 
+290088.386919  9103612.041070 
+290109.697186  9103672.335980 
+290145.229180  9103774.836523 
+290140.407539  9103794.921987 
+290127.871260  9103847.144197 
+290000.396109  9104081.063175 
+289897.396401  9104264.781790 
+289876.806671  9104302.931865 
+289791.429354  9104450.506216 
+289764.552214  9104580.062091 
+289751.404105  9104684.519443 
+289763.210927  9104804.071727 
+289787.841490  9104910.578861 
+289827.128902  9104982.947578 
+289832.141989  9104988.980172 
+289866.247209  9105032.211781 
+289972.104115  9105102.642718 
+290049.163466  9105176.056121 
+290102.298393  9105239.398456 
+290145.812304  9105345.925289 
+290163.016235  9105388.133968 
+290196.276674  9105587.066634 
+290225.607957  9105927.633892 
+290473.301828  9105960.041231 
+290627.651772  9106002.394234 
+290970.215508  9106097.179104 
+291108.458112  9106111.386671 
+291256.365121  9106088.436380 
+291295.079142  9106082.449408 
+291472.385515  9106003.275575 
+291809.165648  9105987.550155 
+291857.706269  9105966.504984 
+291877.648936  9105975.566133 
+291879.636535  9105975.568171 
+291905.527186  9105982.626357 
+291977.955957  9105966.628144 
+291992.855527  9105965.638860 
+292067.627634  9105997.859940 
+292110.309087  9105990.871837 
+292123.191396  9105985.862366 
+292130.214717  9105994.910216 
+292142.140300  9105994.922371 
+292148.058601  9105988.901275 
+292151.025166  9105986.895256 
+292155.971912  9105983.886733 
+292161.934701  9105983.892808 
+292161.956947  9105986.906393 
+292165.969217  9105991.933085 
+292170.982702  9105997.965316 
+292175.009806  9106005.001063 
+292179.022079  9106010.027752 
+292185.029367  9106016.060993 
+292195.011852  9106022.098278 
+292204.935007  9106020.099335 
+292213.827280  9106013.076738 
+292223.720764  9106007.059679 
+292230.669936  9106006.062226 
+292239.614120  9106006.071322 
+292244.612781  9106010.094487 
+292246.630047  9106014.114619 
+292251.613874  9106016.128727 
+292271.519514  9106020.167038 
+292290.498122  9106033.245080 
+292309.365457  9106031.255197 
+292332.200563  9106028.264812 
+292344.200338  9106038.322185 
+292369.616152  9105981.090329 
+292383.336386  9105954.986726 
+292396.099912  9105933.904751 
+292415.656744  9105890.730228 
+292460.317509  9105748.133711 
+292462.853650  9105687.865112 
+292502.983091  9105604.530664 
+292503.947196  9105600.513564 
+292511.645189  9105566.367706 
+292517.444653  9105544.274157 
+292528.109151  9105508.122268 
+292592.808364  9105387.645490 
+292606.402185  9105344.464936 
+292604.206817  9105316.336184 
+292581.631242  9105219.879497 
+292589.551793  9105215.869446 
+292614.344317  9105208.862924 
+292727.419771  9105179.846250 
+292726.344336  9105168.795462 
+292732.113989  9105142.683814 
+Region 1
+188
+293475.302915  9106999.770528 
+293490.023860  9106974.672175 
+293474.855912  9106939.499268 
+293424.040580  9106787.767597 
+293420.932539  9106770.687792 
+293411.772281  9106741.547845 
+293398.644254  9106713.408489 
+293390.537410  9106692.305685 
+293369.429177  9106660.140373 
+293351.369405  9106637.018688 
+293338.315908  9106618.924516 
+293321.257421  9106596.808316 
+293312.171727  9106577.713544 
+293309.011652  9106553.602062 
+293306.867719  9106532.505130 
+293303.700212  9106507.389124 
+293302.535206  9106484.284130 
+293298.373908  9106459.167137 
+293291.238655  9106435.051709 
+293285.052557  9106404.910130 
+293277.947096  9106384.812785 
+293275.922281  9106379.788202 
+293260.836656  9106355.664876 
+293244.772131  9106333.549599 
+293228.707624  9106311.434312 
+293215.624532  9106289.321979 
+293206.494330  9106264.200021 
+293192.372830  9106236.059550 
+293183.294734  9106217.969242 
+293175.180688  9106195.861828 
+293165.093935  9106175.761477 
+293164.893091  9106148.639355 
+293155.755524  9106122.512850 
+293139.735780  9106106.424641 
+293137.681249  9106097.381952 
+293134.618048  9106086.329226 
+293124.531348  9106066.228856 
+293115.416142  9106043.115902 
+293113.198012  9106011.973695 
+293101.108885  9105989.862283 
+293088.997464  9105964.737295 
+293088.915670  9105953.687536 
+293089.768182  9105934.602581 
+293081.646827  9105911.490601 
+293084.434882  9105885.375964 
+293069.357009  9105862.257030 
+293055.324984  9105846.170747 
+293043.243381  9105825.063825 
+293033.164236  9105805.967933 
+293021.075224  9105783.856476 
+293014.919225  9105757.732885 
+293004.832681  9105737.632456 
+292999.670492  9105711.509853 
+292990.473706  9105677.347073 
+292989.442759  9105672.323456 
+292981.314099  9105648.206909 
+292969.247464  9105629.108993 
+292962.127475  9105607.002482 
+292957.914544  9105574.853715 
+292951.773499  9105550.739146 
+292946.611387  9105524.616524 
+292934.440791  9105491.455243 
+292915.380604  9105467.327689 
+292892.323023  9105440.182551 
+292875.317299  9105425.097692 
+292860.306577  9105411.019348 
+292842.307093  9105395.933470 
+292823.343546  9105384.864683 
+292806.352718  9105371.788838 
+292797.267591  9105352.693844 
+292791.134112  9105329.583749 
+292788.983187  9105307.482186 
+292786.824842  9105284.376097 
+292780.661685  9105257.247895 
+292769.499949  9105226.096574 
+292741.473708  9105198.946293 
+292727.494006  9105189.891509 
+292727.419771  9105179.846250 
+292614.344317  9105208.862924 
+292589.551793  9105215.869446 
+292581.631242  9105219.879497 
+292604.206817  9105316.336184 
+292606.402185  9105344.464936 
+292592.808364  9105387.645490 
+292528.109151  9105508.122268 
+292517.444653  9105544.274157 
+292511.645189  9105566.367706 
+292503.947196  9105600.513564 
+292502.983091  9105604.530664 
+292462.853650  9105687.865112 
+292460.317509  9105748.133711 
+292415.656744  9105890.730228 
+292396.099912  9105933.904751 
+292383.336386  9105954.986726 
+292369.616152  9105981.090329 
+292344.200338  9106038.322185 
+292366.204887  9106057.430377 
+292373.176319  9106059.446483 
+292394.023830  9106056.454050 
+292411.007460  9106068.525488 
+292431.002184  9106084.618044 
+292444.107127  9106109.744291 
+292450.069924  9106109.750324 
+292454.045122  9106109.754345 
+292458.005474  9106107.749312 
+292480.877705  9106109.781479 
+292499.871245  9106124.868462 
+292522.765754  9106129.914185 
+292573.664861  9106159.096601 
+292619.491051  9106174.210575 
+292659.347033  9106188.313968 
+292661.334633  9106188.315969 
+292663.322233  9106188.317969 
+292666.311061  9106189.325495 
+292671.287490  9106190.335021 
+292674.276318  9106191.342547 
+292677.257718  9106191.345547 
+292680.246546  9106192.353072 
+292683.227947  9106192.356071 
+292689.213032  9106195.375646 
+292691.208061  9106196.382171 
+292694.189461  9106196.385170 
+292696.184490  9106197.391694 
+292700.174547  9106199.404743 
+292702.169576  9106200.411267 
+292705.158405  9106201.418790 
+292708.154663  9106203.430839 
+292710.157121  9106205.441888 
+292713.145951  9106206.449410 
+292718.152097  9106211.477032 
+292723.143386  9106214.495602 
+292725.145845  9106216.506651 
+292728.142105  9106218.518697 
+292731.138365  9106220.530744 
+292733.133395  9106221.537266 
+292735.135855  9106223.548314 
+292740.127146  9106226.566882 
+292744.117207  9106228.579925 
+292747.113469  9106230.591970 
+292750.102300  9106231.599490 
+292752.097331  9106232.606011 
+292759.083656  9106236.631097 
+292762.094778  9106240.652191 
+292820.989118  9106275.869390 
+292885.846348  9106311.092459 
+292922.840032  9106341.264974 
+292991.791602  9106392.564208 
+293028.956471  9106445.840643 
+293036.017222  9106459.910908 
+293043.975093  9106460.923356 
+293060.892077  9106463.953760 
+293067.915650  9106473.001400 
+293076.956589  9106486.069112 
+293089.928119  9106493.113637 
+293124.897271  9106518.261324 
+293138.877502  9106527.315865 
+293150.728760  9106517.282490 
+293193.700488  9106549.469670 
+293219.814785  9106586.662650 
+293263.750658  9106614.832633 
+293284.762027  9106633.939230 
+293300.856488  9106660.072548 
+293314.881461  9106675.154148 
+293326.881603  9106685.211166 
+293338.904086  9106698.281745 
+293353.159910  9106744.503502 
+293364.337539  9106777.663520 
+293381.597205  9106826.901764 
+293386.596047  9106830.924755 
+293390.615973  9106836.955808 
+293392.730203  9106854.034635 
+293394.762511  9106860.063725 
+293401.823459  9106874.133890 
+293407.868256  9106885.189507 
+293410.901828  9106892.224097 
+293416.909389  9106898.257106 
+293422.916952  9106904.290113 
+293423.955455  9106910.318220 
+293425.023753  9106920.364413 
+293427.108212  9106933.425149 
+293432.151764  9106943.475259 
+293436.186608  9106951.515346 
+293442.179283  9106955.539306 
+293447.185595  9106960.566807 
+293460.202011  9106973.638306 
+293464.214514  9106978.664825 
+293469.258081  9106988.714928 
+293475.302915  9106999.770528 
diff --git a/examples/data/BairrosRecife2.csv b/examples/data/BairrosRecife2.csv
old mode 100755
new mode 100644
index ca41f68..57808cb
--- a/examples/data/BairrosRecife2.csv
+++ b/examples/data/BairrosRecife2.csv
@@ -1,94 +1,94 @@
-261160605001;1;Recife;RECIFE
-261160605002;2;Santo Amaro;SANTO AMARO
-261160605003;3;Boa Vista;BOA VISTA
-261160605004;4;Soledade;SOLEDADE
-261160605005;5;Santo Antonio;SANTO ANTONIO
-261160605006;6;Paissandu;PAISSANDU
-261160605007;7;Ilha do Leite;ILHA DO LEITE
-261160605008;8;Coelhos;COELHOS
-261160605009;9;Ilha Joana Bezerra;ILHA JOANA BEZERRA
-261160605010;10;Cabanga;CABANGA
-261160605011;11;Sao Jose;SAO JOSE
-261160605012;12;Derby;DERBY
-261160605013;13;Gra�as;GRACAS
-261160605014;14;Jaqueira;JAQUEIRA
-261160605015;15;Aflitos;AFLITOS
-261160605016;16;Espinheiro;ESPINHEIRO
-261160605017;17;Rosarinho;ROSARINHO
-261160605018;18;Tamarineira;TAMARINEIRA
-261160605019;19;Peixinhos;PEIXINHOS
-261160605020;20;Campina do Barreto;CAMPINA DO BARRETO
-261160605021;21;Arruda;ARRUDA
-261160605022;22;Ponto de Parada;PONTO DE PARADA
-261160605023;23;Hipodromo;HIPODROMO
-261160605024;24;Campo Grande;CAMPO GRANDE
-261160605025;25;Encruzilhada;ENCRUZILHADA
-261160605026;26;Torreao;TORREAO
-261160605027;27;Passarinho;PASSARINHO
-261160605028;28;Dois Unidos;DOIS UNIDOS
-261160605029;29;Linha do Tiro;LINHA DO TIRO
-261160605030;30;Beberibe;BEBERIBE
-261160605031;31;Alto Santa Teresinha;ALTO SANTA TERESINHA
-261160605032;32;Porto da Madeira;PORTO DA MADEIRA
-261160605033;33;Cajueiro;CAJUEIRO
-261160605034;34;Fundao;FUNDAO
-261160605035;35;Agua Fria;AGUA FRIA
-261160605036;36;Bomba do Hemeterio;BOMBA DO HEMETERIO
-261160605037;37;Pau-Ferro;PAU-FERRO
-261160605038;38;Guabiraba;GUABIRABA
-261160605039;39;Sitio dos Pintos;SITIO DOS PINTOS
-261160605040;40;Dois Irmaos;DOIS IRMAOS
-261160605041;41;Brejo da Guabiraba;BREJO DA GUABIRABA
-261160605042;42;Corrego do Jenipa;CORREGO DO JENIPAPO
-261160605043;43;Apipucos;APIPUCOS
-261160605044;44;Macaxeira;MACAXEIRA
-261160605045;45;Nova Descoberta;NOVA DESCOBERTA
-261160605046;46;Brejo de Beberibe;BREJO DE BEBERIBE
-261160605047;47;Alto do Mandu;ALTO DO MANDU
-261160605048;48;Casa Amarela;CASA AMARELA
-261160605049;49;Vasco da Gama;VASCO DA GAMA
-261160605050;50;Alto Jose Bonifacio;ALTO JOSE BONIFACIO
-261160605051;51;Morro da Conceicao;MORRO DA CONCEICAO
-261160605052;52;Alto Jose do Pinho;ALTO JOSE DO PINHO
-261160605053;53;Mangabeira;MANGABEIRA
-261160605054;54;Parnamirim;PARNAMIRIM
-261160605055;55;Casa Forte;CASA FORTE
-261160605056;56;Santana;SANTANA
-261160605057;57;Po�o;POCO
-261160605058;58;Monteiro;MONTEIRO
-261160605059;59;Torre;TORRE
-261160605060;60;Cordeiro;CORDEIRO
-261160605061;61;Zumbi;ZUMBI
-261160605062;62;Madalena;MADALENA
-261160605063;63;Prado;PRADO
-261160605064;64;Ilha do Retiro;ILHA DO RETIRO
-261160605065;65;Bongi;BONGI
-261160605066;66;San Martin;SAN MARTIN
-261160605067;67;Mustardinha;MUSTARDINHA
-261160605068;68;Mangueira;MANGUEIRA
-261160605069;69;Varzea;VARZEA
-261160605070;70;Caxanga�;CAXANGA
-261160605071;71;Iputinga;IPUTINGA
-261160605072;72;Torroes;TORROES
-261160605073;73;Engenho do Meio;ENGENHO DO MEIO
-261160605074;74;Cidade Universitaria�;CIDADE UNIVERSITARIA
-261160605075;75;Afogados;AFOGADOS
-261160605076;76;Jiquia�;JIQUIA
-261160605077;77;Estancia;ESTANCIA
-261160605078;78;Areias;AREIAS
-261160605079;79;Ca�ote;CACOTE
-261160605080;80;Curado;CURADO
-261160605081;81;Toto;TOTO
-261160605082;82;Coqueiral;COQUEIRAL
-261160605083;83;Sancho;SANCHO
-261160605084;84;Tejipio;TEJIPIO
-261160605085;85;Jardim Sao Paulo;JARDIM SAO PAULO
-261160605086;86;Barro;BARRO
-261160605087;87;Cohab;COHAB
-261160605088;88;Jordao;JORDAO
-261160605089;89;Ibura;IBURA
-261160605090;90;Ipsep;IPSEP
-261160605091;91;Imbiribeira;IMBIRIBEIRA
-261160605092;92;Boa Viagem;BOA VIAGEM
-261160605093;93;Pina;PINA
-261160605094;94;Brasilia Teimosa;BRASILIA TEIMOSA
+261160605001;1;Recife;RECIFE
+261160605002;2;Santo Amaro;SANTO AMARO
+261160605003;3;Boa Vista;BOA VISTA
+261160605004;4;Soledade;SOLEDADE
+261160605005;5;Santo Antonio;SANTO ANTONIO
+261160605006;6;Paissandu;PAISSANDU
+261160605007;7;Ilha do Leite;ILHA DO LEITE
+261160605008;8;Coelhos;COELHOS
+261160605009;9;Ilha Joana Bezerra;ILHA JOANA BEZERRA
+261160605010;10;Cabanga;CABANGA
+261160605011;11;Sao Jose;SAO JOSE
+261160605012;12;Derby;DERBY
+261160605013;13;Gra�as;GRACAS
+261160605014;14;Jaqueira;JAQUEIRA
+261160605015;15;Aflitos;AFLITOS
+261160605016;16;Espinheiro;ESPINHEIRO
+261160605017;17;Rosarinho;ROSARINHO
+261160605018;18;Tamarineira;TAMARINEIRA
+261160605019;19;Peixinhos;PEIXINHOS
+261160605020;20;Campina do Barreto;CAMPINA DO BARRETO
+261160605021;21;Arruda;ARRUDA
+261160605022;22;Ponto de Parada;PONTO DE PARADA
+261160605023;23;Hipodromo;HIPODROMO
+261160605024;24;Campo Grande;CAMPO GRANDE
+261160605025;25;Encruzilhada;ENCRUZILHADA
+261160605026;26;Torreao;TORREAO
+261160605027;27;Passarinho;PASSARINHO
+261160605028;28;Dois Unidos;DOIS UNIDOS
+261160605029;29;Linha do Tiro;LINHA DO TIRO
+261160605030;30;Beberibe;BEBERIBE
+261160605031;31;Alto Santa Teresinha;ALTO SANTA TERESINHA
+261160605032;32;Porto da Madeira;PORTO DA MADEIRA
+261160605033;33;Cajueiro;CAJUEIRO
+261160605034;34;Fundao;FUNDAO
+261160605035;35;Agua Fria;AGUA FRIA
+261160605036;36;Bomba do Hemeterio;BOMBA DO HEMETERIO
+261160605037;37;Pau-Ferro;PAU-FERRO
+261160605038;38;Guabiraba;GUABIRABA
+261160605039;39;Sitio dos Pintos;SITIO DOS PINTOS
+261160605040;40;Dois Irmaos;DOIS IRMAOS
+261160605041;41;Brejo da Guabiraba;BREJO DA GUABIRABA
+261160605042;42;Corrego do Jenipa;CORREGO DO JENIPAPO
+261160605043;43;Apipucos;APIPUCOS
+261160605044;44;Macaxeira;MACAXEIRA
+261160605045;45;Nova Descoberta;NOVA DESCOBERTA
+261160605046;46;Brejo de Beberibe;BREJO DE BEBERIBE
+261160605047;47;Alto do Mandu;ALTO DO MANDU
+261160605048;48;Casa Amarela;CASA AMARELA
+261160605049;49;Vasco da Gama;VASCO DA GAMA
+261160605050;50;Alto Jose Bonifacio;ALTO JOSE BONIFACIO
+261160605051;51;Morro da Conceicao;MORRO DA CONCEICAO
+261160605052;52;Alto Jose do Pinho;ALTO JOSE DO PINHO
+261160605053;53;Mangabeira;MANGABEIRA
+261160605054;54;Parnamirim;PARNAMIRIM
+261160605055;55;Casa Forte;CASA FORTE
+261160605056;56;Santana;SANTANA
+261160605057;57;Po�o;POCO
+261160605058;58;Monteiro;MONTEIRO
+261160605059;59;Torre;TORRE
+261160605060;60;Cordeiro;CORDEIRO
+261160605061;61;Zumbi;ZUMBI
+261160605062;62;Madalena;MADALENA
+261160605063;63;Prado;PRADO
+261160605064;64;Ilha do Retiro;ILHA DO RETIRO
+261160605065;65;Bongi;BONGI
+261160605066;66;San Martin;SAN MARTIN
+261160605067;67;Mustardinha;MUSTARDINHA
+261160605068;68;Mangueira;MANGUEIRA
+261160605069;69;Varzea;VARZEA
+261160605070;70;Caxanga�;CAXANGA
+261160605071;71;Iputinga;IPUTINGA
+261160605072;72;Torroes;TORROES
+261160605073;73;Engenho do Meio;ENGENHO DO MEIO
+261160605074;74;Cidade Universitaria�;CIDADE UNIVERSITARIA
+261160605075;75;Afogados;AFOGADOS
+261160605076;76;Jiquia�;JIQUIA
+261160605077;77;Estancia;ESTANCIA
+261160605078;78;Areias;AREIAS
+261160605079;79;Ca�ote;CACOTE
+261160605080;80;Curado;CURADO
+261160605081;81;Toto;TOTO
+261160605082;82;Coqueiral;COQUEIRAL
+261160605083;83;Sancho;SANCHO
+261160605084;84;Tejipio;TEJIPIO
+261160605085;85;Jardim Sao Paulo;JARDIM SAO PAULO
+261160605086;86;Barro;BARRO
+261160605087;87;Cohab;COHAB
+261160605088;88;Jordao;JORDAO
+261160605089;89;Ibura;IBURA
+261160605090;90;Ipsep;IPSEP
+261160605091;91;Imbiribeira;IMBIRIBEIRA
+261160605092;92;Boa Viagem;BOA VIAGEM
+261160605093;93;Pina;PINA
+261160605094;94;Brasilia Teimosa;BRASILIA TEIMOSA
diff --git a/examples/data/BrasiliaPol.dbf b/examples/data/BrasiliaPol.dbf
old mode 100755
new mode 100644
index 506b360..57b69d5
Binary files a/examples/data/BrasiliaPol.dbf and b/examples/data/BrasiliaPol.dbf differ
diff --git a/examples/data/BrasiliaPol.shp b/examples/data/BrasiliaPol.shp
old mode 100755
new mode 100644
index 9162aba..1270740
Binary files a/examples/data/BrasiliaPol.shp and b/examples/data/BrasiliaPol.shp differ
diff --git a/examples/data/BrasiliaPol.shx b/examples/data/BrasiliaPol.shx
old mode 100755
new mode 100644
index 66b80ba..b1b7da6
Binary files a/examples/data/BrasiliaPol.shx and b/examples/data/BrasiliaPol.shx differ
diff --git a/examples/data/Brasilia_RGB.tif b/examples/data/Brasilia_RGB.tif
old mode 100755
new mode 100644
diff --git a/examples/data/Cadastro_Escolas.geo b/examples/data/Cadastro_Escolas.geo
old mode 100755
new mode 100644
index d5b83d4..253763a
--- a/examples/data/Cadastro_Escolas.geo
+++ b/examples/data/Cadastro_Escolas.geo
@@ -1,201 +1,201 @@
-PONTOS
-1                                184880.000000 8252050.000000 -47.941111 -15.790318
-2                                185860.000000 8252050.000000 -47.931973 -15.790441
-3                                185685.000000 8252275.000000 -47.933575 -15.788388
-4                                185140.000000 8250300.000000 -47.938915 -15.806151
-21                               191400.000000 8246450.000000 -47.881030 -15.841695
-22                               189700.000000 8246360.000000 -47.896898 -15.842296
-29                               193120.000000 8258910.000000 -47.863406 -15.729404
-30                               194600.000000 8257320.000000 -47.849809 -15.743941
-31                               190285.000000 8250745.000000 -47.890878 -15.802777
-32                               189930.000000 8257645.000000 -47.893305 -15.740433
-33                               190770.000000 8253110.000000 -47.886053 -15.781484
-34                               188420.000000 8247530.000000 -47.908685 -15.831572
-35                               191095.000000 8250010.000000 -47.883419 -15.809514
-36                               186220.000000 8254440.000000 -47.928306 -15.768908
-37                               187300.000000 8249355.000000 -47.918894 -15.814955
-38                               188495.000000 8247600.000000 -47.907977 -15.830950
-39                               189520.000000 8249645.000000 -47.898154 -15.812614
-40                               194720.000000 8251690.000000 -47.849400 -15.794791
-41                               189100.000000 8249355.000000 -47.902108 -15.815180
-42                               190150.000000 8250500.000000 -47.892169 -15.804972
-43                               187400.000000 8248050.000000 -47.918131 -15.826750
-44                               189295.000000 8248535.000000 -47.900395 -15.822608
-45                               192035.000000 8253650.000000 -47.874189 -15.776764
-46                               186790.000000 8248895.000000 -47.923710 -15.819044
-47                               191470.000000 8256050.000000 -47.879151 -15.755025
-48                               191850.000000 8254850.000000 -47.875761 -15.765906
-49                               188230.000000 8250150.000000 -47.910119 -15.807893
-50                               189700.000000 8254500.000000 -47.895852 -15.768801
-51                               188620.000000 8247680.000000 -47.906801 -15.830243
-52                               187125.000000 8249330.000000 -47.920530 -15.815158
-53                               187975.000000 8249825.000000 -47.912539 -15.810796
-54                               189940.000000 8253200.000000 -47.893781 -15.780568
-55                               183835.000000 8255140.000000 -47.950451 -15.762288
-56                               191025.000000 8253160.000000 -47.883669 -15.781064
-57                               190950.000000 8253890.000000 -47.884275 -15.774463
-58                               190900.000000 8254540.000000 -47.884658 -15.768588
-59                               188950.000000 8249220.000000 -47.903524 -15.816380
-60                               187955.000000 8248490.000000 -47.912898 -15.822847
-61                               190150.000000 8256960.000000 -47.891341 -15.746645
-62                               187145.000000 8247940.000000 -47.920524 -15.827711
-63                               190145.000000 8249800.000000 -47.892305 -15.811292
-64                               189600.000000 8249295.000000 -47.897453 -15.815784
-65                               188940.000000 8248700.000000 -47.903685 -15.821074
-66                               187360.000000 8247480.000000 -47.918578 -15.831891
-67                               190670.000000 8253750.000000 -47.886904 -15.775693
-68                               189645.000000 8250470.000000 -47.896882 -15.805180
-69                               189400.000000 8250225.000000 -47.899198 -15.807362
-70                               190560.000000 8254320.000000 -47.887856 -15.770532
-71                               188710.000000 8249570.000000 -47.905717 -15.813190
-72                               189920.000000 8256400.000000 -47.893557 -15.751673
-73                               186950.000000 8248060.000000 -47.922327 -15.826603
-74                               186670.000000 8247930.000000 -47.924955 -15.827741
-75                               189510.000000 8257890.000000 -47.897189 -15.738169
-76                               186350.000000 8247660.000000 -47.927974 -15.830139
-77                               191750.000000 8253610.000000 -47.876851 -15.777090
-78                               191650.000000 8254350.000000 -47.877689 -15.770396
-79                               190075.000000 8249285.000000 -47.893024 -15.815933
-80                               191480.000000 8255280.000000 -47.879156 -15.761978
-81                               191130.000000 8256100.000000 -47.882315 -15.754531
-82                               188750.000000 8248090.000000 -47.905535 -15.826558
-83                               191070.000000 8256360.000000 -47.882841 -15.752176
-84                               187900.000000 8247600.000000 -47.913526 -15.830875
-85                               190605.000000 8257745.000000 -47.886999 -15.739614
-86                               186970.000000 8246890.000000 -47.922292 -15.837169
-87                               190080.000000 8254620.000000 -47.892293 -15.767764
-88                               189680.000000 8255940.000000 -47.895854 -15.755796
-89                               185860.000000 8253820.000000 -47.931743 -15.774461
-91                               188350.000000 8250345.000000 -47.908975 -15.806148
-92                               187800.000000 8250050.000000 -47.914142 -15.808742
-93                               187130.000000 8246640.000000 -47.920832 -15.839446
-94                               186530.000000 8249880.000000 -47.926007 -15.810118
-95                               188580.000000 8249900.000000 -47.906887 -15.810194
-96                               190350.000000 8250670.000000 -47.890282 -15.803462
-97                               190970.000000 8254450.000000 -47.884017 -15.769409
-98                               188790.000000 8249145.000000 -47.905026 -15.817037
-99                               187040.000000 8247885.000000 -47.921510 -15.828194
-100                              189055.000000 8248800.000000 -47.902599 -15.820185
-101                              190710.000000 8253080.000000 -47.886616 -15.781747
-102                              189900.000000 8250755.000000 -47.894467 -15.802639
-103                              190725.000000 8253740.000000 -47.886392 -15.775790
-104                              189380.000000 8250140.000000 -47.899396 -15.808127
-105                              188585.000000 8249490.000000 -47.906893 -15.813897
-106                              189980.000000 8256450.000000 -47.892992 -15.751229
-107                              186875.000000 8248160.000000 -47.923013 -15.825690
-108                              186390.000000 8247840.000000 -47.927578 -15.828519
-109                              191720.000000 8253840.000000 -47.877102 -15.775010
-463                              185300.000000 8252710.000000 -47.937109 -15.784412
-464                              184780.000000 8251740.000000 -47.942084 -15.793104
-465                              185045.000000 8252880.000000 -47.939464 -15.782845
-466                              185100.000000 8251460.000000 -47.939136 -15.795672
-467                              184785.000000 8251470.000000 -47.942072 -15.795542
-468                              184540.000000 8251175.000000 -47.944395 -15.798175
-469                              185150.000000 8251660.000000 -47.938644 -15.793873
-470                              184370.000000 8250550.000000 -47.946062 -15.803796
-471                              185375.000000 8252750.000000 -47.936404 -15.784060
-528                              191820.000000 8246735.000000 -47.877076 -15.839174
-540                              192010.000000 8258485.000000 -47.873807 -15.733105
-546                              189350.000000 8256240.000000 -47.898892 -15.753047
-547                              187570.000000 8248430.000000 -47.916496 -15.823340
-548                              190280.000000 8249710.000000 -47.891058 -15.812121
-549                              188560.000000 8250500.000000 -47.906996 -15.804774
-550                              190800.000000 8256780.000000 -47.885305 -15.748351
-551                              187030.000000 8248900.000000 -47.921471 -15.819029
-552                              191600.000000 8253950.000000 -47.878206 -15.774002
-553                              190250.000000 8254300.000000 -47.890749 -15.770675
-554                              190720.000000 8249520.000000 -47.886979 -15.813891
-555                              189980.000000 8254760.000000 -47.893208 -15.766488
-556                              187460.000000 8249930.000000 -47.917328 -15.809783
-557                              190570.000000 8253100.000000 -47.887919 -15.781549
-558                              188870.000000 8257600.000000 -47.903193 -15.740708
-559                              191450.000000 8250470.000000 -47.880049 -15.805404
-560                              189820.000000 8254750.000000 -47.894701 -15.766558
-561                              189250.000000 8256450.000000 -47.899797 -15.751138
-562                              188660.000000 8250270.000000 -47.906093 -15.806863
-563                              189090.000000 8250560.000000 -47.902046 -15.804299
-564                              189470.000000 8251060.000000 -47.898438 -15.799832
-565                              189040.000000 8257000.000000 -47.901685 -15.746146
-566                              189800.000000 8251140.000000 -47.895350 -15.799150
-567                              188100.000000 8249990.000000 -47.911352 -15.809321
-568                              186850.000000 8249120.000000 -47.923122 -15.817020
-569                              186440.000000 8248600.000000 -47.927013 -15.821663
-570                              188400.000000 8250050.000000 -47.908546 -15.808817
-571                              189870.000000 8254110.000000 -47.894317 -15.772343
-572                              188650.000000 8250600.000000 -47.906144 -15.803883
-573                              188900.000000 8250370.000000 -47.903842 -15.805990
-574                              189900.000000 8254230.000000 -47.894022 -15.771263
-575                              187290.000000 8249570.000000 -47.918960 -15.813012
-576                              188820.000000 8250630.000000 -47.904555 -15.803633
-577                              187350.000000 8246820.000000 -47.918757 -15.837849
-578                              189670.000000 8251110.000000 -47.896567 -15.799405
-579                              190100.000000 8248830.000000 -47.892849 -15.820044
-580                              192020.000000 8253930.000000 -47.874293 -15.774234
-581                              189290.000000 8248230.000000 -47.900481 -15.825361
-582                              187520.000000 8246910.000000 -47.917160 -15.837057
-583                              186560.000000 8248700.000000 -47.925881 -15.820775
-584                              189150.000000 8248100.000000 -47.901803 -15.826517
-585                              190300.000000 8253100.000000 -47.890437 -15.781516
-586                              191380.000000 8250300.000000 -47.880724 -15.806931
-587                              189180.000000 8255700.000000 -47.900546 -15.757901
-588                              191700.000000 8255320.000000 -47.877100 -15.761644
-589                              189340.000000 8250950.000000 -47.899664 -15.800809
-590                              191620.000000 8255700.000000 -47.877797 -15.758203
-591                              188820.000000 8247800.000000 -47.904920 -15.829185
-592                              190380.000000 8249150.000000 -47.890197 -15.817190
-593                              189180.000000 8256470.000000 -47.900447 -15.750949
-594                              188820.000000 8250400.000000 -47.904584 -15.805710
-595                              188020.000000 8247840.000000 -47.912376 -15.828723
-596                              191700.000000 8255480.000000 -47.877079 -15.760200
-597                              190240.000000 8249000.000000 -47.891522 -15.818527
-598                              189270.000000 8250810.000000 -47.900335 -15.802064
-599                              189530.000000 8254860.000000 -47.897391 -15.765529
-600                              189630.000000 8257890.000000 -47.896070 -15.738184
-601                              190310.000000 8253690.000000 -47.890268 -15.776190
-602                              188930.000000 8250380.000000 -47.903561 -15.805904
-603                              186850.000000 8249440.000000 -47.923080 -15.814131
-604                              189460.000000 8256590.000000 -47.897822 -15.749900
-605                              188560.000000 8250380.000000 -47.907012 -15.805858
-606                              187460.000000 8249630.000000 -47.917367 -15.812492
-607                              190530.000000 8255180.000000 -47.888026 -15.762764
-608                              189990.000000 8253920.000000 -47.893222 -15.774073
-609                              189020.000000 8256900.000000 -47.901884 -15.747047
-610                              188950.000000 8250820.000000 -47.903318 -15.801934
-611                              188820.000000 8247790.000000 -47.904921 -15.829275
-612                              191910.000000 8254500.000000 -47.875246 -15.769074
-613                              189550.000000 8256160.000000 -47.897038 -15.753794
-614                              188800.000000 8247700.000000 -47.905119 -15.830085
-615                              186970.000000 8249260.000000 -47.921984 -15.815771
-616                              188280.000000 8249990.000000 -47.909673 -15.809344
-617                              186880.000000 8246950.000000 -47.923124 -15.836616
-618                              189860.000000 8254370.000000 -47.894377 -15.769994
-619                              189000.000000 8247930.000000 -47.903224 -15.828033
-620                              188990.000000 8257180.000000 -47.902128 -15.744515
-621                              186410.000000 8247550.000000 -47.927429 -15.831139
-622                              189300.000000 8257330.000000 -47.899219 -15.743199
-623                              189870.000000 8256970.000000 -47.893951 -15.746520
-624                              186510.000000 8248820.000000 -47.926331 -15.819686
-625                              188925.000000 8256730.000000 -47.902791 -15.748570
-626                              189715.000000 8250215.000000 -47.896262 -15.807491
-627                              189920.000000 8255210.000000 -47.893710 -15.762417
-628                              188460.000000 8249560.000000 -47.908050 -15.813249
-629                              189470.000000 8255940.000000 -47.897812 -15.755770
-630                              194100.000000 8250250.000000 -47.855364 -15.807717
-631                              189580.000000 8255120.000000 -47.896891 -15.763188
-632                              189110.000000 8256700.000000 -47.901071 -15.748864
-634                              188900.000000 8257280.000000 -47.902954 -15.743601
-635                              191020.000000 8249860.000000 -47.884137 -15.810859
-636                              189105.000000 8255680.000000 -47.901248 -15.758073
-637                              188220.000000 8250115.000000 -47.910217 -15.808208
-638                              190900.000000 8256180.000000 -47.884449 -15.753780
-639                              188480.000000 8248280.000000 -47.908029 -15.824808
-640                              190660.000000 8253590.000000 -47.887017 -15.777136
-641                              188790.000000 8249625.000000 -47.904964 -15.812703
-642                              187060.000000 8248325.000000 -47.921266 -15.824224
-643                              191305.000000 8250150.000000 -47.881442 -15.808276
-644                              190610.000000 8252810.000000 -47.887583 -15.784172
-645                              187830.000000 8251650.000000 -47.913655 -15.794300
-646                              188630.000000 8247690.000000 -47.906706 -15.830154
-830                              184740.000000 8251050.000000 -47.942547 -15.799329
-831                              184950.000000 8251040.000000 -47.940590 -15.799445
-END
+PONTOS
+1                                184880.000000 8252050.000000 -47.941111 -15.790318
+2                                185860.000000 8252050.000000 -47.931973 -15.790441
+3                                185685.000000 8252275.000000 -47.933575 -15.788388
+4                                185140.000000 8250300.000000 -47.938915 -15.806151
+21                               191400.000000 8246450.000000 -47.881030 -15.841695
+22                               189700.000000 8246360.000000 -47.896898 -15.842296
+29                               193120.000000 8258910.000000 -47.863406 -15.729404
+30                               194600.000000 8257320.000000 -47.849809 -15.743941
+31                               190285.000000 8250745.000000 -47.890878 -15.802777
+32                               189930.000000 8257645.000000 -47.893305 -15.740433
+33                               190770.000000 8253110.000000 -47.886053 -15.781484
+34                               188420.000000 8247530.000000 -47.908685 -15.831572
+35                               191095.000000 8250010.000000 -47.883419 -15.809514
+36                               186220.000000 8254440.000000 -47.928306 -15.768908
+37                               187300.000000 8249355.000000 -47.918894 -15.814955
+38                               188495.000000 8247600.000000 -47.907977 -15.830950
+39                               189520.000000 8249645.000000 -47.898154 -15.812614
+40                               194720.000000 8251690.000000 -47.849400 -15.794791
+41                               189100.000000 8249355.000000 -47.902108 -15.815180
+42                               190150.000000 8250500.000000 -47.892169 -15.804972
+43                               187400.000000 8248050.000000 -47.918131 -15.826750
+44                               189295.000000 8248535.000000 -47.900395 -15.822608
+45                               192035.000000 8253650.000000 -47.874189 -15.776764
+46                               186790.000000 8248895.000000 -47.923710 -15.819044
+47                               191470.000000 8256050.000000 -47.879151 -15.755025
+48                               191850.000000 8254850.000000 -47.875761 -15.765906
+49                               188230.000000 8250150.000000 -47.910119 -15.807893
+50                               189700.000000 8254500.000000 -47.895852 -15.768801
+51                               188620.000000 8247680.000000 -47.906801 -15.830243
+52                               187125.000000 8249330.000000 -47.920530 -15.815158
+53                               187975.000000 8249825.000000 -47.912539 -15.810796
+54                               189940.000000 8253200.000000 -47.893781 -15.780568
+55                               183835.000000 8255140.000000 -47.950451 -15.762288
+56                               191025.000000 8253160.000000 -47.883669 -15.781064
+57                               190950.000000 8253890.000000 -47.884275 -15.774463
+58                               190900.000000 8254540.000000 -47.884658 -15.768588
+59                               188950.000000 8249220.000000 -47.903524 -15.816380
+60                               187955.000000 8248490.000000 -47.912898 -15.822847
+61                               190150.000000 8256960.000000 -47.891341 -15.746645
+62                               187145.000000 8247940.000000 -47.920524 -15.827711
+63                               190145.000000 8249800.000000 -47.892305 -15.811292
+64                               189600.000000 8249295.000000 -47.897453 -15.815784
+65                               188940.000000 8248700.000000 -47.903685 -15.821074
+66                               187360.000000 8247480.000000 -47.918578 -15.831891
+67                               190670.000000 8253750.000000 -47.886904 -15.775693
+68                               189645.000000 8250470.000000 -47.896882 -15.805180
+69                               189400.000000 8250225.000000 -47.899198 -15.807362
+70                               190560.000000 8254320.000000 -47.887856 -15.770532
+71                               188710.000000 8249570.000000 -47.905717 -15.813190
+72                               189920.000000 8256400.000000 -47.893557 -15.751673
+73                               186950.000000 8248060.000000 -47.922327 -15.826603
+74                               186670.000000 8247930.000000 -47.924955 -15.827741
+75                               189510.000000 8257890.000000 -47.897189 -15.738169
+76                               186350.000000 8247660.000000 -47.927974 -15.830139
+77                               191750.000000 8253610.000000 -47.876851 -15.777090
+78                               191650.000000 8254350.000000 -47.877689 -15.770396
+79                               190075.000000 8249285.000000 -47.893024 -15.815933
+80                               191480.000000 8255280.000000 -47.879156 -15.761978
+81                               191130.000000 8256100.000000 -47.882315 -15.754531
+82                               188750.000000 8248090.000000 -47.905535 -15.826558
+83                               191070.000000 8256360.000000 -47.882841 -15.752176
+84                               187900.000000 8247600.000000 -47.913526 -15.830875
+85                               190605.000000 8257745.000000 -47.886999 -15.739614
+86                               186970.000000 8246890.000000 -47.922292 -15.837169
+87                               190080.000000 8254620.000000 -47.892293 -15.767764
+88                               189680.000000 8255940.000000 -47.895854 -15.755796
+89                               185860.000000 8253820.000000 -47.931743 -15.774461
+91                               188350.000000 8250345.000000 -47.908975 -15.806148
+92                               187800.000000 8250050.000000 -47.914142 -15.808742
+93                               187130.000000 8246640.000000 -47.920832 -15.839446
+94                               186530.000000 8249880.000000 -47.926007 -15.810118
+95                               188580.000000 8249900.000000 -47.906887 -15.810194
+96                               190350.000000 8250670.000000 -47.890282 -15.803462
+97                               190970.000000 8254450.000000 -47.884017 -15.769409
+98                               188790.000000 8249145.000000 -47.905026 -15.817037
+99                               187040.000000 8247885.000000 -47.921510 -15.828194
+100                              189055.000000 8248800.000000 -47.902599 -15.820185
+101                              190710.000000 8253080.000000 -47.886616 -15.781747
+102                              189900.000000 8250755.000000 -47.894467 -15.802639
+103                              190725.000000 8253740.000000 -47.886392 -15.775790
+104                              189380.000000 8250140.000000 -47.899396 -15.808127
+105                              188585.000000 8249490.000000 -47.906893 -15.813897
+106                              189980.000000 8256450.000000 -47.892992 -15.751229
+107                              186875.000000 8248160.000000 -47.923013 -15.825690
+108                              186390.000000 8247840.000000 -47.927578 -15.828519
+109                              191720.000000 8253840.000000 -47.877102 -15.775010
+463                              185300.000000 8252710.000000 -47.937109 -15.784412
+464                              184780.000000 8251740.000000 -47.942084 -15.793104
+465                              185045.000000 8252880.000000 -47.939464 -15.782845
+466                              185100.000000 8251460.000000 -47.939136 -15.795672
+467                              184785.000000 8251470.000000 -47.942072 -15.795542
+468                              184540.000000 8251175.000000 -47.944395 -15.798175
+469                              185150.000000 8251660.000000 -47.938644 -15.793873
+470                              184370.000000 8250550.000000 -47.946062 -15.803796
+471                              185375.000000 8252750.000000 -47.936404 -15.784060
+528                              191820.000000 8246735.000000 -47.877076 -15.839174
+540                              192010.000000 8258485.000000 -47.873807 -15.733105
+546                              189350.000000 8256240.000000 -47.898892 -15.753047
+547                              187570.000000 8248430.000000 -47.916496 -15.823340
+548                              190280.000000 8249710.000000 -47.891058 -15.812121
+549                              188560.000000 8250500.000000 -47.906996 -15.804774
+550                              190800.000000 8256780.000000 -47.885305 -15.748351
+551                              187030.000000 8248900.000000 -47.921471 -15.819029
+552                              191600.000000 8253950.000000 -47.878206 -15.774002
+553                              190250.000000 8254300.000000 -47.890749 -15.770675
+554                              190720.000000 8249520.000000 -47.886979 -15.813891
+555                              189980.000000 8254760.000000 -47.893208 -15.766488
+556                              187460.000000 8249930.000000 -47.917328 -15.809783
+557                              190570.000000 8253100.000000 -47.887919 -15.781549
+558                              188870.000000 8257600.000000 -47.903193 -15.740708
+559                              191450.000000 8250470.000000 -47.880049 -15.805404
+560                              189820.000000 8254750.000000 -47.894701 -15.766558
+561                              189250.000000 8256450.000000 -47.899797 -15.751138
+562                              188660.000000 8250270.000000 -47.906093 -15.806863
+563                              189090.000000 8250560.000000 -47.902046 -15.804299
+564                              189470.000000 8251060.000000 -47.898438 -15.799832
+565                              189040.000000 8257000.000000 -47.901685 -15.746146
+566                              189800.000000 8251140.000000 -47.895350 -15.799150
+567                              188100.000000 8249990.000000 -47.911352 -15.809321
+568                              186850.000000 8249120.000000 -47.923122 -15.817020
+569                              186440.000000 8248600.000000 -47.927013 -15.821663
+570                              188400.000000 8250050.000000 -47.908546 -15.808817
+571                              189870.000000 8254110.000000 -47.894317 -15.772343
+572                              188650.000000 8250600.000000 -47.906144 -15.803883
+573                              188900.000000 8250370.000000 -47.903842 -15.805990
+574                              189900.000000 8254230.000000 -47.894022 -15.771263
+575                              187290.000000 8249570.000000 -47.918960 -15.813012
+576                              188820.000000 8250630.000000 -47.904555 -15.803633
+577                              187350.000000 8246820.000000 -47.918757 -15.837849
+578                              189670.000000 8251110.000000 -47.896567 -15.799405
+579                              190100.000000 8248830.000000 -47.892849 -15.820044
+580                              192020.000000 8253930.000000 -47.874293 -15.774234
+581                              189290.000000 8248230.000000 -47.900481 -15.825361
+582                              187520.000000 8246910.000000 -47.917160 -15.837057
+583                              186560.000000 8248700.000000 -47.925881 -15.820775
+584                              189150.000000 8248100.000000 -47.901803 -15.826517
+585                              190300.000000 8253100.000000 -47.890437 -15.781516
+586                              191380.000000 8250300.000000 -47.880724 -15.806931
+587                              189180.000000 8255700.000000 -47.900546 -15.757901
+588                              191700.000000 8255320.000000 -47.877100 -15.761644
+589                              189340.000000 8250950.000000 -47.899664 -15.800809
+590                              191620.000000 8255700.000000 -47.877797 -15.758203
+591                              188820.000000 8247800.000000 -47.904920 -15.829185
+592                              190380.000000 8249150.000000 -47.890197 -15.817190
+593                              189180.000000 8256470.000000 -47.900447 -15.750949
+594                              188820.000000 8250400.000000 -47.904584 -15.805710
+595                              188020.000000 8247840.000000 -47.912376 -15.828723
+596                              191700.000000 8255480.000000 -47.877079 -15.760200
+597                              190240.000000 8249000.000000 -47.891522 -15.818527
+598                              189270.000000 8250810.000000 -47.900335 -15.802064
+599                              189530.000000 8254860.000000 -47.897391 -15.765529
+600                              189630.000000 8257890.000000 -47.896070 -15.738184
+601                              190310.000000 8253690.000000 -47.890268 -15.776190
+602                              188930.000000 8250380.000000 -47.903561 -15.805904
+603                              186850.000000 8249440.000000 -47.923080 -15.814131
+604                              189460.000000 8256590.000000 -47.897822 -15.749900
+605                              188560.000000 8250380.000000 -47.907012 -15.805858
+606                              187460.000000 8249630.000000 -47.917367 -15.812492
+607                              190530.000000 8255180.000000 -47.888026 -15.762764
+608                              189990.000000 8253920.000000 -47.893222 -15.774073
+609                              189020.000000 8256900.000000 -47.901884 -15.747047
+610                              188950.000000 8250820.000000 -47.903318 -15.801934
+611                              188820.000000 8247790.000000 -47.904921 -15.829275
+612                              191910.000000 8254500.000000 -47.875246 -15.769074
+613                              189550.000000 8256160.000000 -47.897038 -15.753794
+614                              188800.000000 8247700.000000 -47.905119 -15.830085
+615                              186970.000000 8249260.000000 -47.921984 -15.815771
+616                              188280.000000 8249990.000000 -47.909673 -15.809344
+617                              186880.000000 8246950.000000 -47.923124 -15.836616
+618                              189860.000000 8254370.000000 -47.894377 -15.769994
+619                              189000.000000 8247930.000000 -47.903224 -15.828033
+620                              188990.000000 8257180.000000 -47.902128 -15.744515
+621                              186410.000000 8247550.000000 -47.927429 -15.831139
+622                              189300.000000 8257330.000000 -47.899219 -15.743199
+623                              189870.000000 8256970.000000 -47.893951 -15.746520
+624                              186510.000000 8248820.000000 -47.926331 -15.819686
+625                              188925.000000 8256730.000000 -47.902791 -15.748570
+626                              189715.000000 8250215.000000 -47.896262 -15.807491
+627                              189920.000000 8255210.000000 -47.893710 -15.762417
+628                              188460.000000 8249560.000000 -47.908050 -15.813249
+629                              189470.000000 8255940.000000 -47.897812 -15.755770
+630                              194100.000000 8250250.000000 -47.855364 -15.807717
+631                              189580.000000 8255120.000000 -47.896891 -15.763188
+632                              189110.000000 8256700.000000 -47.901071 -15.748864
+634                              188900.000000 8257280.000000 -47.902954 -15.743601
+635                              191020.000000 8249860.000000 -47.884137 -15.810859
+636                              189105.000000 8255680.000000 -47.901248 -15.758073
+637                              188220.000000 8250115.000000 -47.910217 -15.808208
+638                              190900.000000 8256180.000000 -47.884449 -15.753780
+639                              188480.000000 8248280.000000 -47.908029 -15.824808
+640                              190660.000000 8253590.000000 -47.887017 -15.777136
+641                              188790.000000 8249625.000000 -47.904964 -15.812703
+642                              187060.000000 8248325.000000 -47.921266 -15.824224
+643                              191305.000000 8250150.000000 -47.881442 -15.808276
+644                              190610.000000 8252810.000000 -47.887583 -15.784172
+645                              187830.000000 8251650.000000 -47.913655 -15.794300
+646                              188630.000000 8247690.000000 -47.906706 -15.830154
+830                              184740.000000 8251050.000000 -47.942547 -15.799329
+831                              184950.000000 8251040.000000 -47.940590 -15.799445
+END
diff --git a/examples/data/Cadastro_Escolas.tab b/examples/data/Cadastro_Escolas.tab
old mode 100755
new mode 100644
index ef759f6..c37b60c
--- a/examples/data/Cadastro_Escolas.tab
+++ b/examples/data/Cadastro_Escolas.tab
@@ -1,237 +1,237 @@
-TABLE
-CADASTRAL	ROTULO
-SEPARATOR ,
-ROTULO,TEXT,32,0
-NOME,TEXT,32,0
-CODIGO,REAL,17,8
-NOME_ESC,TEXT,60,0
-ENDERECO,TEXT,55,0
-TELEFONE,TEXT,13,0
-NOME_RA,TEXT,28,0
-TIPO,TEXT,11,0
-ENSINO,TEXT,15,0
-NO_SALAS,REAL,17,8
-TURNO,TEXT,11,0
-CRE_MAT_AL,REAL,17,8
-CRE_MAT_PF,REAL,17,8
-JARDIM_AL,REAL,17,8
-JARDIM_PF,REAL,17,8
-PG_1A4S_AL,REAL,17,8
-PG_1A4S_PF,REAL,17,8
-PG_5A8S_AL,REAL,17,8
-PG_5A8S_PF,REAL,17,8
-SEGRAU_AL,REAL,17,8
-SEGRAU_PF,REAL,17,8
-ESPECIA_AL,REAL,17,8
-ESP_CLS_CO,REAL,17,8
-ESPECIA_PF,REAL,17,8
-SUPLET_AL,REAL,17,8
-SUPLET_PF,REAL,17,8
-EXTR_AL,REAL,17,8
-EXTR_PF,REAL,17,8
-MUSIC_AL,REAL,17,8
-MUSIC_PF,REAL,17,8
-PROFISS_AL,REAL,17,8
-PROFISS_PF,REAL,17,8
-COORD_X,REAL,17,8
-COORD_Y,REAL,17,8
-INFO_END
-1,1,53008871.000000,Escola Recanto Cultural,Q 02 - Bloco K - Casa 26,233-2255,RA XI - CRUZEIRO,Particular,Infantil,4.000000,M V,31.000000,2.000000,46.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184880.000000,8252050.000000
-2,2,53008901.000000,Maternal e Jardim de Infancia Barquinho Amarelo,Q 10 - Bloco X - Casa 4,234-1149,RA XI - CRUZEIRO,Particular,Infantil,8.000000,M V,36.000000,2.000000,98.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185860.000000,8252050.000000
-3,3,0.000000,Maternal e Jardim de Infancia Matita Pere,Qd 6 - Bloco X - Casa 5,233-3786,RA XI - CRUZEIRO,Particular,Infantil,4.000000,M V,0.000000,0.000000,72.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185685.000000,8252275.000000
-4,4,0.000000,Escola Batista Sementinha do Saber,AOS 1/2 - Lote 7,233-3697,RA XI - CRUZEIRO,Particular,Infantil,4.000000,M V,33.000000,2.000000,26.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185140.000000,8250300.000000
-21,21,53009576.000000,INEI Centro de Ensino de 1o Grau,SHIS QI 7 - Conj 17 - Lote F,248-2450,RA XVI - LAGO SUL,Particular,Inf/Reg,17.000000,M,27.000000,2.000000,76.000000,3.000000,131.000000,6.000000,149.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191400.000000,8246450.000000
-22,22,53009592.000000,Instituto Nossa Senhora do Perpetuo Socorro,SHIS EQL 6/8 - Conj A,248-0043,RA XVI - LAGO SUL,Particular,Inf/Reg,15.000000,M V,39.000000,3.000000,115.000000,7.000000,216.000000,12.000000,181.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189700.000000,8246360.000000
-29,29,53009452.000000,Escola de 1o Grau Tia Bibia - INDI,SHIN QI 03 - Conj D - Area Especial,577-3935,RA XVIII  - LAGO NORTE,Particular,Inf/Reg,21.000000,M V,98.000000,5.000000,96.000000,4.000000,201.000000,10.000000,104.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,193120.000000,8258910.000000
-30,30,0.000000,Sempre Maternal e Jardim de Infancia,SHIN QI 9 - Conj 1 - Casa 28,368-5090,RA XVIII  - LAGO NORTE,Particular,Infantil,2.000000,M V,8.000000,1.000000,8.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,194600.000000,8257320.000000
-31,31,53001451.000000,Escola Classe 102 Sul,SQS 102,226-8224,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,378.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190285.000000,8250745.000000
-32,32,53001524.000000,Escola Classe 115 Norte,SQN 115,274-4960,RA I - BRASILIA,Publica,Inf/Reg/Supl,9.000000,M  V  N,0.000000,0.000000,50.000000,4.000000,394.000000,22.000000,0.000000,0.000000,0.000000,0.000000,0.000000,5.000000,0.000000,265.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189930.000000,8257645.000000
-33,33,53001575.000000,Escola Classe 302 Norte,SQN 302,224-8286,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,397.000000,13.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190770.000000,8253110.000000
-34,34,53000200.000000,CEE 02 de Brasilia,SGAS 612,242-4400,RA I - BRASILIA,Publica,Especial,32.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,221.000000,0.000000,100.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188420.000000,8247530.000000
-35,35,53000234.000000,CES da Asa Sul - CESAS,SGAS 602 Projecao D,225-3122,RA I - BRASILIA,Publica,Supletivo,31.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,7241.000000,78.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191095.000000,8250010.000000
-36,36,53000242.000000,CES Verde Oliva - CESVO,Batalhao de Policia do Exercito,225-5110,RA I - BRASILIA,Publica,Supletivo,14.000000,N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1119.000000,26.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186220.000000,8254440.000000
-37,37,53000439.000000,Centro Integrado de Ensino Especial-CIEE,SGAS 912 Conjunto E Lotes 42/49,346-6161,RA I - BRASILIA,Publica,Especial,63.000000,M  V  I,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,244.000000,0.000000,122.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187300.000000,8249355.000000
-38,38,53000714.000000,CEE de Deficientes Visuais,SGAS 612  Lote 12,242-1447,RA I - BRASILIA,Publica,Especial,45.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,130.000000,0.000000,59.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188495.000000,8247600.000000
-39,39,53000846.000000,CE de 1o Grau 01 de Brasilia,SQS 106,243-3843,RA I - BRASILIA,Publica,Regular,9.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,552.000000,35.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189520.000000,8249645.000000
-40,40,53000854.000000,CE de 1o Grau 01 do Planalto,Rua 03 Acampamento Tamboril,225-1408,RA I - BRASILIA,Publica,Inf/Reg/Supl,18.000000,M  V  N,0.000000,0.000000,67.000000,2.000000,389.000000,16.000000,425.000000,24.000000,0.000000,0.000000,0.000000,0.000000,0.000000,117.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,194720.000000,8251690.000000
-41,41,53000862.000000,CE de 1o Grau 02 de Brasilia,SQS 107,243-9892,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,509.000000,35.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189100.000000,8249355.000000
-42,42,53000870.000000,CE de 1o Grau 03 de Brasilia,SQS 103,223-4083,RA I - BRASILIA,Publica,Regular,10.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,826.000000,52.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190150.000000,8250500.000000
-43,43,53000889.000000,CE de 1o Grau 04 de Brasilia,SQS 113,242-4182,RA I - BRASILIA,Publica,Reg/Supl,10.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,897.000000,52.000000,0.000000,0.000000,0.000000,10.000000,0.000000,165.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187400.000000,8248050.000000
-44,44,53000897.000000,CE de 1o Grau 05 de Brasilia,SQS 408,242-0931,RA I - BRASILIA,Publica,Regular,10.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,763.000000,40.000000,0.000000,0.000000,0.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189295.000000,8248535.000000
-45,45,53000919.000000,CE de 1o Grau GAN,SGAN 603/604 Conjunto H,223-4863,RA I - BRASILIA,Publica,Regular,9.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,883.000000,55.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,192035.000000,8253650.000000
-46,46,53000927.000000,CE de 1o Grau POLIVALENTE,SGAS 913 Modulos 57/58,245-1178,RA I - BRASILIA,Publica,Regular,15.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,640.000000,48.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186790.000000,8248895.000000
-47,47,53000986.000000,CED CAN,SGAN 610 Modulo A,273-8001,RA I - BRASILIA,Publica,Regular,16.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,329.000000,37.000000,1003.000000,77.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191470.000000,8256050.000000
-48,48,53001010.000000,CED da Asa Norte - CEAN,SGAN 606 Modulos G/H,272-2338,RA I - BRASILIA,Publica,Regular,10.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,182.000000,11.000000,948.000000,65.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191850.000000,8254850.000000
-49,49,53001036.000000,CED ELEFANTE BRANCO,SGAS 908 Modulos 25/26,243-4588,RA I - BRASILIA,Publica,Regular,30.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,3670.000000,251.000000,0.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188230.000000,8250150.000000
-50,50,53001044.000000,CED GISNO,SGAN 908 Conjunto B,272-4103,RA I - BRASILIA,Publica,Reg/Supl,22.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,746.000000,38.000000,1094.000000,47.000000,0.000000,1.000000,0.000000,494.000000,17.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189700.000000,8254500.000000
-51,51,53001206.000000,CED SETOR LESTE,SGAS 611/612 Conjunto E,243-8263,RA I - BRASILIA,Publica,Regular,26.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,84.000000,9.000000,1913.000000,192.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188620.000000,8247680.000000
-52,52,53001214.000000,CED SETOR OESTE,SGAS 912/913,346-4224,RA I - BRASILIA,Publica,Regular,16.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1385.000000,70.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187125.000000,8249330.000000
-53,53,53001265.000000,CIE  CASEB,SGAS 909 Conjunto A,242-2266,RA I - BRASILIA,Publica,Regular,37.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1796.000000,107.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187975.000000,8249825.000000
-54,54,53001354.000000,Colegio Militar de Brasilia,SGAN 902/904,321-6664,RA I - BRASILIA,Publica,Regular,92.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1583.000000,90.000000,1602.000000,97.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189940.000000,8253200.000000
-55,55,53001435.000000,Escola Classe 07 do Cruzeiro,Area Especial RCG - SMC,234-4309,RA I - BRASILIA,Publica,Inf/Reg,4.000000,M  V,0.000000,0.000000,55.000000,5.000000,61.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,183835.000000,8255140.000000
-56,56,53001443.000000,Escola Classe 102 Norte,SQN 102,224-7507,RA I - BRASILIA,Publica,Reg/Supl,9.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,126.000000,6.000000,364.000000,23.000000,0.000000,0.000000,0.000000,0.000000,0.000000,141.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191025.000000,8253160.000000
-57,57,53001460.000000,Escola Classe 104 Norte,SQN 104,225-5789,RA I - BRASILIA,Publica,Regular,9.000000,M  V,0.000000,0.000000,0.000000,0.000000,32.000000,1.000000,574.000000,34.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190950.000000,8253890.000000
-58,58,53001478.000000,Escola Classe 106 Norte,SQN 106,273-7543,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,441.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190900.000000,8254540.000000
-59,59,53001486.000000,Escola Classe 108 Sul,SQS 108,242-4516,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,480.000000,13.000000,0.000000,0.000000,0.000000,0.000000,7.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188950.000000,8249220.000000
-60,60,53001494.000000,Escola Classe 111 Sul,SQS 111,242-2915,RA I - BRASILIA,Publica,Regular,10.000000,M  V,0.000000,0.000000,0.000000,0.000000,356.000000,10.000000,340.000000,17.000000,0.000000,0.000000,0.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187955.000000,8248490.000000
-61,61,53001508.000000,Escola Classe 113 Norte,SQN 113,273-7589,RA I - BRASILIA,Publica,Reg/Supl,9.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,593.000000,29.000000,0.000000,0.000000,0.000000,1.000000,0.000000,430.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190150.000000,8256960.000000
-62,62,53001516.000000,Escola Classe 114 Sul,SQS 114,242-3114,RA I - BRASILIA,Publica,Regular,7.000000,M  V,0.000000,0.000000,0.000000,0.000000,333.000000,7.000000,0.000000,0.000000,0.000000,0.000000,16.000000,2.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187145.000000,8247940.000000
-63,63,53001532.000000,Escola Classe 204 Sul,SQS 204,223-4071,RA I - BRASILIA,Publica,Reg/Supl,11.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,399.000000,13.000000,269.000000,13.000000,0.000000,0.000000,0.000000,0.000000,0.000000,198.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190145.000000,8249800.000000
-64,64,53001540.000000,Escola Classe 206 Sul,SQS 206,242-0002,RA I - BRASILIA,Publica,Inf/Reg,8.000000,M  V,0.000000,0.000000,38.000000,2.000000,443.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189600.000000,8249295.000000
-65,65,53001559.000000,Escola Classe 209 Sul,SQS 209,244-7058,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,372.000000,10.000000,0.000000,0.000000,0.000000,0.000000,11.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188940.000000,8248700.000000
-66,66,53001567.000000,Escola Classe 214 Sul,SQS 214,346-5464,RA I - BRASILIA,Publica,Regular,10.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,588.000000,35.000000,0.000000,0.000000,6.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187360.000000,8247480.000000
-67,67,53001583.000000,Escola Classe 304 Norte,SQN 304,226-4364,RA I - BRASILIA,Publica,Regular,7.000000,M  V,0.000000,0.000000,0.000000,0.000000,433.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190670.000000,8253750.000000
-68,68,53001591.000000,Escola Classe 304 Sul,SQS 304,224-4003,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,334.000000,16.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189645.000000,8250470.000000
-69,69,53001605.000000,Escola Classe 305 Sul,SQS 305,243-3083,RA I - BRASILIA,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,566.000000,18.000000,0.000000,0.000000,0.000000,0.000000,8.000000,4.000000,1.000000,267.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189400.000000,8250225.000000
-70,70,53001613.000000,Escola Classe 306 Norte,SQN 306,272-4414,RA I - BRASILIA,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,322.000000,9.000000,156.000000,9.000000,0.000000,0.000000,0.000000,14.000000,1.000000,431.000000,15.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190560.000000,8254320.000000
-71,71,53001621.000000,Escola Classe 308 Sul,SQS 308,242-6194,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,505.000000,15.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188710.000000,8249570.000000
-72,72,53001630.000000,Escola Classe 312 Norte,SQN 312,340-1840,RA I - BRASILIA,Publica,Regular,6.000000,M  V,0.000000,0.000000,0.000000,0.000000,395.000000,16.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189920.000000,8256400.000000
-73,73,53001648.000000,Escola Classe 314 Sul,SQS 314,346-4395,RA I - BRASILIA,Publica,Regular,9.000000,M  V,0.000000,0.000000,0.000000,0.000000,517.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186950.000000,8248060.000000
-74,74,53001656.000000,Escola Classe 315 Sul,SQS 315,245-1399,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,180.000000,6.000000,343.000000,27.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186670.000000,8247930.000000
-75,75,53001664.000000,Escola Classe 316 Norte,SQN 316,274-9055,RA I - BRASILIA,Publica,Inf/Reg,10.000000,M  V,0.000000,0.000000,49.000000,2.000000,516.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,13.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189510.000000,8257890.000000
-76,76,53001672.000000,Escola Classe 316 Sul,SQS 316,245-2158,RA I - BRASILIA,Publica,Regular,11.000000,M  V,0.000000,0.000000,0.000000,0.000000,663.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186350.000000,8247660.000000
-77,77,53001680.000000,Escola Classe 403 Norte,SQN 403,224-7501,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,265.000000,12.000000,0.000000,0.000000,0.000000,0.000000,14.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191750.000000,8253610.000000
-78,78,53001699.000000,Escola Classe 405 Norte,SQN 405,272-2303,RA I - BRASILIA,Publica,Reg/Supl,7.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,148.000000,8.000000,88.000000,8.000000,0.000000,0.000000,3.000000,0.000000,2.000000,250.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191650.000000,8254350.000000
-79,79,53001702.000000,Escola Classe 405 Sul,SQS 405,242-0735,RA I - BRASILIA,Publica,Regular,11.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,538.000000,37.000000,0.000000,0.000000,10.000000,3.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190075.000000,8249285.000000
-80,80,53001710.000000,Escola Classe 407 Norte,SQN 407,272-2053,RA I - BRASILIA,Publica,Inf/Reg/Supl,9.000000,M  V  N,0.000000,0.000000,24.000000,2.000000,229.000000,8.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,2.000000,320.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191480.000000,8255280.000000
-81,81,53001729.000000,Escola Classe 409 Norte,SQN 410,272-4533,RA I - BRASILIA,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,431.000000,24.000000,0.000000,0.000000,0.000000,0.000000,2.000000,206.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191130.000000,8256100.000000
-82,82,53001737.000000,Escola Classe 410 Sul,SQS 410,242-6092,RA I - BRASILIA,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,351.000000,15.000000,0.000000,0.000000,0.000000,0.000000,27.000000,8.000000,3.000000,180.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188750.000000,8248090.000000
-83,83,53001745.000000,Escola Classe 411 Norte,SQN 411,273-4240,RA I - BRASILIA,Publica,Inf/Reg,13.000000,M  V,0.000000,0.000000,28.000000,1.000000,374.000000,10.000000,0.000000,0.000000,0.000000,0.000000,3.000000,3.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191070.000000,8256360.000000
-84,84,53001753.000000,Escola Classe 413 Sul,SQS 413,242-9686,RA I - BRASILIA,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,183.000000,5.000000,315.000000,27.000000,0.000000,0.000000,0.000000,1.000000,0.000000,161.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187900.000000,8247600.000000
-85,85,53001761.000000,Escola Classe 415 Norte,SQN 415,273-5860,RA I - BRASILIA,Publica,Inf/Reg,7.000000,M  V,0.000000,0.000000,146.000000,5.000000,180.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190605.000000,8257745.000000
-86,86,53001770.000000,Escola Classe 416 Sul,SQS 416,346-7277,RA I - BRASILIA,Publica,Inf/Reg,10.000000,M  V,0.000000,0.000000,96.000000,4.000000,286.000000,11.000000,0.000000,0.000000,0.000000,0.000000,12.000000,0.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186970.000000,8246890.000000
-87,87,53001788.000000,Escola Classe 708 Norte,SHCGN 707/708,274-5781,RA I - BRASILIA,Publica,Reg/Supl,9.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,341.000000,18.000000,0.000000,0.000000,0.000000,0.000000,10.000000,10.000000,6.000000,238.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190080.000000,8254620.000000
-88,88,53001796.000000,Escola Classe 711 Norte,SHCGN 711,273-0262,RA I - BRASILIA,Publica,Regular,10.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,392.000000,31.000000,0.000000,0.000000,36.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189680.000000,8255940.000000
-89,89,53001800.000000,Escola Classe do Setor Militar Urbano,Area Especial da QRO SMU,233-8362,RA I - BRASILIA,Publica,Inf/Reg,9.000000,M  V,0.000000,0.000000,26.000000,1.000000,176.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185860.000000,8253820.000000
-91,91,53001834.000000,Escola Normal de Brasilia,SGAS 907 Conjunto A,244-1893,RA I - BRASILIA,Publica,Inf/Reg/Supl,41.000000,M  V  N  I,0.000000,0.000000,331.000000,13.000000,669.000000,25.000000,0.000000,0.000000,549.000000,53.000000,23.000000,0.000000,5.000000,579.000000,28.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188350.000000,8250345.000000
-92,92,53001893.000000,Escola do Parque da Cidade,SGAS Q 909 Conjunto A  Fundos,243-1225,RA I - BRASILIA,Publica,Regular,14.000000,M  V  I,0.000000,0.000000,0.000000,0.000000,93.000000,14.000000,92.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187800.000000,8250050.000000
-93,93,53001966.000000,Escola da Acao Social do Planalto,SGAS Q 616 Modulos 116/117,346-7334,RA I - BRASILIA,Publica,Regular,5.000000,M  V,0.000000,0.000000,0.000000,0.000000,182.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,16.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187130.000000,8246640.000000
-94,94,53002148.000000,Escola Meninos e Meninas do Parque,Parque da Cidade - Estacionamento 06,322-7631,RA I - BRASILIA,Publica,Regular,5.000000,I,0.000000,0.000000,0.000000,0.000000,40.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186530.000000,8249880.000000
-95,95,53002210.000000,Jardim de Infancia 21 de Abril,Praca 21 de Abril  EQS 707/708,242-0390,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,191.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188580.000000,8249900.000000
-96,96,53002237.000000,Jardim de Infancia da 102 Sul,SQS 102,225-2838,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,160.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190350.000000,8250670.000000
-97,97,53002245.000000,Jardim de Infancia da 106 Norte,SQN 106,274-4760,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,302.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190970.000000,8254450.000000
-98,98,53002253.000000,Jardim de Infancia da 108 Sul,SQS 108,242-7933,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,221.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188790.000000,8249145.000000
-99,99,53002261.000000,Jardim de Infancia da 114 Sul,SQS 114,242-3242,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,235.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187040.000000,8247885.000000
-100,100,53002270.000000,Jardim de Infancia da 208 Sul,SQS 208,242-4551,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,264.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,5.000000,4.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189055.000000,8248800.000000
-101,101,53002288.000000,Jardim de Infancia da 302 Norte,SQN 302,226-5736,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,255.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190710.000000,8253080.000000
-102,102,53002296.000000,Jardim de Infancia da 303 Sul,SQS 303,226-7198,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,204.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189900.000000,8250755.000000
-103,103,53002300.000000,Jardim de Infancia da 304 Norte,SQN 304,224-5783,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,242.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190725.000000,8253740.000000
-104,104,53002318.000000,Jardim de Infancia da 305 Sul,SQS 305,243-0228,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,233.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189380.000000,8250140.000000
-105,105,53002326.000000,Jardim de Infancia da 308 Sul,SQS 308,243-2214,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,217.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188585.000000,8249490.000000
-106,106,53002334.000000,Jardim de Infancia da 312 Norte,SQN 312,273-6992,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,266.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189980.000000,8256450.000000
-107,107,53002342.000000,Jardim de Infancia da 314 Sul,SQS 314,245-5119,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,150.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186875.000000,8248160.000000
-108,108,53002350.000000,Jardim de Infancia da 316 Sul,SQS 316,245-1969,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,243.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186390.000000,8247840.000000
-109,109,53002369.000000,Jardim de Infancia da 404 Norte,SQN 404,223-1803,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,271.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191720.000000,8253840.000000
-463,463,53008774.000000,Centro de Ensino de 1o Grau 01 do Cruzeiro,SRES Lote 06,234-2463,RA XI - CRUZEIRO,Publica,Reg/Supl,35.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,418.000000,16.000000,577.000000,33.000000,0.000000,0.000000,0.000000,1.000000,0.000000,224.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185300.000000,8252710.000000
-464,464,53008782.000000,Centro de Ensino de 1o Grau 02 do Cruzeiro,SHCES Q 309 Lote 01,234-1464,RA XI - CRUZEIRO,Publica,Reg/Supl,25.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,724.000000,35.000000,0.000000,0.000000,8.000000,0.000000,1.000000,850.000000,27.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184780.000000,8251740.000000
-465,465,53008790.000000,Centro Educacional 01 do Cruzeiro,SRES Area Especial F Lote G,234-4492,RA XI - CRUZEIRO,Publica,Regular,15.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,333.000000,14.000000,775.000000,48.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185045.000000,8252880.000000
-466,466,53008804.000000,Centro Educacional 02 do Cruzeiro,SHCES Q 805 Lote 02,234-4939,RA XI - CRUZEIRO,Publica,Reg/Supl,20.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,816.000000,41.000000,763.000000,33.000000,0.000000,1.000000,0.000000,336.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185100.000000,8251460.000000
-467,467,53008820.000000,Escola Classe 04 do Cruzeiro,SHCE-EQ 405/407 Lote 01,233-8885,RA XI - CRUZEIRO,Publica,Inf/Reg,8.000000,M  V,0.000000,0.000000,17.000000,1.000000,274.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184785.000000,8251470.000000
-468,468,53008839.000000,Escola Classe 05 do Cruzeiro,SHCES-EQ 201/203 Lote 01,233-8891,RA XI - CRUZEIRO,Publica,Inf/Reg,16.000000,M  V,0.000000,0.000000,65.000000,2.000000,440.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184540.000000,8251175.000000
-469,469,53008847.000000,Escola Classe 06 do Cruzeiro,SHCES Q 807,233-8680,RA XI - CRUZEIRO,Publica,Inf/Reg,15.000000,M  V,0.000000,0.000000,29.000000,1.000000,333.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185150.000000,8251660.000000
-470,470,53008855.000000,Escola Classe 08 do Cruzeiro,AOS 06/08 Lote 03,234-1656,RA XI - CRUZEIRO,Publica,Inf/Reg/Supl,20.000000,M  V  N,0.000000,0.000000,343.000000,12.000000,365.000000,13.000000,0.000000,0.000000,0.000000,0.000000,9.000000,0.000000,1.000000,285.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184370.000000,8250550.000000
-471,471,53008898.000000,Jardim de Infancia 01 do Cruzeiro,SRES Lote 05 Setor Educacional,233-1072,RA XI - CRUZEIRO,Publica,Infantil,18.000000,M  V,0.000000,0.000000,411.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185375.000000,8252750.000000
-528,528,53009479.000000,Centro Educacional do Lago - CEL,SHIS QI 09 Conjunto 10 Lote H,248-0491,RA XVI - LAGO SUL,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,547.000000,27.000000,514.000000,28.000000,0.000000,0.000000,0.000000,444.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191820.000000,8246735.000000
-540,540,53009410.000000,Centro de Ensino de 1o Grau 01 do Lago Norte,SHIN QI 04/06 Area Especial,577-2528,RA XVIII  - LAGO NORTE,Publica,Inf/Reg/Supl,20.000000,M  V  N,0.000000,0.000000,28.000000,1.000000,342.000000,15.000000,809.000000,37.000000,0.000000,0.000000,0.000000,0.000000,0.000000,360.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,192010.000000,8258485.000000
-546,546,53000781.000000,Colegio Arvense - Centro de Ensino de 1o Grau,EQN 712/912 - Conj C,273-0958,RA I - BRASILIA,Particular,Inf/Reg,23.000000,M V,119.000000,6.000000,160.000000,8.000000,177.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189350.000000,8256240.000000
-547,547,53000790.000000,Centro de Artes e Recreacoes Ursinho Feliz,EQS 112/312 - Lote C,244-2539,RA I - BRASILIA,Particular,Infantil,6.000000,M V,111.000000,5.000000,62.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187570.000000,8248430.000000
-548,548,53000803.000000,Centro Infantil Reino Encantado,EQS 204/404 - Lote C,223-7122,RA I - BRASILIA,Particular,Infantil,9.000000,M  V,187.000000,10.000000,157.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190280.000000,8249710.000000
-549,549,53000811.000000,Casa da Crianca Pao de Santo Antonio,SGAS 906 - Modulo 10,242-2337,RA I - BRASILIA,Particular,Infantil,8.000000,I V,79.000000,0.000000,53.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188560.000000,8250500.000000
-550,550,53000838.000000,Centro de Ensino Compacto Junior,EQN 212/412 - Area Especial,273-5091,RA I - BRASILIA,Particular,Inf/Reg,12.000000,M V,24.000000,2.000000,86.000000,6.000000,168.000000,8.000000,197.000000,13.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190800.000000,8256780.000000
-551,551,53000900.000000,Centro de Ensino de 1o Grau Candanguinho,SEPS EQ 713/913 - Conj D,245-2004,RA I - BRASILIA,Particular,Inf/Reg,23.000000,M V,218.000000,11.000000,350.000000,16.000000,396.000000,19.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187030.000000,8248900.000000
-552,552,53000935.000000,Centro de Ensino de 1o Grau Popeye,EQN 204/404 - Conj C,226-4750,RA I - BRASILIA,Particular,Inf/Reg,9.000000,M V,53.000000,4.000000,92.000000,6.000000,64.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191600.000000,8253950.000000
-553,553,53000943.000000,Viver Centro de Ensino,SHGCN 706 - Conj A - Blocos A/B,349-3434,RA I - BRASILIA,Particular,Inf/Reg,17.000000,M V,36.000000,4.000000,101.000000,8.000000,143.000000,9.000000,90.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190250.000000,8254300.000000
-554,554,53000951.000000,INEI Centro Educacional,SGAS 604 - Conj C - Lotes 25 e 26,226-9877,RA I - BRASILIA,Particular,Inf/Reg,38.000000,M V,95.000000,6.000000,286.000000,13.000000,535.000000,19.000000,488.000000,22.000000,143.000000,16.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190720.000000,8249520.000000
-555,555,53000960.000000,Centro de Ensino Mauricio Salles de Mello,SHCGN 708 - Bloco C,272-1208,RA I - BRASILIA,Particular,Inf/Reg,22.000000,M V,50.000000,4.000000,145.000000,8.000000,284.000000,16.000000,286.000000,25.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189980.000000,8254760.000000
-556,556,53000226.000000,Centro de Ensino Tecnologico de Brasilia - CETEB,SGAS 910 - Conj D,243-8011,RA I - BRASILIA,Particular,Supletivo,19.000000,N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2684.000000,29.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187460.000000,8249930.000000
-557,557,53000293.000000,Centro Educacional Alfa,CRN 502 - Bloco B - No 68,321-4481,RA I - BRASILIA,Particular,Supletivo,4.000000,V N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,168.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190570.000000,8253100.000000
-558,558,53000978.000000,Centro Educacional Alvorada,SGAN 916 - Modulo C/D,273-6181,RA I - BRASILIA,Particular,Regular,23.000000,M  V,0.000000,0.000000,25.000000,3.000000,88.000000,11.000000,138.000000,16.000000,242.000000,27.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188870.000000,8257600.000000
-559,559,53001001.000000,Centro Educacional Compacto Integral,SGAS 601 - Conj A,224-0528,RA I - BRASILIA,Particular,Reg/Supl,14.000000,M V N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,163.000000,13.000000,269.000000,16.000000,0.000000,0.000000,0.000000,652.000000,37.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191450.000000,8250470.000000
-560,560,53001028.000000,Centro Educacional do CEUB,SEPN 707/907 - Lote C - Bloco 6,340-1835,RA I - BRASILIA,Particular,Regular,42.000000,M V,0.000000,0.000000,82.000000,6.000000,265.000000,12.000000,658.000000,31.000000,373.000000,20.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189820.000000,8254750.000000
-561,561,53001052.000000,Centro Educacional Juscelino Kubitschek,SGAN 913 - Bloco A,347-6557,RA I - BRASILIA,Particular,Reg/Supl,16.000000,M  V  N,0.000000,0.000000,36.000000,3.000000,91.000000,10.000000,249.000000,17.000000,437.000000,14.000000,0.000000,0.000000,0.000000,321.000000,20.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189250.000000,8256450.000000
-562,562,53001060.000000,Centro Educacional La Salle,SGAS 906 - Conj D,242-7878,RA I - BRASILIA,Particular,Inf/Reg,32.000000,M V N,0.000000,0.000000,0.000000,0.000000,304.000000,17.000000,615.000000,33.000000,778.000000,45.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188660.000000,8250270.000000
-563,563,53001079.000000,Centro Educacional La Salle - Creche,EQS 705/905 - Lote A,244-7043,RA I - BRASILIA,Particular,Infantil,10.000000,M V,38.000000,4.000000,85.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189090.000000,8250560.000000
-564,564,53001087.000000,Centro Educacional Leonardo da Vinci,SEUPS 703 - Bloco 1 - Lote B,226-6703,RA I - BRASILIA,Particular,Regular,42.000000,M,0.000000,0.000000,0.000000,0.000000,89.000000,8.000000,355.000000,18.000000,711.000000,38.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189470.000000,8251060.000000
-565,565,53001095.000000,Centro Educacional Leonardo da Vinci,SGAN 914 - Conj I,340-1616,RA I - BRASILIA,Particular,Regular,58.000000,M,0.000000,0.000000,0.000000,0.000000,286.000000,14.000000,905.000000,29.000000,1083.000000,48.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189040.000000,8257000.000000
-566,566,53001109.000000,Centro Educacional Maria Auxiliadora,SEPS 702 - Bloco C,224-5315,RA I - BRASILIA,Particular,Inf/Reg,29.000000,M V N,17.000000,1.000000,103.000000,6.000000,268.000000,8.000000,513.000000,47.000000,125.000000,16.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189800.000000,8251140.000000
-567,567,53001117.000000,Centro Educacional Nossa Senhora do Rosario,SGAS 908 - Lotes 23 e 24,243-7758,RA I - BRASILIA,Particular,Inf/Reg,16.000000,M V,16.000000,1.000000,74.000000,6.000000,158.000000,13.000000,202.000000,17.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188100.000000,8249990.000000
-568,568,53001125.000000,Colegio Integrado Objetivo,SGAS 913 - Lotes 54/55,245-4544,RA I - BRASILIA,Particular,Regular,33.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1627.000000,46.000000,4087.000000,116.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186850.000000,8249120.000000
-569,569,53001141.000000,Colegio Integrado Objetivo,SGAS 914 - Lotes 67/68,245-2445,RA I - BRASILIA,Particular,Inf/Reg,37.000000,M  V,77.000000,3.000000,324.000000,14.000000,813.000000,29.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186440.000000,8248600.000000
-570,570,53001150.000000,Centro Educacional Planalto,SEUPS EQ 708/907 - Conjunto B,243-2769,RA I - BRASILIA,Particular,Inf/Reg,28.000000,M V,0.000000,0.000000,18.000000,1.000000,59.000000,4.000000,334.000000,18.000000,494.000000,29.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188400.000000,8250050.000000
-571,571,53001168.000000,Centro Educacional Projecao,SGAN 906 - Conj A,340-3106,RA I - BRASILIA,Particular,Inf/Reg,19.000000,M V,34.000000,3.000000,85.000000,4.000000,110.000000,10.000000,100.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189870.000000,8254110.000000
-572,572,53000064.000000,Centro Educacional Projecao,SGAS 906 - Modulo A,244-6161,RA I - BRASILIA,Particular,Regular,6.000000,M,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,146.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188650.000000,8250600.000000
-573,573,53001184.000000,Centro Educacional Rodolpho de Moraes Rego,SEUPS EQ 706/906 - Conjunto A,242-9087,RA I - BRASILIA,Particular,Regular,13.000000,M V,0.000000,0.000000,0.000000,0.000000,125.000000,14.000000,133.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188900.000000,8250370.000000
-574,574,53001192.000000,Centro Educacional Sagrada Familia,SGAN 906 - Modulo C/D,272-1727,RA I - BRASILIA,Particular,Inf/Reg,28.000000,M  V,28.000000,4.000000,117.000000,13.000000,335.000000,17.000000,402.000000,12.000000,128.000000,15.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189900.000000,8254230.000000
-575,575,53001222.000000,Centro Educacional Sigma,SGAS 912 - Conjunto A,346-3232,RA I - BRASILIA,Particular,Regular,70.000000,M V,0.000000,0.000000,0.000000,0.000000,244.000000,9.000000,1429.000000,38.000000,2240.000000,48.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187290.000000,8249570.000000
-576,576,53001281.000000,Colegio Batista de Brasilia,SGAS 905 - Modulo 04,242-1898,RA I - BRASILIA,Particular,Inf/Reg,21.000000,M V,58.000000,4.000000,198.000000,7.000000,322.000000,21.000000,174.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188820.000000,8250630.000000
-577,577,53001290.000000,Colegio Cor Jesu,SGAS 615 - Conjunto G,346-5566,RA I - BRASILIA,Particular,Inf/Reg,20.000000,M  V,18.000000,2.000000,136.000000,7.000000,274.000000,12.000000,341.000000,23.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187350.000000,8246820.000000
-578,578,53001303.000000,Colegio Dom Bosco,SEPS 702 - Bloco A,223-2650,RA I - BRASILIA,Particular,Inf/Reg,30.000000,M V,0.000000,0.000000,31.000000,2.000000,294.000000,16.000000,697.000000,34.000000,300.000000,21.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189670.000000,8251110.000000
-579,579,53001311.000000,Colegio Imaculada Conceicao,SGAS 606 - Conjunto C,243-5259,RA I - BRASILIA,Particular,Inf/Reg,14.000000,M  V,24.000000,4.000000,90.000000,8.000000,190.000000,13.000000,314.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190100.000000,8248830.000000
-580,580,53001320.000000,Colegio Madre Carmen Salles,SGAN 604 - Conjunto D,223-2863,RA I - BRASILIA,Particular,Inf/Reg,29.000000,M  V,28.000000,2.000000,178.000000,10.000000,383.000000,15.000000,395.000000,13.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,192020.000000,8253930.000000
-581,581,53001338.000000,Colegio Marista de Brasilia-1o Grau,SGAS 609 - Conjunto A,242-1243,RA I - BRASILIA,Particular,Inf/Reg,38.000000,M  V,0.000000,0.000000,521.000000,18.000000,1059.000000,29.000000,1273.000000,46.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189290.000000,8248230.000000
-582,582,53001346.000000,Colegio Marista de Brasilia-2o Grau,SGAS 615 - Conjunto C,346-2288,RA I - BRASILIA,Particular,Regular,33.000000,M,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1477.000000,61.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187520.000000,8246910.000000
-583,583,53001362.000000,Colegio Notre Dame,SGAS 914 - Lotes 63/64,245-2836,RA I - BRASILIA,Particular,Inf/Reg,22.000000,M  V,6.000000,0.000000,50.000000,6.000000,152.000000,12.000000,131.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186560.000000,8248700.000000
-584,584,53001370.000000,Colegio Pio XII,SGAS 609 - Conjunto C,242-1335,RA I - BRASILIA,Particular,Inf/Reg,24.000000,M  V,56.000000,4.000000,124.000000,7.000000,256.000000,10.000000,349.000000,23.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189150.000000,8248100.000000
-585,585,53001389.000000,Colegio Sagrado Coracao de Maria,SHCGN 702 - Conjunto C,321-8588,RA I - BRASILIA,Particular,Inf/Reg,23.000000,M  V,27.000000,3.000000,105.000000,7.000000,247.000000,13.000000,284.000000,15.000000,31.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190300.000000,8253100.000000
-586,586,53001397.000000,Colegio Santa Rosa,SGAS 601 - Conjunto C - Lote 3,224-2966,RA I - BRASILIA,Particular,Inf/Reg,23.000000,M  V,26.000000,1.000000,233.000000,10.000000,531.000000,22.000000,507.000000,28.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191380.000000,8250300.000000
-587,587,53001400.000000,Colegio Santa Doroteia,SGAN 911 - Conjunto B,274-5110,RA I - BRASILIA,Particular,Inf/Reg,25.000000,M V,33.000000,3.000000,104.000000,9.000000,250.000000,15.000000,283.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189180.000000,8255700.000000
-588,588,53001419.000000,Creche Fundacao Cabo Frio,SGAN 608 - Modulo A,274-5176,RA I - BRASILIA,Particular,Infantil,10.000000,I,186.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191700.000000,8255320.000000
-589,589,53001427.000000,Cresca Centro de Realizacao Criadora,SEUPS EQ 703/903 - Bloco C,224-1640,RA I - BRASILIA,Particular,Inf/Reg,15.000000,M V,28.000000,2.000000,104.000000,6.000000,159.000000,8.000000,110.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189340.000000,8250950.000000
-590,590,53001826.000000,Educandario Espirito Santo,SGAN 609 - Conjunto A/B,273-5089,RA I - BRASILIA,Particular,Infantil,6.000000,M V,104.000000,4.000000,172.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191620.000000,8255700.000000
-591,591,53001907.000000,Escola Adventista de Brasilia,SGAS 611 - Modulo 75,242-3847,RA I - BRASILIA,Particular,Inf/Reg,16.000000,M,0.000000,0.000000,54.000000,3.000000,131.000000,9.000000,215.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188820.000000,8247800.000000
-592,592,53001915.000000,Escola Americana de Brasilia,SGAS 605 - Bloco E - Lote 34,243-3237,RA I - BRASILIA,Particular,Inf/Reg,40.000000,I,0.000000,0.000000,157.000000,8.000000,183.000000,14.000000,225.000000,25.000000,170.000000,21.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190380.000000,8249150.000000
-593,593,53001923.000000,Escola Anjo da Guarda,SGAN 913 - Lote A,272-4851,RA I - BRASILIA,Particular,Infantil,5.000000,M  V,78.000000,4.000000,153.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189180.000000,8256470.000000
-594,594,53001931.000000,Centro Educacional Canarinho,SGAS 906 - Modulo 9,244-3950,RA I - BRASILIA,Particular,Inf/Reg,8.000000,M  V,42.000000,2.000000,102.000000,6.000000,95.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188820.000000,8250400.000000
-595,595,53001940.000000,Centro Educacional Canarinho,EQS 212/412 - Bloco C,243-2891,RA I - BRASILIA,Particular,Infantil,6.000000,M  V,81.000000,4.000000,138.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188020.000000,8247840.000000
-596,596,53001958.000000,Escola Cenecista Alzira Sodre,SGAN 608 - Modulo D,272-3233,RA I - BRASILIA,Particular,Infantil,12.000000,M V,154.000000,6.000000,113.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191700.000000,8255480.000000
-597,597,53001974.000000,Escola de 1o Grau Vicenta Maria,SGAS 606 - Conjunto A,243-2884,RA I - BRASILIA,Particular,Regular,4.000000,N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,99.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190240.000000,8249000.000000
-598,598,53001982.000000,Escola de 2o Grau Objetivo,SGAS 904 - Lotes A/C,225-7990,RA I - BRASILIA,Particular,Supletiv,18.000000,M,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,781.000000,61.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189270.000000,8250810.000000
-599,599,53002008.000000,Escola Fundamental Alvacir Vite Rossi,SGAN 908 - Conjunto B,347-8486,RA I - BRASILIA,Particular,Regular,12.000000,M V,0.000000,0.000000,0.000000,0.000000,341.000000,17.000000,92.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189530.000000,8254860.000000
-600,600,53002016.000000,Escola Golfinho Dourado,EQN 116/316 - Bloco C,274-0635,RA I - BRASILIA,Particular,Infantil,11.000000,M V,95.000000,5.000000,116.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189630.000000,8257890.000000
-601,601,53002024.000000,Escola Logosofica Gonzalez Pecotche,SHCGN 704 - Area Especial,224-9205,RA I - BRASILIA,Particular,Inf/Reg,10.000000,M V,50.000000,4.000000,73.000000,5.000000,88.000000,6.000000,81.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190310.000000,8253690.000000
-602,602,53002032.000000,Escola Maternal e Jardim de Infancia Branca de Neve,SEUPS EQ 706/906 - Conjunto A,242-9087,RA I - BRASILIA,Particular,Infantil,6.000000,M V,82.000000,5.000000,122.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188930.000000,8250380.000000
-603,603,53002040.000000,Escola Moderna Maria Montessori,SGAS 912 - Lotes 50/52,346-2733,RA I - BRASILIA,Particular,Infantil,19.000000,M V,157.000000,7.000000,213.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186850.000000,8249440.000000
-604,604,53002059.000000,Escola Monteiro Lobato de 1o Grau,SHCGN 713 - Area Especial,273-1270,RA I - BRASILIA,Particular,Inf/Reg,20.000000,M V,20.000000,2.000000,60.000000,6.000000,99.000000,7.000000,100.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189460.000000,8256590.000000
-605,605,53002067.000000,Escola Nossa Senhora de Fatima,SGAS 906 - Conjunto F,243-8646,RA I - BRASILIA,Particular,Inf/Reg,18.000000,M,9.000000,1.000000,18.000000,2.000000,42.000000,4.000000,119.000000,10.000000,210.000000,17.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188560.000000,8250380.000000
-606,606,53002075.000000,Escola Paroquial Santo Antonio,SGAS 911 - Conjunto B,242-7299,RA I - BRASILIA,Particular,Inf/Reg,33.000000,M  V,60.000000,2.000000,425.000000,17.000000,823.000000,35.000000,803.000000,40.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187460.000000,8249630.000000
-607,607,53002083.000000,Escola Pedacinho do Ceu,EQN 108/308 - Lote C,274-1311,RA I - BRASILIA,Particular,Infantil,9.000000,M V,149.000000,7.000000,95.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190530.000000,8255180.000000
-608,608,53002091.000000,Escola Positiva de Brasilia,SGAN 905 - Modulo A,274-8261,RA I - BRASILIA,Particular,Inf/Reg,9.000000,M V,23.000000,2.000000,25.000000,3.000000,16.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189990.000000,8253920.000000
-609,609,53002105.000000,Escola Sao Camilo,SGAN 914 - Conjunto G,349-4308,RA I - BRASILIA,Particular,Inf/Reg,9.000000,M V I,120.000000,4.000000,158.000000,8.000000,145.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189020.000000,8256900.000000
-610,610,53002113.000000,Escola Sao Carlos,SGAS 905 - Lotes 1/2,242-9088,RA I - BRASILIA,Particular,Inf/Reg,16.000000,M  V,28.000000,2.000000,147.000000,6.000000,268.000000,10.000000,315.000000,24.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188950.000000,8250820.000000
-611,611,53002130.000000,Escola Tecnica de Saude Golden Garden,SGAS 611 - Conjunto D,244-9664,RA I - BRASILIA,Particular,Regular,2.000000,M,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,22.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188820.000000,8247790.000000
-612,612,53002164.000000,INEI Centro Educacional,SGAN 605 - Modulo A,349-1088,RA I - BRASILIA,Particular,Inf/Reg,38.000000,M  V,85.000000,3.000000,313.000000,12.000000,523.000000,20.000000,515.000000,21.000000,161.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191910.000000,8254500.000000
-613,613,53002172.000000,Instituto de Educacao de Brasilia - IEB,SHCGN 712 - Conj B - Area Especial,274-6575,RA I - BRASILIA,Particular,Inf/Reg,8.000000,V,19.000000,1.000000,42.000000,3.000000,43.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189550.000000,8256160.000000
-614,614,53002180.000000,Escola Educacional Filantropica,SGAS 611 - Modulo 77,244-4087,RA I - BRASILIA,Particular,Infantil,5.000000,M V,72.000000,5.000000,41.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188800.000000,8247700.000000
-615,615,53002199.000000,Instituto Nossa Senhora do Carmo,SGAS 913 - Bloco C,346-6700,RA I - BRASILIA,Particular,Inf/Reg,15.000000,M V,35.000000,3.000000,56.000000,7.000000,140.000000,13.000000,171.000000,15.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186970.000000,8249260.000000
-616,616,53002202.000000,Sociedade Educacional Saci Perere,SEUPS EQ 708/907 - Modulo D,243-4741,RA I - BRASILIA,Particular,Inf/Reg,15.000000,M,15.000000,2.000000,36.000000,3.000000,79.000000,4.000000,86.000000,10.000000,18.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188280.000000,8249990.000000
-617,617,53002377.000000,Escola Meu Pequeno Mundo,EQS 216/416 - Bloco C,245-5333,RA I - BRASILIA,Particular,Infantil,7.000000,M V,81.000000,2.000000,58.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186880.000000,8246950.000000
-618,618,53002385.000000,Centro de Ensino Juscelino Kubitschek,SGAN 906 - Bloco F,273-5544,RA I - BRASILIA,Particular,Inf/Reg/Esp,25.000000,M  V,108.000000,4.000000,85.000000,4.000000,68.000000,7.000000,81.000000,9.000000,0.000000,0.000000,5.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189860.000000,8254370.000000
-619,619,53002393.000000,Associacao Educacional Sol Nascente,SGAS 610 - Bloco D - Modulo 71,244-3634,RA I - BRASILIA,Particular,Infantil,6.000000,M V,52.000000,3.000000,70.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189000.000000,8247930.000000
-620,620,53002407.000000,Pre-Escola Menino de Deus,SGAN 915 - Conjunto C,273-7202,RA I - BRASILIA,Particular,Infantil,4.000000,M V,9.000000,1.000000,39.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188990.000000,8257180.000000
-621,621,53002415.000000,Renascer Creche Maternal e Jardim de Infancia,EQS 116/316 - Bloco C - Area Especial,245-1820,RA I - BRASILIA,Particular,Inf/Esp,9.000000,M V,110.000000,0.000000,20.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,15.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186410.000000,8247550.000000
-622,622,53002423.000000,Sociedade Sibipiruna,SHCGN 715 - Area Especial - Bloco A,273-1144,RA I - BRASILIA,Particular,Infantil,5.000000,M V,55.000000,4.000000,75.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189300.000000,8257330.000000
-623,623,0.000000,Escola Batista IBAN,EQN 313/314 - Area Especial - Lote A,349-2428,RA I - BRASILIA,Particular,Infantil,6.000000,M V,27.000000,4.000000,27.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189870.000000,8256970.000000
-624,624,0.000000,Creche Maternal e Pre-Escola Marly Sarney,SGAS 914 - Conjunto 63 - Lote A,245-3225,RA I - BRASILIA,Particular,Infantil,2.000000,M V,3.000000,1.000000,5.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186510.000000,8248820.000000
-625,625,0.000000,Centro de Ensino de 1o Grau Renascenca,SGAN 914 - Conjunto B,273-6284,RA I - BRASILIA,Particular,Inf/Reg,8.000000,M V,33.000000,2.000000,44.000000,4.000000,18.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188925.000000,8256730.000000
-626,626,0.000000,Pimentinhas Escola de Educacao Infantil,EQS 104/304 - Lote C,225-7215,RA I - BRASILIA,Particular,Infantil,6.000000,M V,50.000000,3.000000,27.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189715.000000,8250215.000000
-627,627,53000013.000000,Assoc Maes Pais Amigos e Reabilitad Excepcionais - AMPARE,SHCGN 709 - Area Especial C,274-9561,RA I - BRASILIA,Conveniada,Especial,15.000000,M V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,120.000000,0.000000,17.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189920.000000,8255210.000000
-628,628,53000030.000000,Assistencia de Pais e Amigos dos Excepcionais - APAE/DF,CRS 508 - Bloco C - Salas 10 a 16,244-1083,RA I - BRASILIA,Conveniada,Especial,7.000000,M V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,68.000000,0.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188460.000000,8249560.000000
-629,629,0.000000,Associacao de Pais e Amigos do Excepcionais - APAE/DF,EQN 711/911 - Lote E,347-0460,RA I - BRASILIA,Conveniada,Especial,4.000000,M V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,30.000000,0.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189470.000000,8255940.000000
-630,630,53000102.000000,Sociedade Pestalozi de Brasilia,Avenida das Nacoes - Trecho 03 - Lote 04,226-0101,RA I - BRASILIA,Conveniada,Especial,10.000000,I,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,108.000000,0.000000,19.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,194100.000000,8250250.000000
-631,631,53000331.000000,Centro Educacional de Audicao e Linguagem - CEAL,SGAN 909 - Conjunto B,272-2602,RA I - BRASILIA,Conveniada,Especial,40.000000,M V I,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,283.000000,0.000000,51.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189580.000000,8255120.000000
-632,632,53000820.000000,Casa de Ismael - Lar Primeira Luz,SGAN 914 - Conjunto C,273-2268,RA I - BRASILIA,Conveniada,Infantil,2.000000,M,20.000000,1.000000,53.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189110.000000,8256700.000000
-634,634,53002158.000000,Grupo da Fraternidade Cicero Pereira - CAMEGE,SGAN 915 - Modulo E,273-6803,RA I - BRASILIA,Conveniada,Infantil,2.000000,M V I,96.000000,0.000000,61.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188900.000000,8257280.000000
-635,635,53002229.000000,Jardim de Infancia Casa do Candango,SGAS 603 - Conjunto A,223-3516,RA I - BRASILIA,Conveniada,Infantil,12.000000,M I,350.000000,5.000000,130.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191020.000000,8249860.000000
-636,636,0.000000,Creche Acao Social Paula Frassinetti,SGAN 911 - Conjunto B-1,274-0823,RA I - BRASILIA,ENG,Inf/Reg,7.000000,I V,30.000000,4.000000,65.000000,6.000000,45.000000,6.000000,10.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189105.000000,8255680.000000
-637,637,53001257.000000,Centro de Linguas - CIL,SGAS 908 Modulo 25/26,244-8881,RA I - BRASILIA,Publica,Linguas,26.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,6073.000000,53.000000,0.000000,0.000000,0.000000,0.000000,188220.000000,8250115.000000
-638,638,53001842.000000,Escola Parque 210/211 Norte,EQN 210/211,273-2371,RA I - BRASILIA,Publica,Esc Parque,15.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1247.000000,51.000000,0.000000,0.000000,0.000000,0.000000,190900.000000,8256180.000000
-639,639,53001850.000000,Escola Parque 210/211 Sul,EQS 210/211,244-3659,RA I - BRASILIA,Publica,Esc Parque,19.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1275.000000,44.000000,0.000000,0.000000,0.000000,0.000000,188480.000000,8248280.000000
-640,640,53001869.000000,Escola Parque 303/304 Norte,EQN 303/304,224-2179,RA I - BRASILIA,Publica,Esc Parque,27.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2211.000000,67.000000,0.000000,0.000000,0.000000,0.000000,190660.000000,8253590.000000
-641,641,53001877.000000,Escola Parque 308 Sul,EQS 307/308,242-0273,RA I - BRASILIA,Publica,Esc Parque,21.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2493.000000,58.000000,0.000000,0.000000,0.000000,0.000000,188790.000000,8249625.000000
-642,642,53001885.000000,Escola Parque 313/314 Sul,EQS 313/314,245-4582,RA I - BRASILIA,Publica,Esc Parque,29.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2695.000000,64.000000,0.000000,0.000000,0.000000,0.000000,187060.000000,8248325.000000
-643,643,53001990.000000,Escola de Musica de Brasilia,SGAS 602 Conjunto D,225-5075,RA I - BRASILIA,Publica,Musica,74.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2049.000000,150.000000,0.000000,0.000000,191305.000000,8250150.000000
-644,644,53002121.000000,Escola Tecnica de Saude de Brasilia,SHN 501 Bloco A,325-4944,RA I - BRASILIA,Publica,Tecnica,7.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,137.000000,15.000000,190610.000000,8252810.000000
-645,645,0.000000,SENAI - Centro de Treinamento/CETRES,SIG Qd 06 Lote 1100,344-2106,RA I - BRASILIA,Particular,Profissionaliza,16.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,12230.000000,0.000000,187830.000000,8251650.000000
-646,646,53001206.000000,Centro Educ Setor Leste - Setorial de Linguas - SEL,SGAS 611/612 Conjunto E,243-8263,RA I - BRASILIA,Publica,Linguas,26.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2408.000000,32.000000,0.000000,0.000000,0.000000,0.000000,188630.000000,8247690.000000
-830,830,53008812.000000,Centro Educacional Ciman,Q 501 - Conj D - Lote 2,233-8897,RA XI - CRUZEIRO,Particular,Regular,16.000000,M V,0.000000,0.000000,0.000000,0.000000,438.000000,20.000000,532.000000,21.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184740.000000,8251050.000000
+TABLE
+CADASTRAL	ROTULO
+SEPARATOR ,
+ROTULO,TEXT,32,0
+NOME,TEXT,32,0
+CODIGO,REAL,17,8
+NOME_ESC,TEXT,60,0
+ENDERECO,TEXT,55,0
+TELEFONE,TEXT,13,0
+NOME_RA,TEXT,28,0
+TIPO,TEXT,11,0
+ENSINO,TEXT,15,0
+NO_SALAS,REAL,17,8
+TURNO,TEXT,11,0
+CRE_MAT_AL,REAL,17,8
+CRE_MAT_PF,REAL,17,8
+JARDIM_AL,REAL,17,8
+JARDIM_PF,REAL,17,8
+PG_1A4S_AL,REAL,17,8
+PG_1A4S_PF,REAL,17,8
+PG_5A8S_AL,REAL,17,8
+PG_5A8S_PF,REAL,17,8
+SEGRAU_AL,REAL,17,8
+SEGRAU_PF,REAL,17,8
+ESPECIA_AL,REAL,17,8
+ESP_CLS_CO,REAL,17,8
+ESPECIA_PF,REAL,17,8
+SUPLET_AL,REAL,17,8
+SUPLET_PF,REAL,17,8
+EXTR_AL,REAL,17,8
+EXTR_PF,REAL,17,8
+MUSIC_AL,REAL,17,8
+MUSIC_PF,REAL,17,8
+PROFISS_AL,REAL,17,8
+PROFISS_PF,REAL,17,8
+COORD_X,REAL,17,8
+COORD_Y,REAL,17,8
+INFO_END
+1,1,53008871.000000,Escola Recanto Cultural,Q 02 - Bloco K - Casa 26,233-2255,RA XI - CRUZEIRO,Particular,Infantil,4.000000,M V,31.000000,2.000000,46.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184880.000000,8252050.000000
+2,2,53008901.000000,Maternal e Jardim de Infancia Barquinho Amarelo,Q 10 - Bloco X - Casa 4,234-1149,RA XI - CRUZEIRO,Particular,Infantil,8.000000,M V,36.000000,2.000000,98.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185860.000000,8252050.000000
+3,3,0.000000,Maternal e Jardim de Infancia Matita Pere,Qd 6 - Bloco X - Casa 5,233-3786,RA XI - CRUZEIRO,Particular,Infantil,4.000000,M V,0.000000,0.000000,72.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185685.000000,8252275.000000
+4,4,0.000000,Escola Batista Sementinha do Saber,AOS 1/2 - Lote 7,233-3697,RA XI - CRUZEIRO,Particular,Infantil,4.000000,M V,33.000000,2.000000,26.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185140.000000,8250300.000000
+21,21,53009576.000000,INEI Centro de Ensino de 1o Grau,SHIS QI 7 - Conj 17 - Lote F,248-2450,RA XVI - LAGO SUL,Particular,Inf/Reg,17.000000,M,27.000000,2.000000,76.000000,3.000000,131.000000,6.000000,149.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191400.000000,8246450.000000
+22,22,53009592.000000,Instituto Nossa Senhora do Perpetuo Socorro,SHIS EQL 6/8 - Conj A,248-0043,RA XVI - LAGO SUL,Particular,Inf/Reg,15.000000,M V,39.000000,3.000000,115.000000,7.000000,216.000000,12.000000,181.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189700.000000,8246360.000000
+29,29,53009452.000000,Escola de 1o Grau Tia Bibia - INDI,SHIN QI 03 - Conj D - Area Especial,577-3935,RA XVIII  - LAGO NORTE,Particular,Inf/Reg,21.000000,M V,98.000000,5.000000,96.000000,4.000000,201.000000,10.000000,104.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,193120.000000,8258910.000000
+30,30,0.000000,Sempre Maternal e Jardim de Infancia,SHIN QI 9 - Conj 1 - Casa 28,368-5090,RA XVIII  - LAGO NORTE,Particular,Infantil,2.000000,M V,8.000000,1.000000,8.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,194600.000000,8257320.000000
+31,31,53001451.000000,Escola Classe 102 Sul,SQS 102,226-8224,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,378.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190285.000000,8250745.000000
+32,32,53001524.000000,Escola Classe 115 Norte,SQN 115,274-4960,RA I - BRASILIA,Publica,Inf/Reg/Supl,9.000000,M  V  N,0.000000,0.000000,50.000000,4.000000,394.000000,22.000000,0.000000,0.000000,0.000000,0.000000,0.000000,5.000000,0.000000,265.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189930.000000,8257645.000000
+33,33,53001575.000000,Escola Classe 302 Norte,SQN 302,224-8286,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,397.000000,13.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190770.000000,8253110.000000
+34,34,53000200.000000,CEE 02 de Brasilia,SGAS 612,242-4400,RA I - BRASILIA,Publica,Especial,32.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,221.000000,0.000000,100.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188420.000000,8247530.000000
+35,35,53000234.000000,CES da Asa Sul - CESAS,SGAS 602 Projecao D,225-3122,RA I - BRASILIA,Publica,Supletivo,31.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,7241.000000,78.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191095.000000,8250010.000000
+36,36,53000242.000000,CES Verde Oliva - CESVO,Batalhao de Policia do Exercito,225-5110,RA I - BRASILIA,Publica,Supletivo,14.000000,N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1119.000000,26.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186220.000000,8254440.000000
+37,37,53000439.000000,Centro Integrado de Ensino Especial-CIEE,SGAS 912 Conjunto E Lotes 42/49,346-6161,RA I - BRASILIA,Publica,Especial,63.000000,M  V  I,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,244.000000,0.000000,122.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187300.000000,8249355.000000
+38,38,53000714.000000,CEE de Deficientes Visuais,SGAS 612  Lote 12,242-1447,RA I - BRASILIA,Publica,Especial,45.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,130.000000,0.000000,59.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188495.000000,8247600.000000
+39,39,53000846.000000,CE de 1o Grau 01 de Brasilia,SQS 106,243-3843,RA I - BRASILIA,Publica,Regular,9.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,552.000000,35.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189520.000000,8249645.000000
+40,40,53000854.000000,CE de 1o Grau 01 do Planalto,Rua 03 Acampamento Tamboril,225-1408,RA I - BRASILIA,Publica,Inf/Reg/Supl,18.000000,M  V  N,0.000000,0.000000,67.000000,2.000000,389.000000,16.000000,425.000000,24.000000,0.000000,0.000000,0.000000,0.000000,0.000000,117.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,194720.000000,8251690.000000
+41,41,53000862.000000,CE de 1o Grau 02 de Brasilia,SQS 107,243-9892,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,509.000000,35.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189100.000000,8249355.000000
+42,42,53000870.000000,CE de 1o Grau 03 de Brasilia,SQS 103,223-4083,RA I - BRASILIA,Publica,Regular,10.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,826.000000,52.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190150.000000,8250500.000000
+43,43,53000889.000000,CE de 1o Grau 04 de Brasilia,SQS 113,242-4182,RA I - BRASILIA,Publica,Reg/Supl,10.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,897.000000,52.000000,0.000000,0.000000,0.000000,10.000000,0.000000,165.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187400.000000,8248050.000000
+44,44,53000897.000000,CE de 1o Grau 05 de Brasilia,SQS 408,242-0931,RA I - BRASILIA,Publica,Regular,10.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,763.000000,40.000000,0.000000,0.000000,0.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189295.000000,8248535.000000
+45,45,53000919.000000,CE de 1o Grau GAN,SGAN 603/604 Conjunto H,223-4863,RA I - BRASILIA,Publica,Regular,9.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,883.000000,55.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,192035.000000,8253650.000000
+46,46,53000927.000000,CE de 1o Grau POLIVALENTE,SGAS 913 Modulos 57/58,245-1178,RA I - BRASILIA,Publica,Regular,15.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,640.000000,48.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186790.000000,8248895.000000
+47,47,53000986.000000,CED CAN,SGAN 610 Modulo A,273-8001,RA I - BRASILIA,Publica,Regular,16.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,329.000000,37.000000,1003.000000,77.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191470.000000,8256050.000000
+48,48,53001010.000000,CED da Asa Norte - CEAN,SGAN 606 Modulos G/H,272-2338,RA I - BRASILIA,Publica,Regular,10.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,182.000000,11.000000,948.000000,65.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191850.000000,8254850.000000
+49,49,53001036.000000,CED ELEFANTE BRANCO,SGAS 908 Modulos 25/26,243-4588,RA I - BRASILIA,Publica,Regular,30.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,3670.000000,251.000000,0.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188230.000000,8250150.000000
+50,50,53001044.000000,CED GISNO,SGAN 908 Conjunto B,272-4103,RA I - BRASILIA,Publica,Reg/Supl,22.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,746.000000,38.000000,1094.000000,47.000000,0.000000,1.000000,0.000000,494.000000,17.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189700.000000,8254500.000000
+51,51,53001206.000000,CED SETOR LESTE,SGAS 611/612 Conjunto E,243-8263,RA I - BRASILIA,Publica,Regular,26.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,84.000000,9.000000,1913.000000,192.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188620.000000,8247680.000000
+52,52,53001214.000000,CED SETOR OESTE,SGAS 912/913,346-4224,RA I - BRASILIA,Publica,Regular,16.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1385.000000,70.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187125.000000,8249330.000000
+53,53,53001265.000000,CIE  CASEB,SGAS 909 Conjunto A,242-2266,RA I - BRASILIA,Publica,Regular,37.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1796.000000,107.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187975.000000,8249825.000000
+54,54,53001354.000000,Colegio Militar de Brasilia,SGAN 902/904,321-6664,RA I - BRASILIA,Publica,Regular,92.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1583.000000,90.000000,1602.000000,97.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189940.000000,8253200.000000
+55,55,53001435.000000,Escola Classe 07 do Cruzeiro,Area Especial RCG - SMC,234-4309,RA I - BRASILIA,Publica,Inf/Reg,4.000000,M  V,0.000000,0.000000,55.000000,5.000000,61.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,183835.000000,8255140.000000
+56,56,53001443.000000,Escola Classe 102 Norte,SQN 102,224-7507,RA I - BRASILIA,Publica,Reg/Supl,9.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,126.000000,6.000000,364.000000,23.000000,0.000000,0.000000,0.000000,0.000000,0.000000,141.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191025.000000,8253160.000000
+57,57,53001460.000000,Escola Classe 104 Norte,SQN 104,225-5789,RA I - BRASILIA,Publica,Regular,9.000000,M  V,0.000000,0.000000,0.000000,0.000000,32.000000,1.000000,574.000000,34.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190950.000000,8253890.000000
+58,58,53001478.000000,Escola Classe 106 Norte,SQN 106,273-7543,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,441.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190900.000000,8254540.000000
+59,59,53001486.000000,Escola Classe 108 Sul,SQS 108,242-4516,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,480.000000,13.000000,0.000000,0.000000,0.000000,0.000000,7.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188950.000000,8249220.000000
+60,60,53001494.000000,Escola Classe 111 Sul,SQS 111,242-2915,RA I - BRASILIA,Publica,Regular,10.000000,M  V,0.000000,0.000000,0.000000,0.000000,356.000000,10.000000,340.000000,17.000000,0.000000,0.000000,0.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187955.000000,8248490.000000
+61,61,53001508.000000,Escola Classe 113 Norte,SQN 113,273-7589,RA I - BRASILIA,Publica,Reg/Supl,9.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,593.000000,29.000000,0.000000,0.000000,0.000000,1.000000,0.000000,430.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190150.000000,8256960.000000
+62,62,53001516.000000,Escola Classe 114 Sul,SQS 114,242-3114,RA I - BRASILIA,Publica,Regular,7.000000,M  V,0.000000,0.000000,0.000000,0.000000,333.000000,7.000000,0.000000,0.000000,0.000000,0.000000,16.000000,2.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187145.000000,8247940.000000
+63,63,53001532.000000,Escola Classe 204 Sul,SQS 204,223-4071,RA I - BRASILIA,Publica,Reg/Supl,11.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,399.000000,13.000000,269.000000,13.000000,0.000000,0.000000,0.000000,0.000000,0.000000,198.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190145.000000,8249800.000000
+64,64,53001540.000000,Escola Classe 206 Sul,SQS 206,242-0002,RA I - BRASILIA,Publica,Inf/Reg,8.000000,M  V,0.000000,0.000000,38.000000,2.000000,443.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189600.000000,8249295.000000
+65,65,53001559.000000,Escola Classe 209 Sul,SQS 209,244-7058,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,372.000000,10.000000,0.000000,0.000000,0.000000,0.000000,11.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188940.000000,8248700.000000
+66,66,53001567.000000,Escola Classe 214 Sul,SQS 214,346-5464,RA I - BRASILIA,Publica,Regular,10.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,588.000000,35.000000,0.000000,0.000000,6.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187360.000000,8247480.000000
+67,67,53001583.000000,Escola Classe 304 Norte,SQN 304,226-4364,RA I - BRASILIA,Publica,Regular,7.000000,M  V,0.000000,0.000000,0.000000,0.000000,433.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190670.000000,8253750.000000
+68,68,53001591.000000,Escola Classe 304 Sul,SQS 304,224-4003,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,334.000000,16.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189645.000000,8250470.000000
+69,69,53001605.000000,Escola Classe 305 Sul,SQS 305,243-3083,RA I - BRASILIA,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,566.000000,18.000000,0.000000,0.000000,0.000000,0.000000,8.000000,4.000000,1.000000,267.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189400.000000,8250225.000000
+70,70,53001613.000000,Escola Classe 306 Norte,SQN 306,272-4414,RA I - BRASILIA,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,322.000000,9.000000,156.000000,9.000000,0.000000,0.000000,0.000000,14.000000,1.000000,431.000000,15.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190560.000000,8254320.000000
+71,71,53001621.000000,Escola Classe 308 Sul,SQS 308,242-6194,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,505.000000,15.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188710.000000,8249570.000000
+72,72,53001630.000000,Escola Classe 312 Norte,SQN 312,340-1840,RA I - BRASILIA,Publica,Regular,6.000000,M  V,0.000000,0.000000,0.000000,0.000000,395.000000,16.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189920.000000,8256400.000000
+73,73,53001648.000000,Escola Classe 314 Sul,SQS 314,346-4395,RA I - BRASILIA,Publica,Regular,9.000000,M  V,0.000000,0.000000,0.000000,0.000000,517.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186950.000000,8248060.000000
+74,74,53001656.000000,Escola Classe 315 Sul,SQS 315,245-1399,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,180.000000,6.000000,343.000000,27.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186670.000000,8247930.000000
+75,75,53001664.000000,Escola Classe 316 Norte,SQN 316,274-9055,RA I - BRASILIA,Publica,Inf/Reg,10.000000,M  V,0.000000,0.000000,49.000000,2.000000,516.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,13.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189510.000000,8257890.000000
+76,76,53001672.000000,Escola Classe 316 Sul,SQS 316,245-2158,RA I - BRASILIA,Publica,Regular,11.000000,M  V,0.000000,0.000000,0.000000,0.000000,663.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186350.000000,8247660.000000
+77,77,53001680.000000,Escola Classe 403 Norte,SQN 403,224-7501,RA I - BRASILIA,Publica,Regular,8.000000,M  V,0.000000,0.000000,0.000000,0.000000,265.000000,12.000000,0.000000,0.000000,0.000000,0.000000,14.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191750.000000,8253610.000000
+78,78,53001699.000000,Escola Classe 405 Norte,SQN 405,272-2303,RA I - BRASILIA,Publica,Reg/Supl,7.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,148.000000,8.000000,88.000000,8.000000,0.000000,0.000000,3.000000,0.000000,2.000000,250.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191650.000000,8254350.000000
+79,79,53001702.000000,Escola Classe 405 Sul,SQS 405,242-0735,RA I - BRASILIA,Publica,Regular,11.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,538.000000,37.000000,0.000000,0.000000,10.000000,3.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190075.000000,8249285.000000
+80,80,53001710.000000,Escola Classe 407 Norte,SQN 407,272-2053,RA I - BRASILIA,Publica,Inf/Reg/Supl,9.000000,M  V  N,0.000000,0.000000,24.000000,2.000000,229.000000,8.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,2.000000,320.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191480.000000,8255280.000000
+81,81,53001729.000000,Escola Classe 409 Norte,SQN 410,272-4533,RA I - BRASILIA,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,431.000000,24.000000,0.000000,0.000000,0.000000,0.000000,2.000000,206.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191130.000000,8256100.000000
+82,82,53001737.000000,Escola Classe 410 Sul,SQS 410,242-6092,RA I - BRASILIA,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,351.000000,15.000000,0.000000,0.000000,0.000000,0.000000,27.000000,8.000000,3.000000,180.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188750.000000,8248090.000000
+83,83,53001745.000000,Escola Classe 411 Norte,SQN 411,273-4240,RA I - BRASILIA,Publica,Inf/Reg,13.000000,M  V,0.000000,0.000000,28.000000,1.000000,374.000000,10.000000,0.000000,0.000000,0.000000,0.000000,3.000000,3.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191070.000000,8256360.000000
+84,84,53001753.000000,Escola Classe 413 Sul,SQS 413,242-9686,RA I - BRASILIA,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,183.000000,5.000000,315.000000,27.000000,0.000000,0.000000,0.000000,1.000000,0.000000,161.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187900.000000,8247600.000000
+85,85,53001761.000000,Escola Classe 415 Norte,SQN 415,273-5860,RA I - BRASILIA,Publica,Inf/Reg,7.000000,M  V,0.000000,0.000000,146.000000,5.000000,180.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190605.000000,8257745.000000
+86,86,53001770.000000,Escola Classe 416 Sul,SQS 416,346-7277,RA I - BRASILIA,Publica,Inf/Reg,10.000000,M  V,0.000000,0.000000,96.000000,4.000000,286.000000,11.000000,0.000000,0.000000,0.000000,0.000000,12.000000,0.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186970.000000,8246890.000000
+87,87,53001788.000000,Escola Classe 708 Norte,SHCGN 707/708,274-5781,RA I - BRASILIA,Publica,Reg/Supl,9.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,341.000000,18.000000,0.000000,0.000000,0.000000,0.000000,10.000000,10.000000,6.000000,238.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190080.000000,8254620.000000
+88,88,53001796.000000,Escola Classe 711 Norte,SHCGN 711,273-0262,RA I - BRASILIA,Publica,Regular,10.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,392.000000,31.000000,0.000000,0.000000,36.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189680.000000,8255940.000000
+89,89,53001800.000000,Escola Classe do Setor Militar Urbano,Area Especial da QRO SMU,233-8362,RA I - BRASILIA,Publica,Inf/Reg,9.000000,M  V,0.000000,0.000000,26.000000,1.000000,176.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185860.000000,8253820.000000
+91,91,53001834.000000,Escola Normal de Brasilia,SGAS 907 Conjunto A,244-1893,RA I - BRASILIA,Publica,Inf/Reg/Supl,41.000000,M  V  N  I,0.000000,0.000000,331.000000,13.000000,669.000000,25.000000,0.000000,0.000000,549.000000,53.000000,23.000000,0.000000,5.000000,579.000000,28.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188350.000000,8250345.000000
+92,92,53001893.000000,Escola do Parque da Cidade,SGAS Q 909 Conjunto A  Fundos,243-1225,RA I - BRASILIA,Publica,Regular,14.000000,M  V  I,0.000000,0.000000,0.000000,0.000000,93.000000,14.000000,92.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187800.000000,8250050.000000
+93,93,53001966.000000,Escola da Acao Social do Planalto,SGAS Q 616 Modulos 116/117,346-7334,RA I - BRASILIA,Publica,Regular,5.000000,M  V,0.000000,0.000000,0.000000,0.000000,182.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,16.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187130.000000,8246640.000000
+94,94,53002148.000000,Escola Meninos e Meninas do Parque,Parque da Cidade - Estacionamento 06,322-7631,RA I - BRASILIA,Publica,Regular,5.000000,I,0.000000,0.000000,0.000000,0.000000,40.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186530.000000,8249880.000000
+95,95,53002210.000000,Jardim de Infancia 21 de Abril,Praca 21 de Abril  EQS 707/708,242-0390,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,191.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188580.000000,8249900.000000
+96,96,53002237.000000,Jardim de Infancia da 102 Sul,SQS 102,225-2838,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,160.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190350.000000,8250670.000000
+97,97,53002245.000000,Jardim de Infancia da 106 Norte,SQN 106,274-4760,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,302.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190970.000000,8254450.000000
+98,98,53002253.000000,Jardim de Infancia da 108 Sul,SQS 108,242-7933,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,221.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188790.000000,8249145.000000
+99,99,53002261.000000,Jardim de Infancia da 114 Sul,SQS 114,242-3242,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,235.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187040.000000,8247885.000000
+100,100,53002270.000000,Jardim de Infancia da 208 Sul,SQS 208,242-4551,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,264.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,5.000000,4.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189055.000000,8248800.000000
+101,101,53002288.000000,Jardim de Infancia da 302 Norte,SQN 302,226-5736,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,255.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190710.000000,8253080.000000
+102,102,53002296.000000,Jardim de Infancia da 303 Sul,SQS 303,226-7198,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,204.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189900.000000,8250755.000000
+103,103,53002300.000000,Jardim de Infancia da 304 Norte,SQN 304,224-5783,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,242.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190725.000000,8253740.000000
+104,104,53002318.000000,Jardim de Infancia da 305 Sul,SQS 305,243-0228,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,233.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189380.000000,8250140.000000
+105,105,53002326.000000,Jardim de Infancia da 308 Sul,SQS 308,243-2214,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,217.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188585.000000,8249490.000000
+106,106,53002334.000000,Jardim de Infancia da 312 Norte,SQN 312,273-6992,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,266.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189980.000000,8256450.000000
+107,107,53002342.000000,Jardim de Infancia da 314 Sul,SQS 314,245-5119,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,150.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186875.000000,8248160.000000
+108,108,53002350.000000,Jardim de Infancia da 316 Sul,SQS 316,245-1969,RA I - BRASILIA,Publica,Infantil,4.000000,M  V,0.000000,0.000000,243.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186390.000000,8247840.000000
+109,109,53002369.000000,Jardim de Infancia da 404 Norte,SQN 404,223-1803,RA I - BRASILIA,Publica,Infantil,5.000000,M  V,0.000000,0.000000,271.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191720.000000,8253840.000000
+463,463,53008774.000000,Centro de Ensino de 1o Grau 01 do Cruzeiro,SRES Lote 06,234-2463,RA XI - CRUZEIRO,Publica,Reg/Supl,35.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,418.000000,16.000000,577.000000,33.000000,0.000000,0.000000,0.000000,1.000000,0.000000,224.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185300.000000,8252710.000000
+464,464,53008782.000000,Centro de Ensino de 1o Grau 02 do Cruzeiro,SHCES Q 309 Lote 01,234-1464,RA XI - CRUZEIRO,Publica,Reg/Supl,25.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,724.000000,35.000000,0.000000,0.000000,8.000000,0.000000,1.000000,850.000000,27.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184780.000000,8251740.000000
+465,465,53008790.000000,Centro Educacional 01 do Cruzeiro,SRES Area Especial F Lote G,234-4492,RA XI - CRUZEIRO,Publica,Regular,15.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,333.000000,14.000000,775.000000,48.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185045.000000,8252880.000000
+466,466,53008804.000000,Centro Educacional 02 do Cruzeiro,SHCES Q 805 Lote 02,234-4939,RA XI - CRUZEIRO,Publica,Reg/Supl,20.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,816.000000,41.000000,763.000000,33.000000,0.000000,1.000000,0.000000,336.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185100.000000,8251460.000000
+467,467,53008820.000000,Escola Classe 04 do Cruzeiro,SHCE-EQ 405/407 Lote 01,233-8885,RA XI - CRUZEIRO,Publica,Inf/Reg,8.000000,M  V,0.000000,0.000000,17.000000,1.000000,274.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184785.000000,8251470.000000
+468,468,53008839.000000,Escola Classe 05 do Cruzeiro,SHCES-EQ 201/203 Lote 01,233-8891,RA XI - CRUZEIRO,Publica,Inf/Reg,16.000000,M  V,0.000000,0.000000,65.000000,2.000000,440.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184540.000000,8251175.000000
+469,469,53008847.000000,Escola Classe 06 do Cruzeiro,SHCES Q 807,233-8680,RA XI - CRUZEIRO,Publica,Inf/Reg,15.000000,M  V,0.000000,0.000000,29.000000,1.000000,333.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185150.000000,8251660.000000
+470,470,53008855.000000,Escola Classe 08 do Cruzeiro,AOS 06/08 Lote 03,234-1656,RA XI - CRUZEIRO,Publica,Inf/Reg/Supl,20.000000,M  V  N,0.000000,0.000000,343.000000,12.000000,365.000000,13.000000,0.000000,0.000000,0.000000,0.000000,9.000000,0.000000,1.000000,285.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184370.000000,8250550.000000
+471,471,53008898.000000,Jardim de Infancia 01 do Cruzeiro,SRES Lote 05 Setor Educacional,233-1072,RA XI - CRUZEIRO,Publica,Infantil,18.000000,M  V,0.000000,0.000000,411.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,185375.000000,8252750.000000
+528,528,53009479.000000,Centro Educacional do Lago - CEL,SHIS QI 09 Conjunto 10 Lote H,248-0491,RA XVI - LAGO SUL,Publica,Reg/Supl,8.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,547.000000,27.000000,514.000000,28.000000,0.000000,0.000000,0.000000,444.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191820.000000,8246735.000000
+540,540,53009410.000000,Centro de Ensino de 1o Grau 01 do Lago Norte,SHIN QI 04/06 Area Especial,577-2528,RA XVIII  - LAGO NORTE,Publica,Inf/Reg/Supl,20.000000,M  V  N,0.000000,0.000000,28.000000,1.000000,342.000000,15.000000,809.000000,37.000000,0.000000,0.000000,0.000000,0.000000,0.000000,360.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,192010.000000,8258485.000000
+546,546,53000781.000000,Colegio Arvense - Centro de Ensino de 1o Grau,EQN 712/912 - Conj C,273-0958,RA I - BRASILIA,Particular,Inf/Reg,23.000000,M V,119.000000,6.000000,160.000000,8.000000,177.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189350.000000,8256240.000000
+547,547,53000790.000000,Centro de Artes e Recreacoes Ursinho Feliz,EQS 112/312 - Lote C,244-2539,RA I - BRASILIA,Particular,Infantil,6.000000,M V,111.000000,5.000000,62.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187570.000000,8248430.000000
+548,548,53000803.000000,Centro Infantil Reino Encantado,EQS 204/404 - Lote C,223-7122,RA I - BRASILIA,Particular,Infantil,9.000000,M  V,187.000000,10.000000,157.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190280.000000,8249710.000000
+549,549,53000811.000000,Casa da Crianca Pao de Santo Antonio,SGAS 906 - Modulo 10,242-2337,RA I - BRASILIA,Particular,Infantil,8.000000,I V,79.000000,0.000000,53.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188560.000000,8250500.000000
+550,550,53000838.000000,Centro de Ensino Compacto Junior,EQN 212/412 - Area Especial,273-5091,RA I - BRASILIA,Particular,Inf/Reg,12.000000,M V,24.000000,2.000000,86.000000,6.000000,168.000000,8.000000,197.000000,13.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190800.000000,8256780.000000
+551,551,53000900.000000,Centro de Ensino de 1o Grau Candanguinho,SEPS EQ 713/913 - Conj D,245-2004,RA I - BRASILIA,Particular,Inf/Reg,23.000000,M V,218.000000,11.000000,350.000000,16.000000,396.000000,19.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187030.000000,8248900.000000
+552,552,53000935.000000,Centro de Ensino de 1o Grau Popeye,EQN 204/404 - Conj C,226-4750,RA I - BRASILIA,Particular,Inf/Reg,9.000000,M V,53.000000,4.000000,92.000000,6.000000,64.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191600.000000,8253950.000000
+553,553,53000943.000000,Viver Centro de Ensino,SHGCN 706 - Conj A - Blocos A/B,349-3434,RA I - BRASILIA,Particular,Inf/Reg,17.000000,M V,36.000000,4.000000,101.000000,8.000000,143.000000,9.000000,90.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190250.000000,8254300.000000
+554,554,53000951.000000,INEI Centro Educacional,SGAS 604 - Conj C - Lotes 25 e 26,226-9877,RA I - BRASILIA,Particular,Inf/Reg,38.000000,M V,95.000000,6.000000,286.000000,13.000000,535.000000,19.000000,488.000000,22.000000,143.000000,16.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190720.000000,8249520.000000
+555,555,53000960.000000,Centro de Ensino Mauricio Salles de Mello,SHCGN 708 - Bloco C,272-1208,RA I - BRASILIA,Particular,Inf/Reg,22.000000,M V,50.000000,4.000000,145.000000,8.000000,284.000000,16.000000,286.000000,25.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189980.000000,8254760.000000
+556,556,53000226.000000,Centro de Ensino Tecnologico de Brasilia - CETEB,SGAS 910 - Conj D,243-8011,RA I - BRASILIA,Particular,Supletivo,19.000000,N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2684.000000,29.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187460.000000,8249930.000000
+557,557,53000293.000000,Centro Educacional Alfa,CRN 502 - Bloco B - No 68,321-4481,RA I - BRASILIA,Particular,Supletivo,4.000000,V N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,168.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190570.000000,8253100.000000
+558,558,53000978.000000,Centro Educacional Alvorada,SGAN 916 - Modulo C/D,273-6181,RA I - BRASILIA,Particular,Regular,23.000000,M  V,0.000000,0.000000,25.000000,3.000000,88.000000,11.000000,138.000000,16.000000,242.000000,27.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188870.000000,8257600.000000
+559,559,53001001.000000,Centro Educacional Compacto Integral,SGAS 601 - Conj A,224-0528,RA I - BRASILIA,Particular,Reg/Supl,14.000000,M V N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,163.000000,13.000000,269.000000,16.000000,0.000000,0.000000,0.000000,652.000000,37.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191450.000000,8250470.000000
+560,560,53001028.000000,Centro Educacional do CEUB,SEPN 707/907 - Lote C - Bloco 6,340-1835,RA I - BRASILIA,Particular,Regular,42.000000,M V,0.000000,0.000000,82.000000,6.000000,265.000000,12.000000,658.000000,31.000000,373.000000,20.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189820.000000,8254750.000000
+561,561,53001052.000000,Centro Educacional Juscelino Kubitschek,SGAN 913 - Bloco A,347-6557,RA I - BRASILIA,Particular,Reg/Supl,16.000000,M  V  N,0.000000,0.000000,36.000000,3.000000,91.000000,10.000000,249.000000,17.000000,437.000000,14.000000,0.000000,0.000000,0.000000,321.000000,20.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189250.000000,8256450.000000
+562,562,53001060.000000,Centro Educacional La Salle,SGAS 906 - Conj D,242-7878,RA I - BRASILIA,Particular,Inf/Reg,32.000000,M V N,0.000000,0.000000,0.000000,0.000000,304.000000,17.000000,615.000000,33.000000,778.000000,45.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188660.000000,8250270.000000
+563,563,53001079.000000,Centro Educacional La Salle - Creche,EQS 705/905 - Lote A,244-7043,RA I - BRASILIA,Particular,Infantil,10.000000,M V,38.000000,4.000000,85.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189090.000000,8250560.000000
+564,564,53001087.000000,Centro Educacional Leonardo da Vinci,SEUPS 703 - Bloco 1 - Lote B,226-6703,RA I - BRASILIA,Particular,Regular,42.000000,M,0.000000,0.000000,0.000000,0.000000,89.000000,8.000000,355.000000,18.000000,711.000000,38.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189470.000000,8251060.000000
+565,565,53001095.000000,Centro Educacional Leonardo da Vinci,SGAN 914 - Conj I,340-1616,RA I - BRASILIA,Particular,Regular,58.000000,M,0.000000,0.000000,0.000000,0.000000,286.000000,14.000000,905.000000,29.000000,1083.000000,48.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189040.000000,8257000.000000
+566,566,53001109.000000,Centro Educacional Maria Auxiliadora,SEPS 702 - Bloco C,224-5315,RA I - BRASILIA,Particular,Inf/Reg,29.000000,M V N,17.000000,1.000000,103.000000,6.000000,268.000000,8.000000,513.000000,47.000000,125.000000,16.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189800.000000,8251140.000000
+567,567,53001117.000000,Centro Educacional Nossa Senhora do Rosario,SGAS 908 - Lotes 23 e 24,243-7758,RA I - BRASILIA,Particular,Inf/Reg,16.000000,M V,16.000000,1.000000,74.000000,6.000000,158.000000,13.000000,202.000000,17.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188100.000000,8249990.000000
+568,568,53001125.000000,Colegio Integrado Objetivo,SGAS 913 - Lotes 54/55,245-4544,RA I - BRASILIA,Particular,Regular,33.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1627.000000,46.000000,4087.000000,116.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186850.000000,8249120.000000
+569,569,53001141.000000,Colegio Integrado Objetivo,SGAS 914 - Lotes 67/68,245-2445,RA I - BRASILIA,Particular,Inf/Reg,37.000000,M  V,77.000000,3.000000,324.000000,14.000000,813.000000,29.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186440.000000,8248600.000000
+570,570,53001150.000000,Centro Educacional Planalto,SEUPS EQ 708/907 - Conjunto B,243-2769,RA I - BRASILIA,Particular,Inf/Reg,28.000000,M V,0.000000,0.000000,18.000000,1.000000,59.000000,4.000000,334.000000,18.000000,494.000000,29.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188400.000000,8250050.000000
+571,571,53001168.000000,Centro Educacional Projecao,SGAN 906 - Conj A,340-3106,RA I - BRASILIA,Particular,Inf/Reg,19.000000,M V,34.000000,3.000000,85.000000,4.000000,110.000000,10.000000,100.000000,9.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189870.000000,8254110.000000
+572,572,53000064.000000,Centro Educacional Projecao,SGAS 906 - Modulo A,244-6161,RA I - BRASILIA,Particular,Regular,6.000000,M,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,146.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188650.000000,8250600.000000
+573,573,53001184.000000,Centro Educacional Rodolpho de Moraes Rego,SEUPS EQ 706/906 - Conjunto A,242-9087,RA I - BRASILIA,Particular,Regular,13.000000,M V,0.000000,0.000000,0.000000,0.000000,125.000000,14.000000,133.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188900.000000,8250370.000000
+574,574,53001192.000000,Centro Educacional Sagrada Familia,SGAN 906 - Modulo C/D,272-1727,RA I - BRASILIA,Particular,Inf/Reg,28.000000,M  V,28.000000,4.000000,117.000000,13.000000,335.000000,17.000000,402.000000,12.000000,128.000000,15.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189900.000000,8254230.000000
+575,575,53001222.000000,Centro Educacional Sigma,SGAS 912 - Conjunto A,346-3232,RA I - BRASILIA,Particular,Regular,70.000000,M V,0.000000,0.000000,0.000000,0.000000,244.000000,9.000000,1429.000000,38.000000,2240.000000,48.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187290.000000,8249570.000000
+576,576,53001281.000000,Colegio Batista de Brasilia,SGAS 905 - Modulo 04,242-1898,RA I - BRASILIA,Particular,Inf/Reg,21.000000,M V,58.000000,4.000000,198.000000,7.000000,322.000000,21.000000,174.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188820.000000,8250630.000000
+577,577,53001290.000000,Colegio Cor Jesu,SGAS 615 - Conjunto G,346-5566,RA I - BRASILIA,Particular,Inf/Reg,20.000000,M  V,18.000000,2.000000,136.000000,7.000000,274.000000,12.000000,341.000000,23.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187350.000000,8246820.000000
+578,578,53001303.000000,Colegio Dom Bosco,SEPS 702 - Bloco A,223-2650,RA I - BRASILIA,Particular,Inf/Reg,30.000000,M V,0.000000,0.000000,31.000000,2.000000,294.000000,16.000000,697.000000,34.000000,300.000000,21.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189670.000000,8251110.000000
+579,579,53001311.000000,Colegio Imaculada Conceicao,SGAS 606 - Conjunto C,243-5259,RA I - BRASILIA,Particular,Inf/Reg,14.000000,M  V,24.000000,4.000000,90.000000,8.000000,190.000000,13.000000,314.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190100.000000,8248830.000000
+580,580,53001320.000000,Colegio Madre Carmen Salles,SGAN 604 - Conjunto D,223-2863,RA I - BRASILIA,Particular,Inf/Reg,29.000000,M  V,28.000000,2.000000,178.000000,10.000000,383.000000,15.000000,395.000000,13.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,192020.000000,8253930.000000
+581,581,53001338.000000,Colegio Marista de Brasilia-1o Grau,SGAS 609 - Conjunto A,242-1243,RA I - BRASILIA,Particular,Inf/Reg,38.000000,M  V,0.000000,0.000000,521.000000,18.000000,1059.000000,29.000000,1273.000000,46.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189290.000000,8248230.000000
+582,582,53001346.000000,Colegio Marista de Brasilia-2o Grau,SGAS 615 - Conjunto C,346-2288,RA I - BRASILIA,Particular,Regular,33.000000,M,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1477.000000,61.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187520.000000,8246910.000000
+583,583,53001362.000000,Colegio Notre Dame,SGAS 914 - Lotes 63/64,245-2836,RA I - BRASILIA,Particular,Inf/Reg,22.000000,M  V,6.000000,0.000000,50.000000,6.000000,152.000000,12.000000,131.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186560.000000,8248700.000000
+584,584,53001370.000000,Colegio Pio XII,SGAS 609 - Conjunto C,242-1335,RA I - BRASILIA,Particular,Inf/Reg,24.000000,M  V,56.000000,4.000000,124.000000,7.000000,256.000000,10.000000,349.000000,23.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189150.000000,8248100.000000
+585,585,53001389.000000,Colegio Sagrado Coracao de Maria,SHCGN 702 - Conjunto C,321-8588,RA I - BRASILIA,Particular,Inf/Reg,23.000000,M  V,27.000000,3.000000,105.000000,7.000000,247.000000,13.000000,284.000000,15.000000,31.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190300.000000,8253100.000000
+586,586,53001397.000000,Colegio Santa Rosa,SGAS 601 - Conjunto C - Lote 3,224-2966,RA I - BRASILIA,Particular,Inf/Reg,23.000000,M  V,26.000000,1.000000,233.000000,10.000000,531.000000,22.000000,507.000000,28.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191380.000000,8250300.000000
+587,587,53001400.000000,Colegio Santa Doroteia,SGAN 911 - Conjunto B,274-5110,RA I - BRASILIA,Particular,Inf/Reg,25.000000,M V,33.000000,3.000000,104.000000,9.000000,250.000000,15.000000,283.000000,18.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189180.000000,8255700.000000
+588,588,53001419.000000,Creche Fundacao Cabo Frio,SGAN 608 - Modulo A,274-5176,RA I - BRASILIA,Particular,Infantil,10.000000,I,186.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191700.000000,8255320.000000
+589,589,53001427.000000,Cresca Centro de Realizacao Criadora,SEUPS EQ 703/903 - Bloco C,224-1640,RA I - BRASILIA,Particular,Inf/Reg,15.000000,M V,28.000000,2.000000,104.000000,6.000000,159.000000,8.000000,110.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189340.000000,8250950.000000
+590,590,53001826.000000,Educandario Espirito Santo,SGAN 609 - Conjunto A/B,273-5089,RA I - BRASILIA,Particular,Infantil,6.000000,M V,104.000000,4.000000,172.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191620.000000,8255700.000000
+591,591,53001907.000000,Escola Adventista de Brasilia,SGAS 611 - Modulo 75,242-3847,RA I - BRASILIA,Particular,Inf/Reg,16.000000,M,0.000000,0.000000,54.000000,3.000000,131.000000,9.000000,215.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188820.000000,8247800.000000
+592,592,53001915.000000,Escola Americana de Brasilia,SGAS 605 - Bloco E - Lote 34,243-3237,RA I - BRASILIA,Particular,Inf/Reg,40.000000,I,0.000000,0.000000,157.000000,8.000000,183.000000,14.000000,225.000000,25.000000,170.000000,21.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190380.000000,8249150.000000
+593,593,53001923.000000,Escola Anjo da Guarda,SGAN 913 - Lote A,272-4851,RA I - BRASILIA,Particular,Infantil,5.000000,M  V,78.000000,4.000000,153.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189180.000000,8256470.000000
+594,594,53001931.000000,Centro Educacional Canarinho,SGAS 906 - Modulo 9,244-3950,RA I - BRASILIA,Particular,Inf/Reg,8.000000,M  V,42.000000,2.000000,102.000000,6.000000,95.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188820.000000,8250400.000000
+595,595,53001940.000000,Centro Educacional Canarinho,EQS 212/412 - Bloco C,243-2891,RA I - BRASILIA,Particular,Infantil,6.000000,M  V,81.000000,4.000000,138.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188020.000000,8247840.000000
+596,596,53001958.000000,Escola Cenecista Alzira Sodre,SGAN 608 - Modulo D,272-3233,RA I - BRASILIA,Particular,Infantil,12.000000,M V,154.000000,6.000000,113.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191700.000000,8255480.000000
+597,597,53001974.000000,Escola de 1o Grau Vicenta Maria,SGAS 606 - Conjunto A,243-2884,RA I - BRASILIA,Particular,Regular,4.000000,N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,99.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190240.000000,8249000.000000
+598,598,53001982.000000,Escola de 2o Grau Objetivo,SGAS 904 - Lotes A/C,225-7990,RA I - BRASILIA,Particular,Supletiv,18.000000,M,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,781.000000,61.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189270.000000,8250810.000000
+599,599,53002008.000000,Escola Fundamental Alvacir Vite Rossi,SGAN 908 - Conjunto B,347-8486,RA I - BRASILIA,Particular,Regular,12.000000,M V,0.000000,0.000000,0.000000,0.000000,341.000000,17.000000,92.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189530.000000,8254860.000000
+600,600,53002016.000000,Escola Golfinho Dourado,EQN 116/316 - Bloco C,274-0635,RA I - BRASILIA,Particular,Infantil,11.000000,M V,95.000000,5.000000,116.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189630.000000,8257890.000000
+601,601,53002024.000000,Escola Logosofica Gonzalez Pecotche,SHCGN 704 - Area Especial,224-9205,RA I - BRASILIA,Particular,Inf/Reg,10.000000,M V,50.000000,4.000000,73.000000,5.000000,88.000000,6.000000,81.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190310.000000,8253690.000000
+602,602,53002032.000000,Escola Maternal e Jardim de Infancia Branca de Neve,SEUPS EQ 706/906 - Conjunto A,242-9087,RA I - BRASILIA,Particular,Infantil,6.000000,M V,82.000000,5.000000,122.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188930.000000,8250380.000000
+603,603,53002040.000000,Escola Moderna Maria Montessori,SGAS 912 - Lotes 50/52,346-2733,RA I - BRASILIA,Particular,Infantil,19.000000,M V,157.000000,7.000000,213.000000,12.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186850.000000,8249440.000000
+604,604,53002059.000000,Escola Monteiro Lobato de 1o Grau,SHCGN 713 - Area Especial,273-1270,RA I - BRASILIA,Particular,Inf/Reg,20.000000,M V,20.000000,2.000000,60.000000,6.000000,99.000000,7.000000,100.000000,8.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189460.000000,8256590.000000
+605,605,53002067.000000,Escola Nossa Senhora de Fatima,SGAS 906 - Conjunto F,243-8646,RA I - BRASILIA,Particular,Inf/Reg,18.000000,M,9.000000,1.000000,18.000000,2.000000,42.000000,4.000000,119.000000,10.000000,210.000000,17.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188560.000000,8250380.000000
+606,606,53002075.000000,Escola Paroquial Santo Antonio,SGAS 911 - Conjunto B,242-7299,RA I - BRASILIA,Particular,Inf/Reg,33.000000,M  V,60.000000,2.000000,425.000000,17.000000,823.000000,35.000000,803.000000,40.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,187460.000000,8249630.000000
+607,607,53002083.000000,Escola Pedacinho do Ceu,EQN 108/308 - Lote C,274-1311,RA I - BRASILIA,Particular,Infantil,9.000000,M V,149.000000,7.000000,95.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,190530.000000,8255180.000000
+608,608,53002091.000000,Escola Positiva de Brasilia,SGAN 905 - Modulo A,274-8261,RA I - BRASILIA,Particular,Inf/Reg,9.000000,M V,23.000000,2.000000,25.000000,3.000000,16.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189990.000000,8253920.000000
+609,609,53002105.000000,Escola Sao Camilo,SGAN 914 - Conjunto G,349-4308,RA I - BRASILIA,Particular,Inf/Reg,9.000000,M V I,120.000000,4.000000,158.000000,8.000000,145.000000,10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189020.000000,8256900.000000
+610,610,53002113.000000,Escola Sao Carlos,SGAS 905 - Lotes 1/2,242-9088,RA I - BRASILIA,Particular,Inf/Reg,16.000000,M  V,28.000000,2.000000,147.000000,6.000000,268.000000,10.000000,315.000000,24.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188950.000000,8250820.000000
+611,611,53002130.000000,Escola Tecnica de Saude Golden Garden,SGAS 611 - Conjunto D,244-9664,RA I - BRASILIA,Particular,Regular,2.000000,M,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,22.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188820.000000,8247790.000000
+612,612,53002164.000000,INEI Centro Educacional,SGAN 605 - Modulo A,349-1088,RA I - BRASILIA,Particular,Inf/Reg,38.000000,M  V,85.000000,3.000000,313.000000,12.000000,523.000000,20.000000,515.000000,21.000000,161.000000,14.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191910.000000,8254500.000000
+613,613,53002172.000000,Instituto de Educacao de Brasilia - IEB,SHCGN 712 - Conj B - Area Especial,274-6575,RA I - BRASILIA,Particular,Inf/Reg,8.000000,V,19.000000,1.000000,42.000000,3.000000,43.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189550.000000,8256160.000000
+614,614,53002180.000000,Escola Educacional Filantropica,SGAS 611 - Modulo 77,244-4087,RA I - BRASILIA,Particular,Infantil,5.000000,M V,72.000000,5.000000,41.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188800.000000,8247700.000000
+615,615,53002199.000000,Instituto Nossa Senhora do Carmo,SGAS 913 - Bloco C,346-6700,RA I - BRASILIA,Particular,Inf/Reg,15.000000,M V,35.000000,3.000000,56.000000,7.000000,140.000000,13.000000,171.000000,15.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186970.000000,8249260.000000
+616,616,53002202.000000,Sociedade Educacional Saci Perere,SEUPS EQ 708/907 - Modulo D,243-4741,RA I - BRASILIA,Particular,Inf/Reg,15.000000,M,15.000000,2.000000,36.000000,3.000000,79.000000,4.000000,86.000000,10.000000,18.000000,11.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188280.000000,8249990.000000
+617,617,53002377.000000,Escola Meu Pequeno Mundo,EQS 216/416 - Bloco C,245-5333,RA I - BRASILIA,Particular,Infantil,7.000000,M V,81.000000,2.000000,58.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186880.000000,8246950.000000
+618,618,53002385.000000,Centro de Ensino Juscelino Kubitschek,SGAN 906 - Bloco F,273-5544,RA I - BRASILIA,Particular,Inf/Reg/Esp,25.000000,M  V,108.000000,4.000000,85.000000,4.000000,68.000000,7.000000,81.000000,9.000000,0.000000,0.000000,5.000000,0.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189860.000000,8254370.000000
+619,619,53002393.000000,Associacao Educacional Sol Nascente,SGAS 610 - Bloco D - Modulo 71,244-3634,RA I - BRASILIA,Particular,Infantil,6.000000,M V,52.000000,3.000000,70.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189000.000000,8247930.000000
+620,620,53002407.000000,Pre-Escola Menino de Deus,SGAN 915 - Conjunto C,273-7202,RA I - BRASILIA,Particular,Infantil,4.000000,M V,9.000000,1.000000,39.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188990.000000,8257180.000000
+621,621,53002415.000000,Renascer Creche Maternal e Jardim de Infancia,EQS 116/316 - Bloco C - Area Especial,245-1820,RA I - BRASILIA,Particular,Inf/Esp,9.000000,M V,110.000000,0.000000,20.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,15.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186410.000000,8247550.000000
+622,622,53002423.000000,Sociedade Sibipiruna,SHCGN 715 - Area Especial - Bloco A,273-1144,RA I - BRASILIA,Particular,Infantil,5.000000,M V,55.000000,4.000000,75.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189300.000000,8257330.000000
+623,623,0.000000,Escola Batista IBAN,EQN 313/314 - Area Especial - Lote A,349-2428,RA I - BRASILIA,Particular,Infantil,6.000000,M V,27.000000,4.000000,27.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189870.000000,8256970.000000
+624,624,0.000000,Creche Maternal e Pre-Escola Marly Sarney,SGAS 914 - Conjunto 63 - Lote A,245-3225,RA I - BRASILIA,Particular,Infantil,2.000000,M V,3.000000,1.000000,5.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,186510.000000,8248820.000000
+625,625,0.000000,Centro de Ensino de 1o Grau Renascenca,SGAN 914 - Conjunto B,273-6284,RA I - BRASILIA,Particular,Inf/Reg,8.000000,M V,33.000000,2.000000,44.000000,4.000000,18.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188925.000000,8256730.000000
+626,626,0.000000,Pimentinhas Escola de Educacao Infantil,EQS 104/304 - Lote C,225-7215,RA I - BRASILIA,Particular,Infantil,6.000000,M V,50.000000,3.000000,27.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189715.000000,8250215.000000
+627,627,53000013.000000,Assoc Maes Pais Amigos e Reabilitad Excepcionais - AMPARE,SHCGN 709 - Area Especial C,274-9561,RA I - BRASILIA,Conveniada,Especial,15.000000,M V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,120.000000,0.000000,17.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189920.000000,8255210.000000
+628,628,53000030.000000,Assistencia de Pais e Amigos dos Excepcionais - APAE/DF,CRS 508 - Bloco C - Salas 10 a 16,244-1083,RA I - BRASILIA,Conveniada,Especial,7.000000,M V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,68.000000,0.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188460.000000,8249560.000000
+629,629,0.000000,Associacao de Pais e Amigos do Excepcionais - APAE/DF,EQN 711/911 - Lote E,347-0460,RA I - BRASILIA,Conveniada,Especial,4.000000,M V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,30.000000,0.000000,6.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189470.000000,8255940.000000
+630,630,53000102.000000,Sociedade Pestalozi de Brasilia,Avenida das Nacoes - Trecho 03 - Lote 04,226-0101,RA I - BRASILIA,Conveniada,Especial,10.000000,I,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,108.000000,0.000000,19.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,194100.000000,8250250.000000
+631,631,53000331.000000,Centro Educacional de Audicao e Linguagem - CEAL,SGAN 909 - Conjunto B,272-2602,RA I - BRASILIA,Conveniada,Especial,40.000000,M V I,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,283.000000,0.000000,51.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189580.000000,8255120.000000
+632,632,53000820.000000,Casa de Ismael - Lar Primeira Luz,SGAN 914 - Conjunto C,273-2268,RA I - BRASILIA,Conveniada,Infantil,2.000000,M,20.000000,1.000000,53.000000,2.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189110.000000,8256700.000000
+634,634,53002158.000000,Grupo da Fraternidade Cicero Pereira - CAMEGE,SGAN 915 - Modulo E,273-6803,RA I - BRASILIA,Conveniada,Infantil,2.000000,M V I,96.000000,0.000000,61.000000,3.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,188900.000000,8257280.000000
+635,635,53002229.000000,Jardim de Infancia Casa do Candango,SGAS 603 - Conjunto A,223-3516,RA I - BRASILIA,Conveniada,Infantil,12.000000,M I,350.000000,5.000000,130.000000,5.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,191020.000000,8249860.000000
+636,636,0.000000,Creche Acao Social Paula Frassinetti,SGAN 911 - Conjunto B-1,274-0823,RA I - BRASILIA,ENG,Inf/Reg,7.000000,I V,30.000000,4.000000,65.000000,6.000000,45.000000,6.000000,10.000000,4.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,189105.000000,8255680.000000
+637,637,53001257.000000,Centro de Linguas - CIL,SGAS 908 Modulo 25/26,244-8881,RA I - BRASILIA,Publica,Linguas,26.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,6073.000000,53.000000,0.000000,0.000000,0.000000,0.000000,188220.000000,8250115.000000
+638,638,53001842.000000,Escola Parque 210/211 Norte,EQN 210/211,273-2371,RA I - BRASILIA,Publica,Esc Parque,15.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1247.000000,51.000000,0.000000,0.000000,0.000000,0.000000,190900.000000,8256180.000000
+639,639,53001850.000000,Escola Parque 210/211 Sul,EQS 210/211,244-3659,RA I - BRASILIA,Publica,Esc Parque,19.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1275.000000,44.000000,0.000000,0.000000,0.000000,0.000000,188480.000000,8248280.000000
+640,640,53001869.000000,Escola Parque 303/304 Norte,EQN 303/304,224-2179,RA I - BRASILIA,Publica,Esc Parque,27.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2211.000000,67.000000,0.000000,0.000000,0.000000,0.000000,190660.000000,8253590.000000
+641,641,53001877.000000,Escola Parque 308 Sul,EQS 307/308,242-0273,RA I - BRASILIA,Publica,Esc Parque,21.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2493.000000,58.000000,0.000000,0.000000,0.000000,0.000000,188790.000000,8249625.000000
+642,642,53001885.000000,Escola Parque 313/314 Sul,EQS 313/314,245-4582,RA I - BRASILIA,Publica,Esc Parque,29.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2695.000000,64.000000,0.000000,0.000000,0.000000,0.000000,187060.000000,8248325.000000
+643,643,53001990.000000,Escola de Musica de Brasilia,SGAS 602 Conjunto D,225-5075,RA I - BRASILIA,Publica,Musica,74.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2049.000000,150.000000,0.000000,0.000000,191305.000000,8250150.000000
+644,644,53002121.000000,Escola Tecnica de Saude de Brasilia,SHN 501 Bloco A,325-4944,RA I - BRASILIA,Publica,Tecnica,7.000000,M  V,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,137.000000,15.000000,190610.000000,8252810.000000
+645,645,0.000000,SENAI - Centro de Treinamento/CETRES,SIG Qd 06 Lote 1100,344-2106,RA I - BRASILIA,Particular,Profissionaliza,16.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,12230.000000,0.000000,187830.000000,8251650.000000
+646,646,53001206.000000,Centro Educ Setor Leste - Setorial de Linguas - SEL,SGAS 611/612 Conjunto E,243-8263,RA I - BRASILIA,Publica,Linguas,26.000000,M  V  N,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,2408.000000,32.000000,0.000000,0.000000,0.000000,0.000000,188630.000000,8247690.000000
+830,830,53008812.000000,Centro Educacional Ciman,Q 501 - Conj D - Lote 2,233-8897,RA XI - CRUZEIRO,Particular,Regular,16.000000,M V,0.000000,0.000000,0.000000,0.000000,438.000000,20.000000,532.000000,21.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184740.000000,8251050.000000
 831,831,53008863.000000,Escola Mundo Magico,Q 801 - Lote 1 - Bloco F,233-3938,RA XI - CRUZEIRO,Particular,Inf/Reg,11.000000,M V,38.000000,2.000000,230.000000,7.000000,211.000000,7.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,184950.000000,8251040.000000
\ No newline at end of file
diff --git a/examples/data/Distritos.mid b/examples/data/Distritos.mid
old mode 100755
new mode 100644
index 7b7d1d4..850074f
--- a/examples/data/Distritos.mid
+++ b/examples/data/Distritos.mid
@@ -1,96 +1,96 @@
-�GUA RASA;1;ARA;6.9;LESTE;95099;85896;45905;39991;0
-ALTO DE PINHEIROS;2;API;7.7;OESTE;50351;44454;24579;19875;1
-ANHANGUERA;3;ANH;33.3;NORTE;12408;38427;19267;19160;2
-ARICANDUVA;4;ARI;6.6;LESTE;193024;94813;49498;45315;3
-ARTUR ALVIM;5;AAL;6.6;LESTE;117321;111210;58607;52603;4
-BARRA FUNDA;6;BFU;5.6;NORTE;15977;12965;7244;5721;5
-BELA VISTA;7;BVI;2.6;SUDESTE;71825;63190;34809;28381;6
-BELEM;8;BEL;6.0;LESTE;48389;39622;21551;18071;7
-BOM RETIRO;9;BRE;5.0;CENTRO;36136;26598;13961;12637;8
-BR�S;10;BRS;3.5;CENTRO;33536;25158;12829;12329;9
-BRASIL�NDIA;11;BRL;21.0;NORTE;201307;247328;127603;119725;10
-BUTANT�;12;BUT;12.5;OESTE;58019;52649;28198;24451;11
-CACHOEIRINHA;13;CAC;13.3;NORTE;125852;147649;76447;71202;12
-CAMBUCI;14;CMB;3.9;SUDESTE;37069;28717;15674;13043;13
-CAMPO BELO;15;CBE;8.9;SUL;77952;66646;36101;30545;14
-CAMPO GRANDE;16;CGR;13.1;SUL;82052;91373;48339;43034;15
-CAMPO LIMPO;17;CLM;12.0;OESTE;159471;191527;99047;92480;16
-CANGA�BA;18;CNG;16.0;LESTE;115070;137442;71699;65743;17
-CAP�O REDONDO;19;CRE;13.6;OESTE;192489;240793;124539;116254;18
-CARR�O;20;CAR;7.5;LESTE;87336;78175;41590;36585;19
-CASA VERDE;21;CVE;7.1;NORTE;96396;83629;44798;38831;20
-CIDADE ADEMAR;22;CAD;12.0;SUL;230794;243372;126923;116449;21
-CIDADE DUTRA;23;CDU;29.3;SUL;169379;191389;99375;92014;22
-CIDADE L�DER;24;CLD;10.2;LESTE;97370;116841;59902;56939;23
-CIDADE TIRADENTES;25;CTI;15.0;LESTE;192562;190657;99131;91526;24
-CONSOLA��O;26;CON;3.7;CENTRO;65570;54522;30892;23630;25
-CURSINO;27;CUR;12.8;SUDESTE;110435;102089;54699;47390;26
-FREGUESIA DO �;29;FRE;10.5;NORTE;152672;144923;76020;68903;27
-GUAIANAZES;31;GUA;9.9;LESTE;81373;98546;50354;48192;28
-IGUATEMI;33;IGU;19.6;LESTE;59820;101780;51373;50407;29
-ITAIM BIBI;35;IBI;9.9;SUL;107497;81456;45560;35896;30
-ITAIM PAULISTA;36;IPA;12.0;LESTE;163269;212733;109106;103627;31
-ITAQUERA;37;ITQ;14.8;LESTE;175126;201512;104214;97298;32
-JABAQUARA;38;JAB;14.1;SUDESTE;214350;214095;113456;100639;33
-JACAN�;39;JAC;7.8;NORTE;86830;91809;48032;43777;34
-JAGUARA;40;JAG;4.6;NORTE;29798;25713;13400;12313;35
-JARAGU�;42;JAR;27.6;NORTE;93185;145900;74751;71149;36
-JARDIM �NGELA;43;JDA;37.4;SUL;177913;245805;125254;120551;37
-JARDIM PAULISTA;45;JDP;6.1;SUL;103138;83667;48148;35519;38
-JARDIM S�O LUIS;46;JDS;24.7;SUL;204284;239161;123372;115789;39
-JOSE BONIF�CIO;47;JBO;14.1;LESTE;103712;107082;56312;50770;40
-LAGEADO;96;LAJ;9.2;LESTE;112807;107082;50770;56312;41
-LAPA;48;LAP;10.0;OESTE;70319;60184;33030;27154;42
-LIBERDADE;49;LIB;3.7;SUDESTE;76245;61875;34043;27832;43
-LIM�O;50;LIM;6.3;NORTE;89478;82045;43375;38670;44
-MANDAQUI;51;MAN;13.1;NORTE;104022;103113;54385;48728;45
-MOEMA;32;MOE;9.0;SUL;77340;71276;39556;31720;46
-MO�CA;53;MOO;7.7;LESTE;71999;63280;34474;28806;47
-MORUMBI;54;MOR;11.4;OESTE;78892;34588;18560;16028;48
-PARI;56;PRI;2.9;CENTRO;21299;14824;7939;6885;49
-PARQUE DO CARMO;57;PQC;15.4;LESTE;54743;64067;32664;31403;50
-PENHA;59;PEN;11.3;LESTE;133006;124292;66160;58132;51
-PERDIZES;60;PRD;6.1;NORTE;108840;102445;56415;46030;52
-PINHEIROS;62;PIN;8.0;OESTE;78644;62997;35570;27427;53
-PIRITUBA;63;PIR;17.1;NORTE;151464;161796;84539;77257;54
-PONTE RASA;64;PRA;6.4;LESTE;102702;98113;51263;46850;55
-REP�BLICA;66;REP;2.3;CENTRO;57797;47718;24353;23365;56
-SANTA CEC�LIA;69;SCE;3.9;CENTRO;85829;71179;39425;31754;57
-SANTANA;70;STN;12.6;NORTE;137679;124654;63170;61484;58
-SANTO AMARO;71;SAM;15.6;SUL;75556;60539;32692;27847;59
-S�O DOMINGOS;95;SDO;10.0;NORTE;70386;82834;42850;39984;60
-S�O LUCAS;72;SLU;9.9;LESTE;152036;139333;72733;66600;61
-S�O MATEUS;73;SMT;13.0;LESTE;150764;154850;79361;75489;62
-S�O MIGUEL;74;SMI;7.6;LESTE;102964;97373;50677;46696;63
-S�O RAFAEL;75;SRA;13.2;LESTE;89862;125088;63274;61814;64
-SA�DE;77;SAU;8.9;SUDESTE;126596;118077;65008;53069;65
-S�;78;SEE;2.1;CENTRO;27186;20115;10566;9549;66
-SOCORRO;79;SOC;12.5;SUL;43194;39097;20836;18261;67
-TATUAP�;80;TAT;8.2;LESTE;81840;79381;42860;36521;68
-TREMEMB�;81;TRE;18.3;NORTE;125075;163803;84384;79419;69
-TUCURUVI;82;TUC;9.0;NORTE;223768;99368;53627;45741;70
-VILA ANDRADE;83;VAN;10.3;OESTE;42576;73649;37694;35955;71
-VILA CURU��;84;VCR;9.7;LESTE;122367;146482;75121;71361;72
-VILA FORMOSA;85;VFO;7.4;LESTE;97940;93850;49468;44382;73
-VILA GUILHERME;86;VGL;6.9;NORTE;62648;49984;26729;23255;74
-VILA JACU�;87;VJA;7.7;LESTE;100589;141959;72844;69115;75
-VILA LEOPOLDINA;88;VLE;8.0;OESTE;26827;26870;14266;12604;76
-VILA MARIA;89;VMR;11.8;LESTE;122662;113845;59702;54143;77
-VILA MARIANA;90;VMN;8.6;SUDESTE;132822;123683;69168;54515;78
-VILA MATILDE;91;VMT;8.9;LESTE;109023;102935;54454;48481;79
-VILA MEDEIROS;92;VMD;7.7;NORTE;156140;140564;74109;66455;80
-VILA S�NIA;94;VSO;9.9;OESTE;83006;87379;45461;41918;81
-PARELHEIROS;55;PLH;153.5;SUL;55594;102836;51611;51225;82
-GRAJA�;30;GRA;92.0;SUL;192838;333436;170271;163165;83
-PEDREIRA;58;PDR;16.7;SUL;86001;127425;65405;62020;84
-SACOM�;68;SAC;14.2;SUDESTE;207834;228283;118795;109488;85
-IPIRANGA;34;IPI;10.5;SUDESTE;101396;98863;53194;45669;86
-VILA PRUDENTE;93;VPR;9.9;LESTE;114297;102104;53998;48106;87
-SAPOPEMBA;76;SAP;13.5;LESTE;256081;282239;145198;137041;88
-JARDIM HELENA;44;JDH;9.1;LESTE;118381;139106;70891;68215;89
-ERMELINO MATARAZZO;28;ERM;8.7;LESTE;95609;106838;54926;51912;90
-PERUS;61;PRS;23.9;NORTE;46301;70689;35791;34898;91
-JAGUAR�;41;JRE;6.6;OESTE;44361;42479;22105;20374;92
-RIO PEQUENO;67;RPE;9.7;OESTE;102843;111756;58200;53556;93
-RAPOSO TAVARES;65;RTA;12.6;OESTE;82890;91204;47329;43875;94
-MARSILAC;52;MAR;200.0;SUL;5992;8404;4124;4280;95
+�GUA RASA;1;ARA;6.9;LESTE;95099;85896;45905;39991;0
+ALTO DE PINHEIROS;2;API;7.7;OESTE;50351;44454;24579;19875;1
+ANHANGUERA;3;ANH;33.3;NORTE;12408;38427;19267;19160;2
+ARICANDUVA;4;ARI;6.6;LESTE;193024;94813;49498;45315;3
+ARTUR ALVIM;5;AAL;6.6;LESTE;117321;111210;58607;52603;4
+BARRA FUNDA;6;BFU;5.6;NORTE;15977;12965;7244;5721;5
+BELA VISTA;7;BVI;2.6;SUDESTE;71825;63190;34809;28381;6
+BELEM;8;BEL;6.0;LESTE;48389;39622;21551;18071;7
+BOM RETIRO;9;BRE;5.0;CENTRO;36136;26598;13961;12637;8
+BR�S;10;BRS;3.5;CENTRO;33536;25158;12829;12329;9
+BRASIL�NDIA;11;BRL;21.0;NORTE;201307;247328;127603;119725;10
+BUTANT�;12;BUT;12.5;OESTE;58019;52649;28198;24451;11
+CACHOEIRINHA;13;CAC;13.3;NORTE;125852;147649;76447;71202;12
+CAMBUCI;14;CMB;3.9;SUDESTE;37069;28717;15674;13043;13
+CAMPO BELO;15;CBE;8.9;SUL;77952;66646;36101;30545;14
+CAMPO GRANDE;16;CGR;13.1;SUL;82052;91373;48339;43034;15
+CAMPO LIMPO;17;CLM;12.0;OESTE;159471;191527;99047;92480;16
+CANGA�BA;18;CNG;16.0;LESTE;115070;137442;71699;65743;17
+CAP�O REDONDO;19;CRE;13.6;OESTE;192489;240793;124539;116254;18
+CARR�O;20;CAR;7.5;LESTE;87336;78175;41590;36585;19
+CASA VERDE;21;CVE;7.1;NORTE;96396;83629;44798;38831;20
+CIDADE ADEMAR;22;CAD;12.0;SUL;230794;243372;126923;116449;21
+CIDADE DUTRA;23;CDU;29.3;SUL;169379;191389;99375;92014;22
+CIDADE L�DER;24;CLD;10.2;LESTE;97370;116841;59902;56939;23
+CIDADE TIRADENTES;25;CTI;15.0;LESTE;192562;190657;99131;91526;24
+CONSOLA��O;26;CON;3.7;CENTRO;65570;54522;30892;23630;25
+CURSINO;27;CUR;12.8;SUDESTE;110435;102089;54699;47390;26
+FREGUESIA DO �;29;FRE;10.5;NORTE;152672;144923;76020;68903;27
+GUAIANAZES;31;GUA;9.9;LESTE;81373;98546;50354;48192;28
+IGUATEMI;33;IGU;19.6;LESTE;59820;101780;51373;50407;29
+ITAIM BIBI;35;IBI;9.9;SUL;107497;81456;45560;35896;30
+ITAIM PAULISTA;36;IPA;12.0;LESTE;163269;212733;109106;103627;31
+ITAQUERA;37;ITQ;14.8;LESTE;175126;201512;104214;97298;32
+JABAQUARA;38;JAB;14.1;SUDESTE;214350;214095;113456;100639;33
+JACAN�;39;JAC;7.8;NORTE;86830;91809;48032;43777;34
+JAGUARA;40;JAG;4.6;NORTE;29798;25713;13400;12313;35
+JARAGU�;42;JAR;27.6;NORTE;93185;145900;74751;71149;36
+JARDIM �NGELA;43;JDA;37.4;SUL;177913;245805;125254;120551;37
+JARDIM PAULISTA;45;JDP;6.1;SUL;103138;83667;48148;35519;38
+JARDIM S�O LUIS;46;JDS;24.7;SUL;204284;239161;123372;115789;39
+JOSE BONIF�CIO;47;JBO;14.1;LESTE;103712;107082;56312;50770;40
+LAGEADO;96;LAJ;9.2;LESTE;112807;107082;50770;56312;41
+LAPA;48;LAP;10.0;OESTE;70319;60184;33030;27154;42
+LIBERDADE;49;LIB;3.7;SUDESTE;76245;61875;34043;27832;43
+LIM�O;50;LIM;6.3;NORTE;89478;82045;43375;38670;44
+MANDAQUI;51;MAN;13.1;NORTE;104022;103113;54385;48728;45
+MOEMA;32;MOE;9.0;SUL;77340;71276;39556;31720;46
+MO�CA;53;MOO;7.7;LESTE;71999;63280;34474;28806;47
+MORUMBI;54;MOR;11.4;OESTE;78892;34588;18560;16028;48
+PARI;56;PRI;2.9;CENTRO;21299;14824;7939;6885;49
+PARQUE DO CARMO;57;PQC;15.4;LESTE;54743;64067;32664;31403;50
+PENHA;59;PEN;11.3;LESTE;133006;124292;66160;58132;51
+PERDIZES;60;PRD;6.1;NORTE;108840;102445;56415;46030;52
+PINHEIROS;62;PIN;8.0;OESTE;78644;62997;35570;27427;53
+PIRITUBA;63;PIR;17.1;NORTE;151464;161796;84539;77257;54
+PONTE RASA;64;PRA;6.4;LESTE;102702;98113;51263;46850;55
+REP�BLICA;66;REP;2.3;CENTRO;57797;47718;24353;23365;56
+SANTA CEC�LIA;69;SCE;3.9;CENTRO;85829;71179;39425;31754;57
+SANTANA;70;STN;12.6;NORTE;137679;124654;63170;61484;58
+SANTO AMARO;71;SAM;15.6;SUL;75556;60539;32692;27847;59
+S�O DOMINGOS;95;SDO;10.0;NORTE;70386;82834;42850;39984;60
+S�O LUCAS;72;SLU;9.9;LESTE;152036;139333;72733;66600;61
+S�O MATEUS;73;SMT;13.0;LESTE;150764;154850;79361;75489;62
+S�O MIGUEL;74;SMI;7.6;LESTE;102964;97373;50677;46696;63
+S�O RAFAEL;75;SRA;13.2;LESTE;89862;125088;63274;61814;64
+SA�DE;77;SAU;8.9;SUDESTE;126596;118077;65008;53069;65
+S�;78;SEE;2.1;CENTRO;27186;20115;10566;9549;66
+SOCORRO;79;SOC;12.5;SUL;43194;39097;20836;18261;67
+TATUAP�;80;TAT;8.2;LESTE;81840;79381;42860;36521;68
+TREMEMB�;81;TRE;18.3;NORTE;125075;163803;84384;79419;69
+TUCURUVI;82;TUC;9.0;NORTE;223768;99368;53627;45741;70
+VILA ANDRADE;83;VAN;10.3;OESTE;42576;73649;37694;35955;71
+VILA CURU��;84;VCR;9.7;LESTE;122367;146482;75121;71361;72
+VILA FORMOSA;85;VFO;7.4;LESTE;97940;93850;49468;44382;73
+VILA GUILHERME;86;VGL;6.9;NORTE;62648;49984;26729;23255;74
+VILA JACU�;87;VJA;7.7;LESTE;100589;141959;72844;69115;75
+VILA LEOPOLDINA;88;VLE;8.0;OESTE;26827;26870;14266;12604;76
+VILA MARIA;89;VMR;11.8;LESTE;122662;113845;59702;54143;77
+VILA MARIANA;90;VMN;8.6;SUDESTE;132822;123683;69168;54515;78
+VILA MATILDE;91;VMT;8.9;LESTE;109023;102935;54454;48481;79
+VILA MEDEIROS;92;VMD;7.7;NORTE;156140;140564;74109;66455;80
+VILA S�NIA;94;VSO;9.9;OESTE;83006;87379;45461;41918;81
+PARELHEIROS;55;PLH;153.5;SUL;55594;102836;51611;51225;82
+GRAJA�;30;GRA;92.0;SUL;192838;333436;170271;163165;83
+PEDREIRA;58;PDR;16.7;SUL;86001;127425;65405;62020;84
+SACOM�;68;SAC;14.2;SUDESTE;207834;228283;118795;109488;85
+IPIRANGA;34;IPI;10.5;SUDESTE;101396;98863;53194;45669;86
+VILA PRUDENTE;93;VPR;9.9;LESTE;114297;102104;53998;48106;87
+SAPOPEMBA;76;SAP;13.5;LESTE;256081;282239;145198;137041;88
+JARDIM HELENA;44;JDH;9.1;LESTE;118381;139106;70891;68215;89
+ERMELINO MATARAZZO;28;ERM;8.7;LESTE;95609;106838;54926;51912;90
+PERUS;61;PRS;23.9;NORTE;46301;70689;35791;34898;91
+JAGUAR�;41;JRE;6.6;OESTE;44361;42479;22105;20374;92
+RIO PEQUENO;67;RPE;9.7;OESTE;102843;111756;58200;53556;93
+RAPOSO TAVARES;65;RTA;12.6;OESTE;82890;91204;47329;43875;94
+MARSILAC;52;MAR;200.0;SUL;5992;8404;4124;4280;95
diff --git a/examples/data/Distritos.mif b/examples/data/Distritos.mif
old mode 100755
new mode 100644
index 4e046b8..42ac569
--- a/examples/data/Distritos.mif
+++ b/examples/data/Distritos.mif
@@ -1,41096 +1,41096 @@
-Version 300
-Charset "WindowsLatin1" 
-Delimiter ";"
-CoordSys Earth Projection 8, 92, Meters, -45.000000, 0.000000, 0.999600, 500000.000000, 10000000.000000
-Columns 10
-  Nome_Distrito Char(45)
-  Numero_Distrito Integer
-  Sigla Char(3)
-  area_km2 Float
-  Zona Char(10)
-  Pop91 Integer
-  Pop2000 Integer
-  Pop_2000_Fem Integer
-  Pop_2000_Masc Integer
-  object_id_ Char(16)
-Data
-Region 1
-206
-340033.474470  7391306.215632 
-340012.347627  7391313.834327 
-339993.645176  7391324.162558 
-339911.718874  7391363.115885 
-339895.242905  7391373.284144 
-339879.138017  7391377.113488 
-339857.681325  7391387.121773 
-339823.781070  7391399.099722 
-339810.092328  7391401.609292 
-339778.418556  7391409.417954 
-339765.274064  7391416.036820 
-339692.797943  7391432.763955 
-339637.490474  7391445.661746 
-339619.711601  7391449.231135 
-339601.338999  7391454.250275 
-339569.401347  7391463.448699 
-339484.621850  7391505.761451 
-339435.969090  7391532.706836 
-339292.426953  7391612.743126 
-339206.097164  7391660.874882 
-339194.783335  7391653.956067 
-339180.204000  7391649.636807 
-339168.708754  7391647.037252 
-339159.530699  7391645.927442 
-339148.101424  7391647.127237 
-339135.657862  7391649.116896 
-339127.048797  7391651.286524 
-339117.112089  7391650.696625 
-339101.576190  7391694.589107 
-339069.333429  7391757.288367 
-339035.828993  7391822.027278 
-339008.591694  7391850.402418 
-338959.435913  7391833.135375 
-338859.796708  7391855.181599 
-338844.450473  7391879.787384 
-338850.453729  7391938.547319 
-338869.156180  7391987.728895 
-338866.781265  7391999.996793 
-338828.098197  7392039.789977 
-338804.027450  7392059.256643 
-338782.950084  7392069.554879 
-338762.573649  7392072.234420 
-338742.691986  7392073.124267 
-338725.680013  7392087.161863 
-338679.402166  7392129.174666 
-338636.868109  7392167.808049 
-338611.337778  7392195.423319 
-338590.631493  7392219.939119 
-338588.446242  7392233.416811 
-338591.406639  7392251.953635 
-338608.542306  7392270.010542 
-338625.686220  7392297.625812 
-338645.774038  7392319.961986 
-338647.472761  7392340.268508 
-338651.101103  7392378.112026 
-338650.721776  7392394.879154 
-338648.429324  7392425.653882 
-338642.970319  7392475.225391 
-338640.636636  7392502.430731 
-338638.302953  7392527.856376 
-338630.328848  7392550.272536 
-338614.157989  7392569.429255 
-338596.461578  7392587.576146 
-338571.887811  7392607.052810 
-338549.342616  7392625.749608 
-338527.531336  7392640.367104 
-338509.002056  7392650.145429 
-338454.939768  7392650.485371 
-338366.498944  7392656.654314 
-338266.851493  7392663.903072 
-338213.061331  7392665.772752 
-338185.807538  7392671.281808 
-338172.918680  7392684.829488 
-338059.780395  7392788.461736 
-338033.169809  7392808.448313 
-337956.562326  7392880.925898 
-337952.950477  7392884.175342 
-337924.591690  7392908.251218 
-337872.277603  7392965.751368 
-337794.969191  7393053.906268 
-337870.941714  7393206.140192 
-337913.327339  7393305.983090 
-337963.357220  7393405.266083 
-338013.337624  7393505.148974 
-338032.147277  7393552.460870 
-338055.014074  7393603.382148 
-338068.744048  7393629.967594 
-338096.740001  7393684.928180 
-338118.048261  7393733.839802 
-338133.946994  7393769.363717 
-338145.565933  7393793.629560 
-338164.425062  7393824.564261 
-338173.025881  7393846.050581 
-338195.068055  7393889.113205 
-338228.861109  7393967.659750 
-338244.372268  7393992.205546 
-338255.941730  7394018.121107 
-338291.515969  7394089.498881 
-338299.762200  7394106.375990 
-338341.290217  7394195.380744 
-338375.371889  7394264.068978 
-338379.956793  7394260.299624 
-338450.890869  7394334.326944 
-338477.682872  7394362.092188 
-338524.076166  7394411.433736 
-338581.041127  7394473.103173 
-338732.722294  7394630.786163 
-338703.233773  7394679.957740 
-338878.911470  7394746.326372 
-338898.372575  7394704.243580 
-338914.988730  7394670.809307 
-338945.392582  7394607.430164 
-338966.346254  7394570.906420 
-338992.222926  7394521.914812 
-339009.193668  7394491.919949 
-339072.796845  7394480.731866 
-339092.612538  7394476.732551 
-339121.993858  7394465.194527 
-339143.351595  7394457.755801 
-339194.436994  7394442.618394 
-339223.389510  7394437.569259 
-339266.410095  7394431.900230 
-339307.138228  7394428.490814 
-339339.867517  7394425.761282 
-339380.166847  7394428.840754 
-339414.372211  7394432.620107 
-339455.421947  7394436.859381 
-339502.153337  7394444.198124 
-339538.997495  7394449.917144 
-339652.523352  7394477.022501 
-339656.077478  7394459.105570 
-339660.357272  7394446.937655 
-339665.370980  7394438.969019 
-339671.118603  7394432.540121 
-339678.391778  7394428.030893 
-339686.398868  7394425.061402 
-339775.491144  7394413.353407 
-339778.327847  7394391.237196 
-339827.318703  7394352.403847 
-339856.749501  7394334.366937 
-339885.767986  7394319.769437 
-339882.527218  7394296.453431 
-339836.397803  7394115.384447 
-339825.323116  7394072.121857 
-339808.203941  7393973.528745 
-339809.416137  7393955.591818 
-339829.306045  7393935.785210 
-339901.798659  7393848.930088 
-339915.330723  7393820.904888 
-340000.003019  7393776.762449 
-340020.832998  7393761.385083 
-340045.489228  7393738.718966 
-340075.414799  7393698.095924 
-340111.582766  7393633.656962 
-340173.503712  7393536.723566 
-340234.418618  7393440.999963 
-340270.809234  7393407.775654 
-340517.618917  7393270.919096 
-340560.969352  7393251.682391 
-340739.904310  7393151.469556 
-340793.702719  7393122.994434 
-340909.191179  7393058.125545 
-340970.106085  7393032.809882 
-340997.805174  7393027.290827 
-341148.851381  7392950.893913 
-341193.183117  7392919.689258 
-341232.938195  7392879.106210 
-341288.905362  7392823.975653 
-341372.761281  7392736.960558 
-341418.643309  7392686.329231 
-341395.710541  7392635.917866 
-341367.912498  7392566.179811 
-341279.966448  7392352.756369 
-341216.915768  7392201.412293 
-341160.470320  7392061.576245 
-341128.862518  7392071.784497 
-341119.618493  7391981.869898 
-341114.876910  7391946.275995 
-341113.219418  7391926.309415 
-341092.612088  7391744.560547 
-341093.214062  7391743.520725 
-341085.932641  7391678.021945 
-341078.148199  7391636.499057 
-341072.103712  7391551.963537 
-341067.032280  7391500.942277 
-341059.379778  7391432.014084 
-341046.804276  7391322.802791 
-340930.705595  7391331.491302 
-340843.542937  7391339.929857 
-340804.777407  7391332.021212 
-340725.349713  7391314.904144 
-340691.870017  7391304.655899 
-340626.164051  7391286.219057 
-340596.609560  7391278.570367 
-340568.176557  7391268.302126 
-340506.552476  7391251.325034 
-340460.282875  7391247.605671 
-340414.392602  7391248.615498 
-340392.836955  7391248.555508 
-340355.910334  7391249.165404 
-340330.248064  7391250.525171 
-340254.992963  7391252.514830 
-340175.441576  7391262.863058 
-340113.042349  7391276.630699 
-340084.815502  7391280.939961 
-340033.474470  7391306.215632 
-Region 1
-182
-327045.149934  7394665.260258 
-327016.642715  7394577.715254 
-326971.403894  7394423.951592 
-326964.427583  7394388.167721 
-326953.509573  7394311.250896 
-326935.969841  7394231.564546 
-326927.418499  7394217.376976 
-326904.246591  7394172.224710 
-326882.756914  7394133.421357 
-326868.161086  7394100.696962 
-326846.176635  7394067.232695 
-326833.122852  7394039.837387 
-326814.906929  7394014.861665 
-326810.552919  7394000.004210 
-326805.357793  7393990.285875 
-326784.610277  7393958.321350 
-326780.891227  7393937.194969 
-326779.349182  7393876.285402 
-326706.427764  7393787.630588 
-326666.540747  7393736.559336 
-326632.112734  7393667.511163 
-326618.539438  7393624.818476 
-326595.854058  7393602.352324 
-326524.260283  7393533.014201 
-326480.926341  7393492.151201 
-326461.143634  7393476.623860 
-326398.282618  7393417.953910 
-326332.131355  7393354.704744 
-326265.213194  7393290.935667 
-326194.237886  7393224.866984 
-326105.557922  7393133.352660 
-326011.122089  7393067.323970 
-325992.543331  7393100.888221 
-325962.436343  7393151.369574 
-325908.184392  7393223.127282 
-325824.015115  7393303.113581 
-325739.614945  7393385.629447 
-325557.678358  7393478.933465 
-325401.313332  7393585.165268 
-325328.342437  7393628.687813 
-325304.519077  7393642.815393 
-325259.024623  7393666.531331 
-325104.440783  7393743.658120 
-324955.085053  7393817.965392 
-324801.466023  7393898.641573 
-324528.853884  7394033.938398 
-324464.236420  7394066.272859 
-324355.410914  7394115.694393 
-324226.274943  7394180.713256 
-324082.064861  7394268.028300 
-323920.364524  7394341.185769 
-323764.774644  7394415.293075 
-323620.498593  7394507.697247 
-323473.608486  7394605.060570 
-323287.581769  7394707.702988 
-323196.576368  7394782.140237 
-323055.293698  7394922.096264 
-322960.626970  7395008.331493 
-323084.823450  7395133.610034 
-323192.997504  7395247.840467 
-323241.848174  7395300.011531 
-323352.092032  7395420.640868 
-323437.819845  7395510.365499 
-323488.360993  7395525.942831 
-323508.143700  7395536.990938 
-323539.067065  7395554.967859 
-323557.546868  7395571.345054 
-323573.470340  7395590.511771 
-323592.667565  7395614.757618 
-323604.773031  7395633.144468 
-323623.129141  7395670.348095 
-323639.761788  7395698.913202 
-323662.397691  7395744.275432 
-323675.583414  7395753.253894 
-323709.450683  7395792.597155 
-323797.446210  7395885.901173 
-323808.306496  7395899.178899 
-323838.207328  7395920.455254 
-323879.512698  7395948.920378 
-323903.146395  7395958.178793 
-323928.759187  7395969.336881 
-323965.578607  7395981.524794 
-323999.998374  7395984.374306 
-324016.053785  7395986.313973 
-324043.027205  7395988.033679 
-324073.810384  7395987.203821 
-324096.446287  7395984.604266 
-324138.048521  7395979.415155 
-324190.799658  7395969.906784 
-324254.889363  7395961.888157 
-324323.563972  7395953.349620 
-324357.653889  7395951.499937 
-324382.582244  7395951.689904 
-324404.467741  7395955.709216 
-324423.062991  7395959.468572 
-324440.643954  7395967.297231 
-324456.221084  7395977.665455 
-324477.908671  7395999.971634 
-324506.127272  7396048.483324 
-324527.163406  7396064.370603 
-324536.201275  7396070.179608 
-324548.026370  7396080.117906 
-324560.593625  7396088.456477 
-324572.047640  7396095.685239 
-324585.711644  7396105.553549 
-324700.672345  7396127.629767 
-324953.048234  7396172.572069 
-325022.333064  7396184.749983 
-325123.580284  7396187.819457 
-325167.343030  7396184.410041 
-325219.863273  7396180.630689 
-325247.653070  7396178.361077 
-325288.372957  7396174.191792 
-325324.953237  7396168.152826 
-325351.910165  7396159.004393 
-325393.009378  7396146.086606 
-325432.962366  7396133.938687 
-325467.200715  7396120.640964 
-325485.853689  7396111.912459 
-325501.818391  7396102.034151 
-325516.661607  7396090.246171 
-325525.402611  7396077.708318 
-325531.859410  7396068.589880 
-325534.506450  7396050.343006 
-325532.222244  7396044.643982 
-325534.110631  7396033.985808 
-325530.680199  7396021.447955 
-325516.686345  7395993.502742 
-325561.850951  7395949.470284 
-325628.249600  7395862.975100 
-325645.236835  7395843.648411 
-325662.751829  7395829.130897 
-325671.138245  7395824.801639 
-325688.933611  7395819.172603 
-325709.771836  7395810.994004 
-325769.029249  7395805.274984 
-325796.497444  7395800.885735 
-325817.352161  7395798.296179 
-325828.542296  7395794.716792 
-325844.292596  7395787.318060 
-325876.246740  7395755.763465 
-325895.237809  7395723.718953 
-325916.546069  7395703.612398 
-325977.271312  7395674.527380 
-326016.160536  7395659.709918 
-326060.409809  7395655.290675 
-326076.432235  7395651.951247 
-326241.439311  7395612.967924 
-326293.308101  7395601.169945 
-326434.763942  7395579.483660 
-326499.307189  7395571.235073 
-326616.073815  7395566.145944 
-326616.082061  7395566.125948 
-326675.628093  7395581.013398 
-326722.252281  7395592.821375 
-326767.820952  7395600.580046 
-326814.403908  7395523.283286 
-326850.101841  7395465.563173 
-326868.317764  7395432.758792 
-326887.597452  7395414.181974 
-326913.762742  7395398.384680 
-326942.707011  7395379.517912 
-327001.131555  7395345.363762 
-327063.530783  7395282.754487 
-327080.781897  7395264.677583 
-327148.986471  7395187.330832 
-327179.175921  7395159.325629 
-327218.279547  7395130.290602 
-327212.812296  7395090.437429 
-327217.322984  7395065.801649 
-327229.469682  7395045.205177 
-327242.135892  7395027.908140 
-327276.349503  7394981.356113 
-327230.822064  7394900.210013 
-327185.393579  7394852.068259 
-327165.412962  7394817.694147 
-327147.023868  7394801.086992 
-327138.398311  7394788.249191 
-327110.253925  7394746.186396 
-327061.576426  7394678.627968 
-327045.191166  7394665.310249 
-327045.149934  7394665.260258 
-Region 1
-1655
-314875.997705  7407081.823413 
-314889.496785  7407054.698059 
-314897.256488  7407041.890253 
-314909.691804  7407020.303951 
-314920.560336  7407001.477176 
-314926.522361  7406990.679025 
-314932.261737  7406976.851394 
-314940.095656  7406957.484711 
-314943.311686  7406941.867386 
-314942.544787  7406917.871496 
-314937.597048  7406905.703581 
-314930.365104  7406892.495843 
-314927.379969  7406886.156929 
-314923.924798  7406877.028493 
-314921.022125  7406863.110876 
-314924.963823  7406851.032945 
-314932.632818  7406846.313754 
-314940.590430  7406838.815038 
-314942.726204  7406829.746591 
-314944.911455  7406815.129095 
-314946.907043  7406794.692596 
-314946.973013  7406788.893589 
-314940.409013  7406760.288489 
-314938.462903  7406752.449832 
-314943.187993  7406738.602204 
-314945.373244  7406724.234665 
-314942.973591  7406710.826961 
-314939.782300  7406699.938826 
-314938.347455  7406691.850212 
-314929.713652  7406667.264423 
-314926.011094  7406656.876203 
-314925.615275  7406646.018063 
-314926.060572  7406628.601046 
-314927.775788  7406610.694113 
-314934.595420  7406590.557562 
-314943.130269  7406576.250013 
-314943.723998  7406568.681310 
-314945.134103  7406555.063642 
-314944.441420  7406548.994682 
-314946.140143  7406532.347533 
-314950.353967  7406518.499905 
-314957.577665  7406508.221666 
-314967.547358  7406503.272514 
-314992.582914  7406490.644677 
-315015.812546  7406481.536237 
-315045.193866  7406467.188694 
-315077.634537  7406451.351407 
-315100.658013  7406437.443789 
-315127.557218  7406417.517203 
-315135.564308  7406404.969352 
-315155.437723  7406376.634206 
-315164.162235  7406345.159597 
-315160.311246  7406324.923063 
-315158.760954  7406302.686872 
-315160.707065  7406287.309506 
-315163.848879  7406254.765081 
-315164.261190  7406216.141696 
-315159.651547  7406195.385252 
-315156.790105  7406177.938240 
-315153.879186  7406164.780494 
-315135.984865  7406120.888013 
-315146.317392  7406084.384265 
-315166.289763  7406042.371462 
-315210.374112  7405977.632551 
-315215.882594  7405945.268095 
-315216.575277  7405918.402696 
-315208.996991  7405871.570718 
-315203.488509  7405827.488269 
-315197.287344  7405780.656291 
-315195.217540  7405741.403015 
-315202.795826  7405701.449858 
-315212.435670  7405678.723751 
-315234.477844  7405649.108824 
-315243.433251  7405626.382717 
-315240.679010  7405605.026375 
-315237.232085  7405587.809324 
-315232.416287  7405568.522628 
-315227.592242  7405540.287464 
-315227.592242  7405511.362419 
-315231.030920  7405478.298082 
-315235.170528  7405452.132564 
-315243.433251  7405410.809643 
-315258.581576  7405350.200024 
-315275.799706  7405316.445806 
-315294.403202  7405276.502648 
-315301.288805  7405253.776541 
-315304.727483  7405237.249372 
-315309.551528  7405221.402086 
-315321.945613  7405206.254681 
-315341.926230  7405195.916452 
-315353.627631  7405184.898339 
-315359.144359  7405172.500463 
-315362.253188  7405164.211882 
-315366.862831  7405137.246501 
-315375.958423  7405118.399730 
-315395.988518  7405098.403155 
-315409.083532  7405085.905296 
-315426.804682  7405068.408293 
-315443.049756  7405047.111941 
-315458.536177  7405024.285851 
-315468.373930  7405007.218774 
-315477.972543  7404989.381829 
-315488.643165  7404965.755876 
-315492.584863  7404953.427988 
-315499.808561  7404943.149748 
-315507.527033  7404934.891163 
-315519.789178  7404928.702223 
-315530.558756  7404919.713763 
-315538.285474  7404910.205391 
-315543.010564  7404895.607892 
-315545.179322  7404883.000052 
-315546.622413  7404866.602860 
-315547.306850  7404850.455626 
-315552.642161  7404827.019640 
-315555.338679  7404812.152187 
-315560.904884  7404790.245939 
-315565.959824  7404769.079565 
-315568.375969  7404757.491550 
-315569.307793  7404741.594273 
-315572.795949  7404724.207251 
-315577.892119  7404698.501654 
-315577.554024  7404682.844336 
-315576.449029  7404667.436976 
-315572.325914  7404648.450228 
-315569.967492  7404631.513129 
-315571.187934  7404612.086457 
-315576.449029  7404595.979216 
-315580.225803  7404575.052800 
-315582.765642  7404551.596818 
-315592.108621  7404517.932584 
-315586.591893  7404499.225789 
-315582.872843  7404473.970115 
-315582.163667  7404460.842363 
-315582.798627  7404427.778027 
-315583.400602  7404401.522524 
-315580.638114  7404327.305237 
-315581.759602  7404298.780123 
-315585.923948  7404271.284833 
-315589.791430  7404255.647511 
-315593.939284  7404232.941401 
-315598.309787  7404219.073776 
-315606.020012  7404195.627792 
-315626.223277  7404158.344179 
-315628.598192  7404134.628241 
-315633.735593  7404119.250875 
-315649.799251  7404101.893848 
-315666.605069  7404089.595954 
-315684.449912  7404072.238928 
-315702.797775  7404054.142027 
-315718.111025  7404034.505391 
-315730.356678  7404018.648107 
-315743.657848  7403993.962336 
-315760.241018  7403974.085740 
-315778.357986  7403950.179835 
-315791.873559  7403936.092248 
-315807.162070  7403923.024487 
-315835.166269  7403902.937927 
-315859.632836  7403880.821716 
-315882.837729  7403855.156112 
-315894.563869  7403843.088179 
-315910.388385  7403821.691844 
-315923.664817  7403804.074862 
-315933.609771  7403793.006758 
-315949.195147  7403766.811245 
-315964.269256  7403744.405083 
-315971.418738  7403734.336807 
-316003.018294  7403705.171803 
-316025.423303  7403688.344685 
-316061.088250  7403658.949720 
-316077.943546  7403635.543730 
-316089.422299  7403621.196187 
-316101.948323  7403599.789854 
-316116.263780  7403575.104082 
-316128.542417  7403550.918225 
-316144.177270  7403511.345004 
-316153.693421  7403481.340143 
-316155.779717  7403465.702822 
-316158.385526  7403448.795718 
-316155.656024  7403431.878615 
-316150.906195  7403412.421948 
-316145.612115  7403400.284027 
-316141.109673  7403383.606884 
-316135.856824  7403361.370693 
-316113.088981  7403271.166144 
-316144.127793  7403256.138718 
-316172.635012  7403237.821856 
-316190.991122  7403220.474827 
-316212.942588  7403190.769915 
-316229.294863  7403162.564747 
-316235.364089  7403170.663359 
-316250.537153  7403187.380496 
-316260.638786  7403202.317937 
-316278.054825  7403230.403126 
-316290.185030  7403247.110265 
-316305.621974  7403261.047877 
-316324.637782  7403268.196653 
-316341.385876  7403273.055820 
-316356.088906  7403278.414902 
-316373.307035  7403292.362513 
-316387.267904  7403294.942071 
-316404.263385  7403299.551282 
-316422.281399  7403302.900708 
-316444.859579  7403309.049655 
-316460.576894  7403317.438218 
-316475.255185  7403330.366004 
-316481.019300  7403350.582541 
-316487.525576  7403377.117995 
-316487.921395  7403405.383154 
-316486.577259  7403424.569867 
-316490.288063  7403452.855022 
-316497.816872  7403475.601126 
-316510.944871  7403497.107442 
-316515.917348  7403525.142640 
-316516.354398  7403543.579482 
-316522.852428  7403571.364723 
-316530.389483  7403593.101000 
-316535.650578  7403612.307710 
-316539.402613  7403627.215156 
-316543.624683  7403651.720958 
-316545.306914  7403676.966634 
-316545.480085  7403698.422959 
-316541.596110  7403719.869285 
-316533.407603  7403735.736567 
-316522.679257  7403752.863634 
-316517.038835  7403765.971388 
-316514.919554  7403790.447196 
-316514.325826  7403812.403435 
-316512.453931  7403838.149025 
-316512.363223  7403860.355221 
-316519.133378  7403884.871022 
-316533.242679  7403914.205997 
-316544.597738  7403933.182747 
-316553.668592  7403952.399455 
-316558.929687  7403971.106251 
-316563.407390  7403996.871837 
-316564.306229  7404026.656735 
-316564.974174  7404052.912238 
-316566.161631  7404073.618691 
-316574.457339  7404097.374622 
-316587.370937  7404107.022969 
-316604.366418  7404112.132094 
-316629.500929  7404114.251731 
-316650.306169  7404118.620983 
-316683.315830  7404118.750960 
-316707.699934  7404118.081075 
-316728.010400  7404120.180716 
-316752.097640  7404128.859229 
-316773.405900  7404135.248135 
-316788.108929  7404144.146610 
-316806.827873  7404163.143356 
-316821.258776  7404175.061315 
-316839.755072  7404186.749313 
-316861.797246  7404198.447309 
-316876.252889  7404203.546436 
-316892.728857  7404212.194954 
-316912.486826  7404225.652649 
-316926.167323  7404235.290998 
-316939.567448  7404249.988481 
-316951.969778  7404262.656311 
-316966.928441  7404268.265350 
-316988.244947  7404272.134687 
-317009.363544  7404260.606662 
-317019.828010  7404248.028816 
-317037.969718  7404218.303908 
-317052.004802  7404199.687097 
-317071.136057  7404177.540890 
-317096.600418  7404159.713944 
-317121.792652  7404145.176434 
-317153.573625  7404134.948186 
-317179.541006  7404119.140894 
-317205.236260  7404107.632865 
-317225.835344  7404099.884192 
-317253.303539  7404088.126206 
-317271.387523  7404073.808659 
-317294.072903  7404050.672622 
-317309.122274  7404033.315595 
-317329.787328  7404009.659647 
-317349.916377  7403992.072659 
-317377.664943  7403973.495841 
-317398.569138  7403951.869546 
-317423.060443  7403922.174632 
-317439.379733  7403904.317691 
-317456.960697  7403889.490231 
-317476.091952  7403866.594153 
-317493.466760  7403838.139027 
-317504.953759  7403822.781657 
-317517.702432  7403809.953855 
-317539.587928  7403796.406175 
-317567.031384  7403791.716978 
-317604.675427  7403777.729374 
-317631.376721  7403768.241000 
-317675.593010  7403759.822442 
-317706.590591  7403755.653156 
-317731.477715  7403755.753139 
-317766.994231  7403764.471645 
-317828.906930  7403779.099140 
-317849.712170  7403784.228261 
-317871.515204  7403793.646648 
-317887.479907  7403802.045209 
-317897.837172  7403818.492392 
-317905.357735  7403842.498280 
-317914.675975  7403863.734642 
-317920.481322  7403874.362822 
-317936.182145  7403885.780866 
-317951.635581  7403894.429385 
-317960.244646  7403901.778126 
-317968.268228  7403929.073451 
-317967.888902  7403961.637873 
-317968.086811  7403976.775280 
-317980.225263  7403990.202980 
-317997.204252  7403999.861325 
-318020.021572  7404009.799623 
-318050.722288  7404018.998047 
-318070.010222  7404020.837732 
-318097.453678  7404016.658448 
-318117.269370  7404015.218695 
-318136.334655  7404008.979763 
-318146.065207  7403988.323302 
-318150.988207  7403962.337753 
-318153.602262  7403942.411166 
-318158.772649  7403918.695228 
-318167.455930  7403905.097557 
-318178.662557  7403896.559020 
-318199.781154  7403886.040822 
-318213.263741  7403879.781894 
-318228.758408  7403878.832056 
-318245.019975  7403877.632262 
-318257.199658  7403879.441952 
-318273.444732  7403882.031508 
-318292.254384  7403878.062188 
-318302.166353  7403875.582613 
-318322.485066  7403873.642945 
-318334.640010  7403883.531251 
-318343.224336  7403896.439040 
-318356.154425  7403902.547994 
-318372.655133  7403904.877595 
-318382.575348  7403900.378366 
-318397.566996  7403897.908789 
-318417.019854  7403895.219249 
-318412.674090  7403906.477321 
-318558.962222  7404213.984648 
-318781.668173  7404524.191512 
-318996.424758  7404953.697942 
-319230.955804  7405274.163049 
-319235.746864  7405301.738325 
-319240.653371  7405318.195506 
-319248.107963  7405334.682682 
-319252.981486  7405354.169344 
-319257.162325  7405367.597044 
-319259.067204  7405379.235051 
-319260.947344  7405393.892540 
-319261.021561  7405410.809643 
-319251.934214  7405428.396630 
-319244.636300  7405445.743659 
-319239.317481  7405467.659905 
-319236.084959  7405485.296884 
-319235.161381  7405499.934376 
-319235.986004  7405518.121261 
-319243.490074  7405529.309345 
-319249.460345  7405541.737216 
-319256.717028  7405552.415387 
-319264.897289  7405571.692085 
-319270.001706  7405593.958271 
-319271.923077  7405604.326495 
-319270.512972  7405617.444248 
-319266.802168  7405631.551831 
-319260.749435  7405651.438425 
-319261.895661  7405663.066433 
-319267.115525  7405673.464652 
-319275.130861  7405684.652736 
-319288.184644  7405700.440031 
-319299.531458  7405708.378672 
-319317.532979  7405712.347992 
-319342.939616  7405713.617774 
-319352.826846  7405715.477456 
-319370.308855  7405720.456603 
-319378.860196  7405728.875161 
-319390.932678  7405741.113065 
-319401.438376  7405757.120323 
-319411.498777  7405766.818661 
-319433.780093  7405774.617326 
-319446.924584  7405781.566135 
-319459.038297  7405789.514774 
-319466.055839  7405798.673205 
-319473.048643  7405809.851290 
-319485.286049  7405830.427766 
-319501.811495  7405853.573801 
-319512.366671  7405865.041837 
-319523.993856  7405870.460908 
-319545.343347  7405870.670872 
-319566.156833  7405872.900491 
-319578.534425  7405880.599172 
-319597.706912  7405893.416976 
-319623.699031  7405911.353904 
-319644.075467  7405930.740583 
-319642.154095  7405944.108293 
-319640.900668  7405966.064532 
-319637.651653  7405984.971294 
-319628.539568  7406005.327807 
-319620.755126  7406020.145269 
-319609.630961  7406039.222001 
-319603.883338  7406053.309588 
-319600.988911  7406063.127906 
-319600.840479  7406077.005529 
-319603.438042  7406095.472366 
-319606.043851  7406112.919377 
-319614.974519  7406133.455860 
-319627.945839  7406156.561902 
-319639.911120  7406178.648119 
-319655.405787  7406203.293897 
-319667.659686  7406222.110674 
-319676.911957  7406236.088280 
-319688.135077  7406256.654757 
-319693.569343  7406270.842327 
-319701.980498  7406292.898549 
-319707.975508  7406302.296939 
-319727.758215  7406309.145766 
-319738.173204  7406330.622087 
-319741.133601  7406338.990654 
-319746.007124  7406358.727273 
-319750.278671  7406387.052421 
-319755.416073  7406406.299124 
-319759.720605  7406431.084879 
-319760.281349  7406450.021635 
-319758.500163  7406474.497442 
-319755.795399  7406490.124766 
-319747.912003  7406514.290626 
-319738.478315  7406540.456144 
-319730.660888  7406559.312914 
-319725.399793  7406575.420155 
-319723.255773  7406586.248301 
-319722.859954  7406599.636007 
-319722.793984  7406629.170948 
-319724.080396  7406651.907054 
-319726.158446  7406671.873634 
-319725.383301  7406696.359439 
-319719.784110  7406704.688013 
-319718.374005  7406717.115884 
-319722.513612  7406727.134168 
-319723.206296  7406757.698933 
-319726.339863  7406797.872051 
-319729.168321  7406818.858457 
-319736.804330  7406841.664550 
-319743.607470  7406870.769565 
-319751.532098  7406890.536179 
-319755.110962  7406912.292452 
-319762.177982  7406940.637597 
-319769.277986  7406965.963259 
-319771.652901  7406982.140488 
-319771.982750  7406998.807633 
-319769.327464  7407009.645776 
-319763.992153  7407033.321721 
-319748.827334  7407049.079022 
-319743.648702  7407058.117474 
-319741.512928  7407067.685835 
-319739.863682  7407079.283848 
-319743.599224  7407086.902543 
-319752.439183  7407091.531750 
-319766.746394  7407099.850325 
-319779.767192  7407109.968592 
-319790.850126  7407125.675901 
-319792.639558  7407132.544725 
-319791.056282  7407140.653336 
-319793.291010  7407145.972425 
-319798.857216  7407148.052069 
-319806.443748  7407151.661450 
-319814.244682  7407159.060183 
-319822.985687  7407173.037789 
-319833.425415  7407195.363965 
-319842.009741  7407224.738933 
-319849.843660  7407252.844119 
-319857.751795  7407273.880515 
-319866.220674  7407290.117734 
-319871.160166  7407303.305475 
-319877.608718  7407318.512870 
-319885.887934  7407328.441170 
-319892.625104  7407340.379125 
-319903.073079  7407361.445516 
-319908.598053  7407367.804427 
-319923.028957  7407372.493624 
-319937.971127  7407377.702732 
-319954.166724  7407384.421581 
-319969.562436  7407394.679824 
-319987.267094  7407402.688452 
-320007.660022  7407420.305434 
-320018.759448  7407428.504030 
-320031.780247  7407446.560937 
-320041.213934  7407467.857289 
-320043.753774  7407491.623218 
-320043.852728  7407506.270709 
-320044.363995  7407530.256600 
-320045.015447  7407540.114912 
-320049.600351  7407562.881012 
-320052.494778  7407577.808455 
-320047.860396  7407588.506623 
-320043.687804  7407593.625746 
-320041.568522  7407601.434408 
-320042.830196  7407614.362194 
-320045.765854  7407630.589416 
-320051.736125  7407649.256217 
-320053.467833  7407653.315522 
-320058.522773  7407662.493949 
-320067.750305  7407672.392254 
-320077.390148  7407674.511891 
-320081.356585  7407683.640327 
-320084.490153  7407699.577597 
-320067.511164  7407719.354210 
-320054.168763  7407731.342156 
-320043.118814  7407742.590230 
-320037.725779  7407747.589373 
-320033.058412  7407756.377868 
-320032.200804  7407765.206356 
-320037.907196  7407778.144140 
-320045.271080  7407802.959889 
-320047.324391  7407825.206078 
-320051.488738  7407839.633607 
-320051.818587  7407856.300752 
-320047.802673  7407875.197515 
-320041.881879  7407882.466270 
-320026.535644  7407891.394741 
-320015.807298  7407897.103763 
-320004.542947  7407904.812442 
-319995.364892  7407906.992069 
-319990.417154  7407918.560088 
-319991.085098  7407926.898659 
-319994.532023  7407937.786794 
-319997.236786  7407946.405318 
-319996.074068  7407960.022985 
-319994.960827  7407969.101430 
-319996.882199  7407979.219697 
-320003.413213  7407987.118344 
-320015.840283  7407989.257978 
-320031.895694  7407984.878728 
-320043.630080  7407980.699444 
-320061.656340  7407982.899067 
-320076.441832  7408002.235755 
-320079.097118  7408015.643458 
-320083.277957  7408028.311288 
-320087.953570  7408043.008771 
-320092.835338  7408062.245476 
-320088.027786  7408083.661807 
-320079.583646  7408112.866805 
-320078.107570  7408132.543434 
-320075.608963  7408152.460023 
-320074.207103  7408164.567949 
-320066.884450  7408184.194587 
-320056.824049  7408197.972227 
-320046.846110  7408204.441119 
-320037.857719  7408212.939663 
-320026.337734  7408220.398385 
-320017.357589  7408228.387017 
-320012.121233  7408242.974518 
-320005.895329  7408255.292408 
-320000.708450  7408264.830775 
-319994.202174  7408279.408278 
-319985.716802  7408288.416734 
-319975.953265  7408298.415022 
-319966.997859  7408303.884085 
-319954.719221  7408311.332809 
-319952.863819  7408318.381602 
-319953.474040  7408333.289048 
-319957.968236  7408340.907743 
-319965.208427  7408352.845698 
-319971.978582  7408360.994303 
-319980.752571  7408372.952254 
-319987.992762  7408384.890209 
-319990.425400  7408395.518389 
-319992.058154  7408408.666137 
-319991.200546  7408417.494625 
-319991.348978  7408427.842852 
-319993.253857  7408439.990771 
-320002.761761  7408453.718420 
-320010.084414  7408458.587586 
-320021.183840  7408466.526226 
-320034.534488  7408477.514344 
-320036.958879  7408488.402479 
-320035.540528  7408502.520061 
-320031.862709  7408513.348206 
-320031.978156  7408526.725914 
-320031.524613  7408544.902801 
-320030.172232  7408553.221376 
-320024.713227  7408564.279482 
-320017.415313  7408581.626510 
-320007.091032  7408596.673933 
-319990.079058  7408618.970114 
-319978.996124  7408632.997711 
-319972.489848  7408647.325257 
-319967.773004  7408660.912929 
-319951.000171  7408684.478893 
-319929.271353  7408720.372744 
-319910.107113  7408754.516896 
-319894.546476  7408783.401948 
-319884.403613  7408805.268203 
-319867.606041  7408831.103777 
-319856.465383  7408851.190336 
-319848.153183  7408868.277410 
-319836.740399  7408890.133666 
-319819.060481  7408903.331405 
-319805.495431  7408912.289871 
-319795.476261  7408922.288158 
-319789.802855  7408929.806870 
-319782.133860  7408934.026147 
-319773.697966  7408938.735341 
-319757.197259  7408936.805671 
-319746.031862  7408935.175950 
-319727.741723  7408934.736026 
-319717.326733  7408934.636043 
-319704.091533  7408936.525719 
-319686.477585  7408943.164582 
-319675.485359  7408949.613477 
-319666.967003  7408961.651415 
-319658.613571  7408982.277882 
-319654.655380  7408996.375468 
-319646.920416  7409006.393752 
-319638.979296  7409012.882640 
-319629.009603  7409018.081749 
-319617.819468  7409018.981595 
-319611.453378  7409019.931433 
-319603.330841  7409018.831621 
-319597.162660  7409001.354615 
-319588.594827  7408994.955711 
-319574.180416  7408988.246860 
-319563.048004  7408983.587658 
-319540.931614  7408983.367696 
-319527.201640  7408984.237547 
-319507.328224  7408988.836759 
-319488.015552  7408989.146706 
-319473.032150  7408987.736947 
-319463.144920  7408985.117396 
-319450.528187  7408977.158759 
-319442.933409  7408974.309247 
-319435.858143  7408969.939996 
-319421.386008  7408969.040150 
-319393.142668  7408972.289593 
-319381.424774  7408974.449223 
-319372.032317  7408973.599369 
-319361.196770  7408965.150816 
-319349.066565  7408958.212005 
-319339.740078  7408951.303188 
-319332.392687  7408948.703633 
-319324.286642  7408946.603993 
-319305.460497  7408948.693635 
-319301.007533  7408960.761568 
-319293.297307  7408968.770196 
-319285.603574  7408975.758999 
-319270.834575  7408978.138591 
-319260.394847  7408979.798307 
-319244.867195  7408982.417858 
-319237.725959  7408984.617482 
-319222.643603  7408992.546123 
-319205.623383  7408992.376153 
-319188.339284  7408992.206182 
-319166.998039  7408991.736262 
-319142.094422  7408991.496303 
-319120.481052  7408992.286168 
-319103.188706  7408993.375981 
-319090.679174  7408998.805051 
-319078.128411  7409007.763517 
-319071.688105  7409015.782143 
-319056.012020  7409032.289316 
-319041.152313  7409043.757351 
-319032.180414  7409050.486199 
-319016.974365  7409070.532765 
-319006.163556  7409083.550535 
-319002.395029  7409103.207168 
-318996.820577  7409125.373371 
-318995.591888  7409145.559914 
-318994.066336  7409169.275851 
-318990.099899  7409184.133306 
-318987.947633  7409195.221407 
-318980.938337  7409209.558951 
-318976.741005  7409215.257975 
-318969.484322  7409221.636882 
-318963.876885  7409223.016646 
-318958.022062  7409223.636540 
-318945.999057  7409217.557581 
-318937.653872  7409216.347788 
-318927.807873  7409214.608086 
-318914.886029  7409214.058180 
-318906.738753  7409215.377954 
-318898.533754  7409218.957341 
-318891.763598  7409226.366072 
-318887.087986  7409241.373502 
-318883.236996  7409253.621404 
-318882.445358  7409265.199420 
-318882.948378  7409276.047562 
-318881.530026  7409292.644719 
-318876.392624  7409305.622496 
-318873.514690  7409319.920047 
-318870.504816  7409328.918506 
-318871.774735  7409339.276732 
-318879.138619  7409359.863205 
-318884.078111  7409375.850467 
-318888.753724  7409392.087686 
-318893.165458  7409409.064778 
-318895.515633  7409427.011703 
-318897.428759  7409442.179105 
-318901.898216  7409456.646627 
-318907.217035  7409467.604750 
-318910.721683  7409479.782664 
-318912.074064  7409486.871450 
-318913.022381  7409499.989203 
-318907.588115  7409514.976636 
-318896.348503  7409528.574307 
-318884.572885  7409533.333492 
-318868.913293  7409540.782216 
-318852.833144  7409545.191460 
-318826.857517  7409549.370744 
-318798.094664  7409553.729998 
-318774.403244  7409557.969272 
-318758.826114  7409562.388515 
-318747.545271  7409567.157698 
-318739.513442  7409574.276478 
-318735.530513  7409581.745199 
-318732.875226  7409586.724346 
-318730.277664  7409609.840387 
-318731.374412  7409627.507360 
-318735.167678  7409649.013677 
-318742.333653  7409667.070584 
-318748.064783  7409681.818057 
-318757.877798  7409695.655687 
-318763.188370  7409706.613810 
-318770.585239  7409715.352313 
-318773.355973  7409726.500404 
-318771.574787  7409737.298554 
-318766.833204  7409744.747278 
-318755.486391  7409752.285987 
-318733.881266  7409764.633872 
-318718.518539  7409770.822812 
-318699.494485  7409781.211032 
-318674.153818  7409801.277595 
-318666.534301  7409812.185727 
-318661.504100  7409820.884237 
-318660.968095  7409842.790484 
-318661.462869  7409853.888583 
-318661.924658  7409876.574697 
-318656.374945  7409896.351310 
-318645.828016  7409912.988460 
-318640.220579  7409924.446497 
-318629.269584  7409936.784384 
-318613.387344  7409953.801469 
-318597.480365  7409971.568426 
-318575.932965  7409992.224888 
-318557.362453  7410004.892718 
-318545.809484  7410010.671728 
-318529.984967  7410016.670700 
-318516.452903  7410018.550378 
-318494.229311  7410025.079260 
-318475.815478  7410031.198212 
-318458.399439  7410038.346987 
-318446.788746  7410046.395609 
-318438.707440  7410055.274088 
-318429.059351  7410066.132228 
-318422.816954  7410093.447549 
-318410.678502  7410113.074187 
-318398.449342  7410125.632036 
-318385.395559  7410140.949412 
-318378.345032  7410159.686203 
-318368.985560  7410179.622788 
-318362.388576  7410200.629190 
-318347.702039  7410220.695753 
-318332.256849  7410240.492362 
-318324.777518  7410255.939716 
-318318.625830  7410269.147453 
-318310.387845  7410284.574811 
-318301.259268  7410305.521223 
-318295.519891  7410311.940123 
-318289.442419  7410322.128378 
-318278.870752  7410329.437126 
-318258.865396  7410338.295609 
-318246.388849  7410340.515229 
-318231.059106  7410344.944470 
-318219.778263  7410349.973608 
-318211.144459  7410360.861743 
-318205.545269  7410372.059825 
-318199.583244  7410387.797130 
-318196.952697  7410402.354636 
-318192.178129  7410431.969563 
-318193.670697  7410443.347614 
-318198.544219  7410451.776171 
-318203.656882  7410460.454684 
-318205.611239  7410463.524158 
-318209.223088  7410471.672762 
-318209.536445  7410479.491423 
-318204.530983  7410487.190105 
-318200.943872  7410499.198048 
-318201.809726  7410505.267008 
-318206.526570  7410509.406299 
-318211.342369  7410520.104467 
-318220.751318  7410529.642833 
-318228.115202  7410539.651118 
-318230.572579  7410542.730591 
-318231.990931  7410547.039853 
-318233.516483  7410557.408077 
-318228.478036  7410566.616499 
-318219.102072  7410576.724768 
-318211.004274  7410586.363117 
-318205.809148  7410591.282274 
-318200.671747  7410593.931821 
-318186.372783  7410597.881144 
-318174.432241  7410598.860976 
-318157.420267  7410599.720829 
-318146.502257  7410599.970786 
-318136.326409  7410601.490526 
-318128.698645  7410602.070427 
-318121.013159  7410605.159897 
-318120.172043  7410608.419339 
-318120.081334  7410612.198692 
-318123.495274  7410618.067686 
-318126.414440  7410623.176811 
-318133.638138  7410628.635876 
-318138.643600  7410631.275424 
-318141.059745  7410636.374551 
-318141.307132  7410646.962737 
-318139.575424  7410655.491276 
-318137.464389  7410658.970680 
-318133.151610  7410669.448885 
-318128.723384  7410674.128084 
-318122.777852  7410679.027245 
-318111.348576  7410679.517161 
-318098.220577  7410676.937602 
-318083.707211  7410668.788998 
-318065.590242  7410663.069978 
-318057.335765  7410658.340788 
-318044.735525  7410655.021357 
-318037.586043  7410656.871040 
-318029.447013  7410668.269087 
-318019.980341  7410682.156708 
-318010.241542  7410696.544244 
-317996.618769  7410714.621148 
-317984.364870  7410728.438781 
-317967.122002  7410749.205224 
-317954.274375  7410766.282299 
-317940.165074  7410783.339377 
-317929.453221  7410796.187176 
-317915.706754  7410808.974986 
-317901.630438  7410813.934136 
-317884.280369  7410818.313386 
-317868.307420  7410818.183408 
-317856.944115  7410815.903799 
-317831.694156  7410804.575739 
-317835.998689  7410790.058226 
-317850.322391  7410755.864083 
-317857.974893  7410744.376051 
-317860.325069  7410736.567388 
-317861.644466  7410721.270009 
-317860.366300  7410703.323083 
-317857.521351  7410690.205330 
-317846.059090  7410675.127912 
-317832.065237  7410652.911718 
-317818.714589  7410638.924114 
-317810.550821  7410630.975475 
-317795.212832  7410625.556404 
-317782.472406  7410622.786878 
-317770.828728  7410622.646902 
-317748.646367  7410624.236630 
-317707.225551  7410632.315246 
-317669.226920  7410637.074431 
-317647.069298  7410636.804477 
-317624.590074  7410632.035294 
-317608.905743  7410624.746542 
-317594.779950  7410612.618620 
-317584.785518  7410600.910625 
-317566.346947  7410573.045398 
-317557.515233  7410557.987977 
-317546.457038  7410540.670944 
-317529.750175  7410525.143603 
-317520.786522  7410520.924326 
-317507.666769  7410518.894674 
-317490.696027  7410523.913814 
-317463.491712  7410536.651632 
-317450.611099  7410545.830060 
-317419.836167  7410573.845261 
-317395.534525  7410594.831666 
-317363.629859  7410622.826871 
-317341.274327  7410638.614167 
-317333.333207  7410642.623480 
-317326.183725  7410643.663302 
-317319.430062  7410643.203381 
-317316.477912  7410638.684155 
-317313.204158  7410630.425570 
-317310.689058  7410621.057174 
-317306.722621  7410606.429680 
-317298.542360  7410599.610848 
-317286.519356  7410599.460874 
-317272.187407  7410603.760137 
-317251.646046  7410624.426597 
-317237.165665  7410640.683812 
-317228.111304  7410643.563319 
-317204.799210  7410645.512985 
-317180.662493  7410652.691756 
-317170.041348  7410660.770372 
-317169.175494  7410670.478709 
-317172.094659  7410677.237551 
-317177.982468  7410687.025874 
-317187.688281  7410692.374958 
-317206.456702  7410693.354790 
-317267.305638  7410694.854533 
-317278.512266  7410699.473742 
-317285.191713  7410706.282576 
-317291.071275  7410716.820771 
-317289.397290  7410730.988344 
-317284.771155  7410740.646690 
-317271.816326  7410754.684285 
-317262.728980  7410760.543282 
-317252.924212  7410763.412790 
-317240.942439  7410760.273328 
-317227.459852  7410757.123867 
-317216.211993  7410754.734277 
-317204.156004  7410757.573790 
-317195.786080  7410766.442271 
-317175.186996  7410791.587964 
-317162.298137  7410800.396455 
-317142.713339  7410804.635729 
-317111.946653  7410801.256308 
-317068.472525  7410792.507806 
-317040.732205  7410787.678634 
-317014.484453  7410783.609331 
-316998.709414  7410783.419363 
-316975.372581  7410786.868772 
-316957.280351  7410791.118044 
-316935.477317  7410792.347834 
-316920.436192  7410793.467642 
-316909.881017  7410796.327152 
-316904.529213  7410803.725885 
-316904.050932  7410811.944477 
-316903.894254  7410824.262367 
-316908.561620  7410842.259284 
-316914.375213  7410857.646649 
-316919.520861  7410867.424974 
-316924.732479  7410870.844388 
-316932.228302  7410872.434116 
-316936.755483  7410870.994362 
-316947.384874  7410861.795938 
-316954.262231  7410852.907460 
-316959.935637  7410849.618024 
-316965.584305  7410848.568204 
-316973.830536  7410850.167930 
-316977.904174  7410855.077089 
-316980.072932  7410861.825933 
-316979.891515  7410876.393438 
-316977.063058  7410892.420692 
-316972.049350  7410903.188848 
-316965.955386  7410909.467772 
-316955.367225  7410914.936835 
-316938.734578  7410923.325398 
-316918.366389  7410929.794290 
-316911.538510  7410934.943408 
-316903.547912  7410943.431954 
-316898.558942  7410951.590557 
-316892.300053  7410971.307180 
-316879.369964  7411014.479785 
-316872.789472  7411030.087111 
-316864.683427  7411047.174184 
-316847.531267  7411066.760829 
-316833.075625  7411081.148365 
-316819.865163  7411086.217497 
-316799.917531  7411089.326964 
-316776.588945  7411091.656565 
-316756.245494  7411096.635712 
-316744.544093  7411100.974969 
-316734.376490  7411102.334736 
-316723.128632  7411100.705015 
-316714.560798  7411094.995993 
-316704.121070  7411088.137168 
-316668.802464  7411058.562234 
-316655.031259  7411047.934054 
-316642.340310  7411041.425169 
-316618.368518  7411035.516181 
-316599.624835  7411031.926796 
-316577.079641  7411032.016781 
-316565.064883  7411031.866806 
-316554.955004  7411029.127276 
-316546.395416  7411022.298445 
-316536.780312  7411010.220514 
-316527.602257  7410992.553540 
-316519.100393  7410981.615414 
-316510.549052  7410974.036712 
-316500.109324  7410967.927759 
-316479.163898  7410960.189084 
-316464.551577  7410957.399562 
-316452.965623  7410952.400418 
-316445.519277  7410947.071331 
-316442.591865  7410940.312489 
-316442.641342  7410936.203193 
-316444.603945  7410929.874277 
-316447.292217  7410925.055102 
-316455.975497  7410921.425724 
-316464.634040  7410920.415897 
-316476.632305  7410922.055616 
-316507.374253  7410927.674653 
-316531.750111  7410931.334027 
-316542.264055  7410931.843939 
-316550.576255  7410927.834626 
-316553.643853  7410922.645515 
-316556.398094  7410912.967173 
-316556.158954  7410902.129029 
-316552.909939  7410891.630827 
-316542.866030  7410883.282258 
-316529.432920  7410875.643566 
-316515.216418  7410870.984364 
-316506.986680  7410867.894893 
-316499.515595  7410864.815421 
-316498.064259  7410860.316191 
-316499.631042  7410855.477020 
-316507.456715  7410830.171355 
-316510.252188  7410817.133588 
-316509.237901  7410807.775191 
-316504.446841  7410800.616417 
-316495.854269  7410796.407138 
-316485.719651  7410795.907224 
-316476.690029  7410797.286988 
-316472.888517  7410800.596421 
-316470.200245  7410805.045659 
-316466.679105  7410816.213746 
-316463.520798  7410828.871578 
-316459.620331  7410840.409601 
-316451.143206  7410857.116739 
-316439.334604  7410870.044525 
-316431.022404  7410873.673903 
-316423.872922  7410875.073664 
-316417.877912  7410873.513931 
-316412.649802  7410871.204326 
-316410.439812  7410867.434972 
-316409.037953  7410859.206381 
-316408.411239  7410849.478048 
-316410.019254  7410840.909516 
-316414.670128  7410829.391489 
-316422.025766  7410812.294417 
-316429.356665  7410796.327152 
-316433.619966  7410785.918935 
-316435.599062  7410777.720339 
-316434.230187  7410767.242134 
-316428.688720  7410759.703425 
-316419.749806  7410753.244532 
-316410.019254  7410750.135064 
-316395.357456  7410751.444840 
-316379.895773  7410756.104042 
-316350.423745  7410769.561737 
-316342.095052  7410774.310923 
-316336.050565  7410777.230423 
-316329.659736  7410777.520374 
-316324.431626  7410774.840833 
-316316.581215  7410771.751362 
-316308.706064  7410770.161634 
-316303.799557  7410771.971324 
-316300.715467  7410778.280243 
-316299.107452  7410787.228711 
-316297.095372  7410797.666923 
-316292.848563  7410806.575397 
-316290.152045  7410812.524378 
-316279.934966  7410817.993441 
-316266.691519  7410825.302189 
-316256.870258  7410830.031379 
-316241.045742  7410833.570773 
-316229.377325  7410834.920541 
-316219.630281  7410833.310817 
-316211.425281  7410828.351667 
-316202.865694  7410821.892773 
-316191.741529  7410810.544717 
-316185.861966  7410799.636585 
-316179.652555  7410785.369029 
-316178.275434  7410775.260761 
-316176.997268  7410757.683771 
-316174.869741  7410747.205566 
-316170.812595  7410741.176599 
-316164.091917  7410738.097126 
-316156.950682  7410738.017140 
-316148.267401  7410741.636520 
-316137.984351  7410752.344686 
-316126.167503  7410766.392280 
-316113.484800  7410789.398339 
-316107.349604  7410799.036688 
-316095.565741  7410810.094794 
-316065.244351  7410831.381148 
-316045.873955  7410848.328245 
-316038.229699  7410858.316534 
-316032.440845  7410870.944371 
-316029.966976  7410888.101432 
-316029.777313  7410903.408810 
-316034.131322  7410916.166625 
-316042.583709  7410931.214047 
-316051.093819  7410941.412300 
-316059.298818  7410946.371451 
-316074.645054  7410951.040651 
-316082.116139  7410954.500059 
-316089.562485  7410960.189084 
-316093.545414  7410972.197027 
-316097.915917  7410983.085162 
-316103.053318  7410992.493551 
-316110.854252  7411000.062254 
-316118.308845  7411005.011406 
-316128.781558  7411008.500809 
-316149.751722  7411014.369803 
-316162.112822  7411016.759394 
-316181.606911  7411020.368776 
-316195.831659  7411024.658041 
-316202.511106  7411031.456877 
-316204.663372  7411039.705464 
-316204.300538  7411068.840473 
-316203.673825  7411088.627084 
-316204.597402  7411105.084265 
-316207.376382  7411123.421124 
-316208.671040  7411139.878305 
-316208.868950  7411154.075873 
-316206.461051  7411166.743703 
-316197.217026  7411184.560651 
-316186.092861  7411203.097476 
-316168.907716  7411225.303672 
-316148.679712  7411250.449365 
-316119.380855  7411280.344244 
-316085.917651  7411312.048814 
-316041.519945  7411347.362765 
-316000.833043  7411386.456068 
-315988.991456  7411401.993407 
-315977.092145  7411422.019977 
-315964.326980  7411451.374948 
-315953.367740  7411486.348958 
-315943.686665  7411509.764947 
-315936.718600  7411526.112147 
-315921.834154  7411544.608978 
-315913.101395  7411551.967718 
-315903.280135  7411556.326971 
-315893.096040  7411559.196480 
-315883.703583  7411559.446437 
-315872.101136  7411555.937038 
-315861.249097  7411552.447636 
-315852.986374  7411551.597781 
-315843.981490  7411551.107865 
-315836.427943  7411553.997370 
-315830.325732  7411561.026166 
-315824.932697  7411571.794322 
-315820.685888  7411581.072732 
-315815.152668  7411602.669033 
-315812.381934  7411613.847118 
-315807.054869  7411619.386170 
-315802.131869  7411622.685604 
-315797.208870  7411625.615103 
-315787.437086  7411625.865060 
-315778.836268  7411622.765591 
-315774.746137  7411618.976240 
-315771.793987  7411614.836949 
-315771.117796  7411608.847975 
-315773.443233  7411602.898994 
-315776.255198  7411588.361484 
-315775.974826  7411580.892763 
-315774.539982  7411575.273726 
-315771.216751  7411570.744501 
-315767.093635  7411569.944638 
-315758.839159  7411569.464721 
-315748.292230  7411571.574359 
-315732.071894  7411576.233561 
-315715.076413  7411583.862255 
-315701.123790  7411587.801580 
-315686.849565  7411587.621611 
-315675.230626  7411585.232020 
-315666.671039  7411578.403190 
-315651.803085  7411565.885334 
-315644.793789  7411555.337141 
-315641.544774  7411544.469002 
-315642.468352  7411531.031304 
-315647.828402  7411522.882700 
-315656.528175  7411518.133513 
-315683.971631  7411516.983710 
-315700.884650  7411516.443803 
-315711.439825  7411513.964227 
-315737.901979  7411500.846474 
-315744.729858  7411495.327420 
-315766.005133  7411476.910574 
-315781.277152  7411457.673869 
-315786.356830  7411442.046546 
-315783.454157  7411433.418024 
-315771.950665  7411422.069968 
-315746.106978  7411415.401110 
-315705.601493  7411409.662093 
-315691.368499  7411406.122700 
-315629.200167  7411390.405392 
-315606.704449  7411386.386080 
-315589.115239  7411380.937014 
-315575.649145  7411376.287810 
-315557.622885  7411375.307978 
-315540.322293  7411376.957695 
-315522.230063  7411381.586902 
-315504.137833  7411386.226108 
-315493.986723  7411386.846002 
-315484.231432  7411385.226279 
-315473.395885  7411380.607070 
-315460.028745  7411368.109211 
-315435.957998  7411339.794061 
-315413.025230  7411311.108975 
-315397.093513  7411293.352016 
-315385.573528  7411282.753832 
-315371.752846  7411276.604885 
-315350.378616  7411272.975507 
-315328.196255  7411274.565234 
-315313.130392  7411277.364755 
-315302.616448  7411277.224779 
-315297.767664  7411274.175301 
-315292.918881  7411271.135822 
-315290.387288  7411263.627108 
-315292.374630  7411255.058576 
-315298.105760  7411246.909971 
-315310.194734  7411241.830841 
-315336.549687  7411237.311615 
-315348.226350  7411235.211975 
-315355.796389  7411230.822727 
-315358.138319  7411223.384001 
-315355.606726  7411215.885286 
-315344.828903  7411206.406909 
-315331.775120  7411198.768218 
-315297.701695  7411189.749762 
-315278.224098  7411184.650636 
-315269.994360  7411181.561165 
-315266.300048  7411176.652006 
-315267.512244  7411170.323090 
-315272.468229  7411164.034167 
-315284.590188  7411156.715421 
-315294.427941  7411150.856424 
-315302.369061  7411146.477175 
-315305.815986  7411141.288063 
-315307.778588  7411134.589211 
-315306.368483  7411127.470430 
-315294.098092  7411117.232184 
-315278.092158  7411105.454201 
-315263.174727  7411096.295770 
-315250.063220  7411093.146310 
-315225.308036  7411089.846875 
-315202.787580  7411088.067180 
-315189.313239  7411084.167848 
-315179.566194  7411082.548125 
-315153.227734  7411085.577606 
-315134.797408  7411087.217325 
-315122.774404  7411087.067351 
-315111.155465  7411085.057695 
-315099.181938  7411081.168361 
-315077.840693  7411074.919432 
-315058.338358  7411072.059922 
-315048.929408  7411073.439685 
-315032.709073  7411078.468824 
-315008.514632  7411090.866700 
-314983.198704  7411102.124772 
-314959.350605  7411116.022391 
-314936.228174  7411132.539562 
-314913.880889  7411146.837113 
-314894.997021  7411154.435811 
-314879.527092  7411159.844885 
-314855.060526  7411163.274297 
-314831.377351  7411164.474092 
-314823.477463  7411165.123981 
-314812.988257  7411162.754386 
-314802.944348  7411154.775753 
-314787.688822  7411143.007769 
-314775.047350  7411132.389588 
-314768.887416  7411119.261836 
-314762.224461  7411101.114945 
-314750.687985  7411072.329875 
-314742.078920  7411060.391920 
-314731.540237  7411051.543436 
-314719.723389  7411045.174527 
-314695.364023  7411040.505327 
-314676.620341  7411037.155900 
-314649.762368  7411031.836811 
-314615.994053  7411027.677524 
-314583.479166  7411024.158127 
-314562.187398  7411024.508067 
-314539.592726  7411028.587368 
-314515.084929  7411035.126248 
-314495.557855  7411044.844583 
-314477.902675  7411053.963021 
-314459.035299  7411060.571889 
-314437.685808  7411065.281083 
-314417.614483  7411068.140593 
-314403.150594  7411072.939771 
-314389.940132  7411077.758945 
-314369.703882  7411093.686217 
-314355.149285  7411105.964114 
-314343.167512  7411112.652968 
-314333.123603  7411114.402669 
-314322.502458  7411112.393013 
-314315.047866  7411107.943775 
-314308.920916  7411097.285601 
-314299.116148  7411079.728608 
-314297.343209  7411071.609999 
-314292.395470  7411066.560864 
-314284.891400  7411065.850985 
-314278.055275  7411062.021641 
-314274.369210  7411056.372609 
-314271.318105  7411049.483789 
-314266.419844  7411040.705292 
-314259.591965  7411036.266053 
-314242.736669  7411032.316729 
-314230.210645  7411032.156757 
-314222.648851  7411035.796133 
-314207.517018  7411044.324672 
-314193.663351  7411050.373636 
-314183.602949  7411053.983018 
-314175.430935  7411056.372609 
-314170.417226  7411056.312619 
-314164.818036  7411053.753057 
-314154.271107  7411045.524467 
-314135.725334  7411026.607707 
-314123.924978  7411018.989012 
-314113.312079  7411016.369461 
-314099.573859  7411013.699918 
-314083.939006  7411012.260165 
-314065.830283  7411007.670951 
-314047.762792  7411000.592163 
-314034.709009  7410992.953472 
-314019.882286  7410977.206169 
-314015.025256  7410964.688313 
-314012.642095  7410955.319918 
-314016.575547  7410941.672256 
-314025.514462  7410927.464689 
-314033.166964  7410916.976486 
-314035.797511  7410907.048187 
-314036.605642  7410892.110745 
-314032.317602  7410884.592033 
-314025.497969  7410879.522901 
-314014.835593  7410880.632711 
-313979.088183  7410885.161936 
-313962.801877  7410885.581864 
-313945.921843  7410883.502220 
-313938.442512  7410880.912663 
-313933.470035  7410877.733208 
-313929.759231  7410873.953855 
-313927.953307  7410868.324820 
-313929.924156  7410860.886094 
-313938.813592  7410851.027782 
-313955.273069  7410836.920199 
-313959.107566  7410831.361151 
-313959.800249  7410825.772108 
-313956.147169  7410817.623504 
-313948.676084  7410814.424052 
-313933.041231  7410812.354407 
-313917.950629  7410817.763480 
-313899.066761  7410825.002240 
-313885.831561  7410832.300990 
-313872.538637  7410843.349098 
-313857.258371  7410863.695613 
-313841.986352  7410882.812338 
-313833.022700  7410898.259692 
-313821.626409  7410908.078010 
-313811.549515  7410912.937178 
-313796.458913  7410917.726358 
-313782.671215  7410918.796174 
-313759.524046  7410916.636544 
-313740.128911  7410915.766693 
-313735.106957  7410916.326597 
-313735.717178  7410910.757551 
-313734.859570  7410887.261576 
-313730.324143  7410871.024357 
-313725.120771  7410863.615626 
-313716.445737  7410852.097599 
-313704.859783  7410846.838500 
-313698.130859  7410839.909687 
-313689.670226  7410830.411314 
-313688.598216  7410819.283220 
-313685.002859  7410807.105306 
-313678.587292  7410796.897055 
-313675.585664  7410794.317496 
-313663.941986  7410792.847748 
-313647.754636  7410790.028231 
-313638.230239  7410783.039428 
-313633.562873  7410774.380911 
-313630.462290  7410748.325374 
-313636.704686  7410739.596870 
-313641.083435  7410735.887505 
-313648.768922  7410731.228303 
-313656.264746  7410723.289663 
-313659.744655  7410713.001425 
-313660.165213  7410703.163110 
-313643.276932  7410682.416664 
-313637.817928  7410675.497849 
-313629.093416  7410666.259432 
-313614.827437  7410655.151334 
-313604.288754  7410648.642449 
-313592.513136  7410640.103912 
-313574.379675  7410632.205265 
-313566.958068  7410621.467104 
-313559.289073  7410609.979072 
-313555.240174  7410594.751680 
-313547.884536  7410580.234167 
-313543.035753  7410567.026429 
-313535.407989  7410539.121209 
-313532.596025  7410510.796061 
-313531.136442  7410492.599178 
-313531.787894  7410469.883069 
-313534.649336  7410451.006302 
-313540.504160  7410435.209008 
-313551.339707  7410410.163299 
-313563.527636  7410394.725943 
-313572.623228  7410382.518034 
-313584.539031  7410368.350461 
-313601.419066  7410272.726840 
-313598.079342  7410260.548926 
-313596.248679  7410248.650964 
-313596.405357  7410240.072434 
-313592.653322  7410222.085515 
-313587.705584  7410214.676784 
-313575.921720  7410206.888118 
-313567.650751  7410201.189094 
-313553.821822  7410193.870348 
-313541.287552  7410185.321812 
-313537.081974  7410179.182863 
-313522.321221  7410167.054941 
-313515.831438  7410161.135955 
-313503.025041  7410153.327292 
-313494.259298  7410146.608443 
-313488.585892  7410137.420017 
-313475.581586  7410126.831831 
-313468.102255  7410118.873194 
-313462.635004  7410112.464292 
-313453.729075  7410099.186566 
-313451.345914  7410090.308087 
-313445.672507  7410081.369618 
-313435.933709  7410072.101205 
-313428.660534  7410067.432005 
-313421.205941  7410058.213584 
-313417.066333  7410048.545240 
-313416.052047  7410033.887751 
-313421.271911  7410025.139250 
-313426.458790  7410018.920315 
-313431.678654  7410010.431769 
-313442.720357  7410002.553118 
-313449.218387  7409993.834612 
-313464.391451  7409981.996640 
-313479.745932  7409974.187977 
-313491.826660  7409965.069539 
-313499.594610  7409955.871115 
-313512.368021  7409921.766956 
-313514.891367  7409907.929327 
-313517.802287  7409900.910529 
-313523.112859  7409887.122891 
-313529.124361  7409877.134601 
-313543.035753  7409864.766720 
-313554.432043  7409851.089063 
-313564.154349  7409831.822363 
-313570.668871  7409807.456537 
-313578.733685  7409795.728546 
-313584.423584  7409789.529607 
-313593.634624  7409785.150358 
-313605.319533  7409784.350495 
-313610.390965  7409784.180524 
-313626.166004  7409781.690950 
-313634.313280  7409779.821270 
-313646.575425  7409775.242055 
-313656.297731  7409770.112933 
-313666.044775  7409764.233940 
-313679.115051  7409756.385285 
-313695.797175  7409745.577136 
-313710.368265  7409739.028258 
-313727.009158  7409730.239763 
-313735.197665  7409726.350429 
-313741.283384  7409726.460411 
-313754.897910  7409731.499547 
-313760.678518  7409734.379054 
-313772.297457  7409737.618499 
-313778.185266  7409734.189087 
-313787.148918  7409729.549881 
-313799.707928  7409722.201140 
-313804.218616  7409710.923072 
-313806.362636  7409704.144233 
-313806.065772  7409692.026309 
-313805.315365  7409676.868905 
-313802.932204  7409667.990426 
-313802.041611  7409660.651683 
-313798.405023  7409650.743380 
-313795.040561  7409640.335163 
-313792.937772  7409629.696985 
-313792.847064  7409620.348587 
-313794.397355  7409603.971392 
-313796.269250  7409584.064802 
-313799.122445  7409580.075485 
-313810.873324  7409575.486271 
-313822.335585  7409573.166668 
-313832.808298  7409568.817413 
-313840.864865  7409557.599335 
-313844.905518  7409544.041657 
-313852.838392  7409525.504832 
-313858.495306  7409506.418102 
-313864.836657  7409491.890590 
-313870.905883  7409478.372906 
-313879.432486  7409469.434437 
-313888.758972  7409458.496310 
-313905.779193  7409442.399068 
-313923.170493  7409434.120486 
-313941.130783  7409422.582462 
-313954.959712  7409415.263716 
-313969.357631  7409404.405576 
-313977.628600  7409395.467107 
-313985.495504  7409380.719633 
-313990.855554  7409364.152471 
-313995.597137  7409353.894228 
-314001.328267  7409330.768189 
-314006.127573  7409317.480465 
-314012.238030  7409301.433214 
-314017.680542  7409280.326829 
-314020.508999  7409263.459718 
-314022.669512  7409241.283517 
-314027.171954  7409215.367956 
-314028.557321  7409194.191583 
-314033.851401  7409167.026237 
-314039.887642  7409134.261849 
-314044.587993  7409122.963784 
-314051.283932  7409114.215283 
-314059.761057  7409105.736735 
-314073.350845  7409092.778955 
-314084.186393  7409077.771525 
-314090.412297  7409065.993543 
-314098.773975  7409045.407069 
-314098.402894  7409034.558927 
-314097.586517  7409017.901780 
-314093.438663  7409004.744034 
-314084.573965  7408982.947768 
-314063.282198  7408961.511439 
-314049.568716  7408942.444705 
-314041.569873  7408933.266278 
-314036.407732  7408919.338663 
-314034.832702  7408903.181431 
-314036.778813  7408889.333803 
-314042.064646  7408871.486860 
-314044.472546  7408861.168627 
-314043.351058  7408849.050703 
-314038.683692  7408836.642828 
-314030.660109  7408828.984140 
-314018.612366  7408819.255807 
-314006.515146  7408813.066867 
-313994.690051  7408805.358187 
-313975.764952  7408797.829477 
-313948.486421  7408789.440914 
-313931.045643  7408785.201640 
-313906.546092  7408777.352984 
-313877.486375  7408769.194382 
-313856.252331  7408764.155245 
-313833.533966  7408755.826671 
-313820.191565  7408747.598081 
-313806.387375  7408736.589966 
-313794.083998  7408726.111761 
-313785.631612  7408712.894025 
-313782.275396  7408696.466839 
-313785.194562  7408685.908648 
-313790.463903  7408669.821403 
-313792.154380  7408655.973775 
-313790.290732  7408642.336111 
-313785.384225  7408628.658454 
-313780.700366  7408617.760321 
-313772.734507  7408605.312453 
-313767.308487  7408592.884582 
-313757.140885  7408574.107798 
-313749.983157  7408557.880578 
-313741.407077  7408554.251199 
-313738.388957  7408531.765051 
-313738.776529  7408499.740537 
-313743.460388  7408468.525883 
-313748.037046  7408446.889590 
-313750.618117  7408422.203818 
-313754.246458  7408395.008476 
-313761.593850  7408374.661961 
-313772.305703  7408348.306476 
-313784.270984  7408323.470730 
-313793.762395  7408293.315895 
-313798.941028  7408263.870939 
-313798.033943  7408233.846082 
-313802.907465  7408208.680393 
-313814.336741  7408185.864301 
-313824.421881  7408169.837046 
-313843.907724  7408152.160074 
-313860.103321  7408133.683239 
-313874.583702  7408110.397228 
-313888.833189  7408085.341519 
-313904.839122  7408061.315635 
-313919.261780  7408042.818803 
-313940.512316  7408026.171655 
-313958.654023  7408014.783605 
-313971.476912  7408002.565698 
-313981.248695  7407991.587579 
-313987.029303  7407974.500505 
-313991.820363  7407955.643735 
-313995.638368  7407933.997443 
-314007.166598  7407924.039149 
-314017.993899  7407909.291675 
-314032.870099  7407895.334066 
-314048.241073  7407882.146325 
-314065.376740  7407869.988407 
-314085.307880  7407857.110613 
-314098.048306  7407852.211452 
-314115.357144  7407846.612412 
-314133.391651  7407843.542937 
-314148.135911  7407840.683427 
-314159.062167  7407838.793751 
-314170.343010  7407828.335542 
-314181.665085  7407814.587897 
-314194.727114  7407803.649771 
-314209.289958  7407794.231384 
-314227.687298  7407782.593377 
-314247.610192  7407770.465455 
-314265.034477  7407755.787969 
-314274.501150  7407748.579204 
-314289.278395  7407742.700211 
-314301.977590  7407740.580574 
-314321.760297  7407740.550579 
-314332.397935  7407741.180471 
-314344.577618  7407740.820533 
-314359.297139  7407739.220807 
-314374.090877  7407732.082030 
-314387.210630  7407716.594682 
-314395.555816  7407697.277991 
-314401.097283  7407679.681005 
-314415.767327  7407661.694086 
-314432.004155  7407639.937813 
-314448.249229  7407617.681625 
-314460.371188  7407600.424581 
-314485.802564  7407572.979282 
-314502.154839  7407563.080978 
-314519.241029  7407554.952370 
-314529.227214  7407546.743776 
-314533.399807  7407536.955453 
-314535.131515  7407520.078344 
-314532.698877  7407511.219861 
-314527.528491  7407498.552031 
-314519.941959  7407476.015891 
-314519.142074  7407458.858830 
-314524.122798  7407445.051195 
-314533.721410  7407427.254244 
-314544.878560  7407405.947893 
-314552.918635  7407391.160426 
-314560.975202  7407375.113175 
-314565.510629  7407356.746321 
-314575.422598  7407333.660276 
-314584.996472  7407317.882978 
-314595.361984  7407299.596111 
-314605.174999  7407284.578683 
-314619.564671  7407268.601420 
-314639.833906  7407248.914792 
-314656.516031  7407232.707568 
-314674.228934  7407214.500687 
-314690.135913  7407199.303290 
-314700.691088  7407186.315514 
-314707.881801  7407178.576840 
-314717.348474  7407171.118118 
-314725.743137  7407169.198446 
-314735.877754  7407169.828339 
-314740.891463  7407174.677508 
-314752.164060  7407185.645629 
-314760.105180  7407200.113151 
-314770.165581  7407206.282094 
-314781.050606  7407207.671856 
-314792.479882  7407206.542050 
-314802.993826  7407196.833713 
-314816.336227  7407183.366020 
-314825.835884  7407173.637686 
-314838.312431  7407160.229983 
-314853.031953  7407138.153764 
-314866.984575  7407116.327503 
-314875.997705  7407081.823413 
-Region 1
-252
-343920.788828  7392520.207686 
-343850.374264  7392483.813920 
-343742.785693  7392426.073810 
-343715.886489  7392402.337876 
-343693.737113  7392377.812077 
-343620.799203  7392248.074300 
-343571.387789  7392211.550556 
-343577.737387  7392200.642425 
-343655.136507  7392134.113820 
-343671.604230  7392129.404627 
-343693.737113  7392125.465302 
-343725.386146  7392115.187062 
-343788.494549  7392080.562993 
-343868.565449  7392040.829799 
-343941.346681  7391992.568066 
-344002.269833  7391947.455793 
-344015.719435  7391938.367350 
-344018.094349  7391923.339924 
-344012.561129  7391886.156293 
-344066.351291  7391871.918732 
-344154.157155  7391847.392933 
-344230.888331  7391821.287405 
-344260.162450  7391803.090522 
-344316.327527  7391766.706754 
-344362.209554  7391735.852039 
-344411.258134  7391720.824613 
-344419.957907  7391650.416673 
-344417.582993  7391623.521280 
-344394.641979  7391528.597540 
-344339.268541  7391424.175426 
-344338.691304  7391418.866336 
-344321.316496  7391388.441547 
-344306.836115  7391360.096402 
-344291.803237  7391330.831415 
-344272.638997  7391296.097365 
-344251.454430  7391256.474152 
-344228.513417  7391212.961605 
-344214.280423  7391182.106890 
-344207.155679  7391172.618516 
-344202.537790  7391164.879841 
-344184.214666  7391137.814477 
-344174.368666  7391120.917372 
-344162.551818  7391099.740999 
-344145.003839  7391069.996094 
-344120.141454  7391033.392364 
-344116.974901  7391026.273583 
-344080.584285  7390971.682934 
-344047.360222  7390980.391443 
-344080.576039  7390971.682934 
-344080.584285  7390971.682934 
-344090.867335  7390965.364017 
-344208.738956  7390876.759194 
-344291.011599  7390883.088110 
-344333.727074  7390886.257567 
-344357.731851  7390887.677324 
-344410.466496  7390894.166212 
-344457.140161  7390897.325671 
-344506.972133  7390902.864722 
-344552.070769  7390909.193638 
-344596.369520  7390914.732689 
-344613.043398  7390915.402575 
-344646.201491  7390918.682013 
-344697.616740  7390926.600656 
-344761.706444  7390934.509302 
-344786.222488  7390936.878896 
-344807.910074  7390937.458796 
-344817.739581  7390934.599286 
-344827.882445  7390928.310364 
-344840.812535  7390925.810792 
-344929.410037  7390874.389600 
-344983.991837  7390852.233395 
-345006.701957  7390837.985835 
-345043.323467  7390825.338002 
-345056.146356  7390819.509000 
-345070.107224  7390813.909959 
-345089.213741  7390804.771525 
-345106.580302  7390793.013539 
-345130.156276  7390774.256752 
-345141.395888  7390765.658224 
-345149.328762  7390756.519790 
-345188.003584  7390719.026212 
-345229.531601  7390684.702091 
-345238.899319  7390678.043232 
-345250.757399  7390674.673809 
-345284.599929  7390662.295929 
-345303.607491  7390662.315926 
-345319.613425  7390663.535717 
-345391.949360  7390687.321643 
-345467.377632  7390713.707123 
-345506.308087  7390720.585945 
-345538.542602  7390722.505616 
-345566.381877  7390720.206010 
-345600.447056  7390712.697296 
-345633.860782  7390701.719177 
-345677.722483  7390675.953590 
-345689.225975  7390667.705003 
-345772.290256  7390589.388418 
-345820.126640  7390549.035330 
-345848.238040  7390525.309394 
-345864.903673  7390511.921687 
-345922.990121  7390469.149014 
-345960.568194  7390446.992809 
-345991.499805  7390433.065195 
-346028.929446  7390421.347202 
-346068.940157  7390415.348229 
-346121.518124  7390407.269613 
-346124.049717  7390406.149805 
-346162.262750  7390396.271497 
-346216.077651  7390380.554189 
-346251.132377  7390365.706732 
-346258.694171  7390382.663828 
-346263.221351  7390398.441125 
-346271.583029  7390408.939327 
-346278.460386  7390424.736621 
-346283.251446  7390435.194830 
-346280.752838  7390449.572367 
-346282.088727  7390458.440848 
-346287.539486  7390464.369832 
-346295.348666  7390468.769079 
-346300.156219  7390477.457591 
-346301.607555  7390485.336241 
-346306.052273  7390489.705493 
-346313.490374  7390500.523640 
-346320.293514  7390513.551408 
-346322.833353  7390524.209582 
-346330.279699  7390534.477823 
-346343.721055  7390547.135655 
-346352.709446  7390556.424064 
-346362.266828  7390569.481828 
-346366.587853  7390586.028993 
-346366.892963  7390595.557361 
-346369.036983  7390615.064020 
-346378.363470  7390628.701684 
-346390.246288  7390646.078707 
-346401.106574  7390661.696032 
-346406.730503  7390670.394542 
-346416.205422  7390691.090997 
-346424.113558  7390715.986733 
-346429.028311  7390734.083633 
-346443.986974  7390747.751292 
-346455.902777  7390760.389127 
-346460.718575  7390777.606178 
-346464.388148  7390797.692737 
-346463.951098  7390829.247332 
-346455.399757  7390866.151011 
-346454.789536  7390877.289103 
-346450.410787  7390923.691155 
-346450.146908  7390948.156964 
-346452.084772  7390967.893583 
-346459.819736  7390994.369048 
-346468.445294  7391023.883993 
-346482.843212  7391052.159149 
-346491.658433  7391089.102821 
-346510.097005  7391121.967192 
-346558.287977  7391169.429062 
-346582.919467  7391235.027826 
-346607.130401  7391291.318184 
-346622.872455  7391338.000187 
-346633.765726  7391359.706469 
-346723.748594  7391468.767788 
-346736.406558  7391460.999119 
-346748.330608  7391451.690713 
-346765.499260  7391457.399735 
-346771.040727  7391491.413909 
-346777.373832  7391532.546863 
-346778.157224  7391546.784425 
-346767.865928  7391591.876701 
-346755.216211  7391653.586130 
-346704.996666  7391885.286442 
-346684.867617  7391909.972214 
-346624.348530  7391987.368956 
-346565.338504  7392082.332690 
-346516.306416  7392184.595173 
-346486.232413  7392292.756646 
-346477.549132  7392398.968453 
-346479.924047  7392470.166258 
-346480.723931  7392523.957044 
-346476.757494  7392577.747830 
-346463.307892  7392630.748751 
-346455.399757  7392652.105093 
-346442.741793  7392679.790351 
-346422.183940  7392720.143439 
-346403.176378  7392745.449104 
-346376.293666  7392773.934225 
-346263.163628  7392865.698506 
-346228.356288  7392901.292410 
-346100.993256  7393158.388371 
-346063.019364  7393227.996448 
-346022.678804  7393283.376962 
-345984.787374  7393324.199969 
-345923.583850  7393378.540661 
-345873.141657  7393416.724121 
-345795.346717  7393465.515763 
-345769.626724  7393483.962603 
-345741.853419  7393512.777668 
-345679.157327  7393578.416424 
-345617.863095  7393643.945200 
-345566.085013  7393697.206077 
-345398.183510  7393875.395555 
-345355.921578  7393919.937925 
-345279.173910  7394006.163155 
-345236.326495  7394060.013931 
-345212.552612  7394097.157569 
-345208.652145  7394101.936750 
-345185.076172  7394137.180713 
-345149.056636  7394192.841179 
-345116.962307  7394154.687714 
-345079.705837  7394106.685937 
-345076.539284  7394101.146885 
-345052.641708  7394071.002049 
-345039.357030  7394058.424203 
-344991.108335  7394021.250571 
-344940.303308  7393987.516349 
-344905.570184  7393968.749564 
-344885.911170  7393956.171718 
-344810.755024  7393910.289577 
-344767.610745  7393877.295229 
-344762.489836  7393871.536216 
-344722.817220  7393825.514099 
-344739.012817  7393811.626478 
-344767.132464  7393789.920196 
-344787.022372  7393771.853290 
-344757.756500  7393710.943724 
-344742.723621  7393680.099007 
-344714.241141  7393624.718493 
-344688.933459  7393556.690146 
-344666.775837  7393483.302716 
-344654.909511  7393420.023556 
-344634.541321  7393360.423765 
-344629.750261  7393350.075537 
-344616.176966  7393302.153746 
-344585.294832  7393250.942518 
-344548.904216  7393201.890920 
-344507.763771  7393158.378373 
-344457.931800  7393116.255588 
-344402.550115  7393079.071958 
-344347.176676  7393044.467885 
-344293.386513  7393008.863984 
-344268.070585  7392984.938082 
-344226.938387  7392941.625501 
-344190.547771  7392893.173800 
-344174.723254  7392863.108950 
-344159.690376  7392829.884641 
-344147.172598  7392791.691183 
-344131.216141  7392754.737513 
-344117.774785  7392723.292899 
-344098.255957  7392689.438698 
-344081.186260  7392664.362993 
-344054.402503  7392628.809083 
-344025.639650  7392597.804394 
-343967.462493  7392552.642130 
-343920.788828  7392520.207686 
-Region 1
-248
-349181.216036  7394936.783748 
-349134.921697  7394844.179611 
-349102.332593  7394770.442241 
-349036.890507  7394673.808794 
-349082.723057  7394652.302477 
-349075.507605  7394634.605509 
-349056.030008  7394581.804553 
-349021.733935  7394496.059240 
-349013.157855  7394477.192472 
-348996.013942  7394454.896291 
-348966.863516  7394436.039521 
-348934.266167  7394420.602166 
-348908.150354  7394405.054829 
-348885.943255  7394393.146868 
-348860.660312  7394382.698658 
-348851.605951  7394378.309410 
-348828.087701  7394373.620213 
-348802.046104  7394379.539199 
-348775.130408  7394393.146868 
-348751.133876  7394403.435106 
-348733.289033  7394408.244282 
-348711.337567  7394404.124988 
-348682.533484  7394389.037572 
-348653.028470  7394369.830862 
-348629.741115  7394349.954267 
-348615.301965  7394336.216620 
-348596.780931  7394317.009910 
-348575.629349  7394300.402755 
-348564.043395  7394285.045385 
-348539.576829  7394277.136740 
-348520.156956  7394276.726810 
-348498.048812  7394277.016760 
-348471.718597  7394278.736466 
-348456.388854  7394282.605803 
-348428.359916  7394291.924207 
-348391.086954  7394305.601864 
-348368.756161  7394315.800117 
-348324.671812  7394327.808060 
-348284.751810  7394340.295921 
-348223.878135  7394353.103727 
-348101.322655  7394364.211825 
-347921.010576  7394383.298555 
-347829.056858  7394393.236853 
-347815.269160  7394394.876572 
-347780.503052  7394397.376144 
-347752.136018  7394404.394942 
-347713.791046  7394415.393058 
-347685.753862  7394425.081398 
-347661.180094  7394433.319987 
-347626.141860  7394449.337244 
-347609.913278  7394459.275541 
-347548.396398  7394499.508650 
-347318.458502  7394656.561748 
-347294.041414  7394675.868441 
-347218.505941  7394729.509253 
-347186.799184  7394750.175713 
-347176.351210  7394757.204509 
-347140.620292  7394769.772356 
-347066.610372  7394790.678775 
-347018.477124  7394806.536059 
-346962.971745  7394807.515891 
-346860.133003  7394806.746023 
-346822.472468  7394809.665523 
-346782.593696  7394816.694319 
-346686.409662  7394868.085516 
-346699.438706  7394919.356733 
-346704.221520  7394932.394500 
-346713.242897  7394970.258014 
-346724.771127  7395020.579395 
-346738.641287  7395065.541693 
-346741.857317  7395074.060234 
-346746.598900  7395097.636196 
-346756.453145  7395130.210616 
-346763.338748  7395156.226160 
-346770.941772  7395186.081046 
-346784.152234  7395234.612733 
-346850.303496  7395310.679703 
-346862.268777  7395324.447345 
-346881.787605  7395351.112778 
-346907.367412  7395406.183344 
-346914.599357  7395423.100447 
-346934.175908  7395449.815871 
-346950.767324  7395474.181697 
-346964.530283  7395488.949167 
-346981.987553  7395508.755775 
-346996.146331  7395522.783372 
-347014.890014  7395536.141084 
-347045.697931  7395555.087838 
-347084.884019  7395573.624663 
-347101.129094  7395580.663458 
-347124.927715  7395589.561933 
-347162.093477  7395597.210623 
-347177.184079  7395604.819320 
-347205.922193  7395630.164978 
-347213.269584  7395625.355802 
-347231.411292  7395615.077563 
-347254.038949  7395608.698655 
-347290.066730  7395599.180286 
-347318.062683  7395591.771555 
-347326.259437  7395590.031853 
-347416.737079  7395575.204393 
-347449.680771  7395572.064930 
-347569.737643  7395549.508794 
-347523.360842  7395610.978265 
-347457.910509  7395688.844927 
-347404.367733  7395763.672110 
-347334.076863  7395844.648239 
-347280.517595  7395911.086859 
-347310.641076  7395928.273915 
-347269.236752  7396004.040937 
-347234.421166  7396063.240796 
-347202.697917  7396121.100886 
-347183.987219  7396159.784259 
-347170.743773  7396193.348510 
-347157.467342  7396220.433871 
-347127.871620  7396265.856090 
-347122.561047  7396275.024520 
-347113.448962  7396289.142102 
-347102.811325  7396304.029552 
-347082.690522  7396333.044581 
-347075.087497  7396342.972881 
-347035.456113  7396393.084297 
-347007.460160  7396427.338430 
-346934.175908  7396511.733974 
-346913.123281  7396540.808993 
-346870.003741  7396595.929552 
-346849.998386  7396653.999605 
-346767.000074  7396758.541698 
-346753.583457  7396787.756693 
-346743.242684  7396808.623119 
-346729.083906  7396834.408702 
-346713.003756  7396857.004832 
-346682.146361  7396882.460472 
-346606.000667  7396934.001643 
-346663.650065  7397002.509908 
-346678.658205  7396992.001708 
-346706.852068  7396972.755005 
-346732.027810  7396958.037526 
-346751.439437  7396947.169387 
-346776.516224  7396935.491388 
-346811.076177  7396920.004041 
-346833.621372  7396904.226743 
-346866.771219  7396881.600619 
-346876.039982  7396876.561482 
-346969.593469  7396800.504510 
-347090.244069  7396673.536258 
-347142.912744  7396617.095926 
-347183.212074  7396579.642342 
-347230.331036  7396529.600913 
-347266.078445  7396501.295762 
-347291.567544  7396481.419166 
-347312.884051  7396469.931134 
-347347.138893  7396453.453956 
-347369.601625  7396443.085732 
-347395.874116  7396433.877310 
-347446.530711  7396421.159488 
-347491.860240  7396412.650946 
-347535.169444  7396407.641804 
-347549.080835  7396444.745448 
-347559.776196  7396471.230911 
-347602.846259  7396526.611425 
-347651.647452  7396591.260351 
-347795.181342  7396749.863184 
-347881.189528  7396843.797094 
-347954.886091  7396922.083684 
-347954.935569  7396922.053690 
-348032.392413  7397015.107750 
-348016.922484  7397058.280355 
-347984.885878  7397148.324931 
-347963.124076  7397175.420290 
-347931.029746  7397267.334546 
-347919.732410  7397285.871371 
-347963.445679  7397278.942558 
-348020.179746  7397333.523209 
-348135.057985  7397497.035200 
-348145.316296  7397485.957098 
-348149.117808  7397480.238078 
-348151.773094  7397476.418732 
-348156.712586  7397471.069648 
-348164.686691  7397461.521284 
-348186.011444  7397452.322859 
-348205.571503  7397446.363880 
-348224.867683  7397445.733988 
-348249.227048  7397449.543335 
-348287.390603  7397450.503171 
-348309.498748  7397454.252529 
-348370.636302  7397482.077763 
-348438.090469  7397519.371374 
-348523.001906  7397564.603627 
-348534.109578  7397567.783082 
-348545.217251  7397565.393491 
-348599.180584  7397529.689607 
-348671.302117  7397490.556310 
-348691.851724  7397480.208083 
-348733.297279  7397481.267901 
-348828.516505  7397492.375999 
-348865.063799  7397504.653895 
-348920.577424  7397528.089881 
-348977.723802  7397551.105939 
-349034.853688  7397575.701726 
-349094.366735  7397598.717783 
-349152.296505  7397622.523705 
-349207.843115  7397644.739900 
-349359.408834  7397700.300383 
-349420.562880  7397726.975814 
-349439.883799  7397734.424538 
-349485.666871  7397479.588189 
-349504.542493  7397377.255718 
-349508.665609  7397350.580287 
-349528.473055  7397227.991285 
-349557.796651  7397071.808038 
-349564.772962  7397028.975375 
-349576.053805  7396970.225438 
-349585.578202  7396896.428079 
-349593.519322  7396861.504061 
-349599.811196  7396825.810175 
-349607.570899  7396790.106291 
-349608.593431  7396721.048120 
-349605.418633  7396657.558995 
-349598.269151  7396621.065246 
-349595.102598  7396588.520821 
-349581.801428  7396531.910518 
-349572.499680  7396487.558115 
-349562.628942  7396463.452244 
-349552.469586  7396442.385852 
-349542.837988  7396422.829202 
-349533.396054  7396403.672484 
-349505.416594  7396377.436977 
-349486.549218  7396329.155248 
-349468.506465  7396313.287966 
-349449.432934  7396287.542376 
-349450.117371  7396152.125571 
-349463.616450  7396129.989363 
-349485.716349  7396101.494244 
-349508.616131  7396063.180807 
-349625.061154  7396003.940954 
-349602.639653  7395981.724759 
-349531.689084  7395906.387664 
-349487.307871  7395863.325040 
-349443.800758  7395807.954525 
-349418.996096  7395688.824930 
-349399.081449  7395620.606616 
-349374.870516  7395552.828225 
-349340.978508  7395393.055593 
-349290.899150  7395200.498576 
-349202.549034  7395015.310297 
-349200.124643  7394986.265273 
-349181.216036  7394936.783748 
-Region 1
-115
-331139.568375  7398194.775684 
-331145.637601  7398238.988111 
-331157.124600  7398323.783586 
-330389.755115  7398425.616143 
-330238.948049  7398440.953516 
-329851.350470  7398485.715848 
-329395.482347  7398538.076879 
-329263.649858  7398549.594906 
-329181.162813  7398557.763507 
-328821.404508  7398601.735975 
-328705.478998  7398637.709813 
-328615.537360  7398687.691252 
-328421.668478  7398807.610711 
-328317.708248  7398902.424470 
-328241.785202  7398973.502295 
-328141.857379  7399021.464080 
-327890.619470  7399056.238123 
-327687.193206  7399107.099411 
-327604.978287  7399124.166488 
-327502.287977  7399141.383538 
-327116.537553  7399213.321216 
-327105.050554  7399145.072906 
-327095.823022  7399102.290235 
-327092.532776  7399019.634393 
-327088.129289  7398984.530406 
-327088.467384  7398979.811214 
-327157.414118  7398854.862617 
-327190.613443  7398800.841870 
-327199.230754  7398784.624648 
-327204.425879  7398767.957503 
-327206.668854  7398746.291214 
-327205.967925  7398717.346172 
-327205.877216  7398702.978633 
-327210.058055  7398677.463004 
-327215.879894  7398668.454547 
-327222.641803  7398649.817739 
-327330.015972  7398465.119376 
-327336.217138  7398453.081438 
-327353.798101  7398428.965569 
-327363.141081  7398397.071032 
-327395.276641  7398353.138558 
-327460.891899  7398241.927607 
-327509.792046  7398139.425165 
-327559.186968  7398037.662596 
-327587.842620  7397981.352241 
-327733.759671  7397726.455903 
-327815.685972  7397640.850566 
-327930.646674  7397541.787535 
-327964.901516  7397503.874029 
-328048.526541  7397469.529912 
-328093.880809  7397458.611782 
-328131.838209  7397442.654515 
-328168.261810  7397423.387816 
-328199.861366  7397404.161109 
-328246.568016  7397365.287768 
-328257.139684  7397305.528004 
-328268.140155  7397230.790806 
-328283.511129  7397211.914039 
-328399.362424  7397107.361948 
-328485.263408  7397045.412559 
-328559.520715  7396989.872073 
-328632.038068  7396939.930627 
-328663.142850  7396920.453964 
-328690.437873  7396904.796646 
-328737.762991  7396883.450302 
-328796.146304  7396846.536625 
-329060.553443  7396679.945161 
-329161.693462  7396621.455179 
-329188.073154  7396600.328798 
-329240.280040  7396568.444260 
-329359.866877  7396543.888466 
-329486.289839  7396515.243372 
-329616.027786  7396489.867719 
-329680.397862  7396480.359348 
-329730.073156  7396471.450874 
-329838.478104  7396443.395679 
-329954.766448  7396418.369966 
-330026.467424  7396402.212734 
-330118.973639  7396340.983222 
-330211.751980  7396284.582883 
-330162.926049  7396173.591894 
-330199.902147  7396071.269421 
-330213.722829  7396052.872572 
-330222.059769  7396074.118933 
-330293.109292  7396239.940529 
-330363.523855  7396390.924667 
-330429.559670  7396542.708668 
-330466.247150  7396616.925955 
-330460.450050  7396713.489415 
-330456.722754  7396819.181311 
-330458.767819  7396868.192915 
-330457.456669  7396919.554118 
-330458.149352  7396984.532987 
-330459.213116  7397083.336063 
-330476.084904  7397134.487302 
-330480.999657  7397149.084801 
-330498.926963  7397245.178341 
-330510.001650  7397294.999807 
-330551.719331  7397477.308579 
-330567.073813  7397547.076629 
-330578.197978  7397586.129939 
-330587.466741  7397611.735553 
-330607.991609  7397652.518568 
-330635.162939  7397701.900109 
-330657.411269  7397734.804473 
-330692.136147  7397777.527155 
-330734.769159  7397825.039016 
-330793.482321  7397889.997889 
-330871.334985  7397986.731320 
-330942.928759  7398062.308374 
-330981.331455  7398110.820065 
-331057.691551  7398153.602736 
-331066.622219  7398158.281935 
-331110.789030  7398177.908573 
-331139.568375  7398194.775684 
-Region 1
-104
-332883.440001  7393972.568910 
-332834.737763  7393981.237425 
-332776.849224  7393992.055572 
-332680.590974  7394004.803388 
-332622.026244  7394018.381062 
-332506.513045  7394035.928057 
-332485.246016  7394039.187498 
-332451.288038  7394042.966851 
-332422.838542  7394046.116312 
-332403.558855  7394053.924974 
-332383.363836  7394063.463340 
-332320.016292  7394088.599035 
-332237.306599  7394120.463577 
-332216.303449  7394128.482203 
-332195.193099  7394138.010571 
-332174.998080  7394148.418788 
-332140.116525  7394177.893739 
-332124.506410  7394190.031660 
-332110.743451  7394207.368691 
-332094.218005  7394242.042751 
-332083.201041  7394265.448742 
-332074.946564  7394302.732356 
-332069.438082  7394323.538792 
-332046.257927  7394412.353578 
-332039.141430  7394433.629934 
-332010.592980  7394503.887899 
-331988.954871  7394549.330116 
-331983.256725  7394559.408389 
-331968.462987  7394541.271496 
-331937.061341  7394526.514024 
-331922.267603  7394514.856021 
-331908.991172  7394498.378843 
-331900.044012  7394481.391753 
-331892.861545  7394460.065406 
-331885.687324  7394444.848012 
-331838.997166  7394483.041470 
-331682.137367  7394428.010897 
-331567.300359  7394386.358031 
-331478.100882  7394329.657744 
-331400.899671  7394285.885241 
-331372.862486  7394267.158449 
-331244.163565  7394191.021491 
-331112.702156  7394113.314801 
-331065.302822  7394085.219614 
-331030.149141  7394067.272688 
-331017.128343  7394053.065121 
-330989.627163  7394009.142645 
-330931.911795  7393929.406303 
-330870.048573  7393837.811992 
-330806.181516  7393749.777072 
-330699.302121  7393599.372835 
-330801.538889  7393511.227933 
-330894.861481  7393420.303508 
-330953.483934  7393366.462730 
-331028.846236  7393298.264412 
-331103.087051  7393230.246063 
-331168.628092  7393169.086539 
-331240.576454  7393109.116811 
-331390.410465  7392972.170269 
-331536.789305  7392841.392670 
-331650.760459  7392741.629758 
-331671.359543  7392723.602846 
-331692.156537  7392705.036027 
-331727.186525  7392674.131320 
-331896.687796  7392539.074454 
-331984.056610  7392468.866480 
-332000.029558  7392457.088498 
-332079.572699  7392394.139280 
-332219.989515  7392274.429785 
-332337.028266  7392179.646021 
-332461.076314  7392090.601274 
-332497.986442  7392078.373368 
-332541.609002  7392058.756728 
-332559.536308  7392053.557619 
-332555.619348  7392250.453892 
-332557.515981  7392291.436872 
-332555.710057  7392351.046662 
-332577.702754  7392584.276711 
-332580.803337  7392653.954776 
-332583.293698  7392701.066706 
-332584.753281  7392746.688892 
-332582.634000  7392791.091286 
-332575.220638  7392839.113060 
-332573.876503  7392885.275153 
-332572.837478  7392917.239678 
-332578.560362  7392958.982528 
-332583.170005  7392994.156503 
-332591.572914  7393028.010704 
-332603.538194  7393079.041963 
-332610.011485  7393103.287810 
-332616.913581  7393138.681747 
-332625.151565  7393236.764946 
-332635.187228  7393320.950526 
-332641.388393  7393377.150899 
-332653.543337  7393423.622939 
-332669.153452  7393463.186162 
-332691.071933  7393516.607012 
-332714.639660  7393561.139384 
-332749.430507  7393607.281480 
-332766.764084  7393643.535270 
-332783.710088  7393687.697705 
-332806.510916  7393761.085135 
-332838.316627  7393850.359843 
-332883.440001  7393972.568910 
-Region 1
-120
-336981.824879  7397158.343215 
-336633.685514  7397505.313782 
-336447.469133  7397638.350994 
-336366.697304  7397670.655461 
-336275.823842  7397702.969926 
-336197.072340  7397711.048542 
-336150.819232  7397710.118701 
-335944.655219  7397680.753731 
-335969.196002  7397597.128055 
-335989.118895  7397520.771135 
-336000.003920  7397482.547682 
-336009.132497  7397449.823287 
-336038.802435  7397323.244969 
-336046.026133  7397286.361287 
-336088.180864  7397241.199023 
-336000.003920  7397141.376122 
-335983.371272  7397124.139074 
-335961.964058  7397100.653097 
-335895.689102  7397028.375478 
-335841.511366  7396969.895495 
-335788.347918  7396911.155556 
-335708.483174  7396822.300776 
-335608.951170  7396714.019324 
-335504.867247  7396602.918355 
-335403.067529  7396491.327469 
-335420.648493  7396474.910281 
-335488.391278  7396414.320660 
-335504.191056  7396397.133604 
-335574.721066  7396336.044068 
-335582.629202  7396325.665845 
-335644.756303  7396271.635100 
-335654.709504  7396257.977440 
-335678.640065  7396238.040855 
-335711.509540  7396204.936525 
-335778.229792  7396145.606688 
-335806.778243  7396115.031925 
-335815.816112  7396082.297532 
-335844.158407  7395989.423441 
-335876.409415  7395877.872548 
-335922.143010  7395706.351928 
-335942.206089  7395626.815552 
-335977.013428  7395504.076576 
-335995.394277  7395473.701779 
-336038.472585  7395441.887229 
-336070.138111  7395416.821522 
-336086.556356  7395389.496203 
-336117.743601  7395337.635086 
-336138.713765  7395302.301139 
-336158.339794  7395270.136648 
-336216.475720  7395186.211024 
-336276.516526  7395188.630609 
-336572.729377  7395262.567944 
-336685.513073  7395293.952569 
-336808.687020  7395371.189339 
-336984.925462  7395475.271510 
-337132.285603  7395575.474346 
-337206.922237  7395491.548722 
-337262.378138  7395428.069596 
-337327.836717  7395353.772322 
-337376.464739  7395297.102029 
-337475.097904  7395180.921930 
-337506.590259  7395143.058415 
-337605.990323  7395029.127931 
-337663.573752  7394962.509342 
-337698.108965  7394922.766149 
-337759.139318  7394852.738145 
-337815.568275  7394785.729623 
-337848.759353  7394747.916100 
-337904.611073  7394684.296997 
-337958.211573  7394639.784622 
-337995.360842  7394607.700117 
-338025.616262  7394580.524772 
-338061.644044  7394546.900532 
-338115.640362  7394499.328680 
-338169.257353  7394451.756829 
-338217.926607  7394405.674722 
-338279.212593  7394351.314034 
-338333.967564  7394304.512051 
-338375.371889  7394264.068978 
-338379.956793  7394260.299624 
-338450.890869  7394334.326944 
-338477.682872  7394362.092188 
-338524.076166  7394411.433736 
-338581.041127  7394473.103173 
-338732.722294  7394630.786163 
-338703.233773  7394679.957740 
-338878.911470  7394746.326372 
-338862.287070  7394795.138011 
-338847.847920  7394841.570058 
-338834.942569  7394888.032099 
-338807.952656  7395002.742450 
-338793.752647  7395086.168160 
-338758.153669  7395250.370034 
-338740.226363  7395335.935377 
-338708.173265  7395486.209637 
-338688.613206  7395604.439385 
-338661.013072  7395771.280807 
-338652.527701  7395805.604927 
-338637.321651  7395857.096107 
-338626.502597  7395885.361266 
-338616.763798  7395905.987732 
-338604.782025  7395930.833477 
-338588.990493  7395956.839022 
-338573.561796  7395979.415155 
-338558.528917  7396005.050764 
-338542.003471  7396033.725852 
-338526.269663  7396066.970158 
-338462.196451  7396344.182674 
-338383.337747  7396580.802143 
-338340.927383  7396755.842160 
-338321.961053  7396813.082355 
-338306.367430  7396863.453727 
-338283.632573  7396926.053005 
-338252.948348  7396994.811227 
-338206.431361  7397106.442105 
-337821.777686  7396988.232354 
-337576.386355  7396931.912001 
-337391.332693  7396931.912001 
-337194.214796  7397000.300287 
-336981.824879  7397158.343215 
-Region 1
-74
-333821.052918  7396075.218745 
-333729.676437  7396099.864523 
-333632.989382  7396125.490134 
-333556.340668  7396145.636683 
-333432.737917  7396179.760838 
-333355.322304  7396201.427126 
-333314.742603  7396207.546078 
-333263.723174  7396222.513514 
-333226.928493  7396231.451983 
-333185.812787  7396242.400108 
-333078.718989  7396269.485469 
-332929.998220  7396307.788908 
-332916.062090  7396308.218834 
-332896.856619  7396295.920940 
-332818.270040  7396299.800276 
-332794.694067  7396302.709778 
-332685.670652  7396309.468620 
-332492.832548  7396624.534652 
-332439.479436  7396805.113720 
-332399.608911  7396868.092933 
-332328.617111  7396927.462763 
-332281.968184  7396961.047010 
-332224.120876  7396972.245092 
-332169.167995  7396976.304397 
-332016.959070  7397003.399756 
-331995.799242  7397004.029648 
-331968.693882  7397002.339937 
-331765.383065  7396968.455741 
-331762.670055  7397072.437930 
-331759.816860  7397168.441486 
-331704.319727  7397269.404192 
-331651.486128  7397365.547723 
-331604.202241  7397438.875163 
-331573.072720  7397497.215170 
-331509.568498  7397617.484569 
-331436.457417  7397744.902743 
-331363.659693  7397880.439527 
-331328.110193  7397965.235002 
-331299.471034  7397999.999047 
-331296.741531  7398008.977509 
-331274.542678  7398041.781890 
-331254.331167  7398071.996715 
-331236.445093  7398106.750762 
-331198.372246  7398138.695290 
-331139.568375  7398194.775684 
-331145.637601  7398238.988111 
-331157.124600  7398323.783586 
-331542.536928  7398255.255324 
-331752.411744  7398227.770032 
-332221.201710  7398166.210577 
-333145.323794  7398119.288614 
-333595.650450  7398089.513714 
-334098.390147  7398060.788635 
-334095.207102  7397991.890436 
-334091.413836  7397801.832991 
-334088.750304  7397633.881760 
-334085.303379  7397567.043209 
-334084.058199  7397468.200140 
-334082.491415  7397382.074892 
-334080.743214  7397329.973817 
-334080.767953  7397276.622955 
-334079.011505  7397178.539756 
-334077.147857  7397051.241561 
-334074.154476  7396897.007980 
-334073.725672  7396874.941759 
-334056.185939  7396718.558546 
-334029.426921  7396691.163239 
-334057.480597  7396642.061650 
-334104.838700  7396536.829675 
-334118.865538  7396494.736885 
-334115.360890  7396408.791607 
-334076.776777  7396249.198943 
-333982.068818  7396026.457097 
-333821.052918  7396075.218745 
-Region 1
-103
-335324.555167  7394205.758966 
-335270.806236  7394210.308187 
-335245.176951  7394213.087711 
-335209.413049  7394215.857237 
-334973.941933  7394238.813304 
-334784.418814  7394253.730749 
-334636.819531  7394264.608886 
-334542.111572  7394267.818336 
-334486.037204  7394270.827821 
-334405.347837  7394276.366872 
-334284.911638  7394282.485824 
-334135.778557  7394293.573924 
-334091.554022  7394278.196558 
-334052.235994  7394368.041169 
-334017.263730  7394444.888006 
-334196.338875  7394497.159052 
-334182.361514  7394504.187848 
-334166.273118  7394523.774493 
-334144.428853  7394584.504091 
-334138.928617  7394618.258309 
-334133.733492  7394643.394003 
-334124.720362  7394669.499532 
-334117.496664  7394693.085492 
-334107.741373  7394718.181193 
-334093.153791  7394745.276552 
-334071.540420  7394782.070249 
-334043.222864  7394834.061344 
-334027.752936  7394904.139340 
-334015.630977  7394957.900131 
-334016.867911  7394984.985492 
-334014.888816  7395049.254483 
-334017.123544  7395134.299916 
-334020.372559  7395193.259816 
-334021.172444  7395236.302443 
-334012.283007  7395278.225262 
-333992.211682  7395349.133117 
-333971.892969  7395423.830322 
-333957.676468  7395454.315100 
-333947.517112  7395476.431312 
-333933.053223  7395502.336874 
-333919.339741  7395520.383783 
-333899.293155  7395541.460173 
-333879.246568  7395560.216960 
-333830.552576  7395600.850000 
-333884.870497  7395785.938296 
-333907.324983  7395848.817525 
-333982.068818  7396026.457097 
-334076.776777  7396249.198943 
-334113.934292  7396408.831600 
-334184.876614  7396381.876217 
-334205.417975  7396378.426808 
-334306.178667  7396351.301454 
-334411.252138  7396323.436227 
-334507.873223  7396312.538094 
-334605.500347  7396302.929740 
-334756.373383  7396289.032120 
-334874.756270  7396281.063485 
-334979.969927  7396274.794559 
-335045.651154  7396268.285674 
-335107.877211  7396336.993905 
-335176.411634  7396413.840742 
-335272.397758  7396520.072545 
-335317.249007  7396569.614059 
-335403.067529  7396491.327469 
-335420.648493  7396474.910281 
-335488.391278  7396414.320660 
-335504.191056  7396397.133604 
-335574.721066  7396336.044068 
-335582.629202  7396325.665845 
-335644.756303  7396271.635100 
-335654.709504  7396257.977440 
-335678.640065  7396238.040855 
-335711.509540  7396204.936525 
-335778.229792  7396145.606688 
-335806.778243  7396115.031925 
-335815.816112  7396082.297532 
-335844.158407  7395989.423441 
-335876.409415  7395877.872548 
-335922.143010  7395706.351928 
-335942.206089  7395626.815552 
-335977.013428  7395504.076576 
-335995.394277  7395473.701779 
-336038.472585  7395441.887229 
-336070.138111  7395416.821522 
-336086.556356  7395389.496203 
-336117.743601  7395337.635086 
-336138.713765  7395302.301139 
-336158.339794  7395270.136648 
-336216.475720  7395186.211024 
-336182.369310  7395177.112582 
-335857.632747  7395110.094062 
-335656.894755  7395017.779874 
-335587.263583  7395004.422162 
-335344.659478  7394957.800148 
-335168.849840  7394911.948002 
-335228.503073  7394820.743625 
-335289.929245  7394724.460117 
-335280.042014  7394715.811599 
-335500.150403  7394362.392136 
-335608.637813  7394186.182320 
-335438.781954  7394195.670694 
-335375.846722  7394200.969787 
-335324.555167  7394205.758966 
-Region 1
-481
-325664.887603  7405456.271855 
-325545.927479  7405414.878945 
-325375.214012  7405273.403179 
-325324.532679  7405286.450944 
-325274.675968  7405281.921720 
-325238.417292  7405261.515215 
-325199.882656  7405207.124532 
-325145.243132  7405147.694712 
-325118.352174  7405098.673109 
-325087.041236  7405059.099887 
-325051.656660  7405018.696808 
-324976.995288  7404947.249046 
-324957.864033  7404905.696164 
-324947.539752  7404883.210016 
-324921.943452  7404833.278568 
-324903.348202  7404798.954448 
-324879.293947  7404768.209714 
-324859.799858  7404732.095900 
-324850.968145  7404701.531136 
-324843.010533  7404640.351615 
-324839.712040  7404625.194211 
-324820.011795  7404582.021606 
-324810.833741  7404562.534944 
-324805.209811  7404539.278928 
-324801.762887  7404516.492831 
-324803.717244  7404490.837225 
-324809.827701  7404463.391927 
-324815.550585  7404443.565323 
-324825.091473  7404417.259829 
-324850.506356  7404373.817270 
-324890.673746  7404322.176116 
-324922.949493  7404278.263637 
-324965.161947  7404294.360880 
-324996.951166  7404312.427785 
-325036.656767  7404316.237133 
-325061.378966  7404327.725165 
-325099.088979  7404353.840692 
-325135.916645  7404382.235828 
-325160.333734  7404397.323244 
-325197.598450  7404415.070204 
-325223.367921  7404405.861781 
-325248.403477  7404390.224460 
-325269.703491  7404354.720541 
-325290.112912  7404344.962213 
-325317.177041  7404353.840692 
-325351.786471  7404357.830008 
-325371.082651  7404360.049628 
-325391.063268  7404354.720541 
-325497.678784  7404348.431618 
-325543.692751  7404341.852745 
-325568.538644  7404344.962213 
-325614.799998  7404361.549371 
-325643.076322  7404363.599020 
-325777.217756  7404381.405970 
-325882.621077  7404389.244627 
-325923.060592  7404374.857092 
-325962.947609  7404341.522802 
-325983.794080  7404366.528518 
-325993.903959  7404364.148926 
-326013.546481  7404352.830865 
-326056.410387  7404326.045453 
-326108.262686  7404297.770296 
-326158.119396  7404269.645114 
-326202.640795  7404244.569409 
-326249.446401  7404221.783312 
-326259.778928  7404141.317095 
-326495.480938  7403846.597578 
-326524.153082  7403809.313964 
-326560.032432  7403765.221517 
-326608.223404  7403691.404161 
-326633.860935  7403661.669254 
-326663.596842  7403623.725754 
-326655.070240  7403576.513841 
-326626.678468  7403523.252964 
-326660.496260  7403486.349285 
-326717.189095  7403430.558842 
-326736.369828  7403293.582304 
-326732.271451  7403262.817574 
-326743.593526  7403111.643469 
-326763.920484  7402997.782972 
-326765.083203  7402981.755717 
-326762.419670  7402968.408004 
-326819.821682  7402834.111008 
-326927.063912  7402571.326020 
-326978.792516  7402586.603403 
-327006.549329  7402593.992138 
-327032.797081  7402587.183304 
-327051.746919  7402583.373957 
-327064.058541  7402573.695614 
-327064.932642  7402554.358927 
-327196.806362  7402561.387723 
-327325.158942  7402571.935916 
-327323.039661  7402595.761835 
-327378.198698  7402591.292600 
-327582.127982  7402568.406520 
-327570.129716  7402507.167010 
-327650.258339  7402500.298187 
-327739.639233  7402491.329723 
-327748.380238  7402488.600191 
-327763.949121  7402483.900995 
-327773.778628  7402476.202314 
-327788.456919  7402462.054738 
-327764.716021  7402423.371364 
-327821.862399  7402406.664225 
-327851.746739  7402411.943321 
-327833.291675  7402383.808140 
-327787.582818  7402253.700427 
-327870.218296  7402230.844342 
-327923.843533  7402213.257354 
-327942.306844  7402219.416299 
-327958.090129  7402207.998255 
-327984.552283  7402199.229757 
-328007.353111  7402197.390072 
-328032.652547  7402200.789490 
-328094.812633  7402214.357166 
-328163.784107  7402243.342201 
-328182.296894  7402228.564732 
-328183.377151  7402216.366822 
-328181.653688  7402197.370076 
-328201.007592  7402206.728473 
-328213.343953  7402224.055505 
-328223.808419  7402237.933128 
-328232.293791  7402257.869713 
-328238.057906  7402282.325524 
-328236.029333  7402320.778937 
-328228.401570  7402351.143736 
-328210.152662  7402387.717471 
-328210.762883  7402396.156025 
-328199.919089  7402417.172425 
-328192.052185  7402434.799406 
-328185.760311  7402448.567048 
-328181.332085  7402460.035083 
-328178.000608  7402474.172662 
-328175.493754  7402487.880314 
-328174.809317  7402502.707774 
-328183.088533  7402528.173412 
-328193.503522  7402542.600941 
-328210.787621  7402556.938485 
-328301.496158  7402640.044250 
-328319.522419  7402651.332316 
-328333.672950  7402656.931357 
-328348.598628  7402664.820006 
-328354.882256  7402667.359571 
-328361.982260  7402669.659177 
-328382.193772  7402671.788812 
-328409.736182  7402675.238221 
-328485.552026  7402682.776930 
-328513.737643  7402683.316837 
-328552.330002  7402676.837947 
-328613.376848  7402664.620040 
-328660.883382  7402651.672258 
-328689.778175  7402646.493145 
-328700.828124  7402646.403160 
-328723.431042  7402648.982718 
-328748.631523  7402648.982718 
-328811.805896  7402658.481091 
-328841.640758  7402670.049110 
-328854.727526  7402672.848630 
-328892.190152  7402697.084479 
-328910.620478  7402711.801958 
-328929.001326  7402719.270679 
-328951.546520  7402745.796135 
-328968.789389  7402756.414316 
-328999.457120  7402798.337135 
-329033.777932  7402837.310460 
-329065.608383  7402877.103643 
-329106.724089  7402922.195920 
-329134.678811  7402953.100626 
-329153.488463  7402968.188041 
-329160.423543  7402975.756745 
-329184.947833  7402990.424233 
-329194.150626  7402996.063267 
-329200.261083  7402997.922948 
-329218.188388  7403000.442517 
-329231.390604  7403008.411152 
-329258.916521  7402986.344931 
-329295.702956  7402978.486277 
-329312.640714  7402975.006873 
-329374.627630  7402976.576605 
-329426.356235  7402999.122743 
-329451.070188  7403010.790744 
-329449.239525  7403049.304147 
-329434.396310  7403139.588682 
-329419.569587  7403225.204017 
-329409.154598  7403320.267733 
-329404.528462  7403363.310361 
-329402.673060  7403380.957338 
-329399.803372  7403401.103887 
-329398.145880  7403488.278955 
-329400.809412  7403520.773389 
-329404.726372  7403545.869090 
-329421.218833  7403619.036557 
-329426.166571  7403645.502024 
-329421.383758  7403669.727874 
-329415.091884  7403718.499520 
-329406.383864  7403796.496160 
-329388.258649  7403840.078695 
-329353.640973  7403921.024829 
-329322.330035  7403989.513098 
-329279.466128  7404061.120832 
-329233.320222  7404134.288299 
-329200.360038  7404176.311101 
-329172.339346  7404293.061103 
-329160.802869  7404359.999637 
-329155.022262  7404393.733858 
-329142.669408  7404451.843905 
-329122.886701  7404542.128440 
-329112.999470  7404601.278308 
-329003.299864  7404667.796914 
-328932.761607  7404801.993927 
-328943.061149  7404891.598579 
-328928.399351  7404957.547282 
-328926.428502  7405021.656301 
-328946.433857  7405155.573362 
-328962.654193  7405198.186063 
-328997.964553  7405284.421292 
-329039.443093  7405364.537569 
-328976.582077  7405462.050865 
-328963.816912  7405575.761388 
-329009.657708  7405675.744262 
-329140.245016  7405808.731482 
-329196.203937  7405935.089838 
-329298.448951  7406044.821042 
-329319.814935  7406176.418501 
-329273.009330  7406255.844896 
-329193.894993  7406292.578603 
-329236.445543  7406403.389623 
-329214.873404  7406536.046900 
-329383.137740  7406646.318011 
-329454.244987  7406779.715161 
-329407.686769  7406899.454651 
-329388.398835  7406985.509911 
-329450.682615  7407025.213110 
-329552.152483  7407114.557806 
-329655.683909  7407211.001286 
-329701.986494  7407396.059587 
-329711.552122  7407558.751719 
-329734.105562  7407746.859498 
-329755.694194  7407912.351151 
-329861.534565  7408022.562273 
-329887.584407  7408032.160629 
-330076.678722  7408047.857940 
-330203.481011  7408095.399797 
-330240.828189  7408224.747640 
-330392.426894  7408356.785024 
-330381.475899  7408366.823304 
-330350.585519  7408387.029843 
-330313.576436  7408410.475827 
-330277.614624  7408428.872676 
-330234.247697  7408452.768582 
-330184.588896  7408467.496060 
-330143.085618  7408479.274042 
-330105.911610  7408489.572278 
-330067.401713  7408510.218742 
-330025.535600  7408537.414083 
-329996.657300  7408560.160187 
-329964.084689  7408602.352960 
-329936.632987  7408639.026678 
-329903.293477  7408682.979150 
-329875.800544  7408725.461873 
-329854.236651  7408756.626534 
-329830.627692  7408789.030984 
-329808.354623  7408812.856903 
-329777.150886  7408841.152056 
-329760.180144  7408869.317231 
-329747.555165  7408929.626901 
-329732.909859  7408952.502983 
-329715.782438  7408967.020496 
-329695.645143  7408975.689011 
-329662.470557  7408995.885551 
-329621.602238  7409025.100547 
-329592.690953  7409053.165740 
-329563.738437  7409087.299893 
-329539.923323  7409112.625555 
-329516.132948  7409135.171693 
-329490.833512  7409154.918311 
-329464.313634  7409168.086055 
-329440.886093  7409175.724747 
-329420.526150  7409179.344127 
-329394.839141  7409182.403603 
-329372.236223  7409180.943853 
-329350.960948  7409171.155529 
-329333.520170  7409158.357721 
-329315.328985  7409143.280304 
-329299.174619  7409127.213056 
-329286.772289  7409120.034286 
-329265.513506  7409108.216310 
-329247.511984  7409103.007203 
-329231.769930  7409100.847572 
-329211.195585  7409098.897906 
-329187.042375  7409101.467466 
-329157.487884  7409111.825692 
-329112.933500  7409124.083592 
-329085.894110  7409138.511121 
-329056.018016  7409159.237571 
-329030.454701  7409181.253800 
-329011.991391  7409204.099886 
-328998.096492  7409229.265576 
-328985.471513  7409253.171481 
-328974.198916  7409266.469203 
-328955.793329  7409281.736588 
-328940.504817  7409287.415615 
-328913.185055  7409305.882452 
-328904.740915  7409314.151035 
-328895.125810  7409325.009176 
-328882.517324  7409338.446874 
-328871.104540  7409355.943877 
-328856.665390  7409373.140931 
-328847.297672  7409389.908059 
-328823.820654  7409418.083233 
-328805.068725  7409434.960342 
-328784.799490  7409452.077410 
-328760.769974  7409474.473574 
-328738.307242  7409494.030224 
-328709.074354  7409516.816321 
-328683.774919  7409531.083877 
-328655.968629  7409542.781873 
-328633.415188  7409542.451930 
-328609.179516  7409535.023202 
-328592.860226  7409523.935101 
-328579.031297  7409515.906477 
-328563.767524  7409501.798893 
-328553.088655  7409486.251556 
-328534.856239  7409467.314800 
-328527.484109  7409451.047586 
-328514.801407  7409433.960513 
-328497.368875  7409411.744319 
-328484.158413  7409396.156989 
-328469.917173  7409381.819444 
-328448.641898  7409362.572741 
-328429.799261  7409350.694776 
-328405.415157  7409335.947302 
-328378.788078  7409318.900222 
-328355.121396  7409310.641637 
-328338.925799  7409300.893306 
-328329.813714  7409295.254272 
-328315.902323  7409286.285809 
-328305.528565  7409280.626778 
-328293.876641  7409275.477660 
-328278.637607  7409273.567987 
-328260.330975  7409275.437667 
-328238.437233  7409280.806747 
-328219.355455  7409284.686083 
-328192.662406  7409285.715906 
-328161.161805  7409283.926213 
-328136.076772  7409274.607809 
-328118.603009  7409266.109265 
-328098.168849  7409245.202846 
-328076.481263  7409221.506905 
-328061.605063  7409204.189871 
-328043.496340  7409177.484445 
-328028.397492  7409157.127932 
-328016.283779  7409145.139986 
-327997.845207  7409129.052741 
-327974.788746  7409120.254248 
-327954.766898  7409112.495577 
-327937.004518  7409108.046339 
-327911.853514  7409107.326463 
-327895.600194  7409106.426617 
-327879.874632  7409102.497290 
-327867.777411  7409088.489689 
-327856.735708  7409067.913214 
-327851.293196  7409047.136773 
-327843.789126  7409029.879729 
-327832.038248  7409002.724380 
-327824.270298  7408987.237033 
-327816.213731  7408977.308734 
-327807.142877  7408966.100653 
-327805.411169  7408959.771737 
-327807.810822  7408943.864462 
-327823.412690  7408929.336951 
-327836.746845  7408912.009919 
-327855.234894  7408884.364654 
-327865.031417  7408864.977975 
-327876.180320  7408833.223414 
-327881.424923  7408810.267346 
-327883.931777  7408778.932714 
-327882.315516  7408756.166613 
-327875.124803  7408731.080910 
-327864.074854  7408713.034001 
-327846.939186  7408691.647665 
-327838.890865  7408680.459581 
-327829.869489  7408662.432669 
-327824.954736  7408638.616748 
-327822.571575  7408616.610518 
-327818.539168  7408575.867497 
-327824.121866  7408541.033464 
-327828.673786  7408507.699173 
-327830.413740  7408477.374368 
-327831.164147  7408443.260211 
-327826.546258  7408413.385328 
-327821.944861  7408381.240835 
-327813.500721  7408353.865524 
-327803.258903  7408328.489870 
-327797.296878  7408308.723256 
-327781.546577  7408272.429473 
-327768.946337  7408257.152090 
-327755.818338  7408245.154145 
-327738.913565  7408228.077070 
-327717.151762  7408215.239269 
-327694.565337  7408210.240125 
-327674.997031  7408211.079982 
-327623.581783  7408223.027935 
-327591.908011  7408245.894018 
-327570.063746  7408265.870596 
-327550.503687  7408281.797868 
-327530.943628  7408301.014577 
-327504.522705  7408321.241112 
-327484.451380  7408333.379033 
-327452.942532  7408357.904832 
-327428.566675  7408384.190329 
-327406.978043  7408407.196389 
-327379.806713  7408439.290891 
-327357.459428  7408464.066647 
-327331.558017  7408497.680889 
-327306.926526  7408524.726257 
-327275.178538  7408557.340670 
-327241.649365  7408585.655820 
-327213.694643  7408603.102832 
-327178.367791  7408621.819626 
-327161.339324  7408627.388672 
-327129.813984  7408632.207846 
-327109.470533  7408632.217844 
-327076.658782  7408629.968230 
-327047.153768  7408627.968572 
-327025.284765  7408622.919437 
-327003.143636  7408610.301599 
-326983.286712  7408592.384668 
-326962.399010  7408566.369124 
-326939.482735  7408542.383232 
-326900.049260  7408529.015522 
-326867.229262  7408517.667466 
-326848.147484  7408514.907939 
-326808.474869  7408508.109103 
-326764.472982  7408504.599704 
-326731.916863  7408502.850004 
-326699.368991  7408501.860174 
-326673.681982  7408502.630042 
-326618.250820  7408503.929819 
-326575.774486  7408503.699858 
-326519.848550  7408517.377516 
-326498.499059  7408525.476128 
-326471.550377  7408535.094481 
-326442.581369  7408548.492186 
-326418.436405  7408561.899889 
-326393.532789  7408578.846986 
-326202.047067  7408619.639999 
-326065.728628  7408633.267665 
-326011.196305  7408599.193501 
-326018.007691  7408435.601523 
-326127.072338  7408203.841222 
-326147.522990  7408026.621578 
-326208.866700  7407863.029599 
-326236.128738  7407760.787113 
-326195.235680  7407651.725794 
-326202.055313  7407542.664475 
-326072.540015  7407113.238032 
-325997.565286  7407092.791534 
-325874.869620  7407079.163869 
-325727.361046  7407039.950585 
-325543.206223  7406979.400957 
-325466.326615  7406904.283824 
-325385.101243  7406884.707177 
-325254.794306  7406833.875884 
-325171.969166  7406768.877018 
-325162.848835  7406678.852438 
-325166.073111  7406627.001320 
-325178.087869  7406573.330513 
-325171.301221  7406602.245560 
-325166.073111  7406627.001320 
-325156.680654  7406585.758384 
-325183.876723  7406489.574860 
-325284.183872  7406381.113438 
-325516.340004  7406266.063145 
-325601.259687  7406208.622984 
-325711.148956  7406058.758655 
-325721.143388  7405941.368763 
-325679.755556  7405771.437870 
-325652.246131  7405634.771280 
-325614.082576  7405535.638261 
-325664.887603  7405456.271855 
-Region 1
-290
-326424.423169  7392114.857119 
-326316.323331  7392102.299270 
-326277.293922  7392098.559910 
-326211.192137  7392088.081705 
-326121.621579  7392074.324062 
-326071.138155  7392074.154091 
-326040.256022  7392044.599153 
-325976.306503  7391999.996793 
-325910.518075  7391963.663017 
-325857.791676  7391863.610155 
-325833.217909  7391818.697848 
-325768.270596  7391657.715423 
-325707.380429  7391507.831097 
-325673.076110  7391447.831374 
-325622.386530  7391411.807545 
-325530.078224  7391341.749545 
-325473.632775  7391300.336639 
-325452.110113  7391284.489353 
-325437.811149  7391267.512261 
-325320.937322  7391062.417392 
-325256.682693  7391003.107551 
-325182.771728  7390957.115429 
-325162.387046  7390943.447771 
-325078.588850  7390903.014696 
-325052.877103  7390894.176210 
-325023.569999  7390879.608706 
-324976.459283  7390855.002920 
-324934.692125  7390836.296125 
-324856.270472  7390805.751357 
-324826.740720  7390794.393302 
-324759.443231  7390743.262061 
-324730.647394  7390727.324791 
-324674.630749  7390703.828815 
-324604.001784  7390689.501269 
-324555.043912  7390684.282163 
-324472.581606  7390663.375744 
-324440.998542  7390650.747907 
-324379.390953  7390628.291754 
-324334.053177  7390604.775782 
-324227.858219  7390559.063612 
-324117.342236  7390513.591401 
-324062.075998  7390490.355381 
-324000.600348  7390773.936806 
-323991.463525  7390811.100441 
-323962.675934  7390954.815823 
-323902.519681  7390902.244828 
-323730.767189  7390749.990908 
-323671.996303  7390695.700208 
-323611.370016  7390644.968897 
-323541.103884  7390603.466006 
-323508.366349  7390590.078300 
-323452.580598  7390565.532504 
-323398.287416  7390543.216327 
-323356.017237  7390510.101999 
-323314.390265  7390462.990069 
-323285.462488  7390416.727993 
-323273.348775  7390363.457118 
-323259.107535  7390325.693586 
-323243.332496  7390290.459622 
-323220.878010  7390263.594223 
-323201.458136  7390240.298214 
-323185.757313  7390232.039628 
-323123.960061  7390196.745674 
-323090.249470  7390181.758241 
-323059.070472  7390168.820457 
-322995.706436  7390139.865417 
-322925.267133  7390105.031384 
-322856.872896  7390260.554744 
-322798.572046  7390389.432668 
-322755.221611  7390487.355895 
-322739.999069  7390519.570377 
-322711.079539  7390588.078642 
-322690.678364  7390635.530514 
-322670.310174  7390679.932908 
-322641.646277  7390670.614504 
-322530.198469  7390646.888569 
-322444.652073  7390633.340889 
-322363.896736  7390635.120584 
-322317.660121  7390639.379855 
-322264.521410  7390640.439673 
-322148.266051  7390644.878913 
-322026.708365  7390650.198002 
-321933.525958  7390643.989065 
-321842.132984  7390623.582561 
-321789.340616  7390583.729387 
-321619.608450  7390494.244715 
-321555.386806  7390480.057145 
-321373.722345  7390466.579454 
-321220.573349  7390471.788562 
-321087.479187  7390466.119533 
-320954.822074  7390460.620475 
-320891.309606  7390458.760793 
-320707.633064  7390460.790445 
-320736.816474  7390489.175583 
-320761.200579  7390516.360927 
-320776.398382  7390531.958255 
-320793.410355  7390535.337676 
-320878.437240  7390555.024304 
-320898.450841  7390566.862276 
-320914.242373  7390600.816460 
-320924.467699  7390629.651521 
-320936.968985  7390660.776190 
-320951.927647  7390682.132532 
-321029.780311  7390696.800019 
-321064.793806  7390702.978961 
-321093.548412  7390702.069117 
-321154.793167  7390664.825496 
-321187.712120  7390647.498464 
-321202.753245  7390642.259361 
-321218.750932  7390643.389168 
-321227.640369  7390645.238851 
-321239.036660  7390650.397967 
-321251.158619  7390662.955816 
-321258.398809  7390684.132189 
-321263.593934  7390714.377008 
-321266.686271  7390736.613200 
-321272.656542  7390757.269661 
-321281.240868  7390766.488082 
-321293.346335  7390780.055758 
-321330.042061  7390805.251442 
-321344.505950  7390808.660858 
-321359.769722  7390807.751014 
-321380.921304  7390800.012340 
-321401.042107  7390794.293319 
-321427.792879  7390785.574813 
-321449.109385  7390790.304003 
-321469.840409  7390808.510884 
-321479.067941  7390834.276471 
-321477.666082  7390855.142896 
-321474.466545  7390877.509065 
-321474.326359  7390898.115536 
-321482.547851  7390924.141078 
-321492.261910  7390953.975967 
-321492.187694  7390965.434005 
-321483.636353  7390987.410240 
-321476.536348  7390998.948264 
-321453.776752  7391046.600102 
-321437.366753  7391066.846634 
-321431.676854  7391082.583938 
-321433.589979  7391099.900972 
-321439.354094  7391113.428654 
-321459.549113  7391134.954967 
-321485.557725  7391161.340448 
-321495.082121  7391182.266863 
-321498.017779  7391198.074155 
-321494.109066  7391213.061588 
-321477.253770  7391235.417759 
-321469.337389  7391267.862201 
-321466.121359  7391293.547802 
-321479.496745  7391308.125305 
-321510.700482  7391357.716810 
-321521.280396  7391371.794399 
-321537.673902  7391392.260893 
-321559.443951  7391405.388644 
-321591.934100  7391413.507254 
-321610.479873  7391414.147144 
-321628.547364  7391410.957690 
-321684.077481  7391393.790631 
-321748.546513  7391367.525130 
-321795.014022  7391341.369610 
-321817.996267  7391324.482503 
-321839.955979  7391310.384918 
-321869.526962  7391297.097194 
-321894.447071  7391295.997382 
-321907.888427  7391301.936365 
-321924.850924  7391312.244599 
-321926.326999  7391319.383376 
-321931.818989  7391335.190669 
-321933.773345  7391347.678530 
-321936.412139  7391370.604603 
-321937.360456  7391376.423606 
-321948.121787  7391407.328312 
-321976.249679  7391420.496057 
-322011.279667  7391428.634663 
-322040.232183  7391431.894104 
-322059.759257  7391431.684140 
-322075.047769  7391433.403846 
-322106.507139  7391443.292152 
-322127.708198  7391466.588161 
-322135.740026  7391481.915536 
-322139.920865  7391502.821955 
-322141.363956  7391517.079513 
-322150.377086  7391536.476190 
-322164.189522  7391562.791683 
-322169.219723  7391570.200414 
-322226.712443  7391602.414896 
-322368.531118  7391684.830778 
-322422.972732  7391717.525178 
-322482.436301  7391757.128395 
-322548.703011  7391847.932841 
-322556.776071  7391855.881479 
-322567.908482  7391864.609984 
-322581.102451  7391869.279184 
-322662.278346  7391893.764990 
-322692.723429  7391904.153210 
-322706.420418  7391907.812584 
-322718.097081  7391909.932221 
-322733.360854  7391909.022376 
-322766.197344  7391902.633471 
-322799.091558  7391887.836005 
-322866.661172  7391863.280212 
-322906.746099  7391867.469494 
-322776.703042  7391931.958448 
-322650.156387  7391999.996793 
-322563.909060  7392044.009254 
-322555.448428  7392051.328001 
-322549.882222  7392055.577273 
-322537.908695  7392066.175458 
-322529.175937  7392079.143236 
-322489.643507  7392130.264480 
-322473.381940  7392157.059890 
-322449.302947  7392184.045268 
-322409.201527  7392233.856735 
-322367.079781  7392291.606843 
-322301.893328  7392374.662616 
-322394.119171  7392445.280520 
-322405.647402  7392453.929039 
-322421.793521  7392481.394334 
-322426.188762  7392503.430560 
-322424.720933  7392522.537287 
-322415.913959  7392544.573512 
-322402.678759  7392556.331498 
-322419.501069  7392592.515300 
-322361.060033  7392681.410073 
-322272.322345  7392799.509844 
-322163.966874  7392944.624987 
-322253.578662  7393013.393208 
-322182.619848  7393104.547594 
-322113.953485  7393197.501672 
-322046.054022  7393285.626577 
-322094.401672  7393384.509639 
-322023.187224  7393575.926851 
-322053.442644  7393586.944963 
-322078.090628  7393600.462648 
-322102.466486  7393618.809505 
-322121.762665  7393638.156191 
-322145.858151  7393666.661309 
-322171.487436  7393692.626861 
-322189.521943  7393709.693938 
-322216.957152  7393724.751359 
-322267.292144  7393743.938072 
-322325.782658  7393760.095304 
-322370.271072  7393773.443018 
-322410.224060  7393772.543172 
-322433.618616  7393774.642813 
-322461.342443  7393780.821754 
-322483.970100  7393790.020179 
-322499.473014  7393798.698692 
-322826.287627  7394000.014208 
-323037.861167  7394125.962635 
-323080.222053  7394152.618069 
-323100.408826  7394172.134726 
-323124.116739  7394203.979271 
-323146.868090  7394239.923114 
-323165.661249  7394282.015904 
-323167.590867  7394443.338271 
-323163.756370  7394483.771345 
-323177.948133  7394563.257730 
-323222.428301  7394645.443652 
-323287.581769  7394707.702988 
-323473.608486  7394605.060570 
-323620.498593  7394507.697247 
-323764.774644  7394415.293075 
-323920.364524  7394341.185769 
-324082.064861  7394268.028300 
-324226.274943  7394180.713256 
-324355.410914  7394115.694393 
-324464.236420  7394066.272859 
-324528.853884  7394033.938398 
-324801.466023  7393898.641573 
-324955.085053  7393817.965392 
-325104.440783  7393743.658120 
-325259.024623  7393666.531331 
-325304.519077  7393642.815393 
-325328.342437  7393628.687813 
-325401.313332  7393585.165268 
-325557.678358  7393478.933465 
-325739.614945  7393385.629447 
-325824.015115  7393303.113581 
-325908.184392  7393223.127282 
-325962.436343  7393151.369574 
-326011.122089  7393067.323970 
-326027.631042  7393017.592488 
-326043.702946  7392961.322127 
-326078.831889  7392865.948464 
-326131.203699  7392705.355972 
-326219.850679  7392496.851687 
-326270.564997  7392345.047689 
-326339.742626  7392211.080637 
-326424.423169  7392114.857119 
-Region 1
-333
-330962.266170  7402191.131144 
-331061.377616  7402270.787500 
-331095.888091  7402291.134015 
-331090.090991  7402315.249884 
-331091.006323  7402346.734491 
-331188.270613  7402388.417351 
-331261.381694  7402416.782492 
-331310.537475  7402445.847514 
-331327.211354  7402452.326404 
-331429.093533  7402492.159581 
-331448.752547  7402630.965805 
-331478.801812  7402691.455443 
-331466.143848  7402754.274683 
-331458.730486  7402813.554529 
-331474.480787  7402871.914532 
-331498.246423  7402921.656012 
-331524.485929  7402976.576605 
-331532.460034  7403055.783037 
-331522.647020  7403107.174234 
-331485.712153  7403184.620968 
-331479.073937  7403196.368956 
-331460.973461  7403232.442777 
-331410.712685  7403265.637091 
-331377.958657  7403299.421304 
-331343.126579  7403364.150217 
-331376.400119  7403369.349326 
-331399.283409  7403374.538437 
-331475.173470  7403403.653450 
-331483.493917  7403408.852560 
-331583.289800  7403464.992943 
-331590.562976  7403467.072587 
-331638.391113  7403506.575821 
-331665.422257  7403518.013861 
-331709.753993  7403522.123157 
-331767.898166  7403538.960273 
-331807.001791  7403550.838239 
-331857.947004  7403562.876177 
-331796.809450  7403685.145233 
-331602.618965  7404094.265155 
-331583.471217  7404163.593279 
-331659.171615  7404302.239531 
-331665.562443  7404318.656718 
-331660.086946  7404335.983750 
-331631.810621  7404376.116876 
-331604.499105  7404415.940055 
-331588.031383  7404438.146251 
-331615.392376  7404483.748440 
-331687.447939  7404555.806097 
-331704.781516  7404578.612190 
-331708.426350  7404603.237972 
-331701.128436  7404621.484847 
-331644.584033  7404697.181880 
-331647.313535  7404731.845943 
-331654.611449  7404750.092817 
-331623.787039  7404819.110995 
-331613.858577  7404874.261548 
-331623.597376  7404951.668289 
-331559.763304  7404992.721257 
-331531.478733  7405046.532040 
-331514.153402  7405076.636883 
-331466.712837  7405114.030478 
-331448.472175  7405128.627978 
-331415.643931  7405155.983292 
-331381.892109  7405176.049855 
-331368.203366  7405189.737510 
-331359.083035  7405196.126416 
-331260.573564  7405250.847043 
-331273.346975  7405361.218137 
-331288.849889  7405477.058295 
-331300.188456  7405584.699857 
-331252.442780  7405661.566690 
-331196.310688  7405779.746447 
-331181.038669  7405828.428108 
-331213.504079  7405848.474674 
-331243.083309  7405875.200097 
-331261.216770  7405910.524046 
-331253.580760  7405949.657343 
-331222.475978  7406007.887369 
-331211.953788  7406017.065796 
-331205.686653  7406036.152527 
-331209.496411  7406069.536809 
-331212.588748  7406103.351016 
-331204.993969  7406133.715815 
-331190.406387  7406148.723245 
-331165.230645  7406151.762724 
-331147.361063  7406150.782892 
-331116.536653  7406155.742042 
-331087.377981  7406159.841340 
-331052.397471  7406171.289379 
-331024.088161  7406189.456267 
-331002.516022  7406224.980182 
-330988.654108  7406249.076055 
-330984.036219  7406268.522724 
-330982.857008  7406300.067321 
-330983.846556  7406320.233866 
-330987.211018  7406358.497312 
-331011.149825  7406398.860398 
-331031.666447  7406428.215370 
-331050.979119  7406454.580854 
-331069.211535  7406477.496929 
-331092.383443  7406506.441971 
-331104.439433  7406524.968797 
-331110.838508  7406554.503738 
-331109.387171  7406583.388790 
-331102.353136  7406599.376052 
-331092.498891  7406638.689318 
-331034.536135  7406679.752284 
-331028.466910  7406701.088629 
-331022.397684  7406716.845930 
-331016.336704  7406727.014189 
-331011.537398  7406737.422406 
-331000.429726  7406754.699446 
-330970.899974  7406803.481091 
-330967.098461  7406817.958611 
-330965.333768  7406827.616956 
-330965.061642  7406839.814867 
-330963.033070  7406854.292387 
-330967.543758  7406866.740255 
-330971.312285  7406876.398600 
-331001.460504  7406943.467112 
-331032.128236  7406991.228931 
-331065.591440  7407031.632010 
-331074.654048  7407037.980923 
-331084.970082  7407043.569965 
-331090.758936  7407046.369486 
-331123.240839  7407056.777703 
-331160.258168  7407066.945961 
-331174.367469  7407070.755309 
-331181.673629  7407072.794959 
-331194.257377  7407080.673610 
-331200.796638  7407086.002697 
-331210.362265  7407097.690695 
-331245.070650  7407142.403036 
-331255.122805  7407163.239467 
-331261.142554  7407180.256552 
-331265.653242  7407199.823201 
-331269.149644  7407218.110068 
-331274.402493  7407256.993408 
-331285.452442  7407284.928623 
-331298.778350  7407299.416141 
-331333.750615  7407338.289483 
-331342.301956  7407351.497220 
-331347.068277  7407362.165393 
-331350.828558  7407376.142999 
-331352.815900  7407393.929952 
-331349.278267  7407606.333569 
-331345.979775  7407626.140176 
-331339.663162  7407646.466695 
-331330.311936  7407667.813038 
-331330.584062  7407693.118704 
-331306.571038  7407711.755511 
-331290.919693  7407735.391463 
-331268.729086  7407758.257546 
-331169.947489  7407845.912531 
-331158.006947  7407856.830661 
-331150.436907  7407862.169747 
-331142.380340  7407864.449356 
-331135.082426  7407864.199399 
-331126.770225  7407861.409877 
-331069.112581  7407837.523968 
-331057.774013  7407834.224533 
-331045.932426  7407833.464664 
-331030.314065  7407833.464664 
-331015.198725  7407836.004229 
-331104.323985  7407868.428675 
-331189.021020  7407898.183578 
-331282.211673  7408020.722588 
-331248.822685  7407998.686363 
-331218.946591  7407983.259005 
-331180.444941  7407965.991963 
-331128.040145  7407938.736632 
-331097.908418  7407923.049319 
-331066.275877  7407904.072569 
-331040.201296  7407890.444903 
-331019.734151  7407874.337662 
-331003.274675  7407866.109072 
-330991.119731  7407860.190086 
-330974.882903  7407855.500889 
-330960.402522  7407855.870826 
-330945.650015  7407857.010630 
-330927.640248  7407852.561393 
-330921.331881  7407846.432442 
-330908.195636  7407835.704280 
-330896.048938  7407828.015597 
-330874.996311  7407822.776494 
-330859.254257  7407821.116779 
-330836.841002  7407827.755642 
-330781.772674  7407853.821177 
-330739.914807  7407879.236823 
-330701.347186  7407907.721944 
-330660.940656  7407944.285681 
-330635.303125  7407976.420177 
-330606.548519  7408017.883074 
-330583.665229  7408055.606613 
-330561.746748  7408100.158981 
-330552.692386  7408123.085054 
-330546.606668  7408157.919088 
-330555.809462  7408185.564352 
-330567.345938  7408206.900697 
-330580.910988  7408229.766781 
-330588.431550  7408243.984345 
-330589.322143  7408261.441355 
-330584.638284  7408277.078677 
-330571.840134  7408290.866315 
-330548.923859  7408296.735310 
-330526.551835  7408299.064911 
-330504.204550  7408295.845462 
-330486.417431  7408296.195402 
-330461.983849  7408301.284530 
-330437.236911  7408315.992011 
-330409.867672  7408341.027723 
-330392.097044  7408356.515070 
-330240.828189  7408224.747640 
-330203.481011  7408095.399797 
-330076.678722  7408047.857940 
-329887.584407  7408032.160629 
-329861.534565  7408022.562273 
-329755.694194  7407912.351151 
-329734.105562  7407746.859498 
-329711.552122  7407558.751719 
-329701.986494  7407396.059587 
-329655.683909  7407211.001286 
-329552.152483  7407114.557806 
-329450.682615  7407025.213110 
-329388.398835  7406985.509911 
-329407.686769  7406899.454651 
-329454.244987  7406779.715161 
-329383.137740  7406646.318011 
-329214.873404  7406536.046900 
-329236.445543  7406403.389623 
-329193.894993  7406292.578603 
-329273.009330  7406255.844896 
-329319.814935  7406176.418501 
-329298.448951  7406044.821042 
-329196.203937  7405935.089838 
-329140.245016  7405808.731482 
-329009.657708  7405675.744262 
-328963.816912  7405575.761388 
-328976.582077  7405462.050865 
-329039.443093  7405364.537569 
-328997.964553  7405284.421292 
-328962.654193  7405198.186063 
-328946.433857  7405155.573362 
-328926.428502  7405021.656301 
-328928.399351  7404957.547282 
-328943.061149  7404891.598579 
-328932.761607  7404801.993927 
-329003.299864  7404667.796914 
-329112.999470  7404601.278308 
-329122.886701  7404542.128440 
-329142.669408  7404451.843905 
-329155.022262  7404393.733858 
-329160.802869  7404359.999637 
-329172.339346  7404293.061103 
-329200.360038  7404176.311101 
-329233.320222  7404134.288299 
-329279.466128  7404061.120832 
-329322.330035  7403989.513098 
-329353.640973  7403921.024829 
-329388.258649  7403840.078695 
-329406.383864  7403796.496160 
-329415.091884  7403718.499520 
-329421.383758  7403669.727874 
-329426.166571  7403645.502024 
-329421.218833  7403619.036557 
-329404.726372  7403545.869090 
-329400.809412  7403520.773389 
-329398.145880  7403488.278955 
-329399.803372  7403401.103887 
-329404.528462  7403363.310361 
-329409.154598  7403320.267733 
-329419.569587  7403225.204017 
-329434.396310  7403139.588682 
-329449.239525  7403049.304147 
-329451.070188  7403010.790744 
-329454.187263  7402979.256146 
-329445.941033  7402943.452279 
-329421.218833  7402899.869744 
-329376.722172  7402867.175344 
-329335.524004  7402848.498543 
-329299.248836  7402832.931210 
-329264.639406  7402812.694676 
-329230.029975  7402780.000276 
-329223.853549  7402773.411405 
-329206.948776  7402745.756142 
-329192.113807  7402686.606274 
-329180.577330  7402650.802407 
-329160.802869  7402600.990939 
-329083.337779  7402507.586938 
-329084.987025  7402448.437070 
-329086.603286  7402389.157224 
-329117.930716  7402376.709356 
-329126.160454  7402362.741749 
-329135.792052  7402360.532127 
-329156.226211  7402247.051566 
-329156.217965  7402247.021571 
-329156.993111  7402153.997505 
-329155.492297  7402107.145530 
-329155.541774  7402107.125534 
-329189.590460  7402107.985386 
-329351.340275  7402129.261742 
-329430.512335  7402142.879409 
-329653.548135  7402175.233867 
-329742.937275  7402188.001680 
-329759.108134  7402184.592264 
-329766.768882  7402176.933576 
-329799.118845  7402159.056638 
-329825.506783  7402146.288825 
-329845.091581  7402142.029555 
-329873.178242  7402139.479992 
-329902.122512  7402135.220721 
-329940.426253  7402113.084513 
-330000.879370  7402067.122386 
-330065.571050  7402024.559676 
-330100.477344  7402014.341427 
-330136.233000  7402010.932011 
-330175.386103  7402007.532593 
-330210.251166  7402002.603437 
-330245.413094  7402048.075648 
-330311.721034  7402142.179529 
-330356.531052  7402131.481362 
-330393.309240  7402119.443424 
-330422.072093  7402102.726287 
-330476.241582  7402053.904650 
-330495.636716  7402025.819461 
-330573.868707  7401959.580807 
-330672.856459  7402025.149575 
-330738.397500  7402065.942588 
-330778.523659  7402094.027777 
-330810.626235  7402116.773881 
-330885.526748  7402164.925633 
-330924.127353  7402187.021848 
-330962.266170  7402191.131144 
-Region 1
-127
-334118.939754  7394231.104625 
-334111.889227  7394211.348009 
-334096.361575  7394194.420908 
-334017.346193  7394184.542600 
-333978.968235  7394169.455185 
-333964.380653  7394155.307608 
-333961.288317  7394149.568591 
-333956.423041  7394117.764039 
-333992.211682  7393973.488752 
-334002.890550  7393905.390417 
-334024.149333  7393748.137353 
-334141.328270  7393692.396901 
-334231.410094  7393644.665077 
-334198.021106  7393539.693057 
-334176.102625  7393464.365960 
-334149.797149  7393365.672865 
-334209.607060  7393348.105874 
-334240.538671  7393340.567166 
-334277.960066  7393343.586649 
-334294.394804  7393193.372379 
-334304.578899  7393170.236342 
-334333.853017  7393138.121843 
-334342.288911  7393124.054252 
-334345.405986  7393111.826347 
-334356.241534  7393021.411834 
-334358.921558  7392996.776054 
-334409.743078  7392986.947738 
-334358.781373  7392719.923476 
-334329.218636  7392548.722802 
-334302.781220  7392415.995537 
-334278.537302  7392277.169316 
-334242.493028  7392080.962925 
-334230.239129  7391999.996793 
-334222.240286  7391954.644562 
-334214.373381  7391904.213200 
-334190.368604  7391790.992594 
-334185.717730  7391763.807250 
-334171.220856  7391678.751820 
-334144.321652  7391529.517382 
-334217.572919  7391529.127449 
-334304.100617  7391534.196581 
-334386.538185  7391537.016098 
-334443.264006  7391537.536009 
-334499.981580  7391540.285538 
-334563.617742  7391541.795279 
-334698.187980  7391544.164873 
-334778.341342  7391546.504472 
-334822.499907  7391510.330669 
-334894.209128  7391456.909819 
-334903.997404  7391469.507661 
-334905.861052  7391477.356317 
-334905.960007  7391487.764534 
-334902.026555  7391501.762136 
-334890.811681  7391525.448079 
-334847.098413  7391607.554015 
-334865.289598  7391646.467350 
-334874.360451  7391663.644407 
-334885.171260  7391677.002119 
-334901.540028  7391686.240537 
-334921.998926  7391696.968699 
-334934.788829  7391704.217458 
-334945.830532  7391715.535519 
-334957.688612  7391731.682753 
-334975.203606  7391752.839129 
-334998.062157  7391775.465254 
-335051.027697  7391808.749552 
-335095.936669  7391848.702709 
-335131.799526  7391900.913765 
-335124.600567  7391919.510580 
-335123.462587  7391929.908799 
-335125.375712  7391941.556804 
-335128.715436  7391953.004843 
-335133.490003  7391964.352899 
-335140.713701  7391975.401006 
-335150.172128  7391988.018845 
-335163.267142  7391999.996793 
-335195.567627  7392012.104719 
-335214.830822  7392024.232642 
-335229.756500  7392036.180595 
-335243.783338  7392054.467463 
-335252.499604  7392076.163747 
-335256.556749  7392092.071022 
-335259.409945  7392112.057598 
-335258.939910  7392131.334296 
-335254.198327  7392154.470333 
-335246.397393  7392176.896492 
-335307.592671  7392254.153259 
-335402.069735  7392293.756475 
-335448.933064  7392484.923730 
-335459.991259  7392506.380054 
-335471.016470  7392580.877294 
-335479.048298  7392610.312252 
-335492.431931  7392630.838736 
-335515.620331  7392649.565528 
-335540.639395  7392658.573985 
-335572.511077  7392680.160287 
-335750.646151  7392752.307929 
-335792.231892  7392676.400931 
-335876.599078  7392587.426172 
-335911.480634  7392640.397099 
-335951.697500  7392658.344024 
-336000.003920  7392682.359911 
-336050.833685  7392702.986378 
-336198.878264  7392779.573259 
-336232.209528  7392797.680157 
-336250.375974  7392774.524124 
-336259.067502  7392764.955763 
-336272.104792  7392762.346210 
-336290.370193  7392770.174869 
-336313.838965  7392782.352783 
-335608.637813  7394186.182320 
-335438.781954  7394195.670694 
-335375.846722  7394200.969787 
-335324.555167  7394205.758966 
-335270.806236  7394210.308187 
-335245.176951  7394213.087711 
-335209.413049  7394215.857237 
-334973.941933  7394238.813304 
-334784.418814  7394253.730749 
-334636.819531  7394264.608886 
-334542.111572  7394267.818336 
-334486.037204  7394270.827821 
-334405.347837  7394276.366872 
-334284.911638  7394282.485824 
-334135.778557  7394293.573924 
-334091.554022  7394278.196558 
-334118.939754  7394231.104625 
-Region 1
-215
-331327.862806  7384686.289565 
-331319.187771  7384674.861523 
-331315.105887  7384666.223002 
-331312.293922  7384658.094395 
-331311.007510  7384651.225571 
-331309.960239  7384636.988010 
-331303.058144  7384620.990750 
-331291.595883  7384608.292925 
-331279.366723  7384600.934186 
-331264.102950  7384595.865054 
-331246.546725  7384589.776097 
-331238.152063  7384588.776268 
-331226.871219  7384589.316176 
-331173.559338  7384590.615953 
-331133.119823  7384587.996402 
-331110.673583  7384591.295837 
-331079.643017  7384582.057419 
-331049.931848  7384570.169455 
-331023.527418  7384556.961718 
-331008.667710  7384541.744324 
-330981.554104  7384515.108887 
-330926.329097  7384461.768024 
-330852.599549  7384391.310092 
-330808.572923  7384437.992096 
-330766.442931  7384484.554121 
-330734.257893  7384542.284232 
-330714.483432  7384580.217734 
-330709.007934  7384634.318467 
-330708.381221  7384657.404513 
-330698.221865  7384683.809990 
-330675.157158  7384710.995333 
-330663.686651  7384736.620944 
-330647.441576  7384758.967116 
-330612.906363  7384789.441896 
-330570.256858  7384819.246791 
-330425.832374  7384829.315066 
-330392.863944  7384795.100927 
-330310.863426  7384688.119252 
-330249.181621  7384620.310867 
-330175.551028  7384554.312172 
-330143.192819  7384521.797741 
-330124.597569  7384506.320392 
-330057.093924  7384449.200176 
-330057.069186  7384440.811613 
-330059.328653  7384425.564225 
-329971.028015  7384398.708825 
-329906.138426  7384377.682427 
-329922.787566  7384308.784228 
-329743.159924  7384265.761598 
-329707.280574  7384257.922940 
-329689.732595  7384253.363721 
-329671.912491  7384245.495069 
-329654.587160  7384233.317155 
-329634.210724  7384217.579851 
-329618.930459  7384204.892024 
-329603.641947  7384188.894764 
-329591.643682  7384166.528596 
-329579.769110  7384127.995196 
-329502.007155  7384108.668506 
-329479.610392  7384100.059981 
-329437.092827  7384158.389990 
-329418.192466  7384185.275384 
-329325.240955  7384299.225866 
-329294.177404  7384337.399327 
-329237.336136  7384404.307866 
-329207.138439  7384433.322896 
-329185.698240  7384455.779050 
-329163.969422  7384467.667013 
-329141.663368  7384482.744431 
-329115.720726  7384500.771343 
-329067.719418  7384537.415066 
-329045.223700  7384559.041362 
-329029.423923  7384586.256700 
-328985.356066  7384745.199474 
-328971.403444  7384809.698426 
-328955.578927  7384871.227887 
-328935.524094  7384944.955258 
-328879.532188  7385055.116388 
-328846.736929  7385106.097656 
-328806.643755  7385165.677450 
-328750.503417  7385241.284500 
-328667.909171  7385322.490590 
-328566.142439  7385405.706336 
-328512.203844  7385445.219567 
-328429.551874  7385503.209634 
-328387.248711  7385548.991792 
-328337.119875  7385595.063900 
-328313.519163  7385621.769326 
-328175.370061  7385781.361989 
-328138.723812  7385865.967497 
-328098.490452  7385935.395605 
-328019.277161  7386040.087672 
-327884.583229  7386123.873320 
-327894.701354  7386139.360667 
-327991.000836  7386281.996235 
-328025.865899  7386341.556033 
-328128.993260  7386509.677235 
-328178.379935  7386588.683702 
-328211.430827  7386641.564644 
-328241.199720  7386687.776729 
-328296.738083  7386789.989220 
-328306.880947  7386804.066809 
-328330.729046  7386841.340424 
-328374.046496  7386909.598732 
-328382.738023  7386930.095222 
-328389.293776  7386938.503781 
-328421.676724  7386987.615369 
-328439.076271  7387008.751748 
-328457.770475  7387042.865905 
-328513.836598  7387125.711714 
-328526.074004  7387145.348351 
-328577.736639  7387228.914037 
-328638.033077  7387326.757277 
-328666.828915  7387377.298620 
-328702.716511  7387423.980623 
-328760.959638  7387523.133639 
-328788.295892  7387567.316071 
-328803.435972  7387598.610711 
-328813.446896  7387623.056524 
-328817.396840  7387632.704871 
-328849.491170  7387736.157150 
-328887.242414  7387852.937147 
-328910.711186  7387936.482836 
-328923.113517  7387969.287217 
-328929.636285  7387999.342069 
-328960.468942  7388116.581987 
-328983.261523  7388096.585412 
-329006.243768  7388077.138743 
-329034.149013  7388047.893753 
-329066.350543  7387999.981960 
-329136.212609  7387890.930639 
-329174.508105  7387845.418435 
-329225.700704  7387805.805220 
-329274.023616  7387773.140816 
-329328.267321  7387745.315582 
-329406.383864  7387707.422073 
-329432.969712  7387693.814403 
-329464.725946  7387678.197079 
-329557.446563  7387656.030875 
-329605.571565  7387620.936887 
-329652.805975  7387578.354181 
-329740.587100  7387502.307207 
-329829.761838  7387433.409008 
-329924.271887  7387362.961076 
-329956.506403  7387349.743340 
-329998.760089  7387334.725912 
-330042.836192  7387321.478181 
-330169.918852  7387293.382994 
-330213.376488  7387275.576044 
-330273.763635  7387267.907357 
-330296.300583  7387258.418983 
-330329.516400  7387242.991625 
-330386.456623  7387212.146909 
-330400.697863  7387206.217924 
-330438.663509  7387188.420973 
-330461.398367  7387176.463021 
-330497.970400  7387158.766052 
-330537.898649  7387136.099935 
-330579.360696  7387112.563966 
-330604.651886  7387098.216424 
-330661.105581  7387069.981260 
-330713.328959  7387041.756095 
-330829.064806  7386983.886008 
-330867.178885  7386966.948909 
-330923.632580  7386938.713745 
-331030.907794  7386882.263415 
-331124.057215  7386818.744295 
-331217.528240  7386677.328518 
-331248.616529  7386628.186936 
-331281.733392  7386579.725237 
-331296.337466  7386507.677578 
-331401.534630  7386315.070570 
-331420.063911  7386283.825922 
-331425.654855  7386259.310121 
-331437.958231  7386236.634005 
-331477.391706  7386135.751286 
-331520.890573  7386027.819773 
-331532.583728  7386000.004538 
-331574.952861  7385925.147360 
-331633.352666  7385827.404103 
-331652.566384  7385819.065531 
-331678.756412  7385816.755927 
-331707.486280  7385817.225846 
-331739.778519  7385812.116721 
-331764.690382  7385802.938293 
-331796.702249  7385789.180650 
-331839.137352  7385769.574008 
-331875.989757  7385756.566236 
-331915.142860  7385752.456940 
-331944.647873  7385754.706555 
-331959.268440  7385691.917310 
-331875.239350  7385635.317005 
-331795.292144  7385585.325568 
-331762.966920  7385558.640139 
-331778.214200  7385532.784568 
-331747.678408  7385525.655789 
-331744.511855  7385501.759882 
-331743.893388  7385443.299896 
-331745.888976  7385424.493118 
-331750.680036  7385406.686168 
-331756.510121  7385393.208476 
-331761.573307  7385382.030391 
-331765.869593  7385372.871960 
-331778.750205  7385263.280732 
-331758.992237  7385236.125383 
-331803.101324  7385161.358190 
-331709.770486  7385139.571922 
-331677.387538  7385122.604828 
-331693.220301  7385024.471638 
-331657.398675  7384938.176419 
-331594.347995  7384798.100413 
-331582.094097  7384771.934895 
-331544.103712  7384721.903465 
-331394.616043  7384702.736748 
-331327.862806  7384686.289565 
-Region 1
-286
-325879.528740  7381254.317431 
-325957.455620  7381110.702031 
-326015.063787  7381010.379215 
-326026.781681  7380969.316249 
-326080.019346  7380893.309268 
-326145.007889  7380773.469796 
-326208.272971  7380669.007689 
-326278.835967  7380552.007730 
-326364.720459  7380407.382503 
-326385.385513  7380376.507792 
-326428.035018  7380327.926113 
-326445.434564  7380311.208977 
-326561.021979  7380179.021619 
-326675.685817  7380053.003205 
-326748.689696  7379969.697475 
-326793.458483  7379907.108196 
-326813.216451  7379879.312957 
-326880.777819  7379773.461088 
-326932.621871  7379685.686123 
-326984.548385  7379590.942352 
-326999.944098  7379561.767349 
-326999.952344  7379561.767349 
-327025.037378  7379514.225493 
-327068.429044  7379424.920790 
-327118.442432  7379338.095662 
-327157.546058  7379281.435368 
-327203.477563  7379218.856087 
-327252.311741  7379143.678964 
-327404.899993  7378894.401663 
-327454.839165  7378812.035772 
-327465.369602  7378792.669089 
-327530.655010  7378682.148020 
-327583.430886  7378590.603701 
-327727.129701  7378367.911846 
-327782.272246  7378289.275316 
-327831.972278  7378213.318327 
-327931.957824  7378116.364934 
-328011.014438  7378053.305735 
-328064.953032  7378021.691151 
-328171.106759  7377971.119813 
-328187.252879  7378037.428455 
-328188.184703  7378053.835644 
-328195.507356  7378089.689503 
-328196.736044  7378124.263581 
-328230.710515  7378149.259299 
-328258.830161  7378151.468921 
-328286.982792  7378151.248958 
-328300.580827  7378156.838001 
-328307.416952  7378165.116583 
-328324.173293  7378179.934045 
-328332.724634  7378198.860803 
-328346.718487  7378222.726715 
-328355.764602  7378234.354723 
-328383.133842  7378282.746434 
-328416.209473  7378349.924927 
-328417.710287  7378369.661546 
-328414.312840  7378389.548140 
-328409.505287  7378398.796556 
-328398.422353  7378413.404054 
-328390.712128  7378427.481642 
-328385.698420  7378446.148445 
-328385.046967  7378466.624937 
-328390.621419  7378477.992990 
-328403.716434  7378492.210555 
-328413.818066  7378500.419149 
-328442.943753  7378512.947003 
-328472.316826  7378521.705503 
-328488.825780  7378522.565355 
-328509.655759  7378520.925636 
-328526.445084  7378515.476570 
-328546.376224  7378512.057155 
-328572.285880  7378511.257292 
-328591.755231  7378512.377100 
-328610.045371  7378518.236097 
-328626.034812  7378520.635686 
-328645.594871  7378522.535360 
-328665.699181  7378521.665509 
-328679.214753  7378517.166280 
-328690.396642  7378511.427263 
-328728.040685  7378501.908894 
-328749.959166  7378503.048698 
-328761.561612  7378505.068352 
-328773.254767  7378508.197816 
-328783.348154  7378517.396241 
-328800.525052  7378530.893929 
-328818.765714  7378540.852223 
-328834.647955  7378552.010312 
-328870.923123  7378589.313922 
-328900.725001  7378613.589764 
-328964.707504  7378690.456597 
-329001.518678  7378733.069298 
-329024.212305  7378754.705592 
-329041.653083  7378763.444095 
-329060.998740  7378766.773525 
-329094.552652  7378767.053477 
-329130.844313  7378768.253271 
-329156.011809  7378770.432898 
-329180.371175  7378771.832658 
-329197.844937  7378778.011600 
-329217.050408  7378792.529113 
-329239.323477  7378806.856659 
-329248.955075  7378811.955785 
-329260.574014  7378820.844263 
-329270.164380  7378829.482783 
-329275.912003  7378835.311785 
-329282.401786  7378847.239742 
-329296.321424  7378860.467476 
-329317.217372  7378876.654703 
-329332.406929  7378888.252716 
-329343.770235  7378901.890380 
-329345.526682  7378908.999163 
-329349.756998  7378921.896953 
-329351.983481  7378932.005222 
-329359.809153  7378938.174165 
-329365.828902  7378942.913354 
-329377.728213  7378946.262780 
-329385.809519  7378952.891644 
-329396.933684  7378961.110237 
-329425.746014  7378982.936498 
-329443.681565  7378992.674830 
-329467.562649  7379000.703455 
-329481.193669  7379008.162177 
-329507.993918  7379022.659694 
-329528.254907  7379034.637642 
-329548.235524  7379052.934508 
-329626.954041  7379150.877731 
-329661.192391  7379206.098272 
-329689.740842  7379269.147473 
-329721.101257  7379307.260944 
-329733.487095  7379341.785030 
-329779.665987  7379409.203482 
-329742.797090  7379405.704082 
-329694.820520  7379402.474635 
-329696.733645  7379593.821859 
-329733.231462  7379677.157584 
-329742.764105  7379707.312419 
-329744.339135  7379733.497934 
-329737.197899  7379777.150456 
-329718.940744  7379843.019174 
-329713.927036  7379883.322270 
-329718.083136  7379921.505730 
-329737.049467  7379963.918465 
-329753.863531  7380006.511169 
-329760.600702  7380050.693601 
-329761.870621  7380082.318184 
-329758.852501  7380112.962935 
-329754.292335  7380135.069148 
-329696.923308  7380173.192618 
-329683.721093  7380175.482226 
-329676.357209  7380182.341051 
-329659.271019  7380257.218225 
-329658.133040  7380306.869720 
-329664.779501  7380404.852937 
-329661.489255  7380461.653207 
-329662.767421  7380489.858376 
-329679.103204  7380580.032930 
-329686.821676  7380620.795947 
-329697.112972  7380660.899078 
-329732.217176  7380843.877736 
-329710.142016  7380875.142380 
-329687.547344  7380892.679376 
-329650.488784  7380917.065199 
-329620.794107  7380932.072629 
-329614.964022  7380936.901801 
-329607.847525  7380941.221062 
-329602.767847  7380946.040236 
-329600.236254  7380952.649104 
-329601.003154  7380959.008015 
-329642.671357  7381039.574214 
-329646.992382  7381044.913300 
-329655.106673  7381055.841428 
-329670.856973  7381068.289296 
-329693.971158  7381077.947641 
-329726.222166  7381088.115900 
-329775.081083  7381096.814410 
-329824.731637  7381105.662894 
-329874.118313  7381130.918568 
-329902.592547  7381164.902747 
-329837.521541  7381215.983997 
-329802.120473  7381234.770779 
-329767.659475  7381263.465864 
-329744.660738  7381286.411933 
-329687.522606  7381362.958822 
-329568.009985  7381399.402579 
-329550.725885  7381403.341904 
-329542.347715  7381403.531872 
-329530.662806  7381406.751320 
-329513.601355  7381414.489995 
-329438.206068  7381454.573129 
-329408.412437  7381469.850512 
-329391.837513  7381480.388707 
-329366.092781  7381497.975694 
-329359.883369  7381514.702829 
-329357.541440  7381523.071396 
-329356.147827  7381539.818527 
-329352.222621  7381556.555660 
-329344.768029  7381569.973362 
-329325.842929  7381590.649820 
-329308.261966  7381601.697928 
-329261.398637  7381625.233896 
-329247.182135  7381627.153567 
-329239.306985  7381627.353533 
-329230.417548  7381629.313198 
-329222.278519  7381631.292858 
-329083.642889  7381717.128156 
-329049.239615  7381736.944761 
-328991.911819  7381769.789135 
-328883.399670  7381828.159137 
-328829.213689  7381990.991245 
-328826.179076  7381999.999702 
-328820.992197  7382012.417575 
-328781.410290  7382150.953845 
-328751.567181  7382256.175822 
-328741.119207  7382316.055565 
-328737.020830  7382404.470420 
-328732.996669  7382451.392383 
-328728.857062  7382520.550537 
-328726.721288  7382559.933791 
-328721.237545  7382631.551523 
-328718.722444  7382658.206957 
-328716.998982  7382680.053215 
-328707.870405  7382793.563772 
-328704.299787  7382847.684502 
-328692.433461  7383035.912260 
-328691.707793  7383059.538213 
-328689.101984  7383095.602036 
-328691.946933  7383172.638840 
-328699.376787  7383193.295302 
-328723.958801  7383228.089342 
-328673.046573  7383210.022436 
-328636.491032  7383208.842638 
-328582.552438  7383233.858353 
-328576.499704  7383239.557377 
-328545.056827  7383269.132311 
-328488.908242  7383300.047016 
-328432.767904  7383315.324399 
-328402.867072  7383323.223046 
-328346.932889  7383334.361138 
-328248.423418  7383356.857285 
-328155.051348  7383375.564081 
-328109.260030  7383384.292585 
-328069.216334  7383385.992294 
-328042.449069  7383379.913336 
-328011.806076  7383355.327547 
-327999.997474  7383347.198939 
-327927.282212  7383286.069410 
-327811.620581  7383190.605762 
-327745.650735  7383142.234048 
-327693.617020  7383109.169712 
-327666.833263  7383082.854219 
-327554.593818  7383012.766225 
-327458.129411  7382945.517744 
-327405.493721  7382905.344625 
-327378.330637  7382888.947434 
-327277.800840  7382820.989074 
-327180.528303  7382767.468242 
-326932.926982  7382626.382409 
-326804.425969  7382556.034459 
-326755.286681  7382529.538997 
-326669.756777  7382480.637373 
-326665.419259  7382478.457747 
-326647.788818  7382470.839052 
-326564.427673  7382431.355815 
-326508.947033  7382405.470249 
-326423.458360  7382375.945306 
-326316.141914  7382347.000264 
-326243.286466  7382331.292955 
-326198.039399  7382307.826974 
-326137.462588  7382245.847591 
-326083.862089  7382197.585858 
-326039.142780  7382157.762679 
-325970.863991  7382108.621096 
-325902.032703  7382037.573266 
-325874.432569  7382009.048152 
-325833.869361  7381960.826412 
-325819.331256  7381952.747796 
-325775.716942  7381892.528111 
-325723.848152  7381832.018476 
-325675.096436  7381885.109382 
-325574.863503  7381821.520274 
-325612.095234  7381743.983556 
-325652.963553  7381670.716106 
-325703.438731  7381579.161788 
-325759.694516  7381481.598500 
-325804.496287  7381395.073321 
-325879.528740  7381254.317431 
-Region 1
-578
-321543.207123  7387086.988347 
-321457.932852  7387072.140890 
-321409.791358  7387175.963107 
-321404.431308  7387191.660418 
-321405.429102  7387203.348416 
-321378.373219  7387312.749676 
-321346.419075  7387518.064508 
-321356.900034  7387580.773766 
-321356.908280  7387580.773766 
-321356.900034  7387580.793763 
-321356.908280  7387580.823758 
-321356.891788  7387580.823758 
-321345.033708  7387624.826220 
-321252.956297  7387801.076030 
-321227.549660  7387861.845621 
-321226.189032  7387856.726498 
-321225.801459  7387846.208300 
-321224.548032  7387832.230694 
-321224.943851  7387816.623367 
-321223.352329  7387804.855383 
-321220.944430  7387801.176013 
-321214.891696  7387795.456993 
-321203.932456  7387790.667813 
-321192.123853  7387787.638332 
-321183.110723  7387782.099281 
-321174.584121  7387778.119963 
-321161.406644  7387770.651242 
-321149.482595  7387761.422823 
-321125.675727  7387738.206799 
-321114.972119  7387728.768416 
-321104.763286  7387721.109728 
-321091.618794  7387710.651519 
-321078.680458  7387700.743217 
-321057.199028  7387687.525481 
-321040.871491  7387679.236900 
-321039.873697  7387679.106923 
-321028.650577  7387677.427210 
-321006.979483  7387679.596839 
-320987.031851  7387683.776123 
-320970.019877  7387689.105210 
-320947.252034  7387697.913701 
-320936.903015  7387701.663059 
-320929.728794  7387704.012657 
-320924.096619  7387705.382422 
-320914.176403  7387707.032139 
-320907.562926  7387705.732362 
-320899.003339  7387704.192626 
-320884.621913  7387694.924213 
-320872.706109  7387684.815945 
-320861.854070  7387670.948320 
-320846.878915  7387651.711615 
-320835.218745  7387637.394068 
-320822.321640  7387623.826392 
-320807.948460  7387614.128053 
-320791.126150  7387604.399719 
-320768.176890  7387594.591399 
-320740.749926  7387583.953222 
-320715.203104  7387570.455534 
-320685.854769  7387557.917681 
-320661.924208  7387545.319839 
-320648.276696  7387534.971612 
-320634.134410  7387522.833691 
-320620.552869  7387506.716452 
-320599.401287  7387475.661771 
-320581.210102  7387452.735698 
-320567.133786  7387435.728611 
-320555.028320  7387424.060610 
-320543.607290  7387414.942172 
-320532.697527  7387405.723751 
-320521.713548  7387394.625652 
-320504.734559  7387380.908001 
-320481.777053  7387363.341010 
-320467.016300  7387352.422881 
-320457.747537  7387342.224628 
-320441.518955  7387325.967412 
-320426.890142  7387312.269759 
-320413.531248  7387303.131324 
-320405.235540  7387296.942384 
-320400.914515  7387291.463322 
-320398.951912  7387285.124408 
-320397.170727  7387272.366594 
-320395.711144  7387249.860449 
-320394.589656  7387233.453259 
-320394.070144  7387225.914550 
-320391.340642  7387190.660589 
-320388.685355  7387179.542494 
-320387.539129  7387175.553177 
-320380.381401  7387160.065830 
-320371.508457  7387143.348693 
-320364.820764  7387123.172149 
-320358.743292  7387102.315722 
-320352.970930  7387073.670628 
-320345.714247  7387041.566128 
-320337.459770  7387015.550584 
-320334.581836  7387009.201671 
-320329.683575  7387002.942743 
-320326.145942  7386998.353530 
-320311.533621  7386982.996160 
-320290.439763  7386963.469505 
-320271.943468  7386949.281935 
-320260.910011  7386942.053173 
-320244.582475  7386933.324668 
-320238.018475  7386927.595650 
-320222.969104  7386915.227768 
-320203.433784  7386901.590104 
-320179.198112  7386881.013629 
-320154.517144  7386862.876735 
-320138.024682  7386851.158743 
-320125.803768  7386841.260438 
-320113.690056  7386830.372303 
-320103.720363  7386819.164223 
-320098.426283  7386810.135770 
-320092.497243  7386794.438458 
-320086.263093  7386778.641164 
-320078.412681  7386761.044178 
-320070.743686  7386745.766795 
-320060.345190  7386728.029834 
-320048.833452  7386710.272875 
-320038.401970  7386695.525401 
-320022.956780  7386673.079246 
-320010.208107  7386655.862195 
-320000.254907  7386644.214190 
-319989.040033  7386634.995769 
-319969.348034  7386617.918695 
-319957.226075  7386608.020390 
-319934.359278  7386591.573207 
-319930.516534  7386587.963826 
-319920.942661  7386578.995362 
-319914.428138  7386569.387008 
-319908.705254  7386553.149789 
-319901.629988  7386531.573485 
-319894.315582  7386511.986840 
-319887.941245  7386490.870457 
-319883.562497  7386482.061966 
-319877.039729  7386473.123497 
-319871.209643  7386466.184685 
-319858.411494  7386452.617009 
-319845.316479  7386438.499427 
-319825.649219  7386419.762637 
-319808.101240  7386403.155482 
-319790.643970  7386386.768289 
-319775.792509  7386374.840332 
-319768.049298  7386365.551923 
-319762.746972  7386356.623452 
-319758.120836  7386351.034409 
-319749.635465  7386344.285565 
-319729.242537  7386325.978701 
-319713.228357  7386309.381544 
-319703.778176  7386297.523575 
-319697.791413  7386286.485466 
-319688.860745  7386274.417533 
-319677.777811  7386254.230991 
-319667.032973  7386231.834827 
-319657.871410  7386213.887901 
-319647.819255  7386193.051471 
-319639.267914  7386174.554639 
-319631.269070  7386161.496876 
-319626.708905  7386150.478763 
-319621.480795  7386136.011241 
-319617.019584  7386125.553032 
-319608.394027  7386113.145158 
-319605.103780  7386104.366661 
-319599.405635  7386088.999294 
-319590.408997  7386074.051854 
-319586.492038  7386065.673289 
-319583.943953  7386060.014259 
-319572.382737  7386037.498115 
-319562.907818  7386019.881133 
-319556.500497  7386001.854221 
-319547.083302  7385979.478054 
-319534.598508  7385957.501818 
-319521.198384  7385943.264257 
-319507.352962  7385924.377492 
-319493.532280  7385903.161126 
-319481.698939  7385894.262650 
-319466.377442  7385887.543801 
-319409.082632  7385866.227452 
-319382.340106  7385858.038855 
-319368.766810  7385850.440157 
-319346.864822  7385838.432214 
-319316.337276  7385823.544764 
-319285.199509  7385807.877447 
-319262.456405  7385798.399071 
-319223.930015  7385786.511107 
-319211.651378  7385781.152025 
-319206.382036  7385777.982568 
-319199.422218  7385771.363702 
-319193.410715  7385762.545212 
-319179.260184  7385734.450025 
-319170.634626  7385722.492073 
-319159.213597  7385713.603596 
-319143.488035  7385705.984901 
-319118.609157  7385696.486528 
-319092.311928  7385685.638386 
-319080.066275  7385677.619759 
-319066.064176  7385670.470984 
-319037.227107  7385659.142924 
-319010.492827  7385650.504404 
-318997.274120  7385646.905020 
-318980.270392  7385635.736933 
-318952.488841  7385604.372306 
-318937.711596  7385589.764808 
-318923.420878  7385576.157139 
-318892.810870  7385560.509819 
-318839.746375  7385519.006928 
-318816.087940  7385502.549747 
-318798.539961  7385494.471131 
-318778.889193  7385482.373203 
-318774.180596  7385475.334409 
-318769.513229  7385464.756221 
-318756.063627  7385414.304863 
-318748.411125  7385389.289148 
-318737.402407  7385355.474940 
-318729.411809  7385325.250117 
-318723.532247  7385305.903431 
-318714.552102  7385277.788247 
-318703.881479  7385244.403965 
-318695.338384  7385217.498574 
-318685.995405  7385189.753326 
-318673.263225  7385163.277861 
-318668.595858  7385144.501078 
-318667.474371  7385128.093888 
-318669.214326  7385111.286767 
-318677.691451  7385094.439653 
-318683.208179  7385077.562544 
-318688.469274  7385064.674751 
-318689.871133  7385050.067253 
-318688.395058  7385037.749363 
-318683.208179  7385028.270987 
-318669.049401  7385017.572819 
-318651.229297  7385006.274755 
-318638.571333  7384998.586072 
-318620.644027  7384988.067873 
-318606.105923  7384975.260067 
-318573.261186  7384957.793059 
-318562.978136  7384947.804770 
-318543.154198  7384933.487222 
-318515.364401  7384919.849558 
-318495.235352  7384905.761972 
-318484.589468  7384899.862982 
-318472.492247  7384888.414943 
-318449.303847  7384857.560228 
-318434.955405  7384845.862232 
-318422.231472  7384843.152696 
-318408.072694  7384841.313011 
-318387.119021  7384836.073908 
-318372.910766  7384829.355059 
-318365.637591  7384823.726024 
-318359.114822  7384814.567592 
-318348.073119  7384800.250045 
-318337.773577  7384791.371566 
-318320.440000  7384773.764581 
-318298.191670  7384765.735957 
-318287.339631  7384760.836796 
-318273.527194  7384755.567698 
-318259.772482  7384753.957974 
-318244.879789  7384752.998139 
-318226.597896  7384754.427894 
-318211.870128  7384757.457375 
-318195.831209  7384758.917125 
-318172.271728  7384757.847308 
-318153.000287  7384756.167596 
-318137.307710  7384754.757837 
-318098.146361  7384744.299629 
-318073.861212  7384736.460971 
-318056.420434  7384727.162564 
-318043.366651  7384718.694015 
-318034.485460  7384710.825362 
-318016.121105  7384693.988246 
-317990.730961  7384676.501242 
-317978.881127  7384669.042519 
-317962.471128  7384659.094223 
-317949.417345  7384650.395713 
-317936.610949  7384638.607733 
-317928.043115  7384629.969212 
-317925.833125  7384619.091076 
-317920.761693  7384600.304294 
-317916.737533  7384587.406503 
-317912.614418  7384574.288750 
-317908.400594  7384560.611093 
-317903.254946  7384547.363362 
-317900.723353  7384538.024962 
-317893.648087  7384528.336621 
-317891.990595  7384526.067010 
-317873.923103  7384510.229723 
-317858.461421  7384506.600344 
-317838.670467  7384506.130425 
-317815.086248  7384507.380211 
-317802.114927  7384508.000105 
-317785.375079  7384508.560009 
-317770.705034  7384506.720324 
-317754.822794  7384495.662218 
-317739.723946  7384486.943711 
-317725.095133  7384473.695981 
-317714.325555  7384461.488072 
-317697.800109  7384445.110877 
-317685.158638  7384435.872459 
-317670.933890  7384414.536114 
-317660.419946  7384398.568849 
-317646.896127  7384378.792237 
-317636.093565  7384369.013912 
-317628.094722  7384364.374706 
-317617.704471  7384362.804975 
-317608.881004  7384358.705677 
-317601.088316  7384345.207989 
-317596.132332  7384333.519991 
-317591.201086  7384320.162279 
-317583.268212  7384301.345503 
-317574.782840  7384286.178101 
-317569.365067  7384270.930712 
-317561.646595  7384251.893973 
-317551.083174  7384223.518834 
-317549.137063  7384207.651552 
-317550.967726  7384183.865626 
-317554.596068  7384171.057820 
-317554.431143  7384159.649774 
-317551.850073  7384137.683536 
-317548.493857  7384120.476484 
-317543.801752  7384103.799340 
-317538.342747  7384091.881382 
-317528.645180  7384075.924115 
-317522.641924  7384066.435741 
-317512.936111  7384051.248342 
-317497.614614  7384036.210918 
-317478.747238  7384018.803899 
-317479.868726  7384010.735282 
-317483.002293  7383997.147609 
-317486.902760  7383986.569421 
-317490.300207  7383976.311178 
-317491.124831  7383967.232733 
-317490.258976  7383955.374764 
-317486.490449  7383946.686253 
-317477.081500  7383931.728815 
-317468.505420  7383923.870161 
-317447.881597  7383908.982711 
-317428.634895  7383897.894610 
-317412.645453  7383878.857871 
-317385.680279  7383856.371723 
-317350.155518  7383833.775593 
-317323.256313  7383813.829010 
-317300.158621  7383792.602646 
-317273.696467  7383770.896364 
-317251.283212  7383751.789637 
-317226.099224  7383734.082670 
-317173.496518  7383697.978854 
-317164.219509  7383680.471853 
-317156.905102  7383653.576460 
-317154.777575  7383636.379405 
-317156.047494  7383616.452819 
-317157.902896  7383598.865831 
-317161.910564  7383580.418991 
-317168.713705  7383558.352771 
-317177.025905  7383538.746129 
-317188.298503  7383502.002423 
-317193.081316  7383478.576435 
-317194.450191  7383467.408348 
-317193.930678  7383443.702409 
-317192.652512  7383423.525865 
-317190.648678  7383412.087824 
-317221.110254  7383420.606365 
-317238.122228  7383429.594826 
-317262.333161  7383442.092685 
-317280.309944  7383465.178730 
-317294.922265  7383484.015504 
-317304.100319  7383511.180851 
-317309.913912  7383533.716990 
-317316.873731  7383555.513257 
-317326.142494  7383575.049910 
-317336.120433  7383599.165780 
-317349.941116  7383619.912226 
-317366.062497  7383639.918799 
-317388.673661  7383658.105684 
-317412.826871  7383674.042954 
-317440.097155  7383684.681132 
-317463.986485  7383691.839905 
-317489.038534  7383697.498936 
-317511.591975  7383689.800255 
-317546.028234  7383675.022786 
-317598.482507  7383650.576973 
-317655.216574  7383617.812586 
-317678.174080  7383608.974100 
-317699.630772  7383597.066139 
-317713.319515  7383597.626043 
-317780.468571  7383493.423892 
-317803.079736  7383480.766060 
-317830.383006  7383458.659847 
-317874.129259  7383429.914771 
-318064.023459  7383350.338402 
-318091.763778  7383349.308578 
-318114.869717  7383352.717994 
-318153.758940  7383347.518884 
-318181.548738  7383347.118953 
-318220.998705  7383326.242529 
-318242.546106  7383315.654343 
-318266.996180  7383303.666396 
-318315.112935  7383290.968571 
-318344.354069  7383275.421234 
-318351.091240  7383263.373298 
-318359.609596  7383257.084375 
-318372.251068  7383253.944913 
-318427.838908  7383254.834760 
-318451.043801  7383255.764601 
-318474.792946  7383250.185557 
-318490.510261  7383245.586345 
-318504.363929  7383239.417401 
-318527.403897  7383231.178812 
-318560.792885  7383202.573712 
-318611.721606  7383154.102015 
-318650.280980  7383117.658258 
-318638.406408  7383137.614839 
-318631.133233  7383156.891537 
-318619.440078  7383203.153613 
-318645.910478  7383228.929198 
-318660.761939  7383246.046266 
-318688.551737  7383281.010277 
-318683.488551  7383320.183567 
-318672.380878  7383391.631328 
-318734.763613  7383361.396507 
-318776.308123  7383342.899676 
-318883.072071  7383280.820309 
-318902.821794  7383271.801854 
-318961.386524  7383258.654106 
-319005.973893  7383257.764259 
-319035.379951  7383254.244861 
-319056.119221  7383246.706153 
-319065.602387  7383231.288794 
-319096.773139  7383199.964159 
-319115.558052  7383194.285132 
-319137.047729  7383169.989294 
-319161.778175  7383137.004944 
-319171.739621  7383117.008369 
-319182.261812  7383089.413096 
-319252.132124  7383064.687331 
-319310.498944  7383043.151020 
-319350.039620  7383029.563347 
-319418.318410  7383007.857065 
-319466.369196  7382988.360405 
-319527.011976  7382967.633955 
-319590.029671  7382942.368283 
-319632.184402  7382928.940583 
-319663.083028  7382888.377531 
-319759.440233  7382766.218456 
-319834.546902  7382684.862392 
-319892.963200  7382645.219182 
-319903.378189  7382649.358473 
-319936.989825  7382703.859138 
-319955.733508  7382731.344430 
-319988.751415  7382775.836808 
-320020.153061  7382810.670842 
-320075.336837  7382869.280802 
-320109.278322  7382905.144659 
-320122.818633  7382940.868540 
-320137.348491  7382962.194887 
-320163.670460  7382986.670694 
-320214.236346  7383026.993788 
-320234.002561  7383053.659220 
-320266.913267  7383119.857881 
-320289.268799  7383135.205252 
-320345.714247  7383150.632609 
-320386.739245  7383174.838463 
-320423.888514  7383215.791448 
-320452.923492  7383285.199559 
-320477.901325  7383319.733644 
-320507.513539  7383343.419587 
-320534.486959  7383364.735935 
-320549.371406  7383373.664406 
-320616.033934  7383404.389143 
-320645.728611  7383420.486386 
-320655.863228  7383426.485358 
-320665.857660  7383435.133877 
-320674.400755  7383445.542094 
-320676.618991  7383455.650363 
-320675.876830  7383465.178730 
-320658.378329  7383503.932092 
-320642.116762  7383548.734418 
-320635.849626  7383562.911990 
-320638.224541  7383590.747222 
-320646.347078  7383619.092366 
-320657.281580  7383642.378378 
-320664.925836  7383667.943999 
-320676.635483  7383686.250863 
-320687.132935  7383703.987825 
-320700.632014  7383718.005423 
-320717.248169  7383736.372277 
-320730.813219  7383744.510883 
-320749.441454  7383756.378850 
-320760.293493  7383761.717936 
-320778.971206  7383770.026513 
-320797.846827  7383786.323721 
-320808.426741  7383797.301841 
-320820.952766  7383807.760049 
-320842.401212  7383822.647499 
-320865.935954  7383830.506153 
-320866.900763  7383841.424283 
-320896.191374  7383846.343440 
-320918.637614  7383854.372065 
-320949.008481  7383865.490161 
-320976.806525  7383870.599286 
-321018.862301  7383877.318135 
-321049.439325  7383888.656193 
-321116.423456  7383877.238148 
-321181.494462  7383864.760286 
-321192.907245  7383863.060577 
-321200.815381  7383858.611339 
-321215.262777  7383854.032123 
-321225.636535  7383856.811647 
-321244.388463  7383890.785828 
-321257.310307  7383911.702245 
-321281.455270  7383931.048931 
-321298.879555  7383941.117206 
-321320.212554  7383942.956891 
-321345.479005  7383943.796747 
-321371.908174  7383943.786749 
-321388.103771  7383945.976374 
-321409.098674  7383948.225989 
-321424.073829  7383950.405615 
-321441.407406  7383959.364081 
-321458.056546  7383966.332887 
-321484.032172  7383986.469438 
-321503.567492  7383999.227253 
-321516.431612  7384007.255877 
-321533.113737  7384019.523776 
-321547.305500  7384027.342437 
-321560.433499  7384038.360550 
-321575.590071  7384050.838412 
-321584.108427  7384063.126307 
-321600.765813  7384077.953768 
-321620.029008  7384088.272000 
-321649.204172  7384096.930517 
-321689.676672  7384124.675765 
-321715.751253  7384145.592182 
-321732.367408  7384163.739073 
-321761.146753  7384188.014915 
-321778.942119  7384218.029774 
-321789.068490  7384249.274422 
-321797.677555  7384296.126397 
-321817.715895  7384401.698313 
-321833.012653  7384506.790312 
-321851.096637  7384497.921831 
-321867.737530  7384529.656395 
-321898.446493  7384550.382845 
-321941.747450  7384561.300975 
-321954.042580  7384565.580242 
-321976.859900  7384633.218656 
-322034.385605  7384701.326989 
-322125.201344  7384858.750024 
-322220.560755  7385007.084616 
-322371.928565  7385215.968836 
-322408.022316  7385220.378081 
-322088.893190  7385746.477965 
-322097.964044  7385784.491453 
-322104.338380  7385809.067244 
-322109.747907  7385838.232248 
-322109.046978  7385866.187459 
-322097.048712  7385906.460561 
-322062.323835  7385914.719146 
-322027.970038  7386004.003853 
-321844.450175  7386404.245295 
-321822.226583  7386502.288501 
-321813.032036  7386538.512296 
-321808.950152  7386551.170128 
-321801.800670  7386578.775399 
-321797.463153  7386594.482709 
-321790.833183  7386610.429977 
-321750.566839  7386691.686059 
-321746.237568  7386700.044627 
-321737.323393  7386713.962243 
-321728.673097  7386722.050858 
-321711.356012  7386736.198434 
-321698.368199  7386748.836270 
-321690.987823  7386758.204665 
-321685.380386  7386768.832844 
-321677.233110  7386786.299852 
-321670.586648  7386806.806340 
-321667.791176  7386817.204559 
-321626.221927  7386921.266734 
-321565.908996  7386955.840812 
-321543.207123  7387086.988347 
-Region 1
-710
-344711.082834  7398740.002291 
-344699.521619  7398749.370687 
-344675.154007  7398767.177637 
-344652.979893  7398780.615335 
-344634.541321  7398790.923569 
-344539.132433  7398820.058579 
-344507.648324  7398832.396465 
-344469.410553  7398849.453543 
-344406.829908  7398855.422521 
-344349.543344  7398858.022076 
-344305.582688  7398853.902781 
-344287.680122  7398852.972941 
-344241.427014  7398836.045840 
-344193.747308  7398807.740688 
-344128.057835  7398779.385545 
-344058.146292  7398746.641154 
-344040.268464  7398737.702685 
-344017.987148  7398732.753533 
-344000.043350  7398728.764216 
-343924.037843  7398706.408046 
-343900.197990  7398703.428556 
-343776.776656  7398684.621778 
-343715.977197  7398692.660401 
-343696.046058  7398695.239959 
-343640.812805  7398699.719192 
-343640.713850  7398699.619209 
-343600.967018  7398702.488717 
-343566.613221  7398708.417702 
-343506.193089  7398710.787296 
-343425.643909  7398697.749529 
-343367.837832  7398680.862422 
-343324.553367  7398669.794317 
-343276.246948  7398659.726042 
-343202.773033  7398657.716386 
-343178.059080  7398660.265950 
-343144.513413  7398662.995482 
-343119.106777  7398666.524877 
-343095.893637  7398670.854136 
-343063.147856  7398678.512824 
-343015.542366  7398691.340627 
-342935.281803  7398717.186200 
-342862.080014  7398740.742165 
-342862.063521  7398740.742165 
-342793.421897  7398764.678065 
-342768.204924  7398769.087309 
-342733.430569  7398779.655499 
-342673.125885  7398790.763596 
-342613.959180  7398772.106792 
-342584.965433  7398767.987498 
-342562.717102  7398764.678065 
-342541.161456  7398759.678921 
-342521.799306  7398752.500151 
-342492.574665  7398739.952300 
-342468.380224  7398728.444271 
-342444.317723  7398719.375825 
-342419.331644  7398712.507001 
-342395.895856  7398705.008286 
-342366.151703  7398703.788495 
-342327.130539  7398701.078959 
-342279.508557  7398694.730046 
-342169.973875  7398679.362678 
-342170.831483  7398728.284299 
-342169.363654  7398743.261733 
-342169.998614  7398793.143189 
-342177.139850  7398817.748974 
-342189.039161  7398833.616256 
-342186.656000  7398856.632314 
-342188.198045  7398878.498568 
-342200.138587  7398900.304833 
-342190.630683  7398928.050081 
-342173.956805  7398970.112876 
-342138.250626  7399028.042953 
-342128.726230  7399070.895612 
-342106.510884  7399119.307320 
-342093.811689  7399138.354057 
-342072.866263  7399177.477356 
-342046.989592  7399247.865299 
-341967.751561  7399255.064066 
-341887.713647  7399259.963227 
-341881.916546  7399258.973396 
-341827.021389  7399255.743950 
-341800.468526  7399248.495191 
-341780.355970  7399240.116626 
-341764.036679  7399233.257801 
-341746.587655  7399222.979562 
-341724.966039  7399208.132105 
-341704.762774  7399202.033150 
-341679.356137  7399230.608255 
-341680.955906  7399273.460915 
-341661.857635  7399330.811091 
-341657.503626  7399363.895424 
-341647.138114  7399411.967190 
-341641.942988  7399436.522984 
-341635.189326  7399466.237894 
-341564.848978  7399726.383333 
-341571.800551  7399727.123207 
-341608.586985  7399727.123207 
-341635.461451  7399726.293349 
-341661.082490  7399720.504340 
-341689.193890  7399712.245755 
-341711.104125  7399701.497596 
-341735.075917  7399683.720641 
-341751.197298  7399663.884039 
-341764.424252  7399638.248430 
-341775.581402  7399612.622819 
-341790.465849  7399586.587279 
-341804.929737  7399569.640182 
-341821.463430  7399555.992520 
-341835.523253  7399549.383652 
-341858.670422  7399548.553794 
-341895.827938  7399550.573448 
-341931.047589  7399553.083018 
-341962.416250  7399564.261103 
-341987.633223  7399570.460042 
-342009.131147  7399582.857918 
-342020.288297  7399602.294589 
-342027.726397  7399623.370978 
-342033.515251  7399651.896092 
-342039.716416  7399668.843189 
-342049.224320  7399683.310711 
-342063.275897  7399699.018021 
-342085.598443  7399715.965118 
-342126.524486  7399743.660374 
-342152.557836  7399764.326834 
-342195.553683  7399809.789047 
-342218.288541  7399840.793736 
-342224.481460  7399849.472249 
-342236.059168  7399878.817223 
-342250.943614  7399912.301487 
-342258.381714  7399934.627663 
-342259.206337  7399958.603556 
-342255.487287  7399977.610300 
-342244.742449  7399992.497750 
-342229.858002  7400004.895627 
-342211.675064  7400025.152157 
-342180.256925  7400063.175644 
-342166.617660  7400077.233236 
-342158.759002  7400086.321679 
-342144.295113  7400114.436863 
-342129.410667  7400140.062474 
-342113.289286  7400163.618439 
-342110.815417  7400170.647235 
-342111.227728  7400178.915819 
-342114.122155  7400186.764474 
-342123.217748  7400193.793270 
-342133.137963  7400202.061854 
-342139.330882  7400210.330438 
-342141.812998  7400223.558172 
-342139.842149  7400249.223775 
-342137.442496  7400277.458939 
-342139.842149  7400302.094719 
-342142.843777  7400328.520193 
-342147.049354  7400361.564532 
-342151.254932  7400403.017432 
-342159.064112  7400425.843522 
-342167.475268  7400434.262080 
-342192.106759  7400447.469818 
-342228.159279  7400455.888376 
-342257.598322  7400456.488273 
-342276.218311  7400452.878891 
-342290.038994  7400440.860950 
-342309.260957  7400420.444447 
-342322.479665  7400415.635271 
-342333.892448  7400414.435476 
-342344.109528  7400419.834551 
-342362.127542  7400439.061258 
-342372.344622  7400449.879405 
-342387.361008  7400460.687554 
-342407.786921  7400471.505701 
-342418.004001  7400479.314363 
-342424.007257  7400488.922717 
-342431.222709  7400511.758806 
-342437.225964  7400529.775719 
-342450.444672  7400553.811602 
-342466.665008  7400572.428413 
-342495.502076  7400591.055223 
-342514.130311  7400598.863885 
-342526.747044  7400602.473267 
-342557.381791  7400601.873370 
-342586.218860  7400598.863885 
-342602.439195  7400598.263988 
-342621.669405  7400600.063680 
-342633.684163  7400604.872856 
-342639.093691  7400616.890797 
-342641.493344  7400636.107506 
-342639.687419  7400677.560405 
-342637.889741  7400708.205156 
-342639.687419  7400762.275894 
-342635.481842  7400779.692911 
-342627.070686  7400812.137353 
-342612.054300  7400845.771592 
-342602.439195  7400875.216549 
-342598.835593  7400895.043152 
-342599.437568  7400915.459655 
-342607.246748  7400963.521423 
-342618.659531  7401009.183601 
-342628.274636  7401030.210000 
-342639.687419  7401045.227427 
-342658.315654  7401062.654442 
-342700.371431  7401092.089400 
-342738.221629  7401114.915490 
-342784.474737  7401149.159625 
-342824.130860  7401185.803348 
-342848.160376  7401211.638922 
-342878.803369  7401233.865115 
-342908.836141  7401250.082337 
-342949.696214  7401264.499868 
-342993.549669  7401280.127191 
-343028.991968  7401298.144105 
-343056.633333  7401317.970709 
-343073.455644  7401332.388239 
-343088.472030  7401357.024019 
-343090.871683  7401387.658772 
-343087.870055  7401407.485376 
-343078.856925  7401428.511774 
-343056.633333  7401447.138583 
-343025.388365  7401466.355292 
-343015.781507  7401478.973131 
-343007.964080  7401493.390661 
-343002.562799  7401512.017470 
-343000.756874  7401543.252120 
-343007.370351  7401577.496254 
-343020.580813  7401619.549051 
-343034.401495  7401659.802156 
-343047.620203  7401707.863924 
-343060.236936  7401730.090116 
-343076.457272  7401741.508161 
-343097.485160  7401748.716926 
-343122.718626  7401751.116515 
-343143.144539  7401748.716926 
-343158.762900  7401742.707955 
-343174.983236  7401728.890322 
-343193.611471  7401705.464335 
-343205.024254  7401685.637731 
-343218.844936  7401661.001951 
-343239.872824  7401629.767301 
-343263.300366  7401597.922756 
-343289.135806  7401576.896357 
-343308.959745  7401566.688106 
-343361.224355  7401558.879443 
-343423.104069  7401559.479341 
-343449.541485  7401566.688106 
-343468.161474  7401581.705533 
-343481.380181  7401607.541108 
-343490.393312  7401633.366684 
-343493.394940  7401656.802670 
-343493.996914  7401704.864437 
-343500.008416  7401801.577871 
-343503.010044  7401848.439844 
-343509.021547  7401880.284390 
-343515.626777  7401913.928627 
-343518.026430  7401946.363071 
-343515.024802  7401987.216073 
-343507.817597  7402021.460207 
-343504.815969  7402055.704342 
-343508.419572  7402085.139300 
-343518.026430  7402106.165698 
-343536.052691  7402118.183640 
-343567.891387  7402124.792508 
-343595.532752  7402125.992302 
-343611.753088  7402121.783023 
-343624.369821  7402113.374463 
-343632.179001  7402100.756625 
-343635.180629  7402083.939505 
-343638.784232  7402049.695371 
-343640.590157  7402001.633604 
-343644.795734  7401971.598748 
-343654.402593  7401950.572350 
-343667.621301  7401930.745746 
-343689.853138  7401911.519039 
-343707.879399  7401900.110993 
-343727.703337  7401895.301817 
-343741.515773  7401893.502125 
-343753.538778  7401895.301817 
-343764.349586  7401906.719861 
-343831.638828  7401976.407924 
-343939.177922  7402086.938991 
-344066.540954  7402214.907072 
-344112.802308  7402264.768531 
-344141.037402  7402295.403283 
-344162.667265  7402320.039064 
-344173.478073  7402335.056491 
-344183.093178  7402353.073405 
-344187.900731  7402372.300112 
-344192.708283  7402394.526305 
-344196.913861  7402411.953319 
-344202.315142  7402431.180026 
-344204.121067  7402457.005602 
-344204.723041  7402483.441074 
-344202.315142  7402511.076341 
-344199.915489  7402533.902431 
-344198.109564  7402551.329446 
-344199.313514  7402561.537697 
-344200.517464  7402568.146565 
-344205.918745  7402577.764917 
-344216.135825  7402590.382756 
-344231.754185  7402606.000081 
-344247.974521  7402630.025966 
-344258.191601  7402643.243702 
-344262.999153  7402658.261129 
-344263.592882  7402679.887425 
-344269.604384  7402697.314440 
-344284.620770  7402706.322897 
-344303.850980  7402710.532176 
-344328.482471  7402716.541146 
-344360.321167  7402728.549089 
-344393.363814  7402731.558574 
-344411.992049  7402732.758368 
-344437.819243  7402735.757855 
-344481.680944  7402739.367236 
-344515.927540  7402742.966620 
-344572.397727  7402745.376207 
-344617.455131  7402742.366723 
-344651.701727  7402736.357752 
-344685.346348  7402733.958163 
-344728.597828  7402730.358779 
-344746.624088  7402732.158471 
-344782.668362  7402738.767339 
-344797.091020  7402741.766825 
-344850.559579  7402736.967647 
-344865.295594  7402724.359807 
-344873.014065  7402716.391172 
-344888.244853  7402695.914679 
-345233.275390  7402956.939968 
-345193.058523  7402947.101653 
-345178.116353  7402944.642075 
-345160.922962  7402939.882890 
-345137.322250  7402940.592768 
-345115.131643  7402949.131306 
-345104.139418  7402955.800163 
-345094.598529  7402967.528155 
-345094.474836  7402974.866897 
-345094.474836  7402983.275457 
-345097.476464  7403000.092577 
-345101.080066  7403013.310312 
-345112.501096  7403037.346195 
-345135.928637  7403067.980948 
-345157.558500  7403087.807552 
-345176.780464  7403095.016317 
-345206.821482  7403100.425390 
-345236.260525  7403111.833436 
-345254.880514  7403122.651583 
-345266.895272  7403140.068600 
-345271.702825  7403166.504072 
-345277.112352  7403210.356560 
-345286.125482  7403233.792546 
-345292.730713  7403244.600695 
-345301.141868  7403248.809973 
-345316.760229  7403251.809460 
-345344.401594  7403251.809460 
-345384.049471  7403254.818944 
-345417.694092  7403259.618122 
-345432.710478  7403264.427298 
-345456.739994  7403272.235961 
-345471.764626  7403275.245445 
-345489.782640  7403280.644521 
-345513.820403  7403288.463181 
-345524.029236  7403294.462154 
-345542.055496  7403314.288758 
-345556.469908  7403329.306185 
-345573.292218  7403350.932481 
-345591.318478  7403371.968877 
-345624.963099  7403398.394351 
-345648.992616  7403417.021160 
-345682.035262  7403430.238896 
-345708.472677  7403440.447148 
-345733.104168  7403457.274265 
-345748.120554  7403462.683339 
-345767.342518  7403465.082928 
-345790.176330  7403465.682825 
-345813.603872  7403466.282722 
-345831.630132  7403462.073443 
-345855.057673  7403456.074471 
-345878.493461  7403454.264781 
-345896.511475  7403454.264781 
-345919.947262  7403457.274265 
-345933.157724  7403459.673854 
-345943.374803  7403461.473546 
-345955.991536  7403459.073957 
-345968.006294  7403454.264781 
-345984.828605  7403441.646942 
-346001.650915  7403421.830337 
-346017.269276  7403402.003733 
-346037.093215  7403367.159701 
-346052.719822  7403319.097934 
-346056.925399  7403302.880712 
-346056.925399  7403284.853800 
-346048.415289  7403270.736218 
-346040.028873  7403251.209562 
-346018.473226  7403218.775118 
-345989.636157  7403189.930059 
-345962.003038  7403173.712837 
-345932.563995  7403162.904688 
-345896.511475  7403159.295307 
-345847.248493  7403159.295307 
-345834.631760  7403158.695409 
-345811.204219  7403153.286336 
-345784.164828  7403139.468703 
-345771.548095  7403131.660040 
-345758.337634  7403123.251481 
-345751.724157  7403116.042715 
-345746.916604  7403105.824466 
-345742.117298  7403084.198170 
-345742.117298  7403061.372080 
-345748.722529  7403042.745271 
-345759.533337  7403025.328254 
-345779.365522  7403015.709901 
-345793.779933  7403011.510621 
-345819.013399  7403010.910723 
-345847.248493  7403022.918667 
-345864.672778  7403034.936608 
-345881.495089  7403050.553933 
-345891.703922  7403058.372594 
-345905.524605  7403060.172285 
-345919.345287  7403052.363623 
-345927.154468  7403040.345682 
-345940.975150  7403013.910210 
-345954.787587  7402990.484222 
-345968.006294  7402964.048751 
-345977.019424  7402943.022352 
-345982.428952  7402926.205233 
-345983.624655  7402916.586880 
-345980.021052  7402902.769247 
-345984.226630  7402879.343260 
-345988.432208  7402858.916759 
-345997.445338  7402825.872419 
-346009.460096  7402801.246637 
-346023.882753  7402782.019930 
-346071.339811  7402732.158471 
-346115.201511  7402689.505777 
-346140.426731  7402669.679173 
-346172.273674  7402657.661232 
-346207.113998  7402655.261643 
-346259.988829  7402660.670716 
-346293.031475  7402678.687630 
-346324.870172  7402709.332381 
-346357.310843  7402754.384664 
-346397.560695  7402789.228696 
-346445.627973  7402815.664167 
-346543.551962  7402860.116553 
-346582.004136  7402882.342746 
-346630.665143  7402915.387086 
-346673.924869  7402955.640191 
-346710.571118  7403003.102061 
-346740.010161  7403042.745271 
-346752.626894  7403071.580331 
-346760.436075  7403090.207141 
-346776.656410  7403110.033745 
-346795.878374  7403124.451275 
-346812.247142  7403130.840181 
-346841.826371  7403136.389230 
-346854.772953  7403133.299759 
-346871.405600  7403125.911025 
-346905.297608  7403108.044085 
-346944.739330  7403088.317464 
-346973.700092  7403070.450525 
-346989.013342  7403062.161945 
-346935.882878  7402984.025329 
-346861.947174  7402859.056735 
-346762.027597  7402689.865716 
-347215.157971  7402074.291158 
-347188.506154  7402012.081814 
-347156.741673  7401983.296744 
-347122.132243  7401962.220355 
-347087.267180  7401945.363242 
-347034.812907  7401930.305821 
-346994.736226  7401923.017070 
-346958.197178  7401920.647476 
-346934.217139  7401918.737803 
-346887.452765  7401916.918115 
-346817.640177  7401919.517669 
-346754.177186  7401918.497844 
-346715.048821  7401916.208236 
-346686.566340  7401913.638676 
-346667.971090  7401910.409229 
-346629.288022  7401900.130990 
-346597.078245  7401889.152870 
-346570.566614  7401878.234741 
-346544.450801  7401865.396940 
-346519.868788  7401850.309524 
-346501.339508  7401836.801838 
-346490.017433  7401825.613754 
-346476.872941  7401812.186054 
-346458.393138  7401792.169483 
-346440.366878  7401767.683677 
-346429.127266  7401748.117029 
-346417.912392  7401726.730692 
-346404.141187  7401695.696008 
-346388.506334  7401652.203458 
-346368.888551  7401589.584184 
-346354.911190  7401543.482081 
-346372.335475  7401526.514987 
-346384.119339  7401517.086602 
-346395.342459  7401511.677529 
-346412.115292  7401509.367924 
-346433.769894  7401501.559262 
-346452.315666  7401499.019697 
-346469.946108  7401488.401516 
-346487.535318  7401480.802817 
-346509.371336  7401479.303074 
-346535.577857  7401472.064314 
-346593.787999  7401461.686092 
-346615.879651  7401459.436477 
-346634.755273  7401450.597991 
-346661.324628  7401435.290613 
-346686.896190  7401417.963581 
-346705.268792  7401408.865139 
-346742.121196  7401381.849767 
-346746.912256  7401378.450349 
-346775.633878  7401358.573754 
-346793.206595  7401352.984711 
-346821.779784  7401345.316025 
-346843.211738  7401329.328763 
-346872.749736  7401313.901406 
-346911.507020  7401287.935853 
-346938.035144  7401268.709147 
-346982.902885  7401240.274018 
-346995.412417  7401229.005948 
-347011.476074  7401218.777700 
-347019.969692  7401202.700454 
-347028.488048  7401182.073987 
-347031.176319  7401161.407527 
-347032.850304  7401140.991024 
-347032.701872  7401127.653308 
-347033.559480  7401112.485906 
-347031.926726  7401093.309191 
-347031.836018  7401070.853038 
-347033.551234  7401043.877658 
-347035.043801  7401013.112928 
-347038.086660  7400978.328886 
-347043.438464  7400940.275405 
-347051.783650  7400917.669277 
-347064.787955  7400874.576658 
-347069.661478  7400855.069999 
-347077.792261  7400830.684177 
-347093.237451  7400790.041138 
-347110.307148  7400760.776151 
-347133.066745  7400731.511164 
-347145.262920  7400712.804368 
-347167.206140  7400684.359241 
-347225.746131  7400607.942330 
-347254.203873  7400570.548735 
-347272.271365  7400600.053681 
-347283.766610  7400583.896449 
-347317.988467  7400524.996538 
-347336.501255  7400493.521929 
-347352.111370  7400475.295051 
-347365.536233  7400460.267626 
-347379.686765  7400445.910085 
-347393.598156  7400434.202090 
-347407.171452  7400425.593565 
-347423.309325  7400415.795243 
-347426.286214  7400412.705772 
-347448.361374  7400394.018973 
-347459.279383  7400385.050510 
-347468.160574  7400375.392164 
-347481.123648  7400353.485916 
-347485.337472  7400334.759124 
-347485.881723  7400294.965940 
-347467.987403  7400231.886745 
-347468.276021  7400207.520919 
-347468.309006  7400173.246790 
-347470.939553  7400144.341741 
-347471.236418  7400109.617689 
-347475.829568  7400054.527125 
-347481.948271  7399989.488266 
-347490.788231  7399982.369485 
-347492.371507  7399914.221158 
-347475.252332  7399819.187437 
-347456.558127  7399727.183196 
-347424.521521  7399637.278596 
-347438.474143  7399605.913969 
-347363.408706  7399595.775705 
-347318.780105  7399595.775705 
-347288.343268  7399585.627443 
-347236.746603  7399566.990636 
-347211.249258  7399527.797349 
-347186.898139  7399507.510824 
-347166.612411  7399501.421867 
-347142.261292  7399501.421867 
-347114.801344  7399510.090382 
-347083.432683  7399501.421867 
-347040.824409  7399491.273605 
-346998.216135  7399485.184648 
-346949.522143  7399491.273605 
-346921.122125  7399497.362562 
-346905.660443  7399484.014849 
-346897.405966  7399486.764378 
-346887.337318  7399482.185162 
-346841.364582  7399443.821734 
-346832.128804  7399436.403004 
-346812.181172  7399411.907200 
-346795.680464  7399395.020093 
-346779.641546  7399380.922508 
-346756.972658  7399370.254335 
-346736.761146  7399364.675291 
-346715.164268  7399363.775445 
-346687.844506  7399362.975582 
-346651.800232  7399365.235195 
-346617.504159  7399369.794414 
-346599.815994  7399376.633242 
-346554.255570  7399394.880117 
-346526.267863  7399401.009067 
-346518.186557  7399402.728772 
-346503.813377  7399405.388317 
-346491.163659  7399406.008211 
-346473.203369  7399404.288505 
-346452.579546  7399400.859093 
-346431.650612  7399398.509495 
-346412.123538  7399395.390029 
-346377.876942  7399388.391228 
-346345.114668  7399380.862518 
-346327.616167  7399375.233482 
-346321.217092  7399371.484124 
-346311.684449  7399363.365515 
-346300.279912  7399354.926960 
-346284.661551  7399343.678887 
-346274.823798  7399338.989690 
-346267.171296  7399337.739904 
-346259.980583  7399337.120011 
-346249.870704  7399338.449783 
-346234.054434  7399340.089502 
-346225.461861  7399340.089502 
-346217.025967  7399338.209824 
-346209.686822  7399335.870225 
-346186.721070  7399321.022768 
-346175.629890  7399311.804347 
-346154.387599  7399293.847423 
-346150.017097  7399290.557986 
-346144.079811  7399288.848279 
-346122.054129  7399283.849135 
-346107.210914  7399281.659510 
-346082.686624  7399277.440233 
-346043.954079  7399270.411437 
-346026.768934  7399268.531759 
-346014.894362  7399267.911865 
-346005.840001  7399270.251465 
-345993.495393  7399274.630714 
-345975.221746  7399280.559699 
-345965.540671  7399282.279404 
-345959.446707  7399281.969457 
-345935.392452  7399278.060127 
-345916.178735  7399274.160795 
-345900.708806  7399269.781545 
-345888.372445  7399264.782401 
-345884.463732  7399259.943230 
-345879.301591  7399251.854616 
-345868.688692  7399234.787539 
-345859.939442  7399229.948368 
-345839.480543  7399223.079545 
-345828.702720  7399219.790108 
-345809.332324  7399216.830615 
-345746.380599  7399205.582542 
-345728.890344  7399201.833184 
-345714.987199  7399197.923854 
-345708.579878  7399194.644415 
-345687.650945  7399178.397198 
-345660.628047  7399157.310810 
-345649.380188  7399150.431989 
-345624.855898  7399136.684343 
-345612.667970  7399130.275441 
-345594.394322  7399124.496431 
-345571.898605  7399116.687769 
-345548.471064  7399107.939267 
-345527.698809  7399102.470204 
-345517.391021  7399100.750499 
-345504.576378  7399101.540363 
-345495.522017  7399102.630177 
-345488.958017  7399105.129748 
-345478.336872  7399109.658973 
-345472.712943  7399110.438839 
-345465.687154  7399108.719134 
-345449.442080  7399101.850310 
-345434.285508  7399094.821514 
-345417.257042  7399088.572584 
-345388.988963  7399079.044217 
-345383.810330  7399077.164539 
-345316.042807  7399048.729409 
-345302.923054  7399043.580291 
-345292.607019  7399039.830933 
-345222.002793  7399013.425457 
-345199.977111  7399003.897089 
-345159.991138  7398989.839497 
-345134.840135  7398972.812413 
-345105.945343  7398954.845491 
-345071.269943  7398928.909933 
-345037.526367  7398901.414643 
-345028.158649  7398895.485659 
-345019.096041  7398891.576328 
-345000.195681  7398886.577184 
-344991.603108  7398883.607693 
-344986.135857  7398880.798174 
-344963.483462  7398867.670423 
-344937.870669  7398855.332536 
-344912.406309  7398841.894838 
-344901.001772  7398834.396123 
-344893.819305  7398827.057380 
-344880.229517  7398811.590029 
-344860.083976  7398790.973561 
-344852.109871  7398781.755140 
-344843.368866  7398774.566371 
-344825.086973  7398764.568084 
-344809.938647  7398758.479127 
-344792.283467  7398753.789930 
-344756.832922  7398747.381028 
-344745.428385  7398745.821295 
-344739.449868  7398744.001606 
-344729.801778  7398741.132098 
-344723.559381  7398740.512204 
-344711.082834  7398740.002291 
-Region 1
-606
-319663.083028  7382888.377531 
-319759.440233  7382766.218456 
-319834.546902  7382684.862392 
-319892.963200  7382645.219182 
-319903.378189  7382649.358473 
-319936.989825  7382703.859138 
-319955.733508  7382731.344430 
-319988.751415  7382775.836808 
-320020.153061  7382810.670842 
-320075.336837  7382869.280802 
-320109.278322  7382905.144659 
-320122.818633  7382940.868540 
-320137.348491  7382962.194887 
-320163.670460  7382986.670694 
-320214.236346  7383026.993788 
-320234.002561  7383053.659220 
-320266.913267  7383119.857881 
-320289.268799  7383135.205252 
-320345.714247  7383150.632609 
-320386.739245  7383174.838463 
-320423.888514  7383215.791448 
-320452.923492  7383285.199559 
-320477.901325  7383319.733644 
-320507.513539  7383343.419587 
-320534.486959  7383364.735935 
-320549.371406  7383373.664406 
-320616.033934  7383404.389143 
-320645.728611  7383420.486386 
-320655.863228  7383426.485358 
-320665.857660  7383435.133877 
-320674.400755  7383445.542094 
-320676.618991  7383455.650363 
-320675.876830  7383465.178730 
-320658.378329  7383503.932092 
-320642.116762  7383548.734418 
-320635.849626  7383562.911990 
-320638.224541  7383590.747222 
-320687.718417  7383585.908051 
-320748.649815  7383586.048027 
-320869.811682  7383587.047855 
-321023.843025  7383594.726540 
-321065.065932  7383592.166978 
-321131.044023  7383583.028544 
-321225.537580  7383548.284495 
-321241.790901  7383541.465663 
-321241.840378  7383525.508396 
-321235.193916  7383501.942433 
-321229.141183  7383471.627626 
-321223.830610  7383447.091829 
-321207.123747  7383386.852147 
-321193.228848  7383354.447698 
-321162.288991  7383272.211784 
-321147.503499  7383233.668386 
-321024.337798  7382972.973041 
-321031.734667  7382962.804783 
-321018.656146  7382946.517572 
-321010.294468  7382930.870253 
-320994.082378  7382905.194651 
-320986.669017  7382885.158083 
-320971.957741  7382853.743464 
-320961.575737  7382835.016671 
-320946.757261  7382812.120593 
-320937.537975  7382798.382946 
-320926.050975  7382778.636329 
-320915.932850  7382755.370314 
-320903.415072  7382735.833661 
-320890.179872  7382717.276839 
-320878.231084  7382693.430924 
-320862.018994  7382667.315397 
-320853.822241  7382645.279172 
-320845.757428  7382620.703381 
-320843.844302  7382602.516497 
-320847.810739  7382586.619220 
-320850.564980  7382561.723484 
-320854.127352  7382537.287670 
-320850.457779  7382521.080446 
-320844.479262  7382509.372451 
-320839.102719  7382498.234359 
-320826.189122  7382486.776322 
-320814.669138  7382477.767865 
-320797.797350  7382464.050215 
-320785.254833  7382455.031759 
-320767.014171  7382445.283429 
-320752.789423  7382432.265659 
-320737.476173  7382416.008444 
-320731.745043  7382400.881035 
-320724.587314  7382385.393688 
-320715.640154  7382366.566913 
-320721.544455  7382351.019576 
-320734.886857  7382336.232109 
-320740.123213  7382325.223994 
-320744.980243  7382312.096243 
-320747.701499  7382298.068646 
-320745.293600  7382286.410643 
-320742.407419  7382272.742984 
-320737.261771  7382251.306656 
-320725.947942  7382217.052523 
-320720.291028  7382196.386063 
-320717.660481  7382177.849238 
-320712.547818  7382153.643385 
-320704.656175  7382132.167063 
-320692.963020  7382111.870540 
-320680.742106  7382093.993602 
-320675.085192  7382086.444895 
-320656.407479  7382064.788605 
-320644.640108  7382051.350906 
-320630.860657  7382035.233667 
-320611.539738  7382013.397407 
-320597.479915  7381995.050550 
-320583.733449  7381976.503727 
-320573.277228  7381955.987241 
-320564.577455  7381941.479726 
-320554.434591  7381920.203371 
-320537.315416  7381901.936500 
-320525.300658  7381891.488289 
-320503.085313  7381881.360024 
-320447.307809  7381853.864734 
-320433.503619  7381839.847135 
-320413.193153  7381816.231180 
-320400.444480  7381799.124110 
-320396.412073  7381787.226148 
-320386.063054  7381765.499870 
-320373.009271  7381749.162668 
-320360.458508  7381732.615503 
-320353.473950  7381727.986296 
-320343.372318  7381719.887683 
-320341.970459  7381709.239507 
-320344.493805  7381703.180545 
-320349.688931  7381695.711824 
-320352.855483  7381687.443240 
-320350.843403  7381676.565104 
-320345.689509  7381664.427183 
-320338.531780  7381641.081182 
-320337.402047  7381625.003936 
-320339.166740  7381606.307138 
-320341.088112  7381591.159733 
-320344.774177  7381573.262798 
-320345.301936  7381546.787333 
-320355.131443  7381519.442017 
-320356.929121  7381505.844347 
-320361.316116  7381481.088587 
-320363.509613  7381452.533478 
-320363.625060  7381409.780801 
-320359.906010  7381389.024357 
-320357.176508  7381370.047607 
-320343.718660  7381336.433365 
-320337.987529  7381313.107361 
-320327.918882  7381285.842031 
-320316.266958  7381254.357424 
-320309.018521  7381230.011594 
-320308.235129  7381218.973485 
-320305.381933  7381169.691927 
-320293.606316  7381090.475496 
-320281.154508  7381058.091043 
-320276.346955  7381033.995170 
-320266.905021  7381005.310084 
-320262.674705  7380968.036468 
-320260.885273  7380948.079887 
-320251.187705  7380907.196890 
-320242.388977  7380884.050854 
-320224.898722  7380863.344401 
-320205.882914  7380849.926699 
-320189.547131  7380834.659315 
-320170.020057  7380805.064384 
-320159.365927  7380783.888011 
-320151.927827  7380758.322390 
-320144.118647  7380721.458705 
-320128.104467  7380678.496064 
-320104.668679  7380672.737050 
-320024.432855  7380552.557636 
-319971.022019  7380462.803010 
-319958.710397  7380438.387192 
-319938.259745  7380406.492656 
-319899.378767  7380344.283312 
-319779.478574  7380165.683904 
-319723.057864  7380051.013546 
-319708.173417  7380017.819232 
-319704.619292  7379991.523736 
-319698.591297  7379975.496481 
-319690.567715  7379940.472481 
-319608.319810  7379939.422660 
-319603.479273  7379969.427521 
-319609.408313  7379986.604579 
-319602.522710  7379990.733871 
-319596.643148  7380008.940753 
-319590.087394  7380018.009199 
-319574.436049  7380022.068504 
-319552.352643  7380021.508600 
-319534.351122  7380033.156605 
-319526.987238  7380047.174204 
-319519.499660  7380074.879458 
-319510.049480  7380109.043606 
-319501.052842  7380134.839187 
-319488.716481  7380151.086404 
-319476.017286  7380165.453943 
-319461.470935  7380173.702530 
-319324.031009  7380253.598845 
-319283.426569  7380280.284274 
-319232.200984  7380316.818016 
-319202.225936  7380330.965593 
-319169.612094  7380358.100945 
-319144.213703  7380387.935834 
-319118.312293  7380429.578701 
-319119.376057  7380437.947268 
-319122.880705  7380471.841462 
-319125.230880  7380506.095595 
-319120.711946  7380542.199410 
-319056.176945  7380519.233344 
-319045.539307  7380517.623620 
-319022.029304  7380506.385545 
-318988.252743  7380494.317612 
-318968.601976  7380477.810440 
-318932.071174  7380432.998115 
-318901.378703  7380374.158194 
-318877.802730  7380329.455851 
-318864.790178  7380293.971929 
-318852.907360  7380261.157550 
-318866.587856  7380222.474176 
-318872.797268  7380209.586384 
-318880.911559  7380197.098523 
-318884.160574  7380175.062298 
-318882.082524  7380152.596146 
-318867.577404  7380113.682811 
-318840.669953  7380058.302297 
-318796.198031  7379966.248066 
-318778.072816  7379928.554522 
-318745.524944  7379864.425507 
-318643.906644  7379645.762962 
-318626.952394  7379609.929100 
-318543.797404  7379457.085281 
-318495.350799  7379342.184962 
-318443.061450  7379223.315323 
-318425.934029  7379187.131521 
-318416.401387  7379175.703479 
-318381.627032  7379134.010620 
-318365.167556  7379183.482146 
-318186.075918  7379135.680334 
-318156.282287  7379128.661537 
-318125.985636  7379120.312967 
-318102.731265  7379111.604458 
-318082.346583  7379102.376039 
-318047.959801  7379098.726664 
-318037.948877  7379132.490881 
-318000.981025  7379136.660166 
-317973.281936  7379139.919608 
-317978.171951  7379179.022910 
-317977.297851  7379250.690634 
-317925.363090  7379280.295563 
-317887.818002  7379301.441941 
-317862.757707  7379310.710353 
-317757.675990  7379363.011395 
-317601.360442  7379432.439502 
-317587.152186  7379473.382489 
-317571.203976  7379464.174066 
-317549.961686  7379448.466757 
-317535.959587  7379426.710483 
-317524.233447  7379407.633751 
-317518.576532  7379392.756299 
-317515.962477  7379381.328257 
-317509.926236  7379364.171196 
-317499.371061  7379338.615573 
-317485.690565  7379373.269637 
-317452.466501  7379475.502126 
-317443.956391  7379516.115169 
-317428.808066  7379497.398375 
-317399.352530  7379435.598961 
-317379.206988  7379430.179889 
-317407.524544  7379312.799995 
-317438.060336  7379192.110668 
-317458.659420  7379128.481567 
-317461.191013  7379087.388606 
-317535.036009  7378971.768411 
-317516.968517  7378868.506099 
-317513.991628  7378855.548318 
-317369.558898  7378659.011983 
-317400.053459  7378659.581886 
-317426.367181  7378588.953984 
-317426.400166  7378588.943985 
-317456.919466  7378513.396926 
-317355.078517  7378530.104064 
-317384.031033  7378464.975220 
-317331.749931  7378477.603057 
-317294.386260  7378479.272771 
-317259.348026  7378476.383266 
-317105.926905  7378447.628191 
-317033.351829  7378478.392922 
-317012.093046  7378398.316638 
-317000.070042  7378368.941670 
-316984.591867  7378342.956121 
-316945.752120  7378338.146945 
-316925.903443  7378344.495857 
-316903.770560  7378348.545163 
-316884.383672  7378340.046619 
-316800.049471  7378229.135617 
-316784.892899  7378214.578111 
-316759.799619  7378203.769962 
-316700.377281  7378205.439676 
-316724.959295  7378221.256967 
-316744.577078  7378234.684667 
-316758.092650  7378246.592627 
-316773.958397  7378266.839159 
-316781.000678  7378290.415121 
-316791.217758  7378321.439806 
-316793.089653  7378343.176083 
-316791.357944  7378358.883393 
-316787.333784  7378378.769986 
-316776.358051  7378400.346290 
-316762.644569  7378419.553000 
-316742.457796  7378443.558888 
-316728.826777  7378456.456679 
-316712.548718  7378477.733035 
-316703.420140  7378497.999563 
-316687.496669  7378523.055271 
-316666.575982  7378588.474066 
-316649.902104  7378632.686493 
-316643.263888  7378657.632220 
-316630.820326  7378690.036669 
-316623.975954  7378723.071011 
-316613.239362  7378748.966575 
-316599.674313  7378789.449640 
-316596.474775  7378816.654980 
-316593.481393  7378851.948935 
-316591.032263  7378875.954823 
-316581.854208  7378900.100687 
-316568.792179  7378925.186390 
-316547.467426  7378957.920783 
-316528.369156  7378983.936327 
-316511.728263  7379009.201999 
-316493.858681  7379034.787616 
-316480.161692  7379053.444421 
-316460.642864  7379088.858354 
-316421.745394  7379147.628288 
-316388.595547  7379196.169973 
-316361.580895  7379234.923335 
-316342.226992  7379257.389487 
-316318.180983  7379311.580204 
-316313.439401  7379339.875358 
-316314.305255  7379367.690593 
-316319.220008  7379390.456693 
-316320.852762  7379422.821150 
-316315.138124  7379447.556913 
-316309.835798  7379463.664154 
-316304.211869  7379480.761225 
-316291.364241  7379496.438540 
-316320.407466  7379554.848535 
-316345.525484  7379617.637779 
-316391.539451  7379698.303962 
-316413.977445  7379738.567065 
-316421.234128  7379761.703102 
-316429.315434  7379784.619177 
-316437.776066  7379808.985003 
-316451.926598  7379835.520458 
-316468.278874  7379857.776646 
-316485.208385  7379881.802530 
-316491.434289  7379905.918399 
-316491.607460  7379924.415231 
-316489.702581  7379938.232864 
-316485.760883  7379959.449230 
-316483.006642  7379975.586466 
-316476.154024  7380009.620636 
-316470.703265  7380037.015944 
-316467.767607  7380067.550713 
-316459.612085  7380099.795190 
-316457.294894  7380170.323109 
-316460.007904  7380197.938379 
-316463.751693  7380215.925298 
-316471.511396  7380239.841202 
-316482.544853  7380263.237194 
-316498.154967  7380287.033118 
-316513.872283  7380310.709062 
-316529.688553  7380334.724949 
-316543.624683  7380353.951655 
-316555.523994  7380372.818424 
-316569.616802  7380395.814485 
-316575.380917  7380410.491971 
-316580.122500  7380420.540249 
-316591.799162  7380457.123983 
-316596.854102  7380493.077824 
-316601.950272  7380525.822216 
-316606.576408  7380555.667103 
-316613.824844  7380579.573009 
-316628.074331  7380606.338424 
-316651.221500  7380639.532738 
-316665.190615  7380656.429844 
-316689.228378  7380675.346603 
-316702.183206  7380691.893769 
-316711.707602  7380713.060143 
-316722.130838  7380744.094827 
-316736.982299  7380775.219496 
-316743.125741  7380786.337592 
-316759.238876  7380810.693420 
-316775.863277  7380835.709135 
-316791.597085  7380866.033940 
-316800.404059  7380887.640239 
-316818.595244  7380925.853694 
-316828.985495  7380959.657903 
-316846.921046  7381001.640712 
-316876.549753  7381087.526001 
-316884.845461  7381109.122302 
-316899.812370  7381143.756369 
-316905.271374  7381172.401462 
-316908.883223  7381201.026559 
-316910.029449  7381223.632687 
-316909.765570  7381244.569101 
-316910.788103  7381260.526367 
-316911.117952  7381275.373824 
-316921.120630  7381298.869800 
-316928.781378  7381314.367145 
-316943.863734  7381339.922768 
-316947.615769  7381357.909687 
-316947.450844  7381371.307392 
-316943.121573  7381391.193985 
-316942.808216  7381407.691159 
-316948.176512  7381427.147827 
-316950.559673  7381448.444179 
-316955.482673  7381462.681740 
-316957.247366  7381500.695229 
-316952.852125  7381509.503720 
-316932.574644  7381515.892625 
-316924.856172  7381521.111731 
-316920.502162  7381526.820754 
-316915.950243  7381556.005754 
-316916.131660  7381590.119911 
-316912.330148  7381608.786714 
-316909.716093  7381621.384556 
-316905.007495  7381638.941548 
-316902.261500  7381654.848824 
-316902.170792  7381669.696280 
-316904.042686  7381683.563905 
-316905.766148  7381692.442384 
-316917.096469  7381699.901106 
-316931.659312  7381710.159349 
-316937.909955  7381716.218311 
-316949.091844  7381743.613619 
-316952.233658  7381753.511923 
-316953.701487  7381766.819644 
-316958.385346  7381775.518154 
-316965.213225  7381783.906717 
-316973.508933  7381789.995674 
-316985.812309  7381801.003789 
-316995.006856  7381816.401151 
-317001.249253  7381831.108632 
-317002.642866  7381842.196733 
-317004.028232  7381853.624775 
-317010.674694  7381876.640833 
-317012.521850  7381891.838229 
-317016.447056  7381912.484693 
-317018.788985  7381929.241822 
-317023.208965  7381943.139442 
-317024.017096  7381976.113794 
-317012.290956  7382000.049694 
-317004.135433  7382031.734266 
-317002.642866  7382045.121973 
-316999.261911  7382062.239041 
-316999.591760  7382076.316630 
-317001.306976  7382086.194938 
-317005.355876  7382105.181686 
-317009.355297  7382119.859171 
-317013.222780  7382136.296356 
-317022.417327  7382152.033660 
-317029.302929  7382172.280192 
-317049.440225  7382213.373153 
-317050.842084  7382228.260603 
-317046.455089  7382236.289228 
-317028.098980  7382243.707957 
-317016.051237  7382260.945005 
-317009.883056  7382272.273064 
-317007.400941  7382291.179826 
-317007.244262  7382303.697682 
-317013.264011  7382336.122128 
-317019.003387  7382350.259706 
-317030.218261  7382367.016836 
-317038.472738  7382376.415226 
-317051.312119  7382385.663642 
-317060.671591  7382395.641932 
-317084.569167  7382434.705241 
-317097.688920  7382445.943316 
-317106.718543  7382458.131229 
-317112.960939  7382465.190019 
-317114.123658  7382478.167796 
-317113.076387  7382504.623265 
-317113.125864  7382525.009773 
-317110.948859  7382544.136497 
-317109.728417  7382559.523861 
-317107.312271  7382573.451475 
-317105.094035  7382595.567687 
-317105.753734  7382608.425484 
-317106.603095  7382621.843186 
-317115.146190  7382632.251403 
-317121.693698  7382638.870270 
-317128.142250  7382645.479138 
-317136.685345  7382655.447430 
-317143.488485  7382666.615517 
-317144.379078  7382676.703789 
-317142.696847  7382689.081669 
-317139.291154  7382700.119778 
-317138.920073  7382713.297521 
-317144.403817  7382723.445783 
-317146.836455  7382733.004145 
-317143.768857  7382741.822635 
-317138.598470  7382747.071736 
-317136.965717  7382755.140354 
-317138.400561  7382762.689061 
-317142.375244  7382771.267591 
-317150.588490  7382791.314157 
-317157.342153  7382822.408831 
-317168.820906  7382875.049814 
-317187.770744  7382934.439641 
-317220.417571  7383040.301508 
-317246.450921  7383128.566389 
-317248.834082  7383142.004087 
-317253.056152  7383155.341803 
-317252.157313  7383169.739336 
-317249.287624  7383178.997751 
-317242.740117  7383196.534747 
-317233.990867  7383210.822299 
-317227.814440  7383223.370150 
-317222.545098  7383236.487903 
-317217.646837  7383268.992335 
-317214.966812  7383287.669136 
-317211.519888  7383326.282522 
-317201.492472  7383345.099299 
-317187.993392  7383372.184659 
-317188.562382  7383391.901282 
-317190.648678  7383412.087824 
-317221.110254  7383420.606365 
-317238.122228  7383429.594826 
-317262.333161  7383442.092685 
-317280.309944  7383465.178730 
-317294.922265  7383484.015504 
-317304.100319  7383511.180851 
-317309.913912  7383533.716990 
-317316.873731  7383555.513257 
-317326.142494  7383575.049910 
-317336.120433  7383599.165780 
-317349.941116  7383619.912226 
-317366.062497  7383639.918799 
-317388.673661  7383658.105684 
-317412.826871  7383674.042954 
-317440.097155  7383684.681132 
-317463.986485  7383691.839905 
-317489.038534  7383697.498936 
-317511.591975  7383689.800255 
-317546.028234  7383675.022786 
-317598.482507  7383650.576973 
-317655.216574  7383617.812586 
-317678.174080  7383608.974100 
-317699.630772  7383597.066139 
-317713.319515  7383597.626043 
-317780.468571  7383493.423892 
-317803.079736  7383480.766060 
-317830.383006  7383458.659847 
-317874.129259  7383429.914771 
-318064.023459  7383350.338402 
-318091.763778  7383349.308578 
-318114.869717  7383352.717994 
-318153.758940  7383347.518884 
-318181.556984  7383347.128951 
-318220.990459  7383326.282522 
-318242.546106  7383315.654343 
-318266.996180  7383303.666396 
-318315.079951  7383290.988568 
-318344.354069  7383275.421234 
-318351.091240  7383263.373298 
-318359.609596  7383257.084375 
-318372.251068  7383253.944913 
-318427.838908  7383254.834760 
-318451.043801  7383255.764601 
-318474.792946  7383250.185557 
-318490.510261  7383245.586345 
-318504.363929  7383239.417401 
-318527.403897  7383231.178812 
-318560.792885  7383202.573712 
-318611.721606  7383154.102015 
-318638.406408  7383137.614839 
-318631.133233  7383156.891537 
-318619.440078  7383203.153613 
-318645.910478  7383228.929198 
-318660.761939  7383246.046266 
-318688.551737  7383281.010277 
-318683.488551  7383320.183567 
-318672.380878  7383391.631328 
-318734.763613  7383361.396507 
-318776.308123  7383342.899676 
-318883.072071  7383280.820309 
-318902.821794  7383271.801854 
-318961.386524  7383258.654106 
-319005.973893  7383257.764259 
-319035.379951  7383254.244861 
-319056.119221  7383246.706153 
-319065.602387  7383231.288794 
-319096.773139  7383199.964159 
-319115.558052  7383194.285132 
-319137.047729  7383169.989294 
-319161.778175  7383137.004944 
-319171.739621  7383117.008369 
-319182.261812  7383089.413096 
-319252.132124  7383064.687331 
-319310.498944  7383043.151020 
-319350.039620  7383029.563347 
-319418.318410  7383007.857065 
-319466.369196  7382988.360405 
-319527.011976  7382967.633955 
-319590.029671  7382942.368283 
-319632.184402  7382928.940583 
-319663.083028  7382888.377531 
-Region 1
-226
-341952.751668  7394121.943323 
-341895.737229  7394110.985200 
-341883.714225  7394163.186259 
-341872.738492  7394214.627447 
-341855.602824  7394234.823988 
-341841.138936  7394243.202553 
-341823.640435  7394250.061378 
-341807.667486  7394252.350985 
-341789.047497  7394253.490790 
-341765.108689  7394251.201182 
-341752.186846  7394247.391835 
-341741.178128  7394242.822618 
-341736.106696  7394240.962936 
-341678.952072  7394186.422278 
-341629.631366  7394138.400504 
-341577.276048  7394084.289773 
-341527.188443  7394041.217151 
-341458.992115  7394131.151746 
-341405.218445  7394141.509972 
-341415.188138  7394283.505649 
-341418.791741  7394311.310886 
-341426.106147  7394433.319987 
-341402.851777  7394523.584526 
-341386.499502  7394581.344632 
-341370.872895  7394645.573630 
-341342.011087  7394756.914558 
-341324.438370  7394826.842580 
-341313.520360  7394868.255487 
-341284.237995  7394985.305437 
-341268.685604  7395044.875233 
-341254.601042  7395098.546040 
-341225.648527  7395221.704944 
-341192.506926  7395331.356162 
-341158.384023  7395439.277676 
-341127.600844  7395514.954713 
-341116.336493  7395550.278662 
-341101.930328  7395603.099614 
-341093.667605  7395664.189150 
-341068.689773  7395778.099639 
-341029.322267  7395925.344417 
-341003.247686  7396032.006147 
-340966.189126  7396176.621375 
-341041.147362  7396191.898758 
-341243.691279  7396236.431130 
-341302.989924  7396267.655782 
-341311.937084  7396274.514607 
-341400.814958  7396298.330528 
-341472.746828  7396314.617738 
-341519.173107  7396325.405890 
-341612.372005  7396347.742064 
-341643.196415  7396353.031158 
-341780.158060  7396384.215816 
-341854.332905  7396402.922612 
-341881.759868  7396405.132234 
-341899.283108  7396406.841941 
-341980.417772  7396412.301006 
-342000.010816  7396350.091661 
-342015.653915  7396258.917279 
-342048.292496  7396186.579670 
-342073.690886  7396157.934576 
-342102.750603  7396104.963650 
-342191.628477  7396049.993066 
-342234.879957  7396029.906506 
-342314.917872  7395985.324143 
-342384.639752  7395945.910894 
-342423.364051  7395920.065321 
-342544.995953  7395870.413826 
-342584.396443  7395854.086623 
-342647.117273  7395830.040741 
-342723.617555  7395798.906075 
-342827.783940  7395759.482827 
-342882.736821  7395734.797056 
-343006.339573  7395722.839104 
-343090.541834  7395728.968054 
-343259.927657  7395711.531041 
-343297.093419  7395688.724948 
-343318.179031  7395674.867321 
-343350.240375  7395644.822468 
-343405.696277  7395597.970493 
-343445.360646  7395570.445208 
-343492.207482  7395542.170051 
-343552.363735  7395509.005732 
-343636.450549  7395469.902430 
-343738.406944  7395422.220597 
-343807.328940  7395384.187112 
-343846.012008  7395366.440152 
-343874.304826  7395346.583553 
-343898.210648  7395326.357018 
-343918.537607  7395306.080491 
-343936.316480  7395286.113911 
-343964.601051  7395247.540519 
-343997.709667  7395210.626841 
-344050.535021  7395155.316316 
-344090.867335  7395118.082693 
-344168.159255  7395047.824728 
-344203.749986  7395025.048629 
-344250.209250  7394992.104272 
-344282.097423  7394964.748958 
-344301.418342  7394942.802717 
-344319.494079  7394923.616004 
-344341.165174  7394892.611315 
-344358.284348  7394866.545779 
-344373.366704  7394840.910171 
-344384.985643  7394823.093222 
-344404.133391  7394799.657237 
-344422.332822  7394771.961981 
-344451.598694  7394744.276723 
-344520.751585  7394701.714014 
-344622.270930  7394640.994414 
-344735.615370  7394572.756103 
-344775.766267  7394550.809862 
-344813.905084  7394528.313716 
-344885.894678  7394485.601032 
-344961.125040  7394440.808704 
-344974.211808  7394429.100710 
-344990.374420  7394416.422881 
-345002.661304  7394403.925022 
-345015.789303  7394388.557654 
-345035.382347  7394369.720881 
-345088.512811  7394289.214671 
-345149.056636  7394192.841179 
-345116.962307  7394154.687714 
-345079.705837  7394106.685937 
-345076.539284  7394101.146885 
-345052.641708  7394071.002049 
-345039.357030  7394058.424203 
-344991.108335  7394021.250571 
-344940.303308  7393987.516349 
-344905.570184  7393968.749564 
-344885.911170  7393956.171718 
-344810.755024  7393910.289577 
-344767.610745  7393877.295229 
-344762.489836  7393871.536216 
-344722.817220  7393825.514099 
-344739.012817  7393811.626478 
-344767.132464  7393789.920196 
-344787.022372  7393771.853290 
-344757.756500  7393710.943724 
-344742.723621  7393680.099007 
-344714.241141  7393624.718493 
-344688.933459  7393556.690146 
-344666.775837  7393483.302716 
-344654.909511  7393420.023556 
-344634.541321  7393360.423765 
-344629.750261  7393350.075537 
-344616.176966  7393302.153746 
-344585.294832  7393250.942518 
-344548.904216  7393201.890920 
-344507.763771  7393158.378373 
-344457.931800  7393116.255588 
-344402.550115  7393079.071958 
-344347.176676  7393044.467885 
-344293.386513  7393008.863984 
-344268.070585  7392984.938082 
-344226.938387  7392941.625501 
-344190.547771  7392893.173800 
-344174.723254  7392863.108950 
-344159.690376  7392829.884641 
-344147.172598  7392791.691183 
-344131.216141  7392754.737513 
-344117.774785  7392723.292899 
-344098.255957  7392689.438698 
-344081.186260  7392664.362993 
-344054.402503  7392628.809083 
-344025.639650  7392597.804394 
-343967.462493  7392552.642130 
-343920.788828  7392520.207686 
-343840.033491  7392630.668765 
-343705.603439  7392558.971046 
-343746.430527  7392701.876568 
-343628.410474  7392913.500318 
-343616.214299  7392971.110450 
-343632.038815  7393007.504216 
-343632.830454  7393024.111372 
-343713.082770  7393162.907597 
-343724.297644  7393181.744371 
-343728.000201  7393187.533379 
-343730.927613  7393194.822131 
-343731.059553  7393210.439455 
-343726.697297  7393221.797510 
-343753.860381  7393270.919096 
-343658.929774  7393324.719880 
-343562.424136  7393379.300531 
-343464.335223  7393433.881182 
-343365.446425  7393486.092239 
-343302.956489  7393520.106412 
-343294.256716  7393489.251697 
-343295.303987  7393460.636599 
-343295.839992  7393447.718812 
-343232.550172  7393460.776575 
-343172.426904  7393467.895356 
-343160.412146  7393443.479538 
-343144.859755  7393423.672931 
-343123.386570  7393410.945111 
-343094.112452  7393398.287279 
-343074.618362  7393384.029721 
-343065.638217  7393406.985789 
-343047.438786  7393418.063891 
-343026.081049  7393439.420233 
-343005.514950  7393452.078065 
-342979.407383  7393461.566440 
-342946.183320  7393460.776575 
-342912.959257  7393456.827251 
-342876.568641  7393457.617116 
-342843.344578  7393459.986710 
-342774.917356  7393462.576267 
-342786.387863  7393484.512509 
-342783.237802  7393517.736818 
-342783.221310  7393521.686142 
-342743.688880  7393640.745748 
-342730.940208  7393625.968279 
-342511.095699  7393540.672889 
-342496.071066  7393593.673811 
-342495.163981  7393605.641761 
-342479.240510  7393657.312910 
-342447.022486  7393739.228879 
-342418.548252  7393825.454109 
-342354.466794  7393989.206060 
-342317.004168  7394110.825228 
-342254.308076  7394137.810605 
-342172.571438  7394157.647207 
-342159.080605  7394160.026800 
-342117.816467  7394156.067478 
-342085.276840  7394149.718565 
-342018.622558  7394134.641148 
-341952.751668  7394121.943323 
-Region 1
-147
-330573.868707  7401959.580807 
-330672.856459  7402025.149575 
-330738.397500  7402065.942588 
-330778.523659  7402094.027777 
-330810.626235  7402116.773881 
-330885.526748  7402164.925633 
-330924.127353  7402187.021848 
-330962.266170  7402191.131144 
-330997.931118  7402164.765660 
-331025.250880  7402135.560663 
-331089.711665  7402052.364914 
-331113.469055  7402011.481917 
-331165.346092  7401924.006900 
-331193.441000  7401881.944105 
-331192.921488  7401863.527260 
-331218.723943  7401784.370819 
-331227.613380  7401707.873922 
-331234.721631  7401641.165348 
-331239.166349  7401619.029140 
-331257.852308  7401563.778604 
-331279.836759  7401534.623598 
-331311.592993  7401502.479104 
-331338.797308  7401473.794018 
-331377.546345  7401436.040484 
-331390.558897  7401423.512630 
-331419.940217  7401353.414638 
-331445.140698  7401291.545235 
-331461.525958  7401252.471928 
-331482.479630  7401230.405708 
-331499.837946  7401204.040224 
-331509.271634  7401188.382906 
-331585.549267  7401091.649476 
-331665.240840  7400988.817090 
-331689.047708  7400963.191479 
-331709.869441  7400950.923581 
-331654.636188  7400835.513349 
-331703.668275  7400807.538141 
-331750.267724  7400781.452609 
-331800.940812  7400753.797347 
-331844.728297  7400724.142426 
-331865.459320  7400710.894695 
-331887.658173  7400696.707126 
-331932.913487  7400666.042378 
-331996.623865  7400626.879087 
-332030.219009  7400601.613414 
-332051.683947  7400531.615404 
-332094.259236  7400400.557853 
-332099.413130  7400382.880881 
-332109.729165  7400346.787064 
-332122.989103  7400304.054383 
-332147.298991  7400223.768136 
-332182.642336  7400104.008649 
-332204.733988  7400048.868095 
-332227.097765  7399999.996466 
-332230.420996  7399994.147468 
-332242.889297  7399974.100902 
-332268.337165  7399932.238072 
-332290.239153  7399894.174592 
-332323.570418  7399841.403631 
-332437.838436  7399655.405491 
-332408.448870  7399636.028810 
-332393.003680  7399623.540949 
-332375.777304  7399606.983785 
-332356.299707  7399582.028060 
-332344.911663  7399567.770502 
-332322.119081  7399546.374167 
-332286.149023  7399519.348796 
-332261.583502  7399501.241898 
-332237.760142  7399486.194475 
-332216.987887  7399478.235839 
-332203.546531  7399473.656623 
-331999.996573  7399428.104426 
-331940.846361  7399415.636561 
-331868.493933  7399398.089567 
-331653.852796  7399351.307580 
-331630.260330  7399256.933746 
-331561.841354  7399202.673040 
-331571.275042  7399153.131526 
-331658.569640  7399122.466779 
-331490.833062  7399082.843566 
-331595.857056  7398431.905066 
-331543.237858  7398430.295341 
-331451.028507  7398392.191868 
-331325.083826  7398366.016352 
-331190.513588  7398378.574201 
-331166.014037  7398379.634019 
-331157.124600  7398323.783586 
-330389.755115  7398425.616143 
-330238.948049  7398440.953516 
-329851.350470  7398485.715848 
-329395.482347  7398538.076879 
-329435.657983  7399061.717185 
-329451.301082  7399191.105022 
-329458.986569  7399344.238791 
-329465.608293  7399378.612903 
-329488.079271  7399409.027693 
-329515.836083  7399431.503843 
-329573.328804  7399496.512708 
-329601.456696  7399528.847169 
-329633.196438  7399562.451413 
-329650.208412  7399584.597620 
-329805.979709  7399801.140528 
-329890.602528  7399920.420097 
-329905.915778  7399944.905902 
-329935.247620  7399999.116617 
-330000.607245  7400055.746916 
-330049.103327  7400141.592212 
-330098.036460  7400238.035692 
-330129.677247  7400322.161282 
-330108.006152  7400339.758268 
-330060.656296  7400395.078792 
-330016.423515  7400429.032976 
-329971.498050  7400459.587742 
-329922.935998  7400489.322649 
-329889.893352  7400509.579179 
-329860.586248  7400527.626088 
-329851.292746  7400535.624718 
-329847.557204  7400539.644029 
-329842.832114  7400552.141888 
-329841.760104  7400575.737847 
-329843.937108  7400640.916682 
-329818.852075  7400759.126434 
-329773.069002  7400988.187198 
-329755.669456  7401073.362608 
-329824.962532  7401089.719806 
-329875.660358  7401164.427009 
-329910.055386  7401220.687373 
-329936.138213  7401257.821012 
-329915.687561  7401359.213644 
-329975.266578  7401452.597648 
-330017.973806  7401536.203328 
-330012.292153  7401579.055987 
-330010.857309  7401601.132206 
-330001.069033  7401699.865294 
-330020.381706  7401744.507647 
-330091.389998  7401907.479731 
-330094.474088  7401909.779337 
-330193.189715  7401980.037303 
-330210.251166  7402002.603437 
-330245.413094  7402048.075648 
-330311.721034  7402142.179529 
-330356.531052  7402131.481362 
-330393.309240  7402119.443424 
-330422.072093  7402102.726287 
-330476.241582  7402053.904650 
-330495.636716  7402025.819461 
-330573.868707  7401959.580807 
-Region 1
-430
-333690.209977  7381015.128402 
-333674.583370  7380991.662421 
-333665.042481  7380978.374697 
-333653.976039  7380963.737205 
-333644.088809  7380955.318647 
-333637.269176  7380953.468964 
-333631.150473  7380953.398976 
-333597.307942  7380960.327789 
-333575.158567  7380961.177643 
-333553.091653  7380955.388635 
-333542.940544  7380951.059376 
-333537.902097  7380945.690296 
-333534.611851  7380939.231402 
-333535.708599  7380932.152615 
-333538.570041  7380922.774221 
-333542.148905  7380913.395828 
-333543.270393  7380904.437362 
-333541.579915  7380891.679548 
-333535.840539  7380876.442158 
-333527.206735  7380863.384394 
-333516.107309  7380853.176143 
-333495.252592  7380842.647946 
-333474.637015  7380823.851166 
-333465.021910  7380815.932522 
-333425.819330  7380787.127456 
-333413.318044  7380803.004737 
-333392.042769  7380815.182651 
-333371.229283  7380826.010796 
-333355.569691  7380835.229217 
-333342.012888  7380846.577273 
-333321.290110  7380869.283384 
-333305.102759  7380890.079822 
-333289.674062  7380910.906254 
-333279.679630  7380926.713547 
-333271.350937  7380941.700979 
-333265.529098  7380955.848556 
-333260.309234  7380970.146107 
-333231.241271  7380982.164048 
-333214.913735  7380990.692587 
-333193.976555  7381002.760520 
-333153.866889  7381030.965689 
-333139.576171  7381040.254098 
-333139.567925  7381040.284093 
-333042.419082  7381080.557194 
-332999.060401  7381099.593934 
-332950.110776  7381118.580681 
-332921.587064  7381125.249539 
-332898.679036  7381129.918739 
-332870.996439  7381139.787049 
-332832.717437  7381149.775338 
-332789.639128  7381160.703466 
-332779.463279  7381161.903261 
-332739.196935  7381174.591087 
-332656.289332  7381197.897095 
-332645.486770  7381199.696787 
-332635.022303  7381202.096376 
-332627.897560  7381202.046384 
-332620.797555  7381200.476653 
-332613.441917  7381197.117229 
-332603.307300  7381192.468025 
-332555.437931  7381164.662788 
-332533.857545  7381159.933598 
-332521.413983  7381159.333701 
-332514.033607  7381160.553492 
-332503.338246  7381161.753286 
-332499.511995  7381163.253029 
-332486.647875  7381192.158078 
-332464.589208  7381221.922980 
-332434.803823  7381255.517225 
-332347.847321  7381181.229950 
-332297.619530  7381276.573619 
-332239.533081  7381367.488046 
-332210.992877  7381413.840106 
-332206.473943  7381431.357106 
-332140.149509  7381473.629865 
-332120.721390  7381489.017229 
-332099.033803  7381500.305295 
-332058.421118  7381526.740767 
-332038.489978  7381541.858178 
-332009.413769  7381558.655301 
-331999.996573  7381564.084371 
-331991.766835  7381571.353126 
-331957.173898  7381595.908919 
-331918.507322  7381618.155109 
-331901.371655  7381627.243552 
-331885.712063  7381632.502651 
-331871.512054  7381632.912581 
-331860.569306  7381629.973085 
-331845.528181  7381624.044100 
-331832.721785  7381613.245950 
-331825.489840  7381601.627940 
-331758.126382  7381622.614345 
-331726.823691  7381635.412153 
-331617.280763  7381631.142884 
-331599.048347  7381650.869505 
-331588.806528  7381664.197222 
-331578.861574  7381681.084330 
-331566.401520  7381700.031084 
-331553.628108  7381713.888711 
-331520.610201  7381731.535688 
-331414.349273  7381775.648132 
-331355.223799  7381834.088121 
-331320.490676  7381860.553588 
-331271.079262  7381908.605357 
-331210.015924  7381972.024494 
-331194.463533  7381977.583542 
-331085.539072  7382035.363645 
-330891.059968  7382115.399935 
-330875.078773  7382113.470266 
-330857.539041  7382115.339946 
-330840.494082  7382119.499233 
-330792.121693  7382104.821747 
-330792.946316  7382068.737928 
-330792.195909  7382039.752893 
-330789.853980  7382019.146423 
-330786.596719  7381993.210865 
-330756.563947  7381940.919822 
-330660.577822  7382020.486193 
-330644.423456  7382037.883213 
-330621.103116  7382060.789290 
-330547.266367  7382166.091252 
-330456.706262  7382294.869194 
-330428.413444  7382335.022316 
-330418.278827  7382360.337980 
-330410.750018  7382377.814986 
-330403.114009  7382408.749687 
-330394.208080  7382465.849906 
-330393.358718  7382503.463464 
-330389.499482  7382513.221792 
-330385.681477  7382537.697600 
-330378.383563  7382558.983953 
-330365.206086  7382583.509752 
-330350.569027  7382601.166728 
-330320.536255  7382636.980593 
-330291.328106  7382672.564498 
-330255.762113  7382709.548163 
-330228.961864  7382738.563193 
-330193.536057  7382778.896284 
-330169.168445  7382806.631534 
-330154.787019  7382823.518641 
-330126.832297  7382855.033243 
-330115.798840  7382867.131171 
-330076.818908  7382909.213962 
-330067.311004  7382921.581844 
-330039.562438  7382957.155750 
-330029.526775  7382971.303327 
-329970.211638  7383043.950883 
-329878.892880  7383116.548448 
-329863.794032  7383129.626208 
-329853.527475  7383140.214394 
-329834.561144  7383160.370941 
-329817.029658  7383189.176007 
-329800.759845  7383219.020895 
-329788.844042  7383245.586345 
-329755.372591  7383351.518199 
-329738.121477  7383405.748910 
-329696.197640  7383547.194682 
-329674.947104  7383622.991698 
-329621.940333  7383811.589393 
-329616.728715  7383825.766965 
-329609.422555  7383847.563231 
-329600.079576  7383869.589459 
-329588.947164  7383892.355559 
-329479.610392  7384100.059981 
-329437.092827  7384158.389990 
-329418.192466  7384185.275384 
-329389.660508  7384135.743869 
-329337.247466  7384055.727575 
-329282.137907  7383981.070363 
-329208.111494  7383884.246948 
-329177.740627  7383845.093654 
-329148.903558  7383805.420450 
-329073.392824  7383703.307941 
-329064.107569  7383690.260176 
-329014.687908  7383623.311644 
-328969.457333  7383568.301066 
-328926.609919  7383502.902269 
-328885.988987  7383449.441426 
-328863.691179  7383416.697035 
-328844.370261  7383390.861460 
-328772.372421  7383294.108033 
-328723.958801  7383228.089342 
-328699.376787  7383193.295302 
-328691.946933  7383172.638840 
-328689.101984  7383095.602036 
-328691.707793  7383059.538213 
-328692.433461  7383035.912260 
-328704.299787  7382847.684502 
-328707.853912  7382793.563772 
-328716.998982  7382680.053215 
-328718.722444  7382658.206957 
-328721.237545  7382631.551523 
-328726.721288  7382559.933791 
-328728.857062  7382520.550537 
-328732.996669  7382451.392383 
-328737.020830  7382404.470420 
-328741.119207  7382316.055565 
-328751.567181  7382256.175822 
-328781.410290  7382150.953845 
-328820.992197  7382012.417575 
-328829.213689  7381990.991245 
-328883.399670  7381828.159137 
-328991.911819  7381769.789135 
-329049.239615  7381736.944761 
-329083.642889  7381717.128156 
-329222.278519  7381631.292858 
-329230.417548  7381629.313198 
-329239.306985  7381627.353533 
-329247.182135  7381627.153567 
-329261.398637  7381625.233896 
-329308.261966  7381601.697928 
-329325.842929  7381590.649820 
-329344.768029  7381569.973362 
-329352.222621  7381556.555660 
-329356.147827  7381539.818527 
-329357.541440  7381523.071396 
-329359.883369  7381514.702829 
-329366.092781  7381497.975694 
-329391.837513  7381480.388707 
-329408.412437  7381469.850512 
-329438.206068  7381454.573129 
-329513.601355  7381414.489995 
-329530.662806  7381406.751320 
-329542.347715  7381403.531872 
-329550.725885  7381403.341904 
-329568.009985  7381399.402579 
-329687.522606  7381362.958822 
-329744.660738  7381286.411933 
-329767.659475  7381263.465864 
-329802.120473  7381234.770779 
-329837.521541  7381215.983997 
-329902.592547  7381164.902747 
-329874.118313  7381130.918568 
-329824.731637  7381105.662894 
-329775.081083  7381096.814410 
-329726.222166  7381088.115900 
-329693.971158  7381077.947641 
-329670.856973  7381068.289296 
-329655.106673  7381055.841428 
-329646.992382  7381044.913300 
-329642.671357  7381039.574214 
-329601.003154  7380959.008015 
-329600.236254  7380952.649104 
-329602.767847  7380946.040236 
-329607.847525  7380941.221062 
-329614.964022  7380936.901801 
-329620.794107  7380932.072629 
-329650.488784  7380917.065199 
-329687.547344  7380892.679376 
-329710.142016  7380875.142380 
-329732.217176  7380843.877736 
-329697.112972  7380660.899078 
-329686.821676  7380620.795947 
-329679.103204  7380580.032930 
-329662.767421  7380489.858376 
-329661.489255  7380461.653207 
-329664.779501  7380404.852937 
-329658.133040  7380306.869720 
-329659.271019  7380257.218225 
-329676.357209  7380182.341051 
-329683.721093  7380175.482226 
-329696.923308  7380173.192618 
-329754.292335  7380135.069148 
-329758.852501  7380112.962935 
-329761.870621  7380082.318184 
-329760.600702  7380050.693601 
-329753.863531  7380006.511169 
-329737.049467  7379963.918465 
-329718.083136  7379921.505730 
-329713.927036  7379883.322270 
-329718.940744  7379843.019174 
-329737.197899  7379777.150456 
-329744.339135  7379733.497934 
-329742.764105  7379707.312419 
-329733.231462  7379677.157584 
-329696.733645  7379593.821859 
-329694.820520  7379402.474635 
-329742.797090  7379405.704082 
-329779.665987  7379409.203482 
-329733.487095  7379341.785030 
-329721.101257  7379307.260944 
-329738.921361  7379301.042009 
-329760.584209  7379288.894090 
-329789.479001  7379269.077485 
-329849.684731  7379240.982297 
-329900.654683  7379251.880430 
-329911.877803  7379251.900427 
-329934.926017  7379251.840437 
-329950.940197  7379251.910425 
-329976.651944  7379251.110562 
-329998.207591  7379248.481013 
-330018.806676  7379248.610990 
-330051.371040  7379246.551343 
-330065.059783  7379244.611675 
-330077.552823  7379240.322410 
-330090.367465  7379234.823352 
-330109.193610  7379221.315666 
-330122.255639  7379211.607329 
-330136.810236  7379205.688343 
-330158.695732  7379200.959153 
-330179.525711  7379198.539567 
-330205.377644  7379202.398906 
-330223.197748  7379206.138265 
-330240.679757  7379211.547339 
-330264.016590  7379213.267044 
-330284.294071  7379215.156721 
-330301.132874  7379214.536827 
-330318.375742  7379213.896936 
-330336.649390  7379212.447185 
-330367.143951  7379209.247733 
-330388.312025  7379207.957954 
-330409.331667  7379215.736621 
-330475.078863  7379219.156036 
-330524.242891  7379194.360283 
-330587.483233  7379154.867048 
-330609.203805  7379142.299201 
-330688.260418  7379193.260471 
-330768.842584  7379246.821297 
-330874.748924  7379314.849644 
-330907.527691  7379332.186675 
-330931.606685  7379346.214272 
-331073.623269  7379439.518290 
-331105.412488  7379458.115104 
-331155.739234  7379501.247716 
-331424.887956  7379643.283386 
-331459.249999  7379662.190148 
-331466.762315  7379602.090442 
-331489.299263  7379573.545332 
-331523.859216  7379502.927428 
-331607.781105  7379390.656659 
-331647.461967  7379361.291689 
-331670.782307  7379346.354248 
-331743.489323  7379296.212837 
-331779.426396  7379271.817015 
-331783.351602  7379258.149356 
-331797.452656  7379193.040509 
-331803.843485  7379173.823801 
-331814.118288  7379145.428664 
-331841.899839  7379042.256337 
-331882.372339  7379052.574570 
-331938.718833  7379060.513210 
-331962.641149  7379060.843153 
-332011.895884  7379048.615248 
-332081.848659  7379036.437334 
-332108.558200  7379031.718142 
-332168.351618  7379022.489723 
-332172.557196  7378975.767726 
-332179.236643  7378958.000769 
-332195.085898  7378932.625116 
-332213.491485  7378906.509589 
-332251.828211  7378848.689493 
-332271.058421  7378852.268880 
-332304.637072  7378865.676583 
-332327.817227  7378882.843643 
-332360.051742  7378862.427140 
-332382.621675  7378836.631559 
-332396.590790  7378801.167633 
-332419.160723  7378758.184996 
-332439.578390  7378678.668616 
-332498.349276  7378707.203728 
-332529.445812  7378718.301827 
-332559.923881  7378742.567671 
-332591.943994  7378742.567671 
-332645.486770  7378750.066386 
-332771.555144  7378760.504598 
-332844.509546  7378799.247962 
-332946.416465  7378820.684290 
-333003.554597  7378827.413138 
-333055.637790  7378832.452275 
-333156.464452  7378808.926304 
-333201.835213  7378820.684290 
-333263.418063  7378877.494559 
-333277.444902  7378918.147596 
-333275.762671  7378968.568959 
-333270.245942  7379020.010148 
-333247.519331  7379027.388884 
-333228.734417  7379028.828637 
-333157.940527  7379020.820009 
-333147.484307  7379087.818533 
-333226.895508  7379100.466366 
-333242.439652  7379133.440718 
-333278.657098  7379167.924811 
-333310.693704  7379230.904023 
-333329.833205  7379295.802907 
-333350.547736  7379322.318365 
-333372.383755  7379331.816738 
-333372.375509  7379331.856731 
-333390.921282  7379335.446116 
-333429.216777  7379360.271864 
-333444.661967  7379379.158629 
-333454.466735  7379407.683743 
-333462.218192  7379442.797728 
-333464.650830  7379474.352323 
-333461.772895  7379496.208579 
-333457.855936  7379522.894008 
-333464.782769  7379577.604637 
-333505.972692  7379786.038934 
-333490.576979  7379795.387332 
-333441.511907  7379825.452183 
-333503.490576  7379968.087750 
-333528.196283  7380021.878537 
-333554.510005  7380078.288874 
-333593.539415  7380170.653053 
-333625.881131  7380236.751731 
-333523.025896  7380219.514683 
-333580.757757  7380291.902284 
-333630.111448  7380348.182644 
-333717.282352  7380442.436499 
-333750.333244  7380480.320010 
-333791.218056  7380524.112508 
-333824.277194  7380559.696413 
-333859.587554  7380587.091721 
-333871.816714  7380596.920037 
-333907.786772  7380617.256554 
-333936.211529  7380625.595125 
-333985.961039  7380638.162973 
-333928.699213  7380682.275417 
-333882.751216  7380708.410940 
-333844.216580  7380728.747456 
-333830.428883  7380737.555947 
-333817.861627  7380746.574403 
-333800.033276  7380757.952454 
-333789.799704  7380767.550810 
-333775.467755  7380777.529100 
-333756.633364  7380795.016105 
-333747.537772  7380811.773235 
-333733.527426  7380853.126151 
-333719.970623  7380901.627843 
-333707.700232  7380948.349840 
-333690.209977  7381015.128402 
-Region 1
-292
-326888.372597  7378966.659286 
-326899.570979  7379005.862571 
-326911.560998  7379047.825383 
-326936.068795  7379133.590692 
-326955.142327  7379191.620752 
-326990.906229  7379253.620132 
-327010.787891  7379267.137817 
-327047.763990  7379293.593285 
-327118.442432  7379338.095662 
-327157.546058  7379281.435368 
-327203.477563  7379218.856087 
-327252.311741  7379143.678964 
-327404.899993  7378894.401663 
-327454.839165  7378812.035772 
-327465.369602  7378792.669089 
-327530.655010  7378682.148020 
-327583.430886  7378590.603701 
-327727.129701  7378367.911846 
-327782.272246  7378289.275316 
-327831.972278  7378213.318327 
-327931.957824  7378116.364934 
-328011.014438  7378053.305735 
-328064.953032  7378021.691151 
-328171.106759  7377971.119813 
-328426.319352  7377864.928003 
-328532.489571  7377825.134819 
-328734.926287  7377762.125612 
-328936.010622  7377704.465488 
-329087.287723  7377676.120344 
-329205.530424  7377655.693843 
-329290.639771  7377651.264601 
-329315.345478  7377648.785026 
-329328.960005  7377646.825362 
-329364.963048  7377635.747259 
-329448.060314  7377568.498778 
-329523.727726  7377438.361070 
-329625.543936  7377174.836209 
-329651.247437  7377095.949722 
-329682.426435  7377011.584173 
-329721.117749  7376895.304090 
-329833.423164  7376649.296229 
-329930.068988  7376486.844056 
-330072.497883  7376332.340521 
-330184.976469  7376193.664275 
-330462.791980  7375946.156671 
-330220.690894  7375624.781719 
-330030.260690  7375341.120308 
-329979.950437  7375266.433101 
-329918.738667  7375173.019102 
-329881.383242  7375097.821983 
-329829.506205  7374999.848765 
-329784.325107  7374878.929477 
-329749.987803  7374789.584781 
-329642.061136  7374776.137085 
-329554.700569  7374765.808854 
-329498.873587  7374761.389611 
-329409.476201  7374758.570094 
-329299.941519  7374725.825702 
-329205.373746  7374695.030977 
-329118.408997  7374642.170032 
-329049.973529  7374600.607151 
-328977.835504  7374560.873957 
-328901.887719  7374524.760143 
-328857.473521  7374503.853724 
-328808.103338  7374480.017807 
-328785.302510  7374467.889885 
-328733.343011  7374446.903479 
-328698.139853  7374431.646093 
-328674.110336  7374420.288038 
-328616.782541  7374378.845137 
-328582.519453  7374344.770974 
-328545.485631  7374303.468048 
-328500.436473  7374232.820150 
-328476.209047  7374162.982112 
-328466.956776  7374149.564411 
-328455.453285  7374086.315245 
-328428.628296  7374028.825092 
-328381.649520  7373968.065500 
-328369.865657  7373926.812566 
-328369.873903  7373926.812566 
-328341.383176  7373903.246603 
-328306.031585  7373871.811987 
-328236.293213  7373820.740735 
-328205.848129  7373799.134436 
-328131.549591  7373738.874758 
-328094.573493  7373760.781006 
-328041.360566  7373783.177170 
-327990.877142  7373839.217570 
-327966.352852  7373858.204318 
-327960.019747  7373870.072285 
-327948.153421  7373904.876324 
-327914.137720  7374004.559249 
-327889.613430  7374124.598687 
-327888.186832  7374153.543729 
-327885.605762  7374190.457406 
-327886.974636  7374246.407822 
-327893.588113  7374292.899859 
-327899.863495  7374337.832162 
-327917.518675  7374391.852909 
-327935.231578  7374442.034313 
-327950.586059  7374495.325185 
-327960.176426  7374520.060948 
-327965.701400  7374564.233382 
-327947.081411  7374599.537335 
-327914.912866  7374660.676862 
-327893.315988  7374705.899116 
-327890.001003  7374710.238372 
-327830.059152  7374861.742421 
-327826.983308  7374876.919821 
-327802.879576  7374907.264624 
-327705.986366  7374988.900640 
-327649.854274  7375039.961894 
-327636.940677  7375047.500602 
-327574.681635  7375076.065710 
-327572.405676  7374941.458766 
-327562.485460  7374789.494797 
-327544.063381  7374666.105932 
-327497.348484  7374570.662281 
-327473.046843  7374515.401746 
-327372.104733  7374380.064928 
-327282.163096  7374258.605733 
-326939.218856  7373812.612128 
-326840.923786  7373671.666270 
-326746.067395  7373527.950888 
-326700.935775  7373459.772566 
-326575.411652  7373293.091117 
-326532.052971  7373234.011237 
-326437.848032  7373096.694758 
-326338.217074  7372955.578930 
-326299.707176  7372903.227897 
-326286.925519  7372889.080322 
-326165.969808  7372680.406064 
-326077.867080  7372527.082327 
-325983.068412  7372347.063163 
-325896.829332  7372167.483923 
-325821.879342  7371982.275648 
-325770.241445  7371841.869698 
-325606.792908  7371411.253459 
-325562.403448  7371152.427793 
-325552.730619  7370778.031924 
-325574.055372  7370336.627532 
-325529.971023  7370347.375691 
-325513.626994  7370358.253828 
-325504.820019  7370378.640336 
-325502.766708  7370396.777229 
-325501.645221  7370430.881388 
-325495.188422  7370441.659541 
-325484.938357  7370454.717305 
-325472.577258  7370468.045022 
-325449.166209  7370488.291554 
-325436.961787  7370494.230536 
-325421.813462  7370508.118158 
-325415.637035  7370521.005950 
-325405.073614  7370534.943563 
-325389.075926  7370542.832211 
-325350.524798  7370569.837586 
-325338.246160  7370581.875524 
-325313.862056  7370592.103772 
-325297.377841  7370597.772801 
-325242.614624  7370608.630941 
-325218.296489  7370613.100175 
-325198.241656  7370619.169136 
-325153.629549  7370625.927978 
-325096.301753  7370635.996253 
-325062.632393  7370638.245868 
-325054.344932  7370639.515650 
-325004.958256  7370644.524792 
-324981.901795  7370646.024535 
-324897.039836  7370649.983857 
-324853.606939  7370650.673739 
-324806.751856  7370656.092811 
-324748.269589  7370662.021795 
-324720.158188  7370659.912157 
-324703.278154  7370655.942837 
-324664.496132  7370634.656483 
-324644.408314  7370626.547872 
-324622.374385  7370627.827652 
-324606.863226  7370637.945919 
-324592.151950  7370640.315513 
-324574.628710  7370639.325683 
-324545.832873  7370635.096407 
-324509.532965  7370627.017791 
-324482.056525  7370623.138456 
-324462.999486  7370622.908495 
-324434.244879  7370623.558384 
-324410.908047  7370623.158452 
-324368.209064  7370621.648711 
-324332.791504  7370617.119487 
-324312.629470  7370615.329793 
-324284.394376  7370606.341333 
-324264.133387  7370604.101716 
-324241.711886  7370595.193242 
-324215.381672  7370581.135650 
-324182.833800  7370575.426628 
-324161.302891  7370576.606426 
-324149.799400  7370583.775198 
-324115.882653  7370606.401323 
-324098.153257  7370631.437034 
-324095.407262  7370647.464289 
-324093.659061  7370673.809776 
-324105.005875  7370696.205940 
-324113.953035  7370706.614157 
-324124.763843  7370715.162693 
-324148.818098  7370740.488355 
-324165.549700  7370755.865721 
-324181.308247  7370768.243600 
-324186.016845  7370782.921086 
-324191.682005  7370795.398949 
-324203.201989  7370803.837504 
-324218.358561  7370806.577034 
-324234.504681  7370811.646166 
-324251.359976  7370817.165221 
-324258.031177  7370829.873044 
-324263.440704  7370846.110263 
-324262.846975  7370878.224762 
-324257.940468  7370888.243046 
-324249.826177  7370909.849345 
-324237.959851  7370929.865916 
-324194.848558  7370979.627392 
-324167.207192  7371072.891417 
-324161.640987  7371120.113328 
-324188.556684  7371170.284734 
-324217.872034  7371232.884012 
-324234.496435  7371307.851171 
-324233.952183  7371352.593507 
-324228.237545  7371412.333274 
-324210.005129  7371469.373503 
-324164.197318  7371531.072935 
-324072.911545  7371627.096487 
-324012.136825  7371678.637658 
-323971.441677  7371730.428787 
-323955.881040  7371777.640700 
-323974.888601  7371857.507019 
-323997.120439  7371882.702704 
-324011.839961  7371912.787550 
-324033.494562  7371985.265136 
-324022.073533  7372094.666396 
-323985.946797  7372181.401539 
-323940.015292  7372253.059265 
-323922.500298  7372360.170918 
-323933.838865  7372669.108000 
-323911.755459  7372833.209890 
-323880.823848  7372912.476313 
-323798.996502  7373050.932596 
-323746.905063  7373209.685404 
-323699.307819  7373418.219684 
-323823.100234  7373534.359790 
-323906.172761  7373704.610627 
-323913.907726  7373898.987332 
-323887.074491  7374043.092648 
-323820.238792  7374181.728901 
-323766.976388  7374445.023801 
-323784.664553  7374692.451419 
-323801.594064  7374893.696948 
-323830.991877  7375319.813958 
-323848.416162  7375581.529128 
-323918.509122  7375990.759031 
-324051.281682  7376201.592917 
-324248.828383  7376428.054126 
-324408.862982  7376720.733993 
-325318.084126  7376989.218004 
-325444.540073  7377051.717298 
-325444.531827  7377051.727297 
-325491.881684  7377070.224128 
-325496.046030  7377071.953832 
-325580.883251  7377107.177798 
-325636.932881  7377130.673774 
-325778.520661  7377197.552318 
-325903.582995  7377263.111088 
-325958.230765  7377304.893931 
-326007.642179  7377362.494065 
-326243.797733  7377371.212572 
-326251.747099  7377371.212572 
-326390.910487  7377377.701460 
-326430.896460  7377373.062255 
-326464.780222  7377452.288684 
-326514.059696  7377633.527639 
-326554.507457  7377794.999981 
-326564.427673  7377879.465513 
-326614.993559  7378107.236497 
-326618.052911  7378115.675052 
-326659.589174  7378294.304454 
-326664.042139  7378309.671822 
-326693.596629  7378420.962759 
-326703.887925  7378443.088969 
-326782.647674  7378615.319467 
-326802.554075  7378668.590343 
-326823.499501  7378724.120831 
-326830.343872  7378752.036049 
-326843.579073  7378801.657549 
-326873.966432  7378913.928318 
-326888.372597  7378966.659286 
-Region 1
-267
-348002.318410  7391343.469251 
-348043.970121  7391376.063667 
-348068.469672  7391394.030590 
-348086.751566  7391407.228329 
-348103.821263  7391417.796519 
-348127.421975  7391430.094412 
-348152.449285  7391439.292837 
-348196.781021  7391457.089788 
-348210.337824  7391478.036200 
-348222.278366  7391495.993125 
-348235.472335  7391517.339468 
-348246.027511  7391540.275539 
-348257.423801  7391565.481222 
-348263.987801  7391582.058382 
-348270.848665  7391608.923781 
-348271.673288  7391650.796608 
-348285.477478  7391693.839235 
-348295.826497  7391722.884260 
-348313.976451  7391757.798280 
-348345.501791  7391794.252036 
-348361.153137  7391808.279633 
-348393.560823  7391835.564959 
-348425.556198  7391862.090415 
-348442.353770  7391876.098016 
-348456.496055  7391891.315409 
-348470.011627  7391910.752080 
-348479.676210  7391929.138931 
-348481.341948  7391946.995872 
-348482.851008  7391973.241376 
-348486.512335  7392070.054793 
-348491.460073  7392164.818561 
-348496.811877  7392234.846566 
-348510.286218  7392281.578561 
-348521.377398  7392314.862860 
-348558.609129  7392370.333358 
-348657.646360  7392517.698116 
-348741.188922  7392623.859931 
-348786.790578  7392714.184459 
-348878.686572  7392666.642603 
-349016.044036  7392602.833533 
-349051.412119  7392638.127487 
-349103.709714  7392666.642603 
-349165.218348  7392675.981003 
-349303.367450  7392714.184459 
-349382.597234  7392728.442017 
-349407.146263  7392735.580794 
-349441.219688  7392751.418082 
-349461.818772  7392763.306045 
-349477.668027  7392775.983874 
-349498.267112  7392805.298852 
-349518.066311  7392851.250981 
-349521.241110  7392867.098267 
-349535.507089  7392970.090625 
-349548.198038  7393063.314657 
-349545.971556  7393238.614629 
-349545.996295  7393279.367649 
-349547.678526  7393351.705258 
-349548.231023  7393407.275739 
-349547.332184  7393429.751889 
-349544.223355  7393530.244676 
-349543.522425  7393629.737633 
-349640.902163  7393620.389235 
-349676.558864  7393610.480932 
-349712.100119  7393622.288909 
-349788.526184  7393646.024844 
-349904.418710  7393709.853910 
-349930.361351  7393725.271269 
-350035.847134  7393861.008019 
-350092.102919  7393925.996887 
-350129.936625  7393973.598733 
-350144.087157  7393988.036260 
-350252.953894  7393966.969869 
-350323.450920  7393954.512003 
-350362.933872  7393945.803494 
-350369.506118  7394021.390547 
-350379.368610  7394083.839850 
-350392.513102  7394156.137466 
-350405.657593  7394185.712400 
-350454.953560  7394221.866207 
-350491.105035  7394261.309451 
-350530.546756  7394343.465378 
-350530.546756  7394373.050311 
-350523.974511  7394405.914681 
-350563.407986  7394455.206238 
-350599.559461  7394497.928920 
-350606.131707  7394537.372164 
-350619.276198  7394576.805409 
-350639.001182  7394603.100905 
-350658.717919  7394635.965276 
-350685.006903  7394668.829646 
-350681.724903  7394698.404581 
-350664.143939  7394740.557360 
-350571.200674  7395067.051435 
-350538.487877  7395033.177237 
-350503.020839  7395003.812267 
-350459.076675  7394978.806550 
-350434.997682  7394967.208537 
-350413.128678  7394959.079929 
-350086.066678  7394873.004673 
-350034.956541  7394863.116367 
-349986.988217  7394873.104656 
-349957.013169  7394893.091232 
-349929.033708  7394919.076781 
-349909.053091  7394943.062673 
-349897.054826  7394979.026513 
-349181.216036  7394936.783748 
-349134.921697  7394844.179611 
-349102.332593  7394770.442241 
-349036.890507  7394673.808794 
-349082.723057  7394652.302477 
-349075.507605  7394634.605509 
-349056.030008  7394581.804553 
-349021.733935  7394496.059240 
-349013.157855  7394477.192472 
-348996.013942  7394454.896291 
-348966.863516  7394436.039521 
-348934.266167  7394420.602166 
-348908.150354  7394405.054829 
-348885.943255  7394393.146868 
-348860.660312  7394382.698658 
-348851.605951  7394378.309410 
-348828.087701  7394373.620213 
-348802.046104  7394379.539199 
-348775.130408  7394393.146868 
-348751.133876  7394403.435106 
-348733.289033  7394408.244282 
-348711.337567  7394404.124988 
-348682.533484  7394389.037572 
-348653.028470  7394369.830862 
-348629.741115  7394349.954267 
-348615.301965  7394336.216620 
-348596.780931  7394317.009910 
-348575.629349  7394300.402755 
-348564.043395  7394285.045385 
-348539.576829  7394277.136740 
-348520.156956  7394276.726810 
-348498.048812  7394277.016760 
-348471.718597  7394278.736466 
-348456.388854  7394282.605803 
-348428.359916  7394291.924207 
-348391.086954  7394305.601864 
-348368.756161  7394315.800117 
-348324.671812  7394327.808060 
-348284.751810  7394340.295921 
-348223.878135  7394353.103727 
-348101.322655  7394364.211825 
-347921.010576  7394383.298555 
-347829.056858  7394393.236853 
-347815.269160  7394394.876572 
-347780.503052  7394397.376144 
-347752.136018  7394404.394942 
-347713.791046  7394415.393058 
-347685.753862  7394425.081398 
-347661.180094  7394433.319987 
-347626.141860  7394449.337244 
-347609.913278  7394459.275541 
-347548.396398  7394499.508650 
-347318.458502  7394656.561748 
-347294.041414  7394675.868441 
-347218.505941  7394729.509253 
-347186.799184  7394750.175713 
-347176.351210  7394757.204509 
-347140.620292  7394769.772356 
-347066.610372  7394790.678775 
-347018.477124  7394806.536059 
-346962.971745  7394807.515891 
-346860.133003  7394806.746023 
-346822.472468  7394809.665523 
-346782.593696  7394816.694319 
-346686.409662  7394868.085516 
-346617.850500  7394882.603029 
-346565.899247  7394898.500306 
-346430.289984  7394925.275720 
-346387.327123  7394929.964916 
-346341.610020  7394930.954747 
-346285.783039  7394920.986454 
-346235.522263  7394903.979367 
-346174.071352  7394867.085687 
-346126.630787  7394827.792418 
-346115.176773  7394818.963930 
-346097.628794  7394806.816011 
-346083.338076  7394794.798069 
-346058.467445  7394776.921131 
-346033.456627  7394772.161947 
-345972.533475  7394769.042481 
-345899.875937  7394769.042481 
-345838.952785  7394765.913017 
-345779.596417  7394747.176226 
-345755.286529  7394735.108294 
-345743.189308  7394728.849366 
-345734.192671  7394719.580953 
-345694.008789  7394678.358014 
-345604.397000  7394584.384111 
-345585.076082  7394559.308406 
-345568.666083  7394536.652287 
-345543.663511  7394488.240580 
-345517.118895  7394416.352893 
-345500.717142  7394389.017576 
-345475.722817  7394361.672260 
-345423.383991  7394329.647745 
-345376.817527  7394306.041789 
-345355.731915  7394296.593407 
-345311.812491  7394276.566838 
-345249.974007  7394251.931057 
-345175.988826  7394226.315445 
-345149.056636  7394192.841179 
-345185.076172  7394137.180713 
-345208.652145  7394101.936750 
-345212.552612  7394097.157569 
-345236.326495  7394060.013931 
-345279.173910  7394006.163155 
-345355.921578  7393919.937925 
-345398.183510  7393875.395555 
-345566.085013  7393697.206077 
-345617.863095  7393643.945200 
-345679.157327  7393578.416424 
-345741.853419  7393512.777668 
-345769.626724  7393483.962603 
-345795.346717  7393465.515763 
-345873.141657  7393416.724121 
-345923.583850  7393378.540661 
-345984.787374  7393324.199969 
-346022.678804  7393283.376962 
-346063.019364  7393227.996448 
-346100.993256  7393158.388371 
-346228.356288  7392901.292410 
-346263.163628  7392865.698506 
-346376.293666  7392773.934225 
-346403.176378  7392745.449104 
-346422.183940  7392720.143439 
-346442.741793  7392679.790351 
-346455.399757  7392652.105093 
-346463.307892  7392630.748751 
-346476.757494  7392577.747830 
-346480.723931  7392523.957044 
-346479.924047  7392470.166258 
-346477.549132  7392398.968453 
-346486.232413  7392292.756646 
-346516.306416  7392184.595173 
-346565.338504  7392082.332690 
-346624.348530  7391987.368956 
-346684.867617  7391909.972214 
-346704.996666  7391885.286442 
-346889.671001  7391780.154450 
-346952.960821  7391734.272310 
-347015.195124  7391701.957845 
-347066.107352  7391680.481523 
-347096.173109  7391670.193286 
-347142.063383  7391658.325319 
-347192.678746  7391650.416673 
-347247.268793  7391647.257214 
-347272.576475  7391648.047079 
-347341.407762  7391649.626809 
-347405.480974  7391649.626809 
-347508.286732  7391628.270467 
-347541.510795  7391615.612635 
-347574.726612  7391601.375074 
-347628.533267  7391566.571035 
-347672.823772  7391530.177269 
-347707.631112  7391496.952960 
-347719.654116  7391482.305469 
-347750.651697  7391439.652775 
-347799.609568  7391371.704414 
-347814.601216  7391351.257916 
-347907.783622  7391271.701544 
-347914.586762  7391276.450730 
-348002.318410  7391343.469251 
-Region 1
-921
-359001.924239  7391495.483212 
-358973.210864  7391519.799047 
-358956.240121  7391533.146761 
-358936.836740  7391544.584801 
-358920.756590  7391550.853727 
-358896.257039  7391561.131967 
-358881.718935  7391565.751176 
-358869.052724  7391566.850987 
-358853.492087  7391571.910121 
-358834.459787  7391587.007535 
-358824.275692  7391606.064270 
-358816.012969  7391637.768840 
-358808.739793  7391660.954868 
-358802.027362  7391690.119872 
-358796.238508  7391718.854950 
-358793.517252  7391736.441938 
-358789.996111  7391763.207353 
-358789.864171  7391776.825021 
-358791.084614  7391798.101376 
-358799.256628  7391808.479599 
-358813.860703  7391817.588038 
-358830.724244  7391826.166569 
-358864.673976  7391841.004027 
-358893.766678  7391851.582215 
-358916.625229  7391861.990433 
-358939.450795  7391876.937872 
-358961.055920  7391890.875485 
-358978.909009  7391902.233539 
-358994.395430  7391905.482983 
-359017.633308  7391908.592450 
-359046.824965  7391908.982383 
-359074.878641  7391910.912053 
-359100.771806  7391913.821554 
-359134.960678  7391914.371460 
-359159.550938  7391915.161325 
-359184.363846  7391914.741397 
-359205.663859  7391917.600907 
-359225.248657  7391930.298732 
-359252.288047  7391952.154988 
-359266.652981  7391976.110885 
-359284.085513  7391999.306912 
-359293.247075  7392013.014564 
-359312.403069  7392037.790320 
-359326.100058  7392056.967035 
-359342.971846  7392085.252190 
-359357.039915  7392108.198259 
-359361.839222  7392129.174666 
-359369.104151  7392148.741315 
-359371.792422  7392177.336417 
-359369.029935  7392188.164562 
-359357.303795  7392208.651053 
-359334.247334  7392228.027734 
-359307.422346  7392236.736242 
-359278.667739  7392244.434923 
-359247.200123  7392247.564387 
-359227.681295  7392249.484058 
-359204.294985  7392251.253755 
-359183.778363  7392250.943808 
-359161.422832  7392251.393731 
-359137.088205  7392255.583014 
-359122.005849  7392263.191710 
-359100.417218  7392279.258958 
-359084.345314  7392305.134526 
-359074.350883  7392325.411053 
-359066.731365  7392342.498126 
-359054.832055  7392359.665185 
-359041.209282  7392374.702610 
-359023.009851  7392388.590231 
-358994.057335  7392405.807282 
-358966.514924  7392414.735752 
-358941.495861  7392426.783689 
-358910.110707  7392442.321027 
-358889.866210  7392456.408614 
-358870.619508  7392473.055763 
-358854.085816  7392493.492262 
-358839.316817  7392511.509176 
-358830.320179  7392523.167179 
-358825.479642  7392538.844494 
-358822.981034  7392554.211861 
-358821.323541  7392567.259626 
-358819.393923  7392576.877979 
-358812.137240  7392588.326018 
-358806.422603  7392598.344302 
-358799.058719  7392610.682188 
-358803.148849  7392630.878729 
-358695.700464  7392606.132968 
-358683.141454  7392596.164675 
-358672.429601  7392584.316705 
-358662.212521  7392575.358239 
-358650.667798  7392565.389947 
-358637.614015  7392553.751940 
-358620.272192  7392541.733999 
-358609.329444  7392533.655382 
-358600.497731  7392528.476270 
-358588.408757  7392522.817239 
-358571.182381  7392520.327665 
-358560.264372  7392519.337835 
-358547.919764  7392519.217855 
-358532.218941  7392517.408165 
-358514.151450  7392516.678290 
-358505.418691  7392512.049083 
-358490.468275  7392507.029943 
-358479.731683  7392497.741534 
-358458.745026  7392493.662233 
-358434.880435  7392492.102500 
-358412.129084  7392490.772728 
-358391.299106  7392491.452611 
-358379.127669  7392493.552252 
-358336.206039  7392499.231279 
-358317.371648  7392504.030457 
-358294.636790  7392512.339034 
-358279.876037  7392517.948073 
-358258.452330  7392527.486439 
-358247.855923  7392535.914995 
-358231.742789  7392544.943449 
-358221.105151  7392547.393029 
-358203.012921  7392549.872605 
-358192.523716  7392557.521294 
-358181.737646  7392564.950022 
-358160.792220  7392577.587857 
-358146.542734  7392583.656818 
-358130.965604  7392590.255687 
-358131.270715  7392589.875752 
-358098.302284  7392600.683901 
-358070.009467  7392581.587172 
-358060.666488  7392576.618023 
-358046.037675  7392568.839356 
-358008.674004  7392558.951050 
-357988.182120  7392556.651443 
-357968.696277  7392554.911741 
-357956.277454  7392552.132218 
-357926.780687  7392541.104107 
-357909.587296  7392535.395084 
-357890.142684  7392530.006008 
-357867.399580  7392527.896369 
-357849.348581  7392526.176663 
-357827.298160  7392526.066682 
-357801.949247  7392529.256136 
-357785.374324  7392533.855348 
-357774.901611  7392539.514379 
-357765.410199  7392549.942593 
-357756.479532  7392565.799876 
-357749.734115  7392576.807991 
-357740.597291  7392592.775256 
-357729.192754  7392611.052125 
-357723.296700  7392619.080750 
-357708.585424  7392630.778746 
-357699.151736  7392635.457945 
-357687.005038  7392635.227984 
-357678.643361  7392634.368131 
-357668.888070  7392629.618945 
-357661.557171  7392627.779260 
-357646.235674  7392628.629114 
-357632.002680  7392633.468285 
-357621.876309  7392635.807885 
-357605.326124  7392637.087665 
-357594.243190  7392632.658424 
-357577.025060  7392628.839078 
-357552.459539  7392625.719613 
-357550.736077  7392660.253697 
-357480.420468  7392694.647806 
-357302.714198  7392777.373636 
-357234.921936  7392824.855503 
-357159.782282  7392875.006912 
-357071.885710  7392930.567395 
-356986.990765  7392986.037893 
-356949.016873  7393013.473194 
-356898.698374  7393073.692879 
-356860.303924  7393114.835832 
-356756.756005  7393224.587032 
-356710.626591  7393275.248354 
-356673.353629  7393314.431643 
-356626.193436  7393350.595448 
-356562.227424  7393415.704295 
-356220.206762  7393530.774585 
-356153.709158  7393544.252276 
-356091.796459  7393545.162121 
-355994.408475  7393532.714253 
-355972.877566  7393520.766299 
-355945.780452  7393504.769039 
-355918.543153  7393492.761096 
-355895.709340  7393479.253410 
-355885.005733  7393477.153770 
-355872.677618  7393474.704189 
-355861.289573  7393470.494910 
-355852.086780  7393461.986368 
-355844.599202  7393454.827594 
-355836.460173  7393452.198044 
-355822.301395  7393448.958599 
-355807.474672  7393441.169933 
-355792.928321  7393435.930831 
-355785.531452  7393430.431773 
-355784.162578  7393424.222836 
-355782.117513  7393414.344528 
-355776.889403  7393405.985960 
-355768.585448  7393399.477075 
-355751.581721  7393394.547919 
-355738.932003  7393394.207978 
-355719.693547  7393398.997157 
-355702.780528  7393405.476047 
-355691.474946  7393413.004758 
-355670.694444  7393429.961853 
-355657.418013  7393440.360072 
-355647.769923  7393446.019103 
-355635.260391  7393451.318195 
-355627.789306  7393452.907923 
-355621.266538  7393452.178048 
-355611.041212  7393443.999449 
-355603.759790  7393436.500733 
-355596.049565  7393431.441600 
-355590.170002  7393427.732235 
-355581.297058  7393426.532441 
-355570.271848  7393426.652420 
-355558.496230  7393430.081833 
-355546.885537  7393437.820507 
-355533.848247  7393445.779144 
-355520.390398  7393453.837764 
-355497.474123  7393459.046871 
-355478.763426  7393461.736411 
-355458.147849  7393461.316483 
-355448.120433  7393460.056698 
-355435.924258  7393458.656938 
-355419.819369  7393455.947402 
-355408.604496  7393454.177705 
-355395.641421  7393454.717613 
-355382.455698  7393455.797428 
-355368.569046  7393456.547299 
-355360.916544  7393455.807426 
-355352.794007  7393451.408180 
-355345.388892  7393446.579007 
-355337.802359  7393440.080120 
-355330.578661  7393436.900665 
-355323.956938  7393435.620884 
-355316.906411  7393436.550725 
-355309.938346  7393439.580206 
-355295.260055  7393451.808111 
-355287.343674  7393461.046529 
-355278.990242  7393465.445775 
-355265.796273  7393470.724871 
-355253.921701  7393474.234270 
-355256.436802  7393459.456801 
-355250.986043  7393432.611399 
-355249.048179  7393415.574318 
-355247.357702  7393401.996643 
-355240.290682  7393381.950077 
-355228.844914  7393365.882829 
-355213.358493  7393348.995722 
-355199.892398  7393332.648522 
-355184.034896  7393323.340117 
-355165.992144  7393307.942754 
-355141.641025  7393289.935838 
-355124.224986  7393265.450033 
-355109.835313  7393260.710844 
-355103.526947  7393258.091293 
-355091.462711  7393250.602576 
-355083.439129  7393243.933718 
-355077.707999  7393236.524987 
-355072.479888  7393229.636167 
-355067.639351  7393212.649077 
-355065.272683  7393201.001072 
-355064.695447  7393188.113280 
-355063.837839  7393176.735229 
-355063.087432  7393158.288388 
-355063.252356  7393146.670379 
-355061.405201  7393133.512632 
-355056.012166  7393102.367967 
-355047.089744  7393087.600497 
-355034.110177  7393072.773036 
-355016.108656  7393054.086237 
-354999.830596  7393038.968827 
-354988.590984  7393026.440973 
-354977.343125  7393014.922946 
-354967.381679  7393001.905176 
-354963.489458  7392989.977219 
-354955.169011  7392968.400914 
-354950.064594  7392952.413653 
-354943.005821  7392931.607217 
-354929.803606  7392878.386333 
-354928.022420  7392843.002394 
-354925.713475  7392809.378154 
-354921.491405  7392767.135389 
-354910.276531  7392734.660952 
-354901.675713  7392697.407333 
-354889.834126  7392655.824456 
-354878.866639  7392623.849933 
-354864.806816  7392596.134680 
-354848.908083  7392572.178784 
-354831.046747  7392543.643672 
-354812.954517  7392513.598818 
-354785.354383  7392474.065590 
-354762.627772  7392394.719181 
-354781.214776  7392295.576163 
-354843.127475  7392234.066699 
-354857.385208  7392217.039616 
-354876.161875  7392196.853074 
-354899.556432  7392174.716865 
-354936.483052  7392145.951793 
-354968.297010  7392118.366518 
-355011.391812  7392085.682116 
-355034.233871  7392067.855170 
-355052.721920  7392056.187168 
-355068.018677  7392047.368679 
-355087.191164  7392038.480201 
-355107.600585  7392028.941835 
-355126.410237  7392025.912354 
-355148.097823  7392021.473115 
-355163.345104  7392017.083866 
-355193.072765  7391994.347761 
-355206.629568  7391986.179160 
-355223.072552  7391974.271200 
-355240.406129  7391965.912632 
-355261.302078  7391958.703866 
-355283.913242  7391953.384778 
-355303.588748  7391945.826072 
-355323.734290  7391941.596797 
-355337.439525  7391939.297191 
-355363.266720  7391939.107223 
-355353.264042  7391928.599023 
-355347.483434  7391924.559715 
-355339.393882  7391906.762763 
-355347.293771  7391891.885312 
-355349.916072  7391884.936502 
-355355.828620  7391875.688086 
-355364.759287  7391870.688943 
-355379.132467  7391861.860455 
-355394.825044  7391843.833543 
-355405.429697  7391834.875077 
-355413.849098  7391829.975916 
-355419.473028  7391829.036077 
-355430.605439  7391827.926267 
-355438.480589  7391826.346538 
-355445.869212  7391822.317228 
-355462.567829  7391796.131714 
-355469.272015  7391788.662993 
-355474.607326  7391786.173419 
-355485.055300  7391782.064123 
-355491.924410  7391779.584548 
-355496.872149  7391774.655392 
-355502.059028  7391765.846901 
-355506.949042  7391756.808449 
-355511.773087  7391743.790679 
-355515.937434  7391735.192152 
-355521.190283  7391719.854779 
-355524.183664  7391706.597050 
-355529.197373  7391695.019033 
-355535.753126  7391682.011261 
-355543.026301  7391669.233450 
-355551.660105  7391652.936242 
-355556.451165  7391633.269610 
-355556.409934  7391606.464202 
-355555.709004  7391583.978054 
-355550.777758  7391556.692727 
-355549.136758  7391525.778023 
-355545.599125  7391511.900400 
-355542.251156  7391500.242397 
-355534.202835  7391477.346319 
-355530.063227  7391462.688829 
-355528.100624  7391444.951868 
-355528.587152  7391426.565017 
-355530.879604  7391411.417612 
-355533.543136  7391399.599636 
-355539.158819  7391379.503078 
-355550.200522  7391356.577005 
-355557.242803  7391329.411659 
-355581.173364  7391343.589230 
-355603.792775  7391364.085719 
-355644.100350  7390990.169768 
-355650.878752  7390846.134440 
-355633.932748  7390737.683016 
-355635.631472  7390690.231144 
-355622.066422  7390639.399851 
-355606.819142  7390600.426527 
-355584.793460  7390575.010881 
-355559.370331  7390561.453203 
-355527.177046  7390542.806397 
-355493.293284  7390512.311620 
-355471.259356  7390476.727716 
-355456.003829  7390427.586133 
-355449.233674  7390371.665712 
-355439.057825  7390324.213840 
-355400.086139  7390256.435450 
-355366.185885  7390205.594158 
-355337.348817  7390159.572041 
-355358.104579  7390140.385328 
-355372.230372  7390125.457885 
-355381.705291  7390116.919347 
-355392.755240  7390103.741605 
-355408.216923  7390089.054121 
-355420.792425  7390076.326301 
-355427.175007  7390070.307332 
-355450.841689  7390051.380574 
-355458.568407  7390043.701889 
-355466.220909  7390034.143526 
-355471.416035  7390024.675148 
-355482.078411  7390009.047825 
-355492.064596  7390000.399306 
-355509.736268  7389988.951267 
-355517.149630  7389982.272411 
-355522.600388  7389978.003143 
-355527.828498  7389964.985372 
-355530.459046  7389956.926753 
-355532.792729  7389948.648171 
-355534.392498  7389941.019478 
-355541.187392  7389925.252178 
-355544.114804  7389917.643482 
-355548.963588  7389912.704328 
-355557.176833  7389908.025129 
-355562.817255  7389905.305595 
-355578.559309  7389902.476080 
-355584.397641  7389900.206468 
-355596.898926  7389895.347301 
-355602.357931  7389890.088202 
-355613.581051  7389880.119909 
-355620.285236  7389873.211092 
-355629.570492  7389862.672898 
-355635.293376  7389851.654785 
-355636.959115  7389838.717001 
-355638.682577  7389828.988667 
-355638.154818  7389810.481837 
-355633.635884  7389803.133096 
-355628.919040  7389794.774528 
-355623.138432  7389790.845201 
-355604.501951  7389777.037566 
-355599.884062  7389758.280779 
-355598.754328  7389748.632432 
-355596.099042  7389738.754124 
-355595.777439  7389719.587407 
-355613.350156  7389697.061265 
-355621.827282  7389686.293110 
-355636.390125  7389658.747828 
-355643.514868  7389640.101022 
-355651.860054  7389621.474213 
-355656.725330  7389594.278871 
-355659.628003  7389569.053192 
-355664.344847  7389535.328969 
-355672.228243  7389512.372901 
-355678.017097  7389494.815908 
-355698.038945  7389461.241659 
-355710.993773  7389441.874976 
-355726.199823  7389421.208516 
-355740.218415  7389396.542741 
-355747.211218  7389380.995405 
-355761.452459  7389343.821772 
-355763.695434  7389323.355278 
-355770.119247  7389293.630369 
-355775.504036  7389275.073548 
-355788.153754  7389234.560488 
-355809.874325  7389225.692007 
-355817.279440  7389219.783019 
-355819.852264  7389217.483413 
-355825.014405  7389211.994353 
-355829.879681  7389204.515634 
-355838.076434  7389180.559737 
-355852.292936  7389157.333716 
-355851.443574  7389150.244930 
-355860.605136  7389142.026338 
-355865.783769  7389134.437638 
-355873.832090  7389125.439179 
-355880.561014  7389115.980799 
-355894.670315  7389102.493109 
-355905.901681  7389091.534987 
-355914.436530  7389085.086091 
-355932.858609  7389069.868698 
-355945.401126  7389060.250345 
-355956.137718  7389057.810763 
-355961.745155  7389058.860583 
-355963.938652  7389063.759744 
-355963.072798  7389068.728893 
-355962.009034  7389073.478080 
-355961.448291  7389078.567208 
-355965.192079  7389081.376727 
-355971.492200  7389084.536185 
-355980.480591  7389083.626341 
-355986.846681  7389079.926975 
-355997.781183  7389078.047297 
-356013.820102  7389076.647537 
-356020.153207  7389076.047639 
-356032.110241  7389074.617884 
-356051.612577  7389072.818193 
-356058.762059  7389072.218295 
-356070.752078  7389067.799052 
-356080.490876  7389062.909890 
-356085.644770  7389057.650791 
-356086.444655  7389048.792308 
-356087.343494  7389040.723690 
-356087.384725  7389036.734373 
-356088.869047  7389020.797103 
-356093.519921  7389014.758138 
-356098.871724  7389010.048944 
-356105.015166  7389008.339237 
-356116.469181  7389005.459730 
-356123.090904  7389006.519549 
-356127.057341  7389007.889314 
-356134.874767  7389012.288561 
-356138.907174  7389017.307701 
-356148.274892  7389019.287362 
-356153.387555  7389018.337525 
-356165.369328  7389014.138244 
-356176.345061  7389008.929136 
-356183.222418  7389004.229941 
-356199.500477  7388999.630729 
-356211.589451  7388994.771561 
-356229.953807  7388984.873257 
-356247.551263  7388979.844118 
-356263.342795  7388972.135439 
-356274.326774  7388966.256446 
-356286.630150  7388959.847543 
-356296.616335  7388951.089044 
-356298.710878  7388946.119895 
-356303.584400  7388938.311232 
-356309.513440  7388936.591527 
-356315.830053  7388937.651345 
-356320.596374  7388940.800806 
-356326.203811  7388941.850626 
-356331.481399  7388944.230218 
-356337.097082  7388944.510171 
-356343.636342  7388943.910273 
-356347.742965  7388940.630835 
-356348.625312  7388934.541878 
-356348.666543  7388930.002656 
-356348.732513  7388923.693736 
-356350.860041  7388914.855250 
-356355.296513  7388909.916096 
-356364.911618  7388907.466516 
-356373.611391  7388905.106920 
-356386.797114  7388902.917295 
-356398.770641  7388899.597864 
-356409.358801  7388891.399268 
-356421.373559  7388884.210499 
-356428.085991  7388876.191873 
-356449.031416  7388863.324077 
-356458.250702  7388859.104800 
-356472.458958  7388857.025156 
-356487.170233  7388855.175473 
-356505.270709  7388851.586088 
-356521.829141  7388849.316476 
-356546.493616  7388842.027725 
-356565.822781  7388837.238545 
-356575.569826  7388832.009441 
-356590.660428  7388823.410914 
-356601.479482  7388812.892715 
-356619.753129  7388791.476384 
-356626.160451  7388782.897853 
-356642.323063  7388768.990236 
-356672.743408  7388736.735760 
-356684.947829  7388709.610407 
-356695.832853  7388692.113404 
-356698.974667  7388684.274747 
-356703.938898  7388677.795856 
-356711.640878  7388672.886697 
-356715.450636  7388668.827393 
-356723.713359  7388659.159049 
-356716.530892  7388641.812020 
-356711.814048  7388634.013356 
-356708.325893  7388625.784765 
-356709.397903  7388620.265711 
-356715.087802  7388612.237086 
-356736.156921  7388597.599593 
-356750.744503  7388587.441333 
-356761.233709  7388579.462700 
-356772.720708  7388573.043799 
-356785.815722  7388559.326149 
-356792.825018  7388552.637295 
-356805.895294  7388541.469208 
-356815.147565  7388534.700367 
-356825.669755  7388522.512455 
-356833.891247  7388516.723447 
-356845.609141  7388508.534849 
-356851.752582  7388506.155257 
-356863.742602  7388501.176110 
-356873.456662  7388498.836510 
-356883.904636  7388494.947177 
-356893.173399  7388486.408639 
-356900.100233  7388477.170222 
-356907.530087  7388469.381556 
-356925.993397  7388459.263289 
-356934.404552  7388454.584090 
-356947.928371  7388449.734921 
-356958.730933  7388440.756459 
-356967.166827  7388433.527697 
-356973.854520  7388427.618709 
-356984.871484  7388418.090341 
-356993.340363  7388407.652129 
-356997.282061  7388401.043261 
-356999.393096  7388393.754510 
-357000.704247  7388385.465930 
-357000.918649  7388374.057884 
-357000.968126  7388368.858774 
-357001.528870  7388363.219740 
-357009.511221  7388351.001833 
-357022.804145  7388348.142323 
-357040.904621  7388343.773071 
-357049.497193  7388342.093359 
-357057.166188  7388340.173688 
-357065.577343  7388335.714452 
-357073.271076  7388331.805121 
-357086.514523  7388323.846485 
-357098.850884  7388314.668057 
-357109.150426  7388305.239672 
-357115.013496  7388300.210533 
-357125.255314  7388296.541162 
-357138.498761  7388287.922638 
-357144.139183  7388285.763008 
-357152.855448  7388280.973828 
-357161.448021  7388279.394099 
-357167.104935  7388274.364960 
-357172.580432  7388267.326166 
-357181.024572  7388259.877442 
-357183.663366  7388250.818994 
-357188.371964  7388239.240977 
-357190.507737  7388229.402662 
-357194.663838  7388221.693982 
-357197.096476  7388212.635534 
-357201.755596  7388206.366608 
-357204.361405  7388200.637589 
-357215.106243  7388197.418141 
-357226.065484  7388192.988899 
-357236.999986  7388191.429166 
-357247.151096  7388186.440021 
-357254.341809  7388181.530862 
-357261.029502  7388176.051800 
-357272.029974  7388168.303128 
-357280.234973  7388163.393969 
-357289.223365  7388152.635811 
-357313.483775  7388124.190684 
-357330.405040  7388104.644032 
-357342.832110  7388086.377161 
-357350.880431  7388077.158740 
-357356.578576  7388068.350249 
-357364.206340  7388060.671564 
-357376.872550  7388049.173534 
-357394.643177  7388026.867354 
-357400.885574  7388014.079545 
-357409.840980  7388005.860953 
-357418.986050  7387989.113821 
-357426.457135  7387977.005895 
-357429.095929  7387967.957445 
-357431.512074  7387960.448731 
-357436.575260  7387943.771588 
-357440.516958  7387926.424559 
-357443.172244  7387916.156318 
-357448.284907  7387894.280065 
-357454.461334  7387868.094551 
-357462.740550  7387855.546700 
-357474.598629  7387843.258805 
-357479.999911  7387833.790427 
-357486.225815  7387823.222237 
-357486.671111  7387808.604741 
-357485.698056  7387803.495616 
-357483.941609  7387785.318730 
-357482.836614  7387772.910855 
-357479.686554  7387761.472814 
-357476.726157  7387750.584679 
-357471.052750  7387735.917192 
-357462.418947  7387721.659634 
-357456.885726  7387713.301066 
-357450.206279  7387697.063847 
-357441.325089  7387676.927296 
-357435.709406  7387603.789824 
-357462.319992  7387627.305796 
-357482.457287  7387644.662823 
-357504.021180  7387662.149827 
-357528.520732  7387671.808173 
-357545.681138  7387680.606666 
-357566.181267  7387692.214677 
-357582.962346  7387707.991975 
-357602.786285  7387725.688944 
-357614.265038  7387741.526231 
-357622.470037  7387758.543316 
-357633.256107  7387782.349238 
-357638.360524  7387803.105683 
-357643.258785  7387834.830249 
-357646.755187  7387863.325368 
-357646.788172  7387880.492427 
-357646.351121  7387893.880134 
-357647.950890  7387907.847741 
-357653.080046  7387926.064621 
-357662.060191  7387937.002747 
-357670.850673  7387945.951215 
-357683.244757  7387951.390283 
-357692.785646  7387956.799356 
-357704.198429  7387958.009149 
-357712.823987  7387963.408224 
-357717.252212  7387968.997267 
-357718.827243  7387985.734400 
-357703.786118  7388011.280024 
-357682.378903  7388040.085090 
-357664.105256  7388061.501422 
-357649.047639  7388079.038418 
-357639.638690  7388090.496455 
-357617.406852  7388120.291352 
-357604.427285  7388143.857315 
-357594.028788  7388163.693917 
-357586.994753  7388193.968731 
-357576.117975  7388231.402319 
-357572.819483  7388255.848132 
-357571.277438  7388278.314284 
-357566.337945  7388302.960062 
-357566.865704  7388321.896819 
-357565.381383  7388338.383994 
-357563.014714  7388350.651893 
-357554.949901  7388361.210085 
-357535.719691  7388376.637442 
-357518.567531  7388387.545574 
-357498.380759  7388396.863977 
-357472.133007  7388409.461819 
-357453.166676  7388418.240316 
-357425.426356  7388426.498901 
-357397.900438  7388434.537524 
-357379.585560  7388439.556665 
-357358.211330  7388444.665789 
-357338.041050  7388451.004704 
-357318.612931  7388465.322251 
-357300.908273  7388481.539473 
-357295.012218  7388499.976315 
-357293.758791  7388523.662258 
-357295.333821  7388540.069448 
-357302.145208  7388562.945529 
-357302.639982  7388586.091564 
-357297.593289  7388601.218973 
-357291.829173  7388616.336384 
-357281.941943  7388636.392948 
-357269.613828  7388644.571547 
-357260.650175  7388653.240062 
-357245.262709  7388661.388667 
-357233.783956  7388666.817737 
-357220.276630  7388670.007190 
-357206.027144  7388676.846019 
-357199.520868  7388684.864645 
-357194.317496  7388694.892928 
-357191.472546  7388703.941378 
-357192.288923  7388714.809516 
-357203.042008  7388732.076558 
-357220.342600  7388747.193969 
-357256.139487  7388769.910078 
-357288.835792  7388797.035432 
-357326.727222  7388825.530551 
-357352.290537  7388851.586088 
-357385.456876  7388883.030701 
-357417.279080  7388915.785091 
-357447.146928  7388941.520683 
-357449.159008  7388943.230390 
-357486.629880  7388972.945300 
-357523.243144  7389006.739511 
-357576.835397  7389046.802649 
-357616.862601  7389075.987650 
-357648.082830  7389097.883899 
-357680.828612  7389120.240070 
-357707.538153  7389133.237843 
-357729.761744  7389146.625550 
-357764.354682  7389157.373709 
-357802.312082  7389167.931900 
-357831.652170  7389173.310979 
-357853.785053  7389174.300809 
-357879.760680  7389169.131695 
-357896.368588  7389161.213051 
-357920.365120  7389149.145118 
-357936.758626  7389132.477973 
-357949.152711  7389117.430551 
-357959.790348  7389103.682906 
-357973.479091  7389081.666677 
-357983.333337  7389065.379467 
-357993.146351  7389053.071575 
-358004.674582  7389043.323245 
-358021.249505  7389038.504070 
-358041.081690  7389035.484587 
-358057.128855  7389032.875034 
-358075.864291  7389029.015696 
-358085.339210  7389027.945879 
-358094.195662  7389030.575428 
-358106.985565  7389047.422543 
-358124.838655  7389079.926975 
-358143.194764  7389112.781347 
-358162.639376  7389138.216990 
-358182.966335  7389157.683656 
-358204.629182  7389175.830547 
-358229.062764  7389192.797641 
-358255.483687  7389204.455644 
-358285.310303  7389222.022635 
-358322.096738  7389238.659785 
-358359.031605  7389249.427941 
-358397.706427  7389260.985961 
-358415.386345  7389268.354699 
-358441.774283  7389272.933915 
-358466.644915  7389276.273343 
-358487.689296  7389274.043724 
-358509.071772  7389268.934600 
-358527.510343  7389261.575860 
-358539.475624  7389258.486389 
-358556.594799  7389251.337614 
-358583.444526  7389249.937854 
-358603.169510  7389257.656531 
-358622.894493  7389264.825303 
-358643.089512  7389277.093202 
-358659.944808  7389285.451770 
-358680.156319  7389295.500049 
-358703.196287  7389298.269575 
-358718.196181  7389298.529530 
-358738.506647  7389297.949630 
-358752.714902  7389295.869986 
-358764.902831  7389301.638998 
-358781.370554  7389318.966030 
-358796.881714  7389340.152401 
-358815.345024  7389362.258614 
-358834.154676  7389380.155548 
-358851.026464  7389397.822522 
-358865.111026  7389407.810811 
-358877.397910  7389414.799614 
-358887.689206  7389426.527605 
-358895.894205  7389443.544690 
-358901.839737  7389472.179786 
-358900.883175  7389508.043642 
-358898.203150  7389542.347766 
-358897.535205  7389569.143177 
-358894.277944  7389589.489691 
-358879.566668  7389612.825694 
-358863.791629  7389629.502837 
-358842.483369  7389648.229630 
-358826.147586  7389659.147760 
-358807.906924  7389677.354641 
-358793.253372  7389694.051781 
-358780.982981  7389717.627742 
-358772.794474  7389741.023735 
-358770.741163  7389763.709849 
-358772.918167  7389792.074990 
-358784.471137  7389821.200002 
-358797.368241  7389848.905256 
-358825.603335  7389884.839101 
-358839.564204  7389907.785170 
-358855.768047  7389931.191161 
-358878.230779  7389962.305831 
-358892.917316  7389983.932127 
-358910.415817  7390021.755648 
-358916.089224  7390057.469531 
-358919.833013  7390102.911747 
-358919.412455  7390136.016076 
-358918.356937  7390182.188168 
-358920.880284  7390226.950500 
-358925.745560  7390262.094482 
-358933.266122  7390287.200180 
-358946.138488  7390316.895093 
-358958.260447  7390340.711014 
-358967.174623  7390358.507966 
-358983.147572  7390384.463520 
-359000.068837  7390408.109469 
-359018.878489  7390426.116385 
-359031.891041  7390441.863687 
-359046.660040  7390455.731312 
-359062.839145  7390481.356923 
-359072.973762  7390510.581917 
-359078.309073  7390528.018930 
-359087.825223  7390558.013792 
-359095.650896  7390582.559588 
-359103.723956  7390602.346198 
-359118.031166  7390621.202968 
-359135.554406  7390635.770473 
-359150.455345  7390646.098704 
-359172.109947  7390654.397282 
-359186.153278  7390657.036830 
-359202.579769  7390659.896340 
-359230.559230  7390658.166637 
-359254.011510  7390655.387113 
-359271.270870  7390649.038200 
-359284.299915  7390641.629469 
-359299.918276  7390631.041283 
-359317.606440  7390617.373624 
-359323.296340  7390608.785095 
-359328.582173  7390589.898330 
-359333.059877  7390580.639916 
-359341.058720  7390566.542331 
-359358.491252  7390557.963801 
-359372.221226  7390551.784859 
-359390.816476  7390550.075152 
-359409.123108  7390546.155823 
-359424.411620  7390538.107202 
-359442.594558  7390525.659334 
-359457.017216  7390511.401776 
-359481.962063  7390486.286078 
-359505.002032  7390467.129360 
-359491.247319  7390517.930658 
-359482.794933  7390558.273747 
-359479.141853  7390587.698707 
-359479.537672  7390620.813035 
-359478.795511  7390655.907024 
-359480.147893  7390674.633816 
-359479.653119  7390693.790535 
-359477.319436  7390713.917087 
-359461.618612  7390733.703698 
-359442.380156  7390749.351018 
-359419.224741  7390769.287603 
-359382.586738  7390800.712220 
-359350.978936  7390828.757416 
-359325.522822  7390854.542999 
-359297.493884  7390882.398228 
-359269.951473  7390913.142962 
-359250.284213  7390941.748062 
-359233.676305  7390969.823253 
-359222.675833  7390999.508168 
-359214.454341  7391026.333573 
-359213.299869  7391048.449785 
-359219.707190  7391074.665294 
-359231.392099  7391111.878920 
-359232.967129  7391128.396091 
-359238.063300  7391150.922232 
-359230.320089  7391181.087065 
-359217.150859  7391192.145171 
-359192.255488  7391212.051761 
-359170.444208  7391229.898704 
-359145.532345  7391252.244876 
-359127.431869  7391276.550713 
-359114.658458  7391299.346808 
-359104.647534  7391321.403030 
-359099.064836  7391339.729891 
-359093.952173  7391361.386182 
-359091.098977  7391382.062640 
-359085.516279  7391400.389501 
-359076.461918  7391428.544678 
-359061.692918  7391446.561592 
-359045.513814  7391462.688829 
-359027.009272  7391476.576451 
-359001.924239  7391495.483212 
-Region 1
-139
-331270.823628  7395558.717217 
-331370.034029  7395558.257296 
-331500.002871  7395553.918039 
-331590.546483  7395552.708246 
-331713.918340  7395552.948205 
-331806.003997  7395552.498282 
-331841.883347  7395554.207989 
-331836.449081  7395438.667780 
-331825.168237  7395322.887612 
-331823.362313  7395226.394141 
-331821.102846  7395148.427496 
-331827.798785  7395101.795483 
-331833.068126  7395065.111767 
-331835.855352  7395053.303789 
-331841.132940  7395038.176381 
-331842.831663  7394977.996689 
-331833.059880  7394948.131805 
-331819.131997  7394908.448602 
-331882.858867  7394780.830462 
-331947.773195  7394622.227629 
-331988.954871  7394549.330116 
-331968.462987  7394541.271496 
-331937.061341  7394526.514024 
-331922.267603  7394514.856021 
-331908.991172  7394498.378843 
-331900.044012  7394481.391753 
-331892.861545  7394460.065406 
-331885.687324  7394444.848012 
-331838.997166  7394483.041470 
-331682.137367  7394428.010897 
-331567.300359  7394386.358031 
-331478.100882  7394329.657744 
-331400.899671  7394285.885241 
-331372.862486  7394267.158449 
-331244.163565  7394191.021491 
-331112.702156  7394113.314801 
-331065.302822  7394085.219614 
-331030.149141  7394067.272688 
-331017.128343  7394053.065121 
-330989.627163  7394009.142645 
-330931.911795  7393929.406303 
-330870.048573  7393837.811992 
-330806.181516  7393749.777072 
-330699.302121  7393599.372835 
-330672.040082  7393625.528355 
-330568.887983  7393716.152831 
-330482.170622  7393807.187238 
-330396.962321  7393901.111150 
-330311.589095  7394000.004210 
-330299.277472  7393989.116075 
-330242.337250  7393938.754702 
-330202.763589  7393915.788636 
-330174.610957  7393904.330598 
-330108.591635  7393887.363505 
-330047.627252  7393895.972030 
-330016.943027  7393904.840511 
-329987.553461  7393916.498514 
-329950.049604  7393932.015856 
-329891.443643  7393959.711112 
-329852.232816  7393979.317754 
-329809.632789  7394000.004210 
-329804.668558  7394009.682552 
-329669.281943  7394074.731410 
-329569.453075  7394122.433239 
-329429.481556  7394185.712400 
-329165.090909  7394296.363447 
-328967.098911  7394382.238737 
-328981.076272  7394414.463217 
-329003.423557  7394465.914404 
-329014.976526  7394492.299884 
-329034.742741  7394537.362166 
-329045.718474  7394562.377881 
-329093.060084  7394661.820847 
-329146.602860  7394788.429160 
-329185.780702  7394792.408479 
-329213.009755  7394795.148009 
-329243.042527  7394801.426934 
-329267.987375  7394808.995637 
-329290.656263  7394818.094079 
-329314.347684  7394829.722087 
-329339.581150  7394844.399573 
-329362.019143  7394864.156189 
-329383.954117  7394882.143108 
-329428.071451  7394921.916295 
-329462.243831  7394950.541392 
-329500.481602  7394979.156490 
-329550.668162  7395006.991722 
-329557.050744  7395012.560768 
-329583.339728  7395027.828153 
-329593.490837  7395034.067085 
-329637.632910  7395059.422741 
-329652.088552  7395067.971277 
-329683.943741  7395085.938200 
-329700.749560  7395091.737206 
-329710.166755  7395097.306252 
-329735.136341  7395108.684303 
-329764.171319  7395120.302313 
-329812.040688  7395135.949633 
-329859.901811  7395149.047389 
-329873.376152  7395151.307002 
-329891.451889  7395154.056531 
-329904.687090  7395157.585927 
-329912.083959  7395161.125321 
-329919.983847  7395167.724190 
-329928.403249  7395175.062933 
-329953.917087  7395208.067280 
-329956.498157  7395216.895768 
-329962.138579  7395232.643070 
-329972.413382  7395265.377463 
-329980.618381  7395289.233377 
-329995.989355  7395332.865903 
-330012.358123  7395354.942122 
-330024.933625  7395392.745646 
-330087.489531  7395560.216960 
-330108.319509  7395615.587475 
-330124.152272  7395657.660269 
-330144.908035  7395710.191271 
-330155.232315  7395751.824139 
-330163.181682  7395788.127921 
-330167.477968  7395849.317440 
-330173.703872  7395902.888263 
-330182.543831  7395950.830051 
-330190.336519  7395999.991630 
-330213.722829  7396052.872572 
-330285.110448  7395986.443951 
-330362.567293  7395907.877409 
-330423.861525  7395852.816840 
-330470.469221  7395823.501862 
-330517.810831  7395795.986575 
-330600.330861  7395744.005479 
-330654.788968  7395703.852356 
-330729.062767  7395661.199662 
-330781.112975  7395641.623016 
-330853.061338  7395616.997234 
-330952.156291  7395579.213706 
-331010.110800  7395563.586383 
-331082.100394  7395564.196278 
-331134.488697  7395563.576384 
-331270.823628  7395558.717217 
-Region 1
-549
-335159.308951  7382708.718305 
-335206.831979  7382725.045509 
-335219.242556  7382731.934329 
-335235.965911  7382743.132410 
-335248.120855  7382756.100189 
-335290.127154  7382820.169215 
-335346.053091  7382912.973318 
-335370.841260  7382956.435873 
-335435.871035  7383066.267060 
-335439.153035  7383080.244666 
-335438.872663  7383099.031448 
-335435.532939  7383128.746358 
-335427.352678  7383173.178747 
-335408.996569  7383235.878008 
-335373.603747  7383344.789352 
-335360.607688  7383385.402395 
-335357.012331  7383419.176610 
-335356.748452  7383425.265567 
-335357.243226  7383433.404173 
-335361.028245  7383446.871866 
-335366.841838  7383465.418689 
-335390.599228  7383523.108808 
-335409.549067  7383571.910448 
-335423.922247  7383633.139960 
-335444.875919  7383699.718556 
-335461.285918  7383754.099241 
-335459.207867  7383809.319782 
-335458.399737  7383821.907626 
-335449.452577  7383855.151932 
-335442.583466  7383885.426746 
-335427.847452  7383934.318371 
-335421.200990  7383953.625064 
-335417.086121  7383974.511486 
-335417.292277  7383992.788356 
-335418.430257  7384000.007119 
-335424.953025  7384027.982327 
-335433.199256  7384056.767397 
-335441.222838  7384078.123738 
-335454.268375  7384106.728839 
-335472.698701  7384136.953661 
-335481.348997  7384150.691308 
-335495.202664  7384183.705653 
-335509.311965  7384216.729996 
-335521.112321  7384247.474730 
-335536.466802  7384275.149990 
-335542.618490  7384287.587859 
-335545.240792  7384309.204156 
-335546.337540  7384329.260721 
-335552.299565  7384359.035621 
-335551.136847  7384389.060478 
-335545.883998  7384408.157207 
-335409.177986  7384671.312131 
-335416.748026  7384693.818276 
-335473.020304  7384709.575576 
-335616.570687  7384741.780060 
-335624.808671  7384753.278091 
-335633.665123  7384772.534792 
-335636.138992  7384797.820461 
-335637.392419  7384813.227822 
-335642.340158  7384826.905479 
-335650.149338  7384849.471614 
-335657.158634  7384867.748483 
-335658.964559  7384872.607651 
-335665.322402  7384906.241889 
-335667.004634  7384928.738036 
-335668.488955  7384951.464143 
-335672.669794  7384978.309545 
-335674.698367  7384998.046164 
-335680.223341  7385023.581790 
-335685.072125  7385036.599560 
-335687.430547  7385053.796615 
-335691.298029  7385063.694919 
-335691.652617  7385077.982472 
-335692.048436  7385087.620821 
-335695.577823  7385100.838557 
-335700.517315  7385114.966137 
-335715.154374  7385138.392124 
-335726.352755  7385158.778632 
-335730.508856  7385169.906726 
-335736.841961  7385187.473717 
-335742.037086  7385197.052076 
-335746.696207  7385209.289980 
-335757.185412  7385220.268099 
-335761.201326  7385225.847144 
-335766.915964  7385234.775614 
-335777.396923  7385247.073508 
-335783.136300  7385253.232453 
-335792.908083  7385264.410538 
-335802.242816  7385287.226630 
-335809.656177  7385299.714491 
-335814.554438  7385308.852926 
-335837.371759  7385330.429230 
-335850.384311  7385343.916920 
-335864.229732  7385373.421866 
-335877.819520  7385435.491234 
-335882.940429  7385470.095306 
-335883.575389  7385494.801074 
-335884.523706  7385519.846784 
-335884.334042  7385536.233977 
-335884.969002  7385562.049555 
-335882.965168  7385576.647055 
-335875.576545  7385598.043390 
-335864.625551  7385619.079787 
-335865.936702  7385637.856570 
-335866.274797  7385645.125325 
-335860.090124  7385668.531316 
-335849.848306  7385690.347579 
-335839.276638  7385722.412087 
-335834.741211  7385736.359698 
-335824.062342  7385766.224582 
-335820.203106  7385776.512820 
-335812.253740  7385802.668340 
-335795.884972  7385833.823003 
-335786.913073  7385851.559965 
-335781.668471  7385864.127812 
-335777.034089  7385885.784103 
-335776.267190  7385900.001667 
-335776.283682  7385907.260424 
-335768.301331  7385936.735375 
-335762.421768  7385950.962938 
-335755.890754  7385968.829878 
-335747.842433  7385994.985397 
-335739.967282  7386051.495718 
-335730.682027  7386078.631070 
-335725.330223  7386096.388028 
-335723.582022  7386101.697119 
-335721.314309  7386131.022096 
-335720.671103  7386142.650104 
-335720.275284  7386168.885610 
-335713.290726  7386181.883383 
-335705.720686  7386192.651539 
-335699.437059  7386224.586069 
-335696.773526  7386234.634348 
-335685.393728  7386248.461979 
-335667.994181  7386262.329604 
-335659.714966  7386272.867799 
-335655.624835  7386291.764562 
-335658.271875  7386300.873002 
-335667.169558  7386317.360178 
-335666.880940  7386333.867350 
-335657.224604  7386359.882894 
-335609.206803  7386351.254372 
-335604.118879  7386408.534560 
-335575.966247  7386627.277092 
-335555.482610  7386625.667367 
-335545.661350  7386649.693252 
-335586.818287  7386810.195759 
-335612.175446  7386842.040305 
-335658.750157  7386901.710084 
-335706.627772  7386981.436427 
-335725.008620  7387016.980339 
-335743.834764  7387057.723360 
-335771.937919  7387135.460044 
-335775.005516  7387143.828611 
-335785.544199  7387169.384234 
-335819.576393  7387280.885134 
-335852.569562  7387388.436712 
-335905.188760  7387546.629615 
-335980.353152  7387768.871547 
-335990.487769  7387793.347354 
-335946.642561  7387855.336736 
-335928.954396  7387876.073184 
-335912.321749  7387912.326974 
-335908.899563  7387952.930019 
-335910.433362  7387999.682011 
-335908.668669  7388029.606885 
-335909.460307  7388044.114400 
-335906.087599  7388055.782402 
-335897.651705  7388066.900497 
-335892.266916  7388074.989112 
-335882.989907  7388084.797432 
-335789.889963  7388108.613352 
-335744.403754  7388125.840401 
-335647.782670  7388131.539425 
-335630.539802  7388132.189314 
-335610.270567  7388130.019685 
-335570.787614  7388119.851427 
-335549.256706  7388117.671800 
-335537.852169  7388118.111725 
-335522.621381  7388120.801264 
-335506.623694  7388125.770413 
-335489.331348  7388133.029170 
-335473.548063  7388142.827492 
-335440.942467  7388167.263306 
-335414.711207  7388185.630160 
-335385.156716  7388207.276452 
-335375.483888  7388215.085114 
-335365.489456  7388230.522470 
-335363.625808  7388233.891893 
-335356.253678  7388247.229608 
-335348.832070  7388267.336164 
-335344.832648  7388287.552701 
-335334.739262  7388357.100788 
-335328.942162  7388391.364919 
-335318.073630  7388462.682703 
-335314.841108  7388491.107834 
-335307.477224  7388530.951009 
-335296.377797  7388600.239141 
-335295.833546  7388606.838011 
-335276.817738  7388721.038449 
-335254.948734  7388848.176672 
-335241.548610  7388918.724587 
-335235.578339  7388940.790808 
-335227.802143  7388966.386423 
-335210.006777  7389011.748653 
-335208.472978  7389015.048088 
-335186.562744  7389070.288626 
-335151.293615  7389151.614695 
-335139.682922  7389182.779357 
-335124.501612  7389217.233456 
-335117.178959  7389249.697895 
-335117.393361  7389256.816675 
-335119.619843  7389264.445369 
-335123.619265  7389273.123882 
-335140.449822  7389296.099946 
-335152.200700  7389321.835538 
-335157.808137  7389354.389962 
-335156.958776  7389368.107612 
-335155.078635  7389383.854915 
-335150.361791  7389408.210743 
-335144.119394  7389431.786704 
-335133.259109  7389465.001015 
-335120.906255  7389492.356329 
-335109.848060  7389515.402382 
-335102.187312  7389524.750781 
-335092.530976  7389528.500138 
-335081.093454  7389533.509280 
-335054.153018  7389543.737528 
-335045.486230  7389550.286407 
-335038.600627  7389557.095240 
-335032.960205  7389566.473634 
-335030.098763  7389577.881680 
-335022.759618  7389614.665379 
-335012.278659  7389627.303214 
-335007.429875  7389631.592480 
-334998.029172  7389635.091880 
-334988.653208  7389636.041717 
-334978.007324  7389634.441991 
-334957.243316  7389631.262536 
-334929.610197  7389631.832438 
-334912.870348  7389632.992240 
-334892.263018  7389645.050174 
-334861.949874  7389665.936597 
-334832.626278  7389691.402235 
-334773.509050  7389737.764293 
-334746.733540  7389763.489887 
-334738.297646  7389773.338200 
-334730.612159  7389786.245989 
-334725.466511  7389796.124297 
-334722.613315  7389807.792298 
-334722.761747  7389823.289644 
-334723.891481  7389844.126074 
-334729.251531  7389876.430541 
-334733.902405  7389902.376097 
-334733.547817  7389917.113572 
-334731.172902  7389931.581094 
-334724.996476  7389944.998796 
-334712.297280  7389948.478200 
-334703.416090  7389949.178080 
-334665.928725  7389945.118775 
-334640.332426  7389940.829510 
-334627.385843  7389842.956275 
-334623.526607  7389823.189661 
-334619.535432  7389797.564050 
-334610.423347  7389763.679854 
-334594.582338  7389711.338820 
-334586.096967  7389686.103142 
-334582.872690  7389672.885406 
-334578.139354  7389658.437881 
-334572.185575  7389643.190493 
-334562.331330  7389621.594192 
-334519.632348  7389534.169167 
-334476.933365  7389447.074086 
-334459.542065  7389411.040258 
-334434.844604  7389360.768869 
-334398.330295  7389286.481594 
-334355.656051  7389198.566653 
-334336.434088  7389160.143235 
-334321.162068  7389125.239213 
-334306.846612  7389091.514990 
-334241.948777  7388936.761498 
-334209.730754  7388862.374240 
-334183.895313  7388800.274877 
-334172.614469  7388778.218655 
-334140.272753  7388705.641087 
-334131.960552  7388682.285087 
-334124.415251  7388663.598288 
-334120.349860  7388653.030098 
-334115.600031  7388636.822875 
-334112.186091  7388626.134705 
-334106.001418  7388605.018322 
-334100.468198  7388588.451160 
-334095.833816  7388574.553541 
-334089.673882  7388559.426132 
-334082.631601  7388541.519199 
-334075.003837  7388525.261984 
-334066.683391  7388508.434866 
-334060.647150  7388493.507423 
-334042.761075  7388448.475137 
-334019.531444  7388391.394914 
-334013.082891  7388374.927735 
-334006.626093  7388359.460384 
-334003.121445  7388349.782042 
-333988.970913  7388313.158315 
-333985.045707  7388301.070386 
-333982.456391  7388294.831455 
-333974.069974  7388278.574239 
-333947.682036  7388212.255599 
-333936.392946  7388179.841151 
-333934.430343  7388174.342093 
-333925.375982  7388154.085563 
-333919.826269  7388139.728022 
-333915.002224  7388124.170687 
-333909.056692  7388108.263412 
-333904.991300  7388098.255126 
-333900.554828  7388084.027563 
-333896.085371  7388064.590893 
-333891.896286  7388046.823936 
-333888.672010  7388025.297623 
-333887.517537  7388010.000244 
-333886.973286  7387995.712691 
-333888.020557  7387975.346180 
-333889.142045  7387957.189290 
-333892.778632  7387933.313379 
-333899.721959  7387906.148033 
-333907.019873  7387883.741871 
-333913.575626  7387863.995253 
-333919.026385  7387842.458942 
-333925.425460  7387817.833160 
-333929.614545  7387799.386320 
-333936.805258  7387777.540062 
-333956.505503  7387719.919932 
-333973.946281  7387670.868334 
-333981.508074  7387652.231526 
-333987.791702  7387629.045498 
-333995.633867  7387603.549865 
-334000.870224  7387582.683439 
-334003.542003  7387562.996811 
-334008.621681  7387538.241052 
-334011.821218  7387517.014688 
-334011.227489  7387497.408046 
-334010.773947  7387456.974972 
-334011.441891  7387433.948916 
-334011.524354  7387417.781685 
-334001.018656  7387359.001754 
-333997.431546  7387328.796928 
-333995.139093  7387296.872396 
-333987.486591  7387270.316945 
-333982.563592  7387245.001281 
-333974.935828  7387215.896266 
-333967.085417  7387180.522326 
-333961.923276  7387157.716232 
-333958.410382  7387116.813238 
-333953.602830  7387082.089186 
-333949.471468  7387059.113122 
-333944.556715  7387034.247381 
-333941.934413  7387013.071009 
-333939.543006  7386990.554865 
-333938.306072  7386955.650844 
-333937.448464  7386932.164867 
-333935.469369  7386854.838112 
-333934.191203  7386797.008018 
-333935.510600  7386753.055547 
-333932.624419  7386728.549744 
-333931.849273  7386697.745021 
-333930.364952  7386666.830316 
-333926.687133  7386643.394331 
-333919.158324  7386602.571323 
-333905.749953  7386552.249943 
-333879.032166  7386461.355512 
-333864.823911  7386418.552844 
-333856.734358  7386385.448515 
-333847.836675  7386350.684469 
-333844.917510  7386338.856495 
-333839.442013  7386317.810100 
-333837.784520  7386301.612875 
-333831.476154  7386282.946072 
-333844.538183  7386279.336691 
-333833.603681  7386231.474889 
-333813.087059  7386172.664963 
-333784.249991  7386092.808641 
-333748.246948  7385963.870727 
-333751.726857  7385884.884257 
-333752.889576  7385791.950176 
-333734.929285  7385645.395279 
-333734.376788  7385523.246202 
-333744.651591  7385434.501403 
-333741.798396  7385371.712158 
-333734.665406  7385106.297622 
-333730.385612  7385050.647154 
-333763.617922  7385030.410620 
-333826.149089  7385014.233391 
-333980.939084  7384979.709305 
-334051.798944  7384965.491740 
-334042.769322  7384935.816823 
-334037.277332  7384918.939714 
-334032.642950  7384898.003301 
-334029.558860  7384875.067229 
-334021.329122  7384770.225188 
-334018.228539  7384723.923119 
-334018.937715  7384677.451079 
-334020.603454  7384634.298471 
-334022.632026  7384609.702684 
-334023.341202  7384587.856426 
-334024.347242  7384575.688510 
-334026.573725  7384566.590069 
-334052.640060  7384508.979937 
-334080.570043  7384447.590452 
-334087.183520  7384422.334778 
-334089.789329  7384406.637467 
-334091.554022  7384370.853596 
-334094.530911  7384337.379330 
-334096.023479  7384326.741153 
-334100.121856  7384312.613572 
-334119.063448  7384268.301163 
-334156.872415  7384171.047821 
-334159.082405  7384159.969719 
-334162.793209  7384142.732672 
-334163.090073  7384128.245153 
-334166.668937  7384114.607489 
-334174.074052  7384100.549897 
-334187.457685  7384079.243547 
-334207.091960  7384050.698436 
-334229.562938  7384019.943704 
-334271.049725  7383966.832802 
-334311.984014  7383892.985451 
-334346.313072  7383835.115364 
-334444.336016  7383748.180255 
-334289.991316  7383703.437919 
-334164.698088  7383499.832794 
-333835.805425  7383567.701169 
-333720.951924  7383270.122142 
-333543.451810  7383270.122142 
-333538.231946  7383056.078806 
-333359.684560  7383039.821590 
-333376.440901  7382903.784892 
-333406.490165  7382644.369328 
-333415.470310  7382573.531462 
-333417.911194  7382495.554818 
-333450.162202  7382459.840936 
-333442.583917  7382494.724960 
-333505.181053  7382494.724960 
-333536.500237  7382349.849776 
-333567.530803  7382312.716137 
-333642.373593  7382217.122511 
-333673.742254  7382172.180209 
-333670.732380  7382150.333951 
-333699.206614  7382091.204080 
-333727.936482  7382041.472598 
-333657.414717  7381971.174640 
-333718.593503  7381890.078531 
-333679.893942  7381850.975229 
-333504.744003  7381735.794958 
-333306.958161  7381434.986484 
-333365.160057  7381438.185936 
-333397.947070  7381439.945634 
-333429.422932  7381447.294376 
-333458.457911  7381439.355736 
-333489.406014  7381413.370187 
-333496.118446  7381398.412749 
-333502.072224  7381383.185357 
-333522.036349  7381326.845008 
-333546.387468  7381261.136263 
-333611.928509  7381120.920281 
-333627.596347  7381097.624271 
-333641.689155  7381083.216739 
-333663.211817  7381059.210851 
-333674.748294  7381044.793321 
-333682.705907  7381033.385275 
-333693.574439  7381067.169488 
-333709.044367  7381088.055910 
-333722.799080  7381107.372601 
-333742.565295  7381127.099222 
-333767.015369  7381148.085627 
-333790.055337  7381167.062377 
-333823.625742  7381184.279428 
-333866.959684  7381212.914523 
-333894.065044  7381224.292574 
-333910.128702  7381237.660284 
-333923.462857  7381249.438267 
-333935.955896  7381262.985946 
-333951.739182  7381283.322463 
-333956.686920  7381296.560195 
-333961.725367  7381319.766220 
-333964.166251  7381347.371492 
-333969.542794  7381359.279452 
-333975.158477  7381376.286539 
-333986.793908  7381402.452057 
-334000.045601  7381421.208844 
-334015.020756  7381440.875475 
-334034.399398  7381459.592269 
-334052.137040  7381477.959123 
-334067.235888  7381496.066022 
-334082.878988  7381520.171892 
-334094.027891  7381544.107792 
-334098.357162  7381585.250745 
-334104.195494  7381690.202768 
-334110.108041  7381726.596534 
-334112.598403  7381758.191122 
-334114.123955  7381785.896376 
-334110.619307  7381887.528968 
-334110.025579  7381948.098592 
-334112.087137  7382053.780490 
-334116.399915  7382118.779356 
-334118.411995  7382161.512037 
-334118.049161  7382202.155075 
-334125.413045  7382227.710697 
-334133.593306  7382252.726413 
-334137.427803  7382275.472516 
-334137.427803  7382325.453955 
-334263.257037  7382324.084190 
-334388.863622  7382313.336031 
-334444.336016  7382306.207252 
-334490.663339  7382296.438925 
-334572.012405  7382274.772636 
-334575.368620  7382284.990886 
-334582.617057  7382311.326375 
-334588.125539  7382338.191773 
-334599.076534  7382370.656212 
-334609.433799  7382393.482302 
-334620.747628  7382420.847615 
-334641.676561  7382446.453229 
-334660.972741  7382463.620288 
-334680.763694  7382481.007310 
-334706.071376  7382489.715818 
-334729.820521  7382500.284008 
-334773.113231  7382506.202994 
-334798.462144  7382511.032167 
-334842.249629  7382517.731020 
-334873.708999  7382523.400049 
-334902.265696  7382533.578305 
-334941.740402  7382543.226652 
-334970.585717  7382545.436274 
-334994.285384  7382560.323724 
-335008.369946  7382569.342179 
-335016.583191  7382582.389944 
-335026.445683  7382603.436339 
-335031.550100  7382621.433256 
-335039.021185  7382646.219011 
-335047.217938  7382679.203361 
-335056.635134  7382730.254616 
-335061.154068  7382754.560453 
-335071.115515  7382766.638384 
-335084.903212  7382765.248622 
-335094.345146  7382760.369458 
-335114.977215  7382758.049855 
-335123.627511  7382733.454068 
-335133.630189  7382723.705738 
-335159.308951  7382708.718305 
-Region 1
-318
-329451.070188  7403010.790744 
-329454.187263  7402979.256146 
-329445.941033  7402943.452279 
-329421.218833  7402899.869744 
-329376.722172  7402867.175344 
-329335.524004  7402848.498543 
-329299.248836  7402832.931210 
-329264.639406  7402812.694676 
-329230.029975  7402780.000276 
-329223.853549  7402773.411405 
-329206.948776  7402745.756142 
-329192.113807  7402686.606274 
-329180.577330  7402650.802407 
-329160.802869  7402600.990939 
-329083.337779  7402507.586938 
-329084.987025  7402448.437070 
-329086.603286  7402389.157224 
-329078.794105  7402335.956337 
-329044.176429  7402293.933535 
-328991.441784  7402247.231535 
-328876.068771  7402181.852734 
-328774.293793  7402116.863866 
-328710.319535  7402074.781074 
-328675.413241  7402053.494720 
-328629.440505  7402030.508657 
-328577.513991  7401998.164198 
-328548.107932  7401973.788373 
-328521.513838  7401947.792826 
-328474.328907  7401889.732771 
-328413.249076  7401818.374994 
-328373.823847  7401768.183591 
-328263.901593  7401657.802499 
-328195.499110  7401557.499680 
-328172.393171  7401536.823221 
-328116.838316  7401463.745739 
-328065.893103  7401410.154918 
-328018.642201  7401351.424978 
-327958.708597  7401268.679152 
-327942.290351  7401226.466383 
-327926.449342  7401186.993144 
-327917.518675  7401143.050671 
-327913.073956  7401127.793284 
-327904.201012  7401085.320560 
-327901.116922  7401059.754939 
-327898.107048  7401043.577710 
-327901.042706  7401007.563879 
-327904.407168  7400986.917415 
-327908.101479  7400963.101495 
-327916.289986  7400940.275405 
-327931.529020  7400859.829184 
-327956.251220  7400744.768893 
-327975.201058  7400663.912743 
-327983.892585  7400597.324149 
-327993.862278  7400518.667622 
-327992.633590  7400467.596370 
-327988.617675  7400446.999898 
-327983.678183  7400425.183635 
-327974.228003  7400391.519401 
-327951.526130  7400352.696052 
-327918.706132  7400303.074551 
-327857.337683  7400201.801898 
-327828.179012  7400148.161087 
-327801.354023  7400085.171876 
-327774.529035  7400016.363662 
-327739.078490  7399947.095527 
-327707.833522  7399873.848074 
-327705.541070  7399867.899093 
-327677.677056  7399805.989697 
-327630.285969  7399704.737041 
-327582.886635  7399576.558997 
-327557.026456  7399446.221322 
-327535.421331  7399299.876390 
-327502.287977  7399141.383538 
-327116.537553  7399213.321216 
-326901.277948  7399224.829245 
-326675.413691  7399212.761312 
-326431.391234  7399199.933509 
-325865.040113  7399134.584703 
-325848.283772  7399287.228557 
-325848.663099  7399360.046084 
-325841.117798  7399467.767632 
-325818.366447  7399623.241001 
-325807.506162  7399784.473383 
-325796.983971  7399896.474198 
-325791.747615  7399940.596640 
-325777.316711  7400062.595743 
-325753.847939  7400268.760429 
-325734.518774  7400359.634863 
-325730.222488  7400377.501803 
-325722.710172  7400408.436504 
-325712.410630  7400435.801816 
-325700.008299  7400460.837528 
-325687.292611  7400489.502618 
-325672.210255  7400513.638484 
-325653.746945  7400559.130691 
-325600.402079  7400624.149554 
-325531.298666  7400737.030219 
-325504.382969  7400777.403303 
-325490.001543  7400798.359713 
-325469.559137  7400839.192719 
-325459.812093  7400866.548033 
-325452.266792  7400885.674757 
-325445.513129  7400911.960255 
-325440.260280  7400930.137141 
-325437.101973  7400963.271466 
-325429.960738  7401012.543026 
-325404.686041  7401165.676795 
-325396.901599  7401218.937672 
-325378.025977  7401290.855353 
-325334.692035  7401351.804913 
-325319.939528  7401454.757278 
-325295.332776  7401559.709301 
-325317.770770  7401615.439755 
-325334.428156  7401639.375655 
-325358.853491  7401669.910425 
-325400.628895  7401715.752572 
-325422.060849  7401743.917748 
-325461.618017  7401805.247243 
-325492.153809  7401853.069051 
-325522.755571  7401904.430254 
-325547.931313  7401941.353929 
-325562.485910  7401978.527561 
-325571.276392  7402011.051990 
-325574.797533  7402035.667774 
-325572.166985  7402067.322352 
-325568.654091  7402092.817984 
-325559.863609  7402146.438800 
-325576.562226  7402223.805547 
-325615.253540  7402327.537779 
-325643.373187  7402360.072206 
-325670.626979  7402426.880763 
-325689.222229  7402507.526949 
-325661.531387  7402516.755368 
-325607.172234  7402544.450624 
-325584.602301  7402560.857813 
-325568.192302  7402578.294827 
-325554.858147  7402587.533244 
-325532.469631  7402616.238327 
-325498.981688  7402642.113895 
-325476.518956  7402659.600900 
-325452.918244  7402678.627641 
-325435.419742  7402683.926733 
-325340.621075  7402744.286394 
-325327.690985  7402759.463794 
-325303.496544  7402856.757129 
-325308.213388  7402891.541170 
-325303.240911  7402919.366404 
-325303.983072  7402945.681897 
-325312.328257  7402968.198040 
-325322.586568  7402987.674704 
-325332.836633  7403010.960715 
-325343.103190  7403031.187250 
-325327.872402  7403108.054084 
-325278.329048  7403244.890645 
-325279.079455  7403282.244247 
-325281.487355  7403335.245168 
-325292.413610  7403389.865812 
-325309.005026  7403476.091042 
-325292.487827  7403542.149727 
-325216.993585  7403598.770029 
-325016.461748  7403899.578503 
-324981.077172  7403970.356379 
-324973.696796  7404063.260465 
-324986.239313  7404087.686282 
-324952.124657  7404184.599681 
-324934.766341  7404234.041212 
-324930.197929  7404250.428405 
-324926.759251  7404265.295859 
-324922.949493  7404278.263637 
-324965.161947  7404294.360880 
-324996.951166  7404312.427785 
-325036.656767  7404316.237133 
-325061.378966  7404327.725165 
-325099.088979  7404353.840692 
-325135.916645  7404382.235828 
-325160.333734  7404397.323244 
-325197.598450  7404415.070204 
-325223.367921  7404405.861781 
-325248.403477  7404390.224460 
-325269.703491  7404354.720541 
-325290.112912  7404344.962213 
-325317.177041  7404353.840692 
-325351.786471  7404357.830008 
-325371.082651  7404360.049628 
-325391.063268  7404354.720541 
-325497.678784  7404348.431618 
-325543.692751  7404341.852745 
-325568.538644  7404344.962213 
-325614.799998  7404361.549371 
-325643.076322  7404363.599020 
-325777.217756  7404381.405970 
-325882.621077  7404389.244627 
-325923.060592  7404374.857092 
-325962.947609  7404341.522802 
-325983.794080  7404366.528518 
-325993.903959  7404364.148926 
-326013.546481  7404352.830865 
-326056.410387  7404326.045453 
-326108.262686  7404297.770296 
-326158.119396  7404269.645114 
-326202.640795  7404244.569409 
-326249.446401  7404221.783312 
-326259.778928  7404141.317095 
-326495.480938  7403846.597578 
-326524.153082  7403809.313964 
-326560.032432  7403765.221517 
-326608.223404  7403691.404161 
-326633.860935  7403661.669254 
-326663.596842  7403623.725754 
-326655.070240  7403576.513841 
-326626.678468  7403523.252964 
-326660.496260  7403486.349285 
-326717.189095  7403430.558842 
-326736.369828  7403293.582304 
-326732.271451  7403262.817574 
-326743.593526  7403111.643469 
-326763.920484  7402997.782972 
-326765.083203  7402981.755717 
-326762.419670  7402968.408004 
-326819.821682  7402834.111008 
-326927.063912  7402571.326020 
-326978.792516  7402586.603403 
-327006.549329  7402593.992138 
-327032.797081  7402587.183304 
-327051.746919  7402583.373957 
-327064.058541  7402573.695614 
-327064.932642  7402554.358927 
-327196.806362  7402561.387723 
-327325.158942  7402571.935916 
-327323.039661  7402595.761835 
-327378.198698  7402591.292600 
-327582.127982  7402568.406520 
-327570.129716  7402507.167010 
-327650.258339  7402500.298187 
-327739.639233  7402491.329723 
-327748.380238  7402488.600191 
-327763.949121  7402483.900995 
-327773.778628  7402476.202314 
-327788.456919  7402462.054738 
-327764.716021  7402423.371364 
-327821.862399  7402406.664225 
-327851.746739  7402411.943321 
-327833.291675  7402383.808140 
-327787.582818  7402253.700427 
-327870.218296  7402230.844342 
-327923.843533  7402213.257354 
-327942.306844  7402219.416299 
-327958.090129  7402207.998255 
-327984.552283  7402199.229757 
-328007.353111  7402197.390072 
-328032.652547  7402200.789490 
-328094.812633  7402214.357166 
-328163.784107  7402243.342201 
-328182.296894  7402228.564732 
-328183.377151  7402216.366822 
-328181.653688  7402197.370076 
-328201.007592  7402206.728473 
-328213.343953  7402224.055505 
-328223.808419  7402237.933128 
-328232.293791  7402257.869713 
-328238.057906  7402282.325524 
-328236.029333  7402320.778937 
-328228.401570  7402351.143736 
-328210.152662  7402387.717471 
-328210.762883  7402396.156025 
-328199.919089  7402417.172425 
-328192.052185  7402434.799406 
-328185.760311  7402448.567048 
-328181.332085  7402460.035083 
-328178.000608  7402474.172662 
-328175.493754  7402487.880314 
-328174.809317  7402502.707774 
-328183.088533  7402528.173412 
-328193.503522  7402542.600941 
-328210.787621  7402556.938485 
-328301.496158  7402640.044250 
-328319.522419  7402651.332316 
-328333.672950  7402656.931357 
-328348.598628  7402664.820006 
-328354.882256  7402667.359571 
-328361.982260  7402669.659177 
-328382.193772  7402671.788812 
-328409.736182  7402675.238221 
-328485.552026  7402682.776930 
-328513.737643  7402683.316837 
-328552.330002  7402676.837947 
-328613.376848  7402664.620040 
-328660.883382  7402651.672258 
-328689.778175  7402646.493145 
-328700.828124  7402646.403160 
-328723.431042  7402648.982718 
-328748.631523  7402648.982718 
-328811.805896  7402658.481091 
-328841.640758  7402670.049110 
-328854.727526  7402672.848630 
-328892.190152  7402697.084479 
-328910.620478  7402711.801958 
-328929.001326  7402719.270679 
-328951.546520  7402745.796135 
-328968.789389  7402756.414316 
-328999.457120  7402798.337135 
-329033.777932  7402837.310460 
-329065.608383  7402877.103643 
-329106.724089  7402922.195920 
-329134.678811  7402953.100626 
-329153.488463  7402968.188041 
-329160.423543  7402975.756745 
-329184.947833  7402990.424233 
-329194.150626  7402996.063267 
-329200.261083  7402997.922948 
-329218.188388  7403000.442517 
-329231.390604  7403008.411152 
-329258.916521  7402986.344931 
-329295.702956  7402978.486277 
-329312.640714  7402975.006873 
-329374.627630  7402976.576605 
-329426.356235  7402999.122743 
-329451.070188  7403010.790744 
-Region 1
-526
-354751.882933  7396032.606044 
-354559.861206  7395710.631195 
-354581.408607  7395691.084543 
-354551.953071  7395633.974326 
-354544.490232  7395619.976724 
-354526.529942  7395587.632264 
-354522.563505  7395555.887701 
-354523.363389  7395517.804225 
-354532.970248  7395469.552490 
-354513.838993  7395420.990808 
-354488.712728  7395367.290007 
-354466.373689  7395330.736268 
-354453.451846  7395304.170818 
-354442.418389  7395257.528808 
-354434.493762  7395215.226054 
-354430.510832  7395194.039683 
-354431.516873  7395169.923814 
-354430.510832  7395158.335798 
-354437.017108  7395132.460231 
-354442.352420  7395084.338474 
-354442.418389  7395072.630479 
-354458.275891  7395015.500265 
-354465.433619  7394985.345430 
-354474.158131  7394967.888420 
-354494.699492  7394904.699244 
-354509.856064  7394841.720032 
-354536.318218  7394744.396702 
-354581.276667  7394600.481354 
-354616.207700  7394514.786033 
-354636.147086  7394477.262460 
-354629.921182  7394474.212983 
-354623.753001  7394471.743406 
-354619.563916  7394470.013702 
-354611.177500  7394466.074377 
-354602.799329  7394462.375010 
-354595.155074  7394461.145221 
-354587.510818  7394460.405348 
-354581.095250  7394458.925601 
-354562.112427  7394426.001241 
-354549.429725  7394408.144299 
-354543.245052  7394396.946218 
-354534.842143  7394381.178918 
-354526.150615  7394367.921189 
-354511.546541  7394360.402477 
-354499.144210  7394358.212852 
-354488.077769  7394351.494003 
-354486.948035  7394341.885649 
-354487.582995  7394332.547249 
-354492.011221  7394324.778579 
-354499.770924  7394314.270379 
-354510.837365  7394302.802344 
-354521.169892  7394289.804570 
-354527.247364  7394272.467540 
-354530.809736  7394254.070691 
-354529.886158  7394247.751773 
-354526.356771  7394227.995157 
-354521.532726  7394210.758110 
-354516.700435  7394193.521062 
-354515.917043  7394177.343834 
-354519.429937  7394161.976466 
-354524.847711  7394155.487577 
-354529.787203  7394146.969036 
-354528.921349  7394136.350855 
-354526.587666  7394122.423241 
-354518.918671  7394108.675596 
-354513.467913  7394099.007252 
-354504.149672  7394076.401124 
-354493.619236  7394049.735692 
-354485.983226  7394033.718435 
-354478.652327  7394014.171783 
-354479.815045  7394003.333640 
-354481.794141  7393988.956103 
-354477.901920  7393977.288101 
-354474.248840  7393966.879884 
-354469.078453  7393955.701799 
-354459.331409  7393945.213595 
-354454.466132  7393930.746073 
-354449.073098  7393917.538336 
-354444.479947  7393901.061158 
-354442.476113  7393881.584494 
-354437.602591  7393867.626885 
-354432.151832  7393858.208499 
-354418.652753  7393844.390865 
-354404.576437  7393834.852499 
-354399.117432  7393826.443939 
-354389.609528  7393816.715606 
-354384.752499  7393801.748170 
-354381.668408  7393786.800730 
-354384.265971  7393764.614530 
-354385.898725  7393738.618983 
-354387.399539  7393722.471749 
-354391.390714  7393709.393989 
-354391.885488  7393691.966974 
-354389.815684  7393676.789574 
-354529.811942  7393517.606840 
-354668.934099  7393361.813526 
-354818.058934  7393317.371139 
-354851.695309  7393306.463008 
-354866.489047  7393300.853968 
-354888.572452  7393299.884134 
-354902.294180  7393298.304405 
-354929.457264  7393297.154602 
-354949.264710  7393295.914814 
-354976.254623  7393288.696051 
-355001.182978  7393283.736900 
-355022.268590  7393281.747241 
-355053.744452  7393280.407471 
-355090.522641  7393280.907385 
-355112.045303  7393283.976859 
-355141.641025  7393289.935838 
-355165.992144  7393307.942754 
-355184.034896  7393323.340117 
-355199.892398  7393332.648522 
-355213.358493  7393348.995722 
-355228.844914  7393365.882829 
-355240.290682  7393381.950077 
-355247.357702  7393401.996643 
-355249.048179  7393415.574318 
-355250.986043  7393432.611399 
-355256.436802  7393459.456801 
-355253.921701  7393474.234270 
-355265.796273  7393470.724871 
-355278.990242  7393465.445775 
-355287.343674  7393461.046529 
-355295.260055  7393451.808111 
-355309.938346  7393439.580206 
-355316.906411  7393436.550725 
-355323.956938  7393435.620884 
-355330.578661  7393436.900665 
-355337.802359  7393440.080120 
-355345.388892  7393446.579007 
-355352.794007  7393451.408180 
-355360.916544  7393455.807426 
-355368.569046  7393456.547299 
-355382.455698  7393455.797428 
-355395.641421  7393454.717613 
-355408.604496  7393454.177705 
-355419.819369  7393455.947402 
-355435.924258  7393458.656938 
-355448.120433  7393460.056698 
-355458.147849  7393461.316483 
-355478.763426  7393461.736411 
-355497.474123  7393459.046871 
-355520.390398  7393453.837764 
-355533.848247  7393445.779144 
-355546.885537  7393437.820507 
-355558.496230  7393430.081833 
-355570.271848  7393426.652420 
-355581.297058  7393426.532441 
-355590.170002  7393427.732235 
-355596.049565  7393431.441600 
-355603.759790  7393436.500733 
-355611.041212  7393443.999449 
-355621.266538  7393452.178048 
-355627.789306  7393452.907923 
-355635.260391  7393451.318195 
-355647.769923  7393446.019103 
-355657.418013  7393440.360072 
-355670.694444  7393429.961853 
-355691.474946  7393413.004758 
-355702.780528  7393405.476047 
-355719.693547  7393398.997157 
-355738.932003  7393394.207978 
-355751.581721  7393394.547919 
-355768.585448  7393399.477075 
-355776.889403  7393405.985960 
-355782.117513  7393414.344528 
-355784.162578  7393424.222836 
-355785.531452  7393430.431773 
-355792.928321  7393435.930831 
-355807.474672  7393441.169933 
-355822.301395  7393448.958599 
-355836.460173  7393452.198044 
-355844.599202  7393454.827594 
-355852.086780  7393461.986368 
-355861.289573  7393470.494910 
-355872.677618  7393474.704189 
-355885.005733  7393477.153770 
-355895.709340  7393479.253410 
-355918.543153  7393492.761096 
-355945.780452  7393504.769039 
-355972.877566  7393520.766299 
-355994.408475  7393532.714253 
-356091.796459  7393545.162121 
-356153.709158  7393544.252276 
-356220.206762  7393530.774585 
-356562.227424  7393415.704295 
-356626.193436  7393350.595448 
-356673.353629  7393314.431643 
-356710.626591  7393275.248354 
-356756.756005  7393224.587032 
-356860.303924  7393114.835832 
-356898.698374  7393073.692879 
-356949.016873  7393013.473194 
-356986.990765  7392986.037893 
-357071.885710  7392930.567395 
-357159.782282  7392875.006912 
-357234.921936  7392824.855503 
-357302.705952  7392777.373636 
-357480.420468  7392694.647806 
-357550.736077  7392660.253697 
-357552.459539  7392625.719613 
-357577.025060  7392628.839078 
-357594.243190  7392632.658424 
-357605.326124  7392637.087665 
-357621.876309  7392635.807885 
-357632.002680  7392633.468285 
-357646.235674  7392628.629114 
-357661.557171  7392627.779260 
-357668.888070  7392629.618945 
-357678.643361  7392634.368131 
-357687.005038  7392635.227984 
-357699.151736  7392635.457945 
-357708.585424  7392630.778746 
-357723.296700  7392619.080750 
-357729.192754  7392611.052125 
-357740.597291  7392592.775256 
-357749.734115  7392576.807991 
-357756.479532  7392565.799876 
-357765.410199  7392549.942593 
-357774.901611  7392539.514379 
-357785.374324  7392533.855348 
-357801.949247  7392529.256136 
-357827.298160  7392526.066682 
-357849.348581  7392526.176663 
-357867.399580  7392527.896369 
-357890.142684  7392530.006008 
-357909.587296  7392535.395084 
-357926.780687  7392541.104107 
-357956.277454  7392552.132218 
-357968.696277  7392554.911741 
-357988.182120  7392556.651443 
-358008.674004  7392558.951050 
-358046.037675  7392568.839356 
-358060.666488  7392576.618023 
-358070.009467  7392581.587172 
-358098.302284  7392600.683901 
-358131.270715  7392589.875752 
-358146.542734  7392583.656818 
-358160.792220  7392577.587857 
-358181.737646  7392564.950022 
-358192.523716  7392557.521294 
-358203.012921  7392549.872605 
-358221.105151  7392547.393029 
-358231.742789  7392544.943449 
-358247.855923  7392535.914995 
-358258.452330  7392527.486439 
-358279.876037  7392517.948073 
-358294.636790  7392512.339034 
-358317.371648  7392504.030457 
-358336.206039  7392499.231279 
-358379.127669  7392493.552252 
-358391.299106  7392491.452611 
-358412.129084  7392490.772728 
-358434.880435  7392492.102500 
-358458.745026  7392493.662233 
-358479.731683  7392497.741534 
-358490.468275  7392507.029943 
-358505.418691  7392512.049083 
-358514.151450  7392516.678290 
-358532.218941  7392517.408165 
-358547.919764  7392519.217855 
-358560.264372  7392519.337835 
-358571.182381  7392520.327665 
-358588.408757  7392522.817239 
-358600.497731  7392528.476270 
-358609.329444  7392533.655382 
-358620.272192  7392541.733999 
-358637.614015  7392553.751940 
-358650.667798  7392565.389947 
-358662.212521  7392575.358239 
-358672.429601  7392584.316705 
-358683.141454  7392596.164675 
-358695.700464  7392606.132968 
-358803.148849  7392630.878729 
-358809.044904  7392644.106463 
-358815.122376  7392659.343853 
-358820.449441  7392678.440582 
-358820.152577  7392699.147035 
-358812.648507  7392725.312553 
-358807.255472  7392744.869203 
-358804.286829  7392756.247254 
-358805.086713  7392768.545148 
-358814.495662  7392787.681870 
-358829.437832  7392804.768943 
-358842.466877  7392819.176475 
-358857.458524  7392831.174420 
-358878.041116  7392845.661939 
-358899.167959  7392856.830026 
-358910.226154  7392864.018794 
-358922.315128  7392869.787806 
-358935.937901  7392875.566816 
-358945.660207  7392883.515455 
-358954.401212  7392898.002973 
-358957.757427  7392910.210882 
-358954.854754  7392935.876486 
-358949.263810  7392954.313328 
-358943.813051  7392980.178897 
-358941.685524  7392999.645563 
-358946.113750  7393027.260832 
-358948.043368  7393049.766977 
-358951.770664  7393075.492571 
-358956.974035  7393096.798921 
-358968.205402  7393128.803439 
-358976.492863  7393147.600219 
-358993.405882  7393172.126018 
-359005.923661  7393186.423569 
-359024.997192  7393199.341356 
-359045.612769  7393210.499445 
-359064.570853  7393213.228978 
-359085.343108  7393218.638051 
-359119.144407  7393228.156421 
-359130.219095  7393233.355530 
-359146.901220  7393239.714441 
-359160.837350  7393254.801857 
-359169.240259  7393273.158712 
-359173.586022  7393298.664343 
-359175.408439  7393331.798668 
-359177.568952  7393394.157986 
-359182.632137  7393429.871869 
-359191.084524  7393453.207871 
-359201.491267  7393475.344080 
-359208.500563  7393499.439952 
-359213.250392  7393515.657174 
-359218.758874  7393536.973523 
-359223.566426  7393556.950101 
-359228.258531  7393567.958216 
-359233.865968  7393579.636215 
-359236.001742  7393591.284220 
-359225.891863  7393591.414198 
-359200.872799  7393581.985813 
-359183.283589  7393574.057171 
-359167.112731  7393567.588279 
-359150.908888  7393565.108704 
-359130.441743  7393559.489666 
-359116.810724  7393554.930447 
-359103.286906  7393549.701343 
-359090.925806  7393539.723052 
-359077.632882  7393530.964552 
-359063.779215  7393528.165032 
-359051.665502  7393524.505659 
-359040.788724  7393520.306378 
-359031.981749  7393512.357740 
-359024.832267  7393502.099497 
-359009.675696  7393496.640432 
-358978.504944  7393479.283405 
-358967.430256  7393473.314427 
-358958.375895  7393470.674880 
-358939.450795  7393463.846049 
-358922.743932  7393460.476626 
-358918.142535  7393461.206501 
-358908.247059  7393460.776575 
-358895.020105  7393466.965515 
-358885.066904  7393471.634715 
-358875.361091  7393472.754523 
-358860.839479  7393475.823998 
-358850.020424  7393475.614033 
-358836.216234  7393477.253753 
-358824.580802  7393477.803658 
-358807.849200  7393476.093951 
-358797.236302  7393475.873989 
-358782.244654  7393474.734184 
-358768.019906  7393478.033619 
-358754.463103  7393486.872105 
-358739.710597  7393492.261182 
-358732.214773  7393496.950379 
-358718.971327  7393504.359110 
-358707.591528  7393519.636493 
-358702.091292  7393529.334832 
-358697.720790  7393537.593417 
-358692.566896  7393542.862514 
-358681.261314  7393551.061110 
-358667.424139  7393556.900110 
-358652.168612  7393561.189375 
-358642.042241  7393563.638956 
-358623.422252  7393567.438305 
-358615.555348  7393568.248166 
-358598.799007  7393569.857890 
-358570.069140  7393574.237140 
-358542.147403  7393580.386087 
-358527.122771  7393582.235770 
-358510.341691  7393585.945135 
-358493.585351  7393587.784820 
-358481.793241  7393592.873948 
-358468.599272  7393595.513496 
-358460.394272  7393599.642788 
-358448.742348  7393601.302504 
-358438.112957  7393602.632276 
-358432.992048  7393604.022038 
-358424.424214  7393614.020326 
-358404.814678  7393635.756602 
-358396.354045  7393645.754890 
-358388.915945  7393654.203443 
-358380.884116  7393661.662165 
-358369.397117  7393667.091235 
-358351.601751  7393670.570639 
-358340.131244  7393674.220014 
-358330.227521  7393674.899898 
-358324.916949  7393674.739925 
-358318.080824  7393674.669937 
-358309.191387  7393675.579781 
-358299.732960  7393682.248639 
-358294.240971  7393690.277264 
-358288.542825  7393699.305717 
-358283.347700  7393708.224189 
-358278.177314  7393715.812890 
-358272.998681  7393723.291609 
-358260.151053  7393731.700168 
-358248.161034  7393736.569334 
-358235.486578  7393738.658976 
-358227.034191  7393746.657606 
-358210.277850  7393759.235452 
-358203.177846  7393764.704515 
-358190.338465  7393773.103076 
-358182.933350  7393778.342179 
-358168.386999  7393783.961216 
-358136.564795  7393791.629903 
-358104.618897  7393790.540089 
-358093.156637  7393793.979500 
-358085.982416  7393796.899000 
-358082.898326  7393799.078627 
-358078.527823  7393807.127248 
-358075.922014  7393812.966248 
-358069.753834  7393817.115537 
-358058.308066  7393818.775253 
-358055.380654  7393826.054006 
-358054.753940  7393837.572033 
-358052.222348  7393867.106974 
-358046.309800  7393877.135257 
-358044.817232  7393894.062357 
-358043.885408  7393905.460405 
-358039.935464  7393913.169084 
-358033.882731  7393926.506800 
-358021.274244  7393942.444070 
-358014.380395  7393958.321350 
-358007.461808  7393966.559939 
-358003.495371  7393975.828351 
-357999.998969  7393988.636157 
-357995.966562  7394004.773393 
-357992.503145  7394014.261768 
-357980.133799  7394026.759627 
-357965.884313  7394032.828588 
-357956.104283  7394040.817219 
-357941.871289  7394045.886351 
-357926.285913  7394052.705183 
-357912.704371  7394063.203385 
-357900.005176  7394078.360788 
-357892.352674  7394098.447348 
-357892.946403  7394111.075185 
-357895.576950  7394124.502885 
-357897.572538  7394139.250359 
-357902.561508  7394151.368283 
-357904.557095  7394166.555681 
-357905.200301  7394174.204371 
-357904.293216  7394183.502779 
-357903.188221  7394192.131301 
-357900.565920  7394199.080110 
-357897.968357  7394203.929280 
-357881.286233  7394218.496784 
-357870.648595  7394231.564546 
-357864.571123  7394247.341843 
-357862.905384  7394260.949513 
-357862.707475  7394270.807824 
-357865.371007  7394280.686132 
-357869.758002  7394291.584265 
-357875.142791  7394304.372075 
-357877.822816  7394312.700648 
-357880.140006  7394326.338312 
-357878.499007  7394337.736360 
-357878.960795  7394352.913760 
-357879.546278  7394365.981522 
-357881.368695  7394378.619357 
-357886.200986  7394395.946389 
-357887.627584  7394406.254623 
-357890.010745  7394413.143443 
-357889.738619  7394431.310331 
-357883.471484  7394445.417915 
-357875.917936  7394456.086087 
-357863.639299  7394469.033870 
-357854.741616  7394481.801683 
-357843.353572  7394498.078894 
-357834.521859  7394513.826197 
-357822.795719  7394533.642803 
-357817.551116  7394547.770383 
-357812.702332  7394563.777641 
-357813.221845  7394578.515117 
-357813.658895  7394590.813010 
-357827.108497  7394635.795305 
-357811.927187  7394653.252315 
-357802.988273  7394659.701210 
-357785.539248  7394669.499532 
-357767.653174  7394681.947399 
-357748.777552  7394691.175819 
-357733.678704  7394700.554212 
-357718.439670  7394713.472000 
-357703.101681  7394726.719730 
-357698.318867  7394704.413551 
-357634.476549  7394756.894562 
-357579.259789  7394818.504009 
-357560.219242  7394835.961018 
-357392.243524  7395038.926252 
-357333.266482  7395104.974939 
-357303.118263  7395131.150455 
-357277.719873  7395148.607465 
-357179.317602  7395214.476182 
-357053.150274  7395295.412319 
-357022.581497  7395314.389068 
-356973.137098  7395338.714901 
-356839.482191  7395377.988174 
-356760.590503  7395401.434158 
-356526.595462  7395463.833469 
-356474.602978  7395476.831243 
-356425.199810  7395492.428571 
-356201.611512  7395549.628774 
-356032.868894  7395597.570562 
-355772.626101  7395656.220515 
-355426.696726  7395723.299025 
-355197.237112  7395785.968291 
-355105.217424  7395804.365139 
-355031.611569  7395825.071593 
-354978.703753  7395859.575682 
-354925.795938  7395887.180954 
-354877.489518  7395937.782286 
-354860.007509  7395950.550099 
-354822.635592  7395978.975230 
-354751.882933  7396032.606044 
-Region 1
-1464
-352640.699455  7390122.748349 
-352645.828611  7390119.808853 
-352686.061970  7390107.810908 
-352697.120166  7390104.491476 
-352730.302998  7390092.863468 
-352759.065850  7390084.954823 
-352767.155402  7390082.155302 
-352774.725442  7390080.685554 
-352782.880964  7390081.095484 
-352792.240436  7390084.184955 
-352798.021044  7390087.564376 
-352801.459722  7390091.473706 
-352805.170526  7390097.492675 
-352809.343118  7390108.500789 
-352809.994571  7390115.479594 
-352810.126510  7390122.018474 
-352810.274942  7390128.107431 
-352810.225465  7390132.536672 
-352809.260656  7390137.405838 
-352808.996777  7390143.044872 
-352805.797239  7390177.009055 
-352804.972616  7390188.407102 
-352803.752174  7390197.475549 
-352800.775285  7390209.853429 
-352800.272265  7390219.371798 
-352801.121626  7390226.130641 
-352802.927551  7390229.030144 
-352807.792827  7390232.069623 
-352819.090163  7390235.179091 
-352824.903756  7390236.228911 
-352830.090635  7390237.948616 
-352836.390755  7390240.108246 
-352854.804588  7390246.717114 
-352873.292637  7390254.875717 
-352892.943405  7390259.954847 
-352902.525525  7390261.264622 
-352920.576524  7390261.894515 
-352938.644015  7390262.294446 
-352952.909994  7390264.324098 
-352962.690023  7390266.303759 
-352975.834515  7390268.533377 
-352982.654148  7390269.933138 
-352986.637077  7390269.753168 
-352998.387956  7390268.543376 
-353004.234533  7390265.723859 
-353009.693538  7390260.684722 
-353014.459859  7390253.755909 
-353015.977166  7390244.907424 
-353016.084367  7390233.949301 
-353015.457653  7390225.300783 
-353015.985412  7390213.902735 
-353017.477980  7390206.943927 
-353019.687970  7390200.205081 
-353022.805045  7390195.475891 
-353026.301447  7390192.526397 
-353032.238733  7390190.476748 
-353042.027009  7390191.796522 
-353053.728410  7390195.565876 
-353061.653037  7390199.185256 
-353069.569419  7390203.474521 
-353081.468730  7390207.583817 
-353089.401604  7390210.433329 
-353095.107995  7390211.373168 
-353107.452602  7390211.723108 
-353122.939024  7390213.982721 
-353132.521144  7390215.742420 
-353137.411158  7390216.232336 
-353141.913600  7390215.392480 
-353145.220339  7390211.213196 
-353146.490258  7390206.573990 
-353145.566681  7390197.265585 
-353143.117550  7390186.497429 
-353143.463892  7390183.177998 
-353143.909188  7390178.978717 
-353146.284103  7390176.009226 
-353149.368193  7390174.379505 
-353154.060298  7390174.649459 
-353157.301067  7390176.789092 
-353161.984926  7390177.828914 
-353167.592363  7390178.768753 
-353170.462051  7390177.688938 
-353174.494458  7390172.529822 
-353178.040337  7390164.921125 
-353180.233834  7390159.742012 
-353180.266819  7390156.082639 
-353178.164030  7390152.303287 
-353174.923262  7390149.943691 
-353170.025001  7390149.443776 
-353156.443459  7390150.643571 
-353149.401178  7390150.353620 
-353142.383636  7390147.954032 
-353139.151113  7390144.934549 
-353137.460636  7390140.035388 
-353137.823470  7390135.056241 
-353140.404540  7390131.876785 
-353145.327540  7390129.157251 
-353156.699092  7390124.837991 
-353165.102001  7390121.598546 
-353171.064026  7390117.449257 
-353173.381217  7390113.969853 
-353176.564262  7390108.430801 
-353180.365774  7390096.172901 
-353186.138135  7390079.625736 
-353188.842899  7390074.776566 
-353191.935235  7390072.256998 
-353202.721305  7390064.618306 
-353220.467194  7390055.709832 
-353225.423178  7390050.670695 
-353230.016329  7390040.412452 
-353237.800770  7390027.204715 
-353248.504378  7390018.226253 
-353258.358623  7390012.907164 
-353272.698818  7390007.728051 
-353284.276526  7390002.758902 
-353302.179093  7389998.729592 
-353313.113595  7389997.729764 
-353332.805594  7389999.089531 
-353347.071573  7390000.169346 
-353355.515713  7390002.918875 
-353363.910376  7390010.307609 
-353374.828385  7390020.825807 
-353382.513872  7390029.434333 
-353386.232922  7390033.563626 
-353392.170208  7390042.492096 
-353400.490655  7390057.189579 
-353409.239905  7390070.237344 
-353416.282186  7390080.155645 
-353424.297523  7390084.784852 
-353435.998924  7390088.994131 
-353445.465597  7390090.753829 
-353454.148878  7390090.503872 
-353462.131229  7390088.044293 
-353467.177922  7390083.885006 
-353471.012419  7390077.606081 
-353473.181178  7390075.526438 
-353477.691866  7390072.916885 
-353487.339956  7390068.137703 
-353496.254131  7390064.238371 
-353503.667493  7390057.559515 
-353508.516276  7390053.070284 
-353514.585502  7390047.701204 
-353529.626627  7390023.485352 
-353540.338480  7390014.076963 
-353549.120716  7390004.458611 
-353598.218773  7389995.020228 
-353645.263519  7390001.399135 
-353691.912446  7390011.767359 
-353703.415938  7390025.564996 
-353713.814434  7390026.774788 
-353729.878092  7390022.945444 
-353762.203316  7390015.746677 
-353771.653496  7390009.747705 
-353792.401012  7389996.439984 
-353804.382786  7389992.020741 
-353827.134136  7389983.172257 
-353837.606849  7389976.293435 
-353839.899301  7389971.784208 
-353844.871778  7389964.745413 
-353849.794778  7389952.387530 
-353852.210923  7389944.878816 
-353862.980501  7389939.669709 
-353879.266806  7389934.080666 
-353895.487142  7389935.020505 
-353904.368332  7389934.110661 
-353919.887738  7389933.600748 
-353926.509462  7389935.210473 
-353934.343381  7389937.290116 
-353938.590189  7389941.429407 
-353940.717717  7389952.967431 
-353941.872189  7389960.616121 
-353944.560460  7389967.174997 
-353945.492284  7389976.273439 
-353951.041998  7389981.972463 
-353953.260234  7389985.201909 
-353962.825861  7389987.631493 
-353966.190323  7389988.441355 
-353974.733418  7389991.070904 
-353979.994513  7389995.660118 
-353982.814724  7389999.789411 
-353988.784995  7390004.608585 
-353993.386392  7390003.878710 
-354000.032854  7390002.728907 
-354006.365959  7390001.799067 
-354012.707310  7390000.859228 
-354017.514863  7389999.139522 
-354018.883737  7389995.160204 
-354018.933215  7389990.620981 
-354019.023923  7389981.212593 
-354020.293843  7389966.385133 
-354022.124506  7389956.766780 
-354024.598375  7389943.948976 
-354028.762722  7389935.680392 
-354032.102445  7389928.411637 
-354043.234856  7389917.883441 
-354053.905479  7389912.454370 
-354064.361699  7389907.575206 
-354085.546266  7389901.806194 
-354099.012360  7389902.386095 
-354112.981475  7389903.635881 
-354119.545475  7389900.156477 
-354141.397986  7389898.936686 
-354152.629352  7389898.276799 
-354163.547361  7389899.156648 
-354180.748999  7389903.645879 
-354186.240988  7389905.475566 
-354198.610334  7389914.014103 
-354205.726831  7389916.413692 
-354212.496987  7389922.792600 
-354218.252856  7389929.381471 
-354226.012559  7389939.319769 
-354230.176905  7389951.757638 
-354238.085040  7389966.785064 
-354255.360893  7389963.975545 
-354269.330008  7389965.105352 
-354289.244655  7389974.493744 
-354315.772779  7389985.501858 
-354323.103678  7389987.131579 
-354332.240502  7389991.760786 
-354337.831446  7389994.580303 
-354340.552702  7389997.379823 
-354344.486154  7390002.179001 
-354347.025993  7390003.758731 
-354349.557586  7390005.888366 
-354356.888485  7390007.178145 
-354359.444817  7390007.198142 
-354361.522867  7390002.908876 
-354362.867002  7390001.699084 
-354365.637736  7390000.179344 
-354378.773981  7390002.858885 
-354381.808594  7390005.208483 
-354384.002092  7390010.767530 
-354389.386880  7390013.367085 
-354391.069111  7390018.926133 
-354394.120217  7390019.286071 
-354399.406050  7390022.105588 
-354408.979924  7390023.975268 
-354419.700024  7390023.305383 
-354423.122210  7390027.994579 
-354426.948461  7390033.013720 
-354429.174943  7390035.583280 
-354436.002822  7390036.203173 
-354441.313395  7390036.263163 
-354449.658580  7390037.892884 
-354452.998303  7390040.912367 
-354458.251152  7390046.501409 
-354460.403419  7390056.159755 
-354462.390760  7390061.718803 
-354465.293433  7390067.397830 
-354466.744770  7390075.156501 
-354469.457780  7390079.725718 
-354475.527006  7390084.664872 
-354478.784267  7390085.244773 
-354487.467547  7390085.004814 
-354490.741301  7390083.815018 
-354500.999612  7390079.155816 
-354506.862682  7390073.896717 
-354512.024822  7390068.637618 
-354519.908219  7390065.498155 
-354528.632731  7390061.048918 
-354538.058173  7390056.939621 
-354546.007539  7390048.371089 
-354546.370373  7390042.292130 
-354551.037740  7390035.363317 
-354556.356558  7390033.643612 
-354561.963995  7390034.473470 
-354562.623694  7390040.012521 
-354564.099769  7390045.121646 
-354568.363070  7390047.381259 
-354575.999080  7390049.230942 
-354584.542175  7390052.410397 
-354587.378878  7390054.660012 
-354589.893978  7390058.229401 
-354593.101762  7390064.128390 
-354595.823018  7390067.697779 
-354601.380978  7390072.846897 
-354609.734409  7390075.146503 
-354619.275298  7390080.335614 
-354634.266945  7390081.035494 
-354645.184955  7390081.145475 
-354655.591698  7390082.025324 
-354669.593798  7390079.945681 
-354680.792179  7390071.977046 
-354688.700314  7390067.067887 
-354695.874535  7390064.598310 
-354701.020183  7390060.439022 
-354711.938192  7390060.549003 
-354716.011830  7390061.588825 
-354721.437850  7390069.497470 
-354726.517528  7390072.316987 
-354731.951794  7390079.465763 
-354740.577351  7390084.644876 
-354752.707556  7390086.314590 
-354762.899897  7390087.414401 
-354772.284108  7390088.284252 
-354791.745212  7390091.573689 
-354805.219553  7390091.263742 
-354813.911080  7390089.803992 
-354825.546512  7390089.913973 
-354835.977993  7390087.254429 
-354842.830611  7390085.654703 
-354850.483113  7390086.514556 
-354855.232942  7390091.323732 
-354856.906927  7390097.092744 
-354863.487419  7390102.811764 
-354866.225167  7390103.831589 
-354872.855137  7390104.891408 
-354876.120644  7390104.931401 
-354881.035398  7390102.981735 
-354883.501021  7390101.571976 
-354889.941327  7390100.082232 
-354899.993482  7390105.271343 
-354905.048421  7390110.420461 
-354910.482687  7390117.999162 
-354915.727290  7390124.368072 
-354922.472707  7390134.066410 
-354935.707907  7390136.745951 
-354947.293861  7390141.955059 
-354966.177729  7390152.223300 
-354979.759271  7390161.991627 
-354994.338607  7390173.099724 
-355008.711787  7390185.087671 
-355021.988218  7390194.855998 
-355032.650594  7390200.285068 
-355040.632946  7390208.773614 
-355050.660362  7390216.402307 
-355060.019834  7390219.381797 
-355068.851547  7390224.011004 
-355074.640401  7390226.610558 
-355086.036691  7390230.269932 
-355099.502786  7390230.959813 
-355114.494433  7390232.429562 
-355121.322312  7390232.939474 
-355131.935211  7390233.049455 
-355153.119778  7390227.280444 
-355170.387385  7390225.230795 
-355187.811670  7390217.652093 
-355202.044664  7390213.252846 
-355215.741653  7390210.843259 
-355234.163733  7390206.044081 
-355257.599520  7390199.525198 
-355266.010675  7390195.395905 
-355269.639017  7390189.566904 
-355281.150755  7390181.148346 
-355290.262840  7390178.688767 
-355297.437060  7390175.769267 
-355308.891075  7390173.339683 
-355320.130687  7390172.009911 
-355337.348817  7390159.572041 
-355358.104579  7390140.385328 
-355372.230372  7390125.457885 
-355381.705291  7390116.919347 
-355392.755240  7390103.741605 
-355408.216923  7390089.054121 
-355420.792425  7390076.326301 
-355427.175007  7390070.307332 
-355450.841689  7390051.380574 
-355458.568407  7390043.701889 
-355466.220909  7390034.143526 
-355471.416035  7390024.675148 
-355482.078411  7390009.047825 
-355492.064596  7390000.399306 
-355509.736268  7389988.951267 
-355517.149630  7389982.272411 
-355522.600388  7389978.003143 
-355527.828498  7389964.985372 
-355530.459046  7389956.926753 
-355532.792729  7389948.648171 
-355534.392498  7389941.019478 
-355541.187392  7389925.252178 
-355544.114804  7389917.643482 
-355548.963588  7389912.704328 
-355557.176833  7389908.025129 
-355562.817255  7389905.305595 
-355578.559309  7389902.476080 
-355584.397641  7389900.206468 
-355596.898926  7389895.347301 
-355602.357931  7389890.088202 
-355613.581051  7389880.119909 
-355620.285236  7389873.211092 
-355629.570492  7389862.672898 
-355635.293376  7389851.654785 
-355636.959115  7389838.717001 
-355638.682577  7389828.988667 
-355638.154818  7389810.481837 
-355633.635884  7389803.133096 
-355628.919040  7389794.774528 
-355623.138432  7389790.845201 
-355604.501951  7389777.037566 
-355599.884062  7389758.280779 
-355598.754328  7389748.632432 
-355596.099042  7389738.754124 
-355595.777439  7389719.587407 
-355613.350156  7389697.061265 
-355621.827282  7389686.293110 
-355636.390125  7389658.747828 
-355643.514868  7389640.101022 
-355651.860054  7389621.474213 
-355656.725330  7389594.278871 
-355659.628003  7389569.053192 
-355664.344847  7389535.328969 
-355672.228243  7389512.372901 
-355678.017097  7389494.815908 
-355698.038945  7389461.241659 
-355710.993773  7389441.874976 
-355726.199823  7389421.208516 
-355740.218415  7389396.542741 
-355747.211218  7389380.995405 
-355761.452459  7389343.821772 
-355763.695434  7389323.355278 
-355770.119247  7389293.630369 
-355775.504036  7389275.073548 
-355788.153754  7389234.560488 
-355809.874325  7389225.692007 
-355817.279440  7389219.783019 
-355819.852264  7389217.483413 
-355825.014405  7389211.994353 
-355829.879681  7389204.515634 
-355838.076434  7389180.559737 
-355852.292936  7389157.333716 
-355851.443574  7389150.244930 
-355860.605136  7389142.026338 
-355865.783769  7389134.437638 
-355873.832090  7389125.439179 
-355880.561014  7389115.980799 
-355894.670315  7389102.493109 
-355905.901681  7389091.534987 
-355914.436530  7389085.086091 
-355932.858609  7389069.868698 
-355945.401126  7389060.250345 
-355956.137718  7389057.810763 
-355961.745155  7389058.860583 
-355963.938652  7389063.759744 
-355963.072798  7389068.728893 
-355962.009034  7389073.478080 
-355961.448291  7389078.567208 
-355965.192079  7389081.376727 
-355971.492200  7389084.536185 
-355980.480591  7389083.626341 
-355986.846681  7389079.926975 
-355997.781183  7389078.047297 
-356013.820102  7389076.647537 
-356020.153207  7389076.047639 
-356032.110241  7389074.617884 
-356051.612577  7389072.818193 
-356058.762059  7389072.218295 
-356070.752078  7389067.799052 
-356080.490876  7389062.909890 
-356085.644770  7389057.650791 
-356086.444655  7389048.792308 
-356087.343494  7389040.723690 
-356087.384725  7389036.734373 
-356088.869047  7389020.797103 
-356093.519921  7389014.758138 
-356098.871724  7389010.048944 
-356105.015166  7389008.339237 
-356116.469181  7389005.459730 
-356123.090904  7389006.519549 
-356127.057341  7389007.889314 
-356134.874767  7389012.288561 
-356138.907174  7389017.307701 
-356148.274892  7389019.287362 
-356153.387555  7389018.337525 
-356165.369328  7389014.138244 
-356176.345061  7389008.929136 
-356183.222418  7389004.229941 
-356199.500477  7388999.630729 
-356211.589451  7388994.771561 
-356229.953807  7388984.873257 
-356247.551263  7388979.844118 
-356263.342795  7388972.135439 
-356274.326774  7388966.256446 
-356286.630150  7388959.847543 
-356296.616335  7388951.089044 
-356298.710878  7388946.119895 
-356303.584400  7388938.311232 
-356309.513440  7388936.591527 
-356315.830053  7388937.651345 
-356320.596374  7388940.800806 
-356326.203811  7388941.850626 
-356331.481399  7388944.230218 
-356337.097082  7388944.510171 
-356343.636342  7388943.910273 
-356347.742965  7388940.630835 
-356348.625312  7388934.541878 
-356348.666543  7388930.002656 
-356348.732513  7388923.693736 
-356350.860041  7388914.855250 
-356355.296513  7388909.916096 
-356364.911618  7388907.466516 
-356373.611391  7388905.106920 
-356386.797114  7388902.917295 
-356398.770641  7388899.597864 
-356409.358801  7388891.399268 
-356421.373559  7388884.210499 
-356428.085991  7388876.191873 
-356449.031416  7388863.324077 
-356458.250702  7388859.104800 
-356472.458958  7388857.025156 
-356487.170233  7388855.175473 
-356505.270709  7388851.586088 
-356521.829141  7388849.316476 
-356546.493616  7388842.027725 
-356565.822781  7388837.238545 
-356575.569826  7388832.009441 
-356590.660428  7388823.410914 
-356601.479482  7388812.892715 
-356619.753129  7388791.476384 
-356626.160451  7388782.897853 
-356642.323063  7388768.990236 
-356672.743408  7388736.735760 
-356684.947829  7388709.610407 
-356695.832853  7388692.113404 
-356698.974667  7388684.274747 
-356703.938898  7388677.795856 
-356711.640878  7388672.886697 
-356715.450636  7388668.827393 
-356723.713359  7388659.159049 
-356716.530892  7388641.812020 
-356711.814048  7388634.013356 
-356708.325893  7388625.784765 
-356709.397903  7388620.265711 
-356715.087802  7388612.237086 
-356736.156921  7388597.599593 
-356750.744503  7388587.441333 
-356761.233709  7388579.462700 
-356772.720708  7388573.043799 
-356785.815722  7388559.326149 
-356792.825018  7388552.637295 
-356805.895294  7388541.469208 
-356815.147565  7388534.700367 
-356825.669755  7388522.512455 
-356833.891247  7388516.723447 
-356845.609141  7388508.534849 
-356851.752582  7388506.155257 
-356863.742602  7388501.176110 
-356873.456662  7388498.836510 
-356883.904636  7388494.947177 
-356893.173399  7388486.408639 
-356900.100233  7388477.170222 
-356907.530087  7388469.381556 
-356925.993397  7388459.263289 
-356934.404552  7388454.584090 
-356947.928371  7388449.734921 
-356958.730933  7388440.756459 
-356967.166827  7388433.527697 
-356973.854520  7388427.618709 
-356984.871484  7388418.090341 
-356993.340363  7388407.652129 
-356997.282061  7388401.043261 
-356999.393096  7388393.754510 
-357000.704247  7388385.465930 
-357000.918649  7388374.057884 
-357000.968126  7388368.858774 
-357001.528870  7388363.219740 
-357009.511221  7388351.001833 
-357022.804145  7388348.142323 
-357040.904621  7388343.773071 
-357049.497193  7388342.093359 
-357057.166188  7388340.173688 
-357065.577343  7388335.714452 
-357073.271076  7388331.805121 
-357086.514523  7388323.846485 
-357098.850884  7388314.668057 
-357109.150426  7388305.239672 
-357115.013496  7388300.210533 
-357125.255314  7388296.541162 
-357138.498761  7388287.922638 
-357144.139183  7388285.763008 
-357152.855448  7388280.973828 
-357161.448021  7388279.394099 
-357167.104935  7388274.364960 
-357172.580432  7388267.326166 
-357181.024572  7388259.877442 
-357183.663366  7388250.818994 
-357188.371964  7388239.240977 
-357190.507737  7388229.402662 
-357194.663838  7388221.693982 
-357197.096476  7388212.635534 
-357201.755596  7388206.366608 
-357204.361405  7388200.637589 
-357215.106243  7388197.418141 
-357226.065484  7388192.988899 
-357236.999986  7388191.429166 
-357247.151096  7388186.440021 
-357254.341809  7388181.530862 
-357261.029502  7388176.051800 
-357272.029974  7388168.303128 
-357280.234973  7388163.393969 
-357289.223365  7388152.635811 
-357313.483775  7388124.190684 
-357330.405040  7388104.644032 
-357342.832110  7388086.377161 
-357350.880431  7388077.158740 
-357356.578576  7388068.350249 
-357364.206340  7388060.671564 
-357376.872550  7388049.173534 
-357394.643177  7388026.867354 
-357400.885574  7388014.079545 
-357409.840980  7388005.860953 
-357418.986050  7387989.113821 
-357426.457135  7387977.005895 
-357429.095929  7387967.957445 
-357431.512074  7387960.448731 
-357436.575260  7387943.771588 
-357440.516958  7387926.424559 
-357443.172244  7387916.156318 
-357448.284907  7387894.280065 
-357454.461334  7387868.094551 
-357462.740550  7387855.546700 
-357474.598629  7387843.258805 
-357479.999911  7387833.790427 
-357486.225815  7387823.222237 
-357486.671111  7387808.604741 
-357485.698056  7387803.495616 
-357483.941609  7387785.318730 
-357482.836614  7387772.910855 
-357479.686554  7387761.472814 
-357476.726157  7387750.584679 
-357471.052750  7387735.917192 
-357462.418947  7387721.659634 
-357456.885726  7387713.301066 
-357450.206279  7387697.063847 
-357441.325089  7387676.927296 
-357435.709406  7387603.789824 
-357414.871181  7387585.532951 
-357397.809730  7387566.876147 
-357391.715765  7387553.408454 
-357389.959318  7387524.163463 
-357392.251770  7387509.006059 
-357395.814142  7387489.109468 
-357403.004855  7387463.493855 
-357411.952015  7387435.558640 
-357416.215317  7387416.661877 
-357418.928326  7387399.964737 
-357417.691392  7387380.358096 
-357410.657357  7387358.471845 
-357402.996609  7387324.467669 
-357402.658513  7387321.298212 
-357391.146775  7387288.073903 
-357378.967093  7387271.226789 
-357362.375677  7387255.899414 
-357344.753482  7387242.761665 
-357325.218161  7387226.404466 
-357308.131971  7387210.297226 
-357292.027083  7387198.509245 
-357263.907436  7387172.433711 
-357243.077458  7387153.177010 
-357214.438299  7387128.871173 
-357194.597868  7387113.163864 
-357178.534211  7387096.616698 
-357160.565674  7387076.730104 
-357141.343710  7387049.744727 
-357129.584585  7387031.357876 
-357120.744626  7387006.242178 
-357109.348335  7386982.106313 
-357101.646356  7386956.000784 
-357087.932874  7386928.845436 
-357077.237513  7386916.887484 
-357060.670836  7386899.790413 
-357048.317982  7386890.032084 
-357028.733185  7386878.654033 
-357019.596361  7386873.694882 
-356998.716905  7386859.537308 
-356986.891810  7386848.339226 
-356971.149756  7386830.472286 
-356958.128958  7386815.944775 
-356934.280859  7386792.118856 
-356924.822432  7386778.851128 
-356914.143564  7386764.903517 
-356903.538911  7386753.615451 
-356868.657355  7386741.867463 
-356853.937834  7386744.157071 
-356840.422262  7386748.786278 
-356828.102393  7386756.304990 
-356818.462549  7386761.644076 
-356799.281817  7386771.862325 
-356782.649170  7386782.220551 
-356764.037427  7386786.799767 
-356744.708262  7386790.819078 
-356728.463188  7386793.208669 
-356699.675597  7386794.808395 
-356673.724709  7386798.317794 
-356650.495077  7386794.538441 
-356631.941058  7386792.478794 
-356607.911542  7386787.919575 
-356585.588996  7386785.160048 
-356562.606751  7386777.291395 
-356545.446345  7386768.482904 
-356533.786175  7386761.504100 
-356515.768161  7386746.156729 
-356507.200327  7386735.988470 
-356498.071750  7386719.621274 
-356490.897529  7386702.604189 
-356479.501239  7386678.798266 
-356468.418305  7386653.662572 
-356457.343617  7386627.966973 
-356449.872532  7386609.730097 
-356444.116663  7386582.874697 
-356443.852784  7386537.362493 
-356436.884719  7386519.015636 
-356427.063458  7386500.978725 
-356421.357066  7386490.180575 
-356411.519313  7386474.143322 
-356397.269827  7386449.197595 
-356388.833933  7386425.521650 
-356386.854837  7386409.114461 
-356393.435329  7386393.337163 
-356399.760188  7386383.108915 
-356408.039404  7386371.110971 
-356434.839653  7386333.167470 
-356446.541055  7386316.010409 
-356460.914235  7386296.773704 
-356466.496933  7386278.776787 
-356464.723993  7386251.181513 
-356459.735024  7386219.576927 
-356456.964290  7386189.762034 
-356458.555813  7386173.604802 
-356464.435375  7386156.277770 
-356479.361053  7386143.130022 
-356496.851308  7386128.572515 
-356513.096382  7386115.784706 
-356526.463522  7386105.166524 
-356539.871893  7386091.018948 
-356546.237983  7386076.241479 
-356547.309993  7386061.074077 
-356547.730551  7386038.597927 
-356533.167708  7385973.229124 
-356525.614160  7385943.034296 
-356523.849467  7385914.999098 
-356520.847839  7385867.237280 
-356515.529020  7385837.172429 
-356499.457117  7385801.248583 
-356483.723309  7385772.193560 
-356466.364993  7385753.526757 
-356439.300864  7385735.539838 
-356422.107473  7385730.280739 
-356402.143349  7385726.871323 
-356374.345305  7385721.052320 
-356358.199186  7385712.923712 
-356347.297669  7385701.635646 
-356329.007529  7385672.770590 
-356316.423781  7385655.483551 
-356299.246883  7385638.476464 
-356276.586241  7385629.288038 
-356256.374730  7385619.999629 
-356226.144048  7385612.950836 
-356206.410818  7385607.111837 
-356191.757266  7385602.532621 
-356170.968519  7385590.034762 
-356150.872455  7385579.536560 
-356130.792883  7385566.828737 
-356110.053613  7385549.121770 
-356096.686473  7385528.615282 
-356081.694826  7385506.988987 
-356067.626757  7385485.252710 
-356044.545557  7385456.557625 
-356026.247171  7385439.880482 
-356014.826142  7385428.252474 
-356000.551916  7385417.144376 
-355982.138083  7385411.755299 
-355958.586849  7385410.085585 
-355931.464996  7385408.375878 
-355897.828621  7385405.276409 
-355874.277387  7385403.826658 
-355848.244036  7385394.818201 
-355829.681771  7385384.120033 
-355817.279440  7385368.822653 
-355811.168983  7385357.574580 
-355809.412536  7385339.397694 
-355810.525777  7385319.471107 
-355809.222873  7385296.754998 
-355805.256436  7385263.830638 
-355796.903004  7385231.636152 
-355762.293574  7385110.576889 
-355750.889037  7385067.274306 
-355738.206335  7385028.720910 
-355724.014572  7384999.345941 
-355707.390171  7384977.699649 
-355684.655313  7384955.543444 
-355660.840199  7384929.397923 
-355644.900235  7384910.631137 
-355614.949925  7384886.195323 
-355592.165590  7384868.358378 
-355559.320853  7384847.321982 
-355535.629433  7384839.123386 
-355515.698293  7384832.714484 
-355491.033817  7384820.186630 
-355473.123004  7384815.017515 
-355447.906031  7384806.468980 
-355430.374545  7384794.880964 
-355412.513209  7384784.962663 
-355396.004255  7384773.284664 
-355371.826307  7384762.516508 
-355343.492258  7384759.467031 
-355315.496305  7384763.846280 
-355292.077010  7384769.925239 
-355270.043082  7384779.893532 
-355252.742490  7384785.372593 
-355221.126442  7384794.910959 
-355192.792393  7384802.489661 
-355168.383551  7384804.359341 
-355148.213271  7384801.499831 
-355129.024292  7384792.111439 
-355112.812202  7384780.653402 
-355097.078394  7384763.006424 
-355081.979546  7384742.030017 
-355072.644813  7384726.772631 
-355065.396376  7384706.426116 
-355059.657000  7384688.659159 
-355049.745030  7384659.434165 
-355045.028186  7384641.667209 
-355045.168372  7384616.971439 
-355047.460824  7384591.525797 
-355051.171628  7384567.859851 
-355054.024824  7384547.183393 
-355054.461874  7384523.487452 
-355050.206819  7384511.039584 
-355034.225624  7384496.592059 
-355017.428052  7384482.694439 
-355002.947671  7384472.136248 
-354985.424431  7384459.118478 
-354960.083765  7384442.591308 
-354950.584107  7384433.852805 
-354921.788269  7384416.185831 
-354905.304054  7384400.958440 
-354886.832498  7384380.951867 
-354876.458740  7384367.894103 
-354860.197173  7384351.446921 
-354850.441882  7384347.807544 
-354839.507380  7384349.577241 
-354831.483798  7384356.036135 
-354828.869743  7384361.985116 
-354820.788436  7384374.752929 
-354800.040920  7384399.128753 
-354790.747418  7384409.786928 
-354776.357746  7384430.793329 
-354764.136832  7384449.720087 
-354743.430547  7384469.776652 
-354729.865497  7384489.243317 
-354720.497779  7384508.090089 
-354715.005790  7384526.856875 
-354713.793594  7384556.081869 
-354713.859564  7384580.337714 
-354717.199287  7384603.843687 
-354717.232272  7384630.869058 
-354718.296036  7384667.532778 
-354722.460382  7384690.278882 
-354723.548885  7384703.916546 
-354723.062357  7384731.701786 
-354722.229488  7384764.476173 
-354720.101960  7384793.801149 
-354717.520890  7384826.995464 
-354712.507182  7384849.211658 
-354701.770590  7384882.545948 
-354689.491952  7384906.011929 
-354684.173133  7384918.029870 
-354675.572315  7384931.007647 
-354658.807728  7384944.355361 
-354645.770437  7384952.533960 
-354621.699690  7384962.372275 
-354604.770178  7384971.940636 
-354586.793396  7384984.278522 
-354571.661562  7385007.714508 
-354558.789196  7385019.662461 
-354542.667815  7385040.758848 
-354528.063741  7385062.215173 
-354510.639456  7385090.500328 
-354494.188225  7385113.926315 
-354465.532574  7385143.201300 
-354448.231982  7385159.308541 
-354428.333828  7385179.375104 
-354404.840316  7385202.951066 
-354386.319282  7385218.268442 
-354366.825193  7385229.596502 
-354345.434471  7385236.025400 
-354323.276849  7385238.355001 
-354303.271494  7385238.814923 
-354248.401075  7385257.531717 
-354261.751722  7385360.444089 
-354284.973108  7385405.856310 
-354291.792740  7385437.710854 
-354299.362780  7385466.685890 
-354308.672775  7385484.722801 
-354323.227372  7385538.683558 
-354185.911139  7385956.691957 
-354099.284486  7386476.442928 
-354056.404087  7386585.144309 
-354048.025916  7386591.873156 
-354042.575158  7386616.288974 
-354036.835781  7386629.086782 
-354029.043093  7386642.844425 
-354012.360969  7386658.631721 
-353999.134015  7386684.967210 
-353987.251196  7386699.684689 
-353978.675117  7386711.002750 
-353967.443750  7386721.410967 
-353957.647228  7386732.169125 
-353937.328516  7386753.895403 
-353915.715146  7386772.062291 
-353909.002714  7386780.300880 
-353901.061594  7386788.519472 
-353898.579478  7386801.897181 
-353893.722448  7386807.936146 
-353889.417916  7386810.335735 
-353864.745194  7386808.096119 
-353841.870150  7386809.855818 
-353829.731699  7386809.405895 
-353811.458052  7386809.885812 
-353795.757228  7386809.285915 
-353787.082194  7386809.415893 
-353772.049315  7386812.255406 
-353755.993904  7386816.304713 
-353738.091337  7386830.742240 
-353731.049056  7386841.530392 
-353713.633017  7386837.581068 
-353699.350546  7386837.881017 
-353687.665637  7386842.970145 
-353680.145075  7386850.208905 
-353677.844376  7386855.827943 
-353670.620678  7386863.506628 
-353657.154584  7386883.313235 
-353653.773629  7386895.121212 
-353644.669790  7386907.879027 
-353638.913921  7386921.666665 
-353626.297189  7386938.263822 
-353621.646314  7386944.752711 
-353611.173602  7386951.181610 
-353591.621789  7386967.368837 
-353582.484965  7386973.037866 
-353573.933624  7386981.036496 
-353569.109579  7386983.975992 
-353561.300399  7386999.073406 
-353549.813399  7387005.272344 
-353546.259274  7387003.682617 
-353543.752420  7386998.783456 
-353543.628726  7386991.474708 
-353539.068561  7386987.665360 
-353534.285747  7386987.065463 
-353528.958682  7386988.555208 
-353523.516170  7386992.264573 
-353513.035211  7386999.253375 
-353505.836251  7387004.942401 
-353490.259122  7387011.541271 
-353482.177816  7387014.000849 
-353462.848651  7387017.800199 
-353456.408345  7387019.279945 
-353451.551315  7387025.208929 
-353444.294632  7387036.546987 
-353441.383713  7387042.056044 
-353434.250723  7387051.284463 
-353426.062216  7387053.414098 
-353415.581257  7387081.109354 
-353412.942463  7387090.167803 
-353411.540604  7387097.676516 
-353407.400996  7387103.175574 
-353399.517600  7387106.195057 
-353384.674384  7387110.474324 
-353369.369380  7387120.402624 
-353355.020939  7387126.791529 
-353333.011749  7387133.990296 
-353316.890368  7387144.348522 
-353308.536937  7387153.017037 
-353301.346224  7387157.926196 
-353285.752602  7387165.744857 
-353262.374538  7387177.132906 
-353246.954086  7387188.270998 
-353232.094379  7387194.549923 
-353221.506219  7387202.188614 
-353208.831762  7387215.136397 
-353199.373336  7387232.313454 
-353194.029778  7387246.101093 
-353188.496557  7387258.119034 
-353044.863712  7387317.848803 
-352742.012645  7387441.097691 
-352657.686691  7387489.209450 
-352637.755551  7387492.878822 
-352617.750196  7387493.228762 
-352587.230896  7387493.698681 
-352573.608123  7387489.129464 
-352554.732501  7387478.751242 
-352527.445724  7387472.602295 
-352510.532705  7387470.002740 
-352494.996806  7387472.832256 
-352479.625832  7387479.321144 
-352474.364737  7387484.810204 
-352466.291677  7387496.018284 
-352460.098758  7387502.487176 
-352450.516638  7387511.695599 
-352442.781674  7387520.364114 
-352435.302342  7387522.953670 
-352422.619640  7387526.253105 
-352396.165732  7387538.720970 
-352383.647954  7387545.239853 
-352367.732729  7387554.828210 
-352358.653629  7387565.036462 
-352350.094041  7387573.475016 
-352334.508665  7387591.361953 
-352323.582410  7387601.780168 
-352315.360918  7387607.449197 
-352308.137220  7387615.907748 
-352291.397371  7387625.926032 
-352286.441387  7387631.415092 
-352278.681684  7387642.413208 
-352272.340332  7387644.002936 
-352263.327202  7387647.122401 
-352255.122203  7387651.251694 
-352253.357509  7387663.859534 
-352250.380620  7387676.227416 
-352247.618133  7387687.055561 
-352235.290018  7387694.684254 
-352226.606737  7387695.484117 
-352218.921250  7387699.173485 
-352212.950979  7387704.092643 
-352210.658527  7387708.831831 
-352193.357935  7387734.347460 
-352181.887428  7387748.515034 
-352171.266283  7387759.703117 
-352163.844676  7387767.161840 
-352158.707274  7387770.101336 
-352157.025043  7387775.290447 
-352156.662209  7387780.379576 
-352155.351058  7387799.306334 
-352153.644088  7387806.595085 
-352148.704596  7387811.084316 
-352138.075205  7387812.084145 
-352124.452432  7387817.703182 
-352120.617935  7387822.872297 
-352119.224322  7387829.721124 
-352117.979141  7387842.109002 
-352117.814216  7387848.427920 
-352116.082508  7387858.156253 
-352113.295282  7387870.744097 
-352108.116649  7387879.002682 
-352102.616413  7387887.471232 
-352094.394921  7387893.150259 
-352088.111294  7387899.399189 
-352085.653917  7387909.667430 
-352082.932661  7387917.176144 
-352080.821626  7387924.014972 
-352076.352169  7387931.503689 
-352067.437993  7387935.403021 
-352051.225904  7387944.211513 
-352026.759338  7387962.118445 
-352006.885922  7387979.525464 
-351994.566053  7387987.044176 
-351983.755245  7387996.232602 
-351972.482647  7388000.551862 
-351950.852784  7388000.661843 
-351933.915027  7388010.460165 
-351917.810138  7388018.268827 
-351905.721164  7388023.127995 
-351891.842758  7388033.396236 
-351884.140778  7388038.085433 
-351858.090936  7388070.709845 
-351846.241102  7388082.107892 
-351829.328083  7388089.136688 
-351812.918084  7388097.385275 
-351760.818399  7388113.352540 
-351729.375522  7388123.890735 
-351722.506412  7388126.940213 
-351708.157970  7388133.419103 
-351688.705112  7388139.867998 
-351679.980600  7388144.987122 
-351659.670134  7388154.965412 
-351650.261185  7388157.305012 
-351639.475115  7388163.733910 
-351622.529111  7388174.302100 
-351611.462670  7388179.171266 
-351606.795303  7388186.879946 
-351611.710057  7388194.788591 
-351613.062438  7388202.107337 
-351598.697505  7388210.495901 
-351592.026304  7388213.855325 
-351585.693199  7388214.235260 
-351581.108295  7388213.415400 
-351576.119325  7388212.585543 
-351570.478903  7388215.525039 
-351565.729075  7388220.674157 
-351557.507583  7388226.133222 
-351552.559844  7388231.622282 
-351550.242653  7388238.131167 
-351549.516985  7388249.749177 
-351553.912226  7388259.207557 
-351558.373437  7388261.467170 
-351568.227682  7388265.776431 
-351564.137552  7388276.584580 
-351558.431160  7388286.492883 
-351552.262980  7388290.972116 
-351544.783649  7388293.111749 
-351535.325222  7388300.220532 
-351531.367031  7388308.259155 
-351525.372022  7388315.727875 
-351517.018590  7388323.946467 
-351514.932294  7388328.465693 
-351514.091178  7388331.225221 
-351515.369344  7388336.004402 
-351517.587580  7388338.573962 
-351521.001519  7388343.703083 
-351520.976781  7388346.252647 
-351517.554595  7388351.971667 
-351516.218706  7388352.961497 
-351516.177475  7388356.720854 
-351517.653550  7388362.609845 
-351522.114761  7388365.419364 
-351523.796992  7388370.308526 
-351522.065283  7388380.146841 
-351520.300590  7388382.566426 
-351515.361098  7388387.275620 
-351508.689897  7388390.974986 
-351501.845526  7388391.574883 
-351495.702084  7388393.724515 
-351488.511371  7388398.193750 
-351483.868743  7388403.122905 
-351482.656547  7388411.421484 
-351486.375597  7388417.550434 
-351487.909396  7388426.758857 
-351494.193024  7388431.588029 
-351500.682807  7388435.747317 
-351503.189661  7388439.646649 
-351504.830661  7388449.304995 
-351498.967591  7388473.380871 
-351497.013235  7388484.988882 
-351492.716948  7388496.016993 
-351489.962707  7388505.845310 
-351482.367929  7388520.062875 
-351470.402648  7388532.560734 
-351465.034352  7388534.570390 
-351438.910293  7388549.077905 
-351438.555705  7388553.387166 
-351437.656866  7388561.685745 
-351437.483696  7388568.324608 
-351442.076846  7388578.782816 
-351446.950368  7388581.052428 
-351448.310996  7388587.491325 
-351447.610067  7388596.229828 
-351441.466625  7388598.709403 
-351437.458957  7388610.967303 
-351435.776726  7388616.266396 
-351433.162671  7388622.545320 
-351431.562902  7388629.064204 
-351427.250123  7388641.312106 
-351420.752094  7388648.340902 
-351413.058360  7388652.470194 
-351410.831878  7388650.670503 
-351406.568577  7388648.300909 
-351406.824210  7388643.541724 
-351407.690064  7388638.012671 
-351407.351969  7388631.363810 
-351402.577401  7388629.544121 
-351399.196447  7388630.513955 
-351380.197131  7388632.423628 
-351361.461695  7388638.102655 
-351354.774002  7388643.791681 
-351349.578877  7388653.040097 
-351345.101174  7388661.628626 
-351342.017083  7388673.896524 
-351336.121028  7388691.443519 
-351331.626833  7388702.031705 
-351328.839607  7388715.069472 
-351320.939718  7388729.387019 
-351315.299296  7388742.174829 
-351304.810091  7388759.341888 
-351295.854684  7388767.330520 
-351284.400670  7388779.508434 
-351275.610188  7388790.716514 
-351269.483239  7388801.724628 
-351269.903796  7388810.263166 
-351272.262218  7388818.921683 
-351277.028540  7388831.929455 
-351281.918554  7388842.607626 
-351282.751424  7388851.696069 
-351283.196720  7388868.093260 
-351284.326454  7388877.181703 
-351288.523785  7388896.058470 
-351292.729363  7388903.957117 
-351295.054800  7388916.055045 
-351297.792548  7388927.273123 
-351301.660031  7388938.941124 
-351303.911251  7388968.306095 
-351306.772694  7388977.974438 
-351306.739709  7388990.822238 
-351305.824377  7389000.660552 
-351301.338428  7389010.478871 
-351294.502302  7389020.147215 
-351289.117514  7389028.175839 
-351275.799851  7389042.553377 
-351271.478826  7389046.492702 
-351254.351405  7389064.149677 
-351243.928170  7389076.117627 
-351237.900175  7389086.355874 
-351231.699010  7389093.824594 
-351228.961261  7389102.103176 
-351225.283442  7389112.581381 
-351222.710618  7389124.739299 
-351214.447895  7389134.397645 
-351205.904800  7389141.846369 
-351195.968092  7389155.254072 
-351194.747650  7389164.652462 
-351177.282134  7389206.225341 
-351169.761571  7389223.312414 
-351159.767140  7389243.039035 
-351156.270738  7389255.626879 
-351145.929965  7389278.442971 
-351139.547382  7389294.210270 
-351133.824498  7389315.086694 
-351132.826704  7389322.605406 
-351134.632629  7389335.803146 
-351134.212071  7389357.059505 
-351129.363287  7389361.998659 
-351123.384770  7389367.697682 
-351115.839469  7389377.146064 
-351110.372218  7389382.845088 
-351102.637254  7389391.073678 
-351097.879179  7389397.002663 
-351092.684053  7389405.811154 
-351088.387767  7389416.619303 
-351083.035964  7389421.328496 
-351073.338396  7389421.118532 
-351064.630377  7389425.017864 
-351061.010282  7389429.517093 
-351055.031764  7389435.216117 
-351051.411669  7389440.165269 
-351051.048835  7389445.254398 
-351045.226996  7389446.304218 
-351040.320489  7389446.474189 
-351038.094007  7389445.234401 
-351034.366710  7389439.875319 
-351032.173213  7389435.206119 
-351026.681223  7389433.376432 
-351024.133138  7389432.796532 
-351017.000149  7389431.726715 
-351014.089229  7389427.377460 
-351009.298169  7389426.777563 
-351004.721511  7389425.177837 
-351002.692938  7389423.388143 
-351000.977722  7389421.488468 
-350998.775979  7389417.699118 
-350994.694095  7389417.659124 
-350991.931607  7389418.069054 
-350990.034974  7389423.808071 
-350989.878296  7389428.907198 
-350988.806286  7389433.986328 
-350980.782704  7389440.665184 
-350966.879559  7389452.483159 
-350955.606961  7389457.352325 
-350943.485002  7389465.200981 
-350929.656074  7389470.260114 
-350912.330743  7389477.278912 
-350898.716216  7389481.348215 
-350890.338046  7389482.927944 
-350881.630026  7389486.047410 
-350877.836760  7389487.227208 
-350872.559173  7389494.705927 
-350868.600982  7389502.754548 
-350864.040816  7389522.891099 
-350855.852309  7389577.441755 
-350885.678926  7389595.798611 
-350887.971378  7389614.145468 
-350878.793323  7389639.391144 
-350899.450131  7389639.391144 
-350959.103363  7389602.677432 
-350968.165971  7389604.647095 
-350975.719518  7389606.286814 
-350973.163186  7389596.958412 
-350970.689317  7389589.069763 
-350971.703604  7389579.881337 
-350971.761327  7389574.122324 
-350974.482583  7389568.063362 
-350979.850880  7389561.584471 
-350981.821729  7389559.054905 
-350984.427538  7389553.435867 
-350989.705125  7389546.067129 
-350996.780391  7389542.597724 
-351004.243230  7389541.567900 
-351014.757174  7389541.447921 
-351025.584475  7389540.568071 
-351034.482158  7389538.778378 
-351046.554639  7389535.688907 
-351065.809588  7389528.910068 
-351075.416446  7389528.010222 
-351082.623652  7389532.069527 
-351087.563144  7389537.768551 
-351090.581265  7389542.007825 
-351098.200782  7389545.517223 
-351106.133656  7389547.916812 
-351112.738886  7389551.316230 
-351118.519494  7389555.025595 
-351122.964212  7389559.274867 
-351124.547489  7389564.274011 
-351125.001031  7389569.373137 
-351122.725072  7389582.200940 
-351121.702539  7389586.310236 
-351119.756429  7389593.578991 
-351118.783373  7389599.108044 
-351118.907067  7389606.416792 
-351121.479891  7389614.525403 
-351125.767931  7389624.203745 
-351133.041106  7389632.142385 
-351140.198834  7389640.191007 
-351156.188276  7389653.858666 
-351174.395953  7389670.105883 
-351193.890042  7389689.462567 
-351208.024082  7389704.559981 
-351219.626528  7389717.737724 
-351248.999602  7389750.492113 
-351262.919239  7389766.249414 
-351273.837248  7389776.767612 
-351292.234589  7389793.784698 
-351310.326819  7389811.691630 
-351317.459808  7389822.729739 
-351332.088622  7389838.936963 
-351348.069817  7389853.604451 
-351358.798163  7389862.572915 
-351367.176333  7389871.071459 
-351380.395041  7389886.158875 
-351386.357065  7389891.977878 
-351395.287733  7389896.717066 
-351401.563115  7389902.546068 
-351407.846743  7389906.485393 
-351413.198546  7389912.294398 
-351418.063822  7389915.673819 
-351427.225385  7389918.083406 
-351440.773942  7389920.113059 
-351456.870584  7389923.042557 
-351467.161880  7389925.032216 
-351473.791849  7389925.092206 
-351481.559798  7389923.732439 
-351491.389305  7389921.062896 
-351511.642048  7389916.623656 
-351521.257153  7389914.614001 
-351529.008609  7389914.913949 
-351534.294443  7389916.853617 
-351542.515935  7389921.802769 
-351565.242547  7389944.848822 
-351572.928034  7389952.237556 
-351584.522234  7389965.865222 
-351598.491349  7389977.413244 
-351611.470916  7389985.961779 
-351617.053614  7389988.571332 
-351622.446649  7389990.281039 
-351627.138754  7389990.331031 
-351634.708794  7389988.751301 
-351651.382672  7389984.931956 
-351665.698129  7389982.532367 
-351679.263178  7389983.332230 
-351687.212544  7389984.412045 
-351693.314755  7389986.571675 
-351700.835317  7389989.861111 
-351705.906749  7389992.790610 
-351709.650538  7389995.600128 
-351713.113955  7389996.519971 
-351718.836839  7389996.140036 
-351723.941256  7389995.750103 
-351726.299678  7389994.330346 
-351728.880748  7389992.030740 
-351732.500843  7389986.971606 
-351738.916411  7389978.403074 
-351745.472164  7389975.693538 
-351753.454515  7389973.893846 
-351759.383555  7389973.183968 
-351764.487972  7389973.233959 
-351773.130022  7389975.753528 
-351778.729212  7389977.583214 
-351785.705523  7389984.192082 
-351792.978699  7389991.570819 
-351799.641653  7389998.399649 
-351805.727371  7390002.668918 
-351815.779526  7390007.418104 
-351827.843762  7390015.626698 
-351837.656776  7390023.695316 
-351842.010786  7390027.504663 
-351850.248771  7390030.364174 
-351862.156328  7390034.023547 
-351869.874799  7390037.532946 
-351885.006633  7390045.221629 
-351895.075280  7390048.531062 
-351902.505134  7390050.710688 
-351910.965767  7390051.690521 
-351925.751258  7390053.050288 
-351928.794117  7390054.520036 
-351930.806198  7390057.539519 
-351933.403760  7390062.658642 
-351936.817700  7390068.777594 
-351940.330594  7390074.136676 
-351944.461956  7390079.825701 
-351948.914920  7390083.185126 
-351953.293669  7390084.344927 
-351959.404126  7390085.844670 
-351966.438160  7390086.574545 
-351973.892753  7390086.434569 
-351983.087300  7390085.084800 
-351991.580918  7390083.065146 
-352001.600088  7390081.615395 
-352010.052474  7390083.035152 
-352014.925997  7390085.854669 
-352019.585117  7390089.444054 
-352025.637850  7390096.042923 
-352028.878619  7390098.622482 
-352033.150166  7390099.882266 
-352039.672935  7390101.052065 
-352050.871316  7390103.711610 
-352064.716737  7390107.400978 
-352076.649033  7390108.180844 
-352086.429062  7390109.940543 
-352094.658801  7390113.349959 
-352100.447655  7390116.399437 
-352104.686217  7390121.088633 
-352106.467403  7390126.977625 
-352109.980297  7390132.326708 
-352114.350799  7390134.476340 
-352119.760327  7390134.316368 
-352126.093432  7390133.936433 
-352132.640939  7390132.336707 
-352144.202154  7390129.907123 
-352164.141540  7390126.127770 
-352179.834117  7390128.167421 
-352188.105086  7390128.247407 
-352195.155614  7390126.877642 
-352198.858171  7390124.148109 
-352200.334246  7390119.508904 
-352196.705905  7390105.191356 
-352195.452478  7390097.982591 
-352196.846091  7390091.233747 
-352199.039588  7390085.944653 
-352201.224839  7390082.205294 
-352204.721241  7390079.245801 
-352211.309979  7390073.446794 
-352213.280829  7390070.477303 
-352214.765150  7390065.058231 
-352216.909170  7390055.119933 
-352218.583155  7390051.150613 
-352220.949823  7390048.841009 
-352225.254355  7390047.451247 
-352230.152616  7390047.051315 
-352236.477475  7390047.781190 
-352254.025454  7390047.961159 
-352267.722443  7390045.991497 
-352277.774598  7390041.442276 
-352285.789935  7390035.663266 
-352291.529311  7390033.613617 
-352298.052080  7390034.233511 
-352305.778798  7390037.083023 
-352314.396109  7390043.481927 
-352319.945822  7390049.290932 
-352326.946872  7390053.350236 
-352335.811570  7390055.099937 
-352351.726795  7390055.479871 
-352370.693125  7390057.339553 
-352401.880370  7390061.418854 
-352449.708507  7390065.558145 
-352473.729777  7390071.887061 
-352498.031419  7390080.775539 
-352521.599146  7390092.193583 
-352537.003105  7390102.651791 
-352547.954099  7390109.960539 
-352558.418566  7390114.489764 
-352576.725198  7390120.548726 
-352589.317192  7390127.207585 
-352600.499081  7390131.416864 
-352608.951467  7390133.606489 
-352615.680392  7390134.006421 
-352622.524763  7390133.746465 
-352627.950783  7390132.026760 
-352640.699455  7390122.748349 
-Region 1
-198
-328374.697948  7391220.110381 
-328479.062243  7391217.660800 
-328563.718047  7391213.771467 
-328586.873462  7391215.191223 
-328609.220747  7391216.231045 
-328632.689520  7391217.620807 
-328669.344015  7391225.689425 
-328695.096993  7391231.858369 
-328708.323947  7391235.887678 
-328727.727328  7391243.876310 
-328762.509929  7391263.442958 
-328836.091045  7391317.683667 
-328856.286064  7391328.221862 
-328952.181480  7391391.311056 
-329044.786650  7391455.140122 
-329121.385887  7391503.891772 
-329192.476641  7391554.113169 
-329212.440766  7391567.450885 
-329255.156240  7391597.045815 
-329276.538716  7391602.834824 
-329302.448373  7391606.634173 
-329321.596121  7391607.574012 
-329340.677898  7391609.233728 
-329370.933319  7391606.264236 
-329404.709879  7391607.214073 
-329417.235904  7391609.463688 
-329439.418264  7391615.922582 
-329470.308644  7391628.130491 
-329472.856729  7391593.276461 
-329474.926533  7391573.469854 
-329485.481708  7391517.889374 
-329503.978004  7391411.327627 
-329521.756877  7391313.744342 
-329527.215882  7391291.428165 
-329543.898006  7391183.196704 
-329547.419147  7391152.122027 
-329558.535066  7391100.580855 
-329558.765960  7391099.081112 
-329586.671205  7390947.337104 
-329588.922426  7390912.033152 
-329591.313833  7390864.321324 
-329583.422190  7390823.248360 
-329532.287314  7390699.719519 
-329530.547359  7390695.370264 
-329511.952109  7390647.118529 
-329493.447567  7390599.246729 
-329474.662654  7390546.525760 
-329468.123393  7390520.980136 
-329462.548941  7390502.603283 
-329460.850218  7390496.864266 
-329446.889349  7390442.423592 
-329436.779470  7390407.749531 
-329424.756466  7390370.725873 
-329404.033688  7390283.320844 
-329372.277454  7390162.451548 
-329365.482560  7390131.796799 
-329360.493591  7390113.799882 
-329357.467224  7390103.261687 
-329353.459556  7390068.967561 
-329344.891722  7389999.999375 
-329343.951652  7389978.463064 
-329337.321682  7389930.331308 
-329330.823653  7389873.611024 
-329328.992989  7389856.913884 
-329321.340487  7389748.372476 
-329315.873237  7389695.391551 
-329308.962895  7389631.062570 
-329304.221313  7389600.217854 
-329279.738254  7389518.331880 
-329255.345904  7389427.987355 
-329238.474116  7389374.726478 
-329234.128352  7389362.398590 
-329226.236709  7389313.546958 
-329224.958544  7389292.110630 
-329223.804071  7389267.674815 
-329226.640775  7389247.018354 
-329226.682006  7389231.930938 
-329229.452739  7389149.984975 
-329228.430207  7389063.709753 
-329224.603956  7389003.320097 
-329216.481419  7388942.070588 
-329207.212655  7388865.033784 
-329198.026354  7388826.670355 
-329173.427848  7388746.374109 
-329163.746774  7388720.938466 
-329134.142806  7388619.945765 
-329130.357786  7388609.337583 
-329111.119330  7388543.218908 
-329097.075999  7388502.625861 
-329088.912230  7388478.939919 
-329055.539735  7388390.215116 
-329012.906723  7388275.254808 
-328986.312629  7388192.758939 
-328960.468942  7388116.581987 
-328929.636285  7387999.342069 
-328923.113517  7387969.287217 
-328910.711186  7387936.482836 
-328887.242414  7387852.937147 
-328849.491170  7387736.157150 
-328817.396840  7387632.704871 
-328813.446896  7387623.056524 
-328803.435972  7387598.610711 
-328788.295892  7387567.316071 
-328760.959638  7387523.133639 
-328702.716511  7387423.980623 
-328666.828915  7387377.298620 
-328638.033077  7387326.757277 
-328577.736639  7387228.914037 
-328526.074004  7387145.348351 
-328513.836598  7387125.711714 
-328457.770475  7387042.865905 
-328439.076271  7387008.751748 
-328421.676724  7386987.615369 
-328389.293776  7386938.503781 
-328382.738023  7386930.095222 
-328374.046496  7386909.598732 
-328330.729046  7386841.340424 
-328306.880947  7386804.066809 
-328296.738083  7386789.989220 
-328241.199720  7386687.776729 
-328211.430827  7386641.564644 
-328178.379935  7386588.683702 
-328128.993260  7386509.677235 
-328025.865899  7386341.556033 
-327991.000836  7386281.996235 
-327884.583229  7386123.873320 
-327838.288891  7386174.204699 
-327814.317098  7386188.692217 
-327793.099547  7386197.130772 
-327770.298719  7386203.059756 
-327742.583138  7386202.979770 
-327718.924702  7386193.261435 
-327699.026547  7386200.110261 
-327615.162382  7386198.190590 
-327550.627381  7386191.981654 
-327490.759746  7386188.902181 
-327460.586788  7386194.431234 
-327449.850196  7386192.871501 
-327415.257258  7386206.799116 
-327376.351542  7386222.096495 
-327327.335947  7386242.383020 
-327253.977479  7386281.536314 
-327176.561866  7386321.019551 
-327127.026759  7386347.694981 
-327067.678637  7386380.759318 
-327000.702751  7386416.073269 
-326979.559416  7386434.350138 
-326962.836060  7386453.616838 
-326924.392133  7386496.289529 
-326854.233202  7386589.153622 
-326763.062876  7386705.723654 
-326706.543212  7386745.806789 
-326616.106800  7386772.642192 
-326560.436497  7386791.488964 
-326475.186965  7386824.303343 
-326512.962947  7387026.518705 
-326538.542755  7387161.385604 
-326584.243365  7387461.304230 
-326617.929217  7387624.406292 
-326633.341422  7387701.123151 
-326682.670374  7387922.005316 
-326705.322769  7388085.307344 
-326728.527663  7388202.547262 
-326765.190404  7388338.873911 
-326817.735386  7388511.764296 
-326844.172801  7388598.099508 
-326938.171584  7388890.539415 
-327007.431675  7389127.458833 
-327107.623378  7389441.205091 
-327122.384131  7389496.095689 
-327144.277873  7389577.651719 
-327186.704730  7389699.290883 
-327212.903004  7389782.366653 
-327244.354128  7389902.246119 
-327270.643111  7389992.270699 
-327326.197967  7390145.214501 
-327376.128894  7390317.035069 
-327394.386049  7390396.111524 
-327404.850515  7390434.334977 
-327406.870842  7390496.824273 
-327403.588842  7390517.900663 
-327509.437459  7390521.899978 
-327534.918311  7390520.920146 
-327587.364338  7390541.876556 
-327606.404885  7390557.643855 
-327652.039525  7390618.353456 
-327684.678106  7390648.008377 
-327697.426779  7390658.606561 
-327867.389838  7390845.074621 
-327944.912653  7390923.891121 
-328000.046951  7390984.240783 
-328016.572397  7391002.267695 
-328038.861959  7391025.233761 
-328140.397796  7391133.435227 
-328228.096459  7391227.759071 
-328304.390585  7391222.739930 
-328311.861670  7391223.599783 
-328374.697948  7391220.110381 
-Region 1
-511
-360200.142783  7400752.597552 
-360204.232913  7400745.178823 
-360215.348832  7400730.441347 
-360229.977645  7400717.523560 
-360244.895077  7400702.586119 
-360253.718543  7400687.818648 
-360263.886146  7400668.022039 
-360270.582085  7400660.293363 
-360282.984416  7400643.556230 
-360292.813923  7400629.818583 
-360307.912771  7400601.253476 
-360325.031946  7400573.978148 
-360337.970282  7400554.981402 
-360345.680508  7400547.772637 
-360366.320823  7400540.493884 
-360418.956513  7400475.105084 
-360424.555704  7400454.988530 
-360441.320291  7400429.092965 
-360447.793582  7400414.265505 
-360451.949682  7400403.447358 
-360454.398812  7400384.540597 
-360459.923787  7400362.134435 
-360469.035872  7400335.958919 
-360483.013233  7400303.784430 
-360500.800352  7400272.139850 
-360520.319180  7400244.304618 
-360554.953349  7400199.682261 
-360583.213181  7400158.799264 
-360599.326316  7400143.551876 
-360607.894150  7400121.665625 
-360615.719823  7400096.999850 
-360623.825867  7400069.814507 
-360631.057812  7400026.221974 
-360634.554213  7400003.535860 
-360634.273842  7399978.300182 
-360634.232610  7399954.574246 
-360634.463505  7399928.328742 
-360633.135862  7399907.122374 
-360628.245847  7399886.125971 
-360623.355832  7399866.149393 
-360621.772556  7399844.933027 
-360616.198104  7399815.108136 
-360618.366863  7399800.230684 
-360608.644557  7399752.698826 
-360599.977768  7399700.887700 
-360592.844779  7399647.066919 
-360589.018528  7399621.041377 
-360583.650232  7399597.275448 
-360578.578800  7399569.210256 
-360574.299006  7399559.731879 
-360569.854288  7399550.283498 
-360567.627805  7399540.275212 
-360564.024203  7399523.148146 
-360562.754283  7399512.599952 
-360557.418972  7399467.317709 
-360557.633374  7399442.841901 
-360556.751027  7399428.694325 
-360560.197952  7399411.317301 
-360561.311193  7399400.729115 
-360562.003876  7399379.532746 
-360563.298534  7399347.998147 
-360561.187499  7399328.801435 
-360561.500856  7399293.977401 
-360560.189705  7399270.241466 
-360559.167173  7399258.323508 
-360557.905500  7399241.696356 
-360556.272746  7399226.288995 
-360553.328842  7399214.910944 
-360551.184822  7399199.493585 
-360552.248585  7399193.954534 
-360557.179831  7399181.126731 
-360561.278208  7399176.367546 
-360562.111077  7399168.548885 
-360562.927454  7399162.499921 
-360555.951143  7399148.052396 
-360543.590043  7399141.133581 
-360533.768782  7399133.214938 
-360521.110818  7399130.585388 
-360494.500232  7399128.835688 
-360476.960499  7399133.474893 
-360457.919953  7399135.324576 
-360437.089974  7399138.674003 
-360420.341880  7399140.033770 
-360401.540474  7399144.163062 
-360357.035567  7399158.150666 
-360324.998961  7399167.209115 
-360305.702781  7399170.058627 
-360290.199868  7399172.958130 
-360270.631562  7399177.577339 
-360249.282071  7399182.936421 
-360228.179967  7399188.555458 
-360210.401094  7399192.184837 
-360199.450100  7399197.383946 
-360179.098402  7399204.022809 
-360169.681207  7399207.722175 
-360153.419640  7399211.871465 
-360126.256556  7399214.151074 
-360102.862000  7399221.519812 
-360094.137488  7399220.979904 
-360074.222841  7399219.750115 
-360058.249892  7399218.850269 
-360042.796456  7399217.200552 
-360022.040693  7399212.221405 
-360006.603750  7399208.801990 
-359989.913379  7399203.612879 
-359968.143330  7399199.373605 
-359950.653075  7399197.963847 
-359933.426699  7399196.044176 
-359913.899625  7399195.864206 
-359899.204842  7399194.224487 
-359891.107043  7399192.134845 
-359873.600296  7399193.494612 
-359862.929673  7399195.664241 
-359848.680186  7399200.593396 
-359839.988659  7399208.592026 
-359824.221866  7399213.501185 
-359812.363787  7399207.102281 
-359795.087934  7399209.201922 
-359782.825789  7399191.424967 
-359774.851684  7399175.707659 
-359766.415790  7399154.691259 
-359752.421936  7399131.095301 
-359741.611128  7399120.147176 
-359725.984521  7399109.658973 
-359707.042929  7399100.150601 
-359691.886357  7399093.451749 
-359667.370313  7399084.913211 
-359651.182963  7399079.974057 
-359634.236959  7399074.774948 
-359614.841824  7399059.457572 
-359605.820448  7399047.519616 
-359602.159121  7399031.332389 
-359604.542282  7399020.504244 
-359621.430562  7399003.497157 
-359632.637190  7398997.538178 
-359652.584822  7398979.541261 
-359678.395524  7398956.805155 
-359694.022131  7398939.778072 
-359708.395311  7398920.471379 
-359718.975225  7398900.124864 
-359724.467214  7398880.998140 
-359726.998807  7398853.502850 
-359722.199501  7398822.428173 
-359712.295778  7398796.092684 
-359703.076492  7398776.825984 
-359687.359176  7398748.170892 
-359675.105278  7398728.884196 
-359652.964148  7398708.747645 
-359635.581094  7398695.469919 
-359614.751116  7398692.730389 
-359598.885368  7398703.408560 
-359586.581992  7398714.626638 
-359573.000450  7398725.834718 
-359542.547120  7398747.201058 
-359528.231664  7398755.629615 
-359513.973931  7398757.999209 
-359501.538615  7398757.109361 
-359486.060440  7398754.419822 
-359472.132556  7398749.480668 
-359455.186552  7398741.482038 
-359439.518714  7398732.993492 
-359420.321489  7398721.695427 
-359402.369445  7398712.926929 
-359363.686377  7398693.350282 
-359350.055358  7398684.121863 
-359341.231891  7398676.963089 
-359325.300174  7398668.724501 
-359321.028626  7398664.645199 
-359303.521878  7398661.935664 
-359294.879829  7398662.095636 
-359278.601769  7398662.935492 
-359260.039504  7398664.755181 
-359238.426134  7398666.034961 
-359210.974432  7398666.754838 
-359186.103800  7398663.215444 
-359156.673003  7398658.616232 
-359139.141517  7398658.426265 
-359126.458814  7398643.298856 
-359101.810831  7398629.211269 
-359088.600369  7398618.653077 
-359072.544958  7398609.544638 
-359052.531356  7398604.035581 
-359030.497428  7398574.630618 
-359011.127032  7398560.543031 
-358997.924817  7398544.695746 
-358975.033281  7398527.968611 
-358963.117477  7398524.639181 
-358942.749288  7398502.992889 
-358931.930233  7398492.024768 
-358926.149625  7398485.655859 
-358915.858329  7398473.187994 
-358903.530215  7398460.700133 
-358895.267492  7398448.502223 
-358888.019055  7398436.574266 
-358872.524387  7398410.428744 
-358861.284775  7398390.892091 
-358852.312876  7398372.885175 
-358843.093590  7398355.128217 
-358834.641204  7398335.871515 
-358829.676973  7398323.963555 
-358826.526913  7398309.046110 
-358832.348752  7398285.650118 
-358834.954561  7398271.782493 
-358828.571978  7398269.252927 
-358819.105305  7398267.603209 
-358809.094381  7398268.263096 
-358793.137925  7398266.063473 
-358785.757549  7398261.104322 
-358781.246860  7398254.175509 
-358775.845579  7398244.437177 
-358764.267872  7398232.719184 
-358757.720364  7398227.100147 
-358752.681917  7398222.750892 
-358746.851832  7398221.181161 
-358727.555653  7398219.971368 
-358716.645890  7398218.081692 
-358708.028578  7398215.472139 
-358700.450293  7398211.352844 
-358691.610333  7398205.963767 
-358686.093605  7398198.595030 
-358682.143660  7398186.697068 
-358676.618686  7398180.578116 
-358659.425295  7398171.419684 
-358654.584758  7398168.120250 
-358646.882778  7398159.641702 
-358644.458386  7398157.332098 
-358642.372090  7398153.372776 
-358639.180799  7398147.423795 
-358638.521100  7398143.464473 
-358638.298452  7398135.105905 
-358637.531553  7398130.586679 
-358635.989508  7398126.847319 
-358631.990086  7398120.328436 
-358626.456865  7398114.719397 
-358622.193564  7398108.870399 
-358614.400876  7398100.211882 
-358606.113414  7398090.543538 
-358591.517586  7398076.265983 
-358577.927798  7398062.748299 
-358567.372622  7398051.540219 
-358555.283648  7398040.822055 
-358539.549840  7398038.132515 
-358524.244836  7398044.271464 
-358513.029962  7398047.680880 
-358488.967461  7398065.087898 
-358477.216583  7398071.266840 
-358469.860945  7398070.177026 
-358464.302985  7398066.847597 
-358446.524112  7398120.768361 
-358281.723193  7398090.663517 
-358267.473706  7398092.253245 
-358194.733706  7398165.740657 
-358179.519410  7398174.649131 
-358154.953889  7398171.479674 
-358147.029261  7398159.601709 
-358141.487794  7398144.544288 
-358134.346559  7398124.737681 
-358128.013453  7398111.269988 
-358115.338997  7398097.792296 
-358099.168139  7398089.283754 
-358012.970290  7398058.219075 
-357992.527884  7398054.219760 
-357957.662821  7398052.630032 
-357872.099932  7398051.050303 
-357819.010699  7398051.840167 
-357768.296380  7398052.630032 
-357708.090650  7398055.009624 
-357620.136354  7398057.389217 
-357587.646205  7398055.799489 
-357560.714016  7398044.711388 
-357512.382858  7398018.565867 
-357478.779468  7398013.126799 
-357448.309646  7397975.643219 
-357442.059003  7397952.217232 
-357440.500466  7397927.211515 
-357443.634033  7397905.345261 
-357482.679936  7397756.920684 
-357491.552880  7397728.695519 
-357413.832156  7397706.869258 
-357362.779742  7397676.664432 
-357215.262922  7398052.630032 
-357200.213551  7398185.747230 
-357201.582425  7398233.219099 
-357191.909597  7398268.283093 
-357182.277999  7398292.278982 
-357171.920734  7398312.845460 
-357158.133036  7398332.642069 
-357144.741157  7398350.529005 
-357120.983767  7398376.694523 
-357017.782190  7398499.293523 
-356968.576932  7398531.178061 
-356926.150075  7398576.070371 
-356901.287690  7398607.265028 
-356885.603359  7398627.821507 
-356872.557822  7398650.667594 
-356861.812984  7398671.614006 
-356853.319366  7398695.999829 
-356849.839457  7398708.187741 
-356852.148402  7398724.534941 
-356855.323200  7398746.371200 
-356871.197194  7398797.612423 
-356879.179546  7398827.447313 
-356883.335646  7398843.384583 
-356893.503248  7398868.720243 
-356906.243675  7398890.796462 
-356919.256227  7398910.353112 
-356927.024176  7398921.791153 
-356932.433703  7398939.508118 
-356937.109316  7398954.435561 
-356937.942185  7398972.862405 
-356935.476562  7398990.989300 
-356933.761346  7399009.636106 
-356935.872381  7399027.573033 
-356941.051014  7399043.010389 
-356943.648577  7399063.216928 
-356947.004793  7399083.183508 
-356945.602933  7399096.031307 
-356942.180748  7399108.609152 
-356930.108266  7399131.805179 
-356927.147869  7399137.704169 
-356910.177127  7399157.200829 
-356892.002434  7399170.628529 
-356872.285697  7399185.805929 
-356850.796020  7399199.953506 
-356831.318423  7399216.900603 
-356814.388911  7399232.617911 
-356802.588555  7399243.845988 
-356788.198883  7399259.833249 
-356765.678427  7399275.740524 
-356746.951237  7399293.447491 
-356729.444490  7399315.713677 
-356718.312078  7399336.780069 
-356706.635416  7399360.875941 
-356697.160497  7399393.560343 
-356691.899401  7399411.417284 
-356684.700442  7399444.631595 
-356679.365131  7399470.057240 
-356670.953976  7399498.212417 
-356669.189282  7399520.128663 
-356668.917157  7399523.668057 
-356664.126097  7399545.814263 
-356653.381258  7399578.238709 
-356646.982183  7399600.624875 
-356626.803657  7399644.047437 
-356610.195748  7399678.431547 
-356599.516879  7399704.297116 
-356586.520820  7399745.580045 
-356581.589574  7399769.685916 
-356575.305946  7399788.282730 
-356570.185037  7399817.487728 
-356562.342872  7399839.104025 
-356554.253319  7399860.460367 
-356543.863069  7399882.796541 
-356537.760858  7399908.202189 
-356528.624035  7399932.578014 
-356522.579548  7399952.944525 
-356514.127161  7399984.889054 
-356506.045855  7400005.485526 
-356485.677665  7400034.530550 
-356467.667898  7400056.536781 
-356450.202381  7400077.003275 
-356433.470779  7400097.039843 
-356425.719322  7400109.317740 
-356412.451137  7400140.702364 
-356408.410484  7400168.917531 
-356404.798635  7400194.093219 
-356403.347299  7400212.240110 
-356397.979002  7400240.435281 
-356392.421043  7400263.081402 
-356379.235320  7400286.917319 
-356370.659240  7400304.724269 
-356348.509865  7400337.868591 
-356337.855735  7400358.105125 
-356327.778841  7400374.392335 
-356313.067565  7400414.495466 
-356311.698691  7400440.491013 
-356308.763033  7400476.574832 
-356308.622847  7400511.908780 
-356314.065359  7400547.272722 
-356321.536444  7400585.156233 
-356330.021816  7400621.530003 
-356340.791393  7400657.663813 
-356349.771538  7400698.586804 
-356358.281648  7400728.901611 
-356369.092456  7400755.437066 
-356376.629511  7400775.663601 
-356403.033942  7400810.757590 
-356416.244403  7400834.603505 
-356426.816071  7400857.349609 
-356438.129899  7400884.904889 
-356447.662542  7400913.709955 
-356465.441415  7400975.609352 
-356471.378701  7400998.455439 
-356477.447927  7401019.821779 
-356484.267560  7401027.920392 
-356492.093233  7401039.558398 
-356497.337836  7401061.534634 
-356501.015654  7401093.349184 
-357046.808922  7401127.353360 
-357338.387392  7401144.500423 
-357401.693704  7401161.747468 
-357445.456450  7401181.944009 
-357516.844069  7401226.606359 
-357576.678719  7401300.513699 
-357707.249535  7401412.134579 
-358069.176598  7401832.972494 
-358127.353755  7401904.070315 
-358186.165872  7401945.723180 
-358248.276481  7401982.366904 
-358283.496132  7402010.452093 
-358351.981078  7402049.375426 
-358393.641035  7402072.261506 
-358439.778696  7402095.147585 
-358480.811939  7402119.133477 
-358523.576891  7402143.569291 
-358564.799798  7402164.825650 
-358591.929897  7402179.033217 
-358646.899271  7402210.497827 
-358692.121600  7402234.173771 
-358734.268084  7402258.919533 
-358780.216082  7402284.505150 
-358828.778134  7402312.430367 
-358872.491403  7402335.306448 
-358917.656008  7402361.651936 
-358962.523749  7402388.397354 
-359009.898344  7402414.352908 
-359057.602788  7402437.518940 
-359087.957163  7402451.566534 
-359131.703417  7402472.173004 
-359176.727836  7402484.800841 
-359242.161676  7402503.897570 
-359253.566213  7402508.076854 
-359268.186780  7402470.003376 
-359279.682026  7402451.106613 
-359290.146492  7402435.489288 
-359302.185989  7402406.754210 
-359311.042441  7402385.007935 
-359327.023636  7402350.793796 
-359340.357791  7402315.749798 
-359353.708438  7402277.176406 
-359368.823779  7402241.122581 
-359376.006246  7402220.696080 
-359391.377220  7402185.412124 
-359401.363405  7402169.844790 
-359414.202786  7402149.858214 
-359417.427062  7402144.599115 
-359434.513252  7402122.692867 
-359441.926614  7402109.335155 
-359458.501537  7402088.438735 
-359469.477270  7402073.071367 
-359478.927451  7402057.204085 
-359481.492028  7402051.155121 
-359490.191802  7402034.268014 
-359501.390183  7402024.459694 
-359508.275785  7402017.920814 
-359517.956860  7402007.092668 
-359532.041422  7401976.087979 
-359538.951763  7401960.710613 
-359548.410190  7401942.823677 
-359557.357350  7401927.196354 
-359562.742139  7401912.578858 
-359585.509982  7401880.634330 
-359595.644599  7401862.857375 
-359617.645542  7401830.602900 
-359628.274934  7401814.095727 
-359641.402933  7401800.148116 
-359662.579253  7401772.422865 
-359675.781469  7401752.676248 
-359685.676945  7401734.129425 
-359695.869286  7401712.313161 
-359701.410753  7401696.745828 
-359715.264421  7401666.650983 
-359726.941083  7401647.124328 
-359748.257590  7401609.310805 
-359762.103011  7401580.225787 
-359779.683975  7401555.739981 
-359798.213255  7401536.313309 
-359820.139982  7401509.617881 
-359839.980413  7401486.421855 
-359857.849995  7401459.416480 
-359870.178110  7401438.220111 
-359885.615054  7401414.124239 
-359900.194389  7401386.818916 
-359913.338881  7401371.601522 
-359925.172222  7401359.153655 
-359940.097899  7401343.206386 
-359953.563994  7401323.209811 
-359966.856918  7401296.894319 
-359973.231254  7401276.277850 
-359983.712213  7401252.201974 
-359986.664364  7401240.374000 
-360005.119428  7401207.819577 
-360024.250683  7401180.834199 
-360042.549069  7401160.137744 
-360063.997515  7401130.662793 
-360091.069890  7401094.129051 
-360101.996146  7401078.441738 
-360113.944934  7401057.915254 
-360132.334028  7401030.409965 
-360144.530203  7401010.133439 
-360153.180499  7400989.806920 
-360159.134278  7400962.631575 
-360164.873654  7400932.926663 
-360165.351936  7400898.352586 
-360166.910473  7400877.176213 
-360168.972031  7400856.499755 
-360173.862046  7400832.843807 
-360177.498634  7400808.407992 
-360180.475523  7400794.820320 
-360186.528256  7400779.003029 
-360200.142783  7400752.597552 
-Region 1
-309
-352533.638643  7397733.664668 
-352562.261310  7397751.121678 
-352590.273755  7397768.678670 
-352651.881344  7397811.391354 
-352673.610162  7397878.929785 
-352672.538152  7397904.285442 
-352667.590414  7397961.275680 
-352636.807235  7398005.008189 
-352612.200482  7398043.091666 
-352594.743212  7398072.456636 
-352592.368298  7398093.093101 
-352589.828459  7398100.141894 
-352590.933453  7398105.111043 
-352587.750408  7398121.518232 
-352588.179212  7398148.033690 
-352595.213247  7398195.295595 
-352595.823468  7398215.932060 
-352604.119176  7398285.270183 
-352623.926622  7398489.635177 
-352629.987602  7398546.215485 
-352634.580752  7398595.906974 
-352631.249275  7398647.788087 
-352612.010819  7398748.190889 
-352611.582015  7398754.679777 
-352610.262618  7398777.205919 
-352611.301643  7398792.113365 
-352613.000367  7398823.168046 
-352615.383527  7398847.763833 
-352618.179000  7398891.476345 
-352623.101999  7398898.765097 
-352619.539628  7398913.272612 
-352559.540053  7398911.352941 
-352481.646159  7398899.764926 
-352458.936040  7398897.365337 
-352425.110001  7398895.185710 
-352364.739347  7398891.356366 
-352345.731785  7398890.296547 
-352303.511084  7398886.657171 
-352289.129658  7398884.987457 
-352253.753329  7398881.448063 
-352184.443760  7398874.529248 
-352154.699606  7398872.609577 
-352044.010452  7398860.461658 
-351960.377181  7398859.131886 
-351852.739132  7398841.814852 
-351843.346675  7398840.795027 
-351816.233069  7398838.645395 
-351789.276141  7398836.265802 
-351690.849132  7398794.203007 
-351639.747241  7398770.517065 
-351580.300164  7398746.451187 
-351546.218493  7398729.334119 
-351521.628233  7398720.465638 
-351473.989759  7398701.448895 
-351465.578603  7398699.569217 
-351459.476393  7398699.429241 
-351452.137247  7398699.269269 
-351441.161514  7398695.499914 
-351380.782614  7398693.580243 
-351314.268517  7398692.770382 
-351210.539182  7398692.970348 
-351202.853695  7398693.040336 
-351138.038322  7398693.530252 
-351111.089640  7398692.180483 
-351076.678120  7398691.450608 
-351018.030927  7398690.840712 
-350954.592675  7398689.290978 
-350923.586848  7398688.651087 
-350892.572774  7398688.271153 
-350826.157633  7398688.451122 
-350774.536229  7398689.640918 
-350713.398675  7398686.571444 
-350651.189111  7398681.572300 
-350583.141216  7398677.273036 
-350521.203777  7398664.465230 
-350397.271177  7398641.129227 
-350314.866594  7398627.171618 
-350217.800213  7398611.154362 
-350183.858728  7398600.996102 
-350151.079961  7398588.558232 
-350062.169102  7398430.395324 
-350026.817511  7398374.024980 
-350010.861055  7398344.300072 
-350004.066161  7398328.832721 
-349997.048619  7398316.354858 
-349982.997042  7398298.447926 
-349965.556264  7398280.710964 
-349950.770772  7398268.373077 
-349935.869833  7398261.124319 
-349915.823247  7398250.956061 
-349891.216494  7398239.967943 
-349860.961074  7398228.009991 
-349850.950150  7398223.160822 
-349836.453277  7398223.350789 
-349820.397866  7398224.400609 
-349799.823520  7398231.979311 
-349786.208993  7398232.249265 
-349775.662064  7398234.688847 
-349745.992127  7398240.137914 
-349725.186887  7398247.676622 
-349706.187571  7398250.226186 
-349681.011829  7398252.985713 
-349661.088936  7398256.055187 
-349648.686605  7398258.074841 
-349630.008892  7398259.754554 
-349588.736508  7398262.134146 
-349566.183067  7398264.023822 
-349544.314064  7398266.893331 
-349526.543437  7398269.342911 
-349515.971769  7398273.662171 
-349504.666187  7398280.301034 
-349496.015891  7398288.069703 
-349490.812519  7398296.988176 
-349479.003917  7398313.485350 
-349455.782531  7398357.317842 
-349432.750809  7398440.303627 
-349419.078559  7398461.789947 
-349410.296323  7398471.548275 
-349395.651017  7398483.266268 
-349382.960069  7398489.125264 
-349369.287818  7398494.984261 
-349358.551226  7398498.883593 
-349348.787689  7398502.792923 
-349336.096740  7398505.722421 
-349296.572556  7398517.010488 
-349400.978082  7397946.868148 
-349420.513403  7397840.196420 
-349439.883799  7397734.424538 
-349485.666871  7397479.588189 
-349504.542493  7397377.255718 
-349508.665609  7397350.580287 
-349528.473055  7397227.991285 
-349557.796651  7397071.808038 
-349564.772962  7397028.975375 
-349576.053805  7396970.225438 
-349585.578202  7396896.428079 
-349593.519322  7396861.504061 
-349599.811196  7396825.810175 
-349607.570899  7396790.106291 
-349608.593431  7396721.048120 
-349605.418633  7396657.558995 
-349598.269151  7396621.065246 
-349595.102598  7396588.520821 
-349581.801428  7396531.910518 
-349572.499680  7396487.558115 
-349562.628942  7396463.452244 
-349552.469586  7396442.385852 
-349542.837988  7396422.829202 
-349533.396054  7396403.672484 
-349505.416594  7396377.436977 
-349486.549218  7396329.155248 
-349468.506465  7396313.287966 
-349449.432934  7396287.542376 
-349450.117371  7396152.125571 
-349463.616450  7396129.989363 
-349485.716349  7396101.494244 
-349508.616131  7396063.180807 
-349625.061154  7396003.940954 
-349602.639653  7395981.724759 
-349531.689084  7395906.387664 
-349487.307871  7395863.325040 
-349443.800758  7395807.954525 
-349418.996096  7395688.824930 
-349399.081449  7395620.606616 
-349374.870516  7395552.828225 
-349340.978508  7395393.055593 
-349290.899150  7395200.498576 
-349202.549034  7395015.310297 
-349200.124643  7394986.265273 
-349181.216036  7394936.783748 
-349897.054826  7394979.026513 
-349909.053091  7394943.062673 
-349929.033708  7394919.076781 
-349957.013169  7394893.091232 
-349986.988217  7394873.104656 
-350034.956541  7394863.116367 
-350086.066678  7394873.004673 
-350413.128678  7394959.079929 
-350434.997682  7394967.208537 
-350459.076675  7394978.806550 
-350503.020839  7395003.812267 
-350538.487877  7395033.177237 
-350571.200674  7395067.051435 
-350664.143939  7394740.557360 
-350674.938255  7394750.695624 
-350684.701792  7394756.644605 
-350700.163475  7394762.333630 
-350722.090202  7394768.172630 
-350748.156537  7394776.021285 
-350759.437381  7394781.610328 
-350770.009048  7394785.279700 
-350801.254016  7394766.242960 
-350898.427598  7394706.903125 
-350913.823311  7394699.274432 
-350994.388984  7394651.342642 
-351014.262400  7394681.097545 
-351105.721344  7394622.767536 
-351203.266006  7394563.817634 
-351302.377453  7394503.767920 
-351395.361949  7394445.477905 
-351493.285938  7394386.538000 
-351588.579380  7394327.158172 
-351686.066318  7394266.578548 
-351779.487865  7394209.928252 
-351823.473260  7394182.432962 
-351880.537176  7394148.018857 
-352001.971168  7394143.659603 
-352091.789112  7394141.210023 
-352140.516089  7394138.940412 
-352299.585878  7394135.081073 
-352416.072133  7394130.981775 
-352474.719325  7394112.015024 
-352491.871485  7394100.646971 
-352515.678353  7394088.659024 
-352523.635965  7394119.763696 
-352532.426447  7394185.662409 
-352543.410426  7394286.695103 
-352545.603924  7394383.338548 
-352541.637487  7394470.333647 
-352539.196602  7394523.054616 
-352541.208683  7394567.836946 
-352532.426447  7394613.959045 
-352530.216457  7394644.703779 
-352528.031206  7394682.047382 
-352526.489161  7394816.824296 
-352533.242824  7394989.314750 
-352532.418201  7395009.071366 
-352530.892648  7395026.148441 
-352524.642005  7395050.354295 
-352501.956625  7395160.085499 
-352497.792278  7395178.542337 
-352487.913294  7395221.814925 
-352484.177752  7395241.891486 
-352475.997491  7395280.534867 
-352562.516943  7395343.414096 
-352659.946158  7395408.482951 
-352755.462247  7395473.881748 
-352845.676011  7395537.630829 
-352883.443747  7395552.628260 
-352951.788507  7395602.569705 
-353006.997021  7395627.545427 
-353118.609753  7395648.621817 
-353119.788964  7395682.825958 
-353119.640531  7395715.340389 
-353103.601613  7395774.780207 
-353081.476976  7395874.893059 
-353071.960826  7395914.566263 
-353069.577665  7395943.921235 
-353071.160941  7395971.696477 
-353104.203588  7396048.293357 
-353111.419039  7396064.790531 
-353163.980514  7396149.426034 
-353185.692839  7396185.509853 
-353215.618410  7396238.110843 
-353233.149896  7396281.443420 
-353231.088339  7396386.675395 
-353237.842001  7396353.970997 
-353338.421277  7396381.096351 
-353367.101667  7396390.294775 
-353416.026553  7396409.871422 
-353470.666078  7396430.257930 
-353522.056587  7396449.014717 
-353547.438485  7396456.913364 
-353567.410856  7396472.320725 
-353745.521191  7396570.533902 
-354058.902695  7396693.012922 
-354118.226078  7396716.718862 
-354108.891345  7396752.192785 
-354030.296520  7397007.519050 
-354012.839250  7397055.130895 
-353989.032382  7397102.742739 
-353967.608675  7397149.564719 
-353944.593445  7397196.386699 
-353922.369854  7397245.588271 
-353900.146262  7397303.518348 
-353879.522439  7397352.719920 
-353853.398381  7397407.650511 
-353825.509629  7397460.771412 
-353802.873725  7397500.124671 
-353814.476172  7397519.731313 
-353739.353011  7397594.438516 
-353673.671784  7397658.727504 
-353619.922852  7397678.844058 
-353572.045237  7397686.542740 
-353513.076442  7397673.125038 
-353501.671905  7397664.976434 
-353469.049816  7397651.108809 
-353459.261541  7397647.029508 
-353445.737722  7397636.421325 
-353406.271262  7397620.304086 
-353298.427058  7397580.860842 
-353261.253050  7397564.003729 
-353195.406899  7397545.846839 
-353135.168184  7397547.926483 
-353078.030052  7397559.034581 
-353013.750684  7397582.050638 
-352959.787350  7397609.825880 
-352879.609250  7397623.223586 
-352768.895357  7397608.996023 
-352686.284618  7397603.606946 
-352625.221280  7397596.428175 
-352576.733444  7397573.082174 
-352536.087773  7397523.120732 
-352505.073700  7397528.879746 
-352447.572734  7397559.484503 
-352475.675888  7397628.102750 
-352494.617480  7397673.584959 
-352510.582182  7397701.210227 
-352533.638643  7397733.664668 
-Region 1
-387
-333751.726857  7385884.884257 
-333622.252790  7385861.908192 
-333598.668570  7385860.378454 
-333557.973422  7385852.389823 
-333516.536113  7385842.861455 
-333483.163618  7385836.552536 
-333459.587644  7385835.032796 
-333420.838606  7385830.643548 
-333387.457865  7385824.844541 
-333334.047029  7385817.585784 
-333267.772073  7385819.205507 
-333229.361131  7385823.214820 
-333195.782479  7385826.554248 
-333156.126356  7385828.993830 
-333081.621662  7385835.772669 
-333025.266922  7385835.572703 
-332993.180839  7385840.721821 
-332952.947479  7385846.720794 
-332914.231427  7385853.499633 
-332878.879836  7385856.799067 
-332835.158321  7385859.928531 
-332793.152022  7385865.877512 
-332748.630623  7385870.756677 
-332711.530831  7385872.756334 
-332677.020356  7385872.266418 
-332633.373057  7385871.576536 
-332582.634000  7385858.038855 
-332559.940373  7385850.940071 
-332538.656852  7385848.710453 
-332525.660792  7385842.311549 
-332499.841844  7385835.932642 
-332480.743574  7385826.904188 
-332480.727081  7385826.884192 
-332431.925888  7385806.777636 
-332397.555599  7385792.620061 
-332355.104004  7385764.324907 
-332318.713388  7385742.078718 
-332294.452977  7385729.950795 
-332256.042035  7385717.822873 
-332227.740971  7385721.862181 
-332213.590440  7385725.911487 
-332200.932476  7385732.690326 
-332191.861622  7385717.252970 
-332177.727583  7385700.935765 
-332164.146041  7385682.608905 
-332137.972505  7385647.504918 
-332110.215692  7385618.609867 
-332094.663301  7385594.234043 
-332068.201147  7385572.567754 
-332045.053978  7385621.619352 
-332036.453159  7385666.581650 
-331999.510046  7385720.092484 
-331944.647873  7385754.706555 
-331959.268440  7385691.917310 
-331875.239350  7385635.317005 
-331795.292144  7385585.325568 
-331762.966920  7385558.640139 
-331778.214200  7385532.784568 
-331747.678408  7385525.655789 
-331744.511855  7385501.759882 
-331743.893388  7385443.299896 
-331745.888976  7385424.493118 
-331750.680036  7385406.686168 
-331756.510121  7385393.208476 
-331761.573307  7385382.030391 
-331765.869593  7385372.871960 
-331778.750205  7385263.280732 
-331758.992237  7385236.125383 
-331803.101324  7385161.358190 
-331709.770486  7385139.571922 
-331677.387538  7385122.604828 
-331693.220301  7385024.471638 
-331657.398675  7384938.176419 
-331594.347995  7384798.100413 
-331582.094097  7384771.934895 
-331544.103712  7384721.903465 
-331394.616043  7384702.736748 
-331327.862806  7384686.289565 
-331319.187771  7384674.861523 
-331315.105887  7384666.223002 
-331312.293922  7384658.094395 
-331311.007510  7384651.225571 
-331309.960239  7384636.988010 
-331303.058144  7384620.990750 
-331291.595883  7384608.292925 
-331279.366723  7384600.934186 
-331264.102950  7384595.865054 
-331246.546725  7384589.776097 
-331238.152063  7384588.776268 
-331226.871219  7384589.316176 
-331173.559338  7384590.615953 
-331133.119823  7384587.996402 
-331110.673583  7384591.295837 
-331079.643017  7384582.057419 
-331049.931848  7384570.169455 
-331023.527418  7384556.961718 
-331008.667710  7384541.744324 
-330981.554104  7384515.108887 
-330926.329097  7384461.768024 
-330852.599549  7384391.310092 
-330808.572923  7384437.992096 
-330766.442931  7384484.554121 
-330734.257893  7384542.284232 
-330714.483432  7384580.217734 
-330709.007934  7384634.318467 
-330708.381221  7384657.404513 
-330698.221865  7384683.809990 
-330675.157158  7384710.995333 
-330663.686651  7384736.620944 
-330647.441576  7384758.967116 
-330612.906363  7384789.441896 
-330570.256858  7384819.246791 
-330425.832374  7384829.315066 
-330392.863944  7384795.100927 
-330310.863426  7384688.119252 
-330249.181621  7384620.310867 
-330175.551028  7384554.312172 
-330143.192819  7384521.797741 
-330124.597569  7384506.320392 
-330057.093924  7384449.200176 
-330057.069186  7384440.811613 
-330059.328653  7384425.564225 
-329971.028015  7384398.708825 
-329906.138426  7384377.682427 
-329922.787566  7384308.784228 
-329743.159924  7384265.761598 
-329707.280574  7384257.922940 
-329689.732595  7384253.363721 
-329671.912491  7384245.495069 
-329654.587160  7384233.317155 
-329634.210724  7384217.579851 
-329618.930459  7384204.892024 
-329603.641947  7384188.894764 
-329591.643682  7384166.528596 
-329579.769110  7384127.995196 
-329502.007155  7384108.668506 
-329479.610392  7384100.059981 
-329588.947164  7383892.355559 
-329600.079576  7383869.589459 
-329609.422555  7383847.563231 
-329616.728715  7383825.766965 
-329621.940333  7383811.589393 
-329674.947104  7383622.991698 
-329696.197640  7383547.194682 
-329738.121477  7383405.748910 
-329755.372591  7383351.518199 
-329788.844042  7383245.586345 
-329800.759845  7383219.020895 
-329817.029658  7383189.176007 
-329834.561144  7383160.370941 
-329853.527475  7383140.214394 
-329863.794032  7383129.626208 
-329878.892880  7383116.548448 
-329970.211638  7383043.950883 
-330029.526775  7382971.303327 
-330039.562438  7382957.155750 
-330067.311004  7382921.581844 
-330076.818908  7382909.213962 
-330115.798840  7382867.131171 
-330126.832297  7382855.033243 
-330154.787019  7382823.518641 
-330169.168445  7382806.631534 
-330193.536057  7382778.896284 
-330228.961864  7382738.563193 
-330255.762113  7382709.548163 
-330291.328106  7382672.564498 
-330320.536255  7382636.980593 
-330350.569027  7382601.166728 
-330365.206086  7382583.509752 
-330378.383563  7382558.983953 
-330385.681477  7382537.697600 
-330389.499482  7382513.221792 
-330393.358718  7382503.463464 
-330394.208080  7382465.849906 
-330403.114009  7382408.749687 
-330410.750018  7382377.814986 
-330418.278827  7382360.337980 
-330428.413444  7382335.022316 
-330456.706262  7382294.869194 
-330547.266367  7382166.091252 
-330621.103116  7382060.789290 
-330644.423456  7382037.883213 
-330660.577822  7382020.486193 
-330756.563947  7381940.919822 
-330786.596719  7381993.210865 
-330789.853980  7382019.146423 
-330792.195909  7382039.752893 
-330792.946316  7382068.737928 
-330792.121693  7382104.821747 
-330840.494082  7382119.499233 
-330857.539041  7382115.339946 
-330875.078773  7382113.470266 
-330891.059968  7382115.399935 
-331085.539072  7382035.363645 
-331194.463533  7381977.583542 
-331210.015924  7381972.024494 
-331271.079262  7381908.605357 
-331320.490676  7381860.553588 
-331355.223799  7381834.088121 
-331414.349273  7381775.648132 
-331520.610201  7381731.535688 
-331553.628108  7381713.888711 
-331566.401520  7381700.031084 
-331578.861574  7381681.084330 
-331588.806528  7381664.197222 
-331599.048347  7381650.869505 
-331617.280763  7381631.142884 
-331726.823691  7381635.412153 
-331758.126382  7381622.614345 
-331825.489840  7381601.627940 
-331832.721785  7381613.245950 
-331845.528181  7381624.044100 
-331860.569306  7381629.973085 
-331871.512054  7381632.912581 
-331885.712063  7381632.502651 
-331901.371655  7381627.243552 
-331918.507322  7381618.155109 
-331957.173898  7381595.908919 
-331991.766835  7381571.353126 
-331999.996573  7381564.084371 
-332009.413769  7381558.655301 
-332038.489978  7381541.858178 
-332058.421118  7381526.740767 
-332099.033803  7381500.305295 
-332120.721390  7381489.017229 
-332140.149509  7381473.629865 
-332206.473943  7381431.357106 
-332210.992877  7381413.840106 
-332239.533081  7381367.488046 
-332297.619530  7381276.573619 
-332347.847321  7381181.229950 
-332434.803823  7381255.517225 
-332464.589208  7381221.922980 
-332486.647875  7381192.158078 
-332499.511995  7381163.253029 
-332503.338246  7381161.753286 
-332514.033607  7381160.553492 
-332521.413983  7381159.333701 
-332533.857545  7381159.933598 
-332555.437931  7381164.662788 
-332603.307300  7381192.468025 
-332613.441917  7381197.117229 
-332620.797555  7381200.476653 
-332627.897560  7381202.046384 
-332635.022303  7381202.096376 
-332645.486770  7381199.696787 
-332656.289332  7381197.897095 
-332739.196935  7381174.591087 
-332779.463279  7381161.903261 
-332789.639128  7381160.703466 
-332832.717437  7381149.775338 
-332870.996439  7381139.787049 
-332898.679036  7381129.918739 
-332921.587064  7381125.249539 
-332950.110776  7381118.580681 
-332999.060401  7381099.593934 
-333042.419082  7381080.557194 
-333139.567925  7381040.284093 
-333139.576171  7381040.254098 
-333153.866889  7381030.965689 
-333193.976555  7381002.760520 
-333214.913735  7380990.692587 
-333231.241271  7380982.164048 
-333260.309234  7380970.146107 
-333265.529098  7380955.848556 
-333271.350937  7380941.700979 
-333279.679630  7380926.713547 
-333289.674062  7380910.906254 
-333305.102759  7380890.079822 
-333321.290110  7380869.283384 
-333342.012888  7380846.577273 
-333355.569691  7380835.229217 
-333371.229283  7380826.010796 
-333392.042769  7380815.182651 
-333413.318044  7380803.004737 
-333425.819330  7380787.127456 
-333465.021910  7380815.932522 
-333474.637015  7380823.851166 
-333495.252592  7380842.647946 
-333516.107309  7380853.176143 
-333527.206735  7380863.384394 
-333535.840539  7380876.442158 
-333541.579915  7380891.679548 
-333543.270393  7380904.437362 
-333542.148905  7380913.395828 
-333538.570041  7380922.774221 
-333535.708599  7380932.152615 
-333534.611851  7380939.231402 
-333537.902097  7380945.690296 
-333542.940544  7380951.059376 
-333553.091653  7380955.388635 
-333575.158567  7380961.177643 
-333597.307942  7380960.327789 
-333631.150473  7380953.398976 
-333637.269176  7380953.468964 
-333644.088809  7380955.318647 
-333653.976039  7380963.737205 
-333665.042481  7380978.374697 
-333674.583370  7380991.662421 
-333690.209977  7381015.128402 
-333682.705907  7381033.385275 
-333674.748294  7381044.793321 
-333663.211817  7381059.210851 
-333641.689155  7381083.216739 
-333627.596347  7381097.624271 
-333611.928509  7381120.920281 
-333546.387468  7381261.136263 
-333522.036349  7381326.845008 
-333502.072224  7381383.185357 
-333496.118446  7381398.412749 
-333489.406014  7381413.370187 
-333458.457911  7381439.355736 
-333429.422932  7381447.294376 
-333397.947070  7381439.945634 
-333365.160057  7381438.185936 
-333306.958161  7381434.986484 
-333504.744003  7381735.794958 
-333679.893942  7381850.975229 
-333718.593503  7381890.078531 
-333657.414717  7381971.174640 
-333727.936482  7382041.472598 
-333699.206614  7382091.204080 
-333670.732380  7382150.333951 
-333673.742254  7382172.180209 
-333642.373593  7382217.122511 
-333567.530803  7382312.716137 
-333536.500237  7382349.849776 
-333505.181053  7382494.724960 
-333442.583917  7382494.724960 
-333450.162202  7382459.840936 
-333417.911194  7382495.554818 
-333415.470310  7382573.531462 
-333406.490165  7382644.369328 
-333376.440901  7382903.784892 
-333359.684560  7383039.821590 
-333538.231946  7383056.078806 
-333543.451810  7383270.122142 
-333720.951924  7383270.122142 
-333835.805425  7383567.701169 
-334164.698088  7383499.832794 
-334289.991316  7383703.437919 
-334444.336016  7383748.180255 
-334346.313072  7383835.115364 
-334311.984014  7383892.985451 
-334271.049725  7383966.832802 
-334229.562938  7384019.943704 
-334207.091960  7384050.698436 
-334187.457685  7384079.243547 
-334174.074052  7384100.549897 
-334166.668937  7384114.607489 
-334163.090073  7384128.245153 
-334162.793209  7384142.732672 
-334159.082405  7384159.969719 
-334156.872415  7384171.047821 
-334119.063448  7384268.301163 
-334100.121856  7384312.613572 
-334096.023479  7384326.741153 
-334094.530911  7384337.379330 
-334091.554022  7384370.853596 
-334089.789329  7384406.637467 
-334087.183520  7384422.334778 
-334080.570043  7384447.590452 
-334052.640060  7384508.979937 
-334026.573725  7384566.590069 
-334024.347242  7384575.688510 
-334023.341202  7384587.856426 
-334022.632026  7384609.702684 
-334020.603454  7384634.298471 
-334018.937715  7384677.451079 
-334018.228539  7384723.923119 
-334021.329122  7384770.225188 
-334029.558860  7384875.067229 
-334032.642950  7384898.003301 
-334037.277332  7384918.939714 
-334042.769322  7384935.816823 
-334051.798944  7384965.491740 
-333980.939084  7384979.709305 
-333826.149089  7385014.233391 
-333763.617922  7385030.410620 
-333730.385612  7385050.647154 
-333734.665406  7385106.297622 
-333741.798396  7385371.712158 
-333744.651591  7385434.501403 
-333734.376788  7385523.246202 
-333734.929285  7385645.395279 
-333752.889576  7385791.950176 
-333751.726857  7385884.884257 
-Region 1
-871
-337213.882056  7403806.924374 
-337193.118047  7403823.161592 
-337146.798969  7403860.325226 
-337131.436242  7403869.833598 
-337122.686991  7403878.582099 
-337113.566660  7403886.580729 
-337061.120633  7403917.935358 
-337102.533203  7403993.292450 
-337123.940418  7404027.326621 
-337130.760051  7404023.077349 
-337143.269583  7404017.648278 
-337164.973662  7404012.229207 
-337184.080178  7404008.919774 
-337208.612714  7404007.270056 
-337230.085899  7404008.689813 
-337250.371626  7404015.758602 
-337264.522158  7404025.436944 
-337277.262584  7404039.584521 
-337289.772116  7404056.571611 
-337320.670743  7404094.085186 
-337357.242775  7404132.768559 
-337381.536171  7404158.244196 
-337402.061039  7404180.660356 
-337417.638169  7404197.637448 
-337484.399652  7404259.676821 
-337491.474918  7404263.926093 
-337497.140078  7404268.175365 
-337522.851826  7404281.153142 
-337529.457056  7404283.502740 
-337534.883076  7404285.162456 
-337539.369026  7404285.392416 
-337551.631170  7404282.802860 
-337564.140702  7404279.973345 
-337570.506792  7404277.613749 
-337587.254887  7404269.585124 
-337605.660474  7404257.557184 
-337620.281041  7404248.598719 
-337641.284190  7404240.100174 
-337660.629847  7404233.021387 
-337673.131133  7404229.481993 
-337698.133704  7404224.062921 
-337710.164955  7404222.413204 
-337733.996561  7404221.463367 
-337758.999133  7404224.772800 
-337777.404719  7404230.191872 
-337785.659196  7404235.151022 
-337792.734462  7404242.699729 
-337799.817974  7404251.898154 
-337805.243994  7404263.216215 
-337812.080119  7404276.433951 
-337823.171299  7404294.590841 
-337839.210218  7404321.726193 
-337855.727418  7404347.911707 
-337870.826266  7404372.677465 
-337884.976798  7404396.743343 
-337902.912350  7404428.347929 
-337939.946172  7404488.267666 
-337965.897060  7404529.310635 
-337974.390677  7404544.408049 
-337988.310314  7404566.584251 
-337999.632389  7404589.470331 
-338010.014393  7404607.397260 
-338030.539262  7404642.311279 
-338044.458899  7404666.367159 
-338054.370868  7404682.644371 
-338066.633013  7404703.400815 
-338070.830344  7404712.589241 
-338076.305842  7404723.927299 
-338084.799459  7404742.804066 
-338090.695514  7404757.661521 
-338102.017589  7404777.238168 
-338130.096004  7404814.041863 
-338136.519818  7404828.789337 
-338143.710531  7404841.017243 
-338149.326214  7404848.355986 
-338158.207404  7404854.934859 
-338168.729595  7404859.904008 
-338182.542031  7404862.483566 
-338215.840310  7404869.322394 
-338242.591083  7404879.330680 
-338281.447321  7404898.377418 
-338308.948501  7404914.054732 
-338334.000549  7404930.521911 
-338354.162583  7404947.738962 
-338366.259804  7404957.587275 
-338401.842289  7404979.013605 
-338409.098972  7404985.572482 
-338416.899906  7404993.711088 
-338410.039042  7404995.270821 
-338396.911043  7404999.980014 
-338388.879214  7405002.129646 
-338357.527045  7405008.988471 
-338334.800434  7405012.717832 
-338309.327827  7405019.966590 
-338268.764619  7405027.605282 
-338243.292012  7405033.684241 
-338226.634626  7405037.603569 
-338197.245060  7405043.472564 
-338180.785584  7405046.612026 
-338161.192540  7405047.791824 
-338147.528536  7405050.341387 
-338139.447230  7405051.711153 
-338110.445237  7405054.650649 
-338085.170540  7405058.170046 
-338067.342189  7405059.939743 
-338047.938808  7405064.049039 
-338032.073060  7405067.968368 
-338000.325072  7405079.536387 
-337984.261415  7405086.385213 
-337977.887079  7405091.164395 
-337970.399501  7405103.442292 
-337966.688698  7405117.529879 
-337968.865703  7405126.638318 
-337973.038295  7405138.806234 
-337975.487426  7405146.144977 
-337981.218556  7405154.793496 
-337985.720998  7405160.402535 
-337994.544465  7405164.541826 
-338001.900103  7405164.371855 
-338013.057253  7405164.751790 
-338024.643207  7405171.190687 
-338031.207206  7405173.540285 
-338049.596301  7405184.098476 
-338064.233360  7405190.067454 
-338077.872625  7405194.516692 
-338087.768102  7405193.616846 
-338093.367293  7405191.917137 
-338108.103307  7405189.057627 
-338121.775557  7405190.727341 
-338128.834331  7405194.346721 
-338134.821094  7405202.995239 
-338141.764421  7405216.442936 
-338151.429003  7405236.499500 
-338166.371173  7405259.885494 
-338177.025303  7405281.711756 
-338190.219272  7405303.058099 
-338197.673864  7405312.686450 
-338205.713939  7405322.414784 
-338218.000823  7405334.922641 
-338231.499902  7405351.479805 
-338243.984696  7405368.526885 
-338258.432092  7405390.903052 
-338270.149985  7405408.200090 
-338273.720603  7405409.839809 
-338283.607834  7405428.546604 
-338309.814355  7405465.440285 
-338326.174876  7405475.718524 
-338341.051077  7405482.957284 
-338356.677684  7405490.955914 
-338366.284542  7405493.595462 
-338375.355396  7405498.494623 
-338389.629621  7405514.051958 
-338402.312324  7405535.898216 
-338406.996183  7405547.306262 
-338413.733353  7405556.974606 
-338426.003745  7405570.492290 
-338442.017925  7405588.589190 
-338470.822008  7405619.453904 
-338474.293671  7405626.312729 
-338479.035254  7405632.921597 
-338484.741646  7405643.839727 
-338501.794851  7405660.186926 
-338510.362684  7405665.336044 
-338522.954678  7405672.794767 
-338536.857823  7405675.984221 
-338559.337048  7405683.812880 
-338570.180841  7405688.732037 
-338577.214876  7405694.621028 
-338592.016860  7405708.158709 
-338597.665528  7405724.375931 
-338602.860653  7405735.793976 
-338610.785281  7405751.781237 
-338616.706075  7405766.238761 
-338627.426174  7405782.256017 
-338635.672405  7405792.704227 
-338647.208882  7405804.192260 
-338651.472183  7405808.271561 
-338657.970213  7405816.170208 
-338658.852559  7405828.048173 
-338657.953720  7405839.646187 
-338658.102152  7405849.484501 
-338660.534791  7405858.093027 
-338666.801926  7405864.731890 
-338674.190548  7405883.238720 
-338679.105302  7405897.166334 
-338679.954664  7405911.313911 
-338682.486256  7405934.050016 
-338678.156985  7405958.225875 
-338715.652596  7405981.371910 
-338762.804543  7405998.838918 
-338809.964736  7406026.784132 
-338869.337597  7406045.990842 
-338970.634294  7406070.436654 
-339036.999958  7406045.990842 
-339094.740065  7405998.958898 
-339101.757608  7405997.679117 
-339110.696522  7405997.679117 
-339124.096646  7406000.868571 
-339147.078891  7406032.783104 
-339155.894112  7406071.906403 
-339160.949051  7406100.221553 
-339171.900045  7406147.763409 
-339177.441512  7406177.338343 
-339184.013758  7406205.663491 
-339188.054411  7406233.208773 
-339188.895527  7406251.635617 
-339191.385888  7406281.940426 
-339197.059295  7406298.147650 
-339200.027938  7406306.246262 
-339209.981139  7406325.273003 
-339220.610530  7406354.388016 
-339230.712162  7406384.262899 
-339236.517509  7406413.587876 
-339237.655489  7406426.725625 
-339240.434468  7406453.501039 
-339240.244805  7406473.177668 
-339241.564202  7406494.384036 
-339246.718096  7406511.591089 
-339251.929714  7406523.759004 
-339270.500225  7406543.875559 
-339282.069687  7406553.833853 
-339299.914530  7406570.411013 
-339329.576222  7406596.946468 
-339357.745345  7406647.437819 
-339369.174621  7406672.023608 
-339386.904017  7406699.958823 
-339397.879750  7406718.985564 
-339413.786729  7406752.699789 
-339422.164899  7406777.265581 
-339432.464441  7406813.949297 
-339435.573270  7406833.405965 
-339476.524052  7406873.179152 
-339478.931951  7406885.567030 
-339487.499785  7406891.206064 
-339503.645904  7406900.194524 
-339512.197245  7406910.302793 
-339519.693069  7406919.281255 
-339527.889822  7406936.518302 
-339541.405394  7406955.325081 
-339562.804363  7406971.432322 
-339579.181377  7406982.190479 
-339598.848637  7406993.998457 
-339618.985932  7407010.085701 
-339635.329962  7407023.873339 
-339650.676197  7407037.151065 
-339660.983985  7407046.079536 
-339671.225804  7407062.086794 
-339678.672150  7407079.313843 
-339699.889701  7407087.852380 
-339714.007248  7407096.570887 
-339733.402383  7407109.888606 
-339748.468246  7407125.425944 
-339763.303215  7407138.443714 
-339776.975465  7407141.103259 
-339789.410781  7407140.463368 
-339805.911489  7407138.103773 
-339820.127990  7407136.734007 
-339847.348798  7407144.512675 
-339844.495602  7407178.736813 
-339831.565512  7407299.006212 
-339816.540880  7407379.502423 
-339785.889641  7407525.957337 
-339751.824462  7407634.948668 
-339717.767529  7407742.240290 
-339683.702350  7407825.685996 
-339646.239725  7407912.531120 
-339600.258743  7408019.822742 
-339554.277760  7408104.978156 
-339562.672423  7408107.887657 
-339579.758613  7408108.677522 
-339610.236682  7408099.919022 
-339739.290191  7408048.657803 
-339783.506480  7408042.338885 
-339830.914060  7408023.382133 
-339864.072153  7407998.106462 
-339880.523384  7408001.065955 
-339911.042683  7407934.997272 
-339904.305513  7407922.409428 
-339895.086227  7407910.001554 
-339879.476112  7407886.945503 
-339855.891893  7407853.081303 
-339843.481315  7407833.394676 
-339836.505004  7407824.506198 
-339819.006503  7407802.190021 
-339813.514513  7407793.321540 
-339806.422755  7407776.834364 
-339798.976409  7407760.337190 
-339789.039701  7407745.089801 
-339778.938068  7407734.101684 
-339775.392189  7407728.952566 
-339772.901827  7407722.753627 
-339772.901827  7407719.554175 
-339774.501596  7407706.256453 
-339776.101365  7407700.047517 
-339779.111239  7407695.618275 
-339783.547711  7407692.248853 
-339789.748877  7407690.479156 
-339815.106036  7407686.929764 
-339851.282250  7407682.140584 
-339862.629063  7407679.301070 
-339871.856595  7407675.931648 
-339875.575645  7407670.262619 
-339878.412349  7407658.384653 
-339880.012117  7407647.206568 
-339881.958228  7407634.438755 
-339886.567871  7407623.090699 
-339890.822926  7407616.001913 
-339897.386925  7407608.913127 
-339920.797974  7407588.696590 
-339926.999139  7407582.137714 
-339930.726436  7407575.568839 
-339939.055129  7407558.551754 
-339945.800545  7407546.133881 
-339953.246892  7407534.255915 
-339965.838886  7407517.588770 
-339973.458403  7407509.430168 
-339978.604051  7407503.401201 
-339992.078392  7407475.036059 
-339996.333447  7407463.857974 
-340000.415331  7407455.349431 
-340005.198145  7407449.500433 
-340011.234386  7407444.891223 
-340023.290375  7407439.212196 
-340030.027545  7407434.423016 
-340034.101183  7407429.633836 
-340036.591545  7407422.365081 
-340038.364484  7407410.487116 
-340042.792710  7407393.460032 
-340046.338589  7407384.951490 
-340050.775061  7407379.452432 
-340058.039991  7407376.792887 
-340065.139995  7407376.262978 
-340073.823276  7407377.152826 
-340086.951275  7407379.282461 
-340099.716440  7407381.762036 
-340105.389847  7407383.891671 
-340108.407967  7407389.030791 
-340111.244671  7407394.879789 
-340113.190781  7407400.028907 
-340116.736660  7407403.218361 
-340120.282540  7407403.928239 
-340133.410539  7407404.278179 
-340151.313106  7407402.508483 
-340162.841336  7407400.028907 
-340168.514743  7407396.659484 
-340172.415210  7407392.220245 
-340174.188149  7407385.311428 
-340174.724154  7407379.282461 
-340172.951215  7407366.864588 
-340169.759924  7407356.586349 
-340164.086517  7407343.988506 
-340157.703934  7407325.731634 
-340145.285111  7407288.138073 
-340138.547941  7407259.233024 
-340135.356649  7407232.637580 
-340135.356649  7407222.349342 
-340135.538066  7407201.782865 
-340134.474303  7407192.734415 
-340130.037830  7407170.928150 
-340128.438062  7407153.731096 
-340126.846539  7407133.694528 
-340126.310534  7407112.768112 
-340125.782775  7407100.000299 
-340123.828419  7407091.841697 
-340118.864188  7407084.213004 
-340108.762555  7407076.064399 
-340099.889611  7407068.255737 
-340095.815973  7407060.986982 
-340094.216205  7407055.487924 
-340094.397622  7407046.799412 
-340095.279968  7407040.600474 
-340097.762084  7407032.441872 
-340103.616907  7407022.153634 
-340111.772430  7407010.275668 
-340117.272665  7407002.117066 
-340125.428188  7406987.399587 
-340127.910303  7406979.600923 
-340127.728886  7406971.262351 
-340125.782775  7406959.204417 
-340122.410067  7406946.436604 
-340113.190781  7406921.970794 
-340109.999490  7406907.603255 
-340107.871962  7406897.145047 
-340107.698792  7406890.046263 
-340108.935726  7406881.187780 
-340110.180907  7406871.959361 
-340117.800424  7406844.124129 
-340118.864188  7406838.275131 
-340118.864188  7406830.116528 
-340117.800424  7406818.948441 
-340116.563490  7406799.621752 
-340114.790550  7406763.797888 
-340113.545369  7406755.109376 
-340109.644902  7406747.840621 
-340103.790078  7406740.041957 
-340091.560918  7406725.674418 
-340076.305392  7406708.297395 
-340068.859045  7406702.268427 
-340059.994347  7406694.819703 
-340049.711298  7406685.951222 
-340040.846600  7406682.051890 
-340029.672957  7406680.102224 
-340013.007325  7406677.802618 
-339998.996979  7406675.313045 
-339988.887100  7406670.353894 
-339979.667815  7406663.435079 
-339975.058172  7406656.696233 
-339973.103815  7406651.197175 
-339969.557936  7406637.549513 
-339968.675589  7406625.661549 
-339969.557936  7406612.193856 
-339968.675589  7406598.186256 
-339965.838886  7406591.087472 
-339960.693238  7406585.588414 
-339954.838414  7406581.339141 
-339947.392068  7406575.480145 
-339943.673018  7406569.281207 
-339939.591134  7406560.592695 
-339938.527370  7406554.913668 
-339939.945722  7406544.455459 
-339941.718661  7406534.877100 
-339954.129238  7406489.834815 
-339970.267112  7406430.255021 
-339974.167579  7406421.566509 
-339978.604051  7406415.007632 
-339985.159804  7406410.218453 
-339992.968985  7406408.268787 
-340010.879798  7406404.369455 
-340019.035320  7406401.889879 
-340023.644963  7406396.920731 
-340026.127078  7406391.421673 
-340026.481666  7406383.443039 
-340025.591073  7406375.284437 
-340022.935787  7406362.526622 
-340017.616968  7406349.578840 
-340012.652737  7406342.839994 
-340006.616496  7406338.230784 
-339991.905221  7406332.201816 
-339975.231343  7406323.863245 
-339968.139584  7406315.884611 
-339963.711358  7406306.666190 
-339963.884529  7406296.557922 
-339966.193474  7406286.629622 
-339970.093941  7406278.830958 
-339975.058172  7406275.101597 
-339981.086166  7406271.912143 
-339990.305452  7406270.312417 
-340005.734150  7406269.072630 
-340011.762144  7406267.652873 
-340018.680732  7406264.643389 
-340022.045194  7406260.914027 
-340023.290375  7406256.484786 
-340022.754370  7406251.875576 
-340020.626842  7406246.376517 
-340013.889672  7406238.397884 
-340001.833683  7406228.819525 
-339994.032748  7406218.891225 
-339986.932744  7406204.353716 
-339981.613925  7406193.355599 
-339976.831111  7406185.906875 
-339964.593705  7406176.158545 
-339950.055600  7406165.870307 
-339936.399842  7406155.232130 
-339924.162436  7406138.564985 
-339919.198205  7406130.946290 
-339907.496804  7406109.489965 
-339894.022463  7406083.774370 
-339868.657058  7406043.701234 
-339859.083184  7406031.463330 
-339847.917788  7406012.666550 
-339824.861327  7405972.413445 
-339816.524388  7405960.535479 
-339811.205569  7405947.587697 
-339806.595926  7405928.800915 
-339802.522288  7405908.934318 
-339798.267233  7405884.998418 
-339795.603700  7405865.671729 
-339792.230992  7405842.445707 
-339787.266761  7405825.948533 
-339781.593354  7405812.650811 
-339775.746777  7405803.072451 
-339767.409838  7405793.324121 
-339758.899728  7405781.616127 
-339755.708436  7405773.637493 
-339753.226321  7405764.239103 
-339749.499025  7405751.471290 
-339745.243970  7405741.193051 
-339738.679970  7405732.144601 
-339732.478805  7405725.585724 
-339728.578338  7405718.496938 
-339728.042333  7405711.758093 
-339728.932926  7405705.369187 
-339731.769629  7405698.810311 
-339736.552443  7405693.491222 
-339752.335728  7405684.622741 
-339767.055250  7405676.294167 
-339773.083244  7405672.744775 
-339787.448178  7405660.506872 
-339801.277107  7405649.158815 
-339807.486519  7405643.309817 
-339815.460624  7405633.381518 
-339817.942739  7405628.592338 
-339817.942739  7405624.693006 
-339816.878975  7405617.774191 
-339812.096162  7405608.735740 
-339807.131931  7405601.636956 
-339801.458524  7405595.787957 
-339791.703233  7405587.809324 
-339778.756651  7405574.151664 
-339768.193230  7405563.533482 
-339764.746305  7405561.213880 
-339758.718311  7405551.275582 
-339753.399492  7405539.047677 
-339749.672196  7405529.649286 
-339745.953146  7405513.512051 
-339742.935025  7405503.223813 
-339739.570563  7405497.024875 
-339722.896685  7405476.098459 
-339710.667525  7405463.330646 
-339704.103525  7405458.361497 
-339699.988656  7405456.231862 
-339697.366355  7405455.172044 
-339674.136723  7405450.202895 
-339660.307794  7405445.773654 
-339643.279328  7405437.974989 
-339631.396509  7405431.236144 
-339625.013927  7405425.557116 
-339618.812762  7405415.808786 
-339615.085465  7405405.520548 
-339613.667114  7405399.311612 
-339614.376289  7405393.292643 
-339615.794641  7405383.714284 
-339622.886399  7405353.569447 
-339624.659339  7405344.171057 
-339625.549932  7405331.403244 
-339625.549932  7405321.474945 
-339626.613696  7405313.496311 
-339630.332746  7405300.368560 
-339632.105685  7405289.020504 
-339632.823107  7405279.272174 
-339631.932514  7405263.844816 
-339632.287102  7405245.937884 
-339633.886871  7405236.359524 
-339636.542157  7405224.831499 
-339639.560278  7405215.613078 
-339642.751569  7405204.794931 
-339646.825207  7405179.439274 
-339645.761443  7405174.650095 
-339643.106157  7405166.491492 
-339636.896745  7405155.503374 
-339631.751097  7405142.555592 
-339628.559806  7405131.557476 
-339625.195344  7405116.140117 
-339615.794641  7405092.734126 
-339605.866179  7405076.056983 
-339595.228542  7405063.999048 
-339584.228070  7405055.490505 
-339578.554664  7405049.821477 
-339575.717960  7405045.212266 
-339576.253965  7405038.113482 
-339578.381493  7405033.854212 
-339581.036779  7405029.784909 
-339593.455602  7405022.506155 
-339599.656768  7405015.767310 
-339603.384064  7405009.738342 
-339607.812290  7404999.810043 
-339615.085465  7404978.713657 
-339623.422404  7404954.947728 
-339627.141454  7404940.060278 
-339627.496042  7404931.541737 
-339626.259108  7404921.973376 
-339622.358641  7404909.025594 
-339615.440053  7404890.938692 
-339613.667114  7404877.640969 
-339613.312526  7404860.443915 
-339611.184998  7404848.735921 
-339607.812290  7404832.248745 
-339609.040978  7404820.470762 
-339611.399400  7404813.391975 
-339618.004631  7404802.543833 
-339618.936455  7404800.454191 
-339624.139827  7404788.386258 
-339629.796741  7404779.887714 
-339646.313941  7404758.661350 
-339663.771211  7404736.015229 
-339687.833712  7404707.700079 
-339705.290982  7404685.053958 
-339714.254635  7404669.006707 
-339733.130257  7404640.231636 
-339748.699140  7404611.916486 
-339755.535266  7404599.208662 
-339756.252688  7404589.740284 
-339762.379637  7404568.503922 
-339766.362566  7404552.236708 
-339770.873255  7404519.432327 
-339776.068380  7404501.505398 
-339792.577334  7404432.617198 
-339801.070951  7404394.393745 
-339807.206147  7404371.277705 
-339814.281413  7404357.590050 
-339820.886644  7404350.041343 
-339835.985492  7404337.773444 
-339843.539039  7404329.754817 
-339851.084340  7404312.767727 
-339858.167852  7404289.651687 
-339864.773083  7404265.585809 
-339874.206771  7404227.842274 
-339878.923615  7404208.025669 
-339885.528846  7404198.117366 
-339892.134076  7404189.618821 
-339904.404468  7404181.130275 
-339939.319008  7404163.193348 
-339957.716349  7404152.345206 
-339986.503940  7404136.777873 
-339995.937628  7404130.638924 
-340004.431245  7404123.090217 
-340013.394898  7404113.181914 
-340018.111742  7404101.853855 
-340022.358551  7404087.226360 
-340028.963781  7404065.050159 
-340033.688872  7404033.915492 
-340036.987364  7404012.209210 
-340042.174243  7403997.111796 
-340052.086212  7403981.534464 
-340067.185060  7403963.607535 
-340082.283909  7403948.510121 
-340090.777526  7403931.992950 
-340097.382757  7403917.365456 
-340099.271144  7403906.517314 
-340097.382757  7403892.829659 
-340088.419104  7403874.432810 
-340082.753944  7403852.726528 
-340073.790291  7403831.970083 
-340070.483553  7403816.392752 
-340070.483553  7403805.544610 
-340072.371940  7403793.746631 
-340078.037100  7403781.008813 
-340087.949069  7403760.722288 
-340103.987988  7403739.016006 
-340113.891711  7403723.918592 
-340121.915293  7403718.719482 
-340135.125755  7403713.060452 
-340154.471412  7403706.451584 
-340171.928682  7403699.852714 
-340187.027530  7403691.354170 
-340195.991183  7403685.225220 
-340203.074695  7403678.616352 
-340215.336840  7403666.818372 
-340239.877623  7403647.471686 
-340259.693315  7403636.153625 
-340271.015390  7403628.604918 
-340281.867429  7403619.166535 
-340289.891012  7403607.368556 
-340297.906348  7403593.690899 
-340307.348282  7403581.423000 
-340315.841899  7403566.795505 
-340346.509631  7403528.572053 
-340358.301741  7403514.414478 
-340372.930554  7403494.127953 
-340381.894207  7403474.311347 
-340390.857860  7403459.213933 
-340398.411407  7403446.946035 
-340409.914899  7403432.108576 
-340424.337556  7403417.091148 
-340443.262655  7403394.864956 
-340465.486247  7403358.211234 
-340485.013321  7403317.058283 
-340497.630054  7403282.214252 
-340514.749229  7403228.743411 
-340521.659570  7403212.526189 
-340548.995825  7403173.172929 
-340570.625688  7403144.337869 
-340581.436496  7403128.120646 
-340589.641496  7403112.993238 
-340604.567173  7403085.457954 
-340633.709352  7403030.487370 
-340648.123763  7403003.152052 
-340653.228180  7402984.525243 
-340656.238054  7402968.607970 
-340655.330969  7402962.299050 
-340653.533291  7402955.690182 
-340643.918186  7402947.581571 
-340625.298197  7402933.164041 
-340620.490644  7402929.854608 
-340617.489016  7402926.255224 
-340613.580303  7402916.336923 
-340611.477514  7402900.119701 
-340611.477514  7402886.302068 
-340612.978328  7402870.684743 
-340615.798539  7402854.617495 
-340620.787509  7402830.131689 
-340624.391112  7402813.304572 
-340627.095875  7402792.278173 
-340631.301453  7402767.352443 
-340632.208538  7402733.708206 
-340631.301453  7402708.772477 
-340627.095875  7402686.846233 
-340617.785881  7402652.902047 
-340608.170776  7402625.566729 
-340599.759621  7402595.221927 
-340585.345209  7402563.087432 
-340580.834521  7402548.659903 
-340580.834521  7402533.042578 
-340582.038471  7402522.834327 
-340584.141260  7402512.316128 
-340597.961942  7402477.472097 
-340610.578675  7402449.236933 
-340615.081117  7402438.118838 
-340617.183906  7402428.810432 
-340618.684720  7402414.992799 
-340618.684720  7402389.157224 
-340617.785881  7402359.722266 
-340613.283439  7402326.377978 
-340609.077861  7402299.342609 
-340601.565545  7402278.616159 
-340591.348465  7402261.789041 
-340578.731732  7402242.562335 
-340573.627316  7402229.344599 
-340570.625688  7402214.927068 
-340569.726849  7402202.319228 
-340572.423366  7402187.891699 
-340576.934054  7402169.874785 
-340580.537657  7402153.947514 
-340580.834521  7402141.939570 
-340580.537657  7402127.212093 
-340577.536029  7402110.694922 
-340567.318949  7402068.942074 
-340561.612558  7402044.306294 
-340558.008955  7402025.689483 
-340556.805005  7402009.162314 
-340558.305819  7401993.544989 
-340563.113372  7401975.518077 
-340573.932426  7401954.191730 
-340587.447998  7401927.156361 
-340594.053229  7401910.039293 
-340599.165892  7401893.512124 
-340600.666706  7401878.494696 
-340601.507821  7401841.551024 
-340601.862409  7401803.397560 
-340599.759621  7401741.218210 
-340600.963570  7401707.274025 
-340602.769495  7401679.038861 
-340583.539285  7401682.738227 
-340488.089165  7401747.507133 
-340416.808747  7401793.609236 
-340316.600553  7401865.966842 
-340262.076476  7401908.179611 
-340230.707814  7401962.430319 
-340196.947746  7402027.809120 
-340168.943547  7402079.690233 
-340137.756302  7402141.949569 
-340110.123183  7402193.430750 
-340085.458708  7402242.172401 
-340067.284015  7402276.226568 
-340029.079229  7402346.694498 
-339935.212385  7402517.325270 
-339928.269059  7402528.333385 
-339914.093789  7402563.397378 
-339872.318384  7402636.234902 
-339814.504061  7402751.015241 
-339750.249432  7402870.034854 
-339698.034299  7402967.818105 
-339677.336260  7403003.162051 
-339671.596884  7403017.569583 
-339638.653192  7403075.629638 
-339622.523565  7403109.943760 
-339603.722159  7403142.748141 
-339592.837135  7403166.014156 
-339575.066508  7403198.608573 
-339571.809247  7403207.327079 
-339551.086469  7403241.141287 
-339528.730938  7403287.493347 
-339501.501884  7403339.634416 
-339490.534398  7403326.176721 
-339484.044614  7403316.518376 
-339475.295363  7403304.070508 
-339467.288273  7403293.142380 
-339454.193259  7403283.923959 
-339430.592547  7403282.934128 
-339379.103083  7403279.384736 
-339347.891100  7403278.574875 
-339329.394805  7403275.105469 
-339317.775866  7403269.696396 
-339309.768776  7403259.268182 
-339304.466449  7403250.679653 
-339294.537988  7403236.152142 
-339269.543662  7403223.534303 
-339257.166070  7403218.365188 
-339235.346544  7403216.885442 
-339211.770571  7403214.375872 
-339189.967537  7403211.886298 
-339165.336046  7403212.656166 
-339137.645203  7403214.395868 
-339116.040079  7403216.955430 
-339097.197442  7403222.314512 
-339072.994755  7403217.515334 
-339054.638646  7403213.815968 
-339035.210526  7403203.027816 
-339022.618532  7403194.569264 
-339011.576829  7403182.851272 
-339004.493317  7403180.261715 
-338993.550569  7403182.921260 
-338977.025123  7403185.530813 
-338959.543114  7403182.081403 
-338949.177602  7403177.942113 
-338931.547161  7403165.394262 
-338912.869448  7403155.625935 
-338895.725535  7403145.107737 
-338888.732731  7403145.747627 
-338869.312858  7403146.607480 
-338845.934794  7403148.137218 
-338834.051976  7403144.237886 
-338807.697023  7403139.938622 
-338766.086543  7403137.998954 
-338739.014168  7403130.160297 
-338725.407887  7403120.441962 
-338714.357938  7403109.733796 
-338694.649447  7403101.205257 
-338653.632695  7403072.300208 
-338631.153471  7403058.432583 
-338613.424075  7403032.267065 
-338605.639633  7403024.108463 
-338572.531017  7402987.954656 
-338553.358531  7402976.906548 
-338528.141557  7402961.519184 
-338509.043287  7402944.422112 
-338494.266042  7402926.355207 
-338483.570681  7402906.058684 
-338469.642797  7402880.443071 
-338460.159632  7402865.575618 
-338450.684713  7402849.968291 
-338431.165885  7402824.292689 
-338411.333700  7402804.156139 
-338393.967139  7402790.868415 
-338389.852270  7402785.999249 
-338377.936466  7402771.271771 
-338371.644592  7402766.412604 
-338363.365377  7402757.254173 
-338358.706256  7402742.816646 
-338356.141679  7402722.100194 
-338350.996031  7402705.143099 
-338338.189635  7402692.405281 
-338310.688455  7402677.237879 
-338304.421320  7402672.208740 
-338222.758898  7402744.796306 
-338163.740625  7402794.227839 
-338168.383253  7402805.975827 
-338180.562936  7402861.376337 
-338193.633211  7402916.906825 
-338191.068634  7402980.745890 
-338173.743303  7403053.073501 
-338172.390921  7403057.542736 
-338160.763736  7403082.698427 
-338150.620872  7403101.005291 
-338135.051989  7403129.120475 
-338038.290718  7403234.742383 
-337909.657766  7403366.019896 
-337799.669542  7403482.999859 
-337771.657097  7403509.505319 
-337706.660307  7403575.983932 
-337664.563299  7403561.206463 
-337649.200572  7403615.967083 
-337630.580583  7403667.568244 
-337601.042585  7403775.399773 
-337475.980251  7403715.200085 
-337433.718318  7403712.450556 
-337360.582499  7403736.176492 
-337299.700578  7403755.933108 
-337271.696379  7403768.960876 
-337264.241786  7403772.430282 
-337213.882056  7403806.924374 
-Region 1
-354
-323728.713878  7398532.747792 
-323748.999605  7398458.030591 
-323509.298173  7398295.668402 
-323369.285423  7398217.451800 
-323213.489387  7398119.318609 
-323021.822248  7398089.763671 
-322810.331171  7398086.984148 
-322637.292267  7398096.632495 
-322401.062497  7398103.231365 
-322107.109114  7398101.221709 
-321962.148625  7398073.036537 
-321839.329266  7397988.471022 
-321728.590634  7397885.788610 
-321664.162834  7397793.174474 
-321647.785820  7397771.298222 
-321429.648281  7397747.092368 
-321325.490142  7397735.444363 
-321300.165967  7397733.434707 
-321275.559215  7397736.734142 
-321249.674297  7397741.273365 
-321228.110404  7397744.082883 
-321214.652556  7397747.492299 
-321193.797838  7397756.610737 
-321165.587483  7397766.429056 
-321135.604189  7397776.477335 
-321108.366889  7397790.075005 
-321081.632609  7397805.202414 
-321062.765233  7397819.389984 
-321039.799481  7397837.816828 
-321024.379030  7397863.132491 
-321020.099236  7397889.058050 
-321020.173452  7397909.984466 
-321022.226763  7397936.979842 
-321025.162422  7397978.602712 
-321026.044768  7397984.841644 
-321029.170090  7398013.936660 
-321030.555456  7398059.078927 
-321032.344888  7398086.574218 
-321029.854527  7398111.509946 
-321018.532452  7398131.316554 
-320996.910835  7398141.444819 
-320984.186901  7398147.623761 
-320961.559245  7398156.482243 
-320948.818818  7398164.930796 
-320937.579206  7398175.159044 
-320928.838201  7398189.946511 
-320914.283604  7398203.164247 
-320901.312283  7398208.333361 
-320881.793455  7398209.153221 
-320869.646758  7398207.523500 
-320856.988794  7398205.893779 
-320843.819563  7398205.763802 
-320824.556369  7398206.333704 
-320800.452636  7398209.633139 
-320781.181195  7398211.712783 
-320760.128569  7398213.532471 
-320739.364560  7398212.072721 
-320720.884757  7398209.873098 
-320695.560583  7398208.623312 
-320679.818528  7398212.252690 
-320670.104469  7398217.021873 
-320667.350228  7398218.181675 
-320650.519671  7398230.369587 
-320637.276224  7398238.568183 
-320625.541838  7398247.776605 
-320592.194081  7398265.353594 
-320578.703248  7398272.792320 
-320562.136571  7398284.230361 
-320551.820536  7398305.556708 
-320544.481391  7398333.471926 
-320542.287894  7398353.368518 
-320542.304386  7398380.593855 
-320543.046547  7398412.108457 
-320544.192773  7398425.986080 
-320548.860139  7398443.683048 
-320555.102536  7398454.081267 
-320563.629138  7398464.239527 
-320565.814390  7398475.357623 
-320565.501033  7398482.916328 
-320557.329018  7398490.655002 
-320550.962928  7398493.614495 
-320542.345617  7398494.294379 
-320521.004372  7398501.143206 
-320512.032473  7398512.401277 
-320509.880207  7398527.258732 
-320511.273820  7398542.146182 
-320512.964297  7398552.244453 
-320517.656403  7398565.902113 
-320515.223765  7398583.529094 
-320510.350242  7398590.787851 
-320498.368469  7398598.736489 
-320477.266365  7398607.864925 
-320466.571004  7398613.563949 
-320442.442533  7398620.642737 
-320423.641127  7398625.751861 
-320390.351094  7398637.279887 
-320372.283603  7398646.688275 
-320361.151191  7398656.546587 
-320349.812624  7398666.634859 
-320333.138746  7398690.170827 
-320325.370796  7398709.767470 
-320308.334084  7398746.151238 
-320299.024089  7398767.747539 
-320289.202829  7398790.593626 
-320277.072623  7398815.939284 
-320262.963323  7398836.475766 
-320241.745771  7398857.702131 
-320227.999305  7398865.380815 
-320211.712999  7398874.049330 
-320200.300216  7398878.118633 
-320181.721458  7398884.597524 
-320159.118540  7398889.926611 
-320144.399019  7398892.556160 
-320130.924678  7398897.975232 
-320115.875307  7398910.183141 
-320110.688428  7398923.240904 
-320111.133724  7398931.059565 
-320113.335468  7398940.407964 
-320115.834076  7398944.217311 
-320123.874150  7398952.365915 
-320133.481009  7398954.975468 
-320141.850933  7398954.045628 
-320154.261510  7398954.165607 
-320170.737479  7398953.825665 
-320181.878137  7398955.185433 
-320189.456423  7398957.535030 
-320198.016010  7398963.663980 
-320203.013226  7398972.282504 
-320202.939010  7398980.351122 
-320199.294176  7398992.419055 
-320190.594403  7399001.657472 
-320183.444921  7399008.396318 
-320168.898570  7399020.104312 
-320154.640837  7399028.792824 
-320141.422129  7399033.452026 
-320128.475547  7399036.351529 
-320116.229895  7399045.819908 
-320108.750563  7399060.617373 
-320104.577971  7399074.445004 
-320099.432323  7399083.973372 
-320094.064027  7399089.212475 
-320088.473082  7399090.932180 
-320073.761807  7399092.801860 
-320058.786652  7399096.441237 
-320045.353542  7399099.550704 
-320031.706031  7399110.278866 
-320022.272343  7399119.437298 
-320002.102063  7399148.392338 
-319993.072440  7399162.419935 
-319980.645370  7399187.535633 
-319970.370567  7399208.032122 
-319965.109472  7399218.860267 
-319940.139885  7399259.353331 
-319915.129068  7399302.615921 
-319905.357285  7399320.572845 
-319902.957631  7399326.111896 
-319896.674004  7399344.348772 
-319895.676210  7399349.667861 
-319895.280391  7399362.865601 
-319895.898858  7399368.904566 
-319901.291893  7399385.891656 
-319907.592013  7399403.818586 
-319917.198872  7399418.995986 
-319923.837087  7399428.584344 
-319939.430710  7399449.630738 
-319947.949066  7399462.038613 
-319956.830256  7399475.116373 
-319968.045130  7399492.173451 
-319982.212154  7399515.519452 
-319990.450139  7399527.907330 
-319995.010304  7399536.075931 
-320009.144344  7399562.211454 
-320029.248654  7399595.605734 
-320042.285944  7399615.932253 
-320056.906511  7399639.978134 
-320066.933928  7399658.644936 
-320075.806872  7399676.601860 
-320086.040444  7399696.888386 
-320095.803981  7399718.104751 
-320106.260202  7399740.250958 
-320119.445925  7399767.536284 
-320125.119331  7399780.114130 
-320130.075316  7399793.621816 
-320139.393557  7399813.438422 
-320146.402853  7399830.905430 
-320150.509475  7399838.374150 
-320153.939907  7399843.983189 
-320161.509947  7399853.571547 
-320168.412042  7399861.310222 
-320176.023313  7399867.659134 
-320188.747247  7399875.467796 
-320201.735060  7399880.956856 
-320209.610211  7399884.996164 
-320232.534732  7399897.793972 
-320253.372957  7399908.942063 
-320258.460881  7399912.241497 
-320267.408041  7399923.949492 
-320277.188071  7399943.766098 
-320282.647075  7399955.194140 
-320284.205613  7399960.773184 
-320289.953236  7399986.108845 
-320292.921879  7399996.567053 
-320301.852547  7400015.553801 
-320315.318641  7400033.130790 
-320320.282872  7400038.089941 
-320335.018886  7400048.158216 
-320351.041312  7400056.516784 
-320357.415649  7400058.506444 
-320377.404512  7400061.475935 
-320392.288958  7400062.895692 
-320396.882109  7400062.865697 
-320403.907897  7400062.755716 
-320421.480615  7400060.776055 
-320439.482136  7400057.796565 
-320455.075758  7400056.376808 
-320474.355445  7400053.687269 
-320484.135475  7400052.837415 
-320514.184739  7400050.987731 
-320519.140724  7400051.837586 
-320533.035623  7400056.096856 
-320547.210893  7400062.045837 
-320561.386164  7400067.574890 
-320573.433907  7400072.674017 
-320580.237047  7400079.902779 
-320584.483856  7400091.250835 
-320584.772474  7400101.169136 
-320584.203484  7400114.066927 
-320580.517419  7400129.804231 
-320575.413002  7400142.412071 
-320569.888027  7400152.900275 
-320566.630766  7400163.108526 
-320565.212415  7400170.907190 
-320563.934249  7400190.603817 
-320561.806721  7400241.915027 
-320562.515897  7400250.283594 
-320566.911138  7400262.191554 
-320572.584545  7400276.359127 
-320583.213936  7400292.516360 
-320590.866438  7400305.704101 
-320598.238568  7400316.192304 
-320603.763543  7400322.281261 
-320611.704663  7400328.660169 
-320623.892592  7400336.888759 
-320631.545094  7400344.257497 
-320644.161827  7400357.015312 
-320664.290876  7400382.101015 
-320669.106675  7400387.200141 
-320675.909815  7400391.459412 
-320717.586265  7400415.125358 
-320731.332731  7400422.784046 
-320738.985233  7400427.743197 
-320743.660846  7400432.702347 
-320746.497549  7400438.801303 
-320750.183614  7400451.129191 
-320750.612418  7400458.078001 
-320749.474439  7400466.576545 
-320746.497549  7400475.085087 
-320740.832389  7400486.843073 
-320735.158982  7400498.471082 
-320732.470711  7400506.829650 
-320732.610897  7400512.078751 
-320733.320073  7400516.897925 
-320732.891269  7400524.976541 
-320731.332731  7400530.505594 
-320726.657118  7400536.884502 
-320719.713792  7400547.512681 
-320707.097059  7400562.680083 
-320698.306577  7400570.618723 
-320689.804714  7400580.826975 
-320668.117127  7400596.274329 
-320643.172279  7400613.561368 
-320612.265407  7400632.418138 
-320606.880618  7400635.247653 
-320571.166193  7400649.855151 
-320554.294405  7400654.954277 
-320545.512170  7400657.083913 
-320512.626202  7400661.043235 
-320484.135475  7400663.742772 
-320463.866240  7400665.442481 
-320439.910940  7400667.282166 
-320430.419529  7400671.601426 
-320519.247925  7400668.371979 
-320599.071438  7400661.123221 
-320651.492726  7400648.615363 
-320693.886598  7400620.600162 
-320754.413931  7400594.194685 
-320771.063070  7400550.142231 
-320790.466451  7400507.589520 
-320811.123259  7400473.505358 
-320829.141273  7400428.203118 
-320836.678328  7400380.111356 
-320848.124096  7400288.097117 
-320862.893095  7399944.915901 
-320866.076140  7399938.087070 
-320857.203196  7399889.555383 
-320873.505994  7399825.656329 
-320901.411238  7399755.218394 
-320963.241476  7399650.296366 
-321044.796697  7399541.534996 
-321113.496044  7399453.210125 
-321202.720260  7399351.847488 
-321260.963387  7399303.635746 
-321339.813844  7399265.572266 
-321436.335974  7399243.815993 
-321568.201448  7399228.868553 
-321670.273291  7399221.439826 
-321759.951050  7399215.590827 
-321879.859489  7399206.542377 
-321908.779020  7399203.722860 
-321966.222263  7399200.423425 
-322094.170778  7399192.034862 
-322193.109053  7399181.566655 
-322392.972945  7399167.499065 
-322464.888323  7399161.410108 
-322580.162381  7399152.961555 
-322758.734505  7399139.843802 
-322869.143288  7399131.745189 
-322955.530800  7399123.646577 
-323033.202046  7399119.787238 
-323082.283611  7399112.658459 
-323118.797920  7399107.119408 
-323152.656943  7399100.450550 
-323196.007378  7399089.912355 
-323224.506351  7399080.224015 
-323253.409390  7399072.815284 
-323290.649367  7399060.407409 
-323336.251023  7399042.230522 
-323386.371612  7399017.544751 
-323417.863967  7398998.288049 
-323458.855980  7398976.321812 
-323489.952516  7398952.495893 
-323512.679127  7398932.529313 
-323539.199005  7398909.883192 
-323563.830496  7398887.996941 
-323600.880810  7398842.014818 
-323619.022518  7398818.258887 
-323633.370959  7398796.822559 
-323655.990370  7398757.779246 
-323671.773655  7398722.585275 
-323683.351363  7398683.611951 
-323697.386448  7398645.258520 
-323705.071935  7398620.162819 
-323738.634093  7398607.974907 
-323760.173248  7398607.634965 
-323778.727267  7398615.593602 
-323790.659562  7398636.480024 
-323786.676633  7398674.933437 
-323806.566541  7398658.686220 
-323818.836933  7398640.789286 
-323818.498837  7398619.242976 
-323806.566541  7398597.366724 
-323786.709618  7398579.659757 
-323743.070565  7398541.736253 
-323728.713878  7398532.747792 
-Region 1
-524
-325145.243132  7405147.694712 
-325199.882656  7405207.124532 
-325238.417292  7405261.515215 
-325274.675968  7405281.921720 
-325324.532679  7405286.450944 
-325375.214012  7405273.403179 
-325545.927479  7405414.878945 
-325664.887603  7405456.271855 
-325614.082576  7405535.638261 
-325652.246131  7405634.771280 
-325679.755556  7405771.437870 
-325721.143388  7405941.368763 
-325711.148956  7406058.758655 
-325601.259687  7406208.622984 
-325516.340004  7406266.063145 
-325284.183872  7406381.113438 
-325183.876723  7406489.574860 
-325156.680654  7406585.758384 
-325166.073111  7406627.001320 
-325171.301221  7406602.245560 
-325178.087869  7406573.330513 
-325166.073111  7406627.001320 
-325162.848835  7406678.852438 
-325171.969166  7406768.877018 
-325254.794306  7406833.875884 
-325385.101243  7406884.707177 
-325466.326615  7406904.283824 
-325543.206223  7406979.400957 
-325727.361046  7407039.950585 
-325874.869620  7407079.163869 
-325997.565286  7407092.791534 
-326072.540015  7407113.238032 
-326202.055313  7407542.664475 
-326195.235680  7407651.725794 
-326236.128738  7407760.787113 
-326208.866700  7407863.029599 
-326147.522990  7408026.621578 
-326127.072338  7408203.841222 
-326018.007691  7408435.601523 
-326011.196305  7408599.193501 
-326065.728628  7408633.267665 
-326202.047067  7408619.639999 
-326393.532789  7408578.846986 
-326364.069007  7408604.372614 
-326342.991641  7408631.927894 
-326325.724034  7408650.884647 
-326304.399282  7408679.699711 
-326291.708333  7408702.445815 
-326287.931559  7408731.250881 
-326290.248750  7408751.457420 
-326295.353167  7408770.654132 
-326303.005669  7408784.291796 
-326307.862699  7408809.297512 
-326308.662583  7408833.553358 
-326310.212874  7408858.559074 
-326306.939121  7408880.795265 
-326304.407528  7408894.692885 
-326294.775930  7408920.718427 
-326285.136087  7408936.895656 
-326268.379746  7408962.171326 
-326267.381952  7408977.828644 
-326268.173590  7408999.304966 
-326268.956982  7409012.952628 
-326273.550133  7409029.619773 
-326280.180102  7409043.507394 
-326293.687428  7409063.713933 
-326302.865483  7409085.690169 
-326307.722513  7409104.886881 
-326306.502070  7409147.329610 
-326302.725297  7409177.904373 
-326299.971056  7409210.238835 
-326294.413096  7409240.563640 
-326287.568725  7409259.260438 
-326276.403329  7409275.177711 
-326265.468827  7409280.746757 
-326259.622249  7409280.496800 
-326242.329904  7409278.987059 
-326231.395402  7409277.737273 
-326213.591790  7409275.217704 
-326180.780038  7409270.688480 
-326164.749366  7409268.678824 
-326152.792331  7409259.850337 
-326143.886402  7409254.801202 
-326125.555031  7409242.433320 
-326102.663495  7409237.394183 
-326082.320044  7409239.173878 
-326066.050231  7409242.463315 
-326051.050337  7409247.532447 
-326005.547637  7409261.200105 
-325984.453779  7409269.038763 
-325958.775017  7409272.088240 
-325930.803802  7409276.907415 
-325919.671391  7409290.685055 
-325909.668713  7409300.173430 
-325895.114116  7409308.082075 
-325878.860795  7409310.171717 
-325846.832436  7409315.610785 
-325788.449123  7409319.240164 
-325758.927617  7409327.498749 
-325721.102157  7409330.098304 
-325689.090289  7409334.277588 
-325654.761231  7409341.206401 
-325627.565163  7409346.205545 
-325603.914973  7409350.984726 
-325583.084995  7409353.524291 
-325567.615066  7409353.344322 
-325541.730148  7409353.814242 
-325426.431351  7408741.909055 
-325270.173526  7408757.036464 
-325209.695671  7408787.281284 
-325164.324910  7408757.036464 
-324947.589230  7408767.114738 
-324786.292958  7408782.232148 
-324674.861644  7408739.399485 
-324605.832447  7408468.165945 
-324473.785555  7408232.826257 
-324388.098973  7408147.140934 
-324226.802701  7408091.700430 
-323987.381641  7408069.404249 
-323962.189406  7408173.676388 
-323932.321559  7408300.704630 
-323909.265098  7408387.819708 
-323919.341992  7408488.632439 
-323944.542473  7408521.396827 
-324000.311730  7408553.851268 
-323981.502078  7408563.689583 
-323929.468363  7408602.053011 
-323902.181586  7408619.340050 
-323865.461121  7408626.088894 
-323816.610450  7408629.438321 
-323803.399989  7408644.275779 
-323792.391271  7408651.764496 
-323778.042830  7408652.944294 
-323762.630624  7408649.064959 
-323744.876490  7408637.856879 
-323694.623960  7408599.153508 
-323662.950188  7408582.016444 
-323625.256668  7408566.999016 
-323595.751655  7408563.279653 
-323560.243386  7408565.459280 
-323531.612473  7408575.157618 
-323499.311987  7408595.554125 
-323471.142864  7408626.788774 
-323433.168971  7408686.008631 
-323412.033882  7408714.133813 
-323356.272871  7408680.809521 
-323340.761711  7408665.532138 
-323332.771113  7408647.615207 
-323338.073440  7408622.979427 
-323349.016188  7408583.066264 
-323369.186468  7408506.809326 
-323378.001688  7408480.363856 
-323381.753723  7408451.678769 
-323376.789492  7408433.241927 
-323369.953367  7408430.022479 
-323310.407336  7408525.216173 
-323285.949016  7408575.167617 
-323266.083846  7408604.292628 
-323240.083481  7408624.859105 
-323189.567072  7408664.212364 
-323171.128500  7408685.708682 
-323156.079129  7408692.207569 
-323121.346006  7408697.166719 
-323084.922405  7408707.474954 
-323012.512254  7408723.502208 
-322973.557060  7408733.830439 
-322892.216241  7408763.895289 
-322856.287414  7408773.943568 
-322797.541267  7408796.149764 
-322746.307436  7408812.696930 
-322706.362695  7408824.314940 
-322646.717708  7408831.833652 
-322618.490861  7408831.143770 
-322552.166428  7408825.304770 
-322542.592554  7408824.914837 
-322415.180044  7408807.857759 
-322404.113603  7408809.247521 
-322380.933448  7408809.517475 
-322358.701611  7408803.438516 
-322329.963497  7408801.988764 
-322313.132940  7408807.247863 
-322284.716429  7408813.396810 
-322253.496200  7408815.526445 
-322238.108734  7408813.926719 
-322203.441580  7408824.214957 
-322179.230647  7408821.955344 
-322153.997181  7408817.926034 
-322122.339902  7408827.174450 
-321973.693348  7408865.477889 
-321996.263281  7408563.349641 
-321935.925612  7408473.505031 
-321799.829821  7408443.270209 
-321704.066344  7408372.702297 
-321598.217728  7408216.449062 
-321497.407558  7408145.881150 
-321436.921456  7408110.597193 
-321426.836316  7408060.195827 
-321371.396908  7408024.911870 
-321361.311768  7407984.588777 
-321401.635835  7407868.658635 
-321446.998350  7407808.168997 
-321537.731626  7407782.963314 
-321517.569592  7407682.160581 
-321361.352999  7407680.190918 
-321364.602014  7407675.361745 
-321356.331044  7407684.780132 
-321300.413354  7407685.050086 
-321039.337692  7407658.644609 
-320752.566775  7407630.059505 
-320617.988291  7407611.932610 
-320597.818011  7407607.713333 
-320325.016208  7407570.939632 
-320309.117476  7407583.667452 
-320298.603532  7407592.395957 
-320286.786683  7407604.903814 
-320275.497593  7407614.382190 
-320260.679117  7407622.060875 
-320245.769932  7407628.669743 
-320242.957967  7407619.801262 
-320236.369229  7407610.192908 
-320231.817310  7407606.663513 
-320223.241230  7407602.644201 
-320214.920783  7407601.164455 
-320172.576389  7407596.285290 
-320118.679025  7407597.045160 
-320071.279691  7407586.107034 
-320059.438104  7407587.936720 
-320047.860396  7407588.506623 
-320052.494778  7407577.808455 
-320049.600351  7407562.881012 
-320045.015447  7407540.114912 
-320044.363995  7407530.256600 
-320043.852728  7407506.270709 
-320043.753774  7407491.623218 
-320041.213934  7407467.857289 
-320031.780247  7407446.560937 
-320018.759448  7407428.504030 
-320007.660022  7407420.305434 
-319987.267094  7407402.688452 
-319969.562436  7407394.679824 
-319954.166724  7407384.421581 
-319937.971127  7407377.702732 
-319923.028957  7407372.493624 
-319908.598053  7407367.804427 
-319903.073079  7407361.445516 
-319892.625104  7407340.379125 
-319885.887934  7407328.441170 
-319877.608718  7407318.512870 
-319871.160166  7407303.305475 
-319866.220674  7407290.117734 
-319857.751795  7407273.880515 
-319849.843660  7407252.844119 
-319842.009741  7407224.738933 
-319833.425415  7407195.363965 
-319822.985687  7407173.037789 
-319814.244682  7407159.060183 
-319806.443748  7407151.661450 
-319798.857216  7407148.052069 
-319793.291010  7407145.972425 
-319791.056282  7407140.653336 
-319792.639558  7407132.544725 
-319790.850126  7407125.675901 
-319779.767192  7407109.968592 
-319766.746394  7407099.850325 
-319752.439183  7407091.531750 
-319743.599224  7407086.902543 
-319739.863682  7407079.283848 
-319741.512928  7407067.685835 
-319743.648702  7407058.117474 
-319748.827334  7407049.079022 
-319763.992153  7407033.321721 
-319769.327464  7407009.645776 
-319771.982750  7406998.807633 
-319771.652901  7406982.140488 
-319769.277986  7406965.963259 
-319762.177982  7406940.637597 
-319755.110962  7406912.292452 
-319751.532098  7406890.536179 
-319743.607470  7406870.769565 
-319736.804330  7406841.664550 
-319729.168321  7406818.858457 
-319726.339863  7406797.872051 
-319723.206296  7406757.698933 
-319722.513612  7406727.134168 
-319718.374005  7406717.115884 
-319719.784110  7406704.688013 
-319725.383301  7406696.359439 
-319726.158446  7406671.873634 
-319724.080396  7406651.907054 
-319722.793984  7406629.170948 
-319722.859954  7406599.636007 
-319723.255773  7406586.248301 
-319725.399793  7406575.420155 
-319730.660888  7406559.312914 
-319738.478315  7406540.456144 
-319747.912003  7406514.290626 
-319755.795399  7406490.124766 
-319758.500163  7406474.497442 
-319760.281349  7406450.021635 
-319759.720605  7406431.084879 
-319755.416073  7406406.299124 
-319750.278671  7406387.052421 
-319746.007124  7406358.727273 
-319741.133601  7406338.990654 
-319738.173204  7406330.622087 
-319727.758215  7406309.145766 
-319707.975508  7406302.296939 
-319701.980498  7406292.898549 
-319693.569343  7406270.842327 
-319688.135077  7406256.654757 
-319676.911957  7406236.088280 
-319667.659686  7406222.110674 
-319655.405787  7406203.293897 
-319639.911120  7406178.648119 
-319627.945839  7406156.561902 
-319614.974519  7406133.455860 
-319606.043851  7406112.919377 
-319603.438042  7406095.472366 
-319600.840479  7406077.005529 
-319600.988911  7406063.127906 
-319603.883338  7406053.309588 
-319609.630961  7406039.222001 
-319620.755126  7406020.145269 
-319628.539568  7406005.327807 
-319637.651653  7405984.971294 
-319640.900668  7405966.064532 
-319642.154095  7405944.108293 
-319644.075467  7405930.740583 
-319623.699031  7405911.353904 
-319597.706912  7405893.416976 
-319578.534425  7405880.599172 
-319566.156833  7405872.900491 
-319545.343347  7405870.670872 
-319523.993856  7405870.460908 
-319512.366671  7405865.041837 
-319501.811495  7405853.573801 
-319485.286049  7405830.427766 
-319473.048643  7405809.851290 
-319466.055839  7405798.673205 
-319459.038297  7405789.514774 
-319446.924584  7405781.566135 
-319433.780093  7405774.617326 
-319411.498777  7405766.818661 
-319401.438376  7405757.120323 
-319390.932678  7405741.113065 
-319378.860196  7405728.875161 
-319370.308855  7405720.456603 
-319352.826846  7405715.477456 
-319342.939616  7405713.617774 
-319317.532979  7405712.347992 
-319299.531458  7405708.378672 
-319288.184644  7405700.440031 
-319275.130861  7405684.652736 
-319267.115525  7405673.464652 
-319261.895661  7405663.066433 
-319260.749435  7405651.438425 
-319266.802168  7405631.551831 
-319270.512972  7405617.444248 
-319271.923077  7405604.326495 
-319270.001706  7405593.958271 
-319264.897289  7405571.692085 
-319256.717028  7405552.415387 
-319249.460345  7405541.737216 
-319243.490074  7405529.309345 
-319235.986004  7405518.121261 
-319235.161381  7405499.934376 
-319236.084959  7405485.296884 
-319239.317481  7405467.659905 
-319244.636300  7405445.743659 
-319251.934214  7405428.396630 
-319261.021561  7405410.809643 
-319260.947344  7405393.892540 
-319259.067204  7405379.235051 
-319257.162325  7405367.597044 
-319252.981486  7405354.169344 
-319248.107963  7405334.682682 
-319240.653371  7405318.195506 
-319235.746864  7405301.738325 
-319230.955804  7405274.163049 
-318996.424758  7404953.697942 
-318781.668173  7404524.191512 
-318558.962222  7404213.984648 
-318412.674090  7403906.477321 
-318417.019854  7403895.219249 
-318439.664003  7403836.619287 
-318442.533691  7403795.776283 
-318440.447395  7403736.216485 
-318411.000105  7403666.298461 
-318372.613902  7403568.545206 
-318335.060567  7403493.997975 
-318320.893543  7403420.200616 
-318333.699939  7403343.133817 
-318350.514004  7403275.185456 
-318373.743635  7403232.032847 
-318419.889542  7403183.551152 
-318473.069484  7403146.237543 
-318634.266800  7403082.758417 
-318878.751046  7402970.657618 
-318936.779771  7402963.668816 
-318994.973421  7402936.003554 
-319053.686583  7402905.808726 
-319076.940954  7402940.782736 
-319089.722611  7402957.949795 
-319251.868245  7402978.646250 
-319392.161367  7402959.099598 
-319553.160774  7403009.700931 
-319801.990783  7403122.831552 
-320024.746212  7403086.307809 
-320154.047108  7403020.469086 
-320162.441771  7402998.272888 
-320167.793575  7402987.434745 
-320179.701132  7402972.937228 
-320191.625181  7402969.117882 
-320205.957130  7402973.797081 
-320228.700234  7402978.326305 
-320255.508730  7402983.415433 
-320273.749393  7402984.805195 
-320298.504577  7402985.275115 
-320315.302149  7402983.895351 
-320337.608203  7402978.886209 
-320436.727895  7402942.572429 
-320477.307596  7402925.625332 
-320500.182640  7402922.055943 
-320515.182533  7402910.117988 
-320551.746320  7402899.129871 
-320563.282797  7402896.090391 
-320583.428338  7402897.310182 
-320591.023117  7402898.150038 
-320613.700251  7402903.089192 
-320633.854039  7402904.129014 
-320663.136404  7402905.098848 
-320684.469402  7402905.048857 
-320702.058612  7402904.139013 
-320734.392083  7402893.740794 
-320783.655065  7402888.311724 
-320830.163805  7402903.879057 
-320970.762038  7402996.433203 
-320991.410599  7403092.356773 
-320946.930431  7403487.869025 
-321002.658458  7403453.704877 
-321028.238266  7403437.807600 
-321090.332382  7403422.910152 
-321099.073387  7403445.296317 
-321119.260159  7403477.970720 
-321142.918595  7403512.094875 
-321155.279695  7403532.961301 
-321207.090762  7403600.209782 
-321214.561847  7403620.636283 
-321219.319922  7403644.732156 
-321210.348023  7403660.849395 
-321191.043597  7403684.125408 
-321169.050900  7403699.072848 
-321245.361518  7403734.656752 
-321336.927664  7403766.711262 
-321382.710736  7403782.728518 
-321421.624699  7403798.755773 
-321455.962003  7403828.510676 
-321478.738092  7403839.368816 
-321524.059376  7403861.585011 
-321608.946074  7403877.032365 
-321698.615586  7403892.609696 
-321692.966918  7403783.368408 
-321691.746476  7403764.421654 
-321698.615586  7403711.770673 
-321714.638012  7403643.092436 
-321723.799574  7403581.283024 
-321753.560221  7403527.492238 
-322389.946578  7403916.655578 
-322511.900084  7404001.031125 
-322804.212468  7404268.035389 
-323137.508618  7404495.796376 
-323487.478646  7404590.230200 
-323840.186424  7404582.341552 
-324445.839080  7404704.830570 
-324434.236633  7404756.791670 
-324405.193409  7404825.569889 
-324397.697585  7404837.227892 
-324379.423938  7404843.986734 
-324362.659351  7404844.446655 
-324342.522056  7404845.316506 
-324328.346786  7404843.046895 
-324308.242475  7404849.335818 
-324299.872551  7404856.994506 
-324293.036426  7404864.993136 
-324288.162904  7404879.110718 
-324285.944668  7404893.598236 
-324285.656049  7404909.655486 
-324288.014471  7404942.909790 
-324292.789039  7404979.843463 
-324324.248409  7405126.198394 
-324334.185117  7405149.464409 
-324345.680362  7405162.782127 
-324361.348201  7405176.489779 
-324375.853320  7405185.968156 
-324391.183063  7405193.896798 
-324408.673318  7405202.195376 
-324428.175654  7405211.283819 
-324444.231065  7405227.321072 
-324463.395305  7405317.145686 
-324508.345508  7405326.324114 
-324537.240300  7405336.972290 
-324558.053786  7405349.740103 
-324569.796419  7405364.567563 
-324585.109669  7405384.724111 
-324604.950100  7405400.021490 
-324644.086711  7405409.219915 
-324677.450960  7405421.937736 
-324700.548652  7405433.955678 
-324711.969681  7405440.624536 
-324735.496177  7405472.879011 
-324746.702805  7405493.085549 
-324746.777021  7405498.524618 
-324746.875976  7405521.450691 
-324741.202569  7405560.254044 
-324762.552060  7405557.054592 
-324820.217951  7405549.615866 
-324853.573954  7405549.125950 
-324907.801167  7405533.498627 
-324930.783412  7405516.951461 
-325043.863973  7405356.458952 
-325043.855726  7405356.408961 
-325149.547664  7405210.373975 
-325157.142443  7405185.238281 
-325145.243132  7405147.694712 
-Region 1
-718
-323801.594064  7374893.696948 
-323341.363686  7374955.656335 
-323049.917156  7375031.743302 
-322777.700836  7375177.838277 
-322504.519707  7375393.701301 
-322310.749779  7375670.223936 
-321932.519918  7376293.277212 
-321597.722954  7376956.403625 
-321575.021081  7377366.123443 
-321575.021081  7377366.143440 
-321514.757627  7377376.651640 
-321604.047813  7377768.444529 
-321611.758039  7377807.797789 
-321425.846769  7377844.301536 
-321247.093227  7377890.583608 
-321055.417842  7377960.361656 
-320997.356132  7378016.532034 
-320978.026967  7378042.977504 
-320950.113476  7378116.554901 
-320938.700693  7378147.009685 
-320932.359342  7378199.020776 
-320940.382924  7378246.772596 
-320973.483294  7378326.508938 
-320987.130806  7378405.445417 
-320999.590860  7378490.820793 
-321110.378969  7378603.311524 
-321224.712957  7378714.632456 
-321370.019787  7378825.723427 
-321405.272423  7378864.896717 
-321423.298683  7378924.666479 
-321415.687412  7378996.984092 
-321340.547759  7379131.341078 
-321308.956449  7379220.105873 
-321262.324015  7379298.332473 
-321233.726087  7379338.945517 
-321213.333159  7379366.700763 
-321245.592413  7379419.461725 
-321278.676290  7379466.353693 
-321305.319862  7379480.311302 
-321323.082242  7379512.025870 
-321364.948355  7379545.010220 
-321382.702490  7379556.428264 
-321411.885900  7379570.375875 
-321418.227252  7379575.455005 
-321451.212174  7379591.942181 
-321488.872709  7379634.864828 
-321509.570748  7379661.720228 
-321551.189474  7379698.044006 
-321578.146402  7379727.798910 
-321631.235635  7379786.138917 
-321653.417996  7379810.524740 
-321656.716488  7379836.780242 
-321668.285950  7379867.355005 
-321678.626723  7379918.226291 
-321683.401290  7379946.841390 
-321678.230904  7379973.766778 
-321662.282694  7380001.392046 
-321647.357016  7380037.795810 
-321622.469892  7380086.707432 
-321593.286482  7380120.951566 
-321538.745912  7380162.824394 
-321540.708515  7380182.531018 
-321548.657882  7380268.376314 
-321573.858363  7380307.589597 
-321593.443160  7380349.462424 
-321606.282541  7380393.574868 
-321610.949908  7380432.868138 
-321613.836089  7380465.512546 
-321613.662918  7380485.939047 
-321622.890450  7380534.900661 
-321596.321095  7380535.280595 
-321579.688448  7380539.779825 
-321565.298775  7380541.949453 
-321549.416535  7380548.378352 
-321524.636612  7380555.717095 
-321484.147619  7380563.855701 
-321357.708165  7380566.955170 
-321333.777603  7380568.084976 
-321301.732751  7380569.174790 
-321242.269182  7380571.744350 
-321165.505021  7380576.803483 
-321107.781406  7380582.422520 
-321054.222138  7380595.880215 
-320992.985630  7380612.847309 
-320944.134959  7380613.757153 
-320928.227980  7380616.146744 
-320770.048784  7380593.890556 
-320665.923630  7380576.403551 
-320659.557540  7380643.961979 
-320654.049057  7380685.994779 
-320638.892486  7380733.796591 
-320617.122437  7380787.107460 
-320571.067238  7380889.969840 
-320561.781983  7380930.922825 
-320556.463164  7380947.679955 
-320556.652827  7380982.254033 
-320553.717169  7380997.491423 
-320543.500089  7381046.982945 
-320543.500089  7381055.721449 
-320518.060468  7381092.295184 
-320506.936303  7381112.161781 
-320488.646163  7381141.576742 
-320488.654409  7381141.596739 
-320468.912933  7381152.014954 
-320449.303397  7381174.281140 
-320433.602574  7381182.149793 
-320363.550844  7381219.963315 
-320351.280453  7381230.551502 
-320308.235129  7381218.973485 
-320305.381933  7381169.691927 
-320293.606316  7381090.475496 
-320281.154508  7381058.091043 
-320276.346955  7381033.995170 
-320266.905021  7381005.310084 
-320262.674705  7380968.036468 
-320260.885273  7380948.079887 
-320251.187705  7380907.196890 
-320242.388977  7380884.050854 
-320224.898722  7380863.344401 
-320205.882914  7380849.926699 
-320189.547131  7380834.659315 
-320170.020057  7380805.064384 
-320159.365927  7380783.888011 
-320151.927827  7380758.322390 
-320144.118647  7380721.458705 
-320128.104467  7380678.496064 
-320104.668679  7380672.737050 
-320024.432855  7380552.557636 
-319971.022019  7380462.803010 
-319958.710397  7380438.387192 
-319938.259745  7380406.492656 
-319899.378767  7380344.283312 
-319779.478574  7380165.683904 
-319723.057864  7380051.013546 
-319708.173417  7380017.819232 
-319704.619292  7379991.523736 
-319698.591297  7379975.496481 
-319690.567715  7379940.472481 
-319608.319810  7379939.422660 
-319603.479273  7379969.427521 
-319609.408313  7379986.604579 
-319602.522710  7379990.733871 
-319596.643148  7380008.940753 
-319590.087394  7380018.009199 
-319574.436049  7380022.068504 
-319552.352643  7380021.508600 
-319534.351122  7380033.156605 
-319526.987238  7380047.174204 
-319519.499660  7380074.879458 
-319510.049480  7380109.043606 
-319501.052842  7380134.839187 
-319488.716481  7380151.086404 
-319476.017286  7380165.453943 
-319461.470935  7380173.702530 
-319324.031009  7380253.598845 
-319283.426569  7380280.284274 
-319232.200984  7380316.818016 
-319202.225936  7380330.965593 
-319169.612094  7380358.100945 
-319144.213703  7380387.935834 
-319118.312293  7380429.578701 
-319119.376057  7380437.947268 
-319122.880705  7380471.841462 
-319125.230880  7380506.095595 
-319120.711946  7380542.199410 
-319056.176945  7380519.233344 
-319045.539307  7380517.623620 
-319022.029304  7380506.385545 
-318988.252743  7380494.317612 
-318968.601976  7380477.810440 
-318932.071174  7380432.998115 
-318901.378703  7380374.158194 
-318877.802730  7380329.455851 
-318864.790178  7380293.971929 
-318852.907360  7380261.157550 
-318866.587856  7380222.474176 
-318872.797268  7380209.586384 
-318880.911559  7380197.098523 
-318884.160574  7380175.062298 
-318882.082524  7380152.596146 
-318867.577404  7380113.682811 
-318840.669953  7380058.302297 
-318796.198031  7379966.248066 
-318778.072816  7379928.554522 
-318745.524944  7379864.425507 
-318643.906644  7379645.762962 
-318626.952394  7379609.929100 
-318543.797404  7379457.085281 
-318495.350799  7379342.184962 
-318443.061450  7379223.315323 
-318425.934029  7379187.131521 
-318416.401387  7379175.703479 
-318381.627032  7379134.010620 
-318365.167556  7379183.482146 
-318186.075918  7379135.680334 
-318156.282287  7379128.661537 
-318125.985636  7379120.312967 
-318102.731265  7379111.604458 
-318082.346583  7379102.376039 
-318047.959801  7379098.726664 
-318037.948877  7379132.490881 
-318000.981025  7379136.660166 
-317973.281936  7379139.919608 
-317978.171951  7379179.022910 
-317977.297851  7379250.690634 
-317925.363090  7379280.295563 
-317887.818002  7379301.441941 
-317862.757707  7379310.710353 
-317757.675990  7379363.011395 
-317601.360442  7379432.439502 
-317587.152186  7379473.382489 
-317571.203976  7379464.174066 
-317549.961686  7379448.466757 
-317535.959587  7379426.710483 
-317524.233447  7379407.633751 
-317518.576532  7379392.756299 
-317515.962477  7379381.328257 
-317509.926236  7379364.171196 
-317499.371061  7379338.615573 
-317485.690565  7379373.269637 
-317452.466501  7379475.502126 
-317443.956391  7379516.115169 
-317428.808066  7379497.398375 
-317399.352530  7379435.598961 
-317379.206988  7379430.179889 
-317407.524544  7379312.799995 
-317438.060336  7379192.110668 
-317458.659420  7379128.481567 
-317461.191013  7379087.388606 
-317535.036009  7378971.768411 
-317516.968517  7378868.506099 
-317513.991628  7378855.548318 
-317369.558898  7378659.011983 
-317400.053459  7378659.581886 
-317426.367181  7378588.953984 
-317426.400166  7378588.943985 
-317456.919466  7378513.396926 
-317355.078517  7378530.104064 
-317384.031033  7378464.975220 
-317331.749931  7378477.603057 
-317294.386260  7378479.272771 
-317259.348026  7378476.383266 
-317105.926905  7378447.628191 
-317033.351829  7378478.392922 
-317012.093046  7378398.316638 
-317000.070042  7378368.941670 
-316984.591867  7378342.956121 
-316945.752120  7378338.146945 
-316925.903443  7378344.495857 
-316903.770560  7378348.545163 
-316884.383672  7378340.046619 
-316800.049471  7378229.135617 
-316784.892899  7378214.578111 
-316759.799619  7378203.769962 
-316700.377281  7378205.439676 
-316679.654504  7378198.530860 
-316659.228590  7378192.401909 
-316631.628456  7378189.172463 
-316593.934936  7378185.593076 
-316544.325613  7378180.203999 
-316519.809569  7378175.024886 
-316494.971922  7378171.165547 
-316469.029281  7378157.547880 
-316447.415910  7378148.859368 
-316424.037846  7378134.161885 
-316392.215642  7378109.836052 
-316376.869407  7378097.458172 
-316345.055449  7378056.295223 
-316369.093211  7378043.307448 
-316387.457567  7378034.448965 
-316430.296735  7378018.711661 
-316477.160064  7378007.003666 
-316555.746642  7377986.507177 
-316578.003219  7377977.268760 
-316599.657820  7377966.240649 
-316621.732980  7377946.584016 
-316668.085042  7377918.808773 
-316693.335000  7377906.060957 
-316714.577291  7377896.252637 
-316745.080098  7377887.884070 
-316775.162347  7377880.285372 
-316796.008818  7377876.785971 
-316818.751922  7377877.185903 
-316840.076675  7377876.236066 
-316863.495970  7377871.546869 
-316889.191224  7377864.338104 
-316908.512143  7377860.588746 
-316929.111227  7377860.958683 
-316938.841779  7377866.177789 
-316953.783949  7377870.137110 
-316966.738777  7377869.857158 
-316984.699068  7377868.857330 
-316999.616499  7377858.969023 
-317008.258549  7377853.319991 
-317013.445428  7377846.071233 
-317020.248568  7377832.533552 
-317026.614658  7377813.116877 
-317039.701426  7377802.538689 
-317061.199350  7377803.808472 
-317073.890299  7377808.847609 
-317085.162896  7377812.526978 
-317101.119352  7377817.156186 
-317116.638758  7377815.806417 
-317147.125073  7377808.767622 
-317194.310005  7377787.211315 
-317260.139664  7377743.728763 
-317279.064763  7377730.680998 
-317300.348285  7377717.103324 
-317322.233781  7377696.216901 
-317338.247961  7377671.941060 
-317339.138553  7377649.684872 
-317336.211142  7377623.399374 
-317334.801036  7377597.353836 
-317334.289770  7377564.889397 
-317337.547031  7377533.364796 
-317342.874096  7377499.100666 
-317351.227528  7377450.908920 
-317357.494663  7377439.130938 
-317379.841948  7377365.423563 
-317379.330682  7377332.739162 
-317377.079461  7377309.453150 
-317368.528120  7377275.229013 
-317355.210457  7377247.703728 
-317344.902669  7377223.757829 
-317330.414041  7377191.683323 
-317314.333892  7377164.897911 
-317306.681390  7377148.630698 
-317301.370817  7377133.383310 
-317299.952465  7377108.337600 
-317300.315300  7377087.621148 
-317298.055832  7377064.005193 
-317289.224119  7377044.948458 
-317282.569411  7377030.470938 
-317270.051633  7377004.175442 
-317264.328749  7376980.839439 
-317262.201222  7376955.553770 
-317262.514578  7376930.528057 
-317265.186357  7376904.752472 
-317274.438628  7376865.879131 
-317270.604131  7376838.583806 
-317268.946638  7376824.716182 
-317266.761387  7376811.728406 
-317262.217714  7376800.160388 
-317252.948951  7376791.181926 
-317243.160675  7376782.303446 
-317237.462530  7376765.066399 
-317233.240460  7376752.608533 
-317231.079947  7376729.652465 
-317223.147073  7376711.605556 
-317218.149857  7376695.148375 
-317215.733712  7376676.401586 
-317223.658340  7376662.763922 
-317238.229429  7376639.357932 
-317256.164981  7376608.453225 
-317254.466257  7376597.355126 
-317253.765328  7376588.156702 
-317249.798891  7376579.358209 
-317244.776936  7376564.890687 
-317236.291565  7376550.383172 
-317227.995857  7376536.995465 
-317214.645209  7376528.296955 
-317196.148914  7376506.910619 
-317194.532653  7376480.855082 
-317200.107105  7376467.747327 
-317205.722788  7376459.398757 
-317208.130687  7376445.801086 
-317207.710129  7376431.063611 
-317205.013612  7376417.965854 
-317197.262155  7376402.028584 
-317192.388633  7376384.241631 
-317187.333694  7376372.323672 
-317184.925794  7376361.445536 
-317182.427186  7376349.007666 
-317182.575618  7376337.149697 
-317190.219874  7376321.742336 
-317196.066452  7376310.744220 
-317202.993286  7376303.405477 
-317217.655084  7376297.166546 
-317230.642897  7376294.227050 
-317243.713172  7376293.067248 
-317262.506332  7376282.888992 
-317272.500764  7376266.731759 
-317278.685437  7376244.875503 
-317280.070803  7376224.069067 
-317278.710175  7376202.562751 
-317280.079050  7376183.196068 
-317282.759075  7376164.179325 
-317285.414361  7376148.042090 
-317284.762909  7376134.854349 
-317286.939914  7376099.550396 
-317285.867904  7376079.593814 
-317280.870688  7376063.366594 
-317274.991125  7376044.129889 
-317272.599718  7376023.823367 
-317272.492517  7375999.347560 
-317275.749779  7375967.712978 
-317275.815748  7375945.996698 
-317276.755819  7375920.421079 
-317276.137351  7375896.715140 
-317275.791010  7375874.998859 
-317277.407271  7375852.202764 
-317286.486371  7375827.506994 
-317292.390672  7375812.179620 
-317304.042596  7375801.921377 
-317321.318449  7375790.613314 
-317333.316715  7375785.454198 
-317346.675608  7375777.425573 
-317352.349015  7375764.307820 
-317358.253316  7375756.739116 
-317370.193858  7375740.391916 
-317369.039386  7375726.304330 
-317358.294547  7375713.326552 
-317347.706387  7375703.558226 
-317329.127629  7375680.942100 
-317316.337726  7375659.855712 
-317306.145385  7375643.108580 
-317299.630862  7375625.861534 
-317290.724933  7375604.585179 
-317288.053155  7375581.849073 
-317286.403909  7375566.651677 
-317285.422607  7375555.783538 
-317287.113084  7375534.987100 
-317286.923421  7375525.458733 
-317288.811808  7375521.159469 
-317293.289511  7375514.350635 
-317293.371973  7375507.481812 
-317294.815064  7375498.193403 
-317293.017385  7375486.985323 
-317293.132833  7375477.686915 
-317296.571511  7375472.297839 
-317289.174642  7375451.941325 
-317277.242346  7375411.798202 
-317268.361156  7375388.322223 
-317262.852674  7375363.986391 
-317256.758709  7375337.660901 
-317243.210152  7375320.323870 
-317231.937555  7375300.577253 
-317218.380752  7375283.460185 
-317199.142296  7375256.524799 
-317181.107789  7375231.149145 
-317169.793961  7375214.392015 
-317159.585127  7375190.786059 
-317148.551671  7375168.159935 
-317136.891501  7375146.413660 
-317131.209848  7375120.308131 
-317125.256069  7375098.971786 
-317113.125864  7375066.367371 
-317108.466744  7375039.501973 
-317108.079171  7375021.555047 
-317099.643277  7374986.880986 
-317091.050704  7374948.337588 
-317085.500991  7374919.472533 
-317074.253133  7374897.626275 
-317058.882159  7374879.589364 
-317046.875647  7374861.052539 
-317022.260648  7374839.926158 
-317003.154132  7374826.608439 
-316979.174093  7374812.020938 
-316955.977446  7374799.763038 
-316935.601011  7374790.204675 
-316902.022359  7374775.827138 
-316854.078774  7374753.171018 
-316817.622189  7374733.224435 
-316786.921472  7374709.238544 
-316770.585689  7374686.552430 
-316763.155835  7374669.395368 
-316746.556173  7374643.489806 
-316727.763013  7374621.763527 
-316711.748833  7374597.637660 
-316699.808291  7374566.033073 
-316693.120598  7374538.367812 
-316684.008514  7374508.782880 
-316685.674252  7374482.447391 
-316686.812232  7374456.431847 
-316693.689588  7374421.067905 
-316702.191452  7374393.372649 
-316712.458009  7374371.906326 
-316723.219340  7374351.549813 
-316747.034454  7374306.987446 
-316770.090915  7374257.545915 
-316778.394870  7374221.542082 
-316832.679806  7374073.027521 
-316851.415242  7374034.944044 
-316871.321643  7374009.388422 
-316890.378682  7373994.121037 
-316914.490660  7373973.824513 
-316935.188699  7373949.598663 
-316956.595914  7373917.974080 
-316980.105917  7373881.270367 
-316986.818349  7373857.984356 
-316989.267480  7373841.847120 
-316984.501158  7373823.620242 
-316978.069098  7373800.274241 
-316964.132969  7373773.188881 
-316956.109386  7373754.362105 
-316951.244110  7373728.056611 
-316948.407407  7373702.211038 
-316944.861528  7373682.124479 
-316940.655950  7373653.929309 
-316937.728538  7373635.722427 
-316935.675227  7373604.127839 
-316934.924820  7373590.940098 
-316940.705427  7373569.193823 
-316941.802176  7373555.026250 
-316936.854438  7373534.809713 
-316934.660940  7373523.151710 
-316942.099040  7373499.425774 
-316955.350733  7373491.177187 
-316965.971878  7373490.097372 
-316985.482460  7373487.677786 
-317002.939730  7373486.018070 
-317055.509450  7373481.368867 
-317082.153022  7373470.400745 
-317105.786719  7373456.193179 
-317124.777788  7373446.244883 
-317144.304862  7373442.055603 
-317186.072020  7373436.826496 
-317223.501661  7373436.076625 
-317248.067182  7373428.637899 
-317270.653608  7373416.959899 
-317285.331899  7373409.271216 
-317300.810073  7373402.492377 
-317319.355846  7373387.554936 
-317333.646564  7373378.206537 
-317352.901512  7373363.269096 
-317395.377847  7373334.234070 
-317409.808750  7373321.676221 
-317423.258352  7373314.207500 
-317444.360457  7373306.498820 
-317460.844672  7373301.389695 
-317477.254671  7373293.840988 
-317501.135755  7373292.031298 
-317528.480255  7373282.632908 
-317542.663772  7373281.263143 
-317559.881902  7373274.274340 
-317571.080283  7373267.775453 
-317582.509559  7373258.717005 
-317584.307237  7373245.669240 
-317582.930116  7373233.471329 
-317579.953227  7373219.033802 
-317569.661931  7373202.066709 
-317561.473424  7373188.569021 
-317551.388284  7373171.601927 
-317540.363074  7373156.284551 
-317527.342276  7373138.067671 
-317514.313231  7373119.960773 
-317510.635412  7373104.073494 
-317508.004865  7373078.007959 
-317506.231925  7373048.862951 
-317510.371533  7373027.976529 
-317516.547960  7373006.790158 
-317529.948084  7372979.484835 
-317543.884214  7372965.487232 
-317559.675746  7372950.399817 
-317580.184122  7372941.241386 
-317597.451729  7372930.273264 
-317611.445582  7372920.474943 
-317622.215159  7372906.877272 
-317628.292631  7372894.329421 
-317635.293681  7372872.153220 
-317639.004485  7372852.706551 
-317645.370575  7372833.509839 
-317651.852112  7372820.632045 
-317666.604619  7372806.864403 
-317682.734246  7372804.964729 
-317698.962828  7372804.054884 
-317725.276550  7372803.055056 
-317749.273081  7372800.145554 
-317773.187150  7372787.707685 
-317790.677405  7372775.749733 
-317807.928520  7372765.441499 
-317820.908087  7372755.193254 
-317833.871161  7372745.934840 
-317862.337149  7372720.379217 
-317874.079782  7372710.560899 
-317891.619514  7372694.053727 
-317909.390141  7372675.226951 
-317920.374121  7372661.629281 
-317936.446024  7372640.232946 
-317963.493661  7372613.427537 
-317978.221429  7372601.649555 
-317997.814473  7372584.062567 
-318025.002295  7372562.586246 
-318059.446801  7372547.958751 
-318075.741352  7372541.179912 
-318092.126613  7372535.290921 
-318134.817349  7372513.564643 
-318161.089839  7372507.695648 
-318185.729577  7372502.356563 
-318210.740394  7372499.677022 
-318243.947965  7372494.447917 
-318267.474461  7372488.318967 
-318289.318726  7372477.840762 
-318297.202123  7372467.312565 
-318297.795851  7372452.365126 
-318290.646369  7372420.710548 
-318285.896540  7372409.572456 
-318284.263787  7372393.375230 
-318285.657400  7372379.437617 
-318289.970178  7372368.859429 
-318298.150439  7372359.101101 
-318305.060780  7372353.102129 
-318318.279488  7372339.534453 
-318330.261261  7372327.166571 
-318344.510748  7372312.949006 
-318359.494149  7372305.160341 
-318381.528077  7372296.021906 
-318396.965021  7372292.782461 
-318415.956090  7372290.132915 
-318470.892479  7372283.514048 
-318487.500387  7372284.383899 
-318508.437567  7372297.721615 
-318514.960335  7372306.550102 
-318526.298902  7372320.867650 
-318535.303786  7372334.275353 
-318540.968947  7372346.193312 
-318555.564775  7372361.440700 
-318569.443181  7372368.149551 
-318584.335874  7372368.229537 
-318607.441812  7372363.090418 
-318704.508193  7372330.186054 
-318723.796126  7372320.237758 
-318737.484869  7372309.999512 
-318750.266527  7372290.882786 
-318775.269098  7372272.705900 
-318794.054011  7372254.219066 
-318812.533814  7372244.370753 
-318828.416055  7372245.900491 
-318848.380179  7372247.250260 
-318867.371248  7372245.050637 
-318879.006680  7372244.090801 
-318898.278121  7372236.242146 
-318923.041551  7372228.693439 
-318935.748993  7372215.445708 
-318948.068861  7372192.449647 
-318951.021012  7372176.432390 
-318951.392092  7372154.726109 
-318950.913811  7372119.492144 
-318946.831927  7372095.406269 
-318951.499293  7372064.231609 
-318962.475026  7372042.765286 
-318975.462839  7372031.517213 
-318999.747989  7372013.550291 
-319017.914435  7372003.691979 
-319036.847780  7371997.952962 
-319056.135714  7371996.643187 
-319083.999727  7372002.302217 
-319108.392077  7372008.591140 
-319125.131926  7372015.339984 
-319151.082814  7372027.067975 
-319173.240435  7372040.855614 
-319192.025349  7372047.184529 
-319227.533618  7372060.812195 
-319248.899601  7372064.281601 
-319269.185329  7372072.960114 
-319295.515543  7372079.049071 
-319317.161899  7372084.628116 
-319346.411279  7372093.856535 
-319371.496313  7372101.705191 
-319400.984833  7372107.834141 
-319418.928631  7372107.834141 
-319431.611334  7372104.664684 
-319450.940499  7372091.836881 
-319466.468151  7372080.958744 
-319493.474556  7372065.781344 
-319519.260519  7372057.912692 
-319544.914543  7372052.913548 
-319578.089129  7372042.025413 
-319595.670093  7372029.837501 
-319625.612156  7372008.171212 
-319641.667567  7371995.853322 
-319659.306255  7371979.126187 
-319670.249003  7371960.429390 
-319678.668404  7371939.273014 
-319688.629851  7371908.708249 
-319695.672132  7371867.485310 
-319702.590719  7371827.142221 
-319709.253674  7371791.448335 
-319717.524643  7371757.884084 
-319720.996306  7371724.579789 
-319851.616599  7371796.877405 
-319961.283221  7371840.549924 
-320018.198705  7371895.970431 
-320067.008144  7371996.263252 
-320110.432795  7372128.840542 
-320136.631069  7372243.690870 
-320124.162769  7372345.213480 
-320092.150901  7372509.195391 
-320090.666580  7372628.684924 
-320115.883553  7373012.569168 
-320192.961071  7373267.615481 
-320316.052556  7373438.506209 
-320515.083579  7373545.527877 
-320820.070419  7373594.159547 
-321080.857463  7373572.453265 
-321527.168205  7373538.189134 
-321630.056424  7373487.617796 
-321696.018023  7373413.670463 
-321843.188502  7373261.076601 
-322020.573169  7373089.026071 
-322101.674848  7373010.269562 
-322202.212892  7372976.615326 
-322287.462424  7372967.796837 
-322487.012959  7373033.715546 
-322895.605442  7373204.296327 
-323066.417863  7373296.880468 
-323129.781900  7373306.728781 
-323274.527986  7373343.382502 
-323479.669466  7373360.829514 
-323699.307819  7373418.219684 
-323823.100234  7373534.359790 
-323906.172761  7373704.610627 
-323913.907726  7373898.987332 
-323887.074491  7374043.092648 
-323820.238792  7374181.728901 
-323766.976388  7374445.023801 
-323784.664553  7374692.451419 
-323801.594064  7374893.696948 
-Region 1
-147
-331727.186525  7392674.131320 
-331692.156537  7392705.036027 
-331671.359543  7392723.602846 
-331650.760459  7392741.629758 
-331536.789305  7392841.392670 
-331390.410465  7392972.170269 
-331240.576454  7393109.116811 
-331168.628092  7393169.086539 
-331103.087051  7393230.246063 
-331028.846236  7393298.264412 
-330953.483934  7393366.462730 
-330894.861481  7393420.303508 
-330801.538889  7393511.227933 
-330699.302121  7393599.372835 
-330672.040082  7393625.528355 
-330568.887983  7393716.152831 
-330482.170622  7393807.187238 
-330396.962321  7393901.111150 
-330311.589095  7394000.004210 
-330299.277472  7393989.116075 
-330242.337250  7393938.754702 
-330202.763589  7393915.788636 
-330174.610957  7393904.330598 
-330108.591635  7393887.363505 
-330047.627252  7393895.972030 
-330016.943027  7393904.840511 
-329987.553461  7393916.498514 
-329950.049604  7393932.015856 
-329891.443643  7393959.711112 
-329852.232816  7393979.317754 
-329809.632789  7394000.004210 
-329804.668558  7394009.682552 
-329669.281943  7394074.731410 
-329569.453075  7394122.433239 
-329429.481556  7394185.712400 
-329165.090909  7394296.363447 
-328967.098911  7394382.238737 
-328917.778206  7394394.776589 
-328883.787243  7394426.091225 
-328792.913781  7394490.280230 
-328776.767662  7394451.716836 
-328758.881587  7394420.012267 
-328741.506779  7394402.505265 
-328700.630214  7394335.056819 
-328681.210341  7394304.881987 
-328660.767935  7394274.697158 
-328640.086389  7394247.831760 
-328585.743729  7394189.281789 
-328547.687374  7394140.350170 
-328519.881085  7394109.675424 
-328502.786649  7394094.478028 
-328460.178375  7394050.885495 
-328433.402864  7394028.089399 
-328415.277649  7394010.902343 
-328407.922011  7394004.773393 
-328324.610343  7393952.092417 
-328314.813821  7393925.137034 
-328303.780364  7393911.659343 
-328292.763400  7393893.282491 
-328287.856893  7393876.125429 
-328282.950386  7393863.877527 
-328277.969662  7393848.600144 
-328278.052125  7393832.432914 
-328279.173612  7393807.517181 
-328335.577830  7393715.922871 
-328367.169139  7393642.865385 
-328381.616535  7393612.350612 
-328401.423981  7393577.916510 
-328442.556180  7393518.476691 
-328572.013755  7393325.659719 
-328692.293275  7393143.760877 
-328775.011215  7393020.531985 
-328795.173249  7392990.087200 
-328810.478253  7392973.320072 
-328853.136004  7392939.925792 
-328907.462171  7392895.823346 
-328794.431088  7392739.210173 
-328715.795032  7392628.209186 
-328715.803279  7392628.199188 
-328800.821917  7392551.442336 
-328852.567014  7392483.274012 
-328945.617480  7392365.734146 
-329031.353541  7392255.433039 
-329106.567410  7392160.949224 
-329195.585470  7392048.128549 
-329195.593716  7392048.128549 
-329234.936483  7391999.966798 
-329270.551953  7391949.105511 
-329351.966988  7391848.712707 
-329393.998026  7391790.282715 
-329453.948122  7391717.875118 
-329473.912247  7391695.848891 
-329514.549671  7391660.544938 
-329486.627935  7391638.178769 
-329470.308644  7391628.130491 
-329472.856729  7391593.276461 
-329474.926533  7391573.469854 
-329485.481708  7391517.889374 
-329503.978004  7391411.327627 
-329521.756877  7391313.744342 
-329527.215882  7391291.428165 
-329543.898006  7391183.196704 
-329547.419147  7391152.122027 
-329558.535066  7391100.580855 
-329558.765960  7391099.081112 
-329586.671205  7390947.337104 
-329588.922426  7390912.033152 
-329591.313833  7390864.321324 
-329583.422190  7390823.248360 
-329684.768365  7390895.316015 
-329742.887798  7390927.450511 
-329789.462509  7390960.114916 
-329836.202144  7390988.010137 
-329893.736095  7391025.903647 
-330043.256749  7391125.106654 
-330125.809764  7391177.297714 
-330205.006564  7391226.889220 
-330282.422177  7391276.850662 
-330364.488664  7391331.081372 
-330388.782060  7391339.559920 
-330454.281870  7391387.281746 
-330490.524053  7391405.308658 
-330537.601784  7391447.391450 
-330564.690652  7391470.517488 
-330605.517740  7391515.519780 
-330653.477817  7391561.041982 
-330672.823474  7391582.798256 
-330735.577290  7391647.837115 
-330804.053989  7391714.025778 
-330840.279680  7391748.169929 
-330879.259612  7391793.582150 
-330950.474060  7391859.860797 
-330984.069204  7391894.364887 
-331016.509875  7391928.729001 
-331075.998183  7391991.998163 
-331142.306124  7392053.467634 
-331175.521941  7392089.601445 
-331228.330802  7392143.752169 
-331268.399237  7392184.845130 
-331314.891485  7392231.127203 
-331393.346123  7392309.223826 
-331477.012380  7392393.809337 
-331512.965945  7392428.223442 
-331552.696284  7392470.546192 
-331642.151394  7392566.939681 
-331708.401611  7392647.115948 
-331727.186525  7392674.131320 
-Region 1
-383
-320638.224541  7383590.747222 
-320687.718417  7383585.908051 
-320748.649815  7383586.048027 
-320869.811682  7383587.047855 
-321023.843025  7383594.726540 
-321065.065932  7383592.166978 
-321131.044023  7383583.028544 
-321225.537580  7383548.284495 
-321241.790901  7383541.465663 
-321241.840378  7383525.508396 
-321235.193916  7383501.942433 
-321229.141183  7383471.627626 
-321223.830610  7383447.091829 
-321207.123747  7383386.852147 
-321193.228848  7383354.447698 
-321162.288991  7383272.211784 
-321147.503499  7383233.668386 
-321024.337798  7382972.973041 
-321031.734667  7382962.804783 
-321018.656146  7382946.517572 
-321010.294468  7382930.870253 
-320994.082378  7382905.194651 
-320986.669017  7382885.158083 
-320971.957741  7382853.743464 
-320961.575737  7382835.016671 
-320946.757261  7382812.120593 
-320937.537975  7382798.382946 
-320926.050975  7382778.636329 
-320915.932850  7382755.370314 
-320903.415072  7382735.833661 
-320890.179872  7382717.276839 
-320878.231084  7382693.430924 
-320862.018994  7382667.315397 
-320853.822241  7382645.279172 
-320845.757428  7382620.703381 
-320843.844302  7382602.516497 
-320847.810739  7382586.619220 
-320850.564980  7382561.723484 
-320854.127352  7382537.287670 
-320850.457779  7382521.080446 
-320844.479262  7382509.372451 
-320839.102719  7382498.234359 
-320826.189122  7382486.776322 
-320814.669138  7382477.767865 
-320797.797350  7382464.050215 
-320785.254833  7382455.031759 
-320767.014171  7382445.283429 
-320752.789423  7382432.265659 
-320737.476173  7382416.008444 
-320731.745043  7382400.881035 
-320724.587314  7382385.393688 
-320715.640154  7382366.566913 
-320721.544455  7382351.019576 
-320734.886857  7382336.232109 
-320740.123213  7382325.223994 
-320744.980243  7382312.096243 
-320747.701499  7382298.068646 
-320745.293600  7382286.410643 
-320742.407419  7382272.742984 
-320737.261771  7382251.306656 
-320725.947942  7382217.052523 
-320720.291028  7382196.386063 
-320717.660481  7382177.849238 
-320712.547818  7382153.643385 
-320704.656175  7382132.167063 
-320692.963020  7382111.870540 
-320680.742106  7382093.993602 
-320675.085192  7382086.444895 
-320656.407479  7382064.788605 
-320644.640108  7382051.350906 
-320630.860657  7382035.233667 
-320611.539738  7382013.397407 
-320597.479915  7381995.050550 
-320583.733449  7381976.503727 
-320573.277228  7381955.987241 
-320564.577455  7381941.479726 
-320554.434591  7381920.203371 
-320537.315416  7381901.936500 
-320525.300658  7381891.488289 
-320503.085313  7381881.360024 
-320447.307809  7381853.864734 
-320433.503619  7381839.847135 
-320413.193153  7381816.231180 
-320400.444480  7381799.124110 
-320396.412073  7381787.226148 
-320386.063054  7381765.499870 
-320373.009271  7381749.162668 
-320360.458508  7381732.615503 
-320353.473950  7381727.986296 
-320343.372318  7381719.887683 
-320341.970459  7381709.239507 
-320344.493805  7381703.180545 
-320349.688931  7381695.711824 
-320352.855483  7381687.443240 
-320350.843403  7381676.565104 
-320345.689509  7381664.427183 
-320338.531780  7381641.081182 
-320337.402047  7381625.003936 
-320339.166740  7381606.307138 
-320341.088112  7381591.159733 
-320344.774177  7381573.262798 
-320345.301936  7381546.787333 
-320355.131443  7381519.442017 
-320361.316116  7381481.088587 
-320363.509613  7381452.533478 
-320363.625060  7381409.780801 
-320359.906010  7381389.024357 
-320357.176508  7381370.047607 
-320343.718660  7381336.433365 
-320337.987529  7381313.107361 
-320327.918882  7381285.842031 
-320316.266958  7381254.357424 
-320309.018521  7381230.011594 
-320308.235129  7381218.973485 
-320351.280453  7381230.551502 
-320363.550844  7381219.963315 
-320433.602574  7381182.149793 
-320449.303397  7381174.281140 
-320468.912933  7381152.014954 
-320488.654409  7381141.596739 
-320488.646163  7381141.576742 
-320506.936303  7381112.161781 
-320518.060468  7381092.295184 
-320543.500089  7381055.721449 
-320543.500089  7381046.982945 
-320553.717169  7380997.491423 
-320556.652827  7380982.254033 
-320556.463164  7380947.679955 
-320561.781983  7380930.922825 
-320571.067238  7380889.969840 
-320617.122437  7380787.107460 
-320638.892486  7380733.796591 
-320654.049057  7380685.994779 
-320659.557540  7380643.961979 
-320665.923630  7380576.403551 
-320770.048784  7380593.890556 
-320928.227980  7380616.146744 
-320944.134959  7380613.757153 
-320992.985630  7380612.847309 
-321054.222138  7380595.880215 
-321107.781406  7380582.422520 
-321165.505021  7380576.803483 
-321242.269182  7380571.744350 
-321301.732751  7380569.174790 
-321333.777603  7380568.084976 
-321357.708165  7380566.955170 
-321484.147619  7380563.855701 
-321524.636612  7380555.717095 
-321549.416535  7380548.378352 
-321565.298775  7380541.949453 
-321579.688448  7380539.779825 
-321596.321095  7380535.280595 
-321622.890450  7380534.900661 
-321613.662918  7380485.939047 
-321613.836089  7380465.512546 
-321610.949908  7380432.868138 
-321606.282541  7380393.574868 
-321593.443160  7380349.462424 
-321573.858363  7380307.589597 
-321548.657882  7380268.376314 
-321540.708515  7380182.531018 
-321538.745912  7380162.824394 
-321593.286482  7380120.951566 
-321622.469892  7380086.707432 
-321647.357016  7380037.795810 
-321662.282694  7380001.392046 
-321678.230904  7379973.766778 
-321683.401290  7379946.841390 
-321678.626723  7379918.226291 
-321668.285950  7379867.355005 
-321656.716488  7379836.780242 
-321653.417996  7379810.524740 
-321631.235635  7379786.138917 
-321578.146402  7379727.798910 
-321551.189474  7379698.044006 
-321509.570748  7379661.720228 
-321488.872709  7379634.864828 
-321451.212174  7379591.942181 
-321418.227252  7379575.455005 
-321411.885900  7379570.375875 
-321382.702490  7379556.428264 
-321364.948355  7379545.010220 
-321323.082242  7379512.025870 
-321305.319862  7379480.311302 
-321278.676290  7379466.353693 
-321245.592413  7379419.461725 
-321213.333159  7379366.700763 
-321233.726087  7379338.945517 
-321262.324015  7379298.332473 
-321308.956449  7379220.105873 
-321340.547759  7379131.341078 
-321415.687412  7378996.984092 
-321423.298683  7378924.666479 
-321405.272423  7378864.896717 
-321370.019787  7378825.723427 
-321224.712957  7378714.632456 
-321110.378969  7378603.311524 
-320999.590860  7378490.820793 
-320987.130806  7378405.445417 
-320973.483294  7378326.508938 
-320940.382924  7378246.772596 
-320932.359342  7378199.020776 
-320938.700693  7378147.009685 
-320950.113476  7378116.554901 
-320978.026967  7378042.977504 
-320997.356132  7378016.532034 
-321055.417842  7377960.361656 
-321247.093227  7377890.583608 
-321425.846769  7377844.301536 
-321611.758039  7377807.797789 
-321604.047813  7377768.444529 
-321514.757627  7377376.651640 
-321575.021081  7377366.143440 
-321575.021081  7377366.123443 
-321597.722954  7376956.403625 
-321932.519918  7376293.277212 
-322310.749779  7375670.223936 
-322504.519707  7375393.701301 
-322777.700836  7375177.838277 
-323049.917156  7375031.743302 
-323341.363686  7374955.656335 
-323801.594064  7374893.696948 
-323830.991877  7375319.813958 
-323848.416162  7375581.529128 
-323918.509122  7375990.759031 
-324051.281682  7376201.592917 
-324248.828383  7376428.054126 
-324408.862982  7376720.733993 
-324487.457806  7376976.990098 
-324472.144556  7377282.387787 
-324406.422097  7377564.029544 
-324238.100037  7377972.139638 
-324026.510005  7378414.503865 
-323973.354802  7378626.637529 
-323963.170708  7378827.653097 
-324022.238458  7379087.548579 
-324080.943374  7379378.448750 
-324081.124791  7379691.785079 
-324026.839854  7379996.832827 
-324011.930669  7380259.707799 
-324000.625087  7380553.637451 
-323946.892648  7380812.163168 
-323874.573205  7380996.921521 
-323826.827530  7381081.517030 
-323818.704993  7381111.991810 
-323818.366897  7381140.116992 
-323825.788505  7381167.232348 
-323844.119876  7381186.838989 
-323868.734874  7381209.735067 
-323890.100858  7381222.952803 
-323963.822160  7381251.417928 
-323977.057360  7381261.886134 
-323983.934716  7381275.593786 
-323989.781294  7381281.202826 
-324002.249595  7381287.661719 
-324036.941487  7381303.918935 
-324056.394345  7381315.226998 
-324075.047319  7381333.063942 
-324101.624920  7381371.377380 
-324109.557794  7381390.304138 
-324118.537939  7381415.449830 
-324122.776502  7381436.096294 
-324135.541667  7381511.013461 
-324155.843887  7381595.289026 
-324175.758534  7381669.226361 
-324199.994205  7381780.527296 
-324223.982490  7381849.565470 
-324232.286445  7381896.847371 
-324248.927338  7381988.431684 
-324271.241638  7382109.540939 
-324291.131547  7382177.559288 
-324314.237485  7382260.205131 
-324327.876750  7382319.554965 
-324344.624845  7382411.139278 
-324364.555984  7382476.168139 
-324387.332073  7382550.215455 
-324410.421519  7382606.425827 
-324445.385537  7382651.038185 
-324498.243876  7382692.990999 
-324560.181314  7382717.326831 
-324599.796206  7382757.349975 
-324485.470464  7382897.405985 
-324348.484081  7383072.525988 
-324269.394483  7383182.247194 
-324125.341079  7383355.677487 
-324019.278061  7383516.219987 
-323953.341201  7383679.621998 
-323921.807615  7383874.558607 
-323928.148966  7384066.155788 
-323728.169627  7384084.122711 
-323699.472744  7384089.841731 
-323606.249106  7384104.849161 
-323589.789630  7384105.998964 
-323441.052368  7384131.334624 
-323322.793174  7384149.761468 
-323161.859737  7384177.386736 
-323078.960380  7384203.872199 
-322988.796094  7384222.379029 
-322931.303374  7384234.286989 
-322910.539365  7384221.019262 
-322840.990656  7384241.535747 
-322787.480866  7384251.524037 
-322738.811612  7384262.722118 
-322708.836564  7384281.078974 
-322610.731158  7384319.912322 
-322522.686153  7384344.338138 
-322460.493082  7384351.596895 
-322367.632278  7384363.044934 
-322328.660592  7384359.775494 
-322295.956042  7384351.596895 
-322274.491103  7384349.557244 
-322237.696422  7384352.616720 
-322189.530189  7384367.514169 
-322155.596950  7384379.062190 
-322111.306445  7384395.289411 
-322071.551367  7384407.907250 
-322030.023349  7384421.074994 
-321989.361186  7384430.293415 
-321947.701229  7384445.590795 
-321889.136499  7384481.294679 
-321851.096637  7384497.921831 
-321833.012653  7384506.790312 
-321817.715895  7384401.698313 
-321797.677555  7384296.126397 
-321789.068490  7384249.274422 
-321778.942119  7384218.029774 
-321761.146753  7384188.014915 
-321732.367408  7384163.739073 
-321715.751253  7384145.592182 
-321689.676672  7384124.675765 
-321649.204172  7384096.930517 
-321620.029008  7384088.272000 
-321600.765813  7384077.953768 
-321584.108427  7384063.126307 
-321575.590071  7384050.838412 
-321560.433499  7384038.360550 
-321547.305500  7384027.342437 
-321533.113737  7384019.523776 
-321516.431612  7384007.255877 
-321503.567492  7383999.227253 
-321484.032172  7383986.469438 
-321458.056546  7383966.332887 
-321441.407406  7383959.364081 
-321424.073829  7383950.405615 
-321409.098674  7383948.225989 
-321388.103771  7383945.976374 
-321371.908174  7383943.786749 
-321345.479005  7383943.796747 
-321320.212554  7383942.956891 
-321298.879555  7383941.117206 
-321281.455270  7383931.048931 
-321257.310307  7383911.702245 
-321244.388463  7383890.785828 
-321225.636535  7383856.811647 
-321215.262777  7383854.032123 
-321200.815381  7383858.611339 
-321192.907245  7383863.060577 
-321181.494462  7383864.760286 
-321116.423456  7383877.238148 
-321049.439325  7383888.656193 
-321018.862301  7383877.318135 
-320976.806525  7383870.599286 
-320949.008481  7383865.490161 
-320918.637614  7383854.372065 
-320896.191374  7383846.343440 
-320866.900763  7383841.424283 
-320865.935954  7383830.506153 
-320842.401212  7383822.647499 
-320820.952766  7383807.760049 
-320808.426741  7383797.301841 
-320797.846827  7383786.323721 
-320778.971206  7383770.026513 
-320760.293493  7383761.717936 
-320749.441454  7383756.378850 
-320730.813219  7383744.510883 
-320717.248169  7383736.372277 
-320700.632014  7383718.005423 
-320687.132935  7383703.987825 
-320676.635483  7383686.250863 
-320664.925836  7383667.943999 
-320657.281580  7383642.378378 
-320646.347078  7383619.092366 
-320638.224541  7383590.747222 
-Region 1
-697
-354118.226078  7396716.718862 
-354125.688917  7396694.322698 
-354139.691016  7396662.578135 
-354159.292306  7396625.244530 
-354180.757245  7396600.978687 
-354219.687700  7396565.964684 
-354256.366934  7396534.700040 
-354421.027667  7396421.199481 
-354519.479415  7396289.981958 
-354563.341116  7396234.481464 
-354612.463912  7396189.679139 
-354659.756044  7396137.478080 
-354708.689177  7396083.657299 
-354751.882933  7396032.606044 
-354559.861206  7395710.631195 
-354581.408607  7395691.084543 
-354551.953071  7395633.974326 
-354544.490232  7395619.976724 
-354526.529942  7395587.632264 
-354522.563505  7395555.887701 
-354523.363389  7395517.804225 
-354532.970248  7395469.552490 
-354513.838993  7395420.990808 
-354488.712728  7395367.290007 
-354466.373689  7395330.736268 
-354453.451846  7395304.170818 
-354442.418389  7395257.528808 
-354434.493762  7395215.226054 
-354430.510832  7395194.039683 
-354431.516873  7395169.923814 
-354430.510832  7395158.335798 
-354437.017108  7395132.460231 
-354442.352420  7395084.338474 
-354442.418389  7395072.630479 
-354458.275891  7395015.500265 
-354465.433619  7394985.345430 
-354474.158131  7394967.888420 
-354494.699492  7394904.699244 
-354509.856064  7394841.720032 
-354536.318218  7394744.396702 
-354581.276667  7394600.481354 
-354616.207700  7394514.786033 
-354636.147086  7394477.262460 
-354629.921182  7394474.212983 
-354623.753001  7394471.743406 
-354619.563916  7394470.013702 
-354611.177500  7394466.074377 
-354602.799329  7394462.375010 
-354595.155074  7394461.145221 
-354587.510818  7394460.405348 
-354581.095250  7394458.925601 
-354562.112427  7394426.001241 
-354549.429725  7394408.144299 
-354543.245052  7394396.946218 
-354534.842143  7394381.178918 
-354526.150615  7394367.921189 
-354511.546541  7394360.402477 
-354499.144210  7394358.212852 
-354488.077769  7394351.494003 
-354486.948035  7394341.885649 
-354487.582995  7394332.547249 
-354492.011221  7394324.778579 
-354499.770924  7394314.270379 
-354510.837365  7394302.802344 
-354521.169892  7394289.804570 
-354527.247364  7394272.467540 
-354530.809736  7394254.070691 
-354529.886158  7394247.751773 
-354526.356771  7394227.995157 
-354521.532726  7394210.758110 
-354516.700435  7394193.521062 
-354515.917043  7394177.343834 
-354519.429937  7394161.976466 
-354524.847711  7394155.487577 
-354529.787203  7394146.969036 
-354528.921349  7394136.350855 
-354526.587666  7394122.423241 
-354518.918671  7394108.675596 
-354513.467913  7394099.007252 
-354504.149672  7394076.401124 
-354493.619236  7394049.735692 
-354485.983226  7394033.718435 
-354478.652327  7394014.171783 
-354479.815045  7394003.333640 
-354481.794141  7393988.956103 
-354477.901920  7393977.288101 
-354474.248840  7393966.879884 
-354469.078453  7393955.701799 
-354459.331409  7393945.213595 
-354454.466132  7393930.746073 
-354449.073098  7393917.538336 
-354444.479947  7393901.061158 
-354442.476113  7393881.584494 
-354437.602591  7393867.626885 
-354432.151832  7393858.208499 
-354418.652753  7393844.390865 
-354404.576437  7393834.852499 
-354399.117432  7393826.443939 
-354389.609528  7393816.715606 
-354384.752499  7393801.748170 
-354381.668408  7393786.800730 
-354384.265971  7393764.614530 
-354385.898725  7393738.618983 
-354387.399539  7393722.471749 
-354391.390714  7393709.393989 
-354391.885488  7393691.966974 
-354389.815684  7393676.789574 
-354529.811942  7393517.606840 
-354668.934099  7393361.813526 
-354818.058934  7393317.371139 
-354851.695309  7393306.463008 
-354866.489047  7393300.853968 
-354888.572452  7393299.884134 
-354902.294180  7393298.304405 
-354929.457264  7393297.154602 
-354949.264710  7393295.914814 
-354976.254623  7393288.696051 
-355001.182978  7393283.736900 
-355022.268590  7393281.747241 
-355053.744452  7393280.407471 
-355090.522641  7393280.907385 
-355112.045303  7393283.976859 
-355141.641025  7393289.935838 
-355124.224986  7393265.450033 
-355109.835313  7393260.710844 
-355103.526947  7393258.091293 
-355091.462711  7393250.602576 
-355083.439129  7393243.933718 
-355077.707999  7393236.524987 
-355072.479888  7393229.636167 
-355067.639351  7393212.649077 
-355065.272683  7393201.001072 
-355064.695447  7393188.113280 
-355063.837839  7393176.735229 
-355063.087432  7393158.288388 
-355063.252356  7393146.670379 
-355061.405201  7393133.512632 
-355056.012166  7393102.367967 
-355047.089744  7393087.600497 
-355034.110177  7393072.773036 
-355016.108656  7393054.086237 
-354999.830596  7393038.968827 
-354988.590984  7393026.440973 
-354977.343125  7393014.922946 
-354967.381679  7393001.905176 
-354963.489458  7392989.977219 
-354955.169011  7392968.400914 
-354950.064594  7392952.413653 
-354943.005821  7392931.607217 
-354929.803606  7392878.386333 
-354928.022420  7392843.002394 
-354925.713475  7392809.378154 
-354921.491405  7392767.135389 
-354910.276531  7392734.660952 
-354901.675713  7392697.407333 
-354889.834126  7392655.824456 
-354878.866639  7392623.849933 
-354864.806816  7392596.134680 
-354848.908083  7392572.178784 
-354831.046747  7392543.643672 
-354812.954517  7392513.598818 
-354785.354383  7392474.065590 
-354762.627772  7392394.719181 
-354781.214776  7392295.576163 
-354843.127475  7392234.066699 
-354857.385208  7392217.039616 
-354876.161875  7392196.853074 
-354899.556432  7392174.716865 
-354936.483052  7392145.951793 
-354968.297010  7392118.366518 
-355011.391812  7392085.682116 
-355034.233871  7392067.855170 
-355052.721920  7392056.187168 
-355068.018677  7392047.368679 
-355087.191164  7392038.480201 
-355107.600585  7392028.941835 
-355126.410237  7392025.912354 
-355148.097823  7392021.473115 
-355163.345104  7392017.083866 
-355193.072765  7391994.347761 
-355206.629568  7391986.179160 
-355223.072552  7391974.271200 
-355240.406129  7391965.912632 
-355261.302078  7391958.703866 
-355283.913242  7391953.384778 
-355303.588748  7391945.826072 
-355323.734290  7391941.596797 
-355337.439525  7391939.297191 
-355363.266720  7391939.107223 
-355353.264042  7391928.599023 
-355347.483434  7391924.559715 
-355339.393882  7391906.762763 
-355347.293771  7391891.885312 
-355349.916072  7391884.936502 
-355355.828620  7391875.688086 
-355364.759287  7391870.688943 
-355379.132467  7391861.860455 
-355394.825044  7391843.833543 
-355405.429697  7391834.875077 
-355413.849098  7391829.975916 
-355419.473028  7391829.036077 
-355430.605439  7391827.926267 
-355438.480589  7391826.346538 
-355445.869212  7391822.317228 
-355462.567829  7391796.131714 
-355469.272015  7391788.662993 
-355474.607326  7391786.173419 
-355485.055300  7391782.064123 
-355491.924410  7391779.584548 
-355496.872149  7391774.655392 
-355502.059028  7391765.846901 
-355506.949042  7391756.808449 
-355511.773087  7391743.790679 
-355515.937434  7391735.192152 
-355521.190283  7391719.854779 
-355524.183664  7391706.597050 
-355529.197373  7391695.019033 
-355535.753126  7391682.011261 
-355543.026301  7391669.233450 
-355551.660105  7391652.936242 
-355556.451165  7391633.269610 
-355556.409934  7391606.464202 
-355555.709004  7391583.978054 
-355550.777758  7391556.692727 
-355549.136758  7391525.778023 
-355545.599125  7391511.900400 
-355542.251156  7391500.242397 
-355534.202835  7391477.346319 
-355530.063227  7391462.688829 
-355528.100624  7391444.951868 
-355528.587152  7391426.565017 
-355530.879604  7391411.417612 
-355533.543136  7391399.599636 
-355539.158819  7391379.503078 
-355550.200522  7391356.577005 
-355557.242803  7391329.411659 
-355581.173364  7391343.589230 
-355603.792775  7391364.085719 
-355644.100350  7390990.169768 
-355650.878752  7390846.134440 
-355633.932748  7390737.683016 
-355635.631472  7390690.231144 
-355622.066422  7390639.399851 
-355606.819142  7390600.426527 
-355584.793460  7390575.010881 
-355559.370331  7390561.453203 
-355527.177046  7390542.806397 
-355493.293284  7390512.311620 
-355471.259356  7390476.727716 
-355456.003829  7390427.586133 
-355449.233674  7390371.665712 
-355439.057825  7390324.213840 
-355400.086139  7390256.435450 
-355366.185885  7390205.594158 
-355337.348817  7390159.572041 
-355320.130687  7390172.009911 
-355308.891075  7390173.339683 
-355297.437060  7390175.769267 
-355290.262840  7390178.688767 
-355281.150755  7390181.148346 
-355269.639017  7390189.566904 
-355266.010675  7390195.395905 
-355257.599520  7390199.525198 
-355234.163733  7390206.044081 
-355215.741653  7390210.843259 
-355202.044664  7390213.252846 
-355187.811670  7390217.652093 
-355170.387385  7390225.230795 
-355153.119778  7390227.280444 
-355131.935211  7390233.049455 
-355121.322312  7390232.939474 
-355114.494433  7390232.429562 
-355099.502786  7390230.959813 
-355086.036691  7390230.269932 
-355074.640401  7390226.610558 
-355068.851547  7390224.011004 
-355060.019834  7390219.381797 
-355050.660362  7390216.402307 
-355040.632946  7390208.773614 
-355032.650594  7390200.285068 
-355021.988218  7390194.855998 
-355008.711787  7390185.087671 
-354994.338607  7390173.099724 
-354979.759271  7390161.991627 
-354966.177729  7390152.223300 
-354947.293861  7390141.955059 
-354935.707907  7390136.745951 
-354922.472707  7390134.066410 
-354915.727290  7390124.368072 
-354910.482687  7390117.999162 
-354905.048421  7390110.420461 
-354899.993482  7390105.271343 
-354889.941327  7390100.082232 
-354883.501021  7390101.571976 
-354881.035398  7390102.981735 
-354876.120644  7390104.931401 
-354872.855137  7390104.891408 
-354866.225167  7390103.831589 
-354863.487419  7390102.811764 
-354856.906927  7390097.092744 
-354855.232942  7390091.323732 
-354850.483113  7390086.514556 
-354842.830611  7390085.654703 
-354835.977993  7390087.254429 
-354825.546512  7390089.913973 
-354813.911080  7390089.803992 
-354805.219553  7390091.263742 
-354791.745212  7390091.573689 
-354772.284108  7390088.284252 
-354762.899897  7390087.414401 
-354752.707556  7390086.314590 
-354740.577351  7390084.644876 
-354731.951794  7390079.465763 
-354726.517528  7390072.316987 
-354721.437850  7390069.497470 
-354716.011830  7390061.588825 
-354711.938192  7390060.549003 
-354701.020183  7390060.439022 
-354695.874535  7390064.598310 
-354688.700314  7390067.067887 
-354680.792179  7390071.977046 
-354669.593798  7390079.945681 
-354655.591698  7390082.025324 
-354645.184955  7390081.145475 
-354634.266945  7390081.035494 
-354619.275298  7390080.335614 
-354609.734409  7390075.146503 
-354601.380978  7390072.846897 
-354595.823018  7390067.697779 
-354593.101762  7390064.128390 
-354589.893978  7390058.229401 
-354587.378878  7390054.660012 
-354584.542175  7390052.410397 
-354575.999080  7390049.230942 
-354568.363070  7390047.381259 
-354564.099769  7390045.121646 
-354562.623694  7390040.012521 
-354561.963995  7390034.473470 
-354556.356558  7390033.643612 
-354551.037740  7390035.363317 
-354546.370373  7390042.292130 
-354546.007539  7390048.371089 
-354538.058173  7390056.939621 
-354528.632731  7390061.048918 
-354519.908219  7390065.498155 
-354512.024822  7390068.637618 
-354506.862682  7390073.896717 
-354500.999612  7390079.155816 
-354490.741301  7390083.815018 
-354487.467547  7390085.004814 
-354478.784267  7390085.244773 
-354475.527006  7390084.664872 
-354469.457780  7390079.725718 
-354466.744770  7390075.156501 
-354465.293433  7390067.397830 
-354462.390760  7390061.718803 
-354460.403419  7390056.159755 
-354458.251152  7390046.501409 
-354452.998303  7390040.912367 
-354449.658580  7390037.892884 
-354441.313395  7390036.263163 
-354436.002822  7390036.203173 
-354429.174943  7390035.583280 
-354426.948461  7390033.013720 
-354423.122210  7390027.994579 
-354419.700024  7390023.305383 
-354408.979924  7390023.975268 
-354399.406050  7390022.105588 
-354394.120217  7390019.286071 
-354391.069111  7390018.926133 
-354389.386880  7390013.367085 
-354384.002092  7390010.767530 
-354381.808594  7390005.208483 
-354378.773981  7390002.858885 
-354365.637736  7390000.179344 
-354362.867002  7390001.699084 
-354361.522867  7390002.908876 
-354359.444817  7390007.198142 
-354356.888485  7390007.178145 
-354349.557586  7390005.888366 
-354347.025993  7390003.758731 
-354344.486154  7390002.179001 
-354340.552702  7389997.379823 
-354337.831446  7389994.580303 
-354332.240502  7389991.760786 
-354323.103678  7389987.131579 
-354315.772779  7389985.501858 
-354289.244655  7389974.493744 
-354269.330008  7389965.105352 
-354255.360893  7389963.975545 
-354238.085040  7389966.785064 
-354230.176905  7389951.757638 
-354226.012559  7389939.319769 
-354218.252856  7389929.381471 
-354212.496987  7389922.792600 
-354205.726831  7389916.413692 
-354198.610334  7389914.014103 
-354186.240988  7389905.475566 
-354180.748999  7389903.645879 
-354163.547361  7389899.156648 
-354152.629352  7389898.276799 
-354141.397986  7389898.936686 
-354119.545475  7389900.156477 
-354112.981475  7389903.635881 
-354099.012360  7389902.386095 
-354085.546266  7389901.806194 
-354064.361699  7389907.575206 
-354053.905479  7389912.454370 
-354043.234856  7389917.883441 
-354032.102445  7389928.411637 
-354028.762722  7389935.680392 
-354024.598375  7389943.948976 
-354022.124506  7389956.766780 
-354020.293843  7389966.385133 
-354019.023923  7389981.212593 
-354018.933215  7389990.620981 
-354018.883737  7389995.160204 
-354017.514863  7389999.139522 
-354012.707310  7390000.859228 
-354006.365959  7390001.799067 
-354000.032854  7390002.728907 
-353993.386392  7390003.878710 
-353988.784995  7390004.608585 
-353982.814724  7389999.789411 
-353979.994513  7389995.660118 
-353974.733418  7389991.070904 
-353966.190323  7389988.441355 
-353962.825861  7389987.631493 
-353953.260234  7389985.201909 
-353951.041998  7389981.972463 
-353945.492284  7389976.273439 
-353944.560460  7389967.174997 
-353941.872189  7389960.616121 
-353940.717717  7389952.967431 
-353938.590189  7389941.429407 
-353934.343381  7389937.290116 
-353926.509462  7389935.210473 
-353919.887738  7389933.600748 
-353904.368332  7389934.110661 
-353895.487142  7389935.020505 
-353879.266806  7389934.080666 
-353862.980501  7389939.669709 
-353852.210923  7389944.878816 
-353849.794778  7389952.387530 
-353844.871778  7389964.745413 
-353839.899301  7389971.784208 
-353837.606849  7389976.293435 
-353827.134136  7389983.172257 
-353804.382786  7389992.020741 
-353792.401012  7389996.439984 
-353771.653496  7390009.747705 
-353762.203316  7390015.746677 
-353729.878092  7390022.945444 
-353713.814434  7390026.774788 
-353703.415938  7390025.564996 
-353691.912446  7390011.767359 
-353645.263519  7390001.399135 
-353598.218773  7389995.020228 
-353549.120716  7390004.458611 
-353540.338480  7390014.076963 
-353529.626627  7390023.485352 
-353514.585502  7390047.701204 
-353508.516276  7390053.070284 
-353503.667493  7390057.559515 
-353496.254131  7390064.238371 
-353487.339956  7390068.137703 
-353477.691866  7390072.916885 
-353473.181178  7390075.526438 
-353471.012419  7390077.606081 
-353467.177922  7390083.885006 
-353462.131229  7390088.044293 
-353454.148878  7390090.503872 
-353445.465597  7390090.753829 
-353435.998924  7390088.994131 
-353424.297523  7390084.784852 
-353416.282186  7390080.155645 
-353409.239905  7390070.237344 
-353400.490655  7390057.189579 
-353392.170208  7390042.492096 
-353386.232922  7390033.563626 
-353382.513872  7390029.434333 
-353374.828385  7390020.825807 
-353363.910376  7390010.307609 
-353355.515713  7390002.918875 
-353347.071573  7390000.169346 
-353332.805594  7389999.089531 
-353313.113595  7389997.729764 
-353302.179093  7389998.729592 
-353284.276526  7390002.758902 
-353272.698818  7390007.728051 
-353258.358623  7390012.907164 
-353248.504378  7390018.226253 
-353237.800770  7390027.204715 
-353230.016329  7390040.412452 
-353225.423178  7390050.670695 
-353220.467194  7390055.709832 
-353202.721305  7390064.618306 
-353191.935235  7390072.256998 
-353188.842899  7390074.776566 
-353186.138135  7390079.625736 
-353180.365774  7390096.172901 
-353176.564262  7390108.430801 
-353173.381217  7390113.969853 
-353171.064026  7390117.449257 
-353165.102001  7390121.598546 
-353156.699092  7390124.837991 
-353145.327540  7390129.157251 
-353140.404540  7390131.876785 
-353137.823470  7390135.056241 
-353137.460636  7390140.035388 
-353139.151113  7390144.934549 
-353142.383636  7390147.954032 
-353149.401178  7390150.353620 
-353156.443459  7390150.643571 
-353170.025001  7390149.443776 
-353174.923262  7390149.943691 
-353178.164030  7390152.303287 
-353180.266819  7390156.082639 
-353180.233834  7390159.742012 
-353178.040337  7390164.921125 
-353174.494458  7390172.529822 
-353170.462051  7390177.688938 
-353167.592363  7390178.768753 
-353161.984926  7390177.828914 
-353157.301067  7390176.789092 
-353154.060298  7390174.649459 
-353149.368193  7390174.379505 
-353146.284103  7390176.009226 
-353143.909188  7390178.978717 
-353143.463892  7390183.177998 
-353143.117550  7390186.497429 
-353145.566681  7390197.265585 
-353146.490258  7390206.573990 
-353145.220339  7390211.213196 
-353141.913600  7390215.392480 
-353137.411158  7390216.232336 
-353132.521144  7390215.742420 
-353122.939024  7390213.982721 
-353107.452602  7390211.723108 
-353095.107995  7390211.373168 
-353089.401604  7390210.433329 
-353081.468730  7390207.583817 
-353069.569419  7390203.474521 
-353061.653037  7390199.185256 
-353053.728410  7390195.565876 
-353042.027009  7390191.796522 
-353032.238733  7390190.476748 
-353026.301447  7390192.526397 
-353022.805045  7390195.475891 
-353019.687970  7390200.205081 
-353017.477980  7390206.943927 
-353015.985412  7390213.902735 
-353015.457653  7390225.300783 
-353016.084367  7390233.949301 
-353015.977166  7390244.907424 
-353014.459859  7390253.755909 
-353009.693538  7390260.684722 
-353004.234533  7390265.723859 
-352998.387956  7390268.543376 
-352986.637077  7390269.753168 
-352982.654148  7390269.933138 
-352975.834515  7390268.533377 
-352962.690023  7390266.303759 
-352952.909994  7390264.324098 
-352938.644015  7390262.294446 
-352920.576524  7390261.894515 
-352902.525525  7390261.264622 
-352892.943405  7390259.954847 
-352873.292637  7390254.875717 
-352854.804588  7390246.717114 
-352836.390755  7390240.108246 
-352830.090635  7390237.948616 
-352824.903756  7390236.228911 
-352819.090163  7390235.179091 
-352807.792827  7390232.069623 
-352802.927551  7390229.030144 
-352801.121626  7390226.130641 
-352800.272265  7390219.371798 
-352800.775285  7390209.853429 
-352803.752174  7390197.475549 
-352804.972616  7390188.407102 
-352805.797239  7390177.009055 
-352808.996777  7390143.044872 
-352809.260656  7390137.405838 
-352810.225465  7390132.536672 
-352810.274942  7390128.107431 
-352810.126510  7390122.018474 
-352809.994571  7390115.479594 
-352809.343118  7390108.500789 
-352805.170526  7390097.492675 
-352801.459722  7390091.473706 
-352798.021044  7390087.564376 
-352792.240436  7390084.184955 
-352782.880964  7390081.095484 
-352774.725442  7390080.685554 
-352767.155402  7390082.155302 
-352759.065850  7390084.954823 
-352730.302998  7390092.863468 
-352697.120166  7390104.491476 
-352686.061970  7390107.810908 
-352645.828611  7390119.808853 
-352640.699455  7390122.748349 
-352649.333259  7390150.433607 
-352672.983448  7390192.076474 
-352690.968477  7390237.858632 
-352715.063963  7390294.368952 
-352739.703701  7390341.310911 
-352796.553215  7390445.123129 
-352829.348474  7390538.947058 
-352803.669712  7390674.973758 
-352766.042161  7390831.606928 
-352768.070734  7390878.388915 
-352790.451004  7390917.042294 
-352816.896666  7390944.497591 
-352849.436292  7390975.012364 
-352886.808209  7391057.138296 
-352880.046300  7391191.995197 
-352887.583355  7391221.150203 
-352831.888313  7391411.077670 
-352804.692244  7391547.624281 
-352775.203724  7391649.326860 
-352760.945991  7391709.336581 
-352739.596500  7391762.227521 
-352531.948166  7392153.540493 
-352478.718747  7392281.288611 
-352447.473779  7392356.295763 
-352318.626425  7392632.968371 
-352303.849180  7392698.447155 
-352312.301566  7392749.128474 
-352350.316689  7392831.504364 
-352377.768391  7392941.325552 
-352409.450409  7393192.652502 
-352420.013831  7393427.092345 
-352439.021392  7393564.368831 
-352449.576568  7393627.727978 
-352455.917919  7393701.655315 
-352413.301399  7393899.621405 
-352417.902796  7393927.646604 
-352420.450881  7394021.210578 
-352421.242519  7394091.828482 
-352416.072133  7394130.981775 
-352474.719325  7394112.015024 
-352491.871485  7394100.646971 
-352515.678353  7394088.659024 
-352523.635965  7394119.763696 
-352532.426447  7394185.662409 
-352543.410426  7394286.695103 
-352545.603924  7394383.338548 
-352541.637487  7394470.333647 
-352539.196602  7394523.054616 
-352541.208683  7394567.836946 
-352532.426447  7394613.959045 
-352530.216457  7394644.703779 
-352528.031206  7394682.047382 
-352526.489161  7394816.824296 
-352533.242824  7394989.314750 
-352532.418201  7395009.071366 
-352530.892648  7395026.148441 
-352524.642005  7395050.354295 
-352501.956625  7395160.085499 
-352497.792278  7395178.542337 
-352487.913294  7395221.814925 
-352484.177752  7395241.891486 
-352475.997491  7395280.534867 
-352562.516943  7395343.414096 
-352659.946158  7395408.482951 
-352755.462247  7395473.881748 
-352845.676011  7395537.630829 
-352883.443747  7395552.628260 
-352951.788507  7395602.569705 
-353006.997021  7395627.545427 
-353118.609753  7395648.621817 
-353119.788964  7395682.825958 
-353119.640531  7395715.340389 
-353103.601613  7395774.780207 
-353081.476976  7395874.893059 
-353071.960826  7395914.566263 
-353069.577665  7395943.921235 
-353071.160941  7395971.696477 
-353104.203588  7396048.293357 
-353111.419039  7396064.790531 
-353163.980514  7396149.426034 
-353185.692839  7396185.509853 
-353215.618410  7396238.110843 
-353233.149896  7396281.443420 
-353231.088339  7396386.675395 
-353237.842001  7396353.970997 
-353338.421277  7396381.096351 
-353367.101667  7396390.294775 
-353416.026553  7396409.871422 
-353470.666078  7396430.257930 
-353522.056587  7396449.014717 
-353547.438485  7396456.913364 
-353567.410856  7396472.320725 
-353745.521191  7396570.533902 
-354058.902695  7396693.012922 
-354118.226078  7396716.718862 
-Region 1
-494
-353976.399157  7397735.564343 
-353977.454674  7397728.715516 
-353994.507879  7397725.326096 
-354007.066889  7397762.509727 
-354010.456089  7397823.299314 
-354010.983848  7397898.856372 
-354015.197672  7398017.726011 
-354023.913938  7398117.698886 
-354050.846127  7398162.911142 
-354069.070297  7398198.265086 
-354098.542325  7398240.707816 
-354132.673474  7398258.164826 
-354153.998226  7398259.334625 
-354219.110464  7398259.074670 
-354277.889596  7398258.964689 
-354359.230415  7398260.214475 
-354425.901189  7398257.304973 
-354465.169740  7398233.569039 
-354496.917728  7398216.112029 
-354554.847498  7398182.777739 
-354620.710142  7398146.273992 
-354698.472097  7398109.760246 
-354783.746368  7398077.855711 
-354813.193658  7398066.067730 
-354832.176481  7398056.959291 
-354862.737012  7398040.722072 
-354935.740892  7398084.374595 
-354998.420491  7398116.919020 
-355125.478413  7398187.816876 
-355231.425984  7397925.551799 
-355228.383125  7397828.158482 
-355227.731673  7397804.282572 
-355227.756411  7397804.252577 
-355301.032417  7397795.654050 
-355366.903307  7397781.376495 
-355417.526917  7397773.327874 
-355449.266659  7397767.728833 
-355527.803760  7397759.070316 
-355527.770775  7397759.050320 
-355587.506470  7397746.452478 
-355652.313596  7397737.593995 
-355714.333497  7397724.756194 
-355746.922600  7397714.497951 
-355776.930634  7397700.740308 
-355790.396728  7397690.772015 
-355834.843912  7397658.237588 
-355893.557074  7397613.795201 
-355951.750723  7397570.282654 
-356036.662160  7397487.656807 
-356046.104095  7397479.008288 
-356070.488199  7397455.892248 
-356089.116434  7397438.235272 
-356165.031233  7397405.880814 
-356089.116434  7397438.235272 
-356165.031233  7397405.880814 
-356232.073088  7397377.295711 
-356300.813667  7397335.902801 
-356357.052960  7397300.748823 
-356399.240676  7397271.063907 
-356419.551142  7397249.977519 
-356446.854411  7397225.311744 
-356496.628660  7397264.055108 
-356504.512056  7397263.635180 
-356511.158518  7397259.415902 
-356514.795106  7397251.387278 
-356519.990231  7397240.599126 
-356525.375020  7397235.100068 
-356533.538788  7397232.410528 
-356549.058194  7397230.560845 
-356565.055882  7397231.490686 
-356584.088182  7397233.960263 
-356603.565779  7397242.488802 
-356619.777868  7397248.207822 
-356631.891581  7397255.906504 
-356647.848037  7397261.875481 
-356658.724816  7397266.534683 
-356692.748763  7397269.414190 
-356710.742038  7397273.893423 
-356727.696289  7397280.882225 
-356741.607680  7397287.591076 
-356751.701066  7397294.759848 
-356779.037321  7397305.138071 
-356789.683204  7397308.027576 
-356801.838148  7397312.696776 
-356814.776484  7397314.846408 
-356827.970453  7397316.246168 
-356835.573478  7397318.855721 
-356845.691603  7397323.244969 
-356854.317160  7397324.604736 
-356868.022396  7397326.004496 
-356881.191626  7397330.943650 
-356888.209168  7397340.601996 
-356892.926012  7397351.750086 
-356897.956213  7397356.589258 
-356903.745067  7397362.708209 
-356913.846699  7397368.367240 
-356921.622895  7397378.535498 
-356929.159950  7397387.443972 
-356934.932311  7397394.312796 
-356940.440793  7397402.951316 
-356954.566586  7397412.939605 
-356966.457651  7397418.108720 
-356977.845695  7397423.017879 
-356991.006679  7397428.206990 
-356999.055001  7397436.365593 
-357006.913658  7397438.215276 
-357021.905306  7397438.375248 
-357034.662224  7397433.206134 
-357046.173962  7397426.017365 
-357059.648303  7397424.897557 
-357067.473976  7397430.526593 
-357072.710333  7397440.174940 
-357083.273754  7397451.383020 
-357089.334734  7397454.722448 
-357103.501758  7397460.931385 
-357116.407109  7397467.120325 
-357126.995269  7397475.558879 
-357139.851143  7397485.277214 
-357157.275428  7397496.815238 
-357172.712372  7397502.774217 
-357188.413195  7397507.983325 
-357202.596712  7397513.182435 
-357218.800555  7397519.151412 
-357235.507418  7397525.640301 
-357250.193955  7397530.839410 
-357258.242276  7397538.488100 
-357269.374687  7397543.907172 
-357276.944727  7397548.776338 
-357287.598857  7397550.905973 
-357300.768087  7397555.585171 
-357305.179821  7397559.634478 
-357358.483456  7397489.766446 
-357393.389750  7397609.405952 
-357360.041993  7397645.209819 
-357353.609933  7397659.317403 
-357355.696230  7397668.885764 
-357362.779742  7397676.664432 
-357413.832156  7397706.869258 
-357491.552880  7397728.695519 
-357482.679936  7397756.920684 
-357443.634033  7397905.345261 
-357440.500466  7397927.211515 
-357442.059003  7397952.217232 
-357448.309646  7397975.643219 
-357478.779468  7398013.126799 
-357512.382858  7398018.565867 
-357560.714016  7398044.711388 
-357587.646205  7398055.799489 
-357620.136354  7398057.389217 
-357708.090650  7398055.009624 
-357768.296380  7398052.630032 
-357819.010699  7398051.840167 
-357872.099932  7398051.050303 
-357957.662821  7398052.630032 
-357992.527884  7398054.219760 
-358012.970290  7398058.219075 
-358099.168139  7398089.283754 
-358115.338997  7398097.792296 
-358128.013453  7398111.269988 
-358134.346559  7398124.737681 
-358141.487794  7398144.544288 
-358147.029261  7398159.601709 
-358154.953889  7398171.479674 
-358168.683863  7398176.118880 
-358179.519410  7398174.649131 
-358194.733706  7398165.740657 
-358267.473706  7398092.253245 
-358281.723193  7398090.663517 
-358446.524112  7398120.768361 
-358464.302985  7398066.847597 
-358459.561403  7398058.219075 
-358458.464654  7398041.052015 
-358462.249674  7398018.395896 
-358466.001709  7397998.509302 
-358472.821342  7397977.392920 
-358478.816351  7397962.315502 
-358490.245627  7397937.469758 
-358499.365958  7397915.113587 
-358515.652264  7397887.038396 
-358528.137057  7397878.489861 
-358537.908840  7397872.140948 
-358555.662975  7397875.860311 
-358566.053225  7397877.989946 
-358576.443476  7397880.869453 
-358591.913405  7397884.058907 
-358603.837454  7397886.458496 
-358628.452453  7397889.238020 
-358645.241778  7397887.398335 
-358664.603928  7397882.559164 
-358684.032047  7397871.161116 
-358692.022645  7397859.643089 
-358694.166665  7397849.074899 
-358692.030891  7397833.417581 
-358686.827519  7397820.239838 
-358678.300917  7397809.051755 
-358662.723787  7397791.484764 
-358649.900899  7397777.977078 
-358635.535965  7397765.969134 
-358607.292625  7397744.232858 
-358592.680304  7397731.465045 
-358570.745331  7397714.078023 
-358543.244151  7397668.885764 
-358523.882002  7397648.759211 
-358511.133329  7397627.432864 
-358491.276406  7397605.536615 
-358483.277562  7397592.838790 
-358475.789985  7397579.391094 
-358465.960478  7397571.212495 
-358452.618077  7397558.204723 
-358441.238278  7397553.045606 
-358428.868932  7397544.587055 
-358419.748601  7397541.967504 
-358408.640929  7397534.538776 
-358398.011537  7397530.129532 
-358387.571809  7397532.549117 
-358366.040901  7397524.880431 
-358352.401636  7397517.541688 
-358335.917421  7397513.842322 
-358316.192437  7397504.293957 
-358303.047945  7397497.595105 
-358294.958393  7397492.975896 
-358283.372439  7397483.267559 
-358272.553384  7397472.049480 
-358247.649768  7397446.813803 
-358234.521769  7397438.355252 
-358218.375649  7397426.327312 
-358198.172384  7397413.749467 
-358183.287938  7397403.251265 
-358169.162144  7397392.763061 
-358152.273864  7397379.465339 
-358134.255850  7397351.530124 
-358120.740278  7397330.453734 
-358107.686495  7397314.416481 
-358102.474877  7397302.758478 
-358099.060938  7397287.841034 
-358096.669531  7397272.933587 
-358084.926898  7397252.637064 
-358074.660341  7397237.639633 
-358061.400402  7397217.323113 
-358049.847433  7397203.835423 
-358040.537439  7397194.147082 
-358027.714550  7397180.899352 
-358007.849380  7397159.243061 
-357994.317316  7397140.946195 
-357978.492799  7397121.859465 
-357964.152604  7397107.831867 
-357947.478726  7397097.813583 
-357929.007169  7397090.554827 
-357910.024346  7397082.786158 
-357886.258710  7397070.938187 
-357859.722339  7397081.246421 
-357843.386556  7397088.645154 
-357826.028241  7397096.533803 
-357808.933805  7397103.912539 
-357793.637047  7397108.291789 
-357785.473279  7397111.741198 
-357763.027039  7397120.579684 
-357742.287769  7397136.256998 
-357725.415981  7397145.655389 
-357713.434208  7397150.074632 
-357696.867530  7397154.693840 
-357688.712008  7397157.123424 
-357673.695622  7397159.493018 
-357656.675402  7397158.803137 
-357641.428122  7397159.403034 
-357634.814645  7397159.333046 
-357624.655289  7397158.973107 
-357610.141923  7397162.342530 
-357600.667004  7397169.561294 
-357593.418567  7397131.647788 
-357590.004627  7397117.740170 
-357585.089874  7397101.043030 
-357579.235050  7397076.257276 
-357574.798578  7397063.099530 
-357570.362106  7397049.171915 
-357561.901473  7397031.424955 
-357564.614483  7397014.307887 
-357569.075694  7396999.970343 
-357574.320297  7396983.633142 
-357582.071754  7396970.605373 
-357585.963974  7396962.566750 
-357596.502657  7396950.318848 
-357608.806033  7396940.110597 
-357621.810339  7396935.201437 
-357631.268766  7396930.262284 
-357644.306056  7396922.573601 
-357655.050895  7396915.124876 
-357663.016754  7396905.876461 
-357669.448813  7396898.127788 
-357676.466356  7396882.560454 
-357684.481692  7396868.772816 
-357689.718048  7396853.445442 
-357692.125948  7396841.357512 
-357700.231992  7396818.241472 
-357703.736640  7396798.344880 
-357714.118645  7396776.518618 
-357722.538046  7396747.593573 
-357728.533056  7396732.776111 
-357736.053618  7396717.468733 
-357743.417502  7396636.862540 
-357746.031557  7396609.367250 
-357744.918316  7396593.719930 
-357745.091487  7396576.312912 
-357745.998573  7396561.695416 
-357748.200316  7396544.568349 
-357749.396020  7396526.671415 
-357753.692306  7396504.015296 
-357755.085919  7396491.417454 
-357758.301949  7396475.310213 
-357760.594401  7396448.844746 
-357761.303577  7396428.928158 
-357761.196376  7396414.550620 
-357759.662577  7396390.064814 
-357757.229939  7396378.686763 
-357754.376743  7396359.490052 
-357753.304733  7396339.803424 
-357754.426220  7396329.215237 
-357758.417396  7396311.098341 
-357763.934124  7396292.741485 
-357769.426114  7396277.164153 
-357777.499174  7396257.827465 
-357782.768515  7396239.470610 
-357785.036228  7396215.784667 
-357786.454580  7396200.917214 
-357791.468288  7396182.560358 
-357798.972358  7396169.262636 
-357810.813945  7396153.505335 
-357818.260292  7396145.756662 
-357826.481784  7396136.768202 
-357831.709894  7396122.440656 
-357833.870406  7396109.852812 
-357838.084230  7396095.015354 
-357841.077612  7396075.378717 
-357846.305722  7396060.301300 
-357851.269953  7396046.723626 
-357857.034068  7396029.886510 
-357857.570073  7396029.116642 
-357865.783319  7396018.378481 
-357875.348946  7396002.341228 
-357882.828278  7395991.063160 
-357893.812257  7395985.384133 
-357908.127713  7395977.205533 
-357917.107858  7395968.477029 
-357926.368375  7395957.478912 
-357933.064315  7395947.960543 
-357956.013575  7395914.906205 
-357971.120669  7395903.468164 
-357985.683513  7395895.799478 
-358005.293049  7395891.210264 
-358019.064254  7395886.321101 
-358039.209796  7395878.962362 
-358047.431288  7395870.723773 
-358057.450458  7395859.485698 
-358069.753834  7395848.767534 
-358081.323296  7395835.009890 
-358097.700310  7395824.341718 
-358113.813444  7395813.413590 
-358123.511012  7395809.484263 
-358141.553764  7395797.156374 
-358157.914286  7395780.849168 
-358171.124747  7395766.351651 
-358184.417671  7395753.413867 
-358203.639635  7395740.316111 
-358213.262986  7395727.008390 
-358221.253583  7395713.240748 
-358227.660905  7395695.363810 
-358241.630019  7395675.677183 
-358255.285777  7395647.012093 
-358270.030038  7395611.168232 
-358279.224585  7395586.602440 
-358284.279524  7395573.214733 
-358297.143644  7395541.330195 
-358302.627387  7395512.815079 
-358305.356890  7395484.159988 
-358305.216704  7395456.584711 
-358307.880236  7395434.678463 
-358314.122633  7395421.900652 
-358329.468868  7395408.642923 
-358342.159817  7395394.705311 
-358354.586887  7395376.778381 
-358356.252625  7395352.542533 
-358351.115224  7395334.775576 
-358350.711158  7395312.509390 
-358352.170741  7395298.901721 
-358347.940425  7395261.758083 
-358337.616144  7395252.689637 
-358318.847723  7395240.331753 
-358288.402640  7395220.985067 
-358254.535370  7395197.179145 
-358220.173327  7395171.493545 
-358198.403278  7395152.786749 
-358167.949949  7395134.659854 
-358141.883613  7395116.802913 
-358099.860822  7395092.257117 
-358068.203543  7395072.120566 
-358017.901536  7395047.604766 
-357967.937624  7395031.057600 
-357924.455250  7395019.009664 
-357878.218635  7395007.711599 
-357835.544391  7394996.553510 
-357776.262239  7394993.654007 
-357738.131668  7394998.153236 
-357701.732806  7395004.222197 
-357679.096903  7395011.530945 
-357652.370870  7395019.689547 
-357630.452389  7395027.448218 
-357605.012767  7395028.648013 
-357600.048536  7395025.268592 
-357592.742376  7395020.109475 
-357590.911713  7395009.461299 
-357589.996381  7394998.373199 
-357591.653874  7394975.137179 
-357593.344351  7394947.911842 
-357593.723677  7394919.346735 
-357596.634597  7394893.351188 
-357601.557597  7394855.647646 
-357611.939601  7394820.853606 
-357621.315565  7394801.786872 
-357628.885605  7394789.229023 
-357636.859710  7394777.790982 
-357655.743578  7394756.824574 
-357667.972738  7394748.416014 
-357679.806079  7394739.227588 
-357703.101681  7394726.719730 
-357698.318867  7394704.413551 
-357634.476549  7394756.894562 
-357579.259789  7394818.504009 
-357560.219242  7394835.961018 
-357392.243524  7395038.926252 
-357333.266482  7395104.974939 
-357303.118263  7395131.150455 
-357277.719873  7395148.607465 
-357179.317602  7395214.476182 
-357053.150274  7395295.412319 
-357022.581497  7395314.389068 
-356973.137098  7395338.714901 
-356839.482191  7395377.988174 
-356760.590503  7395401.434158 
-356526.595462  7395463.833469 
-356474.602978  7395476.831243 
-356425.199810  7395492.428571 
-356348.048076  7395511.965225 
-356201.611512  7395549.628774 
-356032.868894  7395597.570562 
-355772.626101  7395656.220515 
-355426.696726  7395723.299025 
-355197.237112  7395785.968291 
-355105.217424  7395804.365139 
-355031.611569  7395825.071593 
-354978.703753  7395859.575682 
-354925.795938  7395887.180954 
-354877.489518  7395937.782286 
-354860.007509  7395950.550099 
-354822.635592  7395978.975230 
-354751.882933  7396032.606044 
-354708.689177  7396083.657299 
-354659.756044  7396137.478080 
-354612.463912  7396189.679139 
-354563.341116  7396234.481464 
-354519.479415  7396289.981958 
-354421.027667  7396421.199481 
-354256.366934  7396534.700040 
-354219.687700  7396565.964684 
-354180.757245  7396600.978687 
-354159.292306  7396625.244530 
-354139.691016  7396662.578135 
-354125.688917  7396694.322698 
-354118.226078  7396716.718862 
-354108.891345  7396752.192785 
-354030.296520  7397007.519050 
-354012.839250  7397055.130895 
-353989.032382  7397102.742739 
-353967.608675  7397149.564719 
-353944.593445  7397196.386699 
-353922.369854  7397245.588271 
-353900.146262  7397303.518348 
-353879.522439  7397352.719920 
-353853.398381  7397407.650511 
-353825.509629  7397460.771412 
-353802.873725  7397500.124671 
-353814.476172  7397519.731313 
-353834.382573  7397548.216434 
-353838.118115  7397555.125250 
-353842.208246  7397564.733604 
-353845.877818  7397578.131309 
-353848.277471  7397599.737608 
-353854.231250  7397617.554557 
-353857.950300  7397625.993111 
-353868.670400  7397652.748528 
-353886.605951  7397715.537773 
-353894.547072  7397732.944791 
-353902.108865  7397740.003582 
-353919.236286  7397738.373861 
-353976.399157  7397735.564343 
-Region 1
-189
-324677.920995  7399197.423939 
-324782.458461  7399206.932311 
-325016.857567  7399181.586652 
-325682.056255  7399140.403706 
-325865.040113  7399134.584703 
-326431.391234  7399199.933509 
-326675.413691  7399212.761312 
-326901.277948  7399224.829245 
-327116.537553  7399213.321216 
-327105.050554  7399145.072906 
-327095.823022  7399102.290235 
-327092.532776  7399019.634393 
-327088.129289  7398984.530406 
-327088.467384  7398979.811214 
-327157.414118  7398854.862617 
-327190.613443  7398800.841870 
-327199.230754  7398784.624648 
-327204.425879  7398767.957503 
-327206.668854  7398746.291214 
-327205.967925  7398717.346172 
-327205.877216  7398702.978633 
-327210.058055  7398677.463004 
-327215.879894  7398668.454547 
-327222.641803  7398649.817739 
-327330.015972  7398465.119376 
-327336.217138  7398453.081438 
-327353.798101  7398428.965569 
-327363.141081  7398397.071032 
-327395.276641  7398353.138558 
-327460.891899  7398241.927607 
-327509.792046  7398139.425165 
-327559.186968  7398037.662596 
-327587.842620  7397981.352241 
-327733.759671  7397726.455903 
-327815.685972  7397640.850566 
-327930.646674  7397541.787535 
-327964.901516  7397503.874029 
-327960.011501  7397358.338958 
-327960.011501  7397237.259698 
-327879.503551  7397240.909073 
-327872.279853  7397239.849254 
-327813.451244  7397240.089213 
-327743.209851  7397239.319345 
-327670.469851  7397120.919626 
-327538.018894  7396913.845096 
-327444.688056  7396776.748579 
-327355.587533  7396637.912360 
-327319.056732  7396569.494080 
-327271.220348  7396497.516409 
-327197.350613  7396547.047925 
-327121.732678  7396569.494080 
-327124.041623  7396529.520927 
-327119.704106  7396502.895488 
-327113.816297  7396474.000437 
-327102.617916  7396445.515316 
-327091.081439  7396423.889021 
-327077.656576  7396405.692138 
-327059.663300  7396387.525249 
-327040.169211  7396372.797772 
-327027.940051  7396363.729325 
-326976.689728  7396320.636707 
-326956.791573  7396302.099882 
-326937.256253  7396280.523578 
-326918.883651  7396261.206887 
-326829.296601  7396237.370970 
-326814.469878  7396240.130497 
-326781.196338  7396251.608531 
-326758.684128  7396264.146383 
-326723.340783  7396296.880776 
-326695.229383  7396282.143300 
-326707.293619  7396238.470781 
-326708.926372  7396217.124438 
-326738.052059  7396121.050894 
-326737.969597  7396105.443567 
-326732.922903  7396089.096368 
-326723.711864  7396056.182006 
-326724.849844  7396000.001629 
-326739.033360  7395842.888541 
-326753.917807  7395717.929945 
-326767.820952  7395600.580046 
-326722.252281  7395592.821375 
-326675.628093  7395581.013398 
-326616.082061  7395566.125948 
-326616.073815  7395566.145944 
-326499.307189  7395571.235073 
-326434.763942  7395579.483660 
-326293.308101  7395601.169945 
-326241.439311  7395612.967924 
-326076.432235  7395651.951247 
-326060.409809  7395655.290675 
-326016.160536  7395659.709918 
-325977.271312  7395674.527380 
-325916.546069  7395703.612398 
-325895.237809  7395723.718953 
-325876.246740  7395755.763465 
-325844.292596  7395787.318060 
-325828.542296  7395794.716792 
-325817.352161  7395798.296179 
-325796.497444  7395800.885735 
-325769.029249  7395805.274984 
-325709.771836  7395810.994004 
-325688.933611  7395819.172603 
-325671.138245  7395824.801639 
-325662.751829  7395829.130897 
-325645.236835  7395843.648411 
-325628.249600  7395862.975100 
-325561.850951  7395949.470284 
-325516.686345  7395993.502742 
-325530.680199  7396021.447955 
-325534.110631  7396033.985808 
-325532.222244  7396044.643982 
-325534.506450  7396050.343006 
-325531.859410  7396068.589880 
-325525.402611  7396077.708318 
-325516.661607  7396090.246171 
-325501.818391  7396102.034151 
-325485.853689  7396111.912459 
-325467.200715  7396120.640964 
-325432.962366  7396133.938687 
-325393.009378  7396146.086606 
-325351.910165  7396159.004393 
-325324.953237  7396168.152826 
-325288.372957  7396174.191792 
-325247.653070  7396178.361077 
-325219.863273  7396180.630689 
-325167.343030  7396184.410041 
-325123.580284  7396187.819457 
-325022.333064  7396184.749983 
-324953.048234  7396172.572069 
-324700.672345  7396127.629767 
-324585.711644  7396105.553549 
-324572.047640  7396095.685239 
-324560.593625  7396088.456477 
-324548.026370  7396080.117906 
-324536.201275  7396070.179608 
-324527.163406  7396064.370603 
-324506.127272  7396048.483324 
-324523.881407  7396080.807787 
-324527.163406  7396103.803848 
-324522.232160  7396177.701190 
-324515.668161  7396220.403876 
-324489.387424  7396323.866154 
-324482.823424  7396419.119838 
-324489.387424  7396451.964212 
-324494.318670  7396474.950274 
-324500.882669  7396499.586054 
-324509.095915  7396522.582115 
-324519.601613  7396545.958111 
-324479.871274  7396681.244938 
-324472.812500  7396704.111021 
-324446.012251  7396786.426921 
-324419.632559  7396874.811782 
-324429.569267  7396885.939876 
-324435.127226  7396893.498581 
-324439.538960  7396902.627017 
-324443.076592  7396912.535320 
-324443.043608  7396924.063345 
-324440.322351  7396937.980961 
-324429.965086  7396949.928915 
-324406.768439  7397044.902647 
-324370.707672  7397107.931850 
-324352.236116  7397131.617793 
-324331.727740  7397182.789028 
-324285.746758  7397343.731460 
-324230.719661  7397533.278992 
-324188.853548  7397690.242106 
-324194.263075  7397698.160749 
-324176.978976  7397731.405055 
-324092.018061  7397845.835454 
-324040.990386  7397911.364230 
-324057.120013  7397934.540260 
-323980.817641  7397992.200383 
-323924.256745  7398036.192848 
-323894.867179  7398063.488172 
-323867.563909  7398098.142236 
-323847.566800  7398138.115389 
-323830.909414  7398192.076146 
-323823.578515  7398208.733293 
-323794.527045  7398290.029368 
-323748.999605  7398458.030591 
-323878.712813  7398544.435790 
-323992.576766  7398611.404319 
-324101.971262  7398696.249786 
-324166.712419  7398772.156784 
-324280.576371  7398954.105617 
-324343.082800  7399027.772999 
-324392.205596  7399056.798027 
-324541.718003  7399165.749365 
-324677.920995  7399197.423939 
-Region 1
-124
-333956.423041  7394117.764039 
-333947.632559  7394151.748218 
-333937.423725  7394115.114493 
-333926.142882  7394090.908639 
-333914.862038  7394064.673133 
-333910.087471  7394056.264573 
-333899.787929  7394038.417630 
-333892.993034  7394028.729290 
-333886.453774  7394018.780994 
-333877.630307  7394007.812873 
-333870.942614  7394000.004210 
-333844.810309  7393981.247423 
-333802.688563  7393971.229139 
-333747.339863  7393961.650780 
-333719.137754  7393959.301182 
-333662.684059  7393954.741963 
-333456.750941  7393939.814520 
-333348.296515  7393932.705738 
-333236.312703  7393924.627122 
-333191.717088  7393921.957579 
-333146.082447  7393928.026539 
-333080.392974  7393935.765214 
-333041.759383  7393939.624553 
-333017.243340  7393944.773671 
-332915.641532  7393966.190002 
-332883.440001  7393972.568910 
-332838.316627  7393850.359843 
-332806.510916  7393761.085135 
-332783.710088  7393687.697705 
-332766.764084  7393643.535270 
-332749.430507  7393607.281480 
-332714.639660  7393561.139384 
-332691.071933  7393516.607012 
-332669.153452  7393463.186162 
-332653.543337  7393423.622939 
-332641.388393  7393377.150899 
-332635.187228  7393320.950526 
-332625.151565  7393236.764946 
-332616.913581  7393138.681747 
-332610.011485  7393103.287810 
-332603.538194  7393079.041963 
-332591.572914  7393028.010704 
-332583.170005  7392994.156503 
-332578.560362  7392958.982528 
-332572.837478  7392917.239678 
-332573.876503  7392885.275153 
-332575.220638  7392839.113060 
-332582.634000  7392791.091286 
-332584.753281  7392746.688892 
-332583.293698  7392701.066706 
-332580.803337  7392653.954776 
-332577.702754  7392584.276711 
-332555.710057  7392351.046662 
-332557.515981  7392291.436872 
-332555.619348  7392250.453892 
-332559.536308  7392053.557619 
-332626.710103  7392026.792204 
-332727.652212  7391998.537043 
-332872.571469  7391951.855040 
-332932.142239  7391927.989128 
-333028.037656  7391902.023575 
-333133.292544  7391870.638951 
-333289.797755  7391879.407449 
-333239.347316  7391844.073502 
-333250.108647  7391826.466518 
-333253.638034  7391822.627175 
-333259.707259  7391819.777663 
-333264.786938  7391818.467888 
-333269.619229  7391818.427894 
-333277.263485  7391819.377732 
-333283.876961  7391819.817656 
-333289.220519  7391820.027620 
-333295.833996  7391819.717674 
-333302.678367  7391817.877989 
-333309.011473  7391814.528562 
-333313.299512  7391811.189134 
-333321.578728  7391799.701102 
-333378.246825  7391690.329836 
-333384.497468  7391539.305706 
-333398.606768  7391516.789562 
-333418.191566  7391488.814354 
-333436.481706  7391488.064483 
-333513.386053  7391491.213943 
-333580.106305  7391482.015519 
-333632.337930  7391481.265647 
-333714.173523  7391474.746764 
-333781.553474  7391471.317351 
-333826.083119  7391473.466983 
-333859.810202  7391489.414252 
-333890.156331  7391524.158300 
-334025.790333  7391529.297420 
-334080.363887  7391531.637019 
-334144.321652  7391529.517382 
-334171.220856  7391678.751820 
-334185.717730  7391763.807250 
-334190.368604  7391790.992594 
-334214.373381  7391904.213200 
-334222.240286  7391954.644562 
-334230.239129  7391999.996793 
-334242.493028  7392080.962925 
-334278.537302  7392277.169316 
-334302.781220  7392415.995537 
-334329.218636  7392548.722802 
-334358.781373  7392719.923476 
-334409.743078  7392986.947738 
-334358.921558  7392996.776054 
-334356.241534  7393021.411834 
-334345.405986  7393111.826347 
-334342.288911  7393124.054252 
-334333.853017  7393138.121843 
-334304.578899  7393170.236342 
-334294.394804  7393193.372379 
-334277.960066  7393343.586649 
-334240.538671  7393340.567166 
-334209.607060  7393348.105874 
-334149.797149  7393365.672865 
-334176.102625  7393464.365960 
-334198.021106  7393539.693057 
-334231.410094  7393644.665077 
-334141.328270  7393692.396901 
-334024.149333  7393748.137353 
-334002.890550  7393905.390417 
-333992.211682  7393973.488752 
-333956.423041  7394117.764039 
-Region 1
-145
-329086.603286  7402389.157224 
-329078.794105  7402335.956337 
-329044.176429  7402293.933535 
-328991.441784  7402247.231535 
-328876.068771  7402181.852734 
-328774.293793  7402116.863866 
-328710.319535  7402074.781074 
-328675.413241  7402053.494720 
-328629.440505  7402030.508657 
-328577.513991  7401998.164198 
-328548.107932  7401973.788373 
-328521.513838  7401947.792826 
-328474.328907  7401889.732771 
-328413.249076  7401818.374994 
-328373.823847  7401768.183591 
-328263.901593  7401657.802499 
-328195.499110  7401557.499680 
-328172.393171  7401536.823221 
-328116.838316  7401463.745739 
-328065.893103  7401410.154918 
-328018.642201  7401351.424978 
-327958.708597  7401268.679152 
-327942.290351  7401226.466383 
-327926.449342  7401186.993144 
-327917.518675  7401143.050671 
-327913.073956  7401127.793284 
-327904.201012  7401085.320560 
-327901.116922  7401059.754939 
-327898.107048  7401043.577710 
-327901.042706  7401007.563879 
-327904.407168  7400986.917415 
-327908.101479  7400963.101495 
-327916.289986  7400940.275405 
-327931.529020  7400859.829184 
-327956.251220  7400744.768893 
-327975.201058  7400663.912743 
-327983.892585  7400597.324149 
-327993.862278  7400518.667622 
-327992.633590  7400467.596370 
-327988.617675  7400446.999898 
-327983.678183  7400425.183635 
-327974.228003  7400391.519401 
-327951.526130  7400352.696052 
-327918.706132  7400303.074551 
-327857.337683  7400201.801898 
-327828.179012  7400148.161087 
-327801.354023  7400085.171876 
-327774.529035  7400016.363662 
-327739.078490  7399947.095527 
-327707.833522  7399873.848074 
-327705.541070  7399867.899093 
-327677.677056  7399805.989697 
-327630.285969  7399704.737041 
-327582.886635  7399576.558997 
-327557.026456  7399446.221322 
-327535.421331  7399299.876390 
-327502.287977  7399141.383538 
-327604.978287  7399124.166488 
-327687.193206  7399107.099411 
-327890.619470  7399056.238123 
-328141.857379  7399021.464080 
-328241.785202  7398973.502295 
-328317.708248  7398902.424470 
-328421.668478  7398807.610711 
-328615.537360  7398687.691252 
-328705.478998  7398637.709813 
-328821.404508  7398601.735975 
-329181.162813  7398557.763507 
-329263.649858  7398549.594906 
-329395.482347  7398538.076879 
-329435.657983  7399061.717185 
-329451.301082  7399191.105022 
-329458.986569  7399344.238791 
-329465.608293  7399378.612903 
-329488.079271  7399409.027693 
-329515.836083  7399431.503843 
-329573.328804  7399496.512708 
-329601.456696  7399528.847169 
-329633.196438  7399562.451413 
-329650.208412  7399584.597620 
-329805.979709  7399801.140528 
-329890.602528  7399920.420097 
-329905.915778  7399944.905902 
-329935.247620  7399999.116617 
-330000.607245  7400055.746916 
-330049.103327  7400141.592212 
-330098.036460  7400238.035692 
-330129.677247  7400322.161282 
-330108.006152  7400339.758268 
-330060.656296  7400395.078792 
-330016.423515  7400429.032976 
-329971.498050  7400459.587742 
-329922.935998  7400489.322649 
-329889.893352  7400509.579179 
-329860.586248  7400527.626088 
-329851.292746  7400535.624718 
-329847.557204  7400539.644029 
-329842.832114  7400552.141888 
-329841.760104  7400575.737847 
-329843.937108  7400640.916682 
-329818.852075  7400759.126434 
-329773.069002  7400988.187198 
-329755.669456  7401073.362608 
-329824.962532  7401089.719806 
-329875.660358  7401164.427009 
-329910.055386  7401220.687373 
-329936.138213  7401257.821012 
-329915.687561  7401359.213644 
-329975.266578  7401452.597648 
-330017.973806  7401536.203328 
-330012.292153  7401579.055987 
-330010.857309  7401601.132206 
-330001.069033  7401699.865294 
-330020.381706  7401744.507647 
-330091.389998  7401907.479731 
-330094.474088  7401909.779337 
-330193.189715  7401980.037303 
-330210.251166  7402002.603437 
-330175.386103  7402007.532593 
-330136.233000  7402010.932011 
-330100.477344  7402014.341427 
-330065.571050  7402024.559676 
-330000.879370  7402067.122386 
-329940.426253  7402113.084513 
-329902.122512  7402135.220721 
-329873.178242  7402139.479992 
-329845.091581  7402142.029555 
-329825.506783  7402146.288825 
-329799.118845  7402159.056638 
-329766.768882  7402176.933576 
-329759.108134  7402184.592264 
-329742.937275  7402188.001680 
-329653.548135  7402175.233867 
-329430.512335  7402142.879409 
-329351.340275  7402129.261742 
-329189.590460  7402107.985386 
-329155.541774  7402107.125534 
-329155.492297  7402107.145530 
-329156.993111  7402153.997505 
-329156.217965  7402247.021571 
-329156.226211  7402247.051566 
-329135.792052  7402360.532127 
-329126.160454  7402362.741749 
-329117.930716  7402376.709356 
-329086.603286  7402389.157224 
-Region 1
-514
-334379.256763  7402229.984489 
-334383.891145  7402300.952333 
-334381.227612  7402411.963318 
-334383.891145  7402451.776498 
-334377.640502  7402474.472610 
-334416.752374  7402546.400290 
-334440.996292  7402584.113830 
-334457.727894  7402613.128860 
-334505.440585  7402703.143441 
-334573.636912  7402794.947716 
-334605.285945  7402826.602294 
-334622.429859  7402862.286182 
-334648.372500  7402926.965103 
-334672.665896  7402986.454913 
-334674.710961  7402993.943630 
-334691.120960  7403041.125548 
-334701.049422  7403070.810463 
-334719.133406  7403109.983753 
-334745.364665  7403167.883835 
-334585.313575  7403210.856475 
-334545.772899  7403205.097461 
-334497.928268  7403171.743174 
-334445.977015  7403218.635142 
-334395.229712  7403230.473114 
-334370.425050  7403207.896982 
-334267.660524  7403234.542417 
-334100.022901  7403279.534711 
-334031.348292  7403215.435690 
-333944.358805  7403279.524712 
-333845.354560  7403296.121869 
-333788.125719  7403323.597163 
-333795.926654  7403394.704983 
-333870.200453  7403447.825884 
-333862.820077  7403475.371166 
-333850.516700  7403498.977122 
-333832.333762  7403504.396194 
-333800.849653  7403543.249539 
-333766.413394  7403570.304904 
-333725.503844  7403592.701068 
-333702.422644  7403599.919832 
-333685.361193  7403602.849330 
-333655.847934  7403612.067751 
-333614.690996  7403629.464771 
-333610.551389  7403631.814368 
-333602.280419  7403637.273433 
-333597.786224  7403641.912639 
-333585.590048  7403662.269152 
-333592.879716  7403577.303705 
-333496.176170  7403582.502815 
-333488.507175  7403626.375300 
-333475.717271  7403686.375023 
-333461.946066  7403760.152385 
-333454.079162  7403829.020589 
-333464.898217  7403873.283007 
-333484.136673  7403893.249587 
-333523.965967  7403929.193430 
-333544.383634  7403961.247939 
-333553.751352  7404001.810991 
-333555.887126  7404015.478650 
-333559.771100  7404042.434033 
-333563.432427  7404056.451632 
-333566.590733  7404072.278921 
-333580.238245  7404082.817116 
-333592.154048  7404090.245843 
-333607.236404  7404104.853341 
-333617.667886  7404114.581675 
-333629.311563  7404127.709426 
-333635.182880  7404137.507748 
-333635.100417  7404155.404682 
-333631.876141  7404167.242654 
-333626.779970  7404180.260424 
-333624.231885  7404186.389375 
-333616.958710  7404206.285967 
-333607.079725  7404221.293396 
-333606.890062  7404240.320137 
-333603.649294  7404273.094523 
-333599.361254  7404311.207994 
-333597.530590  7404337.503490 
-333593.357998  7404360.389570 
-333578.795154  7404397.883148 
-333578.745677  7404397.913143 
-333535.560167  7404430.987477 
-333524.510218  7404448.624456 
-333518.812073  7404471.160596 
-333517.360736  7404497.816030 
-333518.383269  7404535.099644 
-333518.449238  7404561.345148 
-333518.276068  7404573.912995 
-333517.121595  7404576.492553 
-333518.309053  7404573.883000 
-333512.759339  7404586.110906 
-333505.156315  7404598.878719 
-333491.888130  7404614.486046 
-333477.407749  7404630.463309 
-333470.307744  7404640.001675 
-333459.447458  7404646.430574 
-333443.647680  7404657.278716 
-333427.443837  7404666.997051 
-333407.364265  7404671.526275 
-333392.587020  7404673.685905 
-333338.673164  7404679.114975 
-333310.908106  7404680.294773 
-333290.828534  7404683.684193 
-333278.360233  7404685.353907 
-333236.906432  7404700.611293 
-333208.044624  7404708.110009 
-333201.035328  7404709.949693 
-333149.488141  7404759.311238 
-333141.612990  7404787.026491 
-333145.389764  7404799.144415 
-333136.013800  7404859.624056 
-333127.916001  7404895.957832 
-333120.131560  7404924.772896 
-333104.595661  7404961.036685 
-333080.656853  7404999.310129 
-333061.632799  7405028.335157 
-332996.718472  7405116.959976 
-332916.029105  7405227.241086 
-332897.235945  7405313.646286 
-332879.176700  7405392.412794 
-332832.964823  7405467.419946 
-332836.543688  7405511.762350 
-332861.241148  7405568.852571 
-332864.284007  7405633.351523 
-332854.578194  7405705.229211 
-332877.700625  7405756.990345 
-332918.849316  7405822.249167 
-332887.761026  7405869.301107 
-332809.256910  7405952.576843 
-332749.026442  7406010.396939 
-332738.900071  7406031.033404 
-332735.593332  7406050.510068 
-332737.283809  7406073.086201 
-332744.491015  7406097.032099 
-332754.807049  7406115.188989 
-332800.598368  7406153.892359 
-332830.532185  7406174.618809 
-332852.120817  7406197.254932 
-332854.396777  7406213.512147 
-332846.810245  7406250.155870 
-332846.892707  7406261.823871 
-332852.467159  7406276.861296 
-332875.317464  7406299.007502 
-332890.531760  7406310.125598 
-332901.400292  7406325.253007 
-332913.852100  7406352.558329 
-332925.240144  7406382.903132 
-332937.403335  7406407.478922 
-332956.031570  7406431.534802 
-332973.917644  7406448.531890 
-332997.782235  7406470.938052 
-333031.426856  7406495.783796 
-333063.933498  7406512.990849 
-333150.518919  7406570.311030 
-333186.868304  7406600.255901 
-333238.456723  7406725.004533 
-333247.956381  7406747.200731 
-333259.047561  7406764.087838 
-333277.659304  7406783.894446 
-333289.962680  7406804.610897 
-333307.626106  7406836.815381 
-333332.537969  7406873.189150 
-333358.340424  7406917.941484 
-333364.096293  7406937.538128 
-333353.310224  7406969.332682 
-333340.140993  7406990.928982 
-333337.246566  7407016.244646 
-333337.048657  7407047.169349 
-333322.840401  7407071.285218 
-333301.416694  7407088.972188 
-333279.836308  7407100.060289 
-333246.158703  7407111.978248 
-333225.798759  7407126.125824 
-333214.179820  7407145.222553 
-333222.137433  7407169.678364 
-333228.792141  7407180.166568 
-333229.229191  7407201.732874 
-333220.067629  7407259.392997 
-333225.642081  7407291.437508 
-333233.583201  7407300.405972 
-333238.869035  7407317.483047 
-333238.613401  7407335.729921 
-333231.026869  7407354.116772 
-333222.483774  7407369.964057 
-333209.603162  7407389.800659 
-333195.386660  7407407.247671 
-333184.707792  7407420.355426 
-333171.686994  7407432.333374 
-333158.187914  7407442.271671 
-333135.296378  7407456.889168 
-333126.448172  7407476.015891 
-333122.432258  7407492.703033 
-333117.839107  7407513.669442 
-333112.553274  7407530.576546 
-333103.762792  7407546.423831 
-333083.105984  7407579.828109 
-333078.471602  7407604.353908 
-333078.900406  7407626.670086 
-333089.892632  7407667.903023 
-333104.257566  7407718.824301 
-333109.172319  7407744.999817 
-333108.322957  7407768.815737 
-333104.801817  7407785.252922 
-333094.988802  7407801.330168 
-333083.971838  7407813.838026 
-333077.242914  7407826.405873 
-333075.016432  7407840.583444 
-333081.118642  7407854.361084 
-333088.210401  7407868.658635 
-333099.301581  7407886.055655 
-333105.073942  7407904.662468 
-333107.531319  7407925.988815 
-333107.382887  7407953.624081 
-333103.193802  7407999.186277 
-332938.953626  7408038.109610 
-332946.498927  7408125.794590 
-332952.411474  7408178.075635 
-332929.379752  7408201.131686 
-332898.810975  7408211.739869 
-332882.805042  7408210.840023 
-332866.642429  7408197.042386 
-332855.782144  7408187.604003 
-332846.933938  7408180.195272 
-332827.184216  7408170.666904 
-332811.714287  7408166.487620 
-332794.941454  7408166.337646 
-332770.243993  7408173.706383 
-332738.108432  7408190.113573 
-332698.064736  7408210.999995 
-332672.608622  7408217.358906 
-332642.320217  7408224.427695 
-332608.980707  7408231.716447 
-332579.220060  7408235.255840 
-332549.492399  7408234.995885 
-332514.223270  7408227.607151 
-332483.539046  7408218.748668 
-332446.818581  7408199.971884 
-332426.046326  7408190.943431 
-332390.538057  7408181.535042 
-332362.888445  7408174.466253 
-332325.516528  7408177.175789 
-332293.702570  7408184.734494 
-332261.080482  7408198.362160 
-332239.162001  7408207.520591 
-332218.043404  7408210.370103 
-332197.238164  7408205.890870 
-332176.004120  7408191.043414 
-332155.042202  7408172.656563 
-332132.546485  7408155.269541 
-332103.915572  7408142.641704 
-332089.707317  7408139.982160 
-332058.973615  7408138.452422 
-332019.820512  7408141.151960 
-331972.050098  7408139.972162 
-331925.632065  7408127.944222 
-331887.897314  7408110.167267 
-331853.213668  7408091.670435 
-331824.376599  7408073.723509 
-331782.848582  7408052.127209 
-331740.050645  7408032.030651 
-331703.280702  7408020.592610 
-331673.091252  7408013.753782 
-331636.007953  7408010.904270 
-331595.593176  7408012.823941 
-331569.642288  7408017.153199 
-331540.665034  7408018.412984 
-331503.837368  7408016.073384 
-331472.345013  7408012.763951 
-331444.629432  7408015.563472 
-331423.411880  7408033.830343 
-331402.491193  7408044.768469 
-331385.396757  7408054.736762 
-331370.627758  7408059.665917 
-331352.304633  7408063.295296 
-331324.399389  7408055.976549 
-331301.400652  7408039.089442 
-331282.211673  7408020.722588 
-331189.021020  7407898.183578 
-331104.323985  7407868.428675 
-331015.198725  7407836.004229 
-331030.314065  7407833.464664 
-331045.932426  7407833.464664 
-331057.774013  7407834.224533 
-331069.112581  7407837.523968 
-331126.770225  7407861.409877 
-331135.082426  7407864.199399 
-331142.380340  7407864.449356 
-331150.436907  7407862.169747 
-331158.006947  7407856.830661 
-331169.947489  7407845.912531 
-331268.729086  7407758.257546 
-331290.919693  7407735.391463 
-331306.571038  7407711.755511 
-331330.584062  7407693.118704 
-331330.311936  7407667.813038 
-331339.663162  7407646.466695 
-331345.979775  7407626.140176 
-331349.278267  7407606.333569 
-331352.815900  7407393.929952 
-331350.828558  7407376.142999 
-331347.068277  7407362.165393 
-331342.301956  7407351.497220 
-331333.750615  7407338.289483 
-331298.778350  7407299.416141 
-331285.452442  7407284.928623 
-331274.402493  7407256.993408 
-331269.149644  7407218.110068 
-331265.653242  7407199.823201 
-331261.142554  7407180.256552 
-331255.122805  7407163.239467 
-331245.070650  7407142.403036 
-331210.362265  7407097.690695 
-331200.796638  7407086.002697 
-331194.257377  7407080.673610 
-331181.673629  7407072.794959 
-331174.367469  7407070.755309 
-331160.258168  7407066.945961 
-331123.240839  7407056.777703 
-331090.758936  7407046.369486 
-331084.970082  7407043.569965 
-331074.654048  7407037.980923 
-331065.591440  7407031.632010 
-331032.128236  7406991.228931 
-331001.460504  7406943.467112 
-330971.312285  7406876.398600 
-330967.543758  7406866.740255 
-330963.033070  7406854.292387 
-330965.061642  7406839.814867 
-330965.333768  7406827.616956 
-330967.098461  7406817.958611 
-330970.899974  7406803.481091 
-331000.429726  7406754.699446 
-331011.537398  7406737.422406 
-331016.336704  7406727.014189 
-331022.397684  7406716.845930 
-331028.466910  7406701.088629 
-331034.536135  7406679.752284 
-331092.498891  7406638.689318 
-331102.353136  7406599.376052 
-331109.387171  7406583.388790 
-331110.838508  7406554.503738 
-331104.439433  7406524.968797 
-331092.383443  7406506.441971 
-331069.211535  7406477.496929 
-331050.979119  7406454.580854 
-331031.666447  7406428.215370 
-331011.149825  7406398.860398 
-330987.211018  7406358.497312 
-330983.846556  7406320.233866 
-330982.857008  7406300.067321 
-330984.036219  7406268.522724 
-330988.654108  7406249.076055 
-331002.516022  7406224.980182 
-331024.088161  7406189.456267 
-331052.397471  7406171.289379 
-331087.377981  7406159.841340 
-331116.536653  7406155.742042 
-331147.361063  7406150.782892 
-331165.230645  7406151.762724 
-331190.406387  7406148.723245 
-331204.993969  7406133.715815 
-331212.588748  7406103.351016 
-331209.496411  7406069.536809 
-331205.686653  7406036.152527 
-331211.953788  7406017.065796 
-331222.475978  7406007.887369 
-331253.580760  7405949.657343 
-331261.216770  7405910.524046 
-331243.083309  7405875.200097 
-331213.504079  7405848.474674 
-331181.038669  7405828.428108 
-331196.310688  7405779.746447 
-331252.442780  7405661.566690 
-331300.188456  7405584.699857 
-331288.849889  7405477.058295 
-331273.346975  7405361.218137 
-331260.573564  7405250.847043 
-331359.083035  7405196.126416 
-331368.203366  7405189.737510 
-331381.892109  7405176.049855 
-331415.643931  7405155.983292 
-331448.472175  7405128.627978 
-331466.712837  7405114.030478 
-331514.153402  7405076.636883 
-331531.478733  7405046.532040 
-331559.763304  7404992.721257 
-331623.597376  7404951.668289 
-331613.858577  7404874.261548 
-331623.787039  7404819.110995 
-331654.611449  7404750.092817 
-331647.313535  7404731.845943 
-331644.584033  7404697.181880 
-331701.128436  7404621.484847 
-331708.426350  7404603.237972 
-331704.781516  7404578.612190 
-331687.447939  7404555.806097 
-331615.392376  7404483.748440 
-331588.031383  7404438.146251 
-331604.499105  7404415.940055 
-331631.810621  7404376.116876 
-331660.086946  7404335.983750 
-331665.562443  7404318.656718 
-331659.171615  7404302.239531 
-331583.471217  7404163.593279 
-331602.618965  7404094.265155 
-331796.809450  7403685.145233 
-331857.947004  7403562.876177 
-331807.001791  7403550.838239 
-331767.898166  7403538.960273 
-331709.753993  7403522.123157 
-331665.422257  7403518.013861 
-331638.391113  7403506.575821 
-331590.562976  7403467.072587 
-331583.289800  7403464.992943 
-331483.493917  7403408.852560 
-331475.173470  7403403.653450 
-331399.283409  7403374.538437 
-331376.400119  7403369.349326 
-331343.126579  7403364.150217 
-331377.958657  7403299.421304 
-331410.712685  7403265.637091 
-331460.973461  7403232.442777 
-331479.073937  7403196.368956 
-331485.712153  7403184.620968 
-331522.647020  7403107.174234 
-331532.460034  7403055.783037 
-331524.485929  7402976.576605 
-331498.246423  7402921.656012 
-331474.480787  7402871.914532 
-331458.730486  7402813.554529 
-331466.143848  7402754.274683 
-331478.801812  7402691.455443 
-331448.752547  7402630.965805 
-331429.093533  7402492.159581 
-331327.211354  7402452.326404 
-331310.537475  7402445.847514 
-331261.381694  7402416.782492 
-331188.270613  7402388.417351 
-331091.006323  7402346.734491 
-331090.090991  7402315.249884 
-331095.888091  7402291.134015 
-331061.377616  7402270.787500 
-330962.266170  7402191.131144 
-330997.931118  7402164.765660 
-331025.250880  7402135.560663 
-331089.711665  7402052.364914 
-331113.469055  7402011.481917 
-331165.346092  7401924.006900 
-331193.441000  7401881.944105 
-331192.921488  7401863.527260 
-331218.723943  7401784.370819 
-331227.613380  7401707.873922 
-331234.721631  7401641.165348 
-331239.166349  7401619.029140 
-331257.852308  7401563.778604 
-331279.836759  7401534.623598 
-331311.592993  7401502.479104 
-331338.797308  7401473.794018 
-331377.546345  7401436.040484 
-331390.558897  7401423.512630 
-331558.476892  7401457.046886 
-331626.961838  7401471.274449 
-331715.023335  7401484.622163 
-331754.151699  7401495.290336 
-331783.508280  7401512.197439 
-331848.043281  7401567.807914 
-331877.944114  7401587.154600 
-331904.117650  7401602.991887 
-331925.302216  7401611.560420 
-331951.780863  7401620.538882 
-332001.621081  7401630.527171 
-332096.526949  7401640.395480 
-332210.308440  7401645.144667 
-332273.260165  7401648.704057 
-332322.193297  7401649.483924 
-332390.439102  7401654.613045 
-332497.706070  7401666.161067 
-332547.999831  7401686.017666 
-332584.637834  7401705.004413 
-332686.585983  7401761.494737 
-332747.360703  7401798.968318 
-332769.576049  7401817.455152 
-332791.766655  7401840.901136 
-332837.417788  7401915.998272 
-332850.916868  7401934.405119 
-332871.548937  7401962.030387 
-332893.351971  7401985.846308 
-332919.327597  7402009.322287 
-332944.618786  7402024.779639 
-332971.080941  7402036.667603 
-333019.280159  7402056.344232 
-333080.269281  7402069.132042 
-333169.303833  7402072.081536 
-333242.818979  7402071.341663 
-333376.861458  7402093.727829 
-333449.147916  7402093.737827 
-333512.107887  7402089.308586 
-333563.259256  7402105.045890 
-333701.466081  7402224.075501 
-333742.952868  7402258.219653 
-333765.003289  7402271.497378 
-333798.136643  7402290.464129 
-333867.231810  7402319.499156 
-333895.763768  7402354.423174 
-333935.106534  7402371.140310 
-334022.656765  7402375.569552 
-334081.683284  7402366.711069 
-334108.318609  7402360.422146 
-334132.339879  7402341.135450 
-334197.270699  7402308.181095 
-334249.403369  7402244.242047 
-334277.110704  7402221.205993 
-334359.581257  7402151.287969 
-334379.256763  7402229.984489 
-Region 1
-204
-330950.853387  7387691.874736 
-330876.662050  7387602.300079 
-330805.068275  7387510.095873 
-330727.677401  7387424.140596 
-330650.500928  7387338.625244 
-330572.837928  7387253.559815 
-330555.512597  7387229.943860 
-330497.970400  7387158.766052 
-330461.398367  7387176.463021 
-330438.663509  7387188.420973 
-330400.697863  7387206.217924 
-330386.456623  7387212.146909 
-330329.516400  7387242.991625 
-330296.300583  7387258.418983 
-330273.763635  7387267.907357 
-330213.376488  7387275.576044 
-330169.918852  7387293.382994 
-330042.836192  7387321.478181 
-329998.760089  7387334.725912 
-329956.506403  7387349.743340 
-329924.271887  7387362.961076 
-329829.761838  7387433.409008 
-329740.587100  7387502.307207 
-329652.805975  7387578.354181 
-329605.571565  7387620.936887 
-329557.446563  7387656.030875 
-329464.725946  7387678.197079 
-329432.969712  7387693.814403 
-329406.383864  7387707.422073 
-329328.267321  7387745.315582 
-329274.023616  7387773.140816 
-329225.700704  7387805.805220 
-329174.508105  7387845.418435 
-329136.212609  7387890.930639 
-329066.350543  7387999.981960 
-329034.149013  7388047.893753 
-329006.243768  7388077.138743 
-328983.261523  7388096.585412 
-328960.468942  7388116.581987 
-328986.312629  7388192.758939 
-329012.906723  7388275.254808 
-329055.539735  7388390.215116 
-329088.912230  7388478.939919 
-329097.075999  7388502.625861 
-329111.119330  7388543.218908 
-329130.357786  7388609.337583 
-329134.142806  7388619.945765 
-329163.746774  7388720.938466 
-329173.427848  7388746.374109 
-329198.026354  7388826.670355 
-329207.212655  7388865.033784 
-329216.481419  7388942.070588 
-329224.603956  7389003.320097 
-329228.430207  7389063.709753 
-329229.452739  7389149.984975 
-329226.682006  7389231.930938 
-329226.640775  7389247.018354 
-329223.804071  7389267.674815 
-329224.958544  7389292.110630 
-329226.236709  7389313.546958 
-329234.128352  7389362.398590 
-329238.474116  7389374.726478 
-329255.345904  7389427.987355 
-329279.738254  7389518.331880 
-329304.221313  7389600.217854 
-329308.962895  7389631.062570 
-329315.873237  7389695.391551 
-329321.340487  7389748.372476 
-329328.992989  7389856.913884 
-329330.823653  7389873.611024 
-329337.321682  7389930.331308 
-329343.951652  7389978.463064 
-329344.891722  7389999.999375 
-329353.459556  7390068.967561 
-329357.467224  7390103.261687 
-329360.493591  7390113.799882 
-329365.482560  7390131.796799 
-329372.277454  7390162.451548 
-329404.033688  7390283.320844 
-329424.756466  7390370.725873 
-329436.779470  7390407.749531 
-329446.889349  7390442.423592 
-329460.850218  7390496.864266 
-329462.548941  7390502.603283 
-329468.123393  7390520.980136 
-329474.662654  7390546.525760 
-329493.447567  7390599.246729 
-329511.952109  7390647.118529 
-329532.287314  7390699.719519 
-329583.422190  7390823.248360 
-329684.768365  7390895.316015 
-329742.887798  7390927.450511 
-329789.462509  7390960.114916 
-329836.202144  7390988.010137 
-329893.736095  7391025.903647 
-330043.256749  7391125.106654 
-330125.809764  7391177.297714 
-330205.006564  7391226.889220 
-330282.422177  7391276.850662 
-330364.488664  7391331.081372 
-330388.782060  7391339.559920 
-330454.281870  7391387.281746 
-330490.524053  7391405.308658 
-330537.601784  7391447.391450 
-330564.690652  7391470.517488 
-330605.517740  7391515.519780 
-330653.477817  7391561.041982 
-330672.823474  7391582.798256 
-330735.577290  7391647.837115 
-330804.053989  7391714.025778 
-330840.279680  7391748.169929 
-330879.259612  7391793.582150 
-330950.474060  7391859.860797 
-330984.069204  7391894.364887 
-331016.509875  7391928.729001 
-331075.998183  7391991.998163 
-331142.306124  7392053.467634 
-331175.521941  7392089.601445 
-331228.330802  7392143.752169 
-331268.399237  7392184.845130 
-331356.386518  7392080.083075 
-331372.780024  7392078.383366 
-331457.023516  7392028.971830 
-331476.921671  7392021.553101 
-331503.029237  7392006.015762 
-331513.609151  7392000.046785 
-331547.410451  7391976.780770 
-331571.753323  7391955.614396 
-331580.213956  7391937.117564 
-331567.753902  7391862.920273 
-331566.418012  7391788.333049 
-331562.459821  7391723.314187 
-331560.373525  7391612.173224 
-331552.712777  7391549.134022 
-331529.359452  7391440.092700 
-331530.579894  7391396.140229 
-331532.938316  7391370.984537 
-331538.380828  7391348.338417 
-331546.602320  7391322.142904 
-331564.241007  7391298.396971 
-331618.971240  7391230.768555 
-331663.690549  7391190.525448 
-331671.474991  7391181.546986 
-331706.711134  7391153.281828 
-331723.253073  7391033.212395 
-331796.190983  7390927.970422 
-331796.182737  7390927.970422 
-331839.458955  7390873.599735 
-331877.581279  7390814.959779 
-331878.562581  7390809.360739 
-331879.543882  7390803.001828 
-331883.601028  7390765.178307 
-331883.601028  7390765.138313 
-331888.837384  7390642.429332 
-331872.179998  7390625.002317 
-331824.459062  7390497.804105 
-331824.607494  7390483.056631 
-331847.127950  7390357.198190 
-331728.703831  7390216.982208 
-331712.623682  7390192.006486 
-331686.120296  7390140.935234 
-331683.753628  7390117.869185 
-331690.259904  7390088.884150 
-331696.757934  7390068.057717 
-331725.850636  7390000.039368 
-331798.821531  7389936.790202 
-331619.870079  7389999.569448 
-331573.757157  7390028.264533 
-331581.788986  7390000.029370 
-331590.562976  7389974.213792 
-331596.401307  7389945.818655 
-331600.343005  7389909.554867 
-331608.127447  7389827.828866 
-331608.127447  7389775.287866 
-331601.621171  7389634.431993 
-331591.973081  7389489.226866 
-331578.226614  7389343.421841 
-331578.127660  7389255.396918 
-331576.395951  7389246.048520 
-331565.123354  7389145.125807 
-331560.076661  7389059.460481 
-331547.740300  7388943.680313 
-331545.851913  7388925.883361 
-331541.926707  7388871.402693 
-331540.986637  7388852.895863 
-331538.438552  7388785.307441 
-331532.732160  7388713.909670 
-331520.626693  7388586.401511 
-331521.179191  7388538.669687 
-331517.476633  7388496.326940 
-331513.642136  7388457.623570 
-331510.797186  7388430.008300 
-331498.073253  7388382.796387 
-331463.323637  7388306.159514 
-331455.530949  7388292.701819 
-331443.376005  7388275.174822 
-331405.228942  7388230.022556 
-331323.137716  7388135.448755 
-331245.985982  7388045.284200 
-331219.391888  7388014.299507 
-331175.282800  7387955.529574 
-331101.470790  7387869.504309 
-331026.273412  7387779.479730 
-330950.853387  7387691.874736 
-Region 1
-153
-337781.107277  7391268.692059 
-337798.399623  7391265.962527 
-337819.782099  7391265.722568 
-337833.281178  7391265.822551 
-337862.093508  7391269.311953 
-337869.498623  7391271.001664 
-337886.353919  7391275.130956 
-337913.698420  7391284.479355 
-337933.167770  7391295.177523 
-337948.546990  7391305.165812 
-337968.321451  7391320.183239 
-337985.556073  7391335.990532 
-338007.746680  7391362.915920 
-338038.653553  7391418.696365 
-338082.746148  7391495.333238 
-338162.973726  7391634.719362 
-338198.754121  7391692.359489 
-338219.509883  7391732.442623 
-338230.172259  7391750.289566 
-338242.368434  7391771.745891 
-338248.858218  7391782.853988 
-338255.611881  7391794.961914 
-338265.573327  7391813.228785 
-338268.179136  7391826.566500 
-338272.632101  7391838.464462 
-338280.061955  7391857.291238 
-338284.696336  7391876.407963 
-338288.835944  7391901.013748 
-338289.132808  7391927.169268 
-338289.561612  7391943.666442 
-338286.287859  7391970.381866 
-338283.080075  7392002.116430 
-338318.233756  7392011.954745 
-338393.637289  7392050.198194 
-338450.701205  7392073.724165 
-338487.108314  7392093.220825 
-338586.755765  7392144.961962 
-338636.868109  7392167.808049 
-338611.337778  7392195.423319 
-338590.631493  7392219.939119 
-338588.446242  7392233.416811 
-338591.406639  7392251.953635 
-338608.542306  7392270.010542 
-338625.686220  7392297.625812 
-338645.774038  7392319.961986 
-338647.472761  7392340.268508 
-338651.101103  7392378.112026 
-338650.721776  7392394.879154 
-338648.429324  7392425.653882 
-338642.970319  7392475.225391 
-338640.636636  7392502.430731 
-338638.302953  7392527.856376 
-338630.328848  7392550.272536 
-338614.157989  7392569.429255 
-338596.461578  7392587.576146 
-338571.887811  7392607.052810 
-338549.342616  7392625.749608 
-338527.531336  7392640.367104 
-338509.002056  7392650.145429 
-338454.939768  7392650.485371 
-338366.498944  7392656.654314 
-338266.851493  7392663.903072 
-338213.061331  7392665.772752 
-338185.807538  7392671.281808 
-338172.918680  7392684.829488 
-338059.780395  7392788.461736 
-338033.169809  7392808.448313 
-337956.562326  7392880.925898 
-337952.950477  7392884.175342 
-337924.591690  7392908.251218 
-337872.277603  7392965.751368 
-337794.969191  7393053.906268 
-337870.941714  7393206.140192 
-337913.327339  7393305.983090 
-337963.357220  7393405.266083 
-338013.337624  7393505.148974 
-338032.147277  7393552.460870 
-338055.014074  7393603.382148 
-338068.744048  7393629.967594 
-338096.740001  7393684.928180 
-338118.048261  7393733.839802 
-338133.946994  7393769.363717 
-338145.565933  7393793.629560 
-338164.425062  7393824.564261 
-338173.025881  7393846.050581 
-338195.068055  7393889.113205 
-338228.861109  7393967.659750 
-338244.372268  7393992.205546 
-338255.941730  7394018.121107 
-338291.515969  7394089.498881 
-338299.762200  7394106.375990 
-338341.290217  7394195.380744 
-338375.371889  7394264.068978 
-338333.967564  7394304.512051 
-338279.212593  7394351.314034 
-338217.926607  7394405.674722 
-338169.257353  7394451.756829 
-338115.640362  7394499.328680 
-338061.644044  7394546.900532 
-338025.616262  7394580.524772 
-337995.360842  7394607.700117 
-337958.211573  7394639.784622 
-337904.611073  7394684.296997 
-337848.759353  7394747.916100 
-337815.568275  7394785.729623 
-337759.139318  7394852.738145 
-337698.108965  7394922.766149 
-337663.573752  7394962.509342 
-337605.990323  7395029.127931 
-337506.590259  7395143.058415 
-337475.097904  7395180.921930 
-337376.464739  7395297.102029 
-337327.836717  7395353.772322 
-337262.378138  7395428.069596 
-337206.922237  7395491.548722 
-337132.285603  7395575.474346 
-336984.925462  7395475.271510 
-336808.687020  7395371.189339 
-336685.513073  7395293.952569 
-336572.729377  7395262.567944 
-336276.516526  7395188.630609 
-336216.475720  7395186.211024 
-336182.369310  7395177.112582 
-335857.632747  7395110.094062 
-335656.894755  7395017.779874 
-335587.263583  7395004.422162 
-335344.659478  7394957.800148 
-335168.849840  7394911.948002 
-335228.503073  7394820.743625 
-335289.929245  7394724.460117 
-335280.042014  7394715.811599 
-335500.150403  7394362.392136 
-335608.637813  7394186.182320 
-336313.838965  7392782.352783 
-336383.791740  7392813.077520 
-336673.597270  7392212.990309 
-336820.619316  7391918.950676 
-336900.426336  7391738.321616 
-336999.084240  7391512.680266 
-337127.222418  7391202.363421 
-337197.422579  7391194.214817 
-337243.238637  7391190.465459 
-337454.812176  7391172.668507 
-337651.880596  7391163.470083 
-337661.050405  7391163.620057 
-337663.417073  7391164.229953 
-337670.500585  7391166.049641 
-337755.280083  7391164.089977 
-337722.056019  7391295.257509 
-337734.969616  7391287.748795 
-337757.003545  7391275.820838 
-337767.138162  7391272.401424 
-337781.107277  7391268.692059 
-Region 1
-188
-324062.075998  7390490.355381 
-324117.342236  7390513.591401 
-324227.858219  7390559.063612 
-324334.053177  7390604.775782 
-324379.390953  7390628.291754 
-324440.998542  7390650.747907 
-324472.581606  7390663.375744 
-324555.043912  7390684.282163 
-324604.001784  7390689.501269 
-324674.630749  7390703.828815 
-324730.647394  7390727.324791 
-324759.443231  7390743.262061 
-324826.740720  7390794.393302 
-324856.270472  7390805.751357 
-324934.692125  7390836.296125 
-324976.459283  7390855.002920 
-325023.569999  7390879.608706 
-325052.877103  7390894.176210 
-325078.588850  7390903.014696 
-325162.387046  7390943.447771 
-325182.771728  7390957.115429 
-325256.682693  7391003.107551 
-325320.937322  7391062.417392 
-325437.811149  7391267.512261 
-325452.110113  7391284.489353 
-325473.632775  7391300.336639 
-325530.078224  7391341.749545 
-325622.386530  7391411.807545 
-325673.076110  7391447.831374 
-325707.380429  7391507.831097 
-325768.270596  7391657.715423 
-325833.217909  7391818.697848 
-325857.791676  7391863.610155 
-325910.518075  7391963.663017 
-325976.306503  7391999.996793 
-326040.256022  7392044.599153 
-326071.138155  7392074.154091 
-326121.621579  7392074.324062 
-326211.192137  7392088.081705 
-326277.293922  7392098.559910 
-326316.323331  7392102.299270 
-326424.423169  7392114.857119 
-326651.664547  7391907.422650 
-326759.541736  7391794.821938 
-326860.442614  7391683.840948 
-327092.664715  7391254.324520 
-327328.061615  7390841.665205 
-327345.634333  7390811.380393 
-327372.566522  7390717.226520 
-327377.555492  7390662.395912 
-327395.078732  7390570.111720 
-327403.588842  7390517.900663 
-327406.870842  7390496.824273 
-327404.850515  7390434.334977 
-327394.386049  7390396.111524 
-327376.128894  7390317.035069 
-327326.197967  7390145.214501 
-327270.643111  7389992.270699 
-327244.354128  7389902.246119 
-327212.903004  7389782.366653 
-327186.704730  7389699.290883 
-327144.277873  7389577.651719 
-327122.384131  7389496.095689 
-327107.623378  7389441.205091 
-327007.431675  7389127.458833 
-326938.171584  7388890.539415 
-326844.172801  7388598.099508 
-326817.735386  7388511.764296 
-326765.190404  7388338.873911 
-326728.527663  7388202.547262 
-326705.322769  7388085.307344 
-326682.670374  7387922.005316 
-326633.341422  7387701.123151 
-326617.929217  7387624.406292 
-326584.243365  7387461.304230 
-326538.542755  7387161.385604 
-326512.962947  7387026.518705 
-326481.528316  7387032.777633 
-326401.952190  7387046.335311 
-326390.176573  7387049.974687 
-326310.542723  7387062.332571 
-326235.411316  7387071.391019 
-326155.010567  7387087.268299 
-326117.036675  7387087.368282 
-326041.146614  7387092.547395 
-325963.376413  7387100.136095 
-325835.089803  7387112.014061 
-325757.336094  7387115.973382 
-325703.752088  7387125.411766 
-325629.651459  7387134.710173 
-325534.992977  7387147.537976 
-325409.666764  7387155.786563 
-325319.403523  7387180.682298 
-325286.888636  7387223.424977 
-325252.526593  7387271.306775 
-325210.190445  7387338.915194 
-325195.693571  7387356.132245 
-325181.609009  7387381.217948 
-325173.123638  7387399.614797 
-325165.965910  7387417.691701 
-325155.691106  7387457.444891 
-325144.253584  7387500.617496 
-325108.811285  7387483.740387 
-325082.208945  7387475.031879 
-325064.108469  7387473.022223 
-325042.602299  7387479.691081 
-325033.292305  7387486.429926 
-324986.643378  7387526.703028 
-324898.639605  7387604.879637 
-324813.150931  7387695.954037 
-324783.736627  7387717.190399 
-324767.631738  7387727.578620 
-324742.381780  7387739.126642 
-324708.992792  7387750.804641 
-324678.069427  7387757.873431 
-324644.779394  7387760.163038 
-324616.519562  7387759.333181 
-324583.922212  7387757.043573 
-324557.542520  7387746.535373 
-324516.740171  7387725.878911 
-324455.041873  7387687.525481 
-324410.850323  7387676.807317 
-324362.684090  7387672.218103 
-324319.729474  7387674.917640 
-324226.992365  7387682.176397 
-324142.649918  7387689.815088 
-323934.168714  7387709.631694 
-323727.130602  7387729.138353 
-323789.076286  7387832.960569 
-323851.747639  7387938.522487 
-323889.441159  7388000.001956 
-323911.887399  7388042.034756 
-323924.570102  7388067.140456 
-323946.406121  7388106.273753 
-323967.640165  7388153.025745 
-323975.070018  7388183.310557 
-323979.580707  7388206.286622 
-323984.577922  7388256.897952 
-323989.204058  7388297.161056 
-323999.957142  7388360.750163 
-324000.781766  7388368.738795 
-324002.620675  7388431.478048 
-324007.741584  7388477.370187 
-324009.481539  7388510.394531 
-324009.110458  7388541.409218 
-324004.137981  7388572.803840 
-324002.299072  7388589.840922 
-323999.998374  7388600.319127 
-323992.906615  7388612.277079 
-323989.979203  7388620.055747 
-323987.126008  7388654.889780 
-323986.763173  7388677.915836 
-323988.808239  7388705.261152 
-324010.891644  7388749.303608 
-324026.081201  7388763.101244 
-324034.360417  7388773.669434 
-324099.217021  7388830.589684 
-324228.369485  7388940.110924 
-324317.453515  7389019.857264 
-324419.129539  7389110.401755 
-324497.691378  7389175.600587 
-324544.043441  7389206.235339 
-324506.333428  7389206.895226 
-324496.660599  7389224.092281 
-324498.103690  7389238.299847 
-324502.630870  7389253.997158 
-324522.792904  7389258.336415 
-324489.370931  7389478.298737 
-324470.833405  7389604.827064 
-324468.268827  7389624.423708 
-324458.191933  7389653.008811 
-324440.907834  7389675.584944 
-324430.377397  7389688.912661 
-324419.343941  7389702.010418 
-324405.778891  7389717.417778 
-324388.478299  7389754.021509 
-324383.489330  7389767.489202 
-324366.510341  7389831.678207 
-324359.723693  7389871.741344 
-324326.977911  7389999.999375 
-324327.299514  7390003.518772 
-324321.518907  7390025.105074 
-324313.487078  7390058.119419 
-324307.203450  7390079.445766 
-324291.791245  7390110.190500 
-324257.124091  7390165.591010 
-324170.340760  7390305.107113 
-324062.075998  7390490.355381 
-Region 1
-65
-336038.802435  7397323.244969 
-336046.026133  7397286.361287 
-336088.180864  7397241.199023 
-336000.003920  7397141.376122 
-335983.371272  7397124.139074 
-335961.964058  7397100.653097 
-335895.689102  7397028.375478 
-335841.511366  7396969.895495 
-335788.347918  7396911.155556 
-335708.483174  7396822.300776 
-335608.951170  7396714.019324 
-335504.867247  7396602.918355 
-335403.067529  7396491.327469 
-335317.249007  7396569.614059 
-335272.397758  7396520.072545 
-335176.411634  7396413.840742 
-335107.877211  7396336.993905 
-335045.651154  7396268.285674 
-334979.969927  7396274.794559 
-334874.756270  7396281.063485 
-334756.373383  7396289.032120 
-334605.500347  7396302.929740 
-334507.873223  7396312.538094 
-334411.252138  7396323.436227 
-334306.178667  7396351.301454 
-334205.417975  7396378.426808 
-334184.876614  7396381.876217 
-334113.934292  7396408.831600 
-334118.865538  7396494.736885 
-334104.838700  7396536.829675 
-334057.480597  7396642.061650 
-334029.426921  7396691.163239 
-334056.185939  7396718.558546 
-334073.725672  7396874.941759 
-334074.154476  7396897.007980 
-334077.147857  7397051.241561 
-334079.011505  7397178.539756 
-334080.767953  7397276.622955 
-334080.743214  7397329.973817 
-334082.491415  7397382.074892 
-334084.058199  7397468.200140 
-334085.303379  7397567.043209 
-334088.750304  7397633.881760 
-334091.413836  7397801.832991 
-334095.207102  7397991.890436 
-334098.390147  7398060.788635 
-334304.290280  7398055.099609 
-334441.524051  7398082.554906 
-334606.209523  7398132.456359 
-334733.465354  7398142.434649 
-334783.082924  7398135.865775 
-334848.244639  7398117.488922 
-334992.965987  7398055.099609 
-335127.709395  7397964.025209 
-335354.777603  7397761.919828 
-335499.498950  7397689.552224 
-335611.779627  7397659.617352 
-335763.988552  7397654.628206 
-335901.040906  7397676.464466 
-335944.655219  7397680.753731 
-335969.196002  7397597.128055 
-335989.118895  7397520.771135 
-336000.003920  7397482.547682 
-336009.132497  7397449.823287 
-336038.802435  7397323.244969 
-Region 1
-763
-348625.263412  7390704.878635 
-348657.308264  7390703.318903 
-348670.098168  7390690.301132 
-348686.433951  7390682.262509 
-348708.443140  7390667.345065 
-348721.703079  7390653.607418 
-348756.188816  7390604.435840 
-348788.629487  7390555.384242 
-348828.598967  7390503.513127 
-348834.123942  7390491.945109 
-348840.358092  7390481.266938 
-348852.216172  7390467.849236 
-348858.639985  7390460.410511 
-348875.470542  7390441.533744 
-348889.505627  7390427.176203 
-348896.094365  7390421.707140 
-348902.452209  7390418.667661 
-348912.792982  7390415.118269 
-348928.765931  7390410.079132 
-348949.727849  7390406.639721 
-348964.744235  7390405.359940 
-348995.436705  7390408.219450 
-349006.931951  7390411.668860 
-349014.460760  7390414.508373 
-349022.072030  7390418.357714 
-349029.609085  7390420.207397 
-349033.789924  7390420.247390 
-349040.634296  7390419.877453 
-349048.212582  7390417.407876 
-349054.595164  7390412.378738 
-349065.925485  7390402.420444 
-349081.098549  7390386.073244 
-349085.122710  7390381.683996 
-349088.709820  7390380.284235 
-349091.257906  7390380.314230 
-349094.003900  7390381.444037 
-349097.055006  7390382.473860 
-349101.532709  7390383.963605 
-349104.072548  7390385.093412 
-349106.694849  7390387.662972 
-349113.671161  7390394.271839 
-349117.109839  7390397.081358 
-349120.367100  7390398.551106 
-349125.570471  7390398.161173 
-349132.629245  7390397.241331 
-349142.953526  7390395.571617 
-349154.729143  7390391.932240 
-349162.703248  7390390.572473 
-349170.454705  7390390.872422 
-349182.890021  7390392.442153 
-349190.657970  7390391.852254 
-349193.939970  7390390.012569 
-349196.009774  7390387.263040 
-349196.760181  7390383.503684 
-349197.848683  7390377.204763 
-349197.230216  7390367.896357 
-349195.432537  7390354.358676 
-349197.551819  7390336.661708 
-349200.380276  7390329.382954 
-349205.855773  7390323.134025 
-349212.230109  7390318.544811 
-349221.457641  7390314.765458 
-349234.165083  7390310.136251 
-349256.776247  7390304.607198 
-349273.458372  7390300.347928 
-349285.613316  7390298.818190 
-349294.799617  7390299.348099 
-349302.336671  7390300.427914 
-349310.690103  7390302.067633 
-349317.320073  7390302.907489 
-349322.424489  7390302.187613 
-349328.370022  7390299.918001 
-349335.915323  7390290.699580 
-349344.326478  7390276.831956 
-349350.535890  7390268.693350 
-349353.512779  7390266.623704 
-349359.862376  7390265.023978 
-349365.073994  7390263.974158 
-349369.799084  7390260.924681 
-349373.460411  7390252.656097 
-349378.886431  7390241.188061 
-349383.463089  7390232.599532 
-349390.348691  7390227.800355 
-349398.339289  7390225.330778 
-349406.082499  7390226.410593 
-349414.741041  7390228.270274 
-349426.863000  7390230.499892 
-349438.894251  7390231.839663 
-349448.666034  7390234.269246 
-349451.477999  7390238.508520 
-349452.558255  7390242.727798 
-349452.112959  7390246.377173 
-349450.851285  7390250.346493 
-349449.185547  7390253.106020 
-349443.949190  7390256.365462 
-349431.233503  7390262.104479 
-349425.164277  7390266.253768 
-349422.451267  7390272.432709 
-349421.684368  7390277.851781 
-349423.729433  7390287.390147 
-349428.339076  7390295.638734 
-349435.092739  7390303.567376 
-349441.384613  7390307.176758 
-349447.181713  7390308.896464 
-349452.591240  7390308.956453 
-349460.878702  7390307.376724 
-349474.913786  7390302.207609 
-349486.112168  7390294.568918 
-349499.578262  7390285.400488 
-349509.457247  7390277.751798 
-349514.940990  7390270.393059 
-349518.297206  7390262.004496 
-349519.789774  7390255.495611 
-349518.445638  7390247.396998 
-349515.963523  7390240.278217 
-349511.757945  7390232.819495 
-349507.873970  7390223.031171 
-349506.628790  7390215.712425 
-349506.735991  7390204.964266 
-349508.459453  7390196.345742 
-349510.372578  7390188.947010 
-349510.636458  7390182.858053 
-349509.968513  7390178.868736 
-349506.735991  7390175.179368 
-349502.579890  7390172.809774 
-349495.380931  7390168.300546 
-349485.543178  7390161.891644 
-349482.327148  7390157.202447 
-349482.360133  7390153.443091 
-349483.316695  7390149.903698 
-349486.227615  7390145.284489 
-349490.639348  7390142.564955 
-349495.859212  7390141.505136 
-349500.749227  7390142.444975 
-349504.996036  7390146.474285 
-349510.553995  7390151.623403 
-349515.386286  7390158.212274 
-349518.923919  7390161.571699 
-349522.585246  7390162.491541 
-349525.240532  7390162.521536 
-349529.437864  7390161.121776 
-349534.665974  7390158.852165 
-349551.125450  7390146.174336 
-349562.529987  7390139.095549 
-349568.896077  7390135.726126 
-349571.056590  7390133.316539 
-349571.089574  7390130.766975 
-349568.962047  7390128.857303 
-349565.407922  7390126.827650 
-349560.542646  7390123.898152 
-349555.693862  7390119.418919 
-349550.375043  7390110.510445 
-349549.731837  7390103.301680 
-349550.713139  7390097.442684 
-349553.607566  7390093.483362 
-349556.691656  7390091.193754 
-349563.049500  7390088.714179 
-349571.732780  7390088.134278 
-349582.032323  7390088.684184 
-349597.188894  7390093.493360 
-349616.204702  7390100.442170 
-349624.854998  7390103.191699 
-349637.282068  7390105.091373 
-349648.496942  7390106.201183 
-349659.299504  7390107.640937 
-349670.497885  7390110.860385 
-349681.267462  7390115.619570 
-349695.863290  7390125.517875 
-349701.924270  7390131.666821 
-349703.309637  7390135.676135 
-349706.303018  7390142.674936 
-349709.106737  7390147.364133 
-349712.347505  7390150.493596 
-349719.760867  7390153.343108 
-349738.075745  7390158.842166 
-349753.042654  7390162.541533 
-349758.856246  7390163.481372 
-349766.805613  7390164.561187 
-349776.198069  7390164.221245 
-349785.598772  7390163.101437 
-349797.168234  7390159.672024 
-349825.147694  7390148.333966 
-349834.870000  7390145.884386 
-349841.392769  7390146.614261 
-349848.402065  7390149.783718 
-349851.816004  7390154.922838 
-349853.869316  7390163.581355 
-349854.339351  7390167.790634 
-349855.955612  7390169.690308 
-349861.571295  7390169.190394 
-349867.714737  7390167.710647 
-349877.321596  7390166.360879 
-349896.650760  7390162.351565 
-349910.702337  7390155.962660 
-349924.465296  7390147.244153 
-349952.411772  7390139.335508 
-349984.613303  7390133.686475 
-350008.634573  7390130.836963 
-350036.292430  7390130.457029 
-350065.170730  7390131.196902 
-350075.503257  7390129.197244 
-350084.928699  7390125.637854 
-350091.682361  7390123.608202 
-350099.483296  7390119.698871 
-350106.863672  7390116.449428 
-350125.368214  7390112.990021 
-350136.426409  7390110.000533 
-350142.380187  7390106.071206 
-350151.846860  7390098.752459 
-350162.657669  7390089.564033 
-350171.909939  7390082.895175 
-350182.052803  7390079.455765 
-350193.061521  7390081.015497 
-350202.198345  7390085.534723 
-350208.861299  7390092.363554 
-350216.332384  7390101.072062 
-350220.455499  7390106.651106 
-350225.815549  7390111.140337 
-350235.875951  7390115.669562 
-350244.534493  7390117.419262 
-350252.698261  7390117.499248 
-350260.268301  7390115.479594 
-350268.976320  7390112.580091 
-350279.853099  7390107.041040 
-350289.509435  7390100.822105 
-350306.241037  7390091.473706 
-350325.669156  7390077.946023 
-350332.975316  7390071.927054 
-350337.535482  7390065.218203 
-350338.541522  7390057.029606 
-350340.083567  7390045.861519 
-350341.807029  7390037.242995 
-350343.299597  7390031.164037 
-350344.017019  7390020.765818 
-350345.550818  7390010.037655 
-350347.043386  7390003.958697 
-350352.568360  7389993.270527 
-350358.027365  7389987.791466 
-350364.607857  7389983.212250 
-350367.502284  7389979.912815 
-350368.467093  7389975.493572 
-350367.988812  7389971.724218 
-350364.137822  7389959.396330 
-350359.247807  7389938.299943 
-350356.444089  7389913.354216 
-350354.596933  7389884.659132 
-350355.281370  7389867.832014 
-350357.441883  7389855.784078 
-350360.196124  7389846.175723 
-350365.185093  7389836.927308 
-350370.470927  7389829.118645 
-350377.241083  7389826.079166 
-350390.938072  7389824.339464 
-350406.127628  7389825.489267 
-350421.102783  7389828.858690 
-350430.651918  7389832.498066 
-350436.729390  7389836.987297 
-350443.887119  7389845.705804 
-350446.913485  7389849.715117 
-350448.109189  7389852.274679 
-350451.358204  7389853.644444 
-350458.590148  7389855.594110 
-350469.384464  7389857.373805 
-350477.325584  7389859.553432 
-350486.149051  7389865.182468 
-350496.893889  7389872.601197 
-350503.655798  7389879.649990 
-350510.805280  7389889.468308 
-350515.225260  7389895.827219 
-350519.158712  7389900.516415 
-350521.492395  7389901.976165 
-350524.559993  7389901.786198 
-350525.483571  7389901.136309 
-350527.635837  7389899.936515 
-350532.781485  7389896.227150 
-350536.780907  7389893.717580 
-350539.658841  7389892.087859 
-350542.215173  7389891.887893 
-350547.113434  7389891.937885 
-350553.025981  7389892.007873 
-350555.788469  7389891.367982 
-350557.239805  7389889.498303 
-350557.792303  7389885.738947 
-350557.833534  7389881.089743 
-350557.874765  7389877.100426 
-350558.839574  7389873.011127 
-350560.694976  7389871.371408 
-350563.762574  7389870.411572 
-350568.446433  7389871.891319 
-350577.096728  7389874.310904 
-350584.592552  7389879.809962 
-350589.936110  7389886.068890 
-350594.809632  7389888.778426 
-350599.674908  7389891.597943 
-350606.296631  7389892.767743 
-350613.330666  7389893.837559 
-350619.333922  7389895.787225 
-350625.436133  7389897.396950 
-350632.247519  7389900.566407 
-350646.241372  7389908.794997 
-350657.604678  7389915.773802 
-350672.332446  7389922.902581 
-350679.135587  7389925.962057 
-350691.537917  7389931.181163 
-350701.804475  7389934.830538 
-350716.062207  7389937.750038 
-350729.157222  7389944.858820 
-350736.158271  7389949.138087 
-350742.219251  7389954.847109 
-350746.185688  7389956.766780 
-350754.794753  7389962.945722 
-350760.369205  7389966.665085 
-350769.423566  7389969.524595 
-350778.395465  7389970.384448 
-350785.858304  7389969.464605 
-350797.617428  7389967.045020 
-350813.202804  7389960.446150 
-350836.811763  7389947.178423 
-350844.109677  7389941.939320 
-350851.217928  7389935.690390 
-350855.951264  7389931.311140 
-350859.991917  7389925.932062 
-350860.931987  7389923.832422 
-350861.253590  7389922.282687 
-350859.645575  7389919.613144 
-350855.695631  7389916.803625 
-350848.364732  7389914.843961 
-350825.217562  7389913.284228 
-350809.203383  7389911.894466 
-350797.287579  7389909.454884 
-350791.696635  7389907.285256 
-350789.923695  7389900.956340 
-350791.102906  7389895.657248 
-350792.991293  7389890.248174 
-350797.139147  7389883.759286 
-350800.190252  7389875.480704 
-350801.715805  7389865.422427 
-350802.350765  7389853.794418 
-350803.340313  7389846.275706 
-350805.039036  7389840.316727 
-350808.337528  7389836.807328 
-350812.633814  7389835.627530 
-350818.051588  7389835.247595 
-350826.908040  7389836.997296 
-350833.199914  7389841.046602 
-350841.833717  7389844.565999 
-350849.379018  7389845.635816 
-350855.192611  7389845.695806 
-350862.259630  7389843.226229 
-350871.899474  7389838.896970 
-350880.945589  7389832.448075 
-350888.062086  7389824.999351 
-350892.836654  7389817.840577 
-350894.222020  7389811.991579 
-350894.065342  7389807.112415 
-350891.335840  7389795.014487 
-350889.035141  7389789.785383 
-350889.101111  7389783.256501 
-350890.585433  7389777.957409 
-350891.550242  7389773.538166 
-350894.642578  7389770.468691 
-350898.229689  7389769.168914 
-350905.379171  7389768.908958 
-350917.517622  7389769.038936 
-350926.002993  7389767.909130 
-350931.429013  7389766.519368 
-350936.558169  7389764.029794 
-350939.155731  7389759.400587 
-350939.724721  7389753.091668 
-350936.995219  7389740.773778 
-350936.657123  7389734.014936 
-350934.579073  7389727.456059 
-350932.764903  7389725.116460 
-350929.004621  7389724.076638 
-350925.236094  7389723.376758 
-350919.834813  7389722.546900 
-350916.800200  7389719.747379 
-350915.051999  7389711.088863 
-350916.396135  7389699.260889 
-350918.111351  7389690.852329 
-350922.927149  7389679.274312 
-350926.992541  7389670.685783 
-350930.291033  7389667.616309 
-350933.779189  7389665.876607 
-350945.546560  7389662.677155 
-350951.178736  7389661.067431 
-350957.149007  7389656.038292 
-350963.267710  7389646.799875 
-350969.336935  7389632.132387 
-350973.633222  7389621.214257 
-350975.348438  7389612.595734 
-350975.719518  7389606.286814 
-350973.163186  7389596.958412 
-350970.689317  7389589.069763 
-350971.703604  7389579.881337 
-350971.761327  7389574.122324 
-350974.482583  7389568.063362 
-350979.850880  7389561.584471 
-350981.821729  7389559.054905 
-350984.427538  7389553.435867 
-350989.705125  7389546.067129 
-350996.780391  7389542.597724 
-351004.243230  7389541.567900 
-351014.757174  7389541.447921 
-351025.584475  7389540.568071 
-351034.482158  7389538.778378 
-351046.554639  7389535.688907 
-351065.809588  7389528.910068 
-351075.416446  7389528.010222 
-351082.623652  7389532.069527 
-351087.563144  7389537.768551 
-351090.581265  7389542.007825 
-351098.200782  7389545.517223 
-351106.133656  7389547.916812 
-351112.738886  7389551.316230 
-351118.519494  7389555.025595 
-351122.964212  7389559.274867 
-351124.547489  7389564.274011 
-351125.001031  7389569.373137 
-351122.725072  7389582.200940 
-351121.702539  7389586.310236 
-351119.756429  7389593.578991 
-351118.783373  7389599.108044 
-351118.907067  7389606.416792 
-351121.479891  7389614.525403 
-351125.767931  7389624.203745 
-351133.041106  7389632.142385 
-351140.198834  7389640.191007 
-351156.188276  7389653.858666 
-351174.395953  7389670.105883 
-351193.890042  7389689.462567 
-351208.024082  7389704.559981 
-351219.626528  7389717.737724 
-351248.999602  7389750.492113 
-351262.919239  7389766.249414 
-351273.837248  7389776.767612 
-351292.234589  7389793.784698 
-351310.326819  7389811.691630 
-351317.459808  7389822.729739 
-351332.088622  7389838.936963 
-351348.069817  7389853.604451 
-351358.798163  7389862.572915 
-351367.176333  7389871.071459 
-351380.395041  7389886.158875 
-351386.357065  7389891.977878 
-351395.287733  7389896.717066 
-351401.563115  7389902.546068 
-351407.846743  7389906.485393 
-351413.198546  7389912.294398 
-351418.063822  7389915.673819 
-351427.225385  7389918.083406 
-351440.773942  7389920.113059 
-351456.870584  7389923.042557 
-351467.161880  7389925.032216 
-351473.791849  7389925.092206 
-351481.559798  7389923.732439 
-351491.389305  7389921.062896 
-351511.642048  7389916.623656 
-351521.257153  7389914.614001 
-351529.008609  7389914.913949 
-351534.294443  7389916.853617 
-351542.515935  7389921.802769 
-351565.242547  7389944.848822 
-351572.928034  7389952.237556 
-351584.522234  7389965.865222 
-351598.491349  7389977.413244 
-351611.470916  7389985.961779 
-351617.053614  7389988.571332 
-351622.446649  7389990.281039 
-351627.138754  7389990.331031 
-351634.708794  7389988.751301 
-351651.382672  7389984.931956 
-351665.698129  7389982.532367 
-351679.263178  7389983.332230 
-351687.212544  7389984.412045 
-351693.314755  7389986.571675 
-351700.835317  7389989.861111 
-351705.906749  7389992.790610 
-351709.650538  7389995.600128 
-351713.113955  7389996.519971 
-351718.836839  7389996.140036 
-351723.941256  7389995.750103 
-351726.299678  7389994.330346 
-351728.880748  7389992.030740 
-351732.500843  7389986.971606 
-351738.916411  7389978.403074 
-351745.472164  7389975.693538 
-351753.454515  7389973.893846 
-351759.383555  7389973.183968 
-351764.487972  7389973.233959 
-351773.130022  7389975.753528 
-351778.729212  7389977.583214 
-351785.705523  7389984.192082 
-351792.978699  7389991.570819 
-351799.641653  7389998.399649 
-351805.727371  7390002.668918 
-351815.779526  7390007.418104 
-351827.843762  7390015.626698 
-351837.656776  7390023.695316 
-351842.010786  7390027.504663 
-351850.248771  7390030.364174 
-351862.156328  7390034.023547 
-351869.874799  7390037.532946 
-351885.006633  7390045.221629 
-351895.075280  7390048.531062 
-351902.505134  7390050.710688 
-351910.965767  7390051.690521 
-351925.751258  7390053.050288 
-351928.794117  7390054.520036 
-351930.806198  7390057.539519 
-351933.403760  7390062.658642 
-351936.817700  7390068.777594 
-351940.330594  7390074.136676 
-351944.461956  7390079.825701 
-351948.914920  7390083.185126 
-351953.293669  7390084.344927 
-351959.404126  7390085.844670 
-351966.438160  7390086.574545 
-351973.892753  7390086.434569 
-351983.087300  7390085.084800 
-351991.580918  7390083.065146 
-352001.600088  7390081.615395 
-352010.052474  7390083.035152 
-352014.925997  7390085.854669 
-352019.585117  7390089.444054 
-352025.637850  7390096.042923 
-352028.878619  7390098.622482 
-352033.150166  7390099.882266 
-352039.672935  7390101.052065 
-352050.871316  7390103.711610 
-352064.716737  7390107.400978 
-352076.649033  7390108.180844 
-352086.429062  7390109.940543 
-352094.658801  7390113.349959 
-352100.447655  7390116.399437 
-352104.686217  7390121.088633 
-352106.467403  7390126.977625 
-352109.980297  7390132.326708 
-352114.350799  7390134.476340 
-352119.760327  7390134.316368 
-352126.093432  7390133.936433 
-352132.640939  7390132.336707 
-352144.202154  7390129.907123 
-352164.141540  7390126.127770 
-352179.834117  7390128.167421 
-352188.105086  7390128.247407 
-352195.155614  7390126.877642 
-352198.858171  7390124.148109 
-352200.334246  7390119.508904 
-352196.705905  7390105.191356 
-352195.452478  7390097.982591 
-352196.846091  7390091.233747 
-352199.039588  7390085.944653 
-352201.224839  7390082.205294 
-352204.721241  7390079.245801 
-352211.309979  7390073.446794 
-352213.280829  7390070.477303 
-352214.765150  7390065.058231 
-352216.909170  7390055.119933 
-352218.583155  7390051.150613 
-352220.949823  7390048.841009 
-352225.254355  7390047.451247 
-352230.152616  7390047.051315 
-352236.477475  7390047.781190 
-352254.025454  7390047.961159 
-352267.722443  7390045.991497 
-352277.774598  7390041.442276 
-352285.789935  7390035.663266 
-352291.529311  7390033.613617 
-352298.052080  7390034.233511 
-352305.778798  7390037.083023 
-352314.396109  7390043.481927 
-352319.945822  7390049.290932 
-352326.946872  7390053.350236 
-352335.811570  7390055.099937 
-352351.726795  7390055.479871 
-352370.693125  7390057.339553 
-352401.880370  7390061.418854 
-352449.708507  7390065.558145 
-352473.729777  7390071.887061 
-352498.031419  7390080.775539 
-352521.599146  7390092.193583 
-352537.003105  7390102.651791 
-352547.954099  7390109.960539 
-352558.418566  7390114.489764 
-352576.725198  7390120.548726 
-352589.317192  7390127.207585 
-352600.499081  7390131.416864 
-352608.951467  7390133.606489 
-352615.680392  7390134.006421 
-352622.524763  7390133.746465 
-352627.950783  7390132.026760 
-352640.699455  7390122.748349 
-352649.333259  7390150.433607 
-352672.983448  7390192.076474 
-352690.968477  7390237.858632 
-352715.063963  7390294.368952 
-352739.703701  7390341.310911 
-352796.553215  7390445.123129 
-352829.348474  7390538.947058 
-352803.669712  7390674.973758 
-352766.042161  7390831.606928 
-352768.070734  7390878.388915 
-352790.451004  7390917.042294 
-352816.896666  7390944.497591 
-352849.436292  7390975.012364 
-352886.808209  7391057.138296 
-352880.046300  7391191.995197 
-352887.583355  7391221.150203 
-352831.888313  7391411.077670 
-352804.692244  7391547.624281 
-352775.203724  7391649.326860 
-352760.945991  7391709.336581 
-352739.596500  7391762.227521 
-352531.948166  7392153.540493 
-352478.718747  7392281.288611 
-352447.473779  7392356.295763 
-352318.626425  7392632.968371 
-352303.849180  7392698.447155 
-352312.301566  7392749.128474 
-352350.316689  7392831.504364 
-352377.768391  7392941.325552 
-352409.450409  7393192.652502 
-352420.013831  7393427.092345 
-352439.021392  7393564.368831 
-352449.576568  7393627.727978 
-352455.917919  7393701.655315 
-352413.301399  7393899.621405 
-352417.902796  7393927.646604 
-352420.450881  7394021.210578 
-352421.242519  7394091.828482 
-352416.072133  7394130.981775 
-352299.585878  7394135.081073 
-352140.516089  7394138.940412 
-352091.789112  7394141.210023 
-352001.971168  7394143.659603 
-351880.537176  7394148.018857 
-351823.473260  7394182.432962 
-351779.487865  7394209.928252 
-351686.066318  7394266.578548 
-351588.579380  7394327.158172 
-351493.285938  7394386.538000 
-351395.361949  7394445.477905 
-351302.377453  7394503.767920 
-351203.266006  7394563.817634 
-351105.721344  7394622.767536 
-351014.262400  7394681.097545 
-350994.388984  7394651.342642 
-350913.823311  7394699.274432 
-350898.427598  7394706.903125 
-350801.254016  7394766.242960 
-350770.009048  7394785.279700 
-350759.437381  7394781.610328 
-350748.156537  7394776.021285 
-350722.090202  7394768.172630 
-350700.163475  7394762.333630 
-350684.701792  7394756.644605 
-350674.938255  7394750.695624 
-350664.143939  7394740.557360 
-350681.724903  7394698.404581 
-350685.006903  7394668.829646 
-350658.717919  7394635.965276 
-350639.001182  7394603.100905 
-350619.276198  7394576.805409 
-350606.131707  7394537.372164 
-350599.559461  7394497.928920 
-350563.407986  7394455.206238 
-350523.974511  7394405.914681 
-350530.546756  7394373.050311 
-350530.546756  7394343.465378 
-350491.105035  7394261.309451 
-350454.953560  7394221.866207 
-350405.657593  7394185.712400 
-350392.513102  7394156.137466 
-350379.368610  7394083.839850 
-350369.506118  7394021.390547 
-350362.933872  7393945.803494 
-350323.450920  7393954.512003 
-350252.953894  7393966.969869 
-350144.087157  7393988.036260 
-350129.936625  7393973.598733 
-350092.102919  7393925.996887 
-350035.847134  7393861.028016 
-350035.847134  7393861.008019 
-349930.361351  7393725.271269 
-349904.418710  7393709.853910 
-349788.526184  7393646.024844 
-349712.100119  7393622.288909 
-349676.558864  7393610.480932 
-349640.902163  7393620.389235 
-349543.522425  7393629.737633 
-349544.223355  7393530.244676 
-349547.332184  7393429.751889 
-349548.231023  7393407.275739 
-349547.678526  7393351.705258 
-349545.996295  7393279.367649 
-349545.971556  7393238.614629 
-349548.198038  7393063.314657 
-349535.507089  7392970.090625 
-349521.241110  7392867.098267 
-349518.066311  7392851.250981 
-349498.267112  7392805.298852 
-349477.668027  7392775.983874 
-349461.818772  7392763.306045 
-349441.219688  7392751.418082 
-349407.146263  7392735.580794 
-349382.597234  7392728.442017 
-349303.367450  7392714.184459 
-349165.218348  7392675.981003 
-349103.709714  7392666.642603 
-349051.412119  7392638.127487 
-349016.044036  7392602.833533 
-348878.686572  7392666.642603 
-348786.790578  7392714.184459 
-348741.188922  7392623.859931 
-348657.646360  7392517.698116 
-348558.609129  7392370.333358 
-348521.377398  7392314.862860 
-348510.286218  7392281.578561 
-348496.811877  7392234.846566 
-348491.460073  7392164.818561 
-348486.512335  7392070.054793 
-348482.851008  7391973.241376 
-348481.341948  7391946.995872 
-348479.676210  7391929.138931 
-348470.011627  7391910.752080 
-348456.496055  7391891.315409 
-348442.353770  7391876.098016 
-348425.556198  7391862.090415 
-348393.560823  7391835.564959 
-348361.153137  7391808.279633 
-348345.501791  7391794.252036 
-348313.976451  7391757.798280 
-348295.826497  7391722.884260 
-348285.477478  7391693.839235 
-348271.673288  7391650.796608 
-348270.848665  7391608.923781 
-348263.987801  7391582.058382 
-348257.423801  7391565.481222 
-348246.027511  7391540.275539 
-348235.472335  7391517.339468 
-348221.956763  7391496.293073 
-348210.271854  7391478.096190 
-348196.781021  7391457.089788 
-348152.449285  7391439.292837 
-348127.421975  7391430.094412 
-348103.821263  7391417.796519 
-348086.751566  7391407.228329 
-348068.469672  7391394.030590 
-348043.970121  7391376.063667 
-348002.318410  7391343.469251 
-347914.586762  7391276.450730 
-347907.783622  7391271.701544 
-347898.283964  7391254.294525 
-348044.835975  7390954.235923 
-348142.891904  7390829.807236 
-348203.163604  7390771.377245 
-348238.036913  7390750.780773 
-348260.186289  7390741.292398 
-348320.309556  7390714.397005 
-348368.566498  7390704.898632 
-348441.347730  7390696.989987 
-348625.263412  7390704.878635 
-Region 1
-371
-346663.650065  7397002.509908 
-346583.043161  7397058.800266 
-346487.411624  7397125.588826 
-346441.018330  7397158.073262 
-346369.696682  7397206.344993 
-346323.369358  7397234.600153 
-346297.352500  7397248.917701 
-346272.976642  7397262.855313 
-346245.566172  7397276.782928 
-346217.042460  7397288.410936 
-346173.287960  7397304.518177 
-346145.143575  7397312.726771 
-346113.972823  7397317.875889 
-346090.619498  7397324.224801 
-346064.569655  7397326.884346 
-346034.149310  7397329.993813 
-346008.701443  7397329.653871 
-345985.158454  7397329.333926 
-345965.788058  7397327.324270 
-345941.873989  7397324.144815 
-345903.916590  7397316.696091 
-345889.873259  7397315.856235 
-345752.128222  7397293.090134 
-345663.629675  7397279.592446 
-345579.773755  7397272.023743 
-345466.074727  7397268.564335 
-345370.385467  7397240.309175 
-345309.091234  7397184.348761 
-345281.631286  7397156.473536 
-345130.815974  7397068.498605 
-345013.999871  7397017.267380 
-344861.749714  7396923.823386 
-344839.377691  7396909.745798 
-344760.865329  7396880.800756 
-344574.838611  7396839.177885 
-344332.424169  7396819.001341 
-344237.699718  7396816.201821 
-344099.501138  7396799.834625 
-344081.079059  7396798.284890 
-344064.190779  7396796.955118 
-344042.552669  7396793.795659 
-344009.518269  7396790.946147 
-343977.555879  7396790.336252 
-343879.203087  7396797.055101 
-343791.397223  7396820.211134 
-343715.721564  7396839.557820 
-343674.910969  7396845.776755 
-343602.377124  7396858.284613 
-343575.296502  7396859.494405 
-343550.895906  7396861.134125 
-343524.986249  7396859.324435 
-343504.040823  7396857.194799 
-343477.413745  7396851.565764 
-343369.849912  7396814.232158 
-343335.207497  7396803.933922 
-343279.974244  7396792.585866 
-343205.758168  7396771.759434 
-343095.093753  7396735.055721 
-342987.562905  7396704.640930 
-342948.500511  7396691.743140 
-342822.902172  7396659.348689 
-342649.475695  7396620.115409 
-342571.590047  7396602.818372 
-342332.168986  7396537.609541 
-342174.129976  7396493.967017 
-342122.162230  7396481.249195 
-341969.887335  7396445.495320 
-341950.648879  7396506.364893 
-341935.451076  7396546.158077 
-341913.845952  7396575.233097 
-341880.448717  7396603.788206 
-341816.111626  7396642.631552 
-341808.723003  7396660.198543 
-341816.078641  7396642.671545 
-341744.963148  7396668.397139 
-341652.646596  7396708.240314 
-341530.759061  7396799.784633 
-341419.987444  7397005.619376 
-341385.831557  7397053.271213 
-341238.537385  7397260.875652 
-341261.156796  7397259.645863 
-341238.529139  7397260.905647 
-341194.543745  7397338.842297 
-341167.817711  7397387.274002 
-341150.418164  7397416.389014 
-341128.153342  7397444.334228 
-341071.460506  7397510.272933 
-341056.460613  7397528.399828 
-341034.426684  7397563.933741 
-340958.503639  7397685.492919 
-340931.777605  7397728.135615 
-340976.158818  7397756.260797 
-341015.427369  7397786.855557 
-341050.976869  7397821.989539 
-341089.420796  7397865.392104 
-341113.804900  7397899.696228 
-341167.957897  7398039.822226 
-341184.079278  7398108.030542 
-341189.859886  7398155.562401 
-341192.168830  7398186.007186 
-341187.608665  7398241.597664 
-341182.009474  7398277.091584 
-341165.475782  7398349.009265 
-341125.662980  7398510.671574 
-341114.217212  7398564.362377 
-341107.191423  7398796.252656 
-341111.322785  7398835.935859 
-341124.970297  7398907.033680 
-341134.478201  7398975.241997 
-341148.942089  7399050.469111 
-341168.370209  7399113.708279 
-341182.834097  7399155.461127 
-341191.929690  7399184.806101 
-341210.533186  7399215.810790 
-341226.654567  7399241.846330 
-341258.064459  7399288.558329 
-341277.904890  7399313.774010 
-341295.271452  7399335.680257 
-341302.709552  7399361.305868 
-341301.884929  7399377.843035 
-341298.990502  7399391.890629 
-341297.333010  7399405.538291 
-341304.779356  7399417.106310 
-341328.751148  7399439.012557 
-341364.300649  7399460.098945 
-341392.816114  7399481.595263 
-341425.471188  7399513.009882 
-341459.783753  7399547.314006 
-341482.106300  7399575.009262 
-341500.289238  7399606.833811 
-341508.972519  7399638.668358 
-341511.866946  7399665.533756 
-341515.173685  7399687.030074 
-341522.611785  7399703.557243 
-341533.356623  7399715.135260 
-341550.310873  7399722.573986 
-341564.848978  7399726.383333 
-341635.189326  7399466.237894 
-341641.942988  7399436.522984 
-341647.138114  7399411.967190 
-341657.503626  7399363.895424 
-341661.857635  7399330.811091 
-341680.955906  7399273.460915 
-341679.356137  7399230.608255 
-341704.762774  7399202.033150 
-341724.966039  7399208.132105 
-341746.587655  7399222.979562 
-341764.036679  7399233.257801 
-341780.355970  7399240.116626 
-341800.468526  7399248.495191 
-341827.021389  7399255.743950 
-341881.916546  7399258.973396 
-341887.713647  7399259.963227 
-341967.751561  7399255.064066 
-342046.989592  7399247.865299 
-342072.866263  7399177.477356 
-342093.811689  7399138.354057 
-342106.510884  7399119.307320 
-342128.726230  7399070.895612 
-342138.250626  7399028.042953 
-342173.956805  7398970.112876 
-342190.630683  7398928.050081 
-342200.138587  7398900.304833 
-342188.198045  7398878.498568 
-342186.656000  7398856.632314 
-342189.039161  7398833.616256 
-342177.139850  7398817.748974 
-342169.998614  7398793.143189 
-342169.363654  7398743.261733 
-342170.831483  7398728.284299 
-342169.973875  7398679.362678 
-342279.508557  7398694.730046 
-342327.130539  7398701.078959 
-342366.151703  7398703.788495 
-342395.895856  7398705.008286 
-342419.331644  7398712.507001 
-342444.317723  7398719.375825 
-342468.380224  7398728.444271 
-342492.574665  7398739.952300 
-342521.799306  7398752.500151 
-342541.161456  7398759.678921 
-342562.717102  7398764.678065 
-342584.965433  7398767.987498 
-342613.959180  7398772.106792 
-342673.125885  7398790.763596 
-342733.430569  7398779.655499 
-342768.204924  7398769.087309 
-342793.421897  7398764.678065 
-342862.063521  7398740.742165 
-342862.080014  7398740.742165 
-342935.281803  7398717.186200 
-343015.542366  7398691.340627 
-343063.147856  7398678.512824 
-343095.893637  7398670.854136 
-343119.106777  7398666.524877 
-343144.513413  7398662.995482 
-343178.059080  7398660.265950 
-343202.773033  7398657.716386 
-343276.246948  7398659.726042 
-343324.553367  7398669.794317 
-343367.837832  7398680.862422 
-343425.643909  7398697.749529 
-343506.193089  7398710.787296 
-343566.613221  7398708.417702 
-343600.967018  7398702.488717 
-343640.713850  7398699.619209 
-343640.812805  7398699.719192 
-343696.046058  7398695.239959 
-343715.977197  7398692.660401 
-343776.776656  7398684.621778 
-343900.197990  7398703.428556 
-343924.037843  7398706.408046 
-344000.043350  7398728.764216 
-344017.987148  7398732.753533 
-344040.268464  7398737.702685 
-344058.146292  7398746.641154 
-344128.057835  7398779.385545 
-344193.747308  7398807.740688 
-344241.427014  7398836.045840 
-344287.680122  7398852.972941 
-344305.582688  7398853.902781 
-344349.543344  7398858.022076 
-344406.829908  7398855.422521 
-344469.410553  7398849.453543 
-344507.648324  7398832.396465 
-344539.132433  7398820.058579 
-344634.541321  7398790.923569 
-344652.979893  7398780.615335 
-344675.154007  7398767.177637 
-344699.521619  7398749.370687 
-344711.082834  7398740.002291 
-344715.766693  7398735.623042 
-344724.829301  7398729.694057 
-344734.197019  7398723.445128 
-344743.259626  7398717.196198 
-344758.877987  7398706.877965 
-344787.616101  7398689.071015 
-344832.178731  7398660.065984 
-344847.285826  7398651.587436 
-344867.909649  7398639.399524 
-344890.710476  7398630.031128 
-344908.514088  7398620.342788 
-344932.881700  7398606.285196 
-344959.747919  7398589.408087 
-345011.921821  7398562.232742 
-345053.779687  7398535.987237 
-345090.021871  7398519.120127 
-345108.765553  7398507.562106 
-345134.691703  7398492.254728 
-345165.309957  7398478.187138 
-345192.802890  7398464.759438 
-345214.045180  7398452.261579 
-345241.224756  7398436.324309 
-345270.787493  7398418.117427 
-345346.809493  7398367.596081 
-345363.367925  7398357.907741 
-345388.675606  7398339.480897 
-345407.105932  7398325.733252 
-345416.787007  7398320.104216 
-345427.408152  7398315.105072 
-345461.151728  7398291.989032 
-345474.898194  7398281.680798 
-345487.704590  7398269.812831 
-345501.451057  7398253.245668 
-345516.129347  7398237.008450 
-345528.317276  7398226.380270 
-345538.311708  7398218.261661 
-345561.120782  7398205.453855 
-345575.799072  7398199.824819 
-345580.606625  7398198.695012 
-345588.918825  7398196.385408 
-345602.665292  7398193.885836 
-345622.662401  7398194.205781 
-345640.152656  7398196.705353 
-345658.582982  7398200.134766 
-345683.890664  7398206.383695 
-345706.386381  7398210.452998 
-345726.688601  7398210.133053 
-345749.802785  7398209.203213 
-345766.674573  7398204.204069 
-345783.859718  7398196.385408 
-345825.090871  7398165.150758 
-345847.586588  7398147.343808 
-345865.390200  7398134.845949 
-345880.703450  7398125.467556 
-345896.008455  7398118.598732 
-345911.940172  7398115.159321 
-345936.621140  7398114.539428 
-345956.304893  7398112.659750 
-345974.421862  7398108.290498 
-346000.348011  7398099.851943 
-346026.282406  7398091.413389 
-346039.154772  7398085.684370 
-346051.581842  7398080.165316 
-346076.749338  7398071.136862 
-346085.630528  7398068.297348 
-346095.946563  7398064.857938 
-346104.687567  7398063.298205 
-346115.308712  7398062.048419 
-346131.553787  7398060.798633 
-346169.981222  7398063.298205 
-346193.722120  7398057.989114 
-346212.779159  7398055.489542 
-346231.522841  7398055.179595 
-346270.890346  7398056.739328 
-346335.227438  7398055.199592 
-346350.862291  7398054.859650 
-346420.782080  7398057.189251 
-346432.260834  7398056.989285 
-346526.424541  7398057.049275 
-346565.049886  7398053.809830 
-346602.652697  7398053.299917 
-346635.456203  7398051.430238 
-346661.382352  7398048.300774 
-346678.880853  7398049.870505 
-346688.248571  7398052.989970 
-346715.741504  7398067.357509 
-346735.111900  7398082.664887 
-346741.981010  7398085.794351 
-346751.670331  7398088.293923 
-346780.095088  7398092.663175 
-346813.525307  7398093.603014 
-346849.759245  7398096.412533 
-346951.336314  7398076.225990 
-347155.290337  7398035.712930 
-347272.370319  7398001.268830 
-347366.360856  7397948.757824 
-347422.393994  7397805.272402 
-347523.006254  7397756.680726 
-347622.612474  7397686.872683 
-347795.280297  7397462.411131 
-347845.161746  7397372.246576 
-347902.712190  7397296.459557 
-347919.732410  7397285.871371 
-347931.029746  7397267.334546 
-347963.124076  7397175.420290 
-347984.885878  7397148.324931 
-348016.922484  7397058.280355 
-348032.392413  7397015.107750 
-347954.935569  7396922.053690 
-347954.886091  7396922.083684 
-347881.189528  7396843.797094 
-347795.181342  7396749.863184 
-347651.647452  7396591.260351 
-347602.846259  7396526.611425 
-347559.776196  7396471.230911 
-347549.080835  7396444.745448 
-347535.169444  7396407.641804 
-347491.860240  7396412.650946 
-347446.530711  7396421.159488 
-347395.874116  7396433.877310 
-347369.601625  7396443.085732 
-347347.138893  7396453.453956 
-347312.884051  7396469.931134 
-347291.567544  7396481.419166 
-347266.078445  7396501.295762 
-347230.331036  7396529.600913 
-347183.212074  7396579.642342 
-347142.912744  7396617.095926 
-347090.244069  7396673.536258 
-346969.593469  7396800.504510 
-346876.039982  7396876.561482 
-346866.771219  7396881.600619 
-346833.621372  7396904.226743 
-346811.076177  7396920.004041 
-346776.516224  7396935.491388 
-346751.439437  7396947.169387 
-346732.027810  7396958.037526 
-346706.852068  7396972.755005 
-346678.658205  7396992.001708 
-346663.650065  7397002.509908 
-Region 1
-184
-326732.922903  7396089.096368 
-326723.711864  7396056.182006 
-326724.849844  7396000.001629 
-326739.033360  7395842.888541 
-326753.917807  7395717.929945 
-326767.820952  7395600.580046 
-326814.403908  7395523.283286 
-326850.101841  7395465.563173 
-326868.317764  7395432.758792 
-326887.597452  7395414.181974 
-326913.762742  7395398.384680 
-326942.707011  7395379.517912 
-327001.131555  7395345.363762 
-327063.530783  7395282.754487 
-327080.781897  7395264.677583 
-327148.986471  7395187.330832 
-327179.175921  7395159.325629 
-327218.279547  7395130.290602 
-327281.412689  7395092.237121 
-327329.240826  7395057.673041 
-327399.581174  7395011.290986 
-327462.541145  7394962.899275 
-327524.222950  7394914.007650 
-327560.267224  7394890.561666 
-327574.500218  7394881.393236 
-327600.921141  7394869.135336 
-327648.716294  7394859.377007 
-327672.613871  7394849.928626 
-327717.127024  7394848.298905 
-327750.219147  7394852.288222 
-327790.947280  7394860.316846 
-327830.347770  7394847.029122 
-327896.927837  7394821.483498 
-327914.327383  7394813.954788 
-327951.039602  7394793.418306 
-327999.997474  7394757.714421 
-328037.089019  7394723.240326 
-328085.519132  7394670.059436 
-328097.698814  7394658.861354 
-328138.097098  7394642.524152 
-328159.446589  7394639.684639 
-328189.965889  7394638.104909 
-328242.881951  7394636.705149 
-328286.883838  7394635.855295 
-328427.275914  7394630.986129 
-328497.970850  7394620.927852 
-328554.441037  7394620.307958 
-328618.720405  7394593.502549 
-328684.014059  7394567.966923 
-328716.759841  7394544.280980 
-328756.877753  7394519.055301 
-328792.913781  7394490.280230 
-328883.787243  7394426.091225 
-328917.778206  7394394.776589 
-328967.098911  7394382.238737 
-328981.076272  7394414.463217 
-329003.423557  7394465.914404 
-329014.976526  7394492.299884 
-329034.742741  7394537.362166 
-329045.718474  7394562.377881 
-329093.060084  7394661.820847 
-329146.602860  7394788.429160 
-329185.780702  7394792.408479 
-329213.009755  7394795.148009 
-329243.042527  7394801.426934 
-329267.987375  7394808.995637 
-329290.656263  7394818.094079 
-329314.347684  7394829.722087 
-329339.581150  7394844.399573 
-329362.019143  7394864.156189 
-329383.954117  7394882.143108 
-329428.071451  7394921.916295 
-329462.243831  7394950.541392 
-329500.481602  7394979.156490 
-329550.668162  7395006.991722 
-329557.050744  7395012.560768 
-329583.339728  7395027.828153 
-329593.490837  7395034.067085 
-329637.632910  7395059.422741 
-329652.088552  7395067.971277 
-329683.943741  7395085.938200 
-329700.749560  7395091.737206 
-329710.166755  7395097.306252 
-329735.136341  7395108.684303 
-329764.171319  7395120.302313 
-329812.040688  7395135.949633 
-329859.901811  7395149.047389 
-329873.376152  7395151.307002 
-329891.451889  7395154.056531 
-329904.687090  7395157.585927 
-329912.083959  7395161.125321 
-329919.983847  7395167.724190 
-329928.403249  7395175.062933 
-329953.917087  7395208.067280 
-329956.498157  7395216.895768 
-329962.138579  7395232.643070 
-329972.413382  7395265.377463 
-329980.618381  7395289.233377 
-329995.989355  7395332.865903 
-330012.358123  7395354.942122 
-330024.933625  7395392.745646 
-330087.489531  7395560.216960 
-330108.319509  7395615.587475 
-330124.152272  7395657.660269 
-330144.908035  7395710.191271 
-330155.232315  7395751.824139 
-330163.181682  7395788.127921 
-330167.477968  7395849.317440 
-330173.703872  7395902.888263 
-330182.543831  7395950.830051 
-330190.336519  7395999.991630 
-330213.722829  7396052.872572 
-330199.902147  7396071.269421 
-330162.926049  7396173.591894 
-330211.751980  7396284.582883 
-330118.973639  7396340.983222 
-330026.467424  7396402.212734 
-329954.766448  7396418.369966 
-329838.478104  7396443.395679 
-329730.073156  7396471.450874 
-329680.397862  7396480.359348 
-329616.027786  7396489.867719 
-329486.289839  7396515.243372 
-329359.866877  7396543.888466 
-329240.280040  7396568.444260 
-329188.073154  7396600.328798 
-329161.693462  7396621.455179 
-329060.553443  7396679.945161 
-328796.146304  7396846.536625 
-328737.762991  7396883.450302 
-328690.437873  7396904.796646 
-328663.142850  7396920.453964 
-328632.038068  7396939.930627 
-328559.520715  7396989.872073 
-328485.263408  7397045.412559 
-328399.362424  7397107.361948 
-328283.511129  7397211.914039 
-328268.140155  7397230.790806 
-328257.139684  7397305.528004 
-328246.568016  7397365.287768 
-328199.861366  7397404.161109 
-328168.261810  7397423.387816 
-328131.838209  7397442.654515 
-328093.880809  7397458.611782 
-328048.526541  7397469.529912 
-327964.901516  7397503.874029 
-327960.011501  7397358.338958 
-327960.011501  7397237.259698 
-327879.503551  7397240.909073 
-327872.279853  7397239.849254 
-327813.451244  7397240.089213 
-327743.209851  7397239.319345 
-327670.469851  7397120.919626 
-327538.018894  7396913.845096 
-327444.688056  7396776.748579 
-327355.587533  7396637.912360 
-327319.056732  7396569.494080 
-327271.220348  7396497.516409 
-327197.350613  7396547.047925 
-327121.732678  7396569.494080 
-327124.041623  7396529.520927 
-327119.704106  7396502.895488 
-327113.816297  7396474.000437 
-327102.617916  7396445.515316 
-327091.081439  7396423.889021 
-327077.656576  7396405.692138 
-327059.663300  7396387.525249 
-327040.169211  7396372.797772 
-327027.940051  7396363.729325 
-326976.689728  7396320.636707 
-326956.791573  7396302.099882 
-326937.256253  7396280.523578 
-326918.883651  7396261.206887 
-326829.296601  7396237.370970 
-326814.469878  7396240.130497 
-326781.196338  7396251.608531 
-326758.684128  7396264.146383 
-326723.340783  7396296.880776 
-326695.229383  7396282.143300 
-326707.293619  7396238.470781 
-326708.926372  7396217.124438 
-326738.052059  7396121.050894 
-326737.969597  7396105.443567 
-326732.922903  7396089.096368 
-Region 1
-200
-329470.308644  7391628.130491 
-329439.418264  7391615.922582 
-329417.235904  7391609.463688 
-329404.709879  7391607.214073 
-329370.933319  7391606.264236 
-329340.677898  7391609.233728 
-329321.596121  7391607.574012 
-329302.448373  7391606.634173 
-329276.538716  7391602.834824 
-329255.156240  7391597.045815 
-329212.440766  7391567.450885 
-329192.476641  7391554.113169 
-329121.385887  7391503.891772 
-329044.786650  7391455.140122 
-328952.181480  7391391.311056 
-328856.286064  7391328.221862 
-328836.091045  7391317.683667 
-328762.509929  7391263.442958 
-328727.727328  7391243.876310 
-328708.323947  7391235.887678 
-328695.096993  7391231.858369 
-328669.344015  7391225.689425 
-328632.689520  7391217.620807 
-328609.220747  7391216.231045 
-328586.873462  7391215.191223 
-328563.718047  7391213.771467 
-328479.062243  7391217.660800 
-328374.697948  7391220.110381 
-328311.861670  7391223.599783 
-328304.390585  7391222.739930 
-328228.096459  7391227.759071 
-328140.397796  7391133.435227 
-328038.861959  7391025.233761 
-328016.572397  7391002.267695 
-328000.046951  7390984.240783 
-327944.912653  7390923.891121 
-327867.389838  7390845.074621 
-327697.426779  7390658.606561 
-327684.678106  7390648.008377 
-327652.039525  7390618.353456 
-327606.404885  7390557.643855 
-327587.364338  7390541.876556 
-327534.918311  7390520.920146 
-327509.437459  7390521.899978 
-327403.588842  7390517.900663 
-327395.078732  7390570.111720 
-327377.555492  7390662.395912 
-327372.566522  7390717.226520 
-327345.634333  7390811.380393 
-327328.061615  7390841.665205 
-327092.664715  7391254.324520 
-326860.442614  7391683.840948 
-326759.541736  7391794.821938 
-326651.664547  7391907.422650 
-326424.423169  7392114.857119 
-326339.742626  7392211.080637 
-326270.564997  7392345.047689 
-326219.850679  7392496.851687 
-326131.203699  7392705.355972 
-326078.831889  7392865.948464 
-326043.702946  7392961.322127 
-326027.631042  7393017.592488 
-326011.122089  7393067.323970 
-325962.436343  7393151.369574 
-325992.543331  7393100.888221 
-326011.122089  7393067.323970 
-326105.557922  7393133.352660 
-326194.237886  7393224.866984 
-326265.213194  7393290.935667 
-326332.131355  7393354.704744 
-326398.282618  7393417.953910 
-326461.143634  7393476.623860 
-326480.926341  7393492.151201 
-326524.260283  7393533.014201 
-326595.854058  7393602.352324 
-326618.539438  7393624.818476 
-326632.112734  7393667.511163 
-326666.540747  7393736.559336 
-326706.427764  7393787.630588 
-326779.349182  7393876.285402 
-326780.891227  7393937.194969 
-326784.610277  7393958.321350 
-326805.357793  7393990.285875 
-326810.552919  7394000.004210 
-326814.906929  7394014.861665 
-326833.122852  7394039.837387 
-326846.176635  7394067.232695 
-326868.161086  7394100.696962 
-326882.756914  7394133.421357 
-326904.246591  7394172.224710 
-326927.418499  7394217.376976 
-326935.969841  7394231.564546 
-326953.509573  7394311.250896 
-326964.427583  7394388.167721 
-326971.403894  7394423.951592 
-327016.642715  7394577.715254 
-327045.149934  7394665.260258 
-327045.191166  7394665.310249 
-327061.576426  7394678.627968 
-327110.253925  7394746.186396 
-327138.398311  7394788.249191 
-327147.023868  7394801.086992 
-327165.412962  7394817.694147 
-327185.393579  7394852.068259 
-327230.822064  7394900.210013 
-327276.349503  7394981.356113 
-327242.135892  7395027.908140 
-327229.469682  7395045.205177 
-327217.322984  7395065.801649 
-327212.812296  7395090.437429 
-327218.279547  7395130.290602 
-327281.412689  7395092.237121 
-327329.240826  7395057.673041 
-327399.581174  7395011.290986 
-327462.541145  7394962.899275 
-327524.222950  7394914.007650 
-327560.267224  7394890.561666 
-327574.500218  7394881.393236 
-327600.921141  7394869.135336 
-327648.716294  7394859.377007 
-327672.613871  7394849.928626 
-327717.127024  7394848.298905 
-327750.219147  7394852.288222 
-327790.947280  7394860.316846 
-327830.347770  7394847.029122 
-327896.927837  7394821.483498 
-327914.327383  7394813.954788 
-327951.039602  7394793.418306 
-327999.997474  7394757.714421 
-328037.089019  7394723.240326 
-328085.519132  7394670.059436 
-328097.698814  7394658.861354 
-328138.097098  7394642.524152 
-328159.446589  7394639.684639 
-328189.965889  7394638.104909 
-328242.881951  7394636.705149 
-328286.883838  7394635.855295 
-328427.275914  7394630.986129 
-328497.970850  7394620.927852 
-328554.441037  7394620.307958 
-328618.720405  7394593.502549 
-328684.014059  7394567.966923 
-328716.759841  7394544.280980 
-328756.877753  7394519.055301 
-328792.913781  7394490.280230 
-328776.767662  7394451.716836 
-328758.881587  7394420.012267 
-328741.506779  7394402.505265 
-328700.630214  7394335.056819 
-328681.210341  7394304.881987 
-328660.767935  7394274.697158 
-328640.086389  7394247.831760 
-328585.743729  7394189.281789 
-328547.687374  7394140.350170 
-328519.881085  7394109.675424 
-328502.786649  7394094.478028 
-328460.178375  7394050.885495 
-328433.402864  7394028.089399 
-328415.277649  7394010.902343 
-328407.922011  7394004.773393 
-328324.610343  7393952.092417 
-328314.813821  7393925.137034 
-328303.780364  7393911.659343 
-328292.763400  7393893.282491 
-328287.856893  7393876.125429 
-328282.950386  7393863.877527 
-328277.969662  7393848.600144 
-328278.052125  7393832.432914 
-328279.173612  7393807.517181 
-328335.577830  7393715.922871 
-328367.169139  7393642.865385 
-328381.616535  7393612.350612 
-328401.423981  7393577.916510 
-328442.556180  7393518.476691 
-328572.013755  7393325.659719 
-328692.293275  7393143.760877 
-328775.011215  7393020.531985 
-328795.173249  7392990.087200 
-328810.478253  7392973.320072 
-328853.136004  7392939.925792 
-328907.462171  7392895.823346 
-328794.431088  7392739.210173 
-328715.795032  7392628.209186 
-328715.803279  7392628.199188 
-328800.821917  7392551.442336 
-328852.567014  7392483.274012 
-328945.617480  7392365.734146 
-329031.353541  7392255.433039 
-329106.567410  7392160.949224 
-329195.585470  7392048.128549 
-329195.593716  7392048.128549 
-329234.936483  7391999.966798 
-329270.551953  7391949.105511 
-329351.966988  7391848.712707 
-329393.998026  7391790.282715 
-329453.948122  7391717.875118 
-329473.912247  7391695.848891 
-329514.549671  7391660.544938 
-329486.627935  7391638.178769 
-329470.308644  7391628.130491 
-Region 1
-297
-323487.478646  7404590.230200 
-323137.508618  7404495.796376 
-322804.212468  7404268.035389 
-322511.900084  7404001.031125 
-322389.946578  7403916.655578 
-321753.560221  7403527.492238 
-321723.799574  7403581.283024 
-321714.638012  7403643.092436 
-321698.615586  7403711.770673 
-321691.746476  7403764.421654 
-321692.966918  7403783.368408 
-321698.615586  7403892.609696 
-321608.946074  7403877.032365 
-321524.059376  7403861.585011 
-321478.738092  7403839.368816 
-321455.962003  7403828.510676 
-321421.624699  7403798.755773 
-321382.710736  7403782.728518 
-321336.927664  7403766.711262 
-321245.361518  7403734.656752 
-321169.050900  7403699.072848 
-321191.043597  7403684.125408 
-321210.348023  7403660.849395 
-321219.319922  7403644.732156 
-321214.561847  7403620.636283 
-321207.090762  7403600.209782 
-321155.279695  7403532.961301 
-321142.918595  7403512.094875 
-321119.260159  7403477.970720 
-321099.073387  7403445.296317 
-321090.332382  7403422.910152 
-321028.238266  7403437.807600 
-321002.658458  7403453.704877 
-320946.930431  7403487.869025 
-320991.410599  7403092.356773 
-320970.762038  7402996.433203 
-320965.764822  7402952.980646 
-320955.374572  7402859.886593 
-320943.780371  7402760.803565 
-320967.983058  7402641.923928 
-320956.413597  7402398.905554 
-320935.740296  7402369.620571 
-320911.653057  7402335.736375 
-320906.845504  7402318.099396 
-320935.740296  7402205.548675 
-320921.136222  7402173.344191 
-320849.410508  7402100.326698 
-320797.805596  7402084.789360 
-320773.751342  7402068.752107 
-320765.736005  7402062.343205 
-320751.305102  7402033.478149 
-320746.497549  7402003.013367 
-320749.705333  7401972.548586 
-320780.166909  7401932.455453 
-320828.522806  7401898.461276 
-320872.607155  7401918.327873 
-320932.227402  7401834.502232 
-320995.566700  7401836.361913 
-321014.186689  7401843.190743 
-321025.368577  7401847.539998 
-321039.032581  7401850.019574 
-321050.832938  7401846.920105 
-321054.560234  7401836.981807 
-321104.853994  7401830.772870 
-321150.373188  7401833.722365 
-321168.820006  7401818.354997 
-321208.550345  7401796.478745 
-321237.758494  7401781.761266 
-321267.626341  7401764.254264 
-321278.956662  7401756.015676 
-321302.648083  7401743.657792 
-321368.568451  7401720.991675 
-321436.550376  7401702.454850 
-321473.633675  7401691.126791 
-321494.216267  7401690.096967 
-321517.899441  7401704.144561 
-321533.369370  7401728.200440 
-321559.122348  7401735.409205 
-321583.836302  7401740.558323 
-321594.144090  7401735.409205 
-321620.919601  7401710.693439 
-321677.571205  7401693.186438 
-321744.514106  7401672.579967 
-321788.796364  7401708.633792 
-321834.125894  7401746.747263 
-321863.573184  7401754.785886 
-321884.164022  7401759.805027 
-321908.276000  7401775.582324 
-321916.942789  7401784.310829 
-321930.276944  7401797.318601 
-321947.437350  7401803.467548 
-321976.043524  7401805.457207 
-322011.122989  7401806.327058 
-322045.245891  7401815.905417 
-322073.266583  7401813.385849 
-322102.252084  7401807.756813 
-322136.193569  7401797.948493 
-322176.608345  7401773.282718 
-322202.930314  7401755.055840 
-322219.711393  7401743.287856 
-322250.610019  7401711.743259 
-322282.267299  7401682.098337 
-322351.296495  7401634.646465 
-322414.017326  7401595.343197 
-322459.338609  7401582.975316 
-322530.396379  7401561.349020 
-322599.417329  7401539.722725 
-322642.322467  7401394.177655 
-322685.450254  7401282.586770 
-322778.550198  7401112.815850 
-322839.209470  7401034.459272 
-322907.884079  7400952.313343 
-323098.223575  7400754.237271 
-323148.566813  7400696.057237 
-323211.130965  7400618.090592 
-323236.306707  7400586.136065 
-323267.601152  7400543.913298 
-323362.210157  7400397.778329 
-323442.495458  7400303.044556 
-323610.446438  7400065.355270 
-323889.193772  7399748.599528 
-324152.108344  7399463.518360 
-324347.552257  7399235.407433 
-324392.205596  7399056.798027 
-324541.718003  7399165.749365 
-324677.920995  7399197.423939 
-324782.458461  7399206.932311 
-325016.857567  7399181.586652 
-325682.056255  7399140.403706 
-325865.040113  7399134.584703 
-325848.283772  7399287.228557 
-325848.663099  7399360.046084 
-325841.117798  7399467.767632 
-325818.366447  7399623.241001 
-325807.506162  7399784.473383 
-325796.983971  7399896.474198 
-325791.747615  7399940.596640 
-325777.316711  7400062.595743 
-325753.847939  7400268.760429 
-325734.518774  7400359.634863 
-325730.222488  7400377.501803 
-325722.710172  7400408.436504 
-325712.410630  7400435.801816 
-325700.008299  7400460.837528 
-325687.292611  7400489.502618 
-325672.210255  7400513.638484 
-325653.746945  7400559.130691 
-325600.402079  7400624.149554 
-325531.298666  7400737.030219 
-325504.382969  7400777.403303 
-325490.001543  7400798.359713 
-325469.559137  7400839.192719 
-325459.812093  7400866.548033 
-325452.266792  7400885.674757 
-325445.513129  7400911.960255 
-325440.260280  7400930.137141 
-325437.101973  7400963.271466 
-325429.960738  7401012.543026 
-325404.686041  7401165.676795 
-325396.901599  7401218.937672 
-325378.025977  7401290.855353 
-325334.692035  7401351.804913 
-325319.939528  7401454.757278 
-325295.332776  7401559.709301 
-325317.770770  7401615.439755 
-325334.428156  7401639.375655 
-325358.853491  7401669.910425 
-325400.628895  7401715.752572 
-325422.060849  7401743.917748 
-325461.618017  7401805.247243 
-325492.153809  7401853.069051 
-325522.755571  7401904.430254 
-325547.931313  7401941.353929 
-325562.485910  7401978.527561 
-325571.276392  7402011.051990 
-325574.797533  7402035.667774 
-325572.166985  7402067.322352 
-325568.654091  7402092.817984 
-325559.863609  7402146.438800 
-325576.562226  7402223.805547 
-325615.253540  7402327.537779 
-325643.373187  7402360.072206 
-325670.626979  7402426.880763 
-325689.222229  7402507.526949 
-325661.531387  7402516.755368 
-325607.172234  7402544.450624 
-325584.602301  7402560.857813 
-325568.192302  7402578.294827 
-325554.858147  7402587.533244 
-325532.469631  7402616.238327 
-325498.981688  7402642.113895 
-325476.518956  7402659.600900 
-325452.918244  7402678.627641 
-325435.419742  7402683.926733 
-325340.621075  7402744.286394 
-325327.690985  7402759.463794 
-325303.496544  7402856.757129 
-325308.213388  7402891.541170 
-325303.240911  7402919.366404 
-325303.983072  7402945.681897 
-325312.328257  7402968.198040 
-325322.586568  7402987.674704 
-325332.836633  7403010.960715 
-325343.103190  7403031.187250 
-325327.872402  7403108.054084 
-325278.329048  7403244.890645 
-325279.079455  7403282.244247 
-325281.487355  7403335.245168 
-325292.413610  7403389.865812 
-325309.005026  7403476.091042 
-325292.487827  7403542.149727 
-325216.993585  7403598.770029 
-325016.461748  7403899.578503 
-324981.077172  7403970.356379 
-324973.696796  7404063.260465 
-324986.239313  7404087.686282 
-324952.124657  7404184.599681 
-324934.766341  7404234.041212 
-324930.197929  7404250.428405 
-324926.759251  7404265.295859 
-324922.949493  7404278.263637 
-324890.673746  7404322.176116 
-324850.506356  7404373.817270 
-324825.091473  7404417.259829 
-324809.827701  7404463.391927 
-324803.717244  7404490.837225 
-324801.762887  7404516.492831 
-324805.209811  7404539.278928 
-324810.833741  7404562.534944 
-324820.011795  7404582.021606 
-324839.712040  7404625.194211 
-324842.029231  7404635.462452 
-324843.010533  7404640.351615 
-324850.968145  7404701.531136 
-324859.799858  7404732.095900 
-324879.293947  7404768.209714 
-324903.348202  7404798.954448 
-324921.943452  7404833.278568 
-324947.539752  7404883.210016 
-324957.864033  7404905.696164 
-324976.987042  7404947.219051 
-325051.656660  7405018.696808 
-325087.041236  7405059.099887 
-325118.352174  7405098.673109 
-325145.243132  7405147.694712 
-325157.142443  7405185.238281 
-325149.547664  7405210.373975 
-325043.855726  7405356.408961 
-325043.863973  7405356.458952 
-324930.783412  7405516.951461 
-324907.801167  7405533.498627 
-324853.573954  7405549.125950 
-324820.217951  7405549.615866 
-324762.552060  7405557.054592 
-324741.202569  7405560.254044 
-324746.875976  7405521.450691 
-324746.777021  7405498.524618 
-324746.702805  7405493.085549 
-324735.496177  7405472.879011 
-324711.969681  7405440.624536 
-324700.548652  7405433.955678 
-324677.450960  7405421.937736 
-324644.086711  7405409.219915 
-324604.950100  7405400.021490 
-324585.109669  7405384.724111 
-324569.796419  7405364.567563 
-324558.053786  7405349.740103 
-324537.240300  7405336.972290 
-324508.345508  7405326.324114 
-324463.395305  7405317.145686 
-324444.231065  7405227.321072 
-324428.175654  7405211.283819 
-324408.673318  7405202.195376 
-324391.183063  7405193.896798 
-324375.853320  7405185.968156 
-324361.348201  7405176.489779 
-324345.680362  7405162.782127 
-324334.185117  7405149.464409 
-324324.248409  7405126.198394 
-324292.789039  7404979.843463 
-324288.014471  7404942.909790 
-324285.656049  7404909.655486 
-324285.944668  7404893.598236 
-324288.162904  7404879.110718 
-324293.036426  7404864.993136 
-324299.872551  7404856.994506 
-324308.242475  7404849.335818 
-324328.346786  7404843.046895 
-324342.522056  7404845.316506 
-324362.659351  7404844.446655 
-324379.423938  7404843.986734 
-324397.697585  7404837.227892 
-324405.193409  7404825.569889 
-324434.236633  7404756.791670 
-324445.839080  7404704.830570 
-323840.186424  7404582.341552 
-323487.478646  7404590.230200 
-Region 1
-332
-349296.572556  7398517.010488 
-349400.978082  7397946.868148 
-349420.513403  7397840.196420 
-349439.883799  7397734.424538 
-349420.562880  7397726.975814 
-349359.408834  7397700.300383 
-349207.843115  7397644.739900 
-349152.296505  7397622.523705 
-349094.366735  7397598.717783 
-349034.853688  7397575.701726 
-348977.723802  7397551.105939 
-348920.577424  7397528.089881 
-348865.063799  7397504.653895 
-348828.516505  7397492.375999 
-348733.297279  7397481.267901 
-348691.851724  7397480.208083 
-348671.302117  7397490.556310 
-348599.180584  7397529.689607 
-348545.217251  7397565.393491 
-348534.109578  7397567.783082 
-348523.001906  7397564.603627 
-348438.090469  7397519.371374 
-348370.636302  7397482.077763 
-348309.498748  7397454.252529 
-348287.390603  7397450.503171 
-348249.227048  7397449.543335 
-348224.867683  7397445.733988 
-348205.571503  7397446.363880 
-348186.011444  7397452.322859 
-348164.686691  7397461.521284 
-348156.712586  7397471.069648 
-348151.773094  7397476.418732 
-348149.117808  7397480.238078 
-348145.316296  7397485.957098 
-348135.057985  7397497.035200 
-348020.179746  7397333.523209 
-347963.445679  7397278.942558 
-347919.732410  7397285.871371 
-347902.712190  7397296.459557 
-347845.161746  7397372.246576 
-347795.280297  7397462.411131 
-347622.612474  7397686.872683 
-347523.006254  7397756.680726 
-347422.393994  7397805.272402 
-347366.360856  7397948.757824 
-347272.370319  7398001.268830 
-347155.290337  7398035.712930 
-346951.336314  7398076.225990 
-346849.759245  7398096.412533 
-346813.525307  7398093.603014 
-346780.095088  7398092.663175 
-346751.670331  7398088.293923 
-346741.981010  7398085.794351 
-346735.111900  7398082.664887 
-346715.741504  7398067.357509 
-346688.248571  7398052.989970 
-346678.880853  7398049.870505 
-346661.382352  7398048.300774 
-346635.456203  7398051.430238 
-346602.652697  7398053.299917 
-346565.049886  7398053.809830 
-346526.424541  7398057.049275 
-346432.260834  7398056.989285 
-346420.782080  7398057.189251 
-346350.862291  7398054.859650 
-346335.227438  7398055.199592 
-346270.890346  7398056.739328 
-346231.522841  7398055.179595 
-346212.779159  7398055.489542 
-346193.722120  7398057.989114 
-346169.981222  7398063.298205 
-346131.553787  7398060.798633 
-346115.308712  7398062.048419 
-346104.687567  7398063.298205 
-346095.946563  7398064.857938 
-346085.630528  7398068.297348 
-346076.749338  7398071.136862 
-346051.581842  7398080.165316 
-346039.154772  7398085.684370 
-346026.282406  7398091.413389 
-346000.348011  7398099.851943 
-345974.421862  7398108.290498 
-345956.304893  7398112.659750 
-345936.621140  7398114.539428 
-345911.940172  7398115.159321 
-345896.008455  7398118.598732 
-345880.703450  7398125.467556 
-345865.390200  7398134.845949 
-345847.586588  7398147.343808 
-345825.090871  7398165.150758 
-345783.859718  7398196.385408 
-345766.674573  7398204.204069 
-345749.802785  7398209.203213 
-345726.688601  7398210.133053 
-345706.386381  7398210.452998 
-345683.890664  7398206.383695 
-345658.582982  7398200.134766 
-345640.152656  7398196.705353 
-345622.662401  7398194.205781 
-345602.665292  7398193.885836 
-345588.918825  7398196.385408 
-345580.606625  7398198.695012 
-345575.799072  7398199.824819 
-345561.120782  7398205.453855 
-345538.311708  7398218.261661 
-345528.317276  7398226.380270 
-345516.129347  7398237.008450 
-345501.451057  7398253.245668 
-345487.704590  7398269.812831 
-345474.898194  7398281.680798 
-345461.151728  7398291.989032 
-345427.408152  7398315.105072 
-345416.787007  7398320.104216 
-345407.105932  7398325.733252 
-345388.675606  7398339.480897 
-345363.367925  7398357.907741 
-345346.809493  7398367.596081 
-345270.787493  7398418.117427 
-345241.224756  7398436.324309 
-345214.045180  7398452.261579 
-345192.802890  7398464.759438 
-345165.309957  7398478.187138 
-345134.691703  7398492.254728 
-345108.765553  7398507.562106 
-345090.021871  7398519.120127 
-345053.779687  7398535.987237 
-345011.921821  7398562.232742 
-344959.747919  7398589.408087 
-344932.881700  7398606.285196 
-344908.514088  7398620.342788 
-344890.710476  7398630.031128 
-344867.909649  7398639.399524 
-344847.285826  7398651.587436 
-344832.178731  7398660.065984 
-344787.616101  7398689.071015 
-344758.877987  7398706.877965 
-344743.259626  7398717.196198 
-344734.197019  7398723.445128 
-344724.829301  7398729.694057 
-344715.766693  7398735.623042 
-344711.082834  7398740.002291 
-344723.559381  7398740.512204 
-344729.801778  7398741.132098 
-344739.449868  7398744.001606 
-344745.428385  7398745.821295 
-344756.832922  7398747.381028 
-344792.283467  7398753.789930 
-344809.938647  7398758.479127 
-344825.086973  7398764.568084 
-344843.368866  7398774.566371 
-344852.109871  7398781.755140 
-344860.083976  7398790.973561 
-344880.229517  7398811.590029 
-344893.819305  7398827.057380 
-344901.001772  7398834.396123 
-344912.406309  7398841.894838 
-344937.870669  7398855.332536 
-344963.483462  7398867.670423 
-344986.135857  7398880.798174 
-344991.603108  7398883.607693 
-345000.195681  7398886.577184 
-345019.096041  7398891.576328 
-345028.158649  7398895.485659 
-345037.526367  7398901.414643 
-345071.269943  7398928.909933 
-345105.945343  7398954.845491 
-345134.840135  7398972.812413 
-345159.991138  7398989.839497 
-345199.977111  7399003.897089 
-345222.002793  7399013.425457 
-345292.607019  7399039.830933 
-345302.923054  7399043.580291 
-345316.042807  7399048.729409 
-345383.810330  7399077.164539 
-345388.988963  7399079.044217 
-345417.257042  7399088.572584 
-345434.285508  7399094.821514 
-345449.442080  7399101.850310 
-345465.687154  7399108.719134 
-345472.712943  7399110.438839 
-345478.336872  7399109.658973 
-345488.958017  7399105.129748 
-345495.522017  7399102.630177 
-345504.576378  7399101.540363 
-345517.391021  7399100.750499 
-345527.698809  7399102.470204 
-345548.471064  7399107.939267 
-345571.898605  7399116.687769 
-345594.394322  7399124.496431 
-345612.667970  7399130.275441 
-345624.855898  7399136.684343 
-345649.380188  7399150.431989 
-345660.628047  7399157.310810 
-345687.650945  7399178.397198 
-345708.579878  7399194.644415 
-345714.987199  7399197.923854 
-345728.890344  7399201.833184 
-345746.380599  7399205.582542 
-345809.332324  7399216.830615 
-345828.702720  7399219.790108 
-345839.480543  7399223.079545 
-345859.939442  7399229.948368 
-345868.688692  7399234.787539 
-345879.301591  7399251.854616 
-345884.463732  7399259.943230 
-345888.372445  7399264.782401 
-345900.708806  7399269.781545 
-345916.178735  7399274.160795 
-345935.392452  7399278.060127 
-345959.446707  7399281.969457 
-345965.540671  7399282.279404 
-345975.221746  7399280.559699 
-345993.495393  7399274.630714 
-346005.840001  7399270.251465 
-346014.894362  7399267.911865 
-346026.768934  7399268.531759 
-346043.954079  7399270.411437 
-346082.686624  7399277.440233 
-346107.210914  7399281.659510 
-346122.054129  7399283.849135 
-346144.079811  7399288.848279 
-346150.017097  7399290.557986 
-346154.387599  7399293.847423 
-346175.629890  7399311.804347 
-346186.721070  7399321.022768 
-346209.686822  7399335.870225 
-346217.025967  7399338.209824 
-346225.461861  7399340.089502 
-346234.054434  7399340.089502 
-346249.870704  7399338.449783 
-346259.980583  7399337.120011 
-346267.171296  7399337.739904 
-346274.823798  7399338.989690 
-346284.661551  7399343.678887 
-346300.279912  7399354.926960 
-346311.684449  7399363.365515 
-346321.217092  7399371.484124 
-346327.616167  7399375.233482 
-346345.114668  7399380.862518 
-346377.876942  7399388.391228 
-346412.123538  7399395.390029 
-346431.650612  7399398.509495 
-346452.579546  7399400.859093 
-346473.203369  7399404.288505 
-346491.163659  7399406.008211 
-346503.813377  7399405.388317 
-346518.186557  7399402.728772 
-346526.267863  7399401.009067 
-346554.255570  7399394.880117 
-346599.815994  7399376.633242 
-346617.504159  7399369.794414 
-346651.800232  7399365.235195 
-346687.844506  7399362.975582 
-346715.164268  7399363.775445 
-346736.761146  7399364.675291 
-346756.972658  7399370.254335 
-346779.641546  7399380.922508 
-346795.680464  7399395.020093 
-346812.181172  7399411.907200 
-346832.128804  7399436.403004 
-346841.364582  7399443.821734 
-346887.337318  7399482.185162 
-346897.405966  7399486.764378 
-346905.660443  7399484.014849 
-346921.122125  7399497.362562 
-346949.522143  7399491.273605 
-346998.216135  7399485.184648 
-347040.824409  7399491.273605 
-347083.432683  7399501.421867 
-347114.801344  7399510.090382 
-347142.261292  7399501.421867 
-347166.612411  7399501.421867 
-347186.898139  7399507.510824 
-347211.249258  7399527.797349 
-347236.746603  7399566.990636 
-347288.343268  7399585.627443 
-347318.780105  7399595.775705 
-347363.408706  7399595.775705 
-347438.474143  7399605.913969 
-347464.853835  7399616.062230 
-347477.025272  7399624.180840 
-347495.282426  7399624.180840 
-347519.633545  7399595.775705 
-347539.919273  7399579.538486 
-347568.327537  7399579.538486 
-347606.870419  7399591.716401 
-347643.392975  7399589.686748 
-347708.315549  7399563.311266 
-347779.323841  7399543.024741 
-347828.553838  7399522.288293 
-347841.673591  7399504.181394 
-347855.840615  7399508.140716 
-347879.771176  7399510.090382 
-347913.457029  7399511.750098 
-347980.672055  7399518.628920 
-348028.689856  7399523.388105 
-348055.490105  7399524.997829 
-348115.431956  7399530.476890 
-348250.018686  7399540.155232 
-348291.983754  7399545.144378 
-348318.866466  7399545.764272 
-348364.179503  7399543.104727 
-348381.306924  7399541.674972 
-348399.168260  7399538.705481 
-348421.556776  7399533.376394 
-348456.248668  7399533.176428 
-348479.931843  7399535.835972 
-348588.806826  7399545.144378 
-348642.151692  7399548.753760 
-348666.618258  7399552.543111 
-348699.388779  7399551.993205 
-348724.877878  7399549.663604 
-348759.140966  7399547.184029 
-348878.900974  7399529.557048 
-348896.028395  7399528.517226 
-348909.750123  7399527.907330 
-348920.016680  7399526.967491 
-348948.251774  7399528.027310 
-348963.540285  7399530.436897 
-348982.622063  7399533.356397 
-349003.468534  7399539.705310 
-349027.935100  7399550.583446 
-349102.291362  7399586.977212 
-349116.582080  7399594.905854 
-349174.503604  7399305.255469 
-349215.289461  7399090.702220 
-349227.749515  7399021.554064 
-349249.148484  7398872.559586 
-349259.868584  7398795.392804 
-349269.879508  7398718.975893 
-349285.407160  7398596.836814 
-349296.572556  7398517.010488 
-Region 1
-99
-331947.773195  7394622.227629 
-331988.954871  7394549.330116 
-332010.592980  7394503.887899 
-332039.141430  7394433.629934 
-332046.257927  7394412.353578 
-332069.438082  7394323.538792 
-332074.946564  7394302.732356 
-332083.201041  7394265.448742 
-332094.218005  7394242.042751 
-332110.743451  7394207.368691 
-332124.506410  7394190.031660 
-332140.116525  7394177.893739 
-332174.998080  7394148.418788 
-332195.193099  7394138.010571 
-332216.303449  7394128.482203 
-332237.306599  7394120.463577 
-332320.016292  7394088.599035 
-332383.363836  7394063.463340 
-332403.558855  7394053.924974 
-332422.838542  7394046.116312 
-332451.288038  7394042.966851 
-332485.246016  7394039.187498 
-332506.513045  7394035.928057 
-332622.026244  7394018.381062 
-332680.590974  7394004.803388 
-332776.849224  7393992.055572 
-332834.737763  7393981.237425 
-332883.440001  7393972.568910 
-332893.986930  7393999.964217 
-332939.159782  7394131.901617 
-332953.747364  7394225.305618 
-332962.933665  7394266.918490 
-332960.171177  7394312.870619 
-332953.747364  7394354.483491 
-332940.017390  7394392.426992 
-332928.043863  7394424.711462 
-332915.196236  7394446.377750 
-332903.865915  7394463.394836 
-332868.382384  7394516.605721 
-332787.783726  7394657.381607 
-332744.119935  7394737.757840 
-332726.613187  7394771.852000 
-332731.049659  7394775.561364 
-332743.922025  7394787.569307 
-332759.020873  7394808.995637 
-332780.147716  7394841.380090 
-332812.101860  7394889.331876 
-333003.983401  7395244.701005 
-333055.472865  7395340.264636 
-333089.109240  7395412.862200 
-333099.087179  7395434.388513 
-333153.619502  7395514.324821 
-333200.021042  7395602.029798 
-333213.718031  7395626.335634 
-333219.548116  7395644.492524 
-333223.860895  7395658.210175 
-333227.151141  7395675.497213 
-333239.281346  7395834.849918 
-333244.831059  7395918.725551 
-333252.038265  7396000.001629 
-333260.902963  7396133.828705 
-333263.723174  7396222.513514 
-333226.928493  7396231.451983 
-333185.812787  7396242.400108 
-333078.718989  7396269.485469 
-332929.998220  7396307.788908 
-332916.062090  7396308.218834 
-332896.856619  7396295.920940 
-332818.270040  7396299.800276 
-332794.694067  7396302.709778 
-332685.670652  7396309.468620 
-332629.662253  7396310.678413 
-332556.006921  7396291.221745 
-332484.833704  7396236.451127 
-332453.027993  7396212.135292 
-332359.392044  7396139.707698 
-332277.358541  7396076.498526 
-332198.120511  7396013.299351 
-332181.141522  7396000.001629 
-332132.233128  7395962.258094 
-332053.440394  7395902.098399 
-331999.996573  7395867.714288 
-331982.126992  7395846.967842 
-331942.611054  7395642.872802 
-331874.051893  7395596.040824 
-331841.883347  7395554.207989 
-331836.449081  7395438.667780 
-331825.168237  7395322.887612 
-331823.362313  7395226.394141 
-331821.102846  7395148.427496 
-331827.798785  7395101.795483 
-331833.068126  7395065.111767 
-331835.855352  7395053.303789 
-331841.132940  7395038.176381 
-331842.831663  7394977.996689 
-331833.059880  7394948.131805 
-331819.131997  7394908.448602 
-331882.858867  7394780.830462 
-331947.773195  7394622.227629 
-Region 1
-97
-331982.126992  7395846.967842 
-331999.996573  7395867.714288 
-332053.440394  7395902.098399 
-332132.233128  7395962.258094 
-332181.141522  7396000.001629 
-332198.120511  7396013.299351 
-332277.358541  7396076.498526 
-332359.392044  7396139.707698 
-332453.027993  7396212.135292 
-332484.833704  7396236.451127 
-332556.006921  7396291.221745 
-332629.662253  7396310.678413 
-332685.670652  7396309.468620 
-332492.832548  7396624.534652 
-332439.479436  7396805.113720 
-332399.608911  7396868.092933 
-332328.617111  7396927.462763 
-332281.968184  7396961.047010 
-332224.120876  7396972.245092 
-332169.167995  7396976.304397 
-332016.959070  7397003.399756 
-331995.799242  7397004.029648 
-331968.693882  7397002.339937 
-331765.383065  7396968.455741 
-331762.670055  7397072.437930 
-331759.816860  7397168.441486 
-331704.319727  7397269.404192 
-331651.486128  7397365.547723 
-331604.202241  7397438.875163 
-331573.072720  7397497.215170 
-331509.568498  7397617.484569 
-331436.457417  7397744.902743 
-331363.659693  7397880.439527 
-331328.110193  7397965.235002 
-331299.471034  7397999.999047 
-331296.741531  7398008.977509 
-331274.542678  7398041.781890 
-331254.331167  7398071.996715 
-331236.445093  7398106.750762 
-331198.372246  7398138.695290 
-331139.568375  7398194.775684 
-331110.789030  7398177.908573 
-331066.622219  7398158.281935 
-331057.691551  7398153.602736 
-330981.331455  7398110.820065 
-330942.928759  7398062.308374 
-330871.334985  7397986.731320 
-330793.482321  7397889.997889 
-330734.769159  7397825.039016 
-330692.136147  7397777.527155 
-330657.411269  7397734.804473 
-330635.162939  7397701.900109 
-330607.991609  7397652.518568 
-330587.466741  7397611.735553 
-330578.197978  7397586.129939 
-330567.073813  7397547.076629 
-330551.719331  7397477.308579 
-330510.001650  7397294.999807 
-330498.926963  7397245.178341 
-330480.999657  7397149.084801 
-330476.084904  7397134.487302 
-330459.213116  7397083.336063 
-330458.149352  7396984.532987 
-330457.456669  7396919.554118 
-330458.767819  7396868.192915 
-330456.722754  7396819.181311 
-330460.450050  7396713.489415 
-330466.247150  7396616.925955 
-330429.559670  7396542.708668 
-330363.523855  7396390.924667 
-330293.109292  7396239.940529 
-330222.059769  7396074.118933 
-330213.722829  7396052.872572 
-330285.110448  7395986.443951 
-330362.567293  7395907.877409 
-330423.861525  7395852.816840 
-330470.469221  7395823.501862 
-330517.810831  7395795.986575 
-330600.330861  7395744.005479 
-330654.788968  7395703.852356 
-330729.062767  7395661.199662 
-330781.112975  7395641.623016 
-330853.061338  7395616.997234 
-330952.156291  7395579.213706 
-331010.110800  7395563.586383 
-331082.100394  7395564.196278 
-331134.488697  7395563.576384 
-331270.823628  7395558.717217 
-331370.034029  7395558.257296 
-331500.002871  7395553.918039 
-331590.546483  7395552.708246 
-331713.918340  7395552.948205 
-331806.003997  7395552.498282 
-331841.883347  7395554.207989 
-331874.051893  7395596.040824 
-331942.611054  7395642.872802 
-331982.126992  7395846.967842 
-Region 1
-219
-335156.216615  7400192.113558 
-335258.593568  7400348.396788 
-335292.353637  7400398.358230 
-335373.463561  7400535.854678 
-335400.956494  7400621.100076 
-335410.588092  7400678.850184 
-335425.711679  7400823.225454 
-335446.723074  7400938.995624 
-335449.089742  7400984.777782 
-335470.290801  7401032.279645 
-335482.891042  7401078.571716 
-335499.639136  7401130.622800 
-335525.449838  7401190.002629 
-335555.342424  7401264.669839 
-335593.266839  7401358.003851 
-335603.088100  7401380.769952 
-335672.521362  7401553.330394 
-335623.283119  7401573.077011 
-335496.522061  7401625.518029 
-335479.336916  7401617.959323 
-335466.967570  7401608.330973 
-335345.962382  7401691.516724 
-335334.961910  7401700.455193 
-335242.158831  7401759.575066 
-335176.156001  7401802.197765 
-335121.079426  7401837.441728 
-335046.220144  7401888.822927 
-335172.626614  7402004.713076 
-335221.320606  7402042.096673 
-335299.527857  7402188.171651 
-335333.469343  7402249.651120 
-335363.930919  7402293.653583 
-335314.783384  7402304.251768 
-335191.320819  7402326.877892 
-335135.246450  7402341.135450 
-335075.733404  7402353.433343 
-335019.659035  7402365.731237 
-335001.459604  7402367.700899 
-334969.002440  7402374.089805 
-334891.776490  7402389.337193 
-334793.704069  7402411.423410 
-334665.211303  7402435.339314 
-334607.965970  7402447.867168 
-334482.046028  7402473.942701 
-334377.640502  7402474.472610 
-334383.891145  7402451.776498 
-334381.227612  7402411.963318 
-334383.891145  7402300.952333 
-334379.256763  7402229.984489 
-334359.581257  7402151.287969 
-334277.110704  7402221.205993 
-334249.403369  7402244.242047 
-334197.270699  7402308.181095 
-334132.339879  7402341.135450 
-334108.318609  7402360.422146 
-334081.683284  7402366.711069 
-334022.656765  7402375.569552 
-333935.106534  7402371.140310 
-333895.763768  7402354.423174 
-333867.231810  7402319.499156 
-333798.136643  7402290.464129 
-333765.003289  7402271.497378 
-333742.952868  7402258.219653 
-333701.466081  7402224.075501 
-333563.259256  7402105.045890 
-333512.107887  7402089.308586 
-333449.147916  7402093.737827 
-333376.861458  7402093.727829 
-333242.818979  7402071.341663 
-333169.303833  7402072.081536 
-333080.269281  7402069.132042 
-333019.280159  7402056.344232 
-332971.080941  7402036.667603 
-332944.618786  7402024.779639 
-332919.327597  7402009.322287 
-332893.351971  7401985.846308 
-332871.548937  7401962.030387 
-332850.916868  7401934.405119 
-332837.417788  7401915.998272 
-332791.766655  7401840.901136 
-332769.576049  7401817.455152 
-332747.360703  7401798.968318 
-332686.585983  7401761.494737 
-332584.637834  7401705.004413 
-332547.999831  7401686.017666 
-332497.706070  7401666.161067 
-332390.439102  7401654.613045 
-332322.193297  7401649.483924 
-332273.260165  7401648.704057 
-332210.308440  7401645.144667 
-332096.526949  7401640.395480 
-332001.621081  7401630.527171 
-331951.780863  7401620.538882 
-331925.302216  7401611.560420 
-331904.117650  7401602.991887 
-331877.944114  7401587.154600 
-331848.043281  7401567.807914 
-331783.508280  7401512.197439 
-331754.151699  7401495.290336 
-331715.023335  7401484.622163 
-331626.961838  7401471.274449 
-331558.476892  7401457.046886 
-331390.558897  7401423.512630 
-331419.940217  7401353.414638 
-331445.140698  7401291.545235 
-331461.525958  7401252.471928 
-331482.479630  7401230.405708 
-331499.837946  7401204.040224 
-331509.271634  7401188.382906 
-331585.549267  7401091.649476 
-331665.240840  7400988.817090 
-331689.047708  7400963.191479 
-331709.869441  7400950.923581 
-331654.636188  7400835.513349 
-331703.668275  7400807.538141 
-331750.267724  7400781.452609 
-331800.940812  7400753.797347 
-331844.728297  7400724.142426 
-331865.459320  7400710.894695 
-331887.658173  7400696.707126 
-331932.913487  7400666.042378 
-331996.623865  7400626.879087 
-332030.219009  7400601.613414 
-332036.057340  7400580.637007 
-332051.683947  7400531.615404 
-332094.259236  7400400.557853 
-332099.413130  7400382.880881 
-332109.729165  7400346.787064 
-332122.989103  7400304.054383 
-332147.298991  7400223.768136 
-332182.642336  7400104.008649 
-332204.733988  7400048.868095 
-332227.097765  7399999.996466 
-332230.420996  7399994.147468 
-332242.889297  7399974.100902 
-332268.337165  7399932.238072 
-332290.239153  7399894.174592 
-332323.570418  7399841.403631 
-332437.838436  7399655.405491 
-332408.448870  7399636.028810 
-332393.003680  7399623.540949 
-332375.777304  7399606.983785 
-332356.299707  7399582.028060 
-332344.911663  7399567.770502 
-332322.119081  7399546.374167 
-332286.149023  7399519.348796 
-332261.583502  7399501.241898 
-332237.760142  7399486.194475 
-332216.987887  7399478.235839 
-332203.546531  7399473.656623 
-331999.996573  7399428.104426 
-331940.846361  7399415.636561 
-331868.493933  7399398.089567 
-331653.852796  7399351.307580 
-331630.260330  7399256.933746 
-331561.841354  7399202.673040 
-331571.275042  7399153.131526 
-331658.569640  7399122.466779 
-331490.833062  7399082.843566 
-331595.857056  7398431.905066 
-331543.237858  7398430.295341 
-331451.028507  7398392.191868 
-331325.083826  7398366.016352 
-331190.513588  7398378.574201 
-331166.014037  7398379.634019 
-331157.124600  7398323.783586 
-331542.536928  7398255.255324 
-331752.411744  7398227.770032 
-332221.201710  7398166.210577 
-333145.323794  7398119.288614 
-333595.650450  7398089.513714 
-334098.390147  7398060.788635 
-334304.290280  7398055.099609 
-334441.524051  7398082.554906 
-334606.209523  7398132.456359 
-334733.465354  7398142.434649 
-334783.082924  7398135.865775 
-334771.043428  7398197.235263 
-334762.492086  7398231.399410 
-334753.948991  7398257.025021 
-334748.259092  7398281.220877 
-334739.715997  7398302.577218 
-334726.901355  7398323.933560 
-334711.241763  7398343.860147 
-334645.131732  7398434.794571 
-334548.955944  7398558.803329 
-334534.731196  7398587.278452 
-334523.343151  7398614.323819 
-334517.653252  7398629.981137 
-334516.226654  7398647.068210 
-334513.381705  7398668.414554 
-334519.071604  7398691.190652 
-334519.071604  7398723.935044 
-334510.528509  7398968.773105 
-334514.668117  7398970.572797 
-334573.150384  7398996.638332 
-334697.421080  7399062.287087 
-334782.728336  7399107.689310 
-334796.845883  7399114.848084 
-334934.590920  7399186.895743 
-334971.534033  7399206.242429 
-335001.937886  7399222.069718 
-335015.882262  7399230.488276 
-335036.143250  7399247.815308 
-335047.778682  7399261.822908 
-335057.896807  7399278.110118 
-335069.260113  7399302.785892 
-335078.339213  7399332.290838 
-335083.072549  7399376.013348 
-335083.806463  7399388.971129 
-335087.286373  7399424.545035 
-335109.806829  7399709.466231 
-335110.293356  7399724.213705 
-335110.021231  7399736.661573 
-335100.002060  7399800.920566 
-335075.782881  7400000.986296 
-335064.856625  7400045.458679 
-335131.469677  7400128.174510 
-335156.216615  7400192.113558 
-Region 1
-169
-329337.247466  7384055.727575 
-329389.660508  7384135.743869 
-329418.192466  7384185.275384 
-329325.240955  7384299.225866 
-329294.177404  7384337.399327 
-329237.336136  7384404.307866 
-329207.138439  7384433.322896 
-329185.698240  7384455.779050 
-329163.969422  7384467.667013 
-329115.728972  7384500.821334 
-329067.719418  7384537.415066 
-329045.223700  7384559.041362 
-329029.423923  7384586.256700 
-328985.356066  7384745.199474 
-328971.403444  7384809.698426 
-328955.578927  7384871.227887 
-328935.524094  7384944.955258 
-328879.532188  7385055.116388 
-328846.736929  7385106.097656 
-328806.643755  7385165.677450 
-328750.503417  7385241.284500 
-328667.909171  7385322.490590 
-328566.142439  7385405.706336 
-328512.203844  7385445.219567 
-328429.551874  7385503.209634 
-328387.248711  7385548.991792 
-328337.119875  7385595.063900 
-328319.720328  7385617.080129 
-328313.519163  7385621.769326 
-328175.370061  7385781.361989 
-328138.723812  7385865.967497 
-328098.490452  7385935.395605 
-328019.277161  7386040.087672 
-327884.583229  7386123.873320 
-327838.288891  7386174.204699 
-327814.317098  7386188.692217 
-327793.099547  7386197.130772 
-327770.298719  7386203.059756 
-327742.583138  7386202.979770 
-327718.924702  7386193.261435 
-327699.026547  7386200.110261 
-327615.162382  7386198.190590 
-327550.627381  7386191.981654 
-327490.759746  7386188.902181 
-327460.586788  7386194.431234 
-327449.850196  7386192.871501 
-327415.257258  7386206.799116 
-327376.351542  7386222.096495 
-327327.335947  7386242.383020 
-327253.977479  7386281.536314 
-327176.561866  7386321.019551 
-327127.026759  7386347.694981 
-327067.678637  7386380.759318 
-327000.702751  7386416.073269 
-326979.559416  7386434.350138 
-326962.836060  7386453.616838 
-326924.392133  7386496.289529 
-326854.233202  7386589.153622 
-326763.062876  7386705.723654 
-326706.543212  7386745.806789 
-326616.106800  7386772.642192 
-326560.436497  7386791.488964 
-326475.186965  7386824.303343 
-326410.421069  7386736.738342 
-326342.389666  7386633.066100 
-326212.808398  7386526.164411 
-326054.076704  7386441.938838 
-325862.953816  7386380.389381 
-325644.890493  7386305.162267 
-325597.309742  7386279.966583 
-325450.724746  7386158.887323 
-325168.885075  7385841.411703 
-324995.252443  7385632.497488 
-324553.378174  7385115.766000 
-324455.866496  7385012.963609 
-324316.892771  7384827.445386 
-324180.838212  7384658.984242 
-324045.080517  7384462.247941 
-323987.744475  7384344.708075 
-323928.148966  7384066.155788 
-323921.807615  7383874.558607 
-323953.341201  7383679.621998 
-324019.278061  7383516.219987 
-324125.341079  7383355.677487 
-324269.394483  7383182.247194 
-324348.484081  7383072.525988 
-324485.470464  7382897.405985 
-324599.796206  7382757.349975 
-324623.660797  7382735.833661 
-324650.749665  7382703.469204 
-324700.227049  7382661.306426 
-324745.061805  7382623.522898 
-324804.228510  7382580.330297 
-324864.640396  7382538.017545 
-324964.658927  7382475.868190 
-325076.791171  7382399.131335 
-325111.738697  7382373.155784 
-325185.905295  7382317.925245 
-325277.240546  7382239.388697 
-325337.413291  7382165.011437 
-325414.235176  7382062.818942 
-325464.166102  7381997.030211 
-325543.808198  7381883.059733 
-325574.863503  7381821.520274 
-325675.096436  7381885.109382 
-325723.848152  7381832.018476 
-325775.716942  7381892.528111 
-325819.331256  7381952.747796 
-325833.869361  7381960.826412 
-325874.432569  7382009.048152 
-325902.032703  7382037.573266 
-325970.863991  7382108.621096 
-326039.142780  7382157.762679 
-326083.862089  7382197.585858 
-326137.462588  7382245.847591 
-326198.039399  7382307.826974 
-326243.286466  7382331.292955 
-326316.141914  7382347.000264 
-326423.458360  7382375.945306 
-326508.947033  7382405.470249 
-326564.427673  7382431.355815 
-326647.788818  7382470.839052 
-326665.419259  7382478.457747 
-326669.756777  7382480.637373 
-326755.286681  7382529.538997 
-326804.425969  7382556.034459 
-326932.926982  7382626.382409 
-327180.528303  7382767.468242 
-327277.800840  7382820.989074 
-327378.330637  7382888.947434 
-327405.493721  7382905.344625 
-327458.129411  7382945.517744 
-327554.593818  7383012.766225 
-327666.833263  7383082.854219 
-327693.617020  7383109.169712 
-327745.650735  7383142.234048 
-327811.620581  7383190.605762 
-327927.282212  7383286.069410 
-327999.997474  7383347.198939 
-328011.806076  7383355.327547 
-328042.449069  7383379.913336 
-328069.216334  7383385.992294 
-328109.260030  7383384.292585 
-328155.051348  7383375.564081 
-328248.423418  7383356.857285 
-328346.932889  7383334.361138 
-328402.867072  7383323.223046 
-328432.767904  7383315.324399 
-328488.908242  7383300.047016 
-328545.056827  7383269.132311 
-328576.499704  7383239.557377 
-328582.552438  7383233.858353 
-328636.491032  7383208.842638 
-328673.046573  7383210.022436 
-328723.958801  7383228.089342 
-328772.372421  7383294.108033 
-328844.370261  7383390.861460 
-328863.691179  7383416.697035 
-328885.988987  7383449.441426 
-328926.609919  7383502.902269 
-328969.457333  7383568.301066 
-329014.687908  7383623.311644 
-329064.107569  7383690.260176 
-329073.392824  7383703.307941 
-329148.903558  7383805.420450 
-329177.740627  7383845.093654 
-329208.111494  7383884.246948 
-329282.137907  7383981.070363 
-329337.247466  7384055.727575 
-Region 1
-239
-322073.266583  7401813.385849 
-322102.252084  7401807.756813 
-322136.193569  7401797.948493 
-322176.608345  7401773.282718 
-322202.930314  7401755.055840 
-322219.711393  7401743.287856 
-322250.610019  7401711.743259 
-322282.267299  7401682.098337 
-322351.296495  7401634.646465 
-322414.017326  7401595.343197 
-322459.338609  7401582.975316 
-322530.396379  7401561.349020 
-322599.417329  7401539.722725 
-322642.322467  7401394.177655 
-322685.450254  7401282.586770 
-322778.550198  7401112.815850 
-322839.209470  7401034.459272 
-322907.884079  7400952.313343 
-323098.223575  7400754.237271 
-323148.566813  7400696.057237 
-323211.130965  7400618.090592 
-323236.306707  7400586.136065 
-323267.601152  7400543.913298 
-323362.210157  7400397.778329 
-323442.495458  7400303.044556 
-323610.446438  7400065.355270 
-323889.193772  7399748.599528 
-324152.108344  7399463.518360 
-324347.552257  7399235.407433 
-324392.205596  7399056.798027 
-324343.082800  7399027.772999 
-324280.576371  7398954.105617 
-324166.712419  7398772.156784 
-324101.971262  7398696.249786 
-323992.576766  7398611.404319 
-323878.712813  7398544.435790 
-323748.999605  7398458.030591 
-323728.713878  7398532.747792 
-323743.070565  7398541.736253 
-323786.709618  7398579.659757 
-323806.566541  7398597.366724 
-323818.498837  7398619.242976 
-323818.836933  7398640.789286 
-323806.566541  7398658.686220 
-323786.676633  7398674.933437 
-323790.659562  7398636.480024 
-323778.727267  7398615.593602 
-323760.173248  7398607.634965 
-323738.634093  7398607.974907 
-323705.071935  7398620.162819 
-323683.351363  7398683.611951 
-323671.773655  7398722.585275 
-323655.990370  7398757.779246 
-323633.370959  7398796.822559 
-323619.022518  7398818.258887 
-323600.880810  7398842.014818 
-323563.830496  7398887.996941 
-323539.199005  7398909.883192 
-323512.679127  7398932.529313 
-323489.952516  7398952.495893 
-323458.855980  7398976.321812 
-323417.863967  7398998.288049 
-323386.371612  7399017.544751 
-323336.251023  7399042.230522 
-323290.649367  7399060.407409 
-323253.409390  7399072.815284 
-323224.506351  7399080.224015 
-323196.007378  7399089.912355 
-323152.656943  7399100.450550 
-323118.797920  7399107.119408 
-323082.283611  7399112.658459 
-323033.202046  7399119.787238 
-322955.530800  7399123.646577 
-322869.143288  7399131.745189 
-322758.734505  7399139.843802 
-322580.162381  7399152.961555 
-322464.888323  7399161.410108 
-322392.972945  7399167.499065 
-322193.109053  7399181.566655 
-322094.170778  7399192.034862 
-321966.222263  7399200.423425 
-321908.779020  7399203.722860 
-321879.859489  7399206.542377 
-321759.951050  7399215.590827 
-321670.273291  7399221.439826 
-321568.201448  7399228.868553 
-321436.335974  7399243.815993 
-321339.813844  7399265.572266 
-321260.963387  7399303.635746 
-321202.720260  7399351.847488 
-321113.496044  7399453.210125 
-321044.796697  7399541.534996 
-320963.241476  7399650.296366 
-320901.411238  7399755.218394 
-320873.505994  7399825.656329 
-320857.203196  7399889.555383 
-320866.076140  7399938.087070 
-320862.893095  7399944.915901 
-320848.124096  7400288.097117 
-320836.678328  7400380.111356 
-320829.141273  7400428.203118 
-320811.123259  7400473.505358 
-320790.466451  7400507.589520 
-320771.063070  7400550.142231 
-320754.413931  7400594.194685 
-320693.886598  7400620.600162 
-320651.492726  7400648.615363 
-320599.071438  7400661.123221 
-320519.247925  7400668.371979 
-320401.681415  7400673.761056 
-320114.737327  7400659.133562 
-320064.121963  7400654.034435 
-319955.618060  7400676.660559 
-319878.598266  7400706.155507 
-319793.307503  7400752.737528 
-319724.171105  7400814.606930 
-319686.659002  7400863.178611 
-319632.967794  7400964.561245 
-319619.592408  7401009.053623 
-319504.029731  7401386.588955 
-319411.309114  7401537.023187 
-319367.051594  7401603.181855 
-319310.070140  7401670.730284 
-319248.462551  7401745.287513 
-319220.928387  7401818.165030 
-319183.886319  7401872.285760 
-319161.522542  7401936.154819 
-319144.263181  7401997.034391 
-319141.649126  7402069.651953 
-319147.693613  7402142.369497 
-319168.309189  7402235.913473 
-319193.682841  7402307.811158 
-319206.448006  7402364.951370 
-319210.150564  7402411.413412 
-319223.410503  7402471.583105 
-319235.128396  7402533.752456 
-319236.200406  7402590.782688 
-319235.318060  7402638.194566 
-319218.281347  7402670.319064 
-319198.556363  7402721.580283 
-319185.972615  7402769.392093 
-319151.569341  7402810.924979 
-319112.993474  7402867.045366 
-319053.686583  7402905.808726 
-319076.940954  7402940.782736 
-319089.722611  7402957.949795 
-319251.868245  7402978.646250 
-319392.161367  7402959.099598 
-319553.160774  7403009.700931 
-319801.990783  7403122.831552 
-320024.746212  7403086.307809 
-320154.047108  7403020.469086 
-320162.441771  7402998.272888 
-320167.793575  7402987.434745 
-320179.701132  7402972.937228 
-320191.625181  7402969.117882 
-320205.957130  7402973.797081 
-320228.700234  7402978.326305 
-320255.508730  7402983.415433 
-320273.749393  7402984.805195 
-320298.504577  7402985.275115 
-320315.302149  7402983.895351 
-320337.608203  7402978.886209 
-320436.727895  7402942.572429 
-320477.307596  7402925.625332 
-320500.182640  7402922.055943 
-320515.182533  7402910.117988 
-320551.746320  7402899.129871 
-320563.282797  7402896.090391 
-320583.428338  7402897.310182 
-320591.023117  7402898.150038 
-320613.700251  7402903.089192 
-320633.854039  7402904.129014 
-320663.136404  7402905.098848 
-320684.469402  7402905.048857 
-320702.058612  7402904.139013 
-320734.392083  7402893.740794 
-320783.655065  7402888.311724 
-320830.163805  7402903.879057 
-320970.762038  7402996.433203 
-320965.764822  7402952.980646 
-320955.374572  7402859.886593 
-320943.780371  7402760.803565 
-320967.983058  7402641.923928 
-320956.413597  7402398.905554 
-320935.740296  7402369.620571 
-320911.653057  7402335.736375 
-320906.845504  7402318.099396 
-320935.740296  7402205.548675 
-320921.136222  7402173.344191 
-320849.410508  7402100.326698 
-320797.805596  7402084.789360 
-320773.751342  7402068.752107 
-320765.736005  7402062.343205 
-320751.305102  7402033.478149 
-320746.497549  7402003.013367 
-320749.705333  7401972.548586 
-320780.166909  7401932.455453 
-320828.522806  7401898.461276 
-320872.607155  7401918.327873 
-320932.227402  7401834.502232 
-320995.566700  7401836.361913 
-321014.186689  7401843.190743 
-321025.368577  7401847.539998 
-321039.032581  7401850.019574 
-321050.832938  7401846.920105 
-321054.560234  7401836.981807 
-321104.853994  7401830.772870 
-321150.373188  7401833.722365 
-321168.820006  7401818.354997 
-321208.550345  7401796.478745 
-321237.758494  7401781.761266 
-321267.626341  7401764.254264 
-321278.956662  7401756.015676 
-321302.648083  7401743.657792 
-321368.568451  7401720.991675 
-321436.550376  7401702.454850 
-321473.633675  7401691.126791 
-321494.216267  7401690.096967 
-321517.899441  7401704.144561 
-321533.369370  7401728.200440 
-321559.122348  7401735.409205 
-321583.836302  7401740.558323 
-321594.144090  7401735.409205 
-321620.919601  7401710.693439 
-321677.571205  7401693.186438 
-321744.514106  7401672.579967 
-321788.796364  7401708.633792 
-321834.125894  7401746.747263 
-321863.573184  7401754.785886 
-321884.164022  7401759.805027 
-321908.276000  7401775.582324 
-321916.942789  7401784.310829 
-321930.276944  7401797.318601 
-321947.437350  7401803.467548 
-321976.043524  7401805.457207 
-322011.122989  7401806.327058 
-322045.245891  7401815.905417 
-322073.266583  7401813.385849 
-Region 1
-355
-343659.482271  7390595.647346 
-343657.057879  7390606.285523 
-343648.292136  7390625.042311 
-343623.965756  7390672.784133 
-343581.283266  7390750.190874 
-343537.767907  7390829.067363 
-343523.873008  7390860.571967 
-343496.000748  7390918.891977 
-343475.591328  7390947.437087 
-343437.444265  7390999.768123 
-343408.961784  7391033.782297 
-343373.362806  7391080.464301 
-343339.635723  7391127.716207 
-343317.519332  7391155.361472 
-343282.769716  7391190.905383 
-343256.827075  7391203.183280 
-343211.687208  7391219.330514 
-343161.929452  7391237.497403 
-343064.780609  7391314.114279 
-342971.581710  7391382.822510 
-342888.649369  7391443.642092 
-342883.916032  7391447.591415 
-342864.166310  7391465.758304 
-342828.699272  7391490.654039 
-342812.223303  7391514.969874 
-342768.221416  7391525.878006 
-342747.102820  7391532.316903 
-342627.400536  7391563.001647 
-342477.888128  7391601.765007 
-342316.039359  7391641.988117 
-342167.532991  7391680.431532 
-342024.733015  7391717.365206 
-341884.794481  7391742.980818 
-341733.146299  7391770.296139 
-341619.298839  7391797.421493 
-341566.572440  7391810.609234 
-341513.582162  7391822.747155 
-341459.742522  7391838.884390 
-341392.337833  7391855.461551 
-341213.452352  7391901.733625 
-341113.219418  7391926.309415 
-341092.612088  7391744.560547 
-341093.214062  7391743.520725 
-341085.932641  7391678.021945 
-341078.148199  7391636.499057 
-341072.103712  7391551.963537 
-341067.032280  7391500.942277 
-341059.379778  7391432.014084 
-341046.804276  7391322.802791 
-340930.705595  7391331.491302 
-340843.542937  7391339.929857 
-340804.777407  7391332.021212 
-340725.349713  7391314.904144 
-340691.870017  7391304.655899 
-340626.164051  7391286.219057 
-340596.609560  7391278.570367 
-340568.176557  7391268.302126 
-340506.552476  7391251.325034 
-340511.310551  7391223.279838 
-340529.221364  7391147.782770 
-340410.277733  7391129.335930 
-340349.915324  7391121.197324 
-340314.423548  7391117.457964 
-340232.505492  7391111.129048 
-340266.917013  7391014.555590 
-340275.567309  7390995.018937 
-340324.607643  7390861.331836 
-340338.057245  7390822.568476 
-340382.355996  7390706.278396 
-340561.925914  7390371.665712 
-340624.424096  7390291.769397 
-340644.198558  7390268.033463 
-340682.172450  7390220.571593 
-340717.771427  7390174.689452 
-340743.087355  7390150.953518 
-340808.743844  7390075.806390 
-340813.378225  7390063.258539 
-340841.967907  7390023.595333 
-340878.589417  7389978.523053 
-340921.238922  7389933.500765 
-340952.962172  7389897.946855 
-341001.012958  7389875.840642 
-341145.124084  7389816.100875 
-341187.410755  7389796.864170 
-341263.968761  7389722.146968 
-341284.089563  7389697.291226 
-341296.895959  7389736.724471 
-341350.117132  7389721.037158 
-341339.322816  7389695.031613 
-341336.510852  7389677.084687 
-341370.650246  7389672.065547 
-341391.974999  7389670.485817 
-341413.299751  7389658.637847 
-341517.556845  7389562.274353 
-341544.414819  7389541.737871 
-341564.947933  7389529.889900 
-341673.154971  7389469.080316 
-341763.195564  7389422.478299 
-341766.139468  7389367.297751 
-341765.141674  7389326.894672 
-341764.267574  7389305.918265 
-341762.791499  7389276.763259 
-341758.998232  7389243.728917 
-341755.460600  7389222.722515 
-341750.760248  7389203.965728 
-341835.127434  7389156.403875 
-341819.459596  7389102.823053 
-341806.372828  7389056.141049 
-341797.623577  7389026.666098 
-341787.670376  7388999.930678 
-341756.870705  7388954.908389 
-341726.071033  7388909.896100 
-341707.904587  7388880.671106 
-341695.263116  7388849.866382 
-341669.839987  7388842.297679 
-341672.363333  7388794.575853 
-341674.730001  7388702.171681 
-341673.938363  7388533.150633 
-341681.294001  7388514.493828 
-341691.321418  7388493.227471 
-341712.456507  7388464.112458 
-341738.316686  7388451.324649 
-341795.595004  7388523.822231 
-341822.057158  7388549.687800 
-341833.577142  7388560.225995 
-341850.613855  7388570.484238 
-341856.905729  7388573.763676 
-341878.791225  7388578.432876 
-341897.749309  7388580.742481 
-341939.269081  7388582.522176 
-341980.203370  7388581.972270 
-341993.595248  7388579.682662 
-342013.262508  7388572.913822 
-342034.735693  7388559.856058 
-342061.898777  7388539.109612 
-342073.773349  7388526.611753 
-342080.790891  7388519.372993 
-342097.448277  7388526.531766 
-342109.124940  7388531.980833 
-342119.853286  7388540.289410 
-342125.831803  7388544.448697 
-342134.366652  7388548.308036 
-342147.535882  7388557.306495 
-342165.520911  7388564.485265 
-342189.830799  7388571.724025 
-342203.503049  7388572.423906 
-342216.911420  7388568.804526 
-342231.581465  7388561.435788 
-342245.921660  7388547.408191 
-342275.204025  7388510.514510 
-342300.717862  7388472.251064 
-342332.853423  7388426.528896 
-342354.136944  7388393.084625 
-342377.399561  7388355.461069 
-342398.641851  7388325.676171 
-342416.585649  7388308.929040 
-342448.762441  7388296.651143 
-342459.028998  7388290.452205 
-342470.573721  7388280.493911 
-342509.809287  7388256.887954 
-342544.245546  7388233.671931 
-342613.629330  7388188.009752 
-342652.271167  7388162.624101 
-342677.174784  7388143.957298 
-342706.283978  7388122.450982 
-342800.109590  7388062.331280 
-342837.498000  7388039.365214 
-342878.993033  7388014.559463 
-342908.737187  7387991.843354 
-342949.053008  7387962.928307 
-342968.472881  7387950.290471 
-343020.283949  7387915.526426 
-343068.829508  7387880.052502 
-343142.633273  7387830.670961 
-343178.446652  7387803.035695 
-343199.202415  7387789.637990 
-343211.909856  7387784.458877 
-343224.905916  7387781.499384 
-343237.390709  7387778.419911 
-343263.935326  7387757.883429 
-343295.320479  7387724.229194 
-343313.536403  7387710.131608 
-343334.300412  7387696.513941 
-343358.156757  7387688.575301 
-343377.584876  7387685.015911 
-343385.888831  7387681.896445 
-343391.949810  7387677.857137 
-343400.938201  7387667.548902 
-343411.534608  7387650.051900 
-343426.031481  7387630.605231 
-343439.843918  7387617.907406 
-343451.330917  7387612.268371 
-343463.403399  7387609.968765 
-343479.829890  7387610.358699 
-343509.862662  7387616.447656 
-343632.310941  7387646.112574 
-343655.128261  7387650.121888 
-343680.089601  7387653.601292 
-343700.103203  7387652.811427 
-343721.378478  7387648.062240 
-343747.848879  7387634.724525 
-343761.265496  7387630.435260 
-343781.938796  7387625.006190 
-343790.580846  7387618.127368 
-343799.247634  7387599.940483 
-343806.759950  7387584.633105 
-343812.227201  7387579.264025 
-343819.772502  7387580.003898 
-343825.454155  7387582.943395 
-343832.727331  7387589.892204 
-343843.298998  7387602.959966 
-343853.392385  7387613.808108 
-343871.327936  7387625.296140 
-343889.296473  7387634.354588 
-343916.055491  7387651.031732 
-343928.325883  7387658.470457 
-343940.423103  7387662.699733 
-343955.612660  7387664.409440 
-343977.753789  7387664.979343 
-343989.166572  7387666.319113 
-344002.789345  7387671.228272 
-344014.160897  7387676.327399 
-344024.806781  7387683.086241 
-344034.652780  7387687.955407 
-344040.952901  7387690.904902 
-344047.871488  7387692.524624 
-344062.442578  7387694.234331 
-344076.758034  7387692.174684 
-344105.380701  7387687.495486 
-344121.823685  7387685.675797 
-344151.040080  7387682.886275 
-344210.041860  7387681.306546 
-344234.747567  7387680.566673 
-344257.251531  7387685.575815 
-344280.044112  7387691.244844 
-344298.400221  7387692.654602 
-344315.552381  7387691.844741 
-344328.251576  7387687.885419 
-344340.035440  7387683.356195 
-344349.535098  7387682.126405 
-344356.577379  7387682.206392 
-344363.487720  7387684.825943 
-344372.591559  7387692.454636 
-344377.324895  7387698.593585 
-344383.921880  7387701.763042 
-344390.815728  7387705.932328 
-344400.636989  7387713.351057 
-344410.367541  7387719.769957 
-344418.589033  7387723.619298 
-344427.132128  7387726.478808 
-344438.256293  7387726.268844 
-344447.475579  7387722.929416 
-344452.860368  7387716.010601 
-344461.263277  7387703.252787 
-344470.243422  7387693.274496 
-344479.479200  7387688.605296 
-344491.963993  7387685.305861 
-344504.935314  7387684.116065 
-344531.867504  7387684.735958 
-344557.249401  7387687.555475 
-344581.617013  7387689.695109 
-344618.065353  7387687.865422 
-344628.884407  7387688.315345 
-344640.882673  7387692.214677 
-344663.510330  7387698.673571 
-344654.117873  7387748.874972 
-344643.826577  7387769.441449 
-344625.643638  7387801.086029 
-344607.435961  7387817.693184 
-344584.503194  7387839.849389 
-344582.919917  7387844.588577 
-344545.745910  7387891.260583 
-344527.546479  7387923.695027 
-344507.772018  7387941.102045 
-344482.621014  7387943.091704 
-344469.798125  7387959.298928 
-344455.342483  7387976.805930 
-344449.512398  7387993.163128 
-344443.632836  7388015.229348 
-344447.186961  7388048.063724 
-344452.373840  7388067.560384 
-344458.278141  7388091.256325 
-344464.957588  7388113.822460 
-344472.057593  7388130.669574 
-344479.190582  7388143.687344 
-344488.550054  7388164.373801 
-344512.521846  7388204.886861 
-344534.168202  7388220.074260 
-344561.751843  7388247.759518 
-344582.078802  7388276.164652 
-344586.548259  7388288.412554 
-344592.889610  7388305.999542 
-344609.002745  7388338.943899 
-344613.488695  7388350.041998 
-344621.330860  7388369.948588 
-344635.588593  7388396.004125 
-344655.511486  7388429.358411 
-344678.468992  7388462.742693 
-344742.723621  7388539.519542 
-344707.908035  7388601.258966 
-344673.249128  7388648.450883 
-344664.409169  7388659.439001 
-344647.784768  7388685.894469 
-344617.999383  7388724.997771 
-344611.699262  7388735.276010 
-344588.453138  7388761.841460 
-344573.989250  7388775.309153 
-344560.407708  7388785.597391 
-344548.112578  7388790.206601 
-344534.308388  7388794.015949 
-344514.509188  7388794.235911 
-344493.769918  7388786.457244 
-344471.562819  7388776.338977 
-344431.436661  7388767.270530 
-344403.572647  7388770.320008 
-344380.408985  7388786.367259 
-344317.910803  7388845.687098 
-344291.803237  7388866.263573 
-344247.487993  7388878.311510 
-344275.343761  7388937.651345 
-344297.361196  7388985.803097 
-344315.057607  7389024.316500 
-344326.618823  7389052.931599 
-344277.578489  7389086.155908 
-344232.479854  7389121.769808 
-344188.189349  7389145.835685 
-344160.490260  7389157.373709 
-344091.667219  7389207.995038 
-343954.177816  7389319.795887 
-343933.636455  7389312.687105 
-343899.678477  7389324.535076 
-343849.920722  7389339.542505 
-343759.088491  7389370.347229 
-343684.847676  7389396.412764 
-343647.723146  7389408.260734 
-343556.280694  7389407.100933 
-343424.959471  7389450.123564 
-343346.801697  7389492.776258 
-343297.827333  7389533.839224 
-343254.386190  7389578.071647 
-343272.931963  7389623.483868 
-343300.194002  7389686.283112 
-343359.500892  7389827.928849 
-343368.093465  7389852.134703 
-343425.091411  7389976.823345 
-343456.517796  7390055.299902 
-343478.238368  7390108.400807 
-343542.657921  7390260.874689 
-343554.285107  7390292.379293 
-343578.949582  7390359.227842 
-343591.219974  7390388.512826 
-343627.915700  7390476.117820 
-343666.491567  7390554.604376 
-343664.232100  7390573.751096 
-343659.482271  7390595.647346 
-Region 1
-938
-350975.719518  7389606.286814 
-350975.348438  7389612.595734 
-350973.633222  7389621.214257 
-350969.336935  7389632.132387 
-350963.267710  7389646.799875 
-350957.149007  7389656.038292 
-350951.178736  7389661.067431 
-350945.546560  7389662.677155 
-350933.779189  7389665.876607 
-350930.291033  7389667.616309 
-350926.992541  7389670.685783 
-350922.927149  7389679.274312 
-350918.111351  7389690.852329 
-350916.396135  7389699.260889 
-350915.051999  7389711.088863 
-350916.800200  7389719.747379 
-350919.834813  7389722.546900 
-350925.236094  7389723.376758 
-350929.004621  7389724.076638 
-350932.764903  7389725.116460 
-350934.579073  7389727.456059 
-350936.657123  7389734.014936 
-350936.995219  7389740.773778 
-350939.724721  7389753.091668 
-350939.155731  7389759.400587 
-350936.558169  7389764.029794 
-350931.429013  7389766.519368 
-350926.002993  7389767.909130 
-350917.517622  7389769.038936 
-350905.379171  7389768.908958 
-350898.229689  7389769.168914 
-350894.642578  7389770.468691 
-350891.550242  7389773.538166 
-350890.585433  7389777.957409 
-350889.101111  7389783.256501 
-350889.035141  7389789.785383 
-350891.335840  7389795.014487 
-350894.065342  7389807.112415 
-350894.222020  7389811.991579 
-350892.836654  7389817.840577 
-350888.062086  7389824.999351 
-350880.945589  7389832.448075 
-350871.899474  7389838.896970 
-350862.259630  7389843.226229 
-350855.192611  7389845.695806 
-350849.379018  7389845.635816 
-350841.833717  7389844.565999 
-350833.199914  7389841.046602 
-350826.908040  7389836.997296 
-350818.051588  7389835.247595 
-350812.633814  7389835.627530 
-350808.337528  7389836.807328 
-350805.039036  7389840.316727 
-350803.340313  7389846.275706 
-350802.350765  7389853.794418 
-350801.715805  7389865.422427 
-350800.190252  7389875.480704 
-350797.139147  7389883.759286 
-350792.991293  7389890.248174 
-350791.102906  7389895.657248 
-350789.923695  7389900.956340 
-350791.696635  7389907.285256 
-350797.287579  7389909.454884 
-350809.203383  7389911.894466 
-350825.217562  7389913.284228 
-350848.364732  7389914.843961 
-350855.695631  7389916.803625 
-350859.645575  7389919.613144 
-350861.253590  7389922.282687 
-350860.931987  7389923.832422 
-350859.991917  7389925.932062 
-350855.951264  7389931.311140 
-350851.217928  7389935.690390 
-350844.109677  7389941.939320 
-350836.811763  7389947.178423 
-350813.202804  7389960.446150 
-350797.617428  7389967.045020 
-350785.858304  7389969.464605 
-350778.395465  7389970.384448 
-350769.423566  7389969.524595 
-350760.369205  7389966.665085 
-350754.794753  7389962.945722 
-350746.185688  7389956.766780 
-350742.219251  7389954.847109 
-350736.158271  7389949.138087 
-350729.157222  7389944.858820 
-350716.062207  7389937.750038 
-350701.804475  7389934.830538 
-350691.537917  7389931.181163 
-350679.135587  7389925.962057 
-350672.332446  7389922.902581 
-350657.604678  7389915.773802 
-350646.241372  7389908.794997 
-350632.247519  7389900.566407 
-350625.436133  7389897.396950 
-350619.333922  7389895.787225 
-350613.330666  7389893.837559 
-350606.296631  7389892.767743 
-350599.674908  7389891.597943 
-350594.809632  7389888.778426 
-350589.936110  7389886.068890 
-350584.592552  7389879.809962 
-350577.096728  7389874.310904 
-350568.446433  7389871.891319 
-350563.762574  7389870.411572 
-350560.694976  7389871.371408 
-350558.839574  7389873.011127 
-350557.874765  7389877.100426 
-350557.833534  7389881.089743 
-350557.792303  7389885.738947 
-350557.239805  7389889.498303 
-350555.788469  7389891.367982 
-350553.025981  7389892.007873 
-350547.113434  7389891.937885 
-350542.215173  7389891.887893 
-350539.658841  7389892.087859 
-350536.780907  7389893.717580 
-350532.781485  7389896.227150 
-350527.635837  7389899.936515 
-350525.483571  7389901.136309 
-350524.559993  7389901.786198 
-350521.492395  7389901.976165 
-350519.158712  7389900.516415 
-350515.225260  7389895.827219 
-350510.805280  7389889.468308 
-350503.655798  7389879.649990 
-350496.893889  7389872.601197 
-350486.149051  7389865.182468 
-350477.325584  7389859.553432 
-350469.384464  7389857.373805 
-350458.590148  7389855.594110 
-350451.358204  7389853.644444 
-350448.109189  7389852.274679 
-350446.913485  7389849.715117 
-350443.887119  7389845.705804 
-350436.729390  7389836.987297 
-350430.651918  7389832.498066 
-350421.102783  7389828.858690 
-350406.127628  7389825.489267 
-350390.938072  7389824.339464 
-350377.241083  7389826.079166 
-350370.470927  7389829.118645 
-350365.185093  7389836.927308 
-350360.196124  7389846.175723 
-350357.441883  7389855.784078 
-350355.281370  7389867.832014 
-350354.596933  7389884.659132 
-350356.444089  7389913.354216 
-350359.247807  7389938.299943 
-350364.137822  7389959.396330 
-350367.988812  7389971.724218 
-350368.467093  7389975.493572 
-350367.502284  7389979.912815 
-350364.607857  7389983.212250 
-350358.027365  7389987.791466 
-350352.568360  7389993.270527 
-350347.043386  7390003.958697 
-350345.550818  7390010.037655 
-350344.017019  7390020.765818 
-350343.299597  7390031.164037 
-350341.807029  7390037.242995 
-350340.083567  7390045.861519 
-350338.541522  7390057.029606 
-350337.535482  7390065.218203 
-350332.975316  7390071.927054 
-350325.669156  7390077.946023 
-350306.241037  7390091.473706 
-350289.509435  7390100.822105 
-350279.853099  7390107.041040 
-350268.976320  7390112.580091 
-350260.268301  7390115.479594 
-350252.698261  7390117.499248 
-350244.534493  7390117.419262 
-350235.875951  7390115.669562 
-350225.815549  7390111.140337 
-350220.455499  7390106.651106 
-350216.332384  7390101.072062 
-350208.861299  7390092.363554 
-350202.198345  7390085.534723 
-350193.061521  7390081.015497 
-350182.052803  7390079.455765 
-350171.909939  7390082.895175 
-350162.657669  7390089.564033 
-350151.846860  7390098.752459 
-350142.380187  7390106.071206 
-350136.426409  7390110.000533 
-350125.368214  7390112.990021 
-350106.863672  7390116.449428 
-350099.483296  7390119.698871 
-350091.682361  7390123.608202 
-350084.928699  7390125.637854 
-350075.503257  7390129.197244 
-350065.170730  7390131.196902 
-350036.292430  7390130.457029 
-350008.634573  7390130.836963 
-349984.613303  7390133.686475 
-349952.411772  7390139.335508 
-349924.465296  7390147.244153 
-349910.702337  7390155.962660 
-349896.650760  7390162.351565 
-349877.321596  7390166.360879 
-349867.714737  7390167.710647 
-349861.571295  7390169.190394 
-349855.955612  7390169.690308 
-349854.339351  7390167.790634 
-349853.869316  7390163.581355 
-349851.816004  7390154.922838 
-349848.402065  7390149.783718 
-349841.392769  7390146.614261 
-349834.870000  7390145.884386 
-349825.147694  7390148.333966 
-349797.168234  7390159.672024 
-349785.598772  7390163.101437 
-349776.198069  7390164.221245 
-349766.805613  7390164.561187 
-349758.856246  7390163.481372 
-349753.042654  7390162.541533 
-349738.075745  7390158.842166 
-349719.760867  7390153.343108 
-349712.347505  7390150.493596 
-349709.106737  7390147.364133 
-349706.303018  7390142.674936 
-349703.309637  7390135.676135 
-349701.924270  7390131.666821 
-349695.863290  7390125.517875 
-349681.267462  7390115.619570 
-349670.497885  7390110.860385 
-349659.299504  7390107.640937 
-349648.496942  7390106.201183 
-349637.282068  7390105.091373 
-349624.854998  7390103.191699 
-349616.204702  7390100.442170 
-349597.188894  7390093.493360 
-349582.032323  7390088.684184 
-349571.732780  7390088.134278 
-349563.049500  7390088.714179 
-349556.691656  7390091.193754 
-349553.607566  7390093.483362 
-349550.713139  7390097.442684 
-349549.731837  7390103.301680 
-349550.375043  7390110.510445 
-349555.693862  7390119.418919 
-349560.542646  7390123.898152 
-349565.407922  7390126.827650 
-349568.962047  7390128.857303 
-349571.089574  7390130.766975 
-349571.056590  7390133.316539 
-349568.896077  7390135.726126 
-349562.529987  7390139.095549 
-349551.125450  7390146.174336 
-349534.665974  7390158.852165 
-349529.437864  7390161.121776 
-349525.240532  7390162.521536 
-349522.585246  7390162.491541 
-349518.923919  7390161.571699 
-349515.386286  7390158.212274 
-349510.553995  7390151.623403 
-349504.996036  7390146.474285 
-349500.749227  7390142.444975 
-349495.859212  7390141.505136 
-349490.639348  7390142.564955 
-349486.227615  7390145.284489 
-349483.316695  7390149.903698 
-349482.360133  7390153.443091 
-349482.327148  7390157.202447 
-349485.543178  7390161.891644 
-349495.380931  7390168.300546 
-349502.579890  7390172.809774 
-349506.735991  7390175.179368 
-349509.968513  7390178.868736 
-349510.636458  7390182.858053 
-349510.372578  7390188.947010 
-349508.459453  7390196.345742 
-349506.735991  7390204.964266 
-349506.628790  7390215.712425 
-349507.873970  7390223.031171 
-349511.757945  7390232.819495 
-349515.963523  7390240.278217 
-349518.445638  7390247.396998 
-349519.789774  7390255.495611 
-349518.297206  7390262.004496 
-349514.940990  7390270.393059 
-349509.457247  7390277.751798 
-349499.578262  7390285.400488 
-349486.112168  7390294.568918 
-349474.913786  7390302.207609 
-349460.878702  7390307.376724 
-349452.591240  7390308.956453 
-349447.181713  7390308.896464 
-349441.384613  7390307.176758 
-349435.092739  7390303.567376 
-349428.339076  7390295.638734 
-349423.729433  7390287.390147 
-349421.684368  7390277.851781 
-349422.451267  7390272.432709 
-349425.164277  7390266.253768 
-349431.233503  7390262.104479 
-349443.949190  7390256.365462 
-349449.185547  7390253.106020 
-349450.851285  7390250.346493 
-349452.112959  7390246.377173 
-349452.558255  7390242.727798 
-349451.477999  7390238.508520 
-349448.666034  7390234.269246 
-349438.894251  7390231.839663 
-349426.863000  7390230.499892 
-349414.741041  7390228.270274 
-349406.082499  7390226.410593 
-349398.339289  7390225.330778 
-349390.348691  7390227.800355 
-349383.463089  7390232.599532 
-349378.886431  7390241.188061 
-349373.460411  7390252.656097 
-349369.799084  7390260.924681 
-349365.073994  7390263.974158 
-349359.862376  7390265.023978 
-349353.512779  7390266.623704 
-349350.535890  7390268.693350 
-349344.326478  7390276.831956 
-349335.915323  7390290.699580 
-349328.370022  7390299.918001 
-349322.424489  7390302.187613 
-349317.320073  7390302.907489 
-349310.690103  7390302.067633 
-349302.336671  7390300.427914 
-349294.799617  7390299.348099 
-349285.613316  7390298.818190 
-349273.458372  7390300.347928 
-349256.776247  7390304.607198 
-349234.165083  7390310.136251 
-349221.457641  7390314.765458 
-349212.230109  7390318.544811 
-349205.855773  7390323.134025 
-349200.380276  7390329.382954 
-349197.551819  7390336.661708 
-349195.432537  7390354.358676 
-349197.230216  7390367.896357 
-349197.848683  7390377.204763 
-349196.760181  7390383.503684 
-349196.009774  7390387.263040 
-349193.939970  7390390.012569 
-349190.657970  7390391.852254 
-349182.890021  7390392.442153 
-349170.454705  7390390.872422 
-349162.703248  7390390.572473 
-349154.729143  7390391.932240 
-349142.953526  7390395.571617 
-349132.629245  7390397.241331 
-349125.570471  7390398.161173 
-349120.367100  7390398.551106 
-349117.109839  7390397.081358 
-349113.671161  7390394.271839 
-349106.694849  7390387.662972 
-349104.072548  7390385.093412 
-349101.532709  7390383.963605 
-349097.055006  7390382.473860 
-349094.003900  7390381.444037 
-349091.257906  7390380.314230 
-349088.709820  7390380.284235 
-349085.122710  7390381.683996 
-349081.098549  7390386.073244 
-349065.925485  7390402.420444 
-349054.595164  7390412.378738 
-349048.212582  7390417.407876 
-349040.634296  7390419.877453 
-349033.789924  7390420.247390 
-349029.609085  7390420.207397 
-349022.072030  7390418.357714 
-349014.460760  7390414.508373 
-349006.931951  7390411.668860 
-348995.436705  7390408.219450 
-348964.744235  7390405.359940 
-348949.727849  7390406.639721 
-348928.765931  7390410.079132 
-348912.792982  7390415.118269 
-348902.452209  7390418.667661 
-348896.094365  7390421.707140 
-348889.505627  7390427.176203 
-348875.470542  7390441.533744 
-348858.639985  7390460.410511 
-348852.216172  7390467.849236 
-348840.358092  7390481.266938 
-348834.123942  7390491.945109 
-348828.598967  7390503.513127 
-348788.629487  7390555.384242 
-348756.188816  7390604.435840 
-348721.703079  7390653.607418 
-348708.443140  7390667.345065 
-348686.433951  7390682.262509 
-348670.098168  7390690.301132 
-348657.308264  7390703.318903 
-348625.263412  7390704.878635 
-348441.347730  7390696.989987 
-348368.566498  7390704.898632 
-348320.309556  7390714.397005 
-348260.186289  7390741.292398 
-348238.036913  7390750.780773 
-348203.163604  7390771.377245 
-348142.891904  7390829.807236 
-348044.835975  7390954.235923 
-347898.283964  7391254.294525 
-347907.783622  7391271.701544 
-347814.601216  7391351.257916 
-347799.609568  7391371.704414 
-347750.651697  7391439.652775 
-347719.654116  7391482.305469 
-347707.631112  7391496.952960 
-347672.823772  7391530.177269 
-347628.533267  7391566.571035 
-347574.726612  7391601.375074 
-347541.510795  7391615.612635 
-347508.286732  7391628.270467 
-347405.480974  7391649.626809 
-347341.407762  7391649.626809 
-347272.576475  7391648.047079 
-347247.268793  7391647.257214 
-347192.678746  7391650.416673 
-347142.063383  7391658.325319 
-347096.173109  7391670.193286 
-347066.107352  7391680.481523 
-347015.195124  7391701.957845 
-346952.960821  7391734.272310 
-346889.671001  7391780.154450 
-346704.996666  7391885.286442 
-346755.216211  7391653.586130 
-346767.865928  7391591.876701 
-346778.157224  7391546.784425 
-346777.373832  7391532.546863 
-346771.040727  7391491.413909 
-346765.499260  7391457.399735 
-346748.330608  7391451.690713 
-346736.406558  7391460.999119 
-346723.748594  7391468.767788 
-346633.765726  7391359.706469 
-346622.872455  7391338.000187 
-346607.130401  7391291.318184 
-346582.919467  7391235.027826 
-346558.287977  7391169.429062 
-346510.097005  7391121.967192 
-346491.658433  7391089.102821 
-346482.843212  7391052.159149 
-346468.445294  7391023.883993 
-346459.819736  7390994.369048 
-346452.084772  7390967.893583 
-346450.146908  7390948.156964 
-346450.410787  7390923.691155 
-346454.789536  7390877.289103 
-346455.399757  7390866.151011 
-346463.951098  7390829.247332 
-346464.388148  7390797.692737 
-346460.718575  7390777.606178 
-346455.902777  7390760.389127 
-346443.986974  7390747.751292 
-346429.028311  7390734.083633 
-346424.113558  7390715.986733 
-346416.205422  7390691.090997 
-346406.730503  7390670.394542 
-346401.106574  7390661.696032 
-346390.246288  7390646.078707 
-346378.363470  7390628.701684 
-346369.036983  7390615.064020 
-346366.892963  7390595.557361 
-346366.587853  7390586.028993 
-346362.266828  7390569.481828 
-346352.709446  7390556.424064 
-346343.721055  7390547.135655 
-346330.279699  7390534.477823 
-346322.833353  7390524.209582 
-346320.293514  7390513.551408 
-346313.490374  7390500.523640 
-346306.052273  7390489.705493 
-346301.607555  7390485.336241 
-346300.156219  7390477.457591 
-346295.348666  7390468.769079 
-346287.539486  7390464.369832 
-346282.088727  7390458.440848 
-346280.752838  7390449.572367 
-346283.251446  7390435.194830 
-346278.460386  7390424.736621 
-346271.583029  7390408.939327 
-346263.221351  7390398.441125 
-346258.694171  7390382.663828 
-346251.132377  7390365.706732 
-346259.733196  7390332.622399 
-346258.619955  7390312.675816 
-346260.425879  7390295.528753 
-346260.211477  7390267.953477 
-346257.721116  7390242.447846 
-346257.539699  7390211.333175 
-346257.366528  7390178.988716 
-346260.549573  7390148.014021 
-346266.519844  7390104.881409 
-346272.160266  7390073.496785 
-346274.139361  7390050.030805 
-346272.152019  7390025.764961 
-346266.412643  7390008.197970 
-346261.753522  7389985.341885 
-346290.829732  7389970.594412 
-346353.327914  7389942.909154 
-346446.666998  7389901.756203 
-346482.265976  7389883.559320 
-346533.689470  7389855.884060 
-346555.838846  7389846.395686 
-346596.971044  7389825.029346 
-346613.529476  7389818.170520 
-346642.853072  7389803.673004 
-346682.088637  7389785.596100 
-346689.526737  7389776.777611 
-346727.500629  7389688.172788 
-346744.900176  7389680.264143 
-346789.207173  7389664.446852 
-346824.006267  7389647.039834 
-346862.763551  7389631.212545 
-346901.537327  7389614.605389 
-346914.986929  7389609.066338 
-346937.136305  7389666.816446 
-346942.661279  7389666.016583 
-346945.036194  7389651.779022 
-346998.826356  7389631.212545 
-347092.247903  7389602.337491 
-347103.372068  7389624.803642 
-347111.766731  7389630.872603 
-347120.920047  7389635.421824 
-347132.506001  7389637.541461 
-347155.463507  7389628.053086 
-347179.979551  7389628.842951 
-347198.962374  7389644.390287 
-347263.843717  7389716.647910 
-347274.910158  7389735.634658 
-347278.076711  7389752.251812 
-347277.293319  7389756.211134 
-347325.542015  7389768.079101 
-347351.806259  7389759.660543 
-347365.882575  7389756.201135 
-347384.873644  7389768.069102 
-347414.931155  7389775.977748 
-347456.863238  7389777.567475 
-347455.032574  7389732.195247 
-347452.072178  7389660.187581 
-347444.642324  7389611.815867 
-347434.227335  7389576.031997 
-347427.663335  7389551.276237 
-347422.270300  7389537.198648 
-347408.606296  7389490.406663 
-347349.266420  7389358.289294 
-347304.398679  7389191.807811 
-347311.721332  7389112.731356 
-347320.503568  7389014.618162 
-347283.568701  7388977.594503 
-347309.140262  7388908.016422 
-347324.527728  7388857.994990 
-347337.993823  7388809.903227 
-347336.072451  7388756.032455 
-347328.378718  7388709.860364 
-347314.912623  7388659.848930 
-347282.208073  7388498.246611 
-347270.663350  7388452.074520 
-347243.731160  7388357.810667 
-347211.026610  7388311.638576 
-347161.013221  7388255.848132 
-347116.763947  7388211.605710 
-347070.593302  7388194.288677 
-347005.175954  7388171.202631 
-346951.484746  7388056.922206 
-347316.833995  7388213.535380 
-347382.243097  7388246.239778 
-347477.115980  7388277.604405 
-347543.613584  7388296.081241 
-347815.467070  7388387.875517 
-347900.848542  7388413.761083 
-348155.195280  7388475.740467 
-348188.287404  7388482.649283 
-348226.178833  7388490.307971 
-348332.382038  7388519.662943 
-348377.777538  7388513.813945 
-348449.536237  7388462.552725 
-348518.004690  7388356.880826 
-348540.327236  7388321.976805 
-348566.542003  7388145.996949 
-348543.642221  7388151.625984 
-348523.826529  7388153.885597 
-348486.248456  7388152.355859 
-348451.103020  7388143.267416 
-348414.456772  7388120.881251 
-348437.397785  7388051.263176 
-348474.967612  7387896.399702 
-348505.833253  7387775.370434 
-348543.180432  7387642.613174 
-348546.173814  7387621.106858 
-348569.057104  7387545.669779 
-348579.216460  7387531.412221 
-348599.180584  7387515.814893 
-348644.246235  7387422.550868 
-348664.367037  7387377.438596 
-348666.403856  7387355.312386 
-348664.647409  7387325.667464 
-348657.588636  7387298.502117 
-348654.554023  7387279.775325 
-348655.287938  7387242.481713 
-348665.612218  7387218.465826 
-348677.346605  7387184.311677 
-348680.290509  7387132.590536 
-348680.331740  7387092.227450 
-348681.082147  7387054.943836 
-348683.440569  7387031.767806 
-348686.590629  7387007.461969 
-348691.802247  7386993.864299 
-348696.881925  7386968.078715 
-348700.708176  7386947.602223 
-348698.852774  7386921.416708 
-348686.186564  7386870.785381 
-348679.869951  7386843.889988 
-348670.378540  7386813.835136 
-348667.211987  7386750.545977 
-348643.759707  7386622.447919 
-348680.405956  7386633.626004 
-348694.226639  7386639.195050 
-348706.934080  7386643.754269 
-348719.245702  7386647.093697 
-348734.624923  7386649.693252 
-348746.441771  7386651.812889 
-348759.602755  7386651.722904 
-348780.243071  7386649.063360 
-348795.894416  7386645.234016 
-348817.812897  7386637.485343 
-348834.742409  7386628.806830 
-348850.212338  7386622.317941 
-348871.924663  7386614.789231 
-348896.671601  7386599.991765 
-348914.491705  7386611.989710 
-348971.572114  7386645.513968 
-349021.832890  7386677.758445 
-349059.575887  7386725.230313 
-349111.791020  7386763.203809 
-349136.298817  7386800.777373 
-349194.847055  7386884.263072 
-349213.821632  7386947.922168 
-349217.854039  7387020.969656 
-349218.068441  7387048.005025 
-349220.946375  7387085.198654 
-349221.441149  7387107.854773 
-349232.812701  7387162.725374 
-349242.312359  7387180.922257 
-349263.999945  7387221.015390 
-349309.626339  7387295.052708 
-349335.049468  7387335.155838 
-349366.484100  7387397.475164 
-349377.031029  7387420.541213 
-349385.392707  7387439.357989 
-349397.011646  7387466.633317 
-349403.493183  7387484.660230 
-349408.078087  7387501.877280 
-349411.937323  7387517.954527 
-349421.626644  7387565.356407 
-349448.699019  7387674.407728 
-349449.878230  7387691.574787 
-349462.330038  7387752.734311 
-349483.572329  7387830.740949 
-349504.938312  7387834.700271 
-349548.453671  7387849.727697 
-349568.219886  7387860.805799 
-349585.627679  7387862.385529 
-349667.100438  7387820.462710 
-349754.122910  7387774.580569 
-349832.437362  7387731.857887 
-349898.893735  7387697.053849 
-349967.708530  7387664.619404 
-349982.403313  7387680.346710 
-350001.361397  7387662.849707 
-350067.859001  7387673.237928 
-350088.218945  7387668.018822 
-350100.316165  7387663.159654 
-350110.747647  7387660.830053 
-350116.932320  7387654.911067 
-350126.992721  7387648.592150 
-350134.711193  7387642.363217 
-350146.552780  7387631.964998 
-350152.490066  7387630.365272 
-350166.145824  7387632.054982 
-350176.733984  7387634.594547 
-350190.381496  7387637.284087 
-350202.783827  7387641.843306 
-350225.329022  7387642.733153 
-350236.032629  7387643.183076 
-350247.461905  7387643.403038 
-350256.351341  7387642.063268 
-350270.378180  7387637.774003 
-350284.231847  7387630.495249 
-350294.795269  7387625.396123 
-350305.259735  7387619.967053 
-350318.882508  7387614.907919 
-350327.598774  7387610.338702 
-350348.272074  7387604.569690 
-350371.427490  7387585.872893 
-350383.574188  7387575.694636 
-350400.025418  7387563.576712 
-350414.398598  7387555.088166 
-350435.401747  7387546.329666 
-350446.196063  7387538.690975 
-350463.397700  7387532.991951 
-350476.641147  7387515.524943 
-350487.963221  7387496.038281 
-350493.150101  7387478.151345 
-350498.369965  7387466.683309 
-350504.158818  7387459.214588 
-350516.173576  7387451.585895 
-350535.807852  7387447.356619 
-350568.924714  7387430.419521 
-350595.823918  7387429.319709 
-350657.522216  7387426.150252 
-350707.279972  7387415.062151 
-350746.441321  7387408.923203 
-350782.963877  7387406.593602 
-350818.109312  7387407.963367 
-350833.142190  7387412.702555 
-350851.333375  7387422.990793 
-350932.022742  7387482.320630 
-350961.288614  7387506.846429 
-350985.021266  7387521.873855 
-351010.337194  7387533.741822 
-351036.436514  7387543.240195 
-351132.167006  7387583.533294 
-351149.566552  7387596.191125 
-351197.823494  7387642.073266 
-351216.022925  7387657.110690 
-351246.872074  7387672.927981 
-351264.288113  7387679.046933 
-351325.186527  7387698.243645 
-351417.478340  7387723.089389 
-351447.560589  7387733.707570 
-351443.849786  7387752.824296 
-351445.416569  7387778.929824 
-351445.416569  7387803.455623 
-351452.549559  7387826.391694 
-351462.040970  7387850.917493 
-351484.190346  7387884.931667 
-351596.165912  7388052.063039 
-351618.323534  7388087.656942 
-351643.631215  7388155.685289 
-351650.261185  7388157.305012 
-351639.475115  7388163.733910 
-351622.529111  7388174.302100 
-351611.462670  7388179.171266 
-351606.795303  7388186.879946 
-351611.710057  7388194.788591 
-351613.062438  7388202.107337 
-351598.697505  7388210.495901 
-351592.026304  7388213.855325 
-351585.693199  7388214.235260 
-351581.108295  7388213.415400 
-351576.119325  7388212.585543 
-351570.478903  7388215.525039 
-351565.729075  7388220.674157 
-351557.507583  7388226.133222 
-351552.559844  7388231.622282 
-351550.242653  7388238.131167 
-351549.516985  7388249.749177 
-351553.912226  7388259.207557 
-351558.373437  7388261.467170 
-351568.227682  7388265.776431 
-351564.137552  7388276.584580 
-351558.431160  7388286.492883 
-351552.262980  7388290.972116 
-351544.783649  7388293.111749 
-351535.325222  7388300.220532 
-351531.367031  7388308.259155 
-351525.372022  7388315.727875 
-351517.018590  7388323.946467 
-351514.932294  7388328.465693 
-351514.091178  7388331.225221 
-351515.369344  7388336.004402 
-351517.587580  7388338.573962 
-351521.001519  7388343.703083 
-351520.976781  7388346.252647 
-351517.554595  7388351.971667 
-351516.218706  7388352.961497 
-351516.177475  7388356.720854 
-351517.653550  7388362.609845 
-351522.114761  7388365.419364 
-351523.796992  7388370.308526 
-351522.065283  7388380.146841 
-351520.300590  7388382.566426 
-351515.361098  7388387.275620 
-351508.689897  7388390.974986 
-351501.845526  7388391.574883 
-351495.702084  7388393.724515 
-351488.511371  7388398.193750 
-351483.868743  7388403.122905 
-351482.656547  7388411.421484 
-351486.375597  7388417.550434 
-351487.909396  7388426.758857 
-351494.193024  7388431.588029 
-351500.682807  7388435.747317 
-351503.189661  7388439.646649 
-351504.830661  7388449.304995 
-351498.967591  7388473.380871 
-351497.013235  7388484.988882 
-351492.716948  7388496.016993 
-351489.962707  7388505.845310 
-351482.367929  7388520.062875 
-351470.402648  7388532.560734 
-351465.034352  7388534.570390 
-351438.910293  7388549.077905 
-351438.555705  7388553.387166 
-351437.656866  7388561.685745 
-351437.483696  7388568.324608 
-351442.076846  7388578.782816 
-351446.950368  7388581.052428 
-351448.310996  7388587.491325 
-351447.610067  7388596.229828 
-351441.466625  7388598.709403 
-351437.458957  7388610.967303 
-351435.776726  7388616.266396 
-351433.162671  7388622.545320 
-351431.562902  7388629.064204 
-351427.250123  7388641.312106 
-351420.752094  7388648.340902 
-351413.058360  7388652.470194 
-351410.831878  7388650.670503 
-351406.568577  7388648.300909 
-351406.824210  7388643.541724 
-351407.690064  7388638.012671 
-351407.351969  7388631.363810 
-351402.577401  7388629.544121 
-351399.196447  7388630.513955 
-351380.197131  7388632.423628 
-351361.461695  7388638.102655 
-351354.774002  7388643.791681 
-351349.578877  7388653.040097 
-351345.101174  7388661.628626 
-351342.017083  7388673.896524 
-351336.121028  7388691.443519 
-351331.626833  7388702.031705 
-351328.839607  7388715.069472 
-351320.939718  7388729.387019 
-351315.299296  7388742.174829 
-351304.810091  7388759.341888 
-351295.854684  7388767.330520 
-351284.400670  7388779.508434 
-351275.610188  7388790.716514 
-351269.483239  7388801.724628 
-351269.903796  7388810.263166 
-351272.262218  7388818.921683 
-351277.028540  7388831.929455 
-351281.918554  7388842.607626 
-351282.751424  7388851.696069 
-351283.196720  7388868.093260 
-351284.326454  7388877.181703 
-351288.523785  7388896.058470 
-351292.729363  7388903.957117 
-351295.054800  7388916.055045 
-351297.792548  7388927.273123 
-351301.660031  7388938.941124 
-351303.911251  7388968.306095 
-351306.772694  7388977.974438 
-351306.739709  7388990.822238 
-351305.824377  7389000.660552 
-351301.338428  7389010.478871 
-351294.502302  7389020.147215 
-351289.117514  7389028.175839 
-351275.799851  7389042.553377 
-351271.478826  7389046.492702 
-351254.351405  7389064.149677 
-351243.928170  7389076.117627 
-351237.900175  7389086.355874 
-351231.699010  7389093.824594 
-351228.961261  7389102.103176 
-351225.283442  7389112.581381 
-351222.710618  7389124.739299 
-351214.447895  7389134.397645 
-351205.904800  7389141.846369 
-351195.968092  7389155.254072 
-351194.747650  7389164.652462 
-351177.282134  7389206.225341 
-351169.761571  7389223.312414 
-351159.767140  7389243.039035 
-351156.270738  7389255.626879 
-351145.929965  7389278.442971 
-351139.547382  7389294.210270 
-351133.824498  7389315.086694 
-351132.826704  7389322.605406 
-351134.632629  7389335.803146 
-351134.212071  7389357.059505 
-351129.363287  7389361.998659 
-351123.384770  7389367.697682 
-351115.839469  7389377.146064 
-351110.372218  7389382.845088 
-351102.637254  7389391.073678 
-351097.879179  7389397.002663 
-351092.684053  7389405.811154 
-351088.387767  7389416.619303 
-351083.035964  7389421.328496 
-351073.338396  7389421.118532 
-351064.630377  7389425.017864 
-351061.010282  7389429.517093 
-351055.031764  7389435.216117 
-351051.411669  7389440.165269 
-351051.048835  7389445.254398 
-351045.226996  7389446.304218 
-351040.320489  7389446.474189 
-351038.094007  7389445.234401 
-351034.366710  7389439.875319 
-351032.173213  7389435.206119 
-351026.681223  7389433.376432 
-351024.133138  7389432.796532 
-351017.000149  7389431.726715 
-351014.089229  7389427.377460 
-351009.298169  7389426.777563 
-351004.721511  7389425.177837 
-351002.692938  7389423.388143 
-351000.977722  7389421.488468 
-350998.775979  7389417.699118 
-350994.694095  7389417.659124 
-350991.931607  7389418.069054 
-350990.034974  7389423.808071 
-350989.878296  7389428.907198 
-350988.806286  7389433.986328 
-350980.782704  7389440.665184 
-350966.879559  7389452.483159 
-350955.606961  7389457.352325 
-350943.485002  7389465.200981 
-350929.656074  7389470.260114 
-350912.330743  7389477.278912 
-350898.716216  7389481.348215 
-350890.338046  7389482.927944 
-350881.630026  7389486.047410 
-350877.836760  7389487.227208 
-350872.559173  7389494.705927 
-350868.600982  7389502.754548 
-350864.040816  7389522.891099 
-350855.852309  7389577.441755 
-350885.678926  7389595.798611 
-350887.971378  7389614.145468 
-350878.793323  7389639.391144 
-350899.450131  7389639.391144 
-350959.103363  7389602.677432 
-350968.165971  7389604.647095 
-350975.719518  7389606.286814 
-Region 1
-624
-353400.210283  7401391.408130 
-353398.668238  7401399.726705 
-353396.821082  7401405.275756 
-353394.355459  7401408.355227 
-353391.889836  7401410.824804 
-353386.035012  7401411.434699 
-353372.478209  7401411.434699 
-353353.990160  7401410.204910 
-353344.127668  7401412.364540 
-353339.814890  7401416.063906 
-353336.120578  7401423.142694 
-353334.578533  7401429.921533 
-353333.654955  7401441.019632 
-353333.341599  7401450.258049 
-353335.502111  7401459.506465 
-353343.204090  7401486.931767 
-353350.906070  7401509.727863 
-353359.226517  7401530.064379 
-353372.783320  7401552.560526 
-353381.103767  7401567.957888 
-353388.500635  7401581.825513 
-353395.279037  7401596.922927 
-353408.835840  7401619.419073 
-353423.316221  7401646.834377 
-353433.277668  7401664.651326 
-353443.651426  7401681.038519 
-353447.964205  7401690.586883 
-353456.903119  7401729.410233 
-353459.368742  7401752.216326 
-353460.292319  7401775.322369 
-353459.781053  7401781.101379 
-353457.826696  7401796.888674 
-353450.124717  7401854.198858 
-353437.796602  7401932.765400 
-353434.712512  7401953.721810 
-353427.818663  7401980.027304 
-353420.850598  7402007.642574 
-353411.301463  7402029.828774 
-353404.044780  7402037.947383 
-353404.646755  7402038.407305 
-353372.593656  7402079.750223 
-353339.179930  7402122.042978 
-353300.966897  7402157.266945 
-353263.817628  7402182.392641 
-353236.596821  7402205.138745 
-353224.887173  7402214.697108 
-353213.795993  7402221.785893 
-353199.315612  7402229.484575 
-353167.757287  7402239.842800 
-353154.002575  7402244.761958 
-353134.343561  7402256.060023 
-353108.796738  7402265.888339 
-353075.877785  7402277.676320 
-353027.719798  7402292.913710 
-352992.838243  7402303.231942 
-352946.824276  7402314.340040 
-352926.489071  7402307.561201 
-352904.925178  7402302.622047 
-352880.887415  7402299.542574 
-352856.857899  7402301.392258 
-352830.972981  7402305.091624 
-352808.790621  7402313.100252 
-352790.921039  7402322.958563 
-352773.051457  7402335.286452 
-352753.944941  7402348.224236 
-352737.922515  7402359.322335 
-352720.052933  7402366.711069 
-352700.336195  7402374.729696 
-352681.229679  7402377.809168 
-352627.002466  7402375.959485 
-352559.218450  7402374.109802 
-352532.715065  7402369.800540 
-352509.914237  7402361.781913 
-352496.975901  7402353.773285 
-352488.968812  7402341.445397 
-352485.266254  7402327.887719 
-352484.656033  7402311.870463 
-352487.121656  7402300.162468 
-352492.044656  7402287.834580 
-352510.532705  7402266.268274 
-352517.311106  7402260.719224 
-352525.936664  7402258.259646 
-352545.661647  7402257.639752 
-352571.538319  7402253.940386 
-352594.957614  7402249.011230 
-352620.842532  7402240.382708 
-352643.643360  7402228.064818 
-352666.444188  7402214.507140 
-352688.008081  7402204.028935 
-352710.808908  7402192.320940 
-352765.654588  7402174.454001 
-352818.653113  7402160.276429 
-352850.079498  7402151.038012 
-352872.261858  7402142.409490 
-352882.734571  7402133.161074 
-352891.978596  7402118.993501 
-352899.375465  7402102.966246 
-352904.306711  7402074.001208 
-352903.069776  7402051.205112 
-352896.291374  7402032.718279 
-352880.268948  7402005.602924 
-352872.880326  7401985.886301 
-352863.636301  7401959.390839 
-352856.857899  7401934.735063 
-352855.010744  7401910.709178 
-352855.010744  7401888.522978 
-352854.392276  7401871.885828 
-352851.926653  7401862.637412 
-352840.835473  7401850.929418 
-352822.965891  7401836.751846 
-352814.332088  7401831.822691 
-352802.012219  7401828.743218 
-352788.455416  7401827.513429 
-352779.211392  7401829.983006 
-352767.501744  7401836.751846 
-352754.563408  7401855.858573 
-352742.853761  7401876.195090 
-352732.991269  7401895.301817 
-352729.296957  7401912.548863 
-352720.052933  7401932.885379 
-352705.877662  7401962.470312 
-352684.313769  7401986.496196 
-352668.901564  7402006.222817 
-352656.581696  7402013.001656 
-352643.024892  7402016.691024 
-352631.315245  7402016.691024 
-352620.224065  7402010.532079 
-352605.430327  7401996.364506 
-352594.339147  7401982.806828 
-352587.560745  7401968.629257 
-352587.560745  7401940.284112 
-352591.263303  7401918.717806 
-352603.583171  7401884.203718 
-352630.086557  7401847.230051 
-352654.734540  7401824.433956 
-352671.367187  7401799.778180 
-352677.535368  7401778.211874 
-352676.298433  7401757.265462 
-352674.451277  7401741.238207 
-352671.367187  7401730.150106 
-352662.741630  7401720.901690 
-352627.002466  7401696.255912 
-352580.172122  7401669.140557 
-352538.883246  7401653.733196 
-352517.929574  7401649.423934 
-352497.594369  7401649.423934 
-352479.106320  7401654.353090 
-352458.193879  7401661.551856 
-352441.520000  7401667.290873 
-352419.947861  7401678.388972 
-352395.918345  7401694.406229 
-352379.895919  7401706.734117 
-352363.255025  7401718.442112 
-352341.072665  7401726.450740 
-352329.981485  7401727.680529 
-352306.562190  7401724.601057 
-352281.295739  7401719.671901 
-352251.716510  7401714.742745 
-352225.221371  7401712.283167 
-352183.314026  7401712.283167 
-352158.666043  7401717.822218 
-352134.018060  7401728.300423 
-352113.064387  7401741.238207 
-352085.950781  7401764.044300 
-352064.386888  7401785.610606 
-352053.287462  7401798.548390 
-352032.952257  7401810.876279 
-352020.632388  7401816.425328 
-351991.053159  7401820.114696 
-351968.870798  7401820.734590 
-351931.276233  7401812.106068 
-351897.384225  7401799.168284 
-351872.736242  7401781.291346 
-351857.332283  7401767.123773 
-351844.385701  7401749.866729 
-351832.684299  7401730.150106 
-351819.737717  7401711.663273 
-351800.639447  7401688.247284 
-351783.380086  7401665.441190 
-351767.976127  7401654.972983 
-351750.106546  7401651.883513 
-351731.618496  7401658.662351 
-351716.833005  7401670.990240 
-351699.507674  7401699.715319 
-351698.344956  7401699.955278 
-351670.612882  7401733.229579 
-351620.079981  7401778.831767 
-351585.569505  7401808.406702 
-351558.455899  7401830.592901 
-351542.433473  7401847.230051 
-351526.411047  7401855.858573 
-351511.625555  7401862.017518 
-351498.687219  7401862.017518 
-351486.359105  7401857.088363 
-351470.336678  7401846.000262 
-351451.848629  7401830.592901 
-351433.979047  7401811.496172 
-351405.636753  7401780.061557 
-351386.530236  7401760.344934 
-351387.049749  7401744.757604 
-351385.911769  7401716.282482 
-351385.293302  7401697.175754 
-351374.202122  7401673.139872 
-351362.385273  7401649.943845 
-351344.012671  7401630.937100 
-351339.081425  7401611.220478 
-351329.837401  7401590.883961 
-351324.906155  7401565.618289 
-351324.287687  7401539.112829 
-351327.371778  7401512.007472 
-351336.615802  7401478.113278 
-351344.012671  7401451.617816 
-351348.943917  7401434.360772 
-351350.172605  7401417.723622 
-351351.401294  7401406.015627 
-351348.325450  7401399.846684 
-351343.394204  7401394.917528 
-351329.218933  7401388.138690 
-351365.485856  7401396.067332 
-351385.631397  7401401.226448 
-351414.864285  7401410.804807 
-351445.325861  7401416.463838 
-351470.633543  7401420.633124 
-351493.731235  7401422.352829 
-351518.296756  7401422.112870 
-351536.232307  7401419.163375 
-351552.691784  7401413.024427 
-351571.113863  7401403.196110 
-351581.677285  7401394.837542 
-351587.573340  7401386.488972 
-351602.070213  7401359.213644 
-351610.176258  7401334.157936 
-351616.072313  7401306.892606 
-351621.481840  7401281.097025 
-351623.197056  7401265.619676 
-351622.463141  7401257.751024 
-351620.005765  7401250.872202 
-351614.357097  7401242.763591 
-351598.384148  7401223.356915 
-351557.359150  7401180.364280 
-351519.278057  7401141.550928 
-351475.053522  7401096.348671 
-351464.490101  7401086.760313 
-351448.525398  7401074.722375 
-351443.363258  7401070.553089 
-351438.943278  7401062.934394 
-351418.797737  7401018.961926 
-351414.130370  7401008.143779 
-351398.907829  7400963.931353 
-351393.737442  7400948.204046 
-351362.533705  7400842.812099 
-351334.529506  7400747.728386 
-351306.277920  7400650.934966 
-351282.198926  7400573.058306 
-351271.536550  7400560.490458 
-351292.646900  7400556.381162 
-351313.476879  7400556.161200 
-351323.438326  7400554.021566 
-351396.367989  7400578.147434 
-351475.540050  7400620.890112 
-351523.566097  7400659.093568 
-351534.319182  7400666.642275 
-351575.500858  7400698.876754 
-351616.847458  7400744.408955 
-351648.562461  7400773.334000 
-351678.768404  7400733.370845 
-351691.261444  7400711.214641 
-351705.601639  7400691.398035 
-351719.216166  7400658.703635 
-351738.256712  7400580.147091 
-351759.952545  7400544.823142 
-351776.659408  7400522.017048 
-351953.376131  7400587.255874 
-351995.423661  7400588.655634 
-352089.851248  7400575.907817 
-352134.380894  7400568.489088 
-352147.879973  7400563.929869 
-352159.226787  7400554.731445 
-352168.272902  7400546.222902 
-352176.618087  7400535.014822 
-352181.936906  7400522.946889 
-352184.666408  7400508.129427 
-352186.991845  7400494.061837 
-352188.138071  7400481.114055 
-352187.742252  7400468.486218 
-352186.546549  7400456.988187 
-352168.990324  7400346.717076 
-352167.844098  7400337.238699 
-352160.991480  7400293.186245 
-352150.691938  7400189.983923 
-352152.868943  7400155.229876 
-352158.410410  7400130.054188 
-352167.011228  7400104.888499 
-352170.985912  7400096.030016 
-352182.530634  7400075.963453 
-352194.471176  7400063.805536 
-352239.990370  7400009.864775 
-352277.741613  7399971.521343 
-352293.590869  7399948.315318 
-352302.472059  7399937.687139 
-352314.956852  7399903.772948 
-352319.822128  7399868.269030 
-352324.926545  7399846.862696 
-352328.901228  7399827.815959 
-352336.834102  7399794.491667 
-352344.783469  7399765.916562 
-352359.049448  7399718.334712 
-352359.041201  7399718.334712 
-352379.689763  7399666.723552 
-352409.722535  7399608.703491 
-352423.337062  7399584.197688 
-352443.969131  7399553.242991 
-352477.300395  7399498.492369 
-352510.631659  7399428.654332 
-352541.579763  7399349.297925 
-352570.136460  7399288.988255 
-352585.639373  7399248.065265 
-352636.007350  7399109.648974 
-352633.962285  7399077.244525 
-352632.040913  7399055.678219 
-352628.866114  7399028.672845 
-352628.866114  7398997.748142 
-352624.800723  7398949.186460 
-352619.539628  7398913.272612 
-352623.101999  7398898.765097 
-352618.179000  7398891.476345 
-352615.383527  7398847.763833 
-352613.000367  7398823.168046 
-352611.301643  7398792.113365 
-352610.262618  7398777.205919 
-352611.582015  7398754.679777 
-352612.010819  7398748.190889 
-352631.249275  7398647.788087 
-352634.580752  7398595.906974 
-352629.987602  7398546.215485 
-352623.926622  7398489.635177 
-352604.119176  7398285.270183 
-352595.823468  7398215.932060 
-352595.213247  7398195.295595 
-352588.179212  7398148.033690 
-352587.750408  7398121.518232 
-352590.933453  7398105.111043 
-352589.828459  7398100.141894 
-352592.368298  7398093.093101 
-352594.743212  7398072.456636 
-352612.200482  7398043.091666 
-352636.807235  7398005.008189 
-352667.590414  7397961.275680 
-352672.513413  7397904.235451 
-352673.610162  7397878.929785 
-352651.881344  7397811.391354 
-352590.273755  7397768.678670 
-352562.261310  7397751.121678 
-352533.638643  7397733.664668 
-352510.582182  7397701.210227 
-352494.617480  7397673.584959 
-352475.675888  7397628.102750 
-352447.572734  7397559.484503 
-352505.073700  7397528.879746 
-352536.087773  7397523.120732 
-352576.733444  7397573.082174 
-352625.221280  7397596.428175 
-352686.284618  7397603.606946 
-352768.895357  7397608.996023 
-352879.609250  7397623.223586 
-352959.787350  7397609.825880 
-353013.750684  7397582.050638 
-353078.030052  7397559.034581 
-353135.168184  7397547.926483 
-353195.406899  7397545.846839 
-353261.253050  7397564.003729 
-353298.427058  7397580.860842 
-353406.271262  7397620.304086 
-353445.737722  7397636.421325 
-353459.261541  7397647.029508 
-353469.049816  7397651.108809 
-353501.671905  7397664.976434 
-353513.076442  7397673.125038 
-353572.045237  7397686.542740 
-353619.922852  7397678.844058 
-353673.671784  7397658.727504 
-353739.353011  7397594.438516 
-353814.476172  7397519.731313 
-353834.382573  7397548.216434 
-353838.118115  7397555.125250 
-353842.208246  7397564.733604 
-353845.877818  7397578.131309 
-353848.277471  7397599.737608 
-353854.231250  7397617.554557 
-353857.950300  7397625.993111 
-353868.670400  7397652.748528 
-353886.605951  7397715.537773 
-353894.547072  7397732.944791 
-353902.108865  7397740.003582 
-353919.236286  7397738.373861 
-353976.399157  7397735.564343 
-353977.396951  7397769.558520 
-353975.896137  7397797.303767 
-353972.647122  7397826.548758 
-353964.153504  7397862.542592 
-353956.154661  7397901.785870 
-353954.901234  7397917.783130 
-353956.649435  7397925.781760 
-353959.403676  7397936.279962 
-353966.899499  7397951.277393 
-353974.403569  7397969.024353 
-353979.648172  7397987.271227 
-353980.901599  7398003.768402 
-353978.402991  7398017.016132 
-353973.653162  7398031.013735 
-353970.898921  7398044.011508 
-353968.152926  7398065.007912 
-353967.897293  7398082.754872 
-353969.901127  7398101.501661 
-353972.152348  7398113.749563 
-353979.895559  7398134.745966 
-353986.896609  7398150.493269 
-353989.395216  7398159.241770 
-353991.893824  7398181.487960 
-353992.644231  7398207.233550 
-353985.395795  7398232.479226 
-353975.401363  7398253.975543 
-353963.155710  7398279.721133 
-353954.150827  7398303.217109 
-353948.114586  7398321.703942 
-353946.407616  7398339.460901 
-353947.900184  7398350.708974 
-353951.899606  7398364.956533 
-353960.401469  7398382.953451 
-353980.645966  7398409.448912 
-354005.648537  7398433.194845 
-354018.891983  7398446.442576 
-354022.891405  7398454.441205 
-354026.396053  7398464.439493 
-354028.894661  7398478.687052 
-354027.888621  7398493.434526 
-354024.392219  7398512.681229 
-354021.390591  7398533.427676 
-354020.145410  7398554.174122 
-354021.390591  7398577.920055 
-354021.646224  7398599.666330 
-354019.395004  7398611.164360 
-354013.144361  7398625.911834 
-354004.898130  7398637.159907 
-354001.393482  7398645.908409 
-353999.397894  7398656.406611 
-353999.307186  7398669.034448 
-354001.146095  7398692.400445 
-354001.896502  7398712.147063 
-354001.146095  7398736.392910 
-353997.146673  7398773.636530 
-353993.394638  7398790.883576 
-353989.395216  7398804.131307 
-353982.897187  7398817.379037 
-353966.149092  7398840.875013 
-353958.900655  7398851.873129 
-353955.651641  7398859.871759 
-353954.917726  7398865.230841 
-353953.153033  7398872.869532 
-353951.157445  7398898.115208 
-353949.656631  7398926.610327 
-353947.652797  7398944.107330 
-353944.906802  7398957.355061 
-353936.050350  7398991.429224 
-353920.654638  7399035.841617 
-353910.660206  7399050.589091 
-353896.814785  7399070.935606 
-353882.161233  7399094.331598 
-353868.167380  7399119.827231 
-353852.664466  7399150.072050 
-353848.063069  7399159.250478 
-353840.921834  7399173.318068 
-353835.916372  7399189.565285 
-353827.670141  7399216.810618 
-353818.920890  7399244.305909 
-353811.177680  7399269.801542 
-353806.675238  7399291.047902 
-353804.176630  7399318.543193 
-353802.172796  7399344.288783 
-353797.175580  7399376.283302 
-353793.176158  7399404.028550 
-353792.788585  7399412.987015 
-353792.178364  7399436.023069 
-353793.679178  7399457.269430 
-353799.921575  7399484.014849 
-353808.670826  7399499.512194 
-353821.675131  7399516.259326 
-353835.322643  7399529.377079 
-353843.420442  7399537.755643 
-353860.168536  7399547.503974 
-353882.416866  7399557.002347 
-353892.658685  7399564.251105 
-353899.907121  7399573.249564 
-353907.163804  7399589.496781 
-353911.410613  7399612.742799 
-353915.657422  7399635.488903 
-353919.904231  7399657.485135 
-353923.408879  7399665.733722 
-353929.156502  7399675.732009 
-353947.652797  7399689.979569 
-353968.400313  7399708.226443 
-353981.899393  7399718.224731 
-354005.392904  7399735.471777 
-354020.640184  7399748.219593 
-354034.889671  7399765.466639 
-354045.139736  7399783.963470 
-354051.637765  7399798.211030 
-354057.385388  7399811.958675 
-354064.386438  7399823.956620 
-354072.632669  7399832.955079 
-354075.881683  7399840.703751 
-354078.611186  7399853.731520 
-354079.138945  7399864.699641 
-354076.887724  7399879.947029 
-354072.632669  7399901.693304 
-354069.383654  7399927.688851 
-354069.886674  7399947.935383 
-354072.888302  7399965.182429 
-354078.883311  7399982.179518 
-354087.137788  7399995.677206 
-354097.379607  7400007.925108 
-354109.880892  7400020.922881 
-354115.438852  7400026.181980 
-354120.881364  7400033.170783 
-354131.873590  7400061.665902 
-354138.627252  7400082.412349 
-354145.125282  7400104.158624 
-354156.373141  7400138.152801 
-354163.126804  7400158.149376 
-354166.870592  7400172.396935 
-354171.125647  7400202.391797 
-354176.617637  7400243.884690 
-354181.367466  7400285.127625 
-354184.121707  7400304.124371 
-354189.366310  7400337.118720 
-354195.616952  7400360.114781 
-354199.368987  7400369.863111 
-354211.490946  7400382.330975 
-354217.955991  7400390.349602 
-354221.963659  7400398.358230 
-354225.047750  7400408.526488 
-354225.971327  7400414.685433 
-354225.352860  7400420.234483 
-354222.582127  7400427.933166 
-354219.498036  7400434.712003 
-354217.650881  7400443.340525 
-354214.880147  7400457.828043 
-354214.880147  7400467.686355 
-354214.880147  7400481.543981 
-354216.727303  7400492.952027 
-354216.727303  7400503.730181 
-354214.880147  7400514.208386 
-354209.948901  7400526.836223 
-354201.933565  7400543.483371 
-354198.857721  7400552.721789 
-354197.315676  7400559.190681 
-354196.392098  7400569.358939 
-354194.544942  7400595.244505 
-354193.613118  7400604.482923 
-354191.056787  7400612.751506 
-354185.606028  7400630.368489 
-354182.835295  7400637.767221 
-354179.132737  7400643.616220 
-354169.888713  7400656.863950 
-354167.117979  7400664.262683 
-354163.728779  7400675.350784 
-354160.034467  7400696.617141 
-354155.721689  7400722.802656 
-354150.171975  7400745.298802 
-354141.233061  7400785.661888 
-354137.538750  7400804.448670 
-354131.989037  7400823.245451 
-354124.905525  7400846.351493 
-354111.653832  7400875.316531 
-354100.257541  7400899.352414 
-354090.708406  7400918.759090 
-354084.622688  7400935.226269 
-354082.693070  7400939.715500 
-354075.914668  7400960.361964 
-354073.143935  7400969.600381 
-354070.983422  7400980.698480 
-354066.670644  7401007.803838 
-354063.586554  7401027.530459 
-354061.739398  7401035.539087 
-354055.719650  7401051.656326 
-354050.648218  7401063.574285 
-354037.709882  7401092.229376 
-354027.542279  7401111.026157 
-354019.840300  7401120.884468 
-353999.505095  7401141.840878 
-353985.016468  7401156.008451 
-353973.620177  7401163.407184 
-353958.826439  7401168.336340 
-353944.040948  7401169.566129 
-353908.912005  7401169.256182 
-353891.660891  7401171.725759 
-353880.874821  7401176.654915 
-353849.135079  7401192.062276 
-353831.883965  7401201.300693 
-353821.097895  7401205.929900 
-353797.678600  7401212.088845 
-353783.198219  7401216.398107 
-353767.489150  7401224.106787 
-353753.289141  7401231.935446 
-353731.436629  7401243.203516 
-353720.963916  7401247.212829 
-353679.675040  7401250.292301 
-353667.965392  7401252.761878 
-353658.408011  7401256.151298 
-353647.316830  7401263.240084 
-353605.722843  7401296.824331 
-353580.151282  7401319.620426 
-353567.823167  7401328.868842 
-353557.037097  7401333.488051 
-353543.480294  7401337.187417 
-353524.992245  7401338.727153 
-353443.956537  7401341.496679 
-353423.621332  7401345.196045 
-353414.072197  7401349.195360 
-353409.140951  7401353.204674 
-353405.133283  7401357.823882 
-353402.362549  7401361.523249 
-353400.820504  7401364.912668 
-353400.210283  7401391.408130 
-Region 1
-800
-349021.832890  7386677.758445 
-348971.572114  7386645.513968 
-348914.491705  7386611.989710 
-348896.671601  7386599.991765 
-348907.020621  7386595.442545 
-348926.267323  7386589.773516 
-348939.362337  7386586.254118 
-348951.261648  7386580.725066 
-348961.552944  7386572.086545 
-348972.858526  7386563.787967 
-348988.806736  7386550.880178 
-349009.752162  7386539.142188 
-349032.783884  7386522.215088 
-349052.822225  7386508.027518 
-349062.692963  7386500.818753 
-349072.233852  7386492.660150 
-349076.909464  7386488.120928 
-349086.565800  7386481.462068 
-349098.258955  7386475.603072 
-349117.761291  7386464.724935 
-349131.012984  7386456.116410 
-349145.138777  7386451.387220 
-349159.561434  7386448.547706 
-349166.397559  7386448.067789 
-349192.933929  7386448.117780 
-349215.404908  7386445.588213 
-349231.361364  7386441.868850 
-349240.374494  7386438.309460 
-349254.525026  7386431.810573 
-349283.065230  7386415.053444 
-349292.498918  7386410.614204 
-349310.145852  7386401.375786 
-349323.240866  7386395.556783 
-349342.339136  7386386.758290 
-349348.177468  7386384.048754 
-349349.505111  7386374.320421 
-349350.082347  7386367.901520 
-349350.247272  7386361.372639 
-349349.018583  7386352.164216 
-349347.352845  7386345.615338 
-349344.969684  7386339.056461 
-349342.677232  7386334.267282 
-349339.758066  7386330.028008 
-349336.756438  7386324.019037 
-349334.381524  7386316.800273 
-349332.550861  7386296.623730 
-349330.984077  7386280.436502 
-349330.316132  7386266.478893 
-349329.714157  7386245.092556 
-349331.619037  7386228.835341 
-349337.284197  7386214.057872 
-349341.745408  7386206.899099 
-349348.985598  7386187.712385 
-349354.065276  7386170.265374 
-349355.895940  7386160.537040 
-349363.573180  7386118.534235 
-349370.508260  7386079.730881 
-349372.149260  7386068.452813 
-349374.351004  7386062.823777 
-349382.399325  7386044.306949 
-349385.120581  7386038.237989 
-349386.192591  7386033.158859 
-349386.448224  7386028.179712 
-349387.421279  7386022.760640 
-349388.823139  7386015.021965 
-349392.014430  7386002.764065 
-349395.477847  7385993.385671 
-349406.395856  7385973.679047 
-349409.644871  7385965.740407 
-349411.508519  7385962.320993 
-349419.647549  7385954.982250 
-349424.521071  7385947.283568 
-349428.141166  7385942.674358 
-349431.019101  7385940.484733 
-349441.376366  7385936.165473 
-349449.993677  7385931.046350 
-349459.864416  7385923.837584 
-349466.750018  7385919.038406 
-349475.507515  7385911.269737 
-349481.791143  7385905.130789 
-349496.238539  7385889.443476 
-349504.476523  7385882.434676 
-349510.042729  7385876.515690 
-349517.835417  7385863.197971 
-349518.940412  7385855.119355 
-349513.737040  7385844.771128 
-349507.948186  7385842.161575 
-349498.085695  7385839.292066 
-349491.274308  7385836.892477 
-349487.744921  7385832.323260 
-349484.256766  7385824.754556 
-349486.565710  7385818.685596 
-349488.717977  7385807.637488 
-349493.904856  7385799.378903 
-349498.827855  7385786.811056 
-349504.328091  7385777.782602 
-349506.059800  7385758.865843 
-349506.933900  7385743.038554 
-349507.074086  7385729.190926 
-349511.304402  7385714.613423 
-349511.477573  7385698.226230 
-349510.364332  7385687.368089 
-349509.160382  7385675.500122 
-349508.253297  7385664.641982 
-349507.717292  7385647.464925 
-349509.894297  7385634.317177 
-349512.574322  7385621.719335 
-349517.464337  7385612.680883 
-349519.113583  7385600.632946 
-349521.026708  7385593.894101 
-349517.340643  7385575.357276 
-349513.135066  7385567.568610 
-349512.500106  7385559.699958 
-349513.835995  7385548.861814 
-349518.874442  7385534.844215 
-349523.492331  7385522.486332 
-349526.164110  7385511.218262 
-349534.789667  7385495.920883 
-349542.829742  7385478.053943 
-349547.200244  7385469.795358 
-349553.953907  7385457.797413 
-349568.302349  7385442.220081 
-349570.198982  7385436.031141 
-349570.281444  7385428.392450 
-349564.929640  7385422.583445 
-349561.177605  7385419.993888 
-349556.139158  7385414.624808 
-349552.741711  7385407.066103 
-349552.510817  7385400.197279 
-349553.426148  7385390.678910 
-349561.070404  7385381.120547 
-349567.040675  7385375.871446 
-349580.490277  7385368.472713 
-349600.305970  7385365.913152 
-349619.767074  7385358.584407 
-349632.482762  7385352.175505 
-349645.256173  7385340.687473 
-349659.151072  7385329.199441 
-349666.803574  7385319.201153 
-349668.205433  7385311.462479 
-349676.179538  7385300.694323 
-349689.365261  7385278.128189 
-349701.775838  7385262.300900 
-349706.204064  7385248.063338 
-349707.869802  7385234.675632 
-349711.275495  7385221.097957 
-349716.280957  7385211.069675 
-349717.592108  7385202.221191 
-349718.730088  7385190.933124 
-349716.346927  7385174.965859 
-349713.238098  7385159.538502 
-349712.347505  7385147.130627 
-349712.446460  7385137.602259 
-349716.124279  7385127.014073 
-349722.374922  7385114.446228 
-349734.422665  7385104.277968 
-349740.079579  7385099.348812 
-349743.971800  7385088.540663 
-349747.624880  7385080.492042 
-349755.079473  7385069.713888 
-349762.294925  7385062.255166 
-349767.646728  7385057.995895 
-349775.554863  7385053.316697 
-349783.528968  7385041.208771 
-349786.464627  7385033.930018 
-349791.824676  7385028.670918 
-349796.434319  7385027.061194 
-349804.367193  7385019.502489 
-349809.488103  7385017.562821 
-349815.070801  7385010.304064 
-349821.041072  7385005.054964 
-349825.089971  7384998.786037 
-349830.581960  7384990.537450 
-349836.626448  7384987.827914 
-349842.035975  7384987.437981 
-349851.626341  7384987.757926 
-349858.437728  7384989.827572 
-349878.212189  7384991.577272 
-349893.533685  7384990.517454 
-349908.418132  7384991.667257 
-349926.229990  7384995.616580 
-349936.826396  7384997.276296 
-349956.073098  7385000.245787 
-349970.759635  7385005.724849 
-349981.586936  7385010.024112 
-350000.347111  7385010.773984 
-350019.148517  7385008.424386 
-350038.782792  7385004.085130 
-350058.078972  7385002.845342 
-350075.363071  7384998.256128 
-350088.853904  7384995.846541 
-350108.216054  7384988.187853 
-350124.774485  7384985.918241 
-350144.070665  7384984.348510 
-350159.062312  7384984.948408 
-350180.057215  7384987.268010 
-350188.410647  7384988.347825 
-350222.187208  7384987.917899 
-350242.275026  7384988.677769 
-350261.257848  7384988.097868 
-350279.515003  7384989.277666 
-350295.529183  7384989.227675 
-350308.302594  7384987.367993 
-350324.209573  7384988.747757 
-350336.628397  7384990.867394 
-350355.668943  7384994.936697 
-350367.263143  7384998.266126 
-350372.837595  7385001.865510 
-350377.867796  7385009.234248 
-350380.011816  7385018.882595 
-350390.484529  7385032.620242 
-350399.588368  7385039.799012 
-350417.326010  7385041.198772 
-350433.389667  7385036.599560 
-350445.082822  7385030.960526 
-350455.918369  7385019.222537 
-350464.082137  7385008.674344 
-350470.250318  7385004.195111 
-350477.135921  7384999.725876 
-350485.514091  7384998.266126 
-350496.910382  7385001.255614 
-350508.257195  7385009.124267 
-350520.560571  7385022.871912 
-350530.373586  7385031.610415 
-350536.129455  7385037.209456 
-350542.916102  7385042.038629 
-350548.803911  7385044.868144 
-350557.363499  7385045.737995 
-350562.987428  7385044.578194 
-350571.645970  7385036.029658 
-350582.877336  7385035.139810 
-350587.998245  7385032.980180 
-350599.138903  7385031.540427 
-350604.251566  7385030.050682 
-350608.910686  7385023.891737 
-350613.025555  7385020.062393 
-350625.411394  7385016.203054 
-350633.063896  7385016.053080 
-350643.957167  7385018.932586 
-350659.138477  7385020.862256 
-350672.909682  7385021.222194 
-350679.448943  7385020.292354 
-350686.606671  7385018.602643 
-350692.494480  7385011.123924 
-350697.170093  7385003.095299 
-350702.332233  7384997.606239 
-350718.956634  7384987.477974 
-350748.939929  7384979.149401 
-350777.381178  7384951.754094 
-350812.708031  7384929.407921 
-350835.632552  7384922.559094 
-350869.895640  7384894.223948 
-350905.362678  7384878.196693 
-350919.867798  7384876.357008 
-350951.533323  7384882.435967 
-350974.589784  7384882.675926 
-350999.584109  7384872.627647 
-351017.470184  7384859.959817 
-351028.784012  7384850.551429 
-351037.219906  7384843.772590 
-351038.984599  7384841.243023 
-351039.025831  7384837.263705 
-351035.100625  7384831.684660 
-351031.760901  7384829.105102 
-351031.092957  7384824.555881 
-351031.851610  7384820.016659 
-351040.336981  7384818.336947 
-351045.358936  7384816.397279 
-351052.054875  7384809.928387 
-351058.734322  7384805.679115 
-351069.660577  7384804.239361 
-351077.040954  7384801.319862 
-351086.441657  7384799.650148 
-351096.889631  7384795.770812 
-351106.826339  7384791.771497 
-351119.039007  7384784.592727 
-351125.710207  7384780.893360 
-351131.688724  7384765.116063 
-351133.618342  7384756.057615 
-351134.913001  7384748.758865 
-351136.339599  7384738.690589 
-351138.434141  7384733.621458 
-351154.052502  7384722.703328 
-351174.956697  7384714.064808 
-351202.853695  7384709.585575 
-351214.604574  7384707.935857 
-351230.519799  7384707.655905 
-351251.885782  7384704.106513 
-351262.696591  7384694.358183 
-351268.873017  7384688.659159 
-351278.471630  7384688.209236 
-351284.788243  7384688.489188 
-351298.526463  7384692.508500 
-351308.982683  7384687.739317 
-351315.357020  7384682.600197 
-351322.531240  7384679.350754 
-351332.937983  7384679.240773 
-351343.855993  7384679.130791 
-351355.829520  7384675.701379 
-351364.306645  7384684.319903 
-351373.674363  7384686.189582 
-351379.941498  7384692.118567 
-351387.206427  7384700.497132 
-351394.578557  7384707.335960 
-351409.652667  7384719.883811 
-351421.535485  7384725.322879 
-351431.933982  7384726.432689 
-351446.579288  7384730.342019 
-351459.121805  7384741.100177 
-351470.320186  7384743.539759 
-351481.452597  7384742.879872 
-351493.896159  7384742.789887 
-351501.540415  7384743.859704 
-351508.318817  7384749.468743 
-351516.350645  7384751.768349 
-351529.585846  7384754.447890 
-351540.000835  7384753.778005 
-351550.077729  7384756.427551 
-351556.344864  7384761.806630 
-351565.193070  7384764.446178 
-351572.367290  7384761.746640 
-351578.197375  7384759.816971 
-351585.891108  7384756.347565 
-351590.649184  7384759.387044 
-351597.773927  7384761.006767 
-351603.917369  7384759.077097 
-351612.542926  7384754.067955 
-351618.867785  7384753.698019 
-351624.219589  7384759.507024 
-351629.480684  7384763.876275 
-351639.005080  7384770.065215 
-351650.937376  7384770.415155 
-351657.575591  7384770.255183 
-351661.649229  7384770.745099 
-351680.549590  7384778.243814 
-351684.977816  7384774.304489 
-351692.053082  7384770.825085 
-351693.957961  7384763.536334 
-351696.258659  7384758.467202 
-351704.513136  7384749.248781 
-351713.971563  7384742.040016 
-351725.178190  7384733.841420 
-351741.794345  7384724.712984 
-351787.222830  7384702.466794 
-351794.702161  7384689.479019 
-351803.451412  7384681.260427 
-351828.585923  7384657.484499 
-351847.882102  7384636.308127 
-351852.937042  7384631.268990 
-351861.480137  7384623.270360 
-351866.345413  7384616.561509 
-351879.061100  7384610.382567 
-351893.904316  7384605.543396 
-351905.556239  7384603.113812 
-351916.466003  7384603.783698 
-351946.152433  7384604.083646 
-351959.618528  7384604.443585 
-351978.180793  7384604.633552 
-351992.553973  7384605.773357 
-352002.977208  7384604.103643 
-352018.834710  7384600.284297 
-352040.464573  7384590.206023 
-352057.781657  7384582.297378 
-352069.812908  7384573.558875 
-352083.336726  7384567.939837 
-352092.737429  7384566.480087 
-352101.659850  7384561.590925 
-352124.411201  7384551.742612 
-352165.823771  7384542.084266 
-352187.041323  7384532.995823 
-352211.194532  7384525.377128 
-352230.870039  7384516.498649 
-352253.489449  7384509.419861 
-352284.074719  7384501.421231 
-352309.019566  7384496.692042 
-352335.184856  7384491.972850 
-352363.939462  7384483.404318 
-352386.839245  7384478.315189 
-352407.726947  7384470.996443 
-352427.138574  7384458.348609 
-352439.697583  7384447.620447 
-352457.666120  7384435.732483 
-352472.410380  7384430.573367 
-352485.917706  7384426.724026 
-352508.248499  7384428.163780 
-352520.824001  7384435.602506 
-352530.133995  7384443.111219 
-352540.887080  7384458.838525 
-352552.242139  7384466.037292 
-352568.421244  7384470.416542 
-352588.715217  7384471.396374 
-352615.367035  7384468.446880 
-352632.247069  7384463.857666 
-352658.131987  7384456.588911 
-352682.351166  7384453.289476 
-352703.882075  7384452.959532 
-352722.625757  7384455.249140 
-352739.827394  7384459.408428 
-352760.632634  7384460.398258 
-352781.767723  7384458.618563 
-352805.327204  7384458.858522 
-352826.429308  7384460.838183 
-352842.072408  7384467.527037 
-352867.314120  7384483.294336 
-352879.848390  7384495.492247 
-352889.042938  7384513.739122 
-352901.016464  7384530.476255 
-352915.859680  7384546.353535 
-352930.966774  7384555.252011 
-352949.446577  7384563.850538 
-352978.151706  7384580.317717 
-352996.540800  7384598.324633 
-353009.050332  7384612.412220 
-353020.858934  7384624.820094 
-353037.664753  7384637.947846 
-353056.631083  7384649.215916 
-353077.312629  7384661.823756 
-353099.577452  7384669.912370 
-353123.054471  7384679.230774 
-353138.202797  7384684.139933 
-353162.743579  7384688.489188 
-353192.627919  7384689.898947 
-353209.994481  7384687.639334 
-353224.722249  7384683.580029 
-353240.629227  7384674.651559 
-353269.936331  7384661.883746 
-353285.694878  7384657.164554 
-353308.536937  7384658.504325 
-353325.012906  7384662.993556 
-353342.395960  7384669.482444 
-353363.399109  7384680.990473 
-353377.063113  7384691.978591 
-353389.349997  7384697.747603 
-353396.334555  7384702.916717 
-353410.608780  7384704.386465 
-353433.162221  7384703.616597 
-353448.508456  7384709.635566 
-353464.324726  7384718.993963 
-353483.909524  7384729.482167 
-353499.255759  7384735.291172 
-353515.962623  7384738.330651 
-353546.976696  7384738.420636 
-353558.653359  7384733.561468 
-353580.382176  7384713.174960 
-353596.041768  7384698.827418 
-353617.424244  7384682.540207 
-353635.079424  7384671.982016 
-353655.241458  7384665.313158 
-353685.818481  7384658.534319 
-353708.165766  7384657.434508 
-353726.068333  7384663.033549 
-353754.872417  7384669.862379 
-353788.112973  7384682.040293 
-353814.806021  7384696.147877 
-353840.171427  7384709.695556 
-353863.813370  7384722.783314 
-353883.909434  7384732.951572 
-353898.216644  7384740.950202 
-353919.549643  7384750.248610 
-353964.846188  7384770.965061 
-353980.439810  7384782.533080 
-353996.115894  7384796.200738 
-354011.049818  7384812.627925 
-354023.237747  7384828.475210 
-354030.519169  7384844.832408 
-354035.895711  7384857.950161 
-354038.724168  7384870.937937 
-354042.105123  7384889.904688 
-354042.022660  7384898.543208 
-354037.396525  7384912.340845 
-354029.100817  7384925.548582 
-354018.438441  7384940.725983 
-354007.009165  7384951.354162 
-353994.953176  7384963.302115 
-353975.797182  7384980.939094 
-353964.293690  7384989.017711 
-353951.454309  7384997.636234 
-353942.202038  7385004.305092 
-353937.740828  7385011.563849 
-353933.238386  7385022.811922 
-353932.520964  7385033.880026 
-353937.559411  7385049.877286 
-353942.944199  7385062.335152 
-353954.142580  7385085.041263 
-353959.082073  7385091.400173 
-353964.961635  7385105.637735 
-353966.594389  7385125.814279 
-353971.434926  7385141.801540 
-353973.611931  7385158.328709 
-353980.695443  7385174.785890 
-354006.844240  7385202.291179 
-354030.321259  7385221.577875 
-354048.809308  7385239.594789 
-354064.312222  7385249.933018 
-354080.582035  7385266.160239 
-354093.545109  7385275.698605 
-354110.342681  7385289.376262 
-354121.590540  7385297.464876 
-354135.353499  7385308.013070 
-354154.138412  7385317.391463 
-354174.127275  7385307.733118 
-354193.984199  7385291.655871 
-354206.353545  7385278.488127 
-354222.054368  7385270.119560 
-354248.401075  7385257.531717 
-354261.751722  7385360.444089 
-354284.973108  7385405.856310 
-354291.792740  7385437.710854 
-354299.362780  7385466.685890 
-354308.672775  7385484.722801 
-354323.227372  7385538.683558 
-354185.911139  7385956.691957 
-354099.284486  7386476.442928 
-354056.404087  7386585.144309 
-354048.025916  7386591.873156 
-354042.575158  7386616.288974 
-354036.835781  7386629.086782 
-354029.043093  7386642.844425 
-354012.360969  7386658.631721 
-353999.134015  7386684.967210 
-353987.251196  7386699.684689 
-353978.675117  7386711.002750 
-353967.443750  7386721.410967 
-353957.647228  7386732.169125 
-353937.328516  7386753.895403 
-353915.715146  7386772.062291 
-353909.002714  7386780.300880 
-353901.061594  7386788.519472 
-353898.579478  7386801.897181 
-353893.722448  7386807.936146 
-353889.417916  7386810.335735 
-353864.745194  7386808.096119 
-353841.870150  7386809.855818 
-353829.731699  7386809.405895 
-353811.458052  7386809.885812 
-353795.757228  7386809.285915 
-353787.082194  7386809.415893 
-353772.049315  7386812.255406 
-353755.993904  7386816.304713 
-353738.091337  7386830.742240 
-353731.049056  7386841.530392 
-353713.633017  7386837.581068 
-353699.350546  7386837.881017 
-353687.665637  7386842.970145 
-353680.145075  7386850.208905 
-353677.844376  7386855.827943 
-353670.620678  7386863.506628 
-353657.154584  7386883.313235 
-353653.773629  7386895.121212 
-353644.669790  7386907.879027 
-353638.913921  7386921.666665 
-353626.297189  7386938.263822 
-353621.646314  7386944.752711 
-353611.173602  7386951.181610 
-353591.621789  7386967.368837 
-353582.484965  7386973.037866 
-353573.933624  7386981.036496 
-353569.109579  7386983.975992 
-353561.300399  7386999.073406 
-353549.813399  7387005.272344 
-353546.259274  7387003.682617 
-353543.752420  7386998.783456 
-353543.628726  7386991.474708 
-353539.068561  7386987.665360 
-353534.285747  7386987.065463 
-353528.958682  7386988.555208 
-353523.516170  7386992.264573 
-353513.035211  7386999.253375 
-353505.836251  7387004.942401 
-353490.259122  7387011.541271 
-353482.177816  7387014.000849 
-353462.848651  7387017.800199 
-353456.408345  7387019.279945 
-353451.551315  7387025.208929 
-353444.294632  7387036.546987 
-353441.383713  7387042.056044 
-353434.250723  7387051.284463 
-353426.062216  7387053.414098 
-353415.581257  7387081.109354 
-353412.942463  7387090.167803 
-353411.540604  7387097.676516 
-353407.400996  7387103.175574 
-353399.517600  7387106.195057 
-353384.674384  7387110.474324 
-353369.369380  7387120.402624 
-353355.020939  7387126.791529 
-353333.011749  7387133.990296 
-353316.890368  7387144.348522 
-353308.536937  7387153.017037 
-353301.346224  7387157.926196 
-353285.752602  7387165.744857 
-353262.374538  7387177.132906 
-353246.954086  7387188.270998 
-353232.094379  7387194.549923 
-353221.506219  7387202.188614 
-353208.831762  7387215.136397 
-353199.373336  7387232.313454 
-353194.029778  7387246.101093 
-353188.496557  7387258.119034 
-353044.863712  7387317.848803 
-352742.012645  7387441.097691 
-352657.686691  7387489.209450 
-352637.755551  7387492.878822 
-352617.750196  7387493.228762 
-352587.230896  7387493.698681 
-352573.608123  7387489.129464 
-352554.732501  7387478.751242 
-352527.445724  7387472.602295 
-352510.532705  7387470.002740 
-352494.996806  7387472.832256 
-352479.625832  7387479.321144 
-352474.364737  7387484.810204 
-352466.291677  7387496.018284 
-352460.098758  7387502.487176 
-352450.516638  7387511.695599 
-352442.781674  7387520.364114 
-352435.302342  7387522.953670 
-352422.619640  7387526.253105 
-352396.165732  7387538.720970 
-352383.647954  7387545.239853 
-352367.732729  7387554.828210 
-352358.653629  7387565.036462 
-352350.094041  7387573.475016 
-352334.508665  7387591.361953 
-352323.582410  7387601.780168 
-352315.360918  7387607.449197 
-352308.137220  7387615.907748 
-352291.397371  7387625.926032 
-352286.441387  7387631.415092 
-352278.681684  7387642.413208 
-352272.340332  7387644.002936 
-352263.327202  7387647.122401 
-352255.122203  7387651.251694 
-352253.357509  7387663.859534 
-352250.380620  7387676.227416 
-352247.618133  7387687.055561 
-352235.290018  7387694.684254 
-352226.606737  7387695.484117 
-352218.921250  7387699.173485 
-352212.950979  7387704.092643 
-352210.658527  7387708.831831 
-352193.357935  7387734.347460 
-352181.887428  7387748.515034 
-352171.266283  7387759.703117 
-352163.844676  7387767.161840 
-352158.707274  7387770.101336 
-352157.025043  7387775.290447 
-352156.662209  7387780.379576 
-352155.351058  7387799.306334 
-352153.644088  7387806.595085 
-352148.704596  7387811.084316 
-352138.075205  7387812.084145 
-352124.452432  7387817.703182 
-352120.617935  7387822.872297 
-352119.224322  7387829.721124 
-352117.979141  7387842.109002 
-352117.814216  7387848.427920 
-352116.082508  7387858.156253 
-352113.295282  7387870.744097 
-352108.116649  7387879.002682 
-352102.616413  7387887.471232 
-352094.394921  7387893.150259 
-352088.111294  7387899.399189 
-352085.653917  7387909.667430 
-352082.932661  7387917.176144 
-352080.821626  7387924.014972 
-352076.352169  7387931.503689 
-352067.437993  7387935.403021 
-352051.225904  7387944.211513 
-352026.759338  7387962.118445 
-352006.885922  7387979.525464 
-351994.566053  7387987.044176 
-351983.755245  7387996.232602 
-351972.482647  7388000.551862 
-351950.852784  7388000.661843 
-351933.915027  7388010.460165 
-351917.810138  7388018.268827 
-351905.721164  7388023.127995 
-351891.842758  7388033.396236 
-351884.140778  7388038.085433 
-351858.090936  7388070.709845 
-351846.241102  7388082.107892 
-351829.328083  7388089.136688 
-351812.918084  7388097.385275 
-351760.818399  7388113.352540 
-351729.375522  7388123.890735 
-351722.506412  7388126.940213 
-351708.157970  7388133.419103 
-351688.705112  7388139.867998 
-351679.980600  7388144.987122 
-351659.670134  7388154.965412 
-351650.261185  7388157.305012 
-351643.631215  7388155.685289 
-351618.323534  7388087.656942 
-351596.165912  7388052.063039 
-351484.190346  7387884.931667 
-351462.040970  7387850.917493 
-351452.549559  7387826.391694 
-351445.416569  7387803.455623 
-351445.416569  7387778.929824 
-351443.849786  7387752.824296 
-351447.560589  7387733.707570 
-351417.478340  7387723.089389 
-351325.186527  7387698.243645 
-351264.288113  7387679.046933 
-351246.872074  7387672.927981 
-351216.022925  7387657.110690 
-351197.823494  7387642.073266 
-351149.566552  7387596.191125 
-351132.167006  7387583.533294 
-351036.436514  7387543.240195 
-351010.337194  7387533.741822 
-350985.021266  7387521.873855 
-350961.288614  7387506.846429 
-350932.022742  7387482.320630 
-350851.333375  7387422.990793 
-350833.142190  7387412.702555 
-350818.109312  7387407.963367 
-350782.963877  7387406.593602 
-350746.441321  7387408.923203 
-350707.279972  7387415.062151 
-350657.522216  7387426.150252 
-350595.823918  7387429.319709 
-350568.924714  7387430.419521 
-350535.807852  7387447.356619 
-350516.173576  7387451.585895 
-350504.158818  7387459.214588 
-350498.369965  7387466.683309 
-350493.150101  7387478.151345 
-350487.963221  7387496.038281 
-350476.641147  7387515.524943 
-350463.397700  7387532.991951 
-350446.196063  7387538.690975 
-350435.401747  7387546.329666 
-350414.398598  7387555.088166 
-350400.025418  7387563.576712 
-350383.574188  7387575.694636 
-350371.427490  7387585.872893 
-350348.272074  7387604.569690 
-350327.598774  7387610.338702 
-350318.882508  7387614.907919 
-350305.259735  7387619.967053 
-350294.795269  7387625.396123 
-350284.231847  7387630.495249 
-350270.378180  7387637.774003 
-350256.351341  7387642.063268 
-350247.461905  7387643.403038 
-350236.032629  7387643.183076 
-350225.329022  7387642.733153 
-350202.783827  7387641.843306 
-350190.381496  7387637.284087 
-350176.733984  7387634.594547 
-350166.145824  7387632.054982 
-350152.490066  7387630.365272 
-350146.552780  7387631.964998 
-350134.711193  7387642.363217 
-350126.992721  7387648.592150 
-350116.932320  7387654.911067 
-350110.747647  7387660.830053 
-350100.316165  7387663.159654 
-350088.218945  7387668.018822 
-350067.859001  7387673.237928 
-350001.361397  7387662.849707 
-349982.403313  7387680.346710 
-349967.708530  7387664.619404 
-349898.893735  7387697.053849 
-349832.437362  7387731.857887 
-349754.122910  7387774.580569 
-349667.100438  7387820.462710 
-349585.627679  7387862.385529 
-349568.219886  7387860.805799 
-349548.453671  7387849.727697 
-349504.938312  7387834.700271 
-349483.572329  7387830.740949 
-349462.330038  7387752.734311 
-349449.878230  7387691.574787 
-349448.699019  7387674.407728 
-349421.626644  7387565.356407 
-349411.937323  7387517.954527 
-349408.078087  7387501.877280 
-349403.493183  7387484.660230 
-349397.011646  7387466.633317 
-349385.392707  7387439.357989 
-349377.031029  7387420.541213 
-349366.484100  7387397.475164 
-349335.049468  7387335.155838 
-349309.626339  7387295.052708 
-349263.999945  7387221.015390 
-349242.312359  7387180.922257 
-349232.812701  7387162.725374 
-349221.441149  7387107.854773 
-349220.946375  7387085.198654 
-349218.068441  7387048.005025 
-349217.854039  7387020.969656 
-349213.821632  7386947.922168 
-349194.847055  7386884.263072 
-349136.298817  7386800.777373 
-349111.791020  7386763.203809 
-349059.575887  7386725.230313 
-349021.832890  7386677.758445 
-Region 1
-259
-330497.970400  7387158.766052 
-330555.512597  7387229.943860 
-330572.837928  7387253.559815 
-330650.500928  7387338.625244 
-330727.677401  7387424.140596 
-330805.068275  7387510.095873 
-330876.662050  7387602.300079 
-330950.853387  7387691.874736 
-331026.273412  7387779.479730 
-331101.470790  7387869.504309 
-331175.282800  7387955.529574 
-331219.391888  7388014.299507 
-331245.985982  7388045.284200 
-331323.137716  7388135.448755 
-331405.228942  7388230.022556 
-331443.376005  7388275.174822 
-331455.530949  7388292.701819 
-331463.323637  7388306.159514 
-331498.073253  7388382.796387 
-331510.797186  7388430.008300 
-331513.642136  7388457.623570 
-331517.476633  7388496.326940 
-331521.179191  7388538.669687 
-331520.626693  7388586.401511 
-331532.732160  7388713.909670 
-331538.438552  7388785.307441 
-331540.986637  7388852.895863 
-331541.926707  7388871.402693 
-331545.851913  7388925.883361 
-331547.740300  7388943.680313 
-331560.076661  7389059.460481 
-331565.123354  7389145.125807 
-331576.395951  7389246.048520 
-331578.127660  7389255.396918 
-331603.262171  7389247.928198 
-331730.006736  7389215.003837 
-331758.918020  7389207.865060 
-331859.901361  7389182.949328 
-331993.976825  7389168.841745 
-332122.123249  7389164.182543 
-332262.152492  7389149.874993 
-332395.551765  7389140.086670 
-332485.031614  7389141.446437 
-332546.367077  7389142.616237 
-332643.697338  7389145.295778 
-332704.529781  7389146.205622 
-332778.284068  7389149.245101 
-332853.572154  7389149.485060 
-332929.091134  7389152.794493 
-333027.452173  7389152.694510 
-333212.002815  7389152.654517 
-333340.272933  7389152.234589 
-333412.518160  7389151.704680 
-333453.600881  7389150.704851 
-333502.022747  7389150.774839 
-333541.563423  7389151.544707 
-333623.951513  7389150.314918 
-333697.211026  7389151.054791 
-333774.032911  7389149.785009 
-333847.787198  7389151.804663 
-333915.208380  7389153.024454 
-333951.186684  7389155.294065 
-334049.803356  7389156.203909 
-334125.817111  7389160.013257 
-334232.539828  7389161.483005 
-334285.761000  7389163.872596 
-334309.048356  7389163.042738 
-334325.870666  7389161.403019 
-334336.434088  7389160.143235 
-334321.162068  7389125.239213 
-334306.846612  7389091.514990 
-334241.948777  7388936.761498 
-334209.730754  7388862.374240 
-334183.895313  7388800.274877 
-334172.614469  7388778.218655 
-334140.272753  7388705.641087 
-334131.960552  7388682.285087 
-334124.415251  7388663.598288 
-334120.349860  7388653.030098 
-334115.600031  7388636.822875 
-334112.186091  7388626.134705 
-334106.001418  7388605.018322 
-334100.468198  7388588.451160 
-334095.833816  7388574.553541 
-334089.673882  7388559.426132 
-334082.631601  7388541.519199 
-334075.003837  7388525.261984 
-334066.683391  7388508.434866 
-334060.647150  7388493.507423 
-334042.761075  7388448.475137 
-334019.531444  7388391.394914 
-334013.082891  7388374.927735 
-334006.626093  7388359.460384 
-334003.121445  7388349.782042 
-333988.970913  7388313.158315 
-333985.045707  7388301.070386 
-333982.456391  7388294.831455 
-333974.069974  7388278.574239 
-333947.682036  7388212.255599 
-333936.392946  7388179.841151 
-333934.430343  7388174.342093 
-333925.375982  7388154.085563 
-333919.826269  7388139.728022 
-333915.002224  7388124.170687 
-333909.056692  7388108.263412 
-333904.991300  7388098.255126 
-333900.554828  7388084.027563 
-333896.085371  7388064.590893 
-333891.896286  7388046.823936 
-333888.672010  7388025.297623 
-333887.517537  7388010.000244 
-333886.973286  7387995.712691 
-333888.020557  7387975.346180 
-333889.142045  7387957.189290 
-333892.778632  7387933.313379 
-333899.721959  7387906.148033 
-333907.019873  7387883.741871 
-333913.575626  7387863.995253 
-333919.026385  7387842.458942 
-333925.425460  7387817.833160 
-333929.614545  7387799.386320 
-333936.805258  7387777.540062 
-333956.505503  7387719.919932 
-333973.946281  7387670.868334 
-333981.508074  7387652.231526 
-333987.791702  7387629.045498 
-333995.633867  7387603.549865 
-334000.870224  7387582.683439 
-334003.542003  7387562.996811 
-334008.621681  7387538.241052 
-334011.821218  7387517.014688 
-334011.227489  7387497.408046 
-334010.773947  7387456.974972 
-334011.441891  7387433.948916 
-334011.524354  7387417.781685 
-334001.018656  7387359.001754 
-333997.431546  7387328.796928 
-333995.139093  7387296.872396 
-333987.486591  7387270.316945 
-333982.563592  7387245.001281 
-333974.935828  7387215.896266 
-333967.085417  7387180.522326 
-333961.923276  7387157.716232 
-333958.410382  7387116.813238 
-333953.602830  7387082.089186 
-333949.471468  7387059.113122 
-333944.556715  7387034.247381 
-333941.934413  7387013.071009 
-333939.543006  7386990.554865 
-333938.306072  7386955.650844 
-333937.448464  7386932.164867 
-333935.469369  7386854.838112 
-333934.191203  7386797.008018 
-333935.510600  7386753.055547 
-333932.624419  7386728.549744 
-333931.849273  7386697.745021 
-333930.364952  7386666.830316 
-333926.687133  7386643.394331 
-333919.158324  7386602.571323 
-333905.749953  7386552.249943 
-333879.032166  7386461.355512 
-333864.823911  7386418.552844 
-333856.734358  7386385.448515 
-333847.836675  7386350.684469 
-333844.917510  7386338.856495 
-333839.442013  7386317.810100 
-333837.784520  7386301.612875 
-333831.476154  7386282.946072 
-333844.538183  7386279.336691 
-333833.603681  7386231.474889 
-333813.087059  7386172.664963 
-333784.249991  7386092.808641 
-333748.246948  7385963.870727 
-333751.726857  7385884.884257 
-333622.252790  7385861.908192 
-333598.668570  7385860.378454 
-333557.973422  7385852.389823 
-333516.536113  7385842.861455 
-333483.163618  7385836.552536 
-333459.587644  7385835.032796 
-333420.838606  7385830.643548 
-333387.457865  7385824.844541 
-333334.047029  7385817.585784 
-333267.772073  7385819.205507 
-333229.361131  7385823.214820 
-333195.782479  7385826.554248 
-333156.126356  7385828.993830 
-333081.621662  7385835.772669 
-333025.266922  7385835.572703 
-332993.180839  7385840.721821 
-332952.947479  7385846.720794 
-332914.231427  7385853.499633 
-332878.879836  7385856.799067 
-332835.158321  7385859.928531 
-332793.152022  7385865.877512 
-332748.630623  7385870.756677 
-332711.530831  7385872.756334 
-332677.020356  7385872.266418 
-332633.373057  7385871.576536 
-332582.634000  7385858.038855 
-332559.940373  7385850.940071 
-332538.656852  7385848.710453 
-332525.660792  7385842.311549 
-332499.841844  7385835.932642 
-332480.743574  7385826.904188 
-332480.727081  7385826.884192 
-332431.925888  7385806.777636 
-332397.555599  7385792.620061 
-332355.104004  7385764.324907 
-332318.713388  7385742.078718 
-332294.452977  7385729.950795 
-332256.042035  7385717.822873 
-332227.740971  7385721.862181 
-332213.590440  7385725.911487 
-332200.932476  7385732.690326 
-332191.861622  7385717.252970 
-332177.727583  7385700.935765 
-332164.146041  7385682.608905 
-332137.972505  7385647.504918 
-332110.215692  7385618.609867 
-332094.663301  7385594.234043 
-332068.201147  7385572.567754 
-332045.053978  7385621.619352 
-332036.453159  7385666.581650 
-331999.510046  7385720.092484 
-331944.647873  7385754.706555 
-331915.142860  7385752.456940 
-331875.989757  7385756.566236 
-331839.137352  7385769.574008 
-331796.702249  7385789.180650 
-331764.690382  7385802.938293 
-331739.778519  7385812.116721 
-331707.486280  7385817.225846 
-331678.756412  7385816.755927 
-331652.566384  7385819.065531 
-331633.352666  7385827.404103 
-331574.952861  7385925.147360 
-331532.583728  7386000.004538 
-331520.890573  7386027.819773 
-331477.391706  7386135.751286 
-331437.958231  7386236.634005 
-331425.654855  7386259.310121 
-331420.063911  7386283.825922 
-331401.534630  7386315.070570 
-331296.337466  7386507.677578 
-331281.733392  7386579.725237 
-331248.616529  7386628.186936 
-331217.528240  7386677.328518 
-331124.057215  7386818.744295 
-331030.907794  7386882.263415 
-330923.632580  7386938.713745 
-330867.178885  7386966.948909 
-330829.064806  7386983.886008 
-330713.328959  7387041.756095 
-330661.105581  7387069.981260 
-330604.651886  7387098.216424 
-330579.360696  7387112.563966 
-330537.898649  7387136.099935 
-330497.970400  7387158.766052 
-Region 1
-112
-333907.324983  7395848.817525 
-333982.068818  7396026.457097 
-333821.052918  7396075.218745 
-333729.676437  7396099.864523 
-333632.989382  7396125.490134 
-333556.340668  7396145.636683 
-333468.848161  7396169.792545 
-333432.737917  7396179.760838 
-333355.322304  7396201.427126 
-333314.742603  7396207.546078 
-333263.723174  7396222.513514 
-333260.902963  7396133.828705 
-333252.038265  7396000.001629 
-333244.831059  7395918.725551 
-333239.281346  7395834.849918 
-333227.151141  7395675.497213 
-333223.860895  7395658.210175 
-333219.548116  7395644.492524 
-333213.718031  7395626.335634 
-333200.021042  7395602.029798 
-333153.619502  7395514.324821 
-333099.087179  7395434.388513 
-333089.109240  7395412.862200 
-333055.472865  7395340.264636 
-333003.983401  7395244.701005 
-332812.101860  7394889.331876 
-332780.147716  7394841.380090 
-332759.020873  7394808.995637 
-332743.922025  7394787.569307 
-332731.049659  7394775.561364 
-332726.613187  7394771.852000 
-332731.288800  7394762.743560 
-332744.119935  7394737.757840 
-332787.783726  7394657.381607 
-332868.382384  7394516.605721 
-332903.865915  7394463.394836 
-332915.196236  7394446.377750 
-332928.043863  7394424.711462 
-332940.017390  7394392.426992 
-332953.747364  7394354.483491 
-332960.171177  7394312.870619 
-332962.933665  7394266.918490 
-332953.747364  7394225.305618 
-332939.159782  7394131.901617 
-332893.986930  7393999.964217 
-332883.440001  7393972.568910 
-332915.641532  7393966.190002 
-333017.243340  7393944.773671 
-333041.759383  7393939.624553 
-333080.392974  7393935.765214 
-333146.082447  7393928.026539 
-333191.717088  7393921.957579 
-333236.312703  7393924.627122 
-333348.296515  7393932.705738 
-333456.750941  7393939.814520 
-333662.684059  7393954.741963 
-333719.137754  7393959.301182 
-333747.339863  7393961.650780 
-333802.688563  7393971.229139 
-333844.810309  7393981.247423 
-333870.942614  7394000.004210 
-333877.630307  7394007.812873 
-333886.453774  7394018.780994 
-333892.993034  7394028.729290 
-333899.787929  7394038.417630 
-333910.087471  7394056.264573 
-333914.862038  7394064.673133 
-333926.142882  7394090.908639 
-333937.423725  7394115.114493 
-333947.632559  7394151.748218 
-333956.423041  7394117.764039 
-333961.288317  7394149.568591 
-333964.380653  7394155.307608 
-333978.968235  7394169.455185 
-334017.346193  7394184.542600 
-334096.361575  7394194.420908 
-334111.889227  7394211.348009 
-334118.939754  7394231.104625 
-334091.554022  7394278.196558 
-334052.235994  7394368.041169 
-334017.263730  7394444.888006 
-334196.338875  7394497.159052 
-334182.361514  7394504.187848 
-334166.273118  7394523.774493 
-334144.428853  7394584.504091 
-334138.928617  7394618.258309 
-334133.733492  7394643.394003 
-334124.720362  7394669.499532 
-334117.496664  7394693.085492 
-334107.741373  7394718.181193 
-334093.153791  7394745.276552 
-334071.540420  7394782.070249 
-334043.222864  7394834.061344 
-334027.752936  7394904.139340 
-334015.630977  7394957.900131 
-334016.867911  7394984.985492 
-334014.888816  7395049.254483 
-334017.123544  7395134.299916 
-334020.372559  7395193.259816 
-334021.172444  7395236.302443 
-334012.283007  7395278.225262 
-333992.211682  7395349.133117 
-333971.892969  7395423.830322 
-333957.676468  7395454.315100 
-333947.517112  7395476.431312 
-333933.053223  7395502.336874 
-333919.339741  7395520.383783 
-333899.293155  7395541.460173 
-333879.246568  7395560.216960 
-333830.552576  7395600.850000 
-333884.870497  7395785.938296 
-333907.324983  7395848.817525 
-Region 1
-140
-325444.531827  7377051.727297 
-325444.540073  7377051.717298 
-325318.084126  7376989.218004 
-324408.862982  7376720.733993 
-324487.457806  7376976.990098 
-324472.144556  7377282.387787 
-324406.422097  7377564.029544 
-324238.100037  7377972.139638 
-324026.510005  7378414.503865 
-323973.354802  7378626.637529 
-323963.170708  7378827.653097 
-324022.238458  7379087.548579 
-324080.943374  7379378.448750 
-324081.124791  7379691.785079 
-324026.839854  7379996.832827 
-324011.930669  7380259.707799 
-324000.625087  7380553.637451 
-323946.892648  7380812.163168 
-323874.573205  7380996.921521 
-323826.827530  7381081.517030 
-323818.704993  7381111.991810 
-323818.366897  7381140.116992 
-323825.788505  7381167.232348 
-323844.119876  7381186.838989 
-323868.734874  7381209.735067 
-323890.100858  7381222.952803 
-323963.822160  7381251.417928 
-323977.057360  7381261.886134 
-323983.934716  7381275.593786 
-323989.781294  7381281.202826 
-324002.249595  7381287.661719 
-324036.941487  7381303.918935 
-324056.394345  7381315.226998 
-324075.047319  7381333.063942 
-324101.624920  7381371.377380 
-324109.005297  7381390.614085 
-324118.537939  7381415.449830 
-324122.776502  7381436.096294 
-324135.541667  7381511.013461 
-324149.329364  7381568.663586 
-324155.843887  7381595.289026 
-324175.758534  7381669.226361 
-324199.994205  7381780.527296 
-324223.982490  7381849.565470 
-324232.286445  7381896.847371 
-324248.927338  7381988.431684 
-324271.241638  7382109.540939 
-324291.131547  7382177.559288 
-324314.237485  7382260.205131 
-324327.876750  7382319.554965 
-324344.624845  7382411.139278 
-324364.555984  7382476.168139 
-324387.332073  7382550.215455 
-324410.421519  7382606.425827 
-324445.385537  7382651.038185 
-324498.243876  7382692.990999 
-324560.181314  7382717.326831 
-324599.796206  7382757.349975 
-324623.660797  7382735.833661 
-324650.749665  7382703.469204 
-324700.227049  7382661.306426 
-324745.061805  7382623.522898 
-324804.228510  7382580.330297 
-324864.640396  7382538.017545 
-324964.658927  7382475.868190 
-325076.791171  7382399.131335 
-325111.738697  7382373.155784 
-325185.905295  7382317.925245 
-325277.240546  7382239.388697 
-325337.413291  7382165.011437 
-325414.235176  7382062.818942 
-325464.166102  7381997.030211 
-325481.936729  7381972.254455 
-325543.808198  7381883.059733 
-325574.863503  7381821.520274 
-325612.095234  7381743.983556 
-325652.963553  7381670.716106 
-325703.438731  7381579.161788 
-325759.694516  7381481.598500 
-325804.496287  7381395.073321 
-325879.528740  7381254.317431 
-325957.455620  7381110.702031 
-326015.063787  7381010.379215 
-326026.781681  7380969.316249 
-326080.019346  7380893.309268 
-326145.007889  7380773.469796 
-326208.272971  7380669.007689 
-326278.835967  7380552.007730 
-326364.720459  7380407.382503 
-326385.385513  7380376.507792 
-326428.035018  7380327.926113 
-326445.434564  7380311.208977 
-326561.021979  7380179.021619 
-326675.685817  7380053.003205 
-326748.689696  7379969.697475 
-326793.458483  7379907.108196 
-326813.216451  7379879.312957 
-326880.777819  7379773.461088 
-326932.621871  7379685.686123 
-326984.548385  7379590.942352 
-327025.037378  7379514.225493 
-327068.429044  7379424.920790 
-327118.442432  7379338.095662 
-327047.763990  7379293.593285 
-327010.787891  7379267.137817 
-326990.906229  7379253.620132 
-326955.142327  7379191.620752 
-326936.068795  7379133.590692 
-326911.560998  7379047.825383 
-326899.570979  7379005.862571 
-326888.372597  7378966.659286 
-326873.966432  7378913.928318 
-326843.579073  7378801.657549 
-326830.343872  7378752.036049 
-326823.499501  7378724.120831 
-326802.554075  7378668.590343 
-326782.647674  7378615.319467 
-326703.887925  7378443.088969 
-326693.596629  7378420.962759 
-326664.042139  7378309.671822 
-326659.589174  7378294.304454 
-326618.052911  7378115.675052 
-326614.993559  7378107.236497 
-326564.427673  7377879.465513 
-326554.507457  7377794.999981 
-326514.059696  7377633.527639 
-326464.780222  7377452.288684 
-326430.896460  7377373.062255 
-326390.910487  7377377.701460 
-326251.747099  7377371.212572 
-326243.797733  7377371.212572 
-326007.642179  7377362.494065 
-325958.230765  7377304.893931 
-325903.582995  7377263.111088 
-325778.520661  7377197.552318 
-325636.932881  7377130.673774 
-325580.883251  7377107.177798 
-325496.046030  7377071.953832 
-325491.881684  7377070.224128 
-325444.531827  7377051.727297 
-Region 1
-177
-340932.074469  7397727.665696 
-340958.503639  7397685.492919 
-341034.426684  7397563.933741 
-341056.460613  7397528.399828 
-341071.460506  7397510.272933 
-341128.153342  7397444.334228 
-341150.418164  7397416.389014 
-341167.817711  7397387.274002 
-341194.543745  7397338.842297 
-341238.529139  7397260.905647 
-341261.156796  7397259.645863 
-341238.537385  7397260.875652 
-341385.831557  7397053.271213 
-341419.987444  7397005.619376 
-341530.759061  7396799.784633 
-341652.646596  7396708.240314 
-341744.963148  7396668.397139 
-341816.078641  7396642.671545 
-341808.723003  7396660.198543 
-341816.111626  7396642.631552 
-341880.448717  7396603.788206 
-341913.845952  7396575.233097 
-341935.451076  7396546.158077 
-341950.648879  7396506.364893 
-341969.887335  7396445.495320 
-341969.912074  7396445.505318 
-341980.417772  7396412.301006 
-341899.283108  7396406.841941 
-341881.759868  7396405.132234 
-341854.332905  7396402.922612 
-341780.158060  7396384.215816 
-341643.196415  7396353.031158 
-341612.372005  7396347.742064 
-341519.173107  7396325.405890 
-341472.746828  7396314.617738 
-341400.814958  7396298.330528 
-341311.937084  7396274.514607 
-341302.989924  7396267.655782 
-341243.691279  7396236.431130 
-341041.147362  7396191.898758 
-340966.189126  7396176.621375 
-341003.247686  7396032.006147 
-341029.322267  7395925.344417 
-341068.689773  7395778.099639 
-341093.667605  7395664.189150 
-341101.930328  7395603.099614 
-341116.336493  7395550.278662 
-341127.600844  7395514.954713 
-341158.384023  7395439.277676 
-341192.506926  7395331.356162 
-341225.648527  7395221.704944 
-341254.601042  7395098.546040 
-341268.685604  7395044.875233 
-341284.237995  7394985.305437 
-341313.520360  7394868.255487 
-341324.438370  7394826.842580 
-341342.011087  7394756.914558 
-341370.872895  7394645.573630 
-341386.499502  7394581.344632 
-341402.851777  7394523.584526 
-341426.106147  7394433.319987 
-341418.791741  7394311.310886 
-341415.188138  7394283.505649 
-341405.218445  7394141.509972 
-341398.192657  7394063.833277 
-341376.166975  7394068.282515 
-341353.382639  7394073.481624 
-341313.116295  7394081.630228 
-341278.943915  7394088.289088 
-341218.169195  7394102.026735 
-340924.471445  7394179.943388 
-340894.809753  7394191.191462 
-340867.811594  7394201.689663 
-340818.301225  7394231.484560 
-340750.500717  7394272.967454 
-340736.778989  7394281.645967 
-340683.813450  7394318.649629 
-340642.541065  7394347.144748 
-340619.369157  7394367.001347 
-340552.154131  7394378.809324 
-340510.419958  7394382.378713 
-340479.010065  7394386.847947 
-340399.838005  7394393.676778 
-340333.967114  7394401.795387 
-340285.256630  7394404.754880 
-340239.193186  7394411.163782 
-340193.896641  7394414.143272 
-340146.703463  7394418.242570 
-340102.157325  7394422.371862 
-340054.972393  7394426.481159 
-340062.748588  7394404.414938 
-340052.506770  7394400.105676 
-339957.370007  7394357.912904 
-339916.419226  7394340.695853 
-339888.002715  7394326.288321 
-339885.767986  7394319.769437 
-339856.749501  7394334.366937 
-339827.318703  7394352.403847 
-339778.327847  7394391.237196 
-339775.491144  7394413.353407 
-339686.398868  7394425.061402 
-339678.391778  7394428.030893 
-339671.118603  7394432.540121 
-339665.370980  7394438.969019 
-339660.357272  7394446.937655 
-339656.077478  7394459.105570 
-339652.523352  7394477.022501 
-339538.997495  7394449.917144 
-339502.153337  7394444.198124 
-339455.421947  7394436.859381 
-339414.372211  7394432.620107 
-339380.166847  7394428.840754 
-339339.867517  7394425.761282 
-339307.138228  7394428.490814 
-339266.410095  7394431.900230 
-339223.389510  7394437.569259 
-339194.436994  7394442.618394 
-339143.351595  7394457.755801 
-339121.993858  7394465.194527 
-339092.612538  7394476.732551 
-339072.796845  7394480.731866 
-339009.193668  7394491.919949 
-338992.222926  7394521.914812 
-338966.346254  7394570.906420 
-338945.392582  7394607.430164 
-338914.988730  7394670.809307 
-338898.372575  7394704.243580 
-338878.911470  7394746.326372 
-338862.287070  7394795.138011 
-338847.847920  7394841.570058 
-338834.942569  7394888.032099 
-338807.952656  7395002.742450 
-338793.752647  7395086.168160 
-338758.153669  7395250.370034 
-338740.226363  7395335.935377 
-338708.173265  7395486.209637 
-338688.613206  7395604.439385 
-338661.013072  7395771.280807 
-338652.527701  7395805.604927 
-338637.321651  7395857.096107 
-338626.502597  7395885.361266 
-338616.763798  7395905.987732 
-338604.782025  7395930.833477 
-338588.990493  7395956.839022 
-338573.561796  7395979.415155 
-338558.528917  7396005.050764 
-338542.003471  7396033.725852 
-338526.269663  7396066.970158 
-338462.196451  7396344.182674 
-338383.337747  7396580.802143 
-338340.927383  7396755.842160 
-338321.961053  7396813.082355 
-338306.367430  7396863.453727 
-338283.632573  7396926.053005 
-338252.948348  7396994.811227 
-338206.431361  7397106.442105 
-338535.431225  7397199.266206 
-338585.906403  7397212.193991 
-338837.853488  7397289.180804 
-338911.335649  7397309.607305 
-339021.373351  7397338.952279 
-339154.731393  7397356.979191 
-339360.862421  7397336.002784 
-339523.214210  7397336.002784 
-339593.026798  7397346.071059 
-339654.560171  7397352.419972 
-339841.040431  7397414.219386 
-340016.116154  7397512.502551 
-340178.896747  7397598.507819 
-340221.570991  7397617.284603 
-340301.757337  7397650.718876 
-340424.617928  7397669.145719 
-340657.879054  7397676.074533 
-340771.685283  7397678.364140 
-340824.461159  7397685.172974 
-340880.675714  7397701.700143 
-340932.074469  7397727.665696 
-Region 1
-1604
-333674.377214  7404344.182346 
-333578.795154  7404397.883148 
-333578.745677  7404397.913143 
-333535.560167  7404430.987477 
-333524.510218  7404448.624456 
-333518.861550  7404471.110604 
-333517.360736  7404497.816030 
-333518.383269  7404535.099644 
-333518.449238  7404561.345148 
-333518.309053  7404573.883000 
-333512.759339  7404586.110906 
-333505.156315  7404598.878719 
-333491.888130  7404614.486046 
-333477.407749  7404630.463309 
-333470.307744  7404640.001675 
-333459.447458  7404646.430574 
-333443.647680  7404657.278716 
-333427.443837  7404666.997051 
-333407.364265  7404671.526275 
-333392.587020  7404673.685905 
-333338.673164  7404679.114975 
-333310.908106  7404680.294773 
-333290.828534  7404683.684193 
-333278.360233  7404685.353907 
-333236.906432  7404700.611293 
-333208.044624  7404708.110009 
-333201.035328  7404709.949693 
-333149.488141  7404759.311238 
-333141.612990  7404787.026491 
-333145.389764  7404799.144415 
-333136.013800  7404859.624056 
-333127.916001  7404895.957832 
-333120.131560  7404924.772896 
-333104.595661  7404961.036685 
-333080.656853  7404999.310129 
-333061.632799  7405028.335157 
-332996.718472  7405116.959976 
-332916.029105  7405227.241086 
-332897.235945  7405313.646286 
-332879.176700  7405392.412794 
-332832.964823  7405467.419946 
-332836.543688  7405511.762350 
-332861.241148  7405568.852571 
-332864.284007  7405633.351523 
-332854.578194  7405705.229211 
-332877.700625  7405756.990345 
-332918.849316  7405822.249167 
-332887.761026  7405869.301107 
-332809.256910  7405952.576843 
-332749.026442  7406010.396939 
-332738.900071  7406031.033404 
-332735.593332  7406050.510068 
-332737.283809  7406073.086201 
-332744.491015  7406097.032099 
-332754.807049  7406115.188989 
-332800.598368  7406153.892359 
-332830.532185  7406174.618809 
-332852.120817  7406197.254932 
-332854.396777  7406213.512147 
-332846.810245  7406250.155870 
-332846.892707  7406261.823871 
-332852.467159  7406276.861296 
-332875.317464  7406299.007502 
-332890.531760  7406310.125598 
-332901.400292  7406325.253007 
-332913.852100  7406352.558329 
-332925.240144  7406382.903132 
-332937.403335  7406407.478922 
-332956.031570  7406431.534802 
-332973.917644  7406448.531890 
-332997.782235  7406470.938052 
-333031.426856  7406495.783796 
-333063.933498  7406512.990849 
-333150.518919  7406570.311030 
-333186.868304  7406600.255901 
-333238.456723  7406725.004533 
-333247.956381  7406747.200731 
-333259.047561  7406764.087838 
-333277.659304  7406783.894446 
-333289.962680  7406804.610897 
-333307.626106  7406836.815381 
-333332.537969  7406873.189150 
-333358.340424  7406917.941484 
-333364.096293  7406937.538128 
-333353.310224  7406969.332682 
-333340.140993  7406990.928982 
-333337.246566  7407016.244646 
-333337.048657  7407047.169349 
-333322.840401  7407071.285218 
-333301.416694  7407088.972188 
-333279.836308  7407100.060289 
-333246.158703  7407111.978248 
-333225.798759  7407126.125824 
-333214.179820  7407145.222553 
-333222.137433  7407169.678364 
-333228.792141  7407180.166568 
-333229.229191  7407201.732874 
-333220.067629  7407259.392997 
-333225.642081  7407291.437508 
-333233.583201  7407300.405972 
-333238.869035  7407317.483047 
-333238.613401  7407335.729921 
-333231.026869  7407354.116772 
-333222.483774  7407369.964057 
-333209.603162  7407389.800659 
-333195.386660  7407407.247671 
-333184.707792  7407420.355426 
-333171.686994  7407432.333374 
-333158.187914  7407442.271671 
-333135.296378  7407456.889168 
-333126.448172  7407476.015891 
-333122.432258  7407492.703033 
-333117.839107  7407513.669442 
-333112.553274  7407530.576546 
-333103.762792  7407546.423831 
-333083.105984  7407579.828109 
-333078.471602  7407604.353908 
-333078.900406  7407626.670086 
-333089.892632  7407667.903023 
-333104.257566  7407718.824301 
-333109.172319  7407744.999817 
-333108.322957  7407768.815737 
-333104.801817  7407785.252922 
-333094.988802  7407801.330168 
-333083.971838  7407813.838026 
-333077.242914  7407826.405873 
-333075.016432  7407840.583444 
-333081.118642  7407854.361084 
-333088.210401  7407868.658635 
-333099.301581  7407886.055655 
-333105.073942  7407904.662468 
-333107.531319  7407925.988815 
-333107.382887  7407953.624081 
-333103.193802  7407999.186277 
-332938.953626  7408038.109610 
-332946.498927  7408125.794590 
-332952.411474  7408178.075635 
-332961.630760  7408167.287483 
-332972.466307  7408144.621365 
-332988.637166  7408121.255368 
-333004.008140  7408104.198289 
-333018.034978  7408096.479612 
-333042.179941  7408095.929706 
-333058.688895  7408097.089507 
-333077.465562  7408101.798700 
-333099.029455  7408106.037974 
-333139.947252  7408105.628045 
-333168.652381  7408106.637872 
-333203.938002  7408111.996954 
-333221.436503  7408117.206061 
-333243.726064  7408127.764253 
-333263.954068  7408141.341927 
-333282.705997  7408149.600512 
-333312.103809  7408160.978563 
-333336.941456  7408169.277142 
-333352.881420  7408179.535385 
-333361.911042  7408196.292515 
-333363.807675  7408216.279091 
-333361.647163  7408233.706106 
-333360.492690  7408253.412730 
-333358.488856  7408284.997320 
-333358.777474  7408316.101992 
-333364.657037  7408347.496615 
-333373.167147  7408365.773484 
-333381.429870  7408382.780571 
-333400.866236  7408402.167250 
-333420.121184  7408409.915923 
-333441.932464  7408415.414981 
-333474.933879  7408421.014022 
-333504.372923  7408426.323112 
-333535.048901  7408436.701335 
-333563.671567  7408448.829257 
-333588.426752  7408469.775669 
-333606.098424  7408486.362828 
-333624.256624  7408506.499379 
-333637.862904  7408522.036717 
-333660.276159  7408551.811617 
-333674.632847  7408569.878523 
-333687.999987  7408583.906120 
-333707.675493  7408604.802540 
-333724.811160  7408624.169223 
-333735.349843  7408643.975830 
-333744.099094  7408663.772439 
-333752.592711  7408684.578875 
-333764.153927  7408703.635611 
-333778.007594  7408720.952645 
-333794.194945  7408730.690977 
-333807.858949  7408739.159526 
-333828.688928  7408740.599280 
-333844.183595  7408741.749083 
-333869.837619  7408742.478958 
-333895.508135  7408742.698920 
-333933.613967  7408743.788733 
-333967.720377  7408743.098852 
-333999.146762  7408744.668583 
-334025.501715  7408746.948192 
-334058.923688  7408752.327271 
-334092.609540  7408756.956478 
-334116.944166  7408758.206264 
-334143.851617  7408755.946651 
-334174.313193  7408752.977159 
-334195.885332  7408751.677382 
-334224.037964  7408751.197464 
-334247.820093  7408756.476560 
-334272.863895  7408763.285394 
-334301.626748  7408778.462794 
-334318.490290  7408791.500561 
-334336.805168  7408811.867072 
-334345.158600  7408839.702304 
-334351.747338  7408892.253303 
-334354.617026  7408936.435735 
-334355.367433  7408989.676615 
-334353.041996  7409019.931433 
-334347.079971  7409059.234700 
-334333.960218  7409104.276985 
-334321.854752  7409149.319270 
-334311.349054  7409186.552892 
-334298.625120  7409217.207641 
-334273.548333  7409266.669169 
-334250.491872  7409289.905189 
-334232.877923  7409301.843144 
-334218.793361  7409315.580791 
-334200.503222  7409345.425678 
-334192.924936  7409367.801846 
-334186.146534  7409386.908573 
-334177.636424  7409405.875324 
-334169.967429  7409416.673474 
-334165.827822  7409430.771060 
-334164.961967  7409450.177735 
-334166.198902  7409456.496653 
-334170.701344  7409468.624576 
-334185.602283  7409479.302746 
-334200.297066  7409483.162085 
-334217.045160  7409481.752327 
-334239.433676  7409468.524593 
-334266.143217  7409454.556985 
-334287.748342  7409446.868302 
-334314.960903  7409433.660565 
-334342.627007  7409429.791227 
-334371.051764  7409426.431803 
-334393.638189  7409424.542126 
-334410.897550  7409423.632282 
-334430.449363  7409419.213039 
-334443.651578  7409417.023414 
-334470.385858  7409393.017526 
-334489.616068  7409371.011296 
-334501.812243  7409342.866117 
-334510.907836  7409320.000034 
-334512.919916  7409295.794180 
-334512.383911  7409272.578157 
-334509.060680  7409249.582096 
-334508.442213  7409234.684647 
-334510.074966  7409223.346589 
-334515.204122  7409217.597574 
-334525.899483  7409212.908377 
-334548.197291  7409215.147994 
-334568.606711  7409228.975625 
-334598.276649  7409255.011166 
-334617.704769  7409265.049446 
-334634.848682  7409275.807603 
-334660.634645  7409283.886220 
-334702.451281  7409286.825716 
-334739.790213  7409281.396646 
-334760.867579  7409278.077215 
-334795.097682  7409278.917071 
-334832.238705  7409292.914673 
-334859.500744  7409306.302380 
-334887.768822  7409320.209998 
-334917.100665  7409328.828521 
-334940.651899  7409332.347919 
-334980.522425  7409326.938845 
-335007.454614  7409322.159664 
-335040.258119  7409313.151207 
-335064.658716  7409307.592159 
-335099.416578  7409305.662489 
-335131.090350  7409308.502003 
-335163.506283  7409313.621126 
-335189.811758  7409320.939873 
-335217.337676  7409333.077794 
-335241.532117  7409348.205202 
-335256.111453  7409361.212974 
-335278.203105  7409384.648960 
-335289.706597  7409401.416088 
-335287.265712  7409420.452827 
-335287.216235  7409430.031186 
-335277.691838  7409454.936920 
-335264.918427  7409472.013995 
-335250.124689  7409487.561332 
-335242.942223  7409501.378965 
-335234.209464  7409522.255389 
-335225.740585  7409540.112330 
-335217.288199  7409555.189748 
-335213.428963  7409564.998068 
-335182.571568  7409595.832786 
-335172.090609  7409611.150162 
-335158.558544  7409626.457540 
-335150.864811  7409642.294827 
-335142.082575  7409671.739784 
-335134.091978  7409695.905644 
-335131.172812  7409719.841544 
-335125.952948  7409745.527145 
-335119.743537  7409768.183264 
-335110.730407  7409793.338955 
-335102.253281  7409813.965422 
-335087.624468  7409845.150080 
-335075.271615  7409877.354564 
-335069.053957  7409901.770382 
-335065.392630  7409922.426843 
-335065.235952  7409950.662007 
-335069.416791  7409974.637900 
-335077.704253  7409990.075256 
-335090.535388  7410008.802048 
-335108.437954  7410028.578660 
-335118.267461  7410040.986535 
-335138.239832  7410052.954485 
-335159.721263  7410066.952087 
-335180.971799  7410076.910382 
-335205.784707  7410086.128803 
-335231.100635  7410095.107265 
-335253.159302  7410096.996941 
-335279.778135  7410098.666655 
-335299.049576  7410099.786463 
-335329.733800  7410100.726302 
-335358.372959  7410105.435496 
-335374.337662  7410108.295006 
-335390.277625  7410116.213649 
-335398.111545  7410121.552735 
-335406.671132  7410132.950782 
-335409.145001  7410145.058709 
-335409.516082  7410169.274561 
-335404.840469  7410189.411111 
-335389.436510  7410223.365295 
-335378.337084  7410259.859044 
-335369.233245  7410300.902014 
-335359.453215  7410326.567618 
-335345.541824  7410366.570766 
-335329.131825  7410398.755253 
-335316.564570  7410425.150731 
-335311.130304  7410444.787368 
-335302.884073  7410468.693273 
-335297.928088  7410492.869132 
-335297.045742  7410516.065158 
-335301.968741  7410543.070533 
-335323.573866  7410581.773903 
-335341.435201  7410609.359178 
-335359.296537  7410635.684669 
-335379.186445  7410663.289940 
-335393.279253  7410683.546470 
-335403.314916  7410704.532876 
-335410.810740  7410725.499284 
-335431.607733  7410772.521230 
-335445.923190  7410799.586594 
-335459.224360  7410824.372348 
-335483.864097  7410864.605457 
-335500.744131  7410886.141768 
-335519.900125  7410907.938034 
-335540.293053  7410936.043220 
-335562.384705  7410978.785899 
-335569.616650  7411002.021918 
-335583.577518  7411046.484302 
-335592.277291  7411080.068550 
-335606.568009  7411110.403354 
-335624.940611  7411135.978973 
-335652.186157  7411164.384107 
-335671.614276  7411183.400850 
-335694.827416  7411206.236938 
-335718.296188  7411227.553287 
-335738.738594  7411247.339898 
-335761.646623  7411279.494390 
-335775.706446  7411305.289971 
-335792.792636  7411334.894900 
-335805.005303  7411375.557935 
-335822.751192  7411422.819840 
-335838.014965  7411461.983131 
-335846.450859  7411496.327248 
-335857.443084  7411527.911838 
-335870.002093  7411550.427981 
-335883.855761  7411568.914815 
-335909.905603  7411582.932414 
-335945.611782  7411592.720737 
-335962.071259  7411598.619727 
-335990.413553  7411610.637668 
-336010.888944  7411623.105532 
-336030.869561  7411633.313784 
-336039.973399  7411639.162782 
-336054.115685  7411650.090910 
-336067.194207  7411671.347269 
-336072.183176  7411686.504673 
-336085.022557  7411703.471766 
-336104.764034  7411711.410407 
-336123.515962  7411715.799655 
-336152.171614  7411716.979453 
-336170.469999  7411709.520730 
-336189.576516  7411695.013215 
-336203.595108  7411682.485361 
-336219.114514  7411674.006814 
-336227.748318  7411671.787194 
-336244.257271  7411667.597911 
-336259.718954  7411670.207464 
-336277.415365  7411681.155589 
-336294.080997  7411695.113198 
-336309.946745  7411715.889639 
-336319.759759  7411730.817082 
-336328.509010  7411753.813143 
-336335.782185  7411769.740415 
-336340.795893  7411780.108639 
-336349.371973  7411788.477206 
-336362.302063  7411790.066934 
-336394.792212  7411785.217764 
-336418.928929  7411778.048992 
-336441.548340  7411770.620265 
-336463.128725  7411765.951064 
-336482.919679  7411764.551304 
-336498.645241  7411765.911071 
-336524.991947  7411771.360138 
-336542.968730  7411777.769040 
-336565.695342  7411796.055908 
-336582.080602  7411814.552739 
-336597.632993  7411846.167324 
-336608.666450  7411870.433167 
-336614.884108  7411892.409403 
-336624.169363  7411910.616284 
-336626.643233  7411923.494079 
-336626.857635  7411929.293085 
-336626.824650  7411936.601833 
-336628.308971  7411942.410838 
-336634.872971  7411948.249838 
-336641.164845  7411957.108321 
-336646.186799  7411966.466718 
-336649.666709  7411979.854425 
-336651.464387  7412023.486951 
-336652.569382  7412052.991897 
-336648.809101  7412091.795250 
-336646.376463  7412118.760631 
-336646.516648  7412139.687047 
-336648.190633  7412159.113719 
-336646.549633  7412180.030136 
-336634.749277  7412204.425958 
-336613.548218  7412232.281186 
-336595.423003  7412253.357576 
-336581.132286  7412269.664783 
-336565.588141  7412282.932510 
-336546.745504  7412295.940282 
-336530.467445  7412303.908917 
-336497.441291  7412314.557093 
-336482.449644  7412319.006331 
-336471.012122  7412322.975651 
-336457.018268  7412331.464197 
-336440.162973  7412351.540758 
-336429.904662  7412372.657141 
-336420.355527  7412403.621837 
-336413.346231  7412433.576706 
-336409.618934  7412464.571397 
-336404.349593  7412501.855011 
-336400.383156  7412531.339960 
-336405.603020  7412551.036586 
-336421.955295  7412575.582382 
-336439.379581  7412589.559988 
-336466.402479  7412611.396247 
-336497.762894  7412628.223365 
-336529.609837  7412649.339748 
-336556.665719  7412665.127044 
-336579.911844  7412682.164125 
-336596.090948  7412691.582512 
-336616.599324  7412699.011240 
-336632.968092  7412706.899888 
-336649.988312  7412715.098484 
-336670.744074  7412723.287081 
-336682.635139  7412729.406033 
-336695.491012  7412744.363471 
-336715.554091  7412786.586239 
-336726.620533  7412803.793291 
-336743.772693  7412820.790380 
-336759.193144  7412830.208767 
-336785.762499  7412842.966581 
-336808.307694  7412847.645780 
-336831.850682  7412855.844375 
-336846.792852  7412860.723540 
-336860.217716  7412863.583050 
-336877.971850  7412864.442903 
-336896.954673  7412871.361717 
-336926.550395  7412885.909226 
-336950.093383  7412894.617734 
-336968.309307  7412903.046290 
-336992.643934  7412905.955792 
-337015.964274  7412909.125249 
-337049.955237  7412908.565345 
-337075.073255  7412907.455535 
-337104.751439  7412907.625506 
-337131.378518  7412908.285393 
-337155.441019  7412915.234203 
-337177.911998  7412933.771027 
-337217.032116  7412969.304941 
-337252.861988  7413004.308945 
-337279.884886  7413026.905074 
-337320.077014  7413051.850801 
-337341.607922  7413056.520002 
-337369.678091  7413072.567253 
-337391.909929  7413088.834466 
-337416.656867  7413109.650901 
-337428.498454  7413124.348383 
-337449.897423  7413153.723352 
-337463.767583  7413168.170877 
-337494.591993  7413191.546873 
-337520.353218  7413211.113521 
-337543.079829  7413229.660344 
-337564.528275  7413251.466609 
-337593.752917  7413286.940533 
-337623.950613  7413331.742858 
-337655.203827  7413368.996477 
-337681.690720  7413395.122002 
-337702.141372  7413412.379046 
-337723.128029  7413424.107037 
-337749.466490  7413432.575587 
-337787.976387  7413440.624208 
-337828.226239  7413455.481663 
-337856.840659  7413464.730079 
-337891.516059  7413477.537885 
-337914.786922  7413490.535659 
-337951.936191  7413515.211432 
-337975.190561  7413530.468818 
-338005.272811  7413549.305592 
-338029.755870  7413570.381982 
-338050.965175  7413588.658851 
-338064.868320  7413597.057412 
-338091.940695  7413610.325140 
-338116.728864  7413623.332912 
-338139.719355  7413639.350168 
-338160.145269  7413662.166260 
-338172.704278  7413684.432446 
-338177.404629  7413705.888771 
-338181.527745  7413740.702807 
-338185.436458  7413768.718008 
-338192.932282  7413789.434460 
-338209.309296  7413810.960773 
-338233.050194  7413829.767551 
-338254.811996  7413838.466061 
-338296.331768  7413852.573645 
-338325.218314  7413859.042537 
-338360.437965  7413864.801550 
-338376.913934  7413866.911189 
-338397.191415  7413870.310607 
-338414.417791  7413874.189942 
-338428.576569  7413882.348545 
-338440.649050  7413901.835207 
-338451.905155  7413930.390315 
-338456.877632  7413949.327072 
-338462.023280  7413981.631538 
-338465.956732  7414004.597604 
-338467.391576  7414020.994796 
-338465.231064  7414045.950521 
-338468.043029  7414068.926585 
-338468.463586  7414086.623554 
-338468.694481  7414110.889398 
-338466.591692  7414130.126103 
-338461.487275  7414155.201807 
-338459.318516  7414167.099769 
-338456.671476  7414183.057036 
-338456.564275  7414197.974481 
-338457.661024  7414207.322879 
-338461.808878  7414215.621458 
-338466.929787  7414220.370644 
-338478.647681  7414223.290144 
-338507.897061  7414227.299458 
-338521.371402  7414229.189134 
-338536.429019  7414236.877817 
-338555.321134  7414246.806116 
-338573.182469  7414254.974717 
-338589.229634  7414259.863880 
-338601.945322  7414261.263640 
-338612.838592  7414258.624092 
-338628.720833  7414245.576327 
-338642.120957  7414238.617519 
-338660.584268  7414230.598892 
-338682.890322  7414225.319797 
-338714.852712  7414221.210501 
-338735.187917  7414222.780232 
-338756.273528  7414222.820225 
-338794.173204  7414228.519249 
-338819.851967  7414230.788860 
-338846.800648  7414233.308428 
-338866.154552  7414238.167596 
-338887.495797  7414238.977457 
-338911.393373  7414240.757152 
-338930.227764  7414244.616491 
-338955.106642  7414243.616663 
-338979.482499  7414242.356878 
-338995.752313  7414243.716646 
-339012.772533  7414243.806630 
-339025.719115  7414242.916783 
-339037.832828  7414234.958146 
-339050.911349  7414221.180506 
-339060.204851  7414209.962427 
-339095.506965  7414182.057207 
-339108.865858  7414171.559005 
-339128.046591  7414157.971333 
-339149.750670  7414143.343838 
-339163.637322  7414133.855464 
-339175.973683  7414122.357433 
-339184.549763  7414116.208487 
-339201.974049  7414105.160379 
-339213.625972  7414101.760961 
-339237.193700  7414095.711997 
-339250.651548  7414095.072107 
-339269.922989  7414092.352573 
-339285.648551  7414089.673032 
-339303.839736  7414079.384794 
-339319.243695  7414069.116553 
-339329.081448  7414058.828315 
-339351.758582  7414040.811401 
-339368.300521  7414030.313200 
-339392.445484  7414021.124773 
-339415.567915  7414013.696046 
-339438.426466  7414009.296800 
-339466.587344  7414007.697074 
-339489.404664  7414009.846705 
-339510.935572  7414014.255950 
-339537.554405  7414017.435405 
-339564.428870  7414019.864989 
-339591.542477  7414025.064099 
-339612.059099  7414030.483170 
-339632.023223  7414044.470775 
-339646.421142  7414054.389076 
-339656.019754  7414061.497858 
-339669.856929  7414077.535111 
-339684.617682  7414107.469983 
-339694.043124  7414137.214888 
-339699.098063  7414161.180783 
-339701.390515  7414188.966024 
-339703.320133  7414205.383212 
-339703.938600  7414216.501307 
-339711.162299  7414229.069155 
-339720.876358  7414235.548045 
-339740.263246  7414244.206562 
-339766.247119  7414252.035221 
-339791.480585  7414261.393618 
-339803.487097  7414268.102468 
-339826.452849  7414279.250559 
-339853.319069  7414299.717053 
-339874.091324  7414321.003407 
-339905.905281  7414354.307702 
-339928.038165  7414385.182414 
-339947.647701  7414417.356903 
-339964.783368  7414456.370220 
-339973.903699  7414481.305949 
-339992.688613  7414506.151693 
-340014.013365  7414531.977269 
-340027.603153  7414545.494954 
-340060.917925  7414576.519639 
-340088.056270  7414599.505702 
-340117.734454  7414621.461941 
-340146.653985  7414644.438006 
-340187.769691  7414667.794005 
-340217.637539  7414683.431326 
-340261.540471  7414705.997461 
-340290.822836  7414717.215539 
-340307.727608  7414724.234337 
-340334.692783  7414738.691861 
-340359.901510  7414750.859776 
-340388.689101  7414761.297989 
-340426.448591  7414784.963935 
-340457.165800  7414803.250802 
-340493.927496  7414825.147052 
-340515.598591  7414837.015019 
-340543.479096  7414859.311200 
-340574.798280  7414890.725819 
-340593.261591  7414916.191457 
-340624.391112  7414963.503353 
-340646.779628  7414999.107254 
-340665.737712  7415025.082805 
-340684.728781  7415049.028703 
-340700.561544  7415061.086637 
-340724.723000  7415076.264038 
-340740.052743  7415088.062017 
-340751.795375  7415102.079616 
-340764.230691  7415122.926045 
-340778.653348  7415146.571995 
-340793.809920  7415172.497554 
-340808.966492  7415198.423113 
-340825.483692  7415216.290053 
-340851.846891  7415238.306281 
-340879.001729  7415257.812940 
-340910.312667  7415269.550929 
-340935.348223  7415275.149970 
-340966.939533  7415284.358393 
-340986.862426  7415293.436838 
-341003.445596  7415306.754557 
-341017.958962  7415323.081760 
-341023.879755  7415336.279499 
-341028.373951  7415363.084908 
-341030.320061  7415390.870149 
-341037.568498  7415420.994988 
-341045.155030  7415443.291169 
-341062.645285  7415464.957458 
-341080.473636  7415479.804915 
-341100.074926  7415494.682366 
-341120.690503  7415509.569816 
-341148.917351  7415524.537253 
-341177.276138  7415549.113043 
-341197.141307  7415563.230625 
-341214.878949  7415585.396828 
-341222.968502  7415608.212920 
-341225.161999  7415636.758030 
-341230.860144  7415668.882528 
-341237.951903  7415690.418839 
-341249.595580  7415713.274923 
-341263.416263  7415744.479578 
-341275.447514  7415777.693889 
-341279.991187  7415800.459989 
-341291.478186  7415835.933913 
-341301.629296  7415856.240435 
-341309.529185  7415874.257349 
-341321.247079  7415911.500969 
-341333.294822  7415942.685628 
-341346.431067  7415967.831320 
-341366.329222  7416000.125789 
-341382.821683  7416020.512297 
-341400.617049  7416037.889320 
-341420.201846  7416054.526470 
-341447.101051  7416074.033129 
-341468.516512  7416085.901096 
-341484.679124  7416091.140199 
-341508.964273  7416096.729241 
-341525.819568  7416108.037304 
-341539.912377  7416116.785806 
-341554.227833  7416128.823744 
-341570.035857  7416142.891334 
-341590.766881  7416148.190426 
-341607.275835  7416145.860825 
-341618.243322  7416140.691711 
-341625.706160  7416131.953208 
-341638.570280  7416116.705819 
-341656.695495  7416107.587381 
-341672.470534  7416103.228128 
-341692.310965  7416098.678907 
-341715.021084  7416087.080894 
-341727.085320  7416075.112944 
-341746.777319  7416040.778825 
-341764.556192  7416017.512810 
-341796.089778  7415989.877544 
-341819.352395  7415974.760133 
-341853.458805  7415965.071793 
-341882.188672  7415958.602901 
-341905.723414  7415963.432074 
-341931.550609  7415966.511546 
-341948.950155  7415974.800127 
-341969.376069  7415984.388484 
-341989.546349  7415994.466758 
-342015.456006  7416012.193721 
-342031.066120  7416021.212177 
-342058.286928  7416035.679698 
-342078.053142  7416036.669529 
-342108.308563  7416030.720548 
-342127.893360  7416025.911372 
-342154.908012  7416015.133218 
-342174.558780  7416005.524864 
-342201.326044  7415993.726885 
-342236.479726  7415981.279017 
-342275.401934  7415971.400709 
-342311.000912  7415963.742021 
-342331.632981  7415956.423274 
-342350.096291  7415939.986090 
-342365.013723  7415922.749042 
-342370.555190  7415904.642144 
-342375.906993  7415881.746066 
-342384.351134  7415854.580719 
-342395.104218  7415825.435711 
-342406.261368  7415805.129190 
-342428.146865  7415778.133814 
-342454.559541  7415754.217910 
-342484.328434  7415725.042908 
-342510.980251  7415702.396787 
-342538.869003  7415682.540188 
-342550.652867  7415672.841849 
-342574.204102  7415654.954913 
-342595.974151  7415637.287939 
-342624.679280  7415612.902116 
-342649.516926  7415593.265480 
-342675.665724  7415569.849491 
-342704.857380  7415546.983408 
-342737.100142  7415523.137492 
-342766.910266  7415511.889419 
-342797.446058  7415503.670827 
-342818.350253  7415495.092296 
-342840.615075  7415478.445148 
-342854.732622  7415464.477540 
-342867.613234  7415448.480280 
-342894.091881  7415418.515413 
-342919.341839  7415406.957393 
-342948.352079  7415398.968761 
-342970.179851  7415397.469018 
-342989.970805  7415396.949107 
-342978.170449  7415387.210775 
-342972.447565  7415377.812385 
-342960.020495  7415356.965956 
-342958.437219  7415341.548597 
-342953.885299  7415319.282411 
-342948.286109  7415300.035708 
-342935.644637  7415276.159797 
-342927.480869  7415258.902753 
-342914.080744  7415234.256975 
-342888.352504  7415181.196064 
-342876.725319  7415156.830237 
-342865.048657  7415115.807264 
-342857.726004  7415092.501256 
-342855.045979  7415062.686363 
-342849.694175  7415022.743205 
-342852.036105  7414997.027610 
-342857.313692  7414958.984127 
-342863.201501  7414934.068395 
-342873.212425  7414903.143692 
-342881.846229  7414860.091066 
-342884.534500  7414826.806767 
-342884.872595  7414799.301479 
-342880.452616  7414765.927196 
-342871.744596  7414752.449504 
-342859.985471  7414739.181777 
-342841.291266  7414733.152810 
-342819.092413  7414723.044541 
-342801.165108  7414716.265702 
-342778.949762  7414707.677173 
-342759.571120  7414695.329288 
-342741.050086  7414675.162743 
-342733.150197  7414657.405784 
-342731.599906  7414638.708987 
-342731.212333  7414607.914262 
-342728.837419  7414574.060061 
-342721.432304  7414556.813015 
-342711.998616  7414540.545801 
-342696.899768  7414530.527517 
-342677.504633  7414519.439417 
-342659.140277  7414507.101530 
-342645.591720  7414495.333546 
-342620.778812  7414470.547791 
-342566.617570  7414419.426548 
-342528.544723  7414380.103284 
-342448.069758  7414302.916505 
-342399.911771  7414258.924041 
-342369.598627  7414227.769377 
-342339.268991  7414198.134453 
-342315.965143  7414174.628480 
-342290.385335  7414151.102509 
-342267.947342  7414139.734457 
-342243.703424  7414131.365890 
-342225.751380  7414126.856663 
-342207.527210  7414123.867175 
-342194.390964  7414119.667894 
-342186.350890  7414113.258992 
-342173.560986  7414101.501006 
-342167.986534  7414087.293439 
-342157.612776  7414072.146034 
-342143.684892  7414055.988802 
-342126.969783  7414035.782263 
-342114.311819  7414019.625030 
-342102.156875  7414003.967712 
-342095.592875  7413988.830305 
-342090.290549  7413969.653590 
-342085.260348  7413947.207435 
-342084.023413  7413927.790761 
-342085.845830  7413900.555426 
-342087.173474  7413869.280783 
-342084.938745  7413840.785664 
-342082.951403  7413815.060071 
-342082.984388  7413797.153138 
-342087.594031  7413772.447370 
-342095.238287  7413751.530952 
-342103.905076  7413730.604537 
-342111.301944  7413706.918594 
-342120.496492  7413676.413819 
-342123.852707  7413642.629606 
-342128.981863  7413612.374789 
-342134.358405  7413582.879841 
-342142.019154  7413554.134765 
-342150.438555  7413527.669298 
-342156.062484  7413502.963530 
-342163.467599  7413478.257762 
-342166.287810  7413460.870740 
-342167.095941  7413431.615751 
-342162.832640  7413406.640029 
-342154.240067  7413387.213357 
-342149.465500  7413357.198498 
-342146.216485  7413331.972819 
-342146.249470  7413310.786448 
-342148.566661  7413291.879687 
-342150.380831  7413272.213055 
-342154.858535  7413246.207510 
-342158.330198  7413222.541564 
-342157.868409  7413194.046445 
-342157.926132  7413164.031586 
-342156.705690  7413137.046208 
-342156.235655  7413113.590226 
-342148.418229  7413085.844978 
-342143.115902  7413069.947702 
-342121.840627  7413048.731336 
-342102.593925  7413029.284667 
-342081.054770  7413012.857481 
-342063.820148  7412998.709904 
-342051.920838  7412985.582153 
-342044.078672  7412969.934833 
-342039.526753  7412962.366129 
-342035.989120  7412955.297340 
-342034.480060  7412948.238549 
-342041.093537  7412938.160276 
-342051.252893  7412932.871181 
-342066.236294  7412926.342300 
-342077.409936  7412920.303334 
-342083.767780  7412911.994757 
-342087.354891  7412891.068342 
-342085.095423  7412875.431020 
-342069.650233  7412859.263790 
-342052.415611  7412845.116213 
-342030.373437  7412829.198940 
-342007.061343  7412812.011884 
-341983.741003  7412796.344567 
-341956.371763  7412777.637772 
-341931.525870  7412764.739981 
-341915.058147  7412753.121971 
-341884.646049  7412731.385694 
-341867.930939  7412712.448938 
-341854.514322  7412692.252397 
-341845.418730  7412673.575596 
-341833.791544  7412645.820351 
-341825.710238  7412622.864283 
-341807.989089  7412600.138176 
-341792.304758  7412575.402413 
-341772.563282  7412544.607688 
-341754.833886  7412525.920888 
-341728.503672  7412493.346468 
-341703.690764  7412464.811356 
-341679.372629  7412439.305725 
-341648.721390  7412409.250873 
-341563.842938  7412339.272860 
-341468.846361  7412251.367917 
-341439.448549  7412229.631640 
-341412.087555  7412208.665231 
-341386.491255  7412188.958607 
-341363.179161  7412172.281464 
-341340.625721  7412153.834623 
-341319.853466  7412133.878042 
-341308.721054  7412114.441371 
-341292.286317  7412080.627163 
-341282.679458  7412062.710232 
-341273.592112  7412035.964813 
-341261.973173  7412005.430044 
-341245.274556  7411976.405015 
-341234.397777  7411956.718388 
-341218.977326  7411927.693359 
-341196.704257  7411894.878980 
-341179.741761  7411870.143217 
-341168.370209  7411845.657411 
-341154.186692  7411831.519833 
-341135.690397  7411814.342775 
-341107.826383  7411787.067447 
-341087.054128  7411769.890390 
-341062.488607  7411741.605235 
-341044.767457  7411719.139083 
-340989.798084  7411664.578429 
-340954.611418  7411621.405824 
-340937.896308  7411598.679716 
-340922.459364  7411576.973434 
-340904.993848  7411550.977887 
-340891.832864  7411534.310742 
-340866.756076  7411508.045241 
-340837.613897  7411485.809050 
-340803.655920  7411464.572688 
-340777.037087  7411447.895544 
-340750.937767  7411430.448533 
-340728.631713  7411414.781217 
-340706.845172  7411397.604159 
-340687.087203  7411379.667231 
-340671.130747  7411363.250043 
-340658.720170  7411350.122292 
-340654.184743  7411330.945577 
-340650.919236  7411308.999336 
-340656.279285  7411293.372013 
-340661.375456  7411278.754517 
-340680.193354  7411257.858096 
-340693.906836  7411249.549519 
-340717.021020  7411235.971845 
-340736.564587  7411230.702748 
-340758.911872  7411224.173866 
-340777.366936  7411217.674979 
-340786.264619  7411206.336921 
-340796.935242  7411194.498949 
-340799.475081  7411188.449985 
-340813.699828  7411176.112098 
-340825.129104  7411162.754386 
-340842.149324  7411147.896931 
-340858.905665  7411133.039476 
-340875.670252  7411117.932064 
-340887.355161  7411107.353876 
-340901.068642  7411092.486423 
-340914.015224  7411085.697586 
-340928.487359  7411074.109571 
-340951.865423  7411046.144361 
-340961.274372  7411031.276907 
-340967.632216  7411018.419110 
-340972.728387  7411001.272047 
-340974.773452  7410990.433903 
-340981.139542  7410973.286841 
-340985.955340  7410959.729163 
-340992.667772  7410948.551078 
-340995.867310  7410941.602268 
-341000.600646  7410851.987618 
-340996.320852  7410832.051033 
-340991.018526  7410815.643843 
-340980.636522  7410800.746395 
-340974.831175  7410786.868772 
-340972.307829  7410773.751019 
-340969.800975  7410755.834088 
-340969.817467  7410745.235904 
-340977.964743  7410723.559617 
-340992.709003  7410701.383415 
-341003.140485  7410682.726611 
-341008.995309  7410663.819849 
-341011.056867  7410645.413002 
-341010.067319  7410626.236287 
-341005.531892  7410611.098880 
-340995.405521  7410596.701346 
-340985.287396  7410578.524460 
-340974.658004  7410563.627012 
-340969.611311  7410549.499431 
-340967.079719  7410543.190512 
-340963.294699  7410532.842285 
-340963.129774  7410519.884504 
-340961.488774  7410508.746412 
-340967.038487  7410501.037733 
-340978.904813  7410487.190105 
-341001.845827  7410459.484850 
-341010.619816  7410442.497760 
-341010.858957  7410419.981617 
-341006.430731  7410396.635616 
-341001.936535  7410382.757993 
-340997.285661  7410361.361658 
-340991.727702  7410344.704511 
-340986.425376  7410327.797407 
-340981.139542  7410304.841339 
-340978.880075  7410287.934235 
-340964.704804  7410271.517047 
-340948.484468  7410264.428262 
-340930.738580  7410256.589604 
-340912.497918  7410245.461510 
-340897.803135  7410232.073804 
-340890.480482  7410213.397003 
-340885.169910  7410204.558517 
-340878.605910  7410183.112190 
-340875.579543  7410168.724655 
-340872.808810  7410159.896167 
-340863.952358  7410142.479150 
-340853.578600  7410128.591529 
-340848.762801  7410126.571875 
-340838.619938  7410123.522397 
-340838.619938  7410123.522397 
-340804.109462  7410135.840288 
-340783.048589  7410143.378996 
-340767.059148  7410149.158006 
-340752.083993  7410158.976325 
-340737.620105  7410163.745508 
-340721.375030  7410171.284216 
-340699.563750  7410174.033745 
-340691.952479  7410175.783446 
-340680.036676  7410173.503836 
-340658.744908  7410162.875657 
-340628.085423  7410143.658948 
-340611.625946  7410126.991803 
-340596.436390  7410109.064874 
-340586.062631  7410093.407556 
-340573.149034  7410077.250323 
-340562.519643  7410066.642141 
-340551.370739  7410057.033786 
-340542.761674  7410049.705042 
-340532.627057  7410042.886210 
-340528.569911  7410038.846902 
-340510.065370  7410032.507987 
-340490.546542  7410025.929114 
-340479.397638  7410023.139592 
-340473.567553  7410019.600198 
-340465.197629  7410018.570375 
-340460.126197  7410016.550721 
-340455.813418  7410017.800507 
-340452.506680  7410026.379037 
-340450.717248  7410032.927916 
-340448.177409  7410037.467138 
-340438.529319  7410044.515931 
-340417.006657  7410020.020126 
-340398.518608  7410003.852896 
-340385.101991  7409989.205405 
-340373.194434  7409976.827525 
-340364.841002  7409967.479126 
-340352.430425  7409956.111074 
-340341.133089  7409948.062452 
-340328.986391  7409943.453242 
-340319.132145  7409936.834375 
-340299.671041  7409922.856770 
-340282.725037  7409913.678342 
-340275.385892  7409911.618695 
-340264.228742  7409911.048792 
-340253.830245  7409910.488888 
-340243.233839  7409900.090669 
-340238.690165  7409895.521452 
-340236.455437  7409886.682966 
-340226.865071  7409878.554358 
-340223.104790  7409870.465744 
-340214.256584  7409864.366789 
-340210.001529  7409854.248522 
-340208.286313  7409842.900465 
-340206.587590  7409828.013016 
-340202.629399  7409810.586001 
-340192.280379  7409801.447566 
-340183.959933  7409792.329128 
-340174.089195  7409787.479959 
-340167.508703  7409785.170354 
-340156.895804  7409777.041746 
-340148.303231  7409772.452533 
-340140.741438  7409762.574225 
-340136.238996  7409751.196174 
-340130.986147  7409738.058424 
-340125.716806  7409727.180287 
-340115.343047  7409722.081161 
-340094.323406  7409715.902219 
-340081.640703  7409715.832231 
-340068.958000  7409717.022027 
-340055.252765  7409717.691913 
-340041.794916  7409720.891365 
-340026.819761  7409722.071162 
-340009.576893  7409721.461267 
-339995.409869  7409714.322490 
-339984.343427  7409697.105439 
-339976.822865  7409681.428124 
-339971.297891  7409671.059900 
-339966.300675  7409656.912324 
-339964.354564  7409642.024874 
-339953.048982  7409621.788340 
-339947.779641  7409610.660246 
-339942.774179  7409598.272368 
-339940.547696  7409587.674183 
-339935.022722  7409578.315786 
-339929.489501  7409569.457304 
-339922.430728  7409561.598650 
-339919.684733  7409553.510035 
-339918.200411  7409546.691203 
-339919.824919  7409527.794440 
-339922.653376  7409520.495691 
-339926.248733  7409512.707025 
-339925.572542  7409497.319660 
-339919.824919  7409487.751299 
-339915.009120  7409479.612693 
-339909.261497  7409464.445291 
-339905.921774  7409448.068097 
-339898.491920  7409429.821222 
-339893.338026  7409412.364212 
-339885.479368  7409386.048720 
-339877.084705  7409363.002668 
-339866.183188  7409336.147268 
-339858.002928  7409316.630611 
-339852.420230  7409290.845028 
-339848.643456  7409262.039962 
-339868.953922  7409259.720359 
-339885.767986  7409252.571583 
-339899.530945  7409245.132858 
-339919.231190  7409227.165935 
-339937.735732  7409202.620140 
-339948.604264  7409179.774053 
-339957.172097  7409159.917454 
-339962.515655  7409131.462328 
-339967.916936  7409098.208025 
-339972.114267  7409083.370566 
-339975.082910  7409065.483630 
-339980.005910  7409028.689932 
-339979.206026  7409006.733693 
-339978.356664  7408989.316677 
-339970.992780  7408964.011011 
-339964.610197  7408942.244740 
-339956.974188  7408919.458643 
-339952.108912  7408897.962325 
-339952.282083  7408880.055392 
-339960.379881  7408856.419441 
-339968.411710  7408838.582496 
-339971.182443  7408814.636598 
-339972.188483  7408788.911004 
-339971.941097  7408762.165586 
-339973.771760  7408730.640985 
-339984.632045  7408709.554597 
-340007.655521  7408688.838146 
-340025.244731  7408679.429757 
-340039.428248  7408675.310463 
-340041.019771  7408668.751587 
-340045.101655  7408660.772953 
-340048.647534  7408655.273895 
-340051.657408  7408648.365079 
-340050.775061  7408640.736385 
-340046.874594  7408635.067356 
-340042.083534  7408631.337995 
-340038.009896  7408626.728785 
-340035.700952  7408619.100091 
-340030.027545  7408608.111974 
-340026.654837  7408604.382612 
-340021.336018  7408603.142825 
-340011.588973  7408600.663249 
-340006.261908  7408595.874070 
-340003.070617  7408589.845103 
-340002.188271  7408582.576348 
-340000.415331  7408574.237776 
-339996.688035  7408568.748716 
-339989.777693  7408558.990388 
-339987.650166  7408555.450994 
-339986.759573  7408546.582513 
-339987.650166  7408539.663698 
-339990.305452  7408530.975186 
-340005.734150  7408506.679348 
-340015.662611  7408481.503660 
-340023.108958  7408461.107154 
-340025.945661  7408455.618094 
-340030.200716  7408451.888733 
-340044.565650  7408443.560160 
-340053.611765  7408436.821314 
-340058.930584  7408428.132802 
-340060.348935  7408420.864047 
-340059.639759  7408399.577694 
-340057.330815  7408376.351672 
-340057.512232  7408368.722979 
-340060.348935  7408363.403890 
-340067.440694  7408355.785195 
-340069.922809  7408350.636077 
-340071.167990  7408347.806562 
-340070.458814  7408344.077200 
-340068.331287  7408341.597625 
-340063.721644  7408332.379204 
-340062.121875  7408327.769994 
-340061.412699  7408320.671210 
-340060.348935  7408303.294186 
-340058.221408  7408294.255734 
-340055.557875  7408285.037313 
-340053.430348  7408280.958012 
-340044.747067  7408266.240533 
-340032.864249  7408245.494087 
-340027.190842  7408236.975546 
-340022.754370  7408230.236700 
-340020.453671  7408225.097580 
-340012.652737  7408201.511621 
-340008.389436  7408189.103746 
-340002.716029  7408169.237149 
-339997.578628  7408158.778940 
-339993.323573  7408152.749973 
-339985.341221  7408146.900975 
-339954.310655  7408128.634104 
-339947.573485  7408122.425167 
-339942.963842  7408114.986442 
-339940.836315  7408108.597536 
-339934.272315  7408083.591819 
-339929.662672  7408067.994491 
-339920.971145  7408031.820687 
-339919.025034  7408022.062359 
-339917.252095  7408013.913754 
-339916.006914  7408004.515364 
-339915.652326  7407995.466914 
-339915.825497  7407962.662533 
-339914.588562  7407949.894720 
-339911.042683  7407934.997272 
-339880.523384  7408001.065955 
-339864.072153  7407998.106462 
-339830.914060  7408023.382133 
-339783.506480  7408042.338885 
-339739.290191  7408048.657803 
-339610.236682  7408099.919022 
-339579.758613  7408108.677522 
-339562.672423  7408107.887657 
-339554.277760  7408104.978156 
-339600.258743  7408019.822742 
-339646.239725  7407912.531120 
-339683.702350  7407825.685996 
-339717.767529  7407742.240290 
-339751.824462  7407634.948668 
-339785.889641  7407525.957337 
-339816.540880  7407379.502423 
-339831.565512  7407299.006212 
-339844.495602  7407178.736813 
-339847.348798  7407144.512675 
-339820.127990  7407136.734007 
-339805.911489  7407138.103773 
-339789.410781  7407140.463368 
-339776.975465  7407141.103259 
-339763.303215  7407138.443714 
-339748.468246  7407125.425944 
-339733.402383  7407109.888606 
-339714.007248  7407096.570887 
-339699.889701  7407087.852380 
-339678.672150  7407079.313843 
-339671.225804  7407062.086794 
-339660.983985  7407046.079536 
-339650.676197  7407037.151065 
-339635.329962  7407023.873339 
-339618.985932  7407010.085701 
-339598.848637  7406993.998457 
-339579.181377  7406982.190479 
-339562.804363  7406971.432322 
-339541.405394  7406955.325081 
-339527.889822  7406936.518302 
-339519.693069  7406919.281255 
-339512.197245  7406910.302793 
-339503.645904  7406900.194524 
-339487.499785  7406891.206064 
-339478.931951  7406885.567030 
-339476.524052  7406873.179152 
-339435.573270  7406833.405965 
-339432.464441  7406813.949297 
-339422.164899  7406777.265581 
-339413.786729  7406752.699789 
-339397.879750  7406718.985564 
-339386.904017  7406699.958823 
-339369.174621  7406672.023608 
-339357.745345  7406647.437819 
-339329.576222  7406596.946468 
-339299.914530  7406570.411013 
-339282.069687  7406553.833853 
-339270.500225  7406543.875559 
-339251.929714  7406523.759004 
-339246.718096  7406511.591089 
-339241.564202  7406494.384036 
-339240.244805  7406473.177668 
-339240.434468  7406453.501039 
-339237.655489  7406426.725625 
-339236.517509  7406413.587876 
-339230.712162  7406384.262899 
-339220.610530  7406354.388016 
-339209.981139  7406325.273003 
-339200.027938  7406306.246262 
-339197.059295  7406298.147650 
-339191.385888  7406281.940426 
-339188.895527  7406251.635617 
-339188.054411  7406233.208773 
-339184.013758  7406205.663491 
-339177.441512  7406177.338343 
-339171.900045  7406147.763409 
-339160.949051  7406100.221553 
-339155.894112  7406071.906403 
-339147.078891  7406032.783104 
-339124.096646  7406000.868571 
-339110.696522  7405997.679117 
-339101.757608  7405997.679117 
-339094.740065  7405998.958898 
-339036.999958  7406045.990842 
-338970.634294  7406070.436654 
-338869.337597  7406045.990842 
-338809.964736  7406026.784132 
-338762.804543  7405998.838918 
-338715.652596  7405981.371910 
-338678.156985  7405958.225875 
-338682.486256  7405934.050016 
-338679.954664  7405911.313911 
-338679.105302  7405897.166334 
-338674.190548  7405883.238720 
-338666.801926  7405864.731890 
-338660.534791  7405858.093027 
-338658.102152  7405849.484501 
-338657.953720  7405839.646187 
-338658.852559  7405828.048173 
-338657.970213  7405816.170208 
-338651.472183  7405808.271561 
-338647.208882  7405804.192260 
-338635.672405  7405792.704227 
-338627.426174  7405782.256017 
-338616.706075  7405766.238761 
-338610.785281  7405751.781237 
-338602.860653  7405735.793976 
-338597.665528  7405724.375931 
-338592.016860  7405708.158709 
-338577.214876  7405694.621028 
-338570.180841  7405688.732037 
-338559.337048  7405683.812880 
-338536.857823  7405675.984221 
-338522.954678  7405672.794767 
-338510.362684  7405665.336044 
-338501.794851  7405660.186926 
-338484.741646  7405643.839727 
-338479.035254  7405632.921597 
-338474.293671  7405626.312729 
-338470.822008  7405619.453904 
-338442.017925  7405588.589190 
-338426.003745  7405570.492290 
-338413.733353  7405556.974606 
-338406.996183  7405547.306262 
-338402.312324  7405535.898216 
-338389.629621  7405514.051958 
-338375.355396  7405498.494623 
-338366.284542  7405493.595462 
-338356.677684  7405490.955914 
-338341.051077  7405482.957284 
-338326.174876  7405475.718524 
-338309.814355  7405465.440285 
-338283.607834  7405428.546604 
-338273.720603  7405409.839809 
-338270.149985  7405408.200090 
-338258.432092  7405390.903052 
-338243.984696  7405368.526885 
-338231.499902  7405351.479805 
-338218.000823  7405334.922641 
-338205.713939  7405322.414784 
-338197.673864  7405312.686450 
-338190.219272  7405303.058099 
-338177.025303  7405281.711756 
-338166.371173  7405259.885494 
-338151.429003  7405236.499500 
-338141.764421  7405216.442936 
-338134.821094  7405202.995239 
-338128.834331  7405194.346721 
-338121.775557  7405190.727341 
-338108.103307  7405189.057627 
-338093.367293  7405191.917137 
-338087.768102  7405193.616846 
-338077.872625  7405194.516692 
-338064.233360  7405190.067454 
-338049.596301  7405184.098476 
-338031.207206  7405173.540285 
-338024.643207  7405171.190687 
-338013.057253  7405164.751790 
-338001.900103  7405164.371855 
-337994.544465  7405164.541826 
-337985.720998  7405160.402535 
-337981.218556  7405154.793496 
-337975.487426  7405146.144977 
-337973.038295  7405138.806234 
-337968.865703  7405126.638318 
-337966.688698  7405117.529879 
-337970.399501  7405103.442292 
-337977.887079  7405091.164395 
-337984.261415  7405086.385213 
-338000.325072  7405079.536387 
-338032.073060  7405067.968368 
-338047.938808  7405064.049039 
-338067.342189  7405059.939743 
-338085.170540  7405058.170046 
-338110.445237  7405054.650649 
-338139.447230  7405051.711153 
-338147.528536  7405050.341387 
-338161.192540  7405047.791824 
-338180.785584  7405046.612026 
-338197.245060  7405043.472564 
-338226.634626  7405037.603569 
-338243.292012  7405033.684241 
-338268.764619  7405027.605282 
-338309.327827  7405019.966590 
-338334.800434  7405012.717832 
-338357.527045  7405008.988471 
-338388.879214  7405002.129646 
-338396.911043  7404999.980014 
-338410.039042  7404995.270821 
-338416.899906  7404993.711088 
-338409.098972  7404985.572482 
-338401.842289  7404979.013605 
-338366.259804  7404957.587275 
-338354.162583  7404947.738962 
-338334.000549  7404930.521911 
-338308.948501  7404914.054732 
-338281.447321  7404898.377418 
-338242.591083  7404879.330680 
-338215.840310  7404869.322394 
-338182.542031  7404862.483566 
-338168.729595  7404859.904008 
-338158.207404  7404854.934859 
-338149.326214  7404848.355986 
-338143.710531  7404841.017243 
-338136.519818  7404828.789337 
-338130.096004  7404814.041863 
-338102.017589  7404777.238168 
-338090.695514  7404757.661521 
-338084.799459  7404742.804066 
-338076.305842  7404723.927299 
-338070.830344  7404712.589241 
-338066.633013  7404703.400815 
-338054.370868  7404682.644371 
-338044.458899  7404666.367159 
-338030.539262  7404642.311279 
-338010.014393  7404607.397260 
-337999.632389  7404589.470331 
-337988.310314  7404566.584251 
-337974.390677  7404544.408049 
-337965.897060  7404529.310635 
-337939.946172  7404488.267666 
-337902.912350  7404428.347929 
-337884.976798  7404396.743343 
-337870.826266  7404372.677465 
-337855.727418  7404347.911707 
-337839.210218  7404321.726193 
-337823.171299  7404294.590841 
-337812.080119  7404276.433951 
-337805.243994  7404263.216215 
-337799.817974  7404251.898154 
-337792.734462  7404242.699729 
-337785.659196  7404235.151022 
-337777.404719  7404230.191872 
-337758.999133  7404224.772800 
-337733.996561  7404221.463367 
-337710.164955  7404222.413204 
-337698.133704  7404224.062921 
-337673.131133  7404229.481993 
-337660.629847  7404233.021387 
-337641.284190  7404240.100174 
-337620.281041  7404248.598719 
-337605.660474  7404257.557184 
-337587.254887  7404269.585124 
-337570.506792  7404277.613749 
-337564.140702  7404279.973345 
-337551.631170  7404282.802860 
-337539.369026  7404285.392416 
-337534.883076  7404285.162456 
-337529.457056  7404283.502740 
-337522.851826  7404281.153142 
-337497.140078  7404268.175365 
-337491.474918  7404263.926093 
-337484.399652  7404259.676821 
-337417.638169  7404197.637448 
-337402.061039  7404180.660356 
-337381.536171  7404158.244196 
-337357.242775  7404132.768559 
-337320.670743  7404094.085186 
-337289.772116  7404056.571611 
-337277.262584  7404039.584521 
-337264.522158  7404025.436944 
-337250.371626  7404015.758602 
-337230.085899  7404008.689813 
-337208.612714  7404007.270056 
-337184.080178  7404008.919774 
-337164.973662  7404012.229207 
-337143.269583  7404017.648278 
-337130.760051  7404023.077349 
-337123.940418  7404027.326621 
-337102.533203  7403993.292450 
-337061.120633  7403917.935358 
-337003.479481  7403951.209659 
-336890.291719  7404014.188871 
-336863.631655  7404032.395752 
-336790.636021  7404073.218760 
-336764.338792  7404078.897787 
-336735.435754  7404085.016739 
-336700.785092  7404086.176540 
-336678.709933  7404089.965891 
-336655.084482  7404097.964521 
-336630.403514  7404116.621325 
-336614.108962  7404137.047826 
-336593.147044  7404177.150957 
-336571.492442  7404204.936198 
-336561.217639  7404216.744175 
-336547.223785  7404230.821764 
-336521.610993  7404238.800397 
-336494.266492  7404244.919349 
-336464.192489  7404244.559411 
-336432.609425  7404239.580264 
-336399.104990  7404239.200329 
-336375.083720  7404240.380127 
-336364.083249  7404242.689731 
-336343.533642  7404249.168621 
-336317.681709  7404265.545816 
-336297.313519  7404295.350711 
-336283.228957  7404315.197311 
-336270.422561  7404345.922048 
-336262.102114  7404312.637749 
-336208.443892  7404340.522973 
-336151.388222  7404372.117561 
-336137.930373  7404343.362487 
-336082.886784  7404315.837201 
-336019.506255  7404306.238845 
-335888.176786  7404290.321572 
-335817.514835  7404277.353793 
-335730.088298  7404262.496338 
-335639.544685  7404248.888669 
-335605.891818  7404243.089662 
-335572.807941  7404232.081548 
-335548.761932  7404217.304079 
-335548.745440  7404217.314078 
-335468.344691  7404202.616595 
-335423.303779  7404295.690652 
-335317.356208  7404380.446134 
-335218.475656  7404389.864521 
-335129.004054  7404375.736941 
-335010.522212  7404275.864048 
-334987.746123  7404213.284768 
-334903.980912  7404223.842959 
-334903.972666  7404223.812964 
-334903.947927  7404223.842959 
-334900.476264  7404177.790847 
-334903.857218  7404130.598931 
-334784.311613  7404192.278366 
-334720.881606  7404220.653505 
-334627.460059  7404254.037787 
-334525.602619  7404265.715787 
-334448.690025  7404241.949858 
-334417.156439  7404228.962082 
-334360.356403  7404239.010361 
-334313.682737  7404235.660935 
-334206.844573  7404269.015222 
-334101.630916  7404320.766357 
-334079.959822  7404329.144922 
-334047.560382  7404315.467265 
-334047.535643  7404315.507258 
-333976.106793  7404294.530851 
-333919.768545  7404284.042648 
-333908.075390  7404279.043504 
-333899.688974  7404270.744925 
-333888.053542  7404260.756636 
-333879.700111  7404249.038643 
-333837.941199  7404223.982935 
-333784.530363  7404203.956366 
-333674.377214  7404344.182346 
-Region 1
-309
-336731.683719  7401133.962228 
-336700.438751  7401143.370616 
-336636.266584  7401131.822594 
-336560.112644  7401115.985307 
-336526.311344  7401109.146478 
-336449.769831  7401085.420543 
-336430.382943  7401079.671527 
-336325.977417  7401053.615990 
-336219.312424  7401025.530801 
-336018.673386  7400980.858453 
-335984.896825  7400976.219248 
-335954.459988  7400971.630034 
-335903.333358  7400983.537994 
-335855.595928  7400990.176857 
-335831.723091  7400994.146177 
-335803.916801  7400998.205482 
-335700.022541  7401017.782128 
-335561.840454  7401046.657182 
-335495.837624  7401037.718713 
-335470.290801  7401032.279645 
-335482.891042  7401078.571716 
-335499.639136  7401130.622800 
-335525.449838  7401190.002629 
-335555.342424  7401264.669839 
-335593.266839  7401358.003851 
-335603.088100  7401380.769952 
-335672.521362  7401553.330394 
-335623.283119  7401573.077011 
-335496.522061  7401625.518029 
-335479.336916  7401617.959323 
-335466.967570  7401608.330973 
-335345.962382  7401691.516724 
-335334.961910  7401700.455193 
-335242.158831  7401759.575066 
-335176.156001  7401802.197765 
-335121.079426  7401837.441728 
-335046.220144  7401888.822927 
-335172.626614  7402004.713076 
-335221.320606  7402042.096673 
-335299.527857  7402188.171651 
-335333.469343  7402249.651120 
-335363.930919  7402293.653583 
-335314.783384  7402304.251768 
-335191.320819  7402326.877892 
-335135.246450  7402341.135450 
-335075.733404  7402353.433343 
-335019.659035  7402365.731237 
-335001.459604  7402367.700899 
-334969.002440  7402374.089805 
-334891.776490  7402389.337193 
-334793.704069  7402411.423410 
-334665.211303  7402435.339314 
-334607.965970  7402447.867168 
-334482.046028  7402473.942701 
-334377.640502  7402474.472610 
-334416.752374  7402546.400290 
-334440.996292  7402584.113830 
-334457.727894  7402613.128860 
-334505.440585  7402703.143441 
-334573.636912  7402794.947716 
-334605.285945  7402826.602294 
-334622.429859  7402862.286182 
-334648.372500  7402926.965103 
-334672.665896  7402986.454913 
-334674.710961  7402993.943630 
-334691.120960  7403041.125548 
-334701.049422  7403070.810463 
-334719.133406  7403109.983753 
-334745.364665  7403167.883835 
-334585.313575  7403210.856475 
-334545.772899  7403205.097461 
-334497.928268  7403171.743174 
-334445.977015  7403218.635142 
-334395.229712  7403230.473114 
-334370.425050  7403207.896982 
-334267.660524  7403234.542417 
-334100.022901  7403279.534711 
-334031.348292  7403215.435690 
-333944.358805  7403279.524712 
-333845.354560  7403296.121869 
-333788.125719  7403323.597163 
-333795.926654  7403394.704983 
-333870.200453  7403447.825884 
-333862.820077  7403475.371166 
-333850.516700  7403498.977122 
-333832.333762  7403504.396194 
-333800.849653  7403543.249539 
-333766.413394  7403570.304904 
-333725.503844  7403592.701068 
-333702.422644  7403599.919832 
-333685.361193  7403602.849330 
-333655.847934  7403612.067751 
-333614.690996  7403629.464771 
-333610.551389  7403631.814368 
-333602.280419  7403637.273433 
-333597.786224  7403641.912639 
-333585.590048  7403662.269152 
-333592.879716  7403577.303705 
-333496.176170  7403582.502815 
-333488.507175  7403626.375300 
-333475.717271  7403686.375023 
-333461.946066  7403760.152385 
-333454.079162  7403829.020589 
-333464.898217  7403873.283007 
-333484.136673  7403893.249587 
-333523.965967  7403929.193430 
-333544.383634  7403961.247939 
-333553.751352  7404001.810991 
-333555.887126  7404015.478650 
-333559.771100  7404042.434033 
-333563.432427  7404056.451632 
-333566.590733  7404072.278921 
-333580.238245  7404082.817116 
-333592.154048  7404090.245843 
-333607.236404  7404104.853341 
-333617.667886  7404114.581675 
-333629.311563  7404127.709426 
-333635.182880  7404137.507748 
-333635.100417  7404155.404682 
-333631.876141  7404167.242654 
-333626.779970  7404180.260424 
-333624.231885  7404186.389375 
-333616.958710  7404206.285967 
-333607.079725  7404221.293396 
-333606.890062  7404240.320137 
-333603.649294  7404273.094523 
-333599.361254  7404311.207994 
-333597.530590  7404337.503490 
-333593.357998  7404360.389570 
-333578.795154  7404397.883148 
-333674.377214  7404344.182346 
-333784.530363  7404203.956366 
-333837.941199  7404223.982935 
-333879.700111  7404249.038643 
-333888.053542  7404260.756636 
-333899.688974  7404270.744925 
-333908.075390  7404279.043504 
-333919.768545  7404284.042648 
-333976.106793  7404294.530851 
-334047.535643  7404315.507258 
-334047.560382  7404315.467265 
-334079.959822  7404329.144922 
-334101.630916  7404320.766357 
-334206.844573  7404269.015222 
-334313.682737  7404235.660935 
-334360.356403  7404239.010361 
-334417.156439  7404228.962082 
-334448.690025  7404241.949858 
-334525.602619  7404265.715787 
-334627.460059  7404254.037787 
-334720.881606  7404220.653505 
-334784.311613  7404192.278366 
-334903.857218  7404130.598931 
-334900.476264  7404177.790847 
-334903.947927  7404223.842959 
-334903.972666  7404223.812964 
-334903.980912  7404223.842959 
-334987.746123  7404213.284768 
-335010.522212  7404275.864048 
-335129.004054  7404375.736941 
-335218.475656  7404389.864521 
-335317.356208  7404380.446134 
-335423.303779  7404295.690652 
-335468.344691  7404202.616595 
-335548.745440  7404217.314078 
-335548.761932  7404217.304079 
-335572.807941  7404232.081548 
-335605.891818  7404243.089662 
-335639.544685  7404248.888669 
-335730.088298  7404262.496338 
-335817.514835  7404277.353793 
-335888.176786  7404290.321572 
-336019.506255  7404306.238845 
-336082.886784  7404315.837201 
-336137.930373  7404343.362487 
-336151.388222  7404372.117561 
-336208.443892  7404340.522973 
-336262.102114  7404312.637749 
-336270.422561  7404345.922048 
-336283.228957  7404315.197311 
-336297.313519  7404295.350711 
-336317.681709  7404265.545816 
-336343.533642  7404249.168621 
-336364.083249  7404242.689731 
-336375.083720  7404240.380127 
-336399.104990  7404239.200329 
-336432.609425  7404239.580264 
-336464.192489  7404244.559411 
-336494.266492  7404244.919349 
-336521.610993  7404238.800397 
-336547.223785  7404230.821764 
-336561.217639  7404216.744175 
-336571.492442  7404204.936198 
-336593.147044  7404177.150957 
-336614.108962  7404137.047826 
-336630.403514  7404116.621325 
-336655.084482  7404097.964521 
-336678.709933  7404089.965891 
-336700.785092  7404086.176540 
-336735.435754  7404085.016739 
-336764.338792  7404078.897787 
-336790.636021  7404073.218760 
-336863.631655  7404032.395752 
-336890.291719  7404014.188871 
-337003.479481  7403951.209659 
-337061.120633  7403917.935358 
-337113.566660  7403886.580729 
-337122.686991  7403878.582099 
-337131.436242  7403869.833598 
-337146.798969  7403860.325226 
-337193.118047  7403823.161592 
-337213.882056  7403806.924374 
-337264.241786  7403772.430282 
-337271.696379  7403768.960876 
-337299.700578  7403755.933108 
-337360.582499  7403736.176492 
-337433.718318  7403712.450556 
-337475.980251  7403715.200085 
-337601.042585  7403775.399773 
-337630.580583  7403667.568244 
-337649.200572  7403615.967083 
-337664.563299  7403561.206463 
-337706.660307  7403575.983932 
-337771.657097  7403509.505319 
-337799.669542  7403482.999859 
-337909.657766  7403366.019896 
-338038.290718  7403234.742383 
-338135.051989  7403129.120475 
-338150.620872  7403101.005291 
-338160.763736  7403082.698427 
-338172.390921  7403057.542736 
-338173.743303  7403053.073501 
-338191.068634  7402980.745890 
-338193.633211  7402916.906825 
-338180.562936  7402861.376337 
-338168.383253  7402805.975827 
-338163.740625  7402794.227839 
-338222.758898  7402744.796306 
-338304.421320  7402672.208740 
-338291.301567  7402662.410418 
-338275.716191  7402648.882736 
-338265.919669  7402639.444352 
-338249.254037  7402631.455721 
-338236.332194  7402629.316087 
-338219.633577  7402624.346938 
-338204.749130  7402615.368476 
-338184.389187  7402597.251580 
-338139.537938  7402567.276714 
-338115.813533  7402554.678872 
-338108.218754  7402548.929857 
-337976.122386  7402452.076447 
-337867.255649  7402373.799855 
-337823.154807  7402345.094772 
-337775.301931  7402310.550689 
-337738.276355  7402284.445160 
-337708.309553  7402276.966441 
-337644.096155  7402261.299125 
-337615.811584  7402248.141379 
-337600.110760  7402221.335970 
-337590.635841  7402205.748640 
-337570.045004  7402185.612090 
-337548.134769  7402170.004763 
-337518.407107  7402149.008360 
-337502.599083  7402132.201238 
-337485.092335  7402106.805589 
-337477.390356  7402093.597851 
-337459.759915  7402057.594018 
-337452.313569  7402042.376625 
-337442.385107  7402022.340057 
-337428.135620  7402002.513453 
-337397.954416  7401954.021759 
-337366.552770  7401901.220803 
-337358.883775  7401892.032377 
-337350.019077  7401880.874288 
-337335.612912  7401852.469154 
-337322.385959  7401831.392764 
-337313.323351  7401801.777837 
-337306.008944  7401774.712473 
-337300.871543  7401757.245465 
-337292.031584  7401729.910147 
-337286.605564  7401715.472620 
-337279.695222  7401700.025268 
-337270.055379  7401674.179693 
-337250.586028  7401620.738847 
-337227.991356  7401575.346623 
-337202.856845  7401529.424489 
-337182.200038  7401492.130877 
-337167.043466  7401462.455960 
-337158.178768  7401437.640210 
-337146.477366  7401416.833774 
-337133.943096  7401402.826174 
-337100.941681  7401379.280207 
-337078.297531  7401361.143314 
-337053.171267  7401337.677333 
-337034.518293  7401323.849702 
-337017.382626  7401314.611284 
-336977.668779  7401301.343557 
-336945.104414  7401285.116336 
-336905.052472  7401256.961159 
-336883.678242  7401238.324351 
-336859.970329  7401224.466725 
-336838.225019  7401216.678059 
-336816.957990  7401211.668917 
-336802.733242  7401189.822659 
-336797.364946  7401170.096038 
-336782.051695  7401154.298744 
-336764.652149  7401143.780546 
-336756.884199  7401134.612116 
-336731.683719  7401133.962228 
-Region 1
-218
-323727.130602  7387729.138353 
-323701.732211  7387697.403789 
-323676.828595  7387671.488228 
-323660.064008  7387657.000709 
-323620.416131  7387628.505590 
-323495.898048  7387530.882312 
-323455.747151  7387495.798322 
-323437.209624  7387476.241672 
-323429.590107  7387467.353194 
-323421.970590  7387457.964802 
-323401.660124  7387422.420891 
-323393.793220  7387405.933715 
-323387.946643  7387392.725977 
-323382.883457  7387380.048149 
-323382.520623  7387378.798363 
-323380.343618  7387373.199322 
-323374.257900  7387350.123275 
-323314.992240  7387360.871434 
-323272.507660  7387370.139846 
-323251.397309  7387370.599767 
-323237.667335  7387370.309817 
-323221.339799  7387369.259997 
-323198.250353  7387366.920397 
-323178.673801  7387362.561144 
-323159.352883  7387357.951934 
-323132.907221  7387346.743853 
-323115.639614  7387322.617986 
-323054.683477  7387247.190906 
-322960.948573  7387136.449875 
-322954.598976  7387130.860832 
-322943.161454  7387124.241966 
-322931.979565  7387118.133012 
-322921.036817  7387113.543798 
-322907.570722  7387108.194715 
-322894.863281  7387105.615157 
-322871.971745  7387103.535513 
-322855.190665  7387102.725652 
-322837.131420  7387105.215225 
-322818.808296  7387109.494492 
-322776.323715  7387130.930820 
-322653.669281  7387188.161017 
-322503.043632  7387263.818058 
-322434.583425  7387305.980836 
-322415.229522  7387327.217198 
-322403.033347  7387325.667464 
-322363.096852  7387324.557654 
-322338.432376  7387323.737794 
-322323.943748  7387317.358887 
-322315.812965  7387312.019801 
-322301.827358  7387303.371283 
-322277.690641  7387284.304549 
-322246.429180  7387262.428296 
-322251.236733  7387283.734646 
-322250.956361  7387306.540740 
-322195.508706  7387309.190286 
-321962.033178  7387323.567823 
-321931.761265  7387326.027402 
-321880.642881  7387329.946731 
-321872.000832  7387328.666950 
-321865.131721  7387325.857431 
-321857.512204  7387321.528173 
-321854.972365  7387317.978781 
-321852.176893  7387310.110128 
-321850.659587  7387298.962038 
-321849.397913  7387286.794122 
-321847.888853  7387276.135948 
-321846.371547  7387266.757554 
-321844.845994  7387261.178510 
-321840.533215  7387255.339510 
-321834.942271  7387249.240555 
-321828.337040  7387244.411382 
-321820.973156  7387238.822339 
-321813.848413  7387232.973341 
-321809.527388  7387230.933691 
-321801.907871  7387225.344648 
-321678.387582  7387137.839637 
-321598.580562  7387098.356400 
-321543.207123  7387086.988347 
-321565.908996  7386955.840812 
-321626.221927  7386921.266734 
-321667.791176  7386817.204559 
-321670.586648  7386806.806340 
-321677.233110  7386786.299852 
-321685.380386  7386768.832844 
-321690.987823  7386758.204665 
-321698.368199  7386748.836270 
-321711.356012  7386736.198434 
-321728.673097  7386722.050858 
-321737.323393  7386713.962243 
-321746.237568  7386700.044627 
-321750.566839  7386691.686059 
-321790.833183  7386610.429977 
-321797.463153  7386594.482709 
-321801.800670  7386578.775399 
-321808.950152  7386551.170128 
-321813.032036  7386538.512296 
-321822.226583  7386502.288501 
-321844.450175  7386404.245295 
-322027.970038  7386004.003853 
-322062.323835  7385914.719146 
-322097.048712  7385906.460561 
-322109.046978  7385866.187459 
-322109.747907  7385838.232248 
-322104.338380  7385809.067244 
-322097.964044  7385784.491453 
-322088.893190  7385746.477965 
-322408.022316  7385220.378081 
-322371.928565  7385215.968836 
-322220.560755  7385007.084616 
-322125.201344  7384858.750024 
-322034.385605  7384701.326989 
-321976.859900  7384633.218656 
-321954.042580  7384565.580242 
-321941.747450  7384561.300975 
-321898.446493  7384550.382845 
-321867.737530  7384529.656395 
-321851.096637  7384497.921831 
-321889.136499  7384481.294679 
-321947.701229  7384445.590795 
-321989.361186  7384430.293415 
-322030.023349  7384421.074994 
-322071.551367  7384407.907250 
-322111.306445  7384395.289411 
-322155.596950  7384379.062190 
-322189.530189  7384367.514169 
-322237.696422  7384352.616720 
-322274.491103  7384349.557244 
-322295.956042  7384351.596895 
-322328.660592  7384359.775494 
-322367.632278  7384363.044934 
-322460.493082  7384351.596895 
-322522.686153  7384344.338138 
-322610.731158  7384319.912322 
-322708.836564  7384281.078974 
-322738.811612  7384262.722118 
-322787.480866  7384251.524037 
-322840.990656  7384241.535747 
-322910.539365  7384221.019262 
-322931.303374  7384234.286989 
-322988.796094  7384222.379029 
-323078.960380  7384203.872199 
-323161.859737  7384177.386736 
-323322.793174  7384149.761468 
-323441.052368  7384131.334624 
-323589.789630  7384105.998964 
-323606.249106  7384104.849161 
-323699.472744  7384089.841731 
-323728.169627  7384084.122711 
-323928.148966  7384066.155788 
-323987.744475  7384344.708075 
-324045.080517  7384462.247941 
-324180.838212  7384658.984242 
-324316.892771  7384827.445386 
-324455.866496  7385012.963609 
-324553.378174  7385115.766000 
-324995.252443  7385632.497488 
-325168.885075  7385841.411703 
-325450.724746  7386158.887323 
-325597.309742  7386279.966583 
-325644.890493  7386305.162267 
-325862.953816  7386380.389381 
-326054.076704  7386441.938838 
-326212.808398  7386526.164411 
-326342.389666  7386633.066100 
-326410.421069  7386736.738342 
-326475.186965  7386824.303343 
-326512.962947  7387026.518705 
-326481.528316  7387032.777633 
-326401.952190  7387046.335311 
-326390.176573  7387049.974687 
-326310.542723  7387062.332571 
-326235.411316  7387071.391019 
-326155.010567  7387087.268299 
-326117.036675  7387087.368282 
-326041.146614  7387092.547395 
-325963.376413  7387100.136095 
-325835.089803  7387112.014061 
-325757.336094  7387115.973382 
-325703.752088  7387125.411766 
-325629.651459  7387134.710173 
-325534.992977  7387147.537976 
-325409.666764  7387155.786563 
-325319.403523  7387180.682298 
-325286.888636  7387223.424977 
-325252.526593  7387271.306775 
-325210.190445  7387338.915194 
-325195.693571  7387356.132245 
-325181.609009  7387381.217948 
-325173.123638  7387399.614797 
-325165.965910  7387417.691701 
-325155.691106  7387457.444891 
-325144.253584  7387500.617496 
-325108.811285  7387483.740387 
-325082.208945  7387475.031879 
-325064.108469  7387473.022223 
-325042.602299  7387479.691081 
-325033.292305  7387486.429926 
-324986.643378  7387526.703028 
-324898.639605  7387604.879637 
-324813.150931  7387695.954037 
-324783.736627  7387717.190399 
-324767.631738  7387727.578620 
-324742.381780  7387739.126642 
-324708.992792  7387750.804641 
-324678.069427  7387757.873431 
-324644.779394  7387760.163038 
-324616.519562  7387759.333181 
-324583.922212  7387757.043573 
-324557.542520  7387746.535373 
-324516.740171  7387725.878911 
-324455.041873  7387687.525481 
-324410.850323  7387676.807317 
-324362.684090  7387672.218103 
-324319.729474  7387674.917640 
-324226.992365  7387682.176397 
-324142.649918  7387689.815088 
-323934.168714  7387709.631694 
-323727.130602  7387729.138353 
-Region 1
-515
-353400.210283  7401391.408130 
-353400.820504  7401364.912668 
-353402.362549  7401361.523249 
-353405.133283  7401357.823882 
-353409.140951  7401353.204674 
-353414.072197  7401349.195360 
-353423.621332  7401345.196045 
-353443.956537  7401341.496679 
-353524.992245  7401338.727153 
-353543.480294  7401337.187417 
-353557.037097  7401333.488051 
-353567.823167  7401328.868842 
-353580.151282  7401319.620426 
-353605.722843  7401296.824331 
-353647.316830  7401263.240084 
-353658.408011  7401256.151298 
-353667.965392  7401252.761878 
-353679.675040  7401250.292301 
-353720.963916  7401247.212829 
-353731.436629  7401243.203516 
-353753.289141  7401231.935446 
-353767.489150  7401224.106787 
-353783.198219  7401216.398107 
-353797.678600  7401212.088845 
-353821.097895  7401205.929900 
-353831.883965  7401201.300693 
-353849.135079  7401192.062276 
-353880.874821  7401176.654915 
-353891.660891  7401171.725759 
-353908.912005  7401169.256182 
-353944.040948  7401169.566129 
-353958.826439  7401168.336340 
-353973.620177  7401163.407184 
-353985.016468  7401156.008451 
-353999.505095  7401141.840878 
-354019.840300  7401120.884468 
-354027.542279  7401111.026157 
-354037.709882  7401092.229376 
-354050.648218  7401063.574285 
-354055.719650  7401051.656326 
-354061.739398  7401035.539087 
-354063.586554  7401027.530459 
-354066.670644  7401007.803838 
-354070.983422  7400980.698480 
-354073.143935  7400969.600381 
-354075.914668  7400960.361964 
-354082.693070  7400939.715500 
-354084.622688  7400935.226269 
-354090.708406  7400918.759090 
-354100.257541  7400899.352414 
-354111.653832  7400875.316531 
-354124.905525  7400846.351493 
-354131.989037  7400823.245451 
-354137.538750  7400804.448670 
-354141.233061  7400785.661888 
-354150.171975  7400745.298802 
-354155.721689  7400722.802656 
-354160.034467  7400696.617141 
-354163.728779  7400675.350784 
-354167.117979  7400664.262683 
-354169.888713  7400656.863950 
-354179.132737  7400643.616220 
-354182.835295  7400637.767221 
-354185.606028  7400630.368489 
-354191.056787  7400612.751506 
-354193.613118  7400604.482923 
-354194.544942  7400595.244505 
-354196.392098  7400569.358939 
-354197.315676  7400559.190681 
-354198.857721  7400552.721789 
-354201.933565  7400543.483371 
-354209.948901  7400526.836223 
-354214.880147  7400514.208386 
-354216.727303  7400503.730181 
-354216.727303  7400492.952027 
-354214.880147  7400481.543981 
-354214.880147  7400467.686355 
-354214.880147  7400457.828043 
-354217.650881  7400443.340525 
-354219.498036  7400434.712003 
-354222.582127  7400427.933166 
-354225.352860  7400420.234483 
-354225.971327  7400414.685433 
-354225.047750  7400408.526488 
-354221.963659  7400398.358230 
-354217.955991  7400390.349602 
-354211.490946  7400382.330975 
-354199.368987  7400369.863111 
-354195.616952  7400360.114781 
-354189.366310  7400337.118720 
-354184.121707  7400304.124371 
-354181.367466  7400285.127625 
-354176.617637  7400243.884690 
-354171.125647  7400202.391797 
-354166.870592  7400172.396935 
-354163.126804  7400158.149376 
-354156.373141  7400138.152801 
-354145.125282  7400104.158624 
-354138.627252  7400082.412349 
-354131.873590  7400061.665902 
-354120.881364  7400033.170783 
-354115.438852  7400026.181980 
-354109.880892  7400020.922881 
-354097.379607  7400007.925108 
-354087.137788  7399995.677206 
-354078.883311  7399982.179518 
-354072.888302  7399965.182429 
-354069.886674  7399947.935383 
-354069.383654  7399927.688851 
-354072.632669  7399901.693304 
-354076.887724  7399879.947029 
-354079.138945  7399864.699641 
-354078.611186  7399853.731520 
-354075.881683  7399840.703751 
-354072.632669  7399832.955079 
-354064.386438  7399823.956620 
-354057.385388  7399811.958675 
-354051.637765  7399798.211030 
-354045.139736  7399783.963470 
-354034.889671  7399765.466639 
-354020.640184  7399748.219593 
-354005.392904  7399735.471777 
-353981.899393  7399718.224731 
-353968.400313  7399708.226443 
-353947.652797  7399689.979569 
-353929.156502  7399675.732009 
-353923.408879  7399665.733722 
-353919.904231  7399657.485135 
-353915.657422  7399635.488903 
-353911.410613  7399612.742799 
-353907.163804  7399589.496781 
-353899.907121  7399573.249564 
-353892.658685  7399564.251105 
-353882.416866  7399557.002347 
-353860.168536  7399547.503974 
-353843.420442  7399537.755643 
-353835.322643  7399529.377079 
-353821.675131  7399516.259326 
-353808.670826  7399499.512194 
-353799.921575  7399484.014849 
-353793.679178  7399457.269430 
-353792.178364  7399436.023069 
-353792.788585  7399412.987015 
-353793.176158  7399404.028550 
-353797.175580  7399376.283302 
-353802.172796  7399344.288783 
-353804.176630  7399318.543193 
-353806.675238  7399291.047902 
-353811.177680  7399269.801542 
-353818.920890  7399244.305909 
-353827.670141  7399216.810618 
-353835.916372  7399189.565285 
-353840.921834  7399173.318068 
-353848.063069  7399159.250478 
-353852.664466  7399150.072050 
-353868.167380  7399119.827231 
-353882.161233  7399094.331598 
-353896.814785  7399070.935606 
-353910.660206  7399050.589091 
-353920.654638  7399035.841617 
-353936.050350  7398991.429224 
-353944.906802  7398957.355061 
-353947.652797  7398944.107330 
-353949.656631  7398926.610327 
-353951.157445  7398898.115208 
-353953.153033  7398872.869532 
-353954.917726  7398865.230841 
-353955.651641  7398859.871759 
-353958.900655  7398851.873129 
-353966.149092  7398840.875013 
-353982.897187  7398817.379037 
-353989.395216  7398804.131307 
-353993.394638  7398790.883576 
-353997.146673  7398773.636530 
-354001.146095  7398736.392910 
-354001.896502  7398712.147063 
-354001.146095  7398692.400445 
-353999.307186  7398669.034448 
-353999.397894  7398656.406611 
-354001.393482  7398645.908409 
-354004.898130  7398637.159907 
-354013.144361  7398625.911834 
-354019.395004  7398611.164360 
-354021.646224  7398599.666330 
-354021.390591  7398577.920055 
-354020.145410  7398554.174122 
-354021.390591  7398533.427676 
-354024.392219  7398512.681229 
-354027.888621  7398493.434526 
-354028.894661  7398478.687052 
-354026.396053  7398464.439493 
-354022.891405  7398454.441205 
-354018.891983  7398446.442576 
-354005.648537  7398433.194845 
-353980.645966  7398409.448912 
-353960.401469  7398382.953451 
-353951.899606  7398364.956533 
-353947.900184  7398350.708974 
-353946.407616  7398339.460901 
-353948.114586  7398321.703942 
-353954.150827  7398303.217109 
-353963.155710  7398279.721133 
-353975.401363  7398253.975543 
-353985.395795  7398232.479226 
-353992.644231  7398207.233550 
-353991.893824  7398181.487960 
-353989.395216  7398159.241770 
-353986.896609  7398150.493269 
-353979.895559  7398134.745966 
-353972.152348  7398113.749563 
-353969.901127  7398101.501661 
-353967.897293  7398082.754872 
-353968.152926  7398065.007912 
-353970.898921  7398044.011508 
-353973.653162  7398031.013735 
-353978.402991  7398017.016132 
-353980.901599  7398003.768402 
-353979.648172  7397987.271227 
-353974.403569  7397969.024353 
-353966.899499  7397951.277393 
-353959.403676  7397936.279962 
-353956.649435  7397925.781760 
-353954.901234  7397917.783130 
-353956.154661  7397901.785870 
-353964.153504  7397862.542592 
-353972.647122  7397826.548758 
-353975.896137  7397797.303767 
-353977.396951  7397769.558520 
-353976.399157  7397735.564343 
-353977.454674  7397728.715516 
-353994.507879  7397725.326096 
-354007.066889  7397762.509727 
-354010.456089  7397823.299314 
-354010.983848  7397898.856372 
-354015.197672  7398017.726011 
-354023.913938  7398117.698886 
-354050.846127  7398162.911142 
-354069.070297  7398198.265086 
-354098.542325  7398240.707816 
-354132.673474  7398258.164826 
-354153.998226  7398259.334625 
-354219.110464  7398259.074670 
-354277.889596  7398258.964689 
-354359.230415  7398260.214475 
-354425.901189  7398257.304973 
-354465.169740  7398233.569039 
-354496.917728  7398216.112029 
-354554.847498  7398182.777739 
-354620.710142  7398146.273992 
-354698.472097  7398109.760246 
-354783.746368  7398077.855711 
-354813.193658  7398066.067730 
-354832.176481  7398056.959291 
-354862.737012  7398040.722072 
-354935.740892  7398084.374595 
-354998.420491  7398116.919020 
-355125.478413  7398187.816876 
-355231.425984  7397925.551799 
-355228.383125  7397828.158482 
-355227.731673  7397804.282572 
-355227.756411  7397804.252577 
-355301.032417  7397795.654050 
-355366.903307  7397781.376495 
-355417.526917  7397773.327874 
-355449.266659  7397767.728833 
-355527.803760  7397759.070316 
-355527.770775  7397759.050320 
-355587.506470  7397746.452478 
-355652.313596  7397737.593995 
-355714.333497  7397724.756194 
-355746.922600  7397714.497951 
-355776.930634  7397700.740308 
-355790.396728  7397690.772015 
-355834.843912  7397658.237588 
-355893.557074  7397613.795201 
-355951.750723  7397570.282654 
-356036.662160  7397487.656807 
-356046.104095  7397479.008288 
-356070.488199  7397455.892248 
-356089.116434  7397438.235272 
-356165.031233  7397405.880814 
-356089.116434  7397438.235272 
-356165.031233  7397405.880814 
-356232.073088  7397377.295711 
-356300.813667  7397335.902801 
-356357.052960  7397300.748823 
-356399.240676  7397271.063907 
-356419.551142  7397249.977519 
-356446.854411  7397225.311744 
-356496.628660  7397264.055108 
-356504.512056  7397263.635180 
-356511.158518  7397259.415902 
-356514.795106  7397251.387278 
-356519.990231  7397240.599126 
-356525.375020  7397235.100068 
-356533.538788  7397232.410528 
-356549.058194  7397230.560845 
-356565.055882  7397231.490686 
-356584.088182  7397233.960263 
-356603.565779  7397242.488802 
-356619.777868  7397248.207822 
-356631.891581  7397255.906504 
-356647.848037  7397261.875481 
-356658.724816  7397266.534683 
-356692.748763  7397269.414190 
-356710.742038  7397273.893423 
-356727.696289  7397280.882225 
-356741.607680  7397287.591076 
-356751.701066  7397294.759848 
-356779.037321  7397305.138071 
-356789.683204  7397308.027576 
-356801.838148  7397312.696776 
-356814.776484  7397314.846408 
-356827.970453  7397316.246168 
-356835.573478  7397318.855721 
-356845.691603  7397323.244969 
-356854.317160  7397324.604736 
-356868.022396  7397326.004496 
-356881.191626  7397330.943650 
-356888.209168  7397340.601996 
-356892.926012  7397351.750086 
-356897.956213  7397356.589258 
-356903.745067  7397362.708209 
-356913.846699  7397368.367240 
-356921.622895  7397378.535498 
-356929.159950  7397387.443972 
-356934.932311  7397394.312796 
-356940.440793  7397402.951316 
-356954.566586  7397412.939605 
-356966.457651  7397418.108720 
-356977.845695  7397423.017879 
-356991.006679  7397428.206990 
-356999.055001  7397436.365593 
-357006.913658  7397438.215276 
-357021.905306  7397438.375248 
-357034.662224  7397433.206134 
-357046.173962  7397426.017365 
-357059.648303  7397424.897557 
-357067.473976  7397430.526593 
-357072.710333  7397440.174940 
-357083.273754  7397451.383020 
-357089.334734  7397454.722448 
-357103.501758  7397460.931385 
-357116.407109  7397467.120325 
-357126.995269  7397475.558879 
-357139.851143  7397485.277214 
-357157.275428  7397496.815238 
-357172.712372  7397502.774217 
-357188.413195  7397507.983325 
-357202.596712  7397513.182435 
-357218.800555  7397519.151412 
-357235.507418  7397525.640301 
-357250.193955  7397530.839410 
-357258.242276  7397538.488100 
-357269.374687  7397543.907172 
-357276.944727  7397548.776338 
-357287.598857  7397550.905973 
-357300.768087  7397555.585171 
-357305.179821  7397559.634478 
-357358.483456  7397489.766446 
-357393.389750  7397609.405952 
-357360.041993  7397645.209819 
-357353.609933  7397659.317403 
-357355.696230  7397668.885764 
-357362.779742  7397676.664432 
-357215.262922  7398052.630032 
-357200.213551  7398185.747230 
-357201.582425  7398233.219099 
-357191.909597  7398268.283093 
-357182.277999  7398292.278982 
-357171.920734  7398312.845460 
-357158.133036  7398332.642069 
-357144.741157  7398350.529005 
-357120.983767  7398376.694523 
-357017.782190  7398499.293523 
-356968.576932  7398531.178061 
-356926.150075  7398576.070371 
-356901.287690  7398607.265028 
-356885.603359  7398627.821507 
-356872.557822  7398650.667594 
-356861.812984  7398671.614006 
-356853.319366  7398695.999829 
-356849.839457  7398708.187741 
-356852.148402  7398724.534941 
-356855.323200  7398746.371200 
-356871.197194  7398797.612423 
-356879.179546  7398827.447313 
-356883.335646  7398843.384583 
-356893.503248  7398868.720243 
-356906.243675  7398890.796462 
-356919.256227  7398910.353112 
-356927.024176  7398921.791153 
-356932.433703  7398939.508118 
-356937.109316  7398954.435561 
-356937.942185  7398972.862405 
-356935.476562  7398990.989300 
-356933.761346  7399009.636106 
-356935.872381  7399027.573033 
-356941.051014  7399043.010389 
-356943.648577  7399063.216928 
-356947.004793  7399083.183508 
-356945.602933  7399096.031307 
-356942.180748  7399108.609152 
-356930.108266  7399131.805179 
-356927.147869  7399137.704169 
-356910.177127  7399157.200829 
-356892.002434  7399170.628529 
-356872.285697  7399185.805929 
-356850.796020  7399199.953506 
-356831.318423  7399216.900603 
-356814.388911  7399232.617911 
-356802.588555  7399243.845988 
-356788.198883  7399259.833249 
-356765.678427  7399275.740524 
-356746.951237  7399293.447491 
-356729.444490  7399315.713677 
-356718.312078  7399336.780069 
-356706.635416  7399360.875941 
-356697.160497  7399393.560343 
-356691.899401  7399411.417284 
-356684.700442  7399444.631595 
-356679.365131  7399470.057240 
-356670.953976  7399498.212417 
-356669.189282  7399520.128663 
-356668.917157  7399523.668057 
-356664.126097  7399545.814263 
-356653.381258  7399578.238709 
-356646.982183  7399600.624875 
-356626.803657  7399644.047437 
-356610.195748  7399678.431547 
-356599.516879  7399704.297116 
-356586.520820  7399745.580045 
-356581.589574  7399769.685916 
-356575.305946  7399788.282730 
-356570.185037  7399817.487728 
-356562.342872  7399839.104025 
-356554.253319  7399860.460367 
-356543.863069  7399882.796541 
-356537.760858  7399908.202189 
-356528.624035  7399932.578014 
-356522.579548  7399952.944525 
-356514.127161  7399984.889054 
-356506.045855  7400005.485526 
-356485.677665  7400034.530550 
-356467.667898  7400056.536781 
-356450.202381  7400077.003275 
-356433.470779  7400097.039843 
-356425.719322  7400109.317740 
-356412.451137  7400140.702364 
-356408.410484  7400168.917531 
-356404.798635  7400194.093219 
-356403.347299  7400212.240110 
-356397.979002  7400240.435281 
-356392.421043  7400263.081402 
-356379.235320  7400286.917319 
-356370.659240  7400304.724269 
-356348.509865  7400337.868591 
-356337.855735  7400358.105125 
-356327.778841  7400374.392335 
-356313.067565  7400414.495466 
-356311.698691  7400440.491013 
-356308.763033  7400476.574832 
-356308.622847  7400511.908780 
-356314.065359  7400547.272722 
-356321.536444  7400585.156233 
-356330.021816  7400621.530003 
-356340.791393  7400657.663813 
-356349.771538  7400698.586804 
-356358.281648  7400728.901611 
-356369.092456  7400755.437066 
-356376.629511  7400775.663601 
-356403.033942  7400810.757590 
-356416.244403  7400834.603505 
-356426.816071  7400857.349609 
-356438.129899  7400884.904889 
-356447.662542  7400913.709955 
-356465.441415  7400975.609352 
-356471.378701  7400998.455439 
-356477.447927  7401019.821779 
-356484.267560  7401027.920392 
-356492.093233  7401039.558398 
-356497.337836  7401061.534634 
-356501.015654  7401093.349184 
-356471.057098  7401095.528811 
-356449.493205  7401093.189212 
-356422.594001  7401092.089400 
-356392.643691  7401093.759114 
-356374.576200  7401092.499330 
-356142.675702  7401107.746718 
-355914.807610  7401134.702101 
-355875.423613  7401138.321481 
-355763.497524  7401149.569554 
-355718.778215  7401154.298744 
-355552.657899  7401170.745927 
-355478.656225  7401173.895388 
-355353.692846  7401188.592870 
-355169.933842  7401203.300351 
-355061.875236  7401219.677546 
-354955.639046  7401235.564824 
-354839.787752  7401250.642242 
-354723.985935  7401267.009438 
-354654.033160  7401277.627619 
-354578.646120  7401280.797076 
-354543.731579  7401283.976532 
-354495.317959  7401288.735716 
-354447.687731  7401293.524896 
-354415.980974  7401296.844328 
-354406.440085  7401297.464221 
-354399.298849  7401303.813134 
-354264.209099  7401307.322533 
-354118.786821  7401318.460625 
-354002.506723  7401333.967969 
-353786.529696  7401356.164167 
-353556.097027  7401378.870277 
-353400.210283  7401391.408130 
-Region 1
-245
-344339.268541  7391424.175426 
-344338.691304  7391418.866336 
-344321.316496  7391388.441547 
-344306.836115  7391360.096402 
-344291.803237  7391330.831415 
-344272.638997  7391296.097365 
-344251.454430  7391256.474152 
-344228.513417  7391212.961605 
-344214.280423  7391182.106890 
-344207.155679  7391172.618516 
-344202.537790  7391164.879841 
-344184.214666  7391137.814477 
-344174.368666  7391120.917372 
-344162.551818  7391099.740999 
-344145.003839  7391069.996094 
-344120.141454  7391033.392364 
-344116.974901  7391026.273583 
-344080.584285  7390971.682934 
-344047.360222  7390980.391443 
-344028.377399  7390987.510223 
-344004.661240  7390992.659341 
-343968.328347  7391005.297176 
-343928.837149  7391016.355282 
-343826.427210  7391048.609757 
-343794.374112  7391057.928161 
-343768.060390  7391064.677005 
-343741.655959  7391073.215543 
-343710.848042  7391075.585137 
-343684.781707  7391066.896625 
-343671.595984  7391056.728367 
-343654.773673  7391049.489607 
-343619.380851  7391029.043109 
-343576.450975  7391006.806918 
-343566.588483  7391003.997399 
-343557.682554  7390998.978259 
-343526.899375  7390982.851021 
-343499.142562  7390983.950833 
-343437.444265  7390999.768123 
-343408.961784  7391033.782297 
-343373.362806  7391080.464301 
-343339.635723  7391127.716207 
-343317.519332  7391155.361472 
-343282.769716  7391190.905383 
-343256.827075  7391203.183280 
-343211.687208  7391219.330514 
-343161.929452  7391237.497403 
-343064.780609  7391314.114279 
-342971.581710  7391382.822510 
-342888.649369  7391443.642092 
-342883.916032  7391447.591415 
-342864.166310  7391465.758304 
-342828.699272  7391490.654039 
-342812.223303  7391514.969874 
-342768.221416  7391525.878006 
-342747.102820  7391532.316903 
-342627.400536  7391563.001647 
-342477.888128  7391601.765007 
-342316.039359  7391641.988117 
-342167.532991  7391680.431532 
-342024.733015  7391717.365206 
-341884.794481  7391742.980818 
-341733.146299  7391770.296139 
-341619.298839  7391797.421493 
-341566.572440  7391810.609234 
-341513.582162  7391822.747155 
-341459.742522  7391838.884390 
-341392.337833  7391855.461551 
-341213.452352  7391901.733625 
-341113.219418  7391926.309415 
-341114.876910  7391946.275995 
-341119.618493  7391981.869898 
-341128.862518  7392071.784497 
-341160.470320  7392061.576245 
-341216.915768  7392201.412293 
-341279.966448  7392352.756369 
-341367.912498  7392566.179811 
-341395.710541  7392635.917866 
-341418.643309  7392686.329231 
-341372.761281  7392736.960558 
-341288.905362  7392823.975653 
-341232.938195  7392879.106210 
-341193.183117  7392919.689258 
-341148.851381  7392950.893913 
-340997.805174  7393027.290827 
-340970.106085  7393032.809882 
-340909.191179  7393058.125545 
-340793.702719  7393122.994434 
-340739.904310  7393151.469556 
-340560.969352  7393251.682391 
-340517.618917  7393270.919096 
-340270.809234  7393407.775654 
-340234.418618  7393440.999963 
-340173.503712  7393536.723566 
-340111.582766  7393633.656962 
-340075.414799  7393698.095924 
-340045.489228  7393738.718966 
-340020.832998  7393761.385083 
-340000.003019  7393776.762449 
-339915.330723  7393820.904888 
-339901.798659  7393848.930088 
-339829.306045  7393935.785210 
-339809.416137  7393955.591818 
-339808.203941  7393973.528745 
-339825.323116  7394072.121857 
-339836.397803  7394115.384447 
-339882.527218  7394296.453431 
-339885.767986  7394319.769437 
-339888.002715  7394326.288321 
-339916.419226  7394340.695853 
-339957.370007  7394357.912904 
-340052.506770  7394400.105676 
-340062.748588  7394404.414938 
-340054.972393  7394426.481159 
-340102.157325  7394422.371862 
-340146.703463  7394418.242570 
-340193.896641  7394414.143272 
-340239.193186  7394411.163782 
-340285.256630  7394404.754880 
-340333.967114  7394401.795387 
-340399.838005  7394393.676778 
-340479.010065  7394386.847947 
-340510.419958  7394382.378713 
-340552.154131  7394378.809324 
-340619.369157  7394367.001347 
-340642.541065  7394347.144748 
-340683.813450  7394318.649629 
-340736.778989  7394281.645967 
-340750.500717  7394272.967454 
-340818.301225  7394231.484560 
-340867.811594  7394201.689663 
-340894.809753  7394191.191462 
-340924.471445  7394179.943388 
-341218.169195  7394102.026735 
-341278.943915  7394088.289088 
-341313.116295  7394081.630228 
-341353.382639  7394073.481624 
-341376.166975  7394068.282515 
-341398.192657  7394063.833277 
-341405.218445  7394141.509972 
-341458.992115  7394131.151746 
-341527.188443  7394041.217151 
-341577.276048  7394084.289773 
-341629.631366  7394138.400504 
-341678.952072  7394186.422278 
-341736.106696  7394240.962936 
-341741.178128  7394242.822618 
-341752.186846  7394247.391835 
-341765.108689  7394251.201182 
-341789.047497  7394253.490790 
-341807.667486  7394252.350985 
-341823.640435  7394250.061378 
-341841.138936  7394243.202553 
-341855.602824  7394234.823988 
-341872.738492  7394214.627447 
-341883.714225  7394163.186259 
-341895.737229  7394110.985200 
-341952.751668  7394121.943323 
-342018.622558  7394134.641148 
-342085.276840  7394149.718565 
-342117.816467  7394156.067478 
-342159.080605  7394160.026800 
-342172.571438  7394157.647207 
-342254.308076  7394137.810605 
-342317.004168  7394110.825228 
-342354.466794  7393989.206060 
-342418.548252  7393825.454109 
-342447.022486  7393739.228879 
-342479.240510  7393657.312910 
-342495.163981  7393605.641761 
-342496.071066  7393593.673811 
-342511.095699  7393540.672889 
-342730.940208  7393625.968279 
-342743.688880  7393640.745748 
-342783.221310  7393521.686142 
-342783.237802  7393517.736818 
-342786.387863  7393484.512509 
-342774.917356  7393462.576267 
-342843.344578  7393459.986710 
-342876.568641  7393457.617116 
-342912.959257  7393456.827251 
-342946.183320  7393460.776575 
-342979.407383  7393461.566440 
-343005.514950  7393452.078065 
-343026.081049  7393439.420233 
-343047.438786  7393418.063891 
-343065.638217  7393406.985789 
-343074.618362  7393384.029721 
-343094.112452  7393398.287279 
-343123.386570  7393410.945111 
-343144.859755  7393423.672931 
-343160.412146  7393443.479538 
-343172.426904  7393467.895356 
-343232.550172  7393460.776575 
-343295.839992  7393447.718812 
-343295.303987  7393460.636599 
-343294.256716  7393489.251697 
-343302.956489  7393520.106412 
-343365.446425  7393486.092239 
-343464.335223  7393433.881182 
-343562.424136  7393379.300531 
-343658.929774  7393324.719880 
-343753.860381  7393270.919096 
-343726.697297  7393221.797510 
-343731.059553  7393210.439455 
-343730.927613  7393194.822131 
-343728.000201  7393187.533379 
-343724.297644  7393181.744371 
-343713.082770  7393162.907597 
-343632.830454  7393024.111372 
-343632.038815  7393007.504216 
-343616.214299  7392971.110450 
-343628.410474  7392913.500318 
-343746.430527  7392701.876568 
-343705.603439  7392558.971046 
-343840.033491  7392630.668765 
-343920.788828  7392520.207686 
-343850.374264  7392483.813920 
-343742.785693  7392426.073810 
-343715.886489  7392402.337876 
-343693.737113  7392377.812077 
-343620.799203  7392248.074300 
-343571.387789  7392211.550556 
-343577.737387  7392200.642425 
-343655.136507  7392134.113820 
-343671.604230  7392129.404627 
-343693.737113  7392125.465302 
-343725.386146  7392115.187062 
-343788.494549  7392080.562993 
-343868.565449  7392040.829799 
-343941.346681  7391992.568066 
-344002.269833  7391947.455793 
-344015.719435  7391938.367350 
-344018.094349  7391923.339924 
-344012.561129  7391886.156293 
-344066.351291  7391871.918732 
-344154.157155  7391847.392933 
-344230.888331  7391821.287405 
-344260.162450  7391803.090522 
-344316.327527  7391766.706754 
-344362.209554  7391735.852039 
-344411.258134  7391720.824613 
-344419.957907  7391650.416673 
-344417.582993  7391623.521280 
-344394.641979  7391528.597540 
-344339.268541  7391424.175426 
-Region 1
-160
-337085.117164  7397800.003305 
-337064.278939  7397738.833783 
-337023.344650  7397666.586158 
-337016.120952  7397601.577293 
-337030.568348  7397531.739256 
-337111.777228  7397341.601825 
-337074.751652  7397287.131155 
-337050.144900  7397256.326432 
-337016.063229  7397203.965401 
-336981.824879  7397158.343215 
-336633.685514  7397505.313782 
-336447.469133  7397638.350994 
-336366.697304  7397670.655461 
-336275.823842  7397702.969926 
-336197.072340  7397711.048542 
-336150.819232  7397710.118701 
-335944.655219  7397680.753731 
-335901.040906  7397676.464466 
-335763.988552  7397654.628206 
-335611.779627  7397659.617352 
-335499.498950  7397689.552224 
-335354.777603  7397761.919828 
-335127.709395  7397964.025209 
-334992.965987  7398055.099609 
-334848.244639  7398117.488922 
-334783.082924  7398135.865775 
-334771.043428  7398197.235263 
-334762.492086  7398231.399410 
-334753.948991  7398257.025021 
-334748.259092  7398281.220877 
-334739.715997  7398302.577218 
-334726.901355  7398323.933560 
-334711.241763  7398343.860147 
-334645.131732  7398434.794571 
-334548.955944  7398558.803329 
-334534.731196  7398587.278452 
-334523.343151  7398614.323819 
-334517.653252  7398629.981137 
-334516.226654  7398647.068210 
-334513.381705  7398668.414554 
-334519.071604  7398691.190652 
-334519.071604  7398723.935044 
-334510.528509  7398968.773105 
-334573.150384  7398996.638332 
-334697.421080  7399062.287087 
-334782.728336  7399107.689310 
-334796.845883  7399114.848084 
-334934.590920  7399186.895743 
-334971.534033  7399206.242429 
-335001.937886  7399222.069718 
-335015.882262  7399230.488276 
-335036.143250  7399247.815308 
-335047.778682  7399261.822908 
-335057.896807  7399278.110118 
-335069.260113  7399302.785892 
-335078.339213  7399332.290838 
-335083.072549  7399376.013348 
-335083.806463  7399388.971129 
-335087.286373  7399424.545035 
-335109.806829  7399709.466231 
-335110.293356  7399724.213705 
-335110.021231  7399736.661573 
-335100.002060  7399800.920566 
-335075.782881  7400000.986296 
-335064.856625  7400045.458679 
-335131.469677  7400128.174510 
-335156.216615  7400192.113558 
-335258.593568  7400348.396788 
-335292.353637  7400398.358230 
-335373.463561  7400535.854678 
-335400.956494  7400621.100076 
-335410.588092  7400678.850184 
-335425.711679  7400823.225454 
-335446.723074  7400938.995624 
-335449.089742  7400984.777782 
-335470.290801  7401032.279645 
-335495.837624  7401037.718713 
-335561.840454  7401046.657182 
-335700.022541  7401017.782128 
-335803.916801  7400998.205482 
-335831.723091  7400994.146177 
-335855.595928  7400990.176857 
-335903.333358  7400983.537994 
-335954.459988  7400971.630034 
-335984.896825  7400976.219248 
-336018.673386  7400980.858453 
-336219.312424  7401025.530801 
-336325.977417  7401053.615990 
-336430.382943  7401079.671527 
-336449.769831  7401085.420543 
-336526.311344  7401109.146478 
-336560.112644  7401115.985307 
-336636.266584  7401131.822594 
-336700.438751  7401143.370616 
-336731.683719  7401133.962228 
-336794.140670  7401093.309191 
-336880.569413  7401039.408424 
-336865.173700  7400930.737038 
-336851.047907  7400819.936018 
-336838.637330  7400751.907670 
-336827.513165  7400669.761741 
-336871.581022  7400643.666211 
-336956.723353  7400588.905591 
-336961.431951  7400532.855192 
-336966.132302  7400431.462560 
-337034.881127  7400436.881631 
-337058.828181  7400437.671496 
-337089.240279  7400428.922995 
-337104.446329  7400418.634757 
-337141.711045  7400383.940700 
-337173.648696  7400351.536250 
-337221.551050  7400314.952517 
-337250.000546  7400310.003364 
-337340.832776  7400233.286505 
-337318.600939  7400187.734308 
-337318.089672  7400177.836004 
-337316.300240  7400158.459323 
-337317.471205  7400132.563758 
-337321.858200  7400092.160679 
-337327.556345  7400064.295452 
-337320.233692  7400027.491756 
-337313.537753  7400008.574996 
-337301.778628  7399982.419477 
-337287.809513  7399961.773013 
-337258.189053  7399938.876935 
-337190.586454  7399887.675705 
-337185.028495  7399879.717069 
-337091.070943  7399813.628389 
-337058.424116  7399793.721799 
-337016.228153  7399683.040757 
-336970.016277  7399568.890310 
-337007.652073  7399506.690965 
-337033.726655  7399465.088091 
-337054.589618  7399429.514184 
-337075.073255  7399391.360720 
-337092.942837  7399344.448755 
-337127.568759  7399337.749903 
-337148.390492  7399271.011334 
-337161.939049  7399228.858555 
-337169.723491  7399208.232088 
-337175.149510  7399188.695434 
-337178.596435  7399163.479754 
-337179.454043  7399134.534712 
-337181.193997  7399038.371184 
-337178.307817  7398931.559479 
-337177.837782  7398826.127539 
-337176.716294  7398724.474951 
-337175.932902  7398630.621027 
-337173.021983  7398484.346083 
-337172.997244  7398413.518215 
-337172.288068  7398366.076342 
-337172.263330  7398316.744792 
-337170.960425  7398213.692444 
-337170.803747  7398157.902000 
-337170.836732  7398113.799554 
-337176.493646  7397969.644247 
-337151.771446  7397930.240996 
-337117.928916  7397883.069076 
-337096.398008  7397846.145401 
-337085.117164  7397800.003305 
-Region 1
-430
-351616.072313  7401306.892606 
-351610.176258  7401334.157936 
-351602.070213  7401359.213644 
-351587.573340  7401386.488972 
-351581.677285  7401394.837542 
-351571.113863  7401403.196110 
-351552.691784  7401413.024427 
-351536.232307  7401419.163375 
-351518.296756  7401422.112870 
-351493.731235  7401422.352829 
-351470.633543  7401420.633124 
-351445.325861  7401416.463838 
-351414.864285  7401410.804807 
-351385.631397  7401401.226448 
-351365.485856  7401396.067332 
-351329.218933  7401388.138690 
-351310.120663  7401383.209534 
-351300.876639  7401383.209534 
-351278.686032  7401386.908900 
-351266.984631  7401389.378477 
-351251.572426  7401391.838056 
-351233.702844  7401390.608267 
-351225.077287  7401386.908900 
-351208.551840  7401386.918899 
-351190.566811  7401390.288321 
-351178.857164  7401387.208849 
-351156.674803  7401379.200221 
-351120.317172  7401368.722016 
-351101.829123  7401365.342594 
-351085.806697  7401367.192278 
-351059.311558  7401367.192278 
-351035.282042  7401368.422067 
-351017.404214  7401371.501539 
-350994.603386  7401379.510168 
-350976.733804  7401384.439323 
-350961.329845  7401390.608267 
-350942.841796  7401391.838056 
-350929.284993  7401390.608267 
-350913.262567  7401390.608267 
-350902.171387  7401394.307633 
-350886.767428  7401402.926157 
-350875.676248  7401410.944783 
-350865.813756  7401419.573305 
-350857.188199  7401429.431617 
-350855.341043  7401446.678662 
-350855.341043  7401478.113278 
-350859.653822  7401495.370322 
-350874.439313  7401519.396206 
-350896.011453  7401531.104201 
-350930.521928  7401544.661879 
-350947.154575  7401555.140084 
-350957.017067  7401571.157340 
-350963.177001  7401589.034278 
-350961.948313  7401604.441639 
-350954.551444  7401619.839001 
-350945.307419  7401627.857628 
-350934.216239  7401632.786784 
-350917.575346  7401635.246362 
-350894.774518  7401632.786784 
-350864.585068  7401619.229106 
-350850.409797  7401609.980690 
-350836.852994  7401601.352168 
-350823.914658  7401600.742273 
-350807.273765  7401600.742273 
-350791.869806  7401606.291322 
-350782.007314  7401615.529740 
-350775.228912  7401631.556994 
-350775.228912  7401647.574251 
-350780.778625  7401670.990240 
-350798.029740  7401715.972535 
-350806.655297  7401736.309051 
-350807.892232  7401752.946201 
-350807.273765  7401767.743667 
-350802.342519  7401778.211874 
-350790.022650  7401782.531134 
-350777.076068  7401783.760923 
-350759.824953  7401782.531134 
-350749.962462  7401774.522506 
-350727.780101  7401752.336306 
-350682.796913  7401699.335384 
-350663.690397  7401687.017494 
-350652.599216  7401682.698234 
-350639.042413  7401682.698234 
-350631.645544  7401687.627390 
-350625.485610  7401695.026123 
-350621.172831  7401706.734117 
-350618.707208  7401725.830846 
-350622.401520  7401758.495251 
-350629.798389  7401791.159656 
-350631.645544  7401836.141951 
-350632.264012  7401859.557940 
-350637.813725  7401876.195090 
-350653.217684  7401890.372662 
-350681.559978  7401906.389918 
-350703.750585  7401925.496645 
-350725.314478  7401954.461684 
-350737.642593  7401977.257779 
-350743.802527  7401994.514823 
-350754.893707  7402030.248702 
-350769.679199  7402054.284585 
-350792.480027  7402082.019834 
-350836.234527  7402122.682869 
-350875.057780  7402151.038012 
-350907.102633  7402182.462629 
-350932.369083  7402224.985345 
-350940.376173  7402256.409963 
-350940.376173  7402294.613419 
-350934.216239  7402322.958563 
-350920.659436  7402351.313706 
-350887.996116  7402403.074840 
-350859.653822  7402432.039879 
-350816.517789  7402472.702914 
-350802.960986  7402485.650696 
-350790.632871  7402495.509007 
-350777.744013  7402501.817926 
-350765.366420  7402507.217002 
-350739.489749  7402518.924996 
-350706.826429  7402521.384575 
-350677.865667  7402519.534892 
-350655.683307  7402511.526264 
-350631.645544  7402496.738796 
-350612.547274  7402486.880485 
-350590.356667  7402479.481752 
-350547.220635  7402474.552597 
-350504.703070  7402469.013546 
-350478.826398  7402465.924075 
-350458.482947  7402460.994919 
-350423.362251  7402444.977663 
-350367.287882  7402424.021252 
-350334.624563  7402414.162941 
-350314.907825  7402411.083468 
-350297.038243  7402411.083468 
-350277.313260  7402414.162941 
-350251.436588  7402424.641146 
-350226.170137  7402436.969034 
-350203.369309  7402452.986291 
-350172.553145  7402467.773758 
-350142.363695  7402483.181119 
-350116.478777  7402491.189747 
-350094.914884  7402495.509007 
-350054.854695  7402497.968586 
-350011.100196  7402501.048058 
-349997.543392  7402504.747425 
-349976.597967  7402515.225630 
-349946.400270  7402528.783308 
-349918.049729  7402539.261513 
-349884.157721  7402545.420458 
-349849.647246  7402544.190668 
-349823.152107  7402538.021725 
-349800.557435  7402389.777118 
-349792.599822  7402332.077002 
-349786.299702  7402264.388596 
-349800.573927  7402204.168911 
-349811.656861  7402191.501081 
-349817.998213  7402177.233525 
-349887.720093  7402121.773025 
-350002.326206  7402014.921327 
-350040.069204  7401915.668329 
-350093.496532  7401769.383386 
-350139.263112  7401657.762506 
-350125.186797  7401641.805239 
-350109.106647  7401604.601611 
-350047.226932  7401579.985828 
-350024.203456  7401578.416097 
-350007.620286  7401574.906698 
-349969.390761  7401565.118375 
-349942.029768  7401545.431747 
-349940.702125  7401493.290678 
-349947.241385  7401461.756080 
-349951.999461  7401404.615867 
-349947.241385  7401339.547013 
-349936.133713  7401283.996528 
-349917.818835  7401240.533973 
-349915.501644  7401217.337946 
-349898.036127  7401120.524530 
-349893.278052  7401088.789965 
-349885.328686  7401064.834069 
-349886.367711  7401059.095052 
-349887.349012  7401050.326554 
-349890.226947  7401041.518063 
-349893.838796  7401030.799899 
-349899.751343  7401021.171548 
-349937.733482  7400991.646605 
-349972.573806  7400968.110637 
-349982.296112  7400961.371791 
-350000.256402  7400948.583981 
-350010.646653  7400931.306941 
-350039.236335  7400901.472051 
-350052.809630  7400883.455137 
-350068.617654  7400863.728516 
-350083.221729  7400836.253223 
-350091.393743  7400817.066509 
-350094.626266  7400798.379710 
-350098.889567  7400782.482433 
-350109.048923  7400737.730099 
-350112.009320  7400727.901782 
-350115.406767  7400688.638508 
-350123.463334  7400636.547430 
-350157.322357  7400470.995788 
-350103.548687  7400438.161412 
-350030.371637  7400374.432328 
-349940.091903  7400291.226581 
-349904.962961  7400255.502700 
-349891.010339  7400242.404943 
-349875.829028  7400225.117905 
-349863.797778  7400212.750023 
-349855.609271  7400202.221826 
-349842.728658  7400185.294726 
-349834.086609  7400171.327118 
-349823.803559  7400149.780809 
-349803.897158  7400102.478912 
-349794.413993  7400083.592147 
-349787.281003  7400068.084803 
-349778.919325  7400048.028238 
-349771.077160  7400035.970304 
-349762.121754  7400025.062172 
-349744.557282  7400002.486039 
-349729.458434  7399989.408279 
-349715.926370  7399978.580134 
-349691.492788  7399954.604241 
-349645.429344  7399915.360963 
-349636.490430  7399905.222700 
-349617.524099  7399889.145454 
-349606.696798  7399880.566923 
-349592.735930  7399867.089232 
-349579.937780  7399855.111283 
-349564.459605  7399841.653589 
-349549.030908  7399831.225375 
-349530.460396  7399816.297932 
-349507.700800  7399800.680607 
-349487.208916  7399784.633356 
-349439.619919  7399758.397849 
-349410.230353  7399743.290437 
-349383.322903  7399729.972718 
-349294.882079  7399686.480168 
-349267.133513  7399672.842504 
-349176.012664  7399625.210663 
-349116.582080  7399594.905854 
-349174.503604  7399305.255469 
-349215.289461  7399090.702220 
-349227.749515  7399021.554064 
-349249.148484  7398872.559586 
-349259.868584  7398795.392804 
-349269.879508  7398718.975893 
-349285.407160  7398596.836814 
-349296.572556  7398517.010488 
-349336.096740  7398505.722421 
-349348.787689  7398502.792923 
-349358.551226  7398498.883593 
-349369.287818  7398494.984261 
-349382.960069  7398489.125264 
-349395.651017  7398483.266268 
-349410.296323  7398471.548275 
-349419.078559  7398461.789947 
-349432.750809  7398440.303627 
-349455.782531  7398357.317842 
-349479.003917  7398313.485350 
-349490.812519  7398296.988176 
-349496.015891  7398288.069703 
-349504.666187  7398280.301034 
-349515.971769  7398273.662171 
-349526.543437  7398269.342911 
-349544.314064  7398266.893331 
-349566.183067  7398264.023822 
-349588.736508  7398262.134146 
-349630.008892  7398259.754554 
-349648.686605  7398258.074841 
-349661.088936  7398256.055187 
-349681.011829  7398252.985713 
-349706.187571  7398250.226186 
-349725.186887  7398247.676622 
-349745.992127  7398240.137914 
-349775.662064  7398234.688847 
-349786.208993  7398232.249265 
-349799.823520  7398231.979311 
-349820.397866  7398224.400609 
-349836.453277  7398223.350789 
-349850.950150  7398223.160822 
-349860.961074  7398228.009991 
-349891.216494  7398239.967943 
-349915.823247  7398250.956061 
-349935.869833  7398261.124319 
-349950.770772  7398268.373077 
-349965.556264  7398280.710964 
-349982.997042  7398298.447926 
-349997.048619  7398316.354858 
-350004.066161  7398328.832721 
-350010.861055  7398344.300072 
-350026.817511  7398374.024980 
-350062.169102  7398430.395324 
-350151.079961  7398588.558232 
-350183.858728  7398600.996102 
-350217.800213  7398611.154362 
-350314.866594  7398627.171618 
-350397.271177  7398641.129227 
-350521.203777  7398664.465230 
-350583.141216  7398677.273036 
-350651.189111  7398681.572300 
-350713.398675  7398686.571444 
-350774.536229  7398689.640918 
-350826.157633  7398688.451122 
-350892.572774  7398688.271153 
-350923.586848  7398688.651087 
-350954.592675  7398689.290978 
-351018.030927  7398690.840712 
-351076.678120  7398691.450608 
-351111.089640  7398692.180483 
-351138.038322  7398693.530252 
-351202.853695  7398693.040336 
-351210.539182  7398692.970348 
-351314.268517  7398692.770382 
-351380.782614  7398693.580243 
-351441.161514  7398695.499914 
-351452.137247  7398699.269269 
-351459.476393  7398699.429241 
-351465.578603  7398699.569217 
-351473.989759  7398701.448895 
-351521.628233  7398720.465638 
-351546.218493  7398729.334119 
-351580.300164  7398746.451187 
-351639.747241  7398770.517065 
-351690.849132  7398794.203007 
-351789.276141  7398836.265802 
-351816.233069  7398838.645395 
-351843.387907  7398840.765032 
-351852.739132  7398841.814852 
-351960.377181  7398859.131886 
-352044.010452  7398860.461658 
-352154.699606  7398872.609577 
-352184.443760  7398874.529248 
-352253.753329  7398881.448063 
-352289.129658  7398884.987457 
-352303.511084  7398886.657171 
-352345.731785  7398890.296547 
-352364.706362  7398891.346368 
-352425.110001  7398895.185710 
-352458.936040  7398897.365337 
-352481.646159  7398899.764926 
-352559.540053  7398911.352941 
-352619.539628  7398913.272612 
-352624.800723  7398949.186460 
-352628.866114  7398997.748142 
-352628.866114  7399028.672845 
-352632.040913  7399055.678219 
-352633.962285  7399077.244525 
-352636.007350  7399109.648974 
-352585.639373  7399248.065265 
-352570.136460  7399288.988255 
-352541.579763  7399349.297925 
-352510.631659  7399428.654332 
-352477.300395  7399498.492369 
-352443.969131  7399553.242991 
-352423.337062  7399584.197688 
-352409.722535  7399608.703491 
-352379.689763  7399666.723552 
-352359.057694  7399718.304717 
-352344.783469  7399765.916562 
-352336.834102  7399794.491667 
-352328.901228  7399827.815959 
-352324.926545  7399846.862696 
-352319.822128  7399868.269030 
-352314.956852  7399903.772948 
-352302.472059  7399937.687139 
-352293.590869  7399948.315318 
-352277.741613  7399971.521343 
-352239.990370  7400009.864775 
-352194.471176  7400063.805536 
-352182.530634  7400075.963453 
-352170.985912  7400096.030016 
-352167.011228  7400104.888499 
-352158.410410  7400130.054188 
-352152.868943  7400155.229876 
-352150.691938  7400189.983923 
-352160.991480  7400293.186245 
-352167.844098  7400337.238699 
-352168.990324  7400346.717076 
-352186.546549  7400456.988187 
-352187.742252  7400468.486218 
-352188.138071  7400481.114055 
-352186.991845  7400494.061837 
-352184.666408  7400508.129427 
-352181.936906  7400522.946889 
-352176.618087  7400535.014822 
-352168.272902  7400546.222902 
-352159.226787  7400554.731445 
-352147.879973  7400563.929869 
-352134.380894  7400568.489088 
-352089.851248  7400575.907817 
-351995.423661  7400588.655634 
-351953.376131  7400587.255874 
-351776.659408  7400522.017048 
-351759.952545  7400544.823142 
-351738.256712  7400580.147091 
-351719.216166  7400658.703635 
-351705.601639  7400691.398035 
-351691.261444  7400711.214641 
-351678.768404  7400733.370845 
-351648.562461  7400773.334000 
-351616.847458  7400744.408955 
-351575.500858  7400698.876754 
-351534.319182  7400666.642275 
-351523.566097  7400659.093568 
-351475.540050  7400620.890112 
-351396.367989  7400578.147434 
-351323.438326  7400554.021566 
-351313.476879  7400556.161200 
-351292.646900  7400556.381162 
-351271.536550  7400560.490458 
-351282.198926  7400573.058306 
-351306.277920  7400650.934966 
-351334.529506  7400747.728386 
-351362.533705  7400842.812099 
-351393.737442  7400948.204046 
-351398.907829  7400963.931353 
-351414.130370  7401008.143779 
-351418.797737  7401018.961926 
-351438.943278  7401062.934394 
-351443.363258  7401070.553089 
-351448.525398  7401074.722375 
-351464.490101  7401086.760313 
-351475.053522  7401096.348671 
-351519.278057  7401141.550928 
-351557.359150  7401180.364280 
-351598.384148  7401223.356915 
-351614.357097  7401242.763591 
-351620.005765  7401250.872202 
-351622.463141  7401257.751024 
-351623.197056  7401265.619676 
-351621.481840  7401281.097025 
-351616.072313  7401306.892606 
-Region 1
-126
-323980.817641  7397992.200383 
-324057.120013  7397934.540260 
-324040.990386  7397911.364230 
-324092.018061  7397845.835454 
-324176.978976  7397731.405055 
-324194.263075  7397698.160749 
-324188.853548  7397690.242106 
-324230.719661  7397533.278992 
-324285.746758  7397343.731460 
-324331.727740  7397182.789028 
-324352.236116  7397131.617793 
-324370.707672  7397107.931850 
-324406.768439  7397044.902647 
-324429.965086  7396949.928915 
-324440.322351  7396937.980961 
-324443.043608  7396924.063345 
-324443.076592  7396912.535320 
-324439.538960  7396902.627017 
-324435.127226  7396893.498581 
-324429.569267  7396885.939876 
-324419.632559  7396874.811782 
-324446.012251  7396786.426921 
-324472.812500  7396704.111021 
-324479.871274  7396681.244938 
-324519.601613  7396545.958111 
-324509.095915  7396522.582115 
-324500.882669  7396499.586054 
-324494.318670  7396474.950274 
-324489.387424  7396451.964212 
-324482.823424  7396419.119838 
-324489.387424  7396323.866154 
-324515.668161  7396220.403876 
-324522.232160  7396177.701190 
-324527.163406  7396103.803848 
-324523.881407  7396080.807787 
-324506.127272  7396048.483324 
-324477.908671  7395999.971634 
-324456.221084  7395977.665455 
-324440.643954  7395967.297231 
-324423.062991  7395959.468572 
-324404.467741  7395955.709216 
-324382.582244  7395951.689904 
-324357.653889  7395951.499937 
-324323.563972  7395953.349620 
-324254.889363  7395961.888157 
-324190.799658  7395969.906784 
-324138.048521  7395979.415155 
-324096.446287  7395984.604266 
-324073.810384  7395987.203821 
-324043.027205  7395988.033679 
-324016.053785  7395986.313973 
-323999.998374  7395984.374306 
-323965.578607  7395981.524794 
-323928.759187  7395969.336881 
-323903.146395  7395958.178793 
-323879.512698  7395948.920378 
-323833.770856  7395916.805879 
-323808.306496  7395899.178899 
-323797.446210  7395885.901173 
-323709.483668  7395792.587157 
-323675.583414  7395753.253894 
-323662.397691  7395744.275432 
-323639.761788  7395698.913202 
-323623.129141  7395670.348095 
-323604.773031  7395633.144468 
-323592.667565  7395614.757618 
-323573.470340  7395590.511771 
-323557.546868  7395571.345054 
-323539.067065  7395554.967859 
-323508.143700  7395536.990938 
-323488.360993  7395525.942831 
-323437.819845  7395510.365499 
-323352.092032  7395420.640868 
-323241.848174  7395300.011531 
-323193.046981  7395247.870462 
-323084.806958  7395133.560042 
-322960.626970  7395008.331493 
-322908.486054  7395063.202094 
-322778.038931  7395159.315631 
-322679.249088  7395255.479159 
-322541.866886  7395376.308462 
-322440.265078  7395484.729890 
-322323.325281  7395595.220964 
-322149.478247  7395741.825852 
-321998.324839  7395885.191295 
-321851.319285  7396032.046140 
-321734.049639  7396143.926976 
-321538.275877  7396361.519704 
-321460.010902  7396574.223270 
-321439.766406  7396810.552789 
-321435.824708  7396919.844068 
-321439.873607  7397044.702681 
-321155.156001  7397230.310888 
-321196.172753  7397248.547764 
-321232.637585  7397269.054252 
-321266.818211  7397280.452299 
-321310.119168  7397294.119958 
-321344.299794  7397298.679177 
-321387.600751  7397314.626445 
-321435.453627  7397344.251371 
-321481.690243  7397401.231611 
-321535.628837  7397502.714228 
-321583.440483  7397617.474570 
-321628.324716  7397727.745682 
-321647.785820  7397771.298222 
-321664.162834  7397793.174474 
-321728.590634  7397885.788610 
-321839.329266  7397988.471022 
-321962.148625  7398073.036537 
-322107.109114  7398101.221709 
-322401.062497  7398103.231365 
-322637.292267  7398096.632495 
-322810.331171  7398086.984148 
-323021.822248  7398089.763671 
-323213.489387  7398119.318609 
-323369.285423  7398217.451800 
-323509.298173  7398295.668402 
-323748.999605  7398458.030591 
-323794.527045  7398290.029368 
-323823.578515  7398208.733293 
-323830.909414  7398192.076146 
-323847.566800  7398138.115389 
-323867.563909  7398098.142236 
-323894.867179  7398063.488172 
-323924.256745  7398036.192848 
-323980.817641  7397992.200383 
-Region 1
-221
-340976.158818  7397756.260797 
-341015.427369  7397786.855557 
-341050.976869  7397821.989539 
-341089.420796  7397865.392104 
-341113.804900  7397899.696228 
-341167.957897  7398039.822226 
-341184.079278  7398108.030542 
-341189.859886  7398155.562401 
-341192.168830  7398186.007186 
-341187.608665  7398241.597664 
-341182.009474  7398277.091584 
-341165.475782  7398349.009265 
-341125.662980  7398510.671574 
-341114.217212  7398564.362377 
-341107.191423  7398796.252656 
-341111.322785  7398835.935859 
-341124.970297  7398907.033680 
-341134.478201  7398975.241997 
-341148.942089  7399050.469111 
-341168.370209  7399113.708279 
-341191.929690  7399184.806101 
-341162.169043  7399198.763710 
-341149.354401  7399204.542720 
-341144.192260  7399208.881977 
-341139.854743  7399215.710807 
-341137.166472  7399220.250029 
-341130.965306  7399223.969392 
-341120.838935  7399230.798223 
-341107.818137  7399240.096630 
-341092.315223  7399249.395037 
-341079.500581  7399258.693444 
-341066.892094  7399269.231639 
-341056.353412  7399278.740011 
-341045.608573  7399286.388700 
-341030.732373  7399298.996541 
-341004.896932  7399322.972434 
-340983.399009  7399341.989177 
-340960.457995  7399360.376027 
-340942.893524  7399374.023689 
-340925.329053  7399385.391742 
-340914.782124  7399392.000610 
-340893.086291  7399408.737743 
-340881.508583  7399417.006327 
-340872.833548  7399422.795335 
-340847.204264  7399447.601086 
-340836.253269  7399460.408892 
-340819.925733  7399486.454431 
-340812.067075  7399500.711989 
-340808.966492  7399508.570643 
-340803.185884  7399530.476890 
-340797.603186  7399554.862713 
-340794.708759  7399569.330235 
-340788.919905  7399611.493013 
-340787.270659  7399622.651102 
-340785.200855  7399650.346358 
-340784.788544  7399670.802854 
-340784.582388  7399695.608605 
-340786.033725  7399718.344710 
-340787.889127  7399741.280781 
-340788.919905  7399766.086532 
-340787.064503  7399788.192746 
-340784.170077  7399802.870232 
-340781.687961  7399810.728886 
-340778.999690  7399816.507896 
-340774.868328  7399823.126762 
-340769.994806  7399829.835613 
-340764.741957  7399837.184354 
-340759.365415  7399846.482761 
-340751.721159  7399861.770143 
-340745.519994  7399872.728266 
-340725.473407  7399904.142885 
-340709.352026  7399934.937610 
-340687.862349  7399972.141237 
-340668.021918  7400004.375716 
-340651.092406  7400031.351095 
-340634.954533  7400057.286653 
-340616.920027  7400088.041385 
-340608.294469  7400102.348934 
-340596.098294  7400128.174510 
-340558.487236  7400204.851376 
-340552.492227  7400220.358720 
-340547.791875  7400229.657127 
-340529.773861  7400252.483217 
-340521.362706  7400269.300337 
-340503.336446  7400308.053698 
-340500.334818  7400317.062155 
-340499.130868  7400333.889273 
-340447.278570  7400269.590287 
-340233.973322  7400103.468742 
-340131.101594  7400024.922196 
-340053.933368  7399963.952640 
-339973.656312  7399907.072383 
-339966.242951  7399899.663652 
-339947.952812  7399866.169389 
-339900.165905  7399823.966618 
-339882.659157  7399807.249482 
-339836.579220  7399829.265710 
-339793.970947  7399849.642220 
-339751.370919  7399881.136825 
-339718.946740  7399907.992225 
-339697.960083  7399933.077928 
-339672.099904  7399958.183628 
-339641.341464  7399987.518603 
-339604.060255  7400067.194955 
-339615.283375  7400110.037617 
-339507.571110  7400212.490068 
-339423.443065  7400304.864245 
-339275.654119  7400465.586714 
-339213.947575  7400525.076524 
-339071.700097  7400670.651589 
-339012.582869  7400722.742666 
-338984.619901  7400747.098494 
-338974.147188  7400753.987314 
-338951.197928  7400765.485345 
-338922.121719  7400770.444495 
-338892.501259  7400775.503628 
-338766.523593  7400795.240248 
-338729.819620  7400803.018915 
-338658.250585  7400808.088047 
-338629.058928  7400804.838604 
-338601.277377  7400809.587790 
-338560.689430  7400814.047026 
-338380.806155  7400829.324409 
-338318.002862  7400819.716055 
-338252.973087  7400809.017888 
-338198.061437  7400790.511058 
-338081.913278  7400670.821560 
-338037.936130  7400625.009407 
-338025.146227  7400605.682717 
-337974.019597  7400554.811431 
-337903.077274  7400482.393836 
-337834.716022  7400379.311493 
-337790.376040  7400367.853455 
-337671.786997  7400344.207506 
-337573.500174  7400280.288454 
-337503.671093  7400238.175668 
-337441.948057  7400193.393339 
-337340.832776  7400233.286505 
-337318.600939  7400187.734308 
-337318.089672  7400177.836004 
-337316.300240  7400158.459323 
-337317.471205  7400132.563758 
-337321.858200  7400092.160679 
-337327.556345  7400064.295452 
-337320.233692  7400027.491756 
-337313.537753  7400008.574996 
-337301.778628  7399982.419477 
-337287.809513  7399961.773013 
-337258.189053  7399938.876935 
-337190.586454  7399887.675705 
-337185.028495  7399879.717069 
-337091.070943  7399813.628389 
-337058.424116  7399793.721799 
-337016.228153  7399683.040757 
-336970.016277  7399568.890310 
-337007.652073  7399506.690965 
-337033.726655  7399465.088091 
-337054.589618  7399429.514184 
-337075.073255  7399391.360720 
-337092.942837  7399344.448755 
-337127.568759  7399337.749903 
-337148.390492  7399271.011334 
-337161.939049  7399228.858555 
-337169.723491  7399208.232088 
-337175.149510  7399188.695434 
-337178.596435  7399163.479754 
-337179.454043  7399134.534712 
-337181.193997  7399038.371184 
-337178.307817  7398931.559479 
-337177.837782  7398826.127539 
-337176.716294  7398724.474951 
-337175.932902  7398630.621027 
-337173.021983  7398484.346083 
-337172.997244  7398413.518215 
-337172.288068  7398366.076342 
-337172.263330  7398316.744792 
-337170.960425  7398213.692444 
-337170.803747  7398157.902000 
-337170.836732  7398113.799554 
-337176.493646  7397969.644247 
-337151.771446  7397930.240996 
-337117.928916  7397883.069076 
-337096.398008  7397846.145401 
-337085.117164  7397800.003305 
-337064.278939  7397738.833783 
-337023.344650  7397666.586158 
-337016.120952  7397601.577293 
-337030.568348  7397531.739256 
-337111.777228  7397341.601825 
-337074.751652  7397287.131155 
-337050.144900  7397256.326432 
-337016.063229  7397203.965401 
-336981.824879  7397158.343215 
-337194.214796  7397000.300287 
-337391.332693  7396931.912001 
-337576.386355  7396931.912001 
-337821.777686  7396988.232354 
-338206.431361  7397106.442105 
-338535.431225  7397199.266206 
-338585.906403  7397212.193991 
-338837.853488  7397289.180804 
-338911.335649  7397309.607305 
-339021.373351  7397338.952279 
-339154.731393  7397356.979191 
-339360.862421  7397336.002784 
-339523.214210  7397336.002784 
-339593.026798  7397346.071059 
-339654.560171  7397352.419972 
-339841.040431  7397414.219386 
-340016.116154  7397512.502551 
-340178.896747  7397598.507819 
-340221.570991  7397617.284603 
-340301.757337  7397650.718876 
-340424.617928  7397669.145719 
-340657.879054  7397676.074533 
-340771.685283  7397678.364140 
-340824.461159  7397685.172974 
-340880.675714  7397701.700143 
-340932.074469  7397727.665696 
-340931.777605  7397728.135615 
-340976.158818  7397756.260797 
-Region 1
-234
-331712.623682  7390192.006486 
-331686.120296  7390140.935234 
-331683.753628  7390117.869185 
-331690.259904  7390088.884150 
-331696.757934  7390068.057717 
-331725.850636  7390000.039368 
-331798.821531  7389936.790202 
-331619.870079  7389999.569448 
-331573.757157  7390028.264533 
-331581.788986  7390000.029370 
-331590.562976  7389974.213792 
-331596.401307  7389945.818655 
-331600.343005  7389909.554867 
-331608.127447  7389827.828866 
-331608.127447  7389775.287866 
-331601.621171  7389634.431993 
-331591.973081  7389489.226866 
-331578.226614  7389343.421841 
-331578.127660  7389255.396918 
-331603.262171  7389247.928198 
-331730.006736  7389215.003837 
-331758.918020  7389207.865060 
-331859.901361  7389182.949328 
-331993.976825  7389168.841745 
-332122.123249  7389164.182543 
-332262.152492  7389149.874993 
-332395.551765  7389140.086670 
-332485.031614  7389141.446437 
-332546.367077  7389142.616237 
-332643.697338  7389145.295778 
-332704.529781  7389146.205622 
-332778.284068  7389149.245101 
-332853.572154  7389149.485060 
-332929.091134  7389152.794493 
-333027.452173  7389152.694510 
-333212.002815  7389152.654517 
-333340.272933  7389152.234589 
-333412.518160  7389151.704680 
-333453.600881  7389150.704851 
-333502.022747  7389150.774839 
-333541.563423  7389151.544707 
-333623.951513  7389150.314918 
-333697.211026  7389151.054791 
-333774.032911  7389149.785009 
-333847.787198  7389151.804663 
-333847.828429  7389151.794665 
-333915.208380  7389153.024454 
-333951.186684  7389155.294065 
-334049.803356  7389156.203909 
-334125.817111  7389160.013257 
-334232.539828  7389161.483005 
-334285.761000  7389163.872596 
-334309.048356  7389163.042738 
-334325.870666  7389161.403019 
-334336.434088  7389160.143235 
-334355.656051  7389198.566653 
-334398.330295  7389286.481594 
-334434.844604  7389360.768869 
-334459.542065  7389411.040258 
-334476.933365  7389447.074086 
-334519.632348  7389534.169167 
-334562.331330  7389621.594192 
-334572.185575  7389643.190493 
-334578.139354  7389658.437881 
-334582.872690  7389672.885406 
-334586.096967  7389686.103142 
-334594.582338  7389711.338820 
-334610.423347  7389763.679854 
-334619.535432  7389797.564050 
-334623.526607  7389823.189661 
-334627.385843  7389842.956275 
-334640.332426  7389940.829510 
-334640.818953  7389946.328568 
-334645.758445  7389969.414614 
-334648.801304  7389997.919731 
-334651.901887  7390022.095590 
-334653.056359  7390036.953045 
-334654.441726  7390058.669325 
-334656.511530  7390074.536607 
-334662.844635  7390110.490449 
-334665.928725  7390135.556155 
-334669.037554  7390158.292261 
-334676.038604  7390198.245417 
-334685.092965  7390236.778817 
-334694.196804  7390280.181382 
-334700.727819  7390307.506702 
-334715.199954  7390372.165626 
-334729.729812  7390426.156378 
-334751.541092  7390497.804105 
-334775.413930  7390544.526102 
-334821.106294  7390644.199029 
-334851.122573  7390700.939310 
-334864.836055  7390724.575262 
-334875.209813  7390746.171562 
-334883.959064  7390766.178135 
-334886.358717  7390771.667195 
-334892.749546  7390783.805116 
-334904.450947  7390805.421413 
-334927.861996  7390847.114272 
-334941.361075  7390872.179978 
-334954.208703  7390891.596652 
-334971.979330  7390909.193638 
-334980.984214  7390915.602540 
-334987.828585  7390924.650990 
-334994.046243  7390932.429658 
-335005.228132  7390941.618084 
-335015.486443  7390948.506904 
-335024.977854  7390952.946144 
-335037.536863  7390956.615515 
-335079.493685  7390965.963914 
-335100.315417  7390970.403153 
-335122.209160  7390974.532446 
-335146.865389  7390981.121317 
-335159.267720  7390984.790689 
-335169.963081  7390988.909983 
-335175.042759  7390990.459718 
-335190.199331  7390998.418355 
-335201.686331  7391006.686938 
-335214.698883  7391018.934840 
-335225.113872  7391029.802979 
-335234.300173  7391042.670775 
-335251.295654  7391067.466527 
-335295.891269  7391144.893265 
-335221.567993  7391197.974173 
-335162.541474  7391247.205740 
-335076.450826  7391312.944479 
-335060.840711  7391329.821588 
-334992.396997  7391379.663051 
-334894.209128  7391456.909819 
-334822.499907  7391510.330669 
-334778.341342  7391546.504472 
-334698.187980  7391544.164873 
-334563.617742  7391541.795279 
-334499.981580  7391540.285538 
-334443.264006  7391537.536009 
-334386.538185  7391537.016098 
-334304.100617  7391534.196581 
-334217.572919  7391529.127449 
-334144.321652  7391529.517382 
-334080.363887  7391531.637019 
-334025.790333  7391529.297420 
-333890.156331  7391524.158300 
-333859.810202  7391489.414252 
-333826.083119  7391473.466983 
-333781.553474  7391471.317351 
-333714.173523  7391474.746764 
-333632.337930  7391481.265647 
-333580.106305  7391482.015519 
-333513.386053  7391491.213943 
-333436.481706  7391488.064483 
-333418.191566  7391488.814354 
-333398.606768  7391516.789562 
-333384.497468  7391539.305706 
-333378.246825  7391690.329836 
-333321.578728  7391799.701102 
-333313.299512  7391811.189134 
-333309.011473  7391814.528562 
-333302.678367  7391817.877989 
-333295.833996  7391819.717674 
-333289.220519  7391820.027620 
-333283.876961  7391819.817656 
-333277.263485  7391819.377732 
-333269.619229  7391818.427894 
-333264.786938  7391818.467888 
-333259.707259  7391819.777663 
-333253.638034  7391822.627175 
-333250.108647  7391826.466518 
-333239.347316  7391844.073502 
-333289.797755  7391879.407449 
-333133.292544  7391870.638951 
-333028.037656  7391902.023575 
-332932.142239  7391927.989128 
-332872.571469  7391951.855040 
-332727.652212  7391998.537043 
-332626.710103  7392026.792204 
-332559.536308  7392053.557619 
-332541.609002  7392058.756728 
-332497.986442  7392078.373368 
-332461.076314  7392090.601274 
-332337.028266  7392179.646021 
-332219.989515  7392274.429785 
-332079.572699  7392394.139280 
-332000.029558  7392457.088498 
-331984.056610  7392468.866480 
-331896.687796  7392539.074454 
-331727.186525  7392674.131320 
-331708.401611  7392647.115948 
-331642.151394  7392566.939681 
-331552.696284  7392470.546192 
-331512.965945  7392428.223442 
-331477.012380  7392393.809337 
-331393.346123  7392309.223826 
-331314.891485  7392231.127203 
-331268.399237  7392184.845130 
-331356.386518  7392080.083075 
-331372.780024  7392078.383366 
-331457.023516  7392028.971830 
-331476.921671  7392021.553101 
-331503.029237  7392006.015762 
-331513.609151  7392000.046785 
-331547.410451  7391976.780770 
-331571.753323  7391955.614396 
-331580.213956  7391937.117564 
-331567.753902  7391862.920273 
-331566.418012  7391788.333049 
-331562.459821  7391723.314187 
-331560.373525  7391612.173224 
-331552.712777  7391549.134022 
-331529.359452  7391440.092700 
-331530.579894  7391396.140229 
-331532.938316  7391370.984537 
-331538.380828  7391348.338417 
-331546.602320  7391322.142904 
-331564.241007  7391298.396971 
-331618.971240  7391230.768555 
-331663.690549  7391190.525448 
-331671.474991  7391181.546986 
-331706.711134  7391153.281828 
-331723.253073  7391033.212395 
-331796.190983  7390927.970422 
-331796.182737  7390927.970422 
-331839.458955  7390873.599735 
-331877.581279  7390814.959779 
-331878.562581  7390809.360739 
-331879.543882  7390803.001828 
-331883.601028  7390765.178307 
-331883.601028  7390765.138313 
-331888.837384  7390642.429332 
-331872.179998  7390625.002317 
-331824.459062  7390497.804105 
-331824.607494  7390483.056631 
-331847.127950  7390357.198190 
-331728.703831  7390216.982208 
-331712.623682  7390192.006486 
-Region 1
-241
-347127.871620  7396265.856090 
-347122.561047  7396275.024520 
-347113.448962  7396289.142102 
-347102.811325  7396304.029552 
-347082.690522  7396333.044581 
-347075.087497  7396342.972881 
-347035.456113  7396393.084297 
-347007.460160  7396427.338430 
-346934.175908  7396511.733974 
-346913.123281  7396540.808993 
-346870.003741  7396595.929552 
-346849.998386  7396653.999605 
-346767.000074  7396758.541698 
-346753.583457  7396787.756693 
-346743.242684  7396808.623119 
-346729.083906  7396834.408702 
-346713.003756  7396857.004832 
-346682.146361  7396882.460472 
-346606.000667  7396934.001643 
-346663.650065  7397002.509908 
-346583.043161  7397058.800266 
-346487.411624  7397125.588826 
-346441.018330  7397158.073262 
-346369.696682  7397206.344993 
-346323.369358  7397234.600153 
-346297.352500  7397248.917701 
-346272.976642  7397262.855313 
-346245.566172  7397276.782928 
-346217.042460  7397288.410936 
-346173.287960  7397304.518177 
-346145.143575  7397312.726771 
-346113.972823  7397317.875889 
-346090.619498  7397324.224801 
-346064.569655  7397326.884346 
-346034.149310  7397329.993813 
-346008.701443  7397329.653871 
-345985.158454  7397329.333926 
-345965.788058  7397327.324270 
-345941.873989  7397324.144815 
-345903.916590  7397316.696091 
-345889.873259  7397315.856235 
-345752.128222  7397293.090134 
-345663.629675  7397279.592446 
-345579.773755  7397272.023743 
-345466.074727  7397268.564335 
-345370.385467  7397240.309175 
-345309.091234  7397184.348761 
-345281.631286  7397156.473536 
-345130.815974  7397068.498605 
-345013.999871  7397017.267380 
-344861.749714  7396923.823386 
-344839.377691  7396909.745798 
-344760.865329  7396880.800756 
-344574.838611  7396839.177885 
-344332.424169  7396819.001341 
-344237.699718  7396816.201821 
-344099.501138  7396799.834625 
-344081.079059  7396798.284890 
-344064.190779  7396796.955118 
-344042.552669  7396793.795659 
-344009.518269  7396790.946147 
-343977.555879  7396790.336252 
-343879.203087  7396797.055101 
-343791.397223  7396820.211134 
-343715.721564  7396839.557820 
-343674.910969  7396845.776755 
-343602.377124  7396858.284613 
-343575.296502  7396859.494405 
-343550.895906  7396861.134125 
-343524.986249  7396859.324435 
-343504.040823  7396857.194799 
-343477.413745  7396851.565764 
-343369.849912  7396814.232158 
-343335.207497  7396803.933922 
-343279.974244  7396792.585866 
-343205.758168  7396771.759434 
-343095.093753  7396735.055721 
-342987.562905  7396704.640930 
-342948.500511  7396691.743140 
-342822.902172  7396659.348689 
-342649.475695  7396620.115409 
-342571.590047  7396602.818372 
-342332.168986  7396537.609541 
-342174.129976  7396493.967017 
-342122.162230  7396481.249195 
-341969.887335  7396445.495320 
-341980.417772  7396412.301006 
-341984.499656  7396398.213419 
-342000.010816  7396350.091661 
-342015.653915  7396258.917279 
-342048.292496  7396186.579670 
-342073.690886  7396157.934576 
-342102.750603  7396104.963650 
-342191.628477  7396049.993066 
-342234.879957  7396029.906506 
-342384.639752  7395945.910894 
-342423.364051  7395920.065321 
-342544.995953  7395870.413826 
-342584.396443  7395854.086623 
-342647.117273  7395830.040741 
-342723.617555  7395798.906075 
-342827.783940  7395759.482827 
-342828.064312  7395758.792946 
-342882.736821  7395734.797056 
-343006.339573  7395722.839104 
-343090.541834  7395728.968054 
-343259.927657  7395711.531041 
-343297.093419  7395688.724948 
-343318.179031  7395674.867321 
-343350.240375  7395644.822468 
-343405.696277  7395597.970493 
-343445.360646  7395570.445208 
-343492.207482  7395542.170051 
-343552.363735  7395509.005732 
-343636.450549  7395469.902430 
-343738.406944  7395422.220597 
-343807.328940  7395384.187112 
-343846.012008  7395366.440152 
-343874.304826  7395346.583553 
-343898.210648  7395326.357018 
-343918.537607  7395306.080491 
-343936.316480  7395286.113911 
-343964.601051  7395247.540519 
-343997.709667  7395210.626841 
-344050.535021  7395155.316316 
-344090.867335  7395118.082693 
-344147.873527  7395066.001614 
-344168.159255  7395047.824728 
-344203.749986  7395025.048629 
-344250.209250  7394992.104272 
-344282.097423  7394964.748958 
-344301.418342  7394942.802717 
-344319.494079  7394923.616004 
-344341.165174  7394892.611315 
-344358.284348  7394866.545779 
-344373.366704  7394840.910171 
-344384.985643  7394823.093222 
-344404.133391  7394799.657237 
-344422.332822  7394771.961981 
-344451.598694  7394744.276723 
-344520.751585  7394701.714014 
-344622.270930  7394640.994414 
-344735.615370  7394572.756103 
-344775.766267  7394550.809862 
-344813.905084  7394528.313716 
-344885.894678  7394485.601032 
-344940.163122  7394452.206752 
-344961.125040  7394440.808704 
-344974.211808  7394429.100710 
-344990.374420  7394416.422881 
-345002.661304  7394403.925022 
-345015.789303  7394388.557654 
-345035.382347  7394369.720881 
-345088.512811  7394289.214671 
-345149.056636  7394192.841179 
-345175.988826  7394226.315445 
-345249.974007  7394251.931057 
-345311.812491  7394276.566838 
-345355.731915  7394296.593407 
-345376.817527  7394306.041789 
-345423.383991  7394329.647745 
-345475.722817  7394361.672260 
-345500.717142  7394389.017576 
-345517.118895  7394416.352893 
-345543.663511  7394488.240580 
-345568.666083  7394536.652287 
-345585.076082  7394559.308406 
-345604.397000  7394584.384111 
-345734.192671  7394719.580953 
-345743.189308  7394728.849366 
-345755.286529  7394735.108294 
-345779.596417  7394747.176226 
-345838.952785  7394765.913017 
-345899.875937  7394769.042481 
-345972.533475  7394769.042481 
-346033.456627  7394772.161947 
-346058.467445  7394776.921131 
-346083.338076  7394794.798069 
-346097.628794  7394806.816011 
-346115.176773  7394818.963930 
-346126.630787  7394827.792418 
-346174.071352  7394867.085687 
-346235.522263  7394903.979367 
-346285.783039  7394920.986454 
-346341.610020  7394930.954747 
-346387.327123  7394929.964916 
-346430.289984  7394925.275720 
-346565.899247  7394898.500306 
-346617.850500  7394882.603029 
-346686.409662  7394868.085516 
-346699.438706  7394919.356733 
-346704.221520  7394932.394500 
-346713.242897  7394970.258014 
-346724.771127  7395020.579395 
-346738.641287  7395065.541693 
-346741.857317  7395074.060234 
-346746.598900  7395097.636196 
-346756.453145  7395130.210616 
-346763.338748  7395156.226160 
-346770.941772  7395186.081046 
-346784.152234  7395234.612733 
-346850.303496  7395310.679703 
-346862.268777  7395324.447345 
-346881.787605  7395351.112778 
-346907.367412  7395406.183344 
-346914.599357  7395423.100447 
-346934.175908  7395449.815871 
-346950.767324  7395474.181697 
-346964.530283  7395488.949167 
-346981.987553  7395508.755775 
-346996.146331  7395522.783372 
-347014.890014  7395536.141084 
-347045.697931  7395555.087838 
-347084.884019  7395573.624663 
-347101.129094  7395580.663458 
-347124.927715  7395589.561933 
-347162.093477  7395597.210623 
-347177.184079  7395604.819320 
-347205.922193  7395630.164978 
-347213.269584  7395625.355802 
-347231.411292  7395615.077563 
-347254.038949  7395608.698655 
-347290.066730  7395599.180286 
-347318.062683  7395591.771555 
-347326.259437  7395590.031853 
-347416.737079  7395575.204393 
-347449.680771  7395572.064930 
-347569.737643  7395549.508794 
-347523.360842  7395610.978265 
-347457.910509  7395688.844927 
-347404.367733  7395763.672110 
-347334.076863  7395844.648239 
-347280.517595  7395911.086859 
-347310.641076  7395928.273915 
-347269.236752  7396004.040937 
-347234.421166  7396063.240796 
-347202.697917  7396121.100886 
-347183.987219  7396159.784259 
-347170.743773  7396193.348510 
-347157.467342  7396220.433871 
-347127.871620  7396265.856090 
-Region 1
-295
-340685.973962  7401513.817162 
-340707.298714  7401477.173439 
-340730.429391  7401434.220796 
-340739.145657  7401412.884451 
-340743.351235  7401399.066818 
-340746.352863  7401382.849596 
-340746.055998  7401364.522735 
-340743.351235  7401342.896439 
-340735.838919  7401319.770401 
-340723.222186  7401296.334415 
-340711.809403  7401276.807760 
-340706.704986  7401265.099765 
-340704.602197  7401256.381258 
-340703.695112  7401247.972699 
-340704.602197  7401238.964242 
-340707.298714  7401230.855631 
-340717.218930  7401211.628924 
-340721.119397  7401203.220364 
-340724.228226  7401190.922471 
-340725.630085  7401185.493401 
-340732.235316  7401132.322509 
-340730.734502  7401098.078374 
-340729.530552  7401061.434651 
-340724.121025  7401013.072935 
-340714.514166  7400970.110294 
-340700.396619  7400930.467085 
-340684.176284  7400901.322077 
-340664.047235  7400881.795422 
-340633.107377  7400859.869177 
-340614.784253  7400847.551287 
-340599.462756  7400832.833808 
-340587.142888  7400814.216997 
-340578.434868  7400793.790496 
-340575.433240  7400777.263327 
-340574.526155  7400763.745643 
-340575.433240  7400742.719244 
-340576.934054  7400667.922056 
-340575.433240  7400640.286790 
-340573.025341  7400591.325177 
-340572.423366  7400555.271352 
-340568.217788  7400527.636086 
-340561.612558  7400483.483649 
-340551.997453  7400444.130390 
-340545.689086  7400417.694918 
-340535.777117  7400391.859343 
-340522.261545  7400365.433870 
-340510.543651  7400345.307317 
-340499.130868  7400333.889273 
-340447.278570  7400269.590287 
-340233.973322  7400103.468742 
-340131.101594  7400024.922196 
-340053.933368  7399963.952640 
-339973.656312  7399907.072383 
-339966.242951  7399899.663652 
-339947.952812  7399866.169389 
-339900.165905  7399823.966618 
-339882.659157  7399807.249482 
-339836.579220  7399829.265710 
-339793.970947  7399849.642220 
-339751.370919  7399881.136825 
-339718.946740  7399907.992225 
-339697.960083  7399933.077928 
-339672.099904  7399958.183628 
-339641.341464  7399987.518603 
-339604.060255  7400067.194955 
-339615.283375  7400110.037617 
-339507.571110  7400212.490068 
-339423.443065  7400304.864245 
-339275.654119  7400465.586714 
-339213.947575  7400525.076524 
-339071.700097  7400670.651589 
-339012.582869  7400722.742666 
-338984.619901  7400747.098494 
-338974.147188  7400753.987314 
-338951.197928  7400765.485345 
-338922.121719  7400770.444495 
-338892.501259  7400775.503628 
-338766.523593  7400795.240248 
-338729.819620  7400803.018915 
-338658.250585  7400808.088047 
-338629.058928  7400804.838604 
-338601.277377  7400809.587790 
-338560.689430  7400814.047026 
-338380.806155  7400829.324409 
-338318.002862  7400819.716055 
-338252.973087  7400809.017888 
-338198.061437  7400790.511058 
-338081.913278  7400670.821560 
-338037.936130  7400625.009407 
-338025.146227  7400605.682717 
-337974.019597  7400554.811431 
-337903.077274  7400482.393836 
-337834.716022  7400379.311493 
-337790.376040  7400367.853455 
-337671.786997  7400344.207506 
-337573.500174  7400280.288454 
-337503.671093  7400238.175668 
-337441.948057  7400193.393339 
-337340.832776  7400233.286505 
-337250.000546  7400310.003364 
-337221.551050  7400314.952517 
-337173.648696  7400351.536250 
-337141.711045  7400383.940700 
-337104.446329  7400418.634757 
-337089.240279  7400428.922995 
-337058.828181  7400437.671496 
-337034.881127  7400436.881631 
-336966.132302  7400431.462560 
-336961.431951  7400532.855192 
-336956.723353  7400588.905591 
-336871.581022  7400643.666211 
-336827.513165  7400669.761741 
-336838.637330  7400751.907670 
-336851.047907  7400819.936018 
-336865.173700  7400930.737038 
-336880.569413  7401039.408424 
-336794.140670  7401093.309191 
-336731.683719  7401133.962228 
-336756.884199  7401134.612116 
-336764.652149  7401143.780546 
-336782.051695  7401154.298744 
-336797.364946  7401170.096038 
-336802.733242  7401189.822659 
-336816.957990  7401211.668917 
-336838.225019  7401216.678059 
-336859.970329  7401224.466725 
-336883.678242  7401238.324351 
-336905.052472  7401256.961159 
-336945.104414  7401285.116336 
-336977.668779  7401301.343557 
-337017.382626  7401314.611284 
-337034.518293  7401323.849702 
-337053.171267  7401337.677333 
-337078.297531  7401361.143314 
-337100.941681  7401379.280207 
-337133.943096  7401402.826174 
-337146.477366  7401416.833774 
-337158.178768  7401437.640210 
-337167.043466  7401462.455960 
-337182.200038  7401492.130877 
-337202.856845  7401529.424489 
-337227.991356  7401575.346623 
-337250.586028  7401620.738847 
-337270.055379  7401674.179693 
-337279.695222  7401700.025268 
-337286.605564  7401715.472620 
-337292.031584  7401729.910147 
-337300.871543  7401757.245465 
-337306.008944  7401774.712473 
-337313.323351  7401801.777837 
-337322.385959  7401831.392764 
-337335.612912  7401852.469154 
-337350.019077  7401880.874288 
-337358.883775  7401892.032377 
-337366.552770  7401901.220803 
-337397.954416  7401954.021759 
-337428.135620  7402002.513453 
-337442.385107  7402022.340057 
-337452.313569  7402042.376625 
-337459.759915  7402057.594018 
-337477.390356  7402093.597851 
-337485.092335  7402106.805589 
-337502.599083  7402132.201238 
-337518.407107  7402149.008360 
-337548.134769  7402170.004763 
-337570.045004  7402185.612090 
-337590.635841  7402205.748640 
-337600.110760  7402221.335970 
-337615.811584  7402248.141379 
-337644.096155  7402261.299125 
-337708.309553  7402276.966441 
-337738.276355  7402284.445160 
-337775.301931  7402310.550689 
-337823.154807  7402345.094772 
-337867.255649  7402373.799855 
-337976.122386  7402452.076447 
-338108.218754  7402548.929857 
-338115.813533  7402554.678872 
-338139.537938  7402567.276714 
-338184.389187  7402597.251580 
-338204.749130  7402615.368476 
-338219.633577  7402624.346938 
-338236.332194  7402629.316087 
-338249.254037  7402631.455721 
-338265.919669  7402639.444352 
-338275.716191  7402648.882736 
-338291.301567  7402662.410418 
-338304.421320  7402672.208740 
-338310.688455  7402677.237879 
-338338.189635  7402692.405281 
-338350.996031  7402705.143099 
-338356.141679  7402722.100194 
-338358.706256  7402742.816646 
-338363.365377  7402757.254173 
-338371.644592  7402766.412604 
-338377.936466  7402771.271771 
-338389.852270  7402785.999249 
-338393.967139  7402790.868415 
-338411.333700  7402804.156139 
-338431.165885  7402824.292689 
-338450.684713  7402849.968291 
-338460.159632  7402865.575618 
-338469.642797  7402880.443071 
-338483.570681  7402906.058684 
-338494.266042  7402926.355207 
-338509.043287  7402944.422112 
-338528.141557  7402961.519184 
-338553.358531  7402976.906548 
-338572.531017  7402987.954656 
-338605.639633  7403024.108463 
-338613.424075  7403032.267065 
-338631.153471  7403058.432583 
-338653.632695  7403072.300208 
-338694.649447  7403101.205257 
-338714.357938  7403109.733796 
-338725.407887  7403120.441962 
-338739.014168  7403130.160297 
-338766.086543  7403137.998954 
-338807.697023  7403139.938622 
-338834.051976  7403144.237886 
-338845.934794  7403148.137218 
-338869.312858  7403146.607480 
-338888.732731  7403145.747627 
-338895.725535  7403145.107737 
-338912.869448  7403155.625935 
-338931.547161  7403165.394262 
-338949.177602  7403177.942113 
-338959.543114  7403182.081403 
-338977.025123  7403185.530813 
-338993.550569  7403182.921260 
-339004.493317  7403180.261715 
-339011.576829  7403182.851272 
-339022.618532  7403194.569264 
-339035.210526  7403203.027816 
-339054.638646  7403213.815968 
-339072.994755  7403217.515334 
-339097.197442  7403222.314512 
-339116.040079  7403216.955430 
-339137.645203  7403214.395868 
-339165.336046  7403212.656166 
-339189.967537  7403211.886298 
-339211.770571  7403214.375872 
-339235.346544  7403216.885442 
-339257.166070  7403218.365188 
-339269.543662  7403223.534303 
-339294.537988  7403236.152142 
-339304.466449  7403250.679653 
-339309.768776  7403259.268182 
-339317.775866  7403269.696396 
-339329.394805  7403275.105469 
-339347.891100  7403278.574875 
-339379.103083  7403279.384736 
-339430.592547  7403282.934128 
-339454.193259  7403283.923959 
-339467.288273  7403293.142380 
-339475.295363  7403304.070508 
-339484.044614  7403316.518376 
-339490.534398  7403326.176721 
-339501.501884  7403339.634416 
-339528.730938  7403287.493347 
-339551.086469  7403241.141287 
-339571.809247  7403207.327079 
-339575.066508  7403198.608573 
-339592.837135  7403166.014156 
-339603.722159  7403142.748141 
-339622.523565  7403109.943760 
-339638.653192  7403075.629638 
-339671.596884  7403017.569583 
-339677.336260  7403003.162051 
-339698.034299  7402967.818105 
-339750.249432  7402870.034854 
-339814.504061  7402751.015241 
-339872.318384  7402636.234902 
-339914.093789  7402563.397378 
-339928.269059  7402528.333385 
-339935.212385  7402517.325270 
-340029.079229  7402346.694498 
-340067.284015  7402276.226568 
-340085.458708  7402242.172401 
-340110.123183  7402193.430750 
-340137.756302  7402141.949569 
-340168.943547  7402079.690233 
-340196.947746  7402027.809120 
-340230.707814  7401962.430319 
-340262.076476  7401908.179611 
-340316.600553  7401865.966842 
-340416.808747  7401793.609236 
-340488.089165  7401747.507133 
-340583.539285  7401682.738227 
-340602.769495  7401679.038861 
-340605.474258  7401656.202773 
-340611.180650  7401637.276015 
-340622.890298  7401612.350284 
-340639.110633  7401588.914299 
-340685.973962  7401513.817162 
-Region 1
-372
-320402.027756  7389574.232305 
-320376.390225  7389522.751123 
-320358.149563  7389505.934004 
-320367.327618  7389498.405293 
-320378.451783  7389490.126711 
-320386.162009  7389477.258916 
-320391.555044  7389462.151503 
-320408.979329  7389439.995298 
-320420.087002  7389416.319354 
-320434.377719  7389399.432247 
-320449.723955  7389380.575476 
-320467.024546  7389359.409102 
-320484.226184  7389339.012596 
-320501.856625  7389316.306485 
-320506.713655  7389307.907924 
-320510.300765  7389301.678991 
-320515.792754  7389278.482964 
-320519.214940  7389257.266598 
-320518.349086  7389236.760111 
-320515.891709  7389220.562885 
-320510.886247  7389204.105704 
-320506.697162  7389188.108444 
-320508.181484  7389167.082046 
-320512.246875  7389151.954637 
-320518.959307  7389137.087184 
-320526.949905  7389126.768951 
-320544.778255  7389112.921323 
-320563.076641  7389094.094548 
-320576.476766  7389074.657877 
-320590.536589  7389052.231719 
-320606.138457  7389036.694380 
-320622.424763  7389023.826584 
-320641.968330  7389011.888629 
-320663.606439  7389003.620046 
-320693.276377  7388997.781046 
-320716.357576  7388996.631243 
-320734.095218  7388998.290958 
-320757.201157  7388995.361460 
-320776.456105  7388989.942388 
-320791.249843  7388982.263704 
-320809.515244  7388974.515031 
-320830.708057  7388961.257302 
-320847.802493  7388948.619467 
-320868.129451  7388930.812517 
-320885.743400  7388918.074699 
-320907.703112  7388900.177764 
-320923.502890  7388885.200330 
-320943.508246  7388876.911750 
-320961.839616  7388871.712640 
-320984.698168  7388864.243919 
-321008.307126  7388853.005844 
-321026.168462  7388844.807249 
-321043.444315  7388834.279052 
-321063.598103  7388822.781022 
-321091.569317  7388805.294017 
-321123.614169  7388789.296757 
-321136.898847  7388779.708400 
-321149.927891  7388773.959384 
-321168.407694  7388765.810780 
-321189.212934  7388758.312065 
-321236.166971  7388750.023484 
-321253.211930  7388750.123467 
-321274.775823  7388748.283782 
-321294.327636  7388743.534596 
-321310.820097  7388738.645433 
-321323.016272  7388726.277552 
-321336.366920  7388710.940179 
-321345.528482  7388696.312685 
-321357.559733  7388681.175277 
-321365.253466  7388669.417291 
-321373.532681  7388643.601713 
-321381.729435  7388623.985074 
-321389.579846  7388599.939192 
-321397.496228  7388578.212914 
-321405.635257  7388547.418189 
-321408.274051  7388531.720878 
-321416.190433  7388510.554503 
-321431.520175  7388491.907697 
-321456.407299  7388485.008879 
-321471.440178  7388482.759264 
-321483.941464  7388478.589978 
-321500.780267  7388479.019905 
-321513.735095  7388479.619802 
-321528.438124  7388479.469828 
-321538.935576  7388480.819597 
-321558.223509  7388481.049557 
-321558.264740  7388477.290201 
-321556.829896  7388469.511534 
-321552.335701  7388461.592890 
-321545.095510  7388452.314479 
-321537.187375  7388448.235178 
-321523.177029  7388442.416175 
-321508.053442  7388435.467365 
-321499.634040  7388430.718178 
-321495.197568  7388426.228947 
-321489.878750  7388419.190153 
-321479.958534  7388403.782792 
-321469.757947  7388386.825697 
-321462.855852  7388358.940473 
-321461.684887  7388345.632753 
-321459.780008  7388334.864597 
-321456.382561  7388320.427070 
-321454.469435  7388310.208821 
-321452.490340  7388305.089697 
-321447.253983  7388299.270694 
-321440.566290  7388295.201391 
-321428.485562  7388289.402385 
-321416.009015  7388283.603378 
-321405.552795  7388278.594236 
-321393.562776  7388274.135000 
-321377.903184  7388269.735753 
-321361.212813  7388265.426491 
-321351.135919  7388263.306854 
-321342.065065  7388262.427005 
-321327.559946  7388263.026902 
-321310.127414  7388261.587149 
-321300.891636  7388257.047927 
-321293.338088  7388248.649365 
-321282.527280  7388231.462309 
-321274.314034  7388218.624508 
-321269.349803  7388207.596397 
-321266.488361  7388199.477788 
-321262.958975  7388187.909769 
-321259.833653  7388176.461730 
-321259.042015  7388165.493609 
-321260.740739  7388143.917305 
-321262.084874  7388134.178973 
-321265.902879  7388122.041052 
-321269.531220  7388109.573188 
-321272.557587  7388103.744186 
-321281.735642  7388096.095496 
-321292.422757  7388081.827940 
-321297.551912  7388071.589694 
-321298.599184  7388060.861532 
-321296.100576  7388048.093719 
-321293.783385  7388037.875469 
-321292.208355  7388024.347786 
-321289.544822  7388000.391889 
-321284.877456  7387981.505125 
-321279.006140  7387960.938647 
-321272.054567  7387945.231338 
-321255.702292  7387913.246817 
-321246.103679  7387897.069588 
-321240.487996  7387889.140946 
-321236.389620  7387882.222131 
-321230.914122  7387870.414153 
-321227.549660  7387861.845621 
-321252.956297  7387801.076030 
-321345.033708  7387624.826220 
-321356.891788  7387580.823758 
-321356.908280  7387580.823758 
-321356.900034  7387580.793763 
-321356.908280  7387580.773766 
-321356.900034  7387580.773766 
-321346.419075  7387518.064508 
-321378.373219  7387312.749676 
-321405.429102  7387203.348416 
-321404.431308  7387191.660418 
-321409.791358  7387175.963107 
-321457.932852  7387072.140890 
-321543.207123  7387086.988347 
-321598.580562  7387098.356400 
-321678.387582  7387137.839637 
-321801.907871  7387225.344648 
-321809.527388  7387230.933691 
-321813.848413  7387232.973341 
-321820.973156  7387238.822339 
-321828.337040  7387244.411382 
-321834.942271  7387249.240555 
-321840.533215  7387255.339510 
-321844.845994  7387261.178510 
-321846.371547  7387266.757554 
-321847.888853  7387276.135948 
-321849.397913  7387286.794122 
-321850.659587  7387298.962038 
-321852.176893  7387310.110128 
-321854.972365  7387317.978781 
-321857.512204  7387321.528173 
-321865.131721  7387325.857431 
-321872.000832  7387328.666950 
-321880.642881  7387329.946731 
-321931.761265  7387326.027402 
-321962.033178  7387323.567823 
-322195.508706  7387309.190286 
-322250.956361  7387306.540740 
-322251.236733  7387283.734646 
-322246.429180  7387262.428296 
-322277.690641  7387284.304549 
-322301.827358  7387303.371283 
-322315.812965  7387312.019801 
-322323.943748  7387317.358887 
-322338.432376  7387323.737794 
-322363.096852  7387324.557654 
-322403.033347  7387325.667464 
-322415.229522  7387327.217198 
-322434.583425  7387305.980836 
-322503.043632  7387263.818058 
-322653.669281  7387188.161017 
-322776.323715  7387130.930820 
-322818.808296  7387109.494492 
-322837.131420  7387105.215225 
-322855.190665  7387102.725652 
-322871.971745  7387103.535513 
-322894.863281  7387105.615157 
-322907.570722  7387108.194715 
-322921.036817  7387113.543798 
-322931.979565  7387118.133012 
-322943.161454  7387124.241966 
-322954.598976  7387130.860832 
-322960.948573  7387136.449875 
-323054.683477  7387247.190906 
-323115.639614  7387322.617986 
-323132.907221  7387346.743853 
-323159.352883  7387357.951934 
-323178.673801  7387362.561144 
-323198.250353  7387366.920397 
-323221.339799  7387369.259997 
-323237.667335  7387370.309817 
-323251.397309  7387370.599767 
-323272.507660  7387370.139846 
-323314.992240  7387360.871434 
-323374.257900  7387350.123275 
-323380.343618  7387373.199322 
-323382.520623  7387378.798363 
-323382.883457  7387380.048149 
-323387.946643  7387392.725977 
-323393.793220  7387405.933715 
-323401.660124  7387422.420891 
-323421.970590  7387457.964802 
-323429.590107  7387467.353194 
-323437.209624  7387476.241672 
-323455.747151  7387495.798322 
-323495.898048  7387530.882312 
-323620.416131  7387628.505590 
-323660.064008  7387657.000709 
-323676.828595  7387671.488228 
-323701.732211  7387697.403789 
-323727.130602  7387729.138353 
-323789.076286  7387832.960569 
-323851.747639  7387938.522487 
-323889.441159  7388000.001956 
-323911.887399  7388042.034756 
-323924.570102  7388067.140456 
-323946.406121  7388106.273753 
-323967.640165  7388153.025745 
-323975.070018  7388183.310557 
-323979.580707  7388206.286622 
-323984.577922  7388256.897952 
-323989.204058  7388297.161056 
-323999.957142  7388360.750163 
-324000.781766  7388368.738795 
-324002.620675  7388431.478048 
-324007.741584  7388477.370187 
-324009.481539  7388510.394531 
-324009.110458  7388541.409218 
-324004.137981  7388572.803840 
-324002.299072  7388589.840922 
-323999.998374  7388600.319127 
-323992.906615  7388612.277079 
-323989.979203  7388620.055747 
-323987.126008  7388654.889780 
-323986.763173  7388677.915836 
-323988.808239  7388705.261152 
-324010.891644  7388749.303608 
-324026.081201  7388763.101244 
-324034.360417  7388773.669434 
-324099.217021  7388830.589684 
-324228.369485  7388940.110924 
-324317.453515  7389019.857264 
-324419.129539  7389110.401755 
-324497.691378  7389175.600587 
-324544.043441  7389206.235339 
-324506.333428  7389206.895226 
-324496.660599  7389224.092281 
-324498.103690  7389238.299847 
-324502.630870  7389253.997158 
-324522.792904  7389258.336415 
-324489.370931  7389478.298737 
-324470.833405  7389604.827064 
-324468.268827  7389624.423708 
-324458.191933  7389653.008811 
-324440.907834  7389675.584944 
-324430.377397  7389688.912661 
-324419.343941  7389702.010418 
-324405.778891  7389717.417778 
-324388.478299  7389754.021509 
-324383.489330  7389767.489202 
-324366.510341  7389831.678207 
-324359.723693  7389871.741344 
-324326.977911  7389999.999375 
-324327.299514  7390003.518772 
-324321.518907  7390025.105074 
-324313.487078  7390058.119419 
-324307.203450  7390079.445766 
-324291.791245  7390110.190500 
-324257.124091  7390165.591010 
-324170.340760  7390305.107113 
-324062.075998  7390490.355381 
-324000.600348  7390773.936806 
-323991.463525  7390811.100441 
-323962.675934  7390954.815823 
-323902.519681  7390902.244828 
-323730.767189  7390749.990908 
-323671.996303  7390695.700208 
-323611.370016  7390644.968897 
-323541.103884  7390603.466006 
-323508.366349  7390590.078300 
-323452.580598  7390565.532504 
-323398.287416  7390543.216327 
-323356.017237  7390510.101999 
-323314.390265  7390462.990069 
-323285.462488  7390416.727993 
-323273.348775  7390363.457118 
-323259.107535  7390325.693586 
-323243.332496  7390290.459622 
-323220.878010  7390263.594223 
-323201.458136  7390240.298214 
-323185.757313  7390232.039628 
-323123.960061  7390196.745674 
-323090.249470  7390181.758241 
-323059.070472  7390168.820457 
-322995.706436  7390139.865417 
-322925.267133  7390105.031384 
-322856.872896  7390260.554744 
-322798.572046  7390389.432668 
-322755.221611  7390487.355895 
-322739.999069  7390519.570377 
-322711.079539  7390588.078642 
-322690.678364  7390635.530514 
-322670.310174  7390679.932908 
-322641.646277  7390670.614504 
-322530.198469  7390646.888569 
-322444.652073  7390633.340889 
-322363.896736  7390635.120584 
-322317.660121  7390639.379855 
-322264.521410  7390640.439673 
-322148.266051  7390644.878913 
-322026.708365  7390650.198002 
-321933.525958  7390643.989065 
-321842.132984  7390623.582561 
-321789.340616  7390583.729387 
-321619.608450  7390494.244715 
-321555.386806  7390480.057145 
-321373.722345  7390466.579454 
-321220.573349  7390471.788562 
-321087.479187  7390466.119533 
-320954.822074  7390460.620475 
-320891.309606  7390458.760793 
-320876.697285  7390395.441639 
-320866.422482  7390373.225445 
-320858.143266  7390356.628287 
-320820.251836  7390282.311017 
-320813.028138  7390259.114991 
-320848.330252  7390142.754922 
-320917.648066  7390122.468397 
-320970.052862  7390110.630425 
-321044.640018  7390024.795128 
-321074.120293  7390026.544828 
-321070.929002  7390008.537912 
-321069.106585  7389989.461180 
-321068.207745  7389969.464605 
-321061.841655  7389951.297717 
-321040.071607  7389930.811226 
-321023.843025  7389921.752778 
-321002.823383  7389913.524187 
-320895.968726  7389869.121793 
-320769.413824  7389817.840577 
-320625.327436  7389754.821372 
-320564.288837  7389725.306427 
-320531.073020  7389702.870270 
-320419.567489  7389627.903112 
-320402.027756  7389574.232305 
-Region 1
-1343
-336095.858105  7355254.410980 
-336145.822016  7355302.272781 
-336158.793337  7355316.480348 
-336178.658506  7355333.317464 
-336189.749687  7355343.195771 
-336198.927741  7355359.912908 
-336211.412535  7355381.429222 
-336223.031474  7355389.647815 
-336244.735553  7355396.656614 
-336262.234054  7355398.406314 
-336271.577033  7355400.505955 
-336283.888656  7355409.944338 
-336285.587379  7355422.262228 
-336281.175646  7355434.060207 
-336267.165300  7355439.109342 
-336249.592583  7355444.218467 
-336234.543212  7355451.357244 
-336212.220665  7355453.546869 
-336190.780466  7355458.396039 
-336168.730045  7355463.345191 
-336152.353031  7355470.693932 
-336140.585660  7355475.543102 
-336128.669856  7355484.711531 
-336110.239531  7355494.139916 
-336092.930693  7355502.688452 
-336076.825804  7355512.586756 
-336059.022192  7355520.355426 
-336026.358873  7355536.372682 
-336002.362341  7355551.170147 
-335980.922142  7355564.657837 
-335960.224103  7355576.045886 
-335944.449064  7355584.394456 
-335920.155668  7355598.632018 
-335904.743463  7355619.608424 
-335876.582585  7355642.654477 
-335858.655280  7355660.951343 
-335844.009974  7355676.618659 
-335828.919372  7355687.526791 
-335802.902515  7355700.854508 
-335781.569516  7355705.373734 
-335757.383321  7355710.072929 
-335730.154268  7355713.532336 
-335723.013032  7355723.750586 
-335720.374238  7355731.699224 
-335719.813495  7355763.363800 
-335718.757977  7355783.950274 
-335721.710128  7355793.288675 
-335725.618841  7355807.736200 
-335725.453916  7355822.023753 
-335722.930570  7355829.302506 
-335713.711284  7355833.961708 
-335703.791068  7355837.831045 
-335692.493732  7355845.789682 
-335683.843437  7355854.218238 
-335674.327286  7355867.405979 
-335650.883253  7355896.261036 
-335637.037831  7355913.718046 
-335623.901586  7355931.395018 
-335613.305180  7355950.101814 
-335603.318994  7355977.347147 
-335594.371834  7356011.691264 
-335591.922703  7356029.828158 
-335591.452668  7356044.325674 
-335591.213528  7356065.482050 
-335591.592854  7356076.780115 
-335590.322935  7356107.444863 
-335589.622005  7356124.501941 
-335589.861146  7356147.647976 
-335589.110739  7356169.014316 
-335587.115151  7356192.580280 
-335581.788086  7356212.676837 
-335573.657303  7356238.392432 
-335562.780524  7356263.188185 
-335563.448469  7356293.882927 
-335569.361016  7356310.999995 
-335574.820021  7356323.357879 
-335582.530247  7356335.515796 
-335590.842447  7356347.243787 
-335599.022708  7356362.401191 
-335598.387748  7356373.689257 
-335599.253603  7356386.767017 
-335599.946286  7356397.525174 
-335598.420733  7356414.892200 
-335593.283332  7356428.119934 
-335587.692387  7356444.897060 
-335579.710036  7356457.434912 
-335571.150448  7356475.941742 
-335559.869605  7356491.649052 
-335548.786671  7356508.026247 
-335535.279345  7356531.022308 
-335528.179341  7356555.528110 
-335523.965517  7356576.854457 
-335517.104653  7356597.930847 
-335511.530201  7356622.456646 
-335503.547850  7356652.271539 
-335493.586403  7356686.375697 
-335483.657941  7356717.390384 
-335475.048877  7356740.106493 
-335474.883952  7356754.723989 
-335479.683258  7356780.469579 
-335481.967464  7356803.095704 
-335479.163746  7356825.881801 
-335471.362811  7356840.189350 
-335468.971405  7356853.447079 
-335459.694395  7356871.953909 
-335454.070466  7356891.930487 
-335443.894617  7356917.956029 
-335437.429572  7356930.733841 
-335425.596231  7356950.420468 
-335415.148257  7356973.666487 
-335403.974615  7357007.210741 
-335397.534308  7357035.825839 
-335394.392495  7357043.104592 
-335386.608053  7357065.270796 
-335380.481103  7357084.367525 
-335374.766466  7357103.124312 
-335369.224999  7357124.880585 
-335363.881441  7357146.976800 
-335358.851240  7357167.733245 
-335350.481316  7357187.579845 
-335346.069583  7357225.963270 
-335342.672136  7357256.268080 
-335341.806282  7357269.105881 
-335343.092694  7357290.502216 
-335344.981081  7357303.589974 
-335350.275161  7357330.565353 
-335352.600598  7357349.422123 
-335355.437301  7357395.414245 
-335348.675392  7357407.962096 
-335341.245538  7357416.190686 
-335335.803026  7357429.418420 
-335330.541931  7357444.195889 
-335328.084554  7357462.772707 
-335328.092800  7357479.829785 
-335331.440770  7357498.916516 
-335333.221956  7357521.642623 
-335327.424855  7357547.718157 
-335323.277001  7357554.207045 
-335317.529379  7357566.654913 
-335313.571188  7357583.442038 
-335316.960389  7357598.329487 
-335318.906499  7357606.428100 
-335324.381996  7357617.456211 
-335334.063071  7357634.733252 
-335344.552277  7357652.910138 
-335354.695140  7357673.956533 
-335362.867155  7357698.422342 
-335372.820355  7357736.965740 
-335378.840104  7357771.699791 
-335383.746611  7357805.204052 
-335384.826867  7357826.590388 
-335387.086334  7357852.206001 
-335392.198997  7357876.631817 
-335396.709685  7357901.047635 
-335401.822348  7357925.803394 
-335404.057077  7357953.188703 
-335410.019102  7357984.493341 
-335414.909116  7358001.600411 
-335419.230141  7358024.796438 
-335421.291699  7358049.412221 
-335422.767774  7358071.798387 
-335422.891468  7358087.865634 
-335422.157553  7358107.462278 
-335421.522593  7358118.080459 
-335419.980548  7358146.195643 
-335415.403890  7358172.731098 
-335414.241172  7358184.789032 
-335413.070207  7358198.616664 
-335410.373690  7358211.874393 
-335405.244534  7358223.672372 
-335400.535936  7358234.910447 
-335394.252309  7358249.907878 
-335388.719088  7358252.607416 
-335380.514088  7358258.056482 
-335375.285978  7358261.095962 
-335370.519657  7358267.684833 
-335371.674129  7358273.573824 
-335376.712576  7358278.832923 
-335388.356254  7358284.281990 
-335401.236866  7358289.411111 
-335405.986695  7358292.570570 
-335407.677172  7358305.108423 
-335405.813524  7358307.627991 
-335404.189017  7358315.916571 
-335404.741514  7358321.125679 
-335412.517710  7358326.754715 
-335417.077875  7358329.354270 
-335424.614930  7358329.224292 
-335433.248733  7358331.093972 
-335445.618079  7358335.993132 
-335453.872556  7358344.841617 
-335456.841199  7358352.400322 
-335459.075928  7358361.288799 
-335455.769189  7358366.017989 
-335452.792300  7358377.056099 
-335456.577320  7358383.854934 
-335459.809842  7358386.444491 
-335464.304038  7358394.023192 
-335463.232028  7358399.212304 
-335460.626219  7358404.501398 
-335463.034118  7358416.379363 
-335472.649223  7358421.478490 
-335477.687670  7358426.297664 
-335482.181866  7358434.436270 
-335480.516127  7358445.934300 
-335478.034012  7358458.532143 
-335480.507881  7358465.091019 
-335488.358293  7358472.939675 
-335499.672121  7358481.148269 
-335506.392799  7358490.526662 
-335511.414754  7358496.565628 
-335519.042517  7358497.655441 
-335534.190843  7358499.375147 
-335535.427777  7358507.143816 
-335533.415697  7358522.961106 
-335528.327773  7358531.209694 
-335520.551577  7358543.407604 
-335515.331713  7358554.425717 
-335512.618703  7358569.013218 
-335510.260281  7358579.731382 
-335510.928226  7358592.589180 
-335519.190949  7358600.547817 
-335517.343794  7358610.826056 
-335508.833683  7358615.495256 
-335501.972820  7358618.624720 
-335487.104866  7358627.643175 
-335483.460032  7358643.220507 
-335482.453992  7358651.189142 
-335473.432615  7358664.926789 
-335461.228194  7358672.435503 
-335451.984169  7358679.084364 
-335443.853386  7358695.821497 
-335453.353044  7358710.998897 
-335452.182079  7358733.135106 
-335450.475109  7358748.842415 
-335447.852808  7358773.288228 
-335448.520753  7358786.365988 
-335447.036431  7358827.438952 
-335449.065004  7358863.902706 
-335451.687305  7358883.979267 
-335453.864310  7358907.375260 
-335451.703798  7358926.731944 
-335452.511928  7358954.317219 
-335454.449792  7358972.174160 
-335453.427260  7358999.069553 
-335448.982541  7359022.395558 
-335443.474059  7359049.910845 
-335438.476844  7359077.316150 
-335424.854071  7359110.830410 
-335416.583101  7359130.347067 
-335405.458936  7359159.342100 
-335396.627223  7359192.466426 
-335383.655902  7359230.979829 
-335364.128828  7359255.565618 
-335363.601069  7359283.360857 
-335379.334877  7359314.885457 
-335384.233138  7359350.269396 
-335388.479947  7359397.281343 
-335392.462877  7359441.073842 
-335397.163228  7359493.514859 
-335397.897143  7359544.576113 
-335405.219795  7359617.433633 
-335414.092740  7359696.610071 
-335415.008071  7359794.533298 
-335422.619342  7359868.710592 
-335435.747341  7359914.492750 
-335456.478365  7359962.914455 
-335476.153871  7359988.720035 
-335488.572695  7360024.973825 
-335481.497429  7360064.757011 
-335450.747235  7360108.709482 
-335408.345117  7360146.333038 
-335365.555426  7360173.858323 
-335326.567248  7360207.642536 
-335296.633430  7360242.296600 
-335228.313409  7360284.159429 
-335182.332427  7360296.587300 
-335109.303809  7360340.499779 
-334898.909480  7360469.787633 
-334843.280408  7360506.031424 
-334798.107556  7360518.909219 
-334770.053880  7360531.327092 
-334739.905661  7360566.651041 
-334702.657437  7360608.083944 
-334643.952521  7360664.564269 
-334584.686861  7360715.605526 
-334503.898539  7360769.946218 
-334296.703748  7360867.809455 
-334172.696932  7360915.001372 
-334088.387470  7360946.925903 
-333997.250129  7360979.440334 
-333920.123133  7361025.072517 
-333837.570118  7361116.826801 
-333794.599010  7361212.350438 
-333775.814097  7361286.897669 
-333748.939631  7361391.369774 
-333732.595602  7361457.188500 
-333712.623232  7361555.091730 
-333714.157030  7361642.826702 
-333717.199890  7361714.414439 
-333708.706272  7361779.553282 
-333685.435409  7361836.433539 
-333663.838531  7361907.401382 
-333654.825401  7361990.807096 
-333656.680803  7362086.410720 
-333659.583476  7362170.616296 
-333661.471863  7362253.822044 
-333659.971049  7362322.250323 
-333657.497180  7362351.795262 
-333639.594613  7362534.783918 
-333632.585317  7362630.397540 
-333620.084031  7362750.976886 
-333610.205047  7362856.968730 
-333598.899465  7362954.302058 
-333586.802244  7363048.635899 
-333584.666471  7363128.472224 
-333576.007928  7363216.757102 
-333575.339984  7363336.146651 
-333566.450547  7363479.692063 
-333575.950205  7363610.609638 
-333607.475545  7363695.365120 
-333710.273056  7363899.570142 
-333601.917585  7363797.637602 
-333411.734768  7363634.625525 
-333271.870450  7363482.161640 
-333102.674289  7363259.029861 
-333023.180626  7363137.490679 
-332933.840963  7362995.794951 
-332834.185266  7362873.915827 
-332754.468954  7362772.533193 
-332624.574329  7362640.335837 
-332484.949152  7362477.903661 
-332314.854152  7362325.069840 
-331887.839590  7361882.835590 
-331818.612484  7361843.812275 
-331736.818122  7361798.670007 
-331646.249771  7361746.658916 
-331565.609882  7361690.678505 
-331482.858957  7361632.228517 
-331383.937174  7361553.541995 
-331291.818532  7361477.255063 
-331213.438109  7361437.461879 
-331156.605088  7361418.855066 
-331100.835830  7361414.105880 
-331034.816507  7361414.885746 
-330979.319375  7361421.434624 
-330797.795100  7361446.660303 
-330725.525134  7361458.768229 
-330643.203014  7361468.326592 
-330588.695429  7361476.995107 
-330528.704101  7361484.703787 
-330482.954014  7361494.132172 
-330437.269896  7361506.999968 
-330381.063588  7361521.627462 
-330343.807118  7361545.663345 
-330296.482000  7361575.788185 
-330265.896731  7361604.003352 
-330230.487416  7361634.938053 
-330204.544775  7361657.664160 
-330154.737542  7361691.528360 
-330113.737283  7361721.503225 
-330067.962456  7361750.318289 
-330003.724320  7361764.175916 
-329949.216735  7361773.064393 
-329863.645600  7361781.352973 
-329782.296534  7361785.712227 
-329695.917268  7361784.692401 
-329624.636851  7361781.862886 
-329538.059675  7361771.974580 
-329492.812608  7361764.575847 
-329443.335224  7361753.247788 
-329393.593960  7361738.150374 
-329332.769763  7361729.901787 
-329279.466128  7361722.842996 
-329220.398378  7361721.593210 
-329163.219015  7361723.792833 
-329088.260778  7361730.101752 
-328997.642950  7361734.790949 
-328915.461015  7361706.015878 
-328879.086892  7361689.188760 
-328840.923336  7361660.273713 
-328809.076393  7361631.428654 
-328773.856742  7361602.773562 
-328752.531990  7361580.257419 
-328728.007700  7361552.052251 
-328697.084335  7361513.468860 
-328625.696716  7361442.840957 
-328592.629331  7361413.216032 
-328572.953825  7361397.808671 
-328546.986445  7361379.331836 
-328515.642522  7361359.575220 
-328484.273861  7361350.226821 
-328459.394983  7361343.957895 
-328441.591371  7361341.638293 
-328378.812817  7361335.239389 
-328335.297458  7361319.552076 
-328301.578621  7361302.095066 
-328273.186849  7361282.148483 
-328249.825277  7361259.272401 
-328239.789614  7361246.754545 
-328219.347209  7361226.677984 
-328200.026290  7361215.489901 
-328171.766458  7361201.642273 
-328163.008961  7361184.475213 
-328162.901760  7361184.365232 
-328163.008961  7361184.475213 
-328154.457620  7361175.066825 
-328151.200359  7361157.639810 
-328149.328464  7361152.640666 
-328140.521490  7361139.352942 
-328132.918465  7361135.823547 
-328084.579061  7361140.682714 
-328075.623655  7361139.462923 
-328055.585314  7361137.013343 
-328045.434204  7361134.013857 
-328026.410150  7361123.595641 
-328013.166704  7361123.655631 
-327997.696775  7361122.145890 
-327985.022319  7361117.116751 
-327982.515465  7361113.877306 
-327977.963545  7361102.409270 
-327972.306631  7361090.051387 
-327967.062028  7361085.782118 
-327957.347969  7361088.321683 
-327952.746572  7361098.679909 
-327941.119387  7361108.068301 
-327931.891855  7361113.047448 
-327922.012870  7361121.466006 
-327911.845268  7361128.764756 
-327902.172439  7361136.283468 
-327888.689852  7361156.510003 
-327865.542683  7361158.339690 
-327853.635126  7361157.419848 
-327838.132212  7361159.229538 
-327825.680404  7361161.289185 
-327803.580506  7361168.897881 
-327787.351924  7361171.687404 
-327769.292679  7361182.105619 
-327759.133323  7361188.414538 
-327745.716705  7361203.311987 
-327731.153862  7361228.167729 
-327721.472787  7361245.334788 
-327707.215054  7361262.001934 
-327691.275091  7361274.659765 
-327682.072297  7361286.177792 
-327656.410027  7361311.233501 
-327642.910948  7361323.811346 
-327628.372843  7361338.698796 
-327616.250884  7361355.395936 
-327609.307558  7361365.164263 
-327595.857956  7361382.281331 
-327587.718926  7361398.688520 
-327578.070836  7361413.086054 
-327561.784531  7361420.864722 
-327552.647707  7361426.513754 
-327534.827603  7361434.052463 
-327520.586362  7361441.191240 
-327458.896311  7361402.907798 
-327448.266920  7361405.777306 
-327397.107305  7361397.838666 
-327268.103272  7361731.551504 
-327265.208845  7361739.080214 
-327124.453935  7362465.335813 
-326951.258352  7363243.712484 
-326775.687856  7363903.469474 
-326611.827006  7364519.253996 
-326607.192625  7364555.987704 
-326627.874171  7364820.742354 
-326635.304025  7364897.279243 
-326703.426136  7365162.193866 
-326789.137458  7365381.496301 
-326879.565623  7365668.287177 
-326773.007831  7366250.047527 
-326661.279652  7366570.552627 
-326246.098431  7367155.122495 
-326169.334270  7368025.373429 
-325671.896899  7369380.911238 
-325613.488847  7369526.546292 
-325608.021596  7369615.920983 
-325585.748527  7369832.083956 
-325581.237839  7370033.769409 
-325573.651307  7370287.315979 
-325573.469890  7370334.217945 
-325574.055372  7370336.627532 
-325529.971023  7370347.375691 
-325513.626994  7370358.253828 
-325504.820019  7370378.640336 
-325502.766708  7370396.777229 
-325501.645221  7370430.881388 
-325495.188422  7370441.659541 
-325484.938357  7370454.717305 
-325472.577258  7370468.045022 
-325449.166209  7370488.291554 
-325436.961787  7370494.230536 
-325421.813462  7370508.118158 
-325415.637035  7370521.005950 
-325405.073614  7370534.943563 
-325389.075926  7370542.832211 
-325350.524798  7370569.837586 
-325338.246160  7370581.875524 
-325313.862056  7370592.103772 
-325297.377841  7370597.772801 
-325242.614624  7370608.630941 
-325218.296489  7370613.100175 
-325198.241656  7370619.169136 
-325153.629549  7370625.927978 
-325096.301753  7370635.996253 
-325062.632393  7370638.245868 
-325054.344932  7370639.515650 
-325004.958256  7370644.524792 
-324981.901795  7370646.024535 
-324897.039836  7370649.983857 
-324853.606939  7370650.673739 
-324806.751856  7370656.092811 
-324748.269589  7370662.021795 
-324720.158188  7370659.912157 
-324703.278154  7370655.942837 
-324664.496132  7370634.656483 
-324644.408314  7370626.547872 
-324622.374385  7370627.827652 
-324606.863226  7370637.945919 
-324592.151950  7370640.315513 
-324574.628710  7370639.325683 
-324545.832873  7370635.096407 
-324509.532965  7370627.017791 
-324482.056525  7370623.138456 
-324462.999486  7370622.908495 
-324434.244879  7370623.558384 
-324410.908047  7370623.158452 
-324368.209064  7370621.648711 
-324332.791504  7370617.119487 
-324312.629470  7370615.329793 
-324284.394376  7370606.341333 
-324264.133387  7370604.101716 
-324241.711886  7370595.193242 
-324215.381672  7370581.135650 
-324182.833800  7370575.426628 
-324161.302891  7370576.606426 
-324149.799400  7370583.775198 
-324115.882653  7370606.401323 
-324098.153257  7370631.437034 
-324095.407262  7370647.464289 
-324093.659061  7370673.809776 
-324105.005875  7370696.205940 
-324113.953035  7370706.614157 
-324124.763843  7370715.162693 
-324148.818098  7370740.488355 
-324165.549700  7370755.865721 
-324181.308247  7370768.243600 
-324186.016845  7370782.921086 
-324191.682005  7370795.398949 
-324203.201989  7370803.837504 
-324218.358561  7370806.577034 
-324234.504681  7370811.646166 
-324251.359976  7370817.165221 
-324258.031177  7370829.873044 
-324263.440704  7370846.110263 
-324262.846975  7370878.224762 
-324257.940468  7370888.243046 
-324249.826177  7370909.849345 
-324237.959851  7370929.865916 
-324194.848558  7370979.627392 
-324167.207192  7371072.891417 
-324161.640987  7371120.113328 
-324188.556684  7371170.284734 
-324217.872034  7371232.884012 
-324234.496435  7371307.851171 
-324233.952183  7371352.593507 
-324228.237545  7371412.333274 
-324210.005129  7371469.373503 
-324164.197318  7371531.072935 
-324072.911545  7371627.096487 
-324012.136825  7371678.637658 
-323971.441677  7371730.428787 
-323955.881040  7371777.640700 
-323974.888601  7371857.507019 
-323997.120439  7371882.702704 
-324011.839961  7371912.787550 
-324033.494562  7371985.265136 
-324022.073533  7372094.666396 
-323985.946797  7372181.401539 
-323940.015292  7372253.059265 
-323922.500298  7372360.170918 
-323933.838865  7372669.108000 
-323911.755459  7372833.209890 
-323880.823848  7372912.476313 
-323798.996502  7373050.932596 
-323746.905063  7373209.685404 
-323699.307819  7373418.219684 
-323479.669466  7373360.829514 
-323274.527986  7373343.382502 
-323129.781900  7373306.728781 
-323066.417863  7373296.880468 
-322895.605442  7373204.296327 
-322487.012959  7373033.715546 
-322287.462424  7372967.796837 
-322202.212892  7372976.615326 
-322101.674848  7373010.269562 
-322020.573169  7373089.026071 
-321843.188502  7373261.076601 
-321696.018023  7373413.670463 
-321630.056424  7373487.617796 
-321527.168205  7373538.189134 
-321080.857463  7373572.453265 
-320820.070419  7373594.159547 
-320515.083579  7373545.527877 
-320316.052556  7373438.506209 
-320192.961071  7373267.615481 
-320115.883553  7373012.569168 
-320090.666580  7372628.684924 
-320092.150901  7372509.195391 
-320124.162769  7372345.213480 
-320136.631069  7372243.690870 
-320110.432795  7372128.840542 
-320067.008144  7371996.263252 
-320018.198705  7371895.970431 
-319961.283221  7371840.549924 
-319851.616599  7371796.877405 
-319720.996306  7371724.579789 
-319698.277941  7371633.035469 
-319684.259348  7371555.658723 
-319697.939845  7371463.674479 
-319742.271581  7371317.239562 
-319756.141741  7371210.297881 
-319734.643818  7371127.852003 
-319682.725550  7371072.481487 
-319628.415875  7371004.573119 
-319545.161930  7370854.008910 
-319501.135305  7370771.273082 
-319436.996123  7370690.836860 
-319372.609554  7370630.217243 
-319305.369789  7370602.022073 
-319222.866251  7370588.474393 
-319107.781856  7370579.615911 
-319000.572612  7370535.963388 
-318926.100903  7370482.752502 
-318859.735239  7370384.779284 
-318763.839822  7370244.023395 
-318655.459613  7370090.809639 
-318572.032498  7369955.292852 
-318522.926194  7369879.915763 
-318418.553653  7369813.807087 
-318293.573781  7369789.861188 
-318188.607511  7369771.154393 
-317951.561365  7369700.836438 
-317804.440364  7369654.234420 
-317734.850424  7369610.931837 
-317633.685666  7369485.163380 
-317606.794708  7369434.971978 
-317565.225459  7369352.266145 
-317519.285708  7369219.768840 
-317485.517394  7369117.216406 
-317484.560831  7368998.796691 
-317479.167796  7368925.289282 
-317481.699389  7368821.976978 
-317471.597756  7368733.462140 
-317445.325266  7368634.769045 
-317433.772296  7368556.202503 
-317439.569397  7368492.803363 
-317457.966737  7368424.475067 
-317487.578951  7368355.176937 
-317514.502894  7368305.665418 
-317542.531832  7368273.680896 
-317656.164891  7368194.144520 
-317686.725421  7368154.761266 
-317702.170611  7368126.266147 
-317705.040300  7368092.741890 
-317705.592797  7368049.109364 
-317687.484075  7367997.818149 
-317675.337377  7367966.543506 
-317640.892872  7367917.591891 
-317527.952497  7367837.745568 
-317462.296008  7367782.085102 
-317433.846512  7367750.600495 
-317429.121422  7367729.384130 
-317433.063121  7367715.696474 
-317437.013065  7367702.128798 
-317440.888793  7367693.420290 
-317452.285084  7367678.612826 
-317457.537933  7367666.274940 
-317458.840838  7367660.086000 
-317452.680903  7367647.278194 
-317449.646290  7367637.599851 
-317439.569397  7367628.501410 
-317426.837216  7367620.032860 
-317417.378790  7367610.054570 
-317412.719670  7367599.806325 
-317411.210609  7367589.708055 
-317410.501434  7367581.609442 
-317405.825821  7367572.251045 
-317398.033133  7367560.073131 
-317381.763320  7367540.706448 
-317368.660059  7367529.138430 
-317357.140075  7367521.679707 
-317335.864800  7367511.331480 
-317303.349912  7367495.084263 
-317287.071853  7367484.796025 
-317268.385895  7367471.048380 
-317259.958247  7367460.970106 
-317250.549298  7367455.421057 
-317243.638956  7367453.561375 
-317233.347661  7367453.541379 
-317219.263099  7367454.471220 
-317203.347873  7367455.711007 
-317191.761919  7367453.241430 
-317186.212206  7367448.852182 
-317181.825211  7367441.373463 
-317178.988508  7367431.925082 
-317177.413478  7367419.167267 
-317177.405232  7367387.932617 
-317178.708136  7367373.545082 
-317174.914870  7367358.877594 
-317169.645529  7367340.090812 
-317158.628565  7367325.113377 
-317144.007998  7367304.096977 
-317128.323667  7367287.289856 
-317120.217622  7367275.661848 
-317117.067562  7367266.983335 
-317117.446889  7367261.004359 
-317119.648632  7367256.055207 
-317121.174185  7367248.206551 
-317118.403452  7367241.967620 
-317109.637708  7367233.769024 
-317098.002277  7367226.650243 
-317089.302504  7367221.661098 
-317082.144775  7367215.702119 
-317073.939776  7367203.194261 
-317063.318631  7367180.688116 
-317042.785517  7367136.005770 
-317019.951704  7367096.062612 
-317003.038685  7367071.926746 
-316993.060746  7367054.409747 
-316988.632520  7367041.941882 
-316986.488500  7367034.723119 
-316987.395585  7367026.974446 
-316990.545645  7367019.815672 
-316996.482931  7367009.817385 
-317011.754951  7366994.719971 
-317024.025342  7366983.801841 
-317035.908160  7366970.994035 
-317043.403984  7366958.236220 
-317046.751953  7366943.548736 
-317047.106541  7366931.920728 
-317046.133486  7366919.722817 
-317043.717341  7366909.504567 
-317033.722909  7366886.008592 
-317026.227085  7366865.972024 
-317015.902805  7366836.597056 
-317006.155760  7366816.980416 
-316997.398263  7366808.561858 
-316979.594651  7366797.923680 
-316960.554104  7366788.495295 
-316948.052819  7366786.005722 
-316936.854438  7366784.755936 
-316923.718192  7366783.816097 
-316912.132238  7366781.346520 
-316896.159289  7366771.278244 
-316880.903763  7366760.340118 
-316865.252417  7366756.600759 
-316852.454267  7366753.781241 
-316843.342182  7366748.572134 
-316823.328580  7366735.694340 
-316813.375380  7366732.574874 
-316802.704757  7366730.115295 
-316794.301848  7366726.015997 
-316787.473969  7366717.627434 
-316783.416824  7366708.489000 
-316779.895683  7366696.591038 
-316774.337724  7366676.694446 
-316766.833654  7366665.746321 
-316755.552811  7366655.078148 
-316731.490310  7366639.820762 
-316714.024793  7366626.972963 
-316703.370663  7366615.094997 
-316695.907824  7366600.717460 
-316690.589006  7366594.438535 
-316681.493413  7366588.239597 
-316661.512796  7366580.120988 
-316649.019757  7366577.301471 
-316631.793381  7366576.971527 
-316603.995338  7366575.401796 
-316588.038881  7366571.982382 
-316578.423776  7366566.653295 
-316573.706932  7366560.394367 
-316572.107164  7366550.076134 
-316571.810299  7366541.317635 
-316574.012043  7366528.829774 
-316578.712394  7366503.194165 
-316578.069188  7366489.786461 
-316573.434807  7366477.868503 
-316565.287531  7366461.041385 
-316557.742230  7366445.434059 
-316555.540486  7366433.896035 
-316557.132009  7366421.288195 
-316559.919235  7366410.350068 
-316564.611340  7366401.661556 
-316571.843284  7366394.442793 
-316592.763971  7366375.985954 
-316597.431338  7366369.517062 
-316599.666066  7366362.008349 
-316599.657820  7366354.479638 
-316598.660026  7366345.051253 
-316591.461067  7366333.883166 
-316579.602987  7366320.995374 
-316563.036310  7366301.288749 
-316555.936305  7366290.670568 
-316549.941296  7366273.213558 
-316550.922597  7366260.035816 
-316552.464642  7366250.977367 
-316557.791707  7366240.739121 
-316566.161631  7366231.660676 
-316571.859777  7366223.862012 
-316583.058158  7366201.295877 
-316588.706826  7366189.737857 
-316591.180695  7366179.139672 
-316588.962459  7366169.141385 
-316583.742595  7366163.202402 
-316576.510651  7366162.562512 
-316570.276500  7366164.472185 
-316563.687762  7366169.151383 
-316555.837351  7366177.909883 
-316544.614231  7366186.968331 
-316537.431764  7366190.417741 
-316531.214106  7366190.447735 
-316523.726528  7366186.038491 
-316518.119092  7366178.539775 
-316513.097137  7366164.522176 
-316512.453931  7366151.004492 
-316510.524313  7366134.477323 
-316505.856947  7366117.020313 
-316497.173666  7366102.622779 
-316483.089104  7366087.935295 
-316465.532879  7366073.867705 
-316455.893035  7366062.889585 
-316451.497794  7366047.882156 
-316451.225669  7366029.155363 
-316453.377935  7366011.678357 
-316451.539025  7365987.952421 
-316446.517071  7365974.484728 
-316436.473162  7365954.758107 
-316428.416595  7365938.810839 
-316422.099982  7365930.982180 
-316417.127505  7365929.472438 
-316420.665138  7365899.617552 
-316428.127977  7365889.409301 
-316436.250514  7365884.190195 
-316449.122880  7365873.502025 
-316466.390487  7365869.842652 
-316478.611401  7365862.913839 
-316487.096772  7365852.495624 
-316496.522214  7365848.516305 
-316511.225243  7365846.156709 
-316520.774378  7365840.517675 
-316534.149764  7365822.740720 
-316544.078226  7365819.551267 
-316558.797747  7365815.741919 
-316568.816918  7365805.243717 
-316580.716228  7365791.216120 
-316593.976167  7365782.077686 
-316598.767227  7365766.410369 
-316601.719378  7365750.053171 
-316613.099176  7365736.795442 
-316627.587803  7365727.896966 
-316636.823582  7365722.247934 
-316649.662963  7365706.460638 
-316656.449611  7365693.702823 
-316669.000374  7365684.774353 
-316678.013504  7365672.926382 
-316683.785865  7365659.928609 
-316693.359739  7365644.431263 
-316706.578447  7365638.182333 
-316726.897159  7365635.222840 
-316739.942696  7365627.304197 
-316755.503333  7365621.635168 
-316765.637951  7365617.995791 
-316779.318447  7365616.176103 
-316801.443084  7365615.676189 
-316809.046109  7365610.457083 
-316822.429741  7365599.768913 
-316832.341710  7365597.569290 
-316845.288293  7365597.179357 
-316868.369492  7365593.489989 
-316887.245114  7365583.531695 
-316900.983334  7365577.392746 
-316917.838630  7365565.974702 
-316933.267327  7365555.096565 
-316952.629477  7365546.698004 
-316971.645285  7365542.178778 
-316992.541233  7365533.580251 
-317017.881900  7365536.449759 
-317029.278191  7365537.589564 
-317046.100501  7365545.558199 
-317057.735933  7365551.797130 
-317073.040937  7365558.745940 
-317089.467428  7365564.824899 
-317112.194040  7365572.873520 
-317128.768963  7365584.151588 
-317146.094294  7365592.240203 
-317169.422881  7365592.980076 
-317216.459380  7365580.172270 
-317267.618995  7365556.226372 
-317315.076052  7365542.538716 
-317387.593405  7365530.050855 
-317487.611936  7365526.221511 
-317636.316214  7365532.530431 
-317710.021023  7365522.492150 
-317797.604239  7365495.016856 
-317856.309155  7365462.532421 
-317902.545770  7365432.537559 
-317950.027566  7365408.771629 
-317993.773820  7365390.044837 
-318037.520073  7365380.076545 
-318105.007225  7365386.245488 
-318137.563343  7365382.556120 
-318165.089261  7365365.069115 
-318190.025863  7365343.782761 
-318210.031218  7365324.975983 
-318223.744700  7365320.056826 
-318266.847748  7365320.816695 
-318321.841860  7365315.417620 
-318359.733290  7365308.808752 
-318393.765483  7365301.150064 
-318432.382582  7365292.991462 
-318480.235458  7365280.523597 
-318515.141752  7365268.335685 
-318558.830282  7365253.928153 
-318601.125199  7365237.960888 
-318609.824973  7365234.851420 
-318634.481202  7365210.905522 
-318648.095729  7365197.457826 
-318666.295160  7365176.971335 
-318681.476471  7365160.984073 
-318700.203660  7365146.266594 
-318732.866980  7365125.970071 
-318755.370943  7365111.072623 
-318782.501042  7365092.695770 
-318804.683403  7365078.908132 
-318834.856361  7365062.560932 
-318857.310847  7365050.992914 
-318874.380544  7365038.795003 
-318896.653613  7365026.447118 
-318916.667215  7365006.980453 
-318953.989655  7364980.425001 
-318972.180840  7364968.247087 
-318994.371446  7364953.899545 
-319016.166234  7364938.562172 
-319035.734539  7364929.943648 
-319054.915272  7364919.995352 
-319074.211451  7364917.245823 
-319095.033184  7364914.516291 
-319109.480580  7364908.267361 
-319126.665725  7364895.189601 
-319134.623337  7364885.881196 
-319148.015216  7364874.743104 
-319161.819406  7364862.515198 
-319218.594704  7364820.802343 
-319232.200984  7364832.820285 
-319249.493330  7364843.338483 
-319262.365696  7364848.817545 
-319275.906007  7364858.295921 
-319287.830056  7364858.215935 
-319301.832156  7364854.626549 
-319313.055276  7364845.358137 
-319328.508712  7364832.140401 
-319334.198611  7364817.372931 
-319344.061103  7364802.875414 
-319349.305706  7364790.757490 
-319358.566223  7364775.700069 
-319369.063674  7364766.971564 
-319388.953583  7364757.363210 
-319407.903421  7364749.514554 
-319418.656506  7364737.346638 
-319425.995651  7364721.049430 
-319433.400766  7364699.103189 
-319436.262208  7364674.207454 
-319442.933409  7364661.889564 
-319464.769427  7364643.002799 
-319494.241456  7364633.514424 
-319518.823469  7364615.097579 
-319526.203846  7364611.868132 
-319537.501182  7364604.369416 
-319545.623719  7364590.621771 
-319556.879824  7364578.803795 
-319571.854979  7364571.235092 
-319584.315033  7364568.735520 
-319599.974625  7364563.166474 
-319629.924935  7364547.259199 
-319648.412984  7364535.861151 
-319663.190229  7364527.622562 
-319673.728912  7364515.904570 
-319678.074675  7364510.425508 
-319687.821720  7364505.556342 
-319705.419176  7364491.598733 
-319720.559256  7364478.390995 
-319747.153350  7364462.323747 
-319761.947087  7364452.655404 
-319779.280664  7364444.226847 
-319794.206342  7364431.788978 
-319813.345843  7364417.181480 
-319827.446897  7364405.953403 
-319835.231339  7364394.415380 
-319843.370369  7364387.096633 
-319851.204288  7364379.997849 
-319861.248197  7364367.489992 
-319873.691759  7364350.032982 
-319888.716391  7364330.066402 
-319901.102230  7364316.928652 
-319918.922334  7364293.892598 
-319930.005268  7364279.405080 
-319941.607715  7364264.377654 
-319949.548835  7364256.169060 
-319962.371723  7364241.481576 
-319970.197396  7364226.634119 
-319977.990084  7364214.656171 
-319986.533179  7364199.588752 
-319992.998224  7364188.030731 
-320002.605083  7364169.433917 
-320017.225650  7364156.986049 
-320036.150749  7364143.158418 
-320052.973059  7364133.730033 
-320077.489103  7364121.192180 
-320103.563684  7364105.784819 
-320115.265086  7364098.846008 
-320137.299014  7364080.179205 
-320163.233409  7364055.183487 
-320184.846780  7364034.577017 
-320210.162708  7364014.180510 
-320229.129038  7363997.023449 
-320254.197580  7363980.616260 
-320279.381568  7363954.450741 
-320299.337446  7363939.193355 
-320311.154295  7363931.814619 
-320326.401575  7363926.245573 
-320341.525162  7363914.797534 
-320353.012161  7363908.628590 
-320376.827276  7363886.442391 
-320397.088264  7363863.316352 
-320401.219626  7363858.827121 
-320418.742866  7363842.539911 
-320427.879690  7363820.833629 
-320450.045558  7363791.318685 
-320455.941612  7363768.462600 
-320461.342893  7363743.716838 
-320464.105381  7363726.359811 
-320468.657300  7363704.263596 
-320470.727104  7363685.016893 
-320472.178441  7363667.199945 
-320469.308752  7363652.212512 
-320464.608401  7363628.676544 
-320457.005376  7363608.639976 
-320454.910834  7363596.762010 
-320454.820125  7363579.814913 
-320452.239055  7363566.157253 
-320447.637658  7363551.039842 
-320442.665181  7363541.341503 
-320435.969242  7363514.226148 
-320436.769126  7363490.760167 
-320439.053332  7363470.853577 
-320440.916980  7363460.235396 
-320442.384809  7363448.957328 
-320442.079699  7363432.780099 
-320439.490382  7363419.352399 
-320436.092935  7363405.684740 
-320431.136951  7363394.766610 
-320423.237062  7363382.818657 
-320416.607092  7363366.561442 
-320407.099188  7363353.373701 
-320395.216370  7363333.727066 
-320386.071300  7363315.450196 
-320381.115316  7363304.092142 
-320379.466069  7363280.816129 
-320376.101607  7363264.598907 
-320364.309497  7363237.983466 
-320349.548745  7363220.626439 
-320339.513082  7363208.098585 
-320329.337233  7363198.890162 
-320317.710048  7363191.981346 
-320274.664724  7363170.954947 
-320253.372957  7363154.297800 
-320234.975616  7363142.219869 
-320214.261085  7363120.253632 
-320198.271643  7363103.436512 
-320187.271172  7363086.689381 
-320176.584057  7363061.303729 
-320181.210192  7363033.218540 
-320200.745513  7362994.585158 
-320208.538201  7362974.308631 
-320228.840420  7362963.920410 
-320242.430209  7362968.969545 
-320261.116167  7362982.267268 
-320289.120366  7362991.925613 
-320328.801228  7362996.514827 
-320367.607990  7362997.324688 
-320396.758415  7362988.166257 
-320414.223932  7362976.638232 
-320436.109428  7362962.070727 
-320451.364954  7362948.303085 
-320469.209798  7362930.476139 
-320476.936516  7362915.508703 
-320485.603304  7362890.243031 
-320491.367419  7362869.276622 
-320494.294831  7362838.851833 
-320495.185424  7362808.067107 
-320487.755570  7362774.632834 
-320477.703415  7362747.487483 
-320474.108059  7362733.039958 
-320464.732094  7362700.355557 
-320457.236271  7362680.988874 
-320454.135688  7362659.572542 
-320453.533713  7362642.625445 
-320452.882261  7362621.239109 
-320445.460653  7362603.202198 
-320440.438699  7362589.514543 
-320433.264478  7362568.598125 
-320426.766448  7362550.131289 
-320429.759830  7362530.784603 
-320439.811985  7362508.868357 
-320448.280864  7362491.581318 
-320457.112577  7362469.655074 
-320460.138944  7362447.318899 
-320455.438592  7362415.694317 
-320440.183066  7362380.830288 
-320421.563077  7362337.397728 
-320408.921605  7362314.091720 
-320391.728214  7362287.076348 
-320373.726693  7362260.270939 
-320363.196256  7362246.623277 
-320350.092996  7362226.966644 
-320339.504836  7362202.020917 
-320338.168946  7362170.216365 
-320331.390545  7362141.441294 
-320320.159179  7362118.925150 
-320304.804697  7362100.018389 
-320291.553004  7362092.429689 
-320266.979237  7362077.502246 
-320245.728701  7362066.494131 
-320226.193380  7362064.034553 
-320203.549231  7362066.304164 
-320184.615885  7362064.964393 
-320041.007779  7362028.610620 
-320022.692900  7362018.302386 
-320016.582444  7362009.703859 
-320000.873374  7361994.996378 
-319972.448617  7361986.777786 
-319946.555453  7361996.306154 
-319886.737296  7362021.701804 
-319859.302086  7362024.131388 
-319841.267580  7362023.791446 
-319827.883948  7362018.752309 
-319812.793346  7362011.803499 
-319796.416332  7362009.503893 
-319773.252670  7362012.203431 
-319753.676118  7362013.843150 
-319727.634522  7362010.303756 
-319708.965055  7362004.304784 
-319692.332408  7361990.147209 
-319676.747032  7361981.418704 
-319662.316129  7361970.830518 
-319630.683588  7361966.331288 
-319599.314927  7361973.470066 
-319578.806551  7361983.848288 
-319557.151949  7361988.237536 
-319539.554493  7361994.106531 
-319526.302800  7361995.046370 
-319502.141345  7361987.987579 
-319490.967702  7361985.298039 
-319471.976633  7361971.990319 
-319453.818433  7361957.812747 
-319433.639907  7361950.024082 
-319413.939662  7361944.794977 
-319394.214678  7361941.885476 
-319378.192252  7361943.575186 
-319355.267731  7361951.923756 
-319340.135897  7361956.612953 
-319320.452145  7361966.001345 
-319300.826116  7361971.400420 
-319272.863148  7361975.039797 
-319248.858370  7361979.609014 
-319226.502839  7361983.648322 
-319202.976343  7361990.887082 
-319186.236495  7362001.645239 
-319169.043104  7362023.691463 
-319156.789205  7362042.368264 
-319152.616612  7362049.737002 
-319145.417653  7362063.824589 
-319141.038905  7362079.281941 
-319129.716830  7362097.188874 
-319116.522861  7362108.986853 
-319106.429475  7362117.835337 
-319074.318652  7362127.293717 
-319036.509685  7362127.923609 
-319013.337777  7362131.732957 
-318981.655759  7362131.113063 
-318960.726825  7362134.952405 
-318941.768741  7362143.350966 
-318916.815647  7362150.789692 
-318896.208317  7362152.639375 
-318875.642217  7362151.719533 
-318847.547310  7362149.589898 
-318823.501301  7362149.619893 
-318801.690021  7362150.119807 
-318775.673163  7362153.339256 
-318755.709039  7362152.869336 
-318733.386493  7362153.699194 
-318720.654312  7362153.199280 
-318720.242001  7362137.252011 
-318719.483348  7362124.724157 
-318715.690082  7362102.627942 
-318712.605991  7362080.441742 
-318714.016097  7362057.085743 
-318714.642810  7362031.840067 
-318717.207388  7362005.734539 
-318719.837936  7361975.299752 
-318725.766975  7361948.904273 
-318730.854900  7361933.456919 
-318736.099502  7361913.150398 
-318743.949914  7361880.565979 
-318746.737140  7361853.130679 
-318750.794285  7361830.584541 
-318757.869551  7361818.826555 
-318778.897440  7361798.929963 
-318791.588388  7361786.572079 
-318797.665860  7361773.134381 
-318806.678991  7361753.087815 
-318814.471679  7361732.581328 
-318821.909779  7361716.394100 
-318833.165883  7361688.178933 
-318842.393416  7361659.613826 
-318839.482496  7361631.658615 
-318827.393522  7361604.153326 
-318810.546473  7361582.896967 
-318795.373408  7361557.891250 
-318790.854474  7361520.177710 
-318786.624158  7361492.432463 
-318779.276766  7361452.459310 
-318771.624264  7361421.014696 
-318764.400566  7361388.140327 
-318768.837038  7361359.285270 
-318785.106851  7361345.537625 
-318802.390951  7361331.799978 
-318809.960990  7361321.591726 
-318812.838925  7361294.926294 
-318807.825217  7361280.468770 
-318800.156222  7361258.662506 
-318795.892921  7361241.105513 
-318791.703836  7361225.438197 
-318787.069454  7361205.221660 
-318782.039253  7361192.193891 
-318781.148660  7361173.797042 
-318781.198138  7361145.331918 
-318784.191520  7361125.985232 
-318794.070504  7361102.299289 
-318806.514066  7361076.313740 
-318816.508498  7361059.376641 
-318826.173080  7361044.549181 
-318846.128958  7361013.224547 
-318859.133264  7360999.656871 
-318871.824213  7360986.749082 
-318884.572885  7360969.622016 
-318896.925739  7360951.285157 
-318907.777778  7360930.598700 
-318913.863497  7360916.601098 
-318923.709496  7360895.124776 
-318938.140400  7360873.598464 
-318958.755976  7360854.361759 
-318977.408950  7360837.654620 
-318986.669467  7360830.015929 
-318998.849150  7360817.648047 
-319012.875988  7360804.090370 
-319035.610846  7360786.213432 
-319050.379845  7360770.336151 
-319064.769517  7360760.327866 
-319080.371386  7360742.800868 
-319097.721455  7360723.744132 
-319108.524017  7360707.376936 
-319113.578957  7360693.929239 
-319119.771876  7360687.690308 
-319119.615197  7360686.810459 
-319119.615197  7360583.948078 
-319126.946096  7359466.359511 
-319136.082920  7359463.729961 
-319180.274470  7359446.332941 
-319248.041993  7359416.508050 
-319283.269891  7359412.488738 
-319292.332498  7359411.298942 
-319298.376985  7359408.559411 
-319350.262269  7359362.377322 
-319386.562176  7359347.979788 
-319389.918392  7359336.111821 
-319398.882044  7359313.885628 
-319407.293200  7359298.008348 
-319414.937456  7359284.140723 
-319423.290887  7359276.612013 
-319433.656399  7359267.833517 
-319454.568840  7359261.414616 
-319465.387895  7359260.494774 
-319484.238778  7359260.644748 
-319498.529496  7359266.573732 
-319511.047274  7359272.502717 
-319518.839962  7359273.322576 
-319529.659016  7359271.632866 
-319548.048111  7359266.213794 
-319573.232099  7359261.354626 
-319593.352902  7359260.244816 
-319614.958026  7359261.434613 
-319662.893365  7359272.192770 
-319680.226942  7359273.342573 
-319698.071785  7359275.002289 
-319711.900714  7359274.102443 
-319724.748341  7359269.903162 
-319743.409561  7359262.204481 
-319770.399474  7359250.506485 
-319806.419009  7359239.908300 
-319834.109852  7359235.069129 
-319864.324041  7359229.230129 
-319902.957631  7359239.408386 
-319925.552303  7359244.147574 
-319943.867182  7359248.856767 
-319955.708769  7359252.936068 
-319974.386481  7359269.613212 
-319987.803099  7359291.999377 
-319998.490214  7359307.786673 
-320181.952353  7359475.527940 
-320357.102292  7359526.609191 
-320430.089679  7359519.310441 
-321650.193720  7359181.658278 
-323030.785901  7358765.929488 
-323692.084121  7358570.502963 
-323836.187002  7358520.431540 
-324813.216901  7358187.338596 
-325088.517311  7358098.433824 
-326572.937783  7357617.596187 
-328059.098209  7357476.850296 
-330702.765538  7357474.340726 
-332084.108126  7357442.346206 
-332089.286759  7357391.804863 
-332097.062954  7357342.563298 
-331836.811915  7355681.047900 
-332066.601378  7355329.898049 
-332270.225552  7355060.754151 
-332502.777502  7354836.182618 
-332741.101814  7354236.195391 
-336095.858105  7355254.410980 
-Region 1
-350
-331851.094387  7373867.232772 
-331905.890589  7373687.333587 
-332003.872302  7373405.931788 
-332079.778855  7373207.995693 
-332124.366224  7373029.096337 
-332115.254139  7372873.592973 
-332107.296527  7372653.760628 
-332128.563555  7372428.399231 
-332141.485399  7372386.906338 
-332157.680996  7372352.532226 
-332206.350249  7372226.063889 
-332234.263740  7372166.244136 
-332272.072707  7372061.682046 
-332304.876213  7371966.588335 
-332331.659970  7371880.733041 
-332360.076481  7371786.359206 
-332401.645730  7371674.088437 
-332456.466671  7371543.700772 
-332511.114441  7371446.097490 
-332565.514825  7371369.970530 
-332623.527058  7371298.422786 
-332689.406194  7371208.478192 
-332749.620170  7371131.641354 
-332820.983050  7371042.646598 
-332890.647207  7370959.930766 
-332966.405328  7370870.096154 
-333112.487304  7370718.722083 
-333143.146789  7370676.429327 
-333208.869248  7370599.432516 
-333269.561505  7370525.155239 
-333343.967244  7370445.818829 
-333418.010149  7370362.613081 
-333531.461790  7370238.534335 
-333617.560685  7370134.972074 
-333694.902082  7370039.508426 
-333777.331403  7369944.974619 
-333864.617755  7369844.081901 
-333942.750790  7369759.476393 
-334054.916019  7369613.571385 
-334146.704813  7369502.090481 
-334237.528797  7369403.227415 
-334316.016420  7369305.114221 
-334407.046561  7369197.282692 
-334511.064514  7369005.205593 
-334580.951319  7368847.952529 
-334622.611276  7368743.210470 
-334653.138822  7368640.448073 
-334672.187615  7368507.430857 
-334694.394714  7368320.612857 
-334699.441407  7368244.695861 
-334697.165447  7368171.658372 
-334691.698196  7368119.897238 
-334685.793895  7368048.059543 
-334683.905508  7367980.801064 
-334686.651503  7367919.141626 
-334686.766950  7367837.635587 
-334681.456378  7367678.082917 
-334668.212931  7367454.761170 
-334662.366354  7367208.153412 
-334666.852303  7366949.367739 
-334665.392720  7366676.114545 
-334659.447188  7366286.961204 
-334655.587952  7366009.688698 
-334653.097591  7365906.766327 
-334652.586324  7365799.884635 
-334658.655550  7365714.779213 
-334661.071696  7365548.007780 
-334647.490154  7365390.254801 
-334610.604764  7365194.238377 
-334588.760499  7365090.976065 
-334564.524827  7364965.107625 
-334545.228647  7364878.942384 
-334510.949067  7364811.643912 
-334461.859256  7364756.153417 
-334384.336441  7364692.794270 
-334286.387714  7364597.310625 
-334200.800086  7364508.715801 
-334084.676666  7364363.290711 
-333966.895754  7364212.526535 
-333846.179183  7364068.701171 
-333710.273056  7363899.570142 
-333601.917585  7363797.637602 
-333411.734768  7363634.625525 
-333271.870450  7363482.161640 
-333102.674289  7363259.029861 
-333023.180626  7363137.490679 
-332933.840963  7362995.794951 
-332834.185266  7362873.915827 
-332754.468954  7362772.533193 
-332624.574329  7362640.335837 
-332484.949152  7362477.903661 
-332314.854152  7362325.069840 
-331887.839590  7361882.835590 
-331818.612484  7361843.812275 
-331736.818122  7361798.670007 
-331646.249771  7361746.658916 
-331565.609882  7361690.678505 
-331482.858957  7361632.228517 
-331383.937174  7361553.541995 
-331291.818532  7361477.255063 
-331213.438109  7361437.461879 
-331156.605088  7361418.855066 
-331100.835830  7361414.105880 
-331034.816507  7361414.885746 
-330979.319375  7361421.434624 
-330797.795100  7361446.660303 
-330725.525134  7361458.768229 
-330643.203014  7361468.326592 
-330588.695429  7361476.995107 
-330528.704101  7361484.703787 
-330482.954014  7361494.132172 
-330437.269896  7361506.999968 
-330381.063588  7361521.627462 
-330343.807118  7361545.663345 
-330296.482000  7361575.788185 
-330265.896731  7361604.003352 
-330230.487416  7361634.938053 
-330204.544775  7361657.664160 
-330154.737542  7361691.528360 
-330113.737283  7361721.503225 
-330067.962456  7361750.318289 
-330003.724320  7361764.175916 
-329949.216735  7361773.064393 
-329863.645600  7361781.352973 
-329782.296534  7361785.712227 
-329695.917268  7361784.692401 
-329624.636851  7361781.862886 
-329538.059675  7361771.974580 
-329492.812608  7361764.575847 
-329443.335224  7361753.247788 
-329393.593960  7361738.150374 
-329332.769763  7361729.901787 
-329279.466128  7361722.842996 
-329220.398378  7361721.593210 
-329163.219015  7361723.792833 
-329088.260778  7361730.101752 
-328997.642950  7361734.790949 
-328915.461015  7361706.015878 
-328879.086892  7361689.188760 
-328840.923336  7361660.273713 
-328809.076393  7361631.428654 
-328773.856742  7361602.773562 
-328752.531990  7361580.257419 
-328728.007700  7361552.052251 
-328697.084335  7361513.468860 
-328625.696716  7361442.840957 
-328592.629331  7361413.216032 
-328572.953825  7361397.808671 
-328546.986445  7361379.331836 
-328515.642522  7361359.575220 
-328484.273861  7361350.226821 
-328459.394983  7361343.957895 
-328441.591371  7361341.638293 
-328378.812817  7361335.239389 
-328335.297458  7361319.552076 
-328301.578621  7361302.095066 
-328273.186849  7361282.148483 
-328249.825277  7361259.272401 
-328239.789614  7361246.754545 
-328219.347209  7361226.677984 
-328200.026290  7361215.489901 
-328171.766458  7361201.642273 
-328163.008961  7361184.475213 
-328154.457620  7361175.066825 
-328151.200359  7361157.639810 
-328149.328464  7361152.640666 
-328140.521490  7361139.352942 
-328132.918465  7361135.823547 
-328084.579061  7361140.682714 
-328075.623655  7361139.462923 
-328055.585314  7361137.013343 
-328045.434204  7361134.013857 
-328026.410150  7361123.595641 
-328013.166704  7361123.655631 
-327997.696775  7361122.145890 
-327985.022319  7361117.116751 
-327982.515465  7361113.877306 
-327977.963545  7361102.409270 
-327972.306631  7361090.051387 
-327967.062028  7361085.782118 
-327957.347969  7361088.321683 
-327952.746572  7361098.679909 
-327941.119387  7361108.068301 
-327931.891855  7361113.047448 
-327922.012870  7361121.466006 
-327911.845268  7361128.764756 
-327902.172439  7361136.283468 
-327888.689852  7361156.510003 
-327865.542683  7361158.339690 
-327853.635126  7361157.419848 
-327838.132212  7361159.229538 
-327825.680404  7361161.289185 
-327803.580506  7361168.897881 
-327787.351924  7361171.687404 
-327769.292679  7361182.105619 
-327759.133323  7361188.414538 
-327745.716705  7361203.311987 
-327731.153862  7361228.167729 
-327721.472787  7361245.334788 
-327707.215054  7361262.001934 
-327691.275091  7361274.659765 
-327682.072297  7361286.177792 
-327656.410027  7361311.233501 
-327642.910948  7361323.811346 
-327628.372843  7361338.698796 
-327616.250884  7361355.395936 
-327609.307558  7361365.164263 
-327595.857956  7361382.281331 
-327587.718926  7361398.688520 
-327578.070836  7361413.086054 
-327561.784531  7361420.864722 
-327552.647707  7361426.513754 
-327534.827603  7361434.052463 
-327520.586362  7361441.191240 
-327458.896311  7361402.907798 
-327448.266920  7361405.777306 
-327397.107305  7361397.838666 
-327268.103272  7361731.551504 
-327265.208845  7361739.080214 
-327124.453935  7362465.335813 
-326951.258352  7363243.712484 
-326775.687856  7363903.469474 
-326611.827006  7364519.253996 
-326607.192625  7364555.987704 
-326627.874171  7364820.742354 
-326635.304025  7364897.279243 
-326703.426136  7365162.193866 
-326789.137458  7365381.496301 
-326879.565623  7365668.287177 
-326773.007831  7366250.047527 
-326661.279652  7366570.552627 
-326246.098431  7367155.122495 
-326169.334270  7368025.373429 
-325671.896899  7369380.911238 
-325613.488847  7369526.546292 
-325608.021596  7369615.920983 
-325585.748527  7369832.083956 
-325581.237839  7370033.769409 
-325573.651307  7370287.315979 
-325573.469890  7370334.217945 
-325574.055372  7370336.627532 
-325552.730619  7370778.031924 
-325562.403448  7371152.427793 
-325606.792908  7371411.253459 
-325770.241445  7371841.869698 
-325821.879342  7371982.275648 
-325896.829332  7372167.483923 
-325983.068412  7372347.063163 
-326077.867080  7372527.082327 
-326165.969808  7372680.406064 
-326286.925519  7372889.080322 
-326299.707176  7372903.227897 
-326338.217074  7372955.578930 
-326437.848032  7373096.694758 
-326532.052971  7373234.011237 
-326575.411652  7373293.091117 
-326700.935775  7373459.772566 
-326746.067395  7373527.950888 
-326840.923786  7373671.666270 
-326939.218856  7373812.612128 
-327282.163096  7374258.605733 
-327372.104733  7374380.064928 
-327473.046843  7374515.401746 
-327497.348484  7374570.662281 
-327544.063381  7374666.105932 
-327562.485460  7374789.494797 
-327572.405676  7374941.458766 
-327574.681635  7375076.065710 
-327636.940677  7375047.500602 
-327649.854274  7375039.961894 
-327705.986366  7374988.900640 
-327802.879576  7374907.264624 
-327826.983308  7374876.919821 
-327830.059152  7374861.742421 
-327890.001003  7374710.238372 
-327893.315988  7374705.899116 
-327914.912866  7374660.676862 
-327947.081411  7374599.537335 
-327965.701400  7374564.233382 
-327960.176426  7374520.060948 
-327950.586059  7374495.325185 
-327935.231578  7374442.034313 
-327917.518675  7374391.852909 
-327899.863495  7374337.832162 
-327893.588113  7374292.899859 
-327886.974636  7374246.407822 
-327885.605762  7374190.457406 
-327888.186832  7374153.543729 
-327889.613430  7374124.598687 
-327914.137720  7374004.559249 
-327948.153421  7373904.876324 
-327960.019747  7373870.072285 
-327966.352852  7373858.204318 
-327990.877142  7373839.217570 
-328041.360566  7373783.177170 
-328094.573493  7373760.781006 
-328131.549591  7373738.874758 
-328205.848129  7373799.134436 
-328236.293213  7373820.740735 
-328306.031585  7373871.811987 
-328341.383176  7373903.246603 
-328369.873903  7373926.812566 
-328369.865657  7373926.812566 
-328381.649520  7373968.065500 
-328428.628296  7374028.825092 
-328455.453285  7374086.315245 
-328466.956776  7374149.564411 
-328476.209047  7374162.982112 
-328500.436473  7374232.820150 
-328545.485631  7374303.468048 
-328582.519453  7374344.770974 
-328616.782541  7374378.845137 
-328674.110336  7374420.288038 
-328698.139853  7374431.646093 
-328733.343011  7374446.903479 
-328785.302510  7374467.889885 
-328808.103338  7374480.017807 
-328857.473521  7374503.853724 
-328901.887719  7374524.760143 
-328977.835504  7374560.873957 
-329049.973529  7374600.607151 
-329118.408997  7374642.170032 
-329205.373746  7374695.030977 
-329299.941519  7374725.825702 
-329409.476201  7374758.570094 
-329498.873587  7374761.389611 
-329554.700569  7374765.808854 
-329642.061136  7374776.137085 
-329749.987803  7374789.584781 
-329784.325107  7374878.929477 
-329829.506205  7374999.848765 
-329881.383242  7375097.821983 
-329918.738667  7375173.019102 
-329979.950437  7375266.433101 
-330030.260690  7375341.120308 
-330220.690894  7375624.781719 
-330462.791980  7375946.156671 
-330939.391126  7375502.262706 
-331209.339733  7375201.484226 
-331372.046110  7375002.798260 
-331443.450221  7374903.835211 
-331530.711834  7374774.047443 
-331634.944189  7374569.692447 
-331652.731308  7374513.082143 
-331688.000437  7374417.678485 
-331719.162942  7374324.344473 
-331752.683870  7374211.873738 
-331786.534647  7374106.711751 
-331813.574037  7374016.647178 
-331851.094387  7373867.232772 
-Region 1
-514
-333270.245942  7379020.010148 
-333285.014941  7379012.751391 
-333306.669543  7379001.043396 
-333315.905321  7378996.054251 
-333335.778737  7378988.855484 
-333354.365741  7378986.635864 
-333381.504086  7378986.065962 
-333404.370884  7378984.216279 
-333425.192616  7378982.576560 
-333448.628404  7378975.867709 
-333462.490317  7378967.939067 
-333486.693004  7378947.612549 
-333492.704506  7378929.965571 
-333494.576401  7378917.917635 
-333493.628084  7378903.170161 
-333491.434587  7378889.302537 
-333480.673256  7378867.586256 
-333474.002055  7378853.548661 
-333462.919121  7378841.680694 
-333444.711444  7378827.963043 
-333427.179958  7378818.684633 
-333416.319672  7378813.575508 
-333404.148235  7378808.006462 
-333396.619427  7378797.618241 
-333390.863558  7378783.600642 
-333376.795488  7378764.603896 
-333356.781887  7378758.394960 
-333334.492325  7378754.045705 
-333291.587187  7378750.676282 
-333308.689870  7378736.358734 
-333319.137844  7378732.379416 
-333330.938200  7378717.341992 
-333338.912305  7378706.583835 
-333344.618696  7378689.366784 
-333353.079329  7378671.519841 
-333358.290947  7378653.422941 
-333364.294203  7378636.765794 
-333372.062152  7378617.139156 
-333385.957051  7378597.472524 
-333393.947648  7378585.494576 
-333408.320828  7378559.079101 
-333414.546732  7378541.422125 
-333432.540008  7378510.957344 
-333446.764755  7378479.992648 
-333456.421092  7378446.988301 
-333461.946066  7378419.033089 
-333472.377548  7378389.798097 
-333483.072909  7378346.175569 
-333479.502291  7378343.745985 
-333496.794637  7378354.994059 
-333560.034980  7378351.344684 
-333583.718154  7378349.954922 
-333711.963533  7378342.746157 
-333788.076242  7378338.436895 
-333808.213537  7378334.927496 
-333902.393737  7378308.392041 
-333933.011992  7378313.891099 
-333951.013513  7378327.608750 
-333971.192040  7378338.136946 
-334000.070339  7378354.194196 
-334029.484644  7378333.157799 
-334042.464211  7378321.899728 
-334050.537271  7378302.493052 
-334050.652718  7378283.336333 
-334046.529603  7378260.580231 
-334038.736915  7378246.432654 
-334024.198810  7378223.886516 
-334011.878942  7378204.369859 
-334000.870224  7378186.302954 
-333989.803782  7378163.576847 
-333984.666381  7378140.480803 
-333982.217250  7378122.623862 
-333983.445938  7378095.608489 
-333984.633396  7378072.142509 
-333989.193561  7378047.386749 
-334009.726676  7378000.004865 
-334014.996017  7377984.887455 
-334021.576509  7377971.449756 
-334030.771056  7377961.031541 
-334045.490578  7377949.683485 
-334063.038557  7377940.245102 
-334087.488631  7377933.436268 
-334112.334523  7377927.627263 
-334123.483427  7377924.657771 
-334132.108985  7377919.878590 
-334136.528964  7377916.499169 
-334142.111662  7377910.250239 
-334146.680074  7377903.321426 
-334151.776245  7377894.522933 
-334157.391928  7377884.844591 
-334159.907028  7377870.357073 
-334160.962546  7377848.770770 
-334165.506219  7377834.983132 
-334168.334676  7377828.704207 
-334170.660113  7377821.305475 
-334175.434680  7377814.166698 
-334182.559424  7377806.268051 
-334191.184981  7377801.498867 
-334202.638995  7377798.749338 
-334213.326110  7377800.529034 
-334224.697662  7377805.088253 
-334239.194536  7377812.347009 
-334252.891525  7377818.705920 
-334267.091534  7377825.614737 
-334283.171684  7377828.464249 
-334302.459617  7377827.464420 
-334324.510038  7377825.944680 
-334346.684152  7377821.655415 
-334373.525633  7377811.107222 
-334380.955487  7377803.218573 
-334385.548637  7377794.300101 
-334387.354562  7377788.231140 
-334388.368848  7377779.602618 
-334387.338069  7377771.394024 
-334382.497532  7377757.936329 
-334371.661985  7377741.859083 
-334364.570226  7377719.962834 
-334334.850811  7377678.759892 
-334324.435822  7377662.022758 
-334317.690405  7377645.665560 
-334314.853702  7377634.997388 
-334314.853702  7377626.358867 
-334318.399581  7377619.310075 
-334328.822817  7377608.131989 
-334341.324102  7377603.292818 
-334355.820976  7377601.573113 
-334372.758734  7377601.103193 
-334382.472793  7377599.113534 
-334390.875702  7377595.004238 
-334408.877224  7377581.916480 
-334420.801273  7377573.517919 
-334428.437283  7377565.409307 
-334430.548318  7377559.570308 
-334431.257494  7377551.161748 
-334429.814403  7377543.053137 
-334427.505459  7377539.933671 
-334414.781525  7377528.705595 
-334398.330295  7377523.096555 
-334381.260597  7377517.247557 
-334369.600427  7377511.358566 
-334361.510875  7377505.509568 
-334356.381719  7377499.360621 
-334353.182182  7377493.561614 
-334351.137117  7377484.683135 
-334352.662669  7377476.054613 
-334355.928177  7377467.566067 
-334361.321212  7377459.207499 
-334365.881377  7377452.948571 
-334385.202296  7377431.132308 
-334399.229134  7377417.444652 
-334415.185590  7377404.006954 
-334424.627524  7377398.687865 
-334435.314639  7377391.499097 
-334470.311642  7377372.072424 
-334489.401666  7377361.654209 
-334501.622580  7377354.265475 
-334515.113413  7377343.117384 
-334520.894021  7377336.758473 
-334527.029216  7377326.420244 
-334531.127593  7377315.942039 
-334531.853261  7377305.543820 
-334531.696583  7377292.586040 
-334529.865920  7377282.927694 
-334525.116091  7377261.381385 
-334522.782408  7377251.723039 
-334517.463589  7377235.165875 
-334514.206328  7377225.267571 
-334511.691227  7377213.499586 
-334511.979846  7377205.860895 
-334515.237107  7377197.482330 
-334519.071604  7377191.983272 
-334523.837925  7377185.724344 
-334534.104482  7377179.755367 
-334550.580451  7377183.594709 
-334565.308219  7377188.963789 
-334578.221816  7377192.543176 
-334587.688489  7377193.652986 
-334595.745056  7377193.852952 
-334605.970382  7377191.093424 
-334616.888392  7377181.695034 
-334626.305587  7377169.727084 
-334631.830562  7377159.378857 
-334644.843114  7377145.131297 
-334665.656600  7377144.261446 
-334687.756498  7377146.831006 
-334710.664527  7377150.200429 
-334733.539571  7377156.329379 
-334751.788479  7377157.089249 
-334773.137970  7377153.789814 
-334806.353787  7377147.520888 
-334835.372273  7377142.311780 
-334967.435657  7377115.566362 
-334980.926490  7377112.066961 
-334980.918244  7377112.066961 
-334991.316741  7377105.758042 
-334992.199087  7377104.768211 
-334997.179811  7377099.159172 
-335001.253448  7377092.160371 
-335001.756469  7377091.290520 
-335002.226504  7377088.540991 
-335003.521162  7377080.872304 
-335004.824066  7377065.384957 
-335003.892242  7377059.625944 
-335001.822438  7377047.058096 
-334997.006640  7377032.050667 
-334995.266685  7377029.091174 
-334991.135323  7377022.142364 
-334985.074344  7377017.313191 
-334976.250877  7377013.223892 
-334949.030070  7377003.275596 
-334931.506830  7376997.406601 
-334928.538187  7376996.416771 
-334908.763726  7376990.877720 
-334900.063952  7376985.338668 
-334893.450475  7376979.979586 
-334893.450475  7376979.969588 
-334893.409244  7376979.939593 
-334893.244319  7376979.309701 
-334891.677536  7376974.130588 
-334891.388918  7376972.080939 
-334891.355933  7376971.940963 
-334891.364179  7376971.930965 
-334891.355933  7376971.890972 
-334899.750595  7376959.803042 
-334910.338756  7376949.744765 
-334920.588820  7376942.665978 
-334927.754795  7376940.956271 
-334931.490337  7376940.056425 
-334936.223674  7376939.866457 
-334946.580939  7376939.416534 
-334946.704633  7376939.446529 
-335006.902116  7376936.047112 
-335037.437909  7376932.407735 
-335060.321199  7376928.788355 
-335077.935147  7376922.119497 
-335090.865237  7376915.070705 
-335098.583709  7376908.621809 
-335107.060834  7376898.413558 
-335110.466527  7376886.495599 
-335110.202648  7376873.647800 
-335102.525407  7376812.858213 
-335097.313789  7376796.081086 
-335089.562332  7376778.604080 
-335073.028640  7376752.828495 
-335064.122711  7376737.561110 
-335053.031531  7376726.353030 
-335018.504563  7376704.916702 
-335008.369946  7376698.827745 
-334966.907898  7376677.421412 
-334939.794291  7376658.504652 
-334917.752117  7376641.977483 
-334902.793455  7376629.729581 
-334888.783109  7376615.172075 
-334848.747659  7376566.870348 
-334811.416973  7376531.896339 
-334762.516825  7376491.463265 
-334732.813902  7376467.427382 
-334677.861021  7376429.753835 
-334677.729082  7376429.733838 
-334677.712589  7376429.663850 
-334609.211151  7376387.381093 
-334537.130849  7376350.347437 
-334482.004797  7376319.262761 
-334443.156805  7376301.425816 
-334379.974185  7376279.439582 
-334325.887159  7376265.531965 
-334287.608156  7376260.112893 
-334256.833223  7376257.993256 
-334258.375268  7376230.098034 
-334256.157032  7376209.691530 
-334205.203573  7376198.253489 
-334174.181253  7376191.254688 
-334145.929667  7376182.516185 
-334120.531277  7376174.257599 
-334091.850887  7376158.420312 
-334059.542155  7376139.553544 
-334038.769900  7376127.905539 
-334009.941077  7376089.152177 
-333943.979479  7376043.430009 
-333904.405818  7376008.525988 
-333857.014730  7375961.694009 
-333820.549898  7375922.620702 
-333745.781325  7375835.155684 
-333672.983601  7375754.579486 
-333601.150686  7375669.354085 
-333522.638324  7375579.849416 
-333462.341885  7375511.491125 
-333394.269251  7375428.195393 
-333272.381716  7375297.987696 
-333205.240906  7375230.539250 
-333106.162445  7375156.521928 
-333009.277481  7375104.910769 
-332916.284738  7375060.418390 
-332833.014301  7375030.663487 
-332694.823968  7374980.122144 
-332582.477321  7374942.938513 
-332483.291659  7374913.883490 
-332372.866385  7374879.519376 
-332265.450984  7374847.014944 
-332150.374835  7374807.811659 
-331944.796305  7374730.004987 
-331819.206213  7374674.724456 
-331712.277340  7374601.267038 
-331634.944189  7374569.692447 
-331530.711834  7374774.047443 
-331443.450221  7374903.835211 
-331372.046110  7375002.798260 
-331209.339733  7375201.484226 
-330939.391126  7375502.262706 
-330462.791980  7375946.156671 
-330184.976469  7376193.664275 
-330072.497883  7376332.340521 
-329930.068988  7376486.844056 
-329833.423164  7376649.296229 
-329721.117749  7376895.304090 
-329682.426435  7377011.584173 
-329651.247437  7377095.949722 
-329625.543936  7377174.836209 
-329523.727726  7377438.361070 
-329448.060314  7377568.498778 
-329364.963048  7377635.747259 
-329328.960005  7377646.825362 
-329315.345478  7377648.785026 
-329290.639771  7377651.264601 
-329205.530424  7377655.693843 
-329087.287723  7377676.120344 
-328936.010622  7377704.465488 
-328734.926287  7377762.125612 
-328532.489571  7377825.134819 
-328426.319352  7377864.928003 
-328171.106759  7377971.119813 
-328187.252879  7378037.428455 
-328188.184703  7378053.835644 
-328195.507356  7378089.689503 
-328196.736044  7378124.263581 
-328230.710515  7378149.259299 
-328258.830161  7378151.468921 
-328286.982792  7378151.248958 
-328300.580827  7378156.838001 
-328307.416952  7378165.116583 
-328324.173293  7378179.934045 
-328332.724634  7378198.860803 
-328346.718487  7378222.726715 
-328355.764602  7378234.354723 
-328383.133842  7378282.746434 
-328416.209473  7378349.924927 
-328417.710287  7378369.661546 
-328414.312840  7378389.548140 
-328409.505287  7378398.796556 
-328398.422353  7378413.404054 
-328390.712128  7378427.481642 
-328385.698420  7378446.148445 
-328385.046967  7378466.624937 
-328390.621419  7378477.992990 
-328403.716434  7378492.210555 
-328413.818066  7378500.419149 
-328442.943753  7378512.947003 
-328472.316826  7378521.705503 
-328488.825780  7378522.565355 
-328509.655759  7378520.925636 
-328526.445084  7378515.476570 
-328546.376224  7378512.057155 
-328572.285880  7378511.257292 
-328591.755231  7378512.377100 
-328610.045371  7378518.236097 
-328626.034812  7378520.635686 
-328645.594871  7378522.535360 
-328665.699181  7378521.665509 
-328679.214753  7378517.166280 
-328690.396642  7378511.427263 
-328728.040685  7378501.908894 
-328749.959166  7378503.048698 
-328761.561612  7378505.068352 
-328773.254767  7378508.197816 
-328783.348154  7378517.396241 
-328800.525052  7378530.893929 
-328818.765714  7378540.852223 
-328834.647955  7378552.010312 
-328870.923123  7378589.313922 
-328900.725001  7378613.589764 
-328964.707504  7378690.456597 
-329001.518678  7378733.069298 
-329024.212305  7378754.705592 
-329041.653083  7378763.444095 
-329060.998740  7378766.773525 
-329094.552652  7378767.053477 
-329130.844313  7378768.253271 
-329156.011809  7378770.432898 
-329180.371175  7378771.832658 
-329197.844937  7378778.011600 
-329217.050408  7378792.529113 
-329239.323477  7378806.856659 
-329248.955075  7378811.955785 
-329260.574014  7378820.844263 
-329270.164380  7378829.482783 
-329275.912003  7378835.311785 
-329282.401786  7378847.239742 
-329296.321424  7378860.467476 
-329317.217372  7378876.654703 
-329332.406929  7378888.252716 
-329343.770235  7378901.890380 
-329345.526682  7378908.999163 
-329349.756998  7378921.896953 
-329351.983481  7378932.005222 
-329359.809153  7378938.174165 
-329365.828902  7378942.913354 
-329377.728213  7378946.262780 
-329385.809519  7378952.891644 
-329396.933684  7378961.110237 
-329425.746014  7378982.936498 
-329443.681565  7378992.674830 
-329467.562649  7379000.703455 
-329481.193669  7379008.162177 
-329507.993918  7379022.659694 
-329528.254907  7379034.637642 
-329548.235524  7379052.934508 
-329626.954041  7379150.877731 
-329661.192391  7379206.098272 
-329689.740842  7379269.147473 
-329721.101257  7379307.260944 
-329738.921361  7379301.042009 
-329760.584209  7379288.894090 
-329789.479001  7379269.077485 
-329849.684731  7379240.982297 
-329900.654683  7379251.880430 
-329911.877803  7379251.900427 
-329934.926017  7379251.840437 
-329950.940197  7379251.910425 
-329976.651944  7379251.110562 
-329998.207591  7379248.481013 
-330018.806676  7379248.610990 
-330051.371040  7379246.551343 
-330065.059783  7379244.611675 
-330077.552823  7379240.322410 
-330090.367465  7379234.823352 
-330109.193610  7379221.315666 
-330122.255639  7379211.607329 
-330136.810236  7379205.688343 
-330158.695732  7379200.959153 
-330179.525711  7379198.539567 
-330205.377644  7379202.398906 
-330223.197748  7379206.138265 
-330240.679757  7379211.547339 
-330264.016590  7379213.267044 
-330284.294071  7379215.156721 
-330301.132874  7379214.536827 
-330318.375742  7379213.896936 
-330336.649390  7379212.447185 
-330367.143951  7379209.247733 
-330388.312025  7379207.957954 
-330409.331667  7379215.736621 
-330475.078863  7379219.156036 
-330524.242891  7379194.360283 
-330587.483233  7379154.867048 
-330609.203805  7379142.299201 
-330688.260418  7379193.260471 
-330768.842584  7379246.821297 
-330874.748924  7379314.849644 
-330907.527691  7379332.186675 
-330931.606685  7379346.214272 
-331073.623269  7379439.518290 
-331105.412488  7379458.115104 
-331155.739234  7379501.247716 
-331424.887956  7379643.283386 
-331459.249999  7379662.190148 
-331466.762315  7379602.090442 
-331489.299263  7379573.545332 
-331523.859216  7379502.927428 
-331607.781105  7379390.656659 
-331647.461967  7379361.291689 
-331670.782307  7379346.354248 
-331743.489323  7379296.212837 
-331779.426396  7379271.817015 
-331783.351602  7379258.149356 
-331797.452656  7379193.040509 
-331803.843485  7379173.823801 
-331814.118288  7379145.428664 
-331841.899839  7379042.256337 
-331882.372339  7379052.574570 
-331938.718833  7379060.513210 
-331962.641149  7379060.843153 
-332011.895884  7379048.615248 
-332081.848659  7379036.437334 
-332108.558200  7379031.718142 
-332168.351618  7379022.489723 
-332172.557196  7378975.767726 
-332179.236643  7378958.000769 
-332195.085898  7378932.625116 
-332213.491485  7378906.509589 
-332251.828211  7378848.689493 
-332271.058421  7378852.268880 
-332304.637072  7378865.676583 
-332327.817227  7378882.843643 
-332360.051742  7378862.427140 
-332382.621675  7378836.631559 
-332396.590790  7378801.167633 
-332419.160723  7378758.184996 
-332439.578390  7378678.668616 
-332498.349276  7378707.203728 
-332529.445812  7378718.301827 
-332559.923881  7378742.567671 
-332591.943994  7378742.567671 
-332645.486770  7378750.066386 
-332771.555144  7378760.504598 
-332844.509546  7378799.247962 
-332946.416465  7378820.684290 
-333003.554597  7378827.413138 
-333055.637790  7378832.452275 
-333156.464452  7378808.926304 
-333201.835213  7378820.684290 
-333263.418063  7378877.494559 
-333277.444902  7378918.147596 
-333275.762671  7378968.568959 
-333270.245942  7379020.010148 
-Region 1
-596
-338743.500117  7387764.332324 
-338720.080822  7387611.578490 
-338700.190914  7387481.440781 
-338678.486835  7387340.214972 
-338665.993795  7387260.778579 
-338655.413881  7387193.770056 
-338635.969269  7387059.992971 
-338614.199221  7386925.186062 
-338591.225222  7386778.851128 
-338586.854720  7386746.856609 
-338585.675509  7386735.818499 
-338584.941594  7386719.201346 
-338585.155996  7386700.264589 
-338581.849258  7386684.007374 
-338570.560168  7386626.117290 
-338561.439837  7386574.626110 
-338552.096858  7386533.883089 
-338547.347029  7386501.488638 
-338543.124959  7386459.355855 
-338540.214039  7386426.981400 
-338535.002421  7386400.565925 
-338527.415889  7386366.701726 
-338525.659442  7386359.263000 
-338525.189407  7386355.603627 
-338520.678719  7386348.244887 
-338503.336896  7386329.668069 
-338496.195660  7386319.949734 
-338492.517841  7386311.161239 
-338490.332590  7386287.215341 
-338491.693218  7386275.377369 
-338494.340258  7386266.108956 
-338500.434222  7386250.231676 
-338509.760709  7386228.845339 
-338523.119603  7386210.718444 
-338532.619261  7386200.860133 
-338547.495461  7386184.522931 
-338565.859816  7386166.336047 
-338584.265403  7386144.389806 
-338603.545091  7386126.552861 
-338616.532904  7386114.624904 
-338628.910496  7386102.906911 
-338639.020375  7386093.058598 
-338652.024680  7386079.130984 
-338664.633167  7386064.983407 
-338675.221327  7386048.606213 
-338682.898568  7386027.869765 
-338689.396598  7386012.322428 
-338692.356995  7385994.305514 
-338694.187658  7385975.938660 
-338693.470236  7385957.871755 
-338688.085447  7385927.916886 
-338680.754548  7385889.623445 
-338676.581955  7385870.526716 
-338670.809594  7385847.760616 
-338666.620509  7385830.323603 
-338664.278579  7385820.665257 
-338661.903665  7385804.138088 
-338658.333047  7385785.711244 
-338654.127469  7385769.494022 
-338651.249535  7385753.186815 
-338645.254525  7385723.321931 
-338639.078098  7385691.137444 
-338632.118280  7385664.921934 
-338626.469612  7385640.936043 
-338620.474602  7385619.939639 
-338615.996899  7385611.541078 
-338607.890854  7385595.213875 
-338596.131729  7385579.576553 
-338581.898735  7385565.358989 
-338568.869691  7385553.361044 
-338552.781295  7385540.783198 
-338531.563743  7385531.464794 
-338504.194504  7385515.327558 
-338477.748842  7385498.530436 
-338461.553245  7385486.832439 
-338443.650678  7385472.014978 
-338427.512805  7385455.327836 
-338411.943921  7385442.420047 
-338399.013832  7385430.102157 
-338387.873174  7385413.804948 
-338369.104753  7385385.239841 
-338358.425885  7385363.643541 
-338349.231337  7385337.398036 
-338342.296257  7385318.381294 
-338340.647011  7385309.062890 
-338338.750378  7385297.744828 
-338336.853745  7385275.908569 
-338338.098926  7385246.353631 
-338341.100554  7385224.347401 
-338346.773961  7385199.821602 
-338352.002071  7385179.605065 
-338357.799171  7385162.837937 
-338363.579779  7385147.400581 
-338367.834834  7385132.163191 
-338375.042039  7385107.987332 
-338381.861672  7385081.591853 
-338392.301400  7385042.168606 
-338397.513018  7385022.961896 
-338403.433811  7385004.305092 
-338409.247404  7384985.658286 
-338414.170404  7384965.551730 
-338418.450197  7384947.544815 
-338422.738237  7384928.548068 
-338428.221981  7384912.770771 
-338433.779940  7384889.794707 
-338439.255437  7384874.567315 
-338445.464849  7384848.501780 
-338451.377396  7384830.184917 
-338456.267411  7384812.517943 
-338461.173918  7384793.521197 
-338468.958360  7384762.816457 
-338472.949536  7384743.259807 
-338476.025380  7384723.693158 
-338478.680666  7384705.006359 
-338481.360691  7384693.848270 
-338485.896118  7384679.940653 
-338488.823530  7384664.363321 
-338492.526087  7384643.916823 
-338489.540952  7384636.678063 
-338488.023645  7384626.699772 
-338488.460696  7384614.521858 
-338488.617374  7384600.234306 
-338486.366153  7384582.487346 
-338482.762550  7384566.830028 
-338478.853837  7384551.612634 
-338474.038038  7384534.725527 
-338470.706561  7384522.177676 
-338466.435014  7384511.939430 
-338463.103536  7384500.051466 
-338459.277285  7384485.613939 
-338453.727572  7384471.266397 
-338446.207010  7384450.359978 
-338440.987146  7384432.802985 
-338433.788186  7384410.346832 
-338427.941609  7384394.779498 
-338420.734403  7384373.213192 
-338414.294097  7384355.976145 
-338410.063781  7384341.978543 
-338408.051701  7384329.770634 
-338406.649841  7384318.232610 
-338404.530560  7384307.024530 
-338399.978641  7384294.796624 
-338392.911621  7384278.209466 
-338385.333335  7384262.292192 
-338379.429034  7384252.593853 
-338372.065150  7384244.425253 
-338366.853532  7384236.506609 
-338361.551206  7384226.478327 
-338354.822282  7384217.429877 
-338350.517749  7384209.631212 
-338350.286855  7384203.092332 
-338351.581513  7384196.463468 
-338354.195568  7384190.624468 
-338358.335176  7384185.355371 
-338365.558874  7384178.016628 
-338375.973863  7384168.158316 
-338352.381397  7384142.532706 
-338295.103079  7384100.149966 
-338229.273420  7384065.745859 
-338211.502793  7384049.048719 
-338198.185131  7384035.501039 
-338179.391971  7384018.903882 
-338159.378369  7384001.736823 
-338143.792993  7383990.598731 
-338122.979507  7383971.981920 
-338105.076940  7383958.044307 
-338086.077625  7383942.217018 
-338062.905717  7383924.240097 
-338045.613371  7383910.872387 
-338019.893378  7383892.865472 
-338008.167238  7383883.097145 
-337989.571988  7383867.719779 
-337974.299969  7383855.591856 
-337958.747578  7383840.794391 
-337939.830724  7383826.626818 
-337918.002952  7383807.670065 
-337900.537435  7383791.082906 
-337885.479818  7383777.955155 
-337869.119297  7383763.377652 
-337850.631248  7383747.000457 
-337825.422520  7383729.223502 
-337804.872914  7383714.266064 
-337778.897287  7383701.568239 
-337746.835942  7383685.490993 
-337736.495169  7383680.051925 
-337715.953809  7383664.434600 
-337693.235443  7383652.216692 
-337675.415339  7383640.608681 
-337655.409983  7383631.530236 
-337637.746557  7383624.021522 
-337620.932493  7383613.203375 
-337601.990901  7383600.585536 
-337575.660687  7383583.238508 
-337554.970894  7383572.150407 
-337527.007926  7383554.673401 
-337504.116390  7383539.915929 
-337487.491989  7383529.867650 
-337456.453176  7383513.570441 
-337435.590213  7383499.942776 
-337408.930149  7383484.695387 
-337396.585542  7383475.356987 
-337378.468573  7383462.089260 
-337361.151489  7383450.931171 
-337338.960882  7383437.503471 
-337316.836245  7383427.175240 
-337291.347146  7383415.927167 
-337266.913565  7383402.479470 
-337247.980219  7383389.641669 
-337227.925386  7383376.453928 
-337216.100292  7383366.465639 
-337201.240584  7383354.227735 
-337180.938364  7383335.730904 
-337165.179817  7383321.933267 
-337138.907327  7383308.455576 
-337120.501740  7383303.156483 
-337097.700912  7383298.357305 
-337066.084864  7383288.039073 
-337046.640252  7383284.059754 
-337019.048364  7383279.650510 
-336999.999571  7383276.781001 
-336987.061235  7383275.191274 
-336967.270282  7383274.721354 
-336951.280841  7383272.691702 
-336912.935868  7383271.151965 
-336892.625402  7383271.921834 
-336878.425393  7383273.761518 
-336861.388680  7383273.011647 
-336852.045701  7383269.362272 
-336840.682395  7383264.143166 
-336836.254169  7383258.554123 
-336827.142085  7383252.135223 
-336818.541266  7383237.087800 
-336811.284583  7383228.929198 
-336801.479815  7383220.730602 
-336791.130795  7383215.741457 
-336779.973645  7383209.742484 
-336773.475616  7383207.012952 
-336758.533446  7383201.973815 
-336747.467004  7383196.974671 
-336742.189416  7383194.485098 
-336731.535286  7383189.485954 
-336721.524362  7383181.517319 
-336714.036785  7383175.888283 
-336708.726212  7383167.189773 
-336704.009369  7383160.610900 
-336693.495424  7383151.632438 
-336679.889144  7383146.163375 
-336667.495059  7383141.144235 
-336654.573216  7383138.234733 
-336638.583775  7383136.065105 
-336616.566339  7383133.935469 
-336594.730320  7383134.465379 
-336569.966889  7383068.506677 
-336566.313809  7383057.608543 
-336559.403468  7383045.900549 
-336552.204509  7383033.202724 
-336544.246896  7383023.694353 
-336532.974299  7383010.386632 
-336527.276153  7382999.688465 
-336521.602747  7382987.340580 
-336513.669873  7382975.622587 
-336505.934908  7382965.124385 
-336495.437457  7382954.926132 
-336481.385880  7382943.358114 
-336456.416293  7382931.890078 
-336434.349380  7382925.551164 
-336412.018588  7382924.971263 
-336383.263981  7382932.180028 
-336366.202530  7382934.309663 
-336348.060823  7382942.078333 
-336334.363834  7382944.257959 
-336321.392513  7382945.547738 
-336307.390413  7382948.377254 
-336293.916072  7382948.677202 
-336281.489003  7382947.317435 
-336271.403863  7382945.647721 
-336262.242300  7382944.217966 
-336251.316045  7382944.867855 
-336241.882357  7382949.307095 
-336234.889553  7382953.986293 
-336227.814287  7382956.895795 
-336219.114514  7382959.575336 
-336210.752836  7382959.475353 
-336202.440636  7382954.396223 
-336193.996495  7382943.338117 
-336189.469315  7382937.749074 
-336182.921808  7382930.150376 
-336169.645376  7382922.581672 
-336159.469528  7382919.912130 
-336152.130382  7382919.832143 
-336138.952906  7382921.231904 
-336126.171248  7382923.301549 
-336117.809571  7382923.211564 
-336102.331396  7382920.931955 
-336087.908738  7382915.012969 
-336076.685618  7382906.024508 
-336065.182127  7382894.926409 
-336052.062374  7382881.938634 
-336039.602319  7382865.401467 
-336029.409978  7382854.883268 
-336018.129134  7382842.125454 
-336003.599276  7382827.787910 
-335982.686835  7382800.972503 
-335963.135022  7382779.046259 
-335950.444073  7382764.498751 
-335941.678330  7382754.770417 
-335934.314446  7382738.513202 
-335929.300738  7382731.144464 
-335921.186447  7382726.955181 
-335911.612573  7382725.295466 
-335898.476328  7382723.155832 
-335882.371439  7382713.117552 
-335876.516616  7382707.408530 
-335867.338561  7382698.220103 
-335855.134140  7382694.320771 
-335841.816477  7382690.291462 
-335832.069432  7382677.333681 
-335828.061764  7382670.974770 
-335822.107986  7382664.815825 
-335809.722147  7382659.586721 
-335801.409947  7382654.507591 
-335795.365460  7382647.788742 
-335788.100531  7382640.949913 
-335779.277064  7382636.200727 
-335762.380537  7382633.241234 
-335747.916649  7382630.751660 
-335731.407695  7382629.021956 
-335718.502344  7382625.102628 
-335696.757034  7382617.213979 
-335687.743904  7382611.025039 
-335677.452608  7382601.386690 
-335665.116247  7382591.278422 
-335652.903579  7382579.510437 
-335638.035625  7382568.492325 
-335619.357913  7382560.193746 
-335603.681828  7382556.694346 
-335588.706674  7382554.974640 
-335576.279604  7382553.504892 
-335562.162057  7382548.025830 
-335555.688766  7382542.636753 
-335545.067621  7382534.438158 
-335529.251351  7382526.169574 
-335515.183281  7382516.151290 
-335499.251563  7382508.332629 
-335482.602424  7382501.383820 
-335461.879646  7382493.515168 
-335443.474059  7382488.206077 
-335432.316909  7382482.767009 
-335424.590191  7382478.787690 
-335422.784267  7382477.567899 
-335402.061489  7382469.689249 
-335387.935696  7382464.990054 
-335374.684003  7382463.840251 
-335361.498281  7382466.129858 
-335352.237764  7382472.888701 
-335343.801870  7382479.327598 
-335334.005348  7382488.296062 
-335323.870730  7382500.813917 
-335315.170957  7382512.011999 
-335306.899987  7382521.550365 
-335293.623556  7382541.007033 
-335290.077677  7382556.584364 
-335289.904506  7382572.081710 
-335289.384994  7382590.908485 
-335286.655491  7382606.825758 
-335278.846311  7382620.913345 
-335270.080568  7382629.121939 
-335260.086136  7382637.540497 
-335245.506800  7382646.229009 
-335225.856033  7382669.375044 
-335159.308951  7382708.718305 
-335206.831979  7382725.045509 
-335219.242556  7382731.934329 
-335235.965911  7382743.132410 
-335248.120855  7382756.100189 
-335290.127154  7382820.169215 
-335346.053091  7382912.973318 
-335370.841260  7382956.435873 
-335435.871035  7383066.267060 
-335439.153035  7383080.244666 
-335438.872663  7383099.031448 
-335435.532939  7383128.746358 
-335427.352678  7383173.178747 
-335408.996569  7383235.878008 
-335373.603747  7383344.789352 
-335360.607688  7383385.402395 
-335357.012331  7383419.176610 
-335356.748452  7383425.265567 
-335357.243226  7383433.404173 
-335361.028245  7383446.871866 
-335366.841838  7383465.418689 
-335390.599228  7383523.108808 
-335409.549067  7383571.910448 
-335423.922247  7383633.139960 
-335444.875919  7383699.718556 
-335461.285918  7383754.099241 
-335459.207867  7383809.319782 
-335458.399737  7383821.907626 
-335449.452577  7383855.151932 
-335442.583466  7383885.426746 
-335427.847452  7383934.318371 
-335421.200990  7383953.625064 
-335417.086121  7383974.511486 
-335417.292277  7383992.788356 
-335418.430257  7384000.007119 
-335424.953025  7384027.982327 
-335433.199256  7384056.767397 
-335441.222838  7384078.123738 
-335454.268375  7384106.728839 
-335472.698701  7384136.953661 
-335481.348997  7384150.691308 
-335495.202664  7384183.705653 
-335509.311965  7384216.729996 
-335521.112321  7384247.474730 
-335536.466802  7384275.149990 
-335542.618490  7384287.587859 
-335545.240792  7384309.204156 
-335546.337540  7384329.260721 
-335552.299565  7384359.035621 
-335551.136847  7384389.060478 
-335545.883998  7384408.157207 
-335409.177986  7384671.312131 
-335416.748026  7384693.818276 
-335473.020304  7384709.575576 
-335616.570687  7384741.780060 
-335624.808671  7384753.278091 
-335633.665123  7384772.534792 
-335636.138992  7384797.820461 
-335637.392419  7384813.227822 
-335642.340158  7384826.905479 
-335650.149338  7384849.471614 
-335657.158634  7384867.748483 
-335658.964559  7384872.607651 
-335665.322402  7384906.241889 
-335667.004634  7384928.738036 
-335668.488955  7384951.464143 
-335672.669794  7384978.309545 
-335674.698367  7384998.046164 
-335680.223341  7385023.581790 
-335685.072125  7385036.599560 
-335687.430547  7385053.796615 
-335691.298029  7385063.694919 
-335691.652617  7385077.982472 
-335692.048436  7385087.620821 
-335695.577823  7385100.838557 
-335700.517315  7385114.966137 
-335715.154374  7385138.392124 
-335726.352755  7385158.778632 
-335730.508856  7385169.906726 
-335736.841961  7385187.473717 
-335742.037086  7385197.052076 
-335746.696207  7385209.289980 
-335757.185412  7385220.268099 
-335761.201326  7385225.847144 
-335766.915964  7385234.775614 
-335777.396923  7385247.073508 
-335783.136300  7385253.232453 
-335792.908083  7385264.410538 
-335802.242816  7385287.226630 
-335809.656177  7385299.714491 
-335814.554438  7385308.852926 
-335837.371759  7385330.429230 
-335850.384311  7385343.916920 
-335864.229732  7385373.421866 
-335877.819520  7385435.491234 
-335882.940429  7385470.095306 
-335883.575389  7385494.801074 
-335884.523706  7385519.846784 
-335884.334042  7385536.233977 
-335884.969002  7385562.049555 
-335882.965168  7385576.647055 
-335875.576545  7385598.043390 
-335864.625551  7385619.079787 
-335865.936702  7385637.856570 
-335866.274797  7385645.125325 
-335860.090124  7385668.531316 
-335849.848306  7385690.347579 
-335839.276638  7385722.412087 
-335834.741211  7385736.359698 
-335824.062342  7385766.224582 
-335820.203106  7385776.512820 
-335812.253740  7385802.668340 
-335795.884972  7385833.823003 
-335786.913073  7385851.559965 
-335781.668471  7385864.127812 
-335777.034089  7385885.784103 
-335776.267190  7385900.001667 
-335776.283682  7385907.260424 
-335768.301331  7385936.735375 
-335762.421768  7385950.962938 
-335755.890754  7385968.829878 
-335747.842433  7385994.985397 
-335739.967282  7386051.495718 
-335730.682027  7386078.631070 
-335725.330223  7386096.388028 
-335723.582022  7386101.697119 
-335721.314309  7386131.022096 
-335720.671103  7386142.650104 
-335720.275284  7386168.885610 
-335713.290726  7386181.883383 
-335705.720686  7386192.651539 
-335699.437059  7386224.586069 
-335696.773526  7386234.634348 
-335685.393728  7386248.461979 
-335667.994181  7386262.329604 
-335659.714966  7386272.867799 
-335655.624835  7386291.764562 
-335658.271875  7386300.873002 
-335667.169558  7386317.360178 
-335666.880940  7386333.867350 
-335657.224604  7386359.882894 
-335609.206803  7386351.254372 
-335604.118879  7386408.534560 
-335575.966247  7386627.277092 
-335555.482610  7386625.667367 
-335545.661350  7386649.693252 
-335586.818287  7386810.195759 
-335612.175446  7386842.040305 
-335658.750157  7386901.710084 
-335706.627772  7386981.436427 
-335725.008620  7387016.980339 
-335743.834764  7387057.723360 
-335771.937919  7387135.460044 
-335775.005516  7387143.828611 
-335785.544199  7387169.384234 
-335819.576393  7387280.885134 
-335852.569562  7387388.436712 
-335905.188760  7387546.629615 
-335980.353152  7387768.871547 
-335990.487769  7387793.347354 
-336023.934481  7387843.478767 
-336048.689665  7387909.117524 
-336111.567174  7388102.904330 
-336144.799483  7388227.602970 
-336166.058266  7388292.981771 
-336167.888929  7388302.700107 
-336183.342365  7388330.265385 
-336207.751208  7388379.416966 
-336235.079217  7388434.747488 
-336242.987352  7388445.865584 
-336259.562275  7388469.141597 
-336281.818852  7388499.656370 
-336304.652665  7388527.641576 
-336328.541995  7388554.127040 
-336479.134659  7388718.998799 
-336530.228304  7388709.440436 
-336563.048302  7388711.410098 
-336619.947293  7388718.488886 
-336642.706890  7388726.357538 
-336662.407135  7388734.166201 
-336692.077073  7388751.873168 
-336723.668382  7388775.199172 
-336745.092090  7388798.065255 
-336799.591428  7388845.577117 
-336827.686336  7388877.241693 
-336846.702144  7388893.438919 
-336864.109937  7388912.895586 
-336887.603448  7388945.490003 
-336918.906139  7388994.161666 
-336931.959922  7388979.284214 
-336946.893846  7388960.257473 
-336964.507795  7388934.411900 
-336986.813849  7388892.879014 
-337025.299007  7388832.599340 
-337043.490192  7388804.224200 
-337060.939216  7388774.299326 
-337065.177778  7388766.760617 
-337089.190802  7388740.275154 
-337109.196158  7388721.868307 
-337137.233342  7388697.532476 
-337171.207812  7388669.227324 
-337199.723278  7388646.421230 
-337289.813347  7388567.654722 
-337429.991022  7388450.814736 
-337437.536323  7388438.426858 
-337450.301488  7388425.209122 
-337462.778035  7388413.511126 
-337478.808708  7388396.254082 
-337492.118124  7388387.915510 
-337654.758531  7388252.148766 
-337687.949609  7388225.113397 
-337714.040683  7388204.017010 
-337778.468483  7388149.656322 
-337823.278500  7388113.222563 
-337858.770277  7388088.256839 
-337892.019079  7388071.899641 
-337926.834665  7388061.651396 
-337959.052688  7388055.032530 
-337980.336209  7388050.393325 
-338050.585848  7388041.094917 
-338298.294371  7387999.981960 
-338495.634916  7387957.429249 
-338523.878256  7387950.760391 
-338547.561431  7387941.062052 
-338757.485724  7387858.036274 
-338743.500117  7387764.332324 
-Region 1
-327
-338766.894673  7387919.095815 
-338757.485724  7387858.036274 
-338547.561431  7387941.062052 
-338523.878256  7387950.760391 
-338495.634916  7387957.429249 
-338298.294371  7387999.981960 
-338050.585848  7388041.094917 
-337980.336209  7388050.393325 
-337959.052688  7388055.032530 
-337926.834665  7388061.651396 
-337892.019079  7388071.899641 
-337858.770277  7388088.256839 
-337823.278500  7388113.222563 
-337778.468483  7388149.656322 
-337714.040683  7388204.017010 
-337687.949609  7388225.113397 
-337654.758531  7388252.148766 
-337492.118124  7388387.915510 
-337478.808708  7388396.254082 
-337462.778035  7388413.511126 
-337450.301488  7388425.209122 
-337437.536323  7388438.426858 
-337429.991022  7388450.814736 
-337289.813347  7388567.654722 
-337199.723278  7388646.421230 
-337171.207812  7388669.227324 
-337137.233342  7388697.532476 
-337109.196158  7388721.868307 
-337089.190802  7388740.275154 
-337065.177778  7388766.760617 
-337060.939216  7388774.299326 
-337043.490192  7388804.224200 
-337025.299007  7388832.599340 
-336986.813849  7388892.879014 
-336964.507795  7388934.411900 
-336946.893846  7388960.257473 
-336931.959922  7388979.284214 
-336918.906139  7388994.161666 
-336887.603448  7388945.490003 
-336864.109937  7388912.895586 
-336846.702144  7388893.438919 
-336827.686336  7388877.241693 
-336799.591428  7388845.577117 
-336745.092090  7388798.065255 
-336723.668382  7388775.199172 
-336692.077073  7388751.873168 
-336662.407135  7388734.166201 
-336642.706890  7388726.357538 
-336619.947293  7388718.488886 
-336563.048302  7388711.410098 
-336530.228304  7388709.440436 
-336479.134659  7388718.998799 
-336328.541995  7388554.127040 
-336304.652665  7388527.641576 
-336281.818852  7388499.656370 
-336259.562275  7388469.141597 
-336242.987352  7388445.865584 
-336235.079217  7388434.747488 
-336207.751208  7388379.416966 
-336183.342365  7388330.265385 
-336167.888929  7388302.700107 
-336166.058266  7388292.981771 
-336144.799483  7388227.602970 
-336111.567174  7388102.904330 
-336048.689665  7387909.117524 
-336023.934481  7387843.478767 
-335990.487769  7387793.347354 
-335946.642561  7387855.336736 
-335928.954396  7387876.073184 
-335912.321749  7387912.326974 
-335908.899563  7387952.930019 
-335910.433362  7387999.682011 
-335908.668669  7388029.606885 
-335909.460307  7388044.114400 
-335906.087599  7388055.782402 
-335897.651705  7388066.900497 
-335892.266916  7388074.989112 
-335882.989907  7388084.797432 
-335789.889963  7388108.613352 
-335744.403754  7388125.840401 
-335647.782670  7388131.539425 
-335630.539802  7388132.189314 
-335610.270567  7388130.019685 
-335570.787614  7388119.851427 
-335549.256706  7388117.671800 
-335537.852169  7388118.111725 
-335522.621381  7388120.801264 
-335506.623694  7388125.770413 
-335489.331348  7388133.029170 
-335473.548063  7388142.827492 
-335440.942467  7388167.263306 
-335414.711207  7388185.630160 
-335385.156716  7388207.276452 
-335375.483888  7388215.085114 
-335365.489456  7388230.522470 
-335356.253678  7388247.229608 
-335348.832070  7388267.336164 
-335344.832648  7388287.552701 
-335334.739262  7388357.100788 
-335328.942162  7388391.364919 
-335318.073630  7388462.682703 
-335314.841108  7388491.107834 
-335307.477224  7388530.951009 
-335296.377797  7388600.239141 
-335295.833546  7388606.838011 
-335276.817738  7388721.038449 
-335254.948734  7388848.176672 
-335241.548610  7388918.724587 
-335235.578339  7388940.790808 
-335227.802143  7388966.386423 
-335210.006777  7389011.748653 
-335208.472978  7389015.048088 
-335186.562744  7389070.288626 
-335151.293615  7389151.614695 
-335139.682922  7389182.779357 
-335124.501612  7389217.233456 
-335117.178959  7389249.697895 
-335117.393361  7389256.816675 
-335119.619843  7389264.445369 
-335123.619265  7389273.123882 
-335140.449822  7389296.099946 
-335152.200700  7389321.835538 
-335157.808137  7389354.389962 
-335156.958776  7389368.107612 
-335155.078635  7389383.854915 
-335150.361791  7389408.210743 
-335144.119394  7389431.786704 
-335133.259109  7389465.001015 
-335120.906255  7389492.356329 
-335109.848060  7389515.402382 
-335102.187312  7389524.750781 
-335092.530976  7389528.500138 
-335081.093454  7389533.509280 
-335054.153018  7389543.737528 
-335045.486230  7389550.286407 
-335038.600627  7389557.095240 
-335032.960205  7389566.473634 
-335030.098763  7389577.881680 
-335022.759618  7389614.665379 
-335012.278659  7389627.303214 
-335007.429875  7389631.592480 
-334998.029172  7389635.091880 
-334988.653208  7389636.041717 
-334978.007324  7389634.441991 
-334957.243316  7389631.262536 
-334929.610197  7389631.832438 
-334912.870348  7389632.992240 
-334892.263018  7389645.050174 
-334861.949874  7389665.936597 
-334832.626278  7389691.402235 
-334773.509050  7389737.764293 
-334746.733540  7389763.489887 
-334738.297646  7389773.338200 
-334730.612159  7389786.245989 
-334725.466511  7389796.124297 
-334722.613315  7389807.792298 
-334722.761747  7389823.289644 
-334723.891481  7389844.126074 
-334729.251531  7389876.430541 
-334733.902405  7389902.376097 
-334733.547817  7389917.113572 
-334731.172902  7389931.581094 
-334724.996476  7389944.998796 
-334712.297280  7389948.478200 
-334703.416090  7389949.178080 
-334665.928725  7389945.118775 
-334640.332426  7389940.829510 
-334640.818953  7389946.328568 
-334645.758445  7389969.414614 
-334648.801304  7389997.919731 
-334651.901887  7390022.095590 
-334653.056359  7390036.953045 
-334654.441726  7390058.669325 
-334656.511530  7390074.536607 
-334662.844635  7390110.490449 
-334665.928725  7390135.556155 
-334669.037554  7390158.292261 
-334676.038604  7390198.245417 
-334685.092965  7390236.778817 
-334694.196804  7390280.181382 
-334700.727819  7390307.506702 
-334715.199954  7390372.165626 
-334729.729812  7390426.156378 
-334751.541092  7390497.804105 
-334775.413930  7390544.526102 
-334821.106294  7390644.199029 
-334851.122573  7390700.939310 
-334864.836055  7390724.575262 
-334875.209813  7390746.171562 
-334883.959064  7390766.178135 
-334886.358717  7390771.667195 
-334892.749546  7390783.805116 
-334904.450947  7390805.421413 
-334927.861996  7390847.114272 
-334941.361075  7390872.179978 
-334954.208703  7390891.596652 
-334971.979330  7390909.193638 
-334980.984214  7390915.602540 
-334987.828585  7390924.650990 
-334994.046243  7390932.429658 
-335005.228132  7390941.618084 
-335015.486443  7390948.506904 
-335024.977854  7390952.946144 
-335037.536863  7390956.615515 
-335079.493685  7390965.963914 
-335100.315417  7390970.403153 
-335122.209160  7390974.532446 
-335146.865389  7390981.121317 
-335159.267720  7390984.790689 
-335169.963081  7390988.909983 
-335175.042759  7390990.459718 
-335190.199331  7390998.418355 
-335201.686331  7391006.686938 
-335214.698883  7391018.934840 
-335225.113872  7391029.802979 
-335234.300173  7391042.670775 
-335251.295654  7391067.466527 
-335295.891269  7391144.893265 
-335221.567993  7391197.974173 
-335162.541474  7391247.205740 
-335076.450826  7391312.944479 
-335060.840711  7391329.821588 
-334992.396997  7391379.663051 
-334894.209128  7391456.909819 
-334903.997404  7391469.507661 
-334905.861052  7391477.356317 
-334905.960007  7391487.764534 
-334902.026555  7391501.762136 
-334890.811681  7391525.448079 
-334847.098413  7391607.554015 
-334865.289598  7391646.467350 
-334874.360451  7391663.644407 
-334885.171260  7391677.002119 
-334901.540028  7391686.240537 
-334921.998926  7391696.968699 
-334934.788829  7391704.217458 
-334945.830532  7391715.535519 
-334957.688612  7391731.682753 
-334975.203606  7391752.839129 
-334998.062157  7391775.465254 
-335051.027697  7391808.749552 
-335095.936669  7391848.702709 
-335131.799526  7391900.913765 
-335124.600567  7391919.510580 
-335123.462587  7391929.908799 
-335125.375712  7391941.556804 
-335128.715436  7391953.004843 
-335133.490003  7391964.352899 
-335140.713701  7391975.401006 
-335150.172128  7391988.018845 
-335163.267142  7391999.996793 
-335195.567627  7392012.104719 
-335214.830822  7392024.232642 
-335229.756500  7392036.180595 
-335243.783338  7392054.467463 
-335252.499604  7392076.163747 
-335256.556749  7392092.071022 
-335259.409945  7392112.057598 
-335258.939910  7392131.334296 
-335254.198327  7392154.470333 
-335246.397393  7392176.896492 
-335307.592671  7392254.153259 
-335402.069735  7392293.756475 
-335448.933064  7392484.923730 
-335459.991259  7392506.380054 
-335471.016470  7392580.877294 
-335479.048298  7392610.312252 
-335492.431931  7392630.838736 
-335515.620331  7392649.565528 
-335540.639395  7392658.573985 
-335572.511077  7392680.160287 
-335750.646151  7392752.307929 
-335792.231892  7392676.400931 
-335876.599078  7392587.426172 
-335911.480634  7392640.397099 
-335951.697500  7392658.344024 
-336000.003920  7392682.359911 
-336050.833685  7392702.986378 
-336198.878264  7392779.573259 
-336232.209528  7392797.680157 
-336250.375974  7392774.524124 
-336259.067502  7392764.955763 
-336272.104792  7392762.346210 
-336290.370193  7392770.174869 
-336313.838965  7392782.352783 
-336383.791740  7392813.077520 
-336673.597270  7392212.990309 
-336820.619316  7391918.950676 
-336900.426336  7391738.321616 
-336999.084240  7391512.680266 
-337127.222418  7391202.363421 
-337085.983018  7391203.593210 
-337171.125350  7390942.437944 
-337199.005856  7390867.120845 
-337232.749431  7390801.572073 
-337291.446101  7390698.369750 
-337338.894912  7390622.562735 
-337403.949426  7390530.118570 
-337512.049263  7390389.742615 
-337620.157347  7390252.036203 
-337773.735147  7390060.299046 
-337862.761453  7389946.828482 
-338041.778874  7389723.796686 
-338270.685990  7389432.756538 
-338773.508150  7388794.945790 
-338806.039530  7388753.692856 
-338802.378204  7388725.967605 
-338799.854857  7388713.869677 
-338796.457410  7388697.882416 
-338811.556259  7388680.555384 
-338822.837102  7388665.837905 
-338828.947559  7388658.039240 
-338843.551633  7388638.822532 
-338862.014944  7388611.667184 
-338871.506355  7388593.280333 
-338874.483245  7388582.682148 
-338875.472792  7388575.823323 
-338872.768029  7388561.955699 
-338862.691135  7388513.663971 
-338860.868718  7388503.345738 
-338852.119467  7388454.404121 
-338845.555468  7388420.109996 
-338835.791930  7388380.246824 
-338829.879383  7388360.800155 
-338817.040002  7388266.846248 
-338791.064375  7388087.147029 
-338766.894673  7387919.095815 
-Region 1
-308
-341738.258962  7388451.264659 
-341720.257441  7388431.857983 
-341697.069040  7388405.472503 
-341675.406192  7388379.646926 
-341649.389335  7388351.011831 
-341620.263648  7388317.257613 
-341594.997197  7388285.193106 
-341570.489400  7388257.797798 
-341550.805647  7388228.562806 
-341538.700181  7388206.616565 
-341527.798664  7388185.680151 
-341515.800398  7388153.765618 
-341505.368916  7388127.730078 
-341498.202942  7388110.373051 
-341494.582847  7388096.385447 
-341485.916058  7388076.798802 
-341469.976095  7388050.373328 
-341455.009186  7388028.507074 
-341446.218704  7388020.218493 
-341434.575026  7388011.559976 
-341410.364093  7387994.912828 
-341381.073482  7387976.316013 
-341351.518991  7387954.179805 
-341295.164251  7387918.565906 
-341264.851107  7387900.299034 
-341232.690808  7387882.222131 
-341211.267100  7387872.243840 
-341202.732252  7387869.274349 
-341178.430610  7387860.815798 
-341138.757994  7387858.836137 
-341125.778427  7387860.245895 
-341104.189795  7387865.764950 
-341080.605576  7387875.923210 
-341042.021463  7387894.989944 
-341014.891364  7387912.746902 
-340980.974617  7387934.413191 
-340942.901770  7387963.018291 
-340915.722194  7387985.094510 
-340899.468873  7387996.542549 
-340872.338775  7388014.299507 
-340848.424706  7388026.337445 
-340820.321552  7388039.205241 
-340799.268925  7388051.603117 
-340741.075275  7388090.726416 
-340706.647262  7388113.052592 
-340661.622843  7388142.907478 
-340627.978222  7388167.683234 
-340569.265060  7388208.346269 
-340537.921137  7388227.942912 
-340508.407877  7388248.439401 
-340481.302517  7388263.316853 
-340461.544549  7388277.944347 
-340435.857540  7388293.831626 
-340416.643823  7388305.689595 
-340392.309196  7388319.267269 
-340360.965274  7388339.193856 
-340323.428432  7388365.139412 
-340291.556750  7388386.615733 
-340263.503073  7388404.242713 
-340250.853356  7388412.971218 
-340229.751251  7388429.788338 
-340180.933566  7388470.011448 
-340139.661182  7388501.905985 
-340102.165571  7388533.830516 
-340057.528724  7388573.983638 
-340034.983530  7388591.790588 
-340000.720441  7388617.336212 
-339950.632837  7388652.780141 
-339915.982175  7388675.986166 
-339876.647655  7388698.702275 
-339836.826607  7388727.837285 
-339789.946786  7388759.211910 
-339750.166969  7388785.137470 
-339717.412941  7388802.834438 
-339703.847892  7388811.432965 
-339675.654029  7388832.389376 
-339635.453655  7388859.294767 
-339597.413793  7388884.240494 
-339559.464640  7388910.625975 
-339512.650788  7388944.780124 
-339469.077705  7388971.655521 
-339422.214377  7389001.150469 
-339390.862208  7389021.626961 
-339343.091794  7389050.232061 
-339313.652750  7389063.749746 
-339284.254938  7389073.168133 
-339247.427272  7389081.076778 
-339211.135611  7389086.655822 
-339153.337780  7389098.533788 
-339114.126953  7389109.621888 
-339076.812760  7389124.489342 
-339039.350134  7389143.456093 
-338992.626991  7389169.301666 
-338965.364953  7389188.498378 
-338926.121141  7389212.094336 
-338876.025290  7389237.899916 
-338842.347684  7389256.026811 
-338833.037689  7389248.948023 
-338795.484355  7389220.512894 
-338768.378995  7389189.418220 
-338747.598494  7389167.042053 
-338737.430891  7389154.084272 
-338731.139017  7389141.496429 
-338728.962012  7389126.189051 
-338728.599178  7389113.231270 
-338733.456208  7389097.993880 
-338739.113122  7389085.216069 
-338746.666670  7389075.997648 
-338753.816152  7389065.879381 
-338759.423588  7389057.200868 
-338766.556578  7389048.972277 
-338778.373426  7389032.485101 
-338788.730692  7389019.087396 
-338797.348003  7388996.591250 
-338801.578319  7388973.605187 
-338805.561249  7388955.258329 
-338808.117580  7388935.911643 
-338811.457304  7388901.617518 
-338812.298419  7388871.612657 
-338812.595284  7388844.697268 
-338811.152193  7388809.023378 
-338809.725595  7388781.538086 
-338806.039530  7388753.692856 
-338773.508150  7388794.945790 
-338270.685990  7389432.756538 
-338041.778874  7389723.796686 
-337862.761453  7389946.828482 
-337773.735147  7390060.299046 
-337620.157347  7390252.036203 
-337512.049263  7390389.742615 
-337403.949426  7390530.118570 
-337338.894912  7390622.562735 
-337291.446101  7390698.369750 
-337232.749431  7390801.572073 
-337199.005856  7390867.120845 
-337171.125350  7390942.437944 
-337085.983018  7391203.593210 
-337127.222418  7391202.363421 
-337197.422579  7391194.214817 
-337243.238637  7391190.465459 
-337454.812176  7391172.668507 
-337651.880596  7391163.470083 
-337661.050405  7391163.620057 
-337663.417073  7391164.229953 
-337670.500585  7391166.049641 
-337755.280083  7391164.089977 
-337722.056019  7391295.257509 
-337734.969616  7391287.748795 
-337757.003545  7391275.820838 
-337767.138162  7391272.401424 
-337781.107277  7391268.692059 
-337798.399623  7391265.962527 
-337819.782099  7391265.722568 
-337833.281178  7391265.822551 
-337862.093508  7391269.311953 
-337869.498623  7391271.001664 
-337886.353919  7391275.130956 
-337913.698420  7391284.479355 
-337933.167770  7391295.177523 
-337948.546990  7391305.165812 
-337968.321451  7391320.183239 
-337985.556073  7391335.990532 
-338007.746680  7391362.915920 
-338038.653553  7391418.696365 
-338082.746148  7391495.333238 
-338162.973726  7391634.719362 
-338198.754121  7391692.359489 
-338219.509883  7391732.442623 
-338230.172259  7391750.289566 
-338242.368434  7391771.745891 
-338248.858218  7391782.853988 
-338255.611881  7391794.961914 
-338265.573327  7391813.228785 
-338268.179136  7391826.566500 
-338272.632101  7391838.464462 
-338280.061955  7391857.291238 
-338284.696336  7391876.407963 
-338288.835944  7391901.013748 
-338289.132808  7391927.169268 
-338289.561612  7391943.666442 
-338286.287859  7391970.381866 
-338283.080075  7392002.116430 
-338318.233756  7392011.954745 
-338393.637289  7392050.198194 
-338450.701205  7392073.724165 
-338487.108314  7392093.220825 
-338586.755765  7392144.961962 
-338636.868109  7392167.808049 
-338679.402166  7392129.174666 
-338725.680013  7392087.161863 
-338742.691986  7392073.124267 
-338762.573649  7392072.234420 
-338782.950084  7392069.554879 
-338804.027450  7392059.256643 
-338828.098197  7392039.789977 
-338866.781265  7391999.996793 
-338869.156180  7391987.728895 
-338850.453729  7391938.547319 
-338844.450473  7391879.787384 
-338859.796708  7391855.181599 
-338959.435913  7391833.135375 
-339008.591694  7391850.402418 
-339035.828993  7391822.027278 
-339069.333429  7391757.288367 
-339101.576190  7391694.589107 
-339117.112089  7391650.696625 
-339127.048797  7391651.286524 
-339135.657862  7391649.116896 
-339148.101424  7391647.127237 
-339159.530699  7391645.927442 
-339168.708754  7391647.037252 
-339180.204000  7391649.636807 
-339194.783335  7391653.956067 
-339206.097164  7391660.874882 
-339292.426953  7391612.743126 
-339435.969090  7391532.706836 
-339484.621850  7391505.761451 
-339569.401347  7391463.448699 
-339601.338999  7391454.250275 
-339619.711601  7391449.231135 
-339637.490474  7391445.661746 
-339692.797943  7391432.763955 
-339765.274064  7391416.036820 
-339778.418556  7391409.417954 
-339810.092328  7391401.609292 
-339823.781070  7391399.099722 
-339857.681325  7391387.121773 
-339879.138017  7391377.113488 
-339895.242905  7391373.284144 
-339911.718874  7391363.115885 
-339993.645176  7391324.162558 
-340012.347627  7391313.834327 
-340033.474470  7391306.215632 
-340084.815502  7391280.939961 
-340113.042349  7391276.630699 
-340175.441576  7391262.863058 
-340254.992963  7391252.514830 
-340330.248064  7391250.525171 
-340355.910334  7391249.165404 
-340392.836955  7391248.555508 
-340414.392602  7391248.615498 
-340460.282875  7391247.605671 
-340506.552476  7391251.325034 
-340511.310551  7391223.279838 
-340529.221364  7391147.782770 
-340410.277733  7391129.335930 
-340349.915324  7391121.197324 
-340314.423548  7391117.457964 
-340232.505492  7391111.129048 
-340266.917013  7391014.555590 
-340275.567309  7390995.018937 
-340324.607643  7390861.331836 
-340338.057245  7390822.568476 
-340382.355996  7390706.278396 
-340561.925914  7390371.665712 
-340624.424096  7390291.769397 
-340644.198558  7390268.033463 
-340682.172450  7390220.571593 
-340717.771427  7390174.689452 
-340743.087355  7390150.953518 
-340808.743844  7390075.806390 
-340813.378225  7390063.258539 
-340841.967907  7390023.595333 
-340878.589417  7389978.523053 
-340921.238922  7389933.500765 
-340952.962172  7389897.946855 
-341001.012958  7389875.840642 
-341145.124084  7389816.100875 
-341187.410755  7389796.864170 
-341263.968761  7389722.146968 
-341284.089563  7389697.291226 
-341296.895959  7389736.724471 
-341350.117132  7389721.037158 
-341339.322816  7389695.031613 
-341336.510852  7389677.084687 
-341370.650246  7389672.065547 
-341391.974999  7389670.485817 
-341413.299751  7389658.637847 
-341517.556845  7389562.274353 
-341544.414819  7389541.737871 
-341564.947933  7389529.889900 
-341673.154971  7389469.080316 
-341763.195564  7389422.478299 
-341766.139468  7389367.297751 
-341765.141674  7389326.894672 
-341764.267574  7389305.918265 
-341762.791499  7389276.763259 
-341758.998232  7389243.728917 
-341755.460600  7389222.722515 
-341750.760248  7389203.965728 
-341835.127434  7389156.403875 
-341819.459596  7389102.823053 
-341806.372828  7389056.141049 
-341797.623577  7389026.666098 
-341787.670376  7388999.930678 
-341756.870705  7388954.908389 
-341726.071033  7388909.896100 
-341707.904587  7388880.671106 
-341695.263116  7388849.866382 
-341669.839987  7388842.297679 
-341672.363333  7388794.575853 
-341674.730001  7388702.171681 
-341673.938363  7388533.150633 
-341681.294001  7388514.493828 
-341691.321418  7388493.227471 
-341712.456507  7388464.112458 
-341738.308440  7388451.324649 
-341738.258962  7388451.264659 
-Region 1
-628
-348624.950055  7386618.428607 
-348618.419040  7386618.698561 
-348602.149227  7386623.067813 
-348592.921695  7386627.407069 
-348585.161992  7386637.395358 
-348572.784400  7386650.783065 
-348565.239099  7386659.671543 
-348562.732245  7386665.630522 
-348561.816913  7386674.918931 
-348563.639330  7386685.797068 
-348563.556868  7386694.205627 
-348562.633290  7386704.613844 
-348559.409014  7386710.002921 
-348554.890079  7386712.832437 
-348545.481130  7386715.282017 
-348526.028272  7386721.400969 
-348514.326871  7386727.699890 
-348507.358806  7386730.619390 
-348503.285168  7386730.349436 
-348500.036153  7386728.319784 
-348495.591435  7386723.960531 
-348494.502932  7386720.961044 
-348491.822907  7386713.622301 
-348488.524415  7386707.383370 
-348486.396888  7386705.703658 
-348481.721275  7386703.993951 
-348474.563547  7386705.023774 
-348468.016040  7386707.063425 
-348463.249718  7386713.882257 
-348454.780839  7386733.608878 
-348450.723694  7386740.877633 
-348445.693493  7386743.817129 
-348439.253187  7386744.966932 
-348431.608931  7386744.557003 
-348413.063159  7386741.707491 
-348383.384974  7386739.957790 
-348372.871030  7386740.957619 
-348360.979966  7386745.706806 
-348349.509459  7386750.016068 
-348339.498535  7386751.245857 
-348332.151143  7386750.615965 
-348326.362290  7386748.666299 
-348323.632787  7386745.906771 
-348323.179244  7386744.936938 
-348322.832903  7386744.537006 
-348319.740566  7386737.638188 
-348319.303516  7386730.649385 
-348320.334295  7386719.921222 
-348318.915943  7386708.833122 
-348313.959959  7386694.385597 
-348308.921512  7386678.828261 
-348305.037537  7386670.039767 
-348300.403155  7386663.790837 
-348288.396644  7386651.153002 
-348268.778861  7386633.446035 
-348260.780017  7386627.387073 
-348247.181983  7386620.818198 
-348236.107295  7386616.049015 
-348232.973727  7386612.919551 
-348229.246431  7386608.780260 
-348223.902874  7386602.301370 
-348219.045844  7386598.492022 
-348214.568141  7386597.222240 
-348206.297171  7386597.692159 
-348195.337931  7386602.001421 
-348189.458368  7386608.150368 
-348186.580434  7386619.638400 
-348184.345705  7386628.026963 
-348180.956505  7386630.876475 
-348176.256153  7386630.826484 
-348170.887857  7386626.997140 
-348166.665787  7386621.308114 
-348163.862068  7386616.079010 
-348157.900044  7386610.250008 
-348149.290979  7386603.961085 
-348139.222331  7386601.421520 
-348131.775985  7386600.791628 
-348126.053101  7386602.061411 
-348117.427544  7386606.950573 
-348106.600243  7386617.578753 
-348093.967017  7386625.757352 
-348089.777932  7386626.487227 
-348086.619626  7386625.567384 
-348084.401390  7386622.887843 
-348081.424501  7386615.219157 
-348076.171652  7386600.431690 
-348072.048536  7386584.664391 
-348069.154109  7386568.577146 
-348064.049693  7386558.998787 
-348058.821582  7386551.300106 
-348051.012402  7386546.900859 
-348040.836553  7386544.251313 
-348009.335952  7386541.591769 
-347986.988667  7386541.251827 
-347973.102015  7386542.321644 
-347966.529769  7386546.021010 
-347963.107583  7386551.740030 
-347959.908046  7386564.997759 
-347957.087835  7386571.176701 
-347950.128016  7386573.536297 
-347943.498047  7386573.026384 
-347928.316736  7386570.876752 
-347911.502672  7386568.257201 
-347894.564914  7386568.417174 
-347874.831684  7386572.196526 
-347855.436550  7386573.106371 
-347837.797862  7386571.816591 
-347799.304458  7386560.428542 
-347797.242900  7386559.548693 
-347797.209915  7386559.538695 
-347774.351364  7386549.780366 
-347756.498274  7386540.062031 
-347743.460984  7386528.194064 
-347732.674914  7386515.226285 
-347723.406151  7386503.508292 
-347713.972463  7386488.340890 
-347703.062700  7386478.482579 
-347690.586153  7386470.823891 
-347669.434571  7386464.295009 
-347652.942110  7386460.355684 
-347630.001096  7386458.895934 
-347613.137555  7386461.705453 
-347600.413621  7386467.884394 
-347583.063551  7386478.122640 
-347553.121488  7386502.278503 
-347535.524032  7386516.156126 
-347521.051897  7386524.754653 
-347513.844691  7386530.663641 
-347498.828305  7386541.691752 
-347485.955939  7386553.189782 
-347477.313890  7386559.958623 
-347468.407961  7386562.308220 
-347448.913871  7386563.428028 
-347434.458229  7386560.068604 
-347414.428135  7386553.099797 
-347394.579458  7386548.130649 
-347362.237741  7386537.712433 
-347330.794864  7386529.523836 
-347301.611453  7386520.355406 
-347272.188902  7386513.516578 
-347259.456722  7386511.166980 
-347241.405723  7386510.867032 
-347232.409086  7386511.996838 
-347225.539976  7386515.356263 
-347220.996302  7386520.175437 
-347216.823710  7386528.883945 
-347211.175042  7386542.441623 
-347201.296057  7386560.288566 
-347189.850289  7386571.686614 
-347183.475953  7386575.935886 
-347153.789523  7386594.892639 
-347140.133765  7386602.391354 
-347111.181249  7386610.170022 
-347082.245226  7386615.629087 
-347055.717102  7386615.679078 
-347031.349490  7386613.429464 
-347010.783391  7386609.230183 
-346997.251326  7386605.430834 
-346978.730292  7386600.481681 
-346970.104735  7386596.292399 
-346949.975686  7386579.245319 
-346943.997169  7386575.415975 
-346936.476606  7386572.016557 
-346927.958250  7386567.497331 
-346920.874738  7386561.768313 
-346906.270664  7386552.649875 
-346891.369725  7386543.521438 
-346877.177962  7386534.403000 
-346869.377028  7386529.443850 
-346844.720798  7386516.116132 
-346813.657247  7386500.508806 
-346793.157118  7386490.220568 
-346762.497632  7386474.943185 
-346745.667075  7386464.694940 
-346730.362071  7386454.896619 
-346708.097249  7386437.829542 
-346700.988998  7386434.210162 
-346694.276566  7386432.590440 
-346684.381089  7386432.260496 
-346677.957276  7386431.860565 
-346671.640663  7386430.800746 
-346655.642976  7386428.411156 
-346645.574328  7386425.651628 
-346636.511720  7386423.891930 
-346622.633314  7386423.531991 
-346605.398692  7386422.792118 
-346591.841889  7386421.322370 
-346573.980553  7386422.132231 
-346562.757434  7386422.012252 
-346536.237556  7386420.512508 
-346518.499914  7386419.112748 
-346506.064598  7386417.433036 
-346494.775508  7386414.543531 
-346482.768996  7386411.094122 
-346469.335887  7386407.184791 
-346461.732862  7386402.785545 
-346449.553179  7386396.786573 
-346435.938652  7386391.217526 
-346425.449447  7386388.897924 
-346411.686488  7386388.308025 
-346399.630499  7386389.177876 
-346390.840017  7386391.077550 
-346374.050691  7386395.656766 
-346360.122808  7386401.165822 
-346341.857407  7386410.824168 
-346324.515584  7386419.832625 
-346312.212208  7386425.571642 
-346290.804993  7386432.990371 
-346266.627045  7386442.588727 
-346252.872332  7386449.977461 
-346242.704730  7386455.856454 
-346211.385546  7386475.123154 
-346174.087844  7386498.989066 
-346160.300147  7386510.467100 
-346142.677952  7386526.784305 
-346119.910109  7386547.360781 
-346106.518231  7386558.848813 
-346091.501845  7386569.986905 
-346072.997303  7386583.084661 
-346055.127721  7386594.302740 
-346047.417495  7386599.871786 
-346043.599491  7386603.921092 
-346039.608315  7386614.629258 
-346035.336768  7386632.186251 
-346028.434673  7386658.251786 
-346023.841522  7386668.060106 
-346009.773453  7386685.517116 
-345992.151258  7386702.054283 
-345975.180515  7386715.172036 
-345948.602914  7386738.807987 
-345939.037286  7386746.016753 
-345924.680599  7386752.735602 
-345912.583378  7386758.034694 
-345899.892429  7386761.334129 
-345878.542938  7386763.653732 
-345863.295658  7386767.923000 
-345845.409583  7386780.020928 
-345826.542208  7386798.427775 
-345815.921063  7386809.055955 
-345812.375183  7386816.224727 
-345800.022330  7386845.109779 
-345783.818487  7386882.143435 
-345767.293040  7386910.318609 
-345761.759820  7386922.006607 
-345757.257378  7386932.924737 
-345747.914398  7386947.992156 
-345743.329494  7386957.470532 
-345737.482917  7386969.698438 
-345729.393364  7386991.984620 
-345722.062465  7387019.039986 
-345714.814029  7387048.314972 
-345708.827265  7387074.050563 
-345707.095557  7387083.448953 
-345704.885567  7387089.737876 
-345701.265472  7387094.467066 
-345693.637708  7387101.915790 
-345685.267784  7387111.344175 
-345679.215051  7387114.163692 
-345670.911097  7387118.392968 
-345662.574157  7387124.621901 
-345655.292736  7387128.421250 
-345636.557300  7387134.420223 
-345625.993878  7387138.739483 
-345611.332080  7387145.898256 
-345586.783052  7387160.805703 
-345556.799757  7387178.432684 
-345538.212753  7387189.310820 
-345515.040845  7387200.028984 
-345494.334560  7387208.337561 
-345483.795877  7387211.437030 
-345466.330360  7387212.466854 
-345455.602014  7387213.906607 
-345429.205830  7387220.275516 
-345371.317291  7387232.943346 
-345320.471033  7387244.921295 
-345285.762648  7387256.289347 
-345268.561011  7387261.758411 
-345246.007570  7387271.266782 
-345236.359480  7387276.255927 
-345228.113250  7387284.034595 
-345211.703251  7387301.251646 
-345204.974326  7387310.260103 
-345186.849111  7387345.394085 
-345173.226338  7387369.279993 
-345162.366053  7387383.337585 
-345136.604828  7387415.852016 
-345124.713763  7387430.559497 
-345114.496684  7387441.747580 
-345087.655203  7387461.404213 
-345066.190265  7387473.802090 
-345041.979331  7387486.389933 
-345016.853067  7387498.187912 
-344968.315753  7387516.554766 
-344944.929443  7387524.563395 
-344919.778439  7387529.612530 
-344902.263446  7387535.071595 
-344891.782486  7387542.270362 
-344880.542874  7387552.888543 
-344867.728232  7387568.485871 
-344847.417765  7387596.950995 
-344833.226003  7387617.287512 
-344822.266762  7387630.795198 
-344820.040280  7387638.303912 
-344807.077205  7387657.990540 
-344798.064075  7387670.178452 
-344781.192287  7387683.296205 
-344770.604127  7387690.714934 
-344753.979726  7387699.063504 
-344734.634069  7387704.612554 
-344717.770527  7387707.202110 
-344703.809659  7387705.172458 
-344688.364469  7387703.762699 
-344681.907670  7387702.442925 
-344671.204063  7387700.733218 
-344663.493837  7387698.773554 
-344654.117873  7387748.874972 
-344643.826577  7387769.441449 
-344625.643638  7387801.086029 
-344607.435961  7387817.693184 
-344584.503194  7387839.849389 
-344582.919917  7387844.588577 
-344545.745910  7387891.260583 
-344527.546479  7387923.695027 
-344507.772018  7387941.102045 
-344482.621014  7387943.091704 
-344469.798125  7387959.298928 
-344455.342483  7387976.805930 
-344449.512398  7387993.163128 
-344443.632836  7388015.229348 
-344447.186961  7388048.063724 
-344452.373840  7388067.560384 
-344458.278141  7388091.256325 
-344464.957588  7388113.822460 
-344472.057593  7388130.669574 
-344479.190582  7388143.687344 
-344488.550054  7388164.373801 
-344512.521846  7388204.886861 
-344534.168202  7388220.074260 
-344561.751843  7388247.759518 
-344582.078802  7388276.164652 
-344586.548259  7388288.412554 
-344592.889610  7388305.999542 
-344609.002745  7388338.943899 
-344613.488695  7388350.041998 
-344621.330860  7388369.948588 
-344635.588593  7388396.004125 
-344655.511486  7388429.358411 
-344678.468992  7388462.742693 
-344742.723621  7388539.519542 
-344707.908035  7388601.258966 
-344673.249128  7388648.450883 
-344664.409169  7388659.439001 
-344647.784768  7388685.894469 
-344617.999383  7388724.997771 
-344611.699262  7388735.276010 
-344588.453138  7388761.841460 
-344573.989250  7388775.309153 
-344560.407708  7388785.597391 
-344548.112578  7388790.206601 
-344534.308388  7388794.015949 
-344514.509188  7388794.235911 
-344493.769918  7388786.457244 
-344471.562819  7388776.338977 
-344431.436661  7388767.270530 
-344403.572647  7388770.320008 
-344380.408985  7388786.367259 
-344317.910803  7388845.687098 
-344291.803237  7388866.263573 
-344247.487993  7388878.311510 
-344275.343761  7388937.651345 
-344297.361196  7388985.803097 
-344315.057607  7389024.316500 
-344326.618823  7389052.931599 
-344277.578489  7389086.155908 
-344232.479854  7389121.769808 
-344188.189349  7389145.835685 
-344160.490260  7389157.373709 
-344091.667219  7389207.995038 
-343954.177816  7389319.795887 
-343933.636455  7389312.687105 
-343899.678477  7389324.535076 
-343849.920722  7389339.542505 
-343759.088491  7389370.347229 
-343684.847676  7389396.412764 
-343647.723146  7389408.260734 
-343556.280694  7389407.100933 
-343424.959471  7389450.123564 
-343346.801697  7389492.776258 
-343297.827333  7389533.839224 
-343254.386190  7389578.071647 
-343272.931963  7389623.483868 
-343300.194002  7389686.283112 
-343359.500892  7389827.928849 
-343368.093465  7389852.134703 
-343425.091411  7389976.823345 
-343456.517796  7390055.299902 
-343478.238368  7390108.400807 
-343542.657921  7390260.874689 
-343554.285107  7390292.379293 
-343578.949582  7390359.227842 
-343591.219974  7390388.512826 
-343627.915700  7390476.117820 
-343666.491567  7390554.604376 
-343664.232100  7390573.751096 
-343659.482271  7390595.647346 
-343657.057879  7390606.285523 
-343648.292136  7390625.042311 
-343623.965756  7390672.784133 
-343581.283266  7390750.190874 
-343537.767907  7390829.067363 
-343523.873008  7390860.571967 
-343496.000748  7390918.891977 
-343475.591328  7390947.437087 
-343437.444265  7390999.768123 
-343499.142562  7390983.950833 
-343526.899375  7390982.851021 
-343557.682554  7390998.978259 
-343566.588483  7391003.997399 
-343576.450975  7391006.806918 
-343619.380851  7391029.043109 
-343654.773673  7391049.489607 
-343671.595984  7391056.728367 
-343684.781707  7391066.896625 
-343710.848042  7391075.585137 
-343741.655959  7391073.215543 
-343768.060390  7391064.677005 
-343794.374112  7391057.928161 
-343826.427210  7391048.609757 
-343928.837149  7391016.355282 
-343968.328347  7391005.297176 
-344004.661240  7390992.659341 
-344028.377399  7390987.510223 
-344047.360222  7390980.391443 
-344080.576039  7390971.682934 
-344080.584285  7390971.682934 
-344090.867335  7390965.364017 
-344208.738956  7390876.759194 
-344291.011599  7390883.088110 
-344333.727074  7390886.257567 
-344357.731851  7390887.677324 
-344410.466496  7390894.166212 
-344457.140161  7390897.325671 
-344506.972133  7390902.864722 
-344552.070769  7390909.193638 
-344596.369520  7390914.732689 
-344613.043398  7390915.402575 
-344646.201491  7390918.682013 
-344697.616740  7390926.600656 
-344761.706444  7390934.509302 
-344786.222488  7390936.878896 
-344807.910074  7390937.458796 
-344817.739581  7390934.599286 
-344827.882445  7390928.310364 
-344840.812535  7390925.810792 
-344929.410037  7390874.389600 
-344983.991837  7390852.233395 
-345006.701957  7390837.985835 
-345043.323467  7390825.338002 
-345056.146356  7390819.509000 
-345070.107224  7390813.909959 
-345089.213741  7390804.771525 
-345106.580302  7390793.013539 
-345130.156276  7390774.256752 
-345141.395888  7390765.658224 
-345149.328762  7390756.519790 
-345188.003584  7390719.026212 
-345229.531601  7390684.702091 
-345238.899319  7390678.043232 
-345250.757399  7390674.673809 
-345284.599929  7390662.295929 
-345303.607491  7390662.315926 
-345319.613425  7390663.535717 
-345391.949360  7390687.321643 
-345467.377632  7390713.707123 
-345506.308087  7390720.585945 
-345538.542602  7390722.505616 
-345566.381877  7390720.206010 
-345600.447056  7390712.697296 
-345633.860782  7390701.719177 
-345677.722483  7390675.953590 
-345689.225975  7390667.705003 
-345772.290256  7390589.388418 
-345820.126640  7390549.035330 
-345848.238040  7390525.309394 
-345864.903673  7390511.921687 
-345922.990121  7390469.149014 
-345960.568194  7390446.992809 
-345991.499805  7390433.065195 
-346028.929446  7390421.347202 
-346068.940157  7390415.348229 
-346121.518124  7390407.269613 
-346124.049717  7390406.149805 
-346162.262750  7390396.271497 
-346216.077651  7390380.554189 
-346251.132377  7390365.706732 
-346259.733196  7390332.622399 
-346258.619955  7390312.675816 
-346260.425879  7390295.528753 
-346260.211477  7390267.953477 
-346257.721116  7390242.447846 
-346257.539699  7390211.333175 
-346257.366528  7390178.988716 
-346260.549573  7390148.014021 
-346266.519844  7390104.881409 
-346272.160266  7390073.496785 
-346274.139361  7390050.030805 
-346272.152019  7390025.764961 
-346266.412643  7390008.197970 
-346261.753522  7389985.341885 
-346290.829732  7389970.594412 
-346353.327914  7389942.909154 
-346446.666998  7389901.756203 
-346482.265976  7389883.559320 
-346533.689470  7389855.884060 
-346555.838846  7389846.395686 
-346596.971044  7389825.029346 
-346613.529476  7389818.170520 
-346642.853072  7389803.673004 
-346682.088637  7389785.596100 
-346689.526737  7389776.777611 
-346727.500629  7389688.172788 
-346744.900176  7389680.264143 
-346789.207173  7389664.446852 
-346824.006267  7389647.039834 
-346862.763551  7389631.212545 
-346901.537327  7389614.605389 
-346914.986929  7389609.066338 
-346937.136305  7389666.816446 
-346942.661279  7389666.016583 
-346945.036194  7389651.779022 
-346998.826356  7389631.212545 
-347092.247903  7389602.337491 
-347103.372068  7389624.803642 
-347111.766731  7389630.872603 
-347120.920047  7389635.421824 
-347132.506001  7389637.541461 
-347155.463507  7389628.053086 
-347179.979551  7389628.842951 
-347198.962374  7389644.390287 
-347263.843717  7389716.647910 
-347274.910158  7389735.634658 
-347278.076711  7389752.251812 
-347277.293319  7389756.211134 
-347325.542015  7389768.079101 
-347351.806259  7389759.660543 
-347365.882575  7389756.201135 
-347384.873644  7389768.069102 
-347414.931155  7389775.977748 
-347456.863238  7389777.567475 
-347455.032574  7389732.195247 
-347452.072178  7389660.187581 
-347444.642324  7389611.815867 
-347434.227335  7389576.031997 
-347427.663335  7389551.276237 
-347422.270300  7389537.198648 
-347408.606296  7389490.406663 
-347349.266420  7389358.289294 
-347304.398679  7389191.807811 
-347311.721332  7389112.731356 
-347320.503568  7389014.618162 
-347283.568701  7388977.594503 
-347309.140262  7388908.016422 
-347324.527728  7388857.994990 
-347337.993823  7388809.903227 
-347336.072451  7388756.032455 
-347328.378718  7388709.860364 
-347314.912623  7388659.848930 
-347282.208073  7388498.246611 
-347270.663350  7388452.074520 
-347243.731160  7388357.810667 
-347211.026610  7388311.638576 
-347161.013221  7388255.848132 
-347116.763947  7388211.605710 
-347070.593302  7388194.288677 
-347005.175954  7388171.202631 
-346951.484746  7388056.922206 
-347316.833995  7388213.535380 
-347382.243097  7388246.239778 
-347477.115980  7388277.604405 
-347543.613584  7388296.081241 
-347815.467070  7388387.875517 
-347900.848542  7388413.761083 
-348155.195280  7388475.740467 
-348188.287404  7388482.649283 
-348226.178833  7388490.307971 
-348332.382038  7388519.662943 
-348377.777538  7388513.813945 
-348449.536237  7388462.552725 
-348518.004690  7388356.880826 
-348540.327236  7388321.976805 
-348566.542003  7388145.996949 
-348543.642221  7388151.625984 
-348523.826529  7388153.885597 
-348486.248456  7388152.355859 
-348451.103020  7388143.267416 
-348414.456772  7388120.881251 
-348437.397785  7388051.263176 
-348474.967612  7387896.399702 
-348505.833253  7387775.370434 
-348543.180432  7387642.613174 
-348546.173814  7387621.106858 
-348569.057104  7387545.669779 
-348579.216460  7387531.412221 
-348599.180584  7387515.814893 
-348644.246235  7387422.550868 
-348664.367037  7387377.438596 
-348666.403856  7387355.312386 
-348664.647409  7387325.667464 
-348657.588636  7387298.502117 
-348654.554023  7387279.775325 
-348655.287938  7387242.481713 
-348665.612218  7387218.465826 
-348677.346605  7387184.311677 
-348680.290509  7387132.590536 
-348680.331740  7387092.227450 
-348681.082147  7387054.943836 
-348683.440569  7387031.767806 
-348686.590629  7387007.461969 
-348691.802247  7386993.864299 
-348696.881925  7386968.078715 
-348700.708176  7386947.602223 
-348698.852774  7386921.416708 
-348686.186564  7386870.785381 
-348679.869951  7386843.889988 
-348670.378540  7386813.835136 
-348667.211987  7386750.545977 
-348643.759707  7386622.447919 
-348624.950055  7386618.428607 
-Region 1
-693
-358421.125722  7403268.426613 
-358437.626429  7403275.425415 
-358452.123303  7403278.924815 
-358470.116578  7403276.425243 
-358483.615658  7403268.426613 
-358494.616129  7403256.928583 
-358510.605571  7403229.433293 
-358530.107906  7403202.437917 
-358547.103387  7403189.440143 
-358575.594114  7403176.442369 
-358600.093666  7403166.943996 
-358619.587755  7403161.944853 
-358656.580345  7403157.945538 
-358684.073278  7403158.945366 
-358709.570624  7403166.943996 
-358727.572145  7403180.441684 
-358742.563792  7403199.438430 
-358756.062872  7403226.433806 
-358757.563686  7403244.930638 
-358754.067284  7403254.928925 
-358742.069019  7403264.427298 
-358706.074222  7403277.924986 
-358681.079897  7403286.923445 
-358669.081631  7403289.922931 
-358658.584180  7403294.422161 
-358651.080110  7403301.920876 
-358646.082894  7403309.919506 
-358645.085100  7403320.417708 
-358649.579296  7403333.915396 
-358659.078953  7403350.412570 
-358674.581867  7403366.409830 
-358692.575142  7403381.907175 
-358705.076428  7403391.905463 
-358733.567155  7403409.402465 
-358744.567626  7403418.900838 
-358769.058932  7403453.894844 
-358783.555805  7403474.391333 
-358796.057091  7403485.889364 
-358815.056406  7403496.387566 
-358827.046425  7403499.886966 
-358844.050153  7403498.387223 
-358861.540408  7403494.387908 
-358876.540302  7403487.889021 
-358886.542980  7403478.890563 
-358893.041009  7403464.892960 
-358901.534627  7403449.395615 
-358912.032078  7403440.397156 
-358918.084812  7403406.143024 
-358924.310716  7403371.828901 
-358926.949510  7403346.343267 
-358931.872509  7403320.617673 
-358934.494811  7403297.401650 
-358941.256720  7403256.018739 
-358948.975192  7403230.303144 
-358955.176357  7403201.548069 
-358964.403889  7403178.352042 
-358974.653954  7403154.406144 
-358990.989737  7403129.460417 
-359007.317274  7403109.323866 
-359018.029127  7403094.466411 
-359030.802538  7403074.559821 
-359043.303824  7403056.422928 
-359056.835889  7403036.276379 
-359071.662611  7403010.320825 
-359077.055646  7402993.933632 
-359085.005013  7402972.757259 
-359087.602575  7402956.859982 
-359093.020349  7402935.673611 
-359102.750901  7402911.727713 
-359118.336277  7402885.772159 
-359131.084949  7402870.674745 
-359147.890767  7402857.347028 
-359191.645267  7402831.231501 
-359197.755724  7402826.962232 
-359218.626934  7402810.615032 
-359230.097441  7402798.787058 
-359241.856566  7402777.880639 
-359246.235314  7402761.483448 
-359246.334269  7402735.737858 
-359246.424977  7402713.021749 
-359246.540425  7402683.486808 
-359245.864234  7402660.260787 
-359245.699309  7402638.294549 
-359245.105581  7402596.391727 
-359245.740540  7402563.077433 
-359247.092922  7402542.380978 
-359250.960404  7402525.233916 
-359253.566213  7402508.076854 
-359242.161676  7402503.897570 
-359176.727836  7402484.800841 
-359131.703417  7402472.173004 
-359087.957163  7402451.566534 
-359057.602788  7402437.518940 
-359009.898344  7402414.352908 
-358962.523749  7402388.397354 
-358917.656008  7402361.651936 
-358872.491403  7402335.306448 
-358828.778134  7402312.430367 
-358780.216082  7402284.505150 
-358734.268084  7402258.919533 
-358692.121600  7402234.173771 
-358646.899271  7402210.497827 
-358591.929897  7402179.033217 
-358564.799798  7402164.825650 
-358523.576891  7402143.569291 
-358480.811939  7402119.133477 
-358439.778696  7402095.147585 
-358393.641035  7402072.261506 
-358351.981078  7402049.375426 
-358283.496132  7402010.452093 
-358248.276481  7401982.366904 
-358186.165872  7401945.723180 
-358127.353755  7401904.070315 
-358069.176598  7401832.972494 
-357707.249535  7401412.134579 
-357576.678719  7401300.513699 
-357516.844069  7401226.606359 
-357445.456450  7401181.944009 
-357401.693704  7401161.747468 
-357338.387392  7401144.500423 
-357046.808922  7401127.353360 
-356501.015654  7401093.349184 
-356471.057098  7401095.528811 
-356449.493205  7401093.189212 
-356422.594001  7401092.089400 
-356392.643691  7401093.759114 
-356374.576200  7401092.499330 
-356142.675702  7401107.746718 
-355914.807610  7401134.702101 
-355875.423613  7401138.321481 
-355763.497524  7401149.569554 
-355718.778215  7401154.298744 
-355552.657899  7401170.745927 
-355478.656225  7401173.895388 
-355353.692846  7401188.592870 
-355169.933842  7401203.300351 
-355061.875236  7401219.677546 
-354955.639046  7401235.564824 
-354839.787752  7401250.642242 
-354723.985935  7401267.009438 
-354654.033160  7401277.627619 
-354578.646120  7401280.797076 
-354543.731579  7401283.976532 
-354495.317959  7401288.735716 
-354447.687731  7401293.524896 
-354415.980974  7401296.844328 
-354406.440085  7401297.464221 
-354399.298849  7401303.813134 
-354264.209099  7401307.322533 
-354118.786821  7401318.460625 
-354002.506723  7401333.967969 
-353786.529696  7401356.164167 
-353556.097027  7401378.870277 
-353400.210283  7401391.408130 
-353398.668238  7401399.726705 
-353396.821082  7401405.275756 
-353394.355459  7401408.355227 
-353391.889836  7401410.824804 
-353386.035012  7401411.434699 
-353372.478209  7401411.434699 
-353353.990160  7401410.204910 
-353344.127668  7401412.364540 
-353339.814890  7401416.063906 
-353336.120578  7401423.142694 
-353334.578533  7401429.921533 
-353333.654955  7401441.019632 
-353333.341599  7401450.258049 
-353335.502111  7401459.506465 
-353343.204090  7401486.931767 
-353350.906070  7401509.727863 
-353359.226517  7401530.064379 
-353372.783320  7401552.560526 
-353381.103767  7401567.957888 
-353388.500635  7401581.825513 
-353395.279037  7401596.922927 
-353408.835840  7401619.419073 
-353423.316221  7401646.834377 
-353433.277668  7401664.651326 
-353443.651426  7401681.038519 
-353447.964205  7401690.586883 
-353456.903119  7401729.410233 
-353459.368742  7401752.216326 
-353460.292319  7401775.322369 
-353459.781053  7401781.101379 
-353457.826696  7401796.888674 
-353450.124717  7401854.198858 
-353437.796602  7401932.765400 
-353434.712512  7401953.721810 
-353427.818663  7401980.027304 
-353420.850598  7402007.642574 
-353411.301463  7402029.828774 
-353404.044780  7402037.947383 
-353404.646755  7402038.407305 
-353372.593656  7402079.750223 
-353339.179930  7402122.042978 
-353300.966897  7402157.266945 
-353263.817628  7402182.392641 
-353236.596821  7402205.138745 
-353224.887173  7402214.697108 
-353213.795993  7402221.785893 
-353199.315612  7402229.484575 
-353167.757287  7402239.842800 
-353154.002575  7402244.761958 
-353134.343561  7402256.060023 
-353108.796738  7402265.888339 
-353075.877785  7402277.676320 
-353027.719798  7402292.913710 
-352992.838243  7402303.231942 
-352946.824276  7402314.340040 
-352962.228235  7402319.269195 
-352981.334751  7402330.977190 
-352998.585865  7402351.313706 
-353007.829890  7402367.330963 
-353012.142669  7402383.968113 
-353014.608292  7402398.755580 
-353014.608292  7402422.791463 
-353013.379603  7402450.526712 
-353013.379603  7402473.942701 
-353017.692382  7402501.667952 
-353024.470783  7402520.154786 
-353031.249185  7402540.491302 
-353036.180431  7402559.598029 
-353034.333275  7402576.235179 
-353020.776472  7402597.801485 
-352996.738710  7402623.687051 
-352982.563439  7402639.704308 
-352974.556349  7402663.740191 
-352976.403505  7402684.076707 
-352988.113153  7402700.093964 
-353013.379603  7402711.192063 
-353030.020497  7402714.881431 
-353056.515636  7402714.881431 
-353079.934931  7402709.952275 
-353108.895693  7402701.323753 
-353139.093389  7402692.705229 
-353178.526864  7402695.164808 
-353211.091229  7402710.022263 
-353258.086498  7402749.015584 
-353274.578959  7402767.512415 
-353284.078617  7402771.011816 
-353301.577118  7402772.011645 
-353314.078404  7402769.012159 
-353330.570865  7402761.013529 
-353348.069367  7402756.514299 
-353363.069260  7402752.514984 
-353381.565555  7402756.014385 
-353401.059645  7402762.013357 
-353416.554312  7402771.511730 
-353436.551421  7402789.008733 
-353451.551315  7402805.005993 
-353470.542384  7402829.501797 
-353474.541806  7402842.499571 
-353475.547846  7402861.996231 
-353473.544012  7402874.994005 
-353468.546796  7402888.991607 
-353457.051551  7402900.489638 
-353436.551421  7402909.488096 
-353395.559409  7402923.985613 
-353368.066476  7402935.983558 
-353347.071573  7402949.481246 
-353327.074463  7402973.977050 
-353316.073992  7402997.473025 
-353314.078404  7403017.469600 
-353319.075620  7403037.966089 
-353334.067267  7403075.959581 
-353346.065532  7403087.957526 
-353359.564612  7403093.456584 
-353381.062535  7403095.456242 
-353408.555468  7403093.456584 
-353470.542384  7403079.458982 
-353525.454034  7403064.011628 
-353591.522834  7403037.966089 
-353616.022385  7403022.968658 
-353626.519837  7403014.970028 
-353631.517053  7403004.471826 
-353634.015660  7402989.974310 
-353640.513690  7402949.981160 
-353645.510906  7402936.983387 
-353656.008358  7402923.985613 
-353670.010457  7402917.486726 
-353732.500393  7402898.489980 
-353793.984289  7402885.992121 
-353828.478272  7402869.494947 
-353849.976195  7402856.997087 
-353867.474696  7402852.497858 
-353885.467972  7402855.997259 
-353897.466237  7402861.496317 
-353905.465081  7402874.494090 
-353906.965895  7402888.991607 
-353905.465081  7402906.988524 
-353898.967051  7402917.986641 
-353887.471806  7402926.985099 
-353863.970048  7402936.483472 
-353845.473753  7402944.982016 
-353827.975252  7402955.980133 
-353817.980820  7402972.477307 
-353814.979192  7402992.973796 
-353817.477800  7403012.970371 
-353822.483262  7403024.468401 
-353830.482106  7403031.467202 
-353840.476537  7403035.466517 
-353851.971783  7403036.966260 
-353877.469128  7403037.966089 
-353905.465081  7403034.466689 
-353934.458828  7403034.466689 
-353962.454781  7403039.465832 
-353986.946086  7403048.464291 
-353998.449578  7403062.461893 
-354003.949814  7403079.458982 
-354005.945401  7403096.456070 
-354004.444587  7403114.452988 
-353996.948764  7403139.948620 
-353975.953860  7403194.939201 
-353964.953389  7403237.431922 
-353964.953389  7403265.427127 
-353968.449791  7403291.422674 
-353980.951076  7403323.917108 
-353992.949342  7403342.913854 
-354015.948079  7403366.909744 
-354028.944139  7403377.907860 
-354060.436493  7403395.904777 
-354103.143722  7403415.361445 
-354117.426193  7403421.400410 
-354136.425509  7403430.398869 
-354152.917970  7403437.397670 
-354230.902573  7403486.889193 
-354257.900733  7403500.886795 
-354282.895058  7403508.885425 
-354303.889961  7403511.884911 
-354328.389512  7403509.885254 
-354351.883023  7403502.886452 
-354391.877242  7403487.389107 
-354452.866364  7403455.894502 
-354509.353044  7403437.897584 
-354567.843558  7403425.399725 
-354581.837411  7403422.900153 
-354620.833836  7403421.900325 
-354635.330709  7403419.900667 
-354669.321672  7403414.901524 
-354689.821801  7403411.402123 
-354724.315784  7403410.402294 
-354767.303384  7403405.903065 
-354801.797367  7403399.904092 
-354838.789958  7403397.404521 
-354867.288931  7403396.404692 
-354879.781971  7403392.405377 
-354891.285462  7403383.406918 
-354899.779080  7403369.409316 
-354908.280944  7403352.912142 
-354926.274219  7403336.414968 
-354940.276319  7403326.916595 
-354960.265182  7403322.417365 
-354981.763105  7403312.918992 
-354997.266019  7403302.920705 
-355015.259294  7403297.421647 
-355040.756639  7403287.923274 
-355057.562457  7403281.674344 
-355079.744817  7403273.425757 
-355106.742977  7403260.927898 
-355121.239850  7403256.428668 
-355139.233125  7403254.429011 
-355158.232441  7403255.928754 
-355166.231284  7403261.427812 
-355168.729892  7403272.925843 
-355171.228500  7403287.423359 
-355169.232912  7403300.921047 
-355164.227450  7403314.918650 
-355156.228607  7403342.413940 
-355153.235225  7403362.910429 
-355155.230813  7403387.406233 
-355163.229657  7403408.402637 
-355177.726530  7403428.399211 
-355207.223297  7403444.896386 
-355243.218094  7403461.393560 
-355274.207429  7403475.391162 
-355302.706402  7403475.391162 
-355321.705717  7403472.391676 
-355347.697836  7403456.394416 
-355366.194131  7403439.397328 
-355381.004362  7403420.690532 
-355394.684858  7403403.403493 
-355412.686380  7403374.408460 
-355417.180576  7403358.911114 
-355424.181625  7403332.415653 
-355431.182675  7403312.419078 
-355439.181519  7403296.921732 
-355442.677921  7403286.923445 
-355444.178735  7403280.924473 
-355451.179784  7403275.925329 
-355459.673402  7403272.925843 
-355476.668883  7403266.926870 
-355503.164022  7403266.926870 
-355531.662996  7403269.926356 
-355552.154879  7403280.924473 
-355571.154194  7403292.922417 
-355591.151303  7403306.920020 
-355601.648755  7403321.417536 
-355604.147363  7403339.414454 
-355602.151775  7403360.910772 
-355594.647705  7403384.406747 
-355584.150254  7403397.404521 
-355560.153722  7403412.401952 
-355524.661946  7403420.900496 
-355493.672611  7403427.399383 
-355487.174581  7403436.897756 
-355486.671561  7403455.394587 
-355490.167963  7403466.392704 
-355501.671455  7403476.890905 
-355513.166700  7403484.389621 
-355534.161603  7403498.387223 
-355550.159291  7403511.884911 
-355567.154772  7403532.381400 
-355586.648862  7403551.878061 
-355625.142266  7403585.372323 
-355656.642867  7403608.368384 
-355690.130810  7403632.864188 
-355726.125607  7403654.860421 
-355738.379505  7403661.749241 
-355758.120982  7403672.857338 
-355781.614493  7403688.854598 
-355796.614386  7403699.352800 
-355809.107426  7403705.351772 
-355829.104535  7403705.851686 
-355855.104900  7403700.852543 
-355871.102588  7403697.853056 
-355896.096913  7403701.352457 
-355925.585434  7403705.851686 
-355954.084407  7403705.351772 
-355973.578496  7403701.352457 
-355989.081410  7403691.354170 
-355997.575027  7403681.355882 
-356001.071429  7403667.858194 
-355998.572821  7403651.860935 
-355989.576183  7403633.864017 
-355986.079782  7403622.865901 
-355983.078154  7403610.867956 
-355985.081988  7403596.370440 
-355990.573977  7403588.871724 
-356006.571665  7403579.873265 
-356054.061707  7403562.376262 
-356131.551536  7403540.879945 
-356199.038688  7403527.382257 
-356229.030229  7403517.883884 
-356245.027916  7403506.885767 
-356252.028966  7403494.387908 
-356256.531408  7403477.390820 
-356259.524790  7403459.393902 
-356254.527574  7403438.397499 
-356246.528730  7403423.899982 
-356233.029651  7403406.402979 
-356198.040894  7403378.407775 
-356156.545862  7403356.911457 
-356074.058816  7403317.418222 
-356046.071110  7403302.420790 
-356026.074000  7403283.424044 
-356016.574343  7403268.426613 
-356009.573293  7403241.931152 
-356010.571087  7403222.434491 
-356015.073529  7403203.937660 
-356028.069588  7403189.940057 
-356045.065069  7403180.941599 
-356067.560787  7403180.441684 
-356124.550487  7403189.440143 
-356213.032542  7403206.437232 
-356263.524212  7403212.936118 
-356287.025969  7403210.936461 
-356308.020872  7403202.437917 
-356326.014148  7403187.940400 
-356339.513227  7403169.443568 
-356341.508815  7403150.946737 
-356339.513227  7403137.948963 
-356331.011363  7403131.949991 
-356321.016932  7403127.450761 
-356308.020872  7403127.450761 
-356273.023869  7403125.951018 
-356254.527574  7403122.951532 
-356230.531043  7403116.452645 
-356208.538346  7403107.454186 
-356196.540080  7403090.457098 
-356190.536824  7403063.461722 
-356191.039844  7403041.965404 
-356195.039266  7403021.968829 
-356210.533934  7402995.473368 
-356236.534299  7402969.477821 
-356254.024554  7402954.980304 
-356270.022242  7402941.982530 
-356285.022135  7402927.485014 
-356303.015410  7402916.986812 
-356321.932263  7402910.227970 
-356333.015197  7402905.988696 
-356354.513121  7402901.989381 
-356377.503612  7402905.488781 
-356390.499671  7402919.986298 
-356398.003741  7402941.482616 
-356419.501664  7403007.471313 
-356426.494468  7403026.967973 
-356437.997960  7403043.965062 
-356455.991235  7403058.462578 
-356469.985088  7403062.961808 
-356486.485796  7403061.462064 
-356498.978835  7403056.962835 
-356509.484533  7403048.964205 
-356512.477915  7403040.965575 
-356512.477915  7403030.967288 
-356510.977101  7403017.469600 
-356502.978257  7402987.474738 
-356502.978257  7402968.477992 
-356503.984297  7402952.480732 
-356507.983719  7402939.482958 
-356517.978151  7402925.985270 
-356533.472818  7402906.988524 
-356579.965067  7402868.995032 
-356593.464146  7402856.997087 
-356597.463568  7402842.499571 
-356597.463568  7402829.001883 
-356591.963332  7402817.003938 
-356574.464831  7402809.505222 
-356547.969692  7402806.005822 
-356515.479543  7402801.506593 
-356492.480806  7402790.508476 
-356475.485324  7402774.511217 
-356470.488109  7402759.513785 
-356470.991129  7402740.517039 
-356475.988344  7402721.020379 
-356489.487424  7402703.523376 
-356533.472818  7402666.529713 
-356563.967379  7402638.534508 
-356593.464146  7402613.538790 
-356617.963697  7402592.542386 
-356634.456159  7402577.544955 
-356639.956395  7402564.047267 
-356640.459415  7402547.550093 
-356636.954767  7402529.053261 
-356623.958707  7402510.556430 
-356605.965432  7402498.558485 
-356586.463096  7402494.059255 
-356560.817319  7402483.131127 
-356541.405692  7402477.952014 
-356519.808814  7402476.712227 
-356501.304272  7402476.092333 
-356477.860239  7402476.712227 
-356455.026426  7402478.561910 
-356439.605975  7402470.543284 
-356425.653353  7402453.926130 
-356418.495624  7402423.071415 
-356422.495046  7402391.576810 
-356416.994810  7402357.582633 
-356404.996545  7402326.587942 
-356391.002691  7402300.092480 
-356379.507446  7402265.598389 
-356376.002798  7402233.103955 
-356379.004426  7402206.608493 
-356383.003848  7402167.115258 
-356384.001642  7402134.120910 
-356386.005476  7402104.126047 
-356388.001063  7402083.129644 
-356395.999907  7402060.633497 
-356409.498987  7402029.638806 
-356420.499458  7402014.141461 
-356435.491106  7402000.143859 
-356451.488793  7401990.145571 
-356474.990550  7401981.147113 
-356494.987660  7401977.147798 
-356527.980829  7401977.647712 
-356553.972948  7401980.647198 
-356572.972263  7401988.145914 
-356587.963910  7401996.644458 
-356607.466246  7402014.141461 
-356637.457787  7402053.634696 
-356649.950826  7402069.132042 
-356660.951298  7402077.130672 
-356672.949563  7402083.629558 
-356684.444809  7402087.628873 
-356693.944467  7402087.628873 
-356704.441918  7402086.129130 
-356717.940998  7402078.630415 
-356727.440655  7402067.132384 
-356739.941941  7402046.635895 
-356756.434402  7402029.638806 
-356768.432668  7402021.640177 
-356783.432562  7402012.141804 
-356798.927229  7401997.144372 
-356829.421790  7401972.148654 
-356844.421683  7401958.151052 
-356851.917507  7401943.153621 
-356860.914145  7401917.158073 
-356867.412174  7401898.161327 
-356886.411490  7401882.164068 
-356906.408599  7401876.665010 
-356926.405709  7401877.164924 
-356939.047180  7401877.574854 
-356946.402818  7401879.664496 
-356955.894229  7401885.663468 
-356963.398299  7401894.162012 
-356968.395515  7401909.659358 
-356969.393309  7401933.655248 
-356965.393887  7401955.651480 
-356956.900269  7401983.146770 
-356952.397828  7402001.643602 
-356954.896435  7402019.140605 
-356961.394465  7402037.637436 
-356970.399349  7402064.632812 
-356994.387634  7402120.623222 
-357021.888813  7402182.112689 
-357032.881039  7402215.107037 
-357048.878726  7402256.599930 
-357061.380012  7402289.094364 
-357069.873629  7402298.592737 
-357079.373287  7402308.591024 
-357104.870632  7402324.588284 
-357122.369134  7402330.587257 
-357139.364615  7402331.587085 
-357159.361724  7402329.587428 
-357172.357784  7402322.588627 
-357192.857913  7402304.591710 
-357215.848404  7402272.597190 
-357235.845514  7402249.101215 
-357247.843779  7402242.602328 
-357258.844251  7402236.103441 
-357275.336712  7402218.606438 
-357293.338234  7402199.609692 
-357312.329303  7402185.612090 
-357332.326412  7402182.112689 
-357366.325621  7402185.612090 
-357394.816348  7402197.610035 
-357424.807889  7402224.105496 
-357442.306390  7402244.601985 
-357458.807098  7402265.598389 
-357547.289153  7402361.082033 
-357579.779301  7402397.075868 
-357628.770158  7402435.069360 
-357670.265190  7402464.564308 
-357710.754183  7402499.558314 
-357739.253156  7402530.553004 
-357764.247481  7402548.549922 
-357793.241228  7402564.547182 
-357811.737523  7402573.045726 
-357842.735104  7402588.043157 
-357871.728851  7402594.542044 
-357897.720970  7402594.042129 
-357922.220521  7402588.543071 
-357948.715661  7402577.045041 
-357978.204181  7402553.049151 
-358014.701998  7402515.555573 
-358036.199921  7402490.059941 
-358060.691226  7402469.563451 
-358109.187309  7402434.069531 
-358137.175016  7402419.572014 
-358163.175381  7402409.573727 
-358183.172490  7402403.574755 
-358206.666001  7402403.074840 
-358228.163925  7402409.073813 
-358250.659642  7402424.571158 
-358279.653389  7402441.068332 
-358296.648870  7402452.566363 
-358313.644352  7402462.064736 
-358323.647029  7402471.563109 
-358331.645873  7402489.060112 
-358339.644717  7402512.556087 
-358366.634630  7402571.046068 
-358390.128141  7402636.534851 
-358402.629426  7402657.531254 
-358413.629898  7402670.529028 
-358430.122359  7402681.027230 
-358443.118419  7402696.024661 
-358448.618655  7402716.021235 
-358452.618077  7402742.016783 
-358452.618077  7402767.012501 
-358447.620861  7402790.008562 
-358440.125037  7402813.504537 
-358429.627586  7402832.501283 
-358414.627692  7402854.497516 
-358400.130819  7402876.993662 
-358388.635573  7402903.489124 
-358381.634523  7402933.983900 
-358371.631845  7402993.473710 
-358368.135444  7403023.968487 
-358371.137072  7403048.964205 
-358375.136494  7403067.960951 
-358382.632317  7403080.458811 
-358403.132447  7403097.455899 
-358417.629320  7403113.453159 
-358428.621545  7403121.451789 
-358437.123409  7403129.450419 
-358438.624223  7403145.447679 
-358436.620389  7403163.944510 
-358432.126194  7403181.941427 
-358427.623752  7403192.439629 
-358412.623858  7403206.937146 
-358404.130240  7403224.434149 
-358404.130240  7403241.431237 
-358410.628270  7403254.429011 
-358421.125722  7403268.426613 
-Region 1
-420
-349823.152107  7402538.021725 
-349788.641631  7402520.774679 
-349760.299337  7402503.517635 
-349730.101640  7402490.579851 
-349707.300812  7402486.260591 
-349680.805673  7402488.730168 
-349661.080690  7402493.039430 
-349648.142354  7402500.438163 
-349631.501460  7402512.766051 
-349612.403190  7402536.791936 
-349596.999231  7402563.287397 
-349585.908051  7402596.571696 
-349579.739870  7402631.075786 
-349577.274247  7402664.350086 
-349574.808625  7402698.244280 
-349574.808625  7402713.651641 
-349577.892715  7402730.288791 
-349580.976805  7402742.616680 
-349580.976805  7402750.005414 
-349577.892715  7402756.174358 
-349571.732780  7402762.333303 
-349565.572846  7402763.563092 
-349559.404666  7402766.652563 
-349544.000707  7402775.890980 
-349521.199879  7402795.607603 
-349499.635986  7402814.094436 
-349483.613560  7402824.572642 
-349469.438289  7402833.201164 
-349455.881486  7402838.750213 
-349447.866150  7402838.750213 
-349426.302257  7402833.201164 
-349412.745454  7402824.572642 
-349390.563093  7402809.165281 
-349378.853446  7402791.298341 
-349372.685265  7402777.120770 
-349369.609421  7402760.483619 
-349361.594085  7402716.731114 
-349351.121372  7402680.987236 
-349341.258880  7402658.811035 
-349322.160610  7402635.395046 
-349295.047004  7402619.367791 
-349271.009241  7402612.588952 
-349251.910971  7402612.588952 
-349229.110143  7402622.447264 
-349210.622094  7402636.624835 
-349197.065291  7402652.032196 
-349188.439734  7402671.128925 
-349185.355644  7402689.615758 
-349186.584332  7402702.563541 
-349189.668422  7402720.430480 
-349203.225225  7402760.483619 
-349209.385160  7402780.820136 
-349218.010717  7402799.306969 
-349224.178897  7402809.165281 
-349232.804455  7402811.634858 
-349241.430012  7402814.714330 
-349259.918061  7402829.501797 
-349274.711799  7402836.900530 
-349292.581381  7402841.829686 
-349335.717413  7402849.838314 
-349365.906864  7402854.767469 
-349389.944626  7402867.705253 
-349406.577273  7402878.803352 
-349414.592609  7402891.741136 
-349417.676700  7402904.678920 
-349413.363921  7402916.386915 
-349403.501429  7402920.086281 
-349388.707691  7402920.086281 
-349378.853446  7402923.165753 
-349365.906864  7402933.643959 
-349351.121372  7402941.652587 
-349330.786167  7402955.210264 
-349307.366872  7402966.308363 
-349284.566044  7402971.237519 
-349258.689373  7402971.237519 
-349241.430012  7402966.308363 
-349227.873209  7402953.360581 
-349193.362733  7402918.236598 
-349167.486062  7402900.369658 
-349116.953160  7402879.413248 
-349062.107480  7402859.086730 
-349020.208382  7402852.917786 
-348978.919506  7402855.997259 
-348926.539448  7402863.395991 
-348875.388080  7402873.254303 
-348824.244957  7402873.874197 
-348752.148163  7402864.015885 
-348703.462417  7402843.679369 
-348639.372712  7402809.785174 
-348596.236680  7402766.032669 
-348562.344672  7402720.430480 
-348511.811771  7402668.669346 
-348491.476566  7402645.863253 
-348479.156697  7402627.376419 
-348467.447050  7402612.588952 
-348458.821492  7402587.323280 
-348448.959001  7402562.057608 
-348431.707886  7402541.111196 
-348403.357345  7402525.083941 
-348366.381247  7402518.305102 
-348322.016526  7402513.995840 
-348291.818829  7402512.766051 
-348262.239600  7402507.826897 
-348245.606953  7402500.438163 
-348223.416346  7402485.030802 
-348201.852453  7402459.765130 
-348187.677182  7402432.649774 
-348175.967535  7402390.746952 
-348169.189133  7402374.729696 
-348161.182043  7402357.472652 
-348153.166707  7402351.313706 
-348143.922683  7402348.844129 
-348132.831502  7402348.844129 
-348122.358790  7402352.543496 
-348110.649142  7402366.101174 
-348102.633806  7402388.287373 
-348081.069913  7402429.570302 
-348065.047487  7402453.606185 
-348047.796372  7402470.853230 
-348035.468257  7402483.181119 
-348021.292987  7402489.340064 
-347993.560913  7402493.659324 
-347967.535809  7402493.659324 
-347957.203282  7402493.659324 
-347926.395364  7402496.738796 
-347890.037734  7402512.146157 
-347860.458504  7402520.774679 
-347838.276144  7402529.403201 
-347788.980177  7402547.270141 
-347713.180825  7402580.544441 
-347652.785432  7402604.580324 
-347605.336620  7402625.526736 
-347569.597457  7402634.775152 
-347525.842957  7402644.013570 
-347501.194974  7402651.412302 
-347476.546990  7402664.969980 
-347437.723736  7402696.394597 
-347408.762974  7402716.731114 
-347385.962147  7402727.209319 
-347365.008474  7402732.138475 
-347342.826114  7402733.368264 
-347290.446057  7402734.608052 
-347231.906066  7402734.608052 
-347196.777123  7402738.297420 
-347150.565246  7402745.076259 
-347096.948255  7402753.704781 
-347061.827558  7402760.483619 
-347036.561108  7402772.191614 
-347018.073059  7402784.519502 
-347002.669100  7402800.536759 
-346993.425075  7402820.873275 
-346992.806608  7402835.050847 
-346995.272231  7402847.988631 
-347006.981878  7402862.166202 
-347047.652288  7402888.041770 
-347074.765894  7402900.369658 
-347100.032345  7402908.378286 
-347123.443394  7402918.856492 
-347135.771509  7402933.034063 
-347137.618664  7402947.821530 
-347134.542820  7402973.087202 
-347124.680328  7403002.662136 
-347105.573812  7403024.848336 
-347082.162763  7403037.786120 
-347058.743468  7403042.105380 
-347035.942640  7403047.034536 
-347016.225903  7403049.494114 
-346996.500919  7403058.122637 
-346989.021588  7403062.161945 
-346989.013342  7403062.161945 
-346958.312625  7403017.009679 
-346935.882878  7402984.025329 
-346861.947174  7402859.056735 
-346762.027597  7402689.865716 
-347215.157971  7402074.291158 
-347188.506154  7402012.081814 
-347156.741673  7401983.296744 
-347122.132243  7401962.220355 
-347087.267180  7401945.363242 
-347034.812907  7401930.305821 
-346994.736226  7401923.017070 
-346958.197178  7401920.647476 
-346934.217139  7401918.737803 
-346887.452765  7401916.918115 
-346817.640177  7401919.517669 
-346754.177186  7401918.497844 
-346715.048821  7401916.208236 
-346686.566340  7401913.638676 
-346667.971090  7401910.409229 
-346629.288022  7401900.130990 
-346597.078245  7401889.152870 
-346570.566614  7401878.234741 
-346544.450801  7401865.396940 
-346519.868788  7401850.309524 
-346501.339508  7401836.801838 
-346490.017433  7401825.613754 
-346476.872941  7401812.186054 
-346458.393138  7401792.169483 
-346440.366878  7401767.683677 
-346429.127266  7401748.117029 
-346417.912392  7401726.730692 
-346404.141187  7401695.696008 
-346388.506334  7401652.203458 
-346368.888551  7401589.584184 
-346354.911190  7401543.482081 
-346372.335475  7401526.514987 
-346384.119339  7401517.086602 
-346395.342459  7401511.677529 
-346412.115292  7401509.367924 
-346433.769894  7401501.559262 
-346452.315666  7401499.019697 
-346469.946108  7401488.401516 
-346487.535318  7401480.802817 
-346509.371336  7401479.303074 
-346535.577857  7401472.064314 
-346593.787999  7401461.686092 
-346615.879651  7401459.436477 
-346634.755273  7401450.597991 
-346661.324628  7401435.290613 
-346686.896190  7401417.963581 
-346705.268792  7401408.865139 
-346742.121196  7401381.849767 
-346746.912256  7401378.450349 
-346775.633878  7401358.573754 
-346793.206595  7401352.984711 
-346821.779784  7401345.316025 
-346843.211738  7401329.328763 
-346872.749736  7401313.901406 
-346911.507020  7401287.935853 
-346938.035144  7401268.709147 
-346982.902885  7401240.274018 
-346995.412417  7401229.005948 
-347011.476074  7401218.777700 
-347019.969692  7401202.700454 
-347028.488048  7401182.073987 
-347031.176319  7401161.407527 
-347032.850304  7401140.991024 
-347032.701872  7401127.653308 
-347033.559480  7401112.485906 
-347031.926726  7401093.309191 
-347031.836018  7401070.853038 
-347033.551234  7401043.877658 
-347035.043801  7401013.112928 
-347038.086660  7400978.328886 
-347043.438464  7400940.275405 
-347051.783650  7400917.669277 
-347064.787955  7400874.576658 
-347069.661478  7400855.069999 
-347077.792261  7400830.684177 
-347093.237451  7400790.041138 
-347110.307148  7400760.776151 
-347133.066745  7400731.511164 
-347145.262920  7400712.804368 
-347167.206140  7400684.359241 
-347225.746131  7400607.942330 
-347254.203873  7400570.548735 
-347272.271365  7400600.053681 
-347283.766610  7400583.896449 
-347317.988467  7400524.996538 
-347336.501255  7400493.521929 
-347352.111370  7400475.295051 
-347365.536233  7400460.267626 
-347379.686765  7400445.910085 
-347393.598156  7400434.202090 
-347407.171452  7400425.593565 
-347423.309325  7400415.795243 
-347426.286214  7400412.705772 
-347448.361374  7400394.018973 
-347459.279383  7400385.050510 
-347468.160574  7400375.392164 
-347481.123648  7400353.485916 
-347485.337472  7400334.759124 
-347485.881723  7400294.965940 
-347467.987403  7400231.886745 
-347468.276021  7400207.520919 
-347468.309006  7400173.246790 
-347470.939553  7400144.341741 
-347471.236418  7400109.617689 
-347475.829568  7400054.527125 
-347481.948271  7399989.488266 
-347490.788231  7399982.369485 
-347492.371507  7399914.221158 
-347475.252332  7399819.187437 
-347456.558127  7399727.183196 
-347424.521521  7399637.278596 
-347438.474143  7399605.913969 
-347464.853835  7399616.062230 
-347477.025272  7399624.180840 
-347495.282426  7399624.180840 
-347519.633545  7399595.775705 
-347539.919273  7399579.538486 
-347568.327537  7399579.538486 
-347606.870419  7399591.716401 
-347643.392975  7399589.686748 
-347708.315549  7399563.311266 
-347779.323841  7399543.024741 
-347828.553838  7399522.288293 
-347841.673591  7399504.181394 
-347855.840615  7399508.140716 
-347879.771176  7399510.090382 
-347913.457029  7399511.750098 
-347980.672055  7399518.628920 
-348028.689856  7399523.388105 
-348055.490105  7399524.997829 
-348115.431956  7399530.476890 
-348250.018686  7399540.155232 
-348291.983754  7399545.144378 
-348318.866466  7399545.764272 
-348364.179503  7399543.104727 
-348381.306924  7399541.674972 
-348399.168260  7399538.705481 
-348421.556776  7399533.376394 
-348456.248668  7399533.176428 
-348479.931843  7399535.835972 
-348588.806826  7399545.144378 
-348642.151692  7399548.753760 
-348666.618258  7399552.543111 
-348699.388779  7399551.993205 
-348724.877878  7399549.663604 
-348759.140966  7399547.184029 
-348878.900974  7399529.557048 
-348896.028395  7399528.517226 
-348909.750123  7399527.907330 
-348920.016680  7399526.967491 
-348948.251774  7399528.027310 
-348963.540285  7399530.436897 
-348982.622063  7399533.356397 
-349003.468534  7399539.705310 
-349027.935100  7399550.583446 
-349102.291362  7399586.977212 
-349116.582080  7399594.905854 
-349176.012664  7399625.210663 
-349267.133513  7399672.842504 
-349294.882079  7399686.480168 
-349383.322903  7399729.972718 
-349410.230353  7399743.290437 
-349439.619919  7399758.397849 
-349487.208916  7399784.633356 
-349507.700800  7399800.680607 
-349530.460396  7399816.297932 
-349549.030908  7399831.225375 
-349564.459605  7399841.653589 
-349579.937780  7399855.111283 
-349592.735930  7399867.089232 
-349606.696798  7399880.566923 
-349617.524099  7399889.145454 
-349636.490430  7399905.222700 
-349645.429344  7399915.360963 
-349691.492788  7399954.604241 
-349715.926370  7399978.580134 
-349729.458434  7399989.408279 
-349744.557282  7400002.486039 
-349762.121754  7400025.062172 
-349771.077160  7400035.970304 
-349778.919325  7400048.028238 
-349787.281003  7400068.084803 
-349794.413993  7400083.592147 
-349803.897158  7400102.478912 
-349823.803559  7400149.780809 
-349834.086609  7400171.327118 
-349842.728658  7400185.294726 
-349855.609271  7400202.221826 
-349863.797778  7400212.750023 
-349875.829028  7400225.117905 
-349891.010339  7400242.404943 
-349904.962961  7400255.502700 
-349940.091903  7400291.226581 
-350030.371637  7400374.432328 
-350103.548687  7400438.161412 
-350157.322357  7400470.995788 
-350123.463334  7400636.547430 
-350115.406767  7400688.638508 
-350112.009320  7400727.901782 
-350109.048923  7400737.730099 
-350098.889567  7400782.482433 
-350094.626266  7400798.379710 
-350091.393743  7400817.066509 
-350083.221729  7400836.253223 
-350068.617654  7400863.728516 
-350052.809630  7400883.455137 
-350039.236335  7400901.472051 
-350010.646653  7400931.306941 
-350000.256402  7400948.583981 
-349982.296112  7400961.371791 
-349972.573806  7400968.110637 
-349937.733482  7400991.646605 
-349899.751343  7401021.171548 
-349893.838796  7401030.799899 
-349890.226947  7401041.518063 
-349887.349012  7401050.326554 
-349886.367711  7401059.095052 
-349885.328686  7401064.834069 
-349893.278052  7401088.789965 
-349898.036127  7401120.524530 
-349915.501644  7401217.337946 
-349917.818835  7401240.533973 
-349936.133713  7401283.996528 
-349947.241385  7401339.547013 
-349951.999461  7401404.615867 
-349947.241385  7401461.756080 
-349940.702125  7401493.290678 
-349942.029768  7401545.431747 
-349969.390761  7401565.118375 
-350007.620286  7401574.906698 
-350024.203456  7401578.416097 
-350047.226932  7401579.985828 
-350109.106647  7401604.601611 
-350125.186797  7401641.805239 
-350139.263112  7401657.762506 
-350093.496532  7401769.383386 
-350040.069204  7401915.668329 
-350002.326206  7402014.921327 
-349887.720093  7402121.773025 
-349817.998213  7402177.233525 
-349811.656861  7402191.501081 
-349800.573927  7402204.168911 
-349786.299702  7402264.388596 
-349792.599822  7402332.077002 
-349800.557435  7402389.777118 
-349823.152107  7402538.021725 
-Region 1
-1191
-325541.730148  7409353.814242 
-325498.635346  7409351.804586 
-325482.918031  7409351.124702 
-325473.987363  7409355.563942 
-325453.784098  7409369.481558 
-325438.866667  7409386.978561 
-325420.040522  7409413.534012 
-325405.815774  7409437.109974 
-325390.749911  7409467.234814 
-325375.700540  7409495.849912 
-325362.143737  7409527.004576 
-325355.530260  7409550.670522 
-325349.180662  7409573.326641 
-325342.138381  7409611.620082 
-325338.699703  7409645.414293 
-325337.174150  7409667.370532 
-325344.661728  7409699.774982 
-325352.982175  7409725.370597 
-325358.746290  7409753.465785 
-325363.248732  7409780.791104 
-325363.809475  7409819.174530 
-325362.053028  7409861.067354 
-325358.416441  7409890.572300 
-325353.765566  7409919.307378 
-325350.648491  7409947.552540 
-325348.834321  7409972.278304 
-325349.139431  7409989.955276 
-325350.359873  7410015.220949 
-325357.781481  7410031.458167 
-325367.231661  7410069.701617 
-325368.303671  7410086.118804 
-325360.197626  7410107.245186 
-325346.921195  7410136.380195 
-325335.665090  7410166.305069 
-325328.408407  7410200.809159 
-325321.959855  7410231.793852 
-325320.393071  7410257.529443 
-325316.575066  7410280.465515 
-325314.727911  7410308.220760 
-325309.780172  7410341.245104 
-325300.898982  7410363.111358 
-325291.762158  7410384.977613 
-325277.784797  7410409.053489 
-325265.374220  7410428.860096 
-325250.992794  7410444.607399 
-325238.400800  7410457.845131 
-325226.625182  7410467.053554 
-325218.568615  7410483.630714 
-325213.431213  7410489.379729 
-325204.475807  7410495.838623 
-325195.553385  7410500.037904 
-325182.095537  7410500.637801 
-325164.992854  7410488.579866 
-325152.928619  7410478.841535 
-325131.051369  7410462.184388 
-325108.300019  7410455.865470 
-325084.798261  7410447.766857 
-325061.049117  7410439.928200 
-325038.842018  7410429.819932 
-325012.775683  7410424.730803 
-324998.633397  7410419.521695 
-324979.988670  7410408.703549 
-324954.804682  7410393.016236 
-324938.947180  7410382.228084 
-324916.319523  7410364.551111 
-324893.576419  7410357.222367 
-324857.837255  7410354.792783 
-324831.498795  7410351.463353 
-324798.538611  7410349.823634 
-324766.304095  7410351.733307 
-324741.441710  7410352.213225 
-324708.192908  7410353.343031 
-324663.201473  7410361.171690 
-324636.986706  7410368.950358 
-324602.014442  7410387.747138 
-324574.917328  7410405.614078 
-324533.983039  7410435.448967 
-324500.866177  7410468.913235 
-324449.813763  7410518.074814 
-324424.118508  7410546.309978 
-324396.633821  7410575.794927 
-324378.615808  7410598.061113 
-324361.348201  7410621.347125 
-324343.569327  7410645.133050 
-324330.177449  7410662.160134 
-324312.481038  7410679.377185 
-324296.722491  7410703.183107 
-324285.078813  7410722.749755 
-324277.731422  7410743.876137 
-324273.204241  7410762.512944 
-324270.169628  7410783.179404 
-324263.358242  7410801.786217 
-324253.932800  7410848.648190 
-324248.638720  7410867.774914 
-324247.212122  7410881.652537 
-324243.690982  7410900.299343 
-324240.697600  7410917.936322 
-324233.630580  7410936.293177 
-324223.001189  7410978.086018 
-324226.621284  7410993.783330 
-324231.733947  7411012.020206 
-324235.395274  7411024.428081 
-324239.196786  7411046.194352 
-324244.004338  7411068.970451 
-324248.869615  7411086.957370 
-324253.982278  7411105.194246 
-324261.329669  7411127.750382 
-324266.178453  7411147.497000 
-324273.492859  7411172.832660 
-324276.024452  7411194.578935 
-324281.376256  7411214.335551 
-324284.072773  7411244.410400 
-324285.342693  7411265.636764 
-324287.198095  7411302.020531 
-324269.724332  7411321.257236 
-324254.806901  7411339.024193 
-324247.294584  7411352.321915 
-324237.638248  7411375.687913 
-324227.190274  7411401.323522 
-324216.816516  7411420.900168 
-324204.191537  7411437.927252 
-324195.706166  7411447.685580 
-324178.554006  7411460.873321 
-324159.134133  7411473.021241 
-324141.215073  7411487.208810 
-324119.445025  7411504.635825 
-324107.034447  7411524.952345 
-324104.205990  7411549.918069 
-324100.989960  7411565.035479 
-324094.203313  7411581.112725 
-324085.462308  7411591.370968 
-324069.382158  7411599.269615 
-324052.081566  7411604.118785 
-324032.777140  7411605.918476 
-324012.697569  7411609.987779 
-323981.732973  7411610.897624 
-323961.892542  7411615.466841 
-323942.035618  7411621.805755 
-323921.881831  7411631.424108 
-323908.547676  7411643.642015 
-323889.424667  7411652.520494 
-323875.892602  7411660.189180 
-323853.017559  7411663.968533 
-323840.029745  7411668.367779 
-323820.469686  7411670.417428 
-323796.275245  7411678.726005 
-323785.522161  7411687.444512 
-323767.586609  7411702.641909 
-323760.668022  7411708.630883 
-323748.364645  7411719.349047 
-323735.294370  7411730.807084 
-323719.774964  7411734.676421 
-323707.092261  7411735.036360 
-323690.624538  7411733.076695 
-323679.483881  7411730.937062 
-323665.852862  7411725.727954 
-323651.661099  7411724.048242 
-323636.166431  7411726.147882 
-323626.980130  7411730.587122 
-323611.765835  7411730.167194 
-323599.891263  7411726.497822 
-323591.546077  7411723.878271 
-323574.600073  7411719.898953 
-323560.350587  7411723.768290 
-323539.240236  7411728.077552 
-323517.626866  7411732.886728 
-323495.988756  7411739.455603 
-323475.851461  7411748.064128 
-323443.014971  7411757.282549 
-323420.857349  7411765.371164 
-323402.534225  7411769.960378 
-323384.524457  7411770.000371 
-323368.048488  7411769.310489 
-323346.245454  7411768.310660 
-323323.403395  7411768.800576 
-323304.874115  7411769.860395 
-323290.847277  7411776.769211 
-323285.198609  7411782.258271 
-323277.999649  7411790.756815 
-323265.688027  7411802.234849 
-323259.717756  7411813.782871 
-323251.405555  7411830.609989 
-323245.377561  7411846.947190 
-323239.382551  7411861.024779 
-323231.886728  7411872.802762 
-323219.830738  7411884.280796 
-323211.675216  7411887.980162 
-323197.978227  7411887.320275 
-323174.938259  7411884.030838 
-323156.145099  7411885.580573 
-323135.546015  7411890.139792 
-323117.701172  7411898.018442 
-323101.612776  7411906.926916 
-323082.217641  7411917.065180 
-323065.832381  7411929.753007 
-323049.463613  7411941.431006 
-323035.346066  7411955.668567 
-323019.942107  7411971.395874 
-323007.350113  7411985.143519 
-322990.635004  7412004.650177 
-322979.832442  7412017.148037 
-322967.735221  7412032.415421 
-322951.011865  7412052.931907 
-322937.941590  7412064.399943 
-322912.320551  7412086.076230 
-322895.110668  7412104.563063 
-322876.325755  7412127.079206 
-322861.804142  7412154.184563 
-322852.370454  7412180.340083 
-322841.675093  7412205.715737 
-322827.351391  7412237.370314 
-322803.082734  7412264.025749 
-322793.690277  7412285.392089 
-322780.116982  7412309.178014 
-322771.681088  7412319.806194 
-322756.491531  7412339.442830 
-322743.668642  7412369.847622 
-322740.419627  7412383.335312 
-322723.828211  7412391.733873 
-322706.189524  7412403.651832 
-322690.092882  7412413.070219 
-322675.851641  7412416.439642 
-322667.448732  7412419.119183 
-322655.021663  7412418.979207 
-322641.844186  7412417.819405 
-322631.948709  7412418.219337 
-322617.996087  7412418.059364 
-322605.140213  7412411.090558 
-322597.594912  7412405.961436 
-322588.515812  7412401.052277 
-322578.166793  7412396.643033 
-322559.695236  7412392.903673 
-322524.038535  7412383.655257 
-322504.593923  7412375.606636 
-322477.554533  7412366.968116 
-322452.791102  7412358.859504 
-322438.871465  7412356.179963 
-322415.089336  7412351.110832 
-322397.063076  7412352.420607 
-322383.654705  7412348.981197 
-322363.410208  7412345.221840 
-322341.673144  7412337.903094 
-322330.120175  7412328.424718 
-322319.820633  7412319.976165 
-322311.541418  7412312.057521 
-322298.248494  7412299.029753 
-322280.329435  7412291.001128 
-322268.900159  7412291.880977 
-322262.022802  7412294.830472 
-322255.598989  7412301.579316 
-322248.177381  7412307.298336 
-322234.183528  7412310.927715 
-322217.179800  7412311.747574 
-322207.028690  7412312.137508 
-322189.488958  7412315.466937 
-322177.540169  7412317.606571 
-322159.184060  7412324.975309 
-322145.445840  7412328.854644 
-322132.746645  7412330.474367 
-322116.757203  7412331.054267 
-322103.571481  7412330.404379 
-322087.862411  7412328.954627 
-322074.948814  7412327.044954 
-322062.802116  7412324.385410 
-322050.688403  7412319.196298 
-322041.122776  7412312.777398 
-322029.083279  7412301.019412 
-322019.278511  7412293.330729 
-322005.861894  7412290.911143 
-321993.640980  7412295.060433 
-321980.389287  7412299.959594 
-321965.339916  7412307.118367 
-321942.687521  7412314.177158 
-321927.967999  7412314.267143 
-321912.737211  7412315.097001 
-321899.040222  7412314.947026 
-321889.400378  7412315.596915 
-321872.693515  7412312.627424 
-321856.209300  7412312.187499 
-321844.046110  7412310.787739 
-321830.134719  7412307.598285 
-321814.928669  7412306.158532 
-321800.745153  7412304.738775 
-321787.848048  7412301.309362 
-321775.206576  7412297.130078 
-321761.031306  7412294.690496 
-321750.179266  7412290.281251 
-321736.985297  7412290.131277 
-321726.562062  7412292.530866 
-321720.698992  7412294.990445 
-321710.696314  7412303.968907 
-321695.110938  7412313.887208 
-321682.156110  7412315.007016 
-321674.561331  7412313.657247 
-321663.156794  7412312.767400 
-321655.908357  7412304.098884 
-321643.877107  7412291.591027 
-321635.317520  7412285.692037 
-321625.001485  7412278.503269 
-321613.168144  7412270.794589 
-321600.048391  7412265.085567 
-321584.570216  7412265.665468 
-321569.322936  7412268.025064 
-321555.584715  7412270.894572 
-321541.376460  7412271.744427 
-321525.626159  7412273.084197 
-321517.008848  7412272.984214 
-321507.088633  7412274.893887 
-321487.990363  7412281.492757 
-321480.065735  7412286.451907 
-321468.116947  7412288.591541 
-321452.143998  7412287.901659 
-321439.238647  7412285.482073 
-321427.075457  7412284.082313 
-321406.261971  7412285.612051 
-321394.807956  7412289.011469 
-321382.545812  7412296.200237 
-321373.804807  7412306.448482 
-321365.129772  7412310.897720 
-321359.299687  7412310.327818 
-321351.704909  7412309.228006 
-321343.912221  7412302.829102 
-321332.598392  7412294.370551 
-321323.041011  7412286.941823 
-321307.084555  7412284.992157 
-321288.563521  7412285.032150 
-321269.193125  7412293.140762 
-321258.736905  7412298.079915 
-321235.581489  7412304.128879 
-321216.293555  7412305.168701 
-321198.325019  7412301.179385 
-321183.671467  7412296.460193 
-321168.754036  7412292.000957 
-321148.031258  7412285.202121 
-321142.712439  7412281.562745 
-321133.963189  7412275.293819 
-321125.205692  7412269.274850 
-321115.417416  7412263.995754 
-321106.437271  7412256.457045 
-321099.774316  7412247.718542 
-321091.668272  7412235.400652 
-321086.802996  7412225.442358 
-321081.467684  7412214.204283 
-321076.833303  7412205.505773 
-321070.252811  7412204.335973 
-321067.688233  7412205.795723 
-321061.833409  7412206.155661 
-321056.250711  7412206.025684 
-321048.928058  7412203.826060 
-321043.691702  7412199.666773 
-321037.408074  7412196.737275 
-321031.099708  7412194.817603 
-321022.960678  7412195.377507 
-321017.336749  7412197.017227 
-321012.207593  7412199.166858 
-321007.004222  7412204.845886 
-321001.297830  7412210.015000 
-321000.258805  7412222.362885 
-320998.865192  7412228.131897 
-320996.176921  7412234.890739 
-320991.064258  7412236.280501 
-320982.644856  7412238.100189 
-320970.943455  7412238.830064 
-320955.803376  7412245.788872 
-320944.984321  7412252.597706 
-320929.176297  7412266.615305 
-320918.761307  7412278.233315 
-320910.680001  7412287.631705 
-320900.265012  7412299.249715 
-320892.035274  7412303.848927 
-320874.866622  7412310.757744 
-320854.984960  7412313.817220 
-320848.800287  7412317.716552 
-320841.428156  7412318.036497 
-320832.307825  7412317.066663 
-320824.968680  7412315.876867 
-320816.178198  7412311.377638 
-320807.024882  7412311.667588 
-320797.830335  7412313.967194 
-320791.909541  7412317.616569 
-320786.227889  7412322.025814 
-320780.694668  7412330.984279 
-320776.950879  7412350.840878 
-320776.365397  7412365.968287 
-320774.312085  7412378.296175 
-320772.761794  7412390.884019 
-320777.313713  7412403.361882 
-320781.915110  7412413.320176 
-320783.539617  7412420.428958 
-320785.419758  7412427.287783 
-320783.226261  7412434.306581 
-320779.292809  7412440.015603 
-320771.508367  7412447.664293 
-320762.767362  7412452.253507 
-320758.017533  7412460.472099 
-320758.025780  7412471.320241 
-320759.831704  7412485.777765 
-320752.154463  7412499.375435 
-320743.965956  7412503.634706 
-320730.153520  7412506.584201 
-320716.316345  7412512.013271 
-320701.209251  7412518.682128 
-320667.276011  7412528.850387 
-320644.648355  7412536.049154 
-320637.721521  7412539.078635 
-320630.110250  7412547.077264 
-320625.698517  7412549.516847 
-320604.909769  7412560.464971 
-320590.289202  7412567.553757 
-320580.030891  7412583.461032 
-320568.090349  7412595.299005 
-320556.537380  7412600.828057 
-320537.826683  7412608.466749 
-320528.978477  7412611.696196 
-320521.128066  7412608.606725 
-320504.635604  7412605.417271 
-320485.891922  7412602.197823 
-320461.474833  7412601.527938 
-320424.226609  7412606.677056 
-320351.964890  7412617.005286 
-320303.411084  7412624.633980 
-320279.340337  7412626.583646 
-320263.210710  7412624.893935 
-320258.328941  7412624.084074 
-320229.203255  7412609.536566 
-320219.489195  7412605.307290 
-320212.018110  7412601.857881 
-320202.271065  7412600.238159 
-320195.129830  7412600.158172 
-320186.083714  7412603.037679 
-320175.512047  7412607.016997 
-320164.495083  7412616.965293 
-320156.083927  7412629.193199 
-320141.150004  7412652.169263 
-320135.064285  7412658.448188 
-320128.269391  7412660.977754 
-320121.136402  7412660.517833 
-320115.528965  7412658.208229 
-320109.946267  7412654.028945 
-320087.739168  7412626.863598 
-320072.986661  7412603.897532 
-320053.451341  7412573.022820 
-320044.603135  7412559.465143 
-320031.961664  7412548.487023 
-320024.869905  7412545.037614 
-320015.122861  7412543.047955 
-320004.979997  7412542.927975 
-319993.657922  7412547.267232 
-319967.220507  7412558.895240 
-319948.311900  7412569.123488 
-319900.178652  7412603.657573 
-319888.056693  7412611.346256 
-319874.475151  7412616.415387 
-319855.574790  7412625.893764 
-319830.283601  7412635.672089 
-319816.330979  7412639.981351 
-319803.169994  7412640.571250 
-319790.421322  7412638.921532 
-319757.477630  7412629.183200 
-319739.880174  7412624.484005 
-319728.624069  7412622.854285 
-319715.454839  7412624.933928 
-319710.902920  7412628.233363 
-319707.818829  7412634.552281 
-319707.373533  7412640.521258 
-319711.331724  7412654.768818 
-319719.454261  7412666.076881 
-319735.418963  7412681.954161 
-319742.428259  7412692.502354 
-319752.727802  7412710.189325 
-319764.082861  7412734.235206 
-319766.622700  7412741.363985 
-319766.548484  7412748.082834 
-319763.777751  7412759.260919 
-319759.555681  7412766.679649 
-319753.849289  7412772.208702 
-319747.070887  7412773.998395 
-319737.299104  7412774.248352 
-319728.318959  7412770.778946 
-319694.311504  7412756.541385 
-319681.975143  7412751.162307 
-319668.236922  7412738.294511 
-319656.378843  7412724.696840 
-319647.134818  7412712.258970 
-319631.351533  7412682.174124 
-319620.293337  7412664.487153 
-319606.612841  7412646.760190 
-319579.903300  7412618.794980 
-319569.430587  7412609.156631 
-319537.921739  7412580.171596 
-319520.744841  7412572.122974 
-319502.743319  7412569.283461 
-319467.399975  7412571.463087 
-319440.731665  7412571.143142 
-319422.359063  7412568.303629 
-319404.035939  7412561.354819 
-319395.468105  7412555.265862 
-319388.813397  7412546.227410 
-319379.923960  7412536.029157 
-319371.084001  7412521.721608 
-319355.152283  7412503.594713 
-319347.763661  7412493.046519 
-319341.900591  7412481.398515 
-319338.272249  7412470.520378 
-319339.533923  7412459.702231 
-319343.112787  7412443.684975 
-319351.556927  7412428.847516 
-319361.567851  7412409.170887 
-319368.906996  7412392.443752 
-319370.110946  7412386.484773 
-319372.139518  7412374.176881 
-319368.775056  7412342.012390 
-319364.594217  7412315.436942 
-319360.957630  7412305.678614 
-319353.527776  7412298.489845 
-319339.336013  7412291.601025 
-319331.848436  7412290.011298 
-319322.076652  7412290.261255 
-319310.375251  7412294.600511 
-319301.658985  7412300.469506 
-319295.193940  7412307.118367 
-319286.032378  7412318.956340 
-319276.062685  7412335.643481 
-319264.550947  7412354.930178 
-319254.985320  7412369.007766 
-319240.595647  7412378.546132 
-319231.128974  7412384.405129 
-319222.849759  7412385.804889 
-319213.424317  7412388.304461 
-319206.645916  7412390.084156 
-319192.363444  7412390.284122 
-319179.614772  7412388.634404 
-319171.747868  7412386.664742 
-319159.807326  7412380.175853 
-319138.565035  7412365.718330 
-319128.521126  7412357.749695 
-319118.889529  7412346.421635 
-319113.001720  7412336.633312 
-319106.404736  7412323.105629 
-319102.421806  7412311.107684 
-319094.860013  7412284.492243 
-319091.701707  7412265.775449 
-319089.392762  7412239.969869 
-319088.617616  7412211.194798 
-319090.407048  7412157.054072 
-319090.670928  7412135.757720 
-319089.623657  7412129.028872 
-319087.520868  7412116.670989 
-319085.302632  7412083.396689 
-319083.100888  7412048.252709 
-319083.595662  7412038.924306 
-319084.387300  7412035.194945 
-319086.325164  7412030.365772 
-319091.627491  7412027.066338 
-319099.172792  7412024.916706 
-319109.332148  7412023.177004 
-319114.997308  7412021.007375 
-319121.074780  7412015.098388 
-319126.855388  7412003.220422 
-319132.248423  7411992.452267 
-319132.322639  7411986.853226 
-319130.920780  7411978.614637 
-319128.743775  7411971.865793 
-319120.992318  7411960.557730 
-319114.304625  7411954.498768 
-319103.873143  7411947.649941 
-319091.206933  7411938.901440 
-319080.387878  7411932.792486 
-319072.215864  7411925.593719 
-319065.940482  7411916.555267 
-319060.794834  7411907.146879 
-319057.587050  7411892.919316 
-319056.943844  7411883.940854 
-319057.784960  7411876.852068 
-319060.489724  7411870.533150 
-319066.575442  7411864.634161 
-319085.112968  7411854.025978 
-319096.459782  7411847.447105 
-319104.087545  7411838.568626 
-319110.239233  7411827.070595 
-319109.637258  7411814.732708 
-319103.889636  7411793.366368 
-319097.284405  7411780.588557 
-319090.266863  7411770.410301 
-319088.477430  7411763.671455 
-319087.520868  7411749.833825 
-319088.782541  7411738.645741 
-319091.198687  7411725.228040 
-319091.685214  7411716.639511 
-319092.559315  7411706.561237 
-319093.763264  7411700.232321 
-319096.476274  7411693.533469 
-319100.335510  7411684.614996 
-319100.830284  7411675.286594 
-319098.694510  7411665.548262 
-319092.765470  7411659.129362 
-319083.076149  7411652.650472 
-319070.393447  7411645.031777 
-319062.229678  7411636.713202 
-319054.832809  7411627.284817 
-319051.220960  7411616.026745 
-319047.724559  7411594.320463 
-319049.274850  7411560.346283 
-319052.556850  7411537.600179 
-319053.802031  7411527.531903 
-319053.843262  7411524.162481 
-319052.845468  7411513.694274 
-319054.907026  7411498.776829 
-319057.463357  7411474.530982 
-319058.906447  7411448.765395 
-319057.158246  7411407.652438 
-319054.725608  7411391.185258 
-319052.177523  7411384.436414 
-319047.749297  7411378.397449 
-319041.391453  7411376.077846 
-319035.759278  7411376.017856 
-319029.731283  7411377.437613 
-319015.003515  7411383.226622 
-318999.888175  7411390.885310 
-318964.008825  7411406.142696 
-318925.886501  7411420.990153 
-318907.398452  7411427.479042 
-318892.307850  7411432.528177 
-318879.889026  7411434.617819 
-318864.122233  7411433.677980 
-318842.014089  7411429.298730 
-318811.288634  7411422.569882 
-318773.446681  7411414.631242 
-318753.218677  7411410.271989 
-318727.754317  7411403.603131 
-318714.634564  7411401.203542 
-318696.962892  7411402.113386 
-318684.527576  7411405.312838 
-318672.455094  7411409.652095 
-318661.091789  7411416.980840 
-318647.081443  7411426.519206 
-318631.562037  7411436.047574 
-318622.491183  7411440.416825 
-318611.193847  7411442.516466 
-318595.039481  7411442.696435 
-318572.956075  7411436.067570 
-318546.065117  7411423.039802 
-318528.179043  7411411.241823 
-318512.263818  7411391.995120 
-318494.056141  7411375.707909 
-318483.245332  7411369.219021 
-318463.784228  7411363.000086 
-318433.058772  7411357.021110 
-318417.333211  7411352.341912 
-318409.491045  7411348.512568 
-318404.683493  7411342.853537 
-318400.997428  7411337.204505 
-318399.595568  7411328.965916 
-318402.028206  7411314.048471 
-318409.713693  7411300.330821 
-318429.430431  7411285.623340 
-318458.168545  7411269.916031 
-318469.136032  7411264.446967 
-318482.775297  7411254.908601 
-318491.128729  7411247.539863 
-318494.221065  7411240.481073 
-318495.053934  7411233.762223 
-318492.126523  7411227.373318 
-318482.090860  7411218.664810 
-318466.027203  7411211.735996 
-318450.293394  7411207.806669 
-318435.648089  7411207.626700 
-318422.833446  7411211.206087 
-318400.947950  7411219.154726 
-318383.589635  7411225.293674 
-318365.522143  7411228.433136 
-318344.090190  7411230.032862 
-318310.264152  7411231.482614 
-318274.549727  7411233.662241 
-318232.056900  7411237.241627 
-318216.248876  7411239.291276 
-318187.255129  7411244.910314 
-318159.036528  7411248.669670 
-318133.803062  7411253.968762 
-318104.042416  7411260.697610 
-318090.840201  7411265.016870 
-318077.225674  7411271.945683 
-318063.602901  7411280.364241 
-318044.323213  7411290.212554 
-318029.991265  7411294.521816 
-318014.207979  7411295.451657 
-317998.457679  7411292.642138 
-317986.154303  7411285.393380 
-317974.659057  7411273.295452 
-317961.745460  7411254.078743 
-317947.347541  7411233.732229 
-317934.755547  7411219.384686 
-317919.838116  7411210.226255 
-317901.135665  7411203.647382 
-317885.789429  7411199.348118 
-317871.894531  7411199.178147 
-317862.477335  7411201.307783 
-317840.987658  7411207.386741 
-317816.867434  7411213.815640 
-317799.154530  7411218.454845 
-317781.499350  7411218.234883 
-317770.647311  7411214.735483 
-317753.099332  7411206.306926 
-317739.715700  7411194.558939 
-317725.284796  7411177.191913 
-317711.653777  7411155.355654 
-317705.073285  7411140.708163 
-317703.762134  7411125.000853 
-317707.316259  7411111.223213 
-317720.419520  7411084.487793 
-317731.197343  7411063.701353 
-317739.344619  7411042.135047 
-317743.492473  7411010.810413 
-317744.102694  7410991.763676 
-317746.881674  7410979.475780 
-317752.324186  7410964.968265 
-317764.470884  7410955.039966 
-317786.513059  7410934.013568 
-317803.945590  7410921.525707 
-317818.434217  7410904.528618 
-317824.709599  7410883.312252 
-317828.478126  7410851.977620 
-317829.278011  7410817.243569 
-317831.694156  7410804.575739 
-317856.944115  7410815.903799 
-317868.307420  7410818.183408 
-317884.280369  7410818.313386 
-317901.630438  7410813.934136 
-317915.706754  7410808.974986 
-317929.453221  7410796.187176 
-317940.165074  7410783.339377 
-317954.274375  7410766.282299 
-317967.122002  7410749.205224 
-317984.364870  7410728.438781 
-317996.618769  7410714.621148 
-318010.241542  7410696.544244 
-318019.980341  7410682.156708 
-318029.447013  7410668.269087 
-318037.586043  7410656.871040 
-318044.735525  7410655.021357 
-318057.335765  7410658.340788 
-318065.590242  7410663.069978 
-318083.707211  7410668.788998 
-318098.220577  7410676.937602 
-318111.348576  7410679.517161 
-318122.777852  7410679.027245 
-318128.723384  7410674.128084 
-318133.151610  7410669.448885 
-318137.464389  7410658.970680 
-318139.575424  7410655.491276 
-318141.307132  7410646.962737 
-318141.059745  7410636.374551 
-318138.643600  7410631.275424 
-318133.638138  7410628.635876 
-318126.414440  7410623.176811 
-318123.495274  7410618.067686 
-318120.081334  7410612.198692 
-318120.172043  7410608.419339 
-318121.013159  7410605.159897 
-318128.698645  7410602.070427 
-318136.326409  7410601.490526 
-318146.502257  7410599.970786 
-318157.420267  7410599.720829 
-318174.432241  7410598.860976 
-318186.372783  7410597.881144 
-318200.671747  7410593.931821 
-318205.809148  7410591.282274 
-318211.004274  7410586.363117 
-318219.102072  7410576.724768 
-318228.478036  7410566.616499 
-318233.516483  7410557.408077 
-318231.990931  7410547.039853 
-318230.572579  7410542.730591 
-318228.115202  7410539.651118 
-318220.751318  7410529.642833 
-318211.342369  7410520.104467 
-318206.526570  7410509.406299 
-318201.809726  7410505.267008 
-318200.943872  7410499.198048 
-318204.530983  7410487.190105 
-318209.536445  7410479.491423 
-318209.223088  7410471.672762 
-318205.611239  7410463.524158 
-318203.656882  7410460.454684 
-318198.544219  7410451.776171 
-318193.670697  7410443.347614 
-318192.178129  7410431.969563 
-318196.952697  7410402.354636 
-318199.583244  7410387.797130 
-318205.545269  7410372.059825 
-318211.144459  7410360.861743 
-318219.778263  7410349.973608 
-318231.059106  7410344.944470 
-318246.388849  7410340.515229 
-318258.865396  7410338.295609 
-318278.870752  7410329.437126 
-318289.442419  7410322.128378 
-318295.519891  7410311.940123 
-318301.259268  7410305.521223 
-318310.387845  7410284.574811 
-318318.625830  7410269.147453 
-318324.777518  7410255.939716 
-318332.256849  7410240.492362 
-318347.702039  7410220.695753 
-318362.388576  7410200.629190 
-318368.985560  7410179.622788 
-318378.345032  7410159.686203 
-318385.395559  7410140.949412 
-318398.449342  7410125.632036 
-318410.678502  7410113.074187 
-318422.816954  7410093.447549 
-318429.059351  7410066.132228 
-318438.707440  7410055.274088 
-318446.788746  7410046.395609 
-318458.399439  7410038.346987 
-318475.815478  7410031.198212 
-318494.229311  7410025.079260 
-318516.452903  7410018.550378 
-318529.984967  7410016.670700 
-318545.809484  7410010.671728 
-318557.362453  7410004.892718 
-318575.932965  7409992.224888 
-318597.480365  7409971.568426 
-318613.387344  7409953.801469 
-318629.269584  7409936.784384 
-318640.220579  7409924.446497 
-318645.828016  7409912.988460 
-318656.374945  7409896.351310 
-318661.924658  7409876.574697 
-318661.462869  7409853.888583 
-318660.968095  7409842.790484 
-318661.504100  7409820.884237 
-318666.534301  7409812.185727 
-318674.153818  7409801.277595 
-318699.494485  7409781.211032 
-318718.518539  7409770.822812 
-318733.881266  7409764.633872 
-318755.486391  7409752.285987 
-318766.833204  7409744.747278 
-318771.574787  7409737.298554 
-318773.355973  7409726.500404 
-318770.585239  7409715.352313 
-318763.188370  7409706.613810 
-318757.877798  7409695.655687 
-318748.064783  7409681.818057 
-318742.333653  7409667.070584 
-318735.167678  7409649.013677 
-318731.374412  7409627.507360 
-318730.277664  7409609.840387 
-318732.875226  7409586.724346 
-318735.530513  7409581.745199 
-318739.513442  7409574.276478 
-318747.545271  7409567.157698 
-318758.826114  7409562.388515 
-318774.403244  7409557.969272 
-318798.094664  7409553.729998 
-318826.857517  7409549.370744 
-318852.833144  7409545.191460 
-318868.913293  7409540.782216 
-318884.572885  7409533.333492 
-318896.348503  7409528.574307 
-318907.588115  7409514.976636 
-318913.022381  7409499.989203 
-318912.074064  7409486.871450 
-318910.721683  7409479.782664 
-318907.217035  7409467.604750 
-318901.898216  7409456.646627 
-318897.428759  7409442.179105 
-318895.515633  7409427.011703 
-318893.165458  7409409.064778 
-318888.753724  7409392.087686 
-318884.078111  7409375.850467 
-318879.138619  7409359.863205 
-318871.774735  7409339.276732 
-318870.504816  7409328.918506 
-318873.514690  7409319.920047 
-318876.392624  7409305.622496 
-318881.530026  7409292.644719 
-318882.948378  7409276.047562 
-318882.445358  7409265.199420 
-318883.236996  7409253.621404 
-318887.087986  7409241.373502 
-318891.763598  7409226.366072 
-318898.533754  7409218.957341 
-318906.738753  7409215.377954 
-318914.886029  7409214.058180 
-318927.807873  7409214.608086 
-318937.653872  7409216.347788 
-318945.999057  7409217.557581 
-318958.022062  7409223.636540 
-318963.876885  7409223.016646 
-318969.484322  7409221.636882 
-318976.741005  7409215.257975 
-318980.938337  7409209.558951 
-318987.947633  7409195.221407 
-318990.099899  7409184.133306 
-318994.066336  7409169.275851 
-318995.591888  7409145.559914 
-318996.820577  7409125.373371 
-319002.395029  7409103.207168 
-319006.163556  7409083.550535 
-319016.974365  7409070.532765 
-319032.180414  7409050.486199 
-319041.152313  7409043.757351 
-319056.012020  7409032.289316 
-319071.688105  7409015.782143 
-319078.128411  7409007.763517 
-319090.679174  7408998.805051 
-319103.188706  7408993.375981 
-319120.481052  7408992.286168 
-319142.094422  7408991.496303 
-319166.998039  7408991.736262 
-319188.339284  7408992.206182 
-319205.623383  7408992.376153 
-319222.643603  7408992.546123 
-319237.725959  7408984.617482 
-319244.867195  7408982.417858 
-319260.394847  7408979.798307 
-319270.834575  7408978.138591 
-319285.603574  7408975.758999 
-319293.297307  7408968.770196 
-319301.007533  7408960.761568 
-319305.460497  7408948.693635 
-319324.286642  7408946.603993 
-319332.392687  7408948.703633 
-319339.740078  7408951.303188 
-319349.066565  7408958.212005 
-319361.196770  7408965.150816 
-319372.032317  7408973.599369 
-319381.424774  7408974.449223 
-319393.142668  7408972.289593 
-319421.386008  7408969.040150 
-319435.858143  7408969.939996 
-319442.933409  7408974.309247 
-319450.528187  7408977.158759 
-319463.144920  7408985.117396 
-319473.032150  7408987.736947 
-319488.015552  7408989.146706 
-319507.328224  7408988.836759 
-319527.201640  7408984.237547 
-319540.931614  7408983.367696 
-319563.048004  7408983.587658 
-319574.180416  7408988.246860 
-319588.594827  7408994.955711 
-319597.162660  7409001.354615 
-319603.330841  7409018.831621 
-319611.453378  7409019.931433 
-319617.819468  7409018.981595 
-319629.009603  7409018.081749 
-319638.979296  7409012.882640 
-319646.920416  7409006.393752 
-319654.655380  7408996.375468 
-319658.613571  7408982.277882 
-319666.967003  7408961.651415 
-319675.485359  7408949.613477 
-319686.477585  7408943.164582 
-319704.091533  7408936.525719 
-319717.326733  7408934.636043 
-319727.741723  7408934.736026 
-319746.031862  7408935.175950 
-319757.197259  7408936.805671 
-319773.697966  7408938.735341 
-319782.133860  7408934.026147 
-319789.802855  7408929.806870 
-319795.476261  7408922.288158 
-319805.495431  7408912.289871 
-319819.060481  7408903.331405 
-319836.740399  7408890.133666 
-319848.153183  7408868.277410 
-319856.465383  7408851.190336 
-319867.606041  7408831.103777 
-319884.403613  7408805.268203 
-319894.546476  7408783.401948 
-319910.107113  7408754.516896 
-319929.271353  7408720.372744 
-319951.000171  7408684.478893 
-319967.773004  7408660.912929 
-319972.489848  7408647.325257 
-319978.996124  7408632.997711 
-319990.079058  7408618.970114 
-320007.091032  7408596.673933 
-320017.415313  7408581.626510 
-320024.713227  7408564.279482 
-320030.172232  7408553.221376 
-320031.524613  7408544.902801 
-320031.978156  7408526.725914 
-320031.862709  7408513.348206 
-320035.540528  7408502.520061 
-320036.958879  7408488.402479 
-320034.534488  7408477.514344 
-320021.183840  7408466.526226 
-320010.084414  7408458.587586 
-320002.761761  7408453.718420 
-319993.253857  7408439.990771 
-319991.348978  7408427.842852 
-319991.200546  7408417.494625 
-319992.058154  7408408.666137 
-319990.425400  7408395.518389 
-319987.992762  7408384.890209 
-319980.752571  7408372.952254 
-319971.978582  7408360.994303 
-319965.208427  7408352.845698 
-319957.968236  7408340.907743 
-319953.474040  7408333.289048 
-319952.863819  7408318.381602 
-319954.719221  7408311.332809 
-319966.997859  7408303.884085 
-319975.953265  7408298.415022 
-319985.716802  7408288.416734 
-319994.202174  7408279.408278 
-320000.708450  7408264.830775 
-320005.895329  7408255.292408 
-320012.121233  7408242.974518 
-320017.357589  7408228.387017 
-320026.337734  7408220.398385 
-320037.857719  7408212.939663 
-320046.846110  7408204.441119 
-320056.824049  7408197.972227 
-320066.884450  7408184.194587 
-320074.207103  7408164.567949 
-320075.608963  7408152.460023 
-320078.107570  7408132.543434 
-320079.583646  7408112.866805 
-320088.027786  7408083.661807 
-320092.835338  7408062.245476 
-320087.953570  7408043.008771 
-320083.277957  7408028.311288 
-320079.097118  7408015.643458 
-320076.441832  7408002.235755 
-320061.656340  7407982.899067 
-320043.630080  7407980.699444 
-320031.895694  7407984.878728 
-320015.840283  7407989.257978 
-320003.413213  7407987.118344 
-319996.882199  7407979.219697 
-319994.960827  7407969.101430 
-319996.074068  7407960.022985 
-319997.236786  7407946.405318 
-319994.532023  7407937.786794 
-319991.085098  7407926.898659 
-319990.417154  7407918.560088 
-319995.364892  7407906.992069 
-320004.542947  7407904.812442 
-320015.807298  7407897.103763 
-320026.535644  7407891.394741 
-320041.881879  7407882.466270 
-320047.802673  7407875.197515 
-320051.818587  7407856.300752 
-320051.488738  7407839.633607 
-320047.324391  7407825.206078 
-320045.271080  7407802.959889 
-320037.907196  7407778.144140 
-320032.200804  7407765.206356 
-320033.058412  7407756.377868 
-320037.725779  7407747.589373 
-320043.118814  7407742.590230 
-320054.168763  7407731.342156 
-320067.511164  7407719.354210 
-320084.490153  7407699.577597 
-320081.356585  7407683.640327 
-320077.390148  7407674.511891 
-320067.750305  7407672.392254 
-320058.522773  7407662.493949 
-320053.467833  7407653.315522 
-320051.736125  7407649.256217 
-320045.765854  7407630.589416 
-320042.830196  7407614.362194 
-320041.568522  7407601.434408 
-320043.687804  7407593.625746 
-320047.860396  7407588.506623 
-320059.438104  7407587.936720 
-320071.279691  7407586.107034 
-320118.679025  7407597.045160 
-320172.576389  7407596.285290 
-320214.920783  7407601.164455 
-320223.241230  7407602.644201 
-320231.817310  7407606.663513 
-320236.369229  7407610.192908 
-320242.957967  7407619.801262 
-320245.769932  7407628.669743 
-320260.679117  7407622.060875 
-320275.497593  7407614.382190 
-320286.786683  7407604.903814 
-320298.603532  7407592.395957 
-320309.117476  7407583.667452 
-320325.016208  7407570.939632 
-320597.818011  7407607.713333 
-320617.988291  7407611.932610 
-320752.566775  7407630.059505 
-321039.337692  7407658.644609 
-321300.413354  7407685.050086 
-321356.331044  7407684.780132 
-321364.602014  7407675.361745 
-321361.352999  7407680.190918 
-321517.569592  7407682.160581 
-321537.731626  7407782.963314 
-321446.998350  7407808.168997 
-321401.635835  7407868.658635 
-321361.311768  7407984.588777 
-321371.396908  7408024.911870 
-321426.836316  7408060.195827 
-321436.921456  7408110.597193 
-321497.407558  7408145.881150 
-321598.217728  7408216.449062 
-321704.066344  7408372.702297 
-321799.829821  7408443.270209 
-321935.925612  7408473.505031 
-321996.263281  7408563.349641 
-321973.693348  7408865.477889 
-322122.339902  7408827.174450 
-322153.997181  7408817.926034 
-322179.230647  7408821.955344 
-322203.441580  7408824.214957 
-322238.108734  7408813.926719 
-322253.496200  7408815.526445 
-322284.716429  7408813.396810 
-322313.132940  7408807.247863 
-322329.963497  7408801.988764 
-322358.701611  7408803.438516 
-322380.933448  7408809.517475 
-322404.113603  7408809.247521 
-322415.180044  7408807.857759 
-322542.592554  7408824.914837 
-322552.166428  7408825.304770 
-322618.490861  7408831.143770 
-322646.717708  7408831.833652 
-322706.362695  7408824.314940 
-322746.307436  7408812.696930 
-322797.541267  7408796.149764 
-322856.287414  7408773.943568 
-322892.216241  7408763.895289 
-322973.557060  7408733.830439 
-323012.512254  7408723.502208 
-323084.922405  7408707.474954 
-323121.346006  7408697.166719 
-323156.079129  7408692.207569 
-323171.128500  7408685.708682 
-323189.567072  7408664.212364 
-323240.083481  7408624.859105 
-323266.083846  7408604.292628 
-323285.949016  7408575.167617 
-323310.407336  7408525.216173 
-323369.953367  7408430.022479 
-323376.789492  7408433.241927 
-323381.753723  7408451.678769 
-323378.001688  7408480.363856 
-323369.186468  7408506.809326 
-323349.016188  7408583.066264 
-323338.073440  7408622.979427 
-323332.771113  7408647.615207 
-323340.761711  7408665.532138 
-323356.272871  7408680.809521 
-323412.033882  7408714.133813 
-323433.168971  7408686.008631 
-323471.142864  7408626.788774 
-323499.311987  7408595.554125 
-323531.612473  7408575.157618 
-323560.243386  7408565.459280 
-323595.751655  7408563.279653 
-323625.256668  7408566.999016 
-323662.950188  7408582.016444 
-323694.623960  7408599.153508 
-323744.876490  7408637.856879 
-323762.630624  7408649.064959 
-323778.042830  7408652.944294 
-323792.391271  7408651.764496 
-323803.399989  7408644.275779 
-323816.610450  7408629.438321 
-323865.461121  7408626.088894 
-323902.181586  7408619.340050 
-323929.468363  7408602.053011 
-323981.502078  7408563.689583 
-324000.311730  7408553.851268 
-323944.542473  7408521.396827 
-323919.341992  7408488.632439 
-323909.265098  7408387.819708 
-323932.321559  7408300.704630 
-323962.189406  7408173.676388 
-323987.381641  7408069.404249 
-324226.802701  7408091.700430 
-324388.098973  7408147.140934 
-324473.785555  7408232.826257 
-324605.832447  7408468.165945 
-324674.861644  7408739.399485 
-324786.292958  7408782.232148 
-324947.589230  7408767.114738 
-325164.324910  7408757.036464 
-325209.695671  7408787.281284 
-325270.173526  7408757.036464 
-325426.431351  7408741.909055 
-325541.730148  7409353.814242 
-Region 1
-171
-320590.668529  7394417.702662 
-320570.011721  7394476.472595 
-320568.543892  7394484.331249 
-320549.453868  7394530.903272 
-320537.991607  7394560.358227 
-320525.820171  7394599.411537 
-320479.657772  7394708.622830 
-320405.985947  7394870.235148 
-320381.700798  7394935.883902 
-320372.349572  7394970.877908 
-320365.571171  7395000.312866 
-320356.698227  7395038.366348 
-320352.756528  7395105.674819 
-320351.461870  7395155.456292 
-320350.060011  7395177.552507 
-320353.531674  7395239.561885 
-320358.553628  7395296.252175 
-320366.404040  7395347.883331 
-320377.330296  7395439.667609 
-320387.250511  7395528.912322 
-320407.123927  7395687.585143 
-320383.778848  7395733.017361 
-320392.660038  7395796.126551 
-320390.804637  7395835.439817 
-320377.305557  7395872.873405 
-320334.886947  7395944.311168 
-320267.944046  7396038.704999 
-320230.844254  7396050.452987 
-320282.383196  7396157.084722 
-320290.316070  7396178.331083 
-320297.745924  7396227.812607 
-320295.115376  7396267.875744 
-320296.665667  7396294.611165 
-320309.612250  7396320.956652 
-320315.293903  7396337.903749 
-320320.695184  7396358.880156 
-320322.509354  7396382.846051 
-320329.972193  7396399.303232 
-320337.888574  7396422.069332 
-320344.320634  7396470.031117 
-320340.510876  7396529.990846 
-320329.164062  7396582.821797 
-320323.012374  7396620.585328 
-320312.721079  7396667.877228 
-320308.449531  7396692.792960 
-320307.484722  7396717.488730 
-320306.231295  7396745.463938 
-320321.915626  7396777.378471 
-320432.208961  7396888.099506 
-320457.615597  7396909.775793 
-320584.657027  7397045.872481 
-320602.031835  7397059.150206 
-320621.393984  7397076.227281 
-320632.691320  7397088.945103 
-320646.742897  7397104.962359 
-320661.569620  7397119.469874 
-320672.083564  7397133.687439 
-320681.377066  7397143.615738 
-320687.149427  7397149.714693 
-320695.445135  7397158.113255 
-320697.943743  7397171.510960 
-320700.013547  7397186.898324 
-320696.706809  7397217.623061 
-320702.874989  7397270.414019 
-320706.478592  7397280.662263 
-320708.424702  7397312.206860 
-320758.627755  7397294.119958 
-320872.565923  7397259.935813 
-320954.607672  7397239.429326 
-321025.253130  7397232.590497 
-321089.062463  7397223.472059 
-321155.156001  7397230.310888 
-321439.873607  7397044.702681 
-321435.824708  7396919.844068 
-321439.766406  7396810.552789 
-321460.010902  7396574.223270 
-321538.275877  7396361.519704 
-321734.049639  7396143.926976 
-321851.319285  7396032.046140 
-321998.324839  7395885.191295 
-322149.478247  7395741.825852 
-322323.325281  7395595.220964 
-322440.265078  7395484.729890 
-322541.866886  7395376.308462 
-322679.249088  7395255.479159 
-322778.038931  7395159.315631 
-322908.486054  7395063.202094 
-322960.626970  7395008.331493 
-323055.293698  7394922.096264 
-323196.576368  7394782.140237 
-323287.581769  7394707.702988 
-323222.428301  7394645.443652 
-323177.948133  7394563.257730 
-323163.756370  7394483.771345 
-323167.590867  7394443.338271 
-323165.661249  7394282.015904 
-323146.868090  7394239.923114 
-323124.116739  7394203.979271 
-323100.408826  7394172.134726 
-323080.222053  7394152.618069 
-323037.861167  7394125.962635 
-322826.287627  7394000.014208 
-322499.473014  7393798.698692 
-322483.970100  7393790.020179 
-322461.342443  7393780.821754 
-322433.618616  7393774.642813 
-322410.224060  7393772.543172 
-322370.271072  7393773.443018 
-322325.782658  7393760.095304 
-322267.292144  7393743.938072 
-322216.957152  7393724.751359 
-322189.521943  7393709.693938 
-322171.487436  7393692.626861 
-322145.858151  7393666.661309 
-322121.762665  7393638.156191 
-322102.466486  7393618.809505 
-322078.090628  7393600.462648 
-322053.442644  7393586.944963 
-322023.187224  7393575.926851 
-322000.048301  7393570.017863 
-321977.148519  7393570.717743 
-321931.068582  7393580.216116 
-321820.602076  7393594.613650 
-321795.921108  7393597.333184 
-321770.992752  7393593.703806 
-321743.021538  7393586.764994 
-321701.056470  7393575.976842 
-321647.876529  7393577.586566 
-321632.299399  7393601.152530 
-321610.117039  7393620.119281 
-321570.609348  7393647.164648 
-321457.446324  7393720.942011 
-321396.284032  7393764.414565 
-321374.109918  7393778.562141 
-321350.121633  7393807.667156 
-321335.558789  7393830.223292 
-321293.321596  7393931.615924 
-321281.306838  7393952.402364 
-321273.143070  7393963.540456 
-321264.476281  7393969.349461 
-321253.789166  7393974.908509 
-321237.733755  7393980.437562 
-321218.643731  7393983.177093 
-321193.204110  7393980.307584 
-321166.758448  7393971.599076 
-321150.769007  7393966.229995 
-321121.767014  7393954.462011 
-321074.227494  7393937.314948 
-321027.446627  7393920.407844 
-321018.515960  7393917.648317 
-320963.406400  7393897.361792 
-320927.296156  7393881.784460 
-320884.333295  7393867.696873 
-320871.873240  7393865.367272 
-320856.856854  7393865.837192 
-320833.181926  7393869.826508 
-320814.339289  7393877.375215 
-320801.838003  7393888.513308 
-320795.463667  7393897.891701 
-320782.426376  7393918.408187 
-320775.507789  7393938.444755 
-320752.146217  7394000.004210 
-320741.500333  7394022.800305 
-320727.094169  7394061.873613 
-320706.561054  7394115.714390 
-320681.830609  7394182.982868 
-320666.599821  7394221.756226 
-320639.230581  7394292.724070 
-320620.866225  7394345.954952 
-320601.792694  7394391.277189 
-320590.668529  7394417.702662 
-Region 1
-367
-318137.109801  7391777.094974 
-318157.115156  7391774.235464 
-318196.969189  7391732.072686 
-318223.695223  7391681.961270 
-318227.034946  7391625.160999 
-318223.695223  7391571.710155 
-318214.137841  7391495.123274 
-318218.656776  7391494.383400 
-318301.754042  7391488.984325 
-318315.739649  7391480.505777 
-318345.689959  7391473.866915 
-318363.872897  7391466.138238 
-318401.483955  7391421.005969 
-318416.706497  7391401.979228 
-318436.703606  7391384.842164 
-318459.537419  7391372.474282 
-318492.843945  7391351.537868 
-318529.960229  7391318.223575 
-318537.876610  7391297.777077 
-318537.571500  7391283.019605 
-318537.571500  7391264.932703 
-318538.528062  7391239.237105 
-318545.191017  7391202.123462 
-318555.474066  7391179.767291 
-318567.076513  7391161.200472 
-318590.866888  7391132.645363 
-318610.863998  7391112.658786 
-318629.888052  7391096.481557 
-318646.792825  7391084.673580 
-318682.226878  7391045.090360 
-318700.310861  7391022.254272 
-318733.617387  7391000.368021 
-318753.606250  7390978.471771 
-318762.174084  7390959.445030 
-318769.793601  7390943.267801 
-318778.369681  7390925.270884 
-318782.146454  7390912.813018 
-318790.722534  7390902.344811 
-318937.299284  7390809.060790 
-318937.282792  7390809.070788 
-318987.271442  7390814.669829 
-319066.641412  7390823.018399 
-319134.516136  7390826.917731 
-319184.323369  7390825.817920 
-319230.625954  7390827.097700 
-319257.846762  7390828.927387 
-319269.333761  7390824.218194 
-319273.869188  7390822.668459 
-319311.801849  7390817.509343 
-319347.417319  7390807.781009 
-319391.575884  7390795.883047 
-319422.441525  7390783.725130 
-319451.781614  7390766.388099 
-319471.993125  7390752.570466 
-319478.821004  7390744.891781 
-319552.113502  7390704.138762 
-319596.387515  7390685.212004 
-319685.826132  7390644.648952 
-319734.948928  7390627.411905 
-319806.550949  7390607.835258 
-319851.113579  7390596.317231 
-319968.152331  7390592.297919 
-319999.999274  7390582.759553 
-320113.203528  7390565.742468 
-320132.029673  7390564.162739 
-320158.302163  7390560.743324 
-320194.626809  7390557.223927 
-320220.313818  7390552.494737 
-320311.682053  7390535.307681 
-320451.686557  7390505.742746 
-320557.296033  7390478.787363 
-320638.051370  7390469.119019 
-320688.007035  7390463.140043 
-320707.633064  7390460.790445 
-320736.816474  7390489.175583 
-320761.200579  7390516.360927 
-320776.398382  7390531.958255 
-320793.410355  7390535.337676 
-320878.437240  7390555.024304 
-320898.450841  7390566.862276 
-320914.242373  7390600.816460 
-320924.467699  7390629.651521 
-320936.968985  7390660.776190 
-320951.927647  7390682.132532 
-321029.780311  7390696.800019 
-321064.793806  7390702.978961 
-321093.548412  7390702.069117 
-321154.793167  7390664.825496 
-321187.712120  7390647.498464 
-321202.753245  7390642.259361 
-321218.750932  7390643.389168 
-321227.640369  7390645.238851 
-321239.036660  7390650.397967 
-321251.158619  7390662.955816 
-321258.398809  7390684.132189 
-321263.593934  7390714.377008 
-321266.686271  7390736.613200 
-321272.656542  7390757.269661 
-321281.240868  7390766.488082 
-321293.346335  7390780.055758 
-321330.042061  7390805.251442 
-321344.505950  7390808.660858 
-321359.769722  7390807.751014 
-321380.921304  7390800.012340 
-321401.042107  7390794.293319 
-321427.792879  7390785.574813 
-321449.109385  7390790.304003 
-321469.840409  7390808.510884 
-321479.067941  7390834.276471 
-321477.666082  7390855.142896 
-321474.466545  7390877.509065 
-321474.326359  7390898.115536 
-321482.547851  7390924.141078 
-321492.261910  7390953.975967 
-321492.187694  7390965.434005 
-321483.636353  7390987.410240 
-321476.536348  7390998.948264 
-321453.776752  7391046.600102 
-321437.366753  7391066.846634 
-321431.676854  7391082.583938 
-321433.589979  7391099.900972 
-321439.354094  7391113.428654 
-321459.549113  7391134.954967 
-321485.557725  7391161.340448 
-321495.082121  7391182.266863 
-321498.017779  7391198.074155 
-321494.109066  7391213.061588 
-321477.253770  7391235.417759 
-321469.337389  7391267.862201 
-321466.121359  7391293.547802 
-321479.496745  7391308.125305 
-321510.700482  7391357.716810 
-321521.280396  7391371.794399 
-321537.673902  7391392.260893 
-321559.443951  7391405.388644 
-321591.934100  7391413.507254 
-321610.479873  7391414.147144 
-321628.547364  7391410.957690 
-321684.077481  7391393.790631 
-321748.546513  7391367.525130 
-321795.014022  7391341.369610 
-321817.996267  7391324.482503 
-321839.955979  7391310.384918 
-321869.526962  7391297.097194 
-321894.447071  7391295.997382 
-321907.888427  7391301.936365 
-321924.850924  7391312.244599 
-321926.326999  7391319.383376 
-321931.818989  7391335.190669 
-321933.773345  7391347.678530 
-321936.412139  7391370.604603 
-321937.360456  7391376.423606 
-321948.121787  7391407.328312 
-321976.249679  7391420.496057 
-322011.279667  7391428.634663 
-322040.232183  7391431.894104 
-322059.759257  7391431.684140 
-322075.047769  7391433.403846 
-322106.507139  7391443.292152 
-322127.708198  7391466.588161 
-322135.740026  7391481.915536 
-322139.920865  7391502.821955 
-322141.363956  7391517.079513 
-322150.377086  7391536.476190 
-322164.189522  7391562.791683 
-322169.219723  7391570.200414 
-322226.712443  7391602.414896 
-322368.531118  7391684.830778 
-322422.972732  7391717.525178 
-322482.436301  7391757.128395 
-322548.703011  7391847.932841 
-322556.776071  7391855.881479 
-322567.908482  7391864.609984 
-322581.102451  7391869.279184 
-322662.278346  7391893.764990 
-322692.723429  7391904.153210 
-322706.420418  7391907.812584 
-322718.097081  7391909.932221 
-322733.360854  7391909.022376 
-322766.197344  7391902.633471 
-322799.091558  7391887.836005 
-322866.661172  7391863.280212 
-322906.746099  7391867.469494 
-322776.703042  7391931.958448 
-322650.156387  7391999.996793 
-322563.909060  7392044.009254 
-322555.448428  7392051.328001 
-322549.882222  7392055.577273 
-322537.908695  7392066.175458 
-322529.175937  7392079.143236 
-322489.643507  7392130.264480 
-322473.381940  7392157.059890 
-322449.302947  7392184.045268 
-322409.201527  7392233.856735 
-322367.079781  7392291.606843 
-322301.893328  7392374.662616 
-322394.119171  7392445.280520 
-322405.647402  7392453.929039 
-322421.793521  7392481.394334 
-322426.188762  7392503.430560 
-322424.720933  7392522.537287 
-322415.913959  7392544.573512 
-322402.678759  7392556.331498 
-322419.501069  7392592.515300 
-322361.060033  7392681.410073 
-322272.322345  7392799.509844 
-322163.966874  7392944.624987 
-322253.578662  7393013.393208 
-322182.619848  7393104.547594 
-322113.953485  7393197.501672 
-322046.054022  7393285.626577 
-322094.401672  7393384.509639 
-322023.187224  7393575.926851 
-322000.048301  7393570.017863 
-321977.148519  7393570.717743 
-321931.068582  7393580.216116 
-321820.602076  7393594.613650 
-321795.921108  7393597.333184 
-321770.992752  7393593.703806 
-321743.021538  7393586.764994 
-321701.056470  7393575.976842 
-321647.876529  7393577.586566 
-321632.299399  7393601.152530 
-321610.117039  7393620.119281 
-321570.609348  7393647.164648 
-321457.446324  7393720.942011 
-321396.284032  7393764.414565 
-321374.109918  7393778.562141 
-321350.121633  7393807.667156 
-321335.558789  7393830.223292 
-321293.321596  7393931.615924 
-321281.306838  7393952.402364 
-321273.143070  7393963.540456 
-321264.476281  7393969.349461 
-321253.789166  7393974.908509 
-321237.733755  7393980.437562 
-321218.643731  7393983.177093 
-321193.204110  7393980.307584 
-321166.758448  7393971.599076 
-321150.769007  7393966.229995 
-321121.767014  7393954.462011 
-321074.227494  7393937.314948 
-321027.446627  7393920.407844 
-321018.515960  7393917.648317 
-320963.406400  7393897.361792 
-320927.296156  7393881.784460 
-320884.333295  7393867.696873 
-320871.873240  7393865.367272 
-320856.856854  7393865.837192 
-320833.181926  7393869.826508 
-320814.339289  7393877.375215 
-320801.838003  7393888.513308 
-320795.463667  7393897.891701 
-320782.426376  7393918.408187 
-320775.507789  7393938.444755 
-320752.146217  7394000.004210 
-320741.500333  7394022.800305 
-320727.094169  7394061.873613 
-320706.561054  7394115.714390 
-320681.830609  7394182.982868 
-320666.599821  7394221.756226 
-320639.230581  7394292.724070 
-320620.866225  7394345.954952 
-320601.792694  7394391.277189 
-320590.668529  7394417.702662 
-320555.721003  7394311.490855 
-320515.982418  7394179.643440 
-320499.193092  7394133.031424 
-320452.016407  7393999.974215 
-320430.963780  7393935.585245 
-320424.886308  7393921.887591 
-320416.079333  7393907.939980 
-320407.420791  7393898.191650 
-320388.141104  7393888.103378 
-320376.151085  7393875.325567 
-320299.147783  7393842.591174 
-320254.230565  7393816.785594 
-320219.942738  7393798.638702 
-320201.083608  7393788.440449 
-320185.110659  7393774.952759 
-320172.213555  7393761.175119 
-320163.266394  7393749.317151 
-320156.908550  7393735.069591 
-320151.391822  7393718.492431 
-320147.326430  7393699.725645 
-320143.343501  7393683.948348 
-320149.750822  7393662.422035 
-320153.610058  7393647.204642 
-320158.986601  7393628.947769 
-320139.401803  7393628.377866 
-320126.422236  7393629.857613 
-320107.332212  7393631.337359 
-319947.099704  7393498.110180 
-319934.408755  7393475.274092 
-319944.559865  7393454.977568 
-320017.868856  7393370.632016 
-319972.860929  7393270.229214 
-319955.766493  7393280.517452 
-319942.836403  7393284.136832 
-319933.526408  7393281.547275 
-319927.663338  7393273.868591 
-319912.737661  7393190.252913 
-319898.306757  7393106.667231 
-319887.858783  7393049.167080 
-319874.829739  7393026.740921 
-319861.066780  7393009.263915 
-319836.286857  7392990.347155 
-319794.000186  7392960.032348 
-319730.100145  7393005.004645 
-319463.590216  7392947.154554 
-319397.224552  7392932.737023 
-319321.598371  7392916.339832 
-319274.866982  7392900.972464 
-319263.314013  7392893.533739 
-319249.757209  7392880.026052 
-319238.723753  7392866.528364 
-319138.185709  7392698.427159 
-319115.607529  7392510.169405 
-319084.799612  7392285.237934 
-318991.584220  7392249.454064 
-318954.401966  7392234.186679 
-318931.287782  7392228.897585 
-318910.672205  7392229.957403 
-318884.779041  7392231.207189 
-318859.133264  7392230.687278 
-318841.544054  7392227.987741 
-318806.613021  7392220.059099 
-318783.490590  7392213.260263 
-318759.122978  7392202.412121 
-318734.499734  7392195.343332 
-318696.558827  7392185.614999 
-318663.639874  7392176.446569 
-318627.422429  7392173.527069 
-318588.178617  7392146.651673 
-318574.836216  7392137.953163 
-318561.139227  7392130.404456 
-318541.348273  7392120.576139 
-318523.462199  7392111.137756 
-318505.592617  7392106.278588 
-318488.547658  7392113.227398 
-318475.056825  7392077.453526 
-318454.416510  7392119.136386 
-318445.757968  7392132.164154 
-318438.963074  7392137.533235 
-318430.642627  7392142.922311 
-318420.021482  7392144.122106 
-318410.909397  7392144.172097 
-318395.711594  7392140.052803 
-318378.617158  7392139.382918 
-318364.994385  7392174.656876 
-318311.451609  7392168.307963 
-318311.484594  7392148.871292 
-318314.535699  7392129.214659 
-318322.625252  7392098.509919 
-318330.945698  7392082.192714 
-318333.757663  7392054.207508 
-318327.507020  7392035.460719 
-318314.956257  7392021.203161 
-318302.908514  7392009.725127 
-318278.813028  7391988.778715 
-318265.256225  7391975.520986 
-318245.679673  7391958.153961 
-318228.362589  7391939.557146 
-318218.079539  7391921.020321 
-318214.343997  7391898.774132 
-318149.404931  7391793.632142 
-318137.109801  7391777.094974 
-Region 1
-691
-315576.902572  7387892.880305 
-315576.877833  7387892.920298 
-315585.132310  7387913.956695 
-315592.141606  7387931.943614 
-315595.464837  7387937.512660 
-315600.082726  7387945.351317 
-315604.280058  7387956.599391 
-315607.339409  7387964.917966 
-315604.733600  7387985.594424 
-315596.874942  7388017.508957 
-315583.153215  7388061.421436 
-315583.177953  7388061.501422 
-315571.039502  7388094.955692 
-315563.807558  7388118.011742 
-315552.444252  7388144.677175 
-315547.059463  7388168.353119 
-315546.993493  7388168.403111 
-315541.773629  7388185.620162 
-315538.854464  7388207.066488 
-315547.348081  7388229.222693 
-315558.760864  7388254.838305 
-315570.783869  7388281.243782 
-315575.822316  7388294.151571 
-315581.759602  7388309.408958 
-315590.797470  7388329.125580 
-315595.209204  7388343.133181 
-315595.687485  7388353.771359 
-315592.562164  7388358.720511 
-315585.165295  7388362.719826 
-315573.529863  7388362.469869 
-315568.491417  7388365.509348 
-315565.324864  7388373.997894 
-315567.526608  7388385.205974 
-315569.934507  7388404.732630 
-315570.066447  7388426.448910 
-315560.022538  7388445.815592 
-315545.245292  7388468.331736 
-315525.561540  7388491.677737 
-315509.473144  7388504.435551 
-315493.228069  7388513.533993 
-315471.837347  7388526.221820 
-315457.843494  7388535.570218 
-315445.045344  7388546.818292 
-315434.036626  7388561.735736 
-315426.450094  7388572.273931 
-315422.285747  7388586.621474 
-315427.530350  7388599.869204 
-315443.569268  7388614.586683 
-315456.194248  7388625.594798 
-315456.218986  7388625.604796 
-315456.235479  7388625.624793 
-315473.412377  7388635.783053 
-315473.461855  7388635.813048 
-315493.665120  7388644.041638 
-315517.999746  7388649.330732 
-315538.689539  7388651.700326 
-315553.442046  7388655.319706 
-315563.321030  7388657.439343 
-315573.208260  7388658.229208 
-315581.974004  7388663.848245 
-315576.778878  7388678.955658 
-315568.408954  7388687.274233 
-315553.870850  7388698.832253 
-315546.424503  7388706.600922 
-315537.535067  7388714.909499 
-315530.088720  7388731.096726 
-315527.903469  7388742.144834 
-315527.680821  7388751.553222 
-315525.949113  7388776.119014 
-315520.300445  7388794.545858 
-315512.062460  7388808.183522 
-315491.875688  7388830.519696 
-315482.136889  7388842.137706 
-315471.895071  7388861.064464 
-315460.845122  7388879.191359 
-315452.640122  7388898.807999 
-315447.428504  7388915.025221 
-315444.608294  7388928.392931 
-315445.746273  7388951.448982 
-315448.352082  7388979.504176 
-315445.886459  7388996.751222 
-315440.732565  7389016.957761 
-315439.058580  7389028.005868 
-315438.943133  7389053.371524 
-315440.872751  7389070.568578 
-315451.304233  7389092.854760 
-315462.337689  7389116.250753 
-315476.669638  7389137.367136 
-315491.463376  7389162.032911 
-315505.737601  7389187.908479 
-315519.253173  7389216.763536 
-315529.775364  7389232.070914 
-315539.538901  7389259.446225 
-315554.810920  7389287.111486 
-315570.478758  7389323.195305 
-315580.209310  7389352.780238 
-315586.319767  7389378.445841 
-315588.942069  7389405.061282 
-315589.370873  7389427.767393 
-315587.655657  7389450.343526 
-315582.650195  7389474.759344 
-315579.236255  7389494.765917 
-315580.926732  7389514.282574 
-315586.319767  7389531.739583 
-315597.147068  7389547.716847 
-315612.798414  7389561.314518 
-315612.847891  7389561.354511 
-315625.002835  7389568.263327 
-315639.367769  7389578.971493 
-315652.141180  7389585.890308 
-315661.632592  7389602.397480 
-315666.860702  7389616.865002 
-315664.197169  7389633.562142 
-315662.721094  7389639.291161 
-315660.395657  7389648.089654 
-315659.637004  7389654.498556 
-315658.969059  7389659.747657 
-315660.585320  7389669.126050 
-315661.772778  7389676.244831 
-315663.116913  7389683.223636 
-315664.881607  7389692.712010 
-315664.428064  7389698.591003 
-315663.859074  7389705.289856 
-315659.373124  7389720.957172 
-315659.529803  7389740.673795 
-315661.129572  7389752.631747 
-315663.116913  7389767.899131 
-315669.540727  7389792.684886 
-315677.234460  7389822.139841 
-315686.396022  7389845.975758 
-315690.923203  7389857.823728 
-315695.458630  7389868.191952 
-315704.859333  7389889.828246 
-315722.935070  7389921.842762 
-315746.230672  7389960.466146 
-315762.310822  7389989.131236 
-315774.977032  7390020.865801 
-315782.448117  7390051.750510 
-315789.168795  7390069.007554 
-315804.712940  7390091.353727 
-315815.944306  7390115.529586 
-315820.430255  7390131.756806 
-315819.531416  7390154.452918 
-315803.558467  7390191.026654 
-315798.280880  7390212.562965 
-315787.527795  7390231.479724 
-315777.896198  7390242.317868 
-315771.942419  7390261.184636 
-315767.398746  7390281.731117 
-315764.322902  7390298.628222 
-315763.160183  7390299.558063 
-315751.846355  7390308.556522 
-315735.337401  7390322.954056 
-315734.240653  7390323.903893 
-315724.378161  7390331.292627 
-315709.873041  7390342.150767 
-315709.831810  7390342.200759 
-315709.823564  7390342.200759 
-315700.093011  7390352.269034 
-315690.321228  7390362.387301 
-315668.410993  7390386.223218 
-315646.030723  7390405.529911 
-315626.404694  7390423.896765 
-315598.812807  7390450.792158 
-315591.885973  7390457.351035 
-315586.905250  7390463.649956 
-315581.875049  7390469.908884 
-315579.739275  7390477.407599 
-315577.554024  7390484.866321 
-315586.072380  7390505.352812 
-315601.814435  7390528.028928 
-315610.398761  7390543.536272 
-315619.815956  7390557.613860 
-315629.183674  7390571.741441 
-315635.335362  7390581.729730 
-315641.437573  7390591.778008 
-315645.552442  7390601.026424 
-315649.626080  7390610.324832 
-315654.243969  7390622.022828 
-315656.206572  7390627.081961 
-315661.137818  7390640.759618 
-315668.460471  7390659.246452 
-315669.054199  7390659.986325 
-315674.133877  7390666.455217 
-315682.676972  7390668.724828 
-315691.178836  7390671.044433 
-315700.653755  7390670.484527 
-315711.250161  7390669.914624 
-315721.557950  7390670.314556 
-315732.731592  7390670.794474 
-315751.714415  7390670.924451 
-315770.771454  7390665.735340 
-315795.675071  7390658.076652 
-315805.298422  7390657.626729 
-315814.113643  7390657.256793 
-315824.602848  7390659.356433 
-315831.876023  7390660.856176 
-315835.875445  7390662.665866 
-315844.723651  7390666.725171 
-315857.925866  7390674.483842 
-315862.502524  7390677.193378 
-315879.926809  7390679.852922 
-315889.715085  7390680.402828 
-315900.492909  7390681.052717 
-315923.203028  7390684.992042 
-315935.506404  7390689.871206 
-315941.732308  7390692.370778 
-315956.138473  7390699.309589 
-315966.602940  7390704.548692 
-315979.335120  7390710.957594 
-316023.089620  7390730.564236 
-316046.195558  7390742.162249 
-316069.309742  7390750.220869 
-316085.035304  7390754.380156 
-316091.170500  7390756.009877 
-316124.905829  7390760.639084 
-316144.944170  7390760.009192 
-316180.163821  7390758.919379 
-316199.773357  7390757.859560 
-316213.124005  7390759.339307 
-316224.949100  7390760.679077 
-316243.981400  7390765.688219 
-316264.687685  7390770.917324 
-316265.611263  7390771.157282 
-316269.709640  7390772.057128 
-316317.174943  7390782.555330 
-316373.010171  7390793.163513 
-316380.209130  7390794.533278 
-316388.678009  7390795.703078 
-316437.289539  7390802.451922 
-316618.442734  7390839.395594 
-316694.885292  7390849.543856 
-316729.676139  7390854.463013 
-316748.147695  7390857.102561 
-316765.769890  7390858.652295 
-316787.135874  7390860.561968 
-316820.557847  7390858.102390 
-316853.353106  7390847.654179 
-316865.912115  7390839.285613 
-316866.753231  7390838.665719 
-316906.013535  7390809.730675 
-316933.127141  7390927.270542 
-316940.655950  7390959.964941 
-316968.132390  7391031.482691 
-316968.148883  7391031.522684 
-316974.481988  7391043.380653 
-316995.963419  7391083.603763 
-317017.939624  7391137.224578 
-317017.972608  7391137.264572 
-317132.603461  7391276.700687 
-317133.172451  7391277.440561 
-317171.492684  7391327.372008 
-317196.594211  7391352.607685 
-317214.735918  7391364.455656 
-317223.204797  7391370.004705 
-317299.746310  7391407.608264 
-317461.388923  7391487.064654 
-317501.127508  7391507.301188 
-317505.291855  7391509.420825 
-317510.033437  7391512.470302 
-317537.213014  7391529.987302 
-317575.590971  7391563.921489 
-317603.191105  7391593.726384 
-317632.019927  7391631.859852 
-317650.194620  7391655.715766 
-317680.219146  7391695.199002 
-317709.814867  7391735.372121 
-317732.409539  7391757.308364 
-317752.736498  7391776.954998 
-317773.088195  7391786.243407 
-317802.733394  7391794.372015 
-317802.741640  7391794.372015 
-317842.199854  7391795.531816 
-317877.147380  7391795.891755 
-317907.312091  7391794.182048 
-317954.843365  7391785.333563 
-318076.788624  7391771.685901 
-318093.355301  7391769.886209 
-318100.158441  7391769.166333 
-318100.174934  7391769.166333 
-318100.174934  7391769.146336 
-318107.819189  7391768.676416 
-318124.814671  7391767.636595 
-318137.109801  7391777.094974 
-318157.115156  7391774.235464 
-318196.969189  7391732.072686 
-318223.695223  7391681.961270 
-318227.034946  7391625.160999 
-318223.695223  7391571.710155 
-318214.137841  7391495.123274 
-318218.656776  7391494.383400 
-318301.754042  7391488.984325 
-318315.739649  7391480.505777 
-318345.689959  7391473.866915 
-318363.872897  7391466.138238 
-318401.483955  7391421.005969 
-318416.706497  7391401.979228 
-318436.703606  7391384.842164 
-318459.537419  7391372.474282 
-318492.843945  7391351.537868 
-318529.960229  7391318.223575 
-318537.876610  7391297.777077 
-318537.571500  7391283.019605 
-318537.571500  7391264.932703 
-318538.528062  7391239.237105 
-318545.191017  7391202.123462 
-318555.474066  7391179.767291 
-318567.076513  7391161.200472 
-318590.866888  7391132.645363 
-318610.863998  7391112.658786 
-318629.888052  7391096.481557 
-318646.792825  7391084.673580 
-318682.226878  7391045.090360 
-318700.310861  7391022.254272 
-318733.617387  7391000.368021 
-318753.606250  7390978.471771 
-318762.174084  7390959.445030 
-318769.793601  7390943.267801 
-318778.369681  7390925.270884 
-318782.146454  7390912.813018 
-318790.722534  7390902.344811 
-318937.282792  7390809.070788 
-318937.299284  7390809.060790 
-318937.282792  7390809.070788 
-318987.271442  7390814.669829 
-319066.641412  7390823.018399 
-319134.516136  7390826.917731 
-319184.323369  7390825.817920 
-319230.625954  7390827.097700 
-319257.846762  7390828.927387 
-319269.333761  7390824.218194 
-319273.869188  7390822.668459 
-319311.801849  7390817.509343 
-319347.417319  7390807.781009 
-319391.575884  7390795.883047 
-319422.441525  7390783.725130 
-319451.781614  7390766.388099 
-319471.993125  7390752.570466 
-319478.821004  7390744.891781 
-319552.113502  7390704.138762 
-319596.387515  7390685.212004 
-319685.826132  7390644.648952 
-319734.948928  7390627.411905 
-319806.550949  7390607.835258 
-319851.113579  7390596.317231 
-319968.152331  7390592.297919 
-319999.999274  7390582.759553 
-320113.203528  7390565.742468 
-320132.029673  7390564.162739 
-320158.302163  7390560.743324 
-320194.626809  7390557.223927 
-320220.313818  7390552.494737 
-320311.682053  7390535.307681 
-320451.686557  7390505.742746 
-320557.296033  7390478.787363 
-320638.051370  7390469.119019 
-320688.007035  7390463.140043 
-320707.633064  7390460.790445 
-320891.309606  7390458.760793 
-320876.697285  7390395.441639 
-320866.422482  7390373.225445 
-320858.143266  7390356.628287 
-320820.251836  7390282.311017 
-320813.028138  7390259.114991 
-320848.330252  7390142.754922 
-320917.648066  7390122.468397 
-320970.052862  7390110.630425 
-321044.640018  7390024.795128 
-321074.120293  7390026.544828 
-321070.929002  7390008.537912 
-321069.106585  7389989.461180 
-321068.207745  7389969.464605 
-321061.841655  7389951.297717 
-321040.071607  7389930.811226 
-321023.843025  7389921.752778 
-321002.823383  7389913.524187 
-320895.968726  7389869.121793 
-320769.413824  7389817.840577 
-320625.327436  7389754.821372 
-320564.288837  7389725.306427 
-320531.073020  7389702.870270 
-320419.567489  7389627.903112 
-320402.027756  7389574.232305 
-320376.390225  7389522.751123 
-320358.149563  7389505.934004 
-320341.863258  7389510.383242 
-320329.394957  7389511.563040 
-320305.794245  7389513.482711 
-320301.184602  7389489.616799 
-320292.938371  7389463.261313 
-320290.283085  7389446.834127 
-320283.603638  7389425.487783 
-320275.876920  7389406.231082 
-320270.343699  7389391.323635 
-320265.445438  7389374.756473 
-320252.622550  7389355.219820 
-320238.076199  7389334.663341 
-320223.175260  7389317.306314 
-320212.620085  7389304.328537 
-320195.756543  7389289.611058 
-320175.586263  7389277.843074 
-320155.605646  7389267.524841 
-320140.160456  7389261.685841 
-320121.655914  7389255.696867 
-320099.737433  7389245.678583 
-320079.229058  7389236.230202 
-320065.845425  7389229.311387 
-320047.992336  7389211.704403 
-320029.891860  7389181.239621 
-320016.871062  7389161.363026 
-320004.279067  7389147.365423 
-319987.093923  7389134.077699 
-319963.880783  7389120.610006 
-319949.532342  7389109.141971 
-319926.360434  7389092.794771 
-319902.067039  7389076.437573 
-319890.777949  7389064.219665 
-319876.429507  7389052.751630 
-319859.714398  7389042.243430 
-319848.367585  7389035.344611 
-319831.883370  7389031.375291 
-319810.657572  7389030.775394 
-319791.336653  7389025.116363 
-319784.360342  7389020.897086 
-319767.628740  7389010.758823 
-319754.228616  7389004.829838 
-319736.779591  7388995.861375 
-319721.400371  7388985.153209 
-319705.303729  7388965.786526 
-319693.049830  7388949.579302 
-319683.937745  7388943.710308 
-319670.595344  7388933.242101 
-319656.156194  7388928.522909 
-319637.635160  7388924.413613 
-319621.942583  7388922.233986 
-319600.947680  7388919.314486 
-319589.625606  7388910.426009 
-319578.699350  7388902.757322 
-319567.830818  7388898.628030 
-319553.721517  7388892.259121 
-319540.799674  7388888.329794 
-319521.965283  7388892.749037 
-319493.779667  7388902.477370 
-319471.473613  7388906.416696 
-319442.595313  7388906.166738 
-319419.555345  7388903.777148 
-319390.149286  7388904.297059 
-319366.573313  7388904.117090 
-319346.229862  7388906.526677 
-319289.924599  7388944.930099 
-319275.708097  7388955.158347 
-319264.798334  7388963.007002 
-319246.730843  7388970.975637 
-319226.659517  7388975.934788 
-319204.064845  7388979.534171 
-319176.439973  7388976.304724 
-319142.539719  7388969.245934 
-319105.530635  7388956.928043 
-319080.800190  7388943.330373 
-319052.812483  7388927.923012 
-319040.443137  7388921.794062 
-319016.966118  7388905.216901 
-319002.312566  7388893.518905 
-318985.671673  7388877.141710 
-318975.941121  7388862.954140 
-318967.744368  7388832.499357 
-318962.813122  7388810.733085 
-318958.648775  7388784.427591 
-318954.987449  7388766.660635 
-318953.074323  7388748.363769 
-318951.458062  7388730.176884 
-318943.714851  7388712.909842 
-318932.681395  7388697.162539 
-318919.817275  7388681.155281 
-318907.695316  7388670.487108 
-318895.589849  7388658.929088 
-318889.627825  7388646.341244 
-318884.861503  7388635.423114 
-318882.709237  7388619.665813 
-318881.068237  7388603.698548 
-318882.379388  7388588.541145 
-318882.931885  7388577.143097 
-318876.763705  7388563.775387 
-318868.187625  7388556.356658 
-318852.008520  7388551.947413 
-318832.926743  7388551.817435 
-318818.685502  7388555.956726 
-318808.278759  7388563.475438 
-318800.065514  7388575.663351 
-318794.713710  7388587.781275 
-318780.711610  7388597.029691 
-318767.492903  7388601.508924 
-318752.270361  7388602.878689 
-318733.938990  7388607.297932 
-318717.479514  7388609.757511 
-318706.883107  7388608.407742 
-318694.967304  7388606.038148 
-318679.472637  7388604.188465 
-318657.405723  7388613.876805 
-318633.673072  7388626.874579 
-318603.409405  7388638.902518 
-318575.190804  7388650.850472 
-318558.698343  7388655.739634 
-318542.667670  7388664.288170 
-318523.346752  7388674.796370 
-318511.958707  7388679.745522 
-318498.253472  7388681.685190 
-318485.768679  7388684.184762 
-318477.662634  7388679.325594 
-318469.432896  7388668.587434 
-318463.907921  7388653.120083 
-318459.009660  7388636.112996 
-318451.027309  7388613.636846 
-318442.311043  7388592.050544 
-318434.551340  7388575.553369 
-318425.777351  7388558.836233 
-318416.755974  7388537.679857 
-318411.799990  7388525.541936 
-318406.497664  7388516.943409 
-318398.474081  7388505.775322 
-318384.554444  7388500.836168 
-318365.118078  7388495.937007 
-318348.130843  7388491.187821 
-318337.278803  7388485.628773 
-318315.541739  7388477.380186 
-318297.795851  7388475.940432 
-318283.546365  7388480.969571 
-318264.975853  7388488.708245 
-318239.833096  7388491.277805 
-318222.854107  7388494.167310 
-318202.139576  7388493.357449 
-318187.650948  7388493.177480 
-318166.606568  7388494.357278 
-318150.328508  7388498.586553 
-318127.981223  7388506.505197 
-318110.218843  7388514.693794 
-318092.332768  7388524.992030 
-318074.017890  7388536.510057 
-318063.083388  7388545.788468 
-318052.338550  7388556.066707 
-318032.085807  7388559.796069 
-318015.370698  7388557.596445 
-318000.981025  7388549.217881 
-317974.642565  7388533.050650 
-317959.246852  7388523.342313 
-317936.800612  7388506.555188 
-317915.690262  7388488.678250 
-317889.912545  7388468.971626 
-317870.467933  7388456.213811 
-317852.359210  7388443.695955 
-317840.987658  7388438.346872 
-317811.886710  7388431.558035 
-317782.719792  7388429.428399 
-317750.988297  7388428.138620 
-317722.843912  7388425.909002 
-317703.160159  7388424.779196 
-317676.038307  7388422.889519 
-317659.306705  7388421.789708 
-317644.611922  7388413.851068 
-317635.071033  7388401.333212 
-317627.847335  7388390.934993 
-317608.913989  7388370.768447 
-317583.499106  7388346.302638 
-317571.418378  7388332.415017 
-317553.524058  7388310.478774 
-317541.501054  7388292.721816 
-317528.983275  7388273.625087 
-317514.923452  7388255.058267 
-317502.521121  7388242.830362 
-317486.696605  7388226.793109 
-317478.607052  7388220.714150 
-317464.720400  7388212.785508 
-317449.753491  7388210.385919 
-317432.799241  7388211.275767 
-317408.901665  7388211.865666 
-317391.427902  7388213.535380 
-317370.853557  7388218.474534 
-317355.342397  7388234.571777 
-317350.196749  7388245.909834 
-317345.265503  7388256.478024 
-317338.289192  7388275.444775 
-317337.481061  7388291.382045 
-317336.631699  7388302.010225 
-317330.414041  7388317.657545 
-317318.160143  7388326.146091 
-317300.645149  7388331.135236 
-317275.296236  7388334.244703 
-317248.949529  7388335.024570 
-317222.099802  7388335.464495 
-317196.165407  7388336.244361 
-317167.567479  7388337.884080 
-317131.506712  7388340.093702 
-317110.454085  7388342.043368 
-317083.818760  7388341.593445 
-317067.953012  7388329.325546 
-317055.361018  7388315.877850 
-317034.019773  7388291.901956 
-317020.380508  7388272.575267 
-317008.860524  7388255.588177 
-317002.576896  7388243.660220 
-316991.559932  7388227.133051 
-316982.010797  7388215.155102 
-316971.686516  7388208.056318 
-316960.859215  7388200.607594 
-316947.442598  7388196.228344 
-316935.007282  7388195.188523 
-316909.798555  7388203.067173 
-316887.162652  7388217.404717 
-316870.661944  7388230.932400 
-316859.884121  7388243.530242 
-316842.534051  7388260.037415 
-316831.517087  7388275.404782 
-316820.021842  7388296.641145 
-316810.695355  7388316.347769 
-316796.899411  7388333.904762 
-316782.616940  7388349.232136 
-316757.935971  7388364.309554 
-316737.625505  7388372.478154 
-316729.948264  7388374.327838 
-316717.042913  7388377.427307 
-316688.139875  7388378.727084 
-316664.572148  7388377.877230 
-316631.620210  7388376.907396 
-316607.227860  7388376.487468 
-316570.309485  7388373.697946 
-316543.171140  7388372.808098 
-316520.370313  7388367.868944 
-316499.680520  7388357.520717 
-316483.369476  7388331.625152 
-316466.365748  7388295.631318 
-316458.655522  7388275.824710 
-316447.704528  7388245.669876 
-316440.736463  7388223.313705 
-316424.672806  7388193.868749 
-316421.250620  7388174.332095 
-316415.890570  7388145.687002 
-316416.533776  7388118.891592 
-316416.195681  7388096.955349 
-316416.294636  7388081.008081 
-316414.711359  7388061.271461 
-316406.316696  7388055.072523 
-316392.858848  7388053.802741 
-316371.097045  7388055.402467 
-316350.761841  7388057.482110 
-316329.750445  7388056.322309 
-316310.792361  7388053.982710 
-316286.424749  7388052.013047 
-316257.299062  7388054.422634 
-316234.679652  7388059.561754 
-316213.618779  7388062.511249 
-316200.647458  7388063.121144 
-316190.059298  7388060.991509 
-316183.206680  7388053.932718 
-316178.250695  7388042.014760 
-316171.257892  7388030.296767 
-316160.686224  7388018.638764 
-316136.186673  7388002.721490 
-316115.191770  7387992.263282 
-316081.151330  7387971.786789 
-316062.630296  7387967.337551 
-316028.194036  7387962.808327 
-316003.636762  7387959.398911 
-315982.336748  7387956.469413 
-315958.859729  7387948.750735 
-315946.201765  7387940.512146 
-315930.517434  7387930.343888 
-315916.490596  7387917.536082 
-315902.381295  7387903.068560 
-315892.955854  7387897.639490 
-315872.999976  7387893.730160 
-315862.552001  7387896.699651 
-315847.824233  7387899.389190 
-315832.651169  7387896.539678 
-315814.435246  7387892.100439 
-315791.123152  7387886.941323 
-315773.434987  7387881.732215 
-315762.574701  7387876.603093 
-315744.408255  7387868.844422 
-315729.944366  7387866.224871 
-315716.519503  7387862.185563 
-315698.278841  7387859.735983 
-315686.074419  7387864.675137 
-315674.892531  7387869.404326 
-315654.821205  7387874.143515 
-315642.171487  7387881.622234 
-315627.592152  7387888.641031 
-315610.398761  7387892.080442 
-315599.678661  7387892.720333 
-315576.910818  7387892.870307 
-315576.910818  7387892.880305 
-315576.902572  7387892.880305 
-Region 1
-2805
-319142.053191  7356557.657745 
-319143.191171  7356532.931980 
-319149.672708  7356527.922838 
-319142.267593  7356517.524620 
-319134.375950  7356505.246723 
-319122.831227  7356491.589062 
-319111.896726  7356478.711268 
-319100.591143  7356470.702640 
-319090.555481  7356466.703325 
-319076.940954  7356463.873809 
-319063.516090  7356462.704010 
-319048.565674  7356461.184270 
-319035.239765  7356459.694525 
-319021.311882  7356457.744859 
-319002.931034  7356453.745544 
-318985.778874  7356449.096341 
-318968.503021  7356446.006870 
-318952.637273  7356443.807247 
-318943.088138  7356442.027552 
-318930.298234  7356438.658129 
-318913.434693  7356435.228716 
-318887.953840  7356429.149757 
-318870.166720  7356425.830326 
-318853.616535  7356422.180951 
-318840.513275  7356419.361434 
-318826.288527  7356416.851864 
-318804.848327  7356412.932535 
-318794.581770  7356411.142842 
-318759.535290  7356404.274018 
-318749.672798  7356402.824267 
-318732.380452  7356400.724626 
-318714.073820  7356399.274875 
-318684.049295  7356397.235224 
-318668.076346  7356396.035430 
-318651.600377  7356394.275731 
-318626.894670  7356391.086277 
-318599.748079  7356387.526887 
-318580.006603  7356386.177118 
-318565.155141  7356384.767360 
-318547.945258  7356384.217454 
-318533.910173  7356383.047654 
-318517.442451  7356380.728052 
-318500.158351  7356377.968524 
-318483.096900  7356374.209168 
-318462.266921  7356370.179858 
-318445.007561  7356365.970579 
-318423.484899  7356360.941441 
-318408.674668  7356356.322232 
-318390.417514  7356350.333258 
-318381.684755  7356348.003657 
-318354.422717  7356345.334114 
-318317.397141  7356341.984688 
-318283.711289  7356339.795063 
-318262.666909  7356337.315488 
-318240.393840  7356334.256012 
-318225.443423  7356332.746270 
-318211.499047  7356332.566301 
-318200.201711  7356331.866421 
-318186.479984  7356329.476830 
-318173.681834  7356326.887274 
-318155.729790  7356321.118262 
-318142.750222  7356316.519050 
-318131.197253  7356311.609891 
-318120.460661  7356307.050672 
-318106.293637  7356300.111860 
-318087.079919  7356289.343705 
-318075.419749  7356285.104431 
-318061.219740  7356280.265260 
-318052.899293  7356278.165620 
-318048.429836  7356277.005818 
-318036.629480  7356276.085976 
-318018.306356  7356275.186130 
-317994.672659  7356276.105972 
-317973.949881  7356279.715354 
-317947.941270  7356282.714840 
-317920.984342  7356288.023931 
-317900.673876  7356291.753292 
-317871.787330  7356296.812426 
-317848.631914  7356299.841907 
-317825.987765  7356302.221499 
-317805.594836  7356304.401126 
-317783.362998  7356306.990682 
-317769.682502  7356309.150312 
-317747.359955  7356310.970001 
-317729.094555  7356313.399584 
-317705.732983  7356316.539047 
-317686.956316  7356319.728500 
-317664.204966  7356322.767980 
-317649.312273  7356324.907613 
-317624.524104  7356328.027079 
-317605.846391  7356330.886589 
-317590.739297  7356333.796091 
-317576.737197  7356337.605438 
-317558.364595  7356340.584928 
-317534.598959  7356343.834371 
-317488.881856  7356350.453237 
-317433.178568  7356358.161917 
-317404.712580  7356362.121239 
-317376.147637  7356366.080561 
-317348.407317  7356369.489977 
-317325.655966  7356372.199512 
-317307.398812  7356374.619098 
-317290.452808  7356377.838547 
-317267.973583  7356383.317608 
-317252.132574  7356387.766846 
-317241.280534  7356391.946130 
-317230.717113  7356397.795128 
-317207.875054  7356407.923393 
-317190.351814  7356416.891857 
-317181.734503  7356421.321098 
-317164.409172  7356430.519523 
-317153.334485  7356436.468504 
-317145.047023  7356439.248028 
-317133.906365  7356442.317502 
-317119.409492  7356445.117022 
-317104.533292  7356446.036865 
-317092.221669  7356445.217005 
-317081.237690  7356443.417313 
-317053.596325  7356438.858094 
-317039.198406  7356433.798961 
-317020.331030  7356427.690007 
-317004.432298  7356420.731199 
-316988.640766  7356412.892542 
-316970.721707  7356404.683948 
-316954.311708  7356397.945102 
-316931.725282  7356387.686860 
-316918.547806  7356383.197629 
-316902.121314  7356377.118670 
-316893.083445  7356375.119012 
-316876.706431  7356373.359314 
-316855.109553  7356373.859228 
-316832.399434  7356373.679259 
-316821.201053  7356373.869226 
-316811.808596  7356375.308980 
-316801.599763  7356377.388624 
-316791.275482  7356380.138153 
-316780.448181  7356382.877683 
-316765.332840  7356386.237108 
-316750.382424  7356392.136097 
-316740.132359  7356397.435190 
-316731.003782  7356402.634299 
-316717.224331  7356413.202489 
-316702.513055  7356424.870490 
-316692.823734  7356433.938937 
-316686.869956  7356445.047034 
-316681.650092  7356455.065318 
-316674.764489  7356475.911747 
-316671.762861  7356487.719725 
-316670.682605  7356500.887469 
-316668.967389  7356523.463602 
-316670.847529  7356551.848740 
-316671.870062  7356567.256101 
-316672.364836  7356600.940331 
-316673.478077  7356624.986212 
-316674.813966  7356648.152244 
-316675.275755  7356667.768884 
-316674.442886  7356685.365870 
-316674.220238  7356718.700160 
-316673.708971  7356735.207332 
-316672.224650  7356747.815173 
-316669.256007  7356773.030854 
-316665.998746  7356796.686802 
-316661.100485  7356821.772505 
-316657.818485  7356839.569456 
-316652.367727  7356859.216091 
-316647.923008  7356872.553806 
-316638.926371  7356891.050638 
-316632.255170  7356903.258547 
-316626.021020  7356912.596947 
-316609.149232  7356933.873303 
-316589.952007  7356953.789891 
-316568.115988  7356973.006600 
-316547.253024  7356987.694084 
-316529.053593  7357001.081791 
-316509.435811  7357014.129556 
-316484.408501  7357027.767220 
-316466.893507  7357035.515892 
-316451.019513  7357042.514694 
-316434.444589  7357048.613649 
-316420.318796  7357054.312673 
-316399.777436  7357059.801732 
-316377.314703  7357063.841041 
-316357.317594  7357066.690552 
-316344.173102  7357067.180469 
-316328.917576  7357065.110823 
-316305.737421  7357061.931368 
-316287.133925  7357059.141845 
-316269.940534  7357057.602109 
-316251.897781  7357059.141845 
-316235.570245  7357061.371464 
-316222.887542  7357065.750713 
-316210.914015  7357070.139962 
-316200.045483  7357075.868980 
-316189.564524  7357082.827788 
-316176.840590  7357090.196526 
-316160.521300  7357099.954855 
-316143.698989  7357109.593204 
-316125.046015  7357118.551669 
-316113.765172  7357124.830594 
-316101.577243  7357129.659766 
-316088.688384  7357133.929035 
-316079.889656  7357137.468429 
-316068.196501  7357143.417410 
-316051.085573  7357151.616005 
-316039.309955  7357156.445178 
-316029.802051  7357159.654629 
-316018.966504  7357162.174197 
-316011.726314  7357162.854080 
-316005.830259  7357162.554132 
-316002.292626  7357160.184538 
-315998.870440  7357156.925096 
-315999.719802  7357154.055588 
-315998.581822  7357147.846651 
-315995.192621  7357142.147627 
-315991.498310  7357135.898698 
-315986.633034  7357126.200359 
-315982.114100  7357113.072608 
-315981.940929  7357103.104315 
-315986.731989  7357094.415803 
-315994.994712  7357085.877266 
-315998.787978  7357083.377694 
-316003.793440  7357082.227891 
-316011.940716  7357082.327874 
-316027.047810  7357079.968278 
-316048.974538  7357077.818646 
-316060.313105  7357074.859153 
-316070.991973  7357068.460249 
-316079.205219  7357063.251142 
-316085.002319  7357056.122363 
-316091.046806  7357045.014265 
-316094.963766  7357033.876173 
-316096.299655  7357024.587764 
-316098.089087  7357011.869943 
-316097.454128  7357006.210912 
-316093.784555  7356998.082304 
-316089.199651  7356990.273642 
-316081.118345  7356985.514457 
-316072.377340  7356983.744760 
-316062.984884  7356985.284497 
-316057.971175  7356987.654091 
-316053.823321  7356992.923188 
-316046.739809  7357005.231080 
-316042.897066  7357011.170063 
-316036.027956  7357014.739451 
-316032.564539  7357015.019403 
-316027.633293  7357010.310210 
-316025.472780  7357004.081277 
-316024.054429  7356995.312779 
-316023.881258  7356985.334488 
-316024.862559  7356979.815433 
-316028.490901  7356967.337571 
-316034.551880  7356955.009682 
-316039.120292  7356940.452176 
-316040.983940  7356921.755379 
-316038.988352  7356903.008590 
-316035.013669  7356895.199927 
-316026.058263  7356886.671388 
-316021.143509  7356880.732405 
-316017.746062  7356875.043380 
-316016.896700  7356870.384178 
-316017.894494  7356863.855296 
-316019.469524  7356859.895974 
-316028.260006  7356857.456392 
-316036.085679  7356858.556204 
-316042.954789  7356863.295392 
-316050.161995  7356865.265055 
-316054.854100  7356864.335214 
-316058.960723  7356862.275567 
-316061.789180  7356855.996642 
-316063.842491  7356846.718232 
-316065.631924  7356826.251737 
-316065.838079  7356810.304469 
-316064.741331  7356800.326178 
-316060.461537  7356792.517516 
-316057.360954  7356787.818321 
-316045.931679  7356773.610754 
-316040.151071  7356763.902417 
-316038.732719  7356755.243900 
-316038.823428  7356748.045133 
-316041.396252  7356738.106836 
-316044.018553  7356732.487798 
-316049.964085  7356729.238355 
-316055.967341  7356729.318341 
-316062.481863  7356729.628288 
-316070.612647  7356731.278006 
-316076.632395  7356730.138201 
-316080.021596  7356728.298516 
-316083.212887  7356725.568983 
-316084.210681  7356719.380044 
-316081.522410  7356714.360903 
-316078.100224  7356711.211443 
-316073.465843  7356707.052155 
-316064.865024  7356694.544298 
-316060.189411  7356686.395693 
-316060.981049  7356680.206754 
-316063.174547  7356675.797509 
-316068.938662  7356671.218293 
-316075.741802  7356672.308107 
-316079.180480  7356674.787682 
-316081.357485  7356679.136937 
-316084.672470  7356683.276228 
-316091.549826  7356686.795625 
-316097.454128  7356686.875611 
-316103.218243  7356682.516358 
-316105.758082  7356674.787682 
-316110.334740  7356659.560290 
-316116.527659  7356644.802818 
-316122.654608  7356627.705747 
-316131.741955  7356602.350090 
-316144.993647  7356569.505716 
-316154.072747  7356551.898732 
-316162.615842  7356544.809946 
-316171.101214  7356542.370364 
-316179.858710  7356542.820287 
-316183.899363  7356545.079900 
-316185.952675  7356551.978718 
-316185.259992  7356558.167658 
-316181.400756  7356565.326432 
-316176.972530  7356569.585702 
-316172.214455  7356575.064763 
-316168.685068  7356580.003917 
-316167.101792  7356584.743106 
-316165.411314  7356589.372313 
-316166.672988  7356594.041513 
-316168.767530  7356597.840862 
-316171.274384  7356600.970326 
-316178.440359  7356606.049456 
-316187.131886  7356611.138584 
-316199.633172  7356613.188233 
-316206.452804  7356613.828124 
-316216.554437  7356612.068425 
-316223.134929  7356607.169264 
-316231.059557  7356601.070309 
-316240.509737  7356594.321465 
-316264.935072  7356572.255245 
-316294.110236  7356544.609980 
-316312.796195  7356524.903356 
-316325.899455  7356511.115717 
-316333.205616  7356497.807997 
-316341.245690  7356481.740749 
-316344.230826  7356471.812450 
-316344.313288  7356465.273570 
-316341.295168  7356454.265455 
-316335.745455  7356450.206151 
-316326.303521  7356447.546606 
-316292.221849  7356444.667099 
-316279.135081  7356440.737772 
-316271.383624  7356433.768966 
-316267.400695  7356426.630189 
-316264.827871  7356412.532604 
-316262.725082  7356377.948528 
-316263.030193  7356354.022626 
-316266.048313  7356341.324801 
-316270.921835  7356326.097409 
-316281.773875  7356305.970857 
-316293.615462  7356287.843962 
-316302.274004  7356271.996676 
-316305.341602  7356254.649648 
-316303.915004  7356238.792364 
-316302.224527  7356227.584284 
-316301.507105  7356211.956961 
-316298.860065  7356196.299643 
-316291.751814  7356186.351347 
-316280.611157  7356181.452186 
-316272.480373  7356180.462355 
-316254.998364  7356177.132926 
-316250.652601  7356174.533371 
-316248.186978  7356168.634381 
-316247.675711  7356160.865712 
-316248.706490  7356151.797265 
-316254.750977  7356140.689168 
-316259.228680  7356133.320430 
-316264.448544  7356123.422126 
-316266.691519  7356115.033563 
-316265.891635  7356106.275063 
-316264.159926  7356097.826510 
-316260.490354  7356090.367788 
-316253.332626  7356084.618772 
-316246.743887  7356082.099204 
-316237.400908  7356079.769603 
-316233.063391  7356076.940088 
-316231.298697  7356071.271059 
-316229.171170  7356062.602544 
-316229.253632  7356056.073662 
-316230.861647  7356049.774741 
-316232.560371  7356044.595628 
-316232.609848  7356040.496330 
-316232.362461  7356036.167072 
-316231.109034  7356030.508041 
-316223.868843  7356015.130675 
-316222.021688  7356008.571799 
-316223.283361  7356004.932422 
-316226.482899  7356001.872946 
-316231.537838  7355996.943790 
-316238.217285  7355992.274590 
-316241.713687  7355989.215114 
-316243.907184  7355985.255792 
-316243.066068  7355979.036858 
-316239.701606  7355971.798098 
-316232.684064  7355962.959612 
-316227.109612  7355952.921331 
-316225.064547  7355945.472607 
-316224.528542  7355939.813576 
-316225.204733  7355934.284523 
-316223.357577  7355927.395703 
-316219.366401  7355920.806832 
-316207.854664  7355913.458091 
-316201.735960  7355906.289319 
-316198.635378  7355901.600122 
-316196.565574  7355896.261036 
-316196.029569  7355890.272062 
-316193.588684  7355881.823509 
-316189.267660  7355877.774203 
-316182.390303  7355873.924862 
-316170.820842  7355870.675419 
-316162.129315  7355865.246349 
-316159.408058  7355863.106715 
-316157.824782  7355859.647308 
-316158.154631  7355857.777628 
-316158.921531  7355853.458368 
-316162.368455  7355846.969480 
-316166.532802  7355839.820704 
-316171.694942  7355834.021697 
-316173.937917  7355825.633134 
-316172.544304  7355815.314902 
-316163.926993  7355804.346780 
-316154.600506  7355793.258680 
-316138.289462  7355770.672549 
-316123.536955  7355753.315522 
-316101.313364  7355723.460636 
-316092.720791  7355710.062930 
-316080.450400  7355689.966373 
-316075.585124  7355680.268034 
-316072.270139  7355668.700016 
-316071.247607  7355653.072692 
-316071.090928  7355641.884609 
-316072.154692  7355630.046637 
-316076.417993  7355615.479132 
-316086.651565  7355571.406681 
-316090.362369  7355552.179974 
-316091.104530  7355541.561793 
-316090.263414  7355536.012744 
-316088.185364  7355531.003602 
-316083.856093  7355527.514199 
-316075.733556  7355525.194597 
-316064.139356  7355523.824831 
-316059.166879  7355522.545051 
-316054.837608  7355518.725705 
-316052.347246  7355514.366451 
-316051.802995  7355509.047363 
-316051.868965  7355504.398159 
-316051.943181  7355498.409185 
-316050.079533  7355492.850137 
-316044.834930  7355489.020793 
-316035.203332  7355485.131459 
-316021.069293  7355483.401755 
-316009.582294  7355482.031990 
-315999.241521  7355478.462601 
-315992.784722  7355473.733412 
-315989.115149  7355466.154710 
-315986.377401  7355457.146253 
-315983.120140  7355440.929031 
-315975.846964  7355420.232576 
-315968.573789  7355408.064660 
-315953.656358  7355395.696779 
-315934.154022  7355375.840180 
-315928.035319  7355368.561427 
-315924.679103  7355360.432819 
-315924.802797  7355350.464526 
-315925.289324  7355336.516915 
-315927.251927  7355326.238676 
-315926.130440  7355318.470007 
-315923.038103  7355313.440868 
-315916.911154  7355306.502057 
-315906.628104  7355298.613408 
-315899.610562  7355289.774922 
-315896.806844  7355286.085554 
-315896.914045  7355277.886958 
-315895.858527  7355264.799200 
-315895.091628  7355253.051212 
-315892.370371  7355242.712983 
-315889.624377  7355234.264430 
-315888.230764  7355224.276141 
-315888.964678  7355214.317847 
-315891.009743  7355198.170613 
-315893.359919  7355189.452106 
-315893.434135  7355183.573113 
-315892.263170  7355179.793761 
-315889.137849  7355177.324184 
-315886.004281  7355175.064571 
-315882.235754  7355175.014579 
-315876.636563  7355174.944591 
-315873.766875  7355176.454333 
-315865.561876  7355181.333497 
-315861.447006  7355184.382975 
-315854.924238  7355184.632932 
-315848.640610  7355182.113363 
-315843.107390  7355176.734285 
-315837.615400  7355168.245739 
-315832.700646  7355154.778046 
-315826.713883  7355136.981094 
-315823.638039  7355130.402221 
-315818.698547  7355126.902820 
-315812.101562  7355124.933158 
-315800.919674  7355123.573391 
-315795.229774  7355122.283612 
-315791.197368  7355119.134151 
-315788.797714  7355115.884708 
-315788.871931  7355110.015713 
-315785.862056  7355098.127749 
-315785.334298  7355091.918813 
-315782.547072  7355087.229616 
-315779.100147  7355085.639888 
-315771.991896  7355084.330113 
-315766.293751  7355083.920183 
-315762.549962  7355081.660570 
-315759.548334  7355077.851223 
-315757.363083  7355073.172024 
-315755.911747  7355067.283033 
-315751.937064  7355059.474370 
-315746.288396  7355055.305085 
-315739.180145  7355053.995309 
-315721.277578  7355052.215614 
-315707.267232  7355048.936175 
-315700.356891  7355047.516419 
-315695.755494  7355041.587434 
-315694.287665  7355036.588291 
-315694.427851  7355025.400207 
-315695.409152  7355020.431058 
-315696.984182  7355016.681700 
-315698.649921  7355013.932171 
-315699.631223  7355008.963023 
-315699.680700  7355004.863725 
-315698.534474  7354999.314675 
-315696.349223  7354995.185383 
-315691.088128  7354992.015925 
-315683.905661  7354988.486530 
-315671.148742  7354982.457563 
-315664.733174  7354974.948849 
-315657.649662  7354963.340837 
-315656.833285  7354955.132243 
-315657.872311  7354945.843834 
-315659.818421  7354937.115329 
-315663.991014  7354929.416648 
-315669.078938  7354921.727965 
-315675.189395  7354913.389393 
-315679.716575  7354901.931356 
-315681.035972  7354894.522625 
-315680.244334  7354884.544334 
-315677.523078  7354874.536049 
-315671.709486  7354867.267294 
-315660.774984  7354862.468116 
-315649.931190  7354858.568784 
-315638.699824  7354852.549815 
-315630.033036  7354845.241067 
-315624.128735  7354837.412408 
-315621.448710  7354831.733380 
-315620.558117  7354821.855072 
-315620.863227  7354798.489075 
-315623.782393  7354769.284077 
-315624.301906  7354752.456960 
-315625.225483  7354727.881169 
-315625.406900  7354713.813579 
-315624.598770  7354705.165060 
-315621.226062  7354698.586187 
-315614.802248  7354691.297436 
-315607.957876  7354685.008513 
-315598.342771  7354679.899388 
-315591.432430  7354679.149517 
-315583.342878  7354674.720275 
-315581.545200  7354671.930753 
-315580.027893  7354662.832312 
-315580.473190  7354652.314113 
-315583.120230  7354644.255494 
-315587.647410  7354632.797456 
-315595.687485  7354617.280114 
-315603.067862  7354605.192185 
-315607.867168  7354596.283711 
-315612.996323  7354585.715521 
-315614.282735  7354580.526410 
-315610.621409  7354572.617765 
-315605.393299  7354567.008727 
-315594.186671  7354559.659984 
-315579.623828  7354551.391400 
-315566.611276  7354541.923022 
-315563.205583  7354537.443789 
-315561.333688  7354532.544629 
-315563.411738  7354521.606502 
-315571.055994  7354513.287927 
-315575.822316  7354506.809037 
-315581.479230  7354501.899878 
-315583.796421  7354496.390821 
-315584.497350  7354489.202053 
-315584.307687  7354480.453551 
-315582.171913  7354472.114980 
-315576.086195  7354462.066701 
-315569.274808  7354453.228215 
-315567.270974  7354442.570041 
-315564.607442  7354428.242495 
-315563.551924  7354415.164735 
-315564.533226  7354410.185588 
-315568.054366  7354405.586375 
-315574.305009  7354402.226951 
-315577.471562  7354401.607057 
-315583.351124  7354403.896665 
-315586.476446  7354406.486221 
-315589.238933  7354413.055096 
-315591.877727  7354421.723611 
-315600.082726  7354440.880330 
-315602.869952  7354446.129431 
-315607.512580  7354449.618833 
-315612.163454  7354451.898443 
-315617.861599  7354452.628318 
-315623.790639  7354450.828626 
-315626.693312  7354446.769321 
-315632.407950  7354437.860847 
-315634.692156  7354434.131486 
-315639.730603  7354430.762063 
-315644.727819  7354429.602262 
-315650.038391  7354429.012363 
-315655.431426  7354428.742409 
-315661.047109  7354427.602604 
-315666.085556  7354424.233181 
-315669.268601  7354421.833592 
-315670.538521  7354418.084235 
-315669.070692  7354413.415034 
-315665.054777  7354409.045783 
-315657.608431  7354402.076977 
-315644.900990  7354392.278655 
-315633.158357  7354379.280881 
-315626.363463  7354369.002642 
-315620.574609  7354360.174154 
-315611.281107  7354354.185180 
-315594.763907  7354347.436336 
-315582.963551  7354338.537860 
-315578.700250  7354330.059313 
-315578.502341  7354321.310811 
-315580.423712  7354314.581964 
-315582.180159  7354304.853630 
-315585.066340  7354294.035483 
-315588.059722  7354282.887393 
-315590.492360  7354267.630006 
-315593.461003  7354250.612921 
-315594.920586  7354239.994740 
-315594.706184  7354225.037302 
-315593.370294  7354209.849903 
-315593.568204  7354194.562522 
-315596.305953  7354179.975021 
-315599.505490  7354168.496987 
-315606.597248  7354155.189266 
-315615.833027  7354141.571599 
-315624.821418  7354123.964615 
-315631.269970  7354113.186461 
-315635.475548  7354103.278158 
-315637.100056  7354095.209540 
-315638.609116  7354080.941984 
-315640.596457  7354068.784067 
-315642.567306  7354057.945923 
-315646.781130  7354047.037792 
-315650.986708  7354036.899528 
-315657.608431  7354012.613688 
-315663.034451  7354002.715384 
-315666.011340  7353992.787084 
-315667.949204  7353984.498504 
-315666.497868  7353978.499532 
-315661.055356  7353966.361611 
-315656.115863  7353954.773596 
-315650.162085  7353934.427081 
-315645.989492  7353918.199860 
-315642.682754  7353905.971955 
-315638.130834  7353895.953671 
-315632.531644  7353887.795068 
-315620.500393  7353881.106214 
-315611.371816  7353878.546653 
-315599.208626  7353873.957439 
-315594.895847  7353868.698340 
-315592.562164  7353860.249787 
-315594.516520  7353850.861395 
-315600.379590  7353838.193565 
-315606.407585  7353828.305259 
-315612.155208  7353816.857219 
-315614.843479  7353806.039072 
-315616.550449  7353791.771516 
-315615.330007  7353775.914233 
-315619.873680  7353762.906461 
-315631.838960  7353759.287081 
-315649.518879  7353753.977990 
-315662.531431  7353747.719062 
-315681.299852  7353729.572171 
-315704.884071  7353716.474414 
-315729.565040  7353705.606276 
-315754.592350  7353691.298726 
-315772.156821  7353679.670718 
-315765.279465  7353668.282669 
-315757.701179  7353663.763443 
-315742.940426  7353663.233534 
-315725.730543  7353663.013571 
-315710.796619  7353660.504001 
-315694.749454  7353649.655860 
-315693.529012  7353633.248670 
-315694.774193  7353607.793030 
-315697.594404  7353578.468053 
-315700.373383  7353552.032582 
-315702.871991  7353532.125991 
-315706.920890  7353502.381086 
-315701.602072  7353480.384854 
-315697.025414  7353448.090386 
-315696.827504  7353423.944522 
-315697.091383  7353379.522131 
-315696.275007  7353371.653479 
-315700.596031  7353344.458137 
-315708.215549  7353321.512068 
-315729.762949  7353300.855606 
-315748.564355  7353279.719226 
-315747.038803  7353255.993290 
-315744.457732  7353227.158230 
-315740.961331  7353189.674650 
-315749.801290  7353159.659791 
-315766.821510  7353110.698178 
-315782.324423  7353068.585392 
-315801.307246  7353025.732732 
-315807.673336  7352989.928865 
-315819.820034  7352939.797452 
-315835.537350  7352896.904799 
-315855.839570  7352846.433444 
-315879.407297  7352795.012252 
-315895.652371  7352750.909807 
-315903.073979  7352695.949221 
-315910.924390  7352655.296184 
-315919.797335  7352606.884477 
-315929.676319  7352574.669995 
-315951.017564  7352546.364843 
-315972.564964  7352517.179842 
-315986.237215  7352482.905713 
-315997.394365  7352438.513317 
-315991.811667  7352389.481716 
-315971.014673  7352256.404511 
-315971.781573  7352212.442041 
-315976.556140  7352165.540075 
-315988.463697  7352134.565381 
-316009.343153  7352110.129566 
-316038.782197  7352084.923884 
-316063.372456  7352056.878688 
-316074.249235  7352026.443901 
-316074.265727  7351993.659517 
-316078.058993  7351951.726699 
-316083.608706  7351907.594259 
-316099.383746  7351860.502325 
-316111.250071  7351824.428504 
-316126.216980  7351784.635321 
-316128.517678  7351748.001596 
-316120.370403  7351716.437002 
-316110.277016  7351693.270971 
-316102.632760  7351646.099051 
-316105.172599  7351614.894396 
-316107.003263  7351583.569761 
-316104.413946  7351554.844682 
-316103.638801  7351503.883411 
-316106.945539  7351460.280880 
-316115.620574  7351419.187918 
-316126.769478  7351375.245445 
-316147.319084  7351344.490713 
-316174.704816  7351321.024733 
-316205.397287  7351309.236752 
-316235.273380  7351313.496023 
-316262.222062  7351324.144199 
-316296.988171  7351336.322113 
-316319.821983  7351349.689823 
-316342.053821  7351362.817574 
-316370.775442  7351385.783640 
-316401.171049  7351413.538886 
-316415.700907  7351423.577167 
-316435.698016  7351436.015036 
-316455.736357  7351453.442051 
-316488.440908  7351459.511012 
-316516.354398  7351450.452563 
-316534.578568  7351442.373947 
-316561.048968  7351426.436677 
-316579.784404  7351418.368059 
-316609.157478  7351406.110159 
-316642.439265  7351399.001376 
-316664.967967  7351396.741763 
-316682.293298  7351395.521972 
-316706.083673  7351390.292868 
-316720.522823  7351367.766726 
-316723.351280  7351345.320571 
-316739.043857  7351320.374844 
-316757.853509  7351306.547213 
-316788.059452  7351301.278115 
-316819.007555  7351309.316738 
-316832.679806  7351314.915779 
-316850.640096  7351327.223671 
-316871.742200  7351341.451234 
-316896.043842  7351351.729474 
-316923.017263  7351352.069415 
-316942.461874  7351344.450720 
-316968.668395  7351332.932693 
-316993.703952  7351317.745295 
-317018.327196  7351302.887840 
-317041.738245  7351287.570463 
-317067.573686  7351273.162931 
-317111.451879  7351257.545606 
-317144.428555  7351249.996899 
-317194.112095  7351250.296848 
-317242.121650  7351245.807617 
-317263.405171  7351237.439050 
-317271.775095  7351219.382143 
-317274.512844  7351204.464699 
-317281.101582  7351182.728422 
-317295.054204  7351150.443952 
-317307.538998  7351113.390299 
-317318.457007  7351079.406120 
-317330.826353  7351050.881006 
-317346.865272  7351014.637214 
-317369.113602  7350970.724736 
-317381.837536  7350946.298920 
-317404.885750  7350911.694847 
-317435.314342  7350888.048898 
-317467.804490  7350871.181787 
-317494.464554  7350856.014385 
-317527.960743  7350848.245716 
-317557.119414  7350860.573604 
-317592.924548  7350879.310395 
-317628.853375  7350904.016163 
-317674.570478  7350935.610751 
-317704.256908  7350955.047422 
-317732.351816  7350979.213282 
-317758.756246  7350992.181061 
-317777.590637  7351008.588250 
-317799.896691  7351031.804274 
-317825.509483  7351059.039609 
-317853.414728  7351090.304253 
-317879.307892  7351112.010535 
-317900.030670  7351131.657170 
-317916.819995  7351140.065730 
-317943.174948  7351149.144175 
-317972.391344  7351149.184168 
-318009.087070  7351146.104695 
-318047.893831  7351136.296375 
-318103.522903  7351116.949689 
-318175.256864  7351088.284599 
-318218.623791  7351064.358698 
-318231.298247  7351052.220777 
-318257.199658  7351032.834097 
-318278.722320  7351021.476043 
-318307.889237  7351001.349490 
-318316.028267  7350985.722167 
-318327.671945  7350958.736790 
-318342.391466  7350921.593152 
-318355.090662  7350891.398324 
-318378.699620  7350859.913717 
-318400.972689  7350829.398944 
-318416.269447  7350811.422023 
-318436.827300  7350796.064654 
-318465.697353  7350783.026887 
-318493.124316  7350771.858800 
-318522.563360  7350754.061849 
-318544.844675  7350731.305746 
-318547.095896  7350706.410011 
-318540.993685  7350681.184332 
-318535.180093  7350658.408233 
-318524.839320  7350638.781595 
-318511.851506  7350611.256310 
-318506.293547  7350583.271103 
-318506.301793  7350550.486719 
-318512.387511  7350520.211905 
-318518.695878  7350504.564585 
-318536.515982  7350480.088778 
-318555.985333  7350461.721924 
-318574.036332  7350451.433686 
-318591.510094  7350453.983249 
-318607.466551  7350464.261489 
-318622.474690  7350476.629370 
-318638.695026  7350482.488367 
-318652.878543  7350471.370271 
-318659.747653  7350459.822249 
-318665.379828  7350432.756885 
-318670.203873  7350413.880119 
-318679.835471  7350392.733741 
-318702.661037  7350375.076765 
-318716.555936  7350362.738879 
-318728.479985  7350337.743160 
-318736.652000  7350318.906387 
-318746.753632  7350292.890843 
-318768.870023  7350267.135255 
-318783.787454  7350254.367442 
-318806.926377  7350244.249175 
-318831.722793  7350247.548610 
-318852.074490  7350256.337104 
-318872.269509  7350269.214898 
-318896.950477  7350282.152682 
-318918.489632  7350285.202160 
-318946.650510  7350280.342992 
-318974.242397  7350271.834450 
-319008.324069  7350257.526901 
-319027.306892  7350245.588945 
-319046.100051  7350232.751144 
-319069.205989  7350216.653902 
-319092.501591  7350201.986414 
-319117.339238  7350177.600591 
-319125.750393  7350164.192888 
-319137.361086  7350140.077019 
-319149.326366  7350119.410559 
-319159.411506  7350102.923383 
-319175.475164  7350095.924582 
-319202.580524  7350102.243499 
-319216.772287  7350115.161286 
-319239.309235  7350136.267671 
-319244.891933  7350145.426102 
-319261.409133  7350167.562311 
-319281.983479  7350191.078283 
-319299.432503  7350195.847466 
-319319.982110  7350188.788675 
-319340.069928  7350178.190490 
-319362.112102  7350165.842605 
-319386.174603  7350154.844489 
-319410.525722  7350153.044797 
-319434.118188  7350146.805866 
-319461.767799  7350134.198026 
-319472.199281  7350113.721533 
-319479.579658  7350085.456375 
-319478.021120  7350055.751463 
-319475.506020  7350021.167387 
-319467.350498  7349989.712775 
-319456.020177  7349967.746537 
-319441.028529  7349945.960269 
-319424.519576  7349914.515655 
-319412.620265  7349889.229986 
-319407.037567  7349864.014306 
-319409.841285  7349843.107887 
-319418.978109  7349828.940314 
-319432.106108  7349813.153018 
-319450.124122  7349797.205749 
-319473.477447  7349777.779077 
-319491.478968  7349762.941618 
-319519.169811  7349738.485808 
-319521.907560  7349723.118440 
-319510.296867  7349707.471120 
-319501.143551  7349698.162715 
-319487.924843  7349689.024280 
-319471.201487  7349675.406612 
-319457.273604  7349657.729640 
-319455.484172  7349629.794425 
-319458.048749  7349604.238803 
-319451.435272  7349579.563030 
-319435.932359  7349557.656782 
-319416.933043  7349546.458700 
-319393.810613  7349531.651236 
-319378.357176  7349522.262845 
-319355.787243  7349503.596042 
-319347.153440  7349485.649116 
-319351.523942  7349470.531706 
-319355.506871  7349460.943348 
-319384.203754  7349437.827308 
-319406.518054  7349419.940371 
-319419.233742  7349404.043095 
-319425.847219  7349380.307160 
-319425.286475  7349368.229229 
-319427.282063  7349354.851521 
-319430.135259  7349338.934247 
-319444.310529  7349328.586020 
-319465.346663  7349331.185574 
-319483.595572  7349336.944588 
-319495.066079  7349339.534144 
-319521.726142  7349340.753935 
-319536.932192  7349337.284530 
-319557.976572  7349323.376912 
-319568.053466  7349306.999717 
-319573.174375  7349296.421529 
-319585.650922  7349276.204992 
-319599.314927  7349257.548188 
-319620.870573  7349243.520591 
-319647.967687  7349233.892240 
-319664.963169  7349225.913607 
-319671.584892  7349217.575035 
-319667.676179  7349212.765859 
-319657.714732  7349195.578803 
-319635.977668  7349175.482245 
-319614.603438  7349151.176408 
-319609.466037  7349130.509948 
-319619.782071  7349103.284612 
-319641.560366  7349071.650030 
-319676.112073  7349059.792062 
-319708.602221  7349050.123718 
-319739.871928  7349040.545358 
-319752.975188  7349018.669106 
-319756.702485  7348988.914202 
-319769.723283  7348933.253737 
-319791.979859  7348911.717425 
-319816.545381  7348909.137867 
-319849.447841  7348923.175463 
-319883.776899  7348945.431651 
-319914.106535  7348969.847468 
-319932.000856  7348987.794394 
-319959.320618  7349001.102115 
-319984.751993  7348986.134678 
-319993.460013  7348965.748171 
-320003.685339  7348929.544372 
-320023.929835  7348898.119755 
-320057.228114  7348872.174199 
-320093.115710  7348859.996285 
-320108.890749  7348860.086269 
-320137.150582  7348878.933041 
-320153.395656  7348906.608301 
-320171.842474  7348929.434391 
-320194.898935  7348958.079484 
-320224.263762  7348978.386006 
-320246.759480  7348978.555977 
-320276.107814  7348959.319272 
-320295.775075  7348941.292360 
-320305.810737  7348920.255963 
-320316.530837  7348901.339203 
-320332.041997  7348865.865280 
-320358.578367  7348868.634805 
-320381.370949  7348877.343313 
-320405.680837  7348878.753072 
-320428.399202  7348860.986115 
-320444.734985  7348848.448263 
-320474.536863  7348834.090722 
-320500.759876  7348820.902981 
-320515.693800  7348815.223954 
-320530.611231  7348794.807451 
-320539.343989  7348771.651418 
-320556.207531  7348750.155100 
-320588.854358  7348727.628958 
-320623.439049  7348713.221426 
-320643.469144  7348715.131099 
-320668.257313  7348719.100419 
-320685.244548  7348719.640327 
-320699.238401  7348716.270904 
-320705.505537  7348694.864570 
-320700.211457  7348686.715966 
-320695.535844  7348661.950208 
-320690.876724  7348643.843310 
-320693.581487  7348615.078237 
-320691.956980  7348589.802567 
-320684.048845  7348555.248485 
-320663.746625  7348525.863519 
-320643.345450  7348505.007091 
-320619.085040  7348483.660748 
-320590.635544  7348454.945666 
-320569.978736  7348430.429866 
-320560.825420  7348405.064211 
-320573.854464  7348380.528413 
-320584.154007  7348363.151390 
-320596.036825  7348324.428023 
-320600.531021  7348298.672435 
-320603.285262  7348274.006660 
-320615.456698  7348236.273123 
-320632.880983  7348202.268948 
-320650.140344  7348173.123940 
-320671.539313  7348147.038408 
-320691.956980  7348133.890660 
-320717.322385  7348131.990986 
-320735.307414  7348134.650530 
-320755.865267  7348135.240429 
-320779.515457  7348131.881004 
-320804.889108  7348121.232828 
-320831.376001  7348103.505865 
-320848.973458  7348087.998521 
-320861.285080  7348072.201227 
-320885.603214  7348040.046735 
-320903.786153  7348018.450434 
-320928.038317  7347991.615031 
-320942.155864  7347961.450198 
-320941.281763  7347950.362097 
-320933.489075  7347930.435510 
-320924.014156  7347906.829554 
-320940.152030  7347877.464584 
-320950.501049  7347855.878281 
-320949.791873  7347839.481090 
-320942.625899  7347809.926152 
-320931.782106  7347773.792342 
-320918.068624  7347738.618367 
-320916.938890  7347715.342354 
-320925.218106  7347687.977041 
-320943.153658  7347661.831520 
-320955.745652  7347639.725306 
-320963.431139  7347618.888875 
-320971.182596  7347601.481857 
-320988.953223  7347596.282748 
-321003.062523  7347607.530821 
-321015.200975  7347621.748385 
-321033.449883  7347627.627378 
-321051.674053  7347635.056106 
-321062.971389  7347651.813236 
-321067.787188  7347681.888084 
-321077.600202  7347702.614534 
-321100.335060  7347716.082227 
-321119.598255  7347705.903970 
-321132.726254  7347689.786731 
-321146.497459  7347679.328523 
-321159.171916  7347666.300754 
-321176.225121  7347661.861514 
-321186.219552  7347652.133181 
-321207.560797  7347638.885450 
-321225.562319  7347648.083874 
-321237.832710  7347667.620528 
-321253.418086  7347691.626416 
-321275.765371  7347719.261682 
-321301.708012  7347753.035897 
-321323.205936  7347751.426173 
-321340.588990  7347736.908660 
-321356.141381  7347722.151187 
-321381.449063  7347700.084967 
-321398.221896  7347694.095993 
-321423.356407  7347694.295959 
-321454.065370  7347688.147012 
-321478.968986  7347674.939274 
-321497.184910  7347650.683429 
-321497.052970  7347627.977319 
-321490.167368  7347601.201905 
-321485.285599  7347567.797627 
-321489.466438  7347550.680559 
-321492.616498  7347526.794650 
-321481.368640  7347506.268166 
-321471.860736  7347485.331752 
-321472.000922  7347466.055054 
-321475.992097  7347439.859541 
-321478.012424  7347400.116349 
-321472.594650  7347377.120288 
-321452.655264  7347360.253177 
-321428.609256  7347362.172848 
-321390.223052  7347363.472626 
-321359.621290  7347360.653109 
-321339.096422  7347350.204898 
-321333.587940  7347334.737548 
-321332.252051  7347310.791650 
-321324.310931  7347286.545803 
-321313.623816  7347253.961384 
-321310.696404  7347235.984463 
-321305.690942  7347196.601209 
-321308.280258  7347176.244696 
-321319.140544  7347146.029872 
-321319.750765  7347130.202583 
-321314.794781  7347119.504415 
-321300.009289  7347121.654047 
-321287.120430  7347126.693184 
-321272.730758  7347146.229838 
-321259.726452  7347160.467399 
-321238.525393  7347179.814085 
-321219.468354  7347181.673766 
-321192.898999  7347173.705131 
-321175.614900  7347148.119514 
-321166.321398  7347126.073290 
-321150.991655  7347106.276681 
-321131.802676  7347102.937253 
-321114.048542  7347098.068087 
-321093.771060  7347091.609194 
-321075.588122  7347081.080997 
-321065.634922  7347063.124073 
-321070.335273  7347036.708598 
-321075.241780  7347019.041626 
-321088.938769  7346989.646659 
-321089.829362  7346958.861932 
-321089.400558  7346944.454400 
-321093.713337  7346917.259058 
-321111.417994  7346884.584655 
-321122.987456  7346863.018349 
-321134.507440  7346836.582877 
-321139.347977  7346799.529224 
-321136.263887  7346777.892930 
-321126.055053  7346747.748094 
-321114.724733  7346725.781856 
-321100.895804  7346716.863384 
-321044.013305  7346691.677698 
-321018.449990  7346676.400315 
-321003.565543  7346661.922795 
-320981.968665  7346631.308039 
-320968.527309  7346599.123552 
-320960.866561  7346569.128690 
-320952.612084  7346545.322767 
-320944.703949  7346518.527357 
-320931.048191  7346503.839873 
-320906.565132  7346491.801935 
-320878.725858  7346479.823987 
-320858.110281  7346460.177352 
-320850.606211  7346442.030460 
-320847.480890  7346414.965097 
-320849.311553  7346398.817862 
-320860.105869  7346381.780781 
-320873.910059  7346368.773009 
-320896.512977  7346359.864535 
-320916.922398  7346346.826768 
-320916.262700  7346326.650224 
-320907.043414  7346306.933601 
-320896.257344  7346282.427799 
-320886.032018  7346253.832697 
-320876.623069  7346224.477725 
-320873.934798  7346212.149837 
-320867.420275  7346195.672659 
-320843.423744  7346185.734362 
-320822.898876  7346183.264785 
-320797.995260  7346180.845199 
-320773.446231  7346174.666258 
-320760.408940  7346158.888960 
-320756.285825  7346130.593807 
-320756.648659  7346109.437431 
-320760.359463  7346081.242260 
-320767.987226  7346041.129131 
-320768.251106  7346012.224082 
-320760.969684  7345992.197513 
-320753.424383  7345984.788782 
-320735.975359  7345980.909446 
-320719.177787  7345981.369368 
-320699.131200  7345988.758102 
-320670.195177  7345999.916191 
-320648.334420  7346006.625042 
-320636.369139  7346002.925675 
-320630.374129  7345986.018571 
-320628.296079  7345964.832200 
-320613.683758  7345945.605494 
-320596.762493  7345939.626518 
-320571.388841  7345934.217444 
-320546.790335  7345931.807857 
-320522.216568  7345927.288631 
-320513.269408  7345910.121572 
-320515.957679  7345890.434944 
-320527.931206  7345869.318561 
-320535.963035  7345853.241315 
-320551.028898  7345828.845494 
-320560.091505  7345811.788415 
-320558.945279  7345781.973522 
-320548.810662  7345754.158287 
-320533.728306  7345730.932265 
-320513.764182  7345716.394755 
-320497.857203  7345702.457143 
-320473.959626  7345684.880153 
-320447.167623  7345670.812563 
-320410.092570  7345665.473478 
-320380.950391  7345660.004414 
-320366.659673  7345647.316588 
-320361.415071  7345627.090052 
-320361.612980  7345595.075536 
-320356.681734  7345574.639037 
-320340.288228  7345558.811748 
-320325.948032  7345550.213221 
-320323.268008  7345528.466946 
-320321.684731  7345509.070268 
-320329.098093  7345485.894238 
-320332.165690  7345451.820075 
-320336.981489  7345408.797444 
-320334.680791  7345372.983579 
-320327.217952  7345351.407274 
-320318.823289  7345322.942150 
-320296.682160  7345262.522500 
-320276.132553  7345213.410912 
-320262.748921  7345168.718567 
-320248.540665  7345141.293265 
-320223.703019  7345125.805918 
-320198.857126  7345126.925726 
-320168.172902  7345131.194995 
-320146.567777  7345134.134491 
-320113.558116  7345136.934012 
-320084.688062  7345134.694395 
-320062.934506  7345124.666113 
-320049.616844  7345115.527678 
-320027.624146  7345099.970343 
-320013.465368  7345084.832936 
-320014.875474  7345070.125455 
-320020.763282  7345062.886695 
-320035.054000  7345051.438656 
-320046.524507  7345037.621023 
-320055.051110  7345023.223489 
-320068.170862  7344991.368946 
-320074.380274  7344974.721797 
-320088.102002  7344959.944328 
-320105.476810  7344945.646777 
-320124.847206  7344926.839999 
-320140.729446  7344901.564328 
-320142.213767  7344880.867874 
-320143.071375  7344869.469826 
-320154.286249  7344851.442914 
-320166.869997  7344838.095200 
-320172.823776  7344817.788678 
-320168.535736  7344802.331326 
-320163.678706  7344784.104448 
-320152.884390  7344760.378512 
-320144.300064  7344747.420732 
-320134.247909  7344737.552422 
-320119.536633  7344733.933042 
-320104.883081  7344733.743075 
-320087.945324  7344729.103869 
-320082.849153  7344722.065075 
-320071.807450  7344709.407243 
-320053.591527  7344709.727188 
-320041.601507  7344708.137461 
-320027.962242  7344700.768723 
-320020.177800  7344688.600807 
-320017.547253  7344671.173792 
-320012.277911  7344652.936916 
-319998.762339  7344627.181328 
-319993.509490  7344616.043236 
-319982.245139  7344597.516409 
-319967.838974  7344569.421222 
-319959.262894  7344555.463612 
-319951.734086  7344547.614957 
-319930.458811  7344540.146236 
-319905.299561  7344541.605986 
-319883.100708  7344551.294326 
-319855.995348  7344554.053854 
-319826.473842  7344555.123671 
-319798.115055  7344552.444130 
-319775.536876  7344543.515659 
-319759.044414  7344535.886966 
-319744.357877  7344530.277926 
-319725.828597  7344523.069161 
-319704.536830  7344516.930213 
-319684.275841  7344509.471490 
-319664.270485  7344506.122064 
-319643.663155  7344510.401331 
-319623.863955  7344515.130521 
-319605.986127  7344520.779553 
-319592.602495  7344516.510285 
-319589.427696  7344494.214104 
-319587.465093  7344464.059269 
-319587.423862  7344435.034241 
-319603.009238  7344401.669956 
-319611.494609  7344382.503239 
-319609.119695  7344360.986924 
-319603.619459  7344336.771072 
-319589.716314  7344317.654347 
-319569.991330  7344300.117351 
-319545.937076  7344287.189565 
-319536.866222  7344272.232127 
-319533.485267  7344249.705986 
-319554.067859  7344231.359128 
-319566.362989  7344208.583030 
-319572.135350  7344186.386832 
-319567.129888  7344171.709346 
-319562.190396  7344144.064081 
-319564.829190  7344120.388137 
-319583.193546  7344100.461550 
-319605.845941  7344079.035220 
-319626.527488  7344060.908325 
-319646.450381  7344046.650767 
-319680.804178  7344033.573007 
-319707.018945  7344020.275285 
-319722.777492  7344005.407832 
-319732.070994  7343986.811017 
-319738.470069  7343963.075083 
-319750.542550  7343933.760105 
-319758.145575  7343895.866595 
-319765.888786  7343870.370962 
-319777.903544  7343845.935148 
-319789.481252  7343823.149051 
-319801.999030  7343807.021814 
-319831.001023  7343790.774597 
-319855.995348  7343777.686838 
-319880.371206  7343765.148986 
-319898.933471  7343761.719573 
-319924.067982  7343761.489613 
-319943.067297  7343771.697864 
-319961.810980  7343777.906801 
-319983.251179  7343772.417741 
-319997.508912  7343763.629246 
-320023.146443  7343755.420652 
-320042.426130  7343751.671295 
-320060.757501  7343758.330154 
-320079.682600  7343774.847325 
-320094.764956  7343797.413459 
-320106.400388  7343827.248349 
-320111.265664  7343852.564013 
-320112.708754  7343867.751411 
-320115.430010  7343885.508370 
-320113.327221  7343899.106040 
-320116.353588  7343917.872826 
-320133.027467  7343927.051254 
-320162.227369  7343935.059882 
-320172.493926  7343952.466900 
-320174.151419  7343974.203177 
-320178.348750  7343996.299392 
-320191.047945  7344006.197697 
-320213.642617  7344014.126338 
-320240.434621  7344027.644023 
-320252.086545  7344048.170507 
-320256.052982  7344072.476344 
-320260.497700  7344091.473090 
-320261.008966  7344123.607585 
-320263.746715  7344148.893254 
-320272.957754  7344176.698491 
-320296.764622  7344193.285650 
-320324.900761  7344197.624907 
-320363.773492  7344197.114994 
-320391.752953  7344189.606280 
-320420.243680  7344189.736258 
-320457.318733  7344178.458190 
-320492.431183  7344170.039632 
-320530.767909  7344163.650726 
-320558.466998  7344153.922393 
-320584.145760  7344151.472812 
-320612.562271  7344157.141841 
-320642.966123  7344175.468702 
-320667.053363  7344185.966904 
-320691.643623  7344188.596453 
-320708.465934  7344177.838296 
-320721.750611  7344165.270449 
-320741.360148  7344150.892912 
-320782.459361  7344159.941362 
-320791.200366  7344176.878461 
-320799.438350  7344210.102770 
-320808.237078  7344238.907835 
-320815.163912  7344270.562413 
-320823.946147  7344300.687253 
-320831.672866  7344317.624352 
-320858.250467  7344332.681773 
-320880.111224  7344333.511631 
-320910.762464  7344348.069137 
-320928.162010  7344364.576310 
-320951.787461  7344371.515121 
-320969.780736  7344372.844893 
-320998.708514  7344386.942478 
-321017.707829  7344388.952134 
-321041.877531  7344385.042804 
-321066.245143  7344381.143472 
-321091.783719  7344397.630648 
-321111.970492  7344426.795652 
-321139.422193  7344436.773943 
-321166.560538  7344439.663448 
-321195.521300  7344434.814278 
-321258.440040  7344432.054751 
-321301.914168  7344430.385037 
-321333.381784  7344436.094059 
-321368.123154  7344441.063208 
-321411.564297  7344433.964424 
-321447.864204  7344436.084061 
-321481.550057  7344451.901352 
-321504.078759  7344481.306315 
-321512.522899  7344506.112066 
-321522.253451  7344541.905935 
-321524.224300  7344620.682441 
-321529.114315  7344636.139793 
-321534.416641  7344643.958454 
-321556.376354  7344661.955371 
-321569.982634  7344672.423578 
-321581.271724  7344697.489285 
-321591.208432  7344716.226075 
-321600.741074  7344735.722736 
-321611.296250  7344754.129583 
-321624.160369  7344767.137355 
-321646.400454  7344778.825352 
-321663.808246  7344786.354063 
-321674.726256  7344791.923109 
-321690.105476  7344799.091881 
-321703.546832  7344806.450621 
-321715.553344  7344823.217748 
-321716.815017  7344860.781314 
-321724.632444  7344878.498279 
-321740.176588  7344896.745154 
-321752.570673  7344906.973402 
-321767.463366  7344920.671056 
-321783.040495  7344935.928442 
-321787.419244  7344960.134296 
-321785.341194  7344972.292213 
-321777.853616  7344993.358605 
-321764.387522  7345028.302619 
-321756.743266  7345045.929600 
-321751.201799  7345065.796197 
-321750.121543  7345087.492481 
-321756.891698  7345099.430436 
-321772.023531  7345109.808658 
-321787.765586  7345112.438208 
-321802.864434  7345117.397358 
-321818.309624  7345119.467004 
-321831.264452  7345116.857451 
-321843.023577  7345112.578184 
-321856.555642  7345096.021020 
-321868.603385  7345076.454371 
-321879.059605  7345062.186815 
-321896.252996  7345046.669473 
-321914.238025  7345040.690497 
-321930.177989  7345043.540009 
-321932.412717  7345051.658619 
-321937.113069  7345066.336104 
-321942.102038  7345082.793286 
-321947.536304  7345104.239612 
-321967.327258  7345132.724733 
-321992.230874  7345135.034337 
-322011.535300  7345137.593899 
-322035.795711  7345142.663030 
-322055.050659  7345148.662003 
-322068.442538  7345160.459982 
-322076.565075  7345178.056968 
-322074.726166  7345203.512607 
-322066.677845  7345220.689665 
-322059.882951  7345243.315789 
-322057.639976  7345260.232892 
-322067.263327  7345280.069494 
-322084.794813  7345302.335680 
-322103.876591  7345323.062130 
-322116.212952  7345337.609638 
-322124.673585  7345352.557077 
-322139.558031  7345358.616040 
-322151.218201  7345361.975464 
-322157.996603  7345348.987689 
-322165.805783  7345334.350196 
-322180.855154  7345327.451378 
-322195.640646  7345324.861821 
-322207.003952  7345327.991285 
-322219.414529  7345336.459835 
-322245.249969  7345337.329686 
-322266.855094  7345335.050076 
-322286.547092  7345346.928042 
-322304.152795  7345363.535197 
-322329.328537  7345384.561595 
-322354.298123  7345381.552111 
-322379.061554  7345370.783955 
-322396.683749  7345361.135608 
-322439.201314  7345354.466750 
-322475.501221  7345356.906332 
-322500.874873  7345362.315406 
-322526.298002  7345380.362315 
-322540.250624  7345404.008264 
-322553.188960  7345427.654214 
-322568.345532  7345436.152758 
-322585.151350  7345435.362894 
-322606.970877  7345431.533549 
-322634.463810  7345430.653700 
-322655.772070  7345435.242914 
-322677.162792  7345450.120366 
-322684.064887  7345467.927316 
-322680.551993  7345488.823736 
-322671.217260  7345502.881328 
-322657.841874  7345522.987884 
-322657.371838  7345544.474204 
-322665.865456  7345557.202024 
-322684.971972  7345575.608871 
-322703.295097  7345591.786100 
-322728.272929  7345604.723884 
-322768.448565  7345606.433591 
-322797.912347  7345601.704401 
-322829.792275  7345591.686117 
-322870.157574  7345577.788497 
-322899.011135  7345565.520599 
-322931.641470  7345551.742959 
-322964.535684  7345541.514711 
-323010.895992  7345528.906870 
-323046.750603  7345526.247326 
-323073.171526  7345529.116834 
-323091.898716  7345536.885504 
-323113.033805  7345556.082215 
-323127.769819  7345574.209110 
-323149.210019  7345585.327206 
-323172.621068  7345584.397365 
-323187.860102  7345562.321147 
-323212.574055  7345538.815173 
-323227.244100  7345520.828254 
-323238.879531  7345501.151625 
-323265.160268  7345466.137622 
-323298.780151  7345413.936564 
-323327.386325  7345379.842404 
-323345.808404  7345363.125267 
-323373.515739  7345344.748415 
-323400.810762  7345334.670141 
-323425.005203  7345328.431210 
-323445.117760  7345322.812172 
-323479.026260  7345312.593923 
-323502.000259  7345306.564955 
-323538.745462  7345313.773721 
-323567.846410  7345322.442236 
-323591.694509  7345327.831313 
-323619.706955  7345317.763037 
-323636.174677  7345302.565641 
-323650.745767  7345276.380126 
-323665.737414  7345248.764856 
-323676.647177  7345230.408000 
-323692.100614  7345206.562085 
-323714.414914  7345188.115245 
-323745.849545  7345171.888024 
-323774.496950  7345159.500146 
-323796.382446  7345150.681657 
-323821.352033  7345147.452210 
-323837.094087  7345150.191741 
-323853.182483  7345166.228994 
-323868.660658  7345190.004921 
-323884.749054  7345205.602249 
-323902.404234  7345217.890145 
-323921.560228  7345232.857581 
-323950.727145  7345252.604198 
-323978.022169  7345266.891751 
-323996.765851  7345273.660592 
-324022.972372  7345269.111371 
-324039.481326  7345251.144448 
-324061.350330  7345226.598653 
-324078.222118  7345212.191121 
-324100.025151  7345193.184377 
-324111.256517  7345190.334865 
-324132.441084  7345180.626528 
-324148.768621  7345176.617214 
-324157.567349  7345189.574995 
-324168.089539  7345219.049946 
-324174.232981  7345241.056177 
-324186.874453  7345272.560780 
-324199.548909  7345292.987281 
-324215.596074  7345311.904041 
-324224.815360  7345331.730645 
-324233.828490  7345360.415731 
-324235.692138  7345374.063394 
-324246.535931  7345386.381284 
-324265.931066  7345398.139270 
-324290.018305  7345400.758821 
-324325.336911  7345399.868973 
-324341.483031  7345394.299927 
-324361.471894  7345399.089107 
-324372.752738  7345408.757451 
-324393.327083  7345415.656269 
-324429.132216  7345416.536118 
-324455.478923  7345417.855892 
-324481.743168  7345416.956046 
-324508.164091  7345411.406997 
-324530.758763  7345394.739852 
-324556.858083  7345374.013402 
-324576.912916  7345357.086302 
-324593.504332  7345347.877879 
-324617.434893  7345346.958036 
-324635.386937  7345351.937184 
-324659.787534  7345370.404020 
-324694.124838  7345391.310439 
-324723.489666  7345420.245483 
-324740.930443  7345450.260342 
-324752.310242  7345485.064380 
-324768.984120  7345511.519849 
-324792.535355  7345524.437636 
-324825.701695  7345533.256125 
-324847.471743  7345534.185966 
-324873.876174  7345538.055303 
-324895.530776  7345532.006339 
-324918.232649  7345522.977886 
-324952.528722  7345505.680849 
-324981.308067  7345498.942003 
-325003.952216  7345469.866983 
-325012.586020  7345445.931083 
-325020.189044  7345432.073457 
-325038.982204  7345409.817269 
-325058.286630  7345387.231138 
-325070.474559  7345364.125096 
-325074.276071  7345344.668429 
-325072.313468  7345338.339513 
-325052.687439  7345320.932494 
-325046.354334  7345314.313628 
-325040.722159  7345300.286031 
-325052.753409  7345290.137769 
-325078.465156  7345284.798684 
-325099.385843  7345280.069494 
-325119.506646  7345273.670590 
-325134.951836  7345258.683157 
-325151.708177  7345236.846898 
-325163.986814  7345222.599338 
-325182.672773  7345209.201633 
-325205.259199  7345192.754450 
-325235.151785  7345178.496892 
-325262.422070  7345170.408278 
-325286.764942  7345176.467240 
-325299.851710  7345188.255221 
-325323.658578  7345197.403654 
-325343.903075  7345197.873573 
-325361.220159  7345196.093878 
-325374.521329  7345206.892029 
-325378.718660  7345221.339554 
-325379.790670  7345242.395947 
-325380.689510  7345268.881410 
-325390.131444  7345295.356875 
-325393.512398  7345310.024363 
-325406.310548  7345320.252611 
-325426.794185  7345309.874389 
-325453.041937  7345302.325682 
-325469.806524  7345304.305343 
-325490.578779  7345303.335509 
-325504.308753  7345286.778345 
-325518.145928  7345270.561123 
-325532.560339  7345256.993447 
-325545.845017  7345252.174272 
-325564.959780  7345270.021215 
-325576.463271  7345286.888326 
-325593.194873  7345308.024705 
-325613.348661  7345324.441893 
-325630.583283  7345329.521023 
-325647.273654  7345313.003853 
-325655.041603  7345301.685791 
-325676.465310  7345289.097947 
-325690.739536  7345286.948316 
-325717.787172  7345280.409436 
-325718.718996  7345262.252546 
-325709.474972  7345244.195639 
-325702.457429  7345218.520037 
-325707.702032  7345205.962188 
-325728.523764  7345200.673094 
-325763.825878  7345201.552943 
-325800.134031  7345202.762736 
-325831.642879  7345205.692234 
-325861.106661  7345210.041489 
-325901.603899  7345218.400057 
-325931.042943  7345224.519009 
-325972.562714  7345232.667613 
-326000.179341  7345246.065318 
-326028.142309  7345264.902092 
-326053.953011  7345293.017276 
-326067.897387  7345317.673053 
-326082.847803  7345343.878564 
-326097.484862  7345378.722596 
-326116.154328  7345416.616105 
-326121.695795  7345437.722489 
-326124.136680  7345471.866641 
-326121.819489  7345494.772717 
-326117.044921  7345510.659996 
-326114.521575  7345534.665884 
-326141.346563  7345546.403873 
-326158.539954  7345554.692453 
-326173.168767  7345565.170659 
-326188.704666  7345584.637324 
-326193.223600  7345606.403596 
-326198.278539  7345634.598766 
-326198.402233  7345666.383322 
-326203.877730  7345701.337335 
-326223.388312  7345728.932608 
-326244.259522  7345744.809888 
-326273.822258  7345766.206223 
-326298.305317  7345777.804236 
-326337.252265  7345788.352430 
-326351.757384  7345792.631697 
-326369.899092  7345807.249193 
-326381.922096  7345822.566569 
-326399.775185  7345835.964274 
-326422.460566  7345827.825668 
-326440.965107  7345812.878229 
-326474.395326  7345799.650494 
-326504.304405  7345784.063164 
-326522.627529  7345774.874738 
-326555.628945  7345755.778009 
-326588.349988  7345742.770237 
-326613.113418  7345731.662140 
-326636.920286  7345715.334937 
-326659.960255  7345695.128398 
-326673.871646  7345680.560893 
-326696.944599  7345665.883407 
-326719.250653  7345664.713608 
-326746.652877  7345670.582603 
-326780.849996  7345678.531241 
-326824.084983  7345696.778115 
-326864.244127  7345716.424750 
-326898.465984  7345730.792289 
-326921.184349  7345737.381161 
-326962.852553  7345742.090354 
-327011.257926  7345753.308432 
-327042.956437  7345774.184856 
-327062.607205  7345790.592046 
-327085.119414  7345805.259534 
-327114.401779  7345816.027689 
-327137.697381  7345825.056143 
-327153.604360  7345831.125103 
-327163.367897  7345848.182181 
-327165.586133  7345875.237547 
-327165.149083  7345894.944171 
-327166.633404  7345915.240695 
-327181.954901  7345935.577211 
-327196.723900  7345951.704449 
-327215.756200  7345959.583099 
-327239.546576  7345961.302805 
-327253.326027  7345958.483288 
-327277.932779  7345959.993029 
-327301.030471  7345968.581558 
-327325.274390  7345975.190426 
-327335.458484  7345974.650518 
-327349.435845  7345954.763925 
-327367.569306  7345944.355708 
-327389.685697  7345941.626175 
-327407.390354  7345950.144716 
-327427.923469  7345952.164370 
-327442.486312  7345943.255896 
-327456.249271  7345940.876304 
-327470.259617  7345960.762897 
-327479.718043  7345978.269898 
-327498.643143  7346012.164093 
-327514.715046  7346029.861061 
-327525.525855  7346044.828498 
-327542.331673  7346060.205864 
-327566.229249  7346078.662702 
-327591.174097  7346102.998534 
-327605.357613  7346125.434690 
-327608.392226  7346152.270094 
-327602.949714  7346181.335115 
-327609.579684  7346205.670947 
-327628.463552  7346217.978839 
-327640.923606  7346239.395170 
-327638.589923  7346264.390889 
-327633.345320  7346285.817218 
-327627.424527  7346313.102545 
-327621.338808  7346336.518534 
-327626.921507  7346354.745412 
-327636.981908  7346389.869395 
-327644.321053  7346413.885282 
-327660.302248  7346439.110961 
-327673.859051  7346454.218373 
-327699.447105  7346459.297503 
-327731.384756  7346460.677266 
-327752.684770  7346466.796218 
-327765.837508  7346473.275109 
-327776.656563  7346504.529755 
-327773.828106  7346527.755777 
-327770.076071  7346552.181593 
-327780.367366  7346559.950262 
-327791.747165  7346561.090067 
-327809.121973  7346555.201075 
-327827.271926  7346543.573067 
-327843.071704  7346516.177760 
-327856.174965  7346492.851755 
-327866.161150  7346474.694865 
-327885.737702  7346454.668296 
-327906.378017  7346447.599507 
-327925.542257  7346436.641384 
-327946.232050  7346425.263333 
-327970.937757  7346418.804439 
-327985.822203  7346433.821867 
-328006.973785  7346451.798787 
-328025.733959  7346449.479185 
-328053.004244  7346440.720685 
-328084.842941  7346442.320411 
-328111.387557  7346452.058743 
-328143.580842  7346457.977729 
-328164.674700  7346455.688121 
-328185.356246  7346444.849978 
-328203.324783  7346431.892197 
-328223.478570  7346422.713769 
-328236.722017  7346421.873913 
-328257.205654  7346428.212827 
-328277.103808  7346440.300757 
-328290.677104  7346454.428337 
-328307.623108  7346466.926196 
-328314.137630  7346475.524723 
-328324.964931  7346480.423884 
-328343.461226  7346490.832101 
-328363.268672  7346494.501473 
-328391.000746  7346489.632307 
-328416.893910  7346486.502843 
-328445.566054  7346488.622480 
-328472.481751  7346484.293221 
-328484.727403  7346472.915170 
-328498.853196  7346449.269221 
-328509.614527  7346426.033201 
-328512.764588  7346409.126097 
-328525.034979  7346379.141233 
-328539.383420  7346353.505624 
-328554.003987  7346330.529560 
-328571.609689  7346304.933944 
-328594.022944  7346286.257143 
-328614.440611  7346280.418143 
-328638.791731  7346269.629991 
-328657.147840  7346258.331926 
-328665.954814  7346227.867145 
-328663.505684  7346211.439959 
-328653.940056  7346194.382880 
-328644.102303  7346174.656259 
-328641.628434  7346160.228731 
-328643.805439  7346140.102178 
-328658.426006  7346116.906151 
-328671.652960  7346100.338989 
-328689.250416  7346083.931800 
-328708.117792  7346072.193810 
-328716.784580  7346070.744058 
-328751.641397  7346057.756283 
-328779.035375  7346055.876605 
-328814.098348  7346051.307388 
-328846.860622  7346051.917283 
-328876.291419  7346041.309100 
-328905.136734  7346020.492666 
-328934.905627  7345999.366285 
-328957.079741  7345983.119068 
-328984.350026  7345965.842027 
-329010.276175  7345951.084555 
-329034.017073  7345939.846480 
-329080.748462  7345938.516708 
-329121.278686  7345952.624291 
-329162.823196  7345968.071645 
-329198.817992  7345978.919787 
-329246.002924  7345990.447813 
-329273.644289  7345993.207340 
-329302.819453  7346004.415420 
-329338.979175  7346019.022918 
-329371.964097  7346026.281675 
-329406.474573  7346034.110334 
-329427.551938  7346041.789018 
-329439.937777  7346044.148614 
-329453.189469  7346033.340465 
-329469.319096  7346012.484038 
-329489.918181  7345991.797581 
-329517.691485  7345975.070447 
-329543.930991  7345967.631721 
-329573.386527  7345955.683767 
-329594.084566  7345943.635831 
-329623.845212  7345931.137972 
-329657.036291  7345929.878188 
-329684.611686  7345946.705305 
-329710.455373  7345973.370738 
-329722.222744  7345993.557280 
-329743.968054  7346022.062397 
-329765.408254  7346041.809015 
-329800.157870  7346054.626819 
-329842.749651  7346058.456163 
-329860.074982  7346056.226545 
-329899.986738  7346046.068285 
-329924.329611  7346036.169981 
-329963.969242  7346031.100849 
-329997.333491  7346023.962072 
-330047.569528  7346018.133070 
-330074.988245  7346014.473697 
-330122.032991  7346011.934132 
-330160.592365  7346012.713999 
-330204.767423  7346020.552656 
-330261.526228  7346031.410796 
-330311.729281  7346046.078284 
-330341.951716  7346054.846782 
-330381.261497  7346060.855752 
-330417.586143  7346061.065716 
-330455.386865  7346056.966418 
-330492.973184  7346054.426853 
-330530.031745  7346052.867121 
-330586.856520  7346057.966247 
-330626.471412  7346063.975218 
-330680.748102  7346069.604254 
-330719.604341  7346071.054005 
-330753.908660  7346070.464106 
-330792.764899  7346063.615280 
-330826.574445  7346061.355667 
-330858.033815  7346059.735944 
-330888.676808  7346067.734574 
-330921.925610  7346078.982647 
-330953.863261  7346088.770971 
-330975.954913  7346096.789597 
-330997.757947  7346085.751488 
-331014.126715  7346069.654245 
-331028.170045  7346043.688693 
-331039.525105  7346021.552485 
-331052.867506  7345994.797068 
-331060.099450  7345968.081644 
-331071.083430  7345943.175910 
-331083.518746  7345906.552183 
-331101.421312  7345872.538009 
-331109.494372  7345834.974444 
-331115.151286  7345812.778246 
-331127.025858  7345772.595129 
-331135.816340  7345742.910213 
-331146.420993  7345715.454916 
-331158.204856  7345690.999105 
-331186.481181  7345674.941856 
-331229.452289  7345664.043723 
-331256.062876  7345659.704466 
-331290.680552  7345649.256256 
-331316.301590  7345642.797362 
-331347.365141  7345623.560657 
-331380.547973  7345596.705257 
-331402.796304  7345573.819177 
-331424.731277  7345542.624521 
-331444.357306  7345526.567271 
-331464.989375  7345520.608292 
-331500.811001  7345511.169908 
-331520.907065  7345507.200588 
-331550.197677  7345491.043356 
-331572.330560  7345469.597030 
-331597.390855  7345432.673354 
-331617.074607  7345402.888456 
-331639.413646  7345363.385223 
-331656.260695  7345332.680482 
-331670.938986  7345304.725271 
-331686.532608  7345285.518561 
-331715.592325  7345245.545408 
-331744.825212  7345200.033203 
-331770.380281  7345164.229336 
-331793.370772  7345130.045192 
-331814.299705  7345106.929151 
-331838.296237  7345081.953429 
-331859.926100  7345068.695700 
-331900.464569  7345047.679300 
-331937.605592  7345030.282280 
-331963.812113  7345008.665983 
-331981.219906  7344981.510634 
-331998.685423  7344941.397505 
-332011.335141  7344895.695334 
-332019.078351  7344868.759947 
-332026.937009  7344831.636306 
-332036.543868  7344793.752796 
-332042.472907  7344774.106161 
-332049.729590  7344745.391079 
-332035.249209  7344721.745130 
-332035.735737  7344697.719245 
-332038.580687  7344680.582181 
-332043.363500  7344654.496649 
-332045.144686  7344641.118940 
-332044.600435  7344618.182869 
-332043.412978  7344598.126305 
-332051.197419  7344584.808586 
-332064.655268  7344582.978899 
-332074.097202  7344593.167154 
-332084.487453  7344609.794306 
-332092.370849  7344622.732090 
-332102.183864  7344627.501273 
-332121.793400  7344630.270799 
-332146.960896  7344635.999817 
-332165.069618  7344644.848302 
-332181.677527  7344660.435632 
-332189.297044  7344670.273946 
-332199.909943  7344676.042958 
-332215.750952  7344687.750953 
-332237.001488  7344706.387760 
-332259.579668  7344724.924585 
-332270.538908  7344735.802722 
-332281.646581  7344743.571391 
-332298.716279  7344753.959612 
-332318.985514  7344769.486952 
-332333.358694  7344776.515748 
-332350.370667  7344783.034631 
-332362.006099  7344788.813642 
-332374.020857  7344797.372176 
-332388.616685  7344810.729888 
-332404.342247  7344823.427712 
-332418.385578  7344831.676300 
-332441.169913  7344840.914717 
-332466.279685  7344851.622883 
-332495.858915  7344863.150908 
-332517.859858  7344869.939745 
-332543.390188  7344879.988024 
-332568.681377  7344892.575868 
-332592.694401  7344900.944435 
-332625.365967  7344909.193022 
-332665.558095  7344917.631576 
-332688.697018  7344923.330600 
-332708.463233  7344929.879478 
-332730.027126  7344939.317862 
-332750.980798  7344948.316320 
-332775.793706  7344958.684544 
-332793.424148  7344964.873484 
-332806.271775  7344971.002434 
-332820.917081  7344980.810754 
-332854.050435  7345001.247254 
-332873.536278  7345014.654957 
-332891.735709  7345024.393289 
-332908.434326  7345040.750487 
-332920.935612  7345050.758773 
-332937.601244  7345061.366956 
-332950.152007  7345067.265945 
-332964.871529  7345070.095461 
-332985.017070  7345070.335419 
-332998.895477  7345067.505904 
-333013.705707  7345062.246805 
-333024.961812  7345057.067692 
-333039.062866  7345051.798595 
-333059.059975  7345047.609312 
-333077.976828  7345048.379180 
-333096.258722  7345051.028727 
-333119.389399  7345056.947713 
-333137.902187  7345066.466082 
-333158.839366  7345077.124257 
-333177.319169  7345089.302171 
-333191.007912  7345102.309942 
-333205.282137  7345117.097410 
-333217.437081  7345131.075015 
-333234.341854  7345155.750789 
-333244.633150  7345172.047997 
-333249.358240  7345186.165579 
-333258.956852  7345208.981671 
-333262.090420  7345228.398345 
-333268.365802  7345257.823304 
-333279.935263  7345295.286887 
-333290.284283  7345332.840455 
-333296.213323  7345348.417786 
-333303.016463  7345357.806178 
-333322.271411  7345382.501948 
-333337.477461  7345395.859660 
-333354.720329  7345409.797273 
-333370.528353  7345423.824870 
-333383.524413  7345444.241373 
-333392.916869  7345458.758886 
-333399.159266  7345464.477906 
-333407.842547  7345470.226922 
-333419.205853  7345473.346387 
-333433.018289  7345475.615999 
-333448.686127  7345476.125911 
-333461.022488  7345474.166247 
-333487.039346  7345468.157276 
-333503.267928  7345463.578061 
-333523.512424  7345455.179499 
-333555.986080  7345436.942623 
-333589.259621  7345419.385630 
-333610.741052  7345409.557314 
-333623.415508  7345404.838122 
-333636.667201  7345402.998437 
-333655.262451  7345404.978098 
-333668.159556  7345407.457673 
-333683.448067  7345414.276505 
-333697.474906  7345423.964846 
-333710.569920  7345435.532864 
-333734.121155  7345457.959023 
-333742.631265  7345470.236920 
-333752.724651  7345485.634283 
-333763.279826  7345506.030789 
-333768.920248  7345519.608463 
-333774.428730  7345535.845682 
-333786.707368  7345565.560592 
-333793.395061  7345585.347203 
-333799.761151  7345606.353604 
-333807.727010  7345622.070912 
-333817.135959  7345635.028693 
-333830.230973  7345646.476732 
-333843.441435  7345656.814961 
-333858.952594  7345662.424000 
-333888.061789  7345670.182671 
-333916.263897  7345678.041325 
-333932.715127  7345680.890837 
-333943.583659  7345682.230607 
-333967.604929  7345681.850672 
-333991.700415  7345684.010302 
-334012.118082  7345686.899808 
-334030.086619  7345690.989107 
-334054.412999  7345698.687788 
-334075.383164  7345706.796399 
-334095.454489  7345713.895183 
-334113.051946  7345723.293574 
-334134.269497  7345736.501311 
-334149.211667  7345746.199650 
-334167.971842  7345760.697167 
-334191.918895  7345775.374653 
-334200.767101  7345784.453098 
-334220.764210  7345798.190744 
-334235.986752  7345810.558626 
-334246.426480  7345822.966501 
-334257.336243  7345838.603822 
-334264.419755  7345850.421798 
-334271.659946  7345875.867439 
-334273.358669  7345887.295482 
-334272.113488  7345915.970570 
-334243.053772  7345921.059698 
-334213.804392  7345915.630628 
-334182.732594  7345927.568583 
-334160.319340  7345938.376732 
-334133.403643  7345951.804432 
-334101.993750  7345975.470378 
-334077.807556  7345989.707939 
-334057.967125  7346007.304925 
-334032.717167  7346034.700232 
-334017.626564  7346055.016752 
-334001.026902  7346073.653560 
-333982.126542  7346088.720979 
-333958.921648  7346106.727895 
-333927.363324  7346125.304713 
-333907.259013  7346129.943918 
-333876.838669  7346138.452461 
-333857.938308  7346144.661397 
-333849.758047  7346165.607809 
-333849.411705  7346178.225648 
-333858.457821  7346196.392536 
-333872.344473  7346209.950214 
-333880.862829  7346230.426706 
-333878.463176  7346252.662897 
-333870.208699  7346279.818246 
-333863.323097  7346303.544182 
-333848.603575  7346335.608690 
-333844.703108  7346364.583726 
-333845.098927  7346392.169001 
-333851.440278  7346432.892026 
-333858.993826  7346457.457818 
-333860.857474  7346489.812276 
-333858.853640  7346530.995222 
-333855.167574  7346559.530334 
-333849.634354  7346588.705336 
-333844.538183  7346607.472122 
-333844.389751  7346629.178404 
-333834.081963  7346666.282048 
-333826.008903  7346695.976962 
-333813.466386  7346724.522072 
-333803.711095  7346749.437804 
-333784.983905  7346784.661771 
-333772.441389  7346804.118438 
-333749.690038  7346835.313095 
-333723.310346  7346872.776678 
-333705.424272  7346896.942538 
-333697.252258  7346916.669159 
-333692.271534  7346933.776229 
-333678.219957  7346960.751608 
-333666.122737  7347003.584271 
-333663.376742  7347029.919760 
-333663.269541  7347056.715171 
-333664.712631  7347072.572454 
-333666.831913  7347100.617650 
-333669.264551  7347118.594571 
-333669.165596  7347153.478596 
-333669.528430  7347183.833396 
-333662.543873  7347206.789464 
-333645.094849  7347237.264244 
-333629.022945  7347254.361316 
-333616.026886  7347269.378743 
-333607.236404  7347280.906769 
-333595.765897  7347295.834212 
-333592.904455  7347314.521011 
-333601.233148  7347324.919230 
-333619.539780  7347334.877524 
-333633.657327  7347337.257116 
-333660.078250  7347349.744977 
-333679.827972  7347357.953571 
-333708.467131  7347371.691218 
-333729.956808  7347387.778462 
-333754.439867  7347409.324772 
-333772.086801  7347431.680942 
-333791.803538  7347442.869026 
-333822.438285  7347460.506005 
-333840.753163  7347469.694431 
-333875.445056  7347479.732711 
-333905.106747  7347493.360377 
-333935.502353  7347505.128361 
-333958.014563  7347511.807217 
-333982.101803  7347523.275253 
-334003.179168  7347531.493845 
-334026.450031  7347542.951883 
-334045.482332  7347551.920346 
-334065.380486  7347565.218069 
-334076.051109  7347575.306341 
-334090.688168  7347594.643028 
-334102.488524  7347612.170026 
-334116.655548  7347628.167286 
-334123.903985  7347643.864597 
-334134.525130  7347658.282128 
-334152.419451  7347677.648810 
-334172.771148  7347686.527289 
-334189.197639  7347691.476442 
-334205.929241  7347696.875517 
-334219.114964  7347709.763309 
-334221.267230  7347725.960535 
-334221.176522  7347742.907632 
-334221.654803  7347753.985734 
-334235.508471  7347770.312938 
-334251.225786  7347775.921977 
-334274.339971  7347774.532215 
-334285.018839  7347766.793541 
-334293.974246  7347749.176558 
-334299.152879  7347740.817990 
-334306.821873  7347729.269968 
-334317.286340  7347722.191181 
-334326.637565  7347723.300990 
-334348.910634  7347741.837815 
-334356.777539  7347748.236719 
-334375.191372  7347757.865070 
-334390.933426  7347760.484621 
-334412.489073  7347761.954369 
-334430.754474  7347775.672020 
-334446.133694  7347800.997682 
-334451.304080  7347820.764296 
-334453.942874  7347847.489718 
-334462.510708  7347872.625413 
-334477.477616  7347880.993979 
-334502.636866  7347870.315808 
-334529.395885  7347853.458696 
-334558.282431  7347845.590043 
-334579.120655  7347847.939641 
-334600.148544  7347851.389050 
-334627.055994  7347856.798124 
-334651.926626  7347862.737106 
-334671.684594  7347861.187372 
-334688.589367  7347869.026029 
-334704.735487  7347881.393911 
-334716.676029  7347895.931420 
-334721.838169  7347916.257939 
-334730.529696  7347939.064032 
-334735.823776  7347956.401063 
-334741.653861  7347971.428488 
-334756.068273  7347983.886355 
-334776.469447  7347988.655538 
-334804.391184  7347985.766033 
-334830.960539  7347985.296113 
-334856.218744  7347992.344906 
-334879.506099  7348003.133058 
-334911.204610  7348016.240813 
-334938.268739  7348026.189108 
-334967.295471  7348032.837970 
-334990.970399  7348036.537336 
-335034.634190  7348036.487344 
-335053.245933  7348037.697137 
-335078.685554  7348038.107067 
-335101.898694  7348046.125694 
-335117.648994  7348066.132267 
-335138.470726  7348096.277103 
-335152.530550  7348121.572770 
-335168.701408  7348148.568146 
-335176.527081  7348167.374925 
-335195.353225  7348185.861758 
-335220.619676  7348191.800741 
-335231.529439  7348190.600946 
-335264.423653  7348197.729725 
-335283.315768  7348209.797658 
-335289.525179  7348245.311575 
-335287.776979  7348264.678257 
-335287.834702  7348286.164577 
-335300.987440  7348319.318898 
-335345.533578  7348357.712322 
-335373.570762  7348380.078490 
-335389.543711  7348398.205385 
-335406.951504  7348424.760837 
-335422.726543  7348442.447807 
-335453.245843  7348443.457634 
-335475.263279  7348423.221100 
-335500.678161  7348408.003707 
-335531.065521  7348402.594634 
-335555.746490  7348407.303827 
-335566.928378  7348426.490540 
-335578.588549  7348456.855339 
-335596.722010  7348482.101015 
-335613.898908  7348492.929160 
-335641.919600  7348498.898138 
-335667.746794  7348492.209283 
-335698.026953  7348478.711595 
-335722.411057  7348464.703995 
-335748.576347  7348445.957206 
-335779.318295  7348428.140258 
-335803.116917  7348411.363132 
-335824.614840  7348400.754949 
-335855.200109  7348396.555668 
-335880.260404  7348385.327591 
-335902.310825  7348370.410147 
-335913.014432  7348351.363409 
-335915.290392  7348321.488526 
-335912.931970  7348296.102875 
-335908.446021  7348270.457268 
-335907.514197  7348244.981631 
-335908.553222  7348225.494969 
-335922.769723  7348210.487540 
-335944.737682  7348202.538901 
-335979.157448  7348210.127601 
-335995.831327  7348220.515822 
-336018.755848  7348244.921642 
-336024.049928  7348271.337117 
-336013.511245  7348303.011691 
-336009.231452  7348338.845553 
-336010.344693  7348375.189328 
-336031.619968  7348419.511736 
-336036.856324  7348451.246300 
-336035.586405  7348464.414045 
-336035.809053  7348480.251332 
-336033.475370  7348497.728338 
-336050.569806  7348515.645269 
-336062.238222  7348536.601679 
-336063.087584  7348569.616024 
-336072.001759  7348590.762402 
-336087.075869  7348598.571065 
-336112.391797  7348609.829136 
-336122.039887  7348612.158737 
-336143.174976  7348614.718299 
-336162.405186  7348624.246667 
-336183.688707  7348640.883817 
-336186.896491  7348663.289979 
-336170.478246  7348674.838001 
-336155.659769  7348680.317062 
-336133.015620  7348693.794754 
-336122.724324  7348703.763046 
-336126.501098  7348720.300214 
-336136.742916  7348741.356607 
-336148.716443  7348762.203036 
-336174.040617  7348773.121166 
-336190.302184  7348775.410774 
-336217.638439  7348787.688670 
-336242.418362  7348792.847787 
-336266.785973  7348797.556980 
-336291.046384  7348803.256004 
-336310.012714  7348818.203444 
-336332.450708  7348840.609606 
-336353.387888  7348861.675997 
-336378.027625  7348878.233161 
-336398.024734  7348892.090787 
-336413.065859  7348912.087362 
-336412.834964  7348931.793987 
-336400.144015  7348947.041375 
-336395.361202  7348965.048290 
-336395.534372  7348994.283283 
-336391.452488  7349012.960084 
-336386.686167  7349029.737210 
-336377.244233  7349045.474514 
-336370.498816  7349056.472630 
-336373.698354  7349079.318717 
-336377.343188  7349089.886907 
-336385.853298  7349111.243249 
-336398.865850  7349130.889883 
-336400.968638  7349151.626331 
-336384.756549  7349172.262796 
-336370.803927  7349172.992671 
-336343.055361  7349169.243314 
-336319.256739  7349176.941995 
-336310.919800  7349193.679128 
-336298.558700  7349215.355415 
-336289.141505  7349229.433004 
-336264.897587  7349239.781231 
-336247.151698  7349243.020676 
-336226.346458  7349246.550072 
-336219.304177  7349248.459745 
-336208.963404  7349253.878816 
-336207.676992  7349268.266352 
-336221.439951  7349275.395131 
-336238.798267  7349278.914528 
-336260.724994  7349284.703536 
-336266.827205  7349302.720450 
-336269.903049  7349318.817693 
-336278.050324  7349336.184718 
-336293.281112  7349339.234196 
-336318.638272  7349338.084393 
-336331.601346  7349334.694973 
-336364.676977  7349326.096446 
-336394.107775  7349324.996634 
-336405.413357  7349332.875285 
-336399.970845  7349355.631387 
-336381.037499  7349382.106852 
-336368.767108  7349395.924485 
-336358.558274  7349407.872439 
-336336.697517  7349414.711267 
-336341.925627  7349429.508733 
-336358.533536  7349436.677505 
-336384.525655  7349451.255008 
-336416.273643  7349470.111778 
-336439.585737  7349487.548791 
-336460.819781  7349508.395220 
-336473.799348  7349531.241307 
-336486.383096  7349551.767791 
-336505.712260  7349570.924509 
-336525.577430  7349578.353237 
-336549.400790  7349595.680269 
-336567.031231  7349611.387578 
-336575.153768  7349631.634110 
-336574.370377  7349655.330051 
-336556.245162  7349673.956861 
-336536.305776  7349681.925496 
-336511.839210  7349693.933439 
-336498.966843  7349707.631093 
-336490.638151  7349732.236878 
-336486.135709  7349761.201916 
-336495.412718  7349796.085941 
-336503.980552  7349821.221636 
-336515.772662  7349849.046869 
-336516.844672  7349880.181536 
-336505.481366  7349912.835943 
-336501.704592  7349940.481208 
-336511.954657  7349970.386085 
-336512.985436  7349995.761739 
-336494.406678  7350018.147904 
-336460.506424  7350027.726263 
-336428.807913  7350031.575604 
-336406.130779  7350047.152936 
-336384.360730  7350073.048500 
-336366.969430  7350089.795631 
-336340.119703  7350114.741358 
-336318.943382  7350132.328346 
-336286.948007  7350153.234765 
-336260.906411  7350169.661951 
-336234.477242  7350193.277906 
-336205.590696  7350218.533580 
-336185.247245  7350234.810792 
-336151.676840  7350259.786513 
-336124.464279  7350280.412980 
-336100.533717  7350299.079783 
-336087.339748  7350323.075673 
-336085.393638  7350350.301009 
-336092.246256  7350374.626842 
-336094.819079  7350398.582739 
-336114.387385  7350423.288507 
-336142.853373  7350435.126479 
-336169.554668  7350432.776882 
-336201.261425  7350428.487616 
-336224.021021  7350449.893950 
-336232.968182  7350477.799170 
-336245.510698  7350511.613378 
-336267.833245  7350535.569274 
-336292.159625  7350553.676173 
-336308.000634  7350557.075591 
-336354.253742  7350562.694628 
-336391.040177  7350567.653779 
-336417.304421  7350576.482266 
-336437.268546  7350593.659324 
-336431.718833  7350616.075484 
-336428.214185  7350646.600256 
-336442.183299  7350671.356017 
-336459.789002  7350698.351391 
-336463.178202  7350713.898728 
-336464.736740  7350737.614666 
-336465.091328  7350769.519201 
-336452.218962  7350800.163952 
-336435.503852  7350828.439108 
-336429.863431  7350849.975419 
-336427.653441  7350883.729638 
-336441.169013  7350912.454717 
-336459.442660  7350934.480944 
-336483.818518  7350957.137064 
-336497.490768  7350972.354457 
-336499.511095  7351000.839578 
-336487.034548  7351023.845637 
-336467.820830  7351048.221462 
-336453.810484  7351071.427487 
-336445.432314  7351092.483880 
-336431.760064  7351122.018821 
-336411.804186  7351158.222619 
-336396.119855  7351185.297982 
-336379.907765  7351214.682948 
-336363.019485  7351249.047062 
-336351.977782  7351280.591659 
-336344.993225  7351295.029186 
-336338.981723  7351330.843051 
-336328.838859  7351354.319030 
-336325.556859  7351383.304065 
-336347.153737  7351399.711255 
-336373.673615  7351413.088963 
-336398.750402  7351436.744911 
-336417.378637  7351464.310189 
-336426.820572  7351492.885295 
-336424.676552  7351529.189076 
-336430.523129  7351561.043620 
-336443.403741  7351574.481318 
-336485.137915  7351610.835091 
-336491.471020  7351626.642383 
-336495.280778  7351658.136989 
-336490.250578  7351679.793279 
-336470.987383  7351708.918290 
-336455.352530  7351723.135855 
-336433.788636  7351748.371532 
-336429.484104  7351768.478088 
-336431.232305  7351794.413646 
-336412.463884  7351815.020116 
-336390.718574  7351829.287672 
-336370.259676  7351838.026175 
-336331.733286  7351842.235454 
-336300.315147  7351847.524548 
-336261.104320  7351858.492670 
-336236.736709  7351861.422168 
-336211.882570  7351863.021894 
-336190.186737  7351854.913283 
-336158.752106  7351834.836722 
-336137.006795  7351813.320407 
-336108.260435  7351790.514314 
-336082.680628  7351774.607038 
-336059.657152  7351758.499797 
-336027.529837  7351745.622003 
-336004.968150  7351742.812485 
-335960.009701  7351739.313084 
-335925.680643  7351740.912810 
-335890.617670  7351736.193618 
-335866.324274  7351741.672680 
-335840.983608  7351768.078157 
-335828.309151  7351798.722908 
-335823.699508  7351819.609330 
-335819.089865  7351839.825867 
-335804.642469  7351865.571457 
-335774.881823  7351877.529409 
-335748.180528  7351880.208950 
-335708.532651  7351875.109823 
-335683.909406  7351874.379948 
-335658.271875  7351872.870207 
-335636.180223  7351873.060174 
-335620.809249  7351890.277225 
-335616.504717  7351910.713725 
-335614.311220  7351942.258321 
-335602.156276  7351963.384703 
-335575.405504  7351988.110467 
-335553.693178  7351999.488518 
-335538.033586  7352024.564223 
-335537.415119  7352043.161038 
-335547.953802  7352056.348779 
-335561.988886  7352083.984045 
-335554.773434  7352100.841157 
-335532.953908  7352121.417633 
-335509.419166  7352158.471286 
-335495.573745  7352194.535109 
-335491.162011  7352233.138496 
-335493.404986  7352268.382459 
-335500.686408  7352308.335616 
-335508.462603  7352348.968655 
-335512.412548  7352386.222274 
-335515.702794  7352410.408131 
-335514.498844  7352444.622271 
-335509.303719  7352479.886230 
-335505.378513  7352511.630793 
-335504.520905  7352533.107114 
-335519.017778  7352556.863045 
-335536.376094  7352561.162309 
-335564.668911  7352552.623771 
-335601.059527  7352540.415862 
-335632.626098  7352521.729063 
-335658.642956  7352507.961421 
-335689.005577  7352497.013297 
-335710.643686  7352483.305645 
-335737.757292  7352471.427679 
-335766.066602  7352461.559370 
-335793.031777  7352463.089108 
-335820.813328  7352481.675924 
-335838.394291  7352511.010899 
-335848.957713  7352549.344333 
-335855.942270  7352579.329197 
-335869.441350  7352609.823973 
-335887.550072  7352619.562305 
-335913.014432  7352627.600928 
-335939.229200  7352632.330118 
-335966.788102  7352643.948128 
-335993.827493  7352656.545970 
-336013.115426  7352678.692177 
-336018.261074  7352710.096797 
-336010.575587  7352750.219925 
-336003.805432  7352781.044645 
-336003.500321  7352798.871591 
-336006.213331  7352820.277924 
-336019.506255  7352850.552739 
-336039.956907  7352869.279531 
-336066.847865  7352886.426594 
-336105.151606  7352902.143902 
-336128.760565  7352902.863778 
-336155.832940  7352894.635188 
-336180.291260  7352884.066998 
-336207.429605  7352878.497952 
-336233.314523  7352876.248337 
-336248.941130  7352889.716030 
-336248.429864  7352917.071345 
-336237.058312  7352940.867269 
-336230.906624  7352962.613544 
-336223.460278  7352999.967145 
-336218.726941  7353030.701881 
-336213.944127  7353057.897222 
-336200.197661  7353084.432677 
-336170.676155  7353119.976589 
-336146.720855  7353140.413088 
-336127.127811  7353162.459312 
-336110.874491  7353185.975284 
-336104.310491  7353207.711561 
-336102.521059  7353231.397503 
-336113.480299  7353261.202398 
-336137.056273  7353282.628728 
-336178.485336  7353310.014037 
-336207.116248  7353326.291249 
-336238.831252  7353348.357469 
-336259.471567  7353377.612458 
-336269.614431  7353425.904186 
-336263.949270  7353467.267101 
-336261.772265  7353497.921850 
-336268.212571  7353530.886204 
-336273.176802  7353569.049667 
-336262.934984  7353592.405666 
-336256.939974  7353618.041275 
-336262.852521  7353653.545193 
-336268.006416  7353683.180117 
-336262.753567  7353715.684549 
-336250.549145  7353741.240172 
-336230.296403  7353767.585659 
-336200.148184  7353795.040956 
-336176.432024  7353812.497966 
-336165.579985  7353844.052561 
-336164.862563  7353871.507858 
-336165.579985  7353907.181748 
-336175.805311  7353965.771712 
-336184.183481  7353989.797596 
-336192.000908  7354009.934147 
-336204.329022  7354026.681278 
-336215.791283  7354057.715963 
-336219.015559  7354069.383964 
-336223.864343  7354090.480350 
-336231.013825  7354106.737566 
-336236.497568  7354117.095791 
-336244.974693  7354132.253195 
-336253.493050  7354144.201148 
-336265.812918  7354153.089626 
-336277.085515  7354164.847612 
-336286.873791  7354172.936226 
-336294.163459  7354184.874181 
-336296.637328  7354191.433058 
-336301.329434  7354199.791626 
-336302.962187  7354216.868701 
-336302.822001  7354229.716500 
-336303.151851  7354245.333825 
-336304.545464  7354257.311774 
-336303.613639  7354276.468492 
-336302.178795  7354285.976863 
-336293.487268  7354298.504718 
-336276.120706  7354303.503861 
-336257.830567  7354308.612986 
-336242.847166  7354310.442673 
-336225.513589  7354312.232366 
-336211.305334  7354317.061539 
-336196.948646  7354325.980011 
-336179.961411  7354334.088622 
-336166.115990  7354342.907112 
-336154.439327  7354348.526149 
-336137.567539  7354354.875062 
-336116.465435  7354357.174668 
-336104.821757  7354360.034178 
-336088.807577  7354362.623735 
-336073.865407  7354360.464105 
-336062.180499  7354358.334469 
-336051.592338  7354358.104509 
-336037.804641  7354362.043834 
-336024.552948  7354363.663556 
-336011.639351  7354362.183810 
-335990.677433  7354360.734058 
-335983.536197  7354362.083827 
-335974.547806  7354373.061947 
-335969.327942  7354384.849927 
-335967.381831  7354403.876668 
-335973.805645  7354438.180792 
-335981.697287  7354461.086869 
-335989.382774  7354483.103098 
-335994.215066  7354505.969181 
-336000.795558  7354527.205543 
-336005.702065  7354543.542745 
-336006.543180  7354559.170068 
-336001.232608  7354578.266797 
-335994.314020  7354586.385406 
-335978.951293  7354603.592459 
-335969.130032  7354616.330277 
-335963.852444  7354632.557497 
-335962.681480  7354654.913668 
-335962.219691  7354668.971260 
-335966.854072  7354691.177456 
-335969.426896  7354706.274870 
-335978.192639  7354723.201971 
-335987.420172  7354735.599847 
-335994.569654  7354751.527119 
-335999.245266  7354769.963961 
-335994.957226  7354788.960707 
-335986.958383  7354802.938313 
-335968.445595  7354827.874041 
-335951.458360  7354844.731154 
-335933.869150  7354860.148513 
-335920.798874  7354872.076470 
-335906.870991  7354888.523653 
-335898.822669  7354906.270613 
-335892.819414  7354923.807609 
-335887.401640  7354952.322724 
-335881.827188  7354977.398429 
-335877.671088  7354993.195723 
-335880.029510  7355009.832874 
-335888.152047  7355029.749462 
-335900.917212  7355043.967027 
-335914.770880  7355052.425578 
-335934.256723  7355057.964629 
-335950.963586  7355066.683136 
-335973.846876  7355078.241156 
-335986.801704  7355084.480087 
-335999.748286  7355101.247215 
-336011.771291  7355118.214309 
-336019.423793  7355135.361372 
-336028.758526  7355164.596364 
-336041.754585  7355185.892716 
-336058.980961  7355211.458337 
-336077.551473  7355234.594374 
-336095.858105  7355254.410980 
-332741.101814  7354236.195391 
-332502.777502  7354836.182618 
-332270.225552  7355060.754151 
-332066.601378  7355329.898049 
-331836.811915  7355681.047900 
-332097.062954  7357342.563298 
-332089.286759  7357391.804863 
-332084.108126  7357442.346206 
-330702.765538  7357474.340726 
-328059.098209  7357476.850296 
-326572.937783  7357617.596187 
-325088.517311  7358098.433824 
-324813.216901  7358187.338596 
-323836.187002  7358520.431540 
-323692.084121  7358570.502963 
-323030.785901  7358765.929488 
-321650.193720  7359181.658278 
-320430.089679  7359519.310441 
-320357.102292  7359526.609191 
-320181.952353  7359475.527940 
-319998.490214  7359307.786673 
-319987.803099  7359291.999377 
-319974.386481  7359269.613212 
-319955.708769  7359252.936068 
-319943.867182  7359248.856767 
-319925.552303  7359244.147574 
-319902.957631  7359239.408386 
-319864.324041  7359229.230129 
-319834.109852  7359235.069129 
-319806.419009  7359239.908300 
-319770.399474  7359250.506485 
-319743.409561  7359262.204481 
-319724.748341  7359269.903162 
-319711.900714  7359274.102443 
-319698.071785  7359275.002289 
-319680.226942  7359273.342573 
-319662.893365  7359272.192770 
-319614.958026  7359261.434613 
-319593.352902  7359260.244816 
-319573.232099  7359261.354626 
-319548.048111  7359266.213794 
-319529.659016  7359271.632866 
-319518.839962  7359273.322576 
-319511.047274  7359272.502717 
-319498.529496  7359266.573732 
-319484.238778  7359260.644748 
-319465.387895  7359260.494774 
-319454.568840  7359261.414616 
-319433.656399  7359267.833517 
-319423.290887  7359276.612013 
-319414.937456  7359284.140723 
-319407.293200  7359298.008348 
-319398.882044  7359313.885628 
-319389.918392  7359336.111821 
-319386.562176  7359347.979788 
-319350.262269  7359362.377322 
-319298.376985  7359408.559411 
-319292.332498  7359411.298942 
-319283.269891  7359412.488738 
-319248.041993  7359416.508050 
-319180.274470  7359446.332941 
-319136.082920  7359463.729961 
-319126.352368  7359468.629122 
-319142.053191  7356557.657745 
+Version 300
+Charset "WindowsLatin1" 
+Delimiter ";"
+CoordSys Earth Projection 8, 92, Meters, -45.000000, 0.000000, 0.999600, 500000.000000, 10000000.000000
+Columns 10
+  Nome_Distrito Char(45)
+  Numero_Distrito Integer
+  Sigla Char(3)
+  area_km2 Float
+  Zona Char(10)
+  Pop91 Integer
+  Pop2000 Integer
+  Pop_2000_Fem Integer
+  Pop_2000_Masc Integer
+  object_id_ Char(16)
+Data
+Region 1
+206
+340033.474470  7391306.215632 
+340012.347627  7391313.834327 
+339993.645176  7391324.162558 
+339911.718874  7391363.115885 
+339895.242905  7391373.284144 
+339879.138017  7391377.113488 
+339857.681325  7391387.121773 
+339823.781070  7391399.099722 
+339810.092328  7391401.609292 
+339778.418556  7391409.417954 
+339765.274064  7391416.036820 
+339692.797943  7391432.763955 
+339637.490474  7391445.661746 
+339619.711601  7391449.231135 
+339601.338999  7391454.250275 
+339569.401347  7391463.448699 
+339484.621850  7391505.761451 
+339435.969090  7391532.706836 
+339292.426953  7391612.743126 
+339206.097164  7391660.874882 
+339194.783335  7391653.956067 
+339180.204000  7391649.636807 
+339168.708754  7391647.037252 
+339159.530699  7391645.927442 
+339148.101424  7391647.127237 
+339135.657862  7391649.116896 
+339127.048797  7391651.286524 
+339117.112089  7391650.696625 
+339101.576190  7391694.589107 
+339069.333429  7391757.288367 
+339035.828993  7391822.027278 
+339008.591694  7391850.402418 
+338959.435913  7391833.135375 
+338859.796708  7391855.181599 
+338844.450473  7391879.787384 
+338850.453729  7391938.547319 
+338869.156180  7391987.728895 
+338866.781265  7391999.996793 
+338828.098197  7392039.789977 
+338804.027450  7392059.256643 
+338782.950084  7392069.554879 
+338762.573649  7392072.234420 
+338742.691986  7392073.124267 
+338725.680013  7392087.161863 
+338679.402166  7392129.174666 
+338636.868109  7392167.808049 
+338611.337778  7392195.423319 
+338590.631493  7392219.939119 
+338588.446242  7392233.416811 
+338591.406639  7392251.953635 
+338608.542306  7392270.010542 
+338625.686220  7392297.625812 
+338645.774038  7392319.961986 
+338647.472761  7392340.268508 
+338651.101103  7392378.112026 
+338650.721776  7392394.879154 
+338648.429324  7392425.653882 
+338642.970319  7392475.225391 
+338640.636636  7392502.430731 
+338638.302953  7392527.856376 
+338630.328848  7392550.272536 
+338614.157989  7392569.429255 
+338596.461578  7392587.576146 
+338571.887811  7392607.052810 
+338549.342616  7392625.749608 
+338527.531336  7392640.367104 
+338509.002056  7392650.145429 
+338454.939768  7392650.485371 
+338366.498944  7392656.654314 
+338266.851493  7392663.903072 
+338213.061331  7392665.772752 
+338185.807538  7392671.281808 
+338172.918680  7392684.829488 
+338059.780395  7392788.461736 
+338033.169809  7392808.448313 
+337956.562326  7392880.925898 
+337952.950477  7392884.175342 
+337924.591690  7392908.251218 
+337872.277603  7392965.751368 
+337794.969191  7393053.906268 
+337870.941714  7393206.140192 
+337913.327339  7393305.983090 
+337963.357220  7393405.266083 
+338013.337624  7393505.148974 
+338032.147277  7393552.460870 
+338055.014074  7393603.382148 
+338068.744048  7393629.967594 
+338096.740001  7393684.928180 
+338118.048261  7393733.839802 
+338133.946994  7393769.363717 
+338145.565933  7393793.629560 
+338164.425062  7393824.564261 
+338173.025881  7393846.050581 
+338195.068055  7393889.113205 
+338228.861109  7393967.659750 
+338244.372268  7393992.205546 
+338255.941730  7394018.121107 
+338291.515969  7394089.498881 
+338299.762200  7394106.375990 
+338341.290217  7394195.380744 
+338375.371889  7394264.068978 
+338379.956793  7394260.299624 
+338450.890869  7394334.326944 
+338477.682872  7394362.092188 
+338524.076166  7394411.433736 
+338581.041127  7394473.103173 
+338732.722294  7394630.786163 
+338703.233773  7394679.957740 
+338878.911470  7394746.326372 
+338898.372575  7394704.243580 
+338914.988730  7394670.809307 
+338945.392582  7394607.430164 
+338966.346254  7394570.906420 
+338992.222926  7394521.914812 
+339009.193668  7394491.919949 
+339072.796845  7394480.731866 
+339092.612538  7394476.732551 
+339121.993858  7394465.194527 
+339143.351595  7394457.755801 
+339194.436994  7394442.618394 
+339223.389510  7394437.569259 
+339266.410095  7394431.900230 
+339307.138228  7394428.490814 
+339339.867517  7394425.761282 
+339380.166847  7394428.840754 
+339414.372211  7394432.620107 
+339455.421947  7394436.859381 
+339502.153337  7394444.198124 
+339538.997495  7394449.917144 
+339652.523352  7394477.022501 
+339656.077478  7394459.105570 
+339660.357272  7394446.937655 
+339665.370980  7394438.969019 
+339671.118603  7394432.540121 
+339678.391778  7394428.030893 
+339686.398868  7394425.061402 
+339775.491144  7394413.353407 
+339778.327847  7394391.237196 
+339827.318703  7394352.403847 
+339856.749501  7394334.366937 
+339885.767986  7394319.769437 
+339882.527218  7394296.453431 
+339836.397803  7394115.384447 
+339825.323116  7394072.121857 
+339808.203941  7393973.528745 
+339809.416137  7393955.591818 
+339829.306045  7393935.785210 
+339901.798659  7393848.930088 
+339915.330723  7393820.904888 
+340000.003019  7393776.762449 
+340020.832998  7393761.385083 
+340045.489228  7393738.718966 
+340075.414799  7393698.095924 
+340111.582766  7393633.656962 
+340173.503712  7393536.723566 
+340234.418618  7393440.999963 
+340270.809234  7393407.775654 
+340517.618917  7393270.919096 
+340560.969352  7393251.682391 
+340739.904310  7393151.469556 
+340793.702719  7393122.994434 
+340909.191179  7393058.125545 
+340970.106085  7393032.809882 
+340997.805174  7393027.290827 
+341148.851381  7392950.893913 
+341193.183117  7392919.689258 
+341232.938195  7392879.106210 
+341288.905362  7392823.975653 
+341372.761281  7392736.960558 
+341418.643309  7392686.329231 
+341395.710541  7392635.917866 
+341367.912498  7392566.179811 
+341279.966448  7392352.756369 
+341216.915768  7392201.412293 
+341160.470320  7392061.576245 
+341128.862518  7392071.784497 
+341119.618493  7391981.869898 
+341114.876910  7391946.275995 
+341113.219418  7391926.309415 
+341092.612088  7391744.560547 
+341093.214062  7391743.520725 
+341085.932641  7391678.021945 
+341078.148199  7391636.499057 
+341072.103712  7391551.963537 
+341067.032280  7391500.942277 
+341059.379778  7391432.014084 
+341046.804276  7391322.802791 
+340930.705595  7391331.491302 
+340843.542937  7391339.929857 
+340804.777407  7391332.021212 
+340725.349713  7391314.904144 
+340691.870017  7391304.655899 
+340626.164051  7391286.219057 
+340596.609560  7391278.570367 
+340568.176557  7391268.302126 
+340506.552476  7391251.325034 
+340460.282875  7391247.605671 
+340414.392602  7391248.615498 
+340392.836955  7391248.555508 
+340355.910334  7391249.165404 
+340330.248064  7391250.525171 
+340254.992963  7391252.514830 
+340175.441576  7391262.863058 
+340113.042349  7391276.630699 
+340084.815502  7391280.939961 
+340033.474470  7391306.215632 
+Region 1
+182
+327045.149934  7394665.260258 
+327016.642715  7394577.715254 
+326971.403894  7394423.951592 
+326964.427583  7394388.167721 
+326953.509573  7394311.250896 
+326935.969841  7394231.564546 
+326927.418499  7394217.376976 
+326904.246591  7394172.224710 
+326882.756914  7394133.421357 
+326868.161086  7394100.696962 
+326846.176635  7394067.232695 
+326833.122852  7394039.837387 
+326814.906929  7394014.861665 
+326810.552919  7394000.004210 
+326805.357793  7393990.285875 
+326784.610277  7393958.321350 
+326780.891227  7393937.194969 
+326779.349182  7393876.285402 
+326706.427764  7393787.630588 
+326666.540747  7393736.559336 
+326632.112734  7393667.511163 
+326618.539438  7393624.818476 
+326595.854058  7393602.352324 
+326524.260283  7393533.014201 
+326480.926341  7393492.151201 
+326461.143634  7393476.623860 
+326398.282618  7393417.953910 
+326332.131355  7393354.704744 
+326265.213194  7393290.935667 
+326194.237886  7393224.866984 
+326105.557922  7393133.352660 
+326011.122089  7393067.323970 
+325992.543331  7393100.888221 
+325962.436343  7393151.369574 
+325908.184392  7393223.127282 
+325824.015115  7393303.113581 
+325739.614945  7393385.629447 
+325557.678358  7393478.933465 
+325401.313332  7393585.165268 
+325328.342437  7393628.687813 
+325304.519077  7393642.815393 
+325259.024623  7393666.531331 
+325104.440783  7393743.658120 
+324955.085053  7393817.965392 
+324801.466023  7393898.641573 
+324528.853884  7394033.938398 
+324464.236420  7394066.272859 
+324355.410914  7394115.694393 
+324226.274943  7394180.713256 
+324082.064861  7394268.028300 
+323920.364524  7394341.185769 
+323764.774644  7394415.293075 
+323620.498593  7394507.697247 
+323473.608486  7394605.060570 
+323287.581769  7394707.702988 
+323196.576368  7394782.140237 
+323055.293698  7394922.096264 
+322960.626970  7395008.331493 
+323084.823450  7395133.610034 
+323192.997504  7395247.840467 
+323241.848174  7395300.011531 
+323352.092032  7395420.640868 
+323437.819845  7395510.365499 
+323488.360993  7395525.942831 
+323508.143700  7395536.990938 
+323539.067065  7395554.967859 
+323557.546868  7395571.345054 
+323573.470340  7395590.511771 
+323592.667565  7395614.757618 
+323604.773031  7395633.144468 
+323623.129141  7395670.348095 
+323639.761788  7395698.913202 
+323662.397691  7395744.275432 
+323675.583414  7395753.253894 
+323709.450683  7395792.597155 
+323797.446210  7395885.901173 
+323808.306496  7395899.178899 
+323838.207328  7395920.455254 
+323879.512698  7395948.920378 
+323903.146395  7395958.178793 
+323928.759187  7395969.336881 
+323965.578607  7395981.524794 
+323999.998374  7395984.374306 
+324016.053785  7395986.313973 
+324043.027205  7395988.033679 
+324073.810384  7395987.203821 
+324096.446287  7395984.604266 
+324138.048521  7395979.415155 
+324190.799658  7395969.906784 
+324254.889363  7395961.888157 
+324323.563972  7395953.349620 
+324357.653889  7395951.499937 
+324382.582244  7395951.689904 
+324404.467741  7395955.709216 
+324423.062991  7395959.468572 
+324440.643954  7395967.297231 
+324456.221084  7395977.665455 
+324477.908671  7395999.971634 
+324506.127272  7396048.483324 
+324527.163406  7396064.370603 
+324536.201275  7396070.179608 
+324548.026370  7396080.117906 
+324560.593625  7396088.456477 
+324572.047640  7396095.685239 
+324585.711644  7396105.553549 
+324700.672345  7396127.629767 
+324953.048234  7396172.572069 
+325022.333064  7396184.749983 
+325123.580284  7396187.819457 
+325167.343030  7396184.410041 
+325219.863273  7396180.630689 
+325247.653070  7396178.361077 
+325288.372957  7396174.191792 
+325324.953237  7396168.152826 
+325351.910165  7396159.004393 
+325393.009378  7396146.086606 
+325432.962366  7396133.938687 
+325467.200715  7396120.640964 
+325485.853689  7396111.912459 
+325501.818391  7396102.034151 
+325516.661607  7396090.246171 
+325525.402611  7396077.708318 
+325531.859410  7396068.589880 
+325534.506450  7396050.343006 
+325532.222244  7396044.643982 
+325534.110631  7396033.985808 
+325530.680199  7396021.447955 
+325516.686345  7395993.502742 
+325561.850951  7395949.470284 
+325628.249600  7395862.975100 
+325645.236835  7395843.648411 
+325662.751829  7395829.130897 
+325671.138245  7395824.801639 
+325688.933611  7395819.172603 
+325709.771836  7395810.994004 
+325769.029249  7395805.274984 
+325796.497444  7395800.885735 
+325817.352161  7395798.296179 
+325828.542296  7395794.716792 
+325844.292596  7395787.318060 
+325876.246740  7395755.763465 
+325895.237809  7395723.718953 
+325916.546069  7395703.612398 
+325977.271312  7395674.527380 
+326016.160536  7395659.709918 
+326060.409809  7395655.290675 
+326076.432235  7395651.951247 
+326241.439311  7395612.967924 
+326293.308101  7395601.169945 
+326434.763942  7395579.483660 
+326499.307189  7395571.235073 
+326616.073815  7395566.145944 
+326616.082061  7395566.125948 
+326675.628093  7395581.013398 
+326722.252281  7395592.821375 
+326767.820952  7395600.580046 
+326814.403908  7395523.283286 
+326850.101841  7395465.563173 
+326868.317764  7395432.758792 
+326887.597452  7395414.181974 
+326913.762742  7395398.384680 
+326942.707011  7395379.517912 
+327001.131555  7395345.363762 
+327063.530783  7395282.754487 
+327080.781897  7395264.677583 
+327148.986471  7395187.330832 
+327179.175921  7395159.325629 
+327218.279547  7395130.290602 
+327212.812296  7395090.437429 
+327217.322984  7395065.801649 
+327229.469682  7395045.205177 
+327242.135892  7395027.908140 
+327276.349503  7394981.356113 
+327230.822064  7394900.210013 
+327185.393579  7394852.068259 
+327165.412962  7394817.694147 
+327147.023868  7394801.086992 
+327138.398311  7394788.249191 
+327110.253925  7394746.186396 
+327061.576426  7394678.627968 
+327045.191166  7394665.310249 
+327045.149934  7394665.260258 
+Region 1
+1655
+314875.997705  7407081.823413 
+314889.496785  7407054.698059 
+314897.256488  7407041.890253 
+314909.691804  7407020.303951 
+314920.560336  7407001.477176 
+314926.522361  7406990.679025 
+314932.261737  7406976.851394 
+314940.095656  7406957.484711 
+314943.311686  7406941.867386 
+314942.544787  7406917.871496 
+314937.597048  7406905.703581 
+314930.365104  7406892.495843 
+314927.379969  7406886.156929 
+314923.924798  7406877.028493 
+314921.022125  7406863.110876 
+314924.963823  7406851.032945 
+314932.632818  7406846.313754 
+314940.590430  7406838.815038 
+314942.726204  7406829.746591 
+314944.911455  7406815.129095 
+314946.907043  7406794.692596 
+314946.973013  7406788.893589 
+314940.409013  7406760.288489 
+314938.462903  7406752.449832 
+314943.187993  7406738.602204 
+314945.373244  7406724.234665 
+314942.973591  7406710.826961 
+314939.782300  7406699.938826 
+314938.347455  7406691.850212 
+314929.713652  7406667.264423 
+314926.011094  7406656.876203 
+314925.615275  7406646.018063 
+314926.060572  7406628.601046 
+314927.775788  7406610.694113 
+314934.595420  7406590.557562 
+314943.130269  7406576.250013 
+314943.723998  7406568.681310 
+314945.134103  7406555.063642 
+314944.441420  7406548.994682 
+314946.140143  7406532.347533 
+314950.353967  7406518.499905 
+314957.577665  7406508.221666 
+314967.547358  7406503.272514 
+314992.582914  7406490.644677 
+315015.812546  7406481.536237 
+315045.193866  7406467.188694 
+315077.634537  7406451.351407 
+315100.658013  7406437.443789 
+315127.557218  7406417.517203 
+315135.564308  7406404.969352 
+315155.437723  7406376.634206 
+315164.162235  7406345.159597 
+315160.311246  7406324.923063 
+315158.760954  7406302.686872 
+315160.707065  7406287.309506 
+315163.848879  7406254.765081 
+315164.261190  7406216.141696 
+315159.651547  7406195.385252 
+315156.790105  7406177.938240 
+315153.879186  7406164.780494 
+315135.984865  7406120.888013 
+315146.317392  7406084.384265 
+315166.289763  7406042.371462 
+315210.374112  7405977.632551 
+315215.882594  7405945.268095 
+315216.575277  7405918.402696 
+315208.996991  7405871.570718 
+315203.488509  7405827.488269 
+315197.287344  7405780.656291 
+315195.217540  7405741.403015 
+315202.795826  7405701.449858 
+315212.435670  7405678.723751 
+315234.477844  7405649.108824 
+315243.433251  7405626.382717 
+315240.679010  7405605.026375 
+315237.232085  7405587.809324 
+315232.416287  7405568.522628 
+315227.592242  7405540.287464 
+315227.592242  7405511.362419 
+315231.030920  7405478.298082 
+315235.170528  7405452.132564 
+315243.433251  7405410.809643 
+315258.581576  7405350.200024 
+315275.799706  7405316.445806 
+315294.403202  7405276.502648 
+315301.288805  7405253.776541 
+315304.727483  7405237.249372 
+315309.551528  7405221.402086 
+315321.945613  7405206.254681 
+315341.926230  7405195.916452 
+315353.627631  7405184.898339 
+315359.144359  7405172.500463 
+315362.253188  7405164.211882 
+315366.862831  7405137.246501 
+315375.958423  7405118.399730 
+315395.988518  7405098.403155 
+315409.083532  7405085.905296 
+315426.804682  7405068.408293 
+315443.049756  7405047.111941 
+315458.536177  7405024.285851 
+315468.373930  7405007.218774 
+315477.972543  7404989.381829 
+315488.643165  7404965.755876 
+315492.584863  7404953.427988 
+315499.808561  7404943.149748 
+315507.527033  7404934.891163 
+315519.789178  7404928.702223 
+315530.558756  7404919.713763 
+315538.285474  7404910.205391 
+315543.010564  7404895.607892 
+315545.179322  7404883.000052 
+315546.622413  7404866.602860 
+315547.306850  7404850.455626 
+315552.642161  7404827.019640 
+315555.338679  7404812.152187 
+315560.904884  7404790.245939 
+315565.959824  7404769.079565 
+315568.375969  7404757.491550 
+315569.307793  7404741.594273 
+315572.795949  7404724.207251 
+315577.892119  7404698.501654 
+315577.554024  7404682.844336 
+315576.449029  7404667.436976 
+315572.325914  7404648.450228 
+315569.967492  7404631.513129 
+315571.187934  7404612.086457 
+315576.449029  7404595.979216 
+315580.225803  7404575.052800 
+315582.765642  7404551.596818 
+315592.108621  7404517.932584 
+315586.591893  7404499.225789 
+315582.872843  7404473.970115 
+315582.163667  7404460.842363 
+315582.798627  7404427.778027 
+315583.400602  7404401.522524 
+315580.638114  7404327.305237 
+315581.759602  7404298.780123 
+315585.923948  7404271.284833 
+315589.791430  7404255.647511 
+315593.939284  7404232.941401 
+315598.309787  7404219.073776 
+315606.020012  7404195.627792 
+315626.223277  7404158.344179 
+315628.598192  7404134.628241 
+315633.735593  7404119.250875 
+315649.799251  7404101.893848 
+315666.605069  7404089.595954 
+315684.449912  7404072.238928 
+315702.797775  7404054.142027 
+315718.111025  7404034.505391 
+315730.356678  7404018.648107 
+315743.657848  7403993.962336 
+315760.241018  7403974.085740 
+315778.357986  7403950.179835 
+315791.873559  7403936.092248 
+315807.162070  7403923.024487 
+315835.166269  7403902.937927 
+315859.632836  7403880.821716 
+315882.837729  7403855.156112 
+315894.563869  7403843.088179 
+315910.388385  7403821.691844 
+315923.664817  7403804.074862 
+315933.609771  7403793.006758 
+315949.195147  7403766.811245 
+315964.269256  7403744.405083 
+315971.418738  7403734.336807 
+316003.018294  7403705.171803 
+316025.423303  7403688.344685 
+316061.088250  7403658.949720 
+316077.943546  7403635.543730 
+316089.422299  7403621.196187 
+316101.948323  7403599.789854 
+316116.263780  7403575.104082 
+316128.542417  7403550.918225 
+316144.177270  7403511.345004 
+316153.693421  7403481.340143 
+316155.779717  7403465.702822 
+316158.385526  7403448.795718 
+316155.656024  7403431.878615 
+316150.906195  7403412.421948 
+316145.612115  7403400.284027 
+316141.109673  7403383.606884 
+316135.856824  7403361.370693 
+316113.088981  7403271.166144 
+316144.127793  7403256.138718 
+316172.635012  7403237.821856 
+316190.991122  7403220.474827 
+316212.942588  7403190.769915 
+316229.294863  7403162.564747 
+316235.364089  7403170.663359 
+316250.537153  7403187.380496 
+316260.638786  7403202.317937 
+316278.054825  7403230.403126 
+316290.185030  7403247.110265 
+316305.621974  7403261.047877 
+316324.637782  7403268.196653 
+316341.385876  7403273.055820 
+316356.088906  7403278.414902 
+316373.307035  7403292.362513 
+316387.267904  7403294.942071 
+316404.263385  7403299.551282 
+316422.281399  7403302.900708 
+316444.859579  7403309.049655 
+316460.576894  7403317.438218 
+316475.255185  7403330.366004 
+316481.019300  7403350.582541 
+316487.525576  7403377.117995 
+316487.921395  7403405.383154 
+316486.577259  7403424.569867 
+316490.288063  7403452.855022 
+316497.816872  7403475.601126 
+316510.944871  7403497.107442 
+316515.917348  7403525.142640 
+316516.354398  7403543.579482 
+316522.852428  7403571.364723 
+316530.389483  7403593.101000 
+316535.650578  7403612.307710 
+316539.402613  7403627.215156 
+316543.624683  7403651.720958 
+316545.306914  7403676.966634 
+316545.480085  7403698.422959 
+316541.596110  7403719.869285 
+316533.407603  7403735.736567 
+316522.679257  7403752.863634 
+316517.038835  7403765.971388 
+316514.919554  7403790.447196 
+316514.325826  7403812.403435 
+316512.453931  7403838.149025 
+316512.363223  7403860.355221 
+316519.133378  7403884.871022 
+316533.242679  7403914.205997 
+316544.597738  7403933.182747 
+316553.668592  7403952.399455 
+316558.929687  7403971.106251 
+316563.407390  7403996.871837 
+316564.306229  7404026.656735 
+316564.974174  7404052.912238 
+316566.161631  7404073.618691 
+316574.457339  7404097.374622 
+316587.370937  7404107.022969 
+316604.366418  7404112.132094 
+316629.500929  7404114.251731 
+316650.306169  7404118.620983 
+316683.315830  7404118.750960 
+316707.699934  7404118.081075 
+316728.010400  7404120.180716 
+316752.097640  7404128.859229 
+316773.405900  7404135.248135 
+316788.108929  7404144.146610 
+316806.827873  7404163.143356 
+316821.258776  7404175.061315 
+316839.755072  7404186.749313 
+316861.797246  7404198.447309 
+316876.252889  7404203.546436 
+316892.728857  7404212.194954 
+316912.486826  7404225.652649 
+316926.167323  7404235.290998 
+316939.567448  7404249.988481 
+316951.969778  7404262.656311 
+316966.928441  7404268.265350 
+316988.244947  7404272.134687 
+317009.363544  7404260.606662 
+317019.828010  7404248.028816 
+317037.969718  7404218.303908 
+317052.004802  7404199.687097 
+317071.136057  7404177.540890 
+317096.600418  7404159.713944 
+317121.792652  7404145.176434 
+317153.573625  7404134.948186 
+317179.541006  7404119.140894 
+317205.236260  7404107.632865 
+317225.835344  7404099.884192 
+317253.303539  7404088.126206 
+317271.387523  7404073.808659 
+317294.072903  7404050.672622 
+317309.122274  7404033.315595 
+317329.787328  7404009.659647 
+317349.916377  7403992.072659 
+317377.664943  7403973.495841 
+317398.569138  7403951.869546 
+317423.060443  7403922.174632 
+317439.379733  7403904.317691 
+317456.960697  7403889.490231 
+317476.091952  7403866.594153 
+317493.466760  7403838.139027 
+317504.953759  7403822.781657 
+317517.702432  7403809.953855 
+317539.587928  7403796.406175 
+317567.031384  7403791.716978 
+317604.675427  7403777.729374 
+317631.376721  7403768.241000 
+317675.593010  7403759.822442 
+317706.590591  7403755.653156 
+317731.477715  7403755.753139 
+317766.994231  7403764.471645 
+317828.906930  7403779.099140 
+317849.712170  7403784.228261 
+317871.515204  7403793.646648 
+317887.479907  7403802.045209 
+317897.837172  7403818.492392 
+317905.357735  7403842.498280 
+317914.675975  7403863.734642 
+317920.481322  7403874.362822 
+317936.182145  7403885.780866 
+317951.635581  7403894.429385 
+317960.244646  7403901.778126 
+317968.268228  7403929.073451 
+317967.888902  7403961.637873 
+317968.086811  7403976.775280 
+317980.225263  7403990.202980 
+317997.204252  7403999.861325 
+318020.021572  7404009.799623 
+318050.722288  7404018.998047 
+318070.010222  7404020.837732 
+318097.453678  7404016.658448 
+318117.269370  7404015.218695 
+318136.334655  7404008.979763 
+318146.065207  7403988.323302 
+318150.988207  7403962.337753 
+318153.602262  7403942.411166 
+318158.772649  7403918.695228 
+318167.455930  7403905.097557 
+318178.662557  7403896.559020 
+318199.781154  7403886.040822 
+318213.263741  7403879.781894 
+318228.758408  7403878.832056 
+318245.019975  7403877.632262 
+318257.199658  7403879.441952 
+318273.444732  7403882.031508 
+318292.254384  7403878.062188 
+318302.166353  7403875.582613 
+318322.485066  7403873.642945 
+318334.640010  7403883.531251 
+318343.224336  7403896.439040 
+318356.154425  7403902.547994 
+318372.655133  7403904.877595 
+318382.575348  7403900.378366 
+318397.566996  7403897.908789 
+318417.019854  7403895.219249 
+318412.674090  7403906.477321 
+318558.962222  7404213.984648 
+318781.668173  7404524.191512 
+318996.424758  7404953.697942 
+319230.955804  7405274.163049 
+319235.746864  7405301.738325 
+319240.653371  7405318.195506 
+319248.107963  7405334.682682 
+319252.981486  7405354.169344 
+319257.162325  7405367.597044 
+319259.067204  7405379.235051 
+319260.947344  7405393.892540 
+319261.021561  7405410.809643 
+319251.934214  7405428.396630 
+319244.636300  7405445.743659 
+319239.317481  7405467.659905 
+319236.084959  7405485.296884 
+319235.161381  7405499.934376 
+319235.986004  7405518.121261 
+319243.490074  7405529.309345 
+319249.460345  7405541.737216 
+319256.717028  7405552.415387 
+319264.897289  7405571.692085 
+319270.001706  7405593.958271 
+319271.923077  7405604.326495 
+319270.512972  7405617.444248 
+319266.802168  7405631.551831 
+319260.749435  7405651.438425 
+319261.895661  7405663.066433 
+319267.115525  7405673.464652 
+319275.130861  7405684.652736 
+319288.184644  7405700.440031 
+319299.531458  7405708.378672 
+319317.532979  7405712.347992 
+319342.939616  7405713.617774 
+319352.826846  7405715.477456 
+319370.308855  7405720.456603 
+319378.860196  7405728.875161 
+319390.932678  7405741.113065 
+319401.438376  7405757.120323 
+319411.498777  7405766.818661 
+319433.780093  7405774.617326 
+319446.924584  7405781.566135 
+319459.038297  7405789.514774 
+319466.055839  7405798.673205 
+319473.048643  7405809.851290 
+319485.286049  7405830.427766 
+319501.811495  7405853.573801 
+319512.366671  7405865.041837 
+319523.993856  7405870.460908 
+319545.343347  7405870.670872 
+319566.156833  7405872.900491 
+319578.534425  7405880.599172 
+319597.706912  7405893.416976 
+319623.699031  7405911.353904 
+319644.075467  7405930.740583 
+319642.154095  7405944.108293 
+319640.900668  7405966.064532 
+319637.651653  7405984.971294 
+319628.539568  7406005.327807 
+319620.755126  7406020.145269 
+319609.630961  7406039.222001 
+319603.883338  7406053.309588 
+319600.988911  7406063.127906 
+319600.840479  7406077.005529 
+319603.438042  7406095.472366 
+319606.043851  7406112.919377 
+319614.974519  7406133.455860 
+319627.945839  7406156.561902 
+319639.911120  7406178.648119 
+319655.405787  7406203.293897 
+319667.659686  7406222.110674 
+319676.911957  7406236.088280 
+319688.135077  7406256.654757 
+319693.569343  7406270.842327 
+319701.980498  7406292.898549 
+319707.975508  7406302.296939 
+319727.758215  7406309.145766 
+319738.173204  7406330.622087 
+319741.133601  7406338.990654 
+319746.007124  7406358.727273 
+319750.278671  7406387.052421 
+319755.416073  7406406.299124 
+319759.720605  7406431.084879 
+319760.281349  7406450.021635 
+319758.500163  7406474.497442 
+319755.795399  7406490.124766 
+319747.912003  7406514.290626 
+319738.478315  7406540.456144 
+319730.660888  7406559.312914 
+319725.399793  7406575.420155 
+319723.255773  7406586.248301 
+319722.859954  7406599.636007 
+319722.793984  7406629.170948 
+319724.080396  7406651.907054 
+319726.158446  7406671.873634 
+319725.383301  7406696.359439 
+319719.784110  7406704.688013 
+319718.374005  7406717.115884 
+319722.513612  7406727.134168 
+319723.206296  7406757.698933 
+319726.339863  7406797.872051 
+319729.168321  7406818.858457 
+319736.804330  7406841.664550 
+319743.607470  7406870.769565 
+319751.532098  7406890.536179 
+319755.110962  7406912.292452 
+319762.177982  7406940.637597 
+319769.277986  7406965.963259 
+319771.652901  7406982.140488 
+319771.982750  7406998.807633 
+319769.327464  7407009.645776 
+319763.992153  7407033.321721 
+319748.827334  7407049.079022 
+319743.648702  7407058.117474 
+319741.512928  7407067.685835 
+319739.863682  7407079.283848 
+319743.599224  7407086.902543 
+319752.439183  7407091.531750 
+319766.746394  7407099.850325 
+319779.767192  7407109.968592 
+319790.850126  7407125.675901 
+319792.639558  7407132.544725 
+319791.056282  7407140.653336 
+319793.291010  7407145.972425 
+319798.857216  7407148.052069 
+319806.443748  7407151.661450 
+319814.244682  7407159.060183 
+319822.985687  7407173.037789 
+319833.425415  7407195.363965 
+319842.009741  7407224.738933 
+319849.843660  7407252.844119 
+319857.751795  7407273.880515 
+319866.220674  7407290.117734 
+319871.160166  7407303.305475 
+319877.608718  7407318.512870 
+319885.887934  7407328.441170 
+319892.625104  7407340.379125 
+319903.073079  7407361.445516 
+319908.598053  7407367.804427 
+319923.028957  7407372.493624 
+319937.971127  7407377.702732 
+319954.166724  7407384.421581 
+319969.562436  7407394.679824 
+319987.267094  7407402.688452 
+320007.660022  7407420.305434 
+320018.759448  7407428.504030 
+320031.780247  7407446.560937 
+320041.213934  7407467.857289 
+320043.753774  7407491.623218 
+320043.852728  7407506.270709 
+320044.363995  7407530.256600 
+320045.015447  7407540.114912 
+320049.600351  7407562.881012 
+320052.494778  7407577.808455 
+320047.860396  7407588.506623 
+320043.687804  7407593.625746 
+320041.568522  7407601.434408 
+320042.830196  7407614.362194 
+320045.765854  7407630.589416 
+320051.736125  7407649.256217 
+320053.467833  7407653.315522 
+320058.522773  7407662.493949 
+320067.750305  7407672.392254 
+320077.390148  7407674.511891 
+320081.356585  7407683.640327 
+320084.490153  7407699.577597 
+320067.511164  7407719.354210 
+320054.168763  7407731.342156 
+320043.118814  7407742.590230 
+320037.725779  7407747.589373 
+320033.058412  7407756.377868 
+320032.200804  7407765.206356 
+320037.907196  7407778.144140 
+320045.271080  7407802.959889 
+320047.324391  7407825.206078 
+320051.488738  7407839.633607 
+320051.818587  7407856.300752 
+320047.802673  7407875.197515 
+320041.881879  7407882.466270 
+320026.535644  7407891.394741 
+320015.807298  7407897.103763 
+320004.542947  7407904.812442 
+319995.364892  7407906.992069 
+319990.417154  7407918.560088 
+319991.085098  7407926.898659 
+319994.532023  7407937.786794 
+319997.236786  7407946.405318 
+319996.074068  7407960.022985 
+319994.960827  7407969.101430 
+319996.882199  7407979.219697 
+320003.413213  7407987.118344 
+320015.840283  7407989.257978 
+320031.895694  7407984.878728 
+320043.630080  7407980.699444 
+320061.656340  7407982.899067 
+320076.441832  7408002.235755 
+320079.097118  7408015.643458 
+320083.277957  7408028.311288 
+320087.953570  7408043.008771 
+320092.835338  7408062.245476 
+320088.027786  7408083.661807 
+320079.583646  7408112.866805 
+320078.107570  7408132.543434 
+320075.608963  7408152.460023 
+320074.207103  7408164.567949 
+320066.884450  7408184.194587 
+320056.824049  7408197.972227 
+320046.846110  7408204.441119 
+320037.857719  7408212.939663 
+320026.337734  7408220.398385 
+320017.357589  7408228.387017 
+320012.121233  7408242.974518 
+320005.895329  7408255.292408 
+320000.708450  7408264.830775 
+319994.202174  7408279.408278 
+319985.716802  7408288.416734 
+319975.953265  7408298.415022 
+319966.997859  7408303.884085 
+319954.719221  7408311.332809 
+319952.863819  7408318.381602 
+319953.474040  7408333.289048 
+319957.968236  7408340.907743 
+319965.208427  7408352.845698 
+319971.978582  7408360.994303 
+319980.752571  7408372.952254 
+319987.992762  7408384.890209 
+319990.425400  7408395.518389 
+319992.058154  7408408.666137 
+319991.200546  7408417.494625 
+319991.348978  7408427.842852 
+319993.253857  7408439.990771 
+320002.761761  7408453.718420 
+320010.084414  7408458.587586 
+320021.183840  7408466.526226 
+320034.534488  7408477.514344 
+320036.958879  7408488.402479 
+320035.540528  7408502.520061 
+320031.862709  7408513.348206 
+320031.978156  7408526.725914 
+320031.524613  7408544.902801 
+320030.172232  7408553.221376 
+320024.713227  7408564.279482 
+320017.415313  7408581.626510 
+320007.091032  7408596.673933 
+319990.079058  7408618.970114 
+319978.996124  7408632.997711 
+319972.489848  7408647.325257 
+319967.773004  7408660.912929 
+319951.000171  7408684.478893 
+319929.271353  7408720.372744 
+319910.107113  7408754.516896 
+319894.546476  7408783.401948 
+319884.403613  7408805.268203 
+319867.606041  7408831.103777 
+319856.465383  7408851.190336 
+319848.153183  7408868.277410 
+319836.740399  7408890.133666 
+319819.060481  7408903.331405 
+319805.495431  7408912.289871 
+319795.476261  7408922.288158 
+319789.802855  7408929.806870 
+319782.133860  7408934.026147 
+319773.697966  7408938.735341 
+319757.197259  7408936.805671 
+319746.031862  7408935.175950 
+319727.741723  7408934.736026 
+319717.326733  7408934.636043 
+319704.091533  7408936.525719 
+319686.477585  7408943.164582 
+319675.485359  7408949.613477 
+319666.967003  7408961.651415 
+319658.613571  7408982.277882 
+319654.655380  7408996.375468 
+319646.920416  7409006.393752 
+319638.979296  7409012.882640 
+319629.009603  7409018.081749 
+319617.819468  7409018.981595 
+319611.453378  7409019.931433 
+319603.330841  7409018.831621 
+319597.162660  7409001.354615 
+319588.594827  7408994.955711 
+319574.180416  7408988.246860 
+319563.048004  7408983.587658 
+319540.931614  7408983.367696 
+319527.201640  7408984.237547 
+319507.328224  7408988.836759 
+319488.015552  7408989.146706 
+319473.032150  7408987.736947 
+319463.144920  7408985.117396 
+319450.528187  7408977.158759 
+319442.933409  7408974.309247 
+319435.858143  7408969.939996 
+319421.386008  7408969.040150 
+319393.142668  7408972.289593 
+319381.424774  7408974.449223 
+319372.032317  7408973.599369 
+319361.196770  7408965.150816 
+319349.066565  7408958.212005 
+319339.740078  7408951.303188 
+319332.392687  7408948.703633 
+319324.286642  7408946.603993 
+319305.460497  7408948.693635 
+319301.007533  7408960.761568 
+319293.297307  7408968.770196 
+319285.603574  7408975.758999 
+319270.834575  7408978.138591 
+319260.394847  7408979.798307 
+319244.867195  7408982.417858 
+319237.725959  7408984.617482 
+319222.643603  7408992.546123 
+319205.623383  7408992.376153 
+319188.339284  7408992.206182 
+319166.998039  7408991.736262 
+319142.094422  7408991.496303 
+319120.481052  7408992.286168 
+319103.188706  7408993.375981 
+319090.679174  7408998.805051 
+319078.128411  7409007.763517 
+319071.688105  7409015.782143 
+319056.012020  7409032.289316 
+319041.152313  7409043.757351 
+319032.180414  7409050.486199 
+319016.974365  7409070.532765 
+319006.163556  7409083.550535 
+319002.395029  7409103.207168 
+318996.820577  7409125.373371 
+318995.591888  7409145.559914 
+318994.066336  7409169.275851 
+318990.099899  7409184.133306 
+318987.947633  7409195.221407 
+318980.938337  7409209.558951 
+318976.741005  7409215.257975 
+318969.484322  7409221.636882 
+318963.876885  7409223.016646 
+318958.022062  7409223.636540 
+318945.999057  7409217.557581 
+318937.653872  7409216.347788 
+318927.807873  7409214.608086 
+318914.886029  7409214.058180 
+318906.738753  7409215.377954 
+318898.533754  7409218.957341 
+318891.763598  7409226.366072 
+318887.087986  7409241.373502 
+318883.236996  7409253.621404 
+318882.445358  7409265.199420 
+318882.948378  7409276.047562 
+318881.530026  7409292.644719 
+318876.392624  7409305.622496 
+318873.514690  7409319.920047 
+318870.504816  7409328.918506 
+318871.774735  7409339.276732 
+318879.138619  7409359.863205 
+318884.078111  7409375.850467 
+318888.753724  7409392.087686 
+318893.165458  7409409.064778 
+318895.515633  7409427.011703 
+318897.428759  7409442.179105 
+318901.898216  7409456.646627 
+318907.217035  7409467.604750 
+318910.721683  7409479.782664 
+318912.074064  7409486.871450 
+318913.022381  7409499.989203 
+318907.588115  7409514.976636 
+318896.348503  7409528.574307 
+318884.572885  7409533.333492 
+318868.913293  7409540.782216 
+318852.833144  7409545.191460 
+318826.857517  7409549.370744 
+318798.094664  7409553.729998 
+318774.403244  7409557.969272 
+318758.826114  7409562.388515 
+318747.545271  7409567.157698 
+318739.513442  7409574.276478 
+318735.530513  7409581.745199 
+318732.875226  7409586.724346 
+318730.277664  7409609.840387 
+318731.374412  7409627.507360 
+318735.167678  7409649.013677 
+318742.333653  7409667.070584 
+318748.064783  7409681.818057 
+318757.877798  7409695.655687 
+318763.188370  7409706.613810 
+318770.585239  7409715.352313 
+318773.355973  7409726.500404 
+318771.574787  7409737.298554 
+318766.833204  7409744.747278 
+318755.486391  7409752.285987 
+318733.881266  7409764.633872 
+318718.518539  7409770.822812 
+318699.494485  7409781.211032 
+318674.153818  7409801.277595 
+318666.534301  7409812.185727 
+318661.504100  7409820.884237 
+318660.968095  7409842.790484 
+318661.462869  7409853.888583 
+318661.924658  7409876.574697 
+318656.374945  7409896.351310 
+318645.828016  7409912.988460 
+318640.220579  7409924.446497 
+318629.269584  7409936.784384 
+318613.387344  7409953.801469 
+318597.480365  7409971.568426 
+318575.932965  7409992.224888 
+318557.362453  7410004.892718 
+318545.809484  7410010.671728 
+318529.984967  7410016.670700 
+318516.452903  7410018.550378 
+318494.229311  7410025.079260 
+318475.815478  7410031.198212 
+318458.399439  7410038.346987 
+318446.788746  7410046.395609 
+318438.707440  7410055.274088 
+318429.059351  7410066.132228 
+318422.816954  7410093.447549 
+318410.678502  7410113.074187 
+318398.449342  7410125.632036 
+318385.395559  7410140.949412 
+318378.345032  7410159.686203 
+318368.985560  7410179.622788 
+318362.388576  7410200.629190 
+318347.702039  7410220.695753 
+318332.256849  7410240.492362 
+318324.777518  7410255.939716 
+318318.625830  7410269.147453 
+318310.387845  7410284.574811 
+318301.259268  7410305.521223 
+318295.519891  7410311.940123 
+318289.442419  7410322.128378 
+318278.870752  7410329.437126 
+318258.865396  7410338.295609 
+318246.388849  7410340.515229 
+318231.059106  7410344.944470 
+318219.778263  7410349.973608 
+318211.144459  7410360.861743 
+318205.545269  7410372.059825 
+318199.583244  7410387.797130 
+318196.952697  7410402.354636 
+318192.178129  7410431.969563 
+318193.670697  7410443.347614 
+318198.544219  7410451.776171 
+318203.656882  7410460.454684 
+318205.611239  7410463.524158 
+318209.223088  7410471.672762 
+318209.536445  7410479.491423 
+318204.530983  7410487.190105 
+318200.943872  7410499.198048 
+318201.809726  7410505.267008 
+318206.526570  7410509.406299 
+318211.342369  7410520.104467 
+318220.751318  7410529.642833 
+318228.115202  7410539.651118 
+318230.572579  7410542.730591 
+318231.990931  7410547.039853 
+318233.516483  7410557.408077 
+318228.478036  7410566.616499 
+318219.102072  7410576.724768 
+318211.004274  7410586.363117 
+318205.809148  7410591.282274 
+318200.671747  7410593.931821 
+318186.372783  7410597.881144 
+318174.432241  7410598.860976 
+318157.420267  7410599.720829 
+318146.502257  7410599.970786 
+318136.326409  7410601.490526 
+318128.698645  7410602.070427 
+318121.013159  7410605.159897 
+318120.172043  7410608.419339 
+318120.081334  7410612.198692 
+318123.495274  7410618.067686 
+318126.414440  7410623.176811 
+318133.638138  7410628.635876 
+318138.643600  7410631.275424 
+318141.059745  7410636.374551 
+318141.307132  7410646.962737 
+318139.575424  7410655.491276 
+318137.464389  7410658.970680 
+318133.151610  7410669.448885 
+318128.723384  7410674.128084 
+318122.777852  7410679.027245 
+318111.348576  7410679.517161 
+318098.220577  7410676.937602 
+318083.707211  7410668.788998 
+318065.590242  7410663.069978 
+318057.335765  7410658.340788 
+318044.735525  7410655.021357 
+318037.586043  7410656.871040 
+318029.447013  7410668.269087 
+318019.980341  7410682.156708 
+318010.241542  7410696.544244 
+317996.618769  7410714.621148 
+317984.364870  7410728.438781 
+317967.122002  7410749.205224 
+317954.274375  7410766.282299 
+317940.165074  7410783.339377 
+317929.453221  7410796.187176 
+317915.706754  7410808.974986 
+317901.630438  7410813.934136 
+317884.280369  7410818.313386 
+317868.307420  7410818.183408 
+317856.944115  7410815.903799 
+317831.694156  7410804.575739 
+317835.998689  7410790.058226 
+317850.322391  7410755.864083 
+317857.974893  7410744.376051 
+317860.325069  7410736.567388 
+317861.644466  7410721.270009 
+317860.366300  7410703.323083 
+317857.521351  7410690.205330 
+317846.059090  7410675.127912 
+317832.065237  7410652.911718 
+317818.714589  7410638.924114 
+317810.550821  7410630.975475 
+317795.212832  7410625.556404 
+317782.472406  7410622.786878 
+317770.828728  7410622.646902 
+317748.646367  7410624.236630 
+317707.225551  7410632.315246 
+317669.226920  7410637.074431 
+317647.069298  7410636.804477 
+317624.590074  7410632.035294 
+317608.905743  7410624.746542 
+317594.779950  7410612.618620 
+317584.785518  7410600.910625 
+317566.346947  7410573.045398 
+317557.515233  7410557.987977 
+317546.457038  7410540.670944 
+317529.750175  7410525.143603 
+317520.786522  7410520.924326 
+317507.666769  7410518.894674 
+317490.696027  7410523.913814 
+317463.491712  7410536.651632 
+317450.611099  7410545.830060 
+317419.836167  7410573.845261 
+317395.534525  7410594.831666 
+317363.629859  7410622.826871 
+317341.274327  7410638.614167 
+317333.333207  7410642.623480 
+317326.183725  7410643.663302 
+317319.430062  7410643.203381 
+317316.477912  7410638.684155 
+317313.204158  7410630.425570 
+317310.689058  7410621.057174 
+317306.722621  7410606.429680 
+317298.542360  7410599.610848 
+317286.519356  7410599.460874 
+317272.187407  7410603.760137 
+317251.646046  7410624.426597 
+317237.165665  7410640.683812 
+317228.111304  7410643.563319 
+317204.799210  7410645.512985 
+317180.662493  7410652.691756 
+317170.041348  7410660.770372 
+317169.175494  7410670.478709 
+317172.094659  7410677.237551 
+317177.982468  7410687.025874 
+317187.688281  7410692.374958 
+317206.456702  7410693.354790 
+317267.305638  7410694.854533 
+317278.512266  7410699.473742 
+317285.191713  7410706.282576 
+317291.071275  7410716.820771 
+317289.397290  7410730.988344 
+317284.771155  7410740.646690 
+317271.816326  7410754.684285 
+317262.728980  7410760.543282 
+317252.924212  7410763.412790 
+317240.942439  7410760.273328 
+317227.459852  7410757.123867 
+317216.211993  7410754.734277 
+317204.156004  7410757.573790 
+317195.786080  7410766.442271 
+317175.186996  7410791.587964 
+317162.298137  7410800.396455 
+317142.713339  7410804.635729 
+317111.946653  7410801.256308 
+317068.472525  7410792.507806 
+317040.732205  7410787.678634 
+317014.484453  7410783.609331 
+316998.709414  7410783.419363 
+316975.372581  7410786.868772 
+316957.280351  7410791.118044 
+316935.477317  7410792.347834 
+316920.436192  7410793.467642 
+316909.881017  7410796.327152 
+316904.529213  7410803.725885 
+316904.050932  7410811.944477 
+316903.894254  7410824.262367 
+316908.561620  7410842.259284 
+316914.375213  7410857.646649 
+316919.520861  7410867.424974 
+316924.732479  7410870.844388 
+316932.228302  7410872.434116 
+316936.755483  7410870.994362 
+316947.384874  7410861.795938 
+316954.262231  7410852.907460 
+316959.935637  7410849.618024 
+316965.584305  7410848.568204 
+316973.830536  7410850.167930 
+316977.904174  7410855.077089 
+316980.072932  7410861.825933 
+316979.891515  7410876.393438 
+316977.063058  7410892.420692 
+316972.049350  7410903.188848 
+316965.955386  7410909.467772 
+316955.367225  7410914.936835 
+316938.734578  7410923.325398 
+316918.366389  7410929.794290 
+316911.538510  7410934.943408 
+316903.547912  7410943.431954 
+316898.558942  7410951.590557 
+316892.300053  7410971.307180 
+316879.369964  7411014.479785 
+316872.789472  7411030.087111 
+316864.683427  7411047.174184 
+316847.531267  7411066.760829 
+316833.075625  7411081.148365 
+316819.865163  7411086.217497 
+316799.917531  7411089.326964 
+316776.588945  7411091.656565 
+316756.245494  7411096.635712 
+316744.544093  7411100.974969 
+316734.376490  7411102.334736 
+316723.128632  7411100.705015 
+316714.560798  7411094.995993 
+316704.121070  7411088.137168 
+316668.802464  7411058.562234 
+316655.031259  7411047.934054 
+316642.340310  7411041.425169 
+316618.368518  7411035.516181 
+316599.624835  7411031.926796 
+316577.079641  7411032.016781 
+316565.064883  7411031.866806 
+316554.955004  7411029.127276 
+316546.395416  7411022.298445 
+316536.780312  7411010.220514 
+316527.602257  7410992.553540 
+316519.100393  7410981.615414 
+316510.549052  7410974.036712 
+316500.109324  7410967.927759 
+316479.163898  7410960.189084 
+316464.551577  7410957.399562 
+316452.965623  7410952.400418 
+316445.519277  7410947.071331 
+316442.591865  7410940.312489 
+316442.641342  7410936.203193 
+316444.603945  7410929.874277 
+316447.292217  7410925.055102 
+316455.975497  7410921.425724 
+316464.634040  7410920.415897 
+316476.632305  7410922.055616 
+316507.374253  7410927.674653 
+316531.750111  7410931.334027 
+316542.264055  7410931.843939 
+316550.576255  7410927.834626 
+316553.643853  7410922.645515 
+316556.398094  7410912.967173 
+316556.158954  7410902.129029 
+316552.909939  7410891.630827 
+316542.866030  7410883.282258 
+316529.432920  7410875.643566 
+316515.216418  7410870.984364 
+316506.986680  7410867.894893 
+316499.515595  7410864.815421 
+316498.064259  7410860.316191 
+316499.631042  7410855.477020 
+316507.456715  7410830.171355 
+316510.252188  7410817.133588 
+316509.237901  7410807.775191 
+316504.446841  7410800.616417 
+316495.854269  7410796.407138 
+316485.719651  7410795.907224 
+316476.690029  7410797.286988 
+316472.888517  7410800.596421 
+316470.200245  7410805.045659 
+316466.679105  7410816.213746 
+316463.520798  7410828.871578 
+316459.620331  7410840.409601 
+316451.143206  7410857.116739 
+316439.334604  7410870.044525 
+316431.022404  7410873.673903 
+316423.872922  7410875.073664 
+316417.877912  7410873.513931 
+316412.649802  7410871.204326 
+316410.439812  7410867.434972 
+316409.037953  7410859.206381 
+316408.411239  7410849.478048 
+316410.019254  7410840.909516 
+316414.670128  7410829.391489 
+316422.025766  7410812.294417 
+316429.356665  7410796.327152 
+316433.619966  7410785.918935 
+316435.599062  7410777.720339 
+316434.230187  7410767.242134 
+316428.688720  7410759.703425 
+316419.749806  7410753.244532 
+316410.019254  7410750.135064 
+316395.357456  7410751.444840 
+316379.895773  7410756.104042 
+316350.423745  7410769.561737 
+316342.095052  7410774.310923 
+316336.050565  7410777.230423 
+316329.659736  7410777.520374 
+316324.431626  7410774.840833 
+316316.581215  7410771.751362 
+316308.706064  7410770.161634 
+316303.799557  7410771.971324 
+316300.715467  7410778.280243 
+316299.107452  7410787.228711 
+316297.095372  7410797.666923 
+316292.848563  7410806.575397 
+316290.152045  7410812.524378 
+316279.934966  7410817.993441 
+316266.691519  7410825.302189 
+316256.870258  7410830.031379 
+316241.045742  7410833.570773 
+316229.377325  7410834.920541 
+316219.630281  7410833.310817 
+316211.425281  7410828.351667 
+316202.865694  7410821.892773 
+316191.741529  7410810.544717 
+316185.861966  7410799.636585 
+316179.652555  7410785.369029 
+316178.275434  7410775.260761 
+316176.997268  7410757.683771 
+316174.869741  7410747.205566 
+316170.812595  7410741.176599 
+316164.091917  7410738.097126 
+316156.950682  7410738.017140 
+316148.267401  7410741.636520 
+316137.984351  7410752.344686 
+316126.167503  7410766.392280 
+316113.484800  7410789.398339 
+316107.349604  7410799.036688 
+316095.565741  7410810.094794 
+316065.244351  7410831.381148 
+316045.873955  7410848.328245 
+316038.229699  7410858.316534 
+316032.440845  7410870.944371 
+316029.966976  7410888.101432 
+316029.777313  7410903.408810 
+316034.131322  7410916.166625 
+316042.583709  7410931.214047 
+316051.093819  7410941.412300 
+316059.298818  7410946.371451 
+316074.645054  7410951.040651 
+316082.116139  7410954.500059 
+316089.562485  7410960.189084 
+316093.545414  7410972.197027 
+316097.915917  7410983.085162 
+316103.053318  7410992.493551 
+316110.854252  7411000.062254 
+316118.308845  7411005.011406 
+316128.781558  7411008.500809 
+316149.751722  7411014.369803 
+316162.112822  7411016.759394 
+316181.606911  7411020.368776 
+316195.831659  7411024.658041 
+316202.511106  7411031.456877 
+316204.663372  7411039.705464 
+316204.300538  7411068.840473 
+316203.673825  7411088.627084 
+316204.597402  7411105.084265 
+316207.376382  7411123.421124 
+316208.671040  7411139.878305 
+316208.868950  7411154.075873 
+316206.461051  7411166.743703 
+316197.217026  7411184.560651 
+316186.092861  7411203.097476 
+316168.907716  7411225.303672 
+316148.679712  7411250.449365 
+316119.380855  7411280.344244 
+316085.917651  7411312.048814 
+316041.519945  7411347.362765 
+316000.833043  7411386.456068 
+315988.991456  7411401.993407 
+315977.092145  7411422.019977 
+315964.326980  7411451.374948 
+315953.367740  7411486.348958 
+315943.686665  7411509.764947 
+315936.718600  7411526.112147 
+315921.834154  7411544.608978 
+315913.101395  7411551.967718 
+315903.280135  7411556.326971 
+315893.096040  7411559.196480 
+315883.703583  7411559.446437 
+315872.101136  7411555.937038 
+315861.249097  7411552.447636 
+315852.986374  7411551.597781 
+315843.981490  7411551.107865 
+315836.427943  7411553.997370 
+315830.325732  7411561.026166 
+315824.932697  7411571.794322 
+315820.685888  7411581.072732 
+315815.152668  7411602.669033 
+315812.381934  7411613.847118 
+315807.054869  7411619.386170 
+315802.131869  7411622.685604 
+315797.208870  7411625.615103 
+315787.437086  7411625.865060 
+315778.836268  7411622.765591 
+315774.746137  7411618.976240 
+315771.793987  7411614.836949 
+315771.117796  7411608.847975 
+315773.443233  7411602.898994 
+315776.255198  7411588.361484 
+315775.974826  7411580.892763 
+315774.539982  7411575.273726 
+315771.216751  7411570.744501 
+315767.093635  7411569.944638 
+315758.839159  7411569.464721 
+315748.292230  7411571.574359 
+315732.071894  7411576.233561 
+315715.076413  7411583.862255 
+315701.123790  7411587.801580 
+315686.849565  7411587.621611 
+315675.230626  7411585.232020 
+315666.671039  7411578.403190 
+315651.803085  7411565.885334 
+315644.793789  7411555.337141 
+315641.544774  7411544.469002 
+315642.468352  7411531.031304 
+315647.828402  7411522.882700 
+315656.528175  7411518.133513 
+315683.971631  7411516.983710 
+315700.884650  7411516.443803 
+315711.439825  7411513.964227 
+315737.901979  7411500.846474 
+315744.729858  7411495.327420 
+315766.005133  7411476.910574 
+315781.277152  7411457.673869 
+315786.356830  7411442.046546 
+315783.454157  7411433.418024 
+315771.950665  7411422.069968 
+315746.106978  7411415.401110 
+315705.601493  7411409.662093 
+315691.368499  7411406.122700 
+315629.200167  7411390.405392 
+315606.704449  7411386.386080 
+315589.115239  7411380.937014 
+315575.649145  7411376.287810 
+315557.622885  7411375.307978 
+315540.322293  7411376.957695 
+315522.230063  7411381.586902 
+315504.137833  7411386.226108 
+315493.986723  7411386.846002 
+315484.231432  7411385.226279 
+315473.395885  7411380.607070 
+315460.028745  7411368.109211 
+315435.957998  7411339.794061 
+315413.025230  7411311.108975 
+315397.093513  7411293.352016 
+315385.573528  7411282.753832 
+315371.752846  7411276.604885 
+315350.378616  7411272.975507 
+315328.196255  7411274.565234 
+315313.130392  7411277.364755 
+315302.616448  7411277.224779 
+315297.767664  7411274.175301 
+315292.918881  7411271.135822 
+315290.387288  7411263.627108 
+315292.374630  7411255.058576 
+315298.105760  7411246.909971 
+315310.194734  7411241.830841 
+315336.549687  7411237.311615 
+315348.226350  7411235.211975 
+315355.796389  7411230.822727 
+315358.138319  7411223.384001 
+315355.606726  7411215.885286 
+315344.828903  7411206.406909 
+315331.775120  7411198.768218 
+315297.701695  7411189.749762 
+315278.224098  7411184.650636 
+315269.994360  7411181.561165 
+315266.300048  7411176.652006 
+315267.512244  7411170.323090 
+315272.468229  7411164.034167 
+315284.590188  7411156.715421 
+315294.427941  7411150.856424 
+315302.369061  7411146.477175 
+315305.815986  7411141.288063 
+315307.778588  7411134.589211 
+315306.368483  7411127.470430 
+315294.098092  7411117.232184 
+315278.092158  7411105.454201 
+315263.174727  7411096.295770 
+315250.063220  7411093.146310 
+315225.308036  7411089.846875 
+315202.787580  7411088.067180 
+315189.313239  7411084.167848 
+315179.566194  7411082.548125 
+315153.227734  7411085.577606 
+315134.797408  7411087.217325 
+315122.774404  7411087.067351 
+315111.155465  7411085.057695 
+315099.181938  7411081.168361 
+315077.840693  7411074.919432 
+315058.338358  7411072.059922 
+315048.929408  7411073.439685 
+315032.709073  7411078.468824 
+315008.514632  7411090.866700 
+314983.198704  7411102.124772 
+314959.350605  7411116.022391 
+314936.228174  7411132.539562 
+314913.880889  7411146.837113 
+314894.997021  7411154.435811 
+314879.527092  7411159.844885 
+314855.060526  7411163.274297 
+314831.377351  7411164.474092 
+314823.477463  7411165.123981 
+314812.988257  7411162.754386 
+314802.944348  7411154.775753 
+314787.688822  7411143.007769 
+314775.047350  7411132.389588 
+314768.887416  7411119.261836 
+314762.224461  7411101.114945 
+314750.687985  7411072.329875 
+314742.078920  7411060.391920 
+314731.540237  7411051.543436 
+314719.723389  7411045.174527 
+314695.364023  7411040.505327 
+314676.620341  7411037.155900 
+314649.762368  7411031.836811 
+314615.994053  7411027.677524 
+314583.479166  7411024.158127 
+314562.187398  7411024.508067 
+314539.592726  7411028.587368 
+314515.084929  7411035.126248 
+314495.557855  7411044.844583 
+314477.902675  7411053.963021 
+314459.035299  7411060.571889 
+314437.685808  7411065.281083 
+314417.614483  7411068.140593 
+314403.150594  7411072.939771 
+314389.940132  7411077.758945 
+314369.703882  7411093.686217 
+314355.149285  7411105.964114 
+314343.167512  7411112.652968 
+314333.123603  7411114.402669 
+314322.502458  7411112.393013 
+314315.047866  7411107.943775 
+314308.920916  7411097.285601 
+314299.116148  7411079.728608 
+314297.343209  7411071.609999 
+314292.395470  7411066.560864 
+314284.891400  7411065.850985 
+314278.055275  7411062.021641 
+314274.369210  7411056.372609 
+314271.318105  7411049.483789 
+314266.419844  7411040.705292 
+314259.591965  7411036.266053 
+314242.736669  7411032.316729 
+314230.210645  7411032.156757 
+314222.648851  7411035.796133 
+314207.517018  7411044.324672 
+314193.663351  7411050.373636 
+314183.602949  7411053.983018 
+314175.430935  7411056.372609 
+314170.417226  7411056.312619 
+314164.818036  7411053.753057 
+314154.271107  7411045.524467 
+314135.725334  7411026.607707 
+314123.924978  7411018.989012 
+314113.312079  7411016.369461 
+314099.573859  7411013.699918 
+314083.939006  7411012.260165 
+314065.830283  7411007.670951 
+314047.762792  7411000.592163 
+314034.709009  7410992.953472 
+314019.882286  7410977.206169 
+314015.025256  7410964.688313 
+314012.642095  7410955.319918 
+314016.575547  7410941.672256 
+314025.514462  7410927.464689 
+314033.166964  7410916.976486 
+314035.797511  7410907.048187 
+314036.605642  7410892.110745 
+314032.317602  7410884.592033 
+314025.497969  7410879.522901 
+314014.835593  7410880.632711 
+313979.088183  7410885.161936 
+313962.801877  7410885.581864 
+313945.921843  7410883.502220 
+313938.442512  7410880.912663 
+313933.470035  7410877.733208 
+313929.759231  7410873.953855 
+313927.953307  7410868.324820 
+313929.924156  7410860.886094 
+313938.813592  7410851.027782 
+313955.273069  7410836.920199 
+313959.107566  7410831.361151 
+313959.800249  7410825.772108 
+313956.147169  7410817.623504 
+313948.676084  7410814.424052 
+313933.041231  7410812.354407 
+313917.950629  7410817.763480 
+313899.066761  7410825.002240 
+313885.831561  7410832.300990 
+313872.538637  7410843.349098 
+313857.258371  7410863.695613 
+313841.986352  7410882.812338 
+313833.022700  7410898.259692 
+313821.626409  7410908.078010 
+313811.549515  7410912.937178 
+313796.458913  7410917.726358 
+313782.671215  7410918.796174 
+313759.524046  7410916.636544 
+313740.128911  7410915.766693 
+313735.106957  7410916.326597 
+313735.717178  7410910.757551 
+313734.859570  7410887.261576 
+313730.324143  7410871.024357 
+313725.120771  7410863.615626 
+313716.445737  7410852.097599 
+313704.859783  7410846.838500 
+313698.130859  7410839.909687 
+313689.670226  7410830.411314 
+313688.598216  7410819.283220 
+313685.002859  7410807.105306 
+313678.587292  7410796.897055 
+313675.585664  7410794.317496 
+313663.941986  7410792.847748 
+313647.754636  7410790.028231 
+313638.230239  7410783.039428 
+313633.562873  7410774.380911 
+313630.462290  7410748.325374 
+313636.704686  7410739.596870 
+313641.083435  7410735.887505 
+313648.768922  7410731.228303 
+313656.264746  7410723.289663 
+313659.744655  7410713.001425 
+313660.165213  7410703.163110 
+313643.276932  7410682.416664 
+313637.817928  7410675.497849 
+313629.093416  7410666.259432 
+313614.827437  7410655.151334 
+313604.288754  7410648.642449 
+313592.513136  7410640.103912 
+313574.379675  7410632.205265 
+313566.958068  7410621.467104 
+313559.289073  7410609.979072 
+313555.240174  7410594.751680 
+313547.884536  7410580.234167 
+313543.035753  7410567.026429 
+313535.407989  7410539.121209 
+313532.596025  7410510.796061 
+313531.136442  7410492.599178 
+313531.787894  7410469.883069 
+313534.649336  7410451.006302 
+313540.504160  7410435.209008 
+313551.339707  7410410.163299 
+313563.527636  7410394.725943 
+313572.623228  7410382.518034 
+313584.539031  7410368.350461 
+313601.419066  7410272.726840 
+313598.079342  7410260.548926 
+313596.248679  7410248.650964 
+313596.405357  7410240.072434 
+313592.653322  7410222.085515 
+313587.705584  7410214.676784 
+313575.921720  7410206.888118 
+313567.650751  7410201.189094 
+313553.821822  7410193.870348 
+313541.287552  7410185.321812 
+313537.081974  7410179.182863 
+313522.321221  7410167.054941 
+313515.831438  7410161.135955 
+313503.025041  7410153.327292 
+313494.259298  7410146.608443 
+313488.585892  7410137.420017 
+313475.581586  7410126.831831 
+313468.102255  7410118.873194 
+313462.635004  7410112.464292 
+313453.729075  7410099.186566 
+313451.345914  7410090.308087 
+313445.672507  7410081.369618 
+313435.933709  7410072.101205 
+313428.660534  7410067.432005 
+313421.205941  7410058.213584 
+313417.066333  7410048.545240 
+313416.052047  7410033.887751 
+313421.271911  7410025.139250 
+313426.458790  7410018.920315 
+313431.678654  7410010.431769 
+313442.720357  7410002.553118 
+313449.218387  7409993.834612 
+313464.391451  7409981.996640 
+313479.745932  7409974.187977 
+313491.826660  7409965.069539 
+313499.594610  7409955.871115 
+313512.368021  7409921.766956 
+313514.891367  7409907.929327 
+313517.802287  7409900.910529 
+313523.112859  7409887.122891 
+313529.124361  7409877.134601 
+313543.035753  7409864.766720 
+313554.432043  7409851.089063 
+313564.154349  7409831.822363 
+313570.668871  7409807.456537 
+313578.733685  7409795.728546 
+313584.423584  7409789.529607 
+313593.634624  7409785.150358 
+313605.319533  7409784.350495 
+313610.390965  7409784.180524 
+313626.166004  7409781.690950 
+313634.313280  7409779.821270 
+313646.575425  7409775.242055 
+313656.297731  7409770.112933 
+313666.044775  7409764.233940 
+313679.115051  7409756.385285 
+313695.797175  7409745.577136 
+313710.368265  7409739.028258 
+313727.009158  7409730.239763 
+313735.197665  7409726.350429 
+313741.283384  7409726.460411 
+313754.897910  7409731.499547 
+313760.678518  7409734.379054 
+313772.297457  7409737.618499 
+313778.185266  7409734.189087 
+313787.148918  7409729.549881 
+313799.707928  7409722.201140 
+313804.218616  7409710.923072 
+313806.362636  7409704.144233 
+313806.065772  7409692.026309 
+313805.315365  7409676.868905 
+313802.932204  7409667.990426 
+313802.041611  7409660.651683 
+313798.405023  7409650.743380 
+313795.040561  7409640.335163 
+313792.937772  7409629.696985 
+313792.847064  7409620.348587 
+313794.397355  7409603.971392 
+313796.269250  7409584.064802 
+313799.122445  7409580.075485 
+313810.873324  7409575.486271 
+313822.335585  7409573.166668 
+313832.808298  7409568.817413 
+313840.864865  7409557.599335 
+313844.905518  7409544.041657 
+313852.838392  7409525.504832 
+313858.495306  7409506.418102 
+313864.836657  7409491.890590 
+313870.905883  7409478.372906 
+313879.432486  7409469.434437 
+313888.758972  7409458.496310 
+313905.779193  7409442.399068 
+313923.170493  7409434.120486 
+313941.130783  7409422.582462 
+313954.959712  7409415.263716 
+313969.357631  7409404.405576 
+313977.628600  7409395.467107 
+313985.495504  7409380.719633 
+313990.855554  7409364.152471 
+313995.597137  7409353.894228 
+314001.328267  7409330.768189 
+314006.127573  7409317.480465 
+314012.238030  7409301.433214 
+314017.680542  7409280.326829 
+314020.508999  7409263.459718 
+314022.669512  7409241.283517 
+314027.171954  7409215.367956 
+314028.557321  7409194.191583 
+314033.851401  7409167.026237 
+314039.887642  7409134.261849 
+314044.587993  7409122.963784 
+314051.283932  7409114.215283 
+314059.761057  7409105.736735 
+314073.350845  7409092.778955 
+314084.186393  7409077.771525 
+314090.412297  7409065.993543 
+314098.773975  7409045.407069 
+314098.402894  7409034.558927 
+314097.586517  7409017.901780 
+314093.438663  7409004.744034 
+314084.573965  7408982.947768 
+314063.282198  7408961.511439 
+314049.568716  7408942.444705 
+314041.569873  7408933.266278 
+314036.407732  7408919.338663 
+314034.832702  7408903.181431 
+314036.778813  7408889.333803 
+314042.064646  7408871.486860 
+314044.472546  7408861.168627 
+314043.351058  7408849.050703 
+314038.683692  7408836.642828 
+314030.660109  7408828.984140 
+314018.612366  7408819.255807 
+314006.515146  7408813.066867 
+313994.690051  7408805.358187 
+313975.764952  7408797.829477 
+313948.486421  7408789.440914 
+313931.045643  7408785.201640 
+313906.546092  7408777.352984 
+313877.486375  7408769.194382 
+313856.252331  7408764.155245 
+313833.533966  7408755.826671 
+313820.191565  7408747.598081 
+313806.387375  7408736.589966 
+313794.083998  7408726.111761 
+313785.631612  7408712.894025 
+313782.275396  7408696.466839 
+313785.194562  7408685.908648 
+313790.463903  7408669.821403 
+313792.154380  7408655.973775 
+313790.290732  7408642.336111 
+313785.384225  7408628.658454 
+313780.700366  7408617.760321 
+313772.734507  7408605.312453 
+313767.308487  7408592.884582 
+313757.140885  7408574.107798 
+313749.983157  7408557.880578 
+313741.407077  7408554.251199 
+313738.388957  7408531.765051 
+313738.776529  7408499.740537 
+313743.460388  7408468.525883 
+313748.037046  7408446.889590 
+313750.618117  7408422.203818 
+313754.246458  7408395.008476 
+313761.593850  7408374.661961 
+313772.305703  7408348.306476 
+313784.270984  7408323.470730 
+313793.762395  7408293.315895 
+313798.941028  7408263.870939 
+313798.033943  7408233.846082 
+313802.907465  7408208.680393 
+313814.336741  7408185.864301 
+313824.421881  7408169.837046 
+313843.907724  7408152.160074 
+313860.103321  7408133.683239 
+313874.583702  7408110.397228 
+313888.833189  7408085.341519 
+313904.839122  7408061.315635 
+313919.261780  7408042.818803 
+313940.512316  7408026.171655 
+313958.654023  7408014.783605 
+313971.476912  7408002.565698 
+313981.248695  7407991.587579 
+313987.029303  7407974.500505 
+313991.820363  7407955.643735 
+313995.638368  7407933.997443 
+314007.166598  7407924.039149 
+314017.993899  7407909.291675 
+314032.870099  7407895.334066 
+314048.241073  7407882.146325 
+314065.376740  7407869.988407 
+314085.307880  7407857.110613 
+314098.048306  7407852.211452 
+314115.357144  7407846.612412 
+314133.391651  7407843.542937 
+314148.135911  7407840.683427 
+314159.062167  7407838.793751 
+314170.343010  7407828.335542 
+314181.665085  7407814.587897 
+314194.727114  7407803.649771 
+314209.289958  7407794.231384 
+314227.687298  7407782.593377 
+314247.610192  7407770.465455 
+314265.034477  7407755.787969 
+314274.501150  7407748.579204 
+314289.278395  7407742.700211 
+314301.977590  7407740.580574 
+314321.760297  7407740.550579 
+314332.397935  7407741.180471 
+314344.577618  7407740.820533 
+314359.297139  7407739.220807 
+314374.090877  7407732.082030 
+314387.210630  7407716.594682 
+314395.555816  7407697.277991 
+314401.097283  7407679.681005 
+314415.767327  7407661.694086 
+314432.004155  7407639.937813 
+314448.249229  7407617.681625 
+314460.371188  7407600.424581 
+314485.802564  7407572.979282 
+314502.154839  7407563.080978 
+314519.241029  7407554.952370 
+314529.227214  7407546.743776 
+314533.399807  7407536.955453 
+314535.131515  7407520.078344 
+314532.698877  7407511.219861 
+314527.528491  7407498.552031 
+314519.941959  7407476.015891 
+314519.142074  7407458.858830 
+314524.122798  7407445.051195 
+314533.721410  7407427.254244 
+314544.878560  7407405.947893 
+314552.918635  7407391.160426 
+314560.975202  7407375.113175 
+314565.510629  7407356.746321 
+314575.422598  7407333.660276 
+314584.996472  7407317.882978 
+314595.361984  7407299.596111 
+314605.174999  7407284.578683 
+314619.564671  7407268.601420 
+314639.833906  7407248.914792 
+314656.516031  7407232.707568 
+314674.228934  7407214.500687 
+314690.135913  7407199.303290 
+314700.691088  7407186.315514 
+314707.881801  7407178.576840 
+314717.348474  7407171.118118 
+314725.743137  7407169.198446 
+314735.877754  7407169.828339 
+314740.891463  7407174.677508 
+314752.164060  7407185.645629 
+314760.105180  7407200.113151 
+314770.165581  7407206.282094 
+314781.050606  7407207.671856 
+314792.479882  7407206.542050 
+314802.993826  7407196.833713 
+314816.336227  7407183.366020 
+314825.835884  7407173.637686 
+314838.312431  7407160.229983 
+314853.031953  7407138.153764 
+314866.984575  7407116.327503 
+314875.997705  7407081.823413 
+Region 1
+252
+343920.788828  7392520.207686 
+343850.374264  7392483.813920 
+343742.785693  7392426.073810 
+343715.886489  7392402.337876 
+343693.737113  7392377.812077 
+343620.799203  7392248.074300 
+343571.387789  7392211.550556 
+343577.737387  7392200.642425 
+343655.136507  7392134.113820 
+343671.604230  7392129.404627 
+343693.737113  7392125.465302 
+343725.386146  7392115.187062 
+343788.494549  7392080.562993 
+343868.565449  7392040.829799 
+343941.346681  7391992.568066 
+344002.269833  7391947.455793 
+344015.719435  7391938.367350 
+344018.094349  7391923.339924 
+344012.561129  7391886.156293 
+344066.351291  7391871.918732 
+344154.157155  7391847.392933 
+344230.888331  7391821.287405 
+344260.162450  7391803.090522 
+344316.327527  7391766.706754 
+344362.209554  7391735.852039 
+344411.258134  7391720.824613 
+344419.957907  7391650.416673 
+344417.582993  7391623.521280 
+344394.641979  7391528.597540 
+344339.268541  7391424.175426 
+344338.691304  7391418.866336 
+344321.316496  7391388.441547 
+344306.836115  7391360.096402 
+344291.803237  7391330.831415 
+344272.638997  7391296.097365 
+344251.454430  7391256.474152 
+344228.513417  7391212.961605 
+344214.280423  7391182.106890 
+344207.155679  7391172.618516 
+344202.537790  7391164.879841 
+344184.214666  7391137.814477 
+344174.368666  7391120.917372 
+344162.551818  7391099.740999 
+344145.003839  7391069.996094 
+344120.141454  7391033.392364 
+344116.974901  7391026.273583 
+344080.584285  7390971.682934 
+344047.360222  7390980.391443 
+344080.576039  7390971.682934 
+344080.584285  7390971.682934 
+344090.867335  7390965.364017 
+344208.738956  7390876.759194 
+344291.011599  7390883.088110 
+344333.727074  7390886.257567 
+344357.731851  7390887.677324 
+344410.466496  7390894.166212 
+344457.140161  7390897.325671 
+344506.972133  7390902.864722 
+344552.070769  7390909.193638 
+344596.369520  7390914.732689 
+344613.043398  7390915.402575 
+344646.201491  7390918.682013 
+344697.616740  7390926.600656 
+344761.706444  7390934.509302 
+344786.222488  7390936.878896 
+344807.910074  7390937.458796 
+344817.739581  7390934.599286 
+344827.882445  7390928.310364 
+344840.812535  7390925.810792 
+344929.410037  7390874.389600 
+344983.991837  7390852.233395 
+345006.701957  7390837.985835 
+345043.323467  7390825.338002 
+345056.146356  7390819.509000 
+345070.107224  7390813.909959 
+345089.213741  7390804.771525 
+345106.580302  7390793.013539 
+345130.156276  7390774.256752 
+345141.395888  7390765.658224 
+345149.328762  7390756.519790 
+345188.003584  7390719.026212 
+345229.531601  7390684.702091 
+345238.899319  7390678.043232 
+345250.757399  7390674.673809 
+345284.599929  7390662.295929 
+345303.607491  7390662.315926 
+345319.613425  7390663.535717 
+345391.949360  7390687.321643 
+345467.377632  7390713.707123 
+345506.308087  7390720.585945 
+345538.542602  7390722.505616 
+345566.381877  7390720.206010 
+345600.447056  7390712.697296 
+345633.860782  7390701.719177 
+345677.722483  7390675.953590 
+345689.225975  7390667.705003 
+345772.290256  7390589.388418 
+345820.126640  7390549.035330 
+345848.238040  7390525.309394 
+345864.903673  7390511.921687 
+345922.990121  7390469.149014 
+345960.568194  7390446.992809 
+345991.499805  7390433.065195 
+346028.929446  7390421.347202 
+346068.940157  7390415.348229 
+346121.518124  7390407.269613 
+346124.049717  7390406.149805 
+346162.262750  7390396.271497 
+346216.077651  7390380.554189 
+346251.132377  7390365.706732 
+346258.694171  7390382.663828 
+346263.221351  7390398.441125 
+346271.583029  7390408.939327 
+346278.460386  7390424.736621 
+346283.251446  7390435.194830 
+346280.752838  7390449.572367 
+346282.088727  7390458.440848 
+346287.539486  7390464.369832 
+346295.348666  7390468.769079 
+346300.156219  7390477.457591 
+346301.607555  7390485.336241 
+346306.052273  7390489.705493 
+346313.490374  7390500.523640 
+346320.293514  7390513.551408 
+346322.833353  7390524.209582 
+346330.279699  7390534.477823 
+346343.721055  7390547.135655 
+346352.709446  7390556.424064 
+346362.266828  7390569.481828 
+346366.587853  7390586.028993 
+346366.892963  7390595.557361 
+346369.036983  7390615.064020 
+346378.363470  7390628.701684 
+346390.246288  7390646.078707 
+346401.106574  7390661.696032 
+346406.730503  7390670.394542 
+346416.205422  7390691.090997 
+346424.113558  7390715.986733 
+346429.028311  7390734.083633 
+346443.986974  7390747.751292 
+346455.902777  7390760.389127 
+346460.718575  7390777.606178 
+346464.388148  7390797.692737 
+346463.951098  7390829.247332 
+346455.399757  7390866.151011 
+346454.789536  7390877.289103 
+346450.410787  7390923.691155 
+346450.146908  7390948.156964 
+346452.084772  7390967.893583 
+346459.819736  7390994.369048 
+346468.445294  7391023.883993 
+346482.843212  7391052.159149 
+346491.658433  7391089.102821 
+346510.097005  7391121.967192 
+346558.287977  7391169.429062 
+346582.919467  7391235.027826 
+346607.130401  7391291.318184 
+346622.872455  7391338.000187 
+346633.765726  7391359.706469 
+346723.748594  7391468.767788 
+346736.406558  7391460.999119 
+346748.330608  7391451.690713 
+346765.499260  7391457.399735 
+346771.040727  7391491.413909 
+346777.373832  7391532.546863 
+346778.157224  7391546.784425 
+346767.865928  7391591.876701 
+346755.216211  7391653.586130 
+346704.996666  7391885.286442 
+346684.867617  7391909.972214 
+346624.348530  7391987.368956 
+346565.338504  7392082.332690 
+346516.306416  7392184.595173 
+346486.232413  7392292.756646 
+346477.549132  7392398.968453 
+346479.924047  7392470.166258 
+346480.723931  7392523.957044 
+346476.757494  7392577.747830 
+346463.307892  7392630.748751 
+346455.399757  7392652.105093 
+346442.741793  7392679.790351 
+346422.183940  7392720.143439 
+346403.176378  7392745.449104 
+346376.293666  7392773.934225 
+346263.163628  7392865.698506 
+346228.356288  7392901.292410 
+346100.993256  7393158.388371 
+346063.019364  7393227.996448 
+346022.678804  7393283.376962 
+345984.787374  7393324.199969 
+345923.583850  7393378.540661 
+345873.141657  7393416.724121 
+345795.346717  7393465.515763 
+345769.626724  7393483.962603 
+345741.853419  7393512.777668 
+345679.157327  7393578.416424 
+345617.863095  7393643.945200 
+345566.085013  7393697.206077 
+345398.183510  7393875.395555 
+345355.921578  7393919.937925 
+345279.173910  7394006.163155 
+345236.326495  7394060.013931 
+345212.552612  7394097.157569 
+345208.652145  7394101.936750 
+345185.076172  7394137.180713 
+345149.056636  7394192.841179 
+345116.962307  7394154.687714 
+345079.705837  7394106.685937 
+345076.539284  7394101.146885 
+345052.641708  7394071.002049 
+345039.357030  7394058.424203 
+344991.108335  7394021.250571 
+344940.303308  7393987.516349 
+344905.570184  7393968.749564 
+344885.911170  7393956.171718 
+344810.755024  7393910.289577 
+344767.610745  7393877.295229 
+344762.489836  7393871.536216 
+344722.817220  7393825.514099 
+344739.012817  7393811.626478 
+344767.132464  7393789.920196 
+344787.022372  7393771.853290 
+344757.756500  7393710.943724 
+344742.723621  7393680.099007 
+344714.241141  7393624.718493 
+344688.933459  7393556.690146 
+344666.775837  7393483.302716 
+344654.909511  7393420.023556 
+344634.541321  7393360.423765 
+344629.750261  7393350.075537 
+344616.176966  7393302.153746 
+344585.294832  7393250.942518 
+344548.904216  7393201.890920 
+344507.763771  7393158.378373 
+344457.931800  7393116.255588 
+344402.550115  7393079.071958 
+344347.176676  7393044.467885 
+344293.386513  7393008.863984 
+344268.070585  7392984.938082 
+344226.938387  7392941.625501 
+344190.547771  7392893.173800 
+344174.723254  7392863.108950 
+344159.690376  7392829.884641 
+344147.172598  7392791.691183 
+344131.216141  7392754.737513 
+344117.774785  7392723.292899 
+344098.255957  7392689.438698 
+344081.186260  7392664.362993 
+344054.402503  7392628.809083 
+344025.639650  7392597.804394 
+343967.462493  7392552.642130 
+343920.788828  7392520.207686 
+Region 1
+248
+349181.216036  7394936.783748 
+349134.921697  7394844.179611 
+349102.332593  7394770.442241 
+349036.890507  7394673.808794 
+349082.723057  7394652.302477 
+349075.507605  7394634.605509 
+349056.030008  7394581.804553 
+349021.733935  7394496.059240 
+349013.157855  7394477.192472 
+348996.013942  7394454.896291 
+348966.863516  7394436.039521 
+348934.266167  7394420.602166 
+348908.150354  7394405.054829 
+348885.943255  7394393.146868 
+348860.660312  7394382.698658 
+348851.605951  7394378.309410 
+348828.087701  7394373.620213 
+348802.046104  7394379.539199 
+348775.130408  7394393.146868 
+348751.133876  7394403.435106 
+348733.289033  7394408.244282 
+348711.337567  7394404.124988 
+348682.533484  7394389.037572 
+348653.028470  7394369.830862 
+348629.741115  7394349.954267 
+348615.301965  7394336.216620 
+348596.780931  7394317.009910 
+348575.629349  7394300.402755 
+348564.043395  7394285.045385 
+348539.576829  7394277.136740 
+348520.156956  7394276.726810 
+348498.048812  7394277.016760 
+348471.718597  7394278.736466 
+348456.388854  7394282.605803 
+348428.359916  7394291.924207 
+348391.086954  7394305.601864 
+348368.756161  7394315.800117 
+348324.671812  7394327.808060 
+348284.751810  7394340.295921 
+348223.878135  7394353.103727 
+348101.322655  7394364.211825 
+347921.010576  7394383.298555 
+347829.056858  7394393.236853 
+347815.269160  7394394.876572 
+347780.503052  7394397.376144 
+347752.136018  7394404.394942 
+347713.791046  7394415.393058 
+347685.753862  7394425.081398 
+347661.180094  7394433.319987 
+347626.141860  7394449.337244 
+347609.913278  7394459.275541 
+347548.396398  7394499.508650 
+347318.458502  7394656.561748 
+347294.041414  7394675.868441 
+347218.505941  7394729.509253 
+347186.799184  7394750.175713 
+347176.351210  7394757.204509 
+347140.620292  7394769.772356 
+347066.610372  7394790.678775 
+347018.477124  7394806.536059 
+346962.971745  7394807.515891 
+346860.133003  7394806.746023 
+346822.472468  7394809.665523 
+346782.593696  7394816.694319 
+346686.409662  7394868.085516 
+346699.438706  7394919.356733 
+346704.221520  7394932.394500 
+346713.242897  7394970.258014 
+346724.771127  7395020.579395 
+346738.641287  7395065.541693 
+346741.857317  7395074.060234 
+346746.598900  7395097.636196 
+346756.453145  7395130.210616 
+346763.338748  7395156.226160 
+346770.941772  7395186.081046 
+346784.152234  7395234.612733 
+346850.303496  7395310.679703 
+346862.268777  7395324.447345 
+346881.787605  7395351.112778 
+346907.367412  7395406.183344 
+346914.599357  7395423.100447 
+346934.175908  7395449.815871 
+346950.767324  7395474.181697 
+346964.530283  7395488.949167 
+346981.987553  7395508.755775 
+346996.146331  7395522.783372 
+347014.890014  7395536.141084 
+347045.697931  7395555.087838 
+347084.884019  7395573.624663 
+347101.129094  7395580.663458 
+347124.927715  7395589.561933 
+347162.093477  7395597.210623 
+347177.184079  7395604.819320 
+347205.922193  7395630.164978 
+347213.269584  7395625.355802 
+347231.411292  7395615.077563 
+347254.038949  7395608.698655 
+347290.066730  7395599.180286 
+347318.062683  7395591.771555 
+347326.259437  7395590.031853 
+347416.737079  7395575.204393 
+347449.680771  7395572.064930 
+347569.737643  7395549.508794 
+347523.360842  7395610.978265 
+347457.910509  7395688.844927 
+347404.367733  7395763.672110 
+347334.076863  7395844.648239 
+347280.517595  7395911.086859 
+347310.641076  7395928.273915 
+347269.236752  7396004.040937 
+347234.421166  7396063.240796 
+347202.697917  7396121.100886 
+347183.987219  7396159.784259 
+347170.743773  7396193.348510 
+347157.467342  7396220.433871 
+347127.871620  7396265.856090 
+347122.561047  7396275.024520 
+347113.448962  7396289.142102 
+347102.811325  7396304.029552 
+347082.690522  7396333.044581 
+347075.087497  7396342.972881 
+347035.456113  7396393.084297 
+347007.460160  7396427.338430 
+346934.175908  7396511.733974 
+346913.123281  7396540.808993 
+346870.003741  7396595.929552 
+346849.998386  7396653.999605 
+346767.000074  7396758.541698 
+346753.583457  7396787.756693 
+346743.242684  7396808.623119 
+346729.083906  7396834.408702 
+346713.003756  7396857.004832 
+346682.146361  7396882.460472 
+346606.000667  7396934.001643 
+346663.650065  7397002.509908 
+346678.658205  7396992.001708 
+346706.852068  7396972.755005 
+346732.027810  7396958.037526 
+346751.439437  7396947.169387 
+346776.516224  7396935.491388 
+346811.076177  7396920.004041 
+346833.621372  7396904.226743 
+346866.771219  7396881.600619 
+346876.039982  7396876.561482 
+346969.593469  7396800.504510 
+347090.244069  7396673.536258 
+347142.912744  7396617.095926 
+347183.212074  7396579.642342 
+347230.331036  7396529.600913 
+347266.078445  7396501.295762 
+347291.567544  7396481.419166 
+347312.884051  7396469.931134 
+347347.138893  7396453.453956 
+347369.601625  7396443.085732 
+347395.874116  7396433.877310 
+347446.530711  7396421.159488 
+347491.860240  7396412.650946 
+347535.169444  7396407.641804 
+347549.080835  7396444.745448 
+347559.776196  7396471.230911 
+347602.846259  7396526.611425 
+347651.647452  7396591.260351 
+347795.181342  7396749.863184 
+347881.189528  7396843.797094 
+347954.886091  7396922.083684 
+347954.935569  7396922.053690 
+348032.392413  7397015.107750 
+348016.922484  7397058.280355 
+347984.885878  7397148.324931 
+347963.124076  7397175.420290 
+347931.029746  7397267.334546 
+347919.732410  7397285.871371 
+347963.445679  7397278.942558 
+348020.179746  7397333.523209 
+348135.057985  7397497.035200 
+348145.316296  7397485.957098 
+348149.117808  7397480.238078 
+348151.773094  7397476.418732 
+348156.712586  7397471.069648 
+348164.686691  7397461.521284 
+348186.011444  7397452.322859 
+348205.571503  7397446.363880 
+348224.867683  7397445.733988 
+348249.227048  7397449.543335 
+348287.390603  7397450.503171 
+348309.498748  7397454.252529 
+348370.636302  7397482.077763 
+348438.090469  7397519.371374 
+348523.001906  7397564.603627 
+348534.109578  7397567.783082 
+348545.217251  7397565.393491 
+348599.180584  7397529.689607 
+348671.302117  7397490.556310 
+348691.851724  7397480.208083 
+348733.297279  7397481.267901 
+348828.516505  7397492.375999 
+348865.063799  7397504.653895 
+348920.577424  7397528.089881 
+348977.723802  7397551.105939 
+349034.853688  7397575.701726 
+349094.366735  7397598.717783 
+349152.296505  7397622.523705 
+349207.843115  7397644.739900 
+349359.408834  7397700.300383 
+349420.562880  7397726.975814 
+349439.883799  7397734.424538 
+349485.666871  7397479.588189 
+349504.542493  7397377.255718 
+349508.665609  7397350.580287 
+349528.473055  7397227.991285 
+349557.796651  7397071.808038 
+349564.772962  7397028.975375 
+349576.053805  7396970.225438 
+349585.578202  7396896.428079 
+349593.519322  7396861.504061 
+349599.811196  7396825.810175 
+349607.570899  7396790.106291 
+349608.593431  7396721.048120 
+349605.418633  7396657.558995 
+349598.269151  7396621.065246 
+349595.102598  7396588.520821 
+349581.801428  7396531.910518 
+349572.499680  7396487.558115 
+349562.628942  7396463.452244 
+349552.469586  7396442.385852 
+349542.837988  7396422.829202 
+349533.396054  7396403.672484 
+349505.416594  7396377.436977 
+349486.549218  7396329.155248 
+349468.506465  7396313.287966 
+349449.432934  7396287.542376 
+349450.117371  7396152.125571 
+349463.616450  7396129.989363 
+349485.716349  7396101.494244 
+349508.616131  7396063.180807 
+349625.061154  7396003.940954 
+349602.639653  7395981.724759 
+349531.689084  7395906.387664 
+349487.307871  7395863.325040 
+349443.800758  7395807.954525 
+349418.996096  7395688.824930 
+349399.081449  7395620.606616 
+349374.870516  7395552.828225 
+349340.978508  7395393.055593 
+349290.899150  7395200.498576 
+349202.549034  7395015.310297 
+349200.124643  7394986.265273 
+349181.216036  7394936.783748 
+Region 1
+115
+331139.568375  7398194.775684 
+331145.637601  7398238.988111 
+331157.124600  7398323.783586 
+330389.755115  7398425.616143 
+330238.948049  7398440.953516 
+329851.350470  7398485.715848 
+329395.482347  7398538.076879 
+329263.649858  7398549.594906 
+329181.162813  7398557.763507 
+328821.404508  7398601.735975 
+328705.478998  7398637.709813 
+328615.537360  7398687.691252 
+328421.668478  7398807.610711 
+328317.708248  7398902.424470 
+328241.785202  7398973.502295 
+328141.857379  7399021.464080 
+327890.619470  7399056.238123 
+327687.193206  7399107.099411 
+327604.978287  7399124.166488 
+327502.287977  7399141.383538 
+327116.537553  7399213.321216 
+327105.050554  7399145.072906 
+327095.823022  7399102.290235 
+327092.532776  7399019.634393 
+327088.129289  7398984.530406 
+327088.467384  7398979.811214 
+327157.414118  7398854.862617 
+327190.613443  7398800.841870 
+327199.230754  7398784.624648 
+327204.425879  7398767.957503 
+327206.668854  7398746.291214 
+327205.967925  7398717.346172 
+327205.877216  7398702.978633 
+327210.058055  7398677.463004 
+327215.879894  7398668.454547 
+327222.641803  7398649.817739 
+327330.015972  7398465.119376 
+327336.217138  7398453.081438 
+327353.798101  7398428.965569 
+327363.141081  7398397.071032 
+327395.276641  7398353.138558 
+327460.891899  7398241.927607 
+327509.792046  7398139.425165 
+327559.186968  7398037.662596 
+327587.842620  7397981.352241 
+327733.759671  7397726.455903 
+327815.685972  7397640.850566 
+327930.646674  7397541.787535 
+327964.901516  7397503.874029 
+328048.526541  7397469.529912 
+328093.880809  7397458.611782 
+328131.838209  7397442.654515 
+328168.261810  7397423.387816 
+328199.861366  7397404.161109 
+328246.568016  7397365.287768 
+328257.139684  7397305.528004 
+328268.140155  7397230.790806 
+328283.511129  7397211.914039 
+328399.362424  7397107.361948 
+328485.263408  7397045.412559 
+328559.520715  7396989.872073 
+328632.038068  7396939.930627 
+328663.142850  7396920.453964 
+328690.437873  7396904.796646 
+328737.762991  7396883.450302 
+328796.146304  7396846.536625 
+329060.553443  7396679.945161 
+329161.693462  7396621.455179 
+329188.073154  7396600.328798 
+329240.280040  7396568.444260 
+329359.866877  7396543.888466 
+329486.289839  7396515.243372 
+329616.027786  7396489.867719 
+329680.397862  7396480.359348 
+329730.073156  7396471.450874 
+329838.478104  7396443.395679 
+329954.766448  7396418.369966 
+330026.467424  7396402.212734 
+330118.973639  7396340.983222 
+330211.751980  7396284.582883 
+330162.926049  7396173.591894 
+330199.902147  7396071.269421 
+330213.722829  7396052.872572 
+330222.059769  7396074.118933 
+330293.109292  7396239.940529 
+330363.523855  7396390.924667 
+330429.559670  7396542.708668 
+330466.247150  7396616.925955 
+330460.450050  7396713.489415 
+330456.722754  7396819.181311 
+330458.767819  7396868.192915 
+330457.456669  7396919.554118 
+330458.149352  7396984.532987 
+330459.213116  7397083.336063 
+330476.084904  7397134.487302 
+330480.999657  7397149.084801 
+330498.926963  7397245.178341 
+330510.001650  7397294.999807 
+330551.719331  7397477.308579 
+330567.073813  7397547.076629 
+330578.197978  7397586.129939 
+330587.466741  7397611.735553 
+330607.991609  7397652.518568 
+330635.162939  7397701.900109 
+330657.411269  7397734.804473 
+330692.136147  7397777.527155 
+330734.769159  7397825.039016 
+330793.482321  7397889.997889 
+330871.334985  7397986.731320 
+330942.928759  7398062.308374 
+330981.331455  7398110.820065 
+331057.691551  7398153.602736 
+331066.622219  7398158.281935 
+331110.789030  7398177.908573 
+331139.568375  7398194.775684 
+Region 1
+104
+332883.440001  7393972.568910 
+332834.737763  7393981.237425 
+332776.849224  7393992.055572 
+332680.590974  7394004.803388 
+332622.026244  7394018.381062 
+332506.513045  7394035.928057 
+332485.246016  7394039.187498 
+332451.288038  7394042.966851 
+332422.838542  7394046.116312 
+332403.558855  7394053.924974 
+332383.363836  7394063.463340 
+332320.016292  7394088.599035 
+332237.306599  7394120.463577 
+332216.303449  7394128.482203 
+332195.193099  7394138.010571 
+332174.998080  7394148.418788 
+332140.116525  7394177.893739 
+332124.506410  7394190.031660 
+332110.743451  7394207.368691 
+332094.218005  7394242.042751 
+332083.201041  7394265.448742 
+332074.946564  7394302.732356 
+332069.438082  7394323.538792 
+332046.257927  7394412.353578 
+332039.141430  7394433.629934 
+332010.592980  7394503.887899 
+331988.954871  7394549.330116 
+331983.256725  7394559.408389 
+331968.462987  7394541.271496 
+331937.061341  7394526.514024 
+331922.267603  7394514.856021 
+331908.991172  7394498.378843 
+331900.044012  7394481.391753 
+331892.861545  7394460.065406 
+331885.687324  7394444.848012 
+331838.997166  7394483.041470 
+331682.137367  7394428.010897 
+331567.300359  7394386.358031 
+331478.100882  7394329.657744 
+331400.899671  7394285.885241 
+331372.862486  7394267.158449 
+331244.163565  7394191.021491 
+331112.702156  7394113.314801 
+331065.302822  7394085.219614 
+331030.149141  7394067.272688 
+331017.128343  7394053.065121 
+330989.627163  7394009.142645 
+330931.911795  7393929.406303 
+330870.048573  7393837.811992 
+330806.181516  7393749.777072 
+330699.302121  7393599.372835 
+330801.538889  7393511.227933 
+330894.861481  7393420.303508 
+330953.483934  7393366.462730 
+331028.846236  7393298.264412 
+331103.087051  7393230.246063 
+331168.628092  7393169.086539 
+331240.576454  7393109.116811 
+331390.410465  7392972.170269 
+331536.789305  7392841.392670 
+331650.760459  7392741.629758 
+331671.359543  7392723.602846 
+331692.156537  7392705.036027 
+331727.186525  7392674.131320 
+331896.687796  7392539.074454 
+331984.056610  7392468.866480 
+332000.029558  7392457.088498 
+332079.572699  7392394.139280 
+332219.989515  7392274.429785 
+332337.028266  7392179.646021 
+332461.076314  7392090.601274 
+332497.986442  7392078.373368 
+332541.609002  7392058.756728 
+332559.536308  7392053.557619 
+332555.619348  7392250.453892 
+332557.515981  7392291.436872 
+332555.710057  7392351.046662 
+332577.702754  7392584.276711 
+332580.803337  7392653.954776 
+332583.293698  7392701.066706 
+332584.753281  7392746.688892 
+332582.634000  7392791.091286 
+332575.220638  7392839.113060 
+332573.876503  7392885.275153 
+332572.837478  7392917.239678 
+332578.560362  7392958.982528 
+332583.170005  7392994.156503 
+332591.572914  7393028.010704 
+332603.538194  7393079.041963 
+332610.011485  7393103.287810 
+332616.913581  7393138.681747 
+332625.151565  7393236.764946 
+332635.187228  7393320.950526 
+332641.388393  7393377.150899 
+332653.543337  7393423.622939 
+332669.153452  7393463.186162 
+332691.071933  7393516.607012 
+332714.639660  7393561.139384 
+332749.430507  7393607.281480 
+332766.764084  7393643.535270 
+332783.710088  7393687.697705 
+332806.510916  7393761.085135 
+332838.316627  7393850.359843 
+332883.440001  7393972.568910 
+Region 1
+120
+336981.824879  7397158.343215 
+336633.685514  7397505.313782 
+336447.469133  7397638.350994 
+336366.697304  7397670.655461 
+336275.823842  7397702.969926 
+336197.072340  7397711.048542 
+336150.819232  7397710.118701 
+335944.655219  7397680.753731 
+335969.196002  7397597.128055 
+335989.118895  7397520.771135 
+336000.003920  7397482.547682 
+336009.132497  7397449.823287 
+336038.802435  7397323.244969 
+336046.026133  7397286.361287 
+336088.180864  7397241.199023 
+336000.003920  7397141.376122 
+335983.371272  7397124.139074 
+335961.964058  7397100.653097 
+335895.689102  7397028.375478 
+335841.511366  7396969.895495 
+335788.347918  7396911.155556 
+335708.483174  7396822.300776 
+335608.951170  7396714.019324 
+335504.867247  7396602.918355 
+335403.067529  7396491.327469 
+335420.648493  7396474.910281 
+335488.391278  7396414.320660 
+335504.191056  7396397.133604 
+335574.721066  7396336.044068 
+335582.629202  7396325.665845 
+335644.756303  7396271.635100 
+335654.709504  7396257.977440 
+335678.640065  7396238.040855 
+335711.509540  7396204.936525 
+335778.229792  7396145.606688 
+335806.778243  7396115.031925 
+335815.816112  7396082.297532 
+335844.158407  7395989.423441 
+335876.409415  7395877.872548 
+335922.143010  7395706.351928 
+335942.206089  7395626.815552 
+335977.013428  7395504.076576 
+335995.394277  7395473.701779 
+336038.472585  7395441.887229 
+336070.138111  7395416.821522 
+336086.556356  7395389.496203 
+336117.743601  7395337.635086 
+336138.713765  7395302.301139 
+336158.339794  7395270.136648 
+336216.475720  7395186.211024 
+336276.516526  7395188.630609 
+336572.729377  7395262.567944 
+336685.513073  7395293.952569 
+336808.687020  7395371.189339 
+336984.925462  7395475.271510 
+337132.285603  7395575.474346 
+337206.922237  7395491.548722 
+337262.378138  7395428.069596 
+337327.836717  7395353.772322 
+337376.464739  7395297.102029 
+337475.097904  7395180.921930 
+337506.590259  7395143.058415 
+337605.990323  7395029.127931 
+337663.573752  7394962.509342 
+337698.108965  7394922.766149 
+337759.139318  7394852.738145 
+337815.568275  7394785.729623 
+337848.759353  7394747.916100 
+337904.611073  7394684.296997 
+337958.211573  7394639.784622 
+337995.360842  7394607.700117 
+338025.616262  7394580.524772 
+338061.644044  7394546.900532 
+338115.640362  7394499.328680 
+338169.257353  7394451.756829 
+338217.926607  7394405.674722 
+338279.212593  7394351.314034 
+338333.967564  7394304.512051 
+338375.371889  7394264.068978 
+338379.956793  7394260.299624 
+338450.890869  7394334.326944 
+338477.682872  7394362.092188 
+338524.076166  7394411.433736 
+338581.041127  7394473.103173 
+338732.722294  7394630.786163 
+338703.233773  7394679.957740 
+338878.911470  7394746.326372 
+338862.287070  7394795.138011 
+338847.847920  7394841.570058 
+338834.942569  7394888.032099 
+338807.952656  7395002.742450 
+338793.752647  7395086.168160 
+338758.153669  7395250.370034 
+338740.226363  7395335.935377 
+338708.173265  7395486.209637 
+338688.613206  7395604.439385 
+338661.013072  7395771.280807 
+338652.527701  7395805.604927 
+338637.321651  7395857.096107 
+338626.502597  7395885.361266 
+338616.763798  7395905.987732 
+338604.782025  7395930.833477 
+338588.990493  7395956.839022 
+338573.561796  7395979.415155 
+338558.528917  7396005.050764 
+338542.003471  7396033.725852 
+338526.269663  7396066.970158 
+338462.196451  7396344.182674 
+338383.337747  7396580.802143 
+338340.927383  7396755.842160 
+338321.961053  7396813.082355 
+338306.367430  7396863.453727 
+338283.632573  7396926.053005 
+338252.948348  7396994.811227 
+338206.431361  7397106.442105 
+337821.777686  7396988.232354 
+337576.386355  7396931.912001 
+337391.332693  7396931.912001 
+337194.214796  7397000.300287 
+336981.824879  7397158.343215 
+Region 1
+74
+333821.052918  7396075.218745 
+333729.676437  7396099.864523 
+333632.989382  7396125.490134 
+333556.340668  7396145.636683 
+333432.737917  7396179.760838 
+333355.322304  7396201.427126 
+333314.742603  7396207.546078 
+333263.723174  7396222.513514 
+333226.928493  7396231.451983 
+333185.812787  7396242.400108 
+333078.718989  7396269.485469 
+332929.998220  7396307.788908 
+332916.062090  7396308.218834 
+332896.856619  7396295.920940 
+332818.270040  7396299.800276 
+332794.694067  7396302.709778 
+332685.670652  7396309.468620 
+332492.832548  7396624.534652 
+332439.479436  7396805.113720 
+332399.608911  7396868.092933 
+332328.617111  7396927.462763 
+332281.968184  7396961.047010 
+332224.120876  7396972.245092 
+332169.167995  7396976.304397 
+332016.959070  7397003.399756 
+331995.799242  7397004.029648 
+331968.693882  7397002.339937 
+331765.383065  7396968.455741 
+331762.670055  7397072.437930 
+331759.816860  7397168.441486 
+331704.319727  7397269.404192 
+331651.486128  7397365.547723 
+331604.202241  7397438.875163 
+331573.072720  7397497.215170 
+331509.568498  7397617.484569 
+331436.457417  7397744.902743 
+331363.659693  7397880.439527 
+331328.110193  7397965.235002 
+331299.471034  7397999.999047 
+331296.741531  7398008.977509 
+331274.542678  7398041.781890 
+331254.331167  7398071.996715 
+331236.445093  7398106.750762 
+331198.372246  7398138.695290 
+331139.568375  7398194.775684 
+331145.637601  7398238.988111 
+331157.124600  7398323.783586 
+331542.536928  7398255.255324 
+331752.411744  7398227.770032 
+332221.201710  7398166.210577 
+333145.323794  7398119.288614 
+333595.650450  7398089.513714 
+334098.390147  7398060.788635 
+334095.207102  7397991.890436 
+334091.413836  7397801.832991 
+334088.750304  7397633.881760 
+334085.303379  7397567.043209 
+334084.058199  7397468.200140 
+334082.491415  7397382.074892 
+334080.743214  7397329.973817 
+334080.767953  7397276.622955 
+334079.011505  7397178.539756 
+334077.147857  7397051.241561 
+334074.154476  7396897.007980 
+334073.725672  7396874.941759 
+334056.185939  7396718.558546 
+334029.426921  7396691.163239 
+334057.480597  7396642.061650 
+334104.838700  7396536.829675 
+334118.865538  7396494.736885 
+334115.360890  7396408.791607 
+334076.776777  7396249.198943 
+333982.068818  7396026.457097 
+333821.052918  7396075.218745 
+Region 1
+103
+335324.555167  7394205.758966 
+335270.806236  7394210.308187 
+335245.176951  7394213.087711 
+335209.413049  7394215.857237 
+334973.941933  7394238.813304 
+334784.418814  7394253.730749 
+334636.819531  7394264.608886 
+334542.111572  7394267.818336 
+334486.037204  7394270.827821 
+334405.347837  7394276.366872 
+334284.911638  7394282.485824 
+334135.778557  7394293.573924 
+334091.554022  7394278.196558 
+334052.235994  7394368.041169 
+334017.263730  7394444.888006 
+334196.338875  7394497.159052 
+334182.361514  7394504.187848 
+334166.273118  7394523.774493 
+334144.428853  7394584.504091 
+334138.928617  7394618.258309 
+334133.733492  7394643.394003 
+334124.720362  7394669.499532 
+334117.496664  7394693.085492 
+334107.741373  7394718.181193 
+334093.153791  7394745.276552 
+334071.540420  7394782.070249 
+334043.222864  7394834.061344 
+334027.752936  7394904.139340 
+334015.630977  7394957.900131 
+334016.867911  7394984.985492 
+334014.888816  7395049.254483 
+334017.123544  7395134.299916 
+334020.372559  7395193.259816 
+334021.172444  7395236.302443 
+334012.283007  7395278.225262 
+333992.211682  7395349.133117 
+333971.892969  7395423.830322 
+333957.676468  7395454.315100 
+333947.517112  7395476.431312 
+333933.053223  7395502.336874 
+333919.339741  7395520.383783 
+333899.293155  7395541.460173 
+333879.246568  7395560.216960 
+333830.552576  7395600.850000 
+333884.870497  7395785.938296 
+333907.324983  7395848.817525 
+333982.068818  7396026.457097 
+334076.776777  7396249.198943 
+334113.934292  7396408.831600 
+334184.876614  7396381.876217 
+334205.417975  7396378.426808 
+334306.178667  7396351.301454 
+334411.252138  7396323.436227 
+334507.873223  7396312.538094 
+334605.500347  7396302.929740 
+334756.373383  7396289.032120 
+334874.756270  7396281.063485 
+334979.969927  7396274.794559 
+335045.651154  7396268.285674 
+335107.877211  7396336.993905 
+335176.411634  7396413.840742 
+335272.397758  7396520.072545 
+335317.249007  7396569.614059 
+335403.067529  7396491.327469 
+335420.648493  7396474.910281 
+335488.391278  7396414.320660 
+335504.191056  7396397.133604 
+335574.721066  7396336.044068 
+335582.629202  7396325.665845 
+335644.756303  7396271.635100 
+335654.709504  7396257.977440 
+335678.640065  7396238.040855 
+335711.509540  7396204.936525 
+335778.229792  7396145.606688 
+335806.778243  7396115.031925 
+335815.816112  7396082.297532 
+335844.158407  7395989.423441 
+335876.409415  7395877.872548 
+335922.143010  7395706.351928 
+335942.206089  7395626.815552 
+335977.013428  7395504.076576 
+335995.394277  7395473.701779 
+336038.472585  7395441.887229 
+336070.138111  7395416.821522 
+336086.556356  7395389.496203 
+336117.743601  7395337.635086 
+336138.713765  7395302.301139 
+336158.339794  7395270.136648 
+336216.475720  7395186.211024 
+336182.369310  7395177.112582 
+335857.632747  7395110.094062 
+335656.894755  7395017.779874 
+335587.263583  7395004.422162 
+335344.659478  7394957.800148 
+335168.849840  7394911.948002 
+335228.503073  7394820.743625 
+335289.929245  7394724.460117 
+335280.042014  7394715.811599 
+335500.150403  7394362.392136 
+335608.637813  7394186.182320 
+335438.781954  7394195.670694 
+335375.846722  7394200.969787 
+335324.555167  7394205.758966 
+Region 1
+481
+325664.887603  7405456.271855 
+325545.927479  7405414.878945 
+325375.214012  7405273.403179 
+325324.532679  7405286.450944 
+325274.675968  7405281.921720 
+325238.417292  7405261.515215 
+325199.882656  7405207.124532 
+325145.243132  7405147.694712 
+325118.352174  7405098.673109 
+325087.041236  7405059.099887 
+325051.656660  7405018.696808 
+324976.995288  7404947.249046 
+324957.864033  7404905.696164 
+324947.539752  7404883.210016 
+324921.943452  7404833.278568 
+324903.348202  7404798.954448 
+324879.293947  7404768.209714 
+324859.799858  7404732.095900 
+324850.968145  7404701.531136 
+324843.010533  7404640.351615 
+324839.712040  7404625.194211 
+324820.011795  7404582.021606 
+324810.833741  7404562.534944 
+324805.209811  7404539.278928 
+324801.762887  7404516.492831 
+324803.717244  7404490.837225 
+324809.827701  7404463.391927 
+324815.550585  7404443.565323 
+324825.091473  7404417.259829 
+324850.506356  7404373.817270 
+324890.673746  7404322.176116 
+324922.949493  7404278.263637 
+324965.161947  7404294.360880 
+324996.951166  7404312.427785 
+325036.656767  7404316.237133 
+325061.378966  7404327.725165 
+325099.088979  7404353.840692 
+325135.916645  7404382.235828 
+325160.333734  7404397.323244 
+325197.598450  7404415.070204 
+325223.367921  7404405.861781 
+325248.403477  7404390.224460 
+325269.703491  7404354.720541 
+325290.112912  7404344.962213 
+325317.177041  7404353.840692 
+325351.786471  7404357.830008 
+325371.082651  7404360.049628 
+325391.063268  7404354.720541 
+325497.678784  7404348.431618 
+325543.692751  7404341.852745 
+325568.538644  7404344.962213 
+325614.799998  7404361.549371 
+325643.076322  7404363.599020 
+325777.217756  7404381.405970 
+325882.621077  7404389.244627 
+325923.060592  7404374.857092 
+325962.947609  7404341.522802 
+325983.794080  7404366.528518 
+325993.903959  7404364.148926 
+326013.546481  7404352.830865 
+326056.410387  7404326.045453 
+326108.262686  7404297.770296 
+326158.119396  7404269.645114 
+326202.640795  7404244.569409 
+326249.446401  7404221.783312 
+326259.778928  7404141.317095 
+326495.480938  7403846.597578 
+326524.153082  7403809.313964 
+326560.032432  7403765.221517 
+326608.223404  7403691.404161 
+326633.860935  7403661.669254 
+326663.596842  7403623.725754 
+326655.070240  7403576.513841 
+326626.678468  7403523.252964 
+326660.496260  7403486.349285 
+326717.189095  7403430.558842 
+326736.369828  7403293.582304 
+326732.271451  7403262.817574 
+326743.593526  7403111.643469 
+326763.920484  7402997.782972 
+326765.083203  7402981.755717 
+326762.419670  7402968.408004 
+326819.821682  7402834.111008 
+326927.063912  7402571.326020 
+326978.792516  7402586.603403 
+327006.549329  7402593.992138 
+327032.797081  7402587.183304 
+327051.746919  7402583.373957 
+327064.058541  7402573.695614 
+327064.932642  7402554.358927 
+327196.806362  7402561.387723 
+327325.158942  7402571.935916 
+327323.039661  7402595.761835 
+327378.198698  7402591.292600 
+327582.127982  7402568.406520 
+327570.129716  7402507.167010 
+327650.258339  7402500.298187 
+327739.639233  7402491.329723 
+327748.380238  7402488.600191 
+327763.949121  7402483.900995 
+327773.778628  7402476.202314 
+327788.456919  7402462.054738 
+327764.716021  7402423.371364 
+327821.862399  7402406.664225 
+327851.746739  7402411.943321 
+327833.291675  7402383.808140 
+327787.582818  7402253.700427 
+327870.218296  7402230.844342 
+327923.843533  7402213.257354 
+327942.306844  7402219.416299 
+327958.090129  7402207.998255 
+327984.552283  7402199.229757 
+328007.353111  7402197.390072 
+328032.652547  7402200.789490 
+328094.812633  7402214.357166 
+328163.784107  7402243.342201 
+328182.296894  7402228.564732 
+328183.377151  7402216.366822 
+328181.653688  7402197.370076 
+328201.007592  7402206.728473 
+328213.343953  7402224.055505 
+328223.808419  7402237.933128 
+328232.293791  7402257.869713 
+328238.057906  7402282.325524 
+328236.029333  7402320.778937 
+328228.401570  7402351.143736 
+328210.152662  7402387.717471 
+328210.762883  7402396.156025 
+328199.919089  7402417.172425 
+328192.052185  7402434.799406 
+328185.760311  7402448.567048 
+328181.332085  7402460.035083 
+328178.000608  7402474.172662 
+328175.493754  7402487.880314 
+328174.809317  7402502.707774 
+328183.088533  7402528.173412 
+328193.503522  7402542.600941 
+328210.787621  7402556.938485 
+328301.496158  7402640.044250 
+328319.522419  7402651.332316 
+328333.672950  7402656.931357 
+328348.598628  7402664.820006 
+328354.882256  7402667.359571 
+328361.982260  7402669.659177 
+328382.193772  7402671.788812 
+328409.736182  7402675.238221 
+328485.552026  7402682.776930 
+328513.737643  7402683.316837 
+328552.330002  7402676.837947 
+328613.376848  7402664.620040 
+328660.883382  7402651.672258 
+328689.778175  7402646.493145 
+328700.828124  7402646.403160 
+328723.431042  7402648.982718 
+328748.631523  7402648.982718 
+328811.805896  7402658.481091 
+328841.640758  7402670.049110 
+328854.727526  7402672.848630 
+328892.190152  7402697.084479 
+328910.620478  7402711.801958 
+328929.001326  7402719.270679 
+328951.546520  7402745.796135 
+328968.789389  7402756.414316 
+328999.457120  7402798.337135 
+329033.777932  7402837.310460 
+329065.608383  7402877.103643 
+329106.724089  7402922.195920 
+329134.678811  7402953.100626 
+329153.488463  7402968.188041 
+329160.423543  7402975.756745 
+329184.947833  7402990.424233 
+329194.150626  7402996.063267 
+329200.261083  7402997.922948 
+329218.188388  7403000.442517 
+329231.390604  7403008.411152 
+329258.916521  7402986.344931 
+329295.702956  7402978.486277 
+329312.640714  7402975.006873 
+329374.627630  7402976.576605 
+329426.356235  7402999.122743 
+329451.070188  7403010.790744 
+329449.239525  7403049.304147 
+329434.396310  7403139.588682 
+329419.569587  7403225.204017 
+329409.154598  7403320.267733 
+329404.528462  7403363.310361 
+329402.673060  7403380.957338 
+329399.803372  7403401.103887 
+329398.145880  7403488.278955 
+329400.809412  7403520.773389 
+329404.726372  7403545.869090 
+329421.218833  7403619.036557 
+329426.166571  7403645.502024 
+329421.383758  7403669.727874 
+329415.091884  7403718.499520 
+329406.383864  7403796.496160 
+329388.258649  7403840.078695 
+329353.640973  7403921.024829 
+329322.330035  7403989.513098 
+329279.466128  7404061.120832 
+329233.320222  7404134.288299 
+329200.360038  7404176.311101 
+329172.339346  7404293.061103 
+329160.802869  7404359.999637 
+329155.022262  7404393.733858 
+329142.669408  7404451.843905 
+329122.886701  7404542.128440 
+329112.999470  7404601.278308 
+329003.299864  7404667.796914 
+328932.761607  7404801.993927 
+328943.061149  7404891.598579 
+328928.399351  7404957.547282 
+328926.428502  7405021.656301 
+328946.433857  7405155.573362 
+328962.654193  7405198.186063 
+328997.964553  7405284.421292 
+329039.443093  7405364.537569 
+328976.582077  7405462.050865 
+328963.816912  7405575.761388 
+329009.657708  7405675.744262 
+329140.245016  7405808.731482 
+329196.203937  7405935.089838 
+329298.448951  7406044.821042 
+329319.814935  7406176.418501 
+329273.009330  7406255.844896 
+329193.894993  7406292.578603 
+329236.445543  7406403.389623 
+329214.873404  7406536.046900 
+329383.137740  7406646.318011 
+329454.244987  7406779.715161 
+329407.686769  7406899.454651 
+329388.398835  7406985.509911 
+329450.682615  7407025.213110 
+329552.152483  7407114.557806 
+329655.683909  7407211.001286 
+329701.986494  7407396.059587 
+329711.552122  7407558.751719 
+329734.105562  7407746.859498 
+329755.694194  7407912.351151 
+329861.534565  7408022.562273 
+329887.584407  7408032.160629 
+330076.678722  7408047.857940 
+330203.481011  7408095.399797 
+330240.828189  7408224.747640 
+330392.426894  7408356.785024 
+330381.475899  7408366.823304 
+330350.585519  7408387.029843 
+330313.576436  7408410.475827 
+330277.614624  7408428.872676 
+330234.247697  7408452.768582 
+330184.588896  7408467.496060 
+330143.085618  7408479.274042 
+330105.911610  7408489.572278 
+330067.401713  7408510.218742 
+330025.535600  7408537.414083 
+329996.657300  7408560.160187 
+329964.084689  7408602.352960 
+329936.632987  7408639.026678 
+329903.293477  7408682.979150 
+329875.800544  7408725.461873 
+329854.236651  7408756.626534 
+329830.627692  7408789.030984 
+329808.354623  7408812.856903 
+329777.150886  7408841.152056 
+329760.180144  7408869.317231 
+329747.555165  7408929.626901 
+329732.909859  7408952.502983 
+329715.782438  7408967.020496 
+329695.645143  7408975.689011 
+329662.470557  7408995.885551 
+329621.602238  7409025.100547 
+329592.690953  7409053.165740 
+329563.738437  7409087.299893 
+329539.923323  7409112.625555 
+329516.132948  7409135.171693 
+329490.833512  7409154.918311 
+329464.313634  7409168.086055 
+329440.886093  7409175.724747 
+329420.526150  7409179.344127 
+329394.839141  7409182.403603 
+329372.236223  7409180.943853 
+329350.960948  7409171.155529 
+329333.520170  7409158.357721 
+329315.328985  7409143.280304 
+329299.174619  7409127.213056 
+329286.772289  7409120.034286 
+329265.513506  7409108.216310 
+329247.511984  7409103.007203 
+329231.769930  7409100.847572 
+329211.195585  7409098.897906 
+329187.042375  7409101.467466 
+329157.487884  7409111.825692 
+329112.933500  7409124.083592 
+329085.894110  7409138.511121 
+329056.018016  7409159.237571 
+329030.454701  7409181.253800 
+329011.991391  7409204.099886 
+328998.096492  7409229.265576 
+328985.471513  7409253.171481 
+328974.198916  7409266.469203 
+328955.793329  7409281.736588 
+328940.504817  7409287.415615 
+328913.185055  7409305.882452 
+328904.740915  7409314.151035 
+328895.125810  7409325.009176 
+328882.517324  7409338.446874 
+328871.104540  7409355.943877 
+328856.665390  7409373.140931 
+328847.297672  7409389.908059 
+328823.820654  7409418.083233 
+328805.068725  7409434.960342 
+328784.799490  7409452.077410 
+328760.769974  7409474.473574 
+328738.307242  7409494.030224 
+328709.074354  7409516.816321 
+328683.774919  7409531.083877 
+328655.968629  7409542.781873 
+328633.415188  7409542.451930 
+328609.179516  7409535.023202 
+328592.860226  7409523.935101 
+328579.031297  7409515.906477 
+328563.767524  7409501.798893 
+328553.088655  7409486.251556 
+328534.856239  7409467.314800 
+328527.484109  7409451.047586 
+328514.801407  7409433.960513 
+328497.368875  7409411.744319 
+328484.158413  7409396.156989 
+328469.917173  7409381.819444 
+328448.641898  7409362.572741 
+328429.799261  7409350.694776 
+328405.415157  7409335.947302 
+328378.788078  7409318.900222 
+328355.121396  7409310.641637 
+328338.925799  7409300.893306 
+328329.813714  7409295.254272 
+328315.902323  7409286.285809 
+328305.528565  7409280.626778 
+328293.876641  7409275.477660 
+328278.637607  7409273.567987 
+328260.330975  7409275.437667 
+328238.437233  7409280.806747 
+328219.355455  7409284.686083 
+328192.662406  7409285.715906 
+328161.161805  7409283.926213 
+328136.076772  7409274.607809 
+328118.603009  7409266.109265 
+328098.168849  7409245.202846 
+328076.481263  7409221.506905 
+328061.605063  7409204.189871 
+328043.496340  7409177.484445 
+328028.397492  7409157.127932 
+328016.283779  7409145.139986 
+327997.845207  7409129.052741 
+327974.788746  7409120.254248 
+327954.766898  7409112.495577 
+327937.004518  7409108.046339 
+327911.853514  7409107.326463 
+327895.600194  7409106.426617 
+327879.874632  7409102.497290 
+327867.777411  7409088.489689 
+327856.735708  7409067.913214 
+327851.293196  7409047.136773 
+327843.789126  7409029.879729 
+327832.038248  7409002.724380 
+327824.270298  7408987.237033 
+327816.213731  7408977.308734 
+327807.142877  7408966.100653 
+327805.411169  7408959.771737 
+327807.810822  7408943.864462 
+327823.412690  7408929.336951 
+327836.746845  7408912.009919 
+327855.234894  7408884.364654 
+327865.031417  7408864.977975 
+327876.180320  7408833.223414 
+327881.424923  7408810.267346 
+327883.931777  7408778.932714 
+327882.315516  7408756.166613 
+327875.124803  7408731.080910 
+327864.074854  7408713.034001 
+327846.939186  7408691.647665 
+327838.890865  7408680.459581 
+327829.869489  7408662.432669 
+327824.954736  7408638.616748 
+327822.571575  7408616.610518 
+327818.539168  7408575.867497 
+327824.121866  7408541.033464 
+327828.673786  7408507.699173 
+327830.413740  7408477.374368 
+327831.164147  7408443.260211 
+327826.546258  7408413.385328 
+327821.944861  7408381.240835 
+327813.500721  7408353.865524 
+327803.258903  7408328.489870 
+327797.296878  7408308.723256 
+327781.546577  7408272.429473 
+327768.946337  7408257.152090 
+327755.818338  7408245.154145 
+327738.913565  7408228.077070 
+327717.151762  7408215.239269 
+327694.565337  7408210.240125 
+327674.997031  7408211.079982 
+327623.581783  7408223.027935 
+327591.908011  7408245.894018 
+327570.063746  7408265.870596 
+327550.503687  7408281.797868 
+327530.943628  7408301.014577 
+327504.522705  7408321.241112 
+327484.451380  7408333.379033 
+327452.942532  7408357.904832 
+327428.566675  7408384.190329 
+327406.978043  7408407.196389 
+327379.806713  7408439.290891 
+327357.459428  7408464.066647 
+327331.558017  7408497.680889 
+327306.926526  7408524.726257 
+327275.178538  7408557.340670 
+327241.649365  7408585.655820 
+327213.694643  7408603.102832 
+327178.367791  7408621.819626 
+327161.339324  7408627.388672 
+327129.813984  7408632.207846 
+327109.470533  7408632.217844 
+327076.658782  7408629.968230 
+327047.153768  7408627.968572 
+327025.284765  7408622.919437 
+327003.143636  7408610.301599 
+326983.286712  7408592.384668 
+326962.399010  7408566.369124 
+326939.482735  7408542.383232 
+326900.049260  7408529.015522 
+326867.229262  7408517.667466 
+326848.147484  7408514.907939 
+326808.474869  7408508.109103 
+326764.472982  7408504.599704 
+326731.916863  7408502.850004 
+326699.368991  7408501.860174 
+326673.681982  7408502.630042 
+326618.250820  7408503.929819 
+326575.774486  7408503.699858 
+326519.848550  7408517.377516 
+326498.499059  7408525.476128 
+326471.550377  7408535.094481 
+326442.581369  7408548.492186 
+326418.436405  7408561.899889 
+326393.532789  7408578.846986 
+326202.047067  7408619.639999 
+326065.728628  7408633.267665 
+326011.196305  7408599.193501 
+326018.007691  7408435.601523 
+326127.072338  7408203.841222 
+326147.522990  7408026.621578 
+326208.866700  7407863.029599 
+326236.128738  7407760.787113 
+326195.235680  7407651.725794 
+326202.055313  7407542.664475 
+326072.540015  7407113.238032 
+325997.565286  7407092.791534 
+325874.869620  7407079.163869 
+325727.361046  7407039.950585 
+325543.206223  7406979.400957 
+325466.326615  7406904.283824 
+325385.101243  7406884.707177 
+325254.794306  7406833.875884 
+325171.969166  7406768.877018 
+325162.848835  7406678.852438 
+325166.073111  7406627.001320 
+325178.087869  7406573.330513 
+325171.301221  7406602.245560 
+325166.073111  7406627.001320 
+325156.680654  7406585.758384 
+325183.876723  7406489.574860 
+325284.183872  7406381.113438 
+325516.340004  7406266.063145 
+325601.259687  7406208.622984 
+325711.148956  7406058.758655 
+325721.143388  7405941.368763 
+325679.755556  7405771.437870 
+325652.246131  7405634.771280 
+325614.082576  7405535.638261 
+325664.887603  7405456.271855 
+Region 1
+290
+326424.423169  7392114.857119 
+326316.323331  7392102.299270 
+326277.293922  7392098.559910 
+326211.192137  7392088.081705 
+326121.621579  7392074.324062 
+326071.138155  7392074.154091 
+326040.256022  7392044.599153 
+325976.306503  7391999.996793 
+325910.518075  7391963.663017 
+325857.791676  7391863.610155 
+325833.217909  7391818.697848 
+325768.270596  7391657.715423 
+325707.380429  7391507.831097 
+325673.076110  7391447.831374 
+325622.386530  7391411.807545 
+325530.078224  7391341.749545 
+325473.632775  7391300.336639 
+325452.110113  7391284.489353 
+325437.811149  7391267.512261 
+325320.937322  7391062.417392 
+325256.682693  7391003.107551 
+325182.771728  7390957.115429 
+325162.387046  7390943.447771 
+325078.588850  7390903.014696 
+325052.877103  7390894.176210 
+325023.569999  7390879.608706 
+324976.459283  7390855.002920 
+324934.692125  7390836.296125 
+324856.270472  7390805.751357 
+324826.740720  7390794.393302 
+324759.443231  7390743.262061 
+324730.647394  7390727.324791 
+324674.630749  7390703.828815 
+324604.001784  7390689.501269 
+324555.043912  7390684.282163 
+324472.581606  7390663.375744 
+324440.998542  7390650.747907 
+324379.390953  7390628.291754 
+324334.053177  7390604.775782 
+324227.858219  7390559.063612 
+324117.342236  7390513.591401 
+324062.075998  7390490.355381 
+324000.600348  7390773.936806 
+323991.463525  7390811.100441 
+323962.675934  7390954.815823 
+323902.519681  7390902.244828 
+323730.767189  7390749.990908 
+323671.996303  7390695.700208 
+323611.370016  7390644.968897 
+323541.103884  7390603.466006 
+323508.366349  7390590.078300 
+323452.580598  7390565.532504 
+323398.287416  7390543.216327 
+323356.017237  7390510.101999 
+323314.390265  7390462.990069 
+323285.462488  7390416.727993 
+323273.348775  7390363.457118 
+323259.107535  7390325.693586 
+323243.332496  7390290.459622 
+323220.878010  7390263.594223 
+323201.458136  7390240.298214 
+323185.757313  7390232.039628 
+323123.960061  7390196.745674 
+323090.249470  7390181.758241 
+323059.070472  7390168.820457 
+322995.706436  7390139.865417 
+322925.267133  7390105.031384 
+322856.872896  7390260.554744 
+322798.572046  7390389.432668 
+322755.221611  7390487.355895 
+322739.999069  7390519.570377 
+322711.079539  7390588.078642 
+322690.678364  7390635.530514 
+322670.310174  7390679.932908 
+322641.646277  7390670.614504 
+322530.198469  7390646.888569 
+322444.652073  7390633.340889 
+322363.896736  7390635.120584 
+322317.660121  7390639.379855 
+322264.521410  7390640.439673 
+322148.266051  7390644.878913 
+322026.708365  7390650.198002 
+321933.525958  7390643.989065 
+321842.132984  7390623.582561 
+321789.340616  7390583.729387 
+321619.608450  7390494.244715 
+321555.386806  7390480.057145 
+321373.722345  7390466.579454 
+321220.573349  7390471.788562 
+321087.479187  7390466.119533 
+320954.822074  7390460.620475 
+320891.309606  7390458.760793 
+320707.633064  7390460.790445 
+320736.816474  7390489.175583 
+320761.200579  7390516.360927 
+320776.398382  7390531.958255 
+320793.410355  7390535.337676 
+320878.437240  7390555.024304 
+320898.450841  7390566.862276 
+320914.242373  7390600.816460 
+320924.467699  7390629.651521 
+320936.968985  7390660.776190 
+320951.927647  7390682.132532 
+321029.780311  7390696.800019 
+321064.793806  7390702.978961 
+321093.548412  7390702.069117 
+321154.793167  7390664.825496 
+321187.712120  7390647.498464 
+321202.753245  7390642.259361 
+321218.750932  7390643.389168 
+321227.640369  7390645.238851 
+321239.036660  7390650.397967 
+321251.158619  7390662.955816 
+321258.398809  7390684.132189 
+321263.593934  7390714.377008 
+321266.686271  7390736.613200 
+321272.656542  7390757.269661 
+321281.240868  7390766.488082 
+321293.346335  7390780.055758 
+321330.042061  7390805.251442 
+321344.505950  7390808.660858 
+321359.769722  7390807.751014 
+321380.921304  7390800.012340 
+321401.042107  7390794.293319 
+321427.792879  7390785.574813 
+321449.109385  7390790.304003 
+321469.840409  7390808.510884 
+321479.067941  7390834.276471 
+321477.666082  7390855.142896 
+321474.466545  7390877.509065 
+321474.326359  7390898.115536 
+321482.547851  7390924.141078 
+321492.261910  7390953.975967 
+321492.187694  7390965.434005 
+321483.636353  7390987.410240 
+321476.536348  7390998.948264 
+321453.776752  7391046.600102 
+321437.366753  7391066.846634 
+321431.676854  7391082.583938 
+321433.589979  7391099.900972 
+321439.354094  7391113.428654 
+321459.549113  7391134.954967 
+321485.557725  7391161.340448 
+321495.082121  7391182.266863 
+321498.017779  7391198.074155 
+321494.109066  7391213.061588 
+321477.253770  7391235.417759 
+321469.337389  7391267.862201 
+321466.121359  7391293.547802 
+321479.496745  7391308.125305 
+321510.700482  7391357.716810 
+321521.280396  7391371.794399 
+321537.673902  7391392.260893 
+321559.443951  7391405.388644 
+321591.934100  7391413.507254 
+321610.479873  7391414.147144 
+321628.547364  7391410.957690 
+321684.077481  7391393.790631 
+321748.546513  7391367.525130 
+321795.014022  7391341.369610 
+321817.996267  7391324.482503 
+321839.955979  7391310.384918 
+321869.526962  7391297.097194 
+321894.447071  7391295.997382 
+321907.888427  7391301.936365 
+321924.850924  7391312.244599 
+321926.326999  7391319.383376 
+321931.818989  7391335.190669 
+321933.773345  7391347.678530 
+321936.412139  7391370.604603 
+321937.360456  7391376.423606 
+321948.121787  7391407.328312 
+321976.249679  7391420.496057 
+322011.279667  7391428.634663 
+322040.232183  7391431.894104 
+322059.759257  7391431.684140 
+322075.047769  7391433.403846 
+322106.507139  7391443.292152 
+322127.708198  7391466.588161 
+322135.740026  7391481.915536 
+322139.920865  7391502.821955 
+322141.363956  7391517.079513 
+322150.377086  7391536.476190 
+322164.189522  7391562.791683 
+322169.219723  7391570.200414 
+322226.712443  7391602.414896 
+322368.531118  7391684.830778 
+322422.972732  7391717.525178 
+322482.436301  7391757.128395 
+322548.703011  7391847.932841 
+322556.776071  7391855.881479 
+322567.908482  7391864.609984 
+322581.102451  7391869.279184 
+322662.278346  7391893.764990 
+322692.723429  7391904.153210 
+322706.420418  7391907.812584 
+322718.097081  7391909.932221 
+322733.360854  7391909.022376 
+322766.197344  7391902.633471 
+322799.091558  7391887.836005 
+322866.661172  7391863.280212 
+322906.746099  7391867.469494 
+322776.703042  7391931.958448 
+322650.156387  7391999.996793 
+322563.909060  7392044.009254 
+322555.448428  7392051.328001 
+322549.882222  7392055.577273 
+322537.908695  7392066.175458 
+322529.175937  7392079.143236 
+322489.643507  7392130.264480 
+322473.381940  7392157.059890 
+322449.302947  7392184.045268 
+322409.201527  7392233.856735 
+322367.079781  7392291.606843 
+322301.893328  7392374.662616 
+322394.119171  7392445.280520 
+322405.647402  7392453.929039 
+322421.793521  7392481.394334 
+322426.188762  7392503.430560 
+322424.720933  7392522.537287 
+322415.913959  7392544.573512 
+322402.678759  7392556.331498 
+322419.501069  7392592.515300 
+322361.060033  7392681.410073 
+322272.322345  7392799.509844 
+322163.966874  7392944.624987 
+322253.578662  7393013.393208 
+322182.619848  7393104.547594 
+322113.953485  7393197.501672 
+322046.054022  7393285.626577 
+322094.401672  7393384.509639 
+322023.187224  7393575.926851 
+322053.442644  7393586.944963 
+322078.090628  7393600.462648 
+322102.466486  7393618.809505 
+322121.762665  7393638.156191 
+322145.858151  7393666.661309 
+322171.487436  7393692.626861 
+322189.521943  7393709.693938 
+322216.957152  7393724.751359 
+322267.292144  7393743.938072 
+322325.782658  7393760.095304 
+322370.271072  7393773.443018 
+322410.224060  7393772.543172 
+322433.618616  7393774.642813 
+322461.342443  7393780.821754 
+322483.970100  7393790.020179 
+322499.473014  7393798.698692 
+322826.287627  7394000.014208 
+323037.861167  7394125.962635 
+323080.222053  7394152.618069 
+323100.408826  7394172.134726 
+323124.116739  7394203.979271 
+323146.868090  7394239.923114 
+323165.661249  7394282.015904 
+323167.590867  7394443.338271 
+323163.756370  7394483.771345 
+323177.948133  7394563.257730 
+323222.428301  7394645.443652 
+323287.581769  7394707.702988 
+323473.608486  7394605.060570 
+323620.498593  7394507.697247 
+323764.774644  7394415.293075 
+323920.364524  7394341.185769 
+324082.064861  7394268.028300 
+324226.274943  7394180.713256 
+324355.410914  7394115.694393 
+324464.236420  7394066.272859 
+324528.853884  7394033.938398 
+324801.466023  7393898.641573 
+324955.085053  7393817.965392 
+325104.440783  7393743.658120 
+325259.024623  7393666.531331 
+325304.519077  7393642.815393 
+325328.342437  7393628.687813 
+325401.313332  7393585.165268 
+325557.678358  7393478.933465 
+325739.614945  7393385.629447 
+325824.015115  7393303.113581 
+325908.184392  7393223.127282 
+325962.436343  7393151.369574 
+326011.122089  7393067.323970 
+326027.631042  7393017.592488 
+326043.702946  7392961.322127 
+326078.831889  7392865.948464 
+326131.203699  7392705.355972 
+326219.850679  7392496.851687 
+326270.564997  7392345.047689 
+326339.742626  7392211.080637 
+326424.423169  7392114.857119 
+Region 1
+333
+330962.266170  7402191.131144 
+331061.377616  7402270.787500 
+331095.888091  7402291.134015 
+331090.090991  7402315.249884 
+331091.006323  7402346.734491 
+331188.270613  7402388.417351 
+331261.381694  7402416.782492 
+331310.537475  7402445.847514 
+331327.211354  7402452.326404 
+331429.093533  7402492.159581 
+331448.752547  7402630.965805 
+331478.801812  7402691.455443 
+331466.143848  7402754.274683 
+331458.730486  7402813.554529 
+331474.480787  7402871.914532 
+331498.246423  7402921.656012 
+331524.485929  7402976.576605 
+331532.460034  7403055.783037 
+331522.647020  7403107.174234 
+331485.712153  7403184.620968 
+331479.073937  7403196.368956 
+331460.973461  7403232.442777 
+331410.712685  7403265.637091 
+331377.958657  7403299.421304 
+331343.126579  7403364.150217 
+331376.400119  7403369.349326 
+331399.283409  7403374.538437 
+331475.173470  7403403.653450 
+331483.493917  7403408.852560 
+331583.289800  7403464.992943 
+331590.562976  7403467.072587 
+331638.391113  7403506.575821 
+331665.422257  7403518.013861 
+331709.753993  7403522.123157 
+331767.898166  7403538.960273 
+331807.001791  7403550.838239 
+331857.947004  7403562.876177 
+331796.809450  7403685.145233 
+331602.618965  7404094.265155 
+331583.471217  7404163.593279 
+331659.171615  7404302.239531 
+331665.562443  7404318.656718 
+331660.086946  7404335.983750 
+331631.810621  7404376.116876 
+331604.499105  7404415.940055 
+331588.031383  7404438.146251 
+331615.392376  7404483.748440 
+331687.447939  7404555.806097 
+331704.781516  7404578.612190 
+331708.426350  7404603.237972 
+331701.128436  7404621.484847 
+331644.584033  7404697.181880 
+331647.313535  7404731.845943 
+331654.611449  7404750.092817 
+331623.787039  7404819.110995 
+331613.858577  7404874.261548 
+331623.597376  7404951.668289 
+331559.763304  7404992.721257 
+331531.478733  7405046.532040 
+331514.153402  7405076.636883 
+331466.712837  7405114.030478 
+331448.472175  7405128.627978 
+331415.643931  7405155.983292 
+331381.892109  7405176.049855 
+331368.203366  7405189.737510 
+331359.083035  7405196.126416 
+331260.573564  7405250.847043 
+331273.346975  7405361.218137 
+331288.849889  7405477.058295 
+331300.188456  7405584.699857 
+331252.442780  7405661.566690 
+331196.310688  7405779.746447 
+331181.038669  7405828.428108 
+331213.504079  7405848.474674 
+331243.083309  7405875.200097 
+331261.216770  7405910.524046 
+331253.580760  7405949.657343 
+331222.475978  7406007.887369 
+331211.953788  7406017.065796 
+331205.686653  7406036.152527 
+331209.496411  7406069.536809 
+331212.588748  7406103.351016 
+331204.993969  7406133.715815 
+331190.406387  7406148.723245 
+331165.230645  7406151.762724 
+331147.361063  7406150.782892 
+331116.536653  7406155.742042 
+331087.377981  7406159.841340 
+331052.397471  7406171.289379 
+331024.088161  7406189.456267 
+331002.516022  7406224.980182 
+330988.654108  7406249.076055 
+330984.036219  7406268.522724 
+330982.857008  7406300.067321 
+330983.846556  7406320.233866 
+330987.211018  7406358.497312 
+331011.149825  7406398.860398 
+331031.666447  7406428.215370 
+331050.979119  7406454.580854 
+331069.211535  7406477.496929 
+331092.383443  7406506.441971 
+331104.439433  7406524.968797 
+331110.838508  7406554.503738 
+331109.387171  7406583.388790 
+331102.353136  7406599.376052 
+331092.498891  7406638.689318 
+331034.536135  7406679.752284 
+331028.466910  7406701.088629 
+331022.397684  7406716.845930 
+331016.336704  7406727.014189 
+331011.537398  7406737.422406 
+331000.429726  7406754.699446 
+330970.899974  7406803.481091 
+330967.098461  7406817.958611 
+330965.333768  7406827.616956 
+330965.061642  7406839.814867 
+330963.033070  7406854.292387 
+330967.543758  7406866.740255 
+330971.312285  7406876.398600 
+331001.460504  7406943.467112 
+331032.128236  7406991.228931 
+331065.591440  7407031.632010 
+331074.654048  7407037.980923 
+331084.970082  7407043.569965 
+331090.758936  7407046.369486 
+331123.240839  7407056.777703 
+331160.258168  7407066.945961 
+331174.367469  7407070.755309 
+331181.673629  7407072.794959 
+331194.257377  7407080.673610 
+331200.796638  7407086.002697 
+331210.362265  7407097.690695 
+331245.070650  7407142.403036 
+331255.122805  7407163.239467 
+331261.142554  7407180.256552 
+331265.653242  7407199.823201 
+331269.149644  7407218.110068 
+331274.402493  7407256.993408 
+331285.452442  7407284.928623 
+331298.778350  7407299.416141 
+331333.750615  7407338.289483 
+331342.301956  7407351.497220 
+331347.068277  7407362.165393 
+331350.828558  7407376.142999 
+331352.815900  7407393.929952 
+331349.278267  7407606.333569 
+331345.979775  7407626.140176 
+331339.663162  7407646.466695 
+331330.311936  7407667.813038 
+331330.584062  7407693.118704 
+331306.571038  7407711.755511 
+331290.919693  7407735.391463 
+331268.729086  7407758.257546 
+331169.947489  7407845.912531 
+331158.006947  7407856.830661 
+331150.436907  7407862.169747 
+331142.380340  7407864.449356 
+331135.082426  7407864.199399 
+331126.770225  7407861.409877 
+331069.112581  7407837.523968 
+331057.774013  7407834.224533 
+331045.932426  7407833.464664 
+331030.314065  7407833.464664 
+331015.198725  7407836.004229 
+331104.323985  7407868.428675 
+331189.021020  7407898.183578 
+331282.211673  7408020.722588 
+331248.822685  7407998.686363 
+331218.946591  7407983.259005 
+331180.444941  7407965.991963 
+331128.040145  7407938.736632 
+331097.908418  7407923.049319 
+331066.275877  7407904.072569 
+331040.201296  7407890.444903 
+331019.734151  7407874.337662 
+331003.274675  7407866.109072 
+330991.119731  7407860.190086 
+330974.882903  7407855.500889 
+330960.402522  7407855.870826 
+330945.650015  7407857.010630 
+330927.640248  7407852.561393 
+330921.331881  7407846.432442 
+330908.195636  7407835.704280 
+330896.048938  7407828.015597 
+330874.996311  7407822.776494 
+330859.254257  7407821.116779 
+330836.841002  7407827.755642 
+330781.772674  7407853.821177 
+330739.914807  7407879.236823 
+330701.347186  7407907.721944 
+330660.940656  7407944.285681 
+330635.303125  7407976.420177 
+330606.548519  7408017.883074 
+330583.665229  7408055.606613 
+330561.746748  7408100.158981 
+330552.692386  7408123.085054 
+330546.606668  7408157.919088 
+330555.809462  7408185.564352 
+330567.345938  7408206.900697 
+330580.910988  7408229.766781 
+330588.431550  7408243.984345 
+330589.322143  7408261.441355 
+330584.638284  7408277.078677 
+330571.840134  7408290.866315 
+330548.923859  7408296.735310 
+330526.551835  7408299.064911 
+330504.204550  7408295.845462 
+330486.417431  7408296.195402 
+330461.983849  7408301.284530 
+330437.236911  7408315.992011 
+330409.867672  7408341.027723 
+330392.097044  7408356.515070 
+330240.828189  7408224.747640 
+330203.481011  7408095.399797 
+330076.678722  7408047.857940 
+329887.584407  7408032.160629 
+329861.534565  7408022.562273 
+329755.694194  7407912.351151 
+329734.105562  7407746.859498 
+329711.552122  7407558.751719 
+329701.986494  7407396.059587 
+329655.683909  7407211.001286 
+329552.152483  7407114.557806 
+329450.682615  7407025.213110 
+329388.398835  7406985.509911 
+329407.686769  7406899.454651 
+329454.244987  7406779.715161 
+329383.137740  7406646.318011 
+329214.873404  7406536.046900 
+329236.445543  7406403.389623 
+329193.894993  7406292.578603 
+329273.009330  7406255.844896 
+329319.814935  7406176.418501 
+329298.448951  7406044.821042 
+329196.203937  7405935.089838 
+329140.245016  7405808.731482 
+329009.657708  7405675.744262 
+328963.816912  7405575.761388 
+328976.582077  7405462.050865 
+329039.443093  7405364.537569 
+328997.964553  7405284.421292 
+328962.654193  7405198.186063 
+328946.433857  7405155.573362 
+328926.428502  7405021.656301 
+328928.399351  7404957.547282 
+328943.061149  7404891.598579 
+328932.761607  7404801.993927 
+329003.299864  7404667.796914 
+329112.999470  7404601.278308 
+329122.886701  7404542.128440 
+329142.669408  7404451.843905 
+329155.022262  7404393.733858 
+329160.802869  7404359.999637 
+329172.339346  7404293.061103 
+329200.360038  7404176.311101 
+329233.320222  7404134.288299 
+329279.466128  7404061.120832 
+329322.330035  7403989.513098 
+329353.640973  7403921.024829 
+329388.258649  7403840.078695 
+329406.383864  7403796.496160 
+329415.091884  7403718.499520 
+329421.383758  7403669.727874 
+329426.166571  7403645.502024 
+329421.218833  7403619.036557 
+329404.726372  7403545.869090 
+329400.809412  7403520.773389 
+329398.145880  7403488.278955 
+329399.803372  7403401.103887 
+329404.528462  7403363.310361 
+329409.154598  7403320.267733 
+329419.569587  7403225.204017 
+329434.396310  7403139.588682 
+329449.239525  7403049.304147 
+329451.070188  7403010.790744 
+329454.187263  7402979.256146 
+329445.941033  7402943.452279 
+329421.218833  7402899.869744 
+329376.722172  7402867.175344 
+329335.524004  7402848.498543 
+329299.248836  7402832.931210 
+329264.639406  7402812.694676 
+329230.029975  7402780.000276 
+329223.853549  7402773.411405 
+329206.948776  7402745.756142 
+329192.113807  7402686.606274 
+329180.577330  7402650.802407 
+329160.802869  7402600.990939 
+329083.337779  7402507.586938 
+329084.987025  7402448.437070 
+329086.603286  7402389.157224 
+329117.930716  7402376.709356 
+329126.160454  7402362.741749 
+329135.792052  7402360.532127 
+329156.226211  7402247.051566 
+329156.217965  7402247.021571 
+329156.993111  7402153.997505 
+329155.492297  7402107.145530 
+329155.541774  7402107.125534 
+329189.590460  7402107.985386 
+329351.340275  7402129.261742 
+329430.512335  7402142.879409 
+329653.548135  7402175.233867 
+329742.937275  7402188.001680 
+329759.108134  7402184.592264 
+329766.768882  7402176.933576 
+329799.118845  7402159.056638 
+329825.506783  7402146.288825 
+329845.091581  7402142.029555 
+329873.178242  7402139.479992 
+329902.122512  7402135.220721 
+329940.426253  7402113.084513 
+330000.879370  7402067.122386 
+330065.571050  7402024.559676 
+330100.477344  7402014.341427 
+330136.233000  7402010.932011 
+330175.386103  7402007.532593 
+330210.251166  7402002.603437 
+330245.413094  7402048.075648 
+330311.721034  7402142.179529 
+330356.531052  7402131.481362 
+330393.309240  7402119.443424 
+330422.072093  7402102.726287 
+330476.241582  7402053.904650 
+330495.636716  7402025.819461 
+330573.868707  7401959.580807 
+330672.856459  7402025.149575 
+330738.397500  7402065.942588 
+330778.523659  7402094.027777 
+330810.626235  7402116.773881 
+330885.526748  7402164.925633 
+330924.127353  7402187.021848 
+330962.266170  7402191.131144 
+Region 1
+127
+334118.939754  7394231.104625 
+334111.889227  7394211.348009 
+334096.361575  7394194.420908 
+334017.346193  7394184.542600 
+333978.968235  7394169.455185 
+333964.380653  7394155.307608 
+333961.288317  7394149.568591 
+333956.423041  7394117.764039 
+333992.211682  7393973.488752 
+334002.890550  7393905.390417 
+334024.149333  7393748.137353 
+334141.328270  7393692.396901 
+334231.410094  7393644.665077 
+334198.021106  7393539.693057 
+334176.102625  7393464.365960 
+334149.797149  7393365.672865 
+334209.607060  7393348.105874 
+334240.538671  7393340.567166 
+334277.960066  7393343.586649 
+334294.394804  7393193.372379 
+334304.578899  7393170.236342 
+334333.853017  7393138.121843 
+334342.288911  7393124.054252 
+334345.405986  7393111.826347 
+334356.241534  7393021.411834 
+334358.921558  7392996.776054 
+334409.743078  7392986.947738 
+334358.781373  7392719.923476 
+334329.218636  7392548.722802 
+334302.781220  7392415.995537 
+334278.537302  7392277.169316 
+334242.493028  7392080.962925 
+334230.239129  7391999.996793 
+334222.240286  7391954.644562 
+334214.373381  7391904.213200 
+334190.368604  7391790.992594 
+334185.717730  7391763.807250 
+334171.220856  7391678.751820 
+334144.321652  7391529.517382 
+334217.572919  7391529.127449 
+334304.100617  7391534.196581 
+334386.538185  7391537.016098 
+334443.264006  7391537.536009 
+334499.981580  7391540.285538 
+334563.617742  7391541.795279 
+334698.187980  7391544.164873 
+334778.341342  7391546.504472 
+334822.499907  7391510.330669 
+334894.209128  7391456.909819 
+334903.997404  7391469.507661 
+334905.861052  7391477.356317 
+334905.960007  7391487.764534 
+334902.026555  7391501.762136 
+334890.811681  7391525.448079 
+334847.098413  7391607.554015 
+334865.289598  7391646.467350 
+334874.360451  7391663.644407 
+334885.171260  7391677.002119 
+334901.540028  7391686.240537 
+334921.998926  7391696.968699 
+334934.788829  7391704.217458 
+334945.830532  7391715.535519 
+334957.688612  7391731.682753 
+334975.203606  7391752.839129 
+334998.062157  7391775.465254 
+335051.027697  7391808.749552 
+335095.936669  7391848.702709 
+335131.799526  7391900.913765 
+335124.600567  7391919.510580 
+335123.462587  7391929.908799 
+335125.375712  7391941.556804 
+335128.715436  7391953.004843 
+335133.490003  7391964.352899 
+335140.713701  7391975.401006 
+335150.172128  7391988.018845 
+335163.267142  7391999.996793 
+335195.567627  7392012.104719 
+335214.830822  7392024.232642 
+335229.756500  7392036.180595 
+335243.783338  7392054.467463 
+335252.499604  7392076.163747 
+335256.556749  7392092.071022 
+335259.409945  7392112.057598 
+335258.939910  7392131.334296 
+335254.198327  7392154.470333 
+335246.397393  7392176.896492 
+335307.592671  7392254.153259 
+335402.069735  7392293.756475 
+335448.933064  7392484.923730 
+335459.991259  7392506.380054 
+335471.016470  7392580.877294 
+335479.048298  7392610.312252 
+335492.431931  7392630.838736 
+335515.620331  7392649.565528 
+335540.639395  7392658.573985 
+335572.511077  7392680.160287 
+335750.646151  7392752.307929 
+335792.231892  7392676.400931 
+335876.599078  7392587.426172 
+335911.480634  7392640.397099 
+335951.697500  7392658.344024 
+336000.003920  7392682.359911 
+336050.833685  7392702.986378 
+336198.878264  7392779.573259 
+336232.209528  7392797.680157 
+336250.375974  7392774.524124 
+336259.067502  7392764.955763 
+336272.104792  7392762.346210 
+336290.370193  7392770.174869 
+336313.838965  7392782.352783 
+335608.637813  7394186.182320 
+335438.781954  7394195.670694 
+335375.846722  7394200.969787 
+335324.555167  7394205.758966 
+335270.806236  7394210.308187 
+335245.176951  7394213.087711 
+335209.413049  7394215.857237 
+334973.941933  7394238.813304 
+334784.418814  7394253.730749 
+334636.819531  7394264.608886 
+334542.111572  7394267.818336 
+334486.037204  7394270.827821 
+334405.347837  7394276.366872 
+334284.911638  7394282.485824 
+334135.778557  7394293.573924 
+334091.554022  7394278.196558 
+334118.939754  7394231.104625 
+Region 1
+215
+331327.862806  7384686.289565 
+331319.187771  7384674.861523 
+331315.105887  7384666.223002 
+331312.293922  7384658.094395 
+331311.007510  7384651.225571 
+331309.960239  7384636.988010 
+331303.058144  7384620.990750 
+331291.595883  7384608.292925 
+331279.366723  7384600.934186 
+331264.102950  7384595.865054 
+331246.546725  7384589.776097 
+331238.152063  7384588.776268 
+331226.871219  7384589.316176 
+331173.559338  7384590.615953 
+331133.119823  7384587.996402 
+331110.673583  7384591.295837 
+331079.643017  7384582.057419 
+331049.931848  7384570.169455 
+331023.527418  7384556.961718 
+331008.667710  7384541.744324 
+330981.554104  7384515.108887 
+330926.329097  7384461.768024 
+330852.599549  7384391.310092 
+330808.572923  7384437.992096 
+330766.442931  7384484.554121 
+330734.257893  7384542.284232 
+330714.483432  7384580.217734 
+330709.007934  7384634.318467 
+330708.381221  7384657.404513 
+330698.221865  7384683.809990 
+330675.157158  7384710.995333 
+330663.686651  7384736.620944 
+330647.441576  7384758.967116 
+330612.906363  7384789.441896 
+330570.256858  7384819.246791 
+330425.832374  7384829.315066 
+330392.863944  7384795.100927 
+330310.863426  7384688.119252 
+330249.181621  7384620.310867 
+330175.551028  7384554.312172 
+330143.192819  7384521.797741 
+330124.597569  7384506.320392 
+330057.093924  7384449.200176 
+330057.069186  7384440.811613 
+330059.328653  7384425.564225 
+329971.028015  7384398.708825 
+329906.138426  7384377.682427 
+329922.787566  7384308.784228 
+329743.159924  7384265.761598 
+329707.280574  7384257.922940 
+329689.732595  7384253.363721 
+329671.912491  7384245.495069 
+329654.587160  7384233.317155 
+329634.210724  7384217.579851 
+329618.930459  7384204.892024 
+329603.641947  7384188.894764 
+329591.643682  7384166.528596 
+329579.769110  7384127.995196 
+329502.007155  7384108.668506 
+329479.610392  7384100.059981 
+329437.092827  7384158.389990 
+329418.192466  7384185.275384 
+329325.240955  7384299.225866 
+329294.177404  7384337.399327 
+329237.336136  7384404.307866 
+329207.138439  7384433.322896 
+329185.698240  7384455.779050 
+329163.969422  7384467.667013 
+329141.663368  7384482.744431 
+329115.720726  7384500.771343 
+329067.719418  7384537.415066 
+329045.223700  7384559.041362 
+329029.423923  7384586.256700 
+328985.356066  7384745.199474 
+328971.403444  7384809.698426 
+328955.578927  7384871.227887 
+328935.524094  7384944.955258 
+328879.532188  7385055.116388 
+328846.736929  7385106.097656 
+328806.643755  7385165.677450 
+328750.503417  7385241.284500 
+328667.909171  7385322.490590 
+328566.142439  7385405.706336 
+328512.203844  7385445.219567 
+328429.551874  7385503.209634 
+328387.248711  7385548.991792 
+328337.119875  7385595.063900 
+328313.519163  7385621.769326 
+328175.370061  7385781.361989 
+328138.723812  7385865.967497 
+328098.490452  7385935.395605 
+328019.277161  7386040.087672 
+327884.583229  7386123.873320 
+327894.701354  7386139.360667 
+327991.000836  7386281.996235 
+328025.865899  7386341.556033 
+328128.993260  7386509.677235 
+328178.379935  7386588.683702 
+328211.430827  7386641.564644 
+328241.199720  7386687.776729 
+328296.738083  7386789.989220 
+328306.880947  7386804.066809 
+328330.729046  7386841.340424 
+328374.046496  7386909.598732 
+328382.738023  7386930.095222 
+328389.293776  7386938.503781 
+328421.676724  7386987.615369 
+328439.076271  7387008.751748 
+328457.770475  7387042.865905 
+328513.836598  7387125.711714 
+328526.074004  7387145.348351 
+328577.736639  7387228.914037 
+328638.033077  7387326.757277 
+328666.828915  7387377.298620 
+328702.716511  7387423.980623 
+328760.959638  7387523.133639 
+328788.295892  7387567.316071 
+328803.435972  7387598.610711 
+328813.446896  7387623.056524 
+328817.396840  7387632.704871 
+328849.491170  7387736.157150 
+328887.242414  7387852.937147 
+328910.711186  7387936.482836 
+328923.113517  7387969.287217 
+328929.636285  7387999.342069 
+328960.468942  7388116.581987 
+328983.261523  7388096.585412 
+329006.243768  7388077.138743 
+329034.149013  7388047.893753 
+329066.350543  7387999.981960 
+329136.212609  7387890.930639 
+329174.508105  7387845.418435 
+329225.700704  7387805.805220 
+329274.023616  7387773.140816 
+329328.267321  7387745.315582 
+329406.383864  7387707.422073 
+329432.969712  7387693.814403 
+329464.725946  7387678.197079 
+329557.446563  7387656.030875 
+329605.571565  7387620.936887 
+329652.805975  7387578.354181 
+329740.587100  7387502.307207 
+329829.761838  7387433.409008 
+329924.271887  7387362.961076 
+329956.506403  7387349.743340 
+329998.760089  7387334.725912 
+330042.836192  7387321.478181 
+330169.918852  7387293.382994 
+330213.376488  7387275.576044 
+330273.763635  7387267.907357 
+330296.300583  7387258.418983 
+330329.516400  7387242.991625 
+330386.456623  7387212.146909 
+330400.697863  7387206.217924 
+330438.663509  7387188.420973 
+330461.398367  7387176.463021 
+330497.970400  7387158.766052 
+330537.898649  7387136.099935 
+330579.360696  7387112.563966 
+330604.651886  7387098.216424 
+330661.105581  7387069.981260 
+330713.328959  7387041.756095 
+330829.064806  7386983.886008 
+330867.178885  7386966.948909 
+330923.632580  7386938.713745 
+331030.907794  7386882.263415 
+331124.057215  7386818.744295 
+331217.528240  7386677.328518 
+331248.616529  7386628.186936 
+331281.733392  7386579.725237 
+331296.337466  7386507.677578 
+331401.534630  7386315.070570 
+331420.063911  7386283.825922 
+331425.654855  7386259.310121 
+331437.958231  7386236.634005 
+331477.391706  7386135.751286 
+331520.890573  7386027.819773 
+331532.583728  7386000.004538 
+331574.952861  7385925.147360 
+331633.352666  7385827.404103 
+331652.566384  7385819.065531 
+331678.756412  7385816.755927 
+331707.486280  7385817.225846 
+331739.778519  7385812.116721 
+331764.690382  7385802.938293 
+331796.702249  7385789.180650 
+331839.137352  7385769.574008 
+331875.989757  7385756.566236 
+331915.142860  7385752.456940 
+331944.647873  7385754.706555 
+331959.268440  7385691.917310 
+331875.239350  7385635.317005 
+331795.292144  7385585.325568 
+331762.966920  7385558.640139 
+331778.214200  7385532.784568 
+331747.678408  7385525.655789 
+331744.511855  7385501.759882 
+331743.893388  7385443.299896 
+331745.888976  7385424.493118 
+331750.680036  7385406.686168 
+331756.510121  7385393.208476 
+331761.573307  7385382.030391 
+331765.869593  7385372.871960 
+331778.750205  7385263.280732 
+331758.992237  7385236.125383 
+331803.101324  7385161.358190 
+331709.770486  7385139.571922 
+331677.387538  7385122.604828 
+331693.220301  7385024.471638 
+331657.398675  7384938.176419 
+331594.347995  7384798.100413 
+331582.094097  7384771.934895 
+331544.103712  7384721.903465 
+331394.616043  7384702.736748 
+331327.862806  7384686.289565 
+Region 1
+286
+325879.528740  7381254.317431 
+325957.455620  7381110.702031 
+326015.063787  7381010.379215 
+326026.781681  7380969.316249 
+326080.019346  7380893.309268 
+326145.007889  7380773.469796 
+326208.272971  7380669.007689 
+326278.835967  7380552.007730 
+326364.720459  7380407.382503 
+326385.385513  7380376.507792 
+326428.035018  7380327.926113 
+326445.434564  7380311.208977 
+326561.021979  7380179.021619 
+326675.685817  7380053.003205 
+326748.689696  7379969.697475 
+326793.458483  7379907.108196 
+326813.216451  7379879.312957 
+326880.777819  7379773.461088 
+326932.621871  7379685.686123 
+326984.548385  7379590.942352 
+326999.944098  7379561.767349 
+326999.952344  7379561.767349 
+327025.037378  7379514.225493 
+327068.429044  7379424.920790 
+327118.442432  7379338.095662 
+327157.546058  7379281.435368 
+327203.477563  7379218.856087 
+327252.311741  7379143.678964 
+327404.899993  7378894.401663 
+327454.839165  7378812.035772 
+327465.369602  7378792.669089 
+327530.655010  7378682.148020 
+327583.430886  7378590.603701 
+327727.129701  7378367.911846 
+327782.272246  7378289.275316 
+327831.972278  7378213.318327 
+327931.957824  7378116.364934 
+328011.014438  7378053.305735 
+328064.953032  7378021.691151 
+328171.106759  7377971.119813 
+328187.252879  7378037.428455 
+328188.184703  7378053.835644 
+328195.507356  7378089.689503 
+328196.736044  7378124.263581 
+328230.710515  7378149.259299 
+328258.830161  7378151.468921 
+328286.982792  7378151.248958 
+328300.580827  7378156.838001 
+328307.416952  7378165.116583 
+328324.173293  7378179.934045 
+328332.724634  7378198.860803 
+328346.718487  7378222.726715 
+328355.764602  7378234.354723 
+328383.133842  7378282.746434 
+328416.209473  7378349.924927 
+328417.710287  7378369.661546 
+328414.312840  7378389.548140 
+328409.505287  7378398.796556 
+328398.422353  7378413.404054 
+328390.712128  7378427.481642 
+328385.698420  7378446.148445 
+328385.046967  7378466.624937 
+328390.621419  7378477.992990 
+328403.716434  7378492.210555 
+328413.818066  7378500.419149 
+328442.943753  7378512.947003 
+328472.316826  7378521.705503 
+328488.825780  7378522.565355 
+328509.655759  7378520.925636 
+328526.445084  7378515.476570 
+328546.376224  7378512.057155 
+328572.285880  7378511.257292 
+328591.755231  7378512.377100 
+328610.045371  7378518.236097 
+328626.034812  7378520.635686 
+328645.594871  7378522.535360 
+328665.699181  7378521.665509 
+328679.214753  7378517.166280 
+328690.396642  7378511.427263 
+328728.040685  7378501.908894 
+328749.959166  7378503.048698 
+328761.561612  7378505.068352 
+328773.254767  7378508.197816 
+328783.348154  7378517.396241 
+328800.525052  7378530.893929 
+328818.765714  7378540.852223 
+328834.647955  7378552.010312 
+328870.923123  7378589.313922 
+328900.725001  7378613.589764 
+328964.707504  7378690.456597 
+329001.518678  7378733.069298 
+329024.212305  7378754.705592 
+329041.653083  7378763.444095 
+329060.998740  7378766.773525 
+329094.552652  7378767.053477 
+329130.844313  7378768.253271 
+329156.011809  7378770.432898 
+329180.371175  7378771.832658 
+329197.844937  7378778.011600 
+329217.050408  7378792.529113 
+329239.323477  7378806.856659 
+329248.955075  7378811.955785 
+329260.574014  7378820.844263 
+329270.164380  7378829.482783 
+329275.912003  7378835.311785 
+329282.401786  7378847.239742 
+329296.321424  7378860.467476 
+329317.217372  7378876.654703 
+329332.406929  7378888.252716 
+329343.770235  7378901.890380 
+329345.526682  7378908.999163 
+329349.756998  7378921.896953 
+329351.983481  7378932.005222 
+329359.809153  7378938.174165 
+329365.828902  7378942.913354 
+329377.728213  7378946.262780 
+329385.809519  7378952.891644 
+329396.933684  7378961.110237 
+329425.746014  7378982.936498 
+329443.681565  7378992.674830 
+329467.562649  7379000.703455 
+329481.193669  7379008.162177 
+329507.993918  7379022.659694 
+329528.254907  7379034.637642 
+329548.235524  7379052.934508 
+329626.954041  7379150.877731 
+329661.192391  7379206.098272 
+329689.740842  7379269.147473 
+329721.101257  7379307.260944 
+329733.487095  7379341.785030 
+329779.665987  7379409.203482 
+329742.797090  7379405.704082 
+329694.820520  7379402.474635 
+329696.733645  7379593.821859 
+329733.231462  7379677.157584 
+329742.764105  7379707.312419 
+329744.339135  7379733.497934 
+329737.197899  7379777.150456 
+329718.940744  7379843.019174 
+329713.927036  7379883.322270 
+329718.083136  7379921.505730 
+329737.049467  7379963.918465 
+329753.863531  7380006.511169 
+329760.600702  7380050.693601 
+329761.870621  7380082.318184 
+329758.852501  7380112.962935 
+329754.292335  7380135.069148 
+329696.923308  7380173.192618 
+329683.721093  7380175.482226 
+329676.357209  7380182.341051 
+329659.271019  7380257.218225 
+329658.133040  7380306.869720 
+329664.779501  7380404.852937 
+329661.489255  7380461.653207 
+329662.767421  7380489.858376 
+329679.103204  7380580.032930 
+329686.821676  7380620.795947 
+329697.112972  7380660.899078 
+329732.217176  7380843.877736 
+329710.142016  7380875.142380 
+329687.547344  7380892.679376 
+329650.488784  7380917.065199 
+329620.794107  7380932.072629 
+329614.964022  7380936.901801 
+329607.847525  7380941.221062 
+329602.767847  7380946.040236 
+329600.236254  7380952.649104 
+329601.003154  7380959.008015 
+329642.671357  7381039.574214 
+329646.992382  7381044.913300 
+329655.106673  7381055.841428 
+329670.856973  7381068.289296 
+329693.971158  7381077.947641 
+329726.222166  7381088.115900 
+329775.081083  7381096.814410 
+329824.731637  7381105.662894 
+329874.118313  7381130.918568 
+329902.592547  7381164.902747 
+329837.521541  7381215.983997 
+329802.120473  7381234.770779 
+329767.659475  7381263.465864 
+329744.660738  7381286.411933 
+329687.522606  7381362.958822 
+329568.009985  7381399.402579 
+329550.725885  7381403.341904 
+329542.347715  7381403.531872 
+329530.662806  7381406.751320 
+329513.601355  7381414.489995 
+329438.206068  7381454.573129 
+329408.412437  7381469.850512 
+329391.837513  7381480.388707 
+329366.092781  7381497.975694 
+329359.883369  7381514.702829 
+329357.541440  7381523.071396 
+329356.147827  7381539.818527 
+329352.222621  7381556.555660 
+329344.768029  7381569.973362 
+329325.842929  7381590.649820 
+329308.261966  7381601.697928 
+329261.398637  7381625.233896 
+329247.182135  7381627.153567 
+329239.306985  7381627.353533 
+329230.417548  7381629.313198 
+329222.278519  7381631.292858 
+329083.642889  7381717.128156 
+329049.239615  7381736.944761 
+328991.911819  7381769.789135 
+328883.399670  7381828.159137 
+328829.213689  7381990.991245 
+328826.179076  7381999.999702 
+328820.992197  7382012.417575 
+328781.410290  7382150.953845 
+328751.567181  7382256.175822 
+328741.119207  7382316.055565 
+328737.020830  7382404.470420 
+328732.996669  7382451.392383 
+328728.857062  7382520.550537 
+328726.721288  7382559.933791 
+328721.237545  7382631.551523 
+328718.722444  7382658.206957 
+328716.998982  7382680.053215 
+328707.870405  7382793.563772 
+328704.299787  7382847.684502 
+328692.433461  7383035.912260 
+328691.707793  7383059.538213 
+328689.101984  7383095.602036 
+328691.946933  7383172.638840 
+328699.376787  7383193.295302 
+328723.958801  7383228.089342 
+328673.046573  7383210.022436 
+328636.491032  7383208.842638 
+328582.552438  7383233.858353 
+328576.499704  7383239.557377 
+328545.056827  7383269.132311 
+328488.908242  7383300.047016 
+328432.767904  7383315.324399 
+328402.867072  7383323.223046 
+328346.932889  7383334.361138 
+328248.423418  7383356.857285 
+328155.051348  7383375.564081 
+328109.260030  7383384.292585 
+328069.216334  7383385.992294 
+328042.449069  7383379.913336 
+328011.806076  7383355.327547 
+327999.997474  7383347.198939 
+327927.282212  7383286.069410 
+327811.620581  7383190.605762 
+327745.650735  7383142.234048 
+327693.617020  7383109.169712 
+327666.833263  7383082.854219 
+327554.593818  7383012.766225 
+327458.129411  7382945.517744 
+327405.493721  7382905.344625 
+327378.330637  7382888.947434 
+327277.800840  7382820.989074 
+327180.528303  7382767.468242 
+326932.926982  7382626.382409 
+326804.425969  7382556.034459 
+326755.286681  7382529.538997 
+326669.756777  7382480.637373 
+326665.419259  7382478.457747 
+326647.788818  7382470.839052 
+326564.427673  7382431.355815 
+326508.947033  7382405.470249 
+326423.458360  7382375.945306 
+326316.141914  7382347.000264 
+326243.286466  7382331.292955 
+326198.039399  7382307.826974 
+326137.462588  7382245.847591 
+326083.862089  7382197.585858 
+326039.142780  7382157.762679 
+325970.863991  7382108.621096 
+325902.032703  7382037.573266 
+325874.432569  7382009.048152 
+325833.869361  7381960.826412 
+325819.331256  7381952.747796 
+325775.716942  7381892.528111 
+325723.848152  7381832.018476 
+325675.096436  7381885.109382 
+325574.863503  7381821.520274 
+325612.095234  7381743.983556 
+325652.963553  7381670.716106 
+325703.438731  7381579.161788 
+325759.694516  7381481.598500 
+325804.496287  7381395.073321 
+325879.528740  7381254.317431 
+Region 1
+578
+321543.207123  7387086.988347 
+321457.932852  7387072.140890 
+321409.791358  7387175.963107 
+321404.431308  7387191.660418 
+321405.429102  7387203.348416 
+321378.373219  7387312.749676 
+321346.419075  7387518.064508 
+321356.900034  7387580.773766 
+321356.908280  7387580.773766 
+321356.900034  7387580.793763 
+321356.908280  7387580.823758 
+321356.891788  7387580.823758 
+321345.033708  7387624.826220 
+321252.956297  7387801.076030 
+321227.549660  7387861.845621 
+321226.189032  7387856.726498 
+321225.801459  7387846.208300 
+321224.548032  7387832.230694 
+321224.943851  7387816.623367 
+321223.352329  7387804.855383 
+321220.944430  7387801.176013 
+321214.891696  7387795.456993 
+321203.932456  7387790.667813 
+321192.123853  7387787.638332 
+321183.110723  7387782.099281 
+321174.584121  7387778.119963 
+321161.406644  7387770.651242 
+321149.482595  7387761.422823 
+321125.675727  7387738.206799 
+321114.972119  7387728.768416 
+321104.763286  7387721.109728 
+321091.618794  7387710.651519 
+321078.680458  7387700.743217 
+321057.199028  7387687.525481 
+321040.871491  7387679.236900 
+321039.873697  7387679.106923 
+321028.650577  7387677.427210 
+321006.979483  7387679.596839 
+320987.031851  7387683.776123 
+320970.019877  7387689.105210 
+320947.252034  7387697.913701 
+320936.903015  7387701.663059 
+320929.728794  7387704.012657 
+320924.096619  7387705.382422 
+320914.176403  7387707.032139 
+320907.562926  7387705.732362 
+320899.003339  7387704.192626 
+320884.621913  7387694.924213 
+320872.706109  7387684.815945 
+320861.854070  7387670.948320 
+320846.878915  7387651.711615 
+320835.218745  7387637.394068 
+320822.321640  7387623.826392 
+320807.948460  7387614.128053 
+320791.126150  7387604.399719 
+320768.176890  7387594.591399 
+320740.749926  7387583.953222 
+320715.203104  7387570.455534 
+320685.854769  7387557.917681 
+320661.924208  7387545.319839 
+320648.276696  7387534.971612 
+320634.134410  7387522.833691 
+320620.552869  7387506.716452 
+320599.401287  7387475.661771 
+320581.210102  7387452.735698 
+320567.133786  7387435.728611 
+320555.028320  7387424.060610 
+320543.607290  7387414.942172 
+320532.697527  7387405.723751 
+320521.713548  7387394.625652 
+320504.734559  7387380.908001 
+320481.777053  7387363.341010 
+320467.016300  7387352.422881 
+320457.747537  7387342.224628 
+320441.518955  7387325.967412 
+320426.890142  7387312.269759 
+320413.531248  7387303.131324 
+320405.235540  7387296.942384 
+320400.914515  7387291.463322 
+320398.951912  7387285.124408 
+320397.170727  7387272.366594 
+320395.711144  7387249.860449 
+320394.589656  7387233.453259 
+320394.070144  7387225.914550 
+320391.340642  7387190.660589 
+320388.685355  7387179.542494 
+320387.539129  7387175.553177 
+320380.381401  7387160.065830 
+320371.508457  7387143.348693 
+320364.820764  7387123.172149 
+320358.743292  7387102.315722 
+320352.970930  7387073.670628 
+320345.714247  7387041.566128 
+320337.459770  7387015.550584 
+320334.581836  7387009.201671 
+320329.683575  7387002.942743 
+320326.145942  7386998.353530 
+320311.533621  7386982.996160 
+320290.439763  7386963.469505 
+320271.943468  7386949.281935 
+320260.910011  7386942.053173 
+320244.582475  7386933.324668 
+320238.018475  7386927.595650 
+320222.969104  7386915.227768 
+320203.433784  7386901.590104 
+320179.198112  7386881.013629 
+320154.517144  7386862.876735 
+320138.024682  7386851.158743 
+320125.803768  7386841.260438 
+320113.690056  7386830.372303 
+320103.720363  7386819.164223 
+320098.426283  7386810.135770 
+320092.497243  7386794.438458 
+320086.263093  7386778.641164 
+320078.412681  7386761.044178 
+320070.743686  7386745.766795 
+320060.345190  7386728.029834 
+320048.833452  7386710.272875 
+320038.401970  7386695.525401 
+320022.956780  7386673.079246 
+320010.208107  7386655.862195 
+320000.254907  7386644.214190 
+319989.040033  7386634.995769 
+319969.348034  7386617.918695 
+319957.226075  7386608.020390 
+319934.359278  7386591.573207 
+319930.516534  7386587.963826 
+319920.942661  7386578.995362 
+319914.428138  7386569.387008 
+319908.705254  7386553.149789 
+319901.629988  7386531.573485 
+319894.315582  7386511.986840 
+319887.941245  7386490.870457 
+319883.562497  7386482.061966 
+319877.039729  7386473.123497 
+319871.209643  7386466.184685 
+319858.411494  7386452.617009 
+319845.316479  7386438.499427 
+319825.649219  7386419.762637 
+319808.101240  7386403.155482 
+319790.643970  7386386.768289 
+319775.792509  7386374.840332 
+319768.049298  7386365.551923 
+319762.746972  7386356.623452 
+319758.120836  7386351.034409 
+319749.635465  7386344.285565 
+319729.242537  7386325.978701 
+319713.228357  7386309.381544 
+319703.778176  7386297.523575 
+319697.791413  7386286.485466 
+319688.860745  7386274.417533 
+319677.777811  7386254.230991 
+319667.032973  7386231.834827 
+319657.871410  7386213.887901 
+319647.819255  7386193.051471 
+319639.267914  7386174.554639 
+319631.269070  7386161.496876 
+319626.708905  7386150.478763 
+319621.480795  7386136.011241 
+319617.019584  7386125.553032 
+319608.394027  7386113.145158 
+319605.103780  7386104.366661 
+319599.405635  7386088.999294 
+319590.408997  7386074.051854 
+319586.492038  7386065.673289 
+319583.943953  7386060.014259 
+319572.382737  7386037.498115 
+319562.907818  7386019.881133 
+319556.500497  7386001.854221 
+319547.083302  7385979.478054 
+319534.598508  7385957.501818 
+319521.198384  7385943.264257 
+319507.352962  7385924.377492 
+319493.532280  7385903.161126 
+319481.698939  7385894.262650 
+319466.377442  7385887.543801 
+319409.082632  7385866.227452 
+319382.340106  7385858.038855 
+319368.766810  7385850.440157 
+319346.864822  7385838.432214 
+319316.337276  7385823.544764 
+319285.199509  7385807.877447 
+319262.456405  7385798.399071 
+319223.930015  7385786.511107 
+319211.651378  7385781.152025 
+319206.382036  7385777.982568 
+319199.422218  7385771.363702 
+319193.410715  7385762.545212 
+319179.260184  7385734.450025 
+319170.634626  7385722.492073 
+319159.213597  7385713.603596 
+319143.488035  7385705.984901 
+319118.609157  7385696.486528 
+319092.311928  7385685.638386 
+319080.066275  7385677.619759 
+319066.064176  7385670.470984 
+319037.227107  7385659.142924 
+319010.492827  7385650.504404 
+318997.274120  7385646.905020 
+318980.270392  7385635.736933 
+318952.488841  7385604.372306 
+318937.711596  7385589.764808 
+318923.420878  7385576.157139 
+318892.810870  7385560.509819 
+318839.746375  7385519.006928 
+318816.087940  7385502.549747 
+318798.539961  7385494.471131 
+318778.889193  7385482.373203 
+318774.180596  7385475.334409 
+318769.513229  7385464.756221 
+318756.063627  7385414.304863 
+318748.411125  7385389.289148 
+318737.402407  7385355.474940 
+318729.411809  7385325.250117 
+318723.532247  7385305.903431 
+318714.552102  7385277.788247 
+318703.881479  7385244.403965 
+318695.338384  7385217.498574 
+318685.995405  7385189.753326 
+318673.263225  7385163.277861 
+318668.595858  7385144.501078 
+318667.474371  7385128.093888 
+318669.214326  7385111.286767 
+318677.691451  7385094.439653 
+318683.208179  7385077.562544 
+318688.469274  7385064.674751 
+318689.871133  7385050.067253 
+318688.395058  7385037.749363 
+318683.208179  7385028.270987 
+318669.049401  7385017.572819 
+318651.229297  7385006.274755 
+318638.571333  7384998.586072 
+318620.644027  7384988.067873 
+318606.105923  7384975.260067 
+318573.261186  7384957.793059 
+318562.978136  7384947.804770 
+318543.154198  7384933.487222 
+318515.364401  7384919.849558 
+318495.235352  7384905.761972 
+318484.589468  7384899.862982 
+318472.492247  7384888.414943 
+318449.303847  7384857.560228 
+318434.955405  7384845.862232 
+318422.231472  7384843.152696 
+318408.072694  7384841.313011 
+318387.119021  7384836.073908 
+318372.910766  7384829.355059 
+318365.637591  7384823.726024 
+318359.114822  7384814.567592 
+318348.073119  7384800.250045 
+318337.773577  7384791.371566 
+318320.440000  7384773.764581 
+318298.191670  7384765.735957 
+318287.339631  7384760.836796 
+318273.527194  7384755.567698 
+318259.772482  7384753.957974 
+318244.879789  7384752.998139 
+318226.597896  7384754.427894 
+318211.870128  7384757.457375 
+318195.831209  7384758.917125 
+318172.271728  7384757.847308 
+318153.000287  7384756.167596 
+318137.307710  7384754.757837 
+318098.146361  7384744.299629 
+318073.861212  7384736.460971 
+318056.420434  7384727.162564 
+318043.366651  7384718.694015 
+318034.485460  7384710.825362 
+318016.121105  7384693.988246 
+317990.730961  7384676.501242 
+317978.881127  7384669.042519 
+317962.471128  7384659.094223 
+317949.417345  7384650.395713 
+317936.610949  7384638.607733 
+317928.043115  7384629.969212 
+317925.833125  7384619.091076 
+317920.761693  7384600.304294 
+317916.737533  7384587.406503 
+317912.614418  7384574.288750 
+317908.400594  7384560.611093 
+317903.254946  7384547.363362 
+317900.723353  7384538.024962 
+317893.648087  7384528.336621 
+317891.990595  7384526.067010 
+317873.923103  7384510.229723 
+317858.461421  7384506.600344 
+317838.670467  7384506.130425 
+317815.086248  7384507.380211 
+317802.114927  7384508.000105 
+317785.375079  7384508.560009 
+317770.705034  7384506.720324 
+317754.822794  7384495.662218 
+317739.723946  7384486.943711 
+317725.095133  7384473.695981 
+317714.325555  7384461.488072 
+317697.800109  7384445.110877 
+317685.158638  7384435.872459 
+317670.933890  7384414.536114 
+317660.419946  7384398.568849 
+317646.896127  7384378.792237 
+317636.093565  7384369.013912 
+317628.094722  7384364.374706 
+317617.704471  7384362.804975 
+317608.881004  7384358.705677 
+317601.088316  7384345.207989 
+317596.132332  7384333.519991 
+317591.201086  7384320.162279 
+317583.268212  7384301.345503 
+317574.782840  7384286.178101 
+317569.365067  7384270.930712 
+317561.646595  7384251.893973 
+317551.083174  7384223.518834 
+317549.137063  7384207.651552 
+317550.967726  7384183.865626 
+317554.596068  7384171.057820 
+317554.431143  7384159.649774 
+317551.850073  7384137.683536 
+317548.493857  7384120.476484 
+317543.801752  7384103.799340 
+317538.342747  7384091.881382 
+317528.645180  7384075.924115 
+317522.641924  7384066.435741 
+317512.936111  7384051.248342 
+317497.614614  7384036.210918 
+317478.747238  7384018.803899 
+317479.868726  7384010.735282 
+317483.002293  7383997.147609 
+317486.902760  7383986.569421 
+317490.300207  7383976.311178 
+317491.124831  7383967.232733 
+317490.258976  7383955.374764 
+317486.490449  7383946.686253 
+317477.081500  7383931.728815 
+317468.505420  7383923.870161 
+317447.881597  7383908.982711 
+317428.634895  7383897.894610 
+317412.645453  7383878.857871 
+317385.680279  7383856.371723 
+317350.155518  7383833.775593 
+317323.256313  7383813.829010 
+317300.158621  7383792.602646 
+317273.696467  7383770.896364 
+317251.283212  7383751.789637 
+317226.099224  7383734.082670 
+317173.496518  7383697.978854 
+317164.219509  7383680.471853 
+317156.905102  7383653.576460 
+317154.777575  7383636.379405 
+317156.047494  7383616.452819 
+317157.902896  7383598.865831 
+317161.910564  7383580.418991 
+317168.713705  7383558.352771 
+317177.025905  7383538.746129 
+317188.298503  7383502.002423 
+317193.081316  7383478.576435 
+317194.450191  7383467.408348 
+317193.930678  7383443.702409 
+317192.652512  7383423.525865 
+317190.648678  7383412.087824 
+317221.110254  7383420.606365 
+317238.122228  7383429.594826 
+317262.333161  7383442.092685 
+317280.309944  7383465.178730 
+317294.922265  7383484.015504 
+317304.100319  7383511.180851 
+317309.913912  7383533.716990 
+317316.873731  7383555.513257 
+317326.142494  7383575.049910 
+317336.120433  7383599.165780 
+317349.941116  7383619.912226 
+317366.062497  7383639.918799 
+317388.673661  7383658.105684 
+317412.826871  7383674.042954 
+317440.097155  7383684.681132 
+317463.986485  7383691.839905 
+317489.038534  7383697.498936 
+317511.591975  7383689.800255 
+317546.028234  7383675.022786 
+317598.482507  7383650.576973 
+317655.216574  7383617.812586 
+317678.174080  7383608.974100 
+317699.630772  7383597.066139 
+317713.319515  7383597.626043 
+317780.468571  7383493.423892 
+317803.079736  7383480.766060 
+317830.383006  7383458.659847 
+317874.129259  7383429.914771 
+318064.023459  7383350.338402 
+318091.763778  7383349.308578 
+318114.869717  7383352.717994 
+318153.758940  7383347.518884 
+318181.548738  7383347.118953 
+318220.998705  7383326.242529 
+318242.546106  7383315.654343 
+318266.996180  7383303.666396 
+318315.112935  7383290.968571 
+318344.354069  7383275.421234 
+318351.091240  7383263.373298 
+318359.609596  7383257.084375 
+318372.251068  7383253.944913 
+318427.838908  7383254.834760 
+318451.043801  7383255.764601 
+318474.792946  7383250.185557 
+318490.510261  7383245.586345 
+318504.363929  7383239.417401 
+318527.403897  7383231.178812 
+318560.792885  7383202.573712 
+318611.721606  7383154.102015 
+318650.280980  7383117.658258 
+318638.406408  7383137.614839 
+318631.133233  7383156.891537 
+318619.440078  7383203.153613 
+318645.910478  7383228.929198 
+318660.761939  7383246.046266 
+318688.551737  7383281.010277 
+318683.488551  7383320.183567 
+318672.380878  7383391.631328 
+318734.763613  7383361.396507 
+318776.308123  7383342.899676 
+318883.072071  7383280.820309 
+318902.821794  7383271.801854 
+318961.386524  7383258.654106 
+319005.973893  7383257.764259 
+319035.379951  7383254.244861 
+319056.119221  7383246.706153 
+319065.602387  7383231.288794 
+319096.773139  7383199.964159 
+319115.558052  7383194.285132 
+319137.047729  7383169.989294 
+319161.778175  7383137.004944 
+319171.739621  7383117.008369 
+319182.261812  7383089.413096 
+319252.132124  7383064.687331 
+319310.498944  7383043.151020 
+319350.039620  7383029.563347 
+319418.318410  7383007.857065 
+319466.369196  7382988.360405 
+319527.011976  7382967.633955 
+319590.029671  7382942.368283 
+319632.184402  7382928.940583 
+319663.083028  7382888.377531 
+319759.440233  7382766.218456 
+319834.546902  7382684.862392 
+319892.963200  7382645.219182 
+319903.378189  7382649.358473 
+319936.989825  7382703.859138 
+319955.733508  7382731.344430 
+319988.751415  7382775.836808 
+320020.153061  7382810.670842 
+320075.336837  7382869.280802 
+320109.278322  7382905.144659 
+320122.818633  7382940.868540 
+320137.348491  7382962.194887 
+320163.670460  7382986.670694 
+320214.236346  7383026.993788 
+320234.002561  7383053.659220 
+320266.913267  7383119.857881 
+320289.268799  7383135.205252 
+320345.714247  7383150.632609 
+320386.739245  7383174.838463 
+320423.888514  7383215.791448 
+320452.923492  7383285.199559 
+320477.901325  7383319.733644 
+320507.513539  7383343.419587 
+320534.486959  7383364.735935 
+320549.371406  7383373.664406 
+320616.033934  7383404.389143 
+320645.728611  7383420.486386 
+320655.863228  7383426.485358 
+320665.857660  7383435.133877 
+320674.400755  7383445.542094 
+320676.618991  7383455.650363 
+320675.876830  7383465.178730 
+320658.378329  7383503.932092 
+320642.116762  7383548.734418 
+320635.849626  7383562.911990 
+320638.224541  7383590.747222 
+320646.347078  7383619.092366 
+320657.281580  7383642.378378 
+320664.925836  7383667.943999 
+320676.635483  7383686.250863 
+320687.132935  7383703.987825 
+320700.632014  7383718.005423 
+320717.248169  7383736.372277 
+320730.813219  7383744.510883 
+320749.441454  7383756.378850 
+320760.293493  7383761.717936 
+320778.971206  7383770.026513 
+320797.846827  7383786.323721 
+320808.426741  7383797.301841 
+320820.952766  7383807.760049 
+320842.401212  7383822.647499 
+320865.935954  7383830.506153 
+320866.900763  7383841.424283 
+320896.191374  7383846.343440 
+320918.637614  7383854.372065 
+320949.008481  7383865.490161 
+320976.806525  7383870.599286 
+321018.862301  7383877.318135 
+321049.439325  7383888.656193 
+321116.423456  7383877.238148 
+321181.494462  7383864.760286 
+321192.907245  7383863.060577 
+321200.815381  7383858.611339 
+321215.262777  7383854.032123 
+321225.636535  7383856.811647 
+321244.388463  7383890.785828 
+321257.310307  7383911.702245 
+321281.455270  7383931.048931 
+321298.879555  7383941.117206 
+321320.212554  7383942.956891 
+321345.479005  7383943.796747 
+321371.908174  7383943.786749 
+321388.103771  7383945.976374 
+321409.098674  7383948.225989 
+321424.073829  7383950.405615 
+321441.407406  7383959.364081 
+321458.056546  7383966.332887 
+321484.032172  7383986.469438 
+321503.567492  7383999.227253 
+321516.431612  7384007.255877 
+321533.113737  7384019.523776 
+321547.305500  7384027.342437 
+321560.433499  7384038.360550 
+321575.590071  7384050.838412 
+321584.108427  7384063.126307 
+321600.765813  7384077.953768 
+321620.029008  7384088.272000 
+321649.204172  7384096.930517 
+321689.676672  7384124.675765 
+321715.751253  7384145.592182 
+321732.367408  7384163.739073 
+321761.146753  7384188.014915 
+321778.942119  7384218.029774 
+321789.068490  7384249.274422 
+321797.677555  7384296.126397 
+321817.715895  7384401.698313 
+321833.012653  7384506.790312 
+321851.096637  7384497.921831 
+321867.737530  7384529.656395 
+321898.446493  7384550.382845 
+321941.747450  7384561.300975 
+321954.042580  7384565.580242 
+321976.859900  7384633.218656 
+322034.385605  7384701.326989 
+322125.201344  7384858.750024 
+322220.560755  7385007.084616 
+322371.928565  7385215.968836 
+322408.022316  7385220.378081 
+322088.893190  7385746.477965 
+322097.964044  7385784.491453 
+322104.338380  7385809.067244 
+322109.747907  7385838.232248 
+322109.046978  7385866.187459 
+322097.048712  7385906.460561 
+322062.323835  7385914.719146 
+322027.970038  7386004.003853 
+321844.450175  7386404.245295 
+321822.226583  7386502.288501 
+321813.032036  7386538.512296 
+321808.950152  7386551.170128 
+321801.800670  7386578.775399 
+321797.463153  7386594.482709 
+321790.833183  7386610.429977 
+321750.566839  7386691.686059 
+321746.237568  7386700.044627 
+321737.323393  7386713.962243 
+321728.673097  7386722.050858 
+321711.356012  7386736.198434 
+321698.368199  7386748.836270 
+321690.987823  7386758.204665 
+321685.380386  7386768.832844 
+321677.233110  7386786.299852 
+321670.586648  7386806.806340 
+321667.791176  7386817.204559 
+321626.221927  7386921.266734 
+321565.908996  7386955.840812 
+321543.207123  7387086.988347 
+Region 1
+710
+344711.082834  7398740.002291 
+344699.521619  7398749.370687 
+344675.154007  7398767.177637 
+344652.979893  7398780.615335 
+344634.541321  7398790.923569 
+344539.132433  7398820.058579 
+344507.648324  7398832.396465 
+344469.410553  7398849.453543 
+344406.829908  7398855.422521 
+344349.543344  7398858.022076 
+344305.582688  7398853.902781 
+344287.680122  7398852.972941 
+344241.427014  7398836.045840 
+344193.747308  7398807.740688 
+344128.057835  7398779.385545 
+344058.146292  7398746.641154 
+344040.268464  7398737.702685 
+344017.987148  7398732.753533 
+344000.043350  7398728.764216 
+343924.037843  7398706.408046 
+343900.197990  7398703.428556 
+343776.776656  7398684.621778 
+343715.977197  7398692.660401 
+343696.046058  7398695.239959 
+343640.812805  7398699.719192 
+343640.713850  7398699.619209 
+343600.967018  7398702.488717 
+343566.613221  7398708.417702 
+343506.193089  7398710.787296 
+343425.643909  7398697.749529 
+343367.837832  7398680.862422 
+343324.553367  7398669.794317 
+343276.246948  7398659.726042 
+343202.773033  7398657.716386 
+343178.059080  7398660.265950 
+343144.513413  7398662.995482 
+343119.106777  7398666.524877 
+343095.893637  7398670.854136 
+343063.147856  7398678.512824 
+343015.542366  7398691.340627 
+342935.281803  7398717.186200 
+342862.080014  7398740.742165 
+342862.063521  7398740.742165 
+342793.421897  7398764.678065 
+342768.204924  7398769.087309 
+342733.430569  7398779.655499 
+342673.125885  7398790.763596 
+342613.959180  7398772.106792 
+342584.965433  7398767.987498 
+342562.717102  7398764.678065 
+342541.161456  7398759.678921 
+342521.799306  7398752.500151 
+342492.574665  7398739.952300 
+342468.380224  7398728.444271 
+342444.317723  7398719.375825 
+342419.331644  7398712.507001 
+342395.895856  7398705.008286 
+342366.151703  7398703.788495 
+342327.130539  7398701.078959 
+342279.508557  7398694.730046 
+342169.973875  7398679.362678 
+342170.831483  7398728.284299 
+342169.363654  7398743.261733 
+342169.998614  7398793.143189 
+342177.139850  7398817.748974 
+342189.039161  7398833.616256 
+342186.656000  7398856.632314 
+342188.198045  7398878.498568 
+342200.138587  7398900.304833 
+342190.630683  7398928.050081 
+342173.956805  7398970.112876 
+342138.250626  7399028.042953 
+342128.726230  7399070.895612 
+342106.510884  7399119.307320 
+342093.811689  7399138.354057 
+342072.866263  7399177.477356 
+342046.989592  7399247.865299 
+341967.751561  7399255.064066 
+341887.713647  7399259.963227 
+341881.916546  7399258.973396 
+341827.021389  7399255.743950 
+341800.468526  7399248.495191 
+341780.355970  7399240.116626 
+341764.036679  7399233.257801 
+341746.587655  7399222.979562 
+341724.966039  7399208.132105 
+341704.762774  7399202.033150 
+341679.356137  7399230.608255 
+341680.955906  7399273.460915 
+341661.857635  7399330.811091 
+341657.503626  7399363.895424 
+341647.138114  7399411.967190 
+341641.942988  7399436.522984 
+341635.189326  7399466.237894 
+341564.848978  7399726.383333 
+341571.800551  7399727.123207 
+341608.586985  7399727.123207 
+341635.461451  7399726.293349 
+341661.082490  7399720.504340 
+341689.193890  7399712.245755 
+341711.104125  7399701.497596 
+341735.075917  7399683.720641 
+341751.197298  7399663.884039 
+341764.424252  7399638.248430 
+341775.581402  7399612.622819 
+341790.465849  7399586.587279 
+341804.929737  7399569.640182 
+341821.463430  7399555.992520 
+341835.523253  7399549.383652 
+341858.670422  7399548.553794 
+341895.827938  7399550.573448 
+341931.047589  7399553.083018 
+341962.416250  7399564.261103 
+341987.633223  7399570.460042 
+342009.131147  7399582.857918 
+342020.288297  7399602.294589 
+342027.726397  7399623.370978 
+342033.515251  7399651.896092 
+342039.716416  7399668.843189 
+342049.224320  7399683.310711 
+342063.275897  7399699.018021 
+342085.598443  7399715.965118 
+342126.524486  7399743.660374 
+342152.557836  7399764.326834 
+342195.553683  7399809.789047 
+342218.288541  7399840.793736 
+342224.481460  7399849.472249 
+342236.059168  7399878.817223 
+342250.943614  7399912.301487 
+342258.381714  7399934.627663 
+342259.206337  7399958.603556 
+342255.487287  7399977.610300 
+342244.742449  7399992.497750 
+342229.858002  7400004.895627 
+342211.675064  7400025.152157 
+342180.256925  7400063.175644 
+342166.617660  7400077.233236 
+342158.759002  7400086.321679 
+342144.295113  7400114.436863 
+342129.410667  7400140.062474 
+342113.289286  7400163.618439 
+342110.815417  7400170.647235 
+342111.227728  7400178.915819 
+342114.122155  7400186.764474 
+342123.217748  7400193.793270 
+342133.137963  7400202.061854 
+342139.330882  7400210.330438 
+342141.812998  7400223.558172 
+342139.842149  7400249.223775 
+342137.442496  7400277.458939 
+342139.842149  7400302.094719 
+342142.843777  7400328.520193 
+342147.049354  7400361.564532 
+342151.254932  7400403.017432 
+342159.064112  7400425.843522 
+342167.475268  7400434.262080 
+342192.106759  7400447.469818 
+342228.159279  7400455.888376 
+342257.598322  7400456.488273 
+342276.218311  7400452.878891 
+342290.038994  7400440.860950 
+342309.260957  7400420.444447 
+342322.479665  7400415.635271 
+342333.892448  7400414.435476 
+342344.109528  7400419.834551 
+342362.127542  7400439.061258 
+342372.344622  7400449.879405 
+342387.361008  7400460.687554 
+342407.786921  7400471.505701 
+342418.004001  7400479.314363 
+342424.007257  7400488.922717 
+342431.222709  7400511.758806 
+342437.225964  7400529.775719 
+342450.444672  7400553.811602 
+342466.665008  7400572.428413 
+342495.502076  7400591.055223 
+342514.130311  7400598.863885 
+342526.747044  7400602.473267 
+342557.381791  7400601.873370 
+342586.218860  7400598.863885 
+342602.439195  7400598.263988 
+342621.669405  7400600.063680 
+342633.684163  7400604.872856 
+342639.093691  7400616.890797 
+342641.493344  7400636.107506 
+342639.687419  7400677.560405 
+342637.889741  7400708.205156 
+342639.687419  7400762.275894 
+342635.481842  7400779.692911 
+342627.070686  7400812.137353 
+342612.054300  7400845.771592 
+342602.439195  7400875.216549 
+342598.835593  7400895.043152 
+342599.437568  7400915.459655 
+342607.246748  7400963.521423 
+342618.659531  7401009.183601 
+342628.274636  7401030.210000 
+342639.687419  7401045.227427 
+342658.315654  7401062.654442 
+342700.371431  7401092.089400 
+342738.221629  7401114.915490 
+342784.474737  7401149.159625 
+342824.130860  7401185.803348 
+342848.160376  7401211.638922 
+342878.803369  7401233.865115 
+342908.836141  7401250.082337 
+342949.696214  7401264.499868 
+342993.549669  7401280.127191 
+343028.991968  7401298.144105 
+343056.633333  7401317.970709 
+343073.455644  7401332.388239 
+343088.472030  7401357.024019 
+343090.871683  7401387.658772 
+343087.870055  7401407.485376 
+343078.856925  7401428.511774 
+343056.633333  7401447.138583 
+343025.388365  7401466.355292 
+343015.781507  7401478.973131 
+343007.964080  7401493.390661 
+343002.562799  7401512.017470 
+343000.756874  7401543.252120 
+343007.370351  7401577.496254 
+343020.580813  7401619.549051 
+343034.401495  7401659.802156 
+343047.620203  7401707.863924 
+343060.236936  7401730.090116 
+343076.457272  7401741.508161 
+343097.485160  7401748.716926 
+343122.718626  7401751.116515 
+343143.144539  7401748.716926 
+343158.762900  7401742.707955 
+343174.983236  7401728.890322 
+343193.611471  7401705.464335 
+343205.024254  7401685.637731 
+343218.844936  7401661.001951 
+343239.872824  7401629.767301 
+343263.300366  7401597.922756 
+343289.135806  7401576.896357 
+343308.959745  7401566.688106 
+343361.224355  7401558.879443 
+343423.104069  7401559.479341 
+343449.541485  7401566.688106 
+343468.161474  7401581.705533 
+343481.380181  7401607.541108 
+343490.393312  7401633.366684 
+343493.394940  7401656.802670 
+343493.996914  7401704.864437 
+343500.008416  7401801.577871 
+343503.010044  7401848.439844 
+343509.021547  7401880.284390 
+343515.626777  7401913.928627 
+343518.026430  7401946.363071 
+343515.024802  7401987.216073 
+343507.817597  7402021.460207 
+343504.815969  7402055.704342 
+343508.419572  7402085.139300 
+343518.026430  7402106.165698 
+343536.052691  7402118.183640 
+343567.891387  7402124.792508 
+343595.532752  7402125.992302 
+343611.753088  7402121.783023 
+343624.369821  7402113.374463 
+343632.179001  7402100.756625 
+343635.180629  7402083.939505 
+343638.784232  7402049.695371 
+343640.590157  7402001.633604 
+343644.795734  7401971.598748 
+343654.402593  7401950.572350 
+343667.621301  7401930.745746 
+343689.853138  7401911.519039 
+343707.879399  7401900.110993 
+343727.703337  7401895.301817 
+343741.515773  7401893.502125 
+343753.538778  7401895.301817 
+343764.349586  7401906.719861 
+343831.638828  7401976.407924 
+343939.177922  7402086.938991 
+344066.540954  7402214.907072 
+344112.802308  7402264.768531 
+344141.037402  7402295.403283 
+344162.667265  7402320.039064 
+344173.478073  7402335.056491 
+344183.093178  7402353.073405 
+344187.900731  7402372.300112 
+344192.708283  7402394.526305 
+344196.913861  7402411.953319 
+344202.315142  7402431.180026 
+344204.121067  7402457.005602 
+344204.723041  7402483.441074 
+344202.315142  7402511.076341 
+344199.915489  7402533.902431 
+344198.109564  7402551.329446 
+344199.313514  7402561.537697 
+344200.517464  7402568.146565 
+344205.918745  7402577.764917 
+344216.135825  7402590.382756 
+344231.754185  7402606.000081 
+344247.974521  7402630.025966 
+344258.191601  7402643.243702 
+344262.999153  7402658.261129 
+344263.592882  7402679.887425 
+344269.604384  7402697.314440 
+344284.620770  7402706.322897 
+344303.850980  7402710.532176 
+344328.482471  7402716.541146 
+344360.321167  7402728.549089 
+344393.363814  7402731.558574 
+344411.992049  7402732.758368 
+344437.819243  7402735.757855 
+344481.680944  7402739.367236 
+344515.927540  7402742.966620 
+344572.397727  7402745.376207 
+344617.455131  7402742.366723 
+344651.701727  7402736.357752 
+344685.346348  7402733.958163 
+344728.597828  7402730.358779 
+344746.624088  7402732.158471 
+344782.668362  7402738.767339 
+344797.091020  7402741.766825 
+344850.559579  7402736.967647 
+344865.295594  7402724.359807 
+344873.014065  7402716.391172 
+344888.244853  7402695.914679 
+345233.275390  7402956.939968 
+345193.058523  7402947.101653 
+345178.116353  7402944.642075 
+345160.922962  7402939.882890 
+345137.322250  7402940.592768 
+345115.131643  7402949.131306 
+345104.139418  7402955.800163 
+345094.598529  7402967.528155 
+345094.474836  7402974.866897 
+345094.474836  7402983.275457 
+345097.476464  7403000.092577 
+345101.080066  7403013.310312 
+345112.501096  7403037.346195 
+345135.928637  7403067.980948 
+345157.558500  7403087.807552 
+345176.780464  7403095.016317 
+345206.821482  7403100.425390 
+345236.260525  7403111.833436 
+345254.880514  7403122.651583 
+345266.895272  7403140.068600 
+345271.702825  7403166.504072 
+345277.112352  7403210.356560 
+345286.125482  7403233.792546 
+345292.730713  7403244.600695 
+345301.141868  7403248.809973 
+345316.760229  7403251.809460 
+345344.401594  7403251.809460 
+345384.049471  7403254.818944 
+345417.694092  7403259.618122 
+345432.710478  7403264.427298 
+345456.739994  7403272.235961 
+345471.764626  7403275.245445 
+345489.782640  7403280.644521 
+345513.820403  7403288.463181 
+345524.029236  7403294.462154 
+345542.055496  7403314.288758 
+345556.469908  7403329.306185 
+345573.292218  7403350.932481 
+345591.318478  7403371.968877 
+345624.963099  7403398.394351 
+345648.992616  7403417.021160 
+345682.035262  7403430.238896 
+345708.472677  7403440.447148 
+345733.104168  7403457.274265 
+345748.120554  7403462.683339 
+345767.342518  7403465.082928 
+345790.176330  7403465.682825 
+345813.603872  7403466.282722 
+345831.630132  7403462.073443 
+345855.057673  7403456.074471 
+345878.493461  7403454.264781 
+345896.511475  7403454.264781 
+345919.947262  7403457.274265 
+345933.157724  7403459.673854 
+345943.374803  7403461.473546 
+345955.991536  7403459.073957 
+345968.006294  7403454.264781 
+345984.828605  7403441.646942 
+346001.650915  7403421.830337 
+346017.269276  7403402.003733 
+346037.093215  7403367.159701 
+346052.719822  7403319.097934 
+346056.925399  7403302.880712 
+346056.925399  7403284.853800 
+346048.415289  7403270.736218 
+346040.028873  7403251.209562 
+346018.473226  7403218.775118 
+345989.636157  7403189.930059 
+345962.003038  7403173.712837 
+345932.563995  7403162.904688 
+345896.511475  7403159.295307 
+345847.248493  7403159.295307 
+345834.631760  7403158.695409 
+345811.204219  7403153.286336 
+345784.164828  7403139.468703 
+345771.548095  7403131.660040 
+345758.337634  7403123.251481 
+345751.724157  7403116.042715 
+345746.916604  7403105.824466 
+345742.117298  7403084.198170 
+345742.117298  7403061.372080 
+345748.722529  7403042.745271 
+345759.533337  7403025.328254 
+345779.365522  7403015.709901 
+345793.779933  7403011.510621 
+345819.013399  7403010.910723 
+345847.248493  7403022.918667 
+345864.672778  7403034.936608 
+345881.495089  7403050.553933 
+345891.703922  7403058.372594 
+345905.524605  7403060.172285 
+345919.345287  7403052.363623 
+345927.154468  7403040.345682 
+345940.975150  7403013.910210 
+345954.787587  7402990.484222 
+345968.006294  7402964.048751 
+345977.019424  7402943.022352 
+345982.428952  7402926.205233 
+345983.624655  7402916.586880 
+345980.021052  7402902.769247 
+345984.226630  7402879.343260 
+345988.432208  7402858.916759 
+345997.445338  7402825.872419 
+346009.460096  7402801.246637 
+346023.882753  7402782.019930 
+346071.339811  7402732.158471 
+346115.201511  7402689.505777 
+346140.426731  7402669.679173 
+346172.273674  7402657.661232 
+346207.113998  7402655.261643 
+346259.988829  7402660.670716 
+346293.031475  7402678.687630 
+346324.870172  7402709.332381 
+346357.310843  7402754.384664 
+346397.560695  7402789.228696 
+346445.627973  7402815.664167 
+346543.551962  7402860.116553 
+346582.004136  7402882.342746 
+346630.665143  7402915.387086 
+346673.924869  7402955.640191 
+346710.571118  7403003.102061 
+346740.010161  7403042.745271 
+346752.626894  7403071.580331 
+346760.436075  7403090.207141 
+346776.656410  7403110.033745 
+346795.878374  7403124.451275 
+346812.247142  7403130.840181 
+346841.826371  7403136.389230 
+346854.772953  7403133.299759 
+346871.405600  7403125.911025 
+346905.297608  7403108.044085 
+346944.739330  7403088.317464 
+346973.700092  7403070.450525 
+346989.013342  7403062.161945 
+346935.882878  7402984.025329 
+346861.947174  7402859.056735 
+346762.027597  7402689.865716 
+347215.157971  7402074.291158 
+347188.506154  7402012.081814 
+347156.741673  7401983.296744 
+347122.132243  7401962.220355 
+347087.267180  7401945.363242 
+347034.812907  7401930.305821 
+346994.736226  7401923.017070 
+346958.197178  7401920.647476 
+346934.217139  7401918.737803 
+346887.452765  7401916.918115 
+346817.640177  7401919.517669 
+346754.177186  7401918.497844 
+346715.048821  7401916.208236 
+346686.566340  7401913.638676 
+346667.971090  7401910.409229 
+346629.288022  7401900.130990 
+346597.078245  7401889.152870 
+346570.566614  7401878.234741 
+346544.450801  7401865.396940 
+346519.868788  7401850.309524 
+346501.339508  7401836.801838 
+346490.017433  7401825.613754 
+346476.872941  7401812.186054 
+346458.393138  7401792.169483 
+346440.366878  7401767.683677 
+346429.127266  7401748.117029 
+346417.912392  7401726.730692 
+346404.141187  7401695.696008 
+346388.506334  7401652.203458 
+346368.888551  7401589.584184 
+346354.911190  7401543.482081 
+346372.335475  7401526.514987 
+346384.119339  7401517.086602 
+346395.342459  7401511.677529 
+346412.115292  7401509.367924 
+346433.769894  7401501.559262 
+346452.315666  7401499.019697 
+346469.946108  7401488.401516 
+346487.535318  7401480.802817 
+346509.371336  7401479.303074 
+346535.577857  7401472.064314 
+346593.787999  7401461.686092 
+346615.879651  7401459.436477 
+346634.755273  7401450.597991 
+346661.324628  7401435.290613 
+346686.896190  7401417.963581 
+346705.268792  7401408.865139 
+346742.121196  7401381.849767 
+346746.912256  7401378.450349 
+346775.633878  7401358.573754 
+346793.206595  7401352.984711 
+346821.779784  7401345.316025 
+346843.211738  7401329.328763 
+346872.749736  7401313.901406 
+346911.507020  7401287.935853 
+346938.035144  7401268.709147 
+346982.902885  7401240.274018 
+346995.412417  7401229.005948 
+347011.476074  7401218.777700 
+347019.969692  7401202.700454 
+347028.488048  7401182.073987 
+347031.176319  7401161.407527 
+347032.850304  7401140.991024 
+347032.701872  7401127.653308 
+347033.559480  7401112.485906 
+347031.926726  7401093.309191 
+347031.836018  7401070.853038 
+347033.551234  7401043.877658 
+347035.043801  7401013.112928 
+347038.086660  7400978.328886 
+347043.438464  7400940.275405 
+347051.783650  7400917.669277 
+347064.787955  7400874.576658 
+347069.661478  7400855.069999 
+347077.792261  7400830.684177 
+347093.237451  7400790.041138 
+347110.307148  7400760.776151 
+347133.066745  7400731.511164 
+347145.262920  7400712.804368 
+347167.206140  7400684.359241 
+347225.746131  7400607.942330 
+347254.203873  7400570.548735 
+347272.271365  7400600.053681 
+347283.766610  7400583.896449 
+347317.988467  7400524.996538 
+347336.501255  7400493.521929 
+347352.111370  7400475.295051 
+347365.536233  7400460.267626 
+347379.686765  7400445.910085 
+347393.598156  7400434.202090 
+347407.171452  7400425.593565 
+347423.309325  7400415.795243 
+347426.286214  7400412.705772 
+347448.361374  7400394.018973 
+347459.279383  7400385.050510 
+347468.160574  7400375.392164 
+347481.123648  7400353.485916 
+347485.337472  7400334.759124 
+347485.881723  7400294.965940 
+347467.987403  7400231.886745 
+347468.276021  7400207.520919 
+347468.309006  7400173.246790 
+347470.939553  7400144.341741 
+347471.236418  7400109.617689 
+347475.829568  7400054.527125 
+347481.948271  7399989.488266 
+347490.788231  7399982.369485 
+347492.371507  7399914.221158 
+347475.252332  7399819.187437 
+347456.558127  7399727.183196 
+347424.521521  7399637.278596 
+347438.474143  7399605.913969 
+347363.408706  7399595.775705 
+347318.780105  7399595.775705 
+347288.343268  7399585.627443 
+347236.746603  7399566.990636 
+347211.249258  7399527.797349 
+347186.898139  7399507.510824 
+347166.612411  7399501.421867 
+347142.261292  7399501.421867 
+347114.801344  7399510.090382 
+347083.432683  7399501.421867 
+347040.824409  7399491.273605 
+346998.216135  7399485.184648 
+346949.522143  7399491.273605 
+346921.122125  7399497.362562 
+346905.660443  7399484.014849 
+346897.405966  7399486.764378 
+346887.337318  7399482.185162 
+346841.364582  7399443.821734 
+346832.128804  7399436.403004 
+346812.181172  7399411.907200 
+346795.680464  7399395.020093 
+346779.641546  7399380.922508 
+346756.972658  7399370.254335 
+346736.761146  7399364.675291 
+346715.164268  7399363.775445 
+346687.844506  7399362.975582 
+346651.800232  7399365.235195 
+346617.504159  7399369.794414 
+346599.815994  7399376.633242 
+346554.255570  7399394.880117 
+346526.267863  7399401.009067 
+346518.186557  7399402.728772 
+346503.813377  7399405.388317 
+346491.163659  7399406.008211 
+346473.203369  7399404.288505 
+346452.579546  7399400.859093 
+346431.650612  7399398.509495 
+346412.123538  7399395.390029 
+346377.876942  7399388.391228 
+346345.114668  7399380.862518 
+346327.616167  7399375.233482 
+346321.217092  7399371.484124 
+346311.684449  7399363.365515 
+346300.279912  7399354.926960 
+346284.661551  7399343.678887 
+346274.823798  7399338.989690 
+346267.171296  7399337.739904 
+346259.980583  7399337.120011 
+346249.870704  7399338.449783 
+346234.054434  7399340.089502 
+346225.461861  7399340.089502 
+346217.025967  7399338.209824 
+346209.686822  7399335.870225 
+346186.721070  7399321.022768 
+346175.629890  7399311.804347 
+346154.387599  7399293.847423 
+346150.017097  7399290.557986 
+346144.079811  7399288.848279 
+346122.054129  7399283.849135 
+346107.210914  7399281.659510 
+346082.686624  7399277.440233 
+346043.954079  7399270.411437 
+346026.768934  7399268.531759 
+346014.894362  7399267.911865 
+346005.840001  7399270.251465 
+345993.495393  7399274.630714 
+345975.221746  7399280.559699 
+345965.540671  7399282.279404 
+345959.446707  7399281.969457 
+345935.392452  7399278.060127 
+345916.178735  7399274.160795 
+345900.708806  7399269.781545 
+345888.372445  7399264.782401 
+345884.463732  7399259.943230 
+345879.301591  7399251.854616 
+345868.688692  7399234.787539 
+345859.939442  7399229.948368 
+345839.480543  7399223.079545 
+345828.702720  7399219.790108 
+345809.332324  7399216.830615 
+345746.380599  7399205.582542 
+345728.890344  7399201.833184 
+345714.987199  7399197.923854 
+345708.579878  7399194.644415 
+345687.650945  7399178.397198 
+345660.628047  7399157.310810 
+345649.380188  7399150.431989 
+345624.855898  7399136.684343 
+345612.667970  7399130.275441 
+345594.394322  7399124.496431 
+345571.898605  7399116.687769 
+345548.471064  7399107.939267 
+345527.698809  7399102.470204 
+345517.391021  7399100.750499 
+345504.576378  7399101.540363 
+345495.522017  7399102.630177 
+345488.958017  7399105.129748 
+345478.336872  7399109.658973 
+345472.712943  7399110.438839 
+345465.687154  7399108.719134 
+345449.442080  7399101.850310 
+345434.285508  7399094.821514 
+345417.257042  7399088.572584 
+345388.988963  7399079.044217 
+345383.810330  7399077.164539 
+345316.042807  7399048.729409 
+345302.923054  7399043.580291 
+345292.607019  7399039.830933 
+345222.002793  7399013.425457 
+345199.977111  7399003.897089 
+345159.991138  7398989.839497 
+345134.840135  7398972.812413 
+345105.945343  7398954.845491 
+345071.269943  7398928.909933 
+345037.526367  7398901.414643 
+345028.158649  7398895.485659 
+345019.096041  7398891.576328 
+345000.195681  7398886.577184 
+344991.603108  7398883.607693 
+344986.135857  7398880.798174 
+344963.483462  7398867.670423 
+344937.870669  7398855.332536 
+344912.406309  7398841.894838 
+344901.001772  7398834.396123 
+344893.819305  7398827.057380 
+344880.229517  7398811.590029 
+344860.083976  7398790.973561 
+344852.109871  7398781.755140 
+344843.368866  7398774.566371 
+344825.086973  7398764.568084 
+344809.938647  7398758.479127 
+344792.283467  7398753.789930 
+344756.832922  7398747.381028 
+344745.428385  7398745.821295 
+344739.449868  7398744.001606 
+344729.801778  7398741.132098 
+344723.559381  7398740.512204 
+344711.082834  7398740.002291 
+Region 1
+606
+319663.083028  7382888.377531 
+319759.440233  7382766.218456 
+319834.546902  7382684.862392 
+319892.963200  7382645.219182 
+319903.378189  7382649.358473 
+319936.989825  7382703.859138 
+319955.733508  7382731.344430 
+319988.751415  7382775.836808 
+320020.153061  7382810.670842 
+320075.336837  7382869.280802 
+320109.278322  7382905.144659 
+320122.818633  7382940.868540 
+320137.348491  7382962.194887 
+320163.670460  7382986.670694 
+320214.236346  7383026.993788 
+320234.002561  7383053.659220 
+320266.913267  7383119.857881 
+320289.268799  7383135.205252 
+320345.714247  7383150.632609 
+320386.739245  7383174.838463 
+320423.888514  7383215.791448 
+320452.923492  7383285.199559 
+320477.901325  7383319.733644 
+320507.513539  7383343.419587 
+320534.486959  7383364.735935 
+320549.371406  7383373.664406 
+320616.033934  7383404.389143 
+320645.728611  7383420.486386 
+320655.863228  7383426.485358 
+320665.857660  7383435.133877 
+320674.400755  7383445.542094 
+320676.618991  7383455.650363 
+320675.876830  7383465.178730 
+320658.378329  7383503.932092 
+320642.116762  7383548.734418 
+320635.849626  7383562.911990 
+320638.224541  7383590.747222 
+320687.718417  7383585.908051 
+320748.649815  7383586.048027 
+320869.811682  7383587.047855 
+321023.843025  7383594.726540 
+321065.065932  7383592.166978 
+321131.044023  7383583.028544 
+321225.537580  7383548.284495 
+321241.790901  7383541.465663 
+321241.840378  7383525.508396 
+321235.193916  7383501.942433 
+321229.141183  7383471.627626 
+321223.830610  7383447.091829 
+321207.123747  7383386.852147 
+321193.228848  7383354.447698 
+321162.288991  7383272.211784 
+321147.503499  7383233.668386 
+321024.337798  7382972.973041 
+321031.734667  7382962.804783 
+321018.656146  7382946.517572 
+321010.294468  7382930.870253 
+320994.082378  7382905.194651 
+320986.669017  7382885.158083 
+320971.957741  7382853.743464 
+320961.575737  7382835.016671 
+320946.757261  7382812.120593 
+320937.537975  7382798.382946 
+320926.050975  7382778.636329 
+320915.932850  7382755.370314 
+320903.415072  7382735.833661 
+320890.179872  7382717.276839 
+320878.231084  7382693.430924 
+320862.018994  7382667.315397 
+320853.822241  7382645.279172 
+320845.757428  7382620.703381 
+320843.844302  7382602.516497 
+320847.810739  7382586.619220 
+320850.564980  7382561.723484 
+320854.127352  7382537.287670 
+320850.457779  7382521.080446 
+320844.479262  7382509.372451 
+320839.102719  7382498.234359 
+320826.189122  7382486.776322 
+320814.669138  7382477.767865 
+320797.797350  7382464.050215 
+320785.254833  7382455.031759 
+320767.014171  7382445.283429 
+320752.789423  7382432.265659 
+320737.476173  7382416.008444 
+320731.745043  7382400.881035 
+320724.587314  7382385.393688 
+320715.640154  7382366.566913 
+320721.544455  7382351.019576 
+320734.886857  7382336.232109 
+320740.123213  7382325.223994 
+320744.980243  7382312.096243 
+320747.701499  7382298.068646 
+320745.293600  7382286.410643 
+320742.407419  7382272.742984 
+320737.261771  7382251.306656 
+320725.947942  7382217.052523 
+320720.291028  7382196.386063 
+320717.660481  7382177.849238 
+320712.547818  7382153.643385 
+320704.656175  7382132.167063 
+320692.963020  7382111.870540 
+320680.742106  7382093.993602 
+320675.085192  7382086.444895 
+320656.407479  7382064.788605 
+320644.640108  7382051.350906 
+320630.860657  7382035.233667 
+320611.539738  7382013.397407 
+320597.479915  7381995.050550 
+320583.733449  7381976.503727 
+320573.277228  7381955.987241 
+320564.577455  7381941.479726 
+320554.434591  7381920.203371 
+320537.315416  7381901.936500 
+320525.300658  7381891.488289 
+320503.085313  7381881.360024 
+320447.307809  7381853.864734 
+320433.503619  7381839.847135 
+320413.193153  7381816.231180 
+320400.444480  7381799.124110 
+320396.412073  7381787.226148 
+320386.063054  7381765.499870 
+320373.009271  7381749.162668 
+320360.458508  7381732.615503 
+320353.473950  7381727.986296 
+320343.372318  7381719.887683 
+320341.970459  7381709.239507 
+320344.493805  7381703.180545 
+320349.688931  7381695.711824 
+320352.855483  7381687.443240 
+320350.843403  7381676.565104 
+320345.689509  7381664.427183 
+320338.531780  7381641.081182 
+320337.402047  7381625.003936 
+320339.166740  7381606.307138 
+320341.088112  7381591.159733 
+320344.774177  7381573.262798 
+320345.301936  7381546.787333 
+320355.131443  7381519.442017 
+320356.929121  7381505.844347 
+320361.316116  7381481.088587 
+320363.509613  7381452.533478 
+320363.625060  7381409.780801 
+320359.906010  7381389.024357 
+320357.176508  7381370.047607 
+320343.718660  7381336.433365 
+320337.987529  7381313.107361 
+320327.918882  7381285.842031 
+320316.266958  7381254.357424 
+320309.018521  7381230.011594 
+320308.235129  7381218.973485 
+320305.381933  7381169.691927 
+320293.606316  7381090.475496 
+320281.154508  7381058.091043 
+320276.346955  7381033.995170 
+320266.905021  7381005.310084 
+320262.674705  7380968.036468 
+320260.885273  7380948.079887 
+320251.187705  7380907.196890 
+320242.388977  7380884.050854 
+320224.898722  7380863.344401 
+320205.882914  7380849.926699 
+320189.547131  7380834.659315 
+320170.020057  7380805.064384 
+320159.365927  7380783.888011 
+320151.927827  7380758.322390 
+320144.118647  7380721.458705 
+320128.104467  7380678.496064 
+320104.668679  7380672.737050 
+320024.432855  7380552.557636 
+319971.022019  7380462.803010 
+319958.710397  7380438.387192 
+319938.259745  7380406.492656 
+319899.378767  7380344.283312 
+319779.478574  7380165.683904 
+319723.057864  7380051.013546 
+319708.173417  7380017.819232 
+319704.619292  7379991.523736 
+319698.591297  7379975.496481 
+319690.567715  7379940.472481 
+319608.319810  7379939.422660 
+319603.479273  7379969.427521 
+319609.408313  7379986.604579 
+319602.522710  7379990.733871 
+319596.643148  7380008.940753 
+319590.087394  7380018.009199 
+319574.436049  7380022.068504 
+319552.352643  7380021.508600 
+319534.351122  7380033.156605 
+319526.987238  7380047.174204 
+319519.499660  7380074.879458 
+319510.049480  7380109.043606 
+319501.052842  7380134.839187 
+319488.716481  7380151.086404 
+319476.017286  7380165.453943 
+319461.470935  7380173.702530 
+319324.031009  7380253.598845 
+319283.426569  7380280.284274 
+319232.200984  7380316.818016 
+319202.225936  7380330.965593 
+319169.612094  7380358.100945 
+319144.213703  7380387.935834 
+319118.312293  7380429.578701 
+319119.376057  7380437.947268 
+319122.880705  7380471.841462 
+319125.230880  7380506.095595 
+319120.711946  7380542.199410 
+319056.176945  7380519.233344 
+319045.539307  7380517.623620 
+319022.029304  7380506.385545 
+318988.252743  7380494.317612 
+318968.601976  7380477.810440 
+318932.071174  7380432.998115 
+318901.378703  7380374.158194 
+318877.802730  7380329.455851 
+318864.790178  7380293.971929 
+318852.907360  7380261.157550 
+318866.587856  7380222.474176 
+318872.797268  7380209.586384 
+318880.911559  7380197.098523 
+318884.160574  7380175.062298 
+318882.082524  7380152.596146 
+318867.577404  7380113.682811 
+318840.669953  7380058.302297 
+318796.198031  7379966.248066 
+318778.072816  7379928.554522 
+318745.524944  7379864.425507 
+318643.906644  7379645.762962 
+318626.952394  7379609.929100 
+318543.797404  7379457.085281 
+318495.350799  7379342.184962 
+318443.061450  7379223.315323 
+318425.934029  7379187.131521 
+318416.401387  7379175.703479 
+318381.627032  7379134.010620 
+318365.167556  7379183.482146 
+318186.075918  7379135.680334 
+318156.282287  7379128.661537 
+318125.985636  7379120.312967 
+318102.731265  7379111.604458 
+318082.346583  7379102.376039 
+318047.959801  7379098.726664 
+318037.948877  7379132.490881 
+318000.981025  7379136.660166 
+317973.281936  7379139.919608 
+317978.171951  7379179.022910 
+317977.297851  7379250.690634 
+317925.363090  7379280.295563 
+317887.818002  7379301.441941 
+317862.757707  7379310.710353 
+317757.675990  7379363.011395 
+317601.360442  7379432.439502 
+317587.152186  7379473.382489 
+317571.203976  7379464.174066 
+317549.961686  7379448.466757 
+317535.959587  7379426.710483 
+317524.233447  7379407.633751 
+317518.576532  7379392.756299 
+317515.962477  7379381.328257 
+317509.926236  7379364.171196 
+317499.371061  7379338.615573 
+317485.690565  7379373.269637 
+317452.466501  7379475.502126 
+317443.956391  7379516.115169 
+317428.808066  7379497.398375 
+317399.352530  7379435.598961 
+317379.206988  7379430.179889 
+317407.524544  7379312.799995 
+317438.060336  7379192.110668 
+317458.659420  7379128.481567 
+317461.191013  7379087.388606 
+317535.036009  7378971.768411 
+317516.968517  7378868.506099 
+317513.991628  7378855.548318 
+317369.558898  7378659.011983 
+317400.053459  7378659.581886 
+317426.367181  7378588.953984 
+317426.400166  7378588.943985 
+317456.919466  7378513.396926 
+317355.078517  7378530.104064 
+317384.031033  7378464.975220 
+317331.749931  7378477.603057 
+317294.386260  7378479.272771 
+317259.348026  7378476.383266 
+317105.926905  7378447.628191 
+317033.351829  7378478.392922 
+317012.093046  7378398.316638 
+317000.070042  7378368.941670 
+316984.591867  7378342.956121 
+316945.752120  7378338.146945 
+316925.903443  7378344.495857 
+316903.770560  7378348.545163 
+316884.383672  7378340.046619 
+316800.049471  7378229.135617 
+316784.892899  7378214.578111 
+316759.799619  7378203.769962 
+316700.377281  7378205.439676 
+316724.959295  7378221.256967 
+316744.577078  7378234.684667 
+316758.092650  7378246.592627 
+316773.958397  7378266.839159 
+316781.000678  7378290.415121 
+316791.217758  7378321.439806 
+316793.089653  7378343.176083 
+316791.357944  7378358.883393 
+316787.333784  7378378.769986 
+316776.358051  7378400.346290 
+316762.644569  7378419.553000 
+316742.457796  7378443.558888 
+316728.826777  7378456.456679 
+316712.548718  7378477.733035 
+316703.420140  7378497.999563 
+316687.496669  7378523.055271 
+316666.575982  7378588.474066 
+316649.902104  7378632.686493 
+316643.263888  7378657.632220 
+316630.820326  7378690.036669 
+316623.975954  7378723.071011 
+316613.239362  7378748.966575 
+316599.674313  7378789.449640 
+316596.474775  7378816.654980 
+316593.481393  7378851.948935 
+316591.032263  7378875.954823 
+316581.854208  7378900.100687 
+316568.792179  7378925.186390 
+316547.467426  7378957.920783 
+316528.369156  7378983.936327 
+316511.728263  7379009.201999 
+316493.858681  7379034.787616 
+316480.161692  7379053.444421 
+316460.642864  7379088.858354 
+316421.745394  7379147.628288 
+316388.595547  7379196.169973 
+316361.580895  7379234.923335 
+316342.226992  7379257.389487 
+316318.180983  7379311.580204 
+316313.439401  7379339.875358 
+316314.305255  7379367.690593 
+316319.220008  7379390.456693 
+316320.852762  7379422.821150 
+316315.138124  7379447.556913 
+316309.835798  7379463.664154 
+316304.211869  7379480.761225 
+316291.364241  7379496.438540 
+316320.407466  7379554.848535 
+316345.525484  7379617.637779 
+316391.539451  7379698.303962 
+316413.977445  7379738.567065 
+316421.234128  7379761.703102 
+316429.315434  7379784.619177 
+316437.776066  7379808.985003 
+316451.926598  7379835.520458 
+316468.278874  7379857.776646 
+316485.208385  7379881.802530 
+316491.434289  7379905.918399 
+316491.607460  7379924.415231 
+316489.702581  7379938.232864 
+316485.760883  7379959.449230 
+316483.006642  7379975.586466 
+316476.154024  7380009.620636 
+316470.703265  7380037.015944 
+316467.767607  7380067.550713 
+316459.612085  7380099.795190 
+316457.294894  7380170.323109 
+316460.007904  7380197.938379 
+316463.751693  7380215.925298 
+316471.511396  7380239.841202 
+316482.544853  7380263.237194 
+316498.154967  7380287.033118 
+316513.872283  7380310.709062 
+316529.688553  7380334.724949 
+316543.624683  7380353.951655 
+316555.523994  7380372.818424 
+316569.616802  7380395.814485 
+316575.380917  7380410.491971 
+316580.122500  7380420.540249 
+316591.799162  7380457.123983 
+316596.854102  7380493.077824 
+316601.950272  7380525.822216 
+316606.576408  7380555.667103 
+316613.824844  7380579.573009 
+316628.074331  7380606.338424 
+316651.221500  7380639.532738 
+316665.190615  7380656.429844 
+316689.228378  7380675.346603 
+316702.183206  7380691.893769 
+316711.707602  7380713.060143 
+316722.130838  7380744.094827 
+316736.982299  7380775.219496 
+316743.125741  7380786.337592 
+316759.238876  7380810.693420 
+316775.863277  7380835.709135 
+316791.597085  7380866.033940 
+316800.404059  7380887.640239 
+316818.595244  7380925.853694 
+316828.985495  7380959.657903 
+316846.921046  7381001.640712 
+316876.549753  7381087.526001 
+316884.845461  7381109.122302 
+316899.812370  7381143.756369 
+316905.271374  7381172.401462 
+316908.883223  7381201.026559 
+316910.029449  7381223.632687 
+316909.765570  7381244.569101 
+316910.788103  7381260.526367 
+316911.117952  7381275.373824 
+316921.120630  7381298.869800 
+316928.781378  7381314.367145 
+316943.863734  7381339.922768 
+316947.615769  7381357.909687 
+316947.450844  7381371.307392 
+316943.121573  7381391.193985 
+316942.808216  7381407.691159 
+316948.176512  7381427.147827 
+316950.559673  7381448.444179 
+316955.482673  7381462.681740 
+316957.247366  7381500.695229 
+316952.852125  7381509.503720 
+316932.574644  7381515.892625 
+316924.856172  7381521.111731 
+316920.502162  7381526.820754 
+316915.950243  7381556.005754 
+316916.131660  7381590.119911 
+316912.330148  7381608.786714 
+316909.716093  7381621.384556 
+316905.007495  7381638.941548 
+316902.261500  7381654.848824 
+316902.170792  7381669.696280 
+316904.042686  7381683.563905 
+316905.766148  7381692.442384 
+316917.096469  7381699.901106 
+316931.659312  7381710.159349 
+316937.909955  7381716.218311 
+316949.091844  7381743.613619 
+316952.233658  7381753.511923 
+316953.701487  7381766.819644 
+316958.385346  7381775.518154 
+316965.213225  7381783.906717 
+316973.508933  7381789.995674 
+316985.812309  7381801.003789 
+316995.006856  7381816.401151 
+317001.249253  7381831.108632 
+317002.642866  7381842.196733 
+317004.028232  7381853.624775 
+317010.674694  7381876.640833 
+317012.521850  7381891.838229 
+317016.447056  7381912.484693 
+317018.788985  7381929.241822 
+317023.208965  7381943.139442 
+317024.017096  7381976.113794 
+317012.290956  7382000.049694 
+317004.135433  7382031.734266 
+317002.642866  7382045.121973 
+316999.261911  7382062.239041 
+316999.591760  7382076.316630 
+317001.306976  7382086.194938 
+317005.355876  7382105.181686 
+317009.355297  7382119.859171 
+317013.222780  7382136.296356 
+317022.417327  7382152.033660 
+317029.302929  7382172.280192 
+317049.440225  7382213.373153 
+317050.842084  7382228.260603 
+317046.455089  7382236.289228 
+317028.098980  7382243.707957 
+317016.051237  7382260.945005 
+317009.883056  7382272.273064 
+317007.400941  7382291.179826 
+317007.244262  7382303.697682 
+317013.264011  7382336.122128 
+317019.003387  7382350.259706 
+317030.218261  7382367.016836 
+317038.472738  7382376.415226 
+317051.312119  7382385.663642 
+317060.671591  7382395.641932 
+317084.569167  7382434.705241 
+317097.688920  7382445.943316 
+317106.718543  7382458.131229 
+317112.960939  7382465.190019 
+317114.123658  7382478.167796 
+317113.076387  7382504.623265 
+317113.125864  7382525.009773 
+317110.948859  7382544.136497 
+317109.728417  7382559.523861 
+317107.312271  7382573.451475 
+317105.094035  7382595.567687 
+317105.753734  7382608.425484 
+317106.603095  7382621.843186 
+317115.146190  7382632.251403 
+317121.693698  7382638.870270 
+317128.142250  7382645.479138 
+317136.685345  7382655.447430 
+317143.488485  7382666.615517 
+317144.379078  7382676.703789 
+317142.696847  7382689.081669 
+317139.291154  7382700.119778 
+317138.920073  7382713.297521 
+317144.403817  7382723.445783 
+317146.836455  7382733.004145 
+317143.768857  7382741.822635 
+317138.598470  7382747.071736 
+317136.965717  7382755.140354 
+317138.400561  7382762.689061 
+317142.375244  7382771.267591 
+317150.588490  7382791.314157 
+317157.342153  7382822.408831 
+317168.820906  7382875.049814 
+317187.770744  7382934.439641 
+317220.417571  7383040.301508 
+317246.450921  7383128.566389 
+317248.834082  7383142.004087 
+317253.056152  7383155.341803 
+317252.157313  7383169.739336 
+317249.287624  7383178.997751 
+317242.740117  7383196.534747 
+317233.990867  7383210.822299 
+317227.814440  7383223.370150 
+317222.545098  7383236.487903 
+317217.646837  7383268.992335 
+317214.966812  7383287.669136 
+317211.519888  7383326.282522 
+317201.492472  7383345.099299 
+317187.993392  7383372.184659 
+317188.562382  7383391.901282 
+317190.648678  7383412.087824 
+317221.110254  7383420.606365 
+317238.122228  7383429.594826 
+317262.333161  7383442.092685 
+317280.309944  7383465.178730 
+317294.922265  7383484.015504 
+317304.100319  7383511.180851 
+317309.913912  7383533.716990 
+317316.873731  7383555.513257 
+317326.142494  7383575.049910 
+317336.120433  7383599.165780 
+317349.941116  7383619.912226 
+317366.062497  7383639.918799 
+317388.673661  7383658.105684 
+317412.826871  7383674.042954 
+317440.097155  7383684.681132 
+317463.986485  7383691.839905 
+317489.038534  7383697.498936 
+317511.591975  7383689.800255 
+317546.028234  7383675.022786 
+317598.482507  7383650.576973 
+317655.216574  7383617.812586 
+317678.174080  7383608.974100 
+317699.630772  7383597.066139 
+317713.319515  7383597.626043 
+317780.468571  7383493.423892 
+317803.079736  7383480.766060 
+317830.383006  7383458.659847 
+317874.129259  7383429.914771 
+318064.023459  7383350.338402 
+318091.763778  7383349.308578 
+318114.869717  7383352.717994 
+318153.758940  7383347.518884 
+318181.556984  7383347.128951 
+318220.990459  7383326.282522 
+318242.546106  7383315.654343 
+318266.996180  7383303.666396 
+318315.079951  7383290.988568 
+318344.354069  7383275.421234 
+318351.091240  7383263.373298 
+318359.609596  7383257.084375 
+318372.251068  7383253.944913 
+318427.838908  7383254.834760 
+318451.043801  7383255.764601 
+318474.792946  7383250.185557 
+318490.510261  7383245.586345 
+318504.363929  7383239.417401 
+318527.403897  7383231.178812 
+318560.792885  7383202.573712 
+318611.721606  7383154.102015 
+318638.406408  7383137.614839 
+318631.133233  7383156.891537 
+318619.440078  7383203.153613 
+318645.910478  7383228.929198 
+318660.761939  7383246.046266 
+318688.551737  7383281.010277 
+318683.488551  7383320.183567 
+318672.380878  7383391.631328 
+318734.763613  7383361.396507 
+318776.308123  7383342.899676 
+318883.072071  7383280.820309 
+318902.821794  7383271.801854 
+318961.386524  7383258.654106 
+319005.973893  7383257.764259 
+319035.379951  7383254.244861 
+319056.119221  7383246.706153 
+319065.602387  7383231.288794 
+319096.773139  7383199.964159 
+319115.558052  7383194.285132 
+319137.047729  7383169.989294 
+319161.778175  7383137.004944 
+319171.739621  7383117.008369 
+319182.261812  7383089.413096 
+319252.132124  7383064.687331 
+319310.498944  7383043.151020 
+319350.039620  7383029.563347 
+319418.318410  7383007.857065 
+319466.369196  7382988.360405 
+319527.011976  7382967.633955 
+319590.029671  7382942.368283 
+319632.184402  7382928.940583 
+319663.083028  7382888.377531 
+Region 1
+226
+341952.751668  7394121.943323 
+341895.737229  7394110.985200 
+341883.714225  7394163.186259 
+341872.738492  7394214.627447 
+341855.602824  7394234.823988 
+341841.138936  7394243.202553 
+341823.640435  7394250.061378 
+341807.667486  7394252.350985 
+341789.047497  7394253.490790 
+341765.108689  7394251.201182 
+341752.186846  7394247.391835 
+341741.178128  7394242.822618 
+341736.106696  7394240.962936 
+341678.952072  7394186.422278 
+341629.631366  7394138.400504 
+341577.276048  7394084.289773 
+341527.188443  7394041.217151 
+341458.992115  7394131.151746 
+341405.218445  7394141.509972 
+341415.188138  7394283.505649 
+341418.791741  7394311.310886 
+341426.106147  7394433.319987 
+341402.851777  7394523.584526 
+341386.499502  7394581.344632 
+341370.872895  7394645.573630 
+341342.011087  7394756.914558 
+341324.438370  7394826.842580 
+341313.520360  7394868.255487 
+341284.237995  7394985.305437 
+341268.685604  7395044.875233 
+341254.601042  7395098.546040 
+341225.648527  7395221.704944 
+341192.506926  7395331.356162 
+341158.384023  7395439.277676 
+341127.600844  7395514.954713 
+341116.336493  7395550.278662 
+341101.930328  7395603.099614 
+341093.667605  7395664.189150 
+341068.689773  7395778.099639 
+341029.322267  7395925.344417 
+341003.247686  7396032.006147 
+340966.189126  7396176.621375 
+341041.147362  7396191.898758 
+341243.691279  7396236.431130 
+341302.989924  7396267.655782 
+341311.937084  7396274.514607 
+341400.814958  7396298.330528 
+341472.746828  7396314.617738 
+341519.173107  7396325.405890 
+341612.372005  7396347.742064 
+341643.196415  7396353.031158 
+341780.158060  7396384.215816 
+341854.332905  7396402.922612 
+341881.759868  7396405.132234 
+341899.283108  7396406.841941 
+341980.417772  7396412.301006 
+342000.010816  7396350.091661 
+342015.653915  7396258.917279 
+342048.292496  7396186.579670 
+342073.690886  7396157.934576 
+342102.750603  7396104.963650 
+342191.628477  7396049.993066 
+342234.879957  7396029.906506 
+342314.917872  7395985.324143 
+342384.639752  7395945.910894 
+342423.364051  7395920.065321 
+342544.995953  7395870.413826 
+342584.396443  7395854.086623 
+342647.117273  7395830.040741 
+342723.617555  7395798.906075 
+342827.783940  7395759.482827 
+342882.736821  7395734.797056 
+343006.339573  7395722.839104 
+343090.541834  7395728.968054 
+343259.927657  7395711.531041 
+343297.093419  7395688.724948 
+343318.179031  7395674.867321 
+343350.240375  7395644.822468 
+343405.696277  7395597.970493 
+343445.360646  7395570.445208 
+343492.207482  7395542.170051 
+343552.363735  7395509.005732 
+343636.450549  7395469.902430 
+343738.406944  7395422.220597 
+343807.328940  7395384.187112 
+343846.012008  7395366.440152 
+343874.304826  7395346.583553 
+343898.210648  7395326.357018 
+343918.537607  7395306.080491 
+343936.316480  7395286.113911 
+343964.601051  7395247.540519 
+343997.709667  7395210.626841 
+344050.535021  7395155.316316 
+344090.867335  7395118.082693 
+344168.159255  7395047.824728 
+344203.749986  7395025.048629 
+344250.209250  7394992.104272 
+344282.097423  7394964.748958 
+344301.418342  7394942.802717 
+344319.494079  7394923.616004 
+344341.165174  7394892.611315 
+344358.284348  7394866.545779 
+344373.366704  7394840.910171 
+344384.985643  7394823.093222 
+344404.133391  7394799.657237 
+344422.332822  7394771.961981 
+344451.598694  7394744.276723 
+344520.751585  7394701.714014 
+344622.270930  7394640.994414 
+344735.615370  7394572.756103 
+344775.766267  7394550.809862 
+344813.905084  7394528.313716 
+344885.894678  7394485.601032 
+344961.125040  7394440.808704 
+344974.211808  7394429.100710 
+344990.374420  7394416.422881 
+345002.661304  7394403.925022 
+345015.789303  7394388.557654 
+345035.382347  7394369.720881 
+345088.512811  7394289.214671 
+345149.056636  7394192.841179 
+345116.962307  7394154.687714 
+345079.705837  7394106.685937 
+345076.539284  7394101.146885 
+345052.641708  7394071.002049 
+345039.357030  7394058.424203 
+344991.108335  7394021.250571 
+344940.303308  7393987.516349 
+344905.570184  7393968.749564 
+344885.911170  7393956.171718 
+344810.755024  7393910.289577 
+344767.610745  7393877.295229 
+344762.489836  7393871.536216 
+344722.817220  7393825.514099 
+344739.012817  7393811.626478 
+344767.132464  7393789.920196 
+344787.022372  7393771.853290 
+344757.756500  7393710.943724 
+344742.723621  7393680.099007 
+344714.241141  7393624.718493 
+344688.933459  7393556.690146 
+344666.775837  7393483.302716 
+344654.909511  7393420.023556 
+344634.541321  7393360.423765 
+344629.750261  7393350.075537 
+344616.176966  7393302.153746 
+344585.294832  7393250.942518 
+344548.904216  7393201.890920 
+344507.763771  7393158.378373 
+344457.931800  7393116.255588 
+344402.550115  7393079.071958 
+344347.176676  7393044.467885 
+344293.386513  7393008.863984 
+344268.070585  7392984.938082 
+344226.938387  7392941.625501 
+344190.547771  7392893.173800 
+344174.723254  7392863.108950 
+344159.690376  7392829.884641 
+344147.172598  7392791.691183 
+344131.216141  7392754.737513 
+344117.774785  7392723.292899 
+344098.255957  7392689.438698 
+344081.186260  7392664.362993 
+344054.402503  7392628.809083 
+344025.639650  7392597.804394 
+343967.462493  7392552.642130 
+343920.788828  7392520.207686 
+343840.033491  7392630.668765 
+343705.603439  7392558.971046 
+343746.430527  7392701.876568 
+343628.410474  7392913.500318 
+343616.214299  7392971.110450 
+343632.038815  7393007.504216 
+343632.830454  7393024.111372 
+343713.082770  7393162.907597 
+343724.297644  7393181.744371 
+343728.000201  7393187.533379 
+343730.927613  7393194.822131 
+343731.059553  7393210.439455 
+343726.697297  7393221.797510 
+343753.860381  7393270.919096 
+343658.929774  7393324.719880 
+343562.424136  7393379.300531 
+343464.335223  7393433.881182 
+343365.446425  7393486.092239 
+343302.956489  7393520.106412 
+343294.256716  7393489.251697 
+343295.303987  7393460.636599 
+343295.839992  7393447.718812 
+343232.550172  7393460.776575 
+343172.426904  7393467.895356 
+343160.412146  7393443.479538 
+343144.859755  7393423.672931 
+343123.386570  7393410.945111 
+343094.112452  7393398.287279 
+343074.618362  7393384.029721 
+343065.638217  7393406.985789 
+343047.438786  7393418.063891 
+343026.081049  7393439.420233 
+343005.514950  7393452.078065 
+342979.407383  7393461.566440 
+342946.183320  7393460.776575 
+342912.959257  7393456.827251 
+342876.568641  7393457.617116 
+342843.344578  7393459.986710 
+342774.917356  7393462.576267 
+342786.387863  7393484.512509 
+342783.237802  7393517.736818 
+342783.221310  7393521.686142 
+342743.688880  7393640.745748 
+342730.940208  7393625.968279 
+342511.095699  7393540.672889 
+342496.071066  7393593.673811 
+342495.163981  7393605.641761 
+342479.240510  7393657.312910 
+342447.022486  7393739.228879 
+342418.548252  7393825.454109 
+342354.466794  7393989.206060 
+342317.004168  7394110.825228 
+342254.308076  7394137.810605 
+342172.571438  7394157.647207 
+342159.080605  7394160.026800 
+342117.816467  7394156.067478 
+342085.276840  7394149.718565 
+342018.622558  7394134.641148 
+341952.751668  7394121.943323 
+Region 1
+147
+330573.868707  7401959.580807 
+330672.856459  7402025.149575 
+330738.397500  7402065.942588 
+330778.523659  7402094.027777 
+330810.626235  7402116.773881 
+330885.526748  7402164.925633 
+330924.127353  7402187.021848 
+330962.266170  7402191.131144 
+330997.931118  7402164.765660 
+331025.250880  7402135.560663 
+331089.711665  7402052.364914 
+331113.469055  7402011.481917 
+331165.346092  7401924.006900 
+331193.441000  7401881.944105 
+331192.921488  7401863.527260 
+331218.723943  7401784.370819 
+331227.613380  7401707.873922 
+331234.721631  7401641.165348 
+331239.166349  7401619.029140 
+331257.852308  7401563.778604 
+331279.836759  7401534.623598 
+331311.592993  7401502.479104 
+331338.797308  7401473.794018 
+331377.546345  7401436.040484 
+331390.558897  7401423.512630 
+331419.940217  7401353.414638 
+331445.140698  7401291.545235 
+331461.525958  7401252.471928 
+331482.479630  7401230.405708 
+331499.837946  7401204.040224 
+331509.271634  7401188.382906 
+331585.549267  7401091.649476 
+331665.240840  7400988.817090 
+331689.047708  7400963.191479 
+331709.869441  7400950.923581 
+331654.636188  7400835.513349 
+331703.668275  7400807.538141 
+331750.267724  7400781.452609 
+331800.940812  7400753.797347 
+331844.728297  7400724.142426 
+331865.459320  7400710.894695 
+331887.658173  7400696.707126 
+331932.913487  7400666.042378 
+331996.623865  7400626.879087 
+332030.219009  7400601.613414 
+332051.683947  7400531.615404 
+332094.259236  7400400.557853 
+332099.413130  7400382.880881 
+332109.729165  7400346.787064 
+332122.989103  7400304.054383 
+332147.298991  7400223.768136 
+332182.642336  7400104.008649 
+332204.733988  7400048.868095 
+332227.097765  7399999.996466 
+332230.420996  7399994.147468 
+332242.889297  7399974.100902 
+332268.337165  7399932.238072 
+332290.239153  7399894.174592 
+332323.570418  7399841.403631 
+332437.838436  7399655.405491 
+332408.448870  7399636.028810 
+332393.003680  7399623.540949 
+332375.777304  7399606.983785 
+332356.299707  7399582.028060 
+332344.911663  7399567.770502 
+332322.119081  7399546.374167 
+332286.149023  7399519.348796 
+332261.583502  7399501.241898 
+332237.760142  7399486.194475 
+332216.987887  7399478.235839 
+332203.546531  7399473.656623 
+331999.996573  7399428.104426 
+331940.846361  7399415.636561 
+331868.493933  7399398.089567 
+331653.852796  7399351.307580 
+331630.260330  7399256.933746 
+331561.841354  7399202.673040 
+331571.275042  7399153.131526 
+331658.569640  7399122.466779 
+331490.833062  7399082.843566 
+331595.857056  7398431.905066 
+331543.237858  7398430.295341 
+331451.028507  7398392.191868 
+331325.083826  7398366.016352 
+331190.513588  7398378.574201 
+331166.014037  7398379.634019 
+331157.124600  7398323.783586 
+330389.755115  7398425.616143 
+330238.948049  7398440.953516 
+329851.350470  7398485.715848 
+329395.482347  7398538.076879 
+329435.657983  7399061.717185 
+329451.301082  7399191.105022 
+329458.986569  7399344.238791 
+329465.608293  7399378.612903 
+329488.079271  7399409.027693 
+329515.836083  7399431.503843 
+329573.328804  7399496.512708 
+329601.456696  7399528.847169 
+329633.196438  7399562.451413 
+329650.208412  7399584.597620 
+329805.979709  7399801.140528 
+329890.602528  7399920.420097 
+329905.915778  7399944.905902 
+329935.247620  7399999.116617 
+330000.607245  7400055.746916 
+330049.103327  7400141.592212 
+330098.036460  7400238.035692 
+330129.677247  7400322.161282 
+330108.006152  7400339.758268 
+330060.656296  7400395.078792 
+330016.423515  7400429.032976 
+329971.498050  7400459.587742 
+329922.935998  7400489.322649 
+329889.893352  7400509.579179 
+329860.586248  7400527.626088 
+329851.292746  7400535.624718 
+329847.557204  7400539.644029 
+329842.832114  7400552.141888 
+329841.760104  7400575.737847 
+329843.937108  7400640.916682 
+329818.852075  7400759.126434 
+329773.069002  7400988.187198 
+329755.669456  7401073.362608 
+329824.962532  7401089.719806 
+329875.660358  7401164.427009 
+329910.055386  7401220.687373 
+329936.138213  7401257.821012 
+329915.687561  7401359.213644 
+329975.266578  7401452.597648 
+330017.973806  7401536.203328 
+330012.292153  7401579.055987 
+330010.857309  7401601.132206 
+330001.069033  7401699.865294 
+330020.381706  7401744.507647 
+330091.389998  7401907.479731 
+330094.474088  7401909.779337 
+330193.189715  7401980.037303 
+330210.251166  7402002.603437 
+330245.413094  7402048.075648 
+330311.721034  7402142.179529 
+330356.531052  7402131.481362 
+330393.309240  7402119.443424 
+330422.072093  7402102.726287 
+330476.241582  7402053.904650 
+330495.636716  7402025.819461 
+330573.868707  7401959.580807 
+Region 1
+430
+333690.209977  7381015.128402 
+333674.583370  7380991.662421 
+333665.042481  7380978.374697 
+333653.976039  7380963.737205 
+333644.088809  7380955.318647 
+333637.269176  7380953.468964 
+333631.150473  7380953.398976 
+333597.307942  7380960.327789 
+333575.158567  7380961.177643 
+333553.091653  7380955.388635 
+333542.940544  7380951.059376 
+333537.902097  7380945.690296 
+333534.611851  7380939.231402 
+333535.708599  7380932.152615 
+333538.570041  7380922.774221 
+333542.148905  7380913.395828 
+333543.270393  7380904.437362 
+333541.579915  7380891.679548 
+333535.840539  7380876.442158 
+333527.206735  7380863.384394 
+333516.107309  7380853.176143 
+333495.252592  7380842.647946 
+333474.637015  7380823.851166 
+333465.021910  7380815.932522 
+333425.819330  7380787.127456 
+333413.318044  7380803.004737 
+333392.042769  7380815.182651 
+333371.229283  7380826.010796 
+333355.569691  7380835.229217 
+333342.012888  7380846.577273 
+333321.290110  7380869.283384 
+333305.102759  7380890.079822 
+333289.674062  7380910.906254 
+333279.679630  7380926.713547 
+333271.350937  7380941.700979 
+333265.529098  7380955.848556 
+333260.309234  7380970.146107 
+333231.241271  7380982.164048 
+333214.913735  7380990.692587 
+333193.976555  7381002.760520 
+333153.866889  7381030.965689 
+333139.576171  7381040.254098 
+333139.567925  7381040.284093 
+333042.419082  7381080.557194 
+332999.060401  7381099.593934 
+332950.110776  7381118.580681 
+332921.587064  7381125.249539 
+332898.679036  7381129.918739 
+332870.996439  7381139.787049 
+332832.717437  7381149.775338 
+332789.639128  7381160.703466 
+332779.463279  7381161.903261 
+332739.196935  7381174.591087 
+332656.289332  7381197.897095 
+332645.486770  7381199.696787 
+332635.022303  7381202.096376 
+332627.897560  7381202.046384 
+332620.797555  7381200.476653 
+332613.441917  7381197.117229 
+332603.307300  7381192.468025 
+332555.437931  7381164.662788 
+332533.857545  7381159.933598 
+332521.413983  7381159.333701 
+332514.033607  7381160.553492 
+332503.338246  7381161.753286 
+332499.511995  7381163.253029 
+332486.647875  7381192.158078 
+332464.589208  7381221.922980 
+332434.803823  7381255.517225 
+332347.847321  7381181.229950 
+332297.619530  7381276.573619 
+332239.533081  7381367.488046 
+332210.992877  7381413.840106 
+332206.473943  7381431.357106 
+332140.149509  7381473.629865 
+332120.721390  7381489.017229 
+332099.033803  7381500.305295 
+332058.421118  7381526.740767 
+332038.489978  7381541.858178 
+332009.413769  7381558.655301 
+331999.996573  7381564.084371 
+331991.766835  7381571.353126 
+331957.173898  7381595.908919 
+331918.507322  7381618.155109 
+331901.371655  7381627.243552 
+331885.712063  7381632.502651 
+331871.512054  7381632.912581 
+331860.569306  7381629.973085 
+331845.528181  7381624.044100 
+331832.721785  7381613.245950 
+331825.489840  7381601.627940 
+331758.126382  7381622.614345 
+331726.823691  7381635.412153 
+331617.280763  7381631.142884 
+331599.048347  7381650.869505 
+331588.806528  7381664.197222 
+331578.861574  7381681.084330 
+331566.401520  7381700.031084 
+331553.628108  7381713.888711 
+331520.610201  7381731.535688 
+331414.349273  7381775.648132 
+331355.223799  7381834.088121 
+331320.490676  7381860.553588 
+331271.079262  7381908.605357 
+331210.015924  7381972.024494 
+331194.463533  7381977.583542 
+331085.539072  7382035.363645 
+330891.059968  7382115.399935 
+330875.078773  7382113.470266 
+330857.539041  7382115.339946 
+330840.494082  7382119.499233 
+330792.121693  7382104.821747 
+330792.946316  7382068.737928 
+330792.195909  7382039.752893 
+330789.853980  7382019.146423 
+330786.596719  7381993.210865 
+330756.563947  7381940.919822 
+330660.577822  7382020.486193 
+330644.423456  7382037.883213 
+330621.103116  7382060.789290 
+330547.266367  7382166.091252 
+330456.706262  7382294.869194 
+330428.413444  7382335.022316 
+330418.278827  7382360.337980 
+330410.750018  7382377.814986 
+330403.114009  7382408.749687 
+330394.208080  7382465.849906 
+330393.358718  7382503.463464 
+330389.499482  7382513.221792 
+330385.681477  7382537.697600 
+330378.383563  7382558.983953 
+330365.206086  7382583.509752 
+330350.569027  7382601.166728 
+330320.536255  7382636.980593 
+330291.328106  7382672.564498 
+330255.762113  7382709.548163 
+330228.961864  7382738.563193 
+330193.536057  7382778.896284 
+330169.168445  7382806.631534 
+330154.787019  7382823.518641 
+330126.832297  7382855.033243 
+330115.798840  7382867.131171 
+330076.818908  7382909.213962 
+330067.311004  7382921.581844 
+330039.562438  7382957.155750 
+330029.526775  7382971.303327 
+329970.211638  7383043.950883 
+329878.892880  7383116.548448 
+329863.794032  7383129.626208 
+329853.527475  7383140.214394 
+329834.561144  7383160.370941 
+329817.029658  7383189.176007 
+329800.759845  7383219.020895 
+329788.844042  7383245.586345 
+329755.372591  7383351.518199 
+329738.121477  7383405.748910 
+329696.197640  7383547.194682 
+329674.947104  7383622.991698 
+329621.940333  7383811.589393 
+329616.728715  7383825.766965 
+329609.422555  7383847.563231 
+329600.079576  7383869.589459 
+329588.947164  7383892.355559 
+329479.610392  7384100.059981 
+329437.092827  7384158.389990 
+329418.192466  7384185.275384 
+329389.660508  7384135.743869 
+329337.247466  7384055.727575 
+329282.137907  7383981.070363 
+329208.111494  7383884.246948 
+329177.740627  7383845.093654 
+329148.903558  7383805.420450 
+329073.392824  7383703.307941 
+329064.107569  7383690.260176 
+329014.687908  7383623.311644 
+328969.457333  7383568.301066 
+328926.609919  7383502.902269 
+328885.988987  7383449.441426 
+328863.691179  7383416.697035 
+328844.370261  7383390.861460 
+328772.372421  7383294.108033 
+328723.958801  7383228.089342 
+328699.376787  7383193.295302 
+328691.946933  7383172.638840 
+328689.101984  7383095.602036 
+328691.707793  7383059.538213 
+328692.433461  7383035.912260 
+328704.299787  7382847.684502 
+328707.853912  7382793.563772 
+328716.998982  7382680.053215 
+328718.722444  7382658.206957 
+328721.237545  7382631.551523 
+328726.721288  7382559.933791 
+328728.857062  7382520.550537 
+328732.996669  7382451.392383 
+328737.020830  7382404.470420 
+328741.119207  7382316.055565 
+328751.567181  7382256.175822 
+328781.410290  7382150.953845 
+328820.992197  7382012.417575 
+328829.213689  7381990.991245 
+328883.399670  7381828.159137 
+328991.911819  7381769.789135 
+329049.239615  7381736.944761 
+329083.642889  7381717.128156 
+329222.278519  7381631.292858 
+329230.417548  7381629.313198 
+329239.306985  7381627.353533 
+329247.182135  7381627.153567 
+329261.398637  7381625.233896 
+329308.261966  7381601.697928 
+329325.842929  7381590.649820 
+329344.768029  7381569.973362 
+329352.222621  7381556.555660 
+329356.147827  7381539.818527 
+329357.541440  7381523.071396 
+329359.883369  7381514.702829 
+329366.092781  7381497.975694 
+329391.837513  7381480.388707 
+329408.412437  7381469.850512 
+329438.206068  7381454.573129 
+329513.601355  7381414.489995 
+329530.662806  7381406.751320 
+329542.347715  7381403.531872 
+329550.725885  7381403.341904 
+329568.009985  7381399.402579 
+329687.522606  7381362.958822 
+329744.660738  7381286.411933 
+329767.659475  7381263.465864 
+329802.120473  7381234.770779 
+329837.521541  7381215.983997 
+329902.592547  7381164.902747 
+329874.118313  7381130.918568 
+329824.731637  7381105.662894 
+329775.081083  7381096.814410 
+329726.222166  7381088.115900 
+329693.971158  7381077.947641 
+329670.856973  7381068.289296 
+329655.106673  7381055.841428 
+329646.992382  7381044.913300 
+329642.671357  7381039.574214 
+329601.003154  7380959.008015 
+329600.236254  7380952.649104 
+329602.767847  7380946.040236 
+329607.847525  7380941.221062 
+329614.964022  7380936.901801 
+329620.794107  7380932.072629 
+329650.488784  7380917.065199 
+329687.547344  7380892.679376 
+329710.142016  7380875.142380 
+329732.217176  7380843.877736 
+329697.112972  7380660.899078 
+329686.821676  7380620.795947 
+329679.103204  7380580.032930 
+329662.767421  7380489.858376 
+329661.489255  7380461.653207 
+329664.779501  7380404.852937 
+329658.133040  7380306.869720 
+329659.271019  7380257.218225 
+329676.357209  7380182.341051 
+329683.721093  7380175.482226 
+329696.923308  7380173.192618 
+329754.292335  7380135.069148 
+329758.852501  7380112.962935 
+329761.870621  7380082.318184 
+329760.600702  7380050.693601 
+329753.863531  7380006.511169 
+329737.049467  7379963.918465 
+329718.083136  7379921.505730 
+329713.927036  7379883.322270 
+329718.940744  7379843.019174 
+329737.197899  7379777.150456 
+329744.339135  7379733.497934 
+329742.764105  7379707.312419 
+329733.231462  7379677.157584 
+329696.733645  7379593.821859 
+329694.820520  7379402.474635 
+329742.797090  7379405.704082 
+329779.665987  7379409.203482 
+329733.487095  7379341.785030 
+329721.101257  7379307.260944 
+329738.921361  7379301.042009 
+329760.584209  7379288.894090 
+329789.479001  7379269.077485 
+329849.684731  7379240.982297 
+329900.654683  7379251.880430 
+329911.877803  7379251.900427 
+329934.926017  7379251.840437 
+329950.940197  7379251.910425 
+329976.651944  7379251.110562 
+329998.207591  7379248.481013 
+330018.806676  7379248.610990 
+330051.371040  7379246.551343 
+330065.059783  7379244.611675 
+330077.552823  7379240.322410 
+330090.367465  7379234.823352 
+330109.193610  7379221.315666 
+330122.255639  7379211.607329 
+330136.810236  7379205.688343 
+330158.695732  7379200.959153 
+330179.525711  7379198.539567 
+330205.377644  7379202.398906 
+330223.197748  7379206.138265 
+330240.679757  7379211.547339 
+330264.016590  7379213.267044 
+330284.294071  7379215.156721 
+330301.132874  7379214.536827 
+330318.375742  7379213.896936 
+330336.649390  7379212.447185 
+330367.143951  7379209.247733 
+330388.312025  7379207.957954 
+330409.331667  7379215.736621 
+330475.078863  7379219.156036 
+330524.242891  7379194.360283 
+330587.483233  7379154.867048 
+330609.203805  7379142.299201 
+330688.260418  7379193.260471 
+330768.842584  7379246.821297 
+330874.748924  7379314.849644 
+330907.527691  7379332.186675 
+330931.606685  7379346.214272 
+331073.623269  7379439.518290 
+331105.412488  7379458.115104 
+331155.739234  7379501.247716 
+331424.887956  7379643.283386 
+331459.249999  7379662.190148 
+331466.762315  7379602.090442 
+331489.299263  7379573.545332 
+331523.859216  7379502.927428 
+331607.781105  7379390.656659 
+331647.461967  7379361.291689 
+331670.782307  7379346.354248 
+331743.489323  7379296.212837 
+331779.426396  7379271.817015 
+331783.351602  7379258.149356 
+331797.452656  7379193.040509 
+331803.843485  7379173.823801 
+331814.118288  7379145.428664 
+331841.899839  7379042.256337 
+331882.372339  7379052.574570 
+331938.718833  7379060.513210 
+331962.641149  7379060.843153 
+332011.895884  7379048.615248 
+332081.848659  7379036.437334 
+332108.558200  7379031.718142 
+332168.351618  7379022.489723 
+332172.557196  7378975.767726 
+332179.236643  7378958.000769 
+332195.085898  7378932.625116 
+332213.491485  7378906.509589 
+332251.828211  7378848.689493 
+332271.058421  7378852.268880 
+332304.637072  7378865.676583 
+332327.817227  7378882.843643 
+332360.051742  7378862.427140 
+332382.621675  7378836.631559 
+332396.590790  7378801.167633 
+332419.160723  7378758.184996 
+332439.578390  7378678.668616 
+332498.349276  7378707.203728 
+332529.445812  7378718.301827 
+332559.923881  7378742.567671 
+332591.943994  7378742.567671 
+332645.486770  7378750.066386 
+332771.555144  7378760.504598 
+332844.509546  7378799.247962 
+332946.416465  7378820.684290 
+333003.554597  7378827.413138 
+333055.637790  7378832.452275 
+333156.464452  7378808.926304 
+333201.835213  7378820.684290 
+333263.418063  7378877.494559 
+333277.444902  7378918.147596 
+333275.762671  7378968.568959 
+333270.245942  7379020.010148 
+333247.519331  7379027.388884 
+333228.734417  7379028.828637 
+333157.940527  7379020.820009 
+333147.484307  7379087.818533 
+333226.895508  7379100.466366 
+333242.439652  7379133.440718 
+333278.657098  7379167.924811 
+333310.693704  7379230.904023 
+333329.833205  7379295.802907 
+333350.547736  7379322.318365 
+333372.383755  7379331.816738 
+333372.375509  7379331.856731 
+333390.921282  7379335.446116 
+333429.216777  7379360.271864 
+333444.661967  7379379.158629 
+333454.466735  7379407.683743 
+333462.218192  7379442.797728 
+333464.650830  7379474.352323 
+333461.772895  7379496.208579 
+333457.855936  7379522.894008 
+333464.782769  7379577.604637 
+333505.972692  7379786.038934 
+333490.576979  7379795.387332 
+333441.511907  7379825.452183 
+333503.490576  7379968.087750 
+333528.196283  7380021.878537 
+333554.510005  7380078.288874 
+333593.539415  7380170.653053 
+333625.881131  7380236.751731 
+333523.025896  7380219.514683 
+333580.757757  7380291.902284 
+333630.111448  7380348.182644 
+333717.282352  7380442.436499 
+333750.333244  7380480.320010 
+333791.218056  7380524.112508 
+333824.277194  7380559.696413 
+333859.587554  7380587.091721 
+333871.816714  7380596.920037 
+333907.786772  7380617.256554 
+333936.211529  7380625.595125 
+333985.961039  7380638.162973 
+333928.699213  7380682.275417 
+333882.751216  7380708.410940 
+333844.216580  7380728.747456 
+333830.428883  7380737.555947 
+333817.861627  7380746.574403 
+333800.033276  7380757.952454 
+333789.799704  7380767.550810 
+333775.467755  7380777.529100 
+333756.633364  7380795.016105 
+333747.537772  7380811.773235 
+333733.527426  7380853.126151 
+333719.970623  7380901.627843 
+333707.700232  7380948.349840 
+333690.209977  7381015.128402 
+Region 1
+292
+326888.372597  7378966.659286 
+326899.570979  7379005.862571 
+326911.560998  7379047.825383 
+326936.068795  7379133.590692 
+326955.142327  7379191.620752 
+326990.906229  7379253.620132 
+327010.787891  7379267.137817 
+327047.763990  7379293.593285 
+327118.442432  7379338.095662 
+327157.546058  7379281.435368 
+327203.477563  7379218.856087 
+327252.311741  7379143.678964 
+327404.899993  7378894.401663 
+327454.839165  7378812.035772 
+327465.369602  7378792.669089 
+327530.655010  7378682.148020 
+327583.430886  7378590.603701 
+327727.129701  7378367.911846 
+327782.272246  7378289.275316 
+327831.972278  7378213.318327 
+327931.957824  7378116.364934 
+328011.014438  7378053.305735 
+328064.953032  7378021.691151 
+328171.106759  7377971.119813 
+328426.319352  7377864.928003 
+328532.489571  7377825.134819 
+328734.926287  7377762.125612 
+328936.010622  7377704.465488 
+329087.287723  7377676.120344 
+329205.530424  7377655.693843 
+329290.639771  7377651.264601 
+329315.345478  7377648.785026 
+329328.960005  7377646.825362 
+329364.963048  7377635.747259 
+329448.060314  7377568.498778 
+329523.727726  7377438.361070 
+329625.543936  7377174.836209 
+329651.247437  7377095.949722 
+329682.426435  7377011.584173 
+329721.117749  7376895.304090 
+329833.423164  7376649.296229 
+329930.068988  7376486.844056 
+330072.497883  7376332.340521 
+330184.976469  7376193.664275 
+330462.791980  7375946.156671 
+330220.690894  7375624.781719 
+330030.260690  7375341.120308 
+329979.950437  7375266.433101 
+329918.738667  7375173.019102 
+329881.383242  7375097.821983 
+329829.506205  7374999.848765 
+329784.325107  7374878.929477 
+329749.987803  7374789.584781 
+329642.061136  7374776.137085 
+329554.700569  7374765.808854 
+329498.873587  7374761.389611 
+329409.476201  7374758.570094 
+329299.941519  7374725.825702 
+329205.373746  7374695.030977 
+329118.408997  7374642.170032 
+329049.973529  7374600.607151 
+328977.835504  7374560.873957 
+328901.887719  7374524.760143 
+328857.473521  7374503.853724 
+328808.103338  7374480.017807 
+328785.302510  7374467.889885 
+328733.343011  7374446.903479 
+328698.139853  7374431.646093 
+328674.110336  7374420.288038 
+328616.782541  7374378.845137 
+328582.519453  7374344.770974 
+328545.485631  7374303.468048 
+328500.436473  7374232.820150 
+328476.209047  7374162.982112 
+328466.956776  7374149.564411 
+328455.453285  7374086.315245 
+328428.628296  7374028.825092 
+328381.649520  7373968.065500 
+328369.865657  7373926.812566 
+328369.873903  7373926.812566 
+328341.383176  7373903.246603 
+328306.031585  7373871.811987 
+328236.293213  7373820.740735 
+328205.848129  7373799.134436 
+328131.549591  7373738.874758 
+328094.573493  7373760.781006 
+328041.360566  7373783.177170 
+327990.877142  7373839.217570 
+327966.352852  7373858.204318 
+327960.019747  7373870.072285 
+327948.153421  7373904.876324 
+327914.137720  7374004.559249 
+327889.613430  7374124.598687 
+327888.186832  7374153.543729 
+327885.605762  7374190.457406 
+327886.974636  7374246.407822 
+327893.588113  7374292.899859 
+327899.863495  7374337.832162 
+327917.518675  7374391.852909 
+327935.231578  7374442.034313 
+327950.586059  7374495.325185 
+327960.176426  7374520.060948 
+327965.701400  7374564.233382 
+327947.081411  7374599.537335 
+327914.912866  7374660.676862 
+327893.315988  7374705.899116 
+327890.001003  7374710.238372 
+327830.059152  7374861.742421 
+327826.983308  7374876.919821 
+327802.879576  7374907.264624 
+327705.986366  7374988.900640 
+327649.854274  7375039.961894 
+327636.940677  7375047.500602 
+327574.681635  7375076.065710 
+327572.405676  7374941.458766 
+327562.485460  7374789.494797 
+327544.063381  7374666.105932 
+327497.348484  7374570.662281 
+327473.046843  7374515.401746 
+327372.104733  7374380.064928 
+327282.163096  7374258.605733 
+326939.218856  7373812.612128 
+326840.923786  7373671.666270 
+326746.067395  7373527.950888 
+326700.935775  7373459.772566 
+326575.411652  7373293.091117 
+326532.052971  7373234.011237 
+326437.848032  7373096.694758 
+326338.217074  7372955.578930 
+326299.707176  7372903.227897 
+326286.925519  7372889.080322 
+326165.969808  7372680.406064 
+326077.867080  7372527.082327 
+325983.068412  7372347.063163 
+325896.829332  7372167.483923 
+325821.879342  7371982.275648 
+325770.241445  7371841.869698 
+325606.792908  7371411.253459 
+325562.403448  7371152.427793 
+325552.730619  7370778.031924 
+325574.055372  7370336.627532 
+325529.971023  7370347.375691 
+325513.626994  7370358.253828 
+325504.820019  7370378.640336 
+325502.766708  7370396.777229 
+325501.645221  7370430.881388 
+325495.188422  7370441.659541 
+325484.938357  7370454.717305 
+325472.577258  7370468.045022 
+325449.166209  7370488.291554 
+325436.961787  7370494.230536 
+325421.813462  7370508.118158 
+325415.637035  7370521.005950 
+325405.073614  7370534.943563 
+325389.075926  7370542.832211 
+325350.524798  7370569.837586 
+325338.246160  7370581.875524 
+325313.862056  7370592.103772 
+325297.377841  7370597.772801 
+325242.614624  7370608.630941 
+325218.296489  7370613.100175 
+325198.241656  7370619.169136 
+325153.629549  7370625.927978 
+325096.301753  7370635.996253 
+325062.632393  7370638.245868 
+325054.344932  7370639.515650 
+325004.958256  7370644.524792 
+324981.901795  7370646.024535 
+324897.039836  7370649.983857 
+324853.606939  7370650.673739 
+324806.751856  7370656.092811 
+324748.269589  7370662.021795 
+324720.158188  7370659.912157 
+324703.278154  7370655.942837 
+324664.496132  7370634.656483 
+324644.408314  7370626.547872 
+324622.374385  7370627.827652 
+324606.863226  7370637.945919 
+324592.151950  7370640.315513 
+324574.628710  7370639.325683 
+324545.832873  7370635.096407 
+324509.532965  7370627.017791 
+324482.056525  7370623.138456 
+324462.999486  7370622.908495 
+324434.244879  7370623.558384 
+324410.908047  7370623.158452 
+324368.209064  7370621.648711 
+324332.791504  7370617.119487 
+324312.629470  7370615.329793 
+324284.394376  7370606.341333 
+324264.133387  7370604.101716 
+324241.711886  7370595.193242 
+324215.381672  7370581.135650 
+324182.833800  7370575.426628 
+324161.302891  7370576.606426 
+324149.799400  7370583.775198 
+324115.882653  7370606.401323 
+324098.153257  7370631.437034 
+324095.407262  7370647.464289 
+324093.659061  7370673.809776 
+324105.005875  7370696.205940 
+324113.953035  7370706.614157 
+324124.763843  7370715.162693 
+324148.818098  7370740.488355 
+324165.549700  7370755.865721 
+324181.308247  7370768.243600 
+324186.016845  7370782.921086 
+324191.682005  7370795.398949 
+324203.201989  7370803.837504 
+324218.358561  7370806.577034 
+324234.504681  7370811.646166 
+324251.359976  7370817.165221 
+324258.031177  7370829.873044 
+324263.440704  7370846.110263 
+324262.846975  7370878.224762 
+324257.940468  7370888.243046 
+324249.826177  7370909.849345 
+324237.959851  7370929.865916 
+324194.848558  7370979.627392 
+324167.207192  7371072.891417 
+324161.640987  7371120.113328 
+324188.556684  7371170.284734 
+324217.872034  7371232.884012 
+324234.496435  7371307.851171 
+324233.952183  7371352.593507 
+324228.237545  7371412.333274 
+324210.005129  7371469.373503 
+324164.197318  7371531.072935 
+324072.911545  7371627.096487 
+324012.136825  7371678.637658 
+323971.441677  7371730.428787 
+323955.881040  7371777.640700 
+323974.888601  7371857.507019 
+323997.120439  7371882.702704 
+324011.839961  7371912.787550 
+324033.494562  7371985.265136 
+324022.073533  7372094.666396 
+323985.946797  7372181.401539 
+323940.015292  7372253.059265 
+323922.500298  7372360.170918 
+323933.838865  7372669.108000 
+323911.755459  7372833.209890 
+323880.823848  7372912.476313 
+323798.996502  7373050.932596 
+323746.905063  7373209.685404 
+323699.307819  7373418.219684 
+323823.100234  7373534.359790 
+323906.172761  7373704.610627 
+323913.907726  7373898.987332 
+323887.074491  7374043.092648 
+323820.238792  7374181.728901 
+323766.976388  7374445.023801 
+323784.664553  7374692.451419 
+323801.594064  7374893.696948 
+323830.991877  7375319.813958 
+323848.416162  7375581.529128 
+323918.509122  7375990.759031 
+324051.281682  7376201.592917 
+324248.828383  7376428.054126 
+324408.862982  7376720.733993 
+325318.084126  7376989.218004 
+325444.540073  7377051.717298 
+325444.531827  7377051.727297 
+325491.881684  7377070.224128 
+325496.046030  7377071.953832 
+325580.883251  7377107.177798 
+325636.932881  7377130.673774 
+325778.520661  7377197.552318 
+325903.582995  7377263.111088 
+325958.230765  7377304.893931 
+326007.642179  7377362.494065 
+326243.797733  7377371.212572 
+326251.747099  7377371.212572 
+326390.910487  7377377.701460 
+326430.896460  7377373.062255 
+326464.780222  7377452.288684 
+326514.059696  7377633.527639 
+326554.507457  7377794.999981 
+326564.427673  7377879.465513 
+326614.993559  7378107.236497 
+326618.052911  7378115.675052 
+326659.589174  7378294.304454 
+326664.042139  7378309.671822 
+326693.596629  7378420.962759 
+326703.887925  7378443.088969 
+326782.647674  7378615.319467 
+326802.554075  7378668.590343 
+326823.499501  7378724.120831 
+326830.343872  7378752.036049 
+326843.579073  7378801.657549 
+326873.966432  7378913.928318 
+326888.372597  7378966.659286 
+Region 1
+267
+348002.318410  7391343.469251 
+348043.970121  7391376.063667 
+348068.469672  7391394.030590 
+348086.751566  7391407.228329 
+348103.821263  7391417.796519 
+348127.421975  7391430.094412 
+348152.449285  7391439.292837 
+348196.781021  7391457.089788 
+348210.337824  7391478.036200 
+348222.278366  7391495.993125 
+348235.472335  7391517.339468 
+348246.027511  7391540.275539 
+348257.423801  7391565.481222 
+348263.987801  7391582.058382 
+348270.848665  7391608.923781 
+348271.673288  7391650.796608 
+348285.477478  7391693.839235 
+348295.826497  7391722.884260 
+348313.976451  7391757.798280 
+348345.501791  7391794.252036 
+348361.153137  7391808.279633 
+348393.560823  7391835.564959 
+348425.556198  7391862.090415 
+348442.353770  7391876.098016 
+348456.496055  7391891.315409 
+348470.011627  7391910.752080 
+348479.676210  7391929.138931 
+348481.341948  7391946.995872 
+348482.851008  7391973.241376 
+348486.512335  7392070.054793 
+348491.460073  7392164.818561 
+348496.811877  7392234.846566 
+348510.286218  7392281.578561 
+348521.377398  7392314.862860 
+348558.609129  7392370.333358 
+348657.646360  7392517.698116 
+348741.188922  7392623.859931 
+348786.790578  7392714.184459 
+348878.686572  7392666.642603 
+349016.044036  7392602.833533 
+349051.412119  7392638.127487 
+349103.709714  7392666.642603 
+349165.218348  7392675.981003 
+349303.367450  7392714.184459 
+349382.597234  7392728.442017 
+349407.146263  7392735.580794 
+349441.219688  7392751.418082 
+349461.818772  7392763.306045 
+349477.668027  7392775.983874 
+349498.267112  7392805.298852 
+349518.066311  7392851.250981 
+349521.241110  7392867.098267 
+349535.507089  7392970.090625 
+349548.198038  7393063.314657 
+349545.971556  7393238.614629 
+349545.996295  7393279.367649 
+349547.678526  7393351.705258 
+349548.231023  7393407.275739 
+349547.332184  7393429.751889 
+349544.223355  7393530.244676 
+349543.522425  7393629.737633 
+349640.902163  7393620.389235 
+349676.558864  7393610.480932 
+349712.100119  7393622.288909 
+349788.526184  7393646.024844 
+349904.418710  7393709.853910 
+349930.361351  7393725.271269 
+350035.847134  7393861.008019 
+350092.102919  7393925.996887 
+350129.936625  7393973.598733 
+350144.087157  7393988.036260 
+350252.953894  7393966.969869 
+350323.450920  7393954.512003 
+350362.933872  7393945.803494 
+350369.506118  7394021.390547 
+350379.368610  7394083.839850 
+350392.513102  7394156.137466 
+350405.657593  7394185.712400 
+350454.953560  7394221.866207 
+350491.105035  7394261.309451 
+350530.546756  7394343.465378 
+350530.546756  7394373.050311 
+350523.974511  7394405.914681 
+350563.407986  7394455.206238 
+350599.559461  7394497.928920 
+350606.131707  7394537.372164 
+350619.276198  7394576.805409 
+350639.001182  7394603.100905 
+350658.717919  7394635.965276 
+350685.006903  7394668.829646 
+350681.724903  7394698.404581 
+350664.143939  7394740.557360 
+350571.200674  7395067.051435 
+350538.487877  7395033.177237 
+350503.020839  7395003.812267 
+350459.076675  7394978.806550 
+350434.997682  7394967.208537 
+350413.128678  7394959.079929 
+350086.066678  7394873.004673 
+350034.956541  7394863.116367 
+349986.988217  7394873.104656 
+349957.013169  7394893.091232 
+349929.033708  7394919.076781 
+349909.053091  7394943.062673 
+349897.054826  7394979.026513 
+349181.216036  7394936.783748 
+349134.921697  7394844.179611 
+349102.332593  7394770.442241 
+349036.890507  7394673.808794 
+349082.723057  7394652.302477 
+349075.507605  7394634.605509 
+349056.030008  7394581.804553 
+349021.733935  7394496.059240 
+349013.157855  7394477.192472 
+348996.013942  7394454.896291 
+348966.863516  7394436.039521 
+348934.266167  7394420.602166 
+348908.150354  7394405.054829 
+348885.943255  7394393.146868 
+348860.660312  7394382.698658 
+348851.605951  7394378.309410 
+348828.087701  7394373.620213 
+348802.046104  7394379.539199 
+348775.130408  7394393.146868 
+348751.133876  7394403.435106 
+348733.289033  7394408.244282 
+348711.337567  7394404.124988 
+348682.533484  7394389.037572 
+348653.028470  7394369.830862 
+348629.741115  7394349.954267 
+348615.301965  7394336.216620 
+348596.780931  7394317.009910 
+348575.629349  7394300.402755 
+348564.043395  7394285.045385 
+348539.576829  7394277.136740 
+348520.156956  7394276.726810 
+348498.048812  7394277.016760 
+348471.718597  7394278.736466 
+348456.388854  7394282.605803 
+348428.359916  7394291.924207 
+348391.086954  7394305.601864 
+348368.756161  7394315.800117 
+348324.671812  7394327.808060 
+348284.751810  7394340.295921 
+348223.878135  7394353.103727 
+348101.322655  7394364.211825 
+347921.010576  7394383.298555 
+347829.056858  7394393.236853 
+347815.269160  7394394.876572 
+347780.503052  7394397.376144 
+347752.136018  7394404.394942 
+347713.791046  7394415.393058 
+347685.753862  7394425.081398 
+347661.180094  7394433.319987 
+347626.141860  7394449.337244 
+347609.913278  7394459.275541 
+347548.396398  7394499.508650 
+347318.458502  7394656.561748 
+347294.041414  7394675.868441 
+347218.505941  7394729.509253 
+347186.799184  7394750.175713 
+347176.351210  7394757.204509 
+347140.620292  7394769.772356 
+347066.610372  7394790.678775 
+347018.477124  7394806.536059 
+346962.971745  7394807.515891 
+346860.133003  7394806.746023 
+346822.472468  7394809.665523 
+346782.593696  7394816.694319 
+346686.409662  7394868.085516 
+346617.850500  7394882.603029 
+346565.899247  7394898.500306 
+346430.289984  7394925.275720 
+346387.327123  7394929.964916 
+346341.610020  7394930.954747 
+346285.783039  7394920.986454 
+346235.522263  7394903.979367 
+346174.071352  7394867.085687 
+346126.630787  7394827.792418 
+346115.176773  7394818.963930 
+346097.628794  7394806.816011 
+346083.338076  7394794.798069 
+346058.467445  7394776.921131 
+346033.456627  7394772.161947 
+345972.533475  7394769.042481 
+345899.875937  7394769.042481 
+345838.952785  7394765.913017 
+345779.596417  7394747.176226 
+345755.286529  7394735.108294 
+345743.189308  7394728.849366 
+345734.192671  7394719.580953 
+345694.008789  7394678.358014 
+345604.397000  7394584.384111 
+345585.076082  7394559.308406 
+345568.666083  7394536.652287 
+345543.663511  7394488.240580 
+345517.118895  7394416.352893 
+345500.717142  7394389.017576 
+345475.722817  7394361.672260 
+345423.383991  7394329.647745 
+345376.817527  7394306.041789 
+345355.731915  7394296.593407 
+345311.812491  7394276.566838 
+345249.974007  7394251.931057 
+345175.988826  7394226.315445 
+345149.056636  7394192.841179 
+345185.076172  7394137.180713 
+345208.652145  7394101.936750 
+345212.552612  7394097.157569 
+345236.326495  7394060.013931 
+345279.173910  7394006.163155 
+345355.921578  7393919.937925 
+345398.183510  7393875.395555 
+345566.085013  7393697.206077 
+345617.863095  7393643.945200 
+345679.157327  7393578.416424 
+345741.853419  7393512.777668 
+345769.626724  7393483.962603 
+345795.346717  7393465.515763 
+345873.141657  7393416.724121 
+345923.583850  7393378.540661 
+345984.787374  7393324.199969 
+346022.678804  7393283.376962 
+346063.019364  7393227.996448 
+346100.993256  7393158.388371 
+346228.356288  7392901.292410 
+346263.163628  7392865.698506 
+346376.293666  7392773.934225 
+346403.176378  7392745.449104 
+346422.183940  7392720.143439 
+346442.741793  7392679.790351 
+346455.399757  7392652.105093 
+346463.307892  7392630.748751 
+346476.757494  7392577.747830 
+346480.723931  7392523.957044 
+346479.924047  7392470.166258 
+346477.549132  7392398.968453 
+346486.232413  7392292.756646 
+346516.306416  7392184.595173 
+346565.338504  7392082.332690 
+346624.348530  7391987.368956 
+346684.867617  7391909.972214 
+346704.996666  7391885.286442 
+346889.671001  7391780.154450 
+346952.960821  7391734.272310 
+347015.195124  7391701.957845 
+347066.107352  7391680.481523 
+347096.173109  7391670.193286 
+347142.063383  7391658.325319 
+347192.678746  7391650.416673 
+347247.268793  7391647.257214 
+347272.576475  7391648.047079 
+347341.407762  7391649.626809 
+347405.480974  7391649.626809 
+347508.286732  7391628.270467 
+347541.510795  7391615.612635 
+347574.726612  7391601.375074 
+347628.533267  7391566.571035 
+347672.823772  7391530.177269 
+347707.631112  7391496.952960 
+347719.654116  7391482.305469 
+347750.651697  7391439.652775 
+347799.609568  7391371.704414 
+347814.601216  7391351.257916 
+347907.783622  7391271.701544 
+347914.586762  7391276.450730 
+348002.318410  7391343.469251 
+Region 1
+921
+359001.924239  7391495.483212 
+358973.210864  7391519.799047 
+358956.240121  7391533.146761 
+358936.836740  7391544.584801 
+358920.756590  7391550.853727 
+358896.257039  7391561.131967 
+358881.718935  7391565.751176 
+358869.052724  7391566.850987 
+358853.492087  7391571.910121 
+358834.459787  7391587.007535 
+358824.275692  7391606.064270 
+358816.012969  7391637.768840 
+358808.739793  7391660.954868 
+358802.027362  7391690.119872 
+358796.238508  7391718.854950 
+358793.517252  7391736.441938 
+358789.996111  7391763.207353 
+358789.864171  7391776.825021 
+358791.084614  7391798.101376 
+358799.256628  7391808.479599 
+358813.860703  7391817.588038 
+358830.724244  7391826.166569 
+358864.673976  7391841.004027 
+358893.766678  7391851.582215 
+358916.625229  7391861.990433 
+358939.450795  7391876.937872 
+358961.055920  7391890.875485 
+358978.909009  7391902.233539 
+358994.395430  7391905.482983 
+359017.633308  7391908.592450 
+359046.824965  7391908.982383 
+359074.878641  7391910.912053 
+359100.771806  7391913.821554 
+359134.960678  7391914.371460 
+359159.550938  7391915.161325 
+359184.363846  7391914.741397 
+359205.663859  7391917.600907 
+359225.248657  7391930.298732 
+359252.288047  7391952.154988 
+359266.652981  7391976.110885 
+359284.085513  7391999.306912 
+359293.247075  7392013.014564 
+359312.403069  7392037.790320 
+359326.100058  7392056.967035 
+359342.971846  7392085.252190 
+359357.039915  7392108.198259 
+359361.839222  7392129.174666 
+359369.104151  7392148.741315 
+359371.792422  7392177.336417 
+359369.029935  7392188.164562 
+359357.303795  7392208.651053 
+359334.247334  7392228.027734 
+359307.422346  7392236.736242 
+359278.667739  7392244.434923 
+359247.200123  7392247.564387 
+359227.681295  7392249.484058 
+359204.294985  7392251.253755 
+359183.778363  7392250.943808 
+359161.422832  7392251.393731 
+359137.088205  7392255.583014 
+359122.005849  7392263.191710 
+359100.417218  7392279.258958 
+359084.345314  7392305.134526 
+359074.350883  7392325.411053 
+359066.731365  7392342.498126 
+359054.832055  7392359.665185 
+359041.209282  7392374.702610 
+359023.009851  7392388.590231 
+358994.057335  7392405.807282 
+358966.514924  7392414.735752 
+358941.495861  7392426.783689 
+358910.110707  7392442.321027 
+358889.866210  7392456.408614 
+358870.619508  7392473.055763 
+358854.085816  7392493.492262 
+358839.316817  7392511.509176 
+358830.320179  7392523.167179 
+358825.479642  7392538.844494 
+358822.981034  7392554.211861 
+358821.323541  7392567.259626 
+358819.393923  7392576.877979 
+358812.137240  7392588.326018 
+358806.422603  7392598.344302 
+358799.058719  7392610.682188 
+358803.148849  7392630.878729 
+358695.700464  7392606.132968 
+358683.141454  7392596.164675 
+358672.429601  7392584.316705 
+358662.212521  7392575.358239 
+358650.667798  7392565.389947 
+358637.614015  7392553.751940 
+358620.272192  7392541.733999 
+358609.329444  7392533.655382 
+358600.497731  7392528.476270 
+358588.408757  7392522.817239 
+358571.182381  7392520.327665 
+358560.264372  7392519.337835 
+358547.919764  7392519.217855 
+358532.218941  7392517.408165 
+358514.151450  7392516.678290 
+358505.418691  7392512.049083 
+358490.468275  7392507.029943 
+358479.731683  7392497.741534 
+358458.745026  7392493.662233 
+358434.880435  7392492.102500 
+358412.129084  7392490.772728 
+358391.299106  7392491.452611 
+358379.127669  7392493.552252 
+358336.206039  7392499.231279 
+358317.371648  7392504.030457 
+358294.636790  7392512.339034 
+358279.876037  7392517.948073 
+358258.452330  7392527.486439 
+358247.855923  7392535.914995 
+358231.742789  7392544.943449 
+358221.105151  7392547.393029 
+358203.012921  7392549.872605 
+358192.523716  7392557.521294 
+358181.737646  7392564.950022 
+358160.792220  7392577.587857 
+358146.542734  7392583.656818 
+358130.965604  7392590.255687 
+358131.270715  7392589.875752 
+358098.302284  7392600.683901 
+358070.009467  7392581.587172 
+358060.666488  7392576.618023 
+358046.037675  7392568.839356 
+358008.674004  7392558.951050 
+357988.182120  7392556.651443 
+357968.696277  7392554.911741 
+357956.277454  7392552.132218 
+357926.780687  7392541.104107 
+357909.587296  7392535.395084 
+357890.142684  7392530.006008 
+357867.399580  7392527.896369 
+357849.348581  7392526.176663 
+357827.298160  7392526.066682 
+357801.949247  7392529.256136 
+357785.374324  7392533.855348 
+357774.901611  7392539.514379 
+357765.410199  7392549.942593 
+357756.479532  7392565.799876 
+357749.734115  7392576.807991 
+357740.597291  7392592.775256 
+357729.192754  7392611.052125 
+357723.296700  7392619.080750 
+357708.585424  7392630.778746 
+357699.151736  7392635.457945 
+357687.005038  7392635.227984 
+357678.643361  7392634.368131 
+357668.888070  7392629.618945 
+357661.557171  7392627.779260 
+357646.235674  7392628.629114 
+357632.002680  7392633.468285 
+357621.876309  7392635.807885 
+357605.326124  7392637.087665 
+357594.243190  7392632.658424 
+357577.025060  7392628.839078 
+357552.459539  7392625.719613 
+357550.736077  7392660.253697 
+357480.420468  7392694.647806 
+357302.714198  7392777.373636 
+357234.921936  7392824.855503 
+357159.782282  7392875.006912 
+357071.885710  7392930.567395 
+356986.990765  7392986.037893 
+356949.016873  7393013.473194 
+356898.698374  7393073.692879 
+356860.303924  7393114.835832 
+356756.756005  7393224.587032 
+356710.626591  7393275.248354 
+356673.353629  7393314.431643 
+356626.193436  7393350.595448 
+356562.227424  7393415.704295 
+356220.206762  7393530.774585 
+356153.709158  7393544.252276 
+356091.796459  7393545.162121 
+355994.408475  7393532.714253 
+355972.877566  7393520.766299 
+355945.780452  7393504.769039 
+355918.543153  7393492.761096 
+355895.709340  7393479.253410 
+355885.005733  7393477.153770 
+355872.677618  7393474.704189 
+355861.289573  7393470.494910 
+355852.086780  7393461.986368 
+355844.599202  7393454.827594 
+355836.460173  7393452.198044 
+355822.301395  7393448.958599 
+355807.474672  7393441.169933 
+355792.928321  7393435.930831 
+355785.531452  7393430.431773 
+355784.162578  7393424.222836 
+355782.117513  7393414.344528 
+355776.889403  7393405.985960 
+355768.585448  7393399.477075 
+355751.581721  7393394.547919 
+355738.932003  7393394.207978 
+355719.693547  7393398.997157 
+355702.780528  7393405.476047 
+355691.474946  7393413.004758 
+355670.694444  7393429.961853 
+355657.418013  7393440.360072 
+355647.769923  7393446.019103 
+355635.260391  7393451.318195 
+355627.789306  7393452.907923 
+355621.266538  7393452.178048 
+355611.041212  7393443.999449 
+355603.759790  7393436.500733 
+355596.049565  7393431.441600 
+355590.170002  7393427.732235 
+355581.297058  7393426.532441 
+355570.271848  7393426.652420 
+355558.496230  7393430.081833 
+355546.885537  7393437.820507 
+355533.848247  7393445.779144 
+355520.390398  7393453.837764 
+355497.474123  7393459.046871 
+355478.763426  7393461.736411 
+355458.147849  7393461.316483 
+355448.120433  7393460.056698 
+355435.924258  7393458.656938 
+355419.819369  7393455.947402 
+355408.604496  7393454.177705 
+355395.641421  7393454.717613 
+355382.455698  7393455.797428 
+355368.569046  7393456.547299 
+355360.916544  7393455.807426 
+355352.794007  7393451.408180 
+355345.388892  7393446.579007 
+355337.802359  7393440.080120 
+355330.578661  7393436.900665 
+355323.956938  7393435.620884 
+355316.906411  7393436.550725 
+355309.938346  7393439.580206 
+355295.260055  7393451.808111 
+355287.343674  7393461.046529 
+355278.990242  7393465.445775 
+355265.796273  7393470.724871 
+355253.921701  7393474.234270 
+355256.436802  7393459.456801 
+355250.986043  7393432.611399 
+355249.048179  7393415.574318 
+355247.357702  7393401.996643 
+355240.290682  7393381.950077 
+355228.844914  7393365.882829 
+355213.358493  7393348.995722 
+355199.892398  7393332.648522 
+355184.034896  7393323.340117 
+355165.992144  7393307.942754 
+355141.641025  7393289.935838 
+355124.224986  7393265.450033 
+355109.835313  7393260.710844 
+355103.526947  7393258.091293 
+355091.462711  7393250.602576 
+355083.439129  7393243.933718 
+355077.707999  7393236.524987 
+355072.479888  7393229.636167 
+355067.639351  7393212.649077 
+355065.272683  7393201.001072 
+355064.695447  7393188.113280 
+355063.837839  7393176.735229 
+355063.087432  7393158.288388 
+355063.252356  7393146.670379 
+355061.405201  7393133.512632 
+355056.012166  7393102.367967 
+355047.089744  7393087.600497 
+355034.110177  7393072.773036 
+355016.108656  7393054.086237 
+354999.830596  7393038.968827 
+354988.590984  7393026.440973 
+354977.343125  7393014.922946 
+354967.381679  7393001.905176 
+354963.489458  7392989.977219 
+354955.169011  7392968.400914 
+354950.064594  7392952.413653 
+354943.005821  7392931.607217 
+354929.803606  7392878.386333 
+354928.022420  7392843.002394 
+354925.713475  7392809.378154 
+354921.491405  7392767.135389 
+354910.276531  7392734.660952 
+354901.675713  7392697.407333 
+354889.834126  7392655.824456 
+354878.866639  7392623.849933 
+354864.806816  7392596.134680 
+354848.908083  7392572.178784 
+354831.046747  7392543.643672 
+354812.954517  7392513.598818 
+354785.354383  7392474.065590 
+354762.627772  7392394.719181 
+354781.214776  7392295.576163 
+354843.127475  7392234.066699 
+354857.385208  7392217.039616 
+354876.161875  7392196.853074 
+354899.556432  7392174.716865 
+354936.483052  7392145.951793 
+354968.297010  7392118.366518 
+355011.391812  7392085.682116 
+355034.233871  7392067.855170 
+355052.721920  7392056.187168 
+355068.018677  7392047.368679 
+355087.191164  7392038.480201 
+355107.600585  7392028.941835 
+355126.410237  7392025.912354 
+355148.097823  7392021.473115 
+355163.345104  7392017.083866 
+355193.072765  7391994.347761 
+355206.629568  7391986.179160 
+355223.072552  7391974.271200 
+355240.406129  7391965.912632 
+355261.302078  7391958.703866 
+355283.913242  7391953.384778 
+355303.588748  7391945.826072 
+355323.734290  7391941.596797 
+355337.439525  7391939.297191 
+355363.266720  7391939.107223 
+355353.264042  7391928.599023 
+355347.483434  7391924.559715 
+355339.393882  7391906.762763 
+355347.293771  7391891.885312 
+355349.916072  7391884.936502 
+355355.828620  7391875.688086 
+355364.759287  7391870.688943 
+355379.132467  7391861.860455 
+355394.825044  7391843.833543 
+355405.429697  7391834.875077 
+355413.849098  7391829.975916 
+355419.473028  7391829.036077 
+355430.605439  7391827.926267 
+355438.480589  7391826.346538 
+355445.869212  7391822.317228 
+355462.567829  7391796.131714 
+355469.272015  7391788.662993 
+355474.607326  7391786.173419 
+355485.055300  7391782.064123 
+355491.924410  7391779.584548 
+355496.872149  7391774.655392 
+355502.059028  7391765.846901 
+355506.949042  7391756.808449 
+355511.773087  7391743.790679 
+355515.937434  7391735.192152 
+355521.190283  7391719.854779 
+355524.183664  7391706.597050 
+355529.197373  7391695.019033 
+355535.753126  7391682.011261 
+355543.026301  7391669.233450 
+355551.660105  7391652.936242 
+355556.451165  7391633.269610 
+355556.409934  7391606.464202 
+355555.709004  7391583.978054 
+355550.777758  7391556.692727 
+355549.136758  7391525.778023 
+355545.599125  7391511.900400 
+355542.251156  7391500.242397 
+355534.202835  7391477.346319 
+355530.063227  7391462.688829 
+355528.100624  7391444.951868 
+355528.587152  7391426.565017 
+355530.879604  7391411.417612 
+355533.543136  7391399.599636 
+355539.158819  7391379.503078 
+355550.200522  7391356.577005 
+355557.242803  7391329.411659 
+355581.173364  7391343.589230 
+355603.792775  7391364.085719 
+355644.100350  7390990.169768 
+355650.878752  7390846.134440 
+355633.932748  7390737.683016 
+355635.631472  7390690.231144 
+355622.066422  7390639.399851 
+355606.819142  7390600.426527 
+355584.793460  7390575.010881 
+355559.370331  7390561.453203 
+355527.177046  7390542.806397 
+355493.293284  7390512.311620 
+355471.259356  7390476.727716 
+355456.003829  7390427.586133 
+355449.233674  7390371.665712 
+355439.057825  7390324.213840 
+355400.086139  7390256.435450 
+355366.185885  7390205.594158 
+355337.348817  7390159.572041 
+355358.104579  7390140.385328 
+355372.230372  7390125.457885 
+355381.705291  7390116.919347 
+355392.755240  7390103.741605 
+355408.216923  7390089.054121 
+355420.792425  7390076.326301 
+355427.175007  7390070.307332 
+355450.841689  7390051.380574 
+355458.568407  7390043.701889 
+355466.220909  7390034.143526 
+355471.416035  7390024.675148 
+355482.078411  7390009.047825 
+355492.064596  7390000.399306 
+355509.736268  7389988.951267 
+355517.149630  7389982.272411 
+355522.600388  7389978.003143 
+355527.828498  7389964.985372 
+355530.459046  7389956.926753 
+355532.792729  7389948.648171 
+355534.392498  7389941.019478 
+355541.187392  7389925.252178 
+355544.114804  7389917.643482 
+355548.963588  7389912.704328 
+355557.176833  7389908.025129 
+355562.817255  7389905.305595 
+355578.559309  7389902.476080 
+355584.397641  7389900.206468 
+355596.898926  7389895.347301 
+355602.357931  7389890.088202 
+355613.581051  7389880.119909 
+355620.285236  7389873.211092 
+355629.570492  7389862.672898 
+355635.293376  7389851.654785 
+355636.959115  7389838.717001 
+355638.682577  7389828.988667 
+355638.154818  7389810.481837 
+355633.635884  7389803.133096 
+355628.919040  7389794.774528 
+355623.138432  7389790.845201 
+355604.501951  7389777.037566 
+355599.884062  7389758.280779 
+355598.754328  7389748.632432 
+355596.099042  7389738.754124 
+355595.777439  7389719.587407 
+355613.350156  7389697.061265 
+355621.827282  7389686.293110 
+355636.390125  7389658.747828 
+355643.514868  7389640.101022 
+355651.860054  7389621.474213 
+355656.725330  7389594.278871 
+355659.628003  7389569.053192 
+355664.344847  7389535.328969 
+355672.228243  7389512.372901 
+355678.017097  7389494.815908 
+355698.038945  7389461.241659 
+355710.993773  7389441.874976 
+355726.199823  7389421.208516 
+355740.218415  7389396.542741 
+355747.211218  7389380.995405 
+355761.452459  7389343.821772 
+355763.695434  7389323.355278 
+355770.119247  7389293.630369 
+355775.504036  7389275.073548 
+355788.153754  7389234.560488 
+355809.874325  7389225.692007 
+355817.279440  7389219.783019 
+355819.852264  7389217.483413 
+355825.014405  7389211.994353 
+355829.879681  7389204.515634 
+355838.076434  7389180.559737 
+355852.292936  7389157.333716 
+355851.443574  7389150.244930 
+355860.605136  7389142.026338 
+355865.783769  7389134.437638 
+355873.832090  7389125.439179 
+355880.561014  7389115.980799 
+355894.670315  7389102.493109 
+355905.901681  7389091.534987 
+355914.436530  7389085.086091 
+355932.858609  7389069.868698 
+355945.401126  7389060.250345 
+355956.137718  7389057.810763 
+355961.745155  7389058.860583 
+355963.938652  7389063.759744 
+355963.072798  7389068.728893 
+355962.009034  7389073.478080 
+355961.448291  7389078.567208 
+355965.192079  7389081.376727 
+355971.492200  7389084.536185 
+355980.480591  7389083.626341 
+355986.846681  7389079.926975 
+355997.781183  7389078.047297 
+356013.820102  7389076.647537 
+356020.153207  7389076.047639 
+356032.110241  7389074.617884 
+356051.612577  7389072.818193 
+356058.762059  7389072.218295 
+356070.752078  7389067.799052 
+356080.490876  7389062.909890 
+356085.644770  7389057.650791 
+356086.444655  7389048.792308 
+356087.343494  7389040.723690 
+356087.384725  7389036.734373 
+356088.869047  7389020.797103 
+356093.519921  7389014.758138 
+356098.871724  7389010.048944 
+356105.015166  7389008.339237 
+356116.469181  7389005.459730 
+356123.090904  7389006.519549 
+356127.057341  7389007.889314 
+356134.874767  7389012.288561 
+356138.907174  7389017.307701 
+356148.274892  7389019.287362 
+356153.387555  7389018.337525 
+356165.369328  7389014.138244 
+356176.345061  7389008.929136 
+356183.222418  7389004.229941 
+356199.500477  7388999.630729 
+356211.589451  7388994.771561 
+356229.953807  7388984.873257 
+356247.551263  7388979.844118 
+356263.342795  7388972.135439 
+356274.326774  7388966.256446 
+356286.630150  7388959.847543 
+356296.616335  7388951.089044 
+356298.710878  7388946.119895 
+356303.584400  7388938.311232 
+356309.513440  7388936.591527 
+356315.830053  7388937.651345 
+356320.596374  7388940.800806 
+356326.203811  7388941.850626 
+356331.481399  7388944.230218 
+356337.097082  7388944.510171 
+356343.636342  7388943.910273 
+356347.742965  7388940.630835 
+356348.625312  7388934.541878 
+356348.666543  7388930.002656 
+356348.732513  7388923.693736 
+356350.860041  7388914.855250 
+356355.296513  7388909.916096 
+356364.911618  7388907.466516 
+356373.611391  7388905.106920 
+356386.797114  7388902.917295 
+356398.770641  7388899.597864 
+356409.358801  7388891.399268 
+356421.373559  7388884.210499 
+356428.085991  7388876.191873 
+356449.031416  7388863.324077 
+356458.250702  7388859.104800 
+356472.458958  7388857.025156 
+356487.170233  7388855.175473 
+356505.270709  7388851.586088 
+356521.829141  7388849.316476 
+356546.493616  7388842.027725 
+356565.822781  7388837.238545 
+356575.569826  7388832.009441 
+356590.660428  7388823.410914 
+356601.479482  7388812.892715 
+356619.753129  7388791.476384 
+356626.160451  7388782.897853 
+356642.323063  7388768.990236 
+356672.743408  7388736.735760 
+356684.947829  7388709.610407 
+356695.832853  7388692.113404 
+356698.974667  7388684.274747 
+356703.938898  7388677.795856 
+356711.640878  7388672.886697 
+356715.450636  7388668.827393 
+356723.713359  7388659.159049 
+356716.530892  7388641.812020 
+356711.814048  7388634.013356 
+356708.325893  7388625.784765 
+356709.397903  7388620.265711 
+356715.087802  7388612.237086 
+356736.156921  7388597.599593 
+356750.744503  7388587.441333 
+356761.233709  7388579.462700 
+356772.720708  7388573.043799 
+356785.815722  7388559.326149 
+356792.825018  7388552.637295 
+356805.895294  7388541.469208 
+356815.147565  7388534.700367 
+356825.669755  7388522.512455 
+356833.891247  7388516.723447 
+356845.609141  7388508.534849 
+356851.752582  7388506.155257 
+356863.742602  7388501.176110 
+356873.456662  7388498.836510 
+356883.904636  7388494.947177 
+356893.173399  7388486.408639 
+356900.100233  7388477.170222 
+356907.530087  7388469.381556 
+356925.993397  7388459.263289 
+356934.404552  7388454.584090 
+356947.928371  7388449.734921 
+356958.730933  7388440.756459 
+356967.166827  7388433.527697 
+356973.854520  7388427.618709 
+356984.871484  7388418.090341 
+356993.340363  7388407.652129 
+356997.282061  7388401.043261 
+356999.393096  7388393.754510 
+357000.704247  7388385.465930 
+357000.918649  7388374.057884 
+357000.968126  7388368.858774 
+357001.528870  7388363.219740 
+357009.511221  7388351.001833 
+357022.804145  7388348.142323 
+357040.904621  7388343.773071 
+357049.497193  7388342.093359 
+357057.166188  7388340.173688 
+357065.577343  7388335.714452 
+357073.271076  7388331.805121 
+357086.514523  7388323.846485 
+357098.850884  7388314.668057 
+357109.150426  7388305.239672 
+357115.013496  7388300.210533 
+357125.255314  7388296.541162 
+357138.498761  7388287.922638 
+357144.139183  7388285.763008 
+357152.855448  7388280.973828 
+357161.448021  7388279.394099 
+357167.104935  7388274.364960 
+357172.580432  7388267.326166 
+357181.024572  7388259.877442 
+357183.663366  7388250.818994 
+357188.371964  7388239.240977 
+357190.507737  7388229.402662 
+357194.663838  7388221.693982 
+357197.096476  7388212.635534 
+357201.755596  7388206.366608 
+357204.361405  7388200.637589 
+357215.106243  7388197.418141 
+357226.065484  7388192.988899 
+357236.999986  7388191.429166 
+357247.151096  7388186.440021 
+357254.341809  7388181.530862 
+357261.029502  7388176.051800 
+357272.029974  7388168.303128 
+357280.234973  7388163.393969 
+357289.223365  7388152.635811 
+357313.483775  7388124.190684 
+357330.405040  7388104.644032 
+357342.832110  7388086.377161 
+357350.880431  7388077.158740 
+357356.578576  7388068.350249 
+357364.206340  7388060.671564 
+357376.872550  7388049.173534 
+357394.643177  7388026.867354 
+357400.885574  7388014.079545 
+357409.840980  7388005.860953 
+357418.986050  7387989.113821 
+357426.457135  7387977.005895 
+357429.095929  7387967.957445 
+357431.512074  7387960.448731 
+357436.575260  7387943.771588 
+357440.516958  7387926.424559 
+357443.172244  7387916.156318 
+357448.284907  7387894.280065 
+357454.461334  7387868.094551 
+357462.740550  7387855.546700 
+357474.598629  7387843.258805 
+357479.999911  7387833.790427 
+357486.225815  7387823.222237 
+357486.671111  7387808.604741 
+357485.698056  7387803.495616 
+357483.941609  7387785.318730 
+357482.836614  7387772.910855 
+357479.686554  7387761.472814 
+357476.726157  7387750.584679 
+357471.052750  7387735.917192 
+357462.418947  7387721.659634 
+357456.885726  7387713.301066 
+357450.206279  7387697.063847 
+357441.325089  7387676.927296 
+357435.709406  7387603.789824 
+357462.319992  7387627.305796 
+357482.457287  7387644.662823 
+357504.021180  7387662.149827 
+357528.520732  7387671.808173 
+357545.681138  7387680.606666 
+357566.181267  7387692.214677 
+357582.962346  7387707.991975 
+357602.786285  7387725.688944 
+357614.265038  7387741.526231 
+357622.470037  7387758.543316 
+357633.256107  7387782.349238 
+357638.360524  7387803.105683 
+357643.258785  7387834.830249 
+357646.755187  7387863.325368 
+357646.788172  7387880.492427 
+357646.351121  7387893.880134 
+357647.950890  7387907.847741 
+357653.080046  7387926.064621 
+357662.060191  7387937.002747 
+357670.850673  7387945.951215 
+357683.244757  7387951.390283 
+357692.785646  7387956.799356 
+357704.198429  7387958.009149 
+357712.823987  7387963.408224 
+357717.252212  7387968.997267 
+357718.827243  7387985.734400 
+357703.786118  7388011.280024 
+357682.378903  7388040.085090 
+357664.105256  7388061.501422 
+357649.047639  7388079.038418 
+357639.638690  7388090.496455 
+357617.406852  7388120.291352 
+357604.427285  7388143.857315 
+357594.028788  7388163.693917 
+357586.994753  7388193.968731 
+357576.117975  7388231.402319 
+357572.819483  7388255.848132 
+357571.277438  7388278.314284 
+357566.337945  7388302.960062 
+357566.865704  7388321.896819 
+357565.381383  7388338.383994 
+357563.014714  7388350.651893 
+357554.949901  7388361.210085 
+357535.719691  7388376.637442 
+357518.567531  7388387.545574 
+357498.380759  7388396.863977 
+357472.133007  7388409.461819 
+357453.166676  7388418.240316 
+357425.426356  7388426.498901 
+357397.900438  7388434.537524 
+357379.585560  7388439.556665 
+357358.211330  7388444.665789 
+357338.041050  7388451.004704 
+357318.612931  7388465.322251 
+357300.908273  7388481.539473 
+357295.012218  7388499.976315 
+357293.758791  7388523.662258 
+357295.333821  7388540.069448 
+357302.145208  7388562.945529 
+357302.639982  7388586.091564 
+357297.593289  7388601.218973 
+357291.829173  7388616.336384 
+357281.941943  7388636.392948 
+357269.613828  7388644.571547 
+357260.650175  7388653.240062 
+357245.262709  7388661.388667 
+357233.783956  7388666.817737 
+357220.276630  7388670.007190 
+357206.027144  7388676.846019 
+357199.520868  7388684.864645 
+357194.317496  7388694.892928 
+357191.472546  7388703.941378 
+357192.288923  7388714.809516 
+357203.042008  7388732.076558 
+357220.342600  7388747.193969 
+357256.139487  7388769.910078 
+357288.835792  7388797.035432 
+357326.727222  7388825.530551 
+357352.290537  7388851.586088 
+357385.456876  7388883.030701 
+357417.279080  7388915.785091 
+357447.146928  7388941.520683 
+357449.159008  7388943.230390 
+357486.629880  7388972.945300 
+357523.243144  7389006.739511 
+357576.835397  7389046.802649 
+357616.862601  7389075.987650 
+357648.082830  7389097.883899 
+357680.828612  7389120.240070 
+357707.538153  7389133.237843 
+357729.761744  7389146.625550 
+357764.354682  7389157.373709 
+357802.312082  7389167.931900 
+357831.652170  7389173.310979 
+357853.785053  7389174.300809 
+357879.760680  7389169.131695 
+357896.368588  7389161.213051 
+357920.365120  7389149.145118 
+357936.758626  7389132.477973 
+357949.152711  7389117.430551 
+357959.790348  7389103.682906 
+357973.479091  7389081.666677 
+357983.333337  7389065.379467 
+357993.146351  7389053.071575 
+358004.674582  7389043.323245 
+358021.249505  7389038.504070 
+358041.081690  7389035.484587 
+358057.128855  7389032.875034 
+358075.864291  7389029.015696 
+358085.339210  7389027.945879 
+358094.195662  7389030.575428 
+358106.985565  7389047.422543 
+358124.838655  7389079.926975 
+358143.194764  7389112.781347 
+358162.639376  7389138.216990 
+358182.966335  7389157.683656 
+358204.629182  7389175.830547 
+358229.062764  7389192.797641 
+358255.483687  7389204.455644 
+358285.310303  7389222.022635 
+358322.096738  7389238.659785 
+358359.031605  7389249.427941 
+358397.706427  7389260.985961 
+358415.386345  7389268.354699 
+358441.774283  7389272.933915 
+358466.644915  7389276.273343 
+358487.689296  7389274.043724 
+358509.071772  7389268.934600 
+358527.510343  7389261.575860 
+358539.475624  7389258.486389 
+358556.594799  7389251.337614 
+358583.444526  7389249.937854 
+358603.169510  7389257.656531 
+358622.894493  7389264.825303 
+358643.089512  7389277.093202 
+358659.944808  7389285.451770 
+358680.156319  7389295.500049 
+358703.196287  7389298.269575 
+358718.196181  7389298.529530 
+358738.506647  7389297.949630 
+358752.714902  7389295.869986 
+358764.902831  7389301.638998 
+358781.370554  7389318.966030 
+358796.881714  7389340.152401 
+358815.345024  7389362.258614 
+358834.154676  7389380.155548 
+358851.026464  7389397.822522 
+358865.111026  7389407.810811 
+358877.397910  7389414.799614 
+358887.689206  7389426.527605 
+358895.894205  7389443.544690 
+358901.839737  7389472.179786 
+358900.883175  7389508.043642 
+358898.203150  7389542.347766 
+358897.535205  7389569.143177 
+358894.277944  7389589.489691 
+358879.566668  7389612.825694 
+358863.791629  7389629.502837 
+358842.483369  7389648.229630 
+358826.147586  7389659.147760 
+358807.906924  7389677.354641 
+358793.253372  7389694.051781 
+358780.982981  7389717.627742 
+358772.794474  7389741.023735 
+358770.741163  7389763.709849 
+358772.918167  7389792.074990 
+358784.471137  7389821.200002 
+358797.368241  7389848.905256 
+358825.603335  7389884.839101 
+358839.564204  7389907.785170 
+358855.768047  7389931.191161 
+358878.230779  7389962.305831 
+358892.917316  7389983.932127 
+358910.415817  7390021.755648 
+358916.089224  7390057.469531 
+358919.833013  7390102.911747 
+358919.412455  7390136.016076 
+358918.356937  7390182.188168 
+358920.880284  7390226.950500 
+358925.745560  7390262.094482 
+358933.266122  7390287.200180 
+358946.138488  7390316.895093 
+358958.260447  7390340.711014 
+358967.174623  7390358.507966 
+358983.147572  7390384.463520 
+359000.068837  7390408.109469 
+359018.878489  7390426.116385 
+359031.891041  7390441.863687 
+359046.660040  7390455.731312 
+359062.839145  7390481.356923 
+359072.973762  7390510.581917 
+359078.309073  7390528.018930 
+359087.825223  7390558.013792 
+359095.650896  7390582.559588 
+359103.723956  7390602.346198 
+359118.031166  7390621.202968 
+359135.554406  7390635.770473 
+359150.455345  7390646.098704 
+359172.109947  7390654.397282 
+359186.153278  7390657.036830 
+359202.579769  7390659.896340 
+359230.559230  7390658.166637 
+359254.011510  7390655.387113 
+359271.270870  7390649.038200 
+359284.299915  7390641.629469 
+359299.918276  7390631.041283 
+359317.606440  7390617.373624 
+359323.296340  7390608.785095 
+359328.582173  7390589.898330 
+359333.059877  7390580.639916 
+359341.058720  7390566.542331 
+359358.491252  7390557.963801 
+359372.221226  7390551.784859 
+359390.816476  7390550.075152 
+359409.123108  7390546.155823 
+359424.411620  7390538.107202 
+359442.594558  7390525.659334 
+359457.017216  7390511.401776 
+359481.962063  7390486.286078 
+359505.002032  7390467.129360 
+359491.247319  7390517.930658 
+359482.794933  7390558.273747 
+359479.141853  7390587.698707 
+359479.537672  7390620.813035 
+359478.795511  7390655.907024 
+359480.147893  7390674.633816 
+359479.653119  7390693.790535 
+359477.319436  7390713.917087 
+359461.618612  7390733.703698 
+359442.380156  7390749.351018 
+359419.224741  7390769.287603 
+359382.586738  7390800.712220 
+359350.978936  7390828.757416 
+359325.522822  7390854.542999 
+359297.493884  7390882.398228 
+359269.951473  7390913.142962 
+359250.284213  7390941.748062 
+359233.676305  7390969.823253 
+359222.675833  7390999.508168 
+359214.454341  7391026.333573 
+359213.299869  7391048.449785 
+359219.707190  7391074.665294 
+359231.392099  7391111.878920 
+359232.967129  7391128.396091 
+359238.063300  7391150.922232 
+359230.320089  7391181.087065 
+359217.150859  7391192.145171 
+359192.255488  7391212.051761 
+359170.444208  7391229.898704 
+359145.532345  7391252.244876 
+359127.431869  7391276.550713 
+359114.658458  7391299.346808 
+359104.647534  7391321.403030 
+359099.064836  7391339.729891 
+359093.952173  7391361.386182 
+359091.098977  7391382.062640 
+359085.516279  7391400.389501 
+359076.461918  7391428.544678 
+359061.692918  7391446.561592 
+359045.513814  7391462.688829 
+359027.009272  7391476.576451 
+359001.924239  7391495.483212 
+Region 1
+139
+331270.823628  7395558.717217 
+331370.034029  7395558.257296 
+331500.002871  7395553.918039 
+331590.546483  7395552.708246 
+331713.918340  7395552.948205 
+331806.003997  7395552.498282 
+331841.883347  7395554.207989 
+331836.449081  7395438.667780 
+331825.168237  7395322.887612 
+331823.362313  7395226.394141 
+331821.102846  7395148.427496 
+331827.798785  7395101.795483 
+331833.068126  7395065.111767 
+331835.855352  7395053.303789 
+331841.132940  7395038.176381 
+331842.831663  7394977.996689 
+331833.059880  7394948.131805 
+331819.131997  7394908.448602 
+331882.858867  7394780.830462 
+331947.773195  7394622.227629 
+331988.954871  7394549.330116 
+331968.462987  7394541.271496 
+331937.061341  7394526.514024 
+331922.267603  7394514.856021 
+331908.991172  7394498.378843 
+331900.044012  7394481.391753 
+331892.861545  7394460.065406 
+331885.687324  7394444.848012 
+331838.997166  7394483.041470 
+331682.137367  7394428.010897 
+331567.300359  7394386.358031 
+331478.100882  7394329.657744 
+331400.899671  7394285.885241 
+331372.862486  7394267.158449 
+331244.163565  7394191.021491 
+331112.702156  7394113.314801 
+331065.302822  7394085.219614 
+331030.149141  7394067.272688 
+331017.128343  7394053.065121 
+330989.627163  7394009.142645 
+330931.911795  7393929.406303 
+330870.048573  7393837.811992 
+330806.181516  7393749.777072 
+330699.302121  7393599.372835 
+330672.040082  7393625.528355 
+330568.887983  7393716.152831 
+330482.170622  7393807.187238 
+330396.962321  7393901.111150 
+330311.589095  7394000.004210 
+330299.277472  7393989.116075 
+330242.337250  7393938.754702 
+330202.763589  7393915.788636 
+330174.610957  7393904.330598 
+330108.591635  7393887.363505 
+330047.627252  7393895.972030 
+330016.943027  7393904.840511 
+329987.553461  7393916.498514 
+329950.049604  7393932.015856 
+329891.443643  7393959.711112 
+329852.232816  7393979.317754 
+329809.632789  7394000.004210 
+329804.668558  7394009.682552 
+329669.281943  7394074.731410 
+329569.453075  7394122.433239 
+329429.481556  7394185.712400 
+329165.090909  7394296.363447 
+328967.098911  7394382.238737 
+328981.076272  7394414.463217 
+329003.423557  7394465.914404 
+329014.976526  7394492.299884 
+329034.742741  7394537.362166 
+329045.718474  7394562.377881 
+329093.060084  7394661.820847 
+329146.602860  7394788.429160 
+329185.780702  7394792.408479 
+329213.009755  7394795.148009 
+329243.042527  7394801.426934 
+329267.987375  7394808.995637 
+329290.656263  7394818.094079 
+329314.347684  7394829.722087 
+329339.581150  7394844.399573 
+329362.019143  7394864.156189 
+329383.954117  7394882.143108 
+329428.071451  7394921.916295 
+329462.243831  7394950.541392 
+329500.481602  7394979.156490 
+329550.668162  7395006.991722 
+329557.050744  7395012.560768 
+329583.339728  7395027.828153 
+329593.490837  7395034.067085 
+329637.632910  7395059.422741 
+329652.088552  7395067.971277 
+329683.943741  7395085.938200 
+329700.749560  7395091.737206 
+329710.166755  7395097.306252 
+329735.136341  7395108.684303 
+329764.171319  7395120.302313 
+329812.040688  7395135.949633 
+329859.901811  7395149.047389 
+329873.376152  7395151.307002 
+329891.451889  7395154.056531 
+329904.687090  7395157.585927 
+329912.083959  7395161.125321 
+329919.983847  7395167.724190 
+329928.403249  7395175.062933 
+329953.917087  7395208.067280 
+329956.498157  7395216.895768 
+329962.138579  7395232.643070 
+329972.413382  7395265.377463 
+329980.618381  7395289.233377 
+329995.989355  7395332.865903 
+330012.358123  7395354.942122 
+330024.933625  7395392.745646 
+330087.489531  7395560.216960 
+330108.319509  7395615.587475 
+330124.152272  7395657.660269 
+330144.908035  7395710.191271 
+330155.232315  7395751.824139 
+330163.181682  7395788.127921 
+330167.477968  7395849.317440 
+330173.703872  7395902.888263 
+330182.543831  7395950.830051 
+330190.336519  7395999.991630 
+330213.722829  7396052.872572 
+330285.110448  7395986.443951 
+330362.567293  7395907.877409 
+330423.861525  7395852.816840 
+330470.469221  7395823.501862 
+330517.810831  7395795.986575 
+330600.330861  7395744.005479 
+330654.788968  7395703.852356 
+330729.062767  7395661.199662 
+330781.112975  7395641.623016 
+330853.061338  7395616.997234 
+330952.156291  7395579.213706 
+331010.110800  7395563.586383 
+331082.100394  7395564.196278 
+331134.488697  7395563.576384 
+331270.823628  7395558.717217 
+Region 1
+549
+335159.308951  7382708.718305 
+335206.831979  7382725.045509 
+335219.242556  7382731.934329 
+335235.965911  7382743.132410 
+335248.120855  7382756.100189 
+335290.127154  7382820.169215 
+335346.053091  7382912.973318 
+335370.841260  7382956.435873 
+335435.871035  7383066.267060 
+335439.153035  7383080.244666 
+335438.872663  7383099.031448 
+335435.532939  7383128.746358 
+335427.352678  7383173.178747 
+335408.996569  7383235.878008 
+335373.603747  7383344.789352 
+335360.607688  7383385.402395 
+335357.012331  7383419.176610 
+335356.748452  7383425.265567 
+335357.243226  7383433.404173 
+335361.028245  7383446.871866 
+335366.841838  7383465.418689 
+335390.599228  7383523.108808 
+335409.549067  7383571.910448 
+335423.922247  7383633.139960 
+335444.875919  7383699.718556 
+335461.285918  7383754.099241 
+335459.207867  7383809.319782 
+335458.399737  7383821.907626 
+335449.452577  7383855.151932 
+335442.583466  7383885.426746 
+335427.847452  7383934.318371 
+335421.200990  7383953.625064 
+335417.086121  7383974.511486 
+335417.292277  7383992.788356 
+335418.430257  7384000.007119 
+335424.953025  7384027.982327 
+335433.199256  7384056.767397 
+335441.222838  7384078.123738 
+335454.268375  7384106.728839 
+335472.698701  7384136.953661 
+335481.348997  7384150.691308 
+335495.202664  7384183.705653 
+335509.311965  7384216.729996 
+335521.112321  7384247.474730 
+335536.466802  7384275.149990 
+335542.618490  7384287.587859 
+335545.240792  7384309.204156 
+335546.337540  7384329.260721 
+335552.299565  7384359.035621 
+335551.136847  7384389.060478 
+335545.883998  7384408.157207 
+335409.177986  7384671.312131 
+335416.748026  7384693.818276 
+335473.020304  7384709.575576 
+335616.570687  7384741.780060 
+335624.808671  7384753.278091 
+335633.665123  7384772.534792 
+335636.138992  7384797.820461 
+335637.392419  7384813.227822 
+335642.340158  7384826.905479 
+335650.149338  7384849.471614 
+335657.158634  7384867.748483 
+335658.964559  7384872.607651 
+335665.322402  7384906.241889 
+335667.004634  7384928.738036 
+335668.488955  7384951.464143 
+335672.669794  7384978.309545 
+335674.698367  7384998.046164 
+335680.223341  7385023.581790 
+335685.072125  7385036.599560 
+335687.430547  7385053.796615 
+335691.298029  7385063.694919 
+335691.652617  7385077.982472 
+335692.048436  7385087.620821 
+335695.577823  7385100.838557 
+335700.517315  7385114.966137 
+335715.154374  7385138.392124 
+335726.352755  7385158.778632 
+335730.508856  7385169.906726 
+335736.841961  7385187.473717 
+335742.037086  7385197.052076 
+335746.696207  7385209.289980 
+335757.185412  7385220.268099 
+335761.201326  7385225.847144 
+335766.915964  7385234.775614 
+335777.396923  7385247.073508 
+335783.136300  7385253.232453 
+335792.908083  7385264.410538 
+335802.242816  7385287.226630 
+335809.656177  7385299.714491 
+335814.554438  7385308.852926 
+335837.371759  7385330.429230 
+335850.384311  7385343.916920 
+335864.229732  7385373.421866 
+335877.819520  7385435.491234 
+335882.940429  7385470.095306 
+335883.575389  7385494.801074 
+335884.523706  7385519.846784 
+335884.334042  7385536.233977 
+335884.969002  7385562.049555 
+335882.965168  7385576.647055 
+335875.576545  7385598.043390 
+335864.625551  7385619.079787 
+335865.936702  7385637.856570 
+335866.274797  7385645.125325 
+335860.090124  7385668.531316 
+335849.848306  7385690.347579 
+335839.276638  7385722.412087 
+335834.741211  7385736.359698 
+335824.062342  7385766.224582 
+335820.203106  7385776.512820 
+335812.253740  7385802.668340 
+335795.884972  7385833.823003 
+335786.913073  7385851.559965 
+335781.668471  7385864.127812 
+335777.034089  7385885.784103 
+335776.267190  7385900.001667 
+335776.283682  7385907.260424 
+335768.301331  7385936.735375 
+335762.421768  7385950.962938 
+335755.890754  7385968.829878 
+335747.842433  7385994.985397 
+335739.967282  7386051.495718 
+335730.682027  7386078.631070 
+335725.330223  7386096.388028 
+335723.582022  7386101.697119 
+335721.314309  7386131.022096 
+335720.671103  7386142.650104 
+335720.275284  7386168.885610 
+335713.290726  7386181.883383 
+335705.720686  7386192.651539 
+335699.437059  7386224.586069 
+335696.773526  7386234.634348 
+335685.393728  7386248.461979 
+335667.994181  7386262.329604 
+335659.714966  7386272.867799 
+335655.624835  7386291.764562 
+335658.271875  7386300.873002 
+335667.169558  7386317.360178 
+335666.880940  7386333.867350 
+335657.224604  7386359.882894 
+335609.206803  7386351.254372 
+335604.118879  7386408.534560 
+335575.966247  7386627.277092 
+335555.482610  7386625.667367 
+335545.661350  7386649.693252 
+335586.818287  7386810.195759 
+335612.175446  7386842.040305 
+335658.750157  7386901.710084 
+335706.627772  7386981.436427 
+335725.008620  7387016.980339 
+335743.834764  7387057.723360 
+335771.937919  7387135.460044 
+335775.005516  7387143.828611 
+335785.544199  7387169.384234 
+335819.576393  7387280.885134 
+335852.569562  7387388.436712 
+335905.188760  7387546.629615 
+335980.353152  7387768.871547 
+335990.487769  7387793.347354 
+335946.642561  7387855.336736 
+335928.954396  7387876.073184 
+335912.321749  7387912.326974 
+335908.899563  7387952.930019 
+335910.433362  7387999.682011 
+335908.668669  7388029.606885 
+335909.460307  7388044.114400 
+335906.087599  7388055.782402 
+335897.651705  7388066.900497 
+335892.266916  7388074.989112 
+335882.989907  7388084.797432 
+335789.889963  7388108.613352 
+335744.403754  7388125.840401 
+335647.782670  7388131.539425 
+335630.539802  7388132.189314 
+335610.270567  7388130.019685 
+335570.787614  7388119.851427 
+335549.256706  7388117.671800 
+335537.852169  7388118.111725 
+335522.621381  7388120.801264 
+335506.623694  7388125.770413 
+335489.331348  7388133.029170 
+335473.548063  7388142.827492 
+335440.942467  7388167.263306 
+335414.711207  7388185.630160 
+335385.156716  7388207.276452 
+335375.483888  7388215.085114 
+335365.489456  7388230.522470 
+335363.625808  7388233.891893 
+335356.253678  7388247.229608 
+335348.832070  7388267.336164 
+335344.832648  7388287.552701 
+335334.739262  7388357.100788 
+335328.942162  7388391.364919 
+335318.073630  7388462.682703 
+335314.841108  7388491.107834 
+335307.477224  7388530.951009 
+335296.377797  7388600.239141 
+335295.833546  7388606.838011 
+335276.817738  7388721.038449 
+335254.948734  7388848.176672 
+335241.548610  7388918.724587 
+335235.578339  7388940.790808 
+335227.802143  7388966.386423 
+335210.006777  7389011.748653 
+335208.472978  7389015.048088 
+335186.562744  7389070.288626 
+335151.293615  7389151.614695 
+335139.682922  7389182.779357 
+335124.501612  7389217.233456 
+335117.178959  7389249.697895 
+335117.393361  7389256.816675 
+335119.619843  7389264.445369 
+335123.619265  7389273.123882 
+335140.449822  7389296.099946 
+335152.200700  7389321.835538 
+335157.808137  7389354.389962 
+335156.958776  7389368.107612 
+335155.078635  7389383.854915 
+335150.361791  7389408.210743 
+335144.119394  7389431.786704 
+335133.259109  7389465.001015 
+335120.906255  7389492.356329 
+335109.848060  7389515.402382 
+335102.187312  7389524.750781 
+335092.530976  7389528.500138 
+335081.093454  7389533.509280 
+335054.153018  7389543.737528 
+335045.486230  7389550.286407 
+335038.600627  7389557.095240 
+335032.960205  7389566.473634 
+335030.098763  7389577.881680 
+335022.759618  7389614.665379 
+335012.278659  7389627.303214 
+335007.429875  7389631.592480 
+334998.029172  7389635.091880 
+334988.653208  7389636.041717 
+334978.007324  7389634.441991 
+334957.243316  7389631.262536 
+334929.610197  7389631.832438 
+334912.870348  7389632.992240 
+334892.263018  7389645.050174 
+334861.949874  7389665.936597 
+334832.626278  7389691.402235 
+334773.509050  7389737.764293 
+334746.733540  7389763.489887 
+334738.297646  7389773.338200 
+334730.612159  7389786.245989 
+334725.466511  7389796.124297 
+334722.613315  7389807.792298 
+334722.761747  7389823.289644 
+334723.891481  7389844.126074 
+334729.251531  7389876.430541 
+334733.902405  7389902.376097 
+334733.547817  7389917.113572 
+334731.172902  7389931.581094 
+334724.996476  7389944.998796 
+334712.297280  7389948.478200 
+334703.416090  7389949.178080 
+334665.928725  7389945.118775 
+334640.332426  7389940.829510 
+334627.385843  7389842.956275 
+334623.526607  7389823.189661 
+334619.535432  7389797.564050 
+334610.423347  7389763.679854 
+334594.582338  7389711.338820 
+334586.096967  7389686.103142 
+334582.872690  7389672.885406 
+334578.139354  7389658.437881 
+334572.185575  7389643.190493 
+334562.331330  7389621.594192 
+334519.632348  7389534.169167 
+334476.933365  7389447.074086 
+334459.542065  7389411.040258 
+334434.844604  7389360.768869 
+334398.330295  7389286.481594 
+334355.656051  7389198.566653 
+334336.434088  7389160.143235 
+334321.162068  7389125.239213 
+334306.846612  7389091.514990 
+334241.948777  7388936.761498 
+334209.730754  7388862.374240 
+334183.895313  7388800.274877 
+334172.614469  7388778.218655 
+334140.272753  7388705.641087 
+334131.960552  7388682.285087 
+334124.415251  7388663.598288 
+334120.349860  7388653.030098 
+334115.600031  7388636.822875 
+334112.186091  7388626.134705 
+334106.001418  7388605.018322 
+334100.468198  7388588.451160 
+334095.833816  7388574.553541 
+334089.673882  7388559.426132 
+334082.631601  7388541.519199 
+334075.003837  7388525.261984 
+334066.683391  7388508.434866 
+334060.647150  7388493.507423 
+334042.761075  7388448.475137 
+334019.531444  7388391.394914 
+334013.082891  7388374.927735 
+334006.626093  7388359.460384 
+334003.121445  7388349.782042 
+333988.970913  7388313.158315 
+333985.045707  7388301.070386 
+333982.456391  7388294.831455 
+333974.069974  7388278.574239 
+333947.682036  7388212.255599 
+333936.392946  7388179.841151 
+333934.430343  7388174.342093 
+333925.375982  7388154.085563 
+333919.826269  7388139.728022 
+333915.002224  7388124.170687 
+333909.056692  7388108.263412 
+333904.991300  7388098.255126 
+333900.554828  7388084.027563 
+333896.085371  7388064.590893 
+333891.896286  7388046.823936 
+333888.672010  7388025.297623 
+333887.517537  7388010.000244 
+333886.973286  7387995.712691 
+333888.020557  7387975.346180 
+333889.142045  7387957.189290 
+333892.778632  7387933.313379 
+333899.721959  7387906.148033 
+333907.019873  7387883.741871 
+333913.575626  7387863.995253 
+333919.026385  7387842.458942 
+333925.425460  7387817.833160 
+333929.614545  7387799.386320 
+333936.805258  7387777.540062 
+333956.505503  7387719.919932 
+333973.946281  7387670.868334 
+333981.508074  7387652.231526 
+333987.791702  7387629.045498 
+333995.633867  7387603.549865 
+334000.870224  7387582.683439 
+334003.542003  7387562.996811 
+334008.621681  7387538.241052 
+334011.821218  7387517.014688 
+334011.227489  7387497.408046 
+334010.773947  7387456.974972 
+334011.441891  7387433.948916 
+334011.524354  7387417.781685 
+334001.018656  7387359.001754 
+333997.431546  7387328.796928 
+333995.139093  7387296.872396 
+333987.486591  7387270.316945 
+333982.563592  7387245.001281 
+333974.935828  7387215.896266 
+333967.085417  7387180.522326 
+333961.923276  7387157.716232 
+333958.410382  7387116.813238 
+333953.602830  7387082.089186 
+333949.471468  7387059.113122 
+333944.556715  7387034.247381 
+333941.934413  7387013.071009 
+333939.543006  7386990.554865 
+333938.306072  7386955.650844 
+333937.448464  7386932.164867 
+333935.469369  7386854.838112 
+333934.191203  7386797.008018 
+333935.510600  7386753.055547 
+333932.624419  7386728.549744 
+333931.849273  7386697.745021 
+333930.364952  7386666.830316 
+333926.687133  7386643.394331 
+333919.158324  7386602.571323 
+333905.749953  7386552.249943 
+333879.032166  7386461.355512 
+333864.823911  7386418.552844 
+333856.734358  7386385.448515 
+333847.836675  7386350.684469 
+333844.917510  7386338.856495 
+333839.442013  7386317.810100 
+333837.784520  7386301.612875 
+333831.476154  7386282.946072 
+333844.538183  7386279.336691 
+333833.603681  7386231.474889 
+333813.087059  7386172.664963 
+333784.249991  7386092.808641 
+333748.246948  7385963.870727 
+333751.726857  7385884.884257 
+333752.889576  7385791.950176 
+333734.929285  7385645.395279 
+333734.376788  7385523.246202 
+333744.651591  7385434.501403 
+333741.798396  7385371.712158 
+333734.665406  7385106.297622 
+333730.385612  7385050.647154 
+333763.617922  7385030.410620 
+333826.149089  7385014.233391 
+333980.939084  7384979.709305 
+334051.798944  7384965.491740 
+334042.769322  7384935.816823 
+334037.277332  7384918.939714 
+334032.642950  7384898.003301 
+334029.558860  7384875.067229 
+334021.329122  7384770.225188 
+334018.228539  7384723.923119 
+334018.937715  7384677.451079 
+334020.603454  7384634.298471 
+334022.632026  7384609.702684 
+334023.341202  7384587.856426 
+334024.347242  7384575.688510 
+334026.573725  7384566.590069 
+334052.640060  7384508.979937 
+334080.570043  7384447.590452 
+334087.183520  7384422.334778 
+334089.789329  7384406.637467 
+334091.554022  7384370.853596 
+334094.530911  7384337.379330 
+334096.023479  7384326.741153 
+334100.121856  7384312.613572 
+334119.063448  7384268.301163 
+334156.872415  7384171.047821 
+334159.082405  7384159.969719 
+334162.793209  7384142.732672 
+334163.090073  7384128.245153 
+334166.668937  7384114.607489 
+334174.074052  7384100.549897 
+334187.457685  7384079.243547 
+334207.091960  7384050.698436 
+334229.562938  7384019.943704 
+334271.049725  7383966.832802 
+334311.984014  7383892.985451 
+334346.313072  7383835.115364 
+334444.336016  7383748.180255 
+334289.991316  7383703.437919 
+334164.698088  7383499.832794 
+333835.805425  7383567.701169 
+333720.951924  7383270.122142 
+333543.451810  7383270.122142 
+333538.231946  7383056.078806 
+333359.684560  7383039.821590 
+333376.440901  7382903.784892 
+333406.490165  7382644.369328 
+333415.470310  7382573.531462 
+333417.911194  7382495.554818 
+333450.162202  7382459.840936 
+333442.583917  7382494.724960 
+333505.181053  7382494.724960 
+333536.500237  7382349.849776 
+333567.530803  7382312.716137 
+333642.373593  7382217.122511 
+333673.742254  7382172.180209 
+333670.732380  7382150.333951 
+333699.206614  7382091.204080 
+333727.936482  7382041.472598 
+333657.414717  7381971.174640 
+333718.593503  7381890.078531 
+333679.893942  7381850.975229 
+333504.744003  7381735.794958 
+333306.958161  7381434.986484 
+333365.160057  7381438.185936 
+333397.947070  7381439.945634 
+333429.422932  7381447.294376 
+333458.457911  7381439.355736 
+333489.406014  7381413.370187 
+333496.118446  7381398.412749 
+333502.072224  7381383.185357 
+333522.036349  7381326.845008 
+333546.387468  7381261.136263 
+333611.928509  7381120.920281 
+333627.596347  7381097.624271 
+333641.689155  7381083.216739 
+333663.211817  7381059.210851 
+333674.748294  7381044.793321 
+333682.705907  7381033.385275 
+333693.574439  7381067.169488 
+333709.044367  7381088.055910 
+333722.799080  7381107.372601 
+333742.565295  7381127.099222 
+333767.015369  7381148.085627 
+333790.055337  7381167.062377 
+333823.625742  7381184.279428 
+333866.959684  7381212.914523 
+333894.065044  7381224.292574 
+333910.128702  7381237.660284 
+333923.462857  7381249.438267 
+333935.955896  7381262.985946 
+333951.739182  7381283.322463 
+333956.686920  7381296.560195 
+333961.725367  7381319.766220 
+333964.166251  7381347.371492 
+333969.542794  7381359.279452 
+333975.158477  7381376.286539 
+333986.793908  7381402.452057 
+334000.045601  7381421.208844 
+334015.020756  7381440.875475 
+334034.399398  7381459.592269 
+334052.137040  7381477.959123 
+334067.235888  7381496.066022 
+334082.878988  7381520.171892 
+334094.027891  7381544.107792 
+334098.357162  7381585.250745 
+334104.195494  7381690.202768 
+334110.108041  7381726.596534 
+334112.598403  7381758.191122 
+334114.123955  7381785.896376 
+334110.619307  7381887.528968 
+334110.025579  7381948.098592 
+334112.087137  7382053.780490 
+334116.399915  7382118.779356 
+334118.411995  7382161.512037 
+334118.049161  7382202.155075 
+334125.413045  7382227.710697 
+334133.593306  7382252.726413 
+334137.427803  7382275.472516 
+334137.427803  7382325.453955 
+334263.257037  7382324.084190 
+334388.863622  7382313.336031 
+334444.336016  7382306.207252 
+334490.663339  7382296.438925 
+334572.012405  7382274.772636 
+334575.368620  7382284.990886 
+334582.617057  7382311.326375 
+334588.125539  7382338.191773 
+334599.076534  7382370.656212 
+334609.433799  7382393.482302 
+334620.747628  7382420.847615 
+334641.676561  7382446.453229 
+334660.972741  7382463.620288 
+334680.763694  7382481.007310 
+334706.071376  7382489.715818 
+334729.820521  7382500.284008 
+334773.113231  7382506.202994 
+334798.462144  7382511.032167 
+334842.249629  7382517.731020 
+334873.708999  7382523.400049 
+334902.265696  7382533.578305 
+334941.740402  7382543.226652 
+334970.585717  7382545.436274 
+334994.285384  7382560.323724 
+335008.369946  7382569.342179 
+335016.583191  7382582.389944 
+335026.445683  7382603.436339 
+335031.550100  7382621.433256 
+335039.021185  7382646.219011 
+335047.217938  7382679.203361 
+335056.635134  7382730.254616 
+335061.154068  7382754.560453 
+335071.115515  7382766.638384 
+335084.903212  7382765.248622 
+335094.345146  7382760.369458 
+335114.977215  7382758.049855 
+335123.627511  7382733.454068 
+335133.630189  7382723.705738 
+335159.308951  7382708.718305 
+Region 1
+318
+329451.070188  7403010.790744 
+329454.187263  7402979.256146 
+329445.941033  7402943.452279 
+329421.218833  7402899.869744 
+329376.722172  7402867.175344 
+329335.524004  7402848.498543 
+329299.248836  7402832.931210 
+329264.639406  7402812.694676 
+329230.029975  7402780.000276 
+329223.853549  7402773.411405 
+329206.948776  7402745.756142 
+329192.113807  7402686.606274 
+329180.577330  7402650.802407 
+329160.802869  7402600.990939 
+329083.337779  7402507.586938 
+329084.987025  7402448.437070 
+329086.603286  7402389.157224 
+329078.794105  7402335.956337 
+329044.176429  7402293.933535 
+328991.441784  7402247.231535 
+328876.068771  7402181.852734 
+328774.293793  7402116.863866 
+328710.319535  7402074.781074 
+328675.413241  7402053.494720 
+328629.440505  7402030.508657 
+328577.513991  7401998.164198 
+328548.107932  7401973.788373 
+328521.513838  7401947.792826 
+328474.328907  7401889.732771 
+328413.249076  7401818.374994 
+328373.823847  7401768.183591 
+328263.901593  7401657.802499 
+328195.499110  7401557.499680 
+328172.393171  7401536.823221 
+328116.838316  7401463.745739 
+328065.893103  7401410.154918 
+328018.642201  7401351.424978 
+327958.708597  7401268.679152 
+327942.290351  7401226.466383 
+327926.449342  7401186.993144 
+327917.518675  7401143.050671 
+327913.073956  7401127.793284 
+327904.201012  7401085.320560 
+327901.116922  7401059.754939 
+327898.107048  7401043.577710 
+327901.042706  7401007.563879 
+327904.407168  7400986.917415 
+327908.101479  7400963.101495 
+327916.289986  7400940.275405 
+327931.529020  7400859.829184 
+327956.251220  7400744.768893 
+327975.201058  7400663.912743 
+327983.892585  7400597.324149 
+327993.862278  7400518.667622 
+327992.633590  7400467.596370 
+327988.617675  7400446.999898 
+327983.678183  7400425.183635 
+327974.228003  7400391.519401 
+327951.526130  7400352.696052 
+327918.706132  7400303.074551 
+327857.337683  7400201.801898 
+327828.179012  7400148.161087 
+327801.354023  7400085.171876 
+327774.529035  7400016.363662 
+327739.078490  7399947.095527 
+327707.833522  7399873.848074 
+327705.541070  7399867.899093 
+327677.677056  7399805.989697 
+327630.285969  7399704.737041 
+327582.886635  7399576.558997 
+327557.026456  7399446.221322 
+327535.421331  7399299.876390 
+327502.287977  7399141.383538 
+327116.537553  7399213.321216 
+326901.277948  7399224.829245 
+326675.413691  7399212.761312 
+326431.391234  7399199.933509 
+325865.040113  7399134.584703 
+325848.283772  7399287.228557 
+325848.663099  7399360.046084 
+325841.117798  7399467.767632 
+325818.366447  7399623.241001 
+325807.506162  7399784.473383 
+325796.983971  7399896.474198 
+325791.747615  7399940.596640 
+325777.316711  7400062.595743 
+325753.847939  7400268.760429 
+325734.518774  7400359.634863 
+325730.222488  7400377.501803 
+325722.710172  7400408.436504 
+325712.410630  7400435.801816 
+325700.008299  7400460.837528 
+325687.292611  7400489.502618 
+325672.210255  7400513.638484 
+325653.746945  7400559.130691 
+325600.402079  7400624.149554 
+325531.298666  7400737.030219 
+325504.382969  7400777.403303 
+325490.001543  7400798.359713 
+325469.559137  7400839.192719 
+325459.812093  7400866.548033 
+325452.266792  7400885.674757 
+325445.513129  7400911.960255 
+325440.260280  7400930.137141 
+325437.101973  7400963.271466 
+325429.960738  7401012.543026 
+325404.686041  7401165.676795 
+325396.901599  7401218.937672 
+325378.025977  7401290.855353 
+325334.692035  7401351.804913 
+325319.939528  7401454.757278 
+325295.332776  7401559.709301 
+325317.770770  7401615.439755 
+325334.428156  7401639.375655 
+325358.853491  7401669.910425 
+325400.628895  7401715.752572 
+325422.060849  7401743.917748 
+325461.618017  7401805.247243 
+325492.153809  7401853.069051 
+325522.755571  7401904.430254 
+325547.931313  7401941.353929 
+325562.485910  7401978.527561 
+325571.276392  7402011.051990 
+325574.797533  7402035.667774 
+325572.166985  7402067.322352 
+325568.654091  7402092.817984 
+325559.863609  7402146.438800 
+325576.562226  7402223.805547 
+325615.253540  7402327.537779 
+325643.373187  7402360.072206 
+325670.626979  7402426.880763 
+325689.222229  7402507.526949 
+325661.531387  7402516.755368 
+325607.172234  7402544.450624 
+325584.602301  7402560.857813 
+325568.192302  7402578.294827 
+325554.858147  7402587.533244 
+325532.469631  7402616.238327 
+325498.981688  7402642.113895 
+325476.518956  7402659.600900 
+325452.918244  7402678.627641 
+325435.419742  7402683.926733 
+325340.621075  7402744.286394 
+325327.690985  7402759.463794 
+325303.496544  7402856.757129 
+325308.213388  7402891.541170 
+325303.240911  7402919.366404 
+325303.983072  7402945.681897 
+325312.328257  7402968.198040 
+325322.586568  7402987.674704 
+325332.836633  7403010.960715 
+325343.103190  7403031.187250 
+325327.872402  7403108.054084 
+325278.329048  7403244.890645 
+325279.079455  7403282.244247 
+325281.487355  7403335.245168 
+325292.413610  7403389.865812 
+325309.005026  7403476.091042 
+325292.487827  7403542.149727 
+325216.993585  7403598.770029 
+325016.461748  7403899.578503 
+324981.077172  7403970.356379 
+324973.696796  7404063.260465 
+324986.239313  7404087.686282 
+324952.124657  7404184.599681 
+324934.766341  7404234.041212 
+324930.197929  7404250.428405 
+324926.759251  7404265.295859 
+324922.949493  7404278.263637 
+324965.161947  7404294.360880 
+324996.951166  7404312.427785 
+325036.656767  7404316.237133 
+325061.378966  7404327.725165 
+325099.088979  7404353.840692 
+325135.916645  7404382.235828 
+325160.333734  7404397.323244 
+325197.598450  7404415.070204 
+325223.367921  7404405.861781 
+325248.403477  7404390.224460 
+325269.703491  7404354.720541 
+325290.112912  7404344.962213 
+325317.177041  7404353.840692 
+325351.786471  7404357.830008 
+325371.082651  7404360.049628 
+325391.063268  7404354.720541 
+325497.678784  7404348.431618 
+325543.692751  7404341.852745 
+325568.538644  7404344.962213 
+325614.799998  7404361.549371 
+325643.076322  7404363.599020 
+325777.217756  7404381.405970 
+325882.621077  7404389.244627 
+325923.060592  7404374.857092 
+325962.947609  7404341.522802 
+325983.794080  7404366.528518 
+325993.903959  7404364.148926 
+326013.546481  7404352.830865 
+326056.410387  7404326.045453 
+326108.262686  7404297.770296 
+326158.119396  7404269.645114 
+326202.640795  7404244.569409 
+326249.446401  7404221.783312 
+326259.778928  7404141.317095 
+326495.480938  7403846.597578 
+326524.153082  7403809.313964 
+326560.032432  7403765.221517 
+326608.223404  7403691.404161 
+326633.860935  7403661.669254 
+326663.596842  7403623.725754 
+326655.070240  7403576.513841 
+326626.678468  7403523.252964 
+326660.496260  7403486.349285 
+326717.189095  7403430.558842 
+326736.369828  7403293.582304 
+326732.271451  7403262.817574 
+326743.593526  7403111.643469 
+326763.920484  7402997.782972 
+326765.083203  7402981.755717 
+326762.419670  7402968.408004 
+326819.821682  7402834.111008 
+326927.063912  7402571.326020 
+326978.792516  7402586.603403 
+327006.549329  7402593.992138 
+327032.797081  7402587.183304 
+327051.746919  7402583.373957 
+327064.058541  7402573.695614 
+327064.932642  7402554.358927 
+327196.806362  7402561.387723 
+327325.158942  7402571.935916 
+327323.039661  7402595.761835 
+327378.198698  7402591.292600 
+327582.127982  7402568.406520 
+327570.129716  7402507.167010 
+327650.258339  7402500.298187 
+327739.639233  7402491.329723 
+327748.380238  7402488.600191 
+327763.949121  7402483.900995 
+327773.778628  7402476.202314 
+327788.456919  7402462.054738 
+327764.716021  7402423.371364 
+327821.862399  7402406.664225 
+327851.746739  7402411.943321 
+327833.291675  7402383.808140 
+327787.582818  7402253.700427 
+327870.218296  7402230.844342 
+327923.843533  7402213.257354 
+327942.306844  7402219.416299 
+327958.090129  7402207.998255 
+327984.552283  7402199.229757 
+328007.353111  7402197.390072 
+328032.652547  7402200.789490 
+328094.812633  7402214.357166 
+328163.784107  7402243.342201 
+328182.296894  7402228.564732 
+328183.377151  7402216.366822 
+328181.653688  7402197.370076 
+328201.007592  7402206.728473 
+328213.343953  7402224.055505 
+328223.808419  7402237.933128 
+328232.293791  7402257.869713 
+328238.057906  7402282.325524 
+328236.029333  7402320.778937 
+328228.401570  7402351.143736 
+328210.152662  7402387.717471 
+328210.762883  7402396.156025 
+328199.919089  7402417.172425 
+328192.052185  7402434.799406 
+328185.760311  7402448.567048 
+328181.332085  7402460.035083 
+328178.000608  7402474.172662 
+328175.493754  7402487.880314 
+328174.809317  7402502.707774 
+328183.088533  7402528.173412 
+328193.503522  7402542.600941 
+328210.787621  7402556.938485 
+328301.496158  7402640.044250 
+328319.522419  7402651.332316 
+328333.672950  7402656.931357 
+328348.598628  7402664.820006 
+328354.882256  7402667.359571 
+328361.982260  7402669.659177 
+328382.193772  7402671.788812 
+328409.736182  7402675.238221 
+328485.552026  7402682.776930 
+328513.737643  7402683.316837 
+328552.330002  7402676.837947 
+328613.376848  7402664.620040 
+328660.883382  7402651.672258 
+328689.778175  7402646.493145 
+328700.828124  7402646.403160 
+328723.431042  7402648.982718 
+328748.631523  7402648.982718 
+328811.805896  7402658.481091 
+328841.640758  7402670.049110 
+328854.727526  7402672.848630 
+328892.190152  7402697.084479 
+328910.620478  7402711.801958 
+328929.001326  7402719.270679 
+328951.546520  7402745.796135 
+328968.789389  7402756.414316 
+328999.457120  7402798.337135 
+329033.777932  7402837.310460 
+329065.608383  7402877.103643 
+329106.724089  7402922.195920 
+329134.678811  7402953.100626 
+329153.488463  7402968.188041 
+329160.423543  7402975.756745 
+329184.947833  7402990.424233 
+329194.150626  7402996.063267 
+329200.261083  7402997.922948 
+329218.188388  7403000.442517 
+329231.390604  7403008.411152 
+329258.916521  7402986.344931 
+329295.702956  7402978.486277 
+329312.640714  7402975.006873 
+329374.627630  7402976.576605 
+329426.356235  7402999.122743 
+329451.070188  7403010.790744 
+Region 1
+526
+354751.882933  7396032.606044 
+354559.861206  7395710.631195 
+354581.408607  7395691.084543 
+354551.953071  7395633.974326 
+354544.490232  7395619.976724 
+354526.529942  7395587.632264 
+354522.563505  7395555.887701 
+354523.363389  7395517.804225 
+354532.970248  7395469.552490 
+354513.838993  7395420.990808 
+354488.712728  7395367.290007 
+354466.373689  7395330.736268 
+354453.451846  7395304.170818 
+354442.418389  7395257.528808 
+354434.493762  7395215.226054 
+354430.510832  7395194.039683 
+354431.516873  7395169.923814 
+354430.510832  7395158.335798 
+354437.017108  7395132.460231 
+354442.352420  7395084.338474 
+354442.418389  7395072.630479 
+354458.275891  7395015.500265 
+354465.433619  7394985.345430 
+354474.158131  7394967.888420 
+354494.699492  7394904.699244 
+354509.856064  7394841.720032 
+354536.318218  7394744.396702 
+354581.276667  7394600.481354 
+354616.207700  7394514.786033 
+354636.147086  7394477.262460 
+354629.921182  7394474.212983 
+354623.753001  7394471.743406 
+354619.563916  7394470.013702 
+354611.177500  7394466.074377 
+354602.799329  7394462.375010 
+354595.155074  7394461.145221 
+354587.510818  7394460.405348 
+354581.095250  7394458.925601 
+354562.112427  7394426.001241 
+354549.429725  7394408.144299 
+354543.245052  7394396.946218 
+354534.842143  7394381.178918 
+354526.150615  7394367.921189 
+354511.546541  7394360.402477 
+354499.144210  7394358.212852 
+354488.077769  7394351.494003 
+354486.948035  7394341.885649 
+354487.582995  7394332.547249 
+354492.011221  7394324.778579 
+354499.770924  7394314.270379 
+354510.837365  7394302.802344 
+354521.169892  7394289.804570 
+354527.247364  7394272.467540 
+354530.809736  7394254.070691 
+354529.886158  7394247.751773 
+354526.356771  7394227.995157 
+354521.532726  7394210.758110 
+354516.700435  7394193.521062 
+354515.917043  7394177.343834 
+354519.429937  7394161.976466 
+354524.847711  7394155.487577 
+354529.787203  7394146.969036 
+354528.921349  7394136.350855 
+354526.587666  7394122.423241 
+354518.918671  7394108.675596 
+354513.467913  7394099.007252 
+354504.149672  7394076.401124 
+354493.619236  7394049.735692 
+354485.983226  7394033.718435 
+354478.652327  7394014.171783 
+354479.815045  7394003.333640 
+354481.794141  7393988.956103 
+354477.901920  7393977.288101 
+354474.248840  7393966.879884 
+354469.078453  7393955.701799 
+354459.331409  7393945.213595 
+354454.466132  7393930.746073 
+354449.073098  7393917.538336 
+354444.479947  7393901.061158 
+354442.476113  7393881.584494 
+354437.602591  7393867.626885 
+354432.151832  7393858.208499 
+354418.652753  7393844.390865 
+354404.576437  7393834.852499 
+354399.117432  7393826.443939 
+354389.609528  7393816.715606 
+354384.752499  7393801.748170 
+354381.668408  7393786.800730 
+354384.265971  7393764.614530 
+354385.898725  7393738.618983 
+354387.399539  7393722.471749 
+354391.390714  7393709.393989 
+354391.885488  7393691.966974 
+354389.815684  7393676.789574 
+354529.811942  7393517.606840 
+354668.934099  7393361.813526 
+354818.058934  7393317.371139 
+354851.695309  7393306.463008 
+354866.489047  7393300.853968 
+354888.572452  7393299.884134 
+354902.294180  7393298.304405 
+354929.457264  7393297.154602 
+354949.264710  7393295.914814 
+354976.254623  7393288.696051 
+355001.182978  7393283.736900 
+355022.268590  7393281.747241 
+355053.744452  7393280.407471 
+355090.522641  7393280.907385 
+355112.045303  7393283.976859 
+355141.641025  7393289.935838 
+355165.992144  7393307.942754 
+355184.034896  7393323.340117 
+355199.892398  7393332.648522 
+355213.358493  7393348.995722 
+355228.844914  7393365.882829 
+355240.290682  7393381.950077 
+355247.357702  7393401.996643 
+355249.048179  7393415.574318 
+355250.986043  7393432.611399 
+355256.436802  7393459.456801 
+355253.921701  7393474.234270 
+355265.796273  7393470.724871 
+355278.990242  7393465.445775 
+355287.343674  7393461.046529 
+355295.260055  7393451.808111 
+355309.938346  7393439.580206 
+355316.906411  7393436.550725 
+355323.956938  7393435.620884 
+355330.578661  7393436.900665 
+355337.802359  7393440.080120 
+355345.388892  7393446.579007 
+355352.794007  7393451.408180 
+355360.916544  7393455.807426 
+355368.569046  7393456.547299 
+355382.455698  7393455.797428 
+355395.641421  7393454.717613 
+355408.604496  7393454.177705 
+355419.819369  7393455.947402 
+355435.924258  7393458.656938 
+355448.120433  7393460.056698 
+355458.147849  7393461.316483 
+355478.763426  7393461.736411 
+355497.474123  7393459.046871 
+355520.390398  7393453.837764 
+355533.848247  7393445.779144 
+355546.885537  7393437.820507 
+355558.496230  7393430.081833 
+355570.271848  7393426.652420 
+355581.297058  7393426.532441 
+355590.170002  7393427.732235 
+355596.049565  7393431.441600 
+355603.759790  7393436.500733 
+355611.041212  7393443.999449 
+355621.266538  7393452.178048 
+355627.789306  7393452.907923 
+355635.260391  7393451.318195 
+355647.769923  7393446.019103 
+355657.418013  7393440.360072 
+355670.694444  7393429.961853 
+355691.474946  7393413.004758 
+355702.780528  7393405.476047 
+355719.693547  7393398.997157 
+355738.932003  7393394.207978 
+355751.581721  7393394.547919 
+355768.585448  7393399.477075 
+355776.889403  7393405.985960 
+355782.117513  7393414.344528 
+355784.162578  7393424.222836 
+355785.531452  7393430.431773 
+355792.928321  7393435.930831 
+355807.474672  7393441.169933 
+355822.301395  7393448.958599 
+355836.460173  7393452.198044 
+355844.599202  7393454.827594 
+355852.086780  7393461.986368 
+355861.289573  7393470.494910 
+355872.677618  7393474.704189 
+355885.005733  7393477.153770 
+355895.709340  7393479.253410 
+355918.543153  7393492.761096 
+355945.780452  7393504.769039 
+355972.877566  7393520.766299 
+355994.408475  7393532.714253 
+356091.796459  7393545.162121 
+356153.709158  7393544.252276 
+356220.206762  7393530.774585 
+356562.227424  7393415.704295 
+356626.193436  7393350.595448 
+356673.353629  7393314.431643 
+356710.626591  7393275.248354 
+356756.756005  7393224.587032 
+356860.303924  7393114.835832 
+356898.698374  7393073.692879 
+356949.016873  7393013.473194 
+356986.990765  7392986.037893 
+357071.885710  7392930.567395 
+357159.782282  7392875.006912 
+357234.921936  7392824.855503 
+357302.705952  7392777.373636 
+357480.420468  7392694.647806 
+357550.736077  7392660.253697 
+357552.459539  7392625.719613 
+357577.025060  7392628.839078 
+357594.243190  7392632.658424 
+357605.326124  7392637.087665 
+357621.876309  7392635.807885 
+357632.002680  7392633.468285 
+357646.235674  7392628.629114 
+357661.557171  7392627.779260 
+357668.888070  7392629.618945 
+357678.643361  7392634.368131 
+357687.005038  7392635.227984 
+357699.151736  7392635.457945 
+357708.585424  7392630.778746 
+357723.296700  7392619.080750 
+357729.192754  7392611.052125 
+357740.597291  7392592.775256 
+357749.734115  7392576.807991 
+357756.479532  7392565.799876 
+357765.410199  7392549.942593 
+357774.901611  7392539.514379 
+357785.374324  7392533.855348 
+357801.949247  7392529.256136 
+357827.298160  7392526.066682 
+357849.348581  7392526.176663 
+357867.399580  7392527.896369 
+357890.142684  7392530.006008 
+357909.587296  7392535.395084 
+357926.780687  7392541.104107 
+357956.277454  7392552.132218 
+357968.696277  7392554.911741 
+357988.182120  7392556.651443 
+358008.674004  7392558.951050 
+358046.037675  7392568.839356 
+358060.666488  7392576.618023 
+358070.009467  7392581.587172 
+358098.302284  7392600.683901 
+358131.270715  7392589.875752 
+358146.542734  7392583.656818 
+358160.792220  7392577.587857 
+358181.737646  7392564.950022 
+358192.523716  7392557.521294 
+358203.012921  7392549.872605 
+358221.105151  7392547.393029 
+358231.742789  7392544.943449 
+358247.855923  7392535.914995 
+358258.452330  7392527.486439 
+358279.876037  7392517.948073 
+358294.636790  7392512.339034 
+358317.371648  7392504.030457 
+358336.206039  7392499.231279 
+358379.127669  7392493.552252 
+358391.299106  7392491.452611 
+358412.129084  7392490.772728 
+358434.880435  7392492.102500 
+358458.745026  7392493.662233 
+358479.731683  7392497.741534 
+358490.468275  7392507.029943 
+358505.418691  7392512.049083 
+358514.151450  7392516.678290 
+358532.218941  7392517.408165 
+358547.919764  7392519.217855 
+358560.264372  7392519.337835 
+358571.182381  7392520.327665 
+358588.408757  7392522.817239 
+358600.497731  7392528.476270 
+358609.329444  7392533.655382 
+358620.272192  7392541.733999 
+358637.614015  7392553.751940 
+358650.667798  7392565.389947 
+358662.212521  7392575.358239 
+358672.429601  7392584.316705 
+358683.141454  7392596.164675 
+358695.700464  7392606.132968 
+358803.148849  7392630.878729 
+358809.044904  7392644.106463 
+358815.122376  7392659.343853 
+358820.449441  7392678.440582 
+358820.152577  7392699.147035 
+358812.648507  7392725.312553 
+358807.255472  7392744.869203 
+358804.286829  7392756.247254 
+358805.086713  7392768.545148 
+358814.495662  7392787.681870 
+358829.437832  7392804.768943 
+358842.466877  7392819.176475 
+358857.458524  7392831.174420 
+358878.041116  7392845.661939 
+358899.167959  7392856.830026 
+358910.226154  7392864.018794 
+358922.315128  7392869.787806 
+358935.937901  7392875.566816 
+358945.660207  7392883.515455 
+358954.401212  7392898.002973 
+358957.757427  7392910.210882 
+358954.854754  7392935.876486 
+358949.263810  7392954.313328 
+358943.813051  7392980.178897 
+358941.685524  7392999.645563 
+358946.113750  7393027.260832 
+358948.043368  7393049.766977 
+358951.770664  7393075.492571 
+358956.974035  7393096.798921 
+358968.205402  7393128.803439 
+358976.492863  7393147.600219 
+358993.405882  7393172.126018 
+359005.923661  7393186.423569 
+359024.997192  7393199.341356 
+359045.612769  7393210.499445 
+359064.570853  7393213.228978 
+359085.343108  7393218.638051 
+359119.144407  7393228.156421 
+359130.219095  7393233.355530 
+359146.901220  7393239.714441 
+359160.837350  7393254.801857 
+359169.240259  7393273.158712 
+359173.586022  7393298.664343 
+359175.408439  7393331.798668 
+359177.568952  7393394.157986 
+359182.632137  7393429.871869 
+359191.084524  7393453.207871 
+359201.491267  7393475.344080 
+359208.500563  7393499.439952 
+359213.250392  7393515.657174 
+359218.758874  7393536.973523 
+359223.566426  7393556.950101 
+359228.258531  7393567.958216 
+359233.865968  7393579.636215 
+359236.001742  7393591.284220 
+359225.891863  7393591.414198 
+359200.872799  7393581.985813 
+359183.283589  7393574.057171 
+359167.112731  7393567.588279 
+359150.908888  7393565.108704 
+359130.441743  7393559.489666 
+359116.810724  7393554.930447 
+359103.286906  7393549.701343 
+359090.925806  7393539.723052 
+359077.632882  7393530.964552 
+359063.779215  7393528.165032 
+359051.665502  7393524.505659 
+359040.788724  7393520.306378 
+359031.981749  7393512.357740 
+359024.832267  7393502.099497 
+359009.675696  7393496.640432 
+358978.504944  7393479.283405 
+358967.430256  7393473.314427 
+358958.375895  7393470.674880 
+358939.450795  7393463.846049 
+358922.743932  7393460.476626 
+358918.142535  7393461.206501 
+358908.247059  7393460.776575 
+358895.020105  7393466.965515 
+358885.066904  7393471.634715 
+358875.361091  7393472.754523 
+358860.839479  7393475.823998 
+358850.020424  7393475.614033 
+358836.216234  7393477.253753 
+358824.580802  7393477.803658 
+358807.849200  7393476.093951 
+358797.236302  7393475.873989 
+358782.244654  7393474.734184 
+358768.019906  7393478.033619 
+358754.463103  7393486.872105 
+358739.710597  7393492.261182 
+358732.214773  7393496.950379 
+358718.971327  7393504.359110 
+358707.591528  7393519.636493 
+358702.091292  7393529.334832 
+358697.720790  7393537.593417 
+358692.566896  7393542.862514 
+358681.261314  7393551.061110 
+358667.424139  7393556.900110 
+358652.168612  7393561.189375 
+358642.042241  7393563.638956 
+358623.422252  7393567.438305 
+358615.555348  7393568.248166 
+358598.799007  7393569.857890 
+358570.069140  7393574.237140 
+358542.147403  7393580.386087 
+358527.122771  7393582.235770 
+358510.341691  7393585.945135 
+358493.585351  7393587.784820 
+358481.793241  7393592.873948 
+358468.599272  7393595.513496 
+358460.394272  7393599.642788 
+358448.742348  7393601.302504 
+358438.112957  7393602.632276 
+358432.992048  7393604.022038 
+358424.424214  7393614.020326 
+358404.814678  7393635.756602 
+358396.354045  7393645.754890 
+358388.915945  7393654.203443 
+358380.884116  7393661.662165 
+358369.397117  7393667.091235 
+358351.601751  7393670.570639 
+358340.131244  7393674.220014 
+358330.227521  7393674.899898 
+358324.916949  7393674.739925 
+358318.080824  7393674.669937 
+358309.191387  7393675.579781 
+358299.732960  7393682.248639 
+358294.240971  7393690.277264 
+358288.542825  7393699.305717 
+358283.347700  7393708.224189 
+358278.177314  7393715.812890 
+358272.998681  7393723.291609 
+358260.151053  7393731.700168 
+358248.161034  7393736.569334 
+358235.486578  7393738.658976 
+358227.034191  7393746.657606 
+358210.277850  7393759.235452 
+358203.177846  7393764.704515 
+358190.338465  7393773.103076 
+358182.933350  7393778.342179 
+358168.386999  7393783.961216 
+358136.564795  7393791.629903 
+358104.618897  7393790.540089 
+358093.156637  7393793.979500 
+358085.982416  7393796.899000 
+358082.898326  7393799.078627 
+358078.527823  7393807.127248 
+358075.922014  7393812.966248 
+358069.753834  7393817.115537 
+358058.308066  7393818.775253 
+358055.380654  7393826.054006 
+358054.753940  7393837.572033 
+358052.222348  7393867.106974 
+358046.309800  7393877.135257 
+358044.817232  7393894.062357 
+358043.885408  7393905.460405 
+358039.935464  7393913.169084 
+358033.882731  7393926.506800 
+358021.274244  7393942.444070 
+358014.380395  7393958.321350 
+358007.461808  7393966.559939 
+358003.495371  7393975.828351 
+357999.998969  7393988.636157 
+357995.966562  7394004.773393 
+357992.503145  7394014.261768 
+357980.133799  7394026.759627 
+357965.884313  7394032.828588 
+357956.104283  7394040.817219 
+357941.871289  7394045.886351 
+357926.285913  7394052.705183 
+357912.704371  7394063.203385 
+357900.005176  7394078.360788 
+357892.352674  7394098.447348 
+357892.946403  7394111.075185 
+357895.576950  7394124.502885 
+357897.572538  7394139.250359 
+357902.561508  7394151.368283 
+357904.557095  7394166.555681 
+357905.200301  7394174.204371 
+357904.293216  7394183.502779 
+357903.188221  7394192.131301 
+357900.565920  7394199.080110 
+357897.968357  7394203.929280 
+357881.286233  7394218.496784 
+357870.648595  7394231.564546 
+357864.571123  7394247.341843 
+357862.905384  7394260.949513 
+357862.707475  7394270.807824 
+357865.371007  7394280.686132 
+357869.758002  7394291.584265 
+357875.142791  7394304.372075 
+357877.822816  7394312.700648 
+357880.140006  7394326.338312 
+357878.499007  7394337.736360 
+357878.960795  7394352.913760 
+357879.546278  7394365.981522 
+357881.368695  7394378.619357 
+357886.200986  7394395.946389 
+357887.627584  7394406.254623 
+357890.010745  7394413.143443 
+357889.738619  7394431.310331 
+357883.471484  7394445.417915 
+357875.917936  7394456.086087 
+357863.639299  7394469.033870 
+357854.741616  7394481.801683 
+357843.353572  7394498.078894 
+357834.521859  7394513.826197 
+357822.795719  7394533.642803 
+357817.551116  7394547.770383 
+357812.702332  7394563.777641 
+357813.221845  7394578.515117 
+357813.658895  7394590.813010 
+357827.108497  7394635.795305 
+357811.927187  7394653.252315 
+357802.988273  7394659.701210 
+357785.539248  7394669.499532 
+357767.653174  7394681.947399 
+357748.777552  7394691.175819 
+357733.678704  7394700.554212 
+357718.439670  7394713.472000 
+357703.101681  7394726.719730 
+357698.318867  7394704.413551 
+357634.476549  7394756.894562 
+357579.259789  7394818.504009 
+357560.219242  7394835.961018 
+357392.243524  7395038.926252 
+357333.266482  7395104.974939 
+357303.118263  7395131.150455 
+357277.719873  7395148.607465 
+357179.317602  7395214.476182 
+357053.150274  7395295.412319 
+357022.581497  7395314.389068 
+356973.137098  7395338.714901 
+356839.482191  7395377.988174 
+356760.590503  7395401.434158 
+356526.595462  7395463.833469 
+356474.602978  7395476.831243 
+356425.199810  7395492.428571 
+356201.611512  7395549.628774 
+356032.868894  7395597.570562 
+355772.626101  7395656.220515 
+355426.696726  7395723.299025 
+355197.237112  7395785.968291 
+355105.217424  7395804.365139 
+355031.611569  7395825.071593 
+354978.703753  7395859.575682 
+354925.795938  7395887.180954 
+354877.489518  7395937.782286 
+354860.007509  7395950.550099 
+354822.635592  7395978.975230 
+354751.882933  7396032.606044 
+Region 1
+1464
+352640.699455  7390122.748349 
+352645.828611  7390119.808853 
+352686.061970  7390107.810908 
+352697.120166  7390104.491476 
+352730.302998  7390092.863468 
+352759.065850  7390084.954823 
+352767.155402  7390082.155302 
+352774.725442  7390080.685554 
+352782.880964  7390081.095484 
+352792.240436  7390084.184955 
+352798.021044  7390087.564376 
+352801.459722  7390091.473706 
+352805.170526  7390097.492675 
+352809.343118  7390108.500789 
+352809.994571  7390115.479594 
+352810.126510  7390122.018474 
+352810.274942  7390128.107431 
+352810.225465  7390132.536672 
+352809.260656  7390137.405838 
+352808.996777  7390143.044872 
+352805.797239  7390177.009055 
+352804.972616  7390188.407102 
+352803.752174  7390197.475549 
+352800.775285  7390209.853429 
+352800.272265  7390219.371798 
+352801.121626  7390226.130641 
+352802.927551  7390229.030144 
+352807.792827  7390232.069623 
+352819.090163  7390235.179091 
+352824.903756  7390236.228911 
+352830.090635  7390237.948616 
+352836.390755  7390240.108246 
+352854.804588  7390246.717114 
+352873.292637  7390254.875717 
+352892.943405  7390259.954847 
+352902.525525  7390261.264622 
+352920.576524  7390261.894515 
+352938.644015  7390262.294446 
+352952.909994  7390264.324098 
+352962.690023  7390266.303759 
+352975.834515  7390268.533377 
+352982.654148  7390269.933138 
+352986.637077  7390269.753168 
+352998.387956  7390268.543376 
+353004.234533  7390265.723859 
+353009.693538  7390260.684722 
+353014.459859  7390253.755909 
+353015.977166  7390244.907424 
+353016.084367  7390233.949301 
+353015.457653  7390225.300783 
+353015.985412  7390213.902735 
+353017.477980  7390206.943927 
+353019.687970  7390200.205081 
+353022.805045  7390195.475891 
+353026.301447  7390192.526397 
+353032.238733  7390190.476748 
+353042.027009  7390191.796522 
+353053.728410  7390195.565876 
+353061.653037  7390199.185256 
+353069.569419  7390203.474521 
+353081.468730  7390207.583817 
+353089.401604  7390210.433329 
+353095.107995  7390211.373168 
+353107.452602  7390211.723108 
+353122.939024  7390213.982721 
+353132.521144  7390215.742420 
+353137.411158  7390216.232336 
+353141.913600  7390215.392480 
+353145.220339  7390211.213196 
+353146.490258  7390206.573990 
+353145.566681  7390197.265585 
+353143.117550  7390186.497429 
+353143.463892  7390183.177998 
+353143.909188  7390178.978717 
+353146.284103  7390176.009226 
+353149.368193  7390174.379505 
+353154.060298  7390174.649459 
+353157.301067  7390176.789092 
+353161.984926  7390177.828914 
+353167.592363  7390178.768753 
+353170.462051  7390177.688938 
+353174.494458  7390172.529822 
+353178.040337  7390164.921125 
+353180.233834  7390159.742012 
+353180.266819  7390156.082639 
+353178.164030  7390152.303287 
+353174.923262  7390149.943691 
+353170.025001  7390149.443776 
+353156.443459  7390150.643571 
+353149.401178  7390150.353620 
+353142.383636  7390147.954032 
+353139.151113  7390144.934549 
+353137.460636  7390140.035388 
+353137.823470  7390135.056241 
+353140.404540  7390131.876785 
+353145.327540  7390129.157251 
+353156.699092  7390124.837991 
+353165.102001  7390121.598546 
+353171.064026  7390117.449257 
+353173.381217  7390113.969853 
+353176.564262  7390108.430801 
+353180.365774  7390096.172901 
+353186.138135  7390079.625736 
+353188.842899  7390074.776566 
+353191.935235  7390072.256998 
+353202.721305  7390064.618306 
+353220.467194  7390055.709832 
+353225.423178  7390050.670695 
+353230.016329  7390040.412452 
+353237.800770  7390027.204715 
+353248.504378  7390018.226253 
+353258.358623  7390012.907164 
+353272.698818  7390007.728051 
+353284.276526  7390002.758902 
+353302.179093  7389998.729592 
+353313.113595  7389997.729764 
+353332.805594  7389999.089531 
+353347.071573  7390000.169346 
+353355.515713  7390002.918875 
+353363.910376  7390010.307609 
+353374.828385  7390020.825807 
+353382.513872  7390029.434333 
+353386.232922  7390033.563626 
+353392.170208  7390042.492096 
+353400.490655  7390057.189579 
+353409.239905  7390070.237344 
+353416.282186  7390080.155645 
+353424.297523  7390084.784852 
+353435.998924  7390088.994131 
+353445.465597  7390090.753829 
+353454.148878  7390090.503872 
+353462.131229  7390088.044293 
+353467.177922  7390083.885006 
+353471.012419  7390077.606081 
+353473.181178  7390075.526438 
+353477.691866  7390072.916885 
+353487.339956  7390068.137703 
+353496.254131  7390064.238371 
+353503.667493  7390057.559515 
+353508.516276  7390053.070284 
+353514.585502  7390047.701204 
+353529.626627  7390023.485352 
+353540.338480  7390014.076963 
+353549.120716  7390004.458611 
+353598.218773  7389995.020228 
+353645.263519  7390001.399135 
+353691.912446  7390011.767359 
+353703.415938  7390025.564996 
+353713.814434  7390026.774788 
+353729.878092  7390022.945444 
+353762.203316  7390015.746677 
+353771.653496  7390009.747705 
+353792.401012  7389996.439984 
+353804.382786  7389992.020741 
+353827.134136  7389983.172257 
+353837.606849  7389976.293435 
+353839.899301  7389971.784208 
+353844.871778  7389964.745413 
+353849.794778  7389952.387530 
+353852.210923  7389944.878816 
+353862.980501  7389939.669709 
+353879.266806  7389934.080666 
+353895.487142  7389935.020505 
+353904.368332  7389934.110661 
+353919.887738  7389933.600748 
+353926.509462  7389935.210473 
+353934.343381  7389937.290116 
+353938.590189  7389941.429407 
+353940.717717  7389952.967431 
+353941.872189  7389960.616121 
+353944.560460  7389967.174997 
+353945.492284  7389976.273439 
+353951.041998  7389981.972463 
+353953.260234  7389985.201909 
+353962.825861  7389987.631493 
+353966.190323  7389988.441355 
+353974.733418  7389991.070904 
+353979.994513  7389995.660118 
+353982.814724  7389999.789411 
+353988.784995  7390004.608585 
+353993.386392  7390003.878710 
+354000.032854  7390002.728907 
+354006.365959  7390001.799067 
+354012.707310  7390000.859228 
+354017.514863  7389999.139522 
+354018.883737  7389995.160204 
+354018.933215  7389990.620981 
+354019.023923  7389981.212593 
+354020.293843  7389966.385133 
+354022.124506  7389956.766780 
+354024.598375  7389943.948976 
+354028.762722  7389935.680392 
+354032.102445  7389928.411637 
+354043.234856  7389917.883441 
+354053.905479  7389912.454370 
+354064.361699  7389907.575206 
+354085.546266  7389901.806194 
+354099.012360  7389902.386095 
+354112.981475  7389903.635881 
+354119.545475  7389900.156477 
+354141.397986  7389898.936686 
+354152.629352  7389898.276799 
+354163.547361  7389899.156648 
+354180.748999  7389903.645879 
+354186.240988  7389905.475566 
+354198.610334  7389914.014103 
+354205.726831  7389916.413692 
+354212.496987  7389922.792600 
+354218.252856  7389929.381471 
+354226.012559  7389939.319769 
+354230.176905  7389951.757638 
+354238.085040  7389966.785064 
+354255.360893  7389963.975545 
+354269.330008  7389965.105352 
+354289.244655  7389974.493744 
+354315.772779  7389985.501858 
+354323.103678  7389987.131579 
+354332.240502  7389991.760786 
+354337.831446  7389994.580303 
+354340.552702  7389997.379823 
+354344.486154  7390002.179001 
+354347.025993  7390003.758731 
+354349.557586  7390005.888366 
+354356.888485  7390007.178145 
+354359.444817  7390007.198142 
+354361.522867  7390002.908876 
+354362.867002  7390001.699084 
+354365.637736  7390000.179344 
+354378.773981  7390002.858885 
+354381.808594  7390005.208483 
+354384.002092  7390010.767530 
+354389.386880  7390013.367085 
+354391.069111  7390018.926133 
+354394.120217  7390019.286071 
+354399.406050  7390022.105588 
+354408.979924  7390023.975268 
+354419.700024  7390023.305383 
+354423.122210  7390027.994579 
+354426.948461  7390033.013720 
+354429.174943  7390035.583280 
+354436.002822  7390036.203173 
+354441.313395  7390036.263163 
+354449.658580  7390037.892884 
+354452.998303  7390040.912367 
+354458.251152  7390046.501409 
+354460.403419  7390056.159755 
+354462.390760  7390061.718803 
+354465.293433  7390067.397830 
+354466.744770  7390075.156501 
+354469.457780  7390079.725718 
+354475.527006  7390084.664872 
+354478.784267  7390085.244773 
+354487.467547  7390085.004814 
+354490.741301  7390083.815018 
+354500.999612  7390079.155816 
+354506.862682  7390073.896717 
+354512.024822  7390068.637618 
+354519.908219  7390065.498155 
+354528.632731  7390061.048918 
+354538.058173  7390056.939621 
+354546.007539  7390048.371089 
+354546.370373  7390042.292130 
+354551.037740  7390035.363317 
+354556.356558  7390033.643612 
+354561.963995  7390034.473470 
+354562.623694  7390040.012521 
+354564.099769  7390045.121646 
+354568.363070  7390047.381259 
+354575.999080  7390049.230942 
+354584.542175  7390052.410397 
+354587.378878  7390054.660012 
+354589.893978  7390058.229401 
+354593.101762  7390064.128390 
+354595.823018  7390067.697779 
+354601.380978  7390072.846897 
+354609.734409  7390075.146503 
+354619.275298  7390080.335614 
+354634.266945  7390081.035494 
+354645.184955  7390081.145475 
+354655.591698  7390082.025324 
+354669.593798  7390079.945681 
+354680.792179  7390071.977046 
+354688.700314  7390067.067887 
+354695.874535  7390064.598310 
+354701.020183  7390060.439022 
+354711.938192  7390060.549003 
+354716.011830  7390061.588825 
+354721.437850  7390069.497470 
+354726.517528  7390072.316987 
+354731.951794  7390079.465763 
+354740.577351  7390084.644876 
+354752.707556  7390086.314590 
+354762.899897  7390087.414401 
+354772.284108  7390088.284252 
+354791.745212  7390091.573689 
+354805.219553  7390091.263742 
+354813.911080  7390089.803992 
+354825.546512  7390089.913973 
+354835.977993  7390087.254429 
+354842.830611  7390085.654703 
+354850.483113  7390086.514556 
+354855.232942  7390091.323732 
+354856.906927  7390097.092744 
+354863.487419  7390102.811764 
+354866.225167  7390103.831589 
+354872.855137  7390104.891408 
+354876.120644  7390104.931401 
+354881.035398  7390102.981735 
+354883.501021  7390101.571976 
+354889.941327  7390100.082232 
+354899.993482  7390105.271343 
+354905.048421  7390110.420461 
+354910.482687  7390117.999162 
+354915.727290  7390124.368072 
+354922.472707  7390134.066410 
+354935.707907  7390136.745951 
+354947.293861  7390141.955059 
+354966.177729  7390152.223300 
+354979.759271  7390161.991627 
+354994.338607  7390173.099724 
+355008.711787  7390185.087671 
+355021.988218  7390194.855998 
+355032.650594  7390200.285068 
+355040.632946  7390208.773614 
+355050.660362  7390216.402307 
+355060.019834  7390219.381797 
+355068.851547  7390224.011004 
+355074.640401  7390226.610558 
+355086.036691  7390230.269932 
+355099.502786  7390230.959813 
+355114.494433  7390232.429562 
+355121.322312  7390232.939474 
+355131.935211  7390233.049455 
+355153.119778  7390227.280444 
+355170.387385  7390225.230795 
+355187.811670  7390217.652093 
+355202.044664  7390213.252846 
+355215.741653  7390210.843259 
+355234.163733  7390206.044081 
+355257.599520  7390199.525198 
+355266.010675  7390195.395905 
+355269.639017  7390189.566904 
+355281.150755  7390181.148346 
+355290.262840  7390178.688767 
+355297.437060  7390175.769267 
+355308.891075  7390173.339683 
+355320.130687  7390172.009911 
+355337.348817  7390159.572041 
+355358.104579  7390140.385328 
+355372.230372  7390125.457885 
+355381.705291  7390116.919347 
+355392.755240  7390103.741605 
+355408.216923  7390089.054121 
+355420.792425  7390076.326301 
+355427.175007  7390070.307332 
+355450.841689  7390051.380574 
+355458.568407  7390043.701889 
+355466.220909  7390034.143526 
+355471.416035  7390024.675148 
+355482.078411  7390009.047825 
+355492.064596  7390000.399306 
+355509.736268  7389988.951267 
+355517.149630  7389982.272411 
+355522.600388  7389978.003143 
+355527.828498  7389964.985372 
+355530.459046  7389956.926753 
+355532.792729  7389948.648171 
+355534.392498  7389941.019478 
+355541.187392  7389925.252178 
+355544.114804  7389917.643482 
+355548.963588  7389912.704328 
+355557.176833  7389908.025129 
+355562.817255  7389905.305595 
+355578.559309  7389902.476080 
+355584.397641  7389900.206468 
+355596.898926  7389895.347301 
+355602.357931  7389890.088202 
+355613.581051  7389880.119909 
+355620.285236  7389873.211092 
+355629.570492  7389862.672898 
+355635.293376  7389851.654785 
+355636.959115  7389838.717001 
+355638.682577  7389828.988667 
+355638.154818  7389810.481837 
+355633.635884  7389803.133096 
+355628.919040  7389794.774528 
+355623.138432  7389790.845201 
+355604.501951  7389777.037566 
+355599.884062  7389758.280779 
+355598.754328  7389748.632432 
+355596.099042  7389738.754124 
+355595.777439  7389719.587407 
+355613.350156  7389697.061265 
+355621.827282  7389686.293110 
+355636.390125  7389658.747828 
+355643.514868  7389640.101022 
+355651.860054  7389621.474213 
+355656.725330  7389594.278871 
+355659.628003  7389569.053192 
+355664.344847  7389535.328969 
+355672.228243  7389512.372901 
+355678.017097  7389494.815908 
+355698.038945  7389461.241659 
+355710.993773  7389441.874976 
+355726.199823  7389421.208516 
+355740.218415  7389396.542741 
+355747.211218  7389380.995405 
+355761.452459  7389343.821772 
+355763.695434  7389323.355278 
+355770.119247  7389293.630369 
+355775.504036  7389275.073548 
+355788.153754  7389234.560488 
+355809.874325  7389225.692007 
+355817.279440  7389219.783019 
+355819.852264  7389217.483413 
+355825.014405  7389211.994353 
+355829.879681  7389204.515634 
+355838.076434  7389180.559737 
+355852.292936  7389157.333716 
+355851.443574  7389150.244930 
+355860.605136  7389142.026338 
+355865.783769  7389134.437638 
+355873.832090  7389125.439179 
+355880.561014  7389115.980799 
+355894.670315  7389102.493109 
+355905.901681  7389091.534987 
+355914.436530  7389085.086091 
+355932.858609  7389069.868698 
+355945.401126  7389060.250345 
+355956.137718  7389057.810763 
+355961.745155  7389058.860583 
+355963.938652  7389063.759744 
+355963.072798  7389068.728893 
+355962.009034  7389073.478080 
+355961.448291  7389078.567208 
+355965.192079  7389081.376727 
+355971.492200  7389084.536185 
+355980.480591  7389083.626341 
+355986.846681  7389079.926975 
+355997.781183  7389078.047297 
+356013.820102  7389076.647537 
+356020.153207  7389076.047639 
+356032.110241  7389074.617884 
+356051.612577  7389072.818193 
+356058.762059  7389072.218295 
+356070.752078  7389067.799052 
+356080.490876  7389062.909890 
+356085.644770  7389057.650791 
+356086.444655  7389048.792308 
+356087.343494  7389040.723690 
+356087.384725  7389036.734373 
+356088.869047  7389020.797103 
+356093.519921  7389014.758138 
+356098.871724  7389010.048944 
+356105.015166  7389008.339237 
+356116.469181  7389005.459730 
+356123.090904  7389006.519549 
+356127.057341  7389007.889314 
+356134.874767  7389012.288561 
+356138.907174  7389017.307701 
+356148.274892  7389019.287362 
+356153.387555  7389018.337525 
+356165.369328  7389014.138244 
+356176.345061  7389008.929136 
+356183.222418  7389004.229941 
+356199.500477  7388999.630729 
+356211.589451  7388994.771561 
+356229.953807  7388984.873257 
+356247.551263  7388979.844118 
+356263.342795  7388972.135439 
+356274.326774  7388966.256446 
+356286.630150  7388959.847543 
+356296.616335  7388951.089044 
+356298.710878  7388946.119895 
+356303.584400  7388938.311232 
+356309.513440  7388936.591527 
+356315.830053  7388937.651345 
+356320.596374  7388940.800806 
+356326.203811  7388941.850626 
+356331.481399  7388944.230218 
+356337.097082  7388944.510171 
+356343.636342  7388943.910273 
+356347.742965  7388940.630835 
+356348.625312  7388934.541878 
+356348.666543  7388930.002656 
+356348.732513  7388923.693736 
+356350.860041  7388914.855250 
+356355.296513  7388909.916096 
+356364.911618  7388907.466516 
+356373.611391  7388905.106920 
+356386.797114  7388902.917295 
+356398.770641  7388899.597864 
+356409.358801  7388891.399268 
+356421.373559  7388884.210499 
+356428.085991  7388876.191873 
+356449.031416  7388863.324077 
+356458.250702  7388859.104800 
+356472.458958  7388857.025156 
+356487.170233  7388855.175473 
+356505.270709  7388851.586088 
+356521.829141  7388849.316476 
+356546.493616  7388842.027725 
+356565.822781  7388837.238545 
+356575.569826  7388832.009441 
+356590.660428  7388823.410914 
+356601.479482  7388812.892715 
+356619.753129  7388791.476384 
+356626.160451  7388782.897853 
+356642.323063  7388768.990236 
+356672.743408  7388736.735760 
+356684.947829  7388709.610407 
+356695.832853  7388692.113404 
+356698.974667  7388684.274747 
+356703.938898  7388677.795856 
+356711.640878  7388672.886697 
+356715.450636  7388668.827393 
+356723.713359  7388659.159049 
+356716.530892  7388641.812020 
+356711.814048  7388634.013356 
+356708.325893  7388625.784765 
+356709.397903  7388620.265711 
+356715.087802  7388612.237086 
+356736.156921  7388597.599593 
+356750.744503  7388587.441333 
+356761.233709  7388579.462700 
+356772.720708  7388573.043799 
+356785.815722  7388559.326149 
+356792.825018  7388552.637295 
+356805.895294  7388541.469208 
+356815.147565  7388534.700367 
+356825.669755  7388522.512455 
+356833.891247  7388516.723447 
+356845.609141  7388508.534849 
+356851.752582  7388506.155257 
+356863.742602  7388501.176110 
+356873.456662  7388498.836510 
+356883.904636  7388494.947177 
+356893.173399  7388486.408639 
+356900.100233  7388477.170222 
+356907.530087  7388469.381556 
+356925.993397  7388459.263289 
+356934.404552  7388454.584090 
+356947.928371  7388449.734921 
+356958.730933  7388440.756459 
+356967.166827  7388433.527697 
+356973.854520  7388427.618709 
+356984.871484  7388418.090341 
+356993.340363  7388407.652129 
+356997.282061  7388401.043261 
+356999.393096  7388393.754510 
+357000.704247  7388385.465930 
+357000.918649  7388374.057884 
+357000.968126  7388368.858774 
+357001.528870  7388363.219740 
+357009.511221  7388351.001833 
+357022.804145  7388348.142323 
+357040.904621  7388343.773071 
+357049.497193  7388342.093359 
+357057.166188  7388340.173688 
+357065.577343  7388335.714452 
+357073.271076  7388331.805121 
+357086.514523  7388323.846485 
+357098.850884  7388314.668057 
+357109.150426  7388305.239672 
+357115.013496  7388300.210533 
+357125.255314  7388296.541162 
+357138.498761  7388287.922638 
+357144.139183  7388285.763008 
+357152.855448  7388280.973828 
+357161.448021  7388279.394099 
+357167.104935  7388274.364960 
+357172.580432  7388267.326166 
+357181.024572  7388259.877442 
+357183.663366  7388250.818994 
+357188.371964  7388239.240977 
+357190.507737  7388229.402662 
+357194.663838  7388221.693982 
+357197.096476  7388212.635534 
+357201.755596  7388206.366608 
+357204.361405  7388200.637589 
+357215.106243  7388197.418141 
+357226.065484  7388192.988899 
+357236.999986  7388191.429166 
+357247.151096  7388186.440021 
+357254.341809  7388181.530862 
+357261.029502  7388176.051800 
+357272.029974  7388168.303128 
+357280.234973  7388163.393969 
+357289.223365  7388152.635811 
+357313.483775  7388124.190684 
+357330.405040  7388104.644032 
+357342.832110  7388086.377161 
+357350.880431  7388077.158740 
+357356.578576  7388068.350249 
+357364.206340  7388060.671564 
+357376.872550  7388049.173534 
+357394.643177  7388026.867354 
+357400.885574  7388014.079545 
+357409.840980  7388005.860953 
+357418.986050  7387989.113821 
+357426.457135  7387977.005895 
+357429.095929  7387967.957445 
+357431.512074  7387960.448731 
+357436.575260  7387943.771588 
+357440.516958  7387926.424559 
+357443.172244  7387916.156318 
+357448.284907  7387894.280065 
+357454.461334  7387868.094551 
+357462.740550  7387855.546700 
+357474.598629  7387843.258805 
+357479.999911  7387833.790427 
+357486.225815  7387823.222237 
+357486.671111  7387808.604741 
+357485.698056  7387803.495616 
+357483.941609  7387785.318730 
+357482.836614  7387772.910855 
+357479.686554  7387761.472814 
+357476.726157  7387750.584679 
+357471.052750  7387735.917192 
+357462.418947  7387721.659634 
+357456.885726  7387713.301066 
+357450.206279  7387697.063847 
+357441.325089  7387676.927296 
+357435.709406  7387603.789824 
+357414.871181  7387585.532951 
+357397.809730  7387566.876147 
+357391.715765  7387553.408454 
+357389.959318  7387524.163463 
+357392.251770  7387509.006059 
+357395.814142  7387489.109468 
+357403.004855  7387463.493855 
+357411.952015  7387435.558640 
+357416.215317  7387416.661877 
+357418.928326  7387399.964737 
+357417.691392  7387380.358096 
+357410.657357  7387358.471845 
+357402.996609  7387324.467669 
+357402.658513  7387321.298212 
+357391.146775  7387288.073903 
+357378.967093  7387271.226789 
+357362.375677  7387255.899414 
+357344.753482  7387242.761665 
+357325.218161  7387226.404466 
+357308.131971  7387210.297226 
+357292.027083  7387198.509245 
+357263.907436  7387172.433711 
+357243.077458  7387153.177010 
+357214.438299  7387128.871173 
+357194.597868  7387113.163864 
+357178.534211  7387096.616698 
+357160.565674  7387076.730104 
+357141.343710  7387049.744727 
+357129.584585  7387031.357876 
+357120.744626  7387006.242178 
+357109.348335  7386982.106313 
+357101.646356  7386956.000784 
+357087.932874  7386928.845436 
+357077.237513  7386916.887484 
+357060.670836  7386899.790413 
+357048.317982  7386890.032084 
+357028.733185  7386878.654033 
+357019.596361  7386873.694882 
+356998.716905  7386859.537308 
+356986.891810  7386848.339226 
+356971.149756  7386830.472286 
+356958.128958  7386815.944775 
+356934.280859  7386792.118856 
+356924.822432  7386778.851128 
+356914.143564  7386764.903517 
+356903.538911  7386753.615451 
+356868.657355  7386741.867463 
+356853.937834  7386744.157071 
+356840.422262  7386748.786278 
+356828.102393  7386756.304990 
+356818.462549  7386761.644076 
+356799.281817  7386771.862325 
+356782.649170  7386782.220551 
+356764.037427  7386786.799767 
+356744.708262  7386790.819078 
+356728.463188  7386793.208669 
+356699.675597  7386794.808395 
+356673.724709  7386798.317794 
+356650.495077  7386794.538441 
+356631.941058  7386792.478794 
+356607.911542  7386787.919575 
+356585.588996  7386785.160048 
+356562.606751  7386777.291395 
+356545.446345  7386768.482904 
+356533.786175  7386761.504100 
+356515.768161  7386746.156729 
+356507.200327  7386735.988470 
+356498.071750  7386719.621274 
+356490.897529  7386702.604189 
+356479.501239  7386678.798266 
+356468.418305  7386653.662572 
+356457.343617  7386627.966973 
+356449.872532  7386609.730097 
+356444.116663  7386582.874697 
+356443.852784  7386537.362493 
+356436.884719  7386519.015636 
+356427.063458  7386500.978725 
+356421.357066  7386490.180575 
+356411.519313  7386474.143322 
+356397.269827  7386449.197595 
+356388.833933  7386425.521650 
+356386.854837  7386409.114461 
+356393.435329  7386393.337163 
+356399.760188  7386383.108915 
+356408.039404  7386371.110971 
+356434.839653  7386333.167470 
+356446.541055  7386316.010409 
+356460.914235  7386296.773704 
+356466.496933  7386278.776787 
+356464.723993  7386251.181513 
+356459.735024  7386219.576927 
+356456.964290  7386189.762034 
+356458.555813  7386173.604802 
+356464.435375  7386156.277770 
+356479.361053  7386143.130022 
+356496.851308  7386128.572515 
+356513.096382  7386115.784706 
+356526.463522  7386105.166524 
+356539.871893  7386091.018948 
+356546.237983  7386076.241479 
+356547.309993  7386061.074077 
+356547.730551  7386038.597927 
+356533.167708  7385973.229124 
+356525.614160  7385943.034296 
+356523.849467  7385914.999098 
+356520.847839  7385867.237280 
+356515.529020  7385837.172429 
+356499.457117  7385801.248583 
+356483.723309  7385772.193560 
+356466.364993  7385753.526757 
+356439.300864  7385735.539838 
+356422.107473  7385730.280739 
+356402.143349  7385726.871323 
+356374.345305  7385721.052320 
+356358.199186  7385712.923712 
+356347.297669  7385701.635646 
+356329.007529  7385672.770590 
+356316.423781  7385655.483551 
+356299.246883  7385638.476464 
+356276.586241  7385629.288038 
+356256.374730  7385619.999629 
+356226.144048  7385612.950836 
+356206.410818  7385607.111837 
+356191.757266  7385602.532621 
+356170.968519  7385590.034762 
+356150.872455  7385579.536560 
+356130.792883  7385566.828737 
+356110.053613  7385549.121770 
+356096.686473  7385528.615282 
+356081.694826  7385506.988987 
+356067.626757  7385485.252710 
+356044.545557  7385456.557625 
+356026.247171  7385439.880482 
+356014.826142  7385428.252474 
+356000.551916  7385417.144376 
+355982.138083  7385411.755299 
+355958.586849  7385410.085585 
+355931.464996  7385408.375878 
+355897.828621  7385405.276409 
+355874.277387  7385403.826658 
+355848.244036  7385394.818201 
+355829.681771  7385384.120033 
+355817.279440  7385368.822653 
+355811.168983  7385357.574580 
+355809.412536  7385339.397694 
+355810.525777  7385319.471107 
+355809.222873  7385296.754998 
+355805.256436  7385263.830638 
+355796.903004  7385231.636152 
+355762.293574  7385110.576889 
+355750.889037  7385067.274306 
+355738.206335  7385028.720910 
+355724.014572  7384999.345941 
+355707.390171  7384977.699649 
+355684.655313  7384955.543444 
+355660.840199  7384929.397923 
+355644.900235  7384910.631137 
+355614.949925  7384886.195323 
+355592.165590  7384868.358378 
+355559.320853  7384847.321982 
+355535.629433  7384839.123386 
+355515.698293  7384832.714484 
+355491.033817  7384820.186630 
+355473.123004  7384815.017515 
+355447.906031  7384806.468980 
+355430.374545  7384794.880964 
+355412.513209  7384784.962663 
+355396.004255  7384773.284664 
+355371.826307  7384762.516508 
+355343.492258  7384759.467031 
+355315.496305  7384763.846280 
+355292.077010  7384769.925239 
+355270.043082  7384779.893532 
+355252.742490  7384785.372593 
+355221.126442  7384794.910959 
+355192.792393  7384802.489661 
+355168.383551  7384804.359341 
+355148.213271  7384801.499831 
+355129.024292  7384792.111439 
+355112.812202  7384780.653402 
+355097.078394  7384763.006424 
+355081.979546  7384742.030017 
+355072.644813  7384726.772631 
+355065.396376  7384706.426116 
+355059.657000  7384688.659159 
+355049.745030  7384659.434165 
+355045.028186  7384641.667209 
+355045.168372  7384616.971439 
+355047.460824  7384591.525797 
+355051.171628  7384567.859851 
+355054.024824  7384547.183393 
+355054.461874  7384523.487452 
+355050.206819  7384511.039584 
+355034.225624  7384496.592059 
+355017.428052  7384482.694439 
+355002.947671  7384472.136248 
+354985.424431  7384459.118478 
+354960.083765  7384442.591308 
+354950.584107  7384433.852805 
+354921.788269  7384416.185831 
+354905.304054  7384400.958440 
+354886.832498  7384380.951867 
+354876.458740  7384367.894103 
+354860.197173  7384351.446921 
+354850.441882  7384347.807544 
+354839.507380  7384349.577241 
+354831.483798  7384356.036135 
+354828.869743  7384361.985116 
+354820.788436  7384374.752929 
+354800.040920  7384399.128753 
+354790.747418  7384409.786928 
+354776.357746  7384430.793329 
+354764.136832  7384449.720087 
+354743.430547  7384469.776652 
+354729.865497  7384489.243317 
+354720.497779  7384508.090089 
+354715.005790  7384526.856875 
+354713.793594  7384556.081869 
+354713.859564  7384580.337714 
+354717.199287  7384603.843687 
+354717.232272  7384630.869058 
+354718.296036  7384667.532778 
+354722.460382  7384690.278882 
+354723.548885  7384703.916546 
+354723.062357  7384731.701786 
+354722.229488  7384764.476173 
+354720.101960  7384793.801149 
+354717.520890  7384826.995464 
+354712.507182  7384849.211658 
+354701.770590  7384882.545948 
+354689.491952  7384906.011929 
+354684.173133  7384918.029870 
+354675.572315  7384931.007647 
+354658.807728  7384944.355361 
+354645.770437  7384952.533960 
+354621.699690  7384962.372275 
+354604.770178  7384971.940636 
+354586.793396  7384984.278522 
+354571.661562  7385007.714508 
+354558.789196  7385019.662461 
+354542.667815  7385040.758848 
+354528.063741  7385062.215173 
+354510.639456  7385090.500328 
+354494.188225  7385113.926315 
+354465.532574  7385143.201300 
+354448.231982  7385159.308541 
+354428.333828  7385179.375104 
+354404.840316  7385202.951066 
+354386.319282  7385218.268442 
+354366.825193  7385229.596502 
+354345.434471  7385236.025400 
+354323.276849  7385238.355001 
+354303.271494  7385238.814923 
+354248.401075  7385257.531717 
+354261.751722  7385360.444089 
+354284.973108  7385405.856310 
+354291.792740  7385437.710854 
+354299.362780  7385466.685890 
+354308.672775  7385484.722801 
+354323.227372  7385538.683558 
+354185.911139  7385956.691957 
+354099.284486  7386476.442928 
+354056.404087  7386585.144309 
+354048.025916  7386591.873156 
+354042.575158  7386616.288974 
+354036.835781  7386629.086782 
+354029.043093  7386642.844425 
+354012.360969  7386658.631721 
+353999.134015  7386684.967210 
+353987.251196  7386699.684689 
+353978.675117  7386711.002750 
+353967.443750  7386721.410967 
+353957.647228  7386732.169125 
+353937.328516  7386753.895403 
+353915.715146  7386772.062291 
+353909.002714  7386780.300880 
+353901.061594  7386788.519472 
+353898.579478  7386801.897181 
+353893.722448  7386807.936146 
+353889.417916  7386810.335735 
+353864.745194  7386808.096119 
+353841.870150  7386809.855818 
+353829.731699  7386809.405895 
+353811.458052  7386809.885812 
+353795.757228  7386809.285915 
+353787.082194  7386809.415893 
+353772.049315  7386812.255406 
+353755.993904  7386816.304713 
+353738.091337  7386830.742240 
+353731.049056  7386841.530392 
+353713.633017  7386837.581068 
+353699.350546  7386837.881017 
+353687.665637  7386842.970145 
+353680.145075  7386850.208905 
+353677.844376  7386855.827943 
+353670.620678  7386863.506628 
+353657.154584  7386883.313235 
+353653.773629  7386895.121212 
+353644.669790  7386907.879027 
+353638.913921  7386921.666665 
+353626.297189  7386938.263822 
+353621.646314  7386944.752711 
+353611.173602  7386951.181610 
+353591.621789  7386967.368837 
+353582.484965  7386973.037866 
+353573.933624  7386981.036496 
+353569.109579  7386983.975992 
+353561.300399  7386999.073406 
+353549.813399  7387005.272344 
+353546.259274  7387003.682617 
+353543.752420  7386998.783456 
+353543.628726  7386991.474708 
+353539.068561  7386987.665360 
+353534.285747  7386987.065463 
+353528.958682  7386988.555208 
+353523.516170  7386992.264573 
+353513.035211  7386999.253375 
+353505.836251  7387004.942401 
+353490.259122  7387011.541271 
+353482.177816  7387014.000849 
+353462.848651  7387017.800199 
+353456.408345  7387019.279945 
+353451.551315  7387025.208929 
+353444.294632  7387036.546987 
+353441.383713  7387042.056044 
+353434.250723  7387051.284463 
+353426.062216  7387053.414098 
+353415.581257  7387081.109354 
+353412.942463  7387090.167803 
+353411.540604  7387097.676516 
+353407.400996  7387103.175574 
+353399.517600  7387106.195057 
+353384.674384  7387110.474324 
+353369.369380  7387120.402624 
+353355.020939  7387126.791529 
+353333.011749  7387133.990296 
+353316.890368  7387144.348522 
+353308.536937  7387153.017037 
+353301.346224  7387157.926196 
+353285.752602  7387165.744857 
+353262.374538  7387177.132906 
+353246.954086  7387188.270998 
+353232.094379  7387194.549923 
+353221.506219  7387202.188614 
+353208.831762  7387215.136397 
+353199.373336  7387232.313454 
+353194.029778  7387246.101093 
+353188.496557  7387258.119034 
+353044.863712  7387317.848803 
+352742.012645  7387441.097691 
+352657.686691  7387489.209450 
+352637.755551  7387492.878822 
+352617.750196  7387493.228762 
+352587.230896  7387493.698681 
+352573.608123  7387489.129464 
+352554.732501  7387478.751242 
+352527.445724  7387472.602295 
+352510.532705  7387470.002740 
+352494.996806  7387472.832256 
+352479.625832  7387479.321144 
+352474.364737  7387484.810204 
+352466.291677  7387496.018284 
+352460.098758  7387502.487176 
+352450.516638  7387511.695599 
+352442.781674  7387520.364114 
+352435.302342  7387522.953670 
+352422.619640  7387526.253105 
+352396.165732  7387538.720970 
+352383.647954  7387545.239853 
+352367.732729  7387554.828210 
+352358.653629  7387565.036462 
+352350.094041  7387573.475016 
+352334.508665  7387591.361953 
+352323.582410  7387601.780168 
+352315.360918  7387607.449197 
+352308.137220  7387615.907748 
+352291.397371  7387625.926032 
+352286.441387  7387631.415092 
+352278.681684  7387642.413208 
+352272.340332  7387644.002936 
+352263.327202  7387647.122401 
+352255.122203  7387651.251694 
+352253.357509  7387663.859534 
+352250.380620  7387676.227416 
+352247.618133  7387687.055561 
+352235.290018  7387694.684254 
+352226.606737  7387695.484117 
+352218.921250  7387699.173485 
+352212.950979  7387704.092643 
+352210.658527  7387708.831831 
+352193.357935  7387734.347460 
+352181.887428  7387748.515034 
+352171.266283  7387759.703117 
+352163.844676  7387767.161840 
+352158.707274  7387770.101336 
+352157.025043  7387775.290447 
+352156.662209  7387780.379576 
+352155.351058  7387799.306334 
+352153.644088  7387806.595085 
+352148.704596  7387811.084316 
+352138.075205  7387812.084145 
+352124.452432  7387817.703182 
+352120.617935  7387822.872297 
+352119.224322  7387829.721124 
+352117.979141  7387842.109002 
+352117.814216  7387848.427920 
+352116.082508  7387858.156253 
+352113.295282  7387870.744097 
+352108.116649  7387879.002682 
+352102.616413  7387887.471232 
+352094.394921  7387893.150259 
+352088.111294  7387899.399189 
+352085.653917  7387909.667430 
+352082.932661  7387917.176144 
+352080.821626  7387924.014972 
+352076.352169  7387931.503689 
+352067.437993  7387935.403021 
+352051.225904  7387944.211513 
+352026.759338  7387962.118445 
+352006.885922  7387979.525464 
+351994.566053  7387987.044176 
+351983.755245  7387996.232602 
+351972.482647  7388000.551862 
+351950.852784  7388000.661843 
+351933.915027  7388010.460165 
+351917.810138  7388018.268827 
+351905.721164  7388023.127995 
+351891.842758  7388033.396236 
+351884.140778  7388038.085433 
+351858.090936  7388070.709845 
+351846.241102  7388082.107892 
+351829.328083  7388089.136688 
+351812.918084  7388097.385275 
+351760.818399  7388113.352540 
+351729.375522  7388123.890735 
+351722.506412  7388126.940213 
+351708.157970  7388133.419103 
+351688.705112  7388139.867998 
+351679.980600  7388144.987122 
+351659.670134  7388154.965412 
+351650.261185  7388157.305012 
+351639.475115  7388163.733910 
+351622.529111  7388174.302100 
+351611.462670  7388179.171266 
+351606.795303  7388186.879946 
+351611.710057  7388194.788591 
+351613.062438  7388202.107337 
+351598.697505  7388210.495901 
+351592.026304  7388213.855325 
+351585.693199  7388214.235260 
+351581.108295  7388213.415400 
+351576.119325  7388212.585543 
+351570.478903  7388215.525039 
+351565.729075  7388220.674157 
+351557.507583  7388226.133222 
+351552.559844  7388231.622282 
+351550.242653  7388238.131167 
+351549.516985  7388249.749177 
+351553.912226  7388259.207557 
+351558.373437  7388261.467170 
+351568.227682  7388265.776431 
+351564.137552  7388276.584580 
+351558.431160  7388286.492883 
+351552.262980  7388290.972116 
+351544.783649  7388293.111749 
+351535.325222  7388300.220532 
+351531.367031  7388308.259155 
+351525.372022  7388315.727875 
+351517.018590  7388323.946467 
+351514.932294  7388328.465693 
+351514.091178  7388331.225221 
+351515.369344  7388336.004402 
+351517.587580  7388338.573962 
+351521.001519  7388343.703083 
+351520.976781  7388346.252647 
+351517.554595  7388351.971667 
+351516.218706  7388352.961497 
+351516.177475  7388356.720854 
+351517.653550  7388362.609845 
+351522.114761  7388365.419364 
+351523.796992  7388370.308526 
+351522.065283  7388380.146841 
+351520.300590  7388382.566426 
+351515.361098  7388387.275620 
+351508.689897  7388390.974986 
+351501.845526  7388391.574883 
+351495.702084  7388393.724515 
+351488.511371  7388398.193750 
+351483.868743  7388403.122905 
+351482.656547  7388411.421484 
+351486.375597  7388417.550434 
+351487.909396  7388426.758857 
+351494.193024  7388431.588029 
+351500.682807  7388435.747317 
+351503.189661  7388439.646649 
+351504.830661  7388449.304995 
+351498.967591  7388473.380871 
+351497.013235  7388484.988882 
+351492.716948  7388496.016993 
+351489.962707  7388505.845310 
+351482.367929  7388520.062875 
+351470.402648  7388532.560734 
+351465.034352  7388534.570390 
+351438.910293  7388549.077905 
+351438.555705  7388553.387166 
+351437.656866  7388561.685745 
+351437.483696  7388568.324608 
+351442.076846  7388578.782816 
+351446.950368  7388581.052428 
+351448.310996  7388587.491325 
+351447.610067  7388596.229828 
+351441.466625  7388598.709403 
+351437.458957  7388610.967303 
+351435.776726  7388616.266396 
+351433.162671  7388622.545320 
+351431.562902  7388629.064204 
+351427.250123  7388641.312106 
+351420.752094  7388648.340902 
+351413.058360  7388652.470194 
+351410.831878  7388650.670503 
+351406.568577  7388648.300909 
+351406.824210  7388643.541724 
+351407.690064  7388638.012671 
+351407.351969  7388631.363810 
+351402.577401  7388629.544121 
+351399.196447  7388630.513955 
+351380.197131  7388632.423628 
+351361.461695  7388638.102655 
+351354.774002  7388643.791681 
+351349.578877  7388653.040097 
+351345.101174  7388661.628626 
+351342.017083  7388673.896524 
+351336.121028  7388691.443519 
+351331.626833  7388702.031705 
+351328.839607  7388715.069472 
+351320.939718  7388729.387019 
+351315.299296  7388742.174829 
+351304.810091  7388759.341888 
+351295.854684  7388767.330520 
+351284.400670  7388779.508434 
+351275.610188  7388790.716514 
+351269.483239  7388801.724628 
+351269.903796  7388810.263166 
+351272.262218  7388818.921683 
+351277.028540  7388831.929455 
+351281.918554  7388842.607626 
+351282.751424  7388851.696069 
+351283.196720  7388868.093260 
+351284.326454  7388877.181703 
+351288.523785  7388896.058470 
+351292.729363  7388903.957117 
+351295.054800  7388916.055045 
+351297.792548  7388927.273123 
+351301.660031  7388938.941124 
+351303.911251  7388968.306095 
+351306.772694  7388977.974438 
+351306.739709  7388990.822238 
+351305.824377  7389000.660552 
+351301.338428  7389010.478871 
+351294.502302  7389020.147215 
+351289.117514  7389028.175839 
+351275.799851  7389042.553377 
+351271.478826  7389046.492702 
+351254.351405  7389064.149677 
+351243.928170  7389076.117627 
+351237.900175  7389086.355874 
+351231.699010  7389093.824594 
+351228.961261  7389102.103176 
+351225.283442  7389112.581381 
+351222.710618  7389124.739299 
+351214.447895  7389134.397645 
+351205.904800  7389141.846369 
+351195.968092  7389155.254072 
+351194.747650  7389164.652462 
+351177.282134  7389206.225341 
+351169.761571  7389223.312414 
+351159.767140  7389243.039035 
+351156.270738  7389255.626879 
+351145.929965  7389278.442971 
+351139.547382  7389294.210270 
+351133.824498  7389315.086694 
+351132.826704  7389322.605406 
+351134.632629  7389335.803146 
+351134.212071  7389357.059505 
+351129.363287  7389361.998659 
+351123.384770  7389367.697682 
+351115.839469  7389377.146064 
+351110.372218  7389382.845088 
+351102.637254  7389391.073678 
+351097.879179  7389397.002663 
+351092.684053  7389405.811154 
+351088.387767  7389416.619303 
+351083.035964  7389421.328496 
+351073.338396  7389421.118532 
+351064.630377  7389425.017864 
+351061.010282  7389429.517093 
+351055.031764  7389435.216117 
+351051.411669  7389440.165269 
+351051.048835  7389445.254398 
+351045.226996  7389446.304218 
+351040.320489  7389446.474189 
+351038.094007  7389445.234401 
+351034.366710  7389439.875319 
+351032.173213  7389435.206119 
+351026.681223  7389433.376432 
+351024.133138  7389432.796532 
+351017.000149  7389431.726715 
+351014.089229  7389427.377460 
+351009.298169  7389426.777563 
+351004.721511  7389425.177837 
+351002.692938  7389423.388143 
+351000.977722  7389421.488468 
+350998.775979  7389417.699118 
+350994.694095  7389417.659124 
+350991.931607  7389418.069054 
+350990.034974  7389423.808071 
+350989.878296  7389428.907198 
+350988.806286  7389433.986328 
+350980.782704  7389440.665184 
+350966.879559  7389452.483159 
+350955.606961  7389457.352325 
+350943.485002  7389465.200981 
+350929.656074  7389470.260114 
+350912.330743  7389477.278912 
+350898.716216  7389481.348215 
+350890.338046  7389482.927944 
+350881.630026  7389486.047410 
+350877.836760  7389487.227208 
+350872.559173  7389494.705927 
+350868.600982  7389502.754548 
+350864.040816  7389522.891099 
+350855.852309  7389577.441755 
+350885.678926  7389595.798611 
+350887.971378  7389614.145468 
+350878.793323  7389639.391144 
+350899.450131  7389639.391144 
+350959.103363  7389602.677432 
+350968.165971  7389604.647095 
+350975.719518  7389606.286814 
+350973.163186  7389596.958412 
+350970.689317  7389589.069763 
+350971.703604  7389579.881337 
+350971.761327  7389574.122324 
+350974.482583  7389568.063362 
+350979.850880  7389561.584471 
+350981.821729  7389559.054905 
+350984.427538  7389553.435867 
+350989.705125  7389546.067129 
+350996.780391  7389542.597724 
+351004.243230  7389541.567900 
+351014.757174  7389541.447921 
+351025.584475  7389540.568071 
+351034.482158  7389538.778378 
+351046.554639  7389535.688907 
+351065.809588  7389528.910068 
+351075.416446  7389528.010222 
+351082.623652  7389532.069527 
+351087.563144  7389537.768551 
+351090.581265  7389542.007825 
+351098.200782  7389545.517223 
+351106.133656  7389547.916812 
+351112.738886  7389551.316230 
+351118.519494  7389555.025595 
+351122.964212  7389559.274867 
+351124.547489  7389564.274011 
+351125.001031  7389569.373137 
+351122.725072  7389582.200940 
+351121.702539  7389586.310236 
+351119.756429  7389593.578991 
+351118.783373  7389599.108044 
+351118.907067  7389606.416792 
+351121.479891  7389614.525403 
+351125.767931  7389624.203745 
+351133.041106  7389632.142385 
+351140.198834  7389640.191007 
+351156.188276  7389653.858666 
+351174.395953  7389670.105883 
+351193.890042  7389689.462567 
+351208.024082  7389704.559981 
+351219.626528  7389717.737724 
+351248.999602  7389750.492113 
+351262.919239  7389766.249414 
+351273.837248  7389776.767612 
+351292.234589  7389793.784698 
+351310.326819  7389811.691630 
+351317.459808  7389822.729739 
+351332.088622  7389838.936963 
+351348.069817  7389853.604451 
+351358.798163  7389862.572915 
+351367.176333  7389871.071459 
+351380.395041  7389886.158875 
+351386.357065  7389891.977878 
+351395.287733  7389896.717066 
+351401.563115  7389902.546068 
+351407.846743  7389906.485393 
+351413.198546  7389912.294398 
+351418.063822  7389915.673819 
+351427.225385  7389918.083406 
+351440.773942  7389920.113059 
+351456.870584  7389923.042557 
+351467.161880  7389925.032216 
+351473.791849  7389925.092206 
+351481.559798  7389923.732439 
+351491.389305  7389921.062896 
+351511.642048  7389916.623656 
+351521.257153  7389914.614001 
+351529.008609  7389914.913949 
+351534.294443  7389916.853617 
+351542.515935  7389921.802769 
+351565.242547  7389944.848822 
+351572.928034  7389952.237556 
+351584.522234  7389965.865222 
+351598.491349  7389977.413244 
+351611.470916  7389985.961779 
+351617.053614  7389988.571332 
+351622.446649  7389990.281039 
+351627.138754  7389990.331031 
+351634.708794  7389988.751301 
+351651.382672  7389984.931956 
+351665.698129  7389982.532367 
+351679.263178  7389983.332230 
+351687.212544  7389984.412045 
+351693.314755  7389986.571675 
+351700.835317  7389989.861111 
+351705.906749  7389992.790610 
+351709.650538  7389995.600128 
+351713.113955  7389996.519971 
+351718.836839  7389996.140036 
+351723.941256  7389995.750103 
+351726.299678  7389994.330346 
+351728.880748  7389992.030740 
+351732.500843  7389986.971606 
+351738.916411  7389978.403074 
+351745.472164  7389975.693538 
+351753.454515  7389973.893846 
+351759.383555  7389973.183968 
+351764.487972  7389973.233959 
+351773.130022  7389975.753528 
+351778.729212  7389977.583214 
+351785.705523  7389984.192082 
+351792.978699  7389991.570819 
+351799.641653  7389998.399649 
+351805.727371  7390002.668918 
+351815.779526  7390007.418104 
+351827.843762  7390015.626698 
+351837.656776  7390023.695316 
+351842.010786  7390027.504663 
+351850.248771  7390030.364174 
+351862.156328  7390034.023547 
+351869.874799  7390037.532946 
+351885.006633  7390045.221629 
+351895.075280  7390048.531062 
+351902.505134  7390050.710688 
+351910.965767  7390051.690521 
+351925.751258  7390053.050288 
+351928.794117  7390054.520036 
+351930.806198  7390057.539519 
+351933.403760  7390062.658642 
+351936.817700  7390068.777594 
+351940.330594  7390074.136676 
+351944.461956  7390079.825701 
+351948.914920  7390083.185126 
+351953.293669  7390084.344927 
+351959.404126  7390085.844670 
+351966.438160  7390086.574545 
+351973.892753  7390086.434569 
+351983.087300  7390085.084800 
+351991.580918  7390083.065146 
+352001.600088  7390081.615395 
+352010.052474  7390083.035152 
+352014.925997  7390085.854669 
+352019.585117  7390089.444054 
+352025.637850  7390096.042923 
+352028.878619  7390098.622482 
+352033.150166  7390099.882266 
+352039.672935  7390101.052065 
+352050.871316  7390103.711610 
+352064.716737  7390107.400978 
+352076.649033  7390108.180844 
+352086.429062  7390109.940543 
+352094.658801  7390113.349959 
+352100.447655  7390116.399437 
+352104.686217  7390121.088633 
+352106.467403  7390126.977625 
+352109.980297  7390132.326708 
+352114.350799  7390134.476340 
+352119.760327  7390134.316368 
+352126.093432  7390133.936433 
+352132.640939  7390132.336707 
+352144.202154  7390129.907123 
+352164.141540  7390126.127770 
+352179.834117  7390128.167421 
+352188.105086  7390128.247407 
+352195.155614  7390126.877642 
+352198.858171  7390124.148109 
+352200.334246  7390119.508904 
+352196.705905  7390105.191356 
+352195.452478  7390097.982591 
+352196.846091  7390091.233747 
+352199.039588  7390085.944653 
+352201.224839  7390082.205294 
+352204.721241  7390079.245801 
+352211.309979  7390073.446794 
+352213.280829  7390070.477303 
+352214.765150  7390065.058231 
+352216.909170  7390055.119933 
+352218.583155  7390051.150613 
+352220.949823  7390048.841009 
+352225.254355  7390047.451247 
+352230.152616  7390047.051315 
+352236.477475  7390047.781190 
+352254.025454  7390047.961159 
+352267.722443  7390045.991497 
+352277.774598  7390041.442276 
+352285.789935  7390035.663266 
+352291.529311  7390033.613617 
+352298.052080  7390034.233511 
+352305.778798  7390037.083023 
+352314.396109  7390043.481927 
+352319.945822  7390049.290932 
+352326.946872  7390053.350236 
+352335.811570  7390055.099937 
+352351.726795  7390055.479871 
+352370.693125  7390057.339553 
+352401.880370  7390061.418854 
+352449.708507  7390065.558145 
+352473.729777  7390071.887061 
+352498.031419  7390080.775539 
+352521.599146  7390092.193583 
+352537.003105  7390102.651791 
+352547.954099  7390109.960539 
+352558.418566  7390114.489764 
+352576.725198  7390120.548726 
+352589.317192  7390127.207585 
+352600.499081  7390131.416864 
+352608.951467  7390133.606489 
+352615.680392  7390134.006421 
+352622.524763  7390133.746465 
+352627.950783  7390132.026760 
+352640.699455  7390122.748349 
+Region 1
+198
+328374.697948  7391220.110381 
+328479.062243  7391217.660800 
+328563.718047  7391213.771467 
+328586.873462  7391215.191223 
+328609.220747  7391216.231045 
+328632.689520  7391217.620807 
+328669.344015  7391225.689425 
+328695.096993  7391231.858369 
+328708.323947  7391235.887678 
+328727.727328  7391243.876310 
+328762.509929  7391263.442958 
+328836.091045  7391317.683667 
+328856.286064  7391328.221862 
+328952.181480  7391391.311056 
+329044.786650  7391455.140122 
+329121.385887  7391503.891772 
+329192.476641  7391554.113169 
+329212.440766  7391567.450885 
+329255.156240  7391597.045815 
+329276.538716  7391602.834824 
+329302.448373  7391606.634173 
+329321.596121  7391607.574012 
+329340.677898  7391609.233728 
+329370.933319  7391606.264236 
+329404.709879  7391607.214073 
+329417.235904  7391609.463688 
+329439.418264  7391615.922582 
+329470.308644  7391628.130491 
+329472.856729  7391593.276461 
+329474.926533  7391573.469854 
+329485.481708  7391517.889374 
+329503.978004  7391411.327627 
+329521.756877  7391313.744342 
+329527.215882  7391291.428165 
+329543.898006  7391183.196704 
+329547.419147  7391152.122027 
+329558.535066  7391100.580855 
+329558.765960  7391099.081112 
+329586.671205  7390947.337104 
+329588.922426  7390912.033152 
+329591.313833  7390864.321324 
+329583.422190  7390823.248360 
+329532.287314  7390699.719519 
+329530.547359  7390695.370264 
+329511.952109  7390647.118529 
+329493.447567  7390599.246729 
+329474.662654  7390546.525760 
+329468.123393  7390520.980136 
+329462.548941  7390502.603283 
+329460.850218  7390496.864266 
+329446.889349  7390442.423592 
+329436.779470  7390407.749531 
+329424.756466  7390370.725873 
+329404.033688  7390283.320844 
+329372.277454  7390162.451548 
+329365.482560  7390131.796799 
+329360.493591  7390113.799882 
+329357.467224  7390103.261687 
+329353.459556  7390068.967561 
+329344.891722  7389999.999375 
+329343.951652  7389978.463064 
+329337.321682  7389930.331308 
+329330.823653  7389873.611024 
+329328.992989  7389856.913884 
+329321.340487  7389748.372476 
+329315.873237  7389695.391551 
+329308.962895  7389631.062570 
+329304.221313  7389600.217854 
+329279.738254  7389518.331880 
+329255.345904  7389427.987355 
+329238.474116  7389374.726478 
+329234.128352  7389362.398590 
+329226.236709  7389313.546958 
+329224.958544  7389292.110630 
+329223.804071  7389267.674815 
+329226.640775  7389247.018354 
+329226.682006  7389231.930938 
+329229.452739  7389149.984975 
+329228.430207  7389063.709753 
+329224.603956  7389003.320097 
+329216.481419  7388942.070588 
+329207.212655  7388865.033784 
+329198.026354  7388826.670355 
+329173.427848  7388746.374109 
+329163.746774  7388720.938466 
+329134.142806  7388619.945765 
+329130.357786  7388609.337583 
+329111.119330  7388543.218908 
+329097.075999  7388502.625861 
+329088.912230  7388478.939919 
+329055.539735  7388390.215116 
+329012.906723  7388275.254808 
+328986.312629  7388192.758939 
+328960.468942  7388116.581987 
+328929.636285  7387999.342069 
+328923.113517  7387969.287217 
+328910.711186  7387936.482836 
+328887.242414  7387852.937147 
+328849.491170  7387736.157150 
+328817.396840  7387632.704871 
+328813.446896  7387623.056524 
+328803.435972  7387598.610711 
+328788.295892  7387567.316071 
+328760.959638  7387523.133639 
+328702.716511  7387423.980623 
+328666.828915  7387377.298620 
+328638.033077  7387326.757277 
+328577.736639  7387228.914037 
+328526.074004  7387145.348351 
+328513.836598  7387125.711714 
+328457.770475  7387042.865905 
+328439.076271  7387008.751748 
+328421.676724  7386987.615369 
+328389.293776  7386938.503781 
+328382.738023  7386930.095222 
+328374.046496  7386909.598732 
+328330.729046  7386841.340424 
+328306.880947  7386804.066809 
+328296.738083  7386789.989220 
+328241.199720  7386687.776729 
+328211.430827  7386641.564644 
+328178.379935  7386588.683702 
+328128.993260  7386509.677235 
+328025.865899  7386341.556033 
+327991.000836  7386281.996235 
+327884.583229  7386123.873320 
+327838.288891  7386174.204699 
+327814.317098  7386188.692217 
+327793.099547  7386197.130772 
+327770.298719  7386203.059756 
+327742.583138  7386202.979770 
+327718.924702  7386193.261435 
+327699.026547  7386200.110261 
+327615.162382  7386198.190590 
+327550.627381  7386191.981654 
+327490.759746  7386188.902181 
+327460.586788  7386194.431234 
+327449.850196  7386192.871501 
+327415.257258  7386206.799116 
+327376.351542  7386222.096495 
+327327.335947  7386242.383020 
+327253.977479  7386281.536314 
+327176.561866  7386321.019551 
+327127.026759  7386347.694981 
+327067.678637  7386380.759318 
+327000.702751  7386416.073269 
+326979.559416  7386434.350138 
+326962.836060  7386453.616838 
+326924.392133  7386496.289529 
+326854.233202  7386589.153622 
+326763.062876  7386705.723654 
+326706.543212  7386745.806789 
+326616.106800  7386772.642192 
+326560.436497  7386791.488964 
+326475.186965  7386824.303343 
+326512.962947  7387026.518705 
+326538.542755  7387161.385604 
+326584.243365  7387461.304230 
+326617.929217  7387624.406292 
+326633.341422  7387701.123151 
+326682.670374  7387922.005316 
+326705.322769  7388085.307344 
+326728.527663  7388202.547262 
+326765.190404  7388338.873911 
+326817.735386  7388511.764296 
+326844.172801  7388598.099508 
+326938.171584  7388890.539415 
+327007.431675  7389127.458833 
+327107.623378  7389441.205091 
+327122.384131  7389496.095689 
+327144.277873  7389577.651719 
+327186.704730  7389699.290883 
+327212.903004  7389782.366653 
+327244.354128  7389902.246119 
+327270.643111  7389992.270699 
+327326.197967  7390145.214501 
+327376.128894  7390317.035069 
+327394.386049  7390396.111524 
+327404.850515  7390434.334977 
+327406.870842  7390496.824273 
+327403.588842  7390517.900663 
+327509.437459  7390521.899978 
+327534.918311  7390520.920146 
+327587.364338  7390541.876556 
+327606.404885  7390557.643855 
+327652.039525  7390618.353456 
+327684.678106  7390648.008377 
+327697.426779  7390658.606561 
+327867.389838  7390845.074621 
+327944.912653  7390923.891121 
+328000.046951  7390984.240783 
+328016.572397  7391002.267695 
+328038.861959  7391025.233761 
+328140.397796  7391133.435227 
+328228.096459  7391227.759071 
+328304.390585  7391222.739930 
+328311.861670  7391223.599783 
+328374.697948  7391220.110381 
+Region 1
+511
+360200.142783  7400752.597552 
+360204.232913  7400745.178823 
+360215.348832  7400730.441347 
+360229.977645  7400717.523560 
+360244.895077  7400702.586119 
+360253.718543  7400687.818648 
+360263.886146  7400668.022039 
+360270.582085  7400660.293363 
+360282.984416  7400643.556230 
+360292.813923  7400629.818583 
+360307.912771  7400601.253476 
+360325.031946  7400573.978148 
+360337.970282  7400554.981402 
+360345.680508  7400547.772637 
+360366.320823  7400540.493884 
+360418.956513  7400475.105084 
+360424.555704  7400454.988530 
+360441.320291  7400429.092965 
+360447.793582  7400414.265505 
+360451.949682  7400403.447358 
+360454.398812  7400384.540597 
+360459.923787  7400362.134435 
+360469.035872  7400335.958919 
+360483.013233  7400303.784430 
+360500.800352  7400272.139850 
+360520.319180  7400244.304618 
+360554.953349  7400199.682261 
+360583.213181  7400158.799264 
+360599.326316  7400143.551876 
+360607.894150  7400121.665625 
+360615.719823  7400096.999850 
+360623.825867  7400069.814507 
+360631.057812  7400026.221974 
+360634.554213  7400003.535860 
+360634.273842  7399978.300182 
+360634.232610  7399954.574246 
+360634.463505  7399928.328742 
+360633.135862  7399907.122374 
+360628.245847  7399886.125971 
+360623.355832  7399866.149393 
+360621.772556  7399844.933027 
+360616.198104  7399815.108136 
+360618.366863  7399800.230684 
+360608.644557  7399752.698826 
+360599.977768  7399700.887700 
+360592.844779  7399647.066919 
+360589.018528  7399621.041377 
+360583.650232  7399597.275448 
+360578.578800  7399569.210256 
+360574.299006  7399559.731879 
+360569.854288  7399550.283498 
+360567.627805  7399540.275212 
+360564.024203  7399523.148146 
+360562.754283  7399512.599952 
+360557.418972  7399467.317709 
+360557.633374  7399442.841901 
+360556.751027  7399428.694325 
+360560.197952  7399411.317301 
+360561.311193  7399400.729115 
+360562.003876  7399379.532746 
+360563.298534  7399347.998147 
+360561.187499  7399328.801435 
+360561.500856  7399293.977401 
+360560.189705  7399270.241466 
+360559.167173  7399258.323508 
+360557.905500  7399241.696356 
+360556.272746  7399226.288995 
+360553.328842  7399214.910944 
+360551.184822  7399199.493585 
+360552.248585  7399193.954534 
+360557.179831  7399181.126731 
+360561.278208  7399176.367546 
+360562.111077  7399168.548885 
+360562.927454  7399162.499921 
+360555.951143  7399148.052396 
+360543.590043  7399141.133581 
+360533.768782  7399133.214938 
+360521.110818  7399130.585388 
+360494.500232  7399128.835688 
+360476.960499  7399133.474893 
+360457.919953  7399135.324576 
+360437.089974  7399138.674003 
+360420.341880  7399140.033770 
+360401.540474  7399144.163062 
+360357.035567  7399158.150666 
+360324.998961  7399167.209115 
+360305.702781  7399170.058627 
+360290.199868  7399172.958130 
+360270.631562  7399177.577339 
+360249.282071  7399182.936421 
+360228.179967  7399188.555458 
+360210.401094  7399192.184837 
+360199.450100  7399197.383946 
+360179.098402  7399204.022809 
+360169.681207  7399207.722175 
+360153.419640  7399211.871465 
+360126.256556  7399214.151074 
+360102.862000  7399221.519812 
+360094.137488  7399220.979904 
+360074.222841  7399219.750115 
+360058.249892  7399218.850269 
+360042.796456  7399217.200552 
+360022.040693  7399212.221405 
+360006.603750  7399208.801990 
+359989.913379  7399203.612879 
+359968.143330  7399199.373605 
+359950.653075  7399197.963847 
+359933.426699  7399196.044176 
+359913.899625  7399195.864206 
+359899.204842  7399194.224487 
+359891.107043  7399192.134845 
+359873.600296  7399193.494612 
+359862.929673  7399195.664241 
+359848.680186  7399200.593396 
+359839.988659  7399208.592026 
+359824.221866  7399213.501185 
+359812.363787  7399207.102281 
+359795.087934  7399209.201922 
+359782.825789  7399191.424967 
+359774.851684  7399175.707659 
+359766.415790  7399154.691259 
+359752.421936  7399131.095301 
+359741.611128  7399120.147176 
+359725.984521  7399109.658973 
+359707.042929  7399100.150601 
+359691.886357  7399093.451749 
+359667.370313  7399084.913211 
+359651.182963  7399079.974057 
+359634.236959  7399074.774948 
+359614.841824  7399059.457572 
+359605.820448  7399047.519616 
+359602.159121  7399031.332389 
+359604.542282  7399020.504244 
+359621.430562  7399003.497157 
+359632.637190  7398997.538178 
+359652.584822  7398979.541261 
+359678.395524  7398956.805155 
+359694.022131  7398939.778072 
+359708.395311  7398920.471379 
+359718.975225  7398900.124864 
+359724.467214  7398880.998140 
+359726.998807  7398853.502850 
+359722.199501  7398822.428173 
+359712.295778  7398796.092684 
+359703.076492  7398776.825984 
+359687.359176  7398748.170892 
+359675.105278  7398728.884196 
+359652.964148  7398708.747645 
+359635.581094  7398695.469919 
+359614.751116  7398692.730389 
+359598.885368  7398703.408560 
+359586.581992  7398714.626638 
+359573.000450  7398725.834718 
+359542.547120  7398747.201058 
+359528.231664  7398755.629615 
+359513.973931  7398757.999209 
+359501.538615  7398757.109361 
+359486.060440  7398754.419822 
+359472.132556  7398749.480668 
+359455.186552  7398741.482038 
+359439.518714  7398732.993492 
+359420.321489  7398721.695427 
+359402.369445  7398712.926929 
+359363.686377  7398693.350282 
+359350.055358  7398684.121863 
+359341.231891  7398676.963089 
+359325.300174  7398668.724501 
+359321.028626  7398664.645199 
+359303.521878  7398661.935664 
+359294.879829  7398662.095636 
+359278.601769  7398662.935492 
+359260.039504  7398664.755181 
+359238.426134  7398666.034961 
+359210.974432  7398666.754838 
+359186.103800  7398663.215444 
+359156.673003  7398658.616232 
+359139.141517  7398658.426265 
+359126.458814  7398643.298856 
+359101.810831  7398629.211269 
+359088.600369  7398618.653077 
+359072.544958  7398609.544638 
+359052.531356  7398604.035581 
+359030.497428  7398574.630618 
+359011.127032  7398560.543031 
+358997.924817  7398544.695746 
+358975.033281  7398527.968611 
+358963.117477  7398524.639181 
+358942.749288  7398502.992889 
+358931.930233  7398492.024768 
+358926.149625  7398485.655859 
+358915.858329  7398473.187994 
+358903.530215  7398460.700133 
+358895.267492  7398448.502223 
+358888.019055  7398436.574266 
+358872.524387  7398410.428744 
+358861.284775  7398390.892091 
+358852.312876  7398372.885175 
+358843.093590  7398355.128217 
+358834.641204  7398335.871515 
+358829.676973  7398323.963555 
+358826.526913  7398309.046110 
+358832.348752  7398285.650118 
+358834.954561  7398271.782493 
+358828.571978  7398269.252927 
+358819.105305  7398267.603209 
+358809.094381  7398268.263096 
+358793.137925  7398266.063473 
+358785.757549  7398261.104322 
+358781.246860  7398254.175509 
+358775.845579  7398244.437177 
+358764.267872  7398232.719184 
+358757.720364  7398227.100147 
+358752.681917  7398222.750892 
+358746.851832  7398221.181161 
+358727.555653  7398219.971368 
+358716.645890  7398218.081692 
+358708.028578  7398215.472139 
+358700.450293  7398211.352844 
+358691.610333  7398205.963767 
+358686.093605  7398198.595030 
+358682.143660  7398186.697068 
+358676.618686  7398180.578116 
+358659.425295  7398171.419684 
+358654.584758  7398168.120250 
+358646.882778  7398159.641702 
+358644.458386  7398157.332098 
+358642.372090  7398153.372776 
+358639.180799  7398147.423795 
+358638.521100  7398143.464473 
+358638.298452  7398135.105905 
+358637.531553  7398130.586679 
+358635.989508  7398126.847319 
+358631.990086  7398120.328436 
+358626.456865  7398114.719397 
+358622.193564  7398108.870399 
+358614.400876  7398100.211882 
+358606.113414  7398090.543538 
+358591.517586  7398076.265983 
+358577.927798  7398062.748299 
+358567.372622  7398051.540219 
+358555.283648  7398040.822055 
+358539.549840  7398038.132515 
+358524.244836  7398044.271464 
+358513.029962  7398047.680880 
+358488.967461  7398065.087898 
+358477.216583  7398071.266840 
+358469.860945  7398070.177026 
+358464.302985  7398066.847597 
+358446.524112  7398120.768361 
+358281.723193  7398090.663517 
+358267.473706  7398092.253245 
+358194.733706  7398165.740657 
+358179.519410  7398174.649131 
+358154.953889  7398171.479674 
+358147.029261  7398159.601709 
+358141.487794  7398144.544288 
+358134.346559  7398124.737681 
+358128.013453  7398111.269988 
+358115.338997  7398097.792296 
+358099.168139  7398089.283754 
+358012.970290  7398058.219075 
+357992.527884  7398054.219760 
+357957.662821  7398052.630032 
+357872.099932  7398051.050303 
+357819.010699  7398051.840167 
+357768.296380  7398052.630032 
+357708.090650  7398055.009624 
+357620.136354  7398057.389217 
+357587.646205  7398055.799489 
+357560.714016  7398044.711388 
+357512.382858  7398018.565867 
+357478.779468  7398013.126799 
+357448.309646  7397975.643219 
+357442.059003  7397952.217232 
+357440.500466  7397927.211515 
+357443.634033  7397905.345261 
+357482.679936  7397756.920684 
+357491.552880  7397728.695519 
+357413.832156  7397706.869258 
+357362.779742  7397676.664432 
+357215.262922  7398052.630032 
+357200.213551  7398185.747230 
+357201.582425  7398233.219099 
+357191.909597  7398268.283093 
+357182.277999  7398292.278982 
+357171.920734  7398312.845460 
+357158.133036  7398332.642069 
+357144.741157  7398350.529005 
+357120.983767  7398376.694523 
+357017.782190  7398499.293523 
+356968.576932  7398531.178061 
+356926.150075  7398576.070371 
+356901.287690  7398607.265028 
+356885.603359  7398627.821507 
+356872.557822  7398650.667594 
+356861.812984  7398671.614006 
+356853.319366  7398695.999829 
+356849.839457  7398708.187741 
+356852.148402  7398724.534941 
+356855.323200  7398746.371200 
+356871.197194  7398797.612423 
+356879.179546  7398827.447313 
+356883.335646  7398843.384583 
+356893.503248  7398868.720243 
+356906.243675  7398890.796462 
+356919.256227  7398910.353112 
+356927.024176  7398921.791153 
+356932.433703  7398939.508118 
+356937.109316  7398954.435561 
+356937.942185  7398972.862405 
+356935.476562  7398990.989300 
+356933.761346  7399009.636106 
+356935.872381  7399027.573033 
+356941.051014  7399043.010389 
+356943.648577  7399063.216928 
+356947.004793  7399083.183508 
+356945.602933  7399096.031307 
+356942.180748  7399108.609152 
+356930.108266  7399131.805179 
+356927.147869  7399137.704169 
+356910.177127  7399157.200829 
+356892.002434  7399170.628529 
+356872.285697  7399185.805929 
+356850.796020  7399199.953506 
+356831.318423  7399216.900603 
+356814.388911  7399232.617911 
+356802.588555  7399243.845988 
+356788.198883  7399259.833249 
+356765.678427  7399275.740524 
+356746.951237  7399293.447491 
+356729.444490  7399315.713677 
+356718.312078  7399336.780069 
+356706.635416  7399360.875941 
+356697.160497  7399393.560343 
+356691.899401  7399411.417284 
+356684.700442  7399444.631595 
+356679.365131  7399470.057240 
+356670.953976  7399498.212417 
+356669.189282  7399520.128663 
+356668.917157  7399523.668057 
+356664.126097  7399545.814263 
+356653.381258  7399578.238709 
+356646.982183  7399600.624875 
+356626.803657  7399644.047437 
+356610.195748  7399678.431547 
+356599.516879  7399704.297116 
+356586.520820  7399745.580045 
+356581.589574  7399769.685916 
+356575.305946  7399788.282730 
+356570.185037  7399817.487728 
+356562.342872  7399839.104025 
+356554.253319  7399860.460367 
+356543.863069  7399882.796541 
+356537.760858  7399908.202189 
+356528.624035  7399932.578014 
+356522.579548  7399952.944525 
+356514.127161  7399984.889054 
+356506.045855  7400005.485526 
+356485.677665  7400034.530550 
+356467.667898  7400056.536781 
+356450.202381  7400077.003275 
+356433.470779  7400097.039843 
+356425.719322  7400109.317740 
+356412.451137  7400140.702364 
+356408.410484  7400168.917531 
+356404.798635  7400194.093219 
+356403.347299  7400212.240110 
+356397.979002  7400240.435281 
+356392.421043  7400263.081402 
+356379.235320  7400286.917319 
+356370.659240  7400304.724269 
+356348.509865  7400337.868591 
+356337.855735  7400358.105125 
+356327.778841  7400374.392335 
+356313.067565  7400414.495466 
+356311.698691  7400440.491013 
+356308.763033  7400476.574832 
+356308.622847  7400511.908780 
+356314.065359  7400547.272722 
+356321.536444  7400585.156233 
+356330.021816  7400621.530003 
+356340.791393  7400657.663813 
+356349.771538  7400698.586804 
+356358.281648  7400728.901611 
+356369.092456  7400755.437066 
+356376.629511  7400775.663601 
+356403.033942  7400810.757590 
+356416.244403  7400834.603505 
+356426.816071  7400857.349609 
+356438.129899  7400884.904889 
+356447.662542  7400913.709955 
+356465.441415  7400975.609352 
+356471.378701  7400998.455439 
+356477.447927  7401019.821779 
+356484.267560  7401027.920392 
+356492.093233  7401039.558398 
+356497.337836  7401061.534634 
+356501.015654  7401093.349184 
+357046.808922  7401127.353360 
+357338.387392  7401144.500423 
+357401.693704  7401161.747468 
+357445.456450  7401181.944009 
+357516.844069  7401226.606359 
+357576.678719  7401300.513699 
+357707.249535  7401412.134579 
+358069.176598  7401832.972494 
+358127.353755  7401904.070315 
+358186.165872  7401945.723180 
+358248.276481  7401982.366904 
+358283.496132  7402010.452093 
+358351.981078  7402049.375426 
+358393.641035  7402072.261506 
+358439.778696  7402095.147585 
+358480.811939  7402119.133477 
+358523.576891  7402143.569291 
+358564.799798  7402164.825650 
+358591.929897  7402179.033217 
+358646.899271  7402210.497827 
+358692.121600  7402234.173771 
+358734.268084  7402258.919533 
+358780.216082  7402284.505150 
+358828.778134  7402312.430367 
+358872.491403  7402335.306448 
+358917.656008  7402361.651936 
+358962.523749  7402388.397354 
+359009.898344  7402414.352908 
+359057.602788  7402437.518940 
+359087.957163  7402451.566534 
+359131.703417  7402472.173004 
+359176.727836  7402484.800841 
+359242.161676  7402503.897570 
+359253.566213  7402508.076854 
+359268.186780  7402470.003376 
+359279.682026  7402451.106613 
+359290.146492  7402435.489288 
+359302.185989  7402406.754210 
+359311.042441  7402385.007935 
+359327.023636  7402350.793796 
+359340.357791  7402315.749798 
+359353.708438  7402277.176406 
+359368.823779  7402241.122581 
+359376.006246  7402220.696080 
+359391.377220  7402185.412124 
+359401.363405  7402169.844790 
+359414.202786  7402149.858214 
+359417.427062  7402144.599115 
+359434.513252  7402122.692867 
+359441.926614  7402109.335155 
+359458.501537  7402088.438735 
+359469.477270  7402073.071367 
+359478.927451  7402057.204085 
+359481.492028  7402051.155121 
+359490.191802  7402034.268014 
+359501.390183  7402024.459694 
+359508.275785  7402017.920814 
+359517.956860  7402007.092668 
+359532.041422  7401976.087979 
+359538.951763  7401960.710613 
+359548.410190  7401942.823677 
+359557.357350  7401927.196354 
+359562.742139  7401912.578858 
+359585.509982  7401880.634330 
+359595.644599  7401862.857375 
+359617.645542  7401830.602900 
+359628.274934  7401814.095727 
+359641.402933  7401800.148116 
+359662.579253  7401772.422865 
+359675.781469  7401752.676248 
+359685.676945  7401734.129425 
+359695.869286  7401712.313161 
+359701.410753  7401696.745828 
+359715.264421  7401666.650983 
+359726.941083  7401647.124328 
+359748.257590  7401609.310805 
+359762.103011  7401580.225787 
+359779.683975  7401555.739981 
+359798.213255  7401536.313309 
+359820.139982  7401509.617881 
+359839.980413  7401486.421855 
+359857.849995  7401459.416480 
+359870.178110  7401438.220111 
+359885.615054  7401414.124239 
+359900.194389  7401386.818916 
+359913.338881  7401371.601522 
+359925.172222  7401359.153655 
+359940.097899  7401343.206386 
+359953.563994  7401323.209811 
+359966.856918  7401296.894319 
+359973.231254  7401276.277850 
+359983.712213  7401252.201974 
+359986.664364  7401240.374000 
+360005.119428  7401207.819577 
+360024.250683  7401180.834199 
+360042.549069  7401160.137744 
+360063.997515  7401130.662793 
+360091.069890  7401094.129051 
+360101.996146  7401078.441738 
+360113.944934  7401057.915254 
+360132.334028  7401030.409965 
+360144.530203  7401010.133439 
+360153.180499  7400989.806920 
+360159.134278  7400962.631575 
+360164.873654  7400932.926663 
+360165.351936  7400898.352586 
+360166.910473  7400877.176213 
+360168.972031  7400856.499755 
+360173.862046  7400832.843807 
+360177.498634  7400808.407992 
+360180.475523  7400794.820320 
+360186.528256  7400779.003029 
+360200.142783  7400752.597552 
+Region 1
+309
+352533.638643  7397733.664668 
+352562.261310  7397751.121678 
+352590.273755  7397768.678670 
+352651.881344  7397811.391354 
+352673.610162  7397878.929785 
+352672.538152  7397904.285442 
+352667.590414  7397961.275680 
+352636.807235  7398005.008189 
+352612.200482  7398043.091666 
+352594.743212  7398072.456636 
+352592.368298  7398093.093101 
+352589.828459  7398100.141894 
+352590.933453  7398105.111043 
+352587.750408  7398121.518232 
+352588.179212  7398148.033690 
+352595.213247  7398195.295595 
+352595.823468  7398215.932060 
+352604.119176  7398285.270183 
+352623.926622  7398489.635177 
+352629.987602  7398546.215485 
+352634.580752  7398595.906974 
+352631.249275  7398647.788087 
+352612.010819  7398748.190889 
+352611.582015  7398754.679777 
+352610.262618  7398777.205919 
+352611.301643  7398792.113365 
+352613.000367  7398823.168046 
+352615.383527  7398847.763833 
+352618.179000  7398891.476345 
+352623.101999  7398898.765097 
+352619.539628  7398913.272612 
+352559.540053  7398911.352941 
+352481.646159  7398899.764926 
+352458.936040  7398897.365337 
+352425.110001  7398895.185710 
+352364.739347  7398891.356366 
+352345.731785  7398890.296547 
+352303.511084  7398886.657171 
+352289.129658  7398884.987457 
+352253.753329  7398881.448063 
+352184.443760  7398874.529248 
+352154.699606  7398872.609577 
+352044.010452  7398860.461658 
+351960.377181  7398859.131886 
+351852.739132  7398841.814852 
+351843.346675  7398840.795027 
+351816.233069  7398838.645395 
+351789.276141  7398836.265802 
+351690.849132  7398794.203007 
+351639.747241  7398770.517065 
+351580.300164  7398746.451187 
+351546.218493  7398729.334119 
+351521.628233  7398720.465638 
+351473.989759  7398701.448895 
+351465.578603  7398699.569217 
+351459.476393  7398699.429241 
+351452.137247  7398699.269269 
+351441.161514  7398695.499914 
+351380.782614  7398693.580243 
+351314.268517  7398692.770382 
+351210.539182  7398692.970348 
+351202.853695  7398693.040336 
+351138.038322  7398693.530252 
+351111.089640  7398692.180483 
+351076.678120  7398691.450608 
+351018.030927  7398690.840712 
+350954.592675  7398689.290978 
+350923.586848  7398688.651087 
+350892.572774  7398688.271153 
+350826.157633  7398688.451122 
+350774.536229  7398689.640918 
+350713.398675  7398686.571444 
+350651.189111  7398681.572300 
+350583.141216  7398677.273036 
+350521.203777  7398664.465230 
+350397.271177  7398641.129227 
+350314.866594  7398627.171618 
+350217.800213  7398611.154362 
+350183.858728  7398600.996102 
+350151.079961  7398588.558232 
+350062.169102  7398430.395324 
+350026.817511  7398374.024980 
+350010.861055  7398344.300072 
+350004.066161  7398328.832721 
+349997.048619  7398316.354858 
+349982.997042  7398298.447926 
+349965.556264  7398280.710964 
+349950.770772  7398268.373077 
+349935.869833  7398261.124319 
+349915.823247  7398250.956061 
+349891.216494  7398239.967943 
+349860.961074  7398228.009991 
+349850.950150  7398223.160822 
+349836.453277  7398223.350789 
+349820.397866  7398224.400609 
+349799.823520  7398231.979311 
+349786.208993  7398232.249265 
+349775.662064  7398234.688847 
+349745.992127  7398240.137914 
+349725.186887  7398247.676622 
+349706.187571  7398250.226186 
+349681.011829  7398252.985713 
+349661.088936  7398256.055187 
+349648.686605  7398258.074841 
+349630.008892  7398259.754554 
+349588.736508  7398262.134146 
+349566.183067  7398264.023822 
+349544.314064  7398266.893331 
+349526.543437  7398269.342911 
+349515.971769  7398273.662171 
+349504.666187  7398280.301034 
+349496.015891  7398288.069703 
+349490.812519  7398296.988176 
+349479.003917  7398313.485350 
+349455.782531  7398357.317842 
+349432.750809  7398440.303627 
+349419.078559  7398461.789947 
+349410.296323  7398471.548275 
+349395.651017  7398483.266268 
+349382.960069  7398489.125264 
+349369.287818  7398494.984261 
+349358.551226  7398498.883593 
+349348.787689  7398502.792923 
+349336.096740  7398505.722421 
+349296.572556  7398517.010488 
+349400.978082  7397946.868148 
+349420.513403  7397840.196420 
+349439.883799  7397734.424538 
+349485.666871  7397479.588189 
+349504.542493  7397377.255718 
+349508.665609  7397350.580287 
+349528.473055  7397227.991285 
+349557.796651  7397071.808038 
+349564.772962  7397028.975375 
+349576.053805  7396970.225438 
+349585.578202  7396896.428079 
+349593.519322  7396861.504061 
+349599.811196  7396825.810175 
+349607.570899  7396790.106291 
+349608.593431  7396721.048120 
+349605.418633  7396657.558995 
+349598.269151  7396621.065246 
+349595.102598  7396588.520821 
+349581.801428  7396531.910518 
+349572.499680  7396487.558115 
+349562.628942  7396463.452244 
+349552.469586  7396442.385852 
+349542.837988  7396422.829202 
+349533.396054  7396403.672484 
+349505.416594  7396377.436977 
+349486.549218  7396329.155248 
+349468.506465  7396313.287966 
+349449.432934  7396287.542376 
+349450.117371  7396152.125571 
+349463.616450  7396129.989363 
+349485.716349  7396101.494244 
+349508.616131  7396063.180807 
+349625.061154  7396003.940954 
+349602.639653  7395981.724759 
+349531.689084  7395906.387664 
+349487.307871  7395863.325040 
+349443.800758  7395807.954525 
+349418.996096  7395688.824930 
+349399.081449  7395620.606616 
+349374.870516  7395552.828225 
+349340.978508  7395393.055593 
+349290.899150  7395200.498576 
+349202.549034  7395015.310297 
+349200.124643  7394986.265273 
+349181.216036  7394936.783748 
+349897.054826  7394979.026513 
+349909.053091  7394943.062673 
+349929.033708  7394919.076781 
+349957.013169  7394893.091232 
+349986.988217  7394873.104656 
+350034.956541  7394863.116367 
+350086.066678  7394873.004673 
+350413.128678  7394959.079929 
+350434.997682  7394967.208537 
+350459.076675  7394978.806550 
+350503.020839  7395003.812267 
+350538.487877  7395033.177237 
+350571.200674  7395067.051435 
+350664.143939  7394740.557360 
+350674.938255  7394750.695624 
+350684.701792  7394756.644605 
+350700.163475  7394762.333630 
+350722.090202  7394768.172630 
+350748.156537  7394776.021285 
+350759.437381  7394781.610328 
+350770.009048  7394785.279700 
+350801.254016  7394766.242960 
+350898.427598  7394706.903125 
+350913.823311  7394699.274432 
+350994.388984  7394651.342642 
+351014.262400  7394681.097545 
+351105.721344  7394622.767536 
+351203.266006  7394563.817634 
+351302.377453  7394503.767920 
+351395.361949  7394445.477905 
+351493.285938  7394386.538000 
+351588.579380  7394327.158172 
+351686.066318  7394266.578548 
+351779.487865  7394209.928252 
+351823.473260  7394182.432962 
+351880.537176  7394148.018857 
+352001.971168  7394143.659603 
+352091.789112  7394141.210023 
+352140.516089  7394138.940412 
+352299.585878  7394135.081073 
+352416.072133  7394130.981775 
+352474.719325  7394112.015024 
+352491.871485  7394100.646971 
+352515.678353  7394088.659024 
+352523.635965  7394119.763696 
+352532.426447  7394185.662409 
+352543.410426  7394286.695103 
+352545.603924  7394383.338548 
+352541.637487  7394470.333647 
+352539.196602  7394523.054616 
+352541.208683  7394567.836946 
+352532.426447  7394613.959045 
+352530.216457  7394644.703779 
+352528.031206  7394682.047382 
+352526.489161  7394816.824296 
+352533.242824  7394989.314750 
+352532.418201  7395009.071366 
+352530.892648  7395026.148441 
+352524.642005  7395050.354295 
+352501.956625  7395160.085499 
+352497.792278  7395178.542337 
+352487.913294  7395221.814925 
+352484.177752  7395241.891486 
+352475.997491  7395280.534867 
+352562.516943  7395343.414096 
+352659.946158  7395408.482951 
+352755.462247  7395473.881748 
+352845.676011  7395537.630829 
+352883.443747  7395552.628260 
+352951.788507  7395602.569705 
+353006.997021  7395627.545427 
+353118.609753  7395648.621817 
+353119.788964  7395682.825958 
+353119.640531  7395715.340389 
+353103.601613  7395774.780207 
+353081.476976  7395874.893059 
+353071.960826  7395914.566263 
+353069.577665  7395943.921235 
+353071.160941  7395971.696477 
+353104.203588  7396048.293357 
+353111.419039  7396064.790531 
+353163.980514  7396149.426034 
+353185.692839  7396185.509853 
+353215.618410  7396238.110843 
+353233.149896  7396281.443420 
+353231.088339  7396386.675395 
+353237.842001  7396353.970997 
+353338.421277  7396381.096351 
+353367.101667  7396390.294775 
+353416.026553  7396409.871422 
+353470.666078  7396430.257930 
+353522.056587  7396449.014717 
+353547.438485  7396456.913364 
+353567.410856  7396472.320725 
+353745.521191  7396570.533902 
+354058.902695  7396693.012922 
+354118.226078  7396716.718862 
+354108.891345  7396752.192785 
+354030.296520  7397007.519050 
+354012.839250  7397055.130895 
+353989.032382  7397102.742739 
+353967.608675  7397149.564719 
+353944.593445  7397196.386699 
+353922.369854  7397245.588271 
+353900.146262  7397303.518348 
+353879.522439  7397352.719920 
+353853.398381  7397407.650511 
+353825.509629  7397460.771412 
+353802.873725  7397500.124671 
+353814.476172  7397519.731313 
+353739.353011  7397594.438516 
+353673.671784  7397658.727504 
+353619.922852  7397678.844058 
+353572.045237  7397686.542740 
+353513.076442  7397673.125038 
+353501.671905  7397664.976434 
+353469.049816  7397651.108809 
+353459.261541  7397647.029508 
+353445.737722  7397636.421325 
+353406.271262  7397620.304086 
+353298.427058  7397580.860842 
+353261.253050  7397564.003729 
+353195.406899  7397545.846839 
+353135.168184  7397547.926483 
+353078.030052  7397559.034581 
+353013.750684  7397582.050638 
+352959.787350  7397609.825880 
+352879.609250  7397623.223586 
+352768.895357  7397608.996023 
+352686.284618  7397603.606946 
+352625.221280  7397596.428175 
+352576.733444  7397573.082174 
+352536.087773  7397523.120732 
+352505.073700  7397528.879746 
+352447.572734  7397559.484503 
+352475.675888  7397628.102750 
+352494.617480  7397673.584959 
+352510.582182  7397701.210227 
+352533.638643  7397733.664668 
+Region 1
+387
+333751.726857  7385884.884257 
+333622.252790  7385861.908192 
+333598.668570  7385860.378454 
+333557.973422  7385852.389823 
+333516.536113  7385842.861455 
+333483.163618  7385836.552536 
+333459.587644  7385835.032796 
+333420.838606  7385830.643548 
+333387.457865  7385824.844541 
+333334.047029  7385817.585784 
+333267.772073  7385819.205507 
+333229.361131  7385823.214820 
+333195.782479  7385826.554248 
+333156.126356  7385828.993830 
+333081.621662  7385835.772669 
+333025.266922  7385835.572703 
+332993.180839  7385840.721821 
+332952.947479  7385846.720794 
+332914.231427  7385853.499633 
+332878.879836  7385856.799067 
+332835.158321  7385859.928531 
+332793.152022  7385865.877512 
+332748.630623  7385870.756677 
+332711.530831  7385872.756334 
+332677.020356  7385872.266418 
+332633.373057  7385871.576536 
+332582.634000  7385858.038855 
+332559.940373  7385850.940071 
+332538.656852  7385848.710453 
+332525.660792  7385842.311549 
+332499.841844  7385835.932642 
+332480.743574  7385826.904188 
+332480.727081  7385826.884192 
+332431.925888  7385806.777636 
+332397.555599  7385792.620061 
+332355.104004  7385764.324907 
+332318.713388  7385742.078718 
+332294.452977  7385729.950795 
+332256.042035  7385717.822873 
+332227.740971  7385721.862181 
+332213.590440  7385725.911487 
+332200.932476  7385732.690326 
+332191.861622  7385717.252970 
+332177.727583  7385700.935765 
+332164.146041  7385682.608905 
+332137.972505  7385647.504918 
+332110.215692  7385618.609867 
+332094.663301  7385594.234043 
+332068.201147  7385572.567754 
+332045.053978  7385621.619352 
+332036.453159  7385666.581650 
+331999.510046  7385720.092484 
+331944.647873  7385754.706555 
+331959.268440  7385691.917310 
+331875.239350  7385635.317005 
+331795.292144  7385585.325568 
+331762.966920  7385558.640139 
+331778.214200  7385532.784568 
+331747.678408  7385525.655789 
+331744.511855  7385501.759882 
+331743.893388  7385443.299896 
+331745.888976  7385424.493118 
+331750.680036  7385406.686168 
+331756.510121  7385393.208476 
+331761.573307  7385382.030391 
+331765.869593  7385372.871960 
+331778.750205  7385263.280732 
+331758.992237  7385236.125383 
+331803.101324  7385161.358190 
+331709.770486  7385139.571922 
+331677.387538  7385122.604828 
+331693.220301  7385024.471638 
+331657.398675  7384938.176419 
+331594.347995  7384798.100413 
+331582.094097  7384771.934895 
+331544.103712  7384721.903465 
+331394.616043  7384702.736748 
+331327.862806  7384686.289565 
+331319.187771  7384674.861523 
+331315.105887  7384666.223002 
+331312.293922  7384658.094395 
+331311.007510  7384651.225571 
+331309.960239  7384636.988010 
+331303.058144  7384620.990750 
+331291.595883  7384608.292925 
+331279.366723  7384600.934186 
+331264.102950  7384595.865054 
+331246.546725  7384589.776097 
+331238.152063  7384588.776268 
+331226.871219  7384589.316176 
+331173.559338  7384590.615953 
+331133.119823  7384587.996402 
+331110.673583  7384591.295837 
+331079.643017  7384582.057419 
+331049.931848  7384570.169455 
+331023.527418  7384556.961718 
+331008.667710  7384541.744324 
+330981.554104  7384515.108887 
+330926.329097  7384461.768024 
+330852.599549  7384391.310092 
+330808.572923  7384437.992096 
+330766.442931  7384484.554121 
+330734.257893  7384542.284232 
+330714.483432  7384580.217734 
+330709.007934  7384634.318467 
+330708.381221  7384657.404513 
+330698.221865  7384683.809990 
+330675.157158  7384710.995333 
+330663.686651  7384736.620944 
+330647.441576  7384758.967116 
+330612.906363  7384789.441896 
+330570.256858  7384819.246791 
+330425.832374  7384829.315066 
+330392.863944  7384795.100927 
+330310.863426  7384688.119252 
+330249.181621  7384620.310867 
+330175.551028  7384554.312172 
+330143.192819  7384521.797741 
+330124.597569  7384506.320392 
+330057.093924  7384449.200176 
+330057.069186  7384440.811613 
+330059.328653  7384425.564225 
+329971.028015  7384398.708825 
+329906.138426  7384377.682427 
+329922.787566  7384308.784228 
+329743.159924  7384265.761598 
+329707.280574  7384257.922940 
+329689.732595  7384253.363721 
+329671.912491  7384245.495069 
+329654.587160  7384233.317155 
+329634.210724  7384217.579851 
+329618.930459  7384204.892024 
+329603.641947  7384188.894764 
+329591.643682  7384166.528596 
+329579.769110  7384127.995196 
+329502.007155  7384108.668506 
+329479.610392  7384100.059981 
+329588.947164  7383892.355559 
+329600.079576  7383869.589459 
+329609.422555  7383847.563231 
+329616.728715  7383825.766965 
+329621.940333  7383811.589393 
+329674.947104  7383622.991698 
+329696.197640  7383547.194682 
+329738.121477  7383405.748910 
+329755.372591  7383351.518199 
+329788.844042  7383245.586345 
+329800.759845  7383219.020895 
+329817.029658  7383189.176007 
+329834.561144  7383160.370941 
+329853.527475  7383140.214394 
+329863.794032  7383129.626208 
+329878.892880  7383116.548448 
+329970.211638  7383043.950883 
+330029.526775  7382971.303327 
+330039.562438  7382957.155750 
+330067.311004  7382921.581844 
+330076.818908  7382909.213962 
+330115.798840  7382867.131171 
+330126.832297  7382855.033243 
+330154.787019  7382823.518641 
+330169.168445  7382806.631534 
+330193.536057  7382778.896284 
+330228.961864  7382738.563193 
+330255.762113  7382709.548163 
+330291.328106  7382672.564498 
+330320.536255  7382636.980593 
+330350.569027  7382601.166728 
+330365.206086  7382583.509752 
+330378.383563  7382558.983953 
+330385.681477  7382537.697600 
+330389.499482  7382513.221792 
+330393.358718  7382503.463464 
+330394.208080  7382465.849906 
+330403.114009  7382408.749687 
+330410.750018  7382377.814986 
+330418.278827  7382360.337980 
+330428.413444  7382335.022316 
+330456.706262  7382294.869194 
+330547.266367  7382166.091252 
+330621.103116  7382060.789290 
+330644.423456  7382037.883213 
+330660.577822  7382020.486193 
+330756.563947  7381940.919822 
+330786.596719  7381993.210865 
+330789.853980  7382019.146423 
+330792.195909  7382039.752893 
+330792.946316  7382068.737928 
+330792.121693  7382104.821747 
+330840.494082  7382119.499233 
+330857.539041  7382115.339946 
+330875.078773  7382113.470266 
+330891.059968  7382115.399935 
+331085.539072  7382035.363645 
+331194.463533  7381977.583542 
+331210.015924  7381972.024494 
+331271.079262  7381908.605357 
+331320.490676  7381860.553588 
+331355.223799  7381834.088121 
+331414.349273  7381775.648132 
+331520.610201  7381731.535688 
+331553.628108  7381713.888711 
+331566.401520  7381700.031084 
+331578.861574  7381681.084330 
+331588.806528  7381664.197222 
+331599.048347  7381650.869505 
+331617.280763  7381631.142884 
+331726.823691  7381635.412153 
+331758.126382  7381622.614345 
+331825.489840  7381601.627940 
+331832.721785  7381613.245950 
+331845.528181  7381624.044100 
+331860.569306  7381629.973085 
+331871.512054  7381632.912581 
+331885.712063  7381632.502651 
+331901.371655  7381627.243552 
+331918.507322  7381618.155109 
+331957.173898  7381595.908919 
+331991.766835  7381571.353126 
+331999.996573  7381564.084371 
+332009.413769  7381558.655301 
+332038.489978  7381541.858178 
+332058.421118  7381526.740767 
+332099.033803  7381500.305295 
+332120.721390  7381489.017229 
+332140.149509  7381473.629865 
+332206.473943  7381431.357106 
+332210.992877  7381413.840106 
+332239.533081  7381367.488046 
+332297.619530  7381276.573619 
+332347.847321  7381181.229950 
+332434.803823  7381255.517225 
+332464.589208  7381221.922980 
+332486.647875  7381192.158078 
+332499.511995  7381163.253029 
+332503.338246  7381161.753286 
+332514.033607  7381160.553492 
+332521.413983  7381159.333701 
+332533.857545  7381159.933598 
+332555.437931  7381164.662788 
+332603.307300  7381192.468025 
+332613.441917  7381197.117229 
+332620.797555  7381200.476653 
+332627.897560  7381202.046384 
+332635.022303  7381202.096376 
+332645.486770  7381199.696787 
+332656.289332  7381197.897095 
+332739.196935  7381174.591087 
+332779.463279  7381161.903261 
+332789.639128  7381160.703466 
+332832.717437  7381149.775338 
+332870.996439  7381139.787049 
+332898.679036  7381129.918739 
+332921.587064  7381125.249539 
+332950.110776  7381118.580681 
+332999.060401  7381099.593934 
+333042.419082  7381080.557194 
+333139.567925  7381040.284093 
+333139.576171  7381040.254098 
+333153.866889  7381030.965689 
+333193.976555  7381002.760520 
+333214.913735  7380990.692587 
+333231.241271  7380982.164048 
+333260.309234  7380970.146107 
+333265.529098  7380955.848556 
+333271.350937  7380941.700979 
+333279.679630  7380926.713547 
+333289.674062  7380910.906254 
+333305.102759  7380890.079822 
+333321.290110  7380869.283384 
+333342.012888  7380846.577273 
+333355.569691  7380835.229217 
+333371.229283  7380826.010796 
+333392.042769  7380815.182651 
+333413.318044  7380803.004737 
+333425.819330  7380787.127456 
+333465.021910  7380815.932522 
+333474.637015  7380823.851166 
+333495.252592  7380842.647946 
+333516.107309  7380853.176143 
+333527.206735  7380863.384394 
+333535.840539  7380876.442158 
+333541.579915  7380891.679548 
+333543.270393  7380904.437362 
+333542.148905  7380913.395828 
+333538.570041  7380922.774221 
+333535.708599  7380932.152615 
+333534.611851  7380939.231402 
+333537.902097  7380945.690296 
+333542.940544  7380951.059376 
+333553.091653  7380955.388635 
+333575.158567  7380961.177643 
+333597.307942  7380960.327789 
+333631.150473  7380953.398976 
+333637.269176  7380953.468964 
+333644.088809  7380955.318647 
+333653.976039  7380963.737205 
+333665.042481  7380978.374697 
+333674.583370  7380991.662421 
+333690.209977  7381015.128402 
+333682.705907  7381033.385275 
+333674.748294  7381044.793321 
+333663.211817  7381059.210851 
+333641.689155  7381083.216739 
+333627.596347  7381097.624271 
+333611.928509  7381120.920281 
+333546.387468  7381261.136263 
+333522.036349  7381326.845008 
+333502.072224  7381383.185357 
+333496.118446  7381398.412749 
+333489.406014  7381413.370187 
+333458.457911  7381439.355736 
+333429.422932  7381447.294376 
+333397.947070  7381439.945634 
+333365.160057  7381438.185936 
+333306.958161  7381434.986484 
+333504.744003  7381735.794958 
+333679.893942  7381850.975229 
+333718.593503  7381890.078531 
+333657.414717  7381971.174640 
+333727.936482  7382041.472598 
+333699.206614  7382091.204080 
+333670.732380  7382150.333951 
+333673.742254  7382172.180209 
+333642.373593  7382217.122511 
+333567.530803  7382312.716137 
+333536.500237  7382349.849776 
+333505.181053  7382494.724960 
+333442.583917  7382494.724960 
+333450.162202  7382459.840936 
+333417.911194  7382495.554818 
+333415.470310  7382573.531462 
+333406.490165  7382644.369328 
+333376.440901  7382903.784892 
+333359.684560  7383039.821590 
+333538.231946  7383056.078806 
+333543.451810  7383270.122142 
+333720.951924  7383270.122142 
+333835.805425  7383567.701169 
+334164.698088  7383499.832794 
+334289.991316  7383703.437919 
+334444.336016  7383748.180255 
+334346.313072  7383835.115364 
+334311.984014  7383892.985451 
+334271.049725  7383966.832802 
+334229.562938  7384019.943704 
+334207.091960  7384050.698436 
+334187.457685  7384079.243547 
+334174.074052  7384100.549897 
+334166.668937  7384114.607489 
+334163.090073  7384128.245153 
+334162.793209  7384142.732672 
+334159.082405  7384159.969719 
+334156.872415  7384171.047821 
+334119.063448  7384268.301163 
+334100.121856  7384312.613572 
+334096.023479  7384326.741153 
+334094.530911  7384337.379330 
+334091.554022  7384370.853596 
+334089.789329  7384406.637467 
+334087.183520  7384422.334778 
+334080.570043  7384447.590452 
+334052.640060  7384508.979937 
+334026.573725  7384566.590069 
+334024.347242  7384575.688510 
+334023.341202  7384587.856426 
+334022.632026  7384609.702684 
+334020.603454  7384634.298471 
+334018.937715  7384677.451079 
+334018.228539  7384723.923119 
+334021.329122  7384770.225188 
+334029.558860  7384875.067229 
+334032.642950  7384898.003301 
+334037.277332  7384918.939714 
+334042.769322  7384935.816823 
+334051.798944  7384965.491740 
+333980.939084  7384979.709305 
+333826.149089  7385014.233391 
+333763.617922  7385030.410620 
+333730.385612  7385050.647154 
+333734.665406  7385106.297622 
+333741.798396  7385371.712158 
+333744.651591  7385434.501403 
+333734.376788  7385523.246202 
+333734.929285  7385645.395279 
+333752.889576  7385791.950176 
+333751.726857  7385884.884257 
+Region 1
+871
+337213.882056  7403806.924374 
+337193.118047  7403823.161592 
+337146.798969  7403860.325226 
+337131.436242  7403869.833598 
+337122.686991  7403878.582099 
+337113.566660  7403886.580729 
+337061.120633  7403917.935358 
+337102.533203  7403993.292450 
+337123.940418  7404027.326621 
+337130.760051  7404023.077349 
+337143.269583  7404017.648278 
+337164.973662  7404012.229207 
+337184.080178  7404008.919774 
+337208.612714  7404007.270056 
+337230.085899  7404008.689813 
+337250.371626  7404015.758602 
+337264.522158  7404025.436944 
+337277.262584  7404039.584521 
+337289.772116  7404056.571611 
+337320.670743  7404094.085186 
+337357.242775  7404132.768559 
+337381.536171  7404158.244196 
+337402.061039  7404180.660356 
+337417.638169  7404197.637448 
+337484.399652  7404259.676821 
+337491.474918  7404263.926093 
+337497.140078  7404268.175365 
+337522.851826  7404281.153142 
+337529.457056  7404283.502740 
+337534.883076  7404285.162456 
+337539.369026  7404285.392416 
+337551.631170  7404282.802860 
+337564.140702  7404279.973345 
+337570.506792  7404277.613749 
+337587.254887  7404269.585124 
+337605.660474  7404257.557184 
+337620.281041  7404248.598719 
+337641.284190  7404240.100174 
+337660.629847  7404233.021387 
+337673.131133  7404229.481993 
+337698.133704  7404224.062921 
+337710.164955  7404222.413204 
+337733.996561  7404221.463367 
+337758.999133  7404224.772800 
+337777.404719  7404230.191872 
+337785.659196  7404235.151022 
+337792.734462  7404242.699729 
+337799.817974  7404251.898154 
+337805.243994  7404263.216215 
+337812.080119  7404276.433951 
+337823.171299  7404294.590841 
+337839.210218  7404321.726193 
+337855.727418  7404347.911707 
+337870.826266  7404372.677465 
+337884.976798  7404396.743343 
+337902.912350  7404428.347929 
+337939.946172  7404488.267666 
+337965.897060  7404529.310635 
+337974.390677  7404544.408049 
+337988.310314  7404566.584251 
+337999.632389  7404589.470331 
+338010.014393  7404607.397260 
+338030.539262  7404642.311279 
+338044.458899  7404666.367159 
+338054.370868  7404682.644371 
+338066.633013  7404703.400815 
+338070.830344  7404712.589241 
+338076.305842  7404723.927299 
+338084.799459  7404742.804066 
+338090.695514  7404757.661521 
+338102.017589  7404777.238168 
+338130.096004  7404814.041863 
+338136.519818  7404828.789337 
+338143.710531  7404841.017243 
+338149.326214  7404848.355986 
+338158.207404  7404854.934859 
+338168.729595  7404859.904008 
+338182.542031  7404862.483566 
+338215.840310  7404869.322394 
+338242.591083  7404879.330680 
+338281.447321  7404898.377418 
+338308.948501  7404914.054732 
+338334.000549  7404930.521911 
+338354.162583  7404947.738962 
+338366.259804  7404957.587275 
+338401.842289  7404979.013605 
+338409.098972  7404985.572482 
+338416.899906  7404993.711088 
+338410.039042  7404995.270821 
+338396.911043  7404999.980014 
+338388.879214  7405002.129646 
+338357.527045  7405008.988471 
+338334.800434  7405012.717832 
+338309.327827  7405019.966590 
+338268.764619  7405027.605282 
+338243.292012  7405033.684241 
+338226.634626  7405037.603569 
+338197.245060  7405043.472564 
+338180.785584  7405046.612026 
+338161.192540  7405047.791824 
+338147.528536  7405050.341387 
+338139.447230  7405051.711153 
+338110.445237  7405054.650649 
+338085.170540  7405058.170046 
+338067.342189  7405059.939743 
+338047.938808  7405064.049039 
+338032.073060  7405067.968368 
+338000.325072  7405079.536387 
+337984.261415  7405086.385213 
+337977.887079  7405091.164395 
+337970.399501  7405103.442292 
+337966.688698  7405117.529879 
+337968.865703  7405126.638318 
+337973.038295  7405138.806234 
+337975.487426  7405146.144977 
+337981.218556  7405154.793496 
+337985.720998  7405160.402535 
+337994.544465  7405164.541826 
+338001.900103  7405164.371855 
+338013.057253  7405164.751790 
+338024.643207  7405171.190687 
+338031.207206  7405173.540285 
+338049.596301  7405184.098476 
+338064.233360  7405190.067454 
+338077.872625  7405194.516692 
+338087.768102  7405193.616846 
+338093.367293  7405191.917137 
+338108.103307  7405189.057627 
+338121.775557  7405190.727341 
+338128.834331  7405194.346721 
+338134.821094  7405202.995239 
+338141.764421  7405216.442936 
+338151.429003  7405236.499500 
+338166.371173  7405259.885494 
+338177.025303  7405281.711756 
+338190.219272  7405303.058099 
+338197.673864  7405312.686450 
+338205.713939  7405322.414784 
+338218.000823  7405334.922641 
+338231.499902  7405351.479805 
+338243.984696  7405368.526885 
+338258.432092  7405390.903052 
+338270.149985  7405408.200090 
+338273.720603  7405409.839809 
+338283.607834  7405428.546604 
+338309.814355  7405465.440285 
+338326.174876  7405475.718524 
+338341.051077  7405482.957284 
+338356.677684  7405490.955914 
+338366.284542  7405493.595462 
+338375.355396  7405498.494623 
+338389.629621  7405514.051958 
+338402.312324  7405535.898216 
+338406.996183  7405547.306262 
+338413.733353  7405556.974606 
+338426.003745  7405570.492290 
+338442.017925  7405588.589190 
+338470.822008  7405619.453904 
+338474.293671  7405626.312729 
+338479.035254  7405632.921597 
+338484.741646  7405643.839727 
+338501.794851  7405660.186926 
+338510.362684  7405665.336044 
+338522.954678  7405672.794767 
+338536.857823  7405675.984221 
+338559.337048  7405683.812880 
+338570.180841  7405688.732037 
+338577.214876  7405694.621028 
+338592.016860  7405708.158709 
+338597.665528  7405724.375931 
+338602.860653  7405735.793976 
+338610.785281  7405751.781237 
+338616.706075  7405766.238761 
+338627.426174  7405782.256017 
+338635.672405  7405792.704227 
+338647.208882  7405804.192260 
+338651.472183  7405808.271561 
+338657.970213  7405816.170208 
+338658.852559  7405828.048173 
+338657.953720  7405839.646187 
+338658.102152  7405849.484501 
+338660.534791  7405858.093027 
+338666.801926  7405864.731890 
+338674.190548  7405883.238720 
+338679.105302  7405897.166334 
+338679.954664  7405911.313911 
+338682.486256  7405934.050016 
+338678.156985  7405958.225875 
+338715.652596  7405981.371910 
+338762.804543  7405998.838918 
+338809.964736  7406026.784132 
+338869.337597  7406045.990842 
+338970.634294  7406070.436654 
+339036.999958  7406045.990842 
+339094.740065  7405998.958898 
+339101.757608  7405997.679117 
+339110.696522  7405997.679117 
+339124.096646  7406000.868571 
+339147.078891  7406032.783104 
+339155.894112  7406071.906403 
+339160.949051  7406100.221553 
+339171.900045  7406147.763409 
+339177.441512  7406177.338343 
+339184.013758  7406205.663491 
+339188.054411  7406233.208773 
+339188.895527  7406251.635617 
+339191.385888  7406281.940426 
+339197.059295  7406298.147650 
+339200.027938  7406306.246262 
+339209.981139  7406325.273003 
+339220.610530  7406354.388016 
+339230.712162  7406384.262899 
+339236.517509  7406413.587876 
+339237.655489  7406426.725625 
+339240.434468  7406453.501039 
+339240.244805  7406473.177668 
+339241.564202  7406494.384036 
+339246.718096  7406511.591089 
+339251.929714  7406523.759004 
+339270.500225  7406543.875559 
+339282.069687  7406553.833853 
+339299.914530  7406570.411013 
+339329.576222  7406596.946468 
+339357.745345  7406647.437819 
+339369.174621  7406672.023608 
+339386.904017  7406699.958823 
+339397.879750  7406718.985564 
+339413.786729  7406752.699789 
+339422.164899  7406777.265581 
+339432.464441  7406813.949297 
+339435.573270  7406833.405965 
+339476.524052  7406873.179152 
+339478.931951  7406885.567030 
+339487.499785  7406891.206064 
+339503.645904  7406900.194524 
+339512.197245  7406910.302793 
+339519.693069  7406919.281255 
+339527.889822  7406936.518302 
+339541.405394  7406955.325081 
+339562.804363  7406971.432322 
+339579.181377  7406982.190479 
+339598.848637  7406993.998457 
+339618.985932  7407010.085701 
+339635.329962  7407023.873339 
+339650.676197  7407037.151065 
+339660.983985  7407046.079536 
+339671.225804  7407062.086794 
+339678.672150  7407079.313843 
+339699.889701  7407087.852380 
+339714.007248  7407096.570887 
+339733.402383  7407109.888606 
+339748.468246  7407125.425944 
+339763.303215  7407138.443714 
+339776.975465  7407141.103259 
+339789.410781  7407140.463368 
+339805.911489  7407138.103773 
+339820.127990  7407136.734007 
+339847.348798  7407144.512675 
+339844.495602  7407178.736813 
+339831.565512  7407299.006212 
+339816.540880  7407379.502423 
+339785.889641  7407525.957337 
+339751.824462  7407634.948668 
+339717.767529  7407742.240290 
+339683.702350  7407825.685996 
+339646.239725  7407912.531120 
+339600.258743  7408019.822742 
+339554.277760  7408104.978156 
+339562.672423  7408107.887657 
+339579.758613  7408108.677522 
+339610.236682  7408099.919022 
+339739.290191  7408048.657803 
+339783.506480  7408042.338885 
+339830.914060  7408023.382133 
+339864.072153  7407998.106462 
+339880.523384  7408001.065955 
+339911.042683  7407934.997272 
+339904.305513  7407922.409428 
+339895.086227  7407910.001554 
+339879.476112  7407886.945503 
+339855.891893  7407853.081303 
+339843.481315  7407833.394676 
+339836.505004  7407824.506198 
+339819.006503  7407802.190021 
+339813.514513  7407793.321540 
+339806.422755  7407776.834364 
+339798.976409  7407760.337190 
+339789.039701  7407745.089801 
+339778.938068  7407734.101684 
+339775.392189  7407728.952566 
+339772.901827  7407722.753627 
+339772.901827  7407719.554175 
+339774.501596  7407706.256453 
+339776.101365  7407700.047517 
+339779.111239  7407695.618275 
+339783.547711  7407692.248853 
+339789.748877  7407690.479156 
+339815.106036  7407686.929764 
+339851.282250  7407682.140584 
+339862.629063  7407679.301070 
+339871.856595  7407675.931648 
+339875.575645  7407670.262619 
+339878.412349  7407658.384653 
+339880.012117  7407647.206568 
+339881.958228  7407634.438755 
+339886.567871  7407623.090699 
+339890.822926  7407616.001913 
+339897.386925  7407608.913127 
+339920.797974  7407588.696590 
+339926.999139  7407582.137714 
+339930.726436  7407575.568839 
+339939.055129  7407558.551754 
+339945.800545  7407546.133881 
+339953.246892  7407534.255915 
+339965.838886  7407517.588770 
+339973.458403  7407509.430168 
+339978.604051  7407503.401201 
+339992.078392  7407475.036059 
+339996.333447  7407463.857974 
+340000.415331  7407455.349431 
+340005.198145  7407449.500433 
+340011.234386  7407444.891223 
+340023.290375  7407439.212196 
+340030.027545  7407434.423016 
+340034.101183  7407429.633836 
+340036.591545  7407422.365081 
+340038.364484  7407410.487116 
+340042.792710  7407393.460032 
+340046.338589  7407384.951490 
+340050.775061  7407379.452432 
+340058.039991  7407376.792887 
+340065.139995  7407376.262978 
+340073.823276  7407377.152826 
+340086.951275  7407379.282461 
+340099.716440  7407381.762036 
+340105.389847  7407383.891671 
+340108.407967  7407389.030791 
+340111.244671  7407394.879789 
+340113.190781  7407400.028907 
+340116.736660  7407403.218361 
+340120.282540  7407403.928239 
+340133.410539  7407404.278179 
+340151.313106  7407402.508483 
+340162.841336  7407400.028907 
+340168.514743  7407396.659484 
+340172.415210  7407392.220245 
+340174.188149  7407385.311428 
+340174.724154  7407379.282461 
+340172.951215  7407366.864588 
+340169.759924  7407356.586349 
+340164.086517  7407343.988506 
+340157.703934  7407325.731634 
+340145.285111  7407288.138073 
+340138.547941  7407259.233024 
+340135.356649  7407232.637580 
+340135.356649  7407222.349342 
+340135.538066  7407201.782865 
+340134.474303  7407192.734415 
+340130.037830  7407170.928150 
+340128.438062  7407153.731096 
+340126.846539  7407133.694528 
+340126.310534  7407112.768112 
+340125.782775  7407100.000299 
+340123.828419  7407091.841697 
+340118.864188  7407084.213004 
+340108.762555  7407076.064399 
+340099.889611  7407068.255737 
+340095.815973  7407060.986982 
+340094.216205  7407055.487924 
+340094.397622  7407046.799412 
+340095.279968  7407040.600474 
+340097.762084  7407032.441872 
+340103.616907  7407022.153634 
+340111.772430  7407010.275668 
+340117.272665  7407002.117066 
+340125.428188  7406987.399587 
+340127.910303  7406979.600923 
+340127.728886  7406971.262351 
+340125.782775  7406959.204417 
+340122.410067  7406946.436604 
+340113.190781  7406921.970794 
+340109.999490  7406907.603255 
+340107.871962  7406897.145047 
+340107.698792  7406890.046263 
+340108.935726  7406881.187780 
+340110.180907  7406871.959361 
+340117.800424  7406844.124129 
+340118.864188  7406838.275131 
+340118.864188  7406830.116528 
+340117.800424  7406818.948441 
+340116.563490  7406799.621752 
+340114.790550  7406763.797888 
+340113.545369  7406755.109376 
+340109.644902  7406747.840621 
+340103.790078  7406740.041957 
+340091.560918  7406725.674418 
+340076.305392  7406708.297395 
+340068.859045  7406702.268427 
+340059.994347  7406694.819703 
+340049.711298  7406685.951222 
+340040.846600  7406682.051890 
+340029.672957  7406680.102224 
+340013.007325  7406677.802618 
+339998.996979  7406675.313045 
+339988.887100  7406670.353894 
+339979.667815  7406663.435079 
+339975.058172  7406656.696233 
+339973.103815  7406651.197175 
+339969.557936  7406637.549513 
+339968.675589  7406625.661549 
+339969.557936  7406612.193856 
+339968.675589  7406598.186256 
+339965.838886  7406591.087472 
+339960.693238  7406585.588414 
+339954.838414  7406581.339141 
+339947.392068  7406575.480145 
+339943.673018  7406569.281207 
+339939.591134  7406560.592695 
+339938.527370  7406554.913668 
+339939.945722  7406544.455459 
+339941.718661  7406534.877100 
+339954.129238  7406489.834815 
+339970.267112  7406430.255021 
+339974.167579  7406421.566509 
+339978.604051  7406415.007632 
+339985.159804  7406410.218453 
+339992.968985  7406408.268787 
+340010.879798  7406404.369455 
+340019.035320  7406401.889879 
+340023.644963  7406396.920731 
+340026.127078  7406391.421673 
+340026.481666  7406383.443039 
+340025.591073  7406375.284437 
+340022.935787  7406362.526622 
+340017.616968  7406349.578840 
+340012.652737  7406342.839994 
+340006.616496  7406338.230784 
+339991.905221  7406332.201816 
+339975.231343  7406323.863245 
+339968.139584  7406315.884611 
+339963.711358  7406306.666190 
+339963.884529  7406296.557922 
+339966.193474  7406286.629622 
+339970.093941  7406278.830958 
+339975.058172  7406275.101597 
+339981.086166  7406271.912143 
+339990.305452  7406270.312417 
+340005.734150  7406269.072630 
+340011.762144  7406267.652873 
+340018.680732  7406264.643389 
+340022.045194  7406260.914027 
+340023.290375  7406256.484786 
+340022.754370  7406251.875576 
+340020.626842  7406246.376517 
+340013.889672  7406238.397884 
+340001.833683  7406228.819525 
+339994.032748  7406218.891225 
+339986.932744  7406204.353716 
+339981.613925  7406193.355599 
+339976.831111  7406185.906875 
+339964.593705  7406176.158545 
+339950.055600  7406165.870307 
+339936.399842  7406155.232130 
+339924.162436  7406138.564985 
+339919.198205  7406130.946290 
+339907.496804  7406109.489965 
+339894.022463  7406083.774370 
+339868.657058  7406043.701234 
+339859.083184  7406031.463330 
+339847.917788  7406012.666550 
+339824.861327  7405972.413445 
+339816.524388  7405960.535479 
+339811.205569  7405947.587697 
+339806.595926  7405928.800915 
+339802.522288  7405908.934318 
+339798.267233  7405884.998418 
+339795.603700  7405865.671729 
+339792.230992  7405842.445707 
+339787.266761  7405825.948533 
+339781.593354  7405812.650811 
+339775.746777  7405803.072451 
+339767.409838  7405793.324121 
+339758.899728  7405781.616127 
+339755.708436  7405773.637493 
+339753.226321  7405764.239103 
+339749.499025  7405751.471290 
+339745.243970  7405741.193051 
+339738.679970  7405732.144601 
+339732.478805  7405725.585724 
+339728.578338  7405718.496938 
+339728.042333  7405711.758093 
+339728.932926  7405705.369187 
+339731.769629  7405698.810311 
+339736.552443  7405693.491222 
+339752.335728  7405684.622741 
+339767.055250  7405676.294167 
+339773.083244  7405672.744775 
+339787.448178  7405660.506872 
+339801.277107  7405649.158815 
+339807.486519  7405643.309817 
+339815.460624  7405633.381518 
+339817.942739  7405628.592338 
+339817.942739  7405624.693006 
+339816.878975  7405617.774191 
+339812.096162  7405608.735740 
+339807.131931  7405601.636956 
+339801.458524  7405595.787957 
+339791.703233  7405587.809324 
+339778.756651  7405574.151664 
+339768.193230  7405563.533482 
+339764.746305  7405561.213880 
+339758.718311  7405551.275582 
+339753.399492  7405539.047677 
+339749.672196  7405529.649286 
+339745.953146  7405513.512051 
+339742.935025  7405503.223813 
+339739.570563  7405497.024875 
+339722.896685  7405476.098459 
+339710.667525  7405463.330646 
+339704.103525  7405458.361497 
+339699.988656  7405456.231862 
+339697.366355  7405455.172044 
+339674.136723  7405450.202895 
+339660.307794  7405445.773654 
+339643.279328  7405437.974989 
+339631.396509  7405431.236144 
+339625.013927  7405425.557116 
+339618.812762  7405415.808786 
+339615.085465  7405405.520548 
+339613.667114  7405399.311612 
+339614.376289  7405393.292643 
+339615.794641  7405383.714284 
+339622.886399  7405353.569447 
+339624.659339  7405344.171057 
+339625.549932  7405331.403244 
+339625.549932  7405321.474945 
+339626.613696  7405313.496311 
+339630.332746  7405300.368560 
+339632.105685  7405289.020504 
+339632.823107  7405279.272174 
+339631.932514  7405263.844816 
+339632.287102  7405245.937884 
+339633.886871  7405236.359524 
+339636.542157  7405224.831499 
+339639.560278  7405215.613078 
+339642.751569  7405204.794931 
+339646.825207  7405179.439274 
+339645.761443  7405174.650095 
+339643.106157  7405166.491492 
+339636.896745  7405155.503374 
+339631.751097  7405142.555592 
+339628.559806  7405131.557476 
+339625.195344  7405116.140117 
+339615.794641  7405092.734126 
+339605.866179  7405076.056983 
+339595.228542  7405063.999048 
+339584.228070  7405055.490505 
+339578.554664  7405049.821477 
+339575.717960  7405045.212266 
+339576.253965  7405038.113482 
+339578.381493  7405033.854212 
+339581.036779  7405029.784909 
+339593.455602  7405022.506155 
+339599.656768  7405015.767310 
+339603.384064  7405009.738342 
+339607.812290  7404999.810043 
+339615.085465  7404978.713657 
+339623.422404  7404954.947728 
+339627.141454  7404940.060278 
+339627.496042  7404931.541737 
+339626.259108  7404921.973376 
+339622.358641  7404909.025594 
+339615.440053  7404890.938692 
+339613.667114  7404877.640969 
+339613.312526  7404860.443915 
+339611.184998  7404848.735921 
+339607.812290  7404832.248745 
+339609.040978  7404820.470762 
+339611.399400  7404813.391975 
+339618.004631  7404802.543833 
+339618.936455  7404800.454191 
+339624.139827  7404788.386258 
+339629.796741  7404779.887714 
+339646.313941  7404758.661350 
+339663.771211  7404736.015229 
+339687.833712  7404707.700079 
+339705.290982  7404685.053958 
+339714.254635  7404669.006707 
+339733.130257  7404640.231636 
+339748.699140  7404611.916486 
+339755.535266  7404599.208662 
+339756.252688  7404589.740284 
+339762.379637  7404568.503922 
+339766.362566  7404552.236708 
+339770.873255  7404519.432327 
+339776.068380  7404501.505398 
+339792.577334  7404432.617198 
+339801.070951  7404394.393745 
+339807.206147  7404371.277705 
+339814.281413  7404357.590050 
+339820.886644  7404350.041343 
+339835.985492  7404337.773444 
+339843.539039  7404329.754817 
+339851.084340  7404312.767727 
+339858.167852  7404289.651687 
+339864.773083  7404265.585809 
+339874.206771  7404227.842274 
+339878.923615  7404208.025669 
+339885.528846  7404198.117366 
+339892.134076  7404189.618821 
+339904.404468  7404181.130275 
+339939.319008  7404163.193348 
+339957.716349  7404152.345206 
+339986.503940  7404136.777873 
+339995.937628  7404130.638924 
+340004.431245  7404123.090217 
+340013.394898  7404113.181914 
+340018.111742  7404101.853855 
+340022.358551  7404087.226360 
+340028.963781  7404065.050159 
+340033.688872  7404033.915492 
+340036.987364  7404012.209210 
+340042.174243  7403997.111796 
+340052.086212  7403981.534464 
+340067.185060  7403963.607535 
+340082.283909  7403948.510121 
+340090.777526  7403931.992950 
+340097.382757  7403917.365456 
+340099.271144  7403906.517314 
+340097.382757  7403892.829659 
+340088.419104  7403874.432810 
+340082.753944  7403852.726528 
+340073.790291  7403831.970083 
+340070.483553  7403816.392752 
+340070.483553  7403805.544610 
+340072.371940  7403793.746631 
+340078.037100  7403781.008813 
+340087.949069  7403760.722288 
+340103.987988  7403739.016006 
+340113.891711  7403723.918592 
+340121.915293  7403718.719482 
+340135.125755  7403713.060452 
+340154.471412  7403706.451584 
+340171.928682  7403699.852714 
+340187.027530  7403691.354170 
+340195.991183  7403685.225220 
+340203.074695  7403678.616352 
+340215.336840  7403666.818372 
+340239.877623  7403647.471686 
+340259.693315  7403636.153625 
+340271.015390  7403628.604918 
+340281.867429  7403619.166535 
+340289.891012  7403607.368556 
+340297.906348  7403593.690899 
+340307.348282  7403581.423000 
+340315.841899  7403566.795505 
+340346.509631  7403528.572053 
+340358.301741  7403514.414478 
+340372.930554  7403494.127953 
+340381.894207  7403474.311347 
+340390.857860  7403459.213933 
+340398.411407  7403446.946035 
+340409.914899  7403432.108576 
+340424.337556  7403417.091148 
+340443.262655  7403394.864956 
+340465.486247  7403358.211234 
+340485.013321  7403317.058283 
+340497.630054  7403282.214252 
+340514.749229  7403228.743411 
+340521.659570  7403212.526189 
+340548.995825  7403173.172929 
+340570.625688  7403144.337869 
+340581.436496  7403128.120646 
+340589.641496  7403112.993238 
+340604.567173  7403085.457954 
+340633.709352  7403030.487370 
+340648.123763  7403003.152052 
+340653.228180  7402984.525243 
+340656.238054  7402968.607970 
+340655.330969  7402962.299050 
+340653.533291  7402955.690182 
+340643.918186  7402947.581571 
+340625.298197  7402933.164041 
+340620.490644  7402929.854608 
+340617.489016  7402926.255224 
+340613.580303  7402916.336923 
+340611.477514  7402900.119701 
+340611.477514  7402886.302068 
+340612.978328  7402870.684743 
+340615.798539  7402854.617495 
+340620.787509  7402830.131689 
+340624.391112  7402813.304572 
+340627.095875  7402792.278173 
+340631.301453  7402767.352443 
+340632.208538  7402733.708206 
+340631.301453  7402708.772477 
+340627.095875  7402686.846233 
+340617.785881  7402652.902047 
+340608.170776  7402625.566729 
+340599.759621  7402595.221927 
+340585.345209  7402563.087432 
+340580.834521  7402548.659903 
+340580.834521  7402533.042578 
+340582.038471  7402522.834327 
+340584.141260  7402512.316128 
+340597.961942  7402477.472097 
+340610.578675  7402449.236933 
+340615.081117  7402438.118838 
+340617.183906  7402428.810432 
+340618.684720  7402414.992799 
+340618.684720  7402389.157224 
+340617.785881  7402359.722266 
+340613.283439  7402326.377978 
+340609.077861  7402299.342609 
+340601.565545  7402278.616159 
+340591.348465  7402261.789041 
+340578.731732  7402242.562335 
+340573.627316  7402229.344599 
+340570.625688  7402214.927068 
+340569.726849  7402202.319228 
+340572.423366  7402187.891699 
+340576.934054  7402169.874785 
+340580.537657  7402153.947514 
+340580.834521  7402141.939570 
+340580.537657  7402127.212093 
+340577.536029  7402110.694922 
+340567.318949  7402068.942074 
+340561.612558  7402044.306294 
+340558.008955  7402025.689483 
+340556.805005  7402009.162314 
+340558.305819  7401993.544989 
+340563.113372  7401975.518077 
+340573.932426  7401954.191730 
+340587.447998  7401927.156361 
+340594.053229  7401910.039293 
+340599.165892  7401893.512124 
+340600.666706  7401878.494696 
+340601.507821  7401841.551024 
+340601.862409  7401803.397560 
+340599.759621  7401741.218210 
+340600.963570  7401707.274025 
+340602.769495  7401679.038861 
+340583.539285  7401682.738227 
+340488.089165  7401747.507133 
+340416.808747  7401793.609236 
+340316.600553  7401865.966842 
+340262.076476  7401908.179611 
+340230.707814  7401962.430319 
+340196.947746  7402027.809120 
+340168.943547  7402079.690233 
+340137.756302  7402141.949569 
+340110.123183  7402193.430750 
+340085.458708  7402242.172401 
+340067.284015  7402276.226568 
+340029.079229  7402346.694498 
+339935.212385  7402517.325270 
+339928.269059  7402528.333385 
+339914.093789  7402563.397378 
+339872.318384  7402636.234902 
+339814.504061  7402751.015241 
+339750.249432  7402870.034854 
+339698.034299  7402967.818105 
+339677.336260  7403003.162051 
+339671.596884  7403017.569583 
+339638.653192  7403075.629638 
+339622.523565  7403109.943760 
+339603.722159  7403142.748141 
+339592.837135  7403166.014156 
+339575.066508  7403198.608573 
+339571.809247  7403207.327079 
+339551.086469  7403241.141287 
+339528.730938  7403287.493347 
+339501.501884  7403339.634416 
+339490.534398  7403326.176721 
+339484.044614  7403316.518376 
+339475.295363  7403304.070508 
+339467.288273  7403293.142380 
+339454.193259  7403283.923959 
+339430.592547  7403282.934128 
+339379.103083  7403279.384736 
+339347.891100  7403278.574875 
+339329.394805  7403275.105469 
+339317.775866  7403269.696396 
+339309.768776  7403259.268182 
+339304.466449  7403250.679653 
+339294.537988  7403236.152142 
+339269.543662  7403223.534303 
+339257.166070  7403218.365188 
+339235.346544  7403216.885442 
+339211.770571  7403214.375872 
+339189.967537  7403211.886298 
+339165.336046  7403212.656166 
+339137.645203  7403214.395868 
+339116.040079  7403216.955430 
+339097.197442  7403222.314512 
+339072.994755  7403217.515334 
+339054.638646  7403213.815968 
+339035.210526  7403203.027816 
+339022.618532  7403194.569264 
+339011.576829  7403182.851272 
+339004.493317  7403180.261715 
+338993.550569  7403182.921260 
+338977.025123  7403185.530813 
+338959.543114  7403182.081403 
+338949.177602  7403177.942113 
+338931.547161  7403165.394262 
+338912.869448  7403155.625935 
+338895.725535  7403145.107737 
+338888.732731  7403145.747627 
+338869.312858  7403146.607480 
+338845.934794  7403148.137218 
+338834.051976  7403144.237886 
+338807.697023  7403139.938622 
+338766.086543  7403137.998954 
+338739.014168  7403130.160297 
+338725.407887  7403120.441962 
+338714.357938  7403109.733796 
+338694.649447  7403101.205257 
+338653.632695  7403072.300208 
+338631.153471  7403058.432583 
+338613.424075  7403032.267065 
+338605.639633  7403024.108463 
+338572.531017  7402987.954656 
+338553.358531  7402976.906548 
+338528.141557  7402961.519184 
+338509.043287  7402944.422112 
+338494.266042  7402926.355207 
+338483.570681  7402906.058684 
+338469.642797  7402880.443071 
+338460.159632  7402865.575618 
+338450.684713  7402849.968291 
+338431.165885  7402824.292689 
+338411.333700  7402804.156139 
+338393.967139  7402790.868415 
+338389.852270  7402785.999249 
+338377.936466  7402771.271771 
+338371.644592  7402766.412604 
+338363.365377  7402757.254173 
+338358.706256  7402742.816646 
+338356.141679  7402722.100194 
+338350.996031  7402705.143099 
+338338.189635  7402692.405281 
+338310.688455  7402677.237879 
+338304.421320  7402672.208740 
+338222.758898  7402744.796306 
+338163.740625  7402794.227839 
+338168.383253  7402805.975827 
+338180.562936  7402861.376337 
+338193.633211  7402916.906825 
+338191.068634  7402980.745890 
+338173.743303  7403053.073501 
+338172.390921  7403057.542736 
+338160.763736  7403082.698427 
+338150.620872  7403101.005291 
+338135.051989  7403129.120475 
+338038.290718  7403234.742383 
+337909.657766  7403366.019896 
+337799.669542  7403482.999859 
+337771.657097  7403509.505319 
+337706.660307  7403575.983932 
+337664.563299  7403561.206463 
+337649.200572  7403615.967083 
+337630.580583  7403667.568244 
+337601.042585  7403775.399773 
+337475.980251  7403715.200085 
+337433.718318  7403712.450556 
+337360.582499  7403736.176492 
+337299.700578  7403755.933108 
+337271.696379  7403768.960876 
+337264.241786  7403772.430282 
+337213.882056  7403806.924374 
+Region 1
+354
+323728.713878  7398532.747792 
+323748.999605  7398458.030591 
+323509.298173  7398295.668402 
+323369.285423  7398217.451800 
+323213.489387  7398119.318609 
+323021.822248  7398089.763671 
+322810.331171  7398086.984148 
+322637.292267  7398096.632495 
+322401.062497  7398103.231365 
+322107.109114  7398101.221709 
+321962.148625  7398073.036537 
+321839.329266  7397988.471022 
+321728.590634  7397885.788610 
+321664.162834  7397793.174474 
+321647.785820  7397771.298222 
+321429.648281  7397747.092368 
+321325.490142  7397735.444363 
+321300.165967  7397733.434707 
+321275.559215  7397736.734142 
+321249.674297  7397741.273365 
+321228.110404  7397744.082883 
+321214.652556  7397747.492299 
+321193.797838  7397756.610737 
+321165.587483  7397766.429056 
+321135.604189  7397776.477335 
+321108.366889  7397790.075005 
+321081.632609  7397805.202414 
+321062.765233  7397819.389984 
+321039.799481  7397837.816828 
+321024.379030  7397863.132491 
+321020.099236  7397889.058050 
+321020.173452  7397909.984466 
+321022.226763  7397936.979842 
+321025.162422  7397978.602712 
+321026.044768  7397984.841644 
+321029.170090  7398013.936660 
+321030.555456  7398059.078927 
+321032.344888  7398086.574218 
+321029.854527  7398111.509946 
+321018.532452  7398131.316554 
+320996.910835  7398141.444819 
+320984.186901  7398147.623761 
+320961.559245  7398156.482243 
+320948.818818  7398164.930796 
+320937.579206  7398175.159044 
+320928.838201  7398189.946511 
+320914.283604  7398203.164247 
+320901.312283  7398208.333361 
+320881.793455  7398209.153221 
+320869.646758  7398207.523500 
+320856.988794  7398205.893779 
+320843.819563  7398205.763802 
+320824.556369  7398206.333704 
+320800.452636  7398209.633139 
+320781.181195  7398211.712783 
+320760.128569  7398213.532471 
+320739.364560  7398212.072721 
+320720.884757  7398209.873098 
+320695.560583  7398208.623312 
+320679.818528  7398212.252690 
+320670.104469  7398217.021873 
+320667.350228  7398218.181675 
+320650.519671  7398230.369587 
+320637.276224  7398238.568183 
+320625.541838  7398247.776605 
+320592.194081  7398265.353594 
+320578.703248  7398272.792320 
+320562.136571  7398284.230361 
+320551.820536  7398305.556708 
+320544.481391  7398333.471926 
+320542.287894  7398353.368518 
+320542.304386  7398380.593855 
+320543.046547  7398412.108457 
+320544.192773  7398425.986080 
+320548.860139  7398443.683048 
+320555.102536  7398454.081267 
+320563.629138  7398464.239527 
+320565.814390  7398475.357623 
+320565.501033  7398482.916328 
+320557.329018  7398490.655002 
+320550.962928  7398493.614495 
+320542.345617  7398494.294379 
+320521.004372  7398501.143206 
+320512.032473  7398512.401277 
+320509.880207  7398527.258732 
+320511.273820  7398542.146182 
+320512.964297  7398552.244453 
+320517.656403  7398565.902113 
+320515.223765  7398583.529094 
+320510.350242  7398590.787851 
+320498.368469  7398598.736489 
+320477.266365  7398607.864925 
+320466.571004  7398613.563949 
+320442.442533  7398620.642737 
+320423.641127  7398625.751861 
+320390.351094  7398637.279887 
+320372.283603  7398646.688275 
+320361.151191  7398656.546587 
+320349.812624  7398666.634859 
+320333.138746  7398690.170827 
+320325.370796  7398709.767470 
+320308.334084  7398746.151238 
+320299.024089  7398767.747539 
+320289.202829  7398790.593626 
+320277.072623  7398815.939284 
+320262.963323  7398836.475766 
+320241.745771  7398857.702131 
+320227.999305  7398865.380815 
+320211.712999  7398874.049330 
+320200.300216  7398878.118633 
+320181.721458  7398884.597524 
+320159.118540  7398889.926611 
+320144.399019  7398892.556160 
+320130.924678  7398897.975232 
+320115.875307  7398910.183141 
+320110.688428  7398923.240904 
+320111.133724  7398931.059565 
+320113.335468  7398940.407964 
+320115.834076  7398944.217311 
+320123.874150  7398952.365915 
+320133.481009  7398954.975468 
+320141.850933  7398954.045628 
+320154.261510  7398954.165607 
+320170.737479  7398953.825665 
+320181.878137  7398955.185433 
+320189.456423  7398957.535030 
+320198.016010  7398963.663980 
+320203.013226  7398972.282504 
+320202.939010  7398980.351122 
+320199.294176  7398992.419055 
+320190.594403  7399001.657472 
+320183.444921  7399008.396318 
+320168.898570  7399020.104312 
+320154.640837  7399028.792824 
+320141.422129  7399033.452026 
+320128.475547  7399036.351529 
+320116.229895  7399045.819908 
+320108.750563  7399060.617373 
+320104.577971  7399074.445004 
+320099.432323  7399083.973372 
+320094.064027  7399089.212475 
+320088.473082  7399090.932180 
+320073.761807  7399092.801860 
+320058.786652  7399096.441237 
+320045.353542  7399099.550704 
+320031.706031  7399110.278866 
+320022.272343  7399119.437298 
+320002.102063  7399148.392338 
+319993.072440  7399162.419935 
+319980.645370  7399187.535633 
+319970.370567  7399208.032122 
+319965.109472  7399218.860267 
+319940.139885  7399259.353331 
+319915.129068  7399302.615921 
+319905.357285  7399320.572845 
+319902.957631  7399326.111896 
+319896.674004  7399344.348772 
+319895.676210  7399349.667861 
+319895.280391  7399362.865601 
+319895.898858  7399368.904566 
+319901.291893  7399385.891656 
+319907.592013  7399403.818586 
+319917.198872  7399418.995986 
+319923.837087  7399428.584344 
+319939.430710  7399449.630738 
+319947.949066  7399462.038613 
+319956.830256  7399475.116373 
+319968.045130  7399492.173451 
+319982.212154  7399515.519452 
+319990.450139  7399527.907330 
+319995.010304  7399536.075931 
+320009.144344  7399562.211454 
+320029.248654  7399595.605734 
+320042.285944  7399615.932253 
+320056.906511  7399639.978134 
+320066.933928  7399658.644936 
+320075.806872  7399676.601860 
+320086.040444  7399696.888386 
+320095.803981  7399718.104751 
+320106.260202  7399740.250958 
+320119.445925  7399767.536284 
+320125.119331  7399780.114130 
+320130.075316  7399793.621816 
+320139.393557  7399813.438422 
+320146.402853  7399830.905430 
+320150.509475  7399838.374150 
+320153.939907  7399843.983189 
+320161.509947  7399853.571547 
+320168.412042  7399861.310222 
+320176.023313  7399867.659134 
+320188.747247  7399875.467796 
+320201.735060  7399880.956856 
+320209.610211  7399884.996164 
+320232.534732  7399897.793972 
+320253.372957  7399908.942063 
+320258.460881  7399912.241497 
+320267.408041  7399923.949492 
+320277.188071  7399943.766098 
+320282.647075  7399955.194140 
+320284.205613  7399960.773184 
+320289.953236  7399986.108845 
+320292.921879  7399996.567053 
+320301.852547  7400015.553801 
+320315.318641  7400033.130790 
+320320.282872  7400038.089941 
+320335.018886  7400048.158216 
+320351.041312  7400056.516784 
+320357.415649  7400058.506444 
+320377.404512  7400061.475935 
+320392.288958  7400062.895692 
+320396.882109  7400062.865697 
+320403.907897  7400062.755716 
+320421.480615  7400060.776055 
+320439.482136  7400057.796565 
+320455.075758  7400056.376808 
+320474.355445  7400053.687269 
+320484.135475  7400052.837415 
+320514.184739  7400050.987731 
+320519.140724  7400051.837586 
+320533.035623  7400056.096856 
+320547.210893  7400062.045837 
+320561.386164  7400067.574890 
+320573.433907  7400072.674017 
+320580.237047  7400079.902779 
+320584.483856  7400091.250835 
+320584.772474  7400101.169136 
+320584.203484  7400114.066927 
+320580.517419  7400129.804231 
+320575.413002  7400142.412071 
+320569.888027  7400152.900275 
+320566.630766  7400163.108526 
+320565.212415  7400170.907190 
+320563.934249  7400190.603817 
+320561.806721  7400241.915027 
+320562.515897  7400250.283594 
+320566.911138  7400262.191554 
+320572.584545  7400276.359127 
+320583.213936  7400292.516360 
+320590.866438  7400305.704101 
+320598.238568  7400316.192304 
+320603.763543  7400322.281261 
+320611.704663  7400328.660169 
+320623.892592  7400336.888759 
+320631.545094  7400344.257497 
+320644.161827  7400357.015312 
+320664.290876  7400382.101015 
+320669.106675  7400387.200141 
+320675.909815  7400391.459412 
+320717.586265  7400415.125358 
+320731.332731  7400422.784046 
+320738.985233  7400427.743197 
+320743.660846  7400432.702347 
+320746.497549  7400438.801303 
+320750.183614  7400451.129191 
+320750.612418  7400458.078001 
+320749.474439  7400466.576545 
+320746.497549  7400475.085087 
+320740.832389  7400486.843073 
+320735.158982  7400498.471082 
+320732.470711  7400506.829650 
+320732.610897  7400512.078751 
+320733.320073  7400516.897925 
+320732.891269  7400524.976541 
+320731.332731  7400530.505594 
+320726.657118  7400536.884502 
+320719.713792  7400547.512681 
+320707.097059  7400562.680083 
+320698.306577  7400570.618723 
+320689.804714  7400580.826975 
+320668.117127  7400596.274329 
+320643.172279  7400613.561368 
+320612.265407  7400632.418138 
+320606.880618  7400635.247653 
+320571.166193  7400649.855151 
+320554.294405  7400654.954277 
+320545.512170  7400657.083913 
+320512.626202  7400661.043235 
+320484.135475  7400663.742772 
+320463.866240  7400665.442481 
+320439.910940  7400667.282166 
+320430.419529  7400671.601426 
+320519.247925  7400668.371979 
+320599.071438  7400661.123221 
+320651.492726  7400648.615363 
+320693.886598  7400620.600162 
+320754.413931  7400594.194685 
+320771.063070  7400550.142231 
+320790.466451  7400507.589520 
+320811.123259  7400473.505358 
+320829.141273  7400428.203118 
+320836.678328  7400380.111356 
+320848.124096  7400288.097117 
+320862.893095  7399944.915901 
+320866.076140  7399938.087070 
+320857.203196  7399889.555383 
+320873.505994  7399825.656329 
+320901.411238  7399755.218394 
+320963.241476  7399650.296366 
+321044.796697  7399541.534996 
+321113.496044  7399453.210125 
+321202.720260  7399351.847488 
+321260.963387  7399303.635746 
+321339.813844  7399265.572266 
+321436.335974  7399243.815993 
+321568.201448  7399228.868553 
+321670.273291  7399221.439826 
+321759.951050  7399215.590827 
+321879.859489  7399206.542377 
+321908.779020  7399203.722860 
+321966.222263  7399200.423425 
+322094.170778  7399192.034862 
+322193.109053  7399181.566655 
+322392.972945  7399167.499065 
+322464.888323  7399161.410108 
+322580.162381  7399152.961555 
+322758.734505  7399139.843802 
+322869.143288  7399131.745189 
+322955.530800  7399123.646577 
+323033.202046  7399119.787238 
+323082.283611  7399112.658459 
+323118.797920  7399107.119408 
+323152.656943  7399100.450550 
+323196.007378  7399089.912355 
+323224.506351  7399080.224015 
+323253.409390  7399072.815284 
+323290.649367  7399060.407409 
+323336.251023  7399042.230522 
+323386.371612  7399017.544751 
+323417.863967  7398998.288049 
+323458.855980  7398976.321812 
+323489.952516  7398952.495893 
+323512.679127  7398932.529313 
+323539.199005  7398909.883192 
+323563.830496  7398887.996941 
+323600.880810  7398842.014818 
+323619.022518  7398818.258887 
+323633.370959  7398796.822559 
+323655.990370  7398757.779246 
+323671.773655  7398722.585275 
+323683.351363  7398683.611951 
+323697.386448  7398645.258520 
+323705.071935  7398620.162819 
+323738.634093  7398607.974907 
+323760.173248  7398607.634965 
+323778.727267  7398615.593602 
+323790.659562  7398636.480024 
+323786.676633  7398674.933437 
+323806.566541  7398658.686220 
+323818.836933  7398640.789286 
+323818.498837  7398619.242976 
+323806.566541  7398597.366724 
+323786.709618  7398579.659757 
+323743.070565  7398541.736253 
+323728.713878  7398532.747792 
+Region 1
+524
+325145.243132  7405147.694712 
+325199.882656  7405207.124532 
+325238.417292  7405261.515215 
+325274.675968  7405281.921720 
+325324.532679  7405286.450944 
+325375.214012  7405273.403179 
+325545.927479  7405414.878945 
+325664.887603  7405456.271855 
+325614.082576  7405535.638261 
+325652.246131  7405634.771280 
+325679.755556  7405771.437870 
+325721.143388  7405941.368763 
+325711.148956  7406058.758655 
+325601.259687  7406208.622984 
+325516.340004  7406266.063145 
+325284.183872  7406381.113438 
+325183.876723  7406489.574860 
+325156.680654  7406585.758384 
+325166.073111  7406627.001320 
+325171.301221  7406602.245560 
+325178.087869  7406573.330513 
+325166.073111  7406627.001320 
+325162.848835  7406678.852438 
+325171.969166  7406768.877018 
+325254.794306  7406833.875884 
+325385.101243  7406884.707177 
+325466.326615  7406904.283824 
+325543.206223  7406979.400957 
+325727.361046  7407039.950585 
+325874.869620  7407079.163869 
+325997.565286  7407092.791534 
+326072.540015  7407113.238032 
+326202.055313  7407542.664475 
+326195.235680  7407651.725794 
+326236.128738  7407760.787113 
+326208.866700  7407863.029599 
+326147.522990  7408026.621578 
+326127.072338  7408203.841222 
+326018.007691  7408435.601523 
+326011.196305  7408599.193501 
+326065.728628  7408633.267665 
+326202.047067  7408619.639999 
+326393.532789  7408578.846986 
+326364.069007  7408604.372614 
+326342.991641  7408631.927894 
+326325.724034  7408650.884647 
+326304.399282  7408679.699711 
+326291.708333  7408702.445815 
+326287.931559  7408731.250881 
+326290.248750  7408751.457420 
+326295.353167  7408770.654132 
+326303.005669  7408784.291796 
+326307.862699  7408809.297512 
+326308.662583  7408833.553358 
+326310.212874  7408858.559074 
+326306.939121  7408880.795265 
+326304.407528  7408894.692885 
+326294.775930  7408920.718427 
+326285.136087  7408936.895656 
+326268.379746  7408962.171326 
+326267.381952  7408977.828644 
+326268.173590  7408999.304966 
+326268.956982  7409012.952628 
+326273.550133  7409029.619773 
+326280.180102  7409043.507394 
+326293.687428  7409063.713933 
+326302.865483  7409085.690169 
+326307.722513  7409104.886881 
+326306.502070  7409147.329610 
+326302.725297  7409177.904373 
+326299.971056  7409210.238835 
+326294.413096  7409240.563640 
+326287.568725  7409259.260438 
+326276.403329  7409275.177711 
+326265.468827  7409280.746757 
+326259.622249  7409280.496800 
+326242.329904  7409278.987059 
+326231.395402  7409277.737273 
+326213.591790  7409275.217704 
+326180.780038  7409270.688480 
+326164.749366  7409268.678824 
+326152.792331  7409259.850337 
+326143.886402  7409254.801202 
+326125.555031  7409242.433320 
+326102.663495  7409237.394183 
+326082.320044  7409239.173878 
+326066.050231  7409242.463315 
+326051.050337  7409247.532447 
+326005.547637  7409261.200105 
+325984.453779  7409269.038763 
+325958.775017  7409272.088240 
+325930.803802  7409276.907415 
+325919.671391  7409290.685055 
+325909.668713  7409300.173430 
+325895.114116  7409308.082075 
+325878.860795  7409310.171717 
+325846.832436  7409315.610785 
+325788.449123  7409319.240164 
+325758.927617  7409327.498749 
+325721.102157  7409330.098304 
+325689.090289  7409334.277588 
+325654.761231  7409341.206401 
+325627.565163  7409346.205545 
+325603.914973  7409350.984726 
+325583.084995  7409353.524291 
+325567.615066  7409353.344322 
+325541.730148  7409353.814242 
+325426.431351  7408741.909055 
+325270.173526  7408757.036464 
+325209.695671  7408787.281284 
+325164.324910  7408757.036464 
+324947.589230  7408767.114738 
+324786.292958  7408782.232148 
+324674.861644  7408739.399485 
+324605.832447  7408468.165945 
+324473.785555  7408232.826257 
+324388.098973  7408147.140934 
+324226.802701  7408091.700430 
+323987.381641  7408069.404249 
+323962.189406  7408173.676388 
+323932.321559  7408300.704630 
+323909.265098  7408387.819708 
+323919.341992  7408488.632439 
+323944.542473  7408521.396827 
+324000.311730  7408553.851268 
+323981.502078  7408563.689583 
+323929.468363  7408602.053011 
+323902.181586  7408619.340050 
+323865.461121  7408626.088894 
+323816.610450  7408629.438321 
+323803.399989  7408644.275779 
+323792.391271  7408651.764496 
+323778.042830  7408652.944294 
+323762.630624  7408649.064959 
+323744.876490  7408637.856879 
+323694.623960  7408599.153508 
+323662.950188  7408582.016444 
+323625.256668  7408566.999016 
+323595.751655  7408563.279653 
+323560.243386  7408565.459280 
+323531.612473  7408575.157618 
+323499.311987  7408595.554125 
+323471.142864  7408626.788774 
+323433.168971  7408686.008631 
+323412.033882  7408714.133813 
+323356.272871  7408680.809521 
+323340.761711  7408665.532138 
+323332.771113  7408647.615207 
+323338.073440  7408622.979427 
+323349.016188  7408583.066264 
+323369.186468  7408506.809326 
+323378.001688  7408480.363856 
+323381.753723  7408451.678769 
+323376.789492  7408433.241927 
+323369.953367  7408430.022479 
+323310.407336  7408525.216173 
+323285.949016  7408575.167617 
+323266.083846  7408604.292628 
+323240.083481  7408624.859105 
+323189.567072  7408664.212364 
+323171.128500  7408685.708682 
+323156.079129  7408692.207569 
+323121.346006  7408697.166719 
+323084.922405  7408707.474954 
+323012.512254  7408723.502208 
+322973.557060  7408733.830439 
+322892.216241  7408763.895289 
+322856.287414  7408773.943568 
+322797.541267  7408796.149764 
+322746.307436  7408812.696930 
+322706.362695  7408824.314940 
+322646.717708  7408831.833652 
+322618.490861  7408831.143770 
+322552.166428  7408825.304770 
+322542.592554  7408824.914837 
+322415.180044  7408807.857759 
+322404.113603  7408809.247521 
+322380.933448  7408809.517475 
+322358.701611  7408803.438516 
+322329.963497  7408801.988764 
+322313.132940  7408807.247863 
+322284.716429  7408813.396810 
+322253.496200  7408815.526445 
+322238.108734  7408813.926719 
+322203.441580  7408824.214957 
+322179.230647  7408821.955344 
+322153.997181  7408817.926034 
+322122.339902  7408827.174450 
+321973.693348  7408865.477889 
+321996.263281  7408563.349641 
+321935.925612  7408473.505031 
+321799.829821  7408443.270209 
+321704.066344  7408372.702297 
+321598.217728  7408216.449062 
+321497.407558  7408145.881150 
+321436.921456  7408110.597193 
+321426.836316  7408060.195827 
+321371.396908  7408024.911870 
+321361.311768  7407984.588777 
+321401.635835  7407868.658635 
+321446.998350  7407808.168997 
+321537.731626  7407782.963314 
+321517.569592  7407682.160581 
+321361.352999  7407680.190918 
+321364.602014  7407675.361745 
+321356.331044  7407684.780132 
+321300.413354  7407685.050086 
+321039.337692  7407658.644609 
+320752.566775  7407630.059505 
+320617.988291  7407611.932610 
+320597.818011  7407607.713333 
+320325.016208  7407570.939632 
+320309.117476  7407583.667452 
+320298.603532  7407592.395957 
+320286.786683  7407604.903814 
+320275.497593  7407614.382190 
+320260.679117  7407622.060875 
+320245.769932  7407628.669743 
+320242.957967  7407619.801262 
+320236.369229  7407610.192908 
+320231.817310  7407606.663513 
+320223.241230  7407602.644201 
+320214.920783  7407601.164455 
+320172.576389  7407596.285290 
+320118.679025  7407597.045160 
+320071.279691  7407586.107034 
+320059.438104  7407587.936720 
+320047.860396  7407588.506623 
+320052.494778  7407577.808455 
+320049.600351  7407562.881012 
+320045.015447  7407540.114912 
+320044.363995  7407530.256600 
+320043.852728  7407506.270709 
+320043.753774  7407491.623218 
+320041.213934  7407467.857289 
+320031.780247  7407446.560937 
+320018.759448  7407428.504030 
+320007.660022  7407420.305434 
+319987.267094  7407402.688452 
+319969.562436  7407394.679824 
+319954.166724  7407384.421581 
+319937.971127  7407377.702732 
+319923.028957  7407372.493624 
+319908.598053  7407367.804427 
+319903.073079  7407361.445516 
+319892.625104  7407340.379125 
+319885.887934  7407328.441170 
+319877.608718  7407318.512870 
+319871.160166  7407303.305475 
+319866.220674  7407290.117734 
+319857.751795  7407273.880515 
+319849.843660  7407252.844119 
+319842.009741  7407224.738933 
+319833.425415  7407195.363965 
+319822.985687  7407173.037789 
+319814.244682  7407159.060183 
+319806.443748  7407151.661450 
+319798.857216  7407148.052069 
+319793.291010  7407145.972425 
+319791.056282  7407140.653336 
+319792.639558  7407132.544725 
+319790.850126  7407125.675901 
+319779.767192  7407109.968592 
+319766.746394  7407099.850325 
+319752.439183  7407091.531750 
+319743.599224  7407086.902543 
+319739.863682  7407079.283848 
+319741.512928  7407067.685835 
+319743.648702  7407058.117474 
+319748.827334  7407049.079022 
+319763.992153  7407033.321721 
+319769.327464  7407009.645776 
+319771.982750  7406998.807633 
+319771.652901  7406982.140488 
+319769.277986  7406965.963259 
+319762.177982  7406940.637597 
+319755.110962  7406912.292452 
+319751.532098  7406890.536179 
+319743.607470  7406870.769565 
+319736.804330  7406841.664550 
+319729.168321  7406818.858457 
+319726.339863  7406797.872051 
+319723.206296  7406757.698933 
+319722.513612  7406727.134168 
+319718.374005  7406717.115884 
+319719.784110  7406704.688013 
+319725.383301  7406696.359439 
+319726.158446  7406671.873634 
+319724.080396  7406651.907054 
+319722.793984  7406629.170948 
+319722.859954  7406599.636007 
+319723.255773  7406586.248301 
+319725.399793  7406575.420155 
+319730.660888  7406559.312914 
+319738.478315  7406540.456144 
+319747.912003  7406514.290626 
+319755.795399  7406490.124766 
+319758.500163  7406474.497442 
+319760.281349  7406450.021635 
+319759.720605  7406431.084879 
+319755.416073  7406406.299124 
+319750.278671  7406387.052421 
+319746.007124  7406358.727273 
+319741.133601  7406338.990654 
+319738.173204  7406330.622087 
+319727.758215  7406309.145766 
+319707.975508  7406302.296939 
+319701.980498  7406292.898549 
+319693.569343  7406270.842327 
+319688.135077  7406256.654757 
+319676.911957  7406236.088280 
+319667.659686  7406222.110674 
+319655.405787  7406203.293897 
+319639.911120  7406178.648119 
+319627.945839  7406156.561902 
+319614.974519  7406133.455860 
+319606.043851  7406112.919377 
+319603.438042  7406095.472366 
+319600.840479  7406077.005529 
+319600.988911  7406063.127906 
+319603.883338  7406053.309588 
+319609.630961  7406039.222001 
+319620.755126  7406020.145269 
+319628.539568  7406005.327807 
+319637.651653  7405984.971294 
+319640.900668  7405966.064532 
+319642.154095  7405944.108293 
+319644.075467  7405930.740583 
+319623.699031  7405911.353904 
+319597.706912  7405893.416976 
+319578.534425  7405880.599172 
+319566.156833  7405872.900491 
+319545.343347  7405870.670872 
+319523.993856  7405870.460908 
+319512.366671  7405865.041837 
+319501.811495  7405853.573801 
+319485.286049  7405830.427766 
+319473.048643  7405809.851290 
+319466.055839  7405798.673205 
+319459.038297  7405789.514774 
+319446.924584  7405781.566135 
+319433.780093  7405774.617326 
+319411.498777  7405766.818661 
+319401.438376  7405757.120323 
+319390.932678  7405741.113065 
+319378.860196  7405728.875161 
+319370.308855  7405720.456603 
+319352.826846  7405715.477456 
+319342.939616  7405713.617774 
+319317.532979  7405712.347992 
+319299.531458  7405708.378672 
+319288.184644  7405700.440031 
+319275.130861  7405684.652736 
+319267.115525  7405673.464652 
+319261.895661  7405663.066433 
+319260.749435  7405651.438425 
+319266.802168  7405631.551831 
+319270.512972  7405617.444248 
+319271.923077  7405604.326495 
+319270.001706  7405593.958271 
+319264.897289  7405571.692085 
+319256.717028  7405552.415387 
+319249.460345  7405541.737216 
+319243.490074  7405529.309345 
+319235.986004  7405518.121261 
+319235.161381  7405499.934376 
+319236.084959  7405485.296884 
+319239.317481  7405467.659905 
+319244.636300  7405445.743659 
+319251.934214  7405428.396630 
+319261.021561  7405410.809643 
+319260.947344  7405393.892540 
+319259.067204  7405379.235051 
+319257.162325  7405367.597044 
+319252.981486  7405354.169344 
+319248.107963  7405334.682682 
+319240.653371  7405318.195506 
+319235.746864  7405301.738325 
+319230.955804  7405274.163049 
+318996.424758  7404953.697942 
+318781.668173  7404524.191512 
+318558.962222  7404213.984648 
+318412.674090  7403906.477321 
+318417.019854  7403895.219249 
+318439.664003  7403836.619287 
+318442.533691  7403795.776283 
+318440.447395  7403736.216485 
+318411.000105  7403666.298461 
+318372.613902  7403568.545206 
+318335.060567  7403493.997975 
+318320.893543  7403420.200616 
+318333.699939  7403343.133817 
+318350.514004  7403275.185456 
+318373.743635  7403232.032847 
+318419.889542  7403183.551152 
+318473.069484  7403146.237543 
+318634.266800  7403082.758417 
+318878.751046  7402970.657618 
+318936.779771  7402963.668816 
+318994.973421  7402936.003554 
+319053.686583  7402905.808726 
+319076.940954  7402940.782736 
+319089.722611  7402957.949795 
+319251.868245  7402978.646250 
+319392.161367  7402959.099598 
+319553.160774  7403009.700931 
+319801.990783  7403122.831552 
+320024.746212  7403086.307809 
+320154.047108  7403020.469086 
+320162.441771  7402998.272888 
+320167.793575  7402987.434745 
+320179.701132  7402972.937228 
+320191.625181  7402969.117882 
+320205.957130  7402973.797081 
+320228.700234  7402978.326305 
+320255.508730  7402983.415433 
+320273.749393  7402984.805195 
+320298.504577  7402985.275115 
+320315.302149  7402983.895351 
+320337.608203  7402978.886209 
+320436.727895  7402942.572429 
+320477.307596  7402925.625332 
+320500.182640  7402922.055943 
+320515.182533  7402910.117988 
+320551.746320  7402899.129871 
+320563.282797  7402896.090391 
+320583.428338  7402897.310182 
+320591.023117  7402898.150038 
+320613.700251  7402903.089192 
+320633.854039  7402904.129014 
+320663.136404  7402905.098848 
+320684.469402  7402905.048857 
+320702.058612  7402904.139013 
+320734.392083  7402893.740794 
+320783.655065  7402888.311724 
+320830.163805  7402903.879057 
+320970.762038  7402996.433203 
+320991.410599  7403092.356773 
+320946.930431  7403487.869025 
+321002.658458  7403453.704877 
+321028.238266  7403437.807600 
+321090.332382  7403422.910152 
+321099.073387  7403445.296317 
+321119.260159  7403477.970720 
+321142.918595  7403512.094875 
+321155.279695  7403532.961301 
+321207.090762  7403600.209782 
+321214.561847  7403620.636283 
+321219.319922  7403644.732156 
+321210.348023  7403660.849395 
+321191.043597  7403684.125408 
+321169.050900  7403699.072848 
+321245.361518  7403734.656752 
+321336.927664  7403766.711262 
+321382.710736  7403782.728518 
+321421.624699  7403798.755773 
+321455.962003  7403828.510676 
+321478.738092  7403839.368816 
+321524.059376  7403861.585011 
+321608.946074  7403877.032365 
+321698.615586  7403892.609696 
+321692.966918  7403783.368408 
+321691.746476  7403764.421654 
+321698.615586  7403711.770673 
+321714.638012  7403643.092436 
+321723.799574  7403581.283024 
+321753.560221  7403527.492238 
+322389.946578  7403916.655578 
+322511.900084  7404001.031125 
+322804.212468  7404268.035389 
+323137.508618  7404495.796376 
+323487.478646  7404590.230200 
+323840.186424  7404582.341552 
+324445.839080  7404704.830570 
+324434.236633  7404756.791670 
+324405.193409  7404825.569889 
+324397.697585  7404837.227892 
+324379.423938  7404843.986734 
+324362.659351  7404844.446655 
+324342.522056  7404845.316506 
+324328.346786  7404843.046895 
+324308.242475  7404849.335818 
+324299.872551  7404856.994506 
+324293.036426  7404864.993136 
+324288.162904  7404879.110718 
+324285.944668  7404893.598236 
+324285.656049  7404909.655486 
+324288.014471  7404942.909790 
+324292.789039  7404979.843463 
+324324.248409  7405126.198394 
+324334.185117  7405149.464409 
+324345.680362  7405162.782127 
+324361.348201  7405176.489779 
+324375.853320  7405185.968156 
+324391.183063  7405193.896798 
+324408.673318  7405202.195376 
+324428.175654  7405211.283819 
+324444.231065  7405227.321072 
+324463.395305  7405317.145686 
+324508.345508  7405326.324114 
+324537.240300  7405336.972290 
+324558.053786  7405349.740103 
+324569.796419  7405364.567563 
+324585.109669  7405384.724111 
+324604.950100  7405400.021490 
+324644.086711  7405409.219915 
+324677.450960  7405421.937736 
+324700.548652  7405433.955678 
+324711.969681  7405440.624536 
+324735.496177  7405472.879011 
+324746.702805  7405493.085549 
+324746.777021  7405498.524618 
+324746.875976  7405521.450691 
+324741.202569  7405560.254044 
+324762.552060  7405557.054592 
+324820.217951  7405549.615866 
+324853.573954  7405549.125950 
+324907.801167  7405533.498627 
+324930.783412  7405516.951461 
+325043.863973  7405356.458952 
+325043.855726  7405356.408961 
+325149.547664  7405210.373975 
+325157.142443  7405185.238281 
+325145.243132  7405147.694712 
+Region 1
+718
+323801.594064  7374893.696948 
+323341.363686  7374955.656335 
+323049.917156  7375031.743302 
+322777.700836  7375177.838277 
+322504.519707  7375393.701301 
+322310.749779  7375670.223936 
+321932.519918  7376293.277212 
+321597.722954  7376956.403625 
+321575.021081  7377366.123443 
+321575.021081  7377366.143440 
+321514.757627  7377376.651640 
+321604.047813  7377768.444529 
+321611.758039  7377807.797789 
+321425.846769  7377844.301536 
+321247.093227  7377890.583608 
+321055.417842  7377960.361656 
+320997.356132  7378016.532034 
+320978.026967  7378042.977504 
+320950.113476  7378116.554901 
+320938.700693  7378147.009685 
+320932.359342  7378199.020776 
+320940.382924  7378246.772596 
+320973.483294  7378326.508938 
+320987.130806  7378405.445417 
+320999.590860  7378490.820793 
+321110.378969  7378603.311524 
+321224.712957  7378714.632456 
+321370.019787  7378825.723427 
+321405.272423  7378864.896717 
+321423.298683  7378924.666479 
+321415.687412  7378996.984092 
+321340.547759  7379131.341078 
+321308.956449  7379220.105873 
+321262.324015  7379298.332473 
+321233.726087  7379338.945517 
+321213.333159  7379366.700763 
+321245.592413  7379419.461725 
+321278.676290  7379466.353693 
+321305.319862  7379480.311302 
+321323.082242  7379512.025870 
+321364.948355  7379545.010220 
+321382.702490  7379556.428264 
+321411.885900  7379570.375875 
+321418.227252  7379575.455005 
+321451.212174  7379591.942181 
+321488.872709  7379634.864828 
+321509.570748  7379661.720228 
+321551.189474  7379698.044006 
+321578.146402  7379727.798910 
+321631.235635  7379786.138917 
+321653.417996  7379810.524740 
+321656.716488  7379836.780242 
+321668.285950  7379867.355005 
+321678.626723  7379918.226291 
+321683.401290  7379946.841390 
+321678.230904  7379973.766778 
+321662.282694  7380001.392046 
+321647.357016  7380037.795810 
+321622.469892  7380086.707432 
+321593.286482  7380120.951566 
+321538.745912  7380162.824394 
+321540.708515  7380182.531018 
+321548.657882  7380268.376314 
+321573.858363  7380307.589597 
+321593.443160  7380349.462424 
+321606.282541  7380393.574868 
+321610.949908  7380432.868138 
+321613.836089  7380465.512546 
+321613.662918  7380485.939047 
+321622.890450  7380534.900661 
+321596.321095  7380535.280595 
+321579.688448  7380539.779825 
+321565.298775  7380541.949453 
+321549.416535  7380548.378352 
+321524.636612  7380555.717095 
+321484.147619  7380563.855701 
+321357.708165  7380566.955170 
+321333.777603  7380568.084976 
+321301.732751  7380569.174790 
+321242.269182  7380571.744350 
+321165.505021  7380576.803483 
+321107.781406  7380582.422520 
+321054.222138  7380595.880215 
+320992.985630  7380612.847309 
+320944.134959  7380613.757153 
+320928.227980  7380616.146744 
+320770.048784  7380593.890556 
+320665.923630  7380576.403551 
+320659.557540  7380643.961979 
+320654.049057  7380685.994779 
+320638.892486  7380733.796591 
+320617.122437  7380787.107460 
+320571.067238  7380889.969840 
+320561.781983  7380930.922825 
+320556.463164  7380947.679955 
+320556.652827  7380982.254033 
+320553.717169  7380997.491423 
+320543.500089  7381046.982945 
+320543.500089  7381055.721449 
+320518.060468  7381092.295184 
+320506.936303  7381112.161781 
+320488.646163  7381141.576742 
+320488.654409  7381141.596739 
+320468.912933  7381152.014954 
+320449.303397  7381174.281140 
+320433.602574  7381182.149793 
+320363.550844  7381219.963315 
+320351.280453  7381230.551502 
+320308.235129  7381218.973485 
+320305.381933  7381169.691927 
+320293.606316  7381090.475496 
+320281.154508  7381058.091043 
+320276.346955  7381033.995170 
+320266.905021  7381005.310084 
+320262.674705  7380968.036468 
+320260.885273  7380948.079887 
+320251.187705  7380907.196890 
+320242.388977  7380884.050854 
+320224.898722  7380863.344401 
+320205.882914  7380849.926699 
+320189.547131  7380834.659315 
+320170.020057  7380805.064384 
+320159.365927  7380783.888011 
+320151.927827  7380758.322390 
+320144.118647  7380721.458705 
+320128.104467  7380678.496064 
+320104.668679  7380672.737050 
+320024.432855  7380552.557636 
+319971.022019  7380462.803010 
+319958.710397  7380438.387192 
+319938.259745  7380406.492656 
+319899.378767  7380344.283312 
+319779.478574  7380165.683904 
+319723.057864  7380051.013546 
+319708.173417  7380017.819232 
+319704.619292  7379991.523736 
+319698.591297  7379975.496481 
+319690.567715  7379940.472481 
+319608.319810  7379939.422660 
+319603.479273  7379969.427521 
+319609.408313  7379986.604579 
+319602.522710  7379990.733871 
+319596.643148  7380008.940753 
+319590.087394  7380018.009199 
+319574.436049  7380022.068504 
+319552.352643  7380021.508600 
+319534.351122  7380033.156605 
+319526.987238  7380047.174204 
+319519.499660  7380074.879458 
+319510.049480  7380109.043606 
+319501.052842  7380134.839187 
+319488.716481  7380151.086404 
+319476.017286  7380165.453943 
+319461.470935  7380173.702530 
+319324.031009  7380253.598845 
+319283.426569  7380280.284274 
+319232.200984  7380316.818016 
+319202.225936  7380330.965593 
+319169.612094  7380358.100945 
+319144.213703  7380387.935834 
+319118.312293  7380429.578701 
+319119.376057  7380437.947268 
+319122.880705  7380471.841462 
+319125.230880  7380506.095595 
+319120.711946  7380542.199410 
+319056.176945  7380519.233344 
+319045.539307  7380517.623620 
+319022.029304  7380506.385545 
+318988.252743  7380494.317612 
+318968.601976  7380477.810440 
+318932.071174  7380432.998115 
+318901.378703  7380374.158194 
+318877.802730  7380329.455851 
+318864.790178  7380293.971929 
+318852.907360  7380261.157550 
+318866.587856  7380222.474176 
+318872.797268  7380209.586384 
+318880.911559  7380197.098523 
+318884.160574  7380175.062298 
+318882.082524  7380152.596146 
+318867.577404  7380113.682811 
+318840.669953  7380058.302297 
+318796.198031  7379966.248066 
+318778.072816  7379928.554522 
+318745.524944  7379864.425507 
+318643.906644  7379645.762962 
+318626.952394  7379609.929100 
+318543.797404  7379457.085281 
+318495.350799  7379342.184962 
+318443.061450  7379223.315323 
+318425.934029  7379187.131521 
+318416.401387  7379175.703479 
+318381.627032  7379134.010620 
+318365.167556  7379183.482146 
+318186.075918  7379135.680334 
+318156.282287  7379128.661537 
+318125.985636  7379120.312967 
+318102.731265  7379111.604458 
+318082.346583  7379102.376039 
+318047.959801  7379098.726664 
+318037.948877  7379132.490881 
+318000.981025  7379136.660166 
+317973.281936  7379139.919608 
+317978.171951  7379179.022910 
+317977.297851  7379250.690634 
+317925.363090  7379280.295563 
+317887.818002  7379301.441941 
+317862.757707  7379310.710353 
+317757.675990  7379363.011395 
+317601.360442  7379432.439502 
+317587.152186  7379473.382489 
+317571.203976  7379464.174066 
+317549.961686  7379448.466757 
+317535.959587  7379426.710483 
+317524.233447  7379407.633751 
+317518.576532  7379392.756299 
+317515.962477  7379381.328257 
+317509.926236  7379364.171196 
+317499.371061  7379338.615573 
+317485.690565  7379373.269637 
+317452.466501  7379475.502126 
+317443.956391  7379516.115169 
+317428.808066  7379497.398375 
+317399.352530  7379435.598961 
+317379.206988  7379430.179889 
+317407.524544  7379312.799995 
+317438.060336  7379192.110668 
+317458.659420  7379128.481567 
+317461.191013  7379087.388606 
+317535.036009  7378971.768411 
+317516.968517  7378868.506099 
+317513.991628  7378855.548318 
+317369.558898  7378659.011983 
+317400.053459  7378659.581886 
+317426.367181  7378588.953984 
+317426.400166  7378588.943985 
+317456.919466  7378513.396926 
+317355.078517  7378530.104064 
+317384.031033  7378464.975220 
+317331.749931  7378477.603057 
+317294.386260  7378479.272771 
+317259.348026  7378476.383266 
+317105.926905  7378447.628191 
+317033.351829  7378478.392922 
+317012.093046  7378398.316638 
+317000.070042  7378368.941670 
+316984.591867  7378342.956121 
+316945.752120  7378338.146945 
+316925.903443  7378344.495857 
+316903.770560  7378348.545163 
+316884.383672  7378340.046619 
+316800.049471  7378229.135617 
+316784.892899  7378214.578111 
+316759.799619  7378203.769962 
+316700.377281  7378205.439676 
+316679.654504  7378198.530860 
+316659.228590  7378192.401909 
+316631.628456  7378189.172463 
+316593.934936  7378185.593076 
+316544.325613  7378180.203999 
+316519.809569  7378175.024886 
+316494.971922  7378171.165547 
+316469.029281  7378157.547880 
+316447.415910  7378148.859368 
+316424.037846  7378134.161885 
+316392.215642  7378109.836052 
+316376.869407  7378097.458172 
+316345.055449  7378056.295223 
+316369.093211  7378043.307448 
+316387.457567  7378034.448965 
+316430.296735  7378018.711661 
+316477.160064  7378007.003666 
+316555.746642  7377986.507177 
+316578.003219  7377977.268760 
+316599.657820  7377966.240649 
+316621.732980  7377946.584016 
+316668.085042  7377918.808773 
+316693.335000  7377906.060957 
+316714.577291  7377896.252637 
+316745.080098  7377887.884070 
+316775.162347  7377880.285372 
+316796.008818  7377876.785971 
+316818.751922  7377877.185903 
+316840.076675  7377876.236066 
+316863.495970  7377871.546869 
+316889.191224  7377864.338104 
+316908.512143  7377860.588746 
+316929.111227  7377860.958683 
+316938.841779  7377866.177789 
+316953.783949  7377870.137110 
+316966.738777  7377869.857158 
+316984.699068  7377868.857330 
+316999.616499  7377858.969023 
+317008.258549  7377853.319991 
+317013.445428  7377846.071233 
+317020.248568  7377832.533552 
+317026.614658  7377813.116877 
+317039.701426  7377802.538689 
+317061.199350  7377803.808472 
+317073.890299  7377808.847609 
+317085.162896  7377812.526978 
+317101.119352  7377817.156186 
+317116.638758  7377815.806417 
+317147.125073  7377808.767622 
+317194.310005  7377787.211315 
+317260.139664  7377743.728763 
+317279.064763  7377730.680998 
+317300.348285  7377717.103324 
+317322.233781  7377696.216901 
+317338.247961  7377671.941060 
+317339.138553  7377649.684872 
+317336.211142  7377623.399374 
+317334.801036  7377597.353836 
+317334.289770  7377564.889397 
+317337.547031  7377533.364796 
+317342.874096  7377499.100666 
+317351.227528  7377450.908920 
+317357.494663  7377439.130938 
+317379.841948  7377365.423563 
+317379.330682  7377332.739162 
+317377.079461  7377309.453150 
+317368.528120  7377275.229013 
+317355.210457  7377247.703728 
+317344.902669  7377223.757829 
+317330.414041  7377191.683323 
+317314.333892  7377164.897911 
+317306.681390  7377148.630698 
+317301.370817  7377133.383310 
+317299.952465  7377108.337600 
+317300.315300  7377087.621148 
+317298.055832  7377064.005193 
+317289.224119  7377044.948458 
+317282.569411  7377030.470938 
+317270.051633  7377004.175442 
+317264.328749  7376980.839439 
+317262.201222  7376955.553770 
+317262.514578  7376930.528057 
+317265.186357  7376904.752472 
+317274.438628  7376865.879131 
+317270.604131  7376838.583806 
+317268.946638  7376824.716182 
+317266.761387  7376811.728406 
+317262.217714  7376800.160388 
+317252.948951  7376791.181926 
+317243.160675  7376782.303446 
+317237.462530  7376765.066399 
+317233.240460  7376752.608533 
+317231.079947  7376729.652465 
+317223.147073  7376711.605556 
+317218.149857  7376695.148375 
+317215.733712  7376676.401586 
+317223.658340  7376662.763922 
+317238.229429  7376639.357932 
+317256.164981  7376608.453225 
+317254.466257  7376597.355126 
+317253.765328  7376588.156702 
+317249.798891  7376579.358209 
+317244.776936  7376564.890687 
+317236.291565  7376550.383172 
+317227.995857  7376536.995465 
+317214.645209  7376528.296955 
+317196.148914  7376506.910619 
+317194.532653  7376480.855082 
+317200.107105  7376467.747327 
+317205.722788  7376459.398757 
+317208.130687  7376445.801086 
+317207.710129  7376431.063611 
+317205.013612  7376417.965854 
+317197.262155  7376402.028584 
+317192.388633  7376384.241631 
+317187.333694  7376372.323672 
+317184.925794  7376361.445536 
+317182.427186  7376349.007666 
+317182.575618  7376337.149697 
+317190.219874  7376321.742336 
+317196.066452  7376310.744220 
+317202.993286  7376303.405477 
+317217.655084  7376297.166546 
+317230.642897  7376294.227050 
+317243.713172  7376293.067248 
+317262.506332  7376282.888992 
+317272.500764  7376266.731759 
+317278.685437  7376244.875503 
+317280.070803  7376224.069067 
+317278.710175  7376202.562751 
+317280.079050  7376183.196068 
+317282.759075  7376164.179325 
+317285.414361  7376148.042090 
+317284.762909  7376134.854349 
+317286.939914  7376099.550396 
+317285.867904  7376079.593814 
+317280.870688  7376063.366594 
+317274.991125  7376044.129889 
+317272.599718  7376023.823367 
+317272.492517  7375999.347560 
+317275.749779  7375967.712978 
+317275.815748  7375945.996698 
+317276.755819  7375920.421079 
+317276.137351  7375896.715140 
+317275.791010  7375874.998859 
+317277.407271  7375852.202764 
+317286.486371  7375827.506994 
+317292.390672  7375812.179620 
+317304.042596  7375801.921377 
+317321.318449  7375790.613314 
+317333.316715  7375785.454198 
+317346.675608  7375777.425573 
+317352.349015  7375764.307820 
+317358.253316  7375756.739116 
+317370.193858  7375740.391916 
+317369.039386  7375726.304330 
+317358.294547  7375713.326552 
+317347.706387  7375703.558226 
+317329.127629  7375680.942100 
+317316.337726  7375659.855712 
+317306.145385  7375643.108580 
+317299.630862  7375625.861534 
+317290.724933  7375604.585179 
+317288.053155  7375581.849073 
+317286.403909  7375566.651677 
+317285.422607  7375555.783538 
+317287.113084  7375534.987100 
+317286.923421  7375525.458733 
+317288.811808  7375521.159469 
+317293.289511  7375514.350635 
+317293.371973  7375507.481812 
+317294.815064  7375498.193403 
+317293.017385  7375486.985323 
+317293.132833  7375477.686915 
+317296.571511  7375472.297839 
+317289.174642  7375451.941325 
+317277.242346  7375411.798202 
+317268.361156  7375388.322223 
+317262.852674  7375363.986391 
+317256.758709  7375337.660901 
+317243.210152  7375320.323870 
+317231.937555  7375300.577253 
+317218.380752  7375283.460185 
+317199.142296  7375256.524799 
+317181.107789  7375231.149145 
+317169.793961  7375214.392015 
+317159.585127  7375190.786059 
+317148.551671  7375168.159935 
+317136.891501  7375146.413660 
+317131.209848  7375120.308131 
+317125.256069  7375098.971786 
+317113.125864  7375066.367371 
+317108.466744  7375039.501973 
+317108.079171  7375021.555047 
+317099.643277  7374986.880986 
+317091.050704  7374948.337588 
+317085.500991  7374919.472533 
+317074.253133  7374897.626275 
+317058.882159  7374879.589364 
+317046.875647  7374861.052539 
+317022.260648  7374839.926158 
+317003.154132  7374826.608439 
+316979.174093  7374812.020938 
+316955.977446  7374799.763038 
+316935.601011  7374790.204675 
+316902.022359  7374775.827138 
+316854.078774  7374753.171018 
+316817.622189  7374733.224435 
+316786.921472  7374709.238544 
+316770.585689  7374686.552430 
+316763.155835  7374669.395368 
+316746.556173  7374643.489806 
+316727.763013  7374621.763527 
+316711.748833  7374597.637660 
+316699.808291  7374566.033073 
+316693.120598  7374538.367812 
+316684.008514  7374508.782880 
+316685.674252  7374482.447391 
+316686.812232  7374456.431847 
+316693.689588  7374421.067905 
+316702.191452  7374393.372649 
+316712.458009  7374371.906326 
+316723.219340  7374351.549813 
+316747.034454  7374306.987446 
+316770.090915  7374257.545915 
+316778.394870  7374221.542082 
+316832.679806  7374073.027521 
+316851.415242  7374034.944044 
+316871.321643  7374009.388422 
+316890.378682  7373994.121037 
+316914.490660  7373973.824513 
+316935.188699  7373949.598663 
+316956.595914  7373917.974080 
+316980.105917  7373881.270367 
+316986.818349  7373857.984356 
+316989.267480  7373841.847120 
+316984.501158  7373823.620242 
+316978.069098  7373800.274241 
+316964.132969  7373773.188881 
+316956.109386  7373754.362105 
+316951.244110  7373728.056611 
+316948.407407  7373702.211038 
+316944.861528  7373682.124479 
+316940.655950  7373653.929309 
+316937.728538  7373635.722427 
+316935.675227  7373604.127839 
+316934.924820  7373590.940098 
+316940.705427  7373569.193823 
+316941.802176  7373555.026250 
+316936.854438  7373534.809713 
+316934.660940  7373523.151710 
+316942.099040  7373499.425774 
+316955.350733  7373491.177187 
+316965.971878  7373490.097372 
+316985.482460  7373487.677786 
+317002.939730  7373486.018070 
+317055.509450  7373481.368867 
+317082.153022  7373470.400745 
+317105.786719  7373456.193179 
+317124.777788  7373446.244883 
+317144.304862  7373442.055603 
+317186.072020  7373436.826496 
+317223.501661  7373436.076625 
+317248.067182  7373428.637899 
+317270.653608  7373416.959899 
+317285.331899  7373409.271216 
+317300.810073  7373402.492377 
+317319.355846  7373387.554936 
+317333.646564  7373378.206537 
+317352.901512  7373363.269096 
+317395.377847  7373334.234070 
+317409.808750  7373321.676221 
+317423.258352  7373314.207500 
+317444.360457  7373306.498820 
+317460.844672  7373301.389695 
+317477.254671  7373293.840988 
+317501.135755  7373292.031298 
+317528.480255  7373282.632908 
+317542.663772  7373281.263143 
+317559.881902  7373274.274340 
+317571.080283  7373267.775453 
+317582.509559  7373258.717005 
+317584.307237  7373245.669240 
+317582.930116  7373233.471329 
+317579.953227  7373219.033802 
+317569.661931  7373202.066709 
+317561.473424  7373188.569021 
+317551.388284  7373171.601927 
+317540.363074  7373156.284551 
+317527.342276  7373138.067671 
+317514.313231  7373119.960773 
+317510.635412  7373104.073494 
+317508.004865  7373078.007959 
+317506.231925  7373048.862951 
+317510.371533  7373027.976529 
+317516.547960  7373006.790158 
+317529.948084  7372979.484835 
+317543.884214  7372965.487232 
+317559.675746  7372950.399817 
+317580.184122  7372941.241386 
+317597.451729  7372930.273264 
+317611.445582  7372920.474943 
+317622.215159  7372906.877272 
+317628.292631  7372894.329421 
+317635.293681  7372872.153220 
+317639.004485  7372852.706551 
+317645.370575  7372833.509839 
+317651.852112  7372820.632045 
+317666.604619  7372806.864403 
+317682.734246  7372804.964729 
+317698.962828  7372804.054884 
+317725.276550  7372803.055056 
+317749.273081  7372800.145554 
+317773.187150  7372787.707685 
+317790.677405  7372775.749733 
+317807.928520  7372765.441499 
+317820.908087  7372755.193254 
+317833.871161  7372745.934840 
+317862.337149  7372720.379217 
+317874.079782  7372710.560899 
+317891.619514  7372694.053727 
+317909.390141  7372675.226951 
+317920.374121  7372661.629281 
+317936.446024  7372640.232946 
+317963.493661  7372613.427537 
+317978.221429  7372601.649555 
+317997.814473  7372584.062567 
+318025.002295  7372562.586246 
+318059.446801  7372547.958751 
+318075.741352  7372541.179912 
+318092.126613  7372535.290921 
+318134.817349  7372513.564643 
+318161.089839  7372507.695648 
+318185.729577  7372502.356563 
+318210.740394  7372499.677022 
+318243.947965  7372494.447917 
+318267.474461  7372488.318967 
+318289.318726  7372477.840762 
+318297.202123  7372467.312565 
+318297.795851  7372452.365126 
+318290.646369  7372420.710548 
+318285.896540  7372409.572456 
+318284.263787  7372393.375230 
+318285.657400  7372379.437617 
+318289.970178  7372368.859429 
+318298.150439  7372359.101101 
+318305.060780  7372353.102129 
+318318.279488  7372339.534453 
+318330.261261  7372327.166571 
+318344.510748  7372312.949006 
+318359.494149  7372305.160341 
+318381.528077  7372296.021906 
+318396.965021  7372292.782461 
+318415.956090  7372290.132915 
+318470.892479  7372283.514048 
+318487.500387  7372284.383899 
+318508.437567  7372297.721615 
+318514.960335  7372306.550102 
+318526.298902  7372320.867650 
+318535.303786  7372334.275353 
+318540.968947  7372346.193312 
+318555.564775  7372361.440700 
+318569.443181  7372368.149551 
+318584.335874  7372368.229537 
+318607.441812  7372363.090418 
+318704.508193  7372330.186054 
+318723.796126  7372320.237758 
+318737.484869  7372309.999512 
+318750.266527  7372290.882786 
+318775.269098  7372272.705900 
+318794.054011  7372254.219066 
+318812.533814  7372244.370753 
+318828.416055  7372245.900491 
+318848.380179  7372247.250260 
+318867.371248  7372245.050637 
+318879.006680  7372244.090801 
+318898.278121  7372236.242146 
+318923.041551  7372228.693439 
+318935.748993  7372215.445708 
+318948.068861  7372192.449647 
+318951.021012  7372176.432390 
+318951.392092  7372154.726109 
+318950.913811  7372119.492144 
+318946.831927  7372095.406269 
+318951.499293  7372064.231609 
+318962.475026  7372042.765286 
+318975.462839  7372031.517213 
+318999.747989  7372013.550291 
+319017.914435  7372003.691979 
+319036.847780  7371997.952962 
+319056.135714  7371996.643187 
+319083.999727  7372002.302217 
+319108.392077  7372008.591140 
+319125.131926  7372015.339984 
+319151.082814  7372027.067975 
+319173.240435  7372040.855614 
+319192.025349  7372047.184529 
+319227.533618  7372060.812195 
+319248.899601  7372064.281601 
+319269.185329  7372072.960114 
+319295.515543  7372079.049071 
+319317.161899  7372084.628116 
+319346.411279  7372093.856535 
+319371.496313  7372101.705191 
+319400.984833  7372107.834141 
+319418.928631  7372107.834141 
+319431.611334  7372104.664684 
+319450.940499  7372091.836881 
+319466.468151  7372080.958744 
+319493.474556  7372065.781344 
+319519.260519  7372057.912692 
+319544.914543  7372052.913548 
+319578.089129  7372042.025413 
+319595.670093  7372029.837501 
+319625.612156  7372008.171212 
+319641.667567  7371995.853322 
+319659.306255  7371979.126187 
+319670.249003  7371960.429390 
+319678.668404  7371939.273014 
+319688.629851  7371908.708249 
+319695.672132  7371867.485310 
+319702.590719  7371827.142221 
+319709.253674  7371791.448335 
+319717.524643  7371757.884084 
+319720.996306  7371724.579789 
+319851.616599  7371796.877405 
+319961.283221  7371840.549924 
+320018.198705  7371895.970431 
+320067.008144  7371996.263252 
+320110.432795  7372128.840542 
+320136.631069  7372243.690870 
+320124.162769  7372345.213480 
+320092.150901  7372509.195391 
+320090.666580  7372628.684924 
+320115.883553  7373012.569168 
+320192.961071  7373267.615481 
+320316.052556  7373438.506209 
+320515.083579  7373545.527877 
+320820.070419  7373594.159547 
+321080.857463  7373572.453265 
+321527.168205  7373538.189134 
+321630.056424  7373487.617796 
+321696.018023  7373413.670463 
+321843.188502  7373261.076601 
+322020.573169  7373089.026071 
+322101.674848  7373010.269562 
+322202.212892  7372976.615326 
+322287.462424  7372967.796837 
+322487.012959  7373033.715546 
+322895.605442  7373204.296327 
+323066.417863  7373296.880468 
+323129.781900  7373306.728781 
+323274.527986  7373343.382502 
+323479.669466  7373360.829514 
+323699.307819  7373418.219684 
+323823.100234  7373534.359790 
+323906.172761  7373704.610627 
+323913.907726  7373898.987332 
+323887.074491  7374043.092648 
+323820.238792  7374181.728901 
+323766.976388  7374445.023801 
+323784.664553  7374692.451419 
+323801.594064  7374893.696948 
+Region 1
+147
+331727.186525  7392674.131320 
+331692.156537  7392705.036027 
+331671.359543  7392723.602846 
+331650.760459  7392741.629758 
+331536.789305  7392841.392670 
+331390.410465  7392972.170269 
+331240.576454  7393109.116811 
+331168.628092  7393169.086539 
+331103.087051  7393230.246063 
+331028.846236  7393298.264412 
+330953.483934  7393366.462730 
+330894.861481  7393420.303508 
+330801.538889  7393511.227933 
+330699.302121  7393599.372835 
+330672.040082  7393625.528355 
+330568.887983  7393716.152831 
+330482.170622  7393807.187238 
+330396.962321  7393901.111150 
+330311.589095  7394000.004210 
+330299.277472  7393989.116075 
+330242.337250  7393938.754702 
+330202.763589  7393915.788636 
+330174.610957  7393904.330598 
+330108.591635  7393887.363505 
+330047.627252  7393895.972030 
+330016.943027  7393904.840511 
+329987.553461  7393916.498514 
+329950.049604  7393932.015856 
+329891.443643  7393959.711112 
+329852.232816  7393979.317754 
+329809.632789  7394000.004210 
+329804.668558  7394009.682552 
+329669.281943  7394074.731410 
+329569.453075  7394122.433239 
+329429.481556  7394185.712400 
+329165.090909  7394296.363447 
+328967.098911  7394382.238737 
+328917.778206  7394394.776589 
+328883.787243  7394426.091225 
+328792.913781  7394490.280230 
+328776.767662  7394451.716836 
+328758.881587  7394420.012267 
+328741.506779  7394402.505265 
+328700.630214  7394335.056819 
+328681.210341  7394304.881987 
+328660.767935  7394274.697158 
+328640.086389  7394247.831760 
+328585.743729  7394189.281789 
+328547.687374  7394140.350170 
+328519.881085  7394109.675424 
+328502.786649  7394094.478028 
+328460.178375  7394050.885495 
+328433.402864  7394028.089399 
+328415.277649  7394010.902343 
+328407.922011  7394004.773393 
+328324.610343  7393952.092417 
+328314.813821  7393925.137034 
+328303.780364  7393911.659343 
+328292.763400  7393893.282491 
+328287.856893  7393876.125429 
+328282.950386  7393863.877527 
+328277.969662  7393848.600144 
+328278.052125  7393832.432914 
+328279.173612  7393807.517181 
+328335.577830  7393715.922871 
+328367.169139  7393642.865385 
+328381.616535  7393612.350612 
+328401.423981  7393577.916510 
+328442.556180  7393518.476691 
+328572.013755  7393325.659719 
+328692.293275  7393143.760877 
+328775.011215  7393020.531985 
+328795.173249  7392990.087200 
+328810.478253  7392973.320072 
+328853.136004  7392939.925792 
+328907.462171  7392895.823346 
+328794.431088  7392739.210173 
+328715.795032  7392628.209186 
+328715.803279  7392628.199188 
+328800.821917  7392551.442336 
+328852.567014  7392483.274012 
+328945.617480  7392365.734146 
+329031.353541  7392255.433039 
+329106.567410  7392160.949224 
+329195.585470  7392048.128549 
+329195.593716  7392048.128549 
+329234.936483  7391999.966798 
+329270.551953  7391949.105511 
+329351.966988  7391848.712707 
+329393.998026  7391790.282715 
+329453.948122  7391717.875118 
+329473.912247  7391695.848891 
+329514.549671  7391660.544938 
+329486.627935  7391638.178769 
+329470.308644  7391628.130491 
+329472.856729  7391593.276461 
+329474.926533  7391573.469854 
+329485.481708  7391517.889374 
+329503.978004  7391411.327627 
+329521.756877  7391313.744342 
+329527.215882  7391291.428165 
+329543.898006  7391183.196704 
+329547.419147  7391152.122027 
+329558.535066  7391100.580855 
+329558.765960  7391099.081112 
+329586.671205  7390947.337104 
+329588.922426  7390912.033152 
+329591.313833  7390864.321324 
+329583.422190  7390823.248360 
+329684.768365  7390895.316015 
+329742.887798  7390927.450511 
+329789.462509  7390960.114916 
+329836.202144  7390988.010137 
+329893.736095  7391025.903647 
+330043.256749  7391125.106654 
+330125.809764  7391177.297714 
+330205.006564  7391226.889220 
+330282.422177  7391276.850662 
+330364.488664  7391331.081372 
+330388.782060  7391339.559920 
+330454.281870  7391387.281746 
+330490.524053  7391405.308658 
+330537.601784  7391447.391450 
+330564.690652  7391470.517488 
+330605.517740  7391515.519780 
+330653.477817  7391561.041982 
+330672.823474  7391582.798256 
+330735.577290  7391647.837115 
+330804.053989  7391714.025778 
+330840.279680  7391748.169929 
+330879.259612  7391793.582150 
+330950.474060  7391859.860797 
+330984.069204  7391894.364887 
+331016.509875  7391928.729001 
+331075.998183  7391991.998163 
+331142.306124  7392053.467634 
+331175.521941  7392089.601445 
+331228.330802  7392143.752169 
+331268.399237  7392184.845130 
+331314.891485  7392231.127203 
+331393.346123  7392309.223826 
+331477.012380  7392393.809337 
+331512.965945  7392428.223442 
+331552.696284  7392470.546192 
+331642.151394  7392566.939681 
+331708.401611  7392647.115948 
+331727.186525  7392674.131320 
+Region 1
+383
+320638.224541  7383590.747222 
+320687.718417  7383585.908051 
+320748.649815  7383586.048027 
+320869.811682  7383587.047855 
+321023.843025  7383594.726540 
+321065.065932  7383592.166978 
+321131.044023  7383583.028544 
+321225.537580  7383548.284495 
+321241.790901  7383541.465663 
+321241.840378  7383525.508396 
+321235.193916  7383501.942433 
+321229.141183  7383471.627626 
+321223.830610  7383447.091829 
+321207.123747  7383386.852147 
+321193.228848  7383354.447698 
+321162.288991  7383272.211784 
+321147.503499  7383233.668386 
+321024.337798  7382972.973041 
+321031.734667  7382962.804783 
+321018.656146  7382946.517572 
+321010.294468  7382930.870253 
+320994.082378  7382905.194651 
+320986.669017  7382885.158083 
+320971.957741  7382853.743464 
+320961.575737  7382835.016671 
+320946.757261  7382812.120593 
+320937.537975  7382798.382946 
+320926.050975  7382778.636329 
+320915.932850  7382755.370314 
+320903.415072  7382735.833661 
+320890.179872  7382717.276839 
+320878.231084  7382693.430924 
+320862.018994  7382667.315397 
+320853.822241  7382645.279172 
+320845.757428  7382620.703381 
+320843.844302  7382602.516497 
+320847.810739  7382586.619220 
+320850.564980  7382561.723484 
+320854.127352  7382537.287670 
+320850.457779  7382521.080446 
+320844.479262  7382509.372451 
+320839.102719  7382498.234359 
+320826.189122  7382486.776322 
+320814.669138  7382477.767865 
+320797.797350  7382464.050215 
+320785.254833  7382455.031759 
+320767.014171  7382445.283429 
+320752.789423  7382432.265659 
+320737.476173  7382416.008444 
+320731.745043  7382400.881035 
+320724.587314  7382385.393688 
+320715.640154  7382366.566913 
+320721.544455  7382351.019576 
+320734.886857  7382336.232109 
+320740.123213  7382325.223994 
+320744.980243  7382312.096243 
+320747.701499  7382298.068646 
+320745.293600  7382286.410643 
+320742.407419  7382272.742984 
+320737.261771  7382251.306656 
+320725.947942  7382217.052523 
+320720.291028  7382196.386063 
+320717.660481  7382177.849238 
+320712.547818  7382153.643385 
+320704.656175  7382132.167063 
+320692.963020  7382111.870540 
+320680.742106  7382093.993602 
+320675.085192  7382086.444895 
+320656.407479  7382064.788605 
+320644.640108  7382051.350906 
+320630.860657  7382035.233667 
+320611.539738  7382013.397407 
+320597.479915  7381995.050550 
+320583.733449  7381976.503727 
+320573.277228  7381955.987241 
+320564.577455  7381941.479726 
+320554.434591  7381920.203371 
+320537.315416  7381901.936500 
+320525.300658  7381891.488289 
+320503.085313  7381881.360024 
+320447.307809  7381853.864734 
+320433.503619  7381839.847135 
+320413.193153  7381816.231180 
+320400.444480  7381799.124110 
+320396.412073  7381787.226148 
+320386.063054  7381765.499870 
+320373.009271  7381749.162668 
+320360.458508  7381732.615503 
+320353.473950  7381727.986296 
+320343.372318  7381719.887683 
+320341.970459  7381709.239507 
+320344.493805  7381703.180545 
+320349.688931  7381695.711824 
+320352.855483  7381687.443240 
+320350.843403  7381676.565104 
+320345.689509  7381664.427183 
+320338.531780  7381641.081182 
+320337.402047  7381625.003936 
+320339.166740  7381606.307138 
+320341.088112  7381591.159733 
+320344.774177  7381573.262798 
+320345.301936  7381546.787333 
+320355.131443  7381519.442017 
+320361.316116  7381481.088587 
+320363.509613  7381452.533478 
+320363.625060  7381409.780801 
+320359.906010  7381389.024357 
+320357.176508  7381370.047607 
+320343.718660  7381336.433365 
+320337.987529  7381313.107361 
+320327.918882  7381285.842031 
+320316.266958  7381254.357424 
+320309.018521  7381230.011594 
+320308.235129  7381218.973485 
+320351.280453  7381230.551502 
+320363.550844  7381219.963315 
+320433.602574  7381182.149793 
+320449.303397  7381174.281140 
+320468.912933  7381152.014954 
+320488.654409  7381141.596739 
+320488.646163  7381141.576742 
+320506.936303  7381112.161781 
+320518.060468  7381092.295184 
+320543.500089  7381055.721449 
+320543.500089  7381046.982945 
+320553.717169  7380997.491423 
+320556.652827  7380982.254033 
+320556.463164  7380947.679955 
+320561.781983  7380930.922825 
+320571.067238  7380889.969840 
+320617.122437  7380787.107460 
+320638.892486  7380733.796591 
+320654.049057  7380685.994779 
+320659.557540  7380643.961979 
+320665.923630  7380576.403551 
+320770.048784  7380593.890556 
+320928.227980  7380616.146744 
+320944.134959  7380613.757153 
+320992.985630  7380612.847309 
+321054.222138  7380595.880215 
+321107.781406  7380582.422520 
+321165.505021  7380576.803483 
+321242.269182  7380571.744350 
+321301.732751  7380569.174790 
+321333.777603  7380568.084976 
+321357.708165  7380566.955170 
+321484.147619  7380563.855701 
+321524.636612  7380555.717095 
+321549.416535  7380548.378352 
+321565.298775  7380541.949453 
+321579.688448  7380539.779825 
+321596.321095  7380535.280595 
+321622.890450  7380534.900661 
+321613.662918  7380485.939047 
+321613.836089  7380465.512546 
+321610.949908  7380432.868138 
+321606.282541  7380393.574868 
+321593.443160  7380349.462424 
+321573.858363  7380307.589597 
+321548.657882  7380268.376314 
+321540.708515  7380182.531018 
+321538.745912  7380162.824394 
+321593.286482  7380120.951566 
+321622.469892  7380086.707432 
+321647.357016  7380037.795810 
+321662.282694  7380001.392046 
+321678.230904  7379973.766778 
+321683.401290  7379946.841390 
+321678.626723  7379918.226291 
+321668.285950  7379867.355005 
+321656.716488  7379836.780242 
+321653.417996  7379810.524740 
+321631.235635  7379786.138917 
+321578.146402  7379727.798910 
+321551.189474  7379698.044006 
+321509.570748  7379661.720228 
+321488.872709  7379634.864828 
+321451.212174  7379591.942181 
+321418.227252  7379575.455005 
+321411.885900  7379570.375875 
+321382.702490  7379556.428264 
+321364.948355  7379545.010220 
+321323.082242  7379512.025870 
+321305.319862  7379480.311302 
+321278.676290  7379466.353693 
+321245.592413  7379419.461725 
+321213.333159  7379366.700763 
+321233.726087  7379338.945517 
+321262.324015  7379298.332473 
+321308.956449  7379220.105873 
+321340.547759  7379131.341078 
+321415.687412  7378996.984092 
+321423.298683  7378924.666479 
+321405.272423  7378864.896717 
+321370.019787  7378825.723427 
+321224.712957  7378714.632456 
+321110.378969  7378603.311524 
+320999.590860  7378490.820793 
+320987.130806  7378405.445417 
+320973.483294  7378326.508938 
+320940.382924  7378246.772596 
+320932.359342  7378199.020776 
+320938.700693  7378147.009685 
+320950.113476  7378116.554901 
+320978.026967  7378042.977504 
+320997.356132  7378016.532034 
+321055.417842  7377960.361656 
+321247.093227  7377890.583608 
+321425.846769  7377844.301536 
+321611.758039  7377807.797789 
+321604.047813  7377768.444529 
+321514.757627  7377376.651640 
+321575.021081  7377366.143440 
+321575.021081  7377366.123443 
+321597.722954  7376956.403625 
+321932.519918  7376293.277212 
+322310.749779  7375670.223936 
+322504.519707  7375393.701301 
+322777.700836  7375177.838277 
+323049.917156  7375031.743302 
+323341.363686  7374955.656335 
+323801.594064  7374893.696948 
+323830.991877  7375319.813958 
+323848.416162  7375581.529128 
+323918.509122  7375990.759031 
+324051.281682  7376201.592917 
+324248.828383  7376428.054126 
+324408.862982  7376720.733993 
+324487.457806  7376976.990098 
+324472.144556  7377282.387787 
+324406.422097  7377564.029544 
+324238.100037  7377972.139638 
+324026.510005  7378414.503865 
+323973.354802  7378626.637529 
+323963.170708  7378827.653097 
+324022.238458  7379087.548579 
+324080.943374  7379378.448750 
+324081.124791  7379691.785079 
+324026.839854  7379996.832827 
+324011.930669  7380259.707799 
+324000.625087  7380553.637451 
+323946.892648  7380812.163168 
+323874.573205  7380996.921521 
+323826.827530  7381081.517030 
+323818.704993  7381111.991810 
+323818.366897  7381140.116992 
+323825.788505  7381167.232348 
+323844.119876  7381186.838989 
+323868.734874  7381209.735067 
+323890.100858  7381222.952803 
+323963.822160  7381251.417928 
+323977.057360  7381261.886134 
+323983.934716  7381275.593786 
+323989.781294  7381281.202826 
+324002.249595  7381287.661719 
+324036.941487  7381303.918935 
+324056.394345  7381315.226998 
+324075.047319  7381333.063942 
+324101.624920  7381371.377380 
+324109.557794  7381390.304138 
+324118.537939  7381415.449830 
+324122.776502  7381436.096294 
+324135.541667  7381511.013461 
+324155.843887  7381595.289026 
+324175.758534  7381669.226361 
+324199.994205  7381780.527296 
+324223.982490  7381849.565470 
+324232.286445  7381896.847371 
+324248.927338  7381988.431684 
+324271.241638  7382109.540939 
+324291.131547  7382177.559288 
+324314.237485  7382260.205131 
+324327.876750  7382319.554965 
+324344.624845  7382411.139278 
+324364.555984  7382476.168139 
+324387.332073  7382550.215455 
+324410.421519  7382606.425827 
+324445.385537  7382651.038185 
+324498.243876  7382692.990999 
+324560.181314  7382717.326831 
+324599.796206  7382757.349975 
+324485.470464  7382897.405985 
+324348.484081  7383072.525988 
+324269.394483  7383182.247194 
+324125.341079  7383355.677487 
+324019.278061  7383516.219987 
+323953.341201  7383679.621998 
+323921.807615  7383874.558607 
+323928.148966  7384066.155788 
+323728.169627  7384084.122711 
+323699.472744  7384089.841731 
+323606.249106  7384104.849161 
+323589.789630  7384105.998964 
+323441.052368  7384131.334624 
+323322.793174  7384149.761468 
+323161.859737  7384177.386736 
+323078.960380  7384203.872199 
+322988.796094  7384222.379029 
+322931.303374  7384234.286989 
+322910.539365  7384221.019262 
+322840.990656  7384241.535747 
+322787.480866  7384251.524037 
+322738.811612  7384262.722118 
+322708.836564  7384281.078974 
+322610.731158  7384319.912322 
+322522.686153  7384344.338138 
+322460.493082  7384351.596895 
+322367.632278  7384363.044934 
+322328.660592  7384359.775494 
+322295.956042  7384351.596895 
+322274.491103  7384349.557244 
+322237.696422  7384352.616720 
+322189.530189  7384367.514169 
+322155.596950  7384379.062190 
+322111.306445  7384395.289411 
+322071.551367  7384407.907250 
+322030.023349  7384421.074994 
+321989.361186  7384430.293415 
+321947.701229  7384445.590795 
+321889.136499  7384481.294679 
+321851.096637  7384497.921831 
+321833.012653  7384506.790312 
+321817.715895  7384401.698313 
+321797.677555  7384296.126397 
+321789.068490  7384249.274422 
+321778.942119  7384218.029774 
+321761.146753  7384188.014915 
+321732.367408  7384163.739073 
+321715.751253  7384145.592182 
+321689.676672  7384124.675765 
+321649.204172  7384096.930517 
+321620.029008  7384088.272000 
+321600.765813  7384077.953768 
+321584.108427  7384063.126307 
+321575.590071  7384050.838412 
+321560.433499  7384038.360550 
+321547.305500  7384027.342437 
+321533.113737  7384019.523776 
+321516.431612  7384007.255877 
+321503.567492  7383999.227253 
+321484.032172  7383986.469438 
+321458.056546  7383966.332887 
+321441.407406  7383959.364081 
+321424.073829  7383950.405615 
+321409.098674  7383948.225989 
+321388.103771  7383945.976374 
+321371.908174  7383943.786749 
+321345.479005  7383943.796747 
+321320.212554  7383942.956891 
+321298.879555  7383941.117206 
+321281.455270  7383931.048931 
+321257.310307  7383911.702245 
+321244.388463  7383890.785828 
+321225.636535  7383856.811647 
+321215.262777  7383854.032123 
+321200.815381  7383858.611339 
+321192.907245  7383863.060577 
+321181.494462  7383864.760286 
+321116.423456  7383877.238148 
+321049.439325  7383888.656193 
+321018.862301  7383877.318135 
+320976.806525  7383870.599286 
+320949.008481  7383865.490161 
+320918.637614  7383854.372065 
+320896.191374  7383846.343440 
+320866.900763  7383841.424283 
+320865.935954  7383830.506153 
+320842.401212  7383822.647499 
+320820.952766  7383807.760049 
+320808.426741  7383797.301841 
+320797.846827  7383786.323721 
+320778.971206  7383770.026513 
+320760.293493  7383761.717936 
+320749.441454  7383756.378850 
+320730.813219  7383744.510883 
+320717.248169  7383736.372277 
+320700.632014  7383718.005423 
+320687.132935  7383703.987825 
+320676.635483  7383686.250863 
+320664.925836  7383667.943999 
+320657.281580  7383642.378378 
+320646.347078  7383619.092366 
+320638.224541  7383590.747222 
+Region 1
+697
+354118.226078  7396716.718862 
+354125.688917  7396694.322698 
+354139.691016  7396662.578135 
+354159.292306  7396625.244530 
+354180.757245  7396600.978687 
+354219.687700  7396565.964684 
+354256.366934  7396534.700040 
+354421.027667  7396421.199481 
+354519.479415  7396289.981958 
+354563.341116  7396234.481464 
+354612.463912  7396189.679139 
+354659.756044  7396137.478080 
+354708.689177  7396083.657299 
+354751.882933  7396032.606044 
+354559.861206  7395710.631195 
+354581.408607  7395691.084543 
+354551.953071  7395633.974326 
+354544.490232  7395619.976724 
+354526.529942  7395587.632264 
+354522.563505  7395555.887701 
+354523.363389  7395517.804225 
+354532.970248  7395469.552490 
+354513.838993  7395420.990808 
+354488.712728  7395367.290007 
+354466.373689  7395330.736268 
+354453.451846  7395304.170818 
+354442.418389  7395257.528808 
+354434.493762  7395215.226054 
+354430.510832  7395194.039683 
+354431.516873  7395169.923814 
+354430.510832  7395158.335798 
+354437.017108  7395132.460231 
+354442.352420  7395084.338474 
+354442.418389  7395072.630479 
+354458.275891  7395015.500265 
+354465.433619  7394985.345430 
+354474.158131  7394967.888420 
+354494.699492  7394904.699244 
+354509.856064  7394841.720032 
+354536.318218  7394744.396702 
+354581.276667  7394600.481354 
+354616.207700  7394514.786033 
+354636.147086  7394477.262460 
+354629.921182  7394474.212983 
+354623.753001  7394471.743406 
+354619.563916  7394470.013702 
+354611.177500  7394466.074377 
+354602.799329  7394462.375010 
+354595.155074  7394461.145221 
+354587.510818  7394460.405348 
+354581.095250  7394458.925601 
+354562.112427  7394426.001241 
+354549.429725  7394408.144299 
+354543.245052  7394396.946218 
+354534.842143  7394381.178918 
+354526.150615  7394367.921189 
+354511.546541  7394360.402477 
+354499.144210  7394358.212852 
+354488.077769  7394351.494003 
+354486.948035  7394341.885649 
+354487.582995  7394332.547249 
+354492.011221  7394324.778579 
+354499.770924  7394314.270379 
+354510.837365  7394302.802344 
+354521.169892  7394289.804570 
+354527.247364  7394272.467540 
+354530.809736  7394254.070691 
+354529.886158  7394247.751773 
+354526.356771  7394227.995157 
+354521.532726  7394210.758110 
+354516.700435  7394193.521062 
+354515.917043  7394177.343834 
+354519.429937  7394161.976466 
+354524.847711  7394155.487577 
+354529.787203  7394146.969036 
+354528.921349  7394136.350855 
+354526.587666  7394122.423241 
+354518.918671  7394108.675596 
+354513.467913  7394099.007252 
+354504.149672  7394076.401124 
+354493.619236  7394049.735692 
+354485.983226  7394033.718435 
+354478.652327  7394014.171783 
+354479.815045  7394003.333640 
+354481.794141  7393988.956103 
+354477.901920  7393977.288101 
+354474.248840  7393966.879884 
+354469.078453  7393955.701799 
+354459.331409  7393945.213595 
+354454.466132  7393930.746073 
+354449.073098  7393917.538336 
+354444.479947  7393901.061158 
+354442.476113  7393881.584494 
+354437.602591  7393867.626885 
+354432.151832  7393858.208499 
+354418.652753  7393844.390865 
+354404.576437  7393834.852499 
+354399.117432  7393826.443939 
+354389.609528  7393816.715606 
+354384.752499  7393801.748170 
+354381.668408  7393786.800730 
+354384.265971  7393764.614530 
+354385.898725  7393738.618983 
+354387.399539  7393722.471749 
+354391.390714  7393709.393989 
+354391.885488  7393691.966974 
+354389.815684  7393676.789574 
+354529.811942  7393517.606840 
+354668.934099  7393361.813526 
+354818.058934  7393317.371139 
+354851.695309  7393306.463008 
+354866.489047  7393300.853968 
+354888.572452  7393299.884134 
+354902.294180  7393298.304405 
+354929.457264  7393297.154602 
+354949.264710  7393295.914814 
+354976.254623  7393288.696051 
+355001.182978  7393283.736900 
+355022.268590  7393281.747241 
+355053.744452  7393280.407471 
+355090.522641  7393280.907385 
+355112.045303  7393283.976859 
+355141.641025  7393289.935838 
+355124.224986  7393265.450033 
+355109.835313  7393260.710844 
+355103.526947  7393258.091293 
+355091.462711  7393250.602576 
+355083.439129  7393243.933718 
+355077.707999  7393236.524987 
+355072.479888  7393229.636167 
+355067.639351  7393212.649077 
+355065.272683  7393201.001072 
+355064.695447  7393188.113280 
+355063.837839  7393176.735229 
+355063.087432  7393158.288388 
+355063.252356  7393146.670379 
+355061.405201  7393133.512632 
+355056.012166  7393102.367967 
+355047.089744  7393087.600497 
+355034.110177  7393072.773036 
+355016.108656  7393054.086237 
+354999.830596  7393038.968827 
+354988.590984  7393026.440973 
+354977.343125  7393014.922946 
+354967.381679  7393001.905176 
+354963.489458  7392989.977219 
+354955.169011  7392968.400914 
+354950.064594  7392952.413653 
+354943.005821  7392931.607217 
+354929.803606  7392878.386333 
+354928.022420  7392843.002394 
+354925.713475  7392809.378154 
+354921.491405  7392767.135389 
+354910.276531  7392734.660952 
+354901.675713  7392697.407333 
+354889.834126  7392655.824456 
+354878.866639  7392623.849933 
+354864.806816  7392596.134680 
+354848.908083  7392572.178784 
+354831.046747  7392543.643672 
+354812.954517  7392513.598818 
+354785.354383  7392474.065590 
+354762.627772  7392394.719181 
+354781.214776  7392295.576163 
+354843.127475  7392234.066699 
+354857.385208  7392217.039616 
+354876.161875  7392196.853074 
+354899.556432  7392174.716865 
+354936.483052  7392145.951793 
+354968.297010  7392118.366518 
+355011.391812  7392085.682116 
+355034.233871  7392067.855170 
+355052.721920  7392056.187168 
+355068.018677  7392047.368679 
+355087.191164  7392038.480201 
+355107.600585  7392028.941835 
+355126.410237  7392025.912354 
+355148.097823  7392021.473115 
+355163.345104  7392017.083866 
+355193.072765  7391994.347761 
+355206.629568  7391986.179160 
+355223.072552  7391974.271200 
+355240.406129  7391965.912632 
+355261.302078  7391958.703866 
+355283.913242  7391953.384778 
+355303.588748  7391945.826072 
+355323.734290  7391941.596797 
+355337.439525  7391939.297191 
+355363.266720  7391939.107223 
+355353.264042  7391928.599023 
+355347.483434  7391924.559715 
+355339.393882  7391906.762763 
+355347.293771  7391891.885312 
+355349.916072  7391884.936502 
+355355.828620  7391875.688086 
+355364.759287  7391870.688943 
+355379.132467  7391861.860455 
+355394.825044  7391843.833543 
+355405.429697  7391834.875077 
+355413.849098  7391829.975916 
+355419.473028  7391829.036077 
+355430.605439  7391827.926267 
+355438.480589  7391826.346538 
+355445.869212  7391822.317228 
+355462.567829  7391796.131714 
+355469.272015  7391788.662993 
+355474.607326  7391786.173419 
+355485.055300  7391782.064123 
+355491.924410  7391779.584548 
+355496.872149  7391774.655392 
+355502.059028  7391765.846901 
+355506.949042  7391756.808449 
+355511.773087  7391743.790679 
+355515.937434  7391735.192152 
+355521.190283  7391719.854779 
+355524.183664  7391706.597050 
+355529.197373  7391695.019033 
+355535.753126  7391682.011261 
+355543.026301  7391669.233450 
+355551.660105  7391652.936242 
+355556.451165  7391633.269610 
+355556.409934  7391606.464202 
+355555.709004  7391583.978054 
+355550.777758  7391556.692727 
+355549.136758  7391525.778023 
+355545.599125  7391511.900400 
+355542.251156  7391500.242397 
+355534.202835  7391477.346319 
+355530.063227  7391462.688829 
+355528.100624  7391444.951868 
+355528.587152  7391426.565017 
+355530.879604  7391411.417612 
+355533.543136  7391399.599636 
+355539.158819  7391379.503078 
+355550.200522  7391356.577005 
+355557.242803  7391329.411659 
+355581.173364  7391343.589230 
+355603.792775  7391364.085719 
+355644.100350  7390990.169768 
+355650.878752  7390846.134440 
+355633.932748  7390737.683016 
+355635.631472  7390690.231144 
+355622.066422  7390639.399851 
+355606.819142  7390600.426527 
+355584.793460  7390575.010881 
+355559.370331  7390561.453203 
+355527.177046  7390542.806397 
+355493.293284  7390512.311620 
+355471.259356  7390476.727716 
+355456.003829  7390427.586133 
+355449.233674  7390371.665712 
+355439.057825  7390324.213840 
+355400.086139  7390256.435450 
+355366.185885  7390205.594158 
+355337.348817  7390159.572041 
+355320.130687  7390172.009911 
+355308.891075  7390173.339683 
+355297.437060  7390175.769267 
+355290.262840  7390178.688767 
+355281.150755  7390181.148346 
+355269.639017  7390189.566904 
+355266.010675  7390195.395905 
+355257.599520  7390199.525198 
+355234.163733  7390206.044081 
+355215.741653  7390210.843259 
+355202.044664  7390213.252846 
+355187.811670  7390217.652093 
+355170.387385  7390225.230795 
+355153.119778  7390227.280444 
+355131.935211  7390233.049455 
+355121.322312  7390232.939474 
+355114.494433  7390232.429562 
+355099.502786  7390230.959813 
+355086.036691  7390230.269932 
+355074.640401  7390226.610558 
+355068.851547  7390224.011004 
+355060.019834  7390219.381797 
+355050.660362  7390216.402307 
+355040.632946  7390208.773614 
+355032.650594  7390200.285068 
+355021.988218  7390194.855998 
+355008.711787  7390185.087671 
+354994.338607  7390173.099724 
+354979.759271  7390161.991627 
+354966.177729  7390152.223300 
+354947.293861  7390141.955059 
+354935.707907  7390136.745951 
+354922.472707  7390134.066410 
+354915.727290  7390124.368072 
+354910.482687  7390117.999162 
+354905.048421  7390110.420461 
+354899.993482  7390105.271343 
+354889.941327  7390100.082232 
+354883.501021  7390101.571976 
+354881.035398  7390102.981735 
+354876.120644  7390104.931401 
+354872.855137  7390104.891408 
+354866.225167  7390103.831589 
+354863.487419  7390102.811764 
+354856.906927  7390097.092744 
+354855.232942  7390091.323732 
+354850.483113  7390086.514556 
+354842.830611  7390085.654703 
+354835.977993  7390087.254429 
+354825.546512  7390089.913973 
+354813.911080  7390089.803992 
+354805.219553  7390091.263742 
+354791.745212  7390091.573689 
+354772.284108  7390088.284252 
+354762.899897  7390087.414401 
+354752.707556  7390086.314590 
+354740.577351  7390084.644876 
+354731.951794  7390079.465763 
+354726.517528  7390072.316987 
+354721.437850  7390069.497470 
+354716.011830  7390061.588825 
+354711.938192  7390060.549003 
+354701.020183  7390060.439022 
+354695.874535  7390064.598310 
+354688.700314  7390067.067887 
+354680.792179  7390071.977046 
+354669.593798  7390079.945681 
+354655.591698  7390082.025324 
+354645.184955  7390081.145475 
+354634.266945  7390081.035494 
+354619.275298  7390080.335614 
+354609.734409  7390075.146503 
+354601.380978  7390072.846897 
+354595.823018  7390067.697779 
+354593.101762  7390064.128390 
+354589.893978  7390058.229401 
+354587.378878  7390054.660012 
+354584.542175  7390052.410397 
+354575.999080  7390049.230942 
+354568.363070  7390047.381259 
+354564.099769  7390045.121646 
+354562.623694  7390040.012521 
+354561.963995  7390034.473470 
+354556.356558  7390033.643612 
+354551.037740  7390035.363317 
+354546.370373  7390042.292130 
+354546.007539  7390048.371089 
+354538.058173  7390056.939621 
+354528.632731  7390061.048918 
+354519.908219  7390065.498155 
+354512.024822  7390068.637618 
+354506.862682  7390073.896717 
+354500.999612  7390079.155816 
+354490.741301  7390083.815018 
+354487.467547  7390085.004814 
+354478.784267  7390085.244773 
+354475.527006  7390084.664872 
+354469.457780  7390079.725718 
+354466.744770  7390075.156501 
+354465.293433  7390067.397830 
+354462.390760  7390061.718803 
+354460.403419  7390056.159755 
+354458.251152  7390046.501409 
+354452.998303  7390040.912367 
+354449.658580  7390037.892884 
+354441.313395  7390036.263163 
+354436.002822  7390036.203173 
+354429.174943  7390035.583280 
+354426.948461  7390033.013720 
+354423.122210  7390027.994579 
+354419.700024  7390023.305383 
+354408.979924  7390023.975268 
+354399.406050  7390022.105588 
+354394.120217  7390019.286071 
+354391.069111  7390018.926133 
+354389.386880  7390013.367085 
+354384.002092  7390010.767530 
+354381.808594  7390005.208483 
+354378.773981  7390002.858885 
+354365.637736  7390000.179344 
+354362.867002  7390001.699084 
+354361.522867  7390002.908876 
+354359.444817  7390007.198142 
+354356.888485  7390007.178145 
+354349.557586  7390005.888366 
+354347.025993  7390003.758731 
+354344.486154  7390002.179001 
+354340.552702  7389997.379823 
+354337.831446  7389994.580303 
+354332.240502  7389991.760786 
+354323.103678  7389987.131579 
+354315.772779  7389985.501858 
+354289.244655  7389974.493744 
+354269.330008  7389965.105352 
+354255.360893  7389963.975545 
+354238.085040  7389966.785064 
+354230.176905  7389951.757638 
+354226.012559  7389939.319769 
+354218.252856  7389929.381471 
+354212.496987  7389922.792600 
+354205.726831  7389916.413692 
+354198.610334  7389914.014103 
+354186.240988  7389905.475566 
+354180.748999  7389903.645879 
+354163.547361  7389899.156648 
+354152.629352  7389898.276799 
+354141.397986  7389898.936686 
+354119.545475  7389900.156477 
+354112.981475  7389903.635881 
+354099.012360  7389902.386095 
+354085.546266  7389901.806194 
+354064.361699  7389907.575206 
+354053.905479  7389912.454370 
+354043.234856  7389917.883441 
+354032.102445  7389928.411637 
+354028.762722  7389935.680392 
+354024.598375  7389943.948976 
+354022.124506  7389956.766780 
+354020.293843  7389966.385133 
+354019.023923  7389981.212593 
+354018.933215  7389990.620981 
+354018.883737  7389995.160204 
+354017.514863  7389999.139522 
+354012.707310  7390000.859228 
+354006.365959  7390001.799067 
+354000.032854  7390002.728907 
+353993.386392  7390003.878710 
+353988.784995  7390004.608585 
+353982.814724  7389999.789411 
+353979.994513  7389995.660118 
+353974.733418  7389991.070904 
+353966.190323  7389988.441355 
+353962.825861  7389987.631493 
+353953.260234  7389985.201909 
+353951.041998  7389981.972463 
+353945.492284  7389976.273439 
+353944.560460  7389967.174997 
+353941.872189  7389960.616121 
+353940.717717  7389952.967431 
+353938.590189  7389941.429407 
+353934.343381  7389937.290116 
+353926.509462  7389935.210473 
+353919.887738  7389933.600748 
+353904.368332  7389934.110661 
+353895.487142  7389935.020505 
+353879.266806  7389934.080666 
+353862.980501  7389939.669709 
+353852.210923  7389944.878816 
+353849.794778  7389952.387530 
+353844.871778  7389964.745413 
+353839.899301  7389971.784208 
+353837.606849  7389976.293435 
+353827.134136  7389983.172257 
+353804.382786  7389992.020741 
+353792.401012  7389996.439984 
+353771.653496  7390009.747705 
+353762.203316  7390015.746677 
+353729.878092  7390022.945444 
+353713.814434  7390026.774788 
+353703.415938  7390025.564996 
+353691.912446  7390011.767359 
+353645.263519  7390001.399135 
+353598.218773  7389995.020228 
+353549.120716  7390004.458611 
+353540.338480  7390014.076963 
+353529.626627  7390023.485352 
+353514.585502  7390047.701204 
+353508.516276  7390053.070284 
+353503.667493  7390057.559515 
+353496.254131  7390064.238371 
+353487.339956  7390068.137703 
+353477.691866  7390072.916885 
+353473.181178  7390075.526438 
+353471.012419  7390077.606081 
+353467.177922  7390083.885006 
+353462.131229  7390088.044293 
+353454.148878  7390090.503872 
+353445.465597  7390090.753829 
+353435.998924  7390088.994131 
+353424.297523  7390084.784852 
+353416.282186  7390080.155645 
+353409.239905  7390070.237344 
+353400.490655  7390057.189579 
+353392.170208  7390042.492096 
+353386.232922  7390033.563626 
+353382.513872  7390029.434333 
+353374.828385  7390020.825807 
+353363.910376  7390010.307609 
+353355.515713  7390002.918875 
+353347.071573  7390000.169346 
+353332.805594  7389999.089531 
+353313.113595  7389997.729764 
+353302.179093  7389998.729592 
+353284.276526  7390002.758902 
+353272.698818  7390007.728051 
+353258.358623  7390012.907164 
+353248.504378  7390018.226253 
+353237.800770  7390027.204715 
+353230.016329  7390040.412452 
+353225.423178  7390050.670695 
+353220.467194  7390055.709832 
+353202.721305  7390064.618306 
+353191.935235  7390072.256998 
+353188.842899  7390074.776566 
+353186.138135  7390079.625736 
+353180.365774  7390096.172901 
+353176.564262  7390108.430801 
+353173.381217  7390113.969853 
+353171.064026  7390117.449257 
+353165.102001  7390121.598546 
+353156.699092  7390124.837991 
+353145.327540  7390129.157251 
+353140.404540  7390131.876785 
+353137.823470  7390135.056241 
+353137.460636  7390140.035388 
+353139.151113  7390144.934549 
+353142.383636  7390147.954032 
+353149.401178  7390150.353620 
+353156.443459  7390150.643571 
+353170.025001  7390149.443776 
+353174.923262  7390149.943691 
+353178.164030  7390152.303287 
+353180.266819  7390156.082639 
+353180.233834  7390159.742012 
+353178.040337  7390164.921125 
+353174.494458  7390172.529822 
+353170.462051  7390177.688938 
+353167.592363  7390178.768753 
+353161.984926  7390177.828914 
+353157.301067  7390176.789092 
+353154.060298  7390174.649459 
+353149.368193  7390174.379505 
+353146.284103  7390176.009226 
+353143.909188  7390178.978717 
+353143.463892  7390183.177998 
+353143.117550  7390186.497429 
+353145.566681  7390197.265585 
+353146.490258  7390206.573990 
+353145.220339  7390211.213196 
+353141.913600  7390215.392480 
+353137.411158  7390216.232336 
+353132.521144  7390215.742420 
+353122.939024  7390213.982721 
+353107.452602  7390211.723108 
+353095.107995  7390211.373168 
+353089.401604  7390210.433329 
+353081.468730  7390207.583817 
+353069.569419  7390203.474521 
+353061.653037  7390199.185256 
+353053.728410  7390195.565876 
+353042.027009  7390191.796522 
+353032.238733  7390190.476748 
+353026.301447  7390192.526397 
+353022.805045  7390195.475891 
+353019.687970  7390200.205081 
+353017.477980  7390206.943927 
+353015.985412  7390213.902735 
+353015.457653  7390225.300783 
+353016.084367  7390233.949301 
+353015.977166  7390244.907424 
+353014.459859  7390253.755909 
+353009.693538  7390260.684722 
+353004.234533  7390265.723859 
+352998.387956  7390268.543376 
+352986.637077  7390269.753168 
+352982.654148  7390269.933138 
+352975.834515  7390268.533377 
+352962.690023  7390266.303759 
+352952.909994  7390264.324098 
+352938.644015  7390262.294446 
+352920.576524  7390261.894515 
+352902.525525  7390261.264622 
+352892.943405  7390259.954847 
+352873.292637  7390254.875717 
+352854.804588  7390246.717114 
+352836.390755  7390240.108246 
+352830.090635  7390237.948616 
+352824.903756  7390236.228911 
+352819.090163  7390235.179091 
+352807.792827  7390232.069623 
+352802.927551  7390229.030144 
+352801.121626  7390226.130641 
+352800.272265  7390219.371798 
+352800.775285  7390209.853429 
+352803.752174  7390197.475549 
+352804.972616  7390188.407102 
+352805.797239  7390177.009055 
+352808.996777  7390143.044872 
+352809.260656  7390137.405838 
+352810.225465  7390132.536672 
+352810.274942  7390128.107431 
+352810.126510  7390122.018474 
+352809.994571  7390115.479594 
+352809.343118  7390108.500789 
+352805.170526  7390097.492675 
+352801.459722  7390091.473706 
+352798.021044  7390087.564376 
+352792.240436  7390084.184955 
+352782.880964  7390081.095484 
+352774.725442  7390080.685554 
+352767.155402  7390082.155302 
+352759.065850  7390084.954823 
+352730.302998  7390092.863468 
+352697.120166  7390104.491476 
+352686.061970  7390107.810908 
+352645.828611  7390119.808853 
+352640.699455  7390122.748349 
+352649.333259  7390150.433607 
+352672.983448  7390192.076474 
+352690.968477  7390237.858632 
+352715.063963  7390294.368952 
+352739.703701  7390341.310911 
+352796.553215  7390445.123129 
+352829.348474  7390538.947058 
+352803.669712  7390674.973758 
+352766.042161  7390831.606928 
+352768.070734  7390878.388915 
+352790.451004  7390917.042294 
+352816.896666  7390944.497591 
+352849.436292  7390975.012364 
+352886.808209  7391057.138296 
+352880.046300  7391191.995197 
+352887.583355  7391221.150203 
+352831.888313  7391411.077670 
+352804.692244  7391547.624281 
+352775.203724  7391649.326860 
+352760.945991  7391709.336581 
+352739.596500  7391762.227521 
+352531.948166  7392153.540493 
+352478.718747  7392281.288611 
+352447.473779  7392356.295763 
+352318.626425  7392632.968371 
+352303.849180  7392698.447155 
+352312.301566  7392749.128474 
+352350.316689  7392831.504364 
+352377.768391  7392941.325552 
+352409.450409  7393192.652502 
+352420.013831  7393427.092345 
+352439.021392  7393564.368831 
+352449.576568  7393627.727978 
+352455.917919  7393701.655315 
+352413.301399  7393899.621405 
+352417.902796  7393927.646604 
+352420.450881  7394021.210578 
+352421.242519  7394091.828482 
+352416.072133  7394130.981775 
+352474.719325  7394112.015024 
+352491.871485  7394100.646971 
+352515.678353  7394088.659024 
+352523.635965  7394119.763696 
+352532.426447  7394185.662409 
+352543.410426  7394286.695103 
+352545.603924  7394383.338548 
+352541.637487  7394470.333647 
+352539.196602  7394523.054616 
+352541.208683  7394567.836946 
+352532.426447  7394613.959045 
+352530.216457  7394644.703779 
+352528.031206  7394682.047382 
+352526.489161  7394816.824296 
+352533.242824  7394989.314750 
+352532.418201  7395009.071366 
+352530.892648  7395026.148441 
+352524.642005  7395050.354295 
+352501.956625  7395160.085499 
+352497.792278  7395178.542337 
+352487.913294  7395221.814925 
+352484.177752  7395241.891486 
+352475.997491  7395280.534867 
+352562.516943  7395343.414096 
+352659.946158  7395408.482951 
+352755.462247  7395473.881748 
+352845.676011  7395537.630829 
+352883.443747  7395552.628260 
+352951.788507  7395602.569705 
+353006.997021  7395627.545427 
+353118.609753  7395648.621817 
+353119.788964  7395682.825958 
+353119.640531  7395715.340389 
+353103.601613  7395774.780207 
+353081.476976  7395874.893059 
+353071.960826  7395914.566263 
+353069.577665  7395943.921235 
+353071.160941  7395971.696477 
+353104.203588  7396048.293357 
+353111.419039  7396064.790531 
+353163.980514  7396149.426034 
+353185.692839  7396185.509853 
+353215.618410  7396238.110843 
+353233.149896  7396281.443420 
+353231.088339  7396386.675395 
+353237.842001  7396353.970997 
+353338.421277  7396381.096351 
+353367.101667  7396390.294775 
+353416.026553  7396409.871422 
+353470.666078  7396430.257930 
+353522.056587  7396449.014717 
+353547.438485  7396456.913364 
+353567.410856  7396472.320725 
+353745.521191  7396570.533902 
+354058.902695  7396693.012922 
+354118.226078  7396716.718862 
+Region 1
+494
+353976.399157  7397735.564343 
+353977.454674  7397728.715516 
+353994.507879  7397725.326096 
+354007.066889  7397762.509727 
+354010.456089  7397823.299314 
+354010.983848  7397898.856372 
+354015.197672  7398017.726011 
+354023.913938  7398117.698886 
+354050.846127  7398162.911142 
+354069.070297  7398198.265086 
+354098.542325  7398240.707816 
+354132.673474  7398258.164826 
+354153.998226  7398259.334625 
+354219.110464  7398259.074670 
+354277.889596  7398258.964689 
+354359.230415  7398260.214475 
+354425.901189  7398257.304973 
+354465.169740  7398233.569039 
+354496.917728  7398216.112029 
+354554.847498  7398182.777739 
+354620.710142  7398146.273992 
+354698.472097  7398109.760246 
+354783.746368  7398077.855711 
+354813.193658  7398066.067730 
+354832.176481  7398056.959291 
+354862.737012  7398040.722072 
+354935.740892  7398084.374595 
+354998.420491  7398116.919020 
+355125.478413  7398187.816876 
+355231.425984  7397925.551799 
+355228.383125  7397828.158482 
+355227.731673  7397804.282572 
+355227.756411  7397804.252577 
+355301.032417  7397795.654050 
+355366.903307  7397781.376495 
+355417.526917  7397773.327874 
+355449.266659  7397767.728833 
+355527.803760  7397759.070316 
+355527.770775  7397759.050320 
+355587.506470  7397746.452478 
+355652.313596  7397737.593995 
+355714.333497  7397724.756194 
+355746.922600  7397714.497951 
+355776.930634  7397700.740308 
+355790.396728  7397690.772015 
+355834.843912  7397658.237588 
+355893.557074  7397613.795201 
+355951.750723  7397570.282654 
+356036.662160  7397487.656807 
+356046.104095  7397479.008288 
+356070.488199  7397455.892248 
+356089.116434  7397438.235272 
+356165.031233  7397405.880814 
+356089.116434  7397438.235272 
+356165.031233  7397405.880814 
+356232.073088  7397377.295711 
+356300.813667  7397335.902801 
+356357.052960  7397300.748823 
+356399.240676  7397271.063907 
+356419.551142  7397249.977519 
+356446.854411  7397225.311744 
+356496.628660  7397264.055108 
+356504.512056  7397263.635180 
+356511.158518  7397259.415902 
+356514.795106  7397251.387278 
+356519.990231  7397240.599126 
+356525.375020  7397235.100068 
+356533.538788  7397232.410528 
+356549.058194  7397230.560845 
+356565.055882  7397231.490686 
+356584.088182  7397233.960263 
+356603.565779  7397242.488802 
+356619.777868  7397248.207822 
+356631.891581  7397255.906504 
+356647.848037  7397261.875481 
+356658.724816  7397266.534683 
+356692.748763  7397269.414190 
+356710.742038  7397273.893423 
+356727.696289  7397280.882225 
+356741.607680  7397287.591076 
+356751.701066  7397294.759848 
+356779.037321  7397305.138071 
+356789.683204  7397308.027576 
+356801.838148  7397312.696776 
+356814.776484  7397314.846408 
+356827.970453  7397316.246168 
+356835.573478  7397318.855721 
+356845.691603  7397323.244969 
+356854.317160  7397324.604736 
+356868.022396  7397326.004496 
+356881.191626  7397330.943650 
+356888.209168  7397340.601996 
+356892.926012  7397351.750086 
+356897.956213  7397356.589258 
+356903.745067  7397362.708209 
+356913.846699  7397368.367240 
+356921.622895  7397378.535498 
+356929.159950  7397387.443972 
+356934.932311  7397394.312796 
+356940.440793  7397402.951316 
+356954.566586  7397412.939605 
+356966.457651  7397418.108720 
+356977.845695  7397423.017879 
+356991.006679  7397428.206990 
+356999.055001  7397436.365593 
+357006.913658  7397438.215276 
+357021.905306  7397438.375248 
+357034.662224  7397433.206134 
+357046.173962  7397426.017365 
+357059.648303  7397424.897557 
+357067.473976  7397430.526593 
+357072.710333  7397440.174940 
+357083.273754  7397451.383020 
+357089.334734  7397454.722448 
+357103.501758  7397460.931385 
+357116.407109  7397467.120325 
+357126.995269  7397475.558879 
+357139.851143  7397485.277214 
+357157.275428  7397496.815238 
+357172.712372  7397502.774217 
+357188.413195  7397507.983325 
+357202.596712  7397513.182435 
+357218.800555  7397519.151412 
+357235.507418  7397525.640301 
+357250.193955  7397530.839410 
+357258.242276  7397538.488100 
+357269.374687  7397543.907172 
+357276.944727  7397548.776338 
+357287.598857  7397550.905973 
+357300.768087  7397555.585171 
+357305.179821  7397559.634478 
+357358.483456  7397489.766446 
+357393.389750  7397609.405952 
+357360.041993  7397645.209819 
+357353.609933  7397659.317403 
+357355.696230  7397668.885764 
+357362.779742  7397676.664432 
+357413.832156  7397706.869258 
+357491.552880  7397728.695519 
+357482.679936  7397756.920684 
+357443.634033  7397905.345261 
+357440.500466  7397927.211515 
+357442.059003  7397952.217232 
+357448.309646  7397975.643219 
+357478.779468  7398013.126799 
+357512.382858  7398018.565867 
+357560.714016  7398044.711388 
+357587.646205  7398055.799489 
+357620.136354  7398057.389217 
+357708.090650  7398055.009624 
+357768.296380  7398052.630032 
+357819.010699  7398051.840167 
+357872.099932  7398051.050303 
+357957.662821  7398052.630032 
+357992.527884  7398054.219760 
+358012.970290  7398058.219075 
+358099.168139  7398089.283754 
+358115.338997  7398097.792296 
+358128.013453  7398111.269988 
+358134.346559  7398124.737681 
+358141.487794  7398144.544288 
+358147.029261  7398159.601709 
+358154.953889  7398171.479674 
+358168.683863  7398176.118880 
+358179.519410  7398174.649131 
+358194.733706  7398165.740657 
+358267.473706  7398092.253245 
+358281.723193  7398090.663517 
+358446.524112  7398120.768361 
+358464.302985  7398066.847597 
+358459.561403  7398058.219075 
+358458.464654  7398041.052015 
+358462.249674  7398018.395896 
+358466.001709  7397998.509302 
+358472.821342  7397977.392920 
+358478.816351  7397962.315502 
+358490.245627  7397937.469758 
+358499.365958  7397915.113587 
+358515.652264  7397887.038396 
+358528.137057  7397878.489861 
+358537.908840  7397872.140948 
+358555.662975  7397875.860311 
+358566.053225  7397877.989946 
+358576.443476  7397880.869453 
+358591.913405  7397884.058907 
+358603.837454  7397886.458496 
+358628.452453  7397889.238020 
+358645.241778  7397887.398335 
+358664.603928  7397882.559164 
+358684.032047  7397871.161116 
+358692.022645  7397859.643089 
+358694.166665  7397849.074899 
+358692.030891  7397833.417581 
+358686.827519  7397820.239838 
+358678.300917  7397809.051755 
+358662.723787  7397791.484764 
+358649.900899  7397777.977078 
+358635.535965  7397765.969134 
+358607.292625  7397744.232858 
+358592.680304  7397731.465045 
+358570.745331  7397714.078023 
+358543.244151  7397668.885764 
+358523.882002  7397648.759211 
+358511.133329  7397627.432864 
+358491.276406  7397605.536615 
+358483.277562  7397592.838790 
+358475.789985  7397579.391094 
+358465.960478  7397571.212495 
+358452.618077  7397558.204723 
+358441.238278  7397553.045606 
+358428.868932  7397544.587055 
+358419.748601  7397541.967504 
+358408.640929  7397534.538776 
+358398.011537  7397530.129532 
+358387.571809  7397532.549117 
+358366.040901  7397524.880431 
+358352.401636  7397517.541688 
+358335.917421  7397513.842322 
+358316.192437  7397504.293957 
+358303.047945  7397497.595105 
+358294.958393  7397492.975896 
+358283.372439  7397483.267559 
+358272.553384  7397472.049480 
+358247.649768  7397446.813803 
+358234.521769  7397438.355252 
+358218.375649  7397426.327312 
+358198.172384  7397413.749467 
+358183.287938  7397403.251265 
+358169.162144  7397392.763061 
+358152.273864  7397379.465339 
+358134.255850  7397351.530124 
+358120.740278  7397330.453734 
+358107.686495  7397314.416481 
+358102.474877  7397302.758478 
+358099.060938  7397287.841034 
+358096.669531  7397272.933587 
+358084.926898  7397252.637064 
+358074.660341  7397237.639633 
+358061.400402  7397217.323113 
+358049.847433  7397203.835423 
+358040.537439  7397194.147082 
+358027.714550  7397180.899352 
+358007.849380  7397159.243061 
+357994.317316  7397140.946195 
+357978.492799  7397121.859465 
+357964.152604  7397107.831867 
+357947.478726  7397097.813583 
+357929.007169  7397090.554827 
+357910.024346  7397082.786158 
+357886.258710  7397070.938187 
+357859.722339  7397081.246421 
+357843.386556  7397088.645154 
+357826.028241  7397096.533803 
+357808.933805  7397103.912539 
+357793.637047  7397108.291789 
+357785.473279  7397111.741198 
+357763.027039  7397120.579684 
+357742.287769  7397136.256998 
+357725.415981  7397145.655389 
+357713.434208  7397150.074632 
+357696.867530  7397154.693840 
+357688.712008  7397157.123424 
+357673.695622  7397159.493018 
+357656.675402  7397158.803137 
+357641.428122  7397159.403034 
+357634.814645  7397159.333046 
+357624.655289  7397158.973107 
+357610.141923  7397162.342530 
+357600.667004  7397169.561294 
+357593.418567  7397131.647788 
+357590.004627  7397117.740170 
+357585.089874  7397101.043030 
+357579.235050  7397076.257276 
+357574.798578  7397063.099530 
+357570.362106  7397049.171915 
+357561.901473  7397031.424955 
+357564.614483  7397014.307887 
+357569.075694  7396999.970343 
+357574.320297  7396983.633142 
+357582.071754  7396970.605373 
+357585.963974  7396962.566750 
+357596.502657  7396950.318848 
+357608.806033  7396940.110597 
+357621.810339  7396935.201437 
+357631.268766  7396930.262284 
+357644.306056  7396922.573601 
+357655.050895  7396915.124876 
+357663.016754  7396905.876461 
+357669.448813  7396898.127788 
+357676.466356  7396882.560454 
+357684.481692  7396868.772816 
+357689.718048  7396853.445442 
+357692.125948  7396841.357512 
+357700.231992  7396818.241472 
+357703.736640  7396798.344880 
+357714.118645  7396776.518618 
+357722.538046  7396747.593573 
+357728.533056  7396732.776111 
+357736.053618  7396717.468733 
+357743.417502  7396636.862540 
+357746.031557  7396609.367250 
+357744.918316  7396593.719930 
+357745.091487  7396576.312912 
+357745.998573  7396561.695416 
+357748.200316  7396544.568349 
+357749.396020  7396526.671415 
+357753.692306  7396504.015296 
+357755.085919  7396491.417454 
+357758.301949  7396475.310213 
+357760.594401  7396448.844746 
+357761.303577  7396428.928158 
+357761.196376  7396414.550620 
+357759.662577  7396390.064814 
+357757.229939  7396378.686763 
+357754.376743  7396359.490052 
+357753.304733  7396339.803424 
+357754.426220  7396329.215237 
+357758.417396  7396311.098341 
+357763.934124  7396292.741485 
+357769.426114  7396277.164153 
+357777.499174  7396257.827465 
+357782.768515  7396239.470610 
+357785.036228  7396215.784667 
+357786.454580  7396200.917214 
+357791.468288  7396182.560358 
+357798.972358  7396169.262636 
+357810.813945  7396153.505335 
+357818.260292  7396145.756662 
+357826.481784  7396136.768202 
+357831.709894  7396122.440656 
+357833.870406  7396109.852812 
+357838.084230  7396095.015354 
+357841.077612  7396075.378717 
+357846.305722  7396060.301300 
+357851.269953  7396046.723626 
+357857.034068  7396029.886510 
+357857.570073  7396029.116642 
+357865.783319  7396018.378481 
+357875.348946  7396002.341228 
+357882.828278  7395991.063160 
+357893.812257  7395985.384133 
+357908.127713  7395977.205533 
+357917.107858  7395968.477029 
+357926.368375  7395957.478912 
+357933.064315  7395947.960543 
+357956.013575  7395914.906205 
+357971.120669  7395903.468164 
+357985.683513  7395895.799478 
+358005.293049  7395891.210264 
+358019.064254  7395886.321101 
+358039.209796  7395878.962362 
+358047.431288  7395870.723773 
+358057.450458  7395859.485698 
+358069.753834  7395848.767534 
+358081.323296  7395835.009890 
+358097.700310  7395824.341718 
+358113.813444  7395813.413590 
+358123.511012  7395809.484263 
+358141.553764  7395797.156374 
+358157.914286  7395780.849168 
+358171.124747  7395766.351651 
+358184.417671  7395753.413867 
+358203.639635  7395740.316111 
+358213.262986  7395727.008390 
+358221.253583  7395713.240748 
+358227.660905  7395695.363810 
+358241.630019  7395675.677183 
+358255.285777  7395647.012093 
+358270.030038  7395611.168232 
+358279.224585  7395586.602440 
+358284.279524  7395573.214733 
+358297.143644  7395541.330195 
+358302.627387  7395512.815079 
+358305.356890  7395484.159988 
+358305.216704  7395456.584711 
+358307.880236  7395434.678463 
+358314.122633  7395421.900652 
+358329.468868  7395408.642923 
+358342.159817  7395394.705311 
+358354.586887  7395376.778381 
+358356.252625  7395352.542533 
+358351.115224  7395334.775576 
+358350.711158  7395312.509390 
+358352.170741  7395298.901721 
+358347.940425  7395261.758083 
+358337.616144  7395252.689637 
+358318.847723  7395240.331753 
+358288.402640  7395220.985067 
+358254.535370  7395197.179145 
+358220.173327  7395171.493545 
+358198.403278  7395152.786749 
+358167.949949  7395134.659854 
+358141.883613  7395116.802913 
+358099.860822  7395092.257117 
+358068.203543  7395072.120566 
+358017.901536  7395047.604766 
+357967.937624  7395031.057600 
+357924.455250  7395019.009664 
+357878.218635  7395007.711599 
+357835.544391  7394996.553510 
+357776.262239  7394993.654007 
+357738.131668  7394998.153236 
+357701.732806  7395004.222197 
+357679.096903  7395011.530945 
+357652.370870  7395019.689547 
+357630.452389  7395027.448218 
+357605.012767  7395028.648013 
+357600.048536  7395025.268592 
+357592.742376  7395020.109475 
+357590.911713  7395009.461299 
+357589.996381  7394998.373199 
+357591.653874  7394975.137179 
+357593.344351  7394947.911842 
+357593.723677  7394919.346735 
+357596.634597  7394893.351188 
+357601.557597  7394855.647646 
+357611.939601  7394820.853606 
+357621.315565  7394801.786872 
+357628.885605  7394789.229023 
+357636.859710  7394777.790982 
+357655.743578  7394756.824574 
+357667.972738  7394748.416014 
+357679.806079  7394739.227588 
+357703.101681  7394726.719730 
+357698.318867  7394704.413551 
+357634.476549  7394756.894562 
+357579.259789  7394818.504009 
+357560.219242  7394835.961018 
+357392.243524  7395038.926252 
+357333.266482  7395104.974939 
+357303.118263  7395131.150455 
+357277.719873  7395148.607465 
+357179.317602  7395214.476182 
+357053.150274  7395295.412319 
+357022.581497  7395314.389068 
+356973.137098  7395338.714901 
+356839.482191  7395377.988174 
+356760.590503  7395401.434158 
+356526.595462  7395463.833469 
+356474.602978  7395476.831243 
+356425.199810  7395492.428571 
+356348.048076  7395511.965225 
+356201.611512  7395549.628774 
+356032.868894  7395597.570562 
+355772.626101  7395656.220515 
+355426.696726  7395723.299025 
+355197.237112  7395785.968291 
+355105.217424  7395804.365139 
+355031.611569  7395825.071593 
+354978.703753  7395859.575682 
+354925.795938  7395887.180954 
+354877.489518  7395937.782286 
+354860.007509  7395950.550099 
+354822.635592  7395978.975230 
+354751.882933  7396032.606044 
+354708.689177  7396083.657299 
+354659.756044  7396137.478080 
+354612.463912  7396189.679139 
+354563.341116  7396234.481464 
+354519.479415  7396289.981958 
+354421.027667  7396421.199481 
+354256.366934  7396534.700040 
+354219.687700  7396565.964684 
+354180.757245  7396600.978687 
+354159.292306  7396625.244530 
+354139.691016  7396662.578135 
+354125.688917  7396694.322698 
+354118.226078  7396716.718862 
+354108.891345  7396752.192785 
+354030.296520  7397007.519050 
+354012.839250  7397055.130895 
+353989.032382  7397102.742739 
+353967.608675  7397149.564719 
+353944.593445  7397196.386699 
+353922.369854  7397245.588271 
+353900.146262  7397303.518348 
+353879.522439  7397352.719920 
+353853.398381  7397407.650511 
+353825.509629  7397460.771412 
+353802.873725  7397500.124671 
+353814.476172  7397519.731313 
+353834.382573  7397548.216434 
+353838.118115  7397555.125250 
+353842.208246  7397564.733604 
+353845.877818  7397578.131309 
+353848.277471  7397599.737608 
+353854.231250  7397617.554557 
+353857.950300  7397625.993111 
+353868.670400  7397652.748528 
+353886.605951  7397715.537773 
+353894.547072  7397732.944791 
+353902.108865  7397740.003582 
+353919.236286  7397738.373861 
+353976.399157  7397735.564343 
+Region 1
+189
+324677.920995  7399197.423939 
+324782.458461  7399206.932311 
+325016.857567  7399181.586652 
+325682.056255  7399140.403706 
+325865.040113  7399134.584703 
+326431.391234  7399199.933509 
+326675.413691  7399212.761312 
+326901.277948  7399224.829245 
+327116.537553  7399213.321216 
+327105.050554  7399145.072906 
+327095.823022  7399102.290235 
+327092.532776  7399019.634393 
+327088.129289  7398984.530406 
+327088.467384  7398979.811214 
+327157.414118  7398854.862617 
+327190.613443  7398800.841870 
+327199.230754  7398784.624648 
+327204.425879  7398767.957503 
+327206.668854  7398746.291214 
+327205.967925  7398717.346172 
+327205.877216  7398702.978633 
+327210.058055  7398677.463004 
+327215.879894  7398668.454547 
+327222.641803  7398649.817739 
+327330.015972  7398465.119376 
+327336.217138  7398453.081438 
+327353.798101  7398428.965569 
+327363.141081  7398397.071032 
+327395.276641  7398353.138558 
+327460.891899  7398241.927607 
+327509.792046  7398139.425165 
+327559.186968  7398037.662596 
+327587.842620  7397981.352241 
+327733.759671  7397726.455903 
+327815.685972  7397640.850566 
+327930.646674  7397541.787535 
+327964.901516  7397503.874029 
+327960.011501  7397358.338958 
+327960.011501  7397237.259698 
+327879.503551  7397240.909073 
+327872.279853  7397239.849254 
+327813.451244  7397240.089213 
+327743.209851  7397239.319345 
+327670.469851  7397120.919626 
+327538.018894  7396913.845096 
+327444.688056  7396776.748579 
+327355.587533  7396637.912360 
+327319.056732  7396569.494080 
+327271.220348  7396497.516409 
+327197.350613  7396547.047925 
+327121.732678  7396569.494080 
+327124.041623  7396529.520927 
+327119.704106  7396502.895488 
+327113.816297  7396474.000437 
+327102.617916  7396445.515316 
+327091.081439  7396423.889021 
+327077.656576  7396405.692138 
+327059.663300  7396387.525249 
+327040.169211  7396372.797772 
+327027.940051  7396363.729325 
+326976.689728  7396320.636707 
+326956.791573  7396302.099882 
+326937.256253  7396280.523578 
+326918.883651  7396261.206887 
+326829.296601  7396237.370970 
+326814.469878  7396240.130497 
+326781.196338  7396251.608531 
+326758.684128  7396264.146383 
+326723.340783  7396296.880776 
+326695.229383  7396282.143300 
+326707.293619  7396238.470781 
+326708.926372  7396217.124438 
+326738.052059  7396121.050894 
+326737.969597  7396105.443567 
+326732.922903  7396089.096368 
+326723.711864  7396056.182006 
+326724.849844  7396000.001629 
+326739.033360  7395842.888541 
+326753.917807  7395717.929945 
+326767.820952  7395600.580046 
+326722.252281  7395592.821375 
+326675.628093  7395581.013398 
+326616.082061  7395566.125948 
+326616.073815  7395566.145944 
+326499.307189  7395571.235073 
+326434.763942  7395579.483660 
+326293.308101  7395601.169945 
+326241.439311  7395612.967924 
+326076.432235  7395651.951247 
+326060.409809  7395655.290675 
+326016.160536  7395659.709918 
+325977.271312  7395674.527380 
+325916.546069  7395703.612398 
+325895.237809  7395723.718953 
+325876.246740  7395755.763465 
+325844.292596  7395787.318060 
+325828.542296  7395794.716792 
+325817.352161  7395798.296179 
+325796.497444  7395800.885735 
+325769.029249  7395805.274984 
+325709.771836  7395810.994004 
+325688.933611  7395819.172603 
+325671.138245  7395824.801639 
+325662.751829  7395829.130897 
+325645.236835  7395843.648411 
+325628.249600  7395862.975100 
+325561.850951  7395949.470284 
+325516.686345  7395993.502742 
+325530.680199  7396021.447955 
+325534.110631  7396033.985808 
+325532.222244  7396044.643982 
+325534.506450  7396050.343006 
+325531.859410  7396068.589880 
+325525.402611  7396077.708318 
+325516.661607  7396090.246171 
+325501.818391  7396102.034151 
+325485.853689  7396111.912459 
+325467.200715  7396120.640964 
+325432.962366  7396133.938687 
+325393.009378  7396146.086606 
+325351.910165  7396159.004393 
+325324.953237  7396168.152826 
+325288.372957  7396174.191792 
+325247.653070  7396178.361077 
+325219.863273  7396180.630689 
+325167.343030  7396184.410041 
+325123.580284  7396187.819457 
+325022.333064  7396184.749983 
+324953.048234  7396172.572069 
+324700.672345  7396127.629767 
+324585.711644  7396105.553549 
+324572.047640  7396095.685239 
+324560.593625  7396088.456477 
+324548.026370  7396080.117906 
+324536.201275  7396070.179608 
+324527.163406  7396064.370603 
+324506.127272  7396048.483324 
+324523.881407  7396080.807787 
+324527.163406  7396103.803848 
+324522.232160  7396177.701190 
+324515.668161  7396220.403876 
+324489.387424  7396323.866154 
+324482.823424  7396419.119838 
+324489.387424  7396451.964212 
+324494.318670  7396474.950274 
+324500.882669  7396499.586054 
+324509.095915  7396522.582115 
+324519.601613  7396545.958111 
+324479.871274  7396681.244938 
+324472.812500  7396704.111021 
+324446.012251  7396786.426921 
+324419.632559  7396874.811782 
+324429.569267  7396885.939876 
+324435.127226  7396893.498581 
+324439.538960  7396902.627017 
+324443.076592  7396912.535320 
+324443.043608  7396924.063345 
+324440.322351  7396937.980961 
+324429.965086  7396949.928915 
+324406.768439  7397044.902647 
+324370.707672  7397107.931850 
+324352.236116  7397131.617793 
+324331.727740  7397182.789028 
+324285.746758  7397343.731460 
+324230.719661  7397533.278992 
+324188.853548  7397690.242106 
+324194.263075  7397698.160749 
+324176.978976  7397731.405055 
+324092.018061  7397845.835454 
+324040.990386  7397911.364230 
+324057.120013  7397934.540260 
+323980.817641  7397992.200383 
+323924.256745  7398036.192848 
+323894.867179  7398063.488172 
+323867.563909  7398098.142236 
+323847.566800  7398138.115389 
+323830.909414  7398192.076146 
+323823.578515  7398208.733293 
+323794.527045  7398290.029368 
+323748.999605  7398458.030591 
+323878.712813  7398544.435790 
+323992.576766  7398611.404319 
+324101.971262  7398696.249786 
+324166.712419  7398772.156784 
+324280.576371  7398954.105617 
+324343.082800  7399027.772999 
+324392.205596  7399056.798027 
+324541.718003  7399165.749365 
+324677.920995  7399197.423939 
+Region 1
+124
+333956.423041  7394117.764039 
+333947.632559  7394151.748218 
+333937.423725  7394115.114493 
+333926.142882  7394090.908639 
+333914.862038  7394064.673133 
+333910.087471  7394056.264573 
+333899.787929  7394038.417630 
+333892.993034  7394028.729290 
+333886.453774  7394018.780994 
+333877.630307  7394007.812873 
+333870.942614  7394000.004210 
+333844.810309  7393981.247423 
+333802.688563  7393971.229139 
+333747.339863  7393961.650780 
+333719.137754  7393959.301182 
+333662.684059  7393954.741963 
+333456.750941  7393939.814520 
+333348.296515  7393932.705738 
+333236.312703  7393924.627122 
+333191.717088  7393921.957579 
+333146.082447  7393928.026539 
+333080.392974  7393935.765214 
+333041.759383  7393939.624553 
+333017.243340  7393944.773671 
+332915.641532  7393966.190002 
+332883.440001  7393972.568910 
+332838.316627  7393850.359843 
+332806.510916  7393761.085135 
+332783.710088  7393687.697705 
+332766.764084  7393643.535270 
+332749.430507  7393607.281480 
+332714.639660  7393561.139384 
+332691.071933  7393516.607012 
+332669.153452  7393463.186162 
+332653.543337  7393423.622939 
+332641.388393  7393377.150899 
+332635.187228  7393320.950526 
+332625.151565  7393236.764946 
+332616.913581  7393138.681747 
+332610.011485  7393103.287810 
+332603.538194  7393079.041963 
+332591.572914  7393028.010704 
+332583.170005  7392994.156503 
+332578.560362  7392958.982528 
+332572.837478  7392917.239678 
+332573.876503  7392885.275153 
+332575.220638  7392839.113060 
+332582.634000  7392791.091286 
+332584.753281  7392746.688892 
+332583.293698  7392701.066706 
+332580.803337  7392653.954776 
+332577.702754  7392584.276711 
+332555.710057  7392351.046662 
+332557.515981  7392291.436872 
+332555.619348  7392250.453892 
+332559.536308  7392053.557619 
+332626.710103  7392026.792204 
+332727.652212  7391998.537043 
+332872.571469  7391951.855040 
+332932.142239  7391927.989128 
+333028.037656  7391902.023575 
+333133.292544  7391870.638951 
+333289.797755  7391879.407449 
+333239.347316  7391844.073502 
+333250.108647  7391826.466518 
+333253.638034  7391822.627175 
+333259.707259  7391819.777663 
+333264.786938  7391818.467888 
+333269.619229  7391818.427894 
+333277.263485  7391819.377732 
+333283.876961  7391819.817656 
+333289.220519  7391820.027620 
+333295.833996  7391819.717674 
+333302.678367  7391817.877989 
+333309.011473  7391814.528562 
+333313.299512  7391811.189134 
+333321.578728  7391799.701102 
+333378.246825  7391690.329836 
+333384.497468  7391539.305706 
+333398.606768  7391516.789562 
+333418.191566  7391488.814354 
+333436.481706  7391488.064483 
+333513.386053  7391491.213943 
+333580.106305  7391482.015519 
+333632.337930  7391481.265647 
+333714.173523  7391474.746764 
+333781.553474  7391471.317351 
+333826.083119  7391473.466983 
+333859.810202  7391489.414252 
+333890.156331  7391524.158300 
+334025.790333  7391529.297420 
+334080.363887  7391531.637019 
+334144.321652  7391529.517382 
+334171.220856  7391678.751820 
+334185.717730  7391763.807250 
+334190.368604  7391790.992594 
+334214.373381  7391904.213200 
+334222.240286  7391954.644562 
+334230.239129  7391999.996793 
+334242.493028  7392080.962925 
+334278.537302  7392277.169316 
+334302.781220  7392415.995537 
+334329.218636  7392548.722802 
+334358.781373  7392719.923476 
+334409.743078  7392986.947738 
+334358.921558  7392996.776054 
+334356.241534  7393021.411834 
+334345.405986  7393111.826347 
+334342.288911  7393124.054252 
+334333.853017  7393138.121843 
+334304.578899  7393170.236342 
+334294.394804  7393193.372379 
+334277.960066  7393343.586649 
+334240.538671  7393340.567166 
+334209.607060  7393348.105874 
+334149.797149  7393365.672865 
+334176.102625  7393464.365960 
+334198.021106  7393539.693057 
+334231.410094  7393644.665077 
+334141.328270  7393692.396901 
+334024.149333  7393748.137353 
+334002.890550  7393905.390417 
+333992.211682  7393973.488752 
+333956.423041  7394117.764039 
+Region 1
+145
+329086.603286  7402389.157224 
+329078.794105  7402335.956337 
+329044.176429  7402293.933535 
+328991.441784  7402247.231535 
+328876.068771  7402181.852734 
+328774.293793  7402116.863866 
+328710.319535  7402074.781074 
+328675.413241  7402053.494720 
+328629.440505  7402030.508657 
+328577.513991  7401998.164198 
+328548.107932  7401973.788373 
+328521.513838  7401947.792826 
+328474.328907  7401889.732771 
+328413.249076  7401818.374994 
+328373.823847  7401768.183591 
+328263.901593  7401657.802499 
+328195.499110  7401557.499680 
+328172.393171  7401536.823221 
+328116.838316  7401463.745739 
+328065.893103  7401410.154918 
+328018.642201  7401351.424978 
+327958.708597  7401268.679152 
+327942.290351  7401226.466383 
+327926.449342  7401186.993144 
+327917.518675  7401143.050671 
+327913.073956  7401127.793284 
+327904.201012  7401085.320560 
+327901.116922  7401059.754939 
+327898.107048  7401043.577710 
+327901.042706  7401007.563879 
+327904.407168  7400986.917415 
+327908.101479  7400963.101495 
+327916.289986  7400940.275405 
+327931.529020  7400859.829184 
+327956.251220  7400744.768893 
+327975.201058  7400663.912743 
+327983.892585  7400597.324149 
+327993.862278  7400518.667622 
+327992.633590  7400467.596370 
+327988.617675  7400446.999898 
+327983.678183  7400425.183635 
+327974.228003  7400391.519401 
+327951.526130  7400352.696052 
+327918.706132  7400303.074551 
+327857.337683  7400201.801898 
+327828.179012  7400148.161087 
+327801.354023  7400085.171876 
+327774.529035  7400016.363662 
+327739.078490  7399947.095527 
+327707.833522  7399873.848074 
+327705.541070  7399867.899093 
+327677.677056  7399805.989697 
+327630.285969  7399704.737041 
+327582.886635  7399576.558997 
+327557.026456  7399446.221322 
+327535.421331  7399299.876390 
+327502.287977  7399141.383538 
+327604.978287  7399124.166488 
+327687.193206  7399107.099411 
+327890.619470  7399056.238123 
+328141.857379  7399021.464080 
+328241.785202  7398973.502295 
+328317.708248  7398902.424470 
+328421.668478  7398807.610711 
+328615.537360  7398687.691252 
+328705.478998  7398637.709813 
+328821.404508  7398601.735975 
+329181.162813  7398557.763507 
+329263.649858  7398549.594906 
+329395.482347  7398538.076879 
+329435.657983  7399061.717185 
+329451.301082  7399191.105022 
+329458.986569  7399344.238791 
+329465.608293  7399378.612903 
+329488.079271  7399409.027693 
+329515.836083  7399431.503843 
+329573.328804  7399496.512708 
+329601.456696  7399528.847169 
+329633.196438  7399562.451413 
+329650.208412  7399584.597620 
+329805.979709  7399801.140528 
+329890.602528  7399920.420097 
+329905.915778  7399944.905902 
+329935.247620  7399999.116617 
+330000.607245  7400055.746916 
+330049.103327  7400141.592212 
+330098.036460  7400238.035692 
+330129.677247  7400322.161282 
+330108.006152  7400339.758268 
+330060.656296  7400395.078792 
+330016.423515  7400429.032976 
+329971.498050  7400459.587742 
+329922.935998  7400489.322649 
+329889.893352  7400509.579179 
+329860.586248  7400527.626088 
+329851.292746  7400535.624718 
+329847.557204  7400539.644029 
+329842.832114  7400552.141888 
+329841.760104  7400575.737847 
+329843.937108  7400640.916682 
+329818.852075  7400759.126434 
+329773.069002  7400988.187198 
+329755.669456  7401073.362608 
+329824.962532  7401089.719806 
+329875.660358  7401164.427009 
+329910.055386  7401220.687373 
+329936.138213  7401257.821012 
+329915.687561  7401359.213644 
+329975.266578  7401452.597648 
+330017.973806  7401536.203328 
+330012.292153  7401579.055987 
+330010.857309  7401601.132206 
+330001.069033  7401699.865294 
+330020.381706  7401744.507647 
+330091.389998  7401907.479731 
+330094.474088  7401909.779337 
+330193.189715  7401980.037303 
+330210.251166  7402002.603437 
+330175.386103  7402007.532593 
+330136.233000  7402010.932011 
+330100.477344  7402014.341427 
+330065.571050  7402024.559676 
+330000.879370  7402067.122386 
+329940.426253  7402113.084513 
+329902.122512  7402135.220721 
+329873.178242  7402139.479992 
+329845.091581  7402142.029555 
+329825.506783  7402146.288825 
+329799.118845  7402159.056638 
+329766.768882  7402176.933576 
+329759.108134  7402184.592264 
+329742.937275  7402188.001680 
+329653.548135  7402175.233867 
+329430.512335  7402142.879409 
+329351.340275  7402129.261742 
+329189.590460  7402107.985386 
+329155.541774  7402107.125534 
+329155.492297  7402107.145530 
+329156.993111  7402153.997505 
+329156.217965  7402247.021571 
+329156.226211  7402247.051566 
+329135.792052  7402360.532127 
+329126.160454  7402362.741749 
+329117.930716  7402376.709356 
+329086.603286  7402389.157224 
+Region 1
+514
+334379.256763  7402229.984489 
+334383.891145  7402300.952333 
+334381.227612  7402411.963318 
+334383.891145  7402451.776498 
+334377.640502  7402474.472610 
+334416.752374  7402546.400290 
+334440.996292  7402584.113830 
+334457.727894  7402613.128860 
+334505.440585  7402703.143441 
+334573.636912  7402794.947716 
+334605.285945  7402826.602294 
+334622.429859  7402862.286182 
+334648.372500  7402926.965103 
+334672.665896  7402986.454913 
+334674.710961  7402993.943630 
+334691.120960  7403041.125548 
+334701.049422  7403070.810463 
+334719.133406  7403109.983753 
+334745.364665  7403167.883835 
+334585.313575  7403210.856475 
+334545.772899  7403205.097461 
+334497.928268  7403171.743174 
+334445.977015  7403218.635142 
+334395.229712  7403230.473114 
+334370.425050  7403207.896982 
+334267.660524  7403234.542417 
+334100.022901  7403279.534711 
+334031.348292  7403215.435690 
+333944.358805  7403279.524712 
+333845.354560  7403296.121869 
+333788.125719  7403323.597163 
+333795.926654  7403394.704983 
+333870.200453  7403447.825884 
+333862.820077  7403475.371166 
+333850.516700  7403498.977122 
+333832.333762  7403504.396194 
+333800.849653  7403543.249539 
+333766.413394  7403570.304904 
+333725.503844  7403592.701068 
+333702.422644  7403599.919832 
+333685.361193  7403602.849330 
+333655.847934  7403612.067751 
+333614.690996  7403629.464771 
+333610.551389  7403631.814368 
+333602.280419  7403637.273433 
+333597.786224  7403641.912639 
+333585.590048  7403662.269152 
+333592.879716  7403577.303705 
+333496.176170  7403582.502815 
+333488.507175  7403626.375300 
+333475.717271  7403686.375023 
+333461.946066  7403760.152385 
+333454.079162  7403829.020589 
+333464.898217  7403873.283007 
+333484.136673  7403893.249587 
+333523.965967  7403929.193430 
+333544.383634  7403961.247939 
+333553.751352  7404001.810991 
+333555.887126  7404015.478650 
+333559.771100  7404042.434033 
+333563.432427  7404056.451632 
+333566.590733  7404072.278921 
+333580.238245  7404082.817116 
+333592.154048  7404090.245843 
+333607.236404  7404104.853341 
+333617.667886  7404114.581675 
+333629.311563  7404127.709426 
+333635.182880  7404137.507748 
+333635.100417  7404155.404682 
+333631.876141  7404167.242654 
+333626.779970  7404180.260424 
+333624.231885  7404186.389375 
+333616.958710  7404206.285967 
+333607.079725  7404221.293396 
+333606.890062  7404240.320137 
+333603.649294  7404273.094523 
+333599.361254  7404311.207994 
+333597.530590  7404337.503490 
+333593.357998  7404360.389570 
+333578.795154  7404397.883148 
+333578.745677  7404397.913143 
+333535.560167  7404430.987477 
+333524.510218  7404448.624456 
+333518.812073  7404471.160596 
+333517.360736  7404497.816030 
+333518.383269  7404535.099644 
+333518.449238  7404561.345148 
+333518.276068  7404573.912995 
+333517.121595  7404576.492553 
+333518.309053  7404573.883000 
+333512.759339  7404586.110906 
+333505.156315  7404598.878719 
+333491.888130  7404614.486046 
+333477.407749  7404630.463309 
+333470.307744  7404640.001675 
+333459.447458  7404646.430574 
+333443.647680  7404657.278716 
+333427.443837  7404666.997051 
+333407.364265  7404671.526275 
+333392.587020  7404673.685905 
+333338.673164  7404679.114975 
+333310.908106  7404680.294773 
+333290.828534  7404683.684193 
+333278.360233  7404685.353907 
+333236.906432  7404700.611293 
+333208.044624  7404708.110009 
+333201.035328  7404709.949693 
+333149.488141  7404759.311238 
+333141.612990  7404787.026491 
+333145.389764  7404799.144415 
+333136.013800  7404859.624056 
+333127.916001  7404895.957832 
+333120.131560  7404924.772896 
+333104.595661  7404961.036685 
+333080.656853  7404999.310129 
+333061.632799  7405028.335157 
+332996.718472  7405116.959976 
+332916.029105  7405227.241086 
+332897.235945  7405313.646286 
+332879.176700  7405392.412794 
+332832.964823  7405467.419946 
+332836.543688  7405511.762350 
+332861.241148  7405568.852571 
+332864.284007  7405633.351523 
+332854.578194  7405705.229211 
+332877.700625  7405756.990345 
+332918.849316  7405822.249167 
+332887.761026  7405869.301107 
+332809.256910  7405952.576843 
+332749.026442  7406010.396939 
+332738.900071  7406031.033404 
+332735.593332  7406050.510068 
+332737.283809  7406073.086201 
+332744.491015  7406097.032099 
+332754.807049  7406115.188989 
+332800.598368  7406153.892359 
+332830.532185  7406174.618809 
+332852.120817  7406197.254932 
+332854.396777  7406213.512147 
+332846.810245  7406250.155870 
+332846.892707  7406261.823871 
+332852.467159  7406276.861296 
+332875.317464  7406299.007502 
+332890.531760  7406310.125598 
+332901.400292  7406325.253007 
+332913.852100  7406352.558329 
+332925.240144  7406382.903132 
+332937.403335  7406407.478922 
+332956.031570  7406431.534802 
+332973.917644  7406448.531890 
+332997.782235  7406470.938052 
+333031.426856  7406495.783796 
+333063.933498  7406512.990849 
+333150.518919  7406570.311030 
+333186.868304  7406600.255901 
+333238.456723  7406725.004533 
+333247.956381  7406747.200731 
+333259.047561  7406764.087838 
+333277.659304  7406783.894446 
+333289.962680  7406804.610897 
+333307.626106  7406836.815381 
+333332.537969  7406873.189150 
+333358.340424  7406917.941484 
+333364.096293  7406937.538128 
+333353.310224  7406969.332682 
+333340.140993  7406990.928982 
+333337.246566  7407016.244646 
+333337.048657  7407047.169349 
+333322.840401  7407071.285218 
+333301.416694  7407088.972188 
+333279.836308  7407100.060289 
+333246.158703  7407111.978248 
+333225.798759  7407126.125824 
+333214.179820  7407145.222553 
+333222.137433  7407169.678364 
+333228.792141  7407180.166568 
+333229.229191  7407201.732874 
+333220.067629  7407259.392997 
+333225.642081  7407291.437508 
+333233.583201  7407300.405972 
+333238.869035  7407317.483047 
+333238.613401  7407335.729921 
+333231.026869  7407354.116772 
+333222.483774  7407369.964057 
+333209.603162  7407389.800659 
+333195.386660  7407407.247671 
+333184.707792  7407420.355426 
+333171.686994  7407432.333374 
+333158.187914  7407442.271671 
+333135.296378  7407456.889168 
+333126.448172  7407476.015891 
+333122.432258  7407492.703033 
+333117.839107  7407513.669442 
+333112.553274  7407530.576546 
+333103.762792  7407546.423831 
+333083.105984  7407579.828109 
+333078.471602  7407604.353908 
+333078.900406  7407626.670086 
+333089.892632  7407667.903023 
+333104.257566  7407718.824301 
+333109.172319  7407744.999817 
+333108.322957  7407768.815737 
+333104.801817  7407785.252922 
+333094.988802  7407801.330168 
+333083.971838  7407813.838026 
+333077.242914  7407826.405873 
+333075.016432  7407840.583444 
+333081.118642  7407854.361084 
+333088.210401  7407868.658635 
+333099.301581  7407886.055655 
+333105.073942  7407904.662468 
+333107.531319  7407925.988815 
+333107.382887  7407953.624081 
+333103.193802  7407999.186277 
+332938.953626  7408038.109610 
+332946.498927  7408125.794590 
+332952.411474  7408178.075635 
+332929.379752  7408201.131686 
+332898.810975  7408211.739869 
+332882.805042  7408210.840023 
+332866.642429  7408197.042386 
+332855.782144  7408187.604003 
+332846.933938  7408180.195272 
+332827.184216  7408170.666904 
+332811.714287  7408166.487620 
+332794.941454  7408166.337646 
+332770.243993  7408173.706383 
+332738.108432  7408190.113573 
+332698.064736  7408210.999995 
+332672.608622  7408217.358906 
+332642.320217  7408224.427695 
+332608.980707  7408231.716447 
+332579.220060  7408235.255840 
+332549.492399  7408234.995885 
+332514.223270  7408227.607151 
+332483.539046  7408218.748668 
+332446.818581  7408199.971884 
+332426.046326  7408190.943431 
+332390.538057  7408181.535042 
+332362.888445  7408174.466253 
+332325.516528  7408177.175789 
+332293.702570  7408184.734494 
+332261.080482  7408198.362160 
+332239.162001  7408207.520591 
+332218.043404  7408210.370103 
+332197.238164  7408205.890870 
+332176.004120  7408191.043414 
+332155.042202  7408172.656563 
+332132.546485  7408155.269541 
+332103.915572  7408142.641704 
+332089.707317  7408139.982160 
+332058.973615  7408138.452422 
+332019.820512  7408141.151960 
+331972.050098  7408139.972162 
+331925.632065  7408127.944222 
+331887.897314  7408110.167267 
+331853.213668  7408091.670435 
+331824.376599  7408073.723509 
+331782.848582  7408052.127209 
+331740.050645  7408032.030651 
+331703.280702  7408020.592610 
+331673.091252  7408013.753782 
+331636.007953  7408010.904270 
+331595.593176  7408012.823941 
+331569.642288  7408017.153199 
+331540.665034  7408018.412984 
+331503.837368  7408016.073384 
+331472.345013  7408012.763951 
+331444.629432  7408015.563472 
+331423.411880  7408033.830343 
+331402.491193  7408044.768469 
+331385.396757  7408054.736762 
+331370.627758  7408059.665917 
+331352.304633  7408063.295296 
+331324.399389  7408055.976549 
+331301.400652  7408039.089442 
+331282.211673  7408020.722588 
+331189.021020  7407898.183578 
+331104.323985  7407868.428675 
+331015.198725  7407836.004229 
+331030.314065  7407833.464664 
+331045.932426  7407833.464664 
+331057.774013  7407834.224533 
+331069.112581  7407837.523968 
+331126.770225  7407861.409877 
+331135.082426  7407864.199399 
+331142.380340  7407864.449356 
+331150.436907  7407862.169747 
+331158.006947  7407856.830661 
+331169.947489  7407845.912531 
+331268.729086  7407758.257546 
+331290.919693  7407735.391463 
+331306.571038  7407711.755511 
+331330.584062  7407693.118704 
+331330.311936  7407667.813038 
+331339.663162  7407646.466695 
+331345.979775  7407626.140176 
+331349.278267  7407606.333569 
+331352.815900  7407393.929952 
+331350.828558  7407376.142999 
+331347.068277  7407362.165393 
+331342.301956  7407351.497220 
+331333.750615  7407338.289483 
+331298.778350  7407299.416141 
+331285.452442  7407284.928623 
+331274.402493  7407256.993408 
+331269.149644  7407218.110068 
+331265.653242  7407199.823201 
+331261.142554  7407180.256552 
+331255.122805  7407163.239467 
+331245.070650  7407142.403036 
+331210.362265  7407097.690695 
+331200.796638  7407086.002697 
+331194.257377  7407080.673610 
+331181.673629  7407072.794959 
+331174.367469  7407070.755309 
+331160.258168  7407066.945961 
+331123.240839  7407056.777703 
+331090.758936  7407046.369486 
+331084.970082  7407043.569965 
+331074.654048  7407037.980923 
+331065.591440  7407031.632010 
+331032.128236  7406991.228931 
+331001.460504  7406943.467112 
+330971.312285  7406876.398600 
+330967.543758  7406866.740255 
+330963.033070  7406854.292387 
+330965.061642  7406839.814867 
+330965.333768  7406827.616956 
+330967.098461  7406817.958611 
+330970.899974  7406803.481091 
+331000.429726  7406754.699446 
+331011.537398  7406737.422406 
+331016.336704  7406727.014189 
+331022.397684  7406716.845930 
+331028.466910  7406701.088629 
+331034.536135  7406679.752284 
+331092.498891  7406638.689318 
+331102.353136  7406599.376052 
+331109.387171  7406583.388790 
+331110.838508  7406554.503738 
+331104.439433  7406524.968797 
+331092.383443  7406506.441971 
+331069.211535  7406477.496929 
+331050.979119  7406454.580854 
+331031.666447  7406428.215370 
+331011.149825  7406398.860398 
+330987.211018  7406358.497312 
+330983.846556  7406320.233866 
+330982.857008  7406300.067321 
+330984.036219  7406268.522724 
+330988.654108  7406249.076055 
+331002.516022  7406224.980182 
+331024.088161  7406189.456267 
+331052.397471  7406171.289379 
+331087.377981  7406159.841340 
+331116.536653  7406155.742042 
+331147.361063  7406150.782892 
+331165.230645  7406151.762724 
+331190.406387  7406148.723245 
+331204.993969  7406133.715815 
+331212.588748  7406103.351016 
+331209.496411  7406069.536809 
+331205.686653  7406036.152527 
+331211.953788  7406017.065796 
+331222.475978  7406007.887369 
+331253.580760  7405949.657343 
+331261.216770  7405910.524046 
+331243.083309  7405875.200097 
+331213.504079  7405848.474674 
+331181.038669  7405828.428108 
+331196.310688  7405779.746447 
+331252.442780  7405661.566690 
+331300.188456  7405584.699857 
+331288.849889  7405477.058295 
+331273.346975  7405361.218137 
+331260.573564  7405250.847043 
+331359.083035  7405196.126416 
+331368.203366  7405189.737510 
+331381.892109  7405176.049855 
+331415.643931  7405155.983292 
+331448.472175  7405128.627978 
+331466.712837  7405114.030478 
+331514.153402  7405076.636883 
+331531.478733  7405046.532040 
+331559.763304  7404992.721257 
+331623.597376  7404951.668289 
+331613.858577  7404874.261548 
+331623.787039  7404819.110995 
+331654.611449  7404750.092817 
+331647.313535  7404731.845943 
+331644.584033  7404697.181880 
+331701.128436  7404621.484847 
+331708.426350  7404603.237972 
+331704.781516  7404578.612190 
+331687.447939  7404555.806097 
+331615.392376  7404483.748440 
+331588.031383  7404438.146251 
+331604.499105  7404415.940055 
+331631.810621  7404376.116876 
+331660.086946  7404335.983750 
+331665.562443  7404318.656718 
+331659.171615  7404302.239531 
+331583.471217  7404163.593279 
+331602.618965  7404094.265155 
+331796.809450  7403685.145233 
+331857.947004  7403562.876177 
+331807.001791  7403550.838239 
+331767.898166  7403538.960273 
+331709.753993  7403522.123157 
+331665.422257  7403518.013861 
+331638.391113  7403506.575821 
+331590.562976  7403467.072587 
+331583.289800  7403464.992943 
+331483.493917  7403408.852560 
+331475.173470  7403403.653450 
+331399.283409  7403374.538437 
+331376.400119  7403369.349326 
+331343.126579  7403364.150217 
+331377.958657  7403299.421304 
+331410.712685  7403265.637091 
+331460.973461  7403232.442777 
+331479.073937  7403196.368956 
+331485.712153  7403184.620968 
+331522.647020  7403107.174234 
+331532.460034  7403055.783037 
+331524.485929  7402976.576605 
+331498.246423  7402921.656012 
+331474.480787  7402871.914532 
+331458.730486  7402813.554529 
+331466.143848  7402754.274683 
+331478.801812  7402691.455443 
+331448.752547  7402630.965805 
+331429.093533  7402492.159581 
+331327.211354  7402452.326404 
+331310.537475  7402445.847514 
+331261.381694  7402416.782492 
+331188.270613  7402388.417351 
+331091.006323  7402346.734491 
+331090.090991  7402315.249884 
+331095.888091  7402291.134015 
+331061.377616  7402270.787500 
+330962.266170  7402191.131144 
+330997.931118  7402164.765660 
+331025.250880  7402135.560663 
+331089.711665  7402052.364914 
+331113.469055  7402011.481917 
+331165.346092  7401924.006900 
+331193.441000  7401881.944105 
+331192.921488  7401863.527260 
+331218.723943  7401784.370819 
+331227.613380  7401707.873922 
+331234.721631  7401641.165348 
+331239.166349  7401619.029140 
+331257.852308  7401563.778604 
+331279.836759  7401534.623598 
+331311.592993  7401502.479104 
+331338.797308  7401473.794018 
+331377.546345  7401436.040484 
+331390.558897  7401423.512630 
+331558.476892  7401457.046886 
+331626.961838  7401471.274449 
+331715.023335  7401484.622163 
+331754.151699  7401495.290336 
+331783.508280  7401512.197439 
+331848.043281  7401567.807914 
+331877.944114  7401587.154600 
+331904.117650  7401602.991887 
+331925.302216  7401611.560420 
+331951.780863  7401620.538882 
+332001.621081  7401630.527171 
+332096.526949  7401640.395480 
+332210.308440  7401645.144667 
+332273.260165  7401648.704057 
+332322.193297  7401649.483924 
+332390.439102  7401654.613045 
+332497.706070  7401666.161067 
+332547.999831  7401686.017666 
+332584.637834  7401705.004413 
+332686.585983  7401761.494737 
+332747.360703  7401798.968318 
+332769.576049  7401817.455152 
+332791.766655  7401840.901136 
+332837.417788  7401915.998272 
+332850.916868  7401934.405119 
+332871.548937  7401962.030387 
+332893.351971  7401985.846308 
+332919.327597  7402009.322287 
+332944.618786  7402024.779639 
+332971.080941  7402036.667603 
+333019.280159  7402056.344232 
+333080.269281  7402069.132042 
+333169.303833  7402072.081536 
+333242.818979  7402071.341663 
+333376.861458  7402093.727829 
+333449.147916  7402093.737827 
+333512.107887  7402089.308586 
+333563.259256  7402105.045890 
+333701.466081  7402224.075501 
+333742.952868  7402258.219653 
+333765.003289  7402271.497378 
+333798.136643  7402290.464129 
+333867.231810  7402319.499156 
+333895.763768  7402354.423174 
+333935.106534  7402371.140310 
+334022.656765  7402375.569552 
+334081.683284  7402366.711069 
+334108.318609  7402360.422146 
+334132.339879  7402341.135450 
+334197.270699  7402308.181095 
+334249.403369  7402244.242047 
+334277.110704  7402221.205993 
+334359.581257  7402151.287969 
+334379.256763  7402229.984489 
+Region 1
+204
+330950.853387  7387691.874736 
+330876.662050  7387602.300079 
+330805.068275  7387510.095873 
+330727.677401  7387424.140596 
+330650.500928  7387338.625244 
+330572.837928  7387253.559815 
+330555.512597  7387229.943860 
+330497.970400  7387158.766052 
+330461.398367  7387176.463021 
+330438.663509  7387188.420973 
+330400.697863  7387206.217924 
+330386.456623  7387212.146909 
+330329.516400  7387242.991625 
+330296.300583  7387258.418983 
+330273.763635  7387267.907357 
+330213.376488  7387275.576044 
+330169.918852  7387293.382994 
+330042.836192  7387321.478181 
+329998.760089  7387334.725912 
+329956.506403  7387349.743340 
+329924.271887  7387362.961076 
+329829.761838  7387433.409008 
+329740.587100  7387502.307207 
+329652.805975  7387578.354181 
+329605.571565  7387620.936887 
+329557.446563  7387656.030875 
+329464.725946  7387678.197079 
+329432.969712  7387693.814403 
+329406.383864  7387707.422073 
+329328.267321  7387745.315582 
+329274.023616  7387773.140816 
+329225.700704  7387805.805220 
+329174.508105  7387845.418435 
+329136.212609  7387890.930639 
+329066.350543  7387999.981960 
+329034.149013  7388047.893753 
+329006.243768  7388077.138743 
+328983.261523  7388096.585412 
+328960.468942  7388116.581987 
+328986.312629  7388192.758939 
+329012.906723  7388275.254808 
+329055.539735  7388390.215116 
+329088.912230  7388478.939919 
+329097.075999  7388502.625861 
+329111.119330  7388543.218908 
+329130.357786  7388609.337583 
+329134.142806  7388619.945765 
+329163.746774  7388720.938466 
+329173.427848  7388746.374109 
+329198.026354  7388826.670355 
+329207.212655  7388865.033784 
+329216.481419  7388942.070588 
+329224.603956  7389003.320097 
+329228.430207  7389063.709753 
+329229.452739  7389149.984975 
+329226.682006  7389231.930938 
+329226.640775  7389247.018354 
+329223.804071  7389267.674815 
+329224.958544  7389292.110630 
+329226.236709  7389313.546958 
+329234.128352  7389362.398590 
+329238.474116  7389374.726478 
+329255.345904  7389427.987355 
+329279.738254  7389518.331880 
+329304.221313  7389600.217854 
+329308.962895  7389631.062570 
+329315.873237  7389695.391551 
+329321.340487  7389748.372476 
+329328.992989  7389856.913884 
+329330.823653  7389873.611024 
+329337.321682  7389930.331308 
+329343.951652  7389978.463064 
+329344.891722  7389999.999375 
+329353.459556  7390068.967561 
+329357.467224  7390103.261687 
+329360.493591  7390113.799882 
+329365.482560  7390131.796799 
+329372.277454  7390162.451548 
+329404.033688  7390283.320844 
+329424.756466  7390370.725873 
+329436.779470  7390407.749531 
+329446.889349  7390442.423592 
+329460.850218  7390496.864266 
+329462.548941  7390502.603283 
+329468.123393  7390520.980136 
+329474.662654  7390546.525760 
+329493.447567  7390599.246729 
+329511.952109  7390647.118529 
+329532.287314  7390699.719519 
+329583.422190  7390823.248360 
+329684.768365  7390895.316015 
+329742.887798  7390927.450511 
+329789.462509  7390960.114916 
+329836.202144  7390988.010137 
+329893.736095  7391025.903647 
+330043.256749  7391125.106654 
+330125.809764  7391177.297714 
+330205.006564  7391226.889220 
+330282.422177  7391276.850662 
+330364.488664  7391331.081372 
+330388.782060  7391339.559920 
+330454.281870  7391387.281746 
+330490.524053  7391405.308658 
+330537.601784  7391447.391450 
+330564.690652  7391470.517488 
+330605.517740  7391515.519780 
+330653.477817  7391561.041982 
+330672.823474  7391582.798256 
+330735.577290  7391647.837115 
+330804.053989  7391714.025778 
+330840.279680  7391748.169929 
+330879.259612  7391793.582150 
+330950.474060  7391859.860797 
+330984.069204  7391894.364887 
+331016.509875  7391928.729001 
+331075.998183  7391991.998163 
+331142.306124  7392053.467634 
+331175.521941  7392089.601445 
+331228.330802  7392143.752169 
+331268.399237  7392184.845130 
+331356.386518  7392080.083075 
+331372.780024  7392078.383366 
+331457.023516  7392028.971830 
+331476.921671  7392021.553101 
+331503.029237  7392006.015762 
+331513.609151  7392000.046785 
+331547.410451  7391976.780770 
+331571.753323  7391955.614396 
+331580.213956  7391937.117564 
+331567.753902  7391862.920273 
+331566.418012  7391788.333049 
+331562.459821  7391723.314187 
+331560.373525  7391612.173224 
+331552.712777  7391549.134022 
+331529.359452  7391440.092700 
+331530.579894  7391396.140229 
+331532.938316  7391370.984537 
+331538.380828  7391348.338417 
+331546.602320  7391322.142904 
+331564.241007  7391298.396971 
+331618.971240  7391230.768555 
+331663.690549  7391190.525448 
+331671.474991  7391181.546986 
+331706.711134  7391153.281828 
+331723.253073  7391033.212395 
+331796.190983  7390927.970422 
+331796.182737  7390927.970422 
+331839.458955  7390873.599735 
+331877.581279  7390814.959779 
+331878.562581  7390809.360739 
+331879.543882  7390803.001828 
+331883.601028  7390765.178307 
+331883.601028  7390765.138313 
+331888.837384  7390642.429332 
+331872.179998  7390625.002317 
+331824.459062  7390497.804105 
+331824.607494  7390483.056631 
+331847.127950  7390357.198190 
+331728.703831  7390216.982208 
+331712.623682  7390192.006486 
+331686.120296  7390140.935234 
+331683.753628  7390117.869185 
+331690.259904  7390088.884150 
+331696.757934  7390068.057717 
+331725.850636  7390000.039368 
+331798.821531  7389936.790202 
+331619.870079  7389999.569448 
+331573.757157  7390028.264533 
+331581.788986  7390000.029370 
+331590.562976  7389974.213792 
+331596.401307  7389945.818655 
+331600.343005  7389909.554867 
+331608.127447  7389827.828866 
+331608.127447  7389775.287866 
+331601.621171  7389634.431993 
+331591.973081  7389489.226866 
+331578.226614  7389343.421841 
+331578.127660  7389255.396918 
+331576.395951  7389246.048520 
+331565.123354  7389145.125807 
+331560.076661  7389059.460481 
+331547.740300  7388943.680313 
+331545.851913  7388925.883361 
+331541.926707  7388871.402693 
+331540.986637  7388852.895863 
+331538.438552  7388785.307441 
+331532.732160  7388713.909670 
+331520.626693  7388586.401511 
+331521.179191  7388538.669687 
+331517.476633  7388496.326940 
+331513.642136  7388457.623570 
+331510.797186  7388430.008300 
+331498.073253  7388382.796387 
+331463.323637  7388306.159514 
+331455.530949  7388292.701819 
+331443.376005  7388275.174822 
+331405.228942  7388230.022556 
+331323.137716  7388135.448755 
+331245.985982  7388045.284200 
+331219.391888  7388014.299507 
+331175.282800  7387955.529574 
+331101.470790  7387869.504309 
+331026.273412  7387779.479730 
+330950.853387  7387691.874736 
+Region 1
+153
+337781.107277  7391268.692059 
+337798.399623  7391265.962527 
+337819.782099  7391265.722568 
+337833.281178  7391265.822551 
+337862.093508  7391269.311953 
+337869.498623  7391271.001664 
+337886.353919  7391275.130956 
+337913.698420  7391284.479355 
+337933.167770  7391295.177523 
+337948.546990  7391305.165812 
+337968.321451  7391320.183239 
+337985.556073  7391335.990532 
+338007.746680  7391362.915920 
+338038.653553  7391418.696365 
+338082.746148  7391495.333238 
+338162.973726  7391634.719362 
+338198.754121  7391692.359489 
+338219.509883  7391732.442623 
+338230.172259  7391750.289566 
+338242.368434  7391771.745891 
+338248.858218  7391782.853988 
+338255.611881  7391794.961914 
+338265.573327  7391813.228785 
+338268.179136  7391826.566500 
+338272.632101  7391838.464462 
+338280.061955  7391857.291238 
+338284.696336  7391876.407963 
+338288.835944  7391901.013748 
+338289.132808  7391927.169268 
+338289.561612  7391943.666442 
+338286.287859  7391970.381866 
+338283.080075  7392002.116430 
+338318.233756  7392011.954745 
+338393.637289  7392050.198194 
+338450.701205  7392073.724165 
+338487.108314  7392093.220825 
+338586.755765  7392144.961962 
+338636.868109  7392167.808049 
+338611.337778  7392195.423319 
+338590.631493  7392219.939119 
+338588.446242  7392233.416811 
+338591.406639  7392251.953635 
+338608.542306  7392270.010542 
+338625.686220  7392297.625812 
+338645.774038  7392319.961986 
+338647.472761  7392340.268508 
+338651.101103  7392378.112026 
+338650.721776  7392394.879154 
+338648.429324  7392425.653882 
+338642.970319  7392475.225391 
+338640.636636  7392502.430731 
+338638.302953  7392527.856376 
+338630.328848  7392550.272536 
+338614.157989  7392569.429255 
+338596.461578  7392587.576146 
+338571.887811  7392607.052810 
+338549.342616  7392625.749608 
+338527.531336  7392640.367104 
+338509.002056  7392650.145429 
+338454.939768  7392650.485371 
+338366.498944  7392656.654314 
+338266.851493  7392663.903072 
+338213.061331  7392665.772752 
+338185.807538  7392671.281808 
+338172.918680  7392684.829488 
+338059.780395  7392788.461736 
+338033.169809  7392808.448313 
+337956.562326  7392880.925898 
+337952.950477  7392884.175342 
+337924.591690  7392908.251218 
+337872.277603  7392965.751368 
+337794.969191  7393053.906268 
+337870.941714  7393206.140192 
+337913.327339  7393305.983090 
+337963.357220  7393405.266083 
+338013.337624  7393505.148974 
+338032.147277  7393552.460870 
+338055.014074  7393603.382148 
+338068.744048  7393629.967594 
+338096.740001  7393684.928180 
+338118.048261  7393733.839802 
+338133.946994  7393769.363717 
+338145.565933  7393793.629560 
+338164.425062  7393824.564261 
+338173.025881  7393846.050581 
+338195.068055  7393889.113205 
+338228.861109  7393967.659750 
+338244.372268  7393992.205546 
+338255.941730  7394018.121107 
+338291.515969  7394089.498881 
+338299.762200  7394106.375990 
+338341.290217  7394195.380744 
+338375.371889  7394264.068978 
+338333.967564  7394304.512051 
+338279.212593  7394351.314034 
+338217.926607  7394405.674722 
+338169.257353  7394451.756829 
+338115.640362  7394499.328680 
+338061.644044  7394546.900532 
+338025.616262  7394580.524772 
+337995.360842  7394607.700117 
+337958.211573  7394639.784622 
+337904.611073  7394684.296997 
+337848.759353  7394747.916100 
+337815.568275  7394785.729623 
+337759.139318  7394852.738145 
+337698.108965  7394922.766149 
+337663.573752  7394962.509342 
+337605.990323  7395029.127931 
+337506.590259  7395143.058415 
+337475.097904  7395180.921930 
+337376.464739  7395297.102029 
+337327.836717  7395353.772322 
+337262.378138  7395428.069596 
+337206.922237  7395491.548722 
+337132.285603  7395575.474346 
+336984.925462  7395475.271510 
+336808.687020  7395371.189339 
+336685.513073  7395293.952569 
+336572.729377  7395262.567944 
+336276.516526  7395188.630609 
+336216.475720  7395186.211024 
+336182.369310  7395177.112582 
+335857.632747  7395110.094062 
+335656.894755  7395017.779874 
+335587.263583  7395004.422162 
+335344.659478  7394957.800148 
+335168.849840  7394911.948002 
+335228.503073  7394820.743625 
+335289.929245  7394724.460117 
+335280.042014  7394715.811599 
+335500.150403  7394362.392136 
+335608.637813  7394186.182320 
+336313.838965  7392782.352783 
+336383.791740  7392813.077520 
+336673.597270  7392212.990309 
+336820.619316  7391918.950676 
+336900.426336  7391738.321616 
+336999.084240  7391512.680266 
+337127.222418  7391202.363421 
+337197.422579  7391194.214817 
+337243.238637  7391190.465459 
+337454.812176  7391172.668507 
+337651.880596  7391163.470083 
+337661.050405  7391163.620057 
+337663.417073  7391164.229953 
+337670.500585  7391166.049641 
+337755.280083  7391164.089977 
+337722.056019  7391295.257509 
+337734.969616  7391287.748795 
+337757.003545  7391275.820838 
+337767.138162  7391272.401424 
+337781.107277  7391268.692059 
+Region 1
+188
+324062.075998  7390490.355381 
+324117.342236  7390513.591401 
+324227.858219  7390559.063612 
+324334.053177  7390604.775782 
+324379.390953  7390628.291754 
+324440.998542  7390650.747907 
+324472.581606  7390663.375744 
+324555.043912  7390684.282163 
+324604.001784  7390689.501269 
+324674.630749  7390703.828815 
+324730.647394  7390727.324791 
+324759.443231  7390743.262061 
+324826.740720  7390794.393302 
+324856.270472  7390805.751357 
+324934.692125  7390836.296125 
+324976.459283  7390855.002920 
+325023.569999  7390879.608706 
+325052.877103  7390894.176210 
+325078.588850  7390903.014696 
+325162.387046  7390943.447771 
+325182.771728  7390957.115429 
+325256.682693  7391003.107551 
+325320.937322  7391062.417392 
+325437.811149  7391267.512261 
+325452.110113  7391284.489353 
+325473.632775  7391300.336639 
+325530.078224  7391341.749545 
+325622.386530  7391411.807545 
+325673.076110  7391447.831374 
+325707.380429  7391507.831097 
+325768.270596  7391657.715423 
+325833.217909  7391818.697848 
+325857.791676  7391863.610155 
+325910.518075  7391963.663017 
+325976.306503  7391999.996793 
+326040.256022  7392044.599153 
+326071.138155  7392074.154091 
+326121.621579  7392074.324062 
+326211.192137  7392088.081705 
+326277.293922  7392098.559910 
+326316.323331  7392102.299270 
+326424.423169  7392114.857119 
+326651.664547  7391907.422650 
+326759.541736  7391794.821938 
+326860.442614  7391683.840948 
+327092.664715  7391254.324520 
+327328.061615  7390841.665205 
+327345.634333  7390811.380393 
+327372.566522  7390717.226520 
+327377.555492  7390662.395912 
+327395.078732  7390570.111720 
+327403.588842  7390517.900663 
+327406.870842  7390496.824273 
+327404.850515  7390434.334977 
+327394.386049  7390396.111524 
+327376.128894  7390317.035069 
+327326.197967  7390145.214501 
+327270.643111  7389992.270699 
+327244.354128  7389902.246119 
+327212.903004  7389782.366653 
+327186.704730  7389699.290883 
+327144.277873  7389577.651719 
+327122.384131  7389496.095689 
+327107.623378  7389441.205091 
+327007.431675  7389127.458833 
+326938.171584  7388890.539415 
+326844.172801  7388598.099508 
+326817.735386  7388511.764296 
+326765.190404  7388338.873911 
+326728.527663  7388202.547262 
+326705.322769  7388085.307344 
+326682.670374  7387922.005316 
+326633.341422  7387701.123151 
+326617.929217  7387624.406292 
+326584.243365  7387461.304230 
+326538.542755  7387161.385604 
+326512.962947  7387026.518705 
+326481.528316  7387032.777633 
+326401.952190  7387046.335311 
+326390.176573  7387049.974687 
+326310.542723  7387062.332571 
+326235.411316  7387071.391019 
+326155.010567  7387087.268299 
+326117.036675  7387087.368282 
+326041.146614  7387092.547395 
+325963.376413  7387100.136095 
+325835.089803  7387112.014061 
+325757.336094  7387115.973382 
+325703.752088  7387125.411766 
+325629.651459  7387134.710173 
+325534.992977  7387147.537976 
+325409.666764  7387155.786563 
+325319.403523  7387180.682298 
+325286.888636  7387223.424977 
+325252.526593  7387271.306775 
+325210.190445  7387338.915194 
+325195.693571  7387356.132245 
+325181.609009  7387381.217948 
+325173.123638  7387399.614797 
+325165.965910  7387417.691701 
+325155.691106  7387457.444891 
+325144.253584  7387500.617496 
+325108.811285  7387483.740387 
+325082.208945  7387475.031879 
+325064.108469  7387473.022223 
+325042.602299  7387479.691081 
+325033.292305  7387486.429926 
+324986.643378  7387526.703028 
+324898.639605  7387604.879637 
+324813.150931  7387695.954037 
+324783.736627  7387717.190399 
+324767.631738  7387727.578620 
+324742.381780  7387739.126642 
+324708.992792  7387750.804641 
+324678.069427  7387757.873431 
+324644.779394  7387760.163038 
+324616.519562  7387759.333181 
+324583.922212  7387757.043573 
+324557.542520  7387746.535373 
+324516.740171  7387725.878911 
+324455.041873  7387687.525481 
+324410.850323  7387676.807317 
+324362.684090  7387672.218103 
+324319.729474  7387674.917640 
+324226.992365  7387682.176397 
+324142.649918  7387689.815088 
+323934.168714  7387709.631694 
+323727.130602  7387729.138353 
+323789.076286  7387832.960569 
+323851.747639  7387938.522487 
+323889.441159  7388000.001956 
+323911.887399  7388042.034756 
+323924.570102  7388067.140456 
+323946.406121  7388106.273753 
+323967.640165  7388153.025745 
+323975.070018  7388183.310557 
+323979.580707  7388206.286622 
+323984.577922  7388256.897952 
+323989.204058  7388297.161056 
+323999.957142  7388360.750163 
+324000.781766  7388368.738795 
+324002.620675  7388431.478048 
+324007.741584  7388477.370187 
+324009.481539  7388510.394531 
+324009.110458  7388541.409218 
+324004.137981  7388572.803840 
+324002.299072  7388589.840922 
+323999.998374  7388600.319127 
+323992.906615  7388612.277079 
+323989.979203  7388620.055747 
+323987.126008  7388654.889780 
+323986.763173  7388677.915836 
+323988.808239  7388705.261152 
+324010.891644  7388749.303608 
+324026.081201  7388763.101244 
+324034.360417  7388773.669434 
+324099.217021  7388830.589684 
+324228.369485  7388940.110924 
+324317.453515  7389019.857264 
+324419.129539  7389110.401755 
+324497.691378  7389175.600587 
+324544.043441  7389206.235339 
+324506.333428  7389206.895226 
+324496.660599  7389224.092281 
+324498.103690  7389238.299847 
+324502.630870  7389253.997158 
+324522.792904  7389258.336415 
+324489.370931  7389478.298737 
+324470.833405  7389604.827064 
+324468.268827  7389624.423708 
+324458.191933  7389653.008811 
+324440.907834  7389675.584944 
+324430.377397  7389688.912661 
+324419.343941  7389702.010418 
+324405.778891  7389717.417778 
+324388.478299  7389754.021509 
+324383.489330  7389767.489202 
+324366.510341  7389831.678207 
+324359.723693  7389871.741344 
+324326.977911  7389999.999375 
+324327.299514  7390003.518772 
+324321.518907  7390025.105074 
+324313.487078  7390058.119419 
+324307.203450  7390079.445766 
+324291.791245  7390110.190500 
+324257.124091  7390165.591010 
+324170.340760  7390305.107113 
+324062.075998  7390490.355381 
+Region 1
+65
+336038.802435  7397323.244969 
+336046.026133  7397286.361287 
+336088.180864  7397241.199023 
+336000.003920  7397141.376122 
+335983.371272  7397124.139074 
+335961.964058  7397100.653097 
+335895.689102  7397028.375478 
+335841.511366  7396969.895495 
+335788.347918  7396911.155556 
+335708.483174  7396822.300776 
+335608.951170  7396714.019324 
+335504.867247  7396602.918355 
+335403.067529  7396491.327469 
+335317.249007  7396569.614059 
+335272.397758  7396520.072545 
+335176.411634  7396413.840742 
+335107.877211  7396336.993905 
+335045.651154  7396268.285674 
+334979.969927  7396274.794559 
+334874.756270  7396281.063485 
+334756.373383  7396289.032120 
+334605.500347  7396302.929740 
+334507.873223  7396312.538094 
+334411.252138  7396323.436227 
+334306.178667  7396351.301454 
+334205.417975  7396378.426808 
+334184.876614  7396381.876217 
+334113.934292  7396408.831600 
+334118.865538  7396494.736885 
+334104.838700  7396536.829675 
+334057.480597  7396642.061650 
+334029.426921  7396691.163239 
+334056.185939  7396718.558546 
+334073.725672  7396874.941759 
+334074.154476  7396897.007980 
+334077.147857  7397051.241561 
+334079.011505  7397178.539756 
+334080.767953  7397276.622955 
+334080.743214  7397329.973817 
+334082.491415  7397382.074892 
+334084.058199  7397468.200140 
+334085.303379  7397567.043209 
+334088.750304  7397633.881760 
+334091.413836  7397801.832991 
+334095.207102  7397991.890436 
+334098.390147  7398060.788635 
+334304.290280  7398055.099609 
+334441.524051  7398082.554906 
+334606.209523  7398132.456359 
+334733.465354  7398142.434649 
+334783.082924  7398135.865775 
+334848.244639  7398117.488922 
+334992.965987  7398055.099609 
+335127.709395  7397964.025209 
+335354.777603  7397761.919828 
+335499.498950  7397689.552224 
+335611.779627  7397659.617352 
+335763.988552  7397654.628206 
+335901.040906  7397676.464466 
+335944.655219  7397680.753731 
+335969.196002  7397597.128055 
+335989.118895  7397520.771135 
+336000.003920  7397482.547682 
+336009.132497  7397449.823287 
+336038.802435  7397323.244969 
+Region 1
+763
+348625.263412  7390704.878635 
+348657.308264  7390703.318903 
+348670.098168  7390690.301132 
+348686.433951  7390682.262509 
+348708.443140  7390667.345065 
+348721.703079  7390653.607418 
+348756.188816  7390604.435840 
+348788.629487  7390555.384242 
+348828.598967  7390503.513127 
+348834.123942  7390491.945109 
+348840.358092  7390481.266938 
+348852.216172  7390467.849236 
+348858.639985  7390460.410511 
+348875.470542  7390441.533744 
+348889.505627  7390427.176203 
+348896.094365  7390421.707140 
+348902.452209  7390418.667661 
+348912.792982  7390415.118269 
+348928.765931  7390410.079132 
+348949.727849  7390406.639721 
+348964.744235  7390405.359940 
+348995.436705  7390408.219450 
+349006.931951  7390411.668860 
+349014.460760  7390414.508373 
+349022.072030  7390418.357714 
+349029.609085  7390420.207397 
+349033.789924  7390420.247390 
+349040.634296  7390419.877453 
+349048.212582  7390417.407876 
+349054.595164  7390412.378738 
+349065.925485  7390402.420444 
+349081.098549  7390386.073244 
+349085.122710  7390381.683996 
+349088.709820  7390380.284235 
+349091.257906  7390380.314230 
+349094.003900  7390381.444037 
+349097.055006  7390382.473860 
+349101.532709  7390383.963605 
+349104.072548  7390385.093412 
+349106.694849  7390387.662972 
+349113.671161  7390394.271839 
+349117.109839  7390397.081358 
+349120.367100  7390398.551106 
+349125.570471  7390398.161173 
+349132.629245  7390397.241331 
+349142.953526  7390395.571617 
+349154.729143  7390391.932240 
+349162.703248  7390390.572473 
+349170.454705  7390390.872422 
+349182.890021  7390392.442153 
+349190.657970  7390391.852254 
+349193.939970  7390390.012569 
+349196.009774  7390387.263040 
+349196.760181  7390383.503684 
+349197.848683  7390377.204763 
+349197.230216  7390367.896357 
+349195.432537  7390354.358676 
+349197.551819  7390336.661708 
+349200.380276  7390329.382954 
+349205.855773  7390323.134025 
+349212.230109  7390318.544811 
+349221.457641  7390314.765458 
+349234.165083  7390310.136251 
+349256.776247  7390304.607198 
+349273.458372  7390300.347928 
+349285.613316  7390298.818190 
+349294.799617  7390299.348099 
+349302.336671  7390300.427914 
+349310.690103  7390302.067633 
+349317.320073  7390302.907489 
+349322.424489  7390302.187613 
+349328.370022  7390299.918001 
+349335.915323  7390290.699580 
+349344.326478  7390276.831956 
+349350.535890  7390268.693350 
+349353.512779  7390266.623704 
+349359.862376  7390265.023978 
+349365.073994  7390263.974158 
+349369.799084  7390260.924681 
+349373.460411  7390252.656097 
+349378.886431  7390241.188061 
+349383.463089  7390232.599532 
+349390.348691  7390227.800355 
+349398.339289  7390225.330778 
+349406.082499  7390226.410593 
+349414.741041  7390228.270274 
+349426.863000  7390230.499892 
+349438.894251  7390231.839663 
+349448.666034  7390234.269246 
+349451.477999  7390238.508520 
+349452.558255  7390242.727798 
+349452.112959  7390246.377173 
+349450.851285  7390250.346493 
+349449.185547  7390253.106020 
+349443.949190  7390256.365462 
+349431.233503  7390262.104479 
+349425.164277  7390266.253768 
+349422.451267  7390272.432709 
+349421.684368  7390277.851781 
+349423.729433  7390287.390147 
+349428.339076  7390295.638734 
+349435.092739  7390303.567376 
+349441.384613  7390307.176758 
+349447.181713  7390308.896464 
+349452.591240  7390308.956453 
+349460.878702  7390307.376724 
+349474.913786  7390302.207609 
+349486.112168  7390294.568918 
+349499.578262  7390285.400488 
+349509.457247  7390277.751798 
+349514.940990  7390270.393059 
+349518.297206  7390262.004496 
+349519.789774  7390255.495611 
+349518.445638  7390247.396998 
+349515.963523  7390240.278217 
+349511.757945  7390232.819495 
+349507.873970  7390223.031171 
+349506.628790  7390215.712425 
+349506.735991  7390204.964266 
+349508.459453  7390196.345742 
+349510.372578  7390188.947010 
+349510.636458  7390182.858053 
+349509.968513  7390178.868736 
+349506.735991  7390175.179368 
+349502.579890  7390172.809774 
+349495.380931  7390168.300546 
+349485.543178  7390161.891644 
+349482.327148  7390157.202447 
+349482.360133  7390153.443091 
+349483.316695  7390149.903698 
+349486.227615  7390145.284489 
+349490.639348  7390142.564955 
+349495.859212  7390141.505136 
+349500.749227  7390142.444975 
+349504.996036  7390146.474285 
+349510.553995  7390151.623403 
+349515.386286  7390158.212274 
+349518.923919  7390161.571699 
+349522.585246  7390162.491541 
+349525.240532  7390162.521536 
+349529.437864  7390161.121776 
+349534.665974  7390158.852165 
+349551.125450  7390146.174336 
+349562.529987  7390139.095549 
+349568.896077  7390135.726126 
+349571.056590  7390133.316539 
+349571.089574  7390130.766975 
+349568.962047  7390128.857303 
+349565.407922  7390126.827650 
+349560.542646  7390123.898152 
+349555.693862  7390119.418919 
+349550.375043  7390110.510445 
+349549.731837  7390103.301680 
+349550.713139  7390097.442684 
+349553.607566  7390093.483362 
+349556.691656  7390091.193754 
+349563.049500  7390088.714179 
+349571.732780  7390088.134278 
+349582.032323  7390088.684184 
+349597.188894  7390093.493360 
+349616.204702  7390100.442170 
+349624.854998  7390103.191699 
+349637.282068  7390105.091373 
+349648.496942  7390106.201183 
+349659.299504  7390107.640937 
+349670.497885  7390110.860385 
+349681.267462  7390115.619570 
+349695.863290  7390125.517875 
+349701.924270  7390131.666821 
+349703.309637  7390135.676135 
+349706.303018  7390142.674936 
+349709.106737  7390147.364133 
+349712.347505  7390150.493596 
+349719.760867  7390153.343108 
+349738.075745  7390158.842166 
+349753.042654  7390162.541533 
+349758.856246  7390163.481372 
+349766.805613  7390164.561187 
+349776.198069  7390164.221245 
+349785.598772  7390163.101437 
+349797.168234  7390159.672024 
+349825.147694  7390148.333966 
+349834.870000  7390145.884386 
+349841.392769  7390146.614261 
+349848.402065  7390149.783718 
+349851.816004  7390154.922838 
+349853.869316  7390163.581355 
+349854.339351  7390167.790634 
+349855.955612  7390169.690308 
+349861.571295  7390169.190394 
+349867.714737  7390167.710647 
+349877.321596  7390166.360879 
+349896.650760  7390162.351565 
+349910.702337  7390155.962660 
+349924.465296  7390147.244153 
+349952.411772  7390139.335508 
+349984.613303  7390133.686475 
+350008.634573  7390130.836963 
+350036.292430  7390130.457029 
+350065.170730  7390131.196902 
+350075.503257  7390129.197244 
+350084.928699  7390125.637854 
+350091.682361  7390123.608202 
+350099.483296  7390119.698871 
+350106.863672  7390116.449428 
+350125.368214  7390112.990021 
+350136.426409  7390110.000533 
+350142.380187  7390106.071206 
+350151.846860  7390098.752459 
+350162.657669  7390089.564033 
+350171.909939  7390082.895175 
+350182.052803  7390079.455765 
+350193.061521  7390081.015497 
+350202.198345  7390085.534723 
+350208.861299  7390092.363554 
+350216.332384  7390101.072062 
+350220.455499  7390106.651106 
+350225.815549  7390111.140337 
+350235.875951  7390115.669562 
+350244.534493  7390117.419262 
+350252.698261  7390117.499248 
+350260.268301  7390115.479594 
+350268.976320  7390112.580091 
+350279.853099  7390107.041040 
+350289.509435  7390100.822105 
+350306.241037  7390091.473706 
+350325.669156  7390077.946023 
+350332.975316  7390071.927054 
+350337.535482  7390065.218203 
+350338.541522  7390057.029606 
+350340.083567  7390045.861519 
+350341.807029  7390037.242995 
+350343.299597  7390031.164037 
+350344.017019  7390020.765818 
+350345.550818  7390010.037655 
+350347.043386  7390003.958697 
+350352.568360  7389993.270527 
+350358.027365  7389987.791466 
+350364.607857  7389983.212250 
+350367.502284  7389979.912815 
+350368.467093  7389975.493572 
+350367.988812  7389971.724218 
+350364.137822  7389959.396330 
+350359.247807  7389938.299943 
+350356.444089  7389913.354216 
+350354.596933  7389884.659132 
+350355.281370  7389867.832014 
+350357.441883  7389855.784078 
+350360.196124  7389846.175723 
+350365.185093  7389836.927308 
+350370.470927  7389829.118645 
+350377.241083  7389826.079166 
+350390.938072  7389824.339464 
+350406.127628  7389825.489267 
+350421.102783  7389828.858690 
+350430.651918  7389832.498066 
+350436.729390  7389836.987297 
+350443.887119  7389845.705804 
+350446.913485  7389849.715117 
+350448.109189  7389852.274679 
+350451.358204  7389853.644444 
+350458.590148  7389855.594110 
+350469.384464  7389857.373805 
+350477.325584  7389859.553432 
+350486.149051  7389865.182468 
+350496.893889  7389872.601197 
+350503.655798  7389879.649990 
+350510.805280  7389889.468308 
+350515.225260  7389895.827219 
+350519.158712  7389900.516415 
+350521.492395  7389901.976165 
+350524.559993  7389901.786198 
+350525.483571  7389901.136309 
+350527.635837  7389899.936515 
+350532.781485  7389896.227150 
+350536.780907  7389893.717580 
+350539.658841  7389892.087859 
+350542.215173  7389891.887893 
+350547.113434  7389891.937885 
+350553.025981  7389892.007873 
+350555.788469  7389891.367982 
+350557.239805  7389889.498303 
+350557.792303  7389885.738947 
+350557.833534  7389881.089743 
+350557.874765  7389877.100426 
+350558.839574  7389873.011127 
+350560.694976  7389871.371408 
+350563.762574  7389870.411572 
+350568.446433  7389871.891319 
+350577.096728  7389874.310904 
+350584.592552  7389879.809962 
+350589.936110  7389886.068890 
+350594.809632  7389888.778426 
+350599.674908  7389891.597943 
+350606.296631  7389892.767743 
+350613.330666  7389893.837559 
+350619.333922  7389895.787225 
+350625.436133  7389897.396950 
+350632.247519  7389900.566407 
+350646.241372  7389908.794997 
+350657.604678  7389915.773802 
+350672.332446  7389922.902581 
+350679.135587  7389925.962057 
+350691.537917  7389931.181163 
+350701.804475  7389934.830538 
+350716.062207  7389937.750038 
+350729.157222  7389944.858820 
+350736.158271  7389949.138087 
+350742.219251  7389954.847109 
+350746.185688  7389956.766780 
+350754.794753  7389962.945722 
+350760.369205  7389966.665085 
+350769.423566  7389969.524595 
+350778.395465  7389970.384448 
+350785.858304  7389969.464605 
+350797.617428  7389967.045020 
+350813.202804  7389960.446150 
+350836.811763  7389947.178423 
+350844.109677  7389941.939320 
+350851.217928  7389935.690390 
+350855.951264  7389931.311140 
+350859.991917  7389925.932062 
+350860.931987  7389923.832422 
+350861.253590  7389922.282687 
+350859.645575  7389919.613144 
+350855.695631  7389916.803625 
+350848.364732  7389914.843961 
+350825.217562  7389913.284228 
+350809.203383  7389911.894466 
+350797.287579  7389909.454884 
+350791.696635  7389907.285256 
+350789.923695  7389900.956340 
+350791.102906  7389895.657248 
+350792.991293  7389890.248174 
+350797.139147  7389883.759286 
+350800.190252  7389875.480704 
+350801.715805  7389865.422427 
+350802.350765  7389853.794418 
+350803.340313  7389846.275706 
+350805.039036  7389840.316727 
+350808.337528  7389836.807328 
+350812.633814  7389835.627530 
+350818.051588  7389835.247595 
+350826.908040  7389836.997296 
+350833.199914  7389841.046602 
+350841.833717  7389844.565999 
+350849.379018  7389845.635816 
+350855.192611  7389845.695806 
+350862.259630  7389843.226229 
+350871.899474  7389838.896970 
+350880.945589  7389832.448075 
+350888.062086  7389824.999351 
+350892.836654  7389817.840577 
+350894.222020  7389811.991579 
+350894.065342  7389807.112415 
+350891.335840  7389795.014487 
+350889.035141  7389789.785383 
+350889.101111  7389783.256501 
+350890.585433  7389777.957409 
+350891.550242  7389773.538166 
+350894.642578  7389770.468691 
+350898.229689  7389769.168914 
+350905.379171  7389768.908958 
+350917.517622  7389769.038936 
+350926.002993  7389767.909130 
+350931.429013  7389766.519368 
+350936.558169  7389764.029794 
+350939.155731  7389759.400587 
+350939.724721  7389753.091668 
+350936.995219  7389740.773778 
+350936.657123  7389734.014936 
+350934.579073  7389727.456059 
+350932.764903  7389725.116460 
+350929.004621  7389724.076638 
+350925.236094  7389723.376758 
+350919.834813  7389722.546900 
+350916.800200  7389719.747379 
+350915.051999  7389711.088863 
+350916.396135  7389699.260889 
+350918.111351  7389690.852329 
+350922.927149  7389679.274312 
+350926.992541  7389670.685783 
+350930.291033  7389667.616309 
+350933.779189  7389665.876607 
+350945.546560  7389662.677155 
+350951.178736  7389661.067431 
+350957.149007  7389656.038292 
+350963.267710  7389646.799875 
+350969.336935  7389632.132387 
+350973.633222  7389621.214257 
+350975.348438  7389612.595734 
+350975.719518  7389606.286814 
+350973.163186  7389596.958412 
+350970.689317  7389589.069763 
+350971.703604  7389579.881337 
+350971.761327  7389574.122324 
+350974.482583  7389568.063362 
+350979.850880  7389561.584471 
+350981.821729  7389559.054905 
+350984.427538  7389553.435867 
+350989.705125  7389546.067129 
+350996.780391  7389542.597724 
+351004.243230  7389541.567900 
+351014.757174  7389541.447921 
+351025.584475  7389540.568071 
+351034.482158  7389538.778378 
+351046.554639  7389535.688907 
+351065.809588  7389528.910068 
+351075.416446  7389528.010222 
+351082.623652  7389532.069527 
+351087.563144  7389537.768551 
+351090.581265  7389542.007825 
+351098.200782  7389545.517223 
+351106.133656  7389547.916812 
+351112.738886  7389551.316230 
+351118.519494  7389555.025595 
+351122.964212  7389559.274867 
+351124.547489  7389564.274011 
+351125.001031  7389569.373137 
+351122.725072  7389582.200940 
+351121.702539  7389586.310236 
+351119.756429  7389593.578991 
+351118.783373  7389599.108044 
+351118.907067  7389606.416792 
+351121.479891  7389614.525403 
+351125.767931  7389624.203745 
+351133.041106  7389632.142385 
+351140.198834  7389640.191007 
+351156.188276  7389653.858666 
+351174.395953  7389670.105883 
+351193.890042  7389689.462567 
+351208.024082  7389704.559981 
+351219.626528  7389717.737724 
+351248.999602  7389750.492113 
+351262.919239  7389766.249414 
+351273.837248  7389776.767612 
+351292.234589  7389793.784698 
+351310.326819  7389811.691630 
+351317.459808  7389822.729739 
+351332.088622  7389838.936963 
+351348.069817  7389853.604451 
+351358.798163  7389862.572915 
+351367.176333  7389871.071459 
+351380.395041  7389886.158875 
+351386.357065  7389891.977878 
+351395.287733  7389896.717066 
+351401.563115  7389902.546068 
+351407.846743  7389906.485393 
+351413.198546  7389912.294398 
+351418.063822  7389915.673819 
+351427.225385  7389918.083406 
+351440.773942  7389920.113059 
+351456.870584  7389923.042557 
+351467.161880  7389925.032216 
+351473.791849  7389925.092206 
+351481.559798  7389923.732439 
+351491.389305  7389921.062896 
+351511.642048  7389916.623656 
+351521.257153  7389914.614001 
+351529.008609  7389914.913949 
+351534.294443  7389916.853617 
+351542.515935  7389921.802769 
+351565.242547  7389944.848822 
+351572.928034  7389952.237556 
+351584.522234  7389965.865222 
+351598.491349  7389977.413244 
+351611.470916  7389985.961779 
+351617.053614  7389988.571332 
+351622.446649  7389990.281039 
+351627.138754  7389990.331031 
+351634.708794  7389988.751301 
+351651.382672  7389984.931956 
+351665.698129  7389982.532367 
+351679.263178  7389983.332230 
+351687.212544  7389984.412045 
+351693.314755  7389986.571675 
+351700.835317  7389989.861111 
+351705.906749  7389992.790610 
+351709.650538  7389995.600128 
+351713.113955  7389996.519971 
+351718.836839  7389996.140036 
+351723.941256  7389995.750103 
+351726.299678  7389994.330346 
+351728.880748  7389992.030740 
+351732.500843  7389986.971606 
+351738.916411  7389978.403074 
+351745.472164  7389975.693538 
+351753.454515  7389973.893846 
+351759.383555  7389973.183968 
+351764.487972  7389973.233959 
+351773.130022  7389975.753528 
+351778.729212  7389977.583214 
+351785.705523  7389984.192082 
+351792.978699  7389991.570819 
+351799.641653  7389998.399649 
+351805.727371  7390002.668918 
+351815.779526  7390007.418104 
+351827.843762  7390015.626698 
+351837.656776  7390023.695316 
+351842.010786  7390027.504663 
+351850.248771  7390030.364174 
+351862.156328  7390034.023547 
+351869.874799  7390037.532946 
+351885.006633  7390045.221629 
+351895.075280  7390048.531062 
+351902.505134  7390050.710688 
+351910.965767  7390051.690521 
+351925.751258  7390053.050288 
+351928.794117  7390054.520036 
+351930.806198  7390057.539519 
+351933.403760  7390062.658642 
+351936.817700  7390068.777594 
+351940.330594  7390074.136676 
+351944.461956  7390079.825701 
+351948.914920  7390083.185126 
+351953.293669  7390084.344927 
+351959.404126  7390085.844670 
+351966.438160  7390086.574545 
+351973.892753  7390086.434569 
+351983.087300  7390085.084800 
+351991.580918  7390083.065146 
+352001.600088  7390081.615395 
+352010.052474  7390083.035152 
+352014.925997  7390085.854669 
+352019.585117  7390089.444054 
+352025.637850  7390096.042923 
+352028.878619  7390098.622482 
+352033.150166  7390099.882266 
+352039.672935  7390101.052065 
+352050.871316  7390103.711610 
+352064.716737  7390107.400978 
+352076.649033  7390108.180844 
+352086.429062  7390109.940543 
+352094.658801  7390113.349959 
+352100.447655  7390116.399437 
+352104.686217  7390121.088633 
+352106.467403  7390126.977625 
+352109.980297  7390132.326708 
+352114.350799  7390134.476340 
+352119.760327  7390134.316368 
+352126.093432  7390133.936433 
+352132.640939  7390132.336707 
+352144.202154  7390129.907123 
+352164.141540  7390126.127770 
+352179.834117  7390128.167421 
+352188.105086  7390128.247407 
+352195.155614  7390126.877642 
+352198.858171  7390124.148109 
+352200.334246  7390119.508904 
+352196.705905  7390105.191356 
+352195.452478  7390097.982591 
+352196.846091  7390091.233747 
+352199.039588  7390085.944653 
+352201.224839  7390082.205294 
+352204.721241  7390079.245801 
+352211.309979  7390073.446794 
+352213.280829  7390070.477303 
+352214.765150  7390065.058231 
+352216.909170  7390055.119933 
+352218.583155  7390051.150613 
+352220.949823  7390048.841009 
+352225.254355  7390047.451247 
+352230.152616  7390047.051315 
+352236.477475  7390047.781190 
+352254.025454  7390047.961159 
+352267.722443  7390045.991497 
+352277.774598  7390041.442276 
+352285.789935  7390035.663266 
+352291.529311  7390033.613617 
+352298.052080  7390034.233511 
+352305.778798  7390037.083023 
+352314.396109  7390043.481927 
+352319.945822  7390049.290932 
+352326.946872  7390053.350236 
+352335.811570  7390055.099937 
+352351.726795  7390055.479871 
+352370.693125  7390057.339553 
+352401.880370  7390061.418854 
+352449.708507  7390065.558145 
+352473.729777  7390071.887061 
+352498.031419  7390080.775539 
+352521.599146  7390092.193583 
+352537.003105  7390102.651791 
+352547.954099  7390109.960539 
+352558.418566  7390114.489764 
+352576.725198  7390120.548726 
+352589.317192  7390127.207585 
+352600.499081  7390131.416864 
+352608.951467  7390133.606489 
+352615.680392  7390134.006421 
+352622.524763  7390133.746465 
+352627.950783  7390132.026760 
+352640.699455  7390122.748349 
+352649.333259  7390150.433607 
+352672.983448  7390192.076474 
+352690.968477  7390237.858632 
+352715.063963  7390294.368952 
+352739.703701  7390341.310911 
+352796.553215  7390445.123129 
+352829.348474  7390538.947058 
+352803.669712  7390674.973758 
+352766.042161  7390831.606928 
+352768.070734  7390878.388915 
+352790.451004  7390917.042294 
+352816.896666  7390944.497591 
+352849.436292  7390975.012364 
+352886.808209  7391057.138296 
+352880.046300  7391191.995197 
+352887.583355  7391221.150203 
+352831.888313  7391411.077670 
+352804.692244  7391547.624281 
+352775.203724  7391649.326860 
+352760.945991  7391709.336581 
+352739.596500  7391762.227521 
+352531.948166  7392153.540493 
+352478.718747  7392281.288611 
+352447.473779  7392356.295763 
+352318.626425  7392632.968371 
+352303.849180  7392698.447155 
+352312.301566  7392749.128474 
+352350.316689  7392831.504364 
+352377.768391  7392941.325552 
+352409.450409  7393192.652502 
+352420.013831  7393427.092345 
+352439.021392  7393564.368831 
+352449.576568  7393627.727978 
+352455.917919  7393701.655315 
+352413.301399  7393899.621405 
+352417.902796  7393927.646604 
+352420.450881  7394021.210578 
+352421.242519  7394091.828482 
+352416.072133  7394130.981775 
+352299.585878  7394135.081073 
+352140.516089  7394138.940412 
+352091.789112  7394141.210023 
+352001.971168  7394143.659603 
+351880.537176  7394148.018857 
+351823.473260  7394182.432962 
+351779.487865  7394209.928252 
+351686.066318  7394266.578548 
+351588.579380  7394327.158172 
+351493.285938  7394386.538000 
+351395.361949  7394445.477905 
+351302.377453  7394503.767920 
+351203.266006  7394563.817634 
+351105.721344  7394622.767536 
+351014.262400  7394681.097545 
+350994.388984  7394651.342642 
+350913.823311  7394699.274432 
+350898.427598  7394706.903125 
+350801.254016  7394766.242960 
+350770.009048  7394785.279700 
+350759.437381  7394781.610328 
+350748.156537  7394776.021285 
+350722.090202  7394768.172630 
+350700.163475  7394762.333630 
+350684.701792  7394756.644605 
+350674.938255  7394750.695624 
+350664.143939  7394740.557360 
+350681.724903  7394698.404581 
+350685.006903  7394668.829646 
+350658.717919  7394635.965276 
+350639.001182  7394603.100905 
+350619.276198  7394576.805409 
+350606.131707  7394537.372164 
+350599.559461  7394497.928920 
+350563.407986  7394455.206238 
+350523.974511  7394405.914681 
+350530.546756  7394373.050311 
+350530.546756  7394343.465378 
+350491.105035  7394261.309451 
+350454.953560  7394221.866207 
+350405.657593  7394185.712400 
+350392.513102  7394156.137466 
+350379.368610  7394083.839850 
+350369.506118  7394021.390547 
+350362.933872  7393945.803494 
+350323.450920  7393954.512003 
+350252.953894  7393966.969869 
+350144.087157  7393988.036260 
+350129.936625  7393973.598733 
+350092.102919  7393925.996887 
+350035.847134  7393861.028016 
+350035.847134  7393861.008019 
+349930.361351  7393725.271269 
+349904.418710  7393709.853910 
+349788.526184  7393646.024844 
+349712.100119  7393622.288909 
+349676.558864  7393610.480932 
+349640.902163  7393620.389235 
+349543.522425  7393629.737633 
+349544.223355  7393530.244676 
+349547.332184  7393429.751889 
+349548.231023  7393407.275739 
+349547.678526  7393351.705258 
+349545.996295  7393279.367649 
+349545.971556  7393238.614629 
+349548.198038  7393063.314657 
+349535.507089  7392970.090625 
+349521.241110  7392867.098267 
+349518.066311  7392851.250981 
+349498.267112  7392805.298852 
+349477.668027  7392775.983874 
+349461.818772  7392763.306045 
+349441.219688  7392751.418082 
+349407.146263  7392735.580794 
+349382.597234  7392728.442017 
+349303.367450  7392714.184459 
+349165.218348  7392675.981003 
+349103.709714  7392666.642603 
+349051.412119  7392638.127487 
+349016.044036  7392602.833533 
+348878.686572  7392666.642603 
+348786.790578  7392714.184459 
+348741.188922  7392623.859931 
+348657.646360  7392517.698116 
+348558.609129  7392370.333358 
+348521.377398  7392314.862860 
+348510.286218  7392281.578561 
+348496.811877  7392234.846566 
+348491.460073  7392164.818561 
+348486.512335  7392070.054793 
+348482.851008  7391973.241376 
+348481.341948  7391946.995872 
+348479.676210  7391929.138931 
+348470.011627  7391910.752080 
+348456.496055  7391891.315409 
+348442.353770  7391876.098016 
+348425.556198  7391862.090415 
+348393.560823  7391835.564959 
+348361.153137  7391808.279633 
+348345.501791  7391794.252036 
+348313.976451  7391757.798280 
+348295.826497  7391722.884260 
+348285.477478  7391693.839235 
+348271.673288  7391650.796608 
+348270.848665  7391608.923781 
+348263.987801  7391582.058382 
+348257.423801  7391565.481222 
+348246.027511  7391540.275539 
+348235.472335  7391517.339468 
+348221.956763  7391496.293073 
+348210.271854  7391478.096190 
+348196.781021  7391457.089788 
+348152.449285  7391439.292837 
+348127.421975  7391430.094412 
+348103.821263  7391417.796519 
+348086.751566  7391407.228329 
+348068.469672  7391394.030590 
+348043.970121  7391376.063667 
+348002.318410  7391343.469251 
+347914.586762  7391276.450730 
+347907.783622  7391271.701544 
+347898.283964  7391254.294525 
+348044.835975  7390954.235923 
+348142.891904  7390829.807236 
+348203.163604  7390771.377245 
+348238.036913  7390750.780773 
+348260.186289  7390741.292398 
+348320.309556  7390714.397005 
+348368.566498  7390704.898632 
+348441.347730  7390696.989987 
+348625.263412  7390704.878635 
+Region 1
+371
+346663.650065  7397002.509908 
+346583.043161  7397058.800266 
+346487.411624  7397125.588826 
+346441.018330  7397158.073262 
+346369.696682  7397206.344993 
+346323.369358  7397234.600153 
+346297.352500  7397248.917701 
+346272.976642  7397262.855313 
+346245.566172  7397276.782928 
+346217.042460  7397288.410936 
+346173.287960  7397304.518177 
+346145.143575  7397312.726771 
+346113.972823  7397317.875889 
+346090.619498  7397324.224801 
+346064.569655  7397326.884346 
+346034.149310  7397329.993813 
+346008.701443  7397329.653871 
+345985.158454  7397329.333926 
+345965.788058  7397327.324270 
+345941.873989  7397324.144815 
+345903.916590  7397316.696091 
+345889.873259  7397315.856235 
+345752.128222  7397293.090134 
+345663.629675  7397279.592446 
+345579.773755  7397272.023743 
+345466.074727  7397268.564335 
+345370.385467  7397240.309175 
+345309.091234  7397184.348761 
+345281.631286  7397156.473536 
+345130.815974  7397068.498605 
+345013.999871  7397017.267380 
+344861.749714  7396923.823386 
+344839.377691  7396909.745798 
+344760.865329  7396880.800756 
+344574.838611  7396839.177885 
+344332.424169  7396819.001341 
+344237.699718  7396816.201821 
+344099.501138  7396799.834625 
+344081.079059  7396798.284890 
+344064.190779  7396796.955118 
+344042.552669  7396793.795659 
+344009.518269  7396790.946147 
+343977.555879  7396790.336252 
+343879.203087  7396797.055101 
+343791.397223  7396820.211134 
+343715.721564  7396839.557820 
+343674.910969  7396845.776755 
+343602.377124  7396858.284613 
+343575.296502  7396859.494405 
+343550.895906  7396861.134125 
+343524.986249  7396859.324435 
+343504.040823  7396857.194799 
+343477.413745  7396851.565764 
+343369.849912  7396814.232158 
+343335.207497  7396803.933922 
+343279.974244  7396792.585866 
+343205.758168  7396771.759434 
+343095.093753  7396735.055721 
+342987.562905  7396704.640930 
+342948.500511  7396691.743140 
+342822.902172  7396659.348689 
+342649.475695  7396620.115409 
+342571.590047  7396602.818372 
+342332.168986  7396537.609541 
+342174.129976  7396493.967017 
+342122.162230  7396481.249195 
+341969.887335  7396445.495320 
+341950.648879  7396506.364893 
+341935.451076  7396546.158077 
+341913.845952  7396575.233097 
+341880.448717  7396603.788206 
+341816.111626  7396642.631552 
+341808.723003  7396660.198543 
+341816.078641  7396642.671545 
+341744.963148  7396668.397139 
+341652.646596  7396708.240314 
+341530.759061  7396799.784633 
+341419.987444  7397005.619376 
+341385.831557  7397053.271213 
+341238.537385  7397260.875652 
+341261.156796  7397259.645863 
+341238.529139  7397260.905647 
+341194.543745  7397338.842297 
+341167.817711  7397387.274002 
+341150.418164  7397416.389014 
+341128.153342  7397444.334228 
+341071.460506  7397510.272933 
+341056.460613  7397528.399828 
+341034.426684  7397563.933741 
+340958.503639  7397685.492919 
+340931.777605  7397728.135615 
+340976.158818  7397756.260797 
+341015.427369  7397786.855557 
+341050.976869  7397821.989539 
+341089.420796  7397865.392104 
+341113.804900  7397899.696228 
+341167.957897  7398039.822226 
+341184.079278  7398108.030542 
+341189.859886  7398155.562401 
+341192.168830  7398186.007186 
+341187.608665  7398241.597664 
+341182.009474  7398277.091584 
+341165.475782  7398349.009265 
+341125.662980  7398510.671574 
+341114.217212  7398564.362377 
+341107.191423  7398796.252656 
+341111.322785  7398835.935859 
+341124.970297  7398907.033680 
+341134.478201  7398975.241997 
+341148.942089  7399050.469111 
+341168.370209  7399113.708279 
+341182.834097  7399155.461127 
+341191.929690  7399184.806101 
+341210.533186  7399215.810790 
+341226.654567  7399241.846330 
+341258.064459  7399288.558329 
+341277.904890  7399313.774010 
+341295.271452  7399335.680257 
+341302.709552  7399361.305868 
+341301.884929  7399377.843035 
+341298.990502  7399391.890629 
+341297.333010  7399405.538291 
+341304.779356  7399417.106310 
+341328.751148  7399439.012557 
+341364.300649  7399460.098945 
+341392.816114  7399481.595263 
+341425.471188  7399513.009882 
+341459.783753  7399547.314006 
+341482.106300  7399575.009262 
+341500.289238  7399606.833811 
+341508.972519  7399638.668358 
+341511.866946  7399665.533756 
+341515.173685  7399687.030074 
+341522.611785  7399703.557243 
+341533.356623  7399715.135260 
+341550.310873  7399722.573986 
+341564.848978  7399726.383333 
+341635.189326  7399466.237894 
+341641.942988  7399436.522984 
+341647.138114  7399411.967190 
+341657.503626  7399363.895424 
+341661.857635  7399330.811091 
+341680.955906  7399273.460915 
+341679.356137  7399230.608255 
+341704.762774  7399202.033150 
+341724.966039  7399208.132105 
+341746.587655  7399222.979562 
+341764.036679  7399233.257801 
+341780.355970  7399240.116626 
+341800.468526  7399248.495191 
+341827.021389  7399255.743950 
+341881.916546  7399258.973396 
+341887.713647  7399259.963227 
+341967.751561  7399255.064066 
+342046.989592  7399247.865299 
+342072.866263  7399177.477356 
+342093.811689  7399138.354057 
+342106.510884  7399119.307320 
+342128.726230  7399070.895612 
+342138.250626  7399028.042953 
+342173.956805  7398970.112876 
+342190.630683  7398928.050081 
+342200.138587  7398900.304833 
+342188.198045  7398878.498568 
+342186.656000  7398856.632314 
+342189.039161  7398833.616256 
+342177.139850  7398817.748974 
+342169.998614  7398793.143189 
+342169.363654  7398743.261733 
+342170.831483  7398728.284299 
+342169.973875  7398679.362678 
+342279.508557  7398694.730046 
+342327.130539  7398701.078959 
+342366.151703  7398703.788495 
+342395.895856  7398705.008286 
+342419.331644  7398712.507001 
+342444.317723  7398719.375825 
+342468.380224  7398728.444271 
+342492.574665  7398739.952300 
+342521.799306  7398752.500151 
+342541.161456  7398759.678921 
+342562.717102  7398764.678065 
+342584.965433  7398767.987498 
+342613.959180  7398772.106792 
+342673.125885  7398790.763596 
+342733.430569  7398779.655499 
+342768.204924  7398769.087309 
+342793.421897  7398764.678065 
+342862.063521  7398740.742165 
+342862.080014  7398740.742165 
+342935.281803  7398717.186200 
+343015.542366  7398691.340627 
+343063.147856  7398678.512824 
+343095.893637  7398670.854136 
+343119.106777  7398666.524877 
+343144.513413  7398662.995482 
+343178.059080  7398660.265950 
+343202.773033  7398657.716386 
+343276.246948  7398659.726042 
+343324.553367  7398669.794317 
+343367.837832  7398680.862422 
+343425.643909  7398697.749529 
+343506.193089  7398710.787296 
+343566.613221  7398708.417702 
+343600.967018  7398702.488717 
+343640.713850  7398699.619209 
+343640.812805  7398699.719192 
+343696.046058  7398695.239959 
+343715.977197  7398692.660401 
+343776.776656  7398684.621778 
+343900.197990  7398703.428556 
+343924.037843  7398706.408046 
+344000.043350  7398728.764216 
+344017.987148  7398732.753533 
+344040.268464  7398737.702685 
+344058.146292  7398746.641154 
+344128.057835  7398779.385545 
+344193.747308  7398807.740688 
+344241.427014  7398836.045840 
+344287.680122  7398852.972941 
+344305.582688  7398853.902781 
+344349.543344  7398858.022076 
+344406.829908  7398855.422521 
+344469.410553  7398849.453543 
+344507.648324  7398832.396465 
+344539.132433  7398820.058579 
+344634.541321  7398790.923569 
+344652.979893  7398780.615335 
+344675.154007  7398767.177637 
+344699.521619  7398749.370687 
+344711.082834  7398740.002291 
+344715.766693  7398735.623042 
+344724.829301  7398729.694057 
+344734.197019  7398723.445128 
+344743.259626  7398717.196198 
+344758.877987  7398706.877965 
+344787.616101  7398689.071015 
+344832.178731  7398660.065984 
+344847.285826  7398651.587436 
+344867.909649  7398639.399524 
+344890.710476  7398630.031128 
+344908.514088  7398620.342788 
+344932.881700  7398606.285196 
+344959.747919  7398589.408087 
+345011.921821  7398562.232742 
+345053.779687  7398535.987237 
+345090.021871  7398519.120127 
+345108.765553  7398507.562106 
+345134.691703  7398492.254728 
+345165.309957  7398478.187138 
+345192.802890  7398464.759438 
+345214.045180  7398452.261579 
+345241.224756  7398436.324309 
+345270.787493  7398418.117427 
+345346.809493  7398367.596081 
+345363.367925  7398357.907741 
+345388.675606  7398339.480897 
+345407.105932  7398325.733252 
+345416.787007  7398320.104216 
+345427.408152  7398315.105072 
+345461.151728  7398291.989032 
+345474.898194  7398281.680798 
+345487.704590  7398269.812831 
+345501.451057  7398253.245668 
+345516.129347  7398237.008450 
+345528.317276  7398226.380270 
+345538.311708  7398218.261661 
+345561.120782  7398205.453855 
+345575.799072  7398199.824819 
+345580.606625  7398198.695012 
+345588.918825  7398196.385408 
+345602.665292  7398193.885836 
+345622.662401  7398194.205781 
+345640.152656  7398196.705353 
+345658.582982  7398200.134766 
+345683.890664  7398206.383695 
+345706.386381  7398210.452998 
+345726.688601  7398210.133053 
+345749.802785  7398209.203213 
+345766.674573  7398204.204069 
+345783.859718  7398196.385408 
+345825.090871  7398165.150758 
+345847.586588  7398147.343808 
+345865.390200  7398134.845949 
+345880.703450  7398125.467556 
+345896.008455  7398118.598732 
+345911.940172  7398115.159321 
+345936.621140  7398114.539428 
+345956.304893  7398112.659750 
+345974.421862  7398108.290498 
+346000.348011  7398099.851943 
+346026.282406  7398091.413389 
+346039.154772  7398085.684370 
+346051.581842  7398080.165316 
+346076.749338  7398071.136862 
+346085.630528  7398068.297348 
+346095.946563  7398064.857938 
+346104.687567  7398063.298205 
+346115.308712  7398062.048419 
+346131.553787  7398060.798633 
+346169.981222  7398063.298205 
+346193.722120  7398057.989114 
+346212.779159  7398055.489542 
+346231.522841  7398055.179595 
+346270.890346  7398056.739328 
+346335.227438  7398055.199592 
+346350.862291  7398054.859650 
+346420.782080  7398057.189251 
+346432.260834  7398056.989285 
+346526.424541  7398057.049275 
+346565.049886  7398053.809830 
+346602.652697  7398053.299917 
+346635.456203  7398051.430238 
+346661.382352  7398048.300774 
+346678.880853  7398049.870505 
+346688.248571  7398052.989970 
+346715.741504  7398067.357509 
+346735.111900  7398082.664887 
+346741.981010  7398085.794351 
+346751.670331  7398088.293923 
+346780.095088  7398092.663175 
+346813.525307  7398093.603014 
+346849.759245  7398096.412533 
+346951.336314  7398076.225990 
+347155.290337  7398035.712930 
+347272.370319  7398001.268830 
+347366.360856  7397948.757824 
+347422.393994  7397805.272402 
+347523.006254  7397756.680726 
+347622.612474  7397686.872683 
+347795.280297  7397462.411131 
+347845.161746  7397372.246576 
+347902.712190  7397296.459557 
+347919.732410  7397285.871371 
+347931.029746  7397267.334546 
+347963.124076  7397175.420290 
+347984.885878  7397148.324931 
+348016.922484  7397058.280355 
+348032.392413  7397015.107750 
+347954.935569  7396922.053690 
+347954.886091  7396922.083684 
+347881.189528  7396843.797094 
+347795.181342  7396749.863184 
+347651.647452  7396591.260351 
+347602.846259  7396526.611425 
+347559.776196  7396471.230911 
+347549.080835  7396444.745448 
+347535.169444  7396407.641804 
+347491.860240  7396412.650946 
+347446.530711  7396421.159488 
+347395.874116  7396433.877310 
+347369.601625  7396443.085732 
+347347.138893  7396453.453956 
+347312.884051  7396469.931134 
+347291.567544  7396481.419166 
+347266.078445  7396501.295762 
+347230.331036  7396529.600913 
+347183.212074  7396579.642342 
+347142.912744  7396617.095926 
+347090.244069  7396673.536258 
+346969.593469  7396800.504510 
+346876.039982  7396876.561482 
+346866.771219  7396881.600619 
+346833.621372  7396904.226743 
+346811.076177  7396920.004041 
+346776.516224  7396935.491388 
+346751.439437  7396947.169387 
+346732.027810  7396958.037526 
+346706.852068  7396972.755005 
+346678.658205  7396992.001708 
+346663.650065  7397002.509908 
+Region 1
+184
+326732.922903  7396089.096368 
+326723.711864  7396056.182006 
+326724.849844  7396000.001629 
+326739.033360  7395842.888541 
+326753.917807  7395717.929945 
+326767.820952  7395600.580046 
+326814.403908  7395523.283286 
+326850.101841  7395465.563173 
+326868.317764  7395432.758792 
+326887.597452  7395414.181974 
+326913.762742  7395398.384680 
+326942.707011  7395379.517912 
+327001.131555  7395345.363762 
+327063.530783  7395282.754487 
+327080.781897  7395264.677583 
+327148.986471  7395187.330832 
+327179.175921  7395159.325629 
+327218.279547  7395130.290602 
+327281.412689  7395092.237121 
+327329.240826  7395057.673041 
+327399.581174  7395011.290986 
+327462.541145  7394962.899275 
+327524.222950  7394914.007650 
+327560.267224  7394890.561666 
+327574.500218  7394881.393236 
+327600.921141  7394869.135336 
+327648.716294  7394859.377007 
+327672.613871  7394849.928626 
+327717.127024  7394848.298905 
+327750.219147  7394852.288222 
+327790.947280  7394860.316846 
+327830.347770  7394847.029122 
+327896.927837  7394821.483498 
+327914.327383  7394813.954788 
+327951.039602  7394793.418306 
+327999.997474  7394757.714421 
+328037.089019  7394723.240326 
+328085.519132  7394670.059436 
+328097.698814  7394658.861354 
+328138.097098  7394642.524152 
+328159.446589  7394639.684639 
+328189.965889  7394638.104909 
+328242.881951  7394636.705149 
+328286.883838  7394635.855295 
+328427.275914  7394630.986129 
+328497.970850  7394620.927852 
+328554.441037  7394620.307958 
+328618.720405  7394593.502549 
+328684.014059  7394567.966923 
+328716.759841  7394544.280980 
+328756.877753  7394519.055301 
+328792.913781  7394490.280230 
+328883.787243  7394426.091225 
+328917.778206  7394394.776589 
+328967.098911  7394382.238737 
+328981.076272  7394414.463217 
+329003.423557  7394465.914404 
+329014.976526  7394492.299884 
+329034.742741  7394537.362166 
+329045.718474  7394562.377881 
+329093.060084  7394661.820847 
+329146.602860  7394788.429160 
+329185.780702  7394792.408479 
+329213.009755  7394795.148009 
+329243.042527  7394801.426934 
+329267.987375  7394808.995637 
+329290.656263  7394818.094079 
+329314.347684  7394829.722087 
+329339.581150  7394844.399573 
+329362.019143  7394864.156189 
+329383.954117  7394882.143108 
+329428.071451  7394921.916295 
+329462.243831  7394950.541392 
+329500.481602  7394979.156490 
+329550.668162  7395006.991722 
+329557.050744  7395012.560768 
+329583.339728  7395027.828153 
+329593.490837  7395034.067085 
+329637.632910  7395059.422741 
+329652.088552  7395067.971277 
+329683.943741  7395085.938200 
+329700.749560  7395091.737206 
+329710.166755  7395097.306252 
+329735.136341  7395108.684303 
+329764.171319  7395120.302313 
+329812.040688  7395135.949633 
+329859.901811  7395149.047389 
+329873.376152  7395151.307002 
+329891.451889  7395154.056531 
+329904.687090  7395157.585927 
+329912.083959  7395161.125321 
+329919.983847  7395167.724190 
+329928.403249  7395175.062933 
+329953.917087  7395208.067280 
+329956.498157  7395216.895768 
+329962.138579  7395232.643070 
+329972.413382  7395265.377463 
+329980.618381  7395289.233377 
+329995.989355  7395332.865903 
+330012.358123  7395354.942122 
+330024.933625  7395392.745646 
+330087.489531  7395560.216960 
+330108.319509  7395615.587475 
+330124.152272  7395657.660269 
+330144.908035  7395710.191271 
+330155.232315  7395751.824139 
+330163.181682  7395788.127921 
+330167.477968  7395849.317440 
+330173.703872  7395902.888263 
+330182.543831  7395950.830051 
+330190.336519  7395999.991630 
+330213.722829  7396052.872572 
+330199.902147  7396071.269421 
+330162.926049  7396173.591894 
+330211.751980  7396284.582883 
+330118.973639  7396340.983222 
+330026.467424  7396402.212734 
+329954.766448  7396418.369966 
+329838.478104  7396443.395679 
+329730.073156  7396471.450874 
+329680.397862  7396480.359348 
+329616.027786  7396489.867719 
+329486.289839  7396515.243372 
+329359.866877  7396543.888466 
+329240.280040  7396568.444260 
+329188.073154  7396600.328798 
+329161.693462  7396621.455179 
+329060.553443  7396679.945161 
+328796.146304  7396846.536625 
+328737.762991  7396883.450302 
+328690.437873  7396904.796646 
+328663.142850  7396920.453964 
+328632.038068  7396939.930627 
+328559.520715  7396989.872073 
+328485.263408  7397045.412559 
+328399.362424  7397107.361948 
+328283.511129  7397211.914039 
+328268.140155  7397230.790806 
+328257.139684  7397305.528004 
+328246.568016  7397365.287768 
+328199.861366  7397404.161109 
+328168.261810  7397423.387816 
+328131.838209  7397442.654515 
+328093.880809  7397458.611782 
+328048.526541  7397469.529912 
+327964.901516  7397503.874029 
+327960.011501  7397358.338958 
+327960.011501  7397237.259698 
+327879.503551  7397240.909073 
+327872.279853  7397239.849254 
+327813.451244  7397240.089213 
+327743.209851  7397239.319345 
+327670.469851  7397120.919626 
+327538.018894  7396913.845096 
+327444.688056  7396776.748579 
+327355.587533  7396637.912360 
+327319.056732  7396569.494080 
+327271.220348  7396497.516409 
+327197.350613  7396547.047925 
+327121.732678  7396569.494080 
+327124.041623  7396529.520927 
+327119.704106  7396502.895488 
+327113.816297  7396474.000437 
+327102.617916  7396445.515316 
+327091.081439  7396423.889021 
+327077.656576  7396405.692138 
+327059.663300  7396387.525249 
+327040.169211  7396372.797772 
+327027.940051  7396363.729325 
+326976.689728  7396320.636707 
+326956.791573  7396302.099882 
+326937.256253  7396280.523578 
+326918.883651  7396261.206887 
+326829.296601  7396237.370970 
+326814.469878  7396240.130497 
+326781.196338  7396251.608531 
+326758.684128  7396264.146383 
+326723.340783  7396296.880776 
+326695.229383  7396282.143300 
+326707.293619  7396238.470781 
+326708.926372  7396217.124438 
+326738.052059  7396121.050894 
+326737.969597  7396105.443567 
+326732.922903  7396089.096368 
+Region 1
+200
+329470.308644  7391628.130491 
+329439.418264  7391615.922582 
+329417.235904  7391609.463688 
+329404.709879  7391607.214073 
+329370.933319  7391606.264236 
+329340.677898  7391609.233728 
+329321.596121  7391607.574012 
+329302.448373  7391606.634173 
+329276.538716  7391602.834824 
+329255.156240  7391597.045815 
+329212.440766  7391567.450885 
+329192.476641  7391554.113169 
+329121.385887  7391503.891772 
+329044.786650  7391455.140122 
+328952.181480  7391391.311056 
+328856.286064  7391328.221862 
+328836.091045  7391317.683667 
+328762.509929  7391263.442958 
+328727.727328  7391243.876310 
+328708.323947  7391235.887678 
+328695.096993  7391231.858369 
+328669.344015  7391225.689425 
+328632.689520  7391217.620807 
+328609.220747  7391216.231045 
+328586.873462  7391215.191223 
+328563.718047  7391213.771467 
+328479.062243  7391217.660800 
+328374.697948  7391220.110381 
+328311.861670  7391223.599783 
+328304.390585  7391222.739930 
+328228.096459  7391227.759071 
+328140.397796  7391133.435227 
+328038.861959  7391025.233761 
+328016.572397  7391002.267695 
+328000.046951  7390984.240783 
+327944.912653  7390923.891121 
+327867.389838  7390845.074621 
+327697.426779  7390658.606561 
+327684.678106  7390648.008377 
+327652.039525  7390618.353456 
+327606.404885  7390557.643855 
+327587.364338  7390541.876556 
+327534.918311  7390520.920146 
+327509.437459  7390521.899978 
+327403.588842  7390517.900663 
+327395.078732  7390570.111720 
+327377.555492  7390662.395912 
+327372.566522  7390717.226520 
+327345.634333  7390811.380393 
+327328.061615  7390841.665205 
+327092.664715  7391254.324520 
+326860.442614  7391683.840948 
+326759.541736  7391794.821938 
+326651.664547  7391907.422650 
+326424.423169  7392114.857119 
+326339.742626  7392211.080637 
+326270.564997  7392345.047689 
+326219.850679  7392496.851687 
+326131.203699  7392705.355972 
+326078.831889  7392865.948464 
+326043.702946  7392961.322127 
+326027.631042  7393017.592488 
+326011.122089  7393067.323970 
+325962.436343  7393151.369574 
+325992.543331  7393100.888221 
+326011.122089  7393067.323970 
+326105.557922  7393133.352660 
+326194.237886  7393224.866984 
+326265.213194  7393290.935667 
+326332.131355  7393354.704744 
+326398.282618  7393417.953910 
+326461.143634  7393476.623860 
+326480.926341  7393492.151201 
+326524.260283  7393533.014201 
+326595.854058  7393602.352324 
+326618.539438  7393624.818476 
+326632.112734  7393667.511163 
+326666.540747  7393736.559336 
+326706.427764  7393787.630588 
+326779.349182  7393876.285402 
+326780.891227  7393937.194969 
+326784.610277  7393958.321350 
+326805.357793  7393990.285875 
+326810.552919  7394000.004210 
+326814.906929  7394014.861665 
+326833.122852  7394039.837387 
+326846.176635  7394067.232695 
+326868.161086  7394100.696962 
+326882.756914  7394133.421357 
+326904.246591  7394172.224710 
+326927.418499  7394217.376976 
+326935.969841  7394231.564546 
+326953.509573  7394311.250896 
+326964.427583  7394388.167721 
+326971.403894  7394423.951592 
+327016.642715  7394577.715254 
+327045.149934  7394665.260258 
+327045.191166  7394665.310249 
+327061.576426  7394678.627968 
+327110.253925  7394746.186396 
+327138.398311  7394788.249191 
+327147.023868  7394801.086992 
+327165.412962  7394817.694147 
+327185.393579  7394852.068259 
+327230.822064  7394900.210013 
+327276.349503  7394981.356113 
+327242.135892  7395027.908140 
+327229.469682  7395045.205177 
+327217.322984  7395065.801649 
+327212.812296  7395090.437429 
+327218.279547  7395130.290602 
+327281.412689  7395092.237121 
+327329.240826  7395057.673041 
+327399.581174  7395011.290986 
+327462.541145  7394962.899275 
+327524.222950  7394914.007650 
+327560.267224  7394890.561666 
+327574.500218  7394881.393236 
+327600.921141  7394869.135336 
+327648.716294  7394859.377007 
+327672.613871  7394849.928626 
+327717.127024  7394848.298905 
+327750.219147  7394852.288222 
+327790.947280  7394860.316846 
+327830.347770  7394847.029122 
+327896.927837  7394821.483498 
+327914.327383  7394813.954788 
+327951.039602  7394793.418306 
+327999.997474  7394757.714421 
+328037.089019  7394723.240326 
+328085.519132  7394670.059436 
+328097.698814  7394658.861354 
+328138.097098  7394642.524152 
+328159.446589  7394639.684639 
+328189.965889  7394638.104909 
+328242.881951  7394636.705149 
+328286.883838  7394635.855295 
+328427.275914  7394630.986129 
+328497.970850  7394620.927852 
+328554.441037  7394620.307958 
+328618.720405  7394593.502549 
+328684.014059  7394567.966923 
+328716.759841  7394544.280980 
+328756.877753  7394519.055301 
+328792.913781  7394490.280230 
+328776.767662  7394451.716836 
+328758.881587  7394420.012267 
+328741.506779  7394402.505265 
+328700.630214  7394335.056819 
+328681.210341  7394304.881987 
+328660.767935  7394274.697158 
+328640.086389  7394247.831760 
+328585.743729  7394189.281789 
+328547.687374  7394140.350170 
+328519.881085  7394109.675424 
+328502.786649  7394094.478028 
+328460.178375  7394050.885495 
+328433.402864  7394028.089399 
+328415.277649  7394010.902343 
+328407.922011  7394004.773393 
+328324.610343  7393952.092417 
+328314.813821  7393925.137034 
+328303.780364  7393911.659343 
+328292.763400  7393893.282491 
+328287.856893  7393876.125429 
+328282.950386  7393863.877527 
+328277.969662  7393848.600144 
+328278.052125  7393832.432914 
+328279.173612  7393807.517181 
+328335.577830  7393715.922871 
+328367.169139  7393642.865385 
+328381.616535  7393612.350612 
+328401.423981  7393577.916510 
+328442.556180  7393518.476691 
+328572.013755  7393325.659719 
+328692.293275  7393143.760877 
+328775.011215  7393020.531985 
+328795.173249  7392990.087200 
+328810.478253  7392973.320072 
+328853.136004  7392939.925792 
+328907.462171  7392895.823346 
+328794.431088  7392739.210173 
+328715.795032  7392628.209186 
+328715.803279  7392628.199188 
+328800.821917  7392551.442336 
+328852.567014  7392483.274012 
+328945.617480  7392365.734146 
+329031.353541  7392255.433039 
+329106.567410  7392160.949224 
+329195.585470  7392048.128549 
+329195.593716  7392048.128549 
+329234.936483  7391999.966798 
+329270.551953  7391949.105511 
+329351.966988  7391848.712707 
+329393.998026  7391790.282715 
+329453.948122  7391717.875118 
+329473.912247  7391695.848891 
+329514.549671  7391660.544938 
+329486.627935  7391638.178769 
+329470.308644  7391628.130491 
+Region 1
+297
+323487.478646  7404590.230200 
+323137.508618  7404495.796376 
+322804.212468  7404268.035389 
+322511.900084  7404001.031125 
+322389.946578  7403916.655578 
+321753.560221  7403527.492238 
+321723.799574  7403581.283024 
+321714.638012  7403643.092436 
+321698.615586  7403711.770673 
+321691.746476  7403764.421654 
+321692.966918  7403783.368408 
+321698.615586  7403892.609696 
+321608.946074  7403877.032365 
+321524.059376  7403861.585011 
+321478.738092  7403839.368816 
+321455.962003  7403828.510676 
+321421.624699  7403798.755773 
+321382.710736  7403782.728518 
+321336.927664  7403766.711262 
+321245.361518  7403734.656752 
+321169.050900  7403699.072848 
+321191.043597  7403684.125408 
+321210.348023  7403660.849395 
+321219.319922  7403644.732156 
+321214.561847  7403620.636283 
+321207.090762  7403600.209782 
+321155.279695  7403532.961301 
+321142.918595  7403512.094875 
+321119.260159  7403477.970720 
+321099.073387  7403445.296317 
+321090.332382  7403422.910152 
+321028.238266  7403437.807600 
+321002.658458  7403453.704877 
+320946.930431  7403487.869025 
+320991.410599  7403092.356773 
+320970.762038  7402996.433203 
+320965.764822  7402952.980646 
+320955.374572  7402859.886593 
+320943.780371  7402760.803565 
+320967.983058  7402641.923928 
+320956.413597  7402398.905554 
+320935.740296  7402369.620571 
+320911.653057  7402335.736375 
+320906.845504  7402318.099396 
+320935.740296  7402205.548675 
+320921.136222  7402173.344191 
+320849.410508  7402100.326698 
+320797.805596  7402084.789360 
+320773.751342  7402068.752107 
+320765.736005  7402062.343205 
+320751.305102  7402033.478149 
+320746.497549  7402003.013367 
+320749.705333  7401972.548586 
+320780.166909  7401932.455453 
+320828.522806  7401898.461276 
+320872.607155  7401918.327873 
+320932.227402  7401834.502232 
+320995.566700  7401836.361913 
+321014.186689  7401843.190743 
+321025.368577  7401847.539998 
+321039.032581  7401850.019574 
+321050.832938  7401846.920105 
+321054.560234  7401836.981807 
+321104.853994  7401830.772870 
+321150.373188  7401833.722365 
+321168.820006  7401818.354997 
+321208.550345  7401796.478745 
+321237.758494  7401781.761266 
+321267.626341  7401764.254264 
+321278.956662  7401756.015676 
+321302.648083  7401743.657792 
+321368.568451  7401720.991675 
+321436.550376  7401702.454850 
+321473.633675  7401691.126791 
+321494.216267  7401690.096967 
+321517.899441  7401704.144561 
+321533.369370  7401728.200440 
+321559.122348  7401735.409205 
+321583.836302  7401740.558323 
+321594.144090  7401735.409205 
+321620.919601  7401710.693439 
+321677.571205  7401693.186438 
+321744.514106  7401672.579967 
+321788.796364  7401708.633792 
+321834.125894  7401746.747263 
+321863.573184  7401754.785886 
+321884.164022  7401759.805027 
+321908.276000  7401775.582324 
+321916.942789  7401784.310829 
+321930.276944  7401797.318601 
+321947.437350  7401803.467548 
+321976.043524  7401805.457207 
+322011.122989  7401806.327058 
+322045.245891  7401815.905417 
+322073.266583  7401813.385849 
+322102.252084  7401807.756813 
+322136.193569  7401797.948493 
+322176.608345  7401773.282718 
+322202.930314  7401755.055840 
+322219.711393  7401743.287856 
+322250.610019  7401711.743259 
+322282.267299  7401682.098337 
+322351.296495  7401634.646465 
+322414.017326  7401595.343197 
+322459.338609  7401582.975316 
+322530.396379  7401561.349020 
+322599.417329  7401539.722725 
+322642.322467  7401394.177655 
+322685.450254  7401282.586770 
+322778.550198  7401112.815850 
+322839.209470  7401034.459272 
+322907.884079  7400952.313343 
+323098.223575  7400754.237271 
+323148.566813  7400696.057237 
+323211.130965  7400618.090592 
+323236.306707  7400586.136065 
+323267.601152  7400543.913298 
+323362.210157  7400397.778329 
+323442.495458  7400303.044556 
+323610.446438  7400065.355270 
+323889.193772  7399748.599528 
+324152.108344  7399463.518360 
+324347.552257  7399235.407433 
+324392.205596  7399056.798027 
+324541.718003  7399165.749365 
+324677.920995  7399197.423939 
+324782.458461  7399206.932311 
+325016.857567  7399181.586652 
+325682.056255  7399140.403706 
+325865.040113  7399134.584703 
+325848.283772  7399287.228557 
+325848.663099  7399360.046084 
+325841.117798  7399467.767632 
+325818.366447  7399623.241001 
+325807.506162  7399784.473383 
+325796.983971  7399896.474198 
+325791.747615  7399940.596640 
+325777.316711  7400062.595743 
+325753.847939  7400268.760429 
+325734.518774  7400359.634863 
+325730.222488  7400377.501803 
+325722.710172  7400408.436504 
+325712.410630  7400435.801816 
+325700.008299  7400460.837528 
+325687.292611  7400489.502618 
+325672.210255  7400513.638484 
+325653.746945  7400559.130691 
+325600.402079  7400624.149554 
+325531.298666  7400737.030219 
+325504.382969  7400777.403303 
+325490.001543  7400798.359713 
+325469.559137  7400839.192719 
+325459.812093  7400866.548033 
+325452.266792  7400885.674757 
+325445.513129  7400911.960255 
+325440.260280  7400930.137141 
+325437.101973  7400963.271466 
+325429.960738  7401012.543026 
+325404.686041  7401165.676795 
+325396.901599  7401218.937672 
+325378.025977  7401290.855353 
+325334.692035  7401351.804913 
+325319.939528  7401454.757278 
+325295.332776  7401559.709301 
+325317.770770  7401615.439755 
+325334.428156  7401639.375655 
+325358.853491  7401669.910425 
+325400.628895  7401715.752572 
+325422.060849  7401743.917748 
+325461.618017  7401805.247243 
+325492.153809  7401853.069051 
+325522.755571  7401904.430254 
+325547.931313  7401941.353929 
+325562.485910  7401978.527561 
+325571.276392  7402011.051990 
+325574.797533  7402035.667774 
+325572.166985  7402067.322352 
+325568.654091  7402092.817984 
+325559.863609  7402146.438800 
+325576.562226  7402223.805547 
+325615.253540  7402327.537779 
+325643.373187  7402360.072206 
+325670.626979  7402426.880763 
+325689.222229  7402507.526949 
+325661.531387  7402516.755368 
+325607.172234  7402544.450624 
+325584.602301  7402560.857813 
+325568.192302  7402578.294827 
+325554.858147  7402587.533244 
+325532.469631  7402616.238327 
+325498.981688  7402642.113895 
+325476.518956  7402659.600900 
+325452.918244  7402678.627641 
+325435.419742  7402683.926733 
+325340.621075  7402744.286394 
+325327.690985  7402759.463794 
+325303.496544  7402856.757129 
+325308.213388  7402891.541170 
+325303.240911  7402919.366404 
+325303.983072  7402945.681897 
+325312.328257  7402968.198040 
+325322.586568  7402987.674704 
+325332.836633  7403010.960715 
+325343.103190  7403031.187250 
+325327.872402  7403108.054084 
+325278.329048  7403244.890645 
+325279.079455  7403282.244247 
+325281.487355  7403335.245168 
+325292.413610  7403389.865812 
+325309.005026  7403476.091042 
+325292.487827  7403542.149727 
+325216.993585  7403598.770029 
+325016.461748  7403899.578503 
+324981.077172  7403970.356379 
+324973.696796  7404063.260465 
+324986.239313  7404087.686282 
+324952.124657  7404184.599681 
+324934.766341  7404234.041212 
+324930.197929  7404250.428405 
+324926.759251  7404265.295859 
+324922.949493  7404278.263637 
+324890.673746  7404322.176116 
+324850.506356  7404373.817270 
+324825.091473  7404417.259829 
+324809.827701  7404463.391927 
+324803.717244  7404490.837225 
+324801.762887  7404516.492831 
+324805.209811  7404539.278928 
+324810.833741  7404562.534944 
+324820.011795  7404582.021606 
+324839.712040  7404625.194211 
+324842.029231  7404635.462452 
+324843.010533  7404640.351615 
+324850.968145  7404701.531136 
+324859.799858  7404732.095900 
+324879.293947  7404768.209714 
+324903.348202  7404798.954448 
+324921.943452  7404833.278568 
+324947.539752  7404883.210016 
+324957.864033  7404905.696164 
+324976.987042  7404947.219051 
+325051.656660  7405018.696808 
+325087.041236  7405059.099887 
+325118.352174  7405098.673109 
+325145.243132  7405147.694712 
+325157.142443  7405185.238281 
+325149.547664  7405210.373975 
+325043.855726  7405356.408961 
+325043.863973  7405356.458952 
+324930.783412  7405516.951461 
+324907.801167  7405533.498627 
+324853.573954  7405549.125950 
+324820.217951  7405549.615866 
+324762.552060  7405557.054592 
+324741.202569  7405560.254044 
+324746.875976  7405521.450691 
+324746.777021  7405498.524618 
+324746.702805  7405493.085549 
+324735.496177  7405472.879011 
+324711.969681  7405440.624536 
+324700.548652  7405433.955678 
+324677.450960  7405421.937736 
+324644.086711  7405409.219915 
+324604.950100  7405400.021490 
+324585.109669  7405384.724111 
+324569.796419  7405364.567563 
+324558.053786  7405349.740103 
+324537.240300  7405336.972290 
+324508.345508  7405326.324114 
+324463.395305  7405317.145686 
+324444.231065  7405227.321072 
+324428.175654  7405211.283819 
+324408.673318  7405202.195376 
+324391.183063  7405193.896798 
+324375.853320  7405185.968156 
+324361.348201  7405176.489779 
+324345.680362  7405162.782127 
+324334.185117  7405149.464409 
+324324.248409  7405126.198394 
+324292.789039  7404979.843463 
+324288.014471  7404942.909790 
+324285.656049  7404909.655486 
+324285.944668  7404893.598236 
+324288.162904  7404879.110718 
+324293.036426  7404864.993136 
+324299.872551  7404856.994506 
+324308.242475  7404849.335818 
+324328.346786  7404843.046895 
+324342.522056  7404845.316506 
+324362.659351  7404844.446655 
+324379.423938  7404843.986734 
+324397.697585  7404837.227892 
+324405.193409  7404825.569889 
+324434.236633  7404756.791670 
+324445.839080  7404704.830570 
+323840.186424  7404582.341552 
+323487.478646  7404590.230200 
+Region 1
+332
+349296.572556  7398517.010488 
+349400.978082  7397946.868148 
+349420.513403  7397840.196420 
+349439.883799  7397734.424538 
+349420.562880  7397726.975814 
+349359.408834  7397700.300383 
+349207.843115  7397644.739900 
+349152.296505  7397622.523705 
+349094.366735  7397598.717783 
+349034.853688  7397575.701726 
+348977.723802  7397551.105939 
+348920.577424  7397528.089881 
+348865.063799  7397504.653895 
+348828.516505  7397492.375999 
+348733.297279  7397481.267901 
+348691.851724  7397480.208083 
+348671.302117  7397490.556310 
+348599.180584  7397529.689607 
+348545.217251  7397565.393491 
+348534.109578  7397567.783082 
+348523.001906  7397564.603627 
+348438.090469  7397519.371374 
+348370.636302  7397482.077763 
+348309.498748  7397454.252529 
+348287.390603  7397450.503171 
+348249.227048  7397449.543335 
+348224.867683  7397445.733988 
+348205.571503  7397446.363880 
+348186.011444  7397452.322859 
+348164.686691  7397461.521284 
+348156.712586  7397471.069648 
+348151.773094  7397476.418732 
+348149.117808  7397480.238078 
+348145.316296  7397485.957098 
+348135.057985  7397497.035200 
+348020.179746  7397333.523209 
+347963.445679  7397278.942558 
+347919.732410  7397285.871371 
+347902.712190  7397296.459557 
+347845.161746  7397372.246576 
+347795.280297  7397462.411131 
+347622.612474  7397686.872683 
+347523.006254  7397756.680726 
+347422.393994  7397805.272402 
+347366.360856  7397948.757824 
+347272.370319  7398001.268830 
+347155.290337  7398035.712930 
+346951.336314  7398076.225990 
+346849.759245  7398096.412533 
+346813.525307  7398093.603014 
+346780.095088  7398092.663175 
+346751.670331  7398088.293923 
+346741.981010  7398085.794351 
+346735.111900  7398082.664887 
+346715.741504  7398067.357509 
+346688.248571  7398052.989970 
+346678.880853  7398049.870505 
+346661.382352  7398048.300774 
+346635.456203  7398051.430238 
+346602.652697  7398053.299917 
+346565.049886  7398053.809830 
+346526.424541  7398057.049275 
+346432.260834  7398056.989285 
+346420.782080  7398057.189251 
+346350.862291  7398054.859650 
+346335.227438  7398055.199592 
+346270.890346  7398056.739328 
+346231.522841  7398055.179595 
+346212.779159  7398055.489542 
+346193.722120  7398057.989114 
+346169.981222  7398063.298205 
+346131.553787  7398060.798633 
+346115.308712  7398062.048419 
+346104.687567  7398063.298205 
+346095.946563  7398064.857938 
+346085.630528  7398068.297348 
+346076.749338  7398071.136862 
+346051.581842  7398080.165316 
+346039.154772  7398085.684370 
+346026.282406  7398091.413389 
+346000.348011  7398099.851943 
+345974.421862  7398108.290498 
+345956.304893  7398112.659750 
+345936.621140  7398114.539428 
+345911.940172  7398115.159321 
+345896.008455  7398118.598732 
+345880.703450  7398125.467556 
+345865.390200  7398134.845949 
+345847.586588  7398147.343808 
+345825.090871  7398165.150758 
+345783.859718  7398196.385408 
+345766.674573  7398204.204069 
+345749.802785  7398209.203213 
+345726.688601  7398210.133053 
+345706.386381  7398210.452998 
+345683.890664  7398206.383695 
+345658.582982  7398200.134766 
+345640.152656  7398196.705353 
+345622.662401  7398194.205781 
+345602.665292  7398193.885836 
+345588.918825  7398196.385408 
+345580.606625  7398198.695012 
+345575.799072  7398199.824819 
+345561.120782  7398205.453855 
+345538.311708  7398218.261661 
+345528.317276  7398226.380270 
+345516.129347  7398237.008450 
+345501.451057  7398253.245668 
+345487.704590  7398269.812831 
+345474.898194  7398281.680798 
+345461.151728  7398291.989032 
+345427.408152  7398315.105072 
+345416.787007  7398320.104216 
+345407.105932  7398325.733252 
+345388.675606  7398339.480897 
+345363.367925  7398357.907741 
+345346.809493  7398367.596081 
+345270.787493  7398418.117427 
+345241.224756  7398436.324309 
+345214.045180  7398452.261579 
+345192.802890  7398464.759438 
+345165.309957  7398478.187138 
+345134.691703  7398492.254728 
+345108.765553  7398507.562106 
+345090.021871  7398519.120127 
+345053.779687  7398535.987237 
+345011.921821  7398562.232742 
+344959.747919  7398589.408087 
+344932.881700  7398606.285196 
+344908.514088  7398620.342788 
+344890.710476  7398630.031128 
+344867.909649  7398639.399524 
+344847.285826  7398651.587436 
+344832.178731  7398660.065984 
+344787.616101  7398689.071015 
+344758.877987  7398706.877965 
+344743.259626  7398717.196198 
+344734.197019  7398723.445128 
+344724.829301  7398729.694057 
+344715.766693  7398735.623042 
+344711.082834  7398740.002291 
+344723.559381  7398740.512204 
+344729.801778  7398741.132098 
+344739.449868  7398744.001606 
+344745.428385  7398745.821295 
+344756.832922  7398747.381028 
+344792.283467  7398753.789930 
+344809.938647  7398758.479127 
+344825.086973  7398764.568084 
+344843.368866  7398774.566371 
+344852.109871  7398781.755140 
+344860.083976  7398790.973561 
+344880.229517  7398811.590029 
+344893.819305  7398827.057380 
+344901.001772  7398834.396123 
+344912.406309  7398841.894838 
+344937.870669  7398855.332536 
+344963.483462  7398867.670423 
+344986.135857  7398880.798174 
+344991.603108  7398883.607693 
+345000.195681  7398886.577184 
+345019.096041  7398891.576328 
+345028.158649  7398895.485659 
+345037.526367  7398901.414643 
+345071.269943  7398928.909933 
+345105.945343  7398954.845491 
+345134.840135  7398972.812413 
+345159.991138  7398989.839497 
+345199.977111  7399003.897089 
+345222.002793  7399013.425457 
+345292.607019  7399039.830933 
+345302.923054  7399043.580291 
+345316.042807  7399048.729409 
+345383.810330  7399077.164539 
+345388.988963  7399079.044217 
+345417.257042  7399088.572584 
+345434.285508  7399094.821514 
+345449.442080  7399101.850310 
+345465.687154  7399108.719134 
+345472.712943  7399110.438839 
+345478.336872  7399109.658973 
+345488.958017  7399105.129748 
+345495.522017  7399102.630177 
+345504.576378  7399101.540363 
+345517.391021  7399100.750499 
+345527.698809  7399102.470204 
+345548.471064  7399107.939267 
+345571.898605  7399116.687769 
+345594.394322  7399124.496431 
+345612.667970  7399130.275441 
+345624.855898  7399136.684343 
+345649.380188  7399150.431989 
+345660.628047  7399157.310810 
+345687.650945  7399178.397198 
+345708.579878  7399194.644415 
+345714.987199  7399197.923854 
+345728.890344  7399201.833184 
+345746.380599  7399205.582542 
+345809.332324  7399216.830615 
+345828.702720  7399219.790108 
+345839.480543  7399223.079545 
+345859.939442  7399229.948368 
+345868.688692  7399234.787539 
+345879.301591  7399251.854616 
+345884.463732  7399259.943230 
+345888.372445  7399264.782401 
+345900.708806  7399269.781545 
+345916.178735  7399274.160795 
+345935.392452  7399278.060127 
+345959.446707  7399281.969457 
+345965.540671  7399282.279404 
+345975.221746  7399280.559699 
+345993.495393  7399274.630714 
+346005.840001  7399270.251465 
+346014.894362  7399267.911865 
+346026.768934  7399268.531759 
+346043.954079  7399270.411437 
+346082.686624  7399277.440233 
+346107.210914  7399281.659510 
+346122.054129  7399283.849135 
+346144.079811  7399288.848279 
+346150.017097  7399290.557986 
+346154.387599  7399293.847423 
+346175.629890  7399311.804347 
+346186.721070  7399321.022768 
+346209.686822  7399335.870225 
+346217.025967  7399338.209824 
+346225.461861  7399340.089502 
+346234.054434  7399340.089502 
+346249.870704  7399338.449783 
+346259.980583  7399337.120011 
+346267.171296  7399337.739904 
+346274.823798  7399338.989690 
+346284.661551  7399343.678887 
+346300.279912  7399354.926960 
+346311.684449  7399363.365515 
+346321.217092  7399371.484124 
+346327.616167  7399375.233482 
+346345.114668  7399380.862518 
+346377.876942  7399388.391228 
+346412.123538  7399395.390029 
+346431.650612  7399398.509495 
+346452.579546  7399400.859093 
+346473.203369  7399404.288505 
+346491.163659  7399406.008211 
+346503.813377  7399405.388317 
+346518.186557  7399402.728772 
+346526.267863  7399401.009067 
+346554.255570  7399394.880117 
+346599.815994  7399376.633242 
+346617.504159  7399369.794414 
+346651.800232  7399365.235195 
+346687.844506  7399362.975582 
+346715.164268  7399363.775445 
+346736.761146  7399364.675291 
+346756.972658  7399370.254335 
+346779.641546  7399380.922508 
+346795.680464  7399395.020093 
+346812.181172  7399411.907200 
+346832.128804  7399436.403004 
+346841.364582  7399443.821734 
+346887.337318  7399482.185162 
+346897.405966  7399486.764378 
+346905.660443  7399484.014849 
+346921.122125  7399497.362562 
+346949.522143  7399491.273605 
+346998.216135  7399485.184648 
+347040.824409  7399491.273605 
+347083.432683  7399501.421867 
+347114.801344  7399510.090382 
+347142.261292  7399501.421867 
+347166.612411  7399501.421867 
+347186.898139  7399507.510824 
+347211.249258  7399527.797349 
+347236.746603  7399566.990636 
+347288.343268  7399585.627443 
+347318.780105  7399595.775705 
+347363.408706  7399595.775705 
+347438.474143  7399605.913969 
+347464.853835  7399616.062230 
+347477.025272  7399624.180840 
+347495.282426  7399624.180840 
+347519.633545  7399595.775705 
+347539.919273  7399579.538486 
+347568.327537  7399579.538486 
+347606.870419  7399591.716401 
+347643.392975  7399589.686748 
+347708.315549  7399563.311266 
+347779.323841  7399543.024741 
+347828.553838  7399522.288293 
+347841.673591  7399504.181394 
+347855.840615  7399508.140716 
+347879.771176  7399510.090382 
+347913.457029  7399511.750098 
+347980.672055  7399518.628920 
+348028.689856  7399523.388105 
+348055.490105  7399524.997829 
+348115.431956  7399530.476890 
+348250.018686  7399540.155232 
+348291.983754  7399545.144378 
+348318.866466  7399545.764272 
+348364.179503  7399543.104727 
+348381.306924  7399541.674972 
+348399.168260  7399538.705481 
+348421.556776  7399533.376394 
+348456.248668  7399533.176428 
+348479.931843  7399535.835972 
+348588.806826  7399545.144378 
+348642.151692  7399548.753760 
+348666.618258  7399552.543111 
+348699.388779  7399551.993205 
+348724.877878  7399549.663604 
+348759.140966  7399547.184029 
+348878.900974  7399529.557048 
+348896.028395  7399528.517226 
+348909.750123  7399527.907330 
+348920.016680  7399526.967491 
+348948.251774  7399528.027310 
+348963.540285  7399530.436897 
+348982.622063  7399533.356397 
+349003.468534  7399539.705310 
+349027.935100  7399550.583446 
+349102.291362  7399586.977212 
+349116.582080  7399594.905854 
+349174.503604  7399305.255469 
+349215.289461  7399090.702220 
+349227.749515  7399021.554064 
+349249.148484  7398872.559586 
+349259.868584  7398795.392804 
+349269.879508  7398718.975893 
+349285.407160  7398596.836814 
+349296.572556  7398517.010488 
+Region 1
+99
+331947.773195  7394622.227629 
+331988.954871  7394549.330116 
+332010.592980  7394503.887899 
+332039.141430  7394433.629934 
+332046.257927  7394412.353578 
+332069.438082  7394323.538792 
+332074.946564  7394302.732356 
+332083.201041  7394265.448742 
+332094.218005  7394242.042751 
+332110.743451  7394207.368691 
+332124.506410  7394190.031660 
+332140.116525  7394177.893739 
+332174.998080  7394148.418788 
+332195.193099  7394138.010571 
+332216.303449  7394128.482203 
+332237.306599  7394120.463577 
+332320.016292  7394088.599035 
+332383.363836  7394063.463340 
+332403.558855  7394053.924974 
+332422.838542  7394046.116312 
+332451.288038  7394042.966851 
+332485.246016  7394039.187498 
+332506.513045  7394035.928057 
+332622.026244  7394018.381062 
+332680.590974  7394004.803388 
+332776.849224  7393992.055572 
+332834.737763  7393981.237425 
+332883.440001  7393972.568910 
+332893.986930  7393999.964217 
+332939.159782  7394131.901617 
+332953.747364  7394225.305618 
+332962.933665  7394266.918490 
+332960.171177  7394312.870619 
+332953.747364  7394354.483491 
+332940.017390  7394392.426992 
+332928.043863  7394424.711462 
+332915.196236  7394446.377750 
+332903.865915  7394463.394836 
+332868.382384  7394516.605721 
+332787.783726  7394657.381607 
+332744.119935  7394737.757840 
+332726.613187  7394771.852000 
+332731.049659  7394775.561364 
+332743.922025  7394787.569307 
+332759.020873  7394808.995637 
+332780.147716  7394841.380090 
+332812.101860  7394889.331876 
+333003.983401  7395244.701005 
+333055.472865  7395340.264636 
+333089.109240  7395412.862200 
+333099.087179  7395434.388513 
+333153.619502  7395514.324821 
+333200.021042  7395602.029798 
+333213.718031  7395626.335634 
+333219.548116  7395644.492524 
+333223.860895  7395658.210175 
+333227.151141  7395675.497213 
+333239.281346  7395834.849918 
+333244.831059  7395918.725551 
+333252.038265  7396000.001629 
+333260.902963  7396133.828705 
+333263.723174  7396222.513514 
+333226.928493  7396231.451983 
+333185.812787  7396242.400108 
+333078.718989  7396269.485469 
+332929.998220  7396307.788908 
+332916.062090  7396308.218834 
+332896.856619  7396295.920940 
+332818.270040  7396299.800276 
+332794.694067  7396302.709778 
+332685.670652  7396309.468620 
+332629.662253  7396310.678413 
+332556.006921  7396291.221745 
+332484.833704  7396236.451127 
+332453.027993  7396212.135292 
+332359.392044  7396139.707698 
+332277.358541  7396076.498526 
+332198.120511  7396013.299351 
+332181.141522  7396000.001629 
+332132.233128  7395962.258094 
+332053.440394  7395902.098399 
+331999.996573  7395867.714288 
+331982.126992  7395846.967842 
+331942.611054  7395642.872802 
+331874.051893  7395596.040824 
+331841.883347  7395554.207989 
+331836.449081  7395438.667780 
+331825.168237  7395322.887612 
+331823.362313  7395226.394141 
+331821.102846  7395148.427496 
+331827.798785  7395101.795483 
+331833.068126  7395065.111767 
+331835.855352  7395053.303789 
+331841.132940  7395038.176381 
+331842.831663  7394977.996689 
+331833.059880  7394948.131805 
+331819.131997  7394908.448602 
+331882.858867  7394780.830462 
+331947.773195  7394622.227629 
+Region 1
+97
+331982.126992  7395846.967842 
+331999.996573  7395867.714288 
+332053.440394  7395902.098399 
+332132.233128  7395962.258094 
+332181.141522  7396000.001629 
+332198.120511  7396013.299351 
+332277.358541  7396076.498526 
+332359.392044  7396139.707698 
+332453.027993  7396212.135292 
+332484.833704  7396236.451127 
+332556.006921  7396291.221745 
+332629.662253  7396310.678413 
+332685.670652  7396309.468620 
+332492.832548  7396624.534652 
+332439.479436  7396805.113720 
+332399.608911  7396868.092933 
+332328.617111  7396927.462763 
+332281.968184  7396961.047010 
+332224.120876  7396972.245092 
+332169.167995  7396976.304397 
+332016.959070  7397003.399756 
+331995.799242  7397004.029648 
+331968.693882  7397002.339937 
+331765.383065  7396968.455741 
+331762.670055  7397072.437930 
+331759.816860  7397168.441486 
+331704.319727  7397269.404192 
+331651.486128  7397365.547723 
+331604.202241  7397438.875163 
+331573.072720  7397497.215170 
+331509.568498  7397617.484569 
+331436.457417  7397744.902743 
+331363.659693  7397880.439527 
+331328.110193  7397965.235002 
+331299.471034  7397999.999047 
+331296.741531  7398008.977509 
+331274.542678  7398041.781890 
+331254.331167  7398071.996715 
+331236.445093  7398106.750762 
+331198.372246  7398138.695290 
+331139.568375  7398194.775684 
+331110.789030  7398177.908573 
+331066.622219  7398158.281935 
+331057.691551  7398153.602736 
+330981.331455  7398110.820065 
+330942.928759  7398062.308374 
+330871.334985  7397986.731320 
+330793.482321  7397889.997889 
+330734.769159  7397825.039016 
+330692.136147  7397777.527155 
+330657.411269  7397734.804473 
+330635.162939  7397701.900109 
+330607.991609  7397652.518568 
+330587.466741  7397611.735553 
+330578.197978  7397586.129939 
+330567.073813  7397547.076629 
+330551.719331  7397477.308579 
+330510.001650  7397294.999807 
+330498.926963  7397245.178341 
+330480.999657  7397149.084801 
+330476.084904  7397134.487302 
+330459.213116  7397083.336063 
+330458.149352  7396984.532987 
+330457.456669  7396919.554118 
+330458.767819  7396868.192915 
+330456.722754  7396819.181311 
+330460.450050  7396713.489415 
+330466.247150  7396616.925955 
+330429.559670  7396542.708668 
+330363.523855  7396390.924667 
+330293.109292  7396239.940529 
+330222.059769  7396074.118933 
+330213.722829  7396052.872572 
+330285.110448  7395986.443951 
+330362.567293  7395907.877409 
+330423.861525  7395852.816840 
+330470.469221  7395823.501862 
+330517.810831  7395795.986575 
+330600.330861  7395744.005479 
+330654.788968  7395703.852356 
+330729.062767  7395661.199662 
+330781.112975  7395641.623016 
+330853.061338  7395616.997234 
+330952.156291  7395579.213706 
+331010.110800  7395563.586383 
+331082.100394  7395564.196278 
+331134.488697  7395563.576384 
+331270.823628  7395558.717217 
+331370.034029  7395558.257296 
+331500.002871  7395553.918039 
+331590.546483  7395552.708246 
+331713.918340  7395552.948205 
+331806.003997  7395552.498282 
+331841.883347  7395554.207989 
+331874.051893  7395596.040824 
+331942.611054  7395642.872802 
+331982.126992  7395846.967842 
+Region 1
+219
+335156.216615  7400192.113558 
+335258.593568  7400348.396788 
+335292.353637  7400398.358230 
+335373.463561  7400535.854678 
+335400.956494  7400621.100076 
+335410.588092  7400678.850184 
+335425.711679  7400823.225454 
+335446.723074  7400938.995624 
+335449.089742  7400984.777782 
+335470.290801  7401032.279645 
+335482.891042  7401078.571716 
+335499.639136  7401130.622800 
+335525.449838  7401190.002629 
+335555.342424  7401264.669839 
+335593.266839  7401358.003851 
+335603.088100  7401380.769952 
+335672.521362  7401553.330394 
+335623.283119  7401573.077011 
+335496.522061  7401625.518029 
+335479.336916  7401617.959323 
+335466.967570  7401608.330973 
+335345.962382  7401691.516724 
+335334.961910  7401700.455193 
+335242.158831  7401759.575066 
+335176.156001  7401802.197765 
+335121.079426  7401837.441728 
+335046.220144  7401888.822927 
+335172.626614  7402004.713076 
+335221.320606  7402042.096673 
+335299.527857  7402188.171651 
+335333.469343  7402249.651120 
+335363.930919  7402293.653583 
+335314.783384  7402304.251768 
+335191.320819  7402326.877892 
+335135.246450  7402341.135450 
+335075.733404  7402353.433343 
+335019.659035  7402365.731237 
+335001.459604  7402367.700899 
+334969.002440  7402374.089805 
+334891.776490  7402389.337193 
+334793.704069  7402411.423410 
+334665.211303  7402435.339314 
+334607.965970  7402447.867168 
+334482.046028  7402473.942701 
+334377.640502  7402474.472610 
+334383.891145  7402451.776498 
+334381.227612  7402411.963318 
+334383.891145  7402300.952333 
+334379.256763  7402229.984489 
+334359.581257  7402151.287969 
+334277.110704  7402221.205993 
+334249.403369  7402244.242047 
+334197.270699  7402308.181095 
+334132.339879  7402341.135450 
+334108.318609  7402360.422146 
+334081.683284  7402366.711069 
+334022.656765  7402375.569552 
+333935.106534  7402371.140310 
+333895.763768  7402354.423174 
+333867.231810  7402319.499156 
+333798.136643  7402290.464129 
+333765.003289  7402271.497378 
+333742.952868  7402258.219653 
+333701.466081  7402224.075501 
+333563.259256  7402105.045890 
+333512.107887  7402089.308586 
+333449.147916  7402093.737827 
+333376.861458  7402093.727829 
+333242.818979  7402071.341663 
+333169.303833  7402072.081536 
+333080.269281  7402069.132042 
+333019.280159  7402056.344232 
+332971.080941  7402036.667603 
+332944.618786  7402024.779639 
+332919.327597  7402009.322287 
+332893.351971  7401985.846308 
+332871.548937  7401962.030387 
+332850.916868  7401934.405119 
+332837.417788  7401915.998272 
+332791.766655  7401840.901136 
+332769.576049  7401817.455152 
+332747.360703  7401798.968318 
+332686.585983  7401761.494737 
+332584.637834  7401705.004413 
+332547.999831  7401686.017666 
+332497.706070  7401666.161067 
+332390.439102  7401654.613045 
+332322.193297  7401649.483924 
+332273.260165  7401648.704057 
+332210.308440  7401645.144667 
+332096.526949  7401640.395480 
+332001.621081  7401630.527171 
+331951.780863  7401620.538882 
+331925.302216  7401611.560420 
+331904.117650  7401602.991887 
+331877.944114  7401587.154600 
+331848.043281  7401567.807914 
+331783.508280  7401512.197439 
+331754.151699  7401495.290336 
+331715.023335  7401484.622163 
+331626.961838  7401471.274449 
+331558.476892  7401457.046886 
+331390.558897  7401423.512630 
+331419.940217  7401353.414638 
+331445.140698  7401291.545235 
+331461.525958  7401252.471928 
+331482.479630  7401230.405708 
+331499.837946  7401204.040224 
+331509.271634  7401188.382906 
+331585.549267  7401091.649476 
+331665.240840  7400988.817090 
+331689.047708  7400963.191479 
+331709.869441  7400950.923581 
+331654.636188  7400835.513349 
+331703.668275  7400807.538141 
+331750.267724  7400781.452609 
+331800.940812  7400753.797347 
+331844.728297  7400724.142426 
+331865.459320  7400710.894695 
+331887.658173  7400696.707126 
+331932.913487  7400666.042378 
+331996.623865  7400626.879087 
+332030.219009  7400601.613414 
+332036.057340  7400580.637007 
+332051.683947  7400531.615404 
+332094.259236  7400400.557853 
+332099.413130  7400382.880881 
+332109.729165  7400346.787064 
+332122.989103  7400304.054383 
+332147.298991  7400223.768136 
+332182.642336  7400104.008649 
+332204.733988  7400048.868095 
+332227.097765  7399999.996466 
+332230.420996  7399994.147468 
+332242.889297  7399974.100902 
+332268.337165  7399932.238072 
+332290.239153  7399894.174592 
+332323.570418  7399841.403631 
+332437.838436  7399655.405491 
+332408.448870  7399636.028810 
+332393.003680  7399623.540949 
+332375.777304  7399606.983785 
+332356.299707  7399582.028060 
+332344.911663  7399567.770502 
+332322.119081  7399546.374167 
+332286.149023  7399519.348796 
+332261.583502  7399501.241898 
+332237.760142  7399486.194475 
+332216.987887  7399478.235839 
+332203.546531  7399473.656623 
+331999.996573  7399428.104426 
+331940.846361  7399415.636561 
+331868.493933  7399398.089567 
+331653.852796  7399351.307580 
+331630.260330  7399256.933746 
+331561.841354  7399202.673040 
+331571.275042  7399153.131526 
+331658.569640  7399122.466779 
+331490.833062  7399082.843566 
+331595.857056  7398431.905066 
+331543.237858  7398430.295341 
+331451.028507  7398392.191868 
+331325.083826  7398366.016352 
+331190.513588  7398378.574201 
+331166.014037  7398379.634019 
+331157.124600  7398323.783586 
+331542.536928  7398255.255324 
+331752.411744  7398227.770032 
+332221.201710  7398166.210577 
+333145.323794  7398119.288614 
+333595.650450  7398089.513714 
+334098.390147  7398060.788635 
+334304.290280  7398055.099609 
+334441.524051  7398082.554906 
+334606.209523  7398132.456359 
+334733.465354  7398142.434649 
+334783.082924  7398135.865775 
+334771.043428  7398197.235263 
+334762.492086  7398231.399410 
+334753.948991  7398257.025021 
+334748.259092  7398281.220877 
+334739.715997  7398302.577218 
+334726.901355  7398323.933560 
+334711.241763  7398343.860147 
+334645.131732  7398434.794571 
+334548.955944  7398558.803329 
+334534.731196  7398587.278452 
+334523.343151  7398614.323819 
+334517.653252  7398629.981137 
+334516.226654  7398647.068210 
+334513.381705  7398668.414554 
+334519.071604  7398691.190652 
+334519.071604  7398723.935044 
+334510.528509  7398968.773105 
+334514.668117  7398970.572797 
+334573.150384  7398996.638332 
+334697.421080  7399062.287087 
+334782.728336  7399107.689310 
+334796.845883  7399114.848084 
+334934.590920  7399186.895743 
+334971.534033  7399206.242429 
+335001.937886  7399222.069718 
+335015.882262  7399230.488276 
+335036.143250  7399247.815308 
+335047.778682  7399261.822908 
+335057.896807  7399278.110118 
+335069.260113  7399302.785892 
+335078.339213  7399332.290838 
+335083.072549  7399376.013348 
+335083.806463  7399388.971129 
+335087.286373  7399424.545035 
+335109.806829  7399709.466231 
+335110.293356  7399724.213705 
+335110.021231  7399736.661573 
+335100.002060  7399800.920566 
+335075.782881  7400000.986296 
+335064.856625  7400045.458679 
+335131.469677  7400128.174510 
+335156.216615  7400192.113558 
+Region 1
+169
+329337.247466  7384055.727575 
+329389.660508  7384135.743869 
+329418.192466  7384185.275384 
+329325.240955  7384299.225866 
+329294.177404  7384337.399327 
+329237.336136  7384404.307866 
+329207.138439  7384433.322896 
+329185.698240  7384455.779050 
+329163.969422  7384467.667013 
+329115.728972  7384500.821334 
+329067.719418  7384537.415066 
+329045.223700  7384559.041362 
+329029.423923  7384586.256700 
+328985.356066  7384745.199474 
+328971.403444  7384809.698426 
+328955.578927  7384871.227887 
+328935.524094  7384944.955258 
+328879.532188  7385055.116388 
+328846.736929  7385106.097656 
+328806.643755  7385165.677450 
+328750.503417  7385241.284500 
+328667.909171  7385322.490590 
+328566.142439  7385405.706336 
+328512.203844  7385445.219567 
+328429.551874  7385503.209634 
+328387.248711  7385548.991792 
+328337.119875  7385595.063900 
+328319.720328  7385617.080129 
+328313.519163  7385621.769326 
+328175.370061  7385781.361989 
+328138.723812  7385865.967497 
+328098.490452  7385935.395605 
+328019.277161  7386040.087672 
+327884.583229  7386123.873320 
+327838.288891  7386174.204699 
+327814.317098  7386188.692217 
+327793.099547  7386197.130772 
+327770.298719  7386203.059756 
+327742.583138  7386202.979770 
+327718.924702  7386193.261435 
+327699.026547  7386200.110261 
+327615.162382  7386198.190590 
+327550.627381  7386191.981654 
+327490.759746  7386188.902181 
+327460.586788  7386194.431234 
+327449.850196  7386192.871501 
+327415.257258  7386206.799116 
+327376.351542  7386222.096495 
+327327.335947  7386242.383020 
+327253.977479  7386281.536314 
+327176.561866  7386321.019551 
+327127.026759  7386347.694981 
+327067.678637  7386380.759318 
+327000.702751  7386416.073269 
+326979.559416  7386434.350138 
+326962.836060  7386453.616838 
+326924.392133  7386496.289529 
+326854.233202  7386589.153622 
+326763.062876  7386705.723654 
+326706.543212  7386745.806789 
+326616.106800  7386772.642192 
+326560.436497  7386791.488964 
+326475.186965  7386824.303343 
+326410.421069  7386736.738342 
+326342.389666  7386633.066100 
+326212.808398  7386526.164411 
+326054.076704  7386441.938838 
+325862.953816  7386380.389381 
+325644.890493  7386305.162267 
+325597.309742  7386279.966583 
+325450.724746  7386158.887323 
+325168.885075  7385841.411703 
+324995.252443  7385632.497488 
+324553.378174  7385115.766000 
+324455.866496  7385012.963609 
+324316.892771  7384827.445386 
+324180.838212  7384658.984242 
+324045.080517  7384462.247941 
+323987.744475  7384344.708075 
+323928.148966  7384066.155788 
+323921.807615  7383874.558607 
+323953.341201  7383679.621998 
+324019.278061  7383516.219987 
+324125.341079  7383355.677487 
+324269.394483  7383182.247194 
+324348.484081  7383072.525988 
+324485.470464  7382897.405985 
+324599.796206  7382757.349975 
+324623.660797  7382735.833661 
+324650.749665  7382703.469204 
+324700.227049  7382661.306426 
+324745.061805  7382623.522898 
+324804.228510  7382580.330297 
+324864.640396  7382538.017545 
+324964.658927  7382475.868190 
+325076.791171  7382399.131335 
+325111.738697  7382373.155784 
+325185.905295  7382317.925245 
+325277.240546  7382239.388697 
+325337.413291  7382165.011437 
+325414.235176  7382062.818942 
+325464.166102  7381997.030211 
+325543.808198  7381883.059733 
+325574.863503  7381821.520274 
+325675.096436  7381885.109382 
+325723.848152  7381832.018476 
+325775.716942  7381892.528111 
+325819.331256  7381952.747796 
+325833.869361  7381960.826412 
+325874.432569  7382009.048152 
+325902.032703  7382037.573266 
+325970.863991  7382108.621096 
+326039.142780  7382157.762679 
+326083.862089  7382197.585858 
+326137.462588  7382245.847591 
+326198.039399  7382307.826974 
+326243.286466  7382331.292955 
+326316.141914  7382347.000264 
+326423.458360  7382375.945306 
+326508.947033  7382405.470249 
+326564.427673  7382431.355815 
+326647.788818  7382470.839052 
+326665.419259  7382478.457747 
+326669.756777  7382480.637373 
+326755.286681  7382529.538997 
+326804.425969  7382556.034459 
+326932.926982  7382626.382409 
+327180.528303  7382767.468242 
+327277.800840  7382820.989074 
+327378.330637  7382888.947434 
+327405.493721  7382905.344625 
+327458.129411  7382945.517744 
+327554.593818  7383012.766225 
+327666.833263  7383082.854219 
+327693.617020  7383109.169712 
+327745.650735  7383142.234048 
+327811.620581  7383190.605762 
+327927.282212  7383286.069410 
+327999.997474  7383347.198939 
+328011.806076  7383355.327547 
+328042.449069  7383379.913336 
+328069.216334  7383385.992294 
+328109.260030  7383384.292585 
+328155.051348  7383375.564081 
+328248.423418  7383356.857285 
+328346.932889  7383334.361138 
+328402.867072  7383323.223046 
+328432.767904  7383315.324399 
+328488.908242  7383300.047016 
+328545.056827  7383269.132311 
+328576.499704  7383239.557377 
+328582.552438  7383233.858353 
+328636.491032  7383208.842638 
+328673.046573  7383210.022436 
+328723.958801  7383228.089342 
+328772.372421  7383294.108033 
+328844.370261  7383390.861460 
+328863.691179  7383416.697035 
+328885.988987  7383449.441426 
+328926.609919  7383502.902269 
+328969.457333  7383568.301066 
+329014.687908  7383623.311644 
+329064.107569  7383690.260176 
+329073.392824  7383703.307941 
+329148.903558  7383805.420450 
+329177.740627  7383845.093654 
+329208.111494  7383884.246948 
+329282.137907  7383981.070363 
+329337.247466  7384055.727575 
+Region 1
+239
+322073.266583  7401813.385849 
+322102.252084  7401807.756813 
+322136.193569  7401797.948493 
+322176.608345  7401773.282718 
+322202.930314  7401755.055840 
+322219.711393  7401743.287856 
+322250.610019  7401711.743259 
+322282.267299  7401682.098337 
+322351.296495  7401634.646465 
+322414.017326  7401595.343197 
+322459.338609  7401582.975316 
+322530.396379  7401561.349020 
+322599.417329  7401539.722725 
+322642.322467  7401394.177655 
+322685.450254  7401282.586770 
+322778.550198  7401112.815850 
+322839.209470  7401034.459272 
+322907.884079  7400952.313343 
+323098.223575  7400754.237271 
+323148.566813  7400696.057237 
+323211.130965  7400618.090592 
+323236.306707  7400586.136065 
+323267.601152  7400543.913298 
+323362.210157  7400397.778329 
+323442.495458  7400303.044556 
+323610.446438  7400065.355270 
+323889.193772  7399748.599528 
+324152.108344  7399463.518360 
+324347.552257  7399235.407433 
+324392.205596  7399056.798027 
+324343.082800  7399027.772999 
+324280.576371  7398954.105617 
+324166.712419  7398772.156784 
+324101.971262  7398696.249786 
+323992.576766  7398611.404319 
+323878.712813  7398544.435790 
+323748.999605  7398458.030591 
+323728.713878  7398532.747792 
+323743.070565  7398541.736253 
+323786.709618  7398579.659757 
+323806.566541  7398597.366724 
+323818.498837  7398619.242976 
+323818.836933  7398640.789286 
+323806.566541  7398658.686220 
+323786.676633  7398674.933437 
+323790.659562  7398636.480024 
+323778.727267  7398615.593602 
+323760.173248  7398607.634965 
+323738.634093  7398607.974907 
+323705.071935  7398620.162819 
+323683.351363  7398683.611951 
+323671.773655  7398722.585275 
+323655.990370  7398757.779246 
+323633.370959  7398796.822559 
+323619.022518  7398818.258887 
+323600.880810  7398842.014818 
+323563.830496  7398887.996941 
+323539.199005  7398909.883192 
+323512.679127  7398932.529313 
+323489.952516  7398952.495893 
+323458.855980  7398976.321812 
+323417.863967  7398998.288049 
+323386.371612  7399017.544751 
+323336.251023  7399042.230522 
+323290.649367  7399060.407409 
+323253.409390  7399072.815284 
+323224.506351  7399080.224015 
+323196.007378  7399089.912355 
+323152.656943  7399100.450550 
+323118.797920  7399107.119408 
+323082.283611  7399112.658459 
+323033.202046  7399119.787238 
+322955.530800  7399123.646577 
+322869.143288  7399131.745189 
+322758.734505  7399139.843802 
+322580.162381  7399152.961555 
+322464.888323  7399161.410108 
+322392.972945  7399167.499065 
+322193.109053  7399181.566655 
+322094.170778  7399192.034862 
+321966.222263  7399200.423425 
+321908.779020  7399203.722860 
+321879.859489  7399206.542377 
+321759.951050  7399215.590827 
+321670.273291  7399221.439826 
+321568.201448  7399228.868553 
+321436.335974  7399243.815993 
+321339.813844  7399265.572266 
+321260.963387  7399303.635746 
+321202.720260  7399351.847488 
+321113.496044  7399453.210125 
+321044.796697  7399541.534996 
+320963.241476  7399650.296366 
+320901.411238  7399755.218394 
+320873.505994  7399825.656329 
+320857.203196  7399889.555383 
+320866.076140  7399938.087070 
+320862.893095  7399944.915901 
+320848.124096  7400288.097117 
+320836.678328  7400380.111356 
+320829.141273  7400428.203118 
+320811.123259  7400473.505358 
+320790.466451  7400507.589520 
+320771.063070  7400550.142231 
+320754.413931  7400594.194685 
+320693.886598  7400620.600162 
+320651.492726  7400648.615363 
+320599.071438  7400661.123221 
+320519.247925  7400668.371979 
+320401.681415  7400673.761056 
+320114.737327  7400659.133562 
+320064.121963  7400654.034435 
+319955.618060  7400676.660559 
+319878.598266  7400706.155507 
+319793.307503  7400752.737528 
+319724.171105  7400814.606930 
+319686.659002  7400863.178611 
+319632.967794  7400964.561245 
+319619.592408  7401009.053623 
+319504.029731  7401386.588955 
+319411.309114  7401537.023187 
+319367.051594  7401603.181855 
+319310.070140  7401670.730284 
+319248.462551  7401745.287513 
+319220.928387  7401818.165030 
+319183.886319  7401872.285760 
+319161.522542  7401936.154819 
+319144.263181  7401997.034391 
+319141.649126  7402069.651953 
+319147.693613  7402142.369497 
+319168.309189  7402235.913473 
+319193.682841  7402307.811158 
+319206.448006  7402364.951370 
+319210.150564  7402411.413412 
+319223.410503  7402471.583105 
+319235.128396  7402533.752456 
+319236.200406  7402590.782688 
+319235.318060  7402638.194566 
+319218.281347  7402670.319064 
+319198.556363  7402721.580283 
+319185.972615  7402769.392093 
+319151.569341  7402810.924979 
+319112.993474  7402867.045366 
+319053.686583  7402905.808726 
+319076.940954  7402940.782736 
+319089.722611  7402957.949795 
+319251.868245  7402978.646250 
+319392.161367  7402959.099598 
+319553.160774  7403009.700931 
+319801.990783  7403122.831552 
+320024.746212  7403086.307809 
+320154.047108  7403020.469086 
+320162.441771  7402998.272888 
+320167.793575  7402987.434745 
+320179.701132  7402972.937228 
+320191.625181  7402969.117882 
+320205.957130  7402973.797081 
+320228.700234  7402978.326305 
+320255.508730  7402983.415433 
+320273.749393  7402984.805195 
+320298.504577  7402985.275115 
+320315.302149  7402983.895351 
+320337.608203  7402978.886209 
+320436.727895  7402942.572429 
+320477.307596  7402925.625332 
+320500.182640  7402922.055943 
+320515.182533  7402910.117988 
+320551.746320  7402899.129871 
+320563.282797  7402896.090391 
+320583.428338  7402897.310182 
+320591.023117  7402898.150038 
+320613.700251  7402903.089192 
+320633.854039  7402904.129014 
+320663.136404  7402905.098848 
+320684.469402  7402905.048857 
+320702.058612  7402904.139013 
+320734.392083  7402893.740794 
+320783.655065  7402888.311724 
+320830.163805  7402903.879057 
+320970.762038  7402996.433203 
+320965.764822  7402952.980646 
+320955.374572  7402859.886593 
+320943.780371  7402760.803565 
+320967.983058  7402641.923928 
+320956.413597  7402398.905554 
+320935.740296  7402369.620571 
+320911.653057  7402335.736375 
+320906.845504  7402318.099396 
+320935.740296  7402205.548675 
+320921.136222  7402173.344191 
+320849.410508  7402100.326698 
+320797.805596  7402084.789360 
+320773.751342  7402068.752107 
+320765.736005  7402062.343205 
+320751.305102  7402033.478149 
+320746.497549  7402003.013367 
+320749.705333  7401972.548586 
+320780.166909  7401932.455453 
+320828.522806  7401898.461276 
+320872.607155  7401918.327873 
+320932.227402  7401834.502232 
+320995.566700  7401836.361913 
+321014.186689  7401843.190743 
+321025.368577  7401847.539998 
+321039.032581  7401850.019574 
+321050.832938  7401846.920105 
+321054.560234  7401836.981807 
+321104.853994  7401830.772870 
+321150.373188  7401833.722365 
+321168.820006  7401818.354997 
+321208.550345  7401796.478745 
+321237.758494  7401781.761266 
+321267.626341  7401764.254264 
+321278.956662  7401756.015676 
+321302.648083  7401743.657792 
+321368.568451  7401720.991675 
+321436.550376  7401702.454850 
+321473.633675  7401691.126791 
+321494.216267  7401690.096967 
+321517.899441  7401704.144561 
+321533.369370  7401728.200440 
+321559.122348  7401735.409205 
+321583.836302  7401740.558323 
+321594.144090  7401735.409205 
+321620.919601  7401710.693439 
+321677.571205  7401693.186438 
+321744.514106  7401672.579967 
+321788.796364  7401708.633792 
+321834.125894  7401746.747263 
+321863.573184  7401754.785886 
+321884.164022  7401759.805027 
+321908.276000  7401775.582324 
+321916.942789  7401784.310829 
+321930.276944  7401797.318601 
+321947.437350  7401803.467548 
+321976.043524  7401805.457207 
+322011.122989  7401806.327058 
+322045.245891  7401815.905417 
+322073.266583  7401813.385849 
+Region 1
+355
+343659.482271  7390595.647346 
+343657.057879  7390606.285523 
+343648.292136  7390625.042311 
+343623.965756  7390672.784133 
+343581.283266  7390750.190874 
+343537.767907  7390829.067363 
+343523.873008  7390860.571967 
+343496.000748  7390918.891977 
+343475.591328  7390947.437087 
+343437.444265  7390999.768123 
+343408.961784  7391033.782297 
+343373.362806  7391080.464301 
+343339.635723  7391127.716207 
+343317.519332  7391155.361472 
+343282.769716  7391190.905383 
+343256.827075  7391203.183280 
+343211.687208  7391219.330514 
+343161.929452  7391237.497403 
+343064.780609  7391314.114279 
+342971.581710  7391382.822510 
+342888.649369  7391443.642092 
+342883.916032  7391447.591415 
+342864.166310  7391465.758304 
+342828.699272  7391490.654039 
+342812.223303  7391514.969874 
+342768.221416  7391525.878006 
+342747.102820  7391532.316903 
+342627.400536  7391563.001647 
+342477.888128  7391601.765007 
+342316.039359  7391641.988117 
+342167.532991  7391680.431532 
+342024.733015  7391717.365206 
+341884.794481  7391742.980818 
+341733.146299  7391770.296139 
+341619.298839  7391797.421493 
+341566.572440  7391810.609234 
+341513.582162  7391822.747155 
+341459.742522  7391838.884390 
+341392.337833  7391855.461551 
+341213.452352  7391901.733625 
+341113.219418  7391926.309415 
+341092.612088  7391744.560547 
+341093.214062  7391743.520725 
+341085.932641  7391678.021945 
+341078.148199  7391636.499057 
+341072.103712  7391551.963537 
+341067.032280  7391500.942277 
+341059.379778  7391432.014084 
+341046.804276  7391322.802791 
+340930.705595  7391331.491302 
+340843.542937  7391339.929857 
+340804.777407  7391332.021212 
+340725.349713  7391314.904144 
+340691.870017  7391304.655899 
+340626.164051  7391286.219057 
+340596.609560  7391278.570367 
+340568.176557  7391268.302126 
+340506.552476  7391251.325034 
+340511.310551  7391223.279838 
+340529.221364  7391147.782770 
+340410.277733  7391129.335930 
+340349.915324  7391121.197324 
+340314.423548  7391117.457964 
+340232.505492  7391111.129048 
+340266.917013  7391014.555590 
+340275.567309  7390995.018937 
+340324.607643  7390861.331836 
+340338.057245  7390822.568476 
+340382.355996  7390706.278396 
+340561.925914  7390371.665712 
+340624.424096  7390291.769397 
+340644.198558  7390268.033463 
+340682.172450  7390220.571593 
+340717.771427  7390174.689452 
+340743.087355  7390150.953518 
+340808.743844  7390075.806390 
+340813.378225  7390063.258539 
+340841.967907  7390023.595333 
+340878.589417  7389978.523053 
+340921.238922  7389933.500765 
+340952.962172  7389897.946855 
+341001.012958  7389875.840642 
+341145.124084  7389816.100875 
+341187.410755  7389796.864170 
+341263.968761  7389722.146968 
+341284.089563  7389697.291226 
+341296.895959  7389736.724471 
+341350.117132  7389721.037158 
+341339.322816  7389695.031613 
+341336.510852  7389677.084687 
+341370.650246  7389672.065547 
+341391.974999  7389670.485817 
+341413.299751  7389658.637847 
+341517.556845  7389562.274353 
+341544.414819  7389541.737871 
+341564.947933  7389529.889900 
+341673.154971  7389469.080316 
+341763.195564  7389422.478299 
+341766.139468  7389367.297751 
+341765.141674  7389326.894672 
+341764.267574  7389305.918265 
+341762.791499  7389276.763259 
+341758.998232  7389243.728917 
+341755.460600  7389222.722515 
+341750.760248  7389203.965728 
+341835.127434  7389156.403875 
+341819.459596  7389102.823053 
+341806.372828  7389056.141049 
+341797.623577  7389026.666098 
+341787.670376  7388999.930678 
+341756.870705  7388954.908389 
+341726.071033  7388909.896100 
+341707.904587  7388880.671106 
+341695.263116  7388849.866382 
+341669.839987  7388842.297679 
+341672.363333  7388794.575853 
+341674.730001  7388702.171681 
+341673.938363  7388533.150633 
+341681.294001  7388514.493828 
+341691.321418  7388493.227471 
+341712.456507  7388464.112458 
+341738.316686  7388451.324649 
+341795.595004  7388523.822231 
+341822.057158  7388549.687800 
+341833.577142  7388560.225995 
+341850.613855  7388570.484238 
+341856.905729  7388573.763676 
+341878.791225  7388578.432876 
+341897.749309  7388580.742481 
+341939.269081  7388582.522176 
+341980.203370  7388581.972270 
+341993.595248  7388579.682662 
+342013.262508  7388572.913822 
+342034.735693  7388559.856058 
+342061.898777  7388539.109612 
+342073.773349  7388526.611753 
+342080.790891  7388519.372993 
+342097.448277  7388526.531766 
+342109.124940  7388531.980833 
+342119.853286  7388540.289410 
+342125.831803  7388544.448697 
+342134.366652  7388548.308036 
+342147.535882  7388557.306495 
+342165.520911  7388564.485265 
+342189.830799  7388571.724025 
+342203.503049  7388572.423906 
+342216.911420  7388568.804526 
+342231.581465  7388561.435788 
+342245.921660  7388547.408191 
+342275.204025  7388510.514510 
+342300.717862  7388472.251064 
+342332.853423  7388426.528896 
+342354.136944  7388393.084625 
+342377.399561  7388355.461069 
+342398.641851  7388325.676171 
+342416.585649  7388308.929040 
+342448.762441  7388296.651143 
+342459.028998  7388290.452205 
+342470.573721  7388280.493911 
+342509.809287  7388256.887954 
+342544.245546  7388233.671931 
+342613.629330  7388188.009752 
+342652.271167  7388162.624101 
+342677.174784  7388143.957298 
+342706.283978  7388122.450982 
+342800.109590  7388062.331280 
+342837.498000  7388039.365214 
+342878.993033  7388014.559463 
+342908.737187  7387991.843354 
+342949.053008  7387962.928307 
+342968.472881  7387950.290471 
+343020.283949  7387915.526426 
+343068.829508  7387880.052502 
+343142.633273  7387830.670961 
+343178.446652  7387803.035695 
+343199.202415  7387789.637990 
+343211.909856  7387784.458877 
+343224.905916  7387781.499384 
+343237.390709  7387778.419911 
+343263.935326  7387757.883429 
+343295.320479  7387724.229194 
+343313.536403  7387710.131608 
+343334.300412  7387696.513941 
+343358.156757  7387688.575301 
+343377.584876  7387685.015911 
+343385.888831  7387681.896445 
+343391.949810  7387677.857137 
+343400.938201  7387667.548902 
+343411.534608  7387650.051900 
+343426.031481  7387630.605231 
+343439.843918  7387617.907406 
+343451.330917  7387612.268371 
+343463.403399  7387609.968765 
+343479.829890  7387610.358699 
+343509.862662  7387616.447656 
+343632.310941  7387646.112574 
+343655.128261  7387650.121888 
+343680.089601  7387653.601292 
+343700.103203  7387652.811427 
+343721.378478  7387648.062240 
+343747.848879  7387634.724525 
+343761.265496  7387630.435260 
+343781.938796  7387625.006190 
+343790.580846  7387618.127368 
+343799.247634  7387599.940483 
+343806.759950  7387584.633105 
+343812.227201  7387579.264025 
+343819.772502  7387580.003898 
+343825.454155  7387582.943395 
+343832.727331  7387589.892204 
+343843.298998  7387602.959966 
+343853.392385  7387613.808108 
+343871.327936  7387625.296140 
+343889.296473  7387634.354588 
+343916.055491  7387651.031732 
+343928.325883  7387658.470457 
+343940.423103  7387662.699733 
+343955.612660  7387664.409440 
+343977.753789  7387664.979343 
+343989.166572  7387666.319113 
+344002.789345  7387671.228272 
+344014.160897  7387676.327399 
+344024.806781  7387683.086241 
+344034.652780  7387687.955407 
+344040.952901  7387690.904902 
+344047.871488  7387692.524624 
+344062.442578  7387694.234331 
+344076.758034  7387692.174684 
+344105.380701  7387687.495486 
+344121.823685  7387685.675797 
+344151.040080  7387682.886275 
+344210.041860  7387681.306546 
+344234.747567  7387680.566673 
+344257.251531  7387685.575815 
+344280.044112  7387691.244844 
+344298.400221  7387692.654602 
+344315.552381  7387691.844741 
+344328.251576  7387687.885419 
+344340.035440  7387683.356195 
+344349.535098  7387682.126405 
+344356.577379  7387682.206392 
+344363.487720  7387684.825943 
+344372.591559  7387692.454636 
+344377.324895  7387698.593585 
+344383.921880  7387701.763042 
+344390.815728  7387705.932328 
+344400.636989  7387713.351057 
+344410.367541  7387719.769957 
+344418.589033  7387723.619298 
+344427.132128  7387726.478808 
+344438.256293  7387726.268844 
+344447.475579  7387722.929416 
+344452.860368  7387716.010601 
+344461.263277  7387703.252787 
+344470.243422  7387693.274496 
+344479.479200  7387688.605296 
+344491.963993  7387685.305861 
+344504.935314  7387684.116065 
+344531.867504  7387684.735958 
+344557.249401  7387687.555475 
+344581.617013  7387689.695109 
+344618.065353  7387687.865422 
+344628.884407  7387688.315345 
+344640.882673  7387692.214677 
+344663.510330  7387698.673571 
+344654.117873  7387748.874972 
+344643.826577  7387769.441449 
+344625.643638  7387801.086029 
+344607.435961  7387817.693184 
+344584.503194  7387839.849389 
+344582.919917  7387844.588577 
+344545.745910  7387891.260583 
+344527.546479  7387923.695027 
+344507.772018  7387941.102045 
+344482.621014  7387943.091704 
+344469.798125  7387959.298928 
+344455.342483  7387976.805930 
+344449.512398  7387993.163128 
+344443.632836  7388015.229348 
+344447.186961  7388048.063724 
+344452.373840  7388067.560384 
+344458.278141  7388091.256325 
+344464.957588  7388113.822460 
+344472.057593  7388130.669574 
+344479.190582  7388143.687344 
+344488.550054  7388164.373801 
+344512.521846  7388204.886861 
+344534.168202  7388220.074260 
+344561.751843  7388247.759518 
+344582.078802  7388276.164652 
+344586.548259  7388288.412554 
+344592.889610  7388305.999542 
+344609.002745  7388338.943899 
+344613.488695  7388350.041998 
+344621.330860  7388369.948588 
+344635.588593  7388396.004125 
+344655.511486  7388429.358411 
+344678.468992  7388462.742693 
+344742.723621  7388539.519542 
+344707.908035  7388601.258966 
+344673.249128  7388648.450883 
+344664.409169  7388659.439001 
+344647.784768  7388685.894469 
+344617.999383  7388724.997771 
+344611.699262  7388735.276010 
+344588.453138  7388761.841460 
+344573.989250  7388775.309153 
+344560.407708  7388785.597391 
+344548.112578  7388790.206601 
+344534.308388  7388794.015949 
+344514.509188  7388794.235911 
+344493.769918  7388786.457244 
+344471.562819  7388776.338977 
+344431.436661  7388767.270530 
+344403.572647  7388770.320008 
+344380.408985  7388786.367259 
+344317.910803  7388845.687098 
+344291.803237  7388866.263573 
+344247.487993  7388878.311510 
+344275.343761  7388937.651345 
+344297.361196  7388985.803097 
+344315.057607  7389024.316500 
+344326.618823  7389052.931599 
+344277.578489  7389086.155908 
+344232.479854  7389121.769808 
+344188.189349  7389145.835685 
+344160.490260  7389157.373709 
+344091.667219  7389207.995038 
+343954.177816  7389319.795887 
+343933.636455  7389312.687105 
+343899.678477  7389324.535076 
+343849.920722  7389339.542505 
+343759.088491  7389370.347229 
+343684.847676  7389396.412764 
+343647.723146  7389408.260734 
+343556.280694  7389407.100933 
+343424.959471  7389450.123564 
+343346.801697  7389492.776258 
+343297.827333  7389533.839224 
+343254.386190  7389578.071647 
+343272.931963  7389623.483868 
+343300.194002  7389686.283112 
+343359.500892  7389827.928849 
+343368.093465  7389852.134703 
+343425.091411  7389976.823345 
+343456.517796  7390055.299902 
+343478.238368  7390108.400807 
+343542.657921  7390260.874689 
+343554.285107  7390292.379293 
+343578.949582  7390359.227842 
+343591.219974  7390388.512826 
+343627.915700  7390476.117820 
+343666.491567  7390554.604376 
+343664.232100  7390573.751096 
+343659.482271  7390595.647346 
+Region 1
+938
+350975.719518  7389606.286814 
+350975.348438  7389612.595734 
+350973.633222  7389621.214257 
+350969.336935  7389632.132387 
+350963.267710  7389646.799875 
+350957.149007  7389656.038292 
+350951.178736  7389661.067431 
+350945.546560  7389662.677155 
+350933.779189  7389665.876607 
+350930.291033  7389667.616309 
+350926.992541  7389670.685783 
+350922.927149  7389679.274312 
+350918.111351  7389690.852329 
+350916.396135  7389699.260889 
+350915.051999  7389711.088863 
+350916.800200  7389719.747379 
+350919.834813  7389722.546900 
+350925.236094  7389723.376758 
+350929.004621  7389724.076638 
+350932.764903  7389725.116460 
+350934.579073  7389727.456059 
+350936.657123  7389734.014936 
+350936.995219  7389740.773778 
+350939.724721  7389753.091668 
+350939.155731  7389759.400587 
+350936.558169  7389764.029794 
+350931.429013  7389766.519368 
+350926.002993  7389767.909130 
+350917.517622  7389769.038936 
+350905.379171  7389768.908958 
+350898.229689  7389769.168914 
+350894.642578  7389770.468691 
+350891.550242  7389773.538166 
+350890.585433  7389777.957409 
+350889.101111  7389783.256501 
+350889.035141  7389789.785383 
+350891.335840  7389795.014487 
+350894.065342  7389807.112415 
+350894.222020  7389811.991579 
+350892.836654  7389817.840577 
+350888.062086  7389824.999351 
+350880.945589  7389832.448075 
+350871.899474  7389838.896970 
+350862.259630  7389843.226229 
+350855.192611  7389845.695806 
+350849.379018  7389845.635816 
+350841.833717  7389844.565999 
+350833.199914  7389841.046602 
+350826.908040  7389836.997296 
+350818.051588  7389835.247595 
+350812.633814  7389835.627530 
+350808.337528  7389836.807328 
+350805.039036  7389840.316727 
+350803.340313  7389846.275706 
+350802.350765  7389853.794418 
+350801.715805  7389865.422427 
+350800.190252  7389875.480704 
+350797.139147  7389883.759286 
+350792.991293  7389890.248174 
+350791.102906  7389895.657248 
+350789.923695  7389900.956340 
+350791.696635  7389907.285256 
+350797.287579  7389909.454884 
+350809.203383  7389911.894466 
+350825.217562  7389913.284228 
+350848.364732  7389914.843961 
+350855.695631  7389916.803625 
+350859.645575  7389919.613144 
+350861.253590  7389922.282687 
+350860.931987  7389923.832422 
+350859.991917  7389925.932062 
+350855.951264  7389931.311140 
+350851.217928  7389935.690390 
+350844.109677  7389941.939320 
+350836.811763  7389947.178423 
+350813.202804  7389960.446150 
+350797.617428  7389967.045020 
+350785.858304  7389969.464605 
+350778.395465  7389970.384448 
+350769.423566  7389969.524595 
+350760.369205  7389966.665085 
+350754.794753  7389962.945722 
+350746.185688  7389956.766780 
+350742.219251  7389954.847109 
+350736.158271  7389949.138087 
+350729.157222  7389944.858820 
+350716.062207  7389937.750038 
+350701.804475  7389934.830538 
+350691.537917  7389931.181163 
+350679.135587  7389925.962057 
+350672.332446  7389922.902581 
+350657.604678  7389915.773802 
+350646.241372  7389908.794997 
+350632.247519  7389900.566407 
+350625.436133  7389897.396950 
+350619.333922  7389895.787225 
+350613.330666  7389893.837559 
+350606.296631  7389892.767743 
+350599.674908  7389891.597943 
+350594.809632  7389888.778426 
+350589.936110  7389886.068890 
+350584.592552  7389879.809962 
+350577.096728  7389874.310904 
+350568.446433  7389871.891319 
+350563.762574  7389870.411572 
+350560.694976  7389871.371408 
+350558.839574  7389873.011127 
+350557.874765  7389877.100426 
+350557.833534  7389881.089743 
+350557.792303  7389885.738947 
+350557.239805  7389889.498303 
+350555.788469  7389891.367982 
+350553.025981  7389892.007873 
+350547.113434  7389891.937885 
+350542.215173  7389891.887893 
+350539.658841  7389892.087859 
+350536.780907  7389893.717580 
+350532.781485  7389896.227150 
+350527.635837  7389899.936515 
+350525.483571  7389901.136309 
+350524.559993  7389901.786198 
+350521.492395  7389901.976165 
+350519.158712  7389900.516415 
+350515.225260  7389895.827219 
+350510.805280  7389889.468308 
+350503.655798  7389879.649990 
+350496.893889  7389872.601197 
+350486.149051  7389865.182468 
+350477.325584  7389859.553432 
+350469.384464  7389857.373805 
+350458.590148  7389855.594110 
+350451.358204  7389853.644444 
+350448.109189  7389852.274679 
+350446.913485  7389849.715117 
+350443.887119  7389845.705804 
+350436.729390  7389836.987297 
+350430.651918  7389832.498066 
+350421.102783  7389828.858690 
+350406.127628  7389825.489267 
+350390.938072  7389824.339464 
+350377.241083  7389826.079166 
+350370.470927  7389829.118645 
+350365.185093  7389836.927308 
+350360.196124  7389846.175723 
+350357.441883  7389855.784078 
+350355.281370  7389867.832014 
+350354.596933  7389884.659132 
+350356.444089  7389913.354216 
+350359.247807  7389938.299943 
+350364.137822  7389959.396330 
+350367.988812  7389971.724218 
+350368.467093  7389975.493572 
+350367.502284  7389979.912815 
+350364.607857  7389983.212250 
+350358.027365  7389987.791466 
+350352.568360  7389993.270527 
+350347.043386  7390003.958697 
+350345.550818  7390010.037655 
+350344.017019  7390020.765818 
+350343.299597  7390031.164037 
+350341.807029  7390037.242995 
+350340.083567  7390045.861519 
+350338.541522  7390057.029606 
+350337.535482  7390065.218203 
+350332.975316  7390071.927054 
+350325.669156  7390077.946023 
+350306.241037  7390091.473706 
+350289.509435  7390100.822105 
+350279.853099  7390107.041040 
+350268.976320  7390112.580091 
+350260.268301  7390115.479594 
+350252.698261  7390117.499248 
+350244.534493  7390117.419262 
+350235.875951  7390115.669562 
+350225.815549  7390111.140337 
+350220.455499  7390106.651106 
+350216.332384  7390101.072062 
+350208.861299  7390092.363554 
+350202.198345  7390085.534723 
+350193.061521  7390081.015497 
+350182.052803  7390079.455765 
+350171.909939  7390082.895175 
+350162.657669  7390089.564033 
+350151.846860  7390098.752459 
+350142.380187  7390106.071206 
+350136.426409  7390110.000533 
+350125.368214  7390112.990021 
+350106.863672  7390116.449428 
+350099.483296  7390119.698871 
+350091.682361  7390123.608202 
+350084.928699  7390125.637854 
+350075.503257  7390129.197244 
+350065.170730  7390131.196902 
+350036.292430  7390130.457029 
+350008.634573  7390130.836963 
+349984.613303  7390133.686475 
+349952.411772  7390139.335508 
+349924.465296  7390147.244153 
+349910.702337  7390155.962660 
+349896.650760  7390162.351565 
+349877.321596  7390166.360879 
+349867.714737  7390167.710647 
+349861.571295  7390169.190394 
+349855.955612  7390169.690308 
+349854.339351  7390167.790634 
+349853.869316  7390163.581355 
+349851.816004  7390154.922838 
+349848.402065  7390149.783718 
+349841.392769  7390146.614261 
+349834.870000  7390145.884386 
+349825.147694  7390148.333966 
+349797.168234  7390159.672024 
+349785.598772  7390163.101437 
+349776.198069  7390164.221245 
+349766.805613  7390164.561187 
+349758.856246  7390163.481372 
+349753.042654  7390162.541533 
+349738.075745  7390158.842166 
+349719.760867  7390153.343108 
+349712.347505  7390150.493596 
+349709.106737  7390147.364133 
+349706.303018  7390142.674936 
+349703.309637  7390135.676135 
+349701.924270  7390131.666821 
+349695.863290  7390125.517875 
+349681.267462  7390115.619570 
+349670.497885  7390110.860385 
+349659.299504  7390107.640937 
+349648.496942  7390106.201183 
+349637.282068  7390105.091373 
+349624.854998  7390103.191699 
+349616.204702  7390100.442170 
+349597.188894  7390093.493360 
+349582.032323  7390088.684184 
+349571.732780  7390088.134278 
+349563.049500  7390088.714179 
+349556.691656  7390091.193754 
+349553.607566  7390093.483362 
+349550.713139  7390097.442684 
+349549.731837  7390103.301680 
+349550.375043  7390110.510445 
+349555.693862  7390119.418919 
+349560.542646  7390123.898152 
+349565.407922  7390126.827650 
+349568.962047  7390128.857303 
+349571.089574  7390130.766975 
+349571.056590  7390133.316539 
+349568.896077  7390135.726126 
+349562.529987  7390139.095549 
+349551.125450  7390146.174336 
+349534.665974  7390158.852165 
+349529.437864  7390161.121776 
+349525.240532  7390162.521536 
+349522.585246  7390162.491541 
+349518.923919  7390161.571699 
+349515.386286  7390158.212274 
+349510.553995  7390151.623403 
+349504.996036  7390146.474285 
+349500.749227  7390142.444975 
+349495.859212  7390141.505136 
+349490.639348  7390142.564955 
+349486.227615  7390145.284489 
+349483.316695  7390149.903698 
+349482.360133  7390153.443091 
+349482.327148  7390157.202447 
+349485.543178  7390161.891644 
+349495.380931  7390168.300546 
+349502.579890  7390172.809774 
+349506.735991  7390175.179368 
+349509.968513  7390178.868736 
+349510.636458  7390182.858053 
+349510.372578  7390188.947010 
+349508.459453  7390196.345742 
+349506.735991  7390204.964266 
+349506.628790  7390215.712425 
+349507.873970  7390223.031171 
+349511.757945  7390232.819495 
+349515.963523  7390240.278217 
+349518.445638  7390247.396998 
+349519.789774  7390255.495611 
+349518.297206  7390262.004496 
+349514.940990  7390270.393059 
+349509.457247  7390277.751798 
+349499.578262  7390285.400488 
+349486.112168  7390294.568918 
+349474.913786  7390302.207609 
+349460.878702  7390307.376724 
+349452.591240  7390308.956453 
+349447.181713  7390308.896464 
+349441.384613  7390307.176758 
+349435.092739  7390303.567376 
+349428.339076  7390295.638734 
+349423.729433  7390287.390147 
+349421.684368  7390277.851781 
+349422.451267  7390272.432709 
+349425.164277  7390266.253768 
+349431.233503  7390262.104479 
+349443.949190  7390256.365462 
+349449.185547  7390253.106020 
+349450.851285  7390250.346493 
+349452.112959  7390246.377173 
+349452.558255  7390242.727798 
+349451.477999  7390238.508520 
+349448.666034  7390234.269246 
+349438.894251  7390231.839663 
+349426.863000  7390230.499892 
+349414.741041  7390228.270274 
+349406.082499  7390226.410593 
+349398.339289  7390225.330778 
+349390.348691  7390227.800355 
+349383.463089  7390232.599532 
+349378.886431  7390241.188061 
+349373.460411  7390252.656097 
+349369.799084  7390260.924681 
+349365.073994  7390263.974158 
+349359.862376  7390265.023978 
+349353.512779  7390266.623704 
+349350.535890  7390268.693350 
+349344.326478  7390276.831956 
+349335.915323  7390290.699580 
+349328.370022  7390299.918001 
+349322.424489  7390302.187613 
+349317.320073  7390302.907489 
+349310.690103  7390302.067633 
+349302.336671  7390300.427914 
+349294.799617  7390299.348099 
+349285.613316  7390298.818190 
+349273.458372  7390300.347928 
+349256.776247  7390304.607198 
+349234.165083  7390310.136251 
+349221.457641  7390314.765458 
+349212.230109  7390318.544811 
+349205.855773  7390323.134025 
+349200.380276  7390329.382954 
+349197.551819  7390336.661708 
+349195.432537  7390354.358676 
+349197.230216  7390367.896357 
+349197.848683  7390377.204763 
+349196.760181  7390383.503684 
+349196.009774  7390387.263040 
+349193.939970  7390390.012569 
+349190.657970  7390391.852254 
+349182.890021  7390392.442153 
+349170.454705  7390390.872422 
+349162.703248  7390390.572473 
+349154.729143  7390391.932240 
+349142.953526  7390395.571617 
+349132.629245  7390397.241331 
+349125.570471  7390398.161173 
+349120.367100  7390398.551106 
+349117.109839  7390397.081358 
+349113.671161  7390394.271839 
+349106.694849  7390387.662972 
+349104.072548  7390385.093412 
+349101.532709  7390383.963605 
+349097.055006  7390382.473860 
+349094.003900  7390381.444037 
+349091.257906  7390380.314230 
+349088.709820  7390380.284235 
+349085.122710  7390381.683996 
+349081.098549  7390386.073244 
+349065.925485  7390402.420444 
+349054.595164  7390412.378738 
+349048.212582  7390417.407876 
+349040.634296  7390419.877453 
+349033.789924  7390420.247390 
+349029.609085  7390420.207397 
+349022.072030  7390418.357714 
+349014.460760  7390414.508373 
+349006.931951  7390411.668860 
+348995.436705  7390408.219450 
+348964.744235  7390405.359940 
+348949.727849  7390406.639721 
+348928.765931  7390410.079132 
+348912.792982  7390415.118269 
+348902.452209  7390418.667661 
+348896.094365  7390421.707140 
+348889.505627  7390427.176203 
+348875.470542  7390441.533744 
+348858.639985  7390460.410511 
+348852.216172  7390467.849236 
+348840.358092  7390481.266938 
+348834.123942  7390491.945109 
+348828.598967  7390503.513127 
+348788.629487  7390555.384242 
+348756.188816  7390604.435840 
+348721.703079  7390653.607418 
+348708.443140  7390667.345065 
+348686.433951  7390682.262509 
+348670.098168  7390690.301132 
+348657.308264  7390703.318903 
+348625.263412  7390704.878635 
+348441.347730  7390696.989987 
+348368.566498  7390704.898632 
+348320.309556  7390714.397005 
+348260.186289  7390741.292398 
+348238.036913  7390750.780773 
+348203.163604  7390771.377245 
+348142.891904  7390829.807236 
+348044.835975  7390954.235923 
+347898.283964  7391254.294525 
+347907.783622  7391271.701544 
+347814.601216  7391351.257916 
+347799.609568  7391371.704414 
+347750.651697  7391439.652775 
+347719.654116  7391482.305469 
+347707.631112  7391496.952960 
+347672.823772  7391530.177269 
+347628.533267  7391566.571035 
+347574.726612  7391601.375074 
+347541.510795  7391615.612635 
+347508.286732  7391628.270467 
+347405.480974  7391649.626809 
+347341.407762  7391649.626809 
+347272.576475  7391648.047079 
+347247.268793  7391647.257214 
+347192.678746  7391650.416673 
+347142.063383  7391658.325319 
+347096.173109  7391670.193286 
+347066.107352  7391680.481523 
+347015.195124  7391701.957845 
+346952.960821  7391734.272310 
+346889.671001  7391780.154450 
+346704.996666  7391885.286442 
+346755.216211  7391653.586130 
+346767.865928  7391591.876701 
+346778.157224  7391546.784425 
+346777.373832  7391532.546863 
+346771.040727  7391491.413909 
+346765.499260  7391457.399735 
+346748.330608  7391451.690713 
+346736.406558  7391460.999119 
+346723.748594  7391468.767788 
+346633.765726  7391359.706469 
+346622.872455  7391338.000187 
+346607.130401  7391291.318184 
+346582.919467  7391235.027826 
+346558.287977  7391169.429062 
+346510.097005  7391121.967192 
+346491.658433  7391089.102821 
+346482.843212  7391052.159149 
+346468.445294  7391023.883993 
+346459.819736  7390994.369048 
+346452.084772  7390967.893583 
+346450.146908  7390948.156964 
+346450.410787  7390923.691155 
+346454.789536  7390877.289103 
+346455.399757  7390866.151011 
+346463.951098  7390829.247332 
+346464.388148  7390797.692737 
+346460.718575  7390777.606178 
+346455.902777  7390760.389127 
+346443.986974  7390747.751292 
+346429.028311  7390734.083633 
+346424.113558  7390715.986733 
+346416.205422  7390691.090997 
+346406.730503  7390670.394542 
+346401.106574  7390661.696032 
+346390.246288  7390646.078707 
+346378.363470  7390628.701684 
+346369.036983  7390615.064020 
+346366.892963  7390595.557361 
+346366.587853  7390586.028993 
+346362.266828  7390569.481828 
+346352.709446  7390556.424064 
+346343.721055  7390547.135655 
+346330.279699  7390534.477823 
+346322.833353  7390524.209582 
+346320.293514  7390513.551408 
+346313.490374  7390500.523640 
+346306.052273  7390489.705493 
+346301.607555  7390485.336241 
+346300.156219  7390477.457591 
+346295.348666  7390468.769079 
+346287.539486  7390464.369832 
+346282.088727  7390458.440848 
+346280.752838  7390449.572367 
+346283.251446  7390435.194830 
+346278.460386  7390424.736621 
+346271.583029  7390408.939327 
+346263.221351  7390398.441125 
+346258.694171  7390382.663828 
+346251.132377  7390365.706732 
+346259.733196  7390332.622399 
+346258.619955  7390312.675816 
+346260.425879  7390295.528753 
+346260.211477  7390267.953477 
+346257.721116  7390242.447846 
+346257.539699  7390211.333175 
+346257.366528  7390178.988716 
+346260.549573  7390148.014021 
+346266.519844  7390104.881409 
+346272.160266  7390073.496785 
+346274.139361  7390050.030805 
+346272.152019  7390025.764961 
+346266.412643  7390008.197970 
+346261.753522  7389985.341885 
+346290.829732  7389970.594412 
+346353.327914  7389942.909154 
+346446.666998  7389901.756203 
+346482.265976  7389883.559320 
+346533.689470  7389855.884060 
+346555.838846  7389846.395686 
+346596.971044  7389825.029346 
+346613.529476  7389818.170520 
+346642.853072  7389803.673004 
+346682.088637  7389785.596100 
+346689.526737  7389776.777611 
+346727.500629  7389688.172788 
+346744.900176  7389680.264143 
+346789.207173  7389664.446852 
+346824.006267  7389647.039834 
+346862.763551  7389631.212545 
+346901.537327  7389614.605389 
+346914.986929  7389609.066338 
+346937.136305  7389666.816446 
+346942.661279  7389666.016583 
+346945.036194  7389651.779022 
+346998.826356  7389631.212545 
+347092.247903  7389602.337491 
+347103.372068  7389624.803642 
+347111.766731  7389630.872603 
+347120.920047  7389635.421824 
+347132.506001  7389637.541461 
+347155.463507  7389628.053086 
+347179.979551  7389628.842951 
+347198.962374  7389644.390287 
+347263.843717  7389716.647910 
+347274.910158  7389735.634658 
+347278.076711  7389752.251812 
+347277.293319  7389756.211134 
+347325.542015  7389768.079101 
+347351.806259  7389759.660543 
+347365.882575  7389756.201135 
+347384.873644  7389768.069102 
+347414.931155  7389775.977748 
+347456.863238  7389777.567475 
+347455.032574  7389732.195247 
+347452.072178  7389660.187581 
+347444.642324  7389611.815867 
+347434.227335  7389576.031997 
+347427.663335  7389551.276237 
+347422.270300  7389537.198648 
+347408.606296  7389490.406663 
+347349.266420  7389358.289294 
+347304.398679  7389191.807811 
+347311.721332  7389112.731356 
+347320.503568  7389014.618162 
+347283.568701  7388977.594503 
+347309.140262  7388908.016422 
+347324.527728  7388857.994990 
+347337.993823  7388809.903227 
+347336.072451  7388756.032455 
+347328.378718  7388709.860364 
+347314.912623  7388659.848930 
+347282.208073  7388498.246611 
+347270.663350  7388452.074520 
+347243.731160  7388357.810667 
+347211.026610  7388311.638576 
+347161.013221  7388255.848132 
+347116.763947  7388211.605710 
+347070.593302  7388194.288677 
+347005.175954  7388171.202631 
+346951.484746  7388056.922206 
+347316.833995  7388213.535380 
+347382.243097  7388246.239778 
+347477.115980  7388277.604405 
+347543.613584  7388296.081241 
+347815.467070  7388387.875517 
+347900.848542  7388413.761083 
+348155.195280  7388475.740467 
+348188.287404  7388482.649283 
+348226.178833  7388490.307971 
+348332.382038  7388519.662943 
+348377.777538  7388513.813945 
+348449.536237  7388462.552725 
+348518.004690  7388356.880826 
+348540.327236  7388321.976805 
+348566.542003  7388145.996949 
+348543.642221  7388151.625984 
+348523.826529  7388153.885597 
+348486.248456  7388152.355859 
+348451.103020  7388143.267416 
+348414.456772  7388120.881251 
+348437.397785  7388051.263176 
+348474.967612  7387896.399702 
+348505.833253  7387775.370434 
+348543.180432  7387642.613174 
+348546.173814  7387621.106858 
+348569.057104  7387545.669779 
+348579.216460  7387531.412221 
+348599.180584  7387515.814893 
+348644.246235  7387422.550868 
+348664.367037  7387377.438596 
+348666.403856  7387355.312386 
+348664.647409  7387325.667464 
+348657.588636  7387298.502117 
+348654.554023  7387279.775325 
+348655.287938  7387242.481713 
+348665.612218  7387218.465826 
+348677.346605  7387184.311677 
+348680.290509  7387132.590536 
+348680.331740  7387092.227450 
+348681.082147  7387054.943836 
+348683.440569  7387031.767806 
+348686.590629  7387007.461969 
+348691.802247  7386993.864299 
+348696.881925  7386968.078715 
+348700.708176  7386947.602223 
+348698.852774  7386921.416708 
+348686.186564  7386870.785381 
+348679.869951  7386843.889988 
+348670.378540  7386813.835136 
+348667.211987  7386750.545977 
+348643.759707  7386622.447919 
+348680.405956  7386633.626004 
+348694.226639  7386639.195050 
+348706.934080  7386643.754269 
+348719.245702  7386647.093697 
+348734.624923  7386649.693252 
+348746.441771  7386651.812889 
+348759.602755  7386651.722904 
+348780.243071  7386649.063360 
+348795.894416  7386645.234016 
+348817.812897  7386637.485343 
+348834.742409  7386628.806830 
+348850.212338  7386622.317941 
+348871.924663  7386614.789231 
+348896.671601  7386599.991765 
+348914.491705  7386611.989710 
+348971.572114  7386645.513968 
+349021.832890  7386677.758445 
+349059.575887  7386725.230313 
+349111.791020  7386763.203809 
+349136.298817  7386800.777373 
+349194.847055  7386884.263072 
+349213.821632  7386947.922168 
+349217.854039  7387020.969656 
+349218.068441  7387048.005025 
+349220.946375  7387085.198654 
+349221.441149  7387107.854773 
+349232.812701  7387162.725374 
+349242.312359  7387180.922257 
+349263.999945  7387221.015390 
+349309.626339  7387295.052708 
+349335.049468  7387335.155838 
+349366.484100  7387397.475164 
+349377.031029  7387420.541213 
+349385.392707  7387439.357989 
+349397.011646  7387466.633317 
+349403.493183  7387484.660230 
+349408.078087  7387501.877280 
+349411.937323  7387517.954527 
+349421.626644  7387565.356407 
+349448.699019  7387674.407728 
+349449.878230  7387691.574787 
+349462.330038  7387752.734311 
+349483.572329  7387830.740949 
+349504.938312  7387834.700271 
+349548.453671  7387849.727697 
+349568.219886  7387860.805799 
+349585.627679  7387862.385529 
+349667.100438  7387820.462710 
+349754.122910  7387774.580569 
+349832.437362  7387731.857887 
+349898.893735  7387697.053849 
+349967.708530  7387664.619404 
+349982.403313  7387680.346710 
+350001.361397  7387662.849707 
+350067.859001  7387673.237928 
+350088.218945  7387668.018822 
+350100.316165  7387663.159654 
+350110.747647  7387660.830053 
+350116.932320  7387654.911067 
+350126.992721  7387648.592150 
+350134.711193  7387642.363217 
+350146.552780  7387631.964998 
+350152.490066  7387630.365272 
+350166.145824  7387632.054982 
+350176.733984  7387634.594547 
+350190.381496  7387637.284087 
+350202.783827  7387641.843306 
+350225.329022  7387642.733153 
+350236.032629  7387643.183076 
+350247.461905  7387643.403038 
+350256.351341  7387642.063268 
+350270.378180  7387637.774003 
+350284.231847  7387630.495249 
+350294.795269  7387625.396123 
+350305.259735  7387619.967053 
+350318.882508  7387614.907919 
+350327.598774  7387610.338702 
+350348.272074  7387604.569690 
+350371.427490  7387585.872893 
+350383.574188  7387575.694636 
+350400.025418  7387563.576712 
+350414.398598  7387555.088166 
+350435.401747  7387546.329666 
+350446.196063  7387538.690975 
+350463.397700  7387532.991951 
+350476.641147  7387515.524943 
+350487.963221  7387496.038281 
+350493.150101  7387478.151345 
+350498.369965  7387466.683309 
+350504.158818  7387459.214588 
+350516.173576  7387451.585895 
+350535.807852  7387447.356619 
+350568.924714  7387430.419521 
+350595.823918  7387429.319709 
+350657.522216  7387426.150252 
+350707.279972  7387415.062151 
+350746.441321  7387408.923203 
+350782.963877  7387406.593602 
+350818.109312  7387407.963367 
+350833.142190  7387412.702555 
+350851.333375  7387422.990793 
+350932.022742  7387482.320630 
+350961.288614  7387506.846429 
+350985.021266  7387521.873855 
+351010.337194  7387533.741822 
+351036.436514  7387543.240195 
+351132.167006  7387583.533294 
+351149.566552  7387596.191125 
+351197.823494  7387642.073266 
+351216.022925  7387657.110690 
+351246.872074  7387672.927981 
+351264.288113  7387679.046933 
+351325.186527  7387698.243645 
+351417.478340  7387723.089389 
+351447.560589  7387733.707570 
+351443.849786  7387752.824296 
+351445.416569  7387778.929824 
+351445.416569  7387803.455623 
+351452.549559  7387826.391694 
+351462.040970  7387850.917493 
+351484.190346  7387884.931667 
+351596.165912  7388052.063039 
+351618.323534  7388087.656942 
+351643.631215  7388155.685289 
+351650.261185  7388157.305012 
+351639.475115  7388163.733910 
+351622.529111  7388174.302100 
+351611.462670  7388179.171266 
+351606.795303  7388186.879946 
+351611.710057  7388194.788591 
+351613.062438  7388202.107337 
+351598.697505  7388210.495901 
+351592.026304  7388213.855325 
+351585.693199  7388214.235260 
+351581.108295  7388213.415400 
+351576.119325  7388212.585543 
+351570.478903  7388215.525039 
+351565.729075  7388220.674157 
+351557.507583  7388226.133222 
+351552.559844  7388231.622282 
+351550.242653  7388238.131167 
+351549.516985  7388249.749177 
+351553.912226  7388259.207557 
+351558.373437  7388261.467170 
+351568.227682  7388265.776431 
+351564.137552  7388276.584580 
+351558.431160  7388286.492883 
+351552.262980  7388290.972116 
+351544.783649  7388293.111749 
+351535.325222  7388300.220532 
+351531.367031  7388308.259155 
+351525.372022  7388315.727875 
+351517.018590  7388323.946467 
+351514.932294  7388328.465693 
+351514.091178  7388331.225221 
+351515.369344  7388336.004402 
+351517.587580  7388338.573962 
+351521.001519  7388343.703083 
+351520.976781  7388346.252647 
+351517.554595  7388351.971667 
+351516.218706  7388352.961497 
+351516.177475  7388356.720854 
+351517.653550  7388362.609845 
+351522.114761  7388365.419364 
+351523.796992  7388370.308526 
+351522.065283  7388380.146841 
+351520.300590  7388382.566426 
+351515.361098  7388387.275620 
+351508.689897  7388390.974986 
+351501.845526  7388391.574883 
+351495.702084  7388393.724515 
+351488.511371  7388398.193750 
+351483.868743  7388403.122905 
+351482.656547  7388411.421484 
+351486.375597  7388417.550434 
+351487.909396  7388426.758857 
+351494.193024  7388431.588029 
+351500.682807  7388435.747317 
+351503.189661  7388439.646649 
+351504.830661  7388449.304995 
+351498.967591  7388473.380871 
+351497.013235  7388484.988882 
+351492.716948  7388496.016993 
+351489.962707  7388505.845310 
+351482.367929  7388520.062875 
+351470.402648  7388532.560734 
+351465.034352  7388534.570390 
+351438.910293  7388549.077905 
+351438.555705  7388553.387166 
+351437.656866  7388561.685745 
+351437.483696  7388568.324608 
+351442.076846  7388578.782816 
+351446.950368  7388581.052428 
+351448.310996  7388587.491325 
+351447.610067  7388596.229828 
+351441.466625  7388598.709403 
+351437.458957  7388610.967303 
+351435.776726  7388616.266396 
+351433.162671  7388622.545320 
+351431.562902  7388629.064204 
+351427.250123  7388641.312106 
+351420.752094  7388648.340902 
+351413.058360  7388652.470194 
+351410.831878  7388650.670503 
+351406.568577  7388648.300909 
+351406.824210  7388643.541724 
+351407.690064  7388638.012671 
+351407.351969  7388631.363810 
+351402.577401  7388629.544121 
+351399.196447  7388630.513955 
+351380.197131  7388632.423628 
+351361.461695  7388638.102655 
+351354.774002  7388643.791681 
+351349.578877  7388653.040097 
+351345.101174  7388661.628626 
+351342.017083  7388673.896524 
+351336.121028  7388691.443519 
+351331.626833  7388702.031705 
+351328.839607  7388715.069472 
+351320.939718  7388729.387019 
+351315.299296  7388742.174829 
+351304.810091  7388759.341888 
+351295.854684  7388767.330520 
+351284.400670  7388779.508434 
+351275.610188  7388790.716514 
+351269.483239  7388801.724628 
+351269.903796  7388810.263166 
+351272.262218  7388818.921683 
+351277.028540  7388831.929455 
+351281.918554  7388842.607626 
+351282.751424  7388851.696069 
+351283.196720  7388868.093260 
+351284.326454  7388877.181703 
+351288.523785  7388896.058470 
+351292.729363  7388903.957117 
+351295.054800  7388916.055045 
+351297.792548  7388927.273123 
+351301.660031  7388938.941124 
+351303.911251  7388968.306095 
+351306.772694  7388977.974438 
+351306.739709  7388990.822238 
+351305.824377  7389000.660552 
+351301.338428  7389010.478871 
+351294.502302  7389020.147215 
+351289.117514  7389028.175839 
+351275.799851  7389042.553377 
+351271.478826  7389046.492702 
+351254.351405  7389064.149677 
+351243.928170  7389076.117627 
+351237.900175  7389086.355874 
+351231.699010  7389093.824594 
+351228.961261  7389102.103176 
+351225.283442  7389112.581381 
+351222.710618  7389124.739299 
+351214.447895  7389134.397645 
+351205.904800  7389141.846369 
+351195.968092  7389155.254072 
+351194.747650  7389164.652462 
+351177.282134  7389206.225341 
+351169.761571  7389223.312414 
+351159.767140  7389243.039035 
+351156.270738  7389255.626879 
+351145.929965  7389278.442971 
+351139.547382  7389294.210270 
+351133.824498  7389315.086694 
+351132.826704  7389322.605406 
+351134.632629  7389335.803146 
+351134.212071  7389357.059505 
+351129.363287  7389361.998659 
+351123.384770  7389367.697682 
+351115.839469  7389377.146064 
+351110.372218  7389382.845088 
+351102.637254  7389391.073678 
+351097.879179  7389397.002663 
+351092.684053  7389405.811154 
+351088.387767  7389416.619303 
+351083.035964  7389421.328496 
+351073.338396  7389421.118532 
+351064.630377  7389425.017864 
+351061.010282  7389429.517093 
+351055.031764  7389435.216117 
+351051.411669  7389440.165269 
+351051.048835  7389445.254398 
+351045.226996  7389446.304218 
+351040.320489  7389446.474189 
+351038.094007  7389445.234401 
+351034.366710  7389439.875319 
+351032.173213  7389435.206119 
+351026.681223  7389433.376432 
+351024.133138  7389432.796532 
+351017.000149  7389431.726715 
+351014.089229  7389427.377460 
+351009.298169  7389426.777563 
+351004.721511  7389425.177837 
+351002.692938  7389423.388143 
+351000.977722  7389421.488468 
+350998.775979  7389417.699118 
+350994.694095  7389417.659124 
+350991.931607  7389418.069054 
+350990.034974  7389423.808071 
+350989.878296  7389428.907198 
+350988.806286  7389433.986328 
+350980.782704  7389440.665184 
+350966.879559  7389452.483159 
+350955.606961  7389457.352325 
+350943.485002  7389465.200981 
+350929.656074  7389470.260114 
+350912.330743  7389477.278912 
+350898.716216  7389481.348215 
+350890.338046  7389482.927944 
+350881.630026  7389486.047410 
+350877.836760  7389487.227208 
+350872.559173  7389494.705927 
+350868.600982  7389502.754548 
+350864.040816  7389522.891099 
+350855.852309  7389577.441755 
+350885.678926  7389595.798611 
+350887.971378  7389614.145468 
+350878.793323  7389639.391144 
+350899.450131  7389639.391144 
+350959.103363  7389602.677432 
+350968.165971  7389604.647095 
+350975.719518  7389606.286814 
+Region 1
+624
+353400.210283  7401391.408130 
+353398.668238  7401399.726705 
+353396.821082  7401405.275756 
+353394.355459  7401408.355227 
+353391.889836  7401410.824804 
+353386.035012  7401411.434699 
+353372.478209  7401411.434699 
+353353.990160  7401410.204910 
+353344.127668  7401412.364540 
+353339.814890  7401416.063906 
+353336.120578  7401423.142694 
+353334.578533  7401429.921533 
+353333.654955  7401441.019632 
+353333.341599  7401450.258049 
+353335.502111  7401459.506465 
+353343.204090  7401486.931767 
+353350.906070  7401509.727863 
+353359.226517  7401530.064379 
+353372.783320  7401552.560526 
+353381.103767  7401567.957888 
+353388.500635  7401581.825513 
+353395.279037  7401596.922927 
+353408.835840  7401619.419073 
+353423.316221  7401646.834377 
+353433.277668  7401664.651326 
+353443.651426  7401681.038519 
+353447.964205  7401690.586883 
+353456.903119  7401729.410233 
+353459.368742  7401752.216326 
+353460.292319  7401775.322369 
+353459.781053  7401781.101379 
+353457.826696  7401796.888674 
+353450.124717  7401854.198858 
+353437.796602  7401932.765400 
+353434.712512  7401953.721810 
+353427.818663  7401980.027304 
+353420.850598  7402007.642574 
+353411.301463  7402029.828774 
+353404.044780  7402037.947383 
+353404.646755  7402038.407305 
+353372.593656  7402079.750223 
+353339.179930  7402122.042978 
+353300.966897  7402157.266945 
+353263.817628  7402182.392641 
+353236.596821  7402205.138745 
+353224.887173  7402214.697108 
+353213.795993  7402221.785893 
+353199.315612  7402229.484575 
+353167.757287  7402239.842800 
+353154.002575  7402244.761958 
+353134.343561  7402256.060023 
+353108.796738  7402265.888339 
+353075.877785  7402277.676320 
+353027.719798  7402292.913710 
+352992.838243  7402303.231942 
+352946.824276  7402314.340040 
+352926.489071  7402307.561201 
+352904.925178  7402302.622047 
+352880.887415  7402299.542574 
+352856.857899  7402301.392258 
+352830.972981  7402305.091624 
+352808.790621  7402313.100252 
+352790.921039  7402322.958563 
+352773.051457  7402335.286452 
+352753.944941  7402348.224236 
+352737.922515  7402359.322335 
+352720.052933  7402366.711069 
+352700.336195  7402374.729696 
+352681.229679  7402377.809168 
+352627.002466  7402375.959485 
+352559.218450  7402374.109802 
+352532.715065  7402369.800540 
+352509.914237  7402361.781913 
+352496.975901  7402353.773285 
+352488.968812  7402341.445397 
+352485.266254  7402327.887719 
+352484.656033  7402311.870463 
+352487.121656  7402300.162468 
+352492.044656  7402287.834580 
+352510.532705  7402266.268274 
+352517.311106  7402260.719224 
+352525.936664  7402258.259646 
+352545.661647  7402257.639752 
+352571.538319  7402253.940386 
+352594.957614  7402249.011230 
+352620.842532  7402240.382708 
+352643.643360  7402228.064818 
+352666.444188  7402214.507140 
+352688.008081  7402204.028935 
+352710.808908  7402192.320940 
+352765.654588  7402174.454001 
+352818.653113  7402160.276429 
+352850.079498  7402151.038012 
+352872.261858  7402142.409490 
+352882.734571  7402133.161074 
+352891.978596  7402118.993501 
+352899.375465  7402102.966246 
+352904.306711  7402074.001208 
+352903.069776  7402051.205112 
+352896.291374  7402032.718279 
+352880.268948  7402005.602924 
+352872.880326  7401985.886301 
+352863.636301  7401959.390839 
+352856.857899  7401934.735063 
+352855.010744  7401910.709178 
+352855.010744  7401888.522978 
+352854.392276  7401871.885828 
+352851.926653  7401862.637412 
+352840.835473  7401850.929418 
+352822.965891  7401836.751846 
+352814.332088  7401831.822691 
+352802.012219  7401828.743218 
+352788.455416  7401827.513429 
+352779.211392  7401829.983006 
+352767.501744  7401836.751846 
+352754.563408  7401855.858573 
+352742.853761  7401876.195090 
+352732.991269  7401895.301817 
+352729.296957  7401912.548863 
+352720.052933  7401932.885379 
+352705.877662  7401962.470312 
+352684.313769  7401986.496196 
+352668.901564  7402006.222817 
+352656.581696  7402013.001656 
+352643.024892  7402016.691024 
+352631.315245  7402016.691024 
+352620.224065  7402010.532079 
+352605.430327  7401996.364506 
+352594.339147  7401982.806828 
+352587.560745  7401968.629257 
+352587.560745  7401940.284112 
+352591.263303  7401918.717806 
+352603.583171  7401884.203718 
+352630.086557  7401847.230051 
+352654.734540  7401824.433956 
+352671.367187  7401799.778180 
+352677.535368  7401778.211874 
+352676.298433  7401757.265462 
+352674.451277  7401741.238207 
+352671.367187  7401730.150106 
+352662.741630  7401720.901690 
+352627.002466  7401696.255912 
+352580.172122  7401669.140557 
+352538.883246  7401653.733196 
+352517.929574  7401649.423934 
+352497.594369  7401649.423934 
+352479.106320  7401654.353090 
+352458.193879  7401661.551856 
+352441.520000  7401667.290873 
+352419.947861  7401678.388972 
+352395.918345  7401694.406229 
+352379.895919  7401706.734117 
+352363.255025  7401718.442112 
+352341.072665  7401726.450740 
+352329.981485  7401727.680529 
+352306.562190  7401724.601057 
+352281.295739  7401719.671901 
+352251.716510  7401714.742745 
+352225.221371  7401712.283167 
+352183.314026  7401712.283167 
+352158.666043  7401717.822218 
+352134.018060  7401728.300423 
+352113.064387  7401741.238207 
+352085.950781  7401764.044300 
+352064.386888  7401785.610606 
+352053.287462  7401798.548390 
+352032.952257  7401810.876279 
+352020.632388  7401816.425328 
+351991.053159  7401820.114696 
+351968.870798  7401820.734590 
+351931.276233  7401812.106068 
+351897.384225  7401799.168284 
+351872.736242  7401781.291346 
+351857.332283  7401767.123773 
+351844.385701  7401749.866729 
+351832.684299  7401730.150106 
+351819.737717  7401711.663273 
+351800.639447  7401688.247284 
+351783.380086  7401665.441190 
+351767.976127  7401654.972983 
+351750.106546  7401651.883513 
+351731.618496  7401658.662351 
+351716.833005  7401670.990240 
+351699.507674  7401699.715319 
+351698.344956  7401699.955278 
+351670.612882  7401733.229579 
+351620.079981  7401778.831767 
+351585.569505  7401808.406702 
+351558.455899  7401830.592901 
+351542.433473  7401847.230051 
+351526.411047  7401855.858573 
+351511.625555  7401862.017518 
+351498.687219  7401862.017518 
+351486.359105  7401857.088363 
+351470.336678  7401846.000262 
+351451.848629  7401830.592901 
+351433.979047  7401811.496172 
+351405.636753  7401780.061557 
+351386.530236  7401760.344934 
+351387.049749  7401744.757604 
+351385.911769  7401716.282482 
+351385.293302  7401697.175754 
+351374.202122  7401673.139872 
+351362.385273  7401649.943845 
+351344.012671  7401630.937100 
+351339.081425  7401611.220478 
+351329.837401  7401590.883961 
+351324.906155  7401565.618289 
+351324.287687  7401539.112829 
+351327.371778  7401512.007472 
+351336.615802  7401478.113278 
+351344.012671  7401451.617816 
+351348.943917  7401434.360772 
+351350.172605  7401417.723622 
+351351.401294  7401406.015627 
+351348.325450  7401399.846684 
+351343.394204  7401394.917528 
+351329.218933  7401388.138690 
+351365.485856  7401396.067332 
+351385.631397  7401401.226448 
+351414.864285  7401410.804807 
+351445.325861  7401416.463838 
+351470.633543  7401420.633124 
+351493.731235  7401422.352829 
+351518.296756  7401422.112870 
+351536.232307  7401419.163375 
+351552.691784  7401413.024427 
+351571.113863  7401403.196110 
+351581.677285  7401394.837542 
+351587.573340  7401386.488972 
+351602.070213  7401359.213644 
+351610.176258  7401334.157936 
+351616.072313  7401306.892606 
+351621.481840  7401281.097025 
+351623.197056  7401265.619676 
+351622.463141  7401257.751024 
+351620.005765  7401250.872202 
+351614.357097  7401242.763591 
+351598.384148  7401223.356915 
+351557.359150  7401180.364280 
+351519.278057  7401141.550928 
+351475.053522  7401096.348671 
+351464.490101  7401086.760313 
+351448.525398  7401074.722375 
+351443.363258  7401070.553089 
+351438.943278  7401062.934394 
+351418.797737  7401018.961926 
+351414.130370  7401008.143779 
+351398.907829  7400963.931353 
+351393.737442  7400948.204046 
+351362.533705  7400842.812099 
+351334.529506  7400747.728386 
+351306.277920  7400650.934966 
+351282.198926  7400573.058306 
+351271.536550  7400560.490458 
+351292.646900  7400556.381162 
+351313.476879  7400556.161200 
+351323.438326  7400554.021566 
+351396.367989  7400578.147434 
+351475.540050  7400620.890112 
+351523.566097  7400659.093568 
+351534.319182  7400666.642275 
+351575.500858  7400698.876754 
+351616.847458  7400744.408955 
+351648.562461  7400773.334000 
+351678.768404  7400733.370845 
+351691.261444  7400711.214641 
+351705.601639  7400691.398035 
+351719.216166  7400658.703635 
+351738.256712  7400580.147091 
+351759.952545  7400544.823142 
+351776.659408  7400522.017048 
+351953.376131  7400587.255874 
+351995.423661  7400588.655634 
+352089.851248  7400575.907817 
+352134.380894  7400568.489088 
+352147.879973  7400563.929869 
+352159.226787  7400554.731445 
+352168.272902  7400546.222902 
+352176.618087  7400535.014822 
+352181.936906  7400522.946889 
+352184.666408  7400508.129427 
+352186.991845  7400494.061837 
+352188.138071  7400481.114055 
+352187.742252  7400468.486218 
+352186.546549  7400456.988187 
+352168.990324  7400346.717076 
+352167.844098  7400337.238699 
+352160.991480  7400293.186245 
+352150.691938  7400189.983923 
+352152.868943  7400155.229876 
+352158.410410  7400130.054188 
+352167.011228  7400104.888499 
+352170.985912  7400096.030016 
+352182.530634  7400075.963453 
+352194.471176  7400063.805536 
+352239.990370  7400009.864775 
+352277.741613  7399971.521343 
+352293.590869  7399948.315318 
+352302.472059  7399937.687139 
+352314.956852  7399903.772948 
+352319.822128  7399868.269030 
+352324.926545  7399846.862696 
+352328.901228  7399827.815959 
+352336.834102  7399794.491667 
+352344.783469  7399765.916562 
+352359.049448  7399718.334712 
+352359.041201  7399718.334712 
+352379.689763  7399666.723552 
+352409.722535  7399608.703491 
+352423.337062  7399584.197688 
+352443.969131  7399553.242991 
+352477.300395  7399498.492369 
+352510.631659  7399428.654332 
+352541.579763  7399349.297925 
+352570.136460  7399288.988255 
+352585.639373  7399248.065265 
+352636.007350  7399109.648974 
+352633.962285  7399077.244525 
+352632.040913  7399055.678219 
+352628.866114  7399028.672845 
+352628.866114  7398997.748142 
+352624.800723  7398949.186460 
+352619.539628  7398913.272612 
+352623.101999  7398898.765097 
+352618.179000  7398891.476345 
+352615.383527  7398847.763833 
+352613.000367  7398823.168046 
+352611.301643  7398792.113365 
+352610.262618  7398777.205919 
+352611.582015  7398754.679777 
+352612.010819  7398748.190889 
+352631.249275  7398647.788087 
+352634.580752  7398595.906974 
+352629.987602  7398546.215485 
+352623.926622  7398489.635177 
+352604.119176  7398285.270183 
+352595.823468  7398215.932060 
+352595.213247  7398195.295595 
+352588.179212  7398148.033690 
+352587.750408  7398121.518232 
+352590.933453  7398105.111043 
+352589.828459  7398100.141894 
+352592.368298  7398093.093101 
+352594.743212  7398072.456636 
+352612.200482  7398043.091666 
+352636.807235  7398005.008189 
+352667.590414  7397961.275680 
+352672.513413  7397904.235451 
+352673.610162  7397878.929785 
+352651.881344  7397811.391354 
+352590.273755  7397768.678670 
+352562.261310  7397751.121678 
+352533.638643  7397733.664668 
+352510.582182  7397701.210227 
+352494.617480  7397673.584959 
+352475.675888  7397628.102750 
+352447.572734  7397559.484503 
+352505.073700  7397528.879746 
+352536.087773  7397523.120732 
+352576.733444  7397573.082174 
+352625.221280  7397596.428175 
+352686.284618  7397603.606946 
+352768.895357  7397608.996023 
+352879.609250  7397623.223586 
+352959.787350  7397609.825880 
+353013.750684  7397582.050638 
+353078.030052  7397559.034581 
+353135.168184  7397547.926483 
+353195.406899  7397545.846839 
+353261.253050  7397564.003729 
+353298.427058  7397580.860842 
+353406.271262  7397620.304086 
+353445.737722  7397636.421325 
+353459.261541  7397647.029508 
+353469.049816  7397651.108809 
+353501.671905  7397664.976434 
+353513.076442  7397673.125038 
+353572.045237  7397686.542740 
+353619.922852  7397678.844058 
+353673.671784  7397658.727504 
+353739.353011  7397594.438516 
+353814.476172  7397519.731313 
+353834.382573  7397548.216434 
+353838.118115  7397555.125250 
+353842.208246  7397564.733604 
+353845.877818  7397578.131309 
+353848.277471  7397599.737608 
+353854.231250  7397617.554557 
+353857.950300  7397625.993111 
+353868.670400  7397652.748528 
+353886.605951  7397715.537773 
+353894.547072  7397732.944791 
+353902.108865  7397740.003582 
+353919.236286  7397738.373861 
+353976.399157  7397735.564343 
+353977.396951  7397769.558520 
+353975.896137  7397797.303767 
+353972.647122  7397826.548758 
+353964.153504  7397862.542592 
+353956.154661  7397901.785870 
+353954.901234  7397917.783130 
+353956.649435  7397925.781760 
+353959.403676  7397936.279962 
+353966.899499  7397951.277393 
+353974.403569  7397969.024353 
+353979.648172  7397987.271227 
+353980.901599  7398003.768402 
+353978.402991  7398017.016132 
+353973.653162  7398031.013735 
+353970.898921  7398044.011508 
+353968.152926  7398065.007912 
+353967.897293  7398082.754872 
+353969.901127  7398101.501661 
+353972.152348  7398113.749563 
+353979.895559  7398134.745966 
+353986.896609  7398150.493269 
+353989.395216  7398159.241770 
+353991.893824  7398181.487960 
+353992.644231  7398207.233550 
+353985.395795  7398232.479226 
+353975.401363  7398253.975543 
+353963.155710  7398279.721133 
+353954.150827  7398303.217109 
+353948.114586  7398321.703942 
+353946.407616  7398339.460901 
+353947.900184  7398350.708974 
+353951.899606  7398364.956533 
+353960.401469  7398382.953451 
+353980.645966  7398409.448912 
+354005.648537  7398433.194845 
+354018.891983  7398446.442576 
+354022.891405  7398454.441205 
+354026.396053  7398464.439493 
+354028.894661  7398478.687052 
+354027.888621  7398493.434526 
+354024.392219  7398512.681229 
+354021.390591  7398533.427676 
+354020.145410  7398554.174122 
+354021.390591  7398577.920055 
+354021.646224  7398599.666330 
+354019.395004  7398611.164360 
+354013.144361  7398625.911834 
+354004.898130  7398637.159907 
+354001.393482  7398645.908409 
+353999.397894  7398656.406611 
+353999.307186  7398669.034448 
+354001.146095  7398692.400445 
+354001.896502  7398712.147063 
+354001.146095  7398736.392910 
+353997.146673  7398773.636530 
+353993.394638  7398790.883576 
+353989.395216  7398804.131307 
+353982.897187  7398817.379037 
+353966.149092  7398840.875013 
+353958.900655  7398851.873129 
+353955.651641  7398859.871759 
+353954.917726  7398865.230841 
+353953.153033  7398872.869532 
+353951.157445  7398898.115208 
+353949.656631  7398926.610327 
+353947.652797  7398944.107330 
+353944.906802  7398957.355061 
+353936.050350  7398991.429224 
+353920.654638  7399035.841617 
+353910.660206  7399050.589091 
+353896.814785  7399070.935606 
+353882.161233  7399094.331598 
+353868.167380  7399119.827231 
+353852.664466  7399150.072050 
+353848.063069  7399159.250478 
+353840.921834  7399173.318068 
+353835.916372  7399189.565285 
+353827.670141  7399216.810618 
+353818.920890  7399244.305909 
+353811.177680  7399269.801542 
+353806.675238  7399291.047902 
+353804.176630  7399318.543193 
+353802.172796  7399344.288783 
+353797.175580  7399376.283302 
+353793.176158  7399404.028550 
+353792.788585  7399412.987015 
+353792.178364  7399436.023069 
+353793.679178  7399457.269430 
+353799.921575  7399484.014849 
+353808.670826  7399499.512194 
+353821.675131  7399516.259326 
+353835.322643  7399529.377079 
+353843.420442  7399537.755643 
+353860.168536  7399547.503974 
+353882.416866  7399557.002347 
+353892.658685  7399564.251105 
+353899.907121  7399573.249564 
+353907.163804  7399589.496781 
+353911.410613  7399612.742799 
+353915.657422  7399635.488903 
+353919.904231  7399657.485135 
+353923.408879  7399665.733722 
+353929.156502  7399675.732009 
+353947.652797  7399689.979569 
+353968.400313  7399708.226443 
+353981.899393  7399718.224731 
+354005.392904  7399735.471777 
+354020.640184  7399748.219593 
+354034.889671  7399765.466639 
+354045.139736  7399783.963470 
+354051.637765  7399798.211030 
+354057.385388  7399811.958675 
+354064.386438  7399823.956620 
+354072.632669  7399832.955079 
+354075.881683  7399840.703751 
+354078.611186  7399853.731520 
+354079.138945  7399864.699641 
+354076.887724  7399879.947029 
+354072.632669  7399901.693304 
+354069.383654  7399927.688851 
+354069.886674  7399947.935383 
+354072.888302  7399965.182429 
+354078.883311  7399982.179518 
+354087.137788  7399995.677206 
+354097.379607  7400007.925108 
+354109.880892  7400020.922881 
+354115.438852  7400026.181980 
+354120.881364  7400033.170783 
+354131.873590  7400061.665902 
+354138.627252  7400082.412349 
+354145.125282  7400104.158624 
+354156.373141  7400138.152801 
+354163.126804  7400158.149376 
+354166.870592  7400172.396935 
+354171.125647  7400202.391797 
+354176.617637  7400243.884690 
+354181.367466  7400285.127625 
+354184.121707  7400304.124371 
+354189.366310  7400337.118720 
+354195.616952  7400360.114781 
+354199.368987  7400369.863111 
+354211.490946  7400382.330975 
+354217.955991  7400390.349602 
+354221.963659  7400398.358230 
+354225.047750  7400408.526488 
+354225.971327  7400414.685433 
+354225.352860  7400420.234483 
+354222.582127  7400427.933166 
+354219.498036  7400434.712003 
+354217.650881  7400443.340525 
+354214.880147  7400457.828043 
+354214.880147  7400467.686355 
+354214.880147  7400481.543981 
+354216.727303  7400492.952027 
+354216.727303  7400503.730181 
+354214.880147  7400514.208386 
+354209.948901  7400526.836223 
+354201.933565  7400543.483371 
+354198.857721  7400552.721789 
+354197.315676  7400559.190681 
+354196.392098  7400569.358939 
+354194.544942  7400595.244505 
+354193.613118  7400604.482923 
+354191.056787  7400612.751506 
+354185.606028  7400630.368489 
+354182.835295  7400637.767221 
+354179.132737  7400643.616220 
+354169.888713  7400656.863950 
+354167.117979  7400664.262683 
+354163.728779  7400675.350784 
+354160.034467  7400696.617141 
+354155.721689  7400722.802656 
+354150.171975  7400745.298802 
+354141.233061  7400785.661888 
+354137.538750  7400804.448670 
+354131.989037  7400823.245451 
+354124.905525  7400846.351493 
+354111.653832  7400875.316531 
+354100.257541  7400899.352414 
+354090.708406  7400918.759090 
+354084.622688  7400935.226269 
+354082.693070  7400939.715500 
+354075.914668  7400960.361964 
+354073.143935  7400969.600381 
+354070.983422  7400980.698480 
+354066.670644  7401007.803838 
+354063.586554  7401027.530459 
+354061.739398  7401035.539087 
+354055.719650  7401051.656326 
+354050.648218  7401063.574285 
+354037.709882  7401092.229376 
+354027.542279  7401111.026157 
+354019.840300  7401120.884468 
+353999.505095  7401141.840878 
+353985.016468  7401156.008451 
+353973.620177  7401163.407184 
+353958.826439  7401168.336340 
+353944.040948  7401169.566129 
+353908.912005  7401169.256182 
+353891.660891  7401171.725759 
+353880.874821  7401176.654915 
+353849.135079  7401192.062276 
+353831.883965  7401201.300693 
+353821.097895  7401205.929900 
+353797.678600  7401212.088845 
+353783.198219  7401216.398107 
+353767.489150  7401224.106787 
+353753.289141  7401231.935446 
+353731.436629  7401243.203516 
+353720.963916  7401247.212829 
+353679.675040  7401250.292301 
+353667.965392  7401252.761878 
+353658.408011  7401256.151298 
+353647.316830  7401263.240084 
+353605.722843  7401296.824331 
+353580.151282  7401319.620426 
+353567.823167  7401328.868842 
+353557.037097  7401333.488051 
+353543.480294  7401337.187417 
+353524.992245  7401338.727153 
+353443.956537  7401341.496679 
+353423.621332  7401345.196045 
+353414.072197  7401349.195360 
+353409.140951  7401353.204674 
+353405.133283  7401357.823882 
+353402.362549  7401361.523249 
+353400.820504  7401364.912668 
+353400.210283  7401391.408130 
+Region 1
+800
+349021.832890  7386677.758445 
+348971.572114  7386645.513968 
+348914.491705  7386611.989710 
+348896.671601  7386599.991765 
+348907.020621  7386595.442545 
+348926.267323  7386589.773516 
+348939.362337  7386586.254118 
+348951.261648  7386580.725066 
+348961.552944  7386572.086545 
+348972.858526  7386563.787967 
+348988.806736  7386550.880178 
+349009.752162  7386539.142188 
+349032.783884  7386522.215088 
+349052.822225  7386508.027518 
+349062.692963  7386500.818753 
+349072.233852  7386492.660150 
+349076.909464  7386488.120928 
+349086.565800  7386481.462068 
+349098.258955  7386475.603072 
+349117.761291  7386464.724935 
+349131.012984  7386456.116410 
+349145.138777  7386451.387220 
+349159.561434  7386448.547706 
+349166.397559  7386448.067789 
+349192.933929  7386448.117780 
+349215.404908  7386445.588213 
+349231.361364  7386441.868850 
+349240.374494  7386438.309460 
+349254.525026  7386431.810573 
+349283.065230  7386415.053444 
+349292.498918  7386410.614204 
+349310.145852  7386401.375786 
+349323.240866  7386395.556783 
+349342.339136  7386386.758290 
+349348.177468  7386384.048754 
+349349.505111  7386374.320421 
+349350.082347  7386367.901520 
+349350.247272  7386361.372639 
+349349.018583  7386352.164216 
+349347.352845  7386345.615338 
+349344.969684  7386339.056461 
+349342.677232  7386334.267282 
+349339.758066  7386330.028008 
+349336.756438  7386324.019037 
+349334.381524  7386316.800273 
+349332.550861  7386296.623730 
+349330.984077  7386280.436502 
+349330.316132  7386266.478893 
+349329.714157  7386245.092556 
+349331.619037  7386228.835341 
+349337.284197  7386214.057872 
+349341.745408  7386206.899099 
+349348.985598  7386187.712385 
+349354.065276  7386170.265374 
+349355.895940  7386160.537040 
+349363.573180  7386118.534235 
+349370.508260  7386079.730881 
+349372.149260  7386068.452813 
+349374.351004  7386062.823777 
+349382.399325  7386044.306949 
+349385.120581  7386038.237989 
+349386.192591  7386033.158859 
+349386.448224  7386028.179712 
+349387.421279  7386022.760640 
+349388.823139  7386015.021965 
+349392.014430  7386002.764065 
+349395.477847  7385993.385671 
+349406.395856  7385973.679047 
+349409.644871  7385965.740407 
+349411.508519  7385962.320993 
+349419.647549  7385954.982250 
+349424.521071  7385947.283568 
+349428.141166  7385942.674358 
+349431.019101  7385940.484733 
+349441.376366  7385936.165473 
+349449.993677  7385931.046350 
+349459.864416  7385923.837584 
+349466.750018  7385919.038406 
+349475.507515  7385911.269737 
+349481.791143  7385905.130789 
+349496.238539  7385889.443476 
+349504.476523  7385882.434676 
+349510.042729  7385876.515690 
+349517.835417  7385863.197971 
+349518.940412  7385855.119355 
+349513.737040  7385844.771128 
+349507.948186  7385842.161575 
+349498.085695  7385839.292066 
+349491.274308  7385836.892477 
+349487.744921  7385832.323260 
+349484.256766  7385824.754556 
+349486.565710  7385818.685596 
+349488.717977  7385807.637488 
+349493.904856  7385799.378903 
+349498.827855  7385786.811056 
+349504.328091  7385777.782602 
+349506.059800  7385758.865843 
+349506.933900  7385743.038554 
+349507.074086  7385729.190926 
+349511.304402  7385714.613423 
+349511.477573  7385698.226230 
+349510.364332  7385687.368089 
+349509.160382  7385675.500122 
+349508.253297  7385664.641982 
+349507.717292  7385647.464925 
+349509.894297  7385634.317177 
+349512.574322  7385621.719335 
+349517.464337  7385612.680883 
+349519.113583  7385600.632946 
+349521.026708  7385593.894101 
+349517.340643  7385575.357276 
+349513.135066  7385567.568610 
+349512.500106  7385559.699958 
+349513.835995  7385548.861814 
+349518.874442  7385534.844215 
+349523.492331  7385522.486332 
+349526.164110  7385511.218262 
+349534.789667  7385495.920883 
+349542.829742  7385478.053943 
+349547.200244  7385469.795358 
+349553.953907  7385457.797413 
+349568.302349  7385442.220081 
+349570.198982  7385436.031141 
+349570.281444  7385428.392450 
+349564.929640  7385422.583445 
+349561.177605  7385419.993888 
+349556.139158  7385414.624808 
+349552.741711  7385407.066103 
+349552.510817  7385400.197279 
+349553.426148  7385390.678910 
+349561.070404  7385381.120547 
+349567.040675  7385375.871446 
+349580.490277  7385368.472713 
+349600.305970  7385365.913152 
+349619.767074  7385358.584407 
+349632.482762  7385352.175505 
+349645.256173  7385340.687473 
+349659.151072  7385329.199441 
+349666.803574  7385319.201153 
+349668.205433  7385311.462479 
+349676.179538  7385300.694323 
+349689.365261  7385278.128189 
+349701.775838  7385262.300900 
+349706.204064  7385248.063338 
+349707.869802  7385234.675632 
+349711.275495  7385221.097957 
+349716.280957  7385211.069675 
+349717.592108  7385202.221191 
+349718.730088  7385190.933124 
+349716.346927  7385174.965859 
+349713.238098  7385159.538502 
+349712.347505  7385147.130627 
+349712.446460  7385137.602259 
+349716.124279  7385127.014073 
+349722.374922  7385114.446228 
+349734.422665  7385104.277968 
+349740.079579  7385099.348812 
+349743.971800  7385088.540663 
+349747.624880  7385080.492042 
+349755.079473  7385069.713888 
+349762.294925  7385062.255166 
+349767.646728  7385057.995895 
+349775.554863  7385053.316697 
+349783.528968  7385041.208771 
+349786.464627  7385033.930018 
+349791.824676  7385028.670918 
+349796.434319  7385027.061194 
+349804.367193  7385019.502489 
+349809.488103  7385017.562821 
+349815.070801  7385010.304064 
+349821.041072  7385005.054964 
+349825.089971  7384998.786037 
+349830.581960  7384990.537450 
+349836.626448  7384987.827914 
+349842.035975  7384987.437981 
+349851.626341  7384987.757926 
+349858.437728  7384989.827572 
+349878.212189  7384991.577272 
+349893.533685  7384990.517454 
+349908.418132  7384991.667257 
+349926.229990  7384995.616580 
+349936.826396  7384997.276296 
+349956.073098  7385000.245787 
+349970.759635  7385005.724849 
+349981.586936  7385010.024112 
+350000.347111  7385010.773984 
+350019.148517  7385008.424386 
+350038.782792  7385004.085130 
+350058.078972  7385002.845342 
+350075.363071  7384998.256128 
+350088.853904  7384995.846541 
+350108.216054  7384988.187853 
+350124.774485  7384985.918241 
+350144.070665  7384984.348510 
+350159.062312  7384984.948408 
+350180.057215  7384987.268010 
+350188.410647  7384988.347825 
+350222.187208  7384987.917899 
+350242.275026  7384988.677769 
+350261.257848  7384988.097868 
+350279.515003  7384989.277666 
+350295.529183  7384989.227675 
+350308.302594  7384987.367993 
+350324.209573  7384988.747757 
+350336.628397  7384990.867394 
+350355.668943  7384994.936697 
+350367.263143  7384998.266126 
+350372.837595  7385001.865510 
+350377.867796  7385009.234248 
+350380.011816  7385018.882595 
+350390.484529  7385032.620242 
+350399.588368  7385039.799012 
+350417.326010  7385041.198772 
+350433.389667  7385036.599560 
+350445.082822  7385030.960526 
+350455.918369  7385019.222537 
+350464.082137  7385008.674344 
+350470.250318  7385004.195111 
+350477.135921  7384999.725876 
+350485.514091  7384998.266126 
+350496.910382  7385001.255614 
+350508.257195  7385009.124267 
+350520.560571  7385022.871912 
+350530.373586  7385031.610415 
+350536.129455  7385037.209456 
+350542.916102  7385042.038629 
+350548.803911  7385044.868144 
+350557.363499  7385045.737995 
+350562.987428  7385044.578194 
+350571.645970  7385036.029658 
+350582.877336  7385035.139810 
+350587.998245  7385032.980180 
+350599.138903  7385031.540427 
+350604.251566  7385030.050682 
+350608.910686  7385023.891737 
+350613.025555  7385020.062393 
+350625.411394  7385016.203054 
+350633.063896  7385016.053080 
+350643.957167  7385018.932586 
+350659.138477  7385020.862256 
+350672.909682  7385021.222194 
+350679.448943  7385020.292354 
+350686.606671  7385018.602643 
+350692.494480  7385011.123924 
+350697.170093  7385003.095299 
+350702.332233  7384997.606239 
+350718.956634  7384987.477974 
+350748.939929  7384979.149401 
+350777.381178  7384951.754094 
+350812.708031  7384929.407921 
+350835.632552  7384922.559094 
+350869.895640  7384894.223948 
+350905.362678  7384878.196693 
+350919.867798  7384876.357008 
+350951.533323  7384882.435967 
+350974.589784  7384882.675926 
+350999.584109  7384872.627647 
+351017.470184  7384859.959817 
+351028.784012  7384850.551429 
+351037.219906  7384843.772590 
+351038.984599  7384841.243023 
+351039.025831  7384837.263705 
+351035.100625  7384831.684660 
+351031.760901  7384829.105102 
+351031.092957  7384824.555881 
+351031.851610  7384820.016659 
+351040.336981  7384818.336947 
+351045.358936  7384816.397279 
+351052.054875  7384809.928387 
+351058.734322  7384805.679115 
+351069.660577  7384804.239361 
+351077.040954  7384801.319862 
+351086.441657  7384799.650148 
+351096.889631  7384795.770812 
+351106.826339  7384791.771497 
+351119.039007  7384784.592727 
+351125.710207  7384780.893360 
+351131.688724  7384765.116063 
+351133.618342  7384756.057615 
+351134.913001  7384748.758865 
+351136.339599  7384738.690589 
+351138.434141  7384733.621458 
+351154.052502  7384722.703328 
+351174.956697  7384714.064808 
+351202.853695  7384709.585575 
+351214.604574  7384707.935857 
+351230.519799  7384707.655905 
+351251.885782  7384704.106513 
+351262.696591  7384694.358183 
+351268.873017  7384688.659159 
+351278.471630  7384688.209236 
+351284.788243  7384688.489188 
+351298.526463  7384692.508500 
+351308.982683  7384687.739317 
+351315.357020  7384682.600197 
+351322.531240  7384679.350754 
+351332.937983  7384679.240773 
+351343.855993  7384679.130791 
+351355.829520  7384675.701379 
+351364.306645  7384684.319903 
+351373.674363  7384686.189582 
+351379.941498  7384692.118567 
+351387.206427  7384700.497132 
+351394.578557  7384707.335960 
+351409.652667  7384719.883811 
+351421.535485  7384725.322879 
+351431.933982  7384726.432689 
+351446.579288  7384730.342019 
+351459.121805  7384741.100177 
+351470.320186  7384743.539759 
+351481.452597  7384742.879872 
+351493.896159  7384742.789887 
+351501.540415  7384743.859704 
+351508.318817  7384749.468743 
+351516.350645  7384751.768349 
+351529.585846  7384754.447890 
+351540.000835  7384753.778005 
+351550.077729  7384756.427551 
+351556.344864  7384761.806630 
+351565.193070  7384764.446178 
+351572.367290  7384761.746640 
+351578.197375  7384759.816971 
+351585.891108  7384756.347565 
+351590.649184  7384759.387044 
+351597.773927  7384761.006767 
+351603.917369  7384759.077097 
+351612.542926  7384754.067955 
+351618.867785  7384753.698019 
+351624.219589  7384759.507024 
+351629.480684  7384763.876275 
+351639.005080  7384770.065215 
+351650.937376  7384770.415155 
+351657.575591  7384770.255183 
+351661.649229  7384770.745099 
+351680.549590  7384778.243814 
+351684.977816  7384774.304489 
+351692.053082  7384770.825085 
+351693.957961  7384763.536334 
+351696.258659  7384758.467202 
+351704.513136  7384749.248781 
+351713.971563  7384742.040016 
+351725.178190  7384733.841420 
+351741.794345  7384724.712984 
+351787.222830  7384702.466794 
+351794.702161  7384689.479019 
+351803.451412  7384681.260427 
+351828.585923  7384657.484499 
+351847.882102  7384636.308127 
+351852.937042  7384631.268990 
+351861.480137  7384623.270360 
+351866.345413  7384616.561509 
+351879.061100  7384610.382567 
+351893.904316  7384605.543396 
+351905.556239  7384603.113812 
+351916.466003  7384603.783698 
+351946.152433  7384604.083646 
+351959.618528  7384604.443585 
+351978.180793  7384604.633552 
+351992.553973  7384605.773357 
+352002.977208  7384604.103643 
+352018.834710  7384600.284297 
+352040.464573  7384590.206023 
+352057.781657  7384582.297378 
+352069.812908  7384573.558875 
+352083.336726  7384567.939837 
+352092.737429  7384566.480087 
+352101.659850  7384561.590925 
+352124.411201  7384551.742612 
+352165.823771  7384542.084266 
+352187.041323  7384532.995823 
+352211.194532  7384525.377128 
+352230.870039  7384516.498649 
+352253.489449  7384509.419861 
+352284.074719  7384501.421231 
+352309.019566  7384496.692042 
+352335.184856  7384491.972850 
+352363.939462  7384483.404318 
+352386.839245  7384478.315189 
+352407.726947  7384470.996443 
+352427.138574  7384458.348609 
+352439.697583  7384447.620447 
+352457.666120  7384435.732483 
+352472.410380  7384430.573367 
+352485.917706  7384426.724026 
+352508.248499  7384428.163780 
+352520.824001  7384435.602506 
+352530.133995  7384443.111219 
+352540.887080  7384458.838525 
+352552.242139  7384466.037292 
+352568.421244  7384470.416542 
+352588.715217  7384471.396374 
+352615.367035  7384468.446880 
+352632.247069  7384463.857666 
+352658.131987  7384456.588911 
+352682.351166  7384453.289476 
+352703.882075  7384452.959532 
+352722.625757  7384455.249140 
+352739.827394  7384459.408428 
+352760.632634  7384460.398258 
+352781.767723  7384458.618563 
+352805.327204  7384458.858522 
+352826.429308  7384460.838183 
+352842.072408  7384467.527037 
+352867.314120  7384483.294336 
+352879.848390  7384495.492247 
+352889.042938  7384513.739122 
+352901.016464  7384530.476255 
+352915.859680  7384546.353535 
+352930.966774  7384555.252011 
+352949.446577  7384563.850538 
+352978.151706  7384580.317717 
+352996.540800  7384598.324633 
+353009.050332  7384612.412220 
+353020.858934  7384624.820094 
+353037.664753  7384637.947846 
+353056.631083  7384649.215916 
+353077.312629  7384661.823756 
+353099.577452  7384669.912370 
+353123.054471  7384679.230774 
+353138.202797  7384684.139933 
+353162.743579  7384688.489188 
+353192.627919  7384689.898947 
+353209.994481  7384687.639334 
+353224.722249  7384683.580029 
+353240.629227  7384674.651559 
+353269.936331  7384661.883746 
+353285.694878  7384657.164554 
+353308.536937  7384658.504325 
+353325.012906  7384662.993556 
+353342.395960  7384669.482444 
+353363.399109  7384680.990473 
+353377.063113  7384691.978591 
+353389.349997  7384697.747603 
+353396.334555  7384702.916717 
+353410.608780  7384704.386465 
+353433.162221  7384703.616597 
+353448.508456  7384709.635566 
+353464.324726  7384718.993963 
+353483.909524  7384729.482167 
+353499.255759  7384735.291172 
+353515.962623  7384738.330651 
+353546.976696  7384738.420636 
+353558.653359  7384733.561468 
+353580.382176  7384713.174960 
+353596.041768  7384698.827418 
+353617.424244  7384682.540207 
+353635.079424  7384671.982016 
+353655.241458  7384665.313158 
+353685.818481  7384658.534319 
+353708.165766  7384657.434508 
+353726.068333  7384663.033549 
+353754.872417  7384669.862379 
+353788.112973  7384682.040293 
+353814.806021  7384696.147877 
+353840.171427  7384709.695556 
+353863.813370  7384722.783314 
+353883.909434  7384732.951572 
+353898.216644  7384740.950202 
+353919.549643  7384750.248610 
+353964.846188  7384770.965061 
+353980.439810  7384782.533080 
+353996.115894  7384796.200738 
+354011.049818  7384812.627925 
+354023.237747  7384828.475210 
+354030.519169  7384844.832408 
+354035.895711  7384857.950161 
+354038.724168  7384870.937937 
+354042.105123  7384889.904688 
+354042.022660  7384898.543208 
+354037.396525  7384912.340845 
+354029.100817  7384925.548582 
+354018.438441  7384940.725983 
+354007.009165  7384951.354162 
+353994.953176  7384963.302115 
+353975.797182  7384980.939094 
+353964.293690  7384989.017711 
+353951.454309  7384997.636234 
+353942.202038  7385004.305092 
+353937.740828  7385011.563849 
+353933.238386  7385022.811922 
+353932.520964  7385033.880026 
+353937.559411  7385049.877286 
+353942.944199  7385062.335152 
+353954.142580  7385085.041263 
+353959.082073  7385091.400173 
+353964.961635  7385105.637735 
+353966.594389  7385125.814279 
+353971.434926  7385141.801540 
+353973.611931  7385158.328709 
+353980.695443  7385174.785890 
+354006.844240  7385202.291179 
+354030.321259  7385221.577875 
+354048.809308  7385239.594789 
+354064.312222  7385249.933018 
+354080.582035  7385266.160239 
+354093.545109  7385275.698605 
+354110.342681  7385289.376262 
+354121.590540  7385297.464876 
+354135.353499  7385308.013070 
+354154.138412  7385317.391463 
+354174.127275  7385307.733118 
+354193.984199  7385291.655871 
+354206.353545  7385278.488127 
+354222.054368  7385270.119560 
+354248.401075  7385257.531717 
+354261.751722  7385360.444089 
+354284.973108  7385405.856310 
+354291.792740  7385437.710854 
+354299.362780  7385466.685890 
+354308.672775  7385484.722801 
+354323.227372  7385538.683558 
+354185.911139  7385956.691957 
+354099.284486  7386476.442928 
+354056.404087  7386585.144309 
+354048.025916  7386591.873156 
+354042.575158  7386616.288974 
+354036.835781  7386629.086782 
+354029.043093  7386642.844425 
+354012.360969  7386658.631721 
+353999.134015  7386684.967210 
+353987.251196  7386699.684689 
+353978.675117  7386711.002750 
+353967.443750  7386721.410967 
+353957.647228  7386732.169125 
+353937.328516  7386753.895403 
+353915.715146  7386772.062291 
+353909.002714  7386780.300880 
+353901.061594  7386788.519472 
+353898.579478  7386801.897181 
+353893.722448  7386807.936146 
+353889.417916  7386810.335735 
+353864.745194  7386808.096119 
+353841.870150  7386809.855818 
+353829.731699  7386809.405895 
+353811.458052  7386809.885812 
+353795.757228  7386809.285915 
+353787.082194  7386809.415893 
+353772.049315  7386812.255406 
+353755.993904  7386816.304713 
+353738.091337  7386830.742240 
+353731.049056  7386841.530392 
+353713.633017  7386837.581068 
+353699.350546  7386837.881017 
+353687.665637  7386842.970145 
+353680.145075  7386850.208905 
+353677.844376  7386855.827943 
+353670.620678  7386863.506628 
+353657.154584  7386883.313235 
+353653.773629  7386895.121212 
+353644.669790  7386907.879027 
+353638.913921  7386921.666665 
+353626.297189  7386938.263822 
+353621.646314  7386944.752711 
+353611.173602  7386951.181610 
+353591.621789  7386967.368837 
+353582.484965  7386973.037866 
+353573.933624  7386981.036496 
+353569.109579  7386983.975992 
+353561.300399  7386999.073406 
+353549.813399  7387005.272344 
+353546.259274  7387003.682617 
+353543.752420  7386998.783456 
+353543.628726  7386991.474708 
+353539.068561  7386987.665360 
+353534.285747  7386987.065463 
+353528.958682  7386988.555208 
+353523.516170  7386992.264573 
+353513.035211  7386999.253375 
+353505.836251  7387004.942401 
+353490.259122  7387011.541271 
+353482.177816  7387014.000849 
+353462.848651  7387017.800199 
+353456.408345  7387019.279945 
+353451.551315  7387025.208929 
+353444.294632  7387036.546987 
+353441.383713  7387042.056044 
+353434.250723  7387051.284463 
+353426.062216  7387053.414098 
+353415.581257  7387081.109354 
+353412.942463  7387090.167803 
+353411.540604  7387097.676516 
+353407.400996  7387103.175574 
+353399.517600  7387106.195057 
+353384.674384  7387110.474324 
+353369.369380  7387120.402624 
+353355.020939  7387126.791529 
+353333.011749  7387133.990296 
+353316.890368  7387144.348522 
+353308.536937  7387153.017037 
+353301.346224  7387157.926196 
+353285.752602  7387165.744857 
+353262.374538  7387177.132906 
+353246.954086  7387188.270998 
+353232.094379  7387194.549923 
+353221.506219  7387202.188614 
+353208.831762  7387215.136397 
+353199.373336  7387232.313454 
+353194.029778  7387246.101093 
+353188.496557  7387258.119034 
+353044.863712  7387317.848803 
+352742.012645  7387441.097691 
+352657.686691  7387489.209450 
+352637.755551  7387492.878822 
+352617.750196  7387493.228762 
+352587.230896  7387493.698681 
+352573.608123  7387489.129464 
+352554.732501  7387478.751242 
+352527.445724  7387472.602295 
+352510.532705  7387470.002740 
+352494.996806  7387472.832256 
+352479.625832  7387479.321144 
+352474.364737  7387484.810204 
+352466.291677  7387496.018284 
+352460.098758  7387502.487176 
+352450.516638  7387511.695599 
+352442.781674  7387520.364114 
+352435.302342  7387522.953670 
+352422.619640  7387526.253105 
+352396.165732  7387538.720970 
+352383.647954  7387545.239853 
+352367.732729  7387554.828210 
+352358.653629  7387565.036462 
+352350.094041  7387573.475016 
+352334.508665  7387591.361953 
+352323.582410  7387601.780168 
+352315.360918  7387607.449197 
+352308.137220  7387615.907748 
+352291.397371  7387625.926032 
+352286.441387  7387631.415092 
+352278.681684  7387642.413208 
+352272.340332  7387644.002936 
+352263.327202  7387647.122401 
+352255.122203  7387651.251694 
+352253.357509  7387663.859534 
+352250.380620  7387676.227416 
+352247.618133  7387687.055561 
+352235.290018  7387694.684254 
+352226.606737  7387695.484117 
+352218.921250  7387699.173485 
+352212.950979  7387704.092643 
+352210.658527  7387708.831831 
+352193.357935  7387734.347460 
+352181.887428  7387748.515034 
+352171.266283  7387759.703117 
+352163.844676  7387767.161840 
+352158.707274  7387770.101336 
+352157.025043  7387775.290447 
+352156.662209  7387780.379576 
+352155.351058  7387799.306334 
+352153.644088  7387806.595085 
+352148.704596  7387811.084316 
+352138.075205  7387812.084145 
+352124.452432  7387817.703182 
+352120.617935  7387822.872297 
+352119.224322  7387829.721124 
+352117.979141  7387842.109002 
+352117.814216  7387848.427920 
+352116.082508  7387858.156253 
+352113.295282  7387870.744097 
+352108.116649  7387879.002682 
+352102.616413  7387887.471232 
+352094.394921  7387893.150259 
+352088.111294  7387899.399189 
+352085.653917  7387909.667430 
+352082.932661  7387917.176144 
+352080.821626  7387924.014972 
+352076.352169  7387931.503689 
+352067.437993  7387935.403021 
+352051.225904  7387944.211513 
+352026.759338  7387962.118445 
+352006.885922  7387979.525464 
+351994.566053  7387987.044176 
+351983.755245  7387996.232602 
+351972.482647  7388000.551862 
+351950.852784  7388000.661843 
+351933.915027  7388010.460165 
+351917.810138  7388018.268827 
+351905.721164  7388023.127995 
+351891.842758  7388033.396236 
+351884.140778  7388038.085433 
+351858.090936  7388070.709845 
+351846.241102  7388082.107892 
+351829.328083  7388089.136688 
+351812.918084  7388097.385275 
+351760.818399  7388113.352540 
+351729.375522  7388123.890735 
+351722.506412  7388126.940213 
+351708.157970  7388133.419103 
+351688.705112  7388139.867998 
+351679.980600  7388144.987122 
+351659.670134  7388154.965412 
+351650.261185  7388157.305012 
+351643.631215  7388155.685289 
+351618.323534  7388087.656942 
+351596.165912  7388052.063039 
+351484.190346  7387884.931667 
+351462.040970  7387850.917493 
+351452.549559  7387826.391694 
+351445.416569  7387803.455623 
+351445.416569  7387778.929824 
+351443.849786  7387752.824296 
+351447.560589  7387733.707570 
+351417.478340  7387723.089389 
+351325.186527  7387698.243645 
+351264.288113  7387679.046933 
+351246.872074  7387672.927981 
+351216.022925  7387657.110690 
+351197.823494  7387642.073266 
+351149.566552  7387596.191125 
+351132.167006  7387583.533294 
+351036.436514  7387543.240195 
+351010.337194  7387533.741822 
+350985.021266  7387521.873855 
+350961.288614  7387506.846429 
+350932.022742  7387482.320630 
+350851.333375  7387422.990793 
+350833.142190  7387412.702555 
+350818.109312  7387407.963367 
+350782.963877  7387406.593602 
+350746.441321  7387408.923203 
+350707.279972  7387415.062151 
+350657.522216  7387426.150252 
+350595.823918  7387429.319709 
+350568.924714  7387430.419521 
+350535.807852  7387447.356619 
+350516.173576  7387451.585895 
+350504.158818  7387459.214588 
+350498.369965  7387466.683309 
+350493.150101  7387478.151345 
+350487.963221  7387496.038281 
+350476.641147  7387515.524943 
+350463.397700  7387532.991951 
+350446.196063  7387538.690975 
+350435.401747  7387546.329666 
+350414.398598  7387555.088166 
+350400.025418  7387563.576712 
+350383.574188  7387575.694636 
+350371.427490  7387585.872893 
+350348.272074  7387604.569690 
+350327.598774  7387610.338702 
+350318.882508  7387614.907919 
+350305.259735  7387619.967053 
+350294.795269  7387625.396123 
+350284.231847  7387630.495249 
+350270.378180  7387637.774003 
+350256.351341  7387642.063268 
+350247.461905  7387643.403038 
+350236.032629  7387643.183076 
+350225.329022  7387642.733153 
+350202.783827  7387641.843306 
+350190.381496  7387637.284087 
+350176.733984  7387634.594547 
+350166.145824  7387632.054982 
+350152.490066  7387630.365272 
+350146.552780  7387631.964998 
+350134.711193  7387642.363217 
+350126.992721  7387648.592150 
+350116.932320  7387654.911067 
+350110.747647  7387660.830053 
+350100.316165  7387663.159654 
+350088.218945  7387668.018822 
+350067.859001  7387673.237928 
+350001.361397  7387662.849707 
+349982.403313  7387680.346710 
+349967.708530  7387664.619404 
+349898.893735  7387697.053849 
+349832.437362  7387731.857887 
+349754.122910  7387774.580569 
+349667.100438  7387820.462710 
+349585.627679  7387862.385529 
+349568.219886  7387860.805799 
+349548.453671  7387849.727697 
+349504.938312  7387834.700271 
+349483.572329  7387830.740949 
+349462.330038  7387752.734311 
+349449.878230  7387691.574787 
+349448.699019  7387674.407728 
+349421.626644  7387565.356407 
+349411.937323  7387517.954527 
+349408.078087  7387501.877280 
+349403.493183  7387484.660230 
+349397.011646  7387466.633317 
+349385.392707  7387439.357989 
+349377.031029  7387420.541213 
+349366.484100  7387397.475164 
+349335.049468  7387335.155838 
+349309.626339  7387295.052708 
+349263.999945  7387221.015390 
+349242.312359  7387180.922257 
+349232.812701  7387162.725374 
+349221.441149  7387107.854773 
+349220.946375  7387085.198654 
+349218.068441  7387048.005025 
+349217.854039  7387020.969656 
+349213.821632  7386947.922168 
+349194.847055  7386884.263072 
+349136.298817  7386800.777373 
+349111.791020  7386763.203809 
+349059.575887  7386725.230313 
+349021.832890  7386677.758445 
+Region 1
+259
+330497.970400  7387158.766052 
+330555.512597  7387229.943860 
+330572.837928  7387253.559815 
+330650.500928  7387338.625244 
+330727.677401  7387424.140596 
+330805.068275  7387510.095873 
+330876.662050  7387602.300079 
+330950.853387  7387691.874736 
+331026.273412  7387779.479730 
+331101.470790  7387869.504309 
+331175.282800  7387955.529574 
+331219.391888  7388014.299507 
+331245.985982  7388045.284200 
+331323.137716  7388135.448755 
+331405.228942  7388230.022556 
+331443.376005  7388275.174822 
+331455.530949  7388292.701819 
+331463.323637  7388306.159514 
+331498.073253  7388382.796387 
+331510.797186  7388430.008300 
+331513.642136  7388457.623570 
+331517.476633  7388496.326940 
+331521.179191  7388538.669687 
+331520.626693  7388586.401511 
+331532.732160  7388713.909670 
+331538.438552  7388785.307441 
+331540.986637  7388852.895863 
+331541.926707  7388871.402693 
+331545.851913  7388925.883361 
+331547.740300  7388943.680313 
+331560.076661  7389059.460481 
+331565.123354  7389145.125807 
+331576.395951  7389246.048520 
+331578.127660  7389255.396918 
+331603.262171  7389247.928198 
+331730.006736  7389215.003837 
+331758.918020  7389207.865060 
+331859.901361  7389182.949328 
+331993.976825  7389168.841745 
+332122.123249  7389164.182543 
+332262.152492  7389149.874993 
+332395.551765  7389140.086670 
+332485.031614  7389141.446437 
+332546.367077  7389142.616237 
+332643.697338  7389145.295778 
+332704.529781  7389146.205622 
+332778.284068  7389149.245101 
+332853.572154  7389149.485060 
+332929.091134  7389152.794493 
+333027.452173  7389152.694510 
+333212.002815  7389152.654517 
+333340.272933  7389152.234589 
+333412.518160  7389151.704680 
+333453.600881  7389150.704851 
+333502.022747  7389150.774839 
+333541.563423  7389151.544707 
+333623.951513  7389150.314918 
+333697.211026  7389151.054791 
+333774.032911  7389149.785009 
+333847.787198  7389151.804663 
+333915.208380  7389153.024454 
+333951.186684  7389155.294065 
+334049.803356  7389156.203909 
+334125.817111  7389160.013257 
+334232.539828  7389161.483005 
+334285.761000  7389163.872596 
+334309.048356  7389163.042738 
+334325.870666  7389161.403019 
+334336.434088  7389160.143235 
+334321.162068  7389125.239213 
+334306.846612  7389091.514990 
+334241.948777  7388936.761498 
+334209.730754  7388862.374240 
+334183.895313  7388800.274877 
+334172.614469  7388778.218655 
+334140.272753  7388705.641087 
+334131.960552  7388682.285087 
+334124.415251  7388663.598288 
+334120.349860  7388653.030098 
+334115.600031  7388636.822875 
+334112.186091  7388626.134705 
+334106.001418  7388605.018322 
+334100.468198  7388588.451160 
+334095.833816  7388574.553541 
+334089.673882  7388559.426132 
+334082.631601  7388541.519199 
+334075.003837  7388525.261984 
+334066.683391  7388508.434866 
+334060.647150  7388493.507423 
+334042.761075  7388448.475137 
+334019.531444  7388391.394914 
+334013.082891  7388374.927735 
+334006.626093  7388359.460384 
+334003.121445  7388349.782042 
+333988.970913  7388313.158315 
+333985.045707  7388301.070386 
+333982.456391  7388294.831455 
+333974.069974  7388278.574239 
+333947.682036  7388212.255599 
+333936.392946  7388179.841151 
+333934.430343  7388174.342093 
+333925.375982  7388154.085563 
+333919.826269  7388139.728022 
+333915.002224  7388124.170687 
+333909.056692  7388108.263412 
+333904.991300  7388098.255126 
+333900.554828  7388084.027563 
+333896.085371  7388064.590893 
+333891.896286  7388046.823936 
+333888.672010  7388025.297623 
+333887.517537  7388010.000244 
+333886.973286  7387995.712691 
+333888.020557  7387975.346180 
+333889.142045  7387957.189290 
+333892.778632  7387933.313379 
+333899.721959  7387906.148033 
+333907.019873  7387883.741871 
+333913.575626  7387863.995253 
+333919.026385  7387842.458942 
+333925.425460  7387817.833160 
+333929.614545  7387799.386320 
+333936.805258  7387777.540062 
+333956.505503  7387719.919932 
+333973.946281  7387670.868334 
+333981.508074  7387652.231526 
+333987.791702  7387629.045498 
+333995.633867  7387603.549865 
+334000.870224  7387582.683439 
+334003.542003  7387562.996811 
+334008.621681  7387538.241052 
+334011.821218  7387517.014688 
+334011.227489  7387497.408046 
+334010.773947  7387456.974972 
+334011.441891  7387433.948916 
+334011.524354  7387417.781685 
+334001.018656  7387359.001754 
+333997.431546  7387328.796928 
+333995.139093  7387296.872396 
+333987.486591  7387270.316945 
+333982.563592  7387245.001281 
+333974.935828  7387215.896266 
+333967.085417  7387180.522326 
+333961.923276  7387157.716232 
+333958.410382  7387116.813238 
+333953.602830  7387082.089186 
+333949.471468  7387059.113122 
+333944.556715  7387034.247381 
+333941.934413  7387013.071009 
+333939.543006  7386990.554865 
+333938.306072  7386955.650844 
+333937.448464  7386932.164867 
+333935.469369  7386854.838112 
+333934.191203  7386797.008018 
+333935.510600  7386753.055547 
+333932.624419  7386728.549744 
+333931.849273  7386697.745021 
+333930.364952  7386666.830316 
+333926.687133  7386643.394331 
+333919.158324  7386602.571323 
+333905.749953  7386552.249943 
+333879.032166  7386461.355512 
+333864.823911  7386418.552844 
+333856.734358  7386385.448515 
+333847.836675  7386350.684469 
+333844.917510  7386338.856495 
+333839.442013  7386317.810100 
+333837.784520  7386301.612875 
+333831.476154  7386282.946072 
+333844.538183  7386279.336691 
+333833.603681  7386231.474889 
+333813.087059  7386172.664963 
+333784.249991  7386092.808641 
+333748.246948  7385963.870727 
+333751.726857  7385884.884257 
+333622.252790  7385861.908192 
+333598.668570  7385860.378454 
+333557.973422  7385852.389823 
+333516.536113  7385842.861455 
+333483.163618  7385836.552536 
+333459.587644  7385835.032796 
+333420.838606  7385830.643548 
+333387.457865  7385824.844541 
+333334.047029  7385817.585784 
+333267.772073  7385819.205507 
+333229.361131  7385823.214820 
+333195.782479  7385826.554248 
+333156.126356  7385828.993830 
+333081.621662  7385835.772669 
+333025.266922  7385835.572703 
+332993.180839  7385840.721821 
+332952.947479  7385846.720794 
+332914.231427  7385853.499633 
+332878.879836  7385856.799067 
+332835.158321  7385859.928531 
+332793.152022  7385865.877512 
+332748.630623  7385870.756677 
+332711.530831  7385872.756334 
+332677.020356  7385872.266418 
+332633.373057  7385871.576536 
+332582.634000  7385858.038855 
+332559.940373  7385850.940071 
+332538.656852  7385848.710453 
+332525.660792  7385842.311549 
+332499.841844  7385835.932642 
+332480.743574  7385826.904188 
+332480.727081  7385826.884192 
+332431.925888  7385806.777636 
+332397.555599  7385792.620061 
+332355.104004  7385764.324907 
+332318.713388  7385742.078718 
+332294.452977  7385729.950795 
+332256.042035  7385717.822873 
+332227.740971  7385721.862181 
+332213.590440  7385725.911487 
+332200.932476  7385732.690326 
+332191.861622  7385717.252970 
+332177.727583  7385700.935765 
+332164.146041  7385682.608905 
+332137.972505  7385647.504918 
+332110.215692  7385618.609867 
+332094.663301  7385594.234043 
+332068.201147  7385572.567754 
+332045.053978  7385621.619352 
+332036.453159  7385666.581650 
+331999.510046  7385720.092484 
+331944.647873  7385754.706555 
+331915.142860  7385752.456940 
+331875.989757  7385756.566236 
+331839.137352  7385769.574008 
+331796.702249  7385789.180650 
+331764.690382  7385802.938293 
+331739.778519  7385812.116721 
+331707.486280  7385817.225846 
+331678.756412  7385816.755927 
+331652.566384  7385819.065531 
+331633.352666  7385827.404103 
+331574.952861  7385925.147360 
+331532.583728  7386000.004538 
+331520.890573  7386027.819773 
+331477.391706  7386135.751286 
+331437.958231  7386236.634005 
+331425.654855  7386259.310121 
+331420.063911  7386283.825922 
+331401.534630  7386315.070570 
+331296.337466  7386507.677578 
+331281.733392  7386579.725237 
+331248.616529  7386628.186936 
+331217.528240  7386677.328518 
+331124.057215  7386818.744295 
+331030.907794  7386882.263415 
+330923.632580  7386938.713745 
+330867.178885  7386966.948909 
+330829.064806  7386983.886008 
+330713.328959  7387041.756095 
+330661.105581  7387069.981260 
+330604.651886  7387098.216424 
+330579.360696  7387112.563966 
+330537.898649  7387136.099935 
+330497.970400  7387158.766052 
+Region 1
+112
+333907.324983  7395848.817525 
+333982.068818  7396026.457097 
+333821.052918  7396075.218745 
+333729.676437  7396099.864523 
+333632.989382  7396125.490134 
+333556.340668  7396145.636683 
+333468.848161  7396169.792545 
+333432.737917  7396179.760838 
+333355.322304  7396201.427126 
+333314.742603  7396207.546078 
+333263.723174  7396222.513514 
+333260.902963  7396133.828705 
+333252.038265  7396000.001629 
+333244.831059  7395918.725551 
+333239.281346  7395834.849918 
+333227.151141  7395675.497213 
+333223.860895  7395658.210175 
+333219.548116  7395644.492524 
+333213.718031  7395626.335634 
+333200.021042  7395602.029798 
+333153.619502  7395514.324821 
+333099.087179  7395434.388513 
+333089.109240  7395412.862200 
+333055.472865  7395340.264636 
+333003.983401  7395244.701005 
+332812.101860  7394889.331876 
+332780.147716  7394841.380090 
+332759.020873  7394808.995637 
+332743.922025  7394787.569307 
+332731.049659  7394775.561364 
+332726.613187  7394771.852000 
+332731.288800  7394762.743560 
+332744.119935  7394737.757840 
+332787.783726  7394657.381607 
+332868.382384  7394516.605721 
+332903.865915  7394463.394836 
+332915.196236  7394446.377750 
+332928.043863  7394424.711462 
+332940.017390  7394392.426992 
+332953.747364  7394354.483491 
+332960.171177  7394312.870619 
+332962.933665  7394266.918490 
+332953.747364  7394225.305618 
+332939.159782  7394131.901617 
+332893.986930  7393999.964217 
+332883.440001  7393972.568910 
+332915.641532  7393966.190002 
+333017.243340  7393944.773671 
+333041.759383  7393939.624553 
+333080.392974  7393935.765214 
+333146.082447  7393928.026539 
+333191.717088  7393921.957579 
+333236.312703  7393924.627122 
+333348.296515  7393932.705738 
+333456.750941  7393939.814520 
+333662.684059  7393954.741963 
+333719.137754  7393959.301182 
+333747.339863  7393961.650780 
+333802.688563  7393971.229139 
+333844.810309  7393981.247423 
+333870.942614  7394000.004210 
+333877.630307  7394007.812873 
+333886.453774  7394018.780994 
+333892.993034  7394028.729290 
+333899.787929  7394038.417630 
+333910.087471  7394056.264573 
+333914.862038  7394064.673133 
+333926.142882  7394090.908639 
+333937.423725  7394115.114493 
+333947.632559  7394151.748218 
+333956.423041  7394117.764039 
+333961.288317  7394149.568591 
+333964.380653  7394155.307608 
+333978.968235  7394169.455185 
+334017.346193  7394184.542600 
+334096.361575  7394194.420908 
+334111.889227  7394211.348009 
+334118.939754  7394231.104625 
+334091.554022  7394278.196558 
+334052.235994  7394368.041169 
+334017.263730  7394444.888006 
+334196.338875  7394497.159052 
+334182.361514  7394504.187848 
+334166.273118  7394523.774493 
+334144.428853  7394584.504091 
+334138.928617  7394618.258309 
+334133.733492  7394643.394003 
+334124.720362  7394669.499532 
+334117.496664  7394693.085492 
+334107.741373  7394718.181193 
+334093.153791  7394745.276552 
+334071.540420  7394782.070249 
+334043.222864  7394834.061344 
+334027.752936  7394904.139340 
+334015.630977  7394957.900131 
+334016.867911  7394984.985492 
+334014.888816  7395049.254483 
+334017.123544  7395134.299916 
+334020.372559  7395193.259816 
+334021.172444  7395236.302443 
+334012.283007  7395278.225262 
+333992.211682  7395349.133117 
+333971.892969  7395423.830322 
+333957.676468  7395454.315100 
+333947.517112  7395476.431312 
+333933.053223  7395502.336874 
+333919.339741  7395520.383783 
+333899.293155  7395541.460173 
+333879.246568  7395560.216960 
+333830.552576  7395600.850000 
+333884.870497  7395785.938296 
+333907.324983  7395848.817525 
+Region 1
+140
+325444.531827  7377051.727297 
+325444.540073  7377051.717298 
+325318.084126  7376989.218004 
+324408.862982  7376720.733993 
+324487.457806  7376976.990098 
+324472.144556  7377282.387787 
+324406.422097  7377564.029544 
+324238.100037  7377972.139638 
+324026.510005  7378414.503865 
+323973.354802  7378626.637529 
+323963.170708  7378827.653097 
+324022.238458  7379087.548579 
+324080.943374  7379378.448750 
+324081.124791  7379691.785079 
+324026.839854  7379996.832827 
+324011.930669  7380259.707799 
+324000.625087  7380553.637451 
+323946.892648  7380812.163168 
+323874.573205  7380996.921521 
+323826.827530  7381081.517030 
+323818.704993  7381111.991810 
+323818.366897  7381140.116992 
+323825.788505  7381167.232348 
+323844.119876  7381186.838989 
+323868.734874  7381209.735067 
+323890.100858  7381222.952803 
+323963.822160  7381251.417928 
+323977.057360  7381261.886134 
+323983.934716  7381275.593786 
+323989.781294  7381281.202826 
+324002.249595  7381287.661719 
+324036.941487  7381303.918935 
+324056.394345  7381315.226998 
+324075.047319  7381333.063942 
+324101.624920  7381371.377380 
+324109.005297  7381390.614085 
+324118.537939  7381415.449830 
+324122.776502  7381436.096294 
+324135.541667  7381511.013461 
+324149.329364  7381568.663586 
+324155.843887  7381595.289026 
+324175.758534  7381669.226361 
+324199.994205  7381780.527296 
+324223.982490  7381849.565470 
+324232.286445  7381896.847371 
+324248.927338  7381988.431684 
+324271.241638  7382109.540939 
+324291.131547  7382177.559288 
+324314.237485  7382260.205131 
+324327.876750  7382319.554965 
+324344.624845  7382411.139278 
+324364.555984  7382476.168139 
+324387.332073  7382550.215455 
+324410.421519  7382606.425827 
+324445.385537  7382651.038185 
+324498.243876  7382692.990999 
+324560.181314  7382717.326831 
+324599.796206  7382757.349975 
+324623.660797  7382735.833661 
+324650.749665  7382703.469204 
+324700.227049  7382661.306426 
+324745.061805  7382623.522898 
+324804.228510  7382580.330297 
+324864.640396  7382538.017545 
+324964.658927  7382475.868190 
+325076.791171  7382399.131335 
+325111.738697  7382373.155784 
+325185.905295  7382317.925245 
+325277.240546  7382239.388697 
+325337.413291  7382165.011437 
+325414.235176  7382062.818942 
+325464.166102  7381997.030211 
+325481.936729  7381972.254455 
+325543.808198  7381883.059733 
+325574.863503  7381821.520274 
+325612.095234  7381743.983556 
+325652.963553  7381670.716106 
+325703.438731  7381579.161788 
+325759.694516  7381481.598500 
+325804.496287  7381395.073321 
+325879.528740  7381254.317431 
+325957.455620  7381110.702031 
+326015.063787  7381010.379215 
+326026.781681  7380969.316249 
+326080.019346  7380893.309268 
+326145.007889  7380773.469796 
+326208.272971  7380669.007689 
+326278.835967  7380552.007730 
+326364.720459  7380407.382503 
+326385.385513  7380376.507792 
+326428.035018  7380327.926113 
+326445.434564  7380311.208977 
+326561.021979  7380179.021619 
+326675.685817  7380053.003205 
+326748.689696  7379969.697475 
+326793.458483  7379907.108196 
+326813.216451  7379879.312957 
+326880.777819  7379773.461088 
+326932.621871  7379685.686123 
+326984.548385  7379590.942352 
+327025.037378  7379514.225493 
+327068.429044  7379424.920790 
+327118.442432  7379338.095662 
+327047.763990  7379293.593285 
+327010.787891  7379267.137817 
+326990.906229  7379253.620132 
+326955.142327  7379191.620752 
+326936.068795  7379133.590692 
+326911.560998  7379047.825383 
+326899.570979  7379005.862571 
+326888.372597  7378966.659286 
+326873.966432  7378913.928318 
+326843.579073  7378801.657549 
+326830.343872  7378752.036049 
+326823.499501  7378724.120831 
+326802.554075  7378668.590343 
+326782.647674  7378615.319467 
+326703.887925  7378443.088969 
+326693.596629  7378420.962759 
+326664.042139  7378309.671822 
+326659.589174  7378294.304454 
+326618.052911  7378115.675052 
+326614.993559  7378107.236497 
+326564.427673  7377879.465513 
+326554.507457  7377794.999981 
+326514.059696  7377633.527639 
+326464.780222  7377452.288684 
+326430.896460  7377373.062255 
+326390.910487  7377377.701460 
+326251.747099  7377371.212572 
+326243.797733  7377371.212572 
+326007.642179  7377362.494065 
+325958.230765  7377304.893931 
+325903.582995  7377263.111088 
+325778.520661  7377197.552318 
+325636.932881  7377130.673774 
+325580.883251  7377107.177798 
+325496.046030  7377071.953832 
+325491.881684  7377070.224128 
+325444.531827  7377051.727297 
+Region 1
+177
+340932.074469  7397727.665696 
+340958.503639  7397685.492919 
+341034.426684  7397563.933741 
+341056.460613  7397528.399828 
+341071.460506  7397510.272933 
+341128.153342  7397444.334228 
+341150.418164  7397416.389014 
+341167.817711  7397387.274002 
+341194.543745  7397338.842297 
+341238.529139  7397260.905647 
+341261.156796  7397259.645863 
+341238.537385  7397260.875652 
+341385.831557  7397053.271213 
+341419.987444  7397005.619376 
+341530.759061  7396799.784633 
+341652.646596  7396708.240314 
+341744.963148  7396668.397139 
+341816.078641  7396642.671545 
+341808.723003  7396660.198543 
+341816.111626  7396642.631552 
+341880.448717  7396603.788206 
+341913.845952  7396575.233097 
+341935.451076  7396546.158077 
+341950.648879  7396506.364893 
+341969.887335  7396445.495320 
+341969.912074  7396445.505318 
+341980.417772  7396412.301006 
+341899.283108  7396406.841941 
+341881.759868  7396405.132234 
+341854.332905  7396402.922612 
+341780.158060  7396384.215816 
+341643.196415  7396353.031158 
+341612.372005  7396347.742064 
+341519.173107  7396325.405890 
+341472.746828  7396314.617738 
+341400.814958  7396298.330528 
+341311.937084  7396274.514607 
+341302.989924  7396267.655782 
+341243.691279  7396236.431130 
+341041.147362  7396191.898758 
+340966.189126  7396176.621375 
+341003.247686  7396032.006147 
+341029.322267  7395925.344417 
+341068.689773  7395778.099639 
+341093.667605  7395664.189150 
+341101.930328  7395603.099614 
+341116.336493  7395550.278662 
+341127.600844  7395514.954713 
+341158.384023  7395439.277676 
+341192.506926  7395331.356162 
+341225.648527  7395221.704944 
+341254.601042  7395098.546040 
+341268.685604  7395044.875233 
+341284.237995  7394985.305437 
+341313.520360  7394868.255487 
+341324.438370  7394826.842580 
+341342.011087  7394756.914558 
+341370.872895  7394645.573630 
+341386.499502  7394581.344632 
+341402.851777  7394523.584526 
+341426.106147  7394433.319987 
+341418.791741  7394311.310886 
+341415.188138  7394283.505649 
+341405.218445  7394141.509972 
+341398.192657  7394063.833277 
+341376.166975  7394068.282515 
+341353.382639  7394073.481624 
+341313.116295  7394081.630228 
+341278.943915  7394088.289088 
+341218.169195  7394102.026735 
+340924.471445  7394179.943388 
+340894.809753  7394191.191462 
+340867.811594  7394201.689663 
+340818.301225  7394231.484560 
+340750.500717  7394272.967454 
+340736.778989  7394281.645967 
+340683.813450  7394318.649629 
+340642.541065  7394347.144748 
+340619.369157  7394367.001347 
+340552.154131  7394378.809324 
+340510.419958  7394382.378713 
+340479.010065  7394386.847947 
+340399.838005  7394393.676778 
+340333.967114  7394401.795387 
+340285.256630  7394404.754880 
+340239.193186  7394411.163782 
+340193.896641  7394414.143272 
+340146.703463  7394418.242570 
+340102.157325  7394422.371862 
+340054.972393  7394426.481159 
+340062.748588  7394404.414938 
+340052.506770  7394400.105676 
+339957.370007  7394357.912904 
+339916.419226  7394340.695853 
+339888.002715  7394326.288321 
+339885.767986  7394319.769437 
+339856.749501  7394334.366937 
+339827.318703  7394352.403847 
+339778.327847  7394391.237196 
+339775.491144  7394413.353407 
+339686.398868  7394425.061402 
+339678.391778  7394428.030893 
+339671.118603  7394432.540121 
+339665.370980  7394438.969019 
+339660.357272  7394446.937655 
+339656.077478  7394459.105570 
+339652.523352  7394477.022501 
+339538.997495  7394449.917144 
+339502.153337  7394444.198124 
+339455.421947  7394436.859381 
+339414.372211  7394432.620107 
+339380.166847  7394428.840754 
+339339.867517  7394425.761282 
+339307.138228  7394428.490814 
+339266.410095  7394431.900230 
+339223.389510  7394437.569259 
+339194.436994  7394442.618394 
+339143.351595  7394457.755801 
+339121.993858  7394465.194527 
+339092.612538  7394476.732551 
+339072.796845  7394480.731866 
+339009.193668  7394491.919949 
+338992.222926  7394521.914812 
+338966.346254  7394570.906420 
+338945.392582  7394607.430164 
+338914.988730  7394670.809307 
+338898.372575  7394704.243580 
+338878.911470  7394746.326372 
+338862.287070  7394795.138011 
+338847.847920  7394841.570058 
+338834.942569  7394888.032099 
+338807.952656  7395002.742450 
+338793.752647  7395086.168160 
+338758.153669  7395250.370034 
+338740.226363  7395335.935377 
+338708.173265  7395486.209637 
+338688.613206  7395604.439385 
+338661.013072  7395771.280807 
+338652.527701  7395805.604927 
+338637.321651  7395857.096107 
+338626.502597  7395885.361266 
+338616.763798  7395905.987732 
+338604.782025  7395930.833477 
+338588.990493  7395956.839022 
+338573.561796  7395979.415155 
+338558.528917  7396005.050764 
+338542.003471  7396033.725852 
+338526.269663  7396066.970158 
+338462.196451  7396344.182674 
+338383.337747  7396580.802143 
+338340.927383  7396755.842160 
+338321.961053  7396813.082355 
+338306.367430  7396863.453727 
+338283.632573  7396926.053005 
+338252.948348  7396994.811227 
+338206.431361  7397106.442105 
+338535.431225  7397199.266206 
+338585.906403  7397212.193991 
+338837.853488  7397289.180804 
+338911.335649  7397309.607305 
+339021.373351  7397338.952279 
+339154.731393  7397356.979191 
+339360.862421  7397336.002784 
+339523.214210  7397336.002784 
+339593.026798  7397346.071059 
+339654.560171  7397352.419972 
+339841.040431  7397414.219386 
+340016.116154  7397512.502551 
+340178.896747  7397598.507819 
+340221.570991  7397617.284603 
+340301.757337  7397650.718876 
+340424.617928  7397669.145719 
+340657.879054  7397676.074533 
+340771.685283  7397678.364140 
+340824.461159  7397685.172974 
+340880.675714  7397701.700143 
+340932.074469  7397727.665696 
+Region 1
+1604
+333674.377214  7404344.182346 
+333578.795154  7404397.883148 
+333578.745677  7404397.913143 
+333535.560167  7404430.987477 
+333524.510218  7404448.624456 
+333518.861550  7404471.110604 
+333517.360736  7404497.816030 
+333518.383269  7404535.099644 
+333518.449238  7404561.345148 
+333518.309053  7404573.883000 
+333512.759339  7404586.110906 
+333505.156315  7404598.878719 
+333491.888130  7404614.486046 
+333477.407749  7404630.463309 
+333470.307744  7404640.001675 
+333459.447458  7404646.430574 
+333443.647680  7404657.278716 
+333427.443837  7404666.997051 
+333407.364265  7404671.526275 
+333392.587020  7404673.685905 
+333338.673164  7404679.114975 
+333310.908106  7404680.294773 
+333290.828534  7404683.684193 
+333278.360233  7404685.353907 
+333236.906432  7404700.611293 
+333208.044624  7404708.110009 
+333201.035328  7404709.949693 
+333149.488141  7404759.311238 
+333141.612990  7404787.026491 
+333145.389764  7404799.144415 
+333136.013800  7404859.624056 
+333127.916001  7404895.957832 
+333120.131560  7404924.772896 
+333104.595661  7404961.036685 
+333080.656853  7404999.310129 
+333061.632799  7405028.335157 
+332996.718472  7405116.959976 
+332916.029105  7405227.241086 
+332897.235945  7405313.646286 
+332879.176700  7405392.412794 
+332832.964823  7405467.419946 
+332836.543688  7405511.762350 
+332861.241148  7405568.852571 
+332864.284007  7405633.351523 
+332854.578194  7405705.229211 
+332877.700625  7405756.990345 
+332918.849316  7405822.249167 
+332887.761026  7405869.301107 
+332809.256910  7405952.576843 
+332749.026442  7406010.396939 
+332738.900071  7406031.033404 
+332735.593332  7406050.510068 
+332737.283809  7406073.086201 
+332744.491015  7406097.032099 
+332754.807049  7406115.188989 
+332800.598368  7406153.892359 
+332830.532185  7406174.618809 
+332852.120817  7406197.254932 
+332854.396777  7406213.512147 
+332846.810245  7406250.155870 
+332846.892707  7406261.823871 
+332852.467159  7406276.861296 
+332875.317464  7406299.007502 
+332890.531760  7406310.125598 
+332901.400292  7406325.253007 
+332913.852100  7406352.558329 
+332925.240144  7406382.903132 
+332937.403335  7406407.478922 
+332956.031570  7406431.534802 
+332973.917644  7406448.531890 
+332997.782235  7406470.938052 
+333031.426856  7406495.783796 
+333063.933498  7406512.990849 
+333150.518919  7406570.311030 
+333186.868304  7406600.255901 
+333238.456723  7406725.004533 
+333247.956381  7406747.200731 
+333259.047561  7406764.087838 
+333277.659304  7406783.894446 
+333289.962680  7406804.610897 
+333307.626106  7406836.815381 
+333332.537969  7406873.189150 
+333358.340424  7406917.941484 
+333364.096293  7406937.538128 
+333353.310224  7406969.332682 
+333340.140993  7406990.928982 
+333337.246566  7407016.244646 
+333337.048657  7407047.169349 
+333322.840401  7407071.285218 
+333301.416694  7407088.972188 
+333279.836308  7407100.060289 
+333246.158703  7407111.978248 
+333225.798759  7407126.125824 
+333214.179820  7407145.222553 
+333222.137433  7407169.678364 
+333228.792141  7407180.166568 
+333229.229191  7407201.732874 
+333220.067629  7407259.392997 
+333225.642081  7407291.437508 
+333233.583201  7407300.405972 
+333238.869035  7407317.483047 
+333238.613401  7407335.729921 
+333231.026869  7407354.116772 
+333222.483774  7407369.964057 
+333209.603162  7407389.800659 
+333195.386660  7407407.247671 
+333184.707792  7407420.355426 
+333171.686994  7407432.333374 
+333158.187914  7407442.271671 
+333135.296378  7407456.889168 
+333126.448172  7407476.015891 
+333122.432258  7407492.703033 
+333117.839107  7407513.669442 
+333112.553274  7407530.576546 
+333103.762792  7407546.423831 
+333083.105984  7407579.828109 
+333078.471602  7407604.353908 
+333078.900406  7407626.670086 
+333089.892632  7407667.903023 
+333104.257566  7407718.824301 
+333109.172319  7407744.999817 
+333108.322957  7407768.815737 
+333104.801817  7407785.252922 
+333094.988802  7407801.330168 
+333083.971838  7407813.838026 
+333077.242914  7407826.405873 
+333075.016432  7407840.583444 
+333081.118642  7407854.361084 
+333088.210401  7407868.658635 
+333099.301581  7407886.055655 
+333105.073942  7407904.662468 
+333107.531319  7407925.988815 
+333107.382887  7407953.624081 
+333103.193802  7407999.186277 
+332938.953626  7408038.109610 
+332946.498927  7408125.794590 
+332952.411474  7408178.075635 
+332961.630760  7408167.287483 
+332972.466307  7408144.621365 
+332988.637166  7408121.255368 
+333004.008140  7408104.198289 
+333018.034978  7408096.479612 
+333042.179941  7408095.929706 
+333058.688895  7408097.089507 
+333077.465562  7408101.798700 
+333099.029455  7408106.037974 
+333139.947252  7408105.628045 
+333168.652381  7408106.637872 
+333203.938002  7408111.996954 
+333221.436503  7408117.206061 
+333243.726064  7408127.764253 
+333263.954068  7408141.341927 
+333282.705997  7408149.600512 
+333312.103809  7408160.978563 
+333336.941456  7408169.277142 
+333352.881420  7408179.535385 
+333361.911042  7408196.292515 
+333363.807675  7408216.279091 
+333361.647163  7408233.706106 
+333360.492690  7408253.412730 
+333358.488856  7408284.997320 
+333358.777474  7408316.101992 
+333364.657037  7408347.496615 
+333373.167147  7408365.773484 
+333381.429870  7408382.780571 
+333400.866236  7408402.167250 
+333420.121184  7408409.915923 
+333441.932464  7408415.414981 
+333474.933879  7408421.014022 
+333504.372923  7408426.323112 
+333535.048901  7408436.701335 
+333563.671567  7408448.829257 
+333588.426752  7408469.775669 
+333606.098424  7408486.362828 
+333624.256624  7408506.499379 
+333637.862904  7408522.036717 
+333660.276159  7408551.811617 
+333674.632847  7408569.878523 
+333687.999987  7408583.906120 
+333707.675493  7408604.802540 
+333724.811160  7408624.169223 
+333735.349843  7408643.975830 
+333744.099094  7408663.772439 
+333752.592711  7408684.578875 
+333764.153927  7408703.635611 
+333778.007594  7408720.952645 
+333794.194945  7408730.690977 
+333807.858949  7408739.159526 
+333828.688928  7408740.599280 
+333844.183595  7408741.749083 
+333869.837619  7408742.478958 
+333895.508135  7408742.698920 
+333933.613967  7408743.788733 
+333967.720377  7408743.098852 
+333999.146762  7408744.668583 
+334025.501715  7408746.948192 
+334058.923688  7408752.327271 
+334092.609540  7408756.956478 
+334116.944166  7408758.206264 
+334143.851617  7408755.946651 
+334174.313193  7408752.977159 
+334195.885332  7408751.677382 
+334224.037964  7408751.197464 
+334247.820093  7408756.476560 
+334272.863895  7408763.285394 
+334301.626748  7408778.462794 
+334318.490290  7408791.500561 
+334336.805168  7408811.867072 
+334345.158600  7408839.702304 
+334351.747338  7408892.253303 
+334354.617026  7408936.435735 
+334355.367433  7408989.676615 
+334353.041996  7409019.931433 
+334347.079971  7409059.234700 
+334333.960218  7409104.276985 
+334321.854752  7409149.319270 
+334311.349054  7409186.552892 
+334298.625120  7409217.207641 
+334273.548333  7409266.669169 
+334250.491872  7409289.905189 
+334232.877923  7409301.843144 
+334218.793361  7409315.580791 
+334200.503222  7409345.425678 
+334192.924936  7409367.801846 
+334186.146534  7409386.908573 
+334177.636424  7409405.875324 
+334169.967429  7409416.673474 
+334165.827822  7409430.771060 
+334164.961967  7409450.177735 
+334166.198902  7409456.496653 
+334170.701344  7409468.624576 
+334185.602283  7409479.302746 
+334200.297066  7409483.162085 
+334217.045160  7409481.752327 
+334239.433676  7409468.524593 
+334266.143217  7409454.556985 
+334287.748342  7409446.868302 
+334314.960903  7409433.660565 
+334342.627007  7409429.791227 
+334371.051764  7409426.431803 
+334393.638189  7409424.542126 
+334410.897550  7409423.632282 
+334430.449363  7409419.213039 
+334443.651578  7409417.023414 
+334470.385858  7409393.017526 
+334489.616068  7409371.011296 
+334501.812243  7409342.866117 
+334510.907836  7409320.000034 
+334512.919916  7409295.794180 
+334512.383911  7409272.578157 
+334509.060680  7409249.582096 
+334508.442213  7409234.684647 
+334510.074966  7409223.346589 
+334515.204122  7409217.597574 
+334525.899483  7409212.908377 
+334548.197291  7409215.147994 
+334568.606711  7409228.975625 
+334598.276649  7409255.011166 
+334617.704769  7409265.049446 
+334634.848682  7409275.807603 
+334660.634645  7409283.886220 
+334702.451281  7409286.825716 
+334739.790213  7409281.396646 
+334760.867579  7409278.077215 
+334795.097682  7409278.917071 
+334832.238705  7409292.914673 
+334859.500744  7409306.302380 
+334887.768822  7409320.209998 
+334917.100665  7409328.828521 
+334940.651899  7409332.347919 
+334980.522425  7409326.938845 
+335007.454614  7409322.159664 
+335040.258119  7409313.151207 
+335064.658716  7409307.592159 
+335099.416578  7409305.662489 
+335131.090350  7409308.502003 
+335163.506283  7409313.621126 
+335189.811758  7409320.939873 
+335217.337676  7409333.077794 
+335241.532117  7409348.205202 
+335256.111453  7409361.212974 
+335278.203105  7409384.648960 
+335289.706597  7409401.416088 
+335287.265712  7409420.452827 
+335287.216235  7409430.031186 
+335277.691838  7409454.936920 
+335264.918427  7409472.013995 
+335250.124689  7409487.561332 
+335242.942223  7409501.378965 
+335234.209464  7409522.255389 
+335225.740585  7409540.112330 
+335217.288199  7409555.189748 
+335213.428963  7409564.998068 
+335182.571568  7409595.832786 
+335172.090609  7409611.150162 
+335158.558544  7409626.457540 
+335150.864811  7409642.294827 
+335142.082575  7409671.739784 
+335134.091978  7409695.905644 
+335131.172812  7409719.841544 
+335125.952948  7409745.527145 
+335119.743537  7409768.183264 
+335110.730407  7409793.338955 
+335102.253281  7409813.965422 
+335087.624468  7409845.150080 
+335075.271615  7409877.354564 
+335069.053957  7409901.770382 
+335065.392630  7409922.426843 
+335065.235952  7409950.662007 
+335069.416791  7409974.637900 
+335077.704253  7409990.075256 
+335090.535388  7410008.802048 
+335108.437954  7410028.578660 
+335118.267461  7410040.986535 
+335138.239832  7410052.954485 
+335159.721263  7410066.952087 
+335180.971799  7410076.910382 
+335205.784707  7410086.128803 
+335231.100635  7410095.107265 
+335253.159302  7410096.996941 
+335279.778135  7410098.666655 
+335299.049576  7410099.786463 
+335329.733800  7410100.726302 
+335358.372959  7410105.435496 
+335374.337662  7410108.295006 
+335390.277625  7410116.213649 
+335398.111545  7410121.552735 
+335406.671132  7410132.950782 
+335409.145001  7410145.058709 
+335409.516082  7410169.274561 
+335404.840469  7410189.411111 
+335389.436510  7410223.365295 
+335378.337084  7410259.859044 
+335369.233245  7410300.902014 
+335359.453215  7410326.567618 
+335345.541824  7410366.570766 
+335329.131825  7410398.755253 
+335316.564570  7410425.150731 
+335311.130304  7410444.787368 
+335302.884073  7410468.693273 
+335297.928088  7410492.869132 
+335297.045742  7410516.065158 
+335301.968741  7410543.070533 
+335323.573866  7410581.773903 
+335341.435201  7410609.359178 
+335359.296537  7410635.684669 
+335379.186445  7410663.289940 
+335393.279253  7410683.546470 
+335403.314916  7410704.532876 
+335410.810740  7410725.499284 
+335431.607733  7410772.521230 
+335445.923190  7410799.586594 
+335459.224360  7410824.372348 
+335483.864097  7410864.605457 
+335500.744131  7410886.141768 
+335519.900125  7410907.938034 
+335540.293053  7410936.043220 
+335562.384705  7410978.785899 
+335569.616650  7411002.021918 
+335583.577518  7411046.484302 
+335592.277291  7411080.068550 
+335606.568009  7411110.403354 
+335624.940611  7411135.978973 
+335652.186157  7411164.384107 
+335671.614276  7411183.400850 
+335694.827416  7411206.236938 
+335718.296188  7411227.553287 
+335738.738594  7411247.339898 
+335761.646623  7411279.494390 
+335775.706446  7411305.289971 
+335792.792636  7411334.894900 
+335805.005303  7411375.557935 
+335822.751192  7411422.819840 
+335838.014965  7411461.983131 
+335846.450859  7411496.327248 
+335857.443084  7411527.911838 
+335870.002093  7411550.427981 
+335883.855761  7411568.914815 
+335909.905603  7411582.932414 
+335945.611782  7411592.720737 
+335962.071259  7411598.619727 
+335990.413553  7411610.637668 
+336010.888944  7411623.105532 
+336030.869561  7411633.313784 
+336039.973399  7411639.162782 
+336054.115685  7411650.090910 
+336067.194207  7411671.347269 
+336072.183176  7411686.504673 
+336085.022557  7411703.471766 
+336104.764034  7411711.410407 
+336123.515962  7411715.799655 
+336152.171614  7411716.979453 
+336170.469999  7411709.520730 
+336189.576516  7411695.013215 
+336203.595108  7411682.485361 
+336219.114514  7411674.006814 
+336227.748318  7411671.787194 
+336244.257271  7411667.597911 
+336259.718954  7411670.207464 
+336277.415365  7411681.155589 
+336294.080997  7411695.113198 
+336309.946745  7411715.889639 
+336319.759759  7411730.817082 
+336328.509010  7411753.813143 
+336335.782185  7411769.740415 
+336340.795893  7411780.108639 
+336349.371973  7411788.477206 
+336362.302063  7411790.066934 
+336394.792212  7411785.217764 
+336418.928929  7411778.048992 
+336441.548340  7411770.620265 
+336463.128725  7411765.951064 
+336482.919679  7411764.551304 
+336498.645241  7411765.911071 
+336524.991947  7411771.360138 
+336542.968730  7411777.769040 
+336565.695342  7411796.055908 
+336582.080602  7411814.552739 
+336597.632993  7411846.167324 
+336608.666450  7411870.433167 
+336614.884108  7411892.409403 
+336624.169363  7411910.616284 
+336626.643233  7411923.494079 
+336626.857635  7411929.293085 
+336626.824650  7411936.601833 
+336628.308971  7411942.410838 
+336634.872971  7411948.249838 
+336641.164845  7411957.108321 
+336646.186799  7411966.466718 
+336649.666709  7411979.854425 
+336651.464387  7412023.486951 
+336652.569382  7412052.991897 
+336648.809101  7412091.795250 
+336646.376463  7412118.760631 
+336646.516648  7412139.687047 
+336648.190633  7412159.113719 
+336646.549633  7412180.030136 
+336634.749277  7412204.425958 
+336613.548218  7412232.281186 
+336595.423003  7412253.357576 
+336581.132286  7412269.664783 
+336565.588141  7412282.932510 
+336546.745504  7412295.940282 
+336530.467445  7412303.908917 
+336497.441291  7412314.557093 
+336482.449644  7412319.006331 
+336471.012122  7412322.975651 
+336457.018268  7412331.464197 
+336440.162973  7412351.540758 
+336429.904662  7412372.657141 
+336420.355527  7412403.621837 
+336413.346231  7412433.576706 
+336409.618934  7412464.571397 
+336404.349593  7412501.855011 
+336400.383156  7412531.339960 
+336405.603020  7412551.036586 
+336421.955295  7412575.582382 
+336439.379581  7412589.559988 
+336466.402479  7412611.396247 
+336497.762894  7412628.223365 
+336529.609837  7412649.339748 
+336556.665719  7412665.127044 
+336579.911844  7412682.164125 
+336596.090948  7412691.582512 
+336616.599324  7412699.011240 
+336632.968092  7412706.899888 
+336649.988312  7412715.098484 
+336670.744074  7412723.287081 
+336682.635139  7412729.406033 
+336695.491012  7412744.363471 
+336715.554091  7412786.586239 
+336726.620533  7412803.793291 
+336743.772693  7412820.790380 
+336759.193144  7412830.208767 
+336785.762499  7412842.966581 
+336808.307694  7412847.645780 
+336831.850682  7412855.844375 
+336846.792852  7412860.723540 
+336860.217716  7412863.583050 
+336877.971850  7412864.442903 
+336896.954673  7412871.361717 
+336926.550395  7412885.909226 
+336950.093383  7412894.617734 
+336968.309307  7412903.046290 
+336992.643934  7412905.955792 
+337015.964274  7412909.125249 
+337049.955237  7412908.565345 
+337075.073255  7412907.455535 
+337104.751439  7412907.625506 
+337131.378518  7412908.285393 
+337155.441019  7412915.234203 
+337177.911998  7412933.771027 
+337217.032116  7412969.304941 
+337252.861988  7413004.308945 
+337279.884886  7413026.905074 
+337320.077014  7413051.850801 
+337341.607922  7413056.520002 
+337369.678091  7413072.567253 
+337391.909929  7413088.834466 
+337416.656867  7413109.650901 
+337428.498454  7413124.348383 
+337449.897423  7413153.723352 
+337463.767583  7413168.170877 
+337494.591993  7413191.546873 
+337520.353218  7413211.113521 
+337543.079829  7413229.660344 
+337564.528275  7413251.466609 
+337593.752917  7413286.940533 
+337623.950613  7413331.742858 
+337655.203827  7413368.996477 
+337681.690720  7413395.122002 
+337702.141372  7413412.379046 
+337723.128029  7413424.107037 
+337749.466490  7413432.575587 
+337787.976387  7413440.624208 
+337828.226239  7413455.481663 
+337856.840659  7413464.730079 
+337891.516059  7413477.537885 
+337914.786922  7413490.535659 
+337951.936191  7413515.211432 
+337975.190561  7413530.468818 
+338005.272811  7413549.305592 
+338029.755870  7413570.381982 
+338050.965175  7413588.658851 
+338064.868320  7413597.057412 
+338091.940695  7413610.325140 
+338116.728864  7413623.332912 
+338139.719355  7413639.350168 
+338160.145269  7413662.166260 
+338172.704278  7413684.432446 
+338177.404629  7413705.888771 
+338181.527745  7413740.702807 
+338185.436458  7413768.718008 
+338192.932282  7413789.434460 
+338209.309296  7413810.960773 
+338233.050194  7413829.767551 
+338254.811996  7413838.466061 
+338296.331768  7413852.573645 
+338325.218314  7413859.042537 
+338360.437965  7413864.801550 
+338376.913934  7413866.911189 
+338397.191415  7413870.310607 
+338414.417791  7413874.189942 
+338428.576569  7413882.348545 
+338440.649050  7413901.835207 
+338451.905155  7413930.390315 
+338456.877632  7413949.327072 
+338462.023280  7413981.631538 
+338465.956732  7414004.597604 
+338467.391576  7414020.994796 
+338465.231064  7414045.950521 
+338468.043029  7414068.926585 
+338468.463586  7414086.623554 
+338468.694481  7414110.889398 
+338466.591692  7414130.126103 
+338461.487275  7414155.201807 
+338459.318516  7414167.099769 
+338456.671476  7414183.057036 
+338456.564275  7414197.974481 
+338457.661024  7414207.322879 
+338461.808878  7414215.621458 
+338466.929787  7414220.370644 
+338478.647681  7414223.290144 
+338507.897061  7414227.299458 
+338521.371402  7414229.189134 
+338536.429019  7414236.877817 
+338555.321134  7414246.806116 
+338573.182469  7414254.974717 
+338589.229634  7414259.863880 
+338601.945322  7414261.263640 
+338612.838592  7414258.624092 
+338628.720833  7414245.576327 
+338642.120957  7414238.617519 
+338660.584268  7414230.598892 
+338682.890322  7414225.319797 
+338714.852712  7414221.210501 
+338735.187917  7414222.780232 
+338756.273528  7414222.820225 
+338794.173204  7414228.519249 
+338819.851967  7414230.788860 
+338846.800648  7414233.308428 
+338866.154552  7414238.167596 
+338887.495797  7414238.977457 
+338911.393373  7414240.757152 
+338930.227764  7414244.616491 
+338955.106642  7414243.616663 
+338979.482499  7414242.356878 
+338995.752313  7414243.716646 
+339012.772533  7414243.806630 
+339025.719115  7414242.916783 
+339037.832828  7414234.958146 
+339050.911349  7414221.180506 
+339060.204851  7414209.962427 
+339095.506965  7414182.057207 
+339108.865858  7414171.559005 
+339128.046591  7414157.971333 
+339149.750670  7414143.343838 
+339163.637322  7414133.855464 
+339175.973683  7414122.357433 
+339184.549763  7414116.208487 
+339201.974049  7414105.160379 
+339213.625972  7414101.760961 
+339237.193700  7414095.711997 
+339250.651548  7414095.072107 
+339269.922989  7414092.352573 
+339285.648551  7414089.673032 
+339303.839736  7414079.384794 
+339319.243695  7414069.116553 
+339329.081448  7414058.828315 
+339351.758582  7414040.811401 
+339368.300521  7414030.313200 
+339392.445484  7414021.124773 
+339415.567915  7414013.696046 
+339438.426466  7414009.296800 
+339466.587344  7414007.697074 
+339489.404664  7414009.846705 
+339510.935572  7414014.255950 
+339537.554405  7414017.435405 
+339564.428870  7414019.864989 
+339591.542477  7414025.064099 
+339612.059099  7414030.483170 
+339632.023223  7414044.470775 
+339646.421142  7414054.389076 
+339656.019754  7414061.497858 
+339669.856929  7414077.535111 
+339684.617682  7414107.469983 
+339694.043124  7414137.214888 
+339699.098063  7414161.180783 
+339701.390515  7414188.966024 
+339703.320133  7414205.383212 
+339703.938600  7414216.501307 
+339711.162299  7414229.069155 
+339720.876358  7414235.548045 
+339740.263246  7414244.206562 
+339766.247119  7414252.035221 
+339791.480585  7414261.393618 
+339803.487097  7414268.102468 
+339826.452849  7414279.250559 
+339853.319069  7414299.717053 
+339874.091324  7414321.003407 
+339905.905281  7414354.307702 
+339928.038165  7414385.182414 
+339947.647701  7414417.356903 
+339964.783368  7414456.370220 
+339973.903699  7414481.305949 
+339992.688613  7414506.151693 
+340014.013365  7414531.977269 
+340027.603153  7414545.494954 
+340060.917925  7414576.519639 
+340088.056270  7414599.505702 
+340117.734454  7414621.461941 
+340146.653985  7414644.438006 
+340187.769691  7414667.794005 
+340217.637539  7414683.431326 
+340261.540471  7414705.997461 
+340290.822836  7414717.215539 
+340307.727608  7414724.234337 
+340334.692783  7414738.691861 
+340359.901510  7414750.859776 
+340388.689101  7414761.297989 
+340426.448591  7414784.963935 
+340457.165800  7414803.250802 
+340493.927496  7414825.147052 
+340515.598591  7414837.015019 
+340543.479096  7414859.311200 
+340574.798280  7414890.725819 
+340593.261591  7414916.191457 
+340624.391112  7414963.503353 
+340646.779628  7414999.107254 
+340665.737712  7415025.082805 
+340684.728781  7415049.028703 
+340700.561544  7415061.086637 
+340724.723000  7415076.264038 
+340740.052743  7415088.062017 
+340751.795375  7415102.079616 
+340764.230691  7415122.926045 
+340778.653348  7415146.571995 
+340793.809920  7415172.497554 
+340808.966492  7415198.423113 
+340825.483692  7415216.290053 
+340851.846891  7415238.306281 
+340879.001729  7415257.812940 
+340910.312667  7415269.550929 
+340935.348223  7415275.149970 
+340966.939533  7415284.358393 
+340986.862426  7415293.436838 
+341003.445596  7415306.754557 
+341017.958962  7415323.081760 
+341023.879755  7415336.279499 
+341028.373951  7415363.084908 
+341030.320061  7415390.870149 
+341037.568498  7415420.994988 
+341045.155030  7415443.291169 
+341062.645285  7415464.957458 
+341080.473636  7415479.804915 
+341100.074926  7415494.682366 
+341120.690503  7415509.569816 
+341148.917351  7415524.537253 
+341177.276138  7415549.113043 
+341197.141307  7415563.230625 
+341214.878949  7415585.396828 
+341222.968502  7415608.212920 
+341225.161999  7415636.758030 
+341230.860144  7415668.882528 
+341237.951903  7415690.418839 
+341249.595580  7415713.274923 
+341263.416263  7415744.479578 
+341275.447514  7415777.693889 
+341279.991187  7415800.459989 
+341291.478186  7415835.933913 
+341301.629296  7415856.240435 
+341309.529185  7415874.257349 
+341321.247079  7415911.500969 
+341333.294822  7415942.685628 
+341346.431067  7415967.831320 
+341366.329222  7416000.125789 
+341382.821683  7416020.512297 
+341400.617049  7416037.889320 
+341420.201846  7416054.526470 
+341447.101051  7416074.033129 
+341468.516512  7416085.901096 
+341484.679124  7416091.140199 
+341508.964273  7416096.729241 
+341525.819568  7416108.037304 
+341539.912377  7416116.785806 
+341554.227833  7416128.823744 
+341570.035857  7416142.891334 
+341590.766881  7416148.190426 
+341607.275835  7416145.860825 
+341618.243322  7416140.691711 
+341625.706160  7416131.953208 
+341638.570280  7416116.705819 
+341656.695495  7416107.587381 
+341672.470534  7416103.228128 
+341692.310965  7416098.678907 
+341715.021084  7416087.080894 
+341727.085320  7416075.112944 
+341746.777319  7416040.778825 
+341764.556192  7416017.512810 
+341796.089778  7415989.877544 
+341819.352395  7415974.760133 
+341853.458805  7415965.071793 
+341882.188672  7415958.602901 
+341905.723414  7415963.432074 
+341931.550609  7415966.511546 
+341948.950155  7415974.800127 
+341969.376069  7415984.388484 
+341989.546349  7415994.466758 
+342015.456006  7416012.193721 
+342031.066120  7416021.212177 
+342058.286928  7416035.679698 
+342078.053142  7416036.669529 
+342108.308563  7416030.720548 
+342127.893360  7416025.911372 
+342154.908012  7416015.133218 
+342174.558780  7416005.524864 
+342201.326044  7415993.726885 
+342236.479726  7415981.279017 
+342275.401934  7415971.400709 
+342311.000912  7415963.742021 
+342331.632981  7415956.423274 
+342350.096291  7415939.986090 
+342365.013723  7415922.749042 
+342370.555190  7415904.642144 
+342375.906993  7415881.746066 
+342384.351134  7415854.580719 
+342395.104218  7415825.435711 
+342406.261368  7415805.129190 
+342428.146865  7415778.133814 
+342454.559541  7415754.217910 
+342484.328434  7415725.042908 
+342510.980251  7415702.396787 
+342538.869003  7415682.540188 
+342550.652867  7415672.841849 
+342574.204102  7415654.954913 
+342595.974151  7415637.287939 
+342624.679280  7415612.902116 
+342649.516926  7415593.265480 
+342675.665724  7415569.849491 
+342704.857380  7415546.983408 
+342737.100142  7415523.137492 
+342766.910266  7415511.889419 
+342797.446058  7415503.670827 
+342818.350253  7415495.092296 
+342840.615075  7415478.445148 
+342854.732622  7415464.477540 
+342867.613234  7415448.480280 
+342894.091881  7415418.515413 
+342919.341839  7415406.957393 
+342948.352079  7415398.968761 
+342970.179851  7415397.469018 
+342989.970805  7415396.949107 
+342978.170449  7415387.210775 
+342972.447565  7415377.812385 
+342960.020495  7415356.965956 
+342958.437219  7415341.548597 
+342953.885299  7415319.282411 
+342948.286109  7415300.035708 
+342935.644637  7415276.159797 
+342927.480869  7415258.902753 
+342914.080744  7415234.256975 
+342888.352504  7415181.196064 
+342876.725319  7415156.830237 
+342865.048657  7415115.807264 
+342857.726004  7415092.501256 
+342855.045979  7415062.686363 
+342849.694175  7415022.743205 
+342852.036105  7414997.027610 
+342857.313692  7414958.984127 
+342863.201501  7414934.068395 
+342873.212425  7414903.143692 
+342881.846229  7414860.091066 
+342884.534500  7414826.806767 
+342884.872595  7414799.301479 
+342880.452616  7414765.927196 
+342871.744596  7414752.449504 
+342859.985471  7414739.181777 
+342841.291266  7414733.152810 
+342819.092413  7414723.044541 
+342801.165108  7414716.265702 
+342778.949762  7414707.677173 
+342759.571120  7414695.329288 
+342741.050086  7414675.162743 
+342733.150197  7414657.405784 
+342731.599906  7414638.708987 
+342731.212333  7414607.914262 
+342728.837419  7414574.060061 
+342721.432304  7414556.813015 
+342711.998616  7414540.545801 
+342696.899768  7414530.527517 
+342677.504633  7414519.439417 
+342659.140277  7414507.101530 
+342645.591720  7414495.333546 
+342620.778812  7414470.547791 
+342566.617570  7414419.426548 
+342528.544723  7414380.103284 
+342448.069758  7414302.916505 
+342399.911771  7414258.924041 
+342369.598627  7414227.769377 
+342339.268991  7414198.134453 
+342315.965143  7414174.628480 
+342290.385335  7414151.102509 
+342267.947342  7414139.734457 
+342243.703424  7414131.365890 
+342225.751380  7414126.856663 
+342207.527210  7414123.867175 
+342194.390964  7414119.667894 
+342186.350890  7414113.258992 
+342173.560986  7414101.501006 
+342167.986534  7414087.293439 
+342157.612776  7414072.146034 
+342143.684892  7414055.988802 
+342126.969783  7414035.782263 
+342114.311819  7414019.625030 
+342102.156875  7414003.967712 
+342095.592875  7413988.830305 
+342090.290549  7413969.653590 
+342085.260348  7413947.207435 
+342084.023413  7413927.790761 
+342085.845830  7413900.555426 
+342087.173474  7413869.280783 
+342084.938745  7413840.785664 
+342082.951403  7413815.060071 
+342082.984388  7413797.153138 
+342087.594031  7413772.447370 
+342095.238287  7413751.530952 
+342103.905076  7413730.604537 
+342111.301944  7413706.918594 
+342120.496492  7413676.413819 
+342123.852707  7413642.629606 
+342128.981863  7413612.374789 
+342134.358405  7413582.879841 
+342142.019154  7413554.134765 
+342150.438555  7413527.669298 
+342156.062484  7413502.963530 
+342163.467599  7413478.257762 
+342166.287810  7413460.870740 
+342167.095941  7413431.615751 
+342162.832640  7413406.640029 
+342154.240067  7413387.213357 
+342149.465500  7413357.198498 
+342146.216485  7413331.972819 
+342146.249470  7413310.786448 
+342148.566661  7413291.879687 
+342150.380831  7413272.213055 
+342154.858535  7413246.207510 
+342158.330198  7413222.541564 
+342157.868409  7413194.046445 
+342157.926132  7413164.031586 
+342156.705690  7413137.046208 
+342156.235655  7413113.590226 
+342148.418229  7413085.844978 
+342143.115902  7413069.947702 
+342121.840627  7413048.731336 
+342102.593925  7413029.284667 
+342081.054770  7413012.857481 
+342063.820148  7412998.709904 
+342051.920838  7412985.582153 
+342044.078672  7412969.934833 
+342039.526753  7412962.366129 
+342035.989120  7412955.297340 
+342034.480060  7412948.238549 
+342041.093537  7412938.160276 
+342051.252893  7412932.871181 
+342066.236294  7412926.342300 
+342077.409936  7412920.303334 
+342083.767780  7412911.994757 
+342087.354891  7412891.068342 
+342085.095423  7412875.431020 
+342069.650233  7412859.263790 
+342052.415611  7412845.116213 
+342030.373437  7412829.198940 
+342007.061343  7412812.011884 
+341983.741003  7412796.344567 
+341956.371763  7412777.637772 
+341931.525870  7412764.739981 
+341915.058147  7412753.121971 
+341884.646049  7412731.385694 
+341867.930939  7412712.448938 
+341854.514322  7412692.252397 
+341845.418730  7412673.575596 
+341833.791544  7412645.820351 
+341825.710238  7412622.864283 
+341807.989089  7412600.138176 
+341792.304758  7412575.402413 
+341772.563282  7412544.607688 
+341754.833886  7412525.920888 
+341728.503672  7412493.346468 
+341703.690764  7412464.811356 
+341679.372629  7412439.305725 
+341648.721390  7412409.250873 
+341563.842938  7412339.272860 
+341468.846361  7412251.367917 
+341439.448549  7412229.631640 
+341412.087555  7412208.665231 
+341386.491255  7412188.958607 
+341363.179161  7412172.281464 
+341340.625721  7412153.834623 
+341319.853466  7412133.878042 
+341308.721054  7412114.441371 
+341292.286317  7412080.627163 
+341282.679458  7412062.710232 
+341273.592112  7412035.964813 
+341261.973173  7412005.430044 
+341245.274556  7411976.405015 
+341234.397777  7411956.718388 
+341218.977326  7411927.693359 
+341196.704257  7411894.878980 
+341179.741761  7411870.143217 
+341168.370209  7411845.657411 
+341154.186692  7411831.519833 
+341135.690397  7411814.342775 
+341107.826383  7411787.067447 
+341087.054128  7411769.890390 
+341062.488607  7411741.605235 
+341044.767457  7411719.139083 
+340989.798084  7411664.578429 
+340954.611418  7411621.405824 
+340937.896308  7411598.679716 
+340922.459364  7411576.973434 
+340904.993848  7411550.977887 
+340891.832864  7411534.310742 
+340866.756076  7411508.045241 
+340837.613897  7411485.809050 
+340803.655920  7411464.572688 
+340777.037087  7411447.895544 
+340750.937767  7411430.448533 
+340728.631713  7411414.781217 
+340706.845172  7411397.604159 
+340687.087203  7411379.667231 
+340671.130747  7411363.250043 
+340658.720170  7411350.122292 
+340654.184743  7411330.945577 
+340650.919236  7411308.999336 
+340656.279285  7411293.372013 
+340661.375456  7411278.754517 
+340680.193354  7411257.858096 
+340693.906836  7411249.549519 
+340717.021020  7411235.971845 
+340736.564587  7411230.702748 
+340758.911872  7411224.173866 
+340777.366936  7411217.674979 
+340786.264619  7411206.336921 
+340796.935242  7411194.498949 
+340799.475081  7411188.449985 
+340813.699828  7411176.112098 
+340825.129104  7411162.754386 
+340842.149324  7411147.896931 
+340858.905665  7411133.039476 
+340875.670252  7411117.932064 
+340887.355161  7411107.353876 
+340901.068642  7411092.486423 
+340914.015224  7411085.697586 
+340928.487359  7411074.109571 
+340951.865423  7411046.144361 
+340961.274372  7411031.276907 
+340967.632216  7411018.419110 
+340972.728387  7411001.272047 
+340974.773452  7410990.433903 
+340981.139542  7410973.286841 
+340985.955340  7410959.729163 
+340992.667772  7410948.551078 
+340995.867310  7410941.602268 
+341000.600646  7410851.987618 
+340996.320852  7410832.051033 
+340991.018526  7410815.643843 
+340980.636522  7410800.746395 
+340974.831175  7410786.868772 
+340972.307829  7410773.751019 
+340969.800975  7410755.834088 
+340969.817467  7410745.235904 
+340977.964743  7410723.559617 
+340992.709003  7410701.383415 
+341003.140485  7410682.726611 
+341008.995309  7410663.819849 
+341011.056867  7410645.413002 
+341010.067319  7410626.236287 
+341005.531892  7410611.098880 
+340995.405521  7410596.701346 
+340985.287396  7410578.524460 
+340974.658004  7410563.627012 
+340969.611311  7410549.499431 
+340967.079719  7410543.190512 
+340963.294699  7410532.842285 
+340963.129774  7410519.884504 
+340961.488774  7410508.746412 
+340967.038487  7410501.037733 
+340978.904813  7410487.190105 
+341001.845827  7410459.484850 
+341010.619816  7410442.497760 
+341010.858957  7410419.981617 
+341006.430731  7410396.635616 
+341001.936535  7410382.757993 
+340997.285661  7410361.361658 
+340991.727702  7410344.704511 
+340986.425376  7410327.797407 
+340981.139542  7410304.841339 
+340978.880075  7410287.934235 
+340964.704804  7410271.517047 
+340948.484468  7410264.428262 
+340930.738580  7410256.589604 
+340912.497918  7410245.461510 
+340897.803135  7410232.073804 
+340890.480482  7410213.397003 
+340885.169910  7410204.558517 
+340878.605910  7410183.112190 
+340875.579543  7410168.724655 
+340872.808810  7410159.896167 
+340863.952358  7410142.479150 
+340853.578600  7410128.591529 
+340848.762801  7410126.571875 
+340838.619938  7410123.522397 
+340838.619938  7410123.522397 
+340804.109462  7410135.840288 
+340783.048589  7410143.378996 
+340767.059148  7410149.158006 
+340752.083993  7410158.976325 
+340737.620105  7410163.745508 
+340721.375030  7410171.284216 
+340699.563750  7410174.033745 
+340691.952479  7410175.783446 
+340680.036676  7410173.503836 
+340658.744908  7410162.875657 
+340628.085423  7410143.658948 
+340611.625946  7410126.991803 
+340596.436390  7410109.064874 
+340586.062631  7410093.407556 
+340573.149034  7410077.250323 
+340562.519643  7410066.642141 
+340551.370739  7410057.033786 
+340542.761674  7410049.705042 
+340532.627057  7410042.886210 
+340528.569911  7410038.846902 
+340510.065370  7410032.507987 
+340490.546542  7410025.929114 
+340479.397638  7410023.139592 
+340473.567553  7410019.600198 
+340465.197629  7410018.570375 
+340460.126197  7410016.550721 
+340455.813418  7410017.800507 
+340452.506680  7410026.379037 
+340450.717248  7410032.927916 
+340448.177409  7410037.467138 
+340438.529319  7410044.515931 
+340417.006657  7410020.020126 
+340398.518608  7410003.852896 
+340385.101991  7409989.205405 
+340373.194434  7409976.827525 
+340364.841002  7409967.479126 
+340352.430425  7409956.111074 
+340341.133089  7409948.062452 
+340328.986391  7409943.453242 
+340319.132145  7409936.834375 
+340299.671041  7409922.856770 
+340282.725037  7409913.678342 
+340275.385892  7409911.618695 
+340264.228742  7409911.048792 
+340253.830245  7409910.488888 
+340243.233839  7409900.090669 
+340238.690165  7409895.521452 
+340236.455437  7409886.682966 
+340226.865071  7409878.554358 
+340223.104790  7409870.465744 
+340214.256584  7409864.366789 
+340210.001529  7409854.248522 
+340208.286313  7409842.900465 
+340206.587590  7409828.013016 
+340202.629399  7409810.586001 
+340192.280379  7409801.447566 
+340183.959933  7409792.329128 
+340174.089195  7409787.479959 
+340167.508703  7409785.170354 
+340156.895804  7409777.041746 
+340148.303231  7409772.452533 
+340140.741438  7409762.574225 
+340136.238996  7409751.196174 
+340130.986147  7409738.058424 
+340125.716806  7409727.180287 
+340115.343047  7409722.081161 
+340094.323406  7409715.902219 
+340081.640703  7409715.832231 
+340068.958000  7409717.022027 
+340055.252765  7409717.691913 
+340041.794916  7409720.891365 
+340026.819761  7409722.071162 
+340009.576893  7409721.461267 
+339995.409869  7409714.322490 
+339984.343427  7409697.105439 
+339976.822865  7409681.428124 
+339971.297891  7409671.059900 
+339966.300675  7409656.912324 
+339964.354564  7409642.024874 
+339953.048982  7409621.788340 
+339947.779641  7409610.660246 
+339942.774179  7409598.272368 
+339940.547696  7409587.674183 
+339935.022722  7409578.315786 
+339929.489501  7409569.457304 
+339922.430728  7409561.598650 
+339919.684733  7409553.510035 
+339918.200411  7409546.691203 
+339919.824919  7409527.794440 
+339922.653376  7409520.495691 
+339926.248733  7409512.707025 
+339925.572542  7409497.319660 
+339919.824919  7409487.751299 
+339915.009120  7409479.612693 
+339909.261497  7409464.445291 
+339905.921774  7409448.068097 
+339898.491920  7409429.821222 
+339893.338026  7409412.364212 
+339885.479368  7409386.048720 
+339877.084705  7409363.002668 
+339866.183188  7409336.147268 
+339858.002928  7409316.630611 
+339852.420230  7409290.845028 
+339848.643456  7409262.039962 
+339868.953922  7409259.720359 
+339885.767986  7409252.571583 
+339899.530945  7409245.132858 
+339919.231190  7409227.165935 
+339937.735732  7409202.620140 
+339948.604264  7409179.774053 
+339957.172097  7409159.917454 
+339962.515655  7409131.462328 
+339967.916936  7409098.208025 
+339972.114267  7409083.370566 
+339975.082910  7409065.483630 
+339980.005910  7409028.689932 
+339979.206026  7409006.733693 
+339978.356664  7408989.316677 
+339970.992780  7408964.011011 
+339964.610197  7408942.244740 
+339956.974188  7408919.458643 
+339952.108912  7408897.962325 
+339952.282083  7408880.055392 
+339960.379881  7408856.419441 
+339968.411710  7408838.582496 
+339971.182443  7408814.636598 
+339972.188483  7408788.911004 
+339971.941097  7408762.165586 
+339973.771760  7408730.640985 
+339984.632045  7408709.554597 
+340007.655521  7408688.838146 
+340025.244731  7408679.429757 
+340039.428248  7408675.310463 
+340041.019771  7408668.751587 
+340045.101655  7408660.772953 
+340048.647534  7408655.273895 
+340051.657408  7408648.365079 
+340050.775061  7408640.736385 
+340046.874594  7408635.067356 
+340042.083534  7408631.337995 
+340038.009896  7408626.728785 
+340035.700952  7408619.100091 
+340030.027545  7408608.111974 
+340026.654837  7408604.382612 
+340021.336018  7408603.142825 
+340011.588973  7408600.663249 
+340006.261908  7408595.874070 
+340003.070617  7408589.845103 
+340002.188271  7408582.576348 
+340000.415331  7408574.237776 
+339996.688035  7408568.748716 
+339989.777693  7408558.990388 
+339987.650166  7408555.450994 
+339986.759573  7408546.582513 
+339987.650166  7408539.663698 
+339990.305452  7408530.975186 
+340005.734150  7408506.679348 
+340015.662611  7408481.503660 
+340023.108958  7408461.107154 
+340025.945661  7408455.618094 
+340030.200716  7408451.888733 
+340044.565650  7408443.560160 
+340053.611765  7408436.821314 
+340058.930584  7408428.132802 
+340060.348935  7408420.864047 
+340059.639759  7408399.577694 
+340057.330815  7408376.351672 
+340057.512232  7408368.722979 
+340060.348935  7408363.403890 
+340067.440694  7408355.785195 
+340069.922809  7408350.636077 
+340071.167990  7408347.806562 
+340070.458814  7408344.077200 
+340068.331287  7408341.597625 
+340063.721644  7408332.379204 
+340062.121875  7408327.769994 
+340061.412699  7408320.671210 
+340060.348935  7408303.294186 
+340058.221408  7408294.255734 
+340055.557875  7408285.037313 
+340053.430348  7408280.958012 
+340044.747067  7408266.240533 
+340032.864249  7408245.494087 
+340027.190842  7408236.975546 
+340022.754370  7408230.236700 
+340020.453671  7408225.097580 
+340012.652737  7408201.511621 
+340008.389436  7408189.103746 
+340002.716029  7408169.237149 
+339997.578628  7408158.778940 
+339993.323573  7408152.749973 
+339985.341221  7408146.900975 
+339954.310655  7408128.634104 
+339947.573485  7408122.425167 
+339942.963842  7408114.986442 
+339940.836315  7408108.597536 
+339934.272315  7408083.591819 
+339929.662672  7408067.994491 
+339920.971145  7408031.820687 
+339919.025034  7408022.062359 
+339917.252095  7408013.913754 
+339916.006914  7408004.515364 
+339915.652326  7407995.466914 
+339915.825497  7407962.662533 
+339914.588562  7407949.894720 
+339911.042683  7407934.997272 
+339880.523384  7408001.065955 
+339864.072153  7407998.106462 
+339830.914060  7408023.382133 
+339783.506480  7408042.338885 
+339739.290191  7408048.657803 
+339610.236682  7408099.919022 
+339579.758613  7408108.677522 
+339562.672423  7408107.887657 
+339554.277760  7408104.978156 
+339600.258743  7408019.822742 
+339646.239725  7407912.531120 
+339683.702350  7407825.685996 
+339717.767529  7407742.240290 
+339751.824462  7407634.948668 
+339785.889641  7407525.957337 
+339816.540880  7407379.502423 
+339831.565512  7407299.006212 
+339844.495602  7407178.736813 
+339847.348798  7407144.512675 
+339820.127990  7407136.734007 
+339805.911489  7407138.103773 
+339789.410781  7407140.463368 
+339776.975465  7407141.103259 
+339763.303215  7407138.443714 
+339748.468246  7407125.425944 
+339733.402383  7407109.888606 
+339714.007248  7407096.570887 
+339699.889701  7407087.852380 
+339678.672150  7407079.313843 
+339671.225804  7407062.086794 
+339660.983985  7407046.079536 
+339650.676197  7407037.151065 
+339635.329962  7407023.873339 
+339618.985932  7407010.085701 
+339598.848637  7406993.998457 
+339579.181377  7406982.190479 
+339562.804363  7406971.432322 
+339541.405394  7406955.325081 
+339527.889822  7406936.518302 
+339519.693069  7406919.281255 
+339512.197245  7406910.302793 
+339503.645904  7406900.194524 
+339487.499785  7406891.206064 
+339478.931951  7406885.567030 
+339476.524052  7406873.179152 
+339435.573270  7406833.405965 
+339432.464441  7406813.949297 
+339422.164899  7406777.265581 
+339413.786729  7406752.699789 
+339397.879750  7406718.985564 
+339386.904017  7406699.958823 
+339369.174621  7406672.023608 
+339357.745345  7406647.437819 
+339329.576222  7406596.946468 
+339299.914530  7406570.411013 
+339282.069687  7406553.833853 
+339270.500225  7406543.875559 
+339251.929714  7406523.759004 
+339246.718096  7406511.591089 
+339241.564202  7406494.384036 
+339240.244805  7406473.177668 
+339240.434468  7406453.501039 
+339237.655489  7406426.725625 
+339236.517509  7406413.587876 
+339230.712162  7406384.262899 
+339220.610530  7406354.388016 
+339209.981139  7406325.273003 
+339200.027938  7406306.246262 
+339197.059295  7406298.147650 
+339191.385888  7406281.940426 
+339188.895527  7406251.635617 
+339188.054411  7406233.208773 
+339184.013758  7406205.663491 
+339177.441512  7406177.338343 
+339171.900045  7406147.763409 
+339160.949051  7406100.221553 
+339155.894112  7406071.906403 
+339147.078891  7406032.783104 
+339124.096646  7406000.868571 
+339110.696522  7405997.679117 
+339101.757608  7405997.679117 
+339094.740065  7405998.958898 
+339036.999958  7406045.990842 
+338970.634294  7406070.436654 
+338869.337597  7406045.990842 
+338809.964736  7406026.784132 
+338762.804543  7405998.838918 
+338715.652596  7405981.371910 
+338678.156985  7405958.225875 
+338682.486256  7405934.050016 
+338679.954664  7405911.313911 
+338679.105302  7405897.166334 
+338674.190548  7405883.238720 
+338666.801926  7405864.731890 
+338660.534791  7405858.093027 
+338658.102152  7405849.484501 
+338657.953720  7405839.646187 
+338658.852559  7405828.048173 
+338657.970213  7405816.170208 
+338651.472183  7405808.271561 
+338647.208882  7405804.192260 
+338635.672405  7405792.704227 
+338627.426174  7405782.256017 
+338616.706075  7405766.238761 
+338610.785281  7405751.781237 
+338602.860653  7405735.793976 
+338597.665528  7405724.375931 
+338592.016860  7405708.158709 
+338577.214876  7405694.621028 
+338570.180841  7405688.732037 
+338559.337048  7405683.812880 
+338536.857823  7405675.984221 
+338522.954678  7405672.794767 
+338510.362684  7405665.336044 
+338501.794851  7405660.186926 
+338484.741646  7405643.839727 
+338479.035254  7405632.921597 
+338474.293671  7405626.312729 
+338470.822008  7405619.453904 
+338442.017925  7405588.589190 
+338426.003745  7405570.492290 
+338413.733353  7405556.974606 
+338406.996183  7405547.306262 
+338402.312324  7405535.898216 
+338389.629621  7405514.051958 
+338375.355396  7405498.494623 
+338366.284542  7405493.595462 
+338356.677684  7405490.955914 
+338341.051077  7405482.957284 
+338326.174876  7405475.718524 
+338309.814355  7405465.440285 
+338283.607834  7405428.546604 
+338273.720603  7405409.839809 
+338270.149985  7405408.200090 
+338258.432092  7405390.903052 
+338243.984696  7405368.526885 
+338231.499902  7405351.479805 
+338218.000823  7405334.922641 
+338205.713939  7405322.414784 
+338197.673864  7405312.686450 
+338190.219272  7405303.058099 
+338177.025303  7405281.711756 
+338166.371173  7405259.885494 
+338151.429003  7405236.499500 
+338141.764421  7405216.442936 
+338134.821094  7405202.995239 
+338128.834331  7405194.346721 
+338121.775557  7405190.727341 
+338108.103307  7405189.057627 
+338093.367293  7405191.917137 
+338087.768102  7405193.616846 
+338077.872625  7405194.516692 
+338064.233360  7405190.067454 
+338049.596301  7405184.098476 
+338031.207206  7405173.540285 
+338024.643207  7405171.190687 
+338013.057253  7405164.751790 
+338001.900103  7405164.371855 
+337994.544465  7405164.541826 
+337985.720998  7405160.402535 
+337981.218556  7405154.793496 
+337975.487426  7405146.144977 
+337973.038295  7405138.806234 
+337968.865703  7405126.638318 
+337966.688698  7405117.529879 
+337970.399501  7405103.442292 
+337977.887079  7405091.164395 
+337984.261415  7405086.385213 
+338000.325072  7405079.536387 
+338032.073060  7405067.968368 
+338047.938808  7405064.049039 
+338067.342189  7405059.939743 
+338085.170540  7405058.170046 
+338110.445237  7405054.650649 
+338139.447230  7405051.711153 
+338147.528536  7405050.341387 
+338161.192540  7405047.791824 
+338180.785584  7405046.612026 
+338197.245060  7405043.472564 
+338226.634626  7405037.603569 
+338243.292012  7405033.684241 
+338268.764619  7405027.605282 
+338309.327827  7405019.966590 
+338334.800434  7405012.717832 
+338357.527045  7405008.988471 
+338388.879214  7405002.129646 
+338396.911043  7404999.980014 
+338410.039042  7404995.270821 
+338416.899906  7404993.711088 
+338409.098972  7404985.572482 
+338401.842289  7404979.013605 
+338366.259804  7404957.587275 
+338354.162583  7404947.738962 
+338334.000549  7404930.521911 
+338308.948501  7404914.054732 
+338281.447321  7404898.377418 
+338242.591083  7404879.330680 
+338215.840310  7404869.322394 
+338182.542031  7404862.483566 
+338168.729595  7404859.904008 
+338158.207404  7404854.934859 
+338149.326214  7404848.355986 
+338143.710531  7404841.017243 
+338136.519818  7404828.789337 
+338130.096004  7404814.041863 
+338102.017589  7404777.238168 
+338090.695514  7404757.661521 
+338084.799459  7404742.804066 
+338076.305842  7404723.927299 
+338070.830344  7404712.589241 
+338066.633013  7404703.400815 
+338054.370868  7404682.644371 
+338044.458899  7404666.367159 
+338030.539262  7404642.311279 
+338010.014393  7404607.397260 
+337999.632389  7404589.470331 
+337988.310314  7404566.584251 
+337974.390677  7404544.408049 
+337965.897060  7404529.310635 
+337939.946172  7404488.267666 
+337902.912350  7404428.347929 
+337884.976798  7404396.743343 
+337870.826266  7404372.677465 
+337855.727418  7404347.911707 
+337839.210218  7404321.726193 
+337823.171299  7404294.590841 
+337812.080119  7404276.433951 
+337805.243994  7404263.216215 
+337799.817974  7404251.898154 
+337792.734462  7404242.699729 
+337785.659196  7404235.151022 
+337777.404719  7404230.191872 
+337758.999133  7404224.772800 
+337733.996561  7404221.463367 
+337710.164955  7404222.413204 
+337698.133704  7404224.062921 
+337673.131133  7404229.481993 
+337660.629847  7404233.021387 
+337641.284190  7404240.100174 
+337620.281041  7404248.598719 
+337605.660474  7404257.557184 
+337587.254887  7404269.585124 
+337570.506792  7404277.613749 
+337564.140702  7404279.973345 
+337551.631170  7404282.802860 
+337539.369026  7404285.392416 
+337534.883076  7404285.162456 
+337529.457056  7404283.502740 
+337522.851826  7404281.153142 
+337497.140078  7404268.175365 
+337491.474918  7404263.926093 
+337484.399652  7404259.676821 
+337417.638169  7404197.637448 
+337402.061039  7404180.660356 
+337381.536171  7404158.244196 
+337357.242775  7404132.768559 
+337320.670743  7404094.085186 
+337289.772116  7404056.571611 
+337277.262584  7404039.584521 
+337264.522158  7404025.436944 
+337250.371626  7404015.758602 
+337230.085899  7404008.689813 
+337208.612714  7404007.270056 
+337184.080178  7404008.919774 
+337164.973662  7404012.229207 
+337143.269583  7404017.648278 
+337130.760051  7404023.077349 
+337123.940418  7404027.326621 
+337102.533203  7403993.292450 
+337061.120633  7403917.935358 
+337003.479481  7403951.209659 
+336890.291719  7404014.188871 
+336863.631655  7404032.395752 
+336790.636021  7404073.218760 
+336764.338792  7404078.897787 
+336735.435754  7404085.016739 
+336700.785092  7404086.176540 
+336678.709933  7404089.965891 
+336655.084482  7404097.964521 
+336630.403514  7404116.621325 
+336614.108962  7404137.047826 
+336593.147044  7404177.150957 
+336571.492442  7404204.936198 
+336561.217639  7404216.744175 
+336547.223785  7404230.821764 
+336521.610993  7404238.800397 
+336494.266492  7404244.919349 
+336464.192489  7404244.559411 
+336432.609425  7404239.580264 
+336399.104990  7404239.200329 
+336375.083720  7404240.380127 
+336364.083249  7404242.689731 
+336343.533642  7404249.168621 
+336317.681709  7404265.545816 
+336297.313519  7404295.350711 
+336283.228957  7404315.197311 
+336270.422561  7404345.922048 
+336262.102114  7404312.637749 
+336208.443892  7404340.522973 
+336151.388222  7404372.117561 
+336137.930373  7404343.362487 
+336082.886784  7404315.837201 
+336019.506255  7404306.238845 
+335888.176786  7404290.321572 
+335817.514835  7404277.353793 
+335730.088298  7404262.496338 
+335639.544685  7404248.888669 
+335605.891818  7404243.089662 
+335572.807941  7404232.081548 
+335548.761932  7404217.304079 
+335548.745440  7404217.314078 
+335468.344691  7404202.616595 
+335423.303779  7404295.690652 
+335317.356208  7404380.446134 
+335218.475656  7404389.864521 
+335129.004054  7404375.736941 
+335010.522212  7404275.864048 
+334987.746123  7404213.284768 
+334903.980912  7404223.842959 
+334903.972666  7404223.812964 
+334903.947927  7404223.842959 
+334900.476264  7404177.790847 
+334903.857218  7404130.598931 
+334784.311613  7404192.278366 
+334720.881606  7404220.653505 
+334627.460059  7404254.037787 
+334525.602619  7404265.715787 
+334448.690025  7404241.949858 
+334417.156439  7404228.962082 
+334360.356403  7404239.010361 
+334313.682737  7404235.660935 
+334206.844573  7404269.015222 
+334101.630916  7404320.766357 
+334079.959822  7404329.144922 
+334047.560382  7404315.467265 
+334047.535643  7404315.507258 
+333976.106793  7404294.530851 
+333919.768545  7404284.042648 
+333908.075390  7404279.043504 
+333899.688974  7404270.744925 
+333888.053542  7404260.756636 
+333879.700111  7404249.038643 
+333837.941199  7404223.982935 
+333784.530363  7404203.956366 
+333674.377214  7404344.182346 
+Region 1
+309
+336731.683719  7401133.962228 
+336700.438751  7401143.370616 
+336636.266584  7401131.822594 
+336560.112644  7401115.985307 
+336526.311344  7401109.146478 
+336449.769831  7401085.420543 
+336430.382943  7401079.671527 
+336325.977417  7401053.615990 
+336219.312424  7401025.530801 
+336018.673386  7400980.858453 
+335984.896825  7400976.219248 
+335954.459988  7400971.630034 
+335903.333358  7400983.537994 
+335855.595928  7400990.176857 
+335831.723091  7400994.146177 
+335803.916801  7400998.205482 
+335700.022541  7401017.782128 
+335561.840454  7401046.657182 
+335495.837624  7401037.718713 
+335470.290801  7401032.279645 
+335482.891042  7401078.571716 
+335499.639136  7401130.622800 
+335525.449838  7401190.002629 
+335555.342424  7401264.669839 
+335593.266839  7401358.003851 
+335603.088100  7401380.769952 
+335672.521362  7401553.330394 
+335623.283119  7401573.077011 
+335496.522061  7401625.518029 
+335479.336916  7401617.959323 
+335466.967570  7401608.330973 
+335345.962382  7401691.516724 
+335334.961910  7401700.455193 
+335242.158831  7401759.575066 
+335176.156001  7401802.197765 
+335121.079426  7401837.441728 
+335046.220144  7401888.822927 
+335172.626614  7402004.713076 
+335221.320606  7402042.096673 
+335299.527857  7402188.171651 
+335333.469343  7402249.651120 
+335363.930919  7402293.653583 
+335314.783384  7402304.251768 
+335191.320819  7402326.877892 
+335135.246450  7402341.135450 
+335075.733404  7402353.433343 
+335019.659035  7402365.731237 
+335001.459604  7402367.700899 
+334969.002440  7402374.089805 
+334891.776490  7402389.337193 
+334793.704069  7402411.423410 
+334665.211303  7402435.339314 
+334607.965970  7402447.867168 
+334482.046028  7402473.942701 
+334377.640502  7402474.472610 
+334416.752374  7402546.400290 
+334440.996292  7402584.113830 
+334457.727894  7402613.128860 
+334505.440585  7402703.143441 
+334573.636912  7402794.947716 
+334605.285945  7402826.602294 
+334622.429859  7402862.286182 
+334648.372500  7402926.965103 
+334672.665896  7402986.454913 
+334674.710961  7402993.943630 
+334691.120960  7403041.125548 
+334701.049422  7403070.810463 
+334719.133406  7403109.983753 
+334745.364665  7403167.883835 
+334585.313575  7403210.856475 
+334545.772899  7403205.097461 
+334497.928268  7403171.743174 
+334445.977015  7403218.635142 
+334395.229712  7403230.473114 
+334370.425050  7403207.896982 
+334267.660524  7403234.542417 
+334100.022901  7403279.534711 
+334031.348292  7403215.435690 
+333944.358805  7403279.524712 
+333845.354560  7403296.121869 
+333788.125719  7403323.597163 
+333795.926654  7403394.704983 
+333870.200453  7403447.825884 
+333862.820077  7403475.371166 
+333850.516700  7403498.977122 
+333832.333762  7403504.396194 
+333800.849653  7403543.249539 
+333766.413394  7403570.304904 
+333725.503844  7403592.701068 
+333702.422644  7403599.919832 
+333685.361193  7403602.849330 
+333655.847934  7403612.067751 
+333614.690996  7403629.464771 
+333610.551389  7403631.814368 
+333602.280419  7403637.273433 
+333597.786224  7403641.912639 
+333585.590048  7403662.269152 
+333592.879716  7403577.303705 
+333496.176170  7403582.502815 
+333488.507175  7403626.375300 
+333475.717271  7403686.375023 
+333461.946066  7403760.152385 
+333454.079162  7403829.020589 
+333464.898217  7403873.283007 
+333484.136673  7403893.249587 
+333523.965967  7403929.193430 
+333544.383634  7403961.247939 
+333553.751352  7404001.810991 
+333555.887126  7404015.478650 
+333559.771100  7404042.434033 
+333563.432427  7404056.451632 
+333566.590733  7404072.278921 
+333580.238245  7404082.817116 
+333592.154048  7404090.245843 
+333607.236404  7404104.853341 
+333617.667886  7404114.581675 
+333629.311563  7404127.709426 
+333635.182880  7404137.507748 
+333635.100417  7404155.404682 
+333631.876141  7404167.242654 
+333626.779970  7404180.260424 
+333624.231885  7404186.389375 
+333616.958710  7404206.285967 
+333607.079725  7404221.293396 
+333606.890062  7404240.320137 
+333603.649294  7404273.094523 
+333599.361254  7404311.207994 
+333597.530590  7404337.503490 
+333593.357998  7404360.389570 
+333578.795154  7404397.883148 
+333674.377214  7404344.182346 
+333784.530363  7404203.956366 
+333837.941199  7404223.982935 
+333879.700111  7404249.038643 
+333888.053542  7404260.756636 
+333899.688974  7404270.744925 
+333908.075390  7404279.043504 
+333919.768545  7404284.042648 
+333976.106793  7404294.530851 
+334047.535643  7404315.507258 
+334047.560382  7404315.467265 
+334079.959822  7404329.144922 
+334101.630916  7404320.766357 
+334206.844573  7404269.015222 
+334313.682737  7404235.660935 
+334360.356403  7404239.010361 
+334417.156439  7404228.962082 
+334448.690025  7404241.949858 
+334525.602619  7404265.715787 
+334627.460059  7404254.037787 
+334720.881606  7404220.653505 
+334784.311613  7404192.278366 
+334903.857218  7404130.598931 
+334900.476264  7404177.790847 
+334903.947927  7404223.842959 
+334903.972666  7404223.812964 
+334903.980912  7404223.842959 
+334987.746123  7404213.284768 
+335010.522212  7404275.864048 
+335129.004054  7404375.736941 
+335218.475656  7404389.864521 
+335317.356208  7404380.446134 
+335423.303779  7404295.690652 
+335468.344691  7404202.616595 
+335548.745440  7404217.314078 
+335548.761932  7404217.304079 
+335572.807941  7404232.081548 
+335605.891818  7404243.089662 
+335639.544685  7404248.888669 
+335730.088298  7404262.496338 
+335817.514835  7404277.353793 
+335888.176786  7404290.321572 
+336019.506255  7404306.238845 
+336082.886784  7404315.837201 
+336137.930373  7404343.362487 
+336151.388222  7404372.117561 
+336208.443892  7404340.522973 
+336262.102114  7404312.637749 
+336270.422561  7404345.922048 
+336283.228957  7404315.197311 
+336297.313519  7404295.350711 
+336317.681709  7404265.545816 
+336343.533642  7404249.168621 
+336364.083249  7404242.689731 
+336375.083720  7404240.380127 
+336399.104990  7404239.200329 
+336432.609425  7404239.580264 
+336464.192489  7404244.559411 
+336494.266492  7404244.919349 
+336521.610993  7404238.800397 
+336547.223785  7404230.821764 
+336561.217639  7404216.744175 
+336571.492442  7404204.936198 
+336593.147044  7404177.150957 
+336614.108962  7404137.047826 
+336630.403514  7404116.621325 
+336655.084482  7404097.964521 
+336678.709933  7404089.965891 
+336700.785092  7404086.176540 
+336735.435754  7404085.016739 
+336764.338792  7404078.897787 
+336790.636021  7404073.218760 
+336863.631655  7404032.395752 
+336890.291719  7404014.188871 
+337003.479481  7403951.209659 
+337061.120633  7403917.935358 
+337113.566660  7403886.580729 
+337122.686991  7403878.582099 
+337131.436242  7403869.833598 
+337146.798969  7403860.325226 
+337193.118047  7403823.161592 
+337213.882056  7403806.924374 
+337264.241786  7403772.430282 
+337271.696379  7403768.960876 
+337299.700578  7403755.933108 
+337360.582499  7403736.176492 
+337433.718318  7403712.450556 
+337475.980251  7403715.200085 
+337601.042585  7403775.399773 
+337630.580583  7403667.568244 
+337649.200572  7403615.967083 
+337664.563299  7403561.206463 
+337706.660307  7403575.983932 
+337771.657097  7403509.505319 
+337799.669542  7403482.999859 
+337909.657766  7403366.019896 
+338038.290718  7403234.742383 
+338135.051989  7403129.120475 
+338150.620872  7403101.005291 
+338160.763736  7403082.698427 
+338172.390921  7403057.542736 
+338173.743303  7403053.073501 
+338191.068634  7402980.745890 
+338193.633211  7402916.906825 
+338180.562936  7402861.376337 
+338168.383253  7402805.975827 
+338163.740625  7402794.227839 
+338222.758898  7402744.796306 
+338304.421320  7402672.208740 
+338291.301567  7402662.410418 
+338275.716191  7402648.882736 
+338265.919669  7402639.444352 
+338249.254037  7402631.455721 
+338236.332194  7402629.316087 
+338219.633577  7402624.346938 
+338204.749130  7402615.368476 
+338184.389187  7402597.251580 
+338139.537938  7402567.276714 
+338115.813533  7402554.678872 
+338108.218754  7402548.929857 
+337976.122386  7402452.076447 
+337867.255649  7402373.799855 
+337823.154807  7402345.094772 
+337775.301931  7402310.550689 
+337738.276355  7402284.445160 
+337708.309553  7402276.966441 
+337644.096155  7402261.299125 
+337615.811584  7402248.141379 
+337600.110760  7402221.335970 
+337590.635841  7402205.748640 
+337570.045004  7402185.612090 
+337548.134769  7402170.004763 
+337518.407107  7402149.008360 
+337502.599083  7402132.201238 
+337485.092335  7402106.805589 
+337477.390356  7402093.597851 
+337459.759915  7402057.594018 
+337452.313569  7402042.376625 
+337442.385107  7402022.340057 
+337428.135620  7402002.513453 
+337397.954416  7401954.021759 
+337366.552770  7401901.220803 
+337358.883775  7401892.032377 
+337350.019077  7401880.874288 
+337335.612912  7401852.469154 
+337322.385959  7401831.392764 
+337313.323351  7401801.777837 
+337306.008944  7401774.712473 
+337300.871543  7401757.245465 
+337292.031584  7401729.910147 
+337286.605564  7401715.472620 
+337279.695222  7401700.025268 
+337270.055379  7401674.179693 
+337250.586028  7401620.738847 
+337227.991356  7401575.346623 
+337202.856845  7401529.424489 
+337182.200038  7401492.130877 
+337167.043466  7401462.455960 
+337158.178768  7401437.640210 
+337146.477366  7401416.833774 
+337133.943096  7401402.826174 
+337100.941681  7401379.280207 
+337078.297531  7401361.143314 
+337053.171267  7401337.677333 
+337034.518293  7401323.849702 
+337017.382626  7401314.611284 
+336977.668779  7401301.343557 
+336945.104414  7401285.116336 
+336905.052472  7401256.961159 
+336883.678242  7401238.324351 
+336859.970329  7401224.466725 
+336838.225019  7401216.678059 
+336816.957990  7401211.668917 
+336802.733242  7401189.822659 
+336797.364946  7401170.096038 
+336782.051695  7401154.298744 
+336764.652149  7401143.780546 
+336756.884199  7401134.612116 
+336731.683719  7401133.962228 
+Region 1
+218
+323727.130602  7387729.138353 
+323701.732211  7387697.403789 
+323676.828595  7387671.488228 
+323660.064008  7387657.000709 
+323620.416131  7387628.505590 
+323495.898048  7387530.882312 
+323455.747151  7387495.798322 
+323437.209624  7387476.241672 
+323429.590107  7387467.353194 
+323421.970590  7387457.964802 
+323401.660124  7387422.420891 
+323393.793220  7387405.933715 
+323387.946643  7387392.725977 
+323382.883457  7387380.048149 
+323382.520623  7387378.798363 
+323380.343618  7387373.199322 
+323374.257900  7387350.123275 
+323314.992240  7387360.871434 
+323272.507660  7387370.139846 
+323251.397309  7387370.599767 
+323237.667335  7387370.309817 
+323221.339799  7387369.259997 
+323198.250353  7387366.920397 
+323178.673801  7387362.561144 
+323159.352883  7387357.951934 
+323132.907221  7387346.743853 
+323115.639614  7387322.617986 
+323054.683477  7387247.190906 
+322960.948573  7387136.449875 
+322954.598976  7387130.860832 
+322943.161454  7387124.241966 
+322931.979565  7387118.133012 
+322921.036817  7387113.543798 
+322907.570722  7387108.194715 
+322894.863281  7387105.615157 
+322871.971745  7387103.535513 
+322855.190665  7387102.725652 
+322837.131420  7387105.215225 
+322818.808296  7387109.494492 
+322776.323715  7387130.930820 
+322653.669281  7387188.161017 
+322503.043632  7387263.818058 
+322434.583425  7387305.980836 
+322415.229522  7387327.217198 
+322403.033347  7387325.667464 
+322363.096852  7387324.557654 
+322338.432376  7387323.737794 
+322323.943748  7387317.358887 
+322315.812965  7387312.019801 
+322301.827358  7387303.371283 
+322277.690641  7387284.304549 
+322246.429180  7387262.428296 
+322251.236733  7387283.734646 
+322250.956361  7387306.540740 
+322195.508706  7387309.190286 
+321962.033178  7387323.567823 
+321931.761265  7387326.027402 
+321880.642881  7387329.946731 
+321872.000832  7387328.666950 
+321865.131721  7387325.857431 
+321857.512204  7387321.528173 
+321854.972365  7387317.978781 
+321852.176893  7387310.110128 
+321850.659587  7387298.962038 
+321849.397913  7387286.794122 
+321847.888853  7387276.135948 
+321846.371547  7387266.757554 
+321844.845994  7387261.178510 
+321840.533215  7387255.339510 
+321834.942271  7387249.240555 
+321828.337040  7387244.411382 
+321820.973156  7387238.822339 
+321813.848413  7387232.973341 
+321809.527388  7387230.933691 
+321801.907871  7387225.344648 
+321678.387582  7387137.839637 
+321598.580562  7387098.356400 
+321543.207123  7387086.988347 
+321565.908996  7386955.840812 
+321626.221927  7386921.266734 
+321667.791176  7386817.204559 
+321670.586648  7386806.806340 
+321677.233110  7386786.299852 
+321685.380386  7386768.832844 
+321690.987823  7386758.204665 
+321698.368199  7386748.836270 
+321711.356012  7386736.198434 
+321728.673097  7386722.050858 
+321737.323393  7386713.962243 
+321746.237568  7386700.044627 
+321750.566839  7386691.686059 
+321790.833183  7386610.429977 
+321797.463153  7386594.482709 
+321801.800670  7386578.775399 
+321808.950152  7386551.170128 
+321813.032036  7386538.512296 
+321822.226583  7386502.288501 
+321844.450175  7386404.245295 
+322027.970038  7386004.003853 
+322062.323835  7385914.719146 
+322097.048712  7385906.460561 
+322109.046978  7385866.187459 
+322109.747907  7385838.232248 
+322104.338380  7385809.067244 
+322097.964044  7385784.491453 
+322088.893190  7385746.477965 
+322408.022316  7385220.378081 
+322371.928565  7385215.968836 
+322220.560755  7385007.084616 
+322125.201344  7384858.750024 
+322034.385605  7384701.326989 
+321976.859900  7384633.218656 
+321954.042580  7384565.580242 
+321941.747450  7384561.300975 
+321898.446493  7384550.382845 
+321867.737530  7384529.656395 
+321851.096637  7384497.921831 
+321889.136499  7384481.294679 
+321947.701229  7384445.590795 
+321989.361186  7384430.293415 
+322030.023349  7384421.074994 
+322071.551367  7384407.907250 
+322111.306445  7384395.289411 
+322155.596950  7384379.062190 
+322189.530189  7384367.514169 
+322237.696422  7384352.616720 
+322274.491103  7384349.557244 
+322295.956042  7384351.596895 
+322328.660592  7384359.775494 
+322367.632278  7384363.044934 
+322460.493082  7384351.596895 
+322522.686153  7384344.338138 
+322610.731158  7384319.912322 
+322708.836564  7384281.078974 
+322738.811612  7384262.722118 
+322787.480866  7384251.524037 
+322840.990656  7384241.535747 
+322910.539365  7384221.019262 
+322931.303374  7384234.286989 
+322988.796094  7384222.379029 
+323078.960380  7384203.872199 
+323161.859737  7384177.386736 
+323322.793174  7384149.761468 
+323441.052368  7384131.334624 
+323589.789630  7384105.998964 
+323606.249106  7384104.849161 
+323699.472744  7384089.841731 
+323728.169627  7384084.122711 
+323928.148966  7384066.155788 
+323987.744475  7384344.708075 
+324045.080517  7384462.247941 
+324180.838212  7384658.984242 
+324316.892771  7384827.445386 
+324455.866496  7385012.963609 
+324553.378174  7385115.766000 
+324995.252443  7385632.497488 
+325168.885075  7385841.411703 
+325450.724746  7386158.887323 
+325597.309742  7386279.966583 
+325644.890493  7386305.162267 
+325862.953816  7386380.389381 
+326054.076704  7386441.938838 
+326212.808398  7386526.164411 
+326342.389666  7386633.066100 
+326410.421069  7386736.738342 
+326475.186965  7386824.303343 
+326512.962947  7387026.518705 
+326481.528316  7387032.777633 
+326401.952190  7387046.335311 
+326390.176573  7387049.974687 
+326310.542723  7387062.332571 
+326235.411316  7387071.391019 
+326155.010567  7387087.268299 
+326117.036675  7387087.368282 
+326041.146614  7387092.547395 
+325963.376413  7387100.136095 
+325835.089803  7387112.014061 
+325757.336094  7387115.973382 
+325703.752088  7387125.411766 
+325629.651459  7387134.710173 
+325534.992977  7387147.537976 
+325409.666764  7387155.786563 
+325319.403523  7387180.682298 
+325286.888636  7387223.424977 
+325252.526593  7387271.306775 
+325210.190445  7387338.915194 
+325195.693571  7387356.132245 
+325181.609009  7387381.217948 
+325173.123638  7387399.614797 
+325165.965910  7387417.691701 
+325155.691106  7387457.444891 
+325144.253584  7387500.617496 
+325108.811285  7387483.740387 
+325082.208945  7387475.031879 
+325064.108469  7387473.022223 
+325042.602299  7387479.691081 
+325033.292305  7387486.429926 
+324986.643378  7387526.703028 
+324898.639605  7387604.879637 
+324813.150931  7387695.954037 
+324783.736627  7387717.190399 
+324767.631738  7387727.578620 
+324742.381780  7387739.126642 
+324708.992792  7387750.804641 
+324678.069427  7387757.873431 
+324644.779394  7387760.163038 
+324616.519562  7387759.333181 
+324583.922212  7387757.043573 
+324557.542520  7387746.535373 
+324516.740171  7387725.878911 
+324455.041873  7387687.525481 
+324410.850323  7387676.807317 
+324362.684090  7387672.218103 
+324319.729474  7387674.917640 
+324226.992365  7387682.176397 
+324142.649918  7387689.815088 
+323934.168714  7387709.631694 
+323727.130602  7387729.138353 
+Region 1
+515
+353400.210283  7401391.408130 
+353400.820504  7401364.912668 
+353402.362549  7401361.523249 
+353405.133283  7401357.823882 
+353409.140951  7401353.204674 
+353414.072197  7401349.195360 
+353423.621332  7401345.196045 
+353443.956537  7401341.496679 
+353524.992245  7401338.727153 
+353543.480294  7401337.187417 
+353557.037097  7401333.488051 
+353567.823167  7401328.868842 
+353580.151282  7401319.620426 
+353605.722843  7401296.824331 
+353647.316830  7401263.240084 
+353658.408011  7401256.151298 
+353667.965392  7401252.761878 
+353679.675040  7401250.292301 
+353720.963916  7401247.212829 
+353731.436629  7401243.203516 
+353753.289141  7401231.935446 
+353767.489150  7401224.106787 
+353783.198219  7401216.398107 
+353797.678600  7401212.088845 
+353821.097895  7401205.929900 
+353831.883965  7401201.300693 
+353849.135079  7401192.062276 
+353880.874821  7401176.654915 
+353891.660891  7401171.725759 
+353908.912005  7401169.256182 
+353944.040948  7401169.566129 
+353958.826439  7401168.336340 
+353973.620177  7401163.407184 
+353985.016468  7401156.008451 
+353999.505095  7401141.840878 
+354019.840300  7401120.884468 
+354027.542279  7401111.026157 
+354037.709882  7401092.229376 
+354050.648218  7401063.574285 
+354055.719650  7401051.656326 
+354061.739398  7401035.539087 
+354063.586554  7401027.530459 
+354066.670644  7401007.803838 
+354070.983422  7400980.698480 
+354073.143935  7400969.600381 
+354075.914668  7400960.361964 
+354082.693070  7400939.715500 
+354084.622688  7400935.226269 
+354090.708406  7400918.759090 
+354100.257541  7400899.352414 
+354111.653832  7400875.316531 
+354124.905525  7400846.351493 
+354131.989037  7400823.245451 
+354137.538750  7400804.448670 
+354141.233061  7400785.661888 
+354150.171975  7400745.298802 
+354155.721689  7400722.802656 
+354160.034467  7400696.617141 
+354163.728779  7400675.350784 
+354167.117979  7400664.262683 
+354169.888713  7400656.863950 
+354179.132737  7400643.616220 
+354182.835295  7400637.767221 
+354185.606028  7400630.368489 
+354191.056787  7400612.751506 
+354193.613118  7400604.482923 
+354194.544942  7400595.244505 
+354196.392098  7400569.358939 
+354197.315676  7400559.190681 
+354198.857721  7400552.721789 
+354201.933565  7400543.483371 
+354209.948901  7400526.836223 
+354214.880147  7400514.208386 
+354216.727303  7400503.730181 
+354216.727303  7400492.952027 
+354214.880147  7400481.543981 
+354214.880147  7400467.686355 
+354214.880147  7400457.828043 
+354217.650881  7400443.340525 
+354219.498036  7400434.712003 
+354222.582127  7400427.933166 
+354225.352860  7400420.234483 
+354225.971327  7400414.685433 
+354225.047750  7400408.526488 
+354221.963659  7400398.358230 
+354217.955991  7400390.349602 
+354211.490946  7400382.330975 
+354199.368987  7400369.863111 
+354195.616952  7400360.114781 
+354189.366310  7400337.118720 
+354184.121707  7400304.124371 
+354181.367466  7400285.127625 
+354176.617637  7400243.884690 
+354171.125647  7400202.391797 
+354166.870592  7400172.396935 
+354163.126804  7400158.149376 
+354156.373141  7400138.152801 
+354145.125282  7400104.158624 
+354138.627252  7400082.412349 
+354131.873590  7400061.665902 
+354120.881364  7400033.170783 
+354115.438852  7400026.181980 
+354109.880892  7400020.922881 
+354097.379607  7400007.925108 
+354087.137788  7399995.677206 
+354078.883311  7399982.179518 
+354072.888302  7399965.182429 
+354069.886674  7399947.935383 
+354069.383654  7399927.688851 
+354072.632669  7399901.693304 
+354076.887724  7399879.947029 
+354079.138945  7399864.699641 
+354078.611186  7399853.731520 
+354075.881683  7399840.703751 
+354072.632669  7399832.955079 
+354064.386438  7399823.956620 
+354057.385388  7399811.958675 
+354051.637765  7399798.211030 
+354045.139736  7399783.963470 
+354034.889671  7399765.466639 
+354020.640184  7399748.219593 
+354005.392904  7399735.471777 
+353981.899393  7399718.224731 
+353968.400313  7399708.226443 
+353947.652797  7399689.979569 
+353929.156502  7399675.732009 
+353923.408879  7399665.733722 
+353919.904231  7399657.485135 
+353915.657422  7399635.488903 
+353911.410613  7399612.742799 
+353907.163804  7399589.496781 
+353899.907121  7399573.249564 
+353892.658685  7399564.251105 
+353882.416866  7399557.002347 
+353860.168536  7399547.503974 
+353843.420442  7399537.755643 
+353835.322643  7399529.377079 
+353821.675131  7399516.259326 
+353808.670826  7399499.512194 
+353799.921575  7399484.014849 
+353793.679178  7399457.269430 
+353792.178364  7399436.023069 
+353792.788585  7399412.987015 
+353793.176158  7399404.028550 
+353797.175580  7399376.283302 
+353802.172796  7399344.288783 
+353804.176630  7399318.543193 
+353806.675238  7399291.047902 
+353811.177680  7399269.801542 
+353818.920890  7399244.305909 
+353827.670141  7399216.810618 
+353835.916372  7399189.565285 
+353840.921834  7399173.318068 
+353848.063069  7399159.250478 
+353852.664466  7399150.072050 
+353868.167380  7399119.827231 
+353882.161233  7399094.331598 
+353896.814785  7399070.935606 
+353910.660206  7399050.589091 
+353920.654638  7399035.841617 
+353936.050350  7398991.429224 
+353944.906802  7398957.355061 
+353947.652797  7398944.107330 
+353949.656631  7398926.610327 
+353951.157445  7398898.115208 
+353953.153033  7398872.869532 
+353954.917726  7398865.230841 
+353955.651641  7398859.871759 
+353958.900655  7398851.873129 
+353966.149092  7398840.875013 
+353982.897187  7398817.379037 
+353989.395216  7398804.131307 
+353993.394638  7398790.883576 
+353997.146673  7398773.636530 
+354001.146095  7398736.392910 
+354001.896502  7398712.147063 
+354001.146095  7398692.400445 
+353999.307186  7398669.034448 
+353999.397894  7398656.406611 
+354001.393482  7398645.908409 
+354004.898130  7398637.159907 
+354013.144361  7398625.911834 
+354019.395004  7398611.164360 
+354021.646224  7398599.666330 
+354021.390591  7398577.920055 
+354020.145410  7398554.174122 
+354021.390591  7398533.427676 
+354024.392219  7398512.681229 
+354027.888621  7398493.434526 
+354028.894661  7398478.687052 
+354026.396053  7398464.439493 
+354022.891405  7398454.441205 
+354018.891983  7398446.442576 
+354005.648537  7398433.194845 
+353980.645966  7398409.448912 
+353960.401469  7398382.953451 
+353951.899606  7398364.956533 
+353947.900184  7398350.708974 
+353946.407616  7398339.460901 
+353948.114586  7398321.703942 
+353954.150827  7398303.217109 
+353963.155710  7398279.721133 
+353975.401363  7398253.975543 
+353985.395795  7398232.479226 
+353992.644231  7398207.233550 
+353991.893824  7398181.487960 
+353989.395216  7398159.241770 
+353986.896609  7398150.493269 
+353979.895559  7398134.745966 
+353972.152348  7398113.749563 
+353969.901127  7398101.501661 
+353967.897293  7398082.754872 
+353968.152926  7398065.007912 
+353970.898921  7398044.011508 
+353973.653162  7398031.013735 
+353978.402991  7398017.016132 
+353980.901599  7398003.768402 
+353979.648172  7397987.271227 
+353974.403569  7397969.024353 
+353966.899499  7397951.277393 
+353959.403676  7397936.279962 
+353956.649435  7397925.781760 
+353954.901234  7397917.783130 
+353956.154661  7397901.785870 
+353964.153504  7397862.542592 
+353972.647122  7397826.548758 
+353975.896137  7397797.303767 
+353977.396951  7397769.558520 
+353976.399157  7397735.564343 
+353977.454674  7397728.715516 
+353994.507879  7397725.326096 
+354007.066889  7397762.509727 
+354010.456089  7397823.299314 
+354010.983848  7397898.856372 
+354015.197672  7398017.726011 
+354023.913938  7398117.698886 
+354050.846127  7398162.911142 
+354069.070297  7398198.265086 
+354098.542325  7398240.707816 
+354132.673474  7398258.164826 
+354153.998226  7398259.334625 
+354219.110464  7398259.074670 
+354277.889596  7398258.964689 
+354359.230415  7398260.214475 
+354425.901189  7398257.304973 
+354465.169740  7398233.569039 
+354496.917728  7398216.112029 
+354554.847498  7398182.777739 
+354620.710142  7398146.273992 
+354698.472097  7398109.760246 
+354783.746368  7398077.855711 
+354813.193658  7398066.067730 
+354832.176481  7398056.959291 
+354862.737012  7398040.722072 
+354935.740892  7398084.374595 
+354998.420491  7398116.919020 
+355125.478413  7398187.816876 
+355231.425984  7397925.551799 
+355228.383125  7397828.158482 
+355227.731673  7397804.282572 
+355227.756411  7397804.252577 
+355301.032417  7397795.654050 
+355366.903307  7397781.376495 
+355417.526917  7397773.327874 
+355449.266659  7397767.728833 
+355527.803760  7397759.070316 
+355527.770775  7397759.050320 
+355587.506470  7397746.452478 
+355652.313596  7397737.593995 
+355714.333497  7397724.756194 
+355746.922600  7397714.497951 
+355776.930634  7397700.740308 
+355790.396728  7397690.772015 
+355834.843912  7397658.237588 
+355893.557074  7397613.795201 
+355951.750723  7397570.282654 
+356036.662160  7397487.656807 
+356046.104095  7397479.008288 
+356070.488199  7397455.892248 
+356089.116434  7397438.235272 
+356165.031233  7397405.880814 
+356089.116434  7397438.235272 
+356165.031233  7397405.880814 
+356232.073088  7397377.295711 
+356300.813667  7397335.902801 
+356357.052960  7397300.748823 
+356399.240676  7397271.063907 
+356419.551142  7397249.977519 
+356446.854411  7397225.311744 
+356496.628660  7397264.055108 
+356504.512056  7397263.635180 
+356511.158518  7397259.415902 
+356514.795106  7397251.387278 
+356519.990231  7397240.599126 
+356525.375020  7397235.100068 
+356533.538788  7397232.410528 
+356549.058194  7397230.560845 
+356565.055882  7397231.490686 
+356584.088182  7397233.960263 
+356603.565779  7397242.488802 
+356619.777868  7397248.207822 
+356631.891581  7397255.906504 
+356647.848037  7397261.875481 
+356658.724816  7397266.534683 
+356692.748763  7397269.414190 
+356710.742038  7397273.893423 
+356727.696289  7397280.882225 
+356741.607680  7397287.591076 
+356751.701066  7397294.759848 
+356779.037321  7397305.138071 
+356789.683204  7397308.027576 
+356801.838148  7397312.696776 
+356814.776484  7397314.846408 
+356827.970453  7397316.246168 
+356835.573478  7397318.855721 
+356845.691603  7397323.244969 
+356854.317160  7397324.604736 
+356868.022396  7397326.004496 
+356881.191626  7397330.943650 
+356888.209168  7397340.601996 
+356892.926012  7397351.750086 
+356897.956213  7397356.589258 
+356903.745067  7397362.708209 
+356913.846699  7397368.367240 
+356921.622895  7397378.535498 
+356929.159950  7397387.443972 
+356934.932311  7397394.312796 
+356940.440793  7397402.951316 
+356954.566586  7397412.939605 
+356966.457651  7397418.108720 
+356977.845695  7397423.017879 
+356991.006679  7397428.206990 
+356999.055001  7397436.365593 
+357006.913658  7397438.215276 
+357021.905306  7397438.375248 
+357034.662224  7397433.206134 
+357046.173962  7397426.017365 
+357059.648303  7397424.897557 
+357067.473976  7397430.526593 
+357072.710333  7397440.174940 
+357083.273754  7397451.383020 
+357089.334734  7397454.722448 
+357103.501758  7397460.931385 
+357116.407109  7397467.120325 
+357126.995269  7397475.558879 
+357139.851143  7397485.277214 
+357157.275428  7397496.815238 
+357172.712372  7397502.774217 
+357188.413195  7397507.983325 
+357202.596712  7397513.182435 
+357218.800555  7397519.151412 
+357235.507418  7397525.640301 
+357250.193955  7397530.839410 
+357258.242276  7397538.488100 
+357269.374687  7397543.907172 
+357276.944727  7397548.776338 
+357287.598857  7397550.905973 
+357300.768087  7397555.585171 
+357305.179821  7397559.634478 
+357358.483456  7397489.766446 
+357393.389750  7397609.405952 
+357360.041993  7397645.209819 
+357353.609933  7397659.317403 
+357355.696230  7397668.885764 
+357362.779742  7397676.664432 
+357215.262922  7398052.630032 
+357200.213551  7398185.747230 
+357201.582425  7398233.219099 
+357191.909597  7398268.283093 
+357182.277999  7398292.278982 
+357171.920734  7398312.845460 
+357158.133036  7398332.642069 
+357144.741157  7398350.529005 
+357120.983767  7398376.694523 
+357017.782190  7398499.293523 
+356968.576932  7398531.178061 
+356926.150075  7398576.070371 
+356901.287690  7398607.265028 
+356885.603359  7398627.821507 
+356872.557822  7398650.667594 
+356861.812984  7398671.614006 
+356853.319366  7398695.999829 
+356849.839457  7398708.187741 
+356852.148402  7398724.534941 
+356855.323200  7398746.371200 
+356871.197194  7398797.612423 
+356879.179546  7398827.447313 
+356883.335646  7398843.384583 
+356893.503248  7398868.720243 
+356906.243675  7398890.796462 
+356919.256227  7398910.353112 
+356927.024176  7398921.791153 
+356932.433703  7398939.508118 
+356937.109316  7398954.435561 
+356937.942185  7398972.862405 
+356935.476562  7398990.989300 
+356933.761346  7399009.636106 
+356935.872381  7399027.573033 
+356941.051014  7399043.010389 
+356943.648577  7399063.216928 
+356947.004793  7399083.183508 
+356945.602933  7399096.031307 
+356942.180748  7399108.609152 
+356930.108266  7399131.805179 
+356927.147869  7399137.704169 
+356910.177127  7399157.200829 
+356892.002434  7399170.628529 
+356872.285697  7399185.805929 
+356850.796020  7399199.953506 
+356831.318423  7399216.900603 
+356814.388911  7399232.617911 
+356802.588555  7399243.845988 
+356788.198883  7399259.833249 
+356765.678427  7399275.740524 
+356746.951237  7399293.447491 
+356729.444490  7399315.713677 
+356718.312078  7399336.780069 
+356706.635416  7399360.875941 
+356697.160497  7399393.560343 
+356691.899401  7399411.417284 
+356684.700442  7399444.631595 
+356679.365131  7399470.057240 
+356670.953976  7399498.212417 
+356669.189282  7399520.128663 
+356668.917157  7399523.668057 
+356664.126097  7399545.814263 
+356653.381258  7399578.238709 
+356646.982183  7399600.624875 
+356626.803657  7399644.047437 
+356610.195748  7399678.431547 
+356599.516879  7399704.297116 
+356586.520820  7399745.580045 
+356581.589574  7399769.685916 
+356575.305946  7399788.282730 
+356570.185037  7399817.487728 
+356562.342872  7399839.104025 
+356554.253319  7399860.460367 
+356543.863069  7399882.796541 
+356537.760858  7399908.202189 
+356528.624035  7399932.578014 
+356522.579548  7399952.944525 
+356514.127161  7399984.889054 
+356506.045855  7400005.485526 
+356485.677665  7400034.530550 
+356467.667898  7400056.536781 
+356450.202381  7400077.003275 
+356433.470779  7400097.039843 
+356425.719322  7400109.317740 
+356412.451137  7400140.702364 
+356408.410484  7400168.917531 
+356404.798635  7400194.093219 
+356403.347299  7400212.240110 
+356397.979002  7400240.435281 
+356392.421043  7400263.081402 
+356379.235320  7400286.917319 
+356370.659240  7400304.724269 
+356348.509865  7400337.868591 
+356337.855735  7400358.105125 
+356327.778841  7400374.392335 
+356313.067565  7400414.495466 
+356311.698691  7400440.491013 
+356308.763033  7400476.574832 
+356308.622847  7400511.908780 
+356314.065359  7400547.272722 
+356321.536444  7400585.156233 
+356330.021816  7400621.530003 
+356340.791393  7400657.663813 
+356349.771538  7400698.586804 
+356358.281648  7400728.901611 
+356369.092456  7400755.437066 
+356376.629511  7400775.663601 
+356403.033942  7400810.757590 
+356416.244403  7400834.603505 
+356426.816071  7400857.349609 
+356438.129899  7400884.904889 
+356447.662542  7400913.709955 
+356465.441415  7400975.609352 
+356471.378701  7400998.455439 
+356477.447927  7401019.821779 
+356484.267560  7401027.920392 
+356492.093233  7401039.558398 
+356497.337836  7401061.534634 
+356501.015654  7401093.349184 
+356471.057098  7401095.528811 
+356449.493205  7401093.189212 
+356422.594001  7401092.089400 
+356392.643691  7401093.759114 
+356374.576200  7401092.499330 
+356142.675702  7401107.746718 
+355914.807610  7401134.702101 
+355875.423613  7401138.321481 
+355763.497524  7401149.569554 
+355718.778215  7401154.298744 
+355552.657899  7401170.745927 
+355478.656225  7401173.895388 
+355353.692846  7401188.592870 
+355169.933842  7401203.300351 
+355061.875236  7401219.677546 
+354955.639046  7401235.564824 
+354839.787752  7401250.642242 
+354723.985935  7401267.009438 
+354654.033160  7401277.627619 
+354578.646120  7401280.797076 
+354543.731579  7401283.976532 
+354495.317959  7401288.735716 
+354447.687731  7401293.524896 
+354415.980974  7401296.844328 
+354406.440085  7401297.464221 
+354399.298849  7401303.813134 
+354264.209099  7401307.322533 
+354118.786821  7401318.460625 
+354002.506723  7401333.967969 
+353786.529696  7401356.164167 
+353556.097027  7401378.870277 
+353400.210283  7401391.408130 
+Region 1
+245
+344339.268541  7391424.175426 
+344338.691304  7391418.866336 
+344321.316496  7391388.441547 
+344306.836115  7391360.096402 
+344291.803237  7391330.831415 
+344272.638997  7391296.097365 
+344251.454430  7391256.474152 
+344228.513417  7391212.961605 
+344214.280423  7391182.106890 
+344207.155679  7391172.618516 
+344202.537790  7391164.879841 
+344184.214666  7391137.814477 
+344174.368666  7391120.917372 
+344162.551818  7391099.740999 
+344145.003839  7391069.996094 
+344120.141454  7391033.392364 
+344116.974901  7391026.273583 
+344080.584285  7390971.682934 
+344047.360222  7390980.391443 
+344028.377399  7390987.510223 
+344004.661240  7390992.659341 
+343968.328347  7391005.297176 
+343928.837149  7391016.355282 
+343826.427210  7391048.609757 
+343794.374112  7391057.928161 
+343768.060390  7391064.677005 
+343741.655959  7391073.215543 
+343710.848042  7391075.585137 
+343684.781707  7391066.896625 
+343671.595984  7391056.728367 
+343654.773673  7391049.489607 
+343619.380851  7391029.043109 
+343576.450975  7391006.806918 
+343566.588483  7391003.997399 
+343557.682554  7390998.978259 
+343526.899375  7390982.851021 
+343499.142562  7390983.950833 
+343437.444265  7390999.768123 
+343408.961784  7391033.782297 
+343373.362806  7391080.464301 
+343339.635723  7391127.716207 
+343317.519332  7391155.361472 
+343282.769716  7391190.905383 
+343256.827075  7391203.183280 
+343211.687208  7391219.330514 
+343161.929452  7391237.497403 
+343064.780609  7391314.114279 
+342971.581710  7391382.822510 
+342888.649369  7391443.642092 
+342883.916032  7391447.591415 
+342864.166310  7391465.758304 
+342828.699272  7391490.654039 
+342812.223303  7391514.969874 
+342768.221416  7391525.878006 
+342747.102820  7391532.316903 
+342627.400536  7391563.001647 
+342477.888128  7391601.765007 
+342316.039359  7391641.988117 
+342167.532991  7391680.431532 
+342024.733015  7391717.365206 
+341884.794481  7391742.980818 
+341733.146299  7391770.296139 
+341619.298839  7391797.421493 
+341566.572440  7391810.609234 
+341513.582162  7391822.747155 
+341459.742522  7391838.884390 
+341392.337833  7391855.461551 
+341213.452352  7391901.733625 
+341113.219418  7391926.309415 
+341114.876910  7391946.275995 
+341119.618493  7391981.869898 
+341128.862518  7392071.784497 
+341160.470320  7392061.576245 
+341216.915768  7392201.412293 
+341279.966448  7392352.756369 
+341367.912498  7392566.179811 
+341395.710541  7392635.917866 
+341418.643309  7392686.329231 
+341372.761281  7392736.960558 
+341288.905362  7392823.975653 
+341232.938195  7392879.106210 
+341193.183117  7392919.689258 
+341148.851381  7392950.893913 
+340997.805174  7393027.290827 
+340970.106085  7393032.809882 
+340909.191179  7393058.125545 
+340793.702719  7393122.994434 
+340739.904310  7393151.469556 
+340560.969352  7393251.682391 
+340517.618917  7393270.919096 
+340270.809234  7393407.775654 
+340234.418618  7393440.999963 
+340173.503712  7393536.723566 
+340111.582766  7393633.656962 
+340075.414799  7393698.095924 
+340045.489228  7393738.718966 
+340020.832998  7393761.385083 
+340000.003019  7393776.762449 
+339915.330723  7393820.904888 
+339901.798659  7393848.930088 
+339829.306045  7393935.785210 
+339809.416137  7393955.591818 
+339808.203941  7393973.528745 
+339825.323116  7394072.121857 
+339836.397803  7394115.384447 
+339882.527218  7394296.453431 
+339885.767986  7394319.769437 
+339888.002715  7394326.288321 
+339916.419226  7394340.695853 
+339957.370007  7394357.912904 
+340052.506770  7394400.105676 
+340062.748588  7394404.414938 
+340054.972393  7394426.481159 
+340102.157325  7394422.371862 
+340146.703463  7394418.242570 
+340193.896641  7394414.143272 
+340239.193186  7394411.163782 
+340285.256630  7394404.754880 
+340333.967114  7394401.795387 
+340399.838005  7394393.676778 
+340479.010065  7394386.847947 
+340510.419958  7394382.378713 
+340552.154131  7394378.809324 
+340619.369157  7394367.001347 
+340642.541065  7394347.144748 
+340683.813450  7394318.649629 
+340736.778989  7394281.645967 
+340750.500717  7394272.967454 
+340818.301225  7394231.484560 
+340867.811594  7394201.689663 
+340894.809753  7394191.191462 
+340924.471445  7394179.943388 
+341218.169195  7394102.026735 
+341278.943915  7394088.289088 
+341313.116295  7394081.630228 
+341353.382639  7394073.481624 
+341376.166975  7394068.282515 
+341398.192657  7394063.833277 
+341405.218445  7394141.509972 
+341458.992115  7394131.151746 
+341527.188443  7394041.217151 
+341577.276048  7394084.289773 
+341629.631366  7394138.400504 
+341678.952072  7394186.422278 
+341736.106696  7394240.962936 
+341741.178128  7394242.822618 
+341752.186846  7394247.391835 
+341765.108689  7394251.201182 
+341789.047497  7394253.490790 
+341807.667486  7394252.350985 
+341823.640435  7394250.061378 
+341841.138936  7394243.202553 
+341855.602824  7394234.823988 
+341872.738492  7394214.627447 
+341883.714225  7394163.186259 
+341895.737229  7394110.985200 
+341952.751668  7394121.943323 
+342018.622558  7394134.641148 
+342085.276840  7394149.718565 
+342117.816467  7394156.067478 
+342159.080605  7394160.026800 
+342172.571438  7394157.647207 
+342254.308076  7394137.810605 
+342317.004168  7394110.825228 
+342354.466794  7393989.206060 
+342418.548252  7393825.454109 
+342447.022486  7393739.228879 
+342479.240510  7393657.312910 
+342495.163981  7393605.641761 
+342496.071066  7393593.673811 
+342511.095699  7393540.672889 
+342730.940208  7393625.968279 
+342743.688880  7393640.745748 
+342783.221310  7393521.686142 
+342783.237802  7393517.736818 
+342786.387863  7393484.512509 
+342774.917356  7393462.576267 
+342843.344578  7393459.986710 
+342876.568641  7393457.617116 
+342912.959257  7393456.827251 
+342946.183320  7393460.776575 
+342979.407383  7393461.566440 
+343005.514950  7393452.078065 
+343026.081049  7393439.420233 
+343047.438786  7393418.063891 
+343065.638217  7393406.985789 
+343074.618362  7393384.029721 
+343094.112452  7393398.287279 
+343123.386570  7393410.945111 
+343144.859755  7393423.672931 
+343160.412146  7393443.479538 
+343172.426904  7393467.895356 
+343232.550172  7393460.776575 
+343295.839992  7393447.718812 
+343295.303987  7393460.636599 
+343294.256716  7393489.251697 
+343302.956489  7393520.106412 
+343365.446425  7393486.092239 
+343464.335223  7393433.881182 
+343562.424136  7393379.300531 
+343658.929774  7393324.719880 
+343753.860381  7393270.919096 
+343726.697297  7393221.797510 
+343731.059553  7393210.439455 
+343730.927613  7393194.822131 
+343728.000201  7393187.533379 
+343724.297644  7393181.744371 
+343713.082770  7393162.907597 
+343632.830454  7393024.111372 
+343632.038815  7393007.504216 
+343616.214299  7392971.110450 
+343628.410474  7392913.500318 
+343746.430527  7392701.876568 
+343705.603439  7392558.971046 
+343840.033491  7392630.668765 
+343920.788828  7392520.207686 
+343850.374264  7392483.813920 
+343742.785693  7392426.073810 
+343715.886489  7392402.337876 
+343693.737113  7392377.812077 
+343620.799203  7392248.074300 
+343571.387789  7392211.550556 
+343577.737387  7392200.642425 
+343655.136507  7392134.113820 
+343671.604230  7392129.404627 
+343693.737113  7392125.465302 
+343725.386146  7392115.187062 
+343788.494549  7392080.562993 
+343868.565449  7392040.829799 
+343941.346681  7391992.568066 
+344002.269833  7391947.455793 
+344015.719435  7391938.367350 
+344018.094349  7391923.339924 
+344012.561129  7391886.156293 
+344066.351291  7391871.918732 
+344154.157155  7391847.392933 
+344230.888331  7391821.287405 
+344260.162450  7391803.090522 
+344316.327527  7391766.706754 
+344362.209554  7391735.852039 
+344411.258134  7391720.824613 
+344419.957907  7391650.416673 
+344417.582993  7391623.521280 
+344394.641979  7391528.597540 
+344339.268541  7391424.175426 
+Region 1
+160
+337085.117164  7397800.003305 
+337064.278939  7397738.833783 
+337023.344650  7397666.586158 
+337016.120952  7397601.577293 
+337030.568348  7397531.739256 
+337111.777228  7397341.601825 
+337074.751652  7397287.131155 
+337050.144900  7397256.326432 
+337016.063229  7397203.965401 
+336981.824879  7397158.343215 
+336633.685514  7397505.313782 
+336447.469133  7397638.350994 
+336366.697304  7397670.655461 
+336275.823842  7397702.969926 
+336197.072340  7397711.048542 
+336150.819232  7397710.118701 
+335944.655219  7397680.753731 
+335901.040906  7397676.464466 
+335763.988552  7397654.628206 
+335611.779627  7397659.617352 
+335499.498950  7397689.552224 
+335354.777603  7397761.919828 
+335127.709395  7397964.025209 
+334992.965987  7398055.099609 
+334848.244639  7398117.488922 
+334783.082924  7398135.865775 
+334771.043428  7398197.235263 
+334762.492086  7398231.399410 
+334753.948991  7398257.025021 
+334748.259092  7398281.220877 
+334739.715997  7398302.577218 
+334726.901355  7398323.933560 
+334711.241763  7398343.860147 
+334645.131732  7398434.794571 
+334548.955944  7398558.803329 
+334534.731196  7398587.278452 
+334523.343151  7398614.323819 
+334517.653252  7398629.981137 
+334516.226654  7398647.068210 
+334513.381705  7398668.414554 
+334519.071604  7398691.190652 
+334519.071604  7398723.935044 
+334510.528509  7398968.773105 
+334573.150384  7398996.638332 
+334697.421080  7399062.287087 
+334782.728336  7399107.689310 
+334796.845883  7399114.848084 
+334934.590920  7399186.895743 
+334971.534033  7399206.242429 
+335001.937886  7399222.069718 
+335015.882262  7399230.488276 
+335036.143250  7399247.815308 
+335047.778682  7399261.822908 
+335057.896807  7399278.110118 
+335069.260113  7399302.785892 
+335078.339213  7399332.290838 
+335083.072549  7399376.013348 
+335083.806463  7399388.971129 
+335087.286373  7399424.545035 
+335109.806829  7399709.466231 
+335110.293356  7399724.213705 
+335110.021231  7399736.661573 
+335100.002060  7399800.920566 
+335075.782881  7400000.986296 
+335064.856625  7400045.458679 
+335131.469677  7400128.174510 
+335156.216615  7400192.113558 
+335258.593568  7400348.396788 
+335292.353637  7400398.358230 
+335373.463561  7400535.854678 
+335400.956494  7400621.100076 
+335410.588092  7400678.850184 
+335425.711679  7400823.225454 
+335446.723074  7400938.995624 
+335449.089742  7400984.777782 
+335470.290801  7401032.279645 
+335495.837624  7401037.718713 
+335561.840454  7401046.657182 
+335700.022541  7401017.782128 
+335803.916801  7400998.205482 
+335831.723091  7400994.146177 
+335855.595928  7400990.176857 
+335903.333358  7400983.537994 
+335954.459988  7400971.630034 
+335984.896825  7400976.219248 
+336018.673386  7400980.858453 
+336219.312424  7401025.530801 
+336325.977417  7401053.615990 
+336430.382943  7401079.671527 
+336449.769831  7401085.420543 
+336526.311344  7401109.146478 
+336560.112644  7401115.985307 
+336636.266584  7401131.822594 
+336700.438751  7401143.370616 
+336731.683719  7401133.962228 
+336794.140670  7401093.309191 
+336880.569413  7401039.408424 
+336865.173700  7400930.737038 
+336851.047907  7400819.936018 
+336838.637330  7400751.907670 
+336827.513165  7400669.761741 
+336871.581022  7400643.666211 
+336956.723353  7400588.905591 
+336961.431951  7400532.855192 
+336966.132302  7400431.462560 
+337034.881127  7400436.881631 
+337058.828181  7400437.671496 
+337089.240279  7400428.922995 
+337104.446329  7400418.634757 
+337141.711045  7400383.940700 
+337173.648696  7400351.536250 
+337221.551050  7400314.952517 
+337250.000546  7400310.003364 
+337340.832776  7400233.286505 
+337318.600939  7400187.734308 
+337318.089672  7400177.836004 
+337316.300240  7400158.459323 
+337317.471205  7400132.563758 
+337321.858200  7400092.160679 
+337327.556345  7400064.295452 
+337320.233692  7400027.491756 
+337313.537753  7400008.574996 
+337301.778628  7399982.419477 
+337287.809513  7399961.773013 
+337258.189053  7399938.876935 
+337190.586454  7399887.675705 
+337185.028495  7399879.717069 
+337091.070943  7399813.628389 
+337058.424116  7399793.721799 
+337016.228153  7399683.040757 
+336970.016277  7399568.890310 
+337007.652073  7399506.690965 
+337033.726655  7399465.088091 
+337054.589618  7399429.514184 
+337075.073255  7399391.360720 
+337092.942837  7399344.448755 
+337127.568759  7399337.749903 
+337148.390492  7399271.011334 
+337161.939049  7399228.858555 
+337169.723491  7399208.232088 
+337175.149510  7399188.695434 
+337178.596435  7399163.479754 
+337179.454043  7399134.534712 
+337181.193997  7399038.371184 
+337178.307817  7398931.559479 
+337177.837782  7398826.127539 
+337176.716294  7398724.474951 
+337175.932902  7398630.621027 
+337173.021983  7398484.346083 
+337172.997244  7398413.518215 
+337172.288068  7398366.076342 
+337172.263330  7398316.744792 
+337170.960425  7398213.692444 
+337170.803747  7398157.902000 
+337170.836732  7398113.799554 
+337176.493646  7397969.644247 
+337151.771446  7397930.240996 
+337117.928916  7397883.069076 
+337096.398008  7397846.145401 
+337085.117164  7397800.003305 
+Region 1
+430
+351616.072313  7401306.892606 
+351610.176258  7401334.157936 
+351602.070213  7401359.213644 
+351587.573340  7401386.488972 
+351581.677285  7401394.837542 
+351571.113863  7401403.196110 
+351552.691784  7401413.024427 
+351536.232307  7401419.163375 
+351518.296756  7401422.112870 
+351493.731235  7401422.352829 
+351470.633543  7401420.633124 
+351445.325861  7401416.463838 
+351414.864285  7401410.804807 
+351385.631397  7401401.226448 
+351365.485856  7401396.067332 
+351329.218933  7401388.138690 
+351310.120663  7401383.209534 
+351300.876639  7401383.209534 
+351278.686032  7401386.908900 
+351266.984631  7401389.378477 
+351251.572426  7401391.838056 
+351233.702844  7401390.608267 
+351225.077287  7401386.908900 
+351208.551840  7401386.918899 
+351190.566811  7401390.288321 
+351178.857164  7401387.208849 
+351156.674803  7401379.200221 
+351120.317172  7401368.722016 
+351101.829123  7401365.342594 
+351085.806697  7401367.192278 
+351059.311558  7401367.192278 
+351035.282042  7401368.422067 
+351017.404214  7401371.501539 
+350994.603386  7401379.510168 
+350976.733804  7401384.439323 
+350961.329845  7401390.608267 
+350942.841796  7401391.838056 
+350929.284993  7401390.608267 
+350913.262567  7401390.608267 
+350902.171387  7401394.307633 
+350886.767428  7401402.926157 
+350875.676248  7401410.944783 
+350865.813756  7401419.573305 
+350857.188199  7401429.431617 
+350855.341043  7401446.678662 
+350855.341043  7401478.113278 
+350859.653822  7401495.370322 
+350874.439313  7401519.396206 
+350896.011453  7401531.104201 
+350930.521928  7401544.661879 
+350947.154575  7401555.140084 
+350957.017067  7401571.157340 
+350963.177001  7401589.034278 
+350961.948313  7401604.441639 
+350954.551444  7401619.839001 
+350945.307419  7401627.857628 
+350934.216239  7401632.786784 
+350917.575346  7401635.246362 
+350894.774518  7401632.786784 
+350864.585068  7401619.229106 
+350850.409797  7401609.980690 
+350836.852994  7401601.352168 
+350823.914658  7401600.742273 
+350807.273765  7401600.742273 
+350791.869806  7401606.291322 
+350782.007314  7401615.529740 
+350775.228912  7401631.556994 
+350775.228912  7401647.574251 
+350780.778625  7401670.990240 
+350798.029740  7401715.972535 
+350806.655297  7401736.309051 
+350807.892232  7401752.946201 
+350807.273765  7401767.743667 
+350802.342519  7401778.211874 
+350790.022650  7401782.531134 
+350777.076068  7401783.760923 
+350759.824953  7401782.531134 
+350749.962462  7401774.522506 
+350727.780101  7401752.336306 
+350682.796913  7401699.335384 
+350663.690397  7401687.017494 
+350652.599216  7401682.698234 
+350639.042413  7401682.698234 
+350631.645544  7401687.627390 
+350625.485610  7401695.026123 
+350621.172831  7401706.734117 
+350618.707208  7401725.830846 
+350622.401520  7401758.495251 
+350629.798389  7401791.159656 
+350631.645544  7401836.141951 
+350632.264012  7401859.557940 
+350637.813725  7401876.195090 
+350653.217684  7401890.372662 
+350681.559978  7401906.389918 
+350703.750585  7401925.496645 
+350725.314478  7401954.461684 
+350737.642593  7401977.257779 
+350743.802527  7401994.514823 
+350754.893707  7402030.248702 
+350769.679199  7402054.284585 
+350792.480027  7402082.019834 
+350836.234527  7402122.682869 
+350875.057780  7402151.038012 
+350907.102633  7402182.462629 
+350932.369083  7402224.985345 
+350940.376173  7402256.409963 
+350940.376173  7402294.613419 
+350934.216239  7402322.958563 
+350920.659436  7402351.313706 
+350887.996116  7402403.074840 
+350859.653822  7402432.039879 
+350816.517789  7402472.702914 
+350802.960986  7402485.650696 
+350790.632871  7402495.509007 
+350777.744013  7402501.817926 
+350765.366420  7402507.217002 
+350739.489749  7402518.924996 
+350706.826429  7402521.384575 
+350677.865667  7402519.534892 
+350655.683307  7402511.526264 
+350631.645544  7402496.738796 
+350612.547274  7402486.880485 
+350590.356667  7402479.481752 
+350547.220635  7402474.552597 
+350504.703070  7402469.013546 
+350478.826398  7402465.924075 
+350458.482947  7402460.994919 
+350423.362251  7402444.977663 
+350367.287882  7402424.021252 
+350334.624563  7402414.162941 
+350314.907825  7402411.083468 
+350297.038243  7402411.083468 
+350277.313260  7402414.162941 
+350251.436588  7402424.641146 
+350226.170137  7402436.969034 
+350203.369309  7402452.986291 
+350172.553145  7402467.773758 
+350142.363695  7402483.181119 
+350116.478777  7402491.189747 
+350094.914884  7402495.509007 
+350054.854695  7402497.968586 
+350011.100196  7402501.048058 
+349997.543392  7402504.747425 
+349976.597967  7402515.225630 
+349946.400270  7402528.783308 
+349918.049729  7402539.261513 
+349884.157721  7402545.420458 
+349849.647246  7402544.190668 
+349823.152107  7402538.021725 
+349800.557435  7402389.777118 
+349792.599822  7402332.077002 
+349786.299702  7402264.388596 
+349800.573927  7402204.168911 
+349811.656861  7402191.501081 
+349817.998213  7402177.233525 
+349887.720093  7402121.773025 
+350002.326206  7402014.921327 
+350040.069204  7401915.668329 
+350093.496532  7401769.383386 
+350139.263112  7401657.762506 
+350125.186797  7401641.805239 
+350109.106647  7401604.601611 
+350047.226932  7401579.985828 
+350024.203456  7401578.416097 
+350007.620286  7401574.906698 
+349969.390761  7401565.118375 
+349942.029768  7401545.431747 
+349940.702125  7401493.290678 
+349947.241385  7401461.756080 
+349951.999461  7401404.615867 
+349947.241385  7401339.547013 
+349936.133713  7401283.996528 
+349917.818835  7401240.533973 
+349915.501644  7401217.337946 
+349898.036127  7401120.524530 
+349893.278052  7401088.789965 
+349885.328686  7401064.834069 
+349886.367711  7401059.095052 
+349887.349012  7401050.326554 
+349890.226947  7401041.518063 
+349893.838796  7401030.799899 
+349899.751343  7401021.171548 
+349937.733482  7400991.646605 
+349972.573806  7400968.110637 
+349982.296112  7400961.371791 
+350000.256402  7400948.583981 
+350010.646653  7400931.306941 
+350039.236335  7400901.472051 
+350052.809630  7400883.455137 
+350068.617654  7400863.728516 
+350083.221729  7400836.253223 
+350091.393743  7400817.066509 
+350094.626266  7400798.379710 
+350098.889567  7400782.482433 
+350109.048923  7400737.730099 
+350112.009320  7400727.901782 
+350115.406767  7400688.638508 
+350123.463334  7400636.547430 
+350157.322357  7400470.995788 
+350103.548687  7400438.161412 
+350030.371637  7400374.432328 
+349940.091903  7400291.226581 
+349904.962961  7400255.502700 
+349891.010339  7400242.404943 
+349875.829028  7400225.117905 
+349863.797778  7400212.750023 
+349855.609271  7400202.221826 
+349842.728658  7400185.294726 
+349834.086609  7400171.327118 
+349823.803559  7400149.780809 
+349803.897158  7400102.478912 
+349794.413993  7400083.592147 
+349787.281003  7400068.084803 
+349778.919325  7400048.028238 
+349771.077160  7400035.970304 
+349762.121754  7400025.062172 
+349744.557282  7400002.486039 
+349729.458434  7399989.408279 
+349715.926370  7399978.580134 
+349691.492788  7399954.604241 
+349645.429344  7399915.360963 
+349636.490430  7399905.222700 
+349617.524099  7399889.145454 
+349606.696798  7399880.566923 
+349592.735930  7399867.089232 
+349579.937780  7399855.111283 
+349564.459605  7399841.653589 
+349549.030908  7399831.225375 
+349530.460396  7399816.297932 
+349507.700800  7399800.680607 
+349487.208916  7399784.633356 
+349439.619919  7399758.397849 
+349410.230353  7399743.290437 
+349383.322903  7399729.972718 
+349294.882079  7399686.480168 
+349267.133513  7399672.842504 
+349176.012664  7399625.210663 
+349116.582080  7399594.905854 
+349174.503604  7399305.255469 
+349215.289461  7399090.702220 
+349227.749515  7399021.554064 
+349249.148484  7398872.559586 
+349259.868584  7398795.392804 
+349269.879508  7398718.975893 
+349285.407160  7398596.836814 
+349296.572556  7398517.010488 
+349336.096740  7398505.722421 
+349348.787689  7398502.792923 
+349358.551226  7398498.883593 
+349369.287818  7398494.984261 
+349382.960069  7398489.125264 
+349395.651017  7398483.266268 
+349410.296323  7398471.548275 
+349419.078559  7398461.789947 
+349432.750809  7398440.303627 
+349455.782531  7398357.317842 
+349479.003917  7398313.485350 
+349490.812519  7398296.988176 
+349496.015891  7398288.069703 
+349504.666187  7398280.301034 
+349515.971769  7398273.662171 
+349526.543437  7398269.342911 
+349544.314064  7398266.893331 
+349566.183067  7398264.023822 
+349588.736508  7398262.134146 
+349630.008892  7398259.754554 
+349648.686605  7398258.074841 
+349661.088936  7398256.055187 
+349681.011829  7398252.985713 
+349706.187571  7398250.226186 
+349725.186887  7398247.676622 
+349745.992127  7398240.137914 
+349775.662064  7398234.688847 
+349786.208993  7398232.249265 
+349799.823520  7398231.979311 
+349820.397866  7398224.400609 
+349836.453277  7398223.350789 
+349850.950150  7398223.160822 
+349860.961074  7398228.009991 
+349891.216494  7398239.967943 
+349915.823247  7398250.956061 
+349935.869833  7398261.124319 
+349950.770772  7398268.373077 
+349965.556264  7398280.710964 
+349982.997042  7398298.447926 
+349997.048619  7398316.354858 
+350004.066161  7398328.832721 
+350010.861055  7398344.300072 
+350026.817511  7398374.024980 
+350062.169102  7398430.395324 
+350151.079961  7398588.558232 
+350183.858728  7398600.996102 
+350217.800213  7398611.154362 
+350314.866594  7398627.171618 
+350397.271177  7398641.129227 
+350521.203777  7398664.465230 
+350583.141216  7398677.273036 
+350651.189111  7398681.572300 
+350713.398675  7398686.571444 
+350774.536229  7398689.640918 
+350826.157633  7398688.451122 
+350892.572774  7398688.271153 
+350923.586848  7398688.651087 
+350954.592675  7398689.290978 
+351018.030927  7398690.840712 
+351076.678120  7398691.450608 
+351111.089640  7398692.180483 
+351138.038322  7398693.530252 
+351202.853695  7398693.040336 
+351210.539182  7398692.970348 
+351314.268517  7398692.770382 
+351380.782614  7398693.580243 
+351441.161514  7398695.499914 
+351452.137247  7398699.269269 
+351459.476393  7398699.429241 
+351465.578603  7398699.569217 
+351473.989759  7398701.448895 
+351521.628233  7398720.465638 
+351546.218493  7398729.334119 
+351580.300164  7398746.451187 
+351639.747241  7398770.517065 
+351690.849132  7398794.203007 
+351789.276141  7398836.265802 
+351816.233069  7398838.645395 
+351843.387907  7398840.765032 
+351852.739132  7398841.814852 
+351960.377181  7398859.131886 
+352044.010452  7398860.461658 
+352154.699606  7398872.609577 
+352184.443760  7398874.529248 
+352253.753329  7398881.448063 
+352289.129658  7398884.987457 
+352303.511084  7398886.657171 
+352345.731785  7398890.296547 
+352364.706362  7398891.346368 
+352425.110001  7398895.185710 
+352458.936040  7398897.365337 
+352481.646159  7398899.764926 
+352559.540053  7398911.352941 
+352619.539628  7398913.272612 
+352624.800723  7398949.186460 
+352628.866114  7398997.748142 
+352628.866114  7399028.672845 
+352632.040913  7399055.678219 
+352633.962285  7399077.244525 
+352636.007350  7399109.648974 
+352585.639373  7399248.065265 
+352570.136460  7399288.988255 
+352541.579763  7399349.297925 
+352510.631659  7399428.654332 
+352477.300395  7399498.492369 
+352443.969131  7399553.242991 
+352423.337062  7399584.197688 
+352409.722535  7399608.703491 
+352379.689763  7399666.723552 
+352359.057694  7399718.304717 
+352344.783469  7399765.916562 
+352336.834102  7399794.491667 
+352328.901228  7399827.815959 
+352324.926545  7399846.862696 
+352319.822128  7399868.269030 
+352314.956852  7399903.772948 
+352302.472059  7399937.687139 
+352293.590869  7399948.315318 
+352277.741613  7399971.521343 
+352239.990370  7400009.864775 
+352194.471176  7400063.805536 
+352182.530634  7400075.963453 
+352170.985912  7400096.030016 
+352167.011228  7400104.888499 
+352158.410410  7400130.054188 
+352152.868943  7400155.229876 
+352150.691938  7400189.983923 
+352160.991480  7400293.186245 
+352167.844098  7400337.238699 
+352168.990324  7400346.717076 
+352186.546549  7400456.988187 
+352187.742252  7400468.486218 
+352188.138071  7400481.114055 
+352186.991845  7400494.061837 
+352184.666408  7400508.129427 
+352181.936906  7400522.946889 
+352176.618087  7400535.014822 
+352168.272902  7400546.222902 
+352159.226787  7400554.731445 
+352147.879973  7400563.929869 
+352134.380894  7400568.489088 
+352089.851248  7400575.907817 
+351995.423661  7400588.655634 
+351953.376131  7400587.255874 
+351776.659408  7400522.017048 
+351759.952545  7400544.823142 
+351738.256712  7400580.147091 
+351719.216166  7400658.703635 
+351705.601639  7400691.398035 
+351691.261444  7400711.214641 
+351678.768404  7400733.370845 
+351648.562461  7400773.334000 
+351616.847458  7400744.408955 
+351575.500858  7400698.876754 
+351534.319182  7400666.642275 
+351523.566097  7400659.093568 
+351475.540050  7400620.890112 
+351396.367989  7400578.147434 
+351323.438326  7400554.021566 
+351313.476879  7400556.161200 
+351292.646900  7400556.381162 
+351271.536550  7400560.490458 
+351282.198926  7400573.058306 
+351306.277920  7400650.934966 
+351334.529506  7400747.728386 
+351362.533705  7400842.812099 
+351393.737442  7400948.204046 
+351398.907829  7400963.931353 
+351414.130370  7401008.143779 
+351418.797737  7401018.961926 
+351438.943278  7401062.934394 
+351443.363258  7401070.553089 
+351448.525398  7401074.722375 
+351464.490101  7401086.760313 
+351475.053522  7401096.348671 
+351519.278057  7401141.550928 
+351557.359150  7401180.364280 
+351598.384148  7401223.356915 
+351614.357097  7401242.763591 
+351620.005765  7401250.872202 
+351622.463141  7401257.751024 
+351623.197056  7401265.619676 
+351621.481840  7401281.097025 
+351616.072313  7401306.892606 
+Region 1
+126
+323980.817641  7397992.200383 
+324057.120013  7397934.540260 
+324040.990386  7397911.364230 
+324092.018061  7397845.835454 
+324176.978976  7397731.405055 
+324194.263075  7397698.160749 
+324188.853548  7397690.242106 
+324230.719661  7397533.278992 
+324285.746758  7397343.731460 
+324331.727740  7397182.789028 
+324352.236116  7397131.617793 
+324370.707672  7397107.931850 
+324406.768439  7397044.902647 
+324429.965086  7396949.928915 
+324440.322351  7396937.980961 
+324443.043608  7396924.063345 
+324443.076592  7396912.535320 
+324439.538960  7396902.627017 
+324435.127226  7396893.498581 
+324429.569267  7396885.939876 
+324419.632559  7396874.811782 
+324446.012251  7396786.426921 
+324472.812500  7396704.111021 
+324479.871274  7396681.244938 
+324519.601613  7396545.958111 
+324509.095915  7396522.582115 
+324500.882669  7396499.586054 
+324494.318670  7396474.950274 
+324489.387424  7396451.964212 
+324482.823424  7396419.119838 
+324489.387424  7396323.866154 
+324515.668161  7396220.403876 
+324522.232160  7396177.701190 
+324527.163406  7396103.803848 
+324523.881407  7396080.807787 
+324506.127272  7396048.483324 
+324477.908671  7395999.971634 
+324456.221084  7395977.665455 
+324440.643954  7395967.297231 
+324423.062991  7395959.468572 
+324404.467741  7395955.709216 
+324382.582244  7395951.689904 
+324357.653889  7395951.499937 
+324323.563972  7395953.349620 
+324254.889363  7395961.888157 
+324190.799658  7395969.906784 
+324138.048521  7395979.415155 
+324096.446287  7395984.604266 
+324073.810384  7395987.203821 
+324043.027205  7395988.033679 
+324016.053785  7395986.313973 
+323999.998374  7395984.374306 
+323965.578607  7395981.524794 
+323928.759187  7395969.336881 
+323903.146395  7395958.178793 
+323879.512698  7395948.920378 
+323833.770856  7395916.805879 
+323808.306496  7395899.178899 
+323797.446210  7395885.901173 
+323709.483668  7395792.587157 
+323675.583414  7395753.253894 
+323662.397691  7395744.275432 
+323639.761788  7395698.913202 
+323623.129141  7395670.348095 
+323604.773031  7395633.144468 
+323592.667565  7395614.757618 
+323573.470340  7395590.511771 
+323557.546868  7395571.345054 
+323539.067065  7395554.967859 
+323508.143700  7395536.990938 
+323488.360993  7395525.942831 
+323437.819845  7395510.365499 
+323352.092032  7395420.640868 
+323241.848174  7395300.011531 
+323193.046981  7395247.870462 
+323084.806958  7395133.560042 
+322960.626970  7395008.331493 
+322908.486054  7395063.202094 
+322778.038931  7395159.315631 
+322679.249088  7395255.479159 
+322541.866886  7395376.308462 
+322440.265078  7395484.729890 
+322323.325281  7395595.220964 
+322149.478247  7395741.825852 
+321998.324839  7395885.191295 
+321851.319285  7396032.046140 
+321734.049639  7396143.926976 
+321538.275877  7396361.519704 
+321460.010902  7396574.223270 
+321439.766406  7396810.552789 
+321435.824708  7396919.844068 
+321439.873607  7397044.702681 
+321155.156001  7397230.310888 
+321196.172753  7397248.547764 
+321232.637585  7397269.054252 
+321266.818211  7397280.452299 
+321310.119168  7397294.119958 
+321344.299794  7397298.679177 
+321387.600751  7397314.626445 
+321435.453627  7397344.251371 
+321481.690243  7397401.231611 
+321535.628837  7397502.714228 
+321583.440483  7397617.474570 
+321628.324716  7397727.745682 
+321647.785820  7397771.298222 
+321664.162834  7397793.174474 
+321728.590634  7397885.788610 
+321839.329266  7397988.471022 
+321962.148625  7398073.036537 
+322107.109114  7398101.221709 
+322401.062497  7398103.231365 
+322637.292267  7398096.632495 
+322810.331171  7398086.984148 
+323021.822248  7398089.763671 
+323213.489387  7398119.318609 
+323369.285423  7398217.451800 
+323509.298173  7398295.668402 
+323748.999605  7398458.030591 
+323794.527045  7398290.029368 
+323823.578515  7398208.733293 
+323830.909414  7398192.076146 
+323847.566800  7398138.115389 
+323867.563909  7398098.142236 
+323894.867179  7398063.488172 
+323924.256745  7398036.192848 
+323980.817641  7397992.200383 
+Region 1
+221
+340976.158818  7397756.260797 
+341015.427369  7397786.855557 
+341050.976869  7397821.989539 
+341089.420796  7397865.392104 
+341113.804900  7397899.696228 
+341167.957897  7398039.822226 
+341184.079278  7398108.030542 
+341189.859886  7398155.562401 
+341192.168830  7398186.007186 
+341187.608665  7398241.597664 
+341182.009474  7398277.091584 
+341165.475782  7398349.009265 
+341125.662980  7398510.671574 
+341114.217212  7398564.362377 
+341107.191423  7398796.252656 
+341111.322785  7398835.935859 
+341124.970297  7398907.033680 
+341134.478201  7398975.241997 
+341148.942089  7399050.469111 
+341168.370209  7399113.708279 
+341191.929690  7399184.806101 
+341162.169043  7399198.763710 
+341149.354401  7399204.542720 
+341144.192260  7399208.881977 
+341139.854743  7399215.710807 
+341137.166472  7399220.250029 
+341130.965306  7399223.969392 
+341120.838935  7399230.798223 
+341107.818137  7399240.096630 
+341092.315223  7399249.395037 
+341079.500581  7399258.693444 
+341066.892094  7399269.231639 
+341056.353412  7399278.740011 
+341045.608573  7399286.388700 
+341030.732373  7399298.996541 
+341004.896932  7399322.972434 
+340983.399009  7399341.989177 
+340960.457995  7399360.376027 
+340942.893524  7399374.023689 
+340925.329053  7399385.391742 
+340914.782124  7399392.000610 
+340893.086291  7399408.737743 
+340881.508583  7399417.006327 
+340872.833548  7399422.795335 
+340847.204264  7399447.601086 
+340836.253269  7399460.408892 
+340819.925733  7399486.454431 
+340812.067075  7399500.711989 
+340808.966492  7399508.570643 
+340803.185884  7399530.476890 
+340797.603186  7399554.862713 
+340794.708759  7399569.330235 
+340788.919905  7399611.493013 
+340787.270659  7399622.651102 
+340785.200855  7399650.346358 
+340784.788544  7399670.802854 
+340784.582388  7399695.608605 
+340786.033725  7399718.344710 
+340787.889127  7399741.280781 
+340788.919905  7399766.086532 
+340787.064503  7399788.192746 
+340784.170077  7399802.870232 
+340781.687961  7399810.728886 
+340778.999690  7399816.507896 
+340774.868328  7399823.126762 
+340769.994806  7399829.835613 
+340764.741957  7399837.184354 
+340759.365415  7399846.482761 
+340751.721159  7399861.770143 
+340745.519994  7399872.728266 
+340725.473407  7399904.142885 
+340709.352026  7399934.937610 
+340687.862349  7399972.141237 
+340668.021918  7400004.375716 
+340651.092406  7400031.351095 
+340634.954533  7400057.286653 
+340616.920027  7400088.041385 
+340608.294469  7400102.348934 
+340596.098294  7400128.174510 
+340558.487236  7400204.851376 
+340552.492227  7400220.358720 
+340547.791875  7400229.657127 
+340529.773861  7400252.483217 
+340521.362706  7400269.300337 
+340503.336446  7400308.053698 
+340500.334818  7400317.062155 
+340499.130868  7400333.889273 
+340447.278570  7400269.590287 
+340233.973322  7400103.468742 
+340131.101594  7400024.922196 
+340053.933368  7399963.952640 
+339973.656312  7399907.072383 
+339966.242951  7399899.663652 
+339947.952812  7399866.169389 
+339900.165905  7399823.966618 
+339882.659157  7399807.249482 
+339836.579220  7399829.265710 
+339793.970947  7399849.642220 
+339751.370919  7399881.136825 
+339718.946740  7399907.992225 
+339697.960083  7399933.077928 
+339672.099904  7399958.183628 
+339641.341464  7399987.518603 
+339604.060255  7400067.194955 
+339615.283375  7400110.037617 
+339507.571110  7400212.490068 
+339423.443065  7400304.864245 
+339275.654119  7400465.586714 
+339213.947575  7400525.076524 
+339071.700097  7400670.651589 
+339012.582869  7400722.742666 
+338984.619901  7400747.098494 
+338974.147188  7400753.987314 
+338951.197928  7400765.485345 
+338922.121719  7400770.444495 
+338892.501259  7400775.503628 
+338766.523593  7400795.240248 
+338729.819620  7400803.018915 
+338658.250585  7400808.088047 
+338629.058928  7400804.838604 
+338601.277377  7400809.587790 
+338560.689430  7400814.047026 
+338380.806155  7400829.324409 
+338318.002862  7400819.716055 
+338252.973087  7400809.017888 
+338198.061437  7400790.511058 
+338081.913278  7400670.821560 
+338037.936130  7400625.009407 
+338025.146227  7400605.682717 
+337974.019597  7400554.811431 
+337903.077274  7400482.393836 
+337834.716022  7400379.311493 
+337790.376040  7400367.853455 
+337671.786997  7400344.207506 
+337573.500174  7400280.288454 
+337503.671093  7400238.175668 
+337441.948057  7400193.393339 
+337340.832776  7400233.286505 
+337318.600939  7400187.734308 
+337318.089672  7400177.836004 
+337316.300240  7400158.459323 
+337317.471205  7400132.563758 
+337321.858200  7400092.160679 
+337327.556345  7400064.295452 
+337320.233692  7400027.491756 
+337313.537753  7400008.574996 
+337301.778628  7399982.419477 
+337287.809513  7399961.773013 
+337258.189053  7399938.876935 
+337190.586454  7399887.675705 
+337185.028495  7399879.717069 
+337091.070943  7399813.628389 
+337058.424116  7399793.721799 
+337016.228153  7399683.040757 
+336970.016277  7399568.890310 
+337007.652073  7399506.690965 
+337033.726655  7399465.088091 
+337054.589618  7399429.514184 
+337075.073255  7399391.360720 
+337092.942837  7399344.448755 
+337127.568759  7399337.749903 
+337148.390492  7399271.011334 
+337161.939049  7399228.858555 
+337169.723491  7399208.232088 
+337175.149510  7399188.695434 
+337178.596435  7399163.479754 
+337179.454043  7399134.534712 
+337181.193997  7399038.371184 
+337178.307817  7398931.559479 
+337177.837782  7398826.127539 
+337176.716294  7398724.474951 
+337175.932902  7398630.621027 
+337173.021983  7398484.346083 
+337172.997244  7398413.518215 
+337172.288068  7398366.076342 
+337172.263330  7398316.744792 
+337170.960425  7398213.692444 
+337170.803747  7398157.902000 
+337170.836732  7398113.799554 
+337176.493646  7397969.644247 
+337151.771446  7397930.240996 
+337117.928916  7397883.069076 
+337096.398008  7397846.145401 
+337085.117164  7397800.003305 
+337064.278939  7397738.833783 
+337023.344650  7397666.586158 
+337016.120952  7397601.577293 
+337030.568348  7397531.739256 
+337111.777228  7397341.601825 
+337074.751652  7397287.131155 
+337050.144900  7397256.326432 
+337016.063229  7397203.965401 
+336981.824879  7397158.343215 
+337194.214796  7397000.300287 
+337391.332693  7396931.912001 
+337576.386355  7396931.912001 
+337821.777686  7396988.232354 
+338206.431361  7397106.442105 
+338535.431225  7397199.266206 
+338585.906403  7397212.193991 
+338837.853488  7397289.180804 
+338911.335649  7397309.607305 
+339021.373351  7397338.952279 
+339154.731393  7397356.979191 
+339360.862421  7397336.002784 
+339523.214210  7397336.002784 
+339593.026798  7397346.071059 
+339654.560171  7397352.419972 
+339841.040431  7397414.219386 
+340016.116154  7397512.502551 
+340178.896747  7397598.507819 
+340221.570991  7397617.284603 
+340301.757337  7397650.718876 
+340424.617928  7397669.145719 
+340657.879054  7397676.074533 
+340771.685283  7397678.364140 
+340824.461159  7397685.172974 
+340880.675714  7397701.700143 
+340932.074469  7397727.665696 
+340931.777605  7397728.135615 
+340976.158818  7397756.260797 
+Region 1
+234
+331712.623682  7390192.006486 
+331686.120296  7390140.935234 
+331683.753628  7390117.869185 
+331690.259904  7390088.884150 
+331696.757934  7390068.057717 
+331725.850636  7390000.039368 
+331798.821531  7389936.790202 
+331619.870079  7389999.569448 
+331573.757157  7390028.264533 
+331581.788986  7390000.029370 
+331590.562976  7389974.213792 
+331596.401307  7389945.818655 
+331600.343005  7389909.554867 
+331608.127447  7389827.828866 
+331608.127447  7389775.287866 
+331601.621171  7389634.431993 
+331591.973081  7389489.226866 
+331578.226614  7389343.421841 
+331578.127660  7389255.396918 
+331603.262171  7389247.928198 
+331730.006736  7389215.003837 
+331758.918020  7389207.865060 
+331859.901361  7389182.949328 
+331993.976825  7389168.841745 
+332122.123249  7389164.182543 
+332262.152492  7389149.874993 
+332395.551765  7389140.086670 
+332485.031614  7389141.446437 
+332546.367077  7389142.616237 
+332643.697338  7389145.295778 
+332704.529781  7389146.205622 
+332778.284068  7389149.245101 
+332853.572154  7389149.485060 
+332929.091134  7389152.794493 
+333027.452173  7389152.694510 
+333212.002815  7389152.654517 
+333340.272933  7389152.234589 
+333412.518160  7389151.704680 
+333453.600881  7389150.704851 
+333502.022747  7389150.774839 
+333541.563423  7389151.544707 
+333623.951513  7389150.314918 
+333697.211026  7389151.054791 
+333774.032911  7389149.785009 
+333847.787198  7389151.804663 
+333847.828429  7389151.794665 
+333915.208380  7389153.024454 
+333951.186684  7389155.294065 
+334049.803356  7389156.203909 
+334125.817111  7389160.013257 
+334232.539828  7389161.483005 
+334285.761000  7389163.872596 
+334309.048356  7389163.042738 
+334325.870666  7389161.403019 
+334336.434088  7389160.143235 
+334355.656051  7389198.566653 
+334398.330295  7389286.481594 
+334434.844604  7389360.768869 
+334459.542065  7389411.040258 
+334476.933365  7389447.074086 
+334519.632348  7389534.169167 
+334562.331330  7389621.594192 
+334572.185575  7389643.190493 
+334578.139354  7389658.437881 
+334582.872690  7389672.885406 
+334586.096967  7389686.103142 
+334594.582338  7389711.338820 
+334610.423347  7389763.679854 
+334619.535432  7389797.564050 
+334623.526607  7389823.189661 
+334627.385843  7389842.956275 
+334640.332426  7389940.829510 
+334640.818953  7389946.328568 
+334645.758445  7389969.414614 
+334648.801304  7389997.919731 
+334651.901887  7390022.095590 
+334653.056359  7390036.953045 
+334654.441726  7390058.669325 
+334656.511530  7390074.536607 
+334662.844635  7390110.490449 
+334665.928725  7390135.556155 
+334669.037554  7390158.292261 
+334676.038604  7390198.245417 
+334685.092965  7390236.778817 
+334694.196804  7390280.181382 
+334700.727819  7390307.506702 
+334715.199954  7390372.165626 
+334729.729812  7390426.156378 
+334751.541092  7390497.804105 
+334775.413930  7390544.526102 
+334821.106294  7390644.199029 
+334851.122573  7390700.939310 
+334864.836055  7390724.575262 
+334875.209813  7390746.171562 
+334883.959064  7390766.178135 
+334886.358717  7390771.667195 
+334892.749546  7390783.805116 
+334904.450947  7390805.421413 
+334927.861996  7390847.114272 
+334941.361075  7390872.179978 
+334954.208703  7390891.596652 
+334971.979330  7390909.193638 
+334980.984214  7390915.602540 
+334987.828585  7390924.650990 
+334994.046243  7390932.429658 
+335005.228132  7390941.618084 
+335015.486443  7390948.506904 
+335024.977854  7390952.946144 
+335037.536863  7390956.615515 
+335079.493685  7390965.963914 
+335100.315417  7390970.403153 
+335122.209160  7390974.532446 
+335146.865389  7390981.121317 
+335159.267720  7390984.790689 
+335169.963081  7390988.909983 
+335175.042759  7390990.459718 
+335190.199331  7390998.418355 
+335201.686331  7391006.686938 
+335214.698883  7391018.934840 
+335225.113872  7391029.802979 
+335234.300173  7391042.670775 
+335251.295654  7391067.466527 
+335295.891269  7391144.893265 
+335221.567993  7391197.974173 
+335162.541474  7391247.205740 
+335076.450826  7391312.944479 
+335060.840711  7391329.821588 
+334992.396997  7391379.663051 
+334894.209128  7391456.909819 
+334822.499907  7391510.330669 
+334778.341342  7391546.504472 
+334698.187980  7391544.164873 
+334563.617742  7391541.795279 
+334499.981580  7391540.285538 
+334443.264006  7391537.536009 
+334386.538185  7391537.016098 
+334304.100617  7391534.196581 
+334217.572919  7391529.127449 
+334144.321652  7391529.517382 
+334080.363887  7391531.637019 
+334025.790333  7391529.297420 
+333890.156331  7391524.158300 
+333859.810202  7391489.414252 
+333826.083119  7391473.466983 
+333781.553474  7391471.317351 
+333714.173523  7391474.746764 
+333632.337930  7391481.265647 
+333580.106305  7391482.015519 
+333513.386053  7391491.213943 
+333436.481706  7391488.064483 
+333418.191566  7391488.814354 
+333398.606768  7391516.789562 
+333384.497468  7391539.305706 
+333378.246825  7391690.329836 
+333321.578728  7391799.701102 
+333313.299512  7391811.189134 
+333309.011473  7391814.528562 
+333302.678367  7391817.877989 
+333295.833996  7391819.717674 
+333289.220519  7391820.027620 
+333283.876961  7391819.817656 
+333277.263485  7391819.377732 
+333269.619229  7391818.427894 
+333264.786938  7391818.467888 
+333259.707259  7391819.777663 
+333253.638034  7391822.627175 
+333250.108647  7391826.466518 
+333239.347316  7391844.073502 
+333289.797755  7391879.407449 
+333133.292544  7391870.638951 
+333028.037656  7391902.023575 
+332932.142239  7391927.989128 
+332872.571469  7391951.855040 
+332727.652212  7391998.537043 
+332626.710103  7392026.792204 
+332559.536308  7392053.557619 
+332541.609002  7392058.756728 
+332497.986442  7392078.373368 
+332461.076314  7392090.601274 
+332337.028266  7392179.646021 
+332219.989515  7392274.429785 
+332079.572699  7392394.139280 
+332000.029558  7392457.088498 
+331984.056610  7392468.866480 
+331896.687796  7392539.074454 
+331727.186525  7392674.131320 
+331708.401611  7392647.115948 
+331642.151394  7392566.939681 
+331552.696284  7392470.546192 
+331512.965945  7392428.223442 
+331477.012380  7392393.809337 
+331393.346123  7392309.223826 
+331314.891485  7392231.127203 
+331268.399237  7392184.845130 
+331356.386518  7392080.083075 
+331372.780024  7392078.383366 
+331457.023516  7392028.971830 
+331476.921671  7392021.553101 
+331503.029237  7392006.015762 
+331513.609151  7392000.046785 
+331547.410451  7391976.780770 
+331571.753323  7391955.614396 
+331580.213956  7391937.117564 
+331567.753902  7391862.920273 
+331566.418012  7391788.333049 
+331562.459821  7391723.314187 
+331560.373525  7391612.173224 
+331552.712777  7391549.134022 
+331529.359452  7391440.092700 
+331530.579894  7391396.140229 
+331532.938316  7391370.984537 
+331538.380828  7391348.338417 
+331546.602320  7391322.142904 
+331564.241007  7391298.396971 
+331618.971240  7391230.768555 
+331663.690549  7391190.525448 
+331671.474991  7391181.546986 
+331706.711134  7391153.281828 
+331723.253073  7391033.212395 
+331796.190983  7390927.970422 
+331796.182737  7390927.970422 
+331839.458955  7390873.599735 
+331877.581279  7390814.959779 
+331878.562581  7390809.360739 
+331879.543882  7390803.001828 
+331883.601028  7390765.178307 
+331883.601028  7390765.138313 
+331888.837384  7390642.429332 
+331872.179998  7390625.002317 
+331824.459062  7390497.804105 
+331824.607494  7390483.056631 
+331847.127950  7390357.198190 
+331728.703831  7390216.982208 
+331712.623682  7390192.006486 
+Region 1
+241
+347127.871620  7396265.856090 
+347122.561047  7396275.024520 
+347113.448962  7396289.142102 
+347102.811325  7396304.029552 
+347082.690522  7396333.044581 
+347075.087497  7396342.972881 
+347035.456113  7396393.084297 
+347007.460160  7396427.338430 
+346934.175908  7396511.733974 
+346913.123281  7396540.808993 
+346870.003741  7396595.929552 
+346849.998386  7396653.999605 
+346767.000074  7396758.541698 
+346753.583457  7396787.756693 
+346743.242684  7396808.623119 
+346729.083906  7396834.408702 
+346713.003756  7396857.004832 
+346682.146361  7396882.460472 
+346606.000667  7396934.001643 
+346663.650065  7397002.509908 
+346583.043161  7397058.800266 
+346487.411624  7397125.588826 
+346441.018330  7397158.073262 
+346369.696682  7397206.344993 
+346323.369358  7397234.600153 
+346297.352500  7397248.917701 
+346272.976642  7397262.855313 
+346245.566172  7397276.782928 
+346217.042460  7397288.410936 
+346173.287960  7397304.518177 
+346145.143575  7397312.726771 
+346113.972823  7397317.875889 
+346090.619498  7397324.224801 
+346064.569655  7397326.884346 
+346034.149310  7397329.993813 
+346008.701443  7397329.653871 
+345985.158454  7397329.333926 
+345965.788058  7397327.324270 
+345941.873989  7397324.144815 
+345903.916590  7397316.696091 
+345889.873259  7397315.856235 
+345752.128222  7397293.090134 
+345663.629675  7397279.592446 
+345579.773755  7397272.023743 
+345466.074727  7397268.564335 
+345370.385467  7397240.309175 
+345309.091234  7397184.348761 
+345281.631286  7397156.473536 
+345130.815974  7397068.498605 
+345013.999871  7397017.267380 
+344861.749714  7396923.823386 
+344839.377691  7396909.745798 
+344760.865329  7396880.800756 
+344574.838611  7396839.177885 
+344332.424169  7396819.001341 
+344237.699718  7396816.201821 
+344099.501138  7396799.834625 
+344081.079059  7396798.284890 
+344064.190779  7396796.955118 
+344042.552669  7396793.795659 
+344009.518269  7396790.946147 
+343977.555879  7396790.336252 
+343879.203087  7396797.055101 
+343791.397223  7396820.211134 
+343715.721564  7396839.557820 
+343674.910969  7396845.776755 
+343602.377124  7396858.284613 
+343575.296502  7396859.494405 
+343550.895906  7396861.134125 
+343524.986249  7396859.324435 
+343504.040823  7396857.194799 
+343477.413745  7396851.565764 
+343369.849912  7396814.232158 
+343335.207497  7396803.933922 
+343279.974244  7396792.585866 
+343205.758168  7396771.759434 
+343095.093753  7396735.055721 
+342987.562905  7396704.640930 
+342948.500511  7396691.743140 
+342822.902172  7396659.348689 
+342649.475695  7396620.115409 
+342571.590047  7396602.818372 
+342332.168986  7396537.609541 
+342174.129976  7396493.967017 
+342122.162230  7396481.249195 
+341969.887335  7396445.495320 
+341980.417772  7396412.301006 
+341984.499656  7396398.213419 
+342000.010816  7396350.091661 
+342015.653915  7396258.917279 
+342048.292496  7396186.579670 
+342073.690886  7396157.934576 
+342102.750603  7396104.963650 
+342191.628477  7396049.993066 
+342234.879957  7396029.906506 
+342384.639752  7395945.910894 
+342423.364051  7395920.065321 
+342544.995953  7395870.413826 
+342584.396443  7395854.086623 
+342647.117273  7395830.040741 
+342723.617555  7395798.906075 
+342827.783940  7395759.482827 
+342828.064312  7395758.792946 
+342882.736821  7395734.797056 
+343006.339573  7395722.839104 
+343090.541834  7395728.968054 
+343259.927657  7395711.531041 
+343297.093419  7395688.724948 
+343318.179031  7395674.867321 
+343350.240375  7395644.822468 
+343405.696277  7395597.970493 
+343445.360646  7395570.445208 
+343492.207482  7395542.170051 
+343552.363735  7395509.005732 
+343636.450549  7395469.902430 
+343738.406944  7395422.220597 
+343807.328940  7395384.187112 
+343846.012008  7395366.440152 
+343874.304826  7395346.583553 
+343898.210648  7395326.357018 
+343918.537607  7395306.080491 
+343936.316480  7395286.113911 
+343964.601051  7395247.540519 
+343997.709667  7395210.626841 
+344050.535021  7395155.316316 
+344090.867335  7395118.082693 
+344147.873527  7395066.001614 
+344168.159255  7395047.824728 
+344203.749986  7395025.048629 
+344250.209250  7394992.104272 
+344282.097423  7394964.748958 
+344301.418342  7394942.802717 
+344319.494079  7394923.616004 
+344341.165174  7394892.611315 
+344358.284348  7394866.545779 
+344373.366704  7394840.910171 
+344384.985643  7394823.093222 
+344404.133391  7394799.657237 
+344422.332822  7394771.961981 
+344451.598694  7394744.276723 
+344520.751585  7394701.714014 
+344622.270930  7394640.994414 
+344735.615370  7394572.756103 
+344775.766267  7394550.809862 
+344813.905084  7394528.313716 
+344885.894678  7394485.601032 
+344940.163122  7394452.206752 
+344961.125040  7394440.808704 
+344974.211808  7394429.100710 
+344990.374420  7394416.422881 
+345002.661304  7394403.925022 
+345015.789303  7394388.557654 
+345035.382347  7394369.720881 
+345088.512811  7394289.214671 
+345149.056636  7394192.841179 
+345175.988826  7394226.315445 
+345249.974007  7394251.931057 
+345311.812491  7394276.566838 
+345355.731915  7394296.593407 
+345376.817527  7394306.041789 
+345423.383991  7394329.647745 
+345475.722817  7394361.672260 
+345500.717142  7394389.017576 
+345517.118895  7394416.352893 
+345543.663511  7394488.240580 
+345568.666083  7394536.652287 
+345585.076082  7394559.308406 
+345604.397000  7394584.384111 
+345734.192671  7394719.580953 
+345743.189308  7394728.849366 
+345755.286529  7394735.108294 
+345779.596417  7394747.176226 
+345838.952785  7394765.913017 
+345899.875937  7394769.042481 
+345972.533475  7394769.042481 
+346033.456627  7394772.161947 
+346058.467445  7394776.921131 
+346083.338076  7394794.798069 
+346097.628794  7394806.816011 
+346115.176773  7394818.963930 
+346126.630787  7394827.792418 
+346174.071352  7394867.085687 
+346235.522263  7394903.979367 
+346285.783039  7394920.986454 
+346341.610020  7394930.954747 
+346387.327123  7394929.964916 
+346430.289984  7394925.275720 
+346565.899247  7394898.500306 
+346617.850500  7394882.603029 
+346686.409662  7394868.085516 
+346699.438706  7394919.356733 
+346704.221520  7394932.394500 
+346713.242897  7394970.258014 
+346724.771127  7395020.579395 
+346738.641287  7395065.541693 
+346741.857317  7395074.060234 
+346746.598900  7395097.636196 
+346756.453145  7395130.210616 
+346763.338748  7395156.226160 
+346770.941772  7395186.081046 
+346784.152234  7395234.612733 
+346850.303496  7395310.679703 
+346862.268777  7395324.447345 
+346881.787605  7395351.112778 
+346907.367412  7395406.183344 
+346914.599357  7395423.100447 
+346934.175908  7395449.815871 
+346950.767324  7395474.181697 
+346964.530283  7395488.949167 
+346981.987553  7395508.755775 
+346996.146331  7395522.783372 
+347014.890014  7395536.141084 
+347045.697931  7395555.087838 
+347084.884019  7395573.624663 
+347101.129094  7395580.663458 
+347124.927715  7395589.561933 
+347162.093477  7395597.210623 
+347177.184079  7395604.819320 
+347205.922193  7395630.164978 
+347213.269584  7395625.355802 
+347231.411292  7395615.077563 
+347254.038949  7395608.698655 
+347290.066730  7395599.180286 
+347318.062683  7395591.771555 
+347326.259437  7395590.031853 
+347416.737079  7395575.204393 
+347449.680771  7395572.064930 
+347569.737643  7395549.508794 
+347523.360842  7395610.978265 
+347457.910509  7395688.844927 
+347404.367733  7395763.672110 
+347334.076863  7395844.648239 
+347280.517595  7395911.086859 
+347310.641076  7395928.273915 
+347269.236752  7396004.040937 
+347234.421166  7396063.240796 
+347202.697917  7396121.100886 
+347183.987219  7396159.784259 
+347170.743773  7396193.348510 
+347157.467342  7396220.433871 
+347127.871620  7396265.856090 
+Region 1
+295
+340685.973962  7401513.817162 
+340707.298714  7401477.173439 
+340730.429391  7401434.220796 
+340739.145657  7401412.884451 
+340743.351235  7401399.066818 
+340746.352863  7401382.849596 
+340746.055998  7401364.522735 
+340743.351235  7401342.896439 
+340735.838919  7401319.770401 
+340723.222186  7401296.334415 
+340711.809403  7401276.807760 
+340706.704986  7401265.099765 
+340704.602197  7401256.381258 
+340703.695112  7401247.972699 
+340704.602197  7401238.964242 
+340707.298714  7401230.855631 
+340717.218930  7401211.628924 
+340721.119397  7401203.220364 
+340724.228226  7401190.922471 
+340725.630085  7401185.493401 
+340732.235316  7401132.322509 
+340730.734502  7401098.078374 
+340729.530552  7401061.434651 
+340724.121025  7401013.072935 
+340714.514166  7400970.110294 
+340700.396619  7400930.467085 
+340684.176284  7400901.322077 
+340664.047235  7400881.795422 
+340633.107377  7400859.869177 
+340614.784253  7400847.551287 
+340599.462756  7400832.833808 
+340587.142888  7400814.216997 
+340578.434868  7400793.790496 
+340575.433240  7400777.263327 
+340574.526155  7400763.745643 
+340575.433240  7400742.719244 
+340576.934054  7400667.922056 
+340575.433240  7400640.286790 
+340573.025341  7400591.325177 
+340572.423366  7400555.271352 
+340568.217788  7400527.636086 
+340561.612558  7400483.483649 
+340551.997453  7400444.130390 
+340545.689086  7400417.694918 
+340535.777117  7400391.859343 
+340522.261545  7400365.433870 
+340510.543651  7400345.307317 
+340499.130868  7400333.889273 
+340447.278570  7400269.590287 
+340233.973322  7400103.468742 
+340131.101594  7400024.922196 
+340053.933368  7399963.952640 
+339973.656312  7399907.072383 
+339966.242951  7399899.663652 
+339947.952812  7399866.169389 
+339900.165905  7399823.966618 
+339882.659157  7399807.249482 
+339836.579220  7399829.265710 
+339793.970947  7399849.642220 
+339751.370919  7399881.136825 
+339718.946740  7399907.992225 
+339697.960083  7399933.077928 
+339672.099904  7399958.183628 
+339641.341464  7399987.518603 
+339604.060255  7400067.194955 
+339615.283375  7400110.037617 
+339507.571110  7400212.490068 
+339423.443065  7400304.864245 
+339275.654119  7400465.586714 
+339213.947575  7400525.076524 
+339071.700097  7400670.651589 
+339012.582869  7400722.742666 
+338984.619901  7400747.098494 
+338974.147188  7400753.987314 
+338951.197928  7400765.485345 
+338922.121719  7400770.444495 
+338892.501259  7400775.503628 
+338766.523593  7400795.240248 
+338729.819620  7400803.018915 
+338658.250585  7400808.088047 
+338629.058928  7400804.838604 
+338601.277377  7400809.587790 
+338560.689430  7400814.047026 
+338380.806155  7400829.324409 
+338318.002862  7400819.716055 
+338252.973087  7400809.017888 
+338198.061437  7400790.511058 
+338081.913278  7400670.821560 
+338037.936130  7400625.009407 
+338025.146227  7400605.682717 
+337974.019597  7400554.811431 
+337903.077274  7400482.393836 
+337834.716022  7400379.311493 
+337790.376040  7400367.853455 
+337671.786997  7400344.207506 
+337573.500174  7400280.288454 
+337503.671093  7400238.175668 
+337441.948057  7400193.393339 
+337340.832776  7400233.286505 
+337250.000546  7400310.003364 
+337221.551050  7400314.952517 
+337173.648696  7400351.536250 
+337141.711045  7400383.940700 
+337104.446329  7400418.634757 
+337089.240279  7400428.922995 
+337058.828181  7400437.671496 
+337034.881127  7400436.881631 
+336966.132302  7400431.462560 
+336961.431951  7400532.855192 
+336956.723353  7400588.905591 
+336871.581022  7400643.666211 
+336827.513165  7400669.761741 
+336838.637330  7400751.907670 
+336851.047907  7400819.936018 
+336865.173700  7400930.737038 
+336880.569413  7401039.408424 
+336794.140670  7401093.309191 
+336731.683719  7401133.962228 
+336756.884199  7401134.612116 
+336764.652149  7401143.780546 
+336782.051695  7401154.298744 
+336797.364946  7401170.096038 
+336802.733242  7401189.822659 
+336816.957990  7401211.668917 
+336838.225019  7401216.678059 
+336859.970329  7401224.466725 
+336883.678242  7401238.324351 
+336905.052472  7401256.961159 
+336945.104414  7401285.116336 
+336977.668779  7401301.343557 
+337017.382626  7401314.611284 
+337034.518293  7401323.849702 
+337053.171267  7401337.677333 
+337078.297531  7401361.143314 
+337100.941681  7401379.280207 
+337133.943096  7401402.826174 
+337146.477366  7401416.833774 
+337158.178768  7401437.640210 
+337167.043466  7401462.455960 
+337182.200038  7401492.130877 
+337202.856845  7401529.424489 
+337227.991356  7401575.346623 
+337250.586028  7401620.738847 
+337270.055379  7401674.179693 
+337279.695222  7401700.025268 
+337286.605564  7401715.472620 
+337292.031584  7401729.910147 
+337300.871543  7401757.245465 
+337306.008944  7401774.712473 
+337313.323351  7401801.777837 
+337322.385959  7401831.392764 
+337335.612912  7401852.469154 
+337350.019077  7401880.874288 
+337358.883775  7401892.032377 
+337366.552770  7401901.220803 
+337397.954416  7401954.021759 
+337428.135620  7402002.513453 
+337442.385107  7402022.340057 
+337452.313569  7402042.376625 
+337459.759915  7402057.594018 
+337477.390356  7402093.597851 
+337485.092335  7402106.805589 
+337502.599083  7402132.201238 
+337518.407107  7402149.008360 
+337548.134769  7402170.004763 
+337570.045004  7402185.612090 
+337590.635841  7402205.748640 
+337600.110760  7402221.335970 
+337615.811584  7402248.141379 
+337644.096155  7402261.299125 
+337708.309553  7402276.966441 
+337738.276355  7402284.445160 
+337775.301931  7402310.550689 
+337823.154807  7402345.094772 
+337867.255649  7402373.799855 
+337976.122386  7402452.076447 
+338108.218754  7402548.929857 
+338115.813533  7402554.678872 
+338139.537938  7402567.276714 
+338184.389187  7402597.251580 
+338204.749130  7402615.368476 
+338219.633577  7402624.346938 
+338236.332194  7402629.316087 
+338249.254037  7402631.455721 
+338265.919669  7402639.444352 
+338275.716191  7402648.882736 
+338291.301567  7402662.410418 
+338304.421320  7402672.208740 
+338310.688455  7402677.237879 
+338338.189635  7402692.405281 
+338350.996031  7402705.143099 
+338356.141679  7402722.100194 
+338358.706256  7402742.816646 
+338363.365377  7402757.254173 
+338371.644592  7402766.412604 
+338377.936466  7402771.271771 
+338389.852270  7402785.999249 
+338393.967139  7402790.868415 
+338411.333700  7402804.156139 
+338431.165885  7402824.292689 
+338450.684713  7402849.968291 
+338460.159632  7402865.575618 
+338469.642797  7402880.443071 
+338483.570681  7402906.058684 
+338494.266042  7402926.355207 
+338509.043287  7402944.422112 
+338528.141557  7402961.519184 
+338553.358531  7402976.906548 
+338572.531017  7402987.954656 
+338605.639633  7403024.108463 
+338613.424075  7403032.267065 
+338631.153471  7403058.432583 
+338653.632695  7403072.300208 
+338694.649447  7403101.205257 
+338714.357938  7403109.733796 
+338725.407887  7403120.441962 
+338739.014168  7403130.160297 
+338766.086543  7403137.998954 
+338807.697023  7403139.938622 
+338834.051976  7403144.237886 
+338845.934794  7403148.137218 
+338869.312858  7403146.607480 
+338888.732731  7403145.747627 
+338895.725535  7403145.107737 
+338912.869448  7403155.625935 
+338931.547161  7403165.394262 
+338949.177602  7403177.942113 
+338959.543114  7403182.081403 
+338977.025123  7403185.530813 
+338993.550569  7403182.921260 
+339004.493317  7403180.261715 
+339011.576829  7403182.851272 
+339022.618532  7403194.569264 
+339035.210526  7403203.027816 
+339054.638646  7403213.815968 
+339072.994755  7403217.515334 
+339097.197442  7403222.314512 
+339116.040079  7403216.955430 
+339137.645203  7403214.395868 
+339165.336046  7403212.656166 
+339189.967537  7403211.886298 
+339211.770571  7403214.375872 
+339235.346544  7403216.885442 
+339257.166070  7403218.365188 
+339269.543662  7403223.534303 
+339294.537988  7403236.152142 
+339304.466449  7403250.679653 
+339309.768776  7403259.268182 
+339317.775866  7403269.696396 
+339329.394805  7403275.105469 
+339347.891100  7403278.574875 
+339379.103083  7403279.384736 
+339430.592547  7403282.934128 
+339454.193259  7403283.923959 
+339467.288273  7403293.142380 
+339475.295363  7403304.070508 
+339484.044614  7403316.518376 
+339490.534398  7403326.176721 
+339501.501884  7403339.634416 
+339528.730938  7403287.493347 
+339551.086469  7403241.141287 
+339571.809247  7403207.327079 
+339575.066508  7403198.608573 
+339592.837135  7403166.014156 
+339603.722159  7403142.748141 
+339622.523565  7403109.943760 
+339638.653192  7403075.629638 
+339671.596884  7403017.569583 
+339677.336260  7403003.162051 
+339698.034299  7402967.818105 
+339750.249432  7402870.034854 
+339814.504061  7402751.015241 
+339872.318384  7402636.234902 
+339914.093789  7402563.397378 
+339928.269059  7402528.333385 
+339935.212385  7402517.325270 
+340029.079229  7402346.694498 
+340067.284015  7402276.226568 
+340085.458708  7402242.172401 
+340110.123183  7402193.430750 
+340137.756302  7402141.949569 
+340168.943547  7402079.690233 
+340196.947746  7402027.809120 
+340230.707814  7401962.430319 
+340262.076476  7401908.179611 
+340316.600553  7401865.966842 
+340416.808747  7401793.609236 
+340488.089165  7401747.507133 
+340583.539285  7401682.738227 
+340602.769495  7401679.038861 
+340605.474258  7401656.202773 
+340611.180650  7401637.276015 
+340622.890298  7401612.350284 
+340639.110633  7401588.914299 
+340685.973962  7401513.817162 
+Region 1
+372
+320402.027756  7389574.232305 
+320376.390225  7389522.751123 
+320358.149563  7389505.934004 
+320367.327618  7389498.405293 
+320378.451783  7389490.126711 
+320386.162009  7389477.258916 
+320391.555044  7389462.151503 
+320408.979329  7389439.995298 
+320420.087002  7389416.319354 
+320434.377719  7389399.432247 
+320449.723955  7389380.575476 
+320467.024546  7389359.409102 
+320484.226184  7389339.012596 
+320501.856625  7389316.306485 
+320506.713655  7389307.907924 
+320510.300765  7389301.678991 
+320515.792754  7389278.482964 
+320519.214940  7389257.266598 
+320518.349086  7389236.760111 
+320515.891709  7389220.562885 
+320510.886247  7389204.105704 
+320506.697162  7389188.108444 
+320508.181484  7389167.082046 
+320512.246875  7389151.954637 
+320518.959307  7389137.087184 
+320526.949905  7389126.768951 
+320544.778255  7389112.921323 
+320563.076641  7389094.094548 
+320576.476766  7389074.657877 
+320590.536589  7389052.231719 
+320606.138457  7389036.694380 
+320622.424763  7389023.826584 
+320641.968330  7389011.888629 
+320663.606439  7389003.620046 
+320693.276377  7388997.781046 
+320716.357576  7388996.631243 
+320734.095218  7388998.290958 
+320757.201157  7388995.361460 
+320776.456105  7388989.942388 
+320791.249843  7388982.263704 
+320809.515244  7388974.515031 
+320830.708057  7388961.257302 
+320847.802493  7388948.619467 
+320868.129451  7388930.812517 
+320885.743400  7388918.074699 
+320907.703112  7388900.177764 
+320923.502890  7388885.200330 
+320943.508246  7388876.911750 
+320961.839616  7388871.712640 
+320984.698168  7388864.243919 
+321008.307126  7388853.005844 
+321026.168462  7388844.807249 
+321043.444315  7388834.279052 
+321063.598103  7388822.781022 
+321091.569317  7388805.294017 
+321123.614169  7388789.296757 
+321136.898847  7388779.708400 
+321149.927891  7388773.959384 
+321168.407694  7388765.810780 
+321189.212934  7388758.312065 
+321236.166971  7388750.023484 
+321253.211930  7388750.123467 
+321274.775823  7388748.283782 
+321294.327636  7388743.534596 
+321310.820097  7388738.645433 
+321323.016272  7388726.277552 
+321336.366920  7388710.940179 
+321345.528482  7388696.312685 
+321357.559733  7388681.175277 
+321365.253466  7388669.417291 
+321373.532681  7388643.601713 
+321381.729435  7388623.985074 
+321389.579846  7388599.939192 
+321397.496228  7388578.212914 
+321405.635257  7388547.418189 
+321408.274051  7388531.720878 
+321416.190433  7388510.554503 
+321431.520175  7388491.907697 
+321456.407299  7388485.008879 
+321471.440178  7388482.759264 
+321483.941464  7388478.589978 
+321500.780267  7388479.019905 
+321513.735095  7388479.619802 
+321528.438124  7388479.469828 
+321538.935576  7388480.819597 
+321558.223509  7388481.049557 
+321558.264740  7388477.290201 
+321556.829896  7388469.511534 
+321552.335701  7388461.592890 
+321545.095510  7388452.314479 
+321537.187375  7388448.235178 
+321523.177029  7388442.416175 
+321508.053442  7388435.467365 
+321499.634040  7388430.718178 
+321495.197568  7388426.228947 
+321489.878750  7388419.190153 
+321479.958534  7388403.782792 
+321469.757947  7388386.825697 
+321462.855852  7388358.940473 
+321461.684887  7388345.632753 
+321459.780008  7388334.864597 
+321456.382561  7388320.427070 
+321454.469435  7388310.208821 
+321452.490340  7388305.089697 
+321447.253983  7388299.270694 
+321440.566290  7388295.201391 
+321428.485562  7388289.402385 
+321416.009015  7388283.603378 
+321405.552795  7388278.594236 
+321393.562776  7388274.135000 
+321377.903184  7388269.735753 
+321361.212813  7388265.426491 
+321351.135919  7388263.306854 
+321342.065065  7388262.427005 
+321327.559946  7388263.026902 
+321310.127414  7388261.587149 
+321300.891636  7388257.047927 
+321293.338088  7388248.649365 
+321282.527280  7388231.462309 
+321274.314034  7388218.624508 
+321269.349803  7388207.596397 
+321266.488361  7388199.477788 
+321262.958975  7388187.909769 
+321259.833653  7388176.461730 
+321259.042015  7388165.493609 
+321260.740739  7388143.917305 
+321262.084874  7388134.178973 
+321265.902879  7388122.041052 
+321269.531220  7388109.573188 
+321272.557587  7388103.744186 
+321281.735642  7388096.095496 
+321292.422757  7388081.827940 
+321297.551912  7388071.589694 
+321298.599184  7388060.861532 
+321296.100576  7388048.093719 
+321293.783385  7388037.875469 
+321292.208355  7388024.347786 
+321289.544822  7388000.391889 
+321284.877456  7387981.505125 
+321279.006140  7387960.938647 
+321272.054567  7387945.231338 
+321255.702292  7387913.246817 
+321246.103679  7387897.069588 
+321240.487996  7387889.140946 
+321236.389620  7387882.222131 
+321230.914122  7387870.414153 
+321227.549660  7387861.845621 
+321252.956297  7387801.076030 
+321345.033708  7387624.826220 
+321356.891788  7387580.823758 
+321356.908280  7387580.823758 
+321356.900034  7387580.793763 
+321356.908280  7387580.773766 
+321356.900034  7387580.773766 
+321346.419075  7387518.064508 
+321378.373219  7387312.749676 
+321405.429102  7387203.348416 
+321404.431308  7387191.660418 
+321409.791358  7387175.963107 
+321457.932852  7387072.140890 
+321543.207123  7387086.988347 
+321598.580562  7387098.356400 
+321678.387582  7387137.839637 
+321801.907871  7387225.344648 
+321809.527388  7387230.933691 
+321813.848413  7387232.973341 
+321820.973156  7387238.822339 
+321828.337040  7387244.411382 
+321834.942271  7387249.240555 
+321840.533215  7387255.339510 
+321844.845994  7387261.178510 
+321846.371547  7387266.757554 
+321847.888853  7387276.135948 
+321849.397913  7387286.794122 
+321850.659587  7387298.962038 
+321852.176893  7387310.110128 
+321854.972365  7387317.978781 
+321857.512204  7387321.528173 
+321865.131721  7387325.857431 
+321872.000832  7387328.666950 
+321880.642881  7387329.946731 
+321931.761265  7387326.027402 
+321962.033178  7387323.567823 
+322195.508706  7387309.190286 
+322250.956361  7387306.540740 
+322251.236733  7387283.734646 
+322246.429180  7387262.428296 
+322277.690641  7387284.304549 
+322301.827358  7387303.371283 
+322315.812965  7387312.019801 
+322323.943748  7387317.358887 
+322338.432376  7387323.737794 
+322363.096852  7387324.557654 
+322403.033347  7387325.667464 
+322415.229522  7387327.217198 
+322434.583425  7387305.980836 
+322503.043632  7387263.818058 
+322653.669281  7387188.161017 
+322776.323715  7387130.930820 
+322818.808296  7387109.494492 
+322837.131420  7387105.215225 
+322855.190665  7387102.725652 
+322871.971745  7387103.535513 
+322894.863281  7387105.615157 
+322907.570722  7387108.194715 
+322921.036817  7387113.543798 
+322931.979565  7387118.133012 
+322943.161454  7387124.241966 
+322954.598976  7387130.860832 
+322960.948573  7387136.449875 
+323054.683477  7387247.190906 
+323115.639614  7387322.617986 
+323132.907221  7387346.743853 
+323159.352883  7387357.951934 
+323178.673801  7387362.561144 
+323198.250353  7387366.920397 
+323221.339799  7387369.259997 
+323237.667335  7387370.309817 
+323251.397309  7387370.599767 
+323272.507660  7387370.139846 
+323314.992240  7387360.871434 
+323374.257900  7387350.123275 
+323380.343618  7387373.199322 
+323382.520623  7387378.798363 
+323382.883457  7387380.048149 
+323387.946643  7387392.725977 
+323393.793220  7387405.933715 
+323401.660124  7387422.420891 
+323421.970590  7387457.964802 
+323429.590107  7387467.353194 
+323437.209624  7387476.241672 
+323455.747151  7387495.798322 
+323495.898048  7387530.882312 
+323620.416131  7387628.505590 
+323660.064008  7387657.000709 
+323676.828595  7387671.488228 
+323701.732211  7387697.403789 
+323727.130602  7387729.138353 
+323789.076286  7387832.960569 
+323851.747639  7387938.522487 
+323889.441159  7388000.001956 
+323911.887399  7388042.034756 
+323924.570102  7388067.140456 
+323946.406121  7388106.273753 
+323967.640165  7388153.025745 
+323975.070018  7388183.310557 
+323979.580707  7388206.286622 
+323984.577922  7388256.897952 
+323989.204058  7388297.161056 
+323999.957142  7388360.750163 
+324000.781766  7388368.738795 
+324002.620675  7388431.478048 
+324007.741584  7388477.370187 
+324009.481539  7388510.394531 
+324009.110458  7388541.409218 
+324004.137981  7388572.803840 
+324002.299072  7388589.840922 
+323999.998374  7388600.319127 
+323992.906615  7388612.277079 
+323989.979203  7388620.055747 
+323987.126008  7388654.889780 
+323986.763173  7388677.915836 
+323988.808239  7388705.261152 
+324010.891644  7388749.303608 
+324026.081201  7388763.101244 
+324034.360417  7388773.669434 
+324099.217021  7388830.589684 
+324228.369485  7388940.110924 
+324317.453515  7389019.857264 
+324419.129539  7389110.401755 
+324497.691378  7389175.600587 
+324544.043441  7389206.235339 
+324506.333428  7389206.895226 
+324496.660599  7389224.092281 
+324498.103690  7389238.299847 
+324502.630870  7389253.997158 
+324522.792904  7389258.336415 
+324489.370931  7389478.298737 
+324470.833405  7389604.827064 
+324468.268827  7389624.423708 
+324458.191933  7389653.008811 
+324440.907834  7389675.584944 
+324430.377397  7389688.912661 
+324419.343941  7389702.010418 
+324405.778891  7389717.417778 
+324388.478299  7389754.021509 
+324383.489330  7389767.489202 
+324366.510341  7389831.678207 
+324359.723693  7389871.741344 
+324326.977911  7389999.999375 
+324327.299514  7390003.518772 
+324321.518907  7390025.105074 
+324313.487078  7390058.119419 
+324307.203450  7390079.445766 
+324291.791245  7390110.190500 
+324257.124091  7390165.591010 
+324170.340760  7390305.107113 
+324062.075998  7390490.355381 
+324000.600348  7390773.936806 
+323991.463525  7390811.100441 
+323962.675934  7390954.815823 
+323902.519681  7390902.244828 
+323730.767189  7390749.990908 
+323671.996303  7390695.700208 
+323611.370016  7390644.968897 
+323541.103884  7390603.466006 
+323508.366349  7390590.078300 
+323452.580598  7390565.532504 
+323398.287416  7390543.216327 
+323356.017237  7390510.101999 
+323314.390265  7390462.990069 
+323285.462488  7390416.727993 
+323273.348775  7390363.457118 
+323259.107535  7390325.693586 
+323243.332496  7390290.459622 
+323220.878010  7390263.594223 
+323201.458136  7390240.298214 
+323185.757313  7390232.039628 
+323123.960061  7390196.745674 
+323090.249470  7390181.758241 
+323059.070472  7390168.820457 
+322995.706436  7390139.865417 
+322925.267133  7390105.031384 
+322856.872896  7390260.554744 
+322798.572046  7390389.432668 
+322755.221611  7390487.355895 
+322739.999069  7390519.570377 
+322711.079539  7390588.078642 
+322690.678364  7390635.530514 
+322670.310174  7390679.932908 
+322641.646277  7390670.614504 
+322530.198469  7390646.888569 
+322444.652073  7390633.340889 
+322363.896736  7390635.120584 
+322317.660121  7390639.379855 
+322264.521410  7390640.439673 
+322148.266051  7390644.878913 
+322026.708365  7390650.198002 
+321933.525958  7390643.989065 
+321842.132984  7390623.582561 
+321789.340616  7390583.729387 
+321619.608450  7390494.244715 
+321555.386806  7390480.057145 
+321373.722345  7390466.579454 
+321220.573349  7390471.788562 
+321087.479187  7390466.119533 
+320954.822074  7390460.620475 
+320891.309606  7390458.760793 
+320876.697285  7390395.441639 
+320866.422482  7390373.225445 
+320858.143266  7390356.628287 
+320820.251836  7390282.311017 
+320813.028138  7390259.114991 
+320848.330252  7390142.754922 
+320917.648066  7390122.468397 
+320970.052862  7390110.630425 
+321044.640018  7390024.795128 
+321074.120293  7390026.544828 
+321070.929002  7390008.537912 
+321069.106585  7389989.461180 
+321068.207745  7389969.464605 
+321061.841655  7389951.297717 
+321040.071607  7389930.811226 
+321023.843025  7389921.752778 
+321002.823383  7389913.524187 
+320895.968726  7389869.121793 
+320769.413824  7389817.840577 
+320625.327436  7389754.821372 
+320564.288837  7389725.306427 
+320531.073020  7389702.870270 
+320419.567489  7389627.903112 
+320402.027756  7389574.232305 
+Region 1
+1343
+336095.858105  7355254.410980 
+336145.822016  7355302.272781 
+336158.793337  7355316.480348 
+336178.658506  7355333.317464 
+336189.749687  7355343.195771 
+336198.927741  7355359.912908 
+336211.412535  7355381.429222 
+336223.031474  7355389.647815 
+336244.735553  7355396.656614 
+336262.234054  7355398.406314 
+336271.577033  7355400.505955 
+336283.888656  7355409.944338 
+336285.587379  7355422.262228 
+336281.175646  7355434.060207 
+336267.165300  7355439.109342 
+336249.592583  7355444.218467 
+336234.543212  7355451.357244 
+336212.220665  7355453.546869 
+336190.780466  7355458.396039 
+336168.730045  7355463.345191 
+336152.353031  7355470.693932 
+336140.585660  7355475.543102 
+336128.669856  7355484.711531 
+336110.239531  7355494.139916 
+336092.930693  7355502.688452 
+336076.825804  7355512.586756 
+336059.022192  7355520.355426 
+336026.358873  7355536.372682 
+336002.362341  7355551.170147 
+335980.922142  7355564.657837 
+335960.224103  7355576.045886 
+335944.449064  7355584.394456 
+335920.155668  7355598.632018 
+335904.743463  7355619.608424 
+335876.582585  7355642.654477 
+335858.655280  7355660.951343 
+335844.009974  7355676.618659 
+335828.919372  7355687.526791 
+335802.902515  7355700.854508 
+335781.569516  7355705.373734 
+335757.383321  7355710.072929 
+335730.154268  7355713.532336 
+335723.013032  7355723.750586 
+335720.374238  7355731.699224 
+335719.813495  7355763.363800 
+335718.757977  7355783.950274 
+335721.710128  7355793.288675 
+335725.618841  7355807.736200 
+335725.453916  7355822.023753 
+335722.930570  7355829.302506 
+335713.711284  7355833.961708 
+335703.791068  7355837.831045 
+335692.493732  7355845.789682 
+335683.843437  7355854.218238 
+335674.327286  7355867.405979 
+335650.883253  7355896.261036 
+335637.037831  7355913.718046 
+335623.901586  7355931.395018 
+335613.305180  7355950.101814 
+335603.318994  7355977.347147 
+335594.371834  7356011.691264 
+335591.922703  7356029.828158 
+335591.452668  7356044.325674 
+335591.213528  7356065.482050 
+335591.592854  7356076.780115 
+335590.322935  7356107.444863 
+335589.622005  7356124.501941 
+335589.861146  7356147.647976 
+335589.110739  7356169.014316 
+335587.115151  7356192.580280 
+335581.788086  7356212.676837 
+335573.657303  7356238.392432 
+335562.780524  7356263.188185 
+335563.448469  7356293.882927 
+335569.361016  7356310.999995 
+335574.820021  7356323.357879 
+335582.530247  7356335.515796 
+335590.842447  7356347.243787 
+335599.022708  7356362.401191 
+335598.387748  7356373.689257 
+335599.253603  7356386.767017 
+335599.946286  7356397.525174 
+335598.420733  7356414.892200 
+335593.283332  7356428.119934 
+335587.692387  7356444.897060 
+335579.710036  7356457.434912 
+335571.150448  7356475.941742 
+335559.869605  7356491.649052 
+335548.786671  7356508.026247 
+335535.279345  7356531.022308 
+335528.179341  7356555.528110 
+335523.965517  7356576.854457 
+335517.104653  7356597.930847 
+335511.530201  7356622.456646 
+335503.547850  7356652.271539 
+335493.586403  7356686.375697 
+335483.657941  7356717.390384 
+335475.048877  7356740.106493 
+335474.883952  7356754.723989 
+335479.683258  7356780.469579 
+335481.967464  7356803.095704 
+335479.163746  7356825.881801 
+335471.362811  7356840.189350 
+335468.971405  7356853.447079 
+335459.694395  7356871.953909 
+335454.070466  7356891.930487 
+335443.894617  7356917.956029 
+335437.429572  7356930.733841 
+335425.596231  7356950.420468 
+335415.148257  7356973.666487 
+335403.974615  7357007.210741 
+335397.534308  7357035.825839 
+335394.392495  7357043.104592 
+335386.608053  7357065.270796 
+335380.481103  7357084.367525 
+335374.766466  7357103.124312 
+335369.224999  7357124.880585 
+335363.881441  7357146.976800 
+335358.851240  7357167.733245 
+335350.481316  7357187.579845 
+335346.069583  7357225.963270 
+335342.672136  7357256.268080 
+335341.806282  7357269.105881 
+335343.092694  7357290.502216 
+335344.981081  7357303.589974 
+335350.275161  7357330.565353 
+335352.600598  7357349.422123 
+335355.437301  7357395.414245 
+335348.675392  7357407.962096 
+335341.245538  7357416.190686 
+335335.803026  7357429.418420 
+335330.541931  7357444.195889 
+335328.084554  7357462.772707 
+335328.092800  7357479.829785 
+335331.440770  7357498.916516 
+335333.221956  7357521.642623 
+335327.424855  7357547.718157 
+335323.277001  7357554.207045 
+335317.529379  7357566.654913 
+335313.571188  7357583.442038 
+335316.960389  7357598.329487 
+335318.906499  7357606.428100 
+335324.381996  7357617.456211 
+335334.063071  7357634.733252 
+335344.552277  7357652.910138 
+335354.695140  7357673.956533 
+335362.867155  7357698.422342 
+335372.820355  7357736.965740 
+335378.840104  7357771.699791 
+335383.746611  7357805.204052 
+335384.826867  7357826.590388 
+335387.086334  7357852.206001 
+335392.198997  7357876.631817 
+335396.709685  7357901.047635 
+335401.822348  7357925.803394 
+335404.057077  7357953.188703 
+335410.019102  7357984.493341 
+335414.909116  7358001.600411 
+335419.230141  7358024.796438 
+335421.291699  7358049.412221 
+335422.767774  7358071.798387 
+335422.891468  7358087.865634 
+335422.157553  7358107.462278 
+335421.522593  7358118.080459 
+335419.980548  7358146.195643 
+335415.403890  7358172.731098 
+335414.241172  7358184.789032 
+335413.070207  7358198.616664 
+335410.373690  7358211.874393 
+335405.244534  7358223.672372 
+335400.535936  7358234.910447 
+335394.252309  7358249.907878 
+335388.719088  7358252.607416 
+335380.514088  7358258.056482 
+335375.285978  7358261.095962 
+335370.519657  7358267.684833 
+335371.674129  7358273.573824 
+335376.712576  7358278.832923 
+335388.356254  7358284.281990 
+335401.236866  7358289.411111 
+335405.986695  7358292.570570 
+335407.677172  7358305.108423 
+335405.813524  7358307.627991 
+335404.189017  7358315.916571 
+335404.741514  7358321.125679 
+335412.517710  7358326.754715 
+335417.077875  7358329.354270 
+335424.614930  7358329.224292 
+335433.248733  7358331.093972 
+335445.618079  7358335.993132 
+335453.872556  7358344.841617 
+335456.841199  7358352.400322 
+335459.075928  7358361.288799 
+335455.769189  7358366.017989 
+335452.792300  7358377.056099 
+335456.577320  7358383.854934 
+335459.809842  7358386.444491 
+335464.304038  7358394.023192 
+335463.232028  7358399.212304 
+335460.626219  7358404.501398 
+335463.034118  7358416.379363 
+335472.649223  7358421.478490 
+335477.687670  7358426.297664 
+335482.181866  7358434.436270 
+335480.516127  7358445.934300 
+335478.034012  7358458.532143 
+335480.507881  7358465.091019 
+335488.358293  7358472.939675 
+335499.672121  7358481.148269 
+335506.392799  7358490.526662 
+335511.414754  7358496.565628 
+335519.042517  7358497.655441 
+335534.190843  7358499.375147 
+335535.427777  7358507.143816 
+335533.415697  7358522.961106 
+335528.327773  7358531.209694 
+335520.551577  7358543.407604 
+335515.331713  7358554.425717 
+335512.618703  7358569.013218 
+335510.260281  7358579.731382 
+335510.928226  7358592.589180 
+335519.190949  7358600.547817 
+335517.343794  7358610.826056 
+335508.833683  7358615.495256 
+335501.972820  7358618.624720 
+335487.104866  7358627.643175 
+335483.460032  7358643.220507 
+335482.453992  7358651.189142 
+335473.432615  7358664.926789 
+335461.228194  7358672.435503 
+335451.984169  7358679.084364 
+335443.853386  7358695.821497 
+335453.353044  7358710.998897 
+335452.182079  7358733.135106 
+335450.475109  7358748.842415 
+335447.852808  7358773.288228 
+335448.520753  7358786.365988 
+335447.036431  7358827.438952 
+335449.065004  7358863.902706 
+335451.687305  7358883.979267 
+335453.864310  7358907.375260 
+335451.703798  7358926.731944 
+335452.511928  7358954.317219 
+335454.449792  7358972.174160 
+335453.427260  7358999.069553 
+335448.982541  7359022.395558 
+335443.474059  7359049.910845 
+335438.476844  7359077.316150 
+335424.854071  7359110.830410 
+335416.583101  7359130.347067 
+335405.458936  7359159.342100 
+335396.627223  7359192.466426 
+335383.655902  7359230.979829 
+335364.128828  7359255.565618 
+335363.601069  7359283.360857 
+335379.334877  7359314.885457 
+335384.233138  7359350.269396 
+335388.479947  7359397.281343 
+335392.462877  7359441.073842 
+335397.163228  7359493.514859 
+335397.897143  7359544.576113 
+335405.219795  7359617.433633 
+335414.092740  7359696.610071 
+335415.008071  7359794.533298 
+335422.619342  7359868.710592 
+335435.747341  7359914.492750 
+335456.478365  7359962.914455 
+335476.153871  7359988.720035 
+335488.572695  7360024.973825 
+335481.497429  7360064.757011 
+335450.747235  7360108.709482 
+335408.345117  7360146.333038 
+335365.555426  7360173.858323 
+335326.567248  7360207.642536 
+335296.633430  7360242.296600 
+335228.313409  7360284.159429 
+335182.332427  7360296.587300 
+335109.303809  7360340.499779 
+334898.909480  7360469.787633 
+334843.280408  7360506.031424 
+334798.107556  7360518.909219 
+334770.053880  7360531.327092 
+334739.905661  7360566.651041 
+334702.657437  7360608.083944 
+334643.952521  7360664.564269 
+334584.686861  7360715.605526 
+334503.898539  7360769.946218 
+334296.703748  7360867.809455 
+334172.696932  7360915.001372 
+334088.387470  7360946.925903 
+333997.250129  7360979.440334 
+333920.123133  7361025.072517 
+333837.570118  7361116.826801 
+333794.599010  7361212.350438 
+333775.814097  7361286.897669 
+333748.939631  7361391.369774 
+333732.595602  7361457.188500 
+333712.623232  7361555.091730 
+333714.157030  7361642.826702 
+333717.199890  7361714.414439 
+333708.706272  7361779.553282 
+333685.435409  7361836.433539 
+333663.838531  7361907.401382 
+333654.825401  7361990.807096 
+333656.680803  7362086.410720 
+333659.583476  7362170.616296 
+333661.471863  7362253.822044 
+333659.971049  7362322.250323 
+333657.497180  7362351.795262 
+333639.594613  7362534.783918 
+333632.585317  7362630.397540 
+333620.084031  7362750.976886 
+333610.205047  7362856.968730 
+333598.899465  7362954.302058 
+333586.802244  7363048.635899 
+333584.666471  7363128.472224 
+333576.007928  7363216.757102 
+333575.339984  7363336.146651 
+333566.450547  7363479.692063 
+333575.950205  7363610.609638 
+333607.475545  7363695.365120 
+333710.273056  7363899.570142 
+333601.917585  7363797.637602 
+333411.734768  7363634.625525 
+333271.870450  7363482.161640 
+333102.674289  7363259.029861 
+333023.180626  7363137.490679 
+332933.840963  7362995.794951 
+332834.185266  7362873.915827 
+332754.468954  7362772.533193 
+332624.574329  7362640.335837 
+332484.949152  7362477.903661 
+332314.854152  7362325.069840 
+331887.839590  7361882.835590 
+331818.612484  7361843.812275 
+331736.818122  7361798.670007 
+331646.249771  7361746.658916 
+331565.609882  7361690.678505 
+331482.858957  7361632.228517 
+331383.937174  7361553.541995 
+331291.818532  7361477.255063 
+331213.438109  7361437.461879 
+331156.605088  7361418.855066 
+331100.835830  7361414.105880 
+331034.816507  7361414.885746 
+330979.319375  7361421.434624 
+330797.795100  7361446.660303 
+330725.525134  7361458.768229 
+330643.203014  7361468.326592 
+330588.695429  7361476.995107 
+330528.704101  7361484.703787 
+330482.954014  7361494.132172 
+330437.269896  7361506.999968 
+330381.063588  7361521.627462 
+330343.807118  7361545.663345 
+330296.482000  7361575.788185 
+330265.896731  7361604.003352 
+330230.487416  7361634.938053 
+330204.544775  7361657.664160 
+330154.737542  7361691.528360 
+330113.737283  7361721.503225 
+330067.962456  7361750.318289 
+330003.724320  7361764.175916 
+329949.216735  7361773.064393 
+329863.645600  7361781.352973 
+329782.296534  7361785.712227 
+329695.917268  7361784.692401 
+329624.636851  7361781.862886 
+329538.059675  7361771.974580 
+329492.812608  7361764.575847 
+329443.335224  7361753.247788 
+329393.593960  7361738.150374 
+329332.769763  7361729.901787 
+329279.466128  7361722.842996 
+329220.398378  7361721.593210 
+329163.219015  7361723.792833 
+329088.260778  7361730.101752 
+328997.642950  7361734.790949 
+328915.461015  7361706.015878 
+328879.086892  7361689.188760 
+328840.923336  7361660.273713 
+328809.076393  7361631.428654 
+328773.856742  7361602.773562 
+328752.531990  7361580.257419 
+328728.007700  7361552.052251 
+328697.084335  7361513.468860 
+328625.696716  7361442.840957 
+328592.629331  7361413.216032 
+328572.953825  7361397.808671 
+328546.986445  7361379.331836 
+328515.642522  7361359.575220 
+328484.273861  7361350.226821 
+328459.394983  7361343.957895 
+328441.591371  7361341.638293 
+328378.812817  7361335.239389 
+328335.297458  7361319.552076 
+328301.578621  7361302.095066 
+328273.186849  7361282.148483 
+328249.825277  7361259.272401 
+328239.789614  7361246.754545 
+328219.347209  7361226.677984 
+328200.026290  7361215.489901 
+328171.766458  7361201.642273 
+328163.008961  7361184.475213 
+328162.901760  7361184.365232 
+328163.008961  7361184.475213 
+328154.457620  7361175.066825 
+328151.200359  7361157.639810 
+328149.328464  7361152.640666 
+328140.521490  7361139.352942 
+328132.918465  7361135.823547 
+328084.579061  7361140.682714 
+328075.623655  7361139.462923 
+328055.585314  7361137.013343 
+328045.434204  7361134.013857 
+328026.410150  7361123.595641 
+328013.166704  7361123.655631 
+327997.696775  7361122.145890 
+327985.022319  7361117.116751 
+327982.515465  7361113.877306 
+327977.963545  7361102.409270 
+327972.306631  7361090.051387 
+327967.062028  7361085.782118 
+327957.347969  7361088.321683 
+327952.746572  7361098.679909 
+327941.119387  7361108.068301 
+327931.891855  7361113.047448 
+327922.012870  7361121.466006 
+327911.845268  7361128.764756 
+327902.172439  7361136.283468 
+327888.689852  7361156.510003 
+327865.542683  7361158.339690 
+327853.635126  7361157.419848 
+327838.132212  7361159.229538 
+327825.680404  7361161.289185 
+327803.580506  7361168.897881 
+327787.351924  7361171.687404 
+327769.292679  7361182.105619 
+327759.133323  7361188.414538 
+327745.716705  7361203.311987 
+327731.153862  7361228.167729 
+327721.472787  7361245.334788 
+327707.215054  7361262.001934 
+327691.275091  7361274.659765 
+327682.072297  7361286.177792 
+327656.410027  7361311.233501 
+327642.910948  7361323.811346 
+327628.372843  7361338.698796 
+327616.250884  7361355.395936 
+327609.307558  7361365.164263 
+327595.857956  7361382.281331 
+327587.718926  7361398.688520 
+327578.070836  7361413.086054 
+327561.784531  7361420.864722 
+327552.647707  7361426.513754 
+327534.827603  7361434.052463 
+327520.586362  7361441.191240 
+327458.896311  7361402.907798 
+327448.266920  7361405.777306 
+327397.107305  7361397.838666 
+327268.103272  7361731.551504 
+327265.208845  7361739.080214 
+327124.453935  7362465.335813 
+326951.258352  7363243.712484 
+326775.687856  7363903.469474 
+326611.827006  7364519.253996 
+326607.192625  7364555.987704 
+326627.874171  7364820.742354 
+326635.304025  7364897.279243 
+326703.426136  7365162.193866 
+326789.137458  7365381.496301 
+326879.565623  7365668.287177 
+326773.007831  7366250.047527 
+326661.279652  7366570.552627 
+326246.098431  7367155.122495 
+326169.334270  7368025.373429 
+325671.896899  7369380.911238 
+325613.488847  7369526.546292 
+325608.021596  7369615.920983 
+325585.748527  7369832.083956 
+325581.237839  7370033.769409 
+325573.651307  7370287.315979 
+325573.469890  7370334.217945 
+325574.055372  7370336.627532 
+325529.971023  7370347.375691 
+325513.626994  7370358.253828 
+325504.820019  7370378.640336 
+325502.766708  7370396.777229 
+325501.645221  7370430.881388 
+325495.188422  7370441.659541 
+325484.938357  7370454.717305 
+325472.577258  7370468.045022 
+325449.166209  7370488.291554 
+325436.961787  7370494.230536 
+325421.813462  7370508.118158 
+325415.637035  7370521.005950 
+325405.073614  7370534.943563 
+325389.075926  7370542.832211 
+325350.524798  7370569.837586 
+325338.246160  7370581.875524 
+325313.862056  7370592.103772 
+325297.377841  7370597.772801 
+325242.614624  7370608.630941 
+325218.296489  7370613.100175 
+325198.241656  7370619.169136 
+325153.629549  7370625.927978 
+325096.301753  7370635.996253 
+325062.632393  7370638.245868 
+325054.344932  7370639.515650 
+325004.958256  7370644.524792 
+324981.901795  7370646.024535 
+324897.039836  7370649.983857 
+324853.606939  7370650.673739 
+324806.751856  7370656.092811 
+324748.269589  7370662.021795 
+324720.158188  7370659.912157 
+324703.278154  7370655.942837 
+324664.496132  7370634.656483 
+324644.408314  7370626.547872 
+324622.374385  7370627.827652 
+324606.863226  7370637.945919 
+324592.151950  7370640.315513 
+324574.628710  7370639.325683 
+324545.832873  7370635.096407 
+324509.532965  7370627.017791 
+324482.056525  7370623.138456 
+324462.999486  7370622.908495 
+324434.244879  7370623.558384 
+324410.908047  7370623.158452 
+324368.209064  7370621.648711 
+324332.791504  7370617.119487 
+324312.629470  7370615.329793 
+324284.394376  7370606.341333 
+324264.133387  7370604.101716 
+324241.711886  7370595.193242 
+324215.381672  7370581.135650 
+324182.833800  7370575.426628 
+324161.302891  7370576.606426 
+324149.799400  7370583.775198 
+324115.882653  7370606.401323 
+324098.153257  7370631.437034 
+324095.407262  7370647.464289 
+324093.659061  7370673.809776 
+324105.005875  7370696.205940 
+324113.953035  7370706.614157 
+324124.763843  7370715.162693 
+324148.818098  7370740.488355 
+324165.549700  7370755.865721 
+324181.308247  7370768.243600 
+324186.016845  7370782.921086 
+324191.682005  7370795.398949 
+324203.201989  7370803.837504 
+324218.358561  7370806.577034 
+324234.504681  7370811.646166 
+324251.359976  7370817.165221 
+324258.031177  7370829.873044 
+324263.440704  7370846.110263 
+324262.846975  7370878.224762 
+324257.940468  7370888.243046 
+324249.826177  7370909.849345 
+324237.959851  7370929.865916 
+324194.848558  7370979.627392 
+324167.207192  7371072.891417 
+324161.640987  7371120.113328 
+324188.556684  7371170.284734 
+324217.872034  7371232.884012 
+324234.496435  7371307.851171 
+324233.952183  7371352.593507 
+324228.237545  7371412.333274 
+324210.005129  7371469.373503 
+324164.197318  7371531.072935 
+324072.911545  7371627.096487 
+324012.136825  7371678.637658 
+323971.441677  7371730.428787 
+323955.881040  7371777.640700 
+323974.888601  7371857.507019 
+323997.120439  7371882.702704 
+324011.839961  7371912.787550 
+324033.494562  7371985.265136 
+324022.073533  7372094.666396 
+323985.946797  7372181.401539 
+323940.015292  7372253.059265 
+323922.500298  7372360.170918 
+323933.838865  7372669.108000 
+323911.755459  7372833.209890 
+323880.823848  7372912.476313 
+323798.996502  7373050.932596 
+323746.905063  7373209.685404 
+323699.307819  7373418.219684 
+323479.669466  7373360.829514 
+323274.527986  7373343.382502 
+323129.781900  7373306.728781 
+323066.417863  7373296.880468 
+322895.605442  7373204.296327 
+322487.012959  7373033.715546 
+322287.462424  7372967.796837 
+322202.212892  7372976.615326 
+322101.674848  7373010.269562 
+322020.573169  7373089.026071 
+321843.188502  7373261.076601 
+321696.018023  7373413.670463 
+321630.056424  7373487.617796 
+321527.168205  7373538.189134 
+321080.857463  7373572.453265 
+320820.070419  7373594.159547 
+320515.083579  7373545.527877 
+320316.052556  7373438.506209 
+320192.961071  7373267.615481 
+320115.883553  7373012.569168 
+320090.666580  7372628.684924 
+320092.150901  7372509.195391 
+320124.162769  7372345.213480 
+320136.631069  7372243.690870 
+320110.432795  7372128.840542 
+320067.008144  7371996.263252 
+320018.198705  7371895.970431 
+319961.283221  7371840.549924 
+319851.616599  7371796.877405 
+319720.996306  7371724.579789 
+319698.277941  7371633.035469 
+319684.259348  7371555.658723 
+319697.939845  7371463.674479 
+319742.271581  7371317.239562 
+319756.141741  7371210.297881 
+319734.643818  7371127.852003 
+319682.725550  7371072.481487 
+319628.415875  7371004.573119 
+319545.161930  7370854.008910 
+319501.135305  7370771.273082 
+319436.996123  7370690.836860 
+319372.609554  7370630.217243 
+319305.369789  7370602.022073 
+319222.866251  7370588.474393 
+319107.781856  7370579.615911 
+319000.572612  7370535.963388 
+318926.100903  7370482.752502 
+318859.735239  7370384.779284 
+318763.839822  7370244.023395 
+318655.459613  7370090.809639 
+318572.032498  7369955.292852 
+318522.926194  7369879.915763 
+318418.553653  7369813.807087 
+318293.573781  7369789.861188 
+318188.607511  7369771.154393 
+317951.561365  7369700.836438 
+317804.440364  7369654.234420 
+317734.850424  7369610.931837 
+317633.685666  7369485.163380 
+317606.794708  7369434.971978 
+317565.225459  7369352.266145 
+317519.285708  7369219.768840 
+317485.517394  7369117.216406 
+317484.560831  7368998.796691 
+317479.167796  7368925.289282 
+317481.699389  7368821.976978 
+317471.597756  7368733.462140 
+317445.325266  7368634.769045 
+317433.772296  7368556.202503 
+317439.569397  7368492.803363 
+317457.966737  7368424.475067 
+317487.578951  7368355.176937 
+317514.502894  7368305.665418 
+317542.531832  7368273.680896 
+317656.164891  7368194.144520 
+317686.725421  7368154.761266 
+317702.170611  7368126.266147 
+317705.040300  7368092.741890 
+317705.592797  7368049.109364 
+317687.484075  7367997.818149 
+317675.337377  7367966.543506 
+317640.892872  7367917.591891 
+317527.952497  7367837.745568 
+317462.296008  7367782.085102 
+317433.846512  7367750.600495 
+317429.121422  7367729.384130 
+317433.063121  7367715.696474 
+317437.013065  7367702.128798 
+317440.888793  7367693.420290 
+317452.285084  7367678.612826 
+317457.537933  7367666.274940 
+317458.840838  7367660.086000 
+317452.680903  7367647.278194 
+317449.646290  7367637.599851 
+317439.569397  7367628.501410 
+317426.837216  7367620.032860 
+317417.378790  7367610.054570 
+317412.719670  7367599.806325 
+317411.210609  7367589.708055 
+317410.501434  7367581.609442 
+317405.825821  7367572.251045 
+317398.033133  7367560.073131 
+317381.763320  7367540.706448 
+317368.660059  7367529.138430 
+317357.140075  7367521.679707 
+317335.864800  7367511.331480 
+317303.349912  7367495.084263 
+317287.071853  7367484.796025 
+317268.385895  7367471.048380 
+317259.958247  7367460.970106 
+317250.549298  7367455.421057 
+317243.638956  7367453.561375 
+317233.347661  7367453.541379 
+317219.263099  7367454.471220 
+317203.347873  7367455.711007 
+317191.761919  7367453.241430 
+317186.212206  7367448.852182 
+317181.825211  7367441.373463 
+317178.988508  7367431.925082 
+317177.413478  7367419.167267 
+317177.405232  7367387.932617 
+317178.708136  7367373.545082 
+317174.914870  7367358.877594 
+317169.645529  7367340.090812 
+317158.628565  7367325.113377 
+317144.007998  7367304.096977 
+317128.323667  7367287.289856 
+317120.217622  7367275.661848 
+317117.067562  7367266.983335 
+317117.446889  7367261.004359 
+317119.648632  7367256.055207 
+317121.174185  7367248.206551 
+317118.403452  7367241.967620 
+317109.637708  7367233.769024 
+317098.002277  7367226.650243 
+317089.302504  7367221.661098 
+317082.144775  7367215.702119 
+317073.939776  7367203.194261 
+317063.318631  7367180.688116 
+317042.785517  7367136.005770 
+317019.951704  7367096.062612 
+317003.038685  7367071.926746 
+316993.060746  7367054.409747 
+316988.632520  7367041.941882 
+316986.488500  7367034.723119 
+316987.395585  7367026.974446 
+316990.545645  7367019.815672 
+316996.482931  7367009.817385 
+317011.754951  7366994.719971 
+317024.025342  7366983.801841 
+317035.908160  7366970.994035 
+317043.403984  7366958.236220 
+317046.751953  7366943.548736 
+317047.106541  7366931.920728 
+317046.133486  7366919.722817 
+317043.717341  7366909.504567 
+317033.722909  7366886.008592 
+317026.227085  7366865.972024 
+317015.902805  7366836.597056 
+317006.155760  7366816.980416 
+316997.398263  7366808.561858 
+316979.594651  7366797.923680 
+316960.554104  7366788.495295 
+316948.052819  7366786.005722 
+316936.854438  7366784.755936 
+316923.718192  7366783.816097 
+316912.132238  7366781.346520 
+316896.159289  7366771.278244 
+316880.903763  7366760.340118 
+316865.252417  7366756.600759 
+316852.454267  7366753.781241 
+316843.342182  7366748.572134 
+316823.328580  7366735.694340 
+316813.375380  7366732.574874 
+316802.704757  7366730.115295 
+316794.301848  7366726.015997 
+316787.473969  7366717.627434 
+316783.416824  7366708.489000 
+316779.895683  7366696.591038 
+316774.337724  7366676.694446 
+316766.833654  7366665.746321 
+316755.552811  7366655.078148 
+316731.490310  7366639.820762 
+316714.024793  7366626.972963 
+316703.370663  7366615.094997 
+316695.907824  7366600.717460 
+316690.589006  7366594.438535 
+316681.493413  7366588.239597 
+316661.512796  7366580.120988 
+316649.019757  7366577.301471 
+316631.793381  7366576.971527 
+316603.995338  7366575.401796 
+316588.038881  7366571.982382 
+316578.423776  7366566.653295 
+316573.706932  7366560.394367 
+316572.107164  7366550.076134 
+316571.810299  7366541.317635 
+316574.012043  7366528.829774 
+316578.712394  7366503.194165 
+316578.069188  7366489.786461 
+316573.434807  7366477.868503 
+316565.287531  7366461.041385 
+316557.742230  7366445.434059 
+316555.540486  7366433.896035 
+316557.132009  7366421.288195 
+316559.919235  7366410.350068 
+316564.611340  7366401.661556 
+316571.843284  7366394.442793 
+316592.763971  7366375.985954 
+316597.431338  7366369.517062 
+316599.666066  7366362.008349 
+316599.657820  7366354.479638 
+316598.660026  7366345.051253 
+316591.461067  7366333.883166 
+316579.602987  7366320.995374 
+316563.036310  7366301.288749 
+316555.936305  7366290.670568 
+316549.941296  7366273.213558 
+316550.922597  7366260.035816 
+316552.464642  7366250.977367 
+316557.791707  7366240.739121 
+316566.161631  7366231.660676 
+316571.859777  7366223.862012 
+316583.058158  7366201.295877 
+316588.706826  7366189.737857 
+316591.180695  7366179.139672 
+316588.962459  7366169.141385 
+316583.742595  7366163.202402 
+316576.510651  7366162.562512 
+316570.276500  7366164.472185 
+316563.687762  7366169.151383 
+316555.837351  7366177.909883 
+316544.614231  7366186.968331 
+316537.431764  7366190.417741 
+316531.214106  7366190.447735 
+316523.726528  7366186.038491 
+316518.119092  7366178.539775 
+316513.097137  7366164.522176 
+316512.453931  7366151.004492 
+316510.524313  7366134.477323 
+316505.856947  7366117.020313 
+316497.173666  7366102.622779 
+316483.089104  7366087.935295 
+316465.532879  7366073.867705 
+316455.893035  7366062.889585 
+316451.497794  7366047.882156 
+316451.225669  7366029.155363 
+316453.377935  7366011.678357 
+316451.539025  7365987.952421 
+316446.517071  7365974.484728 
+316436.473162  7365954.758107 
+316428.416595  7365938.810839 
+316422.099982  7365930.982180 
+316417.127505  7365929.472438 
+316420.665138  7365899.617552 
+316428.127977  7365889.409301 
+316436.250514  7365884.190195 
+316449.122880  7365873.502025 
+316466.390487  7365869.842652 
+316478.611401  7365862.913839 
+316487.096772  7365852.495624 
+316496.522214  7365848.516305 
+316511.225243  7365846.156709 
+316520.774378  7365840.517675 
+316534.149764  7365822.740720 
+316544.078226  7365819.551267 
+316558.797747  7365815.741919 
+316568.816918  7365805.243717 
+316580.716228  7365791.216120 
+316593.976167  7365782.077686 
+316598.767227  7365766.410369 
+316601.719378  7365750.053171 
+316613.099176  7365736.795442 
+316627.587803  7365727.896966 
+316636.823582  7365722.247934 
+316649.662963  7365706.460638 
+316656.449611  7365693.702823 
+316669.000374  7365684.774353 
+316678.013504  7365672.926382 
+316683.785865  7365659.928609 
+316693.359739  7365644.431263 
+316706.578447  7365638.182333 
+316726.897159  7365635.222840 
+316739.942696  7365627.304197 
+316755.503333  7365621.635168 
+316765.637951  7365617.995791 
+316779.318447  7365616.176103 
+316801.443084  7365615.676189 
+316809.046109  7365610.457083 
+316822.429741  7365599.768913 
+316832.341710  7365597.569290 
+316845.288293  7365597.179357 
+316868.369492  7365593.489989 
+316887.245114  7365583.531695 
+316900.983334  7365577.392746 
+316917.838630  7365565.974702 
+316933.267327  7365555.096565 
+316952.629477  7365546.698004 
+316971.645285  7365542.178778 
+316992.541233  7365533.580251 
+317017.881900  7365536.449759 
+317029.278191  7365537.589564 
+317046.100501  7365545.558199 
+317057.735933  7365551.797130 
+317073.040937  7365558.745940 
+317089.467428  7365564.824899 
+317112.194040  7365572.873520 
+317128.768963  7365584.151588 
+317146.094294  7365592.240203 
+317169.422881  7365592.980076 
+317216.459380  7365580.172270 
+317267.618995  7365556.226372 
+317315.076052  7365542.538716 
+317387.593405  7365530.050855 
+317487.611936  7365526.221511 
+317636.316214  7365532.530431 
+317710.021023  7365522.492150 
+317797.604239  7365495.016856 
+317856.309155  7365462.532421 
+317902.545770  7365432.537559 
+317950.027566  7365408.771629 
+317993.773820  7365390.044837 
+318037.520073  7365380.076545 
+318105.007225  7365386.245488 
+318137.563343  7365382.556120 
+318165.089261  7365365.069115 
+318190.025863  7365343.782761 
+318210.031218  7365324.975983 
+318223.744700  7365320.056826 
+318266.847748  7365320.816695 
+318321.841860  7365315.417620 
+318359.733290  7365308.808752 
+318393.765483  7365301.150064 
+318432.382582  7365292.991462 
+318480.235458  7365280.523597 
+318515.141752  7365268.335685 
+318558.830282  7365253.928153 
+318601.125199  7365237.960888 
+318609.824973  7365234.851420 
+318634.481202  7365210.905522 
+318648.095729  7365197.457826 
+318666.295160  7365176.971335 
+318681.476471  7365160.984073 
+318700.203660  7365146.266594 
+318732.866980  7365125.970071 
+318755.370943  7365111.072623 
+318782.501042  7365092.695770 
+318804.683403  7365078.908132 
+318834.856361  7365062.560932 
+318857.310847  7365050.992914 
+318874.380544  7365038.795003 
+318896.653613  7365026.447118 
+318916.667215  7365006.980453 
+318953.989655  7364980.425001 
+318972.180840  7364968.247087 
+318994.371446  7364953.899545 
+319016.166234  7364938.562172 
+319035.734539  7364929.943648 
+319054.915272  7364919.995352 
+319074.211451  7364917.245823 
+319095.033184  7364914.516291 
+319109.480580  7364908.267361 
+319126.665725  7364895.189601 
+319134.623337  7364885.881196 
+319148.015216  7364874.743104 
+319161.819406  7364862.515198 
+319218.594704  7364820.802343 
+319232.200984  7364832.820285 
+319249.493330  7364843.338483 
+319262.365696  7364848.817545 
+319275.906007  7364858.295921 
+319287.830056  7364858.215935 
+319301.832156  7364854.626549 
+319313.055276  7364845.358137 
+319328.508712  7364832.140401 
+319334.198611  7364817.372931 
+319344.061103  7364802.875414 
+319349.305706  7364790.757490 
+319358.566223  7364775.700069 
+319369.063674  7364766.971564 
+319388.953583  7364757.363210 
+319407.903421  7364749.514554 
+319418.656506  7364737.346638 
+319425.995651  7364721.049430 
+319433.400766  7364699.103189 
+319436.262208  7364674.207454 
+319442.933409  7364661.889564 
+319464.769427  7364643.002799 
+319494.241456  7364633.514424 
+319518.823469  7364615.097579 
+319526.203846  7364611.868132 
+319537.501182  7364604.369416 
+319545.623719  7364590.621771 
+319556.879824  7364578.803795 
+319571.854979  7364571.235092 
+319584.315033  7364568.735520 
+319599.974625  7364563.166474 
+319629.924935  7364547.259199 
+319648.412984  7364535.861151 
+319663.190229  7364527.622562 
+319673.728912  7364515.904570 
+319678.074675  7364510.425508 
+319687.821720  7364505.556342 
+319705.419176  7364491.598733 
+319720.559256  7364478.390995 
+319747.153350  7364462.323747 
+319761.947087  7364452.655404 
+319779.280664  7364444.226847 
+319794.206342  7364431.788978 
+319813.345843  7364417.181480 
+319827.446897  7364405.953403 
+319835.231339  7364394.415380 
+319843.370369  7364387.096633 
+319851.204288  7364379.997849 
+319861.248197  7364367.489992 
+319873.691759  7364350.032982 
+319888.716391  7364330.066402 
+319901.102230  7364316.928652 
+319918.922334  7364293.892598 
+319930.005268  7364279.405080 
+319941.607715  7364264.377654 
+319949.548835  7364256.169060 
+319962.371723  7364241.481576 
+319970.197396  7364226.634119 
+319977.990084  7364214.656171 
+319986.533179  7364199.588752 
+319992.998224  7364188.030731 
+320002.605083  7364169.433917 
+320017.225650  7364156.986049 
+320036.150749  7364143.158418 
+320052.973059  7364133.730033 
+320077.489103  7364121.192180 
+320103.563684  7364105.784819 
+320115.265086  7364098.846008 
+320137.299014  7364080.179205 
+320163.233409  7364055.183487 
+320184.846780  7364034.577017 
+320210.162708  7364014.180510 
+320229.129038  7363997.023449 
+320254.197580  7363980.616260 
+320279.381568  7363954.450741 
+320299.337446  7363939.193355 
+320311.154295  7363931.814619 
+320326.401575  7363926.245573 
+320341.525162  7363914.797534 
+320353.012161  7363908.628590 
+320376.827276  7363886.442391 
+320397.088264  7363863.316352 
+320401.219626  7363858.827121 
+320418.742866  7363842.539911 
+320427.879690  7363820.833629 
+320450.045558  7363791.318685 
+320455.941612  7363768.462600 
+320461.342893  7363743.716838 
+320464.105381  7363726.359811 
+320468.657300  7363704.263596 
+320470.727104  7363685.016893 
+320472.178441  7363667.199945 
+320469.308752  7363652.212512 
+320464.608401  7363628.676544 
+320457.005376  7363608.639976 
+320454.910834  7363596.762010 
+320454.820125  7363579.814913 
+320452.239055  7363566.157253 
+320447.637658  7363551.039842 
+320442.665181  7363541.341503 
+320435.969242  7363514.226148 
+320436.769126  7363490.760167 
+320439.053332  7363470.853577 
+320440.916980  7363460.235396 
+320442.384809  7363448.957328 
+320442.079699  7363432.780099 
+320439.490382  7363419.352399 
+320436.092935  7363405.684740 
+320431.136951  7363394.766610 
+320423.237062  7363382.818657 
+320416.607092  7363366.561442 
+320407.099188  7363353.373701 
+320395.216370  7363333.727066 
+320386.071300  7363315.450196 
+320381.115316  7363304.092142 
+320379.466069  7363280.816129 
+320376.101607  7363264.598907 
+320364.309497  7363237.983466 
+320349.548745  7363220.626439 
+320339.513082  7363208.098585 
+320329.337233  7363198.890162 
+320317.710048  7363191.981346 
+320274.664724  7363170.954947 
+320253.372957  7363154.297800 
+320234.975616  7363142.219869 
+320214.261085  7363120.253632 
+320198.271643  7363103.436512 
+320187.271172  7363086.689381 
+320176.584057  7363061.303729 
+320181.210192  7363033.218540 
+320200.745513  7362994.585158 
+320208.538201  7362974.308631 
+320228.840420  7362963.920410 
+320242.430209  7362968.969545 
+320261.116167  7362982.267268 
+320289.120366  7362991.925613 
+320328.801228  7362996.514827 
+320367.607990  7362997.324688 
+320396.758415  7362988.166257 
+320414.223932  7362976.638232 
+320436.109428  7362962.070727 
+320451.364954  7362948.303085 
+320469.209798  7362930.476139 
+320476.936516  7362915.508703 
+320485.603304  7362890.243031 
+320491.367419  7362869.276622 
+320494.294831  7362838.851833 
+320495.185424  7362808.067107 
+320487.755570  7362774.632834 
+320477.703415  7362747.487483 
+320474.108059  7362733.039958 
+320464.732094  7362700.355557 
+320457.236271  7362680.988874 
+320454.135688  7362659.572542 
+320453.533713  7362642.625445 
+320452.882261  7362621.239109 
+320445.460653  7362603.202198 
+320440.438699  7362589.514543 
+320433.264478  7362568.598125 
+320426.766448  7362550.131289 
+320429.759830  7362530.784603 
+320439.811985  7362508.868357 
+320448.280864  7362491.581318 
+320457.112577  7362469.655074 
+320460.138944  7362447.318899 
+320455.438592  7362415.694317 
+320440.183066  7362380.830288 
+320421.563077  7362337.397728 
+320408.921605  7362314.091720 
+320391.728214  7362287.076348 
+320373.726693  7362260.270939 
+320363.196256  7362246.623277 
+320350.092996  7362226.966644 
+320339.504836  7362202.020917 
+320338.168946  7362170.216365 
+320331.390545  7362141.441294 
+320320.159179  7362118.925150 
+320304.804697  7362100.018389 
+320291.553004  7362092.429689 
+320266.979237  7362077.502246 
+320245.728701  7362066.494131 
+320226.193380  7362064.034553 
+320203.549231  7362066.304164 
+320184.615885  7362064.964393 
+320041.007779  7362028.610620 
+320022.692900  7362018.302386 
+320016.582444  7362009.703859 
+320000.873374  7361994.996378 
+319972.448617  7361986.777786 
+319946.555453  7361996.306154 
+319886.737296  7362021.701804 
+319859.302086  7362024.131388 
+319841.267580  7362023.791446 
+319827.883948  7362018.752309 
+319812.793346  7362011.803499 
+319796.416332  7362009.503893 
+319773.252670  7362012.203431 
+319753.676118  7362013.843150 
+319727.634522  7362010.303756 
+319708.965055  7362004.304784 
+319692.332408  7361990.147209 
+319676.747032  7361981.418704 
+319662.316129  7361970.830518 
+319630.683588  7361966.331288 
+319599.314927  7361973.470066 
+319578.806551  7361983.848288 
+319557.151949  7361988.237536 
+319539.554493  7361994.106531 
+319526.302800  7361995.046370 
+319502.141345  7361987.987579 
+319490.967702  7361985.298039 
+319471.976633  7361971.990319 
+319453.818433  7361957.812747 
+319433.639907  7361950.024082 
+319413.939662  7361944.794977 
+319394.214678  7361941.885476 
+319378.192252  7361943.575186 
+319355.267731  7361951.923756 
+319340.135897  7361956.612953 
+319320.452145  7361966.001345 
+319300.826116  7361971.400420 
+319272.863148  7361975.039797 
+319248.858370  7361979.609014 
+319226.502839  7361983.648322 
+319202.976343  7361990.887082 
+319186.236495  7362001.645239 
+319169.043104  7362023.691463 
+319156.789205  7362042.368264 
+319152.616612  7362049.737002 
+319145.417653  7362063.824589 
+319141.038905  7362079.281941 
+319129.716830  7362097.188874 
+319116.522861  7362108.986853 
+319106.429475  7362117.835337 
+319074.318652  7362127.293717 
+319036.509685  7362127.923609 
+319013.337777  7362131.732957 
+318981.655759  7362131.113063 
+318960.726825  7362134.952405 
+318941.768741  7362143.350966 
+318916.815647  7362150.789692 
+318896.208317  7362152.639375 
+318875.642217  7362151.719533 
+318847.547310  7362149.589898 
+318823.501301  7362149.619893 
+318801.690021  7362150.119807 
+318775.673163  7362153.339256 
+318755.709039  7362152.869336 
+318733.386493  7362153.699194 
+318720.654312  7362153.199280 
+318720.242001  7362137.252011 
+318719.483348  7362124.724157 
+318715.690082  7362102.627942 
+318712.605991  7362080.441742 
+318714.016097  7362057.085743 
+318714.642810  7362031.840067 
+318717.207388  7362005.734539 
+318719.837936  7361975.299752 
+318725.766975  7361948.904273 
+318730.854900  7361933.456919 
+318736.099502  7361913.150398 
+318743.949914  7361880.565979 
+318746.737140  7361853.130679 
+318750.794285  7361830.584541 
+318757.869551  7361818.826555 
+318778.897440  7361798.929963 
+318791.588388  7361786.572079 
+318797.665860  7361773.134381 
+318806.678991  7361753.087815 
+318814.471679  7361732.581328 
+318821.909779  7361716.394100 
+318833.165883  7361688.178933 
+318842.393416  7361659.613826 
+318839.482496  7361631.658615 
+318827.393522  7361604.153326 
+318810.546473  7361582.896967 
+318795.373408  7361557.891250 
+318790.854474  7361520.177710 
+318786.624158  7361492.432463 
+318779.276766  7361452.459310 
+318771.624264  7361421.014696 
+318764.400566  7361388.140327 
+318768.837038  7361359.285270 
+318785.106851  7361345.537625 
+318802.390951  7361331.799978 
+318809.960990  7361321.591726 
+318812.838925  7361294.926294 
+318807.825217  7361280.468770 
+318800.156222  7361258.662506 
+318795.892921  7361241.105513 
+318791.703836  7361225.438197 
+318787.069454  7361205.221660 
+318782.039253  7361192.193891 
+318781.148660  7361173.797042 
+318781.198138  7361145.331918 
+318784.191520  7361125.985232 
+318794.070504  7361102.299289 
+318806.514066  7361076.313740 
+318816.508498  7361059.376641 
+318826.173080  7361044.549181 
+318846.128958  7361013.224547 
+318859.133264  7360999.656871 
+318871.824213  7360986.749082 
+318884.572885  7360969.622016 
+318896.925739  7360951.285157 
+318907.777778  7360930.598700 
+318913.863497  7360916.601098 
+318923.709496  7360895.124776 
+318938.140400  7360873.598464 
+318958.755976  7360854.361759 
+318977.408950  7360837.654620 
+318986.669467  7360830.015929 
+318998.849150  7360817.648047 
+319012.875988  7360804.090370 
+319035.610846  7360786.213432 
+319050.379845  7360770.336151 
+319064.769517  7360760.327866 
+319080.371386  7360742.800868 
+319097.721455  7360723.744132 
+319108.524017  7360707.376936 
+319113.578957  7360693.929239 
+319119.771876  7360687.690308 
+319119.615197  7360686.810459 
+319119.615197  7360583.948078 
+319126.946096  7359466.359511 
+319136.082920  7359463.729961 
+319180.274470  7359446.332941 
+319248.041993  7359416.508050 
+319283.269891  7359412.488738 
+319292.332498  7359411.298942 
+319298.376985  7359408.559411 
+319350.262269  7359362.377322 
+319386.562176  7359347.979788 
+319389.918392  7359336.111821 
+319398.882044  7359313.885628 
+319407.293200  7359298.008348 
+319414.937456  7359284.140723 
+319423.290887  7359276.612013 
+319433.656399  7359267.833517 
+319454.568840  7359261.414616 
+319465.387895  7359260.494774 
+319484.238778  7359260.644748 
+319498.529496  7359266.573732 
+319511.047274  7359272.502717 
+319518.839962  7359273.322576 
+319529.659016  7359271.632866 
+319548.048111  7359266.213794 
+319573.232099  7359261.354626 
+319593.352902  7359260.244816 
+319614.958026  7359261.434613 
+319662.893365  7359272.192770 
+319680.226942  7359273.342573 
+319698.071785  7359275.002289 
+319711.900714  7359274.102443 
+319724.748341  7359269.903162 
+319743.409561  7359262.204481 
+319770.399474  7359250.506485 
+319806.419009  7359239.908300 
+319834.109852  7359235.069129 
+319864.324041  7359229.230129 
+319902.957631  7359239.408386 
+319925.552303  7359244.147574 
+319943.867182  7359248.856767 
+319955.708769  7359252.936068 
+319974.386481  7359269.613212 
+319987.803099  7359291.999377 
+319998.490214  7359307.786673 
+320181.952353  7359475.527940 
+320357.102292  7359526.609191 
+320430.089679  7359519.310441 
+321650.193720  7359181.658278 
+323030.785901  7358765.929488 
+323692.084121  7358570.502963 
+323836.187002  7358520.431540 
+324813.216901  7358187.338596 
+325088.517311  7358098.433824 
+326572.937783  7357617.596187 
+328059.098209  7357476.850296 
+330702.765538  7357474.340726 
+332084.108126  7357442.346206 
+332089.286759  7357391.804863 
+332097.062954  7357342.563298 
+331836.811915  7355681.047900 
+332066.601378  7355329.898049 
+332270.225552  7355060.754151 
+332502.777502  7354836.182618 
+332741.101814  7354236.195391 
+336095.858105  7355254.410980 
+Region 1
+350
+331851.094387  7373867.232772 
+331905.890589  7373687.333587 
+332003.872302  7373405.931788 
+332079.778855  7373207.995693 
+332124.366224  7373029.096337 
+332115.254139  7372873.592973 
+332107.296527  7372653.760628 
+332128.563555  7372428.399231 
+332141.485399  7372386.906338 
+332157.680996  7372352.532226 
+332206.350249  7372226.063889 
+332234.263740  7372166.244136 
+332272.072707  7372061.682046 
+332304.876213  7371966.588335 
+332331.659970  7371880.733041 
+332360.076481  7371786.359206 
+332401.645730  7371674.088437 
+332456.466671  7371543.700772 
+332511.114441  7371446.097490 
+332565.514825  7371369.970530 
+332623.527058  7371298.422786 
+332689.406194  7371208.478192 
+332749.620170  7371131.641354 
+332820.983050  7371042.646598 
+332890.647207  7370959.930766 
+332966.405328  7370870.096154 
+333112.487304  7370718.722083 
+333143.146789  7370676.429327 
+333208.869248  7370599.432516 
+333269.561505  7370525.155239 
+333343.967244  7370445.818829 
+333418.010149  7370362.613081 
+333531.461790  7370238.534335 
+333617.560685  7370134.972074 
+333694.902082  7370039.508426 
+333777.331403  7369944.974619 
+333864.617755  7369844.081901 
+333942.750790  7369759.476393 
+334054.916019  7369613.571385 
+334146.704813  7369502.090481 
+334237.528797  7369403.227415 
+334316.016420  7369305.114221 
+334407.046561  7369197.282692 
+334511.064514  7369005.205593 
+334580.951319  7368847.952529 
+334622.611276  7368743.210470 
+334653.138822  7368640.448073 
+334672.187615  7368507.430857 
+334694.394714  7368320.612857 
+334699.441407  7368244.695861 
+334697.165447  7368171.658372 
+334691.698196  7368119.897238 
+334685.793895  7368048.059543 
+334683.905508  7367980.801064 
+334686.651503  7367919.141626 
+334686.766950  7367837.635587 
+334681.456378  7367678.082917 
+334668.212931  7367454.761170 
+334662.366354  7367208.153412 
+334666.852303  7366949.367739 
+334665.392720  7366676.114545 
+334659.447188  7366286.961204 
+334655.587952  7366009.688698 
+334653.097591  7365906.766327 
+334652.586324  7365799.884635 
+334658.655550  7365714.779213 
+334661.071696  7365548.007780 
+334647.490154  7365390.254801 
+334610.604764  7365194.238377 
+334588.760499  7365090.976065 
+334564.524827  7364965.107625 
+334545.228647  7364878.942384 
+334510.949067  7364811.643912 
+334461.859256  7364756.153417 
+334384.336441  7364692.794270 
+334286.387714  7364597.310625 
+334200.800086  7364508.715801 
+334084.676666  7364363.290711 
+333966.895754  7364212.526535 
+333846.179183  7364068.701171 
+333710.273056  7363899.570142 
+333601.917585  7363797.637602 
+333411.734768  7363634.625525 
+333271.870450  7363482.161640 
+333102.674289  7363259.029861 
+333023.180626  7363137.490679 
+332933.840963  7362995.794951 
+332834.185266  7362873.915827 
+332754.468954  7362772.533193 
+332624.574329  7362640.335837 
+332484.949152  7362477.903661 
+332314.854152  7362325.069840 
+331887.839590  7361882.835590 
+331818.612484  7361843.812275 
+331736.818122  7361798.670007 
+331646.249771  7361746.658916 
+331565.609882  7361690.678505 
+331482.858957  7361632.228517 
+331383.937174  7361553.541995 
+331291.818532  7361477.255063 
+331213.438109  7361437.461879 
+331156.605088  7361418.855066 
+331100.835830  7361414.105880 
+331034.816507  7361414.885746 
+330979.319375  7361421.434624 
+330797.795100  7361446.660303 
+330725.525134  7361458.768229 
+330643.203014  7361468.326592 
+330588.695429  7361476.995107 
+330528.704101  7361484.703787 
+330482.954014  7361494.132172 
+330437.269896  7361506.999968 
+330381.063588  7361521.627462 
+330343.807118  7361545.663345 
+330296.482000  7361575.788185 
+330265.896731  7361604.003352 
+330230.487416  7361634.938053 
+330204.544775  7361657.664160 
+330154.737542  7361691.528360 
+330113.737283  7361721.503225 
+330067.962456  7361750.318289 
+330003.724320  7361764.175916 
+329949.216735  7361773.064393 
+329863.645600  7361781.352973 
+329782.296534  7361785.712227 
+329695.917268  7361784.692401 
+329624.636851  7361781.862886 
+329538.059675  7361771.974580 
+329492.812608  7361764.575847 
+329443.335224  7361753.247788 
+329393.593960  7361738.150374 
+329332.769763  7361729.901787 
+329279.466128  7361722.842996 
+329220.398378  7361721.593210 
+329163.219015  7361723.792833 
+329088.260778  7361730.101752 
+328997.642950  7361734.790949 
+328915.461015  7361706.015878 
+328879.086892  7361689.188760 
+328840.923336  7361660.273713 
+328809.076393  7361631.428654 
+328773.856742  7361602.773562 
+328752.531990  7361580.257419 
+328728.007700  7361552.052251 
+328697.084335  7361513.468860 
+328625.696716  7361442.840957 
+328592.629331  7361413.216032 
+328572.953825  7361397.808671 
+328546.986445  7361379.331836 
+328515.642522  7361359.575220 
+328484.273861  7361350.226821 
+328459.394983  7361343.957895 
+328441.591371  7361341.638293 
+328378.812817  7361335.239389 
+328335.297458  7361319.552076 
+328301.578621  7361302.095066 
+328273.186849  7361282.148483 
+328249.825277  7361259.272401 
+328239.789614  7361246.754545 
+328219.347209  7361226.677984 
+328200.026290  7361215.489901 
+328171.766458  7361201.642273 
+328163.008961  7361184.475213 
+328154.457620  7361175.066825 
+328151.200359  7361157.639810 
+328149.328464  7361152.640666 
+328140.521490  7361139.352942 
+328132.918465  7361135.823547 
+328084.579061  7361140.682714 
+328075.623655  7361139.462923 
+328055.585314  7361137.013343 
+328045.434204  7361134.013857 
+328026.410150  7361123.595641 
+328013.166704  7361123.655631 
+327997.696775  7361122.145890 
+327985.022319  7361117.116751 
+327982.515465  7361113.877306 
+327977.963545  7361102.409270 
+327972.306631  7361090.051387 
+327967.062028  7361085.782118 
+327957.347969  7361088.321683 
+327952.746572  7361098.679909 
+327941.119387  7361108.068301 
+327931.891855  7361113.047448 
+327922.012870  7361121.466006 
+327911.845268  7361128.764756 
+327902.172439  7361136.283468 
+327888.689852  7361156.510003 
+327865.542683  7361158.339690 
+327853.635126  7361157.419848 
+327838.132212  7361159.229538 
+327825.680404  7361161.289185 
+327803.580506  7361168.897881 
+327787.351924  7361171.687404 
+327769.292679  7361182.105619 
+327759.133323  7361188.414538 
+327745.716705  7361203.311987 
+327731.153862  7361228.167729 
+327721.472787  7361245.334788 
+327707.215054  7361262.001934 
+327691.275091  7361274.659765 
+327682.072297  7361286.177792 
+327656.410027  7361311.233501 
+327642.910948  7361323.811346 
+327628.372843  7361338.698796 
+327616.250884  7361355.395936 
+327609.307558  7361365.164263 
+327595.857956  7361382.281331 
+327587.718926  7361398.688520 
+327578.070836  7361413.086054 
+327561.784531  7361420.864722 
+327552.647707  7361426.513754 
+327534.827603  7361434.052463 
+327520.586362  7361441.191240 
+327458.896311  7361402.907798 
+327448.266920  7361405.777306 
+327397.107305  7361397.838666 
+327268.103272  7361731.551504 
+327265.208845  7361739.080214 
+327124.453935  7362465.335813 
+326951.258352  7363243.712484 
+326775.687856  7363903.469474 
+326611.827006  7364519.253996 
+326607.192625  7364555.987704 
+326627.874171  7364820.742354 
+326635.304025  7364897.279243 
+326703.426136  7365162.193866 
+326789.137458  7365381.496301 
+326879.565623  7365668.287177 
+326773.007831  7366250.047527 
+326661.279652  7366570.552627 
+326246.098431  7367155.122495 
+326169.334270  7368025.373429 
+325671.896899  7369380.911238 
+325613.488847  7369526.546292 
+325608.021596  7369615.920983 
+325585.748527  7369832.083956 
+325581.237839  7370033.769409 
+325573.651307  7370287.315979 
+325573.469890  7370334.217945 
+325574.055372  7370336.627532 
+325552.730619  7370778.031924 
+325562.403448  7371152.427793 
+325606.792908  7371411.253459 
+325770.241445  7371841.869698 
+325821.879342  7371982.275648 
+325896.829332  7372167.483923 
+325983.068412  7372347.063163 
+326077.867080  7372527.082327 
+326165.969808  7372680.406064 
+326286.925519  7372889.080322 
+326299.707176  7372903.227897 
+326338.217074  7372955.578930 
+326437.848032  7373096.694758 
+326532.052971  7373234.011237 
+326575.411652  7373293.091117 
+326700.935775  7373459.772566 
+326746.067395  7373527.950888 
+326840.923786  7373671.666270 
+326939.218856  7373812.612128 
+327282.163096  7374258.605733 
+327372.104733  7374380.064928 
+327473.046843  7374515.401746 
+327497.348484  7374570.662281 
+327544.063381  7374666.105932 
+327562.485460  7374789.494797 
+327572.405676  7374941.458766 
+327574.681635  7375076.065710 
+327636.940677  7375047.500602 
+327649.854274  7375039.961894 
+327705.986366  7374988.900640 
+327802.879576  7374907.264624 
+327826.983308  7374876.919821 
+327830.059152  7374861.742421 
+327890.001003  7374710.238372 
+327893.315988  7374705.899116 
+327914.912866  7374660.676862 
+327947.081411  7374599.537335 
+327965.701400  7374564.233382 
+327960.176426  7374520.060948 
+327950.586059  7374495.325185 
+327935.231578  7374442.034313 
+327917.518675  7374391.852909 
+327899.863495  7374337.832162 
+327893.588113  7374292.899859 
+327886.974636  7374246.407822 
+327885.605762  7374190.457406 
+327888.186832  7374153.543729 
+327889.613430  7374124.598687 
+327914.137720  7374004.559249 
+327948.153421  7373904.876324 
+327960.019747  7373870.072285 
+327966.352852  7373858.204318 
+327990.877142  7373839.217570 
+328041.360566  7373783.177170 
+328094.573493  7373760.781006 
+328131.549591  7373738.874758 
+328205.848129  7373799.134436 
+328236.293213  7373820.740735 
+328306.031585  7373871.811987 
+328341.383176  7373903.246603 
+328369.873903  7373926.812566 
+328369.865657  7373926.812566 
+328381.649520  7373968.065500 
+328428.628296  7374028.825092 
+328455.453285  7374086.315245 
+328466.956776  7374149.564411 
+328476.209047  7374162.982112 
+328500.436473  7374232.820150 
+328545.485631  7374303.468048 
+328582.519453  7374344.770974 
+328616.782541  7374378.845137 
+328674.110336  7374420.288038 
+328698.139853  7374431.646093 
+328733.343011  7374446.903479 
+328785.302510  7374467.889885 
+328808.103338  7374480.017807 
+328857.473521  7374503.853724 
+328901.887719  7374524.760143 
+328977.835504  7374560.873957 
+329049.973529  7374600.607151 
+329118.408997  7374642.170032 
+329205.373746  7374695.030977 
+329299.941519  7374725.825702 
+329409.476201  7374758.570094 
+329498.873587  7374761.389611 
+329554.700569  7374765.808854 
+329642.061136  7374776.137085 
+329749.987803  7374789.584781 
+329784.325107  7374878.929477 
+329829.506205  7374999.848765 
+329881.383242  7375097.821983 
+329918.738667  7375173.019102 
+329979.950437  7375266.433101 
+330030.260690  7375341.120308 
+330220.690894  7375624.781719 
+330462.791980  7375946.156671 
+330939.391126  7375502.262706 
+331209.339733  7375201.484226 
+331372.046110  7375002.798260 
+331443.450221  7374903.835211 
+331530.711834  7374774.047443 
+331634.944189  7374569.692447 
+331652.731308  7374513.082143 
+331688.000437  7374417.678485 
+331719.162942  7374324.344473 
+331752.683870  7374211.873738 
+331786.534647  7374106.711751 
+331813.574037  7374016.647178 
+331851.094387  7373867.232772 
+Region 1
+514
+333270.245942  7379020.010148 
+333285.014941  7379012.751391 
+333306.669543  7379001.043396 
+333315.905321  7378996.054251 
+333335.778737  7378988.855484 
+333354.365741  7378986.635864 
+333381.504086  7378986.065962 
+333404.370884  7378984.216279 
+333425.192616  7378982.576560 
+333448.628404  7378975.867709 
+333462.490317  7378967.939067 
+333486.693004  7378947.612549 
+333492.704506  7378929.965571 
+333494.576401  7378917.917635 
+333493.628084  7378903.170161 
+333491.434587  7378889.302537 
+333480.673256  7378867.586256 
+333474.002055  7378853.548661 
+333462.919121  7378841.680694 
+333444.711444  7378827.963043 
+333427.179958  7378818.684633 
+333416.319672  7378813.575508 
+333404.148235  7378808.006462 
+333396.619427  7378797.618241 
+333390.863558  7378783.600642 
+333376.795488  7378764.603896 
+333356.781887  7378758.394960 
+333334.492325  7378754.045705 
+333291.587187  7378750.676282 
+333308.689870  7378736.358734 
+333319.137844  7378732.379416 
+333330.938200  7378717.341992 
+333338.912305  7378706.583835 
+333344.618696  7378689.366784 
+333353.079329  7378671.519841 
+333358.290947  7378653.422941 
+333364.294203  7378636.765794 
+333372.062152  7378617.139156 
+333385.957051  7378597.472524 
+333393.947648  7378585.494576 
+333408.320828  7378559.079101 
+333414.546732  7378541.422125 
+333432.540008  7378510.957344 
+333446.764755  7378479.992648 
+333456.421092  7378446.988301 
+333461.946066  7378419.033089 
+333472.377548  7378389.798097 
+333483.072909  7378346.175569 
+333479.502291  7378343.745985 
+333496.794637  7378354.994059 
+333560.034980  7378351.344684 
+333583.718154  7378349.954922 
+333711.963533  7378342.746157 
+333788.076242  7378338.436895 
+333808.213537  7378334.927496 
+333902.393737  7378308.392041 
+333933.011992  7378313.891099 
+333951.013513  7378327.608750 
+333971.192040  7378338.136946 
+334000.070339  7378354.194196 
+334029.484644  7378333.157799 
+334042.464211  7378321.899728 
+334050.537271  7378302.493052 
+334050.652718  7378283.336333 
+334046.529603  7378260.580231 
+334038.736915  7378246.432654 
+334024.198810  7378223.886516 
+334011.878942  7378204.369859 
+334000.870224  7378186.302954 
+333989.803782  7378163.576847 
+333984.666381  7378140.480803 
+333982.217250  7378122.623862 
+333983.445938  7378095.608489 
+333984.633396  7378072.142509 
+333989.193561  7378047.386749 
+334009.726676  7378000.004865 
+334014.996017  7377984.887455 
+334021.576509  7377971.449756 
+334030.771056  7377961.031541 
+334045.490578  7377949.683485 
+334063.038557  7377940.245102 
+334087.488631  7377933.436268 
+334112.334523  7377927.627263 
+334123.483427  7377924.657771 
+334132.108985  7377919.878590 
+334136.528964  7377916.499169 
+334142.111662  7377910.250239 
+334146.680074  7377903.321426 
+334151.776245  7377894.522933 
+334157.391928  7377884.844591 
+334159.907028  7377870.357073 
+334160.962546  7377848.770770 
+334165.506219  7377834.983132 
+334168.334676  7377828.704207 
+334170.660113  7377821.305475 
+334175.434680  7377814.166698 
+334182.559424  7377806.268051 
+334191.184981  7377801.498867 
+334202.638995  7377798.749338 
+334213.326110  7377800.529034 
+334224.697662  7377805.088253 
+334239.194536  7377812.347009 
+334252.891525  7377818.705920 
+334267.091534  7377825.614737 
+334283.171684  7377828.464249 
+334302.459617  7377827.464420 
+334324.510038  7377825.944680 
+334346.684152  7377821.655415 
+334373.525633  7377811.107222 
+334380.955487  7377803.218573 
+334385.548637  7377794.300101 
+334387.354562  7377788.231140 
+334388.368848  7377779.602618 
+334387.338069  7377771.394024 
+334382.497532  7377757.936329 
+334371.661985  7377741.859083 
+334364.570226  7377719.962834 
+334334.850811  7377678.759892 
+334324.435822  7377662.022758 
+334317.690405  7377645.665560 
+334314.853702  7377634.997388 
+334314.853702  7377626.358867 
+334318.399581  7377619.310075 
+334328.822817  7377608.131989 
+334341.324102  7377603.292818 
+334355.820976  7377601.573113 
+334372.758734  7377601.103193 
+334382.472793  7377599.113534 
+334390.875702  7377595.004238 
+334408.877224  7377581.916480 
+334420.801273  7377573.517919 
+334428.437283  7377565.409307 
+334430.548318  7377559.570308 
+334431.257494  7377551.161748 
+334429.814403  7377543.053137 
+334427.505459  7377539.933671 
+334414.781525  7377528.705595 
+334398.330295  7377523.096555 
+334381.260597  7377517.247557 
+334369.600427  7377511.358566 
+334361.510875  7377505.509568 
+334356.381719  7377499.360621 
+334353.182182  7377493.561614 
+334351.137117  7377484.683135 
+334352.662669  7377476.054613 
+334355.928177  7377467.566067 
+334361.321212  7377459.207499 
+334365.881377  7377452.948571 
+334385.202296  7377431.132308 
+334399.229134  7377417.444652 
+334415.185590  7377404.006954 
+334424.627524  7377398.687865 
+334435.314639  7377391.499097 
+334470.311642  7377372.072424 
+334489.401666  7377361.654209 
+334501.622580  7377354.265475 
+334515.113413  7377343.117384 
+334520.894021  7377336.758473 
+334527.029216  7377326.420244 
+334531.127593  7377315.942039 
+334531.853261  7377305.543820 
+334531.696583  7377292.586040 
+334529.865920  7377282.927694 
+334525.116091  7377261.381385 
+334522.782408  7377251.723039 
+334517.463589  7377235.165875 
+334514.206328  7377225.267571 
+334511.691227  7377213.499586 
+334511.979846  7377205.860895 
+334515.237107  7377197.482330 
+334519.071604  7377191.983272 
+334523.837925  7377185.724344 
+334534.104482  7377179.755367 
+334550.580451  7377183.594709 
+334565.308219  7377188.963789 
+334578.221816  7377192.543176 
+334587.688489  7377193.652986 
+334595.745056  7377193.852952 
+334605.970382  7377191.093424 
+334616.888392  7377181.695034 
+334626.305587  7377169.727084 
+334631.830562  7377159.378857 
+334644.843114  7377145.131297 
+334665.656600  7377144.261446 
+334687.756498  7377146.831006 
+334710.664527  7377150.200429 
+334733.539571  7377156.329379 
+334751.788479  7377157.089249 
+334773.137970  7377153.789814 
+334806.353787  7377147.520888 
+334835.372273  7377142.311780 
+334967.435657  7377115.566362 
+334980.926490  7377112.066961 
+334980.918244  7377112.066961 
+334991.316741  7377105.758042 
+334992.199087  7377104.768211 
+334997.179811  7377099.159172 
+335001.253448  7377092.160371 
+335001.756469  7377091.290520 
+335002.226504  7377088.540991 
+335003.521162  7377080.872304 
+335004.824066  7377065.384957 
+335003.892242  7377059.625944 
+335001.822438  7377047.058096 
+334997.006640  7377032.050667 
+334995.266685  7377029.091174 
+334991.135323  7377022.142364 
+334985.074344  7377017.313191 
+334976.250877  7377013.223892 
+334949.030070  7377003.275596 
+334931.506830  7376997.406601 
+334928.538187  7376996.416771 
+334908.763726  7376990.877720 
+334900.063952  7376985.338668 
+334893.450475  7376979.979586 
+334893.450475  7376979.969588 
+334893.409244  7376979.939593 
+334893.244319  7376979.309701 
+334891.677536  7376974.130588 
+334891.388918  7376972.080939 
+334891.355933  7376971.940963 
+334891.364179  7376971.930965 
+334891.355933  7376971.890972 
+334899.750595  7376959.803042 
+334910.338756  7376949.744765 
+334920.588820  7376942.665978 
+334927.754795  7376940.956271 
+334931.490337  7376940.056425 
+334936.223674  7376939.866457 
+334946.580939  7376939.416534 
+334946.704633  7376939.446529 
+335006.902116  7376936.047112 
+335037.437909  7376932.407735 
+335060.321199  7376928.788355 
+335077.935147  7376922.119497 
+335090.865237  7376915.070705 
+335098.583709  7376908.621809 
+335107.060834  7376898.413558 
+335110.466527  7376886.495599 
+335110.202648  7376873.647800 
+335102.525407  7376812.858213 
+335097.313789  7376796.081086 
+335089.562332  7376778.604080 
+335073.028640  7376752.828495 
+335064.122711  7376737.561110 
+335053.031531  7376726.353030 
+335018.504563  7376704.916702 
+335008.369946  7376698.827745 
+334966.907898  7376677.421412 
+334939.794291  7376658.504652 
+334917.752117  7376641.977483 
+334902.793455  7376629.729581 
+334888.783109  7376615.172075 
+334848.747659  7376566.870348 
+334811.416973  7376531.896339 
+334762.516825  7376491.463265 
+334732.813902  7376467.427382 
+334677.861021  7376429.753835 
+334677.729082  7376429.733838 
+334677.712589  7376429.663850 
+334609.211151  7376387.381093 
+334537.130849  7376350.347437 
+334482.004797  7376319.262761 
+334443.156805  7376301.425816 
+334379.974185  7376279.439582 
+334325.887159  7376265.531965 
+334287.608156  7376260.112893 
+334256.833223  7376257.993256 
+334258.375268  7376230.098034 
+334256.157032  7376209.691530 
+334205.203573  7376198.253489 
+334174.181253  7376191.254688 
+334145.929667  7376182.516185 
+334120.531277  7376174.257599 
+334091.850887  7376158.420312 
+334059.542155  7376139.553544 
+334038.769900  7376127.905539 
+334009.941077  7376089.152177 
+333943.979479  7376043.430009 
+333904.405818  7376008.525988 
+333857.014730  7375961.694009 
+333820.549898  7375922.620702 
+333745.781325  7375835.155684 
+333672.983601  7375754.579486 
+333601.150686  7375669.354085 
+333522.638324  7375579.849416 
+333462.341885  7375511.491125 
+333394.269251  7375428.195393 
+333272.381716  7375297.987696 
+333205.240906  7375230.539250 
+333106.162445  7375156.521928 
+333009.277481  7375104.910769 
+332916.284738  7375060.418390 
+332833.014301  7375030.663487 
+332694.823968  7374980.122144 
+332582.477321  7374942.938513 
+332483.291659  7374913.883490 
+332372.866385  7374879.519376 
+332265.450984  7374847.014944 
+332150.374835  7374807.811659 
+331944.796305  7374730.004987 
+331819.206213  7374674.724456 
+331712.277340  7374601.267038 
+331634.944189  7374569.692447 
+331530.711834  7374774.047443 
+331443.450221  7374903.835211 
+331372.046110  7375002.798260 
+331209.339733  7375201.484226 
+330939.391126  7375502.262706 
+330462.791980  7375946.156671 
+330184.976469  7376193.664275 
+330072.497883  7376332.340521 
+329930.068988  7376486.844056 
+329833.423164  7376649.296229 
+329721.117749  7376895.304090 
+329682.426435  7377011.584173 
+329651.247437  7377095.949722 
+329625.543936  7377174.836209 
+329523.727726  7377438.361070 
+329448.060314  7377568.498778 
+329364.963048  7377635.747259 
+329328.960005  7377646.825362 
+329315.345478  7377648.785026 
+329290.639771  7377651.264601 
+329205.530424  7377655.693843 
+329087.287723  7377676.120344 
+328936.010622  7377704.465488 
+328734.926287  7377762.125612 
+328532.489571  7377825.134819 
+328426.319352  7377864.928003 
+328171.106759  7377971.119813 
+328187.252879  7378037.428455 
+328188.184703  7378053.835644 
+328195.507356  7378089.689503 
+328196.736044  7378124.263581 
+328230.710515  7378149.259299 
+328258.830161  7378151.468921 
+328286.982792  7378151.248958 
+328300.580827  7378156.838001 
+328307.416952  7378165.116583 
+328324.173293  7378179.934045 
+328332.724634  7378198.860803 
+328346.718487  7378222.726715 
+328355.764602  7378234.354723 
+328383.133842  7378282.746434 
+328416.209473  7378349.924927 
+328417.710287  7378369.661546 
+328414.312840  7378389.548140 
+328409.505287  7378398.796556 
+328398.422353  7378413.404054 
+328390.712128  7378427.481642 
+328385.698420  7378446.148445 
+328385.046967  7378466.624937 
+328390.621419  7378477.992990 
+328403.716434  7378492.210555 
+328413.818066  7378500.419149 
+328442.943753  7378512.947003 
+328472.316826  7378521.705503 
+328488.825780  7378522.565355 
+328509.655759  7378520.925636 
+328526.445084  7378515.476570 
+328546.376224  7378512.057155 
+328572.285880  7378511.257292 
+328591.755231  7378512.377100 
+328610.045371  7378518.236097 
+328626.034812  7378520.635686 
+328645.594871  7378522.535360 
+328665.699181  7378521.665509 
+328679.214753  7378517.166280 
+328690.396642  7378511.427263 
+328728.040685  7378501.908894 
+328749.959166  7378503.048698 
+328761.561612  7378505.068352 
+328773.254767  7378508.197816 
+328783.348154  7378517.396241 
+328800.525052  7378530.893929 
+328818.765714  7378540.852223 
+328834.647955  7378552.010312 
+328870.923123  7378589.313922 
+328900.725001  7378613.589764 
+328964.707504  7378690.456597 
+329001.518678  7378733.069298 
+329024.212305  7378754.705592 
+329041.653083  7378763.444095 
+329060.998740  7378766.773525 
+329094.552652  7378767.053477 
+329130.844313  7378768.253271 
+329156.011809  7378770.432898 
+329180.371175  7378771.832658 
+329197.844937  7378778.011600 
+329217.050408  7378792.529113 
+329239.323477  7378806.856659 
+329248.955075  7378811.955785 
+329260.574014  7378820.844263 
+329270.164380  7378829.482783 
+329275.912003  7378835.311785 
+329282.401786  7378847.239742 
+329296.321424  7378860.467476 
+329317.217372  7378876.654703 
+329332.406929  7378888.252716 
+329343.770235  7378901.890380 
+329345.526682  7378908.999163 
+329349.756998  7378921.896953 
+329351.983481  7378932.005222 
+329359.809153  7378938.174165 
+329365.828902  7378942.913354 
+329377.728213  7378946.262780 
+329385.809519  7378952.891644 
+329396.933684  7378961.110237 
+329425.746014  7378982.936498 
+329443.681565  7378992.674830 
+329467.562649  7379000.703455 
+329481.193669  7379008.162177 
+329507.993918  7379022.659694 
+329528.254907  7379034.637642 
+329548.235524  7379052.934508 
+329626.954041  7379150.877731 
+329661.192391  7379206.098272 
+329689.740842  7379269.147473 
+329721.101257  7379307.260944 
+329738.921361  7379301.042009 
+329760.584209  7379288.894090 
+329789.479001  7379269.077485 
+329849.684731  7379240.982297 
+329900.654683  7379251.880430 
+329911.877803  7379251.900427 
+329934.926017  7379251.840437 
+329950.940197  7379251.910425 
+329976.651944  7379251.110562 
+329998.207591  7379248.481013 
+330018.806676  7379248.610990 
+330051.371040  7379246.551343 
+330065.059783  7379244.611675 
+330077.552823  7379240.322410 
+330090.367465  7379234.823352 
+330109.193610  7379221.315666 
+330122.255639  7379211.607329 
+330136.810236  7379205.688343 
+330158.695732  7379200.959153 
+330179.525711  7379198.539567 
+330205.377644  7379202.398906 
+330223.197748  7379206.138265 
+330240.679757  7379211.547339 
+330264.016590  7379213.267044 
+330284.294071  7379215.156721 
+330301.132874  7379214.536827 
+330318.375742  7379213.896936 
+330336.649390  7379212.447185 
+330367.143951  7379209.247733 
+330388.312025  7379207.957954 
+330409.331667  7379215.736621 
+330475.078863  7379219.156036 
+330524.242891  7379194.360283 
+330587.483233  7379154.867048 
+330609.203805  7379142.299201 
+330688.260418  7379193.260471 
+330768.842584  7379246.821297 
+330874.748924  7379314.849644 
+330907.527691  7379332.186675 
+330931.606685  7379346.214272 
+331073.623269  7379439.518290 
+331105.412488  7379458.115104 
+331155.739234  7379501.247716 
+331424.887956  7379643.283386 
+331459.249999  7379662.190148 
+331466.762315  7379602.090442 
+331489.299263  7379573.545332 
+331523.859216  7379502.927428 
+331607.781105  7379390.656659 
+331647.461967  7379361.291689 
+331670.782307  7379346.354248 
+331743.489323  7379296.212837 
+331779.426396  7379271.817015 
+331783.351602  7379258.149356 
+331797.452656  7379193.040509 
+331803.843485  7379173.823801 
+331814.118288  7379145.428664 
+331841.899839  7379042.256337 
+331882.372339  7379052.574570 
+331938.718833  7379060.513210 
+331962.641149  7379060.843153 
+332011.895884  7379048.615248 
+332081.848659  7379036.437334 
+332108.558200  7379031.718142 
+332168.351618  7379022.489723 
+332172.557196  7378975.767726 
+332179.236643  7378958.000769 
+332195.085898  7378932.625116 
+332213.491485  7378906.509589 
+332251.828211  7378848.689493 
+332271.058421  7378852.268880 
+332304.637072  7378865.676583 
+332327.817227  7378882.843643 
+332360.051742  7378862.427140 
+332382.621675  7378836.631559 
+332396.590790  7378801.167633 
+332419.160723  7378758.184996 
+332439.578390  7378678.668616 
+332498.349276  7378707.203728 
+332529.445812  7378718.301827 
+332559.923881  7378742.567671 
+332591.943994  7378742.567671 
+332645.486770  7378750.066386 
+332771.555144  7378760.504598 
+332844.509546  7378799.247962 
+332946.416465  7378820.684290 
+333003.554597  7378827.413138 
+333055.637790  7378832.452275 
+333156.464452  7378808.926304 
+333201.835213  7378820.684290 
+333263.418063  7378877.494559 
+333277.444902  7378918.147596 
+333275.762671  7378968.568959 
+333270.245942  7379020.010148 
+Region 1
+596
+338743.500117  7387764.332324 
+338720.080822  7387611.578490 
+338700.190914  7387481.440781 
+338678.486835  7387340.214972 
+338665.993795  7387260.778579 
+338655.413881  7387193.770056 
+338635.969269  7387059.992971 
+338614.199221  7386925.186062 
+338591.225222  7386778.851128 
+338586.854720  7386746.856609 
+338585.675509  7386735.818499 
+338584.941594  7386719.201346 
+338585.155996  7386700.264589 
+338581.849258  7386684.007374 
+338570.560168  7386626.117290 
+338561.439837  7386574.626110 
+338552.096858  7386533.883089 
+338547.347029  7386501.488638 
+338543.124959  7386459.355855 
+338540.214039  7386426.981400 
+338535.002421  7386400.565925 
+338527.415889  7386366.701726 
+338525.659442  7386359.263000 
+338525.189407  7386355.603627 
+338520.678719  7386348.244887 
+338503.336896  7386329.668069 
+338496.195660  7386319.949734 
+338492.517841  7386311.161239 
+338490.332590  7386287.215341 
+338491.693218  7386275.377369 
+338494.340258  7386266.108956 
+338500.434222  7386250.231676 
+338509.760709  7386228.845339 
+338523.119603  7386210.718444 
+338532.619261  7386200.860133 
+338547.495461  7386184.522931 
+338565.859816  7386166.336047 
+338584.265403  7386144.389806 
+338603.545091  7386126.552861 
+338616.532904  7386114.624904 
+338628.910496  7386102.906911 
+338639.020375  7386093.058598 
+338652.024680  7386079.130984 
+338664.633167  7386064.983407 
+338675.221327  7386048.606213 
+338682.898568  7386027.869765 
+338689.396598  7386012.322428 
+338692.356995  7385994.305514 
+338694.187658  7385975.938660 
+338693.470236  7385957.871755 
+338688.085447  7385927.916886 
+338680.754548  7385889.623445 
+338676.581955  7385870.526716 
+338670.809594  7385847.760616 
+338666.620509  7385830.323603 
+338664.278579  7385820.665257 
+338661.903665  7385804.138088 
+338658.333047  7385785.711244 
+338654.127469  7385769.494022 
+338651.249535  7385753.186815 
+338645.254525  7385723.321931 
+338639.078098  7385691.137444 
+338632.118280  7385664.921934 
+338626.469612  7385640.936043 
+338620.474602  7385619.939639 
+338615.996899  7385611.541078 
+338607.890854  7385595.213875 
+338596.131729  7385579.576553 
+338581.898735  7385565.358989 
+338568.869691  7385553.361044 
+338552.781295  7385540.783198 
+338531.563743  7385531.464794 
+338504.194504  7385515.327558 
+338477.748842  7385498.530436 
+338461.553245  7385486.832439 
+338443.650678  7385472.014978 
+338427.512805  7385455.327836 
+338411.943921  7385442.420047 
+338399.013832  7385430.102157 
+338387.873174  7385413.804948 
+338369.104753  7385385.239841 
+338358.425885  7385363.643541 
+338349.231337  7385337.398036 
+338342.296257  7385318.381294 
+338340.647011  7385309.062890 
+338338.750378  7385297.744828 
+338336.853745  7385275.908569 
+338338.098926  7385246.353631 
+338341.100554  7385224.347401 
+338346.773961  7385199.821602 
+338352.002071  7385179.605065 
+338357.799171  7385162.837937 
+338363.579779  7385147.400581 
+338367.834834  7385132.163191 
+338375.042039  7385107.987332 
+338381.861672  7385081.591853 
+338392.301400  7385042.168606 
+338397.513018  7385022.961896 
+338403.433811  7385004.305092 
+338409.247404  7384985.658286 
+338414.170404  7384965.551730 
+338418.450197  7384947.544815 
+338422.738237  7384928.548068 
+338428.221981  7384912.770771 
+338433.779940  7384889.794707 
+338439.255437  7384874.567315 
+338445.464849  7384848.501780 
+338451.377396  7384830.184917 
+338456.267411  7384812.517943 
+338461.173918  7384793.521197 
+338468.958360  7384762.816457 
+338472.949536  7384743.259807 
+338476.025380  7384723.693158 
+338478.680666  7384705.006359 
+338481.360691  7384693.848270 
+338485.896118  7384679.940653 
+338488.823530  7384664.363321 
+338492.526087  7384643.916823 
+338489.540952  7384636.678063 
+338488.023645  7384626.699772 
+338488.460696  7384614.521858 
+338488.617374  7384600.234306 
+338486.366153  7384582.487346 
+338482.762550  7384566.830028 
+338478.853837  7384551.612634 
+338474.038038  7384534.725527 
+338470.706561  7384522.177676 
+338466.435014  7384511.939430 
+338463.103536  7384500.051466 
+338459.277285  7384485.613939 
+338453.727572  7384471.266397 
+338446.207010  7384450.359978 
+338440.987146  7384432.802985 
+338433.788186  7384410.346832 
+338427.941609  7384394.779498 
+338420.734403  7384373.213192 
+338414.294097  7384355.976145 
+338410.063781  7384341.978543 
+338408.051701  7384329.770634 
+338406.649841  7384318.232610 
+338404.530560  7384307.024530 
+338399.978641  7384294.796624 
+338392.911621  7384278.209466 
+338385.333335  7384262.292192 
+338379.429034  7384252.593853 
+338372.065150  7384244.425253 
+338366.853532  7384236.506609 
+338361.551206  7384226.478327 
+338354.822282  7384217.429877 
+338350.517749  7384209.631212 
+338350.286855  7384203.092332 
+338351.581513  7384196.463468 
+338354.195568  7384190.624468 
+338358.335176  7384185.355371 
+338365.558874  7384178.016628 
+338375.973863  7384168.158316 
+338352.381397  7384142.532706 
+338295.103079  7384100.149966 
+338229.273420  7384065.745859 
+338211.502793  7384049.048719 
+338198.185131  7384035.501039 
+338179.391971  7384018.903882 
+338159.378369  7384001.736823 
+338143.792993  7383990.598731 
+338122.979507  7383971.981920 
+338105.076940  7383958.044307 
+338086.077625  7383942.217018 
+338062.905717  7383924.240097 
+338045.613371  7383910.872387 
+338019.893378  7383892.865472 
+338008.167238  7383883.097145 
+337989.571988  7383867.719779 
+337974.299969  7383855.591856 
+337958.747578  7383840.794391 
+337939.830724  7383826.626818 
+337918.002952  7383807.670065 
+337900.537435  7383791.082906 
+337885.479818  7383777.955155 
+337869.119297  7383763.377652 
+337850.631248  7383747.000457 
+337825.422520  7383729.223502 
+337804.872914  7383714.266064 
+337778.897287  7383701.568239 
+337746.835942  7383685.490993 
+337736.495169  7383680.051925 
+337715.953809  7383664.434600 
+337693.235443  7383652.216692 
+337675.415339  7383640.608681 
+337655.409983  7383631.530236 
+337637.746557  7383624.021522 
+337620.932493  7383613.203375 
+337601.990901  7383600.585536 
+337575.660687  7383583.238508 
+337554.970894  7383572.150407 
+337527.007926  7383554.673401 
+337504.116390  7383539.915929 
+337487.491989  7383529.867650 
+337456.453176  7383513.570441 
+337435.590213  7383499.942776 
+337408.930149  7383484.695387 
+337396.585542  7383475.356987 
+337378.468573  7383462.089260 
+337361.151489  7383450.931171 
+337338.960882  7383437.503471 
+337316.836245  7383427.175240 
+337291.347146  7383415.927167 
+337266.913565  7383402.479470 
+337247.980219  7383389.641669 
+337227.925386  7383376.453928 
+337216.100292  7383366.465639 
+337201.240584  7383354.227735 
+337180.938364  7383335.730904 
+337165.179817  7383321.933267 
+337138.907327  7383308.455576 
+337120.501740  7383303.156483 
+337097.700912  7383298.357305 
+337066.084864  7383288.039073 
+337046.640252  7383284.059754 
+337019.048364  7383279.650510 
+336999.999571  7383276.781001 
+336987.061235  7383275.191274 
+336967.270282  7383274.721354 
+336951.280841  7383272.691702 
+336912.935868  7383271.151965 
+336892.625402  7383271.921834 
+336878.425393  7383273.761518 
+336861.388680  7383273.011647 
+336852.045701  7383269.362272 
+336840.682395  7383264.143166 
+336836.254169  7383258.554123 
+336827.142085  7383252.135223 
+336818.541266  7383237.087800 
+336811.284583  7383228.929198 
+336801.479815  7383220.730602 
+336791.130795  7383215.741457 
+336779.973645  7383209.742484 
+336773.475616  7383207.012952 
+336758.533446  7383201.973815 
+336747.467004  7383196.974671 
+336742.189416  7383194.485098 
+336731.535286  7383189.485954 
+336721.524362  7383181.517319 
+336714.036785  7383175.888283 
+336708.726212  7383167.189773 
+336704.009369  7383160.610900 
+336693.495424  7383151.632438 
+336679.889144  7383146.163375 
+336667.495059  7383141.144235 
+336654.573216  7383138.234733 
+336638.583775  7383136.065105 
+336616.566339  7383133.935469 
+336594.730320  7383134.465379 
+336569.966889  7383068.506677 
+336566.313809  7383057.608543 
+336559.403468  7383045.900549 
+336552.204509  7383033.202724 
+336544.246896  7383023.694353 
+336532.974299  7383010.386632 
+336527.276153  7382999.688465 
+336521.602747  7382987.340580 
+336513.669873  7382975.622587 
+336505.934908  7382965.124385 
+336495.437457  7382954.926132 
+336481.385880  7382943.358114 
+336456.416293  7382931.890078 
+336434.349380  7382925.551164 
+336412.018588  7382924.971263 
+336383.263981  7382932.180028 
+336366.202530  7382934.309663 
+336348.060823  7382942.078333 
+336334.363834  7382944.257959 
+336321.392513  7382945.547738 
+336307.390413  7382948.377254 
+336293.916072  7382948.677202 
+336281.489003  7382947.317435 
+336271.403863  7382945.647721 
+336262.242300  7382944.217966 
+336251.316045  7382944.867855 
+336241.882357  7382949.307095 
+336234.889553  7382953.986293 
+336227.814287  7382956.895795 
+336219.114514  7382959.575336 
+336210.752836  7382959.475353 
+336202.440636  7382954.396223 
+336193.996495  7382943.338117 
+336189.469315  7382937.749074 
+336182.921808  7382930.150376 
+336169.645376  7382922.581672 
+336159.469528  7382919.912130 
+336152.130382  7382919.832143 
+336138.952906  7382921.231904 
+336126.171248  7382923.301549 
+336117.809571  7382923.211564 
+336102.331396  7382920.931955 
+336087.908738  7382915.012969 
+336076.685618  7382906.024508 
+336065.182127  7382894.926409 
+336052.062374  7382881.938634 
+336039.602319  7382865.401467 
+336029.409978  7382854.883268 
+336018.129134  7382842.125454 
+336003.599276  7382827.787910 
+335982.686835  7382800.972503 
+335963.135022  7382779.046259 
+335950.444073  7382764.498751 
+335941.678330  7382754.770417 
+335934.314446  7382738.513202 
+335929.300738  7382731.144464 
+335921.186447  7382726.955181 
+335911.612573  7382725.295466 
+335898.476328  7382723.155832 
+335882.371439  7382713.117552 
+335876.516616  7382707.408530 
+335867.338561  7382698.220103 
+335855.134140  7382694.320771 
+335841.816477  7382690.291462 
+335832.069432  7382677.333681 
+335828.061764  7382670.974770 
+335822.107986  7382664.815825 
+335809.722147  7382659.586721 
+335801.409947  7382654.507591 
+335795.365460  7382647.788742 
+335788.100531  7382640.949913 
+335779.277064  7382636.200727 
+335762.380537  7382633.241234 
+335747.916649  7382630.751660 
+335731.407695  7382629.021956 
+335718.502344  7382625.102628 
+335696.757034  7382617.213979 
+335687.743904  7382611.025039 
+335677.452608  7382601.386690 
+335665.116247  7382591.278422 
+335652.903579  7382579.510437 
+335638.035625  7382568.492325 
+335619.357913  7382560.193746 
+335603.681828  7382556.694346 
+335588.706674  7382554.974640 
+335576.279604  7382553.504892 
+335562.162057  7382548.025830 
+335555.688766  7382542.636753 
+335545.067621  7382534.438158 
+335529.251351  7382526.169574 
+335515.183281  7382516.151290 
+335499.251563  7382508.332629 
+335482.602424  7382501.383820 
+335461.879646  7382493.515168 
+335443.474059  7382488.206077 
+335432.316909  7382482.767009 
+335424.590191  7382478.787690 
+335422.784267  7382477.567899 
+335402.061489  7382469.689249 
+335387.935696  7382464.990054 
+335374.684003  7382463.840251 
+335361.498281  7382466.129858 
+335352.237764  7382472.888701 
+335343.801870  7382479.327598 
+335334.005348  7382488.296062 
+335323.870730  7382500.813917 
+335315.170957  7382512.011999 
+335306.899987  7382521.550365 
+335293.623556  7382541.007033 
+335290.077677  7382556.584364 
+335289.904506  7382572.081710 
+335289.384994  7382590.908485 
+335286.655491  7382606.825758 
+335278.846311  7382620.913345 
+335270.080568  7382629.121939 
+335260.086136  7382637.540497 
+335245.506800  7382646.229009 
+335225.856033  7382669.375044 
+335159.308951  7382708.718305 
+335206.831979  7382725.045509 
+335219.242556  7382731.934329 
+335235.965911  7382743.132410 
+335248.120855  7382756.100189 
+335290.127154  7382820.169215 
+335346.053091  7382912.973318 
+335370.841260  7382956.435873 
+335435.871035  7383066.267060 
+335439.153035  7383080.244666 
+335438.872663  7383099.031448 
+335435.532939  7383128.746358 
+335427.352678  7383173.178747 
+335408.996569  7383235.878008 
+335373.603747  7383344.789352 
+335360.607688  7383385.402395 
+335357.012331  7383419.176610 
+335356.748452  7383425.265567 
+335357.243226  7383433.404173 
+335361.028245  7383446.871866 
+335366.841838  7383465.418689 
+335390.599228  7383523.108808 
+335409.549067  7383571.910448 
+335423.922247  7383633.139960 
+335444.875919  7383699.718556 
+335461.285918  7383754.099241 
+335459.207867  7383809.319782 
+335458.399737  7383821.907626 
+335449.452577  7383855.151932 
+335442.583466  7383885.426746 
+335427.847452  7383934.318371 
+335421.200990  7383953.625064 
+335417.086121  7383974.511486 
+335417.292277  7383992.788356 
+335418.430257  7384000.007119 
+335424.953025  7384027.982327 
+335433.199256  7384056.767397 
+335441.222838  7384078.123738 
+335454.268375  7384106.728839 
+335472.698701  7384136.953661 
+335481.348997  7384150.691308 
+335495.202664  7384183.705653 
+335509.311965  7384216.729996 
+335521.112321  7384247.474730 
+335536.466802  7384275.149990 
+335542.618490  7384287.587859 
+335545.240792  7384309.204156 
+335546.337540  7384329.260721 
+335552.299565  7384359.035621 
+335551.136847  7384389.060478 
+335545.883998  7384408.157207 
+335409.177986  7384671.312131 
+335416.748026  7384693.818276 
+335473.020304  7384709.575576 
+335616.570687  7384741.780060 
+335624.808671  7384753.278091 
+335633.665123  7384772.534792 
+335636.138992  7384797.820461 
+335637.392419  7384813.227822 
+335642.340158  7384826.905479 
+335650.149338  7384849.471614 
+335657.158634  7384867.748483 
+335658.964559  7384872.607651 
+335665.322402  7384906.241889 
+335667.004634  7384928.738036 
+335668.488955  7384951.464143 
+335672.669794  7384978.309545 
+335674.698367  7384998.046164 
+335680.223341  7385023.581790 
+335685.072125  7385036.599560 
+335687.430547  7385053.796615 
+335691.298029  7385063.694919 
+335691.652617  7385077.982472 
+335692.048436  7385087.620821 
+335695.577823  7385100.838557 
+335700.517315  7385114.966137 
+335715.154374  7385138.392124 
+335726.352755  7385158.778632 
+335730.508856  7385169.906726 
+335736.841961  7385187.473717 
+335742.037086  7385197.052076 
+335746.696207  7385209.289980 
+335757.185412  7385220.268099 
+335761.201326  7385225.847144 
+335766.915964  7385234.775614 
+335777.396923  7385247.073508 
+335783.136300  7385253.232453 
+335792.908083  7385264.410538 
+335802.242816  7385287.226630 
+335809.656177  7385299.714491 
+335814.554438  7385308.852926 
+335837.371759  7385330.429230 
+335850.384311  7385343.916920 
+335864.229732  7385373.421866 
+335877.819520  7385435.491234 
+335882.940429  7385470.095306 
+335883.575389  7385494.801074 
+335884.523706  7385519.846784 
+335884.334042  7385536.233977 
+335884.969002  7385562.049555 
+335882.965168  7385576.647055 
+335875.576545  7385598.043390 
+335864.625551  7385619.079787 
+335865.936702  7385637.856570 
+335866.274797  7385645.125325 
+335860.090124  7385668.531316 
+335849.848306  7385690.347579 
+335839.276638  7385722.412087 
+335834.741211  7385736.359698 
+335824.062342  7385766.224582 
+335820.203106  7385776.512820 
+335812.253740  7385802.668340 
+335795.884972  7385833.823003 
+335786.913073  7385851.559965 
+335781.668471  7385864.127812 
+335777.034089  7385885.784103 
+335776.267190  7385900.001667 
+335776.283682  7385907.260424 
+335768.301331  7385936.735375 
+335762.421768  7385950.962938 
+335755.890754  7385968.829878 
+335747.842433  7385994.985397 
+335739.967282  7386051.495718 
+335730.682027  7386078.631070 
+335725.330223  7386096.388028 
+335723.582022  7386101.697119 
+335721.314309  7386131.022096 
+335720.671103  7386142.650104 
+335720.275284  7386168.885610 
+335713.290726  7386181.883383 
+335705.720686  7386192.651539 
+335699.437059  7386224.586069 
+335696.773526  7386234.634348 
+335685.393728  7386248.461979 
+335667.994181  7386262.329604 
+335659.714966  7386272.867799 
+335655.624835  7386291.764562 
+335658.271875  7386300.873002 
+335667.169558  7386317.360178 
+335666.880940  7386333.867350 
+335657.224604  7386359.882894 
+335609.206803  7386351.254372 
+335604.118879  7386408.534560 
+335575.966247  7386627.277092 
+335555.482610  7386625.667367 
+335545.661350  7386649.693252 
+335586.818287  7386810.195759 
+335612.175446  7386842.040305 
+335658.750157  7386901.710084 
+335706.627772  7386981.436427 
+335725.008620  7387016.980339 
+335743.834764  7387057.723360 
+335771.937919  7387135.460044 
+335775.005516  7387143.828611 
+335785.544199  7387169.384234 
+335819.576393  7387280.885134 
+335852.569562  7387388.436712 
+335905.188760  7387546.629615 
+335980.353152  7387768.871547 
+335990.487769  7387793.347354 
+336023.934481  7387843.478767 
+336048.689665  7387909.117524 
+336111.567174  7388102.904330 
+336144.799483  7388227.602970 
+336166.058266  7388292.981771 
+336167.888929  7388302.700107 
+336183.342365  7388330.265385 
+336207.751208  7388379.416966 
+336235.079217  7388434.747488 
+336242.987352  7388445.865584 
+336259.562275  7388469.141597 
+336281.818852  7388499.656370 
+336304.652665  7388527.641576 
+336328.541995  7388554.127040 
+336479.134659  7388718.998799 
+336530.228304  7388709.440436 
+336563.048302  7388711.410098 
+336619.947293  7388718.488886 
+336642.706890  7388726.357538 
+336662.407135  7388734.166201 
+336692.077073  7388751.873168 
+336723.668382  7388775.199172 
+336745.092090  7388798.065255 
+336799.591428  7388845.577117 
+336827.686336  7388877.241693 
+336846.702144  7388893.438919 
+336864.109937  7388912.895586 
+336887.603448  7388945.490003 
+336918.906139  7388994.161666 
+336931.959922  7388979.284214 
+336946.893846  7388960.257473 
+336964.507795  7388934.411900 
+336986.813849  7388892.879014 
+337025.299007  7388832.599340 
+337043.490192  7388804.224200 
+337060.939216  7388774.299326 
+337065.177778  7388766.760617 
+337089.190802  7388740.275154 
+337109.196158  7388721.868307 
+337137.233342  7388697.532476 
+337171.207812  7388669.227324 
+337199.723278  7388646.421230 
+337289.813347  7388567.654722 
+337429.991022  7388450.814736 
+337437.536323  7388438.426858 
+337450.301488  7388425.209122 
+337462.778035  7388413.511126 
+337478.808708  7388396.254082 
+337492.118124  7388387.915510 
+337654.758531  7388252.148766 
+337687.949609  7388225.113397 
+337714.040683  7388204.017010 
+337778.468483  7388149.656322 
+337823.278500  7388113.222563 
+337858.770277  7388088.256839 
+337892.019079  7388071.899641 
+337926.834665  7388061.651396 
+337959.052688  7388055.032530 
+337980.336209  7388050.393325 
+338050.585848  7388041.094917 
+338298.294371  7387999.981960 
+338495.634916  7387957.429249 
+338523.878256  7387950.760391 
+338547.561431  7387941.062052 
+338757.485724  7387858.036274 
+338743.500117  7387764.332324 
+Region 1
+327
+338766.894673  7387919.095815 
+338757.485724  7387858.036274 
+338547.561431  7387941.062052 
+338523.878256  7387950.760391 
+338495.634916  7387957.429249 
+338298.294371  7387999.981960 
+338050.585848  7388041.094917 
+337980.336209  7388050.393325 
+337959.052688  7388055.032530 
+337926.834665  7388061.651396 
+337892.019079  7388071.899641 
+337858.770277  7388088.256839 
+337823.278500  7388113.222563 
+337778.468483  7388149.656322 
+337714.040683  7388204.017010 
+337687.949609  7388225.113397 
+337654.758531  7388252.148766 
+337492.118124  7388387.915510 
+337478.808708  7388396.254082 
+337462.778035  7388413.511126 
+337450.301488  7388425.209122 
+337437.536323  7388438.426858 
+337429.991022  7388450.814736 
+337289.813347  7388567.654722 
+337199.723278  7388646.421230 
+337171.207812  7388669.227324 
+337137.233342  7388697.532476 
+337109.196158  7388721.868307 
+337089.190802  7388740.275154 
+337065.177778  7388766.760617 
+337060.939216  7388774.299326 
+337043.490192  7388804.224200 
+337025.299007  7388832.599340 
+336986.813849  7388892.879014 
+336964.507795  7388934.411900 
+336946.893846  7388960.257473 
+336931.959922  7388979.284214 
+336918.906139  7388994.161666 
+336887.603448  7388945.490003 
+336864.109937  7388912.895586 
+336846.702144  7388893.438919 
+336827.686336  7388877.241693 
+336799.591428  7388845.577117 
+336745.092090  7388798.065255 
+336723.668382  7388775.199172 
+336692.077073  7388751.873168 
+336662.407135  7388734.166201 
+336642.706890  7388726.357538 
+336619.947293  7388718.488886 
+336563.048302  7388711.410098 
+336530.228304  7388709.440436 
+336479.134659  7388718.998799 
+336328.541995  7388554.127040 
+336304.652665  7388527.641576 
+336281.818852  7388499.656370 
+336259.562275  7388469.141597 
+336242.987352  7388445.865584 
+336235.079217  7388434.747488 
+336207.751208  7388379.416966 
+336183.342365  7388330.265385 
+336167.888929  7388302.700107 
+336166.058266  7388292.981771 
+336144.799483  7388227.602970 
+336111.567174  7388102.904330 
+336048.689665  7387909.117524 
+336023.934481  7387843.478767 
+335990.487769  7387793.347354 
+335946.642561  7387855.336736 
+335928.954396  7387876.073184 
+335912.321749  7387912.326974 
+335908.899563  7387952.930019 
+335910.433362  7387999.682011 
+335908.668669  7388029.606885 
+335909.460307  7388044.114400 
+335906.087599  7388055.782402 
+335897.651705  7388066.900497 
+335892.266916  7388074.989112 
+335882.989907  7388084.797432 
+335789.889963  7388108.613352 
+335744.403754  7388125.840401 
+335647.782670  7388131.539425 
+335630.539802  7388132.189314 
+335610.270567  7388130.019685 
+335570.787614  7388119.851427 
+335549.256706  7388117.671800 
+335537.852169  7388118.111725 
+335522.621381  7388120.801264 
+335506.623694  7388125.770413 
+335489.331348  7388133.029170 
+335473.548063  7388142.827492 
+335440.942467  7388167.263306 
+335414.711207  7388185.630160 
+335385.156716  7388207.276452 
+335375.483888  7388215.085114 
+335365.489456  7388230.522470 
+335356.253678  7388247.229608 
+335348.832070  7388267.336164 
+335344.832648  7388287.552701 
+335334.739262  7388357.100788 
+335328.942162  7388391.364919 
+335318.073630  7388462.682703 
+335314.841108  7388491.107834 
+335307.477224  7388530.951009 
+335296.377797  7388600.239141 
+335295.833546  7388606.838011 
+335276.817738  7388721.038449 
+335254.948734  7388848.176672 
+335241.548610  7388918.724587 
+335235.578339  7388940.790808 
+335227.802143  7388966.386423 
+335210.006777  7389011.748653 
+335208.472978  7389015.048088 
+335186.562744  7389070.288626 
+335151.293615  7389151.614695 
+335139.682922  7389182.779357 
+335124.501612  7389217.233456 
+335117.178959  7389249.697895 
+335117.393361  7389256.816675 
+335119.619843  7389264.445369 
+335123.619265  7389273.123882 
+335140.449822  7389296.099946 
+335152.200700  7389321.835538 
+335157.808137  7389354.389962 
+335156.958776  7389368.107612 
+335155.078635  7389383.854915 
+335150.361791  7389408.210743 
+335144.119394  7389431.786704 
+335133.259109  7389465.001015 
+335120.906255  7389492.356329 
+335109.848060  7389515.402382 
+335102.187312  7389524.750781 
+335092.530976  7389528.500138 
+335081.093454  7389533.509280 
+335054.153018  7389543.737528 
+335045.486230  7389550.286407 
+335038.600627  7389557.095240 
+335032.960205  7389566.473634 
+335030.098763  7389577.881680 
+335022.759618  7389614.665379 
+335012.278659  7389627.303214 
+335007.429875  7389631.592480 
+334998.029172  7389635.091880 
+334988.653208  7389636.041717 
+334978.007324  7389634.441991 
+334957.243316  7389631.262536 
+334929.610197  7389631.832438 
+334912.870348  7389632.992240 
+334892.263018  7389645.050174 
+334861.949874  7389665.936597 
+334832.626278  7389691.402235 
+334773.509050  7389737.764293 
+334746.733540  7389763.489887 
+334738.297646  7389773.338200 
+334730.612159  7389786.245989 
+334725.466511  7389796.124297 
+334722.613315  7389807.792298 
+334722.761747  7389823.289644 
+334723.891481  7389844.126074 
+334729.251531  7389876.430541 
+334733.902405  7389902.376097 
+334733.547817  7389917.113572 
+334731.172902  7389931.581094 
+334724.996476  7389944.998796 
+334712.297280  7389948.478200 
+334703.416090  7389949.178080 
+334665.928725  7389945.118775 
+334640.332426  7389940.829510 
+334640.818953  7389946.328568 
+334645.758445  7389969.414614 
+334648.801304  7389997.919731 
+334651.901887  7390022.095590 
+334653.056359  7390036.953045 
+334654.441726  7390058.669325 
+334656.511530  7390074.536607 
+334662.844635  7390110.490449 
+334665.928725  7390135.556155 
+334669.037554  7390158.292261 
+334676.038604  7390198.245417 
+334685.092965  7390236.778817 
+334694.196804  7390280.181382 
+334700.727819  7390307.506702 
+334715.199954  7390372.165626 
+334729.729812  7390426.156378 
+334751.541092  7390497.804105 
+334775.413930  7390544.526102 
+334821.106294  7390644.199029 
+334851.122573  7390700.939310 
+334864.836055  7390724.575262 
+334875.209813  7390746.171562 
+334883.959064  7390766.178135 
+334886.358717  7390771.667195 
+334892.749546  7390783.805116 
+334904.450947  7390805.421413 
+334927.861996  7390847.114272 
+334941.361075  7390872.179978 
+334954.208703  7390891.596652 
+334971.979330  7390909.193638 
+334980.984214  7390915.602540 
+334987.828585  7390924.650990 
+334994.046243  7390932.429658 
+335005.228132  7390941.618084 
+335015.486443  7390948.506904 
+335024.977854  7390952.946144 
+335037.536863  7390956.615515 
+335079.493685  7390965.963914 
+335100.315417  7390970.403153 
+335122.209160  7390974.532446 
+335146.865389  7390981.121317 
+335159.267720  7390984.790689 
+335169.963081  7390988.909983 
+335175.042759  7390990.459718 
+335190.199331  7390998.418355 
+335201.686331  7391006.686938 
+335214.698883  7391018.934840 
+335225.113872  7391029.802979 
+335234.300173  7391042.670775 
+335251.295654  7391067.466527 
+335295.891269  7391144.893265 
+335221.567993  7391197.974173 
+335162.541474  7391247.205740 
+335076.450826  7391312.944479 
+335060.840711  7391329.821588 
+334992.396997  7391379.663051 
+334894.209128  7391456.909819 
+334903.997404  7391469.507661 
+334905.861052  7391477.356317 
+334905.960007  7391487.764534 
+334902.026555  7391501.762136 
+334890.811681  7391525.448079 
+334847.098413  7391607.554015 
+334865.289598  7391646.467350 
+334874.360451  7391663.644407 
+334885.171260  7391677.002119 
+334901.540028  7391686.240537 
+334921.998926  7391696.968699 
+334934.788829  7391704.217458 
+334945.830532  7391715.535519 
+334957.688612  7391731.682753 
+334975.203606  7391752.839129 
+334998.062157  7391775.465254 
+335051.027697  7391808.749552 
+335095.936669  7391848.702709 
+335131.799526  7391900.913765 
+335124.600567  7391919.510580 
+335123.462587  7391929.908799 
+335125.375712  7391941.556804 
+335128.715436  7391953.004843 
+335133.490003  7391964.352899 
+335140.713701  7391975.401006 
+335150.172128  7391988.018845 
+335163.267142  7391999.996793 
+335195.567627  7392012.104719 
+335214.830822  7392024.232642 
+335229.756500  7392036.180595 
+335243.783338  7392054.467463 
+335252.499604  7392076.163747 
+335256.556749  7392092.071022 
+335259.409945  7392112.057598 
+335258.939910  7392131.334296 
+335254.198327  7392154.470333 
+335246.397393  7392176.896492 
+335307.592671  7392254.153259 
+335402.069735  7392293.756475 
+335448.933064  7392484.923730 
+335459.991259  7392506.380054 
+335471.016470  7392580.877294 
+335479.048298  7392610.312252 
+335492.431931  7392630.838736 
+335515.620331  7392649.565528 
+335540.639395  7392658.573985 
+335572.511077  7392680.160287 
+335750.646151  7392752.307929 
+335792.231892  7392676.400931 
+335876.599078  7392587.426172 
+335911.480634  7392640.397099 
+335951.697500  7392658.344024 
+336000.003920  7392682.359911 
+336050.833685  7392702.986378 
+336198.878264  7392779.573259 
+336232.209528  7392797.680157 
+336250.375974  7392774.524124 
+336259.067502  7392764.955763 
+336272.104792  7392762.346210 
+336290.370193  7392770.174869 
+336313.838965  7392782.352783 
+336383.791740  7392813.077520 
+336673.597270  7392212.990309 
+336820.619316  7391918.950676 
+336900.426336  7391738.321616 
+336999.084240  7391512.680266 
+337127.222418  7391202.363421 
+337085.983018  7391203.593210 
+337171.125350  7390942.437944 
+337199.005856  7390867.120845 
+337232.749431  7390801.572073 
+337291.446101  7390698.369750 
+337338.894912  7390622.562735 
+337403.949426  7390530.118570 
+337512.049263  7390389.742615 
+337620.157347  7390252.036203 
+337773.735147  7390060.299046 
+337862.761453  7389946.828482 
+338041.778874  7389723.796686 
+338270.685990  7389432.756538 
+338773.508150  7388794.945790 
+338806.039530  7388753.692856 
+338802.378204  7388725.967605 
+338799.854857  7388713.869677 
+338796.457410  7388697.882416 
+338811.556259  7388680.555384 
+338822.837102  7388665.837905 
+338828.947559  7388658.039240 
+338843.551633  7388638.822532 
+338862.014944  7388611.667184 
+338871.506355  7388593.280333 
+338874.483245  7388582.682148 
+338875.472792  7388575.823323 
+338872.768029  7388561.955699 
+338862.691135  7388513.663971 
+338860.868718  7388503.345738 
+338852.119467  7388454.404121 
+338845.555468  7388420.109996 
+338835.791930  7388380.246824 
+338829.879383  7388360.800155 
+338817.040002  7388266.846248 
+338791.064375  7388087.147029 
+338766.894673  7387919.095815 
+Region 1
+308
+341738.258962  7388451.264659 
+341720.257441  7388431.857983 
+341697.069040  7388405.472503 
+341675.406192  7388379.646926 
+341649.389335  7388351.011831 
+341620.263648  7388317.257613 
+341594.997197  7388285.193106 
+341570.489400  7388257.797798 
+341550.805647  7388228.562806 
+341538.700181  7388206.616565 
+341527.798664  7388185.680151 
+341515.800398  7388153.765618 
+341505.368916  7388127.730078 
+341498.202942  7388110.373051 
+341494.582847  7388096.385447 
+341485.916058  7388076.798802 
+341469.976095  7388050.373328 
+341455.009186  7388028.507074 
+341446.218704  7388020.218493 
+341434.575026  7388011.559976 
+341410.364093  7387994.912828 
+341381.073482  7387976.316013 
+341351.518991  7387954.179805 
+341295.164251  7387918.565906 
+341264.851107  7387900.299034 
+341232.690808  7387882.222131 
+341211.267100  7387872.243840 
+341202.732252  7387869.274349 
+341178.430610  7387860.815798 
+341138.757994  7387858.836137 
+341125.778427  7387860.245895 
+341104.189795  7387865.764950 
+341080.605576  7387875.923210 
+341042.021463  7387894.989944 
+341014.891364  7387912.746902 
+340980.974617  7387934.413191 
+340942.901770  7387963.018291 
+340915.722194  7387985.094510 
+340899.468873  7387996.542549 
+340872.338775  7388014.299507 
+340848.424706  7388026.337445 
+340820.321552  7388039.205241 
+340799.268925  7388051.603117 
+340741.075275  7388090.726416 
+340706.647262  7388113.052592 
+340661.622843  7388142.907478 
+340627.978222  7388167.683234 
+340569.265060  7388208.346269 
+340537.921137  7388227.942912 
+340508.407877  7388248.439401 
+340481.302517  7388263.316853 
+340461.544549  7388277.944347 
+340435.857540  7388293.831626 
+340416.643823  7388305.689595 
+340392.309196  7388319.267269 
+340360.965274  7388339.193856 
+340323.428432  7388365.139412 
+340291.556750  7388386.615733 
+340263.503073  7388404.242713 
+340250.853356  7388412.971218 
+340229.751251  7388429.788338 
+340180.933566  7388470.011448 
+340139.661182  7388501.905985 
+340102.165571  7388533.830516 
+340057.528724  7388573.983638 
+340034.983530  7388591.790588 
+340000.720441  7388617.336212 
+339950.632837  7388652.780141 
+339915.982175  7388675.986166 
+339876.647655  7388698.702275 
+339836.826607  7388727.837285 
+339789.946786  7388759.211910 
+339750.166969  7388785.137470 
+339717.412941  7388802.834438 
+339703.847892  7388811.432965 
+339675.654029  7388832.389376 
+339635.453655  7388859.294767 
+339597.413793  7388884.240494 
+339559.464640  7388910.625975 
+339512.650788  7388944.780124 
+339469.077705  7388971.655521 
+339422.214377  7389001.150469 
+339390.862208  7389021.626961 
+339343.091794  7389050.232061 
+339313.652750  7389063.749746 
+339284.254938  7389073.168133 
+339247.427272  7389081.076778 
+339211.135611  7389086.655822 
+339153.337780  7389098.533788 
+339114.126953  7389109.621888 
+339076.812760  7389124.489342 
+339039.350134  7389143.456093 
+338992.626991  7389169.301666 
+338965.364953  7389188.498378 
+338926.121141  7389212.094336 
+338876.025290  7389237.899916 
+338842.347684  7389256.026811 
+338833.037689  7389248.948023 
+338795.484355  7389220.512894 
+338768.378995  7389189.418220 
+338747.598494  7389167.042053 
+338737.430891  7389154.084272 
+338731.139017  7389141.496429 
+338728.962012  7389126.189051 
+338728.599178  7389113.231270 
+338733.456208  7389097.993880 
+338739.113122  7389085.216069 
+338746.666670  7389075.997648 
+338753.816152  7389065.879381 
+338759.423588  7389057.200868 
+338766.556578  7389048.972277 
+338778.373426  7389032.485101 
+338788.730692  7389019.087396 
+338797.348003  7388996.591250 
+338801.578319  7388973.605187 
+338805.561249  7388955.258329 
+338808.117580  7388935.911643 
+338811.457304  7388901.617518 
+338812.298419  7388871.612657 
+338812.595284  7388844.697268 
+338811.152193  7388809.023378 
+338809.725595  7388781.538086 
+338806.039530  7388753.692856 
+338773.508150  7388794.945790 
+338270.685990  7389432.756538 
+338041.778874  7389723.796686 
+337862.761453  7389946.828482 
+337773.735147  7390060.299046 
+337620.157347  7390252.036203 
+337512.049263  7390389.742615 
+337403.949426  7390530.118570 
+337338.894912  7390622.562735 
+337291.446101  7390698.369750 
+337232.749431  7390801.572073 
+337199.005856  7390867.120845 
+337171.125350  7390942.437944 
+337085.983018  7391203.593210 
+337127.222418  7391202.363421 
+337197.422579  7391194.214817 
+337243.238637  7391190.465459 
+337454.812176  7391172.668507 
+337651.880596  7391163.470083 
+337661.050405  7391163.620057 
+337663.417073  7391164.229953 
+337670.500585  7391166.049641 
+337755.280083  7391164.089977 
+337722.056019  7391295.257509 
+337734.969616  7391287.748795 
+337757.003545  7391275.820838 
+337767.138162  7391272.401424 
+337781.107277  7391268.692059 
+337798.399623  7391265.962527 
+337819.782099  7391265.722568 
+337833.281178  7391265.822551 
+337862.093508  7391269.311953 
+337869.498623  7391271.001664 
+337886.353919  7391275.130956 
+337913.698420  7391284.479355 
+337933.167770  7391295.177523 
+337948.546990  7391305.165812 
+337968.321451  7391320.183239 
+337985.556073  7391335.990532 
+338007.746680  7391362.915920 
+338038.653553  7391418.696365 
+338082.746148  7391495.333238 
+338162.973726  7391634.719362 
+338198.754121  7391692.359489 
+338219.509883  7391732.442623 
+338230.172259  7391750.289566 
+338242.368434  7391771.745891 
+338248.858218  7391782.853988 
+338255.611881  7391794.961914 
+338265.573327  7391813.228785 
+338268.179136  7391826.566500 
+338272.632101  7391838.464462 
+338280.061955  7391857.291238 
+338284.696336  7391876.407963 
+338288.835944  7391901.013748 
+338289.132808  7391927.169268 
+338289.561612  7391943.666442 
+338286.287859  7391970.381866 
+338283.080075  7392002.116430 
+338318.233756  7392011.954745 
+338393.637289  7392050.198194 
+338450.701205  7392073.724165 
+338487.108314  7392093.220825 
+338586.755765  7392144.961962 
+338636.868109  7392167.808049 
+338679.402166  7392129.174666 
+338725.680013  7392087.161863 
+338742.691986  7392073.124267 
+338762.573649  7392072.234420 
+338782.950084  7392069.554879 
+338804.027450  7392059.256643 
+338828.098197  7392039.789977 
+338866.781265  7391999.996793 
+338869.156180  7391987.728895 
+338850.453729  7391938.547319 
+338844.450473  7391879.787384 
+338859.796708  7391855.181599 
+338959.435913  7391833.135375 
+339008.591694  7391850.402418 
+339035.828993  7391822.027278 
+339069.333429  7391757.288367 
+339101.576190  7391694.589107 
+339117.112089  7391650.696625 
+339127.048797  7391651.286524 
+339135.657862  7391649.116896 
+339148.101424  7391647.127237 
+339159.530699  7391645.927442 
+339168.708754  7391647.037252 
+339180.204000  7391649.636807 
+339194.783335  7391653.956067 
+339206.097164  7391660.874882 
+339292.426953  7391612.743126 
+339435.969090  7391532.706836 
+339484.621850  7391505.761451 
+339569.401347  7391463.448699 
+339601.338999  7391454.250275 
+339619.711601  7391449.231135 
+339637.490474  7391445.661746 
+339692.797943  7391432.763955 
+339765.274064  7391416.036820 
+339778.418556  7391409.417954 
+339810.092328  7391401.609292 
+339823.781070  7391399.099722 
+339857.681325  7391387.121773 
+339879.138017  7391377.113488 
+339895.242905  7391373.284144 
+339911.718874  7391363.115885 
+339993.645176  7391324.162558 
+340012.347627  7391313.834327 
+340033.474470  7391306.215632 
+340084.815502  7391280.939961 
+340113.042349  7391276.630699 
+340175.441576  7391262.863058 
+340254.992963  7391252.514830 
+340330.248064  7391250.525171 
+340355.910334  7391249.165404 
+340392.836955  7391248.555508 
+340414.392602  7391248.615498 
+340460.282875  7391247.605671 
+340506.552476  7391251.325034 
+340511.310551  7391223.279838 
+340529.221364  7391147.782770 
+340410.277733  7391129.335930 
+340349.915324  7391121.197324 
+340314.423548  7391117.457964 
+340232.505492  7391111.129048 
+340266.917013  7391014.555590 
+340275.567309  7390995.018937 
+340324.607643  7390861.331836 
+340338.057245  7390822.568476 
+340382.355996  7390706.278396 
+340561.925914  7390371.665712 
+340624.424096  7390291.769397 
+340644.198558  7390268.033463 
+340682.172450  7390220.571593 
+340717.771427  7390174.689452 
+340743.087355  7390150.953518 
+340808.743844  7390075.806390 
+340813.378225  7390063.258539 
+340841.967907  7390023.595333 
+340878.589417  7389978.523053 
+340921.238922  7389933.500765 
+340952.962172  7389897.946855 
+341001.012958  7389875.840642 
+341145.124084  7389816.100875 
+341187.410755  7389796.864170 
+341263.968761  7389722.146968 
+341284.089563  7389697.291226 
+341296.895959  7389736.724471 
+341350.117132  7389721.037158 
+341339.322816  7389695.031613 
+341336.510852  7389677.084687 
+341370.650246  7389672.065547 
+341391.974999  7389670.485817 
+341413.299751  7389658.637847 
+341517.556845  7389562.274353 
+341544.414819  7389541.737871 
+341564.947933  7389529.889900 
+341673.154971  7389469.080316 
+341763.195564  7389422.478299 
+341766.139468  7389367.297751 
+341765.141674  7389326.894672 
+341764.267574  7389305.918265 
+341762.791499  7389276.763259 
+341758.998232  7389243.728917 
+341755.460600  7389222.722515 
+341750.760248  7389203.965728 
+341835.127434  7389156.403875 
+341819.459596  7389102.823053 
+341806.372828  7389056.141049 
+341797.623577  7389026.666098 
+341787.670376  7388999.930678 
+341756.870705  7388954.908389 
+341726.071033  7388909.896100 
+341707.904587  7388880.671106 
+341695.263116  7388849.866382 
+341669.839987  7388842.297679 
+341672.363333  7388794.575853 
+341674.730001  7388702.171681 
+341673.938363  7388533.150633 
+341681.294001  7388514.493828 
+341691.321418  7388493.227471 
+341712.456507  7388464.112458 
+341738.308440  7388451.324649 
+341738.258962  7388451.264659 
+Region 1
+628
+348624.950055  7386618.428607 
+348618.419040  7386618.698561 
+348602.149227  7386623.067813 
+348592.921695  7386627.407069 
+348585.161992  7386637.395358 
+348572.784400  7386650.783065 
+348565.239099  7386659.671543 
+348562.732245  7386665.630522 
+348561.816913  7386674.918931 
+348563.639330  7386685.797068 
+348563.556868  7386694.205627 
+348562.633290  7386704.613844 
+348559.409014  7386710.002921 
+348554.890079  7386712.832437 
+348545.481130  7386715.282017 
+348526.028272  7386721.400969 
+348514.326871  7386727.699890 
+348507.358806  7386730.619390 
+348503.285168  7386730.349436 
+348500.036153  7386728.319784 
+348495.591435  7386723.960531 
+348494.502932  7386720.961044 
+348491.822907  7386713.622301 
+348488.524415  7386707.383370 
+348486.396888  7386705.703658 
+348481.721275  7386703.993951 
+348474.563547  7386705.023774 
+348468.016040  7386707.063425 
+348463.249718  7386713.882257 
+348454.780839  7386733.608878 
+348450.723694  7386740.877633 
+348445.693493  7386743.817129 
+348439.253187  7386744.966932 
+348431.608931  7386744.557003 
+348413.063159  7386741.707491 
+348383.384974  7386739.957790 
+348372.871030  7386740.957619 
+348360.979966  7386745.706806 
+348349.509459  7386750.016068 
+348339.498535  7386751.245857 
+348332.151143  7386750.615965 
+348326.362290  7386748.666299 
+348323.632787  7386745.906771 
+348323.179244  7386744.936938 
+348322.832903  7386744.537006 
+348319.740566  7386737.638188 
+348319.303516  7386730.649385 
+348320.334295  7386719.921222 
+348318.915943  7386708.833122 
+348313.959959  7386694.385597 
+348308.921512  7386678.828261 
+348305.037537  7386670.039767 
+348300.403155  7386663.790837 
+348288.396644  7386651.153002 
+348268.778861  7386633.446035 
+348260.780017  7386627.387073 
+348247.181983  7386620.818198 
+348236.107295  7386616.049015 
+348232.973727  7386612.919551 
+348229.246431  7386608.780260 
+348223.902874  7386602.301370 
+348219.045844  7386598.492022 
+348214.568141  7386597.222240 
+348206.297171  7386597.692159 
+348195.337931  7386602.001421 
+348189.458368  7386608.150368 
+348186.580434  7386619.638400 
+348184.345705  7386628.026963 
+348180.956505  7386630.876475 
+348176.256153  7386630.826484 
+348170.887857  7386626.997140 
+348166.665787  7386621.308114 
+348163.862068  7386616.079010 
+348157.900044  7386610.250008 
+348149.290979  7386603.961085 
+348139.222331  7386601.421520 
+348131.775985  7386600.791628 
+348126.053101  7386602.061411 
+348117.427544  7386606.950573 
+348106.600243  7386617.578753 
+348093.967017  7386625.757352 
+348089.777932  7386626.487227 
+348086.619626  7386625.567384 
+348084.401390  7386622.887843 
+348081.424501  7386615.219157 
+348076.171652  7386600.431690 
+348072.048536  7386584.664391 
+348069.154109  7386568.577146 
+348064.049693  7386558.998787 
+348058.821582  7386551.300106 
+348051.012402  7386546.900859 
+348040.836553  7386544.251313 
+348009.335952  7386541.591769 
+347986.988667  7386541.251827 
+347973.102015  7386542.321644 
+347966.529769  7386546.021010 
+347963.107583  7386551.740030 
+347959.908046  7386564.997759 
+347957.087835  7386571.176701 
+347950.128016  7386573.536297 
+347943.498047  7386573.026384 
+347928.316736  7386570.876752 
+347911.502672  7386568.257201 
+347894.564914  7386568.417174 
+347874.831684  7386572.196526 
+347855.436550  7386573.106371 
+347837.797862  7386571.816591 
+347799.304458  7386560.428542 
+347797.242900  7386559.548693 
+347797.209915  7386559.538695 
+347774.351364  7386549.780366 
+347756.498274  7386540.062031 
+347743.460984  7386528.194064 
+347732.674914  7386515.226285 
+347723.406151  7386503.508292 
+347713.972463  7386488.340890 
+347703.062700  7386478.482579 
+347690.586153  7386470.823891 
+347669.434571  7386464.295009 
+347652.942110  7386460.355684 
+347630.001096  7386458.895934 
+347613.137555  7386461.705453 
+347600.413621  7386467.884394 
+347583.063551  7386478.122640 
+347553.121488  7386502.278503 
+347535.524032  7386516.156126 
+347521.051897  7386524.754653 
+347513.844691  7386530.663641 
+347498.828305  7386541.691752 
+347485.955939  7386553.189782 
+347477.313890  7386559.958623 
+347468.407961  7386562.308220 
+347448.913871  7386563.428028 
+347434.458229  7386560.068604 
+347414.428135  7386553.099797 
+347394.579458  7386548.130649 
+347362.237741  7386537.712433 
+347330.794864  7386529.523836 
+347301.611453  7386520.355406 
+347272.188902  7386513.516578 
+347259.456722  7386511.166980 
+347241.405723  7386510.867032 
+347232.409086  7386511.996838 
+347225.539976  7386515.356263 
+347220.996302  7386520.175437 
+347216.823710  7386528.883945 
+347211.175042  7386542.441623 
+347201.296057  7386560.288566 
+347189.850289  7386571.686614 
+347183.475953  7386575.935886 
+347153.789523  7386594.892639 
+347140.133765  7386602.391354 
+347111.181249  7386610.170022 
+347082.245226  7386615.629087 
+347055.717102  7386615.679078 
+347031.349490  7386613.429464 
+347010.783391  7386609.230183 
+346997.251326  7386605.430834 
+346978.730292  7386600.481681 
+346970.104735  7386596.292399 
+346949.975686  7386579.245319 
+346943.997169  7386575.415975 
+346936.476606  7386572.016557 
+346927.958250  7386567.497331 
+346920.874738  7386561.768313 
+346906.270664  7386552.649875 
+346891.369725  7386543.521438 
+346877.177962  7386534.403000 
+346869.377028  7386529.443850 
+346844.720798  7386516.116132 
+346813.657247  7386500.508806 
+346793.157118  7386490.220568 
+346762.497632  7386474.943185 
+346745.667075  7386464.694940 
+346730.362071  7386454.896619 
+346708.097249  7386437.829542 
+346700.988998  7386434.210162 
+346694.276566  7386432.590440 
+346684.381089  7386432.260496 
+346677.957276  7386431.860565 
+346671.640663  7386430.800746 
+346655.642976  7386428.411156 
+346645.574328  7386425.651628 
+346636.511720  7386423.891930 
+346622.633314  7386423.531991 
+346605.398692  7386422.792118 
+346591.841889  7386421.322370 
+346573.980553  7386422.132231 
+346562.757434  7386422.012252 
+346536.237556  7386420.512508 
+346518.499914  7386419.112748 
+346506.064598  7386417.433036 
+346494.775508  7386414.543531 
+346482.768996  7386411.094122 
+346469.335887  7386407.184791 
+346461.732862  7386402.785545 
+346449.553179  7386396.786573 
+346435.938652  7386391.217526 
+346425.449447  7386388.897924 
+346411.686488  7386388.308025 
+346399.630499  7386389.177876 
+346390.840017  7386391.077550 
+346374.050691  7386395.656766 
+346360.122808  7386401.165822 
+346341.857407  7386410.824168 
+346324.515584  7386419.832625 
+346312.212208  7386425.571642 
+346290.804993  7386432.990371 
+346266.627045  7386442.588727 
+346252.872332  7386449.977461 
+346242.704730  7386455.856454 
+346211.385546  7386475.123154 
+346174.087844  7386498.989066 
+346160.300147  7386510.467100 
+346142.677952  7386526.784305 
+346119.910109  7386547.360781 
+346106.518231  7386558.848813 
+346091.501845  7386569.986905 
+346072.997303  7386583.084661 
+346055.127721  7386594.302740 
+346047.417495  7386599.871786 
+346043.599491  7386603.921092 
+346039.608315  7386614.629258 
+346035.336768  7386632.186251 
+346028.434673  7386658.251786 
+346023.841522  7386668.060106 
+346009.773453  7386685.517116 
+345992.151258  7386702.054283 
+345975.180515  7386715.172036 
+345948.602914  7386738.807987 
+345939.037286  7386746.016753 
+345924.680599  7386752.735602 
+345912.583378  7386758.034694 
+345899.892429  7386761.334129 
+345878.542938  7386763.653732 
+345863.295658  7386767.923000 
+345845.409583  7386780.020928 
+345826.542208  7386798.427775 
+345815.921063  7386809.055955 
+345812.375183  7386816.224727 
+345800.022330  7386845.109779 
+345783.818487  7386882.143435 
+345767.293040  7386910.318609 
+345761.759820  7386922.006607 
+345757.257378  7386932.924737 
+345747.914398  7386947.992156 
+345743.329494  7386957.470532 
+345737.482917  7386969.698438 
+345729.393364  7386991.984620 
+345722.062465  7387019.039986 
+345714.814029  7387048.314972 
+345708.827265  7387074.050563 
+345707.095557  7387083.448953 
+345704.885567  7387089.737876 
+345701.265472  7387094.467066 
+345693.637708  7387101.915790 
+345685.267784  7387111.344175 
+345679.215051  7387114.163692 
+345670.911097  7387118.392968 
+345662.574157  7387124.621901 
+345655.292736  7387128.421250 
+345636.557300  7387134.420223 
+345625.993878  7387138.739483 
+345611.332080  7387145.898256 
+345586.783052  7387160.805703 
+345556.799757  7387178.432684 
+345538.212753  7387189.310820 
+345515.040845  7387200.028984 
+345494.334560  7387208.337561 
+345483.795877  7387211.437030 
+345466.330360  7387212.466854 
+345455.602014  7387213.906607 
+345429.205830  7387220.275516 
+345371.317291  7387232.943346 
+345320.471033  7387244.921295 
+345285.762648  7387256.289347 
+345268.561011  7387261.758411 
+345246.007570  7387271.266782 
+345236.359480  7387276.255927 
+345228.113250  7387284.034595 
+345211.703251  7387301.251646 
+345204.974326  7387310.260103 
+345186.849111  7387345.394085 
+345173.226338  7387369.279993 
+345162.366053  7387383.337585 
+345136.604828  7387415.852016 
+345124.713763  7387430.559497 
+345114.496684  7387441.747580 
+345087.655203  7387461.404213 
+345066.190265  7387473.802090 
+345041.979331  7387486.389933 
+345016.853067  7387498.187912 
+344968.315753  7387516.554766 
+344944.929443  7387524.563395 
+344919.778439  7387529.612530 
+344902.263446  7387535.071595 
+344891.782486  7387542.270362 
+344880.542874  7387552.888543 
+344867.728232  7387568.485871 
+344847.417765  7387596.950995 
+344833.226003  7387617.287512 
+344822.266762  7387630.795198 
+344820.040280  7387638.303912 
+344807.077205  7387657.990540 
+344798.064075  7387670.178452 
+344781.192287  7387683.296205 
+344770.604127  7387690.714934 
+344753.979726  7387699.063504 
+344734.634069  7387704.612554 
+344717.770527  7387707.202110 
+344703.809659  7387705.172458 
+344688.364469  7387703.762699 
+344681.907670  7387702.442925 
+344671.204063  7387700.733218 
+344663.493837  7387698.773554 
+344654.117873  7387748.874972 
+344643.826577  7387769.441449 
+344625.643638  7387801.086029 
+344607.435961  7387817.693184 
+344584.503194  7387839.849389 
+344582.919917  7387844.588577 
+344545.745910  7387891.260583 
+344527.546479  7387923.695027 
+344507.772018  7387941.102045 
+344482.621014  7387943.091704 
+344469.798125  7387959.298928 
+344455.342483  7387976.805930 
+344449.512398  7387993.163128 
+344443.632836  7388015.229348 
+344447.186961  7388048.063724 
+344452.373840  7388067.560384 
+344458.278141  7388091.256325 
+344464.957588  7388113.822460 
+344472.057593  7388130.669574 
+344479.190582  7388143.687344 
+344488.550054  7388164.373801 
+344512.521846  7388204.886861 
+344534.168202  7388220.074260 
+344561.751843  7388247.759518 
+344582.078802  7388276.164652 
+344586.548259  7388288.412554 
+344592.889610  7388305.999542 
+344609.002745  7388338.943899 
+344613.488695  7388350.041998 
+344621.330860  7388369.948588 
+344635.588593  7388396.004125 
+344655.511486  7388429.358411 
+344678.468992  7388462.742693 
+344742.723621  7388539.519542 
+344707.908035  7388601.258966 
+344673.249128  7388648.450883 
+344664.409169  7388659.439001 
+344647.784768  7388685.894469 
+344617.999383  7388724.997771 
+344611.699262  7388735.276010 
+344588.453138  7388761.841460 
+344573.989250  7388775.309153 
+344560.407708  7388785.597391 
+344548.112578  7388790.206601 
+344534.308388  7388794.015949 
+344514.509188  7388794.235911 
+344493.769918  7388786.457244 
+344471.562819  7388776.338977 
+344431.436661  7388767.270530 
+344403.572647  7388770.320008 
+344380.408985  7388786.367259 
+344317.910803  7388845.687098 
+344291.803237  7388866.263573 
+344247.487993  7388878.311510 
+344275.343761  7388937.651345 
+344297.361196  7388985.803097 
+344315.057607  7389024.316500 
+344326.618823  7389052.931599 
+344277.578489  7389086.155908 
+344232.479854  7389121.769808 
+344188.189349  7389145.835685 
+344160.490260  7389157.373709 
+344091.667219  7389207.995038 
+343954.177816  7389319.795887 
+343933.636455  7389312.687105 
+343899.678477  7389324.535076 
+343849.920722  7389339.542505 
+343759.088491  7389370.347229 
+343684.847676  7389396.412764 
+343647.723146  7389408.260734 
+343556.280694  7389407.100933 
+343424.959471  7389450.123564 
+343346.801697  7389492.776258 
+343297.827333  7389533.839224 
+343254.386190  7389578.071647 
+343272.931963  7389623.483868 
+343300.194002  7389686.283112 
+343359.500892  7389827.928849 
+343368.093465  7389852.134703 
+343425.091411  7389976.823345 
+343456.517796  7390055.299902 
+343478.238368  7390108.400807 
+343542.657921  7390260.874689 
+343554.285107  7390292.379293 
+343578.949582  7390359.227842 
+343591.219974  7390388.512826 
+343627.915700  7390476.117820 
+343666.491567  7390554.604376 
+343664.232100  7390573.751096 
+343659.482271  7390595.647346 
+343657.057879  7390606.285523 
+343648.292136  7390625.042311 
+343623.965756  7390672.784133 
+343581.283266  7390750.190874 
+343537.767907  7390829.067363 
+343523.873008  7390860.571967 
+343496.000748  7390918.891977 
+343475.591328  7390947.437087 
+343437.444265  7390999.768123 
+343499.142562  7390983.950833 
+343526.899375  7390982.851021 
+343557.682554  7390998.978259 
+343566.588483  7391003.997399 
+343576.450975  7391006.806918 
+343619.380851  7391029.043109 
+343654.773673  7391049.489607 
+343671.595984  7391056.728367 
+343684.781707  7391066.896625 
+343710.848042  7391075.585137 
+343741.655959  7391073.215543 
+343768.060390  7391064.677005 
+343794.374112  7391057.928161 
+343826.427210  7391048.609757 
+343928.837149  7391016.355282 
+343968.328347  7391005.297176 
+344004.661240  7390992.659341 
+344028.377399  7390987.510223 
+344047.360222  7390980.391443 
+344080.576039  7390971.682934 
+344080.584285  7390971.682934 
+344090.867335  7390965.364017 
+344208.738956  7390876.759194 
+344291.011599  7390883.088110 
+344333.727074  7390886.257567 
+344357.731851  7390887.677324 
+344410.466496  7390894.166212 
+344457.140161  7390897.325671 
+344506.972133  7390902.864722 
+344552.070769  7390909.193638 
+344596.369520  7390914.732689 
+344613.043398  7390915.402575 
+344646.201491  7390918.682013 
+344697.616740  7390926.600656 
+344761.706444  7390934.509302 
+344786.222488  7390936.878896 
+344807.910074  7390937.458796 
+344817.739581  7390934.599286 
+344827.882445  7390928.310364 
+344840.812535  7390925.810792 
+344929.410037  7390874.389600 
+344983.991837  7390852.233395 
+345006.701957  7390837.985835 
+345043.323467  7390825.338002 
+345056.146356  7390819.509000 
+345070.107224  7390813.909959 
+345089.213741  7390804.771525 
+345106.580302  7390793.013539 
+345130.156276  7390774.256752 
+345141.395888  7390765.658224 
+345149.328762  7390756.519790 
+345188.003584  7390719.026212 
+345229.531601  7390684.702091 
+345238.899319  7390678.043232 
+345250.757399  7390674.673809 
+345284.599929  7390662.295929 
+345303.607491  7390662.315926 
+345319.613425  7390663.535717 
+345391.949360  7390687.321643 
+345467.377632  7390713.707123 
+345506.308087  7390720.585945 
+345538.542602  7390722.505616 
+345566.381877  7390720.206010 
+345600.447056  7390712.697296 
+345633.860782  7390701.719177 
+345677.722483  7390675.953590 
+345689.225975  7390667.705003 
+345772.290256  7390589.388418 
+345820.126640  7390549.035330 
+345848.238040  7390525.309394 
+345864.903673  7390511.921687 
+345922.990121  7390469.149014 
+345960.568194  7390446.992809 
+345991.499805  7390433.065195 
+346028.929446  7390421.347202 
+346068.940157  7390415.348229 
+346121.518124  7390407.269613 
+346124.049717  7390406.149805 
+346162.262750  7390396.271497 
+346216.077651  7390380.554189 
+346251.132377  7390365.706732 
+346259.733196  7390332.622399 
+346258.619955  7390312.675816 
+346260.425879  7390295.528753 
+346260.211477  7390267.953477 
+346257.721116  7390242.447846 
+346257.539699  7390211.333175 
+346257.366528  7390178.988716 
+346260.549573  7390148.014021 
+346266.519844  7390104.881409 
+346272.160266  7390073.496785 
+346274.139361  7390050.030805 
+346272.152019  7390025.764961 
+346266.412643  7390008.197970 
+346261.753522  7389985.341885 
+346290.829732  7389970.594412 
+346353.327914  7389942.909154 
+346446.666998  7389901.756203 
+346482.265976  7389883.559320 
+346533.689470  7389855.884060 
+346555.838846  7389846.395686 
+346596.971044  7389825.029346 
+346613.529476  7389818.170520 
+346642.853072  7389803.673004 
+346682.088637  7389785.596100 
+346689.526737  7389776.777611 
+346727.500629  7389688.172788 
+346744.900176  7389680.264143 
+346789.207173  7389664.446852 
+346824.006267  7389647.039834 
+346862.763551  7389631.212545 
+346901.537327  7389614.605389 
+346914.986929  7389609.066338 
+346937.136305  7389666.816446 
+346942.661279  7389666.016583 
+346945.036194  7389651.779022 
+346998.826356  7389631.212545 
+347092.247903  7389602.337491 
+347103.372068  7389624.803642 
+347111.766731  7389630.872603 
+347120.920047  7389635.421824 
+347132.506001  7389637.541461 
+347155.463507  7389628.053086 
+347179.979551  7389628.842951 
+347198.962374  7389644.390287 
+347263.843717  7389716.647910 
+347274.910158  7389735.634658 
+347278.076711  7389752.251812 
+347277.293319  7389756.211134 
+347325.542015  7389768.079101 
+347351.806259  7389759.660543 
+347365.882575  7389756.201135 
+347384.873644  7389768.069102 
+347414.931155  7389775.977748 
+347456.863238  7389777.567475 
+347455.032574  7389732.195247 
+347452.072178  7389660.187581 
+347444.642324  7389611.815867 
+347434.227335  7389576.031997 
+347427.663335  7389551.276237 
+347422.270300  7389537.198648 
+347408.606296  7389490.406663 
+347349.266420  7389358.289294 
+347304.398679  7389191.807811 
+347311.721332  7389112.731356 
+347320.503568  7389014.618162 
+347283.568701  7388977.594503 
+347309.140262  7388908.016422 
+347324.527728  7388857.994990 
+347337.993823  7388809.903227 
+347336.072451  7388756.032455 
+347328.378718  7388709.860364 
+347314.912623  7388659.848930 
+347282.208073  7388498.246611 
+347270.663350  7388452.074520 
+347243.731160  7388357.810667 
+347211.026610  7388311.638576 
+347161.013221  7388255.848132 
+347116.763947  7388211.605710 
+347070.593302  7388194.288677 
+347005.175954  7388171.202631 
+346951.484746  7388056.922206 
+347316.833995  7388213.535380 
+347382.243097  7388246.239778 
+347477.115980  7388277.604405 
+347543.613584  7388296.081241 
+347815.467070  7388387.875517 
+347900.848542  7388413.761083 
+348155.195280  7388475.740467 
+348188.287404  7388482.649283 
+348226.178833  7388490.307971 
+348332.382038  7388519.662943 
+348377.777538  7388513.813945 
+348449.536237  7388462.552725 
+348518.004690  7388356.880826 
+348540.327236  7388321.976805 
+348566.542003  7388145.996949 
+348543.642221  7388151.625984 
+348523.826529  7388153.885597 
+348486.248456  7388152.355859 
+348451.103020  7388143.267416 
+348414.456772  7388120.881251 
+348437.397785  7388051.263176 
+348474.967612  7387896.399702 
+348505.833253  7387775.370434 
+348543.180432  7387642.613174 
+348546.173814  7387621.106858 
+348569.057104  7387545.669779 
+348579.216460  7387531.412221 
+348599.180584  7387515.814893 
+348644.246235  7387422.550868 
+348664.367037  7387377.438596 
+348666.403856  7387355.312386 
+348664.647409  7387325.667464 
+348657.588636  7387298.502117 
+348654.554023  7387279.775325 
+348655.287938  7387242.481713 
+348665.612218  7387218.465826 
+348677.346605  7387184.311677 
+348680.290509  7387132.590536 
+348680.331740  7387092.227450 
+348681.082147  7387054.943836 
+348683.440569  7387031.767806 
+348686.590629  7387007.461969 
+348691.802247  7386993.864299 
+348696.881925  7386968.078715 
+348700.708176  7386947.602223 
+348698.852774  7386921.416708 
+348686.186564  7386870.785381 
+348679.869951  7386843.889988 
+348670.378540  7386813.835136 
+348667.211987  7386750.545977 
+348643.759707  7386622.447919 
+348624.950055  7386618.428607 
+Region 1
+693
+358421.125722  7403268.426613 
+358437.626429  7403275.425415 
+358452.123303  7403278.924815 
+358470.116578  7403276.425243 
+358483.615658  7403268.426613 
+358494.616129  7403256.928583 
+358510.605571  7403229.433293 
+358530.107906  7403202.437917 
+358547.103387  7403189.440143 
+358575.594114  7403176.442369 
+358600.093666  7403166.943996 
+358619.587755  7403161.944853 
+358656.580345  7403157.945538 
+358684.073278  7403158.945366 
+358709.570624  7403166.943996 
+358727.572145  7403180.441684 
+358742.563792  7403199.438430 
+358756.062872  7403226.433806 
+358757.563686  7403244.930638 
+358754.067284  7403254.928925 
+358742.069019  7403264.427298 
+358706.074222  7403277.924986 
+358681.079897  7403286.923445 
+358669.081631  7403289.922931 
+358658.584180  7403294.422161 
+358651.080110  7403301.920876 
+358646.082894  7403309.919506 
+358645.085100  7403320.417708 
+358649.579296  7403333.915396 
+358659.078953  7403350.412570 
+358674.581867  7403366.409830 
+358692.575142  7403381.907175 
+358705.076428  7403391.905463 
+358733.567155  7403409.402465 
+358744.567626  7403418.900838 
+358769.058932  7403453.894844 
+358783.555805  7403474.391333 
+358796.057091  7403485.889364 
+358815.056406  7403496.387566 
+358827.046425  7403499.886966 
+358844.050153  7403498.387223 
+358861.540408  7403494.387908 
+358876.540302  7403487.889021 
+358886.542980  7403478.890563 
+358893.041009  7403464.892960 
+358901.534627  7403449.395615 
+358912.032078  7403440.397156 
+358918.084812  7403406.143024 
+358924.310716  7403371.828901 
+358926.949510  7403346.343267 
+358931.872509  7403320.617673 
+358934.494811  7403297.401650 
+358941.256720  7403256.018739 
+358948.975192  7403230.303144 
+358955.176357  7403201.548069 
+358964.403889  7403178.352042 
+358974.653954  7403154.406144 
+358990.989737  7403129.460417 
+359007.317274  7403109.323866 
+359018.029127  7403094.466411 
+359030.802538  7403074.559821 
+359043.303824  7403056.422928 
+359056.835889  7403036.276379 
+359071.662611  7403010.320825 
+359077.055646  7402993.933632 
+359085.005013  7402972.757259 
+359087.602575  7402956.859982 
+359093.020349  7402935.673611 
+359102.750901  7402911.727713 
+359118.336277  7402885.772159 
+359131.084949  7402870.674745 
+359147.890767  7402857.347028 
+359191.645267  7402831.231501 
+359197.755724  7402826.962232 
+359218.626934  7402810.615032 
+359230.097441  7402798.787058 
+359241.856566  7402777.880639 
+359246.235314  7402761.483448 
+359246.334269  7402735.737858 
+359246.424977  7402713.021749 
+359246.540425  7402683.486808 
+359245.864234  7402660.260787 
+359245.699309  7402638.294549 
+359245.105581  7402596.391727 
+359245.740540  7402563.077433 
+359247.092922  7402542.380978 
+359250.960404  7402525.233916 
+359253.566213  7402508.076854 
+359242.161676  7402503.897570 
+359176.727836  7402484.800841 
+359131.703417  7402472.173004 
+359087.957163  7402451.566534 
+359057.602788  7402437.518940 
+359009.898344  7402414.352908 
+358962.523749  7402388.397354 
+358917.656008  7402361.651936 
+358872.491403  7402335.306448 
+358828.778134  7402312.430367 
+358780.216082  7402284.505150 
+358734.268084  7402258.919533 
+358692.121600  7402234.173771 
+358646.899271  7402210.497827 
+358591.929897  7402179.033217 
+358564.799798  7402164.825650 
+358523.576891  7402143.569291 
+358480.811939  7402119.133477 
+358439.778696  7402095.147585 
+358393.641035  7402072.261506 
+358351.981078  7402049.375426 
+358283.496132  7402010.452093 
+358248.276481  7401982.366904 
+358186.165872  7401945.723180 
+358127.353755  7401904.070315 
+358069.176598  7401832.972494 
+357707.249535  7401412.134579 
+357576.678719  7401300.513699 
+357516.844069  7401226.606359 
+357445.456450  7401181.944009 
+357401.693704  7401161.747468 
+357338.387392  7401144.500423 
+357046.808922  7401127.353360 
+356501.015654  7401093.349184 
+356471.057098  7401095.528811 
+356449.493205  7401093.189212 
+356422.594001  7401092.089400 
+356392.643691  7401093.759114 
+356374.576200  7401092.499330 
+356142.675702  7401107.746718 
+355914.807610  7401134.702101 
+355875.423613  7401138.321481 
+355763.497524  7401149.569554 
+355718.778215  7401154.298744 
+355552.657899  7401170.745927 
+355478.656225  7401173.895388 
+355353.692846  7401188.592870 
+355169.933842  7401203.300351 
+355061.875236  7401219.677546 
+354955.639046  7401235.564824 
+354839.787752  7401250.642242 
+354723.985935  7401267.009438 
+354654.033160  7401277.627619 
+354578.646120  7401280.797076 
+354543.731579  7401283.976532 
+354495.317959  7401288.735716 
+354447.687731  7401293.524896 
+354415.980974  7401296.844328 
+354406.440085  7401297.464221 
+354399.298849  7401303.813134 
+354264.209099  7401307.322533 
+354118.786821  7401318.460625 
+354002.506723  7401333.967969 
+353786.529696  7401356.164167 
+353556.097027  7401378.870277 
+353400.210283  7401391.408130 
+353398.668238  7401399.726705 
+353396.821082  7401405.275756 
+353394.355459  7401408.355227 
+353391.889836  7401410.824804 
+353386.035012  7401411.434699 
+353372.478209  7401411.434699 
+353353.990160  7401410.204910 
+353344.127668  7401412.364540 
+353339.814890  7401416.063906 
+353336.120578  7401423.142694 
+353334.578533  7401429.921533 
+353333.654955  7401441.019632 
+353333.341599  7401450.258049 
+353335.502111  7401459.506465 
+353343.204090  7401486.931767 
+353350.906070  7401509.727863 
+353359.226517  7401530.064379 
+353372.783320  7401552.560526 
+353381.103767  7401567.957888 
+353388.500635  7401581.825513 
+353395.279037  7401596.922927 
+353408.835840  7401619.419073 
+353423.316221  7401646.834377 
+353433.277668  7401664.651326 
+353443.651426  7401681.038519 
+353447.964205  7401690.586883 
+353456.903119  7401729.410233 
+353459.368742  7401752.216326 
+353460.292319  7401775.322369 
+353459.781053  7401781.101379 
+353457.826696  7401796.888674 
+353450.124717  7401854.198858 
+353437.796602  7401932.765400 
+353434.712512  7401953.721810 
+353427.818663  7401980.027304 
+353420.850598  7402007.642574 
+353411.301463  7402029.828774 
+353404.044780  7402037.947383 
+353404.646755  7402038.407305 
+353372.593656  7402079.750223 
+353339.179930  7402122.042978 
+353300.966897  7402157.266945 
+353263.817628  7402182.392641 
+353236.596821  7402205.138745 
+353224.887173  7402214.697108 
+353213.795993  7402221.785893 
+353199.315612  7402229.484575 
+353167.757287  7402239.842800 
+353154.002575  7402244.761958 
+353134.343561  7402256.060023 
+353108.796738  7402265.888339 
+353075.877785  7402277.676320 
+353027.719798  7402292.913710 
+352992.838243  7402303.231942 
+352946.824276  7402314.340040 
+352962.228235  7402319.269195 
+352981.334751  7402330.977190 
+352998.585865  7402351.313706 
+353007.829890  7402367.330963 
+353012.142669  7402383.968113 
+353014.608292  7402398.755580 
+353014.608292  7402422.791463 
+353013.379603  7402450.526712 
+353013.379603  7402473.942701 
+353017.692382  7402501.667952 
+353024.470783  7402520.154786 
+353031.249185  7402540.491302 
+353036.180431  7402559.598029 
+353034.333275  7402576.235179 
+353020.776472  7402597.801485 
+352996.738710  7402623.687051 
+352982.563439  7402639.704308 
+352974.556349  7402663.740191 
+352976.403505  7402684.076707 
+352988.113153  7402700.093964 
+353013.379603  7402711.192063 
+353030.020497  7402714.881431 
+353056.515636  7402714.881431 
+353079.934931  7402709.952275 
+353108.895693  7402701.323753 
+353139.093389  7402692.705229 
+353178.526864  7402695.164808 
+353211.091229  7402710.022263 
+353258.086498  7402749.015584 
+353274.578959  7402767.512415 
+353284.078617  7402771.011816 
+353301.577118  7402772.011645 
+353314.078404  7402769.012159 
+353330.570865  7402761.013529 
+353348.069367  7402756.514299 
+353363.069260  7402752.514984 
+353381.565555  7402756.014385 
+353401.059645  7402762.013357 
+353416.554312  7402771.511730 
+353436.551421  7402789.008733 
+353451.551315  7402805.005993 
+353470.542384  7402829.501797 
+353474.541806  7402842.499571 
+353475.547846  7402861.996231 
+353473.544012  7402874.994005 
+353468.546796  7402888.991607 
+353457.051551  7402900.489638 
+353436.551421  7402909.488096 
+353395.559409  7402923.985613 
+353368.066476  7402935.983558 
+353347.071573  7402949.481246 
+353327.074463  7402973.977050 
+353316.073992  7402997.473025 
+353314.078404  7403017.469600 
+353319.075620  7403037.966089 
+353334.067267  7403075.959581 
+353346.065532  7403087.957526 
+353359.564612  7403093.456584 
+353381.062535  7403095.456242 
+353408.555468  7403093.456584 
+353470.542384  7403079.458982 
+353525.454034  7403064.011628 
+353591.522834  7403037.966089 
+353616.022385  7403022.968658 
+353626.519837  7403014.970028 
+353631.517053  7403004.471826 
+353634.015660  7402989.974310 
+353640.513690  7402949.981160 
+353645.510906  7402936.983387 
+353656.008358  7402923.985613 
+353670.010457  7402917.486726 
+353732.500393  7402898.489980 
+353793.984289  7402885.992121 
+353828.478272  7402869.494947 
+353849.976195  7402856.997087 
+353867.474696  7402852.497858 
+353885.467972  7402855.997259 
+353897.466237  7402861.496317 
+353905.465081  7402874.494090 
+353906.965895  7402888.991607 
+353905.465081  7402906.988524 
+353898.967051  7402917.986641 
+353887.471806  7402926.985099 
+353863.970048  7402936.483472 
+353845.473753  7402944.982016 
+353827.975252  7402955.980133 
+353817.980820  7402972.477307 
+353814.979192  7402992.973796 
+353817.477800  7403012.970371 
+353822.483262  7403024.468401 
+353830.482106  7403031.467202 
+353840.476537  7403035.466517 
+353851.971783  7403036.966260 
+353877.469128  7403037.966089 
+353905.465081  7403034.466689 
+353934.458828  7403034.466689 
+353962.454781  7403039.465832 
+353986.946086  7403048.464291 
+353998.449578  7403062.461893 
+354003.949814  7403079.458982 
+354005.945401  7403096.456070 
+354004.444587  7403114.452988 
+353996.948764  7403139.948620 
+353975.953860  7403194.939201 
+353964.953389  7403237.431922 
+353964.953389  7403265.427127 
+353968.449791  7403291.422674 
+353980.951076  7403323.917108 
+353992.949342  7403342.913854 
+354015.948079  7403366.909744 
+354028.944139  7403377.907860 
+354060.436493  7403395.904777 
+354103.143722  7403415.361445 
+354117.426193  7403421.400410 
+354136.425509  7403430.398869 
+354152.917970  7403437.397670 
+354230.902573  7403486.889193 
+354257.900733  7403500.886795 
+354282.895058  7403508.885425 
+354303.889961  7403511.884911 
+354328.389512  7403509.885254 
+354351.883023  7403502.886452 
+354391.877242  7403487.389107 
+354452.866364  7403455.894502 
+354509.353044  7403437.897584 
+354567.843558  7403425.399725 
+354581.837411  7403422.900153 
+354620.833836  7403421.900325 
+354635.330709  7403419.900667 
+354669.321672  7403414.901524 
+354689.821801  7403411.402123 
+354724.315784  7403410.402294 
+354767.303384  7403405.903065 
+354801.797367  7403399.904092 
+354838.789958  7403397.404521 
+354867.288931  7403396.404692 
+354879.781971  7403392.405377 
+354891.285462  7403383.406918 
+354899.779080  7403369.409316 
+354908.280944  7403352.912142 
+354926.274219  7403336.414968 
+354940.276319  7403326.916595 
+354960.265182  7403322.417365 
+354981.763105  7403312.918992 
+354997.266019  7403302.920705 
+355015.259294  7403297.421647 
+355040.756639  7403287.923274 
+355057.562457  7403281.674344 
+355079.744817  7403273.425757 
+355106.742977  7403260.927898 
+355121.239850  7403256.428668 
+355139.233125  7403254.429011 
+355158.232441  7403255.928754 
+355166.231284  7403261.427812 
+355168.729892  7403272.925843 
+355171.228500  7403287.423359 
+355169.232912  7403300.921047 
+355164.227450  7403314.918650 
+355156.228607  7403342.413940 
+355153.235225  7403362.910429 
+355155.230813  7403387.406233 
+355163.229657  7403408.402637 
+355177.726530  7403428.399211 
+355207.223297  7403444.896386 
+355243.218094  7403461.393560 
+355274.207429  7403475.391162 
+355302.706402  7403475.391162 
+355321.705717  7403472.391676 
+355347.697836  7403456.394416 
+355366.194131  7403439.397328 
+355381.004362  7403420.690532 
+355394.684858  7403403.403493 
+355412.686380  7403374.408460 
+355417.180576  7403358.911114 
+355424.181625  7403332.415653 
+355431.182675  7403312.419078 
+355439.181519  7403296.921732 
+355442.677921  7403286.923445 
+355444.178735  7403280.924473 
+355451.179784  7403275.925329 
+355459.673402  7403272.925843 
+355476.668883  7403266.926870 
+355503.164022  7403266.926870 
+355531.662996  7403269.926356 
+355552.154879  7403280.924473 
+355571.154194  7403292.922417 
+355591.151303  7403306.920020 
+355601.648755  7403321.417536 
+355604.147363  7403339.414454 
+355602.151775  7403360.910772 
+355594.647705  7403384.406747 
+355584.150254  7403397.404521 
+355560.153722  7403412.401952 
+355524.661946  7403420.900496 
+355493.672611  7403427.399383 
+355487.174581  7403436.897756 
+355486.671561  7403455.394587 
+355490.167963  7403466.392704 
+355501.671455  7403476.890905 
+355513.166700  7403484.389621 
+355534.161603  7403498.387223 
+355550.159291  7403511.884911 
+355567.154772  7403532.381400 
+355586.648862  7403551.878061 
+355625.142266  7403585.372323 
+355656.642867  7403608.368384 
+355690.130810  7403632.864188 
+355726.125607  7403654.860421 
+355738.379505  7403661.749241 
+355758.120982  7403672.857338 
+355781.614493  7403688.854598 
+355796.614386  7403699.352800 
+355809.107426  7403705.351772 
+355829.104535  7403705.851686 
+355855.104900  7403700.852543 
+355871.102588  7403697.853056 
+355896.096913  7403701.352457 
+355925.585434  7403705.851686 
+355954.084407  7403705.351772 
+355973.578496  7403701.352457 
+355989.081410  7403691.354170 
+355997.575027  7403681.355882 
+356001.071429  7403667.858194 
+355998.572821  7403651.860935 
+355989.576183  7403633.864017 
+355986.079782  7403622.865901 
+355983.078154  7403610.867956 
+355985.081988  7403596.370440 
+355990.573977  7403588.871724 
+356006.571665  7403579.873265 
+356054.061707  7403562.376262 
+356131.551536  7403540.879945 
+356199.038688  7403527.382257 
+356229.030229  7403517.883884 
+356245.027916  7403506.885767 
+356252.028966  7403494.387908 
+356256.531408  7403477.390820 
+356259.524790  7403459.393902 
+356254.527574  7403438.397499 
+356246.528730  7403423.899982 
+356233.029651  7403406.402979 
+356198.040894  7403378.407775 
+356156.545862  7403356.911457 
+356074.058816  7403317.418222 
+356046.071110  7403302.420790 
+356026.074000  7403283.424044 
+356016.574343  7403268.426613 
+356009.573293  7403241.931152 
+356010.571087  7403222.434491 
+356015.073529  7403203.937660 
+356028.069588  7403189.940057 
+356045.065069  7403180.941599 
+356067.560787  7403180.441684 
+356124.550487  7403189.440143 
+356213.032542  7403206.437232 
+356263.524212  7403212.936118 
+356287.025969  7403210.936461 
+356308.020872  7403202.437917 
+356326.014148  7403187.940400 
+356339.513227  7403169.443568 
+356341.508815  7403150.946737 
+356339.513227  7403137.948963 
+356331.011363  7403131.949991 
+356321.016932  7403127.450761 
+356308.020872  7403127.450761 
+356273.023869  7403125.951018 
+356254.527574  7403122.951532 
+356230.531043  7403116.452645 
+356208.538346  7403107.454186 
+356196.540080  7403090.457098 
+356190.536824  7403063.461722 
+356191.039844  7403041.965404 
+356195.039266  7403021.968829 
+356210.533934  7402995.473368 
+356236.534299  7402969.477821 
+356254.024554  7402954.980304 
+356270.022242  7402941.982530 
+356285.022135  7402927.485014 
+356303.015410  7402916.986812 
+356321.932263  7402910.227970 
+356333.015197  7402905.988696 
+356354.513121  7402901.989381 
+356377.503612  7402905.488781 
+356390.499671  7402919.986298 
+356398.003741  7402941.482616 
+356419.501664  7403007.471313 
+356426.494468  7403026.967973 
+356437.997960  7403043.965062 
+356455.991235  7403058.462578 
+356469.985088  7403062.961808 
+356486.485796  7403061.462064 
+356498.978835  7403056.962835 
+356509.484533  7403048.964205 
+356512.477915  7403040.965575 
+356512.477915  7403030.967288 
+356510.977101  7403017.469600 
+356502.978257  7402987.474738 
+356502.978257  7402968.477992 
+356503.984297  7402952.480732 
+356507.983719  7402939.482958 
+356517.978151  7402925.985270 
+356533.472818  7402906.988524 
+356579.965067  7402868.995032 
+356593.464146  7402856.997087 
+356597.463568  7402842.499571 
+356597.463568  7402829.001883 
+356591.963332  7402817.003938 
+356574.464831  7402809.505222 
+356547.969692  7402806.005822 
+356515.479543  7402801.506593 
+356492.480806  7402790.508476 
+356475.485324  7402774.511217 
+356470.488109  7402759.513785 
+356470.991129  7402740.517039 
+356475.988344  7402721.020379 
+356489.487424  7402703.523376 
+356533.472818  7402666.529713 
+356563.967379  7402638.534508 
+356593.464146  7402613.538790 
+356617.963697  7402592.542386 
+356634.456159  7402577.544955 
+356639.956395  7402564.047267 
+356640.459415  7402547.550093 
+356636.954767  7402529.053261 
+356623.958707  7402510.556430 
+356605.965432  7402498.558485 
+356586.463096  7402494.059255 
+356560.817319  7402483.131127 
+356541.405692  7402477.952014 
+356519.808814  7402476.712227 
+356501.304272  7402476.092333 
+356477.860239  7402476.712227 
+356455.026426  7402478.561910 
+356439.605975  7402470.543284 
+356425.653353  7402453.926130 
+356418.495624  7402423.071415 
+356422.495046  7402391.576810 
+356416.994810  7402357.582633 
+356404.996545  7402326.587942 
+356391.002691  7402300.092480 
+356379.507446  7402265.598389 
+356376.002798  7402233.103955 
+356379.004426  7402206.608493 
+356383.003848  7402167.115258 
+356384.001642  7402134.120910 
+356386.005476  7402104.126047 
+356388.001063  7402083.129644 
+356395.999907  7402060.633497 
+356409.498987  7402029.638806 
+356420.499458  7402014.141461 
+356435.491106  7402000.143859 
+356451.488793  7401990.145571 
+356474.990550  7401981.147113 
+356494.987660  7401977.147798 
+356527.980829  7401977.647712 
+356553.972948  7401980.647198 
+356572.972263  7401988.145914 
+356587.963910  7401996.644458 
+356607.466246  7402014.141461 
+356637.457787  7402053.634696 
+356649.950826  7402069.132042 
+356660.951298  7402077.130672 
+356672.949563  7402083.629558 
+356684.444809  7402087.628873 
+356693.944467  7402087.628873 
+356704.441918  7402086.129130 
+356717.940998  7402078.630415 
+356727.440655  7402067.132384 
+356739.941941  7402046.635895 
+356756.434402  7402029.638806 
+356768.432668  7402021.640177 
+356783.432562  7402012.141804 
+356798.927229  7401997.144372 
+356829.421790  7401972.148654 
+356844.421683  7401958.151052 
+356851.917507  7401943.153621 
+356860.914145  7401917.158073 
+356867.412174  7401898.161327 
+356886.411490  7401882.164068 
+356906.408599  7401876.665010 
+356926.405709  7401877.164924 
+356939.047180  7401877.574854 
+356946.402818  7401879.664496 
+356955.894229  7401885.663468 
+356963.398299  7401894.162012 
+356968.395515  7401909.659358 
+356969.393309  7401933.655248 
+356965.393887  7401955.651480 
+356956.900269  7401983.146770 
+356952.397828  7402001.643602 
+356954.896435  7402019.140605 
+356961.394465  7402037.637436 
+356970.399349  7402064.632812 
+356994.387634  7402120.623222 
+357021.888813  7402182.112689 
+357032.881039  7402215.107037 
+357048.878726  7402256.599930 
+357061.380012  7402289.094364 
+357069.873629  7402298.592737 
+357079.373287  7402308.591024 
+357104.870632  7402324.588284 
+357122.369134  7402330.587257 
+357139.364615  7402331.587085 
+357159.361724  7402329.587428 
+357172.357784  7402322.588627 
+357192.857913  7402304.591710 
+357215.848404  7402272.597190 
+357235.845514  7402249.101215 
+357247.843779  7402242.602328 
+357258.844251  7402236.103441 
+357275.336712  7402218.606438 
+357293.338234  7402199.609692 
+357312.329303  7402185.612090 
+357332.326412  7402182.112689 
+357366.325621  7402185.612090 
+357394.816348  7402197.610035 
+357424.807889  7402224.105496 
+357442.306390  7402244.601985 
+357458.807098  7402265.598389 
+357547.289153  7402361.082033 
+357579.779301  7402397.075868 
+357628.770158  7402435.069360 
+357670.265190  7402464.564308 
+357710.754183  7402499.558314 
+357739.253156  7402530.553004 
+357764.247481  7402548.549922 
+357793.241228  7402564.547182 
+357811.737523  7402573.045726 
+357842.735104  7402588.043157 
+357871.728851  7402594.542044 
+357897.720970  7402594.042129 
+357922.220521  7402588.543071 
+357948.715661  7402577.045041 
+357978.204181  7402553.049151 
+358014.701998  7402515.555573 
+358036.199921  7402490.059941 
+358060.691226  7402469.563451 
+358109.187309  7402434.069531 
+358137.175016  7402419.572014 
+358163.175381  7402409.573727 
+358183.172490  7402403.574755 
+358206.666001  7402403.074840 
+358228.163925  7402409.073813 
+358250.659642  7402424.571158 
+358279.653389  7402441.068332 
+358296.648870  7402452.566363 
+358313.644352  7402462.064736 
+358323.647029  7402471.563109 
+358331.645873  7402489.060112 
+358339.644717  7402512.556087 
+358366.634630  7402571.046068 
+358390.128141  7402636.534851 
+358402.629426  7402657.531254 
+358413.629898  7402670.529028 
+358430.122359  7402681.027230 
+358443.118419  7402696.024661 
+358448.618655  7402716.021235 
+358452.618077  7402742.016783 
+358452.618077  7402767.012501 
+358447.620861  7402790.008562 
+358440.125037  7402813.504537 
+358429.627586  7402832.501283 
+358414.627692  7402854.497516 
+358400.130819  7402876.993662 
+358388.635573  7402903.489124 
+358381.634523  7402933.983900 
+358371.631845  7402993.473710 
+358368.135444  7403023.968487 
+358371.137072  7403048.964205 
+358375.136494  7403067.960951 
+358382.632317  7403080.458811 
+358403.132447  7403097.455899 
+358417.629320  7403113.453159 
+358428.621545  7403121.451789 
+358437.123409  7403129.450419 
+358438.624223  7403145.447679 
+358436.620389  7403163.944510 
+358432.126194  7403181.941427 
+358427.623752  7403192.439629 
+358412.623858  7403206.937146 
+358404.130240  7403224.434149 
+358404.130240  7403241.431237 
+358410.628270  7403254.429011 
+358421.125722  7403268.426613 
+Region 1
+420
+349823.152107  7402538.021725 
+349788.641631  7402520.774679 
+349760.299337  7402503.517635 
+349730.101640  7402490.579851 
+349707.300812  7402486.260591 
+349680.805673  7402488.730168 
+349661.080690  7402493.039430 
+349648.142354  7402500.438163 
+349631.501460  7402512.766051 
+349612.403190  7402536.791936 
+349596.999231  7402563.287397 
+349585.908051  7402596.571696 
+349579.739870  7402631.075786 
+349577.274247  7402664.350086 
+349574.808625  7402698.244280 
+349574.808625  7402713.651641 
+349577.892715  7402730.288791 
+349580.976805  7402742.616680 
+349580.976805  7402750.005414 
+349577.892715  7402756.174358 
+349571.732780  7402762.333303 
+349565.572846  7402763.563092 
+349559.404666  7402766.652563 
+349544.000707  7402775.890980 
+349521.199879  7402795.607603 
+349499.635986  7402814.094436 
+349483.613560  7402824.572642 
+349469.438289  7402833.201164 
+349455.881486  7402838.750213 
+349447.866150  7402838.750213 
+349426.302257  7402833.201164 
+349412.745454  7402824.572642 
+349390.563093  7402809.165281 
+349378.853446  7402791.298341 
+349372.685265  7402777.120770 
+349369.609421  7402760.483619 
+349361.594085  7402716.731114 
+349351.121372  7402680.987236 
+349341.258880  7402658.811035 
+349322.160610  7402635.395046 
+349295.047004  7402619.367791 
+349271.009241  7402612.588952 
+349251.910971  7402612.588952 
+349229.110143  7402622.447264 
+349210.622094  7402636.624835 
+349197.065291  7402652.032196 
+349188.439734  7402671.128925 
+349185.355644  7402689.615758 
+349186.584332  7402702.563541 
+349189.668422  7402720.430480 
+349203.225225  7402760.483619 
+349209.385160  7402780.820136 
+349218.010717  7402799.306969 
+349224.178897  7402809.165281 
+349232.804455  7402811.634858 
+349241.430012  7402814.714330 
+349259.918061  7402829.501797 
+349274.711799  7402836.900530 
+349292.581381  7402841.829686 
+349335.717413  7402849.838314 
+349365.906864  7402854.767469 
+349389.944626  7402867.705253 
+349406.577273  7402878.803352 
+349414.592609  7402891.741136 
+349417.676700  7402904.678920 
+349413.363921  7402916.386915 
+349403.501429  7402920.086281 
+349388.707691  7402920.086281 
+349378.853446  7402923.165753 
+349365.906864  7402933.643959 
+349351.121372  7402941.652587 
+349330.786167  7402955.210264 
+349307.366872  7402966.308363 
+349284.566044  7402971.237519 
+349258.689373  7402971.237519 
+349241.430012  7402966.308363 
+349227.873209  7402953.360581 
+349193.362733  7402918.236598 
+349167.486062  7402900.369658 
+349116.953160  7402879.413248 
+349062.107480  7402859.086730 
+349020.208382  7402852.917786 
+348978.919506  7402855.997259 
+348926.539448  7402863.395991 
+348875.388080  7402873.254303 
+348824.244957  7402873.874197 
+348752.148163  7402864.015885 
+348703.462417  7402843.679369 
+348639.372712  7402809.785174 
+348596.236680  7402766.032669 
+348562.344672  7402720.430480 
+348511.811771  7402668.669346 
+348491.476566  7402645.863253 
+348479.156697  7402627.376419 
+348467.447050  7402612.588952 
+348458.821492  7402587.323280 
+348448.959001  7402562.057608 
+348431.707886  7402541.111196 
+348403.357345  7402525.083941 
+348366.381247  7402518.305102 
+348322.016526  7402513.995840 
+348291.818829  7402512.766051 
+348262.239600  7402507.826897 
+348245.606953  7402500.438163 
+348223.416346  7402485.030802 
+348201.852453  7402459.765130 
+348187.677182  7402432.649774 
+348175.967535  7402390.746952 
+348169.189133  7402374.729696 
+348161.182043  7402357.472652 
+348153.166707  7402351.313706 
+348143.922683  7402348.844129 
+348132.831502  7402348.844129 
+348122.358790  7402352.543496 
+348110.649142  7402366.101174 
+348102.633806  7402388.287373 
+348081.069913  7402429.570302 
+348065.047487  7402453.606185 
+348047.796372  7402470.853230 
+348035.468257  7402483.181119 
+348021.292987  7402489.340064 
+347993.560913  7402493.659324 
+347967.535809  7402493.659324 
+347957.203282  7402493.659324 
+347926.395364  7402496.738796 
+347890.037734  7402512.146157 
+347860.458504  7402520.774679 
+347838.276144  7402529.403201 
+347788.980177  7402547.270141 
+347713.180825  7402580.544441 
+347652.785432  7402604.580324 
+347605.336620  7402625.526736 
+347569.597457  7402634.775152 
+347525.842957  7402644.013570 
+347501.194974  7402651.412302 
+347476.546990  7402664.969980 
+347437.723736  7402696.394597 
+347408.762974  7402716.731114 
+347385.962147  7402727.209319 
+347365.008474  7402732.138475 
+347342.826114  7402733.368264 
+347290.446057  7402734.608052 
+347231.906066  7402734.608052 
+347196.777123  7402738.297420 
+347150.565246  7402745.076259 
+347096.948255  7402753.704781 
+347061.827558  7402760.483619 
+347036.561108  7402772.191614 
+347018.073059  7402784.519502 
+347002.669100  7402800.536759 
+346993.425075  7402820.873275 
+346992.806608  7402835.050847 
+346995.272231  7402847.988631 
+347006.981878  7402862.166202 
+347047.652288  7402888.041770 
+347074.765894  7402900.369658 
+347100.032345  7402908.378286 
+347123.443394  7402918.856492 
+347135.771509  7402933.034063 
+347137.618664  7402947.821530 
+347134.542820  7402973.087202 
+347124.680328  7403002.662136 
+347105.573812  7403024.848336 
+347082.162763  7403037.786120 
+347058.743468  7403042.105380 
+347035.942640  7403047.034536 
+347016.225903  7403049.494114 
+346996.500919  7403058.122637 
+346989.021588  7403062.161945 
+346989.013342  7403062.161945 
+346958.312625  7403017.009679 
+346935.882878  7402984.025329 
+346861.947174  7402859.056735 
+346762.027597  7402689.865716 
+347215.157971  7402074.291158 
+347188.506154  7402012.081814 
+347156.741673  7401983.296744 
+347122.132243  7401962.220355 
+347087.267180  7401945.363242 
+347034.812907  7401930.305821 
+346994.736226  7401923.017070 
+346958.197178  7401920.647476 
+346934.217139  7401918.737803 
+346887.452765  7401916.918115 
+346817.640177  7401919.517669 
+346754.177186  7401918.497844 
+346715.048821  7401916.208236 
+346686.566340  7401913.638676 
+346667.971090  7401910.409229 
+346629.288022  7401900.130990 
+346597.078245  7401889.152870 
+346570.566614  7401878.234741 
+346544.450801  7401865.396940 
+346519.868788  7401850.309524 
+346501.339508  7401836.801838 
+346490.017433  7401825.613754 
+346476.872941  7401812.186054 
+346458.393138  7401792.169483 
+346440.366878  7401767.683677 
+346429.127266  7401748.117029 
+346417.912392  7401726.730692 
+346404.141187  7401695.696008 
+346388.506334  7401652.203458 
+346368.888551  7401589.584184 
+346354.911190  7401543.482081 
+346372.335475  7401526.514987 
+346384.119339  7401517.086602 
+346395.342459  7401511.677529 
+346412.115292  7401509.367924 
+346433.769894  7401501.559262 
+346452.315666  7401499.019697 
+346469.946108  7401488.401516 
+346487.535318  7401480.802817 
+346509.371336  7401479.303074 
+346535.577857  7401472.064314 
+346593.787999  7401461.686092 
+346615.879651  7401459.436477 
+346634.755273  7401450.597991 
+346661.324628  7401435.290613 
+346686.896190  7401417.963581 
+346705.268792  7401408.865139 
+346742.121196  7401381.849767 
+346746.912256  7401378.450349 
+346775.633878  7401358.573754 
+346793.206595  7401352.984711 
+346821.779784  7401345.316025 
+346843.211738  7401329.328763 
+346872.749736  7401313.901406 
+346911.507020  7401287.935853 
+346938.035144  7401268.709147 
+346982.902885  7401240.274018 
+346995.412417  7401229.005948 
+347011.476074  7401218.777700 
+347019.969692  7401202.700454 
+347028.488048  7401182.073987 
+347031.176319  7401161.407527 
+347032.850304  7401140.991024 
+347032.701872  7401127.653308 
+347033.559480  7401112.485906 
+347031.926726  7401093.309191 
+347031.836018  7401070.853038 
+347033.551234  7401043.877658 
+347035.043801  7401013.112928 
+347038.086660  7400978.328886 
+347043.438464  7400940.275405 
+347051.783650  7400917.669277 
+347064.787955  7400874.576658 
+347069.661478  7400855.069999 
+347077.792261  7400830.684177 
+347093.237451  7400790.041138 
+347110.307148  7400760.776151 
+347133.066745  7400731.511164 
+347145.262920  7400712.804368 
+347167.206140  7400684.359241 
+347225.746131  7400607.942330 
+347254.203873  7400570.548735 
+347272.271365  7400600.053681 
+347283.766610  7400583.896449 
+347317.988467  7400524.996538 
+347336.501255  7400493.521929 
+347352.111370  7400475.295051 
+347365.536233  7400460.267626 
+347379.686765  7400445.910085 
+347393.598156  7400434.202090 
+347407.171452  7400425.593565 
+347423.309325  7400415.795243 
+347426.286214  7400412.705772 
+347448.361374  7400394.018973 
+347459.279383  7400385.050510 
+347468.160574  7400375.392164 
+347481.123648  7400353.485916 
+347485.337472  7400334.759124 
+347485.881723  7400294.965940 
+347467.987403  7400231.886745 
+347468.276021  7400207.520919 
+347468.309006  7400173.246790 
+347470.939553  7400144.341741 
+347471.236418  7400109.617689 
+347475.829568  7400054.527125 
+347481.948271  7399989.488266 
+347490.788231  7399982.369485 
+347492.371507  7399914.221158 
+347475.252332  7399819.187437 
+347456.558127  7399727.183196 
+347424.521521  7399637.278596 
+347438.474143  7399605.913969 
+347464.853835  7399616.062230 
+347477.025272  7399624.180840 
+347495.282426  7399624.180840 
+347519.633545  7399595.775705 
+347539.919273  7399579.538486 
+347568.327537  7399579.538486 
+347606.870419  7399591.716401 
+347643.392975  7399589.686748 
+347708.315549  7399563.311266 
+347779.323841  7399543.024741 
+347828.553838  7399522.288293 
+347841.673591  7399504.181394 
+347855.840615  7399508.140716 
+347879.771176  7399510.090382 
+347913.457029  7399511.750098 
+347980.672055  7399518.628920 
+348028.689856  7399523.388105 
+348055.490105  7399524.997829 
+348115.431956  7399530.476890 
+348250.018686  7399540.155232 
+348291.983754  7399545.144378 
+348318.866466  7399545.764272 
+348364.179503  7399543.104727 
+348381.306924  7399541.674972 
+348399.168260  7399538.705481 
+348421.556776  7399533.376394 
+348456.248668  7399533.176428 
+348479.931843  7399535.835972 
+348588.806826  7399545.144378 
+348642.151692  7399548.753760 
+348666.618258  7399552.543111 
+348699.388779  7399551.993205 
+348724.877878  7399549.663604 
+348759.140966  7399547.184029 
+348878.900974  7399529.557048 
+348896.028395  7399528.517226 
+348909.750123  7399527.907330 
+348920.016680  7399526.967491 
+348948.251774  7399528.027310 
+348963.540285  7399530.436897 
+348982.622063  7399533.356397 
+349003.468534  7399539.705310 
+349027.935100  7399550.583446 
+349102.291362  7399586.977212 
+349116.582080  7399594.905854 
+349176.012664  7399625.210663 
+349267.133513  7399672.842504 
+349294.882079  7399686.480168 
+349383.322903  7399729.972718 
+349410.230353  7399743.290437 
+349439.619919  7399758.397849 
+349487.208916  7399784.633356 
+349507.700800  7399800.680607 
+349530.460396  7399816.297932 
+349549.030908  7399831.225375 
+349564.459605  7399841.653589 
+349579.937780  7399855.111283 
+349592.735930  7399867.089232 
+349606.696798  7399880.566923 
+349617.524099  7399889.145454 
+349636.490430  7399905.222700 
+349645.429344  7399915.360963 
+349691.492788  7399954.604241 
+349715.926370  7399978.580134 
+349729.458434  7399989.408279 
+349744.557282  7400002.486039 
+349762.121754  7400025.062172 
+349771.077160  7400035.970304 
+349778.919325  7400048.028238 
+349787.281003  7400068.084803 
+349794.413993  7400083.592147 
+349803.897158  7400102.478912 
+349823.803559  7400149.780809 
+349834.086609  7400171.327118 
+349842.728658  7400185.294726 
+349855.609271  7400202.221826 
+349863.797778  7400212.750023 
+349875.829028  7400225.117905 
+349891.010339  7400242.404943 
+349904.962961  7400255.502700 
+349940.091903  7400291.226581 
+350030.371637  7400374.432328 
+350103.548687  7400438.161412 
+350157.322357  7400470.995788 
+350123.463334  7400636.547430 
+350115.406767  7400688.638508 
+350112.009320  7400727.901782 
+350109.048923  7400737.730099 
+350098.889567  7400782.482433 
+350094.626266  7400798.379710 
+350091.393743  7400817.066509 
+350083.221729  7400836.253223 
+350068.617654  7400863.728516 
+350052.809630  7400883.455137 
+350039.236335  7400901.472051 
+350010.646653  7400931.306941 
+350000.256402  7400948.583981 
+349982.296112  7400961.371791 
+349972.573806  7400968.110637 
+349937.733482  7400991.646605 
+349899.751343  7401021.171548 
+349893.838796  7401030.799899 
+349890.226947  7401041.518063 
+349887.349012  7401050.326554 
+349886.367711  7401059.095052 
+349885.328686  7401064.834069 
+349893.278052  7401088.789965 
+349898.036127  7401120.524530 
+349915.501644  7401217.337946 
+349917.818835  7401240.533973 
+349936.133713  7401283.996528 
+349947.241385  7401339.547013 
+349951.999461  7401404.615867 
+349947.241385  7401461.756080 
+349940.702125  7401493.290678 
+349942.029768  7401545.431747 
+349969.390761  7401565.118375 
+350007.620286  7401574.906698 
+350024.203456  7401578.416097 
+350047.226932  7401579.985828 
+350109.106647  7401604.601611 
+350125.186797  7401641.805239 
+350139.263112  7401657.762506 
+350093.496532  7401769.383386 
+350040.069204  7401915.668329 
+350002.326206  7402014.921327 
+349887.720093  7402121.773025 
+349817.998213  7402177.233525 
+349811.656861  7402191.501081 
+349800.573927  7402204.168911 
+349786.299702  7402264.388596 
+349792.599822  7402332.077002 
+349800.557435  7402389.777118 
+349823.152107  7402538.021725 
+Region 1
+1191
+325541.730148  7409353.814242 
+325498.635346  7409351.804586 
+325482.918031  7409351.124702 
+325473.987363  7409355.563942 
+325453.784098  7409369.481558 
+325438.866667  7409386.978561 
+325420.040522  7409413.534012 
+325405.815774  7409437.109974 
+325390.749911  7409467.234814 
+325375.700540  7409495.849912 
+325362.143737  7409527.004576 
+325355.530260  7409550.670522 
+325349.180662  7409573.326641 
+325342.138381  7409611.620082 
+325338.699703  7409645.414293 
+325337.174150  7409667.370532 
+325344.661728  7409699.774982 
+325352.982175  7409725.370597 
+325358.746290  7409753.465785 
+325363.248732  7409780.791104 
+325363.809475  7409819.174530 
+325362.053028  7409861.067354 
+325358.416441  7409890.572300 
+325353.765566  7409919.307378 
+325350.648491  7409947.552540 
+325348.834321  7409972.278304 
+325349.139431  7409989.955276 
+325350.359873  7410015.220949 
+325357.781481  7410031.458167 
+325367.231661  7410069.701617 
+325368.303671  7410086.118804 
+325360.197626  7410107.245186 
+325346.921195  7410136.380195 
+325335.665090  7410166.305069 
+325328.408407  7410200.809159 
+325321.959855  7410231.793852 
+325320.393071  7410257.529443 
+325316.575066  7410280.465515 
+325314.727911  7410308.220760 
+325309.780172  7410341.245104 
+325300.898982  7410363.111358 
+325291.762158  7410384.977613 
+325277.784797  7410409.053489 
+325265.374220  7410428.860096 
+325250.992794  7410444.607399 
+325238.400800  7410457.845131 
+325226.625182  7410467.053554 
+325218.568615  7410483.630714 
+325213.431213  7410489.379729 
+325204.475807  7410495.838623 
+325195.553385  7410500.037904 
+325182.095537  7410500.637801 
+325164.992854  7410488.579866 
+325152.928619  7410478.841535 
+325131.051369  7410462.184388 
+325108.300019  7410455.865470 
+325084.798261  7410447.766857 
+325061.049117  7410439.928200 
+325038.842018  7410429.819932 
+325012.775683  7410424.730803 
+324998.633397  7410419.521695 
+324979.988670  7410408.703549 
+324954.804682  7410393.016236 
+324938.947180  7410382.228084 
+324916.319523  7410364.551111 
+324893.576419  7410357.222367 
+324857.837255  7410354.792783 
+324831.498795  7410351.463353 
+324798.538611  7410349.823634 
+324766.304095  7410351.733307 
+324741.441710  7410352.213225 
+324708.192908  7410353.343031 
+324663.201473  7410361.171690 
+324636.986706  7410368.950358 
+324602.014442  7410387.747138 
+324574.917328  7410405.614078 
+324533.983039  7410435.448967 
+324500.866177  7410468.913235 
+324449.813763  7410518.074814 
+324424.118508  7410546.309978 
+324396.633821  7410575.794927 
+324378.615808  7410598.061113 
+324361.348201  7410621.347125 
+324343.569327  7410645.133050 
+324330.177449  7410662.160134 
+324312.481038  7410679.377185 
+324296.722491  7410703.183107 
+324285.078813  7410722.749755 
+324277.731422  7410743.876137 
+324273.204241  7410762.512944 
+324270.169628  7410783.179404 
+324263.358242  7410801.786217 
+324253.932800  7410848.648190 
+324248.638720  7410867.774914 
+324247.212122  7410881.652537 
+324243.690982  7410900.299343 
+324240.697600  7410917.936322 
+324233.630580  7410936.293177 
+324223.001189  7410978.086018 
+324226.621284  7410993.783330 
+324231.733947  7411012.020206 
+324235.395274  7411024.428081 
+324239.196786  7411046.194352 
+324244.004338  7411068.970451 
+324248.869615  7411086.957370 
+324253.982278  7411105.194246 
+324261.329669  7411127.750382 
+324266.178453  7411147.497000 
+324273.492859  7411172.832660 
+324276.024452  7411194.578935 
+324281.376256  7411214.335551 
+324284.072773  7411244.410400 
+324285.342693  7411265.636764 
+324287.198095  7411302.020531 
+324269.724332  7411321.257236 
+324254.806901  7411339.024193 
+324247.294584  7411352.321915 
+324237.638248  7411375.687913 
+324227.190274  7411401.323522 
+324216.816516  7411420.900168 
+324204.191537  7411437.927252 
+324195.706166  7411447.685580 
+324178.554006  7411460.873321 
+324159.134133  7411473.021241 
+324141.215073  7411487.208810 
+324119.445025  7411504.635825 
+324107.034447  7411524.952345 
+324104.205990  7411549.918069 
+324100.989960  7411565.035479 
+324094.203313  7411581.112725 
+324085.462308  7411591.370968 
+324069.382158  7411599.269615 
+324052.081566  7411604.118785 
+324032.777140  7411605.918476 
+324012.697569  7411609.987779 
+323981.732973  7411610.897624 
+323961.892542  7411615.466841 
+323942.035618  7411621.805755 
+323921.881831  7411631.424108 
+323908.547676  7411643.642015 
+323889.424667  7411652.520494 
+323875.892602  7411660.189180 
+323853.017559  7411663.968533 
+323840.029745  7411668.367779 
+323820.469686  7411670.417428 
+323796.275245  7411678.726005 
+323785.522161  7411687.444512 
+323767.586609  7411702.641909 
+323760.668022  7411708.630883 
+323748.364645  7411719.349047 
+323735.294370  7411730.807084 
+323719.774964  7411734.676421 
+323707.092261  7411735.036360 
+323690.624538  7411733.076695 
+323679.483881  7411730.937062 
+323665.852862  7411725.727954 
+323651.661099  7411724.048242 
+323636.166431  7411726.147882 
+323626.980130  7411730.587122 
+323611.765835  7411730.167194 
+323599.891263  7411726.497822 
+323591.546077  7411723.878271 
+323574.600073  7411719.898953 
+323560.350587  7411723.768290 
+323539.240236  7411728.077552 
+323517.626866  7411732.886728 
+323495.988756  7411739.455603 
+323475.851461  7411748.064128 
+323443.014971  7411757.282549 
+323420.857349  7411765.371164 
+323402.534225  7411769.960378 
+323384.524457  7411770.000371 
+323368.048488  7411769.310489 
+323346.245454  7411768.310660 
+323323.403395  7411768.800576 
+323304.874115  7411769.860395 
+323290.847277  7411776.769211 
+323285.198609  7411782.258271 
+323277.999649  7411790.756815 
+323265.688027  7411802.234849 
+323259.717756  7411813.782871 
+323251.405555  7411830.609989 
+323245.377561  7411846.947190 
+323239.382551  7411861.024779 
+323231.886728  7411872.802762 
+323219.830738  7411884.280796 
+323211.675216  7411887.980162 
+323197.978227  7411887.320275 
+323174.938259  7411884.030838 
+323156.145099  7411885.580573 
+323135.546015  7411890.139792 
+323117.701172  7411898.018442 
+323101.612776  7411906.926916 
+323082.217641  7411917.065180 
+323065.832381  7411929.753007 
+323049.463613  7411941.431006 
+323035.346066  7411955.668567 
+323019.942107  7411971.395874 
+323007.350113  7411985.143519 
+322990.635004  7412004.650177 
+322979.832442  7412017.148037 
+322967.735221  7412032.415421 
+322951.011865  7412052.931907 
+322937.941590  7412064.399943 
+322912.320551  7412086.076230 
+322895.110668  7412104.563063 
+322876.325755  7412127.079206 
+322861.804142  7412154.184563 
+322852.370454  7412180.340083 
+322841.675093  7412205.715737 
+322827.351391  7412237.370314 
+322803.082734  7412264.025749 
+322793.690277  7412285.392089 
+322780.116982  7412309.178014 
+322771.681088  7412319.806194 
+322756.491531  7412339.442830 
+322743.668642  7412369.847622 
+322740.419627  7412383.335312 
+322723.828211  7412391.733873 
+322706.189524  7412403.651832 
+322690.092882  7412413.070219 
+322675.851641  7412416.439642 
+322667.448732  7412419.119183 
+322655.021663  7412418.979207 
+322641.844186  7412417.819405 
+322631.948709  7412418.219337 
+322617.996087  7412418.059364 
+322605.140213  7412411.090558 
+322597.594912  7412405.961436 
+322588.515812  7412401.052277 
+322578.166793  7412396.643033 
+322559.695236  7412392.903673 
+322524.038535  7412383.655257 
+322504.593923  7412375.606636 
+322477.554533  7412366.968116 
+322452.791102  7412358.859504 
+322438.871465  7412356.179963 
+322415.089336  7412351.110832 
+322397.063076  7412352.420607 
+322383.654705  7412348.981197 
+322363.410208  7412345.221840 
+322341.673144  7412337.903094 
+322330.120175  7412328.424718 
+322319.820633  7412319.976165 
+322311.541418  7412312.057521 
+322298.248494  7412299.029753 
+322280.329435  7412291.001128 
+322268.900159  7412291.880977 
+322262.022802  7412294.830472 
+322255.598989  7412301.579316 
+322248.177381  7412307.298336 
+322234.183528  7412310.927715 
+322217.179800  7412311.747574 
+322207.028690  7412312.137508 
+322189.488958  7412315.466937 
+322177.540169  7412317.606571 
+322159.184060  7412324.975309 
+322145.445840  7412328.854644 
+322132.746645  7412330.474367 
+322116.757203  7412331.054267 
+322103.571481  7412330.404379 
+322087.862411  7412328.954627 
+322074.948814  7412327.044954 
+322062.802116  7412324.385410 
+322050.688403  7412319.196298 
+322041.122776  7412312.777398 
+322029.083279  7412301.019412 
+322019.278511  7412293.330729 
+322005.861894  7412290.911143 
+321993.640980  7412295.060433 
+321980.389287  7412299.959594 
+321965.339916  7412307.118367 
+321942.687521  7412314.177158 
+321927.967999  7412314.267143 
+321912.737211  7412315.097001 
+321899.040222  7412314.947026 
+321889.400378  7412315.596915 
+321872.693515  7412312.627424 
+321856.209300  7412312.187499 
+321844.046110  7412310.787739 
+321830.134719  7412307.598285 
+321814.928669  7412306.158532 
+321800.745153  7412304.738775 
+321787.848048  7412301.309362 
+321775.206576  7412297.130078 
+321761.031306  7412294.690496 
+321750.179266  7412290.281251 
+321736.985297  7412290.131277 
+321726.562062  7412292.530866 
+321720.698992  7412294.990445 
+321710.696314  7412303.968907 
+321695.110938  7412313.887208 
+321682.156110  7412315.007016 
+321674.561331  7412313.657247 
+321663.156794  7412312.767400 
+321655.908357  7412304.098884 
+321643.877107  7412291.591027 
+321635.317520  7412285.692037 
+321625.001485  7412278.503269 
+321613.168144  7412270.794589 
+321600.048391  7412265.085567 
+321584.570216  7412265.665468 
+321569.322936  7412268.025064 
+321555.584715  7412270.894572 
+321541.376460  7412271.744427 
+321525.626159  7412273.084197 
+321517.008848  7412272.984214 
+321507.088633  7412274.893887 
+321487.990363  7412281.492757 
+321480.065735  7412286.451907 
+321468.116947  7412288.591541 
+321452.143998  7412287.901659 
+321439.238647  7412285.482073 
+321427.075457  7412284.082313 
+321406.261971  7412285.612051 
+321394.807956  7412289.011469 
+321382.545812  7412296.200237 
+321373.804807  7412306.448482 
+321365.129772  7412310.897720 
+321359.299687  7412310.327818 
+321351.704909  7412309.228006 
+321343.912221  7412302.829102 
+321332.598392  7412294.370551 
+321323.041011  7412286.941823 
+321307.084555  7412284.992157 
+321288.563521  7412285.032150 
+321269.193125  7412293.140762 
+321258.736905  7412298.079915 
+321235.581489  7412304.128879 
+321216.293555  7412305.168701 
+321198.325019  7412301.179385 
+321183.671467  7412296.460193 
+321168.754036  7412292.000957 
+321148.031258  7412285.202121 
+321142.712439  7412281.562745 
+321133.963189  7412275.293819 
+321125.205692  7412269.274850 
+321115.417416  7412263.995754 
+321106.437271  7412256.457045 
+321099.774316  7412247.718542 
+321091.668272  7412235.400652 
+321086.802996  7412225.442358 
+321081.467684  7412214.204283 
+321076.833303  7412205.505773 
+321070.252811  7412204.335973 
+321067.688233  7412205.795723 
+321061.833409  7412206.155661 
+321056.250711  7412206.025684 
+321048.928058  7412203.826060 
+321043.691702  7412199.666773 
+321037.408074  7412196.737275 
+321031.099708  7412194.817603 
+321022.960678  7412195.377507 
+321017.336749  7412197.017227 
+321012.207593  7412199.166858 
+321007.004222  7412204.845886 
+321001.297830  7412210.015000 
+321000.258805  7412222.362885 
+320998.865192  7412228.131897 
+320996.176921  7412234.890739 
+320991.064258  7412236.280501 
+320982.644856  7412238.100189 
+320970.943455  7412238.830064 
+320955.803376  7412245.788872 
+320944.984321  7412252.597706 
+320929.176297  7412266.615305 
+320918.761307  7412278.233315 
+320910.680001  7412287.631705 
+320900.265012  7412299.249715 
+320892.035274  7412303.848927 
+320874.866622  7412310.757744 
+320854.984960  7412313.817220 
+320848.800287  7412317.716552 
+320841.428156  7412318.036497 
+320832.307825  7412317.066663 
+320824.968680  7412315.876867 
+320816.178198  7412311.377638 
+320807.024882  7412311.667588 
+320797.830335  7412313.967194 
+320791.909541  7412317.616569 
+320786.227889  7412322.025814 
+320780.694668  7412330.984279 
+320776.950879  7412350.840878 
+320776.365397  7412365.968287 
+320774.312085  7412378.296175 
+320772.761794  7412390.884019 
+320777.313713  7412403.361882 
+320781.915110  7412413.320176 
+320783.539617  7412420.428958 
+320785.419758  7412427.287783 
+320783.226261  7412434.306581 
+320779.292809  7412440.015603 
+320771.508367  7412447.664293 
+320762.767362  7412452.253507 
+320758.017533  7412460.472099 
+320758.025780  7412471.320241 
+320759.831704  7412485.777765 
+320752.154463  7412499.375435 
+320743.965956  7412503.634706 
+320730.153520  7412506.584201 
+320716.316345  7412512.013271 
+320701.209251  7412518.682128 
+320667.276011  7412528.850387 
+320644.648355  7412536.049154 
+320637.721521  7412539.078635 
+320630.110250  7412547.077264 
+320625.698517  7412549.516847 
+320604.909769  7412560.464971 
+320590.289202  7412567.553757 
+320580.030891  7412583.461032 
+320568.090349  7412595.299005 
+320556.537380  7412600.828057 
+320537.826683  7412608.466749 
+320528.978477  7412611.696196 
+320521.128066  7412608.606725 
+320504.635604  7412605.417271 
+320485.891922  7412602.197823 
+320461.474833  7412601.527938 
+320424.226609  7412606.677056 
+320351.964890  7412617.005286 
+320303.411084  7412624.633980 
+320279.340337  7412626.583646 
+320263.210710  7412624.893935 
+320258.328941  7412624.084074 
+320229.203255  7412609.536566 
+320219.489195  7412605.307290 
+320212.018110  7412601.857881 
+320202.271065  7412600.238159 
+320195.129830  7412600.158172 
+320186.083714  7412603.037679 
+320175.512047  7412607.016997 
+320164.495083  7412616.965293 
+320156.083927  7412629.193199 
+320141.150004  7412652.169263 
+320135.064285  7412658.448188 
+320128.269391  7412660.977754 
+320121.136402  7412660.517833 
+320115.528965  7412658.208229 
+320109.946267  7412654.028945 
+320087.739168  7412626.863598 
+320072.986661  7412603.897532 
+320053.451341  7412573.022820 
+320044.603135  7412559.465143 
+320031.961664  7412548.487023 
+320024.869905  7412545.037614 
+320015.122861  7412543.047955 
+320004.979997  7412542.927975 
+319993.657922  7412547.267232 
+319967.220507  7412558.895240 
+319948.311900  7412569.123488 
+319900.178652  7412603.657573 
+319888.056693  7412611.346256 
+319874.475151  7412616.415387 
+319855.574790  7412625.893764 
+319830.283601  7412635.672089 
+319816.330979  7412639.981351 
+319803.169994  7412640.571250 
+319790.421322  7412638.921532 
+319757.477630  7412629.183200 
+319739.880174  7412624.484005 
+319728.624069  7412622.854285 
+319715.454839  7412624.933928 
+319710.902920  7412628.233363 
+319707.818829  7412634.552281 
+319707.373533  7412640.521258 
+319711.331724  7412654.768818 
+319719.454261  7412666.076881 
+319735.418963  7412681.954161 
+319742.428259  7412692.502354 
+319752.727802  7412710.189325 
+319764.082861  7412734.235206 
+319766.622700  7412741.363985 
+319766.548484  7412748.082834 
+319763.777751  7412759.260919 
+319759.555681  7412766.679649 
+319753.849289  7412772.208702 
+319747.070887  7412773.998395 
+319737.299104  7412774.248352 
+319728.318959  7412770.778946 
+319694.311504  7412756.541385 
+319681.975143  7412751.162307 
+319668.236922  7412738.294511 
+319656.378843  7412724.696840 
+319647.134818  7412712.258970 
+319631.351533  7412682.174124 
+319620.293337  7412664.487153 
+319606.612841  7412646.760190 
+319579.903300  7412618.794980 
+319569.430587  7412609.156631 
+319537.921739  7412580.171596 
+319520.744841  7412572.122974 
+319502.743319  7412569.283461 
+319467.399975  7412571.463087 
+319440.731665  7412571.143142 
+319422.359063  7412568.303629 
+319404.035939  7412561.354819 
+319395.468105  7412555.265862 
+319388.813397  7412546.227410 
+319379.923960  7412536.029157 
+319371.084001  7412521.721608 
+319355.152283  7412503.594713 
+319347.763661  7412493.046519 
+319341.900591  7412481.398515 
+319338.272249  7412470.520378 
+319339.533923  7412459.702231 
+319343.112787  7412443.684975 
+319351.556927  7412428.847516 
+319361.567851  7412409.170887 
+319368.906996  7412392.443752 
+319370.110946  7412386.484773 
+319372.139518  7412374.176881 
+319368.775056  7412342.012390 
+319364.594217  7412315.436942 
+319360.957630  7412305.678614 
+319353.527776  7412298.489845 
+319339.336013  7412291.601025 
+319331.848436  7412290.011298 
+319322.076652  7412290.261255 
+319310.375251  7412294.600511 
+319301.658985  7412300.469506 
+319295.193940  7412307.118367 
+319286.032378  7412318.956340 
+319276.062685  7412335.643481 
+319264.550947  7412354.930178 
+319254.985320  7412369.007766 
+319240.595647  7412378.546132 
+319231.128974  7412384.405129 
+319222.849759  7412385.804889 
+319213.424317  7412388.304461 
+319206.645916  7412390.084156 
+319192.363444  7412390.284122 
+319179.614772  7412388.634404 
+319171.747868  7412386.664742 
+319159.807326  7412380.175853 
+319138.565035  7412365.718330 
+319128.521126  7412357.749695 
+319118.889529  7412346.421635 
+319113.001720  7412336.633312 
+319106.404736  7412323.105629 
+319102.421806  7412311.107684 
+319094.860013  7412284.492243 
+319091.701707  7412265.775449 
+319089.392762  7412239.969869 
+319088.617616  7412211.194798 
+319090.407048  7412157.054072 
+319090.670928  7412135.757720 
+319089.623657  7412129.028872 
+319087.520868  7412116.670989 
+319085.302632  7412083.396689 
+319083.100888  7412048.252709 
+319083.595662  7412038.924306 
+319084.387300  7412035.194945 
+319086.325164  7412030.365772 
+319091.627491  7412027.066338 
+319099.172792  7412024.916706 
+319109.332148  7412023.177004 
+319114.997308  7412021.007375 
+319121.074780  7412015.098388 
+319126.855388  7412003.220422 
+319132.248423  7411992.452267 
+319132.322639  7411986.853226 
+319130.920780  7411978.614637 
+319128.743775  7411971.865793 
+319120.992318  7411960.557730 
+319114.304625  7411954.498768 
+319103.873143  7411947.649941 
+319091.206933  7411938.901440 
+319080.387878  7411932.792486 
+319072.215864  7411925.593719 
+319065.940482  7411916.555267 
+319060.794834  7411907.146879 
+319057.587050  7411892.919316 
+319056.943844  7411883.940854 
+319057.784960  7411876.852068 
+319060.489724  7411870.533150 
+319066.575442  7411864.634161 
+319085.112968  7411854.025978 
+319096.459782  7411847.447105 
+319104.087545  7411838.568626 
+319110.239233  7411827.070595 
+319109.637258  7411814.732708 
+319103.889636  7411793.366368 
+319097.284405  7411780.588557 
+319090.266863  7411770.410301 
+319088.477430  7411763.671455 
+319087.520868  7411749.833825 
+319088.782541  7411738.645741 
+319091.198687  7411725.228040 
+319091.685214  7411716.639511 
+319092.559315  7411706.561237 
+319093.763264  7411700.232321 
+319096.476274  7411693.533469 
+319100.335510  7411684.614996 
+319100.830284  7411675.286594 
+319098.694510  7411665.548262 
+319092.765470  7411659.129362 
+319083.076149  7411652.650472 
+319070.393447  7411645.031777 
+319062.229678  7411636.713202 
+319054.832809  7411627.284817 
+319051.220960  7411616.026745 
+319047.724559  7411594.320463 
+319049.274850  7411560.346283 
+319052.556850  7411537.600179 
+319053.802031  7411527.531903 
+319053.843262  7411524.162481 
+319052.845468  7411513.694274 
+319054.907026  7411498.776829 
+319057.463357  7411474.530982 
+319058.906447  7411448.765395 
+319057.158246  7411407.652438 
+319054.725608  7411391.185258 
+319052.177523  7411384.436414 
+319047.749297  7411378.397449 
+319041.391453  7411376.077846 
+319035.759278  7411376.017856 
+319029.731283  7411377.437613 
+319015.003515  7411383.226622 
+318999.888175  7411390.885310 
+318964.008825  7411406.142696 
+318925.886501  7411420.990153 
+318907.398452  7411427.479042 
+318892.307850  7411432.528177 
+318879.889026  7411434.617819 
+318864.122233  7411433.677980 
+318842.014089  7411429.298730 
+318811.288634  7411422.569882 
+318773.446681  7411414.631242 
+318753.218677  7411410.271989 
+318727.754317  7411403.603131 
+318714.634564  7411401.203542 
+318696.962892  7411402.113386 
+318684.527576  7411405.312838 
+318672.455094  7411409.652095 
+318661.091789  7411416.980840 
+318647.081443  7411426.519206 
+318631.562037  7411436.047574 
+318622.491183  7411440.416825 
+318611.193847  7411442.516466 
+318595.039481  7411442.696435 
+318572.956075  7411436.067570 
+318546.065117  7411423.039802 
+318528.179043  7411411.241823 
+318512.263818  7411391.995120 
+318494.056141  7411375.707909 
+318483.245332  7411369.219021 
+318463.784228  7411363.000086 
+318433.058772  7411357.021110 
+318417.333211  7411352.341912 
+318409.491045  7411348.512568 
+318404.683493  7411342.853537 
+318400.997428  7411337.204505 
+318399.595568  7411328.965916 
+318402.028206  7411314.048471 
+318409.713693  7411300.330821 
+318429.430431  7411285.623340 
+318458.168545  7411269.916031 
+318469.136032  7411264.446967 
+318482.775297  7411254.908601 
+318491.128729  7411247.539863 
+318494.221065  7411240.481073 
+318495.053934  7411233.762223 
+318492.126523  7411227.373318 
+318482.090860  7411218.664810 
+318466.027203  7411211.735996 
+318450.293394  7411207.806669 
+318435.648089  7411207.626700 
+318422.833446  7411211.206087 
+318400.947950  7411219.154726 
+318383.589635  7411225.293674 
+318365.522143  7411228.433136 
+318344.090190  7411230.032862 
+318310.264152  7411231.482614 
+318274.549727  7411233.662241 
+318232.056900  7411237.241627 
+318216.248876  7411239.291276 
+318187.255129  7411244.910314 
+318159.036528  7411248.669670 
+318133.803062  7411253.968762 
+318104.042416  7411260.697610 
+318090.840201  7411265.016870 
+318077.225674  7411271.945683 
+318063.602901  7411280.364241 
+318044.323213  7411290.212554 
+318029.991265  7411294.521816 
+318014.207979  7411295.451657 
+317998.457679  7411292.642138 
+317986.154303  7411285.393380 
+317974.659057  7411273.295452 
+317961.745460  7411254.078743 
+317947.347541  7411233.732229 
+317934.755547  7411219.384686 
+317919.838116  7411210.226255 
+317901.135665  7411203.647382 
+317885.789429  7411199.348118 
+317871.894531  7411199.178147 
+317862.477335  7411201.307783 
+317840.987658  7411207.386741 
+317816.867434  7411213.815640 
+317799.154530  7411218.454845 
+317781.499350  7411218.234883 
+317770.647311  7411214.735483 
+317753.099332  7411206.306926 
+317739.715700  7411194.558939 
+317725.284796  7411177.191913 
+317711.653777  7411155.355654 
+317705.073285  7411140.708163 
+317703.762134  7411125.000853 
+317707.316259  7411111.223213 
+317720.419520  7411084.487793 
+317731.197343  7411063.701353 
+317739.344619  7411042.135047 
+317743.492473  7411010.810413 
+317744.102694  7410991.763676 
+317746.881674  7410979.475780 
+317752.324186  7410964.968265 
+317764.470884  7410955.039966 
+317786.513059  7410934.013568 
+317803.945590  7410921.525707 
+317818.434217  7410904.528618 
+317824.709599  7410883.312252 
+317828.478126  7410851.977620 
+317829.278011  7410817.243569 
+317831.694156  7410804.575739 
+317856.944115  7410815.903799 
+317868.307420  7410818.183408 
+317884.280369  7410818.313386 
+317901.630438  7410813.934136 
+317915.706754  7410808.974986 
+317929.453221  7410796.187176 
+317940.165074  7410783.339377 
+317954.274375  7410766.282299 
+317967.122002  7410749.205224 
+317984.364870  7410728.438781 
+317996.618769  7410714.621148 
+318010.241542  7410696.544244 
+318019.980341  7410682.156708 
+318029.447013  7410668.269087 
+318037.586043  7410656.871040 
+318044.735525  7410655.021357 
+318057.335765  7410658.340788 
+318065.590242  7410663.069978 
+318083.707211  7410668.788998 
+318098.220577  7410676.937602 
+318111.348576  7410679.517161 
+318122.777852  7410679.027245 
+318128.723384  7410674.128084 
+318133.151610  7410669.448885 
+318137.464389  7410658.970680 
+318139.575424  7410655.491276 
+318141.307132  7410646.962737 
+318141.059745  7410636.374551 
+318138.643600  7410631.275424 
+318133.638138  7410628.635876 
+318126.414440  7410623.176811 
+318123.495274  7410618.067686 
+318120.081334  7410612.198692 
+318120.172043  7410608.419339 
+318121.013159  7410605.159897 
+318128.698645  7410602.070427 
+318136.326409  7410601.490526 
+318146.502257  7410599.970786 
+318157.420267  7410599.720829 
+318174.432241  7410598.860976 
+318186.372783  7410597.881144 
+318200.671747  7410593.931821 
+318205.809148  7410591.282274 
+318211.004274  7410586.363117 
+318219.102072  7410576.724768 
+318228.478036  7410566.616499 
+318233.516483  7410557.408077 
+318231.990931  7410547.039853 
+318230.572579  7410542.730591 
+318228.115202  7410539.651118 
+318220.751318  7410529.642833 
+318211.342369  7410520.104467 
+318206.526570  7410509.406299 
+318201.809726  7410505.267008 
+318200.943872  7410499.198048 
+318204.530983  7410487.190105 
+318209.536445  7410479.491423 
+318209.223088  7410471.672762 
+318205.611239  7410463.524158 
+318203.656882  7410460.454684 
+318198.544219  7410451.776171 
+318193.670697  7410443.347614 
+318192.178129  7410431.969563 
+318196.952697  7410402.354636 
+318199.583244  7410387.797130 
+318205.545269  7410372.059825 
+318211.144459  7410360.861743 
+318219.778263  7410349.973608 
+318231.059106  7410344.944470 
+318246.388849  7410340.515229 
+318258.865396  7410338.295609 
+318278.870752  7410329.437126 
+318289.442419  7410322.128378 
+318295.519891  7410311.940123 
+318301.259268  7410305.521223 
+318310.387845  7410284.574811 
+318318.625830  7410269.147453 
+318324.777518  7410255.939716 
+318332.256849  7410240.492362 
+318347.702039  7410220.695753 
+318362.388576  7410200.629190 
+318368.985560  7410179.622788 
+318378.345032  7410159.686203 
+318385.395559  7410140.949412 
+318398.449342  7410125.632036 
+318410.678502  7410113.074187 
+318422.816954  7410093.447549 
+318429.059351  7410066.132228 
+318438.707440  7410055.274088 
+318446.788746  7410046.395609 
+318458.399439  7410038.346987 
+318475.815478  7410031.198212 
+318494.229311  7410025.079260 
+318516.452903  7410018.550378 
+318529.984967  7410016.670700 
+318545.809484  7410010.671728 
+318557.362453  7410004.892718 
+318575.932965  7409992.224888 
+318597.480365  7409971.568426 
+318613.387344  7409953.801469 
+318629.269584  7409936.784384 
+318640.220579  7409924.446497 
+318645.828016  7409912.988460 
+318656.374945  7409896.351310 
+318661.924658  7409876.574697 
+318661.462869  7409853.888583 
+318660.968095  7409842.790484 
+318661.504100  7409820.884237 
+318666.534301  7409812.185727 
+318674.153818  7409801.277595 
+318699.494485  7409781.211032 
+318718.518539  7409770.822812 
+318733.881266  7409764.633872 
+318755.486391  7409752.285987 
+318766.833204  7409744.747278 
+318771.574787  7409737.298554 
+318773.355973  7409726.500404 
+318770.585239  7409715.352313 
+318763.188370  7409706.613810 
+318757.877798  7409695.655687 
+318748.064783  7409681.818057 
+318742.333653  7409667.070584 
+318735.167678  7409649.013677 
+318731.374412  7409627.507360 
+318730.277664  7409609.840387 
+318732.875226  7409586.724346 
+318735.530513  7409581.745199 
+318739.513442  7409574.276478 
+318747.545271  7409567.157698 
+318758.826114  7409562.388515 
+318774.403244  7409557.969272 
+318798.094664  7409553.729998 
+318826.857517  7409549.370744 
+318852.833144  7409545.191460 
+318868.913293  7409540.782216 
+318884.572885  7409533.333492 
+318896.348503  7409528.574307 
+318907.588115  7409514.976636 
+318913.022381  7409499.989203 
+318912.074064  7409486.871450 
+318910.721683  7409479.782664 
+318907.217035  7409467.604750 
+318901.898216  7409456.646627 
+318897.428759  7409442.179105 
+318895.515633  7409427.011703 
+318893.165458  7409409.064778 
+318888.753724  7409392.087686 
+318884.078111  7409375.850467 
+318879.138619  7409359.863205 
+318871.774735  7409339.276732 
+318870.504816  7409328.918506 
+318873.514690  7409319.920047 
+318876.392624  7409305.622496 
+318881.530026  7409292.644719 
+318882.948378  7409276.047562 
+318882.445358  7409265.199420 
+318883.236996  7409253.621404 
+318887.087986  7409241.373502 
+318891.763598  7409226.366072 
+318898.533754  7409218.957341 
+318906.738753  7409215.377954 
+318914.886029  7409214.058180 
+318927.807873  7409214.608086 
+318937.653872  7409216.347788 
+318945.999057  7409217.557581 
+318958.022062  7409223.636540 
+318963.876885  7409223.016646 
+318969.484322  7409221.636882 
+318976.741005  7409215.257975 
+318980.938337  7409209.558951 
+318987.947633  7409195.221407 
+318990.099899  7409184.133306 
+318994.066336  7409169.275851 
+318995.591888  7409145.559914 
+318996.820577  7409125.373371 
+319002.395029  7409103.207168 
+319006.163556  7409083.550535 
+319016.974365  7409070.532765 
+319032.180414  7409050.486199 
+319041.152313  7409043.757351 
+319056.012020  7409032.289316 
+319071.688105  7409015.782143 
+319078.128411  7409007.763517 
+319090.679174  7408998.805051 
+319103.188706  7408993.375981 
+319120.481052  7408992.286168 
+319142.094422  7408991.496303 
+319166.998039  7408991.736262 
+319188.339284  7408992.206182 
+319205.623383  7408992.376153 
+319222.643603  7408992.546123 
+319237.725959  7408984.617482 
+319244.867195  7408982.417858 
+319260.394847  7408979.798307 
+319270.834575  7408978.138591 
+319285.603574  7408975.758999 
+319293.297307  7408968.770196 
+319301.007533  7408960.761568 
+319305.460497  7408948.693635 
+319324.286642  7408946.603993 
+319332.392687  7408948.703633 
+319339.740078  7408951.303188 
+319349.066565  7408958.212005 
+319361.196770  7408965.150816 
+319372.032317  7408973.599369 
+319381.424774  7408974.449223 
+319393.142668  7408972.289593 
+319421.386008  7408969.040150 
+319435.858143  7408969.939996 
+319442.933409  7408974.309247 
+319450.528187  7408977.158759 
+319463.144920  7408985.117396 
+319473.032150  7408987.736947 
+319488.015552  7408989.146706 
+319507.328224  7408988.836759 
+319527.201640  7408984.237547 
+319540.931614  7408983.367696 
+319563.048004  7408983.587658 
+319574.180416  7408988.246860 
+319588.594827  7408994.955711 
+319597.162660  7409001.354615 
+319603.330841  7409018.831621 
+319611.453378  7409019.931433 
+319617.819468  7409018.981595 
+319629.009603  7409018.081749 
+319638.979296  7409012.882640 
+319646.920416  7409006.393752 
+319654.655380  7408996.375468 
+319658.613571  7408982.277882 
+319666.967003  7408961.651415 
+319675.485359  7408949.613477 
+319686.477585  7408943.164582 
+319704.091533  7408936.525719 
+319717.326733  7408934.636043 
+319727.741723  7408934.736026 
+319746.031862  7408935.175950 
+319757.197259  7408936.805671 
+319773.697966  7408938.735341 
+319782.133860  7408934.026147 
+319789.802855  7408929.806870 
+319795.476261  7408922.288158 
+319805.495431  7408912.289871 
+319819.060481  7408903.331405 
+319836.740399  7408890.133666 
+319848.153183  7408868.277410 
+319856.465383  7408851.190336 
+319867.606041  7408831.103777 
+319884.403613  7408805.268203 
+319894.546476  7408783.401948 
+319910.107113  7408754.516896 
+319929.271353  7408720.372744 
+319951.000171  7408684.478893 
+319967.773004  7408660.912929 
+319972.489848  7408647.325257 
+319978.996124  7408632.997711 
+319990.079058  7408618.970114 
+320007.091032  7408596.673933 
+320017.415313  7408581.626510 
+320024.713227  7408564.279482 
+320030.172232  7408553.221376 
+320031.524613  7408544.902801 
+320031.978156  7408526.725914 
+320031.862709  7408513.348206 
+320035.540528  7408502.520061 
+320036.958879  7408488.402479 
+320034.534488  7408477.514344 
+320021.183840  7408466.526226 
+320010.084414  7408458.587586 
+320002.761761  7408453.718420 
+319993.253857  7408439.990771 
+319991.348978  7408427.842852 
+319991.200546  7408417.494625 
+319992.058154  7408408.666137 
+319990.425400  7408395.518389 
+319987.992762  7408384.890209 
+319980.752571  7408372.952254 
+319971.978582  7408360.994303 
+319965.208427  7408352.845698 
+319957.968236  7408340.907743 
+319953.474040  7408333.289048 
+319952.863819  7408318.381602 
+319954.719221  7408311.332809 
+319966.997859  7408303.884085 
+319975.953265  7408298.415022 
+319985.716802  7408288.416734 
+319994.202174  7408279.408278 
+320000.708450  7408264.830775 
+320005.895329  7408255.292408 
+320012.121233  7408242.974518 
+320017.357589  7408228.387017 
+320026.337734  7408220.398385 
+320037.857719  7408212.939663 
+320046.846110  7408204.441119 
+320056.824049  7408197.972227 
+320066.884450  7408184.194587 
+320074.207103  7408164.567949 
+320075.608963  7408152.460023 
+320078.107570  7408132.543434 
+320079.583646  7408112.866805 
+320088.027786  7408083.661807 
+320092.835338  7408062.245476 
+320087.953570  7408043.008771 
+320083.277957  7408028.311288 
+320079.097118  7408015.643458 
+320076.441832  7408002.235755 
+320061.656340  7407982.899067 
+320043.630080  7407980.699444 
+320031.895694  7407984.878728 
+320015.840283  7407989.257978 
+320003.413213  7407987.118344 
+319996.882199  7407979.219697 
+319994.960827  7407969.101430 
+319996.074068  7407960.022985 
+319997.236786  7407946.405318 
+319994.532023  7407937.786794 
+319991.085098  7407926.898659 
+319990.417154  7407918.560088 
+319995.364892  7407906.992069 
+320004.542947  7407904.812442 
+320015.807298  7407897.103763 
+320026.535644  7407891.394741 
+320041.881879  7407882.466270 
+320047.802673  7407875.197515 
+320051.818587  7407856.300752 
+320051.488738  7407839.633607 
+320047.324391  7407825.206078 
+320045.271080  7407802.959889 
+320037.907196  7407778.144140 
+320032.200804  7407765.206356 
+320033.058412  7407756.377868 
+320037.725779  7407747.589373 
+320043.118814  7407742.590230 
+320054.168763  7407731.342156 
+320067.511164  7407719.354210 
+320084.490153  7407699.577597 
+320081.356585  7407683.640327 
+320077.390148  7407674.511891 
+320067.750305  7407672.392254 
+320058.522773  7407662.493949 
+320053.467833  7407653.315522 
+320051.736125  7407649.256217 
+320045.765854  7407630.589416 
+320042.830196  7407614.362194 
+320041.568522  7407601.434408 
+320043.687804  7407593.625746 
+320047.860396  7407588.506623 
+320059.438104  7407587.936720 
+320071.279691  7407586.107034 
+320118.679025  7407597.045160 
+320172.576389  7407596.285290 
+320214.920783  7407601.164455 
+320223.241230  7407602.644201 
+320231.817310  7407606.663513 
+320236.369229  7407610.192908 
+320242.957967  7407619.801262 
+320245.769932  7407628.669743 
+320260.679117  7407622.060875 
+320275.497593  7407614.382190 
+320286.786683  7407604.903814 
+320298.603532  7407592.395957 
+320309.117476  7407583.667452 
+320325.016208  7407570.939632 
+320597.818011  7407607.713333 
+320617.988291  7407611.932610 
+320752.566775  7407630.059505 
+321039.337692  7407658.644609 
+321300.413354  7407685.050086 
+321356.331044  7407684.780132 
+321364.602014  7407675.361745 
+321361.352999  7407680.190918 
+321517.569592  7407682.160581 
+321537.731626  7407782.963314 
+321446.998350  7407808.168997 
+321401.635835  7407868.658635 
+321361.311768  7407984.588777 
+321371.396908  7408024.911870 
+321426.836316  7408060.195827 
+321436.921456  7408110.597193 
+321497.407558  7408145.881150 
+321598.217728  7408216.449062 
+321704.066344  7408372.702297 
+321799.829821  7408443.270209 
+321935.925612  7408473.505031 
+321996.263281  7408563.349641 
+321973.693348  7408865.477889 
+322122.339902  7408827.174450 
+322153.997181  7408817.926034 
+322179.230647  7408821.955344 
+322203.441580  7408824.214957 
+322238.108734  7408813.926719 
+322253.496200  7408815.526445 
+322284.716429  7408813.396810 
+322313.132940  7408807.247863 
+322329.963497  7408801.988764 
+322358.701611  7408803.438516 
+322380.933448  7408809.517475 
+322404.113603  7408809.247521 
+322415.180044  7408807.857759 
+322542.592554  7408824.914837 
+322552.166428  7408825.304770 
+322618.490861  7408831.143770 
+322646.717708  7408831.833652 
+322706.362695  7408824.314940 
+322746.307436  7408812.696930 
+322797.541267  7408796.149764 
+322856.287414  7408773.943568 
+322892.216241  7408763.895289 
+322973.557060  7408733.830439 
+323012.512254  7408723.502208 
+323084.922405  7408707.474954 
+323121.346006  7408697.166719 
+323156.079129  7408692.207569 
+323171.128500  7408685.708682 
+323189.567072  7408664.212364 
+323240.083481  7408624.859105 
+323266.083846  7408604.292628 
+323285.949016  7408575.167617 
+323310.407336  7408525.216173 
+323369.953367  7408430.022479 
+323376.789492  7408433.241927 
+323381.753723  7408451.678769 
+323378.001688  7408480.363856 
+323369.186468  7408506.809326 
+323349.016188  7408583.066264 
+323338.073440  7408622.979427 
+323332.771113  7408647.615207 
+323340.761711  7408665.532138 
+323356.272871  7408680.809521 
+323412.033882  7408714.133813 
+323433.168971  7408686.008631 
+323471.142864  7408626.788774 
+323499.311987  7408595.554125 
+323531.612473  7408575.157618 
+323560.243386  7408565.459280 
+323595.751655  7408563.279653 
+323625.256668  7408566.999016 
+323662.950188  7408582.016444 
+323694.623960  7408599.153508 
+323744.876490  7408637.856879 
+323762.630624  7408649.064959 
+323778.042830  7408652.944294 
+323792.391271  7408651.764496 
+323803.399989  7408644.275779 
+323816.610450  7408629.438321 
+323865.461121  7408626.088894 
+323902.181586  7408619.340050 
+323929.468363  7408602.053011 
+323981.502078  7408563.689583 
+324000.311730  7408553.851268 
+323944.542473  7408521.396827 
+323919.341992  7408488.632439 
+323909.265098  7408387.819708 
+323932.321559  7408300.704630 
+323962.189406  7408173.676388 
+323987.381641  7408069.404249 
+324226.802701  7408091.700430 
+324388.098973  7408147.140934 
+324473.785555  7408232.826257 
+324605.832447  7408468.165945 
+324674.861644  7408739.399485 
+324786.292958  7408782.232148 
+324947.589230  7408767.114738 
+325164.324910  7408757.036464 
+325209.695671  7408787.281284 
+325270.173526  7408757.036464 
+325426.431351  7408741.909055 
+325541.730148  7409353.814242 
+Region 1
+171
+320590.668529  7394417.702662 
+320570.011721  7394476.472595 
+320568.543892  7394484.331249 
+320549.453868  7394530.903272 
+320537.991607  7394560.358227 
+320525.820171  7394599.411537 
+320479.657772  7394708.622830 
+320405.985947  7394870.235148 
+320381.700798  7394935.883902 
+320372.349572  7394970.877908 
+320365.571171  7395000.312866 
+320356.698227  7395038.366348 
+320352.756528  7395105.674819 
+320351.461870  7395155.456292 
+320350.060011  7395177.552507 
+320353.531674  7395239.561885 
+320358.553628  7395296.252175 
+320366.404040  7395347.883331 
+320377.330296  7395439.667609 
+320387.250511  7395528.912322 
+320407.123927  7395687.585143 
+320383.778848  7395733.017361 
+320392.660038  7395796.126551 
+320390.804637  7395835.439817 
+320377.305557  7395872.873405 
+320334.886947  7395944.311168 
+320267.944046  7396038.704999 
+320230.844254  7396050.452987 
+320282.383196  7396157.084722 
+320290.316070  7396178.331083 
+320297.745924  7396227.812607 
+320295.115376  7396267.875744 
+320296.665667  7396294.611165 
+320309.612250  7396320.956652 
+320315.293903  7396337.903749 
+320320.695184  7396358.880156 
+320322.509354  7396382.846051 
+320329.972193  7396399.303232 
+320337.888574  7396422.069332 
+320344.320634  7396470.031117 
+320340.510876  7396529.990846 
+320329.164062  7396582.821797 
+320323.012374  7396620.585328 
+320312.721079  7396667.877228 
+320308.449531  7396692.792960 
+320307.484722  7396717.488730 
+320306.231295  7396745.463938 
+320321.915626  7396777.378471 
+320432.208961  7396888.099506 
+320457.615597  7396909.775793 
+320584.657027  7397045.872481 
+320602.031835  7397059.150206 
+320621.393984  7397076.227281 
+320632.691320  7397088.945103 
+320646.742897  7397104.962359 
+320661.569620  7397119.469874 
+320672.083564  7397133.687439 
+320681.377066  7397143.615738 
+320687.149427  7397149.714693 
+320695.445135  7397158.113255 
+320697.943743  7397171.510960 
+320700.013547  7397186.898324 
+320696.706809  7397217.623061 
+320702.874989  7397270.414019 
+320706.478592  7397280.662263 
+320708.424702  7397312.206860 
+320758.627755  7397294.119958 
+320872.565923  7397259.935813 
+320954.607672  7397239.429326 
+321025.253130  7397232.590497 
+321089.062463  7397223.472059 
+321155.156001  7397230.310888 
+321439.873607  7397044.702681 
+321435.824708  7396919.844068 
+321439.766406  7396810.552789 
+321460.010902  7396574.223270 
+321538.275877  7396361.519704 
+321734.049639  7396143.926976 
+321851.319285  7396032.046140 
+321998.324839  7395885.191295 
+322149.478247  7395741.825852 
+322323.325281  7395595.220964 
+322440.265078  7395484.729890 
+322541.866886  7395376.308462 
+322679.249088  7395255.479159 
+322778.038931  7395159.315631 
+322908.486054  7395063.202094 
+322960.626970  7395008.331493 
+323055.293698  7394922.096264 
+323196.576368  7394782.140237 
+323287.581769  7394707.702988 
+323222.428301  7394645.443652 
+323177.948133  7394563.257730 
+323163.756370  7394483.771345 
+323167.590867  7394443.338271 
+323165.661249  7394282.015904 
+323146.868090  7394239.923114 
+323124.116739  7394203.979271 
+323100.408826  7394172.134726 
+323080.222053  7394152.618069 
+323037.861167  7394125.962635 
+322826.287627  7394000.014208 
+322499.473014  7393798.698692 
+322483.970100  7393790.020179 
+322461.342443  7393780.821754 
+322433.618616  7393774.642813 
+322410.224060  7393772.543172 
+322370.271072  7393773.443018 
+322325.782658  7393760.095304 
+322267.292144  7393743.938072 
+322216.957152  7393724.751359 
+322189.521943  7393709.693938 
+322171.487436  7393692.626861 
+322145.858151  7393666.661309 
+322121.762665  7393638.156191 
+322102.466486  7393618.809505 
+322078.090628  7393600.462648 
+322053.442644  7393586.944963 
+322023.187224  7393575.926851 
+322000.048301  7393570.017863 
+321977.148519  7393570.717743 
+321931.068582  7393580.216116 
+321820.602076  7393594.613650 
+321795.921108  7393597.333184 
+321770.992752  7393593.703806 
+321743.021538  7393586.764994 
+321701.056470  7393575.976842 
+321647.876529  7393577.586566 
+321632.299399  7393601.152530 
+321610.117039  7393620.119281 
+321570.609348  7393647.164648 
+321457.446324  7393720.942011 
+321396.284032  7393764.414565 
+321374.109918  7393778.562141 
+321350.121633  7393807.667156 
+321335.558789  7393830.223292 
+321293.321596  7393931.615924 
+321281.306838  7393952.402364 
+321273.143070  7393963.540456 
+321264.476281  7393969.349461 
+321253.789166  7393974.908509 
+321237.733755  7393980.437562 
+321218.643731  7393983.177093 
+321193.204110  7393980.307584 
+321166.758448  7393971.599076 
+321150.769007  7393966.229995 
+321121.767014  7393954.462011 
+321074.227494  7393937.314948 
+321027.446627  7393920.407844 
+321018.515960  7393917.648317 
+320963.406400  7393897.361792 
+320927.296156  7393881.784460 
+320884.333295  7393867.696873 
+320871.873240  7393865.367272 
+320856.856854  7393865.837192 
+320833.181926  7393869.826508 
+320814.339289  7393877.375215 
+320801.838003  7393888.513308 
+320795.463667  7393897.891701 
+320782.426376  7393918.408187 
+320775.507789  7393938.444755 
+320752.146217  7394000.004210 
+320741.500333  7394022.800305 
+320727.094169  7394061.873613 
+320706.561054  7394115.714390 
+320681.830609  7394182.982868 
+320666.599821  7394221.756226 
+320639.230581  7394292.724070 
+320620.866225  7394345.954952 
+320601.792694  7394391.277189 
+320590.668529  7394417.702662 
+Region 1
+367
+318137.109801  7391777.094974 
+318157.115156  7391774.235464 
+318196.969189  7391732.072686 
+318223.695223  7391681.961270 
+318227.034946  7391625.160999 
+318223.695223  7391571.710155 
+318214.137841  7391495.123274 
+318218.656776  7391494.383400 
+318301.754042  7391488.984325 
+318315.739649  7391480.505777 
+318345.689959  7391473.866915 
+318363.872897  7391466.138238 
+318401.483955  7391421.005969 
+318416.706497  7391401.979228 
+318436.703606  7391384.842164 
+318459.537419  7391372.474282 
+318492.843945  7391351.537868 
+318529.960229  7391318.223575 
+318537.876610  7391297.777077 
+318537.571500  7391283.019605 
+318537.571500  7391264.932703 
+318538.528062  7391239.237105 
+318545.191017  7391202.123462 
+318555.474066  7391179.767291 
+318567.076513  7391161.200472 
+318590.866888  7391132.645363 
+318610.863998  7391112.658786 
+318629.888052  7391096.481557 
+318646.792825  7391084.673580 
+318682.226878  7391045.090360 
+318700.310861  7391022.254272 
+318733.617387  7391000.368021 
+318753.606250  7390978.471771 
+318762.174084  7390959.445030 
+318769.793601  7390943.267801 
+318778.369681  7390925.270884 
+318782.146454  7390912.813018 
+318790.722534  7390902.344811 
+318937.299284  7390809.060790 
+318937.282792  7390809.070788 
+318987.271442  7390814.669829 
+319066.641412  7390823.018399 
+319134.516136  7390826.917731 
+319184.323369  7390825.817920 
+319230.625954  7390827.097700 
+319257.846762  7390828.927387 
+319269.333761  7390824.218194 
+319273.869188  7390822.668459 
+319311.801849  7390817.509343 
+319347.417319  7390807.781009 
+319391.575884  7390795.883047 
+319422.441525  7390783.725130 
+319451.781614  7390766.388099 
+319471.993125  7390752.570466 
+319478.821004  7390744.891781 
+319552.113502  7390704.138762 
+319596.387515  7390685.212004 
+319685.826132  7390644.648952 
+319734.948928  7390627.411905 
+319806.550949  7390607.835258 
+319851.113579  7390596.317231 
+319968.152331  7390592.297919 
+319999.999274  7390582.759553 
+320113.203528  7390565.742468 
+320132.029673  7390564.162739 
+320158.302163  7390560.743324 
+320194.626809  7390557.223927 
+320220.313818  7390552.494737 
+320311.682053  7390535.307681 
+320451.686557  7390505.742746 
+320557.296033  7390478.787363 
+320638.051370  7390469.119019 
+320688.007035  7390463.140043 
+320707.633064  7390460.790445 
+320736.816474  7390489.175583 
+320761.200579  7390516.360927 
+320776.398382  7390531.958255 
+320793.410355  7390535.337676 
+320878.437240  7390555.024304 
+320898.450841  7390566.862276 
+320914.242373  7390600.816460 
+320924.467699  7390629.651521 
+320936.968985  7390660.776190 
+320951.927647  7390682.132532 
+321029.780311  7390696.800019 
+321064.793806  7390702.978961 
+321093.548412  7390702.069117 
+321154.793167  7390664.825496 
+321187.712120  7390647.498464 
+321202.753245  7390642.259361 
+321218.750932  7390643.389168 
+321227.640369  7390645.238851 
+321239.036660  7390650.397967 
+321251.158619  7390662.955816 
+321258.398809  7390684.132189 
+321263.593934  7390714.377008 
+321266.686271  7390736.613200 
+321272.656542  7390757.269661 
+321281.240868  7390766.488082 
+321293.346335  7390780.055758 
+321330.042061  7390805.251442 
+321344.505950  7390808.660858 
+321359.769722  7390807.751014 
+321380.921304  7390800.012340 
+321401.042107  7390794.293319 
+321427.792879  7390785.574813 
+321449.109385  7390790.304003 
+321469.840409  7390808.510884 
+321479.067941  7390834.276471 
+321477.666082  7390855.142896 
+321474.466545  7390877.509065 
+321474.326359  7390898.115536 
+321482.547851  7390924.141078 
+321492.261910  7390953.975967 
+321492.187694  7390965.434005 
+321483.636353  7390987.410240 
+321476.536348  7390998.948264 
+321453.776752  7391046.600102 
+321437.366753  7391066.846634 
+321431.676854  7391082.583938 
+321433.589979  7391099.900972 
+321439.354094  7391113.428654 
+321459.549113  7391134.954967 
+321485.557725  7391161.340448 
+321495.082121  7391182.266863 
+321498.017779  7391198.074155 
+321494.109066  7391213.061588 
+321477.253770  7391235.417759 
+321469.337389  7391267.862201 
+321466.121359  7391293.547802 
+321479.496745  7391308.125305 
+321510.700482  7391357.716810 
+321521.280396  7391371.794399 
+321537.673902  7391392.260893 
+321559.443951  7391405.388644 
+321591.934100  7391413.507254 
+321610.479873  7391414.147144 
+321628.547364  7391410.957690 
+321684.077481  7391393.790631 
+321748.546513  7391367.525130 
+321795.014022  7391341.369610 
+321817.996267  7391324.482503 
+321839.955979  7391310.384918 
+321869.526962  7391297.097194 
+321894.447071  7391295.997382 
+321907.888427  7391301.936365 
+321924.850924  7391312.244599 
+321926.326999  7391319.383376 
+321931.818989  7391335.190669 
+321933.773345  7391347.678530 
+321936.412139  7391370.604603 
+321937.360456  7391376.423606 
+321948.121787  7391407.328312 
+321976.249679  7391420.496057 
+322011.279667  7391428.634663 
+322040.232183  7391431.894104 
+322059.759257  7391431.684140 
+322075.047769  7391433.403846 
+322106.507139  7391443.292152 
+322127.708198  7391466.588161 
+322135.740026  7391481.915536 
+322139.920865  7391502.821955 
+322141.363956  7391517.079513 
+322150.377086  7391536.476190 
+322164.189522  7391562.791683 
+322169.219723  7391570.200414 
+322226.712443  7391602.414896 
+322368.531118  7391684.830778 
+322422.972732  7391717.525178 
+322482.436301  7391757.128395 
+322548.703011  7391847.932841 
+322556.776071  7391855.881479 
+322567.908482  7391864.609984 
+322581.102451  7391869.279184 
+322662.278346  7391893.764990 
+322692.723429  7391904.153210 
+322706.420418  7391907.812584 
+322718.097081  7391909.932221 
+322733.360854  7391909.022376 
+322766.197344  7391902.633471 
+322799.091558  7391887.836005 
+322866.661172  7391863.280212 
+322906.746099  7391867.469494 
+322776.703042  7391931.958448 
+322650.156387  7391999.996793 
+322563.909060  7392044.009254 
+322555.448428  7392051.328001 
+322549.882222  7392055.577273 
+322537.908695  7392066.175458 
+322529.175937  7392079.143236 
+322489.643507  7392130.264480 
+322473.381940  7392157.059890 
+322449.302947  7392184.045268 
+322409.201527  7392233.856735 
+322367.079781  7392291.606843 
+322301.893328  7392374.662616 
+322394.119171  7392445.280520 
+322405.647402  7392453.929039 
+322421.793521  7392481.394334 
+322426.188762  7392503.430560 
+322424.720933  7392522.537287 
+322415.913959  7392544.573512 
+322402.678759  7392556.331498 
+322419.501069  7392592.515300 
+322361.060033  7392681.410073 
+322272.322345  7392799.509844 
+322163.966874  7392944.624987 
+322253.578662  7393013.393208 
+322182.619848  7393104.547594 
+322113.953485  7393197.501672 
+322046.054022  7393285.626577 
+322094.401672  7393384.509639 
+322023.187224  7393575.926851 
+322000.048301  7393570.017863 
+321977.148519  7393570.717743 
+321931.068582  7393580.216116 
+321820.602076  7393594.613650 
+321795.921108  7393597.333184 
+321770.992752  7393593.703806 
+321743.021538  7393586.764994 
+321701.056470  7393575.976842 
+321647.876529  7393577.586566 
+321632.299399  7393601.152530 
+321610.117039  7393620.119281 
+321570.609348  7393647.164648 
+321457.446324  7393720.942011 
+321396.284032  7393764.414565 
+321374.109918  7393778.562141 
+321350.121633  7393807.667156 
+321335.558789  7393830.223292 
+321293.321596  7393931.615924 
+321281.306838  7393952.402364 
+321273.143070  7393963.540456 
+321264.476281  7393969.349461 
+321253.789166  7393974.908509 
+321237.733755  7393980.437562 
+321218.643731  7393983.177093 
+321193.204110  7393980.307584 
+321166.758448  7393971.599076 
+321150.769007  7393966.229995 
+321121.767014  7393954.462011 
+321074.227494  7393937.314948 
+321027.446627  7393920.407844 
+321018.515960  7393917.648317 
+320963.406400  7393897.361792 
+320927.296156  7393881.784460 
+320884.333295  7393867.696873 
+320871.873240  7393865.367272 
+320856.856854  7393865.837192 
+320833.181926  7393869.826508 
+320814.339289  7393877.375215 
+320801.838003  7393888.513308 
+320795.463667  7393897.891701 
+320782.426376  7393918.408187 
+320775.507789  7393938.444755 
+320752.146217  7394000.004210 
+320741.500333  7394022.800305 
+320727.094169  7394061.873613 
+320706.561054  7394115.714390 
+320681.830609  7394182.982868 
+320666.599821  7394221.756226 
+320639.230581  7394292.724070 
+320620.866225  7394345.954952 
+320601.792694  7394391.277189 
+320590.668529  7394417.702662 
+320555.721003  7394311.490855 
+320515.982418  7394179.643440 
+320499.193092  7394133.031424 
+320452.016407  7393999.974215 
+320430.963780  7393935.585245 
+320424.886308  7393921.887591 
+320416.079333  7393907.939980 
+320407.420791  7393898.191650 
+320388.141104  7393888.103378 
+320376.151085  7393875.325567 
+320299.147783  7393842.591174 
+320254.230565  7393816.785594 
+320219.942738  7393798.638702 
+320201.083608  7393788.440449 
+320185.110659  7393774.952759 
+320172.213555  7393761.175119 
+320163.266394  7393749.317151 
+320156.908550  7393735.069591 
+320151.391822  7393718.492431 
+320147.326430  7393699.725645 
+320143.343501  7393683.948348 
+320149.750822  7393662.422035 
+320153.610058  7393647.204642 
+320158.986601  7393628.947769 
+320139.401803  7393628.377866 
+320126.422236  7393629.857613 
+320107.332212  7393631.337359 
+319947.099704  7393498.110180 
+319934.408755  7393475.274092 
+319944.559865  7393454.977568 
+320017.868856  7393370.632016 
+319972.860929  7393270.229214 
+319955.766493  7393280.517452 
+319942.836403  7393284.136832 
+319933.526408  7393281.547275 
+319927.663338  7393273.868591 
+319912.737661  7393190.252913 
+319898.306757  7393106.667231 
+319887.858783  7393049.167080 
+319874.829739  7393026.740921 
+319861.066780  7393009.263915 
+319836.286857  7392990.347155 
+319794.000186  7392960.032348 
+319730.100145  7393005.004645 
+319463.590216  7392947.154554 
+319397.224552  7392932.737023 
+319321.598371  7392916.339832 
+319274.866982  7392900.972464 
+319263.314013  7392893.533739 
+319249.757209  7392880.026052 
+319238.723753  7392866.528364 
+319138.185709  7392698.427159 
+319115.607529  7392510.169405 
+319084.799612  7392285.237934 
+318991.584220  7392249.454064 
+318954.401966  7392234.186679 
+318931.287782  7392228.897585 
+318910.672205  7392229.957403 
+318884.779041  7392231.207189 
+318859.133264  7392230.687278 
+318841.544054  7392227.987741 
+318806.613021  7392220.059099 
+318783.490590  7392213.260263 
+318759.122978  7392202.412121 
+318734.499734  7392195.343332 
+318696.558827  7392185.614999 
+318663.639874  7392176.446569 
+318627.422429  7392173.527069 
+318588.178617  7392146.651673 
+318574.836216  7392137.953163 
+318561.139227  7392130.404456 
+318541.348273  7392120.576139 
+318523.462199  7392111.137756 
+318505.592617  7392106.278588 
+318488.547658  7392113.227398 
+318475.056825  7392077.453526 
+318454.416510  7392119.136386 
+318445.757968  7392132.164154 
+318438.963074  7392137.533235 
+318430.642627  7392142.922311 
+318420.021482  7392144.122106 
+318410.909397  7392144.172097 
+318395.711594  7392140.052803 
+318378.617158  7392139.382918 
+318364.994385  7392174.656876 
+318311.451609  7392168.307963 
+318311.484594  7392148.871292 
+318314.535699  7392129.214659 
+318322.625252  7392098.509919 
+318330.945698  7392082.192714 
+318333.757663  7392054.207508 
+318327.507020  7392035.460719 
+318314.956257  7392021.203161 
+318302.908514  7392009.725127 
+318278.813028  7391988.778715 
+318265.256225  7391975.520986 
+318245.679673  7391958.153961 
+318228.362589  7391939.557146 
+318218.079539  7391921.020321 
+318214.343997  7391898.774132 
+318149.404931  7391793.632142 
+318137.109801  7391777.094974 
+Region 1
+691
+315576.902572  7387892.880305 
+315576.877833  7387892.920298 
+315585.132310  7387913.956695 
+315592.141606  7387931.943614 
+315595.464837  7387937.512660 
+315600.082726  7387945.351317 
+315604.280058  7387956.599391 
+315607.339409  7387964.917966 
+315604.733600  7387985.594424 
+315596.874942  7388017.508957 
+315583.153215  7388061.421436 
+315583.177953  7388061.501422 
+315571.039502  7388094.955692 
+315563.807558  7388118.011742 
+315552.444252  7388144.677175 
+315547.059463  7388168.353119 
+315546.993493  7388168.403111 
+315541.773629  7388185.620162 
+315538.854464  7388207.066488 
+315547.348081  7388229.222693 
+315558.760864  7388254.838305 
+315570.783869  7388281.243782 
+315575.822316  7388294.151571 
+315581.759602  7388309.408958 
+315590.797470  7388329.125580 
+315595.209204  7388343.133181 
+315595.687485  7388353.771359 
+315592.562164  7388358.720511 
+315585.165295  7388362.719826 
+315573.529863  7388362.469869 
+315568.491417  7388365.509348 
+315565.324864  7388373.997894 
+315567.526608  7388385.205974 
+315569.934507  7388404.732630 
+315570.066447  7388426.448910 
+315560.022538  7388445.815592 
+315545.245292  7388468.331736 
+315525.561540  7388491.677737 
+315509.473144  7388504.435551 
+315493.228069  7388513.533993 
+315471.837347  7388526.221820 
+315457.843494  7388535.570218 
+315445.045344  7388546.818292 
+315434.036626  7388561.735736 
+315426.450094  7388572.273931 
+315422.285747  7388586.621474 
+315427.530350  7388599.869204 
+315443.569268  7388614.586683 
+315456.194248  7388625.594798 
+315456.218986  7388625.604796 
+315456.235479  7388625.624793 
+315473.412377  7388635.783053 
+315473.461855  7388635.813048 
+315493.665120  7388644.041638 
+315517.999746  7388649.330732 
+315538.689539  7388651.700326 
+315553.442046  7388655.319706 
+315563.321030  7388657.439343 
+315573.208260  7388658.229208 
+315581.974004  7388663.848245 
+315576.778878  7388678.955658 
+315568.408954  7388687.274233 
+315553.870850  7388698.832253 
+315546.424503  7388706.600922 
+315537.535067  7388714.909499 
+315530.088720  7388731.096726 
+315527.903469  7388742.144834 
+315527.680821  7388751.553222 
+315525.949113  7388776.119014 
+315520.300445  7388794.545858 
+315512.062460  7388808.183522 
+315491.875688  7388830.519696 
+315482.136889  7388842.137706 
+315471.895071  7388861.064464 
+315460.845122  7388879.191359 
+315452.640122  7388898.807999 
+315447.428504  7388915.025221 
+315444.608294  7388928.392931 
+315445.746273  7388951.448982 
+315448.352082  7388979.504176 
+315445.886459  7388996.751222 
+315440.732565  7389016.957761 
+315439.058580  7389028.005868 
+315438.943133  7389053.371524 
+315440.872751  7389070.568578 
+315451.304233  7389092.854760 
+315462.337689  7389116.250753 
+315476.669638  7389137.367136 
+315491.463376  7389162.032911 
+315505.737601  7389187.908479 
+315519.253173  7389216.763536 
+315529.775364  7389232.070914 
+315539.538901  7389259.446225 
+315554.810920  7389287.111486 
+315570.478758  7389323.195305 
+315580.209310  7389352.780238 
+315586.319767  7389378.445841 
+315588.942069  7389405.061282 
+315589.370873  7389427.767393 
+315587.655657  7389450.343526 
+315582.650195  7389474.759344 
+315579.236255  7389494.765917 
+315580.926732  7389514.282574 
+315586.319767  7389531.739583 
+315597.147068  7389547.716847 
+315612.798414  7389561.314518 
+315612.847891  7389561.354511 
+315625.002835  7389568.263327 
+315639.367769  7389578.971493 
+315652.141180  7389585.890308 
+315661.632592  7389602.397480 
+315666.860702  7389616.865002 
+315664.197169  7389633.562142 
+315662.721094  7389639.291161 
+315660.395657  7389648.089654 
+315659.637004  7389654.498556 
+315658.969059  7389659.747657 
+315660.585320  7389669.126050 
+315661.772778  7389676.244831 
+315663.116913  7389683.223636 
+315664.881607  7389692.712010 
+315664.428064  7389698.591003 
+315663.859074  7389705.289856 
+315659.373124  7389720.957172 
+315659.529803  7389740.673795 
+315661.129572  7389752.631747 
+315663.116913  7389767.899131 
+315669.540727  7389792.684886 
+315677.234460  7389822.139841 
+315686.396022  7389845.975758 
+315690.923203  7389857.823728 
+315695.458630  7389868.191952 
+315704.859333  7389889.828246 
+315722.935070  7389921.842762 
+315746.230672  7389960.466146 
+315762.310822  7389989.131236 
+315774.977032  7390020.865801 
+315782.448117  7390051.750510 
+315789.168795  7390069.007554 
+315804.712940  7390091.353727 
+315815.944306  7390115.529586 
+315820.430255  7390131.756806 
+315819.531416  7390154.452918 
+315803.558467  7390191.026654 
+315798.280880  7390212.562965 
+315787.527795  7390231.479724 
+315777.896198  7390242.317868 
+315771.942419  7390261.184636 
+315767.398746  7390281.731117 
+315764.322902  7390298.628222 
+315763.160183  7390299.558063 
+315751.846355  7390308.556522 
+315735.337401  7390322.954056 
+315734.240653  7390323.903893 
+315724.378161  7390331.292627 
+315709.873041  7390342.150767 
+315709.831810  7390342.200759 
+315709.823564  7390342.200759 
+315700.093011  7390352.269034 
+315690.321228  7390362.387301 
+315668.410993  7390386.223218 
+315646.030723  7390405.529911 
+315626.404694  7390423.896765 
+315598.812807  7390450.792158 
+315591.885973  7390457.351035 
+315586.905250  7390463.649956 
+315581.875049  7390469.908884 
+315579.739275  7390477.407599 
+315577.554024  7390484.866321 
+315586.072380  7390505.352812 
+315601.814435  7390528.028928 
+315610.398761  7390543.536272 
+315619.815956  7390557.613860 
+315629.183674  7390571.741441 
+315635.335362  7390581.729730 
+315641.437573  7390591.778008 
+315645.552442  7390601.026424 
+315649.626080  7390610.324832 
+315654.243969  7390622.022828 
+315656.206572  7390627.081961 
+315661.137818  7390640.759618 
+315668.460471  7390659.246452 
+315669.054199  7390659.986325 
+315674.133877  7390666.455217 
+315682.676972  7390668.724828 
+315691.178836  7390671.044433 
+315700.653755  7390670.484527 
+315711.250161  7390669.914624 
+315721.557950  7390670.314556 
+315732.731592  7390670.794474 
+315751.714415  7390670.924451 
+315770.771454  7390665.735340 
+315795.675071  7390658.076652 
+315805.298422  7390657.626729 
+315814.113643  7390657.256793 
+315824.602848  7390659.356433 
+315831.876023  7390660.856176 
+315835.875445  7390662.665866 
+315844.723651  7390666.725171 
+315857.925866  7390674.483842 
+315862.502524  7390677.193378 
+315879.926809  7390679.852922 
+315889.715085  7390680.402828 
+315900.492909  7390681.052717 
+315923.203028  7390684.992042 
+315935.506404  7390689.871206 
+315941.732308  7390692.370778 
+315956.138473  7390699.309589 
+315966.602940  7390704.548692 
+315979.335120  7390710.957594 
+316023.089620  7390730.564236 
+316046.195558  7390742.162249 
+316069.309742  7390750.220869 
+316085.035304  7390754.380156 
+316091.170500  7390756.009877 
+316124.905829  7390760.639084 
+316144.944170  7390760.009192 
+316180.163821  7390758.919379 
+316199.773357  7390757.859560 
+316213.124005  7390759.339307 
+316224.949100  7390760.679077 
+316243.981400  7390765.688219 
+316264.687685  7390770.917324 
+316265.611263  7390771.157282 
+316269.709640  7390772.057128 
+316317.174943  7390782.555330 
+316373.010171  7390793.163513 
+316380.209130  7390794.533278 
+316388.678009  7390795.703078 
+316437.289539  7390802.451922 
+316618.442734  7390839.395594 
+316694.885292  7390849.543856 
+316729.676139  7390854.463013 
+316748.147695  7390857.102561 
+316765.769890  7390858.652295 
+316787.135874  7390860.561968 
+316820.557847  7390858.102390 
+316853.353106  7390847.654179 
+316865.912115  7390839.285613 
+316866.753231  7390838.665719 
+316906.013535  7390809.730675 
+316933.127141  7390927.270542 
+316940.655950  7390959.964941 
+316968.132390  7391031.482691 
+316968.148883  7391031.522684 
+316974.481988  7391043.380653 
+316995.963419  7391083.603763 
+317017.939624  7391137.224578 
+317017.972608  7391137.264572 
+317132.603461  7391276.700687 
+317133.172451  7391277.440561 
+317171.492684  7391327.372008 
+317196.594211  7391352.607685 
+317214.735918  7391364.455656 
+317223.204797  7391370.004705 
+317299.746310  7391407.608264 
+317461.388923  7391487.064654 
+317501.127508  7391507.301188 
+317505.291855  7391509.420825 
+317510.033437  7391512.470302 
+317537.213014  7391529.987302 
+317575.590971  7391563.921489 
+317603.191105  7391593.726384 
+317632.019927  7391631.859852 
+317650.194620  7391655.715766 
+317680.219146  7391695.199002 
+317709.814867  7391735.372121 
+317732.409539  7391757.308364 
+317752.736498  7391776.954998 
+317773.088195  7391786.243407 
+317802.733394  7391794.372015 
+317802.741640  7391794.372015 
+317842.199854  7391795.531816 
+317877.147380  7391795.891755 
+317907.312091  7391794.182048 
+317954.843365  7391785.333563 
+318076.788624  7391771.685901 
+318093.355301  7391769.886209 
+318100.158441  7391769.166333 
+318100.174934  7391769.166333 
+318100.174934  7391769.146336 
+318107.819189  7391768.676416 
+318124.814671  7391767.636595 
+318137.109801  7391777.094974 
+318157.115156  7391774.235464 
+318196.969189  7391732.072686 
+318223.695223  7391681.961270 
+318227.034946  7391625.160999 
+318223.695223  7391571.710155 
+318214.137841  7391495.123274 
+318218.656776  7391494.383400 
+318301.754042  7391488.984325 
+318315.739649  7391480.505777 
+318345.689959  7391473.866915 
+318363.872897  7391466.138238 
+318401.483955  7391421.005969 
+318416.706497  7391401.979228 
+318436.703606  7391384.842164 
+318459.537419  7391372.474282 
+318492.843945  7391351.537868 
+318529.960229  7391318.223575 
+318537.876610  7391297.777077 
+318537.571500  7391283.019605 
+318537.571500  7391264.932703 
+318538.528062  7391239.237105 
+318545.191017  7391202.123462 
+318555.474066  7391179.767291 
+318567.076513  7391161.200472 
+318590.866888  7391132.645363 
+318610.863998  7391112.658786 
+318629.888052  7391096.481557 
+318646.792825  7391084.673580 
+318682.226878  7391045.090360 
+318700.310861  7391022.254272 
+318733.617387  7391000.368021 
+318753.606250  7390978.471771 
+318762.174084  7390959.445030 
+318769.793601  7390943.267801 
+318778.369681  7390925.270884 
+318782.146454  7390912.813018 
+318790.722534  7390902.344811 
+318937.282792  7390809.070788 
+318937.299284  7390809.060790 
+318937.282792  7390809.070788 
+318987.271442  7390814.669829 
+319066.641412  7390823.018399 
+319134.516136  7390826.917731 
+319184.323369  7390825.817920 
+319230.625954  7390827.097700 
+319257.846762  7390828.927387 
+319269.333761  7390824.218194 
+319273.869188  7390822.668459 
+319311.801849  7390817.509343 
+319347.417319  7390807.781009 
+319391.575884  7390795.883047 
+319422.441525  7390783.725130 
+319451.781614  7390766.388099 
+319471.993125  7390752.570466 
+319478.821004  7390744.891781 
+319552.113502  7390704.138762 
+319596.387515  7390685.212004 
+319685.826132  7390644.648952 
+319734.948928  7390627.411905 
+319806.550949  7390607.835258 
+319851.113579  7390596.317231 
+319968.152331  7390592.297919 
+319999.999274  7390582.759553 
+320113.203528  7390565.742468 
+320132.029673  7390564.162739 
+320158.302163  7390560.743324 
+320194.626809  7390557.223927 
+320220.313818  7390552.494737 
+320311.682053  7390535.307681 
+320451.686557  7390505.742746 
+320557.296033  7390478.787363 
+320638.051370  7390469.119019 
+320688.007035  7390463.140043 
+320707.633064  7390460.790445 
+320891.309606  7390458.760793 
+320876.697285  7390395.441639 
+320866.422482  7390373.225445 
+320858.143266  7390356.628287 
+320820.251836  7390282.311017 
+320813.028138  7390259.114991 
+320848.330252  7390142.754922 
+320917.648066  7390122.468397 
+320970.052862  7390110.630425 
+321044.640018  7390024.795128 
+321074.120293  7390026.544828 
+321070.929002  7390008.537912 
+321069.106585  7389989.461180 
+321068.207745  7389969.464605 
+321061.841655  7389951.297717 
+321040.071607  7389930.811226 
+321023.843025  7389921.752778 
+321002.823383  7389913.524187 
+320895.968726  7389869.121793 
+320769.413824  7389817.840577 
+320625.327436  7389754.821372 
+320564.288837  7389725.306427 
+320531.073020  7389702.870270 
+320419.567489  7389627.903112 
+320402.027756  7389574.232305 
+320376.390225  7389522.751123 
+320358.149563  7389505.934004 
+320341.863258  7389510.383242 
+320329.394957  7389511.563040 
+320305.794245  7389513.482711 
+320301.184602  7389489.616799 
+320292.938371  7389463.261313 
+320290.283085  7389446.834127 
+320283.603638  7389425.487783 
+320275.876920  7389406.231082 
+320270.343699  7389391.323635 
+320265.445438  7389374.756473 
+320252.622550  7389355.219820 
+320238.076199  7389334.663341 
+320223.175260  7389317.306314 
+320212.620085  7389304.328537 
+320195.756543  7389289.611058 
+320175.586263  7389277.843074 
+320155.605646  7389267.524841 
+320140.160456  7389261.685841 
+320121.655914  7389255.696867 
+320099.737433  7389245.678583 
+320079.229058  7389236.230202 
+320065.845425  7389229.311387 
+320047.992336  7389211.704403 
+320029.891860  7389181.239621 
+320016.871062  7389161.363026 
+320004.279067  7389147.365423 
+319987.093923  7389134.077699 
+319963.880783  7389120.610006 
+319949.532342  7389109.141971 
+319926.360434  7389092.794771 
+319902.067039  7389076.437573 
+319890.777949  7389064.219665 
+319876.429507  7389052.751630 
+319859.714398  7389042.243430 
+319848.367585  7389035.344611 
+319831.883370  7389031.375291 
+319810.657572  7389030.775394 
+319791.336653  7389025.116363 
+319784.360342  7389020.897086 
+319767.628740  7389010.758823 
+319754.228616  7389004.829838 
+319736.779591  7388995.861375 
+319721.400371  7388985.153209 
+319705.303729  7388965.786526 
+319693.049830  7388949.579302 
+319683.937745  7388943.710308 
+319670.595344  7388933.242101 
+319656.156194  7388928.522909 
+319637.635160  7388924.413613 
+319621.942583  7388922.233986 
+319600.947680  7388919.314486 
+319589.625606  7388910.426009 
+319578.699350  7388902.757322 
+319567.830818  7388898.628030 
+319553.721517  7388892.259121 
+319540.799674  7388888.329794 
+319521.965283  7388892.749037 
+319493.779667  7388902.477370 
+319471.473613  7388906.416696 
+319442.595313  7388906.166738 
+319419.555345  7388903.777148 
+319390.149286  7388904.297059 
+319366.573313  7388904.117090 
+319346.229862  7388906.526677 
+319289.924599  7388944.930099 
+319275.708097  7388955.158347 
+319264.798334  7388963.007002 
+319246.730843  7388970.975637 
+319226.659517  7388975.934788 
+319204.064845  7388979.534171 
+319176.439973  7388976.304724 
+319142.539719  7388969.245934 
+319105.530635  7388956.928043 
+319080.800190  7388943.330373 
+319052.812483  7388927.923012 
+319040.443137  7388921.794062 
+319016.966118  7388905.216901 
+319002.312566  7388893.518905 
+318985.671673  7388877.141710 
+318975.941121  7388862.954140 
+318967.744368  7388832.499357 
+318962.813122  7388810.733085 
+318958.648775  7388784.427591 
+318954.987449  7388766.660635 
+318953.074323  7388748.363769 
+318951.458062  7388730.176884 
+318943.714851  7388712.909842 
+318932.681395  7388697.162539 
+318919.817275  7388681.155281 
+318907.695316  7388670.487108 
+318895.589849  7388658.929088 
+318889.627825  7388646.341244 
+318884.861503  7388635.423114 
+318882.709237  7388619.665813 
+318881.068237  7388603.698548 
+318882.379388  7388588.541145 
+318882.931885  7388577.143097 
+318876.763705  7388563.775387 
+318868.187625  7388556.356658 
+318852.008520  7388551.947413 
+318832.926743  7388551.817435 
+318818.685502  7388555.956726 
+318808.278759  7388563.475438 
+318800.065514  7388575.663351 
+318794.713710  7388587.781275 
+318780.711610  7388597.029691 
+318767.492903  7388601.508924 
+318752.270361  7388602.878689 
+318733.938990  7388607.297932 
+318717.479514  7388609.757511 
+318706.883107  7388608.407742 
+318694.967304  7388606.038148 
+318679.472637  7388604.188465 
+318657.405723  7388613.876805 
+318633.673072  7388626.874579 
+318603.409405  7388638.902518 
+318575.190804  7388650.850472 
+318558.698343  7388655.739634 
+318542.667670  7388664.288170 
+318523.346752  7388674.796370 
+318511.958707  7388679.745522 
+318498.253472  7388681.685190 
+318485.768679  7388684.184762 
+318477.662634  7388679.325594 
+318469.432896  7388668.587434 
+318463.907921  7388653.120083 
+318459.009660  7388636.112996 
+318451.027309  7388613.636846 
+318442.311043  7388592.050544 
+318434.551340  7388575.553369 
+318425.777351  7388558.836233 
+318416.755974  7388537.679857 
+318411.799990  7388525.541936 
+318406.497664  7388516.943409 
+318398.474081  7388505.775322 
+318384.554444  7388500.836168 
+318365.118078  7388495.937007 
+318348.130843  7388491.187821 
+318337.278803  7388485.628773 
+318315.541739  7388477.380186 
+318297.795851  7388475.940432 
+318283.546365  7388480.969571 
+318264.975853  7388488.708245 
+318239.833096  7388491.277805 
+318222.854107  7388494.167310 
+318202.139576  7388493.357449 
+318187.650948  7388493.177480 
+318166.606568  7388494.357278 
+318150.328508  7388498.586553 
+318127.981223  7388506.505197 
+318110.218843  7388514.693794 
+318092.332768  7388524.992030 
+318074.017890  7388536.510057 
+318063.083388  7388545.788468 
+318052.338550  7388556.066707 
+318032.085807  7388559.796069 
+318015.370698  7388557.596445 
+318000.981025  7388549.217881 
+317974.642565  7388533.050650 
+317959.246852  7388523.342313 
+317936.800612  7388506.555188 
+317915.690262  7388488.678250 
+317889.912545  7388468.971626 
+317870.467933  7388456.213811 
+317852.359210  7388443.695955 
+317840.987658  7388438.346872 
+317811.886710  7388431.558035 
+317782.719792  7388429.428399 
+317750.988297  7388428.138620 
+317722.843912  7388425.909002 
+317703.160159  7388424.779196 
+317676.038307  7388422.889519 
+317659.306705  7388421.789708 
+317644.611922  7388413.851068 
+317635.071033  7388401.333212 
+317627.847335  7388390.934993 
+317608.913989  7388370.768447 
+317583.499106  7388346.302638 
+317571.418378  7388332.415017 
+317553.524058  7388310.478774 
+317541.501054  7388292.721816 
+317528.983275  7388273.625087 
+317514.923452  7388255.058267 
+317502.521121  7388242.830362 
+317486.696605  7388226.793109 
+317478.607052  7388220.714150 
+317464.720400  7388212.785508 
+317449.753491  7388210.385919 
+317432.799241  7388211.275767 
+317408.901665  7388211.865666 
+317391.427902  7388213.535380 
+317370.853557  7388218.474534 
+317355.342397  7388234.571777 
+317350.196749  7388245.909834 
+317345.265503  7388256.478024 
+317338.289192  7388275.444775 
+317337.481061  7388291.382045 
+317336.631699  7388302.010225 
+317330.414041  7388317.657545 
+317318.160143  7388326.146091 
+317300.645149  7388331.135236 
+317275.296236  7388334.244703 
+317248.949529  7388335.024570 
+317222.099802  7388335.464495 
+317196.165407  7388336.244361 
+317167.567479  7388337.884080 
+317131.506712  7388340.093702 
+317110.454085  7388342.043368 
+317083.818760  7388341.593445 
+317067.953012  7388329.325546 
+317055.361018  7388315.877850 
+317034.019773  7388291.901956 
+317020.380508  7388272.575267 
+317008.860524  7388255.588177 
+317002.576896  7388243.660220 
+316991.559932  7388227.133051 
+316982.010797  7388215.155102 
+316971.686516  7388208.056318 
+316960.859215  7388200.607594 
+316947.442598  7388196.228344 
+316935.007282  7388195.188523 
+316909.798555  7388203.067173 
+316887.162652  7388217.404717 
+316870.661944  7388230.932400 
+316859.884121  7388243.530242 
+316842.534051  7388260.037415 
+316831.517087  7388275.404782 
+316820.021842  7388296.641145 
+316810.695355  7388316.347769 
+316796.899411  7388333.904762 
+316782.616940  7388349.232136 
+316757.935971  7388364.309554 
+316737.625505  7388372.478154 
+316729.948264  7388374.327838 
+316717.042913  7388377.427307 
+316688.139875  7388378.727084 
+316664.572148  7388377.877230 
+316631.620210  7388376.907396 
+316607.227860  7388376.487468 
+316570.309485  7388373.697946 
+316543.171140  7388372.808098 
+316520.370313  7388367.868944 
+316499.680520  7388357.520717 
+316483.369476  7388331.625152 
+316466.365748  7388295.631318 
+316458.655522  7388275.824710 
+316447.704528  7388245.669876 
+316440.736463  7388223.313705 
+316424.672806  7388193.868749 
+316421.250620  7388174.332095 
+316415.890570  7388145.687002 
+316416.533776  7388118.891592 
+316416.195681  7388096.955349 
+316416.294636  7388081.008081 
+316414.711359  7388061.271461 
+316406.316696  7388055.072523 
+316392.858848  7388053.802741 
+316371.097045  7388055.402467 
+316350.761841  7388057.482110 
+316329.750445  7388056.322309 
+316310.792361  7388053.982710 
+316286.424749  7388052.013047 
+316257.299062  7388054.422634 
+316234.679652  7388059.561754 
+316213.618779  7388062.511249 
+316200.647458  7388063.121144 
+316190.059298  7388060.991509 
+316183.206680  7388053.932718 
+316178.250695  7388042.014760 
+316171.257892  7388030.296767 
+316160.686224  7388018.638764 
+316136.186673  7388002.721490 
+316115.191770  7387992.263282 
+316081.151330  7387971.786789 
+316062.630296  7387967.337551 
+316028.194036  7387962.808327 
+316003.636762  7387959.398911 
+315982.336748  7387956.469413 
+315958.859729  7387948.750735 
+315946.201765  7387940.512146 
+315930.517434  7387930.343888 
+315916.490596  7387917.536082 
+315902.381295  7387903.068560 
+315892.955854  7387897.639490 
+315872.999976  7387893.730160 
+315862.552001  7387896.699651 
+315847.824233  7387899.389190 
+315832.651169  7387896.539678 
+315814.435246  7387892.100439 
+315791.123152  7387886.941323 
+315773.434987  7387881.732215 
+315762.574701  7387876.603093 
+315744.408255  7387868.844422 
+315729.944366  7387866.224871 
+315716.519503  7387862.185563 
+315698.278841  7387859.735983 
+315686.074419  7387864.675137 
+315674.892531  7387869.404326 
+315654.821205  7387874.143515 
+315642.171487  7387881.622234 
+315627.592152  7387888.641031 
+315610.398761  7387892.080442 
+315599.678661  7387892.720333 
+315576.910818  7387892.870307 
+315576.910818  7387892.880305 
+315576.902572  7387892.880305 
+Region 1
+2805
+319142.053191  7356557.657745 
+319143.191171  7356532.931980 
+319149.672708  7356527.922838 
+319142.267593  7356517.524620 
+319134.375950  7356505.246723 
+319122.831227  7356491.589062 
+319111.896726  7356478.711268 
+319100.591143  7356470.702640 
+319090.555481  7356466.703325 
+319076.940954  7356463.873809 
+319063.516090  7356462.704010 
+319048.565674  7356461.184270 
+319035.239765  7356459.694525 
+319021.311882  7356457.744859 
+319002.931034  7356453.745544 
+318985.778874  7356449.096341 
+318968.503021  7356446.006870 
+318952.637273  7356443.807247 
+318943.088138  7356442.027552 
+318930.298234  7356438.658129 
+318913.434693  7356435.228716 
+318887.953840  7356429.149757 
+318870.166720  7356425.830326 
+318853.616535  7356422.180951 
+318840.513275  7356419.361434 
+318826.288527  7356416.851864 
+318804.848327  7356412.932535 
+318794.581770  7356411.142842 
+318759.535290  7356404.274018 
+318749.672798  7356402.824267 
+318732.380452  7356400.724626 
+318714.073820  7356399.274875 
+318684.049295  7356397.235224 
+318668.076346  7356396.035430 
+318651.600377  7356394.275731 
+318626.894670  7356391.086277 
+318599.748079  7356387.526887 
+318580.006603  7356386.177118 
+318565.155141  7356384.767360 
+318547.945258  7356384.217454 
+318533.910173  7356383.047654 
+318517.442451  7356380.728052 
+318500.158351  7356377.968524 
+318483.096900  7356374.209168 
+318462.266921  7356370.179858 
+318445.007561  7356365.970579 
+318423.484899  7356360.941441 
+318408.674668  7356356.322232 
+318390.417514  7356350.333258 
+318381.684755  7356348.003657 
+318354.422717  7356345.334114 
+318317.397141  7356341.984688 
+318283.711289  7356339.795063 
+318262.666909  7356337.315488 
+318240.393840  7356334.256012 
+318225.443423  7356332.746270 
+318211.499047  7356332.566301 
+318200.201711  7356331.866421 
+318186.479984  7356329.476830 
+318173.681834  7356326.887274 
+318155.729790  7356321.118262 
+318142.750222  7356316.519050 
+318131.197253  7356311.609891 
+318120.460661  7356307.050672 
+318106.293637  7356300.111860 
+318087.079919  7356289.343705 
+318075.419749  7356285.104431 
+318061.219740  7356280.265260 
+318052.899293  7356278.165620 
+318048.429836  7356277.005818 
+318036.629480  7356276.085976 
+318018.306356  7356275.186130 
+317994.672659  7356276.105972 
+317973.949881  7356279.715354 
+317947.941270  7356282.714840 
+317920.984342  7356288.023931 
+317900.673876  7356291.753292 
+317871.787330  7356296.812426 
+317848.631914  7356299.841907 
+317825.987765  7356302.221499 
+317805.594836  7356304.401126 
+317783.362998  7356306.990682 
+317769.682502  7356309.150312 
+317747.359955  7356310.970001 
+317729.094555  7356313.399584 
+317705.732983  7356316.539047 
+317686.956316  7356319.728500 
+317664.204966  7356322.767980 
+317649.312273  7356324.907613 
+317624.524104  7356328.027079 
+317605.846391  7356330.886589 
+317590.739297  7356333.796091 
+317576.737197  7356337.605438 
+317558.364595  7356340.584928 
+317534.598959  7356343.834371 
+317488.881856  7356350.453237 
+317433.178568  7356358.161917 
+317404.712580  7356362.121239 
+317376.147637  7356366.080561 
+317348.407317  7356369.489977 
+317325.655966  7356372.199512 
+317307.398812  7356374.619098 
+317290.452808  7356377.838547 
+317267.973583  7356383.317608 
+317252.132574  7356387.766846 
+317241.280534  7356391.946130 
+317230.717113  7356397.795128 
+317207.875054  7356407.923393 
+317190.351814  7356416.891857 
+317181.734503  7356421.321098 
+317164.409172  7356430.519523 
+317153.334485  7356436.468504 
+317145.047023  7356439.248028 
+317133.906365  7356442.317502 
+317119.409492  7356445.117022 
+317104.533292  7356446.036865 
+317092.221669  7356445.217005 
+317081.237690  7356443.417313 
+317053.596325  7356438.858094 
+317039.198406  7356433.798961 
+317020.331030  7356427.690007 
+317004.432298  7356420.731199 
+316988.640766  7356412.892542 
+316970.721707  7356404.683948 
+316954.311708  7356397.945102 
+316931.725282  7356387.686860 
+316918.547806  7356383.197629 
+316902.121314  7356377.118670 
+316893.083445  7356375.119012 
+316876.706431  7356373.359314 
+316855.109553  7356373.859228 
+316832.399434  7356373.679259 
+316821.201053  7356373.869226 
+316811.808596  7356375.308980 
+316801.599763  7356377.388624 
+316791.275482  7356380.138153 
+316780.448181  7356382.877683 
+316765.332840  7356386.237108 
+316750.382424  7356392.136097 
+316740.132359  7356397.435190 
+316731.003782  7356402.634299 
+316717.224331  7356413.202489 
+316702.513055  7356424.870490 
+316692.823734  7356433.938937 
+316686.869956  7356445.047034 
+316681.650092  7356455.065318 
+316674.764489  7356475.911747 
+316671.762861  7356487.719725 
+316670.682605  7356500.887469 
+316668.967389  7356523.463602 
+316670.847529  7356551.848740 
+316671.870062  7356567.256101 
+316672.364836  7356600.940331 
+316673.478077  7356624.986212 
+316674.813966  7356648.152244 
+316675.275755  7356667.768884 
+316674.442886  7356685.365870 
+316674.220238  7356718.700160 
+316673.708971  7356735.207332 
+316672.224650  7356747.815173 
+316669.256007  7356773.030854 
+316665.998746  7356796.686802 
+316661.100485  7356821.772505 
+316657.818485  7356839.569456 
+316652.367727  7356859.216091 
+316647.923008  7356872.553806 
+316638.926371  7356891.050638 
+316632.255170  7356903.258547 
+316626.021020  7356912.596947 
+316609.149232  7356933.873303 
+316589.952007  7356953.789891 
+316568.115988  7356973.006600 
+316547.253024  7356987.694084 
+316529.053593  7357001.081791 
+316509.435811  7357014.129556 
+316484.408501  7357027.767220 
+316466.893507  7357035.515892 
+316451.019513  7357042.514694 
+316434.444589  7357048.613649 
+316420.318796  7357054.312673 
+316399.777436  7357059.801732 
+316377.314703  7357063.841041 
+316357.317594  7357066.690552 
+316344.173102  7357067.180469 
+316328.917576  7357065.110823 
+316305.737421  7357061.931368 
+316287.133925  7357059.141845 
+316269.940534  7357057.602109 
+316251.897781  7357059.141845 
+316235.570245  7357061.371464 
+316222.887542  7357065.750713 
+316210.914015  7357070.139962 
+316200.045483  7357075.868980 
+316189.564524  7357082.827788 
+316176.840590  7357090.196526 
+316160.521300  7357099.954855 
+316143.698989  7357109.593204 
+316125.046015  7357118.551669 
+316113.765172  7357124.830594 
+316101.577243  7357129.659766 
+316088.688384  7357133.929035 
+316079.889656  7357137.468429 
+316068.196501  7357143.417410 
+316051.085573  7357151.616005 
+316039.309955  7357156.445178 
+316029.802051  7357159.654629 
+316018.966504  7357162.174197 
+316011.726314  7357162.854080 
+316005.830259  7357162.554132 
+316002.292626  7357160.184538 
+315998.870440  7357156.925096 
+315999.719802  7357154.055588 
+315998.581822  7357147.846651 
+315995.192621  7357142.147627 
+315991.498310  7357135.898698 
+315986.633034  7357126.200359 
+315982.114100  7357113.072608 
+315981.940929  7357103.104315 
+315986.731989  7357094.415803 
+315994.994712  7357085.877266 
+315998.787978  7357083.377694 
+316003.793440  7357082.227891 
+316011.940716  7357082.327874 
+316027.047810  7357079.968278 
+316048.974538  7357077.818646 
+316060.313105  7357074.859153 
+316070.991973  7357068.460249 
+316079.205219  7357063.251142 
+316085.002319  7357056.122363 
+316091.046806  7357045.014265 
+316094.963766  7357033.876173 
+316096.299655  7357024.587764 
+316098.089087  7357011.869943 
+316097.454128  7357006.210912 
+316093.784555  7356998.082304 
+316089.199651  7356990.273642 
+316081.118345  7356985.514457 
+316072.377340  7356983.744760 
+316062.984884  7356985.284497 
+316057.971175  7356987.654091 
+316053.823321  7356992.923188 
+316046.739809  7357005.231080 
+316042.897066  7357011.170063 
+316036.027956  7357014.739451 
+316032.564539  7357015.019403 
+316027.633293  7357010.310210 
+316025.472780  7357004.081277 
+316024.054429  7356995.312779 
+316023.881258  7356985.334488 
+316024.862559  7356979.815433 
+316028.490901  7356967.337571 
+316034.551880  7356955.009682 
+316039.120292  7356940.452176 
+316040.983940  7356921.755379 
+316038.988352  7356903.008590 
+316035.013669  7356895.199927 
+316026.058263  7356886.671388 
+316021.143509  7356880.732405 
+316017.746062  7356875.043380 
+316016.896700  7356870.384178 
+316017.894494  7356863.855296 
+316019.469524  7356859.895974 
+316028.260006  7356857.456392 
+316036.085679  7356858.556204 
+316042.954789  7356863.295392 
+316050.161995  7356865.265055 
+316054.854100  7356864.335214 
+316058.960723  7356862.275567 
+316061.789180  7356855.996642 
+316063.842491  7356846.718232 
+316065.631924  7356826.251737 
+316065.838079  7356810.304469 
+316064.741331  7356800.326178 
+316060.461537  7356792.517516 
+316057.360954  7356787.818321 
+316045.931679  7356773.610754 
+316040.151071  7356763.902417 
+316038.732719  7356755.243900 
+316038.823428  7356748.045133 
+316041.396252  7356738.106836 
+316044.018553  7356732.487798 
+316049.964085  7356729.238355 
+316055.967341  7356729.318341 
+316062.481863  7356729.628288 
+316070.612647  7356731.278006 
+316076.632395  7356730.138201 
+316080.021596  7356728.298516 
+316083.212887  7356725.568983 
+316084.210681  7356719.380044 
+316081.522410  7356714.360903 
+316078.100224  7356711.211443 
+316073.465843  7356707.052155 
+316064.865024  7356694.544298 
+316060.189411  7356686.395693 
+316060.981049  7356680.206754 
+316063.174547  7356675.797509 
+316068.938662  7356671.218293 
+316075.741802  7356672.308107 
+316079.180480  7356674.787682 
+316081.357485  7356679.136937 
+316084.672470  7356683.276228 
+316091.549826  7356686.795625 
+316097.454128  7356686.875611 
+316103.218243  7356682.516358 
+316105.758082  7356674.787682 
+316110.334740  7356659.560290 
+316116.527659  7356644.802818 
+316122.654608  7356627.705747 
+316131.741955  7356602.350090 
+316144.993647  7356569.505716 
+316154.072747  7356551.898732 
+316162.615842  7356544.809946 
+316171.101214  7356542.370364 
+316179.858710  7356542.820287 
+316183.899363  7356545.079900 
+316185.952675  7356551.978718 
+316185.259992  7356558.167658 
+316181.400756  7356565.326432 
+316176.972530  7356569.585702 
+316172.214455  7356575.064763 
+316168.685068  7356580.003917 
+316167.101792  7356584.743106 
+316165.411314  7356589.372313 
+316166.672988  7356594.041513 
+316168.767530  7356597.840862 
+316171.274384  7356600.970326 
+316178.440359  7356606.049456 
+316187.131886  7356611.138584 
+316199.633172  7356613.188233 
+316206.452804  7356613.828124 
+316216.554437  7356612.068425 
+316223.134929  7356607.169264 
+316231.059557  7356601.070309 
+316240.509737  7356594.321465 
+316264.935072  7356572.255245 
+316294.110236  7356544.609980 
+316312.796195  7356524.903356 
+316325.899455  7356511.115717 
+316333.205616  7356497.807997 
+316341.245690  7356481.740749 
+316344.230826  7356471.812450 
+316344.313288  7356465.273570 
+316341.295168  7356454.265455 
+316335.745455  7356450.206151 
+316326.303521  7356447.546606 
+316292.221849  7356444.667099 
+316279.135081  7356440.737772 
+316271.383624  7356433.768966 
+316267.400695  7356426.630189 
+316264.827871  7356412.532604 
+316262.725082  7356377.948528 
+316263.030193  7356354.022626 
+316266.048313  7356341.324801 
+316270.921835  7356326.097409 
+316281.773875  7356305.970857 
+316293.615462  7356287.843962 
+316302.274004  7356271.996676 
+316305.341602  7356254.649648 
+316303.915004  7356238.792364 
+316302.224527  7356227.584284 
+316301.507105  7356211.956961 
+316298.860065  7356196.299643 
+316291.751814  7356186.351347 
+316280.611157  7356181.452186 
+316272.480373  7356180.462355 
+316254.998364  7356177.132926 
+316250.652601  7356174.533371 
+316248.186978  7356168.634381 
+316247.675711  7356160.865712 
+316248.706490  7356151.797265 
+316254.750977  7356140.689168 
+316259.228680  7356133.320430 
+316264.448544  7356123.422126 
+316266.691519  7356115.033563 
+316265.891635  7356106.275063 
+316264.159926  7356097.826510 
+316260.490354  7356090.367788 
+316253.332626  7356084.618772 
+316246.743887  7356082.099204 
+316237.400908  7356079.769603 
+316233.063391  7356076.940088 
+316231.298697  7356071.271059 
+316229.171170  7356062.602544 
+316229.253632  7356056.073662 
+316230.861647  7356049.774741 
+316232.560371  7356044.595628 
+316232.609848  7356040.496330 
+316232.362461  7356036.167072 
+316231.109034  7356030.508041 
+316223.868843  7356015.130675 
+316222.021688  7356008.571799 
+316223.283361  7356004.932422 
+316226.482899  7356001.872946 
+316231.537838  7355996.943790 
+316238.217285  7355992.274590 
+316241.713687  7355989.215114 
+316243.907184  7355985.255792 
+316243.066068  7355979.036858 
+316239.701606  7355971.798098 
+316232.684064  7355962.959612 
+316227.109612  7355952.921331 
+316225.064547  7355945.472607 
+316224.528542  7355939.813576 
+316225.204733  7355934.284523 
+316223.357577  7355927.395703 
+316219.366401  7355920.806832 
+316207.854664  7355913.458091 
+316201.735960  7355906.289319 
+316198.635378  7355901.600122 
+316196.565574  7355896.261036 
+316196.029569  7355890.272062 
+316193.588684  7355881.823509 
+316189.267660  7355877.774203 
+316182.390303  7355873.924862 
+316170.820842  7355870.675419 
+316162.129315  7355865.246349 
+316159.408058  7355863.106715 
+316157.824782  7355859.647308 
+316158.154631  7355857.777628 
+316158.921531  7355853.458368 
+316162.368455  7355846.969480 
+316166.532802  7355839.820704 
+316171.694942  7355834.021697 
+316173.937917  7355825.633134 
+316172.544304  7355815.314902 
+316163.926993  7355804.346780 
+316154.600506  7355793.258680 
+316138.289462  7355770.672549 
+316123.536955  7355753.315522 
+316101.313364  7355723.460636 
+316092.720791  7355710.062930 
+316080.450400  7355689.966373 
+316075.585124  7355680.268034 
+316072.270139  7355668.700016 
+316071.247607  7355653.072692 
+316071.090928  7355641.884609 
+316072.154692  7355630.046637 
+316076.417993  7355615.479132 
+316086.651565  7355571.406681 
+316090.362369  7355552.179974 
+316091.104530  7355541.561793 
+316090.263414  7355536.012744 
+316088.185364  7355531.003602 
+316083.856093  7355527.514199 
+316075.733556  7355525.194597 
+316064.139356  7355523.824831 
+316059.166879  7355522.545051 
+316054.837608  7355518.725705 
+316052.347246  7355514.366451 
+316051.802995  7355509.047363 
+316051.868965  7355504.398159 
+316051.943181  7355498.409185 
+316050.079533  7355492.850137 
+316044.834930  7355489.020793 
+316035.203332  7355485.131459 
+316021.069293  7355483.401755 
+316009.582294  7355482.031990 
+315999.241521  7355478.462601 
+315992.784722  7355473.733412 
+315989.115149  7355466.154710 
+315986.377401  7355457.146253 
+315983.120140  7355440.929031 
+315975.846964  7355420.232576 
+315968.573789  7355408.064660 
+315953.656358  7355395.696779 
+315934.154022  7355375.840180 
+315928.035319  7355368.561427 
+315924.679103  7355360.432819 
+315924.802797  7355350.464526 
+315925.289324  7355336.516915 
+315927.251927  7355326.238676 
+315926.130440  7355318.470007 
+315923.038103  7355313.440868 
+315916.911154  7355306.502057 
+315906.628104  7355298.613408 
+315899.610562  7355289.774922 
+315896.806844  7355286.085554 
+315896.914045  7355277.886958 
+315895.858527  7355264.799200 
+315895.091628  7355253.051212 
+315892.370371  7355242.712983 
+315889.624377  7355234.264430 
+315888.230764  7355224.276141 
+315888.964678  7355214.317847 
+315891.009743  7355198.170613 
+315893.359919  7355189.452106 
+315893.434135  7355183.573113 
+315892.263170  7355179.793761 
+315889.137849  7355177.324184 
+315886.004281  7355175.064571 
+315882.235754  7355175.014579 
+315876.636563  7355174.944591 
+315873.766875  7355176.454333 
+315865.561876  7355181.333497 
+315861.447006  7355184.382975 
+315854.924238  7355184.632932 
+315848.640610  7355182.113363 
+315843.107390  7355176.734285 
+315837.615400  7355168.245739 
+315832.700646  7355154.778046 
+315826.713883  7355136.981094 
+315823.638039  7355130.402221 
+315818.698547  7355126.902820 
+315812.101562  7355124.933158 
+315800.919674  7355123.573391 
+315795.229774  7355122.283612 
+315791.197368  7355119.134151 
+315788.797714  7355115.884708 
+315788.871931  7355110.015713 
+315785.862056  7355098.127749 
+315785.334298  7355091.918813 
+315782.547072  7355087.229616 
+315779.100147  7355085.639888 
+315771.991896  7355084.330113 
+315766.293751  7355083.920183 
+315762.549962  7355081.660570 
+315759.548334  7355077.851223 
+315757.363083  7355073.172024 
+315755.911747  7355067.283033 
+315751.937064  7355059.474370 
+315746.288396  7355055.305085 
+315739.180145  7355053.995309 
+315721.277578  7355052.215614 
+315707.267232  7355048.936175 
+315700.356891  7355047.516419 
+315695.755494  7355041.587434 
+315694.287665  7355036.588291 
+315694.427851  7355025.400207 
+315695.409152  7355020.431058 
+315696.984182  7355016.681700 
+315698.649921  7355013.932171 
+315699.631223  7355008.963023 
+315699.680700  7355004.863725 
+315698.534474  7354999.314675 
+315696.349223  7354995.185383 
+315691.088128  7354992.015925 
+315683.905661  7354988.486530 
+315671.148742  7354982.457563 
+315664.733174  7354974.948849 
+315657.649662  7354963.340837 
+315656.833285  7354955.132243 
+315657.872311  7354945.843834 
+315659.818421  7354937.115329 
+315663.991014  7354929.416648 
+315669.078938  7354921.727965 
+315675.189395  7354913.389393 
+315679.716575  7354901.931356 
+315681.035972  7354894.522625 
+315680.244334  7354884.544334 
+315677.523078  7354874.536049 
+315671.709486  7354867.267294 
+315660.774984  7354862.468116 
+315649.931190  7354858.568784 
+315638.699824  7354852.549815 
+315630.033036  7354845.241067 
+315624.128735  7354837.412408 
+315621.448710  7354831.733380 
+315620.558117  7354821.855072 
+315620.863227  7354798.489075 
+315623.782393  7354769.284077 
+315624.301906  7354752.456960 
+315625.225483  7354727.881169 
+315625.406900  7354713.813579 
+315624.598770  7354705.165060 
+315621.226062  7354698.586187 
+315614.802248  7354691.297436 
+315607.957876  7354685.008513 
+315598.342771  7354679.899388 
+315591.432430  7354679.149517 
+315583.342878  7354674.720275 
+315581.545200  7354671.930753 
+315580.027893  7354662.832312 
+315580.473190  7354652.314113 
+315583.120230  7354644.255494 
+315587.647410  7354632.797456 
+315595.687485  7354617.280114 
+315603.067862  7354605.192185 
+315607.867168  7354596.283711 
+315612.996323  7354585.715521 
+315614.282735  7354580.526410 
+315610.621409  7354572.617765 
+315605.393299  7354567.008727 
+315594.186671  7354559.659984 
+315579.623828  7354551.391400 
+315566.611276  7354541.923022 
+315563.205583  7354537.443789 
+315561.333688  7354532.544629 
+315563.411738  7354521.606502 
+315571.055994  7354513.287927 
+315575.822316  7354506.809037 
+315581.479230  7354501.899878 
+315583.796421  7354496.390821 
+315584.497350  7354489.202053 
+315584.307687  7354480.453551 
+315582.171913  7354472.114980 
+315576.086195  7354462.066701 
+315569.274808  7354453.228215 
+315567.270974  7354442.570041 
+315564.607442  7354428.242495 
+315563.551924  7354415.164735 
+315564.533226  7354410.185588 
+315568.054366  7354405.586375 
+315574.305009  7354402.226951 
+315577.471562  7354401.607057 
+315583.351124  7354403.896665 
+315586.476446  7354406.486221 
+315589.238933  7354413.055096 
+315591.877727  7354421.723611 
+315600.082726  7354440.880330 
+315602.869952  7354446.129431 
+315607.512580  7354449.618833 
+315612.163454  7354451.898443 
+315617.861599  7354452.628318 
+315623.790639  7354450.828626 
+315626.693312  7354446.769321 
+315632.407950  7354437.860847 
+315634.692156  7354434.131486 
+315639.730603  7354430.762063 
+315644.727819  7354429.602262 
+315650.038391  7354429.012363 
+315655.431426  7354428.742409 
+315661.047109  7354427.602604 
+315666.085556  7354424.233181 
+315669.268601  7354421.833592 
+315670.538521  7354418.084235 
+315669.070692  7354413.415034 
+315665.054777  7354409.045783 
+315657.608431  7354402.076977 
+315644.900990  7354392.278655 
+315633.158357  7354379.280881 
+315626.363463  7354369.002642 
+315620.574609  7354360.174154 
+315611.281107  7354354.185180 
+315594.763907  7354347.436336 
+315582.963551  7354338.537860 
+315578.700250  7354330.059313 
+315578.502341  7354321.310811 
+315580.423712  7354314.581964 
+315582.180159  7354304.853630 
+315585.066340  7354294.035483 
+315588.059722  7354282.887393 
+315590.492360  7354267.630006 
+315593.461003  7354250.612921 
+315594.920586  7354239.994740 
+315594.706184  7354225.037302 
+315593.370294  7354209.849903 
+315593.568204  7354194.562522 
+315596.305953  7354179.975021 
+315599.505490  7354168.496987 
+315606.597248  7354155.189266 
+315615.833027  7354141.571599 
+315624.821418  7354123.964615 
+315631.269970  7354113.186461 
+315635.475548  7354103.278158 
+315637.100056  7354095.209540 
+315638.609116  7354080.941984 
+315640.596457  7354068.784067 
+315642.567306  7354057.945923 
+315646.781130  7354047.037792 
+315650.986708  7354036.899528 
+315657.608431  7354012.613688 
+315663.034451  7354002.715384 
+315666.011340  7353992.787084 
+315667.949204  7353984.498504 
+315666.497868  7353978.499532 
+315661.055356  7353966.361611 
+315656.115863  7353954.773596 
+315650.162085  7353934.427081 
+315645.989492  7353918.199860 
+315642.682754  7353905.971955 
+315638.130834  7353895.953671 
+315632.531644  7353887.795068 
+315620.500393  7353881.106214 
+315611.371816  7353878.546653 
+315599.208626  7353873.957439 
+315594.895847  7353868.698340 
+315592.562164  7353860.249787 
+315594.516520  7353850.861395 
+315600.379590  7353838.193565 
+315606.407585  7353828.305259 
+315612.155208  7353816.857219 
+315614.843479  7353806.039072 
+315616.550449  7353791.771516 
+315615.330007  7353775.914233 
+315619.873680  7353762.906461 
+315631.838960  7353759.287081 
+315649.518879  7353753.977990 
+315662.531431  7353747.719062 
+315681.299852  7353729.572171 
+315704.884071  7353716.474414 
+315729.565040  7353705.606276 
+315754.592350  7353691.298726 
+315772.156821  7353679.670718 
+315765.279465  7353668.282669 
+315757.701179  7353663.763443 
+315742.940426  7353663.233534 
+315725.730543  7353663.013571 
+315710.796619  7353660.504001 
+315694.749454  7353649.655860 
+315693.529012  7353633.248670 
+315694.774193  7353607.793030 
+315697.594404  7353578.468053 
+315700.373383  7353552.032582 
+315702.871991  7353532.125991 
+315706.920890  7353502.381086 
+315701.602072  7353480.384854 
+315697.025414  7353448.090386 
+315696.827504  7353423.944522 
+315697.091383  7353379.522131 
+315696.275007  7353371.653479 
+315700.596031  7353344.458137 
+315708.215549  7353321.512068 
+315729.762949  7353300.855606 
+315748.564355  7353279.719226 
+315747.038803  7353255.993290 
+315744.457732  7353227.158230 
+315740.961331  7353189.674650 
+315749.801290  7353159.659791 
+315766.821510  7353110.698178 
+315782.324423  7353068.585392 
+315801.307246  7353025.732732 
+315807.673336  7352989.928865 
+315819.820034  7352939.797452 
+315835.537350  7352896.904799 
+315855.839570  7352846.433444 
+315879.407297  7352795.012252 
+315895.652371  7352750.909807 
+315903.073979  7352695.949221 
+315910.924390  7352655.296184 
+315919.797335  7352606.884477 
+315929.676319  7352574.669995 
+315951.017564  7352546.364843 
+315972.564964  7352517.179842 
+315986.237215  7352482.905713 
+315997.394365  7352438.513317 
+315991.811667  7352389.481716 
+315971.014673  7352256.404511 
+315971.781573  7352212.442041 
+315976.556140  7352165.540075 
+315988.463697  7352134.565381 
+316009.343153  7352110.129566 
+316038.782197  7352084.923884 
+316063.372456  7352056.878688 
+316074.249235  7352026.443901 
+316074.265727  7351993.659517 
+316078.058993  7351951.726699 
+316083.608706  7351907.594259 
+316099.383746  7351860.502325 
+316111.250071  7351824.428504 
+316126.216980  7351784.635321 
+316128.517678  7351748.001596 
+316120.370403  7351716.437002 
+316110.277016  7351693.270971 
+316102.632760  7351646.099051 
+316105.172599  7351614.894396 
+316107.003263  7351583.569761 
+316104.413946  7351554.844682 
+316103.638801  7351503.883411 
+316106.945539  7351460.280880 
+316115.620574  7351419.187918 
+316126.769478  7351375.245445 
+316147.319084  7351344.490713 
+316174.704816  7351321.024733 
+316205.397287  7351309.236752 
+316235.273380  7351313.496023 
+316262.222062  7351324.144199 
+316296.988171  7351336.322113 
+316319.821983  7351349.689823 
+316342.053821  7351362.817574 
+316370.775442  7351385.783640 
+316401.171049  7351413.538886 
+316415.700907  7351423.577167 
+316435.698016  7351436.015036 
+316455.736357  7351453.442051 
+316488.440908  7351459.511012 
+316516.354398  7351450.452563 
+316534.578568  7351442.373947 
+316561.048968  7351426.436677 
+316579.784404  7351418.368059 
+316609.157478  7351406.110159 
+316642.439265  7351399.001376 
+316664.967967  7351396.741763 
+316682.293298  7351395.521972 
+316706.083673  7351390.292868 
+316720.522823  7351367.766726 
+316723.351280  7351345.320571 
+316739.043857  7351320.374844 
+316757.853509  7351306.547213 
+316788.059452  7351301.278115 
+316819.007555  7351309.316738 
+316832.679806  7351314.915779 
+316850.640096  7351327.223671 
+316871.742200  7351341.451234 
+316896.043842  7351351.729474 
+316923.017263  7351352.069415 
+316942.461874  7351344.450720 
+316968.668395  7351332.932693 
+316993.703952  7351317.745295 
+317018.327196  7351302.887840 
+317041.738245  7351287.570463 
+317067.573686  7351273.162931 
+317111.451879  7351257.545606 
+317144.428555  7351249.996899 
+317194.112095  7351250.296848 
+317242.121650  7351245.807617 
+317263.405171  7351237.439050 
+317271.775095  7351219.382143 
+317274.512844  7351204.464699 
+317281.101582  7351182.728422 
+317295.054204  7351150.443952 
+317307.538998  7351113.390299 
+317318.457007  7351079.406120 
+317330.826353  7351050.881006 
+317346.865272  7351014.637214 
+317369.113602  7350970.724736 
+317381.837536  7350946.298920 
+317404.885750  7350911.694847 
+317435.314342  7350888.048898 
+317467.804490  7350871.181787 
+317494.464554  7350856.014385 
+317527.960743  7350848.245716 
+317557.119414  7350860.573604 
+317592.924548  7350879.310395 
+317628.853375  7350904.016163 
+317674.570478  7350935.610751 
+317704.256908  7350955.047422 
+317732.351816  7350979.213282 
+317758.756246  7350992.181061 
+317777.590637  7351008.588250 
+317799.896691  7351031.804274 
+317825.509483  7351059.039609 
+317853.414728  7351090.304253 
+317879.307892  7351112.010535 
+317900.030670  7351131.657170 
+317916.819995  7351140.065730 
+317943.174948  7351149.144175 
+317972.391344  7351149.184168 
+318009.087070  7351146.104695 
+318047.893831  7351136.296375 
+318103.522903  7351116.949689 
+318175.256864  7351088.284599 
+318218.623791  7351064.358698 
+318231.298247  7351052.220777 
+318257.199658  7351032.834097 
+318278.722320  7351021.476043 
+318307.889237  7351001.349490 
+318316.028267  7350985.722167 
+318327.671945  7350958.736790 
+318342.391466  7350921.593152 
+318355.090662  7350891.398324 
+318378.699620  7350859.913717 
+318400.972689  7350829.398944 
+318416.269447  7350811.422023 
+318436.827300  7350796.064654 
+318465.697353  7350783.026887 
+318493.124316  7350771.858800 
+318522.563360  7350754.061849 
+318544.844675  7350731.305746 
+318547.095896  7350706.410011 
+318540.993685  7350681.184332 
+318535.180093  7350658.408233 
+318524.839320  7350638.781595 
+318511.851506  7350611.256310 
+318506.293547  7350583.271103 
+318506.301793  7350550.486719 
+318512.387511  7350520.211905 
+318518.695878  7350504.564585 
+318536.515982  7350480.088778 
+318555.985333  7350461.721924 
+318574.036332  7350451.433686 
+318591.510094  7350453.983249 
+318607.466551  7350464.261489 
+318622.474690  7350476.629370 
+318638.695026  7350482.488367 
+318652.878543  7350471.370271 
+318659.747653  7350459.822249 
+318665.379828  7350432.756885 
+318670.203873  7350413.880119 
+318679.835471  7350392.733741 
+318702.661037  7350375.076765 
+318716.555936  7350362.738879 
+318728.479985  7350337.743160 
+318736.652000  7350318.906387 
+318746.753632  7350292.890843 
+318768.870023  7350267.135255 
+318783.787454  7350254.367442 
+318806.926377  7350244.249175 
+318831.722793  7350247.548610 
+318852.074490  7350256.337104 
+318872.269509  7350269.214898 
+318896.950477  7350282.152682 
+318918.489632  7350285.202160 
+318946.650510  7350280.342992 
+318974.242397  7350271.834450 
+319008.324069  7350257.526901 
+319027.306892  7350245.588945 
+319046.100051  7350232.751144 
+319069.205989  7350216.653902 
+319092.501591  7350201.986414 
+319117.339238  7350177.600591 
+319125.750393  7350164.192888 
+319137.361086  7350140.077019 
+319149.326366  7350119.410559 
+319159.411506  7350102.923383 
+319175.475164  7350095.924582 
+319202.580524  7350102.243499 
+319216.772287  7350115.161286 
+319239.309235  7350136.267671 
+319244.891933  7350145.426102 
+319261.409133  7350167.562311 
+319281.983479  7350191.078283 
+319299.432503  7350195.847466 
+319319.982110  7350188.788675 
+319340.069928  7350178.190490 
+319362.112102  7350165.842605 
+319386.174603  7350154.844489 
+319410.525722  7350153.044797 
+319434.118188  7350146.805866 
+319461.767799  7350134.198026 
+319472.199281  7350113.721533 
+319479.579658  7350085.456375 
+319478.021120  7350055.751463 
+319475.506020  7350021.167387 
+319467.350498  7349989.712775 
+319456.020177  7349967.746537 
+319441.028529  7349945.960269 
+319424.519576  7349914.515655 
+319412.620265  7349889.229986 
+319407.037567  7349864.014306 
+319409.841285  7349843.107887 
+319418.978109  7349828.940314 
+319432.106108  7349813.153018 
+319450.124122  7349797.205749 
+319473.477447  7349777.779077 
+319491.478968  7349762.941618 
+319519.169811  7349738.485808 
+319521.907560  7349723.118440 
+319510.296867  7349707.471120 
+319501.143551  7349698.162715 
+319487.924843  7349689.024280 
+319471.201487  7349675.406612 
+319457.273604  7349657.729640 
+319455.484172  7349629.794425 
+319458.048749  7349604.238803 
+319451.435272  7349579.563030 
+319435.932359  7349557.656782 
+319416.933043  7349546.458700 
+319393.810613  7349531.651236 
+319378.357176  7349522.262845 
+319355.787243  7349503.596042 
+319347.153440  7349485.649116 
+319351.523942  7349470.531706 
+319355.506871  7349460.943348 
+319384.203754  7349437.827308 
+319406.518054  7349419.940371 
+319419.233742  7349404.043095 
+319425.847219  7349380.307160 
+319425.286475  7349368.229229 
+319427.282063  7349354.851521 
+319430.135259  7349338.934247 
+319444.310529  7349328.586020 
+319465.346663  7349331.185574 
+319483.595572  7349336.944588 
+319495.066079  7349339.534144 
+319521.726142  7349340.753935 
+319536.932192  7349337.284530 
+319557.976572  7349323.376912 
+319568.053466  7349306.999717 
+319573.174375  7349296.421529 
+319585.650922  7349276.204992 
+319599.314927  7349257.548188 
+319620.870573  7349243.520591 
+319647.967687  7349233.892240 
+319664.963169  7349225.913607 
+319671.584892  7349217.575035 
+319667.676179  7349212.765859 
+319657.714732  7349195.578803 
+319635.977668  7349175.482245 
+319614.603438  7349151.176408 
+319609.466037  7349130.509948 
+319619.782071  7349103.284612 
+319641.560366  7349071.650030 
+319676.112073  7349059.792062 
+319708.602221  7349050.123718 
+319739.871928  7349040.545358 
+319752.975188  7349018.669106 
+319756.702485  7348988.914202 
+319769.723283  7348933.253737 
+319791.979859  7348911.717425 
+319816.545381  7348909.137867 
+319849.447841  7348923.175463 
+319883.776899  7348945.431651 
+319914.106535  7348969.847468 
+319932.000856  7348987.794394 
+319959.320618  7349001.102115 
+319984.751993  7348986.134678 
+319993.460013  7348965.748171 
+320003.685339  7348929.544372 
+320023.929835  7348898.119755 
+320057.228114  7348872.174199 
+320093.115710  7348859.996285 
+320108.890749  7348860.086269 
+320137.150582  7348878.933041 
+320153.395656  7348906.608301 
+320171.842474  7348929.434391 
+320194.898935  7348958.079484 
+320224.263762  7348978.386006 
+320246.759480  7348978.555977 
+320276.107814  7348959.319272 
+320295.775075  7348941.292360 
+320305.810737  7348920.255963 
+320316.530837  7348901.339203 
+320332.041997  7348865.865280 
+320358.578367  7348868.634805 
+320381.370949  7348877.343313 
+320405.680837  7348878.753072 
+320428.399202  7348860.986115 
+320444.734985  7348848.448263 
+320474.536863  7348834.090722 
+320500.759876  7348820.902981 
+320515.693800  7348815.223954 
+320530.611231  7348794.807451 
+320539.343989  7348771.651418 
+320556.207531  7348750.155100 
+320588.854358  7348727.628958 
+320623.439049  7348713.221426 
+320643.469144  7348715.131099 
+320668.257313  7348719.100419 
+320685.244548  7348719.640327 
+320699.238401  7348716.270904 
+320705.505537  7348694.864570 
+320700.211457  7348686.715966 
+320695.535844  7348661.950208 
+320690.876724  7348643.843310 
+320693.581487  7348615.078237 
+320691.956980  7348589.802567 
+320684.048845  7348555.248485 
+320663.746625  7348525.863519 
+320643.345450  7348505.007091 
+320619.085040  7348483.660748 
+320590.635544  7348454.945666 
+320569.978736  7348430.429866 
+320560.825420  7348405.064211 
+320573.854464  7348380.528413 
+320584.154007  7348363.151390 
+320596.036825  7348324.428023 
+320600.531021  7348298.672435 
+320603.285262  7348274.006660 
+320615.456698  7348236.273123 
+320632.880983  7348202.268948 
+320650.140344  7348173.123940 
+320671.539313  7348147.038408 
+320691.956980  7348133.890660 
+320717.322385  7348131.990986 
+320735.307414  7348134.650530 
+320755.865267  7348135.240429 
+320779.515457  7348131.881004 
+320804.889108  7348121.232828 
+320831.376001  7348103.505865 
+320848.973458  7348087.998521 
+320861.285080  7348072.201227 
+320885.603214  7348040.046735 
+320903.786153  7348018.450434 
+320928.038317  7347991.615031 
+320942.155864  7347961.450198 
+320941.281763  7347950.362097 
+320933.489075  7347930.435510 
+320924.014156  7347906.829554 
+320940.152030  7347877.464584 
+320950.501049  7347855.878281 
+320949.791873  7347839.481090 
+320942.625899  7347809.926152 
+320931.782106  7347773.792342 
+320918.068624  7347738.618367 
+320916.938890  7347715.342354 
+320925.218106  7347687.977041 
+320943.153658  7347661.831520 
+320955.745652  7347639.725306 
+320963.431139  7347618.888875 
+320971.182596  7347601.481857 
+320988.953223  7347596.282748 
+321003.062523  7347607.530821 
+321015.200975  7347621.748385 
+321033.449883  7347627.627378 
+321051.674053  7347635.056106 
+321062.971389  7347651.813236 
+321067.787188  7347681.888084 
+321077.600202  7347702.614534 
+321100.335060  7347716.082227 
+321119.598255  7347705.903970 
+321132.726254  7347689.786731 
+321146.497459  7347679.328523 
+321159.171916  7347666.300754 
+321176.225121  7347661.861514 
+321186.219552  7347652.133181 
+321207.560797  7347638.885450 
+321225.562319  7347648.083874 
+321237.832710  7347667.620528 
+321253.418086  7347691.626416 
+321275.765371  7347719.261682 
+321301.708012  7347753.035897 
+321323.205936  7347751.426173 
+321340.588990  7347736.908660 
+321356.141381  7347722.151187 
+321381.449063  7347700.084967 
+321398.221896  7347694.095993 
+321423.356407  7347694.295959 
+321454.065370  7347688.147012 
+321478.968986  7347674.939274 
+321497.184910  7347650.683429 
+321497.052970  7347627.977319 
+321490.167368  7347601.201905 
+321485.285599  7347567.797627 
+321489.466438  7347550.680559 
+321492.616498  7347526.794650 
+321481.368640  7347506.268166 
+321471.860736  7347485.331752 
+321472.000922  7347466.055054 
+321475.992097  7347439.859541 
+321478.012424  7347400.116349 
+321472.594650  7347377.120288 
+321452.655264  7347360.253177 
+321428.609256  7347362.172848 
+321390.223052  7347363.472626 
+321359.621290  7347360.653109 
+321339.096422  7347350.204898 
+321333.587940  7347334.737548 
+321332.252051  7347310.791650 
+321324.310931  7347286.545803 
+321313.623816  7347253.961384 
+321310.696404  7347235.984463 
+321305.690942  7347196.601209 
+321308.280258  7347176.244696 
+321319.140544  7347146.029872 
+321319.750765  7347130.202583 
+321314.794781  7347119.504415 
+321300.009289  7347121.654047 
+321287.120430  7347126.693184 
+321272.730758  7347146.229838 
+321259.726452  7347160.467399 
+321238.525393  7347179.814085 
+321219.468354  7347181.673766 
+321192.898999  7347173.705131 
+321175.614900  7347148.119514 
+321166.321398  7347126.073290 
+321150.991655  7347106.276681 
+321131.802676  7347102.937253 
+321114.048542  7347098.068087 
+321093.771060  7347091.609194 
+321075.588122  7347081.080997 
+321065.634922  7347063.124073 
+321070.335273  7347036.708598 
+321075.241780  7347019.041626 
+321088.938769  7346989.646659 
+321089.829362  7346958.861932 
+321089.400558  7346944.454400 
+321093.713337  7346917.259058 
+321111.417994  7346884.584655 
+321122.987456  7346863.018349 
+321134.507440  7346836.582877 
+321139.347977  7346799.529224 
+321136.263887  7346777.892930 
+321126.055053  7346747.748094 
+321114.724733  7346725.781856 
+321100.895804  7346716.863384 
+321044.013305  7346691.677698 
+321018.449990  7346676.400315 
+321003.565543  7346661.922795 
+320981.968665  7346631.308039 
+320968.527309  7346599.123552 
+320960.866561  7346569.128690 
+320952.612084  7346545.322767 
+320944.703949  7346518.527357 
+320931.048191  7346503.839873 
+320906.565132  7346491.801935 
+320878.725858  7346479.823987 
+320858.110281  7346460.177352 
+320850.606211  7346442.030460 
+320847.480890  7346414.965097 
+320849.311553  7346398.817862 
+320860.105869  7346381.780781 
+320873.910059  7346368.773009 
+320896.512977  7346359.864535 
+320916.922398  7346346.826768 
+320916.262700  7346326.650224 
+320907.043414  7346306.933601 
+320896.257344  7346282.427799 
+320886.032018  7346253.832697 
+320876.623069  7346224.477725 
+320873.934798  7346212.149837 
+320867.420275  7346195.672659 
+320843.423744  7346185.734362 
+320822.898876  7346183.264785 
+320797.995260  7346180.845199 
+320773.446231  7346174.666258 
+320760.408940  7346158.888960 
+320756.285825  7346130.593807 
+320756.648659  7346109.437431 
+320760.359463  7346081.242260 
+320767.987226  7346041.129131 
+320768.251106  7346012.224082 
+320760.969684  7345992.197513 
+320753.424383  7345984.788782 
+320735.975359  7345980.909446 
+320719.177787  7345981.369368 
+320699.131200  7345988.758102 
+320670.195177  7345999.916191 
+320648.334420  7346006.625042 
+320636.369139  7346002.925675 
+320630.374129  7345986.018571 
+320628.296079  7345964.832200 
+320613.683758  7345945.605494 
+320596.762493  7345939.626518 
+320571.388841  7345934.217444 
+320546.790335  7345931.807857 
+320522.216568  7345927.288631 
+320513.269408  7345910.121572 
+320515.957679  7345890.434944 
+320527.931206  7345869.318561 
+320535.963035  7345853.241315 
+320551.028898  7345828.845494 
+320560.091505  7345811.788415 
+320558.945279  7345781.973522 
+320548.810662  7345754.158287 
+320533.728306  7345730.932265 
+320513.764182  7345716.394755 
+320497.857203  7345702.457143 
+320473.959626  7345684.880153 
+320447.167623  7345670.812563 
+320410.092570  7345665.473478 
+320380.950391  7345660.004414 
+320366.659673  7345647.316588 
+320361.415071  7345627.090052 
+320361.612980  7345595.075536 
+320356.681734  7345574.639037 
+320340.288228  7345558.811748 
+320325.948032  7345550.213221 
+320323.268008  7345528.466946 
+320321.684731  7345509.070268 
+320329.098093  7345485.894238 
+320332.165690  7345451.820075 
+320336.981489  7345408.797444 
+320334.680791  7345372.983579 
+320327.217952  7345351.407274 
+320318.823289  7345322.942150 
+320296.682160  7345262.522500 
+320276.132553  7345213.410912 
+320262.748921  7345168.718567 
+320248.540665  7345141.293265 
+320223.703019  7345125.805918 
+320198.857126  7345126.925726 
+320168.172902  7345131.194995 
+320146.567777  7345134.134491 
+320113.558116  7345136.934012 
+320084.688062  7345134.694395 
+320062.934506  7345124.666113 
+320049.616844  7345115.527678 
+320027.624146  7345099.970343 
+320013.465368  7345084.832936 
+320014.875474  7345070.125455 
+320020.763282  7345062.886695 
+320035.054000  7345051.438656 
+320046.524507  7345037.621023 
+320055.051110  7345023.223489 
+320068.170862  7344991.368946 
+320074.380274  7344974.721797 
+320088.102002  7344959.944328 
+320105.476810  7344945.646777 
+320124.847206  7344926.839999 
+320140.729446  7344901.564328 
+320142.213767  7344880.867874 
+320143.071375  7344869.469826 
+320154.286249  7344851.442914 
+320166.869997  7344838.095200 
+320172.823776  7344817.788678 
+320168.535736  7344802.331326 
+320163.678706  7344784.104448 
+320152.884390  7344760.378512 
+320144.300064  7344747.420732 
+320134.247909  7344737.552422 
+320119.536633  7344733.933042 
+320104.883081  7344733.743075 
+320087.945324  7344729.103869 
+320082.849153  7344722.065075 
+320071.807450  7344709.407243 
+320053.591527  7344709.727188 
+320041.601507  7344708.137461 
+320027.962242  7344700.768723 
+320020.177800  7344688.600807 
+320017.547253  7344671.173792 
+320012.277911  7344652.936916 
+319998.762339  7344627.181328 
+319993.509490  7344616.043236 
+319982.245139  7344597.516409 
+319967.838974  7344569.421222 
+319959.262894  7344555.463612 
+319951.734086  7344547.614957 
+319930.458811  7344540.146236 
+319905.299561  7344541.605986 
+319883.100708  7344551.294326 
+319855.995348  7344554.053854 
+319826.473842  7344555.123671 
+319798.115055  7344552.444130 
+319775.536876  7344543.515659 
+319759.044414  7344535.886966 
+319744.357877  7344530.277926 
+319725.828597  7344523.069161 
+319704.536830  7344516.930213 
+319684.275841  7344509.471490 
+319664.270485  7344506.122064 
+319643.663155  7344510.401331 
+319623.863955  7344515.130521 
+319605.986127  7344520.779553 
+319592.602495  7344516.510285 
+319589.427696  7344494.214104 
+319587.465093  7344464.059269 
+319587.423862  7344435.034241 
+319603.009238  7344401.669956 
+319611.494609  7344382.503239 
+319609.119695  7344360.986924 
+319603.619459  7344336.771072 
+319589.716314  7344317.654347 
+319569.991330  7344300.117351 
+319545.937076  7344287.189565 
+319536.866222  7344272.232127 
+319533.485267  7344249.705986 
+319554.067859  7344231.359128 
+319566.362989  7344208.583030 
+319572.135350  7344186.386832 
+319567.129888  7344171.709346 
+319562.190396  7344144.064081 
+319564.829190  7344120.388137 
+319583.193546  7344100.461550 
+319605.845941  7344079.035220 
+319626.527488  7344060.908325 
+319646.450381  7344046.650767 
+319680.804178  7344033.573007 
+319707.018945  7344020.275285 
+319722.777492  7344005.407832 
+319732.070994  7343986.811017 
+319738.470069  7343963.075083 
+319750.542550  7343933.760105 
+319758.145575  7343895.866595 
+319765.888786  7343870.370962 
+319777.903544  7343845.935148 
+319789.481252  7343823.149051 
+319801.999030  7343807.021814 
+319831.001023  7343790.774597 
+319855.995348  7343777.686838 
+319880.371206  7343765.148986 
+319898.933471  7343761.719573 
+319924.067982  7343761.489613 
+319943.067297  7343771.697864 
+319961.810980  7343777.906801 
+319983.251179  7343772.417741 
+319997.508912  7343763.629246 
+320023.146443  7343755.420652 
+320042.426130  7343751.671295 
+320060.757501  7343758.330154 
+320079.682600  7343774.847325 
+320094.764956  7343797.413459 
+320106.400388  7343827.248349 
+320111.265664  7343852.564013 
+320112.708754  7343867.751411 
+320115.430010  7343885.508370 
+320113.327221  7343899.106040 
+320116.353588  7343917.872826 
+320133.027467  7343927.051254 
+320162.227369  7343935.059882 
+320172.493926  7343952.466900 
+320174.151419  7343974.203177 
+320178.348750  7343996.299392 
+320191.047945  7344006.197697 
+320213.642617  7344014.126338 
+320240.434621  7344027.644023 
+320252.086545  7344048.170507 
+320256.052982  7344072.476344 
+320260.497700  7344091.473090 
+320261.008966  7344123.607585 
+320263.746715  7344148.893254 
+320272.957754  7344176.698491 
+320296.764622  7344193.285650 
+320324.900761  7344197.624907 
+320363.773492  7344197.114994 
+320391.752953  7344189.606280 
+320420.243680  7344189.736258 
+320457.318733  7344178.458190 
+320492.431183  7344170.039632 
+320530.767909  7344163.650726 
+320558.466998  7344153.922393 
+320584.145760  7344151.472812 
+320612.562271  7344157.141841 
+320642.966123  7344175.468702 
+320667.053363  7344185.966904 
+320691.643623  7344188.596453 
+320708.465934  7344177.838296 
+320721.750611  7344165.270449 
+320741.360148  7344150.892912 
+320782.459361  7344159.941362 
+320791.200366  7344176.878461 
+320799.438350  7344210.102770 
+320808.237078  7344238.907835 
+320815.163912  7344270.562413 
+320823.946147  7344300.687253 
+320831.672866  7344317.624352 
+320858.250467  7344332.681773 
+320880.111224  7344333.511631 
+320910.762464  7344348.069137 
+320928.162010  7344364.576310 
+320951.787461  7344371.515121 
+320969.780736  7344372.844893 
+320998.708514  7344386.942478 
+321017.707829  7344388.952134 
+321041.877531  7344385.042804 
+321066.245143  7344381.143472 
+321091.783719  7344397.630648 
+321111.970492  7344426.795652 
+321139.422193  7344436.773943 
+321166.560538  7344439.663448 
+321195.521300  7344434.814278 
+321258.440040  7344432.054751 
+321301.914168  7344430.385037 
+321333.381784  7344436.094059 
+321368.123154  7344441.063208 
+321411.564297  7344433.964424 
+321447.864204  7344436.084061 
+321481.550057  7344451.901352 
+321504.078759  7344481.306315 
+321512.522899  7344506.112066 
+321522.253451  7344541.905935 
+321524.224300  7344620.682441 
+321529.114315  7344636.139793 
+321534.416641  7344643.958454 
+321556.376354  7344661.955371 
+321569.982634  7344672.423578 
+321581.271724  7344697.489285 
+321591.208432  7344716.226075 
+321600.741074  7344735.722736 
+321611.296250  7344754.129583 
+321624.160369  7344767.137355 
+321646.400454  7344778.825352 
+321663.808246  7344786.354063 
+321674.726256  7344791.923109 
+321690.105476  7344799.091881 
+321703.546832  7344806.450621 
+321715.553344  7344823.217748 
+321716.815017  7344860.781314 
+321724.632444  7344878.498279 
+321740.176588  7344896.745154 
+321752.570673  7344906.973402 
+321767.463366  7344920.671056 
+321783.040495  7344935.928442 
+321787.419244  7344960.134296 
+321785.341194  7344972.292213 
+321777.853616  7344993.358605 
+321764.387522  7345028.302619 
+321756.743266  7345045.929600 
+321751.201799  7345065.796197 
+321750.121543  7345087.492481 
+321756.891698  7345099.430436 
+321772.023531  7345109.808658 
+321787.765586  7345112.438208 
+321802.864434  7345117.397358 
+321818.309624  7345119.467004 
+321831.264452  7345116.857451 
+321843.023577  7345112.578184 
+321856.555642  7345096.021020 
+321868.603385  7345076.454371 
+321879.059605  7345062.186815 
+321896.252996  7345046.669473 
+321914.238025  7345040.690497 
+321930.177989  7345043.540009 
+321932.412717  7345051.658619 
+321937.113069  7345066.336104 
+321942.102038  7345082.793286 
+321947.536304  7345104.239612 
+321967.327258  7345132.724733 
+321992.230874  7345135.034337 
+322011.535300  7345137.593899 
+322035.795711  7345142.663030 
+322055.050659  7345148.662003 
+322068.442538  7345160.459982 
+322076.565075  7345178.056968 
+322074.726166  7345203.512607 
+322066.677845  7345220.689665 
+322059.882951  7345243.315789 
+322057.639976  7345260.232892 
+322067.263327  7345280.069494 
+322084.794813  7345302.335680 
+322103.876591  7345323.062130 
+322116.212952  7345337.609638 
+322124.673585  7345352.557077 
+322139.558031  7345358.616040 
+322151.218201  7345361.975464 
+322157.996603  7345348.987689 
+322165.805783  7345334.350196 
+322180.855154  7345327.451378 
+322195.640646  7345324.861821 
+322207.003952  7345327.991285 
+322219.414529  7345336.459835 
+322245.249969  7345337.329686 
+322266.855094  7345335.050076 
+322286.547092  7345346.928042 
+322304.152795  7345363.535197 
+322329.328537  7345384.561595 
+322354.298123  7345381.552111 
+322379.061554  7345370.783955 
+322396.683749  7345361.135608 
+322439.201314  7345354.466750 
+322475.501221  7345356.906332 
+322500.874873  7345362.315406 
+322526.298002  7345380.362315 
+322540.250624  7345404.008264 
+322553.188960  7345427.654214 
+322568.345532  7345436.152758 
+322585.151350  7345435.362894 
+322606.970877  7345431.533549 
+322634.463810  7345430.653700 
+322655.772070  7345435.242914 
+322677.162792  7345450.120366 
+322684.064887  7345467.927316 
+322680.551993  7345488.823736 
+322671.217260  7345502.881328 
+322657.841874  7345522.987884 
+322657.371838  7345544.474204 
+322665.865456  7345557.202024 
+322684.971972  7345575.608871 
+322703.295097  7345591.786100 
+322728.272929  7345604.723884 
+322768.448565  7345606.433591 
+322797.912347  7345601.704401 
+322829.792275  7345591.686117 
+322870.157574  7345577.788497 
+322899.011135  7345565.520599 
+322931.641470  7345551.742959 
+322964.535684  7345541.514711 
+323010.895992  7345528.906870 
+323046.750603  7345526.247326 
+323073.171526  7345529.116834 
+323091.898716  7345536.885504 
+323113.033805  7345556.082215 
+323127.769819  7345574.209110 
+323149.210019  7345585.327206 
+323172.621068  7345584.397365 
+323187.860102  7345562.321147 
+323212.574055  7345538.815173 
+323227.244100  7345520.828254 
+323238.879531  7345501.151625 
+323265.160268  7345466.137622 
+323298.780151  7345413.936564 
+323327.386325  7345379.842404 
+323345.808404  7345363.125267 
+323373.515739  7345344.748415 
+323400.810762  7345334.670141 
+323425.005203  7345328.431210 
+323445.117760  7345322.812172 
+323479.026260  7345312.593923 
+323502.000259  7345306.564955 
+323538.745462  7345313.773721 
+323567.846410  7345322.442236 
+323591.694509  7345327.831313 
+323619.706955  7345317.763037 
+323636.174677  7345302.565641 
+323650.745767  7345276.380126 
+323665.737414  7345248.764856 
+323676.647177  7345230.408000 
+323692.100614  7345206.562085 
+323714.414914  7345188.115245 
+323745.849545  7345171.888024 
+323774.496950  7345159.500146 
+323796.382446  7345150.681657 
+323821.352033  7345147.452210 
+323837.094087  7345150.191741 
+323853.182483  7345166.228994 
+323868.660658  7345190.004921 
+323884.749054  7345205.602249 
+323902.404234  7345217.890145 
+323921.560228  7345232.857581 
+323950.727145  7345252.604198 
+323978.022169  7345266.891751 
+323996.765851  7345273.660592 
+324022.972372  7345269.111371 
+324039.481326  7345251.144448 
+324061.350330  7345226.598653 
+324078.222118  7345212.191121 
+324100.025151  7345193.184377 
+324111.256517  7345190.334865 
+324132.441084  7345180.626528 
+324148.768621  7345176.617214 
+324157.567349  7345189.574995 
+324168.089539  7345219.049946 
+324174.232981  7345241.056177 
+324186.874453  7345272.560780 
+324199.548909  7345292.987281 
+324215.596074  7345311.904041 
+324224.815360  7345331.730645 
+324233.828490  7345360.415731 
+324235.692138  7345374.063394 
+324246.535931  7345386.381284 
+324265.931066  7345398.139270 
+324290.018305  7345400.758821 
+324325.336911  7345399.868973 
+324341.483031  7345394.299927 
+324361.471894  7345399.089107 
+324372.752738  7345408.757451 
+324393.327083  7345415.656269 
+324429.132216  7345416.536118 
+324455.478923  7345417.855892 
+324481.743168  7345416.956046 
+324508.164091  7345411.406997 
+324530.758763  7345394.739852 
+324556.858083  7345374.013402 
+324576.912916  7345357.086302 
+324593.504332  7345347.877879 
+324617.434893  7345346.958036 
+324635.386937  7345351.937184 
+324659.787534  7345370.404020 
+324694.124838  7345391.310439 
+324723.489666  7345420.245483 
+324740.930443  7345450.260342 
+324752.310242  7345485.064380 
+324768.984120  7345511.519849 
+324792.535355  7345524.437636 
+324825.701695  7345533.256125 
+324847.471743  7345534.185966 
+324873.876174  7345538.055303 
+324895.530776  7345532.006339 
+324918.232649  7345522.977886 
+324952.528722  7345505.680849 
+324981.308067  7345498.942003 
+325003.952216  7345469.866983 
+325012.586020  7345445.931083 
+325020.189044  7345432.073457 
+325038.982204  7345409.817269 
+325058.286630  7345387.231138 
+325070.474559  7345364.125096 
+325074.276071  7345344.668429 
+325072.313468  7345338.339513 
+325052.687439  7345320.932494 
+325046.354334  7345314.313628 
+325040.722159  7345300.286031 
+325052.753409  7345290.137769 
+325078.465156  7345284.798684 
+325099.385843  7345280.069494 
+325119.506646  7345273.670590 
+325134.951836  7345258.683157 
+325151.708177  7345236.846898 
+325163.986814  7345222.599338 
+325182.672773  7345209.201633 
+325205.259199  7345192.754450 
+325235.151785  7345178.496892 
+325262.422070  7345170.408278 
+325286.764942  7345176.467240 
+325299.851710  7345188.255221 
+325323.658578  7345197.403654 
+325343.903075  7345197.873573 
+325361.220159  7345196.093878 
+325374.521329  7345206.892029 
+325378.718660  7345221.339554 
+325379.790670  7345242.395947 
+325380.689510  7345268.881410 
+325390.131444  7345295.356875 
+325393.512398  7345310.024363 
+325406.310548  7345320.252611 
+325426.794185  7345309.874389 
+325453.041937  7345302.325682 
+325469.806524  7345304.305343 
+325490.578779  7345303.335509 
+325504.308753  7345286.778345 
+325518.145928  7345270.561123 
+325532.560339  7345256.993447 
+325545.845017  7345252.174272 
+325564.959780  7345270.021215 
+325576.463271  7345286.888326 
+325593.194873  7345308.024705 
+325613.348661  7345324.441893 
+325630.583283  7345329.521023 
+325647.273654  7345313.003853 
+325655.041603  7345301.685791 
+325676.465310  7345289.097947 
+325690.739536  7345286.948316 
+325717.787172  7345280.409436 
+325718.718996  7345262.252546 
+325709.474972  7345244.195639 
+325702.457429  7345218.520037 
+325707.702032  7345205.962188 
+325728.523764  7345200.673094 
+325763.825878  7345201.552943 
+325800.134031  7345202.762736 
+325831.642879  7345205.692234 
+325861.106661  7345210.041489 
+325901.603899  7345218.400057 
+325931.042943  7345224.519009 
+325972.562714  7345232.667613 
+326000.179341  7345246.065318 
+326028.142309  7345264.902092 
+326053.953011  7345293.017276 
+326067.897387  7345317.673053 
+326082.847803  7345343.878564 
+326097.484862  7345378.722596 
+326116.154328  7345416.616105 
+326121.695795  7345437.722489 
+326124.136680  7345471.866641 
+326121.819489  7345494.772717 
+326117.044921  7345510.659996 
+326114.521575  7345534.665884 
+326141.346563  7345546.403873 
+326158.539954  7345554.692453 
+326173.168767  7345565.170659 
+326188.704666  7345584.637324 
+326193.223600  7345606.403596 
+326198.278539  7345634.598766 
+326198.402233  7345666.383322 
+326203.877730  7345701.337335 
+326223.388312  7345728.932608 
+326244.259522  7345744.809888 
+326273.822258  7345766.206223 
+326298.305317  7345777.804236 
+326337.252265  7345788.352430 
+326351.757384  7345792.631697 
+326369.899092  7345807.249193 
+326381.922096  7345822.566569 
+326399.775185  7345835.964274 
+326422.460566  7345827.825668 
+326440.965107  7345812.878229 
+326474.395326  7345799.650494 
+326504.304405  7345784.063164 
+326522.627529  7345774.874738 
+326555.628945  7345755.778009 
+326588.349988  7345742.770237 
+326613.113418  7345731.662140 
+326636.920286  7345715.334937 
+326659.960255  7345695.128398 
+326673.871646  7345680.560893 
+326696.944599  7345665.883407 
+326719.250653  7345664.713608 
+326746.652877  7345670.582603 
+326780.849996  7345678.531241 
+326824.084983  7345696.778115 
+326864.244127  7345716.424750 
+326898.465984  7345730.792289 
+326921.184349  7345737.381161 
+326962.852553  7345742.090354 
+327011.257926  7345753.308432 
+327042.956437  7345774.184856 
+327062.607205  7345790.592046 
+327085.119414  7345805.259534 
+327114.401779  7345816.027689 
+327137.697381  7345825.056143 
+327153.604360  7345831.125103 
+327163.367897  7345848.182181 
+327165.586133  7345875.237547 
+327165.149083  7345894.944171 
+327166.633404  7345915.240695 
+327181.954901  7345935.577211 
+327196.723900  7345951.704449 
+327215.756200  7345959.583099 
+327239.546576  7345961.302805 
+327253.326027  7345958.483288 
+327277.932779  7345959.993029 
+327301.030471  7345968.581558 
+327325.274390  7345975.190426 
+327335.458484  7345974.650518 
+327349.435845  7345954.763925 
+327367.569306  7345944.355708 
+327389.685697  7345941.626175 
+327407.390354  7345950.144716 
+327427.923469  7345952.164370 
+327442.486312  7345943.255896 
+327456.249271  7345940.876304 
+327470.259617  7345960.762897 
+327479.718043  7345978.269898 
+327498.643143  7346012.164093 
+327514.715046  7346029.861061 
+327525.525855  7346044.828498 
+327542.331673  7346060.205864 
+327566.229249  7346078.662702 
+327591.174097  7346102.998534 
+327605.357613  7346125.434690 
+327608.392226  7346152.270094 
+327602.949714  7346181.335115 
+327609.579684  7346205.670947 
+327628.463552  7346217.978839 
+327640.923606  7346239.395170 
+327638.589923  7346264.390889 
+327633.345320  7346285.817218 
+327627.424527  7346313.102545 
+327621.338808  7346336.518534 
+327626.921507  7346354.745412 
+327636.981908  7346389.869395 
+327644.321053  7346413.885282 
+327660.302248  7346439.110961 
+327673.859051  7346454.218373 
+327699.447105  7346459.297503 
+327731.384756  7346460.677266 
+327752.684770  7346466.796218 
+327765.837508  7346473.275109 
+327776.656563  7346504.529755 
+327773.828106  7346527.755777 
+327770.076071  7346552.181593 
+327780.367366  7346559.950262 
+327791.747165  7346561.090067 
+327809.121973  7346555.201075 
+327827.271926  7346543.573067 
+327843.071704  7346516.177760 
+327856.174965  7346492.851755 
+327866.161150  7346474.694865 
+327885.737702  7346454.668296 
+327906.378017  7346447.599507 
+327925.542257  7346436.641384 
+327946.232050  7346425.263333 
+327970.937757  7346418.804439 
+327985.822203  7346433.821867 
+328006.973785  7346451.798787 
+328025.733959  7346449.479185 
+328053.004244  7346440.720685 
+328084.842941  7346442.320411 
+328111.387557  7346452.058743 
+328143.580842  7346457.977729 
+328164.674700  7346455.688121 
+328185.356246  7346444.849978 
+328203.324783  7346431.892197 
+328223.478570  7346422.713769 
+328236.722017  7346421.873913 
+328257.205654  7346428.212827 
+328277.103808  7346440.300757 
+328290.677104  7346454.428337 
+328307.623108  7346466.926196 
+328314.137630  7346475.524723 
+328324.964931  7346480.423884 
+328343.461226  7346490.832101 
+328363.268672  7346494.501473 
+328391.000746  7346489.632307 
+328416.893910  7346486.502843 
+328445.566054  7346488.622480 
+328472.481751  7346484.293221 
+328484.727403  7346472.915170 
+328498.853196  7346449.269221 
+328509.614527  7346426.033201 
+328512.764588  7346409.126097 
+328525.034979  7346379.141233 
+328539.383420  7346353.505624 
+328554.003987  7346330.529560 
+328571.609689  7346304.933944 
+328594.022944  7346286.257143 
+328614.440611  7346280.418143 
+328638.791731  7346269.629991 
+328657.147840  7346258.331926 
+328665.954814  7346227.867145 
+328663.505684  7346211.439959 
+328653.940056  7346194.382880 
+328644.102303  7346174.656259 
+328641.628434  7346160.228731 
+328643.805439  7346140.102178 
+328658.426006  7346116.906151 
+328671.652960  7346100.338989 
+328689.250416  7346083.931800 
+328708.117792  7346072.193810 
+328716.784580  7346070.744058 
+328751.641397  7346057.756283 
+328779.035375  7346055.876605 
+328814.098348  7346051.307388 
+328846.860622  7346051.917283 
+328876.291419  7346041.309100 
+328905.136734  7346020.492666 
+328934.905627  7345999.366285 
+328957.079741  7345983.119068 
+328984.350026  7345965.842027 
+329010.276175  7345951.084555 
+329034.017073  7345939.846480 
+329080.748462  7345938.516708 
+329121.278686  7345952.624291 
+329162.823196  7345968.071645 
+329198.817992  7345978.919787 
+329246.002924  7345990.447813 
+329273.644289  7345993.207340 
+329302.819453  7346004.415420 
+329338.979175  7346019.022918 
+329371.964097  7346026.281675 
+329406.474573  7346034.110334 
+329427.551938  7346041.789018 
+329439.937777  7346044.148614 
+329453.189469  7346033.340465 
+329469.319096  7346012.484038 
+329489.918181  7345991.797581 
+329517.691485  7345975.070447 
+329543.930991  7345967.631721 
+329573.386527  7345955.683767 
+329594.084566  7345943.635831 
+329623.845212  7345931.137972 
+329657.036291  7345929.878188 
+329684.611686  7345946.705305 
+329710.455373  7345973.370738 
+329722.222744  7345993.557280 
+329743.968054  7346022.062397 
+329765.408254  7346041.809015 
+329800.157870  7346054.626819 
+329842.749651  7346058.456163 
+329860.074982  7346056.226545 
+329899.986738  7346046.068285 
+329924.329611  7346036.169981 
+329963.969242  7346031.100849 
+329997.333491  7346023.962072 
+330047.569528  7346018.133070 
+330074.988245  7346014.473697 
+330122.032991  7346011.934132 
+330160.592365  7346012.713999 
+330204.767423  7346020.552656 
+330261.526228  7346031.410796 
+330311.729281  7346046.078284 
+330341.951716  7346054.846782 
+330381.261497  7346060.855752 
+330417.586143  7346061.065716 
+330455.386865  7346056.966418 
+330492.973184  7346054.426853 
+330530.031745  7346052.867121 
+330586.856520  7346057.966247 
+330626.471412  7346063.975218 
+330680.748102  7346069.604254 
+330719.604341  7346071.054005 
+330753.908660  7346070.464106 
+330792.764899  7346063.615280 
+330826.574445  7346061.355667 
+330858.033815  7346059.735944 
+330888.676808  7346067.734574 
+330921.925610  7346078.982647 
+330953.863261  7346088.770971 
+330975.954913  7346096.789597 
+330997.757947  7346085.751488 
+331014.126715  7346069.654245 
+331028.170045  7346043.688693 
+331039.525105  7346021.552485 
+331052.867506  7345994.797068 
+331060.099450  7345968.081644 
+331071.083430  7345943.175910 
+331083.518746  7345906.552183 
+331101.421312  7345872.538009 
+331109.494372  7345834.974444 
+331115.151286  7345812.778246 
+331127.025858  7345772.595129 
+331135.816340  7345742.910213 
+331146.420993  7345715.454916 
+331158.204856  7345690.999105 
+331186.481181  7345674.941856 
+331229.452289  7345664.043723 
+331256.062876  7345659.704466 
+331290.680552  7345649.256256 
+331316.301590  7345642.797362 
+331347.365141  7345623.560657 
+331380.547973  7345596.705257 
+331402.796304  7345573.819177 
+331424.731277  7345542.624521 
+331444.357306  7345526.567271 
+331464.989375  7345520.608292 
+331500.811001  7345511.169908 
+331520.907065  7345507.200588 
+331550.197677  7345491.043356 
+331572.330560  7345469.597030 
+331597.390855  7345432.673354 
+331617.074607  7345402.888456 
+331639.413646  7345363.385223 
+331656.260695  7345332.680482 
+331670.938986  7345304.725271 
+331686.532608  7345285.518561 
+331715.592325  7345245.545408 
+331744.825212  7345200.033203 
+331770.380281  7345164.229336 
+331793.370772  7345130.045192 
+331814.299705  7345106.929151 
+331838.296237  7345081.953429 
+331859.926100  7345068.695700 
+331900.464569  7345047.679300 
+331937.605592  7345030.282280 
+331963.812113  7345008.665983 
+331981.219906  7344981.510634 
+331998.685423  7344941.397505 
+332011.335141  7344895.695334 
+332019.078351  7344868.759947 
+332026.937009  7344831.636306 
+332036.543868  7344793.752796 
+332042.472907  7344774.106161 
+332049.729590  7344745.391079 
+332035.249209  7344721.745130 
+332035.735737  7344697.719245 
+332038.580687  7344680.582181 
+332043.363500  7344654.496649 
+332045.144686  7344641.118940 
+332044.600435  7344618.182869 
+332043.412978  7344598.126305 
+332051.197419  7344584.808586 
+332064.655268  7344582.978899 
+332074.097202  7344593.167154 
+332084.487453  7344609.794306 
+332092.370849  7344622.732090 
+332102.183864  7344627.501273 
+332121.793400  7344630.270799 
+332146.960896  7344635.999817 
+332165.069618  7344644.848302 
+332181.677527  7344660.435632 
+332189.297044  7344670.273946 
+332199.909943  7344676.042958 
+332215.750952  7344687.750953 
+332237.001488  7344706.387760 
+332259.579668  7344724.924585 
+332270.538908  7344735.802722 
+332281.646581  7344743.571391 
+332298.716279  7344753.959612 
+332318.985514  7344769.486952 
+332333.358694  7344776.515748 
+332350.370667  7344783.034631 
+332362.006099  7344788.813642 
+332374.020857  7344797.372176 
+332388.616685  7344810.729888 
+332404.342247  7344823.427712 
+332418.385578  7344831.676300 
+332441.169913  7344840.914717 
+332466.279685  7344851.622883 
+332495.858915  7344863.150908 
+332517.859858  7344869.939745 
+332543.390188  7344879.988024 
+332568.681377  7344892.575868 
+332592.694401  7344900.944435 
+332625.365967  7344909.193022 
+332665.558095  7344917.631576 
+332688.697018  7344923.330600 
+332708.463233  7344929.879478 
+332730.027126  7344939.317862 
+332750.980798  7344948.316320 
+332775.793706  7344958.684544 
+332793.424148  7344964.873484 
+332806.271775  7344971.002434 
+332820.917081  7344980.810754 
+332854.050435  7345001.247254 
+332873.536278  7345014.654957 
+332891.735709  7345024.393289 
+332908.434326  7345040.750487 
+332920.935612  7345050.758773 
+332937.601244  7345061.366956 
+332950.152007  7345067.265945 
+332964.871529  7345070.095461 
+332985.017070  7345070.335419 
+332998.895477  7345067.505904 
+333013.705707  7345062.246805 
+333024.961812  7345057.067692 
+333039.062866  7345051.798595 
+333059.059975  7345047.609312 
+333077.976828  7345048.379180 
+333096.258722  7345051.028727 
+333119.389399  7345056.947713 
+333137.902187  7345066.466082 
+333158.839366  7345077.124257 
+333177.319169  7345089.302171 
+333191.007912  7345102.309942 
+333205.282137  7345117.097410 
+333217.437081  7345131.075015 
+333234.341854  7345155.750789 
+333244.633150  7345172.047997 
+333249.358240  7345186.165579 
+333258.956852  7345208.981671 
+333262.090420  7345228.398345 
+333268.365802  7345257.823304 
+333279.935263  7345295.286887 
+333290.284283  7345332.840455 
+333296.213323  7345348.417786 
+333303.016463  7345357.806178 
+333322.271411  7345382.501948 
+333337.477461  7345395.859660 
+333354.720329  7345409.797273 
+333370.528353  7345423.824870 
+333383.524413  7345444.241373 
+333392.916869  7345458.758886 
+333399.159266  7345464.477906 
+333407.842547  7345470.226922 
+333419.205853  7345473.346387 
+333433.018289  7345475.615999 
+333448.686127  7345476.125911 
+333461.022488  7345474.166247 
+333487.039346  7345468.157276 
+333503.267928  7345463.578061 
+333523.512424  7345455.179499 
+333555.986080  7345436.942623 
+333589.259621  7345419.385630 
+333610.741052  7345409.557314 
+333623.415508  7345404.838122 
+333636.667201  7345402.998437 
+333655.262451  7345404.978098 
+333668.159556  7345407.457673 
+333683.448067  7345414.276505 
+333697.474906  7345423.964846 
+333710.569920  7345435.532864 
+333734.121155  7345457.959023 
+333742.631265  7345470.236920 
+333752.724651  7345485.634283 
+333763.279826  7345506.030789 
+333768.920248  7345519.608463 
+333774.428730  7345535.845682 
+333786.707368  7345565.560592 
+333793.395061  7345585.347203 
+333799.761151  7345606.353604 
+333807.727010  7345622.070912 
+333817.135959  7345635.028693 
+333830.230973  7345646.476732 
+333843.441435  7345656.814961 
+333858.952594  7345662.424000 
+333888.061789  7345670.182671 
+333916.263897  7345678.041325 
+333932.715127  7345680.890837 
+333943.583659  7345682.230607 
+333967.604929  7345681.850672 
+333991.700415  7345684.010302 
+334012.118082  7345686.899808 
+334030.086619  7345690.989107 
+334054.412999  7345698.687788 
+334075.383164  7345706.796399 
+334095.454489  7345713.895183 
+334113.051946  7345723.293574 
+334134.269497  7345736.501311 
+334149.211667  7345746.199650 
+334167.971842  7345760.697167 
+334191.918895  7345775.374653 
+334200.767101  7345784.453098 
+334220.764210  7345798.190744 
+334235.986752  7345810.558626 
+334246.426480  7345822.966501 
+334257.336243  7345838.603822 
+334264.419755  7345850.421798 
+334271.659946  7345875.867439 
+334273.358669  7345887.295482 
+334272.113488  7345915.970570 
+334243.053772  7345921.059698 
+334213.804392  7345915.630628 
+334182.732594  7345927.568583 
+334160.319340  7345938.376732 
+334133.403643  7345951.804432 
+334101.993750  7345975.470378 
+334077.807556  7345989.707939 
+334057.967125  7346007.304925 
+334032.717167  7346034.700232 
+334017.626564  7346055.016752 
+334001.026902  7346073.653560 
+333982.126542  7346088.720979 
+333958.921648  7346106.727895 
+333927.363324  7346125.304713 
+333907.259013  7346129.943918 
+333876.838669  7346138.452461 
+333857.938308  7346144.661397 
+333849.758047  7346165.607809 
+333849.411705  7346178.225648 
+333858.457821  7346196.392536 
+333872.344473  7346209.950214 
+333880.862829  7346230.426706 
+333878.463176  7346252.662897 
+333870.208699  7346279.818246 
+333863.323097  7346303.544182 
+333848.603575  7346335.608690 
+333844.703108  7346364.583726 
+333845.098927  7346392.169001 
+333851.440278  7346432.892026 
+333858.993826  7346457.457818 
+333860.857474  7346489.812276 
+333858.853640  7346530.995222 
+333855.167574  7346559.530334 
+333849.634354  7346588.705336 
+333844.538183  7346607.472122 
+333844.389751  7346629.178404 
+333834.081963  7346666.282048 
+333826.008903  7346695.976962 
+333813.466386  7346724.522072 
+333803.711095  7346749.437804 
+333784.983905  7346784.661771 
+333772.441389  7346804.118438 
+333749.690038  7346835.313095 
+333723.310346  7346872.776678 
+333705.424272  7346896.942538 
+333697.252258  7346916.669159 
+333692.271534  7346933.776229 
+333678.219957  7346960.751608 
+333666.122737  7347003.584271 
+333663.376742  7347029.919760 
+333663.269541  7347056.715171 
+333664.712631  7347072.572454 
+333666.831913  7347100.617650 
+333669.264551  7347118.594571 
+333669.165596  7347153.478596 
+333669.528430  7347183.833396 
+333662.543873  7347206.789464 
+333645.094849  7347237.264244 
+333629.022945  7347254.361316 
+333616.026886  7347269.378743 
+333607.236404  7347280.906769 
+333595.765897  7347295.834212 
+333592.904455  7347314.521011 
+333601.233148  7347324.919230 
+333619.539780  7347334.877524 
+333633.657327  7347337.257116 
+333660.078250  7347349.744977 
+333679.827972  7347357.953571 
+333708.467131  7347371.691218 
+333729.956808  7347387.778462 
+333754.439867  7347409.324772 
+333772.086801  7347431.680942 
+333791.803538  7347442.869026 
+333822.438285  7347460.506005 
+333840.753163  7347469.694431 
+333875.445056  7347479.732711 
+333905.106747  7347493.360377 
+333935.502353  7347505.128361 
+333958.014563  7347511.807217 
+333982.101803  7347523.275253 
+334003.179168  7347531.493845 
+334026.450031  7347542.951883 
+334045.482332  7347551.920346 
+334065.380486  7347565.218069 
+334076.051109  7347575.306341 
+334090.688168  7347594.643028 
+334102.488524  7347612.170026 
+334116.655548  7347628.167286 
+334123.903985  7347643.864597 
+334134.525130  7347658.282128 
+334152.419451  7347677.648810 
+334172.771148  7347686.527289 
+334189.197639  7347691.476442 
+334205.929241  7347696.875517 
+334219.114964  7347709.763309 
+334221.267230  7347725.960535 
+334221.176522  7347742.907632 
+334221.654803  7347753.985734 
+334235.508471  7347770.312938 
+334251.225786  7347775.921977 
+334274.339971  7347774.532215 
+334285.018839  7347766.793541 
+334293.974246  7347749.176558 
+334299.152879  7347740.817990 
+334306.821873  7347729.269968 
+334317.286340  7347722.191181 
+334326.637565  7347723.300990 
+334348.910634  7347741.837815 
+334356.777539  7347748.236719 
+334375.191372  7347757.865070 
+334390.933426  7347760.484621 
+334412.489073  7347761.954369 
+334430.754474  7347775.672020 
+334446.133694  7347800.997682 
+334451.304080  7347820.764296 
+334453.942874  7347847.489718 
+334462.510708  7347872.625413 
+334477.477616  7347880.993979 
+334502.636866  7347870.315808 
+334529.395885  7347853.458696 
+334558.282431  7347845.590043 
+334579.120655  7347847.939641 
+334600.148544  7347851.389050 
+334627.055994  7347856.798124 
+334651.926626  7347862.737106 
+334671.684594  7347861.187372 
+334688.589367  7347869.026029 
+334704.735487  7347881.393911 
+334716.676029  7347895.931420 
+334721.838169  7347916.257939 
+334730.529696  7347939.064032 
+334735.823776  7347956.401063 
+334741.653861  7347971.428488 
+334756.068273  7347983.886355 
+334776.469447  7347988.655538 
+334804.391184  7347985.766033 
+334830.960539  7347985.296113 
+334856.218744  7347992.344906 
+334879.506099  7348003.133058 
+334911.204610  7348016.240813 
+334938.268739  7348026.189108 
+334967.295471  7348032.837970 
+334990.970399  7348036.537336 
+335034.634190  7348036.487344 
+335053.245933  7348037.697137 
+335078.685554  7348038.107067 
+335101.898694  7348046.125694 
+335117.648994  7348066.132267 
+335138.470726  7348096.277103 
+335152.530550  7348121.572770 
+335168.701408  7348148.568146 
+335176.527081  7348167.374925 
+335195.353225  7348185.861758 
+335220.619676  7348191.800741 
+335231.529439  7348190.600946 
+335264.423653  7348197.729725 
+335283.315768  7348209.797658 
+335289.525179  7348245.311575 
+335287.776979  7348264.678257 
+335287.834702  7348286.164577 
+335300.987440  7348319.318898 
+335345.533578  7348357.712322 
+335373.570762  7348380.078490 
+335389.543711  7348398.205385 
+335406.951504  7348424.760837 
+335422.726543  7348442.447807 
+335453.245843  7348443.457634 
+335475.263279  7348423.221100 
+335500.678161  7348408.003707 
+335531.065521  7348402.594634 
+335555.746490  7348407.303827 
+335566.928378  7348426.490540 
+335578.588549  7348456.855339 
+335596.722010  7348482.101015 
+335613.898908  7348492.929160 
+335641.919600  7348498.898138 
+335667.746794  7348492.209283 
+335698.026953  7348478.711595 
+335722.411057  7348464.703995 
+335748.576347  7348445.957206 
+335779.318295  7348428.140258 
+335803.116917  7348411.363132 
+335824.614840  7348400.754949 
+335855.200109  7348396.555668 
+335880.260404  7348385.327591 
+335902.310825  7348370.410147 
+335913.014432  7348351.363409 
+335915.290392  7348321.488526 
+335912.931970  7348296.102875 
+335908.446021  7348270.457268 
+335907.514197  7348244.981631 
+335908.553222  7348225.494969 
+335922.769723  7348210.487540 
+335944.737682  7348202.538901 
+335979.157448  7348210.127601 
+335995.831327  7348220.515822 
+336018.755848  7348244.921642 
+336024.049928  7348271.337117 
+336013.511245  7348303.011691 
+336009.231452  7348338.845553 
+336010.344693  7348375.189328 
+336031.619968  7348419.511736 
+336036.856324  7348451.246300 
+336035.586405  7348464.414045 
+336035.809053  7348480.251332 
+336033.475370  7348497.728338 
+336050.569806  7348515.645269 
+336062.238222  7348536.601679 
+336063.087584  7348569.616024 
+336072.001759  7348590.762402 
+336087.075869  7348598.571065 
+336112.391797  7348609.829136 
+336122.039887  7348612.158737 
+336143.174976  7348614.718299 
+336162.405186  7348624.246667 
+336183.688707  7348640.883817 
+336186.896491  7348663.289979 
+336170.478246  7348674.838001 
+336155.659769  7348680.317062 
+336133.015620  7348693.794754 
+336122.724324  7348703.763046 
+336126.501098  7348720.300214 
+336136.742916  7348741.356607 
+336148.716443  7348762.203036 
+336174.040617  7348773.121166 
+336190.302184  7348775.410774 
+336217.638439  7348787.688670 
+336242.418362  7348792.847787 
+336266.785973  7348797.556980 
+336291.046384  7348803.256004 
+336310.012714  7348818.203444 
+336332.450708  7348840.609606 
+336353.387888  7348861.675997 
+336378.027625  7348878.233161 
+336398.024734  7348892.090787 
+336413.065859  7348912.087362 
+336412.834964  7348931.793987 
+336400.144015  7348947.041375 
+336395.361202  7348965.048290 
+336395.534372  7348994.283283 
+336391.452488  7349012.960084 
+336386.686167  7349029.737210 
+336377.244233  7349045.474514 
+336370.498816  7349056.472630 
+336373.698354  7349079.318717 
+336377.343188  7349089.886907 
+336385.853298  7349111.243249 
+336398.865850  7349130.889883 
+336400.968638  7349151.626331 
+336384.756549  7349172.262796 
+336370.803927  7349172.992671 
+336343.055361  7349169.243314 
+336319.256739  7349176.941995 
+336310.919800  7349193.679128 
+336298.558700  7349215.355415 
+336289.141505  7349229.433004 
+336264.897587  7349239.781231 
+336247.151698  7349243.020676 
+336226.346458  7349246.550072 
+336219.304177  7349248.459745 
+336208.963404  7349253.878816 
+336207.676992  7349268.266352 
+336221.439951  7349275.395131 
+336238.798267  7349278.914528 
+336260.724994  7349284.703536 
+336266.827205  7349302.720450 
+336269.903049  7349318.817693 
+336278.050324  7349336.184718 
+336293.281112  7349339.234196 
+336318.638272  7349338.084393 
+336331.601346  7349334.694973 
+336364.676977  7349326.096446 
+336394.107775  7349324.996634 
+336405.413357  7349332.875285 
+336399.970845  7349355.631387 
+336381.037499  7349382.106852 
+336368.767108  7349395.924485 
+336358.558274  7349407.872439 
+336336.697517  7349414.711267 
+336341.925627  7349429.508733 
+336358.533536  7349436.677505 
+336384.525655  7349451.255008 
+336416.273643  7349470.111778 
+336439.585737  7349487.548791 
+336460.819781  7349508.395220 
+336473.799348  7349531.241307 
+336486.383096  7349551.767791 
+336505.712260  7349570.924509 
+336525.577430  7349578.353237 
+336549.400790  7349595.680269 
+336567.031231  7349611.387578 
+336575.153768  7349631.634110 
+336574.370377  7349655.330051 
+336556.245162  7349673.956861 
+336536.305776  7349681.925496 
+336511.839210  7349693.933439 
+336498.966843  7349707.631093 
+336490.638151  7349732.236878 
+336486.135709  7349761.201916 
+336495.412718  7349796.085941 
+336503.980552  7349821.221636 
+336515.772662  7349849.046869 
+336516.844672  7349880.181536 
+336505.481366  7349912.835943 
+336501.704592  7349940.481208 
+336511.954657  7349970.386085 
+336512.985436  7349995.761739 
+336494.406678  7350018.147904 
+336460.506424  7350027.726263 
+336428.807913  7350031.575604 
+336406.130779  7350047.152936 
+336384.360730  7350073.048500 
+336366.969430  7350089.795631 
+336340.119703  7350114.741358 
+336318.943382  7350132.328346 
+336286.948007  7350153.234765 
+336260.906411  7350169.661951 
+336234.477242  7350193.277906 
+336205.590696  7350218.533580 
+336185.247245  7350234.810792 
+336151.676840  7350259.786513 
+336124.464279  7350280.412980 
+336100.533717  7350299.079783 
+336087.339748  7350323.075673 
+336085.393638  7350350.301009 
+336092.246256  7350374.626842 
+336094.819079  7350398.582739 
+336114.387385  7350423.288507 
+336142.853373  7350435.126479 
+336169.554668  7350432.776882 
+336201.261425  7350428.487616 
+336224.021021  7350449.893950 
+336232.968182  7350477.799170 
+336245.510698  7350511.613378 
+336267.833245  7350535.569274 
+336292.159625  7350553.676173 
+336308.000634  7350557.075591 
+336354.253742  7350562.694628 
+336391.040177  7350567.653779 
+336417.304421  7350576.482266 
+336437.268546  7350593.659324 
+336431.718833  7350616.075484 
+336428.214185  7350646.600256 
+336442.183299  7350671.356017 
+336459.789002  7350698.351391 
+336463.178202  7350713.898728 
+336464.736740  7350737.614666 
+336465.091328  7350769.519201 
+336452.218962  7350800.163952 
+336435.503852  7350828.439108 
+336429.863431  7350849.975419 
+336427.653441  7350883.729638 
+336441.169013  7350912.454717 
+336459.442660  7350934.480944 
+336483.818518  7350957.137064 
+336497.490768  7350972.354457 
+336499.511095  7351000.839578 
+336487.034548  7351023.845637 
+336467.820830  7351048.221462 
+336453.810484  7351071.427487 
+336445.432314  7351092.483880 
+336431.760064  7351122.018821 
+336411.804186  7351158.222619 
+336396.119855  7351185.297982 
+336379.907765  7351214.682948 
+336363.019485  7351249.047062 
+336351.977782  7351280.591659 
+336344.993225  7351295.029186 
+336338.981723  7351330.843051 
+336328.838859  7351354.319030 
+336325.556859  7351383.304065 
+336347.153737  7351399.711255 
+336373.673615  7351413.088963 
+336398.750402  7351436.744911 
+336417.378637  7351464.310189 
+336426.820572  7351492.885295 
+336424.676552  7351529.189076 
+336430.523129  7351561.043620 
+336443.403741  7351574.481318 
+336485.137915  7351610.835091 
+336491.471020  7351626.642383 
+336495.280778  7351658.136989 
+336490.250578  7351679.793279 
+336470.987383  7351708.918290 
+336455.352530  7351723.135855 
+336433.788636  7351748.371532 
+336429.484104  7351768.478088 
+336431.232305  7351794.413646 
+336412.463884  7351815.020116 
+336390.718574  7351829.287672 
+336370.259676  7351838.026175 
+336331.733286  7351842.235454 
+336300.315147  7351847.524548 
+336261.104320  7351858.492670 
+336236.736709  7351861.422168 
+336211.882570  7351863.021894 
+336190.186737  7351854.913283 
+336158.752106  7351834.836722 
+336137.006795  7351813.320407 
+336108.260435  7351790.514314 
+336082.680628  7351774.607038 
+336059.657152  7351758.499797 
+336027.529837  7351745.622003 
+336004.968150  7351742.812485 
+335960.009701  7351739.313084 
+335925.680643  7351740.912810 
+335890.617670  7351736.193618 
+335866.324274  7351741.672680 
+335840.983608  7351768.078157 
+335828.309151  7351798.722908 
+335823.699508  7351819.609330 
+335819.089865  7351839.825867 
+335804.642469  7351865.571457 
+335774.881823  7351877.529409 
+335748.180528  7351880.208950 
+335708.532651  7351875.109823 
+335683.909406  7351874.379948 
+335658.271875  7351872.870207 
+335636.180223  7351873.060174 
+335620.809249  7351890.277225 
+335616.504717  7351910.713725 
+335614.311220  7351942.258321 
+335602.156276  7351963.384703 
+335575.405504  7351988.110467 
+335553.693178  7351999.488518 
+335538.033586  7352024.564223 
+335537.415119  7352043.161038 
+335547.953802  7352056.348779 
+335561.988886  7352083.984045 
+335554.773434  7352100.841157 
+335532.953908  7352121.417633 
+335509.419166  7352158.471286 
+335495.573745  7352194.535109 
+335491.162011  7352233.138496 
+335493.404986  7352268.382459 
+335500.686408  7352308.335616 
+335508.462603  7352348.968655 
+335512.412548  7352386.222274 
+335515.702794  7352410.408131 
+335514.498844  7352444.622271 
+335509.303719  7352479.886230 
+335505.378513  7352511.630793 
+335504.520905  7352533.107114 
+335519.017778  7352556.863045 
+335536.376094  7352561.162309 
+335564.668911  7352552.623771 
+335601.059527  7352540.415862 
+335632.626098  7352521.729063 
+335658.642956  7352507.961421 
+335689.005577  7352497.013297 
+335710.643686  7352483.305645 
+335737.757292  7352471.427679 
+335766.066602  7352461.559370 
+335793.031777  7352463.089108 
+335820.813328  7352481.675924 
+335838.394291  7352511.010899 
+335848.957713  7352549.344333 
+335855.942270  7352579.329197 
+335869.441350  7352609.823973 
+335887.550072  7352619.562305 
+335913.014432  7352627.600928 
+335939.229200  7352632.330118 
+335966.788102  7352643.948128 
+335993.827493  7352656.545970 
+336013.115426  7352678.692177 
+336018.261074  7352710.096797 
+336010.575587  7352750.219925 
+336003.805432  7352781.044645 
+336003.500321  7352798.871591 
+336006.213331  7352820.277924 
+336019.506255  7352850.552739 
+336039.956907  7352869.279531 
+336066.847865  7352886.426594 
+336105.151606  7352902.143902 
+336128.760565  7352902.863778 
+336155.832940  7352894.635188 
+336180.291260  7352884.066998 
+336207.429605  7352878.497952 
+336233.314523  7352876.248337 
+336248.941130  7352889.716030 
+336248.429864  7352917.071345 
+336237.058312  7352940.867269 
+336230.906624  7352962.613544 
+336223.460278  7352999.967145 
+336218.726941  7353030.701881 
+336213.944127  7353057.897222 
+336200.197661  7353084.432677 
+336170.676155  7353119.976589 
+336146.720855  7353140.413088 
+336127.127811  7353162.459312 
+336110.874491  7353185.975284 
+336104.310491  7353207.711561 
+336102.521059  7353231.397503 
+336113.480299  7353261.202398 
+336137.056273  7353282.628728 
+336178.485336  7353310.014037 
+336207.116248  7353326.291249 
+336238.831252  7353348.357469 
+336259.471567  7353377.612458 
+336269.614431  7353425.904186 
+336263.949270  7353467.267101 
+336261.772265  7353497.921850 
+336268.212571  7353530.886204 
+336273.176802  7353569.049667 
+336262.934984  7353592.405666 
+336256.939974  7353618.041275 
+336262.852521  7353653.545193 
+336268.006416  7353683.180117 
+336262.753567  7353715.684549 
+336250.549145  7353741.240172 
+336230.296403  7353767.585659 
+336200.148184  7353795.040956 
+336176.432024  7353812.497966 
+336165.579985  7353844.052561 
+336164.862563  7353871.507858 
+336165.579985  7353907.181748 
+336175.805311  7353965.771712 
+336184.183481  7353989.797596 
+336192.000908  7354009.934147 
+336204.329022  7354026.681278 
+336215.791283  7354057.715963 
+336219.015559  7354069.383964 
+336223.864343  7354090.480350 
+336231.013825  7354106.737566 
+336236.497568  7354117.095791 
+336244.974693  7354132.253195 
+336253.493050  7354144.201148 
+336265.812918  7354153.089626 
+336277.085515  7354164.847612 
+336286.873791  7354172.936226 
+336294.163459  7354184.874181 
+336296.637328  7354191.433058 
+336301.329434  7354199.791626 
+336302.962187  7354216.868701 
+336302.822001  7354229.716500 
+336303.151851  7354245.333825 
+336304.545464  7354257.311774 
+336303.613639  7354276.468492 
+336302.178795  7354285.976863 
+336293.487268  7354298.504718 
+336276.120706  7354303.503861 
+336257.830567  7354308.612986 
+336242.847166  7354310.442673 
+336225.513589  7354312.232366 
+336211.305334  7354317.061539 
+336196.948646  7354325.980011 
+336179.961411  7354334.088622 
+336166.115990  7354342.907112 
+336154.439327  7354348.526149 
+336137.567539  7354354.875062 
+336116.465435  7354357.174668 
+336104.821757  7354360.034178 
+336088.807577  7354362.623735 
+336073.865407  7354360.464105 
+336062.180499  7354358.334469 
+336051.592338  7354358.104509 
+336037.804641  7354362.043834 
+336024.552948  7354363.663556 
+336011.639351  7354362.183810 
+335990.677433  7354360.734058 
+335983.536197  7354362.083827 
+335974.547806  7354373.061947 
+335969.327942  7354384.849927 
+335967.381831  7354403.876668 
+335973.805645  7354438.180792 
+335981.697287  7354461.086869 
+335989.382774  7354483.103098 
+335994.215066  7354505.969181 
+336000.795558  7354527.205543 
+336005.702065  7354543.542745 
+336006.543180  7354559.170068 
+336001.232608  7354578.266797 
+335994.314020  7354586.385406 
+335978.951293  7354603.592459 
+335969.130032  7354616.330277 
+335963.852444  7354632.557497 
+335962.681480  7354654.913668 
+335962.219691  7354668.971260 
+335966.854072  7354691.177456 
+335969.426896  7354706.274870 
+335978.192639  7354723.201971 
+335987.420172  7354735.599847 
+335994.569654  7354751.527119 
+335999.245266  7354769.963961 
+335994.957226  7354788.960707 
+335986.958383  7354802.938313 
+335968.445595  7354827.874041 
+335951.458360  7354844.731154 
+335933.869150  7354860.148513 
+335920.798874  7354872.076470 
+335906.870991  7354888.523653 
+335898.822669  7354906.270613 
+335892.819414  7354923.807609 
+335887.401640  7354952.322724 
+335881.827188  7354977.398429 
+335877.671088  7354993.195723 
+335880.029510  7355009.832874 
+335888.152047  7355029.749462 
+335900.917212  7355043.967027 
+335914.770880  7355052.425578 
+335934.256723  7355057.964629 
+335950.963586  7355066.683136 
+335973.846876  7355078.241156 
+335986.801704  7355084.480087 
+335999.748286  7355101.247215 
+336011.771291  7355118.214309 
+336019.423793  7355135.361372 
+336028.758526  7355164.596364 
+336041.754585  7355185.892716 
+336058.980961  7355211.458337 
+336077.551473  7355234.594374 
+336095.858105  7355254.410980 
+332741.101814  7354236.195391 
+332502.777502  7354836.182618 
+332270.225552  7355060.754151 
+332066.601378  7355329.898049 
+331836.811915  7355681.047900 
+332097.062954  7357342.563298 
+332089.286759  7357391.804863 
+332084.108126  7357442.346206 
+330702.765538  7357474.340726 
+328059.098209  7357476.850296 
+326572.937783  7357617.596187 
+325088.517311  7358098.433824 
+324813.216901  7358187.338596 
+323836.187002  7358520.431540 
+323692.084121  7358570.502963 
+323030.785901  7358765.929488 
+321650.193720  7359181.658278 
+320430.089679  7359519.310441 
+320357.102292  7359526.609191 
+320181.952353  7359475.527940 
+319998.490214  7359307.786673 
+319987.803099  7359291.999377 
+319974.386481  7359269.613212 
+319955.708769  7359252.936068 
+319943.867182  7359248.856767 
+319925.552303  7359244.147574 
+319902.957631  7359239.408386 
+319864.324041  7359229.230129 
+319834.109852  7359235.069129 
+319806.419009  7359239.908300 
+319770.399474  7359250.506485 
+319743.409561  7359262.204481 
+319724.748341  7359269.903162 
+319711.900714  7359274.102443 
+319698.071785  7359275.002289 
+319680.226942  7359273.342573 
+319662.893365  7359272.192770 
+319614.958026  7359261.434613 
+319593.352902  7359260.244816 
+319573.232099  7359261.354626 
+319548.048111  7359266.213794 
+319529.659016  7359271.632866 
+319518.839962  7359273.322576 
+319511.047274  7359272.502717 
+319498.529496  7359266.573732 
+319484.238778  7359260.644748 
+319465.387895  7359260.494774 
+319454.568840  7359261.414616 
+319433.656399  7359267.833517 
+319423.290887  7359276.612013 
+319414.937456  7359284.140723 
+319407.293200  7359298.008348 
+319398.882044  7359313.885628 
+319389.918392  7359336.111821 
+319386.562176  7359347.979788 
+319350.262269  7359362.377322 
+319298.376985  7359408.559411 
+319292.332498  7359411.298942 
+319283.269891  7359412.488738 
+319248.041993  7359416.508050 
+319180.274470  7359446.332941 
+319136.082920  7359463.729961 
+319126.352368  7359468.629122 
+319142.053191  7356557.657745 
diff --git a/examples/data/EstadosBrasil.dbf b/examples/data/EstadosBrasil.dbf
old mode 100755
new mode 100644
diff --git a/examples/data/EstadosBrasil.shp b/examples/data/EstadosBrasil.shp
old mode 100755
new mode 100644
diff --git a/examples/data/EstadosBrasil.shx b/examples/data/EstadosBrasil.shx
old mode 100755
new mode 100644
diff --git a/examples/data/Mapa_Distritos_SP.dbf b/examples/data/Mapa_Distritos_SP.dbf
old mode 100755
new mode 100644
index cfbdf58..2599d2e
Binary files a/examples/data/Mapa_Distritos_SP.dbf and b/examples/data/Mapa_Distritos_SP.dbf differ
diff --git a/examples/data/Mapa_Distritos_SP.shp b/examples/data/Mapa_Distritos_SP.shp
old mode 100755
new mode 100644
diff --git a/examples/data/Mapa_Distritos_SP.shx b/examples/data/Mapa_Distritos_SP.shx
old mode 100755
new mode 100644
diff --git a/examples/data/Mapa_Drenagem_SP.dbf b/examples/data/Mapa_Drenagem_SP.dbf
old mode 100755
new mode 100644
index 4fa92fb..adc5c6f
Binary files a/examples/data/Mapa_Drenagem_SP.dbf and b/examples/data/Mapa_Drenagem_SP.dbf differ
diff --git a/examples/data/Mapa_Drenagem_SP.shp b/examples/data/Mapa_Drenagem_SP.shp
old mode 100755
new mode 100644
diff --git a/examples/data/Mapa_Drenagem_SP.shx b/examples/data/Mapa_Drenagem_SP.shx
old mode 100755
new mode 100644
diff --git a/examples/data/OcorrenciasBH.csv b/examples/data/OcorrenciasBH.csv
old mode 100755
new mode 100644
index 90e76a2..ae6068c
--- a/examples/data/OcorrenciasBH.csv
+++ b/examples/data/OcorrenciasBH.csv
@@ -1,6502 +1,6502 @@
-COD;Nrbo;Nat;Descricao;Ender;Num;Logr;DataHora;Origem;Post;Comp;Bairro;Munic;X;Y;ID
-1;2001000025;B04001;HOMICIDIO TENTAD;RUA DO GROTAO;200;107217;1/1/2001 00:23:00;CIDADAO COMUM;S;;HAVAI;BH;607513.23;793290.01;0
-2;2001000059;B04001;HOMICIDIO TENTAD;RUA SAO CLEMENTE;1258;62197;1/1/2001 00:53:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609535.38;800385.58;1
-3;2001000068;B06000;LESAO CORPORAL;RUA CORONEL SEVE;830;18072;1/1/2001 00:58:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604805.84;789781.71;2
-4;2001000076;B06000;LESAO CORPORAL;RUA PADRE ODORIC;95;51629;1/1/2001 01:03:00;CIDADAO COMUM;S;0;SAO PEDRO;BH;611365.75;794708.98;3
-5;2001000088;B03000;AMEACA;RUA PADRE CYR AS;116;12091;1/1/2001 01:10:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612147.89;803583.29;4
-6;2001000091;B03000;AMEACA;RUA TRINTA E SET;54;34190;1/1/2001 01:11:00;CIDADAO COMUM;S;0;CONJUNTO FELICID;BH;612530.17;807443.42;5
-7;2001000199;B06000;LESAO CORPORAL;BECO UNIAO;60;302076;1/1/2001 02:23:00;CIDADAO COMUM;N;;VILA CASTANHEIRA;BH;601465.58;788609.45;6
-8;2001000202;B06000;LESAO CORPORAL;RUA JAGUARIBE;821;36822;1/1/2001 02:26:00;CIDADAO COMUM;S;FU;CONCORDIA;BH;611317.87;799724.84;7
-9;2001000234;B06000;LESAO CORPORAL;RUA GOVERNADOR M;23;31642;1/1/2001 02:47:00;CIDADAO COMUM;S;;GAMELEIRA;BH;606275.34;796492.16;8
-10;2001000271;B02000;RIXA;RUA ALVARO OLIVE;175;58381;1/1/2001 03:08:00;CIDADAO COMUM;S;CAA;MARIA VIRGINIA;BH;611835.32;802870.75;9
-11;2001000301;B06000;LESAO CORPORAL;RUA CONEGO TRIND;450;16861;1/1/2001 03:30:00;CIDADAO COMUM;S;B;JARDIM LEBLON;BH;605814.70;807064.01;10
-12;2001000319;B06000;LESAO CORPORAL;RUA PROFESSORA G;528;86335;1/1/2001 03:46:00;INICIATIVA;N;0;FLORAMAR;BH;611759.02;807690.27;11
-13;2001000363;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;1/1/2001 04:28:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;12
-14;2001000372;B03000;AMEACA;RUA JOSE DE FREI;100;99942;1/1/2001 04:36:00;CIDADAO COMUM;S;;PIRATININGA;BH;606412.42;809836.32;13
-15;2001000399;B04001;HOMICIDIO TENTAD;RUA GERALDO SILV;216;56588;1/1/2001 04:49:00;CIDADAO COMUM;N;LJA;RIO BRANCO;BH;606400.39;808660.43;14
-16;2001000422;B02000;RIXA;RUA JUREMA;553;39745;1/1/2001 05:08:00;CIDADAO COMUM;S;0;DA GRACA;BH;612108.35;799658.14;15
-17;2001000425;B04001;HOMICIDIO TENTAD;RUA CORONEL JOAQ;1202;87063;1/1/2001 05:13:00;CIDADAO COMUM;S;SL1408;CEU AZUL;BH;605036.32;808629.66;16
-18;2001000460;B04002;HOMICIDIO CONSUM;RUA ALFREDO ALVE;17;20636;1/1/2001 05:48:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608766.99;807874.12;17
-19;2001000467;B06000;LESAO CORPORAL;AV SILVA LOBO;667;65889;1/1/2001 05:55:00;CIDADAO COMUM;S;AN2;NOVA SUISSA;BH;607649.22;796002.23;18
-20;2001000508;B04001;HOMICIDIO TENTAD;RUA ITAIPU;170;35439;1/1/2001 06:43:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616260.45;798259.34;19
-21;2001000512;B06000;LESAO CORPORAL;RUA JURAMENTO;191;39732;1/1/2001 06:45:00;CIDADAO COMUM;S;;PARAISO;BH;614799.88;797390.14;20
-22;2001000514;B06000;LESAO CORPORAL;RUA JULIO MESQUI;100;81849;1/1/2001 06:47:00;INICIATIVA;S;0;ITAIPU BH;BH;599095.68;788673.49;21
-23;2001000515;B04001;HOMICIDIO TENTAD;BECO ALEGRE;10;77047;1/1/2001 06:48:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606081.83;794476.42;22
-24;2001000548;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;250;26052;1/1/2001 07:35:00;INICIATIVA;N;0;CENTRO (BH);BH;611330.13;797421.35;23
-25;2001000552;B06000;LESAO CORPORAL;RUA DIVINOPOLIS;253;21424;1/1/2001 07:40:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;613916.97;797543.46;24
-26;2001000662;B06000;LESAO CORPORAL;RUA ELISA DE CAR;38;9768;1/1/2001 09:40:00;CIDADAO COMUM;S;0;JARDIM ESTRELA;BH;607183.28;809980.10;25
-27;2001000713;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;685;6731;1/1/2001 10:36:00;INICIATIVA;N;0;CENTRO (BH);BH;610740.67;796659.40;26
-28;2001000719;B06000;LESAO CORPORAL;RUA CASTELO BRAN;100;14030;1/1/2001 10:40:00;CIDADAO COMUM;S;CAA;SANTA TEREZINHA;BH;604419.23;802582.27;27
-29;2001000865;B03000;AMEACA;RUA CORONEL EUGE;64;48324;1/1/2001 13:25:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613368.05;804242.96;28
-30;2001000866;B06000;LESAO CORPORAL;RUA JOAIMA;35;37359;1/1/2001 13:25:00;CIDADAO COMUM;S;CAC;JARDIM LEBLON;BH;605654.36;808186.87;29
-31;2001000912;B03000;AMEACA;AV ABILIO MACHAD;47;634;1/1/2001 14:16:00;INICIATIVA;N;0;INCONFIDENCIA;BH;605263.41;797972.47;30
-32;2001000946;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;1/1/2001 14:52:00;CIDADAO COMUM;S;;TIROL;BH;600947.66;789885.51;31
-33;2001000983;B06000;LESAO CORPORAL;RUA DIRCEU DUART;32;86902;1/1/2001 15:25:00;CIDADAO COMUM;S;;TREVO;BH;603501.37;806677.03;32
-34;2001001008;B04001;HOMICIDIO TENTAD;RUA FIRMINO DUAR;309;89879;1/1/2001 15:44:00;CIDADAO COMUM;N;CA;PALMEIRAS;BH;607146.75;791513.38;33
-35;2001001033;B04001;HOMICIDIO TENTAD;PRACA BAGATELLE;49;84720;1/1/2001 16:06:00;INICIATIVA;S;0;AEROPORTO DA PAM;BH;609324.75;804535.55;34
-36;2001001071;B03000;AMEACA;RUA ARISCO;50;74758;1/1/2001 16:40:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616713.81;804674.58;35
-37;2001001073;B03000;AMEACA;RUA CORREAS;575;87091;1/1/2001 16:41:00;CIDADAO COMUM;N;;BELVEDERE;BH;612014.79;792467.39;36
-38;2001001100;B03000;AMEACA;RUA VIRTULINO PI;250;130438;1/1/2001 17:05:00;CIDADAO COMUM;N;;OLARIA;BH;602132.24;789116.66;37
-39;2001001122;B04002;HOMICIDIO CONSUM;RUA GUIMARAES;1046;62953;1/1/2001 17:18:00;INICIATIVA;N;0;SAO FRANCISCO;BH;608640.25;801619.48;38
-40;2001001192;B03000;AMEACA;RUA FELISBURGO;290;3950;1/1/2001 18:07:00;CIDADAO COMUM;S;LJB;PROVIDENCIA;BH;612659.95;804501.51;39
-41;2001001235;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;6760;18652;1/1/2001 18:38:00;CIDADAO COMUM;N;TERREO;CELESTINO;BH;612122.58;803304.40;40
-42;2001001246;B03000;AMEACA;RUA PROFESSOR RO;245;30334;1/1/2001 18:47:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;607159.88;793820.71;41
-43;2001001249;B04001;HOMICIDIO TENTAD;RUA HILO ESTEVAM;126;94721;1/1/2001 18:51:00;CIDADAO COMUM;N;CAA;CASTELO;BH;605544.85;799870.90;42
-44;2001001294;B02000;RIXA;RUA PORANGA;180;54702;1/1/2001 19:15:00;CIDADAO COMUM;N;CAN;IPANEMA;BH;604697.48;798156.89;43
-45;2001001329;B03000;AMEACA;RUA REDENCAO;151;6413;1/1/2001 19:35:00;CIDADAO COMUM;S;;SAO JOSE;BH;605190.15;798573.66;44
-46;2001001378;B04001;HOMICIDIO TENTAD;RUA AUGUSTO CALH;113;6671;1/1/2001 20:04:00;CIDADAO COMUM;N;;TUPI;BH;613374.04;806556.45;45
-47;2001001391;B06000;LESAO CORPORAL;RUA ITAJUBA;2146;35495;1/1/2001 20:13:00;CIDADAO COMUM;N;0;SAGRADA FAMILIA;BH;612389.93;799465.33;46
-48;2001001505;B06000;LESAO CORPORAL;AV DO CONTORNO;1700;17228;1/1/2001 21:34:00;CIDADAO COMUM;N;PX1700;CENTRO (BH);BH;612216.60;797607.77;47
-49;2001001539;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;281;51657;1/1/2001 21:49:00;INICIATIVA;N;0;PIRATININGA;BH;605627.01;810002.31;48
-50;2001001585;B06000;LESAO CORPORAL;RUA DOS TAMOIOS;19;66825;1/1/2001 22:31:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611310.59;796955.28;49
-51;2001001638;B06000;LESAO CORPORAL;RUA LENI AMARAL;10;75130;1/1/2001 23:10:00;CIDADAO COMUM;N;0;PARQUE NOVO PROG;CO;602712.79;800069.59;50
-52;2001001639;B03000;AMEACA;RUA SERINGUEIRA;39;90471;1/1/2001 23:10:00;CIDADAO COMUM;S;;PATROCINIO;BH;605322.15;794242.76;51
-53;2001001663;B03000;AMEACA;RUA SERRA DA MOE;61;120796;1/1/2001 23:28:00;CIDADAO COMUM;S;AP304;ANTONIO RIBEIRO ;BH;614923.14;807439.28;52
-54;2001001754;B03000;AMEACA;AV DOS CLARINS;220;118337;2/1/2001 00:47:00;CIDADAO COMUM;S;0;CH CALIFORNIA;BH;604029.04;796740.78;53
-55;2001002036;B03000;AMEACA;RUA BEIRA LINHA;224;121732;2/1/2001 09:04:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615460.33;805397.29;54
-56;2001002178;B03000;AMEACA;RUA JULITA NOGUE;425;39597;2/1/2001 11:11:00;CIDADAO COMUM;N;FU;SARANDI (URCA/BH;BH;603736.32;802490.17;55
-57;2001002183;B03000;AMEACA;RUA PITT;231;54380;2/1/2001 11:14:00;CIDADAO COMUM;S;;UNIAO;BH;612654.99;801102.30;56
-58;2001002285;B03000;AMEACA;AV SEN LEVINDO C;1891;14866;2/1/2001 12:34:00;INICIATIVA;N;0;SANTA CECILIA;BH;600974.57;787879.14;57
-59;2001002303;B06000;LESAO CORPORAL;RUA CAMBUQUIRA;111;11830;2/1/2001 12:53:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;609340.52;798017.72;58
-60;2001002364;B06000;LESAO CORPORAL;AV BIAS FORTES;1772;9553;2/1/2001 13:51:00;CIDADAO COMUM;N;;BARRO PRETO;BH;610196.72;797244.85;59
-61;2001002489;B04001;HOMICIDIO TENTAD;RUA NEFELINA;14;81228;2/1/2001 15:27:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;612774.85;797219.81;60
-62;2001002662;B05000;SEQUESTRO E CARC;RUA ITARANA;39;35946;2/1/2001 17:19:00;CIDADAO COMUM;S;CSC;CAICARA;BH;607841.94;799963.57;61
-63;2001002694;B06000;LESAO CORPORAL;RUA MARECHAL RON;202;43677;2/1/2001 17:35:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611946.85;803377.88;62
-64;2001002795;B03000;AMEACA;RUA TANCREDO EST;106;66838;2/1/2001 18:40:00;INICIATIVA;S;0;SAO TOMAZ;BH;609723.18;805275.89;63
-65;2001002805;B03000;AMEACA;RUA MONTEIRO LOB;37;46590;2/1/2001 18:43:00;CIDADAO COMUM;S;;PROFESSOR WASHIN;IB;598805.74;789334.93;64
-66;2001002849;B03000;AMEACA;RUA JOAQUIM GOUV;565;1422;2/1/2001 18:57:00;POLICIAL MILITAR;S;0;SAO PAULO;BH;612537.01;803135.61;65
-67;2001002884;B03000;AMEACA;RUA ESTER DE LIM;288;26301;2/1/2001 19:10:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;611011.80;801489.74;66
-68;2001002908;B03000;AMEACA;RUA FERNAO DIAS;1022;28133;2/1/2001 19:20:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616049.67;798294.87;67
-69;2001002924;B06000;LESAO CORPORAL;RUA DOS VIOLONCE;410;125948;2/1/2001 19:26:00;CIDADAO COMUM;S;0;CH CALIFORNIA;BH;604013.72;797224.38;68
-70;2001002977;B03000;AMEACA;RUA MELCHIOR DIA;14;99577;2/1/2001 20:02:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616662.42;797200.41;69
-71;2001002991;B03000;AMEACA;RUA PADRE EUSTAQ;1284;51294;2/1/2001 20:10:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608346.53;797943.62;70
-72;2001003016;B03000;AMEACA;RUA SOARES NOGUE;52;66220;2/1/2001 20:23:00;CIDADAO COMUM;S;;VILA MAGNESITA;BH;602129.61;794910.94;71
-73;2001003022;B03000;AMEACA;RUA CARNEIRO DE ;94;127348;2/1/2001 20:26:00;CIDADAO COMUM;N;0;SAO PAULO;BH;612957.95;802850.74;72
-74;2001003052;B03000;AMEACA;RUA ITAPERUNA;130;35785;2/1/2001 20:46:00;INICIATIVA;S;0;SAUDADE;BH;614979.57;797450.46;73
-75;2001003054;B06000;LESAO CORPORAL;RUA JOSE GOMES;371;38802;2/1/2001 20:48:00;CIDADAO COMUM;N;;SARANDI (URCA/BH;BH;603642.20;802295.14;74
-76;2001003088;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;510;7936;2/1/2001 21:08:00;CIDADAO COMUM;S;FR449;NOVA SUISSA;BH;607529.85;795029.50;75
-77;2001003128;B04001;HOMICIDIO TENTAD;RUA DOIS;36;27130;2/1/2001 21:24:00;CIDADAO COMUM;S;0;PAULO VI;BH;616592.76;806783.71;76
-78;2001003160;B03000;AMEACA;AV DOM PEDRO II;3545;53145;2/1/2001 21:47:00;CIDADAO COMUM;N;0;ADELAIDE;BH;607409.82;797890.53;77
-79;2001003185;B03000;AMEACA;RUA GENTIOS;1350;30983;2/1/2001 22:03:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;608905.13;793585.28;78
-80;2001003196;B04001;HOMICIDIO TENTAD;RUA LEONCIO CHAG;236;40700;2/1/2001 22:06:00;CIDADAO COMUM;N;;UNIAO;BH;613064.02;800949.19;79
-81;2001003322;B03000;AMEACA;RUA PRINCESA IZA;45;23420;2/1/2001 23:28:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617682.03;797457.97;80
-82;2001003354;B03000;AMEACA;AV CLARA NUNES;306;45644;2/1/2001 23:54:00;CIDADAO COMUM;S;0;RENASCENCA;BH;611039.95;800586.09;81
-83;2001003374;B03000;AMEACA;AV JOSE CANDIDO ;1190;12602;3/1/2001 00:11:00;INICIATIVA;N;0;UNIAO;BH;613277.34;800584.46;82
-84;2001003377;B06000;LESAO CORPORAL;RUA 1;11;27156;3/1/2001 00:16:00;CIDADAO COMUM;N;0;PAULO SEXTO;BH;616440.05;806805.03;83
-85;2001003421;B06000;LESAO CORPORAL;RUA MARIA ROSA D;839;107800;3/1/2001 01:09:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606529.17;811742.51;84
-86;2001003422;B03000;AMEACA;RUA CONCEICAO DO;1280;68253;3/1/2001 01:11:00;CIDADAO COMUM;S;0;SANTA INES;BH;613887.33;801220.49;85
-87;2001003433;B08000;VIOLACAO DE DOMI;RUA DO PROGRESSO;50;25311;3/1/2001 01:29:00;CIDADAO COMUM;N;;TAQUARIL;BH;616998.11;797400.70;86
-88;2001003450;B04001;HOMICIDIO TENTAD;AV PRESIDENTE AN;1240;4461;3/1/2001 01:55:00;CIDADAO COMUM;N;;SAO CRISTOVAO;BH;610402.72;799177.41;87
-89;2001003489;B03000;AMEACA;RUA MARIA GERTRU;808;98993;3/1/2001 03:25:00;CIDADAO COMUM;S;;CEU AZUL;BH;604484.86;808826.28;88
-90;2001003554;B03000;AMEACA;AV CRISTIANO MAC;4000;18652;3/1/2001 05:23:00;INICIATIVA;N;0;DOS PALMARES;BH;612434.91;802092.92;89
-91;2001003563;B06000;LESAO CORPORAL;AV PAES DE ABREU;205;51758;3/1/2001 05:45:00;CIDADAO COMUM;S;0;ERMELINDA;BH;608960.89;800469.77;90
-92;2001003618;B03000;AMEACA;RUA EDSON;525;25050;3/1/2001 07:32:00;CIDADAO COMUM;S;0;UNIAO;BH;612997.48;801565.94;91
-93;2001003778;B03000;AMEACA;RUA JAGUARI;139;36807;3/1/2001 10:09:00;CIDADAO COMUM;N;;BONFIM;BH;609648.11;797805.24;92
-94;2001003868;B03000;AMEACA;AV AUGUSTO DE LI;134;6731;3/1/2001 11:36:00;CIDADAO COMUM;S;SJ;CENTRO (BH);BH;611209.44;796588.30;93
-95;2001004071;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;3/1/2001 14:06:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605855.99;798012.24;94
-96;2001004348;B06000;LESAO CORPORAL;RUA ARANTINA;134;58697;3/1/2001 16:59:00;CIDADAO COMUM;S;0;MINASLANDIA;BH;612191.42;804524.92;95
-97;2001004358;B03000;AMEACA;RUA JORNALISTA O;157;53057;3/1/2001 17:05:00;CIDADAO COMUM;S;0;EYMARD;BH;613530.40;803630.21;96
-98;2001004388;B06000;LESAO CORPORAL;AV CIVILIZACAO;655;51657;3/1/2001 17:20:00;POLICIAL MILITAR;S;0;LEBLON;BH;605180.09;810022.74;97
-99;2001004423;B04001;HOMICIDIO TENTAD;RUA SAO PAULO;279;63464;3/1/2001 17:40:00;CIDADAO COMUM;S;0;CENTRO BH;BH;611088.02;797493.26;98
-100;2001004516;B06000;LESAO CORPORAL;RUA MARTIM DE CA;723;44944;3/1/2001 18:36:00;INICIATIVA;S;0;SANTO AGOSTINHO;BH;609264.88;796048.94;99
-101;2001004539;B03000;AMEACA;RUA RAINHA DAS F;185;92159;3/1/2001 18:50:00;CIDADAO COMUM;S;0;FILADELFIA;BH;602133.38;797481.77;100
-102;2001004579;B03000;AMEACA;RUA FALCAO;200;27749;3/1/2001 19:08:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604919.00;788611.78;101
-103;2001004584;B06000;LESAO CORPORAL;AV EUGENIO RICAL;440;111568;3/1/2001 19:08:00;CIDADAO COMUM;S;;CORACAO EUCARIST;BH;605706.92;796121.88;102
-104;2001004611;B03000;AMEACA;AV SERRANA;530;65040;3/1/2001 19:27:00;CIDADAO COMUM;N;0;SERRANO;BH;603547.03;801432.44;103
-105;2001004672;B03000;AMEACA;RUA DOUTOR BENED;155;12252;3/1/2001 20:01:00;CIDADAO COMUM;S;;AARAO REIS;BH;612381.24;803451.51;104
-106;2001004728;B03000;AMEACA;AV CARANDAI;200;13081;3/1/2001 20:38:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612639.37;796065.46;105
-107;2001004771;B03000;AMEACA;RUA POLONIA;816;54541;3/1/2001 21:02:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605588.31;807537.18;106
-108;2001004858;B06000;LESAO CORPORAL;RUA DOUTOR CRIST;5655;55598;3/1/2001 21:53:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;606433.34;793314.02;107
-109;2001004861;B06000;LESAO CORPORAL;RUA RIO DAS FLOR;170;92770;3/1/2001 21:54:00;CIDADAO COMUM;S;;PILAR;BH;607837.36;788169.94;108
-110;2001005031;B06000;LESAO CORPORAL;ESTRADA DO CERCA;2265;26428;3/1/2001 23:49:00;CIDADAO COMUM;N;0;SAO DOMINGOS;BH;607618.88;793402.60;109
-111;2001005081;B06000;LESAO CORPORAL;RUA BAURU;270;8510;4/1/2001 00:19:00;CIDADAO COMUM;S;BL/08 CASA 65;PIRATININGA;BH;605644.06;809035.86;110
-112;2001005100;B06000;LESAO CORPORAL;RUA MARCIA WINDS;97;21478;4/1/2001 00:39:00;CIDADAO COMUM;N;;MINEIRAO;BH;601682.50;785249.63;111
-113;2001005192;B04001;HOMICIDIO TENTAD;RUA MUNIZ;149;170850;4/1/2001 01:53:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608113.39;793880.88;112
-114;2001005207;B03000;AMEACA;RUA CELIO DE CAS;185;14507;4/1/2001 02:13:00;CIDADAO COMUM;S;0;FLORESTA;BH;611275.26;797940.88;113
-115;2001005237;B06000;LESAO CORPORAL;AV OLEGARIO MACI;642;49699;4/1/2001 02:44:00;CIDADAO COMUM;N;EM FRENTE AO HOT;CENTRO (BH);BH;610498.04;797083.99;114
-116;2001005292;B02000;RIXA;AV AMAZONAS;4601;3140;4/1/2001 04:03:00;CIDADAO COMUM;N;;NOVA SUISSA;BH;607279.09;796018.67;115
-117;2001005297;B02000;RIXA;RUA DOS CAETES;372;11376;4/1/2001 04:11:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611253.80;797440.40;116
-118;2001005456;B03000;AMEACA;RUA JUSSARA;30;39859;4/1/2001 08:26:00;CIDADAO COMUM;S;AP101;DA GRACA;BH;611788.28;799174.80;117
-119;2001005492;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;4/1/2001 09:00:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;118
-120;2001005708;B03000;AMEACA;RUA CARLOS PINTO;176;107220;4/1/2001 11:26:00;CIDADAO COMUM;S;0;CH JATOBA IV;BH;600744.25;787612.36;119
-121;2001005758;B03000;AMEACA;RUA MUNIZ;100;170850;4/1/2001 12:15:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608081.16;793922.64;120
-122;2001005759;B03000;AMEACA;RUA QUARENTA E D;46;34830;4/1/2001 12:16:00;CIDADAO COMUM;N;CSC;CONJUNTO FELICID;BH;612592.89;807203.40;121
-123;2001005783;B03000;AMEACA;RUA JOAQUIM HENR;58;94371;4/1/2001 12:49:00;CIDADAO COMUM;S;CAZZ;OURO PRETO;BH;606222.37;801428.56;122
-124;2001005786;B03000;AMEACA;RUA ADOLFO LIPPI;140;114377;4/1/2001 12:50:00;CIDADAO COMUM;N;0;GARCAS;BH;604210.15;806428.13;123
-125;2001005875;B04002;HOMICIDIO CONSUM;RUA SOCRATES;24;85953;4/1/2001 13:58:00;CIDADAO COMUM;N;;DOM SILVERIO;BH;615325.98;804426.93;124
-126;2001006054;B03000;AMEACA;AV SILVA LOBO;1349;65889;4/1/2001 16:06:00;CIDADAO COMUM;S;PX1339;NOVA SUISSA;BH;607796.39;795312.06;125
-127;2001006300;B03000;AMEACA;RUA DOM RAFAEL;5;23026;4/1/2001 18:12:00;CIDADAO COMUM;S;;TAQUARIL;BH;617052.78;797306.19;126
-128;2001006317;B03000;AMEACA;RUA ELANEY;75;106517;4/1/2001 18:25:00;INICIATIVA;S;0;NOVA YORK;BH;608476.48;810630.48;127
-129;2001006394;B06000;LESAO CORPORAL;RUA JOSE BITES P;125;9263;4/1/2001 19:02:00;INICIATIVA;S;0;PLANALTO;BH;609866.26;807083.02;128
-130;2001006444;B03000;AMEACA;RUA PADRE PETROL;435;53577;4/1/2001 19:30:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;613153.17;798892.77;129
-131;2001006458;B06000;LESAO CORPORAL;RUA MARIANA BARC;271;62994;4/1/2001 19:35:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608942.35;800261.12;130
-132;2001006483;B06000;LESAO CORPORAL;BECO SOL NASCENT;146;301434;4/1/2001 19:47:00;CIDADAO COMUM;S;PX135;CAFEZAL;BH;614453.31;795387.14;131
-133;2001006531;B06000;LESAO CORPORAL;AV JOAQUIM DE OL;100;91852;4/1/2001 20:14:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605302.61;791288.17;132
-134;2001006561;B03000;AMEACA;RUA DOS TUPIS;560;69965;4/1/2001 20:30:00;INICIATIVA;N;0;CENTRO BH;BH;610743.92;796999.61;133
-135;2001006607;B04001;HOMICIDIO TENTAD;RUA DA PAZ;45;31236;4/1/2001 20:55:00;CIDADAO COMUM;N;0;CONJ HAB JARDIM ;BH;603918.54;798119.82;134
-136;2001006617;B03000;AMEACA;BECO PRINCIPAL;55;301983;4/1/2001 21:00:00;CIDADAO COMUM;S;0;SAO JOSE;BH;604808.72;799278.97;135
-137;2001006646;B03000;AMEACA;RUA DOS APIACAS;311;5032;4/1/2001 21:18:00;CIDADAO COMUM;S;;GLORIA;BH;602801.44;797853.30;136
-138;2001006695;B03000;AMEACA;RUA PADRE FEIJO;25;51326;4/1/2001 21:45:00;CIDADAO COMUM;N;0;SAUDADE;BH;614908.34;797473.24;137
-139;2001006713;B03000;AMEACA;RUA CIPRIANO DE ;65;15856;4/1/2001 21:53:00;CIDADAO COMUM;N;CS17;CINQUENTENARIO;BH;606432.80;793433.46;138
-140;2001006756;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;5393;18652;4/1/2001 22:14:00;INICIATIVA;N;0;DOS PALMARES;BH;612255.77;802179.75;139
-141;2001006798;B06000;LESAO CORPORAL;RUA CASTANHOLAS;10;100508;4/1/2001 22:46:00;CIDADAO COMUM;S;;MADRID;BH;611241.05;808632.80;140
-142;2001006824;B03000;AMEACA;RUA CACATUA;422;11219;4/1/2001 23:00:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604646.79;788784.90;141
-143;2001006941;B04002;HOMICIDIO CONSUM;RUA ANTARES;160;4244;5/1/2001 00:09:00;INICIATIVA;N;0;SANTA LUCIA;BH;610301.90;793066.15;142
-144;2001006955;B03000;AMEACA;AV CORONEL DURVA;25;17688;5/1/2001 00:15:00;INICIATIVA;N;0;DURVAL DE BARROS;BH;598751.16;791078.18;143
-145;2001007010;B03000;AMEACA;AV SILVA LOBO;883;65889;5/1/2001 00:58:00;INICIATIVA;S;0;NOVA SUISSA;BH;607689.30;795757.86;144
-146;2001007408;B06000;LESAO CORPORAL;AV DO CONTORNO;2660;17228;5/1/2001 09:03:00;CIDADAO COMUM;N;LJ4;CENTRO (BH);BH;612719.50;796848.35;145
-147;2001007413;B03000;AMEACA;RUA FLOR DE MAIO;101;300399;5/1/2001 09:08:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614412.83;794669.54;146
-148;2001007558;B03000;AMEACA;RUA JOANA ANGELI;975;37374;5/1/2001 10:47:00;CIDADAO COMUM;S;;MINASLANDIA;BH;612135.77;804101.78;147
-149;2001007565;B03000;AMEACA;RUA JOSE PINTO D;20;100901;5/1/2001 10:49:00;CIDADAO COMUM;S;0;JARDIM GUANABARA;BH;611479.65;807085.75;148
-150;2001007622;B03000;AMEACA;RUA MARECHAL BIT;476;43589;5/1/2001 11:36:00;CIDADAO COMUM;S;AP04;GUTIERREZ;BH;608965.94;795104.99;149
-151;2001007678;B03000;AMEACA;RUA MAESTRO JOSE;40;80760;5/1/2001 12:12:00;CIDADAO COMUM;S;AP602;NOVA SUISSA;BH;606643.01;795091.48;150
-152;2001007766;B03000;AMEACA;RUA OITO;35;117287;5/1/2001 13:10:00;CIDADAO COMUM;N;;LINDEIA;BH;600021.70;790389.81;151
-153;2001007775;B06000;LESAO CORPORAL;RUA DOS TUPIS;1253;69965;5/1/2001 13:16:00;CIDADAO COMUM;S;LJC;BARRO PRETO;BH;610089.19;797131.58;152
-154;2001007794;B03000;AMEACA;RUA MANNESMANN;250;42936;5/1/2001 13:26:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604801.53;790717.02;153
-155;2001007856;B06000;LESAO CORPORAL;AV BRASIL;1124;10420;5/1/2001 14:03:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;612027.86;796111.45;154
-156;2001007936;B03000;AMEACA;PRACA ESTEVAO LU;23;26314;5/1/2001 14:58:00;CIDADAO COMUM;N;LJ7;HORTO;BH;613259.16;797963.43;155
-157;2001007938;B03000;AMEACA;RUA JOSE SANTIAG;240;39152;5/1/2001 15:00:00;CIDADAO COMUM;N;CAFR;PIRAJA;BH;613860.40;803263.57;156
-158;2001007945;B03000;AMEACA;RUA SAGARANA;90;59848;5/1/2001 15:01:00;CIDADAO COMUM;S;0;SANTO ANTONIO;BH;610964.40;794592.76;157
-159;2001007961;B06000;LESAO CORPORAL;RUA ENGENHEIRO R;5;94214;5/1/2001 15:14:00;CIDADAO COMUM;N;CAFRENT;CARDOSO;BH;603229.05;788522.32;158
-160;2001008303;B06000;LESAO CORPORAL;RUA CURITIBA;495;19090;5/1/2001 18:13:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610917.19;797386.71;159
-161;2001008430;B03000;AMEACA;AV VISCONDE DE I;20;73289;5/1/2001 19:29:00;INICIATIVA;S;;BARREIRO;BH;602935.35;791287.83;160
-162;2001008451;B03000;AMEACA;RUA ALTINA DE AL;60;15351;5/1/2001 19:43:00;CIDADAO COMUM;S;L;MANTIQUEIRA;BH;607039.64;810032.05;161
-163;2001008533;B03000;AMEACA;RUA CARLOS PINTO;230;107220;5/1/2001 20:29:00;CIDADAO COMUM;N;;CH JATOBA IV;BH;600731.30;787610.33;162
-164;2001008539;B06000;LESAO CORPORAL;RUA ARTUR DE CAS;307;125428;5/1/2001 20:33:00;CIDADAO COMUM;N;;BELMONT;BH;615672.42;805539.35;163
-165;2001008620;B04001;HOMICIDIO TENTAD;RUA ITORORO;584;36154;5/1/2001 21:07:00;CIDADAO COMUM;S;AP101;PADRE EUSTAQUIO;BH;607305.95;797432.52;164
-166;2001008687;B04001;HOMICIDIO TENTAD;RUA MIGUEL PINTO;1473;128757;5/1/2001 21:52:00;CIDADAO COMUM;S;FR;NOVA ESPERANCA;BH;609007.48;799307.70;165
-167;2001008711;B03000;AMEACA;AV DO CONTORNO;2107;17228;5/1/2001 22:03:00;CIDADAO COMUM;S;FR;CENTRO (BH);BH;612416.86;797360.21;166
-168;2001008724;B03000;AMEACA;RUA HORTO;60;25973;5/1/2001 22:10:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617020.54;797738.78;167
-169;2001008756;B04001;HOMICIDIO TENTAD;AV ESPLANADA;199;126244;5/1/2001 22:28:00;CIDADAO COMUM;N;;SAO GABRIEL;BH;613212.38;804445.02;168
-170;2001008827;B04001;HOMICIDIO TENTAD;RUA CARLOS ETIEN;13;13356;5/1/2001 23:13:00;CIDADAO COMUM;S;0;SERRA;BH;613992.00;794863.88;169
-171;2001008940;B04001;HOMICIDIO TENTAD;RUA PEDRA CORAL;54;114005;6/1/2001 00:09:00;CIDADAO COMUM;N;0;PIRATININGA;BH;606451.75;808885.02;170
-172;2001008963;B03000;AMEACA;RUA MONTES CLARO;189;46650;6/1/2001 00:21:00;CIDADAO COMUM;S;0;CARMO;BH;611641.54;794467.80;171
-173;2001009004;B04001;HOMICIDIO TENTAD;RUA TEOFILO PIRE;117;67465;6/1/2001 00:48:00;CIDADAO COMUM;S;CSA;BOA VISTA;BH;615282.49;800096.43;172
-174;2001009074;B06000;LESAO CORPORAL;AV AMAZONAS;641;3140;6/1/2001 01:37:00;INICIATIVA;N;0;CENTRO BH;BH;610925.18;797013.32;173
-175;2001009120;B06000;LESAO CORPORAL;PRACA RAUL SOARE;28;58010;6/1/2001 02:07:00;CIDADAO COMUM;N;;LOURDES;BH;610531.41;796704.90;174
-176;2001009139;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;1454;6731;6/1/2001 02:20:00;CIDADAO COMUM;N;PX1454;BARRO PRETO;BH;609927.60;796926.67;175
-177;2001009238;B06000;LESAO CORPORAL;RUA FRANCISCO VE;90;29703;6/1/2001 03:39:00;INICIATIVA;N;0;TUPI;BH;612776.15;806731.54;176
-178;2001009242;B06000;LESAO CORPORAL;RUA PIUM I;1233;54393;6/1/2001 03:42:00;CIDADAO COMUM;N;AP12;SION;BH;611952.65;793761.39;177
-179;2001009326;B06000;LESAO CORPORAL;RUA JOAO DE PAUL;589;63032;6/1/2001 04:46:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;613318.42;799419.50;178
-180;2001009327;B04001;HOMICIDIO TENTAD;RUA JAGUARAO;286;36790;6/1/2001 04:47:00;CIDADAO COMUM;S;CAFU;BONFIM;BH;610034.79;798147.70;179
-181;2001009450;B06000;LESAO CORPORAL;RUA OTAVIANO PEN;545;128454;6/1/2001 07:23:00;CIDADAO COMUM;N;0;SERRA VERDE;BH;609655.77;810567.19;180
-182;2001009557;B06000;LESAO CORPORAL;RUA B;107;47637;6/1/2001 09:00:00;CIDADAO COMUM;N;;VILA CASTANHEIRA;BH;601135.26;788571.24;181
-183;2001009572;B03000;AMEACA;RUA DES BRAULIO;2070;19917;6/1/2001 09:13:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616352.52;797404.60;182
-184;2001009598;B06000;LESAO CORPORAL;RUA RAIMUNDO TIN;163;301229;6/1/2001 09:27:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610693.03;793106.49;183
-185;2001009667;B03000;AMEACA;RUA MARIA VIRGIN;20;24693;6/1/2001 10:29:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617298.30;797352.94;184
-186;2001009674;B06000;LESAO CORPORAL;AV DO CONTORNO;10555;17228;6/1/2001 10:34:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609494.49;797370.90;185
-187;2001009717;B06000;LESAO CORPORAL;RUA JOAQUIM HENR;145;94371;6/1/2001 11:05:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606357.63;801486.70;186
-188;2001009805;B03000;AMEACA;RUA DOS CAETES;515;11376;6/1/2001 12:25:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611105.83;797439.64;187
-189;2001009808;B04001;HOMICIDIO TENTAD;AV ELISIO DE BRI;789;25251;6/1/2001 12:26:00;CIDADAO COMUM;N;LJC;BOA VISTA;BH;615152.32;799844.87;188
-190;2001009814;B03000;AMEACA;RUA ZURICK;1122;74092;6/1/2001 12:30:00;POLICIAL MILITAR;S;0;NOVA SUISSA;BH;606773.32;795411.41;189
-191;2001009817;B03000;AMEACA;RUA HOFFMAN;83;33320;6/1/2001 12:33:00;CIDADAO COMUM;N;;SANTA CRUZ (BARR;BH;603763.82;789406.87;190
-192;2001009868;B03000;AMEACA;RODOVIA MGT 262;298;26598;6/1/2001 13:11:00;CIDADAO COMUM;S;0;VILA BRASILIA;BH;614655.94;803592.58;191
-193;2001009873;B03000;AMEACA;AV SANTA TEREZIN;705;61415;6/1/2001 13:16:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604567.76;802538.51;192
-194;2001009880;B06000;LESAO CORPORAL;RUA BASE;45;23836;6/1/2001 13:24:00;CIDADAO COMUM;S;;CARDOSO;BH;602968.44;788548.82;193
-195;2001009882;B03000;AMEACA;RUA JOSE SANTIAG;240;39152;6/1/2001 13:23:00;CIDADAO COMUM;N;0;PIRAJA;BH;613860.40;803263.57;194
-196;2001009914;B03000;AMEACA;RUA RUBENS FERRE;120;16339;6/1/2001 13:49:00;CIDADAO COMUM;N;;SAO SALVADOR;BH;602807.32;798925.23;195
-197;2001009935;B03000;AMEACA;RUA DEMETRIO RIB;361;19797;6/1/2001 14:02:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615665.70;798276.22;196
-198;2001009954;B06000;LESAO CORPORAL;RUA OSCAR LOBO P;270;104480;6/1/2001 14:23:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612347.11;803516.89;197
-199;2001010004;B03000;AMEACA;RUA DOS TIMBIRAS;2636;67682;6/1/2001 15:16:00;INICIATIVA;N;0;SANTO AGOSTINHO;BH;610194.40;796558.80;198
-200;2001010019;B06000;LESAO CORPORAL;RUA LEO MARENTE;95;94807;6/1/2001 15:22:00;CIDADAO COMUM;N;FU;JARDIM MONTANHES;BH;606344.73;799379.58;199
-201;2001010081;B06000;LESAO CORPORAL;AV SANTOS DUMONT;629;61950;6/1/2001 16:08:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611010.46;797549.36;200
-202;2001010097;B03000;AMEACA;RUA DO SERMAO;55;64990;6/1/2001 16:21:00;CIDADAO COMUM;S;A;SAO JOSE;BH;605696.31;798909.45;201
-203;2001010101;B03000;AMEACA;AV OTACILIO NEGR;640;50566;6/1/2001 16:21:00;INICIATIVA;S;0;JARDIM ATLANTICO;BH;607915.61;804275.70;202
-204;2001010121;B03000;AMEACA;AV PRESIDENTE AN;1880;4461;6/1/2001 16:34:00;INICIATIVA;S;0;SAO CRISTOVAO;BH;610064.06;799761.80;203
-205;2001010140;B03000;AMEACA;RUA EXPEDITO FLA;41;84847;6/1/2001 16:47:00;CIDADAO COMUM;S;0;DA LAGOA;BH;604809.35;809054.13;204
-206;2001010156;B03000;AMEACA;ESTRADA DO CERCA;1657;26428;6/1/2001 17:05:00;CIDADAO COMUM;N;0;JARDIM AMERICA;BH;607402.86;793956.59;205
-207;2001010201;B06000;LESAO CORPORAL;AV DOS ANDRADAS;560;3761;6/1/2001 17:31:00;INICIATIVA;N;0;CENTRO BH;BH;611447.51;797112.93;206
-208;2001010224;B03000;AMEACA;RUA VIANA DO CAS;65;63640;6/1/2001 17:42:00;CIDADAO COMUM;N;0;SAO FRANCISCO;BH;609912.68;802193.15;207
-209;2001010238;B06000;LESAO CORPORAL;RUA DOM PEDRITO;144;51300;6/1/2001 17:53:00;CIDADAO COMUM;N;;NOVA VISTA;BH;614736.17;800536.88;208
-210;2001010239;B06000;LESAO CORPORAL;RUA PERNAMBUCO;835;53463;6/1/2001 17:54:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611560.86;795440.65;209
-211;2001010252;B02000;RIXA;RUA MIOSOTIS;180;45859;6/1/2001 18:04:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;608901.95;798729.73;210
-212;2001010253;B03000;AMEACA;RUA JOVINO RODRI;244;85083;6/1/2001 18:06:00;CIDADAO COMUM;S;FR945;MANTIQUEIRA;BH;606548.35;810771.26;211
-213;2001010268;B03000;AMEACA;RUA MACHADO DE A;53;42214;6/1/2001 18:14:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610245.43;798573.73;212
-214;2001010415;B06000;LESAO CORPORAL;AV CRISTIANO MAC;5550;18652;6/1/2001 19:24:00;INICIATIVA;S;0;DOS PALMARES;BH;612348.26;802981.49;213
-215;2001010433;B06000;LESAO CORPORAL;RUA ITA;18;86593;6/1/2001 19:32:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616400.79;797361.07;214
-216;2001010448;B03000;AMEACA;RUA HEITOR A MON;233;119862;6/1/2001 19:38:00;INICIATIVA;S;;SERRA VERDE;BH;609591.23;811073.16;215
-217;2001010450;B04001;HOMICIDIO TENTAD;RUA CONCHAS;129;80178;6/1/2001 19:40:00;CIDADAO COMUM;N;CAB;COQUEIROS;BH;602679.62;799734.06;216
-218;2001010452;B03000;AMEACA;RUA GENERAL OZOR;930;30901;6/1/2001 19:41:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615902.29;797976.19;217
-219;2001010503;B02000;RIXA;RUA SANHARO;146;82044;6/1/2001 20:08:00;CIDADAO COMUM;S;CA3;SAO GABRIEL;BH;614094.42;804833.97;218
-220;2001010505;B06000;LESAO CORPORAL;AV DO CONTORNO;1822;17228;6/1/2001 20:09:00;CIDADAO COMUM;N;;FLORESTA;BH;612276.36;797514.41;219
-221;2001010543;B06000;LESAO CORPORAL;RUA DENES;11;31150;6/1/2001 20:35:00;CIDADAO COMUM;N;CJ2;CONJ HAB JARDIM ;BH;603875.61;798234.43;220
-222;2001010552;B03000;AMEACA;RUA COPEIA;824;17269;6/1/2001 20:39:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615664.60;799735.84;221
-223;2001010559;B06000;LESAO CORPORAL;RUA ANDIROBA;238;99882;6/1/2001 20:44:00;CIDADAO COMUM;N;;VILA SANTA BRANC;BH;604861.58;810000.41;222
-224;2001010650;B03000;AMEACA;RUA RAMIRO SIQUE;180;128858;6/1/2001 21:22:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617752.43;797349.60;223
-225;2001010723;B04001;HOMICIDIO TENTAD;RUA MOURA COSTA;151;72711;6/1/2001 21:59:00;CIDADAO COMUM;N;;PLANALTO;BH;609379.75;807147.29;224
-226;2001010764;B06000;LESAO CORPORAL;AV GENERAL OLIMP;236;329;6/1/2001 22:17:00;CIDADAO COMUM;N;;ITAPOA;BH;609013.66;806961.90;225
-227;2001010782;B04001;HOMICIDIO TENTAD;RUA EXPEDICIONAR;190;31627;6/1/2001 22:27:00;INICIATIVA;S;0;MARIA GORETTI;BH;614391.02;803230.73;226
-228;2001010789;B06000;LESAO CORPORAL;RUA SANTA CRUZ;42;60481;6/1/2001 22:33:00;CIDADAO COMUM;N;LJ01;VENDA NOVA;BH;608901.14;808750.75;227
-229;2001010804;B04001;HOMICIDIO TENTAD;RUA OHM;160;49153;6/1/2001 22:42:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612219.81;803558.99;228
-230;2001010919;B06000;LESAO CORPORAL;RUA AMANDO COUTO;651;3037;6/1/2001 23:48:00;INICIATIVA;S;0;SAO TOMAZ;BH;609953.26;805413.09;229
-231;2001010920;B04001;HOMICIDIO TENTAD;AV WALDOMIRO LOB;453;66548;6/1/2001 23:49:00;CIDADAO COMUM;S;;GUARANI;BH;612827.54;805381.24;230
-232;2001010951;B03000;AMEACA;PRACA ESMERALDA;2;25932;7/1/2001 00:05:00;CIDADAO COMUM;S;LJ02;PIRAJA;BH;613180.37;803029.37;231
-233;2001010955;B03000;AMEACA;RUA ITAIPU;1149;35439;7/1/2001 00:07:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616346.43;797993.47;232
-234;2001010966;B04001;HOMICIDIO TENTAD;AV CORONEL DURVA;459;17688;7/1/2001 00:13:00;INICIATIVA;N;0;DURVAL DE BARROS;BH;598326.03;790923.98;233
-235;2001010979;B06000;LESAO CORPORAL;RUA PROFESSORA G;709;86335;7/1/2001 00:20:00;INICIATIVA;N;0;FLORAMAR;BH;611863.73;807061.97;234
-236;2001010986;B06000;LESAO CORPORAL;RUA DA BOLIVIA;746;9884;7/1/2001 00:24:00;INICIATIVA;S;0;SION;BH;610943.73;793524.50;235
-237;2001010995;B03000;AMEACA;RUA MANOEL PEDRO;26;81892;7/1/2001 00:27:00;CIDADAO COMUM;S;A;MARIA GORETTI;BH;614266.81;803203.79;236
-238;2001010996;B03000;AMEACA;AV BRIGADEIRO ED;1213;2860;7/1/2001 00:30:00;CIDADAO COMUM;S;;GLORIA;BH;604077.57;798736.59;237
-239;2001011005;B03000;AMEACA;RUA DOS TUPIS;420;69965;7/1/2001 00:37:00;INICIATIVA;N;0;CENTRO BH;BH;610881.32;796955.33;238
-240;2001011056;B06000;LESAO CORPORAL;RUA FAISAO;115;27710;7/1/2001 01:09:00;CIDADAO COMUM;S;0;FLAVIO MARQUES D;BH;604790.92;789116.71;239
-241;2001011071;B03000;AMEACA;RUA LINCOLN;73;41136;7/1/2001 01:19:00;CIDADAO COMUM;S;;UNIAO;BH;612490.76;801290.23;240
-242;2001011080;B03000;AMEACA;RUA CARMELITA PR;1096;17316;7/1/2001 01:28:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;606179.87;794384.52;241
-243;2001011094;B04001;HOMICIDIO TENTAD;RUA GABRO;411;30435;7/1/2001 01:40:00;INICIATIVA;S;0;SANTA TEREZA;BH;612938.43;797259.63;242
-244;2001011190;B04001;HOMICIDIO TENTAD;AV SINFRONIO BRO;1201;66116;7/1/2001 02:50:00;INICIATIVA;N;0;BARREIRO;BH;602184.38;790705.71;243
-245;2001011241;B02000;RIXA;AV PRESIDENTE AN;2201;4461;7/1/2001 03:21:00;INICIATIVA;S;;CACHOEIRINHA;BH;609937.30;800018.63;244
-246;2001011262;B03000;AMEACA;RUA PEDRINOPOLIS;544;52980;7/1/2001 03:34:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605715.33;807080.47;245
-247;2001011272;B04001;HOMICIDIO TENTAD;RUA XAPURI;1145;73815;7/1/2001 03:44:00;INICIATIVA;S;;JARDIM AMERICA;BH;607415.47;793908.72;246
-248;2001011279;B06000;LESAO CORPORAL;RUA VASSOURAS;353;71369;7/1/2001 03:50:00;CIDADAO COMUM;S;0;SENHOR BOM JESUS;BH;609502.59;799678.80;247
-249;2001011291;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;3600;57830;7/1/2001 03:57:00;CIDADAO COMUM;S;0;ESTORIL;BH;609250.36;792265.54;248
-250;2001011318;B06000;LESAO CORPORAL;RUA FORMIGA;50;29136;7/1/2001 04:24:00;CIDADAO COMUM;S;;LAGOINHA;BH;610336.11;798756.88;249
-251;2001011391;B02000;RIXA;RUA SAO LAZARO;1089;63219;7/1/2001 05:42:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612506.27;799625.54;250
-252;2001011432;B04002;HOMICIDIO CONSUM;RUA PLOTINO;154;60541;7/1/2001 06:58:00;CIDADAO COMUM;N;;BELMONT;BH;615334.54;804870.99;251
-253;2001011471;B03000;AMEACA;AV SANTOS DUMONT;680;61950;7/1/2001 07:41:00;INICIATIVA;N;0;CENTRO (BH);BH;610999.13;797614.04;252
-254;2001011484;B06000;LESAO CORPORAL;RUA LADAINHA;80;40118;7/1/2001 07:47:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611966.74;803424.16;253
-255;2001011712;B03000;AMEACA;RUA AMANDA;5;91317;7/1/2001 11:30:00;CIDADAO COMUM;S;;CONJUNTO VISTA A;BH;605786.45;792731.99;254
-256;2001011727;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;1277;17228;7/1/2001 11:37:00;CIDADAO COMUM;N;;FLORESTA;BH;611851.77;797784.50;255
-257;2001011729;B04001;HOMICIDIO TENTAD;RUA VERDEJANTE;36;82085;7/1/2001 11:42:00;CIDADAO COMUM;N;CAFUND;SAO GABRIEL;BH;614028.89;804701.38;256
-258;2001011737;B06000;LESAO CORPORAL;RUA DO LAGO;130;40161;7/1/2001 11:48:00;CIDADAO COMUM;N;0;SAO MARCOS;BH;614043.12;802745.70;257
-259;2001011788;B03000;AMEACA;AV SARAMENHA;1525;64007;7/1/2001 12:30:00;CIDADAO COMUM;S;0;GUARANI;BH;613298.64;805560.73;258
-260;2001011803;B03000;AMEACA;RUA BOAVENTURA;866;9783;7/1/2001 12:45:00;CIDADAO COMUM;S;;VILA INDAIA;BH;609526.29;803265.21;259
-261;2001011816;B08000;VIOLACAO DE DOMI;AV AMAZONAS;2445;3140;7/1/2001 13:02:00;CIDADAO COMUM;S;PX1232;BARRO PRETO;BH;609381.70;796116.30;260
-262;2001011833;B03000;AMEACA;RUA GERALDO FERN;25;99611;7/1/2001 13:16:00;CIDADAO COMUM;S;;TUPI;BH;614138.51;806080.95;261
-263;2001011861;B04002;HOMICIDIO CONSUM;RUA JOAO NEIVA;342;38783;7/1/2001 13:37:00;CIDADAO COMUM;N;;BOA VISTA;BH;616140.07;800029.20;262
-264;2001011885;B06000;LESAO CORPORAL;RUA MUNIZ;5;170850;7/1/2001 13:58:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608082.99;793968.66;263
-265;2001011892;B06000;LESAO CORPORAL;RUA CARLOS NIEME;437;13472;7/1/2001 14:00:00;CIDADAO COMUM;N;0;SAGRADA FAMILIA;BH;613554.65;798857.84;264
-266;2001011907;B03000;AMEACA;RUA BRUNO FERRET;39;86827;7/1/2001 14:08:00;CIDADAO COMUM;N;;JARDIM ESTRELA;BH;607224.25;810342.62;265
-267;2001011954;B06000;LESAO CORPORAL;RUA PROFESSORA V;3;56893;7/1/2001 14:52:00;CIDADAO COMUM;S;CSA;CHACARAS REUNIDA;BH;605513.76;789431.48;266
-268;2001011962;B06000;LESAO CORPORAL;RUA ARANTINA;375;58697;7/1/2001 14:57:00;CIDADAO COMUM;S;;MINASLANDIA;BH;612163.22;804486.82;267
-269;2001012003;B03000;AMEACA;RUA CINQUENTA E ;198;106201;7/1/2001 15:27:00;CIDADAO COMUM;S;;NOVA YORK;BH;608663.41;810949.46;268
-270;2001012119;B06000;LESAO CORPORAL;RUA MARIANA OLIV;132;94573;7/1/2001 16:43:00;CIDADAO COMUM;S;;OURO PRETO;BH;606307.16;800636.59;269
-271;2001012120;B04001;HOMICIDIO TENTAD;RUA GENTIOS;1350;30983;7/1/2001 16:44:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;608905.13;793585.28;270
-272;2001012123;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;175;51657;7/1/2001 16:45:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;271
-273;2001012152;B06000;LESAO CORPORAL;RUA CURIMATA;481;48050;7/1/2001 17:06:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613956.09;804602.01;272
-274;2001012158;B03000;AMEACA;RUA RAMIRO SIQUE;180;128858;7/1/2001 17:09:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617752.43;797349.60;273
-275;2001012171;B03000;AMEACA;RUA ARACI;347;5335;7/1/2001 17:23:00;CIDADAO COMUM;S;;PINDORAMA;BH;602504.13;797676.24;274
-276;2001012176;B03000;AMEACA;RUA ANDARAI;22;3720;7/1/2001 17:24:00;CIDADAO COMUM;N;0;NOVA VISTA;BH;615259.17;800656.50;275
-277;2001012177;B03000;AMEACA;RUA ADOLFO CIOLE;620;20318;7/1/2001 17:24:00;CIDADAO COMUM;N;CA2;CARDOSO;BH;603802.34;787701.58;276
-278;2001346643;B03000;AMEACA;AV MEM DE SA;1224;45395;28/6/2001 00:37:00;POLICIAL MILITAR;S;0;SANTA EFIGENIA;BH;614262.45;796371.32;277
-279;2001346783;B03000;AMEACA;AV ELISIO DE BRI;426;25251;28/6/2001 03:54:00;INICIATIVA;N;0;BOA VISTA;BH;614758.16;799709.43;278
-280;2001347067;B06000;LESAO CORPORAL;RUA PROFESSORA G;707;86335;28/6/2001 09:26:00;CIDADAO COMUM;N;;FLORAMAR;BH;611863.73;807061.97;279
-281;2001347148;B04001;HOMICIDIO TENTAD;RUA MARIA ANTONI;35;103014;28/6/2001 10:29:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;605397.56;789332.51;280
-282;2001347198;B06000;LESAO CORPORAL;RUA LINDOLFO DE ;2148;41164;28/6/2001 11:06:00;INICIATIVA;S;0;SAO DOMINGOS;BH;607826.43;793671.48;281
-283;2001347210;B03000;AMEACA;BECO PEDRA VERDE;200;301698;28/6/2001 11:11:00;CIDADAO COMUM;S;PROX. BAR DA EVA;VILA CAFEZAL;BH;614697.65;795170.79;282
-284;2001347276;B06000;LESAO CORPORAL;ESTRADA BEIRA LI;475;10878;28/6/2001 12:03:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;616523.09;806630.25;283
-285;2001347323;B05000;SEQUESTRO E CARC;AV SILVA LOBO;1350;65889;28/6/2001 12:36:00;CIDADAO COMUM;S;SEQUETRO RELAMPA;NOVA SUISSA;BH;607813.65;795224.49;284
-286;2001347399;B06000;LESAO CORPORAL;RUA SAO PAULO;108;90213;28/6/2001 13:40:00;CIDADAO COMUM;N;FR;SARANDI (URCA/BH;BH;603053.55;802645.18;285
-287;2001347554;B03000;AMEACA;RUA DAS CLARINET;15;9119;28/6/2001 15:40:00;CIDADAO COMUM;S;;CH CALIFORNIA;BH;604022.46;796614.78;286
-288;2001347588;B06000;LESAO CORPORAL;AV DOS ANDRADAS;551;3761;28/6/2001 16:01:00;INICIATIVA;S;0;CENTRO BH;BH;611552.00;797031.24;287
-289;2001347690;B06000;LESAO CORPORAL;RUA JUNO;264;39629;28/6/2001 16:55:00;INICIATIVA;N;0;GLORIA;BH;604390.58;798253.34;288
-290;2001347752;B03000;AMEACA;RUA DOUTOR RIBEI;137;23650;28/6/2001 17:33:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;603479.43;793070.91;289
-291;2001347766;B04001;HOMICIDIO TENTAD;RUA CARLOS QUADR;236;13431;28/6/2001 17:41:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;605994.61;794519.63;290
-292;2001347878;B03000;AMEACA;AV FRANCISCO SA;360;29656;28/6/2001 18:52:00;CIDADAO COMUM;S;0;PRADO;BH;608929.98;796435.96;291
-293;2001347893;B03000;AMEACA;RUA VEREADOR ANT;67;93602;28/6/2001 18:59:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601901.25;786466.11;292
-294;2001347981;B03000;AMEACA;RUA TITO LIVIO;39;67828;28/6/2001 19:44:00;CIDADAO COMUM;S;;PRIMAVERA;BH;604537.21;798547.45;293
-295;2001348004;B06000;LESAO CORPORAL;RUA K;510;41495;28/6/2001 19:59:00;INICIATIVA;S;0;CH CONFISCO (CO);CO;602570.39;802980.95;294
-296;2001348244;B03000;AMEACA;RUA FLOR DE PITA;114;42949;28/6/2001 22:52:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;601585.95;786070.71;295
-297;2001348268;B03000;AMEACA;RUA ITARARE;21;35959;28/6/2001 23:07:00;CIDADAO COMUM;S;;CONCORDIA;BH;610756.05;799121.84;296
-298;2001348297;B06000;LESAO CORPORAL;RUA ARARIBA;539;5540;28/6/2001 23:23:00;CIDADAO COMUM;N;;SAO CRISTOVAO;BH;610505.35;799302.92;297
-299;2001348312;B06000;LESAO CORPORAL;AV PEDREIRA;66;52952;28/6/2001 23:38:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612837.94;804549.46;298
-300;2001348328;B03000;AMEACA;RUA MELODIA;53;301462;28/6/2001 23:49:00;CIDADAO COMUM;N;0;VILA CAFEZAL;BH;614240.36;795425.90;299
-301;2001348355;B04001;HOMICIDIO TENTAD;RUA CARMO DO RIO;100;13687;29/6/2001 00:06:00;INICIATIVA;S;0;PRADO LOPES;BH;609978.15;798887.53;300
-302;2001348374;B03000;AMEACA;RUA DES TEOFILO;46;20015;29/6/2001 00:25:00;CIDADAO COMUM;N;A;PEDRO SEGUNDO;BH;608693.98;798614.04;301
-303;2001348456;B03000;AMEACA;RUA DOS AIMORES;666;1640;29/6/2001 02:19:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611990.60;795940.64;302
-304;2001348463;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;3200;51657;29/6/2001 02:33:00;INICIATIVA;S;0;LETICIA;BH;607060.12;809957.54;303
-305;2001348510;B06000;LESAO CORPORAL;RUA FELIPE DOS S;531;27953;29/6/2001 03:58:00;CIDADAO COMUM;S;0;LOURDES;BH;610274.10;795492.35;304
-306;2001348553;B06000;LESAO CORPORAL;RUA TAIOBEIRAS;518;17168;29/6/2001 05:46:00;CIDADAO COMUM;S;;COQUEIROS;BH;602451.58;799029.95;305
-307;2001348639;B06000;LESAO CORPORAL;RUA MANOEL TAVAR;470;1536;29/6/2001 07:47:00;CIDADAO COMUM;N;0;GOIANIA;BH;614972.82;802744.77;306
-308;2001348673;B03000;AMEACA;RUA JOSE LIMA DE;81;73641;29/6/2001 08:15:00;CIDADAO COMUM;N;;FLORAMAR;BH;611399.18;806761.31;307
-309;2001348784;B03000;AMEACA;RUA DAS CANARIAS;18;64325;29/6/2001 09:23:00;CIDADAO COMUM;S;;JARDIM ATLANTICO;BH;608145.36;805911.71;308
-310;2001348794;B08000;VIOLACAO DE DOMI;RUA PROFESSORA G;654;86335;29/6/2001 09:33:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611900.95;807062.44;309
-311;2001348805;B06000;LESAO CORPORAL;RUA CESAR BERNAR;375;122675;29/6/2001 09:38:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604662.26;808108.81;310
-312;2001348867;B06000;LESAO CORPORAL;RUA SAO JOSE DO ;60;15465;29/6/2001 10:19:00;CIDADAO COMUM;S;;PLANALTO;BH;609807.84;806352.82;311
-313;2001348893;B06000;LESAO CORPORAL;RUA PROFESSORA G;654;86335;29/6/2001 10:33:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611900.95;807062.44;312
-314;2001348909;B03000;AMEACA;RUA SAO SILVESTR;50;116445;29/6/2001 10:43:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616542.19;805927.67;313
-315;2001348985;B03000;AMEACA;RUA ENGENHO DE D;643;25614;29/6/2001 11:39:00;CIDADAO COMUM;S;LJ11;CAICARA;BH;607887.64;799242.48;314
-316;2001349002;B06000;LESAO CORPORAL;AV GETULIO VARGA;1280;81256;29/6/2001 11:51:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611488.28;795119.52;315
-317;2001349018;B03000;AMEACA;RUA WALDEMAR DIA;439;15377;29/6/2001 12:00:00;CIDADAO COMUM;S;;CANDELARIA;BH;608268.08;808962.30;316
-318;2001349023;B03000;AMEACA;RUA MARCAZITA;75;43488;29/6/2001 12:02:00;CIDADAO COMUM;S;CAFU;SAO CRISTOVAO;BH;610039.61;799325.32;317
-319;2001349037;B03000;AMEACA;RUA EXPEDITO RIB;168;41467;29/6/2001 12:14:00;CIDADAO COMUM;S;;VILA SUZANA;BH;611846.11;803060.50;318
-320;2001349150;B06000;LESAO CORPORAL;RUA JOAO GUALBER;150;68414;29/6/2001 13:41:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608949.69;808085.04;319
-321;2001349249;B06000;LESAO CORPORAL;RUA PADRE EUSTAQ;125;51294;29/6/2001 15:03:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;609409.13;797633.34;320
-322;2001349380;B06000;LESAO CORPORAL;RUA JOANA D'ARC;133;37387;29/6/2001 16:27:00;CIDADAO COMUM;S;0;MINASLANDIA;BH;611958.71;804054.10;321
-323;2001349384;B08000;VIOLACAO DE DOMI;RUA DOUTOR RIBEI;414;23650;29/6/2001 16:28:00;CIDADAO COMUM;S;NR CORRETO 422.;DAS INDUSTRIAS;BH;603510.74;792720.82;322
-324;2001349436;B09000;ABANDONO DE INCA;RUA CATANDUVAS;560;14217;29/6/2001 16:49:00;CIDADAO COMUM;N;0;RENASCENCA;BH;610845.32;800521.36;323
-325;2001349513;B06000;LESAO CORPORAL;RUA DOUTOR BENED;423;12252;29/6/2001 17:33:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;612546.01;803738.77;324
-326;2001349599;B03000;AMEACA;RUA PONTA GROSSA;392;14900;29/6/2001 18:22:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604863.70;789804.10;325
-327;2001349728;B06000;LESAO CORPORAL;RUA CAPA PRETA;509;14232;29/6/2001 19:25:00;CIDADAO COMUM;N;;JOAO PINHEIRO;BH;604842.89;795724.14;326
-328;2001349752;B03000;AMEACA;AV STA ROSA;345;61301;29/6/2001 19:41:00;CIDADAO COMUM;N;;SAO LUIZ;BH;608850.97;804571.43;327
-329;2001349784;B03000;AMEACA;RUA MICA;109;45685;29/6/2001 20:02:00;CIDADAO COMUM;S;0;SAO LUCAS;BH;613238.00;796036.84;328
-330;2001349789;B04002;HOMICIDIO CONSUM;RUA AGUAS DE LIN;65;40902;29/6/2001 20:00:00;CIDADAO COMUM;N;;ITAIPU BH;BH;599247.70;788871.68;329
-331;2001349849;B03000;AMEACA;RUA W TRES;10;122621;29/6/2001 20:43:00;CIDADAO COMUM;S;;PONGELUPE;BH;603702.18;787305.62;330
-332;2001349987;B03000;AMEACA;RUA ANTONIO VIEI;436;4925;29/6/2001 22:16:00;CIDADAO COMUM;N;;GLALIJA;BH;603363.05;794230.23;331
-333;2001350071;B06000;LESAO CORPORAL;AV PERIMETRAL;307;78531;29/6/2001 23:08:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601415.66;788841.83;332
-334;2001350156;B04001;HOMICIDIO TENTAD;RUA QUINZE;18;122215;29/6/2001 23:58:00;CIDADAO COMUM;N;0;JARDIM DOS COMER;BH;607720.46;810683.19;333
-335;2001350158;B04001;HOMICIDIO TENTAD;RUA JOAQUIM DE F;140;38033;30/6/2001 00:00:00;CIDADAO COMUM;S;AN2;BARREIRO;BH;602884.71;791123.78;334
-336;2001350190;B06000;LESAO CORPORAL;RUA URSULA PAULI;2338;71066;30/6/2001 00:22:00;CIDADAO COMUM;S;;CH BONSUCESSO;BH;605473.82;791757.57;335
-337;2001350212;B06000;LESAO CORPORAL;AV AMAZONAS;5800;3140;30/6/2001 00:47:00;INICIATIVA;S;0;GAMELEIRA;BH;606262.47;795876.96;336
-338;2001350216;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;30/6/2001 00:50:00;CIDADAO COMUM;S;;TIROL;BH;600947.66;789885.51;337
-339;2001350230;B06000;LESAO CORPORAL;RUA ANTONIO MART;5;4676;30/6/2001 01:01:00;CIDADAO COMUM;S;0;ESTRELA DO ORIEN;BH;605805.26;792166.99;338
-340;2001350332;B03000;AMEACA;RUA MINAS NOVAS;108;45818;30/6/2001 02:36:00;CIDADAO COMUM;S;0;CRUZEIRO;BH;612204.10;794772.00;339
-341;2001350344;B03000;AMEACA;AV CIVILIZACAO;911;51657;30/6/2001 02:51:00;INICIATIVA;S;0;JARDIM FLORENCIA;BH;609133.74;808652.87;340
-342;2001350345;B06000;LESAO CORPORAL;AV SANTOS DUMONT;597;61950;30/6/2001 02:52:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611065.32;797537.18;341
-343;2001350351;B08000;VIOLACAO DE DOMI;AV PRUDENTE DE M;1220;55774;30/6/2001 02:57:00;CIDADAO COMUM;N;0;CORACAO DE JESUS;BH;610007.32;794115.40;342
-344;2001350396;B06000;LESAO CORPORAL;AV ITAU;955;36025;30/6/2001 03:38:00;CIDADAO COMUM;N;0;DOM BOSCO;BH;604558.93;796915.41;343
-345;2001350406;B06000;LESAO CORPORAL;AV AMAZONAS;5800;3140;30/6/2001 03:54:00;INICIATIVA;S;0;GAMELEIRA;BH;606262.47;795876.96;344
-346;2001350523;B06000;LESAO CORPORAL;RUA POLYCARPO DE;600;115137;30/6/2001 07:29:00;CIDADAO COMUM;S;CA02;BANDEIRANTES;BH;604403.57;803709.10;345
-347;2001350570;B06000;LESAO CORPORAL;RUA RADIALISTA A;390;100031;30/6/2001 08:14:00;CIDADAO COMUM;S;;CEU AZUL;BH;604019.52;808819.00;346
-348;2001350625;B03000;AMEACA;AV OLEGARIO MACI;188;49699;30/6/2001 08:53:00;CIDADAO COMUM;S;LJ08;CENTRO (BH);BH;610617.38;797516.23;347
-349;2001350666;B03000;AMEACA;RUA DES BRAULIO;1210;19917;30/6/2001 09:25:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616240.69;797882.85;348
-350;2001350716;B04002;HOMICIDIO CONSUM;RUA GRAUNAS;449;31797;30/6/2001 10:05:00;CIDADAO COMUM;N;CAFU;VILA CEMIG;BH;605631.69;788709.00;349
-351;2001350786;B03000;AMEACA;RUA PINTORA DJAN;60;129255;30/6/2001 10:49:00;CIDADAO COMUM;S;CA01;TUPI;BH;614207.76;806225.28;350
-352;2001350795;B03000;AMEACA;RUA ALUIZIO DAVI;740;9770;30/6/2001 10:55:00;CIDADAO COMUM;S;LJ21;OURO PRETO;BH;606194.96;801103.04;351
-353;2001350799;B03000;AMEACA;RUA ENCOSTA;12;20406;30/6/2001 10:57:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607344.77;807411.00;352
-354;2001350990;B03000;AMEACA;RUA SALITRE;245;60006;30/6/2001 13:38:00;CIDADAO COMUM;S;CAFU;CACHOEIRINHA;BH;611049.66;801460.02;353
-355;2001351032;B03000;AMEACA;RUA SAO LAZARO;1099;63219;30/6/2001 14:11:00;CIDADAO COMUM;S;CAB;SAGRADA FAMILIA;BH;612509.83;799636.46;354
-356;2001351050;B06000;LESAO CORPORAL;RUA VOLTA REDOND;218;73600;30/6/2001 14:22:00;CIDADAO COMUM;S;;CARDOSO;BH;603536.07;787805.19;355
-357;2001351074;B03000;AMEACA;RUA BERNARDO CIS;301;9351;30/6/2001 14:38:00;POLICIAL MILITAR;N;AN1;PARQUE RIACHUELO;BH;609625.53;799953.65;356
-358;2001351147;B03000;AMEACA;RUA URSULA PAULI;2303;71066;30/6/2001 15:27:00;CIDADAO COMUM;S;0;CH BONSUCESSO;BH;605518.68;791726.85;357
-359;2001351158;B03000;AMEACA;BECO LUIZ ALBERT;36;300741;30/6/2001 15:31:00;CIDADAO COMUM;S;;HORTO;BH;613875.22;798204.15;358
-360;2001351160;B08000;VIOLACAO DE DOMI;RUA GASTAO BRAUL;229;103304;30/6/2001 15:32:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605464.66;795301.09;359
-361;2001351197;B03000;AMEACA;AV ALVARO DA SIL;480;2872;30/6/2001 15:47:00;CIDADAO COMUM;N;0;BARREIRO;BH;602448.91;791262.85;360
-362;2001012206;B03000;AMEACA;RUA ESTRELA DA J;138;26705;7/1/2001 17:36:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604749.69;793333.72;361
-363;2001012218;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;322;51657;7/1/2001 17:47:00;CIDADAO COMUM;S;0;VILA SANTO ANTON;BH;609650.08;808286.90;362
-364;2001012223;B06000;LESAO CORPORAL;RUA ITAPETINGA;1341;35804;7/1/2001 17:51:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;609965.84;800605.10;363
-365;2001012232;B03000;AMEACA;RUA JOVINA GOMES;503;70454;7/1/2001 17:55:00;CIDADAO COMUM;S;;LETICIA;BH;607250.11;809471.34;364
-366;2001012264;B06000;LESAO CORPORAL;RUA AUTA DE SOUZ;106;95374;7/1/2001 18:17:00;CIDADAO COMUM;S;;SANTA MARIA;BH;603542.99;795180.27;365
-367;2001012265;B04001;HOMICIDIO TENTAD;RUA BATISTA CARN;190;8419;7/1/2001 18:17:00;CIDADAO COMUM;S;CAFU;SALGADO FILHO;BH;606473.20;794973.26;366
-368;2001012319;B03000;AMEACA;RUA MARTINS ALVE;838;45023;7/1/2001 18:57:00;CIDADAO COMUM;S;;NOVA ESPERANCA;BH;608959.70;799444.10;367
-369;2001012348;B06000;LESAO CORPORAL;RUA OLIVIO RODRI;24;49976;7/1/2001 19:11:00;CIDADAO COMUM;S;CSA;NOVA VISTA;BH;614970.31;800898.62;368
-370;2001012375;B04001;HOMICIDIO TENTAD;AV DA SINFONIA;437;101627;7/1/2001 19:28:00;CIDADAO COMUM;N;0;SANTA AMELIA;BH;607345.20;806795.49;369
-371;2001012423;B06000;LESAO CORPORAL;RUA FRANCISCO VE;27;29703;7/1/2001 19:52:00;CIDADAO COMUM;S;;TUPI;BH;612704.06;806765.25;370
-372;2001012442;B02000;RIXA;RUA SAO PEDRO DA;410;102989;7/1/2001 20:01:00;CIDADAO COMUM;S;0;OLHOS DAGUA;BH;607826.44;788139.72;371
-373;2001012480;B02000;RIXA;RUA DA BAHIA;10;81155;7/1/2001 20:19:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611510.18;797579.14;372
-374;2001012491;B03000;AMEACA;RUA HILO ESTEVAM;21;94721;7/1/2001 20:21:00;CIDADAO COMUM;S;;CASTELO;BH;605600.44;799917.04;373
-375;2001012528;B03000;AMEACA;RUA LUCIA MIGUEL;446;41555;7/1/2001 20:41:00;CIDADAO COMUM;S;0;TUPI;BH;612593.89;806369.45;374
-376;2001012544;B06000;LESAO CORPORAL;RUA SERESTA;14;301463;7/1/2001 20:48:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614046.73;795320.77;375
-377;2001012622;B06000;LESAO CORPORAL;RUA OLIMPIO DA S;45;28045;7/1/2001 21:24:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612550.80;803827.00;376
-378;2001012707;B06000;LESAO CORPORAL;BECO FREI MARIAN;120;300767;7/1/2001 22:10:00;CIDADAO COMUM;S;NR 195 CORRETO;CARLOS PRATES;BH;608761.56;797834.53;377
-379;2001012725;B06000;LESAO CORPORAL;RUA DAS CANOAS;531;12669;7/1/2001 22:19:00;CIDADAO COMUM;S;0;ESTRELA DO ORIEN;BH;605578.92;792635.96;378
-380;2001012737;B04001;HOMICIDIO TENTAD;RUA QUARENTA E O;124;35048;7/1/2001 22:26:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612791.10;806999.98;379
-381;2001012739;B04001;HOMICIDIO TENTAD;RUA PAULO DE FRO;95;52722;7/1/2001 22:24:00;INICIATIVA;S;0;CENTRO (BH);BH;610759.34;797631.71;380
-382;2001012794;B06000;LESAO CORPORAL;RUA DUZENTOS E Q;44;24321;7/1/2001 22:56:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600616.01;787089.50;381
-383;2001012852;B06000;LESAO CORPORAL;RUA CARLOS SA;300;13520;7/1/2001 23:25:00;CIDADAO COMUM;N;0;COPACABANA;BH;606083.57;805652.90;382
-384;2001013025;B08000;VIOLACAO DE DOMI;RUA VILA RICA;843;71992;8/1/2001 01:05:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;606711.67;797747.92;383
-385;2001013035;B06000;LESAO CORPORAL;RUA ANA JOSEFINA;64;85521;8/1/2001 01:12:00;CIDADAO COMUM;N;0;SAO JOAO BATISTA;BH;608128.63;807571.42;384
-386;2001013105;B04001;HOMICIDIO TENTAD;RUA SAUL;65;170891;8/1/2001 02:15:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608165.20;793608.91;385
-387;2001013168;B06000;LESAO CORPORAL;RUA DOS AIMORES;2198;1640;8/1/2001 03:15:00;INICIATIVA;N;0;BARRO PRETO;BH;610507.20;796334.72;386
-388;2001013289;B03000;AMEACA;RUA COQUEIROS;270;17297;8/1/2001 07:00:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610594.69;801052.44;387
-389;2001013379;B03000;AMEACA;RUA SANTAREM;343;61484;8/1/2001 08:09:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605767.46;793810.29;388
-390;2001013420;B06000;LESAO CORPORAL;RUA JOSE ANTENOR;141;97483;8/1/2001 08:38:00;CIDADAO COMUM;S;;HELIOPOLIS;BH;611315.24;805296.94;389
-391;2001013489;B03000;AMEACA;RUA SAO MATIAS;397;63408;8/1/2001 09:22:00;CIDADAO COMUM;S;;SERRANO;BH;603549.73;800736.58;390
-392;2001013529;B06000;LESAO CORPORAL;RUA FLOR DO BAIL;278;28480;8/1/2001 09:50:00;CIDADAO COMUM;S;0;JARDIM MONTANHES;BH;606264.34;799574.20;391
-393;2001013633;B06000;LESAO CORPORAL;RUA DOS CACTOS;568;73119;8/1/2001 11:19:00;CIDADAO COMUM;S;;LINDEIA;BH;599166.10;790634.92;392
-394;2001013700;B03000;AMEACA;RUA IZABEL GLANS;230;99678;8/1/2001 12:11:00;CIDADAO COMUM;S;CAA;INDUSTRIAL RODRI;BH;616223.51;808595.24;393
-395;2001013798;B03000;AMEACA;RUA CARANCHO;22;13079;8/1/2001 13:27:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604506.63;788542.81;394
-396;2001013800;B03000;AMEACA;RUA MATERLANDIA;8;45124;8/1/2001 13:28:00;CIDADAO COMUM;S;;SANTA INES;BH;613935.57;801097.60;395
-397;2001013969;B03000;AMEACA;RUA BARAO DE AIU;662;7835;8/1/2001 15:22:00;CIDADAO COMUM;S;;ALTO DOS PINHEIR;BH;604250.87;796242.09;396
-398;2001013977;B03000;AMEACA;AV OLEGARIO MACI;208;49699;8/1/2001 15:24:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610610.60;797496.18;397
-399;2001013982;B04001;HOMICIDIO TENTAD;AV AMERICO VESPU;40;3355;8/1/2001 15:25:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609791.15;800757.25;398
-400;2001014145;B06000;LESAO CORPORAL;ESTRADA BEIRA LI;31;10878;8/1/2001 16:57:00;CIDADAO COMUM;N;REF:CASA DE RACO;SAO GABRIEL;BH;616119.62;806734.88;399
-401;2001014146;B03000;AMEACA;RUA FRANCISCO AS;275;15641;8/1/2001 16:59:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604904.12;791193.78;400
-402;2001014291;B06000;LESAO CORPORAL;RUA GUAICURUS;436;32009;8/1/2001 18:24:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611227.45;797639.92;401
-403;2001014298;B03000;AMEACA;RUA SAO PAULO;672;63464;8/1/2001 18:26:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610954.65;797132.32;402
-404;2001014342;B03000;AMEACA;RUA PRIMEIRO DE ;135;55226;8/1/2001 18:51:00;CIDADAO COMUM;S;;APARECIDA;BH;609171.85;799995.94;403
-405;2001014358;B06000;LESAO CORPORAL;RUA ROSANGELA;198;59328;8/1/2001 18:55:00;CIDADAO COMUM;S;;DA LAGOA;BH;604499.11;809027.11;404
-406;2001014446;B04001;HOMICIDIO TENTAD;RUA TURQUESA;483;70035;8/1/2001 19:42:00;INICIATIVA;N;0;PRADO;BH;608600.91;796259.29;405
-407;2001014458;B04001;HOMICIDIO TENTAD;BECO PAI JOAQUIM;25;171056;8/1/2001 19:42:00;CIDADAO COMUM;N;0;CABANA;BH;604389.54;794182.77;406
-408;2001014463;B03000;AMEACA;RUA GURUPA;148;32557;8/1/2001 19:55:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610305.58;801088.40;407
-409;2001014497;B03000;AMEACA;AV ERICO VERISSI;159;41671;8/1/2001 20:12:00;CIDADAO COMUM;S;0;SAO JOAO BATISTA;BH;608449.99;808287.11;408
-410;2001014511;B03000;AMEACA;RUA FURQUIM;421;30117;8/1/2001 20:17:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615033.05;797748.03;409
-411;2001014537;B03000;AMEACA;AV BALEARES;545;89333;8/1/2001 20:33:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;608404.44;810117.51;410
-412;2001014556;B03000;AMEACA;RUA ALCIDES PERE;195;107711;8/1/2001 20:43:00;CIDADAO COMUM;S;FR;MANTIQUEIRA;BH;606787.92;811935.52;411
-413;2001014687;B06000;LESAO CORPORAL;RUA CAICARA;225;11451;8/1/2001 22:03:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615072.13;799252.45;412
-414;2001014734;B04001;HOMICIDIO TENTAD;RUA CINQUENTA E ;11;33925;8/1/2001 22:43:00;INICIATIVA;N;0;FELICIDADE;BH;612673.36;806807.75;413
-415;2001014739;B06000;LESAO CORPORAL;RUA DOUTOR CRIST;185;55598;8/1/2001 22:46:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;604650.82;789126.07;414
-416;2001014742;B03000;AMEACA;RUA JOSE ALVES D;250;38424;8/1/2001 22:50:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610799.19;805124.67;415
-417;2001014820;B06000;LESAO CORPORAL;RUA DOS VICENTIN;130;63159;8/1/2001 23:44:00;CIDADAO COMUM;S;;PLANALTO;BH;610713.35;805437.73;416
-418;2001014838;B06000;LESAO CORPORAL;RUA MARINHO EVAN;30;124960;8/1/2001 23:55:00;CIDADAO COMUM;S;FR;PETROPOLIS;BH;601216.32;786613.61;417
-419;2001014860;B03000;AMEACA;AV SOCIAIS;60;12959;9/1/2001 00:08:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;615537.12;803931.69;418
-420;2001014949;B03000;AMEACA;RUA DOM PEDRITO;464;51300;9/1/2001 01:34:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614816.51;800793.30;419
-421;2001015067;B03000;AMEACA;RUA PADRE FEIJO;982;51326;9/1/2001 04:10:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615870.08;797655.07;420
-422;2001015076;B03000;AMEACA;PRACA SAO GERALD;39;62027;9/1/2001 04:58:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;615306.86;799493.53;421
-423;2001015093;B06000;LESAO CORPORAL;AV CRISTIANO MAC;5554;18652;9/1/2001 06:24:00;INICIATIVA;S;0;DOS PALMARES;BH;612348.26;802981.49;422
-424;2001015203;B03000;AMEACA;RUA ITAMARACA;25;35542;9/1/2001 08:10:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611172.87;798780.05;423
-425;2001015286;B03000;AMEACA;RUA FLOR DE ABRI;10;28464;9/1/2001 09:17:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;605903.22;799072.14;424
-426;2001015401;B03000;AMEACA;RUA NOVA LIMA;20;74799;9/1/2001 11:02:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616617.92;804643.10;425
-427;2001015416;B03000;AMEACA;AV DO CONTORNO;2300;17228;9/1/2001 11:10:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;612513.76;797078.00;426
-428;2001015417;B03000;AMEACA;RUA CARAVELAS;811;13141;9/1/2001 11:10:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615714.70;797598.16;427
-429;2001015439;B03000;AMEACA;RUA DA BAHIA;1148;81155;9/1/2001 11:34:00;INICIATIVA;S;AP1611;LOURDES;BH;611230.12;796512.50;428
-430;2001015440;B06000;LESAO CORPORAL;RUA SAO JOAO BAT;310;62824;9/1/2001 11:33:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605534.57;808136.46;429
-431;2001015458;B04001;HOMICIDIO TENTAD;RUA GLEUCY JOSE ;95;128860;9/1/2001 11:47:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617303.66;796895.30;430
-432;2001015585;B03000;AMEACA;AV WALDOMIRO LOB;992;66548;9/1/2001 13:42:00;CIDADAO COMUM;N;0;GUARANI;BH;612224.50;805424.28;431
-433;2001015629;B03000;AMEACA;AV CRISTOVAO COL;161;18738;9/1/2001 14:22:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611455.89;794979.69;432
-434;2001015652;B03000;AMEACA;RUA JANUARIO BOR;451;89709;9/1/2001 14:36:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;617420.91;804492.75;433
-435;2001015745;B03000;AMEACA;RUA JUNDIAI;97;39616;9/1/2001 15:33:00;CIDADAO COMUM;S;;CONCORDIA;BH;610808.71;799153.94;434
-436;2001015969;B06000;LESAO CORPORAL;AV ARTUR BERNARD;1461;60844;9/1/2001 17:46:00;CIDADAO COMUM;S;;VILA PARIS;BH;610407.20;793259.63;435
-437;2001016078;B03000;AMEACA;AV DOM PEDRO II;1020;53145;9/1/2001 18:52:00;CIDADAO COMUM;N;;BONFIM;BH;609572.19;797764.43;436
-438;2001016093;B03000;AMEACA;RUA SUDAO;82;116606;9/1/2001 18:59:00;CIDADAO COMUM;S;;CANAA;BH;610209.28;810853.60;437
-439;2001016133;B06000;LESAO CORPORAL;RUA DO ACRE;12;877;9/1/2001 19:24:00;INICIATIVA;N;0;CENTRO (BH);BH;610703.72;797641.10;438
-440;2001016156;B03000;AMEACA;RUA FLOR DE MAIO;77;300399;9/1/2001 19:36:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614327.62;794723.12;439
-441;2001016248;B06000;LESAO CORPORAL;AV PARANAIBA;285;52256;9/1/2001 20:25:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609720.07;799824.06;440
-442;2001016331;B03000;AMEACA;AV CRISTIANO MAC;848;18652;9/1/2001 21:07:00;INICIATIVA;S;0;DA GRACA;BH;612306.88;799435.98;441
-443;2001016336;B05000;SEQUESTRO E CARC;AV SANTOS DUMONT;381;61950;9/1/2001 21:10:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611250.50;797490.44;442
-444;2001016350;B03000;AMEACA;RUA ALINE;658;2352;9/1/2001 21:14:00;CIDADAO COMUM;S;;COQUEIROS;BH;602349.52;798353.27;443
-445;2001016355;B08000;VIOLACAO DE DOMI;RUA THAIS;10;67594;9/1/2001 21:17:00;CIDADAO COMUM;S;;GLORIA;BH;604077.88;798711.92;444
-446;2001016432;B06000;LESAO CORPORAL;RUA ENGENHEIRO Z;35;17937;9/1/2001 21:57:00;CIDADAO COMUM;N;0;SANTO ANTONIO;BH;610239.72;793815.04;445
-447;2001016441;B03000;AMEACA;RUA CORREAS;651;87091;9/1/2001 22:03:00;CIDADAO COMUM;N;;BELVEDERE;BH;611978.72;792341.14;446
-448;2001016509;B06000;LESAO CORPORAL;AV SILVA LOBO;295;65889;9/1/2001 22:45:00;CIDADAO COMUM;S;;CALAFATE;BH;607634.19;796415.21;447
-449;2001016512;B06000;LESAO CORPORAL;RUA DOS CAETES;435;11376;9/1/2001 22:47:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611180.00;797412.98;448
-450;2001016520;B06000;LESAO CORPORAL;RUA INGLATERRA;1744;34552;9/1/2001 22:51:00;CIDADAO COMUM;S;;COPACABANA;BH;606211.83;806736.77;449
-451;2001016526;B03000;AMEACA;RUA SALGUEIRO;255;3226;9/1/2001 22:51:00;CIDADAO COMUM;S;0;IPIRANGA;BH;611974.61;800595.47;450
-452;2001016622;B06000;LESAO CORPORAL;RUA SAO GERALDO;190;170283;9/1/2001 23:39:00;CIDADAO COMUM;N;0;CABANA;BH;604753.11;793990.28;451
-453;2001016634;B03000;AMEACA;RUA W QUATRO;190;122634;9/1/2001 23:48:00;CIDADAO COMUM;S;202;PONGELUPE;BH;604134.92;787374.21;452
-454;2001016673;B04001;HOMICIDIO TENTAD;RUA DOUTOR CRIST;312;55598;10/1/2001 00:12:00;CIDADAO COMUM;S;0;CRISTO REDENTOR;BH;604751.25;789297.85;453
-455;2001016795;B04001;HOMICIDIO TENTAD;RUA BRAS;300;170835;10/1/2001 01:55:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608242.10;793878.82;454
-456;2001016842;B03000;AMEACA;RUA JOSE ROMANO;142;15796;10/1/2001 02:45:00;CIDADAO COMUM;N;CA01;SAO JOSE;BH;605207.68;798783.98;455
-457;2001016856;B03000;AMEACA;RUA GUAICURUS;633;32009;10/1/2001 02:55:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611041.29;797644.01;456
-458;2001016910;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;170;57830;10/1/2001 04:36:00;INICIATIVA;S;0;CIDADE JARDIM;BH;609584.57;795355.36;457
-459;2001016946;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;506;31400;10/1/2001 05:41:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610773.41;796842.64;458
-460;2001016959;B04002;HOMICIDIO CONSUM;RUA AGGEO PIO;10;89711;10/1/2001 06:19:00;CIDADAO COMUM;N;0;PALMEIRAS;BH;606647.20;790442.61;459
-461;2001016963;B03000;AMEACA;RUA PADRE PEDRO ;2227;51657;10/1/2001 06:27:00;INICIATIVA;N;0;CANDELARIA;BH;607904.37;809480.72;460
-462;2001016996;B03000;AMEACA;RUA SENA MADUREI;596;64671;10/1/2001 07:19:00;CIDADAO COMUM;S;;OURO PRETO;BH;605824.18;802464.45;461
-463;2001017102;B06000;LESAO CORPORAL;RUA MARIA GERTRU;290;98993;10/1/2001 08:30:00;INICIATIVA;N;0;CEU AZUL;BH;604701.02;808439.25;462
-464;2001017334;B03000;AMEACA;RUA BONAPARTE;122;10083;10/1/2001 11:40:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607575.01;797505.56;463
-465;2001017348;B06000;LESAO CORPORAL;RUA REAL GRANDEZ;264;58089;10/1/2001 11:53:00;CIDADAO COMUM;S;AP302;PATROCINIO;BH;603316.69;798928.15;464
-466;2001017450;B03000;AMEACA;RUA DAVIDSON PIM;247;124189;10/1/2001 13:01:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607292.47;811797.42;465
-467;2001017798;B04002;HOMICIDIO CONSUM;RUA ALICE;40;170949;10/1/2001 17:02:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;607996.88;793885.89;466
-468;2001017995;B06000;LESAO CORPORAL;AV PRESIDENTE AN;7920;4461;10/1/2001 18:34:00;CIDADAO COMUM;S;;SAO LUIZ;BH;608635.14;804693.17;467
-469;2001018012;B03000;AMEACA;RUA ITAJUBA;580;35495;10/1/2001 18:42:00;CIDADAO COMUM;S;0;FLORESTA;BH;612088.81;797996.25;468
-470;2001018298;B03000;AMEACA;RUA CARVALHOS;219;13788;10/1/2001 21:14:00;CIDADAO COMUM;S;0;MANGABEIRAS;BH;612116.96;792573.56;469
-471;2001018321;B06000;LESAO CORPORAL;RUA FRANCISCO JO;545;118223;10/1/2001 21:26:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599752.96;789472.97;470
-472;2001018328;B06000;LESAO CORPORAL;RUA OMAR GOMES D;16;24259;10/1/2001 21:29:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600890.73;787146.97;471
-473;2001018400;B03000;AMEACA;RUA LEOPOLDO GOM;1663;40770;10/1/2001 22:08:00;INICIATIVA;N;0;VERA CRUZ;BH;616032.33;798192.27;472
-474;2001018405;B03000;AMEACA;RUA OCARA;80;49065;10/1/2001 22:10:00;CIDADAO COMUM;S;0;VILA MARAVILHAS;BH;603299.78;795546.30;473
-475;2001018407;B06000;LESAO CORPORAL;RUA VOLTS;40;73626;10/1/2001 22:10:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612172.58;803421.57;474
-476;2001018430;B03000;AMEACA;RUA CIRILO GASPA;326;63348;10/1/2001 22:22:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608684.85;800162.78;475
-477;2001018441;B04001;HOMICIDIO TENTAD;RUA TUCUMAN;50;69823;10/1/2001 22:26:00;CIDADAO COMUM;S;;SAO GERALDO;BH;614856.59;799413.07;476
-478;2001018450;B06000;LESAO CORPORAL;RUA ZILAH RODRIG;48;74008;10/1/2001 22:31:00;CIDADAO COMUM;N;A;NOVA BARROCA;BH;607546.31;792666.26;477
-479;2001018473;B03000;AMEACA;RUA NOVA REPUBLI;212;130110;10/1/2001 22:51:00;CIDADAO COMUM;S;;CEU AZUL;BH;603826.50;807802.31;478
-480;2001018533;B03000;AMEACA;RUA CONSELHEIRO ;14;17095;10/1/2001 23:18:00;CIDADAO COMUM;S;CS2;CENTRO (BH);BH;612530.47;797030.47;479
-481;2001018563;B08000;VIOLACAO DE DOMI;RUA FERNAO DIAS;73;28133;10/1/2001 23:36:00;CIDADAO COMUM;S;0;CASA BRANCA;BH;615967.41;798817.35;480
-482;2001018571;B04001;HOMICIDIO TENTAD;RUA CURRAL DEL R;201;19122;10/1/2001 23:39:00;CIDADAO COMUM;S;;CABANA;BH;604797.75;793784.12;481
-483;2001018601;B04002;HOMICIDIO CONSUM;RUA FREI LUIZ DE;215;29961;10/1/2001 23:56:00;CIDADAO COMUM;N;;JOAO PINHEIRO;BH;604640.64;796058.63;482
-484;2001018615;B03000;AMEACA;RUA NAVAJOS;190;47334;11/1/2001 00:02:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;607290.06;807088.32;483
-485;2001018627;B03000;AMEACA;RUA CHAFARIZ;81;300275;11/1/2001 00:12:00;CIDADAO COMUM;S;;HAVAI;BH;607397.53;793768.20;484
-486;2001018652;B04001;HOMICIDIO TENTAD;RUA DONA CARMEM;512;22820;11/1/2001 00:28:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603873.41;802278.24;485
-487;2001018751;B03000;AMEACA;RUA PADRE PEDRO ;2555;51657;11/1/2001 01:31:00;CIDADAO COMUM;N;0;JARDIM EUROPA;BH;607741.76;809685.90;486
-488;2001018774;B04001;HOMICIDIO TENTAD;AV ESPLANADA;63;126244;11/1/2001 01:57:00;CIDADAO COMUM;N;;SAO GABRIEL;BH;613213.55;804435.56;487
-489;2001018891;B06000;LESAO CORPORAL;RUA VINTE E DOIS;86;118702;11/1/2001 04:29:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604192.72;807622.62;488
-490;2001018929;B06000;LESAO CORPORAL;AV BIAS FORTES;1603;9553;11/1/2001 05:51:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;610264.01;797012.81;489
-491;2001018990;B06000;LESAO CORPORAL;RUA VENANCIO COR;133;70643;11/1/2001 07:21:00;CIDADAO COMUM;S;A;BARREIRO;BH;602024.26;791119.07;490
-492;2001019006;B03000;AMEACA;RUA PADRE ROLIM;850;51672;11/1/2001 07:40:00;CIDADAO COMUM;S;PX163;SANTA EFIGENIA;BH;612095.64;796347.69;491
-493;2001019049;B03000;AMEACA;RUA OITO;35;117287;11/1/2001 08:23:00;CIDADAO COMUM;N;;LINDEIA;BH;600021.70;790389.81;492
-494;2001019201;B03000;AMEACA;RUA LINCOLN;202;41136;11/1/2001 10:19:00;CIDADAO COMUM;N;;UNIAO;BH;612570.90;801367.78;493
-495;2001019205;B03000;AMEACA;RUA ARCABOUCO;40;5700;11/1/2001 10:20:00;CIDADAO COMUM;S;;PINDORAMA;BH;602278.45;797808.57;494
-496;2001019225;B03000;AMEACA;RUA COLONITA;3;16326;11/1/2001 10:31:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604791.25;802270.96;495
-497;2001019301;B03000;AMEACA;RUA HOFFMAN;863;33320;11/1/2001 11:20:00;CIDADAO COMUM;S;;SANTA CRUZ (BARR;BH;603059.63;788930.45;496
-498;2001019318;B03000;AMEACA;RUA WILSON TAVAR;960;118958;11/1/2001 11:33:00;CIDADAO COMUM;S;;TEIXEIRA DIAS;BH;602967.07;789432.38;497
-499;2001019379;B04001;HOMICIDIO TENTAD;RUA ESTACIO RODR;157;26194;11/1/2001 12:11:00;INICIATIVA;N;0;NOVA BARROCA;BH;607870.76;792669.98;498
-500;2001019390;B03000;AMEACA;RUA LUIZ LOPES;82;94431;11/1/2001 12:18:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606237.42;801258.18;499
-501;2001019419;B06000;LESAO CORPORAL;RUA DOS TAMOIOS;350;66825;11/1/2001 12:41:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611013.54;797064.26;500
-502;2001019469;B03000;AMEACA;RUA IPANEMA;22;34726;11/1/2001 13:15:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603482.92;802695.57;501
-503;2001019492;B03000;AMEACA;RUA EXPEDICIONAR;781;31627;11/1/2001 13:42:00;CIDADAO COMUM;N;;MARIA GORETTI;BH;614437.73;803006.94;502
-504;2001019537;B03000;AMEACA;AV AUGUSTO DE LI;1549;6731;11/1/2001 14:22:00;INICIATIVA;N;0;BARRO PRETO;BH;609833.79;796889.71;503
-505;2001019618;B03000;AMEACA;AV AGENOR DE PAU;285;86250;11/1/2001 15:32:00;CIDADAO COMUM;N;;JAQUELINE;BH;611475.70;810215.54;504
-506;2001019619;B03000;AMEACA;RUA DONA LUCI;26;86004;11/1/2001 15:31:00;CIDADAO COMUM;N;BL10    CS70;ESTRELA DALVA;BH;607207.00;791913.46;505
-507;2001019633;B04001;HOMICIDIO TENTAD;RUA POVOA DE VAR;437;54958;11/1/2001 15:40:00;CIDADAO COMUM;N;;PAQUETA;BH;605302.03;802656.56;506
-508;2001019673;B06000;LESAO CORPORAL;RUA GALENA;137;30491;11/1/2001 16:04:00;CIDADAO COMUM;S;;LAGOINHA;BH;610984.03;798720.81;507
-509;2001019682;B03000;AMEACA;RUA IBERTIOGA;256;33809;11/1/2001 16:14:00;CIDADAO COMUM;N;0;SAO JOAO BATISTA;BH;611151.93;801287.85;508
-510;2001019692;B03000;AMEACA;RUA FILOMENA GAS;450;62083;11/1/2001 16:19:00;CIDADAO COMUM;N;0;APARECIDA SETIMA;BH;608686.14;800564.39;509
-511;2001019760;B04001;HOMICIDIO TENTAD;AV SILVIANO BRAN;1970;66002;11/1/2001 16:52:00;CIDADAO COMUM;N;LJD;HORTO;BH;613169.88;797967.87;510
-512;2001019824;B06000;LESAO CORPORAL;AV AFONSO PENA;1212;1259;11/1/2001 17:25:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611387.08;796661.11;511
-513;2001019828;B03000;AMEACA;RUA APRIGIO RIBE;209;36403;11/1/2001 17:28:00;INICIATIVA;S;0;DOM JOAQUIM;BH;613772.67;801498.72;512
-514;2001019901;B03000;AMEACA;RUA CONDE DE LIN;315;16657;11/1/2001 18:08:00;CIDADAO COMUM;S;;CIDADE JARDIM;BH;610022.64;795071.12;513
-515;2001019913;B03000;AMEACA;RUA QUARENTA E D;90;106964;11/1/2001 18:18:00;CIDADAO COMUM;S;CAFRENT;NOVA CINTRA;BH;605544.50;793587.13;514
-516;2001019922;B03000;AMEACA;RUA REIS DE ABRE;227;63363;11/1/2001 18:21:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608511.82;800590.42;515
-517;2001019950;B03000;AMEACA;RUA DOS TIMBIRAS;1986;67682;11/1/2001 18:37:00;CIDADAO COMUM;S;PX1986;LOURDES;BH;610826.13;796391.34;516
-518;2001019990;B08000;VIOLACAO DE DOMI;RUA CONSELHEIRO ;1715;17095;11/1/2001 18:59:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;613260.28;797299.09;517
-519;2001020007;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;2674;67682;11/1/2001 19:05:00;CIDADAO COMUM;N;;SANTO AGOSTINHO;BH;610160.88;796568.65;518
-520;2001020011;B04002;HOMICIDIO CONSUM;RUA BANDONION;322;170139;11/1/2001 19:09:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614122.39;794785.34;519
-521;2001020022;B06000;LESAO CORPORAL;RUA LARANJEIRAS;285;40423;11/1/2001 19:14:00;CIDADAO COMUM;S;;LEBLON;BH;605674.28;809817.52;520
-522;2001020083;B06000;LESAO CORPORAL;RUA UM;460;27979;11/1/2001 19:47:00;CIDADAO COMUM;S;;CAPITAO EDUARDO;BH;618652.15;807023.45;521
-523;2001020163;B03000;AMEACA;RUA JOSE CARLOS ;137;19601;11/1/2001 20:24:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;603937.17;793007.50;522
-524;2001020249;B03000;AMEACA;RUA B;331;99463;11/1/2001 21:18:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615177.80;808389.59;523
-525;2001020261;B03000;AMEACA;RUA SERRINHA;19;129201;11/1/2001 21:24:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;600519.25;786719.95;524
-526;2001020469;B06000;LESAO CORPORAL;RUA DAS TABOADAS;15;300190;11/1/2001 23:20:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608784.28;807980.25;525
-527;2001020505;B03000;AMEACA;RUA JABOTICABAL;1453;36517;11/1/2001 23:37:00;CIDADAO COMUM;N;;JARDIM AMERICA;BH;607241.48;793984.92;526
-528;2001020518;B06000;LESAO CORPORAL;RUA RUBENS DE SO;680;63060;11/1/2001 23:44:00;CIDADAO COMUM;S;;AARAO REIS;BH;612429.10;804993.67;527
-529;2001020611;B04002;HOMICIDIO CONSUM;RUA FREI ANTONIO;108;29845;12/1/2001 00:44:00;CIDADAO COMUM;N;AP202;NOVA CACHOEIRINH;BH;609550.05;801171.08;528
-530;2001020630;B04001;HOMICIDIO TENTAD;ALAMEDA INTERLIG;10;90270;12/1/2001 00:59:00;CIDADAO COMUM;N;0;SERRA VERDE;BH;609772.02;810394.22;529
-531;2001020637;B06000;LESAO CORPORAL;RUA ENCANTADO;299;25453;12/1/2001 01:06:00;CIDADAO COMUM;N;;CAICARA;BH;607616.04;799442.79;530
-532;2001020647;B04002;HOMICIDIO CONSUM;RUA SOCRATES;30;85953;12/1/2001 01:16:00;CIDADAO COMUM;N;;DOM SILVERIO;BH;615325.98;804426.93;531
-533;2001020688;B03000;AMEACA;AV SINFRONIO BRO;1210;66116;12/1/2001 01:45:00;CIDADAO COMUM;S;;BARREIRO;BH;602205.97;790748.09;532
-534;2001020758;B06000;LESAO CORPORAL;AV BRASIL;256;10420;12/1/2001 02:53:00;CIDADAO COMUM;N;PX246;SANTA EFIGENIA;BH;612788.88;796553.11;533
-535;2001020765;B06000;LESAO CORPORAL;AV FRANCISCO SAL;898;29669;12/1/2001 03:01:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612234.65;796788.78;534
-536;2001020968;B03000;AMEACA;RUA MENOTTI MUCC;216;45468;12/1/2001 08:14:00;CIDADAO COMUM;S;;VILA OESTE;BH;603917.44;794443.61;535
-537;2001021032;B03000;AMEACA;RUA SAUDE;79;64164;12/1/2001 08:53:00;CIDADAO COMUM;S;AP102 B;PADRE EUSTAQUIO;BH;605543.58;797680.50;536
-538;2001021065;B06000;LESAO CORPORAL;RUA ALBATROZ;433;1753;12/1/2001 09:06:00;CIDADAO COMUM;N;BL4     CS107;VILA CLORIS;BH;610454.04;807552.45;537
-539;2001021099;B03000;AMEACA;RUA ALFENAS;455;2208;12/1/2001 09:25:00;CIDADAO COMUM;S;AP207;CRUZEIRO;BH;612352.66;794210.94;538
-540;2001021112;B06000;LESAO CORPORAL;RUA DELMO RENAUL;54;70596;12/1/2001 09:36:00;CIDADAO COMUM;N;CASA 2;AARAO REIS;BH;612861.79;804917.93;539
-541;2001021135;B08000;VIOLACAO DE DOMI;RUA PROFESSORA V;3;56893;12/1/2001 09:45:00;CIDADAO COMUM;N;**13**;CHACARAS REUNIDA;BH;605513.76;789431.48;540
-542;2001021145;B03000;AMEACA;RUA NICIAS CONTI;80;56115;12/1/2001 09:56:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605599.41;795256.93;541
-543;2001021193;B08000;VIOLACAO DE DOMI;RUA IBIZA;27;85257;12/1/2001 10:38:00;CIDADAO COMUM;S;;JARDIM EUROPA;BH;608390.06;809789.59;542
-544;2001021300;B03000;AMEACA;RUA GAMA;82;30536;12/1/2001 12:10:00;CIDADAO COMUM;S;;BONFIM;BH;610070.14;798082.23;543
-545;2001021343;B03000;AMEACA;AV DOUTOR CRISTI;50;62459;12/1/2001 12:32:00;CIDADAO COMUM;N;0;VILA CLORIS;BH;609728.30;807891.34;544
-546;2001021380;B06000;LESAO CORPORAL;RUA CORONEL COST;275;10809;12/1/2001 13:01:00;CIDADAO COMUM;S;0;PLANALTO;BH;610783.13;806561.04;545
-547;2001021382;B03000;AMEACA;RUA CAMELIA;80;11842;12/1/2001 12:58:00;CIDADAO COMUM;S;;BANDEIRANTES DO ;BH;606332.11;793590.42;546
-548;2001021454;B03000;AMEACA;RUA SACADURA CAB;18;59807;12/1/2001 13:49:00;CIDADAO COMUM;S;;VILA OESTE;BH;604480.03;795002.18;547
-549;2001021499;B03000;AMEACA;RUA VITORIA;294;73480;12/1/2001 14:21:00;CIDADAO COMUM;S;0;NOVA CACHOEIRINH;BH;609645.56;801127.17;548
-550;2001021699;B06000;LESAO CORPORAL;RUA TREMEDAL;76;68240;12/1/2001 16:35:00;CIDADAO COMUM;N;0;CARLOS PRATES;BH;609427.34;797783.99;549
-551;2001021709;B03000;AMEACA;RUA JUIZ DE FORA;1381;39455;12/1/2001 16:43:00;INICIATIVA;N;0;BARRO PRETO;BH;609377.30;795937.94;550
-552;2001021758;B04001;HOMICIDIO TENTAD;RUA LUPERCIO PAI;358;57335;12/1/2001 17:11:00;CIDADAO COMUM;N;;TIROL;BH;599905.68;788964.16;551
-553;2001021814;B06000;LESAO CORPORAL;RUA FLOR D'AGUA;375;28565;12/1/2001 17:41:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;605701.81;799712.75;552
-554;2001021873;B06000;LESAO CORPORAL;RUA FELIPE DOS S;531;27953;12/1/2001 18:19:00;POLICIAL MILITAR;S;0;LOURDES;BH;610274.10;795492.35;553
-555;2001021878;B04001;HOMICIDIO TENTAD;RUA VALERIO;108;71268;12/1/2001 18:20:00;CIDADAO COMUM;S;C;PIRAJA;BH;613129.62;803028.68;554
-556;2001021881;B03000;AMEACA;RUA ESTADOS UNID;361;26239;12/1/2001 18:20:00;POLICIAL MILITAR;S;0;COPACABANA;BH;606126.26;806325.42;555
-557;2001021906;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;5387;18652;12/1/2001 18:39:00;CIDADAO COMUM;N;;DOS PALMARES;BH;612255.52;802177.46;556
-558;2001021970;B03000;AMEACA;RUA MONTE SIAO;576;46559;12/1/2001 19:10:00;CIDADAO COMUM;S;;SERRA;BH;613413.20;795071.16;557
-559;2001022011;B03000;AMEACA;RUA MONTES CLARO;348;46650;12/1/2001 19:30:00;CIDADAO COMUM;S;AP803;CARMO;BH;611781.30;794373.73;558
-560;2001022094;B06000;LESAO CORPORAL;RUA SERRINHA;40;129201;12/1/2001 20:15:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;600457.30;786999.51;559
-561;2001022109;B03000;AMEACA;RUA DES TINOCO;577;20028;12/1/2001 20:21:00;CIDADAO COMUM;S;;MONSENHOR MESSIA;BH;606789.83;798133.46;560
-562;2001022128;B03000;AMEACA;RUA SACADURA CAB;413;59807;12/1/2001 20:31:00;CIDADAO COMUM;S;;VILA OESTE;BH;604119.86;795095.14;561
-563;2001022135;B06000;LESAO CORPORAL;AV DO CONTORNO;1368;17228;12/1/2001 20:35:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611964.60;797777.29;562
-564;2001022152;B06000;LESAO CORPORAL;RUA MORUNGABA;402;85981;12/1/2001 20:45:00;CIDADAO COMUM;S;0;MARILANDIA (IB);IB;599619.85;788524.08;563
-565;2001022176;B06000;LESAO CORPORAL;AV SANTOS DUMONT;305;61950;12/1/2001 20:59:00;CIDADAO COMUM;S;PX305;CENTRO (BH);BH;611328.73;797470.25;564
-566;2001022189;B06000;LESAO CORPORAL;RUA PROFESSOR ME;289;77920;12/1/2001 21:02:00;CIDADAO COMUM;S;;MANGABEIRAS;BH;612132.44;792715.35;565
-567;2001022190;B06000;LESAO CORPORAL;RUA SAO JOAO DA ;380;62900;12/1/2001 21:02:00;CIDADAO COMUM;S;;SANTA BRANCA;BH;608313.33;806933.86;566
-568;2001022233;B06000;LESAO CORPORAL;RUA MIGUEL GOMES;354;70757;12/1/2001 21:25:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606993.39;812216.05;567
-569;2001022245;B06000;LESAO CORPORAL;AV SILVA LOBO;620;65889;12/1/2001 21:33:00;CIDADAO COMUM;N;0;CALAFATE;BH;607644.28;796106.65;568
-570;2001022298;B04001;HOMICIDIO TENTAD;RUA DOS COMANCHE;25;16367;12/1/2001 22:02:00;INICIATIVA;S;0;ITAMARATI;BH;607092.27;806826.66;569
-571;2001022305;B04001;HOMICIDIO TENTAD;AV COLETORA;1064;78241;12/1/2001 22:07:00;CIDADAO COMUM;S;;VILA PINHO;BH;602444.19;787672.15;570
-572;2001022335;B03000;AMEACA;RUA CORNELIO CER;23;17417;12/1/2001 22:19:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606440.81;797810.81;571
-573;2001022393;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;12/1/2001 22:52:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;572
-574;2001022466;B04001;HOMICIDIO TENTAD;RUA PADRE CAFE;1215;51253;12/1/2001 23:35:00;INICIATIVA;S;0;VERA CRUZ;BH;616153.74;797899.31;573
-575;2001022624;B03000;AMEACA;RUA SOARES NOGUE;161;66220;13/1/2001 01:08:00;CIDADAO COMUM;N;AP2;VILA MAGNESITA;BH;602235.99;794935.65;574
-576;2001022733;B06000;LESAO CORPORAL;RUA POUSO ALEGRE;2522;54932;13/1/2001 02:19:00;CIDADAO COMUM;N;BLC APTO201;FLORESTA;BH;613435.30;798084.21;575
-577;2001022750;B05000;SEQUESTRO E CARC;RUA JOSE BARSAND;190;88734;13/1/2001 02:25:00;POLICIAL MILITAR;S;SL301;DOS PALMARES;BH;612127.41;802150.37;576
-578;2001022797;B02000;RIXA;AV RAJA GABAGLIA;2985;57830;13/1/2001 03:02:00;CIDADAO COMUM;N;0;ESTORIL;BH;609208.29;792438.19;577
-579;2001022800;B02000;RIXA;RUA JOAO SAMAHA;271;7397;13/1/2001 03:06:00;CIDADAO COMUM;S;0;SANTA BRANCA;BH;608625.93;807245.10;578
-580;2001022809;B06000;LESAO CORPORAL;RUA DESENGANO;42;19860;13/1/2001 03:12:00;CIDADAO COMUM;S;CSFRE;MANGABEIRAS;BH;612203.19;792486.25;579
-581;2001022884;B06000;LESAO CORPORAL;RUA ABRAHAO JOAO;191;80859;13/1/2001 04:05:00;CIDADAO COMUM;N;;PARQUE SAO JOSE;BH;606953.95;792329.56;580
-582;2001022924;B03000;AMEACA;RUA GONCALVES DE;304;31582;13/1/2001 04:39:00;CIDADAO COMUM;S;;CAMARGOS;BH;602331.85;794593.77;581
-583;2001022931;B04001;HOMICIDIO TENTAD;RUA DOS CAETES;435;11376;13/1/2001 04:44:00;INICIATIVA;N;0;CENTRO BH;BH;611180.00;797412.98;582
-584;2001022940;B04001;HOMICIDIO TENTAD;RUA FERNAO DIAS;1855;28133;13/1/2001 04:51:00;INICIATIVA;S;0;JONAS VEIGA;BH;616249.53;797464.28;583
-585;2001023136;B06000;LESAO CORPORAL;RUA DOS GUARANIS;301;32181;13/1/2001 08:34:00;INICIATIVA;S;0;CENTRO (BH);BH;610722.99;797339.12;584
-586;2001023150;B06000;LESAO CORPORAL;RUA CARLINDO COS;83;97294;13/1/2001 08:45:00;CIDADAO COMUM;S;0;EYMARD;BH;613742.58;803685.81;585
-587;2001023177;B06000;LESAO CORPORAL;RUA EUFRATES;9;26821;13/1/2001 09:06:00;CIDADAO COMUM;S;CAFU;COQUEIROS;BH;603406.63;799967.72;586
-588;2001023319;B03000;AMEACA;RUA CARAVELAS;155;13141;13/1/2001 11:09:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;615531.31;798475.90;587
-589;2001023341;B03000;AMEACA;AV SOCIAIS;80;12959;13/1/2001 11:21:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;615537.12;803931.69;588
-590;2001023347;B03000;AMEACA;RUA RIACHUELO;501;58527;13/1/2001 11:24:00;CIDADAO COMUM;N;BLA     AP102;CARLOS PRATES;BH;608088.93;797566.54;589
-591;2001023411;B06000;LESAO CORPORAL;RUA ARGEMIRO BAE;80;93022;13/1/2001 12:27:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601241.15;785911.18;590
-592;2001023455;B03000;AMEACA;RUA ALGA MARINHA;883;66623;13/1/2001 12:54:00;CIDADAO COMUM;S;CAFU;FLORAMAR;BH;610844.23;807388.97;591
-593;2001023505;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;13/1/2001 13:39:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;592
-594;2001023540;B06000;LESAO CORPORAL;RUA GURUPA;130;32557;13/1/2001 14:05:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610294.19;801115.97;593
-595;2001023568;B03000;AMEACA;RUA GENOVEVA DE ;571;30970;13/1/2001 14:20:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612420.80;798614.04;594
-596;2001023670;B03000;AMEACA;RUA AVELEDA;72;6987;13/1/2001 15:17:00;CIDADAO COMUM;S;;PINDORAMA;BH;602756.68;797541.67;595
-597;2001023695;B03000;AMEACA;RUA JOSE PEDRO D;454;78560;13/1/2001 15:28:00;POLICIAL MILITAR;N;0;VILA SANTA RITA;BH;601506.24;787345.07;596
-598;2001023732;B06000;LESAO CORPORAL;RUA OLIVIO RODRI;13;49976;13/1/2001 15:55:00;POLICIAL MILITAR;N;0;NOVA VISTA;BH;615133.79;800903.01;597
-599;2001023788;B03000;AMEACA;RUA VINTE E OITO;35;72967;13/1/2001 16:33:00;CIDADAO COMUM;S;0;ALTO DOS PINHEIR;BH;603829.39;795965.50;598
-600;2001023807;B06000;LESAO CORPORAL;RUA DAS DRACENAS;600;33461;13/1/2001 16:47:00;INICIATIVA;S;0;LINDEIA;BH;598761.19;790775.84;599
-601;2001023819;B03000;AMEACA;AV NOSSA SENHORA;693;47996;13/1/2001 16:53:00;CIDADAO COMUM;N;0;CARMO;BH;611528.60;794103.66;600
-602;2001023843;B06000;LESAO CORPORAL;RUA MARIA ANALIA;32;300366;13/1/2001 17:05:00;CIDADAO COMUM;N;0;POMPEIA;BH;606878.92;808915.74;601
-603;2001023897;B06000;LESAO CORPORAL;AV WARLEY APAREC;150;78529;13/1/2001 17:36:00;CIDADAO COMUM;S;0;VILA COLUMBIARA;BH;603986.17;788979.48;602
-604;2001023907;B06000;LESAO CORPORAL;BECO DO INDIO;42;301593;13/1/2001 17:44:00;CIDADAO COMUM;N;;CAFEZAL;BH;614068.93;794877.88;603
-605;2001023949;B03000;AMEACA;RUA RADIALISTA D;298;99334;13/1/2001 18:06:00;CIDADAO COMUM;S;;CEU AZUL;BH;605040.80;807668.88;604
-606;2001023955;B04001;HOMICIDIO TENTAD;RUA FRANCISCO MA;465;89447;13/1/2001 18:10:00;CIDADAO COMUM;N;;CH JATOBA IV;BH;600305.09;787628.76;605
-607;2001024066;B06000;LESAO CORPORAL;RUA BADARO JUNIO;27;7532;13/1/2001 19:06:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612043.50;803566.82;606
-608;2001024138;B04002;HOMICIDIO CONSUM;BECO SAO JOAO DE;150;171084;13/1/2001 19:54:00;CIDADAO COMUM;N;0;CABANA;BH;604617.23;793823.45;607
-609;2001024150;B04001;HOMICIDIO TENTAD;AV NOSSA SENHORA;1030;47996;13/1/2001 19:58:00;CIDADAO COMUM;S;0;SAO PEDRO;BH;611365.27;793876.27;608
-610;2001024222;B03000;AMEACA;RUA BARAUNAS;63;80124;13/1/2001 20:30:00;CIDADAO COMUM;S;0;VILA INDAIA;BH;609882.06;802973.44;609
-611;2001024243;B03000;AMEACA;RUA CARLOS PEIXO;186;13485;13/1/2001 20:37:00;CIDADAO COMUM;N;AP201;SAO LUCAS;BH;613570.29;796453.95;610
-612;2001024248;B06000;LESAO CORPORAL;RUA PONTA GROSSA;895;14900;13/1/2001 20:42:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604801.53;790245.22;611
-613;2001024306;B03000;AMEACA;RUA GREGORIO DE ;175;31885;13/1/2001 21:01:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613997.42;796252.13;612
-614;2001024307;B03000;AMEACA;RUA GABRO;423;30435;13/1/2001 21:01:00;INICIATIVA;S;0;SANTA TEREZA;BH;612938.43;797259.63;613
-615;2001024312;B06000;LESAO CORPORAL;RUA SERRINHA;26;129201;13/1/2001 21:01:00;CIDADAO COMUM;N;0;INDEPENDENCIA;BH;600458.57;786991.65;614
-616;2001024322;B02000;RIXA;RUA DELEGADO PAU;180;90469;13/1/2001 21:07:00;CIDADAO COMUM;N;0;SAO MARCOS;BH;614606.28;802323.69;615
-617;2001024348;B03000;AMEACA;AV PRESIDENTE TA;696;35366;13/1/2001 21:18:00;CIDADAO COMUM;S;CAA;JARDIM MONTANHES;BH;605568.94;799837.94;616
-618;2001024356;B03000;AMEACA;AV DO CONTORNO;10888;17228;13/1/2001 21:22:00;INICIATIVA;S;0;BARRO PRETO;BH;610124.53;797278.95;617
-619;2001024374;B03000;AMEACA;RUA OTAVIO OTONI;49;50626;13/1/2001 21:31:00;CIDADAO COMUM;S;AP201;UNIAO;BH;613006.36;800792.50;618
-620;2001024381;B04001;HOMICIDIO TENTAD;RUA DAS PETUNIAS;110;11870;13/1/2001 21:35:00;CIDADAO COMUM;S;;LINDEIA;BH;599571.37;791092.66;619
-621;2001024384;B03000;AMEACA;RUA NOVA ESPERAN;19;83898;13/1/2001 21:37:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604441.83;807900.54;620
-622;2001024479;B03000;AMEACA;RUA M;81;37812;13/1/2001 22:18:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609087.53;810096.51;621
-623;2001024482;B03000;AMEACA;BECO PARAISO;12;302036;13/1/2001 22:18:00;INICIATIVA;N;0;PALMEIRAS;BH;606213.48;790637.47;622
-624;2001024488;B04002;HOMICIDIO CONSUM;RUA CRISTALIA;47;70899;13/1/2001 22:21:00;CIDADAO COMUM;N;0;PROVIDENCIA;BH;612455.05;804419.38;623
-625;2001024563;B06000;LESAO CORPORAL;AV MEM DE SA;207;45395;13/1/2001 23:02:00;INICIATIVA;N;0;PARAISO;BH;614125.51;797081.42;624
-626;2001024572;B03000;AMEACA;RUA VIRGILIO;70;73150;13/1/2001 23:06:00;CIDADAO COMUM;S;CAFR;PATROCINIO;BH;603914.84;799134.72;625
-627;2001024630;B03000;AMEACA;AV CRISTIANO MAC;880;18652;13/1/2001 23:41:00;CIDADAO COMUM;S;0;DA GRACA;BH;612307.14;799463.41;626
-628;2001024676;B09000;ABANDONO DE INCA;RUA CONCEICAO TE;180;22921;14/1/2001 00:04:00;CIDADAO COMUM;S;;NAZARE;BH;615576.95;804459.95;627
-629;2001024698;B04001;HOMICIDIO TENTAD;AV FRANCISCO SA;830;29656;14/1/2001 00:14:00;CIDADAO COMUM;N;0;PRADO;BH;608886.90;796021.80;628
-630;2001024708;B04001;HOMICIDIO TENTAD;RUA SAO JOSE DE ;689;63120;14/1/2001 00:19:00;CIDADAO COMUM;S;CSA;BOA VISTA;BH;616023.69;800139.76;629
-631;2001024734;B09000;ABANDONO DE INCA;RUA HENRIQUE BAD;117;86020;14/1/2001 00:33:00;CIDADAO COMUM;S;0;ESTRELA DALVA;BH;607188.76;792453.56;630
-632;2001024767;B03000;AMEACA;RUA JOSE PEDRO D;319;78560;14/1/2001 01:03:00;CIDADAO COMUM;N;;VILA SANTA RITA;BH;601528.97;787235.11;631
-633;2001024785;B03000;AMEACA;PRACA RAUL SOARE;259;58010;14/1/2001 01:12:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610365.17;796828.93;632
-634;2001024808;B03000;AMEACA;RUA BOLIVAR FERR;217;89995;14/1/2001 01:26:00;CIDADAO COMUM;N;0;PALMEIRAS;BH;607417.17;791603.80;633
-635;2001024829;B03000;AMEACA;RUA PADRE LEOPOL;658;14185;14/1/2001 01:36:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604726.86;795773.34;634
-636;2001024858;B02000;RIXA;RUA OPALA;12;50263;14/1/2001 01:48:00;CIDADAO COMUM;N;BAR NIKAS BAR NO;CRUZEIRO;BH;612338.91;794504.06;635
-637;2001024860;B06000;LESAO CORPORAL;RUA MAJOR DELFIN;2798;42620;14/1/2001 01:48:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;608833.07;801262.09;636
-638;2001024964;B06000;LESAO CORPORAL;RUA DAS CANOAS;336;12669;14/1/2001 03:02:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605685.71;792606.93;637
-639;2001025010;B03000;AMEACA;RUA DOS COMANCHE;709;16367;14/1/2001 03:32:00;CIDADAO COMUM;S;;ITAMARATI;BH;606559.95;807215.50;638
-640;2001025024;B06000;LESAO CORPORAL;AV ELISIO DE BRI;5;25251;14/1/2001 03:41:00;CIDADAO COMUM;N;0;BOA VISTA;BH;614339.09;799657.38;639
-641;2001025040;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;1315;57830;14/1/2001 03:50:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;609086.55;794205.08;640
-642;2001025118;B03000;AMEACA;RUA BERNARDO GUI;1313;9364;14/1/2001 05:03:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;611312.78;795943.41;641
-643;2001025165;B06000;LESAO CORPORAL;RUA ALCIDES PERE;306;107711;14/1/2001 05:52:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606823.28;811840.98;642
-644;2001025288;B03000;AMEACA;RUA DAS CARMELIT;34;121401;14/1/2001 08:29:00;INICIATIVA;N;0;PLANALTO;BH;610545.05;805542.73;643
-645;2001025312;B02000;RIXA;RUA CINCO;180;302813;14/1/2001 08:57:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614547.56;805977.33;644
-646;2001025318;B03000;AMEACA;RUA CONSELHEIRO ;2379;17095;14/1/2001 09:03:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613824.99;797328.11;645
-647;2001025431;B06000;LESAO CORPORAL;RUA CLAUDINOR ME;52;113610;14/1/2001 10:44:00;CIDADAO COMUM;S;FU;MINASCAIXA;BH;609563.18;809229.69;646
-648;2001025477;B03000;AMEACA;RUA JAQUES ROBER;345;36992;14/1/2001 11:30:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614136.47;802428.12;647
-649;2001025479;B04001;HOMICIDIO TENTAD;AV JOSE BONIFACI;306;38579;14/1/2001 11:33:00;INICIATIVA;N;0;PRADO LOPES;BH;610119.54;799105.82;648
-650;2001025546;B06000;LESAO CORPORAL;RUA CAIO VIANA M;604;11477;14/1/2001 12:40:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604706.23;789321.47;649
-651;2001025586;B03000;AMEACA;RUA CANANEIA;729;12400;14/1/2001 13:06:00;CIDADAO COMUM;S;0;ADELAIDE;BH;607461.12;798380.05;650
-652;2001025600;B03000;AMEACA;RUA ABATI;157;574;14/1/2001 13:12:00;CIDADAO COMUM;S;;SANTA MARIA;BH;603141.19;795508.74;651
-653;2001025607;B03000;AMEACA;AV MEM DE SA;1624;45395;14/1/2001 13:18:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;614287.39;796014.50;652
-654;2001025663;B04001;HOMICIDIO TENTAD;RUA JOSE SABINO ;310;98911;14/1/2001 14:03:00;CIDADAO COMUM;S;0;LAGOA;BH;604678.65;809376.42;653
-655;2001025686;B03000;AMEACA;RUA CRACOVIA;240;85317;14/1/2001 14:24:00;CIDADAO COMUM;S;0;JARDIM EUROPA;BH;608352.36;810508.56;654
-656;2001025687;B03000;AMEACA;AV UM;730;110679;14/1/2001 14:25:00;INICIATIVA;N;0;JARDIM GUANABARA;BH;611764.80;807968.67;655
-657;2001025705;B05000;SEQUESTRO E CARC;RUA DA BAHIA;507;81155;14/1/2001 14:39:00;CIDADAO COMUM;N;AN8;CENTRO (BH);BH;611425.43;797129.06;656
-658;2001025741;B03000;AMEACA;RUA MARIA DE LOU;112;50540;14/1/2001 15:03:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;604565.35;792282.09;657
-659;2001025765;B06000;LESAO CORPORAL;RUA SOCRATES ALV;146;95144;14/1/2001 15:15:00;CIDADAO COMUM;N;0;VIRGINIA;BH;603128.23;794618.01;658
-660;2001025783;B06000;LESAO CORPORAL;ALAMEDA EZEQUIEL;225;27446;14/1/2001 15:28:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611899.54;796686.86;659
-661;2001025788;B06000;LESAO CORPORAL;RUA JUATUBA;42;39367;14/1/2001 15:30:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;605262.83;793420.62;660
-662;2001025805;B03000;AMEACA;RUA JOSE MARIA B;549;38380;14/1/2001 15:37:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607631.11;807779.33;661
-663;2001025826;B06000;LESAO CORPORAL;RUA FLOR DO BESO;252;28492;14/1/2001 15:55:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;605981.94;799070.49;662
-664;2001025867;B03000;AMEACA;RUA LUPERCIO PAI;206;57335;14/1/2001 16:14:00;CIDADAO COMUM;S;;TIROL;BH;599910.51;788988.30;663
-665;2001025948;B03000;AMEACA;RUA CARMO DA CAC;54;13659;14/1/2001 16:59:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606116.87;794269.97;664
-666;2001025963;B06000;LESAO CORPORAL;RUA EUCLASIO;275;26787;14/1/2001 17:07:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613747.64;796622.12;665
-667;2001025964;B06000;LESAO CORPORAL;RUA CINQUENTA;165;302845;14/1/2001 17:07:00;CIDADAO COMUM;S;;TUPI;BH;614216.87;805557.43;666
-668;2001025991;B03000;AMEACA;RUA 4;63;19352;14/1/2001 17:20:00;CIDADAO COMUM;N;;PAULO SEXTO;BH;616421.68;807028.64;667
-669;2001026009;B03000;AMEACA;AV SEN LEVINDO C;4005;14866;14/1/2001 17:28:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;601311.25;786581.21;668
-670;2001026010;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;88;17067;14/1/2001 17:32:00;CIDADAO COMUM;N;;SANTO ANDRE;BH;609523.31;798729.48;669
-671;2001026051;B03000;AMEACA;RUA MARTE;128;44916;14/1/2001 17:47:00;CIDADAO COMUM;S;;SANTA LUCIA;BH;610133.28;791493.83;670
-672;2001026100;B03000;AMEACA;RUA FORMOSA;195;29149;14/1/2001 18:10:00;CIDADAO COMUM;S;;HORTO;BH;613302.97;797777.02;671
-673;2001026113;B03000;AMEACA;RUA JACINTO OLAU;186;36690;14/1/2001 18:15:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610317.15;802037.66;672
-674;2001026152;B09000;ABANDONO DE INCA;RUA PAPOULA;36;31844;14/1/2001 18:38:00;CIDADAO COMUM;S;;REGINA;BH;598758.69;790411.48;673
-675;2001026224;B03000;AMEACA;RUA PAULO DE FRO;95;52722;14/1/2001 19:14:00;INICIATIVA;N;0;CENTRO (BH);BH;610759.34;797631.71;674
-676;2001026226;B03000;AMEACA;BECO DAS MARIAS;39;301279;14/1/2001 19:15:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610478.54;793616.03;675
-677;2001026247;B03000;AMEACA;RUA DUZENTOS E Q;22;24321;14/1/2001 19:26:00;CIDADAO COMUM;N;0;CH VALE DO JATOB;BH;600599.26;787072.73;676
-678;2001026254;B04001;HOMICIDIO TENTAD;RUA SAO VICENTE;86;88126;14/1/2001 19:28:00;CIDADAO COMUM;S;;GRANJA FREITAS;BH;617022.85;798456.93;677
-679;2001026321;B06000;LESAO CORPORAL;RUA SAO JOAO DE ;166;110073;14/1/2001 19:58:00;CIDADAO COMUM;S;;PILAR;BH;607626.60;788623.46;678
-680;2001026324;B06000;LESAO CORPORAL;PRACA CORACAO EU;170;27865;14/1/2001 19:59:00;CIDADAO COMUM;N;AP203;CORACAO EUCARIST;BH;605810.66;796462.32;679
-681;2001026348;B03000;AMEACA;RUA DOUTOR ALIPI;564;2365;14/1/2001 20:09:00;CIDADAO COMUM;N;;CAFEZAL;BH;613838.04;794600.97;680
-682;2001026360;B06000;LESAO CORPORAL;RUA VINTE E OITO;50;33231;14/1/2001 20:12:00;CIDADAO COMUM;S;LJ1;CONJUNTO FELICID;BH;612370.27;807127.34;681
-683;2001026361;B06000;LESAO CORPORAL;RUA JOSE AUGUSTO;113;126257;14/1/2001 20:12:00;CIDADAO COMUM;S;REF:PADARIA ALIN;SAO GABRIEL;BH;613394.90;804456.58;682
-684;2001026416;B04001;HOMICIDIO TENTAD;AV DOM PEDRO II;356;53145;14/1/2001 20:48:00;CIDADAO COMUM;N;0;BONFIM;BH;610241.25;797885.18;683
-685;2001026434;B03000;AMEACA;RUA DESEMBARGADO;601;19986;14/1/2001 20:49:00;CIDADAO COMUM;S;0;SERRA;BH;613943.78;794925.46;684
-686;2001026446;B04001;HOMICIDIO TENTAD;RUA ARACITABA;30;127032;14/1/2001 20:58:00;CIDADAO COMUM;S;;MINASLANDIA;BH;611804.35;804462.96;685
-687;2001026452;B06000;LESAO CORPORAL;RUA FURTADO DE M;292;30158;14/1/2001 21:00:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609763.86;805611.19;686
-688;2001026471;B06000;LESAO CORPORAL;RUA ABELARDO CHA;175;118208;14/1/2001 21:06:00;CIDADAO COMUM;N;;CH TUNEL DE IBIR;BH;599752.96;789832.81;687
-689;2001026514;B06000;LESAO CORPORAL;AV BIAS FORTES;1660;9553;14/1/2001 21:30:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610287.90;797080.46;688
-690;2001026532;B06000;LESAO CORPORAL;AV PRESIDENTE AN;8281;4461;14/1/2001 21:43:00;CIDADAO COMUM;S;;SAO LUIZ;BH;608284.86;804912.96;689
-691;2001026561;B06000;LESAO CORPORAL;RUA LUNDS FERREI;426;41920;14/1/2001 21:53:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;615413.68;800845.00;690
-692;2001026573;B04001;HOMICIDIO TENTAD;RUA DOS CACTOS;283;73119;14/1/2001 21:58:00;CIDADAO COMUM;S;REF:FINAL DO 111;LINDEIA;BH;598989.23;790846.45;691
-693;2001026594;B04001;HOMICIDIO TENTAD;RUA PONTA PORA;170;54601;14/1/2001 22:09:00;CIDADAO COMUM;S;CAA;SANTA EFIGENIA;BH;613187.23;796919.20;692
-694;2001026600;B06000;LESAO CORPORAL;RUA DOUTOR RIBEI;274;23650;14/1/2001 22:10:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;603471.00;792938.94;693
-695;2001026669;B06000;LESAO CORPORAL;RUA MARICA;285;82072;14/1/2001 22:50:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613896.03;804943.57;694
-696;2001026777;B06000;LESAO CORPORAL;RUA CARMO DA CAC;10;13659;14/1/2001 23:41:00;CIDADAO COMUM;N;FU;SALGADO FILHO;BH;606146.59;794290.29;695
-697;2001026793;B04002;HOMICIDIO CONSUM;RUA DOIS;46;109530;14/1/2001 23:47:00;CIDADAO COMUM;N;0;BONSUCESSO;BH;605286.24;790363.21;696
-698;2001026822;B03000;AMEACA;RUA CASTRO ALVES;454;14103;15/1/2001 00:00:00;INICIATIVA;S;;COPACABANA;BH;606016.58;806527.82;697
-699;2001026862;B06000;LESAO CORPORAL;RUA MARIA ROSA D;102;107800;15/1/2001 00:20:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606001.06;811254.93;698
-700;2001026911;B03000;AMEACA;RUA URSULA PAULI;125;71066;15/1/2001 00:56:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606633.82;793659.59;699
-701;2001026952;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;2330;67682;15/1/2001 01:24:00;INICIATIVA;N;0;LOURDES;BH;610463.01;796492.25;700
-702;2001026955;B04002;HOMICIDIO CONSUM;RUA CORONEL ANTO;355;17590;15/1/2001 01:26:00;CIDADAO COMUM;N;FU;JARDIM LEBLON;BH;605978.18;807516.94;701
-703;2001026974;B04001;HOMICIDIO TENTAD;RUA ITAIPU;700;35439;15/1/2001 01:39:00;INICIATIVA;N;0;VERA CRUZ;BH;616224.80;798437.20;702
-704;2001027080;B06000;LESAO CORPORAL;AV ERICO VERISSI;561;41671;15/1/2001 02:55:00;CIDADAO COMUM;N;0;CANDELARIA;BH;608128.88;808577.02;703
-705;2001027123;B03000;AMEACA;AV PRESIDENTE AN;828;4461;15/1/2001 03:46:00;CIDADAO COMUM;S;;LAGOINHA;BH;610489.09;798788.67;704
-706;2001027124;B03000;AMEACA;RUA DOS TUPINAMB;379;69940;15/1/2001 03:47:00;CIDADAO COMUM;S;APA;CENTRO (BH);BH;611197.53;797270.63;705
-707;2001027153;B04001;HOMICIDIO TENTAD;RUA DEZESSEIS;99;32821;15/1/2001 04:44:00;INICIATIVA;S;0;FELICIDADE;BH;612155.90;807182.11;706
-708;2001027224;B03000;AMEACA;RUA JORNALISTA W;505;70381;15/1/2001 07:02:00;CIDADAO COMUM;S;LJA;ITAPOA;BH;609750.72;805961.76;707
-709;2001027290;B03000;AMEACA;RUA LUISIANIA;294;81789;15/1/2001 07:59:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599010.84;789210.41;708
-710;2001027535;B03000;AMEACA;RUA JOAO CAETANO;832;37510;15/1/2001 11:11:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;606577.50;795368.27;709
-711;2001027586;B03000;AMEACA;RUA RAMIRO SIQUE;10;128858;15/1/2001 11:53:00;CIDADAO COMUM;N;0;CASTANHEIRAS (TA;BH;617650.40;797388.81;710
-712;2001027634;B03000;AMEACA;AV NOSSA SENHORA;2777;48107;15/1/2001 12:29:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;609303.34;797427.37;711
-713;2001027649;B03000;AMEACA;RUA FREI CONCEIC;735;29873;15/1/2001 12:46:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604480.03;796335.08;712
-714;2001027671;B03000;AMEACA;RUA BRODOSQUI;264;37160;15/1/2001 12:59:00;CIDADAO COMUM;S;CAA;PIRATININGA;BH;606033.72;809532.74;713
-715;2001027791;B06000;LESAO CORPORAL;RUA MOACIR JOSE ;132;50121;15/1/2001 15:01:00;CIDADAO COMUM;N;;MINASCAIXA;BH;609283.97;809358.15;714
-716;2001027793;B06000;LESAO CORPORAL;RUA RORE CARVALH;181;83567;15/1/2001 15:02:00;CIDADAO COMUM;S;CAFU;LINDEIA;BH;599095.79;791253.82;715
-717;2001027813;B03000;AMEACA;RUA HELIO COSTA;46;32948;15/1/2001 15:07:00;CIDADAO COMUM;S;;PIRAJA;BH;613809.20;802945.76;716
-718;2001027828;B03000;AMEACA;RUA INFANTIL;15;80660;15/1/2001 15:15:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604612.96;797108.92;717
-719;2001027978;B03000;AMEACA;RUA JOAO ALEXAND;879;71384;15/1/2001 16:57:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604478.18;790259.98;718
-720;2001028028;B03000;AMEACA;RUA ITOBI DO OES;100;36139;15/1/2001 17:20:00;CIDADAO COMUM;S;CA2;IPANEMA;BH;605021.06;797922.52;719
-721;2001028144;B08000;VIOLACAO DE DOMI;RUA MODESTINA DE;29;56878;15/1/2001 18:33:00;CIDADAO COMUM;N;0;VISTA ALEGRE;BH;604513.40;793406.58;720
-722;2001028242;B03000;AMEACA;ALAMEDA DAS LATH;1000;84572;15/1/2001 19:17:00;CIDADAO COMUM;N;AP101;SAO LUIZ;BH;608746.76;804097.55;721
-723;2001028284;B06000;LESAO CORPORAL;RUA PAULO TIMOTE;131;41918;15/1/2001 19:42:00;CIDADAO COMUM;N;LJ1;VILA HUMAITA;BH;610309.93;801564.82;722
-724;2001028289;B03000;AMEACA;RUA SAO GERALDO;353;170283;15/1/2001 19:45:00;CIDADAO COMUM;S;;CABANA;BH;604778.44;793924.70;723
-725;2001028291;B03000;AMEACA;RUA BOTUCATU;796;10285;15/1/2001 19:46:00;CIDADAO COMUM;S;;RENASCENCA;BH;611024.84;800182.69;724
-726;2001028438;B06000;LESAO CORPORAL;RUA NELSON HUNGR;1530;46634;15/1/2001 21:08:00;CIDADAO COMUM;S;;TUPI;BH;613245.05;806364.51;725
-727;2001028450;B03000;AMEACA;RUA ASPASIA;127;6293;15/1/2001 21:18:00;INICIATIVA;S;0;ADELAIDE;BH;606996.13;798544.21;726
-728;2001028479;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;4520;17228;15/1/2001 21:32:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;612542.80;795507.60;727
-729;2001028491;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;1701;51657;15/1/2001 21:39:00;CIDADAO COMUM;S;0;VENDA NOVA;BH;608416.84;809036.43;728
-730;2001028514;B06000;LESAO CORPORAL;RUA MODESTINA DE;40;56878;15/1/2001 21:51:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604473.55;793453.50;729
-731;2001028518;B06000;LESAO CORPORAL;RUA LIMA;15;41063;15/1/2001 21:54:00;CIDADAO COMUM;S;LJ1;COPACABANA;BH;606113.57;806114.27;730
-732;2001028601;B03000;AMEACA;RUA CORONEL JOAQ;290;87063;15/1/2001 22:36:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604704.15;807808.13;731
-733;2001028710;B06000;LESAO CORPORAL;RUA DINIS DIAS;145;119673;15/1/2001 23:48:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616573.20;797526.82;732
-734;2001028780;B06000;LESAO CORPORAL;RUA OSCAR LOBO P;270;104480;16/1/2001 00:53:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612347.11;803516.89;733
-735;2001028833;B06000;LESAO CORPORAL;AV DOS ANDRADAS;391;3761;16/1/2001 01:33:00;INICIATIVA;S;0;CENTRO (BH);BH;611562.02;797248.57;734
-736;2001028838;B03000;AMEACA;RUA IRAI;55;34915;16/1/2001 01:37:00;CIDADAO COMUM;N;;CORACAO DE JESUS;BH;609854.94;794169.18;735
-737;2001028846;B08000;VIOLACAO DE DOMI;RUA DOM JOAQUIM ;874;22313;16/1/2001 01:46:00;CIDADAO COMUM;N;0;CORACAO EUCARIST;BH;605566.78;796249.94;736
-738;2001028883;B06000;LESAO CORPORAL;AV AFONSO PENA;3032;1259;16/1/2001 02:30:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612321.21;795046.07;737
-739;2001029145;B06000;LESAO CORPORAL;RUA SAO MATIAS;258;63408;16/1/2001 08:59:00;INICIATIVA;N;0;SERRANO;BH;603478.33;800637.91;738
-740;2001029265;B03000;AMEACA;AV SILVA LOBO;1685;65889;16/1/2001 10:13:00;INICIATIVA;S;0;GRAJAU;BH;608088.35;794919.48;739
-741;2001029275;B06000;LESAO CORPORAL;RUA DA BAHIA;422;81155;16/1/2001 10:21:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611417.58;797211.95;740
-742;2001029310;B06000;LESAO CORPORAL;RUA FRANCISCO DA;411;29729;16/1/2001 10:40:00;CIDADAO COMUM;N;;MONSENHOR MESSIA;BH;606892.04;798251.49;741
-743;2001029335;B03000;AMEACA;RUA ABEILARD PER;48;587;16/1/2001 11:13:00;CIDADAO COMUM;N;CAD;SANTA AMELIA;BH;606763.27;805442.04;742
-744;2001029346;B03000;AMEACA;RUA OZENIL JOSE ;75;86058;16/1/2001 11:19:00;CIDADAO COMUM;S;;VILA FREI LEOPOL;BH;611670.79;809683.45;743
-745;2001029406;B08000;VIOLACAO DE DOMI;RUA POUSO ALEGRE;1314;54932;16/1/2001 12:06:00;CIDADAO COMUM;N;;FLORESTA;BH;612350.46;797901.33;744
-746;2001029518;B03000;AMEACA;RUA FELIPE CAMAR;12;27938;16/1/2001 13:35:00;CIDADAO COMUM;S;;ESPLANADA;BH;613862.69;798419.73;745
-747;2001029618;B06000;LESAO CORPORAL;RUA DOS AERONAUT;385;1158;16/1/2001 14:55:00;INICIATIVA;S;0;LIBERDADE;BH;609426.98;803824.32;746
-748;2001029623;B03000;AMEACA;AV BALEARES;247;89333;16/1/2001 14:59:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;608053.98;809851.39;747
-749;2001029681;B03000;AMEACA;RUA CURITIBA;175;19090;16/1/2001 15:41:00;INICIATIVA;S;0;CENTRO (BH);BH;611005.46;797704.71;748
-750;2001029690;B06000;LESAO CORPORAL;RUA JOSE FLAUSIN;67;95462;16/1/2001 15:46:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;617042.59;804184.81;749
-751;2001029710;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;690;63782;16/1/2001 16:02:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610807.00;793360.70;750
-752;2001029748;B03000;AMEACA;ALAMEDA DIOGO GU;369;21336;16/1/2001 16:34:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601653.68;788600.58;751
-753;2001029824;B03000;AMEACA;RUA NELSON HUNGR;1530;46634;16/1/2001 17:18:00;CIDADAO COMUM;S;;TUPI;BH;613245.05;806364.51;752
-754;2001029849;B03000;AMEACA;RUA WILSON SOARE;530;20664;16/1/2001 17:27:00;CIDADAO COMUM;N;;PLANALTO;BH;610604.63;806147.71;753
-755;2001029852;B03000;AMEACA;RUA JOSE ROBERTO;254;78516;16/1/2001 17:27:00;CIDADAO COMUM;S;;VILA PINHO;BH;602471.77;787524.60;754
-756;2001029870;B03000;AMEACA;RUA JOAQUIM TEIX;10;128845;16/1/2001 17:36:00;CIDADAO COMUM;N;;CASTANHEIRAS (TA;BH;617405.88;796871.94;755
-757;2001029962;B03000;AMEACA;RUA MATIAS AIRES;330;34032;16/1/2001 18:35:00;CIDADAO COMUM;N;;VILA MARAVILHAS;BH;603054.76;795104.69;756
-758;2001029971;B06000;LESAO CORPORAL;RUA PERNAMBUCO;836;53463;16/1/2001 18:38:00;CIDADAO COMUM;S;PX836;FUNCIONARIOS;BH;611527.62;795448.67;757
-759;2001030057;B03000;AMEACA;RUA CANDELARIA;46;12501;16/1/2001 19:16:00;CIDADAO COMUM;N;;VILA OESTE;BH;604297.32;795319.54;758
-760;2001030067;B03000;AMEACA;RUA MINERVINA EU;137;80820;16/1/2001 19:21:00;CIDADAO COMUM;N;;ESTRELA DO ORIEN;BH;606081.61;792178.90;759
-761;2001030122;B04001;HOMICIDIO TENTAD;RUA DA BAHIA;850;81155;16/1/2001 19:51:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611305.01;796799.04;760
-762;2001030162;B03000;AMEACA;RUA DALVA DE MAT;123;19595;16/1/2001 20:16:00;CIDADAO COMUM;S;0;SANTA MONICA DO ;BH;606079.43;808382.47;761
-763;2001030179;B06000;LESAO CORPORAL;RUA DOM CAVATI;55;29300;16/1/2001 20:26:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612535.57;804337.76;762
-764;2001030225;B03000;AMEACA;RUA BARAO DE COC;245;7876;16/1/2001 20:54:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612850.49;798180.54;763
-765;2001030236;B06000;LESAO CORPORAL;RUA CIBIPURUNA;125;60885;16/1/2001 21:08:00;CIDADAO COMUM;S;0;INDUSTRIAL RODRI;BH;616020.85;808409.77;764
-766;2001030297;B03000;AMEACA;RUA VISCONDE DE ;74;73263;16/1/2001 21:49:00;POLICIAL MILITAR;S;0;MAGNESITA;BH;604112.14;794187.97;765
-767;2001030317;B03000;AMEACA;RUA ROSA NEGRA;266;124481;16/1/2001 22:03:00;CIDADAO COMUM;S;;ETELVINA CARNEIR;BH;611498.24;809077.19;766
-768;2001030350;B06000;LESAO CORPORAL;RUA RIACHUELO;1591;58527;16/1/2001 22:29:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606987.22;797534.27;767
-769;2001030355;B03000;AMEACA;RUA GUILHERME PI;337;32516;16/1/2001 22:33:00;CIDADAO COMUM;N;0;MAGNESITA;BH;604227.98;793866.65;768
-770;2001030372;B03000;AMEACA;AV AFONSO PENA;1757;1259;16/1/2001 22:45:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611723.59;796200.98;769
-771;2001030405;B03000;AMEACA;RUA FELIPE DE ME;60;27940;16/1/2001 23:03:00;CIDADAO COMUM;S;0;UNIAO;BH;612275.77;801646.08;770
-772;2001030501;B04001;HOMICIDIO TENTAD;RUA PADRE CAFE;86;51253;16/1/2001 23:46:00;CIDADAO COMUM;S;0;SAUDADE;BH;615066.13;797633.87;771
-773;2001030596;B06000;LESAO CORPORAL;RUA BERNARDO GUI;2213;9364;17/1/2001 00:48:00;INICIATIVA;N;0;LOURDES;BH;610447.87;796167.73;772
-774;2001030617;B03000;AMEACA;RUA VINTE E NOVE;19;73061;17/1/2001 01:10:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604534.00;796873.73;773
-775;2001030637;B04001;HOMICIDIO TENTAD;RUA NANA;255;47186;17/1/2001 01:26:00;INICIATIVA;S;0;MILIONARIOS;BH;603947.95;789918.54;774
-776;2001030671;B04001;HOMICIDIO TENTAD;RUA DAS VERBENAS;62;71545;17/1/2001 01:59:00;CIDADAO COMUM;N;0;LINDEIA;BH;598771.99;790934.64;775
-777;2001030711;B06000;LESAO CORPORAL;RUA FLOR DA AMIZ;320;94646;17/1/2001 02:48:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606193.98;799691.50;776
-778;2001030745;B03000;AMEACA;RUA PADRE JOAO C;411;51455;17/1/2001 03:31:00;CIDADAO COMUM;S;;CORACAO EUCARIST;BH;605827.87;796830.47;777
-779;2001031093;B04002;HOMICIDIO CONSUM;AV SEN LEVINDO C;250;14866;17/1/2001 09:49:00;CIDADAO COMUM;N;0;SANTA CECILIA;BH;600966.68;789489.63;778
-780;2001031100;B03000;AMEACA;AV BERNARDO VASC;1094;9411;17/1/2001 09:52:00;CIDADAO COMUM;N;FU;CACHOEIRINHA;BH;610848.37;801008.03;779
-781;2001031122;B03000;AMEACA;AV AFONSO PENA;4183;1259;17/1/2001 10:10:00;CIDADAO COMUM;S;0;CRUZEIRO;BH;612944.53;794095.63;780
-782;2001031193;B06000;LESAO CORPORAL;RUA TIZIU;514;95881;17/1/2001 11:01:00;CIDADAO COMUM;S;BECO SANTO ANTON;GOIANIA;BH;615351.18;802590.79;781
-783;2001031259;B03000;AMEACA;AV AMAZONAS;2234;3140;17/1/2001 11:54:00;INICIATIVA;S;;BARRO PRETO;BH;609538.19;796266.31;782
-784;2001031309;B03000;AMEACA;RUA ENGENHO DO S;634;80427;17/1/2001 12:33:00;CIDADAO COMUM;S;;ENGENHO NOGUEIRA;BH;606378.52;800198.44;783
-785;2001031353;B03000;AMEACA;RUA CONCEICAO DO;215;81978;17/1/2001 13:04:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614115.15;804354.59;784
-786;2001031379;B03000;AMEACA;RUA RIO DE JANEI;2101;58772;17/1/2001 13:21:00;CIDADAO COMUM;N;0;LOURDES;BH;610746.64;795656.51;785
-787;2001031587;B06000;LESAO CORPORAL;RUA TREZE DE SET;197;69168;17/1/2001 15:47:00;CIDADAO COMUM;S;;LEONINA;BH;608459.92;793384.14;786
-788;2001031669;B03000;AMEACA;RUA ITAPECERICA;946;35757;17/1/2001 16:35:00;CIDADAO COMUM;N;;LAGOINHA;BH;610331.36;798629.12;787
-789;2001031682;B03000;AMEACA;RUA STA CRUZ;703;60466;17/1/2001 16:40:00;CIDADAO COMUM;N;CASA;GRAJAU;BH;608278.05;795120.98;788
-790;2001031690;B03000;AMEACA;RUA FERNANDES TO;45;81271;17/1/2001 16:47:00;CIDADAO COMUM;S;LJ3;FUNCIONARIOS;BH;611476.90;794887.18;789
-791;2001031697;B03000;AMEACA;RUA EXPEDITO FLA;70;84847;17/1/2001 16:50:00;CIDADAO COMUM;N;CASA 41;DA LAGOA;BH;604749.70;809113.09;790
-792;2001031887;B06000;LESAO CORPORAL;RUA INDO;56;34436;17/1/2001 18:33:00;CIDADAO COMUM;S;;CH BETANIA;BH;605116.60;792343.88;791
-793;2001031898;B06000;LESAO CORPORAL;RUA JOAQUIM TEIX;6;128845;17/1/2001 18:39:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617405.88;796871.94;792
-794;2001032040;B03000;AMEACA;RUA SEBASTIAO BR;67;107406;17/1/2001 19:59:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604814.01;792442.75;793
-795;2001032056;B06000;LESAO CORPORAL;ALAMEDA DIOGO GU;320;21336;17/1/2001 20:11:00;CIDADAO COMUM;S;;CASTANHEIRA 2;BH;601785.37;788781.93;794
-796;2001032095;B03000;AMEACA;AV SARAMENHA;1723;64007;17/1/2001 20:33:00;CIDADAO COMUM;S;BL. 32  AP. 104;TUPI;BH;613342.58;805500.03;795
-797;2001032106;B06000;LESAO CORPORAL;RUA JOAO PIRES;95;37866;17/1/2001 20:44:00;CIDADAO COMUM;S;CA;JARDINOPOLIS;BH;604534.36;794612.47;796
-798;2001032176;B03000;AMEACA;AV NOSSA SENHORA;327;48311;17/1/2001 21:36:00;CIDADAO COMUM;S;;PRIMEIRO DE NOVE;BH;612830.58;805154.47;797
-799;2001032362;B03000;AMEACA;RUA TREZE;39;126358;17/1/2001 23:28:00;CIDADAO COMUM;N;;PARQUE SAO JOSE;BH;607047.22;792095.32;798
-800;2001032402;B06000;LESAO CORPORAL;AV RESSACA;370;58454;17/1/2001 23:55:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;606052.47;797241.79;799
-801;2001032521;B06000;LESAO CORPORAL;RUA MAJOR MESSIA;221;115200;18/1/2001 01:06:00;CIDADAO COMUM;N;0;BANDEIRANTES;BH;604706.99;804294.47;800
-802;2001032524;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;18/1/2001 01:16:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;801
-803;2001032593;B06000;LESAO CORPORAL;RUA UARIRA;510;70136;18/1/2001 02:19:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;616229.57;798932.07;802
-804;2001032641;B03000;AMEACA;RUA ARA;139;5250;18/1/2001 02:59:00;CIDADAO COMUM;S;;VILA MARAVILHAS;BH;603021.07;795464.44;803
-805;2001032671;B06000;LESAO CORPORAL;RUA LADAINHA;270;40118;18/1/2001 03:36:00;CIDADAO COMUM;N;CAFU;PRIMEIRO DE MAIO;BH;612103.94;803801.29;804
-806;2001032700;B04001;HOMICIDIO TENTAD;RUA ATIBAIA;191;6530;18/1/2001 04:23:00;INICIATIVA;S;0;PIRATININGA;BH;606522.83;809420.66;805
-807;2001032894;B03000;AMEACA;AV FRANKLIN MAGA;45;29744;18/1/2001 08:46:00;CIDADAO COMUM;S;;TUPI;BH;612519.21;806390.63;806
-808;2001033024;B03000;AMEACA;RUA JOAQUIM SOAR;533;38190;18/1/2001 10:23:00;INICIATIVA;N;0;FLORAMAR;BH;612345.71;805930.65;807
-809;2001033060;B08000;VIOLACAO DE DOMI;RUA BARAO DO MON;960;63653;18/1/2001 10:44:00;CIDADAO COMUM;N;0;CARDOSO;BH;604059.47;787725.48;808
-810;2001033175;B03000;AMEACA;AV BERNARDO VASC;1194;9411;18/1/2001 12:13:00;CIDADAO COMUM;S;FU;CACHOEIRINHA;BH;610951.68;801058.28;809
-811;2001033181;B03000;AMEACA;RUA DOM EUGENIO ;18;22212;18/1/2001 12:20:00;CIDADAO COMUM;N;0;PLANALTO;BH;610690.75;805714.94;810
-812;2001033198;B03000;AMEACA;RUA PONTE NOVA;875;54655;18/1/2001 12:38:00;INICIATIVA;N;0;FLORESTA;BH;611771.89;798243.03;811
-813;2001033239;B02000;RIXA;AV WALDOMIRO LOB;768;66548;18/1/2001 12:59:00;INICIATIVA;N;0;GUARANI;BH;612664.28;805480.89;812
-814;2001033273;B05000;SEQUESTRO E CARC;AV DOM PEDRO II;3552;53145;18/1/2001 13:15:00;INICIATIVA;N;0;ADELAIDE;BH;607395.18;797928.58;813
-815;2001033299;B03000;AMEACA;AV OLEGARIO MACI;1423;49699;18/1/2001 13:40:00;CIDADAO COMUM;S;;LOURDES;BH;610355.84;796334.11;814
-816;2001033329;B06000;LESAO CORPORAL;AV AMAZONAS;2267;3140;18/1/2001 14:08:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609538.15;796202.90;815
-817;2001033436;B06000;LESAO CORPORAL;RUA SANTISSIMA T;157;61516;18/1/2001 15:17:00;CIDADAO COMUM;N;AP108;SAGRADA FAMILIA;BH;613387.78;798604.45;816
-818;2001033449;B03000;AMEACA;RUA A I;1;31526;18/1/2001 15:25:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616922.56;806705.51;817
-819;2001033492;B06000;LESAO CORPORAL;AV MEM DE SA;1736;45395;18/1/2001 15:52:00;CIDADAO COMUM;N;;FAZENDINHA;BH;614290.42;795998.55;818
-820;2001033512;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;1715;17095;18/1/2001 16:03:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;613260.28;797299.09;819
-821;2001033581;B02000;RIXA;RUA RADIALISTA H;35;78950;18/1/2001 16:50:00;CIDADAO COMUM;S;;CEU AZUL;BH;604408.05;808022.13;820
-822;2001033635;B03000;AMEACA;RUA PADRE PEDRO ;111;51657;18/1/2001 17:12:00;CIDADAO COMUM;S;;VENDA NOVA;BH;605043.91;810026.57;821
-823;2001033652;B06000;LESAO CORPORAL;RUA PADRE JULIO ;55;51496;18/1/2001 17:20:00;INICIATIVA;S;0;VERA CRUZ;BH;615000.53;797344.42;822
-824;2001033741;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;584;63782;18/1/2001 18:08:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610825.76;793399.28;823
-825;2001033749;B03000;AMEACA;RUA TIRADENTES;16;48251;18/1/2001 18:13:00;CIDADAO COMUM;S;0;PIRATININGA;BH;605198.06;809060.84;824
-826;2001033881;B04001;HOMICIDIO TENTAD;RUA BRAS;204;170835;18/1/2001 19:13:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;608209.00;793886.27;825
-827;2001033898;B06000;LESAO CORPORAL;RUA IGUACU;674;34118;18/1/2001 19:21:00;CIDADAO COMUM;S;;CONCORDIA;BH;611530.53;799063.01;826
-828;2001033920;B04001;HOMICIDIO TENTAD;RUA JOSE GONCALV;89;99901;18/1/2001 19:33:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614585.31;802987.34;827
-829;2001033923;B03000;AMEACA;RUA ARARI;95;5537;18/1/2001 19:35:00;CIDADAO COMUM;S;OFICINA DO RAMIR;BONFIM;BH;609908.17;797814.73;828
-830;2001033955;B04001;HOMICIDIO TENTAD;RUA PENIDO;83;53306;18/1/2001 19:46:00;CIDADAO COMUM;N;0;PIRAJA;BH;613156.80;803005.55;829
-831;2001033963;B05000;SEQUESTRO E CARC;RUA JACUI;382;36734;18/1/2001 19:49:00;CIDADAO COMUM;N;0;FLORESTA;BH;611811.78;798148.04;830
-832;2001033964;B04001;HOMICIDIO TENTAD;RUA TENENTE JOAO;72;113450;18/1/2001 19:49:00;CIDADAO COMUM;N;;JARDIM GUANABARA;BH;611909.09;807527.63;831
-833;2001034016;B03000;AMEACA;RUA VINTE E OITO;39;33231;18/1/2001 20:25:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612386.16;807143.06;832
-834;2001034052;B03000;AMEACA;RUA BONINAS;271;10115;18/1/2001 20:43:00;CIDADAO COMUM;S;;ESPLANADA;BH;614462.59;798690.33;833
-835;2001034059;B05000;SEQUESTRO E CARC;RUA TEBAS;820;67090;18/1/2001 20:40:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616073.41;798319.09;834
-836;2001034147;B03000;AMEACA;RUA DOS CARIJOS;930;81243;18/1/2001 21:36:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610563.81;797327.45;835
-837;2001034186;B06000;LESAO CORPORAL;RUA SAO TOMAS DE;500;63782;18/1/2001 21:54:00;INICIATIVA;S;0;SAO PEDRO;BH;610867.78;793546.24;836
-838;2001034200;B06000;LESAO CORPORAL;RUA CARLOS SCHET;505;118771;18/1/2001 22:02:00;CIDADAO COMUM;N;;JARDINOPOLIS;BH;605039.83;794569.69;837
-839;2001034282;B06000;LESAO CORPORAL;RUA GUAICURUS;638;32009;18/1/2001 22:50:00;INICIATIVA;S;;CENTRO (BH);BH;611045.09;797686.44;838
-840;2001034301;B03000;AMEACA;RUA SERTAOZINHO;134;84138;18/1/2001 22:59:00;CIDADAO COMUM;N;LJA;JARDIM LEBLON;BH;606208.01;807819.22;839
-841;2001034337;B03000;AMEACA;RUA JAIR LOPES C;25;89359;18/1/2001 23:11:00;CIDADAO COMUM;S;0;LETICIA;BH;607488.53;810081.42;840
-842;2001034362;B03000;AMEACA;RUA ROSALVO DE M;140;70439;18/1/2001 23:27:00;CIDADAO COMUM;S;;GOIANIA;BH;615264.97;803384.96;841
-843;2001034389;B06000;LESAO CORPORAL;RUA ASTOLFO DUTR;380;6426;18/1/2001 23:47:00;CIDADAO COMUM;S;0;ESPLANADA;BH;615034.80;798256.05;842
-844;2001034419;B03000;AMEACA;RUA CRISANTEMO;140;18564;19/1/2001 00:09:00;CIDADAO COMUM;S;;MARAJO;BH;606711.50;793120.10;843
-845;2001034434;B06000;LESAO CORPORAL;RUA SUCURI;169;66450;19/1/2001 00:22:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615059.26;799704.01;844
-846;2001034446;B06000;LESAO CORPORAL;RUA AUGUSTO CESA;70;86451;19/1/2001 00:35:00;CIDADAO COMUM;S;0;LETICIA;BH;606880.19;809662.24;845
-847;2001034488;B03000;AMEACA;RUA SAO MATIAS;397;63408;19/1/2001 01:11:00;CIDADAO COMUM;S;;SERRANO;BH;603549.73;800736.58;846
-848;2001034498;B03000;AMEACA;AV AFONSO PENA;526;1259;19/1/2001 01:17:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611038.27;797264.23;847
-849;2001034552;B09000;ABANDONO DE INCA;RUA ILACIR PEREI;578;114701;19/1/2001 02:13:00;INICIATIVA;N;0;VILA SILVEIRA;BH;612048.74;800476.30;848
-850;2001034715;B03000;AMEACA;RUA CORONEL COST;275;10809;19/1/2001 06:52:00;CIDADAO COMUM;N;0;PLANALTO;BH;610783.13;806561.04;849
-851;2001034845;B06000;LESAO CORPORAL;RUA CRACOVIA;640;85317;19/1/2001 08:35:00;CIDADAO COMUM;S;REF:FINAL DO 220;JARDIM EUROPA;BH;608697.40;810214.06;850
-852;2001034937;B06000;LESAO CORPORAL;RUA RIO COMPRIDO;43;62751;19/1/2001 09:32:00;CIDADAO COMUM;S;ITINERARIO DO 22;VILA SANTA BRANC;BH;605245.60;809653.11;851
-853;2001034962;B03000;AMEACA;RUA ANITA GARIBA;249;4184;19/1/2001 10:00:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608959.99;794513.91;852
-854;2001034972;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;1152;31400;19/1/2001 10:07:00;CIDADAO COMUM;N;PX663;BARRO PRETO;BH;610173.27;797003.72;853
-855;2001034995;B06000;LESAO CORPORAL;RUA SILVIO GUEDE;10;89610;19/1/2001 10:23:00;CIDADAO COMUM;S;;PALMEIRAS;BH;606875.00;790987.05;854
-856;2001035112;B03000;AMEACA;RUA PLATINA;1115;54453;19/1/2001 11:46:00;CIDADAO COMUM;N;;CALAFATE;BH;608044.17;796840.68;855
-857;2001035113;B06000;LESAO CORPORAL;RUA TRES;166;32301;19/1/2001 11:46:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612209.41;807411.82;856
-858;2001035170;B04001;HOMICIDIO TENTAD;RUA PEDRO LESSA;360;53117;19/1/2001 12:26:00;INICIATIVA;N;0;PRADO LOPES;BH;609977.82;798809.19;857
-859;2001035224;B03000;AMEACA;RUA RIO DE JANEI;1058;58772;19/1/2001 13:00:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610976.88;796673.06;858
-860;2001035227;B03000;AMEACA;RUA LIMEIRA;139;54050;19/1/2001 13:03:00;CIDADAO COMUM;S;0;SAO PAULO;BH;606102.38;809708.12;859
-861;2001035483;B03000;AMEACA;RUA LILAS;35;18261;19/1/2001 15:50:00;CIDADAO COMUM;S;0;ALTO DOS PINHEIR;BH;604116.21;795997.43;860
-862;2001035556;B06000;LESAO CORPORAL;RUA JOSE MAURICI;426;58035;19/1/2001 16:32:00;POLICIAL CIVIL;S;;SANTA CRUZ;BH;610629.80;801740.90;861
-863;2001035570;B03000;AMEACA;RUA CARVALHOS;219;13788;19/1/2001 16:40:00;CIDADAO COMUM;S;0;MANGABEIRAS;BH;612116.96;792573.56;862
-864;2001035575;B03000;AMEACA;RUA SILVIO GUEDE;10;89610;19/1/2001 16:43:00;CIDADAO COMUM;S;;PALMEIRAS;BH;606875.00;790987.05;863
-865;2001035577;B02000;RIXA;RUA CLOVIS DE CA;60;16064;19/1/2001 16:44:00;INICIATIVA;N;0;FLORAMAR;BH;612179.96;805856.34;864
-866;2001035788;B03000;AMEACA;BECO NOVA PONTE;60;301242;19/1/2001 18:40:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610896.07;793759.09;865
-867;2001035797;B03000;AMEACA;AV AUGUSTO DE LI;1288;6731;19/1/2001 18:46:00;CIDADAO COMUM;S;CAFU;BARRO PRETO;BH;610091.59;796885.43;866
-868;2001035862;B04001;HOMICIDIO TENTAD;RUA GERALDO ROSA;413;124898;19/1/2001 19:16:00;CIDADAO COMUM;S;;MANGUEIRAS;BH;600857.84;786602.84;867
-869;2001035915;B06000;LESAO CORPORAL;RUA CORNELIO CER;475;17417;19/1/2001 19:45:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605985.02;797880.54;868
-870;2001035955;B03000;AMEACA;RUA IPE ROSA;25;82781;19/1/2001 20:07:00;CIDADAO COMUM;N;0;CELESTINO;BH;610571.21;808589.32;869
-871;2001035993;B03000;AMEACA;RUA TRES;251;300266;19/1/2001 20:31:00;CIDADAO COMUM;S;;VISTA DO SOL;BH;616371.41;804771.28;870
-872;2001036011;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;116;300224;19/1/2001 20:38:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610483.68;793552.32;871
-873;2001036029;B04001;HOMICIDIO TENTAD;RUA GIRASSOL;50;170242;19/1/2001 20:45:00;CIDADAO COMUM;N;;CABANA;BH;604916.41;794394.64;872
-874;2001036040;B03000;AMEACA;AV DOM PEDRO II;533;53145;19/1/2001 20:47:00;CIDADAO COMUM;S;0;BONFIM;BH;610107.60;797839.85;873
-875;2001036088;B06000;LESAO CORPORAL;RUA AZURITA;109;7094;19/1/2001 21:10:00;CIDADAO COMUM;S;;VIRGINIA;BH;603185.21;794446.73;874
-876;2001036091;B06000;LESAO CORPORAL;RUA ANITA GARIBA;54;4184;19/1/2001 21:11:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608849.03;794573.30;875
-877;2001036185;B03000;AMEACA;RUA GOVERNADOR M;23;31642;19/1/2001 21:53:00;CIDADAO COMUM;S;;GAMELEIRA;BH;606275.34;796492.16;876
-878;2001036203;B06000;LESAO CORPORAL;RUA MARCIOS MOUR;63;117306;19/1/2001 22:02:00;CIDADAO COMUM;S;;LINDEIA;BH;600079.56;790636.85;877
-879;2001036272;B06000;LESAO CORPORAL;RUA TAIOBEIRAS;100;17168;19/1/2001 22:39:00;INICIATIVA;S;0;COQUEIROS;BH;602596.36;798636.04;878
-880;2001036329;B04001;HOMICIDIO TENTAD;AV DOM PEDRO II;5146;53145;19/1/2001 23:12:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606192.09;798764.89;879
-881;2001036365;B06000;LESAO CORPORAL;RUA CAICARA;341;11451;19/1/2001 23:28:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615112.79;799155.44;880
-882;2001036369;B06000;LESAO CORPORAL;AV SEN LEVINDO C;1007;14866;19/1/2001 23:30:00;CIDADAO COMUM;S;;MANGUEIRAS;BH;600926.54;788061.46;881
-883;2001036406;B06000;LESAO CORPORAL;AV CLARA NUNES;670;45644;19/1/2001 23:51:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;611029.42;800928.11;882
-884;2001036416;B03000;AMEACA;RUA PEDRO SIMONI;159;301397;20/1/2001 00:00:00;CIDADAO COMUM;S;;OLARIA;BH;601031.98;789234.70;883
-885;2001036433;B03000;AMEACA;AV DOM PEDRO II;1950;53145;20/1/2001 00:09:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608938.73;798417.38;884
-886;2001036489;B04002;HOMICIDIO CONSUM;RUA ILDEU MOREIR;150;80947;20/1/2001 00:37:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605708.95;793399.71;885
-887;2001036556;B03000;AMEACA;RUA JOAQUIM TEIX;63;38207;20/1/2001 01:13:00;CIDADAO COMUM;0;0;CARDOSO;BH;604078.65;788100.48;886
-888;2001036558;B06000;LESAO CORPORAL;RUA JOSE JOAQUIM;342;38871;20/1/2001 01:16:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610903.81;802145.71;887
-889;2001036569;B03000;AMEACA;RUA JOSE LEITE S;60;20548;20/1/2001 01:22:00;CIDADAO COMUM;S;0;LETICIA;BH;607463.95;810357.59;888
-890;2001036651;B06000;LESAO CORPORAL;AV BERNARDO VASC;2717;9411;20/1/2001 02:24:00;INICIATIVA;S;0;IPIRANGA;BH;612138.82;801992.11;889
-891;2001036668;B03000;AMEACA;RUA CASTANHAL;170;96250;20/1/2001 02:34:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614605.78;804429.58;890
-892;2001036690;B04001;HOMICIDIO TENTAD;AV FURQUIM WERNE;1200;650;20/1/2001 02:46:00;INICIATIVA;N;0;TUPI;BH;613155.12;806559.58;891
-893;2001036707;B03000;AMEACA;RUA ANTONIO RIBE;75;96783;20/1/2001 02:56:00;CIDADAO COMUM;S;FU;ANTONIO RIBEIRO ;BH;615051.81;806806.25;892
-894;2001036715;B06000;LESAO CORPORAL;RUA DOS CAETES;372;11376;20/1/2001 03:03:00;CIDADAO COMUM;N;PX409;CENTRO (BH);BH;611253.80;797440.40;893
-895;2001036726;B04001;HOMICIDIO TENTAD;RUA QUATRO DE MA;3;57118;20/1/2001 03:09:00;INICIATIVA;S;0;LEONINA;BH;608663.34;793662.61;894
-896;2001036740;B04001;HOMICIDIO TENTAD;AV AMERICO VESPU;1003;3355;20/1/2001 03:14:00;CIDADAO COMUM;N;0;APARECIDA;BH;609058.54;800075.87;895
-897;2001036755;B06000;LESAO CORPORAL;RUA RIO DE JANEI;97;58772;20/1/2001 03:29:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611257.43;797586.02;896
-898;2001036758;B02000;RIXA;RUA CONTAGEM;1600;70293;20/1/2001 03:33:00;CIDADAO COMUM;S;;SANTA INES;BH;614360.04;801201.70;897
-899;2001036992;B03000;AMEACA;RUA JOSE BARTOLO;36;38512;20/1/2001 08:12:00;CIDADAO COMUM;S;;TUPI;BH;612479.09;806154.91;898
-900;2001037070;B03000;AMEACA;AV FREI ANDREONI;489;75533;20/1/2001 09:15:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606885.38;794024.37;899
-901;2001037105;B03000;AMEACA;RUA AZALEIA;9;115846;20/1/2001 09:44:00;CIDADAO COMUM;S;0;HAVAI;BH;607259.91;793586.09;900
-902;2001037133;B03000;AMEACA;RUA IPE ROSA;25;82781;20/1/2001 10:03:00;CIDADAO COMUM;N;0;CELESTINO;BH;610571.21;808589.32;901
-903;2001037268;B03000;AMEACA;RUA BELA EMILIA;27;96175;20/1/2001 11:51:00;CIDADAO COMUM;S;CA27;OLARIA;BH;601235.90;789192.41;902
-904;2001037308;B04001;HOMICIDIO TENTAD;RUA WILDE JOSE P;35;99321;20/1/2001 12:14:00;CIDADAO COMUM;N;;PLANALTO;BH;609479.86;806756.19;903
-905;2001037335;B03000;AMEACA;RUA CURUPAITI;206;19148;20/1/2001 12:30:00;CIDADAO COMUM;S;CA;PADRE EUSTAQUIO;BH;606230.45;797888.54;904
-906;2001037337;B03000;AMEACA;AV CRISTIANO MAC;1718;18652;20/1/2001 12:31:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612292.78;800077.49;905
-907;2001037348;B03000;AMEACA;RUA MANOEL JOSE ;55;43129;20/1/2001 12:44:00;CIDADAO COMUM;N;0;SANTA CRUZ;BH;610823.28;802125.09;906
-908;2001037394;B06000;LESAO CORPORAL;RUA PURUS;605;55819;20/1/2001 13:20:00;CIDADAO COMUM;N;FU;CONCORDIA;BH;610757.70;799431.82;907
-909;2001037417;B06000;LESAO CORPORAL;RUA PRINCIPAL;55;102699;20/1/2001 13:34:00;CIDADAO COMUM;N;;TIROL;BH;600922.75;789246.93;908
-910;2001037434;B04001;HOMICIDIO TENTAD;RUA YUCATAN;70;36302;20/1/2001 13:47:00;INICIATIVA;S;0;SAO PEDRO;BH;611188.45;793833.06;909
-911;2001037471;B06000;LESAO CORPORAL;RUA SALVADOR PIR;246;60122;20/1/2001 14:08:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604338.28;790483.75;910
-912;2001037519;B06000;LESAO CORPORAL;RUA SAO TOMAS;7;63770;20/1/2001 14:41:00;CIDADAO COMUM;N;;PLANALTO;BH;610686.83;805550.99;911
-913;2001037553;B03000;AMEACA;RUA DIVINO ESPIR;128;96768;20/1/2001 15:08:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614627.89;806302.83;912
-914;2001037652;B03000;AMEACA;RUA ANTONIO JOSE;21;4622;20/1/2001 15:57:00;CIDADAO COMUM;S;;MAGNESITA;BH;604151.12;794091.76;913
-915;2001037676;B03000;AMEACA;RUA JANETE CLAIR;172;50046;20/1/2001 16:10:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607144.48;807726.85;914
-916;2001037702;B04001;HOMICIDIO TENTAD;AV SOLFERINA RIC;840;72840;20/1/2001 16:26:00;INICIATIVA;S;0;JATOBA;BH;600254.65;788290.33;915
-917;2001037728;B04001;HOMICIDIO TENTAD;RUA EVOCACAO;475;26948;20/1/2001 16:45:00;CIDADAO COMUM;S;;SAO JOSE;BH;605856.28;798750.25;916
-918;2001037732;B04001;HOMICIDIO TENTAD;RUA TANCREDO EST;54;66838;20/1/2001 16:48:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609723.18;805275.89;917
-919;2001037739;B06000;LESAO CORPORAL;RUA MUNICIPAL;46;171677;20/1/2001 16:52:00;INICIATIVA;N;0;VILA CEMIG;BH;605614.67;788590.06;918
-920;2001037779;B06000;LESAO CORPORAL;RUA GUAICURUS;660;32009;20/1/2001 17:11:00;INICIATIVA;N;0;CENTRO (BH);BH;611027.05;797689.74;919
-921;2001037812;B06000;LESAO CORPORAL;RUA JOAO PAULO I;65;300458;20/1/2001 17:27:00;CIDADAO COMUM;S;;SAO DOMINGOS;BH;607677.28;793509.05;920
-922;2001037820;B04002;HOMICIDIO CONSUM;RUA BANDONION;110;170139;20/1/2001 17:32:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;613977.41;795089.89;921
-923;2001037856;B06000;LESAO CORPORAL;RUA WALDEMAR DIA;115;15377;20/1/2001 17:53:00;CIDADAO COMUM;S;;CANDELARIA;BH;607931.15;809003.07;922
-924;2001037938;B03000;AMEACA;RUA J;165;41470;20/1/2001 18:37:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602785.39;803022.89;923
-925;2001037965;B06000;LESAO CORPORAL;RUA TRES;396;302811;20/1/2001 18:52:00;CIDADAO COMUM;S;CA15;NOVO AARAO REIS;BH;614548.88;806088.28;924
-926;2001038016;B03000;AMEACA;RUA PEDRA DA VAR;8;127086;20/1/2001 19:19:00;CIDADAO COMUM;S;0;PIRATININGA;BH;605753.30;809312.53;925
-927;2001038183;B03000;AMEACA;RUA CASCALHEIRA;177;13889;20/1/2001 20:44:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609380.40;808731.30;926
-928;2001038240;B03000;AMEACA;RUA OTAVIO CARNE;480;50594;20/1/2001 21:13:00;CIDADAO COMUM;S;0;BOA VISTA;BH;614841.38;799836.60;927
-929;2001038261;B06000;LESAO CORPORAL;RUA JOAO BERNARD;11;114897;20/1/2001 21:22:00;CIDADAO COMUM;S;AP101;PAQUETA;BH;605412.69;802594.48;928
-930;2001038268;B06000;LESAO CORPORAL;RUA BIMBARRA;345;9641;20/1/2001 21:26:00;CIDADAO COMUM;S;;CALAFATE;BH;607141.45;796609.73;929
-931;2001038329;B06000;LESAO CORPORAL;RUA DAS PERPETUA;615;911;20/1/2001 21:56:00;CIDADAO COMUM;N;;LINDEIA;BH;599593.30;790595.60;930
-932;2001038457;B03000;AMEACA;RUA FRANCISCO RO;600;10994;20/1/2001 23:10:00;CIDADAO COMUM;S;;DOM JOAQUIM;BH;613331.06;802015.37;931
-933;2001038479;B03000;AMEACA;RUA VICENTE SOLL;179;24781;20/1/2001 23:20:00;CIDADAO COMUM;S;;NOVA GAMELEIRA;BH;605440.68;794937.65;932
-934;2001038532;B04001;HOMICIDIO TENTAD;RUA DOUTOR CRIST;145;55598;20/1/2001 23:47:00;CIDADAO COMUM;S;0;BARREIRO DE CIMA;BH;604618.87;789081.22;933
-935;2001038588;B06000;LESAO CORPORAL;RUA DOS AIMORES;2198;1640;21/1/2001 00:18:00;CIDADAO COMUM;N;0;LOURDES;BH;610507.20;796334.72;934
-936;2001038624;B03000;AMEACA;RUA PAMPLONA;160;102862;21/1/2001 00:44:00;CIDADAO COMUM;S;0;CH DA LAGOA;BH;604911.66;802925.82;935
-937;2001038693;B06000;LESAO CORPORAL;RUA SEBASTIAO PE;60;125052;21/1/2001 01:20:00;CIDADAO COMUM;S;0;CONJUNTO ERNESTO;BH;601292.68;787495.16;936
-938;2001038729;B03000;AMEACA;PRACA SAO VICENT;10;63902;21/1/2001 01:39:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605483.12;797829.06;937
-939;2001038737;B06000;LESAO CORPORAL;RUA PADRE EUSTAQ;2521;51294;21/1/2001 01:43:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;607174.78;797630.57;938
-940;2001038756;B04001;HOMICIDIO TENTAD;RUA MUTUM;288;47003;21/1/2001 01:59:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606334.37;797068.42;939
-941;2001038762;B03000;AMEACA;RUA DOS CARIJOS;408;81243;21/1/2001 02:05:00;CIDADAO COMUM;N;AP4;CENTRO (BH);BH;611064.18;797198.94;940
-942;2001038767;B04002;HOMICIDIO CONSUM;RUA TOMBOS;52;67985;21/1/2001 02:09:00;INICIATIVA;N;0;CALAFATE;BH;607976.07;796885.75;941
-943;2001038780;B06000;LESAO CORPORAL;AV DOM JOAO VI;1640;22294;21/1/2001 02:15:00;INICIATIVA;N;0;PALMEIRAS;BH;606859.87;791154.76;942
-944;2001038784;B06000;LESAO CORPORAL;RUA TAMANDARE;261;66778;21/1/2001 02:18:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;605277.43;795832.10;943
-945;2001038806;B03000;AMEACA;RUA CURITIBA;339;19090;21/1/2001 02:31:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610965.75;797546.07;944
-946;2001038890;B06000;LESAO CORPORAL;AV SEN LEVINDO C;4445;14866;21/1/2001 03:43:00;CIDADAO COMUM;N;0;CH VALE DO JATOB;BH;601253.14;786620.47;945
-947;2001038915;B02000;RIXA;AV VILARINHOS;313;109988;21/1/2001 03:59:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609359.99;808778.03;946
-948;2001039010;B03000;AMEACA;RUA DOS TUPINAMB;875;69940;21/1/2001 05:43:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610735.22;797386.07;947
-949;2001039148;B06000;LESAO CORPORAL;AV AFONSO PENA;305;1259;21/1/2001 08:31:00;CIDADAO COMUM;N;PX305;CENTRO (BH);BH;610990.99;797465.67;948
-950;2001039240;B03000;AMEACA;RUA STA ROSA;10;61314;21/1/2001 09:57:00;CIDADAO COMUM;N;NUMERO CORRETO E;SAO TOMAZ;BH;609654.78;805254.46;949
-951;2001039277;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;322;51657;21/1/2001 10:29:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;609650.08;808286.90;950
-952;2001039291;B03000;AMEACA;RUA MADEIRA;95;42328;21/1/2001 10:40:00;CIDADAO COMUM;S;;RENASCENCA;BH;611016.45;799716.70;951
-953;2001039354;B06000;LESAO CORPORAL;RUA LINDOLFO DE ;2615;41164;21/1/2001 11:46:00;CIDADAO COMUM;N;NR/EXATO: 2685;SAO DOMINGOS;BH;608030.43;793288.52;952
-954;2001039355;B03000;AMEACA;RUA BARREIRO GRA;141;8258;21/1/2001 11:46:00;INICIATIVA;N;0;MARIA GORETTI;BH;614070.76;803291.42;953
-955;2001039358;B03000;AMEACA;RUA FRANCISCO BR;63;65270;21/1/2001 11:49:00;CIDADAO COMUM;S;LJA;ESTRELA DALVA;BH;607266.70;792342.60;954
-956;2001039382;B03000;AMEACA;RUA SA E BENEVID;86;10708;21/1/2001 12:14:00;CIDADAO COMUM;N;;UNIVERSITARIO;BH;610216.40;802593.25;955
-957;2001039416;B03000;AMEACA;RUA XAVIER DA VE;166;73843;21/1/2001 12:40:00;CIDADAO COMUM;N;;MINAS BRASIL;BH;605784.32;797406.65;956
-958;2001039475;B06000;LESAO CORPORAL;RUA JARDIM DAS O;37;56083;21/1/2001 13:43:00;CIDADAO COMUM;S;0;SAO JOSE;BH;605441.09;799029.32;957
-959;2001039481;B03000;AMEACA;RUA GALBA;152;30463;21/1/2001 13:44:00;CIDADAO COMUM;S;;GLORIA;BH;604337.53;798313.12;958
-960;2001039521;B03000;AMEACA;RUA BOM JESUS DA;599;99680;21/1/2001 14:16:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604069.20;802854.62;959
-961;2001039534;B03000;AMEACA;RUA TENENTE ALIP;40;86436;21/1/2001 14:27:00;INICIATIVA;S;0;JARDIM GUANABARA;BH;611918.24;807418.95;960
-962;2001039550;B04001;HOMICIDIO TENTAD;AV NELIO CERQUEI;15;72359;21/1/2001 14:38:00;CIDADAO COMUM;N;;TIROL;BH;600947.66;789885.51;961
-963;2001039569;B06000;LESAO CORPORAL;RUA DOS CAETES;650;11376;21/1/2001 14:50:00;CIDADAO COMUM;S;PX262;CENTRO (BH);BH;610985.31;797507.20;962
-964;2001039577;B03000;AMEACA;RUA IPANEMA;1135;34726;21/1/2001 14:58:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602814.25;802311.29;963
-965;2001039578;B06000;LESAO CORPORAL;RUA VITORIA REGI;338;73540;21/1/2001 14:58:00;CIDADAO COMUM;S;0;LINDEIA;BH;599149.00;790863.07;964
-966;2001039605;B03000;AMEACA;RUA DIMAS;87;21291;21/1/2001 15:12:00;CIDADAO COMUM;S;FR;SAO PAULO;BH;613218.01;802951.21;965
-967;2001039615;B03000;AMEACA;RUA JOAO PINTO;10;105542;21/1/2001 15:15:00;CIDADAO COMUM;S;0;JARDINOPOLIS;BH;605044.55;794808.96;966
-968;2001039672;B03000;AMEACA;RUA PADRE MARINH;60;51571;21/1/2001 15:58:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;613015.90;796391.73;967
-969;2001039745;B03000;AMEACA;AV SOUZA AGUIAR;2184;84402;21/1/2001 16:51:00;CIDADAO COMUM;N;;CAETANO FURQUIM;BH;616305.52;798833.55;968
-970;2001039818;B06000;LESAO CORPORAL;RUA FRANCISCO DU;247;46316;21/1/2001 17:29:00;CIDADAO COMUM;N;;SANTA TEREZINHA;BH;604462.79;802286.77;969
-971;2001039821;B06000;LESAO CORPORAL;RUA DOS COMANCHE;717;16367;21/1/2001 17:29:00;CIDADAO COMUM;S;;ITAMARATI;BH;606559.95;807215.50;970
-972;2001039827;B03000;AMEACA;RUA DAS PETUNIAS;1055;11870;21/1/2001 17:34:00;CIDADAO COMUM;S;;LINDEIA;BH;598670.92;790714.72;971
-973;2001039840;B06000;LESAO CORPORAL;RUA SAO SEBASTIA;11;170227;21/1/2001 17:37:00;CIDADAO COMUM;N;;CABANA;BH;604747.07;794381.91;972
-974;2001039862;B06000;LESAO CORPORAL;AV SINFRONIO BRO;1355;66116;21/1/2001 17:49:00;CIDADAO COMUM;S;;BARREIRO;BH;602021.17;790667.36;973
-975;2001039880;B03000;AMEACA;RUA NATIVIDADE;36;96641;21/1/2001 17:57:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605991.69;792207.10;974
-976;2001039932;B06000;LESAO CORPORAL;RUA CARTAGENA;154;62257;21/1/2001 18:26:00;CIDADAO COMUM;S;LJA;TREVO;BH;604055.51;805882.78;975
-977;2001039939;B06000;LESAO CORPORAL;AV BRAULIO GOMES;448;81710;21/1/2001 18:24:00;CIDADAO COMUM;N;;ITAIPU BH;BH;600487.50;789975.51;976
-978;2001039961;B03000;AMEACA;RUA PADRE GERALD;28;79840;21/1/2001 18:40:00;CIDADAO COMUM;N;0;MAGNESITA;BH;604349.31;793797.91;977
-979;2001039979;B02000;RIXA;RUA OSCAR CORREI;185;50440;21/1/2001 18:49:00;CIDADAO COMUM;S;;FLORAMAR;BH;611918.19;806355.64;978
-980;2001040002;B03000;AMEACA;RUA ANTONIO PRET;39;4780;21/1/2001 18:58:00;CIDADAO COMUM;N;;ALIPIO DE MELO;BH;604937.08;798863.96;979
-981;2001040030;B06000;LESAO CORPORAL;RUA MARIA MARTIN;1807;44248;21/1/2001 19:14:00;CIDADAO COMUM;N;CAB;SAGRADA FAMILIA;BH;613531.45;799029.43;980
-982;2001040101;B03000;AMEACA;RUA COMENDADOR W;472;16430;21/1/2001 19:48:00;INICIATIVA;S;0;SAO TOMAZ;BH;610078.75;805261.96;981
-983;2001040108;B03000;AMEACA;RUA DA CONSTITUI;26;102368;21/1/2001 19:51:00;CIDADAO COMUM;N;FU;CEU AZUL;BH;604159.50;807833.29;982
-984;2001040115;B04001;HOMICIDIO TENTAD;RUA FATIMA SIMOE;63;117205;21/1/2001 19:56:00;CIDADAO COMUM;N;0;CAPITAO EDUARDO;BH;618273.92;806536.95;983
-985;2001040172;B04001;HOMICIDIO TENTAD;RUA SOARES DO CO;54;66217;21/1/2001 20:27:00;CIDADAO COMUM;N;;VILA PARIS;BH;609894.39;793593.43;984
-986;2001040193;B06000;LESAO CORPORAL;RUA JANUARIA MAR;55;85418;21/1/2001 20:36:00;CIDADAO COMUM;S;;SERRA VERDE;BH;608917.00;810389.06;985
-987;2001040195;B03000;AMEACA;RUA STA DOROTEIA;30;60500;21/1/2001 20:37:00;CIDADAO COMUM;S;CAB;SAO GABRIEL;BH;613919.00;804270.30;986
-988;2001040271;B03000;AMEACA;RUA JOSEFINA FIR;133;98690;21/1/2001 21:08:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;607149.10;810079.48;987
-989;2001040294;B06000;LESAO CORPORAL;RUA DOS INDEPEND;258;109165;21/1/2001 21:19:00;CIDADAO COMUM;S;0;VILA SANTA RITA;BH;601157.29;787604.80;988
-990;2001040385;B06000;LESAO CORPORAL;RUA OCIDENTAL;532;73903;21/1/2001 22:05:00;CIDADAO COMUM;S;0;SERRANO;BH;603644.31;800551.97;989
-991;2001040488;B03000;AMEACA;AV SILVA GUIMARA;20;65863;21/1/2001 23:12:00;INICIATIVA;N;0;ITAIPU BH;BH;598818.25;789175.63;990
-992;2001040505;B06000;LESAO CORPORAL;RUA BEZERRA DE M;131;9525;21/1/2001 23:22:00;CIDADAO COMUM;S;CAA;NAZARE;BH;615459.45;804541.73;991
-993;2001040518;B04001;HOMICIDIO TENTAD;RUA SESSENTA E O;359;106066;21/1/2001 23:28:00;CIDADAO COMUM;N;FU;TOPAZIO;BH;607584.58;812106.94;992
-994;2001040568;B03000;AMEACA;RUA ENGENHO DO C;154;94586;22/1/2001 00:04:00;CIDADAO COMUM;S;;ENGENHO NOGUEIRA;BH;606492.27;800416.82;993
-995;2001040585;B03000;AMEACA;RUA PINTOR AUGUS;20;128091;22/1/2001 00:13:00;CIDADAO COMUM;S;CSA;TUPI;BH;613230.05;805854.87;994
-996;2001040597;B04001;HOMICIDIO TENTAD;RUA JAGUARIBE;71;36822;22/1/2001 00:28:00;CIDADAO COMUM;S;;CONCORDIA;BH;610604.19;799503.99;995
-997;2001040609;B06000;LESAO CORPORAL;RUA BEIRA LINHA;188;121732;22/1/2001 00:42:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615463.61;805379.11;996
-998;2001040618;B03000;AMEACA;RUA LAURO GOMES ;128;64845;22/1/2001 00:51:00;CIDADAO COMUM;S;AP2;DOM JOAQUIM;BH;613776.69;801526.10;997
-999;2001040661;B08000;VIOLACAO DE DOMI;RUA MADALENA;315;42315;22/1/2001 01:16:00;CIDADAO COMUM;N;0;SENHOR BOM JESUS;BH;609692.90;799840.91;998
-1000;2001040696;B04001;HOMICIDIO TENTAD;AV BERNARDO VASC;1172;9411;22/1/2001 01:57:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610951.68;801058.28;999
-1001;2001040802;B06000;LESAO CORPORAL;RUA SAO JOAQUIM;698;62940;22/1/2001 04:24:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613152.40;799476.16;1000
-1002;2001041104;B03000;AMEACA;AV AFONSO PENA;867;1259;22/1/2001 10:15:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611254.14;797008.25;1001
-1003;2001041109;B06000;LESAO CORPORAL;RUA VIOLETA;596;73074;22/1/2001 10:16:00;CIDADAO COMUM;S;;ESPLANADA;BH;614632.06;798499.76;1002
-1004;2001041181;B06000;LESAO CORPORAL;RUA MARIA ANTONI;123;15730;22/1/2001 11:21:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608281.16;808228.73;1003
-1005;2001041191;B03000;AMEACA;AV AFONSO PENA;571;1259;22/1/2001 11:27:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611120.69;797250.44;1004
-1006;2001041277;B09000;ABANDONO DE INCA;RUA GAMA CERQUEI;840;30564;22/1/2001 12:31:00;CIDADAO COMUM;N;;JARDIM AMERICA;BH;607374.14;794959.39;1005
-1007;2001041394;B03000;AMEACA;RUA DONA VIRGINI;110;23054;22/1/2001 14:11:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606564.90;797958.84;1006
-1008;2001041412;B03000;AMEACA;RUA GALDINO;18;75590;22/1/2001 14:27:00;CIDADAO COMUM;S;;LINDEIA;BH;599722.92;790847.61;1007
-1009;2001041423;B03000;AMEACA;RUA JOAQUIM DE F;1313;38033;22/1/2001 14:35:00;INICIATIVA;S;0;SANTA HELENA (BH;BH;603050.87;790075.16;1008
-1010;2001041519;B03000;AMEACA;RUA LICINIO PORT;28;20434;22/1/2001 15:43:00;CIDADAO COMUM;S;;TIROL;BH;599792.31;789385.84;1009
-1011;2001041545;B04001;HOMICIDIO TENTAD;RUA ICO;130;34020;22/1/2001 15:57:00;CIDADAO COMUM;S;;SAUDADE;BH;615033.00;797538.06;1010
-1012;2001041573;B03000;AMEACA;RUA MORRINHOS;397;46808;22/1/2001 16:08:00;CIDADAO COMUM;N;0;CAETANO FURQUIM;BH;616540.30;798975.24;1011
-1013;2001041608;B03000;AMEACA;RUA TUCUMAN;40;69823;22/1/2001 16:31:00;INICIATIVA;N;0;SAO GERALDO;BH;614856.59;799413.07;1012
-1014;2001041799;B06000;LESAO CORPORAL;RUA COVA IRIA;406;120972;22/1/2001 18:21:00;CIDADAO COMUM;N;;MARIA HELENA;BH;605238.63;810733.95;1013
-1015;2001041803;B06000;LESAO CORPORAL;RUA TREZE DE SET;266;69168;22/1/2001 18:23:00;CIDADAO COMUM;N;;LEONINA;BH;608522.06;793376.97;1014
-1016;2001041831;B03000;AMEACA;RUA MARCIA WINDS;82;21478;22/1/2001 18:35:00;CIDADAO COMUM;S;;MINEIRAO;BH;601800.40;785099.89;1015
-1017;2001041843;B04001;HOMICIDIO TENTAD;RUA CURITIBA;685;19090;22/1/2001 18:40:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610868.54;797204.70;1016
-1018;2001041890;B03000;AMEACA;RUA ENGENHO DO S;713;80427;22/1/2001 19:04:00;INICIATIVA;N;;ENGENHO NOGUEIRA;BH;606348.11;800172.67;1017
-1019;2001041907;B03000;AMEACA;RUA MINISTRO OLI;531;46619;22/1/2001 19:12:00;INICIATIVA;S;0;SANTA MONICA;BH;607645.48;807903.83;1018
-1020;2001041917;B06000;LESAO CORPORAL;RUA DOM LUCIO AN;892;22382;22/1/2001 19:17:00;CIDADAO COMUM;S;AP 204;CORACAO EUCARIST;BH;605491.73;796342.06;1019
-1021;2001042143;B04001;HOMICIDIO TENTAD;BECO SAO PAULO;5;301199;22/1/2001 21:21:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610955.63;793472.49;1020
-1022;2001042149;B04002;HOMICIDIO CONSUM;RUA CORONEL ANTO;182;17590;22/1/2001 21:24:00;INICIATIVA;N;0;JARDIM LEBLON;BH;606140.28;807563.65;1021
-1023;2001042224;B03000;AMEACA;RUA VEREADOR ORL;259;71573;22/1/2001 22:12:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;603777.40;792859.37;1022
-1024;2001042265;B04001;HOMICIDIO TENTAD;AV MENELICK DE C;386;30448;22/1/2001 22:36:00;INICIATIVA;N;0;FLAVIO MARQUES D;BH;604597.26;788928.08;1023
-1025;2001042338;B03000;AMEACA;RUA CACONDE;109;11275;22/1/2001 23:32:00;CIDADAO COMUM;S;;NOVA FLORESTA;BH;611770.35;800238.44;1024
-1026;2001042371;B06000;LESAO CORPORAL;RODOVIA MG 20;17;26620;22/1/2001 23:58:00;INICIATIVA;S;0;BELO HORIZONTE (;BH;614269.93;806003.75;1025
-1027;2001042380;B04002;HOMICIDIO CONSUM;BECO PRINCIPAL;5;301983;23/1/2001 00:09:00;CIDADAO COMUM;N;0;SAO JOSE;BH;604808.72;799278.97;1026
-1028;2001042402;B04001;HOMICIDIO TENTAD;RUA DAS GAIVOTAS;778;30450;23/1/2001 00:19:00;CIDADAO COMUM;S;;VILA CLORIS;BH;611033.72;807691.96;1027
-1029;2001042428;B06000;LESAO CORPORAL;RUA TIZIU;66;95881;23/1/2001 00:34:00;CIDADAO COMUM;N;LJ;GOIANIA;BH;615310.05;802956.29;1028
-1030;2001042441;B03000;AMEACA;RUA PAGEU;200;51818;23/1/2001 00:43:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611061.99;798954.74;1029
-1031;2001042563;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;369;17095;23/1/2001 02:54:00;INICIATIVA;N;0;FLORESTA;BH;612011.55;797008.04;1030
-1032;2001042583;B08000;VIOLACAO DE DOMI;RUA ROBERTO BARB;16;94053;23/1/2001 03:29:00;INICIATIVA;N;0;CARDOSO;BH;603859.19;788590.10;1031
-1033;2001042596;B06000;LESAO CORPORAL;RUA NELSON HUNGR;10;46634;23/1/2001 03:47:00;CIDADAO COMUM;N;;TUPI;BH;612851.92;806239.44;1032
-1034;2001042696;B03000;AMEACA;RUA FLOR DE VIDR;310;13504;23/1/2001 07:32:00;CIDADAO COMUM;N;0;CASTELO;BH;605657.99;799640.71;1033
-1035;2001042742;B06000;LESAO CORPORAL;RUA RAVENA;179;58048;23/1/2001 08:14:00;CIDADAO COMUM;S;;NOVA VISTA;BH;614868.70;800661.13;1034
-1036;2001042783;B06000;LESAO CORPORAL;RUA CONDOR;405;16773;23/1/2001 08:49:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605871.88;793840.52;1035
-1037;2001042838;B06000;LESAO CORPORAL;RUA JOAO PAULO I;220;300458;23/1/2001 09:26:00;CIDADAO COMUM;N;;SAO DOMINGOS;BH;607666.14;793505.29;1036
-1038;2001042899;B03000;AMEACA;AV PRESIDENTE AN;3333;4461;23/1/2001 10:14:00;INICIATIVA;N;0;CACHOEIRINHA;BH;609867.68;801202.75;1037
-1039;2001043019;B03000;AMEACA;RUA ALVARO ALVIM;15;103490;23/1/2001 11:32:00;CIDADAO COMUM;S;;CAICARA;BH;607829.25;800104.71;1038
-1040;2001043064;B03000;AMEACA;RUA CHAFARIZ;111;300275;23/1/2001 12:07:00;CIDADAO COMUM;N;;HAVAI;BH;607375.81;793751.13;1039
-1041;2001043148;B06000;LESAO CORPORAL;AV CRISTIANO MAC;7020;18652;23/1/2001 13:14:00;CIDADAO COMUM;S;;VILA SUZANA;BH;612053.97;803296.28;1040
-1042;2001043181;B06000;LESAO CORPORAL;RUA DOUTOR SETTE;396;23662;23/1/2001 13:45:00;CIDADAO COMUM;S;AP402;LUXEMBURGO;BH;609314.30;794473.59;1041
-1043;2001043201;B03000;AMEACA;RUA DOS TIMBIRAS;1350;67682;23/1/2001 13:56:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611415.81;796238.60;1042
-1044;2001043276;B03000;AMEACA;RUA CAMAPUAN;200;11726;23/1/2001 14:50:00;CIDADAO COMUM;S;AP503;ALTO BARROCA;BH;607974.18;795648.55;1043
-1045;2001043278;B03000;AMEACA;RUA DOS TAMOIOS;486;66825;23/1/2001 14:51:00;INICIATIVA;S;PX438;CENTRO (BH);BH;610901.10;797097.30;1044
-1046;2001043312;B03000;AMEACA;RUA FRANCISCO MA;420;56824;23/1/2001 15:16:00;INICIATIVA;S;0;ESTRELA DALVA;BH;607428.83;792074.36;1045
-1047;2001043368;B06000;LESAO CORPORAL;RUA JEQUIA;270;37245;23/1/2001 15:50:00;CIDADAO COMUM;N;CAFR;SAO CRISTOVAO;BH;610642.51;799757.02;1046
-1048;2001043397;B06000;LESAO CORPORAL;AV JOSE RACHEL D;130;85912;23/1/2001 16:05:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;616924.95;804830.32;1047
-1049;2001043531;B03000;AMEACA;RUA FORMIGA;431;29136;23/1/2001 17:33:00;CIDADAO COMUM;S;;LAGOINHA;BH;610642.40;798955.21;1048
-1050;2001043533;B03000;AMEACA;RUA CONGONHAL;50;82955;23/1/2001 17:35:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604214.03;802374.59;1049
-1051;2001043541;B06000;LESAO CORPORAL;RUA SAO BENTO;1862;127801;23/1/2001 17:41:00;CIDADAO COMUM;S;;INSTITUTO AGRONO;BH;613806.19;798841.38;1050
-1052;2001043682;B06000;LESAO CORPORAL;RUA VENEZA;16;71444;23/1/2001 18:55:00;CIDADAO COMUM;S;B;NOVA SUISSA;BH;607426.53;795521.26;1051
-1053;2001043765;B03000;AMEACA;RUA DOS JES;158;37333;23/1/2001 19:45:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;607044.75;807302.74;1052
-1054;2001043807;B03000;AMEACA;RUA JAIME GOMES;40;36835;23/1/2001 20:20:00;CIDADAO COMUM;S;;FLORESTA;BH;612185.31;798118.31;1053
-1055;2001043817;B03000;AMEACA;RUA CASTELO BRAN;70;14030;23/1/2001 20:24:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604435.67;802549.95;1054
-1056;2001043831;B06000;LESAO CORPORAL;AV OTACILIO NEGR;3400;50566;23/1/2001 20:40:00;CIDADAO COMUM;S;;SAO LUIZ;BH;606628.37;803745.77;1055
-1057;2001043837;B03000;AMEACA;RUA BENJAMIM QUA;133;9210;23/1/2001 20:43:00;CIDADAO COMUM;S;0;PARAISO;BH;614517.71;797103.48;1056
-1058;2001043854;B03000;AMEACA;RUA GASPARINO CA;277;114903;23/1/2001 20:53:00;INICIATIVA;S;0;PAQUETA;BH;605422.28;802400.54;1057
-1059;2001043896;B03000;AMEACA;RUA MANOEL CAYLL;160;43043;23/1/2001 21:26:00;CIDADAO COMUM;S;AP102;HORTO;BH;613298.53;798204.06;1058
-1060;2001043949;B06000;LESAO CORPORAL;RUA CHAFARIZ;40;300275;23/1/2001 21:55:00;CIDADAO COMUM;N;CAB;HAVAI;BH;607407.04;793804.07;1059
-1061;2001044015;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;1122;6731;23/1/2001 22:44:00;CIDADAO COMUM;N;BLJ     AP301;BARRO PRETO;BH;610255.53;796843.17;1060
-1062;2001044020;B06000;LESAO CORPORAL;RUA CARAVELAS;410;13141;23/1/2001 22:49:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615549.03;798247.68;1061
-1063;2001044040;B03000;AMEACA;RUA YARA LUCIA;44;33777;23/1/2001 23:01:00;CIDADAO COMUM;S;PX30;NOVA CINTRA;BH;606182.82;793671.01;1062
-1064;2001044084;B06000;LESAO CORPORAL;RUA IBITIRA;228;33940;23/1/2001 23:33:00;CIDADAO COMUM;S;CAA;VILA MARAVILHAS;BH;602921.19;795334.48;1063
-1065;2001044123;B06000;LESAO CORPORAL;RUA STA CLAUDIA;246;60453;24/1/2001 00:05:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604414.90;789230.99;1064
-1066;2001044126;B06000;LESAO CORPORAL;AV VILARINHOS;530;109988;24/1/2001 00:06:00;CIDADAO COMUM;N;0;VENDA NOVA;BH;609120.91;808971.44;1065
-1067;2001044157;B03000;AMEACA;RUA CAETANO PIRR;465;45773;24/1/2001 00:35:00;CIDADAO COMUM;S;A;MILIONARIOS;BH;604038.30;790103.10;1066
-1068;2001044174;B06000;LESAO CORPORAL;RUA VINTE E UM D;7;72286;24/1/2001 00:51:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610893.23;797841.46;1067
-1069;2001044311;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;876;6731;24/1/2001 03:44:00;INICIATIVA;N;0;CENTRO (BH);BH;610565.57;796755.00;1068
-1070;2001044359;B04001;HOMICIDIO TENTAD;RUA DAS PERPETUA;615;911;24/1/2001 05:08:00;CIDADAO COMUM;N;;LINDEIA;BH;599593.30;790595.60;1069
-1071;2001044716;B04002;HOMICIDIO CONSUM;RUA CACHOEIRA DE;10;11247;24/1/2001 11:00:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;609110.10;794267.00;1070
-1072;2001044993;B03000;AMEACA;AV AMAZONAS;3034;3140;24/1/2001 14:35:00;CIDADAO COMUM;S;0;GUTIERREZ;BH;608815.11;795984.84;1071
-1073;2001045017;B03000;AMEACA;RUA JOSE LAVARIN;232;40537;24/1/2001 14:53:00;CIDADAO COMUM;S;FU;PARAISO;BH;614298.37;796663.19;1072
-1074;2001045143;B03000;AMEACA;RUA ITAIPU;1149;35439;24/1/2001 15:54:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616346.43;797993.47;1073
-1075;2001045149;B03000;AMEACA;RUA LEONCIO CHAG;214;40700;24/1/2001 15:55:00;CIDADAO COMUM;N;0;UNIAO;BH;613047.37;800965.00;1074
-1076;2001045158;B06000;LESAO CORPORAL;RUA AMERICO SCOT;53;3342;24/1/2001 16:01:00;CIDADAO COMUM;S;;SERRA;BH;612638.54;795565.51;1075
-1077;2001045167;B03000;AMEACA;RUA FERNAO DIAS;80;28133;24/1/2001 16:04:00;CIDADAO COMUM;S;0;CASA BRANCA;BH;615915.15;798840.47;1076
-1078;2001045249;B06000;LESAO CORPORAL;RUA FELISBURGO;108;3950;24/1/2001 16:46:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612659.95;804501.51;1077
-1079;2001045290;B03000;AMEACA;RUA PEDRO GLANSM;120;53044;24/1/2001 17:14:00;CIDADAO COMUM;S;0;INDUSTRIAL RODRI;BH;615927.58;808718.47;1078
-1080;2001045375;B06000;LESAO CORPORAL;RUA GUARATINGUET;24;32295;24/1/2001 18:01:00;CIDADAO COMUM;N;CAFU;GUARANI;BH;612687.54;805517.29;1079
-1081;2001045377;B06000;LESAO CORPORAL;RUA GUARARAPES;22;32241;24/1/2001 18:01:00;CIDADAO COMUM;S;;GLORIA;BH;603926.83;798914.01;1080
-1082;2001045445;B03000;AMEACA;AV ASSIS CHATEAU;176;6353;24/1/2001 18:40:00;CIDADAO COMUM;S;;FLORESTA;BH;612121.94;797426.16;1081
-1083;2001045543;B04001;HOMICIDIO TENTAD;RUA SOLIMOES;172;66273;24/1/2001 19:22:00;CIDADAO COMUM;S;;CABANA;BH;604623.34;794561.91;1082
-1084;2001045631;B03000;AMEACA;RUA DEZOITO;25;80225;24/1/2001 20:15:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605387.77;793337.29;1083
-1085;2001045633;B06000;LESAO CORPORAL;RUA RUBIO FERREI;124;56373;24/1/2001 20:16:00;CIDADAO COMUM;N;FU;TIROL;BH;599909.18;789518.18;1084
-1086;2001045730;B03000;AMEACA;RUA CARMEM;117;100407;24/1/2001 21:14:00;CIDADAO COMUM;N;;SANTA MONICA DO ;BH;606236.18;808762.74;1085
-1087;2001045738;B03000;AMEACA;RUA PADRE PEDRO ;175;51657;24/1/2001 21:19:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;1086
-1088;2001045757;B03000;AMEACA;RUA T;171;78456;24/1/2001 21:31:00;CIDADAO COMUM;N;;VILA PINHO;BH;602287.09;787641.67;1087
-1089;2001045759;B04001;HOMICIDIO TENTAD;RUA VERA LUCIA;100;71520;24/1/2001 21:29:00;CIDADAO COMUM;N;HOSP. DOM BOSCO;SINIMBU;BH;606759.42;808149.86;1088
-1090;2001045797;B03000;AMEACA;RUA CORREGO DA M;175;18160;24/1/2001 21:53:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613008.28;798049.61;1089
-1091;2001045827;B06000;LESAO CORPORAL;RUA COLUNA PREST;509;16354;24/1/2001 22:16:00;INICIATIVA;N;0;PROVIDENCIA;BH;612375.03;803902.06;1090
-1092;2001045847;B09000;ABANDONO DE INCA;RUA DOS GUARANIS;527;32181;24/1/2001 22:27:00;CIDADAO COMUM;S;PX527;CENTRO (BH);BH;610657.75;797116.77;1091
-1093;2001045864;B04001;HOMICIDIO TENTAD;RUA CINCO;140;78037;24/1/2001 22:35:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;601574.18;786072.51;1092
-1094;2001045905;B03000;AMEACA;RUA MADRE ISABEL;130;120768;24/1/2001 22:56:00;POLICIAL MILITAR;N;0;SAO GERALDO;BH;616215.65;799943.84;1093
-1095;2001045932;B03000;AMEACA;RUA DES BRAULIO;1553;19917;24/1/2001 23:15:00;INICIATIVA;N;0;VERA CRUZ;BH;616310.09;797705.61;1094
-1096;2001045960;B06000;LESAO CORPORAL;RUA ANTONIO FALA;441;82930;24/1/2001 23:33:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603894.24;802156.28;1095
-1097;2001045965;B03000;AMEACA;RUA ONZE DE DEZE;93;112687;24/1/2001 23:39:00;CIDADAO COMUM;S;0;LEONINA;BH;608748.36;793528.53;1096
-1098;2001046114;B03000;AMEACA;AV SERRANA;530;65040;25/1/2001 01:36:00;CIDADAO COMUM;N;;SERRANO;BH;603547.03;801432.44;1097
-1099;2001046127;B03000;AMEACA;RUA JOSE MOREIRA;409;55368;25/1/2001 01:44:00;CIDADAO COMUM;S;FU;SAO MARCOS;BH;614431.87;802397.68;1098
-1100;2001046164;B03000;AMEACA;RUA JORNALISTA O;252;53057;25/1/2001 02:24:00;CIDADAO COMUM;S;;EYMARD;BH;613619.32;803624.62;1099
-1101;2001046236;B06000;LESAO CORPORAL;RUA SETIBA;221;32314;25/1/2001 03:52:00;CIDADAO COMUM;S;0;IPANEMA;BH;604627.33;798423.60;1100
-1102;2001046241;B06000;LESAO CORPORAL;RUA DOS CHILENOS;101;15188;25/1/2001 04:03:00;CIDADAO COMUM;N;;GORDURAS;BH;616531.80;804343.27;1101
-1103;2001046501;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;322;51657;25/1/2001 09:30:00;CIDADAO COMUM;S;0;VILA SANTO ANTON;BH;609650.08;808286.90;1102
-1104;2001046539;B08000;VIOLACAO DE DOMI;RUA POUSO ALEGRE;2486;54932;25/1/2001 09:55:00;CIDADAO COMUM;N;;FLORESTA;BH;613399.86;798014.09;1103
-1105;2001046563;B06000;LESAO CORPORAL;RUA PONTALINA;151;57640;25/1/2001 10:09:00;CIDADAO COMUM;S;;CH CELSO MACHADO;BH;603970.94;801060.78;1104
-1106;2001046593;B06000;LESAO CORPORAL;RUA JUIZ MILTON ;34;78342;25/1/2001 10:32:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614919.77;806285.93;1105
-1107;2001046600;B06000;LESAO CORPORAL;RUA ROMUALDO DIA;291;78705;25/1/2001 10:38:00;CIDADAO COMUM;N;REF:MERCEARIA DO;CH JATOBA IV;BH;600109.79;787826.40;1106
-1108;2001046621;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;1700;57830;25/1/2001 10:54:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;608719.62;793771.09;1107
-1109;2001046625;B03000;AMEACA;RUA AVENTINO;247;7025;25/1/2001 10:57:00;CIDADAO COMUM;N;CAB;GLORIA;BH;604050.11;798085.79;1108
-1110;2001046635;B03000;AMEACA;RUA JOAO PAULO I;175;300458;25/1/2001 11:07:00;CIDADAO COMUM;S;;SAO DOMINGOS;BH;607677.28;793509.05;1109
-1111;2001046745;B06000;LESAO CORPORAL;RUA BELEM DE JUD;287;124797;25/1/2001 12:25:00;CIDADAO COMUM;N;;CRISTO REDENTOR;BH;604914.21;790484.26;1110
-1112;2001046764;B03000;AMEACA;RUA DOZE DE MAIO;89;24072;25/1/2001 12:43:00;CIDADAO COMUM;S;;LEONINA;BH;608268.84;793457.66;1111
-1113;2001046785;B03000;AMEACA;RUA OTAVIANO PEN;270;128454;25/1/2001 12:57:00;CIDADAO COMUM;S;AP204;SERRA VERDE;BH;609633.96;810676.53;1112
-1114;2001046824;B06000;LESAO CORPORAL;RUA JOAQUIM ANAC;23;118932;25/1/2001 13:19:00;INICIATIVA;N;0;TEIXEIRA DIAS;BH;603052.88;789295.61;1113
-1115;2001046834;B03000;AMEACA;RUA DOS CAETES;323;11376;25/1/2001 13:28:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611304.85;797393.25;1114
-1116;2001046851;B03000;AMEACA;RUA GABRO;379;30435;25/1/2001 13:39:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612925.79;797244.47;1115
-1117;2001046948;B04001;HOMICIDIO TENTAD;AV NOSSA SENHORA;1719;47996;25/1/2001 14:44:00;INICIATIVA;S;0;SAO PEDRO;BH;611051.04;793277.57;1116
-1118;2001047162;B04001;HOMICIDIO TENTAD;RUA QUATRO DE JU;40;170910;25/1/2001 16:52:00;CIDADAO COMUM;N;;LEONINA;BH;608611.71;793487.56;1117
-1119;2001047229;B06000;LESAO CORPORAL;RUA SERENATA;237;172351;25/1/2001 17:21:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614290.56;795445.06;1118
-1120;2001047233;B06000;LESAO CORPORAL;RUA JOAQUIM ASSI;140;92679;25/1/2001 17:23:00;CIDADAO COMUM;S;;CALIFORNIA;BH;603481.98;796969.02;1119
-1121;2001047329;B03000;AMEACA;RUA JOAQUIM DE F;1313;38033;25/1/2001 18:20:00;CIDADAO COMUM;S;;SANTA HELENA (BH;BH;603050.87;790075.16;1120
-1122;2001047383;B06000;LESAO CORPORAL;AV BIAS FORTES;161;9553;25/1/2001 18:46:00;CIDADAO COMUM;S;PX400;LOURDES;BH;610994.27;795773.90;1121
-1123;2001047430;B03000;AMEACA;RUA FARMACEUTICO;400;70426;25/1/2001 19:07:00;CIDADAO COMUM;S;0;CANDELARIA;BH;607825.43;809110.55;1122
-1124;2001047502;B04002;HOMICIDIO CONSUM;RUA GRAUNAS;181;31797;25/1/2001 19:49:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;605268.99;788621.91;1123
-1125;2001047511;B03000;AMEACA;RUA POLONIA;51;54541;25/1/2001 19:57:00;CIDADAO COMUM;N;;COPACABANA;BH;605659.23;806545.79;1124
-1126;2001047531;B03000;AMEACA;RUA HELE AMARAL ;45;112747;25/1/2001 20:04:00;CIDADAO COMUM;N;FU;SAO MARCOS;BH;614384.96;802750.10;1125
-1127;2001047634;B04001;HOMICIDIO TENTAD;RUA ALVARO FERRE;75;113591;25/1/2001 21:08:00;CIDADAO COMUM;S;0;JARDIM EUROPA;BH;608159.91;810568.87;1126
-1128;2001047641;B06000;LESAO CORPORAL;RUA ALTEROSA;5;26138;25/1/2001 21:13:00;CIDADAO COMUM;N;0;TAQUARIL;BH;617385.86;797791.56;1127
-1129;2001047653;B04001;HOMICIDIO TENTAD;AV A;270;302850;25/1/2001 21:18:00;INICIATIVA;S;0;GUARANI;BH;613784.86;805457.10;1128
-1130;2001047663;B03000;AMEACA;RUA MALMEQUER;421;42687;25/1/2001 21:23:00;CIDADAO COMUM;N;CA1;LINDEIA;BH;599129.73;791104.90;1129
-1131;2001047717;B03000;AMEACA;RUA MARIA LETICI;205;126780;25/1/2001 21:57:00;CIDADAO COMUM;S;0;DAS INDUSTRIAS;BH;605272.86;790815.43;1130
-1132;2001047724;B04001;HOMICIDIO TENTAD;RUA MANOEL TAVAR;402;1536;25/1/2001 22:05:00;CIDADAO COMUM;S;;GOIANIA;BH;614972.82;802744.77;1131
-1133;2001047745;B06000;LESAO CORPORAL;RUA ROSA CRUZ;255;59283;25/1/2001 22:20:00;CIDADAO COMUM;S;CSB;BOA VISTA;BH;616069.21;799968.25;1132
-1134;2001047758;B06000;LESAO CORPORAL;PRACA ITAPIRA;10;35845;25/1/2001 22:24:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616265.14;798905.89;1133
-1135;2001047775;B06000;LESAO CORPORAL;AV DOUTOR CRISTI;2300;62459;25/1/2001 22:35:00;CIDADAO COMUM;S;0;ITAPOA;BH;609779.66;806002.26;1134
-1136;2001047781;B04001;HOMICIDIO TENTAD;RUA JUATUBA;42;39367;25/1/2001 22:41:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;605262.83;793420.62;1135
-1137;2001047808;B06000;LESAO CORPORAL;RUA MARIA IZABEL;106;107900;25/1/2001 22:57:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606572.69;811478.62;1136
-1138;2001048040;B03000;AMEACA;AV BRASIL;248;10420;26/1/2001 00:54:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;612792.45;796553.47;1137
-1139;2001048067;B06000;LESAO CORPORAL;AV VILARINHOS;1551;109988;26/1/2001 01:13:00;CIDADAO COMUM;S;;VENDA NOVA;BH;608767.45;809004.21;1138
-1140;2001048096;B04002;HOMICIDIO CONSUM;AV A;213;302850;26/1/2001 01:43:00;CIDADAO COMUM;S;;GUARANI;BH;613831.79;805433.00;1139
-1141;2001048120;B06000;LESAO CORPORAL;AV OLEGARIO MACI;228;49699;26/1/2001 02:09:00;INICIATIVA;S;0;CENTRO (BH);BH;610607.36;797465.13;1140
-1142;2001048142;B06000;LESAO CORPORAL;RUA SAO FELIPE;282;62386;26/1/2001 02:23:00;CIDADAO COMUM;N;0;SAGRADA FAMILIA;BH;613372.54;798722.04;1141
-1143;2001048268;B05000;SEQUESTRO E CARC;RUA PLATINA;1328;54453;26/1/2001 04:47:00;CIDADAO COMUM;S;FR1328;CALAFATE;BH;607876.92;796707.40;1142
-1144;2001048271;B03000;AMEACA;AV BRASIL;248;10420;26/1/2001 04:55:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;612792.45;796553.47;1143
-1145;2001048331;B06000;LESAO CORPORAL;RUA JOAQUIM DE P;1000;38147;26/1/2001 06:39:00;CIDADAO COMUM;N;;ALIPIO DE MELO;BH;604681.70;799201.87;1144
-1146;2001048348;B03000;AMEACA;RUA PROFESSOR AI;700;72608;26/1/2001 06:59:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608615.33;807850.01;1145
-1147;2001048563;B06000;LESAO CORPORAL;AV CRISTIANO MAC;2062;18652;26/1/2001 09:33:00;CIDADAO COMUM;N;0;CIDADE NOVA;BH;612189.85;800428.05;1146
-1148;2001048708;B03000;AMEACA;RUA ITARARE;217;35959;26/1/2001 11:06:00;CIDADAO COMUM;S;;CONCORDIA;BH;610928.47;799185.62;1147
-1149;2001048858;B04001;HOMICIDIO TENTAD;RUA JOSE LAVARIN;245;40537;26/1/2001 13:06:00;CIDADAO COMUM;S;;PARAISO;BH;614324.25;796702.92;1148
-1150;2001048874;B04002;HOMICIDIO CONSUM;RUA MONTEIRO LOB;241;46590;26/1/2001 13:13:00;CIDADAO COMUM;N;0;JATOBA;IB;598882.79;789573.14;1149
-1151;2001048894;B06000;LESAO CORPORAL;AV AFONSO PENA;464;1259;26/1/2001 13:22:00;INICIATIVA;S;0;CENTRO (BH);BH;611005.20;797320.30;1150
-1152;2001048910;B03000;AMEACA;RUA MANOEL DINIZ;17;43069;26/1/2001 13:34:00;CIDADAO COMUM;N;0;DOS PALMARES;BH;612125.79;802687.18;1151
-1153;2001048931;B03000;AMEACA;RUA MADRID;201;42403;26/1/2001 13:44:00;INICIATIVA;S;0;COPACABANA;BH;606232.37;806154.01;1152
-1154;2001048993;B03000;AMEACA;RUA AROEIRA NEVE;247;92423;26/1/2001 14:30:00;CIDADAO COMUM;S;CAFU;ALVARO CAMARGOS;BH;604010.44;797371.18;1153
-1155;2001049041;B03000;AMEACA;RUA DOUTOR ALIPI;502;2365;26/1/2001 15:03:00;CIDADAO COMUM;S;;CAFEZAL;BH;613838.04;794600.97;1154
-1156;2001049051;B06000;LESAO CORPORAL;AV DOM PEDRO II;4414;53145;26/1/2001 15:09:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606624.52;798141.20;1155
-1157;2001049190;B06000;LESAO CORPORAL;AV JOSE BONIFACI;90;38579;26/1/2001 16:26:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610155.34;799025.63;1156
-1158;2001049194;B03000;AMEACA;AV HENFIL;590;103550;26/1/2001 16:29:00;INICIATIVA;S;0;SARANDI (URCA/BH;BH;603609.38;801869.84;1157
-1159;2001049372;B06000;LESAO CORPORAL;AV AFONSO VAZ DE;1025;1306;26/1/2001 18:09:00;CIDADAO COMUM;S;0;BARREIRO;BH;602121.95;790867.83;1158
-1160;2001049375;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;23;6353;26/1/2001 18:11:00;CIDADAO COMUM;N;LJZZ;FLORESTA;BH;612282.71;797462.19;1159
-1161;2001049385;B06000;LESAO CORPORAL;RUA CAICARA;1387;11451;26/1/2001 18:15:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616156.88;799378.61;1160
-1162;2001049419;B04002;HOMICIDIO CONSUM;RUA FLOR DO BESO;240;28492;26/1/2001 18:35:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;605973.04;799060.82;1161
-1163;2001049457;B04002;HOMICIDIO CONSUM;RUA ARISTOLINO B;10;41089;26/1/2001 19:00:00;CIDADAO COMUM;N;REF:CASA NOVA;REGINA;BH;598834.62;789796.85;1162
-1164;2001049491;B06000;LESAO CORPORAL;RUA BEIRA ALTA;1036;62777;26/1/2001 19:18:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609649.09;802529.74;1163
-1165;2001049537;B03000;AMEACA;RUA CELIO CAUTIE;36;92612;26/1/2001 19:44:00;CIDADAO COMUM;S;;CALIFORNIA;BH;603380.35;796952.78;1164
-1166;2001049634;B03000;AMEACA;RUA RAMOS;79;57870;26/1/2001 20:46:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614428.82;802482.52;1165
-1167;2001049651;B04001;HOMICIDIO TENTAD;RUA SAO PAULO;365;90213;26/1/2001 20:54:00;CIDADAO COMUM;S;LJA;SARANDI (URCA/BH;BH;602814.92;802490.07;1166
-1168;2001049735;B03000;AMEACA;RUA JOAO PINTO;35;105542;26/1/2001 21:29:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;605029.47;794803.37;1167
-1169;2001049801;B06000;LESAO CORPORAL;RUA SERVIDAO;93;170201;26/1/2001 22:11:00;CIDADAO COMUM;N;0;CABANA;BH;604396.96;794232.57;1168
-1170;2001049808;B04001;HOMICIDIO TENTAD;RUA AMPERE;1;3484;26/1/2001 22:14:00;CIDADAO COMUM;N;CAB;PRIMEIRO DE MAIO;BH;612112.26;803408.93;1169
-1171;2001049828;B03000;AMEACA;RUA ANTONIO JUST;420;4648;26/1/2001 22:32:00;CIDADAO COMUM;S;;POMPEIA;BH;614843.56;798116.13;1170
-1172;2001049867;B03000;AMEACA;RUA RADIALISTA A;200;122398;26/1/2001 22:54:00;CIDADAO COMUM;N;CS03;CEU AZUL;BH;604585.98;808469.73;1171
-1173;2001049875;B03000;AMEACA;RUA MAYRINK;604;42573;26/1/2001 22:55:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;616305.86;799381.93;1172
-1174;2001049979;B08000;VIOLACAO DE DOMI;RUA FREI LUIZ DE;60;96540;26/1/2001 23:52:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614919.28;806533.15;1173
-1175;2001049987;B04001;HOMICIDIO TENTAD;RUA VINTE E UM D;7;72286;26/1/2001 23:55:00;INICIATIVA;N;0;CENTRO (BH);BH;610893.23;797841.46;1174
-1176;2001050074;B04001;HOMICIDIO TENTAD;RUA DOS COMANCHE;495;16367;27/1/2001 00:36:00;CIDADAO COMUM;S;0;ITAMARATI;BH;606692.45;806999.22;1175
-1177;2001050089;B06000;LESAO CORPORAL;RUA GABRO;310;30435;27/1/2001 00:49:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612866.12;797324.00;1176
-1178;2001050128;B03000;AMEACA;AV DO CONTORNO;10185;17228;27/1/2001 01:06:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;609218.63;797141.66;1177
-1179;2001050191;B04001;HOMICIDIO TENTAD;RUA DOS URUGUAIO;151;46710;27/1/2001 01:50:00;INICIATIVA;S;0;GORDURAS;BH;616632.70;804348.93;1178
-1180;2001050256;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;35;26052;27/1/2001 02:32:00;INICIATIVA;S;0;CENTRO (BH);BH;611414.93;797615.20;1179
-1181;2001050261;B04001;HOMICIDIO TENTAD;RUA ANTONIO TEIX;1223;119037;27/1/2001 02:33:00;CIDADAO COMUM;S;;TEIXEIRA DIAS;BH;602609.16;790019.78;1180
-1182;2001050273;B03000;AMEACA;RUA MIGUEL ABRAS;105;45698;27/1/2001 02:35:00;CIDADAO COMUM;S;AP301;SERRA;BH;612787.45;794670.58;1181
-1183;2001050281;B04001;HOMICIDIO TENTAD;RUA CARLOS SCHET;523;118771;27/1/2001 02:44:00;CIDADAO COMUM;N;;JARDINOPOLIS;BH;605039.83;794569.69;1182
-1184;2001050339;B03000;AMEACA;RUA CORONEL NEWT;520;124872;27/1/2001 03:22:00;CIDADAO COMUM;N;0;MANGUEIRAS;BH;600751.18;786764.27;1183
-1185;2001050341;B06000;LESAO CORPORAL;RUA DOS CAETES;920;11376;27/1/2001 03:23:00;INICIATIVA;S;0;CENTRO (BH);BH;610732.50;797574.81;1184
-1186;2001050377;B03000;AMEACA;RUA JOSE LEAL DO;71;110593;27/1/2001 03:50:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611585.51;807912.79;1185
-1187;2001050413;B06000;LESAO CORPORAL;RUA LAGOA DOS PA;145;40190;27/1/2001 04:18:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605885.22;807433.39;1186
-1188;2001050423;B06000;LESAO CORPORAL;RUA OURO PRETO;293;50730;27/1/2001 04:28:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;609961.08;797017.98;1187
-1189;2001050440;B02000;RIXA;RUA ANGATUBA;144;84368;27/1/2001 04:40:00;CIDADAO COMUM;S;;PIRATININGA;BH;605572.65;809065.32;1188
-1190;2001050455;B03000;AMEACA;RUA SAO TEOFILO;289;105441;27/1/2001 04:55:00;CIDADAO COMUM;N;;PAULO SEXTO;BH;616316.21;806468.17;1189
-1191;2001050466;B03000;AMEACA;RUA JOAO SAMAHA;261;7397;27/1/2001 05:06:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608633.12;807211.33;1190
-1192;2001050532;B03000;AMEACA;RUA WANDERSON BI;119;102080;27/1/2001 06:35:00;CIDADAO COMUM;N;FR;MINEIRAO;BH;601946.30;785457.99;1191
-1193;2001050545;B06000;LESAO CORPORAL;RUA SAO JOAQUIM;460;62940;27/1/2001 07:00:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612928.27;799516.16;1192
-1194;2001050551;B04002;HOMICIDIO CONSUM;RUA PLINIO TEIXE;61;98155;27/1/2001 07:07:00;CIDADAO COMUM;S;;DOM SILVERIO;BH;615265.19;804798.58;1193
-1195;2001050560;B04002;HOMICIDIO CONSUM;RUA ANDREQUICE;50;3888;27/1/2001 07:16:00;CIDADAO COMUM;N;;DOM CABRAL;BH;604920.41;797169.31;1194
-1196;2001050572;B06000;LESAO CORPORAL;RUA DOS TUPIS;212;69965;27/1/2001 07:33:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611089.79;796902.82;1195
-1197;2001050596;B03000;AMEACA;RUA REIS DE ABRE;340;63363;27/1/2001 07:48:00;CIDADAO COMUM;S;CAFU;APARECIDA SETIMA;BH;608643.80;800686.52;1196
-1198;2001050642;B08000;VIOLACAO DE DOMI;RUA LINCOLN;477;41136;27/1/2001 08:17:00;CIDADAO COMUM;N;;UNIAO;BH;612774.54;801729.46;1197
-1199;2001050646;B06000;LESAO CORPORAL;PRACA AFONSO ARI;176;1205;27/1/2001 08:19:00;INICIATIVA;N;0;CENTRO (BH);BH;611333.30;796434.60;1198
-1200;2001050686;B03000;AMEACA;RUA MADRID;230;42403;27/1/2001 09:00:00;INICIATIVA;S;;COPACABANA;BH;606215.50;806159.29;1199
-1201;2001050713;B03000;AMEACA;RUA ANITA GARIBA;210;4184;27/1/2001 09:34:00;CIDADAO COMUM;S;CAB;MORRO DAS PEDRAS;BH;608935.51;794538.06;1200
-1202;2001050725;B06000;LESAO CORPORAL;RUA ESTRELA DE P;23;90024;27/1/2001 09:45:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605955.92;791890.07;1201
-1203;2001050746;B03000;AMEACA;PRACA ITAPIRA;10;35845;27/1/2001 10:01:00;CIDADAO COMUM;S;;SAO GERALDO;BH;616265.14;798905.89;1202
-1204;2001050770;B03000;AMEACA;RUA JOSE MOREIRA;481;95232;27/1/2001 10:20:00;CIDADAO COMUM;N;0;TIROL;BH;600268.32;789248.46;1203
-1205;2001050788;B06000;LESAO CORPORAL;AV AMAZONAS;2267;3140;27/1/2001 10:34:00;CIDADAO COMUM;S;;SANTO AGOSTINHO;BH;609538.15;796202.90;1204
-1206;2001050937;B03000;AMEACA;RUA IPANEMA;1135;34726;27/1/2001 12:49:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602814.25;802311.29;1205
-1207;2001050941;B03000;AMEACA;RUA HAVANA;220;115036;27/1/2001 12:49:00;CIDADAO COMUM;N;AP101;ESTRELA DALVA;BH;607670.74;792047.48;1206
-1208;2001050948;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;322;51657;27/1/2001 13:00:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;609650.08;808286.90;1207
-1209;2001050949;B03000;AMEACA;RUA OLAVO BILAC;700;49660;27/1/2001 13:00:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607643.18;808117.12;1208
-1210;2001051049;B03000;AMEACA;RUA DECIO SALEMA;67;88750;27/1/2001 14:07:00;CIDADAO COMUM;S;;DOS PALMARES;BH;611952.79;802027.46;1209
-1211;2001051052;B04002;HOMICIDIO CONSUM;RUA PITANGUI;34;54365;27/1/2001 14:09:00;CIDADAO COMUM;N;AP204;SAO CRISTOVAO;BH;610522.93;799402.64;1210
-1212;2001051157;B06000;LESAO CORPORAL;RUA JULITA NOGUE;376;39597;27/1/2001 15:06:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603732.82;802432.71;1211
-1213;2001051175;B03000;AMEACA;RUA ILHA DE MALT;383;20926;27/1/2001 15:13:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;613705.47;804079.08;1212
-1214;2001051187;B03000;AMEACA;RUA STO IDELFONS;75;61850;27/1/2001 15:22:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608474.99;800221.72;1213
-1215;2001051261;B03000;AMEACA;RUA SAO PAULO;848;63464;27/1/2001 16:02:00;INICIATIVA;S;1302;CENTRO BH;BH;610915.13;796961.87;1214
-1216;2001051290;B02000;RIXA;AV AFONSO PENA;464;1259;27/1/2001 16:12:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611005.20;797320.30;1215
-1217;2001051296;B04001;HOMICIDIO TENTAD;RUA SEBASTIAO SA;168;90078;27/1/2001 16:16:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614744.66;802402.66;1216
-1218;2001051342;B03000;AMEACA;RUA IPANEMA;1135;34726;27/1/2001 16:46:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602814.25;802311.29;1217
-1219;2001051358;B08000;VIOLACAO DE DOMI;RUA SAO PEDRO DO;33;63842;27/1/2001 16:53:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612040.86;803799.62;1218
-1220;2001051423;B03000;AMEACA;RUA ESPIRITO SAN;421;26052;27/1/2001 17:29:00;INICIATIVA;N;0;CENTRO BH;BH;611314.96;797240.91;1219
-1221;2001051430;B06000;LESAO CORPORAL;RUA WALTER IANNI;250;82186;27/1/2001 17:37:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613230.08;803699.54;1220
-1222;2001051432;B03000;AMEACA;RUA JOAO PINTO;35;105542;27/1/2001 17:37:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;605029.47;794803.37;1221
-1223;2001051466;B06000;LESAO CORPORAL;RUA PORTO SEGURO;505;60595;27/1/2001 18:01:00;CIDADAO COMUM;N;;NOVA VISTA;BH;614940.97;800734.58;1222
-1224;2001051470;B06000;LESAO CORPORAL;RUA CLEANTO;42;46499;27/1/2001 18:00:00;CIDADAO COMUM;S;FR30;BELMONT;BH;615394.32;805069.93;1223
-1225;2001051500;B03000;AMEACA;RUA CESAR SALLES;85;113490;27/1/2001 18:15:00;CIDADAO COMUM;S;;JARDIM ESTRELA;BH;607230.33;810530.99;1224
-1226;2001051519;B06000;LESAO CORPORAL;AV LEONIL PRATA;221;101223;27/1/2001 18:27:00;INICIATIVA;N;0;CONJUNTO ALIPIO ;BH;604161.15;799915.91;1225
-1227;2001051531;B06000;LESAO CORPORAL;RUA PADRE PETROL;141;53577;27/1/2001 18:32:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612868.29;799155.55;1226
-1228;2001051552;B06000;LESAO CORPORAL;BECO LUIZ ALBERT;36;300741;27/1/2001 18:44:00;INICIATIVA;S;0;HORTO;BH;613875.22;798204.15;1227
-1229;2001051562;B03000;AMEACA;RUA SABRINA FERR;34;1132;27/1/2001 18:51:00;CIDADAO COMUM;S;;CARDOSO;BH;603666.33;788546.78;1228
-1230;2001051565;B03000;AMEACA;RUA NELSON DE SE;235;47448;27/1/2001 18:52:00;CIDADAO COMUM;N;0;CINQUENTENARIO;BH;606251.88;792825.67;1229
-1231;2001051584;B03000;AMEACA;RUA IRAPIRUARA;102;101872;27/1/2001 19:04:00;CIDADAO COMUM;N;0;SAO COSME (SL);SL;610221.72;812531.14;1230
-1232;2001051594;B04001;HOMICIDIO TENTAD;RUA CONSUELO;146;106296;27/1/2001 19:04:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607848.43;811390.89;1231
-1233;2001051600;B03000;AMEACA;RUA RENATO GONCA;122;14475;27/1/2001 19:12:00;CIDADAO COMUM;N;0;DOM JOAQUIM;BH;613762.36;801977.09;1232
-1234;2001051646;B06000;LESAO CORPORAL;RUA MORUMBI;96;46849;27/1/2001 19:39:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599330.25;788838.38;1233
-1235;2001051818;B02000;RIXA;RUA OCARA;333;49065;27/1/2001 21:06:00;CIDADAO COMUM;N;;VILA MARAVILHAS;BH;603016.39;795307.65;1234
-1236;2001051850;B06000;LESAO CORPORAL;RUA CAMAPUAN;250;11726;27/1/2001 21:31:00;CIDADAO COMUM;S;A;ALTO BARROCA;BH;607995.04;795600.51;1235
-1237;2001051902;B06000;LESAO CORPORAL;AV SILVA GUIMARA;60;65863;27/1/2001 21:52:00;CIDADAO COMUM;S;;ITAIPU BH;BH;598869.30;789086.11;1236
-1238;2001051904;B06000;LESAO CORPORAL;AV FREI HENRIQUE;410;81360;27/1/2001 21:52:00;CIDADAO COMUM;S;303,BLOCO C.;NOVA CACHOEIRINH;BH;609359.89;801137.27;1237
-1239;2001051948;B04001;HOMICIDIO TENTAD;RUA PROFESSORA G;660;86335;27/1/2001 22:15:00;CIDADAO COMUM;N;;FLORAMAR;BH;611900.95;807062.44;1238
-1240;2001051965;B06000;LESAO CORPORAL;AV BIAS FORTES;1770;9553;27/1/2001 22:29:00;INICIATIVA;N;0;BARRO PRETO;BH;610196.72;797244.85;1239
-1241;2001051992;B06000;LESAO CORPORAL;RUA MEYER;311;45326;27/1/2001 22:45:00;CIDADAO COMUM;N;;CAICARA;BH;607697.54;799497.02;1240
-1242;2001052009;B04001;HOMICIDIO TENTAD;RUA NOVE DE DEZE;211;48872;27/1/2001 22:51:00;INICIATIVA;S;0;LEONINA;BH;608390.33;793413.61;1241
-1243;2001052169;B03000;AMEACA;RUA CARLOS SHIRN;7;7182;28/1/2001 00:21:00;CIDADAO COMUM;S;CAB;TIROL;BH;601034.52;789803.43;1242
-1244;2001052170;B06000;LESAO CORPORAL;RUA ZURICK;11;74092;28/1/2001 00:23:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606533.22;796470.48;1243
-1245;2001052190;B03000;AMEACA;RUA VARNA;275;85231;28/1/2001 00:35:00;CIDADAO COMUM;S;CAA;JARDIM EUROPA;BH;608204.41;810553.78;1244
-1246;2001052192;B06000;LESAO CORPORAL;RUA NELSON HUNGR;449;46634;28/1/2001 00:37:00;CIDADAO COMUM;S;REF:CAMPO DO TUP;TUPI;BH;612722.64;806192.86;1245
-1247;2001052311;B06000;LESAO CORPORAL;RUA BARDANA;20;96600;28/1/2001 01:42:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614835.21;806457.22;1246
-1248;2001052312;B03000;AMEACA;RUA CINQUENTA E ;317;74137;28/1/2001 01:43:00;CIDADAO COMUM;N;;NOVA YORK;BH;608575.18;810924.30;1247
-1249;2001052330;B06000;LESAO CORPORAL;RUA GESTAL MOREI;59;47779;28/1/2001 01:52:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601255.90;788791.33;1248
-1250;2001052372;B06000;LESAO CORPORAL;RUA DA HARMONIA;17;32847;28/1/2001 02:16:00;CIDADAO COMUM;S;;FERNAO DIAS;BH;612751.05;802595.90;1249
-1251;2001052383;B03000;AMEACA;RUA DOUTOR ALIPI;243;2365;28/1/2001 02:21:00;CIDADAO COMUM;N;;SERRA;BH;613840.35;794757.13;1250
-1252;2001052422;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;28/1/2001 02:42:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;605855.99;798012.24;1251
-1253;2001052443;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;960;51657;28/1/2001 02:55:00;INICIATIVA;S;0;VENDA NOVA;BH;609089.09;808708.75;1252
-1254;2001052456;B06000;LESAO CORPORAL;RUA CINCO DE JUL;10;15670;28/1/2001 03:00:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612568.07;803874.18;1253
-1255;2001052490;B06000;LESAO CORPORAL;AV BIAS FORTES;1166;9553;28/1/2001 03:25:00;INICIATIVA;N;0;LOURDES;BH;610518.39;796681.64;1254
-1256;2001052493;B06000;LESAO CORPORAL;RUA DOIS;45;302810;28/1/2001 03:26:00;INICIATIVA;S;0;NOVO AARAO REIS;BH;614384.20;805861.01;1255
-1257;2001052574;B04001;HOMICIDIO TENTAD;RUA LADAINHA;45;40118;28/1/2001 04:33:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612013.16;803584.39;1256
-1258;2001052588;B06000;LESAO CORPORAL;AV ABILIO MACHAD;3123;634;28/1/2001 04:47:00;CIDADAO COMUM;N;0;CONJUNTO ALIPIO ;BH;603784.55;799976.88;1257
-1259;2001052625;B03000;AMEACA;RUA TAMBORIL;810;66793;28/1/2001 05:21:00;INICIATIVA;S;0;CONCORDIA;BH;611055.36;799478.21;1258
-1260;2001052673;B03000;AMEACA;RUA CAIANA;78;11350;28/1/2001 06:35:00;CIDADAO COMUM;S;0;SANTA INES;BH;614529.10;800410.29;1259
-1261;2001052738;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;1002;57830;28/1/2001 08:03:00;CIDADAO COMUM;N;;GUTIERREZ;BH;609199.03;794395.98;1260
-1262;2001052829;B06000;LESAO CORPORAL;RUA CARAVELAS;314;13141;28/1/2001 10:03:00;CIDADAO COMUM;N;CAC;VERA CRUZ;BH;615535.24;798308.71;1261
-1263;2001052895;B03000;AMEACA;RUA JOSE LAVARIN;245;40537;28/1/2001 11:04:00;CIDADAO COMUM;S;0;PARAISO;BH;614324.25;796702.92;1262
-1264;2001052971;B06000;LESAO CORPORAL;RUA DOS CURIANGO;30;19050;28/1/2001 12:14:00;CIDADAO COMUM;N;;VILA CLORIS;BH;610539.11;807498.57;1263
-1265;2001052986;B03000;AMEACA;RUA MARIA ROSA D;803;107800;28/1/2001 12:27:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606508.78;811712.71;1264
-1266;2001052989;B03000;AMEACA;RUA IVAPE;150;124601;28/1/2001 12:28:00;CIDADAO COMUM;S;0;JAQUELINE;BH;611546.33;810757.01;1265
-1267;2001053049;B03000;AMEACA;AV ESPLANADA;213;126244;28/1/2001 13:29:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;613217.11;804464.30;1266
-1268;2001053052;B03000;AMEACA;RUA DOS NAMBIQUA;75;110477;28/1/2001 13:30:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;606757.55;806811.23;1267
-1269;2001053091;B06000;LESAO CORPORAL;AV AMAZONAS;2267;3140;28/1/2001 13:58:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609538.15;796202.90;1268
-1270;2001053275;B03000;AMEACA;RUA LAPINHA;786;40376;28/1/2001 16:06:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606744.32;794824.20;1269
-1271;2001053282;B06000;LESAO CORPORAL;RUA CAVAQUINHO;21;301465;28/1/2001 16:10:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614169.38;795393.99;1270
-1272;2001053356;B06000;LESAO CORPORAL;RUA N;6;27197;28/1/2001 16:53:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616415.06;806950.10;1271
-1273;2001053363;B06000;LESAO CORPORAL;RUA JANETE CLAIR;168;50046;28/1/2001 16:58:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607149.50;807738.88;1272
-1274;2001053403;B03000;AMEACA;RUA DAVID CAMPIS;218;19683;28/1/2001 17:24:00;CIDADAO COMUM;S;AP401;FLORESTA;BH;611994.62;797423.35;1273
-1275;2001053425;B03000;AMEACA;RUA JOSE FRANCIS;87;78469;28/1/2001 17:35:00;CIDADAO COMUM;S;;VILA PINHO;BH;602321.14;787694.01;1274
-1276;2001053426;B06000;LESAO CORPORAL;RUA NELITA SALER;151;15770;28/1/2001 17:35:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608440.05;808269.08;1275
-1277;2001053432;B03000;AMEACA;RUA DOS XERENTES;24;84166;28/1/2001 17:39:00;CIDADAO COMUM;S;;SANTA MONICA;BH;606998.62;807231.05;1276
-1278;2001053449;B06000;LESAO CORPORAL;RUA IZABEL DIAS ;30;101920;28/1/2001 17:45:00;CIDADAO COMUM;S;;TEIXEIRA DIAS;BH;602673.89;789210.29;1277
-1279;2001053454;B03000;AMEACA;RUA JOAQUIM HENR;86;106605;28/1/2001 17:49:00;CIDADAO COMUM;S;A;MARIA HELENA;BH;605823.93;810911.64;1278
-1280;2001053485;B03000;AMEACA;RUA MARIA DE OLI;120;44276;28/1/2001 18:06:00;CIDADAO COMUM;S;;INDUSTRIAL RODRI;BH;615725.91;808833.53;1279
-1281;2001053501;B03000;AMEACA;RUA BEIRA LINHA;48;121732;28/1/2001 18:15:00;CIDADAO COMUM;S;CAA;SAO GABRIEL;BH;615355.82;805237.80;1280
-1282;2001053506;B06000;LESAO CORPORAL;RUA SAO GERALDO;301;170283;28/1/2001 18:18:00;CIDADAO COMUM;S;0;CABANA;BH;604776.91;793944.01;1281
-1283;2001053510;B03000;AMEACA;RUA FLOR DE ALEC;389;92451;28/1/2001 18:23:00;CIDADAO COMUM;S;NR EXATO - 490;FILADELFIA;BH;602449.93;797457.13;1282
-1284;2001053517;B03000;AMEACA;AV SEN LEVINDO C;3997;14866;28/1/2001 18:29:00;POLICIAL MILITAR;S;0;CH VALE DO JATOB;BH;601259.67;786764.12;1283
-1285;2001053523;B03000;AMEACA;RUA CAXANGA;267;14390;28/1/2001 18:32:00;POLICIAL MILITAR;S;;GUARANI;BH;612391.07;805707.53;1284
-1286;2001053525;B06000;LESAO CORPORAL;RUA VINTE E NOVE;206;73061;28/1/2001 18:35:00;CIDADAO COMUM;S;CSA;JOAO PINHEIRO;BH;604400.97;796725.97;1285
-1287;2001053542;B04001;HOMICIDIO TENTAD;AV TERESA CRISTI;718;67512;28/1/2001 18:47:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608524.82;797475.69;1286
-1288;2001053549;B03000;AMEACA;RUA DIVINO;172;21409;28/1/2001 18:51:00;CIDADAO COMUM;N;0;ERMELINDA;BH;609039.36;800563.79;1287
-1289;2001053567;B03000;AMEACA;RUA ITABORAI;73;92870;28/1/2001 19:02:00;CIDADAO COMUM;S;PX6;PILAR;BH;607759.30;788416.73;1288
-1290;2001053588;B03000;AMEACA;RUA BARAO DO MON;645;63653;28/1/2001 19:10:00;CIDADAO COMUM;N;;CARDOSO;BH;604055.56;787957.50;1289
-1291;2001053638;B03000;AMEACA;RUA AGUAS VERMEL;60;82098;28/1/2001 19:39:00;CIDADAO COMUM;S;;MINASLANDIA;BH;612295.05;804465.10;1290
-1292;2001053658;B06000;LESAO CORPORAL;RUA CONCEICAO DO;167;68253;28/1/2001 19:51:00;CIDADAO COMUM;S;CA2;SANTA INES;BH;614119.12;799674.66;1291
-1293;2001053669;B03000;AMEACA;RUA CANDELARIA;102;12514;28/1/2001 20:00:00;CIDADAO COMUM;S;CSA;NAZARE;BH;615755.10;804693.59;1292
-1294;2001053674;B03000;AMEACA;RUA ALABASTRO;400;1665;28/1/2001 20:03:00;CIDADAO COMUM;N;AP203;SAGRADA FAMILIA;BH;613052.21;798230.19;1293
-1295;2001053681;B03000;AMEACA;RUA ALGARVE;735;61396;28/1/2001 20:08:00;CIDADAO COMUM;N;CAA;SAO FRANCISCO;BH;609186.09;801896.95;1294
-1296;2001053683;B06000;LESAO CORPORAL;RUA LASSANCE;548;84415;28/1/2001 20:09:00;CIDADAO COMUM;S;0;BOA VISTA;BH;615768.49;799690.36;1295
-1297;2001053714;B06000;LESAO CORPORAL;RUA FERNAO DIAS;1694;28133;28/1/2001 20:29:00;CIDADAO COMUM;S;FU;VERA CRUZ;BH;616219.71;797519.14;1296
-1298;2001053718;B06000;LESAO CORPORAL;RUA PROFESSOR ME;275;77920;28/1/2001 20:32:00;CIDADAO COMUM;S;;MANGABEIRAS;BH;612090.78;792751.46;1297
-1299;2001053738;B04002;HOMICIDIO CONSUM;RUA DOUTOR CRIST;312;55598;28/1/2001 20:44:00;OUTROS;N;0;ARAGUAIA;BH;604751.25;789297.85;1298
-1300;2001053745;B04001;HOMICIDIO TENTAD;RUA DOUTOR BENED;445;12252;28/1/2001 20:48:00;CIDADAO COMUM;N;CAFR;ANTONIO RIBEIRO ;BH;612559.52;803764.92;1299
-1301;2001053752;B04002;HOMICIDIO CONSUM;RUA FLOR DE ACAC;220;102226;28/1/2001 20:46:00;CIDADAO COMUM;N;0;MINEIRAO;BH;601652.97;785722.31;1300
-1302;2001053763;B03000;AMEACA;RUA CACIMBA DE A;128;82029;28/1/2001 20:55:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614244.12;804717.14;1301
-1303;2001053769;B06000;LESAO CORPORAL;RUA MARROCOS;862;44869;28/1/2001 20:56:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605521.60;807505.20;1302
-1304;2001053786;B03000;AMEACA;RUA DONA FRANCEL;178;22861;28/1/2001 21:04:00;CIDADAO COMUM;S;0;MARIA VIRGINIA;BH;611567.91;802625.14;1303
-1305;2001053825;B04002;HOMICIDIO CONSUM;RUA DONA LALA FE;854;18712;28/1/2001 21:21:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604700.79;790766.05;1304
-1306;2001053833;B03000;AMEACA;RUA MONTE SIMPLO;1552;46574;28/1/2001 21:24:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;606848.39;794673.93;1305
-1307;2001053868;B03000;AMEACA;RUA MENDES DE OL;213;45430;28/1/2001 21:47:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609706.47;798762.86;1306
-1308;2001053912;B03000;AMEACA;RUA MARIA AMELIA;490;43812;28/1/2001 22:06:00;CIDADAO COMUM;S;LJZ;SAO BERNARDO;BH;610757.05;805313.24;1307
-1309;2001054009;B06000;LESAO CORPORAL;RUA CLORITA;64;16051;28/1/2001 23:01:00;CIDADAO COMUM;S;AT1701;SANTA TEREZA;BH;612843.67;797209.41;1308
-1310;2001054032;B04002;HOMICIDIO CONSUM;BECO MARCO ANTON;15;170750;28/1/2001 23:12:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608920.38;794610.08;1309
-1311;2001054111;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;29/1/2001 00:01:00;CIDADAO COMUM;S;;TIROL;BH;600947.66;789885.51;1310
-1312;2001054156;B03000;AMEACA;RUA LEONCIO JOSE;82;86350;29/1/2001 00:24:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611968.50;807233.49;1311
-1313;2001054157;B06000;LESAO CORPORAL;RUA VICTOR SANCH;284;87089;29/1/2001 00:26:00;CIDADAO COMUM;N;0;CEU AZUL;BH;605262.37;808625.54;1312
-1314;2001054158;B06000;LESAO CORPORAL;RUA W TRES;446;122621;29/1/2001 00:27:00;CIDADAO COMUM;S;0;PONGELUPE;BH;603956.29;787319.05;1313
-1315;2001054160;B02000;RIXA;AV SANTA TEREZIN;165;61415;29/1/2001 00:28:00;CIDADAO COMUM;S;0;CH DA LAGOA;BH;605063.85;802804.94;1314
-1316;2001054180;B03000;AMEACA;AV DO CONTORNO;6200;17228;29/1/2001 00:39:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611304.57;794846.88;1315
-1317;2001054243;B03000;AMEACA;RUA ABILIO FERNA;71;95421;29/1/2001 01:23:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616742.67;804336.01;1316
-1318;2001054246;B06000;LESAO CORPORAL;RUA EUDES GARCIA;315;113419;29/1/2001 01:25:00;INICIATIVA;N;0;FLORAMAR;BH;611582.85;806831.85;1317
-1319;2001054255;B04001;HOMICIDIO TENTAD;AV LEONIL PRATA;221;101223;29/1/2001 01:35:00;CIDADAO COMUM;S;;CONJUNTO ALIPIO ;BH;604161.15;799915.91;1318
-1320;2001054429;B03000;AMEACA;AV PARANA;122;52230;29/1/2001 05:30:00;INICIATIVA;S;;CENTRO (BH);BH;610785.23;797422.18;1319
-1321;2001054657;B08000;VIOLACAO DE DOMI;RUA CONTAGEM;1225;70293;29/1/2001 09:19:00;CIDADAO COMUM;N;0;BOA VISTA;BH;614534.83;800862.24;1320
-1322;2001054660;B03000;AMEACA;RUA PENIDO;64;53306;29/1/2001 09:21:00;CIDADAO COMUM;S;;PIRAJA;BH;613178.39;802974.59;1321
-1323;2001054799;B06000;LESAO CORPORAL;RUA EUCLIDES DA ;60;26806;29/1/2001 11:17:00;CIDADAO COMUM;N;0;PRADO;BH;608952.90;796051.89;1322
-1324;2001054815;B03000;AMEACA;RUA W TRES;464;122621;29/1/2001 11:24:00;CIDADAO COMUM;S;0;PONGELUPE;BH;603956.29;787319.05;1323
-1325;2001054838;B03000;AMEACA;RUA DOUTOR CRIST;277;55598;29/1/2001 11:44:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604648.63;789196.82;1324
-1326;2001054868;B06000;LESAO CORPORAL;AV COLETORA;956;78241;29/1/2001 12:09:00;CIDADAO COMUM;S;;VILA PINHO;BH;602212.14;787909.78;1325
-1327;2001054918;B06000;LESAO CORPORAL;RUA LUIZA GOMES ;99;86681;29/1/2001 12:45:00;CIDADAO COMUM;N;CS01;JAQUELINE;BH;611466.53;809848.13;1326
-1328;2001054962;B03000;AMEACA;RUA A;673;41110;29/1/2001 13:20:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602680.51;802847.95;1327
-1329;2001055030;B06000;LESAO CORPORAL;RUA ANIBAL VAZ D;35;4128;29/1/2001 14:18:00;CIDADAO COMUM;S;0;TUPI;BH;612241.94;806597.44;1328
-1330;2001055079;B03000;AMEACA;RUA DES BRAULIO;1147;19917;29/1/2001 15:02:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616247.76;797972.01;1329
-1331;2001055128;B04001;HOMICIDIO TENTAD;RUA TIBIRICA;137;67613;29/1/2001 15:31:00;CIDADAO COMUM;S;;NOVA GRANADA;BH;608221.23;794143.73;1330
-1332;2001055209;B03000;AMEACA;RUA DOUTOR CRIST;5913;55598;29/1/2001 16:13:00;CIDADAO COMUM;N;0;ARAGUAIA;BH;605633.98;789574.15;1331
-1333;2001055359;B03000;AMEACA;RUA MACHADO DE A;131;42214;29/1/2001 17:32:00;CIDADAO COMUM;S;;LAGOINHA;BH;610184.60;798601.91;1332
-1334;2001055391;B03000;AMEACA;RUA SAO TOMAS DE;920;63782;29/1/2001 17:55:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610767.14;793197.10;1333
-1335;2001055413;B03000;AMEACA;RUA FREI GASPAR;157;29886;29/1/2001 18:08:00;CIDADAO COMUM;S;;CABANA;BH;604297.25;794201.39;1334
-1336;2001055428;B03000;AMEACA;RUA AROEIRA;923;81385;29/1/2001 18:10:00;CIDADAO COMUM;S;CAA;SAO JOAO BATISTA;BH;610704.45;801881.67;1335
-1337;2001055456;B03000;AMEACA;RUA PEREIRA PASS;42;53375;29/1/2001 18:27:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610200.44;798788.69;1336
-1338;2001055499;B03000;AMEACA;RUA DR CELSO AZE;32;23256;29/1/2001 18:53:00;CIDADAO COMUM;S;AP09;NOVA CINTRA;BH;605899.79;793934.12;1337
-1339;2001055526;B03000;AMEACA;RUA STELLA HANRI;186;91184;29/1/2001 19:11:00;CIDADAO COMUM;S;APTO 201;BURITIS;BH;607973.76;791265.75;1338
-1340;2001055536;B06000;LESAO CORPORAL;RUA FRANCE JOSE ;328;85751;29/1/2001 19:15:00;CIDADAO COMUM;N;CAA;SERRA VERDE;BH;609703.97;810229.05;1339
-1341;2001055558;B03000;AMEACA;RUA CELSO DA CUN;108;86511;29/1/2001 19:24:00;POLICIAL MILITAR;S;0;TREVO;BH;603458.59;806578.82;1340
-1342;2001055570;B03000;AMEACA;RUA HERCULANO SO;727;90093;29/1/2001 19:29:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614694.95;802735.17;1341
-1343;2001055598;B06000;LESAO CORPORAL;RUA FLOR DO ORIE;214;50190;29/1/2001 19:53:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;605906.21;799974.11;1342
-1344;2001055608;B03000;AMEACA;RUA LA PAZ;71;40363;29/1/2001 19:56:00;CIDADAO COMUM;S;0;COPACABANA;BH;605705.71;806410.64;1343
-1345;2001055646;B06000;LESAO CORPORAL;RUA CASCADURA;58;13863;29/1/2001 20:23:00;CIDADAO COMUM;N;;CAICARA;BH;607422.93;799127.29;1344
-1346;2001055668;B03000;AMEACA;RUA EPAMINONDAS ;15;25696;29/1/2001 20:33:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604476.95;793805.73;1345
-1347;2001055686;B03000;AMEACA;RUA SERRAVITE;35;65081;29/1/2001 20:45:00;CIDADAO COMUM;S;AP24;FLORESTA;BH;612213.50;797991.04;1346
-1348;2001055723;B03000;AMEACA;AV SOUZA AGUIAR;847;84402;29/1/2001 21:08:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615363.95;798852.85;1347
-1349;2001055772;B03000;AMEACA;RUA NUNO TRISTAO;286;102370;29/1/2001 21:44:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616633.04;797516.63;1348
-1350;2001055788;B03000;AMEACA;RUA HERMENEGILDO;225;33197;29/1/2001 21:52:00;CIDADAO COMUM;S;;TUPI;BH;612279.45;806696.80;1349
-1351;2001055823;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;7100;18652;29/1/2001 22:16:00;INICIATIVA;S;0;VILA SUZANA;BH;612026.03;803295.77;1350
-1352;2001055836;B06000;LESAO CORPORAL;AV ITAITE;836;35441;29/1/2001 22:24:00;CIDADAO COMUM;S;LJ;SAO GERALDO;BH;615609.27;799536.30;1351
-1353;2001055880;B03000;AMEACA;RUA TRINTA E OIT;21;34681;29/1/2001 22:55:00;CIDADAO COMUM;S;A;CONJUNTO FELICID;BH;612484.12;807437.95;1352
-1354;2001055892;B03000;AMEACA;RUA MINERVINA EU;100;80820;29/1/2001 22:59:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;606081.95;792227.89;1353
-1355;2001055976;B03000;AMEACA;BECO NOSSA SENHO;110;300380;29/1/2001 23:52:00;CIDADAO COMUM;S;AP601;PRADO LOPES;BH;609845.68;798847.17;1354
-1356;2001055999;B03000;AMEACA;RUA ALFREDO ALVE;260;108175;30/1/2001 00:07:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606762.54;811481.99;1355
-1357;2001056121;B03000;AMEACA;RUA POUSO ALEGRE;282;54932;30/1/2001 01:45:00;CIDADAO COMUM;N;;FLORESTA;BH;611333.17;797986.35;1356
-1358;2001056150;B06000;LESAO CORPORAL;RUA MADALENA;57;42315;30/1/2001 02:11:00;CIDADAO COMUM;N;;SENHOR BOM JESUS;BH;609926.03;799941.02;1357
-1359;2001056363;B03000;AMEACA;RUA DOS GUARANIS;201;32181;30/1/2001 07:28:00;INICIATIVA;S;0;CENTRO (BH);BH;610742.55;797432.73;1358
-1360;2001056543;B06000;LESAO CORPORAL;RUA SESSENTA E C;41;33650;30/1/2001 10:02:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612355.18;806822.66;1359
-1361;2001056548;B04001;HOMICIDIO TENTAD;RUA MODELO;46;46026;30/1/2001 10:02:00;CIDADAO COMUM;N;;DOS PALMARES;BH;612190.56;802776.59;1360
-1362;2001056633;B06000;LESAO CORPORAL;AV AFONSO PENA;381;1259;30/1/2001 10:53:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611019.19;797421.73;1361
-1363;2001056801;B04001;HOMICIDIO TENTAD;AV PRESIDENTE AN;7500;4461;30/1/2001 12:53:00;CIDADAO COMUM;S;0;SAO LUIZ;BH;608835.03;804381.07;1362
-1364;2001056804;B04001;HOMICIDIO TENTAD;AV WALDIR SOEIRO;10;118904;30/1/2001 13:02:00;INICIATIVA;N;0;BETANIA;BH;603541.81;789510.67;1363
-1365;2001056822;B06000;LESAO CORPORAL;RUA IARA;7;33751;30/1/2001 13:18:00;CIDADAO COMUM;N;CSFDS;POMPEIA;BH;614644.40;798189.26;1364
-1366;2001056888;B03000;AMEACA;RUA JUPARANA;265;39672;30/1/2001 14:12:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611081.27;799473.64;1365
-1367;2001056931;B03000;AMEACA;RUA ENGENHO DO S;359;80427;30/1/2001 14:34:00;CIDADAO COMUM;N;0;ENGENHO NOGUEIRA;BH;606394.48;799795.89;1366
-1368;2001056997;B06000;LESAO CORPORAL;RUA BANGU;210;84598;30/1/2001 15:17:00;CIDADAO COMUM;N;;CAICARA;BH;607093.33;799200.45;1367
-1369;2001057006;B03000;AMEACA;RUA TACIBA;223;32024;30/1/2001 15:24:00;CIDADAO COMUM;S;0;COQUEIROS;BH;602360.48;799174.13;1368
-1370;2001057158;B03000;AMEACA;RUA OSCAR NEGRAO;428;17776;30/1/2001 16:43:00;CIDADAO COMUM;S;ATO 204;JARDINOPOLIS;BH;605047.53;794663.48;1369
-1371;2001057188;B06000;LESAO CORPORAL;RUA ALEXANDRE SI;140;2135;30/1/2001 17:00:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606816.61;794109.41;1370
-1372;2001057365;B03000;AMEACA;RUA MAURA;803;82205;30/1/2001 18:49:00;CIDADAO COMUM;S;;IPIRANGA;BH;612027.95;801355.98;1371
-1373;2001057409;B09000;ABANDONO DE INCA;RUA JUAZEIRO DO ;181;64873;30/1/2001 19:08:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;615324.29;806762.00;1372
-1374;2001057414;B03000;AMEACA;RUA ITAIPU;960;35439;30/1/2001 19:10:00;CIDADAO COMUM;S;CA3;VERA CRUZ;BH;616274.97;798164.89;1373
-1375;2001057490;B03000;AMEACA;RUA GUAICUI;151;31999;30/1/2001 19:59:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;609829.07;794224.02;1374
-1376;2001057553;B03000;AMEACA;RUA MANOEL PEDRO;11;81892;30/1/2001 20:44:00;CIDADAO COMUM;S;;PIRAJA;BH;614154.29;803189.54;1375
-1377;2001057607;B02000;RIXA;RUA JULITA NUNES;572;130047;30/1/2001 21:19:00;POLICIAL MILITAR;N;;MINASCAIXA;BH;609418.89;809963.99;1376
-1378;2001057639;B06000;LESAO CORPORAL;RUA SAO CLEMENTE;628;62197;30/1/2001 21:41:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609621.52;799734.14;1377
-1379;2001057649;B03000;AMEACA;RUA COUTO DE MAG;664;18463;30/1/2001 21:48:00;CIDADAO COMUM;S;;PARAISO;BH;614639.66;796763.67;1378
-1380;2001057660;B03000;AMEACA;AV SANTA TEREZA;55;61383;30/1/2001 21:55:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616478.06;797391.26;1379
-1381;2001057698;B03000;AMEACA;RUA JOAQUIM PURI;147;96087;30/1/2001 22:23:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614549.72;803290.47;1380
-1382;2001057740;B06000;LESAO CORPORAL;RUA JOSE FELIX M;1223;7416;30/1/2001 22:50:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606398.63;811463.72;1381
-1383;2001057741;B03000;AMEACA;RUA RIO PETROPOL;305;91893;30/1/2001 22:49:00;CIDADAO COMUM;S;;FILADELFIA;BH;602103.96;797827.26;1382
-1384;2001057761;B06000;LESAO CORPORAL;RUA ARAGUARI;12;5376;30/1/2001 23:00:00;INICIATIVA;S;;BARRO PRETO;BH;610125.29;797250.75;1383
-1385;2001057762;B06000;LESAO CORPORAL;AV FURQUIM WERNE;48;650;30/1/2001 23:01:00;INICIATIVA;S;0;TUPI;BH;613005.07;805799.44;1384
-1386;2001057809;B03000;AMEACA;BECO SANTA MARIA;62;48960;30/1/2001 23:33:00;INICIATIVA;S;A;VILA PARAISO;BH;606182.79;790615.55;1385
-1387;2001057828;B04001;HOMICIDIO TENTAD;RUA AREIA BRANCA;10;75707;30/1/2001 23:36:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;614957.33;807774.40;1386
-1388;2001057851;B02000;RIXA;RUA JACUI;3076;36734;30/1/2001 23:50:00;CIDADAO COMUM;S;0;IPIRANGA;BH;611440.16;800881.73;1387
-1389;2001057872;B04001;HOMICIDIO TENTAD;RUA MOEMA;95;46070;31/1/2001 00:05:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;606560.38;798127.38;1388
-1390;2001057993;B03000;AMEACA;RUA MARIANO DE A;537;44411;31/1/2001 01:58:00;CIDADAO COMUM;S;0;ESPLANADA;BH;614922.39;798396.44;1389
-1391;2001058010;B04001;HOMICIDIO TENTAD;AV MANOEL GOMES;250;43103;31/1/2001 02:31:00;CIDADAO COMUM;N;;NOVA CACHOEIRINH;BH;609668.41;801466.24;1390
-1392;2001058084;B06000;LESAO CORPORAL;RUA OTAVIO CARNE;568;50594;31/1/2001 04:41:00;CIDADAO COMUM;S;;BOA VISTA;BH;614956.47;799991.12;1391
-1393;2001058262;B03000;AMEACA;RUA ITAPEVA;721;35820;31/1/2001 08:41:00;CIDADAO COMUM;S;;CONCORDIA;BH;611512.69;799189.30;1392
-1394;2001058280;B04001;HOMICIDIO TENTAD;AV AFONSO PENA;590;1259;31/1/2001 08:49:00;INICIATIVA;N;0;CENTRO BH;BH;611078.27;797193.62;1393
-1395;2001058316;B03000;AMEACA;RUA JOSE EDUARDO;375;38770;31/1/2001 09:17:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604315.58;790674.24;1394
-1396;2001058329;B06000;LESAO CORPORAL;AV SEN LEVINDO C;55;14866;31/1/2001 09:28:00;CIDADAO COMUM;N;CAA;INDEPENDENCIA;BH;601582.86;786276.22;1395
-1397;2001058332;B06000;LESAO CORPORAL;RUA ANGOLA;741;4001;31/1/2001 09:30:00;CIDADAO COMUM;S;AN2;SAO PAULO;BH;613020.50;802906.60;1396
-1398;2001058381;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;1428;51657;31/1/2001 10:01:00;CIDADAO COMUM;N;;VENDA NOVA;BH;608684.86;808921.08;1397
-1399;2001058403;B04001;HOMICIDIO TENTAD;RUA MARLY PASSOS;225;118107;31/1/2001 10:14:00;CIDADAO COMUM;S;;CH TUNEL DE IBIR;BH;599637.89;789970.22;1398
-1400;2001058524;B03000;AMEACA;RUA PADRE MARINH;246;51571;31/1/2001 11:37:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612834.71;796437.03;1399
-1401;2001058572;B03000;AMEACA;AV TERESA CRISTI;729;67512;31/1/2001 12:10:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;602258.86;791337.75;1400
-1402;2001058607;B03000;AMEACA;RUA ITAOCA;95;35703;31/1/2001 12:31:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611520.36;805977.45;1401
-1403;2001058618;B03000;AMEACA;RUA CONDOR;425;16773;31/1/2001 12:38:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605857.42;793824.01;1402
-1404;2001058670;B03000;AMEACA;RUA QUARENTA E U;46;34801;31/1/2001 13:13:00;INICIATIVA;N;0;FELICIDADE;BH;612521.64;807196.19;1403
-1405;2001058698;B04002;HOMICIDIO CONSUM;RUA PRINCIPAL;49;300224;31/1/2001 13:32:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610480.42;793583.71;1404
-1406;2001058716;B06000;LESAO CORPORAL;RUA JOAO MAGELA ;120;99390;31/1/2001 13:45:00;CIDADAO COMUM;S;;CEU AZUL;BH;605062.14;807887.41;1405
-1407;2001058767;B03000;AMEACA;RUA PATROCINIO;209;52574;31/1/2001 14:23:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;609810.09;797518.64;1406
-1408;2001058820;B03000;AMEACA;RUA SAO JOAO DE ;90;110073;31/1/2001 14:58:00;CIDADAO COMUM;S;;PILAR;BH;607693.72;788702.75;1407
-1409;2001058831;B06000;LESAO CORPORAL;RUA MACON RIBEIR;57;70514;31/1/2001 15:02:00;CIDADAO COMUM;N;LJ;VENDA NOVA;BH;609690.76;808307.39;1408
-1410;2001058879;B06000;LESAO CORPORAL;PRACA PRIMEIRO D;38;55254;31/1/2001 15:35:00;POLICIAL MILITAR;N;0;CENTRO (BH);BH;610657.63;796948.07;1409
-1411;2001058885;B03000;AMEACA;RUA EPAMINONDAS ;33;25696;31/1/2001 15:41:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604476.95;793805.73;1410
-1412;2001058943;B06000;LESAO CORPORAL;RUA NICOLINA DE ;71;44263;31/1/2001 16:21:00;CIDADAO COMUM;S;0;HAVAI;BH;607309.12;793702.59;1411
-1413;2001058952;B06000;LESAO CORPORAL;RUA JOAQUIM TEIX;150;128845;31/1/2001 16:26:00;POLICIAL MILITAR;N;0;CASTANHEIRAS (TA;BH;617405.88;796871.94;1412
-1414;2001058958;B06000;LESAO CORPORAL;RUA ANTONIO RODR;480;11537;31/1/2001 16:31:00;CIDADAO COMUM;S;;VENDA NOVA;BH;607247.00;809301.40;1413
-1415;2001059044;B03000;AMEACA;RUA CORREGO DA M;63;18160;31/1/2001 17:16:00;CIDADAO COMUM;S;LJ;SAGRADA FAMILIA;BH;612904.87;798017.92;1414
-1416;2001059173;B03000;AMEACA;RUA SANTOS;903;61910;31/1/2001 18:24:00;CIDADAO COMUM;S;AP101;JARDIM AMERICA;BH;607394.98;794391.51;1415
-1417;2001059237;B03000;AMEACA;RUA BENJAMIM JAC;71;9207;31/1/2001 19:00:00;CIDADAO COMUM;S;0;GUTIERREZ;BH;608577.81;794897.65;1416
-1418;2001059300;B04001;HOMICIDIO TENTAD;RUA ALZIRA GONCA;190;58615;31/1/2001 19:34:00;CIDADAO COMUM;N;;VENDA NOVA;BH;608972.31;808425.51;1417
-1419;2001059360;B03000;AMEACA;RUA SAO LUIZ GON;210;63290;31/1/2001 20:04:00;CIDADAO COMUM;N;CAFU;IPIRANGA;BH;611529.38;800705.13;1418
-1420;2001059382;B09000;ABANDONO DE INCA;RUA DAS PETUNIAS;1069;11870;31/1/2001 20:17:00;CIDADAO COMUM;N;;LINDEIA;BH;598693.86;790907.36;1419
-1421;2001059436;B04001;HOMICIDIO TENTAD;RUA SANTA LUZIA;55;60904;31/1/2001 20:51:00;CIDADAO COMUM;N;AP301;NOVA CINTRA;BH;605213.06;793118.55;1420
-1422;2001059446;B03000;AMEACA;RUA PRINCIPAL;401;300224;31/1/2001 20:56:00;CIDADAO COMUM;N;0;MORRO DO PAPAGAI;BH;610524.12;793316.01;1421
-1423;2001059455;B03000;AMEACA;AV MEM DE SA;538;45395;31/1/2001 20:59:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613961.23;796782.49;1422
-1424;2001059463;B03000;AMEACA;AV AUGUSTO DE LI;385;6731;31/1/2001 21:03:00;CIDADAO COMUM;S;AP102;CENTRO (BH);BH;611025.06;796588.88;1423
-1425;2001059469;B03000;AMEACA;RUA VITORIA REGI;201;73540;31/1/2001 21:04:00;CIDADAO COMUM;S;0;LINDEIA;BH;599089.55;790969.98;1424
-1426;2001059501;B04001;HOMICIDIO TENTAD;RUA CINQUENTA E ;235;33925;31/1/2001 21:23:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612859.28;806829.06;1425
-1427;2001059566;B03000;AMEACA;RUA CURVELO;50;19150;31/1/2001 22:00:00;CIDADAO COMUM;S;AP304;FLORESTA;BH;612139.97;797829.32;1426
-1428;2001059572;B04001;HOMICIDIO TENTAD;RUA SEIS;306;300264;31/1/2001 22:04:00;CIDADAO COMUM;N;0;VISTA DO SOL;BH;616300.81;804950.19;1427
-1429;2001059585;B08000;VIOLACAO DE DOMI;RUA JOAO AMACECK;129;37462;31/1/2001 22:10:00;CIDADAO COMUM;N;;BOA VISTA;BH;616121.92;799878.30;1428
-1430;2001059655;B03000;AMEACA;RUA JOINVILLE;99;53510;31/1/2001 23:00:00;CIDADAO COMUM;N;;COPACABANA;BH;606583.92;806827.53;1429
-1431;2001059686;B06000;LESAO CORPORAL;RUA FLOREAL;96;113926;31/1/2001 23:12:00;CIDADAO COMUM;N;0;PIRATININGA;BH;605452.17;809312.96;1430
-1432;2001059694;B06000;LESAO CORPORAL;RUA MACIEL RIBEI;30;81499;31/1/2001 23:17:00;CIDADAO COMUM;S;0;JARDIM GUANABARA;BH;611750.66;807384.55;1431
-1433;2001059711;B02000;RIXA;RUA KEPLER;196;39990;31/1/2001 23:28:00;CIDADAO COMUM;S;;SANTA LUCIA;BH;609886.18;792478.04;1432
-1434;2001059763;B03000;AMEACA;RUA TRIPUI;131;69763;31/1/2001 23:55:00;CIDADAO COMUM;S;0;GUARANI;BH;612931.77;805684.10;1433
-1435;2001059832;B02000;RIXA;RUA DOUTOR CRIST;312;55598;1/2/2001 00:40:00;CIDADAO COMUM;S;0;BARREIRO DE CIMA;BH;604751.25;789297.85;1434
-1436;2001059842;B06000;LESAO CORPORAL;RUA NEFELINA;99;81228;1/2/2001 00:54:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612838.15;797304.69;1435
-1437;2001059851;B03000;AMEACA;RUA BRASIL TRI-C;180;170485;1/2/2001 01:04:00;INICIATIVA;N;0;DOM CABRAL;BH;604562.87;796907.92;1436
-1438;2001060029;B02000;RIXA;PRACA DUQUE DE C;69;24145;1/2/2001 04:19:00;INICIATIVA;N;0;SANTA TEREZA;BH;613410.51;797459.13;1437
-1439;2001060132;B04001;HOMICIDIO TENTAD;RUA CARMELITA CO;338;93366;1/2/2001 07:20:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;600867.06;785924.34;1438
-1440;2001060145;B03000;AMEACA;AV AFONSO PENA;372;1259;1/2/2001 07:33:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610959.28;797388.43;1439
-1441;2001060393;B03000;AMEACA;RUA MAJOR DELFIN;1070;42620;1/2/2001 10:35:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609785.00;802309.75;1440
-1442;2001060421;B06000;LESAO CORPORAL;BECO SANTO ANTON;282;96349;1/2/2001 11:02:00;INICIATIVA;N;0;PRIMEIRO DE MAIO;BH;612200.69;803724.03;1441
-1443;2001060436;B03000;AMEACA;RUA CAPA PRETA;186;14232;1/2/2001 11:10:00;CIDADAO COMUM;N;CAA;JOAO PINHEIRO;BH;605022.27;796035.34;1442
-1444;2001060485;B03000;AMEACA;RUA SILVEIRA MAR;538;65977;1/2/2001 11:50:00;CIDADAO COMUM;S;FU;PARQUE RIACHUELO;BH;609470.74;800354.37;1443
-1445;2001060593;B03000;AMEACA;RUA DA BOLIVIA;897;9884;1/2/2001 13:18:00;CIDADAO COMUM;S;0;SION;BH;611010.39;793433.40;1444
-1446;2001060608;B03000;AMEACA;BECO DAS MARIAS;35;301279;1/2/2001 13:25:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610462.00;793612.12;1445
-1447;2001060632;B06000;LESAO CORPORAL;RUA NELSON;605;47407;1/2/2001 13:40:00;CIDADAO COMUM;N;;UNIAO;BH;613017.58;801280.15;1446
-1448;2001060716;B03000;AMEACA;RUA MARIO SALUST;258;34492;1/2/2001 14:31:00;CIDADAO COMUM;S;0;GOIANIA;BH;614977.70;803071.04;1447
-1449;2001060725;B03000;AMEACA;AV SERRANA;435;65040;1/2/2001 14:36:00;CIDADAO COMUM;S;0;SERRANO;BH;603481.26;801371.79;1448
-1450;2001060727;B03000;AMEACA;AV SILVA GUIMARA;97;65863;1/2/2001 14:37:00;INICIATIVA;S;0;ITAIPU BH;BH;598852.15;789036.88;1449
-1451;2001060729;B04001;HOMICIDIO TENTAD;AV CIVILIZACAO;300;51657;1/2/2001 14:37:00;INICIATIVA;N;0;LEBLON;BH;605644.83;810039.92;1450
-1452;2001060777;B06000;LESAO CORPORAL;AV SINFRONIO BRO;688;66116;1/2/2001 15:08:00;INICIATIVA;N;0;BARREIRO;BH;602643.71;790854.32;1451
-1453;2001060794;B03000;AMEACA;AV ALVARO DA SIL;938;2872;1/2/2001 15:21:00;CIDADAO COMUM;S;;BARREIRO;BH;602015.43;790984.73;1452
-1454;2001060800;B06000;LESAO CORPORAL;BECO BOA VISTA;90;170302;1/2/2001 15:25:00;CIDADAO COMUM;N;;CABANA;BH;604870.95;793612.31;1453
-1455;2001060822;B03000;AMEACA;RUA JURAMENTO;191;39732;1/2/2001 15:38:00;CIDADAO COMUM;S;0;PARAISO;BH;614799.88;797390.14;1454
-1456;2001060872;B03000;AMEACA;RUA CRISTALIA;192;70899;1/2/2001 16:06:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612534.68;804567.59;1455
-1457;2001061075;B03000;AMEACA;RUA SETE DE SETE;200;170167;1/2/2001 17:55:00;CIDADAO COMUM;S;0;CABANA;BH;604457.24;794353.97;1456
-1458;2001061136;B06000;LESAO CORPORAL;RUA URCA;219;71040;1/2/2001 18:31:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603289.41;802477.20;1457
-1459;2001061149;B03000;AMEACA;RUA SAO CLEMENTE;40;62197;1/2/2001 18:35:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609648.20;799172.19;1458
-1460;2001061168;B03000;AMEACA;RUA ETILANDIA;130;26759;1/2/2001 18:45:00;CIDADAO COMUM;S;CAA;ANTONIO RIBEIRO ;BH;615163.64;806661.04;1459
-1461;2001061193;B03000;AMEACA;RUA FLOR DA PASC;34;28795;1/2/2001 19:01:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;605912.50;799356.90;1460
-1462;2001061258;B03000;AMEACA;AV SERRANA;1322;65040;1/2/2001 19:36:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603457.28;802162.09;1461
-1463;2001061264;B06000;LESAO CORPORAL;RUA LUAR DE MINA;23;88343;1/2/2001 19:38:00;CIDADAO COMUM;S;;VENDA NOVA;BH;607263.75;809334.88;1462
-1464;2001061304;B03000;AMEACA;RUA REGENCIA;316;301448;1/2/2001 19:58:00;CIDADAO COMUM;S;PX271;VILA CAFEZAL;BH;614098.82;795476.81;1463
-1465;2001061437;B03000;AMEACA;RUA ANTONIO VIEI;234;4925;1/2/2001 21:05:00;CIDADAO COMUM;N;0;GLALIJA;BH;603544.15;794206.42;1464
-1466;2001061455;B03000;AMEACA;AV FLOR DE SEDA;235;748;1/2/2001 21:14:00;CIDADAO COMUM;S;0;LINDEIA;BH;599017.62;790942.00;1465
-1467;2001061507;B03000;AMEACA;RUA CAMILO GOMES;395;11902;1/2/2001 21:42:00;CIDADAO COMUM;S;CAFR;ITAIPU BH;BH;599526.34;789343.98;1466
-1468;2001061604;B06000;LESAO CORPORAL;RUA ALAGOAS;896;1678;1/2/2001 22:38:00;CIDADAO COMUM;N;1106;FUNCIONARIOS;BH;611371.17;795424.35;1467
-1469;2001061631;B06000;LESAO CORPORAL;RUA MICA;151;45685;1/2/2001 23:02:00;CIDADAO COMUM;S;;SAO LUCAS;BH;613254.23;795969.45;1468
-1470;2001061669;B06000;LESAO CORPORAL;BECO CANARINHO;20;172074;1/2/2001 23:14:00;CIDADAO COMUM;S;;VILA CEMIG;BH;605308.22;788787.01;1469
-1471;2001061680;B06000;LESAO CORPORAL;AV AFONSO PENA;1301;1259;1/2/2001 23:20:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611434.79;796733.41;1470
-1472;2001061694;B06000;LESAO CORPORAL;RUA JULIO PIRES ;73;39543;1/2/2001 23:32:00;CIDADAO COMUM;N;;RIO BRANCO;BH;607144.25;808780.18;1471
-1473;2001061712;B06000;LESAO CORPORAL;RUA PERNAMBUCO;1077;53463;1/2/2001 23:40:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611502.50;795210.22;1472
-1474;2001061785;B06000;LESAO CORPORAL;AV CRISTIANO MAC;2250;18652;2/2/2001 00:21:00;INICIATIVA;N;0;CIDADE NOVA;BH;612163.55;800630.11;1473
-1475;2001061796;B06000;LESAO CORPORAL;RUA SERINGUEIRA;808;90471;2/2/2001 00:30:00;CIDADAO COMUM;S;;PATROCINIO;BH;605107.82;794408.66;1474
-1476;2001061833;B03000;AMEACA;RUA CONTAGEM;1010;70293;2/2/2001 00:53:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614621.27;800626.08;1475
-1477;2001061837;B06000;LESAO CORPORAL;RUA DES BRAULIO;1341;19917;2/2/2001 00:58:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616286.46;797842.29;1476
-1478;2001061842;B03000;AMEACA;RUA PADRE PAULO ;85;56096;2/2/2001 01:00:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611731.42;807037.64;1477
-1479;2001061911;B04001;HOMICIDIO TENTAD;AV PRUDENTE DE M;1000;55774;2/2/2001 01:50:00;INICIATIVA;N;0;CORACAO DE JESUS;BH;609997.99;794345.70;1478
-1480;2001061942;B03000;AMEACA;AV A;74;302850;2/2/2001 02:14:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;613873.98;805539.35;1479
-1481;2001061950;B04001;HOMICIDIO TENTAD;AV ARTUR BERNARD;1180;60844;2/2/2001 02:19:00;INICIATIVA;S;0;VILA PARIS;BH;610180.14;793263.99;1480
-1482;2001061994;B06000;LESAO CORPORAL;RUA SERRINHA;61;129201;2/2/2001 03:10:00;CIDADAO COMUM;N;;MANGUEIRAS;BH;600519.25;786719.95;1481
-1483;2001062013;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;1361;31400;2/2/2001 03:28:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609953.61;797025.02;1482
-1484;2001062058;B04002;HOMICIDIO CONSUM;RUA CONCEICAO DE;488;16515;2/2/2001 04:29:00;INICIATIVA;N;0;JARDIM LEBLON;BH;605827.11;807322.29;1483
-1485;2001062083;B03000;AMEACA;RUA JOSE CAMILO ;63;82350;2/2/2001 05:17:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;611432.74;805022.11;1484
-1486;2001062201;B04002;HOMICIDIO CONSUM;RUA MUNICIPAL;49;171677;2/2/2001 07:54:00;CIDADAO COMUM;S;;VILA CEMIG;BH;605549.39;788565.80;1485
-1487;2001062279;B06000;LESAO CORPORAL;AV AMAZONAS;885;3140;2/2/2001 08:51:00;INICIATIVA;N;0;CENTRO (BH);BH;610745.60;796908.15;1486
-1488;2001062289;B03000;AMEACA;RUA SAO PAULO;370;90213;2/2/2001 08:55:00;CIDADAO COMUM;S;0;SARANDI (URCA/BH;BH;602793.89;802510.17;1487
-1489;2001062300;B06000;LESAO CORPORAL;RUA DES BRAULIO;1341;19917;2/2/2001 09:02:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616286.46;797842.29;1488
-1490;2001062326;B03000;AMEACA;RUA PIAUI;164;53624;2/2/2001 09:16:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;612590.73;796729.91;1489
-1491;2001062340;B06000;LESAO CORPORAL;RUA ITAPEVA;721;35820;2/2/2001 09:25:00;CIDADAO COMUM;S;;CONCORDIA;BH;611512.69;799189.30;1490
-1492;2001062362;B06000;LESAO CORPORAL;RUA TEN ANASTACI;1046;67263;2/2/2001 09:36:00;CIDADAO COMUM;S;PX215;SAO LUCAS;BH;613301.83;796082.54;1491
-1493;2001062462;B06000;LESAO CORPORAL;RUA VICENTE DE A;301;71807;2/2/2001 10:42:00;INICIATIVA;S;* SLU *;BARREIRO;BH;602068.68;790559.92;1492
-1494;2001062509;B03000;AMEACA;AV SEN LEVINDO C;3363;14866;2/2/2001 11:13:00;INICIATIVA;S;0;CH VALE DO JATOB;BH;601209.33;786916.79;1493
-1495;2001062610;B03000;AMEACA;RUA IGUACU;35;34118;2/2/2001 12:30:00;CIDADAO COMUM;S;;CONCORDIA;BH;610921.00;798888.59;1494
-1496;2001062625;B03000;AMEACA;AV RAUL MOURAO G;137;89900;2/2/2001 12:37:00;INICIATIVA;S;;PALMEIRAS;BH;606587.40;791752.04;1495
-1497;2001062635;B03000;AMEACA;AV SINFRONIO BRO;452;66116;2/2/2001 12:44:00;CIDADAO COMUM;S;;BARREIRO;BH;602895.18;790906.39;1496
-1498;2001062636;B06000;LESAO CORPORAL;RUA QUARENTA E T;135;56780;2/2/2001 12:44:00;CIDADAO COMUM;N;];GOIANIA;BH;615572.59;803438.36;1497
-1499;2001062637;B06000;LESAO CORPORAL;RUA 35;5;302833;2/2/2001 12:45:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;613942.87;805469.60;1498
-1500;2001062705;B06000;LESAO CORPORAL;RUA D;48;47740;2/2/2001 13:34:00;CIDADAO COMUM;S;0;VILA CASTANHEIRA;BH;601064.32;788642.82;1499
-1501;2001062712;B03000;AMEACA;RUA GUSTAVO DA S;69;32617;2/2/2001 13:43:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613767.26;798748.73;1500
-1502;2001062802;B03000;AMEACA;RUA CONCEICAO DA;69;46360;2/2/2001 14:48:00;INICIATIVA;S;0;COQUEIROS;BH;603000.95;800039.62;1501
-1503;2001062834;B06000;LESAO CORPORAL;AV AFONSO PENA;1707;1259;2/2/2001 15:07:00;CIDADAO COMUM;S;LJ1;CENTRO (BH);BH;611696.54;796248.60;1502
-1504;2001062838;B06000;LESAO CORPORAL;RUA JOAQUIM ARIS;12;114087;2/2/2001 15:13:00;CIDADAO COMUM;S;;LETICIA;BH;607112.71;809608.80;1503
-1505;2001062874;B03000;AMEACA;RUA FREI LUIZ DE;980;29961;2/2/2001 15:25:00;CIDADAO COMUM;S;;ALTO DOS PINHEIR;BH;604208.48;796388.72;1504
-1506;2001062951;B03000;AMEACA;RUA GERALDO SILV;205;56588;2/2/2001 16:13:00;CIDADAO COMUM;S;;RIO BRANCO;BH;606436.61;808648.71;1505
-1507;2001062998;B03000;AMEACA;RUA GIRASSOL;403;31277;2/2/2001 16:43:00;CIDADAO COMUM;S;;LINDEIA;BH;599265.73;791053.31;1506
-1508;2001063130;B03000;AMEACA;RUA PATU;26;52587;2/2/2001 17:49:00;INICIATIVA;S;0;SAO GERALDO;BH;616132.74;799457.09;1507
-1509;2001063187;B04001;HOMICIDIO TENTAD;RUA PORUINA;95;54860;2/2/2001 18:21:00;CIDADAO COMUM;N;AP202;JARDIM AMERICA;BH;606963.06;794728.99;1508
-1510;2001063190;B03000;AMEACA;RUA ORION RIGEL ;195;128961;2/2/2001 18:21:00;CIDADAO COMUM;S;AP05;FLORAMAR;BH;611775.11;807103.70;1509
-1511;2001063224;B03000;AMEACA;AV SANTOS DUMONT;690;61950;2/2/2001 18:41:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610987.45;797613.53;1510
-1512;2001063257;B06000;LESAO CORPORAL;RUA JOSE LINS DO;124;38903;2/2/2001 18:54:00;CIDADAO COMUM;S;;TUPI;BH;612511.61;806023.59;1511
-1513;2001063264;B06000;LESAO CORPORAL;AV ARTUR BERNARD;1400;60844;2/2/2001 18:58:00;CIDADAO COMUM;S;;VILA PARIS;BH;610262.27;793237.57;1512
-1514;2001063276;B03000;AMEACA;RUA PARAIBA;845;52170;2/2/2001 19:08:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;611731.54;795534.42;1513
-1515;2001063341;B04001;HOMICIDIO TENTAD;RUA VASCO DA GAM;316;71330;2/2/2001 19:44:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;611169.88;805021.78;1514
-1516;2001063344;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;426;51644;2/2/2001 19:46:00;CIDADAO COMUM;S;AP202;CORACAO EUCARIST;BH;605699.54;796696.04;1515
-1517;2001063407;B04001;HOMICIDIO TENTAD;RUA PADRE CAFE;105;51253;2/2/2001 20:15:00;CIDADAO COMUM;N;;SAUDADE;BH;615127.56;797675.19;1516
-1518;2001063440;B03000;AMEACA;AV AFONSO PENA;3888;1259;2/2/2001 20:29:00;CIDADAO COMUM;S;PROX. BANCO ITAU;CRUZEIRO;BH;612736.07;794330.03;1517
-1519;2001063567;B06000;LESAO CORPORAL;RUA SENHOR DOS P;175;64817;2/2/2001 21:33:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609781.32;802567.71;1518
-1520;2001063648;B03000;AMEACA;RUA RADIALISTA C;299;99375;2/2/2001 22:24:00;CIDADAO COMUM;S;;CEU AZUL;BH;604907.33;807570.81;1519
-1521;2001063671;B03000;AMEACA;RUA JAIR NEGRAO ;5;21944;2/2/2001 22:35:00;CIDADAO COMUM;S;0;JARDIM ESTRELA;BH;607349.55;810148.64;1520
-1522;2001063809;B06000;LESAO CORPORAL;RUA JANUARIO PER;57;86363;2/2/2001 23:43:00;CIDADAO COMUM;N;0;JAQUELINE;BH;611073.74;810225.60;1521
-1523;2001063818;B03000;AMEACA;RUA ADONIAS FILH;191;22010;2/2/2001 23:49:00;CIDADAO COMUM;S;;SANTA MARIA;BH;603661.98;795283.35;1522
-1524;2001063825;B06000;LESAO CORPORAL;RUA ANTONIO GENT;21;4562;2/2/2001 23:49:00;CIDADAO COMUM;S;;CONCORDIA;BH;610610.15;799328.53;1523
-1525;2001063906;B03000;AMEACA;RUA CARMEM;117;100407;3/2/2001 00:36:00;CIDADAO COMUM;N;;SANTA MONICA DO ;BH;606236.18;808762.74;1524
-1526;2001063962;B03000;AMEACA;RUA CORONEL ANTO;418;17590;3/2/2001 01:07:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605911.45;807534.46;1525
-1527;2001063964;B03000;AMEACA;RUA ENEAS;862;25481;3/2/2001 01:08:00;CIDADAO COMUM;S;;NOVO GLORIA;BH;603052.25;799062.91;1526
-1528;2001063969;B03000;AMEACA;RUA DOUTOR VIEIR;975;129964;3/2/2001 01:10:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;612837.37;798930.87;1527
-1529;2001064004;B04002;HOMICIDIO CONSUM;AV WALDOMIRO LOB;591;66548;3/2/2001 01:28:00;CIDADAO COMUM;N;CA01;GUARANI;BH;612785.98;805403.93;1528
-1530;2001064013;B06000;LESAO CORPORAL;RUA CORONEL JOAQ;1162;87063;3/2/2001 01:31:00;CIDADAO COMUM;S;;CEU AZUL;BH;605013.45;808558.53;1529
-1531;2001064032;B04001;HOMICIDIO TENTAD;RUA ATIBAIA;215;6530;3/2/2001 01:43:00;CIDADAO COMUM;S;;PIRATININGA;BH;606550.78;809443.16;1530
-1532;2001064078;B06000;LESAO CORPORAL;RUA LUCERNA;165;83655;3/2/2001 02:08:00;CIDADAO COMUM;S;LJ1;JARDIM EUROPA;BH;607904.55;810123.51;1531
-1533;2001064093;B06000;LESAO CORPORAL;RUA PADRE MANOEL;20;51556;3/2/2001 02:21:00;CIDADAO COMUM;N;0;VILA OESTE;BH;605001.79;795759.79;1532
-1534;2001064105;B03000;AMEACA;AV RAJA GABAGLIA;2708;57830;3/2/2001 02:30:00;CIDADAO COMUM;S;;ESTORIL;BH;609088.84;792662.10;1533
-1535;2001064106;B04001;HOMICIDIO TENTAD;RUA MARCOS PAULO;87;81911;3/2/2001 02:30:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614036.11;803725.32;1534
-1536;2001064192;B06000;LESAO CORPORAL;AV PRUDENTE DE M;1111;55774;3/2/2001 03:31:00;CIDADAO COMUM;S;AP01;CORACAO DE JESUS;BH;610016.76;794258.13;1535
-1537;2001064248;B04001;HOMICIDIO TENTAD;RUA CONCEICAO DO;1044;68253;3/2/2001 03:58:00;CIDADAO COMUM;N;FU;SANTA INES;BH;613891.99;800833.38;1536
-1538;2001064279;B06000;LESAO CORPORAL;AV DO CONTORNO;8159;17228;3/2/2001 04:19:00;INICIATIVA;N;0;CENTRO BH;BH;609751.80;795477.78;1537
-1539;2001064286;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;3/2/2001 04:23:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;1538
-1540;2001064357;B03000;AMEACA;RUA NOVA SUISSA;90;23707;3/2/2001 05:42:00;CIDADAO COMUM;S;;TAQUARIL;BH;617425.46;797075.87;1539
-1541;2001064425;B03000;AMEACA;RUA CLORITA;100;16051;3/2/2001 07:11:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612847.22;797209.80;1540
-1542;2001064448;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;250;26052;3/2/2001 07:47:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611330.13;797421.35;1541
-1543;2001064522;B03000;AMEACA;RUA ALVARENGA PE;1027;2683;3/2/2001 08:52:00;CIDADAO COMUM;S;AP201;SANTO AGOSTINHO;BH;610138.17;795955.25;1542
-1544;2001064560;B03000;AMEACA;RUA JOAQUIM ANAC;23;118932;3/2/2001 09:13:00;INICIATIVA;S;0;TEIXEIRA DIAS;BH;603052.88;789295.61;1543
-1545;2001064665;B03000;AMEACA;RUA SAO MATEUS;414;63389;3/2/2001 10:29:00;CIDADAO COMUM;S;APTO 404;SAGRADA FAMILIA;BH;613396.28;799197.79;1544
-1546;2001064690;B03000;AMEACA;RUA VEBRA;5;82637;3/2/2001 10:51:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614667.55;803334.30;1545
-1547;2001064793;B03000;AMEACA;AV PRESIDENTE AN;1397;4461;3/2/2001 12:12:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610280.96;799328.31;1546
-1548;2001064860;B03000;AMEACA;RUA INDEPENDENCI;659;34391;3/2/2001 13:09:00;CIDADAO COMUM;N;;CABANA;BH;604615.33;794432.74;1547
-1549;2001065007;B03000;AMEACA;RUA DONA LUCI;10;86004;3/2/2001 14:52:00;CIDADAO COMUM;S;0;ESTRELA DALVA;BH;607227.83;791915.50;1548
-1550;2001065028;B03000;AMEACA;RUA ALEIXO LOURE;140;56650;3/2/2001 15:07:00;INICIATIVA;S;0;CARDOSO;BH;603942.21;787795.21;1549
-1551;2001065054;B06000;LESAO CORPORAL;RUA DA DESCIDA;53;65154;3/2/2001 15:23:00;CIDADAO COMUM;S;CAA;SAO JOSE;BH;605272.07;798601.47;1550
-1552;2001065143;B06000;LESAO CORPORAL;RUA SAO PAULO;124;63464;3/2/2001 16:17:00;INICIATIVA;S;0;CENTRO BH;BH;611102.49;797669.42;1551
-1553;2001065184;B03000;AMEACA;RUA DONA LUCI;10;86004;3/2/2001 16:43:00;CIDADAO COMUM;N;0;ESTRELA DALVA;BH;607227.83;791915.50;1552
-1554;2001065212;B06000;LESAO CORPORAL;RUA AUGUSTO DOS ;820;6669;3/2/2001 16:58:00;CIDADAO COMUM;S;;SINIMBU;BH;606642.44;808285.27;1553
-1555;2001065238;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;3/2/2001 17:12:00;INICIATIVA;S;0;TIROL;BH;600947.66;789885.51;1554
-1556;2001065260;B06000;LESAO CORPORAL;RUA DEMERGINA MA;112;48756;3/2/2001 17:23:00;CIDADAO COMUM;S;0;JONAS VEIGA;BH;616164.65;797149.10;1555
-1557;2001065269;B06000;LESAO CORPORAL;RUA OITENTA E DO;25;124223;3/2/2001 17:26:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607793.10;811865.64;1556
-1558;2001065295;B03000;AMEACA;RUA NHONHO BROCH;35;47580;3/2/2001 17:41:00;INICIATIVA;N;0;DAS INDUSTRIAS;BH;604735.48;792089.49;1557
-1559;2001065296;B03000;AMEACA;RUA GERALDO FERR;213;96222;3/2/2001 17:40:00;CIDADAO COMUM;N;CAA;MANTIQUEIRA;BH;606241.53;810809.31;1558
-1560;2001065308;B03000;AMEACA;RUA ENGENHO DA N;143;94504;3/2/2001 17:49:00;CIDADAO COMUM;N;;ENGENHO NOGUEIRA;BH;606394.76;800258.95;1559
-1561;2001065316;B03000;AMEACA;RUA JULIO PIRES ;97;39543;3/2/2001 17:53:00;CIDADAO COMUM;S;CAA;RIO BRANCO;BH;607122.60;808788.73;1560
-1562;2001065365;B06000;LESAO CORPORAL;RUA ANIBAL BENEV;231;4083;3/2/2001 18:24:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613656.92;796467.64;1561
-1563;2001065386;B03000;AMEACA;RUA BOLIVAR FERR;156;89995;3/2/2001 18:36:00;CIDADAO COMUM;N;;PALMEIRAS;BH;607337.16;791539.73;1562
-1564;2001065391;B06000;LESAO CORPORAL;RUA JOSE CLEMENT;542;38670;3/2/2001 18:42:00;CIDADAO COMUM;S;;IPIRANGA;BH;611983.53;800784.84;1563
-1565;2001065402;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;2222;57830;3/2/2001 18:49:00;INICIATIVA;S;0;ESTORIL;BH;608853.99;793279.32;1564
-1566;2001065409;B06000;LESAO CORPORAL;RUA TEREZINHA FR;12;105136;3/2/2001 18:51:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;605517.42;791015.18;1565
-1567;2001065419;B06000;LESAO CORPORAL;RUA SERRINHA;172;129201;3/2/2001 18:54:00;CIDADAO COMUM;0;;MANGUEIRAS;BH;600395.13;787259.05;1566
-1568;2001065432;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;1499;40770;3/2/2001 19:01:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615753.66;798128.77;1567
-1569;2001065447;B06000;LESAO CORPORAL;RUA ELETRON;100;25210;3/2/2001 19:10:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612263.84;803426.36;1568
-1570;2001065450;B06000;LESAO CORPORAL;RUA YUCATAN;70;36302;3/2/2001 19:12:00;POLICIAL MILITAR;S;;SAO PEDRO;BH;611188.45;793833.06;1569
-1571;2001065452;B04001;HOMICIDIO TENTAD;RUA AUGUSTA ANDR;91;99104;3/2/2001 19:12:00;CIDADAO COMUM;N;CS1;JAQUELINE;BH;610916.35;810299.61;1570
-1572;2001065466;B03000;AMEACA;RUA BRASIL;39;10446;3/2/2001 19:22:00;CIDADAO COMUM;N;;CABANA;BH;604919.66;793520.54;1571
-1573;2001065474;B04001;HOMICIDIO TENTAD;RUA POPULAR;81;54696;3/2/2001 19:26:00;CIDADAO COMUM;N;0;SAO CRISTOVAO;BH;610254.78;799269.93;1572
-1574;2001065530;B06000;LESAO CORPORAL;RUA JOAQUIM HENR;61;106605;3/2/2001 19:53:00;CIDADAO COMUM;S;;MARIA HELENA;BH;605851.29;810925.75;1573
-1575;2001065569;B06000;LESAO CORPORAL;RUA MARIA AUTA;85;91332;3/2/2001 20:13:00;CIDADAO COMUM;N;0;PALMEIRAS;BH;606555.53;791338.66;1574
-1576;2001065614;B03000;AMEACA;RUA FERNAO DIAS;1022;28133;3/2/2001 20:20:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616049.67;798294.87;1575
-1577;2001065617;B06000;LESAO CORPORAL;RUA PROGRESSO;1242;55759;3/2/2001 20:28:00;CIDADAO COMUM;S;AP 203;MONSENHOR MESSIA;BH;607191.53;797933.65;1576
-1578;2001065639;B03000;AMEACA;RUA ANIBAL BENEV;316;4083;3/2/2001 20:42:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613731.62;796429.78;1577
-1579;2001065642;B03000;AMEACA;RUA JOSE GONCALV;985;38828;3/2/2001 20:43:00;CIDADAO COMUM;N;0;BARREIRO;BH;602322.13;790879.97;1578
-1580;2001065648;B03000;AMEACA;RUA GUARARAPES;1425;32241;3/2/2001 20:45:00;CIDADAO COMUM;S;CAFR;GLORIA;BH;602749.14;798328.63;1579
-1581;2001065651;B06000;LESAO CORPORAL;AV BRAULIO GOMES;1050;81710;3/2/2001 20:47:00;CIDADAO COMUM;N;0;ITAIPU BH;BH;599840.36;789003.21;1580
-1582;2001065795;B03000;AMEACA;RUA TEODORO BONF;120;102430;3/2/2001 21:41:00;INICIATIVA;N;0;VERA CRUZ;BH;616904.51;797429.79;1581
-1583;2001065821;B03000;AMEACA;RUA EMILIO CARAM;315;92578;3/2/2001 21:51:00;CIDADAO COMUM;S;0;CALIFORNIA;BH;603435.58;796803.82;1582
-1584;2001065838;B03000;AMEACA;RUA IARA;518;33751;3/2/2001 21:57:00;CIDADAO COMUM;S;0;POMPEIA;BH;614707.91;797693.11;1583
-1585;2001065842;B06000;LESAO CORPORAL;RUA DR GERALDO S;158;23372;3/2/2001 21:58:00;INICIATIVA;S;0;REGINA;BH;599187.17;790136.57;1584
-1586;2001065844;B06000;LESAO CORPORAL;RUA DOS JAVAES;715;37198;3/2/2001 21:58:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;606509.12;807854.37;1585
-1587;2001065847;B03000;AMEACA;RUA MAURO COURA ;155;86930;3/2/2001 22:01:00;CIDADAO COMUM;S;;NOVO PAQUETA;BH;605770.00;801615.17;1586
-1588;2001065857;B06000;LESAO CORPORAL;RUA JOSE OURIVIO;103;39023;3/2/2001 22:05:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610133.84;801161.17;1587
-1589;2001065899;B06000;LESAO CORPORAL;RUA ALFREDO ALVE;237;20636;3/2/2001 22:31:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608508.39;808007.47;1588
-1590;2001065902;B06000;LESAO CORPORAL;RUA SAO PAULO;412;90213;3/2/2001 22:32:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602793.89;802510.17;1589
-1591;2001065911;B06000;LESAO CORPORAL;RUA TRES;210;302811;3/2/2001 22:35:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614468.64;806039.61;1590
-1592;2001065929;B04001;HOMICIDIO TENTAD;RUA DALVA DE MAT;29;19595;3/2/2001 22:43:00;CIDADAO COMUM;S;;SANTA MONICA DO ;BH;606094.58;808319.55;1591
-1593;2001065951;B06000;LESAO CORPORAL;RUA AMARANTO;183;3080;3/2/2001 22:55:00;CIDADAO COMUM;N;0;LINDEIA;BH;599445.88;790872.47;1592
-1594;2001065966;B03000;AMEACA;RUA CAPITAO PROC;26;12886;3/2/2001 23:03:00;CIDADAO COMUM;S;A;SANTA TEREZA;BH;612952.30;797362.40;1593
-1595;2001065990;B03000;AMEACA;RUA MARIANA;1204;44380;3/2/2001 23:13:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609625.10;798862.81;1594
-1596;2001066063;B03000;AMEACA;RUA NELSON HUNGR;10;46634;3/2/2001 23:52:00;CIDADAO COMUM;S;CAA;TUPI;BH;612851.92;806239.44;1595
-1597;2001066080;B03000;AMEACA;AV VEREADOR CICE;655;19756;4/2/2001 00:01:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604995.41;796458.52;1596
-1598;2001066084;B06000;LESAO CORPORAL;RUA ARISTOLINO B;151;41089;4/2/2001 00:03:00;INICIATIVA;S;0;REGINA;BH;598850.12;789949.69;1597
-1599;2001066136;B03000;AMEACA;RUA RADIALISTA W;56;98823;4/2/2001 00:35:00;CIDADAO COMUM;N;0;CEU AZUL;BH;604488.67;808458.66;1598
-1600;2001066188;B06000;LESAO CORPORAL;RUA CORONEL JOAQ;308;87063;4/2/2001 01:06:00;INICIATIVA;N;0;CEU AZUL;BH;604708.59;807851.94;1599
-1601;2001066271;B04001;HOMICIDIO TENTAD;RUA COROCOCO;11;76700;4/2/2001 01:49:00;INICIATIVA;S;0;NOVO AARAO REIS;BH;614329.87;806083.51;1600
-1602;2001066382;B02000;RIXA;RUA ALVARES MACI;312;2756;4/2/2001 02:58:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;612816.00;796590.28;1601
-1603;2001066390;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;4/2/2001 03:04:00;CIDADAO COMUM;N;;TIROL;BH;600947.66;789885.51;1602
-1604;2001066394;B06000;LESAO CORPORAL;AV ANTONIO ABRAH;1100;4320;4/2/2001 03:05:00;CIDADAO COMUM;S;0;SAO JOSE;BH;607791.03;803406.56;1603
-1605;2001066417;B03000;AMEACA;RUA JOAO PIRES;357;37866;4/2/2001 03:21:00;CIDADAO COMUM;N;;JARDINOPOLIS;BH;604771.54;794346.93;1604
-1606;2001066466;B06000;LESAO CORPORAL;RUA PROFESSORA V;3;56893;4/2/2001 03:42:00;CIDADAO COMUM;N;CSA;CHACARAS REUNIDA;BH;605513.76;789431.48;1605
-1607;2001066515;B06000;LESAO CORPORAL;RUA CAMELIA;110;11842;4/2/2001 04:32:00;CIDADAO COMUM;S;;BANDEIRANTES DO ;BH;606343.03;793587.88;1606
-1608;2001066542;B04001;HOMICIDIO TENTAD;RUA NINIVE;64;47700;4/2/2001 04:51:00;CIDADAO COMUM;S;CAA;SAO SALVADOR;BH;603563.72;799724.10;1607
-1609;2001066544;B06000;LESAO CORPORAL;RUA TENENTE VITO;71;67351;4/2/2001 04:51:00;INICIATIVA;N;0;SANTA TEREZA;BH;613395.47;797441.30;1608
-1610;2001066567;B03000;AMEACA;RUA VINHEDO;179;111858;4/2/2001 05:17:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599333.04;789042.72;1609
-1611;2001066648;B03000;AMEACA;RUA DA PEDREIRA;400;301298;4/2/2001 07:03:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;608618.39;794087.94;1610
-1612;2001066749;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;350;26052;4/2/2001 08:52:00;INICIATIVA;N;0;CENTRO BH;BH;611301.04;797310.96;1611
-1613;2001066790;B03000;AMEACA;AV AGENOR DE PAU;84;86250;4/2/2001 09:27:00;CIDADAO COMUM;N;;VILA FREI LEOPOL;BH;611111.29;809996.06;1612
-1614;2001066807;B06000;LESAO CORPORAL;RUA SETE DE OUTU;377;85030;4/2/2001 09:41:00;CIDADAO COMUM;N;;JARDIM DOS COMER;BH;607382.83;811141.67;1613
-1615;2001066816;B04001;HOMICIDIO TENTAD;RUA CARMELITA CO;140;93366;4/2/2001 09:56:00;CIDADAO COMUM;S;CA1;MINEIRAO;BH;600972.13;785917.35;1614
-1616;2001066847;B03000;AMEACA;RUA K;132;78774;4/2/2001 10:13:00;CIDADAO COMUM;S;0;CH JATOBA IV;BH;600562.64;787899.51;1615
-1617;2001066882;B03000;AMEACA;RUA BENEDITO NEV;185;9061;4/2/2001 10:45:00;CIDADAO COMUM;N;AP1202;NAZARE;BH;615997.83;804535.57;1616
-1618;2001066908;B03000;AMEACA;RUA CARMO;97;170992;4/2/2001 11:14:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608239.92;794053.80;1617
-1619;2001066963;B06000;LESAO CORPORAL;RUA CAMPINA VERD;65;12110;4/2/2001 12:14:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;606175.99;794495.57;1618
-1620;2001067032;B03000;AMEACA;RUA CAIO VIANA M;604;11477;4/2/2001 13:08:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604706.23;789321.47;1619
-1621;2001067052;B03000;AMEACA;AV BERNARDO VASC;2295;9411;4/2/2001 13:22:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;611969.00;801923.00;1620
-1622;2001067131;B03000;AMEACA;RUA CARLOS PINHE;19;13498;4/2/2001 14:19:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;606713.12;798861.18;1621
-1623;2001067142;B03000;AMEACA;RUA CARLOS EDUAR;210;92073;4/2/2001 14:22:00;CIDADAO COMUM;N;;CALIFORNIA;BH;602559.02;797182.09;1622
-1624;2001067193;B03000;AMEACA;AV PRESIDENTE CA;2020;55125;4/2/2001 15:04:00;CIDADAO COMUM;N;;CAICARA;BH;608432.84;800193.57;1623
-1625;2001067217;B03000;AMEACA;RUA PADRE FEIJO;416;51326;4/2/2001 15:21:00;INICIATIVA;S;0;SAUDADE;BH;615275.06;797524.13;1624
-1626;2001067392;B03000;AMEACA;RUA SAMUEL GAMMO;60;89591;4/2/2001 17:09:00;CIDADAO COMUM;S;;PALMEIRAS;BH;606686.57;790636.24;1625
-1627;2001067441;B06000;LESAO CORPORAL;AV UM;690;110679;4/2/2001 17:38:00;CIDADAO COMUM;N;CAA;JARDIM GUANABARA;BH;611709.66;807996.63;1626
-1628;2001067472;B03000;AMEACA;RUA DA FORTUNA;420;29209;4/2/2001 17:54:00;CIDADAO COMUM;S;0;SANTA CRUZ (BARR;BH;603043.11;788655.87;1627
-1629;2001067480;B04002;HOMICIDIO CONSUM;RUA GENTIOS;109;30983;4/2/2001 17:59:00;CIDADAO COMUM;N;;LUXEMBURGO;BH;608911.22;793572.33;1628
-1630;2001067494;B03000;AMEACA;RUA ESTRADA NOVA;224;170517;4/2/2001 18:06:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608342.46;794041.79;1629
-1631;2001067517;B06000;LESAO CORPORAL;AV DO CONTORNO;777;17228;4/2/2001 18:17:00;POLICIAL MILITAR;N;0;CENTRO (BH);BH;611399.16;797723.83;1630
-1632;2001067520;B06000;LESAO CORPORAL;RUA FLOR DA AMEI;240;77539;4/2/2001 18:17:00;CIDADAO COMUM;S;;JARDIM ALVORADA;BH;606203.88;800157.23;1631
-1633;2001067589;B03000;AMEACA;RUA COSTA JUNIOR;97;18321;4/2/2001 18:58:00;CIDADAO COMUM;N;97B;NOVA CACHOEIRINH;BH;609712.41;801469.91;1632
-1634;2001067703;B04001;HOMICIDIO TENTAD;RUA JOAQUIM PURI;5;96087;4/2/2001 20:03:00;INICIATIVA;N;0;MARIA GORETTI;BH;614651.86;803376.96;1633
-1635;2001067713;B03000;AMEACA;RUA DO CAFE;250;11389;4/2/2001 20:08:00;CIDADAO COMUM;S;FR;SANTA CRUZ (BARR;BH;603088.07;788898.98;1634
-1636;2001067714;B04002;HOMICIDIO CONSUM;RUA EPAMINONDAS ;305;25696;4/2/2001 20:09:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;604790.40;793595.99;1635
-1637;2001067723;B06000;LESAO CORPORAL;RUA MANHUMIRIM;737;42908;4/2/2001 20:15:00;INICIATIVA;N;0;ADELAIDE;BH;607822.69;798019.82;1636
-1638;2001067729;B03000;AMEACA;RUA MADRE SILVA;10;42384;4/2/2001 20:18:00;CIDADAO COMUM;S;0;ESPLANADA;BH;614409.41;798868.24;1637
-1639;2001067889;B03000;AMEACA;RUA JOAO ABRAS;115;124920;4/2/2001 21:41:00;CIDADAO COMUM;N;;MANGUEIRAS;BH;600549.95;786723.91;1638
-1640;2001067925;B03000;AMEACA;RUA MILTON DIAS;253;82712;4/2/2001 21:55:00;INICIATIVA;S;0;JARDIM VITORIA;BH;617102.88;803874.69;1639
-1641;2001067947;B03000;AMEACA;RUA DETETIVE WIL;168;21815;4/2/2001 22:08:00;POLICIAL MILITAR;S;0;DAS INDUSTRIAS;BH;605205.22;791432.67;1640
-1642;2001067981;B03000;AMEACA;RUA ESPINOSA;1062;26024;4/2/2001 22:25:00;INICIATIVA;N;0;CARLOS PRATES;BH;608710.01;797660.23;1641
-1643;2001067982;B03000;AMEACA;RUA LUIZ LOPES;68;94431;4/2/2001 22:26:00;CIDADAO COMUM;S;;OURO PRETO;BH;606229.55;801269.61;1642
-1644;2001067989;B04001;HOMICIDIO TENTAD;RUA CAMPANARIO;513;12010;4/2/2001 22:30:00;CIDADAO COMUM;S;0;SANTA INES;BH;614382.53;800754.13;1643
-1645;2001068010;B03000;AMEACA;RUA DAS FLORES;132;28930;4/2/2001 22:45:00;CIDADAO COMUM;N;AP32;NOVA SUISSA;BH;607488.91;795325.47;1644
-1646;2001068067;B06000;LESAO CORPORAL;AV PRUDENTE DE M;1150;55774;4/2/2001 23:13:00;CIDADAO COMUM;S;;CORACAO DE JESUS;BH;610007.32;794115.40;1645
-1647;2001068086;B04001;HOMICIDIO TENTAD;RUA CONTAGEM;801;70293;4/2/2001 23:19:00;CIDADAO COMUM;S;CAA;BOA VISTA;BH;614535.71;800352.87;1646
-1648;2001068120;B06000;LESAO CORPORAL;RUA RAINHA DAS F;39;92159;4/2/2001 23:37:00;CIDADAO COMUM;S;0;FILADELFIA;BH;602179.51;797574.42;1647
-1649;2001068144;B03000;AMEACA;RUA PAMIR;191;51947;4/2/2001 23:50:00;CIDADAO COMUM;S;;CH BETANIA;BH;605245.60;792168.52;1648
-1650;2001068214;B06000;LESAO CORPORAL;RUA JOSE BENEVID;451;99580;5/2/2001 00:21:00;CIDADAO COMUM;S;0;LETICIA;BH;606760.76;809412.33;1649
-1651;2001068229;B06000;LESAO CORPORAL;RUA DES BARCELOS;1500;19904;5/2/2001 00:30:00;INICIATIVA;S;0;JARDIM AMERICA;BH;606729.35;795407.19;1650
-1652;2001068305;B06000;LESAO CORPORAL;RUA LUIZ LOPES;22;94431;5/2/2001 01:13:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606191.02;801329.52;1651
-1653;2001068306;B03000;AMEACA;AV SILVA LOBO;237;65889;5/2/2001 01:11:00;POLICIAL MILITAR;N;;CALAFATE;BH;607663.44;796335.47;1652
-1654;2001068311;B03000;AMEACA;RUA GERALDO FERR;213;96222;5/2/2001 01:16:00;CIDADAO COMUM;S;C;MANTIQUEIRA;BH;606241.53;810809.31;1653
-1655;2001068324;B03000;AMEACA;RUA I;129;36687;5/2/2001 01:32:00;CIDADAO COMUM;S;0;MINASCAIXA;BH;609198.28;809916.80;1654
-1656;2001068361;B06000;LESAO CORPORAL;AV BIAS FORTES;1772;9553;5/2/2001 02:02:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610196.72;797244.85;1655
-1657;2001068440;B06000;LESAO CORPORAL;AV CIVILIZACAO;730;51657;5/2/2001 03:10:00;CIDADAO COMUM;S;;JARDIM FLORENCIA;BH;609311.62;808604.54;1656
-1658;2001068536;B03000;AMEACA;RUA VIANA DO CAS;1167;63640;5/2/2001 06:04:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609175.75;801372.41;1657
-1659;2001068657;B06000;LESAO CORPORAL;RUA TIMOTEO NONA;229;86161;5/2/2001 08:16:00;CIDADAO COMUM;N;;JAQUELINE;BH;611446.46;810532.25;1658
-1660;2001068734;B06000;LESAO CORPORAL;RUA TIRADENTES;90;85607;5/2/2001 09:00:00;CIDADAO COMUM;S;;ALVORADA (SB);SB;615497.04;802314.39;1659
-1661;2001068748;B06000;LESAO CORPORAL;RUA ANTONIO SILV;141;87108;5/2/2001 09:12:00;CIDADAO COMUM;S;0;DA LAGOA;BH;604758.70;808936.59;1660
-1662;2001068943;B03000;AMEACA;RUA FLOR DE MAIO;152;300399;5/2/2001 11:35:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614299.55;794710.96;1661
-1663;2001068976;B03000;AMEACA;RUA ALFREDO ALVE;468;20636;5/2/2001 11:57:00;INICIATIVA;S;0;SAO JOAO BATISTA;BH;608516.97;808041.50;1662
-1664;2001068995;B06000;LESAO CORPORAL;AV OLEGARIO MACI;1206;49699;5/2/2001 12:08:00;INICIATIVA;S;0;LOURDES;BH;610340.00;796469.41;1663
-1665;2001068999;B03000;AMEACA;RUA BOACHA;378;9695;5/2/2001 12:11:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604947.57;797405.33;1664
-1666;2001069095;B03000;AMEACA;RUA JAIR NEGRAO ;5;21944;5/2/2001 13:39:00;INICIATIVA;S;0;JARDIM ESTRELA;BH;607349.55;810148.64;1665
-1667;2001069132;B03000;AMEACA;AV BRASIL;237;10420;5/2/2001 13:59:00;CIDADAO COMUM;N;SL1003;SANTA EFIGENIA;BH;612812.64;796502.70;1666
-1668;2001069146;B06000;LESAO CORPORAL;RUA ALEXANDRE TO;186;2163;5/2/2001 14:06:00;CIDADAO COMUM;S;;HORTO;BH;613173.91;798217.77;1667
-1669;2001069347;B03000;AMEACA;RUA EVARISTO DA ;51;26922;5/2/2001 16:07:00;CIDADAO COMUM;N;FUNDOS;PRADO LOPES;BH;610160.34;798662.11;1668
-1670;2001069374;B03000;AMEACA;RUA SANTO ANDRE;115;26282;5/2/2001 16:19:00;CIDADAO COMUM;S;;TAQUARIL;BH;617403.36;797627.63;1669
-1671;2001069406;B03000;AMEACA;RUA CHIQUINHA GO;120;97200;5/2/2001 16:37:00;CIDADAO COMUM;N;;TUPI;BH;613769.37;806154.10;1670
-1672;2001069466;B03000;AMEACA;RUA CORONEL PEDR;128;18031;5/2/2001 16:59:00;CIDADAO COMUM;S;;CIDADE NOVA;BH;612312.95;800326.26;1671
-1673;2001069495;B04001;HOMICIDIO TENTAD;RUA TIGRE;471;67639;5/2/2001 17:18:00;INICIATIVA;N;0;SAO SALVADOR;BH;603394.12;800043.56;1672
-1674;2001069516;B03000;AMEACA;RUA SERRA DOS AI;154;65025;5/2/2001 17:27:00;CIDADAO COMUM;N;0;JARDIM LEBLON;BH;605851.32;807675.65;1673
-1675;2001069592;B06000;LESAO CORPORAL;RUA PIRACICABA;207;54047;5/2/2001 18:09:00;CIDADAO COMUM;N;0;PEDRO SEGUNDO;BH;608102.79;798417.13;1674
-1676;2001069604;B04001;HOMICIDIO TENTAD;RUA ALGARVE;400;61396;5/2/2001 18:16:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609107.38;801969.00;1675
-1677;2001069634;B03000;AMEACA;RUA SILVA ALVARE;626;65810;5/2/2001 18:32:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615385.74;799442.89;1676
-1678;2001069646;B03000;AMEACA;RUA MOISES;117;46114;5/2/2001 18:38:00;POLICIAL MILITAR;S;;SAO SALVADOR;BH;603000.91;799203.73;1677
-1679;2001069679;B06000;LESAO CORPORAL;ESTRADA DO CERCA;2603;26428;5/2/2001 18:51:00;CIDADAO COMUM;S;;HAVAI;BH;607721.78;793319.05;1678
-1680;2001069712;B03000;AMEACA;RUA PEONIA;411;115799;5/2/2001 19:03:00;CIDADAO COMUM;N;;HAVAI;BH;607162.30;793263.14;1679
-1681;2001069750;B06000;LESAO CORPORAL;AV PRESIDENTE AN;2563;4461;5/2/2001 19:27:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;609975.05;800406.95;1680
-1682;2001069814;B03000;AMEACA;RUA MARIA AMELIA;62;43800;5/2/2001 20:04:00;CIDADAO COMUM;S;0;NOVA GAMELEIRA;BH;605575.64;794758.64;1681
-1683;2001069821;B06000;LESAO CORPORAL;RUA ANA PEREIRA ;127;90415;5/2/2001 20:07:00;CIDADAO COMUM;S;;AARAO REIS;BH;613081.27;803728.83;1682
-1684;2001069849;B03000;AMEACA;RUA SEBASTIAO CL;25;108190;5/2/2001 20:22:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606855.47;811488.80;1683
-1685;2001069941;B06000;LESAO CORPORAL;RUA SETE DE OUTU;102;85030;5/2/2001 21:11:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607536.55;810892.37;1684
-1686;2001069968;B03000;AMEACA;RUA MARECHAL BIT;865;43589;5/2/2001 21:31:00;CIDADAO COMUM;N;AP601;GUTIERREZ;BH;608918.42;795085.07;1685
-1687;2001070040;B03000;AMEACA;RUA JOSE CAMBRAI;378;80786;5/2/2001 22:08:00;CIDADAO COMUM;S;;NOVA BARROCA;BH;607453.81;793052.97;1686
-1688;2001070154;B03000;AMEACA;RUA JOSE GOMES;334;38802;5/2/2001 23:19:00;CIDADAO COMUM;N;;SARANDI (URCA/BH;BH;603682.39;802289.69;1687
-1689;2001070181;B06000;LESAO CORPORAL;RUA DOS VICENTIN;85;63159;5/2/2001 23:42:00;CIDADAO COMUM;S;;PLANALTO;BH;610711.47;805504.00;1688
-1690;2001070204;B03000;AMEACA;RUA JAGUARA;600;36775;5/2/2001 23:58:00;CIDADAO COMUM;N;0;SAUDADE;BH;615333.34;797495.39;1689
-1691;2001070241;B04001;HOMICIDIO TENTAD;AV SARAMENHA;636;64007;6/2/2001 00:30:00;INICIATIVA;N;0;FLORAMAR;BH;612390.88;805800.78;1690
-1692;2001070259;B06000;LESAO CORPORAL;RUA MARECHAL RON;68;43677;6/2/2001 00:43:00;INICIATIVA;N;0;PRIMEIRO DE MAIO;BH;611883.66;803480.80;1691
-1693;2001070283;B06000;LESAO CORPORAL;AV DO CONTORNO;5602;17228;6/2/2001 01:14:00;CIDADAO COMUM;S;0;CARMO;BH;611910.43;794907.67;1692
-1694;2001070288;B03000;AMEACA;RUA DOS BANDOLIN;1;106980;6/2/2001 01:21:00;CIDADAO COMUM;S;0;DOM BOSCO;BH;604085.47;796771.04;1693
-1695;2001070292;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;726;6353;6/2/2001 01:29:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611774.82;797225.12;1694
-1696;2001070320;B03000;AMEACA;RUA NEFELINA;99;81228;6/2/2001 02:01:00;CIDADAO COMUM;N;;SANTA TEREZA;BH;612838.15;797304.69;1695
-1697;2001070324;B03000;AMEACA;RUA CORONEL ALVA;175;17520;6/2/2001 02:04:00;CIDADAO COMUM;N;;FLORAMAR;BH;611562.81;806331.42;1696
-1698;2001070544;B06000;LESAO CORPORAL;AV BARAO HOMEM D;1270;7936;6/2/2001 07:24:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607864.45;794292.87;1697
-1699;2001070603;B06000;LESAO CORPORAL;AV SANTOS DUMONT;680;61950;6/2/2001 08:13:00;INICIATIVA;N;0;CENTRO (BH);BH;610999.13;797614.04;1698
-1700;2001070604;B06000;LESAO CORPORAL;RUA SAO CLEMENTE;807;62197;6/2/2001 08:12:00;CIDADAO COMUM;N;;SENHOR BOM JESUS;BH;609581.73;799913.96;1699
-1701;2001070701;B03000;AMEACA;RUA GUANABARA;15;32040;6/2/2001 09:22:00;CIDADAO COMUM;S;;CONCORDIA;BH;611511.11;798794.06;1700
-1702;2001070754;B03000;AMEACA;RUA M;32;120210;6/2/2001 09:53:00;CIDADAO COMUM;S;AP102;DIAMANTE;BH;602103.71;789532.87;1701
-1703;2001070769;B06000;LESAO CORPORAL;AV ITAU;512;36025;6/2/2001 10:10:00;CIDADAO COMUM;S;;DOM BOSCO;BH;605311.81;797266.71;1702
-1704;2001070816;B03000;AMEACA;AV BERNARDO VASC;288;9411;6/2/2001 10:34:00;CIDADAO COMUM;S;E M PROF. HEONOR;CACHOEIRINHA;BH;609909.14;801037.91;1703
-1705;2001070823;B03000;AMEACA;RUA POLONIA;15;54541;6/2/2001 10:38:00;CIDADAO COMUM;N;0;COPACABANA;BH;605659.23;806545.79;1704
-1706;2001070846;B03000;AMEACA;ESTRADA DOS BORG;104;85893;6/2/2001 10:50:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616597.33;804710.50;1705
-1707;2001070848;B06000;LESAO CORPORAL;RUA QUARENTA E S;84;302843;6/2/2001 10:50:00;INICIATIVA;S;0;NOVO ARAO REIS;BH;614233.65;805810.54;1706
-1708;2001070982;B03000;AMEACA;RUA H;12;78295;6/2/2001 12:20:00;CIDADAO COMUM;S;0;VILA PINHO;BH;601931.42;788161.20;1707
-1709;2001071260;B06000;LESAO CORPORAL;RUA SAO GERALDO;275;170283;6/2/2001 15:35:00;CIDADAO COMUM;S;;CABANA;BH;604775.39;793964.32;1708
-1710;2001071267;B06000;LESAO CORPORAL;RUA JACAREI;353;13154;6/2/2001 15:40:00;INICIATIVA;N;0;COQUEIROS;BH;602568.63;798483.85;1709
-1711;2001071341;B06000;LESAO CORPORAL;RUA DOS TUPIS;666;69965;6/2/2001 16:18:00;INICIATIVA;N;0;BARRO PRETO;BH;610636.56;797022.10;1710
-1712;2001071412;B06000;LESAO CORPORAL;RUA SILVEIRA MAR;283;65977;6/2/2001 16:56:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609501.21;800093.16;1711
-1713;2001071474;B03000;AMEACA;RUA MARIANO PROC;997;44424;6/2/2001 17:33:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604645.59;796389.21;1712
-1714;2001071545;B03000;AMEACA;RUA OLAVO BILAC;311;49660;6/2/2001 18:15:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607863.74;807696.64;1713
-1715;2001071609;B03000;AMEACA;RUA DA FLAGELACA;123;56042;6/2/2001 18:53:00;CIDADAO COMUM;S;CAFRENT;SAO JOSE;BH;605589.94;798801.47;1714
-1716;2001071644;B03000;AMEACA;RUA JOSE JOAO GA;109;24551;6/2/2001 19:08:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600794.39;787466.77;1715
-1717;2001071645;B03000;AMEACA;AV ALTAMIRO AVEL;391;122937;6/2/2001 19:08:00;CIDADAO COMUM;N;0;CASTELO;BH;604570.40;801462.65;1716
-1718;2001071740;B06000;LESAO CORPORAL;AV OIAPOQUE;284;49166;6/2/2001 19:56:00;INICIATIVA;S;0;CENTRO (BH);BH;610899.84;797829.02;1717
-1719;2001071754;B03000;AMEACA;AV NOSSA SENHORA;344;48311;6/2/2001 20:00:00;CIDADAO COMUM;S;CAFR;PRIMEIRO DE NOVE;BH;612802.94;805193.38;1718
-1720;2001071788;B03000;AMEACA;AV DOS ANDRADAS;3520;3761;6/2/2001 20:21:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613892.46;797180.43;1719
-1721;2001071831;B04001;HOMICIDIO TENTAD;RUA ELIAS SALIBA;202;58961;6/2/2001 20:50:00;CIDADAO COMUM;S;0;NOVO GLORIA;BH;602991.88;798853.32;1720
-1722;2001071855;B02000;RIXA;AV PRESIDENTE AN;3860;4461;6/2/2001 21:06:00;INICIATIVA;N;0;CACHOEIRINHA;BH;609645.14;802028.98;1721
-1723;2001071911;B03000;AMEACA;RUA TAMBORIL;536;66793;6/2/2001 21:33:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611236.65;799260.64;1722
-1724;2001071966;B04002;HOMICIDIO CONSUM;RUA TEBAS;892;67090;6/2/2001 21:57:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616165.12;798336.16;1723
-1725;2001072104;B06000;LESAO CORPORAL;RUA JOAQUIM SOAR;466;38190;6/2/2001 23:17:00;CIDADAO COMUM;S;0;FLORAMAR;BH;612307.60;805870.83;1724
-1726;2001072156;B03000;AMEACA;RUA UM;32;27979;6/2/2001 23:45:00;CIDADAO COMUM;N;CAA;CAPITAO EDUARDO;BH;618614.13;806901.22;1725
-1727;2001072171;B04001;HOMICIDIO TENTAD;RUA TENENTE JOAO;85;113450;6/2/2001 23:57:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611899.67;807534.07;1726
-1728;2001072180;B06000;LESAO CORPORAL;AV XIMANGO;600;73856;7/2/2001 00:07:00;INICIATIVA;S;;FLAVIO MARQUES D;BH;604518.35;788396.04;1727
-1729;2001072227;B06000;LESAO CORPORAL;AV OLEGARIO MACI;459;49699;7/2/2001 00:38:00;INICIATIVA;S;0;CENTRO (BH);BH;610594.57;797209.17;1728
-1730;2001072257;B03000;AMEACA;RUA DUARTINA;420;29278;7/2/2001 01:12:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614879.93;800739.70;1729
-1731;2001072274;B03000;AMEACA;AV OLEGARIO MACI;642;49699;7/2/2001 01:25:00;CIDADAO COMUM;S;PR642;CENTRO (BH);BH;610498.04;797083.99;1730
-1732;2001072352;B06000;LESAO CORPORAL;RUA MANOEL CAYLL;121;43043;7/2/2001 02:27:00;CIDADAO COMUM;N;;HORTO;BH;613259.68;798134.49;1731
-1733;2001072388;B04001;HOMICIDIO TENTAD;AV BERNARDO MONT;367;9392;7/2/2001 02:58:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;612374.91;796851.89;1732
-1734;2001072431;B03000;AMEACA;RUA GERALDO PEDR;337;106315;7/2/2001 03:48:00;CIDADAO COMUM;S;;NOVA YORK;BH;608385.57;811231.11;1733
-1735;2001072458;B03000;AMEACA;RUA MACEDONIA;131;38289;7/2/2001 04:19:00;CIDADAO COMUM;N;CAA;COQUEIROS;BH;603334.57;799872.76;1734
-1736;2001072492;B03000;AMEACA;AV ELIAS ANTONIO;490;104726;7/2/2001 06:00:00;CIDADAO COMUM;N;AP401;LETICIA;BH;607244.80;809413.40;1735
-1737;2001072557;B03000;AMEACA;RUA RAMIRO SIQUE;19;128858;7/2/2001 07:26:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617768.11;797161.56;1736
-1738;2001072590;B03000;AMEACA;RUA ALCIDES LINS;455;1914;7/2/2001 07:55:00;CIDADAO COMUM;S;ESCOLA STOS DUMO;VILA SANTO ANTON;BH;609186.90;808524.24;1737
-1739;2001072670;B03000;AMEACA;RUA ITAMARATI;250;48277;7/2/2001 08:58:00;CIDADAO COMUM;N;BAR NOSSO BARZIN;PIRATININGA;BH;605206.37;808939.33;1738
-1740;2001072672;B03000;AMEACA;RUA A;330;41110;7/2/2001 08:59:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602965.99;802835.21;1739
-1741;2001072747;B03000;AMEACA;RUA CORCOVADO;833;14894;7/2/2001 10:08:00;CIDADAO COMUM;S;AP301;JARDIM AMERICA;BH;607334.53;794302.08;1740
-1742;2001072774;B06000;LESAO CORPORAL;RUA ITAJUBA;954;35495;7/2/2001 10:19:00;CIDADAO COMUM;N;0;FLORESTA;BH;612190.33;798386.12;1741
-1743;2001072799;B03000;AMEACA;RUA CARMO DO RIO;288;13687;7/2/2001 10:36:00;CIDADAO COMUM;N;;PRADO LOPES;BH;609993.05;798980.09;1742
-1744;2001072875;B06000;LESAO CORPORAL;ALAMEDA EZEQUIEL;225;27446;7/2/2001 11:21:00;INICIATIVA;N;0;CENTRO (BH);BH;611899.54;796686.86;1743
-1745;2001072881;B04001;HOMICIDIO TENTAD;RUA INDEPENDENCI;340;34391;7/2/2001 11:26:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;604509.30;794718.09;1744
-1746;2001072907;B03000;AMEACA;RUA DAS PETUNIAS;969;11870;7/2/2001 11:48:00;CIDADAO COMUM;N;;LINDEIA;BH;598921.19;791104.13;1745
-1747;2001072911;B03000;AMEACA;RUA JAGUARIBE;883;36822;7/2/2001 11:53:00;CIDADAO COMUM;S;;CONCORDIA;BH;611378.39;799732.86;1746
-1748;2001072953;B06000;LESAO CORPORAL;RUA DESEMBARGADO;430;116202;7/2/2001 12:26:00;CIDADAO COMUM;S;;DONA CLARA;BH;610723.18;803594.67;1747
-1749;2001072956;B03000;AMEACA;RUA MONTE CASTEL;66;127234;7/2/2001 12:30:00;CIDADAO COMUM;S;;VILA OESTE;BH;604489.89;795257.80;1748
-1750;2001072970;B04001;HOMICIDIO TENTAD;RUA MUNIZ;149;170850;7/2/2001 12:38:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608113.39;793880.88;1749
-1751;2001073159;B03000;AMEACA;RUA ARAGUARI;628;5376;7/2/2001 14:48:00;INICIATIVA;S;INICIATIVA DA VP;BARRO PRETO;BH;609954.68;796706.40;1750
-1752;2001073181;B03000;AMEACA;RUA URSULA PAULI;1442;71066;7/2/2001 15:03:00;CIDADAO COMUM;S;0;BETANIA;BH;605777.81;792682.47;1751
-1753;2001073272;B03000;AMEACA;RUA IPE;345;34767;7/2/2001 15:44:00;CIDADAO COMUM;N;0;SAO CRISTOVAO;BH;610494.64;799268.14;1752
-1754;2001073357;B06000;LESAO CORPORAL;RUA CATALUNHA;443;14204;7/2/2001 16:18:00;CIDADAO COMUM;S;0;SARANDI (URCA/BH;BH;603933.81;802539.25;1753
-1755;2001073400;B03000;AMEACA;RUA EXPEDICIONAR;48;31627;7/2/2001 16:43:00;CIDADAO COMUM;N;;MARIA GORETTI;BH;614332.83;803360.97;1754
-1756;2001073819;B04002;HOMICIDIO CONSUM;RUA CINCO;52;78037;7/2/2001 20:40:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601318.63;786154.43;1755
-1757;2001073820;B06000;LESAO CORPORAL;AV DOM JOSE GASP;500;22339;7/2/2001 20:40:00;CIDADAO COMUM;N;CSA;CORACAO EUCARIST;BH;605797.97;796894.62;1756
-1758;2001073833;B03000;AMEACA;ALAMEDA EZEQUIEL;345;27446;7/2/2001 20:46:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611840.81;796451.07;1757
-1759;2001073843;B03000;AMEACA;RUA AMERICANOS;50;3254;7/2/2001 20:52:00;CIDADAO COMUM;S;;FAZENDINHA;BH;603722.29;790086.11;1758
-1760;2001073861;B04001;HOMICIDIO TENTAD;AV AMINTAS JAQUE;60;52546;7/2/2001 21:00:00;CIDADAO COMUM;N;0;COQUEIROS;BH;603487.16;799877.67;1759
-1761;2001073930;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;1982;17228;7/2/2001 21:39:00;CIDADAO COMUM;S;FR2107;CENTRO (BH);BH;612352.69;797370.37;1760
-1762;2001073945;B06000;LESAO CORPORAL;RUA 36;194;302834;7/2/2001 21:45:00;CIDADAO COMUM;S;REF:POSTO FELIPE;NOVO AARAO REIS;BH;613827.91;805532.46;1761
-1763;2001073956;B03000;AMEACA;RUA HELIO RODRIG;304;32950;7/2/2001 21:52:00;CIDADAO COMUM;N;0;BOA VISTA;BH;614343.25;800026.03;1762
-1764;2001073991;B06000;LESAO CORPORAL;RUA ROSEIRAL;54;59416;7/2/2001 22:12:00;CIDADAO COMUM;N;CS;SANTO ANDRE;BH;609832.66;799191.69;1763
-1765;2001074002;B03000;AMEACA;AV AUGUSTO DE LI;1096;6731;7/2/2001 22:17:00;CIDADAO COMUM;S;PX1096;BARRO PRETO;BH;610281.56;796840.01;1764
-1766;2001074043;B06000;LESAO CORPORAL;RUA FREI VICENTE;247;30029;7/2/2001 22:42:00;INICIATIVA;S;0;SANTA MONICA;BH;607277.72;807964.07;1765
-1767;2001074066;B03000;AMEACA;RUA SOROR ANA AN;70;19337;7/2/2001 22:59:00;CIDADAO COMUM;N;;CAMPO ALEGRE;BH;610387.80;807162.63;1766
-1768;2001074150;B02000;RIXA;RUA VICENTINA DE;549;71891;7/2/2001 23:52:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613595.79;798515.06;1767
-1769;2001074222;B08000;VIOLACAO DE DOMI;RUA MARMORE;614;44695;8/2/2001 00:48:00;CIDADAO COMUM;N;CSFU;SANTA TEREZA;BH;613418.76;797408.02;1768
-1770;2001074246;B06000;LESAO CORPORAL;AV PARANA;39;52230;8/2/2001 01:04:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610859.45;797471.75;1769
-1771;2001074658;B03000;AMEACA;RUA H;7;78295;8/2/2001 09:19:00;CIDADAO COMUM;S;;VILA PINHO;BH;601974.30;788329.06;1770
-1772;2001074721;B03000;AMEACA;AV BIAS FORTES;1035;9553;8/2/2001 10:03:00;CIDADAO COMUM;S;;LOURDES;BH;610553.39;796535.86;1771
-1773;2001074812;B03000;AMEACA;AV BARAO HOMEM D;1884;7936;8/2/2001 11:00:00;CIDADAO COMUM;S;;LEONINA;BH;608064.83;793456.63;1772
-1774;2001074849;B03000;AMEACA;AV NOSSA SENHORA;879;47996;8/2/2001 11:33:00;INICIATIVA;S;;CARMO;BH;611483.97;793937.14;1773
-1775;2001074858;B03000;AMEACA;RUA JOSE LAPORTE;237;123826;8/2/2001 11:37:00;INICIATIVA;S;;ESTORIL;BH;608574.77;792517.75;1774
-1776;2001074914;B03000;AMEACA;RUA PARIS;107;52316;8/2/2001 12:19:00;CIDADAO COMUM;N;0;COPACABANA;BH;606011.45;806325.41;1775
-1777;2001074943;B03000;AMEACA;RUA DOUTOR CEZAR;97;80962;8/2/2001 12:39:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605438.05;793395.99;1776
-1778;2001075012;B03000;AMEACA;AV FURQUIM WERNE;80;650;8/2/2001 13:20:00;CIDADAO COMUM;S;LJA;TUPI;BH;613037.46;805818.71;1777
-1779;2001075034;B03000;AMEACA;AV DOM JOAO VI;784;22294;8/2/2001 13:37:00;CIDADAO COMUM;S;CAFR;CINQUENTENARIO;BH;606589.71;791888.93;1778
-1780;2001075122;B03000;AMEACA;AV ARTUR BERNARD;1180;60844;8/2/2001 14:39:00;CIDADAO COMUM;S;0;VILA PARIS;BH;610180.14;793263.99;1779
-1781;2001075157;B06000;LESAO CORPORAL;RUA PONTA PORA;295;54601;8/2/2001 15:04:00;CIDADAO COMUM;S;PX36;SANTA EFIGENIA;BH;613215.57;796976.97;1780
-1782;2001075175;B06000;LESAO CORPORAL;RUA IBIRAPITANGA;59;33880;8/2/2001 15:14:00;CIDADAO COMUM;S;0;DOM CABRAL;BH;605182.78;796323.06;1781
-1783;2001075204;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;8/2/2001 15:31:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;1782
-1784;2001075207;B03000;AMEACA;AV GUANABARA;312;93400;8/2/2001 15:34:00;CIDADAO COMUM;N;CA312;SARANDI (URCA/BH;BH;602854.58;802637.55;1783
-1785;2001075232;B03000;AMEACA;RUA CURITIBA;914;19090;8/2/2001 15:47:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610779.71;797017.51;1784
-1786;2001075335;B06000;LESAO CORPORAL;RUA CARMELA ALUO;249;13558;8/2/2001 16:58:00;CIDADAO COMUM;N;0;ARAGUAIA;BH;605218.59;789628.45;1785
-1787;2001075348;B03000;AMEACA;RUA IPANEMA;1120;34726;8/2/2001 17:05:00;CIDADAO COMUM;S;0;SARANDI (URCA/BH;BH;602824.51;802350.58;1786
-1788;2001075382;B03000;AMEACA;AV AMINTAS VIDAL;1689;118769;8/2/2001 17:21:00;CIDADAO COMUM;S;AP103;NOVA GAMELEIRA;BH;605235.40;794648.57;1787
-1789;2001075421;B03000;AMEACA;RUA EXPEDICIONAR;500;27096;8/2/2001 17:44:00;CIDADAO COMUM;S;0;SAO LUIZ;BH;606853.89;803084.68;1788
-1790;2001075450;B03000;AMEACA;RUA VISEU;1178;62042;8/2/2001 17:59:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609516.82;802452.66;1789
-1791;2001075465;B06000;LESAO CORPORAL;RUA JACUI;1467;36734;8/2/2001 18:08:00;CIDADAO COMUM;N;;CONCORDIA;BH;611633.01;799247.97;1790
-1792;2001075469;B03000;AMEACA;RUA INACIO MURTA;156;34322;8/2/2001 18:10:00;CIDADAO COMUM;S;CA18;COPACABANA;BH;606337.97;805563.86;1791
-1793;2001075470;B06000;LESAO CORPORAL;RUA GERALDO FERR;170;96222;8/2/2001 18:11:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606278.02;810733.96;1792
-1794;2001075486;B03000;AMEACA;RUA YUCATAN;70;36302;8/2/2001 18:17:00;POLICIAL MILITAR;S;0;SAO PEDRO;BH;611188.45;793833.06;1793
-1795;2001075493;B06000;LESAO CORPORAL;RUA JOSE ANTONIO;62;80483;8/2/2001 18:24:00;CIDADAO COMUM;S;;JARDIM ALVORADA;BH;606114.48;800215.54;1794
-1796;2001075514;B06000;LESAO CORPORAL;RUA SAO CRISTOVA;70;25378;8/2/2001 18:35:00;CIDADAO COMUM;N;;TAQUARIL;BH;617039.20;797453.04;1795
-1797;2001075541;B06000;LESAO CORPORAL;RUA M;3;27184;8/2/2001 18:49:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616370.43;806971.69;1796
-1798;2001075618;B03000;AMEACA;RUA JOSE BERNARD;41;83251;8/2/2001 19:26:00;CIDADAO COMUM;N;;SANTA HELENA (BH;BH;603509.72;789328.98;1797
-1799;2001075724;B06000;LESAO CORPORAL;RUA AARAO REIS;194;473;8/2/2001 20:30:00;INICIATIVA;S;0;CENTRO BH;BH;611579.10;797272.30;1798
-1800;2001075739;B03000;AMEACA;RUA V;176;118150;8/2/2001 20:40:00;CIDADAO COMUM;S;;CH TUNEL DE IBIR;BH;599765.67;789621.94;1799
-1801;2001075749;B06000;LESAO CORPORAL;RUA ENGENHO DA E;69;94977;8/2/2001 20:46:00;CIDADAO COMUM;N;CAFU;ENGENHO NOGUEIRA;BH;606438.46;800149.67;1800
-1802;2001075751;B03000;AMEACA;RUA SAUDE;252;64164;8/2/2001 20:47:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605595.24;797841.46;1801
-1803;2001075797;B03000;AMEACA;RUA PEDRO AMERIC;320;113157;8/2/2001 21:14:00;CIDADAO COMUM;S;CSFR;TUPI;BH;613781.51;806534.29;1802
-1804;2001075805;B04001;HOMICIDIO TENTAD;RUA ROMA;105;59227;8/2/2001 21:18:00;CIDADAO COMUM;S;;COPACABANA;BH;606318.49;806279.57;1803
-1805;2001075811;B03000;AMEACA;RUA PROFESSOR AI;808;72608;8/2/2001 21:21:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608500.71;807940.36;1804
-1806;2001076026;B03000;AMEACA;AV ITAITE;504;35441;8/2/2001 23:04:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615257.50;799429.25;1805
-1807;2001076062;B06000;LESAO CORPORAL;RUA SAO CRISTOVA;199;62229;8/2/2001 23:19:00;CIDADAO COMUM;N;0;SAO BERNARDO;BH;610869.22;805058.68;1806
-1808;2001076067;B03000;AMEACA;RUA GENTIOS;1350;30983;8/2/2001 23:19:00;INICIATIVA;S;HT 124.14 SD MAR;CORACAO DE JESUS;BH;608905.13;793585.28;1807
-1809;2001076070;B06000;LESAO CORPORAL;RUA A;128;78673;8/2/2001 23:26:00;CIDADAO COMUM;N;;CH JATOBA IV;BH;600210.63;787810.91;1808
-1810;2001076075;B06000;LESAO CORPORAL;AV AGENOR DE PAU;280;86250;8/2/2001 23:28:00;POLICIAL MILITAR;N;0;JAQUELINE;BH;611517.37;810264.32;1809
-1811;2001076103;B03000;AMEACA;RUA BARAO DE LEO;330;7964;8/2/2001 23:41:00;CIDADAO COMUM;N;;ALTO DOS PINHEIR;BH;604194.18;796281.95;1810
-1812;2001076111;B03000;AMEACA;RUA FREI MARTINH;42;94154;8/2/2001 23:45:00;CIDADAO COMUM;S;0;PAQUETA;BH;605242.03;802751.03;1811
-1813;2001076231;B06000;LESAO CORPORAL;RUA NICOLINA DE ;15;44263;9/2/2001 01:45:00;INICIATIVA;S;0;HAVAI;BH;607302.26;793743.23;1812
-1814;2001076252;B04001;HOMICIDIO TENTAD;RUA JOAQUIM GOUV;10;1422;9/2/2001 01:55:00;INICIATIVA;S;0;SAO PAULO;BH;612535.79;802867.60;1813
-1815;2001076323;B03000;AMEACA;RUA CORONEL NEWT;332;124872;9/2/2001 02:51:00;CIDADAO COMUM;S;0;MANGUEIRAS;BH;600855.58;786772.21;1814
-1816;2001076328;B03000;AMEACA;RUA POTOMAIO;658;54920;9/2/2001 02:57:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;615643.99;799123.70;1815
-1817;2001076354;B06000;LESAO CORPORAL;RUA DIVINO ESPIR;75;96768;9/2/2001 03:27:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;614662.44;806404.94;1816
-1818;2001076375;B06000;LESAO CORPORAL;AV URUGUAI;96;71113;9/2/2001 03:46:00;CIDADAO COMUM;N;0;SION;BH;611525.36;793887.62;1817
-1819;2001076612;B03000;AMEACA;RUA JOAO BATISTA;60;97745;9/2/2001 08:47:00;CIDADAO COMUM;N;;DOM SILVERIO;BH;614734.92;804019.88;1818
-1820;2001076653;B03000;AMEACA;RUA PADRE EUSTAQ;1255;51294;9/2/2001 09:25:00;CIDADAO COMUM;N;LJ02;CARLOS PRATES;BH;608384.30;797938.60;1819
-1821;2001076722;B03000;AMEACA;RUA COPO DE LEIT;40;98606;9/2/2001 10:24:00;CIDADAO COMUM;S;;VILA FREI LEOPOL;BH;611148.28;809422.81;1820
-1822;2001076772;B03000;AMEACA;AV DOM JOAO VI;784;22294;9/2/2001 10:54:00;CIDADAO COMUM;S;CAFR;CINQUENTENARIO;BH;606589.71;791888.93;1821
-1823;2001076992;B06000;LESAO CORPORAL;RUA YUCATAN;70;36302;9/2/2001 13:46:00;INICIATIVA;S;;SAO PEDRO;BH;611188.45;793833.06;1822
-1824;2001077010;B03000;AMEACA;RUA AMERICO MART;310;46228;9/2/2001 14:01:00;CIDADAO COMUM;N;;MINASLANDIA;BH;612269.47;804162.89;1823
-1825;2001077087;B06000;LESAO CORPORAL;RUA GERALDO FERR;78;96222;9/2/2001 14:56:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606284.84;810641.13;1824
-1826;2001077237;B04001;HOMICIDIO TENTAD;AV SILVA LOBO;2425;65889;9/2/2001 16:24:00;INICIATIVA;S;0;GRAJAU;BH;608493.57;794563.18;1825
-1827;2001077285;B04002;HOMICIDIO CONSUM;RUA CAMILA DE SO;100;74294;9/2/2001 16:52:00;CIDADAO COMUM;N;0;SAO JOAO BATISTA;BH;608167.22;807611.94;1826
-1828;2001077311;B06000;LESAO CORPORAL;RUA QUITANDINHA;176;57600;9/2/2001 17:11:00;POLICIAL MILITAR;S;0;SERRANO;BH;603414.69;800598.96;1827
-1829;2001077333;B06000;LESAO CORPORAL;RUA PADRE CORREA;327;51266;9/2/2001 17:26:00;CIDADAO COMUM;S;PX327;SANTA EFIGENIA;BH;614030.80;796078.14;1828
-1830;2001077417;B06000;LESAO CORPORAL;RUA CONCHAS;196;80178;9/2/2001 18:11:00;CIDADAO COMUM;N;;COQUEIROS;BH;602671.11;799789.15;1829
-1831;2001077449;B06000;LESAO CORPORAL;RUA ERNESTO TOGN;37;129850;9/2/2001 18:29:00;CIDADAO COMUM;N;0;GORDURAS;BH;616207.37;803889.32;1830
-1832;2001077475;B03000;AMEACA;RUA VASCO BALBOA;507;102396;9/2/2001 18:47:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616645.98;797621.02;1831
-1833;2001077521;B04001;HOMICIDIO TENTAD;RUA SERRINHA;19;129201;9/2/2001 19:13:00;CIDADAO COMUM;N;0;INDEPENDENCIA;BH;600519.25;786719.95;1832
-1834;2001077570;B04001;HOMICIDIO TENTAD;RUA DEZOITO;47;80225;9/2/2001 19:41:00;INICIATIVA;S;0;NOVA CINTRA;BH;605380.91;793339.84;1833
-1835;2001077754;B03000;AMEACA;RUA E;25;24609;9/2/2001 21:14:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613409.70;798697.81;1834
-1836;2001077877;B03000;AMEACA;AV AMINTAS JAQUE;131;52546;9/2/2001 22:26:00;CIDADAO COMUM;N;;COQUEIROS;BH;602749.04;799120.63;1835
-1837;2001077892;B03000;AMEACA;RUA CLOTILDE RIB;12;72507;9/2/2001 22:35:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608811.96;807889.70;1836
-1838;2001077894;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;527;31400;9/2/2001 22:37:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610800.99;796803.14;1837
-1839;2001077922;B04001;HOMICIDIO TENTAD;RUA DES BRAULIO;1522;19917;9/2/2001 22:52:00;INICIATIVA;N;0;VERA CRUZ;BH;616275.72;797731.58;1838
-1840;2001077945;B06000;LESAO CORPORAL;RUA GOIAS;58;31393;9/2/2001 23:01:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611325.19;796598.30;1839
-1841;2001078018;B06000;LESAO CORPORAL;RUA BRASIL;15;10446;9/2/2001 23:45:00;CIDADAO COMUM;S;;CABANA;BH;604813.51;793739.13;1840
-1842;2001078030;B03000;AMEACA;RUA PRINCESA LEO;110;55327;9/2/2001 23:54:00;CIDADAO COMUM;S;FU;IPIRANGA;BH;611523.35;801138.47;1841
-1843;2001078141;B03000;AMEACA;RUA ESTEVAO MUSS;227;26327;10/2/2001 00:49:00;CIDADAO COMUM;S;;NOVA GAMELEIRA;BH;605568.02;794405.75;1842
-1844;2001078189;B03000;AMEACA;RUA JOSE FERREIR;80;69650;10/2/2001 01:16:00;CIDADAO COMUM;N;;FLORAMAR;BH;611705.38;806398.85;1843
-1845;2001078203;B03000;AMEACA;AV SARAMENHA;1150;64007;10/2/2001 01:24:00;CIDADAO COMUM;S;;GUARANI;BH;612916.89;805724.57;1844
-1846;2001078255;B03000;AMEACA;RUA DELFIM MOREI;11;19730;10/2/2001 01:53:00;CIDADAO COMUM;N;0;BOA VISTA;BH;614618.57;800009.25;1845
-1847;2001078280;B06000;LESAO CORPORAL;RUA OSWALDO JOSE;50;20160;10/2/2001 02:10:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609180.23;809203.87;1846
-1848;2001078281;B04001;HOMICIDIO TENTAD;RUA DOUTOR CRIST;390;55598;10/2/2001 02:12:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604864.19;789415.74;1847
-1849;2001078285;B06000;LESAO CORPORAL;RUA CARLOS ESTEV;7;74496;10/2/2001 02:15:00;INICIATIVA;S;0;TUPI;BH;612542.70;806590.74;1848
-1850;2001078305;B06000;LESAO CORPORAL;RUA DOS VIOLINOS;340;101797;10/2/2001 02:29:00;CIDADAO COMUM;N;;CH CALIFORNIA;BH;603894.90;796720.96;1849
-1851;2001078317;B06000;LESAO CORPORAL;AV JOSE LOPES MU;101;19176;10/2/2001 02:34:00;INICIATIVA;S;L;FLORAMAR;BH;611566.94;806488.49;1850
-1852;2001078346;B06000;LESAO CORPORAL;RUA PADUA;280;51745;10/2/2001 02:54:00;INICIATIVA;S;0;MARIA VIRGINIA;BH;611522.89;802814.14;1851
-1853;2001078410;B02000;RIXA;RUA RAIMUNDO MAG;88;57801;10/2/2001 03:31:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614095.77;803555.29;1852
-1854;2001078422;B03000;AMEACA;AV CORONEL DURVA;652;17688;10/2/2001 03:40:00;CIDADAO COMUM;N;0;DURVAL DE BARROS;BH;598098.20;790874.26;1853
-1855;2001078424;B03000;AMEACA;PRACA CHUI;37;15210;10/2/2001 03:40:00;CIDADAO COMUM;S;B;JOAO PINHEIRO;BH;604582.28;796335.40;1854
-1856;2001078426;B04002;HOMICIDIO CONSUM;RUA MARIANITA;6;101122;10/2/2001 03:40:00;CIDADAO COMUM;S;0;CONJUNTO ALIPIO ;BH;603833.65;799926.48;1855
-1857;2001078457;B02000;RIXA;RUA PARAIBA;993;52170;10/2/2001 04:02:00;CIDADAO COMUM;N;FR993;FUNCIONARIOS;BH;611690.70;795387.82;1856
-1858;2001078490;B03000;AMEACA;RUA DES BRAULIO;1044;19917;10/2/2001 04:26:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616205.73;798039.53;1857
-1859;2001078513;B06000;LESAO CORPORAL;RUA MUNIZ;470;170850;10/2/2001 04:46:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608195.31;793753.03;1858
-1860;2001078614;B06000;LESAO CORPORAL;AV SEN LEVINDO C;1846;14866;10/2/2001 07:02:00;INICIATIVA;S;0;SANTA CECILIA;BH;600957.86;787724.62;1859
-1861;2001078630;B04001;HOMICIDIO TENTAD;RUA JORNALISTA J;222;6470;10/2/2001 07:22:00;CIDADAO COMUM;N;;NOVA CINTRA;BH;606207.46;793674.57;1860
-1862;2001078834;B03000;AMEACA;AV MEM DE SA;1203;45395;10/2/2001 10:22:00;CIDADAO COMUM;N;;PARAISO;BH;614307.18;796365.33;1861
-1863;2001078839;B03000;AMEACA;RUA CASTIGLIANO;377;14056;10/2/2001 10:26:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;607244.05;797116.33;1862
-1864;2001078841;B04002;HOMICIDIO CONSUM;RUA UM;14;27979;10/2/2001 10:27:00;CIDADAO COMUM;N;;CAPITAO EDUARDO;BH;618614.13;806901.22;1863
-1865;2001078880;B03000;AMEACA;RUA ANTONIO JOSE;265;7431;10/2/2001 10:58:00;CIDADAO COMUM;S;INICIATIVA DA MP;CEU AZUL;BH;605135.52;807570.40;1864
-1866;2001078954;B06000;LESAO CORPORAL;RUA CAMOES;400;11971;10/2/2001 12:00:00;CIDADAO COMUM;S;;SAO LUCAS;BH;613224.65;795764.03;1865
-1867;2001078967;B06000;LESAO CORPORAL;RUA TIRADENTES;215;85607;10/2/2001 12:14:00;CIDADAO COMUM;N;0;VILA SAO JORGE;BH;615513.82;802373.44;1866
-1868;2001079037;B03000;AMEACA;RUA SAO PEDRO;169;96046;10/2/2001 12:55:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614537.78;803247.55;1867
-1869;2001079045;B03000;AMEACA;RUA LAMBDA;150;40307;10/2/2001 13:01:00;CIDADAO COMUM;N;0;CAICARA;BH;608190.20;799951.28;1868
-1870;2001079046;B06000;LESAO CORPORAL;RUA JOSE TEIXEIR;210;72995;10/2/2001 13:02:00;CIDADAO COMUM;S;;FLORAMAR;BH;611479.65;807013.94;1869
-1871;2001079083;B03000;AMEACA;RUA NADIR;138;47173;10/2/2001 13:23:00;CIDADAO COMUM;S;0;ADELAIDE;BH;607481.75;798916.11;1870
-1872;2001079097;B03000;AMEACA;RUA RIO DE JANEI;18;58772;10/2/2001 13:34:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611248.04;797676.50;1871
-1873;2001079113;B03000;AMEACA;AV ALVARES CABRA;780;2730;10/2/2001 13:44:00;INICIATIVA;S;0;LOURDES;BH;610742.90;796168.29;1872
-1874;2001079138;B03000;AMEACA;RUA EVARISTO DA ;10;26922;10/2/2001 13:57:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610219.65;798678.72;1873
-1875;2001079201;B06000;LESAO CORPORAL;RUA TEIXEIRAS;40;67222;10/2/2001 14:39:00;CIDADAO COMUM;N;LJB;ERMELINDA;BH;609010.61;801078.91;1874
-1876;2001079258;B03000;AMEACA;RUA SAO TEOFILO;22;105441;10/2/2001 15:33:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616200.84;806211.29;1875
-1877;2001079278;B03000;AMEACA;RUA FREI VICENTE;247;30029;10/2/2001 15:44:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607277.72;807964.07;1876
-1878;2001079318;B06000;LESAO CORPORAL;RUA JACUI;2811;36734;10/2/2001 16:01:00;CIDADAO COMUM;S;;IPIRANGA;BH;611411.53;800497.94;1877
-1879;2001079319;B03000;AMEACA;RUA DA BAHIA;561;81155;10/2/2001 16:01:00;INICIATIVA;S;0;CENTRO (BH);BH;611416.65;797071.68;1878
-1880;2001079321;B03000;AMEACA;AV AUGUSTO DE LI;134;6731;10/2/2001 16:00:00;INICIATIVA;N;0;CENTRO (BH);BH;611209.44;796588.30;1879
-1881;2001079324;B04002;HOMICIDIO CONSUM;RUA REGENCIA;160;301448;10/2/2001 16:03:00;INICIATIVA;N;0;VILA CAFEZAL;BH;614098.82;795476.81;1880
-1882;2001079339;B03000;AMEACA;RUA MUNICIPAL;24;171677;10/2/2001 16:14:00;CIDADAO COMUM;S;;VILA CEMIG;BH;605534.66;788579.65;1881
-1883;2001079375;B06000;LESAO CORPORAL;BECO BELMIRO DIA;15;171015;10/2/2001 16:39:00;CIDADAO COMUM;S;CAFR;CABANA;BH;604778.50;794122.00;1882
-1884;2001079425;B02000;RIXA;RUA PINTOR RENAT;437;26617;10/2/2001 17:03:00;CIDADAO COMUM;N;FU;TUPI;BH;613985.37;806046.29;1883
-1885;2001079426;B06000;LESAO CORPORAL;RUA A;311;78673;10/2/2001 17:02:00;CIDADAO COMUM;S;0;CH JATOBA IV;BH;600108.52;787774.84;1884
-1886;2001079444;B03000;AMEACA;RUA ESTEVAO MUSS;60;26327;10/2/2001 17:12:00;CIDADAO COMUM;S;CAA;NOVA GAMELEIRA;BH;605516.79;794498.15;1885
-1887;2001079478;B03000;AMEACA;RUA CARVALHOS;137;13788;10/2/2001 17:34:00;CIDADAO COMUM;N;CAA;MANGABEIRAS;BH;612119.88;792554.36;1886
-1888;2001079495;B06000;LESAO CORPORAL;RUA ANTONIO MARM;26;102907;10/2/2001 17:45:00;CIDADAO COMUM;N;;CH DA LAGOA;BH;605102.35;802904.34;1887
-1889;2001079500;B03000;AMEACA;RUA MARCO AURELI;127;61821;10/2/2001 17:47:00;CIDADAO COMUM;S;;NAZARE;BH;615586.92;804707.76;1888
-1890;2001079502;B03000;AMEACA;RUA MARCIOS MOUR;280;117306;10/2/2001 17:49:00;CIDADAO COMUM;N;;LINDEIA;BH;600206.92;790444.42;1889
-1891;2001079518;B03000;AMEACA;RUA PADRE JULIO ;1571;51496;10/2/2001 17:55:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616274.14;797626.03;1890
-1892;2001079534;B04001;HOMICIDIO TENTAD;PRACA CARDEAL AR;10;13182;10/2/2001 18:04:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605707.20;793813.75;1891
-1893;2001079582;B06000;LESAO CORPORAL;AV COLETORA;920;78241;10/2/2001 18:31:00;CIDADAO COMUM;S;;VILA PINHO;BH;602212.14;787909.78;1892
-1894;2001079584;B06000;LESAO CORPORAL;RUA MANHUARA;942;42891;10/2/2001 18:31:00;CIDADAO COMUM;S;CACIMA;PROVIDENCIA;BH;612690.19;804281.53;1893
-1895;2001079650;B06000;LESAO CORPORAL;RUA AVILA;26;86739;10/2/2001 19:10:00;CIDADAO COMUM;S;CSB;JARDIM EUROPA;BH;608597.44;810162.74;1894
-1896;2001079661;B03000;AMEACA;RUA CONEGO PINHE;254;16820;10/2/2001 19:17:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;614304.74;797161.13;1895
-1897;2001079668;B03000;AMEACA;RUA CARMO DO RIO;70;13687;10/2/2001 19:23:00;CIDADAO COMUM;N;;PRADO LOPES;BH;609977.20;798867.23;1896
-1898;2001079684;B04001;HOMICIDIO TENTAD;RUA MARZAGANIA;113;88066;10/2/2001 19:33:00;CIDADAO COMUM;S;0;GRANJA FREITAS;BH;617023.58;798845.01;1897
-1899;2001079718;B06000;LESAO CORPORAL;RUA DA RESSURREI;238;58470;10/2/2001 19:52:00;CIDADAO COMUM;S;0;SAO JOSE;BH;605345.40;798739.68;1898
-1900;2001079731;B04002;HOMICIDIO CONSUM;RUA ALICE;100;170949;10/2/2001 19:58:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;607996.88;793885.89;1899
-1901;2001079774;B06000;LESAO CORPORAL;RUA PROFESSOR MI;108;128628;10/2/2001 20:27:00;INICIATIVA;S;0;NOVA ESPERANCA;BH;609336.96;799237.81;1900
-1902;2001079780;B03000;AMEACA;RUA PADRE MANOEL;15;51556;10/2/2001 20:30:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;605001.34;795728.64;1901
-1903;2001079798;B03000;AMEACA;RUA MANOEL PAULI;125;43185;10/2/2001 20:44:00;CIDADAO COMUM;S;;DURVAL DE BARROS;IB;598267.43;791064.47;1902
-1904;2001079848;B06000;LESAO CORPORAL;RUA DINIS DIAS;145;119673;10/2/2001 21:10:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616573.20;797526.82;1903
-1905;2001079851;B04001;HOMICIDIO TENTAD;RUA BATISTA CARN;98;8419;10/2/2001 21:12:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606473.20;794973.26;1904
-1906;2001079885;B03000;AMEACA;RUA TEBAS;670;67090;10/2/2001 21:25:00;INICIATIVA;N;0;VERA CRUZ;BH;615977.89;798300.24;1905
-1907;2001079894;B02000;RIXA;RUA ALCOBACA;1210;62708;10/2/2001 21:30:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;608806.89;801887.18;1906
-1908;2001079932;B06000;LESAO CORPORAL;RUA NIQUELINA;20;47738;10/2/2001 21:56:00;INICIATIVA;N;0;SANTA EFIGENIA;BH;613202.56;796623.13;1907
-1909;2001080034;B03000;AMEACA;RUA SERRA NEGRA;145;65038;10/2/2001 23:05:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610132.74;799274.01;1908
-1910;2001080038;B06000;LESAO CORPORAL;RUA CORONEL ANTO;26;17590;10/2/2001 23:08:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;606351.58;807582.90;1909
-1911;2001080039;B06000;LESAO CORPORAL;AV MENELICK DE C;256;30448;10/2/2001 23:09:00;INICIATIVA;S;0;FLAVIO MARQUES D;BH;604486.70;788882.24;1910
-1912;2001080057;B06000;LESAO CORPORAL;RUA H;432;78295;10/2/2001 23:15:00;CIDADAO COMUM;S;CAA;VILA PINHO;BH;602014.90;788025.16;1911
-1913;2001080082;B03000;AMEACA;RUA CORONEL FULG;186;17750;10/2/2001 23:26:00;CIDADAO COMUM;S;PX186;SAO LUCAS;BH;613210.64;796135.07;1912
-1914;2001080106;B04001;HOMICIDIO TENTAD;RUA ELVIRA AUGUS;461;21222;10/2/2001 23:39:00;POLICIAL MILITAR;N;0;BOA VISTA;BH;615016.28;800012.15;1913
-1915;2001080134;B03000;AMEACA;RUA ARTUR DE SA;564;6211;10/2/2001 23:49:00;CIDADAO COMUM;S;;UNIAO;BH;612425.80;801529.08;1914
-1916;2001080164;B04001;HOMICIDIO TENTAD;RUA PITANGUI;4000;54365;11/2/2001 00:02:00;CIDADAO COMUM;S;0;ESPLANADA;BH;614196.00;798230.33;1915
-1917;2001080172;B06000;LESAO CORPORAL;RUA MONTE CARMEL;197;46420;11/2/2001 00:08:00;CIDADAO COMUM;S;AP04;FLORESTA;BH;612341.65;798167.69;1916
-1918;2001080180;B06000;LESAO CORPORAL;RUA CAMPOS SALES;472;12300;11/2/2001 00:12:00;INICIATIVA;S;0;NOVA SUISSA;BH;607050.85;796279.60;1917
-1919;2001080182;B04002;HOMICIDIO CONSUM;RUA EMIDIO FURTA;737;108525;11/2/2001 00:10:00;INICIATIVA;N;0;LETICIA;BH;606802.06;809377.86;1918
-1920;2001080200;B06000;LESAO CORPORAL;RODOVIA MGT 262;1060;26598;11/2/2001 00:21:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614799.23;802174.37;1919
-1921;2001080240;B03000;AMEACA;RUA JOSUE MENEZE;255;72982;11/2/2001 00:41:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605384.39;795273.46;1920
-1922;2001080247;B06000;LESAO CORPORAL;AV NOSSA SENHORA;3126;48107;11/2/2001 00:46:00;INICIATIVA;S;0;CARLOS PRATES;BH;608689.07;797282.61;1921
-1923;2001080259;B03000;AMEACA;RUA DAS VERBENAS;752;71545;11/2/2001 00:52:00;CIDADAO COMUM;N;;LINDEIA;BH;598936.24;790800.47;1922
-1924;2001080261;B04001;HOMICIDIO TENTAD;RUA RIO JORDAO;258;124816;11/2/2001 00:52:00;CIDADAO COMUM;N;0;CRISTO REDENTOR;BH;605093.51;790501.88;1923
-1925;2001080318;B04001;HOMICIDIO TENTAD;RUA EXPEDICIONAR;65;19570;11/2/2001 01:17:00;INICIATIVA;S;0;MARIA GORETTI;BH;614141.03;803465.87;1924
-1926;2001080406;B04002;HOMICIDIO CONSUM;RUA ANAPURUS;32;20894;11/2/2001 01:56:00;CIDADAO COMUM;N;0;SAO GABRIEL;BH;613070.65;804032.62;1925
-1927;2001080426;B06000;LESAO CORPORAL;RUA SAO VICENTE;16;88126;11/2/2001 02:04:00;CIDADAO COMUM;S;BLOCO 300;GRANJA FREITAS;BH;617082.39;798490.25;1926
-1928;2001080486;B06000;LESAO CORPORAL;RUA JOAO PROCOPI;282;69070;11/2/2001 02:39:00;CIDADAO COMUM;S;;JARDIM ALVORADA;BH;606052.66;800374.59;1927
-1929;2001080515;B06000;LESAO CORPORAL;RUA FLOR DO NATA;166;28741;11/2/2001 02:55:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;606469.77;798943.26;1928
-1930;2001080526;B06000;LESAO CORPORAL;RUA PERNAMBUCO;514;53463;11/2/2001 02:59:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611607.37;795755.17;1929
-1931;2001080528;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;955;40770;11/2/2001 03:00:00;INICIATIVA;N;0;VERA CRUZ;BH;615259.66;798008.79;1930
-1932;2001080529;B04001;HOMICIDIO TENTAD;RUA TEN ANASTACI;550;67263;11/2/2001 03:00:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613431.12;796565.01;1931
-1933;2001080534;B03000;AMEACA;RUA INACIO PARRE;389;21730;11/2/2001 03:02:00;CIDADAO COMUM;S;;ESTRELA DALVA;BH;607308.18;792108.65;1932
-1934;2001080537;B06000;LESAO CORPORAL;RUA EXPEDICIONAR;95;27418;11/2/2001 03:03:00;CIDADAO COMUM;N;0;ADELAIDE;BH;607416.33;798153.36;1933
-1935;2001080567;B06000;LESAO CORPORAL;RUA JOAO GUALBER;16;20450;11/2/2001 03:21:00;CIDADAO COMUM;N;0;CEU AZUL;BH;605094.97;807593.39;1934
-1936;2001080617;B02000;RIXA;AV OTACILIO NEGR;11840;50566;11/2/2001 03:48:00;CIDADAO COMUM;N;;TREVO;BH;604861.56;805383.18;1935
-1937;2001080632;B03000;AMEACA;AV BRIGADEIRO ED;1080;2860;11/2/2001 03:55:00;POLICIAL MILITAR;N;0;GLORIA;BH;604212.05;798647.23;1936
-1938;2001080650;B06000;LESAO CORPORAL;AV SEN LEVINDO C;4405;14866;11/2/2001 04:07:00;CIDADAO COMUM;N;0;CH VALE DO JATOB;BH;601253.14;786620.47;1937
-1939;2001080675;B06000;LESAO CORPORAL;RUA M;46;78790;11/2/2001 04:24:00;CIDADAO COMUM;S;;CH JATOBA IV;BH;600650.50;787805.22;1938
-1940;2001080688;B06000;LESAO CORPORAL;RUA DR PEDRO RUE;280;113853;11/2/2001 04:36:00;CIDADAO COMUM;S;0;LETICIA;BH;606912.50;809559.22;1939
-1941;2001080747;B03000;AMEACA;RUA PAULO ALVES ;18;24580;11/2/2001 05:18:00;CIDADAO COMUM;N;0;CH VALE DO JATOB;BH;600632.65;787523.33;1940
-1942;2001080779;B03000;AMEACA;RUA STA CATARINA;655;60400;11/2/2001 05:43:00;INICIATIVA;N;0;LOURDES;BH;610491.35;796335.53;1941
-1943;2001080781;B03000;AMEACA;AV CIVILIZACAO;90;51657;11/2/2001 05:45:00;CIDADAO COMUM;S;;LEBLON;BH;605103.49;810060.35;1942
-1944;2001080785;B06000;LESAO CORPORAL;RUA HUMAITA;1040;33562;11/2/2001 05:49:00;CIDADAO COMUM;N;LJ;PADRE EUSTAQUIO;BH;606604.09;797013.74;1943
-1945;2001080797;B03000;AMEACA;PRACA QUINZE DE ;9;57565;11/2/2001 06:06:00;INICIATIVA;N;0;BONFIM;BH;609834.50;798492.95;1944
-1946;2001080809;B04002;HOMICIDIO CONSUM;RUA MANHUMIRIM;808;42908;11/2/2001 06:23:00;CIDADAO COMUM;N;0;ADELAIDE;BH;607843.93;798076.55;1945
-1947;2001080827;B03000;AMEACA;RUA SAO MIGUEL;1501;63410;11/2/2001 06:50:00;INICIATIVA;S;0;ITAPOA;BH;609533.82;805627.88;1946
-1948;2001080880;B06000;LESAO CORPORAL;PRACA RAUL SOARE;423;58010;11/2/2001 07:46:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610510.71;796848.26;1947
-1949;2001080911;B06000;LESAO CORPORAL;AV AMAZONAS;166;3140;11/2/2001 08:17:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611331.41;797309.82;1948
-1950;2001080958;B03000;AMEACA;RUA MARIA DE LOU;585;20765;11/2/2001 08:44:00;CIDADAO COMUM;N;;LETICIA;BH;607064.26;809882.88;1949
-1951;2001080969;B06000;LESAO CORPORAL;RUA GUIDO CIOLET;40;19440;11/2/2001 08:55:00;CIDADAO COMUM;N;;BARREIRO;BH;602909.44;790423.89;1950
-1952;2001080977;B06000;LESAO CORPORAL;AV AMINTAS JAQUE;175;52546;11/2/2001 09:00:00;CIDADAO COMUM;N;0;COQUEIROS;BH;603381.96;799800.15;1951
-1953;2001081007;B03000;AMEACA;RUA ALECRIM DA S;15;105596;11/2/2001 09:30:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615935.58;806050.26;1952
-1954;2001081030;B06000;LESAO CORPORAL;RUA ROCHA PITA;409;59000;11/2/2001 09:49:00;CIDADAO COMUM;S;;POMPEIA;BH;615026.15;797886.50;1953
-1955;2001081040;B06000;LESAO CORPORAL;RUA ANTONIO SIMI;80;118526;11/2/2001 09:56:00;CIDADAO COMUM;S;;REGINA;BH;598646.53;790272.89;1954
-1956;2001081042;B06000;LESAO CORPORAL;RUA FORMIGA;50;29136;11/2/2001 09:55:00;CIDADAO COMUM;N;;LAGOINHA;BH;610336.11;798756.88;1955
-1957;2001081053;B04001;HOMICIDIO TENTAD;RUA JUNQUILHOS;1234;39657;11/2/2001 10:09:00;CIDADAO COMUM;N;;JARDIM AMERICA;BH;607397.31;795111.26;1956
-1958;2001081068;B06000;LESAO CORPORAL;RUA MANGARATIBA;238;42822;11/2/2001 10:24:00;INICIATIVA;S;0;SAO GERALDO;BH;614996.90;799256.76;1957
-1959;2001081076;B06000;LESAO CORPORAL;AV BASILIO DA GA;385;8361;11/2/2001 10:31:00;CIDADAO COMUM;N;;TUPI;BH;613167.64;805972.52;1958
-1960;2001081090;B06000;LESAO CORPORAL;RUA ENCANTADO;269;25453;11/2/2001 10:42:00;CIDADAO COMUM;S;;CAICARA;BH;607644.74;799420.19;1959
-1961;2001081100;B03000;AMEACA;RUA CALIFORNIA;831;11653;11/2/2001 10:48:00;INICIATIVA;S;0;SION;BH;611481.57;793037.66;1960
-1962;2001081128;B03000;AMEACA;RUA FRANCISCO GO;64;68569;11/2/2001 11:10:00;CIDADAO COMUM;S;0;ESTRELA DALVA;BH;607396.99;792279.34;1961
-1963;2001081159;B06000;LESAO CORPORAL;AV ITAU;1337;36025;11/2/2001 11:37:00;CIDADAO COMUM;N;0;JOAO PINHEIRO;BH;604300.14;796713.76;1962
-1964;2001081224;B03000;AMEACA;RUA LEOPOLDO GOM;184;40770;11/2/2001 12:22:00;CIDADAO COMUM;S;;POMPEIA;BH;614481.68;797860.86;1963
-1965;2001081231;B04001;HOMICIDIO TENTAD;RUA SERRA NEGRA;135;65038;11/2/2001 12:28:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610139.91;799281.20;1964
-1966;2001081242;B03000;AMEACA;RUA FLORESTAL;36;123611;11/2/2001 12:36:00;CIDADAO COMUM;S;;INSTITUTO AGRONO;BH;613828.23;799199.35;1965
-1967;2001081283;B06000;LESAO CORPORAL;RUA ITAIPU;960;35439;11/2/2001 13:11:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616274.97;798164.89;1966
-1968;2001081314;B06000;LESAO CORPORAL;RUA JULITA NOGUE;403;39597;11/2/2001 13:32:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603725.15;802483.82;1967
-1969;2001081315;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;697;31400;11/2/2001 13:32:00;INICIATIVA;N;0;CENTRO (BH);BH;610556.85;796867.59;1968
-1970;2001081317;B05000;SEQUESTRO E CARC;RUA MOACYR FROES;170;108380;11/2/2001 13:33:00;INICIATIVA;N;0;SAO JOAO BATISTA;BH;608939.36;807397.69;1969
-1971;2001081417;B03000;AMEACA;RUA SILVA ORTIZ;315;7520;11/2/2001 14:50:00;CIDADAO COMUM;N;CS02;JOAO PINHEIRO;BH;604641.80;796156.88;1970
-1972;2001081434;B04002;HOMICIDIO CONSUM;RUA SAO GERALDO;54;62650;11/2/2001 15:06:00;CIDADAO COMUM;N;;NOVA CINTRA;BH;605798.69;794163.16;1971
-1973;2001081501;B03000;AMEACA;RUA CORONEL REMI;367;92928;11/2/2001 15:55:00;CIDADAO COMUM;S;;VILA MARAVILHAS;BH;603166.34;795066.83;1972
-1974;2001081528;B03000;AMEACA;RUA EVARISTO DA ;335;26922;11/2/2001 16:11:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610037.93;798652.33;1973
-1975;2001081588;B03000;AMEACA;RUA COPERNICO PI;78;6630;11/2/2001 16:52:00;CIDADAO COMUM;S;BECO E;SANTO ANTONIO;BH;610449.69;793640.03;1974
-1976;2001081620;B02000;RIXA;RUA RIO DAS FLOR;170;92770;11/2/2001 17:10:00;CIDADAO COMUM;N;;PILAR;BH;607837.36;788169.94;1975
-1977;2001081676;B03000;AMEACA;RUA NARCISO PERE;141;78267;11/2/2001 17:38:00;CIDADAO COMUM;S;CAB;VILA PINHO;BH;601878.96;788485.35;1976
-1978;2001081694;B06000;LESAO CORPORAL;RUA MARIA DA CON;243;107881;11/2/2001 17:42:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606570.12;811671.60;1977
-1979;2001081699;B04001;HOMICIDIO TENTAD;AV DOM PEDRO I;3083;48337;11/2/2001 17:44:00;CIDADAO COMUM;N;;PLANALTO;BH;609678.52;807952.23;1978
-1980;2001081773;B06000;LESAO CORPORAL;RUA GRAO MOGOL;197;31769;11/2/2001 18:20:00;CIDADAO COMUM;N;0;CARMO;BH;611788.50;794682.45;1979
-1981;2001081799;B02000;RIXA;RUA RIO DE JANEI;282;58772;11/2/2001 18:35:00;CIDADAO COMUM;S;FR;CENTRO (BH);BH;611181.78;797418.31;1980
-1982;2001081850;B04001;HOMICIDIO TENTAD;RUA ARTUR DE SA;939;6211;11/2/2001 18:58:00;CIDADAO COMUM;N;;UNIAO;BH;612733.03;801920.16;1981
-1983;2001081899;B04001;HOMICIDIO TENTAD;AV SILVA LOBO;1710;65889;11/2/2001 19:17:00;CIDADAO COMUM;S;;GRAJAU;BH;608050.43;794902.40;1982
-1984;2001081904;B04001;HOMICIDIO TENTAD;RUA DOMINGOS ROC;123;22631;11/2/2001 19:20:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606553.35;795142.98;1983
-1985;2001081928;B06000;LESAO CORPORAL;RUA SABINO JOSE ;207;118210;11/2/2001 19:34:00;CIDADAO COMUM;S;;TIROL;BH;599914.84;789810.06;1984
-1986;2001081946;B04001;HOMICIDIO TENTAD;RUA ARACY DE ALM;211;85648;11/2/2001 19:41:00;CIDADAO COMUM;S;0;GOIANIA;BH;614914.01;803850.11;1985
-1987;2001081962;B04001;HOMICIDIO TENTAD;RUA D;81;79764;11/2/2001 19:51:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;616942.69;804583.48;1986
-1988;2001081965;B06000;LESAO CORPORAL;RUA MARIA ROSA D;31;14591;11/2/2001 19:54:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600813.94;787318.13;1987
-1989;2001081977;B03000;AMEACA;RUA BENEDITO ANI;81;56244;11/2/2001 20:02:00;CIDADAO COMUM;N;;NOVA YORK;BH;608363.76;810624.49;1988
-1990;2001082021;B03000;AMEACA;RUA CINCO;14;302813;11/2/2001 20:22:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614439.74;805916.30;1989
-1991;2001082123;B06000;LESAO CORPORAL;RUA GENERAL SAMP;110;30927;11/2/2001 21:22:00;INICIATIVA;S;0;POMPEIA;BH;614275.40;798137.47;1990
-1992;2001082126;B06000;LESAO CORPORAL;RUA HESPERIA;516;33260;11/2/2001 21:22:00;CIDADAO COMUM;S;0;PARQUE RIACHUELO;BH;609757.21;800624.53;1991
-1993;2001082143;B03000;AMEACA;RUA MAJOR DELFIN;3143;42620;11/2/2001 21:31:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608575.21;800912.64;1992
-1994;2001082148;B03000;AMEACA;RUA PONTA PORA;35;54601;11/2/2001 21:35:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;613128.09;796821.54;1993
-1995;2001082159;B03000;AMEACA;RUA CAMILO GOMES;395;11902;11/2/2001 21:38:00;CIDADAO COMUM;S;CAFR;ITAIPU BH;BH;599526.34;789343.98;1994
-1996;2001082160;B03000;AMEACA;RUA TIBIRICA;20;67613;11/2/2001 21:40:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;608290.82;794241.49;1995
-1997;2001082258;B03000;AMEACA;RUA BRAS;20;170835;11/2/2001 22:23:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608019.79;793890.35;1996
-1998;2001082266;B06000;LESAO CORPORAL;RUA UM;29;302808;11/2/2001 22:28:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614345.23;805792.20;1997
-1999;2001082309;B03000;AMEACA;RUA JANUARIA;480;36936;11/2/2001 22:50:00;CIDADAO COMUM;S;AP402;FLORESTA;BH;611701.44;798121.30;1998
-2000;2001082331;B03000;AMEACA;RUA INTERNA;88;34666;11/2/2001 23:06:00;CIDADAO COMUM;S;;MAGNESITA;BH;603921.34;793691.32;1999
-2001;2001082378;B06000;LESAO CORPORAL;RUA ITABERA;115;35224;11/2/2001 23:27:00;CIDADAO COMUM;N;AP03;SANTA EFIGENIA;BH;614248.22;797046.89;2000
-2002;2001082448;B03000;AMEACA;RUA DURVALIA;100;115704;12/2/2001 00:00:00;CIDADAO COMUM;N;;HAVAI;BH;607390.14;793424.75;2001
-2003;2001082462;B06000;LESAO CORPORAL;RUA CINQUENTA E ;348;106201;12/2/2001 00:16:00;CIDADAO COMUM;N;0;NOVA YORK;BH;608638.63;810805.70;2002
-2004;2001082465;B04001;HOMICIDIO TENTAD;PRACA ESMERALDA;10;25932;12/2/2001 00:19:00;CIDADAO COMUM;N;0;PIRAJA;BH;613180.37;803029.37;2003
-2005;2001082468;B06000;LESAO CORPORAL;RUA STA JULIANA;259;60829;12/2/2001 00:20:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606335.02;794528.18;2004
-2006;2001082508;B04002;HOMICIDIO CONSUM;RUA MODELO;371;46026;12/2/2001 00:56:00;INICIATIVA;N;0;SUZANA;BH;612016.08;802934.75;2005
-2007;2001082548;B05000;SEQUESTRO E CARC;RUA CONCEICAO DO;55;21106;12/2/2001 01:17:00;INICIATIVA;S;0;OURO PRETO;BH;606837.86;802480.63;2006
-2008;2001082579;B06000;LESAO CORPORAL;AV DOUTOR CRISTI;862;62459;12/2/2001 01:49:00;INICIATIVA;N;0;PLANALTO;BH;609793.27;807173.69;2007
-2009;2001082983;B03000;AMEACA;RUA JOAO AFONSO ;407;7457;12/2/2001 09:22:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606679.76;802575.31;2008
-2010;2001083030;B03000;AMEACA;RUA CINCO;14;302813;12/2/2001 09:47:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614439.74;805916.30;2009
-2011;2001083044;B03000;AMEACA;RUA FRUTAL;319;30060;12/2/2001 09:54:00;CIDADAO COMUM;S;AP203;SANTA EFIGENIA;BH;613765.93;796775.54;2010
-2012;2001083112;B04001;HOMICIDIO TENTAD;RUA DOS BANDOLIN;114;106980;12/2/2001 10:39:00;CIDADAO COMUM;N;0;CH CALIFORNIA;BH;604133.35;796768.11;2011
-2013;2001083142;B06000;LESAO CORPORAL;AV DO CONTORNO;1542;17228;12/2/2001 11:01:00;INICIATIVA;S;0;FLORESTA;BH;612129.40;797743.70;2012
-2014;2001083167;B06000;LESAO CORPORAL;AV CLARA NUNES;822;45644;12/2/2001 11:16:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;611029.42;801039.87;2013
-2015;2001083307;B04002;HOMICIDIO CONSUM;RUA DOUTOR ALIPI;25;2365;12/2/2001 12:42:00;CIDADAO COMUM;N;0;SERRA;BH;613823.09;794921.03;2014
-2016;2001083403;B03000;AMEACA;RUA ITAQUERA;587;35920;12/2/2001 13:48:00;CIDADAO COMUM;S;;CONCORDIA;BH;611337.87;799230.32;2015
-2017;2001083469;B06000;LESAO CORPORAL;RUA WENCESLAU BR;77;73727;12/2/2001 14:26:00;CIDADAO COMUM;S;;COPACABANA;BH;606339.57;806993.12;2016
-2018;2001083505;B04002;HOMICIDIO CONSUM;AV OLEGARIO MACI;1611;49699;12/2/2001 14:43:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610311.35;796159.61;2017
-2019;2001083547;B03000;AMEACA;RUA ITAPARICA;221;35731;12/2/2001 15:14:00;CIDADAO COMUM;N;;SERRA;BH;613007.39;795346.68;2018
-2020;2001083570;B06000;LESAO CORPORAL;RUA CARLOS ETIEN;13;13356;12/2/2001 15:32:00;CIDADAO COMUM;S;;SERRA;BH;613992.00;794863.88;2019
-2021;2001083573;B06000;LESAO CORPORAL;AV BARAO HOMEM D;1997;7936;12/2/2001 15:34:00;CIDADAO COMUM;N;;LEONINA;BH;608163.53;793322.71;2020
-2022;2001083664;B06000;LESAO CORPORAL;RUA PADRE PETROL;1160;53577;12/2/2001 16:35:00;CIDADAO COMUM;N;AP205;SAGRADA FAMILIA;BH;613590.37;798532.20;2021
-2023;2001083681;B06000;LESAO CORPORAL;AV FRANCISCO SA;1409;29656;12/2/2001 16:45:00;CIDADAO COMUM;S;;GUTIERREZ;BH;608968.06;795431.45;2022
-2024;2001083794;B06000;LESAO CORPORAL;RUA DA BAHIA;380;81155;12/2/2001 17:42:00;CIDADAO COMUM;S;PX380;CENTRO (BH);BH;611423.82;797248.36;2023
-2025;2001083842;B04001;HOMICIDIO TENTAD;RUA VILA RICA;1989;71992;12/2/2001 18:12:00;CIDADAO COMUM;N;BL1     AP104;JARDIM MONTANHES;BH;606729.96;798841.80;2024
-2026;2001084077;B06000;LESAO CORPORAL;RUA MIOSOTIS;180;45859;12/2/2001 21:02:00;CIDADAO COMUM;N;;SANTO ANDRE;BH;608901.95;798729.73;2025
-2027;2001084081;B06000;LESAO CORPORAL;RUA EPAMINONDAS ;65;25696;12/2/2001 21:04:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604476.95;793805.73;2026
-2028;2001084102;B03000;AMEACA;RUA JOAO PINTO;15;105542;12/2/2001 21:23:00;CIDADAO COMUM;S;APT301;JARDINOPOLIS;BH;605029.47;794803.37;2027
-2029;2001084181;B03000;AMEACA;RUA JOSE DE OLIV;22;63161;12/2/2001 22:12:00;CIDADAO COMUM;N;;ARAGUAIA;BH;604028.76;790381.13;2028
-2030;2001084207;B02000;RIXA;RUA ITANHAEM;345;100173;12/2/2001 22:34:00;INICIATIVA;S;0;PIRATININGA;BH;605634.00;808953.53;2029
-2031;2001084253;B03000;AMEACA;RUA DEMOCRITO;58;26078;12/2/2001 23:07:00;CIDADAO COMUM;S;;BELMONT;BH;615545.74;804744.99;2030
-2032;2001084510;B06000;LESAO CORPORAL;RUA JULIO DE CAS;1132;39470;13/2/2001 03:50:00;CIDADAO COMUM;S;0;CINQUENTENARIO;BH;606683.66;792194.71;2031
-2033;2001084532;B06000;LESAO CORPORAL;AV CIVILIZACAO;889;51657;13/2/2001 04:35:00;INICIATIVA;S;0;JARDIM FLORENCIA;BH;609155.17;808648.71;2032
-2034;2001084876;B04001;HOMICIDIO TENTAD;RUA FLOR DE VIDR;5;13504;13/2/2001 10:45:00;CIDADAO COMUM;N;0;CASTELO;BH;605642.59;799384.30;2033
-2035;2001084975;B04001;HOMICIDIO TENTAD;RUA PACIFICO CAR;250;93426;13/2/2001 12:08:00;INICIATIVA;N;0;INDEPENDENCIA;BH;602007.04;786043.55;2034
-2036;2001085018;B03000;AMEACA;AV AUGUSTO DE LI;486;6731;13/2/2001 12:35:00;CIDADAO COMUM;S;AP403;CENTRO (BH);BH;610871.39;796677.01;2035
-2037;2001085062;B03000;AMEACA;RUA SERRINHA;19;129201;13/2/2001 13:14:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;600519.25;786719.95;2036
-2038;2001085080;B06000;LESAO CORPORAL;RUA ACUCENAS;70;892;13/2/2001 13:31:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;607357.83;795794.04;2037
-2039;2001085093;B03000;AMEACA;RUA MONSENHOR PA;101;46329;13/2/2001 13:35:00;CIDADAO COMUM;N;0;VISTA ALEGRE;BH;604816.75;793484.58;2038
-2040;2001085141;B06000;LESAO CORPORAL;RUA RAIMUNDO CEZ;45;130280;13/2/2001 14:09:00;CIDADAO COMUM;S;;CASTANHEIRA 2;BH;601563.68;788756.45;2039
-2041;2001085182;B06000;LESAO CORPORAL;AV LUXEMBURGO;9;127612;13/2/2001 14:39:00;INICIATIVA;N;0;JARDIM EUROPA;BH;607808.50;810256.46;2040
-2042;2001085186;B03000;AMEACA;RUA ITAMAR;230;35527;13/2/2001 14:42:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616310.09;798514.15;2041
-2043;2001085206;B03000;AMEACA;RUA IRLANDA;51;35063;13/2/2001 15:00:00;POLICIAL MILITAR;N;0;ITAPOA;BH;608317.79;805800.24;2042
-2044;2001085210;B03000;AMEACA;RUA JOAO ALEXAND;267;71384;13/2/2001 15:07:00;CIDADAO COMUM;N;;MILIONARIOS;BH;603980.36;789980.34;2043
-2045;2001085222;B03000;AMEACA;RUA CARVALHO DE ;59;13810;13/2/2001 15:11:00;CIDADAO COMUM;S;CAB;BOA VISTA;BH;614427.79;799810.56;2044
-2046;2001085244;B06000;LESAO CORPORAL;RUA DAVIDSON PIM;440;124189;13/2/2001 15:22:00;CIDADAO COMUM;S;0;TOPAZIO;BH;607419.22;811909.65;2045
-2047;2001085305;B03000;AMEACA;RUA MILTON VIEIR;80;45786;13/2/2001 15:53:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612458.82;800064.95;2046
-2048;2001085421;B08000;VIOLACAO DE DOMI;RUA DONA NAIR;120;22962;13/2/2001 17:11:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604635.38;792141.95;2047
-2049;2001085596;B03000;AMEACA;RUA PLATAO;180;63187;13/2/2001 18:48:00;CIDADAO COMUM;S;;NAZARE;BH;615718.21;804422.79;2048
-2050;2001085644;B03000;AMEACA;RUA LEO MARENTE;112;94807;13/2/2001 19:21:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606371.05;799398.56;2049
-2051;2001085724;B03000;AMEACA;RUA CONSELHEIRO ;2015;17041;13/2/2001 20:05:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612870.41;799864.95;2050
-2052;2001085727;B06000;LESAO CORPORAL;RUA DEZESSETE;130;32862;13/2/2001 20:07:00;CIDADAO COMUM;N;0;CONJUNTO FELICID;BH;612198.23;807435.95;2051
-2053;2001085789;B03000;AMEACA;RUA FERNAO DIAS;1022;28133;13/2/2001 20:48:00;INICIATIVA;N;0;VERA CRUZ;BH;616049.67;798294.87;2052
-2054;2001085814;B03000;AMEACA;RUA ITANHAEM;345;100173;13/2/2001 21:10:00;CIDADAO COMUM;S;0;PIRATININGA;BH;605634.00;808953.53;2053
-2055;2001085825;B06000;LESAO CORPORAL;RUA FRANCISCO BI;1590;29353;13/2/2001 21:13:00;CIDADAO COMUM;S;AP203;MONSENHOR MESSIA;BH;607087.58;798304.09;2054
-2056;2001085836;B04001;HOMICIDIO TENTAD;BECO HELIOTERIO;12;170863;13/2/2001 21:26:00;INICIATIVA;S;0;LEONINA;BH;608284.91;793801.92;2055
-2057;2001085869;B03000;AMEACA;RUA JOSE FERNAND;122;119948;13/2/2001 21:52:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;616040.45;799464.74;2056
-2058;2001085875;B06000;LESAO CORPORAL;RUA SAO TOMAS DE;133;63782;13/2/2001 21:58:00;CIDADAO COMUM;S;;SAO PEDRO;BH;610990.24;793846.72;2057
-2059;2001085899;B04001;HOMICIDIO TENTAD;RUA VILA ISABEL;25;84370;13/2/2001 22:10:00;CIDADAO COMUM;S;0;VILA SANTA BRANC;BH;605053.21;809820.25;2058
-2060;2001085961;B06000;LESAO CORPORAL;RUA CHAPINHA;170;15061;13/2/2001 22:56:00;CIDADAO COMUM;N;;JARDINOPOLIS;BH;604518.33;794265.31;2059
-2061;2001085976;B06000;LESAO CORPORAL;RUA PINTOR RENAT;258;26617;13/2/2001 23:03:00;CIDADAO COMUM;S;;TUPI;BH;613981.53;805995.61;2060
-2062;2001085979;B06000;LESAO CORPORAL;RUA MARIA BEATRI;54;43881;13/2/2001 23:04:00;CIDADAO COMUM;N;0;HAVAI;BH;606696.13;793615.49;2061
-2063;2001086053;B04002;HOMICIDIO CONSUM;AV UM;595;301245;13/2/2001 23:45:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614648.71;805739.64;2062
-2064;2001086084;B06000;LESAO CORPORAL;RUA NUBIA REZEND;278;97950;14/2/2001 00:10:00;CIDADAO COMUM;N;0;DOM SILVERIO;BH;615162.22;804356.62;2063
-2065;2001086115;B03000;AMEACA;RUA ARIOLINO ARI;192;85811;14/2/2001 00:38:00;CIDADAO COMUM;S;;SERRA VERDE;BH;609175.05;810135.20;2064
-2066;2001086131;B03000;AMEACA;RUA CORNELIA;172;17404;14/2/2001 00:57:00;CIDADAO COMUM;S;;DOM JOAQUIM;BH;613726.12;801994.35;2065
-2067;2001086263;B04002;HOMICIDIO CONSUM;AV BARAO HOMEM D;1280;7936;14/2/2001 03:49:00;CIDADAO COMUM;N;PX1280;JARDIM AMERICA;BH;607865.97;794285.50;2066
-2068;2001086280;B06000;LESAO CORPORAL;RUA DES BARCELOS;574;19904;14/2/2001 04:08:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;607344.70;796068.28;2067
-2069;2001086355;B03000;AMEACA;RUA DINIS DIAS;389;119673;14/2/2001 07:04:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616573.20;797526.82;2068
-2070;2001086372;B06000;LESAO CORPORAL;RUA MICHEL GARIB;219;85490;14/2/2001 07:17:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608812.41;809462.99;2069
-2071;2001086380;B03000;AMEACA;RUA SERRA DA MOE;161;120796;14/2/2001 07:21:00;CIDADAO COMUM;N;AP201;ANTONIO RIBEIRO ;BH;614997.56;807384.95;2070
-2072;2001086619;B03000;AMEACA;RUA SALINAS;432;59992;14/2/2001 10:04:00;CIDADAO COMUM;S;0;FLORESTA;BH;612149.51;798050.73;2071
-2073;2001086645;B03000;AMEACA;RUA FLOR DE LIMA;16;23810;14/2/2001 10:20:00;CIDADAO COMUM;S;0;FILADELFIA;BH;602168.34;797463.32;2072
-2074;2001086693;B03000;AMEACA;RUA PIRAQUARA;320;54189;14/2/2001 10:49:00;CIDADAO COMUM;S;;VILA OESTE;BH;604522.65;795351.05;2073
-2075;2001086791;B03000;AMEACA;AV AUGUSTO DE LI;215;6731;14/2/2001 12:15:00;INICIATIVA;S;;CENTRO (BH);BH;611184.43;796546.36;2074
-2076;2001086853;B03000;AMEACA;RUA PRINCESA LEO;220;55327;14/2/2001 13:08:00;CIDADAO COMUM;S;;IPIRANGA;BH;611610.24;801056.09;2075
-2077;2001086872;B06000;LESAO CORPORAL;RUA PADRE ADOLFO;79;85332;14/2/2001 13:31:00;INICIATIVA;N;0;MINASCAIXA;BH;609204.95;809728.62;2076
-2078;2001086890;B03000;AMEACA;RUA ROGERIO APAR;100;96682;14/2/2001 13:44:00;POLICIAL MILITAR;S;SOL PM/SOMENTE R;ANTONIO RIBEIRO ;BH;615004.45;806026.02;2077
-2079;2001086902;B03000;AMEACA;RUA ACALIFA;209;98385;14/2/2001 13:53:00;CIDADAO COMUM;S;;JULIANA;BH;611057.85;809064.48;2078
-2080;2001087048;B03000;AMEACA;AV URUGUAI;335;71113;14/2/2001 15:31:00;CIDADAO COMUM;S;SL14;SION;BH;611750.13;793745.62;2079
-2081;2001087196;B03000;AMEACA;RUA AMANDO COUTO;230;3037;14/2/2001 16:53:00;CIDADAO COMUM;N;SL101;SAO TOMAZ;BH;609922.73;805494.21;2080
-2082;2001087204;B03000;AMEACA;AV SIDERAL;371;65721;14/2/2001 16:58:00;CIDADAO COMUM;S;0;VISTA ALEGRE;BH;604340.08;793439.54;2081
-2083;2001087261;B03000;AMEACA;RUA GETULIO DRUM;155;26040;14/2/2001 17:25:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605566.99;793350.25;2082
-2084;2001087335;B03000;AMEACA;RUA STA CATARINA;352;60400;14/2/2001 18:16:00;POLICIAL MILITAR;N;0;CENTRO (BH);BH;610547.19;796653.24;2083
-2085;2001087379;B06000;LESAO CORPORAL;AV SERRANA;647;65040;14/2/2001 18:36:00;CIDADAO COMUM;S;LJ6;SERRANO;BH;603476.59;801568.74;2084
-2086;2001087398;B04001;HOMICIDIO TENTAD;RUA PROFESSORA G;450;86335;14/2/2001 18:49:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611770.58;807594.40;2085
-2087;2001087466;B03000;AMEACA;RUA H;440;78295;14/2/2001 19:22:00;CIDADAO COMUM;S;;VILA PINHO;BH;602017.92;788016.06;2086
-2088;2001087483;B03000;AMEACA;RUA F;85;302327;14/2/2001 19:38:00;CIDADAO COMUM;S;;BONSUCESSO;BH;606318.82;789810.40;2087
-2089;2001087486;B04001;HOMICIDIO TENTAD;RUA OSCAR NEGRAO;29;17776;14/2/2001 19:42:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605045.53;795084.05;2088
-2090;2001087493;B03000;AMEACA;RUA JOSE DE ALEN;269;82274;14/2/2001 19:43:00;CIDADAO COMUM;S;;GUARANI;BH;611909.31;804949.94;2089
-2091;2001087596;B03000;AMEACA;RUA SERENATA;68;172351;14/2/2001 20:37:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614101.09;795309.49;2090
-2092;2001087611;B06000;LESAO CORPORAL;RUA SAO PAULO;409;63464;14/2/2001 20:47:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611057.56;797364.72;2091
-2093;2001087632;B06000;LESAO CORPORAL;RUA GERALDO ILID;283;107680;14/2/2001 20:56:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606527.82;812020.77;2092
-2094;2001087748;B02000;RIXA;RUA VEREADOR JUL;17;125456;14/2/2001 22:07:00;INICIATIVA;S;0;NOVA GAMELEIRA;BH;605709.31;795133.42;2093
-2095;2001087762;B06000;LESAO CORPORAL;RUA LAJEDO;335;130034;14/2/2001 22:10:00;CIDADAO COMUM;S;FU;SAO GABRIEL;BH;614399.48;804590.63;2094
-2096;2001087818;B02000;RIXA;AV CRISTIANO MAC;4000;18652;14/2/2001 22:50:00;INICIATIVA;N;0;DOS PALMARES;BH;612434.91;802092.92;2095
-2097;2001087866;B04001;HOMICIDIO TENTAD;RUA CARMELITA CO;100;93366;14/2/2001 23:14:00;POLICIAL MILITAR;S;0;MINEIRAO;BH;600997.54;785906.69;2096
-2098;2001087869;B06000;LESAO CORPORAL;RUA CRISTAL;312;18611;14/2/2001 23:16:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;612754.03;797170.88;2097
-2099;2001087872;B03000;AMEACA;RUA NIQUELINA;892;47738;14/2/2001 23:17:00;INICIATIVA;N;0;SANTA EFIGENIA;BH;613866.59;797105.70;2098
-2100;2001087874;B05000;SEQUESTRO E CARC;RUA LUIZ BALENA;70;114796;14/2/2001 23:19:00;CIDADAO COMUM;N;AP201;VILA SILVEIRA;BH;611916.32;800099.52;2099
-2101;2001087892;B06000;LESAO CORPORAL;RUA ARAGUARI;525;5376;14/2/2001 23:26:00;CIDADAO COMUM;N;AP-1406;BARRO PRETO;BH;610030.23;796776.44;2100
-2102;2001087908;B03000;AMEACA;RUA ANGRA DOS RE;101;4027;14/2/2001 23:35:00;CIDADAO COMUM;N;0;NOVA GRANADA;BH;607661.15;795094.51;2101
-2103;2001087946;B03000;AMEACA;AV DOM JOAO VI;1010;22294;15/2/2001 00:01:00;INICIATIVA;S;0;PALMEIRAS;BH;606644.46;791666.74;2102
-2104;2001087977;B03000;AMEACA;RUA MANOEL CAYLL;121;43043;15/2/2001 00:22:00;CIDADAO COMUM;S;;HORTO;BH;613259.68;798134.49;2103
-2105;2001088110;B06000;LESAO CORPORAL;RUA VOLTS;280;73626;15/2/2001 02:23:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612030.29;803549.80;2104
-2106;2001088114;B06000;LESAO CORPORAL;BECO NOSSA SENHO;930;170113;15/2/2001 02:25:00;CIDADAO COMUM;N;3 AGUA;CAFEZAL;BH;614339.35;794970.47;2105
-2107;2001088177;B04001;HOMICIDIO TENTAD;RUA ITUMIRIM;16;36230;15/2/2001 03:56:00;CIDADAO COMUM;S;CSA;SANTA INES;BH;614584.65;800620.95;2106
-2108;2001088220;B06000;LESAO CORPORAL;RUA DOS GUARANIS;26;32181;15/2/2001 04:53:00;INICIATIVA;S;0;CENTRO (BH);BH;610757.73;797608.11;2107
-2109;2001088358;B03000;AMEACA;RUA CIRILO GASPA;326;63348;15/2/2001 08:10:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608684.85;800162.78;2108
-2110;2001088395;B09000;ABANDONO DE INCA;RUA JUNQUEIRA FR;20;39644;15/2/2001 08:37:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;607163.35;807956.23;2109
-2111;2001088397;B03000;AMEACA;RUA RIO GRANDE D;708;58731;15/2/2001 08:36:00;CIDADAO COMUM;N;PX2300;FUNCIONARIOS;BH;611896.05;795752.13;2110
-2112;2001088614;B06000;LESAO CORPORAL;AV DOS ANDRADAS;356;3761;15/2/2001 10:53:00;INICIATIVA;S;0;CENTRO BH;BH;611480.30;797265.49;2111
-2113;2001088676;B03000;AMEACA;RUA CARANGOLA;228;13094;15/2/2001 11:44:00;CIDADAO COMUM;S;PX230;SANTO ANTONIO;BH;610754.02;794740.44;2112
-2114;2001088695;B04001;HOMICIDIO TENTAD;RUA ROSA ROCHA C;54;19453;15/2/2001 11:54:00;INICIATIVA;N;0;CARDOSO;BH;603554.58;788167.67;2113
-2115;2001088939;B06000;LESAO CORPORAL;RUA ANGOLA;790;4001;15/2/2001 15:19:00;CIDADAO COMUM;S;;SAO PAULO;BH;613029.32;802881.46;2114
-2116;2001089077;B03000;AMEACA;AV DO CONTORNO;1781;17228;15/2/2001 16:37:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;612253.65;797644.51;2115
-2117;2001089086;B06000;LESAO CORPORAL;RUA UARIRA;350;70136;15/2/2001 16:40:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;616162.91;799326.26;2116
-2118;2001089167;B03000;AMEACA;RUA DO LAGO;510;40161;15/2/2001 17:24:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614189.26;802411.99;2117
-2119;2001089275;B03000;AMEACA;RUA NOVA ESPERAN;205;83898;15/2/2001 18:20:00;CIDADAO COMUM;S;CAC;CEU AZUL;BH;604285.81;807801.26;2118
-2120;2001089356;B04001;HOMICIDIO TENTAD;RUA CRISTIANO OT;212;29192;15/2/2001 18:53:00;CIDADAO COMUM;S;AP201;SANTA TEREZINHA;BH;604360.17;802644.76;2119
-2121;2001089401;B03000;AMEACA;RUA CONTENDAS;63;17215;15/2/2001 19:14:00;CIDADAO COMUM;S;0;BARROCA;BH;607701.63;795996.98;2120
-2122;2001089485;B03000;AMEACA;RUA DES SARAIVA;1075;66535;15/2/2001 20:03:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616101.45;797681.72;2121
-2123;2001089505;B03000;AMEACA;RUA GUAICUI;151;31999;15/2/2001 20:16:00;INICIATIVA;N;0;CORACAO DE JESUS;BH;609829.07;794224.02;2122
-2124;2001089636;B03000;AMEACA;AV RAJA GABAGLIA;1710;57830;15/2/2001 21:38:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608719.62;793771.09;2123
-2125;2001089652;B04001;HOMICIDIO TENTAD;AV MARIA CONCEIC;1356;32052;15/2/2001 21:52:00;CIDADAO COMUM;N;;GOIANIA;BH;615166.56;803057.27;2124
-2126;2001089657;B03000;AMEACA;RUA RADIALISTA M;330;98864;15/2/2001 21:53:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604309.77;808868.97;2125
-2127;2001089658;B06000;LESAO CORPORAL;RUA PRATINHA;49;88485;15/2/2001 21:54:00;CIDADAO COMUM;S;CAC;CAICARA;BH;606915.08;799459.94;2126
-2128;2001089664;B03000;AMEACA;RUA ARAL;59;5389;15/2/2001 21:56:00;CIDADAO COMUM;S;;CH BETANIA;BH;605281.73;792385.15;2127
-2129;2001089665;B06000;LESAO CORPORAL;RUA CASTELO BRAN;110;14030;15/2/2001 21:56:00;CIDADAO COMUM;N;CAA;SANTA TEREZINHA;BH;604414.63;802592.40;2128
-2130;2001089677;B06000;LESAO CORPORAL;RUA ARARIBA;235;5540;15/2/2001 22:05:00;CIDADAO COMUM;N;;SAO CRISTOVAO;BH;610149.82;799166.33;2129
-2131;2001089724;B03000;AMEACA;RUA TRINTA E SET;31;34190;15/2/2001 22:32:00;CIDADAO COMUM;S;31;CONJUNTO FELICID;BH;612467.97;807431.31;2130
-2132;2001089766;B06000;LESAO CORPORAL;RUA JOAO PAULINO;50;87048;15/2/2001 23:01:00;CIDADAO COMUM;S;0;DA LAGOA;BH;604692.66;809030.76;2131
-2133;2001089832;B03000;AMEACA;RUA AROEIRA;892;81385;15/2/2001 23:35:00;INICIATIVA;S;0;SAO JOAO BATISTA;BH;610748.85;801927.11;2132
-2134;2001089909;B03000;AMEACA;AV CACHOEIRINHA;861;11250;16/2/2001 00:20:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610468.79;801301.88;2133
-2135;2001089951;B06000;LESAO CORPORAL;AV BRASIL;41;10420;16/2/2001 00:56:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;612997.74;796618.26;2134
-2136;2001089970;B03000;AMEACA;AV OLINTO MEIREL;1400;49847;16/2/2001 01:07:00;INICIATIVA;S;0;SANTA HELENA (BH;BH;603611.60;790119.35;2135
-2137;2001089972;B03000;AMEACA;RUA PARAIBA;1255;52170;16/2/2001 01:09:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611617.62;795132.74;2136
-2138;2001089982;B06000;LESAO CORPORAL;RUA ALFREDINA AM;135;2251;16/2/2001 01:21:00;CIDADAO COMUM;S;AN2;MILIONARIOS;BH;604399.69;790520.39;2137
-2139;2001090014;B04001;HOMICIDIO TENTAD;AV CORONEL DURVA;732;17688;16/2/2001 01:54:00;CIDADAO COMUM;S;;DURVAL DE BARROS;BH;598151.28;790894.64;2138
-2140;2001090047;B03000;AMEACA;RUA ATTILIO DE M;351;111630;16/2/2001 02:29:00;CIDADAO COMUM;S;CAA     FU;DIAMANTE;BH;601521.26;789910.34;2139
-2141;2001090073;B06000;LESAO CORPORAL;AV DO CONTORNO;6244;17228;16/2/2001 03:04:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611257.58;794841.55;2140
-2142;2001090159;B02000;RIXA;RUA OURO PRETO;300;50730;16/2/2001 04:42:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609908.33;797015.97;2141
-2143;2001090187;B06000;LESAO CORPORAL;AV SANTOS DUMONT;680;61950;16/2/2001 05:42:00;INICIATIVA;N;0;CENTRO BH;BH;610999.13;797614.04;2142
-2144;2001090391;B03000;AMEACA;RUA E;70;130743;16/2/2001 08:50:00;CIDADAO COMUM;N;0;INSTITUTO AGRONO;BH;614047.53;799573.40;2143
-2145;2001090441;B03000;AMEACA;AV OLEGARIO MACI;698;49699;16/2/2001 09:29:00;CIDADAO COMUM;S;MERCADO NOVO;CENTRO (BH);BH;610483.21;797000.62;2144
-2146;2001090443;B03000;AMEACA;RUA JOSE OVIDIO ;970;10298;16/2/2001 09:30:00;CIDADAO COMUM;N;0;CARDOSO;BH;603504.94;787842.27;2145
-2147;2001090488;B03000;AMEACA;RUA ILHA DE MALT;90;20926;16/2/2001 10:15:00;INICIATIVA;N;0;SAO GABRIEL;BH;614020.17;803939.85;2146
-2148;2001090518;B03000;AMEACA;RUA IRMAOS RODRI;110;35108;16/2/2001 10:27:00;CIDADAO COMUM;N;;AARAO REIS;BH;613324.76;805089.21;2147
-2149;2001090564;B03000;AMEACA;RUA BEBEDOURO;80;128010;16/2/2001 10:50:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;615701.66;800447.38;2148
-2150;2001090574;B06000;LESAO CORPORAL;RUA SAO RAFAEL;128;63580;16/2/2001 10:59:00;CIDADAO COMUM;S;FUNDOS;FLORESTA;BH;612235.40;798259.74;2149
-2151;2001090580;B03000;AMEACA;RUA SABINOPOLIS;391;59790;16/2/2001 11:03:00;INICIATIVA;N;0;CARLOS PRATES;BH;608912.23;798344.41;2150
-2152;2001090640;B04002;HOMICIDIO CONSUM;RUA ACALIFA;8;98385;16/2/2001 11:46:00;CIDADAO COMUM;S;ACAMPAMENTO MARI;JULIANA;BH;611001.95;809141.12;2151
-2153;2001090712;B06000;LESAO CORPORAL;RUA HORACIO DOLA;175;11565;16/2/2001 12:29:00;INICIATIVA;S;0;CEU AZUL;BH;604118.20;807543.82;2152
-2154;2001090756;B03000;AMEACA;RUA PITANGUI;33;54365;16/2/2001 13:05:00;CIDADAO COMUM;N;0;SAO CRISTOVAO;BH;610543.96;799415.99;2153
-2155;2001090775;B03000;AMEACA;RUA PADRE FEIJO;549;51326;16/2/2001 13:19:00;POLICIAL MILITAR;S;;SAUDADE;BH;615464.89;797595.09;2154
-2156;2001090908;B04001;HOMICIDIO TENTAD;RUA ALEXANDRITA;284;91304;16/2/2001 14:49:00;CIDADAO COMUM;S;;BETANIA;BH;605673.10;793001.80;2155
-2157;2001090915;B03000;AMEACA;RUA GETULIO DRUM;280;26040;16/2/2001 14:55:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605578.88;793232.64;2156
-2158;2001090916;B03000;AMEACA;RUA CAMILO DE BR;636;11896;16/2/2001 14:55:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605855.99;798012.24;2157
-2159;2001090975;B03000;AMEACA;RUA PADRE JULIO ;1571;51496;16/2/2001 15:36:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616274.14;797626.03;2158
-2160;2001090979;B03000;AMEACA;RUA RAIMUNDO TIN;182;301229;16/2/2001 15:37:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610702.97;793142.76;2159
-2161;2001091133;B06000;LESAO CORPORAL;AV CHURCHILL;39;15222;16/2/2001 16:57:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;613209.68;796790.66;2160
-2162;2001091142;B03000;AMEACA;RUA ANTONIO CARL;21;108670;16/2/2001 17:03:00;CIDADAO COMUM;S;;MINASCAIXA;BH;608872.80;809582.96;2161
-2163;2001091174;B06000;LESAO CORPORAL;RUA ARIOLINO ARI;159;85811;16/2/2001 17:15:00;CIDADAO COMUM;S;0;SERRA VERDE;BH;609207.39;810119.05;2162
-2164;2001091292;B06000;LESAO CORPORAL;AV PRUDENTE DE M;1965;55774;16/2/2001 18:22:00;CIDADAO COMUM;S;AP701;SANTO ANTONIO;BH;610208.70;793775.64;2163
-2165;2001091329;B06000;LESAO CORPORAL;RUA E;62;302329;16/2/2001 18:43:00;CIDADAO COMUM;S;0;BOM SUCESSO;BH;606194.00;789731.97;2164
-2166;2001091359;B03000;AMEACA;RUA FRANCELINA A;549;29265;16/2/2001 19:07:00;CIDADAO COMUM;S;;PIRAJA;BH;614287.13;803103.73;2165
-2167;2001091364;B06000;LESAO CORPORAL;RUA ITABIRA;450;35237;16/2/2001 19:11:00;INICIATIVA;S;0;LAGOINHA;BH;610968.63;798450.39;2166
-2168;2001091369;B06000;LESAO CORPORAL;RUA PARA DE MINA;845;52070;16/2/2001 19:14:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;605807.00;797725.10;2167
-2169;2001091385;B03000;AMEACA;RUA DO CARMO;117;13646;16/2/2001 19:27:00;CIDADAO COMUM;S;0;ITAIPU BH;BH;598973.23;789319.66;2168
-2170;2001091400;B06000;LESAO CORPORAL;RUA ALVARO FERNA;148;102415;16/2/2001 19:37:00;INICIATIVA;S;0;VERA CRUZ;BH;616786.53;797450.04;2169
-2171;2001091428;B03000;AMEACA;RUA GRAVETEIRO;50;95853;16/2/2001 19:51:00;CIDADAO COMUM;N;;GOIANIA;BH;615297.87;802503.50;2170
-2172;2001091464;B03000;AMEACA;RUA ARISCO;152;74758;16/2/2001 20:14:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616713.81;804674.58;2171
-2173;2001091477;B03000;AMEACA;RUA DAS PERPETUA;1071;911;16/2/2001 20:29:00;CIDADAO COMUM;N;0;LINDEIA;BH;599244.38;790367.98;2172
-2174;2001091483;B04001;HOMICIDIO TENTAD;RUA FREI MANOEL ;577;29974;16/2/2001 20:32:00;CIDADAO COMUM;S;BLB     AP902;LIBERDADE;BH;609905.49;803627.17;2173
-2175;2001091502;B06000;LESAO CORPORAL;RUA RIACHO;87;24927;16/2/2001 20:44:00;CIDADAO COMUM;N;0;TAQUARIL;BH;617229.41;797173.93;2174
-2176;2001091582;B03000;AMEACA;BECO PRIMEIRO DE;13;302438;16/2/2001 21:31:00;CIDADAO COMUM;S;CAB;MANTIQUEIRA;BH;606906.19;811699.13;2175
-2177;2001091604;B06000;LESAO CORPORAL;RUA ELOI MENDES;201;25277;16/2/2001 21:47:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612761.04;798110.17;2176
-2178;2001091615;B03000;AMEACA;RUA PADRE MANOEL;143;51569;16/2/2001 21:52:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;614135.75;796233.74;2177
-2179;2001091627;B06000;LESAO CORPORAL;RUA REGIA;207;58209;16/2/2001 22:05:00;CIDADAO COMUM;N;;NOVA CINTRA;BH;605661.54;794056.19;2178
-2180;2001091634;B03000;AMEACA;RUA BADARO JUNIO;15;7532;16/2/2001 22:09:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612042.23;803554.37;2179
-2181;2001091663;B03000;AMEACA;RUA PROFESSOR RU;450;86754;16/2/2001 22:32:00;CIDADAO COMUM;N;CAB;JARDIM GUANABARA;BH;611585.01;807365.63;2180
-2182;2001091668;B03000;AMEACA;RUA DOS CACTOS;57;73119;16/2/2001 22:37:00;INICIATIVA;S;0;LINDEIA;BH;598831.75;791014.25;2181
-2183;2001091699;B04001;HOMICIDIO TENTAD;RUA FAISAO;700;27710;16/2/2001 22:48:00;POLICIAL MILITAR;N;0;FLAVIO MARQUES D;BH;605210.94;788677.86;2182
-2184;2001091769;B03000;AMEACA;AV SETE DE ABRIL;519;65560;16/2/2001 23:29:00;CIDADAO COMUM;S;;ESPLANADA;BH;614504.08;798488.31;2183
-2185;2001091779;B06000;LESAO CORPORAL;RUA JOSE BARBOSA;157;85304;16/2/2001 23:32:00;CIDADAO COMUM;S;;JAQUELINE;BH;610514.81;810125.87;2184
-2186;2001091815;B06000;LESAO CORPORAL;RUA 35;42;302833;17/2/2001 00:00:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;613934.25;805520.40;2185
-2187;2001091831;B04002;HOMICIDIO CONSUM;RUA FAUSTINO ASS;148;27824;17/2/2001 00:05:00;CIDADAO COMUM;N;0;MAGNESITA;BH;604163.70;793810.66;2186
-2188;2001091840;B03000;AMEACA;RUA JOSE ROMANO;121;15796;17/2/2001 00:14:00;CIDADAO COMUM;S;;SAO JOSE;BH;605134.23;798826.00;2187
-2189;2001091851;B06000;LESAO CORPORAL;RUA JOSE BARBOSA;517;85304;17/2/2001 00:22:00;CIDADAO COMUM;N;0;JAQUELINE;BH;610735.42;810323.17;2188
-2190;2001091864;B06000;LESAO CORPORAL;RUA BANDONION;211;170139;17/2/2001 00:30:00;CIDADAO COMUM;S;PX472;VILA CAFEZAL;BH;614041.90;794984.61;2189
-2191;2001091883;B03000;AMEACA;RUA BANDONION;79;170139;17/2/2001 00:40:00;INICIATIVA;N;0;VILA CAFEZAL;BH;614016.06;795069.25;2190
-2192;2001091884;B06000;LESAO CORPORAL;RUA DONA LUCI;408;86004;17/2/2001 00:41:00;INICIATIVA;N;0;CINQUENTENARIO;BH;606438.83;791862.80;2191
-2193;2001091942;B04001;HOMICIDIO TENTAD;AV BRIGADEIRO ED;870;2860;17/2/2001 01:11:00;CIDADAO COMUM;S;0;GLORIA;BH;604398.53;798513.15;2192
-2194;2001091999;B03000;AMEACA;RUA ESTRELA;26;86310;17/2/2001 01:45:00;CIDADAO COMUM;N;0;CELESTINO;BH;610886.12;808672.60;2193
-2195;2001092003;B03000;AMEACA;RUA HELVECIO MON;97;33001;17/2/2001 01:48:00;CIDADAO COMUM;N;;VILA OESTE;BH;604410.60;795565.96;2194
-2196;2001092030;B06000;LESAO CORPORAL;AV SINFRONIO BRO;350;66116;17/2/2001 02:07:00;CIDADAO COMUM;N;0;BARREIRO;BH;603002.38;790928.20;2195
-2197;2001092056;B03000;AMEACA;RUA PARA DE MINA;139;52070;17/2/2001 02:21:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;606589.43;797648.14;2196
-2198;2001092069;B03000;AMEACA;RUA CONTAGEM;1600;70293;17/2/2001 02:35:00;CIDADAO COMUM;S;;SANTA INES;BH;614360.04;801201.70;2197
-2199;2001092115;B06000;LESAO CORPORAL;RUA SAO PAULO;279;63464;17/2/2001 02:59:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611088.02;797493.26;2198
-2200;2001092138;B06000;LESAO CORPORAL;RUA PONTA GROSSA;905;14900;17/2/2001 03:18:00;CIDADAO COMUM;S;0;CRISTO REDENTOR;BH;604801.53;790245.22;2199
-2201;2001092142;B06000;LESAO CORPORAL;RUA QUARENTA E S;50;302841;17/2/2001 03:19:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614267.81;805802.32;2200
-2202;2001092155;B03000;AMEACA;RUA DR BROCHADO;16;23215;17/2/2001 03:28:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615833.96;798332.84;2201
-2203;2001092195;B04001;HOMICIDIO TENTAD;RUA TEBAS;401;67090;17/2/2001 03:47:00;INICIATIVA;N;0;VERA CRUZ;BH;615721.64;798265.77;2202
-2204;2001092237;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;877;6731;17/2/2001 04:22:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;610561.38;796714.77;2203
-2205;2001092245;B06000;LESAO CORPORAL;RUA PRELUDIO;239;101642;17/2/2001 04:30:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;607538.25;806790.64;2204
-2206;2001092278;B06000;LESAO CORPORAL;RUA DOUTOR CRIST;312;55598;17/2/2001 05:14:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;604751.25;789297.85;2205
-2207;2001092325;B03000;AMEACA;AV ITAITE;50;35441;17/2/2001 06:17:00;CIDADAO COMUM;S;;SAO GERALDO;BH;614822.25;799362.74;2206
-2208;2001092338;B03000;AMEACA;RUA CLOTILDE RIB;83;72507;17/2/2001 06:42:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608840.66;807990.84;2207
-2209;2001092503;B03000;AMEACA;AV CECILIA PINTO;125;14447;17/2/2001 09:08:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;610655.78;805320.47;2208
-2210;2001092544;B03000;AMEACA;RUA DO CAMPO;120;12136;17/2/2001 09:42:00;INICIATIVA;S;0;HAVAI;BH;607432.47;793601.64;2209
-2211;2001092547;B03000;AMEACA;RUA ERNESTO CARN;43;28099;17/2/2001 09:46:00;CIDADAO COMUM;N;CAA;PADRE EUSTAQUIO;BH;606439.90;797104.09;2210
-2212;2001092694;B03000;AMEACA;RUA AMERICA;41;3239;17/2/2001 11:46:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;611091.64;804986.46;2211
-2213;2001092801;B06000;LESAO CORPORAL;RUA FERNAO GOMES;160;119705;17/2/2001 13:13:00;INICIATIVA;S;0;VERA CRUZ;BH;616951.95;797377.70;2212
-2214;2001092891;B06000;LESAO CORPORAL;RUA A;335;78673;17/2/2001 14:05:00;CIDADAO COMUM;N;;CH JATOBA IV;BH;600123.46;788004.17;2213
-2215;2001092911;B03000;AMEACA;RUA ITABERA;296;35224;17/2/2001 14:23:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;614214.74;797171.59;2214
-2216;2001092913;B06000;LESAO CORPORAL;AV PRESIDENTE AN;758;4461;17/2/2001 14:21:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610544.46;798745.75;2215
-2217;2001093016;B03000;AMEACA;AV PRUDENTE DE M;393;55774;17/2/2001 15:23:00;CIDADAO COMUM;S;LJ01;CIDADE JARDIM;BH;610187.86;794922.92;2216
-2218;2001093022;B04001;HOMICIDIO TENTAD;RUA JULIO DE CAS;1232;39470;17/2/2001 15:25:00;CIDADAO COMUM;N;;CINQUENTENARIO;BH;606605.39;792116.47;2217
-2219;2001093134;B06000;LESAO CORPORAL;RUA PONTA PORA;28;54601;17/2/2001 16:29:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613149.37;796815.00;2218
-2220;2001093139;B03000;AMEACA;RUA TULIPA;1274;69851;17/2/2001 16:30:00;INICIATIVA;S;0;ESPLANADA;BH;615286.17;798382.46;2219
-2221;2001093251;B06000;LESAO CORPORAL;RUA FLOR DA ROMA;88;23808;17/2/2001 17:35:00;CIDADAO COMUM;S;;VILA IPE;BH;605882.08;799902.76;2220
-2222;2001093260;B03000;AMEACA;RUA DAS PRINCESA;101;55330;17/2/2001 17:45:00;CIDADAO COMUM;N;;VILA OESTE;BH;604262.01;794976.39;2221
-2223;2001093305;B03000;AMEACA;RUA CINQUENTA E ;89;106201;17/2/2001 18:13:00;CIDADAO COMUM;S;;NOVA YORK;BH;608593.49;810710.03;2222
-2224;2001093338;B03000;AMEACA;RUA SAO JOAO DE ;285;110073;17/2/2001 18:29:00;CIDADAO COMUM;S;;PILAR;BH;607532.32;788462.72;2223
-2225;2001093342;B03000;AMEACA;RUA DOS VIOLINOS;123;101797;17/2/2001 18:32:00;CIDADAO COMUM;S;AP202;CH CALIFORNIA;BH;603794.84;796641.72;2224
-2226;2001093355;B03000;AMEACA;RUA MARIA APAREC;100;43853;17/2/2001 18:45:00;CIDADAO COMUM;S;0;SAO MARCOS;BH;613901.71;802711.93;2225
-2227;2001093370;B03000;AMEACA;RUA DUZENTOS E T;73;24536;17/2/2001 18:50:00;CIDADAO COMUM;S;0;CH VALE DO JATOB;BH;600454.11;787414.72;2226
-2228;2001093392;B03000;AMEACA;RUA SANTA FRANCI;685;60655;17/2/2001 19:03:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608451.88;800571.03;2227
-2229;2001093398;B03000;AMEACA;RUA CAMASSARI;141;11754;17/2/2001 19:06:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;605030.60;790317.84;2228
-2230;2001093401;B06000;LESAO CORPORAL;RUA WALTER IANNI;80;82186;17/2/2001 19:08:00;INICIATIVA;N;0;SAO GABRIEL;BH;613192.78;803761.07;2229
-2231;2001093468;B06000;LESAO CORPORAL;RUA ENCOSTA;12;20406;17/2/2001 19:45:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607344.77;807411.00;2230
-2232;2001093531;B03000;AMEACA;RUA SAO MATIAS;320;63408;17/2/2001 20:13:00;CIDADAO COMUM;S;;SERRANO;BH;603539.80;800675.01;2231
-2233;2001093536;B02000;RIXA;RUA TOME DE SOUZ;935;67998;17/2/2001 20:15:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611457.69;795178.33;2232
-2234;2001093551;B04001;HOMICIDIO TENTAD;RUA BONFIM;641;10096;17/2/2001 20:21:00;CIDADAO COMUM;S;;BONFIM;BH;610151.96;798046.05;2233
-2235;2001093571;B06000;LESAO CORPORAL;RUA TOME DE SOUZ;935;67998;17/2/2001 20:32:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611457.69;795178.33;2234
-2236;2001093618;B03000;AMEACA;RUA DOS TUPIS;1642;69965;17/2/2001 20:50:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609682.21;797276.24;2235
-2237;2001093629;B03000;AMEACA;RUA JOSE JOAQUIM;255;38871;17/2/2001 20:54:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610954.46;802060.45;2236
-2238;2001093645;B06000;LESAO CORPORAL;AV DO CONTORNO;1955;17228;17/2/2001 20:57:00;CIDADAO COMUM;S;FR;CENTRO (BH);BH;612342.06;797489.86;2237
-2239;2001093660;B06000;LESAO CORPORAL;RUA PAU FERRO;335;102138;17/2/2001 21:08:00;CIDADAO COMUM;S;0;SOLIMOES;BH;612656.52;807906.15;2238
-2240;2001093665;B03000;AMEACA;RUA GEORGINA PEN;150;31006;17/2/2001 21:07:00;CIDADAO COMUM;S;A;SAO LUCAS;BH;614133.28;795705.78;2239
-2241;2001093683;B03000;AMEACA;RUA BOA VISTA;235;170170;17/2/2001 21:17:00;CIDADAO COMUM;S;;CABANA;BH;604488.55;794283.53;2240
-2242;2001093691;B02000;RIXA;RUA CANDELARIA;95;12501;17/2/2001 21:20:00;CIDADAO COMUM;S;CAC;VILA OESTE;BH;604307.70;795241.24;2241
-2243;2001093702;B04001;HOMICIDIO TENTAD;ESTRADA DO CERCA;2090;26428;17/2/2001 21:24:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607493.80;793552.14;2242
-2244;2001093794;B06000;LESAO CORPORAL;RUA BOAVENTURA;67;9783;17/2/2001 22:13:00;CIDADAO COMUM;S;;VILA INDAIA;BH;609601.28;804249.81;2243
-2245;2001093818;B03000;AMEACA;RUA VINTE E TRES;43;85550;17/2/2001 22:28:00;INICIATIVA;N;0;SERRA VERDE;BH;609894.94;810467.98;2244
-2246;2001093884;B06000;LESAO CORPORAL;RUA PORTO SEGURO;1331;60595;17/2/2001 23:07:00;CIDADAO COMUM;S;CAFR;NOVA VISTA;BH;615617.40;800842.65;2245
-2247;2001093995;B06000;LESAO CORPORAL;RUA TENENTE VITO;10;67351;17/2/2001 23:24:00;INICIATIVA;S;0;SANTA TEREZA;BH;613424.95;797503.01;2246
-2248;2001094047;B04001;HOMICIDIO TENTAD;RUA VINTE E SEIS;160;72780;17/2/2001 23:59:00;POLICIAL MILITAR;S;0;LEONINA;BH;608498.24;793329.27;2247
-2249;2001094074;B03000;AMEACA;RUA VIOLETA DE M;26;80253;18/2/2001 00:17:00;CIDADAO COMUM;S;0;SAO JOSE;BH;605328.14;799159.14;2248
-2250;2001094114;B03000;AMEACA;AV RAJA GABAGLIA;3500;57830;18/2/2001 00:48:00;INICIATIVA;N;0;ESTORIL;BH;609202.60;792327.00;2249
-2251;2001094130;B03000;AMEACA;RUA GABRO;412;30435;18/2/2001 00:59:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612889.45;797274.75;2250
-2252;2001094202;B06000;LESAO CORPORAL;RUA JOAQUIM RAMO;587;38175;18/2/2001 01:37:00;CIDADAO COMUM;N;0;PARAISO;BH;614891.10;796559.44;2251
-2253;2001094203;B02000;RIXA;RUA URSULA PAULI;1619;71066;18/2/2001 01:38:00;CIDADAO COMUM;S;AP04;ESTRELA DO ORIEN;BH;605719.59;792476.26;2252
-2254;2001094232;B04002;HOMICIDIO CONSUM;RUA FLAMENGO;16;130601;18/2/2001 01:59:00;CIDADAO COMUM;N;0;LEBLON;BH;605783.10;809975.35;2253
-2255;2001094234;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;470;63782;18/2/2001 02:00:00;INICIATIVA;N;0;MORRO DO PAPAGAI;BH;610865.34;793549.62;2254
-2256;2001094241;B06000;LESAO CORPORAL;RUA BONFIM;513;10096;18/2/2001 02:05:00;CIDADAO COMUM;S;;BONFIM;BH;610224.47;797941.04;2255
-2257;2001094250;B03000;AMEACA;RUA U;5;27260;18/2/2001 02:14:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616607.44;806842.86;2256
-2258;2001094269;B03000;AMEACA;AV COLETORA;204;78241;18/2/2001 02:34:00;CIDADAO COMUM;S;;VILA PINHO;BH;601871.72;788550.76;2257
-2259;2001094271;B03000;AMEACA;AV DO CONTORNO;6001;17228;18/2/2001 02:35:00;INICIATIVA;S;0;CARMO;BH;611659.17;794835.24;2258
-2260;2001094303;B06000;LESAO CORPORAL;RUA CORONEL ANTO;245;17619;18/2/2001 03:02:00;CIDADAO COMUM;S;;REGINA;BH;599153.96;790105.62;2259
-2261;2001094354;B06000;LESAO CORPORAL;RUA RITMO;168;301436;18/2/2001 04:01:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614143.53;795296.98;2260
-2262;2001094359;B06000;LESAO CORPORAL;RUA GUAICURUS;538;32009;18/2/2001 04:10:00;INICIATIVA;S;0;CENTRO BH;BH;611143.63;797659.74;2261
-2263;2001094388;B03000;AMEACA;RUA DUZENTOS E T;73;24536;18/2/2001 04:45:00;CIDADAO COMUM;S;0;CH VALE DO JATOB;BH;600454.11;787414.72;2262
-2264;2001094417;B03000;AMEACA;RUA EGITO;190;25189;18/2/2001 05:20:00;CIDADAO COMUM;S;0;SAO SALVADOR;BH;603437.23;799645.18;2263
-2265;2001094432;B04002;HOMICIDIO CONSUM;RUA CONDOR;445;16773;18/2/2001 05:38:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605847.00;793807.25;2264
-2266;2001094434;B03000;AMEACA;RUA TRIPUI;20;69763;18/2/2001 05:42:00;CIDADAO COMUM;S;;GUARANI;BH;612802.62;805718.90;2265
-2267;2001094445;B02000;RIXA;AV SARAMENHA;720;64007;18/2/2001 06:01:00;INICIATIVA;N;0;FLORAMAR;BH;612541.25;805817.83;2266
-2268;2001094448;B04001;HOMICIDIO TENTAD;RUA GENERAL LADA;171;36520;18/2/2001 06:14:00;CIDADAO COMUM;N;CA3;GOIANIA;BH;615050.81;802764.73;2267
-2269;2001094466;B04002;HOMICIDIO CONSUM;BECO SANTO ANTON;58;302091;18/2/2001 06:49:00;CIDADAO COMUM;N;;VILA CALIFORNIA;BH;603966.86;797275.61;2268
-2270;2001094515;B03000;AMEACA;RUA SAO PEDRO DO;19;63842;18/2/2001 07:54:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612040.86;803799.62;2269
-2271;2001094559;B03000;AMEACA;RUA FLOR DA PAIX;42;28782;18/2/2001 08:35:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;605881.83;799262.46;2270
-2272;2001094577;B03000;AMEACA;RUA CANARIO;703;50106;18/2/2001 08:50:00;CIDADAO COMUM;S;0;GOIANIA;BH;615544.37;803013.49;2271
-2273;2001094689;B06000;LESAO CORPORAL;RUA REGENCIA;100;301448;18/2/2001 10:29:00;INICIATIVA;S;0;VILA CAFEZAL;BH;614118.47;795470.66;2272
-2274;2001094709;B03000;AMEACA;RUA FREI LEOPOLD;153;29946;18/2/2001 10:40:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606823.65;802833.82;2273
-2275;2001094815;B06000;LESAO CORPORAL;AV OLEGARIO MACI;5;49699;18/2/2001 12:01:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610698.51;797640.81;2274
-2276;2001094854;B06000;LESAO CORPORAL;AV OIAPOQUE;264;49166;18/2/2001 12:30:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610918.13;797828.76;2275
-2277;2001094864;B04001;HOMICIDIO TENTAD;AV WALDIR SOEIRO;10;118904;18/2/2001 12:39:00;CIDADAO COMUM;N;0;MILIONARIOS;BH;603541.81;789510.67;2276
-2278;2001094868;B04001;HOMICIDIO TENTAD;RUA GENERAL OZOR;707;30901;18/2/2001 12:41:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;615594.65;797934.45;2277
-2279;2001094874;B06000;LESAO CORPORAL;RUA PIRAPORA;99;54176;18/2/2001 12:44:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;613695.01;796551.73;2278
-2280;2001094913;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;3792;17095;18/2/2001 13:15:00;INICIATIVA;N;0;SAGRADA FAMILIA;BH;613741.51;798439.29;2279
-2281;2001094970;B06000;LESAO CORPORAL;RUA DALMI CECILI;144;101176;18/2/2001 13:55:00;CIDADAO COMUM;N;CSC;FLORAMAR;BH;610937.76;807364.76;2280
-2282;2001095011;B06000;LESAO CORPORAL;AV MEM DE SA;1728;45395;18/2/2001 14:20:00;INICIATIVA;S;0;FAZENDINHA;BH;614290.42;795998.55;2281
-2283;2001095020;B03000;AMEACA;RUA BONFIM;544;10096;18/2/2001 14:27:00;CIDADAO COMUM;S;FU;BONFIM;BH;610213.22;797986.51;2282
-2284;2001095021;B03000;AMEACA;PRACA BAGATELLE;35;84720;18/2/2001 14:30:00;CIDADAO COMUM;S;;AEROPORTO DA PAM;BH;609214.07;804691.90;2283
-2285;2001095037;B06000;LESAO CORPORAL;RUA MARQUES DO L;482;44755;18/2/2001 14:36:00;CIDADAO COMUM;N;CA01;JOAO PINHEIRO;BH;604482.56;796269.88;2284
-2286;2001095043;B03000;AMEACA;RUA RADIALISTA M;1111;98864;18/2/2001 14:43:00;CIDADAO COMUM;S;;CEU AZUL;BH;604226.17;808393.41;2285
-2287;2001095089;B03000;AMEACA;RUA ITAPECERICA;42;35757;18/2/2001 15:19:00;CIDADAO COMUM;N;;LAGOINHA;BH;610796.43;798065.06;2286
-2288;2001095093;B03000;AMEACA;RUA CINABRIO;300;15276;18/2/2001 15:22:00;CIDADAO COMUM;S;CAFR;PRADO LOPES;BH;610021.42;798566.35;2287
-2289;2001095105;B06000;LESAO CORPORAL;RUA EDUARDO CARL;42;130582;18/2/2001 15:28:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604696.58;789263.56;2288
-2290;2001095106;B03000;AMEACA;RUA REIS DE ABRE;224;63363;18/2/2001 15:31:00;CIDADAO COMUM;N;;APARECIDA SETIMA;BH;608553.03;800581.70;2289
-2291;2001095119;B03000;AMEACA;RUA SAO TOMAS DE;595;63782;18/2/2001 15:39:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610837.70;793388.15;2290
-2292;2001095121;B03000;AMEACA;AV WASHINGTON LU;115;73701;18/2/2001 15:43:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;611072.54;804833.84;2291
-2293;2001095129;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS;6;63770;18/2/2001 15:46:00;CIDADAO COMUM;S;;PLANALTO;BH;610641.48;805609.77;2292
-2294;2001095179;B06000;LESAO CORPORAL;RUA MILTON DIAS;111;82712;18/2/2001 16:26:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;617080.52;803920.41;2293
-2295;2001095231;B06000;LESAO CORPORAL;BECO PRINCIPAL;230;170504;18/2/2001 17:00:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608596.19;793933.42;2294
-2296;2001095306;B06000;LESAO CORPORAL;AV DJALMA VIEIRA;994;53410;18/2/2001 17:56:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600495.77;787406.59;2295
-2297;2001095314;B06000;LESAO CORPORAL;RUA F;80;27487;18/2/2001 18:01:00;CIDADAO COMUM;S;0;VILA MARAVILHAS;BH;603084.51;795584.66;2296
-2298;2001095333;B03000;AMEACA;RUA JULITA NOGUE;406;39597;18/2/2001 18:18:00;CIDADAO COMUM;N;;SARANDI (URCA/BH;BH;603772.02;802478.16;2297
-2299;2001095337;B06000;LESAO CORPORAL;AV DOM JOAO VI;169;22294;18/2/2001 18:20:00;CIDADAO COMUM;N;;CINQUENTENARIO;BH;606195.21;792895.55;2298
-2300;2001095354;B03000;AMEACA;RUA ENGENHO DO O;73;103102;18/2/2001 18:35:00;CIDADAO COMUM;S;CAB;ENGENHO NOGUEIRA;BH;606446.26;800361.51;2299
-2301;2001095367;B03000;AMEACA;RUA BEIRA MAR;422;94992;18/2/2001 18:40:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603081.96;802265.91;2300
-2302;2001095389;B06000;LESAO CORPORAL;RUA CAMILO DE BR;248;11896;18/2/2001 18:52:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606212.93;797959.97;2301
-2303;2001095415;B06000;LESAO CORPORAL;RUA FREI LUIZ DE;140;29961;18/2/2001 19:06:00;CIDADAO COMUM;N;;ALTO DOS PINHEIR;BH;604876.04;795919.50;2302
-2304;2001095471;B04002;HOMICIDIO CONSUM;RUA FERNAO DIAS;1853;28133;18/2/2001 19:45:00;CIDADAO COMUM;N;0;JONAS VEIGA;BH;616249.53;797464.28;2303
-2305;2001095477;B03000;AMEACA;RUA ARIOLINO ARI;159;85811;18/2/2001 19:48:00;CIDADAO COMUM;S;0;SERRA VERDE;BH;609207.39;810119.05;2304
-2306;2001095530;B06000;LESAO CORPORAL;RUA JOSE PINTO D;10;100901;18/2/2001 20:18:00;CIDADAO COMUM;S;0;JARDIM GUANABARA;BH;611479.65;807085.75;2305
-2307;2001095609;B06000;LESAO CORPORAL;RUA CONEGO SANTA;546;16859;18/2/2001 20:58:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610600.04;801826.61;2306
-2308;2001095611;B03000;AMEACA;RUA JOEL JOSE DE;281;68698;18/2/2001 20:59:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;605046.83;791261.70;2307
-2309;2001095623;B06000;LESAO CORPORAL;RUA DOS TUPIS;369;69965;18/2/2001 21:06:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610933.97;796910.36;2308
-2310;2001095643;B04001;HOMICIDIO TENTAD;RUA REIS DE ABRE;440;63363;18/2/2001 21:18:00;CIDADAO COMUM;S;LJ1;APARECIDA SETIMA;BH;608751.51;800785.16;2309
-2311;2001095665;B03000;AMEACA;RUA MARIA PIETRA;125;2668;18/2/2001 21:28:00;INICIATIVA;N;0;SAO PAULO;BH;612440.02;802941.04;2310
-2312;2001095682;B03000;AMEACA;RUA PARANAMIRIM;24;52269;18/2/2001 21:41:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;605341.80;790124.53;2311
-2313;2001095693;B04001;HOMICIDIO TENTAD;RUA MUNIZ;149;170850;18/2/2001 21:47:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608113.39;793880.88;2312
-2314;2001095699;B03000;AMEACA;RUA CALDAS DA RA;2559;61100;18/2/2001 21:51:00;CIDADAO COMUM;S;CSA;SAO FRANCISCO;BH;608467.61;800980.26;2313
-2315;2001095707;B04001;HOMICIDIO TENTAD;RUA JOSE FELIX M;800;7416;18/2/2001 21:56:00;INICIATIVA;N;0;MANTIQUEIRA;BH;606465.11;810558.08;2314
-2316;2001095715;B03000;AMEACA;RUA CASCALHEIRA;177;13889;18/2/2001 22:01:00;CIDADAO COMUM;N;;VENDA NOVA;BH;609380.40;808731.30;2315
-2317;2001095755;B06000;LESAO CORPORAL;RUA DOS AFONSOS;371;1319;18/2/2001 22:28:00;CIDADAO COMUM;N;CA02;BOA VISTA;BH;615950.95;800243.51;2316
-2318;2001095758;B03000;AMEACA;RUA MANGARATIBA;174;42822;18/2/2001 22:31:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615031.70;799151.60;2317
-2319;2001095759;B03000;AMEACA;RUA CAMPOS SALES;472;12300;18/2/2001 22:31:00;CIDADAO COMUM;S;0;CALAFATE;BH;607050.85;796279.60;2318
-2320;2001095797;B03000;AMEACA;RUA SAO TOMAS DE;609;63782;18/2/2001 22:57:00;CIDADAO COMUM;N;0;MORRO DO PAPAGAI;BH;610837.70;793388.15;2319
-2321;2001095831;B03000;AMEACA;RUA STO ANTONIO;233;61759;18/2/2001 23:11:00;POLICIAL MILITAR;N;;SAO TOMAZ;BH;609990.56;805531.55;2320
-2322;2001095866;B03000;AMEACA;RUA CALDAS DA RA;805;61100;18/2/2001 23:29:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609644.68;802276.32;2321
-2323;2001095872;B04001;HOMICIDIO TENTAD;RUA JOAQUIM ANAC;23;118932;18/2/2001 23:32:00;CIDADAO COMUM;S;0;TEIXEIRA DIAS;BH;603052.88;789295.61;2322
-2324;2001095883;B06000;LESAO CORPORAL;AV DJALMA VIEIRA;764;53410;18/2/2001 23:40:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600529.64;787199.48;2323
-2325;2001095901;B03000;AMEACA;RUA AMERICO MAGA;560;3314;18/2/2001 23:48:00;CIDADAO COMUM;S;0;BARREIRO;BH;602218.78;790571.99;2324
-2326;2001095907;B06000;LESAO CORPORAL;RUA DOUTOR BENED;473;12252;18/2/2001 23:50:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;612581.15;803808.71;2325
-2327;2001095922;B06000;LESAO CORPORAL;RUA ANTONIO TEIX;715;119037;19/2/2001 00:01:00;CIDADAO COMUM;S;AP202;TEIXEIRA DIAS;BH;602289.75;790401.66;2326
-2328;2001095946;B04001;HOMICIDIO TENTAD;RUA ICO;126;34020;19/2/2001 00:21:00;CIDADAO COMUM;N;0;SAUDADE;BH;615030.21;797547.97;2327
-2329;2001095954;B06000;LESAO CORPORAL;RUA AGUIA;265;104625;19/2/2001 00:25:00;CIDADAO COMUM;S;;GOIANIA;BH;615619.21;803362.78;2328
-2330;2001095955;B03000;AMEACA;AV WALDOMIRO LOB;1500;66548;19/2/2001 00:26:00;CIDADAO COMUM;N;;GUARANI;BH;612111.73;805291.94;2329
-2331;2001096017;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;1368;31400;19/2/2001 01:05:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609964.47;797064.77;2330
-2332;2001096038;B03000;AMEACA;RUA LIGNITO;36;41050;19/2/2001 01:18:00;CIDADAO COMUM;S;AP 202;SANTA EFIGENIA;BH;613978.82;796630.25;2331
-2333;2001096442;B03000;AMEACA;RUA MODESTINO GO;119;84430;19/2/2001 09:48:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614906.32;800737.33;2332
-2334;2001096450;B06000;LESAO CORPORAL;AV SARAMENHA;170;64007;19/2/2001 09:57:00;CIDADAO COMUM;S;;FLORAMAR;BH;611924.76;805561.32;2333
-2335;2001096544;B06000;LESAO CORPORAL;RUA OSCAR LOBO P;27;104480;19/2/2001 11:02:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612321.28;803479.45;2334
-2336;2001096593;B06000;LESAO CORPORAL;RUA SAO PAULO;1106;63464;19/2/2001 11:42:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610856.65;796731.49;2335
-2337;2001096634;B03000;AMEACA;RUA PASSA TEMPO;600;52432;19/2/2001 12:15:00;INICIATIVA;S;;CARMO;BH;611611.62;794303.33;2336
-2338;2001096635;B03000;AMEACA;RUA LOURDES;84;108106;19/2/2001 12:17:00;CIDADAO COMUM;N;CA12;SANTA MONICA DO ;BH;605821.64;808586.26;2337
-2339;2001096677;B03000;AMEACA;RUA MARIO SOARES;980;44641;19/2/2001 12:50:00;CIDADAO COMUM;N;A;DOM BOSCO;BH;604460.37;797645.73;2338
-2340;2001096678;B03000;AMEACA;RUA SAO RICARDO;124;83920;19/2/2001 12:52:00;CIDADAO COMUM;N;;PAULO SEXTO;BH;616411.25;806313.89;2339
-2341;2001096679;B06000;LESAO CORPORAL;RUA JOEL SANTANA;50;100205;19/2/2001 12:53:00;CIDADAO COMUM;S;;BRAUNAS;BH;603823.79;804620.90;2340
-2342;2001096737;B03000;AMEACA;RUA ANTONIO LUCI;83;14709;19/2/2001 13:43:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600810.66;787478.72;2341
-2343;2001096750;B08000;VIOLACAO DE DOMI;RUA SANTOS;1639;61910;19/2/2001 13:50:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607707.17;793808.83;2342
-2344;2001097001;B06000;LESAO CORPORAL;RUA LAGOA DA PRA;454;40187;19/2/2001 16:24:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606490.48;794951.41;2343
-2345;2001097013;B03000;AMEACA;RUA SAO CLEMENTE;1258;62197;19/2/2001 16:31:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609535.38;800385.58;2344
-2346;2001097029;B03000;AMEACA;RUA TEBAS;820;67090;19/2/2001 16:45:00;INICIATIVA;N;0;VERA CRUZ;BH;616073.41;798319.09;2345
-2347;2001097050;B06000;LESAO CORPORAL;RUA RADIALISTA M;162;81127;19/2/2001 17:02:00;CIDADAO COMUM;N;;CEU AZUL;BH;604385.56;808571.36;2346
-2348;2001097165;B03000;AMEACA;RUA JAIME SALSE;118;36848;19/2/2001 18:21:00;CIDADAO COMUM;N;0;MAGNESITA;BH;604098.60;793775.56;2347
-2349;2001097191;B06000;LESAO CORPORAL;AV MEIER;570;83857;19/2/2001 18:37:00;INICIATIVA;S;;ZOOLOGICO;BH;603156.99;802837.24;2348
-2350;2001097200;B03000;AMEACA;RUA DA BOLIVIA;758;9884;19/2/2001 18:40:00;CIDADAO COMUM;N;;SION;BH;610943.73;793524.50;2349
-2351;2001097207;B02000;RIXA;RUA NHONHO BROCH;214;47580;19/2/2001 18:45:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;604635.54;792049.77;2350
-2352;2001097218;B03000;AMEACA;RODOVIA MG 20;68;26620;19/2/2001 18:52:00;CIDADAO COMUM;S;0;BELO HORIZONTE (;BH;614262.81;805994.36;2351
-2353;2001097225;B03000;AMEACA;RUA GILBERTO FRE;40;92593;19/2/2001 18:56:00;CIDADAO COMUM;N;0;CHACARAS REUNIDA;BH;605821.94;789605.11;2352
-2354;2001097292;B06000;LESAO CORPORAL;RUA BEGONIA;71;94889;19/2/2001 19:37:00;INICIATIVA;S;0;LINDEIA;BH;599348.67;790354.44;2353
-2355;2001097302;B06000;LESAO CORPORAL;RUA CECILIA MARI;132;78759;19/2/2001 19:50:00;CIDADAO COMUM;S;0;CH JATOBA IV;BH;600506.19;787792.37;2354
-2356;2001097305;B06000;LESAO CORPORAL;RUA CINCO;25;27128;19/2/2001 19:52:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616801.10;806900.75;2355
-2357;2001097357;B03000;AMEACA;RUA DOM LUCIO AN;411;22382;19/2/2001 20:31:00;CIDADAO COMUM;S;AP502;CORACAO EUCARIST;BH;605812.96;796643.35;2356
-2358;2001097370;B03000;AMEACA;RUA FILEMON MATO;121;91824;19/2/2001 20:39:00;INICIATIVA;S;0;LINDEIA;BH;599659.84;791195.04;2357
-2359;2001097451;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;1472;6731;19/2/2001 21:34:00;CIDADAO COMUM;S;PX1454;BARRO PRETO;BH;609889.16;796941.60;2358
-2360;2001097482;B03000;AMEACA;RUA ERNESTO TOGN;22;129850;19/2/2001 22:01:00;CIDADAO COMUM;S;0;GORDURAS;BH;616254.09;803812.57;2359
-2361;2001097533;B03000;AMEACA;RUA BARROQUINHA;50;170498;19/2/2001 22:51:00;CIDADAO COMUM;N;AN2;CABANA;BH;604310.01;794399.73;2360
-2362;2001097539;B04001;HOMICIDIO TENTAD;RUA DEZ;84;108538;19/2/2001 22:56:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;604982.91;791211.23;2361
-2363;2001097639;B03000;AMEACA;RUA DOUTOR CAMIL;17;23228;20/2/2001 00:17:00;CIDADAO COMUM;S;PX17;SAO LUCAS;BH;613282.55;795474.81;2362
-2364;2001097640;B03000;AMEACA;RUA MARECHAL HEN;75;38351;20/2/2001 00:18:00;CIDADAO COMUM;N;;TUPI;BH;612646.28;806452.90;2363
-2365;2001097819;B03000;AMEACA;RUA REMI PEREIRA;120;96727;20/2/2001 06:27:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;614954.59;806157.68;2364
-2366;2001097842;B03000;AMEACA;RUA CABEDELO;18;82016;20/2/2001 06:57:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614170.46;804650.36;2365
-2367;2001097945;B03000;AMEACA;RUA PONTA GROSSA;892;14900;20/2/2001 08:13:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604828.64;790426.10;2366
-2368;2001098267;B03000;AMEACA;RUA ANGOLA;28;4001;20/2/2001 12:18:00;CIDADAO COMUM;S;;SAO PAULO;BH;612347.81;802847.99;2367
-2369;2001098314;B03000;AMEACA;RUA JAIR AFONSO ;11;53104;20/2/2001 12:57:00;CIDADAO COMUM;N;;PIRATININGA;BH;606718.57;809902.65;2368
-2370;2001098373;B03000;AMEACA;RUA BONFIM DE AB;23;10102;20/2/2001 13:50:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610768.91;802546.50;2369
-2371;2001098400;B04001;HOMICIDIO TENTAD;RUA MARTA GONCAL;139;102847;20/2/2001 14:08:00;POLICIAL MILITAR;N;0;CH DA LAGOA;BH;604899.39;802953.25;2370
-2372;2001098481;B06000;LESAO CORPORAL;RUA JOAO GOMIDE ;193;68921;20/2/2001 15:03:00;CIDADAO COMUM;N;;COQUEIROS;BH;602301.00;798690.19;2371
-2373;2001098536;B03000;AMEACA;AV DOM PEDRO II;1426;53145;20/2/2001 15:35:00;CIDADAO COMUM;N;;BONFIM;BH;609360.60;798114.20;2372
-2374;2001098539;B03000;AMEACA;RUA RADIALISTA J;45;99031;20/2/2001 15:36:00;INICIATIVA;S;0;CEU AZUL;BH;604501.89;808357.72;2373
-2375;2001098547;B03000;AMEACA;RUA J;329;47350;20/2/2001 15:41:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601281.34;788532.74;2374
-2376;2001098696;B03000;AMEACA;RUA URCA;800;71040;20/2/2001 16:59:00;CIDADAO COMUM;N;;SARANDI (URCA/BH;BH;602998.93;802378.25;2375
-2377;2001098874;B03000;AMEACA;AV ABILIO MACHAD;1054;634;20/2/2001 18:34:00;CIDADAO COMUM;S;;CONJUNTO ALIPIO ;BH;604787.27;798591.50;2376
-2378;2001098894;B04002;HOMICIDIO CONSUM;RUA RAIMUNDO TIN;150;301229;20/2/2001 18:45:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610732.45;793209.20;2377
-2379;2001099048;B03000;AMEACA;RUA JOAQUIM RAMO;326;38175;20/2/2001 20:20:00;CIDADAO COMUM;S;;PARAISO;BH;614858.19;796846.14;2378
-2380;2001099086;B03000;AMEACA;RUA BARAO DE CAM;188;7850;20/2/2001 20:43:00;CIDADAO COMUM;S;;SAO JOSE;BH;605155.86;798480.70;2379
-2381;2001099109;B03000;AMEACA;AV MARIA CONCEIC;1075;32052;20/2/2001 20:58:00;CIDADAO COMUM;S;CAFU;GOIANIA;BH;615361.70;803442.89;2380
-2382;2001099173;B03000;AMEACA;AV DOUTOR CRISTI;2152;62459;20/2/2001 21:38:00;CIDADAO COMUM;S;;ITAPOA;BH;609739.69;806030.28;2381
-2383;2001099274;B06000;LESAO CORPORAL;RUA LUPERCIO PAI;50;57335;20/2/2001 22:40:00;INICIATIVA;N;0;TIROL;BH;599917.53;789181.52;2382
-2384;2001099286;B03000;AMEACA;RUA DONA SINVALI;435;59863;20/2/2001 22:48:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615490.44;807265.68;2383
-2385;2001099327;B03000;AMEACA;RUA JOAO PAULO I;65;300458;20/2/2001 23:10:00;CIDADAO COMUM;N;;SAO DOMINGOS;BH;607677.28;793509.05;2384
-2386;2001099335;B06000;LESAO CORPORAL;RUA RADIALISTA C;25;57348;20/2/2001 23:15:00;INICIATIVA;N;0;CEU AZUL;BH;604520.56;807229.82;2385
-2387;2001099387;B03000;AMEACA;RUA JACOB MARRA ;53;119847;20/2/2001 23:49:00;CIDADAO COMUM;S;AP103;SERRA VERDE;BH;609498.28;810533.01;2386
-2388;2001099418;B04001;HOMICIDIO TENTAD;RUA RAMIRO SIQUE;95;128858;21/2/2001 00:08:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617771.12;797214.62;2387
-2389;2001099453;B03000;AMEACA;RUA JOAQUIM GOUV;12;1422;21/2/2001 00:43:00;CIDADAO COMUM;S;0;SAO PAULO;BH;612535.79;802867.60;2388
-2390;2001099486;B06000;LESAO CORPORAL;RUA CELIO DINIZ;215;111656;21/2/2001 01:11:00;CIDADAO COMUM;S;0;RIO BRANCO;BH;606714.88;808783.28;2389
-2391;2001099659;B03000;AMEACA;RUA CABEDELO;70;82016;21/2/2001 06:42:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614177.56;804723.53;2390
-2392;2001099661;B03000;AMEACA;RUA UBA;313;70149;21/2/2001 06:44:00;CIDADAO COMUM;S;APT214;FLORESTA;BH;611232.61;798155.29;2391
-2393;2001099688;B06000;LESAO CORPORAL;AV CRISTIANO MAC;4000;18652;21/2/2001 07:13:00;INICIATIVA;N;0;PALMARES;BH;612434.91;802092.92;2392
-2394;2001099706;B04001;HOMICIDIO TENTAD;RUA SANTA CRUZ;5;23360;21/2/2001 07:25:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617658.23;797386.88;2393
-2395;2001099720;B03000;AMEACA;RUA MUNHOZ;578;13573;21/2/2001 07:36:00;CIDADAO COMUM;N;AP202;SANTA ROSA;BH;610348.81;803561.40;2394
-2396;2001099721;B06000;LESAO CORPORAL;RUA DOS GUARANIS;6;32181;21/2/2001 07:37:00;INICIATIVA;S;0;CENTRO BH;BH;610799.21;797579.92;2395
-2397;2001099846;B03000;AMEACA;RUA HERCULANO MO;105;37967;21/2/2001 09:00:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605544.73;793496.43;2396
-2398;2001099870;B03000;AMEACA;PRACA DUQUE DE C;15;24145;21/2/2001 09:19:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;613412.06;797495.79;2397
-2399;2001099926;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;1663;40770;21/2/2001 09:57:00;INICIATIVA;S;0;VERA CRUZ;BH;616032.33;798192.27;2398
-2400;2001099942;B03000;AMEACA;RUA REYNALDO SMI;104;111177;21/2/2001 10:06:00;CIDADAO COMUM;S;APTO 201;SANTA AMELIA;BH;606951.74;805850.94;2399
-2401;2001099998;B03000;AMEACA;RUA JOSE DE LIMA;52;38897;21/2/2001 10:49:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611909.78;805737.84;2400
-2402;2001100060;B06000;LESAO CORPORAL;RUA FERNAO DIAS;923;28133;21/2/2001 11:49:00;INICIATIVA;N;0;CAETANO FURQUIM;BH;616127.28;798063.59;2401
-2403;2001100061;B06000;LESAO CORPORAL;AV PRESIDENTE AN;2747;4461;21/2/2001 11:49:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;609898.08;800576.10;2402
-2404;2001100130;B06000;LESAO CORPORAL;AV FRANCISCO DES;364;29400;21/2/2001 12:47:00;INICIATIVA;S;0;ANCHIETA;BH;612071.32;794111.30;2403
-2405;2001100180;B03000;AMEACA;AV SEBASTIAO DE ;97;116101;21/2/2001 13:27:00;CIDADAO COMUM;S;0;DONA CLARA;BH;610312.62;803707.12;2404
-2406;2001100259;B03000;AMEACA;RUA VINTE E TRES;71;101730;21/2/2001 14:33:00;CIDADAO COMUM;N;;SAO MARCOS;BH;614482.87;802741.97;2405
-2407;2001100349;B02000;RIXA;RUA DOS COMERCIA;187;101251;21/2/2001 15:34:00;CIDADAO COMUM;N;0;CONJUNTO ALIPIO ;BH;604650.57;799721.85;2406
-2408;2001100382;B06000;LESAO CORPORAL;RUA GUAICURUS;547;32009;21/2/2001 15:53:00;INICIATIVA;N;0;CENTRO (BH);BH;611125.89;797629.28;2407
-2409;2001100404;B06000;LESAO CORPORAL;RUA DOS CAETES;920;11376;21/2/2001 16:12:00;INICIATIVA;S;0;CENTRO BH;BH;610732.50;797574.81;2408
-2410;2001100413;B03000;AMEACA;RUA DONA CONCEIC;365;16528;21/2/2001 16:14:00;CIDADAO COMUM;S;;JARDIM FLORENCIA;BH;604771.69;810125.01;2409
-2411;2001100497;B04001;HOMICIDIO TENTAD;RUA UM;29;302808;21/2/2001 16:59:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614345.23;805792.20;2410
-2412;2001100543;B03000;AMEACA;RUA DA OLARIA;388;18640;21/2/2001 17:18:00;CIDADAO COMUM;S;;OLARIA;BH;601188.13;789175.19;2411
-2413;2001100583;B03000;AMEACA;RUA OITO;491;117287;21/2/2001 17:34:00;CIDADAO COMUM;S;CAA;LINDEIA;BH;599818.67;790753.26;2412
-2414;2001100600;B04001;HOMICIDIO TENTAD;RUA BEZERRA DE M;99;9525;21/2/2001 17:39:00;INICIATIVA;N;0;NAZARE;BH;615471.18;804578.13;2413
-2415;2001100669;B03000;AMEACA;RUA CURITIBA;914;19090;21/2/2001 18:14:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610779.71;797017.51;2414
-2416;2001100684;B03000;AMEACA;AV BALEARES;319;89333;21/2/2001 18:23:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;608067.53;809872.95;2415
-2417;2001100700;B06000;LESAO CORPORAL;RUA F;62;105278;21/2/2001 18:32:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;614864.40;807874.65;2416
-2418;2001100707;B03000;AMEACA;RUA DES BRAULIO;1359;19917;21/2/2001 18:35:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616284.49;797815.10;2417
-2419;2001100722;B03000;AMEACA;RUA MONTE BRANCO;470;46417;21/2/2001 18:51:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606655.16;795731.00;2418
-2420;2001100750;B03000;AMEACA;PRACA SAO VICENT;60;63902;21/2/2001 19:04:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605439.94;797844.56;2419
-2421;2001100778;B03000;AMEACA;AV CARANDAI;219;13081;21/2/2001 19:18:00;INICIATIVA;S;0;FUNCIONARIOS;BH;612589.23;796026.58;2420
-2422;2001100783;B03000;AMEACA;AV ARTUR BERNARD;2848;60844;21/2/2001 19:20:00;INICIATIVA;S;0;VILA PARIS;BH;610410.67;793282.74;2421
-2423;2001100826;B04002;HOMICIDIO CONSUM;RUA MALVA;10;115760;21/2/2001 19:45:00;INICIATIVA;S;0;HAVAI;BH;607288.35;793433.20;2422
-2424;2001100881;B03000;AMEACA;RUA AMUR;48;3497;21/2/2001 20:14:00;CIDADAO COMUM;S;0;CH BETANIA;BH;605011.02;792353.02;2423
-2425;2001100901;B03000;AMEACA;AV PRESIDENTE AN;7920;4461;21/2/2001 20:23:00;CIDADAO COMUM;S;0;SAO LUIZ;BH;608635.14;804693.17;2424
-2426;2001100941;B03000;AMEACA;RUA PADRE EUSTAQ;2401;51294;21/2/2001 20:50:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;607335.24;797620.70;2425
-2427;2001100943;B04001;HOMICIDIO TENTAD;RUA VINTE E DOIS;23;118702;21/2/2001 20:51:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604092.74;807628.21;2426
-2428;2001100968;B03000;AMEACA;RUA ARACA;52;5262;21/2/2001 21:07:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;609876.75;799484.37;2427
-2429;2001101001;B06000;LESAO CORPORAL;RUA DOMINGOS ROC;343;22631;21/2/2001 21:32:00;CIDADAO COMUM;S;CAD;SALGADO FILHO;BH;606524.25;795445.27;2428
-2430;2001101004;B03000;AMEACA;RUA RADIALISTA O;122;103446;21/2/2001 21:32:00;CIDADAO COMUM;S;CSB;CEU AZUL;BH;604457.63;808510.55;2429
-2431;2001101041;B03000;AMEACA;RUA FREDERICO BR;300;51080;21/2/2001 21:57:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608056.63;797436.64;2430
-2432;2001101211;B03000;AMEACA;RUA JACUTINGA;90;36750;21/2/2001 23:44:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606244.30;797617.34;2431
-2433;2001101246;B04001;HOMICIDIO TENTAD;AV FREI ANDREONI;609;75533;22/2/2001 00:05:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606840.37;793987.35;2432
-2434;2001101267;B06000;LESAO CORPORAL;RUA LISBOA;598;41252;22/2/2001 00:18:00;CIDADAO COMUM;N;0;COPACABANA;BH;606187.97;806472.44;2433
-2435;2001101290;B06000;LESAO CORPORAL;RUA W QUATRO;514;122634;22/2/2001 00:35:00;CIDADAO COMUM;S;;PONGELUPE;BH;603929.62;787324.64;2434
-2436;2001101310;B03000;AMEACA;RUA ALCEU AMOROS;73;102024;22/2/2001 00:54:00;CIDADAO COMUM;N;;MINEIRAO;BH;601744.06;785344.75;2435
-2437;2001101452;B06000;LESAO CORPORAL;RUA PINTOR AUGUS;285;128091;22/2/2001 04:24:00;CIDADAO COMUM;N;;TUPI;BH;613297.04;805806.56;2436
-2438;2001101460;B02000;RIXA;AV OLEGARIO MACI;579;49699;22/2/2001 04:48:00;INICIATIVA;N;VAGA LUME CENTER;CENTRO BH;BH;610560.87;797092.76;2437
-2439;2001101499;B03000;AMEACA;BECO LORENCO SIL;260;302105;22/2/2001 05:55:00;CIDADAO COMUM;N;0;JARDIM LEBLON;BH;605709.69;807233.04;2438
-2440;2001101671;B03000;AMEACA;RUA DOUTOR ANTON;60;23130;22/2/2001 08:49:00;CIDADAO COMUM;S;0;SAO CRISTOVAO;BH;610229.36;799732.11;2439
-2441;2001101860;B03000;AMEACA;RUA JURUA;955;39799;22/2/2001 10:40:00;CIDADAO COMUM;N;0;DA GRACA;BH;612096.46;799861.01;2440
-2442;2001101898;B03000;AMEACA;RUA TEBAS;253;67090;22/2/2001 11:07:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615547.45;798229.16;2441
-2443;2001101930;B06000;LESAO CORPORAL;RUA SAO PAULO;249;63464;22/2/2001 11:31:00;CIDADAO COMUM;N;SALA 308;CENTRO (BH);BH;611100.20;797529.33;2442
-2444;2001101935;B03000;AMEACA;AV STA ROSA;166;61301;22/2/2001 11:34:00;CIDADAO COMUM;S;0;SAO LUIZ;BH;608988.02;804670.34;2443
-2445;2001102015;B06000;LESAO CORPORAL;RUA BURI;51;10764;22/2/2001 12:27:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;610328.10;801370.73;2444
-2446;2001102059;B03000;AMEACA;RUA POUSO ALEGRE;1314;54932;22/2/2001 13:04:00;CIDADAO COMUM;S;;FLORESTA;BH;612350.46;797901.33;2445
-2447;2001102067;B06000;LESAO CORPORAL;RUA AMELIA NAVES;62;91345;22/2/2001 13:13:00;CIDADAO COMUM;S;;PALMEIRAS;BH;606759.30;791240.11;2446
-2448;2001102218;B03000;AMEACA;RUA CAICARA;1381;11451;22/2/2001 14:58:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;616106.59;799365.14;2447
-2449;2001102250;B06000;LESAO CORPORAL;AV SILVIANO BRAN;652;66002;22/2/2001 15:18:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612067.13;798452.85;2448
-2450;2001102414;B03000;AMEACA;RUA JOSE GONCALV;99;38828;22/2/2001 16:36:00;CIDADAO COMUM;N;;BARREIRO;BH;602247.62;791245.80;2449
-2451;2001102436;B03000;AMEACA;AV DOM PEDRO I;1680;48337;22/2/2001 16:48:00;CIDADAO COMUM;S;;ITAPOA;BH;608647.29;806767.29;2450
-2452;2001102504;B06000;LESAO CORPORAL;RUA ESPINOSA;183;26024;22/2/2001 17:32:00;CIDADAO COMUM;N;;SANTO ANDRE;BH;609102.22;798462.10;2451
-2453;2001102675;B03000;AMEACA;RUA JULIO DE CAS;1227;39470;22/2/2001 19:08:00;INICIATIVA;S;0;CINQUENTENARIO;BH;606610.98;792052.30;2452
-2454;2001102682;B03000;AMEACA;RUA ARTUR ALVIM;265;6110;22/2/2001 19:12:00;CIDADAO COMUM;S;;INSTITUTO AGRONO;BH;613624.18;798721.80;2453
-2455;2001102701;B06000;LESAO CORPORAL;RUA MARIA BEATRI;1038;43881;22/2/2001 19:29:00;CIDADAO COMUM;N;;HAVAI;BH;607183.31;792946.88;2454
-2456;2001102705;B03000;AMEACA;RUA CONDOR;253;16773;22/2/2001 19:31:00;CIDADAO COMUM;N;CAB;NOVA CINTRA;BH;605677.65;793973.38;2455
-2457;2001102769;B03000;AMEACA;RUA CONDE DE PAL;200;16685;22/2/2001 20:02:00;CIDADAO COMUM;S;AP103;CABANA;BH;604461.38;793915.85;2456
-2458;2001102795;B03000;AMEACA;RUA DOUTOR CRIST;185;55598;22/2/2001 20:23:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604650.82;789126.07;2457
-2459;2001102845;B03000;AMEACA;RUA MARIA AMELIA;721;43812;22/2/2001 21:03:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610257.12;805510.06;2458
-2460;2001102872;B04001;HOMICIDIO TENTAD;BECO HELIOTERIO;100;170863;22/2/2001 21:22:00;INICIATIVA;S;0;LEONINA;BH;608285.06;793705.32;2459
-2461;2001102887;B03000;AMEACA;RUA SAO PEDRO;51;96046;22/2/2001 21:32:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614466.68;803349.59;2460
-2462;2001102946;B04001;HOMICIDIO TENTAD;RUA DOS FRANCISC;50;62723;22/2/2001 22:21:00;CIDADAO COMUM;N;CA1;PLANALTO;BH;610878.58;805675.14;2461
-2463;2001102961;B06000;LESAO CORPORAL;RUA SAO PAULO;78;63464;22/2/2001 22:27:00;INICIATIVA;N;0;CENTRO BH;BH;611107.57;797698.12;2462
-2464;2001102980;B06000;LESAO CORPORAL;RUA MARIA ROSA D;719;107800;22/2/2001 22:42:00;INICIATIVA;N;0;MANTIQUEIRA;BH;606463.33;811640.07;2463
-2465;2001103016;B06000;LESAO CORPORAL;AV BRIGADEIRO ED;980;2860;22/2/2001 22:59:00;CIDADAO COMUM;S;0;GLORIA;BH;604325.87;798595.64;2464
-2466;2001103020;B06000;LESAO CORPORAL;AV MEM DE SA;1310;45395;22/2/2001 23:09:00;CIDADAO COMUM;N;0;PARAISO;BH;614204.17;796304.90;2465
-2467;2001103029;B06000;LESAO CORPORAL;RUA AMERICO SCOT;63;3342;22/2/2001 23:12:00;CIDADAO COMUM;N;;SERRA;BH;612649.72;795554.59;2466
-2468;2001103096;B04002;HOMICIDIO CONSUM;AV RAJA GABAGLIA;2222;57830;22/2/2001 23:57:00;INICIATIVA;S;0;ESTORIL;BH;608853.99;793279.32;2467
-2469;2001103238;B03000;AMEACA;RUA CUIABA;1243;81269;23/2/2001 01:19:00;CIDADAO COMUM;S;AP401;BARROCA;BH;607852.76;795971.31;2468
-2470;2001103353;B03000;AMEACA;RUA MANOEL COUTO;560;43056;23/2/2001 03:23:00;CIDADAO COMUM;S;;CIDADE JARDIM;BH;609733.64;794645.46;2469
-2471;2001103382;B04002;HOMICIDIO CONSUM;PRACA BERNARDO D;50;9424;23/2/2001 03:54:00;CIDADAO COMUM;N;0;ERMELINDA;BH;609134.84;801050.78;2470
-2472;2001103393;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;4000;18652;23/2/2001 03:58:00;INICIATIVA;S;0;DOS PALMARES;BH;612434.91;802092.92;2471
-2473;2001103394;B03000;AMEACA;RUA MARFIM;734;50207;23/2/2001 04:03:00;CIDADAO COMUM;S;;COQUEIROS;BH;602183.65;798513.40;2472
-2474;2001103445;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;322;51657;23/2/2001 05:10:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;609650.08;808286.90;2473
-2475;2001103487;B06000;LESAO CORPORAL;AV OLEGARIO MACI;657;49699;23/2/2001 05:59:00;POLICIAL MILITAR;N;0;CENTRO (BH);BH;610536.33;797017.45;2474
-2476;2001103551;B06000;LESAO CORPORAL;RUA CAETES;16;31208;23/2/2001 07:13:00;CIDADAO COMUM;S;;CONJ HAB JARDIM ;BH;603845.30;798142.06;2475
-2477;2001103582;B03000;AMEACA;RUA SANTA CRUZ;140;23360;23/2/2001 07:35:00;CIDADAO COMUM;N;0;TAQUARIL;BH;617675.20;797420.56;2476
-2478;2001103607;B04001;HOMICIDIO TENTAD;RUA TEBAS;267;67090;23/2/2001 07:49:00;INICIATIVA;N;0;VERA CRUZ;BH;615547.45;798229.16;2477
-2479;2001103731;B03000;AMEACA;RUA ANITA BLUMBE;19;38815;23/2/2001 08:53:00;CIDADAO COMUM;S;;BANDEIRANTES;BH;606031.12;802912.13;2478
-2480;2001103762;B03000;AMEACA;RUA DOS GUARANIS;100;32181;23/2/2001 09:12:00;INICIATIVA;N;0;CENTRO (BH);BH;610735.90;797543.55;2479
-2481;2001103903;B03000;AMEACA;RUA JORNALISTA M;97;20488;23/2/2001 10:41:00;CIDADAO COMUM;N;0;ANTONIO RIBEIRO ;BH;615929.10;806739.07;2480
-2482;2001104110;B03000;AMEACA;RUA PADRE JULIO ;1070;51496;23/2/2001 13:10:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615893.98;797514.95;2481
-2483;2001104345;B03000;AMEACA;AV BRASIL;723;10420;23/2/2001 15:36:00;CIDADAO COMUM;S;AP1404;SANTA EFIGENIA;BH;612425.27;796268.81;2482
-2484;2001104401;B02000;RIXA;RUA SEBASTIAO FE;170;29063;23/2/2001 16:33:00;CIDADAO COMUM;N;0;CALIFORNIA;BH;603429.75;796223.66;2483
-2485;2001104402;B06000;LESAO CORPORAL;RUA DIVA;180;109950;23/2/2001 16:34:00;CIDADAO COMUM;S;0;SANTA MONICA DO ;BH;606025.20;808435.76;2484
-2486;2001104404;B06000;LESAO CORPORAL;RUA NARCISA PERE;325;78720;23/2/2001 16:34:00;INICIATIVA;N;0;CH JATOBA IV;BH;600341.04;787842.12;2485
-2487;2001104406;B06000;LESAO CORPORAL;RUA BIMBARRA;350;9641;23/2/2001 16:34:00;CIDADAO COMUM;S;;CALAFATE;BH;607195.50;796594.64;2486
-2488;2001104409;B03000;AMEACA;RUA SAO MANOEL;197;63335;23/2/2001 16:35:00;CIDADAO COMUM;S;0;FLORESTA;BH;611949.84;798441.30;2487
-2489;2001104410;B03000;AMEACA;RUA JOAQUIM DE F;1313;38033;23/2/2001 16:35:00;CIDADAO COMUM;S;;SANTA HELENA (BH;BH;603050.87;790075.16;2488
-2490;2001104431;B04001;HOMICIDIO TENTAD;RUA LUIZ LOPES;232;94431;23/2/2001 16:40:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606295.93;801150.74;2489
-2491;2001104600;B06000;LESAO CORPORAL;RUA SENHORA DO P;2842;62231;23/2/2001 17:54:00;CIDADAO COMUM;N;;CINQUENTENARIO;BH;606406.64;790677.98;2490
-2492;2001104609;B06000;LESAO CORPORAL;RUA PAULO KRUGER;204;55910;23/2/2001 18:01:00;CIDADAO COMUM;S;;FLORAMAR;BH;611701.18;806916.68;2491
-2493;2001104889;B06000;LESAO CORPORAL;RUA CONCEICAO CH;117;20387;23/2/2001 20:23:00;CIDADAO COMUM;S;0;SAO JOAO BATISTA;BH;608745.78;808046.24;2492
-2494;2001104903;B06000;LESAO CORPORAL;AV PARANA;523;52230;23/2/2001 20:34:00;INICIATIVA;N;0;CENTRO (BH);BH;610725.40;796994.57;2493
-2495;2001104918;B03000;AMEACA;RUA G;50;47435;23/2/2001 20:39:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601086.93;788642.82;2494
-2496;2001105009;B03000;AMEACA;AV PRESIDENTE AN;4040;4461;23/2/2001 21:22:00;INICIATIVA;N;0;SAO FRANCISCO;BH;609574.90;802239.54;2495
-2497;2001105146;B06000;LESAO CORPORAL;RUA SAO PAULO;271;63464;23/2/2001 22:37:00;INICIATIVA;S;VP7782;CENTRO (BH);BH;611088.90;797498.96;2496
-2498;2001105154;B06000;LESAO CORPORAL;RUA MENDES;99;26963;23/2/2001 22:41:00;INICIATIVA;N;0;PIRAJA;BH;613234.27;802879.31;2497
-2499;2001105165;B06000;LESAO CORPORAL;AV SARAMENHA;1072;64007;23/2/2001 22:47:00;INICIATIVA;S;0;GUARANI;BH;612916.89;805724.57;2498
-2500;2001105214;B03000;AMEACA;RUA CORONEL ALVA;25;17520;23/2/2001 23:25:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611475.38;806507.14;2499
-2501;2001105223;B03000;AMEACA;RUA DESEMBARGADO;1456;94891;23/2/2001 23:27:00;CIDADAO COMUM;S;;ENGENHO NOGUEIRA;BH;606512.31;801019.24;2500
-2502;2001105264;B06000;LESAO CORPORAL;AV GUARAPARI;1234;20711;23/2/2001 23:54:00;CIDADAO COMUM;S;0;JARDIM ATLANTICO;BH;607413.32;806390.79;2501
-2503;2001105265;B04001;HOMICIDIO TENTAD;RUA RAIMUNDO TIN;65;301229;23/2/2001 23:57:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610757.06;793273.56;2502
-2504;2001105279;B06000;LESAO CORPORAL;RUA AMARANTO VER;62;110120;24/2/2001 00:01:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;615845.03;805907.88;2503
-2505;2001105293;B03000;AMEACA;RUA PIRATININGA;20;54210;24/2/2001 00:08:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;609977.00;797713.87;2504
-2506;2001105310;B03000;AMEACA;RUA CONSELHEIRO ;15;17095;24/2/2001 00:23:00;CIDADAO COMUM;S;;CENTRO (BH);BH;612543.94;797025.95;2505
-2507;2001105406;B04001;HOMICIDIO TENTAD;AV JOSE RACHEL D;397;85912;24/2/2001 01:15:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616985.36;804671.06;2506
-2508;2001105422;B06000;LESAO CORPORAL;RUA PITT;187;54380;24/2/2001 01:25:00;CIDADAO COMUM;S;;UNIAO;BH;612621.52;801125.76;2507
-2509;2001105450;B03000;AMEACA;RUA BENJAMIN FLO;60;9162;24/2/2001 01:43:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606255.12;793325.23;2508
-2510;2001105465;B03000;AMEACA;RUA MATIAS AIRES;296;34032;24/2/2001 01:51:00;CIDADAO COMUM;S;;VILA MARAVILHAS;BH;603072.43;795117.27;2509
-2511;2001105473;B03000;AMEACA;AV FRANCISCO SA;830;29656;24/2/2001 01:58:00;CIDADAO COMUM;S;0;GUTIERREZ;BH;608886.90;796021.80;2510
-2512;2001105503;B04001;HOMICIDIO TENTAD;RUA PROFESSOR CA;240;89853;24/2/2001 02:22:00;CIDADAO COMUM;N;;PALMEIRAS;BH;606944.81;791601.05;2511
-2513;2001105518;B06000;LESAO CORPORAL;RUA DOS CAETES;499;11376;24/2/2001 02:32:00;INICIATIVA;N;0;CENTRO BH;BH;611125.13;797436.34;2512
-2514;2001105526;B03000;AMEACA;RUA TIRADENTES;26;85607;24/2/2001 02:36:00;CIDADAO COMUM;S;0;ALVORADA;BH;615497.04;802314.39;2513
-2515;2001105568;B03000;AMEACA;RUA ANDIROBA;30;102935;24/2/2001 03:08:00;INICIATIVA;N;0;SAO PAULO;BH;612437.66;803008.77;2514
-2516;2001105649;B05000;SEQUESTRO E CARC;RUA JOAQUIM RAMO;173;38175;24/2/2001 04:41:00;CIDADAO COMUM;S;0;PARAISO;BH;614826.55;797125.45;2515
-2517;2001105688;B08000;VIOLACAO DE DOMI;RUA SEVERINO LAR;351;57221;24/2/2001 05:16:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609620.22;809012.12;2516
-2518;2001105699;B06000;LESAO CORPORAL;PRACA MODESTINO ;39;46039;24/2/2001 05:35:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604068.02;788748.39;2517
-2519;2001105712;B03000;AMEACA;RUA DAVID FONSEC;380;19696;24/2/2001 06:04:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604476.46;790256.25;2518
-2520;2001105717;B04002;HOMICIDIO CONSUM;RUA ECA DE QUEIR;202;24968;24/2/2001 06:07:00;INICIATIVA;N;0;COPACABANA;BH;606539.78;806907.32;2519
-2521;2001105721;B06000;LESAO CORPORAL;RUA FLOR DE LIMA;64;23810;24/2/2001 06:07:00;CIDADAO COMUM;S;0;PINDORAMA;BH;602279.39;797503.89;2520
-2522;2001105742;B06000;LESAO CORPORAL;RUA ALFREDO ALVE;45;108175;24/2/2001 06:37:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606710.57;811632.81;2521
-2523;2001105763;B06000;LESAO CORPORAL;RUA THIAGO SALLE;26;65012;24/2/2001 07:06:00;CIDADAO COMUM;S;0;JARDIM ESTRELA;BH;607320.11;810230.39;2522
-2524;2001105764;B03000;AMEACA;RUA DOM RAFAEL;5;23026;24/2/2001 07:06:00;INICIATIVA;N;0;TAQUARIL;BH;617052.78;797306.19;2523
-2525;2001105853;B03000;AMEACA;BECO SOL NASCENT;141;301434;24/2/2001 08:10:00;CIDADAO COMUM;S;PX135;CAFEZAL;BH;614209.99;795215.91;2524
-2526;2001105883;B06000;LESAO CORPORAL;RUA OSWALDO BRAG;34;72185;24/2/2001 08:30:00;CIDADAO COMUM;N;;SANTA AMELIA;BH;607351.55;806454.90;2525
-2527;2001105976;B03000;AMEACA;RUA ANTONIO MARZ;347;94520;24/2/2001 09:26:00;CIDADAO COMUM;S;CA347;OURO PRETO;BH;606195.44;800699.90;2526
-2528;2001106002;B03000;AMEACA;RUA AURELIANO LE;107;6832;24/2/2001 09:48:00;CIDADAO COMUM;S;;LIBERDADE;BH;609500.21;803405.43;2527
-2529;2001106210;B03000;AMEACA;RUA AGUANIL;640;1564;24/2/2001 12:20:00;CIDADAO COMUM;S;CAFR;VISTA ALEGRE;BH;605291.18;793463.89;2528
-2530;2001106230;B03000;AMEACA;RUA DAS PERPETUA;12;911;24/2/2001 12:30:00;CIDADAO COMUM;S;;LINDEIA;BH;599704.53;791168.04;2529
-2531;2001106327;B06000;LESAO CORPORAL;RUA OSCAR LOBO P;270;104480;24/2/2001 13:34:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612347.11;803516.89;2530
-2532;2001106334;B03000;AMEACA;RUA APORE;575;5099;24/2/2001 13:39:00;CIDADAO COMUM;N;;PARQUE RIACHUELO;BH;609511.92;800464.70;2531
-2533;2001106408;B06000;LESAO CORPORAL;RUA ROSA DE PEDR;20;124494;24/2/2001 14:25:00;CIDADAO COMUM;S;;ETELVINA CARNEIR;BH;611390.80;809189.08;2532
-2534;2001106409;B06000;LESAO CORPORAL;AV PRESIDENTE AN;4013;4461;24/2/2001 14:26:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609536.57;802154.10;2533
-2535;2001106490;B03000;AMEACA;RUA LUIZ BRANDAO;727;41656;24/2/2001 15:25:00;CIDADAO COMUM;S;;PARAISO;BH;614745.37;796750.21;2534
-2536;2001106523;B03000;AMEACA;RUA JAIR AFONSO ;9;53104;24/2/2001 15:37:00;CIDADAO COMUM;S;;PIRATININGA;BH;606827.32;809921.05;2535
-2537;2001106558;B06000;LESAO CORPORAL;RUA TENENTE VITO;71;67351;24/2/2001 15:59:00;CIDADAO COMUM;N;;SANTA TEREZA;BH;613395.47;797441.30;2536
-2538;2001106561;B03000;AMEACA;RUA ALMADA;174;2393;24/2/2001 16:01:00;CIDADAO COMUM;N;;PINDORAMA;BH;602539.53;797812.24;2537
-2539;2001106594;B03000;AMEACA;AV JOAO XXIII;227;37926;24/2/2001 16:17:00;CIDADAO COMUM;S;0;CONJUNTO ALIPIO ;BH;604398.40;799487.39;2538
-2540;2001106610;B06000;LESAO CORPORAL;RUA CAMPINA VERD;237;12110;24/2/2001 16:25:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;606135.94;794519.08;2539
-2541;2001106615;B03000;AMEACA;RUA KEPLER;173;39990;24/2/2001 16:30:00;CIDADAO COMUM;N;;SANTA LUCIA;BH;609519.93;791702.20;2540
-2542;2001106634;B03000;AMEACA;BECO SOL NASCENT;240;301434;24/2/2001 16:38:00;CIDADAO COMUM;N;0;CAFEZAL;BH;614453.31;795387.14;2541
-2543;2001106669;B06000;LESAO CORPORAL;RUA PIRAMBO;412;54090;24/2/2001 16:56:00;CIDADAO COMUM;S;0;SAO JOAO BATISTA;BH;610666.17;801718.53;2542
-2544;2001106765;B06000;LESAO CORPORAL;RUA PITANGUI;2218;54365;24/2/2001 17:51:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612464.06;798517.38;2543
-2545;2001106790;B06000;LESAO CORPORAL;AV VEREADOR CICE;615;19756;24/2/2001 18:01:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604877.79;796469.45;2544
-2546;2001106795;B03000;AMEACA;RUA SAO TOMAS DE;478;63782;24/2/2001 18:04:00;CIDADAO COMUM;S;PX77;MORRO DO PAPAGAI;BH;610863.39;793538.47;2545
-2547;2001106867;B04001;HOMICIDIO TENTAD;AV VINTE E OITO ;356;72970;24/2/2001 18:46:00;INICIATIVA;N;0;ESPLANADA;BH;614552.43;798837.28;2546
-2548;2001106875;B06000;LESAO CORPORAL;RUA SAO PAULO;100;63464;24/2/2001 18:49:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611108.08;797692.28;2547
-2549;2001106902;B03000;AMEACA;RUA JOSE DE ARAU;508;24725;24/2/2001 19:03:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;607209.92;793937.31;2548
-2550;2001106918;B03000;AMEACA;RUA REAL GRANDEZ;119;58089;24/2/2001 19:11:00;CIDADAO COMUM;S;;NOVO GLORIA;BH;603101.41;798931.25;2549
-2551;2001106943;B06000;LESAO CORPORAL;RUA EPHIGENIA NA;12;98533;24/2/2001 19:26:00;CIDADAO COMUM;S;0;CASTELO;BH;605318.52;799860.30;2550
-2552;2001106960;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;2400;57830;24/2/2001 19:36:00;INICIATIVA;S;0;ESTORIL;BH;609018.00;793117.61;2551
-2553;2001106969;B06000;LESAO CORPORAL;RUA TRINTA E UM;23;95490;24/2/2001 19:38:00;POLICIAL MILITAR;S;0;MARIA GORETTI;BH;614564.25;803088.11;2552
-2554;2001107051;B06000;LESAO CORPORAL;RUA PITANGUI;3225;54365;24/2/2001 20:21:00;INICIATIVA;N;0;CONCORDIA;BH;613314.48;798412.93;2553
-2555;2001107087;B04001;HOMICIDIO TENTAD;RUA OESTE;519;49125;24/2/2001 20:36:00;CIDADAO COMUM;S;;CALAFATE;BH;608042.76;796702.89;2554
-2556;2001107110;B04002;HOMICIDIO CONSUM;RUA RAIMUNDO TIN;129;301229;24/2/2001 20:49:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610720.17;793143.45;2555
-2557;2001107139;B03000;AMEACA;RUA SAO TIAGO;10;21682;24/2/2001 21:02:00;CIDADAO COMUM;S;0;SAO TOMAZ;BH;610320.61;805512.06;2556
-2558;2001107221;B06000;LESAO CORPORAL;RUA PINHAL;90;12108;24/2/2001 21:46:00;CIDADAO COMUM;S;;PIRATININGA;BH;606126.70;809852.49;2557
-2559;2001107259;B03000;AMEACA;RUA MARCELINA FR;117;124655;24/2/2001 22:04:00;CIDADAO COMUM;S;;JAQUELINE;BH;611565.58;810539.70;2558
-2560;2001107267;B06000;LESAO CORPORAL;RUA FAGUNDES VAR;68;27689;24/2/2001 22:08:00;CIDADAO COMUM;S;;LAGOINHA;BH;610273.99;798496.34;2559
-2561;2001107301;B03000;AMEACA;RUA ROSALVO DE M;220;70439;24/2/2001 22:27:00;CIDADAO COMUM;S;A;GOIANIA;BH;615275.20;803488.95;2560
-2562;2001107322;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;320;26052;24/2/2001 22:36:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611297.21;797352.55;2561
-2563;2001107340;B06000;LESAO CORPORAL;RUA FORMIGA;50;29136;24/2/2001 22:48:00;CIDADAO COMUM;S;;LAGOINHA;BH;610336.11;798756.88;2562
-2564;2001107426;B06000;LESAO CORPORAL;AV FURQUIM WERNE;11;650;24/2/2001 23:28:00;INICIATIVA;N;0;SOLIMOES;BH;612945.73;805797.12;2563
-2565;2001107440;B06000;LESAO CORPORAL;RUA PERNAMBUCO;1077;53463;24/2/2001 23:37:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611502.50;795210.22;2564
-2566;2001107453;B04001;HOMICIDIO TENTAD;RUA COPERNICO PI;55;6630;24/2/2001 23:41:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610405.30;793669.43;2565
-2567;2001107490;B03000;AMEACA;RUA PROFESSORA A;313;130479;24/2/2001 23:57:00;CIDADAO COMUM;S;0;OLARIA;BH;601738.06;789041.13;2566
-2568;2001107553;B03000;AMEACA;RUA STA JOSEFINA;885;60803;25/2/2001 00:34:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608456.09;800930.17;2567
-2569;2001107593;B06000;LESAO CORPORAL;RUA EDSON LUIZ M;72;25062;25/2/2001 00:58:00;INICIATIVA;S;0;MARIA GORETTI;BH;614153.98;803689.74;2568
-2570;2001107620;B03000;AMEACA;RUA NATAL;373;47306;25/2/2001 01:10:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609189.92;799371.29;2569
-2571;2001107662;B06000;LESAO CORPORAL;AV FURQUIM WERNE;120;650;25/2/2001 01:32:00;CIDADAO COMUM;S;;TUPI;BH;613071.54;805851.16;2570
-2572;2001107666;B06000;LESAO CORPORAL;RUA CARVALHOS;5;13788;25/2/2001 01:32:00;CIDADAO COMUM;N;;MANGABEIRAS;BH;612030.85;792390.04;2571
-2573;2001107714;B04001;HOMICIDIO TENTAD;RUA JOAQUIM DE P;945;38147;25/2/2001 02:04:00;CIDADAO COMUM;N;CAB;ALIPIO DE MELO;BH;604655.51;799121.62;2572
-2574;2001107730;B06000;LESAO CORPORAL;RUA PARA DE MINA;1186;52070;25/2/2001 02:10:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605500.40;797813.06;2573
-2575;2001107740;B04001;HOMICIDIO TENTAD;RUA NELSON HUNGR;273;46634;25/2/2001 02:15:00;CIDADAO COMUM;S;;TUPI;BH;612567.47;806138.51;2574
-2576;2001107745;B06000;LESAO CORPORAL;AV WALDOMIRO LOB;1665;66548;25/2/2001 02:18:00;INICIATIVA;S;0;GUARANI;BH;611916.93;805178.94;2575
-2577;2001107781;B06000;LESAO CORPORAL;AV JOAQUIM CLEME;18;38018;25/2/2001 02:39:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611922.55;805613.83;2576
-2578;2001107799;B06000;LESAO CORPORAL;RUA CHAFARIZ;119;93568;25/2/2001 02:51:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601522.62;786428.24;2577
-2579;2001107809;B06000;LESAO CORPORAL;RUA OURO PRETO;285;50730;25/2/2001 02:56:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609961.08;797017.98;2578
-2580;2001107892;B04001;HOMICIDIO TENTAD;RUA RAMIRO SIQUE;55;128858;25/2/2001 03:59:00;INICIATIVA;S;0;CASTANHEIRAS (TA;BH;617767.11;797185.33;2579
-2581;2001107955;B06000;LESAO CORPORAL;RODOVIA BR 356;5100;10317;25/2/2001 04:55:00;CIDADAO COMUM;N;;BELVEDERE;BH;610345.89;791069.48;2580
-2582;2001108010;B02000;RIXA;RUA CURITIBA;275;19090;25/2/2001 05:59:00;POLICIAL MILITAR;N;;CENTRO (BH);BH;610963.21;797560.80;2581
-2583;2001108110;B06000;LESAO CORPORAL;RUA OLENKA DIAS ;46;33506;25/2/2001 08:05:00;CIDADAO COMUM;N;;NOVA BARROCA;BH;607432.41;792756.34;2582
-2584;2001108239;B06000;LESAO CORPORAL;AV OLEGARIO MACI;459;49699;25/2/2001 09:32:00;INICIATIVA;S;0;CENTRO BH;BH;610594.57;797209.17;2583
-2585;2001108265;B03000;AMEACA;RUA TRINTA E SEI;201;34310;25/2/2001 09:52:00;CIDADAO COMUM;N;0;CONJUNTO FELICID;BH;612501.14;807529.70;2584
-2586;2001108381;B04001;HOMICIDIO TENTAD;RUA MUNIZ;149;170850;25/2/2001 11:30:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608113.39;793880.88;2585
-2587;2001108404;B04001;HOMICIDIO TENTAD;AV BIAS FORTES;1696;9553;25/2/2001 11:43:00;INICIATIVA;N;0;CENTRO BH;BH;610237.36;797177.50;2586
-2588;2001108413;B03000;AMEACA;AV AMAZONAS;2267;3140;25/2/2001 11:52:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;609538.15;796202.90;2587
-2589;2001108419;B03000;AMEACA;RUA RIBEIRAO DAS;72;46688;25/2/2001 11:57:00;CIDADAO COMUM;N;CSB;PARAISO;BH;614172.67;796041.86;2588
-2590;2001108433;B06000;LESAO CORPORAL;RUA ALEXANDRE SI;205;2135;25/2/2001 12:04:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;605987.96;793132.08;2589
-2591;2001108456;B03000;AMEACA;RUA GERALDO RIBE;49;43680;25/2/2001 12:25:00;CIDADAO COMUM;N;;NOVO GLORIA;BH;603076.41;798841.74;2590
-2592;2001108541;B06000;LESAO CORPORAL;RUA POTENGI;27;61428;25/2/2001 13:43:00;POLICIAL MILITAR;S;;SAO GABRIEL;BH;613898.77;803936.09;2591
-2593;2001108579;B03000;AMEACA;ALAMEDA ALVARO C;100;2816;25/2/2001 14:11:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;612069.23;796731.22;2592
-2594;2001108619;B03000;AMEACA;RUA PADRE PEDRO ;4950;51657;25/2/2001 14:38:00;CIDADAO COMUM;N;APTO.:104 - BLOC;MANTIQUEIRA;BH;606693.60;809984.49;2593
-2595;2001108645;B04002;HOMICIDIO CONSUM;RUA TREZE DE MAI;164;120944;25/2/2001 14:57:00;CIDADAO COMUM;N;;MARIA HELENA;BH;605148.22;810689.31;2594
-2596;2001108653;B06000;LESAO CORPORAL;RUA JOSE ANTENOR;10;16049;25/2/2001 15:03:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612546.74;803795.50;2595
-2597;2001108683;B03000;AMEACA;RUA COSTA RICA;86;68685;25/2/2001 15:21:00;CIDADAO COMUM;N;0;COQUEIROS;BH;602114.03;799090.79;2596
-2598;2001108722;B06000;LESAO CORPORAL;AV BRASIL;1460;10420;25/2/2001 15:49:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611745.06;795947.58;2597
-2599;2001108742;B03000;AMEACA;RUA SERRA NEGRA;1747;65038;25/2/2001 16:01:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;608895.81;799098.28;2598
-2600;2001108773;B06000;LESAO CORPORAL;RUA PASSARELA;83;302328;25/2/2001 16:22:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;606149.87;789752.27;2599
-2601;2001108810;B06000;LESAO CORPORAL;AV PRESIDENTE AN;2957;4461;25/2/2001 16:47:00;INICIATIVA;N;0;PARQUE RIACHUELO;BH;609797.06;800844.62;2600
-2602;2001108832;B06000;LESAO CORPORAL;RUA SAPUCAI;100;63943;25/2/2001 17:03:00;CIDADAO COMUM;N;;FLORESTA;BH;611873.41;797692.97;2601
-2603;2001108861;B03000;AMEACA;RUA EUFRATES;278;26821;25/2/2001 17:23:00;CIDADAO COMUM;N;0;COQUEIROS;BH;603482.30;800034.96;2602
-2604;2001108942;B03000;AMEACA;RUA CINCO;154;302813;25/2/2001 18:16:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614537.55;805974.74;2603
-2605;2001108957;B03000;AMEACA;RUA DONA GENI;92;22874;25/2/2001 18:19:00;CIDADAO COMUM;N;0;JARDIM FLORENCIA;BH;605132.66;810238.28;2604
-2606;2001109034;B04001;HOMICIDIO TENTAD;RUA ARARIBA;255;5540;25/2/2001 19:06:00;CIDADAO COMUM;N;;SAO CRISTOVAO;BH;610179.08;799177.02;2605
-2607;2001109039;B06000;LESAO CORPORAL;RUA ZURICK;640;74092;25/2/2001 19:10:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606662.78;795875.98;2606
-2608;2001109073;B03000;AMEACA;RUA MARANGUAPE;355;43447;25/2/2001 19:27:00;CIDADAO COMUM;S;AP-303;BARROCA;BH;607967.88;796076.63;2607
-2609;2001109075;B06000;LESAO CORPORAL;RUA COPAIBA;10;104801;25/2/2001 19:30:00;CIDADAO COMUM;S;;INDUSTRIAL RODRI;BH;615815.87;808158.86;2608
-2610;2001109107;B03000;AMEACA;AV PARANA;246;52230;25/2/2001 19:42:00;INICIATIVA;N;0;CENTRO (BH);BH;610752.57;797284.29;2609
-2611;2001109129;B06000;LESAO CORPORAL;RUA VERGARA;123;109178;25/2/2001 19:55:00;CIDADAO COMUM;S;;COQUEIROS;BH;602357.56;799632.39;2610
-2612;2001109169;B03000;AMEACA;RUA OFICINAS;153;49140;25/2/2001 20:11:00;CIDADAO COMUM;S;0;ESPLANADA;BH;614750.88;798897.40;2611
-2613;2001109198;B03000;AMEACA;RUA PROFESSORA A;205;22008;25/2/2001 20:26:00;INICIATIVA;S;0;CANDELARIA;BH;608013.33;808737.70;2612
-2614;2001109199;B03000;AMEACA;AV PRESIDENTE AN;7920;4461;25/2/2001 20:28:00;CIDADAO COMUM;S;;SAO LUIZ;BH;608635.14;804693.17;2613
-2615;2001109255;B04001;HOMICIDIO TENTAD;AV SEN LEVINDO C;2270;14866;25/2/2001 20:58:00;CIDADAO COMUM;S;;SANTA CECILIA;BH;600975.64;787380.04;2614
-2616;2001109274;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;2225;57830;25/2/2001 21:04:00;INICIATIVA;N;0;LEONINA;BH;609138.65;793053.24;2615
-2617;2001109340;B03000;AMEACA;RUA VILA RICA;1929;71992;25/2/2001 21:32:00;INICIATIVA;S;401;JARDIM MONTANHES;BH;606729.96;798841.80;2616
-2618;2001109342;B06000;LESAO CORPORAL;RUA FLOR BRANCA;25;28509;25/2/2001 21:32:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;605799.54;799045.82;2617
-2619;2001109345;B06000;LESAO CORPORAL;RUA CLELIA;175;16008;25/2/2001 21:33:00;CIDADAO COMUM;N;;SANTA MONICA;BH;606886.03;807994.52;2618
-2620;2001109365;B06000;LESAO CORPORAL;RUA JOANA DARC;31;170141;25/2/2001 21:48:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614352.14;794982.51;2619
-2621;2001109389;B06000;LESAO CORPORAL;RUA HOFFMAN;630;33320;25/2/2001 22:01:00;CIDADAO COMUM;S;0;SANTA CRUZ (BARR;BH;603165.37;789052.57;2620
-2622;2001109395;B06000;LESAO CORPORAL;RUA VICOSA;816;71910;25/2/2001 22:02:00;CIDADAO COMUM;S;PX342;SANTO ANTONIO;BH;610915.33;793946.00;2621
-2623;2001109432;B06000;LESAO CORPORAL;RUA BARAO DO MON;810;63653;25/2/2001 22:15:00;CIDADAO COMUM;S;;CARDOSO;BH;604036.31;787823.06;2622
-2624;2001109491;B02000;RIXA;RUA DOS AFONSOS;439;1319;25/2/2001 22:51:00;CIDADAO COMUM;S;0;BOA VISTA;BH;616017.53;800220.24;2623
-2625;2001109500;B06000;LESAO CORPORAL;RUA DA FLAGELACA;143;56042;25/2/2001 22:54:00;CIDADAO COMUM;N;0;SAO JOSE;BH;605583.59;798817.24;2624
-2626;2001109536;B03000;AMEACA;AV NEMEN LARA RO;250;104537;25/2/2001 23:17:00;CIDADAO COMUM;S;;SERRA VERDE;BH;609434.17;810322.36;2625
-2627;2001109563;B06000;LESAO CORPORAL;AV PRESIDENTE AN;4013;4461;25/2/2001 23:31:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609536.57;802154.10;2626
-2628;2001109578;B06000;LESAO CORPORAL;RUA FAGUNDES VAR;108;27689;25/2/2001 23:38:00;CIDADAO COMUM;S;;LAGOINHA;BH;610267.48;798536.31;2627
-2629;2001109589;B04001;HOMICIDIO TENTAD;AV ARTUR BERNARD;1200;60844;25/2/2001 23:43:00;POLICIAL MILITAR;S;0;VILA PARIS;BH;610180.14;793263.99;2628
-2630;2001109652;B03000;AMEACA;RUA DOS AFONSOS;156;1319;26/2/2001 00:14:00;CIDADAO COMUM;S;CAB;BOA VISTA;BH;615727.67;800287.75;2629
-2631;2001109693;B06000;LESAO CORPORAL;RUA RIO GRANDE;719;97238;26/2/2001 00:33:00;CIDADAO COMUM;N;0;MINASLANDIA;BH;611610.44;804160.03;2630
-2632;2001109701;B06000;LESAO CORPORAL;RUA JOAQUIM TEIX;63;38207;26/2/2001 00:40:00;CIDADAO COMUM;S;0;CARDOSO;BH;604078.65;788100.48;2631
-2633;2001109706;B03000;AMEACA;RUA DOIS;12;27130;26/2/2001 00:42:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616403.95;806778.34;2632
-2634;2001109712;B03000;AMEACA;RUA NOVE;75;81013;26/2/2001 00:44:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605202.66;793145.62;2633
-2635;2001109814;B03000;AMEACA;RUA FAISAO;730;27710;26/2/2001 01:49:00;INICIATIVA;S;0;FLAVIO MARQUES D;BH;605277.76;788638.67;2634
-2636;2001109878;B05000;SEQUESTRO E CARC;RUA LASSANCE;235;84415;26/2/2001 02:31:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;615719.21;799981.01;2635
-2637;2001109955;B06000;LESAO CORPORAL;RUA CRISTAL;256;18611;26/2/2001 03:26:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;612735.35;797203.71;2636
-2638;2001110036;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;526;6353;26/2/2001 04:50:00;INICIATIVA;S;0;FLORESTA;BH;611816.86;797247.91;2637
-2639;2001110038;B06000;LESAO CORPORAL;RUA SILVA ALVARE;271;65810;26/2/2001 04:53:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615444.32;799061.06;2638
-2640;2001110067;B03000;AMEACA;RUA PAULO BRANDA;286;52710;26/2/2001 05:48:00;CIDADAO COMUM;S;CAB;SANTA EFIGENIA;BH;613634.47;796180.78;2639
-2641;2001110086;B06000;LESAO CORPORAL;RUA DOUTOR RIBEI;38;23650;26/2/2001 06:13:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;603413.75;793166.39;2640
-2642;2001110279;B06000;LESAO CORPORAL;RUA CONDOR;425;16773;26/2/2001 09:43:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605857.42;793824.01;2641
-2643;2001110342;B03000;AMEACA;RUA ATTILIO DE M;456;111630;26/2/2001 10:35:00;CIDADAO COMUM;N;0;DIAMANTE;BH;601519.35;789800.80;2642
-2644;2001110411;B04001;HOMICIDIO TENTAD;RUA TREZE;98;302331;26/2/2001 11:28:00;CIDADAO COMUM;N;;BONSUCESSO;BH;606355.86;789862.18;2643
-2645;2001110507;B03000;AMEACA;RUA JAGUARIBE;116;36822;26/2/2001 12:38:00;CIDADAO COMUM;S;;CONCORDIA;BH;610734.26;799522.66;2644
-2646;2001110624;B06000;LESAO CORPORAL;RUA JAGUARIBE;116;36822;26/2/2001 14:27:00;CIDADAO COMUM;N;CAB;CONCORDIA;BH;610734.26;799522.66;2645
-2647;2001110638;B06000;LESAO CORPORAL;RUA JOAO SILVA;45;89548;26/2/2001 14:31:00;CIDADAO COMUM;N;0;JARDIM VITORIA;BH;617433.32;804609.88;2646
-2648;2001110661;B03000;AMEACA;RUA ALBERTO MART;221;85244;26/2/2001 15:02:00;CIDADAO COMUM;S;0;JAQUELINE;BH;610706.28;810149.56;2647
-2649;2001110667;B03000;AMEACA;RUA FELICIO ROXO;5;27912;26/2/2001 15:04:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;611328.66;801692.14;2648
-2650;2001110674;B04001;HOMICIDIO TENTAD;RUA CAMETA;89;11883;26/2/2001 15:08:00;CIDADAO COMUM;S;;SAUDADE;BH;615105.71;797645.06;2649
-2651;2001110683;B06000;LESAO CORPORAL;RUA TRES;10;126837;26/2/2001 15:13:00;CIDADAO COMUM;S;;CONJUNTO VISTA A;BH;605133.98;792598.37;2650
-2652;2001110693;B04001;HOMICIDIO TENTAD;RUA ESTANISLAU P;18;86842;26/2/2001 15:24:00;INICIATIVA;N;0;CEU AZUL;BH;603281.88;806905.01;2651
-2653;2001110699;B03000;AMEACA;RUA CLORITA;100;16051;26/2/2001 15:26:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612847.22;797209.80;2652
-2654;2001110730;B06000;LESAO CORPORAL;RUA FELISBURGO;108;3950;26/2/2001 15:45:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612659.95;804501.51;2653
-2655;2001110764;B03000;AMEACA;RUA DOS JAVAES;315;37198;26/2/2001 16:11:00;CIDADAO COMUM;S;;SANTA MONICA;BH;606537.47;807752.17;2654
-2656;2001110773;B03000;AMEACA;AV AMAZONAS;6556;3140;26/2/2001 16:15:00;CIDADAO COMUM;S;0;GAMELEIRA;BH;605457.51;795682.06;2655
-2657;2001110801;B03000;AMEACA;RUA TUCA;80;69808;26/2/2001 16:32:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614229.42;803814.92;2656
-2658;2001110831;B06000;LESAO CORPORAL;RUA BERTOPOLIS;256;41873;26/2/2001 16:48:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612487.20;804200.25;2657
-2659;2001110881;B03000;AMEACA;RUA COSME E DAMI;444;18246;26/2/2001 17:21:00;CIDADAO COMUM;N;;UNIVERSITARIO;BH;610495.10;802666.38;2658
-2660;2001110889;B06000;LESAO CORPORAL;RUA GERALDO MART;143;86086;26/2/2001 17:25:00;CIDADAO COMUM;N;0;JAQUELINE;BH;611308.77;810320.43;2659
-2661;2001110918;B06000;LESAO CORPORAL;RUA MAJOR DELFIN;2614;42620;26/2/2001 17:40:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;608955.78;801400.33;2660
-2662;2001110968;B06000;LESAO CORPORAL;RUA BANDEIRANTES;42;71908;26/2/2001 18:13:00;CIDADAO COMUM;S;CAFR;NOVA CINTRA;BH;606042.17;793837.55;2661
-2663;2001111064;B06000;LESAO CORPORAL;RUA ANTONIO BICA;69;84875;26/2/2001 19:08:00;CIDADAO COMUM;N;0;DA LAGOA;BH;604696.70;809222.53;2662
-2664;2001111071;B03000;AMEACA;RUA PADRE CAFE;1230;51253;26/2/2001 19:12:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616158.27;797878.23;2663
-2665;2001111077;B03000;AMEACA;RUA LEOPOLDO GOM;241;40770;26/2/2001 19:16:00;CIDADAO COMUM;N;;POMPEIA;BH;614535.33;797876.85;2664
-2666;2001111203;B03000;AMEACA;RUA JORNALISTA C;185;120682;26/2/2001 20:26:00;CIDADAO COMUM;S;0;CHACARAS REUNIDA;BH;605748.54;789323.77;2665
-2667;2001111212;B03000;AMEACA;RUA ALBERTO MART;221;85244;26/2/2001 20:28:00;CIDADAO COMUM;N;0;JAQUELINE;BH;610706.28;810149.56;2666
-2668;2001111280;B04001;HOMICIDIO TENTAD;RUA ANAPURUS;79;20894;26/2/2001 21:07:00;INICIATIVA;S;0;SAO GABRIEL;BH;613199.76;804134.53;2667
-2669;2001111334;B04002;HOMICIDIO CONSUM;ESTRADA DO CERCA;2700;26428;26/2/2001 21:34:00;CIDADAO COMUM;N;;HAVAI;BH;607731.88;793293.52;2668
-2670;2001111478;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;2555;17095;26/2/2001 22:58:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613979.96;797400.79;2669
-2671;2001111532;B04001;HOMICIDIO TENTAD;RUA JOSE FELIX M;800;7416;26/2/2001 23:29:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606465.11;810558.08;2670
-2672;2001111562;B06000;LESAO CORPORAL;RUA ABILIO FERNA;195;95421;26/2/2001 23:43:00;CIDADAO COMUM;N;0;JARDIM VITORIA;BH;616838.69;804321.77;2671
-2673;2001111585;B06000;LESAO CORPORAL;RUA MICA;159;45685;26/2/2001 23:59:00;CIDADAO COMUM;S;0;SAO LUCAS;BH;613254.73;795968.68;2672
-2674;2001111600;B06000;LESAO CORPORAL;RUA MANJERICAO;543;34464;27/2/2001 00:09:00;CIDADAO COMUM;N;;LINDEIA;BH;599654.37;791207.03;2673
-2675;2001111659;B06000;LESAO CORPORAL;RUA DOS BENEDITI;85;63310;27/2/2001 00:57:00;CIDADAO COMUM;S;;PLANALTO;BH;610768.63;805419.05;2674
-2676;2001111732;B06000;LESAO CORPORAL;RUA DAS GABIROBA;95;30375;27/2/2001 01:40:00;CIDADAO COMUM;N;PRONTO SOCORRO J;VILA CLORIS;BH;610034.72;808298.49;2675
-2677;2001111738;B06000;LESAO CORPORAL;AV SANTOS DUMONT;477;61950;27/2/2001 01:48:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611172.34;797512.69;2676
-2678;2001111758;B06000;LESAO CORPORAL;RUA FRANCISCO LE;422;29495;27/2/2001 02:04:00;CIDADAO COMUM;N;0;SAO MARCOS;BH;614241.44;802567.46;2677
-2679;2001111784;B03000;AMEACA;RUA HUMAITA;47;33562;27/2/2001 02:20:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607640.09;796954.54;2678
-2680;2001111829;B06000;LESAO CORPORAL;AV SANTOS DUMONT;574;61950;27/2/2001 02:58:00;INICIATIVA;S;0;CENTRO (BH);BH;611085.24;797586.10;2679
-2681;2001111903;B06000;LESAO CORPORAL;AV PARANA;368;52230;27/2/2001 04:17:00;POLICIAL MILITAR;S;;CENTRO (BH);BH;610721.21;797160.64;2680
-2682;2001111924;B06000;LESAO CORPORAL;AV CRISTIANO MAC;1460;18652;27/2/2001 04:39:00;INICIATIVA;S;0;CELESTINO;BH;612408.10;799806.41;2681
-2683;2001111936;B03000;AMEACA;AV ESPLANADA;56;126244;27/2/2001 04:57:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613206.75;804342.60;2682
-2684;2001111982;B02000;RIXA;AV DOS ANDRADAS;377;3761;27/2/2001 06:11:00;INICIATIVA;N;0;CENTRO (BH);BH;611545.35;797222.18;2683
-2685;2001112028;B06000;LESAO CORPORAL;RUA RUI GUERRA;90;301669;27/2/2001 07:26:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614477.59;795128.95;2684
-2686;2001112105;B03000;AMEACA;RUA DAS CARMELIT;103;121401;27/2/2001 08:30:00;CIDADAO COMUM;N;;PLANALTO;BH;610572.62;805546.84;2685
-2687;2001112380;B04002;HOMICIDIO CONSUM;RUA SAUL;22;170891;27/2/2001 12:29:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608144.99;793571.20;2686
-2688;2001112418;B03000;AMEACA;RUA ROSALINA BAN;215;59302;27/2/2001 13:01:00;CIDADAO COMUM;S;;MINASLANDIA;BH;611890.83;803991.25;2687
-2689;2001112444;B03000;AMEACA;RUA RAMIRO SIQUE;45;128858;27/2/2001 13:30:00;CIDADAO COMUM;N;;CASTANHEIRAS (TA;BH;617763.55;797138.45;2688
-2690;2001112456;B03000;AMEACA;RUA NANA;689;47186;27/2/2001 13:47:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;603866.49;789493.30;2689
-2691;2001112459;B03000;AMEACA;RUA ALTINOPOLIS;829;36296;27/2/2001 13:49:00;CIDADAO COMUM;S;LJA;PIRATININGA;BH;605549.05;809289.01;2690
-2692;2001112463;B06000;LESAO CORPORAL;RUA DA PEDREIRA;347;301298;27/2/2001 13:52:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608679.64;794084.76;2691
-2693;2001112488;B06000;LESAO CORPORAL;RUA JERUSALEM;348;37320;27/2/2001 14:13:00;INICIATIVA;S;0;SAO SALVADOR;BH;603256.17;799675.78;2692
-2694;2001112512;B06000;LESAO CORPORAL;RUA DOUTOR CRIST;175;55598;27/2/2001 14:33:00;INICIATIVA;S;0;BONSUCESSO;BH;604650.82;789126.07;2693
-2695;2001112597;B03000;AMEACA;RUA DR JOSE ERNE;26;1362;27/2/2001 15:32:00;CIDADAO COMUM;S;FU;JARDIM MONTANHES;BH;606642.37;799044.19;2694
-2696;2001112615;B03000;AMEACA;RUA JOSE BARBOSA;675;85304;27/2/2001 15:47:00;CIDADAO COMUM;S;0;JAQUELINE;BH;610743.31;810454.35;2695
-2697;2001112618;B03000;AMEACA;RUA DOMICIO GABR;407;14623;27/2/2001 15:49:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600606.12;787280.28;2696
-2698;2001112636;B03000;AMEACA;RUA FRANCISCO DU;1057;46316;27/2/2001 16:04:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604095.29;803005.00;2697
-2699;2001112670;B03000;AMEACA;AV DORA TOMICH L;135;100060;27/2/2001 16:19:00;CIDADAO COMUM;S;;BRAUNAS;BH;604689.70;805481.65;2698
-2700;2001112701;B06000;LESAO CORPORAL;RUA COUTO DE MAG;271;18463;27/2/2001 16:32:00;CIDADAO COMUM;S;;PARAISO;BH;614290.78;796749.32;2699
-2701;2001112722;B06000;LESAO CORPORAL;RUA PAU BRASIL;516;109401;27/2/2001 16:39:00;CIDADAO COMUM;N;SOLIMOES;SOLIMOES;BH;612440.90;807719.97;2700
-2702;2001112740;B04001;HOMICIDIO TENTAD;RUA GUAICURUS;538;32009;27/2/2001 16:56:00;INICIATIVA;S;0;CENTRO BH;BH;611143.63;797659.74;2701
-2703;2001112787;B06000;LESAO CORPORAL;RUA ESTORIL;1507;63827;27/2/2001 17:31:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;608967.89;801689.91;2702
-2704;2001112797;B03000;AMEACA;RUA MIKHAIL NIME;88;130481;27/2/2001 17:38:00;INICIATIVA;S;0;HELIOPOLIS;BH;611319.96;805188.66;2703
-2705;2001112830;B03000;AMEACA;RUA MARIO SOARES;492;44641;27/2/2001 17:56:00;CIDADAO COMUM;N;0;DOM BOSCO;BH;604170.41;797305.50;2704
-2706;2001112918;B04002;HOMICIDIO CONSUM;RUA PADRE PEDRO ;175;51657;27/2/2001 18:48:00;POLICIAL MILITAR;N;0;VENDA NOVA;BH;609671.68;808130.71;2705
-2707;2001112963;B04002;HOMICIDIO CONSUM;RUA CANDIDO DE S;840;12628;27/2/2001 19:07:00;CIDADAO COMUM;N;0;GAMELEIRA;BH;605603.59;794333.92;2706
-2708;2001112972;B03000;AMEACA;ALAMEDA CHICO ME;100;96018;27/2/2001 19:13:00;CIDADAO COMUM;N;;VILA CASTANHEIRA;BH;601310.13;788681.30;2707
-2709;2001112973;B04001;HOMICIDIO TENTAD;AV GUARATA;633;32267;27/2/2001 19:13:00;CIDADAO COMUM;S;;PRADO;BH;608528.64;797229.38;2708
-2710;2001113033;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;27/2/2001 19:44:00;CIDADAO COMUM;S;;TIROL;BH;600947.66;789885.51;2709
-2711;2001113064;B03000;AMEACA;RUA PONTE NOVA;354;54655;27/2/2001 19:57:00;POLICIAL MILITAR;S;;COLEGIO BATISTA;BH;611261.34;798370.33;2710
-2712;2001113095;B03000;AMEACA;AV MANOEL GOMES;106;43103;27/2/2001 20:16:00;CIDADAO COMUM;S;;NOVA CACHOEIRINH;BH;609780.82;801385.63;2711
-2713;2001113141;B03000;AMEACA;AV CRISTIANO MAC;1616;18652;27/2/2001 20:38:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612314.39;800010.13;2712
-2714;2001113202;B03000;AMEACA;RUA DEPUTADO SEB;923;89724;27/2/2001 21:14:00;CIDADAO COMUM;N;0;PALMEIRAS;BH;606848.85;790779.26;2713
-2715;2001113227;B03000;AMEACA;RUA TAPIRA;20;66939;27/2/2001 21:23:00;CIDADAO COMUM;N;FE;CONCORDIA;BH;610810.13;799594.08;2714
-2716;2001113261;B06000;LESAO CORPORAL;RUA JOSE HONORAT;320;100826;27/2/2001 21:38:00;CIDADAO COMUM;S;CAFU;JARDIM GUANABARA;BH;611008.01;807522.85;2715
-2717;2001113288;B03000;AMEACA;RUA STIBINA;279;66434;27/2/2001 21:49:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;614304.97;796464.86;2716
-2718;2001113371;B03000;AMEACA;RUA OSWALDO GOEL;68;97470;27/2/2001 22:23:00;CIDADAO COMUM;N;;TUPI;BH;613632.96;806410.86;2717
-2719;2001113386;B03000;AMEACA;RUA ANTONIO DA C;132;98937;27/2/2001 22:31:00;CIDADAO COMUM;S;0;LAGOA;BH;604752.28;809599.37;2718
-2720;2001113418;B06000;LESAO CORPORAL;PRACA MINERVA;39;45833;27/2/2001 22:45:00;INICIATIVA;N;0;PROFESSOR WASHIN;IB;598848.60;789287.98;2719
-2721;2001113482;B03000;AMEACA;RUA MARECHAL RON;108;43677;27/2/2001 23:17:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611883.66;803480.80;2720
-2722;2001113492;B06000;LESAO CORPORAL;RUA AGUA DE COLO;12;105570;27/2/2001 23:25:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;616067.52;806207.89;2721
-2723;2001113519;B03000;AMEACA;RUA DES SARAIVA;931;66535;27/2/2001 23:43:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616054.70;797928.23;2722
-2724;2001113572;B06000;LESAO CORPORAL;RUA ANTONIO JOSE;216;7431;28/2/2001 00:25:00;INICIATIVA;S;0;CEU AZUL;BH;605133.43;807821.38;2723
-2725;2001113731;B03000;AMEACA;RUA SAFIRA;95;59835;28/2/2001 02:24:00;INICIATIVA;S;0;PRADO;BH;608617.43;796702.89;2724
-2726;2001113752;B06000;LESAO CORPORAL;RUA OSWALDO GOEL;68;97470;28/2/2001 02:37:00;CIDADAO COMUM;N;;TUPI;BH;613632.96;806410.86;2725
-2727;2001113759;B04001;HOMICIDIO TENTAD;AV DOM PEDRO II;4205;53145;28/2/2001 02:43:00;INICIATIVA;S;0;PADRE EUSTAQUIO;BH;606744.93;797901.91;2726
-2728;2001113860;B04001;HOMICIDIO TENTAD;ESTRADA DOS BORG;5;85893;28/2/2001 04:34:00;INICIATIVA;S;0;JARDIM VITORIA;BH;616433.49;804527.60;2727
-2729;2001114009;B03000;AMEACA;RUA FORMIGA;50;29136;28/2/2001 07:58:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610336.11;798756.88;2728
-2730;2001114092;B04001;HOMICIDIO TENTAD;AV PRESIDENTE AN;3710;4461;28/2/2001 09:09:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;609808.70;801577.71;2729
-2731;2001114187;B03000;AMEACA;RUA DR JOSE ERNE;26;1362;28/2/2001 10:07:00;CIDADAO COMUM;S;FU;JARDIM MONTANHES;BH;606642.37;799044.19;2730
-2732;2001114239;B06000;LESAO CORPORAL;AV BARBACENA;415;8084;28/2/2001 10:44:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609507.27;796845.22;2731
-2733;2001114276;B03000;AMEACA;RUA CIRILO GASPA;326;63348;28/2/2001 11:20:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608684.85;800162.78;2732
-2734;2001114472;B03000;AMEACA;RUA PROFESSOR JO;95;55529;28/2/2001 14:08:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611231.92;799402.77;2733
-2735;2001114499;B04001;HOMICIDIO TENTAD;AV CECILIA PINTO;33;14447;28/2/2001 14:32:00;CIDADAO COMUM;S;0;SAO BERNARDO;BH;610600.26;805253.80;2734
-2736;2001114536;B03000;AMEACA;RUA DOS MACARICO;158;42170;28/2/2001 14:54:00;CIDADAO COMUM;S;AP04;VILA CLORIS;BH;610202.02;807689.91;2735
-2737;2001114552;B06000;LESAO CORPORAL;RUA MARCAZITA;162;43488;28/2/2001 15:07:00;CIDADAO COMUM;N;0;SAO CRISTOVAO;BH;610040.06;799407.54;2736
-2738;2001114596;B03000;AMEACA;AV JOAO XXIII;41;37926;28/2/2001 15:34:00;INICIATIVA;N;0;CONJUNTO ALIPIO ;BH;604194.53;799545.38;2737
-2739;2001114644;B03000;AMEACA;RUA AGRIPINO GRI;86;1450;28/2/2001 15:57:00;CIDADAO COMUM;S;0;TUPI;BH;613304.20;806016.33;2738
-2740;2001114678;B03000;AMEACA;RUA ITABIRA;493;35237;28/2/2001 16:16:00;CIDADAO COMUM;N;AP102;LAGOINHA;BH;610931.11;798451.36;2739
-2741;2001114681;B06000;LESAO CORPORAL;RUA OSCAR LOBO P;270;104480;28/2/2001 16:18:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612347.11;803516.89;2740
-2742;2001114688;B04001;HOMICIDIO TENTAD;RUA MUNIZ;100;170850;28/2/2001 16:25:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608081.16;793922.64;2741
-2743;2001114757;B03000;AMEACA;RUA ASTOLFO DUTR;542;6426;28/2/2001 17:12:00;INICIATIVA;S;0;ESPLANADA;BH;615215.48;798283.62;2742
-2744;2001114765;B06000;LESAO CORPORAL;RUA PIRATUBA;71;54236;28/2/2001 17:17:00;CIDADAO COMUM;N;0;SANTO ANDRE;BH;609779.72;799545.81;2743
-2745;2001114779;B03000;AMEACA;RUA DOS GUAJAJAR;1268;32037;28/2/2001 17:26:00;CIDADAO COMUM;S;AP2822;SANTO AGOSTINHO;BH;610359.02;796667.12;2744
-2746;2001114924;B03000;AMEACA;RUA CAMPANARIO;557;12010;28/2/2001 19:05:00;CIDADAO COMUM;S;;SANTA INES;BH;614359.44;800809.14;2745
-2747;2001114998;B04001;HOMICIDIO TENTAD;BECO UNIAO;5;302591;28/2/2001 19:58:00;CIDADAO COMUM;N;;HORIZONTE (NEVES;RN;603390.24;807473.62;2746
-2748;2001115013;B03000;AMEACA;RUA HILDEBRANDO ;304;129788;28/2/2001 20:09:00;CIDADAO COMUM;S;0;COPACABANA;BH;606515.65;806259.16;2747
-2749;2001115022;B03000;AMEACA;RUA BOM DESPACHO;390;9944;28/2/2001 20:16:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;614081.01;797685.62;2748
-2750;2001115062;B08000;VIOLACAO DE DOMI;AV FRANCISCO SA;55;29656;28/2/2001 20:42:00;CIDADAO COMUM;S;;PRADO;BH;609022.99;796771.47;2749
-2751;2001115065;B06000;LESAO CORPORAL;RUA CAETANO PIRR;520;45773;28/2/2001 20:44:00;INICIATIVA;S;0;MILIONARIOS;BH;604100.25;790093.56;2750
-2752;2001115077;B06000;LESAO CORPORAL;RUA JABOTICABAL;822;36517;28/2/2001 20:52:00;CIDADAO COMUM;S;0;JARDIM AMERICA;BH;607756.01;794117.46;2751
-2753;2001115118;B06000;LESAO CORPORAL;AV CIVILIZACAO;911;51657;28/2/2001 21:20:00;CIDADAO COMUM;N;BL12 APTO203;JARDIM FLORENCIA;BH;609133.74;808652.87;2752
-2754;2001115135;B06000;LESAO CORPORAL;RUA YUCATAN;8;36302;28/2/2001 21:33:00;INICIATIVA;S;0;SAO PEDRO;BH;611235.19;793829.00;2753
-2755;2001115172;B03000;AMEACA;AV JOAO FIRMINO ;249;47259;28/2/2001 21:55:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601168.35;788608.66;2754
-2756;2001115204;B03000;AMEACA;RUA AUGUSTO DE A;189;6643;28/2/2001 22:18:00;CIDADAO COMUM;S;0;BOA VISTA;BH;615915.90;799869.09;2755
-2757;2001115225;B06000;LESAO CORPORAL;RUA DOUTOR BENED;2090;12252;28/2/2001 22:34:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;613267.66;805156.63;2756
-2758;2001115248;B03000;AMEACA;RUA JOSE MAURICI;97;58035;28/2/2001 22:54:00;CIDADAO COMUM;S;CAA;VILA HUMAITA;BH;610284.60;801833.76;2757
-2759;2001115326;B06000;LESAO CORPORAL;RUA JOSE MARIA B;373;38380;28/2/2001 23:39:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;607751.02;807597.60;2758
-2760;2001115488;B03000;AMEACA;AV NELIO CERQUEI;15;72359;1/3/2001 02:40:00;CIDADAO COMUM;S;0;TIROL;BH;600947.66;789885.51;2759
-2761;2001115505;B03000;AMEACA;RUA EMILIO RICAL;141;102806;1/3/2001 03:07:00;CIDADAO COMUM;S;AP104;JOAO PINHEIRO;BH;605108.25;795890.74;2760
-2762;2001115858;B03000;AMEACA;RUA FERREIRA DOS;95;28234;1/3/2001 10:05:00;CIDADAO COMUM;S;;PIRAJA;BH;613165.96;802804.35;2761
-2763;2001115889;B03000;AMEACA;RUA ALVARES MACI;670;2756;1/3/2001 10:50:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;612469.08;796685.32;2762
-2764;2001115966;B03000;AMEACA;RUA CORNELIO CER;753;17417;1/3/2001 11:36:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605629.54;797930.61;2763
-2765;2001115976;B03000;AMEACA;RUA Q;144;78415;1/3/2001 11:44:00;CIDADAO COMUM;N;;VILA PINHO;BH;602175.50;788033.53;2764
-2766;2001115985;B03000;AMEACA;RUA MARIA AMELIA;841;43812;1/3/2001 11:56:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;610257.12;805510.06;2765
-2767;2001116096;B04001;HOMICIDIO TENTAD;RUA BOGOTA;23;9856;1/3/2001 13:19:00;CIDADAO COMUM;S;CASA C;JARDIM AMERICA;BH;607651.60;794611.02;2766
-2768;2001116146;B06000;LESAO CORPORAL;RUA CRISANTEMO;210;18564;1/3/2001 13:57:00;CIDADAO COMUM;S;;MARAJO;BH;606640.47;793158.42;2767
-2769;2001116150;B03000;AMEACA;RUA JOSE ISIDORO;67;38869;1/3/2001 13:58:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614288.39;803379.27;2768
-2770;2001116165;B03000;AMEACA;RUA CHAFARIZ;40;300275;1/3/2001 14:09:00;CIDADAO COMUM;S;CAB;HAVAI;BH;607407.04;793804.07;2769
-2771;2001116187;B04001;HOMICIDIO TENTAD;RUA CORCOVADO;1133;14894;1/3/2001 14:26:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607494.97;794011.81;2770
-2772;2001116188;B06000;LESAO CORPORAL;RUA PASSA QUATRO;325;52420;1/3/2001 14:26:00;CIDADAO COMUM;S;AP02;CAICARA;BH;607592.67;799403.42;2771
-2773;2001116190;B03000;AMEACA;RUA SAO RAFAEL;138;63580;1/3/2001 14:26:00;CIDADAO COMUM;N;;FLORESTA;BH;612241.79;798264.50;2772
-2774;2001116251;B06000;LESAO CORPORAL;RUA DEMETRIO RIB;1363;19797;1/3/2001 15:03:00;CIDADAO COMUM;S;0;SAUDADE;BH;615883.06;797293.92;2773
-2775;2001116256;B03000;AMEACA;RUA MARCO ANTONI;53;54829;1/3/2001 15:06:00;CIDADAO COMUM;N;0;MARIA VIRGINIA;BH;612035.38;802855.52;2774
-2776;2001116258;B03000;AMEACA;RUA MECA;53;45281;1/3/2001 15:06:00;CIDADAO COMUM;S;0;CH BETANIA;BH;605413.35;792348.38;2775
-2777;2001116317;B06000;LESAO CORPORAL;AV BARBACENA;653;8084;1/3/2001 15:52:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609636.01;796640.35;2776
-2778;2001116490;B03000;AMEACA;RUA AUGUSTO DE A;189;6643;1/3/2001 17:28:00;CIDADAO COMUM;S;0;BOA VISTA;BH;615915.90;799869.09;2777
-2779;2001116610;B06000;LESAO CORPORAL;RUA WILSON ABRAO;165;113286;1/3/2001 18:27:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608897.10;809883.65;2778
-2780;2001116617;B03000;AMEACA;AV AUGUSTO DE LI;1640;6731;1/3/2001 18:32:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609741.31;796987.79;2779
-2781;2001116619;B03000;AMEACA;RUA JOAQUIM ANAC;23;118932;1/3/2001 18:33:00;INICIATIVA;N;0;TEIXEIRA DIAS;BH;603052.88;789295.61;2780
-2782;2001116923;B03000;AMEACA;RUA GLAUBER ROCH;75;94139;1/3/2001 21:18:00;CIDADAO COMUM;S;0;PAQUETA;BH;605378.45;802809.61;2781
-2783;2001116936;B03000;AMEACA;RUA DARIO FARIA ;352;39240;1/3/2001 21:24:00;CIDADAO COMUM;S;0;DAS INDUSTRIAS;BH;604227.17;792565.96;2782
-2784;2001116939;B06000;LESAO CORPORAL;RUA SAO MIGUEL;995;63410;1/3/2001 21:28:00;CIDADAO COMUM;S;0;ITAPOA;BH;609281.94;805595.11;2783
-2785;2001116945;B03000;AMEACA;RUA PADRE AUGUST;15;51238;1/3/2001 21:32:00;CIDADAO COMUM;S;;HELIOPOLIS;BH;611053.12;806066.34;2784
-2786;2001116973;B06000;LESAO CORPORAL;RUA DA PEDREIRA;328;301298;1/3/2001 21:50:00;CIDADAO COMUM;N;AGUARDA NA 125 C;MORRO DAS PEDRAS;BH;608618.39;794087.94;2785
-2787;2001117029;B04001;HOMICIDIO TENTAD;RUA BARAO DE COR;45;7910;1/3/2001 22:26:00;CIDADAO COMUM;S;0;SAO TOMAZ;BH;609532.40;805277.88;2786
-2788;2001117050;B06000;LESAO CORPORAL;RUA MUCURI;5;46880;1/3/2001 22:38:00;INICIATIVA;N;0;FLORESTA;BH;612422.07;797232.88;2787
-2789;2001117063;B06000;LESAO CORPORAL;RUA FREI ZACARIA;330;37610;1/3/2001 22:46:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603812.96;802146.64;2788
-2790;2001117079;B03000;AMEACA;RUA CLORITA;100;16051;1/3/2001 22:57:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612847.22;797209.80;2789
-2791;2001117099;B03000;AMEACA;RUA JOSE LUIZ DI;406;83945;1/3/2001 23:11:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;605070.02;789748.80;2790
-2792;2001117103;B06000;LESAO CORPORAL;RUA ANTONIO EUST;85;72103;1/3/2001 23:14:00;CIDADAO COMUM;S;;TIROL;BH;600127.68;789465.93;2791
-2793;2001117130;B06000;LESAO CORPORAL;RUA PAI TOMAS;90;51760;1/3/2001 23:33:00;CIDADAO COMUM;N;CA;CABANA;BH;604944.65;794453.85;2792
-2794;2001117136;B03000;AMEACA;RUA FERNAO DIAS;60;28133;1/3/2001 23:41:00;INICIATIVA;S;0;CASA BRANCA;BH;616318.93;799741.71;2793
-2795;2001117223;B04002;HOMICIDIO CONSUM;RUA HUMAITA;1234;33562;2/3/2001 01:09:00;CIDADAO COMUM;N;CAA;PADRE EUSTAQUIO;BH;606390.98;797020.45;2794
-2796;2001117236;B03000;AMEACA;AV AUGUSTO DE LI;46;6731;2/3/2001 01:25:00;INICIATIVA;N;0;CENTRO BH;BH;611284.46;796568.91;2795
-2797;2001117250;B08000;VIOLACAO DE DOMI;RUA PIRATININGA;225;54150;2/3/2001 01:45:00;CIDADAO COMUM;S;CS;CARDOSO;BH;603928.77;788099.60;2796
-2798;2001117262;B03000;AMEACA;RUA CARMESIA;617;13618;2/3/2001 01:57:00;CIDADAO COMUM;S;;SANTA INES;BH;614301.69;800789.19;2797
-2799;2001117363;B06000;LESAO CORPORAL;AV CRISTIANO MAC;10727;18652;2/3/2001 04:13:00;INICIATIVA;N;0;VILA CLORIS;BH;611116.34;806188.75;2798
-2800;2001117372;B04001;HOMICIDIO TENTAD;RUA DOS COMANCHE;105;16367;2/3/2001 04:35:00;INICIATIVA;N;0;ITAMARATI;BH;606988.32;806826.23;2799
-2801;2001117503;B06000;LESAO CORPORAL;RUA COSTA MACHAD;382;18334;2/3/2001 07:55:00;CIDADAO COMUM;N;;UNIVERSITARIO;BH;610772.74;802837.58;2800
-2802;2001117571;B04001;HOMICIDIO TENTAD;RUA VIGIA;185;71977;2/3/2001 08:42:00;CIDADAO COMUM;N;;SAO GERALDO;BH;615575.02;798840.43;2801
-2803;2001117677;B09000;ABANDONO DE INCA;RUA ABAIBA;289;561;2/3/2001 09:50:00;CIDADAO COMUM;S;;SAO PAULO;BH;612405.72;802787.54;2802
-2804;2001117690;B03000;AMEACA;RUA JORDAO;100;96090;2/3/2001 10:01:00;CIDADAO COMUM;N;;OLARIA;BH;601797.43;789255.76;2803
-2805;2001117733;B08000;VIOLACAO DE DOMI;AV SEN LEVINDO C;4007;14866;2/3/2001 10:27:00;INICIATIVA;S;0;CH VALE DO JATOB;BH;601309.73;786551.23;2804
-2806;2001117800;B03000;AMEACA;RUA MENDES DE OL;1084;45430;2/3/2001 11:10:00;CIDADAO COMUM;N;0;SANTO ANDRE;BH;609718.74;799470.77;2805
-2807;2001117812;B03000;AMEACA;RUA ALFREDINA AM;220;2251;2/3/2001 11:23:00;CIDADAO COMUM;N;LJ1;MILIONARIOS;BH;604422.87;790414.37;2806
-2808;2001117876;B03000;AMEACA;RUA PADRE CYR AS;57;12091;2/3/2001 12:20:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612109.79;803534.32;2807
-2809;2001117924;B03000;AMEACA;RUA VOLUNTARIOS ;117;73639;2/3/2001 13:01:00;CIDADAO COMUM;N;;IPIRANGA;BH;611544.61;800681.01;2808
-2810;2001117955;B03000;AMEACA;RUA JACUI;2664;36734;2/3/2001 13:20:00;CIDADAO COMUM;S;;NOVA FLORESTA;BH;611427.64;800343.72;2809
-2811;2001117997;B06000;LESAO CORPORAL;AV DOS ANDRADAS;318;3761;2/3/2001 13:47:00;CIDADAO COMUM;S;PX333;CENTRO (BH);BH;611498.16;797301.08;2810
-2812;2001118025;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;1740;57830;2/3/2001 14:01:00;INICIATIVA;N;0;GUTIERREZ;BH;608719.62;793771.09;2811
-2813;2001118066;B03000;AMEACA;AV PRESIDENTE CO;163;55140;2/3/2001 14:27:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;603598.49;792896.47;2812
-2814;2001118095;B06000;LESAO CORPORAL;RUA MORRINHOS;194;46808;2/3/2001 14:43:00;CIDADAO COMUM;S;0;CAETANO FURQUIM;BH;616454.98;798919.85;2813
-2815;2001118103;B03000;AMEACA;RUA AMENDITA;71;3213;2/3/2001 14:49:00;CIDADAO COMUM;S;CSB;FILADELFIA;BH;602278.57;797876.85;2814
-2816;2001118189;B03000;AMEACA;RUA PONTA PORA;45;54601;2/3/2001 15:51:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;613127.25;796831.17;2815
-2817;2001118205;B06000;LESAO CORPORAL;AV LUXEMBURGO;29;127612;2/3/2001 16:01:00;CIDADAO COMUM;S;0;JARDIM EUROPA;BH;607874.09;810280.10;2816
-2818;2001118211;B03000;AMEACA;RUA IARA;370;33751;2/3/2001 16:03:00;CIDADAO COMUM;S;0;POMPEIA;BH;614672.10;797859.09;2817
-2819;2001118329;B06000;LESAO CORPORAL;BECO LORENCO SIL;137;302105;2/3/2001 17:15:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605675.37;807175.93;2818
-2820;2001118396;B03000;AMEACA;RUA DONA HONORIN;46;22395;2/3/2001 17:57:00;CIDADAO COMUM;N;CSFR;ENGENHO NOGUEIRA;BH;606991.70;800313.31;2819
-2821;2001118437;B04001;HOMICIDIO TENTAD;RUA MANAIRA;90;96235;2/3/2001 18:19:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614046.95;805015.29;2820
-2822;2001118472;B03000;AMEACA;RUA FERNAO DIAS;237;28133;2/3/2001 18:38:00;CIDADAO COMUM;N;CSFR;CASA BRANCA;BH;615994.86;798666.47;2821
-2823;2001118488;B03000;AMEACA;RUA ALEM PARAIBA;274;81357;2/3/2001 18:50:00;CIDADAO COMUM;S;0;BONFIM;BH;610523.78;798150.33;2822
-2824;2001118490;B04001;HOMICIDIO TENTAD;RUA NHONHO BROCH;215;47580;2/3/2001 18:52:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604663.85;792029.41;2823
-2825;2001118644;B03000;AMEACA;RUA BERNADETH JO;89;94230;2/3/2001 20:18:00;CIDADAO COMUM;S;;CARDOSO;BH;603122.39;788415.38;2824
-2826;2001118646;B03000;AMEACA;RUA ADAMINA;385;993;2/3/2001 20:20:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;613245.80;797540.93;2825
-2827;2001118668;B04001;HOMICIDIO TENTAD;BECO COPACABANA;150;170460;2/3/2001 20:35:00;CIDADAO COMUM;N;;CABANA;BH;604709.11;794310.50;2826
-2828;2001118767;B03000;AMEACA;RUA MANOEL CAYLL;121;43043;2/3/2001 21:31:00;CIDADAO COMUM;S;;HORTO;BH;613259.68;798134.49;2827
-2829;2001118838;B04001;HOMICIDIO TENTAD;RUA GABRO;379;30435;2/3/2001 22:21:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612925.79;797244.47;2828
-2830;2001118845;B06000;LESAO CORPORAL;RUA GUARAIBA;98;96291;2/3/2001 22:25:00;CIDADAO COMUM;S;CSA;SAO GABRIEL;BH;614482.79;804612.97;2829
-2831;2001118885;B06000;LESAO CORPORAL;RUA JOAO GUALBER;150;68414;2/3/2001 22:54:00;INICIATIVA;N;0;SAO JOAO BATISTA;BH;608949.69;808085.04;2830
-2832;2001118895;B06000;LESAO CORPORAL;RUA SEIS;84;86174;2/3/2001 22:57:00;CIDADAO COMUM;N;;JAQUELINE;BH;611389.70;810027.38;2831
-2833;2001118896;B03000;AMEACA;RUA LEOPOLDO GOM;148;40770;2/3/2001 22:59:00;CIDADAO COMUM;S;;POMPEIA;BH;614465.15;797866.77;2832
-2834;2001118907;B03000;AMEACA;AV B;346;93643;2/3/2001 23:07:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;601444.33;786227.25;2833
-2835;2001118950;B03000;AMEACA;RUA ANTONIO TEIX;23;119037;2/3/2001 23:28:00;CIDADAO COMUM;N;;TEIXEIRA DIAS;BH;603001.89;789757.04;2834
-2836;2001118952;B03000;AMEACA;AV DOS ANDRADAS;6001;3761;2/3/2001 23:27:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615410.70;798622.38;2835
-2837;2001118960;B06000;LESAO CORPORAL;RUA CHACARAS REU;107;120411;2/3/2001 23:35:00;CIDADAO COMUM;S;;CHACARAS REUNIDA;BH;605765.30;789253.09;2836
-2838;2001118963;B03000;AMEACA;RUA BRAGA;155;10332;2/3/2001 23:39:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;607240.53;794200.41;2837
-2839;2001118969;B03000;AMEACA;RUA GASPAR DE LE;45;119720;2/3/2001 23:43:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616869.52;797183.90;2838
-2840;2001119053;B02000;RIXA;AV WALDOMIRO LOB;1536;66548;3/3/2001 00:33:00;CIDADAO COMUM;S;;GUARANI;BH;612089.63;805263.76;2839
-2841;2001119069;B04001;HOMICIDIO TENTAD;RUA JULIO DE CAS;6;39470;3/3/2001 00:45:00;CIDADAO COMUM;S;0;CINQUENTENARIO;BH;606321.36;793163.73;2840
-2842;2001119070;B03000;AMEACA;RUA ORLANDO RODR;20;128630;3/3/2001 00:45:00;CIDADAO COMUM;S;CAA;SALGADO FILHO;BH;607282.69;794204.34;2841
-2843;2001119071;B06000;LESAO CORPORAL;RUA JULIO FERREI;265;20995;3/3/2001 00:46:00;CIDADAO COMUM;S;0;SANTA AMELIA;BH;607245.17;806503.88;2842
-2844;2001119107;B06000;LESAO CORPORAL;RUA JOSE DE ALEN;50;116980;3/3/2001 01:05:00;CIDADAO COMUM;S;;CAPITAO EDUARDO;BH;618262.11;806584.69;2843
-2845;2001119129;B06000;LESAO CORPORAL;AV DOM PEDRO II;4205;53145;3/3/2001 01:15:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606744.93;797901.91;2844
-2846;2001119159;B06000;LESAO CORPORAL;RUA DAS GABIROBA;95;30375;3/3/2001 01:36:00;CIDADAO COMUM;S;;VILA CLORIS;BH;610034.72;808298.49;2845
-2847;2001119180;B03000;AMEACA;RUA ORDALIA;2;50310;3/3/2001 01:59:00;CIDADAO COMUM;S;;PATROCINIO;BH;603533.64;798879.31;2846
-2848;2001119195;B04001;HOMICIDIO TENTAD;RUA MARIA BEATRI;710;43881;3/3/2001 02:04:00;CIDADAO COMUM;N;LJB;HAVAI;BH;606975.56;793180.58;2847
-2849;2001119210;B06000;LESAO CORPORAL;RUA MARCELINA FR;48;124655;3/3/2001 02:16:00;CIDADAO COMUM;S;;JAQUELINE;BH;611484.77;810591.71;2848
-2850;2001119258;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;8665;18652;3/3/2001 02:38:00;CIDADAO COMUM;N;;DONA CLARA;BH;611659.92;803708.12;2849
-2851;2001119315;B06000;LESAO CORPORAL;RUA ESMERALDO BO;255;75650;3/3/2001 03:28:00;CIDADAO COMUM;N;201;BURITIS;BH;608019.94;790475.98;2850
-2852;2001119344;B06000;LESAO CORPORAL;AV SANTOS DUMONT;270;61950;3/3/2001 03:56:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611379.38;797507.11;2851
-2853;2001119367;B03000;AMEACA;RUA LEOPOLDO GOM;1591;40770;3/3/2001 04:14:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615861.34;798144.40;2852
-2854;2001119377;B04001;HOMICIDIO TENTAD;AV VEREADOR CICE;105;19756;3/3/2001 04:20:00;INICIATIVA;N;0;CORACAO EUCARIST;BH;605300.75;796090.62;2853
-2855;2001119403;B03000;AMEACA;RUA PIRANGUINHO;145;54122;3/3/2001 04:52:00;CIDADAO COMUM;S;;SAO GERALDO;BH;616037.88;799139.11;2854
-2856;2001119419;B06000;LESAO CORPORAL;RUA AARAO REIS;364;473;3/3/2001 05:33:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611579.10;797272.30;2855
-2857;2001119439;B03000;AMEACA;RUA LEOPOLDO GOM;1591;40770;3/3/2001 06:51:00;INICIATIVA;S;0;VERA CRUZ;BH;615861.34;798144.40;2856
-2858;2001119446;B03000;AMEACA;RUA LUIZ CASTANH;240;41697;3/3/2001 07:05:00;CIDADAO COMUM;N;0;SANTA CRUZ;BH;611154.40;801888.99;2857
-2859;2001119489;B06000;LESAO CORPORAL;RUA SERENATA;115;172351;3/3/2001 08:02:00;CIDADAO COMUM;S;0;SERRA;BH;614062.04;795309.15;2858
-2860;2001119504;B03000;AMEACA;RUA MURILO PINTO;84;91691;3/3/2001 08:15:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;607074.69;793938.12;2859
-2861;2001119507;B03000;AMEACA;RUA VINTE E SEIS;75;72780;3/3/2001 08:16:00;INICIATIVA;S;0;LEONINA;BH;608491.67;793462.89;2860
-2862;2001119538;B03000;AMEACA;RUA NOVA LIMA;292;48453;3/3/2001 08:45:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;609248.22;798009.84;2861
-2863;2001119550;B09000;ABANDONO DE INCA;RUA FRANCISCO LE;72;29495;3/3/2001 09:00:00;CIDADAO COMUM;S;FU;SAO MARCOS;BH;614356.83;802276.53;2862
-2864;2001119611;B03000;AMEACA;AV DO CONTORNO;1341;17228;3/3/2001 09:57:00;INICIATIVA;N;0;CENTRO (BH);BH;611909.94;797822.35;2863
-2865;2001119613;B06000;LESAO CORPORAL;RUA BOLIVAR;458;9871;3/3/2001 09:58:00;CIDADAO COMUM;N;0;UNIAO;BH;612866.19;801674.00;2864
-2866;2001119616;B03000;AMEACA;RUA INDEPENDENCI;831;34391;3/3/2001 10:01:00;CIDADAO COMUM;S;0;CABANA;BH;605985.71;793145.38;2865
-2867;2001119633;B03000;AMEACA;RUA FLOR DE VIDR;44;13504;3/3/2001 10:23:00;CIDADAO COMUM;S;;CASTELO;BH;605631.15;799432.80;2866
-2868;2001119638;B08000;VIOLACAO DE DOMI;RUA TEBAS;480;67090;3/3/2001 10:25:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615811.31;798263.72;2867
-2869;2001119639;B06000;LESAO CORPORAL;RUA SA E BENEVID;36;10708;3/3/2001 10:25:00;CIDADAO COMUM;S;;UNIVERSITARIO;BH;610216.40;802593.25;2868
-2870;2001119686;B03000;AMEACA;RUA OSWALDO DE S;433;50553;3/3/2001 11:04:00;CIDADAO COMUM;N;0;DOM BOSCO;BH;604169.56;797430.90;2869
-2871;2001119695;B03000;AMEACA;RUA PENALVA;51;96276;3/3/2001 11:14:00;CIDADAO COMUM;N;REF///DEPOSITO J;DOM SILVERIO;BH;614562.09;804374.72;2870
-2872;2001119728;B04001;HOMICIDIO TENTAD;RUA DES CINTRA N;864;62966;3/3/2001 11:47:00;CIDADAO COMUM;N;0;MILIONARIOS;BH;604725.20;790121.59;2871
-2873;2001119742;B03000;AMEACA;RUA JOAO LIRIO D;26;108581;3/3/2001 12:05:00;CIDADAO COMUM;S;REF///SUPERM. FO;VENDA NOVA;BH;608643.28;808563.86;2872
-2874;2001119753;B03000;AMEACA;RUA ARACI;429;5335;3/3/2001 12:13:00;CIDADAO COMUM;S;CSA;PINDORAMA;BH;602526.65;797595.21;2873
-2875;2001119811;B03000;AMEACA;RUA SAO MATIAS;150;63408;3/3/2001 13:01:00;CIDADAO COMUM;N;0;SERRANO;BH;603286.89;800380.66;2874
-2876;2001119829;B03000;AMEACA;RUA TUCA;370;69808;3/3/2001 13:14:00;CIDADAO COMUM;S;CAA;MARIA GORETTI;BH;614517.00;803684.53;2875
-2877;2001119864;B03000;AMEACA;RUA SAO PAULO;118;63464;3/3/2001 13:42:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611103.76;797674.75;2876
-2878;2001119877;B03000;AMEACA;RUA CINCO;154;302813;3/3/2001 13:53:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614537.55;805974.74;2877
-2879;2001119929;B03000;AMEACA;RUA DEMETRIO RIB;1397;19797;3/3/2001 14:29:00;POLICIAL MILITAR;S;0;SAUDADE;BH;615890.15;797259.25;2878
-2880;2001119972;B06000;LESAO CORPORAL;RUA MADRE ISABEL;100;120768;3/3/2001 15:00:00;CIDADAO COMUM;S;;SAO GERALDO;BH;616215.65;799943.84;2879
-2881;2001119982;B03000;AMEACA;RUA JOSE TEIXEIR;187;72995;3/3/2001 15:10:00;CIDADAO COMUM;N;;FLORAMAR;BH;611473.63;806945.13;2880
-2882;2001120095;B06000;LESAO CORPORAL;RUA FRANCISCO MA;445;89447;3/3/2001 16:12:00;CIDADAO COMUM;S;;CH JATOBA IV;BH;600342.66;787631.44;2881
-2883;2001120122;B06000;LESAO CORPORAL;RUA Z;5;29123;3/3/2001 16:30:00;CIDADAO COMUM;N;CAA;CAPITAO EDUARDO;BH;618671.14;807129.45;2882
-2884;2001120124;B03000;AMEACA;RUA DES BRAULIO;20;19917;3/3/2001 16:32:00;POLICIAL MILITAR;S;0;VERA CRUZ;BH;616057.65;798818.48;2883
-2885;2001120159;B03000;AMEACA;RUA RIACHO;5;24927;3/3/2001 16:56:00;CIDADAO COMUM;S;;TAQUARIL;BH;617267.94;797108.52;2884
-2886;2001120165;B06000;LESAO CORPORAL;AV SALAMANCA;175;21480;3/3/2001 17:00:00;CIDADAO COMUM;S;CAFR;JARDIM EUROPA;BH;608328.18;809912.26;2885
-2887;2001120220;B03000;AMEACA;RUA AGUA BOA;87;130567;3/3/2001 17:36:00;CIDADAO COMUM;S;;ARAGUAIA;BH;603962.80;789155.02;2886
-2888;2001120239;B04002;HOMICIDIO CONSUM;RUA AGUA DOCE DO;225;1523;3/3/2001 17:51:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605966.04;807870.45;2887
-2889;2001120287;B06000;LESAO CORPORAL;RUA N;121;37780;3/3/2001 18:28:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608881.39;810032.40;2888
-2890;2001120292;B06000;LESAO CORPORAL;RUA PERNAMBUCO;1077;53463;3/3/2001 18:30:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611502.50;795210.22;2889
-2891;2001120323;B06000;LESAO CORPORAL;RUA CURITIBA;767;19090;3/3/2001 18:49:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610846.44;797113.78;2890
-2892;2001120343;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;853;67682;3/3/2001 19:00:00;INICIATIVA;N;0;BARRO PRETO;BH;611886.69;796078.48;2891
-2893;2001120350;B04001;HOMICIDIO TENTAD;RUA PADRE JULIO ;471;51496;3/3/2001 19:04:00;POLICIAL MILITAR;N;CAA;VERA CRUZ;BH;615410.34;797432.56;2892
-2894;2001120390;B06000;LESAO CORPORAL;RUA ATTILIO DE M;363;111630;3/3/2001 19:31:00;POLICIAL MILITAR;S;0;DIAMANTE;BH;601525.46;789900.12;2893
-2895;2001120433;B03000;AMEACA;RUA CORCOVADO;55;95015;3/3/2001 19:55:00;INICIATIVA;S;0;SARANDI (URCA/BH;BH;603193.23;802354.91;2894
-2896;2001120441;B03000;AMEACA;AV IVAI;1178;80629;3/3/2001 20:02:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604605.18;797950.15;2895
-2897;2001120528;B04001;HOMICIDIO TENTAD;RUA JOAQUIM LEIT;87;64413;3/3/2001 20:55:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606801.78;810035.40;2896
-2898;2001120610;B03000;AMEACA;RUA ATAULFO ALVE;99;6482;3/3/2001 21:37:00;CIDADAO COMUM;S;;TUPI;BH;613317.31;806200.20;2897
-2899;2001120622;B06000;LESAO CORPORAL;RUA GEORGINA PEN;90;31006;3/3/2001 21:42:00;CIDADAO COMUM;S;PX305;SAO LUCAS;BH;614133.28;795705.78;2898
-2900;2001120624;B03000;AMEACA;RUA PADRE JULIO ;48;51496;3/3/2001 21:43:00;CIDADAO COMUM;N;FU;VERA CRUZ;BH;614971.95;797313.30;2899
-2901;2001120629;B03000;AMEACA;RUA REAL MADRID;209;58091;3/3/2001 21:46:00;CIDADAO COMUM;S;;COQUEIROS;BH;603451.26;800201.70;2900
-2902;2001120725;B03000;AMEACA;RUA JOAO GUALBER;1438;37692;3/3/2001 22:41:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612708.10;799896.97;2901
-2903;2001120754;B06000;LESAO CORPORAL;AV FURQUIM WERNE;30;650;3/3/2001 23:04:00;INICIATIVA;N;0;TUPI;BH;613005.07;805799.44;2902
-2904;2001120765;B06000;LESAO CORPORAL;RUA DR BROCHADO;103;23215;3/3/2001 23:11:00;CIDADAO COMUM;N;CA55;VERA CRUZ;BH;615814.74;798592.95;2903
-2905;2001120767;B03000;AMEACA;RUA QUARENTA E S;25;302841;3/3/2001 23:12:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614269.60;805745.84;2904
-2906;2001120841;B06000;LESAO CORPORAL;RUA MARANHAO;1737;43462;3/3/2001 23:54:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612357.28;795160.76;2905
-2907;2001120845;B06000;LESAO CORPORAL;AV SINFRONIO BRO;80;66116;3/3/2001 23:55:00;CIDADAO COMUM;S;;BARREIRO;BH;603269.29;790982.81;2906
-2908;2001120891;B03000;AMEACA;RUA MARIA DO CAR;192;83236;4/3/2001 00:20:00;CIDADAO COMUM;N;;SANTA CRUZ (BARR;BH;603418.68;788956.00;2907
-2909;2001120957;B04001;HOMICIDIO TENTAD;RUA DOS TUPINAMB;908;69940;4/3/2001 00:57:00;INICIATIVA;N;0;CENTRO (BH);BH;610686.75;797442.02;2908
-2910;2001120981;B06000;LESAO CORPORAL;PRACA RAUL SOARE;10;58010;4/3/2001 01:07:00;INICIATIVA;S;0;CENTRO (BH);BH;610534.96;796717.53;2909
-2911;2001120985;B04001;HOMICIDIO TENTAD;RUA DOIS;42;27130;4/3/2001 01:07:00;CIDADAO COMUM;N;0;PAULO SEXTO;BH;616599.36;806788.61;2910
-2912;2001121076;B03000;AMEACA;RUA LUCIA MIGUEL;38;41555;4/3/2001 02:04:00;INICIATIVA;S;0;TUPI;BH;612616.49;805975.44;2911
-2913;2001121110;B06000;LESAO CORPORAL;RUA TOME DE SOUZ;1380;67998;4/3/2001 02:32:00;POLICIAL MILITAR;S;0;LOURDES;BH;611029.66;795329.53;2912
-2914;2001121147;B03000;AMEACA;RUA PIRAI;204;54062;4/3/2001 03:05:00;CIDADAO COMUM;S;FR168;CONCORDIA;BH;610712.96;799396.54;2913
-2915;2001121185;B06000;LESAO CORPORAL;AV GENERAL OLIMP;556;329;4/3/2001 03:34:00;CIDADAO COMUM;N;;ITAPOA;BH;609185.49;806725.82;2914
-2916;2001121201;B03000;AMEACA;AV SEN LEVINDO C;23;14866;4/3/2001 03:47:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;600967.99;789592.58;2915
-2917;2001121205;B06000;LESAO CORPORAL;RUA PEDRO LUIZ D;289;100841;4/3/2001 03:51:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611454.51;807362.84;2916
-2918;2001121213;B06000;LESAO CORPORAL;RUA BADARO JUNIO;38;7532;4/3/2001 04:01:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612064.33;803545.79;2917
-2919;2001121256;B04001;HOMICIDIO TENTAD;AV GETULIO VARGA;1238;81256;4/3/2001 04:44:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611530.70;795136.03;2918
-2920;2001121281;B06000;LESAO CORPORAL;RUA PARA DE MINA;972;52070;4/3/2001 05:03:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605685.93;797784.68;2919
-2921;2001121406;B02000;RIXA;AV SARAMENHA;303;64007;4/3/2001 08:01:00;CIDADAO COMUM;N;;FLORAMAR;BH;612061.08;805691.75;2920
-2922;2001121429;B06000;LESAO CORPORAL;RUA RAMIRO SIQUE;66;128858;4/3/2001 08:20:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617650.40;797388.81;2921
-2923;2001121431;B06000;LESAO CORPORAL;RUA B;160;47637;4/3/2001 08:12:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601142.40;788544.37;2922
-2924;2001121452;B06000;LESAO CORPORAL;RUA DOUTOR JULIO;85;112315;4/3/2001 08:42:00;CIDADAO COMUM;N;CA;OURO PRETO;BH;605834.18;802796.95;2923
-2925;2001121453;B03000;AMEACA;RUA NELSON SOARE;157;47450;4/3/2001 08:42:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604257.72;796952.69;2924
-2926;2001121563;B03000;AMEACA;RUA OURO BRANCO;124;50701;4/3/2001 10:22:00;CIDADAO COMUM;S;;POMPEIA;BH;614764.54;797598.86;2925
-2927;2001121583;B03000;AMEACA;RUA VERA LUCIA;226;71520;4/3/2001 10:35:00;CIDADAO COMUM;S;0;SINIMBU;BH;606703.86;808030.07;2926
-2928;2001121612;B03000;AMEACA;RUA GENTIOS;1350;30983;4/3/2001 10:58:00;CIDADAO COMUM;S;0;LUXEMBURGO;BH;608905.13;793585.28;2927
-2929;2001121653;B03000;AMEACA;RUA ARANTINA;274;58697;4/3/2001 11:29:00;CIDADAO COMUM;S;CAA;MINASLANDIA;BH;612171.98;804515.39;2928
-2930;2001121663;B03000;AMEACA;RUA DESEMBARGADO;601;19986;4/3/2001 11:42:00;CIDADAO COMUM;S;;SERRA;BH;613943.78;794925.46;2929
-2931;2001121679;B09000;ABANDONO DE INCA;AV AMINTAS JAQUE;1100;52546;4/3/2001 11:56:00;CIDADAO COMUM;S;;COQUEIROS;BH;602729.07;799162.42;2930
-2932;2001121693;B06000;LESAO CORPORAL;RUA COPERNICO PI;15;6630;4/3/2001 12:04:00;CIDADAO COMUM;S;;SANTO ANTONIO;BH;610369.73;793668.93;2931
-2933;2001121780;B04001;HOMICIDIO TENTAD;RUA EDMAR COLINI;348;104638;4/3/2001 13:23:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;605882.85;811488.28;2932
-2934;2001121829;B06000;LESAO CORPORAL;RUA RIBATEJO;112;63058;4/3/2001 13:56:00;INICIATIVA;N;0;SAO FRANCISCO;BH;609796.03;802014.20;2933
-2935;2001121839;B03000;AMEACA;RUA DES TEOFILO;55;20015;4/3/2001 14:07:00;CIDADAO COMUM;S;;PEDRO SEGUNDO;BH;608657.91;798601.08;2934
-2936;2001121845;B06000;LESAO CORPORAL;RUA DOS TUPINAMB;688;69940;4/3/2001 14:11:00;INICIATIVA;N;0;CENTRO BH;BH;610916.87;797380.59;2935
-2937;2001121850;B03000;AMEACA;RUA PORTO SEGURO;480;60595;4/3/2001 14:12:00;CIDADAO COMUM;S;;NOVA VISTA;BH;614968.49;800704.88;2936
-2938;2001121910;B06000;LESAO CORPORAL;RUA MARIA AMBROS;241;86206;4/3/2001 15:04:00;CIDADAO COMUM;N;;VILA FREI LEOPOL;BH;611121.44;810097.63;2937
-2939;2001121919;B04002;HOMICIDIO CONSUM;RUA DOS INDUSTRI;225;34480;4/3/2001 15:12:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;604608.18;792459.57;2938
-2940;2001121989;B04001;HOMICIDIO TENTAD;VIA PASSAGEM PED;14;35744;4/3/2001 15:52:00;CIDADAO COMUM;N;0;CAPITAO EDUARDO;BH;618468.35;807122.91;2939
-2941;2001121995;B06000;LESAO CORPORAL;RUA JULIO CESAR;245;39483;4/3/2001 15:55:00;CIDADAO COMUM;N;0;NAZARE;BH;615538.35;804353.02;2940
-2942;2001122058;B03000;AMEACA;AV CACHOEIRINHA;1000;11250;4/3/2001 16:35:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610539.92;801314.88;2941
-2943;2001122096;B03000;AMEACA;RUA JATAI;1351;37116;4/3/2001 17:01:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611142.78;799513.14;2942
-2944;2001122213;B06000;LESAO CORPORAL;RUA CORNELIO CER;16;17417;4/3/2001 18:07:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606458.19;797838.52;2943
-2945;2001122224;B03000;AMEACA;RUA AMANDO COUTO;230;3037;4/3/2001 18:12:00;CIDADAO COMUM;S;0;SAO TOMAZ;BH;609922.73;805494.21;2944
-2946;2001122232;B03000;AMEACA;AV PRESIDENTE AN;4013;4461;4/3/2001 18:18:00;POLICIAL MILITAR;N;0;SAO FRANCISCO;BH;609536.57;802154.10;2945
-2947;2001122240;B03000;AMEACA;RUA BRISTOL;27;97543;4/3/2001 18:20:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;607783.31;810421.22;2946
-2948;2001122248;B03000;AMEACA;RUA DOUTOR CRIST;5800;55598;4/3/2001 18:32:00;CIDADAO COMUM;N;;ARAGUAIA;BH;605425.77;789436.02;2947
-2949;2001122273;B04002;HOMICIDIO CONSUM;RUA CORONEL JOAQ;400;17864;4/3/2001 18:49:00;CIDADAO COMUM;N;;HELIOPOLIS;BH;610982.98;806034.03;2948
-2950;2001122323;B03000;AMEACA;RUA TRINTA;102;106141;4/3/2001 19:17:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;608088.16;810913.29;2949
-2951;2001122343;B03000;AMEACA;RUA BONINAS;265;94863;4/3/2001 19:31:00;CIDADAO COMUM;S;;LINDEIA;BH;599815.61;790501.68;2950
-2952;2001122369;B06000;LESAO CORPORAL;RUA VEREADOR ANT;41;93602;4/3/2001 19:49:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;601665.13;786440.78;2951
-2953;2001122371;B03000;AMEACA;RUA MANOEL ALEXA;300;1580;4/3/2001 19:49:00;INICIATIVA;S;0;SAO PAULO;BH;612667.88;802769.94;2952
-2954;2001122471;B03000;AMEACA;RUA MANOEL PASSO;151;43160;4/3/2001 20:51:00;CIDADAO COMUM;S;0;VILA HUMAITA;BH;610414.87;801554.81;2953
-2955;2001122474;B04001;HOMICIDIO TENTAD;RUA SOFRE;42;85588;4/3/2001 20:53:00;CIDADAO COMUM;S;0;GOIANIA;BH;615466.95;802363.54;2954
-2956;2001122500;B06000;LESAO CORPORAL;AV ALFREDO CARAM;310;2277;4/3/2001 21:04:00;CIDADAO COMUM;S;;SAO LUIZ;BH;607189.83;803094.77;2955
-2957;2001122521;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;725;51657;4/3/2001 21:11:00;INICIATIVA;N;0;CANDELARIA;BH;609314.30;808555.78;2956
-2958;2001122536;B04001;HOMICIDIO TENTAD;RUA SACRAMENTO;170;59822;4/3/2001 21:20:00;CIDADAO COMUM;N;AP401;SERRA;BH;613713.64;795025.29;2957
-2959;2001122557;B06000;LESAO CORPORAL;RUA IRACI SANSAO;140;78443;4/3/2001 21:36:00;CIDADAO COMUM;S;;VILA PINHO;BH;602369.97;787512.60;2958
-2960;2001122599;B06000;LESAO CORPORAL;RUA VEREADOR ANT;81;93602;4/3/2001 21:59:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;601901.25;786466.11;2959
-2961;2001122607;B06000;LESAO CORPORAL;RUA JURACY CAMAR;304;39720;4/3/2001 22:05:00;CIDADAO COMUM;S;0;TUPI;BH;613245.23;805753.50;2960
-2962;2001122628;B06000;LESAO CORPORAL;RUA BARAO DO MON;757;63653;4/3/2001 22:18:00;CIDADAO COMUM;S;;CARDOSO;BH;604068.44;787904.09;2961
-2963;2001122641;B03000;AMEACA;RODOVIA BRASILIA;190;124400;4/3/2001 22:26:00;CIDADAO COMUM;S;0;SAO BENEDITO (SL;SL;610627.87;810496.47;2962
-2964;2001122646;B03000;AMEACA;RUA MEDEIA;628;64426;4/3/2001 22:32:00;CIDADAO COMUM;S;;VILA CAPRI;BH;608913.64;809686.79;2963
-2965;2001122660;B03000;AMEACA;RUA VICENTE SOLL;86;24781;4/3/2001 22:43:00;CIDADAO COMUM;S;CAA;NOVA GAMELEIRA;BH;605568.33;794890.84;2964
-2966;2001122671;B04001;HOMICIDIO TENTAD;RUA BACO;485;85461;4/3/2001 22:51:00;CIDADAO COMUM;N;;VILA CAPRI;BH;608762.35;809576.72;2965
-2967;2001122699;B03000;AMEACA;RUA DOS MOICANOS;315;92741;4/3/2001 23:11:00;CIDADAO COMUM;N;0;PILAR;BH;607410.73;788295.46;2966
-2968;2001122720;B06000;LESAO CORPORAL;RUA DOS TUPIS;751;69965;4/3/2001 23:25:00;INICIATIVA;N;PPM.1;CENTRO (BH);BH;610541.84;797015.87;2967
-2969;2001122815;B03000;AMEACA;RUA ALCINDO VIEI;150;1968;5/3/2001 00:30:00;CIDADAO COMUM;N;;BARREIRO;BH;602801.65;791079.84;2968
-2970;2001122903;B04002;HOMICIDIO CONSUM;RUA ANTONIO MARI;180;103420;5/3/2001 01:31:00;CIDADAO COMUM;N;;BELMONT;BH;615617.05;805562.96;2969
-2971;2001122936;B06000;LESAO CORPORAL;RUA MAFRA;538;66488;5/3/2001 02:19:00;CIDADAO COMUM;S;;COQUEIROS;BH;602417.29;798939.66;2970
-2972;2001122943;B06000;LESAO CORPORAL;AV PRESIDENTE AN;400;4461;5/3/2001 02:27:00;CIDADAO COMUM;N;;LAGOINHA;BH;610659.00;798426.12;2971
-2973;2001123277;B03000;AMEACA;RUA SAO SALVADOR;46;63612;5/3/2001 09:00:00;CIDADAO COMUM;S;;BONFIM;BH;610151.37;797963.59;2972
-2974;2001123527;B03000;AMEACA;RUA SANTO AGOSTI;1271;61557;5/3/2001 12:07:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613648.90;799370.40;2973
-2975;2001123609;B04002;HOMICIDIO CONSUM;RUA SAO SIMAO;200;92161;5/3/2001 13:20:00;CIDADAO COMUM;N;;ARAGUAIA;BH;605420.44;789857.68;2974
-2976;2001123757;B03000;AMEACA;AV GENERAL OLIMP;604;329;5/3/2001 15:04:00;CIDADAO COMUM;S;;ITAPOA;BH;609214.29;806688.46;2975
-2977;2001123814;B06000;LESAO CORPORAL;RUA ARIOLINO ARI;159;85811;5/3/2001 15:36:00;CIDADAO COMUM;N;;SERRA VERDE;BH;609207.39;810119.05;2976
-2978;2001123894;B03000;AMEACA;RUA PADRE FELIPE;11;51339;5/3/2001 16:18:00;CIDADAO COMUM;N;0;SANTA CRUZ;BH;610690.00;802397.32;2977
-2979;2001123898;B03000;AMEACA;RUA JOAO ANTONIO;160;122054;5/3/2001 16:19:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607884.02;810802.11;2978
-2980;2001123903;B03000;AMEACA;RUA JOSE GONCALV;127;99901;5/3/2001 16:28:00;CIDADAO COMUM;S;NR/EXATO: 129;MARIA GORETTI;BH;614573.12;802978.70;2979
-2981;2001123907;B03000;AMEACA;RUA PRIMEIRO DE ;35;23978;5/3/2001 16:31:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617547.71;797272.25;2980
-2982;2001124154;B06000;LESAO CORPORAL;RUA PROFESSOR RA;276;55673;5/3/2001 18:50:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;606499.51;797431.02;2981
-2983;2001124239;B03000;AMEACA;RUA SAO PEDRO;230;96046;5/3/2001 19:31:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614553.53;803184.78;2982
-2984;2001124243;B06000;LESAO CORPORAL;RUA MARIA;75;43737;5/3/2001 19:33:00;CIDADAO COMUM;N;;VILA MARAVILHAS;BH;603288.12;795483.45;2983
-2985;2001124249;B06000;LESAO CORPORAL;RUA JUIZ MILTON ;165;78342;5/3/2001 19:37:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;615036.21;806160.82;2984
-2986;2001124308;B06000;LESAO CORPORAL;RUA ERNESTO AUST;65;25784;5/3/2001 20:17:00;CIDADAO COMUM;S;;BOA VISTA;BH;614683.32;799433.40;2985
-2987;2001124315;B06000;LESAO CORPORAL;RUA DR BROCHADO;931;23215;5/3/2001 20:20:00;CIDADAO COMUM;S;CAFU;VERA CRUZ;BH;615979.15;797788.31;2986
-2988;2001124317;B04001;HOMICIDIO TENTAD;AV DOS ANDRADAS;5455;3761;5/3/2001 20:21:00;CIDADAO COMUM;S;0;ESPLANADA;BH;615393.94;798623.14;2987
-2989;2001124326;B06000;LESAO CORPORAL;RUA PARA DE MINA;1170;52070;5/3/2001 20:26:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605500.40;797813.06;2988
-2990;2001124344;B04001;HOMICIDIO TENTAD;RUA DAS TABOADAS;10;300190;5/3/2001 20:31:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608781.80;807946.76;2989
-2991;2001124358;B04001;HOMICIDIO TENTAD;RUA TEBAS;1215;67090;5/3/2001 20:39:00;CIDADAO COMUM;S;CSB;VERA CRUZ;BH;616361.69;798406.61;2990
-2992;2001124364;B09000;ABANDONO DE INCA;RUA STA MARIA;475;61024;5/3/2001 20:43:00;POLICIAL MILITAR;N;- P/2 16 BPM;SAO MARCOS;BH;614312.59;802504.64;2991
-2993;2001124445;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;10677;17228;5/3/2001 21:32:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609554.35;797409.14;2992
-2994;2001124605;B03000;AMEACA;RUA BOTAFOGO;102;10257;5/3/2001 23:28:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610941.52;804934.38;2993
-2995;2001124767;B03000;AMEACA;RUA DOS GOITACAZ;1203;31400;6/3/2001 03:05:00;CIDADAO COMUM;N;;BARRO PRETO;BH;610116.39;796977.69;2994
-2996;2001124803;B04001;HOMICIDIO TENTAD;PRACA RUI BARBOS;10;59558;6/3/2001 04:19:00;INICIATIVA;N;0;CENTRO BH;BH;611488.17;797485.82;2995
-2997;2001124923;B03000;AMEACA;RUA CORNELIO CER;306;17417;6/3/2001 07:47:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;606165.11;797879.98;2996
-2998;2001125042;B05000;SEQUESTRO E CARC;RUA JOAO BATISTA;10;97745;6/3/2001 09:16:00;CIDADAO COMUM;N;0;DOM SILVERIO;BH;614734.92;804019.88;2997
-2999;2001125140;B03000;AMEACA;RUA FRANCISCO AL;70;29325;6/3/2001 10:04:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;606448.55;805403.41;2998
-3000;2001125232;B03000;AMEACA;RUA CASTIGLIANO;708;14056;6/3/2001 11:04:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607285.74;797447.96;2999
-3001;2001125299;B03000;AMEACA;RUA IRACEMA;96;34896;6/3/2001 11:58:00;CIDADAO COMUM;N;;VILA HUMAITA;BH;610308.42;801607.23;3000
-3002;2001125347;B03000;AMEACA;RUA NAZARE;18;25771;6/3/2001 12:22:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617252.57;797798.96;3001
-3003;2001125399;B06000;LESAO CORPORAL;RUA ANTONIO JORG;92;100551;6/3/2001 13:04:00;CIDADAO COMUM;S;;CEU AZUL;BH;603811.20;807646.41;3002
-3004;2001125498;B08000;VIOLACAO DE DOMI;RUA ANTONIO SILV;141;87108;6/3/2001 14:14:00;CIDADAO COMUM;N;NUMERO CORRETO 1;DA LAGOA;BH;604758.70;808936.59;3003
-3005;2001125518;B03000;AMEACA;RUA CRUZEIRO DO ;1031;75168;6/3/2001 14:36:00;CIDADAO COMUM;N;;COQUEIROS;BH;602379.47;799714.08;3004
-3006;2001125636;B03000;AMEACA;RUA MARIA DA CON;123;107881;6/3/2001 15:51:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606501.70;811563.34;3005
-3007;2001125736;B06000;LESAO CORPORAL;AV BARAO HOMEM D;797;7936;6/3/2001 16:39:00;CIDADAO COMUM;S;0;JARDIM AMERICA;BH;607684.12;794788.83;3006
-3008;2001125762;B06000;LESAO CORPORAL;RUA RUBENS DE SO;631;63060;6/3/2001 16:52:00;CIDADAO COMUM;S;;AARAO REIS;BH;612567.12;805018.45;3007
-3009;2001125868;B03000;AMEACA;AV CENTRAL;1229;14812;6/3/2001 17:56:00;CIDADAO COMUM;S;LJ03;COPACABANA;BH;605957.82;807450.11;3008
-3010;2001125909;B06000;LESAO CORPORAL;AV SILVIANO BRAN;2099;66002;6/3/2001 18:25:00;CIDADAO COMUM;S;LJ02;HORTO;BH;613305.97;798057.81;3009
-3011;2001125912;B03000;AMEACA;RUA JOVINO RODRI;244;85083;6/3/2001 18:26:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606548.35;810771.26;3010
-3012;2001125923;B06000;LESAO CORPORAL;RUA JASSAPE;255;37103;6/3/2001 18:34:00;CIDADAO COMUM;N;;VILA MARAVILHAS;BH;603073.29;795519.68;3011
-3013;2001125940;B03000;AMEACA;RUA FERNANDO CAN;33;80818;6/3/2001 18:42:00;CIDADAO COMUM;N;FU;ESTRELA DO ORIEN;BH;605862.69;791985.49;3012
-3014;2001126007;B03000;AMEACA;RUA JOSE BENJAMI;36;95;6/3/2001 19:21:00;INICIATIVA;S;0;PLANALTO;BH;610484.66;806769.49;3013
-3015;2001126043;B04001;HOMICIDIO TENTAD;RUA INGLATERRA;138;34552;6/3/2001 19:45:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;606114.00;807514.48;3014
-3016;2001126104;B03000;AMEACA;RUA JANAUBA;75;36891;6/3/2001 20:23:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604696.85;793369.28;3015
-3017;2001126109;B03000;AMEACA;RUA ITAPETINGA;53;35817;6/3/2001 20:21:00;CIDADAO COMUM;S;0;PIRATININGA;BH;605923.68;809900.61;3016
-3018;2001126112;B03000;AMEACA;RUA MALVINA PALH;70;96714;6/3/2001 20:25:00;CIDADAO COMUM;S;;SERRA VERDE;BH;609317.97;810139.24;3017
-3019;2001126128;B04001;HOMICIDIO TENTAD;RUA DOMINGOS FRA;10;103244;6/3/2001 20:40:00;CIDADAO COMUM;N;;OURO PRETO;BH;606343.45;800732.42;3018
-3020;2001126136;B06000;LESAO CORPORAL;RUA CINQUENTA E ;6;33900;6/3/2001 20:42:00;CIDADAO COMUM;S;ZZ;CONJUNTO FELICID;BH;612556.58;806824.33;3019
-3021;2001126176;B03000;AMEACA;RUA DELEGADO PAU;180;90469;6/3/2001 21:11:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614606.28;802323.69;3020
-3022;2001126204;B09000;ABANDONO DE INCA;RUA BIMBARRA;326;9641;6/3/2001 21:32:00;CIDADAO COMUM;S;0;CALAFATE;BH;607195.50;796594.64;3021
-3023;2001126303;B06000;LESAO CORPORAL;RUA SILVA RESEND;170;28511;6/3/2001 22:47:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606058.40;799084.79;3022
-3024;2001126305;B03000;AMEACA;RUA ANTONIO ORLI;559;55907;6/3/2001 22:50:00;CIDADAO COMUM;S;NUMERO CORRETO 5;SAO JOAO BATISTA;BH;608243.75;807563.95;3023
-3025;2001126315;B08000;VIOLACAO DE DOMI;RUA BABACU;40;126925;6/3/2001 22:58:00;CIDADAO COMUM;N;0;OLARIA;BH;601691.41;789264.08;3024
-3026;2001126322;B04001;HOMICIDIO TENTAD;RUA LAJEDO;410;130034;6/3/2001 23:02:00;CIDADAO COMUM;N;;SAO GABRIEL;BH;614464.85;804546.93;3025
-3027;2001126334;B06000;LESAO CORPORAL;RUA IMBARE;221;82491;6/3/2001 23:06:00;INICIATIVA;N;0;GUARANI;BH;612018.59;805507.76;3026
-3028;2001126345;B03000;AMEACA;RUA FLOR BRANCA;39;28509;6/3/2001 23:12:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;605828.36;799059.89;3027
-3029;2001126385;B06000;LESAO CORPORAL;RUA PADRE ESPECH;42;51281;6/3/2001 23:36:00;CIDADAO COMUM;N;;GLORIA;BH;604236.49;798539.26;3028
-3030;2001126390;B06000;LESAO CORPORAL;RUA JOSIAS CASIM;161;63814;6/3/2001 23:33:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;613459.62;798877.69;3029
-3031;2001126398;B06000;LESAO CORPORAL;RUA OSCAR TROMPO;1396;50452;6/3/2001 23:44:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608530.75;794473.15;3030
-3032;2001126428;B06000;LESAO CORPORAL;RUA DOS CARIJOS;930;81243;6/3/2001 23:57:00;INICIATIVA;S;0;CENTRO BH;BH;610563.81;797327.45;3031
-3033;2001126457;B03000;AMEACA;RUA MONTANA;92;121745;7/3/2001 00:20:00;CIDADAO COMUM;N;;COQUEIROS;BH;603179.87;800404.09;3032
-3034;2001126547;B03000;AMEACA;PRACA RAUL SOARE;423;58010;7/3/2001 01:38:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610510.71;796848.26;3033
-3035;2001126634;B03000;AMEACA;RUA FLOR BRANCA;33;28509;7/3/2001 03:33:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;605816.65;799060.78;3034
-3036;2001126760;B06000;LESAO CORPORAL;RUA EXPEDICIONAR;12;31627;7/3/2001 07:24:00;CIDADAO COMUM;N;0;MARIA GORETTI;BH;614326.24;803386.64;3035
-3037;2001126795;B06000;LESAO CORPORAL;RUA CURITIBA;580;19090;7/3/2001 08:08:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610868.49;797331.11;3036
-3038;2001126866;B03000;AMEACA;RUA DO LAGO;325;40161;7/3/2001 08:58:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614131.46;802654.70;3037
-3039;2001126874;B03000;AMEACA;RUA WAGNER BUENO;406;86492;7/3/2001 09:06:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611620.07;807780.87;3038
-3040;2001126977;B03000;AMEACA;RUA ESPINOSA;987;26024;7/3/2001 10:06:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608773.85;797707.87;3039
-3041;2001127041;B03000;AMEACA;RUA HERCULANO DE;190;33130;7/3/2001 10:45:00;CIDADAO COMUM;S;AP301;GUTIERREZ;BH;609428.58;795499.24;3040
-3042;2001127077;B05000;SEQUESTRO E CARC;RUA HELGA TAVEIR;67;100693;7/3/2001 11:08:00;INICIATIVA;N;0;CEU AZUL;BH;603759.90;807691.36;3041
-3043;2001127098;B03000;AMEACA;RUA MARIA AMELIA;33;119024;7/3/2001 11:23:00;CIDADAO COMUM;S;0;TEIXEIRA DIAS;BH;602594.03;789712.61;3042
-3044;2001127124;B03000;AMEACA;RUA YUCATAN;100;36302;7/3/2001 11:38:00;CIDADAO COMUM;N;0;SAO PEDRO;BH;611188.45;793833.06;3043
-3045;2001127148;B04002;HOMICIDIO CONSUM;RUA BRASILIANITA;150;113894;7/3/2001 11:51:00;CIDADAO COMUM;N;;CANDELARIA;BH;607690.06;809275.37;3044
-3046;2001127201;B03000;AMEACA;RUA TABATINGA;208;66680;7/3/2001 12:21:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604637.99;796344.27;3045
-3047;2001127247;B03000;AMEACA;RUA TAMBORIL;596;66793;7/3/2001 12:55:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611198.91;799313.87;3046
-3048;2001127289;B03000;AMEACA;RUA MARIA AMELIA;33;119024;7/3/2001 13:30:00;CIDADAO COMUM;N;;TEIXEIRA DIAS;BH;602594.03;789712.61;3047
-3049;2001127360;B03000;AMEACA;AV FRANCISCO SAL;898;29669;7/3/2001 14:27:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612234.65;796788.78;3048
-3050;2001127377;B03000;AMEACA;PRACA SANTO ANTO;125;61761;7/3/2001 14:36:00;CIDADAO COMUM;S;;JARAGUA;BH;609416.64;804336.33;3049
-3051;2001127405;B03000;AMEACA;RUA PURUS;394;55819;7/3/2001 14:59:00;CIDADAO COMUM;S;0;CONCORDIA;BH;610938.91;799271.58;3050
-3052;2001127436;B03000;AMEACA;AV DOM JOSE GASP;14;22339;7/3/2001 15:18:00;CIDADAO COMUM;S;0;CORACAO EUCARIST;BH;606024.82;797122.38;3051
-3053;2001127482;B06000;LESAO CORPORAL;AV FRANCISCO SAL;263;29669;7/3/2001 15:41:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611966.14;797352.42;3052
-3054;2001127528;B06000;LESAO CORPORAL;RUA CAMPINA VERD;312;12110;7/3/2001 16:12:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606172.49;794445.71;3053
-3055;2001127548;B06000;LESAO CORPORAL;RUA SEMIRAMIS;160;64656;7/3/2001 16:22:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;605337.72;789588.60;3054
-3056;2001127572;B06000;LESAO CORPORAL;RUA GALDINO;4;75590;7/3/2001 16:37:00;CIDADAO COMUM;N;0;LINDEIA;BH;599722.92;790847.61;3055
-3057;2001127591;B06000;LESAO CORPORAL;BECO SAO CRISTOV;5;301295;7/3/2001 16:47:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610556.36;793177.37;3056
-3058;2001127606;B06000;LESAO CORPORAL;RUA LUIZ LOPES;82;94431;7/3/2001 16:57:00;CIDADAO COMUM;S;;OURO PRETO;BH;606237.42;801258.18;3057
-3059;2001127633;B06000;LESAO CORPORAL;RUA MUQUICABA;370;65343;7/3/2001 17:12:00;CIDADAO COMUM;S;;GLORIA;BH;602088.07;798145.49;3058
-3060;2001127638;B06000;LESAO CORPORAL;RUA PROFESSOR EU;110;91418;7/3/2001 17:15:00;CIDADAO COMUM;S;;BURITIS;BH;607528.16;791585.70;3059
-3061;2001127708;B06000;LESAO CORPORAL;RUA COLUNA PREST;405;16354;7/3/2001 17:58:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612497.26;803910.18;3060
-3062;2001127720;B06000;LESAO CORPORAL;RUA MANOEL PASSO;369;43160;7/3/2001 18:04:00;CIDADAO COMUM;S;0;VILA HUMAITA;BH;610429.05;801721.18;3061
-3063;2001127743;B06000;LESAO CORPORAL;AV BELEM;320;8913;7/3/2001 18:15:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;614947.36;797209.43;3062
-3064;2001127891;B03000;AMEACA;RUA DONA CARMEM;582;22820;7/3/2001 19:30:00;CIDADAO COMUM;N;0;SARANDI (URCA/BH;BH;603959.19;802338.10;3063
-3065;2001127929;B03000;AMEACA;RUA FICUS;125;28310;7/3/2001 19:46:00;CIDADAO COMUM;S;;INCONFIDENCIA;BH;605124.31;798223.07;3064
-3066;2001128029;B06000;LESAO CORPORAL;RUA ARROJADO LIS;120;6076;7/3/2001 20:54:00;CIDADAO COMUM;N;;INCONFIDENCIA;BH;605153.45;798173.45;3065
-3067;2001128053;B03000;AMEACA;RUA JESUINA FERR;167;119011;7/3/2001 21:06:00;INICIATIVA;S;0;TEIXEIRA DIAS;BH;602856.34;789660.64;3066
-3068;2001128088;B06000;LESAO CORPORAL;AV PORTUGAL;4984;54816;7/3/2001 21:26:00;CIDADAO COMUM;S;;ITAPOA;BH;609353.03;805409.84;3067
-3069;2001128093;B03000;AMEACA;RUA MARTINS SOAR;740;45049;7/3/2001 21:28:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604912.80;792944.99;3068
-3070;2001128121;B03000;AMEACA;AV BERNARDO VASC;1252;9411;7/3/2001 21:41:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610951.68;801058.28;3069
-3071;2001128132;B09000;ABANDONO DE INCA;RUA DOS TABAIARE;42;66649;7/3/2001 21:46:00;CIDADAO COMUM;S;202;FLORESTA;BH;611831.98;797292.90;3070
-3072;2001128236;B03000;AMEACA;RUA FLOR DE MAIO;174;300399;7/3/2001 22:52:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614434.55;794786.90;3071
-3073;2001128265;B06000;LESAO CORPORAL;AV BIAS FORTES;722;9553;7/3/2001 23:10:00;INICIATIVA;N;0;LOURDES;BH;610734.57;796310.95;3072
-3074;2001128300;B06000;LESAO CORPORAL;RUA SAO MANOEL;94;63335;7/3/2001 23:26:00;CIDADAO COMUM;S;;FLORESTA;BH;611886.96;798345.12;3073
-3075;2001128303;B06000;LESAO CORPORAL;RUA DES RIBEIRO ;166;20002;7/3/2001 23:29:00;INICIATIVA;N;0;BARREIRO;BH;603033.13;791206.79;3074
-3076;2001128309;B03000;AMEACA;RUA MONTE DAS OL;65;99508;7/3/2001 23:31:00;CIDADAO COMUM;S;;OLARIA;BH;601547.09;789148.77;3075
-3077;2001128388;B04002;HOMICIDIO CONSUM;BECO CATARINO;430;301514;8/3/2001 00:23:00;CIDADAO COMUM;N;;SAO LUCAS;BH;613394.52;795818.55;3076
-3078;2001128417;B06000;LESAO CORPORAL;RUA QUINANTE;231;57234;8/3/2001 00:43:00;INICIATIVA;N;0;MINASCAIXA;BH;609661.87;808945.92;3077
-3079;2001128420;B06000;LESAO CORPORAL;RUA L;125;78787;8/3/2001 00:48:00;CIDADAO COMUM;S;0;CH JATOBA IV;BH;600586.54;787827.43;3078
-3080;2001128426;B03000;AMEACA;RUA ITAPETINGA;2228;35804;8/3/2001 00:46:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610220.10;801479.69;3079
-3081;2001128460;B03000;AMEACA;RUA 51;239;302847;8/3/2001 01:30:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614103.15;805588.83;3080
-3082;2001128522;B03000;AMEACA;RUA FLORIANO PEI;5;29022;8/3/2001 02:56:00;CIDADAO COMUM;N;C;SAO GABRIEL;BH;613239.65;804432.77;3081
-3083;2001128528;B06000;LESAO CORPORAL;RUA CURITIBA;792;19090;8/3/2001 03:03:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610814.12;797122.12;3082
-3084;2001128544;B03000;AMEACA;RUA JACUI;3489;36734;8/3/2001 03:31:00;CIDADAO COMUM;S;;IPIRANGA;BH;611609.85;801193.35;3083
-3085;2001128610;B03000;AMEACA;RUA JACUI;3493;36734;8/3/2001 05:50:00;INICIATIVA;N;0;IPIRANGA;BH;611618.36;801205.40;3084
-3086;2001128617;B06000;LESAO CORPORAL;RUA JULIO MESQUI;33;81849;8/3/2001 06:01:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599314.94;788609.30;3085
-3087;2001128793;B03000;AMEACA;RUA STA APOLONIA;120;60352;8/3/2001 08:51:00;CIDADAO COMUM;N;0;DOM JOAQUIM;BH;614079.87;802000.80;3086
-3088;2001128821;B03000;AMEACA;RUA SALGUEIRO;48;3226;8/3/2001 09:13:00;CIDADAO COMUM;S;0;IPIRANGA;BH;611541.64;800461.93;3087
-3089;2001128825;B06000;LESAO CORPORAL;RUA PARAIBA;330;52170;8/3/2001 09:16:00;CIDADAO COMUM;N;AN19;FUNCIONARIOS;BH;611835.74;796063.52;3088
-3090;2001128859;B03000;AMEACA;RUA BERTOPOLIS;169;41873;8/3/2001 09:44:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612404.11;803929.57;3089
-3091;2001128883;B06000;LESAO CORPORAL;ALAMEDA DAS LATH;1200;84572;8/3/2001 10:00:00;CIDADAO COMUM;N;;SAO JOSE;BH;608808.73;803906.61;3090
-3092;2001128942;B03000;AMEACA;RUA ITABIRA;493;35237;8/3/2001 10:40:00;CIDADAO COMUM;S;CAP;LAGOINHA;BH;610931.11;798451.36;3091
-3093;2001128957;B03000;AMEACA;RUA JOSE AMARAL;155;80584;8/3/2001 10:53:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606532.81;801594.14;3092
-3094;2001128991;B03000;AMEACA;RUA DOS NAMORADO;57;48210;8/3/2001 11:19:00;CIDADAO COMUM;S;LJB;PIRAJA;BH;614090.68;802963.39;3093
-3095;2001128994;B06000;LESAO CORPORAL;RUA MARTIM DE CA;256;44944;8/3/2001 11:20:00;CIDADAO COMUM;N;0;SANTO AGOSTINHO;BH;609741.45;795972.83;3094
-3096;2001129021;B06000;LESAO CORPORAL;RUA CHOPOTO;490;80180;8/3/2001 11:37:00;CIDADAO COMUM;N;;PINDORAMA;BH;601788.76;797759.65;3095
-3097;2001129204;B06000;LESAO CORPORAL;RUA SANTO AGOSTI;1381;61557;8/3/2001 13:46:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613758.52;799384.75;3096
-3098;2001129302;B03000;AMEACA;RUA CARMO DA MAT;357;13661;8/3/2001 15:00:00;CIDADAO COMUM;S;;VERA CRUZ;BH;615362.69;797800.57;3097
-3099;2001129362;B06000;LESAO CORPORAL;RUA CORCOVADO;1720;14894;8/3/2001 15:47:00;CIDADAO COMUM;N;;SAO DOMINGOS;BH;607813.13;793342.15;3098
-3100;2001129373;B04001;HOMICIDIO TENTAD;RUA DOUTOR CRIST;312;55598;8/3/2001 15:53:00;CIDADAO COMUM;N;0;ARAGUAIA;BH;604751.25;789297.85;3099
-3101;2001129425;B06000;LESAO CORPORAL;RUA CINQUENTA E ;45;106416;8/3/2001 16:26:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;608342.42;811076.87;3100
-3102;2001129466;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;8/3/2001 16:47:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605855.99;798012.24;3101
-3103;2001129508;B03000;AMEACA;RUA JOANESIA;10;37406;8/3/2001 17:13:00;INICIATIVA;S;0;SERRA;BH;612962.48;795111.42;3102
-3104;2001129512;B03000;AMEACA;RUA MONTEIRO LOB;92;46590;8/3/2001 17:16:00;CIDADAO COMUM;S;;PROFESSOR WASHIN;IB;598851.29;789377.12;3103
-3105;2001129520;B03000;AMEACA;RUA MARIA EUSTAQ;106;69460;8/3/2001 17:19:00;INICIATIVA;S;0;FLORAMAR;BH;611579.16;806666.38;3104
-3106;2001129599;B06000;LESAO CORPORAL;RUA DAVID NASSER;587;68382;8/3/2001 18:10:00;CIDADAO COMUM;N;0;PLANALTO;BH;609458.50;806627.41;3105
-3107;2001129625;B06000;LESAO CORPORAL;RUA EXPEDITO FLA;345;84847;8/3/2001 18:22:00;INICIATIVA;S;0;DA LAGOA;BH;604545.28;809198.83;3106
-3108;2001129662;B06000;LESAO CORPORAL;RUA DO LEBLON;330;40612;8/3/2001 18:45:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602981.47;802543.20;3107
-3109;2001129685;B04002;HOMICIDIO CONSUM;RUA CINQUENTA;318;302845;8/3/2001 18:54:00;CIDADAO COMUM;S;0;TUPI;BH;614150.27;805475.49;3108
-3110;2001129778;B09000;ABANDONO DE INCA;ALAMEDA CHICO ME;37;96018;8/3/2001 19:34:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601335.72;788785.36;3109
-3111;2001129840;B05000;SEQUESTRO E CARC;RUA JULIA FREITA;32;92262;8/3/2001 20:09:00;CIDADAO COMUM;N;0;ALVARO CAMARGOS;BH;604119.95;797579.85;3110
-3112;2001129857;B03000;AMEACA;RUA VILA DA BARR;512;8069;8/3/2001 20:19:00;CIDADAO COMUM;N;;BARREIRO;BH;602200.76;790298.47;3111
-3113;2001130090;B06000;LESAO CORPORAL;PRACA MILTON CAM;16;18867;8/3/2001 23:02:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612371.63;794891.33;3112
-3114;2001130119;B06000;LESAO CORPORAL;RUA CAJUI;30;11580;8/3/2001 23:12:00;CIDADAO COMUM;S;;VILA SUZANA;BH;611836.44;803207.06;3113
-3115;2001130234;B06000;LESAO CORPORAL;RUA SOFRE;42;85588;9/3/2001 00:26:00;CIDADAO COMUM;S;0;GOIANIA;BH;615466.95;802363.54;3114
-3116;2001130302;B06000;LESAO CORPORAL;AV OLEGARIO MACI;735;49699;9/3/2001 01:19:00;INICIATIVA;N;0;CENTRO (BH);BH;610517.79;796937.79;3115
-3117;2001130451;B03000;AMEACA;AV GUANABARA;147;93400;9/3/2001 03:48:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603018.25;802662.19;3116
-3118;2001130457;B06000;LESAO CORPORAL;RUA BRASIL;57;10446;9/3/2001 03:52:00;CIDADAO COMUM;S;;CABANA;BH;604945.57;793506.57;3117
-3119;2001130762;B06000;LESAO CORPORAL;RUA EMANUEL;224;87010;9/3/2001 09:31:00;CIDADAO COMUM;S;0;PILAR;BH;607677.72;788684.08;3118
-3120;2001130815;B03000;AMEACA;AV SILVA LOBO;1665;65889;9/3/2001 10:11:00;INICIATIVA;S;0;GRAJAU;BH;607998.83;795075.02;3119
-3121;2001130845;B06000;LESAO CORPORAL;RUA P SETE;31;36343;9/3/2001 10:32:00;CIDADAO COMUM;S;;SERRA VERDE;BH;608973.20;809822.11;3120
-3122;2001130880;B03000;AMEACA;RUA DES BRAULIO;2070;19917;9/3/2001 10:55:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616352.52;797404.60;3121
-3123;2001130905;B03000;AMEACA;RUA CURA D'ARS;658;19019;9/3/2001 11:14:00;CIDADAO COMUM;N;;PRADO;BH;608458.95;796162.03;3122
-3124;2001130957;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;75;7936;9/3/2001 11:43:00;CIDADAO COMUM;S;0;ESTORIL;BH;607588.49;794818.58;3123
-3125;2001130967;B06000;LESAO CORPORAL;RUA JORNALISTA J;20;86423;9/3/2001 11:50:00;CIDADAO COMUM;N;;VILA FREI LEOPOL;BH;611387.13;809456.99;3124
-3126;2001130988;B03000;AMEACA;RUA Q;49;78415;9/3/2001 12:07:00;CIDADAO COMUM;S;;VILA PINHO;BH;602108.64;787980.59;3125
-3127;2001131001;B03000;AMEACA;RUA VINTE E UM;150;302827;9/3/2001 12:17:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614559.08;805708.38;3126
-3128;2001131024;B06000;LESAO CORPORAL;RUA JOSE BENEDIT;95;14097;9/3/2001 12:36:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608678.04;799900.10;3127
-3129;2001131052;B06000;LESAO CORPORAL;RUA DA BAHIA;1201;81155;9/3/2001 12:57:00;INICIATIVA;N;0;LOURDES;BH;611247.00;796466.91;3128
-3130;2001131062;B03000;AMEACA;AV PORTUGAL;1615;54816;9/3/2001 13:03:00;CIDADAO COMUM;N;LJ;JARDIM ATLANTICO;BH;606624.57;805076.59;3129
-3131;2001131084;B03000;AMEACA;AV BRIGADEIRO ED;146;2860;9/3/2001 13:15:00;CIDADAO COMUM;N;0;DOM BOSCO;BH;604415.87;797954.64;3130
-3132;2001131141;B03000;AMEACA;RUA FREI LEOPOLD;153;29946;9/3/2001 13:53:00;CIDADAO COMUM;S;;OURO PRETO;BH;606823.65;802833.82;3131
-3133;2001131326;B06000;LESAO CORPORAL;BECO BELMIRO DIA;12;171015;9/3/2001 15:51:00;CIDADAO COMUM;N;EN22;CABANA;BH;604788.98;794084.00;3132
-3134;2001131385;B03000;AMEACA;RUA JUATUBA;42;39367;9/3/2001 16:24:00;CIDADAO COMUM;N;0;VISTA ALEGRE;BH;605262.83;793420.62;3133
-3135;2001131589;B06000;LESAO CORPORAL;RUA FERNAO DIAS;1724;28133;9/3/2001 18:15:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616225.47;797490.06;3134
-3136;2001131607;B03000;AMEACA;AV SANTA MATILDE;100;61125;9/3/2001 18:21:00;CIDADAO COMUM;S;0;DOM CABRAL;BH;604671.57;796695.46;3135
-3137;2001131626;B03000;AMEACA;RUA PERNAMBUCO;1408;53463;9/3/2001 18:29:00;CIDADAO COMUM;S;PX257;FUNCIONARIOS;BH;611366.54;794888.79;3136
-3138;2001131647;B06000;LESAO CORPORAL;RUA ANTONIO MARC;56;48539;9/3/2001 18:39:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606640.65;810340.57;3137
-3139;2001131681;B03000;AMEACA;BECO ALIPIO GOUL;25;301607;9/3/2001 19:04:00;INICIATIVA;S;0;CAFEZAL;BH;614372.36;794514.88;3138
-3140;2001131697;B03000;AMEACA;AV OLEGARIO MACI;742;49699;9/3/2001 19:12:00;CIDADAO COMUM;S;LJ1186;LOURDES;BH;610475.34;796973.70;3139
-3141;2001131743;B04001;HOMICIDIO TENTAD;RUA OPALA;52;50263;9/3/2001 19:39:00;CIDADAO COMUM;S;;CRUZEIRO;BH;612382.32;794474.41;3140
-3142;2001131750;B03000;AMEACA;RUA VINTE E UM;96;38727;9/3/2001 19:42:00;CIDADAO COMUM;S;0;EYMARD;BH;613449.25;803612.99;3141
-3143;2001131806;B06000;LESAO CORPORAL;RUA PINDARE;264;53725;9/3/2001 20:19:00;CIDADAO COMUM;S;;JARDIM FLORENCIA;BH;604842.13;810280.47;3142
-3144;2001131820;B03000;AMEACA;RUA SAO PEDRO;125;25642;9/3/2001 20:30:00;CIDADAO COMUM;S;;TAQUARIL;BH;617086.49;797642.21;3143
-3145;2001131823;B09000;ABANDONO DE INCA;RUA LINCOLN;116;41136;9/3/2001 20:31:00;CIDADAO COMUM;S;0;UNIAO;BH;612529.82;801293.20;3144
-3146;2001131845;B06000;LESAO CORPORAL;RUA UM;40;126811;9/3/2001 20:39:00;CIDADAO COMUM;S;CASA B/PROXIMO F;BETANIA;BH;605248.47;792522.98;3145
-3147;2001131935;B03000;AMEACA;RUA POROROCAS;157;54730;9/3/2001 21:33:00;CIDADAO COMUM;S;0;APARECIDA;BH;609174.80;799926.58;3146
-3148;2001131978;B06000;LESAO CORPORAL;AV DOM JOAO VI;500;22294;9/3/2001 22:00:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606436.28;792638.35;3147
-3149;2001132045;B09000;ABANDONO DE INCA;RUA ROMA;425;59227;9/3/2001 22:52:00;CIDADAO COMUM;S;;COPACABANA;BH;606404.89;806324.07;3148
-3150;2001132053;B06000;LESAO CORPORAL;RUA MARIA HELENA;45;116763;9/3/2001 22:55:00;CIDADAO COMUM;N;0;GORDURAS;BH;618471.78;806457.72;3149
-3151;2001132080;B03000;AMEACA;RUA B;145;99463;9/3/2001 23:11:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615056.13;808241.11;3150
-3152;2001132097;B03000;AMEACA;RUA ALUIZIO DAVI;47;9770;9/3/2001 23:19:00;CIDADAO COMUM;N;;OURO PRETO;BH;606077.06;800835.16;3151
-3153;2001132123;B04001;HOMICIDIO TENTAD;RUA RIO DE JANEI;661;58772;9/3/2001 23:46:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611114.77;797039.90;3152
-3154;2001132179;B03000;AMEACA;AV JOAO XXIII;495;37926;10/3/2001 00:14:00;INICIATIVA;N;0;SAO JOSE;BH;604237.06;799490.03;3153
-3155;2001132215;B06000;LESAO CORPORAL;RUA ALBERTO BRES;416;1779;10/3/2001 00:43:00;MILITARES DAS FO;S;AP301;SAO LUCAS;BH;613739.06;795923.53;3154
-3156;2001132278;B06000;LESAO CORPORAL;RUA AGUANIL;621;1564;10/3/2001 01:19:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;605153.02;793405.94;3155
-3157;2001132312;B03000;AMEACA;RUA PILAR;143;53652;10/3/2001 01:38:00;CIDADAO COMUM;S;0;GRAJAU;BH;608312.73;795173.39;3156
-3158;2001132328;B06000;LESAO CORPORAL;RUA PENALVA;55;96276;10/3/2001 01:49:00;CIDADAO COMUM;S;;DOM SILVERIO;BH;614572.76;804374.21;3157
-3159;2001132364;B06000;LESAO CORPORAL;RUA ARCEBURGO;242;5754;10/3/2001 02:09:00;CIDADAO COMUM;N;0;BONFIM;BH;610028.45;797978.48;3158
-3160;2001132366;B06000;LESAO CORPORAL;RUA DES BRAULIO;1460;19917;10/3/2001 02:13:00;INICIATIVA;S;0;VERA CRUZ;BH;616272.96;797748.52;3159
-3161;2001132379;B06000;LESAO CORPORAL;RUA AMPERE;165;3484;10/3/2001 02:19:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612179.88;803639.20;3160
-3162;2001132393;B04001;HOMICIDIO TENTAD;RUA ANTONIO JOSE;387;7431;10/3/2001 02:33:00;INICIATIVA;S;0;CEU AZUL;BH;605094.73;807852.13;3161
-3163;2001132421;B04001;HOMICIDIO TENTAD;RUA JOAO LUCIO B;207;37737;10/3/2001 02:56:00;CIDADAO COMUM;N;0;PRADO;BH;609066.20;796836.45;3162
-3164;2001132424;B06000;LESAO CORPORAL;RUA SOCRATES;704;85953;10/3/2001 03:00:00;CIDADAO COMUM;S;;DOM SILVERIO;BH;615328.85;804470.89;3163
-3165;2001132437;B02000;RIXA;RUA DESEMBARGADO;86;115569;10/3/2001 03:09:00;CIDADAO COMUM;S;0;SANTA ROSA;BH;610450.04;803515.63;3164
-3166;2001132463;B06000;LESAO CORPORAL;AV DEPUTADO ULTI;922;82549;10/3/2001 03:31:00;CIDADAO COMUM;N;0;PLANALTO;BH;610685.49;806327.55;3165
-3167;2001132471;B06000;LESAO CORPORAL;AV SANTOS DUMONT;574;61950;10/3/2001 03:37:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611085.24;797586.10;3166
-3168;2001132479;B04001;HOMICIDIO TENTAD;RUA DOS CAETES;904;11376;10/3/2001 03:44:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610737.67;797573.19;3167
-3169;2001132489;B03000;AMEACA;RUA DOM HENRIQUE;145;102531;10/3/2001 03:51:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616541.52;797463.00;3168
-3170;2001132512;B03000;AMEACA;AV CECILIA PINTO;10;14447;10/3/2001 04:04:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;610447.02;805109.36;3169
-3171;2001132562;B06000;LESAO CORPORAL;RUA JANUARIA;130;36936;10/3/2001 04:45:00;INICIATIVA;N;0;FLORESTA;BH;611623.24;797867.33;3170
-3172;2001132583;B03000;AMEACA;RUA CARMO DO PAR;24;13674;10/3/2001 05:08:00;INICIATIVA;S;0;SANTA BRANCA;BH;608430.17;806537.36;3171
-3173;2001132619;B06000;LESAO CORPORAL;RUA MANHUARA;754;42891;10/3/2001 05:48:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612620.57;804097.74;3172
-3174;2001132724;B03000;AMEACA;RUA JOSE SANTIAG;217;39152;10/3/2001 08:13:00;CIDADAO COMUM;S;;PIRAJA;BH;613907.92;803290.60;3173
-3175;2001132783;B03000;AMEACA;RUA B;233;99463;10/3/2001 08:55:00;CIDADAO COMUM;S;CONJUNTO HABITAC;ANTONIO RIBEIRO ;BH;615108.83;808304.73;3174
-3176;2001132826;B03000;AMEACA;RUA JOAO ALPHONS;358;56900;10/3/2001 09:37:00;CIDADAO COMUM;S;;SANTA MARIA;BH;603482.31;795442.09;3175
-3177;2001132836;B03000;AMEACA;RUA E;25;24609;10/3/2001 09:42:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;613409.70;798697.81;3176
-3178;2001132854;B03000;AMEACA;RUA DESEMBARGADO;524;56837;10/3/2001 10:01:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606619.76;801988.28;3177
-3179;2001132858;B03000;AMEACA;RUA ALGA MARINHA;837;66623;10/3/2001 10:04:00;CIDADAO COMUM;S;0;FLORAMAR;BH;610880.29;807307.57;3178
-3180;2001132875;B06000;LESAO CORPORAL;RUA EURITA;464;26910;10/3/2001 10:12:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;613248.91;797355.88;3179
-3181;2001132915;B06000;LESAO CORPORAL;AV DOM PEDRO II;5092;53145;10/3/2001 10:42:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606214.33;798752.85;3180
-3182;2001132939;B03000;AMEACA;RUA LAGOA DO OUR;60;96310;10/3/2001 11:05:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614514.29;804670.38;3181
-3183;2001132964;B03000;AMEACA;RUA ONZE DE AGOS;170;14800;10/3/2001 11:24:00;CIDADAO COMUM;S;0;LEONINA;BH;608260.71;793318.58;3182
-3184;2001133010;B06000;LESAO CORPORAL;RUA PONTA PORA;234;54601;10/3/2001 11:57:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613187.23;796919.20;3183
-3185;2001133018;B06000;LESAO CORPORAL;RUA AFONSO TAUNA;55;1287;10/3/2001 12:06:00;CIDADAO COMUM;N;;TUPI;BH;613048.27;805895.79;3184
-3186;2001133071;B03000;AMEACA;AV ABILIO MACHAD;1850;634;10/3/2001 12:46:00;INICIATIVA;N;0;GLORIA;BH;604280.89;799156.78;3185
-3187;2001133125;B06000;LESAO CORPORAL;RUA DOS CARIJOS;244;81243;10/3/2001 13:20:00;INICIATIVA;N;0;CENTRO (BH);BH;611237.36;797154.26;3186
-3188;2001133148;B03000;AMEACA;AV PERIMETRAL;575;78531;10/3/2001 13:34:00;CIDADAO COMUM;S;0;VILA PINHO;BH;601770.82;788354.35;3187
-3189;2001133167;B03000;AMEACA;RUA ITAQUERA;61;35920;10/3/2001 13:48:00;CIDADAO COMUM;S;0;CONCORDIA;BH;610845.53;799056.35;3188
-3190;2001133210;B04001;HOMICIDIO TENTAD;AV PRESIDENTE AN;50;4461;10/3/2001 14:14:00;INICIATIVA;N;0;LAGOINHA;BH;610871.52;798167.64;3189
-3191;2001133221;B03000;AMEACA;RUA CACHOEIRA DO;87;11221;10/3/2001 14:19:00;CIDADAO COMUM;N;0;CALAFATE;BH;607823.36;796524.67;3190
-3192;2001133233;B03000;AMEACA;RUA JOSE DO CARM;135;69559;10/3/2001 14:26:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609514.03;809256.67;3191
-3193;2001133266;B06000;LESAO CORPORAL;RUA RAMIRO SIQUE;125;128858;10/3/2001 14:48:00;INICIATIVA;S;0;CASTANHEIRAS (TA;BH;617779.12;797270.76;3192
-3194;2001133288;B06000;LESAO CORPORAL;RUA NICIAS CONTI;840;56115;10/3/2001 15:06:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605487.26;795114.95;3193
-3195;2001133323;B03000;AMEACA;RUA SEBASTIAO MA;6;67150;10/3/2001 15:25:00;CIDADAO COMUM;S;;UNIAO;BH;613320.67;801418.37;3194
-3196;2001133324;B06000;LESAO CORPORAL;RUA JOAQUIM CARD;399;71835;10/3/2001 15:26:00;POLICIAL MILITAR;N;FU;TUPI;BH;613424.10;806433.65;3195
-3197;2001133332;B03000;AMEACA;RUA BENEDITO NEV;80;9061;10/3/2001 15:27:00;CIDADAO COMUM;S;;NAZARE;BH;616036.74;804426.63;3196
-3198;2001133370;B06000;LESAO CORPORAL;RUA ANGRA DOS RE;101;4027;10/3/2001 15:56:00;CIDADAO COMUM;S;0;NOVA GRANADA;BH;607661.15;795094.51;3197
-3199;2001133372;B03000;AMEACA;AV ANTONIO ABRAH;1000;4320;10/3/2001 15:56:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;3198
-3200;2001133376;B03000;AMEACA;RUA Y;26;78497;10/3/2001 15:58:00;CIDADAO COMUM;S;;VILA PINHO;BH;602512.92;787531.28;3199
-3201;2001133431;B03000;AMEACA;RUA ARARIBA;317;5540;10/3/2001 16:27:00;CIDADAO COMUM;S;0;SAO CRISTOVAO;BH;610222.10;799194.68;3200
-3202;2001133453;B03000;AMEACA;RUA CAMBUI;329;11827;10/3/2001 16:43:00;CIDADAO COMUM;S;;GUARANI;BH;612340.28;805479.91;3201
-3203;2001133493;B03000;AMEACA;AV DOM JOAO VI;1015;22294;10/3/2001 17:04:00;CIDADAO COMUM;N;;PALMEIRAS;BH;606671.01;791769.47;3202
-3204;2001133517;B03000;AMEACA;RUA MONSENHOR NO;627;82968;10/3/2001 17:16:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603609.05;802750.23;3203
-3205;2001133608;B03000;AMEACA;RUA DOS TUPIS;642;69965;10/3/2001 18:18:00;INICIATIVA;N;0;CENTRO (BH);BH;610664.10;797017.51;3204
-3206;2001133614;B06000;LESAO CORPORAL;RUA CINCO;18;27128;10/3/2001 18:23:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616655.75;806912.57;3205
-3207;2001133637;B03000;AMEACA;AV COLETORA;259;78241;10/3/2001 18:34:00;CIDADAO COMUM;S;CA;VILA PINHO;BH;601857.39;788584.95;3206
-3208;2001133639;B04001;HOMICIDIO TENTAD;RUA DO BATISMO;252;8390;10/3/2001 18:38:00;CIDADAO COMUM;S;;SAO JOSE;BH;605523.60;798732.42;3207
-3209;2001133661;B03000;AMEACA;RUA FLOR DA AMIZ;77;94646;10/3/2001 18:50:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606195.05;799625.17;3208
-3210;2001133668;B06000;LESAO CORPORAL;AV ANTONIO ABRAH;1000;4320;10/3/2001 18:56:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;3209
-3211;2001133685;B06000;LESAO CORPORAL;AV CECILIA PINTO;11;14447;10/3/2001 19:14:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610600.26;805253.80;3210
-3212;2001133726;B06000;LESAO CORPORAL;AV OTACILIO NEGR;1814;50566;10/3/2001 19:30:00;INICIATIVA;S;0;SAO LUIZ;BH;607161.46;804037.88;3211
-3213;2001133756;B06000;LESAO CORPORAL;RUA BEIRA ALTA;1016;62777;10/3/2001 19:45:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609672.34;802505.06;3212
-3214;2001133825;B03000;AMEACA;RUA PINTOR ATAID;800;53870;10/3/2001 20:24:00;CIDADAO COMUM;S;CAFU;TUPI;BH;613715.53;806266.08;3213
-3215;2001133830;B04002;HOMICIDIO CONSUM;RUA BENTO;140;170807;10/3/2001 20:22:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;608443.37;794109.13;3214
-3216;2001133843;B06000;LESAO CORPORAL;AV NOSSA SENHORA;2458;48107;10/3/2001 20:32:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;609576.83;797656.73;3215
-3217;2001133878;B03000;AMEACA;RUA JOAQUIM PURI;183;96087;10/3/2001 20:54:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614518.23;803271.68;3216
-3218;2001133925;B06000;LESAO CORPORAL;RUA PINHEIROS;840;53794;10/3/2001 21:13:00;INICIATIVA;S;0;APARECIDA;BH;609294.20;800486.27;3217
-3219;2001133942;B04002;HOMICIDIO CONSUM;RUA RADIALISTA J;170;113664;10/3/2001 21:22:00;CIDADAO COMUM;N;LJ1;CEU AZUL;BH;604317.03;807560.85;3218
-3220;2001133970;B06000;LESAO CORPORAL;RUA CONEGO SANTA;71;16846;10/3/2001 21:38:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;609967.00;801045.34;3219
-3221;2001134000;B06000;LESAO CORPORAL;AV ALVARO DA SIL;120;2872;10/3/2001 21:58:00;CIDADAO COMUM;S;;BARREIRO;BH;602794.32;791345.50;3220
-3222;2001134002;B06000;LESAO CORPORAL;RUA JOAIMA;5;37359;10/3/2001 21:58:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605520.04;808206.04;3221
-3223;2001134015;B06000;LESAO CORPORAL;RUA SAO PAULO;855;63464;10/3/2001 22:11:00;INICIATIVA;S;0;CENTRO (BH);BH;610942.81;796944.19;3222
-3224;2001134022;B04001;HOMICIDIO TENTAD;RUA ANTONIO VIEI;365;4925;10/3/2001 22:12:00;CIDADAO COMUM;S;;GLALIJA;BH;603373.75;794204.83;3223
-3225;2001134034;B03000;AMEACA;RUA DO LEBLON;425;40612;10/3/2001 22:24:00;CIDADAO COMUM;N;CAFR;SARANDI (URCA/BH;BH;602909.50;802449.12;3224
-3226;2001134053;B06000;LESAO CORPORAL;RUA ARMANDO RIBE;236;82435;10/3/2001 22:39:00;CIDADAO COMUM;N;0;SAO BERNARDO;BH;611325.66;805084.25;3225
-3227;2001134061;B03000;AMEACA;RUA JOSE DO CARM;130;40997;10/3/2001 22:47:00;INICIATIVA;S;0;VILA SUZANA;BH;611633.88;802983.51;3226
-3228;2001134090;B03000;AMEACA;RUA JOSE DOS SAN;595;118917;10/3/2001 23:02:00;CIDADAO COMUM;S;;TEIXEIRA DIAS;BH;602852.09;789247.61;3227
-3229;2001134095;B03000;AMEACA;RUA CLAUDINOR ME;125;113610;10/3/2001 23:05:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609632.17;809246.02;3228
-3230;2001134157;B06000;LESAO CORPORAL;RUA SAIDE HADDAD;453;32632;10/3/2001 23:34:00;CIDADAO COMUM;N;;COPACABANA;BH;606667.30;806118.72;3229
-3231;2001134200;B06000;LESAO CORPORAL;RUA JACUI;520;36734;11/3/2001 00:08:00;CIDADAO COMUM;S;0;FLORESTA;BH;611817.14;798323.18;3230
-3232;2001134233;B06000;LESAO CORPORAL;AV JOSE BONIFACI;407;38579;11/3/2001 00:33:00;CIDADAO COMUM;N;0;PRADO LOPES;BH;610154.66;799019.14;3231
-3233;2001134292;B06000;LESAO CORPORAL;RUA AQUIDABAN;765;5190;11/3/2001 01:06:00;CIDADAO COMUM;N;AP201;PADRE EUSTAQUIO;BH;607112.28;797085.44;3232
-3234;2001134309;B06000;LESAO CORPORAL;RUA PECANHA;456;52880;11/3/2001 01:14:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;610082.65;797547.31;3233
-3235;2001134366;B06000;LESAO CORPORAL;RUA FRANCISCO GO;11;68569;11/3/2001 01:47:00;CIDADAO COMUM;S;0;ESTRELA DALVA;BH;607532.57;792322.04;3234
-3236;2001134391;B06000;LESAO CORPORAL;RUA FLOR DA NOIV;220;28767;11/3/2001 02:06:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606155.93;799519.51;3235
-3237;2001134424;B02000;RIXA;RUA DOUTOR ALBER;40;23114;11/3/2001 02:30:00;CIDADAO COMUM;S;;HELIOPOLIS;BH;610784.10;805344.10;3236
-3238;2001134426;B04001;HOMICIDIO TENTAD;RUA VINTE E UM;150;302827;11/3/2001 02:16:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614559.08;805708.38;3237
-3239;2001134439;B03000;AMEACA;AV SILVA LOBO;953;65889;11/3/2001 02:49:00;CIDADAO COMUM;S;0;CALAFATE;BH;607671.69;795612.00;3238
-3240;2001134493;B06000;LESAO CORPORAL;AV BIAS FORTES;1772;9553;11/3/2001 03:31:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610196.72;797244.85;3239
-3241;2001134611;B06000;LESAO CORPORAL;RUA PADRE EUSTAQ;245;51294;11/3/2001 05:44:00;INICIATIVA;N;0;CARLOS PRATES;BH;609259.76;797673.34;3240
-3242;2001134770;B06000;LESAO CORPORAL;RUA ARGENTINA;330;5870;11/3/2001 08:40:00;CIDADAO COMUM;N;;COPACABANA;BH;606266.99;806343.30;3241
-3243;2001134910;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;2221;57830;11/3/2001 10:43:00;INICIATIVA;S;0;ESTORIL;BH;609072.11;793144.52;3242
-3244;2001134955;B03000;AMEACA;RUA DOS MOICANOS;27;84024;11/3/2001 11:10:00;CIDADAO COMUM;N;;SANTA MONICA;BH;606518.83;807252.81;3243
-3245;2001135047;B03000;AMEACA;RUA PARACATU;812;52095;11/3/2001 12:31:00;CIDADAO COMUM;N;0;SANTO AGOSTINHO;BH;609642.16;796526.05;3244
-3246;2001135061;B03000;AMEACA;RUA OLIVER;286;49950;11/3/2001 12:47:00;CIDADAO COMUM;S;;UNIAO;BH;612796.31;801453.59;3245
-3247;2001135100;B03000;AMEACA;RUA VERISSIMO GU;475;102720;11/3/2001 13:23:00;INICIATIVA;S;;REGINA;BH;599062.14;790155.01;3246
-3248;2001135107;B03000;AMEACA;RUA CECILIO EMIG;95;14131;11/3/2001 13:33:00;CIDADAO COMUM;N;0;PRIMEIRO DE MAIO;BH;612420.25;803804.17;3247
-3249;2001135112;B04001;HOMICIDIO TENTAD;RUA ADAMINA;285;993;11/3/2001 13:44:00;CIDADAO COMUM;N;CAB;SANTA TEREZA;BH;613245.80;797540.93;3248
-3250;2001135139;B04001;HOMICIDIO TENTAD;BECO PEDRA VERDE;195;301698;11/3/2001 14:07:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614674.76;794885.65;3249
-3251;2001135140;B03000;AMEACA;RUA KEPLER;125;39990;11/3/2001 14:06:00;CIDADAO COMUM;S;0;SANTA LUCIA;BH;609926.77;792542.84;3250
-3252;2001135161;B06000;LESAO CORPORAL;RUA BABEL;453;7460;11/3/2001 14:29:00;CIDADAO COMUM;S;;SAO SALVADOR;BH;603180.30;799419.94;3251
-3253;2001135207;B03000;AMEACA;RUA CATALUNHA;400;14204;11/3/2001 15:13:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603903.59;802481.58;3252
-3254;2001135286;B03000;AMEACA;RUA COMPASSO;79;301444;11/3/2001 15:51:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614292.21;795356.13;3253
-3255;2001135350;B03000;AMEACA;RUA HERCILIA GOM;126;104389;11/3/2001 16:27:00;INICIATIVA;N;0;DAS INDUSTRIAS;BH;605366.03;791053.96;3254
-3256;2001135402;B03000;AMEACA;BECO DA AGUA;209;172308;11/3/2001 16:55:00;CIDADAO COMUM;S;;CAFEZAL;BH;614062.90;794471.00;3255
-3257;2001135454;B03000;AMEACA;RUA PROFESSOR NE;85;55617;11/3/2001 17:22:00;CIDADAO COMUM;S;AP204;LIBERDADE;BH;609112.67;804157.20;3256
-3258;2001135545;B06000;LESAO CORPORAL;RUA JOAO SILVA;36;89548;11/3/2001 18:16:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;617409.75;804658.18;3257
-3259;2001135556;B03000;AMEACA;RUA MONTE ALEGRE;974;46357;11/3/2001 18:22:00;CIDADAO COMUM;S;0;SAO LUCAS;BH;613142.34;795894.02;3258
-3260;2001135565;B03000;AMEACA;RUA ITAPAGIPE;299;35729;11/3/2001 18:32:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611258.92;798905.89;3259
-3261;2001135582;B03000;AMEACA;RUA CENTRO SOCIA;481;14853;11/3/2001 18:39:00;CIDADAO COMUM;S;;CABANA;BH;604988.44;794481.77;3260
-3262;2001135642;B03000;AMEACA;RUA RAMIRO SIQUE;75;128858;11/3/2001 19:15:00;CIDADAO COMUM;N;;CASTANHEIRAS (TA;BH;617772.39;797223.77;3261
-3263;2001135655;B06000;LESAO CORPORAL;RUA PADRE JULIO ;1074;51496;11/3/2001 19:20:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615907.15;797512.07;3262
-3264;2001135672;B03000;AMEACA;RUA JOSE AGUILAR;52;65371;11/3/2001 19:31:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608388.25;808451.24;3263
-3265;2001135704;B03000;AMEACA;RUA JULITA NUNES;210;130047;11/3/2001 19:51:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609164.95;809748.79;3264
-3266;2001135711;B03000;AMEACA;AV ITAITUBA;450;35454;11/3/2001 19:58:00;CIDADAO COMUM;S;;BOA VISTA;BH;615072.17;799768.56;3265
-3267;2001135734;B06000;LESAO CORPORAL;RUA SILVIO GUEDE;80;89610;11/3/2001 20:08:00;CIDADAO COMUM;S;A;PALMEIRAS;BH;606793.47;790943.10;3266
-3268;2001135755;B06000;LESAO CORPORAL;RUA DOM LARA;36;22354;11/3/2001 20:20:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;604948.00;793141.08;3267
-3269;2001135759;B03000;AMEACA;AV AUGUSTO DE LI;566;6731;11/3/2001 20:22:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610794.74;796703.04;3268
-3270;2001135807;B03000;AMEACA;RUA CARLINDO COS;116;97294;11/3/2001 20:47:00;CIDADAO COMUM;S;;EYMARD;BH;613796.27;803705.16;3269
-3271;2001135814;B06000;LESAO CORPORAL;RUA OSCAR TROMPO;1396;50452;11/3/2001 20:52:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608530.75;794473.15;3270
-3272;2001135832;B06000;LESAO CORPORAL;RUA IPE;75;107002;11/3/2001 20:59:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605934.79;794017.44;3271
-3273;2001135950;B06000;LESAO CORPORAL;RUA DR BROCHADO;347;23215;11/3/2001 22:07:00;CIDADAO COMUM;S;LJ;VERA CRUZ;BH;615924.06;798038.94;3272
-3274;2001135984;B06000;LESAO CORPORAL;RUA CORONEL ANTO;187;17619;11/3/2001 22:25:00;INICIATIVA;N;0;REGINA;BH;599173.76;790169.22;3273
-3275;2001136008;B06000;LESAO CORPORAL;RUA VEREADOR CAM;310;21005;11/3/2001 22:40:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615839.95;806852.22;3274
-3276;2001136016;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;11/3/2001 22:50:00;INICIATIVA;S;0;TIROL;BH;600947.66;789885.51;3275
-3277;2001136021;B03000;AMEACA;RUA ARARUAMA;95;77945;11/3/2001 22:52:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606533.50;795254.31;3276
-3278;2001136023;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;11/3/2001 22:55:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;3277
-3279;2001136032;B06000;LESAO CORPORAL;AV LEONTINO FRAN;716;445;11/3/2001 23:00:00;CIDADAO COMUM;N;;SERRA VERDE;BH;608934.38;810294.22;3278
-3280;2001136046;B04001;HOMICIDIO TENTAD;RUA CONDE DE PRA;329;16704;11/3/2001 23:08:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;607817.82;797193.08;3279
-3281;2001136048;B04001;HOMICIDIO TENTAD;RUA DOS COMANCHE;835;16367;11/3/2001 23:09:00;CIDADAO COMUM;S;CA102;SANTA MONICA;BH;606520.24;807304.69;3280
-3282;2001136058;B04001;HOMICIDIO TENTAD;AV BRIGADEIRO ED;1250;2860;11/3/2001 23:15:00;CIDADAO COMUM;S;;GLORIA;BH;604129.27;798741.46;3281
-3283;2001136065;B06000;LESAO CORPORAL;AV COLETORA;706;78241;11/3/2001 23:18:00;CIDADAO COMUM;S;0;VILA PINHO;BH;602173.18;788104.09;3282
-3284;2001136072;B03000;AMEACA;RUA IBIRAPITANGA;13;33880;11/3/2001 23:20:00;CIDADAO COMUM;S;;DOM CABRAL;BH;605218.23;796295.85;3283
-3285;2001136083;B03000;AMEACA;RUA DR BROCHADO;786;23215;11/3/2001 23:28:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615903.09;797998.69;3284
-3286;2001136122;B06000;LESAO CORPORAL;RUA UM;1;27979;11/3/2001 23:56:00;CIDADAO COMUM;S;0;CAPITAO EDUARDO;BH;618570.61;806854.95;3285
-3287;2001136133;B06000;LESAO CORPORAL;RUA MONTE ALEGRE;956;46357;12/3/2001 00:03:00;CIDADAO COMUM;N;;SAO LUCAS;BH;613132.69;795877.59;3286
-3288;2001136154;B06000;LESAO CORPORAL;RUA CISNE;29;15897;12/3/2001 00:21:00;CIDADAO COMUM;S;0;SANTA CRUZ (BARR;BH;603604.65;788616.62;3287
-3289;2001136176;B03000;AMEACA;RUA TREM DE FERR;500;9377;12/3/2001 00:38:00;CIDADAO COMUM;S;;ITAIPU BH;BH;598843.35;789728.92;3288
-3290;2001136186;B03000;AMEACA;AV IVAI;1283;80629;12/3/2001 00:41:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604508.73;797938.76;3289
-3291;2001136197;B06000;LESAO CORPORAL;RUA VOLTS;281;73626;12/3/2001 00:47:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612018.39;803526.32;3290
-3292;2001136248;B03000;AMEACA;AV AGENOR DE PAU;285;86250;12/3/2001 01:19:00;CIDADAO COMUM;S;REF///FABRICA DE;JAQUELINE;BH;611475.70;810215.54;3291
-3293;2001136304;B03000;AMEACA;RUA DOS CARIJOS;758;81243;12/3/2001 02:24:00;INICIATIVA;N;0;CENTRO BH;BH;610724.95;797294.54;3292
-3294;2001136750;B06000;LESAO CORPORAL;RUA SAO PAULO;279;63464;12/3/2001 11:01:00;INICIATIVA;N;0;CENTRO (BH);BH;611088.02;797493.26;3293
-3295;2001136769;B03000;AMEACA;RUA REAL MADRID;94;58091;12/3/2001 11:13:00;INICIATIVA;S;0;COQUEIROS;BH;603542.26;800110.20;3294
-3296;2001136822;B06000;LESAO CORPORAL;RUA RIACHO;90;24927;12/3/2001 11:49:00;CIDADAO COMUM;N;0;TAQUARIL;BH;617243.77;797186.28;3295
-3297;2001136898;B06000;LESAO CORPORAL;RUA UM;18;103128;12/3/2001 12:39:00;CIDADAO COMUM;S;0;OLHOS DAGUA;BH;605995.69;793120.57;3296
-3298;2001136922;B04002;HOMICIDIO CONSUM;RUA GILBERTO FRE;150;92593;12/3/2001 12:58:00;CIDADAO COMUM;N;0;CHACARAS REUNIDA;BH;605824.74;789594.96;3297
-3299;2001136943;B03000;AMEACA;RUA ITAPEVA;721;35820;12/3/2001 13:10:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611512.69;799189.30;3298
-3300;2001136965;B03000;AMEACA;AV DOS BANDEIRAN;325;7775;12/3/2001 13:27:00;CIDADAO COMUM;S;0;SION;BH;611990.67;793015.07;3299
-3301;2001136997;B03000;AMEACA;RUA ALIPIO DE ME;735;2378;12/3/2001 14:00:00;CIDADAO COMUM;S;0;JARDIM MONTANHES;BH;606267.32;798788.92;3300
-3302;2001137181;B04001;HOMICIDIO TENTAD;AV GETULIO VARGA;1444;81256;12/3/2001 16:00:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;611346.34;795024.47;3301
-3303;2001137233;B03000;AMEACA;RUA IBIRAPITANGA;285;33880;12/3/2001 16:25:00;CIDADAO COMUM;S;0;DOM CABRAL;BH;605026.43;796485.74;3302
-3304;2001137242;B03000;AMEACA;AV SARAMENHA;1525;64007;12/3/2001 16:30:00;CIDADAO COMUM;S;0;GUARANI;BH;613298.64;805560.73;3303
-3305;2001137298;B03000;AMEACA;RUA GRAUNAS;213;31797;12/3/2001 16:54:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;605268.99;788621.91;3304
-3306;2001137310;B06000;LESAO CORPORAL;AV DOS ANDRADAS;1120;3761;12/3/2001 17:04:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;612076.67;796872.70;3305
-3307;2001137316;B06000;LESAO CORPORAL;RUA I;155;41454;12/3/2001 17:06:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602858.57;802861.67;3306
-3308;2001137333;B03000;AMEACA;RUA MARIA GERTRU;325;98993;12/3/2001 17:18:00;CIDADAO COMUM;N;;CEU AZUL;BH;604660.09;808431.77;3307
-3309;2001137337;B06000;LESAO CORPORAL;RUA PROFESSOR AN;62;4358;12/3/2001 17:19:00;CIDADAO COMUM;S;AP201;LOURDES;BH;610900.31;795508.58;3308
-3310;2001137432;B03000;AMEACA;PRACA RAUL SOARE;423;58010;12/3/2001 18:23:00;INICIATIVA;N;0;CENTRO BH;BH;610510.71;796848.26;3309
-3311;2001137546;B06000;LESAO CORPORAL;RUA SILVIANOPOLI;153;66015;12/3/2001 19:33:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;614056.98;797864.30;3310
-3312;2001137569;B03000;AMEACA;RUA DA COLINA;122;102270;12/3/2001 19:47:00;CIDADAO COMUM;S;0;TIROL;BH;601154.85;789668.92;3311
-3313;2001137582;B06000;LESAO CORPORAL;RUA MIRIAM WANDE;73;116041;12/3/2001 19:56:00;CIDADAO COMUM;N;0;DONA CLARA;BH;611425.09;803472.66;3312
-3314;2001137633;B03000;AMEACA;RUA CONDE D'EU;923;16631;12/3/2001 20:35:00;INICIATIVA;S;0;SAUDADE;BH;615588.75;797702.47;3313
-3315;2001137641;B06000;LESAO CORPORAL;RUA I;195;41454;12/3/2001 20:41:00;CIDADAO COMUM;N;CAFU;CH CONFISCO;BH;602841.28;802896.95;3314
-3316;2001137648;B03000;AMEACA;RUA IRACEMA BRAS;18;91405;12/3/2001 20:44:00;INICIATIVA;N;0;PALMEIRAS;BH;607490.84;791887.56;3315
-3317;2001137655;B03000;AMEACA;RUA CALMA;65;11679;12/3/2001 20:51:00;CIDADAO COMUM;S;0;BOA VISTA;BH;616096.68;800314.24;3316
-3318;2001137672;B03000;AMEACA;RUA GUAPORE;17;32125;12/3/2001 21:00:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605507.08;794128.89;3317
-3319;2001137741;B09000;ABANDONO DE INCA;RUA JOSE MAURO D;255;102125;12/3/2001 21:50:00;CIDADAO COMUM;N;CAA;MINEIRAO;BH;601633.89;785370.24;3318
-3320;2001137835;B03000;AMEACA;RUA PORTO SEGURO;544;60595;12/3/2001 22:55:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615015.28;800738.31;3319
-3321;2001137851;B04001;HOMICIDIO TENTAD;RUA REGENCIA;271;301448;12/3/2001 23:03:00;CIDADAO COMUM;S;PX271;VILA CAFEZAL;BH;614107.56;795461.45;3320
-3322;2001137864;B03000;AMEACA;RUA ODILIA GONCA;163;49080;12/3/2001 23:10:00;CIDADAO COMUM;S;;PIRAJA;BH;614130.19;803011.41;3321
-3323;2001138002;B06000;LESAO CORPORAL;RUA ATALIBA LAGO;119;710;13/3/2001 01:09:00;CIDADAO COMUM;N;0;NOVA SUISSA;BH;607254.89;795684.00;3322
-3324;2001138145;B03000;AMEACA;RUA CURI;749;19047;13/3/2001 04:12:00;CIDADAO COMUM;S;CAFRENT;SAO GERALDO;BH;615768.04;799053.75;3323
-3325;2001138173;B06000;LESAO CORPORAL;RUA GONCALVES DI;2700;31513;13/3/2001 05:25:00;CIDADAO COMUM;S;0;SANTO AGOSTINHO;BH;609946.31;796198.75;3324
-3326;2001138221;B06000;LESAO CORPORAL;RUA QUATRO DE MA;140;57118;13/3/2001 07:00:00;CIDADAO COMUM;S;0;LEONINA;BH;608669.25;793470.73;3325
-3327;2001138408;B03000;AMEACA;AV CORONEL DURVA;842;17688;13/3/2001 09:11:00;CIDADAO COMUM;S;;DURVAL DE BARROS;BH;598151.28;790894.64;3326
-3328;2001138499;B03000;AMEACA;RUA JOSEFINA PIR;200;39253;13/3/2001 10:24:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599776.55;789186.36;3327
-3329;2001138511;B03000;AMEACA;RUA FELIPE CAMAR;21;27938;13/3/2001 10:28:00;CIDADAO COMUM;S;;ESPLANADA;BH;614109.28;798485.73;3328
-3330;2001138568;B03000;AMEACA;AV MARIA CONCEIC;322;32052;13/3/2001 10:59:00;CIDADAO COMUM;S;;GOIANIA;BH;615551.34;803923.05;3329
-3331;2001138578;B06000;LESAO CORPORAL;RUA DUZENTOS E Q;76;24321;13/3/2001 11:04:00;CIDADAO COMUM;N;0;CH VALE DO JATOB;BH;600636.59;787113.12;3330
-3332;2001138653;B06000;LESAO CORPORAL;RUA VERISSIMO GU;462;102720;13/3/2001 11:57:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599091.26;790147.08;3331
-3333;2001138702;B03000;AMEACA;AV DOUTOR CRISTI;2213;62459;13/3/2001 12:35:00;CIDADAO COMUM;S;;ITAPOA;BH;609823.89;806007.84;3332
-3334;2001138747;B06000;LESAO CORPORAL;RUA SILVA VIANA;89;65923;13/3/2001 13:01:00;CIDADAO COMUM;S;CSA;SALGADO FILHO;BH;606569.99;794493.65;3333
-3335;2001138752;B06000;LESAO CORPORAL;RUA STA EFIGENIA;50;60539;13/3/2001 13:08:00;CIDADAO COMUM;S;0;SAO MARCOS;BH;614184.47;802711.80;3334
-3336;2001138946;B03000;AMEACA;RUA ITAPEMA;162;35760;13/3/2001 15:29:00;INICIATIVA;S;0;ANCHIETA;BH;612289.18;793841.58;3335
-3337;2001139028;B06000;LESAO CORPORAL;RUA HERCULANO MO;205;37967;13/3/2001 16:17:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605544.73;793496.43;3336
-3338;2001139330;B03000;AMEACA;RUA JACUI;2811;36734;13/3/2001 18:47:00;CIDADAO COMUM;N;;IPIRANGA;BH;611411.53;800497.94;3337
-3339;2001139401;B06000;LESAO CORPORAL;RUA BRANT HORTA;5;104593;13/3/2001 19:29:00;CIDADAO COMUM;S;;MARIA HELENA;BH;605831.72;810788.33;3338
-3340;2001139446;B04001;HOMICIDIO TENTAD;RUA JOSE FELIX M;1700;7416;13/3/2001 19:55:00;INICIATIVA;S;0;MANTIQUEIRA;BH;606728.71;811705.78;3339
-3341;2001139482;B03000;AMEACA;RUA ANGOLA;300;4001;13/3/2001 20:17:00;INICIATIVA;S;0;SAO PAULO;BH;612605.92;802886.01;3340
-3342;2001139492;B09000;ABANDONO DE INCA;RUA PATATIVA;105;52518;13/3/2001 20:19:00;CIDADAO COMUM;S;PRACA IRERE;FLAVIO MARQUES D;BH;604802.99;789000.10;3341
-3343;2001139542;B06000;LESAO CORPORAL;RUA GENERAL ARAN;189;30813;13/3/2001 20:57:00;CIDADAO COMUM;S;0;JARAGUA;BH;609466.26;804067.62;3342
-3344;2001139588;B03000;AMEACA;RUA TRINTA E SET;54;34190;13/3/2001 21:26:00;CIDADAO COMUM;S;0;CONJUNTO FELICID;BH;612530.17;807443.42;3343
-3345;2001139594;B06000;LESAO CORPORAL;RUA CALDAS DA RA;2178;61100;13/3/2001 21:31:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609144.55;801773.57;3344
-3346;2001139684;B03000;AMEACA;RUA BARROCA;5;24611;13/3/2001 22:26:00;CIDADAO COMUM;S;NR125;TAQUARIL;BH;617467.89;797401.78;3345
-3347;2001139719;B03000;AMEACA;RUA IGUACU;508;34118;13/3/2001 22:52:00;CIDADAO COMUM;S;;CONCORDIA;BH;611371.61;799012.35;3346
-3348;2001139723;B03000;AMEACA;RUA SERRA JOSE V;140;52499;13/3/2001 22:56:00;CIDADAO COMUM;S;;SANTA CECILIA;BH;601470.84;787774.23;3347
-3349;2001139782;B03000;AMEACA;AV AMINTAS VIDAL;1729;118769;13/3/2001 23:24:00;CIDADAO COMUM;S;0;NOVA GAMELEIRA;BH;605199.95;794638.45;3348
-3350;2001139791;B04001;HOMICIDIO TENTAD;RUA JOSE JORGE F;321;38884;13/3/2001 23:30:00;CIDADAO COMUM;S;0;NOVA BARROCA;BH;607534.36;793019.31;3349
-3351;2001139814;B03000;AMEACA;RUA DES CINTRA N;656;62966;13/3/2001 23:44:00;CIDADAO COMUM;0;0;MILIONARIOS;BH;604451.86;789966.96;3350
-3352;2001139816;B03000;AMEACA;RUA PROFESSOR MI;1935;128628;13/3/2001 23:47:00;CIDADAO COMUM;S;;NOVA ESPERANCA;BH;608960.31;799824.11;3351
-3353;2001139825;B03000;AMEACA;RUA TREZE DE SET;180;69168;13/3/2001 23:54:00;CIDADAO COMUM;S;CAB;LEONINA;BH;608442.23;793344.13;3352
-3354;2001139829;B03000;AMEACA;AV FLOR DE SEDA;1290;748;13/3/2001 23:57:00;INICIATIVA;S;0;LINDEIA;BH;599939.54;790359.54;3353
-3355;2001139851;B04001;HOMICIDIO TENTAD;RUA DO CRUZEIRO;55;18854;14/3/2001 00:16:00;CIDADAO COMUM;S;;SAO MARCOS;BH;613597.78;802791.01;3354
-3356;2001140018;B03000;AMEACA;AV ANTONIO ABRAH;1000;4320;14/3/2001 03:26:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;3355
-3357;2001140054;B04001;HOMICIDIO TENTAD;RUA 39;176;302835;14/3/2001 04:59:00;INICIATIVA;N;0;NOVO AARAO REIS;BH;613952.77;805354.20;3356
-3358;2001140062;B08000;VIOLACAO DE DOMI;RUA CEARA;179;14406;14/3/2001 05:30:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;612485.49;796745.96;3357
-3359;2001140070;B06000;LESAO CORPORAL;RUA DOS CARIJOS;1022;81243;14/3/2001 05:48:00;INICIATIVA;S;0;CENTRO BH;BH;610474.65;797355.45;3358
-3360;2001140080;B03000;AMEACA;RUA LUCIO FLAVIO;20;50972;14/3/2001 06:11:00;CIDADAO COMUM;S;0;MINASCAIXA;BH;609454.19;809673.48;3359
-3361;2001140086;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;421;6353;14/3/2001 06:15:00;CIDADAO COMUM;S;;FLORESTA;BH;611953.21;797271.49;3360
-3362;2001140106;B06000;LESAO CORPORAL;RUA GENERAL EPHI;115;50059;14/3/2001 07:06:00;CIDADAO COMUM;S;;ITAPOA;BH;609233.80;805997.47;3361
-3363;2001140112;B06000;LESAO CORPORAL;RUA LEOPOLDINA;13;40739;14/3/2001 07:12:00;CIDADAO COMUM;N;0;SANTO ANTONIO;BH;610963.61;794854.30;3362
-3364;2001140131;B02000;RIXA;RUA MANAUS;346;42747;14/3/2001 07:34:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;612940.29;796427.76;3363
-3365;2001140321;B03000;AMEACA;RUA DAVIDSON PIM;214;124189;14/3/2001 09:35:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607258.18;811738.99;3364
-3366;2001140457;B03000;AMEACA;RUA SAO CLARET;190;114755;14/3/2001 11:03:00;CIDADAO COMUM;N;AP302;VILA SILVEIRA;BH;611777.60;800427.71;3365
-3367;2001140661;B02000;RIXA;AV DOM PEDRO II;3400;53145;14/3/2001 13:38:00;INICIATIVA;N;;ADELAIDE;BH;607623.64;797937.10;3366
-3368;2001140669;B06000;LESAO CORPORAL;RUA PROFESSOR MO;725;55585;14/3/2001 13:40:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611848.20;794904.52;3367
-3369;2001140698;B08000;VIOLACAO DE DOMI;RUA ALFREDO NOHM;199;22704;14/3/2001 13:57:00;INICIATIVA;S;0;DAS INDUSTRIAS;BH;604541.99;792319.73;3368
-3370;2001140875;B03000;AMEACA;RUA PONTA PORA;140;54601;14/3/2001 16:03:00;POLICIAL MILITAR;N;;SANTA EFIGENIA;BH;613187.23;796919.20;3369
-3371;2001140906;B03000;AMEACA;RUA STA JUDITE;565;60816;14/3/2001 16:18:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608890.87;800502.72;3370
-3372;2001141013;B06000;LESAO CORPORAL;AV GETULIO VARGA;809;81256;14/3/2001 17:19:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611927.12;795308.34;3371
-3373;2001141071;B03000;AMEACA;RUA ALDO DE SA B;49;98750;14/3/2001 17:51:00;CIDADAO COMUM;N;;DA LAGOA;BH;604924.09;809416.56;3372
-3374;2001141121;B06000;LESAO CORPORAL;AV GETULIO VARGA;613;81256;14/3/2001 18:15:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612093.15;795403.01;3373
-3375;2001141197;B03000;AMEACA;RUA SOFRE;42;85588;14/3/2001 18:58:00;CIDADAO COMUM;S;0;GOIANIA;BH;615466.95;802363.54;3374
-3376;2001141259;B04001;HOMICIDIO TENTAD;RUA CAPELINHA;20;300406;14/3/2001 19:24:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610483.17;793376.89;3375
-3377;2001141269;B06000;LESAO CORPORAL;RUA ARANTINA;165;58697;14/3/2001 19:35:00;CIDADAO COMUM;N;;MINASLANDIA;BH;612211.61;804489.48;3376
-3378;2001141276;B03000;AMEACA;RUA W QUATRO;514;122634;14/3/2001 19:38:00;CIDADAO COMUM;N;;PONGELUPE;BH;603929.62;787324.64;3377
-3379;2001141312;B03000;AMEACA;RUA RIO POMBA;1246;54567;14/3/2001 19:54:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;607109.63;797801.63;3378
-3380;2001141380;B06000;LESAO CORPORAL;AV CORONEL JOSE ;181;84604;14/3/2001 20:33:00;CIDADAO COMUM;S;;SAO JOSE;BH;608832.60;803978.64;3379
-3381;2001141402;B06000;LESAO CORPORAL;RUA MARIANA BARC;145;62994;14/3/2001 20:47:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608869.02;800147.51;3380
-3382;2001141441;B03000;AMEACA;RUA CEARA;279;14406;14/3/2001 21:09:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612470.16;796689.96;3381
-3383;2001141449;B03000;AMEACA;RUA JOSE DE OLIV;25;63161;14/3/2001 21:13:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604052.63;790469.09;3382
-3384;2001141461;B03000;AMEACA;RUA OITENTA E TR;50;124280;14/3/2001 21:20:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607669.40;811934.97;3383
-3385;2001141469;B03000;AMEACA;RUA MARTINS AFON;388;71457;14/3/2001 21:23:00;CIDADAO COMUM;N;0;PATROCINIO;BH;603630.03;799348.03;3384
-3386;2001141515;B06000;LESAO CORPORAL;RUA JULIO KLEIM ;344;7302;14/3/2001 21:53:00;INICIATIVA;N;0;BETANIA;BH;605961.02;792449.57;3385
-3387;2001141665;B06000;LESAO CORPORAL;RUA CORONEL JOAQ;372;87063;14/3/2001 23:26:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604738.67;807922.80;3386
-3388;2001141677;B09000;ABANDONO DE INCA;RUA CONEGO PINHE;708;16820;14/3/2001 23:33:00;CIDADAO COMUM;S;;PARAISO;BH;614349.66;796709.82;3387
-3389;2001141900;B06000;LESAO CORPORAL;RUA HENRIQUE DIA;93;33042;15/3/2001 03:13:00;CIDADAO COMUM;N;0;APARECIDA;BH;609281.26;800060.96;3388
-3390;2001141953;B03000;AMEACA;RUA JOANESIA;9;37406;15/3/2001 04:25:00;CIDADAO COMUM;N;AP03;SERRA;BH;612963.67;795138.79;3389
-3391;2001142178;B03000;AMEACA;RUA NOGUEIRA DE ;28;47800;15/3/2001 08:54:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604732.74;795679.00;3390
-3392;2001142412;B06000;LESAO CORPORAL;RUA SESSENTA E O;31;106066;15/3/2001 11:32:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607962.18;811691.00;3391
-3393;2001142522;B06000;LESAO CORPORAL;RUA NELSON JOSE ;59;98877;15/3/2001 12:52:00;CIDADAO COMUM;S;;DA LAGOA;BH;604821.51;809427.80;3392
-3394;2001142577;B03000;AMEACA;RUA SILVA ORTIZ;300;7520;15/3/2001 13:26:00;CIDADAO COMUM;N;;JOAO PINHEIRO;BH;604675.35;796257.53;3393
-3395;2001142606;B03000;AMEACA;RUA MALVA;156;115760;15/3/2001 13:49:00;CIDADAO COMUM;S;;HAVAI;BH;607321.62;793409.57;3394
-3396;2001142647;B03000;AMEACA;RUA LUTHER KING;20;41946;15/3/2001 14:12:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612652.26;799995.01;3395
-3397;2001142773;B06000;LESAO CORPORAL;RUA CARLOS EDUAR;436;92073;15/3/2001 15:31:00;CIDADAO COMUM;S;0;FILADELFIA;BH;602312.89;797192.51;3396
-3398;2001142875;B02000;RIXA;RUA CONCEICAO DA;180;14258;15/3/2001 16:17:00;INICIATIVA;S;0;SANTA TEREZINHA;BH;604616.08;802515.97;3397
-3399;2001142985;B03000;AMEACA;RUA SANTOS;2200;61910;15/3/2001 17:24:00;INICIATIVA;S;0;SAO DOMINGOS;BH;607908.90;793256.53;3398
-3400;2001143090;B03000;AMEACA;RUA ASCENCAO;26;6278;15/3/2001 18:09:00;CIDADAO COMUM;S;;SAO JOSE;BH;605379.29;798810.81;3399
-3401;2001143142;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;351;16988;15/3/2001 18:33:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606657.62;794080.67;3400
-3402;2001143187;B03000;AMEACA;AV SANTOS DUMONT;381;61950;15/3/2001 18:55:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611250.50;797490.44;3401
-3403;2001143202;B04001;HOMICIDIO TENTAD;RUA JOSE CHRISTI;105;106949;15/3/2001 19:02:00;INICIATIVA;N;0;NOVA CINTRA;BH;605792.55;793322.96;3402
-3404;2001143346;B03000;AMEACA;RUA CONDE D'EU;926;16631;15/3/2001 20:27:00;INICIATIVA;S;0;SAUDADE;BH;615552.91;797716.18;3403
-3405;2001143397;B03000;AMEACA;RUA CONDE D'EU;923;16631;15/3/2001 20:56:00;CIDADAO COMUM;S;FU;SAUDADE;BH;615588.75;797702.47;3404
-3406;2001143398;B03000;AMEACA;RUA UM;114;96005;15/3/2001 20:56:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614583.51;803368.88;3405
-3407;2001143408;B03000;AMEACA;RUA CINCO;407;81647;15/3/2001 21:02:00;CIDADAO COMUM;N;;OLHOS DAGUA;BH;608262.81;788625.24;3406
-3408;2001143418;B05000;SEQUESTRO E CARC;RUA ABAETE;55;546;15/3/2001 21:04:00;CIDADAO COMUM;N;0;BONFIM;BH;610111.42;797998.63;3407
-3409;2001143426;B03000;AMEACA;RUA FATIMA SIMOE;44;117205;15/3/2001 21:15:00;CIDADAO COMUM;S;0;CAPITAO EDUARDO;BH;618332.22;806602.98;3408
-3410;2001143452;B03000;AMEACA;RUA JOSE SABINO ;125;98911;15/3/2001 21:28:00;CIDADAO COMUM;N;;DA LAGOA;BH;604731.93;809431.45;3409
-3411;2001143454;B03000;AMEACA;RUA PROFESSORA R;305;51887;15/3/2001 21:30:00;CIDADAO COMUM;S;;REGINA;BH;598852.69;790207.85;3410
-3412;2001143478;B04002;HOMICIDIO CONSUM;RUA DA BOLIVIA;136;9884;15/3/2001 21:47:00;CIDADAO COMUM;N;AP202;SAO PEDRO;BH;611293.61;793900.87;3411
-3413;2001143483;B06000;LESAO CORPORAL;RUA JACINTO FERR;209;36674;15/3/2001 21:49:00;CIDADAO COMUM;S;;NOVA BARROCA;BH;607663.08;792741.35;3412
-3414;2001143485;B06000;LESAO CORPORAL;RUA MANOEL CAYLL;121;43043;15/3/2001 21:52:00;CIDADAO COMUM;S;;HORTO;BH;613259.68;798134.49;3413
-3415;2001143512;B06000;LESAO CORPORAL;RUA VIRTULINO PI;155;130438;15/3/2001 22:06:00;CIDADAO COMUM;N;0;OLARIA;BH;602074.19;789195.72;3414
-3416;2001143628;B06000;LESAO CORPORAL;RUA MENDES DE OL;1084;45430;15/3/2001 23:17:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609718.74;799470.77;3415
-3417;2001143672;B06000;LESAO CORPORAL;RUA DOS AGRONOMO;270;103459;15/3/2001 23:48:00;CIDADAO COMUM;N;;CONJUNTO ALIPIO ;BH;604645.46;800074.41;3416
-3418;2001143686;B06000;LESAO CORPORAL;RUA JOSE DE LIMA;37;38897;15/3/2001 23:58:00;INICIATIVA;S;0;FLORAMAR;BH;611871.50;805757.42;3417
-3419;2001143707;B03000;AMEACA;RUA CONDE D'EU;923;16631;16/3/2001 00:07:00;CIDADAO COMUM;S;0;SAUDADE;BH;615588.75;797702.47;3418
-3420;2001143721;B03000;AMEACA;RUA CAMPOS SALES;472;12300;16/3/2001 00:17:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;607050.85;796279.60;3419
-3421;2001143726;B06000;LESAO CORPORAL;RUA CARLOS FREDE;70;20610;16/3/2001 00:21:00;INICIATIVA;S;0;OURO PRETO;BH;606320.33;802238.74;3420
-3422;2001143738;B03000;AMEACA;RUA GUILHERME DE;400;32484;16/3/2001 00:28:00;CIDADAO COMUM;S;AP202;SANTO ANTONIO;BH;610616.72;793886.05;3421
-3423;2001143787;B03000;AMEACA;RUA SAO PAULO;848;63464;16/3/2001 01:17:00;INICIATIVA;N;APT1302;CENTRO BH;BH;610915.13;796961.87;3422
-3424;2001143833;B06000;LESAO CORPORAL;RUA ALCIDES PERE;866;107711;16/3/2001 01:54:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606811.68;811564.61;3423
-3425;2001143851;B02000;RIXA;RUA MAJOR LOPES;760;42646;16/3/2001 02:16:00;CIDADAO COMUM;N;0;SAO PEDRO;BH;611405.26;794100.40;3424
-3426;2001143859;B04002;HOMICIDIO CONSUM;RUA DOUTOR ARGEM;160;23155;16/3/2001 02:25:00;CIDADAO COMUM;N;;SAO LUCAS;BH;614033.70;795650.47;3425
-3427;2001143974;B04001;HOMICIDIO TENTAD;RUA INDIANA;1270;34410;16/3/2001 04:58:00;INICIATIVA;S;0;JARDIM AMERICA;BH;607710.69;794088.68;3426
-3428;2001144154;B03000;AMEACA;RUA LUIZA SAN MA;861;41858;16/3/2001 08:34:00;CIDADAO COMUM;S;;PARAISO;BH;614280.39;796336.59;3427
-3429;2001144327;B03000;AMEACA;RUA A;709;41110;16/3/2001 10:17:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602648.51;802862.42;3428
-3430;2001144365;B06000;LESAO CORPORAL;RUA JOAO ZACARIA;100;15500;16/3/2001 10:40:00;CIDADAO COMUM;N;;COPACABANA;BH;605379.27;806582.71;3429
-3431;2001144404;B03000;AMEACA;RUA PROFESSORA M;1090;70987;16/3/2001 11:06:00;CIDADAO COMUM;S;0;VILA OESTE;BH;604347.01;795429.68;3430
-3432;2001144467;B06000;LESAO CORPORAL;RUA PRINCIPAL;38;102699;16/3/2001 11:40:00;CIDADAO COMUM;S;;TIROL;BH;600913.57;789222.97;3431
-3433;2001144509;B03000;AMEACA;RUA CINCO;10;27128;16/3/2001 12:04:00;INICIATIVA;S;0;PAULO SEXTO;BH;616475.28;806960.67;3432
-3434;2001144526;B04002;HOMICIDIO CONSUM;RUA DOS BANDOLIN;540;106980;16/3/2001 12:17:00;CIDADAO COMUM;S;0;CH CALIFORNIA;BH;603983.54;797176.08;3433
-3435;2001144569;B06000;LESAO CORPORAL;RUA DOS TUPIS;820;69965;16/3/2001 12:48:00;INICIATIVA;S;0;CENTRO (BH);BH;610499.24;797065.06;3434
-3436;2001144598;B03000;AMEACA;AV DOM PEDRO II;5092;53145;16/3/2001 13:03:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606214.33;798752.85;3435
-3437;2001144639;B02000;RIXA;RUA HELIO GILBER;15;55991;16/3/2001 13:36:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611891.86;806760.29;3436
-3438;2001144721;B03000;AMEACA;RUA GONCALVES DI;146;31513;16/3/2001 14:32:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;612406.58;795539.25;3437
-3439;2001144748;B03000;AMEACA;RUA CEARA;640;14406;16/3/2001 14:49:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;612330.77;796303.86;3438
-3440;2001145048;B06000;LESAO CORPORAL;RUA JOSE MARIANO;11;50480;16/3/2001 17:42:00;CIDADAO COMUM;S;CAA;TUPI;BH;612132.07;806501.28;3439
-3441;2001145123;B03000;AMEACA;RUA PADRE EUSTAQ;2408;51294;16/3/2001 18:22:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607296.09;797652.98;3440
-3442;2001145159;B03000;AMEACA;RUA MARIA COLARE;37;93832;16/3/2001 18:38:00;CIDADAO COMUM;S;0;DIAMANTE;BH;601312.46;789810.08;3441
-3443;2001145277;B04001;HOMICIDIO TENTAD;RUA FERNAO DIAS;1084;28133;16/3/2001 19:37:00;INICIATIVA;S;0;VERA CRUZ;BH;616058.53;798249.96;3442
-3444;2001145292;B06000;LESAO CORPORAL;AV OLEGARIO MACI;228;49699;16/3/2001 19:45:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610607.36;797465.13;3443
-3445;2001145345;B03000;AMEACA;RUA GENERAL OZOR;958;30901;16/3/2001 20:19:00;CIDADAO COMUM;S;CSA;VERA CRUZ;BH;616275.74;798043.34;3444
-3446;2001145353;B03000;AMEACA;RUA SAMBEATIBA;292;60163;16/3/2001 20:20:00;CIDADAO COMUM;N;CSA;CACHOEIRINHA;BH;610595.78;801153.89;3445
-3447;2001145392;B04001;HOMICIDIO TENTAD;RUA CAPIVARI;547;12918;16/3/2001 20:43:00;INICIATIVA;S;0;SERRA;BH;613619.59;794775.30;3446
-3448;2001145393;B03000;AMEACA;RUA TIZIU;562;95881;16/3/2001 20:41:00;CIDADAO COMUM;S;0;GOIANIA;BH;615351.18;802590.79;3447
-3449;2001145406;B06000;LESAO CORPORAL;RUA JOSE DO CARM;135;69559;16/3/2001 20:47:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609514.03;809256.67;3448
-3450;2001145411;B06000;LESAO CORPORAL;RUA ALFEU DE CAR;235;2223;16/3/2001 20:53:00;CIDADAO COMUM;S;;TUPI;BH;613587.67;805832.09;3449
-3451;2001145528;B06000;LESAO CORPORAL;RUA ARTUR DE SA;1081;6211;16/3/2001 21:51:00;CIDADAO COMUM;S;;UNIAO;BH;612820.90;801929.81;3450
-3452;2001145532;B06000;LESAO CORPORAL;RUA CARLOS MUZZI;167;89967;16/3/2001 21:52:00;INICIATIVA;S;0;PALMEIRAS;BH;606570.26;791453.47;3451
-3453;2001145575;B03000;AMEACA;RUA MAURILIO GOM;653;43941;16/3/2001 22:18:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604472.94;789934.70;3452
-3454;2001145625;B06000;LESAO CORPORAL;AV ITAU;1307;36025;16/3/2001 22:53:00;CIDADAO COMUM;N;0;JOAO PINHEIRO;BH;604313.94;796735.81;3453
-3455;2001145635;B03000;AMEACA;RUA ALMADA;97;2393;16/3/2001 22:56:00;CIDADAO COMUM;S;;PINDORAMA;BH;602560.67;797874.36;3454
-3456;2001145654;B03000;AMEACA;RUA TAMBORIL;536;66793;16/3/2001 23:08:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611236.65;799260.64;3455
-3457;2001145661;B03000;AMEACA;RUA SERRINHA;100;129201;16/3/2001 23:13:00;INICIATIVA;S;0;MANGUEIRAS;BH;600477.81;786778.57;3456
-3458;2001145706;B03000;AMEACA;RUA ENGENHO VERM;113;94835;16/3/2001 23:38:00;CIDADAO COMUM;N;;ENGENHO NOGUEIRA;BH;606509.65;800521.34;3457
-3459;2001145734;B03000;AMEACA;RUA CANDIDO LUCI;639;12568;16/3/2001 23:49:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609554.18;800062.48;3458
-3460;2001145800;B03000;AMEACA;RUA BENJAMIM JAC;98;9207;17/3/2001 00:31:00;CIDADAO COMUM;S;0;GUTIERREZ;BH;608757.98;794815.62;3459
-3461;2001145809;B03000;AMEACA;RUA NEFELINA;99;81228;17/3/2001 00:36:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612838.15;797304.69;3460
-3462;2001145819;B03000;AMEACA;AV CLARA NUNES;736;45644;17/3/2001 00:39:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;611029.42;800977.57;3461
-3463;2001145919;B04001;HOMICIDIO TENTAD;RUA PADRE CYR AS;10;12091;17/3/2001 01:34:00;CIDADAO COMUM;S;CS1;PRIMEIRO DE MAIO;BH;612115.88;803483.73;3462
-3464;2001145937;B03000;AMEACA;RUA EDSON LUIZ M;112;25062;17/3/2001 01:47:00;CIDADAO COMUM;N;CAB;MARIA GORETTI;BH;614197.63;803631.48;3463
-3465;2001145961;B06000;LESAO CORPORAL;RUA ALEM PARAIBA;504;81357;17/3/2001 02:04:00;CIDADAO COMUM;S;0;BONFIM;BH;610323.38;798258.43;3464
-3466;2001145973;B06000;LESAO CORPORAL;RUA MATA DA CORD;80;45111;17/3/2001 02:15:00;INICIATIVA;N;0;MANGABEIRAS;BH;613257.08;793831.98;3465
-3467;2001145992;B06000;LESAO CORPORAL;AV LEONTINO FRAN;130;445;17/3/2001 02:30:00;CIDADAO COMUM;N;0;SERRA VERDE;BH;609625.47;810530.91;3466
-3468;2001146010;B09000;ABANDONO DE INCA;RUA XAPURI;945;73815;17/3/2001 02:46:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607567.46;794124.12;3467
-3469;2001146013;B08000;VIOLACAO DE DOMI;RUA MARIA ANALIA;32;300366;17/3/2001 02:49:00;CIDADAO COMUM;N;0;POMPEIA;BH;606878.92;808915.74;3468
-3470;2001146058;B02000;RIXA;AV JOSE LOPES MU;280;19176;17/3/2001 03:17:00;CIDADAO COMUM;S;BAR DO NADINHO;FLORAMAR;BH;611600.65;806347.17;3469
-3471;2001146078;B09000;ABANDONO DE INCA;RUA PADRE JULIO ;689;51496;17/3/2001 03:30:00;INICIATIVA;S;0;VERA CRUZ;BH;615671.77;797489.47;3470
-3472;2001146094;B03000;AMEACA;RUA ALAGOAS;1498;1678;17/3/2001 03:42:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611220.75;794842.31;3471
-3473;2001146100;B04001;HOMICIDIO TENTAD;RUA MANOEL TAVAR;303;1536;17/3/2001 03:48:00;CIDADAO COMUM;N;;GOIANIA;BH;614997.46;802812.46;3472
-3474;2001146163;B06000;LESAO CORPORAL;RUA DOS CARIJOS;91;81243;17/3/2001 04:51:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611378.20;797082.80;3473
-3475;2001146168;B06000;LESAO CORPORAL;RUA TREMEDAL;10;68240;17/3/2001 04:54:00;INICIATIVA;S;0;CARLOS PRATES;BH;609440.09;797845.02;3474
-3476;2001146172;B03000;AMEACA;RUA ITALO DINELI;99;93063;17/3/2001 04:58:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;601209.85;786107.68;3475
-3477;2001146366;B06000;LESAO CORPORAL;RUA DOS GUARANIS;319;32181;17/3/2001 08:58:00;INICIATIVA;N;0;CENTRO BH;BH;610709.97;797311.90;3476
-3478;2001146390;B06000;LESAO CORPORAL;RUA VINTE;44;102342;17/3/2001 09:13:00;CIDADAO COMUM;N;;CEU AZUL;BH;604034.56;807504.41;3477
-3479;2001146418;B06000;LESAO CORPORAL;PRACA CARDEAL AR;16;13182;17/3/2001 09:24:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605707.20;793813.75;3478
-3480;2001146428;B03000;AMEACA;RUA BARREIRO;771;84342;17/3/2001 09:33:00;CIDADAO COMUM;S;;SAO GERALDO;BH;616339.91;799085.95;3479
-3481;2001146534;B06000;LESAO CORPORAL;RUA SEN FIRMINO;118;80616;17/3/2001 10:59:00;CIDADAO COMUM;S;CA1;OURO PRETO;BH;606298.47;801983.26;3480
-3482;2001146568;B04001;HOMICIDIO TENTAD;AV ARTUR BERNARD;2772;60844;17/3/2001 11:21:00;CIDADAO COMUM;S;;VILA PARIS;BH;610407.76;793270.00;3481
-3483;2001146634;B06000;LESAO CORPORAL;RUA DO CERCADINH;415;14881;17/3/2001 12:02:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606735.94;794868.66;3482
-3484;2001146649;B06000;LESAO CORPORAL;RUA GERALDO LOPE;88;46940;17/3/2001 12:11:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606827.06;812118.20;3483
-3485;2001146661;B06000;LESAO CORPORAL;RUA DOS INCAS;75;34335;17/3/2001 12:19:00;CIDADAO COMUM;N;;SANTA MONICA;BH;606866.81;806924.00;3484
-3486;2001146766;B03000;AMEACA;RUA MONTE CASSIN;235;46432;17/3/2001 13:40:00;CIDADAO COMUM;S;;SANTA BRANCA;BH;607986.57;806091.99;3485
-3487;2001146775;B06000;LESAO CORPORAL;RUA TEBAS;818;67090;17/3/2001 13:47:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616044.45;798315.21;3486
-3488;2001146785;B03000;AMEACA;RUA CAMOES;197;11971;17/3/2001 13:56:00;POLICIAL MILITAR;S;0;SAO LUCAS;BH;613046.92;795889.39;3487
-3489;2001146845;B08000;VIOLACAO DE DOMI;RUA ALEM PARAIBA;127;81357;17/3/2001 14:36:00;CIDADAO COMUM;N;0;BONFIM;BH;610651.10;798047.31;3488
-3490;2001146854;B03000;AMEACA;RUA FLAVIO MARQU;212;28436;17/3/2001 14:43:00;CIDADAO COMUM;N;CAFU;BARREIRO;BH;603060.95;791135.44;3489
-3491;2001146865;B03000;AMEACA;RUA JOAQUINA ANG;100;84761;17/3/2001 14:56:00;CIDADAO COMUM;S;;DA LAGOA;BH;604531.65;809462.44;3490
-3492;2001146909;B06000;LESAO CORPORAL;RUA NELSON;633;47407;17/3/2001 15:16:00;CIDADAO COMUM;S;;UNIAO;BH;613054.57;801287.70;3491
-3493;2001146913;B03000;AMEACA;RUA ARACY DE ALM;11;85648;17/3/2001 15:20:00;INICIATIVA;N;0;GOIANIA;BH;614691.72;803615.96;3492
-3494;2001146921;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;1892;17026;17/3/2001 15:27:00;CIDADAO COMUM;N;;JARDIM AMERICA;BH;607532.92;793643.55;3493
-3495;2001146935;B03000;AMEACA;RUA LIVRAMENTO;275;41325;17/3/2001 15:32:00;CIDADAO COMUM;S;APT 103;VILA OESTE;BH;604678.91;795400.30;3494
-3496;2001147012;B03000;AMEACA;RUA CARANCHO;22;13079;17/3/2001 16:20:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604506.63;788542.81;3495
-3497;2001147051;B03000;AMEACA;AV PROFESSOR ALF;400;2264;17/3/2001 16:36:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;611944.42;796416.90;3496
-3498;2001147124;B06000;LESAO CORPORAL;RUA JOSE LAVARIN;237;40537;17/3/2001 17:21:00;CIDADAO COMUM;S;;PARAISO;BH;614295.70;796691.51;3497
-3499;2001147147;B06000;LESAO CORPORAL;RUA PAVAO;60;171510;17/3/2001 17:34:00;CIDADAO COMUM;S;0;VILA CEMIG;BH;605536.69;788858.86;3498
-3500;2001147176;B03000;AMEACA;RUA CINCO DE JUL;114;15670;17/3/2001 17:50:00;CIDADAO COMUM;N;0;PRIMEIRO DE MAIO;BH;612338.42;803849.66;3499
-3501;2001147190;B03000;AMEACA;RUA OITENTA E TR;7;124280;17/3/2001 18:02:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607733.73;811916.10;3500
-3502;2001147202;B06000;LESAO CORPORAL;RUA MARIA AMELIA;151;43812;17/3/2001 18:10:00;INICIATIVA;N;0;SAO TOMAZ;BH;610196.88;805486.32;3501
-3503;2001147220;B03000;AMEACA;RUA CRUZ DE MALT;19;18813;17/3/2001 18:17:00;CIDADAO COMUM;S;CA;NAZARE;BH;615899.65;804621.81;3502
-3504;2001147259;B03000;AMEACA;RUA MARIO SOARES;464;44641;17/3/2001 18:35:00;CIDADAO COMUM;N;FU;DOM BOSCO;BH;604167.26;797273.60;3503
-3505;2001147303;B04001;HOMICIDIO TENTAD;RUA TEBAS;670;67090;17/3/2001 19:00:00;INICIATIVA;N;0;VERA CRUZ;BH;615977.89;798300.24;3504
-3506;2001147318;B06000;LESAO CORPORAL;AV PRESIDENTE AN;845;4461;17/3/2001 19:06:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610492.26;798773.24;3505
-3507;2001147322;B06000;LESAO CORPORAL;AV ANTONIO ABRAH;1000;4320;17/3/2001 19:08:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;3506
-3508;2001147330;B06000;LESAO CORPORAL;RUA MARIO MARTIN;232;44600;17/3/2001 19:13:00;CIDADAO COMUM;S;0;POMPEIA;BH;614937.63;797990.94;3507
-3509;2001147345;B03000;AMEACA;RUA ITAPOA;274;35873;17/3/2001 19:17:00;CIDADAO COMUM;S;;GLORIA;BH;602804.26;798134.63;3508
-3510;2001147381;B03000;AMEACA;RUA PARA DE MINA;821;52070;17/3/2001 19:31:00;INICIATIVA;S;0;PADRE EUSTAQUIO;BH;605833.93;797706.32;3509
-3511;2001147383;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;1001;26052;17/3/2001 19:31:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611161.78;796678.49;3510
-3512;2001147390;B03000;AMEACA;RUA RADIALISTA D;196;99334;17/3/2001 19:31:00;CIDADAO COMUM;N;;CEU AZUL;BH;605026.18;807770.66;3511
-3513;2001147410;B04001;HOMICIDIO TENTAD;RUA JACAREI;1190;13154;17/3/2001 19:44:00;CIDADAO COMUM;N;0;PINDORAMA;BH;602313.10;797841.05;3512
-3514;2001147411;B06000;LESAO CORPORAL;RUA GALDINO;4;75590;17/3/2001 19:46:00;CIDADAO COMUM;N;;LINDEIA;BH;599722.92;790847.61;3513
-3515;2001147421;B04002;HOMICIDIO CONSUM;RUA CINQUENTA E ;114;106201;17/3/2001 19:50:00;CIDADAO COMUM;N;0;NOVA YORK;BH;608696.88;810953.35;3514
-3516;2001147431;B03000;AMEACA;RUA MAJOR LOPES;511;42646;17/3/2001 19:56:00;CIDADAO COMUM;N;;SAO PEDRO;BH;611467.06;794345.31;3515
-3517;2001147502;B04001;HOMICIDIO TENTAD;RUA JOANA DARC;326;170141;17/3/2001 20:22:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614576.09;794880.91;3516
-3518;2001147504;B06000;LESAO CORPORAL;RUA JOSE LEAL DO;119;110593;17/3/2001 20:24:00;CIDADAO COMUM;N;;JARDIM GUANABARA;BH;611553.51;807888.66;3517
-3519;2001147523;B06000;LESAO CORPORAL;RUA DOS ALAMOS;234;90080;17/3/2001 20:30:00;CIDADAO COMUM;S;;MARAJO;BH;606897.14;792529.00;3518
-3520;2001147617;B02000;RIXA;RUA MONTE ALEGRE;285;46357;17/3/2001 21:14:00;CIDADAO COMUM;S;;SERRA;BH;612735.09;795362.92;3519
-3521;2001147651;B03000;AMEACA;RUA CORACAO EUCA;284;17344;17/3/2001 21:29:00;CIDADAO COMUM;S;AP301;CORACAO EUCARIST;BH;605751.72;796518.06;3520
-3522;2001147658;B04001;HOMICIDIO TENTAD;RUA LONDRES;286;41366;17/3/2001 21:34:00;CIDADAO COMUM;N;;COPACABANA;BH;606209.73;806102.86;3521
-3523;2001147672;B06000;LESAO CORPORAL;RUA TABOAO DA SE;36;53347;17/3/2001 21:41:00;INICIATIVA;S;0;ITAIPU BH;BH;599335.27;788659.59;3522
-3524;2001147676;B06000;LESAO CORPORAL;RUA CRACOVIA;620;85317;17/3/2001 21:43:00;CIDADAO COMUM;S;CA620C;JARDIM EUROPA;BH;608692.32;810242.32;3523
-3525;2001147725;B06000;LESAO CORPORAL;RUA CAMIG;54;83453;17/3/2001 22:07:00;CIDADAO COMUM;S;;BETANIA;BH;604759.31;792879.57;3524
-3526;2001147744;B03000;AMEACA;RODOVIA MGT 262;248;26598;17/3/2001 22:18:00;CIDADAO COMUM;S;0;VILA BRASILIA;BH;614638.21;803650.72;3525
-3527;2001147745;B06000;LESAO CORPORAL;RUA IMPERATRIZ;30;122357;17/3/2001 22:18:00;CIDADAO COMUM;N;;SAO TOMAZ;BH;609306.94;805400.92;3526
-3528;2001147758;B06000;LESAO CORPORAL;RUA CHAFARIZ;100;300275;17/3/2001 22:23:00;CIDADAO COMUM;S;;HAVAI;BH;607371.53;793762.11;3527
-3529;2001147909;B04002;HOMICIDIO CONSUM;RUA SERRINHA;74;129201;17/3/2001 23:57:00;CIDADAO COMUM;N;0;MANGUEIRAS;BH;600452.04;787052.18;3528
-3530;2001147918;B04001;HOMICIDIO TENTAD;RUA BRAS;90;170835;18/3/2001 00:03:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608062.97;793879.17;3529
-3531;2001147927;B03000;AMEACA;RUA EMANUEL;77;87010;18/3/2001 00:07:00;CIDADAO COMUM;S;;PILAR;BH;607761.58;788553.01;3530
-3532;2001147937;B06000;LESAO CORPORAL;RUA COARI;241;16092;18/3/2001 00:15:00;INICIATIVA;S;0;SAO GERALDO;BH;615219.20;799212.31;3531
-3533;2001148061;B06000;LESAO CORPORAL;RUA LAVRAS;107;40540;18/3/2001 01:35:00;CIDADAO COMUM;S;0;SAO PEDRO;BH;611511.59;794723.74;3532
-3534;2001148065;B04002;HOMICIDIO CONSUM;RUA DA PEDREIRA;350;301298;18/3/2001 01:36:00;INICIATIVA;S;L;MORRO DAS PEDRAS;BH;608618.39;794087.94;3533
-3535;2001148069;B06000;LESAO CORPORAL;RUA LUIZ LOPES;333;94431;18/3/2001 01:40:00;CIDADAO COMUM;S;;OURO PRETO;BH;606306.33;801223.55;3534
-3536;2001148077;B06000;LESAO CORPORAL;RUA HERACLITO;210;125598;18/3/2001 01:46:00;CIDADAO COMUM;N;;BELMONT;BH;615384.05;804976.88;3535
-3537;2001148121;B06000;LESAO CORPORAL;RUA OLIMPIO DA S;59;28045;18/3/2001 02:10:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612549.53;803816.58;3536
-3538;2001148173;B06000;LESAO CORPORAL;AV FURQUIM WERNE;100;650;18/3/2001 02:43:00;INICIATIVA;N;0;TUPI;BH;613046.58;805827.69;3537
-3539;2001148195;B03000;AMEACA;RUA LUIZA EFIGEN;275;119560;18/3/2001 03:02:00;CIDADAO COMUM;N;APTO309;VILA MAGNESITA;BH;602642.26;795177.79;3538
-3540;2001148220;B03000;AMEACA;AV CRISTIANO MAC;2020;18652;18/3/2001 03:24:00;CIDADAO COMUM;S;AP203;CIDADE NOVA;BH;612192.14;800401.14;3539
-3541;2001148232;B04001;HOMICIDIO TENTAD;RUA SOARES NOGUE;550;66220;18/3/2001 03:31:00;CIDADAO COMUM;N;0;VILA MAGNESITA;BH;602599.93;794792.84;3540
-3542;2001148242;B04001;HOMICIDIO TENTAD;RUA ALICE;182;170949;18/3/2001 03:39:00;CIDADAO COMUM;N;PX109;MORRO DAS PEDRAS;BH;608002.45;793792.58;3541
-3543;2001148332;B04001;HOMICIDIO TENTAD;AV CENTRAL;22;14812;18/3/2001 05:01:00;INICIATIVA;N;0;JARDIM LEBLON;BH;606118.45;806004.26;3542
-3544;2001148366;B04002;HOMICIDIO CONSUM;RUA FARADAY;50;27764;18/3/2001 05:49:00;CIDADAO COMUM;N;FU;PRIMEIRO DE MAIO;BH;612221.44;803449.31;3543
-3545;2001148395;B03000;AMEACA;AV PADRE JOSE MA;292;53448;18/3/2001 06:59:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605582.54;793667.41;3544
-3546;2001148431;B06000;LESAO CORPORAL;RUA OLARIA;30;49560;18/3/2001 07:57:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610900.05;805173.88;3545
-3547;2001148433;B06000;LESAO CORPORAL;RUA FLOR D'AGUA;600;28565;18/3/2001 07:55:00;CIDADAO COMUM;S;ESTA NO H. ALBER;JARDIM MONTANHES;BH;605734.71;800020.84;3546
-3548;2001148499;B08000;VIOLACAO DE DOMI;RUA SAO LUIZ;16;63288;18/3/2001 08:47:00;CIDADAO COMUM;N;CA16;SAO TOMAZ;BH;609860.89;805286.87;3547
-3549;2001148531;B03000;AMEACA;RUA FREDERICO AU;15;29785;18/3/2001 09:21:00;CIDADAO COMUM;N;;UNIVERSITARIO;BH;610671.05;802759.35;3548
-3550;2001148532;B03000;AMEACA;RUA SANTA FRANCI;630;60655;18/3/2001 09:14:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608507.50;800521.15;3549
-3551;2001148612;B03000;AMEACA;RUA HORTENCIA;767;33433;18/3/2001 10:15:00;CIDADAO COMUM;N;;ESPLANADA;BH;614778.34;798272.90;3550
-3552;2001148657;B02000;RIXA;AV ALVARES CABRA;211;2730;18/3/2001 10:51:00;INICIATIVA;N;0;LOURDES;BH;611296.92;796433.12;3551
-3553;2001148692;B03000;AMEACA;RUA LAGOA DOURAD;471;40174;18/3/2001 11:22:00;CIDADAO COMUM;S;;PRADO;BH;608581.17;796507.97;3552
-3554;2001148699;B06000;LESAO CORPORAL;RUA GRAUNAS;429;31797;18/3/2001 11:27:00;CIDADAO COMUM;N;;VILA CEMIG;BH;605560.06;788702.39;3553
-3555;2001148799;B06000;LESAO CORPORAL;RUA SERRA DOS AI;91;65025;18/3/2001 13:02:00;CIDADAO COMUM;N;FU;JARDIM LEBLON;BH;605955.53;807662.83;3554
-3556;2001148843;B04001;HOMICIDIO TENTAD;RUA SERRINHA;168;129201;18/3/2001 13:41:00;CIDADAO COMUM;S;;MANGUEIRAS;BH;600395.13;787259.05;3555
-3557;2001148861;B06000;LESAO CORPORAL;RUA DONA SINVALI;224;59863;18/3/2001 13:59:00;CIDADAO COMUM;N;0;ANTONIO RIBEIRO ;BH;615423.36;806998.20;3556
-3558;2001148866;B06000;LESAO CORPORAL;RUA AMARANTO VER;119;110120;18/3/2001 14:01:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615899.69;806141.36;3557
-3559;2001148880;B06000;LESAO CORPORAL;RUA JOSE ANTENOR;165;16049;18/3/2001 14:09:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612330.81;803766.42;3558
-3560;2001148885;B03000;AMEACA;RUA DR BROCHADO;1076;23215;18/3/2001 14:13:00;CIDADAO COMUM;S;;VERA CRUZ;BH;615982.91;797659.64;3559
-3561;2001148905;B03000;AMEACA;RUA BADARO JUNIO;38;7532;18/3/2001 14:26:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612064.33;803545.79;3560
-3562;2001148907;B06000;LESAO CORPORAL;RUA ARTUR ITABIR;655;6177;18/3/2001 14:28:00;CIDADAO COMUM;N;0;SAO JOSE;BH;607806.80;803463.71;3561
-3563;2001148959;B06000;LESAO CORPORAL;RUA EDMAR COLINI;857;104638;18/3/2001 15:09:00;CIDADAO COMUM;N;0;MANTIQUEIRA;BH;605904.97;812041.11;3562
-3564;2001148973;B04001;HOMICIDIO TENTAD;AV ARTUR BERNARD;1334;60844;18/3/2001 15:15:00;INICIATIVA;N;0;VILA PARIS;BH;610228.38;793304.17;3563
-3565;2001148994;B03000;AMEACA;RUA FRANCISCO GO;65;68569;18/3/2001 15:25:00;CIDADAO COMUM;S;FR23;ESTRELA DALVA;BH;607466.26;792294.61;3564
-3566;2001148998;B04002;HOMICIDIO CONSUM;RUA FLOR DE PITA;119;42949;18/3/2001 15:27:00;CIDADAO COMUM;N;0;INDEPENDENCIA;BH;601600.30;786045.97;3565
-3567;2001149029;B03000;AMEACA;AV AUGUSTO DE LI;1105;6731;18/3/2001 15:46:00;CIDADAO COMUM;N;;BARRO PRETO;BH;610249.02;796782.22;3566
-3568;2001149148;B03000;AMEACA;RUA DELFIM;194;19728;18/3/2001 16:56:00;CIDADAO COMUM;S;;SANTA CRUZ (BARR;BH;603557.64;789073.38;3567
-3569;2001149150;B02000;RIXA;RUA CARMELITA IN;281;121137;18/3/2001 16:57:00;CIDADAO COMUM;S;FU;MALDONADO;BH;602056.77;790380.15;3568
-3570;2001149161;B06000;LESAO CORPORAL;RUA JOAO SAMAHA;1282;7397;18/3/2001 17:02:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608383.18;807945.10;3569
-3571;2001149164;B03000;AMEACA;ALAMEDA INDAIA;105;34363;18/3/2001 17:05:00;CIDADAO COMUM;S;;DOM CABRAL;BH;604920.54;796718.55;3570
-3572;2001149183;B03000;AMEACA;RUA FURTADO DE M;144;30158;18/3/2001 17:15:00;INICIATIVA;S;0;SAO TOMAZ;BH;609931.80;805638.24;3571
-3573;2001149223;B06000;LESAO CORPORAL;RUA DELMO RENAUL;6;70596;18/3/2001 17:46:00;CIDADAO COMUM;S;;AARAO REIS;BH;612821.17;804943.88;3572
-3574;2001149224;B06000;LESAO CORPORAL;RUA MACEDO;285;42182;18/3/2001 17:48:00;CIDADAO COMUM;S;0;FLORESTA;BH;612120.19;798390.29;3573
-3575;2001149235;B03000;AMEACA;RUA DOS PINTASSI;43;53813;18/3/2001 17:55:00;CIDADAO COMUM;N;;VILA CLORIS;BH;610040.49;807382.22;3574
-3576;2001149262;B06000;LESAO CORPORAL;AV JOAO XXIII;287;37926;18/3/2001 18:17:00;CIDADAO COMUM;S;0;CONJUNTO ALIPIO ;BH;604398.40;799487.39;3575
-3577;2001149265;B03000;AMEACA;RUA ARAGAO;140;5350;18/3/2001 18:21:00;CIDADAO COMUM;S;0;DOM BOSCO;BH;604648.22;797203.56;3576
-3578;2001149267;B06000;LESAO CORPORAL;RUA VOLTA GRANDE;134;73594;18/3/2001 18:20:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612934.80;798672.43;3577
-3579;2001149286;B06000;LESAO CORPORAL;RUA ALBERTO MART;18;85244;18/3/2001 18:36:00;CIDADAO COMUM;S;;JAQUELINE;BH;610475.11;809992.93;3578
-3580;2001149289;B06000;LESAO CORPORAL;RUA ALZIRA MARIA;79;49254;18/3/2001 18:36:00;CIDADAO COMUM;N;LJ1;SANTA MONICA;BH;607065.04;807373.38;3579
-3581;2001149322;B03000;AMEACA;BECO SARGENTO SO;60;300412;18/3/2001 18:56:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;614210.46;797140.33;3580
-3582;2001149334;B06000;LESAO CORPORAL;RUA PEDRO AMERIC;40;113157;18/3/2001 19:03:00;CIDADAO COMUM;N;;TUPI;BH;613644.24;806540.35;3581
-3583;2001149351;B03000;AMEACA;RUA JOAO CAETANO;834;37510;18/3/2001 19:13:00;INICIATIVA;S;0;NOVA SUISSA;BH;606534.92;795367.16;3582
-3584;2001149376;B03000;AMEACA;RUA MARIA GERTRU;823;98993;18/3/2001 19:32:00;CIDADAO COMUM;S;;CEU AZUL;BH;604453.51;808797.46;3583
-3585;2001149378;B06000;LESAO CORPORAL;RUA DOS INCONFID;937;34350;18/3/2001 19:34:00;CIDADAO COMUM;S;PX937;FUNCIONARIOS;BH;611530.18;795303.43;3584
-3586;2001149413;B03000;AMEACA;RUA TAIOBEIRAS;420;17168;18/3/2001 19:54:00;CIDADAO COMUM;S;;COQUEIROS;BH;602218.51;799284.00;3585
-3587;2001149422;B03000;AMEACA;RUA SAO JOAQUIM;698;62940;18/3/2001 20:04:00;CIDADAO COMUM;N;0;SAGRADA FAMILIA;BH;613152.40;799476.16;3586
-3588;2001149424;B03000;AMEACA;RUA ANTONIO SILV;85;103607;18/3/2001 20:04:00;CIDADAO COMUM;S;0;LINDEIA;BH;600014.68;790841.11;3587
-3589;2001149497;B06000;LESAO CORPORAL;RUA CABROBO;33;11187;18/3/2001 20:49:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613112.62;798985.69;3588
-3590;2001149505;B09000;ABANDONO DE INCA;RUA CAMILO PRATE;301;11915;18/3/2001 20:50:00;CIDADAO COMUM;S;0;UNIAO;BH;613325.68;801204.49;3589
-3591;2001149511;B06000;LESAO CORPORAL;RUA VOLTA GRANDE;278;73594;18/3/2001 20:53:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612839.11;798622.81;3590
-3592;2001149521;B06000;LESAO CORPORAL;RUA ITAMI;423;35671;18/3/2001 21:00:00;INICIATIVA;S;0;GUARANI;BH;612816.24;805557.38;3591
-3593;2001149523;B06000;LESAO CORPORAL;RUA PADRE SILVEI;540;51704;18/3/2001 21:01:00;INICIATIVA;S;0;SAO LUIZ;BH;608955.34;804515.98;3592
-3594;2001149533;B04001;HOMICIDIO TENTAD;RUA SERRA NEGRA;652;65038;18/3/2001 21:05:00;INICIATIVA;S;0;SANTO ANDRE;BH;609806.47;799141.42;3593
-3595;2001149547;B06000;LESAO CORPORAL;RUA SAN MARTIN;169;60208;18/3/2001 21:12:00;CIDADAO COMUM;S;0;UNIAO;BH;612658.97;801715.38;3594
-3596;2001149592;B04001;HOMICIDIO TENTAD;RUA EMERSON PEIX;26;116619;18/3/2001 21:48:00;CIDADAO COMUM;S;0;PARAISO;BH;614664.42;796179.44;3595
-3597;2001149657;B03000;AMEACA;RUA JUDA;148;12340;18/3/2001 22:31:00;INICIATIVA;S;0;SAO SALVADOR;BH;603624.77;799671.12;3596
-3598;2001149677;B03000;AMEACA;AV NOSSA SENHORA;1612;48107;18/3/2001 22:46:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;610355.98;797806.10;3597
-3599;2001149680;B03000;AMEACA;RUA CAMETA;125;11883;18/3/2001 22:44:00;CIDADAO COMUM;S;;SAUDADE;BH;615111.61;797615.51;3598
-3600;2001149691;B04001;HOMICIDIO TENTAD;RUA SOLIMOES;410;66273;18/3/2001 22:51:00;CIDADAO COMUM;N;;CABANA;BH;604890.13;794350.83;3599
-3601;2001149705;B06000;LESAO CORPORAL;RUA ITAMAR;691;35527;18/3/2001 22:55:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616421.36;798118.78;3600
-3602;2001149716;B06000;LESAO CORPORAL;RUA CARAVELAS;811;13141;18/3/2001 23:02:00;INICIATIVA;S;0;VERA CRUZ;BH;615714.70;797598.16;3601
-3603;2001149739;B04002;HOMICIDIO CONSUM;RUA ARISTOLINO B;190;41089;18/3/2001 23:15:00;CIDADAO COMUM;N;0;REGINA;BH;598888.42;789981.76;3602
-3604;2001149762;B02000;RIXA;RUA DOS CARIJOS;412;81243;18/3/2001 23:23:00;CIDADAO COMUM;S;PX244;CENTRO (BH);BH;611080.93;797191.84;3603
-3605;2001149768;B03000;AMEACA;RUA ROSA DE PEDR;20;124494;18/3/2001 23:27:00;CIDADAO COMUM;S;;ETELVINA CARNEIR;BH;611390.80;809189.08;3604
-3606;2001149841;B06000;LESAO CORPORAL;RUA OURO PRETO;293;50730;19/3/2001 00:00:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609961.08;797017.98;3605
-3607;2001149850;B04001;HOMICIDIO TENTAD;RUA PONTA GROSSA;420;14900;19/3/2001 00:11:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604863.70;789804.10;3606
-3608;2001149909;B06000;LESAO CORPORAL;AV VINTE E OITO ;1300;72970;19/3/2001 00:47:00;CIDADAO COMUM;S;CSA;ESPLANADA;BH;614446.33;798009.59;3607
-3609;2001149972;B06000;LESAO CORPORAL;AV DO CONTORNO;2600;17228;19/3/2001 01:15:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;612669.56;796877.24;3608
-3610;2001149990;B03000;AMEACA;AV PRESIDENTE TA;3587;35366;19/3/2001 01:27:00;CIDADAO COMUM;S;0;PAQUETA;BH;605080.35;802485.42;3609
-3611;2001150250;B03000;AMEACA;RUA OURO PRETO;1329;50730;19/3/2001 07:25:00;CIDADAO COMUM;S;AP202;SANTO AGOSTINHO;BH;609682.00;795988.07;3610
-3612;2001150271;B03000;AMEACA;RUA DOS GUARANIS;177;32181;19/3/2001 07:46:00;CIDADAO COMUM;S;EN177;CENTRO (BH);BH;610747.14;797450.62;3611
-3613;2001150385;B06000;LESAO CORPORAL;AV PARANA;246;52230;19/3/2001 08:54:00;INICIATIVA;S;0;CENTRO BH;BH;610752.57;797284.29;3612
-3614;2001150595;B03000;AMEACA;RUA MACEDO;184;42182;19/3/2001 11:03:00;CIDADAO COMUM;S;FU;FLORESTA;BH;612053.24;798305.99;3613
-3615;2001150602;B03000;AMEACA;RUA PARATI;337;110099;19/3/2001 11:03:00;CIDADAO COMUM;S;0;PILAR;BH;607573.03;788581.48;3614
-3616;2001150626;B09000;ABANDONO DE INCA;RUA VALAO;155;80238;19/3/2001 11:25:00;CIDADAO COMUM;S;;COQUEIROS;BH;602499.62;799683.99;3615
-3617;2001150660;B03000;AMEACA;RUA AURELIANO MA;156;6845;19/3/2001 11:47:00;CIDADAO COMUM;S;;PARAISO;BH;615026.70;796950.70;3616
-3618;2001150676;B03000;AMEACA;RUA ORLANDO MORE;6;87110;19/3/2001 12:03:00;CIDADAO COMUM;N;;DOM JOAQUIM;BH;614045.60;801793.68;3617
-3619;2001150725;B03000;AMEACA;RUA PADRE FEIJO;917;51326;19/3/2001 12:36:00;CIDADAO COMUM;S;0;SAUDADE;BH;615646.25;797648.91;3618
-3620;2001150732;B06000;LESAO CORPORAL;RUA GIBRALTAR;468;31223;19/3/2001 12:40:00;CIDADAO COMUM;S;0;NOVO GLORIA;BH;603168.59;798993.83;3619
-3621;2001150773;B03000;AMEACA;RUA CACHOEIRA DA;443;31958;19/3/2001 13:06:00;CIDADAO COMUM;S;0;GLORIA;BH;602888.75;798160.55;3620
-3622;2001150790;B03000;AMEACA;RUA PROFESSOR ES;830;26342;19/3/2001 13:14:00;CIDADAO COMUM;S;0;SERRA;BH;612840.03;794598.41;3621
-3623;2001150805;B04001;HOMICIDIO TENTAD;RUA RAIMUNDO TIN;44;301229;19/3/2001 13:29:00;INICIATIVA;N;0;MORRO DO PAPAGAI;BH;610762.74;793311.54;3622
-3624;2001151196;B06000;LESAO CORPORAL;AV SILVA LOBO;1397;65889;19/3/2001 17:09:00;CIDADAO COMUM;S;0;GRAJAU;BH;607823.81;795270.53;3623
-3625;2001151235;B03000;AMEACA;RUA RIO PETROPOL;295;91893;19/3/2001 17:30:00;CIDADAO COMUM;N;0;PINDORAMA;BH;602111.84;797838.19;3624
-3626;2001151257;B06000;LESAO CORPORAL;BECO OPALA;53;300769;19/3/2001 17:38:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;608757.86;797782.63;3625
-3627;2001151260;B03000;AMEACA;RUA CORONEL COST;135;10809;19/3/2001 17:39:00;CIDADAO COMUM;N;0;PLANALTO;BH;610637.95;806592.04;3626
-3628;2001151305;B06000;LESAO CORPORAL;RUA REMI PEREIRA;230;96727;19/3/2001 18:05:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;614854.85;806306.99;3627
-3629;2001151462;B03000;AMEACA;RUA DAVID CAMPIS;80;19683;19/3/2001 19:29:00;INICIATIVA;S;0;FLORESTA;BH;612121.55;797462.14;3628
-3630;2001151533;B06000;LESAO CORPORAL;RUA LOTUS;455;100564;19/3/2001 20:11:00;CIDADAO COMUM;S;;BETANIA;BH;604877.82;792364.78;3629
-3631;2001151545;B03000;AMEACA;RUA ANITA GARIBA;5;4184;19/3/2001 20:17:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608751.79;794649.99;3630
-3632;2001151574;B06000;LESAO CORPORAL;RUA OLIVER;234;49950;19/3/2001 20:37:00;CIDADAO COMUM;N;0;UNIAO;BH;612739.53;801366.60;3631
-3633;2001151596;B06000;LESAO CORPORAL;RUA INDIANOPOLIS;508;34423;19/3/2001 20:54:00;CIDADAO COMUM;N;0;RENASCENCA;BH;610662.86;800609.57;3632
-3634;2001151609;B06000;LESAO CORPORAL;RUA BRASILINO VI;143;89589;19/3/2001 21:01:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;617170.18;804550.42;3633
-3635;2001151632;B03000;AMEACA;RUA ASTOLFO DUTR;651;6426;19/3/2001 21:18:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615314.92;798329.61;3634
-3636;2001151644;B03000;AMEACA;RUA GIRASSOL;234;31277;19/3/2001 21:26:00;CIDADAO COMUM;S;0;LINDEIA;BH;599424.88;790984.00;3635
-3637;2001151716;B02000;RIXA;RUA HONORIO BICA;90;29959;19/3/2001 22:17:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615452.20;800576.26;3636
-3638;2001151869;B03000;AMEACA;AV PROFESSOR ALF;110;2264;19/3/2001 23:53:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612047.80;796468.72;3637
-3639;2001151875;B08000;VIOLACAO DE DOMI;RUA CONDE RIBEIR;607;16717;19/3/2001 23:55:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612740.88;798926.93;3638
-3640;2001151892;B03000;AMEACA;RUA BOREAL;56;10184;20/3/2001 00:08:00;CIDADAO COMUM;N;APTO 301;ADELAIDE;BH;606950.84;798500.09;3639
-3641;2001151908;B06000;LESAO CORPORAL;RUA DOIS;22;27130;20/3/2001 00:35:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616441.48;806767.08;3640
-3642;2001151929;B03000;AMEACA;AV ARTUR BERNARD;60;60844;20/3/2001 00:51:00;CIDADAO COMUM;S;;VILA PARIS;BH;610150.40;793809.60;3641
-3643;2001152119;B06000;LESAO CORPORAL;RUA MARIA ANTONI;108;93089;20/3/2001 06:41:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601439.44;786074.51;3642
-3644;2001152376;B04002;HOMICIDIO CONSUM;RUA DOUTOR ARGEM;160;23155;20/3/2001 09:54:00;CIDADAO COMUM;N;0;SAO LUCAS;BH;614033.70;795650.47;3643
-3645;2001152468;B03000;AMEACA;AV BIAS FORTES;1171;9553;20/3/2001 10:44:00;INICIATIVA;S;0;LOURDES;BH;610488.02;796648.12;3644
-3646;2001152491;B03000;AMEACA;RUA LUIZ CASTANH;625;41697;20/3/2001 10:57:00;CIDADAO COMUM;S;CAA;SANTA CRUZ;BH;610814.26;802068.61;3645
-3647;2001152582;B03000;AMEACA;RUA PADRE BELCHI;267;51240;20/3/2001 11:51:00;CIDADAO COMUM;S;AP201;CENTRO (BH);BH;610814.67;796746.33;3646
-3648;2001152677;B03000;AMEACA;AV AUGUSTO DE LI;744;6731;20/3/2001 13:04:00;CIDADAO COMUM;N;LJ76;CENTRO (BH);BH;610661.75;796747.31;3647
-3649;2001152776;B03000;AMEACA;RUA COMENDADOR W;18;16430;20/3/2001 14:10:00;CIDADAO COMUM;S;0;SAO TOMAZ;BH;609994.29;805766.64;3648
-3650;2001152810;B04001;HOMICIDIO TENTAD;RUA MARZAGANIA;5;88066;20/3/2001 14:27:00;INICIATIVA;0;0;VERA CRUZ;BH;617023.58;798845.01;3649
-3651;2001152869;B03000;AMEACA;RUA DOS GUAJAJAR;2429;32037;20/3/2001 15:05:00;INICIATIVA;N;0;BARRO PRETO;BH;609225.26;796929.95;3650
-3652;2001152882;B06000;LESAO CORPORAL;RUA JOANA LOPES ;300;77340;20/3/2001 15:14:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;602100.12;786426.51;3651
-3653;2001153024;B03000;AMEACA;RUA DOS CONSTRUT;701;101249;20/3/2001 16:34:00;INICIATIVA;N;0;CONJUNTO ALIPIO ;BH;604117.89;800080.17;3652
-3654;2001153045;B06000;LESAO CORPORAL;RUA DUARTE DA CO;136;24117;20/3/2001 16:39:00;INICIATIVA;S;0;VILA INDAIA;BH;609723.00;803384.28;3653
-3655;2001153190;B03000;AMEACA;RUA DOS ECONOMIS;612;103272;20/3/2001 17:52:00;INICIATIVA;S;0;CONJUNTO ALIPIO ;BH;604238.00;800485.06;3654
-3656;2001153226;B06000;LESAO CORPORAL;RUA VEREADOR ANT;96;93602;20/3/2001 18:09:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;602105.45;786483.33;3655
-3657;2001153273;B04002;HOMICIDIO CONSUM;RUA BOLIVAR;571;9871;20/3/2001 18:43:00;CIDADAO COMUM;N;;UNIAO;BH;612952.36;801829.38;3656
-3658;2001153294;B03000;AMEACA;RUA ICA;265;33979;20/3/2001 18:56:00;CIDADAO COMUM;N;0;RENASCENCA;BH;611007.28;799791.40;3657
-3659;2001153343;B06000;LESAO CORPORAL;AV AMAZONAS;8063;3140;20/3/2001 19:25:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;604590.39;794944.77;3658
-3660;2001153371;B06000;LESAO CORPORAL;AV BIAS FORTES;1772;9553;20/3/2001 19:35:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610196.72;797244.85;3659
-3661;2001153376;B06000;LESAO CORPORAL;RUA DOS INCONFID;20;25340;20/3/2001 19:37:00;CIDADAO COMUM;S;;TAQUARIL;BH;617047.89;797408.42;3660
-3662;2001153393;B03000;AMEACA;RUA SAO GERALDO;110;170283;20/3/2001 19:44:00;CIDADAO COMUM;S;0;CABANA;BH;604668.39;794124.46;3661
-3663;2001153453;B03000;AMEACA;RUA ARMINDA MORE;80;5997;20/3/2001 20:17:00;CIDADAO COMUM;S;;NOVA BARROCA;BH;607377.03;792889.19;3662
-3664;2001153597;B04001;HOMICIDIO TENTAD;RUA CARLOS PINHE;260;13498;20/3/2001 21:41:00;CIDADAO COMUM;N;CSF;JARDIM MONTANHES;BH;606565.14;798867.92;3663
-3665;2001153603;B06000;LESAO CORPORAL;AV VEREADOR CICE;520;19756;20/3/2001 21:45:00;CIDADAO COMUM;N;;DOM CABRAL;BH;605030.08;796406.17;3664
-3666;2001153655;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;5;170504;20/3/2001 22:17:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;608571.78;793994.63;3665
-3667;2001153712;B03000;AMEACA;RUA POUSO ALEGRE;1314;54932;20/3/2001 22:57:00;CIDADAO COMUM;N;;FLORESTA;BH;612350.46;797901.33;3666
-3668;2001153716;B03000;AMEACA;RUA LOTUS;420;100564;20/3/2001 22:58:00;CIDADAO COMUM;S;;BETANIA;BH;604969.15;792317.38;3667
-3669;2001153763;B02000;RIXA;RUA DOM PEDRITO;361;51300;20/3/2001 23:24:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614749.56;800708.97;3668
-3670;2001153777;B06000;LESAO CORPORAL;RUA DOS GUARANIS;200;32181;20/3/2001 23:37:00;INICIATIVA;S;0;CENTRO (BH);BH;610701.30;797475.97;3669
-3671;2001153806;B03000;AMEACA;RUA FERNAO DIAS;368;28133;20/3/2001 23:52:00;CIDADAO COMUM;S;LJ;CASA BRANCA;BH;615960.65;799305.77;3670
-3672;2001153862;B03000;AMEACA;RUA CAMPOS ELISE;897;12265;21/3/2001 00:39:00;CIDADAO COMUM;S;CAA;ALTO BARROCA;BH;607686.86;795553.41;3671
-3673;2001153880;B06000;LESAO CORPORAL;RUA ASA BRANCA;512;95737;21/3/2001 01:01:00;CIDADAO COMUM;S;;GOIANIA;BH;615345.92;802410.58;3672
-3674;2001153897;B04001;HOMICIDIO TENTAD;AV COLETORA;1160;78241;21/3/2001 01:11:00;CIDADAO COMUM;S;0;VILA PINHO;BH;602428.44;787588.34;3673
-3675;2001153911;B03000;AMEACA;RUA PATRIARCA;182;52559;21/3/2001 01:37:00;CIDADAO COMUM;S;AP202;IPIRANGA;BH;611538.59;800876.99;3674
-3676;2001153944;B03000;AMEACA;RUA CLORITA;100;16051;21/3/2001 02:12:00;CIDADAO COMUM;N;AP 1003;SANTA TEREZA;BH;612847.22;797209.80;3675
-3677;2001153948;B06000;LESAO CORPORAL;AV OLEGARIO MACI;515;49699;21/3/2001 02:19:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610571.41;797149.18;3676
-3678;2001154155;B03000;AMEACA;RUA DOS TIMBIRAS;1228;67682;21/3/2001 07:11:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611538.87;796208.86;3677
-3679;2001154212;B03000;AMEACA;RUA ESMERALDA;776;25920;21/3/2001 07:58:00;CIDADAO COMUM;S;;PRADO;BH;608599.45;795975.60;3678
-3680;2001154369;B03000;AMEACA;RUA CORONEL PEDR;164;18031;21/3/2001 09:36:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612313.72;800359.78;3679
-3681;2001154380;B03000;AMEACA;RUA RIO GRANDE D;499;58744;21/3/2001 09:42:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610383.31;797003.64;3680
-3682;2001154412;B03000;AMEACA;RUA ARAUA;312;5600;21/3/2001 10:00:00;CIDADAO COMUM;N;CA;SAO PAULO;BH;612777.64;803071.62;3681
-3683;2001154492;B03000;AMEACA;RUA BARAO DE COR;349;7891;21/3/2001 10:59:00;CIDADAO COMUM;N;0;BARREIRO;BH;602959.46;791015.32;3682
-3684;2001154559;B06000;LESAO CORPORAL;RUA CONGONHAS;606;16890;21/3/2001 11:50:00;INICIATIVA;N;0;SANTO ANTONIO;BH;610840.10;794487.88;3683
-3685;2001154562;B09000;ABANDONO DE INCA;RUA ITAPERUNA;160;35785;21/3/2001 11:53:00;CIDADAO COMUM;S;FU;SAUDADE;BH;614985.30;797412.99;3684
-3686;2001154626;B03000;AMEACA;RUA SIMAO TAMM;357;66084;21/3/2001 12:37:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610301.98;800541.54;3685
-3687;2001154645;B03000;AMEACA;RUA ILDEU MOREIR;99;80947;21/3/2001 12:52:00;CIDADAO COMUM;N;CAA;NOVA CINTRA;BH;605770.46;793443.77;3686
-3688;2001154676;B06000;LESAO CORPORAL;RUA WALFRIDO TEI;200;7154;21/3/2001 13:14:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609178.70;809605.33;3687
-3689;2001154678;B08000;VIOLACAO DE DOMI;RUA ITAMI;326;35671;21/3/2001 13:18:00;INICIATIVA;S;0;GUARANI;BH;613009.51;805481.70;3688
-3690;2001154734;B04001;HOMICIDIO TENTAD;RUA ALIPIO DE ME;763;2378;21/3/2001 14:06:00;INICIATIVA;S;0;JARDIM MONTANHES;BH;606232.66;798813.74;3689
-3691;2001154831;B03000;AMEACA;RUA F;93;302327;21/3/2001 15:26:00;CIDADAO COMUM;S;;BONSUCESSO;BH;606318.82;789810.40;3690
-3692;2001154913;B03000;AMEACA;RUA ROGERIO APAR;25;96682;21/3/2001 15:59:00;CIDADAO COMUM;S;CAA;ANTONIO RIBEIRO ;BH;614926.02;805954.24;3691
-3693;2001154939;B03000;AMEACA;RUA RAMIRO SIQUE;8;128858;21/3/2001 16:10:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617650.40;797388.81;3692
-3694;2001154955;B06000;LESAO CORPORAL;AV OLEGARIO MACI;338;49699;21/3/2001 16:20:00;CIDADAO COMUM;N;LJ42;CENTRO (BH);BH;610579.39;797366.71;3693
-3695;2001154996;B03000;AMEACA;RUA INGLATERRA;410;34552;21/3/2001 16:47:00;INICIATIVA;S;;JARDIM LEBLON;BH;606157.81;807087.68;3694
-3696;2001155110;B06000;LESAO CORPORAL;RUA MENDES DE OL;474;45430;21/3/2001 17:52:00;CIDADAO COMUM;S;LJFU;SANTO ANDRE;BH;609733.99;799040.75;3695
-3697;2001155302;B06000;LESAO CORPORAL;AV DOM PEDRO II;1020;53145;21/3/2001 19:22:00;INICIATIVA;S;0;JARDIM MONTANHES;BH;609572.19;797764.43;3696
-3698;2001155322;B03000;AMEACA;RUA CORONEL JOAQ;20;17864;21/3/2001 19:31:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611040.89;806104.13;3697
-3699;2001155354;B06000;LESAO CORPORAL;RUA ALEXANDRE LE;36;50162;21/3/2001 19:45:00;INICIATIVA;S;0;ESTRELA DALVA;BH;607674.96;792406.67;3698
-3700;2001155381;B04002;HOMICIDIO CONSUM;RUA ALIPIO DE ME;927;2378;21/3/2001 20:02:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606079.76;798879.74;3699
-3701;2001155504;B04002;HOMICIDIO CONSUM;RUA JAIR DE MATO;5;93703;21/3/2001 21:03:00;INICIATIVA;N;0;INDEPENDENCIA;BH;601631.28;786418.61;3700
-3702;2001155550;B03000;AMEACA;RUA MARIA LUCIA ;330;114061;21/3/2001 21:34:00;INICIATIVA;S;0;SANTA MONICA DO ;BH;606272.35;808701.83;3701
-3703;2001155566;B03000;AMEACA;RUA MARECHAL HEN;30;38351;21/3/2001 21:47:00;CIDADAO COMUM;S;;TUPI;BH;612620.28;806401.73;3702
-3704;2001155633;B04002;HOMICIDIO CONSUM;RUA JAVARI;431;37204;21/3/2001 22:33:00;CIDADAO COMUM;N;0;RENASCENCA;BH;610659.27;799750.92;3703
-3705;2001155656;B03000;AMEACA;AV AMAZONAS;333;3140;21/3/2001 22:50:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611084.15;797100.95;3704
-3706;2001155658;B03000;AMEACA;RUA MANGARATIBA;174;42822;21/3/2001 22:55:00;CIDADAO COMUM;N;;SAO GERALDO;BH;615031.70;799151.60;3705
-3707;2001155747;B06000;LESAO CORPORAL;RUA MAURA;388;82205;21/3/2001 23:55:00;CIDADAO COMUM;N;;IPIRANGA;BH;611731.38;801595.73;3706
-3708;2001155757;B06000;LESAO CORPORAL;RUA E;361;41211;22/3/2001 00:03:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602757.46;802918.53;3707
-3709;2001155779;B03000;AMEACA;RUA DOM PEDRITO;513;51300;22/3/2001 00:16:00;CIDADAO COMUM;S;0;NOVA VISTA (SB);SB;614792.29;800828.38;3708
-3710;2001155798;B04001;HOMICIDIO TENTAD;RUA SETE DE SETE;375;170167;22/3/2001 00:32:00;CIDADAO COMUM;S;0;CABANA;BH;604560.04;794283.05;3709
-3711;2001155820;B06000;LESAO CORPORAL;RUA CLAUDIO GOME;100;117060;22/3/2001 00:47:00;CIDADAO COMUM;S;AP201;DOS PALMARES;BH;611064.87;802289.97;3710
-3712;2001155828;B06000;LESAO CORPORAL;RUA FLOR DA AMIZ;10;94646;22/3/2001 00:57:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606160.75;799560.96;3711
-3713;2001155932;B03000;AMEACA;AV PARANA;26;52230;22/3/2001 02:20:00;INICIATIVA;S;0;CENTRO (BH);BH;610802.35;797494.35;3712
-3714;2001155956;B03000;AMEACA;RUA DES BRAULIO;1553;19917;22/3/2001 02:42:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616310.09;797705.61;3713
-3715;2001155980;B06000;LESAO CORPORAL;RUA MAJOR MESSIA;221;115200;22/3/2001 03:03:00;INICIATIVA;N;0;BANDEIRANTES;BH;604706.99;804294.47;3714
-3716;2001156089;B03000;AMEACA;RUA NELSON SOARE;316;47450;22/3/2001 06:22:00;CIDADAO COMUM;N;;DOM BOSCO;BH;604236.64;797100.59;3715
-3717;2001156367;B03000;AMEACA;RUA CONEGO SANTA;103;16859;22/3/2001 10:04:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610538.66;801482.66;3716
-3718;2001156449;B06000;LESAO CORPORAL;RUA LUIZ DA SILV;50;82158;22/3/2001 10:49:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;613336.01;803981.77;3717
-3719;2001156540;B03000;AMEACA;RUA CONDOR;186;16773;22/3/2001 11:46:00;CIDADAO COMUM;S;CAA;NOVA CINTRA;BH;605641.34;793929.45;3718
-3720;2001156595;B03000;AMEACA;RUA PEDRO LESSA;963;53117;22/3/2001 12:32:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609375.22;798807.26;3719
-3721;2001156844;B03000;AMEACA;RUA DONA LUIZA;491;22947;22/3/2001 15:25:00;INICIATIVA;S;0;MILIONARIOS;BH;604145.21;789897.69;3720
-3722;2001156885;B06000;LESAO CORPORAL;RUA CLORITA;100;16051;22/3/2001 15:50:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612847.22;797209.80;3721
-3723;2001156964;B06000;LESAO CORPORAL;AV DOS ANDRADAS;302;3761;22/3/2001 16:32:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611502.37;797321.65;3722
-3724;2001156986;B04001;HOMICIDIO TENTAD;RUA AMAROS;201;3125;22/3/2001 16:44:00;CIDADAO COMUM;S;0;SAO PAULO;BH;612908.14;802687.28;3723
-3725;2001156989;B06000;LESAO CORPORAL;RUA CARMO DA CAC;10;13659;22/3/2001 16:46:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606146.59;794290.29;3724
-3726;2001157104;B06000;LESAO CORPORAL;AV NELSON LEMOS ;119;89172;22/3/2001 17:38:00;CIDADAO COMUM;S;LJ5;DOS PALMARES;BH;612117.64;802505.91;3725
-3727;2001157129;B03000;AMEACA;AV WALDOMIRO LOB;1665;66548;22/3/2001 17:52:00;CIDADAO COMUM;N;;GUARANI;BH;611916.93;805178.94;3726
-3728;2001157315;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;175;51657;22/3/2001 19:32:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;3727
-3729;2001157326;B03000;AMEACA;RUA CLORITA;100;16051;22/3/2001 19:41:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612847.22;797209.80;3728
-3730;2001157335;B03000;AMEACA;RUA CAITITE;261;11524;22/3/2001 19:43:00;CIDADAO COMUM;S;;GLORIA;BH;603611.95;798765.39;3729
-3731;2001157405;B03000;AMEACA;RUA SAN SALVADOR;51;130728;22/3/2001 20:18:00;CIDADAO COMUM;S;0;ESTRELA DALVA;BH;607903.57;792246.82;3730
-3732;2001157415;B06000;LESAO CORPORAL;RUA FUNCIONARIOS;65;25163;22/3/2001 20:23:00;POLICIAL MILITAR;S;;TAQUARIL;BH;617149.42;797082.15;3731
-3733;2001157427;B06000;LESAO CORPORAL;RUA ESTRELA;90;86310;22/3/2001 20:38:00;CIDADAO COMUM;S;;CELESTINO;BH;610886.12;808672.60;3732
-3734;2001157429;B03000;AMEACA;RUA LUIZ DELFINO;220;35211;22/3/2001 20:39:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;607532.77;807525.06;3733
-3735;2001157488;B03000;AMEACA;RUA JOSE PEDRO D;392;78560;22/3/2001 21:10:00;CIDADAO COMUM;S;CAFR;VILA SANTA RITA;BH;601530.38;787287.41;3734
-3736;2001157533;B08000;VIOLACAO DE DOMI;RUA LEOPOLDO GOM;287;40770;22/3/2001 21:34:00;CIDADAO COMUM;N;0;POMPEIA;BH;614583.76;797883.74;3735
-3737;2001157534;B04002;HOMICIDIO CONSUM;RUA MUNIZ;450;170850;22/3/2001 21:34:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;608189.72;793769.03;3736
-3738;2001157538;B06000;LESAO CORPORAL;RUA VINTE E NOVE;274;73061;22/3/2001 21:38:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604371.26;796671.42;3737
-3739;2001157586;B03000;AMEACA;RUA AUGUSTO JOSE;40;6729;22/3/2001 22:04:00;CIDADAO COMUM;S;0;BETANIA;BH;605990.32;793126.57;3738
-3740;2001157597;B06000;LESAO CORPORAL;RUA EDUARDO LEIT;104;95258;22/3/2001 22:11:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;604948.63;791383.04;3739
-3741;2001157639;B06000;LESAO CORPORAL;RUA ROBERTSON PI;365;87149;22/3/2001 22:36:00;CIDADAO COMUM;S;;PONGELUPE;BH;603958.75;787192.76;3740
-3742;2001157641;B03000;AMEACA;RUA DOS BENEDITI;91;63310;22/3/2001 22:37:00;CIDADAO COMUM;S;;PLANALTO;BH;610767.07;805432.04;3741
-3743;2001157642;B03000;AMEACA;RUA CONSELHEIRO ;1517;17095;22/3/2001 22:37:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;613099.23;797328.67;3742
-3744;2001157644;B04002;HOMICIDIO CONSUM;RUA DOUTOR ARIST;596;89576;22/3/2001 22:39:00;CIDADAO COMUM;N;;PALMEIRAS;BH;606530.11;790740.76;3743
-3745;2001157653;B03000;AMEACA;RUA GENTIOS;1350;30983;22/3/2001 22:47:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;608905.13;793585.28;3744
-3746;2001157710;B04001;HOMICIDIO TENTAD;RUA JAGUARA;396;36775;22/3/2001 23:16:00;CIDADAO COMUM;N;CAB;SAUDADE;BH;615317.98;797573.75;3745
-3747;2001157773;B06000;LESAO CORPORAL;RUA ITAJUBA;2168;35495;22/3/2001 23:58:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612394.62;799485.99;3746
-3748;2001157795;B06000;LESAO CORPORAL;RUA GUAICURUS;690;32009;23/3/2001 00:15:00;INICIATIVA;S;0;CENTRO (BH);BH;611000.88;797693.04;3747
-3749;2001157828;B06000;LESAO CORPORAL;RUA JOAO PROCOPI;211;69070;23/3/2001 00:44:00;CIDADAO COMUM;S;0;JARDIM ALVORADA;BH;605929.92;800245.45;3748
-3750;2001157863;B03000;AMEACA;AV AGENOR DE PAU;85;86250;23/3/2001 01:09:00;CIDADAO COMUM;N;;VILA FREI LEOPOL;BH;611303.39;810132.56;3749
-3751;2001157873;B06000;LESAO CORPORAL;RUA BARAO DE SAR;445;8043;23/3/2001 01:15:00;CIDADAO COMUM;S;AP304;HORTO;BH;613709.90;797916.68;3750
-3752;2001157916;B03000;AMEACA;RUA SAO RAFAEL;138;63580;23/3/2001 02:08:00;CIDADAO COMUM;S;;FLORESTA;BH;612241.79;798264.50;3751
-3753;2001158255;B03000;AMEACA;RUA ITAPERUNA;3;35785;23/3/2001 08:29:00;CIDADAO COMUM;S;0;SAUDADE;BH;614974.32;797593.43;3752
-3754;2001158287;B03000;AMEACA;RUA PRINCIPAL;300;170504;23/3/2001 08:47:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608596.19;793933.42;3753
-3755;2001158329;B03000;AMEACA;RUA DAVID RABELO;948;19702;23/3/2001 09:12:00;INICIATIVA;S;A;INCONFIDENCIA;BH;604928.15;798979.46;3754
-3756;2001158331;B03000;AMEACA;RUA DOS GUAJAJAR;190;32037;23/3/2001 09:17:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611392.58;796387.87;3755
-3757;2001158559;B06000;LESAO CORPORAL;AV TERESA CRISTI;175;67512;23/3/2001 12:10:00;CIDADAO COMUM;S;FR175;CARLOS PRATES;BH;609052.83;797141.23;3756
-3758;2001158587;B03000;AMEACA;RUA MARMORE;206;44695;23/3/2001 12:27:00;CIDADAO COMUM;N;CONJ7;SANTA TEREZA;BH;613022.23;797513.82;3757
-3759;2001158621;B03000;AMEACA;RUA VISCONDE DE ;472;73380;23/3/2001 12:42:00;CIDADAO COMUM;S;CASA 05.;SAO JOAO BATISTA;BH;607907.71;807824.31;3758
-3760;2001158630;B03000;AMEACA;RUA JOAQUIM GONC;495;119428;23/3/2001 12:48:00;CIDADAO COMUM;S;BL/16 APT/103;VILA MAGNESITA;BH;602540.14;795033.90;3759
-3761;2001158686;B03000;AMEACA;RUA JACAREI;187;13154;23/3/2001 13:15:00;CIDADAO COMUM;S;;COQUEIROS;BH;602705.00;798554.24;3760
-3762;2001158722;B03000;AMEACA;RUA DR BROCHADO;93;23215;23/3/2001 13:37:00;CIDADAO COMUM;S;CAA;VERA CRUZ;BH;615809.92;798594.98;3761
-3763;2001158767;B06000;LESAO CORPORAL;RUA MARIA BEATRI;90;126792;23/3/2001 14:11:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605181.92;790926.68;3762
-3764;2001158796;B03000;AMEACA;AV AVAI;238;6946;23/3/2001 14:41:00;CIDADAO COMUM;S;LJ03;DOM BOSCO;BH;604297.83;797579.83;3763
-3765;2001158914;B06000;LESAO CORPORAL;RUA AROEIRA NEVE;151;92423;23/3/2001 15:37:00;CIDADAO COMUM;N;;ALVARO CAMARGOS;BH;604095.41;797469.10;3764
-3766;2001158941;B03000;AMEACA;RUA VIOLETA DE M;34;80253;23/3/2001 15:46:00;CIDADAO COMUM;S;;ALIPIO DE MELO;BH;605328.14;799159.14;3765
-3767;2001158990;B06000;LESAO CORPORAL;RUA MARIA BEATRI;90;126792;23/3/2001 16:05:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;605181.92;790926.68;3766
-3768;2001159015;B03000;AMEACA;RUA DOMINGOS ROC;122;22631;23/3/2001 16:17:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606564.17;795287.65;3767
-3769;2001159044;B03000;AMEACA;RUA RIO GRANDE D;697;58744;23/3/2001 16:35:00;CIDADAO COMUM;S;SL804;BARRO PRETO;BH;610340.32;796860.88;3768
-3770;2001159091;B03000;AMEACA;RUA JASMIM;25;37071;23/3/2001 16:57:00;CIDADAO COMUM;S;;LINDEIA;BH;599163.11;790914.30;3769
-3771;2001159117;B03000;AMEACA;RUA ZILAH RODRIG;277;74008;23/3/2001 17:05:00;CIDADAO COMUM;0;0;NOVA BARROCA;BH;607736.18;792540.41;3770
-3772;2001159170;B03000;AMEACA;AV PADRE JOSE MA;781;53448;23/3/2001 17:28:00;CIDADAO COMUM;S;0;VISTA ALEGRE;BH;605084.94;793257.67;3771
-3773;2001159215;B03000;AMEACA;RUA SUASSUI;460;66447;23/3/2001 17:50:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608932.68;797321.00;3772
-3774;2001159241;B03000;AMEACA;RUA DR ANTONIO P;25;95030;23/3/2001 18:00:00;MILITARES DAS FO;S;0;COQUEIROS;BH;602118.47;799218.16;3773
-3775;2001159286;B06000;LESAO CORPORAL;AV PRESIDENTE CA;2020;55125;23/3/2001 18:23:00;CIDADAO COMUM;S;0;CAICARA;BH;608432.84;800193.57;3774
-3776;2001159312;B06000;LESAO CORPORAL;RUA IBERTIOGA;256;33809;23/3/2001 18:35:00;CIDADAO COMUM;S;FU;SAO JOAO BATISTA;BH;611151.93;801287.85;3775
-3777;2001159325;B03000;AMEACA;RUA SANTAREM;337;61484;23/3/2001 18:39:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605761.62;793824.26;3776
-3778;2001159372;B03000;AMEACA;AV AMAZONAS;148;3140;23/3/2001 19:00:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611346.52;797320.11;3777
-3779;2001159443;B03000;AMEACA;RUA ZENITE;520;73957;23/3/2001 19:42:00;CIDADAO COMUM;S;AP301;ADELAIDE;BH;606967.94;799056.74;3778
-3780;2001159445;B06000;LESAO CORPORAL;RUA GUAICURUS;177;32009;23/3/2001 19:44:00;POLICIAL MILITAR;S;0;CENTRO (BH);BH;611334.76;797567.17;3779
-3781;2001159499;B06000;LESAO CORPORAL;RUA EDSON LUIZ M;112;25062;23/3/2001 20:09:00;CIDADAO COMUM;S;CAB;MARIA GORETTI;BH;614197.63;803631.48;3780
-3782;2001159512;B03000;AMEACA;RUA FRANCISCO JO;545;118223;23/3/2001 20:14:00;POLICIAL MILITAR;N;0;ITAIPU BH;BH;599752.96;789472.97;3781
-3783;2001159524;B03000;AMEACA;RUA ANTONIO PEIX;192;12379;23/3/2001 20:20:00;CIDADAO COMUM;S;;ADELAIDE;BH;607407.69;798098.04;3782
-3784;2001159527;B06000;LESAO CORPORAL;RUA CARMELITA CO;17;93366;23/3/2001 20:23:00;INICIATIVA;S;0;MINEIRAO;BH;601088.47;785895.52;3783
-3785;2001159603;B03000;AMEACA;RUA AUGUSTO JOSE;401;6729;23/3/2001 20:59:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605834.73;791972.39;3784
-3786;2001159663;B03000;AMEACA;RUA MARROCOS;1380;44869;23/3/2001 21:21:00;CIDADAO COMUM;N;0;JARDIM LEBLON;BH;605477.74;807935.17;3785
-3787;2001159725;B06000;LESAO CORPORAL;RUA QUARENTA E O;218;35048;23/3/2001 21:57:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612674.73;807062.29;3786
-3788;2001159755;B06000;LESAO CORPORAL;RUA LAGOA DOURAD;255;40174;23/3/2001 22:11:00;CIDADAO COMUM;N;PX300;PRADO;BH;608792.86;796447.49;3787
-3789;2001159850;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;1614;40770;23/3/2001 23:16:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615965.80;798142.50;3788
-3790;2001159951;B06000;LESAO CORPORAL;RUA DOS TUPIS;597;69965;24/3/2001 00:26:00;INICIATIVA;N;0;CENTRO BH;BH;610730.23;796962.57;3789
-3791;2001159980;B06000;LESAO CORPORAL;RUA DES BRAULIO;1138;19917;24/3/2001 00:41:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616228.18;797935.95;3790
-3792;2001159986;B06000;LESAO CORPORAL;RUA VIOLETA DE M;430;80253;24/3/2001 00:45:00;INICIATIVA;S;0;SAO JOSE;BH;604587.45;799319.51;3791
-3793;2001159993;B06000;LESAO CORPORAL;RUA JOANA LOPES ;300;77340;24/3/2001 00:49:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;602100.12;786426.51;3792
-3794;2001159994;B06000;LESAO CORPORAL;RUA RADIALISTA W;49;99983;24/3/2001 00:50:00;CIDADAO COMUM;S;;CEU AZUL;BH;604193.21;808558.49;3793
-3795;2001160050;B06000;LESAO CORPORAL;RUA DR GERALDO S;280;23372;24/3/2001 01:20:00;INICIATIVA;S;0;REGINA;BH;599010.61;790221.47;3794
-3796;2001160057;B06000;LESAO CORPORAL;RUA ANTONIO DE F;410;4550;24/3/2001 01:22:00;CIDADAO COMUM;N;0;PIRAJA;BH;613437.47;803121.36;3795
-3797;2001160064;B06000;LESAO CORPORAL;RUA FLOR DE PITA;107;42949;24/3/2001 01:26:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;601600.30;786045.97;3796
-3798;2001160122;B04001;HOMICIDIO TENTAD;RUA UNIAO;100;23587;24/3/2001 02:15:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617415.17;796910.53;3797
-3799;2001160162;B06000;LESAO CORPORAL;RUA ELI PINHEIRO;499;42734;24/3/2001 02:41:00;CIDADAO COMUM;S;;PINDORAMA;BH;601964.61;797707.33;3798
-3800;2001160208;B06000;LESAO CORPORAL;RUA NADIR;519;47173;24/3/2001 03:13:00;CIDADAO COMUM;S;AP102;ADELAIDE;BH;607116.61;798871.94;3799
-3801;2001160228;B06000;LESAO CORPORAL;RUA CARLOS SCHET;625;118771;24/3/2001 03:25:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;604966.86;794527.69;3800
-3802;2001160261;B03000;AMEACA;RUA ARISTOTELES;150;22427;24/3/2001 03:55:00;CIDADAO COMUM;S;;NAZARE;BH;615473.36;804481.47;3801
-3803;2001160271;B06000;LESAO CORPORAL;RUA CHAPADA;108;42721;24/3/2001 04:01:00;CIDADAO COMUM;S;0;PRIMAVERA;BH;604251.15;798747.54;3802
-3804;2001160281;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;429;6353;24/3/2001 04:06:00;CIDADAO COMUM;S;0;FLORESTA;BH;611933.16;797254.59;3803
-3805;2001160287;B06000;LESAO CORPORAL;RUA FELIPE DOS S;508;27953;24/3/2001 04:17:00;INICIATIVA;N;0;LOURDES;BH;610309.76;795521.03;3804
-3806;2001160297;B06000;LESAO CORPORAL;ESTRADA DO CERCA;1570;26428;24/3/2001 04:27:00;CIDADAO COMUM;S;0;JARDIM AMERICA;BH;607375.69;794003.07;3805
-3807;2001160309;B04001;HOMICIDIO TENTAD;RUA ENGENHEIRO A;111;4588;24/3/2001 04:51:00;CIDADAO COMUM;N;;JOAO PINHEIRO;BH;605231.12;795804.48;3806
-3808;2001160328;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;283;26052;24/3/2001 05:22:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611347.16;797371.80;3807
-3809;2001160354;B06000;LESAO CORPORAL;RUA SILVA ALVARE;619;65810;24/3/2001 05:55:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615346.41;799416.06;3808
-3810;2001160374;B03000;AMEACA;AV PRESIDENTE AN;1000;4461;24/3/2001 06:32:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610467.56;799002.85;3809
-3811;2001160376;B03000;AMEACA;RUA NORONHA GUAR;140;47867;24/3/2001 06:40:00;CIDADAO COMUM;N;;BARREIRO;BH;602096.60;791122.57;3810
-3812;2001160398;B03000;AMEACA;AV NOSSA SENHORA;2654;48107;24/3/2001 07:15:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;609400.94;797538.83;3811
-3813;2001160401;B06000;LESAO CORPORAL;RUA LAZARO FERRE;53;56143;24/3/2001 07:17:00;CIDADAO COMUM;N;;JARDIM GUANABARA;BH;611818.49;807543.63;3812
-3814;2001160402;B06000;LESAO CORPORAL;RUA DOS CAETES;540;11376;24/3/2001 07:20:00;INICIATIVA;S;0;CENTRO (BH);BH;611085.09;797483.48;3813
-3815;2001160471;B03000;AMEACA;RUA DOUTOR ALBER;149;23114;24/3/2001 08:13:00;CIDADAO COMUM;N;0;HELIOPOLIS;BH;610892.27;805316.02;3814
-3816;2001160486;B06000;LESAO CORPORAL;RUA MARIA CANDID;123;114957;24/3/2001 08:22:00;CIDADAO COMUM;S;FU;PAQUETA;BH;605581.25;802467.74;3815
-3817;2001160490;B06000;LESAO CORPORAL;RUA CARLOS MUZZI;137;89967;24/3/2001 08:24:00;CIDADAO COMUM;S;;PALMEIRAS;BH;606607.86;791463.13;3816
-3818;2001160552;B03000;AMEACA;RUA LEOPOLDINA;120;40739;24/3/2001 09:08:00;INICIATIVA;S;0;SANTO ANTONIO;BH;610885.17;794753.81;3817
-3819;2001160680;B03000;AMEACA;RUA TRES CORACOE;131;68805;24/3/2001 10:34:00;CIDADAO COMUM;S;;CALAFATE;BH;607965.67;796506.72;3818
-3820;2001160683;B03000;AMEACA;RUA SERGIPE;1211;64961;24/3/2001 10:35:00;CIDADAO COMUM;S;ARMADO DE REV;FUNCIONARIOS;BH;611200.95;795166.34;3819
-3821;2001160756;B04001;HOMICIDIO TENTAD;RUA SAO VICENTE;22;88126;24/3/2001 11:20:00;INICIATIVA;S;0;GRANJA FREITAS;BH;617082.39;798490.25;3820
-3822;2001160829;B04001;HOMICIDIO TENTAD;RUA 31;300;302830;24/3/2001 12:07:00;CIDADAO COMUM;S;AP703;NOVO AARAO REIS;BH;614073.73;805523.06;3821
-3823;2001160850;B06000;LESAO CORPORAL;RUA PAULINO CAET;300;20881;24/3/2001 12:16:00;CIDADAO COMUM;S;;CEU AZUL;BH;604892.28;807442.71;3822
-3824;2001160963;B06000;LESAO CORPORAL;RUA 36;94;302834;24/3/2001 13:42:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;613775.82;805485.10;3823
-3825;2001160980;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;215;63782;24/3/2001 13:53:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610955.95;793822.34;3824
-3826;2001160990;B06000;LESAO CORPORAL;RUA RIACHO;80;24927;24/3/2001 13:57:00;CIDADAO COMUM;S;;TAQUARIL;BH;617249.69;797177.50;3825
-3827;2001161069;B03000;AMEACA;RUA Y;55;41817;24/3/2001 14:54:00;CIDADAO COMUM;N;;CH CONFISCO (CO);CO;602477.29;802958.98;3826
-3828;2001161092;B04002;HOMICIDIO CONSUM;RUA CHAFARIZ;54;93568;24/3/2001 15:18:00;CIDADAO COMUM;N;0;PETROPOLIS;BH;601454.00;786602.56;3827
-3829;2001161110;B03000;AMEACA;RUA PADRE EUSTAQ;1340;51294;24/3/2001 15:31:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;608296.40;797908.26;3828
-3830;2001161139;B03000;AMEACA;RUA DOS TAMOIOS;19;66825;24/3/2001 15:45:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611310.59;796955.28;3829
-3831;2001161166;B03000;AMEACA;AV JOAQUIM ABEL ;185;123996;24/3/2001 15:47:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606602.10;812230.32;3830
-3832;2001161190;B03000;AMEACA;RUA EXPEDITO FLA;44;84847;24/3/2001 16:07:00;CIDADAO COMUM;S;BL10;DA LAGOA;BH;604775.59;809097.83;3831
-3833;2001161203;B06000;LESAO CORPORAL;RUA HEMATITA;608;33014;24/3/2001 16:13:00;CIDADAO COMUM;S;;ADELAIDE;BH;607683.27;798277.79;3832
-3834;2001161224;B06000;LESAO CORPORAL;RUA CIPRIANO DE ;745;15856;24/3/2001 16:25:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606346.75;792973.08;3833
-3835;2001161319;B06000;LESAO CORPORAL;RUA DOM SILVERIO;300;22496;24/3/2001 17:15:00;CIDADAO COMUM;S;;BELMONT;BH;615222.25;805374.99;3834
-3836;2001161335;B03000;AMEACA;RUA BRASIL;21;10446;24/3/2001 17:25:00;CIDADAO COMUM;S;;CABANA;BH;604813.51;793739.13;3835
-3837;2001161368;B03000;AMEACA;RUA ANTONIO PEIX;192;12379;24/3/2001 17:47:00;CIDADAO COMUM;S;;ADELAIDE;BH;607407.69;798098.04;3836
-3838;2001161386;B06000;LESAO CORPORAL;RUA NICOLINA DE ;69;44263;24/3/2001 17:56:00;INICIATIVA;S;0;HAVAI;BH;607317.75;793714.27;3837
-3839;2001161392;B03000;AMEACA;AV MIGUEL MOYSES;70;10811;24/3/2001 17:58:00;CIDADAO COMUM;N;;NOVA GAMELEIRA;BH;605508.31;794694.74;3838
-3840;2001161447;B03000;AMEACA;RUA DOS TIMBIRAS;2163;67682;24/3/2001 18:24:00;CIDADAO COMUM;S;AP401;LOURDES;BH;610609.99;796418.01;3839
-3841;2001161488;B06000;LESAO CORPORAL;RUA RIO DE JANEI;328;58772;24/3/2001 18:49:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611168.31;797376.15;3840
-3842;2001161515;B03000;AMEACA;RUA H;152;41441;24/3/2001 19:04:00;POLICIAL MILITAR;S;0;CH CONFISCO;BH;602941.36;803114.92;3841
-3843;2001161545;B03000;AMEACA;RUA POVOA DE VAR;381;54958;24/3/2001 19:13:00;INICIATIVA;N;0;PAQUETA;BH;605370.76;802630.89;3842
-3844;2001161549;B06000;LESAO CORPORAL;AV NOSSA SENHORA;2299;48107;24/3/2001 19:15:00;INICIATIVA;N;0;CARLOS PRATES;BH;609679.55;797662.00;3843
-3845;2001161577;B03000;AMEACA;RUA RAMIRO SIQUE;73;128858;24/3/2001 19:26:00;INICIATIVA;S;0;CASTANHEIRAS (TA;BH;617772.39;797223.77;3844
-3846;2001161579;B04001;HOMICIDIO TENTAD;RUA DURVAL DE BA;10;24914;24/3/2001 19:27:00;INICIATIVA;N;0;TAQUARIL;BH;617311.85;797132.61;3845
-3847;2001161605;B06000;LESAO CORPORAL;RUA CORONEL ABIL;228;17518;24/3/2001 19:38:00;CIDADAO COMUM;S;0;CAETANO FURQUIM;BH;616532.45;799490.62;3846
-3848;2001161610;B06000;LESAO CORPORAL;RUA PROFESSOR ME;295;77920;24/3/2001 19:42:00;CIDADAO COMUM;S;0;MANGABEIRAS;BH;612132.44;792715.35;3847
-3849;2001161724;B04002;HOMICIDIO CONSUM;RUA REGENCIA;100;301448;24/3/2001 20:46:00;CIDADAO COMUM;N;0;VILA CAFEZAL;BH;614118.47;795470.66;3848
-3850;2001161744;B03000;AMEACA;RUA JULITA NUNES;211;130047;24/3/2001 20:54:00;CIDADAO COMUM;N;;MINASCAIXA;BH;609211.34;809819.89;3849
-3851;2001161766;B06000;LESAO CORPORAL;RUA FREI VICENTE;235;30029;24/3/2001 21:01:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;607275.87;807974.29;3850
-3852;2001161789;B03000;AMEACA;RUA RIO PARNAIBA;230;52344;24/3/2001 21:10:00;CIDADAO COMUM;S;0;MINASLANDIA;BH;612194.90;804722.15;3851
-3853;2001161853;B03000;AMEACA;RUA SAO GONCALO ;165;62689;24/3/2001 21:44:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605834.54;807920.69;3852
-3854;2001161854;B06000;LESAO CORPORAL;RUA BOM JARDIM;310;9972;24/3/2001 21:45:00;CIDADAO COMUM;N;;SARANDI (URCA/BH;BH;604021.54;802515.54;3853
-3855;2001161865;B03000;AMEACA;RUA PIO XI;560;53927;24/3/2001 21:48:00;CIDADAO COMUM;S;;IPIRANGA;BH;612058.97;800797.20;3854
-3856;2001161904;B06000;LESAO CORPORAL;RUA K;45;78774;24/3/2001 22:05:00;CIDADAO COMUM;N;0;CH JATOBA IV;BH;600642.62;787884.73;3855
-3857;2001161955;B06000;LESAO CORPORAL;RUA BEBERIBE;155;8550;24/3/2001 22:49:00;CIDADAO COMUM;N;;SAO CRISTOVAO;BH;610639.39;799190.15;3856
-3858;2001161982;B03000;AMEACA;RUA RITMO;273;301436;24/3/2001 23:01:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614052.17;795226.81;3857
-3859;2001162002;B03000;AMEACA;RUA ALETES;200;2075;24/3/2001 23:10:00;CIDADAO COMUM;S;;PINDORAMA;BH;602582.06;797448.37;3858
-3860;2001162011;B03000;AMEACA;RUA STA INES;255;60730;24/3/2001 23:16:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614319.43;802711.42;3859
-3861;2001162046;B03000;AMEACA;RUA MAURA;513;82205;24/3/2001 23:31:00;CIDADAO COMUM;S;FU;IPIRANGA;BH;611834.45;801543.11;3860
-3862;2001162097;B04002;HOMICIDIO CONSUM;AV BUENO CERQUEI;143;71343;25/3/2001 00:00:00;CIDADAO COMUM;N;CSA;UNIVERSITARIO;BH;610578.63;802883.10;3861
-3863;2001162126;B06000;LESAO CORPORAL;RUA DOS CARIJOS;412;81243;25/3/2001 00:14:00;INICIATIVA;N;0;CENTRO (BH);BH;611080.93;797191.84;3862
-3864;2001162128;B06000;LESAO CORPORAL;AV PRESIDENTE CA;800;55125;25/3/2001 00:15:00;CIDADAO COMUM;N;0;CAICARA;BH;608266.95;799059.21;3863
-3865;2001162156;B06000;LESAO CORPORAL;RUA PONTA GROSSA;20;14900;25/3/2001 00:34:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604918.03;789453.17;3864
-3866;2001162169;B04001;HOMICIDIO TENTAD;RUA JOSE CHRISTI;110;106949;25/3/2001 00:41:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605812.26;793381.78;3865
-3867;2001162225;B02000;RIXA;AV PROFESSOR MAR;1430;91130;25/3/2001 01:10:00;CIDADAO COMUM;S;0;BURITIS;BH;608335.60;791553.16;3866
-3868;2001162251;B03000;AMEACA;PRACA CINQUENTEN;10;8462;25/3/2001 01:25:00;POLICIAL MILITAR;S;;CINQUENTENARIO;BH;606358.33;793267.49;3867
-3869;2001162257;B03000;AMEACA;RUA MARIA MARTIN;633;82680;25/3/2001 01:28:00;CIDADAO COMUM;S;0;CELESTINO;BH;611032.06;808645.30;3868
-3870;2001162281;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;2200;57830;25/3/2001 01:37:00;INICIATIVA;N;0;ESTORIL;BH;608853.99;793279.32;3869
-3871;2001162284;B06000;LESAO CORPORAL;RUA MIGUEL PINTO;1595;128757;25/3/2001 01:35:00;CIDADAO COMUM;S;;NOVA ESPERANCA;BH;609001.69;799454.98;3870
-3872;2001162310;B03000;AMEACA;BECO A;18;302717;25/3/2001 01:45:00;CIDADAO COMUM;S;0;VILA CASTANHEIRA;BH;601391.47;788282.32;3871
-3873;2001162322;B06000;LESAO CORPORAL;AV PEDREIRA;66;52952;25/3/2001 01:52:00;INICIATIVA;S;0;PROVIDENCIA;BH;612837.94;804549.46;3872
-3874;2001162331;B03000;AMEACA;RUA EDSON TOMAS ;700;68556;25/3/2001 01:56:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;611116.83;804710.84;3873
-3875;2001162364;B03000;AMEACA;RUA REGINO GONZA;11;95522;25/3/2001 02:11:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;617056.30;804188.87;3874
-3876;2001162406;B06000;LESAO CORPORAL;AV AMAZONAS;3615;3140;25/3/2001 02:32:00;CIDADAO COMUM;N;0;BARROCA;BH;608219.93;795824.43;3875
-3877;2001162408;B03000;AMEACA;RUA ANTONIO VERG;11;4900;25/3/2001 02:33:00;INICIATIVA;S;0;OURO PRETO;BH;605613.02;802592.15;3876
-3878;2001162430;B06000;LESAO CORPORAL;AV SILVIANO BRAN;427;66002;25/3/2001 02:47:00;CIDADAO COMUM;N;CAFU;SAGRADA FAMILIA;BH;612050.15;798570.93;3877
-3879;2001162484;B03000;AMEACA;RUA GABRO;267;30435;25/3/2001 03:27:00;CIDADAO COMUM;S;CAB;SANTA TEREZA;BH;612913.80;797341.46;3878
-3880;2001162560;B06000;LESAO CORPORAL;AV PRESIDENTE CA;800;55125;25/3/2001 04:18:00;INICIATIVA;S;0;CAICARA;BH;608266.95;799059.21;3879
-3881;2001162590;B06000;LESAO CORPORAL;AV SANTOS DUMONT;673;61950;25/3/2001 04:41:00;CIDADAO COMUM;S;PX734;CENTRO (BH);BH;610982.01;797558.77;3880
-3882;2001162693;B04002;HOMICIDIO CONSUM;RUA VEREADOR ANT;67;93602;25/3/2001 06:40:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;601901.25;786466.11;3881
-3883;2001162695;B03000;AMEACA;RUA OLAU FERREIR;19;49598;25/3/2001 06:41:00;CIDADAO COMUM;S;0;CAICARA;BH;607753.24;799849.35;3882
-3884;2001162703;B03000;AMEACA;RUA NATAL;373;47306;25/3/2001 07:00:00;CIDADAO COMUM;N;0;SANTO ANDRE;BH;609189.92;799371.29;3883
-3885;2001162749;B03000;AMEACA;RUA SAO JOAO;31;62780;25/3/2001 07:56:00;CIDADAO COMUM;S;0;FLAVIO MARQUES D;BH;604144.35;788857.30;3884
-3886;2001162812;B04002;HOMICIDIO CONSUM;RUA 51;227;302847;25/3/2001 08:38:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614103.15;805588.83;3885
-3887;2001162894;B03000;AMEACA;RUA DEPUTADA IVE;124;87325;25/3/2001 09:57:00;CIDADAO COMUM;N;;PONGELUPE;BH;603758.88;787112.87;3886
-3888;2001162938;B03000;AMEACA;RUA EXPEDITO FLA;359;84847;25/3/2001 10:29:00;CIDADAO COMUM;N;;DA LAGOA;BH;604520.36;809212.26;3887
-3889;2001162959;B02000;RIXA;RUA ASSEMBLEIA;90;6338;25/3/2001 10:42:00;CIDADAO COMUM;N;;LUXEMBURGO;BH;609657.18;794608.63;3888
-3890;2001162994;B06000;LESAO CORPORAL;RUA ITAMAR;70;35527;25/3/2001 11:10:00;INICIATIVA;N;0;VERA CRUZ;BH;616278.93;798658.76;3889
-3891;2001162997;B06000;LESAO CORPORAL;RUA PASSOS;41;52458;25/3/2001 11:10:00;CIDADAO COMUM;N;CSB;CARLOS PRATES;BH;609255.16;798152.08;3890
-3892;2001163036;B06000;LESAO CORPORAL;RUA BEZERRA DE M;82;9525;25/3/2001 11:46:00;CIDADAO COMUM;S;;NAZARE;BH;615434.80;804565.98;3891
-3893;2001163106;B04001;HOMICIDIO TENTAD;RUA DR JOAO CARV;137;36012;25/3/2001 12:42:00;CIDADAO COMUM;N;;PRADO LOPES;BH;610144.49;798836.55;3892
-3894;2001163241;B03000;AMEACA;RUA ABILIO BARRE;75;129661;25/3/2001 14:37:00;CIDADAO COMUM;S;;TUPI;BH;613770.88;806593.53;3893
-3895;2001163256;B06000;LESAO CORPORAL;RUA VINTE E QUAT;7;300270;25/3/2001 14:46:00;CIDADAO COMUM;S;PROX ESC. MURILO;VISTA DO SOL;BH;615774.88;804917.15;3894
-3896;2001163264;B06000;LESAO CORPORAL;RUA CORONEL ANTO;342;17590;25/3/2001 14:52:00;CIDADAO COMUM;N;CAFU;JARDIM LEBLON;BH;606018.67;807546.54;3895
-3897;2001163310;B03000;AMEACA;RUA NOSSA SENHOR;340;48021;25/3/2001 15:25:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610236.98;800129.30;3896
-3898;2001163362;B06000;LESAO CORPORAL;AV SANTOS DUMONT;305;61950;25/3/2001 15:54:00;CIDADAO COMUM;N;PX305;CENTRO (BH);BH;611328.73;797470.25;3897
-3899;2001163415;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;491;63782;25/3/2001 16:21:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610857.53;793450.63;3898
-3900;2001163424;B03000;AMEACA;RUA CARLINDO COS;75;97294;25/3/2001 16:27:00;CIDADAO COMUM;N;;EYMARD;BH;613736.10;803676.67;3899
-3901;2001163461;B06000;LESAO CORPORAL;AV MENELICK DE C;1420;30448;25/3/2001 16:46:00;CIDADAO COMUM;S;0;FLAVIO MARQUES D;BH;605358.05;788416.82;3900
-3902;2001163466;B06000;LESAO CORPORAL;RUA NIZIO TORRES;205;94659;25/3/2001 16:48:00;CIDADAO COMUM;S;CA2;OURO PRETO;BH;606256.94;800864.38;3901
-3903;2001163471;B06000;LESAO CORPORAL;RUA MARIA ROSA D;205;107800;25/3/2001 16:54:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;605990.28;811335.34;3902
-3904;2001163528;B06000;LESAO CORPORAL;RUA Q;74;78415;25/3/2001 17:31:00;CIDADAO COMUM;N;CA57;VILA PINHO;BH;602137.45;787979.37;3903
-3905;2001163541;B04001;HOMICIDIO TENTAD;RUA RIO NOVO;64;58817;25/3/2001 17:40:00;CIDADAO COMUM;N;0;LAGOINHA;BH;610575.70;798394.02;3904
-3906;2001163585;B06000;LESAO CORPORAL;RUA CLAUDIO BRAN;210;15960;25/3/2001 18:01:00;CIDADAO COMUM;N;;TUPI;BH;612776.24;806486.34;3905
-3907;2001163610;B04001;HOMICIDIO TENTAD;RUA ENGENHO DO S;760;80427;25/3/2001 18:07:00;INICIATIVA;N;0;ENGENHO NOGUEIRA;BH;606376.46;800209.42;3906
-3908;2001163631;B06000;LESAO CORPORAL;AV DOUTOR CRISTI;1109;62459;25/3/2001 18:21:00;INICIATIVA;S;0;PLANALTO;BH;610111.47;805715.27;3907
-3909;2001163646;B04001;HOMICIDIO TENTAD;RUA REGINO GONZA;11;95522;25/3/2001 18:33:00;POLICIAL MILITAR;N;SOL MILITAR REFO;JARDIM VITORIA;BH;617056.30;804188.87;3908
-3910;2001163677;B03000;AMEACA;RUA JOAQUIM CORR;14;57288;25/3/2001 18:47:00;CIDADAO COMUM;S;;CAMARGOS;BH;602174.27;794614.42;3909
-3911;2001163687;B03000;AMEACA;AV SANTA ALBERTI;200;116170;25/3/2001 18:54:00;CIDADAO COMUM;N;;CAETANO FURQUIM;BH;616505.24;799988.35;3910
-3912;2001163688;B03000;AMEACA;RUA MUNICIPAL;20;84239;25/3/2001 18:53:00;CIDADAO COMUM;S;CAC;RIO BRANCO;BH;606795.56;808729.34;3911
-3913;2001163709;B03000;AMEACA;RUA ALEXANDRE LE;27;50162;25/3/2001 19:04:00;CIDADAO COMUM;N;;ESTRELA DALVA;BH;607685.49;792465.04;3912
-3914;2001163727;B06000;LESAO CORPORAL;RUA DOS SALESIAN;680;9087;25/3/2001 19:13:00;CIDADAO COMUM;S;0;PLANALTO;BH;610416.78;805536.12;3913
-3915;2001163746;B06000;LESAO CORPORAL;AV DO CONTORNO;9530;17228;25/3/2001 19:24:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609166.33;796740.91;3914
-3916;2001163767;B03000;AMEACA;AV MONTESE;1090;46675;25/3/2001 19:35:00;CIDADAO COMUM;S;;SANTA BRANCA;BH;607998.64;806599.40;3915
-3917;2001163773;B06000;LESAO CORPORAL;RUA BOM JESUS DA;250;99680;25/3/2001 19:34:00;CIDADAO COMUM;N;;SANTA TEREZINHA;BH;604196.12;802710.04;3916
-3918;2001163797;B03000;AMEACA;RUA TRES;86;300266;25/3/2001 19:51:00;CIDADAO COMUM;S;;VISTA DO SOL;BH;616379.13;804683.65;3917
-3919;2001163809;B03000;AMEACA;RUA SAO RAFAEL;138;63580;25/3/2001 19:58:00;CIDADAO COMUM;S;;FLORESTA;BH;612241.79;798264.50;3918
-3920;2001163825;B03000;AMEACA;RUA VINTE E SETE;191;33115;25/3/2001 20:05:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612303.47;807232.65;3919
-3921;2001163846;B04001;HOMICIDIO TENTAD;AV JOSE CANDIDO ;1200;12602;25/3/2001 20:15:00;INICIATIVA;N;0;UNIAO;BH;613277.34;800584.46;3920
-3922;2001163858;B06000;LESAO CORPORAL;RUA ALETES;134;2075;25/3/2001 20:20:00;CIDADAO COMUM;S;CAA;PINDORAMA;BH;602646.60;797535.96;3921
-3923;2001163859;B04001;HOMICIDIO TENTAD;RUA SETENTA E TR;25;124264;25/3/2001 20:21:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607860.04;811786.76;3922
-3924;2001163876;B03000;AMEACA;RUA NAVAJOS;393;47334;25/3/2001 20:27:00;CIDADAO COMUM;S;CASA 103;SANTA MONICA;BH;607322.84;807248.25;3923
-3925;2001163898;B03000;AMEACA;RUA ROCHA LAGOA;249;58990;25/3/2001 20:42:00;CIDADAO COMUM;N;CAA;CACHOEIRINHA;BH;609953.51;801281.16;3924
-3926;2001163963;B06000;LESAO CORPORAL;RUA DES BRAULIO;1235;19917;25/3/2001 21:11:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616276.33;797850.05;3925
-3927;2001164004;B04001;HOMICIDIO TENTAD;RUA JULITA NOGUE;1000;39597;25/3/2001 21:31:00;CIDADAO COMUM;S;0;SANTA TEREZINHA;BH;604381.61;802818.36;3926
-3928;2001164012;B03000;AMEACA;RUA ANA SEVERINA;100;99955;25/3/2001 21:35:00;INICIATIVA;S;0;BRAUNAS;BH;603437.58;804941.90;3927
-3929;2001164056;B06000;LESAO CORPORAL;RUA MAUREA DE OL;215;117592;25/3/2001 21:50:00;CIDADAO COMUM;N;PROX.ORFANATO ST;VENDA NOVA;BH;607285.12;809101.82;3928
-3930;2001164061;B03000;AMEACA;RUA DOS TUPINAMB;518;69940;25/3/2001 21:56:00;CIDADAO COMUM;N;PX518;CENTRO (BH);BH;611073.31;797352.77;3929
-3931;2001164068;B04002;HOMICIDIO CONSUM;AV MARIA CONCEIC;1015;32052;25/3/2001 21:58:00;CIDADAO COMUM;N;CAB;GOIANIA;BH;615379.04;803475.97;3930
-3932;2001164083;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;25/3/2001 22:08:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;3931
-3933;2001164085;B03000;AMEACA;AV WALDOMIRO LOB;1220;66548;25/3/2001 22:08:00;CIDADAO COMUM;S;0;GUARANI;BH;612147.10;805326.19;3932
-3934;2001164094;B04001;HOMICIDIO TENTAD;RUA FLOR DE MAIO;447;300399;25/3/2001 22:12:00;INICIATIVA;S;0;VILA CAFEZAL;BH;614645.76;794817.74;3933
-3935;2001164110;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;4052;17228;25/3/2001 22:19:00;CIDADAO COMUM;S;AP101;SAO LUCAS;BH;612793.97;795966.61;3934
-3936;2001164111;B03000;AMEACA;RUA INDUSTRIAL J;597;34477;25/3/2001 22:19:00;CIDADAO COMUM;S;A;NOVA GRANADA;BH;608020.74;794556.86;3935
-3937;2001164112;B03000;AMEACA;RUA GIBRALTAR;188;31223;25/3/2001 22:20:00;CIDADAO COMUM;N;PROX. A R:GUARAR;NOVO GLORIA;BH;603456.01;799013.92;3936
-3938;2001164146;B04001;HOMICIDIO TENTAD;RUA CONEGO TRIND;1445;16861;25/3/2001 22:39:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605675.61;808311.01;3937
-3939;2001164167;B03000;AMEACA;RUA SAO JOSE;400;63045;25/3/2001 22:56:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605876.86;794133.51;3938
-3940;2001164168;B03000;AMEACA;AV MENELICK DE C;205;30448;25/3/2001 22:57:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604170.93;788789.23;3939
-3941;2001164264;B06000;LESAO CORPORAL;RUA SAO RODRIGUE;120;103420;25/3/2001 23:49:00;INICIATIVA;S;0;ANTONIO RIBEIRO ;BH;615617.05;805562.96;3940
-3942;2001164284;B03000;AMEACA;AV MANOEL GOMES;250;43103;26/3/2001 00:11:00;CIDADAO COMUM;S;0;NOVA CACHOEIRINH;BH;609668.41;801466.24;3941
-3943;2001164294;B03000;AMEACA;RUA ANTONIO VIEI;321;4925;26/3/2001 00:20:00;CIDADAO COMUM;S;0;GLALIJA;BH;603417.19;794194.43;3942
-3944;2001164434;B03000;AMEACA;RUA DIVINESIA;84;82199;26/3/2001 02:23:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612651.00;804712.28;3943
-3945;2001164499;B03000;AMEACA;PRACA CRISTO RED;50;18693;26/3/2001 04:15:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;604707.83;790851.38;3944
-3946;2001164617;B06000;LESAO CORPORAL;AV AMAZONAS;1313;3140;26/3/2001 07:35:00;INICIATIVA;N;0;BARRO PRETO;BH;610339.94;796671.36;3945
-3947;2001164662;B03000;AMEACA;RUA DIVISA SANTA;260;21452;26/3/2001 08:07:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604225.39;790674.08;3946
-3948;2001164679;B03000;AMEACA;RUA CALDAS DA RA;855;61100;26/3/2001 08:15:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609607.84;802228.80;3947
-3949;2001164717;B03000;AMEACA;RUA TEOFILO PIRE;117;67465;26/3/2001 08:36:00;CIDADAO COMUM;S;FU;BOA VISTA;BH;615282.49;800096.43;3948
-3950;2001164754;B03000;AMEACA;AV RAJA GABAGLIA;1740;57830;26/3/2001 09:02:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608719.62;793771.09;3949
-3951;2001164896;B03000;AMEACA;AV FLOR DE SEDA;781;748;26/3/2001 10:37:00;CIDADAO COMUM;S;0;LINDEIA;BH;599486.14;790600.03;3950
-3952;2001164927;B08000;VIOLACAO DE DOMI;RUA GUARATINGA;15;32282;26/3/2001 11:03:00;CIDADAO COMUM;S;;SION;BH;611644.45;793087.67;3951
-3953;2001164988;B03000;AMEACA;RUA VILA RICA;1795;71992;26/3/2001 11:48:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606750.79;798775.44;3952
-3954;2001165099;B06000;LESAO CORPORAL;RUA JOSUE AZEVED;10;56487;26/3/2001 13:17:00;CIDADAO COMUM;S;0;PLANALTO;BH;610223.03;806345.30;3953
-3955;2001165108;B03000;AMEACA;RUA PEDRA DO IND;75;32774;26/3/2001 13:24:00;CIDADAO COMUM;N;;CANDELARIA;BH;608469.25;808762.11;3954
-3956;2001165115;B06000;LESAO CORPORAL;RUA DURVALIA;65;115704;26/3/2001 13:26:00;CIDADAO COMUM;N;;HAVAI;BH;607425.30;793431.31;3955
-3957;2001165160;B03000;AMEACA;AV SANTOS DUMONT;260;61950;26/3/2001 13:55:00;CIDADAO COMUM;N;PX262;CENTRO (BH);BH;611389.56;797503.41;3956
-3958;2001165167;B06000;LESAO CORPORAL;RUA CHEIK NAGIB ;205;52892;26/3/2001 14:00:00;POLICIAL MILITAR;S;0;JARDIM ATLANTICO;BH;607950.82;805633.54;3957
-3959;2001165259;B03000;AMEACA;RUA VIANA DO CAS;490;63640;26/3/2001 15:05:00;CIDADAO COMUM;N;;SAO FRANCISCO;BH;609580.11;801875.33;3958
-3960;2001165331;B06000;LESAO CORPORAL;AV AMAZONAS;555;3140;26/3/2001 15:47:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611012.14;797068.58;3959
-3961;2001165381;B03000;AMEACA;RUA SEBASTIAO MO;409;93555;26/3/2001 16:19:00;INICIATIVA;S;0;TIROL;BH;600565.02;789378.17;3960
-3962;2001165452;B06000;LESAO CORPORAL;RUA DAVIDSON PIM;53;124189;26/3/2001 16:54:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607054.62;811628.39;3961
-3963;2001165537;B06000;LESAO CORPORAL;RUA GUARDA CUSTO;143;32330;26/3/2001 17:43:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606669.33;802899.77;3962
-3964;2001165544;B03000;AMEACA;RUA SEIS;289;21465;26/3/2001 17:47:00;CIDADAO COMUM;S;0;FLAVIO MARQUES D;BH;604570.80;788685.75;3963
-3965;2001165604;B03000;AMEACA;RUA DONA LUCI;74;86004;26/3/2001 18:17:00;INICIATIVA;S;0;CINQUENTENARIO;BH;606844.52;791890.31;3964
-3966;2001165647;B03000;AMEACA;RUA JAVARI;1176;37204;26/3/2001 18:41:00;CIDADAO COMUM;S;0;RENASCENCA;BH;610764.64;800500.36;3965
-3967;2001165791;B03000;AMEACA;RUA COLETORA A;219;103780;26/3/2001 19:41:00;CIDADAO COMUM;S;;PETROPOLIS;BH;601557.17;786612.31;3966
-3968;2001165812;B06000;LESAO CORPORAL;RUA SAO JOAQUIM;1189;62940;26/3/2001 19:58:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613255.69;799389.27;3967
-3969;2001165838;B03000;AMEACA;RUA MADRE TEREZA;264;96594;26/3/2001 20:11:00;CIDADAO COMUM;N;0;JARDIM EUROPA;BH;608301.76;809616.81;3968
-3970;2001165845;B03000;AMEACA;RUA 1;100;300686;26/3/2001 20:18:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607517.47;811158.32;3969
-3971;2001165865;B06000;LESAO CORPORAL;AV DOS ENGENHEIR;570;103027;26/3/2001 20:27:00;CIDADAO COMUM;N;AP204;CONJUNTO ALIPIO ;BH;604325.61;800713.15;3970
-3972;2001165906;B06000;LESAO CORPORAL;RUA PADRE BELCHI;323;51240;26/3/2001 20:54:00;INICIATIVA;S;0;CENTRO (BH);BH;610835.72;796709.76;3971
-3973;2001166016;B06000;LESAO CORPORAL;RUA BOLIVAR;206;9871;26/3/2001 22:09:00;CIDADAO COMUM;N;;UNIAO;BH;612670.70;801380.95;3972
-3974;2001166068;B03000;AMEACA;RUA JOAO CANDIDO;30;93240;26/3/2001 22:37:00;INICIATIVA;S;0;INDEPENDENCIA;BH;601117.42;785918.74;3973
-3975;2001166095;B03000;AMEACA;RUA NOVA FRIBURG;389;48438;26/3/2001 22:55:00;CIDADAO COMUM;S;0;SENHOR BOM JESUS;BH;609623.52;799755.41;3974
-3976;2001166131;B03000;AMEACA;RUA DOS BOROROS;58;10216;26/3/2001 23:15:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;606568.60;807503.10;3975
-3977;2001166142;B03000;AMEACA;RUA JOAO BATISTA;10;97745;26/3/2001 23:21:00;CIDADAO COMUM;S;0;DOM SILVERIO;BH;614734.92;804019.88;3976
-3978;2001166237;B03000;AMEACA;RUA EXPEDICIONAR;119;27068;27/3/2001 00:38:00;CIDADAO COMUM;N;0;ADELAIDE;BH;607311.27;798455.73;3977
-3979;2001166301;B03000;AMEACA;RUA CHAFARIZ;101;300275;27/3/2001 01:46:00;CIDADAO COMUM;S;;HAVAI;BH;607375.81;793751.13;3978
-3980;2001166424;B04001;HOMICIDIO TENTAD;RUA CABROBO;179;11187;27/3/2001 03:42:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;613152.24;799131.49;3979
-3981;2001166592;B03000;AMEACA;RUA CURITIBA;34;19090;27/3/2001 08:02:00;INICIATIVA;S;0;CENTRO BH;BH;610999.16;797826.98;3980
-3982;2001166788;B03000;AMEACA;RUA DARIO FARIA ;172;39240;27/3/2001 09:52:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604413.16;792527.74;3981
-3983;2001166852;B03000;AMEACA;RUA RIO NEGRO;490;58804;27/3/2001 10:37:00;CIDADAO COMUM;S;;BARROCA;BH;608240.20;796055.77;3982
-3984;2001166886;B03000;AMEACA;AV PRESIDENTE CA;3001;55125;27/3/2001 10:53:00;POLICIAL MILITAR;S;0;CAICARA;BH;608178.06;800324.32;3983
-3985;2001166925;B03000;AMEACA;RUA INES GLANSMA;880;34511;27/3/2001 11:20:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615208.26;807133.98;3984
-3986;2001166932;B03000;AMEACA;RUA MARIA DO CAR;15;83236;27/3/2001 11:24:00;CIDADAO COMUM;S;0;SANTA CRUZ (BARR;BH;603386.16;789142.95;3985
-3987;2001167019;B03000;AMEACA;RUA GUANABARA;714;32040;27/3/2001 12:16:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611362.74;799465.31;3986
-3988;2001167193;B06000;LESAO CORPORAL;RUA MOEMA;384;46070;27/3/2001 14:16:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606492.20;797861.20;3987
-3989;2001167241;B04002;HOMICIDIO CONSUM;BECO PAI JOAQUIM;251;171056;27/3/2001 14:43:00;CIDADAO COMUM;N;;CABANA;BH;604642.25;793982.11;3988
-3990;2001167247;B03000;AMEACA;RUA DA PAZ;30;31236;27/3/2001 14:46:00;CIDADAO COMUM;S;;CONJ HAB JARDIM ;BH;603953.08;798167.57;3989
-3991;2001167277;B03000;AMEACA;RUA HUMBERTO ROD;31;15480;27/3/2001 15:01:00;CIDADAO COMUM;N;CAFU;GOIANIA;BH;615645.47;803559.43;3990
-3992;2001167280;B06000;LESAO CORPORAL;RUA SERGIO MIRAN;47;80644;27/3/2001 15:03:00;CIDADAO COMUM;S;;OURO PRETO;BH;606189.60;801803.75;3991
-3993;2001167507;B03000;AMEACA;RUA DOS CAETES;657;11376;27/3/2001 17:10:00;POLICIAL MILITAR;N;0;CENTRO (BH);BH;610996.07;797471.77;3992
-3994;2001167580;B04001;HOMICIDIO TENTAD;ESTRADA DO CERCA;2350;26428;27/3/2001 17:45:00;CIDADAO COMUM;N;0;JARDIM AMERICA;BH;607601.11;793409.02;3993
-3995;2001167669;B03000;AMEACA;RUA SAO SALVADOR;46;63612;27/3/2001 18:31:00;CIDADAO COMUM;S;AP001;BONFIM;BH;610151.37;797963.59;3994
-3996;2001167896;B06000;LESAO CORPORAL;BECO TIA ANASTAC;25;301677;27/3/2001 20:22:00;CIDADAO COMUM;S;0;FAZENDINHA;BH;614673.21;795432.98;3995
-3997;2001167906;B03000;AMEACA;RUA FLOR DE VIDR;20;13504;27/3/2001 20:26:00;CIDADAO COMUM;S;AGUARDA NO FINAL;CASTELO;BH;605624.05;799447.30;3996
-3998;2001167922;B04001;HOMICIDIO TENTAD;AV PORTUGAL;3009;54816;27/3/2001 20:39:00;INICIATIVA;S;0;JARDIM ATLANTICO;BH;605742.12;805959.60;3997
-3999;2001167934;B03000;AMEACA;RODOVIA MGT 262;300;26598;27/3/2001 20:44:00;CIDADAO COMUM;S;;VILA BRASILIA;BH;614660.37;803506.34;3998
-4000;2001167943;B02000;RIXA;AV PRUDENTE DE M;720;55774;27/3/2001 20:51:00;CIDADAO COMUM;S;AP501;CORACAO DE JESUS;BH;610001.43;794654.44;3999
-4001;2001167958;B03000;AMEACA;RUA ENEIDA;328;25494;27/3/2001 21:03:00;CIDADAO COMUM;S;;PATROCINIO;BH;603602.88;799173.27;4000
-4002;2001167977;B03000;AMEACA;RUA ADAO MACIEL;185;106429;27/3/2001 21:15:00;CIDADAO COMUM;S;0;PRIMEIRO DE NOVE;BH;612581.61;805228.97;4001
-4003;2001167993;B06000;LESAO CORPORAL;RUA MARIA AMELIA;841;43812;27/3/2001 21:29:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610257.12;805510.06;4002
-4004;2001168075;B04001;HOMICIDIO TENTAD;RUA XINGU;560;73871;27/3/2001 22:21:00;CIDADAO COMUM;S;0;SANTA LUCIA;BH;609764.51;791271.71;4003
-4005;2001168080;B03000;AMEACA;RUA MARIA DE LOU;344;50540;27/3/2001 22:24:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;604339.53;792318.45;4004
-4006;2001168087;B06000;LESAO CORPORAL;RUA JACUI;3930;36734;27/3/2001 22:32:00;CIDADAO COMUM;S;;IPIRANGA;BH;611988.07;801551.26;4005
-4007;2001168118;B06000;LESAO CORPORAL;RUA BOM JESUS DO;39;42012;27/3/2001 22:46:00;CIDADAO COMUM;N;CAFRENT;CAMPO ALEGRE;BH;610264.60;806691.71;4006
-4008;2001168179;B04001;HOMICIDIO TENTAD;BECO LORENCO SIL;127;302105;27/3/2001 23:17:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605675.37;807168.57;4007
-4009;2001168190;B03000;AMEACA;RUA PROCOPIO FER;153;92552;27/3/2001 23:22:00;CIDADAO COMUM;S;;CALIFORNIA;BH;603463.88;796859.04;4008
-4010;2001168195;B06000;LESAO CORPORAL;RUA JORNALISTA D;65;122810;27/3/2001 23:23:00;CIDADAO COMUM;S;;BELVEDERE;BH;610550.50;791457.63;4009
-4011;2001168232;B05000;SEQUESTRO E CARC;AV BRAULIO GOMES;1453;81710;27/3/2001 23:46:00;CIDADAO COMUM;N;0;TIROL;BH;599864.95;789210.47;4010
-4012;2001168235;B03000;AMEACA;RUA ITAMBACURI;291;35570;27/3/2001 23:46:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608250.07;797536.60;4011
-4013;2001168245;B06000;LESAO CORPORAL;AV SANTOS DUMONT;574;61950;27/3/2001 23:52:00;INICIATIVA;S;0;CENTRO BH;BH;611085.24;797586.10;4012
-4014;2001168246;B03000;AMEACA;RUA CALAFATE;35;24044;27/3/2001 23:51:00;CIDADAO COMUM;N;;TAQUARIL;BH;617670.37;797320.52;4013
-4015;2001168283;B06000;LESAO CORPORAL;RUA CORNELIO CER;23;17417;28/3/2001 00:29:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606440.81;797810.81;4014
-4016;2001168289;B03000;AMEACA;RUA FLORALIA;40;28883;28/3/2001 00:32:00;INICIATIVA;S;0;ANCHIETA;BH;612042.63;794110.01;4015
-4017;2001168303;B03000;AMEACA;RUA JOAO DE MATO;6;37800;28/3/2001 00:47:00;CIDADAO COMUM;N;FR;IPIRANGA;BH;611683.83;800766.83;4016
-4018;2001168318;B03000;AMEACA;RUA CONCEICAO OL;275;108579;28/3/2001 01:05:00;CIDADAO COMUM;S;0;VILA SANTO ANTON;BH;609315.71;808212.65;4017
-4019;2001168326;B03000;AMEACA;AV VILARINHOS;1271;109988;28/3/2001 01:11:00;INICIATIVA;N;0;VENDA NOVA;BH;608853.02;808991.96;4018
-4020;2001168350;B04001;HOMICIDIO TENTAD;AV SILVIANO BRAN;2301;66002;28/3/2001 01:34:00;CIDADAO COMUM;S;;HORTO;BH;613485.88;798221.24;4019
-4021;2001168379;B03000;AMEACA;RUA AUGUSTA ANDR;1163;99104;28/3/2001 02:02:00;CIDADAO COMUM;S;;JAQUELINE;BH;611767.30;810612.10;4020
-4022;2001168393;B03000;AMEACA;RUA DO BATISMO;493;8390;28/3/2001 02:19:00;CIDADAO COMUM;N;;SAO JOSE;BH;605325.95;798900.22;4021
-4023;2001168607;B03000;AMEACA;RUA RADIALISTA A;120;122445;28/3/2001 07:54:00;CIDADAO COMUM;N;;CEU AZUL;BH;604759.99;808626.41;4022
-4024;2001168620;B03000;AMEACA;BECO SANTA CATAR;26;170255;28/3/2001 07:59:00;CIDADAO COMUM;S;FU;CABANA;BH;604766.78;794259.59;4023
-4025;2001168649;B03000;AMEACA;RUA JOAO ANTONIO;160;122054;28/3/2001 08:17:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607884.02;810802.11;4024
-4026;2001168712;B03000;AMEACA;AV FRANCISCO SA;334;29656;28/3/2001 08:55:00;CIDADAO COMUM;S;0;PRADO;BH;608934.20;796443.88;4025
-4027;2001168746;B03000;AMEACA;RUA SAO FELICISS;153;62373;28/3/2001 09:09:00;INICIATIVA;S;0;ESTRELA DO ORIEN;BH;605823.49;792412.58;4026
-4028;2001168771;B03000;AMEACA;AV BRIGADEIRO ED;1921;2860;28/3/2001 09:23:00;CIDADAO COMUM;S;0;PATROCINIO;BH;603691.51;799509.80;4027
-4029;2001168810;B09000;ABANDONO DE INCA;RUA CAMILO PRATE;35;11915;28/3/2001 09:47:00;CIDADAO COMUM;N;CAA;UNIAO;BH;613017.76;801351.18;4028
-4030;2001168828;B03000;AMEACA;RUA TOME DE SOUZ;248;67998;28/3/2001 09:56:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;612136.30;795032.33;4029
-4031;2001168833;B06000;LESAO CORPORAL;AV SARAMENHA;354;64007;28/3/2001 10:00:00;INICIATIVA;S;0;FLORAMAR;BH;612099.17;805663.93;4030
-4032;2001169124;B06000;LESAO CORPORAL;RUA PADRE EUSTAQ;2232;51294;28/3/2001 13:34:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;607452.58;797649.52;4031
-4033;2001169162;B03000;AMEACA;AV NELIO CERQUEI;15;72359;28/3/2001 14:05:00;CIDADAO COMUM;S;UNIDADE DE URGEN;TIROL;BH;600947.66;789885.51;4032
-4034;2001169278;B03000;AMEACA;RUA ANTONIO JOSE;67;4635;28/3/2001 15:10:00;CIDADAO COMUM;S;201;CAICARA;BH;607554.63;800226.83;4033
-4035;2001169311;B03000;AMEACA;AV AFONSO PENA;1452;1259;28/3/2001 15:28:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611506.40;796458.35;4034
-4036;2001169314;B04002;HOMICIDIO CONSUM;RUA GONCALVES MA;25;31567;28/3/2001 15:31:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607990.26;807452.46;4035
-4037;2001169339;B06000;LESAO CORPORAL;RUA RADIALISTA P;120;98909;28/3/2001 15:44:00;CIDADAO COMUM;S;;CEU AZUL;BH;604177.44;808465.20;4036
-4038;2001169403;B03000;AMEACA;RUA JOSE BARTOLO;129;38525;28/3/2001 16:19:00;CIDADAO COMUM;S;0;CONJUNTO ALIPIO ;BH;603704.00;799565.04;4037
-4039;2001169447;B03000;AMEACA;RUA BARAO DE GUA;260;7923;28/3/2001 16:50:00;CIDADAO COMUM;S;AP04;JOAO PINHEIRO;BH;604824.14;796178.48;4038
-4040;2001169462;B03000;AMEACA;RUA POUSO ALEGRE;538;54932;28/3/2001 16:56:00;CIDADAO COMUM;S;0;FLORESTA;BH;611588.94;797985.47;4039
-4041;2001169483;B03000;AMEACA;RUA AVEIRO;865;60715;28/3/2001 17:07:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;608907.00;801541.82;4040
-4042;2001169527;B03000;AMEACA;RUA ERNESTO TOGN;83;129850;28/3/2001 17:37:00;CIDADAO COMUM;S;;GORDURAS;BH;616434.31;803881.80;4041
-4043;2001169558;B03000;AMEACA;RUA CAMBOATA;90;106230;28/3/2001 17:53:00;CIDADAO COMUM;S;;PATROCINIO;BH;605068.16;794132.71;4042
-4044;2001169597;B03000;AMEACA;RUA INDEPENDENCI;1009;34391;28/3/2001 18:15:00;CIDADAO COMUM;S;;CABANA;BH;605985.71;793145.38;4043
-4045;2001169603;B03000;AMEACA;RUA DONA LUIZA;600;22947;28/3/2001 18:20:00;CIDADAO COMUM;N;BL L,APTO 303;MILIONARIOS;BH;604360.74;789993.13;4044
-4046;2001169616;B03000;AMEACA;RUA ALVARES RUBI;98;2769;28/3/2001 18:28:00;INICIATIVA;N;0;TUPI;BH;612206.64;806160.80;4045
-4047;2001169636;B03000;AMEACA;RUA SAFIRA;95;59835;28/3/2001 18:44:00;CIDADAO COMUM;S;;PRADO;BH;608617.43;796702.89;4046
-4048;2001169681;B03000;AMEACA;RODOVIA BRASILIA;80;124400;28/3/2001 19:05:00;INICIATIVA;N;0;SAO BENEDITO (SL;SL;610627.87;810496.47;4047
-4049;2001169694;B03000;AMEACA;RUA ISLANDIA;25;83683;28/3/2001 19:10:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;607785.96;810027.21;4048
-4050;2001169699;B03000;AMEACA;RUA JACAREI;123;36586;28/3/2001 19:11:00;CIDADAO COMUM;S;0;PIRATININGA;BH;606579.01;809587.17;4049
-4051;2001169844;B06000;LESAO CORPORAL;RUA MARECHAL RON;186;43677;28/3/2001 20:28:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611903.65;803402.26;4050
-4052;2001169849;B03000;AMEACA;RUA MONTE VIRGIN;295;46587;28/3/2001 20:31:00;INICIATIVA;S;0;MINASLANDIA;BH;612149.14;804944.69;4051
-4053;2001169914;B06000;LESAO CORPORAL;RUA CARMEM MIRAN;35;13605;28/3/2001 21:03:00;CIDADAO COMUM;S;0;TUPI;BH;612518.22;806227.57;4052
-4054;2001169921;B03000;AMEACA;RUA SANTA CLARA ;159;49295;28/3/2001 21:12:00;CIDADAO COMUM;S;;MINASLANDIA;BH;611739.23;804154.31;4053
-4055;2001169989;B03000;AMEACA;RUA VILA REAL;904;60683;28/3/2001 21:56:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609535.45;801659.70;4054
-4056;2001170010;B03000;AMEACA;RUA JAIME SALSE;278;36848;28/3/2001 22:13:00;INICIATIVA;S;0;MAGNESITA;BH;604022.14;793879.98;4055
-4057;2001170051;B03000;AMEACA;RUA CASABLANCA;839;13850;28/3/2001 22:41:00;CIDADAO COMUM;N;CAB;SANTA TEREZINHA;BH;604208.62;803104.88;4056
-4058;2001170094;B09000;ABANDONO DE INCA;RUA A;135;99489;28/3/2001 23:05:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;614971.05;808005.92;4057
-4059;2001170095;B06000;LESAO CORPORAL;RUA GUARATINGUET;87;32295;28/3/2001 23:08:00;CIDADAO COMUM;S;0;GUARANI;BH;612643.64;805626.34;4058
-4060;2001170096;B06000;LESAO CORPORAL;RUA DOS VIOLINOS;135;101797;28/3/2001 23:07:00;CIDADAO COMUM;S;0;CH CALIFORNIA;BH;603865.45;796695.57;4059
-4061;2001170160;B04001;HOMICIDIO TENTAD;RUA FELIPE CAMAR;12;27938;28/3/2001 23:48:00;CIDADAO COMUM;N;0;ESPLANADA;BH;613862.69;798419.73;4060
-4062;2001170163;B03000;AMEACA;RUA DO CARMO;170;13646;28/3/2001 23:51:00;CIDADAO COMUM;S;0;ITAIPU BH;BH;599008.41;789438.00;4061
-4063;2001170278;B06000;LESAO CORPORAL;RUA ANTONIO DE A;156;4345;29/3/2001 01:43:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611821.42;794964.79;4062
-4064;2001170285;B06000;LESAO CORPORAL;PRACA DUQUE DE C;39;24145;29/3/2001 01:54:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;613405.86;797477.21;4063
-4065;2001170301;B03000;AMEACA;RUA FLOR DO ORIE;398;50190;29/3/2001 02:21:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606173.97;799884.28;4064
-4066;2001170313;B03000;AMEACA;RUA ESTADOS UNID;271;26239;29/3/2001 02:36:00;CIDADAO COMUM;S;;COPACABANA;BH;606171.40;806197.79;4065
-4067;2001170328;B02000;RIXA;RUA DOS CAETES;409;11376;29/3/2001 02:52:00;CIDADAO COMUM;S;PX409;CENTRO (BH);BH;611212.90;797410.52;4066
-4068;2001170385;B06000;LESAO CORPORAL;RUA JUAZEIRO DO ;8;64873;29/3/2001 04:16:00;CIDADAO COMUM;N;0;ANTONIO RIBEIRO ;BH;615003.76;806779.18;4067
-4069;2001170507;B03000;AMEACA;RUA OTAVIANO NEV;235;94517;29/3/2001 07:16:00;CIDADAO COMUM;N;AP601;OURO PRETO;BH;606299.39;801104.52;4068
-4070;2001170640;B06000;LESAO CORPORAL;RUA JACUI;1131;36734;29/3/2001 08:36:00;CIDADAO COMUM;N;;CONCORDIA;BH;611706.90;799025.84;4069
-4071;2001170642;B03000;AMEACA;RUA SAO JOAO DE ;36;110073;29/3/2001 08:35:00;CIDADAO COMUM;N;0;PILAR;BH;607619.96;788690.43;4070
-4072;2001170910;B06000;LESAO CORPORAL;RUA GONCALVES DI;1116;31513;29/3/2001 11:38:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611468.71;795788.77;4071
-4073;2001171007;B03000;AMEACA;RUA OSORIO DUQUE;102;128136;29/3/2001 12:45:00;CIDADAO COMUM;S;;CAMPO ALEGRE;BH;610441.32;806709.79;4072
-4074;2001171073;B06000;LESAO CORPORAL;RUA MONTE ALEGRE;28;46357;29/3/2001 13:33:00;INICIATIVA;S;0;SERRA;BH;612538.37;795198.21;4073
-4075;2001171095;B03000;AMEACA;RUA C;53;102503;29/3/2001 13:47:00;CIDADAO COMUM;N;0;INDEPENDENCIA;BH;601649.58;786316.25;4074
-4076;2001171102;B06000;LESAO CORPORAL;RUA ITABIRA;493;35237;29/3/2001 13:56:00;CIDADAO COMUM;N;;LAGOINHA;BH;610931.11;798451.36;4075
-4077;2001171104;B06000;LESAO CORPORAL;RUA JOAO CAMPOS;114;48019;29/3/2001 13:58:00;CIDADAO COMUM;N;;CASTANHEIRA 2;BH;601623.61;788750.02;4076
-4078;2001171119;B06000;LESAO CORPORAL;RUA SERRINHA;53;129201;29/3/2001 14:07:00;CIDADAO COMUM;N;;MANGUEIRAS;BH;600519.25;786719.95;4077
-4079;2001171125;B06000;LESAO CORPORAL;RUA SAO DOMINGOS;360;62332;29/3/2001 14:10:00;CIDADAO COMUM;S;AP01;SANTO ANTONIO;BH;611078.05;794339.79;4078
-4080;2001171137;B03000;AMEACA;RUA RUBI;486;59517;29/3/2001 14:13:00;INICIATIVA;S;0;PRADO;BH;608575.67;796298.16;4079
-4081;2001171180;B03000;AMEACA;RUA DOS GUAJAJAR;496;32037;29/3/2001 14:37:00;CIDADAO COMUM;N;;LOURDES;BH;611128.51;796461.69;4080
-4082;2001171302;B03000;AMEACA;RUA SAO RAFAEL;138;63580;29/3/2001 15:38:00;CIDADAO COMUM;S;;FLORESTA;BH;612241.79;798264.50;4081
-4083;2001171305;B03000;AMEACA;RUA MERCEDES LUI;519;45483;29/3/2001 15:39:00;CIDADAO COMUM;S;;PIRAJA;BH;613947.54;803042.92;4082
-4084;2001171354;B03000;AMEACA;RUA DAS ARTEMISI;292;6091;29/3/2001 16:00:00;INICIATIVA;S;0;PARQUE SAO JOSE;BH;606852.54;792578.14;4083
-4085;2001171357;B06000;LESAO CORPORAL;AV JOAO PINHEIRO;467;37853;29/3/2001 16:01:00;CIDADAO COMUM;S;AP203;FUNCIONARIOS;BH;611292.51;796021.38;4084
-4086;2001171376;B03000;AMEACA;RUA NUNES VIEIRA;227;48932;29/3/2001 16:09:00;CIDADAO COMUM;S;POSTO MENINI DE ;SANTO ANTONIO;BH;610298.96;794576.25;4085
-4087;2001171419;B03000;AMEACA;RUA CAMILO PRATE;255;11915;29/3/2001 16:32:00;CIDADAO COMUM;N;CA3;UNIAO;BH;613231.52;801243.96;4086
-4088;2001171447;B03000;AMEACA;RUA HORIZONTE;375;33405;29/3/2001 16:53:00;CIDADAO COMUM;S;FR1661;PARAISO;BH;614681.90;796440.16;4087
-4089;2001171451;B06000;LESAO CORPORAL;RUA SATELITE;411;64076;29/3/2001 16:54:00;CIDADAO COMUM;S;;ADELAIDE;BH;607421.50;799006.29;4088
-4090;2001171470;B03000;AMEACA;RUA DES BRAULIO;1670;19917;29/3/2001 17:04:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616312.54;797548.95;4089
-4091;2001171499;B03000;AMEACA;RUA TEREZOPOLIS;65;26140;29/3/2001 17:15:00;CIDADAO COMUM;S;;TAQUARIL;BH;617459.03;797908.71;4090
-4092;2001171517;B06000;LESAO CORPORAL;RUA GUIA LOBO;30;32430;29/3/2001 17:24:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604560.55;789502.59;4091
-4093;2001171567;B06000;LESAO CORPORAL;PRACA DA LIBERDA;87;40870;29/3/2001 17:51:00;INICIATIVA;N;0;LOURDES;BH;611248.83;795658.19;4092
-4094;2001171622;B06000;LESAO CORPORAL;RUA DOM SEBASTIA;576;22455;29/3/2001 18:21:00;CIDADAO COMUM;N;;COPACABANA;BH;605770.79;806817.25;4093
-4095;2001171623;B06000;LESAO CORPORAL;RUA COSTA MACHAD;402;18334;29/3/2001 18:20:00;CIDADAO COMUM;S;;UNIVERSITARIO;BH;610772.74;802837.58;4094
-4096;2001171630;B06000;LESAO CORPORAL;RUA PAULO TIMOTE;175;41918;29/3/2001 18:25:00;CIDADAO COMUM;S;;VILA HUMAITA;BH;610336.11;801567.61;4095
-4097;2001171682;B03000;AMEACA;RUA DOS INDUSTRI;1247;34480;29/3/2001 18:50:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605216.21;791703.04;4096
-4098;2001171691;B06000;LESAO CORPORAL;RUA PARANAN;401;52271;29/3/2001 18:55:00;CIDADAO COMUM;N;FU;BONSUCESSO;BH;605204.95;790235.82;4097
-4099;2001171802;B03000;AMEACA;RUA HOFFMAN;80;33320;29/3/2001 19:37:00;CIDADAO COMUM;S;;SANTA CRUZ (BARR;BH;603694.24;789400.31;4098
-4100;2001171878;B06000;LESAO CORPORAL;RUA SAO TOMAS DE;787;63782;29/3/2001 20:29:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610797.04;793270.28;4099
-4101;2001171901;B03000;AMEACA;RUA DR BROCHADO;103;23215;29/3/2001 20:43:00;CIDADAO COMUM;N;CA55;VERA CRUZ;BH;615814.74;798592.95;4100
-4102;2001172111;B06000;LESAO CORPORAL;AV PRESIDENTE AN;2873;4461;29/3/2001 22:51:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;609839.13;800672.59;4101
-4103;2001172118;B06000;LESAO CORPORAL;RUA PATRICIO BAR;159;106661;29/3/2001 22:56:00;CIDADAO COMUM;N;;CH CALIFORNIA DO;BH;603497.76;797154.52;4102
-4104;2001172134;B03000;AMEACA;RUA CONSELHEIRO ;2957;17095;29/3/2001 23:08:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;614206.34;797690.26;4103
-4105;2001172324;B06000;LESAO CORPORAL;RUA NUMA NOGUEIR;111;48920;30/3/2001 01:07:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611850.13;806046.56;4104
-4106;2001172327;B08000;VIOLACAO DE DOMI;RUA SESSENTA E U;161;33689;30/3/2001 01:11:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612458.15;806921.58;4105
-4107;2001172331;B03000;AMEACA;RUA FERNAO DIAS;1223;28133;30/3/2001 01:15:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616164.18;797853.81;4106
-4108;2001172372;B06000;LESAO CORPORAL;RUA SERGIPE;1456;64961;30/3/2001 01:45:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611092.98;794935.73;4107
-4109;2001172427;B03000;AMEACA;RUA ARACAJU;169;5275;30/3/2001 02:52:00;CIDADAO COMUM;N;;SANTO ANDRE;BH;609468.69;799249.95;4108
-4110;2001172428;B06000;LESAO CORPORAL;AV GETULIO VARGA;263;81256;30/3/2001 02:52:00;CIDADAO COMUM;N;PX263;FUNCIONARIOS;BH;612405.05;795576.33;4109
-4111;2001172518;B04001;HOMICIDIO TENTAD;RUA SANTO AGOSTI;1271;61557;30/3/2001 05:29:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613648.90;799370.40;4110
-4112;2001172710;B03000;AMEACA;RUA SALINAS;2113;59992;30/3/2001 08:43:00;CIDADAO COMUM;N;;SANTA TEREZA;BH;613571.20;797710.20;4111
-4113;2001172712;B06000;LESAO CORPORAL;AV BIAS FORTES;1772;9553;30/3/2001 08:45:00;CIDADAO COMUM;S;PX1772;BARRO PRETO;BH;610196.72;797244.85;4112
-4114;2001172843;B06000;LESAO CORPORAL;BECO CARTOLA;10;301689;30/3/2001 10:01:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614408.03;795249.56;4113
-4115;2001172891;B03000;AMEACA;RUA DAS CLARINET;75;9119;30/3/2001 10:35:00;CIDADAO COMUM;S;;CH CALIFORNIA;BH;603994.02;796604.11;4114
-4116;2001173002;B03000;AMEACA;RUA IRIBA;276;35007;30/3/2001 11:51:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610507.65;800899.30;4115
-4117;2001173075;B06000;LESAO CORPORAL;RUA ANTONIO TEIX;2056;119037;30/3/2001 12:48:00;CIDADAO COMUM;S;;TEIXEIRA DIAS;BH;603154.87;789443.56;4116
-4118;2001173132;B03000;AMEACA;AV DOM PEDRO II;3249;53145;30/3/2001 13:19:00;CIDADAO COMUM;S;;ADELAIDE;BH;607698.05;797913.20;4117
-4119;2001173160;B03000;AMEACA;RUA RAMIRO SIQUE;165;128858;30/3/2001 13:34:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617702.63;797351.00;4118
-4120;2001173205;B06000;LESAO CORPORAL;RUA TEREZINHA FR;155;105136;30/3/2001 14:01:00;CIDADAO COMUM;S;0;DAS INDUSTRIAS;BH;605492.99;791083.70;4119
-4121;2001173330;B03000;AMEACA;RUA CINQUENTA;203;302845;30/3/2001 15:25:00;CIDADAO COMUM;S;;TUPI;BH;614197.66;805513.25;4120
-4122;2001173412;B06000;LESAO CORPORAL;RUA PADRE LAGE;19;4610;30/3/2001 16:10:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604640.37;797142.70;4121
-4123;2001173413;B06000;LESAO CORPORAL;RUA JOSAFA BELO;77;38364;30/3/2001 16:11:00;INICIATIVA;N;0;CIDADE JARDIM;BH;610011.54;795221.71;4122
-4124;2001173552;B04002;HOMICIDIO CONSUM;RUA MARIA ROSA D;150;107800;30/3/2001 17:26:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606011.75;811304.95;4123
-4125;2001173597;B06000;LESAO CORPORAL;RUA CELIA COSTA;31;105149;30/3/2001 17:45:00;CIDADAO COMUM;S;;PATROCINIO;BH;604016.70;799013.81;4124
-4126;2001173605;B04001;HOMICIDIO TENTAD;RUA LASSANCE;548;84415;30/3/2001 17:49:00;INICIATIVA;N;0;BOA VISTA;BH;615768.49;799690.36;4125
-4127;2001173695;B06000;LESAO CORPORAL;RUA TIMOTEO;448;69688;30/3/2001 18:43:00;CIDADAO COMUM;N;;SANTA INES;BH;614007.96;800435.59;4126
-4128;2001173701;B03000;AMEACA;RUA QUATRO;221;79588;30/3/2001 18:47:00;CIDADAO COMUM;S;;LINDEIA;BH;599659.25;790421.07;4127
-4129;2001173712;B03000;AMEACA;RUA EX-COMBATENT;180;19784;30/3/2001 18:55:00;CIDADAO COMUM;S;;SAO PAULO;BH;613081.65;802874.53;4128
-4130;2001173727;B06000;LESAO CORPORAL;AV BERNARDO MONT;879;9392;30/3/2001 19:05:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;612245.04;796346.92;4129
-4131;2001173744;B03000;AMEACA;RUA CORONEL ANTO;182;17590;30/3/2001 19:13:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;606140.28;807563.65;4130
-4132;2001173821;B03000;AMEACA;RUA FRANCA;48;29224;30/3/2001 19:57:00;CIDADAO COMUM;S;0;JARDIM AMERICA;BH;607503.92;794169.65;4131
-4133;2001173833;B04001;HOMICIDIO TENTAD;AV AUGUSTO DE LI;2109;6731;30/3/2001 20:08:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;609263.62;797044.80;4132
-4134;2001173857;B04002;HOMICIDIO CONSUM;AV COLETORA;478;78241;30/3/2001 20:21:00;INICIATIVA;N;0;VILA PINHO;BH;602113.34;788183.02;4133
-4135;2001173869;B04001;HOMICIDIO TENTAD;RUA ALGARVE;735;61396;30/3/2001 20:28:00;CIDADAO COMUM;N;CAA;SAO FRANCISCO;BH;609186.09;801896.95;4134
-4136;2001173891;B04002;HOMICIDIO CONSUM;RUA PRINCIPAL;428;300224;30/3/2001 20:39:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610510.27;793309.97;4135
-4137;2001173905;B03000;AMEACA;RUA DOUTOR BENED;1540;12252;30/3/2001 20:52:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;613682.32;803992.93;4136
-4138;2001173954;B03000;AMEACA;RUA JOSE BARTOLO;38;38525;30/3/2001 21:13:00;CIDADAO COMUM;S;;CONJUNTO ALIPIO ;BH;603707.54;799638.81;4137
-4139;2001174009;B03000;AMEACA;RUA HENRIQUE HOR;1324;88170;30/3/2001 21:52:00;CIDADAO COMUM;S;0;PLANALTO;BH;609649.18;806260.00;4138
-4140;2001174055;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;4000;18652;30/3/2001 22:25:00;INICIATIVA;N;0;DOS PALMARES;BH;612434.91;802092.92;4139
-4141;2001174066;B06000;LESAO CORPORAL;RUA ROSA NEGRA;227;124481;30/3/2001 22:34:00;CIDADAO COMUM;S;FU;ETELVINA CARNEIR;BH;611506.11;809123.86;4140
-4142;2001174092;B03000;AMEACA;AV GANDHI;293;76160;30/3/2001 22:54:00;CIDADAO COMUM;N;;VILA SANTA LUZIA;CO;603027.36;801996.15;4141
-4143;2001174111;B06000;LESAO CORPORAL;AV NOSSA SENHORA;1800;47996;30/3/2001 23:05:00;INICIATIVA;S;0;SAO PEDRO;BH;611086.35;793436.77;4142
-4144;2001174167;B06000;LESAO CORPORAL;RUA FLOR DE PAU;23;80294;30/3/2001 23:38:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;605654.63;799232.62;4143
-4145;2001174173;B06000;LESAO CORPORAL;RUA INHAMBU;40;56490;30/3/2001 23:39:00;CIDADAO COMUM;S;0;GOIANIA;BH;615378.23;802857.04;4144
-4146;2001174186;B03000;AMEACA;RUA MARIA BEATRI;606;43881;30/3/2001 23:52:00;CIDADAO COMUM;S;AP202;HAVAI;BH;606879.73;793253.08;4145
-4147;2001174232;B03000;AMEACA;RODOVIA MGT 262;291;26598;31/3/2001 00:19:00;CIDADAO COMUM;S;0;VILA BRASILIA;BH;614731.31;803443.10;4146
-4148;2001174260;B03000;AMEACA;RUA POUSO ALEGRE;2312;54932;31/3/2001 00:33:00;CIDADAO COMUM;S;BLC     AP106;FLORESTA;BH;613332.91;797870.75;4147
-4149;2001174296;B06000;LESAO CORPORAL;RUA AUGUSTO MEIE;230;6757;31/3/2001 00:52:00;CIDADAO COMUM;S;0;TUPI;BH;613793.27;806006.25;4148
-4150;2001174333;B04001;HOMICIDIO TENTAD;RUA MELODIA;53;301462;31/3/2001 01:09:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614240.36;795425.90;4149
-4151;2001174340;B06000;LESAO CORPORAL;RUA MARIA REGINA;759;124771;31/3/2001 01:12:00;INICIATIVA;S;0;CEU AZUL;BH;604595.45;807095.92;4150
-4152;2001174489;B02000;RIXA;AV SANTOS DUMONT;574;61950;31/3/2001 02:41:00;CIDADAO COMUM;S;PX587;CENTRO (BH);BH;611085.24;797586.10;4151
-4153;2001174547;B06000;LESAO CORPORAL;AV ERICO VERISSI;1000;41671;31/3/2001 03:19:00;INICIATIVA;S;0;SANTA MONICA;BH;607768.47;808762.85;4152
-4154;2001174555;B06000;LESAO CORPORAL;RUA CELIA DE SOU;671;14488;31/3/2001 03:23:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612595.85;798676.48;4153
-4155;2001174608;B03000;AMEACA;RUA CLOVIS DE CA;20;16064;31/3/2001 04:00:00;INICIATIVA;S;0;FLORAMAR;BH;612214.25;805793.87;4154
-4156;2001174621;B04001;HOMICIDIO TENTAD;RUA CAMBOATA;3;106230;31/3/2001 04:08:00;INICIATIVA;N;0;PATROCINIO;BH;605142.92;794077.66;4155
-4157;2001174721;B06000;LESAO CORPORAL;RUA DES CAMPOS;117;19920;31/3/2001 06:04:00;CIDADAO COMUM;S;;INCONFIDENCIA;BH;605053.40;798174.04;4156
-4158;2001174790;B06000;LESAO CORPORAL;RUA INDEPENDENCI;1009;34391;31/3/2001 07:21:00;CIDADAO COMUM;S;;CABANA;BH;605985.71;793145.38;4157
-4159;2001174807;B06000;LESAO CORPORAL;RUA VINTE E OITO;95;106182;31/3/2001 07:47:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;608112.67;810710.07;4158
-4160;2001174832;B03000;AMEACA;RUA PADRE MANOEL;143;51569;31/3/2001 08:07:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;614135.75;796233.74;4159
-4161;2001174957;B08000;VIOLACAO DE DOMI;RUA AGUA MARINHA;39;87744;31/3/2001 09:37:00;CIDADAO COMUM;S;CA;CANDELARIA;BH;607662.50;809375.47;4160
-4162;2001174969;B06000;LESAO CORPORAL;RUA R;2;27231;31/3/2001 09:49:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616521.94;806858.96;4161
-4163;2001175043;B06000;LESAO CORPORAL;RUA MADRE PAULIN;245;15538;31/3/2001 10:34:00;CIDADAO COMUM;S;;DIAMANTE;BH;601308.14;789709.42;4162
-4164;2001175055;B03000;AMEACA;RUA MUNIZ;360;170850;31/3/2001 10:50:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608153.90;793811.95;4163
-4165;2001175118;B06000;LESAO CORPORAL;RUA DOS CARIJOS;645;81243;31/3/2001 11:33:00;POLICIAL CIVIL;N;;CENTRO (BH);BH;610833.39;797215.72;4164
-4166;2001175169;B03000;AMEACA;AV PARANAIBA;547;52256;31/3/2001 12:06:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609858.31;800010.80;4165
-4167;2001175193;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;1030;300224;31/3/2001 12:32:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610701.80;792989.02;4166
-4168;2001175240;B03000;AMEACA;RUA FILOMENA GAS;177;62083;31/3/2001 13:04:00;CIDADAO COMUM;N;;APARECIDA SETIMA;BH;608447.47;800337.13;4167
-4169;2001175256;B03000;AMEACA;RUA SAO LEOPOLDO;10;63221;31/3/2001 13:17:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610817.96;801203.39;4168
-4170;2001175305;B03000;AMEACA;RUA FLOR DO ORIE;329;50190;31/3/2001 13:54:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606029.07;799987.90;4169
-4171;2001175328;B03000;AMEACA;RUA PARAIBUNA;57;52196;31/3/2001 14:07:00;CIDADAO COMUM;S;CAA;MINASLANDIA;BH;611940.42;804599.42;4170
-4172;2001175359;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;535;63782;31/3/2001 14:26:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610849.00;793420.56;4171
-4173;2001175411;B06000;LESAO CORPORAL;AV BARBACENA;653;8084;31/3/2001 15:02:00;CIDADAO COMUM;N;PRONTO SOCORRO;BARRO PRETO;BH;609636.01;796640.35;4172
-4174;2001175446;B03000;AMEACA;RUA 51;5;302847;31/3/2001 15:30:00;CIDADAO COMUM;N;0;NOVO AARAO REIS;BH;614188.75;805564.70;4173
-4175;2001175500;B03000;AMEACA;RUA K;500;41495;31/3/2001 16:00:00;INICIATIVA;N;0;CH CONFISCO (CO);CO;602570.39;802980.95;4174
-4176;2001175534;B03000;AMEACA;RUA GABRO;23;30435;31/3/2001 16:22:00;CIDADAO COMUM;N;BECO BRILHANTINA;SANTA TEREZA;BH;613006.52;797578.51;4175
-4177;2001175557;B03000;AMEACA;RUA JOVIANO COEL;10;39294;31/3/2001 16:35:00;CIDADAO COMUM;S;AN2;RIO BRANCO;BH;606938.05;808860.20;4176
-4178;2001175560;B03000;AMEACA;RUA PIRAI;54;54062;31/3/2001 16:41:00;CIDADAO COMUM;S;CAC;CONCORDIA;BH;610781.50;799320.53;4177
-4179;2001175564;B04001;HOMICIDIO TENTAD;RUA CAMILA DE SO;37;74294;31/3/2001 16:45:00;CIDADAO COMUM;N;QUI;SAO JOAO BATISTA;BH;608148.92;807536.43;4178
-4180;2001175608;B06000;LESAO CORPORAL;RUA LIGNITO;343;41050;31/3/2001 17:11:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613799.80;796334.31;4179
-4181;2001175617;B03000;AMEACA;RUA MAJOR DELFIN;1214;42620;31/3/2001 17:17:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609652.80;802187.36;4180
-4182;2001175632;B04001;HOMICIDIO TENTAD;RUA MUSAS;206;46993;31/3/2001 17:22:00;CIDADAO COMUM;N;;SANTA LUCIA;BH;610285.02;791421.66;4181
-4183;2001175657;B04001;HOMICIDIO TENTAD;RUA GUAPE;850;32100;31/3/2001 17:38:00;CIDADAO COMUM;N;PADARIA SANTA CR;SANTO ANDRE;BH;609843.76;799014.55;4182
-4184;2001175666;B06000;LESAO CORPORAL;RUA CASTELO DE B;41;124021;31/3/2001 17:40:00;CIDADAO COMUM;N;0;CASTELO;BH;605332.82;801428.56;4183
-4185;2001175688;B06000;LESAO CORPORAL;RUA NEY WERNECK;266;80382;31/3/2001 18:00:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606001.11;800117.22;4184
-4186;2001175806;B06000;LESAO CORPORAL;RUA HELIO LAZZAR;488;127694;31/3/2001 18:57:00;CIDADAO COMUM;S;;CAICARA;BH;607119.32;799646.13;4185
-4187;2001175876;B03000;AMEACA;RUA VISCONDE DE ;166;73380;31/3/2001 19:33:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608052.72;807550.20;4186
-4188;2001175924;B06000;LESAO CORPORAL;RUA NEY WERNECK;200;80382;31/3/2001 19:57:00;CIDADAO COMUM;S;CA03;JARDIM MONTANHES;BH;605920.10;800059.06;4187
-4189;2001175972;B03000;AMEACA;RUA SAO PAULO;124;63464;31/3/2001 20:21:00;INICIATIVA;N;0;CENTRO (BH);BH;611102.49;797669.42;4188
-4190;2001176092;B03000;AMEACA;BECO SAO MIGUEL;19;171002;31/3/2001 21:15:00;CIDADAO COMUM;S;FUNDOS CEM COLIN;CABANA;BH;604847.29;794027.97;4189
-4191;2001176111;B06000;LESAO CORPORAL;RUA CURI;742;19047;31/3/2001 21:29:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615733.51;799053.01;4190
-4192;2001176152;B06000;LESAO CORPORAL;RUA OZANAM;475;50796;31/3/2001 21:56:00;CIDADAO COMUM;N;0;IPIRANGA;BH;611931.96;801078.35;4191
-4193;2001176153;B02000;RIXA;RUA LARANJEIRAS;305;40423;31/3/2001 21:56:00;CIDADAO COMUM;N;0;LEBLON;BH;605695.40;809792.54;4192
-4194;2001176169;B04001;HOMICIDIO TENTAD;RUA ANA FRANCA;200;3529;31/3/2001 22:05:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604638.14;791892.60;4193
-4195;2001176199;B06000;LESAO CORPORAL;AV GOVERNADOR BE;826;67670;31/3/2001 22:25:00;CIDADAO COMUM;N;0;GAMELEIRA;BH;604830.93;795345.21;4194
-4196;2001176220;B06000;LESAO CORPORAL;RUA DOS AEROVIAR;59;1186;31/3/2001 22:38:00;CIDADAO COMUM;S;;LIBERDADE;BH;609063.15;804069.27;4195
-4197;2001176269;B06000;LESAO CORPORAL;AV SILVIANO BRAN;2503;66002;31/3/2001 23:17:00;CIDADAO COMUM;S;;HORTO;BH;613666.26;798305.11;4196
-4198;2001176280;B06000;LESAO CORPORAL;RUA NOSSA SENHOR;25;64905;31/3/2001 23:22:00;CIDADAO COMUM;N;0;JARDIM AMERICA;BH;607765.22;794520.66;4197
-4199;2001176304;B02000;RIXA;RUA MANTENA;80;43273;31/3/2001 23:34:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606459.52;802813.73;4198
-4200;2001176309;B06000;LESAO CORPORAL;RUA MONTE ALEGRE;1055;46357;31/3/2001 23:36:00;CIDADAO COMUM;S;;SAO LUCAS;BH;613156.17;795981.81;4199
-4201;2001235488;B03000;AMEACA;RUA GRACILIANO R;124;31683;1/5/2001 01:58:00;CIDADAO COMUM;S;;TUPI;BH;612710.78;805937.90;4200
-4202;2001235683;B03000;AMEACA;RUA CORONEL ALTI;267;119100;1/5/2001 05:13:00;CIDADAO COMUM;S;0;TEIXEIRA DIAS;BH;602544.15;789909.92;4201
-4203;2001235684;B06000;LESAO CORPORAL;RUA OURO PRETO;285;50730;1/5/2001 05:14:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609961.08;797017.98;4202
-4204;2001235688;B04001;HOMICIDIO TENTAD;RUA PADRE VENANC;78;51717;1/5/2001 05:17:00;INICIATIVA;S;0;GLORIA;BH;603605.95;798587.38;4203
-4205;2001235690;B06000;LESAO CORPORAL;RUA DOS TUPIS;546;69965;1/5/2001 05:24:00;INICIATIVA;N;0;CENTRO (BH);BH;610760.44;796995.95;4204
-4206;2001235694;B06000;LESAO CORPORAL;RUA AMILCAR CABR;960;5146;1/5/2001 05:26:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604353.05;789957.05;4205
-4207;2001235725;B06000;LESAO CORPORAL;AV OLEGARIO MACI;663;49699;1/5/2001 06:45:00;POLICIAL MILITAR;N;;CENTRO (BH);BH;610536.72;797015.09;4206
-4208;2001235747;B04002;HOMICIDIO CONSUM;RUA JOAQUIM GONC;777;119428;1/5/2001 07:41:00;CIDADAO COMUM;N;;VILA MAGNESITA;BH;602285.91;795055.04;4207
-4209;2001235792;B06000;LESAO CORPORAL;RUA LUZIA SALOMA;445;85042;1/5/2001 08:20:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606713.75;810778.88;4208
-4210;2001235893;B03000;AMEACA;AV SEN LEVINDO C;3320;14866;1/5/2001 09:54:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;601145.74;787029.27;4209
-4211;2001235921;B04002;HOMICIDIO CONSUM;RUA DO GROTAO;112;107217;1/5/2001 10:16:00;CIDADAO COMUM;N;0;HAVAI;BH;607513.23;793290.01;4210
-4212;2001235942;B06000;LESAO CORPORAL;ALAMEDA EZEQUIEL;225;27446;1/5/2001 10:33:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611899.54;796686.86;4211
-4213;2001235991;B04001;HOMICIDIO TENTAD;RUA JOAO LUCIO B;120;37737;1/5/2001 11:16:00;CIDADAO COMUM;S;;PRADO;BH;609122.06;796967.46;4212
-4214;2001235992;B03000;AMEACA;RUA URSULA PAULI;1750;71066;1/5/2001 11:18:00;CIDADAO COMUM;N;LJ4;ESTRELA DO ORIEN;BH;605775.64;792584.24;4213
-4215;2001236053;B06000;LESAO CORPORAL;RUA FLOR DE LIZ;42;28640;1/5/2001 12:11:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;606502.24;799018.81;4214
-4216;2001236098;B06000;LESAO CORPORAL;RUA DOS ANDRADAS;11;3787;1/5/2001 12:55:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609178.72;808615.38;4215
-4217;2001236194;B03000;AMEACA;RUA PERDIGAO PEQ;110;83006;1/5/2001 14:19:00;CIDADAO COMUM;S;;OURO PRETO;BH;605834.34;802999.45;4216
-4218;2001236220;B02000;RIXA;RUA VASSOURAS;750;71369;1/5/2001 14:37:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609096.59;799624.01;4217
-4219;2001236278;B06000;LESAO CORPORAL;RUA GERALDA MARI;42;69662;1/5/2001 15:24:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608535.68;807364.54;4218
-4220;2001236328;B06000;LESAO CORPORAL;RUA CARLINDO AUG;4;97124;1/5/2001 15:59:00;CIDADAO COMUM;S;0;SAO MARCOS;BH;614603.58;802449.51;4219
-4221;2001236456;B06000;LESAO CORPORAL;RUA FRUTAL;113;30060;1/5/2001 17:15:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613818.79;796965.01;4220
-4222;2001236537;B06000;LESAO CORPORAL;RUA VIOLETA DE M;400;80253;1/5/2001 17:59:00;INICIATIVA;S;0;SAO JOSE;BH;604478.74;799349.35;4221
-4223;2001236567;B06000;LESAO CORPORAL;RUA GUAICURUS;538;32009;1/5/2001 18:14:00;INICIATIVA;S;0;CENTRO (BH);BH;611143.63;797659.74;4222
-4224;2001236587;B03000;AMEACA;RUA ESPORA;779;117319;1/5/2001 18:28:00;CIDADAO COMUM;S;;LINDEIA;BH;600383.46;790393.09;4223
-4225;2001236590;B04001;HOMICIDIO TENTAD;RUA MARIO FILHO;495;44579;1/5/2001 18:29:00;INICIATIVA;N;0;ERMELINDA;BH;609263.47;800331.22;4224
-4226;2001236620;B06000;LESAO CORPORAL;RUA SEBASTIAO GO;101;119821;1/5/2001 18:44:00;CIDADAO COMUM;S;;SERRA VERDE;BH;609664.46;810990.23;4225
-4227;2001236627;B03000;AMEACA;RUA HONORIO BICA;830;29959;1/5/2001 18:51:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;615468.71;800578.81;4226
-4228;2001236701;B04001;HOMICIDIO TENTAD;AV PROFESSOR MAR;1390;91130;1/5/2001 19:25:00;CIDADAO COMUM;N;0;BURITIS;BH;608356.66;791712.79;4227
-4229;2001236733;B03000;AMEACA;RUA ADELIA CARME;297;1031;1/5/2001 19:41:00;CIDADAO COMUM;S;0;ITAIPU BH;BH;599573.53;789407.34;4228
-4230;2001236743;B04001;HOMICIDIO TENTAD;RUA SAO ROQUE;1570;63600;1/5/2001 19:47:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613633.57;799210.41;4229
-4231;2001236753;B06000;LESAO CORPORAL;AV PARANA;466;52230;1/5/2001 19:56:00;POLICIAL CIVIL;N;0;CENTRO (BH);BH;610691.17;797079.45;4230
-4232;2001236757;B06000;LESAO CORPORAL;RUA DES TINOCO;547;20028;1/5/2001 19:57:00;CIDADAO COMUM;S;;MONSENHOR MESSIA;BH;606692.07;798141.20;4231
-4233;2001236774;B06000;LESAO CORPORAL;RUA ITATIAIA;86;17499;1/5/2001 20:05:00;CIDADAO COMUM;S;;BONFIM;BH;610307.06;798033.40;4232
-4234;2001236822;B06000;LESAO CORPORAL;RUA JANAITIBA;916;36889;1/5/2001 20:31:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;616237.80;799193.05;4233
-4235;2001236852;B04002;HOMICIDIO CONSUM;RUA MICA;175;45685;1/5/2001 20:51:00;INICIATIVA;N;0;SAO LUCAS;BH;613254.99;795969.19;4234
-4236;2001236855;B03000;AMEACA;RUA GERALDO JARD;60;302051;1/5/2001 20:51:00;CIDADAO COMUM;S;0;CASTELO;BH;610589.31;804979.41;4235
-4237;2001236872;B06000;LESAO CORPORAL;RUA VISTA ALEGRE;627;73409;1/5/2001 21:01:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;614626.92;796908.04;4236
-4238;2001236917;B03000;AMEACA;RUA LUNDS FERREI;187;41920;1/5/2001 21:28:00;CIDADAO COMUM;N;;NOVA VISTA;BH;615004.25;800832.46;4237
-4239;2001236921;B04002;HOMICIDIO CONSUM;RUA DA BOLIVIA;222;9884;1/5/2001 21:30:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;611248.65;793837.13;4238
-4240;2001236922;B03000;AMEACA;RUA ALUISIO DE A;30;2642;1/5/2001 21:29:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607420.66;808150.58;4239
-4241;2001236943;B06000;LESAO CORPORAL;RUA ITAJUBA;1057;35495;1/5/2001 21:46:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612183.27;798466.57;4240
-4242;2001236962;B03000;AMEACA;RUA NATERCIA;95;47321;1/5/2001 21:54:00;CIDADAO COMUM;S;;SANTA INES;BH;614017.02;801360.75;4241
-4243;2001236984;B02000;RIXA;RUA SAO JOAQUIM;1388;62940;1/5/2001 22:11:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613458.25;799298.92;4242
-4244;2001237029;B03000;AMEACA;RUA ARAPE;141;29798;1/5/2001 22:30:00;CIDADAO COMUM;N;CAFR;UNIAO;BH;613068.53;801117.75;4243
-4245;2001237036;B06000;LESAO CORPORAL;RUA PINTO MARTIN;428;53854;1/5/2001 22:33:00;CIDADAO COMUM;N;0;VILA OESTE;BH;604042.43;795007.75;4244
-4246;2001237148;B06000;LESAO CORPORAL;RUA WALTER IANNI;80;82186;1/5/2001 23:39:00;INICIATIVA;N;0;SAO GABRIEL;BH;613192.78;803761.07;4245
-4247;2001237180;B03000;AMEACA;AV FLOR DE SEDA;1370;748;1/5/2001 23:59:00;CIDADAO COMUM;N;;LINDEIA;BH;599978.29;790345.69;4246
-4248;2001237184;B04002;HOMICIDIO CONSUM;BECO JOSE BONIFA;235;300984;1/5/2001 23:59:00;CIDADAO COMUM;N;0;PRADO LOPES;BH;610199.16;798938.94;4247
-4249;2001237255;B06000;LESAO CORPORAL;RUA MARIA DELFIN;99;43970;2/5/2001 01:08:00;CIDADAO COMUM;N;0;CINQUENTENARIO;BH;606411.72;793418.98;4248
-4250;2001237261;B03000;AMEACA;RUA CARLOS NIEME;455;13472;2/5/2001 01:24:00;INICIATIVA;S;0;SAGRADA FAMILIA;BH;613542.53;798883.75;4249
-4251;2001237280;B04001;HOMICIDIO TENTAD;ESTRADA DO CERCA;2178;26428;2/5/2001 01:41:00;CIDADAO COMUM;S;;SAO DOMINGOS;BH;607554.57;793526.69;4250
-4252;2001237465;B06000;LESAO CORPORAL;RUA CORONEL ANTO;784;17590;2/5/2001 07:11:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605558.64;807500.35;4251
-4253;2001237627;B04001;HOMICIDIO TENTAD;RUA CAIO VIANA M;65;11477;2/5/2001 08:50:00;CIDADAO COMUM;S;FU;ARAGUAIA;BH;604494.91;789155.55;4252
-4254;2001237680;B06000;LESAO CORPORAL;RUA HILDEBRANDO ;556;129788;2/5/2001 09:17:00;CIDADAO COMUM;S;0;COPACABANA;BH;606580.08;806418.27;4253
-4255;2001237829;B06000;LESAO CORPORAL;AV BARBACENA;653;8084;2/5/2001 10:59:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609636.01;796640.35;4254
-4256;2001237849;B03000;AMEACA;RUA PONTA GROSSA;1441;14900;2/5/2001 11:17:00;INICIATIVA;N;0;CRISTO REDENTOR;BH;604877.50;790823.59;4255
-4257;2001237884;B06000;LESAO CORPORAL;RUA DOUTOR ALIPI;389;2365;2/5/2001 11:42:00;CIDADAO COMUM;S;;SERRA;BH;613860.47;794632.24;4256
-4258;2001238076;B03000;AMEACA;RUA QUIARI;90;57161;2/5/2001 13:59:00;POLICIAL MILITAR;N;;SAO GERALDO;BH;615497.49;799877.42;4257
-4259;2001238189;B03000;AMEACA;RUA ORION RIGEL ;191;128961;2/5/2001 15:16:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611775.11;807103.70;4258
-4260;2001238225;B03000;AMEACA;RUA DINIS DIAS;145;119673;2/5/2001 15:32:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616573.20;797526.82;4259
-4261;2001238276;B06000;LESAO CORPORAL;RUA BONFIM;1120;10096;2/5/2001 15:59:00;CIDADAO COMUM;S;;BONFIM;BH;609801.52;798284.45;4260
-4262;2001238313;B03000;AMEACA;RUA CURITIBA;949;19090;2/5/2001 16:16:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610799.92;796919.51;4261
-4263;2001238333;B03000;AMEACA;RUA MAJOR DELFIN;2450;42620;2/5/2001 16:29:00;INICIATIVA;S;;SAO FRANCISCO;BH;609055.69;801501.27;4262
-4264;2001238360;B03000;AMEACA;RUA BARAO DE SAR;559;8043;2/5/2001 16:44:00;CIDADAO COMUM;N;0;HORTO;BH;613733.24;797809.77;4263
-4265;2001238364;B03000;AMEACA;RUA VOLTS;25;73626;2/5/2001 16:45:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612240.98;803326.26;4264
-4266;2001238367;B03000;AMEACA;RUA G;11;36721;2/5/2001 16:48:00;INICIATIVA;S;0;MINASCAIXA;BH;609150.38;809830.09;4265
-4267;2001238396;B03000;AMEACA;RUA JUATUBA;42;39367;2/5/2001 17:05:00;CIDADAO COMUM;S;NR CORRETO/57;VISTA ALEGRE;BH;605262.83;793420.62;4266
-4268;2001238560;B04001;HOMICIDIO TENTAD;RUA AFONSO PEREI;10;107752;2/5/2001 19:00:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606653.03;811490.84;4267
-4269;2001238608;B03000;AMEACA;AV ITAITUBA;450;35454;2/5/2001 19:19:00;CIDADAO COMUM;N;0;BOA VISTA;BH;615072.17;799768.56;4268
-4270;2001238679;B03000;AMEACA;RUA BARAO DE MAC;449;7980;2/5/2001 19:55:00;CIDADAO COMUM;S;;SANTO ANTONIO;BH;610174.15;794888.88;4269
-4271;2001238686;B03000;AMEACA;RUA JOSE MOREIRA;422;55368;2/5/2001 20:01:00;CIDADAO COMUM;N;CSFU;SAO MARCOS;BH;614483.67;802473.88;4270
-4272;2001238703;B03000;AMEACA;RUA JOAO WESLEY;69;64441;2/5/2001 20:10:00;CIDADAO COMUM;S;0;SAO JOAO BATISTA;BH;608579.52;808541.11;4271
-4273;2001238742;B03000;AMEACA;RUA CARLOS ETIEN;84;13356;2/5/2001 20:37:00;INICIATIVA;N;0;SERRA;BH;613964.61;794958.91;4272
-4274;2001238770;B06000;LESAO CORPORAL;RUA URANO;338;71000;2/5/2001 20:48:00;CIDADAO COMUM;S;CAC;VILA SATELITE;BH;610013.62;808625.58;4273
-4275;2001238798;B06000;LESAO CORPORAL;AV MEM DE SA;1457;45395;2/5/2001 21:07:00;CIDADAO COMUM;S;;PARAISO;BH;614255.88;796144.29;4274
-4276;2001238874;B06000;LESAO CORPORAL;RUA DOS OTONI;637;50667;2/5/2001 22:04:00;INICIATIVA;N;0;SANTA EFIGENIA;BH;612405.45;796371.31;4275
-4277;2001238880;B03000;AMEACA;RUA CRISTAL;312;18611;2/5/2001 22:07:00;CIDADAO COMUM;N;;SANTA TEREZA;BH;612754.03;797170.88;4276
-4278;2001238894;B03000;AMEACA;RUA HORACIO DOLA;127;11565;2/5/2001 22:21:00;CIDADAO COMUM;N;;CEU AZUL;BH;604125.19;807520.28;4277
-4279;2001238912;B03000;AMEACA;RUA MEXICO;579;45660;2/5/2001 22:32:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605377.49;807191.43;4278
-4280;2001238926;B03000;AMEACA;BECO ORIENTAL;150;301495;2/5/2001 22:42:00;CIDADAO COMUM;S;0;SAO LUCAS;BH;613207.58;795848.83;4279
-4281;2001238979;B03000;AMEACA;RUA LUPERCIO PAI;280;57335;2/5/2001 23:07:00;CIDADAO COMUM;S;0;TIROL;BH;599911.01;789035.54;4280
-4282;2001238987;B03000;AMEACA;RUA LOURIVAL SOA;26;109341;2/5/2001 23:13:00;CIDADAO COMUM;S;;CEU AZUL;BH;604657.01;807776.85;4281
-4283;2001238996;B03000;AMEACA;RUA SABARA;21;59750;2/5/2001 23:24:00;CIDADAO COMUM;S;0;FLORESTA;BH;611202.63;798017.88;4282
-4284;2001238998;B03000;AMEACA;AV SEN LEVINDO C;1070;14866;2/5/2001 23:24:00;CIDADAO COMUM;N;;SANTA CECILIA;BH;601290.55;786629.80;4283
-4285;2001239044;B02000;RIXA;RUA ITAQUERA;428;35920;2/5/2001 23:54:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611178.14;799141.23;4284
-4286;2001239088;B03000;AMEACA;RUA TIZIU;542;95881;3/5/2001 00:38:00;CIDADAO COMUM;N;0;GOIANIA;BH;615351.18;802590.79;4285
-4287;2001239107;B03000;AMEACA;RUA DINIS DIAS;145;119673;3/5/2001 00:54:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616573.20;797526.82;4286
-4288;2001239179;B04001;HOMICIDIO TENTAD;RUA DOUTOR BENED;400;12252;3/5/2001 01:59:00;INICIATIVA;N;0;ANTONIO RIBEIRO ;BH;612542.70;803696.47;4287
-4289;2001239180;B06000;LESAO CORPORAL;AV DO CONTORNO;10360;17228;3/5/2001 02:00:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609614.39;797316.12;4288
-4290;2001239192;B06000;LESAO CORPORAL;RUA ZODIACO;637;74036;3/5/2001 02:16:00;CIDADAO COMUM;N;;SANTA LUCIA;BH;610296.58;791986.51;4289
-4291;2001239263;B03000;AMEACA;RUA DONATO DA FO;44;23067;3/5/2001 03:32:00;CIDADAO COMUM;S;AP 301;CORACAO DE JESUS;BH;610024.42;794463.88;4290
-4292;2001239507;B03000;AMEACA;RUA OURO PRETO;1421;50730;3/5/2001 08:27:00;CIDADAO COMUM;N;APT.203;SANTO AGOSTINHO;BH;609659.90;795880.65;4291
-4293;2001239604;B03000;AMEACA;RUA MARQUES DO L;470;44755;3/5/2001 09:18:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604486.51;796277.77;4292
-4294;2001239649;B03000;AMEACA;RUA SAO LAZARO;831;63219;3/5/2001 09:39:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;612468.94;799392.66;4293
-4295;2001239730;B06000;LESAO CORPORAL;RUA SAO FIDELIS;701;48309;3/5/2001 10:31:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615514.94;800550.35;4294
-4296;2001239779;B06000;LESAO CORPORAL;RUA FLOR DO AMEN;283;94910;3/5/2001 11:05:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606038.51;799794.54;4295
-4297;2001239942;B03000;AMEACA;RUA ANHEMBI;168;84396;3/5/2001 12:52:00;CIDADAO COMUM;S;;PIRATININGA;BH;605469.33;809069.82;4296
-4298;2001240172;B03000;AMEACA;AV ARTUR GUIMARA;1010;6151;3/5/2001 15:22:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610759.65;802050.82;4297
-4299;2001240206;B06000;LESAO CORPORAL;RUA GUARARAPES;1544;32241;3/5/2001 15:40:00;CIDADAO COMUM;S;0;NOVO GLORIA;BH;602656.25;798267.93;4298
-4300;2001240309;B06000;LESAO CORPORAL;RUA CELINA DIAS ;67;86307;3/5/2001 16:27:00;CIDADAO COMUM;S;;JAQUELINE;BH;610884.16;810367.55;4299
-4301;2001240424;B03000;AMEACA;RUA JEQUIRICA;157;37258;3/5/2001 17:32:00;CIDADAO COMUM;S;;CONCORDIA;BH;611254.76;799443.34;4300
-4302;2001240584;B03000;AMEACA;RUA GERALDO SILV;121;56588;3/5/2001 18:57:00;CIDADAO COMUM;S;AP02;RIO BRANCO;BH;606686.40;808809.56;4301
-4303;2001240720;B03000;AMEACA;RUA NELSON DE SE;91;47448;3/5/2001 20:04:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606350.59;792901.24;4302
-4304;2001240732;B03000;AMEACA;RUA TREM DE FERR;145;9377;3/5/2001 20:10:00;INICIATIVA;S;0;ITAIPU BH;BH;598907.42;789366.11;4303
-4305;2001240758;B03000;AMEACA;PRACA CARLOS CHA;35;13328;3/5/2001 20:20:00;INICIATIVA;N;0;SANTO AGOSTINHO;BH;610136.92;795881.25;4304
-4306;2001240945;B06000;LESAO CORPORAL;RUA DOS INDEPEND;180;109165;3/5/2001 22:15:00;CIDADAO COMUM;S;;VILA SANTA RITA;BH;601157.29;787604.80;4305
-4307;2001240953;B03000;AMEACA;RUA EGEU;70;18680;3/5/2001 22:18:00;CIDADAO COMUM;S;;MINASLANDIA;BH;611648.78;804462.61;4306
-4308;2001241105;B06000;LESAO CORPORAL;RUA PADRE CAFE;1053;51253;3/5/2001 23:58:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616124.40;797897.91;4307
-4309;2001241108;B06000;LESAO CORPORAL;RUA JOSE NILTON ;248;113144;4/5/2001 00:00:00;CIDADAO COMUM;N;0;TIROL;BH;599992.30;789975.91;4308
-4310;2001241114;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;1820;40770;4/5/2001 00:04:00;INICIATIVA;N;0;VERA CRUZ;BH;616129.07;798179.53;4309
-4311;2001241171;B03000;AMEACA;AV OLINTO MEIREL;1634;49847;4/5/2001 00:57:00;CIDADAO COMUM;N;0;MILIONARIOS;BH;603690.86;789825.51;4310
-4312;2001241221;B06000;LESAO CORPORAL;RUA ANTONIO SIMI;268;118526;4/5/2001 01:51:00;CIDADAO COMUM;S;;REGINA;BH;598714.08;790387.69;4311
-4313;2001241357;B04001;HOMICIDIO TENTAD;PRACA CARDEAL AR;96;13182;4/5/2001 04:39:00;CIDADAO COMUM;N;;NOVA CINTRA;BH;605691.12;793887.54;4312
-4314;2001241449;B03000;AMEACA;AV CARANDAI;897;13081;4/5/2001 07:39:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611934.68;796197.56;4313
-4315;2001241458;B03000;AMEACA;RUA CORONEL CAMI;460;17650;4/5/2001 07:48:00;CIDADAO COMUM;S;0;VILA OESTE;BH;604170.06;795259.34;4314
-4316;2001241522;B03000;AMEACA;RUA ITAPEVA;821;35820;4/5/2001 08:31:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611604.06;799219.61;4315
-4317;2001241538;B06000;LESAO CORPORAL;RUA PRIMEIRO DE ;50;23978;4/5/2001 08:39:00;CIDADAO COMUM;S;CAST07;TAQUARIL;BH;617532.48;797226.06;4316
-4318;2001241586;B03000;AMEACA;RUA HERMILO ALVE;168;33216;4/5/2001 09:08:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;612592.79;797429.00;4317
-4319;2001241733;B04001;HOMICIDIO TENTAD;RUA SEIS;80;86174;4/5/2001 10:48:00;CIDADAO COMUM;S;;JAQUELINE;BH;611389.70;810027.38;4318
-4320;2001241818;B06000;LESAO CORPORAL;RUA VENERO CAETA;76;91459;4/5/2001 11:49:00;CIDADAO COMUM;S;FU;PALMEIRAS;BH;606859.87;791116.66;4319
-4321;2001241823;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;3792;17095;4/5/2001 11:53:00;INICIATIVA;N;0;HORTO;BH;613741.51;798439.29;4320
-4322;2001241856;B02000;RIXA;RUA ITAPEMA;185;35760;4/5/2001 12:17:00;INICIATIVA;N;0;ANCHIETA;BH;612293.88;793797.78;4321
-4323;2001241898;B03000;AMEACA;RUA EDUARDO QUEN;27;25047;4/5/2001 12:50:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;610548.55;805019.11;4322
-4324;2001241908;B04001;HOMICIDIO TENTAD;RUA BENJAMIM JAC;800;9207;4/5/2001 12:57:00;CIDADAO COMUM;N;;GUTIERREZ;BH;609111.97;794709.49;4323
-4325;2001241973;B06000;LESAO CORPORAL;RUA BUENO DO PRA;866;10676;4/5/2001 13:38:00;CIDADAO COMUM;N;;ALTO DOS PINHEIR;BH;604211.61;796222.13;4324
-4326;2001242005;B03000;AMEACA;RUA FURTADO NUNE;25;30160;4/5/2001 13:57:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606302.42;797166.69;4325
-4327;2001242011;B06000;LESAO CORPORAL;RUA RIO DE JANEI;821;58772;4/5/2001 14:06:00;INICIATIVA;N;0;CENTRO BH;BH;611082.48;796907.81;4326
-4328;2001242025;B06000;LESAO CORPORAL;RUA TOME DE SOUZ;935;67998;4/5/2001 14:16:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611457.69;795178.33;4327
-4329;2001242058;B06000;LESAO CORPORAL;RUA JOSE NUNES C;60;119456;4/5/2001 14:39:00;CIDADAO COMUM;N;;VILA MAGNESITA;BH;602578.26;794932.48;4328
-4330;2001242109;B03000;AMEACA;RUA JOSE NILTON ;312;113144;4/5/2001 15:21:00;CIDADAO COMUM;S;;TIROL;BH;599975.29;790055.55;4329
-4331;2001242161;B04001;HOMICIDIO TENTAD;RUA BANDONION;54;170139;4/5/2001 15:44:00;CIDADAO COMUM;S;AP302;VILA CAFEZAL;BH;613977.41;795089.89;4330
-4332;2001242281;B06000;LESAO CORPORAL;RUA PADRE FEIJO;98;51326;4/5/2001 16:56:00;CIDADAO COMUM;N;;SAUDADE;BH;614957.36;797460.62;4331
-4333;2001242449;B06000;LESAO CORPORAL;RUA SUZANA;45;23284;4/5/2001 18:15:00;CIDADAO COMUM;S;SETOR 9;TAQUARIL;BH;617621.30;797027.01;4332
-4334;2001242573;B03000;AMEACA;RUA GASTAO DA CU;44;30712;4/5/2001 19:20:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608652.47;794813.51;4333
-4335;2001242588;B04002;HOMICIDIO CONSUM;RUA LAUDIVINA LU;74;15380;4/5/2001 19:26:00;CIDADAO COMUM;N;;LETICIA;BH;607823.42;809796.60;4334
-4336;2001242654;B03000;AMEACA;RUA PORTO SEGURO;835;60595;4/5/2001 19:57:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615303.96;800806.89;4335
-4337;2001242668;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;4/5/2001 20:04:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;4336
-4338;2001242705;B06000;LESAO CORPORAL;AV PRESIDENTE AN;1240;4461;4/5/2001 20:27:00;POLICIAL MILITAR;S;;SAO CRISTOVAO;BH;610402.72;799177.41;4337
-4339;2001242735;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;256;40770;4/5/2001 20:41:00;CIDADAO COMUM;S;0;POMPEIA;BH;614562.10;797847.38;4338
-4340;2001242798;B06000;LESAO CORPORAL;AV NOSSA SENHORA;1900;47996;4/5/2001 21:17:00;INICIATIVA;S;0;SAO PEDRO;BH;610981.82;793299.68;4339
-4341;2001242860;B06000;LESAO CORPORAL;RUA FIRMINO DUAR;287;89879;4/5/2001 21:55:00;POLICIAL MILITAR;S;0;PALMEIRAS;BH;607127.95;791538.27;4340
-4342;2001242964;B03000;AMEACA;RUA QUARENTA E S;91;302841;4/5/2001 23:00:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614268.33;805792.06;4341
-4343;2001243177;B04001;HOMICIDIO TENTAD;AV NOSSA SENHORA;1900;47996;5/5/2001 00:59:00;INICIATIVA;S;0;SAO PEDRO;BH;610981.82;793299.68;4342
-4344;2001243210;B03000;AMEACA;RUA MONTE ALVERN;579;46385;5/5/2001 01:15:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;607879.30;808121.62;4343
-4345;2001243324;B06000;LESAO CORPORAL;RUA DANIEL DE CA;1679;19630;5/5/2001 02:44:00;CIDADAO COMUM;S;0;NOVA GRANADA;BH;609232.04;794835.81;4344
-4346;2001243372;B04001;HOMICIDIO TENTAD;RUA ANGATURAMA;411;3935;5/5/2001 03:09:00;CIDADAO COMUM;S;;SAO PAULO;BH;612782.45;802779.28;4345
-4347;2001243418;B04002;HOMICIDIO CONSUM;RUA ALIPIO DE ME;667;2378;5/5/2001 03:50:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606333.50;798725.89;4346
-4348;2001243424;B06000;LESAO CORPORAL;RUA ITAMBE;27;35596;5/5/2001 04:00:00;CIDADAO COMUM;N;;FLORESTA;BH;611768.53;797139.48;4347
-4349;2001243440;B03000;AMEACA;RUA DA BAHIA;1196;81155;5/5/2001 04:18:00;CIDADAO COMUM;S;;LOURDES;BH;611215.54;796459.72;4348
-4350;2001243443;B06000;LESAO CORPORAL;AV CIVILIZACAO;1800;51657;5/5/2001 04:21:00;CIDADAO COMUM;S;;VILA SANTA BRANC;BH;608373.95;809140.92;4349
-4351;2001243461;B04001;HOMICIDIO TENTAD;RUA ITAMIRIM;780;35615;5/5/2001 04:35:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615978.04;798604.99;4350
-4352;2001243469;B06000;LESAO CORPORAL;AV SANTOS DUMONT;436;61950;5/5/2001 04:46:00;CIDADAO COMUM;S;PX436;CENTRO (BH);BH;611217.57;797550.79;4351
-4353;2001243484;B06000;LESAO CORPORAL;AV CIVILIZACAO;1500;51657;5/5/2001 05:02:00;INICIATIVA;S;0;VILA SANTA BRANC;BH;608670.39;808930.49;4352
-4354;2001243499;B06000;LESAO CORPORAL;RUA VINTE E UM D;157;72286;5/5/2001 05:31:00;CIDADAO COMUM;S;PX207;CENTRO (BH);BH;610959.73;797725.04;4353
-4355;2001243537;B03000;AMEACA;AV BARAO HOMEM D;3163;7936;5/5/2001 06:25:00;CIDADAO COMUM;S;;ESTORIL;BH;608238.29;793044.57;4354
-4356;2001243742;B04001;HOMICIDIO TENTAD;RUA JOEL DE MATO;106;84660;5/5/2001 09:19:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;607187.82;793819.19;4355
-4357;2001243783;B05000;SEQUESTRO E CARC;RUA OLINTO MAGAL;560;49834;5/5/2001 09:49:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;606154.07;797798.82;4356
-4358;2001243795;B04001;HOMICIDIO TENTAD;RUA TIZIU;566;95881;5/5/2001 09:56:00;CIDADAO COMUM;N;CASA B;GOIANIA;BH;615351.18;802590.79;4357
-4359;2001243925;B03000;AMEACA;RUA FORMIGA;294;29136;5/5/2001 11:24:00;CIDADAO COMUM;S;0;SAO CRISTOVAO;BH;610521.09;798844.04;4358
-4360;2001243928;B03000;AMEACA;RUA GASTAO DA CU;44;30712;5/5/2001 11:26:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;608652.47;794813.51;4359
-4361;2001243955;B06000;LESAO CORPORAL;RUA DES BRAULIO;648;19917;5/5/2001 11:42:00;INICIATIVA;N;0;VERA CRUZ;BH;616109.45;798454.20;4360
-4362;2001244005;B03000;AMEACA;RUA SAIRA;10;48670;5/5/2001 12:09:00;CIDADAO COMUM;S;0;GOIANIA;BH;615390.10;802975.69;4361
-4363;2001244036;B06000;LESAO CORPORAL;RUA CORONEL SEVE;721;18072;5/5/2001 12:36:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604669.06;789748.35;4362
-4364;2001244056;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;360;63782;5/5/2001 12:49:00;INICIATIVA;N;0;MORRO DO PAPAGAI;BH;610920.76;793642.68;4363
-4365;2001244106;B02000;RIXA;RUA FREI VICENTE;247;30029;5/5/2001 13:23:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607277.72;807964.07;4364
-4366;2001244141;B03000;AMEACA;RUA CURITIBA;1832;19090;5/5/2001 13:45:00;INICIATIVA;S;0;LOURDES;BH;610540.51;796105.15;4365
-4367;2001244144;B03000;AMEACA;RUA ITAIPU;767;35439;5/5/2001 13:46:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616248.63;798433.00;4366
-4368;2001244209;B06000;LESAO CORPORAL;RUA ALCIDA TORRE;186;112936;5/5/2001 14:29:00;CIDADAO COMUM;N;0;CH SANTA MARIA;BH;608957.30;793494.58;4367
-4369;2001244210;B03000;AMEACA;RUA PALESTINA;984;51861;5/5/2001 14:31:00;CIDADAO COMUM;S;;COQUEIROS;BH;603317.91;800262.15;4368
-4370;2001244220;B04001;HOMICIDIO TENTAD;RUA CAPIVARI;792;12918;5/5/2001 14:36:00;CIDADAO COMUM;S;;SERRA;BH;613862.34;794772.93;4369
-4371;2001244251;B04001;HOMICIDIO TENTAD;RUA FILOMENA REI;376;107967;5/5/2001 14:57:00;CIDADAO COMUM;N;0;MANTIQUEIRA;BH;606947.09;811786.56;4370
-4372;2001244255;B06000;LESAO CORPORAL;AV BERNARDO MONT;17;9392;5/5/2001 15:00:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;612464.12;797183.95;4371
-4373;2001244274;B06000;LESAO CORPORAL;RUA FLUORINA;605;29091;5/5/2001 15:11:00;CIDADAO COMUM;S;0;POMPEIA;BH;614642.94;797560.93;4372
-4374;2001244288;B03000;AMEACA;RUA ANTENOR PRAT;10;86896;5/5/2001 15:23:00;CIDADAO COMUM;N;;NOVO PAQUETA;BH;605663.03;802024.87;4373
-4375;2001244294;B06000;LESAO CORPORAL;RUA ANTONIO FERR;360;70798;5/5/2001 15:27:00;CIDADAO COMUM;S;;SANTA HELENA (BH;BH;603091.88;790204.68;4374
-4376;2001244431;B06000;LESAO CORPORAL;AV VEREADOR CICE;34;19756;5/5/2001 16:37:00;CIDADAO COMUM;S;CAFU;CORACAO EUCARIST;BH;604819.38;796509.78;4375
-4377;2001244466;B03000;AMEACA;AV DO CONTORNO;11428;17228;5/5/2001 16:56:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;610540.75;797564.41;4376
-4378;2001244481;B03000;AMEACA;RUA WALDEMAR FAL;114;36429;5/5/2001 17:07:00;CIDADAO COMUM;N;;PLANALTO;BH;610860.67;806612.32;4377
-4379;2001244504;B03000;AMEACA;RUA BINARIO;190;301457;5/5/2001 17:19:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614311.76;795528.44;4378
-4380;2001244535;B03000;AMEACA;RUA ASTOLFO DUTR;953;6426;5/5/2001 17:36:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615614.18;798400.93;4379
-4381;2001244546;B03000;AMEACA;RUA PERDIGAO PEQ;110;83006;5/5/2001 17:41:00;CIDADAO COMUM;N;;OURO PRETO;BH;605834.34;802999.45;4380
-4382;2001244568;B03000;AMEACA;RUA JUVENTUDE;345;99274;5/5/2001 17:54:00;CIDADAO COMUM;N;FR1;CEU AZUL;BH;604514.48;808009.59;4381
-4383;2001244594;B03000;AMEACA;RUA JACAREI;363;13154;5/5/2001 18:11:00;CIDADAO COMUM;S;0;COQUEIROS;BH;602568.63;798483.85;4382
-4384;2001244616;B03000;AMEACA;RUA CIPRIANO DE ;278;15856;5/5/2001 18:20:00;CIDADAO COMUM;S;FU;CINQUENTENARIO;BH;606286.24;793387.96;4383
-4385;2001244668;B06000;LESAO CORPORAL;RUA ANTONIO FERR;360;70798;5/5/2001 18:52:00;CIDADAO COMUM;N;;SANTA HELENA (BH;BH;603091.88;790204.68;4384
-4386;2001244713;B06000;LESAO CORPORAL;RUA CORONEL ANTO;757;17590;5/5/2001 19:12:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605502.27;807469.46;4385
-4387;2001244763;B03000;AMEACA;RUA COCAIS;671;16140;5/5/2001 19:36:00;CIDADAO COMUM;S;0;ESPLANADA;BH;615173.47;798832.72;4386
-4388;2001244779;B04001;HOMICIDIO TENTAD;AV CATULO DA PAI;655;59081;5/5/2001 19:45:00;INICIATIVA;S;0;DAS INDUSTRIAS;BH;604432.91;792729.44;4387
-4389;2001244804;B03000;AMEACA;RUA PEDRA DO IND;10;32774;5/5/2001 20:01:00;INICIATIVA;N;0;CANDELARIA;BH;608567.02;808676.74;4388
-4390;2001244827;B06000;LESAO CORPORAL;RUA ICARAI;412;34004;5/5/2001 20:09:00;CIDADAO COMUM;S;0;ALTO DOS CAICARA;BH;607901.24;798457.83;4389
-4391;2001244863;B06000;LESAO CORPORAL;RUA N;50;37780;5/5/2001 20:32:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608946.55;810184.24;4390
-4392;2001244882;B03000;AMEACA;RUA WEAVER;65;25021;5/5/2001 20:41:00;CIDADAO COMUM;S;;DURVAL DE BARROS;IB;598280.05;790991.94;4391
-4393;2001244887;B03000;AMEACA;AV RAJA GABAGLIA;1000;57830;5/5/2001 20:44:00;INICIATIVA;N;0;GUTIERREZ;BH;609199.03;794395.98;4392
-4394;2001244897;B03000;AMEACA;RUA FREI LUIZ DE;175;29961;5/5/2001 20:51:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604838.14;795915.30;4393
-4395;2001244917;B03000;AMEACA;BECO NOSSA SENHO;880;170113;5/5/2001 21:04:00;CIDADAO COMUM;S;0;CAFEZAL;BH;614316.22;794914.87;4394
-4396;2001244922;B03000;AMEACA;RUA TUBARAO;14;69791;5/5/2001 21:04:00;CIDADAO COMUM;S;0;CARDOSO;BH;604249.55;787840.85;4395
-4397;2001244943;B06000;LESAO CORPORAL;RUA FURTADO DE M;353;30145;5/5/2001 21:13:00;CIDADAO COMUM;S;;SANTA ROSA;BH;610023.23;803520.42;4396
-4398;2001244996;B03000;AMEACA;RUA BABEL;682;7460;5/5/2001 21:48:00;CIDADAO COMUM;S;0;SAO SALVADOR;BH;603045.44;799312.42;4397
-4399;2001245008;B03000;AMEACA;AV CRISTIANO MAC;4000;18652;5/5/2001 21:54:00;INICIATIVA;N;0;DOS PALMARES;BH;612434.91;802092.92;4398
-4400;2001245028;B06000;LESAO CORPORAL;RUA AUREO DRUMON;60;117435;5/5/2001 22:06:00;INICIATIVA;N;0;CASA BRANCA;BH;616476.94;799773.65;4399
-4401;2001245043;B06000;LESAO CORPORAL;RUA ANIBAL BENEV;75;4083;5/5/2001 22:15:00;INICIATIVA;N;0;SANTA EFIGENIA;BH;613526.59;796519.01;4400
-4402;2001245059;B04001;HOMICIDIO TENTAD;RUA PASSARELA;97;302328;5/5/2001 22:22:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;606149.87;789752.27;4401
-4403;2001245061;B09000;ABANDONO DE INCA;RUA ARTUR DE SA;1107;6211;5/5/2001 22:20:00;CIDADAO COMUM;S;;UNIAO;BH;612854.19;801930.79;4402
-4404;2001245072;B03000;AMEACA;RUA HIGINO DE OL;221;83630;5/5/2001 22:25:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604607.93;789209.81;4403
-4405;2001245077;B06000;LESAO CORPORAL;RUA ITATINGA;15;36000;5/5/2001 22:29:00;INICIATIVA;N;0;FLORAMAR;BH;611719.65;805792.24;4404
-4406;2001245104;B06000;LESAO CORPORAL;AV SIDERAL;579;65721;5/5/2001 22:49:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604300.41;793606.82;4405
-4407;2001245204;B05000;SEQUESTRO E CARC;RUA CINQUENTA E ;38;33900;5/5/2001 23:32:00;CIDADAO COMUM;N;0;CONJUNTO FELICID;BH;612593.41;806824.84;4406
-4408;2001245208;B06000;LESAO CORPORAL;RUA CURITIBA;1099;19090;5/5/2001 23:35:00;INICIATIVA;N;0;CENTRO (BH);BH;610750.03;796765.47;4407
-4409;2001245264;B06000;LESAO CORPORAL;RUA DOMINGOS FRA;70;103244;6/5/2001 00:09:00;CIDADAO COMUM;S;;OURO PRETO;BH;606342.21;800670.65;4408
-4410;2001245281;B03000;AMEACA;RUA TAMBORIL;930;66793;6/5/2001 00:14:00;CIDADAO COMUM;S;;CONCORDIA;BH;610977.60;799570.66;4409
-4411;2001245295;B06000;LESAO CORPORAL;AV BIAS FORTES;1526;9553;6/5/2001 00:24:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610343.53;796985.22;4410
-4412;2001245318;B03000;AMEACA;AV ABILIO MACHAD;762;634;6/5/2001 00:38:00;CIDADAO COMUM;S;;INCONFIDENCIA;BH;604926.99;798292.43;4411
-4413;2001245337;B03000;AMEACA;BECO SAO CAETANO;100;300716;6/5/2001 00:48:00;CIDADAO COMUM;N;0;PRADO LOPES;BH;609992.00;799125.07;4412
-4414;2001245350;B06000;LESAO CORPORAL;RUA JOSE FELIX M;680;7416;6/5/2001 00:55:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606479.01;810419.90;4413
-4415;2001245369;B03000;AMEACA;RUA RAMIRO ATHAN;35;94790;6/5/2001 01:10:00;CIDADAO COMUM;S;;ENGENHO NOGUEIRA;BH;606229.15;800580.68;4414
-4416;2001245420;B02000;RIXA;AV TERESA CRISTI;175;67512;6/5/2001 01:39:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;609052.83;797141.23;4415
-4417;2001245481;B05000;SEQUESTRO E CARC;AV AMAZONAS;4434;3140;6/5/2001 02:09:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;607491.23;795998.20;4416
-4418;2001245482;B06000;LESAO CORPORAL;RUA RADIALISTA G;80;109442;6/5/2001 02:10:00;CIDADAO COMUM;S;;CEU AZUL;BH;604543.26;808886.65;4417
-4419;2001245488;B03000;AMEACA;RUA EXPEDICIONAR;505;82970;6/5/2001 02:13:00;CIDADAO COMUM;S;;SAO LUIZ;BH;606781.64;803296.30;4418
-4420;2001245531;B06000;LESAO CORPORAL;RUA DOS CAETES;180;11376;6/5/2001 02:43:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611446.97;797386.75;4419
-4421;2001245549;B04002;HOMICIDIO CONSUM;RUA BINARIO;128;301457;6/5/2001 02:59:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614311.76;795528.44;4420
-4422;2001245585;B03000;AMEACA;RUA EMBU;51;81810;6/5/2001 03:23:00;CIDADAO COMUM;S;0;ITAIPU BH;BH;599072.38;789121.58;4421
-4423;2001245602;B04002;HOMICIDIO CONSUM;RUA AMPERE;117;3484;6/5/2001 03:35:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612156.78;803570.63;4422
-4424;2001245671;B02000;RIXA;RUA JANUARIA;65;36936;6/5/2001 04:28:00;CIDADAO COMUM;S;0;FLORESTA;BH;611563.51;797768.28;4423
-4425;2001245681;B06000;LESAO CORPORAL;RUA BIMBARRA;300;9641;6/5/2001 04:39:00;CIDADAO COMUM;S;;CALAFATE;BH;607195.50;796594.64;4424
-4426;2001245711;B06000;LESAO CORPORAL;AV BRIGADEIRO ED;2520;2860;6/5/2001 05:12:00;CIDADAO COMUM;N;0;SAO SALVADOR;BH;603671.98;799787.66;4425
-4427;2001245736;B02000;RIXA;RUA CONTAGEM;1275;70293;6/5/2001 05:37:00;CIDADAO COMUM;N;L;NOVA VISTA;BH;614505.49;800932.51;4426
-4428;2001245742;B06000;LESAO CORPORAL;RUA POTOMAIO;722;54920;6/5/2001 05:44:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615767.01;799159.51;4427
-4429;2001245962;B06000;LESAO CORPORAL;AV AMAZONAS;1684;3140;6/5/2001 10:00:00;INICIATIVA;N;0;BARRO PRETO;BH;610031.46;796551.75;4428
-4430;2001245983;B03000;AMEACA;RUA ITAPOA;260;82218;6/5/2001 10:14:00;CIDADAO COMUM;N;0;GUARANI;BH;612898.19;805462.56;4429
-4431;2001246031;B03000;AMEACA;RUA DOM PEDRITO;42;51300;6/5/2001 10:49:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614692.46;800392.26;4430
-4432;2001246072;B03000;AMEACA;RUA JULITA NUNES;211;130047;6/5/2001 11:22:00;CIDADAO COMUM;N;;MINASCAIXA;BH;609211.34;809819.89;4431
-4433;2001246111;B06000;LESAO CORPORAL;RUA CRUCILANDIA;200;18781;6/5/2001 11:53:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605921.59;807710.06;4432
-4434;2001246133;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;6/5/2001 12:14:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;4433
-4435;2001246138;B03000;AMEACA;RUA CIPRESTE;341;73087;6/5/2001 12:21:00;CIDADAO COMUM;S;CAFU;MARAJO;BH;606844.91;792758.83;4434
-4436;2001246139;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;865;6731;6/5/2001 12:22:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;610544.42;796719.11;4435
-4437;2001246190;B06000;LESAO CORPORAL;AV DOUTOR ALVARO;91;117665;6/5/2001 13:03:00;CIDADAO COMUM;S;APTO 704;SANTA MONICA;BH;608473.61;807215.71;4436
-4438;2001246226;B04001;HOMICIDIO TENTAD;RUA G;5;36721;6/5/2001 13:29:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609150.38;809830.09;4437
-4439;2001246285;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;1843;7936;6/5/2001 14:07:00;CIDADAO COMUM;S;;NOVA GRANADA;BH;608102.37;793516.46;4438
-4440;2001246379;B06000;LESAO CORPORAL;RUA LAGOINHAS;140;40221;6/5/2001 15:26:00;CIDADAO COMUM;S;;JARDIM FLORENCIA;BH;604925.31;810345.40;4439
-4441;2001246395;B04001;HOMICIDIO TENTAD;BECO MARCO ANTON;220;170750;6/5/2001 15:36:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;608957.14;794564.47;4440
-4442;2001246412;B03000;AMEACA;RUA CRECIUMA;90;18549;6/5/2001 15:45:00;CIDADAO COMUM;N;APB;CARDOSO;BH;603433.71;787957.69;4441
-4443;2001246424;B03000;AMEACA;RUA JOAQUIM DE P;165;15349;6/5/2001 15:55:00;CIDADAO COMUM;S;ESCOLA ANTONIA F;SAO JOAO BATISTA;BH;608533.39;808412.51;4442
-4444;2001246447;B03000;AMEACA;BECO PRINCIPAL;240;301983;6/5/2001 16:13:00;CIDADAO COMUM;S;PROX. AO CAMPO;SAO JOSE;BH;605159.47;799250.89;4443
-4445;2001246487;B06000;LESAO CORPORAL;RUA FERNAO DIAS;388;28133;6/5/2001 16:34:00;CIDADAO COMUM;S;;CASA BRANCA;BH;616135.79;799507.45;4444
-4446;2001246555;B06000;LESAO CORPORAL;RUA LAURO SOARES;278;106599;6/5/2001 17:17:00;CIDADAO COMUM;S;;NOVA YORK;BH;608565.48;811276.66;4445
-4447;2001246610;B06000;LESAO CORPORAL;RUA JEQUIRICA;440;37258;6/5/2001 17:49:00;CIDADAO COMUM;S;;CONCORDIA;BH;611201.11;799723.09;4446
-4448;2001246650;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;175;51657;6/5/2001 18:06:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;4447
-4449;2001246669;B03000;AMEACA;RUA SAO GREGORIO;120;62710;6/5/2001 18:14:00;CIDADAO COMUM;N;0;AARAO REIS;BH;612875.24;803517.95;4448
-4450;2001246713;B06000;LESAO CORPORAL;RUA SAO JOAO;70;105426;6/5/2001 18:42:00;CIDADAO COMUM;N;;PAULO SEXTO;BH;616253.42;806196.50;4449
-4451;2001246717;B03000;AMEACA;AV NOSSA SENHORA;2078;47996;6/5/2001 18:42:00;CIDADAO COMUM;N;EM FRENTE RUA PA;SAO PEDRO;BH;610858.87;793078.63;4450
-4452;2001246731;B04001;HOMICIDIO TENTAD;RUA PROFESSOR CA;63;55443;6/5/2001 18:49:00;CIDADAO COMUM;S;;INDUSTRIAL RODRI;BH;615917.11;808278.38;4451
-4453;2001246821;B06000;LESAO CORPORAL;RUA MARILANDIA;71;96525;6/5/2001 19:41:00;CIDADAO COMUM;N;CAA;ANTONIO RIBEIRO ;BH;615507.36;806041.85;4452
-4454;2001246920;B03000;AMEACA;AV CRISTIANO MAC;7505;18652;6/5/2001 20:39:00;CIDADAO COMUM;S;0;VILA SUZANA;BH;611862.37;803269.47;4453
-4455;2001246959;B06000;LESAO CORPORAL;AV PARANA;33;52230;6/5/2001 21:00:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610863.26;797477.33;4454
-4456;2001247166;B03000;AMEACA;RUA CURVELO;50;19150;6/5/2001 23:10:00;CIDADAO COMUM;S;AP102;FLORESTA;BH;612139.97;797829.32;4455
-4457;2001247198;B02000;RIXA;RUA SILVA ALVARE;614;65810;6/5/2001 23:33:00;INICIATIVA;N;0;SAO GERALDO;BH;615391.08;799419.26;4456
-4458;2001247265;B03000;AMEACA;PRACA DIVINA PAS;5;68846;7/5/2001 00:17:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614186.09;804239.54;4457
-4459;2001247283;B06000;LESAO CORPORAL;RUA SILVESTRE FE;510;65992;7/5/2001 00:31:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612773.97;798453.23;4458
-4460;2001247292;B06000;LESAO CORPORAL;RUA CERRO CORA;184;21553;7/5/2001 00:42:00;CIDADAO COMUM;S;;COQUEIROS;BH;602113.72;798098.87;4459
-4461;2001247338;B03000;AMEACA;RUA PEDRA SABAO;389;86509;7/5/2001 01:40:00;CIDADAO COMUM;N;0;PIRATININGA;BH;606405.34;809276.69;4460
-4462;2001247372;B06000;LESAO CORPORAL;RUA MARIETA ALEX;240;51036;7/5/2001 02:17:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609420.35;809489.23;4461
-4463;2001247456;B03000;AMEACA;RUA MARIETA ALEX;210;51036;7/5/2001 04:07:00;CIDADAO COMUM;N;0;MINASCAIXA;BH;609447.04;809466.64;4462
-4464;2001247509;B03000;AMEACA;RUA JOEL JOSE DE;489;68698;7/5/2001 06:42:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605136.14;791090.50;4463
-4465;2001247608;B06000;LESAO CORPORAL;RUA W QUATRO;514;122634;7/5/2001 08:15:00;CIDADAO COMUM;N;0;PONGELUPE;BH;603929.62;787324.64;4464
-4466;2001247906;B04001;HOMICIDIO TENTAD;RUA JOSE FELIX M;1716;7416;7/5/2001 11:22:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606727.06;811723.89;4465
-4467;2001247964;B03000;AMEACA;RUA BARAO DE AIU;271;7835;7/5/2001 11:56:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604506.82;796526.27;4466
-4468;2001247991;B06000;LESAO CORPORAL;RUA GOIAS;151;31393;7/5/2001 12:17:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611426.58;796490.69;4467
-4469;2001248003;B06000;LESAO CORPORAL;RUA CONDE DE VAL;175;16758;7/5/2001 12:26:00;CIDADAO COMUM;N;0;NOVA CACHOEIRINH;BH;609756.08;801316.65;4468
-4470;2001248046;B03000;AMEACA;RUA BARAO DE COR;665;7910;7/5/2001 12:59:00;CIDADAO COMUM;N;0;SAO TOMAZ;BH;610090.94;805370.91;4469
-4471;2001248128;B06000;LESAO CORPORAL;RUA CURITIBA;400;19090;7/5/2001 14:06:00;INICIATIVA;S;0;CENTRO (BH);BH;610902.12;797451.92;4470
-4472;2001248142;B06000;LESAO CORPORAL;RUA FELIPE CAMAR;12;27938;7/5/2001 14:19:00;INICIATIVA;N;0;ESPLANADA;BH;613862.69;798419.73;4471
-4473;2001248286;B06000;LESAO CORPORAL;RUA DOS GUARANIS;169;32181;7/5/2001 15:49:00;INICIATIVA;S;0;CENTRO (BH);BH;610753.12;797462.10;4472
-4474;2001248370;B03000;AMEACA;RUA JOAQUIM ALVE;21;80887;7/5/2001 16:36:00;CIDADAO COMUM;N;;BETANIA;BH;605381.69;792920.20;4473
-4475;2001248490;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;88;17067;7/5/2001 17:39:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609523.31;798729.48;4474
-4476;2001248493;B03000;AMEACA;RUA BELA EMILIA;200;96175;7/5/2001 17:40:00;CIDADAO COMUM;S;;OLARIA;BH;601337.35;789370.00;4475
-4477;2001248512;B03000;AMEACA;RUA CASABLANCA;3;13850;7/5/2001 17:50:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604682.45;802172.96;4476
-4478;2001248543;B04002;HOMICIDIO CONSUM;RUA GUAICURUS;500;32009;7/5/2001 18:03:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611180.98;797650.33;4477
-4479;2001248631;B03000;AMEACA;RUA AMERICANOS;20;3254;7/5/2001 18:51:00;CIDADAO COMUM;S;0;FAZENDINHA;BH;603696.78;790070.38;4478
-4480;2001248736;B06000;LESAO CORPORAL;AV ABILIO MACHAD;3848;634;7/5/2001 19:41:00;CIDADAO COMUM;S;;SERRANO;BH;603259.17;800621.53;4479
-4481;2001248817;B06000;LESAO CORPORAL;RUA BARAO DO MON;960;63653;7/5/2001 20:24:00;CIDADAO COMUM;N;APTO-104;CARDOSO;BH;604059.47;787725.48;4480
-4482;2001248840;B04001;HOMICIDIO TENTAD;RUA RIO NOVO;129;58817;7/5/2001 20:41:00;INICIATIVA;N;0;LAGOINHA;BH;610648.13;798503.93;4481
-4483;2001248918;B03000;AMEACA;RUA CLAUDIO BRAN;340;15960;7/5/2001 21:34:00;CIDADAO COMUM;S;;TUPI;BH;612814.66;806637.99;4482
-4484;2001248981;B03000;AMEACA;AV PORTUGAL;1809;54816;7/5/2001 22:20:00;INICIATIVA;N;0;JARDIM ATLANTICO;BH;606307.50;805239.45;4483
-4485;2001249078;B06000;LESAO CORPORAL;RUA RODRIGUES AL;410;59126;7/5/2001 23:37:00;CIDADAO COMUM;N;AP101;PRADO LOPES;BH;610095.84;798792.47;4484
-4486;2001249185;B06000;LESAO CORPORAL;RUA SAIRA;307;48670;8/5/2001 01:54:00;CIDADAO COMUM;N;;GOIANIA;BH;615401.41;803182.53;4485
-4487;2001249218;B06000;LESAO CORPORAL;AV MONTESE;672;46675;8/5/2001 02:21:00;INICIATIVA;S;0;SANTA BRANCA;BH;608400.48;806406.08;4486
-4488;2001249666;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;253;6731;8/5/2001 10:25:00;INICIATIVA;N;0;CENTRO (BH);BH;611160.79;796551.47;4487
-4489;2001249723;B03000;AMEACA;RUA DO SERMAO;148;64990;8/5/2001 11:01:00;CIDADAO COMUM;S;;SAO JOSE;BH;605777.82;798909.90;4488
-4490;2001249731;B03000;AMEACA;RUA JANAITIBA;888;36889;8/5/2001 11:07:00;CIDADAO COMUM;S;;SAO GERALDO;BH;616130.34;799168.86;4489
-4491;2001249752;B06000;LESAO CORPORAL;RUA DAMASCO;451;19614;8/5/2001 11:19:00;INICIATIVA;S;0;SAO SALVADOR;BH;603250.69;799385.12;4490
-4492;2001249903;B03000;AMEACA;RUA CAMPESTRE;428;12063;8/5/2001 13:03:00;CIDADAO COMUM;S;FU;SAGRADA FAMILIA;BH;612910.03;798086.76;4491
-4493;2001249924;B03000;AMEACA;RUA JAIR LOPES C;48;122101;8/5/2001 13:12:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607851.73;810870.09;4492
-4494;2001249938;B03000;AMEACA;RUA ALEXANDRE LE;35;50162;8/5/2001 13:20:00;CIDADAO COMUM;N;;ESTRELA DALVA;BH;607696.16;792453.23;4493
-4495;2001249952;B03000;AMEACA;RUA NASCIMENTO;580;47261;8/5/2001 13:28:00;CIDADAO COMUM;S;0;FLAVIO MARQUES D;BH;604508.07;788992.97;4494
-4496;2001250073;B03000;AMEACA;RUA DA BAHIA;1148;81155;8/5/2001 14:49:00;INICIATIVA;S;SL1202;LOURDES;BH;611230.12;796512.50;4495
-4497;2001250149;B03000;AMEACA;RUA 51;114;302847;8/5/2001 15:29:00;CIDADAO COMUM;S;FU;NOVO AARAO REIS;BH;614109.28;805610.20;4496
-4498;2001250158;B03000;AMEACA;AV DOM PEDRO II;1900;53145;8/5/2001 15:35:00;CIDADAO COMUM;S;LJ154;CARLOS PRATES;BH;608983.67;798422.37;4497
-4499;2001250327;B06000;LESAO CORPORAL;RUA JANAITIBA;1347;36889;8/5/2001 17:02:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;616608.63;799314.07;4498
-4500;2001250329;B04001;HOMICIDIO TENTAD;RUA JAGUARA;601;36775;8/5/2001 17:03:00;CIDADAO COMUM;S;L;SAUDADE;BH;615359.14;797487.70;4499
-4501;2001250339;B03000;AMEACA;RUA SANTA LUZIA;175;60904;8/5/2001 17:10:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605214.60;793215.43;4500
-4502;2001250587;B06000;LESAO CORPORAL;RUA SEBASTIAO MO;409;93555;8/5/2001 19:18:00;INICIATIVA;S;0;TIROL;BH;600565.02;789378.17;4501
-4503;2001250608;B06000;LESAO CORPORAL;RUA CORONEL ABIL;52;17518;8/5/2001 19:30:00;CIDADAO COMUM;S;0;CAETANO FURQUIM;BH;616348.03;799463.87;4502
-4504;2001250693;B06000;LESAO CORPORAL;RUA ANTONIO DE A;1080;4345;8/5/2001 20:24:00;INICIATIVA;S;0;LOURDES;BH;610929.46;795211.87;4503
-4505;2001250704;B06000;LESAO CORPORAL;RUA CANDIDO SIQU;307;12615;8/5/2001 20:29:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615150.40;800896.13;4504
-4506;2001250799;B05000;SEQUESTRO E CARC;AV PRESIDENTE AN;7823;4461;8/5/2001 21:25:00;CIDADAO COMUM;S;;SAO LUIZ;BH;608734.45;804398.54;4505
-4507;2001250835;B03000;AMEACA;RUA ALCINDO GUAN;31;98707;8/5/2001 21:47:00;CIDADAO COMUM;S;;CAMPO ALEGRE;BH;610349.19;806959.33;4506
-4508;2001250838;B03000;AMEACA;RUA REGENCIA;61;301448;8/5/2001 21:51:00;CIDADAO COMUM;N;CAB;VILA CAFEZAL;BH;614150.86;795438.09;4507
-4509;2001250851;B04002;HOMICIDIO CONSUM;RUA ESPIRITO SAN;946;26052;8/5/2001 21:58:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611138.96;796746.01;4508
-4510;2001250879;B03000;AMEACA;RUA SANTA INES D;44;94227;8/5/2001 22:19:00;CIDADAO COMUM;S;FU;SANTA CECILIA;BH;601180.74;788442.37;4509
-4511;2001250957;B03000;AMEACA;RUA CRUZEIRO DO ;291;75168;8/5/2001 23:08:00;CIDADAO COMUM;S;;COQUEIROS;BH;602379.66;799734.65;4510
-4512;2001250967;B08000;VIOLACAO DE DOMI;RUA MONTE SIAO;231;46559;8/5/2001 23:18:00;CIDADAO COMUM;N;0;SERRA;BH;613107.73;795189.59;4511
-4513;2001250992;B06000;LESAO CORPORAL;RUA GUAICURUS;451;32009;8/5/2001 23:37:00;INICIATIVA;N;0;CENTRO BH;BH;611210.22;797600.57;4512
-4514;2001251009;B03000;AMEACA;RUA DOS UAICAS;360;18970;8/5/2001 23:50:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;606735.24;807473.53;4513
-4515;2001251028;B04001;HOMICIDIO TENTAD;AV ANTONIO FRANC;33;53390;9/5/2001 00:07:00;INICIATIVA;N;0;BANDEIRANTES;BH;604326.94;804327.93;4514
-4516;2001251082;B03000;AMEACA;AV AMAZONAS;6768;3140;9/5/2001 00:39:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605414.68;795606.90;4515
-4517;2001251129;B06000;LESAO CORPORAL;RUA MARTE;400;44929;9/5/2001 01:33:00;CIDADAO COMUM;S;0;VILA SATELITE;BH;610232.40;808735.34;4516
-4518;2001251167;B06000;LESAO CORPORAL;RUA BORDA DA MAT;78;10171;9/5/2001 02:21:00;CIDADAO COMUM;S;;BONFIM;BH;609993.99;798314.38;4517
-4519;2001251309;B06000;LESAO CORPORAL;RUA JOSE CHRISTI;25;106949;9/5/2001 07:19:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605857.11;793405.06;4518
-4520;2001251441;B03000;AMEACA;RUA FREI GASPAR;157;29886;9/5/2001 08:54:00;CIDADAO COMUM;N;;CABANA;BH;604297.25;794201.39;4519
-4521;2001251538;B03000;AMEACA;RUA CAMILO DE BR;636;11896;9/5/2001 10:09:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;4520
-4522;2001251557;B03000;AMEACA;RUA DOUTOR SYLVI;925;123274;9/5/2001 10:17:00;CIDADAO COMUM;N;AP104;CASTELO;BH;604372.86;800845.50;4521
-4523;2001251581;B03000;AMEACA;RUA SANTO ANTONI;35;25986;9/5/2001 10:34:00;CIDADAO COMUM;S;;TAQUARIL;BH;617296.15;797925.88;4522
-4524;2001251679;B03000;AMEACA;RUA ZILDA REVERT;111;110612;9/5/2001 11:28:00;CIDADAO COMUM;N;;JARDIM GUANABARA;BH;611726.73;807911.32;4523
-4525;2001251715;B06000;LESAO CORPORAL;RUA RONDONIA;235;17127;9/5/2001 11:57:00;CIDADAO COMUM;S;0;GLORIA;BH;603466.48;798566.15;4524
-4526;2001251728;B04001;HOMICIDIO TENTAD;PRACA SAO VICENT;10;63902;9/5/2001 12:08:00;POLICIAL MILITAR;N;0;PADRE EUSTAQUIO;BH;605483.12;797829.06;4525
-4527;2001251748;B04001;HOMICIDIO TENTAD;RUA JOSE MAURO D;255;102125;9/5/2001 12:24:00;CIDADAO COMUM;S;;MINEIRAO;BH;601633.89;785370.24;4526
-4528;2001251750;B06000;LESAO CORPORAL;BECO CRAVO;20;301263;9/5/2001 12:27:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610463.43;793275.60;4527
-4529;2001251862;B06000;LESAO CORPORAL;AV AFONSO PENA;590;1259;9/5/2001 13:51:00;INICIATIVA;N;0;CENTRO BH;BH;611078.27;797193.62;4528
-4530;2001251905;B06000;LESAO CORPORAL;RUA PLATINA;1640;54453;9/5/2001 14:22:00;CIDADAO COMUM;N;0;CALAFATE;BH;607780.27;796697.87;4529
-4531;2001251930;B03000;AMEACA;AV GUARAPARI;126;20711;9/5/2001 14:38:00;CIDADAO COMUM;S;;JARDIM ATLANTICO;BH;607081.25;805991.12;4530
-4532;2001252019;B06000;LESAO CORPORAL;RUA QUINTA DA BO;60;99841;9/5/2001 15:33:00;CIDADAO COMUM;S;;VILA SANTA BRANC;BH;605014.26;809772.21;4531
-4533;2001252026;B04001;HOMICIDIO TENTAD;RUA JOAO PIRES;397;37866;9/5/2001 15:38:00;CIDADAO COMUM;S;;CABANA;BH;604773.50;794306.75;4532
-4534;2001252171;B06000;LESAO CORPORAL;RUA JOAO PIRES;1;37866;9/5/2001 16:58:00;CIDADAO COMUM;S;0;JARDINOPOLIS;BH;604514.03;794634.06;4533
-4535;2001252172;B04001;HOMICIDIO TENTAD;RUA ABILIO FERNA;381;95421;9/5/2001 17:02:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616838.69;804321.77;4534
-4536;2001252178;B03000;AMEACA;RUA MIRAI;122;45919;9/5/2001 17:05:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609482.35;798454.10;4535
-4537;2001252223;B03000;AMEACA;RUA BURI;61;10764;9/5/2001 17:29:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610312.98;801362.88;4536
-4538;2001252455;B04001;HOMICIDIO TENTAD;RUA JOAO LUIZ DE;410;37765;9/5/2001 19:30:00;CIDADAO COMUM;S;0;NOVA CACHOEIRINH;BH;609353.56;800937.01;4537
-4539;2001252497;B06000;LESAO CORPORAL;RUA F;198;41280;9/5/2001 19:55:00;CIDADAO COMUM;S;CAFR;CH CONFISCO;BH;602835.56;803046.97;4538
-4540;2001252506;B03000;AMEACA;RUA ILMENITA;237;82117;9/5/2001 19:59:00;CIDADAO COMUM;S;AP206;GLALIJA;BH;603069.39;794320.03;4539
-4541;2001252550;B03000;AMEACA;RUA MINERVA;640;45846;9/5/2001 20:29:00;CIDADAO COMUM;S;AP101;ADELAIDE;BH;607168.91;798964.10;4540
-4542;2001252585;B03000;AMEACA;RUA ARACATI;71;5307;9/5/2001 21:03:00;CIDADAO COMUM;S;AP302;NOVA SUISSA;BH;607257.82;795899.28;4541
-4543;2001252624;B03000;AMEACA;RUA JOAO SOARES ;23;74111;9/5/2001 21:22:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607768.98;811531.53;4542
-4544;2001252725;B03000;AMEACA;RUA SIRIUS;93;88113;9/5/2001 22:16:00;INICIATIVA;S;0;SANTA CRUZ (BARR;BH;603753.99;789251.72;4543
-4545;2001252726;B03000;AMEACA;RUA JOSE FELIX M;1716;7416;9/5/2001 22:16:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606727.06;811723.89;4544
-4546;2001252732;B06000;LESAO CORPORAL;RUA K;35;36599;9/5/2001 22:17:00;CIDADAO COMUM;N;0;MINASCAIXA;BH;609084.97;809987.42;4545
-4547;2001252750;B03000;AMEACA;RUA MODELO;152;46026;9/5/2001 22:34:00;CIDADAO COMUM;N;0;MARIA VIRGINIA;BH;612120.40;802858.31;4546
-4548;2001252842;B06000;LESAO CORPORAL;AV SILVA LOBO;1600;65889;9/5/2001 23:38:00;CIDADAO COMUM;S;;GRAJAU;BH;607981.65;795035.94;4547
-4549;2001252859;B06000;LESAO CORPORAL;AV AFONSO PENA;3357;1259;9/5/2001 23:54:00;CIDADAO COMUM;S;0;CRUZEIRO;BH;612514.75;794823.74;4548
-4550;2001252865;B03000;AMEACA;RUA GUSTAVO DA S;1693;32617;10/5/2001 00:01:00;CIDADAO COMUM;N;;SANTA INES;BH;613754.67;800364.22;4549
-4551;2001252876;B03000;AMEACA;RUA JOAO ERMES;4;116561;10/5/2001 00:09:00;CIDADAO COMUM;S;0;PARAISO;BH;614519.97;796126.23;4550
-4552;2001252886;B03000;AMEACA;RUA TORONTO;70;100350;10/5/2001 00:13:00;CIDADAO COMUM;S;0;TREVO;BH;604033.51;806095.79;4551
-4553;2001252988;B03000;AMEACA;RUA CAMBE;126;40250;10/5/2001 01:52:00;CIDADAO COMUM;S;0;COQUEIROS;BH;602264.49;799116.82;4552
-4554;2001253024;B06000;LESAO CORPORAL;RUA FLOR DAS PED;690;28801;10/5/2001 02:38:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606323.95;799397.43;4553
-4555;2001253106;B03000;AMEACA;RUA JANAUBA;320;36891;10/5/2001 05:00:00;CIDADAO COMUM;N;0;VISTA ALEGRE;BH;604453.47;793310.88;4554
-4556;2001253244;B03000;AMEACA;RUA JACUTINGA;808;36750;10/5/2001 08:18:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605679.99;797701.48;4555
-4557;2001253246;B03000;AMEACA;RUA QUEOPS;131;60021;10/5/2001 08:17:00;CIDADAO COMUM;N;0;VISTA ALEGRE;BH;604351.56;793342.99;4556
-4558;2001253429;B06000;LESAO CORPORAL;RUA DO LAGO;147;40161;10/5/2001 10:38:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614062.40;802766.77;4557
-4559;2001253441;B06000;LESAO CORPORAL;RUA SANTA ALEXAN;1030;60309;10/5/2001 10:50:00;CIDADAO COMUM;S;CS;ARAGUAIA;BH;604760.87;789628.98;4558
-4560;2001253475;B06000;LESAO CORPORAL;RUA CODAJAS;980;77898;10/5/2001 11:20:00;INICIATIVA;S;0;SAO GABRIEL;BH;613552.43;804595.92;4559
-4561;2001253510;B03000;AMEACA;RUA STA HELENA;103;60670;10/5/2001 11:46:00;INICIATIVA;N;0;SERRA;BH;613322.81;794435.59;4560
-4562;2001253541;B03000;AMEACA;RUA CORCOVADO;136;14894;10/5/2001 12:18:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;606973.95;794896.86;4561
-4563;2001253573;B03000;AMEACA;RUA VIOLETA DOS ;146;3989;10/5/2001 12:47:00;CIDADAO COMUM;S;;LINDEIA;BH;599182.03;790934.89;4562
-4564;2001253608;B03000;AMEACA;RUA ENGENHO DO S;1031;80427;10/5/2001 13:14:00;CIDADAO COMUM;S;0;ENGENHO NOGUEIRA;BH;606142.82;800344.91;4563
-4565;2001253831;B03000;AMEACA;AV JOSE BONIFACI;189;38579;10/5/2001 15:50:00;INICIATIVA;S;;PRADO LOPES;BH;610210.56;798939.37;4564
-4566;2001253991;B03000;AMEACA;RUA SANTA FRANCI;179;60655;10/5/2001 17:05:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608755.22;800253.46;4565
-4567;2001254092;B03000;AMEACA;AV ERICO VERISSI;500;41671;10/5/2001 17:50:00;INICIATIVA;N;0;SAO JOAO BATISTA;BH;608155.75;808592.03;4566
-4568;2001254109;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;1492;57830;10/5/2001 17:57:00;INICIATIVA;N;0;CIDADE JARDIM;BH;608850.52;794091.22;4567
-4569;2001254114;B03000;AMEACA;RUA FERNAO DIAS;251;28133;10/5/2001 17:58:00;CIDADAO COMUM;N;0;CASA BRANCA;BH;615998.48;798638.40;4568
-4570;2001254147;B06000;LESAO CORPORAL;RUA CORONEL JOSE;20;17892;10/5/2001 18:14:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610767.91;802211.31;4569
-4571;2001254205;B06000;LESAO CORPORAL;RUA PASSOS;346;52458;10/5/2001 18:42:00;CIDADAO COMUM;S;AP204;CARLOS PRATES;BH;608956.39;798267.55;4570
-4572;2001254256;B03000;AMEACA;RUA ANTONIO SILV;90;87108;10/5/2001 19:07:00;CIDADAO COMUM;S;BLOCO 201;DA LAGOA;BH;604689.68;808944.30;4571
-4573;2001254276;B03000;AMEACA;RUA PORTO;890;60601;10/5/2001 19:13:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;608967.59;801936.11;4572
-4574;2001254344;B03000;AMEACA;RUA ALEXANDRE LE;6;50162;10/5/2001 19:55:00;CIDADAO COMUM;S;;ESTRELA DALVA;BH;607625.18;792478.81;4573
-4575;2001254455;B02000;RIXA;RUA PINTOR ATAID;390;53870;10/5/2001 20:55:00;CIDADAO COMUM;S;;TUPI;BH;613618.30;805975.02;4574
-4576;2001254485;B03000;AMEACA;RUA TUBARAO;56;69791;10/5/2001 21:11:00;CIDADAO COMUM;S;;CARDOSO;BH;604185.10;788056.10;4575
-4577;2001254513;B06000;LESAO CORPORAL;RUA LINCOLN;167;41136;10/5/2001 21:26:00;CIDADAO COMUM;N;0;UNIAO;BH;612532.35;801354.69;4576
-4578;2001254514;B06000;LESAO CORPORAL;RUA LUIZ CASTANH;495;41697;10/5/2001 21:26:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610908.25;802008.16;4577
-4579;2001254518;B04001;HOMICIDIO TENTAD;RUA SAO PEDRO DA;38;102989;10/5/2001 21:31:00;INICIATIVA;S;0;OLHOS DAGUA;BH;608147.07;788329.74;4578
-4580;2001254545;B03000;AMEACA;RUA JOAQUIM DE F;1265;38033;10/5/2001 21:46:00;CIDADAO COMUM;S;0;SANTA HELENA (BH;BH;603033.64;790158.08;4579
-4581;2001254652;B04002;HOMICIDIO CONSUM;RUA SERENATA;467;172351;10/5/2001 23:04:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614363.58;795470.27;4580
-4582;2001254691;B03000;AMEACA;RUA ARTUR DE SA;956;6211;10/5/2001 23:24:00;CIDADAO COMUM;S;0;UNIAO;BH;612941.69;801856.30;4581
-4583;2001254693;B03000;AMEACA;RUA ONOFRE D`OLI;225;84746;10/5/2001 23:26:00;CIDADAO COMUM;N;LJB;DA LAGOA;BH;604554.22;809621.65;4582
-4584;2001254717;B04001;HOMICIDIO TENTAD;AV ELISIO DE BRI;777;25251;10/5/2001 23:43:00;CIDADAO COMUM;N;;BOA VISTA;BH;615141.65;799844.87;4583
-4585;2001254722;B04001;HOMICIDIO TENTAD;RUA STO ANTONIO ;671;61806;10/5/2001 23:46:00;CIDADAO COMUM;S;AP101;SANTO ANTONIO;BH;610832.25;793990.71;4584
-4586;2001254870;B03000;AMEACA;RUA BRUGES;29;86694;11/5/2001 02:02:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;608435.52;810233.73;4585
-4587;2001254908;B06000;LESAO CORPORAL;AV PRUDENTE DE M;569;55774;11/5/2001 02:59:00;CIDADAO COMUM;S;;SANTO ANTONIO;BH;610114.08;794733.79;4586
-4588;2001254923;B06000;LESAO CORPORAL;AV AFONSO PENA;329;1259;11/5/2001 03:25:00;CIDADAO COMUM;S;PX262;CENTRO (BH);BH;610993.53;797462.63;4587
-4589;2001254939;B06000;LESAO CORPORAL;AV GETULIO VARGA;710;81256;11/5/2001 03:43:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611981.03;795397.59;4588
-4590;2001255241;B03000;AMEACA;RUA QUINTINO SIM;85;96903;11/5/2001 09:19:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615085.10;805917.04;4589
-4591;2001255370;B04001;HOMICIDIO TENTAD;RUA POUSO ALEGRE;1333;54932;11/5/2001 10:47:00;INICIATIVA;N;0;FLORESTA;BH;612371.12;797930.27;4590
-4592;2001255480;B03000;AMEACA;AV DO CONTORNO;9384;17228;11/5/2001 11:59:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609125.98;796561.06;4591
-4593;2001255571;B02000;RIXA;RUA BOAVENTURA;1878;9783;11/5/2001 13:08:00;INICIATIVA;N;0;LIBERDADE;BH;609483.47;804149.44;4592
-4594;2001255627;B06000;LESAO CORPORAL;AV DO CONTORNO;12;17228;11/5/2001 13:40:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610893.99;797847.30;4593
-4595;2001255641;B06000;LESAO CORPORAL;PRACA CARLOS CHA;60;13328;11/5/2001 13:48:00;CIDADAO COMUM;S;INICIATIVA POV 5;SANTO AGOSTINHO;BH;610052.84;795756.23;4594
-4596;2001255646;B06000;LESAO CORPORAL;RUA DOM FERRAO;74;22225;11/5/2001 13:51:00;CIDADAO COMUM;S;;SAO JOSE;BH;605189.39;798429.64;4595
-4597;2001255733;B03000;AMEACA;AV FRANCISCO SA;787;29656;11/5/2001 14:58:00;CIDADAO COMUM;S;;PRADO;BH;608927.04;796068.26;4596
-4598;2001255870;B04001;HOMICIDIO TENTAD;RUA CAPELINHA;400;12785;11/5/2001 16:14:00;INICIATIVA;N;0;SERRA;BH;613522.48;794649.03;4597
-4599;2001255937;B06000;LESAO CORPORAL;RUA DOS EXPEDICI;570;26989;11/5/2001 16:44:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;606784.87;805558.89;4598
-4600;2001256002;B03000;AMEACA;AV TERESA CRISTI;2900;67512;11/5/2001 17:23:00;CIDADAO COMUM;S;;CALAFATE;BH;606779.86;796797.64;4599
-4601;2001256059;B06000;LESAO CORPORAL;RUA SAO PAULO;779;63464;11/5/2001 17:49:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610959.32;797010.67;4600
-4602;2001256203;B08000;VIOLACAO DE DOMI;RUA ALBUQUERQUE ;77;10880;11/5/2001 19:06:00;CIDADAO COMUM;N;;CAMPO ALEGRE;BH;610445.17;807211.91;4601
-4603;2001256263;B03000;AMEACA;AV TERESA CRISTI;685;67512;11/5/2001 19:38:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;602258.86;791337.75;4602
-4604;2001256401;B03000;AMEACA;RUA JOAQUIM FRAN;739;38046;11/5/2001 20:46:00;CIDADAO COMUM;S;;IPIRANGA;BH;611821.21;801601.31;4603
-4605;2001256429;B03000;AMEACA;RUA VERISSIMO GU;119;102720;11/5/2001 20:58:00;INICIATIVA;S;0;ITAIPU BH;BH;598941.05;789762.58;4604
-4606;2001256448;B06000;LESAO CORPORAL;RUA PROGRESSO;112;55759;11/5/2001 21:14:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607146.45;796825.23;4605
-4607;2001256494;B06000;LESAO CORPORAL;RUA DAVID RABELO;769;19702;11/5/2001 21:36:00;CIDADAO COMUM;S;CSCSA;INCONFIDENCIA;BH;604970.59;798819.86;4606
-4608;2001256569;B04001;HOMICIDIO TENTAD;RUA CONCEICAO DE;378;16515;11/5/2001 22:30:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605972.65;807322.31;4607
-4609;2001256632;B03000;AMEACA;RUA DAS TABOADAS;55;300190;11/5/2001 23:08:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608788.79;808021.90;4608
-4610;2001256740;B03000;AMEACA;AV DOM JOAO VI;1010;22294;12/5/2001 00:12:00;INICIATIVA;S;0;PALMEIRAS;BH;606644.46;791666.74;4609
-4611;2001256745;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;652;67682;12/5/2001 00:15:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612095.69;796055.44;4610
-4612;2001256755;B06000;LESAO CORPORAL;RUA LINDOLFO DE ;1263;41164;12/5/2001 00:25:00;INICIATIVA;N;0;JARDIM AMERICA;BH;607430.53;794486.80;4611
-4613;2001256780;B04002;HOMICIDIO CONSUM;RUA CARACA;1071;12990;12/5/2001 00:37:00;CIDADAO COMUM;N;AP502;SERRA;BH;613823.56;794597.43;4612
-4614;2001256786;B03000;AMEACA;RUA CONSELHEIRO ;2303;17095;12/5/2001 00:39:00;CIDADAO COMUM;S;CS;SANTA EFIGENIA;BH;613771.63;797289.73;4613
-4615;2001256796;B06000;LESAO CORPORAL;RUA BRAZOPOLIS;121;10521;12/5/2001 00:46:00;CIDADAO COMUM;N;;FLORESTA;BH;612251.86;797133.18;4614
-4616;2001256802;B03000;AMEACA;RUA AGUAS DA PRA;11;13706;12/5/2001 00:50:00;CIDADAO COMUM;S;0;ITAIPU BH;BH;599099.77;789179.92;4615
-4617;2001256838;B06000;LESAO CORPORAL;RUA APORE;200;5099;12/5/2001 01:12:00;INICIATIVA;N;0;PARQUE RIACHUELO;BH;609728.86;800605.94;4616
-4618;2001256881;B06000;LESAO CORPORAL;RUA GUAICURUS;618;32009;12/5/2001 01:40:00;CIDADAO COMUM;S;EN618;CENTRO (BH);BH;611072.00;797681.10;4617
-4619;2001256912;B02000;RIXA;AV ITAITUBA;184;35454;12/5/2001 02:08:00;CIDADAO COMUM;S;0;BOA VISTA;BH;614838.03;799461.10;4618
-4620;2001256996;B06000;LESAO CORPORAL;RUA FREI CRISTOV;149;58278;12/5/2001 03:10:00;CIDADAO COMUM;N;;VILA OESTE;BH;605116.46;795770.62;4619
-4621;2001256998;B06000;LESAO CORPORAL;RUA ANGATURAMA;20;3935;12/5/2001 03:12:00;INICIATIVA;S;0;SAO PAULO;BH;612443.80;802655.56;4620
-4622;2001257019;B04001;HOMICIDIO TENTAD;BECO SANTA CATAR;40;170255;12/5/2001 03:36:00;CIDADAO COMUM;S;;CABANA;BH;604766.78;794259.59;4621
-4623;2001257030;B03000;AMEACA;RUA SAO CRISTOVA;5;25378;12/5/2001 03:46:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617079.81;797404.89;4622
-4624;2001257031;B06000;LESAO CORPORAL;PRACA IRAJA;10;34928;12/5/2001 03:47:00;INICIATIVA;N;0;SAO CRISTOVAO;BH;610536.61;799448.54;4623
-4625;2001257035;B03000;AMEACA;RUA CANTORA MAYS;47;129431;12/5/2001 03:48:00;CIDADAO COMUM;S;0;TUPI;BH;614037.14;806688.21;4624
-4626;2001257078;B06000;LESAO CORPORAL;RUA ISABEL BUENO;1421;35136;12/5/2001 04:21:00;CIDADAO COMUM;S;0;JARAGUA;BH;609989.71;804029.32;4625
-4627;2001257096;B06000;LESAO CORPORAL;RUA ALOIZIO NOGU;45;73005;12/5/2001 04:33:00;CIDADAO COMUM;S;;PLANALTO;BH;609451.75;807323.17;4626
-4628;2001257201;B03000;AMEACA;RUA QUITANDINHA;123;57600;12/5/2001 06:32:00;CIDADAO COMUM;N;;SERRANO;BH;603488.06;800504.16;4627
-4629;2001257238;B06000;LESAO CORPORAL;RUA ARTUR DE SA;1098;6211;12/5/2001 07:18:00;CIDADAO COMUM;S;;UNIAO;BH;613434.92;801356.54;4628
-4630;2001257424;B03000;AMEACA;RUA RIO DAS FLOR;180;92770;12/5/2001 09:56:00;CIDADAO COMUM;S;0;PILAR;BH;607838.63;788171.21;4629
-4631;2001257509;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;9;300224;12/5/2001 11:07:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610432.17;793618.37;4630
-4632;2001257550;B03000;AMEACA;RUA GRAO MOGOL;202;31769;12/5/2001 11:30:00;INICIATIVA;S;0;CARMO;BH;611751.26;794655.75;4631
-4633;2001257562;B06000;LESAO CORPORAL;RUA BURI;51;10764;12/5/2001 11:39:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610328.10;801370.73;4632
-4634;2001257579;B03000;AMEACA;RUA CORONEL JOAQ;1210;87063;12/5/2001 11:51:00;CIDADAO COMUM;S;CA3;CEU AZUL;BH;605036.32;808629.66;4633
-4635;2001257598;B06000;LESAO CORPORAL;RUA CASTIGLIANO;728;14056;12/5/2001 12:00:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607280.97;797470.91;4634
-4636;2001257617;B03000;AMEACA;RUA MESSIAS COUT;200;127580;12/5/2001 12:18:00;INICIATIVA;N;0;CEU AZUL;BH;604895.88;807321.01;4635
-4637;2001257650;B03000;AMEACA;RUA SAO PAULO;834;63464;12/5/2001 12:38:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610919.36;796978.01;4636
-4638;2001257662;B03000;AMEACA;RUA JULIO MESQUI;283;81849;12/5/2001 12:41:00;CIDADAO COMUM;N;0;ITAIPU BH;BH;599468.18;788771.65;4637
-4639;2001257669;B03000;AMEACA;RUA SERRA DA MAN;965;109240;12/5/2001 12:49:00;CIDADAO COMUM;N;AP301;ANTONIO RIBEIRO ;BH;614881.68;807326.00;4638
-4640;2001257680;B06000;LESAO CORPORAL;RUA ALBERT SCHAR;7;1854;12/5/2001 12:57:00;CIDADAO COMUM;S;;MAGNESITA;BH;604047.83;793934.04;4639
-4641;2001257717;B06000;LESAO CORPORAL;AV DOUTOR ALVARO;800;117665;12/5/2001 13:25:00;CIDADAO COMUM;S;0;SANTA BRANCA;BH;608440.88;807202.81;4640
-4642;2001257731;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;990;6353;12/5/2001 13:34:00;INICIATIVA;S;0;FLORESTA;BH;611413.87;797012.89;4641
-4643;2001257750;B06000;LESAO CORPORAL;RUA LEVI FREIRE;250;116546;12/5/2001 13:44:00;CIDADAO COMUM;N;0;PARAISO;BH;614520.44;796034.35;4642
-4644;2001257817;B06000;LESAO CORPORAL;RUA E;153;78718;12/5/2001 14:20:00;CIDADAO COMUM;N;;CH JATOBA IV;BH;600281.70;787829.99;4643
-4645;2001257833;B06000;LESAO CORPORAL;RUA RONDONIA;236;17127;12/5/2001 14:29:00;CIDADAO COMUM;N;CAFR;GLORIA;BH;603443.13;798525.97;4644
-4646;2001257838;B03000;AMEACA;RUA MARIA GERTRU;219;98993;12/5/2001 14:34:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604827.21;808352.50;4645
-4647;2001257858;B03000;AMEACA;AV UM;860;301245;12/5/2001 14:49:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614827.68;805630.99;4646
-4648;2001257878;B03000;AMEACA;RUA PROMISSOES;202;55761;12/5/2001 14:58:00;CIDADAO COMUM;S;0;NOVA ESPERANCA;BH;608818.71;799315.46;4647
-4649;2001257922;B06000;LESAO CORPORAL;RUA RADIALISTA M;15;79562;12/5/2001 15:23:00;CIDADAO COMUM;S;;CEU AZUL;BH;604475.94;808710.04;4648
-4650;2001257973;B03000;AMEACA;AV CRISTIANO MAC;542;18652;12/5/2001 15:43:00;CIDADAO COMUM;S;;DA GRACA;BH;612039.80;798916.59;4649
-4651;2001258015;B03000;AMEACA;RUA CAPITAO NELS;315;72002;12/5/2001 16:04:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609032.48;808918.34;4650
-4652;2001258028;B03000;AMEACA;RUA QUATRO DE MA;5;57118;12/5/2001 16:15:00;INICIATIVA;S;0;LEONINA;BH;608663.34;793662.61;4651
-4653;2001258049;B06000;LESAO CORPORAL;RUA CONCEICAO DA;500;14258;12/5/2001 16:23:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604382.93;802978.96;4652
-4654;2001258098;B06000;LESAO CORPORAL;RUA LUIZ VAZ DE ;61;105089;12/5/2001 16:49:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616937.66;797132.02;4653
-4655;2001258176;B03000;AMEACA;RUA JOAO ALFREDO;55;37447;12/5/2001 17:29:00;CIDADAO COMUM;N;CS;HORTO;BH;613927.89;798257.61;4654
-4656;2001258215;B06000;LESAO CORPORAL;RUA CORONEL PEDR;199;18031;12/5/2001 17:46:00;CIDADAO COMUM;N;0;CIDADE NOVA;BH;612288.62;800421.50;4655
-4657;2001258223;B03000;AMEACA;AV ARI BARROSO;430;5902;12/5/2001 17:51:00;CIDADAO COMUM;S;FU;TUPI;BH;612787.40;806269.41;4656
-4658;2001258271;B06000;LESAO CORPORAL;RUA DOS INDEPEND;121;109165;12/5/2001 18:11:00;CIDADAO COMUM;S;;VILA SANTA RITA;BH;601142.53;787637.02;4657
-4659;2001258273;B03000;AMEACA;RUA DOS AEROVIAR;290;1186;12/5/2001 18:11:00;CIDADAO COMUM;S;0;LIBERDADE;BH;609377.19;803887.06;4658
-4660;2001258286;B03000;AMEACA;RUA SAGRES;101;59889;12/5/2001 18:19:00;CIDADAO COMUM;N;AP301;BARROCA;BH;607891.35;796012.94;4659
-4661;2001258297;B06000;LESAO CORPORAL;RUA ODILIA GONCA;52;49080;12/5/2001 18:33:00;CIDADAO COMUM;N;;PIRAJA;BH;614070.68;803150.89;4660
-4662;2001258304;B03000;AMEACA;RUA JOAQUIM CARD;414;71835;12/5/2001 18:35:00;CIDADAO COMUM;S;;TUPI;BH;613454.61;806454.28;4661
-4663;2001258307;B06000;LESAO CORPORAL;RUA DEZESSEIS;49;32821;12/5/2001 18:36:00;CIDADAO COMUM;S;SUPERMERCADO VEM;CONJUNTO FELICID;BH;612162.50;807188.97;4662
-4664;2001258333;B06000;LESAO CORPORAL;RUA L;117;78787;12/5/2001 18:51:00;CIDADAO COMUM;S;;CH JATOBA IV;BH;600594.32;787827.80;4663
-4665;2001258352;B06000;LESAO CORPORAL;RUA SENHOR DOS P;175;64817;12/5/2001 18:58:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609781.32;802567.71;4664
-4666;2001258372;B06000;LESAO CORPORAL;AV AFONSO PENA;1901;1259;12/5/2001 19:07:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611800.51;796073.43;4665
-4667;2001258405;B03000;AMEACA;RUA ELIZABETH;194;80200;12/5/2001 19:18:00;CIDADAO COMUM;S;;COQUEIROS;BH;602038.28;798951.11;4666
-4668;2001258412;B04001;HOMICIDIO TENTAD;RUA OTAVIANO FAB;110;63307;12/5/2001 19:23:00;CIDADAO COMUM;S;CSFR;APARECIDA SETIMA;BH;608857.09;801112.17;4667
-4669;2001258432;B03000;AMEACA;AV PRESIDENTE AN;852;4461;12/5/2001 19:30:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610473.85;798803.90;4668
-4670;2001258474;B03000;AMEACA;RUA MUQUICABA;210;65343;12/5/2001 19:50:00;CIDADAO COMUM;0;;COQUEIROS;BH;602234.45;798202.08;4669
-4671;2001258510;B03000;AMEACA;RUA JOAQUIM ASSI;26;92679;12/5/2001 20:11:00;CIDADAO COMUM;S;;CALIFORNIA;BH;603354.37;796982.95;4670
-4672;2001258518;B03000;AMEACA;RUA AUGUSTO MEIE;95;6757;12/5/2001 20:14:00;CIDADAO COMUM;S;CAA;TUPI;BH;613750.20;805945.30;4671
-4673;2001258559;B04002;HOMICIDIO CONSUM;RUA MONSENHOR PA;3;46329;12/5/2001 20:34:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;604730.86;793414.75;4672
-4674;2001258618;B06000;LESAO CORPORAL;RUA JOSE MARIA B;425;38380;12/5/2001 21:07:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;607704.21;807669.09;4673
-4675;2001258644;B03000;AMEACA;RUA ALBERT SCHAR;84;1854;12/5/2001 21:16:00;CIDADAO COMUM;N;0;MAGNESITA;BH;603931.13;793864.90;4674
-4676;2001258665;B04001;HOMICIDIO TENTAD;RUA APORE;193;5099;12/5/2001 21:25:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;609739.93;800581.13;4675
-4677;2001258690;B03000;AMEACA;AV PRESIDENTE CA;3001;55125;12/5/2001 21:37:00;INICIATIVA;S;INICIATIVA VP780;CAICARA;BH;608178.06;800324.32;4676
-4678;2001258700;B03000;AMEACA;RUA NOVA PONTE;308;48466;12/5/2001 21:46:00;INICIATIVA;S;102;SALGADO FILHO;BH;606459.09;794174.01;4677
-4679;2001258701;B06000;LESAO CORPORAL;RUA PEREIRA PASS;287;53375;12/5/2001 21:46:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610162.72;798759.81;4678
-4680;2001258710;B06000;LESAO CORPORAL;RUA CONCEICAO DE;488;16515;12/5/2001 21:47:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605827.11;807322.29;4679
-4681;2001258721;B06000;LESAO CORPORAL;RUA EXPEDITO FLA;557;84847;12/5/2001 21:57:00;CIDADAO COMUM;S;;DA LAGOA;BH;604351.06;809302.59;4680
-4682;2001258729;B06000;LESAO CORPORAL;RUA PERNAMBUCO;1299;53463;12/5/2001 22:02:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611431.27;794981.10;4681
-4683;2001258731;B03000;AMEACA;RUA SAO JERONIMO;1271;79102;12/5/2001 22:03:00;CIDADAO COMUM;N;0;INSTITUTO AGRONO;BH;613760.56;799445.72;4682
-4684;2001258748;B03000;AMEACA;AV PRESIDENTE CA;3001;55125;12/5/2001 22:14:00;INICIATIVA;S;0;CAICARA;BH;608178.06;800324.32;4683
-4685;2001258751;B03000;AMEACA;RUA CASTELO DO P;167;47930;12/5/2001 22:14:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613593.07;804563.66;4684
-4686;2001258784;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;12/5/2001 22:32:00;CIDADAO COMUM;S;0;VENDA NOVA;BH;609671.68;808130.71;4685
-4687;2001258791;B06000;LESAO CORPORAL;RUA DA BAHIA;2115;81155;12/5/2001 22:39:00;CIDADAO COMUM;S;0;LOURDES;BH;611025.25;795571.99;4686
-4688;2001258840;B03000;AMEACA;RUA CASSITERITA;292;5612;12/5/2001 23:07:00;CIDADAO COMUM;S;FU;SANTA INES;BH;614227.45;800375.00;4687
-4689;2001258888;B05000;SEQUESTRO E CARC;AV PRESIDENTE AN;4013;4461;12/5/2001 23:28:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609536.57;802154.10;4688
-4690;2001258889;B06000;LESAO CORPORAL;RUA JOSE BARTOLO;80;38525;12/5/2001 23:31:00;CIDADAO COMUM;S;;CONJUNTO ALIPIO ;BH;603707.54;799638.81;4689
-4691;2001258894;B03000;AMEACA;RUA MARIA MARTIN;1594;44248;12/5/2001 23:33:00;CIDADAO COMUM;S;AP102;SAGRADA FAMILIA;BH;613282.33;799066.17;4690
-4692;2001258932;B06000;LESAO CORPORAL;AV DOUTOR ALVARO;850;117665;13/5/2001 00:04:00;INICIATIVA;N;0;SANTA MONICA;BH;608763.01;807333.73;4691
-4693;2001258938;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;1051;7936;13/5/2001 00:09:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607839.34;794525.74;4692
-4694;2001259004;B04001;HOMICIDIO TENTAD;RUA VINTE E UM;112;122095;13/5/2001 00:56:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607804.35;811033.87;4693
-4695;2001259034;B06000;LESAO CORPORAL;AV SANTOS DUMONT;680;61950;13/5/2001 01:18:00;INICIATIVA;S;0;CENTRO BH;BH;610999.13;797614.04;4694
-4696;2001259042;B08000;VIOLACAO DE DOMI;RUA DIAMANTINA;983;21162;13/5/2001 01:23:00;CIDADAO COMUM;N;;LAGOINHA;BH;610536.33;798826.01;4695
-4697;2001259058;B06000;LESAO CORPORAL;RUA FORMIGA;50;29136;13/5/2001 01:29:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610336.11;798756.88;4696
-4698;2001259073;B06000;LESAO CORPORAL;RUA DOS CARIJOS;412;81243;13/5/2001 01:38:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611080.93;797191.84;4697
-4699;2001259088;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;13/5/2001 01:49:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;4698
-4700;2001259091;B06000;LESAO CORPORAL;RUA DIRAMIR LOUR;384;70530;13/5/2001 01:50:00;CIDADAO COMUM;N;AN      CA2;TIROL;BH;600155.33;789384.39;4699
-4701;2001259106;B04001;HOMICIDIO TENTAD;RUA RAMIRO SIQUE;325;128858;13/5/2001 02:02:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617477.62;797374.15;4700
-4702;2001259137;B06000;LESAO CORPORAL;RUA PROGRESSO;1375;55759;13/5/2001 02:21:00;CIDADAO COMUM;S;0;MONSENHOR MESSIA;BH;607167.73;798091.18;4701
-4703;2001259187;B06000;LESAO CORPORAL;RUA SAO BORJA;568;61620;13/5/2001 02:57:00;CIDADAO COMUM;N;;BOA VISTA;BH;615135.57;800346.41;4702
-4704;2001259312;B06000;LESAO CORPORAL;RUA FERNANDES TO;245;81271;13/5/2001 04:27:00;CIDADAO COMUM;S;FR250;FUNCIONARIOS;BH;611285.26;794930.19;4703
-4705;2001259339;B04002;HOMICIDIO CONSUM;RUA CURITIBA;32;19090;13/5/2001 04:57:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610999.16;797826.98;4704
-4706;2001259357;B06000;LESAO CORPORAL;AV OLINTO MEIREL;2507;49847;13/5/2001 05:24:00;INICIATIVA;N;0;ARAGUAIA;BH;603968.63;788996.75;4705
-4707;2001259390;B06000;LESAO CORPORAL;RUA MAJOR WALTER;129;72390;13/5/2001 06:31:00;CIDADAO COMUM;N;CASA 03;PLANALTO;BH;609728.93;807677.63;4706
-4708;2001259396;B04001;HOMICIDIO TENTAD;RUA ARAPARI;43;5410;13/5/2001 06:38:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615934.87;799624.71;4707
-4709;2001259453;B04001;HOMICIDIO TENTAD;AV DOM PEDRO I;175;48337;13/5/2001 08:02:00;CIDADAO COMUM;N;0;JARDIM ATLANTICO;BH;608131.43;805671.13;4708
-4710;2001259543;B03000;AMEACA;RUA GUARAIBA;198;96291;13/5/2001 09:15:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614587.96;804585.04;4709
-4711;2001259612;B06000;LESAO CORPORAL;RUA CAVAQUINHO;15;301465;13/5/2001 10:20:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614161.77;795395.78;4710
-4712;2001259659;B03000;AMEACA;AV AMAZONAS;5681;3140;13/5/2001 11:02:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606524.08;795878.14;4711
-4713;2001259679;B03000;AMEACA;RUA ANTONIO MARZ;386;94520;13/5/2001 11:27:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606238.36;800769.75;4712
-4714;2001259693;B06000;LESAO CORPORAL;RUA PORTO ALEGRE;590;44061;13/5/2001 11:46:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;608751.81;797637.69;4713
-4715;2001259698;B03000;AMEACA;RUA CONSELHEIRO ;51;17095;13/5/2001 11:50:00;CIDADAO COMUM;N;;CENTRO (BH);BH;612543.94;797025.95;4714
-4716;2001259729;B06000;LESAO CORPORAL;RUA QUARENTA E U;83;302837;13/5/2001 12:15:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614183.34;805806.43;4715
-4717;2001259756;B03000;AMEACA;RUA ESTANCIA;20;51597;13/5/2001 12:39:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615503.60;800840.93;4716
-4718;2001259768;B03000;AMEACA;AV ARTUR BERNARD;132;60844;13/5/2001 12:53:00;CIDADAO COMUM;S;0;VILA PARIS;BH;610081.34;793505.68;4717
-4719;2001259775;B03000;AMEACA;RUA ARMANDO ZILL;22;9235;13/5/2001 12:59:00;CIDADAO COMUM;N;0;PLANALTO;BH;609811.97;807080.31;4718
-4720;2001259843;B06000;LESAO CORPORAL;RUA PALMIRA;642;51950;13/5/2001 13:57:00;INICIATIVA;S;0;SERRA;BH;613125.73;794915.16;4719
-4721;2001259867;B08000;VIOLACAO DE DOMI;RUA DES DRUMOND;72;19958;13/5/2001 14:16:00;INICIATIVA;N;0;SERRA;BH;612661.90;795485.42;4720
-4722;2001259953;B06000;LESAO CORPORAL;RUA ESTRELA DALV;107;97080;13/5/2001 15:12:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614946.94;806014.91;4721
-4723;2001260002;B03000;AMEACA;RUA JOSE DE LIMA;516;38897;13/5/2001 15:43:00;CIDADAO COMUM;S;;FLORAMAR;BH;612310.27;805965.70;4722
-4724;2001260033;B03000;AMEACA;RUA ARMINDA MORE;61;5997;13/5/2001 15:58:00;CIDADAO COMUM;S;CAA;NOVA BARROCA;BH;607411.92;792906.03;4723
-4725;2001260048;B06000;LESAO CORPORAL;RUA ARACI;556;5335;13/5/2001 16:04:00;CIDADAO COMUM;N;;PINDORAMA;BH;602554.36;797419.36;4724
-4726;2001260112;B06000;LESAO CORPORAL;RUA MARIANA OLIV;178;94573;13/5/2001 16:42:00;CIDADAO COMUM;S;;OURO PRETO;BH;606307.92;800693.24;4725
-4727;2001260121;B03000;AMEACA;AV WASHINGTON LU;1571;73701;13/5/2001 16:45:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;610155.55;805082.41;4726
-4728;2001260133;B03000;AMEACA;RUA HELIO GILBER;132;55991;13/5/2001 16:51:00;CIDADAO COMUM;S;;FLORAMAR;BH;611809.55;806797.10;4727
-4729;2001260148;B06000;LESAO CORPORAL;RUA MARQUESA DE ;55;44830;13/5/2001 17:00:00;CIDADAO COMUM;N;;JARDIM ROMA;BH;612053.62;805151.76;4728
-4730;2001260169;B06000;LESAO CORPORAL;RUA ANTONIO PEIX;120;12379;13/5/2001 17:10:00;INICIATIVA;S;0;ADELAIDE;BH;607417.84;798044.53;4729
-4731;2001260177;B04001;HOMICIDIO TENTAD;RUA DAS PETUNIAS;1449;11870;13/5/2001 17:15:00;INICIATIVA;S;0;LINDEIA;BH;598916.78;790521.90;4730
-4732;2001260221;B04002;HOMICIDIO CONSUM;RUA MUNICIPAL;180;171677;13/5/2001 17:44:00;CIDADAO COMUM;N;;VILA CEMIG;BH;605640.33;788590.82;4731
-4733;2001260257;B03000;AMEACA;RUA JOAQUIM HENR;145;94371;13/5/2001 18:04:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606357.63;801486.70;4732
-4734;2001260321;B03000;AMEACA;RUA ADELIA CARME;250;1031;13/5/2001 18:40:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599636.37;789371.37;4733
-4735;2001260324;B03000;AMEACA;RUA DOUTOR ALBER;149;23114;13/5/2001 18:43:00;CIDADAO COMUM;S;0;HELIOPOLIS;BH;610892.27;805316.02;4734
-4736;2001260366;B03000;AMEACA;RUA PAULO GONCAL;113;96538;13/5/2001 19:06:00;CIDADAO COMUM;N;0;SERRA VERDE;BH;608906.50;810218.95;4735
-4737;2001260376;B06000;LESAO CORPORAL;RUA DONA LALA FE;518;18712;13/5/2001 19:12:00;CIDADAO COMUM;S;CAFR;MILIONARIOS;BH;604501.36;790651.11;4736
-4738;2001260405;B06000;LESAO CORPORAL;RUA NARCISIO TEI;327;99072;13/5/2001 19:27:00;CIDADAO COMUM;N;;CEU AZUL;BH;605477.17;808266.38;4737
-4739;2001260431;B03000;AMEACA;RUA OSCAR NEGRAO;190;17776;13/5/2001 19:40:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605051.19;794788.68;4738
-4740;2001260457;B03000;AMEACA;RUA MAJOR DELFIN;1900;42620;13/5/2001 19:53:00;CIDADAO COMUM;S;L;SAO FRANCISCO;BH;609452.74;801950.14;4739
-4741;2001260466;B03000;AMEACA;RUA LOURIVAL CAR;300;72318;13/5/2001 19:58:00;CIDADAO COMUM;S;0;PLANALTO;BH;610813.53;806285.84;4740
-4742;2001260469;B06000;LESAO CORPORAL;RUA MARIA CANDID;169;114957;13/5/2001 20:00:00;CIDADAO COMUM;S;AP101;PAQUETA;BH;605538.04;802484.02;4741
-4743;2001260507;B03000;AMEACA;RUA F;98;302327;13/5/2001 20:23:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;606197.92;789828.69;4742
-4744;2001260519;B06000;LESAO CORPORAL;RUA REDENTOR;26;58177;13/5/2001 20:29:00;POLICIAL MILITAR;S;0;SAO JOSE;BH;605803.83;798763.19;4743
-4745;2001260531;B06000;LESAO CORPORAL;RUA ANIL;135;4130;13/5/2001 20:37:00;CIDADAO COMUM;S;CA03;COQUEIROS;BH;603022.64;799841.35;4744
-4746;2001260545;B09000;ABANDONO DE INCA;RUA PAPOULA;36;31844;13/5/2001 20:45:00;CIDADAO COMUM;S;LJA;REGINA;BH;598758.69;790411.48;4745
-4747;2001260558;B03000;AMEACA;RUA POTOMAIO;748;54920;13/5/2001 20:53:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615802.83;799168.91;4746
-4748;2001260574;B04001;HOMICIDIO TENTAD;RUA CINCO;354;81647;13/5/2001 21:03:00;CIDADAO COMUM;N;;OLHOS DAGUA;BH;605646.00;790609.97;4747
-4749;2001260592;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;300;170504;13/5/2001 21:13:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608596.19;793933.42;4748
-4750;2001260602;B03000;AMEACA;RUA VINTE E SEIS;355;72780;13/5/2001 21:17:00;CIDADAO COMUM;N;;LEONINA;BH;608535.90;793292.69;4749
-4751;2001260613;B03000;AMEACA;RUA WALTER IANNI;163;82186;13/5/2001 21:22:00;INICIATIVA;S;0;SAO GABRIEL;BH;613063.80;804020.31;4750
-4752;2001260619;B03000;AMEACA;RUA LUIZ LOPES;233;94431;13/5/2001 21:26:00;CIDADAO COMUM;S;;OURO PRETO;BH;606306.33;801223.55;4751
-4753;2001260637;B03000;AMEACA;RUA MIRAMAR;11;96929;13/5/2001 21:36:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;614767.26;805814.49;4752
-4754;2001260657;B06000;LESAO CORPORAL;RUA AFONSO DE CA;94;1246;13/5/2001 21:48:00;CIDADAO COMUM;S;;UNIVERSITARIO;BH;610387.82;802693.09;4753
-4755;2001260665;B03000;AMEACA;RUA ITAJOBI;21;35482;13/5/2001 21:50:00;CIDADAO COMUM;S;;POMPEIA;BH;614481.76;797983.31;4754
-4756;2001260704;B06000;LESAO CORPORAL;RUA MOACYR JOSE ;200;91068;13/5/2001 22:19:00;INICIATIVA;N;0;BURITIS;BH;607346.74;791431.83;4755
-4757;2001260710;B03000;AMEACA;RUA GUARARAPES;1860;32241;13/5/2001 22:21:00;CIDADAO COMUM;S;;GLORIA;BH;602480.24;798079.29;4756
-4758;2001260719;B06000;LESAO CORPORAL;RUA AVELINO GIAR;218;99350;13/5/2001 22:27:00;INICIATIVA;N;0;CEU AZUL;BH;604476.31;807597.49;4757
-4759;2001260722;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;2985;57830;13/5/2001 22:28:00;INICIATIVA;N;0;ESTORIL;BH;609208.29;792438.19;4758
-4760;2001260781;B03000;AMEACA;RUA ANTARES;25;4244;13/5/2001 23:06:00;CIDADAO COMUM;S;0;SANTA LUCIA;BH;610164.63;793156.54;4759
-4761;2001260805;B02000;RIXA;RUA JOAQUIM DE F;1690;38033;13/5/2001 23:21:00;CIDADAO COMUM;N;;SANTA HELENA (BH;BH;603165.47;789641.23;4760
-4762;2001260847;B04001;HOMICIDIO TENTAD;RUA TAQUARACU;41;42167;13/5/2001 23:55:00;CIDADAO COMUM;S;0;CH CELSO MACHADO;BH;603814.57;800865.65;4761
-4763;2001260848;B03000;AMEACA;RUA DOM PEDRITO;138;51300;13/5/2001 23:56:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614713.80;800489.83;4762
-4764;2001260908;B03000;AMEACA;RUA MARQUES DE B;312;44730;14/5/2001 00:45:00;CIDADAO COMUM;S;0;SAUDADE;BH;615167.15;797589.14;4763
-4765;2001260921;B03000;AMEACA;RUA DIAS DE FARI;95;21250;14/5/2001 00:56:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613724.89;798608.18;4764
-4766;2001260923;B06000;LESAO CORPORAL;RUA CINCO DE JUL;110;15670;14/5/2001 00:57:00;CIDADAO COMUM;N;0;PRIMEIRO DE MAIO;BH;612393.58;803875.40;4765
-4767;2001260948;B03000;AMEACA;RUA VEREADOR ORL;201;71573;14/5/2001 01:22:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;603759.63;792842.36;4766
-4768;2001261104;B06000;LESAO CORPORAL;RUA OSORIO DA RO;69;125153;14/5/2001 06:12:00;CIDADAO COMUM;N;SUPERMERCADO CAR;MINEIRAO;BH;602016.31;785808.46;4767
-4769;2001261120;B03000;AMEACA;RUA CANA DA INDI;394;94848;14/5/2001 06:37:00;CIDADAO COMUM;N;;LINDEIA;BH;599823.12;790690.41;4768
-4770;2001261277;B03000;AMEACA;AV DO CONTORNO;677;17228;14/5/2001 08:48:00;CIDADAO COMUM;S;11 ANDAR;CENTRO (BH);BH;611305.43;797755.06;4769
-4771;2001261402;B06000;LESAO CORPORAL;RUA CANDIDA MARI;342;108830;14/5/2001 10:04:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;605976.13;811733.65;4770
-4772;2001261442;B03000;AMEACA;RUA PADRE ANTONI;230;82347;14/5/2001 10:31:00;CIDADAO COMUM;S;CAA;SAO BERNARDO;BH;611345.47;805007.03;4771
-4773;2001261507;B03000;AMEACA;RUA CINQUENTA A;77;302846;14/5/2001 11:13:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614230.31;805549.12;4772
-4774;2001261516;B03000;AMEACA;RUA JORNALISTA J;173;38336;14/5/2001 11:19:00;INICIATIVA;S;APTO 202;CRUZEIRO;BH;612754.67;794039.36;4773
-4775;2001261526;B03000;AMEACA;RUA MENDES DE OL;1084;45430;14/5/2001 11:23:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609718.74;799470.77;4774
-4776;2001261577;B03000;AMEACA;RUA MARIA MARTIN;1594;44248;14/5/2001 12:02:00;CIDADAO COMUM;S;AP 102;SAGRADA FAMILIA;BH;613282.33;799066.17;4775
-4777;2001261580;B03000;AMEACA;RUA JACAREI;123;36586;14/5/2001 12:04:00;CIDADAO COMUM;S;0;PIRATININGA;BH;606579.01;809587.17;4776
-4778;2001261628;B04002;HOMICIDIO CONSUM;RUA QUATRO DE JU;40;170910;14/5/2001 12:28:00;CIDADAO COMUM;S;;LEONINA;BH;608611.71;793487.56;4777
-4779;2001261639;B03000;AMEACA;RUA FALCAO;705;27749;14/5/2001 12:42:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;605316.73;788384.43;4778
-4780;2001261644;B04002;HOMICIDIO CONSUM;AV COLETORA;5;78241;14/5/2001 12:44:00;CIDADAO COMUM;N;0;VILA PINHO;BH;601752.97;788537.18;4779
-4781;2001261668;B03000;AMEACA;RUA OSCAR LOBO P;20;104480;14/5/2001 13:06:00;INICIATIVA;N;0;PRIMEIRO DE MAIO;BH;612345.92;803542.19;4780
-4782;2001261679;B08000;VIOLACAO DE DOMI;AV FRANCISCO SA;1007;29656;14/5/2001 13:10:00;INICIATIVA;N;0;GUTIERREZ;BH;608964.99;795860.37;4781
-4783;2001261715;B03000;AMEACA;RUA MAR DE ESPAN;770;43318;14/5/2001 13:43:00;CIDADAO COMUM;S;0;SANTO ANTONIO;BH;610593.29;794090.63;4782
-4784;2001261738;B06000;LESAO CORPORAL;RUA ALVARENGA PE;1366;2683;14/5/2001 14:02:00;CIDADAO COMUM;S;;SANTO AGOSTINHO;BH;609629.53;796137.77;4783
-4785;2001261807;B03000;AMEACA;RUA BENJAMIM JAC;274;9207;14/5/2001 14:56:00;CIDADAO COMUM;S;;GUTIERREZ;BH;608759.50;794812.82;4784
-4786;2001261861;B03000;AMEACA;RUA TRINTA E OIT;21;34681;14/5/2001 15:38:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612484.12;807437.95;4785
-4787;2001261880;B08000;VIOLACAO DE DOMI;RUA ESPIRITO SAN;54;26052;14/5/2001 15:48:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611361.32;797556.04;4786
-4788;2001261973;B04001;HOMICIDIO TENTAD;RUA JOAO CANDIDO;113;93240;14/5/2001 16:43:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;601016.84;786016.92;4787
-4789;2001262021;B03000;AMEACA;RUA MUNIZ;149;170850;14/5/2001 17:11:00;INICIATIVA;S;INICIATIVA;MORRO DAS PEDRAS;BH;608113.39;793880.88;4788
-4790;2001262118;B06000;LESAO CORPORAL;RUA DOS AIMORES;2896;1640;14/5/2001 18:01:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;609843.89;796509.28;4789
-4791;2001262131;B06000;LESAO CORPORAL;RUA MIRAMAR;11;96929;14/5/2001 18:06:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614767.26;805814.49;4790
-4792;2001262200;B06000;LESAO CORPORAL;RUA DOZE;105;74178;14/5/2001 18:53:00;CIDADAO COMUM;S;;NOVA YORK;BH;608520.95;810739.19;4791
-4793;2001262257;B03000;AMEACA;RUA DA BALANCA;9;7605;14/5/2001 19:17:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615261.54;806909.29;4792
-4794;2001262280;B06000;LESAO CORPORAL;RUA DO ACRE;114;877;14/5/2001 19:40:00;INICIATIVA;S;0;CENTRO (BH);BH;610717.96;797611.34;4793
-4795;2001262341;B04001;HOMICIDIO TENTAD;RUA MAE D'AGUA;42;82489;14/5/2001 20:08:00;CIDADAO COMUM;S;CS;SAO GABRIEL;BH;613698.17;805073.78;4794
-4796;2001262410;B04001;HOMICIDIO TENTAD;RUA MARIA FRANCI;40;121906;14/5/2001 21:02:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;602238.64;786114.07;4795
-4797;2001262425;B06000;LESAO CORPORAL;RUA E 1;10;28073;14/5/2001 21:08:00;CIDADAO COMUM;N;0;CAPITAO EDUARDO;BH;618588.44;806798.16;4796
-4798;2001262426;B06000;LESAO CORPORAL;RUA BARAO DE MAU;282;7992;14/5/2001 21:11:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603487.33;802924.92;4797
-4799;2001262449;B03000;AMEACA;BECO SAO SEBASTI;34;93470;14/5/2001 21:30:00;CIDADAO COMUM;S;;DOZE DE OUTUBRO;BH;606183.04;790631.55;4798
-4800;2001262485;B06000;LESAO CORPORAL;RUA MARIA BEATRI;301;43881;14/5/2001 21:58:00;CIDADAO COMUM;N;FR301;HAVAI;BH;606834.07;793558.59;4799
-4801;2001262487;B03000;AMEACA;RUA JAVARI;964;37204;14/5/2001 22:01:00;INICIATIVA;S;0;RENASCENCA;BH;610741.99;800276.63;4800
-4802;2001262505;B03000;AMEACA;RUA ARISTIDES FE;93;20793;14/5/2001 22:11:00;CIDADAO COMUM;S;;TIROL;BH;600120.66;789714.99;4801
-4803;2001262506;B03000;AMEACA;AV MARIA CONCEIC;286;32052;14/5/2001 22:10:00;CIDADAO COMUM;N;;GOIANIA;BH;615643.14;803997.94;4802
-4804;2001262515;B06000;LESAO CORPORAL;RUA REMI PEREIRA;234;96727;14/5/2001 22:19:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;614854.85;806306.99;4803
-4805;2001262546;B03000;AMEACA;RUA CABO FRIO;250;82031;14/5/2001 22:41:00;CIDADAO COMUM;S;CAA;SAO GABRIEL;BH;614311.41;804741.76;4804
-4806;2001262549;B03000;AMEACA;RUA BENVINDA DE ;120;9276;14/5/2001 22:42:00;CIDADAO COMUM;S;AP002;SANTO ANTONIO;BH;611009.60;794652.84;4805
-4807;2001262564;B03000;AMEACA;RUA CINQUENTA;115;106100;14/5/2001 22:52:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;608191.83;810920.50;4806
-4808;2001262583;B04001;HOMICIDIO TENTAD;RUA SAN MARINO;38;96409;14/5/2001 23:02:00;CIDADAO COMUM;S;0;JARDIM EUROPA;BH;607798.16;810368.84;4807
-4809;2001262616;B04001;HOMICIDIO TENTAD;RUA ONZE DE DEZE;86;112687;14/5/2001 23:20:00;CIDADAO COMUM;S;0;LEONINA;BH;608758.16;793556.94;4808
-4810;2001262685;B06000;LESAO CORPORAL;AV AFONSO PENA;758;1259;15/5/2001 00:21:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611140.69;797058.18;4809
-4811;2001262731;B06000;LESAO CORPORAL;AV SANTOS DUMONT;109;61950;15/5/2001 01:11:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611469.19;797433.51;4810
-4812;2001262795;B06000;LESAO CORPORAL;RUA JOAO DE CARV;25;37550;15/5/2001 02:57:00;POLICIAL MILITAR;S;;DOM BOSCO;BH;604376.29;797736.45;4811
-4813;2001262829;B03000;AMEACA;AV OLEGARIO MACI;660;49699;15/5/2001 04:00:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610493.31;797062.69;4812
-4814;2001262833;B06000;LESAO CORPORAL;RUA JOSE CLEMENT;304;38667;15/5/2001 04:01:00;CIDADAO COMUM;S;;FLORAMAR;BH;612226.70;806061.56;4813
-4815;2001262899;B06000;LESAO CORPORAL;RUA ANTENOR VALE;119;100882;15/5/2001 06:45:00;CIDADAO COMUM;N;;FLORAMAR;BH;611247.72;807310.71;4814
-4816;2001262919;B03000;AMEACA;BECO SANTA MARIA;83;48960;15/5/2001 07:08:00;INICIATIVA;S;83-A;VILA PARAISO;BH;606118.68;790661.45;4815
-4817;2001263090;B03000;AMEACA;RUA ABILIO FERNA;375;95421;15/5/2001 09:18:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616838.69;804321.77;4816
-4818;2001263151;B03000;AMEACA;RUA PEDRO LUCIO ;372;64293;15/5/2001 09:58:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608988.43;809546.51;4817
-4819;2001263181;B06000;LESAO CORPORAL;RUA ENCANTADO;241;25453;15/5/2001 10:14:00;CIDADAO COMUM;S;0;CAICARA;BH;607683.35;799393.01;4818
-4820;2001263205;B03000;AMEACA;RUA JUIZ DE FORA;397;39455;15/5/2001 10:25:00;CIDADAO COMUM;S;LJ5;BARRO PRETO;BH;609618.99;796869.79;4819
-4821;2001263247;B06000;LESAO CORPORAL;RUA JOSE RAIMUND;13;123983;15/5/2001 10:52:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606781.66;812080.95;4820
-4822;2001263268;B03000;AMEACA;RUA DOS URUGUAIO;85;46710;15/5/2001 11:05:00;CIDADAO COMUM;S;;GORDURAS;BH;616569.96;804408.86;4821
-4823;2001263274;B03000;AMEACA;RUA COSME E DAMI;26;18246;15/5/2001 11:08:00;CIDADAO COMUM;N;;UNIVERSITARIO;BH;610117.24;802600.75;4822
-4824;2001263385;B06000;LESAO CORPORAL;RUA BEIRA LINHA;278;121732;15/5/2001 12:27:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615460.33;805397.29;4823
-4825;2001263424;B03000;AMEACA;AV PRESIDENTE AN;845;4461;15/5/2001 12:53:00;CIDADAO COMUM;N;;LAGOINHA;BH;610492.26;798773.24;4824
-4826;2001263462;B03000;AMEACA;RUA LOPES TROVAO;121;41394;15/5/2001 13:28:00;CIDADAO COMUM;N;;FLORESTA;BH;611901.95;798312.61;4825
-4827;2001263481;B03000;AMEACA;RUA MILTON PALME;84;85837;15/5/2001 13:40:00;CIDADAO COMUM;N;SL737;SERRA VERDE;BH;609178.25;810223.10;4826
-4828;2001263487;B06000;LESAO CORPORAL;AV RAUL MOURAO G;499;89900;15/5/2001 13:47:00;CIDADAO COMUM;N;0;PALMEIRAS;BH;606963.83;791845.95;4827
-4829;2001263491;B04001;HOMICIDIO TENTAD;RUA JULIO CESAR ;110;91792;15/5/2001 13:50:00;CIDADAO COMUM;S;;CH ATILA DE PAIV;BH;601531.01;790750.83;4828
-4830;2001263505;B03000;AMEACA;RUA MODESTINO GO;53;84430;15/5/2001 13:58:00;CIDADAO COMUM;N;;NOVA VISTA;BH;614965.79;800757.80;4829
-4831;2001263534;B03000;AMEACA;RUA DOS JESUITAS;114;63391;15/5/2001 14:13:00;CIDADAO COMUM;S;LJ2;PLANALTO;BH;610253.29;805590.30;4830
-4832;2001263805;B03000;AMEACA;RUA JOSE ROMAO D;200;84850;15/5/2001 16:49:00;INICIATIVA;S;0;DA LAGOA;BH;604558.08;809126.53;4831
-4833;2001263867;B03000;AMEACA;RUA MODESTINO GO;53;84430;15/5/2001 17:17:00;CIDADAO COMUM;N;;NOVA VISTA;BH;614965.79;800757.80;4832
-4834;2001263893;B03000;AMEACA;RUA SAO SALVADOR;13;63612;15/5/2001 17:30:00;INICIATIVA;S;0;BONFIM;BH;610184.38;797952.86;4833
-4835;2001263979;B03000;AMEACA;RUA ITANAJE;24;35643;15/5/2001 18:16:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;606560.35;795249.35;4834
-4836;2001263984;B06000;LESAO CORPORAL;AV AFONSO PENA;3160;1259;15/5/2001 18:19:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;612365.19;794973.12;4835
-4837;2001264048;B04001;HOMICIDIO TENTAD;RUA DOS GOITACAZ;1789;31400;15/5/2001 18:49:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609552.62;797129.26;4836
-4838;2001264215;B03000;AMEACA;AV ITAU;460;36025;15/5/2001 20:14:00;CIDADAO COMUM;S;APTO.:103.;DOM BOSCO;BH;605316.00;797316.62;4837
-4839;2001264258;B03000;AMEACA;RUA O;56;78396;15/5/2001 20:41:00;CIDADAO COMUM;N;0;VILA PINHO;BH;602074.09;788052.68;4838
-4840;2001264320;B03000;AMEACA;RUA DOS TABAIARE;42;66649;15/5/2001 21:19:00;CIDADAO COMUM;N;AP703;FLORESTA;BH;611831.98;797292.90;4839
-4841;2001264326;B03000;AMEACA;AV AUGUSTO DE LI;1327;6731;15/5/2001 21:22:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;610051.77;796842.69;4840
-4842;2001264362;B06000;LESAO CORPORAL;RUA PROFESSOR OT;92;55632;15/5/2001 21:46:00;INICIATIVA;0;0;SANTA EFIGENIA;BH;612987.19;796926.84;4841
-4843;2001264368;B03000;AMEACA;RUA BENTO;90;170807;15/5/2001 21:50:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608443.37;794109.13;4842
-4844;2001264382;B06000;LESAO CORPORAL;AV BIAS FORTES;661;9553;15/5/2001 21:54:00;INICIATIVA;S;0;LOURDES;BH;610743.50;796207.75;4843
-4845;2001264421;B03000;AMEACA;RUA PROFESSOR OT;92;55632;15/5/2001 22:24:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;612987.19;796926.84;4844
-4846;2001264462;B04002;HOMICIDIO CONSUM;RUA JOANA DARC;225;170141;15/5/2001 22:46:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614511.87;794982.94;4845
-4847;2001264537;B03000;AMEACA;RUA JOSE JOAQUIM;255;38871;15/5/2001 23:35:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610954.46;802060.45;4846
-4848;2001264644;B03000;AMEACA;RUA DOS TUPIS;1044;69965;16/5/2001 01:22:00;INICIATIVA;N;0;BARRO PRETO;BH;610269.70;797121.45;4847
-4849;2001264670;B03000;AMEACA;RUA MAGNO MOURA;149;42545;16/5/2001 02:00:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615900.66;800588.01;4848
-4850;2001264811;B06000;LESAO CORPORAL;RUA CONEGO SANTA;957;16859;16/5/2001 06:15:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;610495.45;800852.05;4849
-4851;2001264827;B06000;LESAO CORPORAL;RUA SATURNINO FE;39;64108;16/5/2001 06:49:00;CIDADAO COMUM;S;;LETICIA;BH;607622.21;809926.71;4850
-4852;2001265006;B03000;AMEACA;RUA JOAQUIM CHAV;161;50931;16/5/2001 09:40:00;CIDADAO COMUM;N;0;MINASCAIXA;BH;609225.46;809596.53;4851
-4853;2001265080;B03000;AMEACA;RUA COPENHAGUE;76;63524;16/5/2001 10:17:00;INICIATIVA;S;0;TREVO;BH;604077.22;805831.39;4852
-4854;2001265109;B06000;LESAO CORPORAL;RUA DOS ADVOGADO;405;103130;16/5/2001 10:43:00;INICIATIVA;S;0;CONJUNTO ALIPIO ;BH;604499.30;800376.34;4853
-4855;2001265138;B06000;LESAO CORPORAL;RUA JAIME SALSE;278;36848;16/5/2001 11:08:00;INICIATIVA;N;0;MAGNESITA;BH;604022.14;793879.98;4854
-4856;2001265467;B03000;AMEACA;RUA JANAITIBA;803;36889;16/5/2001 14:47:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;616039.65;799186.15;4855
-4857;2001265476;B06000;LESAO CORPORAL;RUA SAO TOMAS DE;535;63782;16/5/2001 14:54:00;CIDADAO COMUM;N;0;MORRO DO PAPAGAI;BH;610849.00;793420.56;4856
-4858;2001265482;B03000;AMEACA;RUA PAULO DE FRO;11;52722;16/5/2001 14:56:00;INICIATIVA;N;0;CENTRO BH;BH;610740.91;797637.21;4857
-4859;2001265634;B06000;LESAO CORPORAL;RUA DOM SILVERIO;300;22496;16/5/2001 16:18:00;CIDADAO COMUM;N;;BELMONT;BH;615222.25;805374.99;4858
-4860;2001265662;B06000;LESAO CORPORAL;RUA GEORGINA PEN;150;31006;16/5/2001 16:36:00;CIDADAO COMUM;S;CAFR;SAO LUCAS;BH;614133.28;795705.78;4859
-4861;2001265740;B03000;AMEACA;RUA ANDARAI;286;3720;16/5/2001 17:24:00;CIDADAO COMUM;N;0;NOVA VISTA (SB);SB;615301.42;800837.38;4860
-4862;2001265905;B04001;HOMICIDIO TENTAD;RUA GRAUNAS;338;31797;16/5/2001 18:58:00;CIDADAO COMUM;N;A;FLAVIO MARQUES D;BH;605357.25;788696.63;4861
-4863;2001266102;B03000;AMEACA;RUA SALINAS;1584;59992;16/5/2001 20:53:00;INICIATIVA;S;0;HORTO;BH;613059.02;797579.96;4862
-4864;2001266129;B03000;AMEACA;RUA SAO JERONIMO;47;62764;16/5/2001 21:12:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612475.53;799757.38;4863
-4865;2001266295;B06000;LESAO CORPORAL;RUA MARCAZITA;1;43488;16/5/2001 23:13:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610116.75;799181.06;4864
-4866;2001266311;B03000;AMEACA;RUA DOUTOR BENED;1689;12252;16/5/2001 23:22:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;612974.25;804856.37;4865
-4867;2001266313;B03000;AMEACA;RUA NESTOR VERAS;105;85852;16/5/2001 23:27:00;CIDADAO COMUM;N;AN2;SERRA VERDE;BH;609293.01;810251.97;4866
-4868;2001266378;B06000;LESAO CORPORAL;RUA ANGATURAMA;14;3935;17/5/2001 00:17:00;INICIATIVA;S;0;SAO PAULO;BH;612414.84;802648.96;4867
-4869;2001266446;B06000;LESAO CORPORAL;RUA GIRASSOL;440;31277;17/5/2001 01:51:00;CIDADAO COMUM;N;;LINDEIA;BH;599263.27;791099.17;4868
-4870;2001266489;B06000;LESAO CORPORAL;RUA NAVARRA;39;113576;17/5/2001 02:51:00;CIDADAO COMUM;N;CAA;JARDIM EUROPA;BH;608746.87;810211.38;4869
-4871;2001266905;B06000;LESAO CORPORAL;RUA GENERAL OZOR;1131;30901;17/5/2001 10:46:00;CIDADAO COMUM;S;;VERA CRUZ;BH;615951.92;798005.52;4870
-4872;2001267080;B06000;LESAO CORPORAL;RUA JOAO AVELINO;235;83075;17/5/2001 13:01:00;CIDADAO COMUM;N;;CALIFORNIA;BH;603313.10;796473.50;4871
-4873;2001267167;B03000;AMEACA;RUA DOS ECONOMIS;612;103272;17/5/2001 14:15:00;INICIATIVA;S;MP6953 CB VICTOR;CONJUNTO ALIPIO ;BH;604238.00;800485.06;4872
-4874;2001267178;B03000;AMEACA;AV DOS BANDEIRAN;492;7775;17/5/2001 14:22:00;CIDADAO COMUM;S;FLORICULT. CIA D;SION;BH;612063.30;793124.76;4873
-4875;2001267208;B06000;LESAO CORPORAL;RUA VIOLETA DE M;9;80253;17/5/2001 14:38:00;CIDADAO COMUM;S;0;SAO JOSE;BH;604156.53;799475.93;4874
-4876;2001267270;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;200;170504;17/5/2001 15:14:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608596.19;793933.42;4875
-4877;2001267337;B03000;AMEACA;AV BARBACENA;252;8084;17/5/2001 15:47:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609389.65;796964.49;4876
-4878;2001267379;B03000;AMEACA;RUA DOUTOR JOSE ;79;91547;17/5/2001 16:11:00;CIDADAO COMUM;S;0;SAO BENTO;BH;609872.53;793003.40;4877
-4879;2001267401;B03000;AMEACA;RUA CANA DA INDI;394;94848;17/5/2001 16:22:00;CIDADAO COMUM;N;0;LINDEIA;BH;599823.12;790690.41;4878
-4880;2001267513;B03000;AMEACA;AV PRESIDENTE AN;295;4461;17/5/2001 17:28:00;POLICIAL MILITAR;S;0;LAGOINHA;BH;610689.55;798286.65;4879
-4881;2001267545;B03000;AMEACA;AV ARQUITETO MOR;47;6050;17/5/2001 17:43:00;CIDADAO COMUM;N;FU;BARREIRO;BH;602994.37;791488.05;4880
-4882;2001267683;B06000;LESAO CORPORAL;RUA DOS GUARANIS;301;32181;17/5/2001 19:02:00;INICIATIVA;N;0;CENTRO BH;BH;610722.99;797339.12;4881
-4883;2001267743;B06000;LESAO CORPORAL;RUA GONCALVES DI;1041;31513;17/5/2001 19:31:00;CIDADAO COMUM;S;AP102;FUNCIONARIOS;BH;611538.79;795731.57;4882
-4884;2001267778;B03000;AMEACA;RUA CACILDA BECK;36;11262;17/5/2001 19:52:00;CIDADAO COMUM;S;0;TUPI;BH;613323.37;806316.54;4883
-4885;2001267853;B06000;LESAO CORPORAL;AV SEN LEVINDO C;1070;14866;17/5/2001 20:34:00;INICIATIVA;N;0;SANTA CECILIA;BH;601290.55;786629.80;4884
-4886;2001267905;B06000;LESAO CORPORAL;RUA BUARQUE DE M;85;10650;17/5/2001 21:13:00;CIDADAO COMUM;S;;FLORESTA;BH;611837.94;798205.68;4885
-4887;2001267924;B04001;HOMICIDIO TENTAD;AV SIDERAL;265;65721;17/5/2001 21:19:00;INICIATIVA;S;0;VISTA ALEGRE;BH;604262.37;793431.83;4886
-4888;2001268039;B06000;LESAO CORPORAL;RUA SEBASTIAO DE;151;64209;17/5/2001 22:18:00;INICIATIVA;S;;NOVA GRANADA;BH;607929.60;794787.71;4887
-4889;2001268119;B06000;LESAO CORPORAL;AV OLEGARIO MACI;372;49699;17/5/2001 23:09:00;INICIATIVA;S;0;CENTRO (BH);BH;610569.33;797339.29;4888
-4890;2001268126;B03000;AMEACA;RUA LEILOEIRO JO;121;85229;17/5/2001 23:11:00;CIDADAO COMUM;N;AP203;SANTA AMELIA;BH;606958.53;805966.94;4889
-4891;2001268139;B09000;ABANDONO DE INCA;RUA PEDRINOPOLIS;400;52980;17/5/2001 23:23:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605848.57;807100.75;4890
-4892;2001268218;B06000;LESAO CORPORAL;RUA CONSUELO;146;106296;18/5/2001 00:25:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607848.43;811390.89;4891
-4893;2001268236;B06000;LESAO CORPORAL;RUA AUGUSTA ANDR;1167;99104;18/5/2001 00:41:00;CIDADAO COMUM;S;;JAQUELINE;BH;611759.56;810626.88;4892
-4894;2001268268;B03000;AMEACA;RUA DOUTOR CRIST;312;55598;18/5/2001 01:12:00;CIDADAO COMUM;N;;ARAGUAIA;BH;604751.25;789297.85;4893
-4895;2001268310;B03000;AMEACA;RUA RIO BONITO;184;110174;18/5/2001 02:00:00;CIDADAO COMUM;S;;PILAR;BH;607753.16;788709.99;4894
-4896;2001268369;B03000;AMEACA;RUA DOS TIMBIRAS;2796;67682;18/5/2001 03:04:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610033.69;796605.59;4895
-4897;2001268417;B06000;LESAO CORPORAL;RUA RADIALISTA E;36;12381;18/5/2001 04:23:00;CIDADAO COMUM;S;CAFR;CEU AZUL;BH;603996.65;808758.62;4896
-4898;2001268435;B06000;LESAO CORPORAL;RUA FERNAO DIAS;799;28133;18/5/2001 04:56:00;INICIATIVA;N;0;CAETANO FURQUIM;BH;615910.87;799034.52;4897
-4899;2001268774;B03000;AMEACA;RUA AUGUSTO MORE;512;6760;18/5/2001 10:30:00;CIDADAO COMUM;S;0;SANTA AMELIA;BH;606752.48;805506.78;4898
-4900;2001268820;B06000;LESAO CORPORAL;RUA MARIA ISABEL;15;118481;18/5/2001 11:00:00;CIDADAO COMUM;N;;MALDONADO;BH;601683.64;790179.32;4899
-4901;2001268899;B06000;LESAO CORPORAL;RUA EDUARDO QUEN;81;25047;18/5/2001 11:47:00;CIDADAO COMUM;S;0;SAO BERNARDO;BH;610496.41;805089.06;4900
-4902;2001268932;B03000;AMEACA;RUA CARMESIA;452;13618;18/5/2001 12:20:00;CIDADAO COMUM;S;BLF     AP403;SANTA INES;BH;614353.47;800610.41;4901
-4903;2001268938;B03000;AMEACA;RUA ALEM PARAIBA;1035;81357;18/5/2001 12:20:00;CIDADAO COMUM;S;0;BONFIM;BH;609842.01;798489.63;4902
-4904;2001268950;B06000;LESAO CORPORAL;RUA IPANEMA;785;34726;18/5/2001 12:33:00;CIDADAO COMUM;N;CA01;SARANDI (URCA/BH;BH;602941.78;802385.88;4903
-4905;2001268996;B03000;AMEACA;RUA VATICANO;349;71371;18/5/2001 13:05:00;CIDADAO COMUM;N;0;GLORIA;BH;604160.24;797994.67;4904
-4906;2001269010;B03000;AMEACA;AV OLEGARIO MACI;308;49699;18/5/2001 13:17:00;INICIATIVA;S;0;CENTRO (BH);BH;610578.92;797398.38;4905
-4907;2001269019;B03000;AMEACA;RUA TREZE DE SET;323;69168;18/5/2001 13:21:00;CIDADAO COMUM;S;;LEONINA;BH;608612.10;793426.03;4906
-4908;2001269080;B03000;AMEACA;RUA EXPEDICIONAR;158;27001;18/5/2001 14:06:00;CIDADAO COMUM;S;0;ADELAIDE;BH;607662.37;798580.43;4907
-4909;2001269088;B03000;AMEACA;RUA SAO BORJA;346;61620;18/5/2001 14:11:00;CIDADAO COMUM;N;CAA;BOA VISTA;BH;614926.86;800315.28;4908
-4910;2001269345;B03000;AMEACA;RUA PEDRO LESSA;137;53117;18/5/2001 16:46:00;CIDADAO COMUM;0;PANIFICADORA LAG;LAGOINHA;BH;610203.19;798737.46;4909
-4911;2001269348;B05000;SEQUESTRO E CARC;RUA JOSE CLETO;412;38682;18/5/2001 16:45:00;CIDADAO COMUM;S;AP301;DOS PALMARES;BH;610976.99;802305.66;4910
-4912;2001269644;B03000;AMEACA;RUA DES TORRES;131;81344;18/5/2001 19:09:00;CIDADAO COMUM;S;0;PEDRO SEGUNDO;BH;608747.06;798694.06;4911
-4913;2001269696;B06000;LESAO CORPORAL;RUA ETEL NOGUEIR;550;94416;18/5/2001 19:32:00;INICIATIVA;S;0;OURO PRETO;BH;606438.05;800864.00;4912
-4914;2001269721;B06000;LESAO CORPORAL;RUA JOSE ANTONIO;73;80483;18/5/2001 19:45:00;CIDADAO COMUM;S;A;JARDIM ALVORADA;BH;606135.30;800181.37;4913
-4915;2001269730;B03000;AMEACA;RUA BOLIVAR FERR;101;89995;18/5/2001 19:49:00;CIDADAO COMUM;S;PROX. PADARIA SA;PALMEIRAS;BH;607269.62;791505.60;4914
-4916;2001269765;B03000;AMEACA;RUA PAULO PAPINI;75;9190;18/5/2001 20:09:00;CIDADAO COMUM;S;0;PARAISO;BH;614770.70;797028.44;4915
-4917;2001269767;B06000;LESAO CORPORAL;RUA OURO FINO;16;50714;18/5/2001 20:11:00;CIDADAO COMUM;N;AP101;CRUZEIRO;BH;612074.49;794639.35;4916
-4918;2001269810;B03000;AMEACA;RUA DELIO JOSE C;65;74427;18/5/2001 20:34:00;INICIATIVA;S;0;PLANALTO;BH;610551.00;806441.67;4917
-4919;2001269818;B06000;LESAO CORPORAL;RUA MEDEIROS;204;62420;18/5/2001 20:38:00;CIDADAO COMUM;S;RUA DA GARAGEM D;MINASLANDIA;BH;612156.90;804581.93;4918
-4920;2001269827;B05000;SEQUESTRO E CARC;AV PRESIDENTE AN;901;4461;18/5/2001 20:42:00;CIDADAO COMUM;N;VITIMA NO DI;SAO CRISTOVAO;BH;610492.26;798773.24;4919
-4921;2001269885;B03000;AMEACA;RUA POVOA DE VAR;437;54958;18/5/2001 21:19:00;CIDADAO COMUM;N;;PAQUETA;BH;605302.03;802656.56;4920
-4922;2001269890;B03000;AMEACA;RUA W DOIS;155;122619;18/5/2001 21:22:00;CIDADAO COMUM;S;;PONGELUPE;BH;603965.42;787409.50;4921
-4923;2001269928;B03000;AMEACA;ALAMEDA VARGEM G;40;95967;18/5/2001 21:37:00;CIDADAO COMUM;S;0;VILA CASTANHEIRA;BH;601365.77;788667.34;4922
-4924;2001270019;B02000;RIXA;RUA NILO APARECI;425;7384;18/5/2001 22:24:00;CIDADAO COMUM;S;;PLANALTO;BH;609419.95;807033.99;4923
-4925;2001270055;B03000;AMEACA;RUA ALCINDO VIEI;583;1968;18/5/2001 22:47:00;CIDADAO COMUM;N;B;BARREIRO;BH;602841.65;790669.84;4924
-4926;2001270099;B04001;HOMICIDIO TENTAD;RUA ANDIROBA;7;102935;18/5/2001 23:12:00;INICIATIVA;S;0;SAO PAULO;BH;612393.94;802957.18;4925
-4927;2001270116;B03000;AMEACA;RUA DEZESSEIS;548;32821;18/5/2001 23:21:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612269.18;807345.95;4926
-4928;2001270148;B03000;AMEACA;RUA RIO GRANDE D;555;58744;18/5/2001 23:37:00;INICIATIVA;N;0;BARRO PRETO;BH;610367.39;796966.84;4927
-4929;2001270155;B04001;HOMICIDIO TENTAD;AV NELIO CERQUEI;15;72359;18/5/2001 23:39:00;CIDADAO COMUM;S;;TIROL;BH;600947.66;789885.51;4928
-4930;2001270163;B03000;AMEACA;RUA TOME DE SOUZ;950;67998;18/5/2001 23:48:00;CIDADAO COMUM;S;FR888;FUNCIONARIOS;BH;611435.66;795218.32;4929
-4931;2001270166;B03000;AMEACA;RUA MARIA DA FE;415;44046;18/5/2001 23:50:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606364.70;794639.09;4930
-4932;2001270264;B06000;LESAO CORPORAL;AV HENFIL;219;103550;19/5/2001 00:53:00;CIDADAO COMUM;N;0;SARANDI (URCA/BH;BH;603229.57;801700.39;4931
-4933;2001270266;B04001;HOMICIDIO TENTAD;RUA C;53;47693;19/5/2001 01:02:00;CIDADAO COMUM;S;0;VILA CASTANHEIRA;BH;601080.99;788618.39;4932
-4934;2001270268;B06000;LESAO CORPORAL;RUA DOS CAETES;342;11376;19/5/2001 01:02:00;CIDADAO COMUM;N;FR;CENTRO (BH);BH;611282.38;797431.89;4933
-4935;2001270307;B04002;HOMICIDIO CONSUM;RUA UM;43;94923;19/5/2001 01:25:00;CIDADAO COMUM;N;0;LINDEIA;BH;599399.40;790259.57;4934
-4936;2001270322;B04002;HOMICIDIO CONSUM;RUA BANDONION;100;170139;19/5/2001 01:39:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;613977.41;795089.89;4935
-4937;2001270333;B06000;LESAO CORPORAL;AV DOS ANDRADAS;346;3761;19/5/2001 01:48:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611480.77;797265.49;4936
-4938;2001270402;B03000;AMEACA;RUA LIBANIA PENA;65;40855;19/5/2001 02:37:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610749.14;805180.30;4937
-4939;2001270410;B06000;LESAO CORPORAL;RUA QUIXADA;793;57612;19/5/2001 02:43:00;CIDADAO COMUM;S;;IPIRANGA;BH;611561.33;800355.15;4938
-4940;2001270432;B03000;AMEACA;RUA JULIO CESAR;140;39483;19/5/2001 02:59:00;CIDADAO COMUM;S;0;NAZARE;BH;615490.97;804461.80;4939
-4941;2001270514;B06000;LESAO CORPORAL;AV SANTOS DUMONT;680;61950;19/5/2001 04:09:00;INICIATIVA;S;0;CENTRO BH;BH;610999.13;797614.04;4940
-4942;2001270544;B06000;LESAO CORPORAL;AV AMAZONAS;5274;3140;19/5/2001 04:41:00;INICIATIVA;S;0;NOVA SUISSA;BH;606875.02;796011.33;4941
-4943;2001270551;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;1679;31400;19/5/2001 04:46:00;INICIATIVA;N;0;BARRO PRETO;BH;609632.92;797106.27;4942
-4944;2001270624;B03000;AMEACA;RUA PADRE PEDRO ;2277;51657;19/5/2001 06:54:00;INICIATIVA;S;;JARDIM EUROPA;BH;608046.88;809283.20;4943
-4945;2001270706;B03000;AMEACA;RUA SATURNINO DE;50;64089;19/5/2001 10:00:00;INICIATIVA;N;0;CENTRO (BH);BH;610855.98;797753.13;4944
-4946;2001270828;B06000;LESAO CORPORAL;RUA CORONEL LOUR;25;109200;19/5/2001 10:54:00;CIDADAO COMUM;N;;JARDIM ALVORADA;BH;605889.74;800220.31;4945
-4947;2001270972;B03000;AMEACA;RUA CABROBO;573;11187;19/5/2001 13:30:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613270.28;799510.57;4946
-4948;2001271000;B03000;AMEACA;RUA PORTO SEGURO;327;60595;19/5/2001 13:43:00;CIDADAO COMUM;S;;NOVA VISTA;BH;614852.94;800555.19;4947
-4949;2001271082;B06000;LESAO CORPORAL;RUA PADRE BELCHI;227;51240;19/5/2001 14:26:00;INICIATIVA;S;0;CENTRO (BH);BH;610792.57;796787.63;4948
-4950;2001271105;B06000;LESAO CORPORAL;AV AFONSO PENA;394;1259;19/5/2001 14:44:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610976.70;797371.57;4949
-4951;2001271134;B03000;AMEACA;RUA OITO;56;84819;19/5/2001 15:13:00;CIDADAO COMUM;S;;DA LAGOA;BH;604483.44;809351.75;4950
-4952;2001271145;B03000;AMEACA;RUA AARAO REIS;540;473;19/5/2001 15:17:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611545.12;797121.03;4951
-4953;2001271244;B03000;AMEACA;RUA DR BROCHADO;340;23215;19/5/2001 16:14:00;POLICIAL MILITAR;S;0;VERA CRUZ;BH;615875.51;798147.95;4952
-4954;2001271270;B03000;AMEACA;RUA PUBLICITARIO;95;21695;19/5/2001 16:26:00;CIDADAO COMUM;S;FU;AARAO REIS;BH;612736.33;804984.01;4953
-4955;2001271283;B06000;LESAO CORPORAL;RUA MARAVILHAS;251;41426;19/5/2001 16:35:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612382.90;804177.17;4954
-4956;2001271291;B06000;LESAO CORPORAL;RUA RIO GRANDE D;456;58744;19/5/2001 16:40:00;INICIATIVA;N;0;CENTRO BH;BH;610351.17;797021.88;4955
-4957;2001271420;B03000;AMEACA;AV SEN LEVINDO C;1923;14866;19/5/2001 17:58:00;CIDADAO COMUM;S;LJC;SANTA CECILIA;BH;601016.38;787684.29;4956
-4958;2001271430;B06000;LESAO CORPORAL;RUA DES BRAULIO;1380;19917;19/5/2001 18:01:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616260.28;797776.23;4957
-4959;2001271431;B06000;LESAO CORPORAL;RUA CEL JOAO CAM;275;17808;19/5/2001 18:01:00;CIDADAO COMUM;S;;SINIMBU;BH;606419.60;808235.56;4958
-4960;2001271473;B03000;AMEACA;ESTRADA DOS BORG;42;85893;19/5/2001 18:21:00;CIDADAO COMUM;N;0;JARDIM VITORIA;BH;616427.41;804519.29;4959
-4961;2001271495;B03000;AMEACA;RUA JAIR NEGRAO ;21;21944;19/5/2001 18:35:00;CIDADAO COMUM;S;0;JARDIM ESTRELA;BH;607350.38;810168.77;4960
-4962;2001271524;B03000;AMEACA;RUA PARA DE MINA;390;52070;19/5/2001 18:58:00;CIDADAO COMUM;S;AP203;PADRE EUSTAQUIO;BH;606291.28;797707.27;4961
-4963;2001271536;B03000;AMEACA;RUA ALBA;37;1738;19/5/2001 19:03:00;CIDADAO COMUM;N;0;CAICARA;BH;608338.85;800029.22;4962
-4964;2001271550;B03000;AMEACA;RUA MARIA ANALIA;60;300366;19/5/2001 19:13:00;CIDADAO COMUM;S;;POMPEIA;BH;606878.92;808915.74;4963
-4965;2001271579;B06000;LESAO CORPORAL;RUA ARARUAMA;111;77945;19/5/2001 19:29:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606533.50;795254.31;4964
-4966;2001271659;B06000;LESAO CORPORAL;AV ARTUR GUIMARA;1000;6151;19/5/2001 20:15:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610780.22;802042.44;4965
-4967;2001271703;B04002;HOMICIDIO CONSUM;RUA DOS JAVAES;357;37198;19/5/2001 20:37:00;CIDADAO COMUM;S;;SANTA MONICA;BH;606525.85;807799.24;4966
-4968;2001271747;B03000;AMEACA;RUA MARIA CARMEM;905;127206;19/5/2001 21:01:00;CIDADAO COMUM;N;CAA;SANTA EFIGENIA;BH;614070.11;796009.57;4967
-4969;2001271750;B02000;RIXA;RUA GRAO PARA;389;31771;19/5/2001 21:04:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;612830.65;796401.48;4968
-4970;2001271824;B06000;LESAO CORPORAL;AV ARTUR BERNARD;1150;60844;19/5/2001 21:39:00;INICIATIVA;S;0;VILA PARIS;BH;610180.14;793263.99;4969
-4971;2001271871;B04001;HOMICIDIO TENTAD;RUA REPUBLICA AR;20;58379;19/5/2001 22:10:00;CIDADAO COMUM;N;AP101;SION;BH;611786.71;793814.45;4970
-4972;2001271898;B03000;AMEACA;RUA NILO PECANHA;742;47665;19/5/2001 22:27:00;CIDADAO COMUM;S;0;BOA VISTA;BH;614370.93;800093.85;4971
-4973;2001271920;B06000;LESAO CORPORAL;RUA CLEANTO;69;46499;19/5/2001 22:38:00;CIDADAO COMUM;S;B;BELMONT;BH;615311.95;804929.64;4972
-4974;2001271964;B06000;LESAO CORPORAL;RUA OSCAR NEGRAO;200;17776;19/5/2001 23:10:00;CIDADAO COMUM;S;EM FRENTE A CADE;GAMELEIRA;BH;605051.19;794788.68;4973
-4975;2001271999;B06000;LESAO CORPORAL;RUA SILVA REIS;80;65908;19/5/2001 23:28:00;CIDADAO COMUM;N;;NOVA VISTA;BH;615541.63;800479.89;4974
-4976;2001272038;B04001;HOMICIDIO TENTAD;RUA EVOCACAO;375;26948;19/5/2001 23:52:00;INICIATIVA;N;SOCORRIDO AO ALB;SAO JOSE;BH;605821.48;798726.88;4975
-4977;2001272060;B06000;LESAO CORPORAL;ESTRADA BEIRA LI;286;10878;20/5/2001 00:03:00;INICIATIVA;S;0;SAO GABRIEL;BH;616550.18;806626.14;4976
-4978;2001272135;B03000;AMEACA;RUA PADRE PEDRO ;11;51657;20/5/2001 00:49:00;INICIATIVA;S;0;VENDA NOVA;BH;605831.31;809997.06;4977
-4979;2001272202;B06000;LESAO CORPORAL;AV ABILIO MACHAD;3123;634;20/5/2001 01:35:00;CIDADAO COMUM;S;0;ALIPIO DE MELO;BH;603784.55;799976.88;4978
-4980;2001272208;B04002;HOMICIDIO CONSUM;RUA OSCAR LOBO P;270;104480;20/5/2001 01:39:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612347.11;803516.89;4979
-4981;2001272257;B02000;RIXA;RUA BOM RETIRO;210;10030;20/5/2001 02:05:00;CIDADAO COMUM;0;;JARDIM MONTANHES;BH;606360.47;798202.25;4980
-4982;2001272275;B04001;HOMICIDIO TENTAD;RUA CLAUDIO GOME;150;117060;20/5/2001 02:16:00;CIDADAO COMUM;N;CASA 09;DOS PALMARES;BH;611064.87;802289.97;4981
-4983;2001272289;B06000;LESAO CORPORAL;AV DO CONTORNO;6969;17228;20/5/2001 02:25:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610714.40;794917.94;4982
-4984;2001272302;B04002;HOMICIDIO CONSUM;RUA CLEMENTE BAR;525;16010;20/5/2001 02:32:00;INICIATIVA;N;0;ALIPIO DE MELO;BH;604567.10;799155.53;4983
-4985;2001272369;B06000;LESAO CORPORAL;AV OLEGARIO MACI;220;49699;20/5/2001 03:25:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610608.26;797483.18;4984
-4986;2001272379;B02000;RIXA;RUA CONSUELO;181;106296;20/5/2001 03:30:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607835.55;811463.55;4985
-4987;2001272417;B06000;LESAO CORPORAL;RUA VERISSIMO GU;475;102720;20/5/2001 04:13:00;INICIATIVA;N;0;REGINA;BH;599062.14;790155.01;4986
-4988;2001272490;B03000;AMEACA;RUA GUIDO CIOLET;76;19440;20/5/2001 05:22:00;CIDADAO COMUM;S;;BARREIRO;BH;602875.39;790418.81;4987
-4989;2001272530;B03000;AMEACA;RUA FLUORINA;570;29091;20/5/2001 06:39:00;CIDADAO COMUM;S;;POMPEIA;BH;614606.92;797613.73;4988
-4990;2001272690;B03000;AMEACA;AV BERNARDO VASC;1277;9411;20/5/2001 09:30:00;INICIATIVA;N;0;CACHOEIRINHA;BH;611028.41;801154.68;4989
-4991;2001272729;B06000;LESAO CORPORAL;AV SARAMENHA;165;64007;20/5/2001 10:09:00;INICIATIVA;N;0;FLORAMAR;BH;611941.98;805631.36;4990
-4992;2001272767;B06000;LESAO CORPORAL;AV BASILIO DA GA;36;8361;20/5/2001 10:36:00;CIDADAO COMUM;N;;TUPI;BH;613149.68;805708.58;4991
-4993;2001272828;B06000;LESAO CORPORAL;RUA BARAO DE COR;803;7910;20/5/2001 11:33:00;CIDADAO COMUM;S;CA2;SAO TOMAZ;BH;610349.02;805430.19;4992
-4994;2001272833;B03000;AMEACA;RUA LINCOLN;446;41136;20/5/2001 11:37:00;CIDADAO COMUM;S;0;UNIAO;BH;612776.31;801654.48;4993
-4995;2001272877;B03000;AMEACA;RUA CATAS ALTAS;105;51990;20/5/2001 12:15:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612519.37;804119.57;4994
-4996;2001272878;B03000;AMEACA;RUA DOUTOR CAMIL;268;23228;20/5/2001 12:11:00;CIDADAO COMUM;S;;SAO LUCAS;BH;613449.89;795496.32;4995
-4997;2001272901;B03000;AMEACA;RUA GERALDO BERN;36;103461;20/5/2001 12:34:00;CIDADAO COMUM;S;;OURO PRETO;BH;606396.19;800721.24;4996
-4998;2001272904;B06000;LESAO CORPORAL;RUA JOSE CLETO;755;38682;20/5/2001 12:37:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610608.49;802484.40;4997
-4999;2001272974;B03000;AMEACA;RUA CLEBER SOARE;57;20116;20/5/2001 13:38:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607150.82;807842.20;4998
-5000;2001273001;B03000;AMEACA;RUA FLOR DE VIDR;227;13504;20/5/2001 14:03:00;INICIATIVA;S;0;CASTELO;BH;605603.23;799571.25;4999
-5001;2001273007;B03000;AMEACA;RUA DA BAHIA;637;81155;20/5/2001 14:08:00;INICIATIVA;S;0;CENTRO (BH);BH;611390.26;797003.62;5000
-5002;2001273047;B06000;LESAO CORPORAL;RUA SERRA NEGRA;1392;65038;20/5/2001 14:31:00;CIDADAO COMUM;S;CAC;SANTO ANDRE;BH;609041.92;799138.87;5001
-5003;2001273068;B06000;LESAO CORPORAL;RUA COROA DE FRA;266;77189;20/5/2001 14:49:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600562.13;786921.65;5002
-5004;2001273118;B06000;LESAO CORPORAL;BECO TIA ANASTAC;46;301677;20/5/2001 15:32:00;CIDADAO COMUM;S;FU;FAZENDINHA;BH;614694.46;795507.37;5003
-5005;2001273131;B03000;AMEACA;RUA PADRE LUIZ C;142;42472;20/5/2001 15:41:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;603753.25;793019.65;5004
-5006;2001273211;B04001;HOMICIDIO TENTAD;RUA ARAUA;126;5600;20/5/2001 16:35:00;CIDADAO COMUM;S;;SAO PAULO;BH;612543.10;803149.82;5005
-5007;2001273270;B03000;AMEACA;RUA PASSARO LIRA;146;68442;20/5/2001 17:09:00;CIDADAO COMUM;S;0;GOIANIA;BH;615530.18;803239.52;5006
-5008;2001273299;B06000;LESAO CORPORAL;RUA PADRE EUSTAQ;685;51294;20/5/2001 17:22:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;608908.98;797876.89;5007
-5009;2001273353;B03000;AMEACA;AV TERESA CRISTI;724;67512;20/5/2001 17:53:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608524.82;797475.69;5008
-5010;2001273364;B03000;AMEACA;AV ERICO VERISSI;1167;41671;20/5/2001 17:59:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;607617.30;808717.70;5009
-5011;2001273381;B06000;LESAO CORPORAL;RUA JULIO MESQUI;8;81849;20/5/2001 18:13:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599193.51;788636.30;5010
-5012;2001273390;B03000;AMEACA;RUA BERTALHA;160;110187;20/5/2001 18:19:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;615738.53;806166.25;5011
-5013;2001273408;B06000;LESAO CORPORAL;RUA LUPERCIO PAI;221;57335;20/5/2001 18:30:00;CIDADAO COMUM;S;0;TIROL;BH;599950.08;789076.85;5012
-5014;2001273433;B03000;AMEACA;RUA LUME;269;41961;20/5/2001 18:47:00;CIDADAO COMUM;N;;COQUEIROS;BH;603305.77;800449.88;5013
-5015;2001273446;B03000;AMEACA;RUA EXPEDITO FLA;90;84847;20/5/2001 18:51:00;CIDADAO COMUM;N;CASA 41 / BLOCO ;DA LAGOA;BH;604749.70;809113.09;5014
-5016;2001273450;B06000;LESAO CORPORAL;RUA SAO FELICISS;440;62373;20/5/2001 18:54:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;606148.08;792191.84;5015
-5017;2001273454;B06000;LESAO CORPORAL;RUA TEOFILO FILH;150;91070;20/5/2001 18:55:00;CIDADAO COMUM;N;;JARDIM AMERICA;BH;605989.94;793124.95;5016
-5018;2001273499;B03000;AMEACA;RUA AMIRO RODRIG;26;61862;20/5/2001 19:17:00;INICIATIVA;S;0;APARECIDA SETIMA;BH;609026.94;800161.98;5017
-5019;2001273523;B03000;AMEACA;RUA POVOA DE VAR;437;54958;20/5/2001 19:26:00;CIDADAO COMUM;N;;PAQUETA;BH;605302.03;802656.56;5018
-5020;2001273580;B03000;AMEACA;AV AMAZONAS;1877;3140;20/5/2001 20:06:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609886.56;796413.42;5019
-5021;2001273587;B03000;AMEACA;RUA AARAO REIS;554;473;20/5/2001 20:12:00;INICIATIVA;N;0;CENTRO (BH);BH;611545.12;797119.64;5020
-5022;2001273623;B03000;AMEACA;AV RAJA GABAGLIA;3077;57830;20/5/2001 20:31:00;CIDADAO COMUM;S;0;ESTORIL;BH;609208.29;792438.19;5021
-5023;2001273629;B06000;LESAO CORPORAL;RUA COMENDADOR A;287;16382;20/5/2001 20:35:00;CIDADAO COMUM;N;;ITAMARATI;BH;606664.16;807899.34;5022
-5024;2001273668;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;379;17095;20/5/2001 21:01:00;CIDADAO COMUM;S;0;FLORESTA;BH;612028.06;797010.00;5023
-5025;2001273698;B06000;LESAO CORPORAL;AV ABILIO MACHAD;469;634;20/5/2001 21:20:00;CIDADAO COMUM;S;0;INCONFIDENCIA;BH;605007.68;798009.39;5024
-5026;2001273734;B06000;LESAO CORPORAL;RUA DANIEL LOPES;37;34449;20/5/2001 21:39:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;603834.56;793135.67;5025
-5027;2001273802;B03000;AMEACA;RUA JOAQUIM LEMO;18;37724;20/5/2001 22:21:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609275.23;810024.59;5026
-5028;2001273829;B03000;AMEACA;RUA CARLOS NIEME;825;13472;20/5/2001 22:36:00;CIDADAO COMUM;S;FU;SAGRADA FAMILIA;BH;613695.14;799445.07;5027
-5029;2001273889;B06000;LESAO CORPORAL;AV JOSE BONIFACI;190;38579;20/5/2001 23:04:00;CIDADAO COMUM;S;0;PRADO LOPES;BH;610155.34;799025.63;5028
-5030;2001273908;B03000;AMEACA;RUA MARIA FELICI;185;44059;20/5/2001 23:15:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603734.72;802316.09;5029
-5031;2001274017;B03000;AMEACA;RUA NEFELINA;117;81228;21/5/2001 00:40:00;INICIATIVA;N;0;SANTA TEREZA;BH;612835.00;797309.03;5030
-5032;2001274031;B06000;LESAO CORPORAL;RUA LUIS AUGUSTO;5;124857;21/5/2001 00:52:00;CIDADAO COMUM;N;;MANGUEIRAS;BH;600721.87;786584.83;5031
-5033;2001274046;B02000;RIXA;RUA VISEU;908;62042;21/5/2001 01:08:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609672.72;802306.32;5032
-5034;2001274196;B06000;LESAO CORPORAL;RUA BONAPARTE;75;10083;21/5/2001 06:48:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;607584.10;797552.96;5033
-5035;2001274197;B03000;AMEACA;RUA MARACA;1154;43346;21/5/2001 06:53:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;616526.60;799181.02;5034
-5036;2001274450;B06000;LESAO CORPORAL;RUA CENTAURO;541;14563;21/5/2001 09:48:00;CIDADAO COMUM;S;;SANTA LUCIA;BH;610100.51;792567.18;5035
-5037;2001274496;B03000;AMEACA;RUA CURITIBA;632;19090;21/5/2001 10:22:00;POLICIAL MILITAR;S;0;CENTRO (BH);BH;610853.82;797287.53;5036
-5038;2001274552;B03000;AMEACA;RUA DOS TUPINAMB;761;69940;21/5/2001 10:58:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610842.81;797365.98;5037
-5039;2001274570;B03000;AMEACA;RUA PLATINA;1457;54453;21/5/2001 11:11:00;CIDADAO COMUM;S;0;CALAFATE;BH;607792.63;796609.73;5038
-5040;2001274665;B03000;AMEACA;RUA TREZE;150;302331;21/5/2001 12:21:00;CIDADAO COMUM;S;;BONSUCESSO;BH;606355.86;789862.18;5039
-5041;2001274764;B03000;AMEACA;RUA FAGUNDES VAR;256;27689;21/5/2001 13:30:00;CIDADAO COMUM;N;0;LAGOINHA;BH;610256.27;798704.22;5040
-5042;2001274886;B03000;AMEACA;RUA PINTOR AUGUS;180;128091;21/5/2001 15:06:00;CIDADAO COMUM;S;;TUPI;BH;613389.00;805635.15;5041
-5043;2001274908;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;1600;57830;21/5/2001 15:16:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608784.38;794022.15;5042
-5044;2001274931;B03000;AMEACA;RUA SAO PAULO;114;63464;21/5/2001 15:31:00;CIDADAO COMUM;S;EN114   AN1;CENTRO (BH);BH;611103.00;797681.10;5043
-5045;2001274945;B06000;LESAO CORPORAL;RUA PITT;343;54380;21/5/2001 15:38:00;INICIATIVA;N;0;UNIAO;BH;612765.60;801021.57;5044
-5046;2001274949;B03000;AMEACA;AV JEQUITINHONHA;45;37305;21/5/2001 15:39:00;CIDADAO COMUM;S;;VERA CRUZ;BH;615703.97;798584.81;5045
-5047;2001274973;B03000;AMEACA;AV VINTE E OITO ;283;72970;21/5/2001 15:54:00;CIDADAO COMUM;S;;ESPLANADA;BH;614619.31;798893.34;5046
-5048;2001275004;B06000;LESAO CORPORAL;RUA EXPEDICIONAR;185;27027;21/5/2001 16:14:00;CIDADAO COMUM;N;0;SAO LUIZ;BH;606686.05;803437.82;5047
-5049;2001275221;B06000;LESAO CORPORAL;RUA ARIOLINO ARI;151;85811;21/5/2001 18:01:00;CIDADAO COMUM;N;CAFU;SERRA VERDE;BH;609228.75;810106.96;5048
-5050;2001275330;B04001;HOMICIDIO TENTAD;AV A;930;34099;21/5/2001 19:04:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612389.02;807268.89;5049
-5051;2001275338;B03000;AMEACA;RUA MONTE BRANCO;585;46417;21/5/2001 19:07:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606551.97;795683.29;5050
-5052;2001275344;B04002;HOMICIDIO CONSUM;RUA JOAO PAULO I;5;300458;21/5/2001 19:09:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607634.38;793575.75;5051
-5053;2001275414;B03000;AMEACA;RUA PAULA DIAS;66;52634;21/5/2001 19:50:00;INICIATIVA;N;0;UNIAO;BH;612328.98;801534.33;5052
-5054;2001275472;B06000;LESAO CORPORAL;RUA ALFEU DE CAR;276;2223;21/5/2001 20:28:00;CIDADAO COMUM;S;;TUPI;BH;613601.59;805893.87;5053
-5055;2001275546;B03000;AMEACA;RUA PARA DE MINA;271;52070;21/5/2001 21:35:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606412.82;797640.03;5054
-5056;2001275600;B04001;HOMICIDIO TENTAD;RUA JOSUE MARTIN;146;84821;21/5/2001 22:05:00;CIDADAO COMUM;N;;DA LAGOA;BH;604509.51;809508.04;5055
-5057;2001275603;B03000;AMEACA;RUA JOSE PINTO D;389;100901;21/5/2001 22:06:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611512.23;807703.49;5056
-5058;2001275640;B04001;HOMICIDIO TENTAD;RUA CURITIBA;258;19090;21/5/2001 22:33:00;INICIATIVA;N;0;CENTRO (BH);BH;610943.75;797629.80;5057
-5059;2001275833;B06000;LESAO CORPORAL;AV SANTA ALBERTI;903;116170;22/5/2001 01:47:00;CIDADAO COMUM;S;;CASA BRANCA;BH;616511.53;800054.35;5058
-5060;2001276130;B03000;AMEACA;RUA FERREIRA;288;28161;22/5/2001 08:52:00;CIDADAO COMUM;N;;EYMARD;BH;613694.20;803637.73;5059
-5061;2001276167;B04001;HOMICIDIO TENTAD;RUA SANTOS;2200;61910;22/5/2001 09:18:00;CIDADAO COMUM;N;0;SAO DOMINGOS;BH;607908.90;793256.53;5060
-5062;2001276251;B06000;LESAO CORPORAL;RUA ALIANCA;92;2324;22/5/2001 10:27:00;CIDADAO COMUM;N;0;SAO GABRIEL;BH;613401.48;804083.87;5061
-5063;2001276350;B06000;LESAO CORPORAL;AV ELIAS ANTONIO;502;104726;22/5/2001 11:38:00;CIDADAO COMUM;N;0;VENDA NOVA;BH;607224.67;809399.71;5062
-5064;2001276366;B03000;AMEACA;RUA FREI LUIZ DE;481;29961;22/5/2001 11:49:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604477.25;796175.73;5063
-5065;2001276411;B06000;LESAO CORPORAL;RUA AMERICO MAGA;422;3314;22/5/2001 12:20:00;CIDADAO COMUM;S;;BARREIRO;BH;602220.18;790566.15;5064
-5066;2001276422;B06000;LESAO CORPORAL;RUA DOS CARIJOS;504;81243;22/5/2001 12:32:00;INICIATIVA;N;0;CENTRO (BH);BH;610976.67;797223.89;5065
-5067;2001276488;B06000;LESAO CORPORAL;RUA GENTIL PORTU;449;119370;22/5/2001 13:23:00;CIDADAO COMUM;S;0;VILA MAGNESITA;BH;602070.13;795047.24;5066
-5068;2001276570;B06000;LESAO CORPORAL;RUA ESPINOSA;315;26024;22/5/2001 14:28:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;609029.44;798321.28;5067
-5069;2001276579;B03000;AMEACA;RUA JOSE MOREIRA;1053;55368;22/5/2001 14:33:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614395.90;802801.54;5068
-5070;2001276697;B03000;AMEACA;RUA FLOR DA CACH;330;28524;22/5/2001 15:39:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;605682.14;799348.85;5069
-5071;2001276698;B06000;LESAO CORPORAL;RUA RIO GRANDE D;441;58744;22/5/2001 15:40:00;CIDADAO COMUM;S;LJ;CENTRO (BH);BH;610401.04;797083.20;5070
-5072;2001276808;B06000;LESAO CORPORAL;AV DOUTOR ALVARO;754;117665;22/5/2001 16:40:00;CIDADAO COMUM;S;0;SANTA BRANCA;BH;608440.88;807202.81;5071
-5073;2001277070;B06000;LESAO CORPORAL;RUA ANTONIO PRAC;98;109805;22/5/2001 18:49:00;CIDADAO COMUM;S;;BONSUCESSO;BH;605541.58;789914.87;5072
-5074;2001277095;B03000;AMEACA;RUA FERNAO DIAS;60;28133;22/5/2001 18:58:00;CIDADAO COMUM;S;0;CASA BRANCA;BH;616318.93;799741.71;5073
-5075;2001277203;B03000;AMEACA;RUA W QUATRO;339;122634;22/5/2001 20:05:00;CIDADAO COMUM;S;0;PONGELUPE;BH;604000.81;787302.07;5074
-5076;2001277223;B06000;LESAO CORPORAL;RUA SAO VICENTE;54;88126;22/5/2001 20:15:00;CIDADAO COMUM;S;BLOCO 390;GRANJA FREITAS;BH;617022.85;798456.93;5075
-5077;2001277336;B03000;AMEACA;RUA MARTINS SOAR;740;45049;22/5/2001 21:33:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604912.80;792944.99;5076
-5078;2001277339;B03000;AMEACA;RUA VINTE;52;302826;22/5/2001 21:36:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614620.50;805688.82;5077
-5079;2001277380;B06000;LESAO CORPORAL;RUA MADALENA;307;42315;22/5/2001 22:01:00;CIDADAO COMUM;S;AP01;SENHOR BOM JESUS;BH;609701.82;799838.82;5078
-5080;2001277394;B06000;LESAO CORPORAL;AV FLOR DE SEDA;580;748;22/5/2001 22:12:00;CIDADAO COMUM;S;;LINDEIA;BH;599238.03;790679.79;5079
-5081;2001277399;B06000;LESAO CORPORAL;RUA DAS GABIROBA;95;30375;22/5/2001 22:18:00;CIDADAO COMUM;S;;VILA CLORIS;BH;610034.72;808298.49;5080
-5082;2001277400;B03000;AMEACA;RUA BELA EMILIA;200;96175;22/5/2001 22:16:00;CIDADAO COMUM;S;0;OLARIA;BH;601337.35;789370.00;5081
-5083;2001277466;B04001;HOMICIDIO TENTAD;RUA ALVARO OLIVE;175;58381;22/5/2001 23:04:00;CIDADAO COMUM;S;0;MARIA VIRGINIA;BH;611835.32;802870.75;5082
-5084;2001277478;B06000;LESAO CORPORAL;RUA SEARA;378;68685;22/5/2001 23:10:00;CIDADAO COMUM;S;0;COQUEIROS;BH;602279.67;798769.43;5083
-5085;2001277567;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;23/5/2001 00:39:00;INICIATIVA;S;0;TIROL;BH;600947.66;789885.51;5084
-5086;2001277681;B03000;AMEACA;RUA ANTONIO JULI;216;111379;23/5/2001 03:03:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;606775.18;806180.58;5085
-5087;2001277768;B06000;LESAO CORPORAL;RUA EXPEDITO FLA;40;84847;23/5/2001 05:56:00;CIDADAO COMUM;N;CA 41;DA LAGOA;BH;604784.62;809092.91;5086
-5088;2001277777;B06000;LESAO CORPORAL;RUA DOS GUARANIS;124;32181;23/5/2001 06:32:00;INICIATIVA;N;0;CENTRO (BH);BH;610723.61;797512.51;5087
-5089;2001278167;B03000;AMEACA;RUA ESTANISLAU F;111;26267;23/5/2001 11:25:00;CIDADAO COMUM;S;;BANDEIRANTES;BH;606222.65;802875.95;5088
-5090;2001278187;B03000;AMEACA;RUA DOS CARIJOS;408;81243;23/5/2001 11:39:00;CIDADAO COMUM;N;SOBRE LOJA;CENTRO (BH);BH;611064.18;797198.94;5089
-5091;2001278248;B03000;AMEACA;RUA BERNARDINO D;231;9336;23/5/2001 12:41:00;CIDADAO COMUM;S;;GUTIERREZ;BH;608913.93;795852.97;5090
-5092;2001278280;B03000;AMEACA;RUA ITAPETINGA;87;35804;23/5/2001 12:59:00;CIDADAO COMUM;S;0;SAO CRISTOVAO;BH;610402.29;799494.96;5091
-5093;2001278287;B03000;AMEACA;AV AFONSO PENA;4183;1259;23/5/2001 13:10:00;INICIATIVA;N;0;CRUZEIRO;BH;612944.53;794095.63;5092
-5094;2001278426;B03000;AMEACA;RUA OURO FINO;16;50714;23/5/2001 14:44:00;CIDADAO COMUM;S;AP901;CRUZEIRO;BH;612074.49;794639.35;5093
-5095;2001278451;B09000;ABANDONO DE INCA;RUA DOMINGOS DE ;73;102112;23/5/2001 15:03:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599757.23;788374.16;5094
-5096;2001278476;B03000;AMEACA;RUA GUARAIBA;3;96291;23/5/2001 15:15:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614395.92;804666.82;5095
-5097;2001278552;B03000;AMEACA;RUA BANDONION;442;170139;23/5/2001 15:52:00;CIDADAO COMUM;N;PX472;VILA CAFEZAL;BH;614122.39;794785.34;5096
-5098;2001278610;B03000;AMEACA;RUA TOMBOS;38;67985;23/5/2001 16:16:00;CIDADAO COMUM;S;;CALAFATE;BH;607983.96;796880.16;5097
-5099;2001278633;B03000;AMEACA;RUA POUSO ALEGRE;105;54932;23/5/2001 16:29:00;CIDADAO COMUM;N;;FLORESTA;BH;611138.61;798018.14;5098
-5100;2001278753;B03000;AMEACA;RUA DOS BOROROS;19;10216;23/5/2001 17:35:00;INICIATIVA;S;0;SANTA MONICA;BH;606549.06;807469.90;5099
-5101;2001278850;B06000;LESAO CORPORAL;RUA QUARENTA E U;106;34801;23/5/2001 18:24:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612521.64;807196.19;5100
-5102;2001278927;B03000;AMEACA;RUA CANTAGALO;80;12697;23/5/2001 19:04:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609858.05;799342.85;5101
-5103;2001278946;B03000;AMEACA;AV SARAMENHA;1400;64007;23/5/2001 19:14:00;CIDADAO COMUM;S;;GUARANI;BH;613120.71;805643.66;5102
-5104;2001278966;B03000;AMEACA;RUA CINQUENTA;368;302845;23/5/2001 19:22:00;CIDADAO COMUM;S;;TUPI;BH;614150.27;805475.49;5103
-5105;2001278984;B03000;AMEACA;RUA CORONEL OTAV;29;13620;23/5/2001 19:36:00;CIDADAO COMUM;S;0;PARAISO;BH;614424.13;797386.27;5104
-5106;2001279009;B03000;AMEACA;RUA IPANEMA;1135;34726;23/5/2001 19:50:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602814.25;802311.29;5105
-5107;2001279047;B03000;AMEACA;RUA MARIA BEATRI;166;43881;23/5/2001 20:11:00;CIDADAO COMUM;N;AP 103;HAVAI;BH;606737.06;793607.05;5106
-5108;2001279168;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;23/5/2001 21:13:00;INICIATIVA;S;0;TIROL;BH;600947.66;789885.51;5107
-5109;2001279277;B03000;AMEACA;RUA BOLIVAR;458;9871;23/5/2001 22:26:00;CIDADAO COMUM;S;;UNIAO;BH;612866.19;801674.00;5108
-5110;2001279278;B04002;HOMICIDIO CONSUM;RUA RAINHA DAS F;162;92159;23/5/2001 22:26:00;CIDADAO COMUM;N;0;FILADELFIA;BH;602100.52;797477.94;5109
-5111;2001279344;B06000;LESAO CORPORAL;RUA DOS CAETES;372;11376;23/5/2001 23:04:00;CIDADAO COMUM;N;AN2;CENTRO (BH);BH;611253.80;797440.40;5110
-5112;2001279381;B03000;AMEACA;RUA JOAO ALVES T;75;84963;23/5/2001 23:20:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606095.35;810560.19;5111
-5113;2001279416;B06000;LESAO CORPORAL;AV GETULIO VARGA;671;81256;23/5/2001 23:41:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;612052.08;795376.53;5112
-5114;2001279426;B06000;LESAO CORPORAL;AV ITAITUBA;450;35454;23/5/2001 23:50:00;CIDADAO COMUM;N;0;BOA VISTA;BH;615072.17;799768.56;5113
-5115;2001279517;B06000;LESAO CORPORAL;BECO PAI JOAQUIM;130;171056;24/5/2001 01:13:00;CIDADAO COMUM;S;;CABANA;BH;604615.44;794171.61;5114
-5116;2001279549;B06000;LESAO CORPORAL;RUA DAS PETUNIAS;845;11870;24/5/2001 01:53:00;CIDADAO COMUM;N;;LINDEIA;BH;598835.03;791076.43;5115
-5117;2001279573;B03000;AMEACA;RUA PROFESSOR RU;337;86754;24/5/2001 02:39:00;CIDADAO COMUM;N;;JARDIM GUANABARA;BH;611623.53;807570.50;5116
-5118;2001279836;B03000;AMEACA;RUA ENGENHO DA P;72;85622;24/5/2001 09:04:00;INICIATIVA;S;0;ENGENHO NOGUEIRA;BH;606453.65;800474.17;5117
-5119;2001279952;B03000;AMEACA;RUA JOSUE MARTIN;768;84821;24/5/2001 10:08:00;CIDADAO COMUM;N;;DA LAGOA;BH;604376.66;809326.50;5118
-5120;2001280107;B06000;LESAO CORPORAL;RUA CANDIDO DE S;657;12628;24/5/2001 11:59:00;CIDADAO COMUM;N;;GAMELEIRA;BH;605715.13;794396.26;5119
-5121;2001280115;B03000;AMEACA;RUA JABOATAO;33;36498;24/5/2001 12:03:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;605038.10;794746.42;5120
-5122;2001280171;B03000;AMEACA;RUA DOS TUPINAMB;861;69940;24/5/2001 12:55:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610736.01;797388.04;5121
-5123;2001280174;B06000;LESAO CORPORAL;RUA BENJAMIM JAC;294;9207;24/5/2001 12:59:00;CIDADAO COMUM;N;CAFU;GUTIERREZ;BH;608971.75;794756.23;5122
-5124;2001280327;B06000;LESAO CORPORAL;RUA CARANGOLA;288;13094;24/5/2001 14:45:00;CIDADAO COMUM;N;3 ANDAR;SANTO ANTONIO;BH;610731.49;794680.82;5123
-5125;2001280338;B06000;LESAO CORPORAL;AV CRISTIANO MAC;4000;18652;24/5/2001 14:54:00;INICIATIVA;N;0;DOS PALMARES;BH;612434.91;802092.92;5124
-5126;2001280343;B03000;AMEACA;RUA JULITA NOGUE;815;39597;24/5/2001 14:56:00;CIDADAO COMUM;S;LJ1;SANTA TEREZINHA;BH;604270.87;802788.56;5125
-5127;2001280372;B03000;AMEACA;RUA JOAO ALEXAND;267;71384;24/5/2001 15:15:00;CIDADAO COMUM;S;;MILIONARIOS;BH;603980.36;789980.34;5126
-5128;2001280491;B06000;LESAO CORPORAL;RUA CURITIBA;618;19090;24/5/2001 16:12:00;CIDADAO COMUM;S;FR601;CENTRO (BH);BH;610854.28;797299.45;5127
-5129;2001280502;B06000;LESAO CORPORAL;RUA GRAUNAS;414;31797;24/5/2001 16:19:00;CIDADAO COMUM;S;PROX. PADARIA GR;VILA CEMIG;BH;605539.74;788730.01;5128
-5130;2001280592;B03000;AMEACA;RUA RIO DE JANEI;1226;58772;24/5/2001 17:03:00;CIDADAO COMUM;S;0;LOURDES;BH;610936.28;796511.14;5129
-5131;2001280616;B03000;AMEACA;RUA SEBASTIAO DE;154;64209;24/5/2001 17:16:00;INICIATIVA;S;0;NOVA GRANADA;BH;607921.86;794816.01;5130
-5132;2001280644;B03000;AMEACA;RUA ITAOCA;135;35703;24/5/2001 17:31:00;CIDADAO COMUM;N;;FLORAMAR;BH;611520.36;805977.45;5131
-5133;2001280745;B03000;AMEACA;RUA MOREIRA DIAS;7;31191;24/5/2001 18:26:00;CIDADAO COMUM;N;LJ;CONJ HAB JARDIM ;BH;603860.94;798157.37;5132
-5134;2001280853;B03000;AMEACA;AV PRESIDENTE AN;2241;4461;24/5/2001 19:10:00;INICIATIVA;S;0;CACHOEIRINHA;BH;609932.46;800069.95;5133
-5135;2001280949;B03000;AMEACA;RUA IPANEMA;1061;34726;24/5/2001 20:04:00;CIDADAO COMUM;S;0;SARANDI (URCA/BH;BH;602857.04;802334.16;5134
-5136;2001280964;B05000;SEQUESTRO E CARC;RUA DEPUTADO ALV;416;66030;24/5/2001 20:08:00;CIDADAO COMUM;S;APTO 102;SANTO ANTONIO;BH;610586.47;793838.70;5135
-5137;2001280989;B05000;SEQUESTRO E CARC;RUA CORONEL JOAQ;257;17864;24/5/2001 20:18:00;CIDADAO COMUM;N;FU;HELIOPOLIS;BH;611086.49;806159.62;5136
-5138;2001281063;B03000;AMEACA;RUA EMANUEL;224;87010;24/5/2001 21:04:00;CIDADAO COMUM;S;0;PILAR;BH;607677.72;788684.08;5137
-5139;2001281065;B03000;AMEACA;AV DOS BANDEIRAN;2323;7775;24/5/2001 21:06:00;CIDADAO COMUM;S;;MANGABEIRAS;BH;613280.67;794128.20;5138
-5140;2001281119;B06000;LESAO CORPORAL;AV FRANCISCO SA;1369;29656;24/5/2001 21:31:00;CIDADAO COMUM;S;0;GUTIERREZ;BH;608976.96;795456.85;5139
-5141;2001281127;B03000;AMEACA;RUA DOS GOITACAZ;182;31400;24/5/2001 21:35:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611092.06;796762.15;5140
-5142;2001281197;B04001;HOMICIDIO TENTAD;RUA ALFREDO ALVE;10;20636;24/5/2001 22:19:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608779.25;807888.15;5141
-5143;2001281392;B03000;AMEACA;RUA GONCALVES DI;2299;31513;25/5/2001 00:16:00;INICIATIVA;N;0;LOURDES;BH;610326.03;796058.66;5142
-5144;2001281409;B03000;AMEACA;AV PARANA;26;52230;25/5/2001 00:34:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610802.35;797494.35;5143
-5145;2001281522;B03000;AMEACA;RUA MAJOR LOPES;729;42646;25/5/2001 02:47:00;CIDADAO COMUM;N;;SAO PEDRO;BH;611437.36;794125.71;5144
-5146;2001281898;B03000;AMEACA;RUA INDIANA;509;34410;25/5/2001 09:43:00;CIDADAO COMUM;S;AP301;JARDIM AMERICA;BH;607373.55;794767.27;5145
-5147;2001281946;B03000;AMEACA;RUA PADRE PEDRO ;3260;51657;25/5/2001 10:11:00;CIDADAO COMUM;N;0;LETICIA;BH;607007.69;809969.06;5146
-5148;2001282081;B02000;RIXA;AV OLEGARIO MACI;583;49699;25/5/2001 11:46:00;CIDADAO COMUM;S;LJ31;CENTRO (BH);BH;610565.00;797105.59;5147
-5149;2001282088;B06000;LESAO CORPORAL;VIA PRESIDENTE J;4500;130006;25/5/2001 11:50:00;CIDADAO COMUM;N;;CALIFORNIA;BH;607778.73;796821.76;5148
-5150;2001282089;B03000;AMEACA;RUA SAO LUIZ;5;63288;25/5/2001 11:51:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609870.41;805338.58;5149
-5151;2001282334;B03000;AMEACA;RUA CRUZEIRO DO ;209;18927;25/5/2001 14:41:00;CIDADAO COMUM;S;;SANTA HELENA (BH;BH;603532.73;789011.35;5150
-5152;2001282410;B06000;LESAO CORPORAL;AV PRESIDENTE CA;525;55125;25/5/2001 15:36:00;CIDADAO COMUM;N;0;ALTO DOS CAICARA;BH;608340.47;798800.45;5151
-5153;2001282491;B06000;LESAO CORPORAL;RUA DOUTOR GERVA;40;87050;25/5/2001 16:25:00;CIDADAO COMUM;N;0;OLHOS DAGUA;BH;608108.50;788523.67;5152
-5154;2001282503;B03000;AMEACA;RUA CINCO DE JAN;228;119604;25/5/2001 16:34:00;CIDADAO COMUM;N;NR CORRETO E 254;SAO GERALDO;BH;616284.75;799825.01;5153
-5155;2001282546;B06000;LESAO CORPORAL;AV AMAZONAS;478;3140;25/5/2001 16:53:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611039.88;797135.69;5154
-5156;2001282551;B04001;HOMICIDIO TENTAD;AV MANOEL SALLES;200;432;25/5/2001 16:56:00;CIDADAO COMUM;N;;CARDOSO;BH;603752.13;788401.90;5155
-5157;2001282566;B06000;LESAO CORPORAL;RUA SERRINHA;45;129201;25/5/2001 17:01:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;600519.25;786719.95;5156
-5158;2001282631;B03000;AMEACA;RUA GERALDA GONC;60;84254;25/5/2001 17:33:00;CIDADAO COMUM;S;RUA IZAUTINA MAR;JARDIM VITORIA;BH;617144.90;804912.86;5157
-5159;2001282726;B04001;HOMICIDIO TENTAD;RUA BENTO;30;170807;25/5/2001 18:27:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608443.37;794109.13;5158
-5160;2001282731;B03000;AMEACA;RUA I;130;104700;25/5/2001 18:26:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;607030.39;793937.19;5159
-5161;2001282982;B06000;LESAO CORPORAL;AV PARANA;33;52230;25/5/2001 20:32:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610863.26;797477.33;5160
-5162;2001283047;B06000;LESAO CORPORAL;RUA JOAQUIM TEIX;63;38207;25/5/2001 21:06:00;CIDADAO COMUM;S;;CARDOSO;BH;604078.65;788100.48;5161
-5163;2001283053;B06000;LESAO CORPORAL;RUA RADIALISTA A;178;99003;25/5/2001 21:10:00;CIDADAO COMUM;S;;CEU AZUL;BH;604527.89;807566.31;5162
-5164;2001283176;B05000;SEQUESTRO E CARC;RUA SESSENTA E U;100;65167;25/5/2001 22:18:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608098.40;808395.62;5163
-5165;2001283214;B03000;AMEACA;AV DOM PEDRO II;2885;53145;25/5/2001 22:41:00;INICIATIVA;S;0;CARLOS PRATES;BH;608077.06;798049.51;5164
-5166;2001283237;B06000;LESAO CORPORAL;RUA CENTRALINA;270;14840;25/5/2001 22:52:00;CIDADAO COMUM;S;0;SANTA INES;BH;614171.90;800275.69;5165
-5167;2001283243;B03000;AMEACA;RUA MINISTRO OLI;72;46619;25/5/2001 22:57:00;CIDADAO COMUM;S;CAA;SANTA MONICA;BH;607953.66;807394.94;5166
-5168;2001283278;B03000;AMEACA;RUA OSWALDO FERR;70;39382;25/5/2001 23:12:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604732.86;792044.18;5167
-5169;2001283305;B08000;VIOLACAO DE DOMI;RUA PROFESSOR AR;323;5801;25/5/2001 23:29:00;CIDADAO COMUM;S;AP02;SANTO ANTONIO;BH;610205.23;794414.18;5168
-5170;2001283337;B04001;HOMICIDIO TENTAD;RUA NOSSA SENHOR;10;170182;25/5/2001 23:43:00;CIDADAO COMUM;S;0;CABANA;BH;604634.49;794225.93;5169
-5171;2001283373;B06000;LESAO CORPORAL;RUA DESENGANO;32;19860;26/5/2001 00:02:00;CIDADAO COMUM;N;;MANGABEIRAS;BH;612211.82;792481.68;5170
-5172;2001283425;B06000;LESAO CORPORAL;RUA PLATINA;580;54453;26/5/2001 00:43:00;CIDADAO COMUM;S;0;PRADO;BH;608677.53;796816.06;5171
-5173;2001283430;B03000;AMEACA;AV PRESIDENTE AN;3633;4461;26/5/2001 00:48:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;609764.82;801488.12;5172
-5174;2001283477;B02000;RIXA;RUA COBRE;200;16124;26/5/2001 01:11:00;CIDADAO COMUM;S;;CRUZEIRO;BH;612541.79;794425.08;5173
-5175;2001283500;B06000;LESAO CORPORAL;RUA DOUTOR RIBEI;355;23650;26/5/2001 01:26:00;CIDADAO COMUM;S;0;DAS INDUSTRIAS;BH;603537.51;792795.69;5174
-5176;2001283517;B03000;AMEACA;AV PRESIDENTE AN;3633;4461;26/5/2001 01:36:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;609764.82;801488.12;5175
-5177;2001283535;B02000;RIXA;RUA CURITIBA;343;19090;26/5/2001 01:50:00;INICIATIVA;N;0;CENTRO (BH);BH;610968.29;797543.53;5176
-5178;2001283543;B06000;LESAO CORPORAL;RUA DANTE;416;19642;26/5/2001 01:58:00;CIDADAO COMUM;S;;SAO LUCAS;BH;612910.82;795728.90;5177
-5179;2001283616;B06000;LESAO CORPORAL;RUA MARMORE;582;44695;26/5/2001 02:57:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;613395.01;797414.73;5178
-5180;2001283663;B02000;RIXA;RUA SILVA ALVARE;507;65810;26/5/2001 03:30:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615370.54;799332.02;5179
-5181;2001283700;B06000;LESAO CORPORAL;RUA SAO PAULO;175;63464;26/5/2001 04:26:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611119.54;797591.18;5180
-5182;2001283757;B04001;HOMICIDIO TENTAD;AV AMAZONAS;5253;3140;26/5/2001 05:45:00;INICIATIVA;S;0;NOVA SUISSA;BH;606825.09;795951.48;5181
-5183;2001283767;B06000;LESAO CORPORAL;RUA STA MARGARID;439;60986;26/5/2001 06:05:00;CIDADAO COMUM;S;;NAZARE;BH;615391.93;804360.13;5182
-5184;2001283791;B03000;AMEACA;RUA SILVA ALVARE;507;65810;26/5/2001 06:47:00;CIDADAO COMUM;N;;SAO GERALDO;BH;615370.54;799332.02;5183
-5185;2001283799;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;361;26052;26/5/2001 06:59:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611326.30;797302.57;5184
-5186;2001283851;B06000;LESAO CORPORAL;AV NOSSA SENHORA;1890;47996;26/5/2001 07:51:00;INICIATIVA;N;0;SAO PEDRO;BH;611009.80;793343.42;5185
-5187;2001283940;B03000;AMEACA;RUA ITAPECERICA;769;35757;26/5/2001 08:52:00;INICIATIVA;S;0;LAGOINHA;BH;610386.11;798482.47;5186
-5188;2001283965;B03000;AMEACA;AV AMAZONAS;4410;3140;26/5/2001 09:14:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;607487.10;796000.98;5187
-5189;2001283997;B03000;AMEACA;AV PORTUGAL;5101;54816;26/5/2001 09:34:00;CIDADAO COMUM;S;;ITAPOA;BH;609450.94;805490.11;5188
-5190;2001284134;B06000;LESAO CORPORAL;RUA SERRA FORMOS;20;109225;26/5/2001 11:14:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615180.89;807887.67;5189
-5191;2001284207;B03000;AMEACA;RUA TERCIA CABRA;50;118135;26/5/2001 12:13:00;CIDADAO COMUM;N;;CH TUNEL DE IBIR;BH;599852.03;789754.31;5190
-5192;2001284300;B06000;LESAO CORPORAL;RUA QUATRO;46;126840;26/5/2001 13:32:00;CIDADAO COMUM;S;0;BETANIA;BH;605305.32;792543.78;5191
-5193;2001284304;B06000;LESAO CORPORAL;AV GUARAPARI;1201;20711;26/5/2001 13:34:00;CIDADAO COMUM;N;;JARDIM ATLANTICO;BH;607346.51;806392.63;5192
-5194;2001284336;B03000;AMEACA;RUA ICARAI;978;34004;26/5/2001 13:55:00;CIDADAO COMUM;N;AP301;ALTO DOS CAICARA;BH;607895.02;799025.63;5193
-5195;2001284398;B03000;AMEACA;RUA NOSSA SENHOR;25;64905;26/5/2001 14:37:00;CIDADAO COMUM;S;0;JARDIM AMERICA;BH;607765.22;794520.66;5194
-5196;2001284399;B03000;AMEACA;RUA CATALUNHA;166;14204;26/5/2001 14:38:00;INICIATIVA;S;0;SARANDI (URCA/BH;BH;603684.17;802323.97;5195
-5197;2001284477;B03000;AMEACA;RUA INFANTIL;81;80660;26/5/2001 15:22:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604563.01;797057.53;5196
-5198;2001284495;B06000;LESAO CORPORAL;RUA MARCELINO FE;727;43490;26/5/2001 15:32:00;CIDADAO COMUM;S;;SANTA INES;BH;614209.93;801758.02;5197
-5199;2001284503;B03000;AMEACA;RUA GUTIERREZ;5;24637;26/5/2001 15:35:00;CIDADAO COMUM;S;NUMERO CORRETO E;TAQUARIL;BH;617427.50;797417.78;5198
-5200;2001284543;B03000;AMEACA;RUA MARATAIZES;310;51092;26/5/2001 16:01:00;CIDADAO COMUM;S;;IPANEMA;BH;604675.62;798245.47;5199
-5201;2001284555;B04002;HOMICIDIO CONSUM;RUA DONA JUDITE ;794;39414;26/5/2001 16:10:00;CIDADAO COMUM;N;CAA;REGINA;BH;598670.03;790410.17;5200
-5202;2001284564;B06000;LESAO CORPORAL;AV SIDERAL;89;65721;26/5/2001 16:14:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;603852.38;793551.54;5201
-5203;2001284651;B03000;AMEACA;RUA VIOLETA DE M;90;80253;26/5/2001 17:06:00;INICIATIVA;N;0;SAO JOSE;BH;605267.44;799157.87;5202
-5204;2001284653;B03000;AMEACA;RUA JOAO DE MATO;190;37800;26/5/2001 17:04:00;CIDADAO COMUM;N;0;IPIRANGA;BH;611502.45;800913.64;5203
-5205;2001284663;B03000;AMEACA;RUA DES CINTRA N;540;62966;26/5/2001 17:15:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604305.96;789885.00;5204
-5206;2001284692;B04002;HOMICIDIO CONSUM;RUA MARIA RITA B;285;121934;26/5/2001 17:31:00;INICIATIVA;N;0;INDEPENDENCIA;BH;602404.76;786326.03;5205
-5207;2001284716;B03000;AMEACA;RUA UM;505;27979;26/5/2001 17:42:00;CIDADAO COMUM;N;;CAPITAO EDUARDO;BH;618631.70;807113.56;5206
-5208;2001284719;B06000;LESAO CORPORAL;RUA LUNARDI;12;41899;26/5/2001 17:45:00;CIDADAO COMUM;N;0;PEDRO SEGUNDO;BH;608406.08;798297.52;5207
-5209;2001284743;B03000;AMEACA;RUA MAUREA DE OL;320;117592;26/5/2001 17:58:00;CIDADAO COMUM;N;;VENDA NOVA;BH;607368.76;809104.72;5208
-5210;2001284752;B03000;AMEACA;RUA ODILON DIAS ;268;49112;26/5/2001 18:03:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604281.61;797258.86;5209
-5211;2001284758;B03000;AMEACA;RUA DEUSDALMA;112;20069;26/5/2001 18:06:00;CIDADAO COMUM;N;0;NOVA GAMELEIRA;BH;605634.14;794503.99;5210
-5212;2001284763;B06000;LESAO CORPORAL;RUA PAULO DUARTE;275;94066;26/5/2001 18:13:00;CIDADAO COMUM;S;CAUN;SANTA CECILIA;BH;601223.87;788340.04;5211
-5213;2001284770;B03000;AMEACA;AV SIDERAL;89;65721;26/5/2001 18:16:00;CIDADAO COMUM;S;0;VISTA ALEGRE;BH;603852.38;793551.54;5212
-5214;2001284778;B06000;LESAO CORPORAL;AV PADRE JOSE MA;1191;53448;26/5/2001 18:25:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604787.25;793141.38;5213
-5215;2001284802;B03000;AMEACA;RUA JOSE DE ARAU;595;24725;26/5/2001 18:41:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;607367.03;793894.95;5214
-5216;2001284811;B03000;AMEACA;RUA ITANAJE;124;35643;26/5/2001 18:47:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606436.88;795219.48;5215
-5217;2001284904;B03000;AMEACA;RUA ANCHIETA;130;23559;26/5/2001 19:31:00;INICIATIVA;S;0;TAQUARIL;BH;617463.18;796945.34;5216
-5218;2001284921;B03000;AMEACA;RUA DAS OLIVEIRA;279;119620;26/5/2001 19:38:00;CIDADAO COMUM;S;CA1;SAO GERALDO;BH;616314.78;799827.01;5217
-5219;2001284930;B06000;LESAO CORPORAL;RUA NELSON SOARE;417;47463;26/5/2001 19:41:00;CIDADAO COMUM;N;AP201;CIDADE NOVA;BH;612293.70;800251.52;5218
-5220;2001284964;B03000;AMEACA;RUA CINQUENTA E ;36;106416;26/5/2001 20:02:00;CIDADAO COMUM;N;0;JARDIM DOS COMER;BH;608384.93;811048.95;5219
-5221;2001285018;B03000;AMEACA;RUA JOSE CLETO;1075;38682;26/5/2001 20:36:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610463.70;802431.79;5220
-5222;2001285049;B06000;LESAO CORPORAL;RUA MADRE TEREZA;264;96594;26/5/2001 20:51:00;CIDADAO COMUM;S;;JARDIM EUROPA;BH;608301.76;809616.81;5221
-5223;2001285093;B03000;AMEACA;RUA CHAFARIZ;60;300275;26/5/2001 21:11:00;CIDADAO COMUM;S;;HAVAI;BH;607388.59;793775.52;5222
-5224;2001285181;B06000;LESAO CORPORAL;RUA BOACHA;407;9695;26/5/2001 21:59:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604961.28;797374.77;5223
-5225;2001285183;B04001;HOMICIDIO TENTAD;RUA JOAO PAULO I;230;300458;26/5/2001 21:57:00;CIDADAO COMUM;N;0;SAO DOMINGOS;BH;607666.14;793505.29;5224
-5226;2001285203;B06000;LESAO CORPORAL;AV VINTE E OITO ;356;72970;26/5/2001 22:10:00;CIDADAO COMUM;N;0;ESPLANADA;BH;614552.43;798837.28;5225
-5227;2001285214;B06000;LESAO CORPORAL;RUA AVELINO GIAR;218;99350;26/5/2001 22:14:00;CIDADAO COMUM;N;;CEU AZUL;BH;604476.31;807597.49;5226
-5228;2001285233;B03000;AMEACA;AV AMAZONAS;8524;3140;26/5/2001 22:29:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;604277.23;794566.59;5227
-5229;2001285235;B06000;LESAO CORPORAL;RUA PADRE FRANCI;412;51341;26/5/2001 22:30:00;CIDADAO COMUM;N;0;VILA PARIS;BH;609790.49;793465.90;5228
-5230;2001285319;B06000;LESAO CORPORAL;RUA CONDE DE LIN;994;16657;26/5/2001 23:11:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;609936.78;794362.75;5229
-5231;2001285332;B06000;LESAO CORPORAL;AV AMAZONAS;1040;3140;26/5/2001 23:17:00;INICIATIVA;S;0;CENTRO (BH);BH;610552.12;796862.46;5230
-5232;2001285381;B03000;AMEACA;RUA JARAGUA;70;23851;26/5/2001 23:41:00;CIDADAO COMUM;S;;TAQUARIL;BH;617279.96;796983.51;5231
-5233;2001285406;B06000;LESAO CORPORAL;RUA SERRA AZUL;62;65100;26/5/2001 23:53:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616095.92;797406.02;5232
-5234;2001285415;B06000;LESAO CORPORAL;RUA MARCO AURELI;127;61821;27/5/2001 00:02:00;CIDADAO COMUM;S;LJA;NAZARE;BH;615586.92;804707.76;5233
-5235;2001285464;B04002;HOMICIDIO CONSUM;RUA DOS GUARANIS;597;32181;27/5/2001 00:38:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610645.29;797060.64;5234
-5236;2001285473;B04001;HOMICIDIO TENTAD;RUA PINTARROXO;150;95954;27/5/2001 00:39:00;CIDADAO COMUM;S;0;GOIANIA;BH;615369.55;802331.82;5235
-5237;2001285512;B06000;LESAO CORPORAL;RUA JOSE FELIX M;852;7416;27/5/2001 01:01:00;INICIATIVA;S;0;MANTIQUEIRA;BH;606455.66;810642.94;5236
-5238;2001285583;B04001;HOMICIDIO TENTAD;RUA SERGIO MIRAN;260;80644;27/5/2001 01:45:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606220.07;801489.47;5237
-5239;2001285600;B06000;LESAO CORPORAL;AV JEQUITINHONHA;867;37305;27/5/2001 01:52:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615872.02;797817.83;5238
-5240;2001285643;B04002;HOMICIDIO CONSUM;RUA VOLTS;40;73626;27/5/2001 02:24:00;CIDADAO COMUM;N;0;PRIMEIRO DE MAIO;BH;612172.58;803421.57;5239
-5241;2001285647;B06000;LESAO CORPORAL;RUA LUIS RODRIGU;144;85749;27/5/2001 02:25:00;CIDADAO COMUM;S;;CEU AZUL;BH;604852.37;807579.06;5240
-5242;2001285656;B08000;VIOLACAO DE DOMI;ALAMEDA INDAIA;125;34363;27/5/2001 02:28:00;CIDADAO COMUM;N;;DOM CABRAL;BH;604902.65;796728.21;5241
-5243;2001285687;B06000;LESAO CORPORAL;AV BRASIL;342;10420;27/5/2001 02:48:00;CIDADAO COMUM;S;PX342;SAO LUCAS;BH;612723.24;796515.30;5242
-5244;2001285700;B04001;HOMICIDIO TENTAD;RUA OLNEY BARREI;159;48973;27/5/2001 02:58:00;CIDADAO COMUM;S;0;DOM JOAQUIM;BH;613552.48;801797.81;5243
-5245;2001285715;B04001;HOMICIDIO TENTAD;RUA FLOR DE PITA;114;42949;27/5/2001 03:08:00;CIDADAO COMUM;N;0;INDEPENDENCIA;BH;601585.95;786070.71;5244
-5246;2001285841;B06000;LESAO CORPORAL;RUA MONLEVADE;110;46183;27/5/2001 04:41:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610853.97;800937.94;5245
-5247;2001285872;B02000;RIXA;RUA JANUARIA;65;36936;27/5/2001 05:06:00;CIDADAO COMUM;S;0;FLORESTA;BH;611563.51;797768.28;5246
-5248;2001285881;B04001;HOMICIDIO TENTAD;RUA DIAMANTINA;70;21175;27/5/2001 05:17:00;CIDADAO COMUM;S;;CABANA;BH;604767.01;794055.25;5247
-5249;2001285924;B03000;AMEACA;AV COLETORA;127;78241;27/5/2001 06:11:00;CIDADAO COMUM;S;;VILA PINHO;BH;601784.22;788552.93;5248
-5250;2001285948;B03000;AMEACA;RUA DESENGANO;5;19860;27/5/2001 06:45:00;CIDADAO COMUM;N;;MANGABEIRAS;BH;612147.19;792537.48;5249
-5251;2001286123;B03000;AMEACA;RUA JOAQUIM RAMO;394;38175;27/5/2001 10:06:00;CIDADAO COMUM;S;FU;PARAISO;BH;614835.48;796823.96;5250
-5252;2001286145;B06000;LESAO CORPORAL;PRACA MARABU;112;43333;27/5/2001 10:24:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;604605.44;788619.51;5251
-5253;2001286178;B03000;AMEACA;RUA JULIO DE CAS;1227;39470;27/5/2001 10:51:00;INICIATIVA;N;0;CINQUENTENARIO;BH;606610.98;792052.30;5252
-5254;2001286277;B06000;LESAO CORPORAL;RUA RADIALISTA J;70;109367;27/5/2001 12:01:00;CIDADAO COMUM;N;;CEU AZUL;BH;605246.76;808308.68;5253
-5255;2001286322;B06000;LESAO CORPORAL;RUA SAO ROQUE;620;63600;27/5/2001 12:34:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612678.13;799449.80;5254
-5256;2001286387;B06000;LESAO CORPORAL;RUA DOM HENRIQUE;145;102531;27/5/2001 13:24:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616541.52;797463.00;5255
-5257;2001286408;B06000;LESAO CORPORAL;AV DOM JOAO VI;169;22294;27/5/2001 13:40:00;CIDADAO COMUM;N;;CINQUENTENARIO;BH;606195.21;792895.55;5256
-5258;2001286469;B06000;LESAO CORPORAL;RUA NELSON JOSE ;250;98877;27/5/2001 14:23:00;CIDADAO COMUM;S;;DA LAGOA;BH;604911.80;809367.50;5257
-5259;2001286481;B06000;LESAO CORPORAL;PRACA TEJO;12;67235;27/5/2001 14:33:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605960.64;797956.52;5258
-5260;2001286489;B06000;LESAO CORPORAL;RUA DR BROCHADO;888;23215;27/5/2001 14:37:00;INICIATIVA;S;0;VERA CRUZ;BH;615934.25;797872.40;5259
-5261;2001286498;B06000;LESAO CORPORAL;RUA JAIR LOPES C;192;89359;27/5/2001 14:42:00;CIDADAO COMUM;S;0;JARDIM ESTRELA;BH;607211.19;810184.65;5260
-5262;2001286502;B06000;LESAO CORPORAL;RUA SAO MIGUEL;1296;63410;27/5/2001 14:43:00;CIDADAO COMUM;S;BLE     CA48;ITAPOA;BH;609541.66;805574.12;5261
-5263;2001286521;B04001;HOMICIDIO TENTAD;BECO ARANA;118;79780;27/5/2001 15:03:00;CIDADAO COMUM;N;;SAO PAULO;BH;612523.47;803161.32;5262
-5264;2001286536;B06000;LESAO CORPORAL;RUA FLOR DE PEQU;35;94810;27/5/2001 15:12:00;CIDADAO COMUM;S;0;JARDIM ALVORADA;BH;606186.87;800088.39;5263
-5265;2001286545;B06000;LESAO CORPORAL;RUA JOAQUIM TEIX;140;128845;27/5/2001 15:18:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617405.88;796871.94;5264
-5266;2001286551;B03000;AMEACA;RUA SAO LUIZ;10;26112;27/5/2001 15:19:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617354.11;797763.63;5265
-5267;2001286558;B04001;HOMICIDIO TENTAD;ALAMEDA DAS PRIN;763;55342;27/5/2001 15:31:00;INICIATIVA;N;0;SAO JOSE;BH;608047.19;803545.43;5266
-5268;2001286573;B03000;AMEACA;RUA DOZE DE DEZE;90;24060;27/5/2001 15:40:00;CIDADAO COMUM;N;0;BELMONT;BH;615655.26;804957.06;5267
-5269;2001286583;B03000;AMEACA;RUA MARTINS SOAR;570;45049;27/5/2001 15:48:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;605080.53;792957.62;5268
-5270;2001286597;B03000;AMEACA;RUA CARACA;948;12990;27/5/2001 15:59:00;CIDADAO COMUM;S;;SERRA;BH;613753.87;794503.33;5269
-5271;2001286684;B03000;AMEACA;RUA G;90;78282;27/5/2001 17:04:00;CIDADAO COMUM;N;0;VILA PINHO;BH;601884.79;788409.89;5270
-5272;2001286726;B06000;LESAO CORPORAL;AV TERESA CRISTI;7836;67512;27/5/2001 17:32:00;CIDADAO COMUM;S;0;BETANIA;BH;604911.31;792765.55;5271
-5273;2001286830;B06000;LESAO CORPORAL;RUA BARAO DE COR;290;7910;27/5/2001 18:40:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609705.85;805280.22;5272
-5274;2001286831;B04002;HOMICIDIO CONSUM;AV OLINTO MEIREL;2480;49847;27/5/2001 18:39:00;CIDADAO COMUM;N;0;FLAVIO MARQUES D;BH;603783.40;789476.90;5273
-5275;2001286870;B03000;AMEACA;AV SETE DE ABRIL;711;65560;27/5/2001 19:00:00;CIDADAO COMUM;S;AP402;ESPLANADA;BH;614701.23;798401.70;5274
-5276;2001286920;B06000;LESAO CORPORAL;ALAMEDA DIOGO GU;405;21336;27/5/2001 19:22:00;CIDADAO COMUM;N;;VILA CASTANHEIRA;BH;601539.04;788530.12;5275
-5277;2001286933;B06000;LESAO CORPORAL;AV DEPUTADO ULTI;890;82549;27/5/2001 19:26:00;CIDADAO COMUM;N;;PLANALTO;BH;610672.89;806325.59;5276
-5278;2001287054;B06000;LESAO CORPORAL;RUA DOS BANDOLIN;489;106980;27/5/2001 20:41:00;CIDADAO COMUM;N;;CH CALIFORNIA;BH;603972.58;797126.87;5277
-5279;2001287058;B03000;AMEACA;RUA OZANAM;716;50796;27/5/2001 20:43:00;CIDADAO COMUM;N;0;IPIRANGA;BH;612055.67;800906.36;5278
-5280;2001287142;B03000;AMEACA;RUA CAMBE;557;40250;27/5/2001 21:21:00;CIDADAO COMUM;N;CAAN;COQUEIROS;BH;602564.33;798526.49;5279
-5281;2001287186;B03000;AMEACA;RUA MARIO SOARES;446;44641;27/5/2001 21:50:00;CIDADAO COMUM;S;AP201;DOM BOSCO;BH;604166.48;797249.18;5280
-5282;2001287210;B03000;AMEACA;RUA FREI ALBINO ;10;93048;27/5/2001 22:00:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;601296.99;786093.21;5281
-5283;2001287232;B03000;AMEACA;RUA DES BRAULIO;2157;19917;27/5/2001 22:12:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616414.12;797300.11;5282
-5284;2001287243;B06000;LESAO CORPORAL;AV WASHINGTON LU;913;73701;27/5/2001 22:17:00;CIDADAO COMUM;N;0;SAO BERNARDO;BH;610643.18;804939.91;5283
-5285;2001287256;B03000;AMEACA;RUA ARLEI QUEIRO;184;106356;27/5/2001 22:24:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607916.37;811372.01;5284
-5286;2001287283;B06000;LESAO CORPORAL;RUA EXPEDICIONAR;327;86666;27/5/2001 22:40:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;611848.25;807663.34;5285
-5287;2001287289;B03000;AMEACA;RUA CONSELHEIRO ;30;15869;27/5/2001 22:43:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606636.12;794589.81;5286
-5288;2001287293;B03000;AMEACA;RUA MANOEL NUNES;269;43157;27/5/2001 22:44:00;CIDADAO COMUM;S;0;TUPI;BH;613856.56;806029.52;5287
-5289;2001287387;B06000;LESAO CORPORAL;RUA MADUREIRA;326;42416;27/5/2001 23:44:00;CIDADAO COMUM;N;0;PARQUE RIACHUELO;BH;609675.92;800149.35;5288
-5290;2001287407;B03000;AMEACA;RUA FLOR D'AGUA;295;28565;28/5/2001 00:02:00;CIDADAO COMUM;S;CAFR;JARDIM MONTANHES;BH;605689.51;799604.37;5289
-5291;2001287431;B06000;LESAO CORPORAL;RUA DIVISA NOVA;209;21440;28/5/2001 00:25:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;606192.97;794563.10;5290
-5292;2001287447;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;580;18652;28/5/2001 00:39:00;INICIATIVA;S;0;CIDADE NOVA;BH;612034.84;801109.08;5291
-5293;2001287514;B03000;AMEACA;RUA JEQUIRICA;157;37258;28/5/2001 01:54:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611254.76;799443.34;5292
-5294;2001287586;B03000;AMEACA;RUA GOUVEIA;1096;31630;28/5/2001 03:53:00;CIDADAO COMUM;S;0;BOA VISTA;BH;615182.93;800074.33;5293
-5295;2001287718;B03000;AMEACA;RUA DES SARAIVA;157;66535;28/5/2001 08:03:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;615887.76;798678.76;5294
-5296;2001287725;B03000;AMEACA;RUA CAPA PRETA;111;14232;28/5/2001 08:08:00;CIDADAO COMUM;N;0;JOAO PINHEIRO;BH;605084.93;796075.85;5295
-5297;2001287841;B03000;AMEACA;RUA SEBASTIAO NE;57;15478;28/5/2001 09:17:00;CIDADAO COMUM;S;;ITAPOA;BH;609616.49;805847.33;5296
-5298;2001288081;B03000;AMEACA;AV BELEM;1093;8913;28/5/2001 12:04:00;CIDADAO COMUM;S;0;POMPEIA;BH;615054.50;797767.32;5297
-5299;2001288153;B06000;LESAO CORPORAL;RUA CORONEL JOSE;39;17892;28/5/2001 13:04:00;CIDADAO COMUM;N;;SANTA CRUZ;BH;610739.96;802185.68;5298
-5300;2001288185;B06000;LESAO CORPORAL;RUA CAPA PRETA;111;14232;28/5/2001 13:30:00;CIDADAO COMUM;N;0;JOAO PINHEIRO;BH;605084.93;796075.85;5299
-5301;2001288222;B03000;AMEACA;RUA DEZENOVE;41;130191;28/5/2001 13:59:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604918.87;791473.08;5300
-5302;2001288305;B06000;LESAO CORPORAL;RUA NEFELINA;99;81228;28/5/2001 15:00:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;612838.15;797304.69;5301
-5303;2001288312;B03000;AMEACA;RUA BARAO DE MAC;449;7980;28/5/2001 15:05:00;CIDADAO COMUM;S;;SANTO ANTONIO;BH;610174.15;794888.88;5302
-5304;2001288352;B03000;AMEACA;RUA SAO FELIPE;282;62386;28/5/2001 15:32:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613372.54;798722.04;5303
-5305;2001288453;B06000;LESAO CORPORAL;RUA DOS CARIJOS;504;81243;28/5/2001 16:24:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610976.67;797223.89;5304
-5306;2001288483;B03000;AMEACA;RUA REGENCIA;195;301448;28/5/2001 16:39:00;CIDADAO COMUM;S;PX271;VILA CAFEZAL;BH;614107.56;795461.45;5305
-5307;2001288582;B03000;AMEACA;RUA DAVID RABELO;1023;19702;28/5/2001 17:28:00;CIDADAO COMUM;S;;INCONFIDENCIA;BH;604852.48;799008.93;5306
-5308;2001288590;B06000;LESAO CORPORAL;AV SOUZA AGUIAR;2184;84402;28/5/2001 17:36:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;616305.52;798833.55;5307
-5309;2001288599;B06000;LESAO CORPORAL;RUA PAULO KRUGER;175;55910;28/5/2001 17:41:00;CIDADAO COMUM;S;;FLORAMAR;BH;611687.19;806856.30;5308
-5310;2001288601;B03000;AMEACA;AV OLEGARIO MACI;735;49699;28/5/2001 17:41:00;POLICIAL MILITAR;S;0;CENTRO (BH);BH;610517.79;796937.79;5309
-5311;2001288682;B06000;LESAO CORPORAL;RUA DAS VERBENAS;81;71545;28/5/2001 18:22:00;CIDADAO COMUM;S;;LINDEIA;BH;598801.30;790941.81;5310
-5312;2001288690;B06000;LESAO CORPORAL;AV FRANCISCO SA;1373;29656;28/5/2001 18:25:00;CIDADAO COMUM;S;AP2;GUTIERREZ;BH;608976.96;795456.85;5311
-5313;2001288701;B06000;LESAO CORPORAL;RUA LUCIA;20;41527;28/5/2001 18:33:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614026.99;803819.45;5312
-5314;2001288770;B06000;LESAO CORPORAL;AV PROFESSOR ALF;400;2264;28/5/2001 19:07:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;611944.42;796416.90;5313
-5315;2001288976;B06000;LESAO CORPORAL;RUA TOBIAS MOSCO;55;97947;28/5/2001 20:48:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612286.60;803830.35;5314
-5316;2001289022;B03000;AMEACA;AV AGENOR DE PAU;482;86250;28/5/2001 21:20:00;CIDADAO COMUM;S;;JAQUELINE;BH;611517.37;810264.32;5315
-5317;2001289080;B06000;LESAO CORPORAL;RUA GERALDO CAST;112;107812;28/5/2001 21:48:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606674.34;811207.21;5316
-5318;2001289160;B03000;AMEACA;RUA DOS TIMBIRAS;2469;67682;28/5/2001 22:40:00;CIDADAO COMUM;N;0;SANTO AGOSTINHO;BH;610326.19;796489.72;5317
-5319;2001289187;B03000;AMEACA;RUA INDIANOPOLIS;907;34423;28/5/2001 22:57:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610919.83;800890.40;5318
-5320;2001289223;B06000;LESAO CORPORAL;RUA PLATINA;1281;54453;28/5/2001 23:17:00;CIDADAO COMUM;S;;CALAFATE;BH;607934.16;796732.35;5319
-5321;2001289256;B06000;LESAO CORPORAL;RUA JURITI;33;171450;28/5/2001 23:37:00;CIDADAO COMUM;S;;VILA CEMIG;BH;605430.16;788887.55;5320
-5322;2001289298;B03000;AMEACA;RUA HERCULANO PE;483;33143;29/5/2001 00:21:00;CIDADAO COMUM;S;NUMERO E O 483;SALGADO FILHO;BH;606642.48;795383.85;5321
-5323;2001289340;B03000;AMEACA;RUA ITAPETINGA;1341;35804;29/5/2001 01:05:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;609965.84;800605.10;5322
-5324;2001289349;B06000;LESAO CORPORAL;RUA JACAREI;1123;13154;29/5/2001 01:12:00;CIDADAO COMUM;S;;PINDORAMA;BH;602398.69;797917.94;5323
-5325;2001289434;B06000;LESAO CORPORAL;RUA POUSO ALEGRE;219;54932;29/5/2001 03:15:00;CIDADAO COMUM;S;BLB     AP108;FLORESTA;BH;611250.38;798020.65;5324
-5326;2001289609;B06000;LESAO CORPORAL;RUA NACIP RAYDAN;33;47132;29/5/2001 08:01:00;CIDADAO COMUM;S;INICIATIVA HT 14;RIO BRANCO;BH;606908.68;808543.95;5325
-5327;2001289648;B06000;LESAO CORPORAL;RUA RECIFE;726;58149;29/5/2001 08:29:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;608741.90;799254.55;5326
-5328;2001289666;B03000;AMEACA;AV OLEGARIO MACI;572;49699;29/5/2001 08:38:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610516.97;797139.20;5327
-5329;2001289698;B03000;AMEACA;RUA CESARIO ALVI;688;15018;29/5/2001 08:59:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;607391.04;797458.15;5328
-5330;2001289700;B06000;LESAO CORPORAL;AV SEN LEVINDO C;958;14866;29/5/2001 08:59:00;CIDADAO COMUM;N;;MANGUEIRAS;BH;601356.47;786363.54;5329
-5331;2001289708;B03000;AMEACA;RUA DOUTOR ALIPI;25;2365;29/5/2001 09:10:00;CIDADAO COMUM;S;;SERRA;BH;613823.09;794921.03;5330
-5332;2001289733;B03000;AMEACA;RUA JUNIA CRISTI;110;96377;29/5/2001 09:27:00;CIDADAO COMUM;S;;VISTA DO SOL;BH;616293.01;804590.04;5331
-5333;2001289778;B06000;LESAO CORPORAL;RUA AVE DO PARAI;237;6959;29/5/2001 09:52:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604667.15;788706.56;5332
-5334;2001289920;B06000;LESAO CORPORAL;RUA JORDELINA MA;531;84948;29/5/2001 11:33:00;CIDADAO COMUM;N;CAFR;MANTIQUEIRA;BH;606139.38;810993.07;5333
-5335;2001289960;B03000;AMEACA;BECO SAO JOAQUIM;39;301212;29/5/2001 12:18:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610959.40;793684.37;5334
-5336;2001289999;B03000;AMEACA;ESTRADA DO CERCA;2251;26428;29/5/2001 12:49:00;INICIATIVA;S;0;SAO DOMINGOS;BH;607619.37;793428.63;5335
-5337;2001290169;B03000;AMEACA;RUA JOSE FERNAND;34;119948;29/5/2001 15:00:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;615957.39;799439.10;5336
-5338;2001290263;B03000;AMEACA;RUA MORRO DA GRA;303;46823;29/5/2001 15:56:00;CIDADAO COMUM;S;CAA;JARDIM MONTANHES;BH;606309.98;798371.21;5337
-5339;2001290265;B03000;AMEACA;RUA MARIO SOARES;298;44641;29/5/2001 15:58:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604166.68;797141.11;5338
-5340;2001290302;B03000;AMEACA;RUA JOSE ANTENOR;130;16049;29/5/2001 16:21:00;CIDADAO COMUM;N;CSA;PRIMEIRO DE MAIO;BH;612312.80;803782.08;5339
-5341;2001290342;B06000;LESAO CORPORAL;PRACA GREVILEA;30;1334;29/5/2001 16:39:00;CIDADAO COMUM;N;;PATROCINIO;BH;605248.49;794497.92;5340
-5342;2001290360;B04001;HOMICIDIO TENTAD;RUA BANDONION;122;170139;29/5/2001 16:48:00;INICIATIVA;S;0;VILA CAFEZAL;BH;613977.41;795089.89;5341
-5343;2001290368;B03000;AMEACA;RUA FERNAO DIAS;1210;28133;29/5/2001 16:53:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616131.10;797898.69;5342
-5344;2001290372;B03000;AMEACA;RUA FERNAO DIAS;428;28133;29/5/2001 16:57:00;CIDADAO COMUM;S;;CASA BRANCA;BH;616090.44;799485.48;5343
-5345;2001290400;B03000;AMEACA;RUA ANTARES;170;4244;29/5/2001 17:12:00;CIDADAO COMUM;S;0;SANTA LUCIA;BH;610301.90;793066.15;5344
-5346;2001290423;B06000;LESAO CORPORAL;RUA DO FLAMENGO;84;28410;29/5/2001 17:24:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610992.47;804908.91;5345
-5347;2001290448;B06000;LESAO CORPORAL;AV JOSE BONIFACI;189;38579;29/5/2001 17:38:00;CIDADAO COMUM;S;0;PRADO LOPES;BH;610210.56;798939.37;5346
-5348;2001290479;B06000;LESAO CORPORAL;AV MEM DE SA;600;45395;29/5/2001 17:48:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613969.89;796740.47;5347
-5349;2001290557;B06000;LESAO CORPORAL;RUA CINQUENTA E ;317;74137;29/5/2001 18:18:00;CIDADAO COMUM;S;;NOVA YORK;BH;608575.18;810924.30;5348
-5350;2001290570;B06000;LESAO CORPORAL;RUA ARTUR DE SA;1096;6211;29/5/2001 18:27:00;CIDADAO COMUM;S;;UNIAO;BH;613434.92;801356.54;5349
-5351;2001290619;B06000;LESAO CORPORAL;RUA CONCEICAO DO;536;81978;29/5/2001 18:51:00;CIDADAO COMUM;N;LJA;SAO GABRIEL;BH;614391.87;804594.70;5350
-5352;2001290787;B03000;AMEACA;RUA QUARENTA E U;83;302837;29/5/2001 20:19:00;CIDADAO COMUM;N;0;NOVO AARAO REIS;BH;614183.34;805806.43;5351
-5353;2001290830;B03000;AMEACA;RUA OZENIL JOSE ;112;86058;29/5/2001 20:44:00;CIDADAO COMUM;S;;VILA FREI LEOPOL;BH;611716.17;809676.58;5352
-5354;2001290846;B03000;AMEACA;ESTRADA DOS BORG;5;85893;29/5/2001 20:57:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616433.49;804527.60;5353
-5355;2001290853;B06000;LESAO CORPORAL;RUA XAVIER DA VE;152;73843;29/5/2001 21:00:00;CIDADAO COMUM;S;;MINAS BRASIL;BH;605794.49;797401.06;5354
-5356;2001290906;B04001;HOMICIDIO TENTAD;AV ALVARES CABRA;1030;2730;29/5/2001 21:34:00;INICIATIVA;N;0;LOURDES;BH;610560.65;796057.42;5355
-5357;2001290914;B04002;HOMICIDIO CONSUM;AV RAJA GABAGLIA;1961;57830;29/5/2001 21:38:00;INICIATIVA;N;0;LEONINA;BH;608875.32;793451.62;5356
-5358;2001290924;B06000;LESAO CORPORAL;RUA FLOR DA IMPE;448;28600;29/5/2001 21:46:00;CIDADAO COMUM;S;0;JARDIM MONTANHES;BH;605810.72;799740.52;5357
-5359;2001290979;B03000;AMEACA;RUA CORONEL ANTO;172;17590;29/5/2001 22:23:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;606140.28;807563.65;5358
-5360;2001291055;B03000;AMEACA;RUA MAURICIO PER;61;40666;29/5/2001 23:28:00;CIDADAO COMUM;S;0;JAQUELINE;BH;610598.71;810084.72;5359
-5361;2001291060;B03000;AMEACA;RUA ANTARES;170;4244;29/5/2001 23:31:00;CIDADAO COMUM;S;0;SANTA LUCIA;BH;610301.90;793066.15;5360
-5362;2001291099;B06000;LESAO CORPORAL;RUA ITANHOMI;85;35669;29/5/2001 23:56:00;CIDADAO COMUM;N;0;CARLOS PRATES;BH;608749.52;798284.45;5361
-5363;2001291719;B03000;AMEACA;RUA COROCOCO;33;76700;30/5/2001 11:10:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614301.94;806027.12;5362
-5364;2001291737;B06000;LESAO CORPORAL;RUA DINIS DIAS;145;119673;30/5/2001 11:21:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616573.20;797526.82;5363
-5365;2001291778;B04001;HOMICIDIO TENTAD;RUA PENALVA;71;96276;30/5/2001 11:54:00;INICIATIVA;N;0;DOM SILVERIO;BH;614598.66;804371.67;5364
-5366;2001291817;B03000;AMEACA;RUA TOBIAS MOSCO;55;97947;30/5/2001 12:26:00;POLICIAL MILITAR;N;0;PROVIDENCIA;BH;612286.60;803830.35;5365
-5367;2001291892;B03000;AMEACA;RUA JULITA NOGUE;700;39597;30/5/2001 13:22:00;CIDADAO COMUM;N;;SANTA TEREZINHA;BH;604160.72;802710.37;5366
-5368;2001291966;B03000;AMEACA;RUA SANTO ANTONI;101;29832;30/5/2001 14:28:00;CIDADAO COMUM;S;CASA A;SALGADO FILHO;BH;606572.22;793836.55;5367
-5369;2001292012;B03000;AMEACA;RUA CURI;773;19047;30/5/2001 15:04:00;CIDADAO COMUM;N;BLB     AP302;SAO GERALDO;BH;615774.12;799043.09;5368
-5370;2001292059;B06000;LESAO CORPORAL;RUA JULITA NUNES;210;130047;30/5/2001 15:30:00;CIDADAO COMUM;S;0;MINASCAIXA;BH;609164.95;809748.79;5369
-5371;2001292063;B03000;AMEACA;AV CATULO DA PAI;526;59081;30/5/2001 15:32:00;CIDADAO COMUM;S;PRACA DOS INDUST;DAS INDUSTRIAS;BH;604336.90;792747.38;5370
-5372;2001292069;B04001;HOMICIDIO TENTAD;RUA CARLOS QUADR;96;13431;30/5/2001 15:38:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606077.39;794694.97;5371
-5373;2001292289;B03000;AMEACA;RUA GIRASSOL;35;170242;30/5/2001 17:44:00;CIDADAO COMUM;S;;CABANA;BH;604914.68;794410.67;5372
-5374;2001292318;B03000;AMEACA;RUA FRANCISCO LE;165;29495;30/5/2001 17:59:00;CIDADAO COMUM;S;0;SAO MARCOS;BH;614281.87;802378.50;5373
-5375;2001292324;B06000;LESAO CORPORAL;RUA BARAO DE MAC;449;7980;30/5/2001 18:03:00;CIDADAO COMUM;S;;SANTO ANTONIO;BH;610174.15;794888.88;5374
-5376;2001292371;B06000;LESAO CORPORAL;RUA FORMIGA;544;29136;30/5/2001 18:27:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610753.25;798994.38;5375
-5377;2001292381;B03000;AMEACA;RUA CURI;773;19047;30/5/2001 18:33:00;CIDADAO COMUM;S;CA01;SAO GERALDO;BH;615774.12;799043.09;5376
-5378;2001292397;B06000;LESAO CORPORAL;RUA CARANGOLA;288;13094;30/5/2001 18:42:00;CIDADAO COMUM;S;0;SANTO ANTONIO;BH;610731.49;794680.82;5377
-5379;2001292477;B05000;SEQUESTRO E CARC;RUA ROGERIO FAJA;160;59167;30/5/2001 19:15:00;INICIATIVA;S;0;ANCHIETA;BH;612526.71;793523.78;5378
-5380;2001292523;B03000;AMEACA;RUA SEBASTIAO NE;57;15478;30/5/2001 19:35:00;CIDADAO COMUM;S;0;ITAPOA;BH;609616.49;805847.33;5379
-5381;2001292525;B06000;LESAO CORPORAL;RUA CINQUENTA E ;400;74137;30/5/2001 19:37:00;CIDADAO COMUM;S;CS;NOVA YORK;BH;608560.84;810967.05;5380
-5382;2001292547;B03000;AMEACA;RUA PEDRA DE ANI;265;24016;30/5/2001 19:47:00;CIDADAO COMUM;S;;PIRATININGA;BH;606397.61;809067.54;5381
-5383;2001292561;B03000;AMEACA;RUA DOUTOR JOSE ;80;72488;30/5/2001 19:55:00;CIDADAO COMUM;S;;PLANALTO;BH;610724.20;806179.76;5382
-5384;2001292584;B06000;LESAO CORPORAL;RUA GLEUCY JOSE ;5;128860;30/5/2001 20:05:00;INICIATIVA;S;0;CASTANHEIRAS (TA;BH;617303.66;796895.30;5383
-5385;2001292611;B04002;HOMICIDIO CONSUM;AV SIDERAL;635;65721;30/5/2001 20:22:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;604330.64;793630.31;5384
-5386;2001292640;B03000;AMEACA;RUA PITANGUI;530;54365;30/5/2001 20:40:00;CIDADAO COMUM;S;;CONCORDIA;BH;610812.36;798951.44;5385
-5387;2001292680;B03000;AMEACA;RUA CADIZ;200;21090;30/5/2001 21:06:00;INICIATIVA;S;0;JARDIM EUROPA;BH;608241.44;809904.76;5386
-5388;2001292712;B03000;AMEACA;RUA E;155;78254;30/5/2001 21:22:00;CIDADAO COMUM;S;;VILA PINHO;BH;601857.50;788531.20;5387
-5389;2001292750;B06000;LESAO CORPORAL;RUA SAO CRISTOVA;460;62260;30/5/2001 21:44:00;CIDADAO COMUM;S;;LEBLON;BH;605482.14;809635.82;5388
-5390;2001292773;B03000;AMEACA;RUA PINHAL;43;12108;30/5/2001 21:57:00;CIDADAO COMUM;N;0;PIRATININGA;BH;606115.25;809906.56;5389
-5391;2001292781;B04001;HOMICIDIO TENTAD;RUA SAO COSME;60;62216;30/5/2001 22:02:00;CIDADAO COMUM;S;0;GLORIA;BH;603350.23;798467.27;5390
-5392;2001292791;B04001;HOMICIDIO TENTAD;RUA CINQUENTA;203;302845;30/5/2001 22:11:00;CIDADAO COMUM;S;;TUPI;BH;614197.66;805513.25;5391
-5393;2001292812;B06000;LESAO CORPORAL;RODOVIA BR 356;5000;10317;30/5/2001 22:23:00;INICIATIVA;S;0;BELVEDERE;BH;610345.89;791069.48;5392
-5394;2001292839;B04001;HOMICIDIO TENTAD;AV NELIO CERQUEI;15;72359;30/5/2001 22:41:00;CIDADAO COMUM;S;0;TIROL;BH;600947.66;789885.51;5393
-5395;2001292849;B03000;AMEACA;RUA PEDRO NAVA;28;109631;30/5/2001 22:48:00;CIDADAO COMUM;S;0;TUPI;BH;613021.05;806403.70;5394
-5396;2001292864;B04001;HOMICIDIO TENTAD;AV PRESIDENTE AN;7440;4461;30/5/2001 22:52:00;CIDADAO COMUM;N;;LIBERDADE;BH;608848.82;804317.22;5395
-5397;2001292909;B02000;RIXA;RUA MANOEL PAULI;122;43185;30/5/2001 23:20:00;CIDADAO COMUM;S;;DURVAL DE BARROS;IB;598281.11;791094.85;5396
-5398;2001293035;B06000;LESAO CORPORAL;AV DOM PEDRO II;3573;53145;31/5/2001 00:47:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;607359.84;797881.47;5397
-5399;2001293069;B06000;LESAO CORPORAL;AV DAS PALMEIRAS;847;51921;31/5/2001 01:11:00;INICIATIVA;N;0;SAO JOSE;BH;607761.79;803424.91;5398
-5400;2001293093;B02000;RIXA;RUA STO ANTONIO ;525;61806;31/5/2001 01:27:00;CIDADAO COMUM;S;AP601;SANTO ANTONIO;BH;610914.49;794114.23;5399
-5401;2001293159;B06000;LESAO CORPORAL;AV PRESIDENTE AN;1694;4461;31/5/2001 02:26:00;CIDADAO COMUM;S;0;SAO CRISTOVAO;BH;610133.22;799644.13;5400
-5402;2001293171;B06000;LESAO CORPORAL;RUA NANA;171;47186;31/5/2001 02:38:00;INICIATIVA;N;0;MILIONARIOS;BH;603968.42;790001.17;5401
-5403;2001293192;B04001;HOMICIDIO TENTAD;AV PRUDENTE DE M;914;55774;31/5/2001 03:15:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;610064.80;794421.13;5402
-5404;2001293300;B03000;AMEACA;RUA IZABEL;17;170734;31/5/2001 06:42:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608601.43;794604.87;5403
-5405;2001293593;B03000;AMEACA;RUA SABINO JOSE ;50;118210;31/5/2001 10:22:00;INICIATIVA;S;0;TIROL;BH;599830.93;789972.56;5404
-5406;2001293618;B03000;AMEACA;AV AUGUSTO DE LI;1142;6731;31/5/2001 10:36:00;CIDADAO COMUM;0;AP 1404;BARRO PRETO;BH;610231.87;796856.58;5405
-5407;2001293677;B03000;AMEACA;RUA HENRIQUE DIA;81;33042;31/5/2001 11:18:00;CIDADAO COMUM;S;CA3;APARECIDA;BH;609285.64;800049.41;5406
-5408;2001293750;B03000;AMEACA;RUA GUIMARAES;900;62953;31/5/2001 12:07:00;INICIATIVA;S;0;SAO FRANCISCO;BH;608835.37;801449.62;5407
-5409;2001293894;B03000;AMEACA;PRACA AFONSO ARI;60;1205;31/5/2001 14:00:00;INICIATIVA;S;HOTEL DEL REY;CENTRO (BH);BH;611340.42;796563.87;5408
-5410;2001293957;B06000;LESAO CORPORAL;RUA PONTA PORA;200;54601;31/5/2001 14:35:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613187.23;796919.20;5409
-5411;2001294028;B03000;AMEACA;AV TERESA CRISTI;625;67512;31/5/2001 15:26:00;CIDADAO COMUM;N;0;CARLOS PRATES;BH;603730.45;793544.44;5410
-5412;2001294064;B06000;LESAO CORPORAL;RUA CLORITA;100;16051;31/5/2001 15:47:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612847.22;797209.80;5411
-5413;2001294080;B03000;AMEACA;RUA PIRAPETINGA;436;54148;31/5/2001 15:55:00;INICIATIVA;S;0;SERRA;BH;612727.63;794527.29;5412
-5414;2001294088;B03000;AMEACA;RUA EMILIO RICAL;141;102806;31/5/2001 15:54:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;605108.25;795890.74;5413
-5415;2001294138;B06000;LESAO CORPORAL;RUA ANTONIO FAUS;76;97528;31/5/2001 16:20:00;CIDADAO COMUM;N;FU;DOM SILVERIO;BH;614828.18;804494.38;5414
-5416;2001294183;B06000;LESAO CORPORAL;RUA JOSE CUSTODI;131;84733;31/5/2001 16:47:00;CIDADAO COMUM;S;0;DA LAGOA;BH;604676.60;809611.69;5415
-5417;2001294228;B06000;LESAO CORPORAL;RUA MANOEL PAULI;214;43185;31/5/2001 17:23:00;CIDADAO COMUM;S;CAA;DURVAL DE BARROS;IB;598180.67;791056.45;5416
-5418;2001294299;B06000;LESAO CORPORAL;RUA SAPUCAI;499;63943;31/5/2001 17:54:00;INICIATIVA;N;0;FLORESTA;BH;611751.63;797265.20;5417
-5419;2001294323;B06000;LESAO CORPORAL;RUA DOS CAETES;273;11376;31/5/2001 18:10:00;INICIATIVA;S;0;CENTRO (BH);BH;611347.27;797380.42;5418
-5420;2001294356;B06000;LESAO CORPORAL;RUA CLORITA;100;16051;31/5/2001 18:25:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612847.22;797209.80;5419
-5421;2001294378;B03000;AMEACA;AV WASHINGTON LU;1300;73701;31/5/2001 18:36:00;CIDADAO COMUM;N;0;SAO BERNARDO;BH;610297.76;805044.70;5420
-5422;2001294406;B03000;AMEACA;RUA MARIO MACHAD;50;84484;31/5/2001 18:51:00;CIDADAO COMUM;N;0;DOM SILVERIO;BH;615329.03;804272.61;5421
-5423;2001294421;B03000;AMEACA;RUA FREI LUIZ DE;481;29961;31/5/2001 18:57:00;INICIATIVA;S;0;JOAO PINHEIRO;BH;604477.25;796175.73;5422
-5424;2001294473;B06000;LESAO CORPORAL;RUA PIROLOZITO;55;54292;31/5/2001 19:18:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;614090.56;797908.92;5423
-5425;2001294484;B03000;AMEACA;AV ABILIO MACHAD;289;634;31/5/2001 19:24:00;CIDADAO COMUM;N;;INCONFIDENCIA;BH;605159.11;797994.37;5424
-5426;2001294498;B06000;LESAO CORPORAL;RUA FLOR DE MAIO;36;300399;31/5/2001 19:32:00;CIDADAO COMUM;S;PX472;VILA CAFEZAL;BH;614158.56;794801.41;5425
-5427;2001294580;B03000;AMEACA;RUA POTOMAIO;658;54920;31/5/2001 20:21:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615643.99;799123.70;5426
-5428;2001294636;B06000;LESAO CORPORAL;RUA LAVRAS;1038;40540;31/5/2001 20:58:00;INICIATIVA;N;0;SAO PEDRO;BH;611111.90;793838.67;5427
-5429;2001294659;B03000;AMEACA;RUA MERCEDES LUI;192;45483;31/5/2001 21:09:00;CIDADAO COMUM;S;0;PIRAJA;BH;613955.91;803348.34;5428
-5430;2001294667;B03000;AMEACA;RUA GUIA LOBO;200;32430;31/5/2001 21:12:00;INICIATIVA;S;0;ARAGUAIA;BH;604780.15;789332.65;5429
-5431;2001294721;B06000;LESAO CORPORAL;ESTRADA DO CERCA;2112;26428;31/5/2001 21:49:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607514.35;793543.05;5430
-5432;2001294758;B06000;LESAO CORPORAL;RUA ENGENHO DO O;173;103102;31/5/2001 22:07:00;CIDADAO COMUM;S;CAB;ENGENHO NOGUEIRA;BH;606374.39;800410.53;5431
-5433;2001294932;B04002;HOMICIDIO CONSUM;AV UM;241;301245;1/6/2001 00:12:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614419.15;805879.87;5432
-5434;2001294956;B06000;LESAO CORPORAL;RUA DES SARAIVA;608;66535;1/6/2001 00:35:00;CIDADAO COMUM;N;BECO TANCREDO NE;VERA CRUZ;BH;615953.00;798263.22;5433
-5435;2001294996;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;6557;17228;1/6/2001 01:25:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611103.01;794818.70;5434
-5436;2001295050;B04002;HOMICIDIO CONSUM;RUA GAMA CERQUEI;850;30564;1/6/2001 02:30:00;CIDADAO COMUM;N;PROX. A BARAO;JARDIM AMERICA;BH;607640.84;794403.25;5435
-5437;2001295097;B03000;AMEACA;AV MONTESE;672;46675;1/6/2001 03:49:00;INICIATIVA;N;0;ITAPOA;BH;608400.48;806406.08;5436
-5438;2001295173;B03000;AMEACA;RUA CAPITAO DUAR;155;96701;1/6/2001 07:09:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614915.48;806363.75;5437
-5439;2001295194;B03000;AMEACA;RUA SAO SALVADOR;46;63612;1/6/2001 07:22:00;CIDADAO COMUM;S;;BONFIM;BH;610151.37;797963.59;5438
-5440;2001295386;B03000;AMEACA;RUA JOAQUIM DE P;1000;38147;1/6/2001 09:46:00;CIDADAO COMUM;N;0;ALIPIO DE MELO;BH;604681.70;799201.87;5439
-5441;2001295394;B03000;AMEACA;RUA RIO DE JANEI;882;58772;1/6/2001 09:51:00;CIDADAO COMUM;N;LOJA MOURA CALCA;CENTRO (BH);BH;611020.00;796841.48;5440
-5442;2001295478;B06000;LESAO CORPORAL;RUA FLOR DE VIDR;44;13504;1/6/2001 11:01:00;CIDADAO COMUM;N;0;CASTELO;BH;605631.15;799432.80;5441
-5443;2001295497;B06000;LESAO CORPORAL;AV BIAS FORTES;1889;9553;1/6/2001 11:12:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;610128.59;797270.32;5442
-5444;2001295536;B08000;VIOLACAO DE DOMI;RUA ABAETE;379;546;1/6/2001 11:46:00;CIDADAO COMUM;S;CAFR;BONFIM;BH;609826.63;797835.67;5443
-5445;2001295638;B03000;AMEACA;RUA DONA NOEMI;61;22988;1/6/2001 13:09:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606252.90;797217.31;5444
-5446;2001295692;B03000;AMEACA;RUA PATROCINIO;209;52574;1/6/2001 13:45:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;609810.09;797518.64;5445
-5447;2001295737;B03000;AMEACA;RUA DA APRESENTA;59;5118;1/6/2001 14:12:00;CIDADAO COMUM;S;;SAO JOSE;BH;605407.63;798641.22;5446
-5448;2001295785;B03000;AMEACA;RUA ROSALINA BAN;215;59302;1/6/2001 14:57:00;CIDADAO COMUM;S;0;MINASLANDIA;BH;611890.83;803991.25;5447
-5449;2001295871;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;790;31400;1/6/2001 15:50:00;INICIATIVA;N;0;BARRO PRETO;BH;610517.27;796910.59;5448
-5450;2001295875;B03000;AMEACA;RUA CABO VALERIO;78;111920;1/6/2001 15:53:00;CIDADAO COMUM;S;;CH ATILA DE PAIV;BH;601444.34;790687.78;5449
-5451;2001295926;B03000;AMEACA;RUA SERRA NEGRA;1224;65038;1/6/2001 16:21:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609224.13;799135.37;5450
-5452;2001295929;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;701;300224;1/6/2001 16:20:00;CIDADAO COMUM;N;0;MORRO DO PAPAGAI;BH;610540.12;793166.02;5451
-5453;2001296069;B03000;AMEACA;RUA CIRILO GASPA;326;63348;1/6/2001 17:26:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608684.85;800162.78;5452
-5454;2001296095;B06000;LESAO CORPORAL;RUA CARIOCA;114;81634;1/6/2001 17:46:00;INICIATIVA;S;0;SAO PAULO;BH;612315.00;802612.78;5453
-5455;2001296108;B03000;AMEACA;RUA GODOFREDO DE;375;31352;1/6/2001 17:49:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612726.57;799375.77;5454
-5456;2001296199;B03000;AMEACA;RUA MONTALVANIA;28;46344;1/6/2001 18:37:00;CIDADAO COMUM;S;;SANTA INES;BH;613916.00;800191.38;5455
-5457;2001296204;B03000;AMEACA;RUA LIMOEIRO;294;41108;1/6/2001 18:45:00;INICIATIVA;S;102;NOVA SUISSA;BH;607267.86;795880.77;5456
-5458;2001296341;B03000;AMEACA;RUA DA APRESENTA;59;5118;1/6/2001 19:52:00;INICIATIVA;S;;SAO JOSE;BH;605407.63;798641.22;5457
-5459;2001296413;B03000;AMEACA;RUA ARAGUARI;165;5376;1/6/2001 20:36:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610131.21;797120.08;5458
-5460;2001296556;B03000;AMEACA;RUA NELSON HUNGR;10;46634;1/6/2001 21:58:00;CIDADAO COMUM;S;;TUPI;BH;612851.92;806239.44;5459
-5461;2001296572;B03000;AMEACA;RUA DES BRAULIO;1938;19917;1/6/2001 22:05:00;INICIATIVA;S;0;VERA CRUZ;BH;616339.91;797391.22;5460
-5462;2001296635;B06000;LESAO CORPORAL;BECO NOSSA SENHO;20;300897;1/6/2001 22:52:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608649.57;793925.65;5461
-5463;2001296638;B03000;AMEACA;RUA FREI LUIZ DE;59;29961;1/6/2001 22:54:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604955.30;795833.82;5462
-5464;2001296645;B04002;HOMICIDIO CONSUM;RUA DOS CARIJOS;787;81243;1/6/2001 22:57:00;INICIATIVA;N;0;CENTRO (BH);BH;610711.74;797261.24;5463
-5465;2001296724;B06000;LESAO CORPORAL;AV SILVA LOBO;2366;65889;1/6/2001 23:46:00;INICIATIVA;S;0;GRAJAU;BH;608534.06;794486.36;5464
-5466;2001296730;B06000;LESAO CORPORAL;RUA JANUARIO PER;170;86363;1/6/2001 23:47:00;CIDADAO COMUM;N;;JAQUELINE;BH;611007.43;810129.96;5465
-5467;2001296741;B03000;AMEACA;AV RAJA GABAGLIA;1987;57830;1/6/2001 23:56:00;INICIATIVA;N;0;LEONINA;BH;608875.32;793451.62;5466
-5468;2001296747;B03000;AMEACA;RUA FEIRA DE SAN;358;12946;1/6/2001 23:58:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615488.77;806619.60;5467
-5469;2001296755;B06000;LESAO CORPORAL;RUA SEIS;62;302814;2/6/2001 00:08:00;INICIATIVA;N;0;NOVO ARAO REIS;BH;614490.26;805888.76;5468
-5470;2001296774;B04001;HOMICIDIO TENTAD;RUA ITAJOBI;10;35482;2/6/2001 00:17:00;INICIATIVA;S;0;POMPEIA;BH;614467.30;798001.31;5469
-5471;2001296853;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;2/6/2001 01:09:00;CIDADAO COMUM;0;;VENDA NOVA;BH;609671.68;808130.71;5470
-5472;2001296947;B06000;LESAO CORPORAL;RUA OUTONO;535;50768;2/6/2001 02:30:00;CIDADAO COMUM;N;;CRUZEIRO;BH;612086.42;794535.17;5471
-5473;2001296952;B06000;LESAO CORPORAL;RUA PERNAMBUCO;1184;53463;2/6/2001 02:30:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611453.01;795164.24;5472
-5474;2001297020;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;510;7936;2/6/2001 03:17:00;CIDADAO COMUM;N;;NOVA SUISSA;BH;607529.85;795029.50;5473
-5475;2001297053;B03000;AMEACA;RUA INGAI;693;36964;2/6/2001 03:52:00;CIDADAO COMUM;S;AP201;PADRE EUSTAQUIO;BH;607942.26;797392.70;5474
-5476;2001297084;B08000;VIOLACAO DE DOMI;RUA FRANCE JOSE ;328;85751;2/6/2001 04:21:00;CIDADAO COMUM;N;;SERRA VERDE;BH;609703.97;810229.05;5475
-5477;2001297169;B03000;AMEACA;RUA BINARIO;30;301457;2/6/2001 06:41:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614325.07;795529.96;5476
-5478;2001297170;B04001;HOMICIDIO TENTAD;RUA JAIR NEGRAO ;5;21944;2/6/2001 06:42:00;CIDADAO COMUM;N;;JARDIM ESTRELA;BH;607349.55;810148.64;5477
-5479;2001297172;B03000;AMEACA;RUA DOS TUPIS;1110;69965;2/6/2001 06:44:00;CIDADAO COMUM;N;;BARRO PRETO;BH;610202.12;797135.97;5478
-5480;2001297344;B03000;AMEACA;RUA IPACARAI;365;34694;2/6/2001 09:16:00;INICIATIVA;S;0;GLORIA;BH;602745.45;798057.80;5479
-5481;2001297377;B06000;LESAO CORPORAL;RUA ONDINA PEDRO;30;82882;2/6/2001 09:36:00;CIDADAO COMUM;N;0;SERRANO;BH;603640.89;801660.33;5480
-5482;2001297399;B09000;ABANDONO DE INCA;RUA CORONEL JOAO;400;17836;2/6/2001 09:54:00;CIDADAO COMUM;0;0;FLORAMAR;BH;611414.14;806536.86;5481
-5483;2001297411;B03000;AMEACA;RUA M;100;37812;2/6/2001 10:01:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609121.71;810078.66;5482
-5484;2001297452;B08000;VIOLACAO DE DOMI;RUA XAVIER DA VE;166;73843;2/6/2001 10:28:00;CIDADAO COMUM;N;;MINAS BRASIL;BH;605784.32;797406.65;5483
-5485;2001297468;B03000;AMEACA;RUA CAMPINA VERD;312;12110;2/6/2001 10:37:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606172.49;794445.71;5484
-5486;2001297604;B06000;LESAO CORPORAL;RUA MARIA ANGELI;65;43825;2/6/2001 12:09:00;CIDADAO COMUM;S;CAFU;MARIA GORETTI;BH;614078.28;803663.57;5485
-5487;2001297620;B03000;AMEACA;RUA FERNANDO LOB;400;28118;2/6/2001 12:25:00;POLICIAL MILITAR;N;0;SANTA EFIGENIA;BH;614428.02;796990.29;5486
-5488;2001297682;B03000;AMEACA;RUA ROBERTO ALVA;488;125888;2/6/2001 13:09:00;CIDADAO COMUM;S;0;MANGABEIRAS;BH;613717.09;794096.65;5487
-5489;2001297739;B06000;LESAO CORPORAL;RUA DEUSDEDITH D;45;20071;2/6/2001 13:53:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604180.22;796804.73;5488
-5490;2001297824;B06000;LESAO CORPORAL;RUA CAETANO VASC;11;98202;2/6/2001 15:00:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;616275.04;804051.71;5489
-5491;2001297851;B03000;AMEACA;RUA PROFESSOR LE;396;84052;2/6/2001 15:19:00;CIDADAO COMUM;S;;ITAMARATI;BH;606383.37;807880.96;5490
-5492;2001297882;B03000;AMEACA;RUA TAPIRA;81;66939;2/6/2001 15:33:00;CIDADAO COMUM;S;0;CONCORDIA;BH;610785.63;799662.42;5491
-5493;2001297894;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;2/6/2001 15:44:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;5492
-5494;2001297924;B03000;AMEACA;AV DOS ESPORTES;550;26065;2/6/2001 16:08:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606264.57;797115.43;5493
-5495;2001297963;B06000;LESAO CORPORAL;RUA EVEREST;169;26935;2/6/2001 16:29:00;CIDADAO COMUM;S;0;BELMONT;BH;615458.96;805318.06;5494
-5496;2001297972;B06000;LESAO CORPORAL;RUA INTENDENTE C;420;34653;2/6/2001 16:35:00;CIDADAO COMUM;S;AP302;VILA INDAIA;BH;609729.35;803429.79;5495
-5497;2001297976;B04001;HOMICIDIO TENTAD;RUA GRAUNAS;42;31797;2/6/2001 16:37:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;605204.19;788456.55;5496
-5498;2001297977;B03000;AMEACA;RUA CONSELHEIRO ;231;17041;2/6/2001 16:37:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;612529.23;798131.69;5497
-5499;2001298009;B03000;AMEACA;RUA STA APOLONIA;548;60352;2/6/2001 16:52:00;CIDADAO COMUM;S;;DOM JOAQUIM;BH;613932.42;802281.61;5498
-5500;2001298039;B03000;AMEACA;RUA LUIZ LOPES;232;94431;2/6/2001 17:08:00;CIDADAO COMUM;S;;OURO PRETO;BH;606295.93;801150.74;5499
-5501;2001298063;B03000;AMEACA;RUA REGINA;17;58224;2/6/2001 17:23:00;CIDADAO COMUM;S;;EYMARD;BH;613648.70;803339.62;5500
-5502;2001298065;B03000;AMEACA;RUA FLOR DE VIDR;44;13504;2/6/2001 17:21:00;CIDADAO COMUM;S;0;CASTELO;BH;605631.15;799432.80;5501
-5503;2001298084;B06000;LESAO CORPORAL;RUA PEDRA DOURAD;158;127060;2/6/2001 17:32:00;CIDADAO COMUM;S;0;PIRATININGA;BH;605914.83;809333.11;5502
-5504;2001298101;B03000;AMEACA;RUA SARARE;25;64035;2/6/2001 17:48:00;CIDADAO COMUM;N;;JARDINOPOLIS;BH;604534.76;794804.54;5503
-5505;2001298102;B06000;LESAO CORPORAL;RUA HERCILIA GOM;186;104389;2/6/2001 17:50:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605402.11;791022.21;5504
-5506;2001298284;B03000;AMEACA;RUA ITANHAEM;20;100173;2/6/2001 19:16:00;CIDADAO COMUM;S;;PIRATININGA;BH;605396.91;809225.25;5505
-5507;2001298286;B06000;LESAO CORPORAL;RUA PADRE FEIJO;2190;51326;2/6/2001 19:18:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616394.07;797774.76;5506
-5508;2001298296;B03000;AMEACA;AV AUGUSTO DE LI;170;6731;2/6/2001 19:21:00;CIDADAO COMUM;S;1502;CENTRO (BH);BH;611167.70;796596.57;5507
-5509;2001298323;B06000;LESAO CORPORAL;RUA AVELINO GIAR;65;99350;2/6/2001 19:39:00;INICIATIVA;N;0;CEU AZUL;BH;604887.51;807674.66;5508
-5510;2001298328;B06000;LESAO CORPORAL;RUA SARANDI;18;64010;2/6/2001 19:42:00;INICIATIVA;S;0;ESPLANADA;BH;615019.62;798459.96;5509
-5511;2001298355;B03000;AMEACA;RUA ESTEVAO DE O;207;26330;2/6/2001 19:55:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606323.57;798272.26;5510
-5512;2001298367;B03000;AMEACA;AV AFONSO PENA;590;1259;2/6/2001 20:01:00;INICIATIVA;N;0;CENTRO BH;BH;611078.27;797193.62;5511
-5513;2001298443;B04001;HOMICIDIO TENTAD;RUA MANTIQUEIRA;276;43286;2/6/2001 20:45:00;CIDADAO COMUM;N;0;SANTA INES;BH;614324.07;800485.83;5512
-5514;2001298469;B06000;LESAO CORPORAL;AV WALDIR SOEIRO;97;118904;2/6/2001 21:00:00;INICIATIVA;N;0;BETANIA;BH;601638.75;788954.48;5513
-5515;2001298474;B06000;LESAO CORPORAL;RUA NICIAS CONTI;115;56115;2/6/2001 21:02:00;CIDADAO COMUM;S;0;GAMELEIRA;BH;604986.20;794809.65;5514
-5516;2001298484;B03000;AMEACA;RUA DA BOLIVIA;648;9884;2/6/2001 21:07:00;INICIATIVA;S;0;SION;BH;610943.73;793524.50;5515
-5517;2001298496;B06000;LESAO CORPORAL;RUA DOS AMERICAN;1297;3254;2/6/2001 21:16:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604811.91;790698.06;5516
-5518;2001298527;B03000;AMEACA;AV ITAITE;99;35441;2/6/2001 21:28:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;614875.88;799394.79;5517
-5519;2001298538;B06000;LESAO CORPORAL;RUA GUARARAPES;951;32241;2/6/2001 21:33:00;CIDADAO COMUM;N;0;GLORIA;BH;603067.32;798685.03;5518
-5520;2001298558;B06000;LESAO CORPORAL;RUA ANA DE FREIT;87;3531;2/6/2001 21:42:00;CIDADAO COMUM;N;;DURVAL DE BARROS;IB;598543.34;790677.20;5519
-5521;2001298566;B03000;AMEACA;RUA ITAGUA;195;35338;2/6/2001 21:45:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615942.80;798772.06;5520
-5522;2001298601;B03000;AMEACA;AV BELEM;906;8913;2/6/2001 22:04:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615138.21;797926.24;5521
-5523;2001298619;B06000;LESAO CORPORAL;RUA AMARANTO;68;3080;2/6/2001 22:12:00;CIDADAO COMUM;S;;LINDEIA;BH;599564.60;790850.68;5522
-5524;2001298655;B03000;AMEACA;RUA ANTONIA DE C;162;65457;2/6/2001 22:30:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608892.64;809255.94;5523
-5525;2001298692;B04002;HOMICIDIO CONSUM;AV ESPLANADA;600;126244;2/6/2001 22:47:00;CIDADAO COMUM;N;0;SAO GABRIEL;BH;613295.56;804506.46;5524
-5526;2001298703;B06000;LESAO CORPORAL;RUA DES ONOFRE M;18;108770;2/6/2001 22:55:00;INICIATIVA;N;0;RIO BRANCO;BH;607470.11;808742.09;5525
-5527;2001298717;B06000;LESAO CORPORAL;RUA SAO VICENTE;10;113680;2/6/2001 23:00:00;CIDADAO COMUM;S;;TIROL;BH;600949.68;789154.18;5526
-5528;2001298726;B03000;AMEACA;RUA OTAVIO CARNE;456;50594;2/6/2001 23:06:00;CIDADAO COMUM;S;0;BOA VISTA;BH;614836.31;799825.99;5527
-5529;2001298740;B04001;HOMICIDIO TENTAD;RUA CLORITA;100;16051;2/6/2001 23:11:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612847.22;797209.80;5528
-5530;2001298741;B06000;LESAO CORPORAL;RUA VISCONDE DE ;584;73308;2/6/2001 23:11:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605857.28;807175.17;5529
-5531;2001298768;B06000;LESAO CORPORAL;RUA BERNARDO CIS;183;9351;2/6/2001 23:23:00;CIDADAO COMUM;N;;PARQUE RIACHUELO;BH;609725.24;799999.49;5530
-5532;2001298777;B06000;LESAO CORPORAL;RUA JOSE MOREIRA;481;95232;2/6/2001 23:25:00;CIDADAO COMUM;S;0;TIROL;BH;600268.32;789248.46;5531
-5533;2001298824;B02000;RIXA;AV ITAITE;654;35441;2/6/2001 23:55:00;CIDADAO COMUM;N;;SAO GERALDO;BH;615408.86;799462.18;5532
-5534;2001298831;B03000;AMEACA;RUA GUARARAPES;951;32241;2/6/2001 23:59:00;CIDADAO COMUM;S;;GLORIA;BH;603067.32;798685.03;5533
-5535;2001298875;B03000;AMEACA;RUA ANTONIO JOSE;102;7431;3/6/2001 00:31:00;CIDADAO COMUM;S;;CEU AZUL;BH;605149.79;807714.83;5534
-5536;2001298885;B03000;AMEACA;RUA PEDRO LUIZ D;199;100841;3/6/2001 00:38:00;CIDADAO COMUM;S;;FLORAMAR;BH;611505.95;807230.49;5535
-5537;2001298930;B06000;LESAO CORPORAL;RUA GABRO;379;30435;3/6/2001 01:04:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612925.79;797244.47;5536
-5538;2001298943;B06000;LESAO CORPORAL;RUA MOREIRA DIAS;7;31191;3/6/2001 01:11:00;CIDADAO COMUM;S;0;CONJ HAB JARDIM ;BH;603860.94;798157.37;5537
-5539;2001298998;B03000;AMEACA;RUA ANTONIO MARZ;354;94520;3/6/2001 01:43:00;CIDADAO COMUM;N;;OURO PRETO;BH;606237.09;800709.30;5538
-5540;2001299037;B04001;HOMICIDIO TENTAD;RUA DAVID FONSEC;450;19696;3/6/2001 02:01:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604513.19;789975.34;5539
-5541;2001299104;B06000;LESAO CORPORAL;RUA SAO PAULO;550;90213;3/6/2001 02:42:00;CIDADAO COMUM;S;CA;SARANDI (URCA/BH;BH;602793.89;802510.17;5540
-5542;2001299106;B06000;LESAO CORPORAL;AV SILVIANO BRAN;2400;66002;3/6/2001 02:44:00;INICIATIVA;S;0;HORTO;BH;613573.09;798218.66;5541
-5543;2001299181;B04001;HOMICIDIO TENTAD;RUA DOS GOITACAZ;1361;31400;3/6/2001 03:35:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609953.61;797025.02;5542
-5544;2001299188;B06000;LESAO CORPORAL;RUA PROFESSOR SA;15;122722;3/6/2001 03:44:00;CIDADAO COMUM;S;0;BELVEDERE;BH;611311.76;791412.70;5543
-5545;2001299204;B03000;AMEACA;RUA MARIA;27;43737;3/6/2001 04:01:00;CIDADAO COMUM;N;;VILA MARAVILHAS;BH;603342.50;795417.91;5544
-5546;2001299247;B06000;LESAO CORPORAL;AV FLOR DE SEDA;883;748;3/6/2001 04:32:00;CIDADAO COMUM;S;0;LINDEIA;BH;599539.85;790575.26;5545
-5547;2001299256;B06000;LESAO CORPORAL;RUA OITO;95;81606;3/6/2001 04:40:00;CIDADAO COMUM;S;;OLHOS DAGUA;BH;608583.83;788592.29;5546
-5548;2001299298;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;322;51657;3/6/2001 05:34:00;CIDADAO COMUM;S;0;VILA SANTO ANTON;BH;609650.08;808286.90;5547
-5549;2001299361;B06000;LESAO CORPORAL;RUA ARTUR DE SA;1095;6211;3/6/2001 07:16:00;CIDADAO COMUM;S;;UNIAO;BH;612867.65;801923.71;5548
-5550;2001299401;B03000;AMEACA;RUA FERNAO DIAS;428;28133;3/6/2001 08:03:00;CIDADAO COMUM;S;;CASA BRANCA;BH;616090.44;799485.48;5549
-5551;2001299440;B03000;AMEACA;RUA D;114;79764;3/6/2001 08:30:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616892.23;804514.53;5550
-5552;2001299493;B03000;AMEACA;RUA P;9;27216;3/6/2001 09:32:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616464.31;806936.03;5551
-5553;2001299532;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;744;6731;3/6/2001 10:00:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610661.75;796747.31;5552
-5554;2001299539;B03000;AMEACA;RUA LEONCIO JOSE;49;86350;3/6/2001 10:05:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611933.98;807194.50;5553
-5555;2001299564;B09000;ABANDONO DE INCA;RUA CLOVIS DE CA;65;16064;3/6/2001 10:26:00;CIDADAO COMUM;S;;FLORAMAR;BH;612155.53;805842.63;5554
-5556;2001299571;B06000;LESAO CORPORAL;RUA CARLINDO AUG;5;97124;3/6/2001 10:30:00;CIDADAO COMUM;N;;SAO MARCOS;BH;614652.76;802454.88;5555
-5557;2001299638;B06000;LESAO CORPORAL;RUA ANTONIO JULI;218;111379;3/6/2001 11:18:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;606775.18;806180.58;5556
-5558;2001299725;B06000;LESAO CORPORAL;RUA TRUCAL;92;95825;3/6/2001 12:15:00;CIDADAO COMUM;S;;GOIANIA;BH;615359.86;803216.58;5557
-5559;2001299825;B06000;LESAO CORPORAL;AV ALVARES CABRA;17;2730;3/6/2001 13:09:00;INICIATIVA;N;0;CENTRO BH;BH;611448.04;796520.02;5558
-5560;2001299832;B06000;LESAO CORPORAL;RUA CLOVIS DE SO;210;118642;3/6/2001 13:14:00;CIDADAO COMUM;N;;REGINA;BH;598820.84;789899.77;5559
-5561;2001299854;B03000;AMEACA;RUA VITORIA REGI;400;73540;3/6/2001 13:28:00;CIDADAO COMUM;S;CSB;LINDEIA;BH;599149.38;790905.76;5560
-5562;2001299857;B04001;HOMICIDIO TENTAD;RUA LA PAZ;151;40350;3/6/2001 13:27:00;CIDADAO COMUM;S;0;SION;BH;611089.07;793827.88;5561
-5563;2001299869;B03000;AMEACA;RUA SERVIDAO;27;106734;3/6/2001 13:38:00;CIDADAO COMUM;N;;JARDIM DOS COMER;BH;607267.69;811545.81;5562
-5564;2001299871;B03000;AMEACA;RUA SAO JERONIMO;1271;62764;3/6/2001 13:40:00;CIDADAO COMUM;N;0;SAGRADA FAMILIA;BH;612648.00;799754.06;5563
-5565;2001299997;B03000;AMEACA;RUA CAMPOS SALES;1023;12300;3/6/2001 15:06:00;CIDADAO COMUM;S;CAZZ;CALAFATE;BH;606539.69;796004.69;5564
-5566;2001300030;B06000;LESAO CORPORAL;RUA LAGUNA;104;94167;3/6/2001 15:25:00;CIDADAO COMUM;S;;SANTA CECILIA;BH;601002.03;787950.46;5565
-5567;2001300195;B03000;AMEACA;RUA QUINANTE;350;57234;3/6/2001 16:56:00;CIDADAO COMUM;N;;MINASCAIXA;BH;609756.82;808965.48;5566
-5568;2001300228;B06000;LESAO CORPORAL;RUA SAO JOAO BAT;93;62824;3/6/2001 17:13:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605813.84;808139.15;5567
-5569;2001300229;B04001;HOMICIDIO TENTAD;RUA GAMA CERQUEI;1117;30564;3/6/2001 17:09:00;INICIATIVA;S;0;JARDIM AMERICA;BH;607837.58;794041.01;5568
-5570;2001300243;B03000;AMEACA;RUA ESTRELA DO S;226;26718;3/6/2001 17:27:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;613340.29;797293.43;5569
-5571;2001300251;B03000;AMEACA;RUA MARIA;27;43737;3/6/2001 17:29:00;CIDADAO COMUM;S;0;VILA MARAVILHAS;BH;603342.50;795417.91;5570
-5572;2001300280;B06000;LESAO CORPORAL;RUA PARANOA;94;27521;3/6/2001 17:46:00;CIDADAO COMUM;S;;CH CELSO MACHADO;BH;603709.56;801171.39;5571
-5573;2001300307;B03000;AMEACA;RUA NATAL;166;47306;3/6/2001 17:57:00;CIDADAO COMUM;N;AP10;SANTO ANDRE;BH;609468.39;799440.41;5572
-5574;2001300310;B06000;LESAO CORPORAL;RUA GASPAR DE LE;45;119720;3/6/2001 17:58:00;INICIATIVA;S;0;VERA CRUZ;BH;616869.52;797183.90;5573
-5575;2001300364;B06000;LESAO CORPORAL;RUA IBIAPABA;389;33837;3/6/2001 18:23:00;CIDADAO COMUM;N;0;VILA IPIRANGA;BH;604922.07;789751.90;5574
-5576;2001300383;B06000;LESAO CORPORAL;RUA PARA DE MINA;10;52070;3/6/2001 18:32:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;606706.69;797678.03;5575
-5577;2001300388;B03000;AMEACA;RUA GERALDO FERR;1510;41007;3/6/2001 18:33:00;CIDADAO COMUM;N;CAF;JARDIM VITORIA;BH;617152.34;804043.58;5576
-5578;2001300394;B06000;LESAO CORPORAL;RUA CONCEICAO CH;27;20387;3/6/2001 18:36:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608844.59;808153.20;5577
-5579;2001300430;B06000;LESAO CORPORAL;RUA APERE;389;5020;3/6/2001 18:52:00;CIDADAO COMUM;0;0;SAO GERALDO;BH;615435.75;799736.04;5578
-5580;2001300432;B06000;LESAO CORPORAL;AV AMAZONAS;6000;3140;3/6/2001 18:53:00;POLICIAL MILITAR;S;0;GAMELEIRA;BH;606048.05;795827.62;5579
-5581;2001300451;B04001;HOMICIDIO TENTAD;BECO OPALA;75;300769;3/6/2001 19:00:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;608739.85;797746.86;5580
-5582;2001300466;B03000;AMEACA;RUA MOTOQUEIRO L;26;69505;3/6/2001 19:05:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611770.40;806402.82;5581
-5583;2001300472;B03000;AMEACA;RUA MONTE SIMPLO;300;46574;3/6/2001 19:07:00;MILITARES DAS FO;S;;NOVA SUISSA;BH;606574.34;795868.64;5582
-5584;2001300493;B06000;LESAO CORPORAL;AV DOS CLARINS;54;118337;3/6/2001 19:16:00;CIDADAO COMUM;S;;CH CALIFORNIA;BH;604017.86;796719.43;5583
-5585;2001300517;B06000;LESAO CORPORAL;AV PRESIDENTE AN;3330;4461;3/6/2001 19:30:00;INICIATIVA;S;0;CACHOEIRINHA;BH;609917.41;801202.78;5584
-5586;2001300521;B06000;LESAO CORPORAL;AV ANTONIO ABRAH;1000;4320;3/6/2001 19:32:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;5585
-5587;2001300524;B06000;LESAO CORPORAL;AV PARANA;42;52230;3/6/2001 19:33:00;INICIATIVA;N;0;CENTRO (BH);BH;610805.41;797476.32;5586
-5588;2001300530;B03000;AMEACA;RUA FLOR DA SEIV;120;28739;3/6/2001 19:38:00;CIDADAO COMUM;S;LJA;JARDIM MONTANHES;BH;606072.83;799591.68;5587
-5589;2001300632;B06000;LESAO CORPORAL;RUA CINQUENTA E ;187;33736;3/6/2001 20:35:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612647.11;806904.94;5588
-5590;2001300686;B06000;LESAO CORPORAL;RUA MARIA BEATRI;76;43881;3/6/2001 21:06:00;CIDADAO COMUM;S;;HAVAI;BH;606696.13;793615.49;5589
-5591;2001300722;B06000;LESAO CORPORAL;BECO SAO SEBASTI;80;93470;3/6/2001 21:25:00;CIDADAO COMUM;S;CAFRENT;DOZE DE OUTUBRO;BH;606084.20;790709.65;5590
-5592;2001300797;B06000;LESAO CORPORAL;RUA IPE CLARO;300;124440;3/6/2001 22:13:00;INICIATIVA;N;0;ETELVINA CARNEIR;BH;611601.13;808955.15;5591
-5593;2001300817;B03000;AMEACA;RUA SAO PAULO;1031;63464;3/6/2001 22:25:00;INICIATIVA;S;0;CENTRO BH;BH;610900.59;796770.40;5592
-5594;2001300873;B05000;SEQUESTRO E CARC;RUA LAUDELINA CA;295;15594;3/6/2001 22:47:00;INICIATIVA;N;0;BRAUNAS;BH;604477.36;805759.23;5593
-5595;2001300876;B06000;LESAO CORPORAL;PRACA RUI BARBOS;50;59558;3/6/2001 22:50:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611488.17;797485.82;5594
-5596;2001300956;B03000;AMEACA;RUA NELSON HUNGR;10;46634;3/6/2001 23:29:00;CIDADAO COMUM;N;;TUPI;BH;612851.92;806239.44;5595
-5597;2001300966;B06000;LESAO CORPORAL;RUA PIO XI;560;53927;3/6/2001 23:40:00;INICIATIVA;S;0;IPIRANGA;BH;612058.97;800797.20;5596
-5598;2001301005;B06000;LESAO CORPORAL;RUA POMBA;405;57464;4/6/2001 00:04:00;CIDADAO COMUM;N;;GOIANIA;BH;615455.09;803054.45;5597
-5599;2001301078;B04001;HOMICIDIO TENTAD;RUA CONCEICAO DE;479;16515;4/6/2001 00:56:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605887.75;807297.08;5598
-5600;2001301123;B03000;AMEACA;RUA ANTERO DE QU;405;4298;4/6/2001 01:44:00;CIDADAO COMUM;N;;SANTA BRANCA;BH;608270.89;806423.86;5599
-5601;2001301146;B04002;HOMICIDIO CONSUM;AV AMERICO VESPU;667;3355;4/6/2001 02:14:00;INICIATIVA;N;0;ERMELINDA;BH;609288.35;800370.16;5600
-5602;2001301308;B03000;AMEACA;RUA FLOR DA AMEI;263;77539;4/6/2001 07:31:00;CIDADAO COMUM;S;;JARDIM ALVORADA;BH;606349.66;800027.37;5601
-5603;2001301331;B06000;LESAO CORPORAL;AV OLEGARIO MACI;103;49699;4/6/2001 07:58:00;INICIATIVA;N;0;CENTRO (BH);BH;610681.26;797548.71;5602
-5604;2001301509;B03000;AMEACA;RUA CARMO DA CAC;10;13659;4/6/2001 09:58:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606146.59;794290.29;5603
-5605;2001301637;B03000;AMEACA;RUA VENEZUELA;643;71460;4/6/2001 11:22:00;INICIATIVA;N;0;SION;BH;611300.07;793371.41;5604
-5606;2001301647;B03000;AMEACA;RUA LADAINHA;45;40118;4/6/2001 11:33:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612013.16;803584.39;5605
-5607;2001301650;B04001;HOMICIDIO TENTAD;RUA CURRAL DEL R;194;19122;4/6/2001 11:33:00;CIDADAO COMUM;S;;CABANA;BH;604750.80;793811.34;5606
-5608;2001301663;B06000;LESAO CORPORAL;RUA MUNIZ;83;170850;4/6/2001 11:45:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608088.74;793990.65;5607
-5609;2001301677;B06000;LESAO CORPORAL;RUA ERNESTO GAZZ;110;99117;4/6/2001 11:57:00;CIDADAO COMUM;N;;CEU AZUL;BH;605033.43;808548.91;5608
-5610;2001301688;B03000;AMEACA;RUA CONSELHEIRO ;375;17041;4/6/2001 12:00:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612564.61;798267.52;5609
-5611;2001301723;B03000;AMEACA;RUA ARAPE;26;29798;4/6/2001 12:32:00;CIDADAO COMUM;S;26A;UNIAO;BH;612951.72;801000.18;5610
-5612;2001301746;B03000;AMEACA;RUA AQUILES LOBO;12;5219;4/6/2001 12:51:00;CIDADAO COMUM;S;;FLORESTA;BH;612358.94;797328.31;5611
-5613;2001301759;B06000;LESAO CORPORAL;RUA VILA REAL;87;60683;4/6/2001 13:03:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609915.68;801999.03;5612
-5614;2001301793;B06000;LESAO CORPORAL;AV AMAZONAS;2267;3140;4/6/2001 13:33:00;INICIATIVA;N;INICIATIVA POV5.;BARRO PRETO;BH;609538.15;796202.90;5613
-5615;2001301844;B04001;HOMICIDIO TENTAD;RUA ONZE DE NOVE;56;81054;4/6/2001 14:10:00;INICIATIVA;S;0;LEONINA;BH;608376.82;793204.43;5614
-5616;2001301853;B06000;LESAO CORPORAL;RUA DO CALVARIO;258;11700;4/6/2001 14:16:00;CIDADAO COMUM;N;CSA;SAO MARCOS;BH;613836.82;802510.54;5615
-5617;2001301864;B03000;AMEACA;RUA STA JOSEFINA;821;60803;4/6/2001 14:20:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608530.91;800871.09;5616
-5618;2001301885;B06000;LESAO CORPORAL;RUA FLOR DE ABRI;5;28464;4/6/2001 14:38:00;CIDADAO COMUM;S;0;JARDIM MONTANHES;BH;606020.27;798873.31;5617
-5619;2001301937;B06000;LESAO CORPORAL;AV PRESIDENTE AN;4013;4461;4/6/2001 15:13:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609536.57;802154.10;5618
-5620;2001301938;B06000;LESAO CORPORAL;RUA BIMBARRA;343;9641;4/6/2001 15:13:00;CIDADAO COMUM;N;CAA;CALAFATE;BH;607141.45;796609.73;5619
-5621;2001301987;B06000;LESAO CORPORAL;RUA COSTA JUNIOR;119;18321;4/6/2001 15:41:00;CIDADAO COMUM;S;0;NOVA CACHOEIRINH;BH;609688.67;801513.50;5620
-5622;2001302005;B06000;LESAO CORPORAL;RUA CAPELINHA;20;300406;4/6/2001 15:52:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610483.17;793376.89;5621
-5623;2001302121;B06000;LESAO CORPORAL;AV AMAZONAS;1735;3140;4/6/2001 16:58:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;610011.95;796485.92;5622
-5624;2001302139;B03000;AMEACA;AV WALDOMIRO LOB;1560;66548;4/6/2001 17:06:00;CIDADAO COMUM;N;0;GUARANI;BH;612066.64;805250.22;5623
-5625;2001302180;B03000;AMEACA;RUA WALESKA DE S;90;107954;4/6/2001 17:28:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606465.56;811841.30;5624
-5626;2001302284;B03000;AMEACA;RUA DOS GUAJAJAR;2127;32037;4/6/2001 18:20:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;609531.05;796845.76;5625
-5627;2001302375;B06000;LESAO CORPORAL;RUA AROEIRA DO S;105;105757;4/6/2001 19:02:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615836.12;805770.66;5626
-5628;2001302503;B03000;AMEACA;RUA PLINIO TEIXE;25;98155;4/6/2001 20:08:00;CIDADAO COMUM;N;CA5;DOM SILVERIO;BH;615278.38;804834.14;5627
-5629;2001302525;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;4/6/2001 20:21:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;5628
-5630;2001302590;B03000;AMEACA;AV AMERICO VESPU;990;3355;4/6/2001 21:00:00;CIDADAO COMUM;S;0;APARECIDA;BH;609042.75;800120.55;5629
-5631;2001302630;B03000;AMEACA;AV A;455;34099;4/6/2001 21:24:00;CIDADAO COMUM;N;CAFR;CONJUNTO FELICID;BH;612533.56;807079.22;5630
-5632;2001302726;B03000;AMEACA;AV A;84;302850;4/6/2001 22:28:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;613873.98;805539.35;5631
-5633;2001302935;B03000;AMEACA;RUA ANTONIO DE A;156;4345;5/6/2001 01:03:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611821.42;794964.79;5632
-5634;2001303015;B04001;HOMICIDIO TENTAD;AV IBIRAPUERA;20;33893;5/6/2001 03:15:00;CIDADAO COMUM;N;0;ITAIPU BH;BH;599290.35;789040.69;5633
-5635;2001303179;B03000;AMEACA;PRACA SILVA GUIM;22;65850;5/6/2001 08:01:00;CIDADAO COMUM;N;0;CARMO;BH;611990.82;794859.98;5634
-5636;2001303214;B06000;LESAO CORPORAL;RUA MARCOS DONAT;125;99422;5/6/2001 08:18:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614912.51;808004.53;5635
-5637;2001303354;B03000;AMEACA;RUA GENTIL TEODO;87;66333;5/6/2001 10:02:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;611230.41;801186.56;5636
-5638;2001303385;B06000;LESAO CORPORAL;RUA SAO BORJA;884;61620;5/6/2001 10:20:00;CIDADAO COMUM;N;;BOA VISTA;BH;615470.78;800428.06;5637
-5639;2001303520;B04001;HOMICIDIO TENTAD;RUA CAMILO PRATE;242;11915;5/6/2001 11:48:00;CIDADAO COMUM;N;;UNIAO;BH;613203.18;801235.39;5638
-5640;2001303527;B03000;AMEACA;RUA MARTINHO DE ;80;44985;5/6/2001 11:54:00;CIDADAO COMUM;N;CAA;NOVA CACHOEIRINH;BH;609773.94;801245.03;5639
-5641;2001303654;B03000;AMEACA;RUA ALCIDES LINS;502;1914;5/6/2001 13:28:00;CIDADAO COMUM;0;;VILA SANTO ANTON;BH;609215.72;808481.71;5640
-5642;2001303671;B06000;LESAO CORPORAL;AV URUGUAI;335;71113;5/6/2001 13:39:00;CIDADAO COMUM;N;SALA 14;SION;BH;611750.13;793745.62;5641
-5643;2001303768;B03000;AMEACA;RUA ITAPURA;397;35918;5/6/2001 14:41:00;CIDADAO COMUM;S;CAA;SAUDADE;BH;615292.38;797464.66;5642
-5644;2001303884;B06000;LESAO CORPORAL;RUA FERNANDES TO;1020;81271;5/6/2001 15:46:00;CIDADAO COMUM;S;0;LOURDES;BH;610527.63;795180.24;5643
-5645;2001304089;B04001;HOMICIDIO TENTAD;AV DEL REY;155;35381;5/6/2001 17:42:00;CIDADAO COMUM;N;;CAICARA;BH;608155.87;800189.74;5644
-5646;2001304105;B06000;LESAO CORPORAL;RUA RAINHA DAS F;150;92159;5/6/2001 17:54:00;CIDADAO COMUM;N;0;FILADELFIA;BH;602077.15;797500.80;5645
-5647;2001304131;B03000;AMEACA;AV SEN LEVINDO C;3363;14866;5/6/2001 18:06:00;CIDADAO COMUM;S;LJ;CH VALE DO JATOB;BH;601209.33;786916.79;5646
-5648;2001304139;B06000;LESAO CORPORAL;RUA PARA DE MINA;390;52070;5/6/2001 18:09:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606291.28;797707.27;5647
-5649;2001304248;B06000;LESAO CORPORAL;RUA DOMINGOS VIE;587;22660;5/6/2001 19:02:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612419.49;796795.17;5648
-5650;2001304287;B03000;AMEACA;RUA FRUTAL;379;30060;5/6/2001 19:20:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613747.13;796713.04;5649
-5651;2001304404;B03000;AMEACA;RUA CASA BRANCA;251;13848;5/6/2001 20:22:00;CIDADAO COMUM;S;;POMPEIA;BH;614924.14;798019.77;5650
-5652;2001304472;B04001;HOMICIDIO TENTAD;RUA AMAZONITA;495;3153;5/6/2001 20:58:00;CIDADAO COMUM;S;VITIMA JA SOCORR;POMPEIA;BH;614858.36;797726.26;5651
-5653;2001304477;B06000;LESAO CORPORAL;RUA JEQUIRICA;132;37258;5/6/2001 21:02:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611258.32;799494.73;5652
-5654;2001304478;B06000;LESAO CORPORAL;RUA AGUA COMPRID;63;1508;5/6/2001 21:03:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605882.52;808251.63;5653
-5655;2001304484;B04001;HOMICIDIO TENTAD;RUA PEDRO LESSA;100;53117;5/6/2001 21:09:00;INICIATIVA;S;0;LAGOINHA;BH;610197.53;798760.14;5654
-5656;2001304489;B06000;LESAO CORPORAL;RUA DO CAFE;234;11389;5/6/2001 21:11:00;CIDADAO COMUM;N;;SANTA CRUZ (BARR;BH;603108.90;788912.18;5655
-5657;2001304533;B06000;LESAO CORPORAL;RUA MATO GROSSO;457;45200;5/6/2001 21:39:00;INICIATIVA;S;0;BARRO PRETO;BH;610181.58;796806.67;5656
-5658;2001304575;B04002;HOMICIDIO CONSUM;RUA DEZ DE NOVEM;84;20374;5/6/2001 22:02:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609772.92;805395.37;5657
-5659;2001304582;B03000;AMEACA;AV OTACILIO NEGR;17447;50566;5/6/2001 22:11:00;INICIATIVA;N;0;JARDIM ATLANTICO;BH;607861.37;805251.64;5658
-5660;2001304606;B06000;LESAO CORPORAL;RUA JOAQUIM NABU;122;38121;5/6/2001 22:26:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;606973.16;795764.37;5659
-5661;2001304619;B04002;HOMICIDIO CONSUM;RUA DEPUTADA IVE;100;87325;5/6/2001 22:35:00;CIDADAO COMUM;N;0;PONGELUPE;BH;603758.88;787112.87;5660
-5662;2001304630;B03000;AMEACA;RUA EVORA;136;26950;5/6/2001 22:41:00;CIDADAO COMUM;S;;PRIMAVERA;BH;604493.86;798763.19;5661
-5663;2001304673;B03000;AMEACA;RUA RIBATEJO;112;63058;5/6/2001 23:09:00;CIDADAO COMUM;N;0;SAO FRANCISCO;BH;609796.03;802014.20;5662
-5664;2001304706;B06000;LESAO CORPORAL;AV DO CONTORNO;4470;17228;5/6/2001 23:27:00;CIDADAO COMUM;S;PX50;CENTRO (BH);BH;612554.26;795566.52;5663
-5665;2001304715;B04001;HOMICIDIO TENTAD;RUA DEZESSETE;9;100306;5/6/2001 23:42:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614505.24;802575.32;5664
-5666;2001304796;B03000;AMEACA;RUA VITORIA;5;301511;6/6/2001 00:59:00;INICIATIVA;S;0;SAO LUCAS;BH;613449.25;795834.03;5665
-5667;2001304807;B04001;HOMICIDIO TENTAD;RUA POTOMAIO;658;54920;6/6/2001 01:17:00;INICIATIVA;N;0;SAO GERALDO;BH;615643.99;799123.70;5666
-5668;2001304813;B03000;AMEACA;RUA CAICARA;24;11451;6/6/2001 01:32:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616320.61;799419.93;5667
-5669;2001304818;B03000;AMEACA;RUA CORONEL EGID;415;17690;6/6/2001 01:35:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;614439.06;796945.79;5668
-5670;2001304822;B04001;HOMICIDIO TENTAD;RUA MARIA CARMEM;549;127206;6/6/2001 01:45:00;CIDADAO COMUM;S;BLA     AP304;SANTA EFIGENIA;BH;614141.69;796132.08;5669
-5671;2001304838;B06000;LESAO CORPORAL;AV PRESIDENTE AN;2866;4461;6/6/2001 02:07:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;609879.81;800682.86;5670
-5672;2001305231;B06000;LESAO CORPORAL;RUA HELGA TAVEIR;530;100693;6/6/2001 09:47:00;CIDADAO COMUM;N;0;CEU AZUL;BH;603941.82;807926.54;5671
-5673;2001305240;B03000;AMEACA;RUA PIRANGUINHO;165;54122;6/6/2001 09:52:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616057.71;799113.24;5672
-5674;2001305249;B03000;AMEACA;AV MEM DE SA;1397;45395;6/6/2001 09:55:00;CIDADAO COMUM;N;PX1397;PARAISO;BH;614236.79;796216.14;5673
-5675;2001305267;B03000;AMEACA;RUA TOME DE SOUZ;395;67998;6/6/2001 10:09:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611948.04;795039.05;5674
-5676;2001305270;B03000;AMEACA;AV AFONSO PENA;867;1259;6/6/2001 10:13:00;INICIATIVA;S;0;CENTRO (BH);BH;611254.14;797008.25;5675
-5677;2001305283;B03000;AMEACA;RUA BELMIRO BRAG;1195;8982;6/6/2001 10:18:00;CIDADAO COMUM;S;AP204;ADELAIDE;BH;607026.45;798575.71;5676
-5678;2001305287;B03000;AMEACA;RUA UNIVERSO;680;70961;6/6/2001 10:18:00;CIDADAO COMUM;S;0;COPACABANA;BH;606119.55;806713.20;5677
-5679;2001305446;B03000;AMEACA;AV DO CONTORNO;3219;17228;6/6/2001 11:52:00;INICIATIVA;S;INICIATIVA DO VP;CENTRO (BH);BH;613212.31;796734.16;5678
-5680;2001305554;B03000;AMEACA;RUA DA BAHIA;1596;81155;6/6/2001 13:01:00;CIDADAO COMUM;S;AP202;LOURDES;BH;611120.55;796111.28;5679
-5681;2001305572;B06000;LESAO CORPORAL;AV OLINTO MEIREL;2632;49847;6/6/2001 13:11:00;CIDADAO COMUM;N;0;SANTA CRUZ (BARR;BH;603957.46;789009.43;5680
-5682;2001305579;B06000;LESAO CORPORAL;RUA AGUAS DE LIN;247;40902;6/6/2001 13:18:00;CIDADAO COMUM;N;CAA;ITAIPU BH;BH;599247.70;788871.68;5681
-5683;2001305696;B03000;AMEACA;RUA FRANCISCO LU;71;29514;6/6/2001 14:34:00;CIDADAO COMUM;N;;SANTA CRUZ;BH;610916.00;802176.45;5682
-5684;2001305756;B03000;AMEACA;AV DOM PEDRO II;3337;53145;6/6/2001 15:10:00;CIDADAO COMUM;N;;ADELAIDE;BH;607614.75;797887.86;5683
-5685;2001305843;B03000;AMEACA;RUA ITAPECERICA;685;35757;6/6/2001 15:54:00;CIDADAO COMUM;N;0;LAGOINHA;BH;610477.87;798369.81;5684
-5686;2001305910;B03000;AMEACA;BECO PEDRA VERDE;182;301698;6/6/2001 16:27:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614697.65;795170.79;5685
-5687;2001305994;B03000;AMEACA;AV DO CONTORNO;6777;17228;6/6/2001 17:10:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610892.04;794878.43;5686
-5688;2001306024;B03000;AMEACA;RUA CRAVEIRO LOP;860;18489;6/6/2001 17:24:00;CIDADAO COMUM;N;GALPAO EXPOMINAS;GAMELEIRA;BH;605727.56;796248.05;5687
-5689;2001306033;B02000;RIXA;RUA ALEXANDRE MA;324;52789;6/6/2001 17:30:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;606006.18;793576.28;5688
-5690;2001306195;B06000;LESAO CORPORAL;AV PETIT;740;53551;6/6/2001 18:43:00;CIDADAO COMUM;S;FU;NOVA VISTA;BH;615847.28;800394.38;5689
-5691;2001306308;B06000;LESAO CORPORAL;RUA LOTUS;510;100564;6/6/2001 19:47:00;CIDADAO COMUM;S;;BETANIA;BH;604905.14;792400.97;5690
-5692;2001306315;B06000;LESAO CORPORAL;RUA CAPITAO GUST;312;32598;6/6/2001 19:45:00;CIDADAO COMUM;S;0;ADELAIDE;BH;607626.17;798233.85;5691
-5693;2001306384;B06000;LESAO CORPORAL;RUA IMBIACA;95;34206;6/6/2001 20:24:00;CIDADAO COMUM;S;;DOM CABRAL;BH;604742.86;797020.53;5692
-5694;2001306488;B03000;AMEACA;RUA NIQUELINA;1445;47738;6/6/2001 21:17:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;614355.92;797450.36;5693
-5695;2001306523;B03000;AMEACA;AV JOAO XXIII;287;37926;6/6/2001 21:35:00;CIDADAO COMUM;S;;CONJUNTO ALIPIO ;BH;604398.40;799487.39;5694
-5696;2001306643;B04001;HOMICIDIO TENTAD;RUA CORURIPE;177;18233;6/6/2001 22:50:00;CIDADAO COMUM;S;0;NOVA GRANADA;BH;607718.16;795040.31;5695
-5697;2001306647;B06000;LESAO CORPORAL;RUA SEIS;84;86174;6/6/2001 22:55:00;CIDADAO COMUM;N;CA4;JAQUELINE;BH;611389.70;810027.38;5696
-5698;2001306653;B06000;LESAO CORPORAL;AV CECILIA PINTO;11;14447;6/6/2001 23:00:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610600.26;805253.80;5697
-5699;2001306657;B06000;LESAO CORPORAL;RUA JOAO ALVES T;446;84963;6/6/2001 23:03:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606089.89;810927.39;5698
-5700;2001306660;B06000;LESAO CORPORAL;RUA DAVIDSON PIM;466;124189;6/6/2001 23:04:00;CIDADAO COMUM;S;;TOPAZIO;BH;607497.32;812001.15;5699
-5701;2001306678;B06000;LESAO CORPORAL;RUA CORCOVADO;1614;14894;6/6/2001 23:18:00;INICIATIVA;S;0;SAO DOMINGOS;BH;607706.18;793576.66;5700
-5702;2001306712;B04001;HOMICIDIO TENTAD;RUA GUAICURUS;446;32009;6/6/2001 23:45:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611231.02;797639.92;5701
-5703;2001306720;B06000;LESAO CORPORAL;RUA DAS TABOADAS;124;300190;6/6/2001 23:51:00;CIDADAO COMUM;S;CSB;SAO JOAO BATISTA;BH;608839.98;808049.60;5702
-5704;2001306736;B09000;ABANDONO DE INCA;RUA FREI ZACARIA;376;37610;7/6/2001 00:03:00;CIDADAO COMUM;S;CAA;SARANDI (URCA/BH;BH;603887.13;802202.26;5703
-5705;2001306746;B03000;AMEACA;RUA ALVARES MACI;591;2756;7/6/2001 00:13:00;POLICIAL MILITAR;S;0;SANTA EFIGENIA;BH;612545.42;796667.48;5704
-5706;2001306768;B03000;AMEACA;RUA MAJOR MESSIA;343;115200;7/6/2001 00:29:00;CIDADAO COMUM;N;0;BANDEIRANTES;BH;604713.16;804349.62;5705
-5707;2001306865;B04001;HOMICIDIO TENTAD;RUA MARIA RITA B;163;121934;7/6/2001 02:36:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;602335.41;786241.08;5706
-5708;2001306931;B06000;LESAO CORPORAL;RUA DOS CAETES;409;11376;7/6/2001 05:06:00;CIDADAO COMUM;N;PX409;CENTRO (BH);BH;611212.90;797410.52;5707
-5709;2001306986;B03000;AMEACA;RUA ALAIR PEREIR;325;128873;7/6/2001 07:16:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617363.96;797160.02;5708
-5710;2001307031;B03000;AMEACA;RUA CABO FRIO;250;82031;7/6/2001 07:49:00;CIDADAO COMUM;S;CAA;SAO GABRIEL;BH;614311.41;804741.76;5709
-5711;2001307062;B08000;VIOLACAO DE DOMI;AV JOSE BONIFACI;189;38579;7/6/2001 08:08:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610210.56;798939.37;5710
-5712;2001307250;B06000;LESAO CORPORAL;AV SILVIANO BRAN;444;66002;7/6/2001 10:07:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612009.58;798561.76;5711
-5713;2001307252;B06000;LESAO CORPORAL;RUA ESCRAVO ISID;572;25885;7/6/2001 10:09:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609868.46;799047.90;5712
-5714;2001307268;B06000;LESAO CORPORAL;RUA H;12;78295;7/6/2001 10:27:00;CIDADAO COMUM;S;0;VILA PINHO;BH;601931.42;788161.20;5713
-5715;2001307358;B03000;AMEACA;RUA CONSELHEIRO ;25;17054;7/6/2001 11:27:00;CIDADAO COMUM;N;;ALTO DOS CAICARA;BH;608118.02;799129.56;5714
-5716;2001307564;B03000;AMEACA;RUA GONCALVES DI;1896;31513;7/6/2001 14:09:00;CIDADAO COMUM;N;;LOURDES;BH;610731.97;795987.14;5715
-5717;2001307635;B04001;HOMICIDIO TENTAD;RUA ITAIPU;787;35439;7/6/2001 14:38:00;INICIATIVA;N;0;VERA CRUZ;BH;616254.15;798399.12;5716
-5718;2001307790;B06000;LESAO CORPORAL;RUA OURO PRETO;573;50730;7/6/2001 16:10:00;INICIATIVA;N;0;BARRO PRETO;BH;609882.70;796735.88;5717
-5719;2001307850;B06000;LESAO CORPORAL;RUA AURELIANO MA;107;6845;7/6/2001 16:39:00;CIDADAO COMUM;S;;PARAISO;BH;615050.99;797005.85;5718
-5720;2001307919;B06000;LESAO CORPORAL;RUA DEPUTADO RAI;147;83438;7/6/2001 17:17:00;CIDADAO COMUM;S;;MARIZE;BH;610957.10;807744.36;5719
-5721;2001307955;B06000;LESAO CORPORAL;RUA JOAO SOARES ;23;74111;7/6/2001 17:32:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607768.98;811531.53;5720
-5722;2001308062;B03000;AMEACA;RUA ITAQUERA;843;35920;7/6/2001 18:18:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611598.52;799291.25;5721
-5723;2001308099;B03000;AMEACA;RUA ONZE DE DEZE;110;112687;7/6/2001 18:33:00;CIDADAO COMUM;S;CAA;LEONINA;BH;608758.16;793565.97;5722
-5724;2001308173;B03000;AMEACA;RUA CARMELITA PR;722;17316;7/6/2001 19:05:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606261.79;794694.17;5723
-5725;2001308181;B03000;AMEACA;RUA MANOEL PASSO;450;43160;7/6/2001 19:08:00;CIDADAO COMUM;S;CSA;VILA HUMAITA;BH;610453.77;801846.66;5724
-5726;2001308244;B03000;AMEACA;RUA CUCO;652;90112;7/6/2001 19:33:00;CIDADAO COMUM;S;;GOIANIA;BH;615741.29;803187.70;5725
-5727;2001308250;B03000;AMEACA;AV OLEGARIO MACI;742;49699;7/6/2001 19:36:00;CIDADAO COMUM;S;;LOURDES;BH;610475.34;796973.70;5726
-5728;2001308307;B06000;LESAO CORPORAL;AV OLINTO MEIREL;1500;49847;7/6/2001 20:06:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;603642.11;789991.70;5727
-5729;2001308317;B03000;AMEACA;RUA DR RAUL DE B;9;57956;7/6/2001 20:10:00;INICIATIVA;S;0;CASA BRANCA;BH;616356.49;799755.26;5728
-5730;2001308336;B06000;LESAO CORPORAL;RUA AUGUSTA ANDR;1240;99104;7/6/2001 20:21:00;CIDADAO COMUM;S;REF:PROXIMO FINA;JAQUELINE;BH;611721.24;810630.60;5729
-5731;2001308356;B06000;LESAO CORPORAL;RUA CAMPINA VERD;312;12110;7/6/2001 20:34:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606172.49;794445.71;5730
-5732;2001308400;B03000;AMEACA;RUA NELSON SOARE;235;47463;7/6/2001 20:53:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612344.14;800069.91;5731
-5733;2001308423;B03000;AMEACA;AV ARTUR GUIMARA;1010;6151;7/6/2001 21:05:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610759.65;802050.82;5732
-5734;2001308424;B06000;LESAO CORPORAL;RUA SERRA DOS OR;138;40578;7/6/2001 21:05:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615451.58;807727.88;5733
-5735;2001308484;B03000;AMEACA;RUA JACUI;2722;36734;7/6/2001 21:40:00;CIDADAO COMUM;N;;NOVA FLORESTA;BH;611430.18;800387.15;5734
-5736;2001308533;B06000;LESAO CORPORAL;RUA DAS DRACENAS;427;33461;7/6/2001 22:03:00;CIDADAO COMUM;N;;LINDEIA;BH;598862.48;790625.78;5735
-5737;2001308701;B06000;LESAO CORPORAL;AV A;679;34099;7/6/2001 23:55:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612341.99;807254.84;5736
-5738;2001308802;B03000;AMEACA;RUA AUGUSTUS WIL;321;50090;8/6/2001 01:14:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;607670.65;806516.20;5737
-5739;2001308803;B06000;LESAO CORPORAL;RUA JOAO LUIZ DE;360;37765;8/6/2001 01:15:00;CIDADAO COMUM;S;0;NOVA CACHOEIRINH;BH;609312.42;800902.42;5738
-5740;2001308967;B03000;AMEACA;AV PARANA;122;52230;8/6/2001 06:07:00;INICIATIVA;N;0;CENTRO (BH);BH;610785.23;797422.18;5739
-5741;2001309085;B03000;AMEACA;RUA CACHOEIRA DO;328;11234;8/6/2001 08:10:00;POLICIAL CIVIL;N;0;SANTA EFIGENIA;BH;614546.78;797375.65;5740
-5742;2001309250;B03000;AMEACA;AV URUGUAI;335;71113;8/6/2001 09:38:00;CIDADAO COMUM;S;SL14;SION;BH;611750.13;793745.62;5741
-5743;2001309509;B06000;LESAO CORPORAL;AV ERICO VERISSI;777;41671;8/6/2001 12:12:00;INICIATIVA;N;0;CANDELARIA;BH;607923.53;808663.31;5742
-5744;2001309569;B06000;LESAO CORPORAL;RUA AMANDA;350;91317;8/6/2001 12:53:00;CIDADAO COMUM;N;;CONJUNTO VISTA A;BH;605638.25;792913.17;5743
-5745;2001309636;B03000;AMEACA;RUA CARAVELAS;191;13141;8/6/2001 13:39:00;CIDADAO COMUM;S;CA1;VERA CRUZ;BH;615541.02;798435.24;5744
-5746;2001309686;B06000;LESAO CORPORAL;RUA GUAICURUS;451;32009;8/6/2001 14:14:00;CIDADAO COMUM;N;PX428;CENTRO (BH);BH;611210.22;797600.57;5745
-5747;2001309744;B03000;AMEACA;BECO PRIMEIRO DE;75;302438;8/6/2001 14:51:00;INICIATIVA;S;0;MANTIQUEIRA;BH;607062.15;811576.33;5746
-5748;2001309976;B03000;AMEACA;RUA BARBOSA;39;51178;8/6/2001 17:00:00;CIDADAO COMUM;N;0;COQUEIROS;BH;603046.78;799686.07;5747
-5749;2001309980;B06000;LESAO CORPORAL;RUA PONTE NOVA;888;54655;8/6/2001 17:03:00;CIDADAO COMUM;N;;FLORESTA;BH;611744.63;798218.29;5748
-5750;2001310074;B03000;AMEACA;RUA DOS GOITACAZ;771;31400;8/6/2001 18:01:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610520.96;796873.90;5749
-5751;2001310083;B03000;AMEACA;RUA JACUI;2722;36734;8/6/2001 18:04:00;CIDADAO COMUM;N;CASA 08;NOVA FLORESTA;BH;611430.18;800387.15;5750
-5752;2001310141;B06000;LESAO CORPORAL;RUA I;295;41454;8/6/2001 18:34:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602797.84;802986.83;5751
-5753;2001310154;B06000;LESAO CORPORAL;RUA PROFESSOR MA;697;42498;8/6/2001 18:39:00;CIDADAO COMUM;S;CJ901;LIBERDADE;BH;609041.43;803974.87;5752
-5754;2001310310;B06000;LESAO CORPORAL;RUA DES SARAIVA;1075;66535;8/6/2001 20:03:00;CIDADAO COMUM;S;CS1;VERA CRUZ;BH;616101.45;797681.72;5753
-5755;2001310334;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;8/6/2001 20:18:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;5754
-5756;2001310337;B04002;HOMICIDIO CONSUM;AV OTACILIO NEGR;17676;50566;8/6/2001 20:18:00;CIDADAO COMUM;N;0;JARDIM ATLANTICO;BH;607848.71;805488.96;5755
-5757;2001310355;B03000;AMEACA;RUA CARLOS PINTO;325;107220;8/6/2001 20:32:00;CIDADAO COMUM;S;;CH JATOBA IV;BH;600627.32;787544.42;5756
-5758;2001310454;B03000;AMEACA;RUA RAIMUNDO TIN;50;301229;8/6/2001 21:29:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610762.74;793311.54;5757
-5759;2001310655;B04001;HOMICIDIO TENTAD;RUA POUSO ALEGRE;94;54932;8/6/2001 23:15:00;CIDADAO COMUM;S;0;FLORESTA;BH;611136.07;797991.21;5758
-5760;2001310678;B04001;HOMICIDIO TENTAD;ESTRADA DO CERCA;1035;26428;8/6/2001 23:29:00;INICIATIVA;0;0;JARDIM AMERICA;BH;607094.07;794616.79;5759
-5761;2001310683;B03000;AMEACA;RUA RENATO GONCA;31;14475;8/6/2001 23:32:00;CIDADAO COMUM;S;0;DOM JOAQUIM;BH;613661.46;801938.79;5760
-5762;2001310706;B06000;LESAO CORPORAL;RUA BRUGES;190;86694;8/6/2001 23:44:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;608594.89;810230.41;5761
-5763;2001310715;B06000;LESAO CORPORAL;RUA FRANCISCO BI;2370;29353;8/6/2001 23:51:00;INICIATIVA;S;;ADELAIDE;BH;607087.54;798984.64;5762
-5764;2001310746;B04001;HOMICIDIO TENTAD;RUA FERNAO DIAS;771;28133;9/6/2001 00:07:00;INICIATIVA;S;INICIATIVA DO HT;CAETANO FURQUIM;BH;615918.16;799039.80;5763
-5765;2001310802;B06000;LESAO CORPORAL;AV PRESIDENTE AN;191;4461;9/6/2001 00:43:00;POLICIAL MILITAR;S;;LAGOINHA;BH;610755.18;798205.83;5764
-5766;2001310805;B04001;HOMICIDIO TENTAD;RUA TREZE DE SET;180;69168;9/6/2001 00:43:00;CIDADAO COMUM;N;REF:FINAL 9202;LEONINA;BH;608442.23;793344.13;5765
-5767;2001310871;B04002;HOMICIDIO CONSUM;RUA QUELUZITA;12;40915;9/6/2001 01:32:00;CIDADAO COMUM;N;0;SAO PAULO;BH;612785.37;802514.84;5766
-5768;2001310879;B06000;LESAO CORPORAL;RUA ARIOLINO ARI;159;85811;9/6/2001 01:38:00;CIDADAO COMUM;N;;SERRA VERDE;BH;609207.39;810119.05;5767
-5769;2001310902;B03000;AMEACA;RUA RIO DE JANEI;842;58772;9/6/2001 01:55:00;CIDADAO COMUM;S;FR842;CENTRO (BH);BH;611039.08;796883.84;5768
-5770;2001310942;B04002;HOMICIDIO CONSUM;RUA TRES MARIAS;32;68833;9/6/2001 02:26:00;CIDADAO COMUM;N;0;SANTA CRUZ (BARR;BH;603509.09;788918.41;5769
-5771;2001310981;B06000;LESAO CORPORAL;RUA DOS GUAJAJAR;1022;32037;9/6/2001 02:53:00;INICIATIVA;S;INICIATIVA POV6.;CENTRO BH;BH;610486.05;796628.40;5770
-5772;2001310986;B03000;AMEACA;RUA QUARENTA E U;102;34801;9/6/2001 02:58:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612521.64;807196.19;5771
-5773;2001311035;B06000;LESAO CORPORAL;RUA ALMIRANTE AL;700;2494;9/6/2001 03:46:00;INICIATIVA;S;0;GUTIERREZ;BH;609108.08;795079.04;5772
-5774;2001311042;B06000;LESAO CORPORAL;RUA DAS PRINCESA;367;55330;9/6/2001 03:50:00;CIDADAO COMUM;S;;VILA OESTE;BH;603936.55;795087.90;5773
-5775;2001311043;B06000;LESAO CORPORAL;RUA SERGIPE;1221;64961;9/6/2001 03:50:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611202.39;795153.85;5774
-5776;2001311055;B03000;AMEACA;RUA ESPIRITO SAN;946;26052;9/6/2001 04:01:00;CIDADAO COMUM;S;AP301;CENTRO (BH);BH;611138.96;796746.01;5775
-5777;2001311072;B06000;LESAO CORPORAL;AV JEQUITINHONHA;231;37305;9/6/2001 04:15:00;INICIATIVA;N;0;VERA CRUZ;BH;615747.31;798399.78;5776
-5778;2001311117;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;3929;17095;9/6/2001 05:02:00;INICIATIVA;N;0;SAGRADA FAMILIA;BH;613749.08;798435.50;5777
-5779;2001311135;B06000;LESAO CORPORAL;AV DOS ANDRADAS;364;3761;9/6/2001 05:23:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611480.30;797265.49;5778
-5780;2001311248;B02000;RIXA;RUA PADRE PEDRO ;2630;51657;9/6/2001 08:06:00;CIDADAO COMUM;S;;JARDIM EUROPA;BH;607686.72;809797.55;5779
-5781;2001311338;B04001;HOMICIDIO TENTAD;RUA JEQUIRICA;357;37258;9/6/2001 09:03:00;CIDADAO COMUM;N;CAC;CONCORDIA;BH;611192.98;799637.47;5780
-5782;2001311399;B03000;AMEACA;RUA SAO LAZARO;70;63219;9/6/2001 09:51:00;CIDADAO COMUM;S;FUNDOS;SAGRADA FAMILIA;BH;612389.37;798744.88;5781
-5783;2001311455;B03000;AMEACA;RUA OTAVIANO PEN;549;128454;9/6/2001 10:31:00;CIDADAO COMUM;S;0;SERRA VERDE;BH;609655.77;810567.19;5782
-5784;2001311507;B06000;LESAO CORPORAL;RUA JACUI;487;36734;9/6/2001 11:10:00;CIDADAO COMUM;N;0;FLORESTA;BH;611774.16;798289.34;5783
-5785;2001311529;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;345;6731;9/6/2001 11:26:00;INICIATIVA;N;0;CENTRO (BH);BH;611069.26;796574.94;5784
-5786;2001311536;B06000;LESAO CORPORAL;AV VILARINHOS;2640;109988;9/6/2001 11:30:00;CIDADAO COMUM;S;;JARDIM EUROPA;BH;607859.01;809852.86;5785
-5787;2001311570;B06000;LESAO CORPORAL;RUA DEZESSETE;291;32862;9/6/2001 11:56:00;CIDADAO COMUM;N;CAA;CONJUNTO FELICID;BH;612252.68;807568.31;5786
-5788;2001311574;B06000;LESAO CORPORAL;RUA EXPEDITO RIB;406;41467;9/6/2001 11:58:00;CIDADAO COMUM;S;;VILA SUZANA;BH;611755.26;803117.98;5787
-5789;2001311597;B03000;AMEACA;AV NOSSA SENHORA;316;48311;9/6/2001 12:14:00;CIDADAO COMUM;S;0;PRIMEIRO DE NOVE;BH;612821.93;805191.13;5788
-5790;2001311689;B06000;LESAO CORPORAL;RUA PARA DE MINA;275;52070;9/6/2001 13:21:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606411.19;797635.97;5789
-5791;2001311721;B03000;AMEACA;AV AMERICO VESPU;954;3355;9/6/2001 13:37:00;CIDADAO COMUM;S;CAA;APARECIDA;BH;609067.36;800150.52;5790
-5792;2001311724;B03000;AMEACA;RUA DES BARCELOS;450;19904;9/6/2001 13:39:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;607399.05;796128.14;5791
-5793;2001311814;B03000;AMEACA;AV CRISTIANO MAC;2000;18652;9/6/2001 14:43:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612196.70;800379.26;5792
-5794;2001311829;B02000;RIXA;RUA AUGUSTO FRAN;300;69230;9/6/2001 14:51:00;CIDADAO COMUM;N;0;SAO JOAO BATISTA;BH;608837.25;807592.10;5793
-5795;2001311830;B06000;LESAO CORPORAL;AV PRESIDENTE TA;746;35366;9/6/2001 14:55:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;605537.23;799893.01;5794
-5796;2001311831;B04001;HOMICIDIO TENTAD;RUA BRAGANCA;2;109092;9/6/2001 14:56:00;CIDADAO COMUM;N;CA02;COQUEIROS;BH;602175.97;799441.69;5795
-5797;2001311853;B03000;AMEACA;RUA ALCIDES PERE;236;107711;9/6/2001 15:06:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606777.90;811900.92;5796
-5798;2001311954;B03000;AMEACA;RUA KIMBERLITA;201;57190;9/6/2001 16:07:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;613732.10;797577.05;5797
-5799;2001311969;B06000;LESAO CORPORAL;RUA JUIZ ELYSEU ;285;62588;9/6/2001 16:14:00;CIDADAO COMUM;S;0;DAS INDUSTRIAS;BH;603441.90;792866.98;5798
-5800;2001311977;B03000;AMEACA;RUA SAO LAZARO;70;63219;9/6/2001 16:17:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;612389.37;798744.88;5799
-5801;2001312028;B06000;LESAO CORPORAL;RUA PROFESSOR ZI;317;55718;9/6/2001 16:46:00;CIDADAO COMUM;N;;MINAS BRASIL;BH;605757.79;797222.69;5800
-5802;2001312052;B06000;LESAO CORPORAL;RUA GUARAREMA;65;111010;9/6/2001 17:04:00;CIDADAO COMUM;N;CAA;CACHOEIRINHA;BH;610247.41;801060.78;5801
-5803;2001312055;B06000;LESAO CORPORAL;RUA FARMACEUTICO;16;61733;9/6/2001 17:06:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605821.57;793571.67;5802
-5804;2001312057;B03000;AMEACA;RUA CARLOS DE LA;46;13371;9/6/2001 17:06:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;607983.09;807505.27;5803
-5805;2001312076;B06000;LESAO CORPORAL;RUA ESCRITOR HUM;9;129659;9/6/2001 17:14:00;CIDADAO COMUM;N;;TUPI;BH;613614.95;806792.88;5804
-5806;2001312081;B06000;LESAO CORPORAL;AV PRESIDENTE AN;7267;4461;9/6/2001 17:18:00;CIDADAO COMUM;N;;LIBERDADE;BH;608919.61;803884.14;5805
-5807;2001312151;B03000;AMEACA;RUA CARMELA ALUO;259;13558;9/6/2001 17:57:00;CIDADAO COMUM;N;0;BONSUCESSO;BH;605218.59;789645.48;5806
-5808;2001312184;B03000;AMEACA;RUA PONTA GROSSA;200;14900;9/6/2001 18:10:00;CIDADAO COMUM;N;0;ARAGUAIA;BH;604860.92;789716.01;5807
-5809;2001312219;B03000;AMEACA;RUA CASTRO ALVES;232;14103;9/6/2001 18:28:00;CIDADAO COMUM;N;A;COPACABANA;BH;605790.25;806502.86;5808
-5810;2001312285;B06000;LESAO CORPORAL;AV DOS JARDINS;409;117290;9/6/2001 19:05:00;CIDADAO COMUM;N;;LINDEIA;BH;599962.61;790648.30;5809
-5811;2001312309;B03000;AMEACA;RUA PALESTINA;50;51861;9/6/2001 19:15:00;CIDADAO COMUM;S;;SAO SALVADOR;BH;603317.09;799323.41;5810
-5812;2001312310;B06000;LESAO CORPORAL;RUA LUCIA MIGUEL;383;41555;9/6/2001 19:15:00;POLICIAL MILITAR;S;0;TUPI;BH;612536.99;806309.34;5811
-5813;2001312365;B06000;LESAO CORPORAL;RUA 18;32;21828;9/6/2001 19:42:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;608204.82;811136.31;5812
-5814;2001312436;B06000;LESAO CORPORAL;RUA STA RITA DUR;759;61270;9/6/2001 20:19:00;CIDADAO COMUM;S;AP201;FUNCIONARIOS;BH;611737.20;795391.37;5813
-5815;2001312482;B04001;HOMICIDIO TENTAD;RUA PROFESSOR CO;284;57310;9/6/2001 20:48:00;POLICIAL MILITAR;S;;PLANALTO;BH;609325.21;806811.45;5814
-5816;2001312528;B06000;LESAO CORPORAL;RUA CURITIBANOS;837;19107;9/6/2001 21:18:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607514.33;793818.10;5815
-5817;2001312559;B06000;LESAO CORPORAL;AV DO CONTORNO;5602;17228;9/6/2001 21:34:00;CIDADAO COMUM;S;;CARMO;BH;611910.43;794907.67;5816
-5818;2001312574;B03000;AMEACA;RUA ZOROASTRO DE;54;74064;9/6/2001 21:43:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604415.82;797027.21;5817
-5819;2001312602;B06000;LESAO CORPORAL;RUA ARTHUR LUCCH;730;83277;9/6/2001 21:56:00;CIDADAO COMUM;N;0;SANTA HELENA (BH;BH;603564.41;789534.30;5818
-5820;2001312631;B06000;LESAO CORPORAL;RUA LAURA SOARES;240;100867;9/6/2001 22:13:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611217.50;807328.23;5819
-5821;2001312667;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;4000;18652;9/6/2001 22:33:00;INICIATIVA;S;0;DOS PALMARES;BH;612434.91;802092.92;5820
-5822;2001312712;B04001;HOMICIDIO TENTAD;RUA ALTINOPOLIS;585;36296;9/6/2001 23:01:00;CIDADAO COMUM;S;;PIRATININGA;BH;605592.82;809341.84;5821
-5823;2001312745;B04001;HOMICIDIO TENTAD;RUA PAPOULA AZUL;51;119774;9/6/2001 23:21:00;CIDADAO COMUM;S;;HAVAI;BH;606864.21;793618.62;5822
-5824;2001312792;B04002;HOMICIDIO CONSUM;RUA ANAPURUS;600;20894;9/6/2001 23:48:00;CIDADAO COMUM;N;0;SAO GABRIEL;BH;613458.94;804196.63;5823
-5825;2001312851;B06000;LESAO CORPORAL;RUA CAVAQUINHO;15;301465;10/6/2001 00:31:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614161.77;795395.78;5824
-5826;2001312904;B03000;AMEACA;RUA DINIS DIAS;145;119673;10/6/2001 01:13:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616573.20;797526.82;5825
-5827;2001312925;B06000;LESAO CORPORAL;RUA J;320;47350;10/6/2001 01:26:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601249.95;788553.98;5826
-5828;2001312937;B04001;HOMICIDIO TENTAD;RUA JOSE BARBOSA;197;85304;10/6/2001 01:34:00;CIDADAO COMUM;S;;JAQUELINE;BH;610514.81;810125.87;5827
-5829;2001312972;B06000;LESAO CORPORAL;RUA BETULA;90;9500;10/6/2001 01:53:00;CIDADAO COMUM;N;;ARAGUAIA;BH;604981.38;789649.75;5828
-5830;2001312987;B03000;AMEACA;RUA URSULA PAULI;985;71066;10/6/2001 02:01:00;CIDADAO COMUM;S;;BETANIA;BH;606238.79;793107.91;5829
-5831;2001313063;B04001;HOMICIDIO TENTAD;RUA TIRADENTES;80;85607;10/6/2001 02:53:00;CIDADAO COMUM;S;;ALVORADA;BH;615497.04;802314.39;5830
-5832;2001313122;B04002;HOMICIDIO CONSUM;RUA SAO GERALDO;10;170283;10/6/2001 03:31:00;CIDADAO COMUM;N;0;CABANA;BH;604668.39;794124.46;5831
-5833;2001313145;B03000;AMEACA;RUA DA BAHIA;479;81155;10/6/2001 03:53:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611431.82;797150.49;5832
-5834;2001313165;B06000;LESAO CORPORAL;RUA GUAICURUS;690;32009;10/6/2001 04:08:00;INICIATIVA;N;0;CENTRO BH;BH;611000.88;797693.04;5833
-5835;2001313315;B03000;AMEACA;RUA FRANCISCA LE;212;29441;10/6/2001 07:58:00;INICIATIVA;N;0;UNIAO;BH;613207.57;800943.92;5834
-5836;2001313329;B04001;HOMICIDIO TENTAD;RUA AVELINO DOS ;132;6990;10/6/2001 08:13:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;608938.77;798986.00;5835
-5837;2001313355;B06000;LESAO CORPORAL;RUA JOAO NEPOMUC;83;124176;10/6/2001 08:36:00;INICIATIVA;S;INIC.VP5867;JARDIM DOS COMER;BH;607184.27;811813.31;5836
-5838;2001313365;B04001;HOMICIDIO TENTAD;RUA JOAQUINA ANG;151;84761;10/6/2001 08:47:00;CIDADAO COMUM;N;PANIFICADORA BRA;DA LAGOA;BH;604460.97;809500.24;5837
-5839;2001313408;B06000;LESAO CORPORAL;AV ERICO VERISSI;1001;41671;10/6/2001 09:28:00;CIDADAO COMUM;N;AP301;SANTA MONICA;BH;607738.22;808727.73;5838
-5840;2001313549;B03000;AMEACA;RUA GERALDO RIBE;127;43680;10/6/2001 11:24:00;CIDADAO COMUM;S;CAA;NOVO GLORIA;BH;603097.99;798785.86;5839
-5841;2001313561;B03000;AMEACA;RUA TRES;98;32301;10/6/2001 11:36:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612209.41;807411.82;5840
-5842;2001313598;B03000;AMEACA;RUA FLORESTAL;36;123611;10/6/2001 12:04:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613828.23;799199.35;5841
-5843;2001313650;B03000;AMEACA;AV CORONEL DURVA;860;17688;10/6/2001 12:46:00;CIDADAO COMUM;S;;DURVAL DE BARROS;BH;598151.28;790894.64;5842
-5844;2001313720;B03000;AMEACA;RUA PROFESSOR MA;637;42498;10/6/2001 13:32:00;CIDADAO COMUM;S;;SAO LUIZ;BH;609027.03;804041.57;5843
-5845;2001313735;B03000;AMEACA;RUA RIO DE JANEI;430;58772;10/6/2001 13:43:00;INICIATIVA;N;0;CENTRO (BH);BH;611148.38;797276.61;5844
-5846;2001313791;B04001;HOMICIDIO TENTAD;RUA SEBASTIAO MO;390;93555;10/6/2001 14:36:00;INICIATIVA;S;0;TIROL;BH;600537.35;789420.62;5845
-5847;2001313803;B03000;AMEACA;RUA VIOLETA DE M;430;80253;10/6/2001 14:44:00;CIDADAO COMUM;S;BECO SAO JOAO;SAO JOSE;BH;604587.45;799319.51;5846
-5848;2001313812;B03000;AMEACA;RUA SANTO ANDRE;55;26282;10/6/2001 14:56:00;CIDADAO COMUM;S;CAB;TAQUARIL;BH;617350.27;797630.94;5847
-5849;2001313846;B06000;LESAO CORPORAL;RUA MARCO AURELI;137;61821;10/6/2001 15:15:00;CIDADAO COMUM;S;CAA;NAZARE;BH;615636.15;804705.79;5848
-5850;2001313934;B06000;LESAO CORPORAL;RUA CRUZEIRO DO ;170;18927;10/6/2001 15:57:00;CIDADAO COMUM;N;0;SANTA HELENA (BH;BH;603493.85;789033.21;5849
-5851;2001313947;B03000;AMEACA;RUA WALDEMAR FAL;92;36429;10/6/2001 16:02:00;CIDADAO COMUM;S;0;PLANALTO;BH;610846.65;806603.67;5850
-5852;2001313989;B03000;AMEACA;RUA PURUS;668;55819;10/6/2001 16:22:00;CIDADAO COMUM;S;;CONCORDIA;BH;610705.32;799540.90;5851
-5853;2001313990;B06000;LESAO CORPORAL;RUA GALENA;79;30491;10/6/2001 16:22:00;CIDADAO COMUM;S;AP01;LAGOINHA;BH;611030.10;798682.21;5852
-5854;2001313995;B03000;AMEACA;AV BIAS FORTES;1526;9553;10/6/2001 16:26:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;610343.53;796985.22;5853
-5855;2001314100;B03000;AMEACA;AV AUGUSTO DE LI;1324;6731;10/6/2001 17:16:00;CIDADAO COMUM;S;AP701;BARRO PRETO;BH;610063.55;796892.75;5854
-5856;2001314150;B06000;LESAO CORPORAL;RUA JOVIANO COEL;55;39294;10/6/2001 17:35:00;CIDADAO COMUM;S;;RIO BRANCO;BH;606857.20;808664.47;5855
-5857;2001314246;B04001;HOMICIDIO TENTAD;RUA DOUTOR CRIST;390;55598;10/6/2001 18:19:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604864.19;789415.74;5856
-5858;2001314279;B06000;LESAO CORPORAL;RUA STO ANTONIO;207;61759;10/6/2001 18:36:00;CIDADAO COMUM;S;0;SAO TOMAZ;BH;609983.70;805566.23;5857
-5859;2001314296;B02000;RIXA;RUA CALDAS DA RA;575;61100;10/6/2001 18:46:00;CIDADAO COMUM;N;CAFU;SAO FRANCISCO;BH;609793.95;802422.17;5858
-5860;2001314303;B06000;LESAO CORPORAL;RUA CARMO DA MAT;644;13661;10/6/2001 18:47:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615391.83;797554.64;5859
-5861;2001314331;B03000;AMEACA;AV SILVA LOBO;1035;65889;10/6/2001 19:00:00;INICIATIVA;N;0;NOVA GRANADA;BH;607680.38;795529.41;5860
-5862;2001314355;B06000;LESAO CORPORAL;RUA MARMORE;588;44695;10/6/2001 19:13:00;INICIATIVA;N;0;SANTA TEREZA;BH;613395.01;797414.73;5861
-5863;2001314372;B03000;AMEACA;RUA GERALDO FRAN;45;86060;10/6/2001 19:21:00;CIDADAO COMUM;S;;JAQUELINE;BH;611229.28;810256.18;5862
-5864;2001314382;B03000;AMEACA;RUA MONTE SIAO;573;46559;10/6/2001 19:25:00;INICIATIVA;N;0;SERRA;BH;613412.29;795061.49;5863
-5865;2001314428;B06000;LESAO CORPORAL;RUA FERNAO DIAS;840;28133;10/6/2001 19:46:00;INICIATIVA;S;0;CAETANO FURQUIM;BH;615877.50;799055.02;5864
-5866;2001314431;B02000;RIXA;RUA EDNA BRANDAO;75;99160;10/6/2001 19:47:00;INICIATIVA;S;0;SANTA AMELIA;BH;606976.14;805701.15;5865
-5867;2001314449;B02000;RIXA;RUA JOSE DE OLIV;72;63161;10/6/2001 19:58:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604164.27;789183.07;5866
-5868;2001314488;B05000;SEQUESTRO E CARC;RUA VERONA;261;71661;10/6/2001 20:12:00;CIDADAO COMUM;S;;BANDEIRANTES;BH;605870.97;803359.12;5867
-5869;2001314508;B06000;LESAO CORPORAL;AV TERESA CRISTI;869;67512;10/6/2001 20:24:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;608268.22;797339.78;5868
-5870;2001314523;B03000;AMEACA;RUA JOSE JACINTO;270;67538;10/6/2001 20:31:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604623.93;791960.37;5869
-5871;2001314617;B06000;LESAO CORPORAL;AV ERICO VERISSI;561;41671;10/6/2001 21:25:00;INICIATIVA;N;0;CANDELARIA;BH;608128.88;808577.02;5870
-5872;2001314649;B03000;AMEACA;RUA ADAMINA;234;993;10/6/2001 21:38:00;CIDADAO COMUM;N;CSA;SANTA TEREZA;BH;613193.20;797342.09;5871
-5873;2001314738;B06000;LESAO CORPORAL;AV PRESIDENTE CA;3001;55125;10/6/2001 22:31:00;CIDADAO COMUM;S;;CAICARA;BH;608178.06;800324.32;5872
-5874;2001314752;B04001;HOMICIDIO TENTAD;RUA SAO FELICISS;51;62373;10/6/2001 22:44:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605772.68;792439.17;5873
-5875;2001314780;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;739;63782;10/6/2001 23:03:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610819.02;793333.13;5874
-5876;2001314795;B03000;AMEACA;RUA NARCISA PERE;90;78720;10/6/2001 23:11:00;CIDADAO COMUM;N;0;CH JATOBA IV;BH;600614.17;787750.61;5875
-5877;2001314946;B04001;HOMICIDIO TENTAD;RUA PADRE PETROL;31;53577;11/6/2001 01:22:00;INICIATIVA;S;0;SAGRADA FAMILIA;BH;612764.71;799184.30;5876
-5878;2001315078;B06000;LESAO CORPORAL;AV AFONSO PENA;398;1259;11/6/2001 05:06:00;CIDADAO COMUM;S;PX398;CENTRO (BH);BH;610976.65;797364.82;5877
-5879;2001315356;B06000;LESAO CORPORAL;RUA NILOPOLIS;50;87441;11/6/2001 09:52:00;INICIATIVA;S;0;PILAR;BH;608050.29;788327.07;5878
-5880;2001315390;B03000;AMEACA;RUA CLARA;31;171840;11/6/2001 10:08:00;CIDADAO COMUM;N;;VILA CEMIG;BH;605580.88;788660.00;5879
-5881;2001315428;B06000;LESAO CORPORAL;RUA PIUMA;413;92855;11/6/2001 10:31:00;CIDADAO COMUM;N;;SAO SALVADOR;BH;602763.71;799950.93;5880
-5882;2001315497;B06000;LESAO CORPORAL;RUA DOS APIACAS;76;5032;11/6/2001 11:20:00;CIDADAO COMUM;S;0;GLORIA;BH;602560.03;798017.10;5881
-5883;2001315634;B03000;AMEACA;RUA MARIA APAREC;77;116849;11/6/2001 13:12:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610181.84;802182.01;5882
-5884;2001315672;B03000;AMEACA;RUA MARIA APAREC;115;43853;11/6/2001 13:42:00;POLICIAL MILITAR;N;0;SAO MARCOS;BH;613924.81;802705.15;5883
-5885;2001315799;B06000;LESAO CORPORAL;RUA FREI GASPAR;157;29886;11/6/2001 15:14:00;CIDADAO COMUM;S;0;CABANA;BH;604297.25;794201.39;5884
-5886;2001315820;B03000;AMEACA;RUA SEBASTIAO EV;55;100104;11/6/2001 15:29:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614617.98;802826.35;5885
-5887;2001315851;B06000;LESAO CORPORAL;RUA HUMBERTO DE ;581;33590;11/6/2001 15:46:00;CIDADAO COMUM;S;;COPACABANA;BH;606089.56;807059.06;5886
-5888;2001316035;B06000;LESAO CORPORAL;RUA CINCO DE JAN;6;119604;11/6/2001 17:24:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616273.08;799779.17;5887
-5889;2001316103;B03000;AMEACA;AV DOM PEDRO II;4155;53145;11/6/2001 17:55:00;CIDADAO COMUM;S;CAFU;PADRE EUSTAQUIO;BH;606790.98;797901.91;5888
-5890;2001316117;B06000;LESAO CORPORAL;RUA BRANDAO;32;10360;11/6/2001 18:03:00;CIDADAO COMUM;S;0;EYMARD;BH;613565.17;803366.01;5889
-5891;2001316141;B06000;LESAO CORPORAL;RUA MARIA AMELIA;520;43812;11/6/2001 18:16:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610736.86;805313.62;5890
-5892;2001316202;B03000;AMEACA;RUA MEDEIA;143;64426;11/6/2001 18:49:00;CIDADAO COMUM;S;A;VILA CAPRI;BH;608606.25;809304.68;5891
-5893;2001316277;B06000;LESAO CORPORAL;RUA DA BAHIA;1070;81155;11/6/2001 19:31:00;CIDADAO COMUM;N;MILITAR NO LOCAL;CENTRO (BH);BH;611250.10;796582.72;5892
-5894;2001316315;B04002;HOMICIDIO CONSUM;RUA QUATRO DE MA;26;57118;11/6/2001 19:53:00;CIDADAO COMUM;N;;LEONINA;BH;608650.17;793654.44;5893
-5895;2001316336;B03000;AMEACA;RUA VINTE;163;97140;11/6/2001 20:08:00;CIDADAO COMUM;N;;SAO MARCOS;BH;614596.78;802636.22;5894
-5896;2001316349;B03000;AMEACA;RUA IVO ROCHA;153;36330;11/6/2001 20:19:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606520.91;793061.86;5895
-5897;2001316354;B05000;SEQUESTRO E CARC;RUA LEOPOLDINA;120;40739;11/6/2001 20:22:00;CIDADAO COMUM;S;AP404;SANTO ANTONIO;BH;610885.17;794753.81;5896
-5898;2001316355;B03000;AMEACA;RUA ANA HILBERT;111;3544;11/6/2001 20:16:00;CIDADAO COMUM;S;0;SANTA HELENA (BH;BH;603446.72;790142.99;5897
-5899;2001316371;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;1750;57830;11/6/2001 20:36:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608719.62;793771.09;5898
-5900;2001316421;B03000;AMEACA;RUA DOM LUCIO AN;101;22382;11/6/2001 21:07:00;CIDADAO COMUM;S;0;CORACAO EUCARIST;BH;605436.95;796211.96;5899
-5901;2001316490;B03000;AMEACA;RUA AUGUSTO JOSE;560;6729;11/6/2001 21:55:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605916.80;791810.80;5900
-5902;2001316531;B04001;HOMICIDIO TENTAD;RUA MAJOR DELFIN;2700;42620;11/6/2001 22:22:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;608893.52;801341.34;5901
-5903;2001316541;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;2900;67682;11/6/2001 22:27:00;INICIATIVA;S;0;BARRO PRETO;BH;609912.78;796638.75;5902
-5904;2001316592;B03000;AMEACA;RUA CAMPO DO MEI;55;12177;11/6/2001 23:05:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605703.85;807563.76;5903
-5905;2001316625;B06000;LESAO CORPORAL;RUA BONAPARTE;606;10083;11/6/2001 23:22:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607739.08;797055.95;5904
-5906;2001316644;B06000;LESAO CORPORAL;RUA URSULA PAULI;2465;71066;11/6/2001 23:42:00;INICIATIVA;S;0;CH BONSUCESSO;BH;605460.77;791671.99;5905
-5907;2001316803;B03000;AMEACA;RUA NEFELINA;117;81228;12/6/2001 03:12:00;CIDADAO COMUM;N;;SANTA TEREZA;BH;612835.00;797309.03;5906
-5908;2001316961;B06000;LESAO CORPORAL;RUA PURUS;125;55819;12/6/2001 07:55:00;CIDADAO COMUM;S;BECO DOS CAQUIS ;CONCORDIA;BH;611069.17;799069.41;5907
-5909;2001317004;B03000;AMEACA;RUA RIO POMBA;631;54567;12/6/2001 08:24:00;CIDADAO COMUM;S;CAA;PADRE EUSTAQUIO;BH;607685.08;797757.01;5908
-5910;2001317159;B06000;LESAO CORPORAL;RUA LUIZ CASTANH;773;41697;12/6/2001 09:48:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610661.48;802130.20;5909
-5911;2001317204;B03000;AMEACA;RUA JAIME SALSE;278;36848;12/6/2001 10:18:00;INICIATIVA;S;0;MAGNESITA;BH;604022.14;793879.98;5910
-5912;2001317237;B03000;AMEACA;RUA FRANCA;48;29224;12/6/2001 10:42:00;CIDADAO COMUM;S;BL18    AP09;JARDIM AMERICA;BH;607503.92;794169.65;5911
-5913;2001317308;B06000;LESAO CORPORAL;RUA DOUTOR BENED;1500;12252;12/6/2001 11:25:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;612933.21;804714.67;5912
-5914;2001317393;B06000;LESAO CORPORAL;RUA BELO ORIENTE;850;42923;12/6/2001 12:29:00;CIDADAO COMUM;N;CAFR;PROVIDENCIA;BH;612677.75;804042.59;5913
-5915;2001317467;B03000;AMEACA;AV RAJA GABAGLIA;1710;57830;12/6/2001 13:22:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608719.62;793771.09;5914
-5916;2001317551;B03000;AMEACA;RUA CECILIO EMIG;82;14131;12/6/2001 14:09:00;CIDADAO COMUM;S;REF:IGREJA SANTO;PRIMEIRO DE MAIO;BH;612455.98;803751.51;5915
-5917;2001317569;B06000;LESAO CORPORAL;RUA NOSSA SENHOR;855;48021;12/6/2001 14:22:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610156.25;800645.51;5916
-5918;2001317579;B06000;LESAO CORPORAL;RUA TRES;5;126837;12/6/2001 14:25:00;CIDADAO COMUM;N;;CONJUNTO VISTA A;BH;605113.84;792582.18;5917
-5919;2001317731;B03000;AMEACA;RUA CASTELO DE A;70;124034;12/6/2001 15:53:00;CIDADAO COMUM;N;;CASTELO;BH;605287.78;801402.95;5918
-5920;2001317796;B06000;LESAO CORPORAL;RUA ROGERIO APAR;25;96682;12/6/2001 16:22:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;614926.02;805954.24;5919
-5921;2001318172;B03000;AMEACA;AV NOSSA SENHORA;1700;48107;12/6/2001 20:07:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;610293.44;797814.94;5920
-5922;2001318184;B03000;AMEACA;RUA CAPIVARI;1036;12918;12/6/2001 20:14:00;CIDADAO COMUM;S;;SERRA;BH;613966.21;794792.76;5921
-5923;2001318287;B03000;AMEACA;RUA VINTE E UM;85;122095;12/6/2001 21:21:00;CIDADAO COMUM;N;;JARDIM DOS COMER;BH;607810.43;810991.30;5922
-5924;2001318330;B04001;HOMICIDIO TENTAD;RUA FLOR DO AMEN;89;94910;12/6/2001 21:54:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;605876.71;799791.72;5923
-5925;2001318380;B06000;LESAO CORPORAL;RUA CONTAGEM;1225;70293;12/6/2001 22:28:00;CIDADAO COMUM;S;RESTAURANTE PALA;NOVA VISTA;BH;614534.83;800862.24;5924
-5926;2001318398;B03000;AMEACA;RUA RIACHUELO;501;58527;12/6/2001 22:36:00;CIDADAO COMUM;S;BLA     AP102;CARLOS PRATES;BH;608088.93;797566.54;5925
-5927;2001318418;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;12/6/2001 22:46:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;5926
-5928;2001318481;B03000;AMEACA;RUA BEGONIA;758;8812;12/6/2001 23:22:00;CIDADAO COMUM;S;0;ESPLANADA;BH;615103.97;798724.96;5927
-5929;2001318482;B03000;AMEACA;RUA FLOR DAS PED;360;28801;12/6/2001 23:25:00;CIDADAO COMUM;N;CA;JARDIM MONTANHES;BH;606148.99;799101.27;5928
-5930;2001318500;B03000;AMEACA;RUA MARIA BEATRI;56;43881;12/6/2001 23:36:00;CIDADAO COMUM;S;0;HAVAI;BH;606696.13;793615.49;5929
-5931;2001318514;B02000;RIXA;AV GETULIO VARGA;216;81256;12/6/2001 23:55:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;612417.35;795645.38;5930
-5932;2001318545;B04002;HOMICIDIO CONSUM;RUA B;81;47637;13/6/2001 00:20:00;CIDADAO COMUM;N;0;VILA CASTANHEIRA;BH;601122.18;788570.67;5931
-5933;2001318554;B06000;LESAO CORPORAL;AV PARANA;365;52230;13/6/2001 00:30:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610769.16;797164.79;5932
-5934;2001318593;B06000;LESAO CORPORAL;RUA ENGENHO NOVO;209;25630;13/6/2001 01:07:00;CIDADAO COMUM;S;;POMPEIA;BH;614830.73;797567.55;5933
-5935;2001318600;B06000;LESAO CORPORAL;RUA AURELIANO PI;112;6858;13/6/2001 01:17:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;609016.12;800210.99;5934
-5936;2001319261;B06000;LESAO CORPORAL;RUA GUIMARAES PA;144;87873;13/6/2001 12:34:00;CIDADAO COMUM;S;;VILA OESTE;BH;604338.90;795567.29;5935
-5937;2001319281;B09000;ABANDONO DE INCA;RUA PETRINA ALVE;312;1350;13/6/2001 12:52:00;CIDADAO COMUM;N;;GOIANIA;BH;615082.31;802831.51;5936
-5938;2001319437;B03000;AMEACA;RUA SAO LUIZ;410;63288;13/6/2001 14:39:00;INICIATIVA;S;0;SAO TOMAZ;BH;609850.88;805509.35;5937
-5939;2001319468;B06000;LESAO CORPORAL;RUA CUBATAO;316;84560;13/6/2001 15:05:00;CIDADAO COMUM;S;;RENASCENCA;BH;611087.08;800639.81;5938
-5940;2001319520;B03000;AMEACA;RUA MARIA AMELIA;550;43812;13/6/2001 15:33:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610819.92;805277.80;5939
-5941;2001319533;B06000;LESAO CORPORAL;RUA MARTINHO CAM;25;44972;13/6/2001 15:37:00;CIDADAO COMUM;S;;CRUZEIRO;BH;612259.84;794643.53;5940
-5942;2001319600;B06000;LESAO CORPORAL;RUA JACI NOGUEIR;212;36659;13/6/2001 16:12:00;CIDADAO COMUM;S;;FLORAMAR;BH;611955.57;806101.15;5941
-5943;2001319649;B06000;LESAO CORPORAL;RUA DAVID RABELO;221;19702;13/6/2001 16:44:00;CIDADAO COMUM;N;CAC;INCONFIDENCIA;BH;605006.34;798378.12;5942
-5944;2001319690;B03000;AMEACA;RUA SAO CLEMENTE;196;62197;13/6/2001 17:07:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609647.96;799330.51;5943
-5945;2001319777;B03000;AMEACA;RUA DOS ECONOMIS;612;103272;13/6/2001 17:54:00;INICIATIVA;S;0;CONJUNTO ALIPIO ;BH;604238.00;800485.06;5944
-5946;2001319875;B06000;LESAO CORPORAL;RUA SAO CLEMENTE;147;62197;13/6/2001 18:40:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609623.42;799280.71;5945
-5947;2001319979;B04001;HOMICIDIO TENTAD;RUA EXPEDICIONAR;49;31627;13/6/2001 19:25:00;CIDADAO COMUM;N;;MARIA GORETTI;BH;614368.17;803366.53;5946
-5948;2001320018;B06000;LESAO CORPORAL;RUA MUQUICABA;180;65343;13/6/2001 19:45:00;CIDADAO COMUM;S;;COQUEIROS;BH;602620.44;798332.25;5947
-5949;2001320081;B04001;HOMICIDIO TENTAD;RUA BENEDITO ANI;15;56244;13/6/2001 20:22:00;INICIATIVA;N;0;NOVA YORK;BH;608352.11;810599.17;5948
-5950;2001320155;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;13/6/2001 21:06:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;5949
-5951;2001320160;B04001;HOMICIDIO TENTAD;BECO HELIOTERIO;90;170863;13/6/2001 21:09:00;INICIATIVA;S;0;LEONINA;BH;608285.06;793705.32;5950
-5952;2001320173;B06000;LESAO CORPORAL;AV BALEARES;529;89333;13/6/2001 21:19:00;CIDADAO COMUM;S;;JARDIM EUROPA;BH;608358.52;810091.95;5951
-5953;2001320203;B04002;HOMICIDIO CONSUM;RUA REGENCIA;82;301448;13/6/2001 21:38:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614123.87;795468.74;5952
-5954;2001320297;B06000;LESAO CORPORAL;PRACA RAUL SOARE;441;58010;13/6/2001 22:30:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610514.66;796843.53;5953
-5955;2001320312;B06000;LESAO CORPORAL;AV ELISIO DE BRI;23;25251;13/6/2001 22:42:00;CIDADAO COMUM;S;0;BOA VISTA;BH;614321.28;799654.60;5954
-5956;2001320313;B03000;AMEACA;RUA GIL DE OLIVE;215;112545;13/6/2001 22:42:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604297.85;808055.70;5955
-5957;2001320362;B03000;AMEACA;PRACA CARDEAL AR;46;13182;13/6/2001 23:19:00;INICIATIVA;S;0;NOVA CINTRA;BH;605685.61;793811.72;5956
-5958;2001320418;B03000;AMEACA;RUA SATURNINO FE;58;64108;14/6/2001 00:03:00;CIDADAO COMUM;S;CAB;LETICIA;BH;607664.20;809941.98;5957
-5959;2001320459;B06000;LESAO CORPORAL;AV SINFRONIO BRO;1355;66116;14/6/2001 00:33:00;CIDADAO COMUM;S;0;BARREIRO;BH;602021.17;790667.36;5958
-5960;2001320570;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;1025;26052;14/6/2001 02:12:00;CIDADAO COMUM;N;APTO 703;CENTRO (BH);BH;611153.91;796654.06;5959
-5961;2001320571;B02000;RIXA;RUA PADRE PEDRO ;870;51657;14/6/2001 02:13:00;CIDADAO COMUM;S;0;VENDA NOVA;BH;609186.76;808667.02;5960
-5962;2001320578;B03000;AMEACA;RUA JULIO PEREIR;28;102239;14/6/2001 02:20:00;INICIATIVA;S;0;CIDADE NOVA;BH;612273.13;800429.88;5961
-5963;2001320598;B02000;RIXA;RUA PADRE PEDRO ;870;51657;14/6/2001 02:47:00;CIDADAO COMUM;S;0;VENDA NOVA;BH;609186.76;808667.02;5962
-5964;2001320624;B03000;AMEACA;RUA FLOR DA ROMA;115;23808;14/6/2001 03:07:00;CIDADAO COMUM;S;;VILA IPE;BH;605905.20;799936.77;5963
-5965;2001320666;B06000;LESAO CORPORAL;AV AMAZONAS;333;3140;14/6/2001 03:43:00;INICIATIVA;S;0;CENTRO (BH);BH;611084.15;797100.95;5964
-5966;2001320699;B06000;LESAO CORPORAL;AV DO CONTORNO;1813;17228;14/6/2001 04:21:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;612273.73;797607.09;5965
-5967;2001320702;B06000;LESAO CORPORAL;RUA FERNANDES TO;390;81271;14/6/2001 04:25:00;CIDADAO COMUM;N;0;LOURDES;BH;611239.41;794977.80;5966
-5968;2001320784;B03000;AMEACA;RUA RIO DE JANEI;147;58772;14/6/2001 06:53:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611252.60;797543.60;5967
-5969;2001320796;B03000;AMEACA;RUA FLAVIO MARQU;376;28436;14/6/2001 07:15:00;CIDADAO COMUM;N;;BARREIRO;BH;603097.24;790974.11;5968
-5970;2001320806;B06000;LESAO CORPORAL;RUA LOTUS;385;100564;14/6/2001 07:21:00;CIDADAO COMUM;S;;BETANIA;BH;604933.19;792316.58;5969
-5971;2001320877;B06000;LESAO CORPORAL;RUA BERILO;2;9289;14/6/2001 08:33:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612085.16;803501.30;5970
-5972;2001320944;B03000;AMEACA;RUA LOURENCO VOL;237;97603;14/6/2001 09:26:00;CIDADAO COMUM;S;FR220;DOM SILVERIO;BH;614553.44;804153.08;5971
-5973;2001320965;B03000;AMEACA;AV DO CONTORNO;1277;17228;14/6/2001 09:45:00;INICIATIVA;N;0;BARRO PRETO;BH;611851.77;797784.50;5972
-5974;2001320978;B03000;AMEACA;AV OLINTO MEIREL;2511;49847;14/6/2001 09:55:00;CIDADAO COMUM;N;;ARAGUAIA;BH;603791.58;789431.89;5973
-5975;2001321018;B03000;AMEACA;RUA FREI CONCEIC;1196;29873;14/6/2001 10:22:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604263.93;796522.94;5974
-5976;2001321103;B03000;AMEACA;RUA ANTONIO RODR;480;11537;14/6/2001 11:32:00;CIDADAO COMUM;N;;VENDA NOVA;BH;607247.00;809301.40;5975
-5977;2001321150;B06000;LESAO CORPORAL;RUA CARLOS MARQU;40;84200;14/6/2001 12:10:00;CIDADAO COMUM;N;;COPACABANA;BH;606242.68;805806.40;5976
-5978;2001321196;B06000;LESAO CORPORAL;AV AFONSO VAZ DE;65;1306;14/6/2001 12:44:00;CIDADAO COMUM;N;0;BARREIRO;BH;602931.29;791287.07;5977
-5979;2001321220;B06000;LESAO CORPORAL;RUA POUSO ALEGRE;2522;54932;14/6/2001 13:00:00;CIDADAO COMUM;N;;FLORESTA;BH;613435.30;798084.21;5978
-5980;2001321256;B06000;LESAO CORPORAL;RUA FARADAY;149;27764;14/6/2001 13:29:00;CIDADAO COMUM;N;CSA;PRIMEIRO DE MAIO;BH;612224.89;803549.14;5979
-5981;2001321283;B03000;AMEACA;AV JEQUITINHONHA;347;37305;14/6/2001 13:56:00;CIDADAO COMUM;N;CA1;VERA CRUZ;BH;615765.43;798316.29;5980
-5982;2001321285;B08000;VIOLACAO DE DOMI;RUA NETUNO;58;130021;14/6/2001 13:57:00;CIDADAO COMUM;N;;VILA SATELITE;BH;610007.16;808805.46;5981
-5983;2001321292;B03000;AMEACA;RUA CORONEL BERN;132;89941;14/6/2001 13:59:00;CIDADAO COMUM;S;0;PALMEIRAS;BH;606632.74;791582.00;5982
-5984;2001321331;B02000;RIXA;RUA PINTARROXO;167;95954;14/6/2001 14:28:00;CIDADAO COMUM;S;;GOIANIA;BH;615366.02;802364.10;5983
-5985;2001321333;B03000;AMEACA;RUA JORNALISTA J;192;6470;14/6/2001 14:30:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;606205.43;793698.70;5984
-5986;2001321362;B06000;LESAO CORPORAL;AV COLETORA;580;78241;14/6/2001 14:52:00;CIDADAO COMUM;S;;VILA PINHO;BH;602113.34;788183.02;5985
-5987;2001321427;B03000;AMEACA;RUA PADRE TIAGO ;60;119430;14/6/2001 15:36:00;CIDADAO COMUM;S;APTO 103;VILA MAGNESITA;BH;602516.78;794930.47;5986
-5988;2001321460;B03000;AMEACA;AV OLEGARIO MACI;170;49699;14/6/2001 15:58:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610621.91;797526.25;5987
-5989;2001321476;B03000;AMEACA;RUA BOREAL;56;10184;14/6/2001 16:08:00;CIDADAO COMUM;S;AP301;ADELAIDE;BH;606950.84;798500.09;5988
-5990;2001321512;B04001;HOMICIDIO TENTAD;RUA DIMAS PEREIR;48;107780;14/6/2001 16:33:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606086.92;811647.38;5989
-5991;2001321516;B06000;LESAO CORPORAL;RUA SAO PAULO;157;63464;14/6/2001 16:35:00;INICIATIVA;S;0;CENTRO BH;BH;611124.36;797602.35;5990
-5992;2001321540;B03000;AMEACA;RUA NIQUELINA;1158;47738;14/6/2001 16:57:00;POLICIAL MILITAR;S;0;SANTA EFIGENIA;BH;614131.84;797245.39;5991
-5993;2001321574;B03000;AMEACA;RUA JOSE JACINTO;262;67538;14/6/2001 17:13:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604619.48;791960.34;5992
-5994;2001321616;B04001;HOMICIDIO TENTAD;RUA DELIO VIEIRA;168;23344;14/6/2001 17:36:00;CIDADAO COMUM;S;;GLORIA;BH;603163.67;798723.49;5993
-5995;2001321618;B06000;LESAO CORPORAL;RUA SAO TIAGO;151;21682;14/6/2001 17:38:00;INICIATIVA;N;0;SAO TOMAZ;BH;610186.02;805592.90;5994
-5996;2001321655;B03000;AMEACA;RUA DOS TIMBIRAS;2500;67682;14/6/2001 17:56:00;POLICIAL MILITAR;S;0;SANTO AGOSTINHO;BH;610281.40;796553.09;5995
-5997;2001321670;B03000;AMEACA;RUA NIQUELINA;1158;47738;14/6/2001 18:03:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;614131.84;797245.39;5996
-5998;2001321776;B08000;VIOLACAO DE DOMI;AV DO CONTORNO;12;17228;14/6/2001 18:58:00;INICIATIVA;N;0;CENTRO BH;BH;610893.99;797847.30;5997
-5999;2001321839;B04001;HOMICIDIO TENTAD;RUA CORONEL SEVE;800;18072;14/6/2001 19:18:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604766.76;789755.34;5998
-6000;2001321853;B06000;LESAO CORPORAL;RUA DR JOAO CARV;142;36012;14/6/2001 19:25:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610121.75;798846.43;5999
-6001;2001321886;B06000;LESAO CORPORAL;RUA PARACATU;724;52095;14/6/2001 19:48:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609642.16;796526.05;6000
-6002;2001321943;B06000;LESAO CORPORAL;RUA PSI;16;49991;14/6/2001 20:20:00;CIDADAO COMUM;N;0;CAICARA;BH;608003.95;799396.57;6001
-6003;2001321960;B03000;AMEACA;AV PRESIDENTE CA;3001;55125;14/6/2001 20:29:00;INICIATIVA;S;0;CAICARA;BH;608178.06;800324.32;6002
-6004;2001321976;B03000;AMEACA;RUA PIRANGUINHO;157;54122;14/6/2001 20:42:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616053.38;799126.91;6003
-6005;2001322019;B03000;AMEACA;RUA ANTONIO DE P;158;119254;14/6/2001 21:06:00;CIDADAO COMUM;S;AP301;SERRA VERDE;BH;609376.50;811110.92;6004
-6006;2001322034;B06000;LESAO CORPORAL;AV BIAS FORTES;1770;9553;14/6/2001 21:15:00;INICIATIVA;N;0;BARRO PRETO;BH;610196.72;797244.85;6005
-6007;2001322047;B04002;HOMICIDIO CONSUM;RUA ESPIRITO SAN;361;26052;14/6/2001 21:21:00;INICIATIVA;S;0;CENTRO BH;BH;611326.30;797302.57;6006
-6008;2001322054;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;615;6353;14/6/2001 21:24:00;INICIATIVA;S;0;FLORESTA;BH;611764.60;797160.68;6007
-6009;2001322176;B04002;HOMICIDIO CONSUM;RUA APOLO OITO;345;83797;14/6/2001 22:28:00;CIDADAO COMUM;N;;CH ATILA DE PAIV;BH;601455.09;790798.99;6008
-6010;2001322178;B03000;AMEACA;RUA DAS VIOLAS;805;101670;14/6/2001 22:28:00;CIDADAO COMUM;S;0;VILA CALIFORNIA;BH;603660.18;796896.20;6009
-6011;2001322221;B06000;LESAO CORPORAL;RUA SAO VICENTE;86;88126;14/6/2001 22:48:00;CIDADAO COMUM;S;;GRANJA FREITAS;BH;617022.85;798456.93;6010
-6012;2001322232;B04001;HOMICIDIO TENTAD;AV CORONEL DURVA;38;17688;14/6/2001 22:57:00;CIDADAO COMUM;N;0;DURVAL DE BARROS;BH;598767.92;791083.00;6011
-6013;2001322300;B06000;LESAO CORPORAL;RUA DONA CARMEM;392;22820;14/6/2001 23:28:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603768.76;802208.64;6012
-6014;2001322484;B04002;HOMICIDIO CONSUM;BECO PRINCIPAL;5;301983;15/6/2001 01:47:00;CIDADAO COMUM;N;;SAO JOSE;BH;604808.72;799278.97;6013
-6015;2001322511;B06000;LESAO CORPORAL;RUA LUCIO PETIT ;46;114121;15/6/2001 02:13:00;CIDADAO COMUM;S;;RIO BRANCO;BH;606256.19;808682.91;6014
-6016;2001322522;B03000;AMEACA;RUA FLOR DA VERD;253;28842;15/6/2001 02:23:00;CIDADAO COMUM;N;0;JARDIM ALVORADA;BH;606254.68;799470.06;6015
-6017;2001322576;B06000;LESAO CORPORAL;RUA RIO DE JANEI;462;58772;15/6/2001 03:46:00;CIDADAO COMUM;S;FR;CENTRO (BH);BH;611136.20;797245.88;6016
-6018;2001322607;B03000;AMEACA;RUA GRAJAU;261;31715;15/6/2001 05:13:00;CIDADAO COMUM;N;;ANCHIETA;BH;612355.52;793641.12;6017
-6019;2001322634;B06000;LESAO CORPORAL;AV CRISTIANO MAC;5387;18652;15/6/2001 06:25:00;CIDADAO COMUM;S;;DOS PALMARES;BH;612255.52;802177.46;6018
-6020;2001322638;B03000;AMEACA;RUA FRANCISCO DU;139;46316;15/6/2001 06:39:00;INICIATIVA;N;0;SANTA TEREZINHA;BH;604475.97;802319.26;6019
-6021;2001322803;B06000;LESAO CORPORAL;RUA JOAO SAMAHA;261;7397;15/6/2001 09:09:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608633.12;807211.33;6020
-6022;2001322825;B06000;LESAO CORPORAL;RUA SUASSUI;393;66447;15/6/2001 09:25:00;CIDADAO COMUM;N;CAA;CARLOS PRATES;BH;608993.56;797367.98;6021
-6023;2001322896;B06000;LESAO CORPORAL;AV JEQUITINHONHA;1027;37305;15/6/2001 10:05:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615981.31;797493.07;6022
-6024;2001322955;B03000;AMEACA;RUA PEDRO GLANSM;55;53044;15/6/2001 10:45:00;CIDADAO COMUM;S;0;INDUSTRIAL RODRI;BH;615807.17;808659.59;6023
-6025;2001322993;B03000;AMEACA;RUA ALVARO OLIVE;111;58381;15/6/2001 11:17:00;CIDADAO COMUM;S;;MARIA VIRGINIA;BH;611875.97;802851.94;6024
-6026;2001323021;B03000;AMEACA;RUA LUCIA MIGUEL;140;41555;15/6/2001 11:34:00;CIDADAO COMUM;S;;TUPI;BH;612588.93;806074.09;6025
-6027;2001323029;B06000;LESAO CORPORAL;RUA HILARINO BEN;64;33298;15/6/2001 11:42:00;CIDADAO COMUM;S;;MAGNESITA;BH;604274.73;793891.55;6026
-6028;2001323035;B03000;AMEACA;RUA SOBRAL;404;66232;15/6/2001 11:44:00;CIDADAO COMUM;N;0;SANTA LUCIA;BH;610299.27;792033.67;6027
-6029;2001323057;B03000;AMEACA;BECO FREI MARIAN;120;300767;15/6/2001 12:02:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608761.56;797834.53;6028
-6030;2001323105;B03000;AMEACA;RUA MANAUS;611;42747;15/6/2001 12:42:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;612917.36;796183.64;6029
-6031;2001323106;B04001;HOMICIDIO TENTAD;RUA MANAIRA;10;96235;15/6/2001 12:42:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614046.95;805015.29;6030
-6032;2001323251;B04001;HOMICIDIO TENTAD;AV NOSSA SENHORA;2128;47996;15/6/2001 14:32:00;CIDADAO COMUM;S;0;SAO PEDRO;BH;610842.82;793056.52;6031
-6033;2001323264;B06000;LESAO CORPORAL;AV JEQUITINHONHA;1027;37305;15/6/2001 14:44:00;CIDADAO COMUM;S;CAFU;VERA CRUZ;BH;615981.31;797493.07;6032
-6034;2001323284;B06000;LESAO CORPORAL;AV BIAS FORTES;1836;9553;15/6/2001 15:00:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;610196.72;797244.85;6033
-6035;2001323290;B06000;LESAO CORPORAL;RUA DOS EXPEDICI;59;26989;15/6/2001 15:03:00;CIDADAO COMUM;S;CA;SANTA AMELIA;BH;606863.60;806683.97;6034
-6036;2001323304;B03000;AMEACA;RUA MARIA ROSA D;599;107800;15/6/2001 15:12:00;CIDADAO COMUM;N;CSA;MANTIQUEIRA;BH;606348.34;811601.38;6035
-6037;2001323321;B03000;AMEACA;RUA TIJUCA;77;67667;15/6/2001 15:21:00;CIDADAO COMUM;S;0;LEBLON;BH;605675.09;809917.57;6036
-6038;2001323483;B06000;LESAO CORPORAL;RUA RIO PETROPOL;276;91893;15/6/2001 17:10:00;CIDADAO COMUM;N;0;PINDORAMA;BH;602095.17;797898.68;6037
-6039;2001323504;B03000;AMEACA;RUA ANTENOR PERD;178;74266;15/6/2001 17:24:00;CIDADAO COMUM;N;0;SAO JOAO BATISTA;BH;609049.41;808143.38;6038
-6040;2001323515;B08000;VIOLACAO DE DOMI;RUA BRAZILINA FE;120;89840;15/6/2001 17:34:00;CIDADAO COMUM;N;0;BETANIA;BH;605521.19;792493.46;6039
-6041;2001323560;B03000;AMEACA;RUA EDSON TOMAS ;276;68556;15/6/2001 18:08:00;INICIATIVA;N;0;SAO BERNARDO;BH;611475.18;804538.49;6040
-6042;2001323604;B03000;AMEACA;RUA NAIR PENTAGN;165;97657;15/6/2001 18:33:00;CIDADAO COMUM;S;0;HELIOPOLIS;BH;611056.37;805379.55;6041
-6043;2001323606;B03000;AMEACA;RUA DAVIDSON PIM;234;124189;15/6/2001 18:30:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607280.34;811756.73;6042
-6044;2001323827;B03000;AMEACA;RUA GUARARAPES;1860;32241;15/6/2001 20:49:00;CIDADAO COMUM;S;0;GLORIA;BH;602480.24;798079.29;6043
-6045;2001323838;B06000;LESAO CORPORAL;RUA RAIMUNDO GIL;320;63086;15/6/2001 20:55:00;CIDADAO COMUM;S;CAA;NOVA CINTRA;BH;605210.75;793177.47;6044
-6046;2001323839;B06000;LESAO CORPORAL;RUA MARECHAL GUA;100;96802;15/6/2001 20:56:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615270.76;806183.72;6045
-6047;2001323866;B04002;HOMICIDIO CONSUM;AV AMINTAS JAQUE;313;52546;15/6/2001 21:17:00;CIDADAO COMUM;N;0;COQUEIROS;BH;603210.01;799696.54;6046
-6048;2001323869;B06000;LESAO CORPORAL;AV NELIO CERQUEI;687;72359;15/6/2001 21:18:00;CIDADAO COMUM;S;0;TIROL;BH;600383.74;789115.36;6047
-6049;2001323892;B03000;AMEACA;RUA MARIA JOANA ;266;119267;15/6/2001 21:34:00;CIDADAO COMUM;S;0;ALVORADA;BH;615255.07;802225.21;6048
-6050;2001323904;B06000;LESAO CORPORAL;RUA G;70;78733;15/6/2001 21:38:00;CIDADAO COMUM;S;;CH JATOBA IV;BH;600404.89;787792.43;6049
-6051;2001323905;B06000;LESAO CORPORAL;RUA RADIALISTA Z;81;15437;15/6/2001 21:39:00;CIDADAO COMUM;S;;CEU AZUL;BH;604523.50;807871.15;6050
-6052;2001323919;B04002;HOMICIDIO CONSUM;RUA SACRAMENTO;30;59822;15/6/2001 21:45:00;CIDADAO COMUM;S;0;SERRA;BH;613575.35;795041.52;6051
-6053;2001323947;B09000;ABANDONO DE INCA;RUA ANA PAULA;33;3598;15/6/2001 22:05:00;CIDADAO COMUM;S;;VILA SUZANA;BH;611442.14;802914.74;6052
-6054;2001323973;B03000;AMEACA;RUA DELMO RENAUL;43;70596;15/6/2001 22:17:00;CIDADAO COMUM;S;0;AARAO REIS;BH;612822.44;804930.93;6053
-6055;2001323985;B04001;HOMICIDIO TENTAD;RUA CAMBUQUIRA;798;11830;15/6/2001 22:28:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608642.63;798179.48;6054
-6056;2001324040;B06000;LESAO CORPORAL;RUA SAO JOSE;23;302037;15/6/2001 23:00:00;CIDADAO COMUM;S;CAC;DOZE DE OUTUBRO;BH;606186.44;790674.49;6055
-6057;2001324128;B04002;HOMICIDIO CONSUM;RUA P;16;78402;15/6/2001 23:56:00;CIDADAO COMUM;N;;VILA PINHO;BH;602081.24;787982.68;6056
-6058;2001324129;B06000;LESAO CORPORAL;RUA MOEMA;394;46070;15/6/2001 23:55:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606488.15;797836.90;6057
-6059;2001324170;B03000;AMEACA;RUA PADRE LUIZ C;119;42472;16/6/2001 00:24:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;603784.38;793050.81;6058
-6060;2001324171;B03000;AMEACA;RUA PADRE PEDRO ;148;51657;16/6/2001 00:27:00;CIDADAO COMUM;S;0;VENDA NOVA;BH;609719.17;808135.92;6059
-6061;2001324241;B06000;LESAO CORPORAL;RUA DAS GABIROBA;95;30375;16/6/2001 01:28:00;POLICIAL CIVIL;S;;VILA CLORIS;BH;610034.72;808298.49;6060
-6062;2001324313;B03000;AMEACA;ESTRADA BEIRA LI;10;10878;16/6/2001 02:41:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;616178.24;806739.23;6061
-6063;2001324382;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;951;51657;16/6/2001 04:08:00;CIDADAO COMUM;N;SJ;VENDA NOVA;BH;609054.57;808684.17;6062
-6064;2001324400;B06000;LESAO CORPORAL;RUA CAPANEMA;331;56979;16/6/2001 04:42:00;CIDADAO COMUM;N;;COQUEIROS;BH;602389.39;798785.86;6063
-6065;2001324511;B03000;AMEACA;RUA JOSE CLETO;425;38682;16/6/2001 07:50:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610927.84;802291.16;6064
-6066;2001324607;B03000;AMEACA;RUA RAMIRO SIQUE;10;128858;16/6/2001 09:12:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617650.40;797388.81;6065
-6067;2001324666;B03000;AMEACA;RUA OLIVER;225;49950;16/6/2001 10:01:00;CIDADAO COMUM;N;;UNIAO;BH;612718.71;801397.71;6066
-6068;2001324724;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;635;6731;16/6/2001 10:47:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610790.65;796647.21;6067
-6069;2001324740;B03000;AMEACA;RUA FREDERICO BR;285;51080;16/6/2001 10:58:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608098.92;797431.78;6068
-6070;2001324751;B03000;AMEACA;RUA OZANAM;207;50796;16/6/2001 11:12:00;CIDADAO COMUM;S;AP104;IPIRANGA;BH;611657.56;801318.05;6069
-6071;2001324842;B03000;AMEACA;RUA TRINTA E TRE;137;34133;16/6/2001 12:14:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612435.60;807334.47;6070
-6072;2001324923;B03000;AMEACA;RUA GENTIL TEODO;87;66333;16/6/2001 13:13:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;611230.41;801186.56;6071
-6073;2001324937;B04001;HOMICIDIO TENTAD;RUA SERRINHA;658;129201;16/6/2001 13:24:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600157.51;787603.35;6072
-6074;2001324982;B03000;AMEACA;RUA DOUTOR LUIZ ;34;23505;16/6/2001 13:52:00;CIDADAO COMUM;S;0;MAGNESITA;BH;603885.26;793861.02;6073
-6075;2001324999;B04001;HOMICIDIO TENTAD;RUA NASCIMENTO G;620;47274;16/6/2001 14:09:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608659.42;794728.52;6074
-6076;2001325029;B06000;LESAO CORPORAL;RUA MARIA JOANA ;516;7328;16/6/2001 14:34:00;CIDADAO COMUM;S;;CARDOSO;BH;603100.97;788196.41;6075
-6077;2001325064;B06000;LESAO CORPORAL;RUA DAVID RABELO;416;19702;16/6/2001 15:01:00;CIDADAO COMUM;S;0;INCONFIDENCIA;BH;605050.70;798560.71;6076
-6078;2001325179;B03000;AMEACA;RUA IMPERATRIZ;32;122357;16/6/2001 16:11:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609306.94;805400.92;6077
-6079;2001325203;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;16/6/2001 16:25:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;6078
-6080;2001325207;B06000;LESAO CORPORAL;RUA CRUCIFICACAO;55;18766;16/6/2001 16:26:00;CIDADAO COMUM;S;;SAO JOSE;BH;605621.95;798926.66;6079
-6081;2001325250;B06000;LESAO CORPORAL;RUA ROBERTO DE M;100;130412;16/6/2001 16:55:00;CIDADAO COMUM;S;;OLARIA;BH;602109.78;789254.89;6080
-6082;2001325265;B03000;AMEACA;AV SILVA LOBO;1969;65889;16/6/2001 17:05:00;INICIATIVA;N;0;GRAJAU;BH;608248.61;794746.76;6081
-6083;2001325268;B06000;LESAO CORPORAL;RUA VEREADOR CAM;210;21005;16/6/2001 17:05:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615766.93;806676.50;6082
-6084;2001325283;B03000;AMEACA;RUA DARIO GONCAL;379;19670;16/6/2001 17:16:00;INICIATIVA;N;0;FLORAMAR;BH;612133.58;805984.63;6083
-6085;2001325302;B03000;AMEACA;RUA ANTONIO LUCI;83;14709;16/6/2001 17:25:00;CIDADAO COMUM;N;CAFU;CH VALE DO JATOB;BH;600810.66;787478.72;6084
-6086;2001325333;B04002;HOMICIDIO CONSUM;RUA BENTO;12;170807;16/6/2001 17:38:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608443.37;794109.13;6085
-6087;2001325366;B04001;HOMICIDIO TENTAD;RUA PARINTINS;305;61560;16/6/2001 17:52:00;CIDADAO COMUM;S;AP301;SAO GABRIEL;BH;613301.07;804534.83;6086
-6088;2001325377;B03000;AMEACA;RUA MADRID;110;42403;16/6/2001 18:02:00;CIDADAO COMUM;S;CSXX;COPACABANA;BH;606215.50;806159.29;6087
-6089;2001325399;B03000;AMEACA;RUA ALFINETE;151;2249;16/6/2001 18:18:00;CIDADAO COMUM;S;;LINDEIA;BH;599467.32;790906.24;6088
-6090;2001325459;B06000;LESAO CORPORAL;AV ERICO VERISSI;2291;41671;16/6/2001 18:50:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;606975.53;807805.13;6089
-6091;2001325524;B03000;AMEACA;AV WALDOMIRO LOB;330;66548;16/6/2001 19:16:00;CIDADAO COMUM;N;;GUARANI;BH;612929.48;805371.63;6090
-6092;2001325536;B03000;AMEACA;RUA SILVA BARBOS;123;126490;16/6/2001 19:23:00;CIDADAO COMUM;N;0;TIROL;BH;600046.40;789883.53;6091
-6093;2001325540;B03000;AMEACA;RUA OTAVIO TARQU;58;50639;16/6/2001 19:25:00;CIDADAO COMUM;S;CS;TUPI;BH;612691.45;805903.79;6092
-6094;2001325647;B06000;LESAO CORPORAL;RUA ESTEVAO MUSS;10;26327;16/6/2001 20:29:00;CIDADAO COMUM;S;0;NOVA GAMELEIRA;BH;605516.79;794498.15;6093
-6095;2001325677;B04001;HOMICIDIO TENTAD;RUA PORTO VELHO;490;62506;16/6/2001 20:46:00;CIDADAO COMUM;S;;GLORIA;BH;603911.24;798307.42;6094
-6096;2001325679;B03000;AMEACA;RUA AUGUSTA;73;6615;16/6/2001 20:51:00;CIDADAO COMUM;S;CAB;ITAIPU BH;BH;598978.25;789462.02;6095
-6097;2001325717;B06000;LESAO CORPORAL;RUA URSULA PAULI;2338;71066;16/6/2001 21:10:00;INICIATIVA;N;0;CH BONSUCESSO;BH;605473.82;791757.57;6096
-6098;2001325737;B06000;LESAO CORPORAL;RUA ANTONIO MARC;293;48539;16/6/2001 21:21:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606469.80;810190.14;6097
-6099;2001325776;B06000;LESAO CORPORAL;AV SILVIANO BRAN;2700;66002;16/6/2001 21:41:00;INICIATIVA;S;0;HORTO;BH;613805.02;798316.76;6098
-6100;2001325826;B06000;LESAO CORPORAL;RUA APERE;196;5020;16/6/2001 22:19:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615542.42;799519.99;6099
-6101;2001325838;B06000;LESAO CORPORAL;AV AFONSO PENA;590;1259;16/6/2001 22:25:00;INICIATIVA;N;0;CENTRO (BH);BH;611078.27;797193.62;6100
-6102;2001325969;B04001;HOMICIDIO TENTAD;RUA DOS LAZARIST;94;122486;16/6/2001 23:37:00;CIDADAO COMUM;S;CAB;PLANALTO;BH;610826.79;805918.07;6101
-6103;2001325972;B06000;LESAO CORPORAL;RUA GUAICURUS;451;32009;16/6/2001 23:40:00;CIDADAO COMUM;S;PX428;CENTRO (BH);BH;611210.22;797600.57;6102
-6104;2001325980;B03000;AMEACA;RUA MANJERICAO;637;34464;16/6/2001 23:43:00;CIDADAO COMUM;S;;LINDEIA;BH;599654.37;791207.03;6103
-6105;2001326019;B06000;LESAO CORPORAL;RUA BARRA DA TIJ;140;100098;17/6/2001 00:01:00;CIDADAO COMUM;N;CAB;VILA SANTA BRANC;BH;605384.20;809444.62;6104
-6106;2001326045;B03000;AMEACA;RUA FERNAO DIAS;1201;28133;17/6/2001 00:17:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616149.41;797919.40;6105
-6107;2001326046;B04001;HOMICIDIO TENTAD;RUA JOSE JORGE F;70;38884;17/6/2001 00:19:00;CIDADAO COMUM;N;;NOVA BARROCA;BH;607287.63;792753.33;6106
-6108;2001326102;B04001;HOMICIDIO TENTAD;RUA ESTOCOLMO;12;100390;17/6/2001 00:57:00;CIDADAO COMUM;N;;TREVO;BH;604166.43;805838.05;6107
-6109;2001326104;B03000;AMEACA;RUA PASCOA;72;52404;17/6/2001 00:57:00;CIDADAO COMUM;S;0;SAO JOSE;BH;605753.40;798866.19;6108
-6110;2001326108;B06000;LESAO CORPORAL;RUA IPE AMARELO;19;117362;17/6/2001 01:02:00;CIDADAO COMUM;S;CAB;LINDEIA;BH;600282.81;790534.78;6109
-6111;2001326119;B03000;AMEACA;AV MEM DE SA;942;45395;17/6/2001 01:09:00;CIDADAO COMUM;N;;PARAISO;BH;614245.94;796551.31;6110
-6112;2001326137;B03000;AMEACA;BECO DA AGUA;155;172308;17/6/2001 01:23:00;CIDADAO COMUM;S;CAZZZ;CAFEZAL;BH;614122.88;794504.57;6111
-6113;2001326211;B02000;RIXA;RUA URANO;258;71000;17/6/2001 02:10:00;CIDADAO COMUM;S;;VILA SATELITE;BH;610063.87;808693.02;6112
-6114;2001326215;B03000;AMEACA;RUA NOVE DE DEZE;10;48872;17/6/2001 02:13:00;CIDADAO COMUM;N;CAB;LEONINA;BH;608380.02;793403.51;6113
-6115;2001326223;B06000;LESAO CORPORAL;RUA SAIRA;285;48670;17/6/2001 02:22:00;CIDADAO COMUM;S;0;GOIANIA;BH;615408.70;803160.66;6114
-6116;2001326234;B02000;RIXA;AV SARAMENHA;1000;64007;17/6/2001 02:32:00;CIDADAO COMUM;S;0;TUPI;BH;612916.89;805724.57;6115
-6117;2001326253;B03000;AMEACA;RUA STA ALIANCA;17;60311;17/6/2001 02:47:00;CIDADAO COMUM;S;;DOM JOAQUIM;BH;613911.96;802400.90;6116
-6118;2001326283;B04001;HOMICIDIO TENTAD;RUA ALCANTARA;269;1870;17/6/2001 03:04:00;CIDADAO COMUM;S;0;NOVA GRANADA;BH;607795.92;794870.02;6117
-6119;2001326294;B03000;AMEACA;RUA BURI;51;10764;17/6/2001 03:13:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610328.10;801370.73;6118
-6120;2001326298;B03000;AMEACA;RUA GAMA CERQUEI;756;30564;17/6/2001 03:16:00;CIDADAO COMUM;S;CAC;JARDIM AMERICA;BH;607596.70;794467.83;6119
-6121;2001326364;B03000;AMEACA;RUA SACRAMENTO;170;59822;17/6/2001 04:23:00;CIDADAO COMUM;N;0;SERRA;BH;613713.64;795025.29;6120
-6122;2001326378;B03000;AMEACA;RUA MARIO SOARES;700;44641;17/6/2001 04:37:00;CIDADAO COMUM;S;0;DOM BOSCO;BH;604285.11;797448.93;6121
-6123;2001326389;B04002;HOMICIDIO CONSUM;RUA PADRE PEDRO ;322;51657;17/6/2001 04:54:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;609650.08;808286.90;6122
-6124;2001326409;B03000;AMEACA;RUA OLARIA;80;25110;17/6/2001 05:14:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617221.65;797115.07;6123
-6125;2001326472;B04002;HOMICIDIO CONSUM;RUA SAO VICENTE;140;63855;17/6/2001 07:22:00;CIDADAO COMUM;N;0;VENDA NOVA;BH;608585.03;808760.44;6124
-6126;2001326507;B06000;LESAO CORPORAL;RUA JOAQUIM ALVE;73;80887;17/6/2001 08:05:00;CIDADAO COMUM;N;CAB;BETANIA;BH;605405.07;792912.81;6125
-6127;2001326683;B03000;AMEACA;PRACA JOSE CAVAL;50;38639;17/6/2001 10:22:00;INICIATIVA;S;0;CORACAO DE JESUS;BH;609777.00;794213.05;6126
-6128;2001326729;B03000;AMEACA;RUA DOS AIMORES;1630;1640;17/6/2001 10:57:00;CIDADAO COMUM;S;AP21;LOURDES;BH;611057.68;796189.83;6127
-6129;2001326872;B06000;LESAO CORPORAL;RUA DUZENTOS E O;99;24261;17/6/2001 12:46:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600758.52;787074.86;6128
-6130;2001326900;B03000;AMEACA;RUA SAO MIGUEL;1501;63410;17/6/2001 13:11:00;CIDADAO COMUM;S;;ITAPOA;BH;609533.82;805627.88;6129
-6131;2001326950;B06000;LESAO CORPORAL;RUA DIVINO ESPIR;85;96768;17/6/2001 13:46:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614662.44;806416.62;6130
-6132;2001327023;B03000;AMEACA;RUA CORACAO EUCA;75;17344;17/6/2001 14:37:00;CIDADAO COMUM;N;0;CORACAO EUCARIST;BH;605859.87;796363.89;6131
-6133;2001327035;B06000;LESAO CORPORAL;RUA INGLATERRA;226;34552;17/6/2001 14:45:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;606129.97;807391.13;6132
-6134;2001327046;B02000;RIXA;RUA CAMPOS SALES;350;12300;17/6/2001 14:59:00;CIDADAO COMUM;N;0;CALAFATE;BH;607187.46;796294.85;6133
-6135;2001327075;B03000;AMEACA;AV PRESIDENTE TA;3735;35366;17/6/2001 15:16:00;CIDADAO COMUM;S;;PAQUETA;BH;605051.03;802496.83;6134
-6136;2001327076;B06000;LESAO CORPORAL;RUA EVOCACAO;473;26948;17/6/2001 15:17:00;CIDADAO COMUM;S;;SAO JOSE;BH;605849.93;798746.20;6135
-6137;2001327109;B04001;HOMICIDIO TENTAD;RUA GUSTAVO DA S;1693;32617;17/6/2001 15:40:00;CIDADAO COMUM;N;;SANTA INES;BH;613754.67;800364.22;6136
-6138;2001327143;B06000;LESAO CORPORAL;RUA NOSSA SENHOR;37;102834;17/6/2001 16:02:00;CIDADAO COMUM;S;;CEU AZUL;BH;603522.11;807505.18;6137
-6139;2001327192;B06000;LESAO CORPORAL;RUA FRANCISCO SE;2;119699;17/6/2001 16:36:00;CIDADAO COMUM;S;;VERA CRUZ;BH;617010.39;797762.35;6138
-6140;2001327224;B06000;LESAO CORPORAL;RUA BEIRA ALTA;85;62777;17/6/2001 16:53:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609881.41;802314.78;6139
-6141;2001327236;B03000;AMEACA;RUA MONTE SILVES;108;46561;17/6/2001 16:59:00;CIDADAO COMUM;S;;MINASLANDIA;BH;612316.79;804895.21;6140
-6142;2001327321;B04001;HOMICIDIO TENTAD;RUA ARTUR DE SA;1305;6211;17/6/2001 17:54:00;CIDADAO COMUM;S;;UNIAO;BH;613170.84;801684.18;6141
-6143;2001327344;B06000;LESAO CORPORAL;RUA TAMAREIRA;120;99740;17/6/2001 18:02:00;CIDADAO COMUM;S;;OLARIA;BH;601456.59;789210.66;6142
-6144;2001327348;B03000;AMEACA;RUA OLINTO MAGAL;1850;49834;17/6/2001 18:04:00;CIDADAO COMUM;S;;IPANEMA;BH;604865.84;797988.70;6143
-6145;2001327477;B03000;AMEACA;RUA ABRAHAO JOAO;86;80859;17/6/2001 19:07:00;CIDADAO COMUM;S;;PARQUE SAO JOSE;BH;607070.62;792177.61;6144
-6146;2001327494;B03000;AMEACA;PRACA NOSSA SENH;95;47942;17/6/2001 19:19:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604200.40;790234.15;6145
-6147;2001327534;B06000;LESAO CORPORAL;RUA A;162;36460;17/6/2001 19:42:00;CIDADAO COMUM;S;0;MINASCAIXA;BH;609181.68;810054.73;6146
-6148;2001327554;B06000;LESAO CORPORAL;RUA VICENTE CUNH;55;71848;17/6/2001 19:55:00;CIDADAO COMUM;S;0;BOA VISTA;BH;615551.80;800264.65;6147
-6149;2001327575;B03000;AMEACA;RUA CAICARA;1696;11451;17/6/2001 20:05:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;615995.71;799311.10;6148
-6150;2001327576;B06000;LESAO CORPORAL;RUA JANE EYRE;1227;36910;17/6/2001 20:05:00;CIDADAO COMUM;S;CSA;MINASLANDIA;BH;611848.15;804028.58;6149
-6151;2001327582;B06000;LESAO CORPORAL;RUA LIMA;15;41063;17/6/2001 20:09:00;CIDADAO COMUM;S;LJ1;COPACABANA;BH;606113.57;806114.27;6150
-6152;2001327590;B06000;LESAO CORPORAL;RUA ANA RAFAEL D;513;78572;17/6/2001 20:12:00;CIDADAO COMUM;N;;VILA SANTA RITA;BH;601339.91;787583.63;6151
-6153;2001327630;B03000;AMEACA;RUA SAN MARTIN;150;60208;17/6/2001 20:27:00;CIDADAO COMUM;S;CAB;UNIAO;BH;612640.75;801688.68;6152
-6154;2001327649;B06000;LESAO CORPORAL;RUA FREI ZACARIA;186;37610;17/6/2001 20:34:00;CIDADAO COMUM;S;PROX. FINAL DO 3;SARANDI (URCA/BH;BH;603664.32;802044.70;6153
-6155;2001327742;B04002;HOMICIDIO CONSUM;AV JOSE CANDIDO ;2468;12602;17/6/2001 21:29:00;CIDADAO COMUM;N;DROGARIA DROGAZA;DOM JOAQUIM;BH;613887.75;801512.24;6154
-6156;2001327772;B03000;AMEACA;RUA DA ABOLICAO;401;42242;17/6/2001 21:44:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607586.54;810989.54;6155
-6157;2001327817;B03000;AMEACA;RUA ESTRELA DA J;138;26705;17/6/2001 22:17:00;CIDADAO COMUM;N;FR462;VISTA ALEGRE;BH;604749.69;793333.72;6156
-6158;2001327832;B06000;LESAO CORPORAL;AV BRIGADEIRO ED;1099;2860;17/6/2001 22:26:00;CIDADAO COMUM;N;;GLORIA;BH;604209.92;798598.54;6157
-6159;2001327868;B03000;AMEACA;RUA JANAUBA;370;36891;17/6/2001 22:45:00;CIDADAO COMUM;0;;VISTA ALEGRE;BH;604535.02;793331.14;6158
-6160;2001327870;B03000;AMEACA;RUA NIASSA;60;47592;17/6/2001 22:47:00;CIDADAO COMUM;S;;SAO SALVADOR;BH;602868.95;799108.68;6159
-6161;2001327892;B06000;LESAO CORPORAL;RUA MARIA ROSA D;758;107800;17/6/2001 22:58:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606487.47;811625.86;6160
-6162;2001327956;B06000;LESAO CORPORAL;RUA TUIUTI;1131;69849;17/6/2001 23:43:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606881.12;797315.71;6161
-6163;2001327960;B06000;LESAO CORPORAL;BECO BOA ESPERAN;38;302223;17/6/2001 23:45:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610876.57;793768.26;6162
-6164;2001327985;B03000;AMEACA;RUA DAS OLIVEIRA;86;78922;17/6/2001 23:58:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606298.52;796974.69;6163
-6165;2001328011;B09000;ABANDONO DE INCA;RUA GARRET;1186;30678;18/6/2001 00:21:00;INICIATIVA;S;0;JARDIM AMERICA;BH;607366.16;794291.41;6164
-6166;2001328079;B06000;LESAO CORPORAL;RUA JOAO PIRES;508;37866;18/6/2001 01:33:00;CIDADAO COMUM;S;;CABANA;BH;604906.04;794212.99;6165
-6167;2001328087;B06000;LESAO CORPORAL;RUA AGGEO PIO;40;89711;18/6/2001 01:40:00;CIDADAO COMUM;S;0;PALMEIRAS;BH;606610.57;790431.18;6166
-6168;2001328091;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;1500;7936;18/6/2001 01:51:00;INICIATIVA;N;0;LEONINA;BH;607932.09;793780.23;6167
-6169;2001328365;B06000;LESAO CORPORAL;RUA MARIA REGINA;759;124771;18/6/2001 08:52:00;INICIATIVA;S;0;CEU AZUL;BH;604595.45;807095.92;6168
-6170;2001328473;B06000;LESAO CORPORAL;AV BELEM;875;8913;18/6/2001 10:02:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615290.39;798197.24;6169
-6171;2001328662;B03000;AMEACA;RUA UARIRA;350;70136;18/6/2001 12:17:00;INICIATIVA;S;0;SAO GERALDO;BH;616162.91;799326.26;6170
-6172;2001328667;B04001;HOMICIDIO TENTAD;AV AFONSO PENA;1650;1259;18/6/2001 12:19:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611599.78;796278.99;6171
-6173;2001328669;B06000;LESAO CORPORAL;RUA DORIVAL MACH;618;42227;18/6/2001 12:20:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607487.17;807388.25;6172
-6174;2001328845;B06000;LESAO CORPORAL;RUA LASSANCE;586;84415;18/6/2001 14:13:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615776.61;799647.18;6173
-6175;2001328929;B03000;AMEACA;RUA CINCO;100;78037;18/6/2001 15:07:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601512.54;786086.62;6174
-6176;2001328960;B06000;LESAO CORPORAL;RUA ASSEMBLEIA;217;6338;18/6/2001 15:30:00;CIDADAO COMUM;S;;LUXEMBURGO;BH;609594.93;794581.12;6175
-6177;2001329136;B06000;LESAO CORPORAL;RUA PROFESSORA G;370;86335;18/6/2001 17:08:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611783.09;807548.07;6176
-6178;2001329145;B03000;AMEACA;RUA TRES;71;76476;18/6/2001 17:14:00;CIDADAO COMUM;S;;REGINA;BH;599087.41;789774.50;6177
-6179;2001329160;B03000;AMEACA;RUA DONA CLARA;233;22859;18/6/2001 17:26:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609877.61;800349.00;6178
-6180;2001329176;B03000;AMEACA;RUA SAO PAULO;1033;63464;18/6/2001 17:32:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610899.52;796753.82;6179
-6181;2001329379;B03000;AMEACA;RUA SANTO AGOSTI;1271;61557;18/6/2001 19:17:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613648.90;799370.40;6180
-6182;2001329382;B04001;HOMICIDIO TENTAD;RUA PATROCINIO;118;52574;18/6/2001 19:17:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;609914.10;797517.10;6181
-6183;2001329468;B06000;LESAO CORPORAL;RUA OBI;2;49052;18/6/2001 20:03:00;CIDADAO COMUM;S;;CH BETANIA;BH;605192.56;792417.97;6182
-6184;2001329495;B04002;HOMICIDIO CONSUM;AV CIVILIZACAO;889;51657;18/6/2001 20:20:00;CIDADAO COMUM;N;0;VILA SANTA BRANC;BH;609155.17;808648.71;6183
-6185;2001329508;B06000;LESAO CORPORAL;RUA ALICE TERAIA;200;92767;18/6/2001 20:26:00;INICIATIVA;S;0;PILAR;BH;607185.13;788258.51;6184
-6186;2001329511;B06000;LESAO CORPORAL;RUA BEZERRA DE M;94;9525;18/6/2001 20:28:00;CIDADAO COMUM;N;0;NAZARE;BH;615431.97;804557.49;6185
-6187;2001329529;B03000;AMEACA;RUA RIACHO;80;24927;18/6/2001 20:39:00;CIDADAO COMUM;S;;TAQUARIL;BH;617249.69;797177.50;6186
-6188;2001329603;B08000;VIOLACAO DE DOMI;RUA HENRIQUE BAD;171;86020;18/6/2001 21:35:00;CIDADAO COMUM;S;;PARQUE SAO JOSE;BH;607178.34;792364.15;6187
-6189;2001329650;B03000;AMEACA;ALAMEDA VARGEM G;38;95967;18/6/2001 22:24:00;CIDADAO COMUM;S;0;VILA CASTANHEIRA;BH;601365.77;788667.34;6188
-6190;2001329697;B06000;LESAO CORPORAL;RUA BANDONION;472;170139;18/6/2001 22:55:00;CIDADAO COMUM;S;PX472;VILA CAFEZAL;BH;614136.44;794775.38;6189
-6191;2001329821;B06000;LESAO CORPORAL;AV OIAPOQUE;85;49166;19/6/2001 00:47:00;INICIATIVA;S;0;CENTRO (BH);BH;611176.91;797703.67;6190
-6192;2001329825;B06000;LESAO CORPORAL;RUA CORREGO DA M;400;18160;19/6/2001 00:49:00;CIDADAO COMUM;N;AP902;HORTO;BH;613235.32;798042.59;6191
-6193;2001329874;B03000;AMEACA;AV SERRANA;217;65040;19/6/2001 02:20:00;CIDADAO COMUM;S;;SERRANO;BH;603435.57;801125.64;6192
-6194;2001329900;B06000;LESAO CORPORAL;AV OIAPOQUE;280;49166;19/6/2001 03:19:00;INICIATIVA;S;0;CENTRO (BH);BH;610908.21;797831.05;6193
-6195;2001329991;B04001;HOMICIDIO TENTAD;RUA DAS GABIROBA;5;30375;19/6/2001 07:29:00;CIDADAO COMUM;N;;VILA CLORIS;BH;610034.72;808298.49;6194
-6196;2001330003;B06000;LESAO CORPORAL;RUA PARACATU;1570;52095;19/6/2001 07:44:00;CIDADAO COMUM;S;;SANTO AGOSTINHO;BH;609475.97;795885.87;6195
-6197;2001330261;B03000;AMEACA;RUA ALVARENGA;30;74502;19/6/2001 10:27:00;INICIATIVA;N;INICIATIVA DA VP;PRIMEIRO DE NOVE;BH;612312.21;805334.82;6196
-6198;2001330306;B06000;LESAO CORPORAL;RUA LAGOA DOS PA;41;40190;19/6/2001 10:54:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605679.60;807460.55;6197
-6199;2001330376;B03000;AMEACA;RUA SAO JOAO EVA;676;62865;19/6/2001 11:36:00;CIDADAO COMUM;S;0;SANTO ANTONIO;BH;610809.68;794146.08;6198
-6200;2001330419;B03000;AMEACA;PRACA COMENDADOR;10;16395;19/6/2001 12:12:00;INICIATIVA;S;0;FLORESTA;BH;611966.10;798060.14;6199
-6201;2001330451;B03000;AMEACA;RUA CORONEL MARC;281;17978;19/6/2001 12:43:00;CIDADAO COMUM;S;;SANTA ROSA;BH;610254.94;803257.66;6200
-6202;2001330484;B03000;AMEACA;RUA BOM JESUS DA;659;99680;19/6/2001 13:06:00;CIDADAO COMUM;N;BL47    AP1003;SANTA TEREZINHA;BH;604062.02;802892.42;6201
-6203;2001330499;B06000;LESAO CORPORAL;RUA STA APOLONIA;120;60352;19/6/2001 13:15:00;CIDADAO COMUM;S;0;DOM JOAQUIM;BH;614079.87;802000.80;6202
-6204;2001330555;B03000;AMEACA;RUA FRANCISCO RO;64;10994;19/6/2001 13:44:00;CIDADAO COMUM;S;;DOM JOAQUIM;BH;613740.83;801756.15;6203
-6205;2001330623;B03000;AMEACA;RUA AQUILES LOBO;470;5219;19/6/2001 14:41:00;CIDADAO COMUM;S;;FLORESTA;BH;611971.87;797103.12;6204
-6206;2001330632;B03000;AMEACA;RUA ENGENHEIRO A;103;25500;19/6/2001 14:46:00;CIDADAO COMUM;S;;FLORAMAR;BH;611346.97;806271.04;6205
-6207;2001330720;B03000;AMEACA;AV AUGUSTO DE LI;1549;6731;19/6/2001 15:53:00;INICIATIVA;S;;BARRO PRETO;BH;609833.79;796889.71;6206
-6208;2001330833;B06000;LESAO CORPORAL;RUA PAULO KRUGER;230;55910;19/6/2001 16:46:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611701.18;806916.68;6207
-6209;2001330896;B04001;HOMICIDIO TENTAD;RUA DONA CARMEM;741;22820;19/6/2001 17:22:00;CIDADAO COMUM;S;0;SARANDI (URCA/BH;BH;604141.60;802506.92;6208
-6210;2001330963;B02000;RIXA;RUA DA OLARIA;507;18640;19/6/2001 18:05:00;CIDADAO COMUM;N;REF:PROXIMO COGR;OLARIA;BH;601386.46;789148.72;6209
-6211;2001331052;B03000;AMEACA;RUA VIOLETA DE M;178;80253;19/6/2001 18:56:00;CIDADAO COMUM;S;0;SAO JOSE;BH;605196.32;799173.61;6210
-6212;2001331096;B06000;LESAO CORPORAL;RUA JOSE JORGE F;70;38884;19/6/2001 19:14:00;CIDADAO COMUM;S;;NOVA BARROCA;BH;607287.63;792753.33;6211
-6213;2001331262;B03000;AMEACA;RUA ESTADOS UNID;337;26239;19/6/2001 20:34:00;CIDADAO COMUM;S;LJ1;COPACABANA;BH;606183.03;806063.64;6212
-6214;2001331297;B03000;AMEACA;AV PARANA;200;52230;19/6/2001 20:55:00;INICIATIVA;N;0;CENTRO (BH);BH;610763.62;797326.10;6213
-6215;2001331304;B04002;HOMICIDIO CONSUM;RUA PRINCIPAL;300;170504;19/6/2001 20:59:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608596.19;793933.42;6214
-6216;2001331314;B03000;AMEACA;AV JOSE BONIFACI;189;38579;19/6/2001 21:07:00;INICIATIVA;S;0;PRADO LOPES;BH;610210.56;798939.37;6215
-6217;2001331344;B04002;HOMICIDIO CONSUM;RUA URSULA PAULI;1728;71066;19/6/2001 21:27:00;INICIATIVA;N;0;SALGADO FILHO;BH;605896.08;792802.21;6216
-6218;2001331359;B06000;LESAO CORPORAL;RUA DR PEDRO RUE;700;113853;19/6/2001 21:36:00;CIDADAO COMUM;N;;LETICIA;BH;607002.38;809601.56;6217
-6219;2001331367;B03000;AMEACA;RUA BEIRA MAR;421;94992;19/6/2001 21:40:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603053.29;802253.83;6218
-6220;2001331373;B03000;AMEACA;RUA CALDAS DA RA;506;61100;19/6/2001 21:43:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609820.95;802507.00;6219
-6221;2001331413;B04001;HOMICIDIO TENTAD;RUA FERNAO DIAS;100;28133;19/6/2001 22:05:00;INICIATIVA;N;0;CASA BRANCA;BH;616308.02;799694.32;6220
-6222;2001331494;B06000;LESAO CORPORAL;RUA DOS TUPIS;337;69965;19/6/2001 23:06:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610958.56;796903.24;6221
-6223;2001331513;B06000;LESAO CORPORAL;RUA OSCAR TROMPO;1372;50452;19/6/2001 23:19:00;INICIATIVA;S;;MORRO DAS PEDRAS;BH;608553.52;794568.52;6222
-6224;2001331519;B04001;HOMICIDIO TENTAD;RUA GENTIOS;1350;30983;19/6/2001 23:21:00;CIDADAO COMUM;S;;CORACAO DE JESUS;BH;608905.13;793585.28;6223
-6225;2001331529;B04001;HOMICIDIO TENTAD;AV PORTUGAL;150;54816;19/6/2001 23:32:00;CIDADAO COMUM;N;;JARDIM ATLANTICO;BH;605670.52;806041.29;6224
-6226;2001331553;B03000;AMEACA;RUA MARIA DA GLO;63;86288;19/6/2001 23:49:00;CIDADAO COMUM;S;CS02;JAQUELINE;BH;611227.16;810173.00;6225
-6227;2001331562;B03000;AMEACA;RUA PROFESSOR MI;220;91128;19/6/2001 23:54:00;CIDADAO COMUM;S;APTO 102;BURITIS;BH;607948.05;790719.17;6226
-6228;2001331618;B06000;LESAO CORPORAL;RUA GUAICURUS;451;32009;20/6/2001 00:44:00;CIDADAO COMUM;S;PX428;CENTRO (BH);BH;611210.22;797600.57;6227
-6229;2001331632;B04002;HOMICIDIO CONSUM;AV CRISTIANO MAC;5397;18652;20/6/2001 00:53:00;CIDADAO COMUM;N;;SAO PAULO;BH;612256.79;802178.98;6228
-6230;2001331635;B03000;AMEACA;RUA PITANGUI;33;54365;20/6/2001 00:56:00;CIDADAO COMUM;N;0;SAO CRISTOVAO;BH;610543.96;799415.99;6229
-6231;2001331739;B04001;HOMICIDIO TENTAD;RUA BARAO DE COR;586;7910;20/6/2001 03:47:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;610052.00;805335.74;6230
-6232;2001331772;B06000;LESAO CORPORAL;RUA DOUTOR CEZAR;145;80962;20/6/2001 05:06:00;CIDADAO COMUM;N;;NOVA CINTRA;BH;605479.20;793361.18;6231
-6233;2001331818;B04002;HOMICIDIO CONSUM;RUA QUATRO DE MA;6;57118;20/6/2001 06:56:00;CIDADAO COMUM;N;0;LEONINA;BH;608650.19;793692.46;6232
-6234;2001332186;B06000;LESAO CORPORAL;RUA DAS FLORES;200;170214;20/6/2001 11:18:00;CIDADAO COMUM;N;CAB;CABANA;BH;604375.80;794455.85;6233
-6235;2001332248;B03000;AMEACA;AV PRESIDENTE CA;1185;55125;20/6/2001 12:04:00;CIDADAO COMUM;S;CS;CAICARA;BH;608290.93;799772.80;6234
-6236;2001332295;B06000;LESAO CORPORAL;RUA JACUI;1131;36734;20/6/2001 12:36:00;INICIATIVA;N;0;CONCORDIA;BH;611706.90;799025.84;6235
-6237;2001332335;B03000;AMEACA;RUA IBIRAPITANGA;59;33880;20/6/2001 13:11:00;CIDADAO COMUM;S;;DOM CABRAL;BH;605182.78;796323.06;6236
-6238;2001332348;B03000;AMEACA;RUA JOSUE MARTIN;464;84821;20/6/2001 13:18:00;CIDADAO COMUM;N;;DA LAGOA;BH;604491.32;809555.61;6237
-6239;2001332393;B03000;AMEACA;RUA RUI GUERRA;20;301669;20/6/2001 13:45:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614477.59;795128.95;6238
-6240;2001332458;B03000;AMEACA;RUA VASCO DA GAM;334;71330;20/6/2001 14:26:00;CIDADAO COMUM;S;0;SAO BERNARDO;BH;611151.08;804995.87;6239
-6241;2001332506;B03000;AMEACA;RUA VOLTS;40;73626;20/6/2001 15:02:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612172.58;803421.57;6240
-6242;2001332547;B06000;LESAO CORPORAL;RUA CARDEAL;18;103001;20/6/2001 15:26:00;INICIATIVA;N;0;CONJUNTO ALIPIO ;BH;604210.73;799874.42;6241
-6243;2001332720;B06000;LESAO CORPORAL;RUA ANTARES;70;4244;20/6/2001 16:57:00;INICIATIVA;S;0;SANTA LUCIA;BH;610151.02;793124.83;6242
-6244;2001332733;B05000;SEQUESTRO E CARC;RUA JULIO PEREIR;298;102239;20/6/2001 17:02:00;INICIATIVA;N;0;CIDADE NOVA;BH;612286.60;800677.40;6243
-6245;2001332761;B03000;AMEACA;AV CIVILIZACAO;911;51657;20/6/2001 17:16:00;CIDADAO COMUM;S;;JARDIM FLORENCIA;BH;609133.74;808652.87;6244
-6246;2001332797;B03000;AMEACA;RUA ANGELINA DE ;1076;96207;20/6/2001 17:36:00;CIDADAO COMUM;S;;DOM SILVERIO;BH;615236.49;804525.63;6245
-6247;2001332806;B03000;AMEACA;AV SANTA TEREZIN;355;61415;20/6/2001 17:42:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604513.16;802496.64;6246
-6248;2001332833;B06000;LESAO CORPORAL;RUA SESSENTA E U;160;33689;20/6/2001 17:54:00;CIDADAO COMUM;S;0;CONJUNTO FELICID;BH;612483.89;806937.99;6247
-6249;2001332933;B03000;AMEACA;RUA ESTORIL;133;63827;20/6/2001 18:41:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609800.46;802609.37;6248
-6250;2001333044;B06000;LESAO CORPORAL;RUA DA PAZ;110;31236;20/6/2001 19:32:00;CIDADAO COMUM;S;;CONJ HAB JARDIM ;BH;603850.05;798083.86;6249
-6251;2001333048;B06000;LESAO CORPORAL;AV BERNARDO VASC;837;9411;20/6/2001 19:33:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;610594.13;800829.58;6250
-6252;2001333051;B03000;AMEACA;RUA PROFESSORA A;90;59923;20/6/2001 19:28:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;616394.40;799545.27;6251
-6253;2001333134;B04001;HOMICIDIO TENTAD;RUA PROFESSOR PI;29;55658;20/6/2001 20:37:00;CIDADAO COMUM;N;0;CIDADE NOVA;BH;612187.10;800801.34;6252
-6254;2001333224;B03000;AMEACA;RUA DOS TUPINAMB;953;69940;20/6/2001 21:36:00;CIDADAO COMUM;S;APTO 1207;CENTRO (BH);BH;610646.84;797421.18;6253
-6255;2001333234;B03000;AMEACA;RUA CRISTAL;83;18611;20/6/2001 21:38:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612657.77;797382.69;6254
-6256;2001333296;B03000;AMEACA;RUA ARISTIDES VI;75;84471;20/6/2001 22:24:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614483.20;803729.27;6255
-6257;2001333297;B06000;LESAO CORPORAL;AV OIAPOQUE;242;49166;20/6/2001 22:26:00;INICIATIVA;S;0;CENTRO (BH);BH;610939.71;797820.89;6256
-6258;2001333303;B03000;AMEACA;RUA EUCLASIO;474;26787;20/6/2001 22:25:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613904.16;796503.28;6257
-6259;2001333380;B03000;AMEACA;RUA ITAI;959;35413;20/6/2001 23:12:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613839.32;796099.97;6258
-6260;2001333415;B04002;HOMICIDIO CONSUM;RUA STO ANTONIO;5;61759;20/6/2001 23:29:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609947.81;805765.49;6259
-6261;2001333440;B06000;LESAO CORPORAL;RUA PURUS;125;55819;20/6/2001 23:40:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611069.17;799069.41;6260
-6262;2001333517;B06000;LESAO CORPORAL;RUA ANDARAI;286;3720;21/6/2001 01:05:00;CIDADAO COMUM;N;0;NOVA VISTA (SB);SB;615301.42;800837.38;6261
-6263;2001333630;B03000;AMEACA;AV PRESIDENTE CA;320;55125;21/6/2001 04:18:00;INICIATIVA;S;0;CAMPUS UFMG;BH;608476.86;798679.56;6262
-6264;2001333881;B03000;AMEACA;AV PARANAIBA;429;52256;21/6/2001 09:18:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609777.38;799943.11;6263
-6265;2001333883;B03000;AMEACA;AV DOS ANDRADAS;3540;3761;21/6/2001 09:20:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613913.55;797194.26;6264
-6266;2001333922;B03000;AMEACA;RUA CRUCILANDIA;55;18781;21/6/2001 09:44:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605926.67;807569.38;6265
-6267;2001333998;B06000;LESAO CORPORAL;RUA ERNESTO AUST;420;25784;21/6/2001 10:37:00;CIDADAO COMUM;N;;BOA VISTA;BH;614936.22;799730.60;6266
-6268;2001334006;B04001;HOMICIDIO TENTAD;RUA CINQUENTA;350;302845;21/6/2001 10:42:00;INICIATIVA;S;0;TUPI;BH;614150.27;805475.49;6267
-6269;2001334147;B06000;LESAO CORPORAL;RUA AUGUSTO JOSE;283;6729;21/6/2001 12:10:00;CIDADAO COMUM;N;;BETANIA;BH;605791.54;792055.74;6268
-6270;2001334211;B08000;VIOLACAO DE DOMI;RUA OFICINAS;329;49140;21/6/2001 13:01:00;CIDADAO COMUM;N;;ESPLANADA;BH;614686.26;798740.80;6269
-6271;2001334490;B03000;AMEACA;RUA LAJEDO;530;130034;21/6/2001 15:53:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614592.06;804513.45;6270
-6272;2001334502;B04001;HOMICIDIO TENTAD;RUA JUSCELINO KU;45;74861;21/6/2001 16:00:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616747.23;804553.20;6271
-6273;2001334566;B03000;AMEACA;RUA F DOIS;1;28653;21/6/2001 16:25:00;CIDADAO COMUM;S;;CAPITAO EDUARDO;BH;618568.08;806941.06;6272
-6274;2001334584;B03000;AMEACA;RUA TOME DE SOUZ;920;67998;21/6/2001 16:36:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;611510.63;795206.41;6273
-6275;2001334682;B03000;AMEACA;RUA SAO TOMAS;17;63770;21/6/2001 17:25:00;CIDADAO COMUM;N;;PLANALTO;BH;610686.83;805550.99;6274
-6276;2001334696;B03000;AMEACA;AV AMAZONAS;345;3140;21/6/2001 17:32:00;INICIATIVA;N;0;CENTRO (BH);BH;611084.15;797100.95;6275
-6277;2001334831;B06000;LESAO CORPORAL;RUA BANDONION;172;170139;21/6/2001 18:43:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;613977.41;795089.89;6276
-6278;2001335098;B04001;HOMICIDIO TENTAD;RUA SERINGUEIRA;300;90471;21/6/2001 21:06:00;CIDADAO COMUM;S;0;PATROCINIO;BH;605268.53;794551.84;6277
-6279;2001335107;B06000;LESAO CORPORAL;RUA JOAQUIM DE F;1479;38033;21/6/2001 21:15:00;INICIATIVA;S;;SANTA HELENA (BH;BH;603134.26;789846.88;6278
-6280;2001335108;B09000;ABANDONO DE INCA;RUA CANDIDA FERR;5;12542;21/6/2001 21:14:00;POLICIAL MILITAR;S;;NOVA GAMELEIRA;BH;605763.19;794511.59;6279
-6281;2001335112;B06000;LESAO CORPORAL;RUA HELIUM;449;32976;21/6/2001 21:18:00;CIDADAO COMUM;S;;NOVA FLORESTA;BH;611770.19;800159.48;6280
-6282;2001335155;B06000;LESAO CORPORAL;AV OIAPOQUE;184;49166;21/6/2001 21:50:00;CIDADAO COMUM;N;0;CENTRO BH;BH;610988.22;797810.47;6281
-6283;2001335157;B03000;AMEACA;RUA DOS MAIAS;114;83999;21/6/2001 21:52:00;CIDADAO COMUM;S;CA03;SANTA MONICA;BH;607253.67;807274.56;6282
-6284;2001335172;B04001;HOMICIDIO TENTAD;AV JOSE BONIFACI;284;38579;21/6/2001 22:02:00;INICIATIVA;N;0;PRADO LOPES;BH;610129.14;799078.88;6283
-6285;2001335185;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;5555;18652;21/6/2001 22:12:00;POLICIAL MILITAR;S;0;DOS PALMARES;BH;612227.11;802603.49;6284
-6286;2001335235;B03000;AMEACA;RUA PROFESSORA G;520;86335;21/6/2001 22:56:00;CIDADAO COMUM;S;;FLORAMAR;BH;611761.04;807676.30;6285
-6287;2001335261;B03000;AMEACA;RUA JULIA LOPES ;108;95333;21/6/2001 23:09:00;CIDADAO COMUM;S;;SANTA MARIA;BH;603320.49;795112.03;6286
-6288;2001335286;B03000;AMEACA;RUA FELICIDADE;70;25743;21/6/2001 23:28:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617179.69;797703.11;6287
-6289;2001335330;B03000;AMEACA;RUA TABELIAO FER;207;66692;22/6/2001 00:05:00;INICIATIVA;S;0;CIDADE NOVA;BH;612332.83;800624.31;6288
-6290;2001335365;B04001;HOMICIDIO TENTAD;RUA RODRIGUES DO;45;59154;22/6/2001 00:31:00;CIDADAO COMUM;N;0;ERMELINDA;BH;608945.83;801127.50;6289
-6291;2001335427;B06000;LESAO CORPORAL;AV AMAZONAS;1746;3140;22/6/2001 01:38:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609974.58;796529.68;6290
-6292;2001335428;B03000;AMEACA;RUA ANTONIO JOSE;300;7431;22/6/2001 01:38:00;CIDADAO COMUM;0;0;CEU AZUL;BH;605178.86;807552.02;6291
-6293;2001335492;B02000;RIXA;RUA PADRE PEDRO ;5631;51657;22/6/2001 02:50:00;INICIATIVA;N;0;MANTIQUEIRA;BH;606035.58;809984.17;6292
-6294;2001335562;B03000;AMEACA;RUA CLAUDIO MANO;47;15972;22/6/2001 04:52:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;612460.15;795339.86;6293
-6295;2001335644;B03000;AMEACA;RUA OITO;56;84819;22/6/2001 07:30:00;CIDADAO COMUM;N;;DA LAGOA;BH;604483.44;809351.75;6294
-6296;2001335668;B04001;HOMICIDIO TENTAD;RUA BOAVENTURA;361;9783;22/6/2001 07:53:00;CIDADAO COMUM;S;;VILA INDAIA;BH;607139.57;802390.07;6295
-6297;2001335967;B03000;AMEACA;AV DO CONTORNO;3800;17228;22/6/2001 11:23:00;CIDADAO COMUM;S;;SAO LUCAS;BH;612975.85;796174.37;6296
-6298;2001336449;B06000;LESAO CORPORAL;AV DO CONTORNO;8372;17228;22/6/2001 16:53:00;CIDADAO COMUM;N;;CENTRO (BH);BH;609515.14;795627.09;6297
-6299;2001336490;B06000;LESAO CORPORAL;RUA CLOVIS DE SO;138;118642;22/6/2001 17:14:00;INICIATIVA;N;0;REGINA;BH;598943.95;789862.49;6298
-6300;2001336510;B03000;AMEACA;RUA BOM JESUS DA;497;99680;22/6/2001 17:23:00;CIDADAO COMUM;S;0;SANTA TEREZINHA;BH;604100.08;802814.35;6299
-6301;2001336624;B03000;AMEACA;RUA VOLGA;37;73581;22/6/2001 18:25:00;CIDADAO COMUM;S;;COQUEIROS;BH;602559.03;799047.10;6300
-6302;2001336641;B03000;AMEACA;RUA LIMEIRA;275;54050;22/6/2001 18:32:00;CIDADAO COMUM;S;;PIRATININGA;BH;606243.18;809547.88;6301
-6303;2001336650;B03000;AMEACA;RUA IPAMERI;310;14825;22/6/2001 18:33:00;CIDADAO COMUM;N;;ARAGUAIA;BH;605162.04;789659.13;6302
-6304;2001336843;B04001;HOMICIDIO TENTAD;RUA SAO GERALDO;73;170283;22/6/2001 19:52:00;CIDADAO COMUM;N;;CABANA;BH;604695.64;794127.52;6303
-6305;2001336866;B03000;AMEACA;RUA AUREO DRUMON;35;117435;22/6/2001 20:06:00;CIDADAO COMUM;S;0;CASA BRANCA;BH;616403.94;799816.82;6304
-6306;2001336877;B03000;AMEACA;RUA SAO PAULO;848;63464;22/6/2001 20:12:00;CIDADAO COMUM;S;AP1104;CENTRO (BH);BH;610915.13;796961.87;6305
-6307;2001336880;B06000;LESAO CORPORAL;RUA IRACEMA;34;34896;22/6/2001 20:14:00;CIDADAO COMUM;S;C;VILA HUMAITA;BH;610298.98;801523.27;6306
-6308;2001336908;B06000;LESAO CORPORAL;RUA FLOR DE ABRI;75;28464;22/6/2001 20:27:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;605861.84;799044.97;6307
-6309;2001336942;B06000;LESAO CORPORAL;AV AMAZONAS;5253;3140;22/6/2001 20:48:00;INICIATIVA;S;0;NOVA SUISSA;BH;606825.09;795951.48;6308
-6310;2001337020;B03000;AMEACA;RUA JULIO DE CAS;234;39470;22/6/2001 21:33:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606434.93;792926.11;6309
-6311;2001337044;B06000;LESAO CORPORAL;RUA ZONA DA MATA;110;74049;22/6/2001 21:48:00;CIDADAO COMUM;S;0;SANTA AMELIA;BH;607020.99;806347.09;6310
-6312;2001337108;B04001;HOMICIDIO TENTAD;RUA BARREIRO GRA;120;8258;22/6/2001 22:27:00;INICIATIVA;N;0;MARIA GORETTI;BH;614113.53;803391.42;6311
-6313;2001337246;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;322;51657;22/6/2001 23:46:00;CIDADAO COMUM;S;UPA VENDA NOVA;VILA SANTO ANTON;BH;609650.08;808286.90;6312
-6314;2001337247;B06000;LESAO CORPORAL;AV TERESA CRISTI;6778;67512;22/6/2001 23:48:00;INICIATIVA;S;0;CINQUENTENARIO;BH;606046.64;793197.39;6313
-6315;2001337286;B06000;LESAO CORPORAL;RUA CONEGO SANTA;881;16859;23/6/2001 00:15:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610516.02;800779.29;6314
-6316;2001337321;B06000;LESAO CORPORAL;RUA URANDI;150;70974;23/6/2001 00:41:00;CIDADAO COMUM;S;;CONCORDIA;BH;611599.58;799038.35;6315
-6317;2001337385;B06000;LESAO CORPORAL;RUA SAO PAULO;279;63464;23/6/2001 01:22:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611088.02;797493.26;6316
-6318;2001337403;B03000;AMEACA;RUA IARA;312;33751;23/6/2001 01:36:00;CIDADAO COMUM;N;;POMPEIA;BH;614667.76;797898.82;6317
-6319;2001337488;B06000;LESAO CORPORAL;RUA MARCO AURELI;32;61821;23/6/2001 02:44:00;INICIATIVA;S;0;NAZARE;BH;615693.25;804691.63;6318
-6320;2001337508;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;101;26052;23/6/2001 02:58:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611395.36;797540.06;6319
-6321;2001337521;B04001;HOMICIDIO TENTAD;AV BERNARDO VASC;2717;9411;23/6/2001 03:11:00;CIDADAO COMUM;N;;IPIRANGA;BH;612138.82;801992.11;6320
-6322;2001337610;B04002;HOMICIDIO CONSUM;AV CORONEL DURVA;732;17688;23/6/2001 04:42:00;CIDADAO COMUM;N;;DURVAL DE BARROS;BH;598151.28;790894.64;6321
-6323;2001337677;B03000;AMEACA;RUA DES BRAULIO;247;19917;23/6/2001 06:15:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616279.66;797686.69;6322
-6324;2001337752;B04001;HOMICIDIO TENTAD;RUA CINQUENTA;290;106100;23/6/2001 08:12:00;CIDADAO COMUM;N;;JARDIM DOS COMER;BH;608410.77;810960.29;6323
-6325;2001337761;B03000;AMEACA;RUA DES SARAIVA;1001;66535;23/6/2001 08:16:00;CIDADAO COMUM;S;CAFU;VERA CRUZ;BH;616098.29;797767.22;6324
-6326;2001337775;B03000;AMEACA;RUA AMILCAR CABR;250;5146;23/6/2001 08:26:00;CIDADAO COMUM;S;AP303;MILIONARIOS;BH;604246.18;790098.14;6325
-6327;2001337780;B06000;LESAO CORPORAL;RUA RIBEIRAO DAS;54;46688;23/6/2001 08:33:00;CIDADAO COMUM;N;0;PARAISO;BH;614140.00;796036.93;6326
-6328;2001337790;B04001;HOMICIDIO TENTAD;BECO SAO JOAO DE;220;171084;23/6/2001 08:37:00;CIDADAO COMUM;N;0;CABANA;BH;604606.84;793833.50;6327
-6329;2001337799;B03000;AMEACA;RUA ALICE;234;170949;23/6/2001 08:45:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;608002.45;793792.58;6328
-6330;2001337820;B03000;AMEACA;RUA CARACA;948;12990;23/6/2001 09:08:00;CIDADAO COMUM;S;;SERRA;BH;613753.87;794503.33;6329
-6331;2001337934;B03000;AMEACA;RUA TIPUANA;590;74300;23/6/2001 10:45:00;CIDADAO COMUM;S;;JULIANA;BH;610702.83;809126.98;6330
-6332;2001337941;B03000;AMEACA;AV WALDIR SOEIRO;345;118904;23/6/2001 10:49:00;CIDADAO COMUM;S;CAFDS;DAS INDUSTRIAS;BH;601686.77;788954.10;6331
-6333;2001337964;B06000;LESAO CORPORAL;RUA AUGUSTO FERR;410;85575;23/6/2001 11:11:00;CIDADAO COMUM;N;;SERRA VERDE;BH;609753.87;810385.88;6332
-6334;2001338027;B03000;AMEACA;RUA JORGE ANTONI;86;86391;23/6/2001 11:55:00;CIDADAO COMUM;0;;LETICIA;BH;606706.48;809837.19;6333
-6335;2001338105;B03000;AMEACA;RUA TEN ANASTACI;486;67263;23/6/2001 12:50:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;613443.83;796627.00;6334
-6336;2001338144;B03000;AMEACA;RUA TEBAS;840;67090;23/6/2001 13:28:00;POLICIAL MILITAR;S;0;VERA CRUZ;BH;616073.41;798319.09;6335
-6337;2001338191;B03000;AMEACA;RUA CONEGO ROCHA;47;16833;23/6/2001 13:52:00;CIDADAO COMUM;S;AP302;GUTIERREZ;BH;609565.01;795498.13;6336
-6338;2001338232;B03000;AMEACA;RUA ROSA MARIA S;106;20131;23/6/2001 14:22:00;CIDADAO COMUM;S;0;ITAPOA;BH;609283.13;806438.01;6337
-6339;2001338238;B04001;HOMICIDIO TENTAD;RUA ALICE;5;170949;23/6/2001 14:25:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608015.47;793880.36;6338
-6340;2001338275;B06000;LESAO CORPORAL;RUA JOSE OVIDIO ;671;10298;23/6/2001 14:50:00;CIDADAO COMUM;N;;CARDOSO;BH;603962.71;787984.77;6339
-6341;2001338325;B03000;AMEACA;RUA NICOLAU COEL;45;119759;23/6/2001 15:18:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616495.40;797313.44;6340
-6342;2001338332;B03000;AMEACA;AV SANTOS DUMONT;596;61950;23/6/2001 15:23:00;CIDADAO COMUM;S;AN1;CENTRO (BH);BH;611062.63;797591.94;6341
-6343;2001338345;B03000;AMEACA;RUA BERTOPOLIS;404;41873;23/6/2001 15:31:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612526.93;804327.60;6342
-6344;2001338347;B03000;AMEACA;RUA TEFE;483;67121;23/6/2001 15:33:00;CIDADAO COMUM;S;;RENASCENCA;BH;610906.55;800086.84;6343
-6345;2001338369;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;1740;57830;23/6/2001 15:48:00;INICIATIVA;S;0;LUXEMBURGO;BH;608719.62;793771.09;6344
-6346;2001338391;B03000;AMEACA;RUA VOLTA GRANDE;645;73594;23/6/2001 16:02:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612975.31;798813.56;6345
-6347;2001338512;B03000;AMEACA;AV DO CONTORNO;6117;17228;23/6/2001 17:10:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611505.72;794818.76;6346
-6348;2001338573;B06000;LESAO CORPORAL;RUA DOS CONSTRUT;845;101249;23/6/2001 17:53:00;CIDADAO COMUM;S;0;CONJUNTO ALIPIO ;BH;604027.49;800198.33;6347
-6349;2001338577;B04001;HOMICIDIO TENTAD;RUA ALCIDA TORRE;120;112936;23/6/2001 17:53:00;INICIATIVA;N;0;CONJUNTO SANTA M;BH;608957.30;793494.58;6348
-6350;2001338618;B04001;HOMICIDIO TENTAD;RUA DOUTOR ALBER;15;4994;23/6/2001 18:15:00;INICIATIVA;S;0;PADRE EUSTAQUIO;BH;605823.47;797781.18;6349
-6351;2001338630;B04002;HOMICIDIO CONSUM;RUA SAO TOMAS DE;1079;63782;23/6/2001 18:24:00;CIDADAO COMUM;N;PX1079;MORRO DO PAPAGAI;BH;610696.43;793067.40;6350
-6352;2001338747;B03000;AMEACA;AV DOS ANDRADAS;4000;3761;23/6/2001 19:19:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;614232.48;798106.24;6351
-6353;2001338771;B03000;AMEACA;RUA JOSE OSORIO;25;105091;23/6/2001 19:31:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605474.09;790849.03;6352
-6354;2001338773;B03000;AMEACA;RUA ALICEDRO;77;2340;23/6/2001 19:30:00;CIDADAO COMUM;S;0;PINDORAMA;BH;602424.18;797655.47;6353
-6355;2001338837;B06000;LESAO CORPORAL;BECO PARAISO;12;302036;23/6/2001 20:03:00;INICIATIVA;S;0;PALMEIRAS;BH;606213.48;790637.47;6354
-6356;2001338908;B06000;LESAO CORPORAL;RUA CONDE D'EU;987;16631;23/6/2001 20:44:00;CIDADAO COMUM;S;;SAUDADE;BH;615598.60;797674.91;6355
-6357;2001338910;B06000;LESAO CORPORAL;RUA PERIMETRAL;178;53407;23/6/2001 20:45:00;CIDADAO COMUM;S;EM FRENTE A QUAD;CARLOS PRATES;BH;608223.50;797279.43;6356
-6358;2001338949;B06000;LESAO CORPORAL;RUA SARACA;700;63997;23/6/2001 21:07:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609001.06;799557.24;6357
-6359;2001339077;B06000;LESAO CORPORAL;RUA NOVE;75;81013;23/6/2001 22:14:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605202.66;793145.62;6358
-6360;2001339116;B06000;LESAO CORPORAL;RUA ALVARO MATA;165;2844;23/6/2001 22:34:00;CIDADAO COMUM;S;0;ERMELINDA;BH;609096.01;801009.66;6359
-6361;2001339153;B03000;AMEACA;RUA DOZE DE DEZE;101;24060;23/6/2001 23:05:00;CIDADAO COMUM;S;CAFR;BELMONT;BH;615616.59;804938.16;6360
-6362;2001339195;B03000;AMEACA;RUA STA JUDITE;465;60816;23/6/2001 23:34:00;CIDADAO COMUM;S;CX6;APARECIDA SETIMA;BH;608750.85;800357.87;6361
-6363;2001339223;B03000;AMEACA;RUA CORNELIO PRO;40;36706;23/6/2001 23:48:00;CIDADAO COMUM;S;;NOVA VISTA;BH;614638.60;800712.32;6362
-6364;2001339233;B06000;LESAO CORPORAL;RUA JURUA;790;39799;23/6/2001 23:54:00;CIDADAO COMUM;N;AP303;DA GRACA;BH;612261.50;799605.83;6363
-6365;2001339247;B06000;LESAO CORPORAL;RUA DAS GABIROBA;95;30375;24/6/2001 00:05:00;CIDADAO COMUM;N;;VILA CLORIS;BH;610034.72;808298.49;6364
-6366;2001339266;B03000;AMEACA;RUA SERRA NEGRA;1372;65038;24/6/2001 00:23:00;CIDADAO COMUM;S;CAA;SANTO ANDRE;BH;609056.02;799135.06;6365
-6367;2001339299;B06000;LESAO CORPORAL;RUA JOSE SANGUIN;69;107028;24/6/2001 00:43:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;609033.61;807855.07;6366
-6368;2001339398;B02000;RIXA;AV SERRANA;774;65040;24/6/2001 02:04:00;CIDADAO COMUM;S;;SERRANO;BH;603492.23;801710.41;6367
-6369;2001339405;B06000;LESAO CORPORAL;RUA ANTONIO TEIX;1280;119037;24/6/2001 02:10:00;INICIATIVA;N;0;TEIXEIRA DIAS;BH;602642.10;789958.00;6368
-6370;2001339433;B02000;RIXA;RUA ALIANCA;99;2324;24/6/2001 02:29:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;613443.00;804094.68;6369
-6371;2001339474;B06000;LESAO CORPORAL;RUA CASCALHEIRA;52;13889;24/6/2001 03:03:00;INICIATIVA;S;0;VENDA NOVA;BH;609356.04;808626.75;6370
-6372;2001339485;B03000;AMEACA;AV JOSE LOPES MU;225;19176;24/6/2001 03:11:00;CIDADAO COMUM;N;;FLORAMAR;BH;611602.39;806414.44;6371
-6373;2001339515;B06000;LESAO CORPORAL;RUA HORIZONTE;69;33405;24/6/2001 03:32:00;CIDADAO COMUM;S;AP202;PARAISO;BH;614458.83;796413.39;6372
-6374;2001339551;B06000;LESAO CORPORAL;RUA MARCO AURELI;196;61821;24/6/2001 04:12:00;CIDADAO COMUM;S;;NAZARE;BH;615704.53;804641.91;6373
-6375;2001339585;B04001;HOMICIDIO TENTAD;AV SANTOS DUMONT;673;61950;24/6/2001 04:55:00;INICIATIVA;S;0;CENTRO BH;BH;610982.01;797558.77;6374
-6376;2001339826;B03000;AMEACA;RUA ESPINOSA;842;26024;24/6/2001 09:38:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608835.49;797841.84;6375
-6377;2001339854;B06000;LESAO CORPORAL;RODOVIA MGT 262;780;26598;24/6/2001 09:58:00;CIDADAO COMUM;S;;GOIANIA;BH;614725.95;803156.17;6376
-6378;2001339955;B03000;AMEACA;RUA CINQUENTA;280;106100;24/6/2001 11:19:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;608385.69;810923.86;6377
-6379;2001340050;B03000;AMEACA;RUA MADRE DOS AN;458;37172;24/6/2001 12:36:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612440.57;804452.14;6378
-6380;2001340053;B03000;AMEACA;RUA PAULO TIMOTE;99;41918;24/6/2001 12:38:00;CIDADAO COMUM;N;;VILA HUMAITA;BH;610259.40;801578.24;6379
-6381;2001340067;B02000;RIXA;RUA CRISPIM JAQU;1000;18609;24/6/2001 12:54:00;CIDADAO COMUM;S;0;VISTA ALEGRE;BH;604692.26;793120.54;6380
-6382;2001340072;B04001;HOMICIDIO TENTAD;AV FURQUIM WERNE;7;650;24/6/2001 12:57:00;CIDADAO COMUM;N;;TUPI;BH;612940.53;805718.72;6381
-6383;2001340100;B06000;LESAO CORPORAL;RUA CANDIDO LUCI;411;12568;24/6/2001 13:19:00;CIDADAO COMUM;N;0;PARQUE RIACHUELO;BH;609781.70;800106.89;6382
-6384;2001340192;B06000;LESAO CORPORAL;RUA JOSE LUIZ DI;518;83945;24/6/2001 14:33:00;CIDADAO COMUM;S;FU;ARAGUAIA;BH;605111.03;789825.22;6383
-6385;2001340194;B03000;AMEACA;AV BARBACENA;1009;8084;24/6/2001 14:35:00;CIDADAO COMUM;S;;SANTO AGOSTINHO;BH;609814.42;796318.09;6384
-6386;2001340208;B06000;LESAO CORPORAL;RUA LIBANIA PENA;619;40855;24/6/2001 14:47:00;POLICIAL MILITAR;N;;SAO BERNARDO;BH;610581.29;805061.10;6385
-6387;2001340245;B06000;LESAO CORPORAL;RUA MARECHAL RON;337;43677;24/6/2001 15:03:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611964.72;803360.61;6386
-6388;2001340400;B03000;AMEACA;RUA PADRE EUSTAQ;2183;51294;24/6/2001 16:22:00;INICIATIVA;S;;PADRE EUSTAQUIO;BH;607503.34;797614.57;6387
-6389;2001340449;B03000;AMEACA;RUA CINCO DE JUL;23;15670;24/6/2001 16:45:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612552.07;803842.49;6388
-6390;2001340457;B03000;AMEACA;RUA LENI AMARAL;344;75130;24/6/2001 16:51:00;CIDADAO COMUM;S;;PARQUE NOVO PROG;CO;602711.02;799959.00;6389
-6391;2001340462;B06000;LESAO CORPORAL;RUA CINQUENTA E ;127;74137;24/6/2001 16:52:00;CIDADAO COMUM;S;;NOVA YORK;BH;608631.53;811073.66;6390
-6392;2001340463;B03000;AMEACA;RUA F;52;47388;24/6/2001 16:53:00;CIDADAO COMUM;S;;VILA PINHO;BH;601062.53;788698.15;6391
-6393;2001340471;B06000;LESAO CORPORAL;RUA JOSE CLETO;1100;38682;24/6/2001 16:58:00;INICIATIVA;N;0;DOS PALMARES;BH;610290.19;802437.88;6392
-6394;2001340488;B06000;LESAO CORPORAL;AV AFONSO PENA;2300;1259;24/6/2001 17:05:00;CIDADAO COMUM;S;PX2300;FUNCIONARIOS;BH;611928.21;795711.43;6393
-6395;2001340501;B06000;LESAO CORPORAL;RUA JULIO MESQUI;43;81849;24/6/2001 17:11:00;CIDADAO COMUM;N;0;ITAIPU BH;BH;599327.39;788616.41;6394
-6396;2001340524;B03000;AMEACA;RUA 76;170;124249;24/6/2001 17:29:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607613.29;811768.50;6395
-6397;2001340526;B06000;LESAO CORPORAL;AV ABILIO MACHAD;1989;634;24/6/2001 17:33:00;INICIATIVA;N;0;GLORIA;BH;604187.17;799269.85;6396
-6398;2001340534;B02000;RIXA;RUA RIO DE JANEI;282;58772;24/6/2001 17:36:00;INICIATIVA;S;0;CENTRO (BH);BH;611181.78;797418.31;6397
-6399;2001340569;B06000;LESAO CORPORAL;RUA PURUS;540;55819;24/6/2001 17:56:00;CIDADAO COMUM;N;0;CONCORDIA;BH;610829.80;799382.32;6398
-6400;2001340573;B06000;LESAO CORPORAL;RUA DOUTOR ROBER;10;85610;24/6/2001 17:57:00;INICIATIVA;N;0;SERRA VERDE;BH;609549.68;809984.85;6399
-6401;2001340677;B06000;LESAO CORPORAL;RUA CORONEL OTAV;114;13620;24/6/2001 18:51:00;CIDADAO COMUM;N;;PARAISO;BH;614395.86;797635.16;6400
-6402;2001340697;B03000;AMEACA;RUA ALINE;907;2352;24/6/2001 18:59:00;INICIATIVA;N;0;PINDORAMA;BH;602382.96;798113.38;6401
-6403;2001340782;B04002;HOMICIDIO CONSUM;RUA DOZE;130;74178;24/6/2001 19:49:00;CIDADAO COMUM;N;;NOVA YORK;BH;608552.95;810735.96;6402
-6404;2001340784;B06000;LESAO CORPORAL;RUA CURITIBA;175;19090;24/6/2001 19:50:00;INICIATIVA;S;0;CENTRO (BH);BH;611005.46;797704.71;6403
-6405;2001340806;B06000;LESAO CORPORAL;RUA VEREADOR SOC;714;71586;24/6/2001 20:04:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;608704.45;797784.61;6404
-6406;2001340868;B06000;LESAO CORPORAL;AV CIVILIZACAO;315;51657;24/6/2001 20:36:00;INICIATIVA;S;0;JARDIM FLORENCIA;BH;604827.53;810045.09;6405
-6407;2001340871;B03000;AMEACA;RUA MARIA MERCES;225;69284;24/6/2001 20:37:00;INICIATIVA;S;0;TIROL;BH;600618.46;789134.05;6406
-6408;2001340883;B06000;LESAO CORPORAL;RUA DR BROCHADO;864;23215;24/6/2001 20:44:00;CIDADAO COMUM;S;LJ;VERA CRUZ;BH;615928.19;797908.73;6407
-6409;2001340891;B03000;AMEACA;RUA VINTE E TRES;133;300330;24/6/2001 20:48:00;CIDADAO COMUM;S;0;VILA CALIFORNIA;BH;604003.11;797234.46;6408
-6410;2001340977;B03000;AMEACA;RUA BARAO DE SAR;488;8043;24/6/2001 21:31:00;CIDADAO COMUM;S;AP903;HORTO;BH;613702.53;797827.39;6409
-6411;2001340990;B06000;LESAO CORPORAL;RUA CASTELO BRAN;271;14030;24/6/2001 21:37:00;INICIATIVA;S;0;SANTA TEREZINHA;BH;604254.63;802847.80;6410
-6412;2001340993;B03000;AMEACA;RUA JOSE LAVARIN;750;40537;24/6/2001 21:42:00;CIDADAO COMUM;S;;PARAISO;BH;614679.14;796705.60;6411
-6413;2001340995;B03000;AMEACA;RUA PEPERI;1000;53259;24/6/2001 21:41:00;CIDADAO COMUM;S;0;NOVA GRANADA;BH;608160.45;794166.42;6412
-6414;2001341005;B03000;AMEACA;RUA VALAO;96;80238;24/6/2001 21:50:00;CIDADAO COMUM;N;0;COQUEIROS;BH;602714.03;799499.21;6413
-6415;2001341087;B06000;LESAO CORPORAL;RUA ITAQUERA;232;35920;24/6/2001 22:35:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611011.46;799088.18;6414
-6416;2001341133;B06000;LESAO CORPORAL;RUA RADIALISTA C;182;99132;24/6/2001 23:01:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604926.16;808509.27;6415
-6417;2001341147;B04001;HOMICIDIO TENTAD;RUA COSTA DAS PA;1;74846;24/6/2001 23:06:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616667.46;804539.72;6416
-6418;2001341173;B04001;HOMICIDIO TENTAD;RUA PERUIBE;691;79610;24/6/2001 23:17:00;CIDADAO COMUM;N;0;PIRATININGA;BH;605780.79;809382.10;6417
-6419;2001341234;B04002;HOMICIDIO CONSUM;RUA RADIALISTA M;325;98864;25/6/2001 00:16:00;CIDADAO COMUM;N;;CEU AZUL;BH;604276.82;808882.62;6418
-6420;2001341291;B06000;LESAO CORPORAL;RUA DOUTOR CRIST;312;55598;25/6/2001 01:12:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604751.25;789297.85;6419
-6421;2001341296;B03000;AMEACA;AV LEONTINO FRAN;516;445;25/6/2001 01:21:00;CIDADAO COMUM;N;;SERRA VERDE;BH;609081.19;810348.74;6420
-6422;2001341312;B06000;LESAO CORPORAL;AV SARAMENHA;480;64007;25/6/2001 01:42:00;CIDADAO COMUM;S;INCI TPO4851 BPE;FLORAMAR;BH;612665.01;805817.21;6421
-6423;2001341326;B04002;HOMICIDIO CONSUM;AV PRESIDENTE AN;3073;4461;25/6/2001 02:13:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;609842.22;801019.10;6422
-6424;2001341328;B03000;AMEACA;RUA LUCIO FLAVIO;20;50972;25/6/2001 02:15:00;CIDADAO COMUM;N;;MINASCAIXA;BH;609454.19;809673.48;6423
-6425;2001341344;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;3963;17095;25/6/2001 02:35:00;INICIATIVA;S;0;SAGRADA FAMILIA;BH;613739.23;798444.60;6424
-6426;2001341467;B03000;AMEACA;RUA ALUISIO DE A;30;2642;25/6/2001 07:30:00;CIDADAO COMUM;N;BL 13  APTO 202;SANTA MONICA;BH;607420.66;808150.58;6425
-6427;2001341524;B03000;AMEACA;RUA CURRAL DEL R;60;19122;25/6/2001 08:25:00;CIDADAO COMUM;S;0;CABANA;BH;604726.85;793857.84;6426
-6428;2001341538;B06000;LESAO CORPORAL;AV BARAO HOMEM D;1843;7936;25/6/2001 08:34:00;CIDADAO COMUM;S;;NOVA GRANADA;BH;608102.37;793516.46;6427
-6429;2001341689;B03000;AMEACA;RUA ITABIRA;510;35237;25/6/2001 10:10:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610932.37;798497.33;6428
-6430;2001341703;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;138;67682;25/6/2001 10:18:00;CIDADAO COMUM;S;SL 501;FUNCIONARIOS;BH;612597.62;795925.49;6429
-6431;2001341736;B03000;AMEACA;RUA STA CATARINA;1234;60400;25/6/2001 10:48:00;INICIATIVA;N;0;LOURDES;BH;610316.02;795806.92;6430
-6432;2001341773;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;25/6/2001 11:08:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;6431
-6433;2001341899;B06000;LESAO CORPORAL;RUA BOACHA;381;9695;25/6/2001 12:33:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604969.79;797397.60;6432
-6434;2001341931;B06000;LESAO CORPORAL;ALAMEDA DIOGO GU;479;21336;25/6/2001 12:48:00;CIDADAO COMUM;S;CA4;VILA CASTANHEIRA;BH;601475.52;788466.09;6433
-6435;2001341976;B06000;LESAO CORPORAL;RUA NEFELINA;127;81228;25/6/2001 13:31:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612851.15;797300.76;6434
-6436;2001342212;B06000;LESAO CORPORAL;RUA BERNARDO GUI;20;9364;25/6/2001 16:05:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;612577.23;795634.07;6435
-6437;2001342216;B03000;AMEACA;RUA SESSENTA E N;98;78976;25/6/2001 16:06:00;CIDADAO COMUM;S;0;NOVA YORK;BH;608040.39;811378.70;6436
-6438;2001342219;B03000;AMEACA;RUA MARGARIDA AS;525;61226;25/6/2001 16:09:00;CIDADAO COMUM;S;;CALIFORNIA;BH;603087.78;796379.85;6437
-6439;2001342236;B03000;AMEACA;RUA CANA DA INDI;394;94848;25/6/2001 16:20:00;CIDADAO COMUM;S;;LINDEIA;BH;599823.12;790690.41;6438
-6440;2001342239;B03000;AMEACA;RUA OHM;12;49153;25/6/2001 16:22:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612164.04;803384.40;6439
-6441;2001342267;B06000;LESAO CORPORAL;RUA STO ANTONIO;218;61645;25/6/2001 16:42:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;609460.12;808275.49;6440
-6442;2001342592;B03000;AMEACA;RUA AQUIRI;105;5234;25/6/2001 19:38:00;INICIATIVA;S;;AARAO REIS;BH;612521.48;804887.66;6441
-6443;2001342609;B03000;AMEACA;RUA JABIRU;408;36485;25/6/2001 19:53:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;604475.87;788500.08;6442
-6444;2001342650;B03000;AMEACA;RUA CARMELITA PR;1189;17316;25/6/2001 20:16:00;CIDADAO COMUM;S;CAA;SALGADO FILHO;BH;606197.02;794264.22;6443
-6445;2001342661;B03000;AMEACA;RUA RITA DE CASS;80;61267;25/6/2001 20:26:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605839.44;793359.44;6444
-6446;2001342731;B03000;AMEACA;RUA DEZESSETE;573;32862;25/6/2001 21:15:00;CIDADAO COMUM;S;AP1;CONJUNTO FELICID;BH;612405.99;807435.12;6445
-6447;2001342784;B06000;LESAO CORPORAL;RUA JOSE BARTOLO;80;38525;25/6/2001 21:48:00;CIDADAO COMUM;N;BLC     AP107;CONJUNTO ALIPIO ;BH;603707.54;799638.81;6446
-6448;2001342991;B03000;AMEACA;AV AMAZONAS;4041;3140;26/6/2001 00:24:00;CIDADAO COMUM;S;;BARROCA;BH;607766.16;795855.52;6447
-6449;2001343131;B06000;LESAO CORPORAL;AV OLEGARIO MACI;579;49699;26/6/2001 03:36:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610560.87;797092.76;6448
-6450;2001343515;B03000;AMEACA;RUA DEZOITO;30;80225;26/6/2001 10:15:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605414.94;793346.67;6449
-6451;2001343616;B06000;LESAO CORPORAL;RUA MARECHAL RON;87;43677;26/6/2001 11:18:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611937.37;803522.85;6450
-6452;2001343618;B04001;HOMICIDIO TENTAD;AV ANTONIO ABRAH;1000;4320;26/6/2001 11:20:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;6451
-6453;2001343735;B03000;AMEACA;RUA DESCALVADO;204;19857;26/6/2001 12:37:00;CIDADAO COMUM;N;0;RENASCENCA;BH;611194.49;800550.72;6452
-6454;2001343766;B03000;AMEACA;RUA ALCINDO VIEI;583;1968;26/6/2001 12:54:00;CIDADAO COMUM;S;;BARREIRO;BH;602841.65;790669.84;6453
-6455;2001343767;B04001;HOMICIDIO TENTAD;RUA FLOR DE ABRI;27;28464;26/6/2001 12:54:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606010.63;798889.05;6454
-6456;2001343772;B03000;AMEACA;RUA JORNALISTA G;90;72172;26/6/2001 12:58:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;608897.05;807828.39;6455
-6457;2001343786;B03000;AMEACA;RUA AMIRO RODRIG;96;61862;26/6/2001 13:09:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608980.16;800113.60;6456
-6458;2001343970;B03000;AMEACA;PRACA PAULO VI;20;120424;26/6/2001 15:19:00;INICIATIVA;S;0;CONJUNTO ALIPIO ;BH;604118.40;799596.48;6457
-6459;2001344044;B06000;LESAO CORPORAL;AV DOM PEDRO II;2679;53145;26/6/2001 16:04:00;CIDADAO COMUM;S;SL3A;CARLOS PRATES;BH;608253.87;798143.37;6458
-6460;2001344097;B03000;AMEACA;RUA DOM SILVERIO;300;22496;26/6/2001 16:30:00;INICIATIVA;N;0;BELMONT;BH;615222.25;805374.99;6459
-6461;2001344115;B03000;AMEACA;RUA JOSE CLEMENT;70;84862;26/6/2001 16:36:00;CIDADAO COMUM;N;;DA LAGOA;BH;604781.02;809128.05;6460
-6462;2001344155;B03000;AMEACA;RUA ITAPETINGA;1341;35804;26/6/2001 17:02:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;609965.84;800605.10;6461
-6463;2001344199;B03000;AMEACA;RUA RIO DE JANEI;909;58772;26/6/2001 17:27:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611055.94;796826.34;6462
-6464;2001344224;B03000;AMEACA;RUA ODILON BRAGA;1058;49100;26/6/2001 17:37:00;CIDADAO COMUM;N;0;MANGABEIRAS;BH;612805.67;793445.11;6463
-6465;2001344256;B06000;LESAO CORPORAL;RUA DOS BANDOLIN;555;106980;26/6/2001 17:49:00;CIDADAO COMUM;S;BOLCO B.;CH CALIFORNIA;BH;603953.43;797197.40;6464
-6466;2001344299;B03000;AMEACA;RUA MARIA DA SIL;677;44323;26/6/2001 18:17:00;CIDADAO COMUM;N;0;GLORIA;BH;603855.74;798980.34;6465
-6467;2001344395;B06000;LESAO CORPORAL;RUA SENHORA DO P;10;62231;26/6/2001 19:10:00;CIDADAO COMUM;S;0;CINQUENTENARIO;BH;606327.84;791562.32;6466
-6468;2001344548;B03000;AMEACA;RUA CURIATA;60;19062;26/6/2001 20:53:00;CIDADAO COMUM;S;0;GUARANI;BH;612579.40;805613.07;6467
-6469;2001344656;B04002;HOMICIDIO CONSUM;RUA JURAMENTO;800;39732;26/6/2001 22:09:00;CIDADAO COMUM;S;0;SAUDADE;BH;615203.20;796976.91;6468
-6470;2001344657;B03000;AMEACA;AV AUGUSTO DE LI;361;6731;26/6/2001 22:09:00;INICIATIVA;S;APTO 904;CENTRO BH;BH;611054.26;796579.41;6469
-6471;2001344725;B03000;AMEACA;RUA DIVISA SANTA;306;21452;26/6/2001 22:45:00;CIDADAO COMUM;N;0;MILIONARIOS;BH;604260.70;790692.63;6470
-6472;2001344746;B06000;LESAO CORPORAL;RUA ARISTOLINO B;300;41089;26/6/2001 22:55:00;INICIATIVA;S;0;REGINA;BH;598924.48;790096.71;6471
-6473;2001344807;B04001;HOMICIDIO TENTAD;RUA ZURICK;9;74092;26/6/2001 23:30:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606533.22;796470.48;6472
-6474;2001344809;B06000;LESAO CORPORAL;AV AMAZONAS;139;3140;26/6/2001 23:32:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611360.40;797271.51;6473
-6475;2001344816;B03000;AMEACA;RUA MARIA PIETRA;125;2668;26/6/2001 23:35:00;INICIATIVA;N;0;SAO PAULO;BH;612440.02;802941.04;6474
-6476;2001344842;B03000;AMEACA;RUA JOAO ALFREDO;66;37447;26/6/2001 23:51:00;CIDADAO COMUM;S;;HORTO;BH;613906.31;798281.36;6475
-6477;2001344871;B03000;AMEACA;RUA ALABANDINA;629;35400;27/6/2001 00:15:00;CIDADAO COMUM;N;APT 102;CAICARA;BH;607975.49;799959.05;6476
-6478;2001345042;B02000;RIXA;RUA ANDALUZITA;13;3718;27/6/2001 05:36:00;CIDADAO COMUM;N;;CARMO;BH;611931.63;794855.16;6477
-6479;2001345207;B03000;AMEACA;RUA SAO PEDRO DA;12;102989;27/6/2001 08:30:00;CIDADAO COMUM;S;;OLHOS DAGUA;BH;608155.44;788331.27;6478
-6480;2001345348;B03000;AMEACA;RUA VISEU;1178;62042;27/6/2001 10:04:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609516.82;802452.66;6479
-6481;2001345361;B06000;LESAO CORPORAL;PRACA RIO BRANCO;100;58630;27/6/2001 10:21:00;INICIATIVA;S;0;CENTRO BH;BH;610794.50;797743.33;6480
-6482;2001345428;B03000;AMEACA;RUA ALCIDES GONC;61;1901;27/6/2001 11:15:00;CIDADAO COMUM;S;;CAMARGOS;BH;602711.47;794464.61;6481
-6483;2001345480;B03000;AMEACA;RUA MONTE ALVERN;563;46385;27/6/2001 12:03:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;607879.30;808121.62;6482
-6484;2001345568;B03000;AMEACA;RUA QUINTIL;536;96897;27/6/2001 13:17:00;CIDADAO COMUM;S;0;JARDIM ANA LUCIA;BH;609938.92;808861.42;6483
-6485;2001345579;B06000;LESAO CORPORAL;AV PARANA;523;52230;27/6/2001 13:24:00;INICIATIVA;N;PPM1.1;CENTRO (BH);BH;610725.40;796994.57;6484
-6486;2001345630;B03000;AMEACA;RUA LAGUNA;40;23170;27/6/2001 13:54:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617501.43;797020.37;6485
-6487;2001345723;B06000;LESAO CORPORAL;RUA PITANGUI;34;54365;27/6/2001 15:10:00;CIDADAO COMUM;S;FR168;SAO CRISTOVAO;BH;610522.93;799402.64;6486
-6488;2001345793;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;785;26052;27/6/2001 15:55:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611219.33;796898.46;6487
-6489;2001345931;B06000;LESAO CORPORAL;RUA MONTE ALVERN;563;46385;27/6/2001 17:09:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;607879.30;808121.62;6488
-6490;2001345982;B06000;LESAO CORPORAL;RUA FRANCISCO FE;40;29426;27/6/2001 17:34:00;CIDADAO COMUM;N;0;TUPI;BH;613135.84;805984.96;6489
-6491;2001346037;B06000;LESAO CORPORAL;RUA LILIA;96;83730;27/6/2001 18:03:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;606213.48;808831.98;6490
-6492;2001346067;B03000;AMEACA;RUA ABAIBA;218;561;27/6/2001 18:16:00;INICIATIVA;S;0;SAO PAULO;BH;612454.75;802727.11;6491
-6493;2001346081;B06000;LESAO CORPORAL;RUA ANTONIO ACAC;46;24564;27/6/2001 18:20:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600609.06;787448.50;6492
-6494;2001346145;B04001;HOMICIDIO TENTAD;RUA VILA REAL;87;60683;27/6/2001 18:58:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609915.68;801999.03;6493
-6495;2001346204;B04002;HOMICIDIO CONSUM;RUA CARACA;1071;12990;27/6/2001 19:27:00;INICIATIVA;N;0;SERRA;BH;613823.56;794597.43;6494
-6496;2001346328;B03000;AMEACA;RUA SAO MATEUS;171;20522;27/6/2001 20:41:00;CIDADAO COMUM;S;;CARDOSO;BH;603578.33;788323.16;6495
-6497;2001346357;B06000;LESAO CORPORAL;RUA TRINTA E OIT;212;34681;27/6/2001 21:01:00;CIDADAO COMUM;N;CAA;CONJUNTO FELICID;BH;612582.28;807355.59;6496
-6498;2001346377;B03000;AMEACA;RUA ORIENTAL;19;50364;27/6/2001 21:17:00;CIDADAO COMUM;S;CASA 160 NO BECO;SAO LUCAS;BH;613100.81;796033.16;6497
-6499;2001346396;B03000;AMEACA;RUA DIVINOPOLIS;253;21424;27/6/2001 21:30:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;613916.97;797543.46;6498
-6500;2001346469;B06000;LESAO CORPORAL;RUA SERVIDAO;93;170201;27/6/2001 22:26:00;CIDADAO COMUM;N;0;CABANA;BH;604396.96;794232.57;6499
-6501;2001346478;B03000;AMEACA;RUA CORONEL OTAV;20;13620;27/6/2001 22:32:00;CIDADAO COMUM;N;;POMPEIA;BH;614397.44;797674.95;6500
+COD;Nrbo;Nat;Descricao;Ender;Num;Logr;DataHora;Origem;Post;Comp;Bairro;Munic;X;Y;ID
+1;2001000025;B04001;HOMICIDIO TENTAD;RUA DO GROTAO;200;107217;1/1/2001 00:23:00;CIDADAO COMUM;S;;HAVAI;BH;607513.23;793290.01;0
+2;2001000059;B04001;HOMICIDIO TENTAD;RUA SAO CLEMENTE;1258;62197;1/1/2001 00:53:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609535.38;800385.58;1
+3;2001000068;B06000;LESAO CORPORAL;RUA CORONEL SEVE;830;18072;1/1/2001 00:58:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604805.84;789781.71;2
+4;2001000076;B06000;LESAO CORPORAL;RUA PADRE ODORIC;95;51629;1/1/2001 01:03:00;CIDADAO COMUM;S;0;SAO PEDRO;BH;611365.75;794708.98;3
+5;2001000088;B03000;AMEACA;RUA PADRE CYR AS;116;12091;1/1/2001 01:10:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612147.89;803583.29;4
+6;2001000091;B03000;AMEACA;RUA TRINTA E SET;54;34190;1/1/2001 01:11:00;CIDADAO COMUM;S;0;CONJUNTO FELICID;BH;612530.17;807443.42;5
+7;2001000199;B06000;LESAO CORPORAL;BECO UNIAO;60;302076;1/1/2001 02:23:00;CIDADAO COMUM;N;;VILA CASTANHEIRA;BH;601465.58;788609.45;6
+8;2001000202;B06000;LESAO CORPORAL;RUA JAGUARIBE;821;36822;1/1/2001 02:26:00;CIDADAO COMUM;S;FU;CONCORDIA;BH;611317.87;799724.84;7
+9;2001000234;B06000;LESAO CORPORAL;RUA GOVERNADOR M;23;31642;1/1/2001 02:47:00;CIDADAO COMUM;S;;GAMELEIRA;BH;606275.34;796492.16;8
+10;2001000271;B02000;RIXA;RUA ALVARO OLIVE;175;58381;1/1/2001 03:08:00;CIDADAO COMUM;S;CAA;MARIA VIRGINIA;BH;611835.32;802870.75;9
+11;2001000301;B06000;LESAO CORPORAL;RUA CONEGO TRIND;450;16861;1/1/2001 03:30:00;CIDADAO COMUM;S;B;JARDIM LEBLON;BH;605814.70;807064.01;10
+12;2001000319;B06000;LESAO CORPORAL;RUA PROFESSORA G;528;86335;1/1/2001 03:46:00;INICIATIVA;N;0;FLORAMAR;BH;611759.02;807690.27;11
+13;2001000363;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;1/1/2001 04:28:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;12
+14;2001000372;B03000;AMEACA;RUA JOSE DE FREI;100;99942;1/1/2001 04:36:00;CIDADAO COMUM;S;;PIRATININGA;BH;606412.42;809836.32;13
+15;2001000399;B04001;HOMICIDIO TENTAD;RUA GERALDO SILV;216;56588;1/1/2001 04:49:00;CIDADAO COMUM;N;LJA;RIO BRANCO;BH;606400.39;808660.43;14
+16;2001000422;B02000;RIXA;RUA JUREMA;553;39745;1/1/2001 05:08:00;CIDADAO COMUM;S;0;DA GRACA;BH;612108.35;799658.14;15
+17;2001000425;B04001;HOMICIDIO TENTAD;RUA CORONEL JOAQ;1202;87063;1/1/2001 05:13:00;CIDADAO COMUM;S;SL1408;CEU AZUL;BH;605036.32;808629.66;16
+18;2001000460;B04002;HOMICIDIO CONSUM;RUA ALFREDO ALVE;17;20636;1/1/2001 05:48:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608766.99;807874.12;17
+19;2001000467;B06000;LESAO CORPORAL;AV SILVA LOBO;667;65889;1/1/2001 05:55:00;CIDADAO COMUM;S;AN2;NOVA SUISSA;BH;607649.22;796002.23;18
+20;2001000508;B04001;HOMICIDIO TENTAD;RUA ITAIPU;170;35439;1/1/2001 06:43:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616260.45;798259.34;19
+21;2001000512;B06000;LESAO CORPORAL;RUA JURAMENTO;191;39732;1/1/2001 06:45:00;CIDADAO COMUM;S;;PARAISO;BH;614799.88;797390.14;20
+22;2001000514;B06000;LESAO CORPORAL;RUA JULIO MESQUI;100;81849;1/1/2001 06:47:00;INICIATIVA;S;0;ITAIPU BH;BH;599095.68;788673.49;21
+23;2001000515;B04001;HOMICIDIO TENTAD;BECO ALEGRE;10;77047;1/1/2001 06:48:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606081.83;794476.42;22
+24;2001000548;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;250;26052;1/1/2001 07:35:00;INICIATIVA;N;0;CENTRO (BH);BH;611330.13;797421.35;23
+25;2001000552;B06000;LESAO CORPORAL;RUA DIVINOPOLIS;253;21424;1/1/2001 07:40:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;613916.97;797543.46;24
+26;2001000662;B06000;LESAO CORPORAL;RUA ELISA DE CAR;38;9768;1/1/2001 09:40:00;CIDADAO COMUM;S;0;JARDIM ESTRELA;BH;607183.28;809980.10;25
+27;2001000713;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;685;6731;1/1/2001 10:36:00;INICIATIVA;N;0;CENTRO (BH);BH;610740.67;796659.40;26
+28;2001000719;B06000;LESAO CORPORAL;RUA CASTELO BRAN;100;14030;1/1/2001 10:40:00;CIDADAO COMUM;S;CAA;SANTA TEREZINHA;BH;604419.23;802582.27;27
+29;2001000865;B03000;AMEACA;RUA CORONEL EUGE;64;48324;1/1/2001 13:25:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613368.05;804242.96;28
+30;2001000866;B06000;LESAO CORPORAL;RUA JOAIMA;35;37359;1/1/2001 13:25:00;CIDADAO COMUM;S;CAC;JARDIM LEBLON;BH;605654.36;808186.87;29
+31;2001000912;B03000;AMEACA;AV ABILIO MACHAD;47;634;1/1/2001 14:16:00;INICIATIVA;N;0;INCONFIDENCIA;BH;605263.41;797972.47;30
+32;2001000946;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;1/1/2001 14:52:00;CIDADAO COMUM;S;;TIROL;BH;600947.66;789885.51;31
+33;2001000983;B06000;LESAO CORPORAL;RUA DIRCEU DUART;32;86902;1/1/2001 15:25:00;CIDADAO COMUM;S;;TREVO;BH;603501.37;806677.03;32
+34;2001001008;B04001;HOMICIDIO TENTAD;RUA FIRMINO DUAR;309;89879;1/1/2001 15:44:00;CIDADAO COMUM;N;CA;PALMEIRAS;BH;607146.75;791513.38;33
+35;2001001033;B04001;HOMICIDIO TENTAD;PRACA BAGATELLE;49;84720;1/1/2001 16:06:00;INICIATIVA;S;0;AEROPORTO DA PAM;BH;609324.75;804535.55;34
+36;2001001071;B03000;AMEACA;RUA ARISCO;50;74758;1/1/2001 16:40:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616713.81;804674.58;35
+37;2001001073;B03000;AMEACA;RUA CORREAS;575;87091;1/1/2001 16:41:00;CIDADAO COMUM;N;;BELVEDERE;BH;612014.79;792467.39;36
+38;2001001100;B03000;AMEACA;RUA VIRTULINO PI;250;130438;1/1/2001 17:05:00;CIDADAO COMUM;N;;OLARIA;BH;602132.24;789116.66;37
+39;2001001122;B04002;HOMICIDIO CONSUM;RUA GUIMARAES;1046;62953;1/1/2001 17:18:00;INICIATIVA;N;0;SAO FRANCISCO;BH;608640.25;801619.48;38
+40;2001001192;B03000;AMEACA;RUA FELISBURGO;290;3950;1/1/2001 18:07:00;CIDADAO COMUM;S;LJB;PROVIDENCIA;BH;612659.95;804501.51;39
+41;2001001235;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;6760;18652;1/1/2001 18:38:00;CIDADAO COMUM;N;TERREO;CELESTINO;BH;612122.58;803304.40;40
+42;2001001246;B03000;AMEACA;RUA PROFESSOR RO;245;30334;1/1/2001 18:47:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;607159.88;793820.71;41
+43;2001001249;B04001;HOMICIDIO TENTAD;RUA HILO ESTEVAM;126;94721;1/1/2001 18:51:00;CIDADAO COMUM;N;CAA;CASTELO;BH;605544.85;799870.90;42
+44;2001001294;B02000;RIXA;RUA PORANGA;180;54702;1/1/2001 19:15:00;CIDADAO COMUM;N;CAN;IPANEMA;BH;604697.48;798156.89;43
+45;2001001329;B03000;AMEACA;RUA REDENCAO;151;6413;1/1/2001 19:35:00;CIDADAO COMUM;S;;SAO JOSE;BH;605190.15;798573.66;44
+46;2001001378;B04001;HOMICIDIO TENTAD;RUA AUGUSTO CALH;113;6671;1/1/2001 20:04:00;CIDADAO COMUM;N;;TUPI;BH;613374.04;806556.45;45
+47;2001001391;B06000;LESAO CORPORAL;RUA ITAJUBA;2146;35495;1/1/2001 20:13:00;CIDADAO COMUM;N;0;SAGRADA FAMILIA;BH;612389.93;799465.33;46
+48;2001001505;B06000;LESAO CORPORAL;AV DO CONTORNO;1700;17228;1/1/2001 21:34:00;CIDADAO COMUM;N;PX1700;CENTRO (BH);BH;612216.60;797607.77;47
+49;2001001539;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;281;51657;1/1/2001 21:49:00;INICIATIVA;N;0;PIRATININGA;BH;605627.01;810002.31;48
+50;2001001585;B06000;LESAO CORPORAL;RUA DOS TAMOIOS;19;66825;1/1/2001 22:31:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611310.59;796955.28;49
+51;2001001638;B06000;LESAO CORPORAL;RUA LENI AMARAL;10;75130;1/1/2001 23:10:00;CIDADAO COMUM;N;0;PARQUE NOVO PROG;CO;602712.79;800069.59;50
+52;2001001639;B03000;AMEACA;RUA SERINGUEIRA;39;90471;1/1/2001 23:10:00;CIDADAO COMUM;S;;PATROCINIO;BH;605322.15;794242.76;51
+53;2001001663;B03000;AMEACA;RUA SERRA DA MOE;61;120796;1/1/2001 23:28:00;CIDADAO COMUM;S;AP304;ANTONIO RIBEIRO ;BH;614923.14;807439.28;52
+54;2001001754;B03000;AMEACA;AV DOS CLARINS;220;118337;2/1/2001 00:47:00;CIDADAO COMUM;S;0;CH CALIFORNIA;BH;604029.04;796740.78;53
+55;2001002036;B03000;AMEACA;RUA BEIRA LINHA;224;121732;2/1/2001 09:04:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615460.33;805397.29;54
+56;2001002178;B03000;AMEACA;RUA JULITA NOGUE;425;39597;2/1/2001 11:11:00;CIDADAO COMUM;N;FU;SARANDI (URCA/BH;BH;603736.32;802490.17;55
+57;2001002183;B03000;AMEACA;RUA PITT;231;54380;2/1/2001 11:14:00;CIDADAO COMUM;S;;UNIAO;BH;612654.99;801102.30;56
+58;2001002285;B03000;AMEACA;AV SEN LEVINDO C;1891;14866;2/1/2001 12:34:00;INICIATIVA;N;0;SANTA CECILIA;BH;600974.57;787879.14;57
+59;2001002303;B06000;LESAO CORPORAL;RUA CAMBUQUIRA;111;11830;2/1/2001 12:53:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;609340.52;798017.72;58
+60;2001002364;B06000;LESAO CORPORAL;AV BIAS FORTES;1772;9553;2/1/2001 13:51:00;CIDADAO COMUM;N;;BARRO PRETO;BH;610196.72;797244.85;59
+61;2001002489;B04001;HOMICIDIO TENTAD;RUA NEFELINA;14;81228;2/1/2001 15:27:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;612774.85;797219.81;60
+62;2001002662;B05000;SEQUESTRO E CARC;RUA ITARANA;39;35946;2/1/2001 17:19:00;CIDADAO COMUM;S;CSC;CAICARA;BH;607841.94;799963.57;61
+63;2001002694;B06000;LESAO CORPORAL;RUA MARECHAL RON;202;43677;2/1/2001 17:35:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611946.85;803377.88;62
+64;2001002795;B03000;AMEACA;RUA TANCREDO EST;106;66838;2/1/2001 18:40:00;INICIATIVA;S;0;SAO TOMAZ;BH;609723.18;805275.89;63
+65;2001002805;B03000;AMEACA;RUA MONTEIRO LOB;37;46590;2/1/2001 18:43:00;CIDADAO COMUM;S;;PROFESSOR WASHIN;IB;598805.74;789334.93;64
+66;2001002849;B03000;AMEACA;RUA JOAQUIM GOUV;565;1422;2/1/2001 18:57:00;POLICIAL MILITAR;S;0;SAO PAULO;BH;612537.01;803135.61;65
+67;2001002884;B03000;AMEACA;RUA ESTER DE LIM;288;26301;2/1/2001 19:10:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;611011.80;801489.74;66
+68;2001002908;B03000;AMEACA;RUA FERNAO DIAS;1022;28133;2/1/2001 19:20:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616049.67;798294.87;67
+69;2001002924;B06000;LESAO CORPORAL;RUA DOS VIOLONCE;410;125948;2/1/2001 19:26:00;CIDADAO COMUM;S;0;CH CALIFORNIA;BH;604013.72;797224.38;68
+70;2001002977;B03000;AMEACA;RUA MELCHIOR DIA;14;99577;2/1/2001 20:02:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616662.42;797200.41;69
+71;2001002991;B03000;AMEACA;RUA PADRE EUSTAQ;1284;51294;2/1/2001 20:10:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608346.53;797943.62;70
+72;2001003016;B03000;AMEACA;RUA SOARES NOGUE;52;66220;2/1/2001 20:23:00;CIDADAO COMUM;S;;VILA MAGNESITA;BH;602129.61;794910.94;71
+73;2001003022;B03000;AMEACA;RUA CARNEIRO DE ;94;127348;2/1/2001 20:26:00;CIDADAO COMUM;N;0;SAO PAULO;BH;612957.95;802850.74;72
+74;2001003052;B03000;AMEACA;RUA ITAPERUNA;130;35785;2/1/2001 20:46:00;INICIATIVA;S;0;SAUDADE;BH;614979.57;797450.46;73
+75;2001003054;B06000;LESAO CORPORAL;RUA JOSE GOMES;371;38802;2/1/2001 20:48:00;CIDADAO COMUM;N;;SARANDI (URCA/BH;BH;603642.20;802295.14;74
+76;2001003088;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;510;7936;2/1/2001 21:08:00;CIDADAO COMUM;S;FR449;NOVA SUISSA;BH;607529.85;795029.50;75
+77;2001003128;B04001;HOMICIDIO TENTAD;RUA DOIS;36;27130;2/1/2001 21:24:00;CIDADAO COMUM;S;0;PAULO VI;BH;616592.76;806783.71;76
+78;2001003160;B03000;AMEACA;AV DOM PEDRO II;3545;53145;2/1/2001 21:47:00;CIDADAO COMUM;N;0;ADELAIDE;BH;607409.82;797890.53;77
+79;2001003185;B03000;AMEACA;RUA GENTIOS;1350;30983;2/1/2001 22:03:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;608905.13;793585.28;78
+80;2001003196;B04001;HOMICIDIO TENTAD;RUA LEONCIO CHAG;236;40700;2/1/2001 22:06:00;CIDADAO COMUM;N;;UNIAO;BH;613064.02;800949.19;79
+81;2001003322;B03000;AMEACA;RUA PRINCESA IZA;45;23420;2/1/2001 23:28:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617682.03;797457.97;80
+82;2001003354;B03000;AMEACA;AV CLARA NUNES;306;45644;2/1/2001 23:54:00;CIDADAO COMUM;S;0;RENASCENCA;BH;611039.95;800586.09;81
+83;2001003374;B03000;AMEACA;AV JOSE CANDIDO ;1190;12602;3/1/2001 00:11:00;INICIATIVA;N;0;UNIAO;BH;613277.34;800584.46;82
+84;2001003377;B06000;LESAO CORPORAL;RUA 1;11;27156;3/1/2001 00:16:00;CIDADAO COMUM;N;0;PAULO SEXTO;BH;616440.05;806805.03;83
+85;2001003421;B06000;LESAO CORPORAL;RUA MARIA ROSA D;839;107800;3/1/2001 01:09:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606529.17;811742.51;84
+86;2001003422;B03000;AMEACA;RUA CONCEICAO DO;1280;68253;3/1/2001 01:11:00;CIDADAO COMUM;S;0;SANTA INES;BH;613887.33;801220.49;85
+87;2001003433;B08000;VIOLACAO DE DOMI;RUA DO PROGRESSO;50;25311;3/1/2001 01:29:00;CIDADAO COMUM;N;;TAQUARIL;BH;616998.11;797400.70;86
+88;2001003450;B04001;HOMICIDIO TENTAD;AV PRESIDENTE AN;1240;4461;3/1/2001 01:55:00;CIDADAO COMUM;N;;SAO CRISTOVAO;BH;610402.72;799177.41;87
+89;2001003489;B03000;AMEACA;RUA MARIA GERTRU;808;98993;3/1/2001 03:25:00;CIDADAO COMUM;S;;CEU AZUL;BH;604484.86;808826.28;88
+90;2001003554;B03000;AMEACA;AV CRISTIANO MAC;4000;18652;3/1/2001 05:23:00;INICIATIVA;N;0;DOS PALMARES;BH;612434.91;802092.92;89
+91;2001003563;B06000;LESAO CORPORAL;AV PAES DE ABREU;205;51758;3/1/2001 05:45:00;CIDADAO COMUM;S;0;ERMELINDA;BH;608960.89;800469.77;90
+92;2001003618;B03000;AMEACA;RUA EDSON;525;25050;3/1/2001 07:32:00;CIDADAO COMUM;S;0;UNIAO;BH;612997.48;801565.94;91
+93;2001003778;B03000;AMEACA;RUA JAGUARI;139;36807;3/1/2001 10:09:00;CIDADAO COMUM;N;;BONFIM;BH;609648.11;797805.24;92
+94;2001003868;B03000;AMEACA;AV AUGUSTO DE LI;134;6731;3/1/2001 11:36:00;CIDADAO COMUM;S;SJ;CENTRO (BH);BH;611209.44;796588.30;93
+95;2001004071;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;3/1/2001 14:06:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605855.99;798012.24;94
+96;2001004348;B06000;LESAO CORPORAL;RUA ARANTINA;134;58697;3/1/2001 16:59:00;CIDADAO COMUM;S;0;MINASLANDIA;BH;612191.42;804524.92;95
+97;2001004358;B03000;AMEACA;RUA JORNALISTA O;157;53057;3/1/2001 17:05:00;CIDADAO COMUM;S;0;EYMARD;BH;613530.40;803630.21;96
+98;2001004388;B06000;LESAO CORPORAL;AV CIVILIZACAO;655;51657;3/1/2001 17:20:00;POLICIAL MILITAR;S;0;LEBLON;BH;605180.09;810022.74;97
+99;2001004423;B04001;HOMICIDIO TENTAD;RUA SAO PAULO;279;63464;3/1/2001 17:40:00;CIDADAO COMUM;S;0;CENTRO BH;BH;611088.02;797493.26;98
+100;2001004516;B06000;LESAO CORPORAL;RUA MARTIM DE CA;723;44944;3/1/2001 18:36:00;INICIATIVA;S;0;SANTO AGOSTINHO;BH;609264.88;796048.94;99
+101;2001004539;B03000;AMEACA;RUA RAINHA DAS F;185;92159;3/1/2001 18:50:00;CIDADAO COMUM;S;0;FILADELFIA;BH;602133.38;797481.77;100
+102;2001004579;B03000;AMEACA;RUA FALCAO;200;27749;3/1/2001 19:08:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604919.00;788611.78;101
+103;2001004584;B06000;LESAO CORPORAL;AV EUGENIO RICAL;440;111568;3/1/2001 19:08:00;CIDADAO COMUM;S;;CORACAO EUCARIST;BH;605706.92;796121.88;102
+104;2001004611;B03000;AMEACA;AV SERRANA;530;65040;3/1/2001 19:27:00;CIDADAO COMUM;N;0;SERRANO;BH;603547.03;801432.44;103
+105;2001004672;B03000;AMEACA;RUA DOUTOR BENED;155;12252;3/1/2001 20:01:00;CIDADAO COMUM;S;;AARAO REIS;BH;612381.24;803451.51;104
+106;2001004728;B03000;AMEACA;AV CARANDAI;200;13081;3/1/2001 20:38:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612639.37;796065.46;105
+107;2001004771;B03000;AMEACA;RUA POLONIA;816;54541;3/1/2001 21:02:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605588.31;807537.18;106
+108;2001004858;B06000;LESAO CORPORAL;RUA DOUTOR CRIST;5655;55598;3/1/2001 21:53:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;606433.34;793314.02;107
+109;2001004861;B06000;LESAO CORPORAL;RUA RIO DAS FLOR;170;92770;3/1/2001 21:54:00;CIDADAO COMUM;S;;PILAR;BH;607837.36;788169.94;108
+110;2001005031;B06000;LESAO CORPORAL;ESTRADA DO CERCA;2265;26428;3/1/2001 23:49:00;CIDADAO COMUM;N;0;SAO DOMINGOS;BH;607618.88;793402.60;109
+111;2001005081;B06000;LESAO CORPORAL;RUA BAURU;270;8510;4/1/2001 00:19:00;CIDADAO COMUM;S;BL/08 CASA 65;PIRATININGA;BH;605644.06;809035.86;110
+112;2001005100;B06000;LESAO CORPORAL;RUA MARCIA WINDS;97;21478;4/1/2001 00:39:00;CIDADAO COMUM;N;;MINEIRAO;BH;601682.50;785249.63;111
+113;2001005192;B04001;HOMICIDIO TENTAD;RUA MUNIZ;149;170850;4/1/2001 01:53:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608113.39;793880.88;112
+114;2001005207;B03000;AMEACA;RUA CELIO DE CAS;185;14507;4/1/2001 02:13:00;CIDADAO COMUM;S;0;FLORESTA;BH;611275.26;797940.88;113
+115;2001005237;B06000;LESAO CORPORAL;AV OLEGARIO MACI;642;49699;4/1/2001 02:44:00;CIDADAO COMUM;N;EM FRENTE AO HOT;CENTRO (BH);BH;610498.04;797083.99;114
+116;2001005292;B02000;RIXA;AV AMAZONAS;4601;3140;4/1/2001 04:03:00;CIDADAO COMUM;N;;NOVA SUISSA;BH;607279.09;796018.67;115
+117;2001005297;B02000;RIXA;RUA DOS CAETES;372;11376;4/1/2001 04:11:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611253.80;797440.40;116
+118;2001005456;B03000;AMEACA;RUA JUSSARA;30;39859;4/1/2001 08:26:00;CIDADAO COMUM;S;AP101;DA GRACA;BH;611788.28;799174.80;117
+119;2001005492;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;4/1/2001 09:00:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;118
+120;2001005708;B03000;AMEACA;RUA CARLOS PINTO;176;107220;4/1/2001 11:26:00;CIDADAO COMUM;S;0;CH JATOBA IV;BH;600744.25;787612.36;119
+121;2001005758;B03000;AMEACA;RUA MUNIZ;100;170850;4/1/2001 12:15:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608081.16;793922.64;120
+122;2001005759;B03000;AMEACA;RUA QUARENTA E D;46;34830;4/1/2001 12:16:00;CIDADAO COMUM;N;CSC;CONJUNTO FELICID;BH;612592.89;807203.40;121
+123;2001005783;B03000;AMEACA;RUA JOAQUIM HENR;58;94371;4/1/2001 12:49:00;CIDADAO COMUM;S;CAZZ;OURO PRETO;BH;606222.37;801428.56;122
+124;2001005786;B03000;AMEACA;RUA ADOLFO LIPPI;140;114377;4/1/2001 12:50:00;CIDADAO COMUM;N;0;GARCAS;BH;604210.15;806428.13;123
+125;2001005875;B04002;HOMICIDIO CONSUM;RUA SOCRATES;24;85953;4/1/2001 13:58:00;CIDADAO COMUM;N;;DOM SILVERIO;BH;615325.98;804426.93;124
+126;2001006054;B03000;AMEACA;AV SILVA LOBO;1349;65889;4/1/2001 16:06:00;CIDADAO COMUM;S;PX1339;NOVA SUISSA;BH;607796.39;795312.06;125
+127;2001006300;B03000;AMEACA;RUA DOM RAFAEL;5;23026;4/1/2001 18:12:00;CIDADAO COMUM;S;;TAQUARIL;BH;617052.78;797306.19;126
+128;2001006317;B03000;AMEACA;RUA ELANEY;75;106517;4/1/2001 18:25:00;INICIATIVA;S;0;NOVA YORK;BH;608476.48;810630.48;127
+129;2001006394;B06000;LESAO CORPORAL;RUA JOSE BITES P;125;9263;4/1/2001 19:02:00;INICIATIVA;S;0;PLANALTO;BH;609866.26;807083.02;128
+130;2001006444;B03000;AMEACA;RUA PADRE PETROL;435;53577;4/1/2001 19:30:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;613153.17;798892.77;129
+131;2001006458;B06000;LESAO CORPORAL;RUA MARIANA BARC;271;62994;4/1/2001 19:35:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608942.35;800261.12;130
+132;2001006483;B06000;LESAO CORPORAL;BECO SOL NASCENT;146;301434;4/1/2001 19:47:00;CIDADAO COMUM;S;PX135;CAFEZAL;BH;614453.31;795387.14;131
+133;2001006531;B06000;LESAO CORPORAL;AV JOAQUIM DE OL;100;91852;4/1/2001 20:14:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605302.61;791288.17;132
+134;2001006561;B03000;AMEACA;RUA DOS TUPIS;560;69965;4/1/2001 20:30:00;INICIATIVA;N;0;CENTRO BH;BH;610743.92;796999.61;133
+135;2001006607;B04001;HOMICIDIO TENTAD;RUA DA PAZ;45;31236;4/1/2001 20:55:00;CIDADAO COMUM;N;0;CONJ HAB JARDIM ;BH;603918.54;798119.82;134
+136;2001006617;B03000;AMEACA;BECO PRINCIPAL;55;301983;4/1/2001 21:00:00;CIDADAO COMUM;S;0;SAO JOSE;BH;604808.72;799278.97;135
+137;2001006646;B03000;AMEACA;RUA DOS APIACAS;311;5032;4/1/2001 21:18:00;CIDADAO COMUM;S;;GLORIA;BH;602801.44;797853.30;136
+138;2001006695;B03000;AMEACA;RUA PADRE FEIJO;25;51326;4/1/2001 21:45:00;CIDADAO COMUM;N;0;SAUDADE;BH;614908.34;797473.24;137
+139;2001006713;B03000;AMEACA;RUA CIPRIANO DE ;65;15856;4/1/2001 21:53:00;CIDADAO COMUM;N;CS17;CINQUENTENARIO;BH;606432.80;793433.46;138
+140;2001006756;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;5393;18652;4/1/2001 22:14:00;INICIATIVA;N;0;DOS PALMARES;BH;612255.77;802179.75;139
+141;2001006798;B06000;LESAO CORPORAL;RUA CASTANHOLAS;10;100508;4/1/2001 22:46:00;CIDADAO COMUM;S;;MADRID;BH;611241.05;808632.80;140
+142;2001006824;B03000;AMEACA;RUA CACATUA;422;11219;4/1/2001 23:00:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604646.79;788784.90;141
+143;2001006941;B04002;HOMICIDIO CONSUM;RUA ANTARES;160;4244;5/1/2001 00:09:00;INICIATIVA;N;0;SANTA LUCIA;BH;610301.90;793066.15;142
+144;2001006955;B03000;AMEACA;AV CORONEL DURVA;25;17688;5/1/2001 00:15:00;INICIATIVA;N;0;DURVAL DE BARROS;BH;598751.16;791078.18;143
+145;2001007010;B03000;AMEACA;AV SILVA LOBO;883;65889;5/1/2001 00:58:00;INICIATIVA;S;0;NOVA SUISSA;BH;607689.30;795757.86;144
+146;2001007408;B06000;LESAO CORPORAL;AV DO CONTORNO;2660;17228;5/1/2001 09:03:00;CIDADAO COMUM;N;LJ4;CENTRO (BH);BH;612719.50;796848.35;145
+147;2001007413;B03000;AMEACA;RUA FLOR DE MAIO;101;300399;5/1/2001 09:08:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614412.83;794669.54;146
+148;2001007558;B03000;AMEACA;RUA JOANA ANGELI;975;37374;5/1/2001 10:47:00;CIDADAO COMUM;S;;MINASLANDIA;BH;612135.77;804101.78;147
+149;2001007565;B03000;AMEACA;RUA JOSE PINTO D;20;100901;5/1/2001 10:49:00;CIDADAO COMUM;S;0;JARDIM GUANABARA;BH;611479.65;807085.75;148
+150;2001007622;B03000;AMEACA;RUA MARECHAL BIT;476;43589;5/1/2001 11:36:00;CIDADAO COMUM;S;AP04;GUTIERREZ;BH;608965.94;795104.99;149
+151;2001007678;B03000;AMEACA;RUA MAESTRO JOSE;40;80760;5/1/2001 12:12:00;CIDADAO COMUM;S;AP602;NOVA SUISSA;BH;606643.01;795091.48;150
+152;2001007766;B03000;AMEACA;RUA OITO;35;117287;5/1/2001 13:10:00;CIDADAO COMUM;N;;LINDEIA;BH;600021.70;790389.81;151
+153;2001007775;B06000;LESAO CORPORAL;RUA DOS TUPIS;1253;69965;5/1/2001 13:16:00;CIDADAO COMUM;S;LJC;BARRO PRETO;BH;610089.19;797131.58;152
+154;2001007794;B03000;AMEACA;RUA MANNESMANN;250;42936;5/1/2001 13:26:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604801.53;790717.02;153
+155;2001007856;B06000;LESAO CORPORAL;AV BRASIL;1124;10420;5/1/2001 14:03:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;612027.86;796111.45;154
+156;2001007936;B03000;AMEACA;PRACA ESTEVAO LU;23;26314;5/1/2001 14:58:00;CIDADAO COMUM;N;LJ7;HORTO;BH;613259.16;797963.43;155
+157;2001007938;B03000;AMEACA;RUA JOSE SANTIAG;240;39152;5/1/2001 15:00:00;CIDADAO COMUM;N;CAFR;PIRAJA;BH;613860.40;803263.57;156
+158;2001007945;B03000;AMEACA;RUA SAGARANA;90;59848;5/1/2001 15:01:00;CIDADAO COMUM;S;0;SANTO ANTONIO;BH;610964.40;794592.76;157
+159;2001007961;B06000;LESAO CORPORAL;RUA ENGENHEIRO R;5;94214;5/1/2001 15:14:00;CIDADAO COMUM;N;CAFRENT;CARDOSO;BH;603229.05;788522.32;158
+160;2001008303;B06000;LESAO CORPORAL;RUA CURITIBA;495;19090;5/1/2001 18:13:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610917.19;797386.71;159
+161;2001008430;B03000;AMEACA;AV VISCONDE DE I;20;73289;5/1/2001 19:29:00;INICIATIVA;S;;BARREIRO;BH;602935.35;791287.83;160
+162;2001008451;B03000;AMEACA;RUA ALTINA DE AL;60;15351;5/1/2001 19:43:00;CIDADAO COMUM;S;L;MANTIQUEIRA;BH;607039.64;810032.05;161
+163;2001008533;B03000;AMEACA;RUA CARLOS PINTO;230;107220;5/1/2001 20:29:00;CIDADAO COMUM;N;;CH JATOBA IV;BH;600731.30;787610.33;162
+164;2001008539;B06000;LESAO CORPORAL;RUA ARTUR DE CAS;307;125428;5/1/2001 20:33:00;CIDADAO COMUM;N;;BELMONT;BH;615672.42;805539.35;163
+165;2001008620;B04001;HOMICIDIO TENTAD;RUA ITORORO;584;36154;5/1/2001 21:07:00;CIDADAO COMUM;S;AP101;PADRE EUSTAQUIO;BH;607305.95;797432.52;164
+166;2001008687;B04001;HOMICIDIO TENTAD;RUA MIGUEL PINTO;1473;128757;5/1/2001 21:52:00;CIDADAO COMUM;S;FR;NOVA ESPERANCA;BH;609007.48;799307.70;165
+167;2001008711;B03000;AMEACA;AV DO CONTORNO;2107;17228;5/1/2001 22:03:00;CIDADAO COMUM;S;FR;CENTRO (BH);BH;612416.86;797360.21;166
+168;2001008724;B03000;AMEACA;RUA HORTO;60;25973;5/1/2001 22:10:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617020.54;797738.78;167
+169;2001008756;B04001;HOMICIDIO TENTAD;AV ESPLANADA;199;126244;5/1/2001 22:28:00;CIDADAO COMUM;N;;SAO GABRIEL;BH;613212.38;804445.02;168
+170;2001008827;B04001;HOMICIDIO TENTAD;RUA CARLOS ETIEN;13;13356;5/1/2001 23:13:00;CIDADAO COMUM;S;0;SERRA;BH;613992.00;794863.88;169
+171;2001008940;B04001;HOMICIDIO TENTAD;RUA PEDRA CORAL;54;114005;6/1/2001 00:09:00;CIDADAO COMUM;N;0;PIRATININGA;BH;606451.75;808885.02;170
+172;2001008963;B03000;AMEACA;RUA MONTES CLARO;189;46650;6/1/2001 00:21:00;CIDADAO COMUM;S;0;CARMO;BH;611641.54;794467.80;171
+173;2001009004;B04001;HOMICIDIO TENTAD;RUA TEOFILO PIRE;117;67465;6/1/2001 00:48:00;CIDADAO COMUM;S;CSA;BOA VISTA;BH;615282.49;800096.43;172
+174;2001009074;B06000;LESAO CORPORAL;AV AMAZONAS;641;3140;6/1/2001 01:37:00;INICIATIVA;N;0;CENTRO BH;BH;610925.18;797013.32;173
+175;2001009120;B06000;LESAO CORPORAL;PRACA RAUL SOARE;28;58010;6/1/2001 02:07:00;CIDADAO COMUM;N;;LOURDES;BH;610531.41;796704.90;174
+176;2001009139;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;1454;6731;6/1/2001 02:20:00;CIDADAO COMUM;N;PX1454;BARRO PRETO;BH;609927.60;796926.67;175
+177;2001009238;B06000;LESAO CORPORAL;RUA FRANCISCO VE;90;29703;6/1/2001 03:39:00;INICIATIVA;N;0;TUPI;BH;612776.15;806731.54;176
+178;2001009242;B06000;LESAO CORPORAL;RUA PIUM I;1233;54393;6/1/2001 03:42:00;CIDADAO COMUM;N;AP12;SION;BH;611952.65;793761.39;177
+179;2001009326;B06000;LESAO CORPORAL;RUA JOAO DE PAUL;589;63032;6/1/2001 04:46:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;613318.42;799419.50;178
+180;2001009327;B04001;HOMICIDIO TENTAD;RUA JAGUARAO;286;36790;6/1/2001 04:47:00;CIDADAO COMUM;S;CAFU;BONFIM;BH;610034.79;798147.70;179
+181;2001009450;B06000;LESAO CORPORAL;RUA OTAVIANO PEN;545;128454;6/1/2001 07:23:00;CIDADAO COMUM;N;0;SERRA VERDE;BH;609655.77;810567.19;180
+182;2001009557;B06000;LESAO CORPORAL;RUA B;107;47637;6/1/2001 09:00:00;CIDADAO COMUM;N;;VILA CASTANHEIRA;BH;601135.26;788571.24;181
+183;2001009572;B03000;AMEACA;RUA DES BRAULIO;2070;19917;6/1/2001 09:13:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616352.52;797404.60;182
+184;2001009598;B06000;LESAO CORPORAL;RUA RAIMUNDO TIN;163;301229;6/1/2001 09:27:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610693.03;793106.49;183
+185;2001009667;B03000;AMEACA;RUA MARIA VIRGIN;20;24693;6/1/2001 10:29:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617298.30;797352.94;184
+186;2001009674;B06000;LESAO CORPORAL;AV DO CONTORNO;10555;17228;6/1/2001 10:34:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609494.49;797370.90;185
+187;2001009717;B06000;LESAO CORPORAL;RUA JOAQUIM HENR;145;94371;6/1/2001 11:05:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606357.63;801486.70;186
+188;2001009805;B03000;AMEACA;RUA DOS CAETES;515;11376;6/1/2001 12:25:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611105.83;797439.64;187
+189;2001009808;B04001;HOMICIDIO TENTAD;AV ELISIO DE BRI;789;25251;6/1/2001 12:26:00;CIDADAO COMUM;N;LJC;BOA VISTA;BH;615152.32;799844.87;188
+190;2001009814;B03000;AMEACA;RUA ZURICK;1122;74092;6/1/2001 12:30:00;POLICIAL MILITAR;S;0;NOVA SUISSA;BH;606773.32;795411.41;189
+191;2001009817;B03000;AMEACA;RUA HOFFMAN;83;33320;6/1/2001 12:33:00;CIDADAO COMUM;N;;SANTA CRUZ (BARR;BH;603763.82;789406.87;190
+192;2001009868;B03000;AMEACA;RODOVIA MGT 262;298;26598;6/1/2001 13:11:00;CIDADAO COMUM;S;0;VILA BRASILIA;BH;614655.94;803592.58;191
+193;2001009873;B03000;AMEACA;AV SANTA TEREZIN;705;61415;6/1/2001 13:16:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604567.76;802538.51;192
+194;2001009880;B06000;LESAO CORPORAL;RUA BASE;45;23836;6/1/2001 13:24:00;CIDADAO COMUM;S;;CARDOSO;BH;602968.44;788548.82;193
+195;2001009882;B03000;AMEACA;RUA JOSE SANTIAG;240;39152;6/1/2001 13:23:00;CIDADAO COMUM;N;0;PIRAJA;BH;613860.40;803263.57;194
+196;2001009914;B03000;AMEACA;RUA RUBENS FERRE;120;16339;6/1/2001 13:49:00;CIDADAO COMUM;N;;SAO SALVADOR;BH;602807.32;798925.23;195
+197;2001009935;B03000;AMEACA;RUA DEMETRIO RIB;361;19797;6/1/2001 14:02:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615665.70;798276.22;196
+198;2001009954;B06000;LESAO CORPORAL;RUA OSCAR LOBO P;270;104480;6/1/2001 14:23:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612347.11;803516.89;197
+199;2001010004;B03000;AMEACA;RUA DOS TIMBIRAS;2636;67682;6/1/2001 15:16:00;INICIATIVA;N;0;SANTO AGOSTINHO;BH;610194.40;796558.80;198
+200;2001010019;B06000;LESAO CORPORAL;RUA LEO MARENTE;95;94807;6/1/2001 15:22:00;CIDADAO COMUM;N;FU;JARDIM MONTANHES;BH;606344.73;799379.58;199
+201;2001010081;B06000;LESAO CORPORAL;AV SANTOS DUMONT;629;61950;6/1/2001 16:08:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611010.46;797549.36;200
+202;2001010097;B03000;AMEACA;RUA DO SERMAO;55;64990;6/1/2001 16:21:00;CIDADAO COMUM;S;A;SAO JOSE;BH;605696.31;798909.45;201
+203;2001010101;B03000;AMEACA;AV OTACILIO NEGR;640;50566;6/1/2001 16:21:00;INICIATIVA;S;0;JARDIM ATLANTICO;BH;607915.61;804275.70;202
+204;2001010121;B03000;AMEACA;AV PRESIDENTE AN;1880;4461;6/1/2001 16:34:00;INICIATIVA;S;0;SAO CRISTOVAO;BH;610064.06;799761.80;203
+205;2001010140;B03000;AMEACA;RUA EXPEDITO FLA;41;84847;6/1/2001 16:47:00;CIDADAO COMUM;S;0;DA LAGOA;BH;604809.35;809054.13;204
+206;2001010156;B03000;AMEACA;ESTRADA DO CERCA;1657;26428;6/1/2001 17:05:00;CIDADAO COMUM;N;0;JARDIM AMERICA;BH;607402.86;793956.59;205
+207;2001010201;B06000;LESAO CORPORAL;AV DOS ANDRADAS;560;3761;6/1/2001 17:31:00;INICIATIVA;N;0;CENTRO BH;BH;611447.51;797112.93;206
+208;2001010224;B03000;AMEACA;RUA VIANA DO CAS;65;63640;6/1/2001 17:42:00;CIDADAO COMUM;N;0;SAO FRANCISCO;BH;609912.68;802193.15;207
+209;2001010238;B06000;LESAO CORPORAL;RUA DOM PEDRITO;144;51300;6/1/2001 17:53:00;CIDADAO COMUM;N;;NOVA VISTA;BH;614736.17;800536.88;208
+210;2001010239;B06000;LESAO CORPORAL;RUA PERNAMBUCO;835;53463;6/1/2001 17:54:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611560.86;795440.65;209
+211;2001010252;B02000;RIXA;RUA MIOSOTIS;180;45859;6/1/2001 18:04:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;608901.95;798729.73;210
+212;2001010253;B03000;AMEACA;RUA JOVINO RODRI;244;85083;6/1/2001 18:06:00;CIDADAO COMUM;S;FR945;MANTIQUEIRA;BH;606548.35;810771.26;211
+213;2001010268;B03000;AMEACA;RUA MACHADO DE A;53;42214;6/1/2001 18:14:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610245.43;798573.73;212
+214;2001010415;B06000;LESAO CORPORAL;AV CRISTIANO MAC;5550;18652;6/1/2001 19:24:00;INICIATIVA;S;0;DOS PALMARES;BH;612348.26;802981.49;213
+215;2001010433;B06000;LESAO CORPORAL;RUA ITA;18;86593;6/1/2001 19:32:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616400.79;797361.07;214
+216;2001010448;B03000;AMEACA;RUA HEITOR A MON;233;119862;6/1/2001 19:38:00;INICIATIVA;S;;SERRA VERDE;BH;609591.23;811073.16;215
+217;2001010450;B04001;HOMICIDIO TENTAD;RUA CONCHAS;129;80178;6/1/2001 19:40:00;CIDADAO COMUM;N;CAB;COQUEIROS;BH;602679.62;799734.06;216
+218;2001010452;B03000;AMEACA;RUA GENERAL OZOR;930;30901;6/1/2001 19:41:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615902.29;797976.19;217
+219;2001010503;B02000;RIXA;RUA SANHARO;146;82044;6/1/2001 20:08:00;CIDADAO COMUM;S;CA3;SAO GABRIEL;BH;614094.42;804833.97;218
+220;2001010505;B06000;LESAO CORPORAL;AV DO CONTORNO;1822;17228;6/1/2001 20:09:00;CIDADAO COMUM;N;;FLORESTA;BH;612276.36;797514.41;219
+221;2001010543;B06000;LESAO CORPORAL;RUA DENES;11;31150;6/1/2001 20:35:00;CIDADAO COMUM;N;CJ2;CONJ HAB JARDIM ;BH;603875.61;798234.43;220
+222;2001010552;B03000;AMEACA;RUA COPEIA;824;17269;6/1/2001 20:39:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615664.60;799735.84;221
+223;2001010559;B06000;LESAO CORPORAL;RUA ANDIROBA;238;99882;6/1/2001 20:44:00;CIDADAO COMUM;N;;VILA SANTA BRANC;BH;604861.58;810000.41;222
+224;2001010650;B03000;AMEACA;RUA RAMIRO SIQUE;180;128858;6/1/2001 21:22:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617752.43;797349.60;223
+225;2001010723;B04001;HOMICIDIO TENTAD;RUA MOURA COSTA;151;72711;6/1/2001 21:59:00;CIDADAO COMUM;N;;PLANALTO;BH;609379.75;807147.29;224
+226;2001010764;B06000;LESAO CORPORAL;AV GENERAL OLIMP;236;329;6/1/2001 22:17:00;CIDADAO COMUM;N;;ITAPOA;BH;609013.66;806961.90;225
+227;2001010782;B04001;HOMICIDIO TENTAD;RUA EXPEDICIONAR;190;31627;6/1/2001 22:27:00;INICIATIVA;S;0;MARIA GORETTI;BH;614391.02;803230.73;226
+228;2001010789;B06000;LESAO CORPORAL;RUA SANTA CRUZ;42;60481;6/1/2001 22:33:00;CIDADAO COMUM;N;LJ01;VENDA NOVA;BH;608901.14;808750.75;227
+229;2001010804;B04001;HOMICIDIO TENTAD;RUA OHM;160;49153;6/1/2001 22:42:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612219.81;803558.99;228
+230;2001010919;B06000;LESAO CORPORAL;RUA AMANDO COUTO;651;3037;6/1/2001 23:48:00;INICIATIVA;S;0;SAO TOMAZ;BH;609953.26;805413.09;229
+231;2001010920;B04001;HOMICIDIO TENTAD;AV WALDOMIRO LOB;453;66548;6/1/2001 23:49:00;CIDADAO COMUM;S;;GUARANI;BH;612827.54;805381.24;230
+232;2001010951;B03000;AMEACA;PRACA ESMERALDA;2;25932;7/1/2001 00:05:00;CIDADAO COMUM;S;LJ02;PIRAJA;BH;613180.37;803029.37;231
+233;2001010955;B03000;AMEACA;RUA ITAIPU;1149;35439;7/1/2001 00:07:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616346.43;797993.47;232
+234;2001010966;B04001;HOMICIDIO TENTAD;AV CORONEL DURVA;459;17688;7/1/2001 00:13:00;INICIATIVA;N;0;DURVAL DE BARROS;BH;598326.03;790923.98;233
+235;2001010979;B06000;LESAO CORPORAL;RUA PROFESSORA G;709;86335;7/1/2001 00:20:00;INICIATIVA;N;0;FLORAMAR;BH;611863.73;807061.97;234
+236;2001010986;B06000;LESAO CORPORAL;RUA DA BOLIVIA;746;9884;7/1/2001 00:24:00;INICIATIVA;S;0;SION;BH;610943.73;793524.50;235
+237;2001010995;B03000;AMEACA;RUA MANOEL PEDRO;26;81892;7/1/2001 00:27:00;CIDADAO COMUM;S;A;MARIA GORETTI;BH;614266.81;803203.79;236
+238;2001010996;B03000;AMEACA;AV BRIGADEIRO ED;1213;2860;7/1/2001 00:30:00;CIDADAO COMUM;S;;GLORIA;BH;604077.57;798736.59;237
+239;2001011005;B03000;AMEACA;RUA DOS TUPIS;420;69965;7/1/2001 00:37:00;INICIATIVA;N;0;CENTRO BH;BH;610881.32;796955.33;238
+240;2001011056;B06000;LESAO CORPORAL;RUA FAISAO;115;27710;7/1/2001 01:09:00;CIDADAO COMUM;S;0;FLAVIO MARQUES D;BH;604790.92;789116.71;239
+241;2001011071;B03000;AMEACA;RUA LINCOLN;73;41136;7/1/2001 01:19:00;CIDADAO COMUM;S;;UNIAO;BH;612490.76;801290.23;240
+242;2001011080;B03000;AMEACA;RUA CARMELITA PR;1096;17316;7/1/2001 01:28:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;606179.87;794384.52;241
+243;2001011094;B04001;HOMICIDIO TENTAD;RUA GABRO;411;30435;7/1/2001 01:40:00;INICIATIVA;S;0;SANTA TEREZA;BH;612938.43;797259.63;242
+244;2001011190;B04001;HOMICIDIO TENTAD;AV SINFRONIO BRO;1201;66116;7/1/2001 02:50:00;INICIATIVA;N;0;BARREIRO;BH;602184.38;790705.71;243
+245;2001011241;B02000;RIXA;AV PRESIDENTE AN;2201;4461;7/1/2001 03:21:00;INICIATIVA;S;;CACHOEIRINHA;BH;609937.30;800018.63;244
+246;2001011262;B03000;AMEACA;RUA PEDRINOPOLIS;544;52980;7/1/2001 03:34:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605715.33;807080.47;245
+247;2001011272;B04001;HOMICIDIO TENTAD;RUA XAPURI;1145;73815;7/1/2001 03:44:00;INICIATIVA;S;;JARDIM AMERICA;BH;607415.47;793908.72;246
+248;2001011279;B06000;LESAO CORPORAL;RUA VASSOURAS;353;71369;7/1/2001 03:50:00;CIDADAO COMUM;S;0;SENHOR BOM JESUS;BH;609502.59;799678.80;247
+249;2001011291;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;3600;57830;7/1/2001 03:57:00;CIDADAO COMUM;S;0;ESTORIL;BH;609250.36;792265.54;248
+250;2001011318;B06000;LESAO CORPORAL;RUA FORMIGA;50;29136;7/1/2001 04:24:00;CIDADAO COMUM;S;;LAGOINHA;BH;610336.11;798756.88;249
+251;2001011391;B02000;RIXA;RUA SAO LAZARO;1089;63219;7/1/2001 05:42:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612506.27;799625.54;250
+252;2001011432;B04002;HOMICIDIO CONSUM;RUA PLOTINO;154;60541;7/1/2001 06:58:00;CIDADAO COMUM;N;;BELMONT;BH;615334.54;804870.99;251
+253;2001011471;B03000;AMEACA;AV SANTOS DUMONT;680;61950;7/1/2001 07:41:00;INICIATIVA;N;0;CENTRO (BH);BH;610999.13;797614.04;252
+254;2001011484;B06000;LESAO CORPORAL;RUA LADAINHA;80;40118;7/1/2001 07:47:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611966.74;803424.16;253
+255;2001011712;B03000;AMEACA;RUA AMANDA;5;91317;7/1/2001 11:30:00;CIDADAO COMUM;S;;CONJUNTO VISTA A;BH;605786.45;792731.99;254
+256;2001011727;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;1277;17228;7/1/2001 11:37:00;CIDADAO COMUM;N;;FLORESTA;BH;611851.77;797784.50;255
+257;2001011729;B04001;HOMICIDIO TENTAD;RUA VERDEJANTE;36;82085;7/1/2001 11:42:00;CIDADAO COMUM;N;CAFUND;SAO GABRIEL;BH;614028.89;804701.38;256
+258;2001011737;B06000;LESAO CORPORAL;RUA DO LAGO;130;40161;7/1/2001 11:48:00;CIDADAO COMUM;N;0;SAO MARCOS;BH;614043.12;802745.70;257
+259;2001011788;B03000;AMEACA;AV SARAMENHA;1525;64007;7/1/2001 12:30:00;CIDADAO COMUM;S;0;GUARANI;BH;613298.64;805560.73;258
+260;2001011803;B03000;AMEACA;RUA BOAVENTURA;866;9783;7/1/2001 12:45:00;CIDADAO COMUM;S;;VILA INDAIA;BH;609526.29;803265.21;259
+261;2001011816;B08000;VIOLACAO DE DOMI;AV AMAZONAS;2445;3140;7/1/2001 13:02:00;CIDADAO COMUM;S;PX1232;BARRO PRETO;BH;609381.70;796116.30;260
+262;2001011833;B03000;AMEACA;RUA GERALDO FERN;25;99611;7/1/2001 13:16:00;CIDADAO COMUM;S;;TUPI;BH;614138.51;806080.95;261
+263;2001011861;B04002;HOMICIDIO CONSUM;RUA JOAO NEIVA;342;38783;7/1/2001 13:37:00;CIDADAO COMUM;N;;BOA VISTA;BH;616140.07;800029.20;262
+264;2001011885;B06000;LESAO CORPORAL;RUA MUNIZ;5;170850;7/1/2001 13:58:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608082.99;793968.66;263
+265;2001011892;B06000;LESAO CORPORAL;RUA CARLOS NIEME;437;13472;7/1/2001 14:00:00;CIDADAO COMUM;N;0;SAGRADA FAMILIA;BH;613554.65;798857.84;264
+266;2001011907;B03000;AMEACA;RUA BRUNO FERRET;39;86827;7/1/2001 14:08:00;CIDADAO COMUM;N;;JARDIM ESTRELA;BH;607224.25;810342.62;265
+267;2001011954;B06000;LESAO CORPORAL;RUA PROFESSORA V;3;56893;7/1/2001 14:52:00;CIDADAO COMUM;S;CSA;CHACARAS REUNIDA;BH;605513.76;789431.48;266
+268;2001011962;B06000;LESAO CORPORAL;RUA ARANTINA;375;58697;7/1/2001 14:57:00;CIDADAO COMUM;S;;MINASLANDIA;BH;612163.22;804486.82;267
+269;2001012003;B03000;AMEACA;RUA CINQUENTA E ;198;106201;7/1/2001 15:27:00;CIDADAO COMUM;S;;NOVA YORK;BH;608663.41;810949.46;268
+270;2001012119;B06000;LESAO CORPORAL;RUA MARIANA OLIV;132;94573;7/1/2001 16:43:00;CIDADAO COMUM;S;;OURO PRETO;BH;606307.16;800636.59;269
+271;2001012120;B04001;HOMICIDIO TENTAD;RUA GENTIOS;1350;30983;7/1/2001 16:44:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;608905.13;793585.28;270
+272;2001012123;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;175;51657;7/1/2001 16:45:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;271
+273;2001012152;B06000;LESAO CORPORAL;RUA CURIMATA;481;48050;7/1/2001 17:06:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613956.09;804602.01;272
+274;2001012158;B03000;AMEACA;RUA RAMIRO SIQUE;180;128858;7/1/2001 17:09:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617752.43;797349.60;273
+275;2001012171;B03000;AMEACA;RUA ARACI;347;5335;7/1/2001 17:23:00;CIDADAO COMUM;S;;PINDORAMA;BH;602504.13;797676.24;274
+276;2001012176;B03000;AMEACA;RUA ANDARAI;22;3720;7/1/2001 17:24:00;CIDADAO COMUM;N;0;NOVA VISTA;BH;615259.17;800656.50;275
+277;2001012177;B03000;AMEACA;RUA ADOLFO CIOLE;620;20318;7/1/2001 17:24:00;CIDADAO COMUM;N;CA2;CARDOSO;BH;603802.34;787701.58;276
+278;2001346643;B03000;AMEACA;AV MEM DE SA;1224;45395;28/6/2001 00:37:00;POLICIAL MILITAR;S;0;SANTA EFIGENIA;BH;614262.45;796371.32;277
+279;2001346783;B03000;AMEACA;AV ELISIO DE BRI;426;25251;28/6/2001 03:54:00;INICIATIVA;N;0;BOA VISTA;BH;614758.16;799709.43;278
+280;2001347067;B06000;LESAO CORPORAL;RUA PROFESSORA G;707;86335;28/6/2001 09:26:00;CIDADAO COMUM;N;;FLORAMAR;BH;611863.73;807061.97;279
+281;2001347148;B04001;HOMICIDIO TENTAD;RUA MARIA ANTONI;35;103014;28/6/2001 10:29:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;605397.56;789332.51;280
+282;2001347198;B06000;LESAO CORPORAL;RUA LINDOLFO DE ;2148;41164;28/6/2001 11:06:00;INICIATIVA;S;0;SAO DOMINGOS;BH;607826.43;793671.48;281
+283;2001347210;B03000;AMEACA;BECO PEDRA VERDE;200;301698;28/6/2001 11:11:00;CIDADAO COMUM;S;PROX. BAR DA EVA;VILA CAFEZAL;BH;614697.65;795170.79;282
+284;2001347276;B06000;LESAO CORPORAL;ESTRADA BEIRA LI;475;10878;28/6/2001 12:03:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;616523.09;806630.25;283
+285;2001347323;B05000;SEQUESTRO E CARC;AV SILVA LOBO;1350;65889;28/6/2001 12:36:00;CIDADAO COMUM;S;SEQUETRO RELAMPA;NOVA SUISSA;BH;607813.65;795224.49;284
+286;2001347399;B06000;LESAO CORPORAL;RUA SAO PAULO;108;90213;28/6/2001 13:40:00;CIDADAO COMUM;N;FR;SARANDI (URCA/BH;BH;603053.55;802645.18;285
+287;2001347554;B03000;AMEACA;RUA DAS CLARINET;15;9119;28/6/2001 15:40:00;CIDADAO COMUM;S;;CH CALIFORNIA;BH;604022.46;796614.78;286
+288;2001347588;B06000;LESAO CORPORAL;AV DOS ANDRADAS;551;3761;28/6/2001 16:01:00;INICIATIVA;S;0;CENTRO BH;BH;611552.00;797031.24;287
+289;2001347690;B06000;LESAO CORPORAL;RUA JUNO;264;39629;28/6/2001 16:55:00;INICIATIVA;N;0;GLORIA;BH;604390.58;798253.34;288
+290;2001347752;B03000;AMEACA;RUA DOUTOR RIBEI;137;23650;28/6/2001 17:33:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;603479.43;793070.91;289
+291;2001347766;B04001;HOMICIDIO TENTAD;RUA CARLOS QUADR;236;13431;28/6/2001 17:41:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;605994.61;794519.63;290
+292;2001347878;B03000;AMEACA;AV FRANCISCO SA;360;29656;28/6/2001 18:52:00;CIDADAO COMUM;S;0;PRADO;BH;608929.98;796435.96;291
+293;2001347893;B03000;AMEACA;RUA VEREADOR ANT;67;93602;28/6/2001 18:59:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601901.25;786466.11;292
+294;2001347981;B03000;AMEACA;RUA TITO LIVIO;39;67828;28/6/2001 19:44:00;CIDADAO COMUM;S;;PRIMAVERA;BH;604537.21;798547.45;293
+295;2001348004;B06000;LESAO CORPORAL;RUA K;510;41495;28/6/2001 19:59:00;INICIATIVA;S;0;CH CONFISCO (CO);CO;602570.39;802980.95;294
+296;2001348244;B03000;AMEACA;RUA FLOR DE PITA;114;42949;28/6/2001 22:52:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;601585.95;786070.71;295
+297;2001348268;B03000;AMEACA;RUA ITARARE;21;35959;28/6/2001 23:07:00;CIDADAO COMUM;S;;CONCORDIA;BH;610756.05;799121.84;296
+298;2001348297;B06000;LESAO CORPORAL;RUA ARARIBA;539;5540;28/6/2001 23:23:00;CIDADAO COMUM;N;;SAO CRISTOVAO;BH;610505.35;799302.92;297
+299;2001348312;B06000;LESAO CORPORAL;AV PEDREIRA;66;52952;28/6/2001 23:38:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612837.94;804549.46;298
+300;2001348328;B03000;AMEACA;RUA MELODIA;53;301462;28/6/2001 23:49:00;CIDADAO COMUM;N;0;VILA CAFEZAL;BH;614240.36;795425.90;299
+301;2001348355;B04001;HOMICIDIO TENTAD;RUA CARMO DO RIO;100;13687;29/6/2001 00:06:00;INICIATIVA;S;0;PRADO LOPES;BH;609978.15;798887.53;300
+302;2001348374;B03000;AMEACA;RUA DES TEOFILO;46;20015;29/6/2001 00:25:00;CIDADAO COMUM;N;A;PEDRO SEGUNDO;BH;608693.98;798614.04;301
+303;2001348456;B03000;AMEACA;RUA DOS AIMORES;666;1640;29/6/2001 02:19:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611990.60;795940.64;302
+304;2001348463;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;3200;51657;29/6/2001 02:33:00;INICIATIVA;S;0;LETICIA;BH;607060.12;809957.54;303
+305;2001348510;B06000;LESAO CORPORAL;RUA FELIPE DOS S;531;27953;29/6/2001 03:58:00;CIDADAO COMUM;S;0;LOURDES;BH;610274.10;795492.35;304
+306;2001348553;B06000;LESAO CORPORAL;RUA TAIOBEIRAS;518;17168;29/6/2001 05:46:00;CIDADAO COMUM;S;;COQUEIROS;BH;602451.58;799029.95;305
+307;2001348639;B06000;LESAO CORPORAL;RUA MANOEL TAVAR;470;1536;29/6/2001 07:47:00;CIDADAO COMUM;N;0;GOIANIA;BH;614972.82;802744.77;306
+308;2001348673;B03000;AMEACA;RUA JOSE LIMA DE;81;73641;29/6/2001 08:15:00;CIDADAO COMUM;N;;FLORAMAR;BH;611399.18;806761.31;307
+309;2001348784;B03000;AMEACA;RUA DAS CANARIAS;18;64325;29/6/2001 09:23:00;CIDADAO COMUM;S;;JARDIM ATLANTICO;BH;608145.36;805911.71;308
+310;2001348794;B08000;VIOLACAO DE DOMI;RUA PROFESSORA G;654;86335;29/6/2001 09:33:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611900.95;807062.44;309
+311;2001348805;B06000;LESAO CORPORAL;RUA CESAR BERNAR;375;122675;29/6/2001 09:38:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604662.26;808108.81;310
+312;2001348867;B06000;LESAO CORPORAL;RUA SAO JOSE DO ;60;15465;29/6/2001 10:19:00;CIDADAO COMUM;S;;PLANALTO;BH;609807.84;806352.82;311
+313;2001348893;B06000;LESAO CORPORAL;RUA PROFESSORA G;654;86335;29/6/2001 10:33:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611900.95;807062.44;312
+314;2001348909;B03000;AMEACA;RUA SAO SILVESTR;50;116445;29/6/2001 10:43:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616542.19;805927.67;313
+315;2001348985;B03000;AMEACA;RUA ENGENHO DE D;643;25614;29/6/2001 11:39:00;CIDADAO COMUM;S;LJ11;CAICARA;BH;607887.64;799242.48;314
+316;2001349002;B06000;LESAO CORPORAL;AV GETULIO VARGA;1280;81256;29/6/2001 11:51:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611488.28;795119.52;315
+317;2001349018;B03000;AMEACA;RUA WALDEMAR DIA;439;15377;29/6/2001 12:00:00;CIDADAO COMUM;S;;CANDELARIA;BH;608268.08;808962.30;316
+318;2001349023;B03000;AMEACA;RUA MARCAZITA;75;43488;29/6/2001 12:02:00;CIDADAO COMUM;S;CAFU;SAO CRISTOVAO;BH;610039.61;799325.32;317
+319;2001349037;B03000;AMEACA;RUA EXPEDITO RIB;168;41467;29/6/2001 12:14:00;CIDADAO COMUM;S;;VILA SUZANA;BH;611846.11;803060.50;318
+320;2001349150;B06000;LESAO CORPORAL;RUA JOAO GUALBER;150;68414;29/6/2001 13:41:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608949.69;808085.04;319
+321;2001349249;B06000;LESAO CORPORAL;RUA PADRE EUSTAQ;125;51294;29/6/2001 15:03:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;609409.13;797633.34;320
+322;2001349380;B06000;LESAO CORPORAL;RUA JOANA D'ARC;133;37387;29/6/2001 16:27:00;CIDADAO COMUM;S;0;MINASLANDIA;BH;611958.71;804054.10;321
+323;2001349384;B08000;VIOLACAO DE DOMI;RUA DOUTOR RIBEI;414;23650;29/6/2001 16:28:00;CIDADAO COMUM;S;NR CORRETO 422.;DAS INDUSTRIAS;BH;603510.74;792720.82;322
+324;2001349436;B09000;ABANDONO DE INCA;RUA CATANDUVAS;560;14217;29/6/2001 16:49:00;CIDADAO COMUM;N;0;RENASCENCA;BH;610845.32;800521.36;323
+325;2001349513;B06000;LESAO CORPORAL;RUA DOUTOR BENED;423;12252;29/6/2001 17:33:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;612546.01;803738.77;324
+326;2001349599;B03000;AMEACA;RUA PONTA GROSSA;392;14900;29/6/2001 18:22:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604863.70;789804.10;325
+327;2001349728;B06000;LESAO CORPORAL;RUA CAPA PRETA;509;14232;29/6/2001 19:25:00;CIDADAO COMUM;N;;JOAO PINHEIRO;BH;604842.89;795724.14;326
+328;2001349752;B03000;AMEACA;AV STA ROSA;345;61301;29/6/2001 19:41:00;CIDADAO COMUM;N;;SAO LUIZ;BH;608850.97;804571.43;327
+329;2001349784;B03000;AMEACA;RUA MICA;109;45685;29/6/2001 20:02:00;CIDADAO COMUM;S;0;SAO LUCAS;BH;613238.00;796036.84;328
+330;2001349789;B04002;HOMICIDIO CONSUM;RUA AGUAS DE LIN;65;40902;29/6/2001 20:00:00;CIDADAO COMUM;N;;ITAIPU BH;BH;599247.70;788871.68;329
+331;2001349849;B03000;AMEACA;RUA W TRES;10;122621;29/6/2001 20:43:00;CIDADAO COMUM;S;;PONGELUPE;BH;603702.18;787305.62;330
+332;2001349987;B03000;AMEACA;RUA ANTONIO VIEI;436;4925;29/6/2001 22:16:00;CIDADAO COMUM;N;;GLALIJA;BH;603363.05;794230.23;331
+333;2001350071;B06000;LESAO CORPORAL;AV PERIMETRAL;307;78531;29/6/2001 23:08:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601415.66;788841.83;332
+334;2001350156;B04001;HOMICIDIO TENTAD;RUA QUINZE;18;122215;29/6/2001 23:58:00;CIDADAO COMUM;N;0;JARDIM DOS COMER;BH;607720.46;810683.19;333
+335;2001350158;B04001;HOMICIDIO TENTAD;RUA JOAQUIM DE F;140;38033;30/6/2001 00:00:00;CIDADAO COMUM;S;AN2;BARREIRO;BH;602884.71;791123.78;334
+336;2001350190;B06000;LESAO CORPORAL;RUA URSULA PAULI;2338;71066;30/6/2001 00:22:00;CIDADAO COMUM;S;;CH BONSUCESSO;BH;605473.82;791757.57;335
+337;2001350212;B06000;LESAO CORPORAL;AV AMAZONAS;5800;3140;30/6/2001 00:47:00;INICIATIVA;S;0;GAMELEIRA;BH;606262.47;795876.96;336
+338;2001350216;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;30/6/2001 00:50:00;CIDADAO COMUM;S;;TIROL;BH;600947.66;789885.51;337
+339;2001350230;B06000;LESAO CORPORAL;RUA ANTONIO MART;5;4676;30/6/2001 01:01:00;CIDADAO COMUM;S;0;ESTRELA DO ORIEN;BH;605805.26;792166.99;338
+340;2001350332;B03000;AMEACA;RUA MINAS NOVAS;108;45818;30/6/2001 02:36:00;CIDADAO COMUM;S;0;CRUZEIRO;BH;612204.10;794772.00;339
+341;2001350344;B03000;AMEACA;AV CIVILIZACAO;911;51657;30/6/2001 02:51:00;INICIATIVA;S;0;JARDIM FLORENCIA;BH;609133.74;808652.87;340
+342;2001350345;B06000;LESAO CORPORAL;AV SANTOS DUMONT;597;61950;30/6/2001 02:52:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611065.32;797537.18;341
+343;2001350351;B08000;VIOLACAO DE DOMI;AV PRUDENTE DE M;1220;55774;30/6/2001 02:57:00;CIDADAO COMUM;N;0;CORACAO DE JESUS;BH;610007.32;794115.40;342
+344;2001350396;B06000;LESAO CORPORAL;AV ITAU;955;36025;30/6/2001 03:38:00;CIDADAO COMUM;N;0;DOM BOSCO;BH;604558.93;796915.41;343
+345;2001350406;B06000;LESAO CORPORAL;AV AMAZONAS;5800;3140;30/6/2001 03:54:00;INICIATIVA;S;0;GAMELEIRA;BH;606262.47;795876.96;344
+346;2001350523;B06000;LESAO CORPORAL;RUA POLYCARPO DE;600;115137;30/6/2001 07:29:00;CIDADAO COMUM;S;CA02;BANDEIRANTES;BH;604403.57;803709.10;345
+347;2001350570;B06000;LESAO CORPORAL;RUA RADIALISTA A;390;100031;30/6/2001 08:14:00;CIDADAO COMUM;S;;CEU AZUL;BH;604019.52;808819.00;346
+348;2001350625;B03000;AMEACA;AV OLEGARIO MACI;188;49699;30/6/2001 08:53:00;CIDADAO COMUM;S;LJ08;CENTRO (BH);BH;610617.38;797516.23;347
+349;2001350666;B03000;AMEACA;RUA DES BRAULIO;1210;19917;30/6/2001 09:25:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616240.69;797882.85;348
+350;2001350716;B04002;HOMICIDIO CONSUM;RUA GRAUNAS;449;31797;30/6/2001 10:05:00;CIDADAO COMUM;N;CAFU;VILA CEMIG;BH;605631.69;788709.00;349
+351;2001350786;B03000;AMEACA;RUA PINTORA DJAN;60;129255;30/6/2001 10:49:00;CIDADAO COMUM;S;CA01;TUPI;BH;614207.76;806225.28;350
+352;2001350795;B03000;AMEACA;RUA ALUIZIO DAVI;740;9770;30/6/2001 10:55:00;CIDADAO COMUM;S;LJ21;OURO PRETO;BH;606194.96;801103.04;351
+353;2001350799;B03000;AMEACA;RUA ENCOSTA;12;20406;30/6/2001 10:57:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607344.77;807411.00;352
+354;2001350990;B03000;AMEACA;RUA SALITRE;245;60006;30/6/2001 13:38:00;CIDADAO COMUM;S;CAFU;CACHOEIRINHA;BH;611049.66;801460.02;353
+355;2001351032;B03000;AMEACA;RUA SAO LAZARO;1099;63219;30/6/2001 14:11:00;CIDADAO COMUM;S;CAB;SAGRADA FAMILIA;BH;612509.83;799636.46;354
+356;2001351050;B06000;LESAO CORPORAL;RUA VOLTA REDOND;218;73600;30/6/2001 14:22:00;CIDADAO COMUM;S;;CARDOSO;BH;603536.07;787805.19;355
+357;2001351074;B03000;AMEACA;RUA BERNARDO CIS;301;9351;30/6/2001 14:38:00;POLICIAL MILITAR;N;AN1;PARQUE RIACHUELO;BH;609625.53;799953.65;356
+358;2001351147;B03000;AMEACA;RUA URSULA PAULI;2303;71066;30/6/2001 15:27:00;CIDADAO COMUM;S;0;CH BONSUCESSO;BH;605518.68;791726.85;357
+359;2001351158;B03000;AMEACA;BECO LUIZ ALBERT;36;300741;30/6/2001 15:31:00;CIDADAO COMUM;S;;HORTO;BH;613875.22;798204.15;358
+360;2001351160;B08000;VIOLACAO DE DOMI;RUA GASTAO BRAUL;229;103304;30/6/2001 15:32:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605464.66;795301.09;359
+361;2001351197;B03000;AMEACA;AV ALVARO DA SIL;480;2872;30/6/2001 15:47:00;CIDADAO COMUM;N;0;BARREIRO;BH;602448.91;791262.85;360
+362;2001012206;B03000;AMEACA;RUA ESTRELA DA J;138;26705;7/1/2001 17:36:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604749.69;793333.72;361
+363;2001012218;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;322;51657;7/1/2001 17:47:00;CIDADAO COMUM;S;0;VILA SANTO ANTON;BH;609650.08;808286.90;362
+364;2001012223;B06000;LESAO CORPORAL;RUA ITAPETINGA;1341;35804;7/1/2001 17:51:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;609965.84;800605.10;363
+365;2001012232;B03000;AMEACA;RUA JOVINA GOMES;503;70454;7/1/2001 17:55:00;CIDADAO COMUM;S;;LETICIA;BH;607250.11;809471.34;364
+366;2001012264;B06000;LESAO CORPORAL;RUA AUTA DE SOUZ;106;95374;7/1/2001 18:17:00;CIDADAO COMUM;S;;SANTA MARIA;BH;603542.99;795180.27;365
+367;2001012265;B04001;HOMICIDIO TENTAD;RUA BATISTA CARN;190;8419;7/1/2001 18:17:00;CIDADAO COMUM;S;CAFU;SALGADO FILHO;BH;606473.20;794973.26;366
+368;2001012319;B03000;AMEACA;RUA MARTINS ALVE;838;45023;7/1/2001 18:57:00;CIDADAO COMUM;S;;NOVA ESPERANCA;BH;608959.70;799444.10;367
+369;2001012348;B06000;LESAO CORPORAL;RUA OLIVIO RODRI;24;49976;7/1/2001 19:11:00;CIDADAO COMUM;S;CSA;NOVA VISTA;BH;614970.31;800898.62;368
+370;2001012375;B04001;HOMICIDIO TENTAD;AV DA SINFONIA;437;101627;7/1/2001 19:28:00;CIDADAO COMUM;N;0;SANTA AMELIA;BH;607345.20;806795.49;369
+371;2001012423;B06000;LESAO CORPORAL;RUA FRANCISCO VE;27;29703;7/1/2001 19:52:00;CIDADAO COMUM;S;;TUPI;BH;612704.06;806765.25;370
+372;2001012442;B02000;RIXA;RUA SAO PEDRO DA;410;102989;7/1/2001 20:01:00;CIDADAO COMUM;S;0;OLHOS DAGUA;BH;607826.44;788139.72;371
+373;2001012480;B02000;RIXA;RUA DA BAHIA;10;81155;7/1/2001 20:19:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611510.18;797579.14;372
+374;2001012491;B03000;AMEACA;RUA HILO ESTEVAM;21;94721;7/1/2001 20:21:00;CIDADAO COMUM;S;;CASTELO;BH;605600.44;799917.04;373
+375;2001012528;B03000;AMEACA;RUA LUCIA MIGUEL;446;41555;7/1/2001 20:41:00;CIDADAO COMUM;S;0;TUPI;BH;612593.89;806369.45;374
+376;2001012544;B06000;LESAO CORPORAL;RUA SERESTA;14;301463;7/1/2001 20:48:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614046.73;795320.77;375
+377;2001012622;B06000;LESAO CORPORAL;RUA OLIMPIO DA S;45;28045;7/1/2001 21:24:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612550.80;803827.00;376
+378;2001012707;B06000;LESAO CORPORAL;BECO FREI MARIAN;120;300767;7/1/2001 22:10:00;CIDADAO COMUM;S;NR 195 CORRETO;CARLOS PRATES;BH;608761.56;797834.53;377
+379;2001012725;B06000;LESAO CORPORAL;RUA DAS CANOAS;531;12669;7/1/2001 22:19:00;CIDADAO COMUM;S;0;ESTRELA DO ORIEN;BH;605578.92;792635.96;378
+380;2001012737;B04001;HOMICIDIO TENTAD;RUA QUARENTA E O;124;35048;7/1/2001 22:26:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612791.10;806999.98;379
+381;2001012739;B04001;HOMICIDIO TENTAD;RUA PAULO DE FRO;95;52722;7/1/2001 22:24:00;INICIATIVA;S;0;CENTRO (BH);BH;610759.34;797631.71;380
+382;2001012794;B06000;LESAO CORPORAL;RUA DUZENTOS E Q;44;24321;7/1/2001 22:56:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600616.01;787089.50;381
+383;2001012852;B06000;LESAO CORPORAL;RUA CARLOS SA;300;13520;7/1/2001 23:25:00;CIDADAO COMUM;N;0;COPACABANA;BH;606083.57;805652.90;382
+384;2001013025;B08000;VIOLACAO DE DOMI;RUA VILA RICA;843;71992;8/1/2001 01:05:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;606711.67;797747.92;383
+385;2001013035;B06000;LESAO CORPORAL;RUA ANA JOSEFINA;64;85521;8/1/2001 01:12:00;CIDADAO COMUM;N;0;SAO JOAO BATISTA;BH;608128.63;807571.42;384
+386;2001013105;B04001;HOMICIDIO TENTAD;RUA SAUL;65;170891;8/1/2001 02:15:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608165.20;793608.91;385
+387;2001013168;B06000;LESAO CORPORAL;RUA DOS AIMORES;2198;1640;8/1/2001 03:15:00;INICIATIVA;N;0;BARRO PRETO;BH;610507.20;796334.72;386
+388;2001013289;B03000;AMEACA;RUA COQUEIROS;270;17297;8/1/2001 07:00:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610594.69;801052.44;387
+389;2001013379;B03000;AMEACA;RUA SANTAREM;343;61484;8/1/2001 08:09:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605767.46;793810.29;388
+390;2001013420;B06000;LESAO CORPORAL;RUA JOSE ANTENOR;141;97483;8/1/2001 08:38:00;CIDADAO COMUM;S;;HELIOPOLIS;BH;611315.24;805296.94;389
+391;2001013489;B03000;AMEACA;RUA SAO MATIAS;397;63408;8/1/2001 09:22:00;CIDADAO COMUM;S;;SERRANO;BH;603549.73;800736.58;390
+392;2001013529;B06000;LESAO CORPORAL;RUA FLOR DO BAIL;278;28480;8/1/2001 09:50:00;CIDADAO COMUM;S;0;JARDIM MONTANHES;BH;606264.34;799574.20;391
+393;2001013633;B06000;LESAO CORPORAL;RUA DOS CACTOS;568;73119;8/1/2001 11:19:00;CIDADAO COMUM;S;;LINDEIA;BH;599166.10;790634.92;392
+394;2001013700;B03000;AMEACA;RUA IZABEL GLANS;230;99678;8/1/2001 12:11:00;CIDADAO COMUM;S;CAA;INDUSTRIAL RODRI;BH;616223.51;808595.24;393
+395;2001013798;B03000;AMEACA;RUA CARANCHO;22;13079;8/1/2001 13:27:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604506.63;788542.81;394
+396;2001013800;B03000;AMEACA;RUA MATERLANDIA;8;45124;8/1/2001 13:28:00;CIDADAO COMUM;S;;SANTA INES;BH;613935.57;801097.60;395
+397;2001013969;B03000;AMEACA;RUA BARAO DE AIU;662;7835;8/1/2001 15:22:00;CIDADAO COMUM;S;;ALTO DOS PINHEIR;BH;604250.87;796242.09;396
+398;2001013977;B03000;AMEACA;AV OLEGARIO MACI;208;49699;8/1/2001 15:24:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610610.60;797496.18;397
+399;2001013982;B04001;HOMICIDIO TENTAD;AV AMERICO VESPU;40;3355;8/1/2001 15:25:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609791.15;800757.25;398
+400;2001014145;B06000;LESAO CORPORAL;ESTRADA BEIRA LI;31;10878;8/1/2001 16:57:00;CIDADAO COMUM;N;REF:CASA DE RACO;SAO GABRIEL;BH;616119.62;806734.88;399
+401;2001014146;B03000;AMEACA;RUA FRANCISCO AS;275;15641;8/1/2001 16:59:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604904.12;791193.78;400
+402;2001014291;B06000;LESAO CORPORAL;RUA GUAICURUS;436;32009;8/1/2001 18:24:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611227.45;797639.92;401
+403;2001014298;B03000;AMEACA;RUA SAO PAULO;672;63464;8/1/2001 18:26:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610954.65;797132.32;402
+404;2001014342;B03000;AMEACA;RUA PRIMEIRO DE ;135;55226;8/1/2001 18:51:00;CIDADAO COMUM;S;;APARECIDA;BH;609171.85;799995.94;403
+405;2001014358;B06000;LESAO CORPORAL;RUA ROSANGELA;198;59328;8/1/2001 18:55:00;CIDADAO COMUM;S;;DA LAGOA;BH;604499.11;809027.11;404
+406;2001014446;B04001;HOMICIDIO TENTAD;RUA TURQUESA;483;70035;8/1/2001 19:42:00;INICIATIVA;N;0;PRADO;BH;608600.91;796259.29;405
+407;2001014458;B04001;HOMICIDIO TENTAD;BECO PAI JOAQUIM;25;171056;8/1/2001 19:42:00;CIDADAO COMUM;N;0;CABANA;BH;604389.54;794182.77;406
+408;2001014463;B03000;AMEACA;RUA GURUPA;148;32557;8/1/2001 19:55:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610305.58;801088.40;407
+409;2001014497;B03000;AMEACA;AV ERICO VERISSI;159;41671;8/1/2001 20:12:00;CIDADAO COMUM;S;0;SAO JOAO BATISTA;BH;608449.99;808287.11;408
+410;2001014511;B03000;AMEACA;RUA FURQUIM;421;30117;8/1/2001 20:17:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615033.05;797748.03;409
+411;2001014537;B03000;AMEACA;AV BALEARES;545;89333;8/1/2001 20:33:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;608404.44;810117.51;410
+412;2001014556;B03000;AMEACA;RUA ALCIDES PERE;195;107711;8/1/2001 20:43:00;CIDADAO COMUM;S;FR;MANTIQUEIRA;BH;606787.92;811935.52;411
+413;2001014687;B06000;LESAO CORPORAL;RUA CAICARA;225;11451;8/1/2001 22:03:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615072.13;799252.45;412
+414;2001014734;B04001;HOMICIDIO TENTAD;RUA CINQUENTA E ;11;33925;8/1/2001 22:43:00;INICIATIVA;N;0;FELICIDADE;BH;612673.36;806807.75;413
+415;2001014739;B06000;LESAO CORPORAL;RUA DOUTOR CRIST;185;55598;8/1/2001 22:46:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;604650.82;789126.07;414
+416;2001014742;B03000;AMEACA;RUA JOSE ALVES D;250;38424;8/1/2001 22:50:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610799.19;805124.67;415
+417;2001014820;B06000;LESAO CORPORAL;RUA DOS VICENTIN;130;63159;8/1/2001 23:44:00;CIDADAO COMUM;S;;PLANALTO;BH;610713.35;805437.73;416
+418;2001014838;B06000;LESAO CORPORAL;RUA MARINHO EVAN;30;124960;8/1/2001 23:55:00;CIDADAO COMUM;S;FR;PETROPOLIS;BH;601216.32;786613.61;417
+419;2001014860;B03000;AMEACA;AV SOCIAIS;60;12959;9/1/2001 00:08:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;615537.12;803931.69;418
+420;2001014949;B03000;AMEACA;RUA DOM PEDRITO;464;51300;9/1/2001 01:34:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614816.51;800793.30;419
+421;2001015067;B03000;AMEACA;RUA PADRE FEIJO;982;51326;9/1/2001 04:10:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615870.08;797655.07;420
+422;2001015076;B03000;AMEACA;PRACA SAO GERALD;39;62027;9/1/2001 04:58:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;615306.86;799493.53;421
+423;2001015093;B06000;LESAO CORPORAL;AV CRISTIANO MAC;5554;18652;9/1/2001 06:24:00;INICIATIVA;S;0;DOS PALMARES;BH;612348.26;802981.49;422
+424;2001015203;B03000;AMEACA;RUA ITAMARACA;25;35542;9/1/2001 08:10:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611172.87;798780.05;423
+425;2001015286;B03000;AMEACA;RUA FLOR DE ABRI;10;28464;9/1/2001 09:17:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;605903.22;799072.14;424
+426;2001015401;B03000;AMEACA;RUA NOVA LIMA;20;74799;9/1/2001 11:02:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616617.92;804643.10;425
+427;2001015416;B03000;AMEACA;AV DO CONTORNO;2300;17228;9/1/2001 11:10:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;612513.76;797078.00;426
+428;2001015417;B03000;AMEACA;RUA CARAVELAS;811;13141;9/1/2001 11:10:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615714.70;797598.16;427
+429;2001015439;B03000;AMEACA;RUA DA BAHIA;1148;81155;9/1/2001 11:34:00;INICIATIVA;S;AP1611;LOURDES;BH;611230.12;796512.50;428
+430;2001015440;B06000;LESAO CORPORAL;RUA SAO JOAO BAT;310;62824;9/1/2001 11:33:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605534.57;808136.46;429
+431;2001015458;B04001;HOMICIDIO TENTAD;RUA GLEUCY JOSE ;95;128860;9/1/2001 11:47:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617303.66;796895.30;430
+432;2001015585;B03000;AMEACA;AV WALDOMIRO LOB;992;66548;9/1/2001 13:42:00;CIDADAO COMUM;N;0;GUARANI;BH;612224.50;805424.28;431
+433;2001015629;B03000;AMEACA;AV CRISTOVAO COL;161;18738;9/1/2001 14:22:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611455.89;794979.69;432
+434;2001015652;B03000;AMEACA;RUA JANUARIO BOR;451;89709;9/1/2001 14:36:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;617420.91;804492.75;433
+435;2001015745;B03000;AMEACA;RUA JUNDIAI;97;39616;9/1/2001 15:33:00;CIDADAO COMUM;S;;CONCORDIA;BH;610808.71;799153.94;434
+436;2001015969;B06000;LESAO CORPORAL;AV ARTUR BERNARD;1461;60844;9/1/2001 17:46:00;CIDADAO COMUM;S;;VILA PARIS;BH;610407.20;793259.63;435
+437;2001016078;B03000;AMEACA;AV DOM PEDRO II;1020;53145;9/1/2001 18:52:00;CIDADAO COMUM;N;;BONFIM;BH;609572.19;797764.43;436
+438;2001016093;B03000;AMEACA;RUA SUDAO;82;116606;9/1/2001 18:59:00;CIDADAO COMUM;S;;CANAA;BH;610209.28;810853.60;437
+439;2001016133;B06000;LESAO CORPORAL;RUA DO ACRE;12;877;9/1/2001 19:24:00;INICIATIVA;N;0;CENTRO (BH);BH;610703.72;797641.10;438
+440;2001016156;B03000;AMEACA;RUA FLOR DE MAIO;77;300399;9/1/2001 19:36:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614327.62;794723.12;439
+441;2001016248;B06000;LESAO CORPORAL;AV PARANAIBA;285;52256;9/1/2001 20:25:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609720.07;799824.06;440
+442;2001016331;B03000;AMEACA;AV CRISTIANO MAC;848;18652;9/1/2001 21:07:00;INICIATIVA;S;0;DA GRACA;BH;612306.88;799435.98;441
+443;2001016336;B05000;SEQUESTRO E CARC;AV SANTOS DUMONT;381;61950;9/1/2001 21:10:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611250.50;797490.44;442
+444;2001016350;B03000;AMEACA;RUA ALINE;658;2352;9/1/2001 21:14:00;CIDADAO COMUM;S;;COQUEIROS;BH;602349.52;798353.27;443
+445;2001016355;B08000;VIOLACAO DE DOMI;RUA THAIS;10;67594;9/1/2001 21:17:00;CIDADAO COMUM;S;;GLORIA;BH;604077.88;798711.92;444
+446;2001016432;B06000;LESAO CORPORAL;RUA ENGENHEIRO Z;35;17937;9/1/2001 21:57:00;CIDADAO COMUM;N;0;SANTO ANTONIO;BH;610239.72;793815.04;445
+447;2001016441;B03000;AMEACA;RUA CORREAS;651;87091;9/1/2001 22:03:00;CIDADAO COMUM;N;;BELVEDERE;BH;611978.72;792341.14;446
+448;2001016509;B06000;LESAO CORPORAL;AV SILVA LOBO;295;65889;9/1/2001 22:45:00;CIDADAO COMUM;S;;CALAFATE;BH;607634.19;796415.21;447
+449;2001016512;B06000;LESAO CORPORAL;RUA DOS CAETES;435;11376;9/1/2001 22:47:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611180.00;797412.98;448
+450;2001016520;B06000;LESAO CORPORAL;RUA INGLATERRA;1744;34552;9/1/2001 22:51:00;CIDADAO COMUM;S;;COPACABANA;BH;606211.83;806736.77;449
+451;2001016526;B03000;AMEACA;RUA SALGUEIRO;255;3226;9/1/2001 22:51:00;CIDADAO COMUM;S;0;IPIRANGA;BH;611974.61;800595.47;450
+452;2001016622;B06000;LESAO CORPORAL;RUA SAO GERALDO;190;170283;9/1/2001 23:39:00;CIDADAO COMUM;N;0;CABANA;BH;604753.11;793990.28;451
+453;2001016634;B03000;AMEACA;RUA W QUATRO;190;122634;9/1/2001 23:48:00;CIDADAO COMUM;S;202;PONGELUPE;BH;604134.92;787374.21;452
+454;2001016673;B04001;HOMICIDIO TENTAD;RUA DOUTOR CRIST;312;55598;10/1/2001 00:12:00;CIDADAO COMUM;S;0;CRISTO REDENTOR;BH;604751.25;789297.85;453
+455;2001016795;B04001;HOMICIDIO TENTAD;RUA BRAS;300;170835;10/1/2001 01:55:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608242.10;793878.82;454
+456;2001016842;B03000;AMEACA;RUA JOSE ROMANO;142;15796;10/1/2001 02:45:00;CIDADAO COMUM;N;CA01;SAO JOSE;BH;605207.68;798783.98;455
+457;2001016856;B03000;AMEACA;RUA GUAICURUS;633;32009;10/1/2001 02:55:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611041.29;797644.01;456
+458;2001016910;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;170;57830;10/1/2001 04:36:00;INICIATIVA;S;0;CIDADE JARDIM;BH;609584.57;795355.36;457
+459;2001016946;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;506;31400;10/1/2001 05:41:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610773.41;796842.64;458
+460;2001016959;B04002;HOMICIDIO CONSUM;RUA AGGEO PIO;10;89711;10/1/2001 06:19:00;CIDADAO COMUM;N;0;PALMEIRAS;BH;606647.20;790442.61;459
+461;2001016963;B03000;AMEACA;RUA PADRE PEDRO ;2227;51657;10/1/2001 06:27:00;INICIATIVA;N;0;CANDELARIA;BH;607904.37;809480.72;460
+462;2001016996;B03000;AMEACA;RUA SENA MADUREI;596;64671;10/1/2001 07:19:00;CIDADAO COMUM;S;;OURO PRETO;BH;605824.18;802464.45;461
+463;2001017102;B06000;LESAO CORPORAL;RUA MARIA GERTRU;290;98993;10/1/2001 08:30:00;INICIATIVA;N;0;CEU AZUL;BH;604701.02;808439.25;462
+464;2001017334;B03000;AMEACA;RUA BONAPARTE;122;10083;10/1/2001 11:40:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607575.01;797505.56;463
+465;2001017348;B06000;LESAO CORPORAL;RUA REAL GRANDEZ;264;58089;10/1/2001 11:53:00;CIDADAO COMUM;S;AP302;PATROCINIO;BH;603316.69;798928.15;464
+466;2001017450;B03000;AMEACA;RUA DAVIDSON PIM;247;124189;10/1/2001 13:01:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607292.47;811797.42;465
+467;2001017798;B04002;HOMICIDIO CONSUM;RUA ALICE;40;170949;10/1/2001 17:02:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;607996.88;793885.89;466
+468;2001017995;B06000;LESAO CORPORAL;AV PRESIDENTE AN;7920;4461;10/1/2001 18:34:00;CIDADAO COMUM;S;;SAO LUIZ;BH;608635.14;804693.17;467
+469;2001018012;B03000;AMEACA;RUA ITAJUBA;580;35495;10/1/2001 18:42:00;CIDADAO COMUM;S;0;FLORESTA;BH;612088.81;797996.25;468
+470;2001018298;B03000;AMEACA;RUA CARVALHOS;219;13788;10/1/2001 21:14:00;CIDADAO COMUM;S;0;MANGABEIRAS;BH;612116.96;792573.56;469
+471;2001018321;B06000;LESAO CORPORAL;RUA FRANCISCO JO;545;118223;10/1/2001 21:26:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599752.96;789472.97;470
+472;2001018328;B06000;LESAO CORPORAL;RUA OMAR GOMES D;16;24259;10/1/2001 21:29:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600890.73;787146.97;471
+473;2001018400;B03000;AMEACA;RUA LEOPOLDO GOM;1663;40770;10/1/2001 22:08:00;INICIATIVA;N;0;VERA CRUZ;BH;616032.33;798192.27;472
+474;2001018405;B03000;AMEACA;RUA OCARA;80;49065;10/1/2001 22:10:00;CIDADAO COMUM;S;0;VILA MARAVILHAS;BH;603299.78;795546.30;473
+475;2001018407;B06000;LESAO CORPORAL;RUA VOLTS;40;73626;10/1/2001 22:10:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612172.58;803421.57;474
+476;2001018430;B03000;AMEACA;RUA CIRILO GASPA;326;63348;10/1/2001 22:22:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608684.85;800162.78;475
+477;2001018441;B04001;HOMICIDIO TENTAD;RUA TUCUMAN;50;69823;10/1/2001 22:26:00;CIDADAO COMUM;S;;SAO GERALDO;BH;614856.59;799413.07;476
+478;2001018450;B06000;LESAO CORPORAL;RUA ZILAH RODRIG;48;74008;10/1/2001 22:31:00;CIDADAO COMUM;N;A;NOVA BARROCA;BH;607546.31;792666.26;477
+479;2001018473;B03000;AMEACA;RUA NOVA REPUBLI;212;130110;10/1/2001 22:51:00;CIDADAO COMUM;S;;CEU AZUL;BH;603826.50;807802.31;478
+480;2001018533;B03000;AMEACA;RUA CONSELHEIRO ;14;17095;10/1/2001 23:18:00;CIDADAO COMUM;S;CS2;CENTRO (BH);BH;612530.47;797030.47;479
+481;2001018563;B08000;VIOLACAO DE DOMI;RUA FERNAO DIAS;73;28133;10/1/2001 23:36:00;CIDADAO COMUM;S;0;CASA BRANCA;BH;615967.41;798817.35;480
+482;2001018571;B04001;HOMICIDIO TENTAD;RUA CURRAL DEL R;201;19122;10/1/2001 23:39:00;CIDADAO COMUM;S;;CABANA;BH;604797.75;793784.12;481
+483;2001018601;B04002;HOMICIDIO CONSUM;RUA FREI LUIZ DE;215;29961;10/1/2001 23:56:00;CIDADAO COMUM;N;;JOAO PINHEIRO;BH;604640.64;796058.63;482
+484;2001018615;B03000;AMEACA;RUA NAVAJOS;190;47334;11/1/2001 00:02:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;607290.06;807088.32;483
+485;2001018627;B03000;AMEACA;RUA CHAFARIZ;81;300275;11/1/2001 00:12:00;CIDADAO COMUM;S;;HAVAI;BH;607397.53;793768.20;484
+486;2001018652;B04001;HOMICIDIO TENTAD;RUA DONA CARMEM;512;22820;11/1/2001 00:28:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603873.41;802278.24;485
+487;2001018751;B03000;AMEACA;RUA PADRE PEDRO ;2555;51657;11/1/2001 01:31:00;CIDADAO COMUM;N;0;JARDIM EUROPA;BH;607741.76;809685.90;486
+488;2001018774;B04001;HOMICIDIO TENTAD;AV ESPLANADA;63;126244;11/1/2001 01:57:00;CIDADAO COMUM;N;;SAO GABRIEL;BH;613213.55;804435.56;487
+489;2001018891;B06000;LESAO CORPORAL;RUA VINTE E DOIS;86;118702;11/1/2001 04:29:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604192.72;807622.62;488
+490;2001018929;B06000;LESAO CORPORAL;AV BIAS FORTES;1603;9553;11/1/2001 05:51:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;610264.01;797012.81;489
+491;2001018990;B06000;LESAO CORPORAL;RUA VENANCIO COR;133;70643;11/1/2001 07:21:00;CIDADAO COMUM;S;A;BARREIRO;BH;602024.26;791119.07;490
+492;2001019006;B03000;AMEACA;RUA PADRE ROLIM;850;51672;11/1/2001 07:40:00;CIDADAO COMUM;S;PX163;SANTA EFIGENIA;BH;612095.64;796347.69;491
+493;2001019049;B03000;AMEACA;RUA OITO;35;117287;11/1/2001 08:23:00;CIDADAO COMUM;N;;LINDEIA;BH;600021.70;790389.81;492
+494;2001019201;B03000;AMEACA;RUA LINCOLN;202;41136;11/1/2001 10:19:00;CIDADAO COMUM;N;;UNIAO;BH;612570.90;801367.78;493
+495;2001019205;B03000;AMEACA;RUA ARCABOUCO;40;5700;11/1/2001 10:20:00;CIDADAO COMUM;S;;PINDORAMA;BH;602278.45;797808.57;494
+496;2001019225;B03000;AMEACA;RUA COLONITA;3;16326;11/1/2001 10:31:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604791.25;802270.96;495
+497;2001019301;B03000;AMEACA;RUA HOFFMAN;863;33320;11/1/2001 11:20:00;CIDADAO COMUM;S;;SANTA CRUZ (BARR;BH;603059.63;788930.45;496
+498;2001019318;B03000;AMEACA;RUA WILSON TAVAR;960;118958;11/1/2001 11:33:00;CIDADAO COMUM;S;;TEIXEIRA DIAS;BH;602967.07;789432.38;497
+499;2001019379;B04001;HOMICIDIO TENTAD;RUA ESTACIO RODR;157;26194;11/1/2001 12:11:00;INICIATIVA;N;0;NOVA BARROCA;BH;607870.76;792669.98;498
+500;2001019390;B03000;AMEACA;RUA LUIZ LOPES;82;94431;11/1/2001 12:18:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606237.42;801258.18;499
+501;2001019419;B06000;LESAO CORPORAL;RUA DOS TAMOIOS;350;66825;11/1/2001 12:41:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611013.54;797064.26;500
+502;2001019469;B03000;AMEACA;RUA IPANEMA;22;34726;11/1/2001 13:15:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603482.92;802695.57;501
+503;2001019492;B03000;AMEACA;RUA EXPEDICIONAR;781;31627;11/1/2001 13:42:00;CIDADAO COMUM;N;;MARIA GORETTI;BH;614437.73;803006.94;502
+504;2001019537;B03000;AMEACA;AV AUGUSTO DE LI;1549;6731;11/1/2001 14:22:00;INICIATIVA;N;0;BARRO PRETO;BH;609833.79;796889.71;503
+505;2001019618;B03000;AMEACA;AV AGENOR DE PAU;285;86250;11/1/2001 15:32:00;CIDADAO COMUM;N;;JAQUELINE;BH;611475.70;810215.54;504
+506;2001019619;B03000;AMEACA;RUA DONA LUCI;26;86004;11/1/2001 15:31:00;CIDADAO COMUM;N;BL10    CS70;ESTRELA DALVA;BH;607207.00;791913.46;505
+507;2001019633;B04001;HOMICIDIO TENTAD;RUA POVOA DE VAR;437;54958;11/1/2001 15:40:00;CIDADAO COMUM;N;;PAQUETA;BH;605302.03;802656.56;506
+508;2001019673;B06000;LESAO CORPORAL;RUA GALENA;137;30491;11/1/2001 16:04:00;CIDADAO COMUM;S;;LAGOINHA;BH;610984.03;798720.81;507
+509;2001019682;B03000;AMEACA;RUA IBERTIOGA;256;33809;11/1/2001 16:14:00;CIDADAO COMUM;N;0;SAO JOAO BATISTA;BH;611151.93;801287.85;508
+510;2001019692;B03000;AMEACA;RUA FILOMENA GAS;450;62083;11/1/2001 16:19:00;CIDADAO COMUM;N;0;APARECIDA SETIMA;BH;608686.14;800564.39;509
+511;2001019760;B04001;HOMICIDIO TENTAD;AV SILVIANO BRAN;1970;66002;11/1/2001 16:52:00;CIDADAO COMUM;N;LJD;HORTO;BH;613169.88;797967.87;510
+512;2001019824;B06000;LESAO CORPORAL;AV AFONSO PENA;1212;1259;11/1/2001 17:25:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611387.08;796661.11;511
+513;2001019828;B03000;AMEACA;RUA APRIGIO RIBE;209;36403;11/1/2001 17:28:00;INICIATIVA;S;0;DOM JOAQUIM;BH;613772.67;801498.72;512
+514;2001019901;B03000;AMEACA;RUA CONDE DE LIN;315;16657;11/1/2001 18:08:00;CIDADAO COMUM;S;;CIDADE JARDIM;BH;610022.64;795071.12;513
+515;2001019913;B03000;AMEACA;RUA QUARENTA E D;90;106964;11/1/2001 18:18:00;CIDADAO COMUM;S;CAFRENT;NOVA CINTRA;BH;605544.50;793587.13;514
+516;2001019922;B03000;AMEACA;RUA REIS DE ABRE;227;63363;11/1/2001 18:21:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608511.82;800590.42;515
+517;2001019950;B03000;AMEACA;RUA DOS TIMBIRAS;1986;67682;11/1/2001 18:37:00;CIDADAO COMUM;S;PX1986;LOURDES;BH;610826.13;796391.34;516
+518;2001019990;B08000;VIOLACAO DE DOMI;RUA CONSELHEIRO ;1715;17095;11/1/2001 18:59:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;613260.28;797299.09;517
+519;2001020007;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;2674;67682;11/1/2001 19:05:00;CIDADAO COMUM;N;;SANTO AGOSTINHO;BH;610160.88;796568.65;518
+520;2001020011;B04002;HOMICIDIO CONSUM;RUA BANDONION;322;170139;11/1/2001 19:09:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614122.39;794785.34;519
+521;2001020022;B06000;LESAO CORPORAL;RUA LARANJEIRAS;285;40423;11/1/2001 19:14:00;CIDADAO COMUM;S;;LEBLON;BH;605674.28;809817.52;520
+522;2001020083;B06000;LESAO CORPORAL;RUA UM;460;27979;11/1/2001 19:47:00;CIDADAO COMUM;S;;CAPITAO EDUARDO;BH;618652.15;807023.45;521
+523;2001020163;B03000;AMEACA;RUA JOSE CARLOS ;137;19601;11/1/2001 20:24:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;603937.17;793007.50;522
+524;2001020249;B03000;AMEACA;RUA B;331;99463;11/1/2001 21:18:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615177.80;808389.59;523
+525;2001020261;B03000;AMEACA;RUA SERRINHA;19;129201;11/1/2001 21:24:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;600519.25;786719.95;524
+526;2001020469;B06000;LESAO CORPORAL;RUA DAS TABOADAS;15;300190;11/1/2001 23:20:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608784.28;807980.25;525
+527;2001020505;B03000;AMEACA;RUA JABOTICABAL;1453;36517;11/1/2001 23:37:00;CIDADAO COMUM;N;;JARDIM AMERICA;BH;607241.48;793984.92;526
+528;2001020518;B06000;LESAO CORPORAL;RUA RUBENS DE SO;680;63060;11/1/2001 23:44:00;CIDADAO COMUM;S;;AARAO REIS;BH;612429.10;804993.67;527
+529;2001020611;B04002;HOMICIDIO CONSUM;RUA FREI ANTONIO;108;29845;12/1/2001 00:44:00;CIDADAO COMUM;N;AP202;NOVA CACHOEIRINH;BH;609550.05;801171.08;528
+530;2001020630;B04001;HOMICIDIO TENTAD;ALAMEDA INTERLIG;10;90270;12/1/2001 00:59:00;CIDADAO COMUM;N;0;SERRA VERDE;BH;609772.02;810394.22;529
+531;2001020637;B06000;LESAO CORPORAL;RUA ENCANTADO;299;25453;12/1/2001 01:06:00;CIDADAO COMUM;N;;CAICARA;BH;607616.04;799442.79;530
+532;2001020647;B04002;HOMICIDIO CONSUM;RUA SOCRATES;30;85953;12/1/2001 01:16:00;CIDADAO COMUM;N;;DOM SILVERIO;BH;615325.98;804426.93;531
+533;2001020688;B03000;AMEACA;AV SINFRONIO BRO;1210;66116;12/1/2001 01:45:00;CIDADAO COMUM;S;;BARREIRO;BH;602205.97;790748.09;532
+534;2001020758;B06000;LESAO CORPORAL;AV BRASIL;256;10420;12/1/2001 02:53:00;CIDADAO COMUM;N;PX246;SANTA EFIGENIA;BH;612788.88;796553.11;533
+535;2001020765;B06000;LESAO CORPORAL;AV FRANCISCO SAL;898;29669;12/1/2001 03:01:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612234.65;796788.78;534
+536;2001020968;B03000;AMEACA;RUA MENOTTI MUCC;216;45468;12/1/2001 08:14:00;CIDADAO COMUM;S;;VILA OESTE;BH;603917.44;794443.61;535
+537;2001021032;B03000;AMEACA;RUA SAUDE;79;64164;12/1/2001 08:53:00;CIDADAO COMUM;S;AP102 B;PADRE EUSTAQUIO;BH;605543.58;797680.50;536
+538;2001021065;B06000;LESAO CORPORAL;RUA ALBATROZ;433;1753;12/1/2001 09:06:00;CIDADAO COMUM;N;BL4     CS107;VILA CLORIS;BH;610454.04;807552.45;537
+539;2001021099;B03000;AMEACA;RUA ALFENAS;455;2208;12/1/2001 09:25:00;CIDADAO COMUM;S;AP207;CRUZEIRO;BH;612352.66;794210.94;538
+540;2001021112;B06000;LESAO CORPORAL;RUA DELMO RENAUL;54;70596;12/1/2001 09:36:00;CIDADAO COMUM;N;CASA 2;AARAO REIS;BH;612861.79;804917.93;539
+541;2001021135;B08000;VIOLACAO DE DOMI;RUA PROFESSORA V;3;56893;12/1/2001 09:45:00;CIDADAO COMUM;N;**13**;CHACARAS REUNIDA;BH;605513.76;789431.48;540
+542;2001021145;B03000;AMEACA;RUA NICIAS CONTI;80;56115;12/1/2001 09:56:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605599.41;795256.93;541
+543;2001021193;B08000;VIOLACAO DE DOMI;RUA IBIZA;27;85257;12/1/2001 10:38:00;CIDADAO COMUM;S;;JARDIM EUROPA;BH;608390.06;809789.59;542
+544;2001021300;B03000;AMEACA;RUA GAMA;82;30536;12/1/2001 12:10:00;CIDADAO COMUM;S;;BONFIM;BH;610070.14;798082.23;543
+545;2001021343;B03000;AMEACA;AV DOUTOR CRISTI;50;62459;12/1/2001 12:32:00;CIDADAO COMUM;N;0;VILA CLORIS;BH;609728.30;807891.34;544
+546;2001021380;B06000;LESAO CORPORAL;RUA CORONEL COST;275;10809;12/1/2001 13:01:00;CIDADAO COMUM;S;0;PLANALTO;BH;610783.13;806561.04;545
+547;2001021382;B03000;AMEACA;RUA CAMELIA;80;11842;12/1/2001 12:58:00;CIDADAO COMUM;S;;BANDEIRANTES DO ;BH;606332.11;793590.42;546
+548;2001021454;B03000;AMEACA;RUA SACADURA CAB;18;59807;12/1/2001 13:49:00;CIDADAO COMUM;S;;VILA OESTE;BH;604480.03;795002.18;547
+549;2001021499;B03000;AMEACA;RUA VITORIA;294;73480;12/1/2001 14:21:00;CIDADAO COMUM;S;0;NOVA CACHOEIRINH;BH;609645.56;801127.17;548
+550;2001021699;B06000;LESAO CORPORAL;RUA TREMEDAL;76;68240;12/1/2001 16:35:00;CIDADAO COMUM;N;0;CARLOS PRATES;BH;609427.34;797783.99;549
+551;2001021709;B03000;AMEACA;RUA JUIZ DE FORA;1381;39455;12/1/2001 16:43:00;INICIATIVA;N;0;BARRO PRETO;BH;609377.30;795937.94;550
+552;2001021758;B04001;HOMICIDIO TENTAD;RUA LUPERCIO PAI;358;57335;12/1/2001 17:11:00;CIDADAO COMUM;N;;TIROL;BH;599905.68;788964.16;551
+553;2001021814;B06000;LESAO CORPORAL;RUA FLOR D'AGUA;375;28565;12/1/2001 17:41:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;605701.81;799712.75;552
+554;2001021873;B06000;LESAO CORPORAL;RUA FELIPE DOS S;531;27953;12/1/2001 18:19:00;POLICIAL MILITAR;S;0;LOURDES;BH;610274.10;795492.35;553
+555;2001021878;B04001;HOMICIDIO TENTAD;RUA VALERIO;108;71268;12/1/2001 18:20:00;CIDADAO COMUM;S;C;PIRAJA;BH;613129.62;803028.68;554
+556;2001021881;B03000;AMEACA;RUA ESTADOS UNID;361;26239;12/1/2001 18:20:00;POLICIAL MILITAR;S;0;COPACABANA;BH;606126.26;806325.42;555
+557;2001021906;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;5387;18652;12/1/2001 18:39:00;CIDADAO COMUM;N;;DOS PALMARES;BH;612255.52;802177.46;556
+558;2001021970;B03000;AMEACA;RUA MONTE SIAO;576;46559;12/1/2001 19:10:00;CIDADAO COMUM;S;;SERRA;BH;613413.20;795071.16;557
+559;2001022011;B03000;AMEACA;RUA MONTES CLARO;348;46650;12/1/2001 19:30:00;CIDADAO COMUM;S;AP803;CARMO;BH;611781.30;794373.73;558
+560;2001022094;B06000;LESAO CORPORAL;RUA SERRINHA;40;129201;12/1/2001 20:15:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;600457.30;786999.51;559
+561;2001022109;B03000;AMEACA;RUA DES TINOCO;577;20028;12/1/2001 20:21:00;CIDADAO COMUM;S;;MONSENHOR MESSIA;BH;606789.83;798133.46;560
+562;2001022128;B03000;AMEACA;RUA SACADURA CAB;413;59807;12/1/2001 20:31:00;CIDADAO COMUM;S;;VILA OESTE;BH;604119.86;795095.14;561
+563;2001022135;B06000;LESAO CORPORAL;AV DO CONTORNO;1368;17228;12/1/2001 20:35:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611964.60;797777.29;562
+564;2001022152;B06000;LESAO CORPORAL;RUA MORUNGABA;402;85981;12/1/2001 20:45:00;CIDADAO COMUM;S;0;MARILANDIA (IB);IB;599619.85;788524.08;563
+565;2001022176;B06000;LESAO CORPORAL;AV SANTOS DUMONT;305;61950;12/1/2001 20:59:00;CIDADAO COMUM;S;PX305;CENTRO (BH);BH;611328.73;797470.25;564
+566;2001022189;B06000;LESAO CORPORAL;RUA PROFESSOR ME;289;77920;12/1/2001 21:02:00;CIDADAO COMUM;S;;MANGABEIRAS;BH;612132.44;792715.35;565
+567;2001022190;B06000;LESAO CORPORAL;RUA SAO JOAO DA ;380;62900;12/1/2001 21:02:00;CIDADAO COMUM;S;;SANTA BRANCA;BH;608313.33;806933.86;566
+568;2001022233;B06000;LESAO CORPORAL;RUA MIGUEL GOMES;354;70757;12/1/2001 21:25:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606993.39;812216.05;567
+569;2001022245;B06000;LESAO CORPORAL;AV SILVA LOBO;620;65889;12/1/2001 21:33:00;CIDADAO COMUM;N;0;CALAFATE;BH;607644.28;796106.65;568
+570;2001022298;B04001;HOMICIDIO TENTAD;RUA DOS COMANCHE;25;16367;12/1/2001 22:02:00;INICIATIVA;S;0;ITAMARATI;BH;607092.27;806826.66;569
+571;2001022305;B04001;HOMICIDIO TENTAD;AV COLETORA;1064;78241;12/1/2001 22:07:00;CIDADAO COMUM;S;;VILA PINHO;BH;602444.19;787672.15;570
+572;2001022335;B03000;AMEACA;RUA CORNELIO CER;23;17417;12/1/2001 22:19:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606440.81;797810.81;571
+573;2001022393;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;12/1/2001 22:52:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;572
+574;2001022466;B04001;HOMICIDIO TENTAD;RUA PADRE CAFE;1215;51253;12/1/2001 23:35:00;INICIATIVA;S;0;VERA CRUZ;BH;616153.74;797899.31;573
+575;2001022624;B03000;AMEACA;RUA SOARES NOGUE;161;66220;13/1/2001 01:08:00;CIDADAO COMUM;N;AP2;VILA MAGNESITA;BH;602235.99;794935.65;574
+576;2001022733;B06000;LESAO CORPORAL;RUA POUSO ALEGRE;2522;54932;13/1/2001 02:19:00;CIDADAO COMUM;N;BLC APTO201;FLORESTA;BH;613435.30;798084.21;575
+577;2001022750;B05000;SEQUESTRO E CARC;RUA JOSE BARSAND;190;88734;13/1/2001 02:25:00;POLICIAL MILITAR;S;SL301;DOS PALMARES;BH;612127.41;802150.37;576
+578;2001022797;B02000;RIXA;AV RAJA GABAGLIA;2985;57830;13/1/2001 03:02:00;CIDADAO COMUM;N;0;ESTORIL;BH;609208.29;792438.19;577
+579;2001022800;B02000;RIXA;RUA JOAO SAMAHA;271;7397;13/1/2001 03:06:00;CIDADAO COMUM;S;0;SANTA BRANCA;BH;608625.93;807245.10;578
+580;2001022809;B06000;LESAO CORPORAL;RUA DESENGANO;42;19860;13/1/2001 03:12:00;CIDADAO COMUM;S;CSFRE;MANGABEIRAS;BH;612203.19;792486.25;579
+581;2001022884;B06000;LESAO CORPORAL;RUA ABRAHAO JOAO;191;80859;13/1/2001 04:05:00;CIDADAO COMUM;N;;PARQUE SAO JOSE;BH;606953.95;792329.56;580
+582;2001022924;B03000;AMEACA;RUA GONCALVES DE;304;31582;13/1/2001 04:39:00;CIDADAO COMUM;S;;CAMARGOS;BH;602331.85;794593.77;581
+583;2001022931;B04001;HOMICIDIO TENTAD;RUA DOS CAETES;435;11376;13/1/2001 04:44:00;INICIATIVA;N;0;CENTRO BH;BH;611180.00;797412.98;582
+584;2001022940;B04001;HOMICIDIO TENTAD;RUA FERNAO DIAS;1855;28133;13/1/2001 04:51:00;INICIATIVA;S;0;JONAS VEIGA;BH;616249.53;797464.28;583
+585;2001023136;B06000;LESAO CORPORAL;RUA DOS GUARANIS;301;32181;13/1/2001 08:34:00;INICIATIVA;S;0;CENTRO (BH);BH;610722.99;797339.12;584
+586;2001023150;B06000;LESAO CORPORAL;RUA CARLINDO COS;83;97294;13/1/2001 08:45:00;CIDADAO COMUM;S;0;EYMARD;BH;613742.58;803685.81;585
+587;2001023177;B06000;LESAO CORPORAL;RUA EUFRATES;9;26821;13/1/2001 09:06:00;CIDADAO COMUM;S;CAFU;COQUEIROS;BH;603406.63;799967.72;586
+588;2001023319;B03000;AMEACA;RUA CARAVELAS;155;13141;13/1/2001 11:09:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;615531.31;798475.90;587
+589;2001023341;B03000;AMEACA;AV SOCIAIS;80;12959;13/1/2001 11:21:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;615537.12;803931.69;588
+590;2001023347;B03000;AMEACA;RUA RIACHUELO;501;58527;13/1/2001 11:24:00;CIDADAO COMUM;N;BLA     AP102;CARLOS PRATES;BH;608088.93;797566.54;589
+591;2001023411;B06000;LESAO CORPORAL;RUA ARGEMIRO BAE;80;93022;13/1/2001 12:27:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601241.15;785911.18;590
+592;2001023455;B03000;AMEACA;RUA ALGA MARINHA;883;66623;13/1/2001 12:54:00;CIDADAO COMUM;S;CAFU;FLORAMAR;BH;610844.23;807388.97;591
+593;2001023505;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;13/1/2001 13:39:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;592
+594;2001023540;B06000;LESAO CORPORAL;RUA GURUPA;130;32557;13/1/2001 14:05:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610294.19;801115.97;593
+595;2001023568;B03000;AMEACA;RUA GENOVEVA DE ;571;30970;13/1/2001 14:20:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612420.80;798614.04;594
+596;2001023670;B03000;AMEACA;RUA AVELEDA;72;6987;13/1/2001 15:17:00;CIDADAO COMUM;S;;PINDORAMA;BH;602756.68;797541.67;595
+597;2001023695;B03000;AMEACA;RUA JOSE PEDRO D;454;78560;13/1/2001 15:28:00;POLICIAL MILITAR;N;0;VILA SANTA RITA;BH;601506.24;787345.07;596
+598;2001023732;B06000;LESAO CORPORAL;RUA OLIVIO RODRI;13;49976;13/1/2001 15:55:00;POLICIAL MILITAR;N;0;NOVA VISTA;BH;615133.79;800903.01;597
+599;2001023788;B03000;AMEACA;RUA VINTE E OITO;35;72967;13/1/2001 16:33:00;CIDADAO COMUM;S;0;ALTO DOS PINHEIR;BH;603829.39;795965.50;598
+600;2001023807;B06000;LESAO CORPORAL;RUA DAS DRACENAS;600;33461;13/1/2001 16:47:00;INICIATIVA;S;0;LINDEIA;BH;598761.19;790775.84;599
+601;2001023819;B03000;AMEACA;AV NOSSA SENHORA;693;47996;13/1/2001 16:53:00;CIDADAO COMUM;N;0;CARMO;BH;611528.60;794103.66;600
+602;2001023843;B06000;LESAO CORPORAL;RUA MARIA ANALIA;32;300366;13/1/2001 17:05:00;CIDADAO COMUM;N;0;POMPEIA;BH;606878.92;808915.74;601
+603;2001023897;B06000;LESAO CORPORAL;AV WARLEY APAREC;150;78529;13/1/2001 17:36:00;CIDADAO COMUM;S;0;VILA COLUMBIARA;BH;603986.17;788979.48;602
+604;2001023907;B06000;LESAO CORPORAL;BECO DO INDIO;42;301593;13/1/2001 17:44:00;CIDADAO COMUM;N;;CAFEZAL;BH;614068.93;794877.88;603
+605;2001023949;B03000;AMEACA;RUA RADIALISTA D;298;99334;13/1/2001 18:06:00;CIDADAO COMUM;S;;CEU AZUL;BH;605040.80;807668.88;604
+606;2001023955;B04001;HOMICIDIO TENTAD;RUA FRANCISCO MA;465;89447;13/1/2001 18:10:00;CIDADAO COMUM;N;;CH JATOBA IV;BH;600305.09;787628.76;605
+607;2001024066;B06000;LESAO CORPORAL;RUA BADARO JUNIO;27;7532;13/1/2001 19:06:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612043.50;803566.82;606
+608;2001024138;B04002;HOMICIDIO CONSUM;BECO SAO JOAO DE;150;171084;13/1/2001 19:54:00;CIDADAO COMUM;N;0;CABANA;BH;604617.23;793823.45;607
+609;2001024150;B04001;HOMICIDIO TENTAD;AV NOSSA SENHORA;1030;47996;13/1/2001 19:58:00;CIDADAO COMUM;S;0;SAO PEDRO;BH;611365.27;793876.27;608
+610;2001024222;B03000;AMEACA;RUA BARAUNAS;63;80124;13/1/2001 20:30:00;CIDADAO COMUM;S;0;VILA INDAIA;BH;609882.06;802973.44;609
+611;2001024243;B03000;AMEACA;RUA CARLOS PEIXO;186;13485;13/1/2001 20:37:00;CIDADAO COMUM;N;AP201;SAO LUCAS;BH;613570.29;796453.95;610
+612;2001024248;B06000;LESAO CORPORAL;RUA PONTA GROSSA;895;14900;13/1/2001 20:42:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604801.53;790245.22;611
+613;2001024306;B03000;AMEACA;RUA GREGORIO DE ;175;31885;13/1/2001 21:01:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613997.42;796252.13;612
+614;2001024307;B03000;AMEACA;RUA GABRO;423;30435;13/1/2001 21:01:00;INICIATIVA;S;0;SANTA TEREZA;BH;612938.43;797259.63;613
+615;2001024312;B06000;LESAO CORPORAL;RUA SERRINHA;26;129201;13/1/2001 21:01:00;CIDADAO COMUM;N;0;INDEPENDENCIA;BH;600458.57;786991.65;614
+616;2001024322;B02000;RIXA;RUA DELEGADO PAU;180;90469;13/1/2001 21:07:00;CIDADAO COMUM;N;0;SAO MARCOS;BH;614606.28;802323.69;615
+617;2001024348;B03000;AMEACA;AV PRESIDENTE TA;696;35366;13/1/2001 21:18:00;CIDADAO COMUM;S;CAA;JARDIM MONTANHES;BH;605568.94;799837.94;616
+618;2001024356;B03000;AMEACA;AV DO CONTORNO;10888;17228;13/1/2001 21:22:00;INICIATIVA;S;0;BARRO PRETO;BH;610124.53;797278.95;617
+619;2001024374;B03000;AMEACA;RUA OTAVIO OTONI;49;50626;13/1/2001 21:31:00;CIDADAO COMUM;S;AP201;UNIAO;BH;613006.36;800792.50;618
+620;2001024381;B04001;HOMICIDIO TENTAD;RUA DAS PETUNIAS;110;11870;13/1/2001 21:35:00;CIDADAO COMUM;S;;LINDEIA;BH;599571.37;791092.66;619
+621;2001024384;B03000;AMEACA;RUA NOVA ESPERAN;19;83898;13/1/2001 21:37:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604441.83;807900.54;620
+622;2001024479;B03000;AMEACA;RUA M;81;37812;13/1/2001 22:18:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609087.53;810096.51;621
+623;2001024482;B03000;AMEACA;BECO PARAISO;12;302036;13/1/2001 22:18:00;INICIATIVA;N;0;PALMEIRAS;BH;606213.48;790637.47;622
+624;2001024488;B04002;HOMICIDIO CONSUM;RUA CRISTALIA;47;70899;13/1/2001 22:21:00;CIDADAO COMUM;N;0;PROVIDENCIA;BH;612455.05;804419.38;623
+625;2001024563;B06000;LESAO CORPORAL;AV MEM DE SA;207;45395;13/1/2001 23:02:00;INICIATIVA;N;0;PARAISO;BH;614125.51;797081.42;624
+626;2001024572;B03000;AMEACA;RUA VIRGILIO;70;73150;13/1/2001 23:06:00;CIDADAO COMUM;S;CAFR;PATROCINIO;BH;603914.84;799134.72;625
+627;2001024630;B03000;AMEACA;AV CRISTIANO MAC;880;18652;13/1/2001 23:41:00;CIDADAO COMUM;S;0;DA GRACA;BH;612307.14;799463.41;626
+628;2001024676;B09000;ABANDONO DE INCA;RUA CONCEICAO TE;180;22921;14/1/2001 00:04:00;CIDADAO COMUM;S;;NAZARE;BH;615576.95;804459.95;627
+629;2001024698;B04001;HOMICIDIO TENTAD;AV FRANCISCO SA;830;29656;14/1/2001 00:14:00;CIDADAO COMUM;N;0;PRADO;BH;608886.90;796021.80;628
+630;2001024708;B04001;HOMICIDIO TENTAD;RUA SAO JOSE DE ;689;63120;14/1/2001 00:19:00;CIDADAO COMUM;S;CSA;BOA VISTA;BH;616023.69;800139.76;629
+631;2001024734;B09000;ABANDONO DE INCA;RUA HENRIQUE BAD;117;86020;14/1/2001 00:33:00;CIDADAO COMUM;S;0;ESTRELA DALVA;BH;607188.76;792453.56;630
+632;2001024767;B03000;AMEACA;RUA JOSE PEDRO D;319;78560;14/1/2001 01:03:00;CIDADAO COMUM;N;;VILA SANTA RITA;BH;601528.97;787235.11;631
+633;2001024785;B03000;AMEACA;PRACA RAUL SOARE;259;58010;14/1/2001 01:12:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610365.17;796828.93;632
+634;2001024808;B03000;AMEACA;RUA BOLIVAR FERR;217;89995;14/1/2001 01:26:00;CIDADAO COMUM;N;0;PALMEIRAS;BH;607417.17;791603.80;633
+635;2001024829;B03000;AMEACA;RUA PADRE LEOPOL;658;14185;14/1/2001 01:36:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604726.86;795773.34;634
+636;2001024858;B02000;RIXA;RUA OPALA;12;50263;14/1/2001 01:48:00;CIDADAO COMUM;N;BAR NIKAS BAR NO;CRUZEIRO;BH;612338.91;794504.06;635
+637;2001024860;B06000;LESAO CORPORAL;RUA MAJOR DELFIN;2798;42620;14/1/2001 01:48:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;608833.07;801262.09;636
+638;2001024964;B06000;LESAO CORPORAL;RUA DAS CANOAS;336;12669;14/1/2001 03:02:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605685.71;792606.93;637
+639;2001025010;B03000;AMEACA;RUA DOS COMANCHE;709;16367;14/1/2001 03:32:00;CIDADAO COMUM;S;;ITAMARATI;BH;606559.95;807215.50;638
+640;2001025024;B06000;LESAO CORPORAL;AV ELISIO DE BRI;5;25251;14/1/2001 03:41:00;CIDADAO COMUM;N;0;BOA VISTA;BH;614339.09;799657.38;639
+641;2001025040;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;1315;57830;14/1/2001 03:50:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;609086.55;794205.08;640
+642;2001025118;B03000;AMEACA;RUA BERNARDO GUI;1313;9364;14/1/2001 05:03:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;611312.78;795943.41;641
+643;2001025165;B06000;LESAO CORPORAL;RUA ALCIDES PERE;306;107711;14/1/2001 05:52:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606823.28;811840.98;642
+644;2001025288;B03000;AMEACA;RUA DAS CARMELIT;34;121401;14/1/2001 08:29:00;INICIATIVA;N;0;PLANALTO;BH;610545.05;805542.73;643
+645;2001025312;B02000;RIXA;RUA CINCO;180;302813;14/1/2001 08:57:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614547.56;805977.33;644
+646;2001025318;B03000;AMEACA;RUA CONSELHEIRO ;2379;17095;14/1/2001 09:03:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613824.99;797328.11;645
+647;2001025431;B06000;LESAO CORPORAL;RUA CLAUDINOR ME;52;113610;14/1/2001 10:44:00;CIDADAO COMUM;S;FU;MINASCAIXA;BH;609563.18;809229.69;646
+648;2001025477;B03000;AMEACA;RUA JAQUES ROBER;345;36992;14/1/2001 11:30:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614136.47;802428.12;647
+649;2001025479;B04001;HOMICIDIO TENTAD;AV JOSE BONIFACI;306;38579;14/1/2001 11:33:00;INICIATIVA;N;0;PRADO LOPES;BH;610119.54;799105.82;648
+650;2001025546;B06000;LESAO CORPORAL;RUA CAIO VIANA M;604;11477;14/1/2001 12:40:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604706.23;789321.47;649
+651;2001025586;B03000;AMEACA;RUA CANANEIA;729;12400;14/1/2001 13:06:00;CIDADAO COMUM;S;0;ADELAIDE;BH;607461.12;798380.05;650
+652;2001025600;B03000;AMEACA;RUA ABATI;157;574;14/1/2001 13:12:00;CIDADAO COMUM;S;;SANTA MARIA;BH;603141.19;795508.74;651
+653;2001025607;B03000;AMEACA;AV MEM DE SA;1624;45395;14/1/2001 13:18:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;614287.39;796014.50;652
+654;2001025663;B04001;HOMICIDIO TENTAD;RUA JOSE SABINO ;310;98911;14/1/2001 14:03:00;CIDADAO COMUM;S;0;LAGOA;BH;604678.65;809376.42;653
+655;2001025686;B03000;AMEACA;RUA CRACOVIA;240;85317;14/1/2001 14:24:00;CIDADAO COMUM;S;0;JARDIM EUROPA;BH;608352.36;810508.56;654
+656;2001025687;B03000;AMEACA;AV UM;730;110679;14/1/2001 14:25:00;INICIATIVA;N;0;JARDIM GUANABARA;BH;611764.80;807968.67;655
+657;2001025705;B05000;SEQUESTRO E CARC;RUA DA BAHIA;507;81155;14/1/2001 14:39:00;CIDADAO COMUM;N;AN8;CENTRO (BH);BH;611425.43;797129.06;656
+658;2001025741;B03000;AMEACA;RUA MARIA DE LOU;112;50540;14/1/2001 15:03:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;604565.35;792282.09;657
+659;2001025765;B06000;LESAO CORPORAL;RUA SOCRATES ALV;146;95144;14/1/2001 15:15:00;CIDADAO COMUM;N;0;VIRGINIA;BH;603128.23;794618.01;658
+660;2001025783;B06000;LESAO CORPORAL;ALAMEDA EZEQUIEL;225;27446;14/1/2001 15:28:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611899.54;796686.86;659
+661;2001025788;B06000;LESAO CORPORAL;RUA JUATUBA;42;39367;14/1/2001 15:30:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;605262.83;793420.62;660
+662;2001025805;B03000;AMEACA;RUA JOSE MARIA B;549;38380;14/1/2001 15:37:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607631.11;807779.33;661
+663;2001025826;B06000;LESAO CORPORAL;RUA FLOR DO BESO;252;28492;14/1/2001 15:55:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;605981.94;799070.49;662
+664;2001025867;B03000;AMEACA;RUA LUPERCIO PAI;206;57335;14/1/2001 16:14:00;CIDADAO COMUM;S;;TIROL;BH;599910.51;788988.30;663
+665;2001025948;B03000;AMEACA;RUA CARMO DA CAC;54;13659;14/1/2001 16:59:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606116.87;794269.97;664
+666;2001025963;B06000;LESAO CORPORAL;RUA EUCLASIO;275;26787;14/1/2001 17:07:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613747.64;796622.12;665
+667;2001025964;B06000;LESAO CORPORAL;RUA CINQUENTA;165;302845;14/1/2001 17:07:00;CIDADAO COMUM;S;;TUPI;BH;614216.87;805557.43;666
+668;2001025991;B03000;AMEACA;RUA 4;63;19352;14/1/2001 17:20:00;CIDADAO COMUM;N;;PAULO SEXTO;BH;616421.68;807028.64;667
+669;2001026009;B03000;AMEACA;AV SEN LEVINDO C;4005;14866;14/1/2001 17:28:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;601311.25;786581.21;668
+670;2001026010;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;88;17067;14/1/2001 17:32:00;CIDADAO COMUM;N;;SANTO ANDRE;BH;609523.31;798729.48;669
+671;2001026051;B03000;AMEACA;RUA MARTE;128;44916;14/1/2001 17:47:00;CIDADAO COMUM;S;;SANTA LUCIA;BH;610133.28;791493.83;670
+672;2001026100;B03000;AMEACA;RUA FORMOSA;195;29149;14/1/2001 18:10:00;CIDADAO COMUM;S;;HORTO;BH;613302.97;797777.02;671
+673;2001026113;B03000;AMEACA;RUA JACINTO OLAU;186;36690;14/1/2001 18:15:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610317.15;802037.66;672
+674;2001026152;B09000;ABANDONO DE INCA;RUA PAPOULA;36;31844;14/1/2001 18:38:00;CIDADAO COMUM;S;;REGINA;BH;598758.69;790411.48;673
+675;2001026224;B03000;AMEACA;RUA PAULO DE FRO;95;52722;14/1/2001 19:14:00;INICIATIVA;N;0;CENTRO (BH);BH;610759.34;797631.71;674
+676;2001026226;B03000;AMEACA;BECO DAS MARIAS;39;301279;14/1/2001 19:15:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610478.54;793616.03;675
+677;2001026247;B03000;AMEACA;RUA DUZENTOS E Q;22;24321;14/1/2001 19:26:00;CIDADAO COMUM;N;0;CH VALE DO JATOB;BH;600599.26;787072.73;676
+678;2001026254;B04001;HOMICIDIO TENTAD;RUA SAO VICENTE;86;88126;14/1/2001 19:28:00;CIDADAO COMUM;S;;GRANJA FREITAS;BH;617022.85;798456.93;677
+679;2001026321;B06000;LESAO CORPORAL;RUA SAO JOAO DE ;166;110073;14/1/2001 19:58:00;CIDADAO COMUM;S;;PILAR;BH;607626.60;788623.46;678
+680;2001026324;B06000;LESAO CORPORAL;PRACA CORACAO EU;170;27865;14/1/2001 19:59:00;CIDADAO COMUM;N;AP203;CORACAO EUCARIST;BH;605810.66;796462.32;679
+681;2001026348;B03000;AMEACA;RUA DOUTOR ALIPI;564;2365;14/1/2001 20:09:00;CIDADAO COMUM;N;;CAFEZAL;BH;613838.04;794600.97;680
+682;2001026360;B06000;LESAO CORPORAL;RUA VINTE E OITO;50;33231;14/1/2001 20:12:00;CIDADAO COMUM;S;LJ1;CONJUNTO FELICID;BH;612370.27;807127.34;681
+683;2001026361;B06000;LESAO CORPORAL;RUA JOSE AUGUSTO;113;126257;14/1/2001 20:12:00;CIDADAO COMUM;S;REF:PADARIA ALIN;SAO GABRIEL;BH;613394.90;804456.58;682
+684;2001026416;B04001;HOMICIDIO TENTAD;AV DOM PEDRO II;356;53145;14/1/2001 20:48:00;CIDADAO COMUM;N;0;BONFIM;BH;610241.25;797885.18;683
+685;2001026434;B03000;AMEACA;RUA DESEMBARGADO;601;19986;14/1/2001 20:49:00;CIDADAO COMUM;S;0;SERRA;BH;613943.78;794925.46;684
+686;2001026446;B04001;HOMICIDIO TENTAD;RUA ARACITABA;30;127032;14/1/2001 20:58:00;CIDADAO COMUM;S;;MINASLANDIA;BH;611804.35;804462.96;685
+687;2001026452;B06000;LESAO CORPORAL;RUA FURTADO DE M;292;30158;14/1/2001 21:00:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609763.86;805611.19;686
+688;2001026471;B06000;LESAO CORPORAL;RUA ABELARDO CHA;175;118208;14/1/2001 21:06:00;CIDADAO COMUM;N;;CH TUNEL DE IBIR;BH;599752.96;789832.81;687
+689;2001026514;B06000;LESAO CORPORAL;AV BIAS FORTES;1660;9553;14/1/2001 21:30:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610287.90;797080.46;688
+690;2001026532;B06000;LESAO CORPORAL;AV PRESIDENTE AN;8281;4461;14/1/2001 21:43:00;CIDADAO COMUM;S;;SAO LUIZ;BH;608284.86;804912.96;689
+691;2001026561;B06000;LESAO CORPORAL;RUA LUNDS FERREI;426;41920;14/1/2001 21:53:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;615413.68;800845.00;690
+692;2001026573;B04001;HOMICIDIO TENTAD;RUA DOS CACTOS;283;73119;14/1/2001 21:58:00;CIDADAO COMUM;S;REF:FINAL DO 111;LINDEIA;BH;598989.23;790846.45;691
+693;2001026594;B04001;HOMICIDIO TENTAD;RUA PONTA PORA;170;54601;14/1/2001 22:09:00;CIDADAO COMUM;S;CAA;SANTA EFIGENIA;BH;613187.23;796919.20;692
+694;2001026600;B06000;LESAO CORPORAL;RUA DOUTOR RIBEI;274;23650;14/1/2001 22:10:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;603471.00;792938.94;693
+695;2001026669;B06000;LESAO CORPORAL;RUA MARICA;285;82072;14/1/2001 22:50:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613896.03;804943.57;694
+696;2001026777;B06000;LESAO CORPORAL;RUA CARMO DA CAC;10;13659;14/1/2001 23:41:00;CIDADAO COMUM;N;FU;SALGADO FILHO;BH;606146.59;794290.29;695
+697;2001026793;B04002;HOMICIDIO CONSUM;RUA DOIS;46;109530;14/1/2001 23:47:00;CIDADAO COMUM;N;0;BONSUCESSO;BH;605286.24;790363.21;696
+698;2001026822;B03000;AMEACA;RUA CASTRO ALVES;454;14103;15/1/2001 00:00:00;INICIATIVA;S;;COPACABANA;BH;606016.58;806527.82;697
+699;2001026862;B06000;LESAO CORPORAL;RUA MARIA ROSA D;102;107800;15/1/2001 00:20:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606001.06;811254.93;698
+700;2001026911;B03000;AMEACA;RUA URSULA PAULI;125;71066;15/1/2001 00:56:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606633.82;793659.59;699
+701;2001026952;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;2330;67682;15/1/2001 01:24:00;INICIATIVA;N;0;LOURDES;BH;610463.01;796492.25;700
+702;2001026955;B04002;HOMICIDIO CONSUM;RUA CORONEL ANTO;355;17590;15/1/2001 01:26:00;CIDADAO COMUM;N;FU;JARDIM LEBLON;BH;605978.18;807516.94;701
+703;2001026974;B04001;HOMICIDIO TENTAD;RUA ITAIPU;700;35439;15/1/2001 01:39:00;INICIATIVA;N;0;VERA CRUZ;BH;616224.80;798437.20;702
+704;2001027080;B06000;LESAO CORPORAL;AV ERICO VERISSI;561;41671;15/1/2001 02:55:00;CIDADAO COMUM;N;0;CANDELARIA;BH;608128.88;808577.02;703
+705;2001027123;B03000;AMEACA;AV PRESIDENTE AN;828;4461;15/1/2001 03:46:00;CIDADAO COMUM;S;;LAGOINHA;BH;610489.09;798788.67;704
+706;2001027124;B03000;AMEACA;RUA DOS TUPINAMB;379;69940;15/1/2001 03:47:00;CIDADAO COMUM;S;APA;CENTRO (BH);BH;611197.53;797270.63;705
+707;2001027153;B04001;HOMICIDIO TENTAD;RUA DEZESSEIS;99;32821;15/1/2001 04:44:00;INICIATIVA;S;0;FELICIDADE;BH;612155.90;807182.11;706
+708;2001027224;B03000;AMEACA;RUA JORNALISTA W;505;70381;15/1/2001 07:02:00;CIDADAO COMUM;S;LJA;ITAPOA;BH;609750.72;805961.76;707
+709;2001027290;B03000;AMEACA;RUA LUISIANIA;294;81789;15/1/2001 07:59:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599010.84;789210.41;708
+710;2001027535;B03000;AMEACA;RUA JOAO CAETANO;832;37510;15/1/2001 11:11:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;606577.50;795368.27;709
+711;2001027586;B03000;AMEACA;RUA RAMIRO SIQUE;10;128858;15/1/2001 11:53:00;CIDADAO COMUM;N;0;CASTANHEIRAS (TA;BH;617650.40;797388.81;710
+712;2001027634;B03000;AMEACA;AV NOSSA SENHORA;2777;48107;15/1/2001 12:29:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;609303.34;797427.37;711
+713;2001027649;B03000;AMEACA;RUA FREI CONCEIC;735;29873;15/1/2001 12:46:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604480.03;796335.08;712
+714;2001027671;B03000;AMEACA;RUA BRODOSQUI;264;37160;15/1/2001 12:59:00;CIDADAO COMUM;S;CAA;PIRATININGA;BH;606033.72;809532.74;713
+715;2001027791;B06000;LESAO CORPORAL;RUA MOACIR JOSE ;132;50121;15/1/2001 15:01:00;CIDADAO COMUM;N;;MINASCAIXA;BH;609283.97;809358.15;714
+716;2001027793;B06000;LESAO CORPORAL;RUA RORE CARVALH;181;83567;15/1/2001 15:02:00;CIDADAO COMUM;S;CAFU;LINDEIA;BH;599095.79;791253.82;715
+717;2001027813;B03000;AMEACA;RUA HELIO COSTA;46;32948;15/1/2001 15:07:00;CIDADAO COMUM;S;;PIRAJA;BH;613809.20;802945.76;716
+718;2001027828;B03000;AMEACA;RUA INFANTIL;15;80660;15/1/2001 15:15:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604612.96;797108.92;717
+719;2001027978;B03000;AMEACA;RUA JOAO ALEXAND;879;71384;15/1/2001 16:57:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604478.18;790259.98;718
+720;2001028028;B03000;AMEACA;RUA ITOBI DO OES;100;36139;15/1/2001 17:20:00;CIDADAO COMUM;S;CA2;IPANEMA;BH;605021.06;797922.52;719
+721;2001028144;B08000;VIOLACAO DE DOMI;RUA MODESTINA DE;29;56878;15/1/2001 18:33:00;CIDADAO COMUM;N;0;VISTA ALEGRE;BH;604513.40;793406.58;720
+722;2001028242;B03000;AMEACA;ALAMEDA DAS LATH;1000;84572;15/1/2001 19:17:00;CIDADAO COMUM;N;AP101;SAO LUIZ;BH;608746.76;804097.55;721
+723;2001028284;B06000;LESAO CORPORAL;RUA PAULO TIMOTE;131;41918;15/1/2001 19:42:00;CIDADAO COMUM;N;LJ1;VILA HUMAITA;BH;610309.93;801564.82;722
+724;2001028289;B03000;AMEACA;RUA SAO GERALDO;353;170283;15/1/2001 19:45:00;CIDADAO COMUM;S;;CABANA;BH;604778.44;793924.70;723
+725;2001028291;B03000;AMEACA;RUA BOTUCATU;796;10285;15/1/2001 19:46:00;CIDADAO COMUM;S;;RENASCENCA;BH;611024.84;800182.69;724
+726;2001028438;B06000;LESAO CORPORAL;RUA NELSON HUNGR;1530;46634;15/1/2001 21:08:00;CIDADAO COMUM;S;;TUPI;BH;613245.05;806364.51;725
+727;2001028450;B03000;AMEACA;RUA ASPASIA;127;6293;15/1/2001 21:18:00;INICIATIVA;S;0;ADELAIDE;BH;606996.13;798544.21;726
+728;2001028479;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;4520;17228;15/1/2001 21:32:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;612542.80;795507.60;727
+729;2001028491;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;1701;51657;15/1/2001 21:39:00;CIDADAO COMUM;S;0;VENDA NOVA;BH;608416.84;809036.43;728
+730;2001028514;B06000;LESAO CORPORAL;RUA MODESTINA DE;40;56878;15/1/2001 21:51:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604473.55;793453.50;729
+731;2001028518;B06000;LESAO CORPORAL;RUA LIMA;15;41063;15/1/2001 21:54:00;CIDADAO COMUM;S;LJ1;COPACABANA;BH;606113.57;806114.27;730
+732;2001028601;B03000;AMEACA;RUA CORONEL JOAQ;290;87063;15/1/2001 22:36:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604704.15;807808.13;731
+733;2001028710;B06000;LESAO CORPORAL;RUA DINIS DIAS;145;119673;15/1/2001 23:48:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616573.20;797526.82;732
+734;2001028780;B06000;LESAO CORPORAL;RUA OSCAR LOBO P;270;104480;16/1/2001 00:53:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612347.11;803516.89;733
+735;2001028833;B06000;LESAO CORPORAL;AV DOS ANDRADAS;391;3761;16/1/2001 01:33:00;INICIATIVA;S;0;CENTRO (BH);BH;611562.02;797248.57;734
+736;2001028838;B03000;AMEACA;RUA IRAI;55;34915;16/1/2001 01:37:00;CIDADAO COMUM;N;;CORACAO DE JESUS;BH;609854.94;794169.18;735
+737;2001028846;B08000;VIOLACAO DE DOMI;RUA DOM JOAQUIM ;874;22313;16/1/2001 01:46:00;CIDADAO COMUM;N;0;CORACAO EUCARIST;BH;605566.78;796249.94;736
+738;2001028883;B06000;LESAO CORPORAL;AV AFONSO PENA;3032;1259;16/1/2001 02:30:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612321.21;795046.07;737
+739;2001029145;B06000;LESAO CORPORAL;RUA SAO MATIAS;258;63408;16/1/2001 08:59:00;INICIATIVA;N;0;SERRANO;BH;603478.33;800637.91;738
+740;2001029265;B03000;AMEACA;AV SILVA LOBO;1685;65889;16/1/2001 10:13:00;INICIATIVA;S;0;GRAJAU;BH;608088.35;794919.48;739
+741;2001029275;B06000;LESAO CORPORAL;RUA DA BAHIA;422;81155;16/1/2001 10:21:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611417.58;797211.95;740
+742;2001029310;B06000;LESAO CORPORAL;RUA FRANCISCO DA;411;29729;16/1/2001 10:40:00;CIDADAO COMUM;N;;MONSENHOR MESSIA;BH;606892.04;798251.49;741
+743;2001029335;B03000;AMEACA;RUA ABEILARD PER;48;587;16/1/2001 11:13:00;CIDADAO COMUM;N;CAD;SANTA AMELIA;BH;606763.27;805442.04;742
+744;2001029346;B03000;AMEACA;RUA OZENIL JOSE ;75;86058;16/1/2001 11:19:00;CIDADAO COMUM;S;;VILA FREI LEOPOL;BH;611670.79;809683.45;743
+745;2001029406;B08000;VIOLACAO DE DOMI;RUA POUSO ALEGRE;1314;54932;16/1/2001 12:06:00;CIDADAO COMUM;N;;FLORESTA;BH;612350.46;797901.33;744
+746;2001029518;B03000;AMEACA;RUA FELIPE CAMAR;12;27938;16/1/2001 13:35:00;CIDADAO COMUM;S;;ESPLANADA;BH;613862.69;798419.73;745
+747;2001029618;B06000;LESAO CORPORAL;RUA DOS AERONAUT;385;1158;16/1/2001 14:55:00;INICIATIVA;S;0;LIBERDADE;BH;609426.98;803824.32;746
+748;2001029623;B03000;AMEACA;AV BALEARES;247;89333;16/1/2001 14:59:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;608053.98;809851.39;747
+749;2001029681;B03000;AMEACA;RUA CURITIBA;175;19090;16/1/2001 15:41:00;INICIATIVA;S;0;CENTRO (BH);BH;611005.46;797704.71;748
+750;2001029690;B06000;LESAO CORPORAL;RUA JOSE FLAUSIN;67;95462;16/1/2001 15:46:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;617042.59;804184.81;749
+751;2001029710;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;690;63782;16/1/2001 16:02:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610807.00;793360.70;750
+752;2001029748;B03000;AMEACA;ALAMEDA DIOGO GU;369;21336;16/1/2001 16:34:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601653.68;788600.58;751
+753;2001029824;B03000;AMEACA;RUA NELSON HUNGR;1530;46634;16/1/2001 17:18:00;CIDADAO COMUM;S;;TUPI;BH;613245.05;806364.51;752
+754;2001029849;B03000;AMEACA;RUA WILSON SOARE;530;20664;16/1/2001 17:27:00;CIDADAO COMUM;N;;PLANALTO;BH;610604.63;806147.71;753
+755;2001029852;B03000;AMEACA;RUA JOSE ROBERTO;254;78516;16/1/2001 17:27:00;CIDADAO COMUM;S;;VILA PINHO;BH;602471.77;787524.60;754
+756;2001029870;B03000;AMEACA;RUA JOAQUIM TEIX;10;128845;16/1/2001 17:36:00;CIDADAO COMUM;N;;CASTANHEIRAS (TA;BH;617405.88;796871.94;755
+757;2001029962;B03000;AMEACA;RUA MATIAS AIRES;330;34032;16/1/2001 18:35:00;CIDADAO COMUM;N;;VILA MARAVILHAS;BH;603054.76;795104.69;756
+758;2001029971;B06000;LESAO CORPORAL;RUA PERNAMBUCO;836;53463;16/1/2001 18:38:00;CIDADAO COMUM;S;PX836;FUNCIONARIOS;BH;611527.62;795448.67;757
+759;2001030057;B03000;AMEACA;RUA CANDELARIA;46;12501;16/1/2001 19:16:00;CIDADAO COMUM;N;;VILA OESTE;BH;604297.32;795319.54;758
+760;2001030067;B03000;AMEACA;RUA MINERVINA EU;137;80820;16/1/2001 19:21:00;CIDADAO COMUM;N;;ESTRELA DO ORIEN;BH;606081.61;792178.90;759
+761;2001030122;B04001;HOMICIDIO TENTAD;RUA DA BAHIA;850;81155;16/1/2001 19:51:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611305.01;796799.04;760
+762;2001030162;B03000;AMEACA;RUA DALVA DE MAT;123;19595;16/1/2001 20:16:00;CIDADAO COMUM;S;0;SANTA MONICA DO ;BH;606079.43;808382.47;761
+763;2001030179;B06000;LESAO CORPORAL;RUA DOM CAVATI;55;29300;16/1/2001 20:26:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612535.57;804337.76;762
+764;2001030225;B03000;AMEACA;RUA BARAO DE COC;245;7876;16/1/2001 20:54:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612850.49;798180.54;763
+765;2001030236;B06000;LESAO CORPORAL;RUA CIBIPURUNA;125;60885;16/1/2001 21:08:00;CIDADAO COMUM;S;0;INDUSTRIAL RODRI;BH;616020.85;808409.77;764
+766;2001030297;B03000;AMEACA;RUA VISCONDE DE ;74;73263;16/1/2001 21:49:00;POLICIAL MILITAR;S;0;MAGNESITA;BH;604112.14;794187.97;765
+767;2001030317;B03000;AMEACA;RUA ROSA NEGRA;266;124481;16/1/2001 22:03:00;CIDADAO COMUM;S;;ETELVINA CARNEIR;BH;611498.24;809077.19;766
+768;2001030350;B06000;LESAO CORPORAL;RUA RIACHUELO;1591;58527;16/1/2001 22:29:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606987.22;797534.27;767
+769;2001030355;B03000;AMEACA;RUA GUILHERME PI;337;32516;16/1/2001 22:33:00;CIDADAO COMUM;N;0;MAGNESITA;BH;604227.98;793866.65;768
+770;2001030372;B03000;AMEACA;AV AFONSO PENA;1757;1259;16/1/2001 22:45:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611723.59;796200.98;769
+771;2001030405;B03000;AMEACA;RUA FELIPE DE ME;60;27940;16/1/2001 23:03:00;CIDADAO COMUM;S;0;UNIAO;BH;612275.77;801646.08;770
+772;2001030501;B04001;HOMICIDIO TENTAD;RUA PADRE CAFE;86;51253;16/1/2001 23:46:00;CIDADAO COMUM;S;0;SAUDADE;BH;615066.13;797633.87;771
+773;2001030596;B06000;LESAO CORPORAL;RUA BERNARDO GUI;2213;9364;17/1/2001 00:48:00;INICIATIVA;N;0;LOURDES;BH;610447.87;796167.73;772
+774;2001030617;B03000;AMEACA;RUA VINTE E NOVE;19;73061;17/1/2001 01:10:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604534.00;796873.73;773
+775;2001030637;B04001;HOMICIDIO TENTAD;RUA NANA;255;47186;17/1/2001 01:26:00;INICIATIVA;S;0;MILIONARIOS;BH;603947.95;789918.54;774
+776;2001030671;B04001;HOMICIDIO TENTAD;RUA DAS VERBENAS;62;71545;17/1/2001 01:59:00;CIDADAO COMUM;N;0;LINDEIA;BH;598771.99;790934.64;775
+777;2001030711;B06000;LESAO CORPORAL;RUA FLOR DA AMIZ;320;94646;17/1/2001 02:48:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606193.98;799691.50;776
+778;2001030745;B03000;AMEACA;RUA PADRE JOAO C;411;51455;17/1/2001 03:31:00;CIDADAO COMUM;S;;CORACAO EUCARIST;BH;605827.87;796830.47;777
+779;2001031093;B04002;HOMICIDIO CONSUM;AV SEN LEVINDO C;250;14866;17/1/2001 09:49:00;CIDADAO COMUM;N;0;SANTA CECILIA;BH;600966.68;789489.63;778
+780;2001031100;B03000;AMEACA;AV BERNARDO VASC;1094;9411;17/1/2001 09:52:00;CIDADAO COMUM;N;FU;CACHOEIRINHA;BH;610848.37;801008.03;779
+781;2001031122;B03000;AMEACA;AV AFONSO PENA;4183;1259;17/1/2001 10:10:00;CIDADAO COMUM;S;0;CRUZEIRO;BH;612944.53;794095.63;780
+782;2001031193;B06000;LESAO CORPORAL;RUA TIZIU;514;95881;17/1/2001 11:01:00;CIDADAO COMUM;S;BECO SANTO ANTON;GOIANIA;BH;615351.18;802590.79;781
+783;2001031259;B03000;AMEACA;AV AMAZONAS;2234;3140;17/1/2001 11:54:00;INICIATIVA;S;;BARRO PRETO;BH;609538.19;796266.31;782
+784;2001031309;B03000;AMEACA;RUA ENGENHO DO S;634;80427;17/1/2001 12:33:00;CIDADAO COMUM;S;;ENGENHO NOGUEIRA;BH;606378.52;800198.44;783
+785;2001031353;B03000;AMEACA;RUA CONCEICAO DO;215;81978;17/1/2001 13:04:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614115.15;804354.59;784
+786;2001031379;B03000;AMEACA;RUA RIO DE JANEI;2101;58772;17/1/2001 13:21:00;CIDADAO COMUM;N;0;LOURDES;BH;610746.64;795656.51;785
+787;2001031587;B06000;LESAO CORPORAL;RUA TREZE DE SET;197;69168;17/1/2001 15:47:00;CIDADAO COMUM;S;;LEONINA;BH;608459.92;793384.14;786
+788;2001031669;B03000;AMEACA;RUA ITAPECERICA;946;35757;17/1/2001 16:35:00;CIDADAO COMUM;N;;LAGOINHA;BH;610331.36;798629.12;787
+789;2001031682;B03000;AMEACA;RUA STA CRUZ;703;60466;17/1/2001 16:40:00;CIDADAO COMUM;N;CASA;GRAJAU;BH;608278.05;795120.98;788
+790;2001031690;B03000;AMEACA;RUA FERNANDES TO;45;81271;17/1/2001 16:47:00;CIDADAO COMUM;S;LJ3;FUNCIONARIOS;BH;611476.90;794887.18;789
+791;2001031697;B03000;AMEACA;RUA EXPEDITO FLA;70;84847;17/1/2001 16:50:00;CIDADAO COMUM;N;CASA 41;DA LAGOA;BH;604749.70;809113.09;790
+792;2001031887;B06000;LESAO CORPORAL;RUA INDO;56;34436;17/1/2001 18:33:00;CIDADAO COMUM;S;;CH BETANIA;BH;605116.60;792343.88;791
+793;2001031898;B06000;LESAO CORPORAL;RUA JOAQUIM TEIX;6;128845;17/1/2001 18:39:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617405.88;796871.94;792
+794;2001032040;B03000;AMEACA;RUA SEBASTIAO BR;67;107406;17/1/2001 19:59:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604814.01;792442.75;793
+795;2001032056;B06000;LESAO CORPORAL;ALAMEDA DIOGO GU;320;21336;17/1/2001 20:11:00;CIDADAO COMUM;S;;CASTANHEIRA 2;BH;601785.37;788781.93;794
+796;2001032095;B03000;AMEACA;AV SARAMENHA;1723;64007;17/1/2001 20:33:00;CIDADAO COMUM;S;BL. 32  AP. 104;TUPI;BH;613342.58;805500.03;795
+797;2001032106;B06000;LESAO CORPORAL;RUA JOAO PIRES;95;37866;17/1/2001 20:44:00;CIDADAO COMUM;S;CA;JARDINOPOLIS;BH;604534.36;794612.47;796
+798;2001032176;B03000;AMEACA;AV NOSSA SENHORA;327;48311;17/1/2001 21:36:00;CIDADAO COMUM;S;;PRIMEIRO DE NOVE;BH;612830.58;805154.47;797
+799;2001032362;B03000;AMEACA;RUA TREZE;39;126358;17/1/2001 23:28:00;CIDADAO COMUM;N;;PARQUE SAO JOSE;BH;607047.22;792095.32;798
+800;2001032402;B06000;LESAO CORPORAL;AV RESSACA;370;58454;17/1/2001 23:55:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;606052.47;797241.79;799
+801;2001032521;B06000;LESAO CORPORAL;RUA MAJOR MESSIA;221;115200;18/1/2001 01:06:00;CIDADAO COMUM;N;0;BANDEIRANTES;BH;604706.99;804294.47;800
+802;2001032524;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;18/1/2001 01:16:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;801
+803;2001032593;B06000;LESAO CORPORAL;RUA UARIRA;510;70136;18/1/2001 02:19:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;616229.57;798932.07;802
+804;2001032641;B03000;AMEACA;RUA ARA;139;5250;18/1/2001 02:59:00;CIDADAO COMUM;S;;VILA MARAVILHAS;BH;603021.07;795464.44;803
+805;2001032671;B06000;LESAO CORPORAL;RUA LADAINHA;270;40118;18/1/2001 03:36:00;CIDADAO COMUM;N;CAFU;PRIMEIRO DE MAIO;BH;612103.94;803801.29;804
+806;2001032700;B04001;HOMICIDIO TENTAD;RUA ATIBAIA;191;6530;18/1/2001 04:23:00;INICIATIVA;S;0;PIRATININGA;BH;606522.83;809420.66;805
+807;2001032894;B03000;AMEACA;AV FRANKLIN MAGA;45;29744;18/1/2001 08:46:00;CIDADAO COMUM;S;;TUPI;BH;612519.21;806390.63;806
+808;2001033024;B03000;AMEACA;RUA JOAQUIM SOAR;533;38190;18/1/2001 10:23:00;INICIATIVA;N;0;FLORAMAR;BH;612345.71;805930.65;807
+809;2001033060;B08000;VIOLACAO DE DOMI;RUA BARAO DO MON;960;63653;18/1/2001 10:44:00;CIDADAO COMUM;N;0;CARDOSO;BH;604059.47;787725.48;808
+810;2001033175;B03000;AMEACA;AV BERNARDO VASC;1194;9411;18/1/2001 12:13:00;CIDADAO COMUM;S;FU;CACHOEIRINHA;BH;610951.68;801058.28;809
+811;2001033181;B03000;AMEACA;RUA DOM EUGENIO ;18;22212;18/1/2001 12:20:00;CIDADAO COMUM;N;0;PLANALTO;BH;610690.75;805714.94;810
+812;2001033198;B03000;AMEACA;RUA PONTE NOVA;875;54655;18/1/2001 12:38:00;INICIATIVA;N;0;FLORESTA;BH;611771.89;798243.03;811
+813;2001033239;B02000;RIXA;AV WALDOMIRO LOB;768;66548;18/1/2001 12:59:00;INICIATIVA;N;0;GUARANI;BH;612664.28;805480.89;812
+814;2001033273;B05000;SEQUESTRO E CARC;AV DOM PEDRO II;3552;53145;18/1/2001 13:15:00;INICIATIVA;N;0;ADELAIDE;BH;607395.18;797928.58;813
+815;2001033299;B03000;AMEACA;AV OLEGARIO MACI;1423;49699;18/1/2001 13:40:00;CIDADAO COMUM;S;;LOURDES;BH;610355.84;796334.11;814
+816;2001033329;B06000;LESAO CORPORAL;AV AMAZONAS;2267;3140;18/1/2001 14:08:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609538.15;796202.90;815
+817;2001033436;B06000;LESAO CORPORAL;RUA SANTISSIMA T;157;61516;18/1/2001 15:17:00;CIDADAO COMUM;N;AP108;SAGRADA FAMILIA;BH;613387.78;798604.45;816
+818;2001033449;B03000;AMEACA;RUA A I;1;31526;18/1/2001 15:25:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616922.56;806705.51;817
+819;2001033492;B06000;LESAO CORPORAL;AV MEM DE SA;1736;45395;18/1/2001 15:52:00;CIDADAO COMUM;N;;FAZENDINHA;BH;614290.42;795998.55;818
+820;2001033512;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;1715;17095;18/1/2001 16:03:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;613260.28;797299.09;819
+821;2001033581;B02000;RIXA;RUA RADIALISTA H;35;78950;18/1/2001 16:50:00;CIDADAO COMUM;S;;CEU AZUL;BH;604408.05;808022.13;820
+822;2001033635;B03000;AMEACA;RUA PADRE PEDRO ;111;51657;18/1/2001 17:12:00;CIDADAO COMUM;S;;VENDA NOVA;BH;605043.91;810026.57;821
+823;2001033652;B06000;LESAO CORPORAL;RUA PADRE JULIO ;55;51496;18/1/2001 17:20:00;INICIATIVA;S;0;VERA CRUZ;BH;615000.53;797344.42;822
+824;2001033741;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;584;63782;18/1/2001 18:08:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610825.76;793399.28;823
+825;2001033749;B03000;AMEACA;RUA TIRADENTES;16;48251;18/1/2001 18:13:00;CIDADAO COMUM;S;0;PIRATININGA;BH;605198.06;809060.84;824
+826;2001033881;B04001;HOMICIDIO TENTAD;RUA BRAS;204;170835;18/1/2001 19:13:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;608209.00;793886.27;825
+827;2001033898;B06000;LESAO CORPORAL;RUA IGUACU;674;34118;18/1/2001 19:21:00;CIDADAO COMUM;S;;CONCORDIA;BH;611530.53;799063.01;826
+828;2001033920;B04001;HOMICIDIO TENTAD;RUA JOSE GONCALV;89;99901;18/1/2001 19:33:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614585.31;802987.34;827
+829;2001033923;B03000;AMEACA;RUA ARARI;95;5537;18/1/2001 19:35:00;CIDADAO COMUM;S;OFICINA DO RAMIR;BONFIM;BH;609908.17;797814.73;828
+830;2001033955;B04001;HOMICIDIO TENTAD;RUA PENIDO;83;53306;18/1/2001 19:46:00;CIDADAO COMUM;N;0;PIRAJA;BH;613156.80;803005.55;829
+831;2001033963;B05000;SEQUESTRO E CARC;RUA JACUI;382;36734;18/1/2001 19:49:00;CIDADAO COMUM;N;0;FLORESTA;BH;611811.78;798148.04;830
+832;2001033964;B04001;HOMICIDIO TENTAD;RUA TENENTE JOAO;72;113450;18/1/2001 19:49:00;CIDADAO COMUM;N;;JARDIM GUANABARA;BH;611909.09;807527.63;831
+833;2001034016;B03000;AMEACA;RUA VINTE E OITO;39;33231;18/1/2001 20:25:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612386.16;807143.06;832
+834;2001034052;B03000;AMEACA;RUA BONINAS;271;10115;18/1/2001 20:43:00;CIDADAO COMUM;S;;ESPLANADA;BH;614462.59;798690.33;833
+835;2001034059;B05000;SEQUESTRO E CARC;RUA TEBAS;820;67090;18/1/2001 20:40:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616073.41;798319.09;834
+836;2001034147;B03000;AMEACA;RUA DOS CARIJOS;930;81243;18/1/2001 21:36:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610563.81;797327.45;835
+837;2001034186;B06000;LESAO CORPORAL;RUA SAO TOMAS DE;500;63782;18/1/2001 21:54:00;INICIATIVA;S;0;SAO PEDRO;BH;610867.78;793546.24;836
+838;2001034200;B06000;LESAO CORPORAL;RUA CARLOS SCHET;505;118771;18/1/2001 22:02:00;CIDADAO COMUM;N;;JARDINOPOLIS;BH;605039.83;794569.69;837
+839;2001034282;B06000;LESAO CORPORAL;RUA GUAICURUS;638;32009;18/1/2001 22:50:00;INICIATIVA;S;;CENTRO (BH);BH;611045.09;797686.44;838
+840;2001034301;B03000;AMEACA;RUA SERTAOZINHO;134;84138;18/1/2001 22:59:00;CIDADAO COMUM;N;LJA;JARDIM LEBLON;BH;606208.01;807819.22;839
+841;2001034337;B03000;AMEACA;RUA JAIR LOPES C;25;89359;18/1/2001 23:11:00;CIDADAO COMUM;S;0;LETICIA;BH;607488.53;810081.42;840
+842;2001034362;B03000;AMEACA;RUA ROSALVO DE M;140;70439;18/1/2001 23:27:00;CIDADAO COMUM;S;;GOIANIA;BH;615264.97;803384.96;841
+843;2001034389;B06000;LESAO CORPORAL;RUA ASTOLFO DUTR;380;6426;18/1/2001 23:47:00;CIDADAO COMUM;S;0;ESPLANADA;BH;615034.80;798256.05;842
+844;2001034419;B03000;AMEACA;RUA CRISANTEMO;140;18564;19/1/2001 00:09:00;CIDADAO COMUM;S;;MARAJO;BH;606711.50;793120.10;843
+845;2001034434;B06000;LESAO CORPORAL;RUA SUCURI;169;66450;19/1/2001 00:22:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615059.26;799704.01;844
+846;2001034446;B06000;LESAO CORPORAL;RUA AUGUSTO CESA;70;86451;19/1/2001 00:35:00;CIDADAO COMUM;S;0;LETICIA;BH;606880.19;809662.24;845
+847;2001034488;B03000;AMEACA;RUA SAO MATIAS;397;63408;19/1/2001 01:11:00;CIDADAO COMUM;S;;SERRANO;BH;603549.73;800736.58;846
+848;2001034498;B03000;AMEACA;AV AFONSO PENA;526;1259;19/1/2001 01:17:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611038.27;797264.23;847
+849;2001034552;B09000;ABANDONO DE INCA;RUA ILACIR PEREI;578;114701;19/1/2001 02:13:00;INICIATIVA;N;0;VILA SILVEIRA;BH;612048.74;800476.30;848
+850;2001034715;B03000;AMEACA;RUA CORONEL COST;275;10809;19/1/2001 06:52:00;CIDADAO COMUM;N;0;PLANALTO;BH;610783.13;806561.04;849
+851;2001034845;B06000;LESAO CORPORAL;RUA CRACOVIA;640;85317;19/1/2001 08:35:00;CIDADAO COMUM;S;REF:FINAL DO 220;JARDIM EUROPA;BH;608697.40;810214.06;850
+852;2001034937;B06000;LESAO CORPORAL;RUA RIO COMPRIDO;43;62751;19/1/2001 09:32:00;CIDADAO COMUM;S;ITINERARIO DO 22;VILA SANTA BRANC;BH;605245.60;809653.11;851
+853;2001034962;B03000;AMEACA;RUA ANITA GARIBA;249;4184;19/1/2001 10:00:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608959.99;794513.91;852
+854;2001034972;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;1152;31400;19/1/2001 10:07:00;CIDADAO COMUM;N;PX663;BARRO PRETO;BH;610173.27;797003.72;853
+855;2001034995;B06000;LESAO CORPORAL;RUA SILVIO GUEDE;10;89610;19/1/2001 10:23:00;CIDADAO COMUM;S;;PALMEIRAS;BH;606875.00;790987.05;854
+856;2001035112;B03000;AMEACA;RUA PLATINA;1115;54453;19/1/2001 11:46:00;CIDADAO COMUM;N;;CALAFATE;BH;608044.17;796840.68;855
+857;2001035113;B06000;LESAO CORPORAL;RUA TRES;166;32301;19/1/2001 11:46:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612209.41;807411.82;856
+858;2001035170;B04001;HOMICIDIO TENTAD;RUA PEDRO LESSA;360;53117;19/1/2001 12:26:00;INICIATIVA;N;0;PRADO LOPES;BH;609977.82;798809.19;857
+859;2001035224;B03000;AMEACA;RUA RIO DE JANEI;1058;58772;19/1/2001 13:00:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610976.88;796673.06;858
+860;2001035227;B03000;AMEACA;RUA LIMEIRA;139;54050;19/1/2001 13:03:00;CIDADAO COMUM;S;0;SAO PAULO;BH;606102.38;809708.12;859
+861;2001035483;B03000;AMEACA;RUA LILAS;35;18261;19/1/2001 15:50:00;CIDADAO COMUM;S;0;ALTO DOS PINHEIR;BH;604116.21;795997.43;860
+862;2001035556;B06000;LESAO CORPORAL;RUA JOSE MAURICI;426;58035;19/1/2001 16:32:00;POLICIAL CIVIL;S;;SANTA CRUZ;BH;610629.80;801740.90;861
+863;2001035570;B03000;AMEACA;RUA CARVALHOS;219;13788;19/1/2001 16:40:00;CIDADAO COMUM;S;0;MANGABEIRAS;BH;612116.96;792573.56;862
+864;2001035575;B03000;AMEACA;RUA SILVIO GUEDE;10;89610;19/1/2001 16:43:00;CIDADAO COMUM;S;;PALMEIRAS;BH;606875.00;790987.05;863
+865;2001035577;B02000;RIXA;RUA CLOVIS DE CA;60;16064;19/1/2001 16:44:00;INICIATIVA;N;0;FLORAMAR;BH;612179.96;805856.34;864
+866;2001035788;B03000;AMEACA;BECO NOVA PONTE;60;301242;19/1/2001 18:40:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610896.07;793759.09;865
+867;2001035797;B03000;AMEACA;AV AUGUSTO DE LI;1288;6731;19/1/2001 18:46:00;CIDADAO COMUM;S;CAFU;BARRO PRETO;BH;610091.59;796885.43;866
+868;2001035862;B04001;HOMICIDIO TENTAD;RUA GERALDO ROSA;413;124898;19/1/2001 19:16:00;CIDADAO COMUM;S;;MANGUEIRAS;BH;600857.84;786602.84;867
+869;2001035915;B06000;LESAO CORPORAL;RUA CORNELIO CER;475;17417;19/1/2001 19:45:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605985.02;797880.54;868
+870;2001035955;B03000;AMEACA;RUA IPE ROSA;25;82781;19/1/2001 20:07:00;CIDADAO COMUM;N;0;CELESTINO;BH;610571.21;808589.32;869
+871;2001035993;B03000;AMEACA;RUA TRES;251;300266;19/1/2001 20:31:00;CIDADAO COMUM;S;;VISTA DO SOL;BH;616371.41;804771.28;870
+872;2001036011;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;116;300224;19/1/2001 20:38:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610483.68;793552.32;871
+873;2001036029;B04001;HOMICIDIO TENTAD;RUA GIRASSOL;50;170242;19/1/2001 20:45:00;CIDADAO COMUM;N;;CABANA;BH;604916.41;794394.64;872
+874;2001036040;B03000;AMEACA;AV DOM PEDRO II;533;53145;19/1/2001 20:47:00;CIDADAO COMUM;S;0;BONFIM;BH;610107.60;797839.85;873
+875;2001036088;B06000;LESAO CORPORAL;RUA AZURITA;109;7094;19/1/2001 21:10:00;CIDADAO COMUM;S;;VIRGINIA;BH;603185.21;794446.73;874
+876;2001036091;B06000;LESAO CORPORAL;RUA ANITA GARIBA;54;4184;19/1/2001 21:11:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608849.03;794573.30;875
+877;2001036185;B03000;AMEACA;RUA GOVERNADOR M;23;31642;19/1/2001 21:53:00;CIDADAO COMUM;S;;GAMELEIRA;BH;606275.34;796492.16;876
+878;2001036203;B06000;LESAO CORPORAL;RUA MARCIOS MOUR;63;117306;19/1/2001 22:02:00;CIDADAO COMUM;S;;LINDEIA;BH;600079.56;790636.85;877
+879;2001036272;B06000;LESAO CORPORAL;RUA TAIOBEIRAS;100;17168;19/1/2001 22:39:00;INICIATIVA;S;0;COQUEIROS;BH;602596.36;798636.04;878
+880;2001036329;B04001;HOMICIDIO TENTAD;AV DOM PEDRO II;5146;53145;19/1/2001 23:12:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606192.09;798764.89;879
+881;2001036365;B06000;LESAO CORPORAL;RUA CAICARA;341;11451;19/1/2001 23:28:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615112.79;799155.44;880
+882;2001036369;B06000;LESAO CORPORAL;AV SEN LEVINDO C;1007;14866;19/1/2001 23:30:00;CIDADAO COMUM;S;;MANGUEIRAS;BH;600926.54;788061.46;881
+883;2001036406;B06000;LESAO CORPORAL;AV CLARA NUNES;670;45644;19/1/2001 23:51:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;611029.42;800928.11;882
+884;2001036416;B03000;AMEACA;RUA PEDRO SIMONI;159;301397;20/1/2001 00:00:00;CIDADAO COMUM;S;;OLARIA;BH;601031.98;789234.70;883
+885;2001036433;B03000;AMEACA;AV DOM PEDRO II;1950;53145;20/1/2001 00:09:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608938.73;798417.38;884
+886;2001036489;B04002;HOMICIDIO CONSUM;RUA ILDEU MOREIR;150;80947;20/1/2001 00:37:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605708.95;793399.71;885
+887;2001036556;B03000;AMEACA;RUA JOAQUIM TEIX;63;38207;20/1/2001 01:13:00;CIDADAO COMUM;0;0;CARDOSO;BH;604078.65;788100.48;886
+888;2001036558;B06000;LESAO CORPORAL;RUA JOSE JOAQUIM;342;38871;20/1/2001 01:16:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610903.81;802145.71;887
+889;2001036569;B03000;AMEACA;RUA JOSE LEITE S;60;20548;20/1/2001 01:22:00;CIDADAO COMUM;S;0;LETICIA;BH;607463.95;810357.59;888
+890;2001036651;B06000;LESAO CORPORAL;AV BERNARDO VASC;2717;9411;20/1/2001 02:24:00;INICIATIVA;S;0;IPIRANGA;BH;612138.82;801992.11;889
+891;2001036668;B03000;AMEACA;RUA CASTANHAL;170;96250;20/1/2001 02:34:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614605.78;804429.58;890
+892;2001036690;B04001;HOMICIDIO TENTAD;AV FURQUIM WERNE;1200;650;20/1/2001 02:46:00;INICIATIVA;N;0;TUPI;BH;613155.12;806559.58;891
+893;2001036707;B03000;AMEACA;RUA ANTONIO RIBE;75;96783;20/1/2001 02:56:00;CIDADAO COMUM;S;FU;ANTONIO RIBEIRO ;BH;615051.81;806806.25;892
+894;2001036715;B06000;LESAO CORPORAL;RUA DOS CAETES;372;11376;20/1/2001 03:03:00;CIDADAO COMUM;N;PX409;CENTRO (BH);BH;611253.80;797440.40;893
+895;2001036726;B04001;HOMICIDIO TENTAD;RUA QUATRO DE MA;3;57118;20/1/2001 03:09:00;INICIATIVA;S;0;LEONINA;BH;608663.34;793662.61;894
+896;2001036740;B04001;HOMICIDIO TENTAD;AV AMERICO VESPU;1003;3355;20/1/2001 03:14:00;CIDADAO COMUM;N;0;APARECIDA;BH;609058.54;800075.87;895
+897;2001036755;B06000;LESAO CORPORAL;RUA RIO DE JANEI;97;58772;20/1/2001 03:29:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611257.43;797586.02;896
+898;2001036758;B02000;RIXA;RUA CONTAGEM;1600;70293;20/1/2001 03:33:00;CIDADAO COMUM;S;;SANTA INES;BH;614360.04;801201.70;897
+899;2001036992;B03000;AMEACA;RUA JOSE BARTOLO;36;38512;20/1/2001 08:12:00;CIDADAO COMUM;S;;TUPI;BH;612479.09;806154.91;898
+900;2001037070;B03000;AMEACA;AV FREI ANDREONI;489;75533;20/1/2001 09:15:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606885.38;794024.37;899
+901;2001037105;B03000;AMEACA;RUA AZALEIA;9;115846;20/1/2001 09:44:00;CIDADAO COMUM;S;0;HAVAI;BH;607259.91;793586.09;900
+902;2001037133;B03000;AMEACA;RUA IPE ROSA;25;82781;20/1/2001 10:03:00;CIDADAO COMUM;N;0;CELESTINO;BH;610571.21;808589.32;901
+903;2001037268;B03000;AMEACA;RUA BELA EMILIA;27;96175;20/1/2001 11:51:00;CIDADAO COMUM;S;CA27;OLARIA;BH;601235.90;789192.41;902
+904;2001037308;B04001;HOMICIDIO TENTAD;RUA WILDE JOSE P;35;99321;20/1/2001 12:14:00;CIDADAO COMUM;N;;PLANALTO;BH;609479.86;806756.19;903
+905;2001037335;B03000;AMEACA;RUA CURUPAITI;206;19148;20/1/2001 12:30:00;CIDADAO COMUM;S;CA;PADRE EUSTAQUIO;BH;606230.45;797888.54;904
+906;2001037337;B03000;AMEACA;AV CRISTIANO MAC;1718;18652;20/1/2001 12:31:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612292.78;800077.49;905
+907;2001037348;B03000;AMEACA;RUA MANOEL JOSE ;55;43129;20/1/2001 12:44:00;CIDADAO COMUM;N;0;SANTA CRUZ;BH;610823.28;802125.09;906
+908;2001037394;B06000;LESAO CORPORAL;RUA PURUS;605;55819;20/1/2001 13:20:00;CIDADAO COMUM;N;FU;CONCORDIA;BH;610757.70;799431.82;907
+909;2001037417;B06000;LESAO CORPORAL;RUA PRINCIPAL;55;102699;20/1/2001 13:34:00;CIDADAO COMUM;N;;TIROL;BH;600922.75;789246.93;908
+910;2001037434;B04001;HOMICIDIO TENTAD;RUA YUCATAN;70;36302;20/1/2001 13:47:00;INICIATIVA;S;0;SAO PEDRO;BH;611188.45;793833.06;909
+911;2001037471;B06000;LESAO CORPORAL;RUA SALVADOR PIR;246;60122;20/1/2001 14:08:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604338.28;790483.75;910
+912;2001037519;B06000;LESAO CORPORAL;RUA SAO TOMAS;7;63770;20/1/2001 14:41:00;CIDADAO COMUM;N;;PLANALTO;BH;610686.83;805550.99;911
+913;2001037553;B03000;AMEACA;RUA DIVINO ESPIR;128;96768;20/1/2001 15:08:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614627.89;806302.83;912
+914;2001037652;B03000;AMEACA;RUA ANTONIO JOSE;21;4622;20/1/2001 15:57:00;CIDADAO COMUM;S;;MAGNESITA;BH;604151.12;794091.76;913
+915;2001037676;B03000;AMEACA;RUA JANETE CLAIR;172;50046;20/1/2001 16:10:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607144.48;807726.85;914
+916;2001037702;B04001;HOMICIDIO TENTAD;AV SOLFERINA RIC;840;72840;20/1/2001 16:26:00;INICIATIVA;S;0;JATOBA;BH;600254.65;788290.33;915
+917;2001037728;B04001;HOMICIDIO TENTAD;RUA EVOCACAO;475;26948;20/1/2001 16:45:00;CIDADAO COMUM;S;;SAO JOSE;BH;605856.28;798750.25;916
+918;2001037732;B04001;HOMICIDIO TENTAD;RUA TANCREDO EST;54;66838;20/1/2001 16:48:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609723.18;805275.89;917
+919;2001037739;B06000;LESAO CORPORAL;RUA MUNICIPAL;46;171677;20/1/2001 16:52:00;INICIATIVA;N;0;VILA CEMIG;BH;605614.67;788590.06;918
+920;2001037779;B06000;LESAO CORPORAL;RUA GUAICURUS;660;32009;20/1/2001 17:11:00;INICIATIVA;N;0;CENTRO (BH);BH;611027.05;797689.74;919
+921;2001037812;B06000;LESAO CORPORAL;RUA JOAO PAULO I;65;300458;20/1/2001 17:27:00;CIDADAO COMUM;S;;SAO DOMINGOS;BH;607677.28;793509.05;920
+922;2001037820;B04002;HOMICIDIO CONSUM;RUA BANDONION;110;170139;20/1/2001 17:32:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;613977.41;795089.89;921
+923;2001037856;B06000;LESAO CORPORAL;RUA WALDEMAR DIA;115;15377;20/1/2001 17:53:00;CIDADAO COMUM;S;;CANDELARIA;BH;607931.15;809003.07;922
+924;2001037938;B03000;AMEACA;RUA J;165;41470;20/1/2001 18:37:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602785.39;803022.89;923
+925;2001037965;B06000;LESAO CORPORAL;RUA TRES;396;302811;20/1/2001 18:52:00;CIDADAO COMUM;S;CA15;NOVO AARAO REIS;BH;614548.88;806088.28;924
+926;2001038016;B03000;AMEACA;RUA PEDRA DA VAR;8;127086;20/1/2001 19:19:00;CIDADAO COMUM;S;0;PIRATININGA;BH;605753.30;809312.53;925
+927;2001038183;B03000;AMEACA;RUA CASCALHEIRA;177;13889;20/1/2001 20:44:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609380.40;808731.30;926
+928;2001038240;B03000;AMEACA;RUA OTAVIO CARNE;480;50594;20/1/2001 21:13:00;CIDADAO COMUM;S;0;BOA VISTA;BH;614841.38;799836.60;927
+929;2001038261;B06000;LESAO CORPORAL;RUA JOAO BERNARD;11;114897;20/1/2001 21:22:00;CIDADAO COMUM;S;AP101;PAQUETA;BH;605412.69;802594.48;928
+930;2001038268;B06000;LESAO CORPORAL;RUA BIMBARRA;345;9641;20/1/2001 21:26:00;CIDADAO COMUM;S;;CALAFATE;BH;607141.45;796609.73;929
+931;2001038329;B06000;LESAO CORPORAL;RUA DAS PERPETUA;615;911;20/1/2001 21:56:00;CIDADAO COMUM;N;;LINDEIA;BH;599593.30;790595.60;930
+932;2001038457;B03000;AMEACA;RUA FRANCISCO RO;600;10994;20/1/2001 23:10:00;CIDADAO COMUM;S;;DOM JOAQUIM;BH;613331.06;802015.37;931
+933;2001038479;B03000;AMEACA;RUA VICENTE SOLL;179;24781;20/1/2001 23:20:00;CIDADAO COMUM;S;;NOVA GAMELEIRA;BH;605440.68;794937.65;932
+934;2001038532;B04001;HOMICIDIO TENTAD;RUA DOUTOR CRIST;145;55598;20/1/2001 23:47:00;CIDADAO COMUM;S;0;BARREIRO DE CIMA;BH;604618.87;789081.22;933
+935;2001038588;B06000;LESAO CORPORAL;RUA DOS AIMORES;2198;1640;21/1/2001 00:18:00;CIDADAO COMUM;N;0;LOURDES;BH;610507.20;796334.72;934
+936;2001038624;B03000;AMEACA;RUA PAMPLONA;160;102862;21/1/2001 00:44:00;CIDADAO COMUM;S;0;CH DA LAGOA;BH;604911.66;802925.82;935
+937;2001038693;B06000;LESAO CORPORAL;RUA SEBASTIAO PE;60;125052;21/1/2001 01:20:00;CIDADAO COMUM;S;0;CONJUNTO ERNESTO;BH;601292.68;787495.16;936
+938;2001038729;B03000;AMEACA;PRACA SAO VICENT;10;63902;21/1/2001 01:39:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605483.12;797829.06;937
+939;2001038737;B06000;LESAO CORPORAL;RUA PADRE EUSTAQ;2521;51294;21/1/2001 01:43:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;607174.78;797630.57;938
+940;2001038756;B04001;HOMICIDIO TENTAD;RUA MUTUM;288;47003;21/1/2001 01:59:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606334.37;797068.42;939
+941;2001038762;B03000;AMEACA;RUA DOS CARIJOS;408;81243;21/1/2001 02:05:00;CIDADAO COMUM;N;AP4;CENTRO (BH);BH;611064.18;797198.94;940
+942;2001038767;B04002;HOMICIDIO CONSUM;RUA TOMBOS;52;67985;21/1/2001 02:09:00;INICIATIVA;N;0;CALAFATE;BH;607976.07;796885.75;941
+943;2001038780;B06000;LESAO CORPORAL;AV DOM JOAO VI;1640;22294;21/1/2001 02:15:00;INICIATIVA;N;0;PALMEIRAS;BH;606859.87;791154.76;942
+944;2001038784;B06000;LESAO CORPORAL;RUA TAMANDARE;261;66778;21/1/2001 02:18:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;605277.43;795832.10;943
+945;2001038806;B03000;AMEACA;RUA CURITIBA;339;19090;21/1/2001 02:31:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610965.75;797546.07;944
+946;2001038890;B06000;LESAO CORPORAL;AV SEN LEVINDO C;4445;14866;21/1/2001 03:43:00;CIDADAO COMUM;N;0;CH VALE DO JATOB;BH;601253.14;786620.47;945
+947;2001038915;B02000;RIXA;AV VILARINHOS;313;109988;21/1/2001 03:59:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609359.99;808778.03;946
+948;2001039010;B03000;AMEACA;RUA DOS TUPINAMB;875;69940;21/1/2001 05:43:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610735.22;797386.07;947
+949;2001039148;B06000;LESAO CORPORAL;AV AFONSO PENA;305;1259;21/1/2001 08:31:00;CIDADAO COMUM;N;PX305;CENTRO (BH);BH;610990.99;797465.67;948
+950;2001039240;B03000;AMEACA;RUA STA ROSA;10;61314;21/1/2001 09:57:00;CIDADAO COMUM;N;NUMERO CORRETO E;SAO TOMAZ;BH;609654.78;805254.46;949
+951;2001039277;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;322;51657;21/1/2001 10:29:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;609650.08;808286.90;950
+952;2001039291;B03000;AMEACA;RUA MADEIRA;95;42328;21/1/2001 10:40:00;CIDADAO COMUM;S;;RENASCENCA;BH;611016.45;799716.70;951
+953;2001039354;B06000;LESAO CORPORAL;RUA LINDOLFO DE ;2615;41164;21/1/2001 11:46:00;CIDADAO COMUM;N;NR/EXATO: 2685;SAO DOMINGOS;BH;608030.43;793288.52;952
+954;2001039355;B03000;AMEACA;RUA BARREIRO GRA;141;8258;21/1/2001 11:46:00;INICIATIVA;N;0;MARIA GORETTI;BH;614070.76;803291.42;953
+955;2001039358;B03000;AMEACA;RUA FRANCISCO BR;63;65270;21/1/2001 11:49:00;CIDADAO COMUM;S;LJA;ESTRELA DALVA;BH;607266.70;792342.60;954
+956;2001039382;B03000;AMEACA;RUA SA E BENEVID;86;10708;21/1/2001 12:14:00;CIDADAO COMUM;N;;UNIVERSITARIO;BH;610216.40;802593.25;955
+957;2001039416;B03000;AMEACA;RUA XAVIER DA VE;166;73843;21/1/2001 12:40:00;CIDADAO COMUM;N;;MINAS BRASIL;BH;605784.32;797406.65;956
+958;2001039475;B06000;LESAO CORPORAL;RUA JARDIM DAS O;37;56083;21/1/2001 13:43:00;CIDADAO COMUM;S;0;SAO JOSE;BH;605441.09;799029.32;957
+959;2001039481;B03000;AMEACA;RUA GALBA;152;30463;21/1/2001 13:44:00;CIDADAO COMUM;S;;GLORIA;BH;604337.53;798313.12;958
+960;2001039521;B03000;AMEACA;RUA BOM JESUS DA;599;99680;21/1/2001 14:16:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604069.20;802854.62;959
+961;2001039534;B03000;AMEACA;RUA TENENTE ALIP;40;86436;21/1/2001 14:27:00;INICIATIVA;S;0;JARDIM GUANABARA;BH;611918.24;807418.95;960
+962;2001039550;B04001;HOMICIDIO TENTAD;AV NELIO CERQUEI;15;72359;21/1/2001 14:38:00;CIDADAO COMUM;N;;TIROL;BH;600947.66;789885.51;961
+963;2001039569;B06000;LESAO CORPORAL;RUA DOS CAETES;650;11376;21/1/2001 14:50:00;CIDADAO COMUM;S;PX262;CENTRO (BH);BH;610985.31;797507.20;962
+964;2001039577;B03000;AMEACA;RUA IPANEMA;1135;34726;21/1/2001 14:58:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602814.25;802311.29;963
+965;2001039578;B06000;LESAO CORPORAL;RUA VITORIA REGI;338;73540;21/1/2001 14:58:00;CIDADAO COMUM;S;0;LINDEIA;BH;599149.00;790863.07;964
+966;2001039605;B03000;AMEACA;RUA DIMAS;87;21291;21/1/2001 15:12:00;CIDADAO COMUM;S;FR;SAO PAULO;BH;613218.01;802951.21;965
+967;2001039615;B03000;AMEACA;RUA JOAO PINTO;10;105542;21/1/2001 15:15:00;CIDADAO COMUM;S;0;JARDINOPOLIS;BH;605044.55;794808.96;966
+968;2001039672;B03000;AMEACA;RUA PADRE MARINH;60;51571;21/1/2001 15:58:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;613015.90;796391.73;967
+969;2001039745;B03000;AMEACA;AV SOUZA AGUIAR;2184;84402;21/1/2001 16:51:00;CIDADAO COMUM;N;;CAETANO FURQUIM;BH;616305.52;798833.55;968
+970;2001039818;B06000;LESAO CORPORAL;RUA FRANCISCO DU;247;46316;21/1/2001 17:29:00;CIDADAO COMUM;N;;SANTA TEREZINHA;BH;604462.79;802286.77;969
+971;2001039821;B06000;LESAO CORPORAL;RUA DOS COMANCHE;717;16367;21/1/2001 17:29:00;CIDADAO COMUM;S;;ITAMARATI;BH;606559.95;807215.50;970
+972;2001039827;B03000;AMEACA;RUA DAS PETUNIAS;1055;11870;21/1/2001 17:34:00;CIDADAO COMUM;S;;LINDEIA;BH;598670.92;790714.72;971
+973;2001039840;B06000;LESAO CORPORAL;RUA SAO SEBASTIA;11;170227;21/1/2001 17:37:00;CIDADAO COMUM;N;;CABANA;BH;604747.07;794381.91;972
+974;2001039862;B06000;LESAO CORPORAL;AV SINFRONIO BRO;1355;66116;21/1/2001 17:49:00;CIDADAO COMUM;S;;BARREIRO;BH;602021.17;790667.36;973
+975;2001039880;B03000;AMEACA;RUA NATIVIDADE;36;96641;21/1/2001 17:57:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605991.69;792207.10;974
+976;2001039932;B06000;LESAO CORPORAL;RUA CARTAGENA;154;62257;21/1/2001 18:26:00;CIDADAO COMUM;S;LJA;TREVO;BH;604055.51;805882.78;975
+977;2001039939;B06000;LESAO CORPORAL;AV BRAULIO GOMES;448;81710;21/1/2001 18:24:00;CIDADAO COMUM;N;;ITAIPU BH;BH;600487.50;789975.51;976
+978;2001039961;B03000;AMEACA;RUA PADRE GERALD;28;79840;21/1/2001 18:40:00;CIDADAO COMUM;N;0;MAGNESITA;BH;604349.31;793797.91;977
+979;2001039979;B02000;RIXA;RUA OSCAR CORREI;185;50440;21/1/2001 18:49:00;CIDADAO COMUM;S;;FLORAMAR;BH;611918.19;806355.64;978
+980;2001040002;B03000;AMEACA;RUA ANTONIO PRET;39;4780;21/1/2001 18:58:00;CIDADAO COMUM;N;;ALIPIO DE MELO;BH;604937.08;798863.96;979
+981;2001040030;B06000;LESAO CORPORAL;RUA MARIA MARTIN;1807;44248;21/1/2001 19:14:00;CIDADAO COMUM;N;CAB;SAGRADA FAMILIA;BH;613531.45;799029.43;980
+982;2001040101;B03000;AMEACA;RUA COMENDADOR W;472;16430;21/1/2001 19:48:00;INICIATIVA;S;0;SAO TOMAZ;BH;610078.75;805261.96;981
+983;2001040108;B03000;AMEACA;RUA DA CONSTITUI;26;102368;21/1/2001 19:51:00;CIDADAO COMUM;N;FU;CEU AZUL;BH;604159.50;807833.29;982
+984;2001040115;B04001;HOMICIDIO TENTAD;RUA FATIMA SIMOE;63;117205;21/1/2001 19:56:00;CIDADAO COMUM;N;0;CAPITAO EDUARDO;BH;618273.92;806536.95;983
+985;2001040172;B04001;HOMICIDIO TENTAD;RUA SOARES DO CO;54;66217;21/1/2001 20:27:00;CIDADAO COMUM;N;;VILA PARIS;BH;609894.39;793593.43;984
+986;2001040193;B06000;LESAO CORPORAL;RUA JANUARIA MAR;55;85418;21/1/2001 20:36:00;CIDADAO COMUM;S;;SERRA VERDE;BH;608917.00;810389.06;985
+987;2001040195;B03000;AMEACA;RUA STA DOROTEIA;30;60500;21/1/2001 20:37:00;CIDADAO COMUM;S;CAB;SAO GABRIEL;BH;613919.00;804270.30;986
+988;2001040271;B03000;AMEACA;RUA JOSEFINA FIR;133;98690;21/1/2001 21:08:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;607149.10;810079.48;987
+989;2001040294;B06000;LESAO CORPORAL;RUA DOS INDEPEND;258;109165;21/1/2001 21:19:00;CIDADAO COMUM;S;0;VILA SANTA RITA;BH;601157.29;787604.80;988
+990;2001040385;B06000;LESAO CORPORAL;RUA OCIDENTAL;532;73903;21/1/2001 22:05:00;CIDADAO COMUM;S;0;SERRANO;BH;603644.31;800551.97;989
+991;2001040488;B03000;AMEACA;AV SILVA GUIMARA;20;65863;21/1/2001 23:12:00;INICIATIVA;N;0;ITAIPU BH;BH;598818.25;789175.63;990
+992;2001040505;B06000;LESAO CORPORAL;RUA BEZERRA DE M;131;9525;21/1/2001 23:22:00;CIDADAO COMUM;S;CAA;NAZARE;BH;615459.45;804541.73;991
+993;2001040518;B04001;HOMICIDIO TENTAD;RUA SESSENTA E O;359;106066;21/1/2001 23:28:00;CIDADAO COMUM;N;FU;TOPAZIO;BH;607584.58;812106.94;992
+994;2001040568;B03000;AMEACA;RUA ENGENHO DO C;154;94586;22/1/2001 00:04:00;CIDADAO COMUM;S;;ENGENHO NOGUEIRA;BH;606492.27;800416.82;993
+995;2001040585;B03000;AMEACA;RUA PINTOR AUGUS;20;128091;22/1/2001 00:13:00;CIDADAO COMUM;S;CSA;TUPI;BH;613230.05;805854.87;994
+996;2001040597;B04001;HOMICIDIO TENTAD;RUA JAGUARIBE;71;36822;22/1/2001 00:28:00;CIDADAO COMUM;S;;CONCORDIA;BH;610604.19;799503.99;995
+997;2001040609;B06000;LESAO CORPORAL;RUA BEIRA LINHA;188;121732;22/1/2001 00:42:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615463.61;805379.11;996
+998;2001040618;B03000;AMEACA;RUA LAURO GOMES ;128;64845;22/1/2001 00:51:00;CIDADAO COMUM;S;AP2;DOM JOAQUIM;BH;613776.69;801526.10;997
+999;2001040661;B08000;VIOLACAO DE DOMI;RUA MADALENA;315;42315;22/1/2001 01:16:00;CIDADAO COMUM;N;0;SENHOR BOM JESUS;BH;609692.90;799840.91;998
+1000;2001040696;B04001;HOMICIDIO TENTAD;AV BERNARDO VASC;1172;9411;22/1/2001 01:57:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610951.68;801058.28;999
+1001;2001040802;B06000;LESAO CORPORAL;RUA SAO JOAQUIM;698;62940;22/1/2001 04:24:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613152.40;799476.16;1000
+1002;2001041104;B03000;AMEACA;AV AFONSO PENA;867;1259;22/1/2001 10:15:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611254.14;797008.25;1001
+1003;2001041109;B06000;LESAO CORPORAL;RUA VIOLETA;596;73074;22/1/2001 10:16:00;CIDADAO COMUM;S;;ESPLANADA;BH;614632.06;798499.76;1002
+1004;2001041181;B06000;LESAO CORPORAL;RUA MARIA ANTONI;123;15730;22/1/2001 11:21:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608281.16;808228.73;1003
+1005;2001041191;B03000;AMEACA;AV AFONSO PENA;571;1259;22/1/2001 11:27:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611120.69;797250.44;1004
+1006;2001041277;B09000;ABANDONO DE INCA;RUA GAMA CERQUEI;840;30564;22/1/2001 12:31:00;CIDADAO COMUM;N;;JARDIM AMERICA;BH;607374.14;794959.39;1005
+1007;2001041394;B03000;AMEACA;RUA DONA VIRGINI;110;23054;22/1/2001 14:11:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606564.90;797958.84;1006
+1008;2001041412;B03000;AMEACA;RUA GALDINO;18;75590;22/1/2001 14:27:00;CIDADAO COMUM;S;;LINDEIA;BH;599722.92;790847.61;1007
+1009;2001041423;B03000;AMEACA;RUA JOAQUIM DE F;1313;38033;22/1/2001 14:35:00;INICIATIVA;S;0;SANTA HELENA (BH;BH;603050.87;790075.16;1008
+1010;2001041519;B03000;AMEACA;RUA LICINIO PORT;28;20434;22/1/2001 15:43:00;CIDADAO COMUM;S;;TIROL;BH;599792.31;789385.84;1009
+1011;2001041545;B04001;HOMICIDIO TENTAD;RUA ICO;130;34020;22/1/2001 15:57:00;CIDADAO COMUM;S;;SAUDADE;BH;615033.00;797538.06;1010
+1012;2001041573;B03000;AMEACA;RUA MORRINHOS;397;46808;22/1/2001 16:08:00;CIDADAO COMUM;N;0;CAETANO FURQUIM;BH;616540.30;798975.24;1011
+1013;2001041608;B03000;AMEACA;RUA TUCUMAN;40;69823;22/1/2001 16:31:00;INICIATIVA;N;0;SAO GERALDO;BH;614856.59;799413.07;1012
+1014;2001041799;B06000;LESAO CORPORAL;RUA COVA IRIA;406;120972;22/1/2001 18:21:00;CIDADAO COMUM;N;;MARIA HELENA;BH;605238.63;810733.95;1013
+1015;2001041803;B06000;LESAO CORPORAL;RUA TREZE DE SET;266;69168;22/1/2001 18:23:00;CIDADAO COMUM;N;;LEONINA;BH;608522.06;793376.97;1014
+1016;2001041831;B03000;AMEACA;RUA MARCIA WINDS;82;21478;22/1/2001 18:35:00;CIDADAO COMUM;S;;MINEIRAO;BH;601800.40;785099.89;1015
+1017;2001041843;B04001;HOMICIDIO TENTAD;RUA CURITIBA;685;19090;22/1/2001 18:40:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610868.54;797204.70;1016
+1018;2001041890;B03000;AMEACA;RUA ENGENHO DO S;713;80427;22/1/2001 19:04:00;INICIATIVA;N;;ENGENHO NOGUEIRA;BH;606348.11;800172.67;1017
+1019;2001041907;B03000;AMEACA;RUA MINISTRO OLI;531;46619;22/1/2001 19:12:00;INICIATIVA;S;0;SANTA MONICA;BH;607645.48;807903.83;1018
+1020;2001041917;B06000;LESAO CORPORAL;RUA DOM LUCIO AN;892;22382;22/1/2001 19:17:00;CIDADAO COMUM;S;AP 204;CORACAO EUCARIST;BH;605491.73;796342.06;1019
+1021;2001042143;B04001;HOMICIDIO TENTAD;BECO SAO PAULO;5;301199;22/1/2001 21:21:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610955.63;793472.49;1020
+1022;2001042149;B04002;HOMICIDIO CONSUM;RUA CORONEL ANTO;182;17590;22/1/2001 21:24:00;INICIATIVA;N;0;JARDIM LEBLON;BH;606140.28;807563.65;1021
+1023;2001042224;B03000;AMEACA;RUA VEREADOR ORL;259;71573;22/1/2001 22:12:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;603777.40;792859.37;1022
+1024;2001042265;B04001;HOMICIDIO TENTAD;AV MENELICK DE C;386;30448;22/1/2001 22:36:00;INICIATIVA;N;0;FLAVIO MARQUES D;BH;604597.26;788928.08;1023
+1025;2001042338;B03000;AMEACA;RUA CACONDE;109;11275;22/1/2001 23:32:00;CIDADAO COMUM;S;;NOVA FLORESTA;BH;611770.35;800238.44;1024
+1026;2001042371;B06000;LESAO CORPORAL;RODOVIA MG 20;17;26620;22/1/2001 23:58:00;INICIATIVA;S;0;BELO HORIZONTE (;BH;614269.93;806003.75;1025
+1027;2001042380;B04002;HOMICIDIO CONSUM;BECO PRINCIPAL;5;301983;23/1/2001 00:09:00;CIDADAO COMUM;N;0;SAO JOSE;BH;604808.72;799278.97;1026
+1028;2001042402;B04001;HOMICIDIO TENTAD;RUA DAS GAIVOTAS;778;30450;23/1/2001 00:19:00;CIDADAO COMUM;S;;VILA CLORIS;BH;611033.72;807691.96;1027
+1029;2001042428;B06000;LESAO CORPORAL;RUA TIZIU;66;95881;23/1/2001 00:34:00;CIDADAO COMUM;N;LJ;GOIANIA;BH;615310.05;802956.29;1028
+1030;2001042441;B03000;AMEACA;RUA PAGEU;200;51818;23/1/2001 00:43:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611061.99;798954.74;1029
+1031;2001042563;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;369;17095;23/1/2001 02:54:00;INICIATIVA;N;0;FLORESTA;BH;612011.55;797008.04;1030
+1032;2001042583;B08000;VIOLACAO DE DOMI;RUA ROBERTO BARB;16;94053;23/1/2001 03:29:00;INICIATIVA;N;0;CARDOSO;BH;603859.19;788590.10;1031
+1033;2001042596;B06000;LESAO CORPORAL;RUA NELSON HUNGR;10;46634;23/1/2001 03:47:00;CIDADAO COMUM;N;;TUPI;BH;612851.92;806239.44;1032
+1034;2001042696;B03000;AMEACA;RUA FLOR DE VIDR;310;13504;23/1/2001 07:32:00;CIDADAO COMUM;N;0;CASTELO;BH;605657.99;799640.71;1033
+1035;2001042742;B06000;LESAO CORPORAL;RUA RAVENA;179;58048;23/1/2001 08:14:00;CIDADAO COMUM;S;;NOVA VISTA;BH;614868.70;800661.13;1034
+1036;2001042783;B06000;LESAO CORPORAL;RUA CONDOR;405;16773;23/1/2001 08:49:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605871.88;793840.52;1035
+1037;2001042838;B06000;LESAO CORPORAL;RUA JOAO PAULO I;220;300458;23/1/2001 09:26:00;CIDADAO COMUM;N;;SAO DOMINGOS;BH;607666.14;793505.29;1036
+1038;2001042899;B03000;AMEACA;AV PRESIDENTE AN;3333;4461;23/1/2001 10:14:00;INICIATIVA;N;0;CACHOEIRINHA;BH;609867.68;801202.75;1037
+1039;2001043019;B03000;AMEACA;RUA ALVARO ALVIM;15;103490;23/1/2001 11:32:00;CIDADAO COMUM;S;;CAICARA;BH;607829.25;800104.71;1038
+1040;2001043064;B03000;AMEACA;RUA CHAFARIZ;111;300275;23/1/2001 12:07:00;CIDADAO COMUM;N;;HAVAI;BH;607375.81;793751.13;1039
+1041;2001043148;B06000;LESAO CORPORAL;AV CRISTIANO MAC;7020;18652;23/1/2001 13:14:00;CIDADAO COMUM;S;;VILA SUZANA;BH;612053.97;803296.28;1040
+1042;2001043181;B06000;LESAO CORPORAL;RUA DOUTOR SETTE;396;23662;23/1/2001 13:45:00;CIDADAO COMUM;S;AP402;LUXEMBURGO;BH;609314.30;794473.59;1041
+1043;2001043201;B03000;AMEACA;RUA DOS TIMBIRAS;1350;67682;23/1/2001 13:56:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611415.81;796238.60;1042
+1044;2001043276;B03000;AMEACA;RUA CAMAPUAN;200;11726;23/1/2001 14:50:00;CIDADAO COMUM;S;AP503;ALTO BARROCA;BH;607974.18;795648.55;1043
+1045;2001043278;B03000;AMEACA;RUA DOS TAMOIOS;486;66825;23/1/2001 14:51:00;INICIATIVA;S;PX438;CENTRO (BH);BH;610901.10;797097.30;1044
+1046;2001043312;B03000;AMEACA;RUA FRANCISCO MA;420;56824;23/1/2001 15:16:00;INICIATIVA;S;0;ESTRELA DALVA;BH;607428.83;792074.36;1045
+1047;2001043368;B06000;LESAO CORPORAL;RUA JEQUIA;270;37245;23/1/2001 15:50:00;CIDADAO COMUM;N;CAFR;SAO CRISTOVAO;BH;610642.51;799757.02;1046
+1048;2001043397;B06000;LESAO CORPORAL;AV JOSE RACHEL D;130;85912;23/1/2001 16:05:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;616924.95;804830.32;1047
+1049;2001043531;B03000;AMEACA;RUA FORMIGA;431;29136;23/1/2001 17:33:00;CIDADAO COMUM;S;;LAGOINHA;BH;610642.40;798955.21;1048
+1050;2001043533;B03000;AMEACA;RUA CONGONHAL;50;82955;23/1/2001 17:35:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604214.03;802374.59;1049
+1051;2001043541;B06000;LESAO CORPORAL;RUA SAO BENTO;1862;127801;23/1/2001 17:41:00;CIDADAO COMUM;S;;INSTITUTO AGRONO;BH;613806.19;798841.38;1050
+1052;2001043682;B06000;LESAO CORPORAL;RUA VENEZA;16;71444;23/1/2001 18:55:00;CIDADAO COMUM;S;B;NOVA SUISSA;BH;607426.53;795521.26;1051
+1053;2001043765;B03000;AMEACA;RUA DOS JES;158;37333;23/1/2001 19:45:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;607044.75;807302.74;1052
+1054;2001043807;B03000;AMEACA;RUA JAIME GOMES;40;36835;23/1/2001 20:20:00;CIDADAO COMUM;S;;FLORESTA;BH;612185.31;798118.31;1053
+1055;2001043817;B03000;AMEACA;RUA CASTELO BRAN;70;14030;23/1/2001 20:24:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604435.67;802549.95;1054
+1056;2001043831;B06000;LESAO CORPORAL;AV OTACILIO NEGR;3400;50566;23/1/2001 20:40:00;CIDADAO COMUM;S;;SAO LUIZ;BH;606628.37;803745.77;1055
+1057;2001043837;B03000;AMEACA;RUA BENJAMIM QUA;133;9210;23/1/2001 20:43:00;CIDADAO COMUM;S;0;PARAISO;BH;614517.71;797103.48;1056
+1058;2001043854;B03000;AMEACA;RUA GASPARINO CA;277;114903;23/1/2001 20:53:00;INICIATIVA;S;0;PAQUETA;BH;605422.28;802400.54;1057
+1059;2001043896;B03000;AMEACA;RUA MANOEL CAYLL;160;43043;23/1/2001 21:26:00;CIDADAO COMUM;S;AP102;HORTO;BH;613298.53;798204.06;1058
+1060;2001043949;B06000;LESAO CORPORAL;RUA CHAFARIZ;40;300275;23/1/2001 21:55:00;CIDADAO COMUM;N;CAB;HAVAI;BH;607407.04;793804.07;1059
+1061;2001044015;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;1122;6731;23/1/2001 22:44:00;CIDADAO COMUM;N;BLJ     AP301;BARRO PRETO;BH;610255.53;796843.17;1060
+1062;2001044020;B06000;LESAO CORPORAL;RUA CARAVELAS;410;13141;23/1/2001 22:49:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615549.03;798247.68;1061
+1063;2001044040;B03000;AMEACA;RUA YARA LUCIA;44;33777;23/1/2001 23:01:00;CIDADAO COMUM;S;PX30;NOVA CINTRA;BH;606182.82;793671.01;1062
+1064;2001044084;B06000;LESAO CORPORAL;RUA IBITIRA;228;33940;23/1/2001 23:33:00;CIDADAO COMUM;S;CAA;VILA MARAVILHAS;BH;602921.19;795334.48;1063
+1065;2001044123;B06000;LESAO CORPORAL;RUA STA CLAUDIA;246;60453;24/1/2001 00:05:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604414.90;789230.99;1064
+1066;2001044126;B06000;LESAO CORPORAL;AV VILARINHOS;530;109988;24/1/2001 00:06:00;CIDADAO COMUM;N;0;VENDA NOVA;BH;609120.91;808971.44;1065
+1067;2001044157;B03000;AMEACA;RUA CAETANO PIRR;465;45773;24/1/2001 00:35:00;CIDADAO COMUM;S;A;MILIONARIOS;BH;604038.30;790103.10;1066
+1068;2001044174;B06000;LESAO CORPORAL;RUA VINTE E UM D;7;72286;24/1/2001 00:51:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610893.23;797841.46;1067
+1069;2001044311;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;876;6731;24/1/2001 03:44:00;INICIATIVA;N;0;CENTRO (BH);BH;610565.57;796755.00;1068
+1070;2001044359;B04001;HOMICIDIO TENTAD;RUA DAS PERPETUA;615;911;24/1/2001 05:08:00;CIDADAO COMUM;N;;LINDEIA;BH;599593.30;790595.60;1069
+1071;2001044716;B04002;HOMICIDIO CONSUM;RUA CACHOEIRA DE;10;11247;24/1/2001 11:00:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;609110.10;794267.00;1070
+1072;2001044993;B03000;AMEACA;AV AMAZONAS;3034;3140;24/1/2001 14:35:00;CIDADAO COMUM;S;0;GUTIERREZ;BH;608815.11;795984.84;1071
+1073;2001045017;B03000;AMEACA;RUA JOSE LAVARIN;232;40537;24/1/2001 14:53:00;CIDADAO COMUM;S;FU;PARAISO;BH;614298.37;796663.19;1072
+1074;2001045143;B03000;AMEACA;RUA ITAIPU;1149;35439;24/1/2001 15:54:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616346.43;797993.47;1073
+1075;2001045149;B03000;AMEACA;RUA LEONCIO CHAG;214;40700;24/1/2001 15:55:00;CIDADAO COMUM;N;0;UNIAO;BH;613047.37;800965.00;1074
+1076;2001045158;B06000;LESAO CORPORAL;RUA AMERICO SCOT;53;3342;24/1/2001 16:01:00;CIDADAO COMUM;S;;SERRA;BH;612638.54;795565.51;1075
+1077;2001045167;B03000;AMEACA;RUA FERNAO DIAS;80;28133;24/1/2001 16:04:00;CIDADAO COMUM;S;0;CASA BRANCA;BH;615915.15;798840.47;1076
+1078;2001045249;B06000;LESAO CORPORAL;RUA FELISBURGO;108;3950;24/1/2001 16:46:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612659.95;804501.51;1077
+1079;2001045290;B03000;AMEACA;RUA PEDRO GLANSM;120;53044;24/1/2001 17:14:00;CIDADAO COMUM;S;0;INDUSTRIAL RODRI;BH;615927.58;808718.47;1078
+1080;2001045375;B06000;LESAO CORPORAL;RUA GUARATINGUET;24;32295;24/1/2001 18:01:00;CIDADAO COMUM;N;CAFU;GUARANI;BH;612687.54;805517.29;1079
+1081;2001045377;B06000;LESAO CORPORAL;RUA GUARARAPES;22;32241;24/1/2001 18:01:00;CIDADAO COMUM;S;;GLORIA;BH;603926.83;798914.01;1080
+1082;2001045445;B03000;AMEACA;AV ASSIS CHATEAU;176;6353;24/1/2001 18:40:00;CIDADAO COMUM;S;;FLORESTA;BH;612121.94;797426.16;1081
+1083;2001045543;B04001;HOMICIDIO TENTAD;RUA SOLIMOES;172;66273;24/1/2001 19:22:00;CIDADAO COMUM;S;;CABANA;BH;604623.34;794561.91;1082
+1084;2001045631;B03000;AMEACA;RUA DEZOITO;25;80225;24/1/2001 20:15:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605387.77;793337.29;1083
+1085;2001045633;B06000;LESAO CORPORAL;RUA RUBIO FERREI;124;56373;24/1/2001 20:16:00;CIDADAO COMUM;N;FU;TIROL;BH;599909.18;789518.18;1084
+1086;2001045730;B03000;AMEACA;RUA CARMEM;117;100407;24/1/2001 21:14:00;CIDADAO COMUM;N;;SANTA MONICA DO ;BH;606236.18;808762.74;1085
+1087;2001045738;B03000;AMEACA;RUA PADRE PEDRO ;175;51657;24/1/2001 21:19:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;1086
+1088;2001045757;B03000;AMEACA;RUA T;171;78456;24/1/2001 21:31:00;CIDADAO COMUM;N;;VILA PINHO;BH;602287.09;787641.67;1087
+1089;2001045759;B04001;HOMICIDIO TENTAD;RUA VERA LUCIA;100;71520;24/1/2001 21:29:00;CIDADAO COMUM;N;HOSP. DOM BOSCO;SINIMBU;BH;606759.42;808149.86;1088
+1090;2001045797;B03000;AMEACA;RUA CORREGO DA M;175;18160;24/1/2001 21:53:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613008.28;798049.61;1089
+1091;2001045827;B06000;LESAO CORPORAL;RUA COLUNA PREST;509;16354;24/1/2001 22:16:00;INICIATIVA;N;0;PROVIDENCIA;BH;612375.03;803902.06;1090
+1092;2001045847;B09000;ABANDONO DE INCA;RUA DOS GUARANIS;527;32181;24/1/2001 22:27:00;CIDADAO COMUM;S;PX527;CENTRO (BH);BH;610657.75;797116.77;1091
+1093;2001045864;B04001;HOMICIDIO TENTAD;RUA CINCO;140;78037;24/1/2001 22:35:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;601574.18;786072.51;1092
+1094;2001045905;B03000;AMEACA;RUA MADRE ISABEL;130;120768;24/1/2001 22:56:00;POLICIAL MILITAR;N;0;SAO GERALDO;BH;616215.65;799943.84;1093
+1095;2001045932;B03000;AMEACA;RUA DES BRAULIO;1553;19917;24/1/2001 23:15:00;INICIATIVA;N;0;VERA CRUZ;BH;616310.09;797705.61;1094
+1096;2001045960;B06000;LESAO CORPORAL;RUA ANTONIO FALA;441;82930;24/1/2001 23:33:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603894.24;802156.28;1095
+1097;2001045965;B03000;AMEACA;RUA ONZE DE DEZE;93;112687;24/1/2001 23:39:00;CIDADAO COMUM;S;0;LEONINA;BH;608748.36;793528.53;1096
+1098;2001046114;B03000;AMEACA;AV SERRANA;530;65040;25/1/2001 01:36:00;CIDADAO COMUM;N;;SERRANO;BH;603547.03;801432.44;1097
+1099;2001046127;B03000;AMEACA;RUA JOSE MOREIRA;409;55368;25/1/2001 01:44:00;CIDADAO COMUM;S;FU;SAO MARCOS;BH;614431.87;802397.68;1098
+1100;2001046164;B03000;AMEACA;RUA JORNALISTA O;252;53057;25/1/2001 02:24:00;CIDADAO COMUM;S;;EYMARD;BH;613619.32;803624.62;1099
+1101;2001046236;B06000;LESAO CORPORAL;RUA SETIBA;221;32314;25/1/2001 03:52:00;CIDADAO COMUM;S;0;IPANEMA;BH;604627.33;798423.60;1100
+1102;2001046241;B06000;LESAO CORPORAL;RUA DOS CHILENOS;101;15188;25/1/2001 04:03:00;CIDADAO COMUM;N;;GORDURAS;BH;616531.80;804343.27;1101
+1103;2001046501;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;322;51657;25/1/2001 09:30:00;CIDADAO COMUM;S;0;VILA SANTO ANTON;BH;609650.08;808286.90;1102
+1104;2001046539;B08000;VIOLACAO DE DOMI;RUA POUSO ALEGRE;2486;54932;25/1/2001 09:55:00;CIDADAO COMUM;N;;FLORESTA;BH;613399.86;798014.09;1103
+1105;2001046563;B06000;LESAO CORPORAL;RUA PONTALINA;151;57640;25/1/2001 10:09:00;CIDADAO COMUM;S;;CH CELSO MACHADO;BH;603970.94;801060.78;1104
+1106;2001046593;B06000;LESAO CORPORAL;RUA JUIZ MILTON ;34;78342;25/1/2001 10:32:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614919.77;806285.93;1105
+1107;2001046600;B06000;LESAO CORPORAL;RUA ROMUALDO DIA;291;78705;25/1/2001 10:38:00;CIDADAO COMUM;N;REF:MERCEARIA DO;CH JATOBA IV;BH;600109.79;787826.40;1106
+1108;2001046621;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;1700;57830;25/1/2001 10:54:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;608719.62;793771.09;1107
+1109;2001046625;B03000;AMEACA;RUA AVENTINO;247;7025;25/1/2001 10:57:00;CIDADAO COMUM;N;CAB;GLORIA;BH;604050.11;798085.79;1108
+1110;2001046635;B03000;AMEACA;RUA JOAO PAULO I;175;300458;25/1/2001 11:07:00;CIDADAO COMUM;S;;SAO DOMINGOS;BH;607677.28;793509.05;1109
+1111;2001046745;B06000;LESAO CORPORAL;RUA BELEM DE JUD;287;124797;25/1/2001 12:25:00;CIDADAO COMUM;N;;CRISTO REDENTOR;BH;604914.21;790484.26;1110
+1112;2001046764;B03000;AMEACA;RUA DOZE DE MAIO;89;24072;25/1/2001 12:43:00;CIDADAO COMUM;S;;LEONINA;BH;608268.84;793457.66;1111
+1113;2001046785;B03000;AMEACA;RUA OTAVIANO PEN;270;128454;25/1/2001 12:57:00;CIDADAO COMUM;S;AP204;SERRA VERDE;BH;609633.96;810676.53;1112
+1114;2001046824;B06000;LESAO CORPORAL;RUA JOAQUIM ANAC;23;118932;25/1/2001 13:19:00;INICIATIVA;N;0;TEIXEIRA DIAS;BH;603052.88;789295.61;1113
+1115;2001046834;B03000;AMEACA;RUA DOS CAETES;323;11376;25/1/2001 13:28:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611304.85;797393.25;1114
+1116;2001046851;B03000;AMEACA;RUA GABRO;379;30435;25/1/2001 13:39:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612925.79;797244.47;1115
+1117;2001046948;B04001;HOMICIDIO TENTAD;AV NOSSA SENHORA;1719;47996;25/1/2001 14:44:00;INICIATIVA;S;0;SAO PEDRO;BH;611051.04;793277.57;1116
+1118;2001047162;B04001;HOMICIDIO TENTAD;RUA QUATRO DE JU;40;170910;25/1/2001 16:52:00;CIDADAO COMUM;N;;LEONINA;BH;608611.71;793487.56;1117
+1119;2001047229;B06000;LESAO CORPORAL;RUA SERENATA;237;172351;25/1/2001 17:21:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614290.56;795445.06;1118
+1120;2001047233;B06000;LESAO CORPORAL;RUA JOAQUIM ASSI;140;92679;25/1/2001 17:23:00;CIDADAO COMUM;S;;CALIFORNIA;BH;603481.98;796969.02;1119
+1121;2001047329;B03000;AMEACA;RUA JOAQUIM DE F;1313;38033;25/1/2001 18:20:00;CIDADAO COMUM;S;;SANTA HELENA (BH;BH;603050.87;790075.16;1120
+1122;2001047383;B06000;LESAO CORPORAL;AV BIAS FORTES;161;9553;25/1/2001 18:46:00;CIDADAO COMUM;S;PX400;LOURDES;BH;610994.27;795773.90;1121
+1123;2001047430;B03000;AMEACA;RUA FARMACEUTICO;400;70426;25/1/2001 19:07:00;CIDADAO COMUM;S;0;CANDELARIA;BH;607825.43;809110.55;1122
+1124;2001047502;B04002;HOMICIDIO CONSUM;RUA GRAUNAS;181;31797;25/1/2001 19:49:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;605268.99;788621.91;1123
+1125;2001047511;B03000;AMEACA;RUA POLONIA;51;54541;25/1/2001 19:57:00;CIDADAO COMUM;N;;COPACABANA;BH;605659.23;806545.79;1124
+1126;2001047531;B03000;AMEACA;RUA HELE AMARAL ;45;112747;25/1/2001 20:04:00;CIDADAO COMUM;N;FU;SAO MARCOS;BH;614384.96;802750.10;1125
+1127;2001047634;B04001;HOMICIDIO TENTAD;RUA ALVARO FERRE;75;113591;25/1/2001 21:08:00;CIDADAO COMUM;S;0;JARDIM EUROPA;BH;608159.91;810568.87;1126
+1128;2001047641;B06000;LESAO CORPORAL;RUA ALTEROSA;5;26138;25/1/2001 21:13:00;CIDADAO COMUM;N;0;TAQUARIL;BH;617385.86;797791.56;1127
+1129;2001047653;B04001;HOMICIDIO TENTAD;AV A;270;302850;25/1/2001 21:18:00;INICIATIVA;S;0;GUARANI;BH;613784.86;805457.10;1128
+1130;2001047663;B03000;AMEACA;RUA MALMEQUER;421;42687;25/1/2001 21:23:00;CIDADAO COMUM;N;CA1;LINDEIA;BH;599129.73;791104.90;1129
+1131;2001047717;B03000;AMEACA;RUA MARIA LETICI;205;126780;25/1/2001 21:57:00;CIDADAO COMUM;S;0;DAS INDUSTRIAS;BH;605272.86;790815.43;1130
+1132;2001047724;B04001;HOMICIDIO TENTAD;RUA MANOEL TAVAR;402;1536;25/1/2001 22:05:00;CIDADAO COMUM;S;;GOIANIA;BH;614972.82;802744.77;1131
+1133;2001047745;B06000;LESAO CORPORAL;RUA ROSA CRUZ;255;59283;25/1/2001 22:20:00;CIDADAO COMUM;S;CSB;BOA VISTA;BH;616069.21;799968.25;1132
+1134;2001047758;B06000;LESAO CORPORAL;PRACA ITAPIRA;10;35845;25/1/2001 22:24:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616265.14;798905.89;1133
+1135;2001047775;B06000;LESAO CORPORAL;AV DOUTOR CRISTI;2300;62459;25/1/2001 22:35:00;CIDADAO COMUM;S;0;ITAPOA;BH;609779.66;806002.26;1134
+1136;2001047781;B04001;HOMICIDIO TENTAD;RUA JUATUBA;42;39367;25/1/2001 22:41:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;605262.83;793420.62;1135
+1137;2001047808;B06000;LESAO CORPORAL;RUA MARIA IZABEL;106;107900;25/1/2001 22:57:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606572.69;811478.62;1136
+1138;2001048040;B03000;AMEACA;AV BRASIL;248;10420;26/1/2001 00:54:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;612792.45;796553.47;1137
+1139;2001048067;B06000;LESAO CORPORAL;AV VILARINHOS;1551;109988;26/1/2001 01:13:00;CIDADAO COMUM;S;;VENDA NOVA;BH;608767.45;809004.21;1138
+1140;2001048096;B04002;HOMICIDIO CONSUM;AV A;213;302850;26/1/2001 01:43:00;CIDADAO COMUM;S;;GUARANI;BH;613831.79;805433.00;1139
+1141;2001048120;B06000;LESAO CORPORAL;AV OLEGARIO MACI;228;49699;26/1/2001 02:09:00;INICIATIVA;S;0;CENTRO (BH);BH;610607.36;797465.13;1140
+1142;2001048142;B06000;LESAO CORPORAL;RUA SAO FELIPE;282;62386;26/1/2001 02:23:00;CIDADAO COMUM;N;0;SAGRADA FAMILIA;BH;613372.54;798722.04;1141
+1143;2001048268;B05000;SEQUESTRO E CARC;RUA PLATINA;1328;54453;26/1/2001 04:47:00;CIDADAO COMUM;S;FR1328;CALAFATE;BH;607876.92;796707.40;1142
+1144;2001048271;B03000;AMEACA;AV BRASIL;248;10420;26/1/2001 04:55:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;612792.45;796553.47;1143
+1145;2001048331;B06000;LESAO CORPORAL;RUA JOAQUIM DE P;1000;38147;26/1/2001 06:39:00;CIDADAO COMUM;N;;ALIPIO DE MELO;BH;604681.70;799201.87;1144
+1146;2001048348;B03000;AMEACA;RUA PROFESSOR AI;700;72608;26/1/2001 06:59:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608615.33;807850.01;1145
+1147;2001048563;B06000;LESAO CORPORAL;AV CRISTIANO MAC;2062;18652;26/1/2001 09:33:00;CIDADAO COMUM;N;0;CIDADE NOVA;BH;612189.85;800428.05;1146
+1148;2001048708;B03000;AMEACA;RUA ITARARE;217;35959;26/1/2001 11:06:00;CIDADAO COMUM;S;;CONCORDIA;BH;610928.47;799185.62;1147
+1149;2001048858;B04001;HOMICIDIO TENTAD;RUA JOSE LAVARIN;245;40537;26/1/2001 13:06:00;CIDADAO COMUM;S;;PARAISO;BH;614324.25;796702.92;1148
+1150;2001048874;B04002;HOMICIDIO CONSUM;RUA MONTEIRO LOB;241;46590;26/1/2001 13:13:00;CIDADAO COMUM;N;0;JATOBA;IB;598882.79;789573.14;1149
+1151;2001048894;B06000;LESAO CORPORAL;AV AFONSO PENA;464;1259;26/1/2001 13:22:00;INICIATIVA;S;0;CENTRO (BH);BH;611005.20;797320.30;1150
+1152;2001048910;B03000;AMEACA;RUA MANOEL DINIZ;17;43069;26/1/2001 13:34:00;CIDADAO COMUM;N;0;DOS PALMARES;BH;612125.79;802687.18;1151
+1153;2001048931;B03000;AMEACA;RUA MADRID;201;42403;26/1/2001 13:44:00;INICIATIVA;S;0;COPACABANA;BH;606232.37;806154.01;1152
+1154;2001048993;B03000;AMEACA;RUA AROEIRA NEVE;247;92423;26/1/2001 14:30:00;CIDADAO COMUM;S;CAFU;ALVARO CAMARGOS;BH;604010.44;797371.18;1153
+1155;2001049041;B03000;AMEACA;RUA DOUTOR ALIPI;502;2365;26/1/2001 15:03:00;CIDADAO COMUM;S;;CAFEZAL;BH;613838.04;794600.97;1154
+1156;2001049051;B06000;LESAO CORPORAL;AV DOM PEDRO II;4414;53145;26/1/2001 15:09:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606624.52;798141.20;1155
+1157;2001049190;B06000;LESAO CORPORAL;AV JOSE BONIFACI;90;38579;26/1/2001 16:26:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610155.34;799025.63;1156
+1158;2001049194;B03000;AMEACA;AV HENFIL;590;103550;26/1/2001 16:29:00;INICIATIVA;S;0;SARANDI (URCA/BH;BH;603609.38;801869.84;1157
+1159;2001049372;B06000;LESAO CORPORAL;AV AFONSO VAZ DE;1025;1306;26/1/2001 18:09:00;CIDADAO COMUM;S;0;BARREIRO;BH;602121.95;790867.83;1158
+1160;2001049375;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;23;6353;26/1/2001 18:11:00;CIDADAO COMUM;N;LJZZ;FLORESTA;BH;612282.71;797462.19;1159
+1161;2001049385;B06000;LESAO CORPORAL;RUA CAICARA;1387;11451;26/1/2001 18:15:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616156.88;799378.61;1160
+1162;2001049419;B04002;HOMICIDIO CONSUM;RUA FLOR DO BESO;240;28492;26/1/2001 18:35:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;605973.04;799060.82;1161
+1163;2001049457;B04002;HOMICIDIO CONSUM;RUA ARISTOLINO B;10;41089;26/1/2001 19:00:00;CIDADAO COMUM;N;REF:CASA NOVA;REGINA;BH;598834.62;789796.85;1162
+1164;2001049491;B06000;LESAO CORPORAL;RUA BEIRA ALTA;1036;62777;26/1/2001 19:18:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609649.09;802529.74;1163
+1165;2001049537;B03000;AMEACA;RUA CELIO CAUTIE;36;92612;26/1/2001 19:44:00;CIDADAO COMUM;S;;CALIFORNIA;BH;603380.35;796952.78;1164
+1166;2001049634;B03000;AMEACA;RUA RAMOS;79;57870;26/1/2001 20:46:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614428.82;802482.52;1165
+1167;2001049651;B04001;HOMICIDIO TENTAD;RUA SAO PAULO;365;90213;26/1/2001 20:54:00;CIDADAO COMUM;S;LJA;SARANDI (URCA/BH;BH;602814.92;802490.07;1166
+1168;2001049735;B03000;AMEACA;RUA JOAO PINTO;35;105542;26/1/2001 21:29:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;605029.47;794803.37;1167
+1169;2001049801;B06000;LESAO CORPORAL;RUA SERVIDAO;93;170201;26/1/2001 22:11:00;CIDADAO COMUM;N;0;CABANA;BH;604396.96;794232.57;1168
+1170;2001049808;B04001;HOMICIDIO TENTAD;RUA AMPERE;1;3484;26/1/2001 22:14:00;CIDADAO COMUM;N;CAB;PRIMEIRO DE MAIO;BH;612112.26;803408.93;1169
+1171;2001049828;B03000;AMEACA;RUA ANTONIO JUST;420;4648;26/1/2001 22:32:00;CIDADAO COMUM;S;;POMPEIA;BH;614843.56;798116.13;1170
+1172;2001049867;B03000;AMEACA;RUA RADIALISTA A;200;122398;26/1/2001 22:54:00;CIDADAO COMUM;N;CS03;CEU AZUL;BH;604585.98;808469.73;1171
+1173;2001049875;B03000;AMEACA;RUA MAYRINK;604;42573;26/1/2001 22:55:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;616305.86;799381.93;1172
+1174;2001049979;B08000;VIOLACAO DE DOMI;RUA FREI LUIZ DE;60;96540;26/1/2001 23:52:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614919.28;806533.15;1173
+1175;2001049987;B04001;HOMICIDIO TENTAD;RUA VINTE E UM D;7;72286;26/1/2001 23:55:00;INICIATIVA;N;0;CENTRO (BH);BH;610893.23;797841.46;1174
+1176;2001050074;B04001;HOMICIDIO TENTAD;RUA DOS COMANCHE;495;16367;27/1/2001 00:36:00;CIDADAO COMUM;S;0;ITAMARATI;BH;606692.45;806999.22;1175
+1177;2001050089;B06000;LESAO CORPORAL;RUA GABRO;310;30435;27/1/2001 00:49:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612866.12;797324.00;1176
+1178;2001050128;B03000;AMEACA;AV DO CONTORNO;10185;17228;27/1/2001 01:06:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;609218.63;797141.66;1177
+1179;2001050191;B04001;HOMICIDIO TENTAD;RUA DOS URUGUAIO;151;46710;27/1/2001 01:50:00;INICIATIVA;S;0;GORDURAS;BH;616632.70;804348.93;1178
+1180;2001050256;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;35;26052;27/1/2001 02:32:00;INICIATIVA;S;0;CENTRO (BH);BH;611414.93;797615.20;1179
+1181;2001050261;B04001;HOMICIDIO TENTAD;RUA ANTONIO TEIX;1223;119037;27/1/2001 02:33:00;CIDADAO COMUM;S;;TEIXEIRA DIAS;BH;602609.16;790019.78;1180
+1182;2001050273;B03000;AMEACA;RUA MIGUEL ABRAS;105;45698;27/1/2001 02:35:00;CIDADAO COMUM;S;AP301;SERRA;BH;612787.45;794670.58;1181
+1183;2001050281;B04001;HOMICIDIO TENTAD;RUA CARLOS SCHET;523;118771;27/1/2001 02:44:00;CIDADAO COMUM;N;;JARDINOPOLIS;BH;605039.83;794569.69;1182
+1184;2001050339;B03000;AMEACA;RUA CORONEL NEWT;520;124872;27/1/2001 03:22:00;CIDADAO COMUM;N;0;MANGUEIRAS;BH;600751.18;786764.27;1183
+1185;2001050341;B06000;LESAO CORPORAL;RUA DOS CAETES;920;11376;27/1/2001 03:23:00;INICIATIVA;S;0;CENTRO (BH);BH;610732.50;797574.81;1184
+1186;2001050377;B03000;AMEACA;RUA JOSE LEAL DO;71;110593;27/1/2001 03:50:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611585.51;807912.79;1185
+1187;2001050413;B06000;LESAO CORPORAL;RUA LAGOA DOS PA;145;40190;27/1/2001 04:18:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605885.22;807433.39;1186
+1188;2001050423;B06000;LESAO CORPORAL;RUA OURO PRETO;293;50730;27/1/2001 04:28:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;609961.08;797017.98;1187
+1189;2001050440;B02000;RIXA;RUA ANGATUBA;144;84368;27/1/2001 04:40:00;CIDADAO COMUM;S;;PIRATININGA;BH;605572.65;809065.32;1188
+1190;2001050455;B03000;AMEACA;RUA SAO TEOFILO;289;105441;27/1/2001 04:55:00;CIDADAO COMUM;N;;PAULO SEXTO;BH;616316.21;806468.17;1189
+1191;2001050466;B03000;AMEACA;RUA JOAO SAMAHA;261;7397;27/1/2001 05:06:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608633.12;807211.33;1190
+1192;2001050532;B03000;AMEACA;RUA WANDERSON BI;119;102080;27/1/2001 06:35:00;CIDADAO COMUM;N;FR;MINEIRAO;BH;601946.30;785457.99;1191
+1193;2001050545;B06000;LESAO CORPORAL;RUA SAO JOAQUIM;460;62940;27/1/2001 07:00:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612928.27;799516.16;1192
+1194;2001050551;B04002;HOMICIDIO CONSUM;RUA PLINIO TEIXE;61;98155;27/1/2001 07:07:00;CIDADAO COMUM;S;;DOM SILVERIO;BH;615265.19;804798.58;1193
+1195;2001050560;B04002;HOMICIDIO CONSUM;RUA ANDREQUICE;50;3888;27/1/2001 07:16:00;CIDADAO COMUM;N;;DOM CABRAL;BH;604920.41;797169.31;1194
+1196;2001050572;B06000;LESAO CORPORAL;RUA DOS TUPIS;212;69965;27/1/2001 07:33:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611089.79;796902.82;1195
+1197;2001050596;B03000;AMEACA;RUA REIS DE ABRE;340;63363;27/1/2001 07:48:00;CIDADAO COMUM;S;CAFU;APARECIDA SETIMA;BH;608643.80;800686.52;1196
+1198;2001050642;B08000;VIOLACAO DE DOMI;RUA LINCOLN;477;41136;27/1/2001 08:17:00;CIDADAO COMUM;N;;UNIAO;BH;612774.54;801729.46;1197
+1199;2001050646;B06000;LESAO CORPORAL;PRACA AFONSO ARI;176;1205;27/1/2001 08:19:00;INICIATIVA;N;0;CENTRO (BH);BH;611333.30;796434.60;1198
+1200;2001050686;B03000;AMEACA;RUA MADRID;230;42403;27/1/2001 09:00:00;INICIATIVA;S;;COPACABANA;BH;606215.50;806159.29;1199
+1201;2001050713;B03000;AMEACA;RUA ANITA GARIBA;210;4184;27/1/2001 09:34:00;CIDADAO COMUM;S;CAB;MORRO DAS PEDRAS;BH;608935.51;794538.06;1200
+1202;2001050725;B06000;LESAO CORPORAL;RUA ESTRELA DE P;23;90024;27/1/2001 09:45:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605955.92;791890.07;1201
+1203;2001050746;B03000;AMEACA;PRACA ITAPIRA;10;35845;27/1/2001 10:01:00;CIDADAO COMUM;S;;SAO GERALDO;BH;616265.14;798905.89;1202
+1204;2001050770;B03000;AMEACA;RUA JOSE MOREIRA;481;95232;27/1/2001 10:20:00;CIDADAO COMUM;N;0;TIROL;BH;600268.32;789248.46;1203
+1205;2001050788;B06000;LESAO CORPORAL;AV AMAZONAS;2267;3140;27/1/2001 10:34:00;CIDADAO COMUM;S;;SANTO AGOSTINHO;BH;609538.15;796202.90;1204
+1206;2001050937;B03000;AMEACA;RUA IPANEMA;1135;34726;27/1/2001 12:49:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602814.25;802311.29;1205
+1207;2001050941;B03000;AMEACA;RUA HAVANA;220;115036;27/1/2001 12:49:00;CIDADAO COMUM;N;AP101;ESTRELA DALVA;BH;607670.74;792047.48;1206
+1208;2001050948;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;322;51657;27/1/2001 13:00:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;609650.08;808286.90;1207
+1209;2001050949;B03000;AMEACA;RUA OLAVO BILAC;700;49660;27/1/2001 13:00:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607643.18;808117.12;1208
+1210;2001051049;B03000;AMEACA;RUA DECIO SALEMA;67;88750;27/1/2001 14:07:00;CIDADAO COMUM;S;;DOS PALMARES;BH;611952.79;802027.46;1209
+1211;2001051052;B04002;HOMICIDIO CONSUM;RUA PITANGUI;34;54365;27/1/2001 14:09:00;CIDADAO COMUM;N;AP204;SAO CRISTOVAO;BH;610522.93;799402.64;1210
+1212;2001051157;B06000;LESAO CORPORAL;RUA JULITA NOGUE;376;39597;27/1/2001 15:06:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603732.82;802432.71;1211
+1213;2001051175;B03000;AMEACA;RUA ILHA DE MALT;383;20926;27/1/2001 15:13:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;613705.47;804079.08;1212
+1214;2001051187;B03000;AMEACA;RUA STO IDELFONS;75;61850;27/1/2001 15:22:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608474.99;800221.72;1213
+1215;2001051261;B03000;AMEACA;RUA SAO PAULO;848;63464;27/1/2001 16:02:00;INICIATIVA;S;1302;CENTRO BH;BH;610915.13;796961.87;1214
+1216;2001051290;B02000;RIXA;AV AFONSO PENA;464;1259;27/1/2001 16:12:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611005.20;797320.30;1215
+1217;2001051296;B04001;HOMICIDIO TENTAD;RUA SEBASTIAO SA;168;90078;27/1/2001 16:16:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614744.66;802402.66;1216
+1218;2001051342;B03000;AMEACA;RUA IPANEMA;1135;34726;27/1/2001 16:46:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602814.25;802311.29;1217
+1219;2001051358;B08000;VIOLACAO DE DOMI;RUA SAO PEDRO DO;33;63842;27/1/2001 16:53:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612040.86;803799.62;1218
+1220;2001051423;B03000;AMEACA;RUA ESPIRITO SAN;421;26052;27/1/2001 17:29:00;INICIATIVA;N;0;CENTRO BH;BH;611314.96;797240.91;1219
+1221;2001051430;B06000;LESAO CORPORAL;RUA WALTER IANNI;250;82186;27/1/2001 17:37:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613230.08;803699.54;1220
+1222;2001051432;B03000;AMEACA;RUA JOAO PINTO;35;105542;27/1/2001 17:37:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;605029.47;794803.37;1221
+1223;2001051466;B06000;LESAO CORPORAL;RUA PORTO SEGURO;505;60595;27/1/2001 18:01:00;CIDADAO COMUM;N;;NOVA VISTA;BH;614940.97;800734.58;1222
+1224;2001051470;B06000;LESAO CORPORAL;RUA CLEANTO;42;46499;27/1/2001 18:00:00;CIDADAO COMUM;S;FR30;BELMONT;BH;615394.32;805069.93;1223
+1225;2001051500;B03000;AMEACA;RUA CESAR SALLES;85;113490;27/1/2001 18:15:00;CIDADAO COMUM;S;;JARDIM ESTRELA;BH;607230.33;810530.99;1224
+1226;2001051519;B06000;LESAO CORPORAL;AV LEONIL PRATA;221;101223;27/1/2001 18:27:00;INICIATIVA;N;0;CONJUNTO ALIPIO ;BH;604161.15;799915.91;1225
+1227;2001051531;B06000;LESAO CORPORAL;RUA PADRE PETROL;141;53577;27/1/2001 18:32:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612868.29;799155.55;1226
+1228;2001051552;B06000;LESAO CORPORAL;BECO LUIZ ALBERT;36;300741;27/1/2001 18:44:00;INICIATIVA;S;0;HORTO;BH;613875.22;798204.15;1227
+1229;2001051562;B03000;AMEACA;RUA SABRINA FERR;34;1132;27/1/2001 18:51:00;CIDADAO COMUM;S;;CARDOSO;BH;603666.33;788546.78;1228
+1230;2001051565;B03000;AMEACA;RUA NELSON DE SE;235;47448;27/1/2001 18:52:00;CIDADAO COMUM;N;0;CINQUENTENARIO;BH;606251.88;792825.67;1229
+1231;2001051584;B03000;AMEACA;RUA IRAPIRUARA;102;101872;27/1/2001 19:04:00;CIDADAO COMUM;N;0;SAO COSME (SL);SL;610221.72;812531.14;1230
+1232;2001051594;B04001;HOMICIDIO TENTAD;RUA CONSUELO;146;106296;27/1/2001 19:04:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607848.43;811390.89;1231
+1233;2001051600;B03000;AMEACA;RUA RENATO GONCA;122;14475;27/1/2001 19:12:00;CIDADAO COMUM;N;0;DOM JOAQUIM;BH;613762.36;801977.09;1232
+1234;2001051646;B06000;LESAO CORPORAL;RUA MORUMBI;96;46849;27/1/2001 19:39:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599330.25;788838.38;1233
+1235;2001051818;B02000;RIXA;RUA OCARA;333;49065;27/1/2001 21:06:00;CIDADAO COMUM;N;;VILA MARAVILHAS;BH;603016.39;795307.65;1234
+1236;2001051850;B06000;LESAO CORPORAL;RUA CAMAPUAN;250;11726;27/1/2001 21:31:00;CIDADAO COMUM;S;A;ALTO BARROCA;BH;607995.04;795600.51;1235
+1237;2001051902;B06000;LESAO CORPORAL;AV SILVA GUIMARA;60;65863;27/1/2001 21:52:00;CIDADAO COMUM;S;;ITAIPU BH;BH;598869.30;789086.11;1236
+1238;2001051904;B06000;LESAO CORPORAL;AV FREI HENRIQUE;410;81360;27/1/2001 21:52:00;CIDADAO COMUM;S;303,BLOCO C.;NOVA CACHOEIRINH;BH;609359.89;801137.27;1237
+1239;2001051948;B04001;HOMICIDIO TENTAD;RUA PROFESSORA G;660;86335;27/1/2001 22:15:00;CIDADAO COMUM;N;;FLORAMAR;BH;611900.95;807062.44;1238
+1240;2001051965;B06000;LESAO CORPORAL;AV BIAS FORTES;1770;9553;27/1/2001 22:29:00;INICIATIVA;N;0;BARRO PRETO;BH;610196.72;797244.85;1239
+1241;2001051992;B06000;LESAO CORPORAL;RUA MEYER;311;45326;27/1/2001 22:45:00;CIDADAO COMUM;N;;CAICARA;BH;607697.54;799497.02;1240
+1242;2001052009;B04001;HOMICIDIO TENTAD;RUA NOVE DE DEZE;211;48872;27/1/2001 22:51:00;INICIATIVA;S;0;LEONINA;BH;608390.33;793413.61;1241
+1243;2001052169;B03000;AMEACA;RUA CARLOS SHIRN;7;7182;28/1/2001 00:21:00;CIDADAO COMUM;S;CAB;TIROL;BH;601034.52;789803.43;1242
+1244;2001052170;B06000;LESAO CORPORAL;RUA ZURICK;11;74092;28/1/2001 00:23:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606533.22;796470.48;1243
+1245;2001052190;B03000;AMEACA;RUA VARNA;275;85231;28/1/2001 00:35:00;CIDADAO COMUM;S;CAA;JARDIM EUROPA;BH;608204.41;810553.78;1244
+1246;2001052192;B06000;LESAO CORPORAL;RUA NELSON HUNGR;449;46634;28/1/2001 00:37:00;CIDADAO COMUM;S;REF:CAMPO DO TUP;TUPI;BH;612722.64;806192.86;1245
+1247;2001052311;B06000;LESAO CORPORAL;RUA BARDANA;20;96600;28/1/2001 01:42:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614835.21;806457.22;1246
+1248;2001052312;B03000;AMEACA;RUA CINQUENTA E ;317;74137;28/1/2001 01:43:00;CIDADAO COMUM;N;;NOVA YORK;BH;608575.18;810924.30;1247
+1249;2001052330;B06000;LESAO CORPORAL;RUA GESTAL MOREI;59;47779;28/1/2001 01:52:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601255.90;788791.33;1248
+1250;2001052372;B06000;LESAO CORPORAL;RUA DA HARMONIA;17;32847;28/1/2001 02:16:00;CIDADAO COMUM;S;;FERNAO DIAS;BH;612751.05;802595.90;1249
+1251;2001052383;B03000;AMEACA;RUA DOUTOR ALIPI;243;2365;28/1/2001 02:21:00;CIDADAO COMUM;N;;SERRA;BH;613840.35;794757.13;1250
+1252;2001052422;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;28/1/2001 02:42:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;605855.99;798012.24;1251
+1253;2001052443;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;960;51657;28/1/2001 02:55:00;INICIATIVA;S;0;VENDA NOVA;BH;609089.09;808708.75;1252
+1254;2001052456;B06000;LESAO CORPORAL;RUA CINCO DE JUL;10;15670;28/1/2001 03:00:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612568.07;803874.18;1253
+1255;2001052490;B06000;LESAO CORPORAL;AV BIAS FORTES;1166;9553;28/1/2001 03:25:00;INICIATIVA;N;0;LOURDES;BH;610518.39;796681.64;1254
+1256;2001052493;B06000;LESAO CORPORAL;RUA DOIS;45;302810;28/1/2001 03:26:00;INICIATIVA;S;0;NOVO AARAO REIS;BH;614384.20;805861.01;1255
+1257;2001052574;B04001;HOMICIDIO TENTAD;RUA LADAINHA;45;40118;28/1/2001 04:33:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612013.16;803584.39;1256
+1258;2001052588;B06000;LESAO CORPORAL;AV ABILIO MACHAD;3123;634;28/1/2001 04:47:00;CIDADAO COMUM;N;0;CONJUNTO ALIPIO ;BH;603784.55;799976.88;1257
+1259;2001052625;B03000;AMEACA;RUA TAMBORIL;810;66793;28/1/2001 05:21:00;INICIATIVA;S;0;CONCORDIA;BH;611055.36;799478.21;1258
+1260;2001052673;B03000;AMEACA;RUA CAIANA;78;11350;28/1/2001 06:35:00;CIDADAO COMUM;S;0;SANTA INES;BH;614529.10;800410.29;1259
+1261;2001052738;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;1002;57830;28/1/2001 08:03:00;CIDADAO COMUM;N;;GUTIERREZ;BH;609199.03;794395.98;1260
+1262;2001052829;B06000;LESAO CORPORAL;RUA CARAVELAS;314;13141;28/1/2001 10:03:00;CIDADAO COMUM;N;CAC;VERA CRUZ;BH;615535.24;798308.71;1261
+1263;2001052895;B03000;AMEACA;RUA JOSE LAVARIN;245;40537;28/1/2001 11:04:00;CIDADAO COMUM;S;0;PARAISO;BH;614324.25;796702.92;1262
+1264;2001052971;B06000;LESAO CORPORAL;RUA DOS CURIANGO;30;19050;28/1/2001 12:14:00;CIDADAO COMUM;N;;VILA CLORIS;BH;610539.11;807498.57;1263
+1265;2001052986;B03000;AMEACA;RUA MARIA ROSA D;803;107800;28/1/2001 12:27:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606508.78;811712.71;1264
+1266;2001052989;B03000;AMEACA;RUA IVAPE;150;124601;28/1/2001 12:28:00;CIDADAO COMUM;S;0;JAQUELINE;BH;611546.33;810757.01;1265
+1267;2001053049;B03000;AMEACA;AV ESPLANADA;213;126244;28/1/2001 13:29:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;613217.11;804464.30;1266
+1268;2001053052;B03000;AMEACA;RUA DOS NAMBIQUA;75;110477;28/1/2001 13:30:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;606757.55;806811.23;1267
+1269;2001053091;B06000;LESAO CORPORAL;AV AMAZONAS;2267;3140;28/1/2001 13:58:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609538.15;796202.90;1268
+1270;2001053275;B03000;AMEACA;RUA LAPINHA;786;40376;28/1/2001 16:06:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606744.32;794824.20;1269
+1271;2001053282;B06000;LESAO CORPORAL;RUA CAVAQUINHO;21;301465;28/1/2001 16:10:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614169.38;795393.99;1270
+1272;2001053356;B06000;LESAO CORPORAL;RUA N;6;27197;28/1/2001 16:53:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616415.06;806950.10;1271
+1273;2001053363;B06000;LESAO CORPORAL;RUA JANETE CLAIR;168;50046;28/1/2001 16:58:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607149.50;807738.88;1272
+1274;2001053403;B03000;AMEACA;RUA DAVID CAMPIS;218;19683;28/1/2001 17:24:00;CIDADAO COMUM;S;AP401;FLORESTA;BH;611994.62;797423.35;1273
+1275;2001053425;B03000;AMEACA;RUA JOSE FRANCIS;87;78469;28/1/2001 17:35:00;CIDADAO COMUM;S;;VILA PINHO;BH;602321.14;787694.01;1274
+1276;2001053426;B06000;LESAO CORPORAL;RUA NELITA SALER;151;15770;28/1/2001 17:35:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608440.05;808269.08;1275
+1277;2001053432;B03000;AMEACA;RUA DOS XERENTES;24;84166;28/1/2001 17:39:00;CIDADAO COMUM;S;;SANTA MONICA;BH;606998.62;807231.05;1276
+1278;2001053449;B06000;LESAO CORPORAL;RUA IZABEL DIAS ;30;101920;28/1/2001 17:45:00;CIDADAO COMUM;S;;TEIXEIRA DIAS;BH;602673.89;789210.29;1277
+1279;2001053454;B03000;AMEACA;RUA JOAQUIM HENR;86;106605;28/1/2001 17:49:00;CIDADAO COMUM;S;A;MARIA HELENA;BH;605823.93;810911.64;1278
+1280;2001053485;B03000;AMEACA;RUA MARIA DE OLI;120;44276;28/1/2001 18:06:00;CIDADAO COMUM;S;;INDUSTRIAL RODRI;BH;615725.91;808833.53;1279
+1281;2001053501;B03000;AMEACA;RUA BEIRA LINHA;48;121732;28/1/2001 18:15:00;CIDADAO COMUM;S;CAA;SAO GABRIEL;BH;615355.82;805237.80;1280
+1282;2001053506;B06000;LESAO CORPORAL;RUA SAO GERALDO;301;170283;28/1/2001 18:18:00;CIDADAO COMUM;S;0;CABANA;BH;604776.91;793944.01;1281
+1283;2001053510;B03000;AMEACA;RUA FLOR DE ALEC;389;92451;28/1/2001 18:23:00;CIDADAO COMUM;S;NR EXATO - 490;FILADELFIA;BH;602449.93;797457.13;1282
+1284;2001053517;B03000;AMEACA;AV SEN LEVINDO C;3997;14866;28/1/2001 18:29:00;POLICIAL MILITAR;S;0;CH VALE DO JATOB;BH;601259.67;786764.12;1283
+1285;2001053523;B03000;AMEACA;RUA CAXANGA;267;14390;28/1/2001 18:32:00;POLICIAL MILITAR;S;;GUARANI;BH;612391.07;805707.53;1284
+1286;2001053525;B06000;LESAO CORPORAL;RUA VINTE E NOVE;206;73061;28/1/2001 18:35:00;CIDADAO COMUM;S;CSA;JOAO PINHEIRO;BH;604400.97;796725.97;1285
+1287;2001053542;B04001;HOMICIDIO TENTAD;AV TERESA CRISTI;718;67512;28/1/2001 18:47:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608524.82;797475.69;1286
+1288;2001053549;B03000;AMEACA;RUA DIVINO;172;21409;28/1/2001 18:51:00;CIDADAO COMUM;N;0;ERMELINDA;BH;609039.36;800563.79;1287
+1289;2001053567;B03000;AMEACA;RUA ITABORAI;73;92870;28/1/2001 19:02:00;CIDADAO COMUM;S;PX6;PILAR;BH;607759.30;788416.73;1288
+1290;2001053588;B03000;AMEACA;RUA BARAO DO MON;645;63653;28/1/2001 19:10:00;CIDADAO COMUM;N;;CARDOSO;BH;604055.56;787957.50;1289
+1291;2001053638;B03000;AMEACA;RUA AGUAS VERMEL;60;82098;28/1/2001 19:39:00;CIDADAO COMUM;S;;MINASLANDIA;BH;612295.05;804465.10;1290
+1292;2001053658;B06000;LESAO CORPORAL;RUA CONCEICAO DO;167;68253;28/1/2001 19:51:00;CIDADAO COMUM;S;CA2;SANTA INES;BH;614119.12;799674.66;1291
+1293;2001053669;B03000;AMEACA;RUA CANDELARIA;102;12514;28/1/2001 20:00:00;CIDADAO COMUM;S;CSA;NAZARE;BH;615755.10;804693.59;1292
+1294;2001053674;B03000;AMEACA;RUA ALABASTRO;400;1665;28/1/2001 20:03:00;CIDADAO COMUM;N;AP203;SAGRADA FAMILIA;BH;613052.21;798230.19;1293
+1295;2001053681;B03000;AMEACA;RUA ALGARVE;735;61396;28/1/2001 20:08:00;CIDADAO COMUM;N;CAA;SAO FRANCISCO;BH;609186.09;801896.95;1294
+1296;2001053683;B06000;LESAO CORPORAL;RUA LASSANCE;548;84415;28/1/2001 20:09:00;CIDADAO COMUM;S;0;BOA VISTA;BH;615768.49;799690.36;1295
+1297;2001053714;B06000;LESAO CORPORAL;RUA FERNAO DIAS;1694;28133;28/1/2001 20:29:00;CIDADAO COMUM;S;FU;VERA CRUZ;BH;616219.71;797519.14;1296
+1298;2001053718;B06000;LESAO CORPORAL;RUA PROFESSOR ME;275;77920;28/1/2001 20:32:00;CIDADAO COMUM;S;;MANGABEIRAS;BH;612090.78;792751.46;1297
+1299;2001053738;B04002;HOMICIDIO CONSUM;RUA DOUTOR CRIST;312;55598;28/1/2001 20:44:00;OUTROS;N;0;ARAGUAIA;BH;604751.25;789297.85;1298
+1300;2001053745;B04001;HOMICIDIO TENTAD;RUA DOUTOR BENED;445;12252;28/1/2001 20:48:00;CIDADAO COMUM;N;CAFR;ANTONIO RIBEIRO ;BH;612559.52;803764.92;1299
+1301;2001053752;B04002;HOMICIDIO CONSUM;RUA FLOR DE ACAC;220;102226;28/1/2001 20:46:00;CIDADAO COMUM;N;0;MINEIRAO;BH;601652.97;785722.31;1300
+1302;2001053763;B03000;AMEACA;RUA CACIMBA DE A;128;82029;28/1/2001 20:55:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614244.12;804717.14;1301
+1303;2001053769;B06000;LESAO CORPORAL;RUA MARROCOS;862;44869;28/1/2001 20:56:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605521.60;807505.20;1302
+1304;2001053786;B03000;AMEACA;RUA DONA FRANCEL;178;22861;28/1/2001 21:04:00;CIDADAO COMUM;S;0;MARIA VIRGINIA;BH;611567.91;802625.14;1303
+1305;2001053825;B04002;HOMICIDIO CONSUM;RUA DONA LALA FE;854;18712;28/1/2001 21:21:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604700.79;790766.05;1304
+1306;2001053833;B03000;AMEACA;RUA MONTE SIMPLO;1552;46574;28/1/2001 21:24:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;606848.39;794673.93;1305
+1307;2001053868;B03000;AMEACA;RUA MENDES DE OL;213;45430;28/1/2001 21:47:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609706.47;798762.86;1306
+1308;2001053912;B03000;AMEACA;RUA MARIA AMELIA;490;43812;28/1/2001 22:06:00;CIDADAO COMUM;S;LJZ;SAO BERNARDO;BH;610757.05;805313.24;1307
+1309;2001054009;B06000;LESAO CORPORAL;RUA CLORITA;64;16051;28/1/2001 23:01:00;CIDADAO COMUM;S;AT1701;SANTA TEREZA;BH;612843.67;797209.41;1308
+1310;2001054032;B04002;HOMICIDIO CONSUM;BECO MARCO ANTON;15;170750;28/1/2001 23:12:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608920.38;794610.08;1309
+1311;2001054111;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;29/1/2001 00:01:00;CIDADAO COMUM;S;;TIROL;BH;600947.66;789885.51;1310
+1312;2001054156;B03000;AMEACA;RUA LEONCIO JOSE;82;86350;29/1/2001 00:24:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611968.50;807233.49;1311
+1313;2001054157;B06000;LESAO CORPORAL;RUA VICTOR SANCH;284;87089;29/1/2001 00:26:00;CIDADAO COMUM;N;0;CEU AZUL;BH;605262.37;808625.54;1312
+1314;2001054158;B06000;LESAO CORPORAL;RUA W TRES;446;122621;29/1/2001 00:27:00;CIDADAO COMUM;S;0;PONGELUPE;BH;603956.29;787319.05;1313
+1315;2001054160;B02000;RIXA;AV SANTA TEREZIN;165;61415;29/1/2001 00:28:00;CIDADAO COMUM;S;0;CH DA LAGOA;BH;605063.85;802804.94;1314
+1316;2001054180;B03000;AMEACA;AV DO CONTORNO;6200;17228;29/1/2001 00:39:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611304.57;794846.88;1315
+1317;2001054243;B03000;AMEACA;RUA ABILIO FERNA;71;95421;29/1/2001 01:23:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616742.67;804336.01;1316
+1318;2001054246;B06000;LESAO CORPORAL;RUA EUDES GARCIA;315;113419;29/1/2001 01:25:00;INICIATIVA;N;0;FLORAMAR;BH;611582.85;806831.85;1317
+1319;2001054255;B04001;HOMICIDIO TENTAD;AV LEONIL PRATA;221;101223;29/1/2001 01:35:00;CIDADAO COMUM;S;;CONJUNTO ALIPIO ;BH;604161.15;799915.91;1318
+1320;2001054429;B03000;AMEACA;AV PARANA;122;52230;29/1/2001 05:30:00;INICIATIVA;S;;CENTRO (BH);BH;610785.23;797422.18;1319
+1321;2001054657;B08000;VIOLACAO DE DOMI;RUA CONTAGEM;1225;70293;29/1/2001 09:19:00;CIDADAO COMUM;N;0;BOA VISTA;BH;614534.83;800862.24;1320
+1322;2001054660;B03000;AMEACA;RUA PENIDO;64;53306;29/1/2001 09:21:00;CIDADAO COMUM;S;;PIRAJA;BH;613178.39;802974.59;1321
+1323;2001054799;B06000;LESAO CORPORAL;RUA EUCLIDES DA ;60;26806;29/1/2001 11:17:00;CIDADAO COMUM;N;0;PRADO;BH;608952.90;796051.89;1322
+1324;2001054815;B03000;AMEACA;RUA W TRES;464;122621;29/1/2001 11:24:00;CIDADAO COMUM;S;0;PONGELUPE;BH;603956.29;787319.05;1323
+1325;2001054838;B03000;AMEACA;RUA DOUTOR CRIST;277;55598;29/1/2001 11:44:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604648.63;789196.82;1324
+1326;2001054868;B06000;LESAO CORPORAL;AV COLETORA;956;78241;29/1/2001 12:09:00;CIDADAO COMUM;S;;VILA PINHO;BH;602212.14;787909.78;1325
+1327;2001054918;B06000;LESAO CORPORAL;RUA LUIZA GOMES ;99;86681;29/1/2001 12:45:00;CIDADAO COMUM;N;CS01;JAQUELINE;BH;611466.53;809848.13;1326
+1328;2001054962;B03000;AMEACA;RUA A;673;41110;29/1/2001 13:20:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602680.51;802847.95;1327
+1329;2001055030;B06000;LESAO CORPORAL;RUA ANIBAL VAZ D;35;4128;29/1/2001 14:18:00;CIDADAO COMUM;S;0;TUPI;BH;612241.94;806597.44;1328
+1330;2001055079;B03000;AMEACA;RUA DES BRAULIO;1147;19917;29/1/2001 15:02:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616247.76;797972.01;1329
+1331;2001055128;B04001;HOMICIDIO TENTAD;RUA TIBIRICA;137;67613;29/1/2001 15:31:00;CIDADAO COMUM;S;;NOVA GRANADA;BH;608221.23;794143.73;1330
+1332;2001055209;B03000;AMEACA;RUA DOUTOR CRIST;5913;55598;29/1/2001 16:13:00;CIDADAO COMUM;N;0;ARAGUAIA;BH;605633.98;789574.15;1331
+1333;2001055359;B03000;AMEACA;RUA MACHADO DE A;131;42214;29/1/2001 17:32:00;CIDADAO COMUM;S;;LAGOINHA;BH;610184.60;798601.91;1332
+1334;2001055391;B03000;AMEACA;RUA SAO TOMAS DE;920;63782;29/1/2001 17:55:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610767.14;793197.10;1333
+1335;2001055413;B03000;AMEACA;RUA FREI GASPAR;157;29886;29/1/2001 18:08:00;CIDADAO COMUM;S;;CABANA;BH;604297.25;794201.39;1334
+1336;2001055428;B03000;AMEACA;RUA AROEIRA;923;81385;29/1/2001 18:10:00;CIDADAO COMUM;S;CAA;SAO JOAO BATISTA;BH;610704.45;801881.67;1335
+1337;2001055456;B03000;AMEACA;RUA PEREIRA PASS;42;53375;29/1/2001 18:27:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610200.44;798788.69;1336
+1338;2001055499;B03000;AMEACA;RUA DR CELSO AZE;32;23256;29/1/2001 18:53:00;CIDADAO COMUM;S;AP09;NOVA CINTRA;BH;605899.79;793934.12;1337
+1339;2001055526;B03000;AMEACA;RUA STELLA HANRI;186;91184;29/1/2001 19:11:00;CIDADAO COMUM;S;APTO 201;BURITIS;BH;607973.76;791265.75;1338
+1340;2001055536;B06000;LESAO CORPORAL;RUA FRANCE JOSE ;328;85751;29/1/2001 19:15:00;CIDADAO COMUM;N;CAA;SERRA VERDE;BH;609703.97;810229.05;1339
+1341;2001055558;B03000;AMEACA;RUA CELSO DA CUN;108;86511;29/1/2001 19:24:00;POLICIAL MILITAR;S;0;TREVO;BH;603458.59;806578.82;1340
+1342;2001055570;B03000;AMEACA;RUA HERCULANO SO;727;90093;29/1/2001 19:29:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614694.95;802735.17;1341
+1343;2001055598;B06000;LESAO CORPORAL;RUA FLOR DO ORIE;214;50190;29/1/2001 19:53:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;605906.21;799974.11;1342
+1344;2001055608;B03000;AMEACA;RUA LA PAZ;71;40363;29/1/2001 19:56:00;CIDADAO COMUM;S;0;COPACABANA;BH;605705.71;806410.64;1343
+1345;2001055646;B06000;LESAO CORPORAL;RUA CASCADURA;58;13863;29/1/2001 20:23:00;CIDADAO COMUM;N;;CAICARA;BH;607422.93;799127.29;1344
+1346;2001055668;B03000;AMEACA;RUA EPAMINONDAS ;15;25696;29/1/2001 20:33:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604476.95;793805.73;1345
+1347;2001055686;B03000;AMEACA;RUA SERRAVITE;35;65081;29/1/2001 20:45:00;CIDADAO COMUM;S;AP24;FLORESTA;BH;612213.50;797991.04;1346
+1348;2001055723;B03000;AMEACA;AV SOUZA AGUIAR;847;84402;29/1/2001 21:08:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615363.95;798852.85;1347
+1349;2001055772;B03000;AMEACA;RUA NUNO TRISTAO;286;102370;29/1/2001 21:44:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616633.04;797516.63;1348
+1350;2001055788;B03000;AMEACA;RUA HERMENEGILDO;225;33197;29/1/2001 21:52:00;CIDADAO COMUM;S;;TUPI;BH;612279.45;806696.80;1349
+1351;2001055823;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;7100;18652;29/1/2001 22:16:00;INICIATIVA;S;0;VILA SUZANA;BH;612026.03;803295.77;1350
+1352;2001055836;B06000;LESAO CORPORAL;AV ITAITE;836;35441;29/1/2001 22:24:00;CIDADAO COMUM;S;LJ;SAO GERALDO;BH;615609.27;799536.30;1351
+1353;2001055880;B03000;AMEACA;RUA TRINTA E OIT;21;34681;29/1/2001 22:55:00;CIDADAO COMUM;S;A;CONJUNTO FELICID;BH;612484.12;807437.95;1352
+1354;2001055892;B03000;AMEACA;RUA MINERVINA EU;100;80820;29/1/2001 22:59:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;606081.95;792227.89;1353
+1355;2001055976;B03000;AMEACA;BECO NOSSA SENHO;110;300380;29/1/2001 23:52:00;CIDADAO COMUM;S;AP601;PRADO LOPES;BH;609845.68;798847.17;1354
+1356;2001055999;B03000;AMEACA;RUA ALFREDO ALVE;260;108175;30/1/2001 00:07:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606762.54;811481.99;1355
+1357;2001056121;B03000;AMEACA;RUA POUSO ALEGRE;282;54932;30/1/2001 01:45:00;CIDADAO COMUM;N;;FLORESTA;BH;611333.17;797986.35;1356
+1358;2001056150;B06000;LESAO CORPORAL;RUA MADALENA;57;42315;30/1/2001 02:11:00;CIDADAO COMUM;N;;SENHOR BOM JESUS;BH;609926.03;799941.02;1357
+1359;2001056363;B03000;AMEACA;RUA DOS GUARANIS;201;32181;30/1/2001 07:28:00;INICIATIVA;S;0;CENTRO (BH);BH;610742.55;797432.73;1358
+1360;2001056543;B06000;LESAO CORPORAL;RUA SESSENTA E C;41;33650;30/1/2001 10:02:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612355.18;806822.66;1359
+1361;2001056548;B04001;HOMICIDIO TENTAD;RUA MODELO;46;46026;30/1/2001 10:02:00;CIDADAO COMUM;N;;DOS PALMARES;BH;612190.56;802776.59;1360
+1362;2001056633;B06000;LESAO CORPORAL;AV AFONSO PENA;381;1259;30/1/2001 10:53:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611019.19;797421.73;1361
+1363;2001056801;B04001;HOMICIDIO TENTAD;AV PRESIDENTE AN;7500;4461;30/1/2001 12:53:00;CIDADAO COMUM;S;0;SAO LUIZ;BH;608835.03;804381.07;1362
+1364;2001056804;B04001;HOMICIDIO TENTAD;AV WALDIR SOEIRO;10;118904;30/1/2001 13:02:00;INICIATIVA;N;0;BETANIA;BH;603541.81;789510.67;1363
+1365;2001056822;B06000;LESAO CORPORAL;RUA IARA;7;33751;30/1/2001 13:18:00;CIDADAO COMUM;N;CSFDS;POMPEIA;BH;614644.40;798189.26;1364
+1366;2001056888;B03000;AMEACA;RUA JUPARANA;265;39672;30/1/2001 14:12:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611081.27;799473.64;1365
+1367;2001056931;B03000;AMEACA;RUA ENGENHO DO S;359;80427;30/1/2001 14:34:00;CIDADAO COMUM;N;0;ENGENHO NOGUEIRA;BH;606394.48;799795.89;1366
+1368;2001056997;B06000;LESAO CORPORAL;RUA BANGU;210;84598;30/1/2001 15:17:00;CIDADAO COMUM;N;;CAICARA;BH;607093.33;799200.45;1367
+1369;2001057006;B03000;AMEACA;RUA TACIBA;223;32024;30/1/2001 15:24:00;CIDADAO COMUM;S;0;COQUEIROS;BH;602360.48;799174.13;1368
+1370;2001057158;B03000;AMEACA;RUA OSCAR NEGRAO;428;17776;30/1/2001 16:43:00;CIDADAO COMUM;S;ATO 204;JARDINOPOLIS;BH;605047.53;794663.48;1369
+1371;2001057188;B06000;LESAO CORPORAL;RUA ALEXANDRE SI;140;2135;30/1/2001 17:00:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606816.61;794109.41;1370
+1372;2001057365;B03000;AMEACA;RUA MAURA;803;82205;30/1/2001 18:49:00;CIDADAO COMUM;S;;IPIRANGA;BH;612027.95;801355.98;1371
+1373;2001057409;B09000;ABANDONO DE INCA;RUA JUAZEIRO DO ;181;64873;30/1/2001 19:08:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;615324.29;806762.00;1372
+1374;2001057414;B03000;AMEACA;RUA ITAIPU;960;35439;30/1/2001 19:10:00;CIDADAO COMUM;S;CA3;VERA CRUZ;BH;616274.97;798164.89;1373
+1375;2001057490;B03000;AMEACA;RUA GUAICUI;151;31999;30/1/2001 19:59:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;609829.07;794224.02;1374
+1376;2001057553;B03000;AMEACA;RUA MANOEL PEDRO;11;81892;30/1/2001 20:44:00;CIDADAO COMUM;S;;PIRAJA;BH;614154.29;803189.54;1375
+1377;2001057607;B02000;RIXA;RUA JULITA NUNES;572;130047;30/1/2001 21:19:00;POLICIAL MILITAR;N;;MINASCAIXA;BH;609418.89;809963.99;1376
+1378;2001057639;B06000;LESAO CORPORAL;RUA SAO CLEMENTE;628;62197;30/1/2001 21:41:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609621.52;799734.14;1377
+1379;2001057649;B03000;AMEACA;RUA COUTO DE MAG;664;18463;30/1/2001 21:48:00;CIDADAO COMUM;S;;PARAISO;BH;614639.66;796763.67;1378
+1380;2001057660;B03000;AMEACA;AV SANTA TEREZA;55;61383;30/1/2001 21:55:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616478.06;797391.26;1379
+1381;2001057698;B03000;AMEACA;RUA JOAQUIM PURI;147;96087;30/1/2001 22:23:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614549.72;803290.47;1380
+1382;2001057740;B06000;LESAO CORPORAL;RUA JOSE FELIX M;1223;7416;30/1/2001 22:50:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606398.63;811463.72;1381
+1383;2001057741;B03000;AMEACA;RUA RIO PETROPOL;305;91893;30/1/2001 22:49:00;CIDADAO COMUM;S;;FILADELFIA;BH;602103.96;797827.26;1382
+1384;2001057761;B06000;LESAO CORPORAL;RUA ARAGUARI;12;5376;30/1/2001 23:00:00;INICIATIVA;S;;BARRO PRETO;BH;610125.29;797250.75;1383
+1385;2001057762;B06000;LESAO CORPORAL;AV FURQUIM WERNE;48;650;30/1/2001 23:01:00;INICIATIVA;S;0;TUPI;BH;613005.07;805799.44;1384
+1386;2001057809;B03000;AMEACA;BECO SANTA MARIA;62;48960;30/1/2001 23:33:00;INICIATIVA;S;A;VILA PARAISO;BH;606182.79;790615.55;1385
+1387;2001057828;B04001;HOMICIDIO TENTAD;RUA AREIA BRANCA;10;75707;30/1/2001 23:36:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;614957.33;807774.40;1386
+1388;2001057851;B02000;RIXA;RUA JACUI;3076;36734;30/1/2001 23:50:00;CIDADAO COMUM;S;0;IPIRANGA;BH;611440.16;800881.73;1387
+1389;2001057872;B04001;HOMICIDIO TENTAD;RUA MOEMA;95;46070;31/1/2001 00:05:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;606560.38;798127.38;1388
+1390;2001057993;B03000;AMEACA;RUA MARIANO DE A;537;44411;31/1/2001 01:58:00;CIDADAO COMUM;S;0;ESPLANADA;BH;614922.39;798396.44;1389
+1391;2001058010;B04001;HOMICIDIO TENTAD;AV MANOEL GOMES;250;43103;31/1/2001 02:31:00;CIDADAO COMUM;N;;NOVA CACHOEIRINH;BH;609668.41;801466.24;1390
+1392;2001058084;B06000;LESAO CORPORAL;RUA OTAVIO CARNE;568;50594;31/1/2001 04:41:00;CIDADAO COMUM;S;;BOA VISTA;BH;614956.47;799991.12;1391
+1393;2001058262;B03000;AMEACA;RUA ITAPEVA;721;35820;31/1/2001 08:41:00;CIDADAO COMUM;S;;CONCORDIA;BH;611512.69;799189.30;1392
+1394;2001058280;B04001;HOMICIDIO TENTAD;AV AFONSO PENA;590;1259;31/1/2001 08:49:00;INICIATIVA;N;0;CENTRO BH;BH;611078.27;797193.62;1393
+1395;2001058316;B03000;AMEACA;RUA JOSE EDUARDO;375;38770;31/1/2001 09:17:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604315.58;790674.24;1394
+1396;2001058329;B06000;LESAO CORPORAL;AV SEN LEVINDO C;55;14866;31/1/2001 09:28:00;CIDADAO COMUM;N;CAA;INDEPENDENCIA;BH;601582.86;786276.22;1395
+1397;2001058332;B06000;LESAO CORPORAL;RUA ANGOLA;741;4001;31/1/2001 09:30:00;CIDADAO COMUM;S;AN2;SAO PAULO;BH;613020.50;802906.60;1396
+1398;2001058381;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;1428;51657;31/1/2001 10:01:00;CIDADAO COMUM;N;;VENDA NOVA;BH;608684.86;808921.08;1397
+1399;2001058403;B04001;HOMICIDIO TENTAD;RUA MARLY PASSOS;225;118107;31/1/2001 10:14:00;CIDADAO COMUM;S;;CH TUNEL DE IBIR;BH;599637.89;789970.22;1398
+1400;2001058524;B03000;AMEACA;RUA PADRE MARINH;246;51571;31/1/2001 11:37:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612834.71;796437.03;1399
+1401;2001058572;B03000;AMEACA;AV TERESA CRISTI;729;67512;31/1/2001 12:10:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;602258.86;791337.75;1400
+1402;2001058607;B03000;AMEACA;RUA ITAOCA;95;35703;31/1/2001 12:31:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611520.36;805977.45;1401
+1403;2001058618;B03000;AMEACA;RUA CONDOR;425;16773;31/1/2001 12:38:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605857.42;793824.01;1402
+1404;2001058670;B03000;AMEACA;RUA QUARENTA E U;46;34801;31/1/2001 13:13:00;INICIATIVA;N;0;FELICIDADE;BH;612521.64;807196.19;1403
+1405;2001058698;B04002;HOMICIDIO CONSUM;RUA PRINCIPAL;49;300224;31/1/2001 13:32:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610480.42;793583.71;1404
+1406;2001058716;B06000;LESAO CORPORAL;RUA JOAO MAGELA ;120;99390;31/1/2001 13:45:00;CIDADAO COMUM;S;;CEU AZUL;BH;605062.14;807887.41;1405
+1407;2001058767;B03000;AMEACA;RUA PATROCINIO;209;52574;31/1/2001 14:23:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;609810.09;797518.64;1406
+1408;2001058820;B03000;AMEACA;RUA SAO JOAO DE ;90;110073;31/1/2001 14:58:00;CIDADAO COMUM;S;;PILAR;BH;607693.72;788702.75;1407
+1409;2001058831;B06000;LESAO CORPORAL;RUA MACON RIBEIR;57;70514;31/1/2001 15:02:00;CIDADAO COMUM;N;LJ;VENDA NOVA;BH;609690.76;808307.39;1408
+1410;2001058879;B06000;LESAO CORPORAL;PRACA PRIMEIRO D;38;55254;31/1/2001 15:35:00;POLICIAL MILITAR;N;0;CENTRO (BH);BH;610657.63;796948.07;1409
+1411;2001058885;B03000;AMEACA;RUA EPAMINONDAS ;33;25696;31/1/2001 15:41:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604476.95;793805.73;1410
+1412;2001058943;B06000;LESAO CORPORAL;RUA NICOLINA DE ;71;44263;31/1/2001 16:21:00;CIDADAO COMUM;S;0;HAVAI;BH;607309.12;793702.59;1411
+1413;2001058952;B06000;LESAO CORPORAL;RUA JOAQUIM TEIX;150;128845;31/1/2001 16:26:00;POLICIAL MILITAR;N;0;CASTANHEIRAS (TA;BH;617405.88;796871.94;1412
+1414;2001058958;B06000;LESAO CORPORAL;RUA ANTONIO RODR;480;11537;31/1/2001 16:31:00;CIDADAO COMUM;S;;VENDA NOVA;BH;607247.00;809301.40;1413
+1415;2001059044;B03000;AMEACA;RUA CORREGO DA M;63;18160;31/1/2001 17:16:00;CIDADAO COMUM;S;LJ;SAGRADA FAMILIA;BH;612904.87;798017.92;1414
+1416;2001059173;B03000;AMEACA;RUA SANTOS;903;61910;31/1/2001 18:24:00;CIDADAO COMUM;S;AP101;JARDIM AMERICA;BH;607394.98;794391.51;1415
+1417;2001059237;B03000;AMEACA;RUA BENJAMIM JAC;71;9207;31/1/2001 19:00:00;CIDADAO COMUM;S;0;GUTIERREZ;BH;608577.81;794897.65;1416
+1418;2001059300;B04001;HOMICIDIO TENTAD;RUA ALZIRA GONCA;190;58615;31/1/2001 19:34:00;CIDADAO COMUM;N;;VENDA NOVA;BH;608972.31;808425.51;1417
+1419;2001059360;B03000;AMEACA;RUA SAO LUIZ GON;210;63290;31/1/2001 20:04:00;CIDADAO COMUM;N;CAFU;IPIRANGA;BH;611529.38;800705.13;1418
+1420;2001059382;B09000;ABANDONO DE INCA;RUA DAS PETUNIAS;1069;11870;31/1/2001 20:17:00;CIDADAO COMUM;N;;LINDEIA;BH;598693.86;790907.36;1419
+1421;2001059436;B04001;HOMICIDIO TENTAD;RUA SANTA LUZIA;55;60904;31/1/2001 20:51:00;CIDADAO COMUM;N;AP301;NOVA CINTRA;BH;605213.06;793118.55;1420
+1422;2001059446;B03000;AMEACA;RUA PRINCIPAL;401;300224;31/1/2001 20:56:00;CIDADAO COMUM;N;0;MORRO DO PAPAGAI;BH;610524.12;793316.01;1421
+1423;2001059455;B03000;AMEACA;AV MEM DE SA;538;45395;31/1/2001 20:59:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613961.23;796782.49;1422
+1424;2001059463;B03000;AMEACA;AV AUGUSTO DE LI;385;6731;31/1/2001 21:03:00;CIDADAO COMUM;S;AP102;CENTRO (BH);BH;611025.06;796588.88;1423
+1425;2001059469;B03000;AMEACA;RUA VITORIA REGI;201;73540;31/1/2001 21:04:00;CIDADAO COMUM;S;0;LINDEIA;BH;599089.55;790969.98;1424
+1426;2001059501;B04001;HOMICIDIO TENTAD;RUA CINQUENTA E ;235;33925;31/1/2001 21:23:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612859.28;806829.06;1425
+1427;2001059566;B03000;AMEACA;RUA CURVELO;50;19150;31/1/2001 22:00:00;CIDADAO COMUM;S;AP304;FLORESTA;BH;612139.97;797829.32;1426
+1428;2001059572;B04001;HOMICIDIO TENTAD;RUA SEIS;306;300264;31/1/2001 22:04:00;CIDADAO COMUM;N;0;VISTA DO SOL;BH;616300.81;804950.19;1427
+1429;2001059585;B08000;VIOLACAO DE DOMI;RUA JOAO AMACECK;129;37462;31/1/2001 22:10:00;CIDADAO COMUM;N;;BOA VISTA;BH;616121.92;799878.30;1428
+1430;2001059655;B03000;AMEACA;RUA JOINVILLE;99;53510;31/1/2001 23:00:00;CIDADAO COMUM;N;;COPACABANA;BH;606583.92;806827.53;1429
+1431;2001059686;B06000;LESAO CORPORAL;RUA FLOREAL;96;113926;31/1/2001 23:12:00;CIDADAO COMUM;N;0;PIRATININGA;BH;605452.17;809312.96;1430
+1432;2001059694;B06000;LESAO CORPORAL;RUA MACIEL RIBEI;30;81499;31/1/2001 23:17:00;CIDADAO COMUM;S;0;JARDIM GUANABARA;BH;611750.66;807384.55;1431
+1433;2001059711;B02000;RIXA;RUA KEPLER;196;39990;31/1/2001 23:28:00;CIDADAO COMUM;S;;SANTA LUCIA;BH;609886.18;792478.04;1432
+1434;2001059763;B03000;AMEACA;RUA TRIPUI;131;69763;31/1/2001 23:55:00;CIDADAO COMUM;S;0;GUARANI;BH;612931.77;805684.10;1433
+1435;2001059832;B02000;RIXA;RUA DOUTOR CRIST;312;55598;1/2/2001 00:40:00;CIDADAO COMUM;S;0;BARREIRO DE CIMA;BH;604751.25;789297.85;1434
+1436;2001059842;B06000;LESAO CORPORAL;RUA NEFELINA;99;81228;1/2/2001 00:54:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612838.15;797304.69;1435
+1437;2001059851;B03000;AMEACA;RUA BRASIL TRI-C;180;170485;1/2/2001 01:04:00;INICIATIVA;N;0;DOM CABRAL;BH;604562.87;796907.92;1436
+1438;2001060029;B02000;RIXA;PRACA DUQUE DE C;69;24145;1/2/2001 04:19:00;INICIATIVA;N;0;SANTA TEREZA;BH;613410.51;797459.13;1437
+1439;2001060132;B04001;HOMICIDIO TENTAD;RUA CARMELITA CO;338;93366;1/2/2001 07:20:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;600867.06;785924.34;1438
+1440;2001060145;B03000;AMEACA;AV AFONSO PENA;372;1259;1/2/2001 07:33:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610959.28;797388.43;1439
+1441;2001060393;B03000;AMEACA;RUA MAJOR DELFIN;1070;42620;1/2/2001 10:35:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609785.00;802309.75;1440
+1442;2001060421;B06000;LESAO CORPORAL;BECO SANTO ANTON;282;96349;1/2/2001 11:02:00;INICIATIVA;N;0;PRIMEIRO DE MAIO;BH;612200.69;803724.03;1441
+1443;2001060436;B03000;AMEACA;RUA CAPA PRETA;186;14232;1/2/2001 11:10:00;CIDADAO COMUM;N;CAA;JOAO PINHEIRO;BH;605022.27;796035.34;1442
+1444;2001060485;B03000;AMEACA;RUA SILVEIRA MAR;538;65977;1/2/2001 11:50:00;CIDADAO COMUM;S;FU;PARQUE RIACHUELO;BH;609470.74;800354.37;1443
+1445;2001060593;B03000;AMEACA;RUA DA BOLIVIA;897;9884;1/2/2001 13:18:00;CIDADAO COMUM;S;0;SION;BH;611010.39;793433.40;1444
+1446;2001060608;B03000;AMEACA;BECO DAS MARIAS;35;301279;1/2/2001 13:25:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610462.00;793612.12;1445
+1447;2001060632;B06000;LESAO CORPORAL;RUA NELSON;605;47407;1/2/2001 13:40:00;CIDADAO COMUM;N;;UNIAO;BH;613017.58;801280.15;1446
+1448;2001060716;B03000;AMEACA;RUA MARIO SALUST;258;34492;1/2/2001 14:31:00;CIDADAO COMUM;S;0;GOIANIA;BH;614977.70;803071.04;1447
+1449;2001060725;B03000;AMEACA;AV SERRANA;435;65040;1/2/2001 14:36:00;CIDADAO COMUM;S;0;SERRANO;BH;603481.26;801371.79;1448
+1450;2001060727;B03000;AMEACA;AV SILVA GUIMARA;97;65863;1/2/2001 14:37:00;INICIATIVA;S;0;ITAIPU BH;BH;598852.15;789036.88;1449
+1451;2001060729;B04001;HOMICIDIO TENTAD;AV CIVILIZACAO;300;51657;1/2/2001 14:37:00;INICIATIVA;N;0;LEBLON;BH;605644.83;810039.92;1450
+1452;2001060777;B06000;LESAO CORPORAL;AV SINFRONIO BRO;688;66116;1/2/2001 15:08:00;INICIATIVA;N;0;BARREIRO;BH;602643.71;790854.32;1451
+1453;2001060794;B03000;AMEACA;AV ALVARO DA SIL;938;2872;1/2/2001 15:21:00;CIDADAO COMUM;S;;BARREIRO;BH;602015.43;790984.73;1452
+1454;2001060800;B06000;LESAO CORPORAL;BECO BOA VISTA;90;170302;1/2/2001 15:25:00;CIDADAO COMUM;N;;CABANA;BH;604870.95;793612.31;1453
+1455;2001060822;B03000;AMEACA;RUA JURAMENTO;191;39732;1/2/2001 15:38:00;CIDADAO COMUM;S;0;PARAISO;BH;614799.88;797390.14;1454
+1456;2001060872;B03000;AMEACA;RUA CRISTALIA;192;70899;1/2/2001 16:06:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612534.68;804567.59;1455
+1457;2001061075;B03000;AMEACA;RUA SETE DE SETE;200;170167;1/2/2001 17:55:00;CIDADAO COMUM;S;0;CABANA;BH;604457.24;794353.97;1456
+1458;2001061136;B06000;LESAO CORPORAL;RUA URCA;219;71040;1/2/2001 18:31:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603289.41;802477.20;1457
+1459;2001061149;B03000;AMEACA;RUA SAO CLEMENTE;40;62197;1/2/2001 18:35:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609648.20;799172.19;1458
+1460;2001061168;B03000;AMEACA;RUA ETILANDIA;130;26759;1/2/2001 18:45:00;CIDADAO COMUM;S;CAA;ANTONIO RIBEIRO ;BH;615163.64;806661.04;1459
+1461;2001061193;B03000;AMEACA;RUA FLOR DA PASC;34;28795;1/2/2001 19:01:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;605912.50;799356.90;1460
+1462;2001061258;B03000;AMEACA;AV SERRANA;1322;65040;1/2/2001 19:36:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603457.28;802162.09;1461
+1463;2001061264;B06000;LESAO CORPORAL;RUA LUAR DE MINA;23;88343;1/2/2001 19:38:00;CIDADAO COMUM;S;;VENDA NOVA;BH;607263.75;809334.88;1462
+1464;2001061304;B03000;AMEACA;RUA REGENCIA;316;301448;1/2/2001 19:58:00;CIDADAO COMUM;S;PX271;VILA CAFEZAL;BH;614098.82;795476.81;1463
+1465;2001061437;B03000;AMEACA;RUA ANTONIO VIEI;234;4925;1/2/2001 21:05:00;CIDADAO COMUM;N;0;GLALIJA;BH;603544.15;794206.42;1464
+1466;2001061455;B03000;AMEACA;AV FLOR DE SEDA;235;748;1/2/2001 21:14:00;CIDADAO COMUM;S;0;LINDEIA;BH;599017.62;790942.00;1465
+1467;2001061507;B03000;AMEACA;RUA CAMILO GOMES;395;11902;1/2/2001 21:42:00;CIDADAO COMUM;S;CAFR;ITAIPU BH;BH;599526.34;789343.98;1466
+1468;2001061604;B06000;LESAO CORPORAL;RUA ALAGOAS;896;1678;1/2/2001 22:38:00;CIDADAO COMUM;N;1106;FUNCIONARIOS;BH;611371.17;795424.35;1467
+1469;2001061631;B06000;LESAO CORPORAL;RUA MICA;151;45685;1/2/2001 23:02:00;CIDADAO COMUM;S;;SAO LUCAS;BH;613254.23;795969.45;1468
+1470;2001061669;B06000;LESAO CORPORAL;BECO CANARINHO;20;172074;1/2/2001 23:14:00;CIDADAO COMUM;S;;VILA CEMIG;BH;605308.22;788787.01;1469
+1471;2001061680;B06000;LESAO CORPORAL;AV AFONSO PENA;1301;1259;1/2/2001 23:20:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611434.79;796733.41;1470
+1472;2001061694;B06000;LESAO CORPORAL;RUA JULIO PIRES ;73;39543;1/2/2001 23:32:00;CIDADAO COMUM;N;;RIO BRANCO;BH;607144.25;808780.18;1471
+1473;2001061712;B06000;LESAO CORPORAL;RUA PERNAMBUCO;1077;53463;1/2/2001 23:40:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611502.50;795210.22;1472
+1474;2001061785;B06000;LESAO CORPORAL;AV CRISTIANO MAC;2250;18652;2/2/2001 00:21:00;INICIATIVA;N;0;CIDADE NOVA;BH;612163.55;800630.11;1473
+1475;2001061796;B06000;LESAO CORPORAL;RUA SERINGUEIRA;808;90471;2/2/2001 00:30:00;CIDADAO COMUM;S;;PATROCINIO;BH;605107.82;794408.66;1474
+1476;2001061833;B03000;AMEACA;RUA CONTAGEM;1010;70293;2/2/2001 00:53:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614621.27;800626.08;1475
+1477;2001061837;B06000;LESAO CORPORAL;RUA DES BRAULIO;1341;19917;2/2/2001 00:58:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616286.46;797842.29;1476
+1478;2001061842;B03000;AMEACA;RUA PADRE PAULO ;85;56096;2/2/2001 01:00:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611731.42;807037.64;1477
+1479;2001061911;B04001;HOMICIDIO TENTAD;AV PRUDENTE DE M;1000;55774;2/2/2001 01:50:00;INICIATIVA;N;0;CORACAO DE JESUS;BH;609997.99;794345.70;1478
+1480;2001061942;B03000;AMEACA;AV A;74;302850;2/2/2001 02:14:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;613873.98;805539.35;1479
+1481;2001061950;B04001;HOMICIDIO TENTAD;AV ARTUR BERNARD;1180;60844;2/2/2001 02:19:00;INICIATIVA;S;0;VILA PARIS;BH;610180.14;793263.99;1480
+1482;2001061994;B06000;LESAO CORPORAL;RUA SERRINHA;61;129201;2/2/2001 03:10:00;CIDADAO COMUM;N;;MANGUEIRAS;BH;600519.25;786719.95;1481
+1483;2001062013;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;1361;31400;2/2/2001 03:28:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609953.61;797025.02;1482
+1484;2001062058;B04002;HOMICIDIO CONSUM;RUA CONCEICAO DE;488;16515;2/2/2001 04:29:00;INICIATIVA;N;0;JARDIM LEBLON;BH;605827.11;807322.29;1483
+1485;2001062083;B03000;AMEACA;RUA JOSE CAMILO ;63;82350;2/2/2001 05:17:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;611432.74;805022.11;1484
+1486;2001062201;B04002;HOMICIDIO CONSUM;RUA MUNICIPAL;49;171677;2/2/2001 07:54:00;CIDADAO COMUM;S;;VILA CEMIG;BH;605549.39;788565.80;1485
+1487;2001062279;B06000;LESAO CORPORAL;AV AMAZONAS;885;3140;2/2/2001 08:51:00;INICIATIVA;N;0;CENTRO (BH);BH;610745.60;796908.15;1486
+1488;2001062289;B03000;AMEACA;RUA SAO PAULO;370;90213;2/2/2001 08:55:00;CIDADAO COMUM;S;0;SARANDI (URCA/BH;BH;602793.89;802510.17;1487
+1489;2001062300;B06000;LESAO CORPORAL;RUA DES BRAULIO;1341;19917;2/2/2001 09:02:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616286.46;797842.29;1488
+1490;2001062326;B03000;AMEACA;RUA PIAUI;164;53624;2/2/2001 09:16:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;612590.73;796729.91;1489
+1491;2001062340;B06000;LESAO CORPORAL;RUA ITAPEVA;721;35820;2/2/2001 09:25:00;CIDADAO COMUM;S;;CONCORDIA;BH;611512.69;799189.30;1490
+1492;2001062362;B06000;LESAO CORPORAL;RUA TEN ANASTACI;1046;67263;2/2/2001 09:36:00;CIDADAO COMUM;S;PX215;SAO LUCAS;BH;613301.83;796082.54;1491
+1493;2001062462;B06000;LESAO CORPORAL;RUA VICENTE DE A;301;71807;2/2/2001 10:42:00;INICIATIVA;S;* SLU *;BARREIRO;BH;602068.68;790559.92;1492
+1494;2001062509;B03000;AMEACA;AV SEN LEVINDO C;3363;14866;2/2/2001 11:13:00;INICIATIVA;S;0;CH VALE DO JATOB;BH;601209.33;786916.79;1493
+1495;2001062610;B03000;AMEACA;RUA IGUACU;35;34118;2/2/2001 12:30:00;CIDADAO COMUM;S;;CONCORDIA;BH;610921.00;798888.59;1494
+1496;2001062625;B03000;AMEACA;AV RAUL MOURAO G;137;89900;2/2/2001 12:37:00;INICIATIVA;S;;PALMEIRAS;BH;606587.40;791752.04;1495
+1497;2001062635;B03000;AMEACA;AV SINFRONIO BRO;452;66116;2/2/2001 12:44:00;CIDADAO COMUM;S;;BARREIRO;BH;602895.18;790906.39;1496
+1498;2001062636;B06000;LESAO CORPORAL;RUA QUARENTA E T;135;56780;2/2/2001 12:44:00;CIDADAO COMUM;N;];GOIANIA;BH;615572.59;803438.36;1497
+1499;2001062637;B06000;LESAO CORPORAL;RUA 35;5;302833;2/2/2001 12:45:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;613942.87;805469.60;1498
+1500;2001062705;B06000;LESAO CORPORAL;RUA D;48;47740;2/2/2001 13:34:00;CIDADAO COMUM;S;0;VILA CASTANHEIRA;BH;601064.32;788642.82;1499
+1501;2001062712;B03000;AMEACA;RUA GUSTAVO DA S;69;32617;2/2/2001 13:43:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613767.26;798748.73;1500
+1502;2001062802;B03000;AMEACA;RUA CONCEICAO DA;69;46360;2/2/2001 14:48:00;INICIATIVA;S;0;COQUEIROS;BH;603000.95;800039.62;1501
+1503;2001062834;B06000;LESAO CORPORAL;AV AFONSO PENA;1707;1259;2/2/2001 15:07:00;CIDADAO COMUM;S;LJ1;CENTRO (BH);BH;611696.54;796248.60;1502
+1504;2001062838;B06000;LESAO CORPORAL;RUA JOAQUIM ARIS;12;114087;2/2/2001 15:13:00;CIDADAO COMUM;S;;LETICIA;BH;607112.71;809608.80;1503
+1505;2001062874;B03000;AMEACA;RUA FREI LUIZ DE;980;29961;2/2/2001 15:25:00;CIDADAO COMUM;S;;ALTO DOS PINHEIR;BH;604208.48;796388.72;1504
+1506;2001062951;B03000;AMEACA;RUA GERALDO SILV;205;56588;2/2/2001 16:13:00;CIDADAO COMUM;S;;RIO BRANCO;BH;606436.61;808648.71;1505
+1507;2001062998;B03000;AMEACA;RUA GIRASSOL;403;31277;2/2/2001 16:43:00;CIDADAO COMUM;S;;LINDEIA;BH;599265.73;791053.31;1506
+1508;2001063130;B03000;AMEACA;RUA PATU;26;52587;2/2/2001 17:49:00;INICIATIVA;S;0;SAO GERALDO;BH;616132.74;799457.09;1507
+1509;2001063187;B04001;HOMICIDIO TENTAD;RUA PORUINA;95;54860;2/2/2001 18:21:00;CIDADAO COMUM;N;AP202;JARDIM AMERICA;BH;606963.06;794728.99;1508
+1510;2001063190;B03000;AMEACA;RUA ORION RIGEL ;195;128961;2/2/2001 18:21:00;CIDADAO COMUM;S;AP05;FLORAMAR;BH;611775.11;807103.70;1509
+1511;2001063224;B03000;AMEACA;AV SANTOS DUMONT;690;61950;2/2/2001 18:41:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610987.45;797613.53;1510
+1512;2001063257;B06000;LESAO CORPORAL;RUA JOSE LINS DO;124;38903;2/2/2001 18:54:00;CIDADAO COMUM;S;;TUPI;BH;612511.61;806023.59;1511
+1513;2001063264;B06000;LESAO CORPORAL;AV ARTUR BERNARD;1400;60844;2/2/2001 18:58:00;CIDADAO COMUM;S;;VILA PARIS;BH;610262.27;793237.57;1512
+1514;2001063276;B03000;AMEACA;RUA PARAIBA;845;52170;2/2/2001 19:08:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;611731.54;795534.42;1513
+1515;2001063341;B04001;HOMICIDIO TENTAD;RUA VASCO DA GAM;316;71330;2/2/2001 19:44:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;611169.88;805021.78;1514
+1516;2001063344;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;426;51644;2/2/2001 19:46:00;CIDADAO COMUM;S;AP202;CORACAO EUCARIST;BH;605699.54;796696.04;1515
+1517;2001063407;B04001;HOMICIDIO TENTAD;RUA PADRE CAFE;105;51253;2/2/2001 20:15:00;CIDADAO COMUM;N;;SAUDADE;BH;615127.56;797675.19;1516
+1518;2001063440;B03000;AMEACA;AV AFONSO PENA;3888;1259;2/2/2001 20:29:00;CIDADAO COMUM;S;PROX. BANCO ITAU;CRUZEIRO;BH;612736.07;794330.03;1517
+1519;2001063567;B06000;LESAO CORPORAL;RUA SENHOR DOS P;175;64817;2/2/2001 21:33:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609781.32;802567.71;1518
+1520;2001063648;B03000;AMEACA;RUA RADIALISTA C;299;99375;2/2/2001 22:24:00;CIDADAO COMUM;S;;CEU AZUL;BH;604907.33;807570.81;1519
+1521;2001063671;B03000;AMEACA;RUA JAIR NEGRAO ;5;21944;2/2/2001 22:35:00;CIDADAO COMUM;S;0;JARDIM ESTRELA;BH;607349.55;810148.64;1520
+1522;2001063809;B06000;LESAO CORPORAL;RUA JANUARIO PER;57;86363;2/2/2001 23:43:00;CIDADAO COMUM;N;0;JAQUELINE;BH;611073.74;810225.60;1521
+1523;2001063818;B03000;AMEACA;RUA ADONIAS FILH;191;22010;2/2/2001 23:49:00;CIDADAO COMUM;S;;SANTA MARIA;BH;603661.98;795283.35;1522
+1524;2001063825;B06000;LESAO CORPORAL;RUA ANTONIO GENT;21;4562;2/2/2001 23:49:00;CIDADAO COMUM;S;;CONCORDIA;BH;610610.15;799328.53;1523
+1525;2001063906;B03000;AMEACA;RUA CARMEM;117;100407;3/2/2001 00:36:00;CIDADAO COMUM;N;;SANTA MONICA DO ;BH;606236.18;808762.74;1524
+1526;2001063962;B03000;AMEACA;RUA CORONEL ANTO;418;17590;3/2/2001 01:07:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605911.45;807534.46;1525
+1527;2001063964;B03000;AMEACA;RUA ENEAS;862;25481;3/2/2001 01:08:00;CIDADAO COMUM;S;;NOVO GLORIA;BH;603052.25;799062.91;1526
+1528;2001063969;B03000;AMEACA;RUA DOUTOR VIEIR;975;129964;3/2/2001 01:10:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;612837.37;798930.87;1527
+1529;2001064004;B04002;HOMICIDIO CONSUM;AV WALDOMIRO LOB;591;66548;3/2/2001 01:28:00;CIDADAO COMUM;N;CA01;GUARANI;BH;612785.98;805403.93;1528
+1530;2001064013;B06000;LESAO CORPORAL;RUA CORONEL JOAQ;1162;87063;3/2/2001 01:31:00;CIDADAO COMUM;S;;CEU AZUL;BH;605013.45;808558.53;1529
+1531;2001064032;B04001;HOMICIDIO TENTAD;RUA ATIBAIA;215;6530;3/2/2001 01:43:00;CIDADAO COMUM;S;;PIRATININGA;BH;606550.78;809443.16;1530
+1532;2001064078;B06000;LESAO CORPORAL;RUA LUCERNA;165;83655;3/2/2001 02:08:00;CIDADAO COMUM;S;LJ1;JARDIM EUROPA;BH;607904.55;810123.51;1531
+1533;2001064093;B06000;LESAO CORPORAL;RUA PADRE MANOEL;20;51556;3/2/2001 02:21:00;CIDADAO COMUM;N;0;VILA OESTE;BH;605001.79;795759.79;1532
+1534;2001064105;B03000;AMEACA;AV RAJA GABAGLIA;2708;57830;3/2/2001 02:30:00;CIDADAO COMUM;S;;ESTORIL;BH;609088.84;792662.10;1533
+1535;2001064106;B04001;HOMICIDIO TENTAD;RUA MARCOS PAULO;87;81911;3/2/2001 02:30:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614036.11;803725.32;1534
+1536;2001064192;B06000;LESAO CORPORAL;AV PRUDENTE DE M;1111;55774;3/2/2001 03:31:00;CIDADAO COMUM;S;AP01;CORACAO DE JESUS;BH;610016.76;794258.13;1535
+1537;2001064248;B04001;HOMICIDIO TENTAD;RUA CONCEICAO DO;1044;68253;3/2/2001 03:58:00;CIDADAO COMUM;N;FU;SANTA INES;BH;613891.99;800833.38;1536
+1538;2001064279;B06000;LESAO CORPORAL;AV DO CONTORNO;8159;17228;3/2/2001 04:19:00;INICIATIVA;N;0;CENTRO BH;BH;609751.80;795477.78;1537
+1539;2001064286;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;3/2/2001 04:23:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;1538
+1540;2001064357;B03000;AMEACA;RUA NOVA SUISSA;90;23707;3/2/2001 05:42:00;CIDADAO COMUM;S;;TAQUARIL;BH;617425.46;797075.87;1539
+1541;2001064425;B03000;AMEACA;RUA CLORITA;100;16051;3/2/2001 07:11:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612847.22;797209.80;1540
+1542;2001064448;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;250;26052;3/2/2001 07:47:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611330.13;797421.35;1541
+1543;2001064522;B03000;AMEACA;RUA ALVARENGA PE;1027;2683;3/2/2001 08:52:00;CIDADAO COMUM;S;AP201;SANTO AGOSTINHO;BH;610138.17;795955.25;1542
+1544;2001064560;B03000;AMEACA;RUA JOAQUIM ANAC;23;118932;3/2/2001 09:13:00;INICIATIVA;S;0;TEIXEIRA DIAS;BH;603052.88;789295.61;1543
+1545;2001064665;B03000;AMEACA;RUA SAO MATEUS;414;63389;3/2/2001 10:29:00;CIDADAO COMUM;S;APTO 404;SAGRADA FAMILIA;BH;613396.28;799197.79;1544
+1546;2001064690;B03000;AMEACA;RUA VEBRA;5;82637;3/2/2001 10:51:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614667.55;803334.30;1545
+1547;2001064793;B03000;AMEACA;AV PRESIDENTE AN;1397;4461;3/2/2001 12:12:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610280.96;799328.31;1546
+1548;2001064860;B03000;AMEACA;RUA INDEPENDENCI;659;34391;3/2/2001 13:09:00;CIDADAO COMUM;N;;CABANA;BH;604615.33;794432.74;1547
+1549;2001065007;B03000;AMEACA;RUA DONA LUCI;10;86004;3/2/2001 14:52:00;CIDADAO COMUM;S;0;ESTRELA DALVA;BH;607227.83;791915.50;1548
+1550;2001065028;B03000;AMEACA;RUA ALEIXO LOURE;140;56650;3/2/2001 15:07:00;INICIATIVA;S;0;CARDOSO;BH;603942.21;787795.21;1549
+1551;2001065054;B06000;LESAO CORPORAL;RUA DA DESCIDA;53;65154;3/2/2001 15:23:00;CIDADAO COMUM;S;CAA;SAO JOSE;BH;605272.07;798601.47;1550
+1552;2001065143;B06000;LESAO CORPORAL;RUA SAO PAULO;124;63464;3/2/2001 16:17:00;INICIATIVA;S;0;CENTRO BH;BH;611102.49;797669.42;1551
+1553;2001065184;B03000;AMEACA;RUA DONA LUCI;10;86004;3/2/2001 16:43:00;CIDADAO COMUM;N;0;ESTRELA DALVA;BH;607227.83;791915.50;1552
+1554;2001065212;B06000;LESAO CORPORAL;RUA AUGUSTO DOS ;820;6669;3/2/2001 16:58:00;CIDADAO COMUM;S;;SINIMBU;BH;606642.44;808285.27;1553
+1555;2001065238;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;3/2/2001 17:12:00;INICIATIVA;S;0;TIROL;BH;600947.66;789885.51;1554
+1556;2001065260;B06000;LESAO CORPORAL;RUA DEMERGINA MA;112;48756;3/2/2001 17:23:00;CIDADAO COMUM;S;0;JONAS VEIGA;BH;616164.65;797149.10;1555
+1557;2001065269;B06000;LESAO CORPORAL;RUA OITENTA E DO;25;124223;3/2/2001 17:26:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607793.10;811865.64;1556
+1558;2001065295;B03000;AMEACA;RUA NHONHO BROCH;35;47580;3/2/2001 17:41:00;INICIATIVA;N;0;DAS INDUSTRIAS;BH;604735.48;792089.49;1557
+1559;2001065296;B03000;AMEACA;RUA GERALDO FERR;213;96222;3/2/2001 17:40:00;CIDADAO COMUM;N;CAA;MANTIQUEIRA;BH;606241.53;810809.31;1558
+1560;2001065308;B03000;AMEACA;RUA ENGENHO DA N;143;94504;3/2/2001 17:49:00;CIDADAO COMUM;N;;ENGENHO NOGUEIRA;BH;606394.76;800258.95;1559
+1561;2001065316;B03000;AMEACA;RUA JULIO PIRES ;97;39543;3/2/2001 17:53:00;CIDADAO COMUM;S;CAA;RIO BRANCO;BH;607122.60;808788.73;1560
+1562;2001065365;B06000;LESAO CORPORAL;RUA ANIBAL BENEV;231;4083;3/2/2001 18:24:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613656.92;796467.64;1561
+1563;2001065386;B03000;AMEACA;RUA BOLIVAR FERR;156;89995;3/2/2001 18:36:00;CIDADAO COMUM;N;;PALMEIRAS;BH;607337.16;791539.73;1562
+1564;2001065391;B06000;LESAO CORPORAL;RUA JOSE CLEMENT;542;38670;3/2/2001 18:42:00;CIDADAO COMUM;S;;IPIRANGA;BH;611983.53;800784.84;1563
+1565;2001065402;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;2222;57830;3/2/2001 18:49:00;INICIATIVA;S;0;ESTORIL;BH;608853.99;793279.32;1564
+1566;2001065409;B06000;LESAO CORPORAL;RUA TEREZINHA FR;12;105136;3/2/2001 18:51:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;605517.42;791015.18;1565
+1567;2001065419;B06000;LESAO CORPORAL;RUA SERRINHA;172;129201;3/2/2001 18:54:00;CIDADAO COMUM;0;;MANGUEIRAS;BH;600395.13;787259.05;1566
+1568;2001065432;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;1499;40770;3/2/2001 19:01:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615753.66;798128.77;1567
+1569;2001065447;B06000;LESAO CORPORAL;RUA ELETRON;100;25210;3/2/2001 19:10:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612263.84;803426.36;1568
+1570;2001065450;B06000;LESAO CORPORAL;RUA YUCATAN;70;36302;3/2/2001 19:12:00;POLICIAL MILITAR;S;;SAO PEDRO;BH;611188.45;793833.06;1569
+1571;2001065452;B04001;HOMICIDIO TENTAD;RUA AUGUSTA ANDR;91;99104;3/2/2001 19:12:00;CIDADAO COMUM;N;CS1;JAQUELINE;BH;610916.35;810299.61;1570
+1572;2001065466;B03000;AMEACA;RUA BRASIL;39;10446;3/2/2001 19:22:00;CIDADAO COMUM;N;;CABANA;BH;604919.66;793520.54;1571
+1573;2001065474;B04001;HOMICIDIO TENTAD;RUA POPULAR;81;54696;3/2/2001 19:26:00;CIDADAO COMUM;N;0;SAO CRISTOVAO;BH;610254.78;799269.93;1572
+1574;2001065530;B06000;LESAO CORPORAL;RUA JOAQUIM HENR;61;106605;3/2/2001 19:53:00;CIDADAO COMUM;S;;MARIA HELENA;BH;605851.29;810925.75;1573
+1575;2001065569;B06000;LESAO CORPORAL;RUA MARIA AUTA;85;91332;3/2/2001 20:13:00;CIDADAO COMUM;N;0;PALMEIRAS;BH;606555.53;791338.66;1574
+1576;2001065614;B03000;AMEACA;RUA FERNAO DIAS;1022;28133;3/2/2001 20:20:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616049.67;798294.87;1575
+1577;2001065617;B06000;LESAO CORPORAL;RUA PROGRESSO;1242;55759;3/2/2001 20:28:00;CIDADAO COMUM;S;AP 203;MONSENHOR MESSIA;BH;607191.53;797933.65;1576
+1578;2001065639;B03000;AMEACA;RUA ANIBAL BENEV;316;4083;3/2/2001 20:42:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613731.62;796429.78;1577
+1579;2001065642;B03000;AMEACA;RUA JOSE GONCALV;985;38828;3/2/2001 20:43:00;CIDADAO COMUM;N;0;BARREIRO;BH;602322.13;790879.97;1578
+1580;2001065648;B03000;AMEACA;RUA GUARARAPES;1425;32241;3/2/2001 20:45:00;CIDADAO COMUM;S;CAFR;GLORIA;BH;602749.14;798328.63;1579
+1581;2001065651;B06000;LESAO CORPORAL;AV BRAULIO GOMES;1050;81710;3/2/2001 20:47:00;CIDADAO COMUM;N;0;ITAIPU BH;BH;599840.36;789003.21;1580
+1582;2001065795;B03000;AMEACA;RUA TEODORO BONF;120;102430;3/2/2001 21:41:00;INICIATIVA;N;0;VERA CRUZ;BH;616904.51;797429.79;1581
+1583;2001065821;B03000;AMEACA;RUA EMILIO CARAM;315;92578;3/2/2001 21:51:00;CIDADAO COMUM;S;0;CALIFORNIA;BH;603435.58;796803.82;1582
+1584;2001065838;B03000;AMEACA;RUA IARA;518;33751;3/2/2001 21:57:00;CIDADAO COMUM;S;0;POMPEIA;BH;614707.91;797693.11;1583
+1585;2001065842;B06000;LESAO CORPORAL;RUA DR GERALDO S;158;23372;3/2/2001 21:58:00;INICIATIVA;S;0;REGINA;BH;599187.17;790136.57;1584
+1586;2001065844;B06000;LESAO CORPORAL;RUA DOS JAVAES;715;37198;3/2/2001 21:58:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;606509.12;807854.37;1585
+1587;2001065847;B03000;AMEACA;RUA MAURO COURA ;155;86930;3/2/2001 22:01:00;CIDADAO COMUM;S;;NOVO PAQUETA;BH;605770.00;801615.17;1586
+1588;2001065857;B06000;LESAO CORPORAL;RUA JOSE OURIVIO;103;39023;3/2/2001 22:05:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610133.84;801161.17;1587
+1589;2001065899;B06000;LESAO CORPORAL;RUA ALFREDO ALVE;237;20636;3/2/2001 22:31:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608508.39;808007.47;1588
+1590;2001065902;B06000;LESAO CORPORAL;RUA SAO PAULO;412;90213;3/2/2001 22:32:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602793.89;802510.17;1589
+1591;2001065911;B06000;LESAO CORPORAL;RUA TRES;210;302811;3/2/2001 22:35:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614468.64;806039.61;1590
+1592;2001065929;B04001;HOMICIDIO TENTAD;RUA DALVA DE MAT;29;19595;3/2/2001 22:43:00;CIDADAO COMUM;S;;SANTA MONICA DO ;BH;606094.58;808319.55;1591
+1593;2001065951;B06000;LESAO CORPORAL;RUA AMARANTO;183;3080;3/2/2001 22:55:00;CIDADAO COMUM;N;0;LINDEIA;BH;599445.88;790872.47;1592
+1594;2001065966;B03000;AMEACA;RUA CAPITAO PROC;26;12886;3/2/2001 23:03:00;CIDADAO COMUM;S;A;SANTA TEREZA;BH;612952.30;797362.40;1593
+1595;2001065990;B03000;AMEACA;RUA MARIANA;1204;44380;3/2/2001 23:13:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609625.10;798862.81;1594
+1596;2001066063;B03000;AMEACA;RUA NELSON HUNGR;10;46634;3/2/2001 23:52:00;CIDADAO COMUM;S;CAA;TUPI;BH;612851.92;806239.44;1595
+1597;2001066080;B03000;AMEACA;AV VEREADOR CICE;655;19756;4/2/2001 00:01:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604995.41;796458.52;1596
+1598;2001066084;B06000;LESAO CORPORAL;RUA ARISTOLINO B;151;41089;4/2/2001 00:03:00;INICIATIVA;S;0;REGINA;BH;598850.12;789949.69;1597
+1599;2001066136;B03000;AMEACA;RUA RADIALISTA W;56;98823;4/2/2001 00:35:00;CIDADAO COMUM;N;0;CEU AZUL;BH;604488.67;808458.66;1598
+1600;2001066188;B06000;LESAO CORPORAL;RUA CORONEL JOAQ;308;87063;4/2/2001 01:06:00;INICIATIVA;N;0;CEU AZUL;BH;604708.59;807851.94;1599
+1601;2001066271;B04001;HOMICIDIO TENTAD;RUA COROCOCO;11;76700;4/2/2001 01:49:00;INICIATIVA;S;0;NOVO AARAO REIS;BH;614329.87;806083.51;1600
+1602;2001066382;B02000;RIXA;RUA ALVARES MACI;312;2756;4/2/2001 02:58:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;612816.00;796590.28;1601
+1603;2001066390;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;4/2/2001 03:04:00;CIDADAO COMUM;N;;TIROL;BH;600947.66;789885.51;1602
+1604;2001066394;B06000;LESAO CORPORAL;AV ANTONIO ABRAH;1100;4320;4/2/2001 03:05:00;CIDADAO COMUM;S;0;SAO JOSE;BH;607791.03;803406.56;1603
+1605;2001066417;B03000;AMEACA;RUA JOAO PIRES;357;37866;4/2/2001 03:21:00;CIDADAO COMUM;N;;JARDINOPOLIS;BH;604771.54;794346.93;1604
+1606;2001066466;B06000;LESAO CORPORAL;RUA PROFESSORA V;3;56893;4/2/2001 03:42:00;CIDADAO COMUM;N;CSA;CHACARAS REUNIDA;BH;605513.76;789431.48;1605
+1607;2001066515;B06000;LESAO CORPORAL;RUA CAMELIA;110;11842;4/2/2001 04:32:00;CIDADAO COMUM;S;;BANDEIRANTES DO ;BH;606343.03;793587.88;1606
+1608;2001066542;B04001;HOMICIDIO TENTAD;RUA NINIVE;64;47700;4/2/2001 04:51:00;CIDADAO COMUM;S;CAA;SAO SALVADOR;BH;603563.72;799724.10;1607
+1609;2001066544;B06000;LESAO CORPORAL;RUA TENENTE VITO;71;67351;4/2/2001 04:51:00;INICIATIVA;N;0;SANTA TEREZA;BH;613395.47;797441.30;1608
+1610;2001066567;B03000;AMEACA;RUA VINHEDO;179;111858;4/2/2001 05:17:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599333.04;789042.72;1609
+1611;2001066648;B03000;AMEACA;RUA DA PEDREIRA;400;301298;4/2/2001 07:03:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;608618.39;794087.94;1610
+1612;2001066749;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;350;26052;4/2/2001 08:52:00;INICIATIVA;N;0;CENTRO BH;BH;611301.04;797310.96;1611
+1613;2001066790;B03000;AMEACA;AV AGENOR DE PAU;84;86250;4/2/2001 09:27:00;CIDADAO COMUM;N;;VILA FREI LEOPOL;BH;611111.29;809996.06;1612
+1614;2001066807;B06000;LESAO CORPORAL;RUA SETE DE OUTU;377;85030;4/2/2001 09:41:00;CIDADAO COMUM;N;;JARDIM DOS COMER;BH;607382.83;811141.67;1613
+1615;2001066816;B04001;HOMICIDIO TENTAD;RUA CARMELITA CO;140;93366;4/2/2001 09:56:00;CIDADAO COMUM;S;CA1;MINEIRAO;BH;600972.13;785917.35;1614
+1616;2001066847;B03000;AMEACA;RUA K;132;78774;4/2/2001 10:13:00;CIDADAO COMUM;S;0;CH JATOBA IV;BH;600562.64;787899.51;1615
+1617;2001066882;B03000;AMEACA;RUA BENEDITO NEV;185;9061;4/2/2001 10:45:00;CIDADAO COMUM;N;AP1202;NAZARE;BH;615997.83;804535.57;1616
+1618;2001066908;B03000;AMEACA;RUA CARMO;97;170992;4/2/2001 11:14:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608239.92;794053.80;1617
+1619;2001066963;B06000;LESAO CORPORAL;RUA CAMPINA VERD;65;12110;4/2/2001 12:14:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;606175.99;794495.57;1618
+1620;2001067032;B03000;AMEACA;RUA CAIO VIANA M;604;11477;4/2/2001 13:08:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604706.23;789321.47;1619
+1621;2001067052;B03000;AMEACA;AV BERNARDO VASC;2295;9411;4/2/2001 13:22:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;611969.00;801923.00;1620
+1622;2001067131;B03000;AMEACA;RUA CARLOS PINHE;19;13498;4/2/2001 14:19:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;606713.12;798861.18;1621
+1623;2001067142;B03000;AMEACA;RUA CARLOS EDUAR;210;92073;4/2/2001 14:22:00;CIDADAO COMUM;N;;CALIFORNIA;BH;602559.02;797182.09;1622
+1624;2001067193;B03000;AMEACA;AV PRESIDENTE CA;2020;55125;4/2/2001 15:04:00;CIDADAO COMUM;N;;CAICARA;BH;608432.84;800193.57;1623
+1625;2001067217;B03000;AMEACA;RUA PADRE FEIJO;416;51326;4/2/2001 15:21:00;INICIATIVA;S;0;SAUDADE;BH;615275.06;797524.13;1624
+1626;2001067392;B03000;AMEACA;RUA SAMUEL GAMMO;60;89591;4/2/2001 17:09:00;CIDADAO COMUM;S;;PALMEIRAS;BH;606686.57;790636.24;1625
+1627;2001067441;B06000;LESAO CORPORAL;AV UM;690;110679;4/2/2001 17:38:00;CIDADAO COMUM;N;CAA;JARDIM GUANABARA;BH;611709.66;807996.63;1626
+1628;2001067472;B03000;AMEACA;RUA DA FORTUNA;420;29209;4/2/2001 17:54:00;CIDADAO COMUM;S;0;SANTA CRUZ (BARR;BH;603043.11;788655.87;1627
+1629;2001067480;B04002;HOMICIDIO CONSUM;RUA GENTIOS;109;30983;4/2/2001 17:59:00;CIDADAO COMUM;N;;LUXEMBURGO;BH;608911.22;793572.33;1628
+1630;2001067494;B03000;AMEACA;RUA ESTRADA NOVA;224;170517;4/2/2001 18:06:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608342.46;794041.79;1629
+1631;2001067517;B06000;LESAO CORPORAL;AV DO CONTORNO;777;17228;4/2/2001 18:17:00;POLICIAL MILITAR;N;0;CENTRO (BH);BH;611399.16;797723.83;1630
+1632;2001067520;B06000;LESAO CORPORAL;RUA FLOR DA AMEI;240;77539;4/2/2001 18:17:00;CIDADAO COMUM;S;;JARDIM ALVORADA;BH;606203.88;800157.23;1631
+1633;2001067589;B03000;AMEACA;RUA COSTA JUNIOR;97;18321;4/2/2001 18:58:00;CIDADAO COMUM;N;97B;NOVA CACHOEIRINH;BH;609712.41;801469.91;1632
+1634;2001067703;B04001;HOMICIDIO TENTAD;RUA JOAQUIM PURI;5;96087;4/2/2001 20:03:00;INICIATIVA;N;0;MARIA GORETTI;BH;614651.86;803376.96;1633
+1635;2001067713;B03000;AMEACA;RUA DO CAFE;250;11389;4/2/2001 20:08:00;CIDADAO COMUM;S;FR;SANTA CRUZ (BARR;BH;603088.07;788898.98;1634
+1636;2001067714;B04002;HOMICIDIO CONSUM;RUA EPAMINONDAS ;305;25696;4/2/2001 20:09:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;604790.40;793595.99;1635
+1637;2001067723;B06000;LESAO CORPORAL;RUA MANHUMIRIM;737;42908;4/2/2001 20:15:00;INICIATIVA;N;0;ADELAIDE;BH;607822.69;798019.82;1636
+1638;2001067729;B03000;AMEACA;RUA MADRE SILVA;10;42384;4/2/2001 20:18:00;CIDADAO COMUM;S;0;ESPLANADA;BH;614409.41;798868.24;1637
+1639;2001067889;B03000;AMEACA;RUA JOAO ABRAS;115;124920;4/2/2001 21:41:00;CIDADAO COMUM;N;;MANGUEIRAS;BH;600549.95;786723.91;1638
+1640;2001067925;B03000;AMEACA;RUA MILTON DIAS;253;82712;4/2/2001 21:55:00;INICIATIVA;S;0;JARDIM VITORIA;BH;617102.88;803874.69;1639
+1641;2001067947;B03000;AMEACA;RUA DETETIVE WIL;168;21815;4/2/2001 22:08:00;POLICIAL MILITAR;S;0;DAS INDUSTRIAS;BH;605205.22;791432.67;1640
+1642;2001067981;B03000;AMEACA;RUA ESPINOSA;1062;26024;4/2/2001 22:25:00;INICIATIVA;N;0;CARLOS PRATES;BH;608710.01;797660.23;1641
+1643;2001067982;B03000;AMEACA;RUA LUIZ LOPES;68;94431;4/2/2001 22:26:00;CIDADAO COMUM;S;;OURO PRETO;BH;606229.55;801269.61;1642
+1644;2001067989;B04001;HOMICIDIO TENTAD;RUA CAMPANARIO;513;12010;4/2/2001 22:30:00;CIDADAO COMUM;S;0;SANTA INES;BH;614382.53;800754.13;1643
+1645;2001068010;B03000;AMEACA;RUA DAS FLORES;132;28930;4/2/2001 22:45:00;CIDADAO COMUM;N;AP32;NOVA SUISSA;BH;607488.91;795325.47;1644
+1646;2001068067;B06000;LESAO CORPORAL;AV PRUDENTE DE M;1150;55774;4/2/2001 23:13:00;CIDADAO COMUM;S;;CORACAO DE JESUS;BH;610007.32;794115.40;1645
+1647;2001068086;B04001;HOMICIDIO TENTAD;RUA CONTAGEM;801;70293;4/2/2001 23:19:00;CIDADAO COMUM;S;CAA;BOA VISTA;BH;614535.71;800352.87;1646
+1648;2001068120;B06000;LESAO CORPORAL;RUA RAINHA DAS F;39;92159;4/2/2001 23:37:00;CIDADAO COMUM;S;0;FILADELFIA;BH;602179.51;797574.42;1647
+1649;2001068144;B03000;AMEACA;RUA PAMIR;191;51947;4/2/2001 23:50:00;CIDADAO COMUM;S;;CH BETANIA;BH;605245.60;792168.52;1648
+1650;2001068214;B06000;LESAO CORPORAL;RUA JOSE BENEVID;451;99580;5/2/2001 00:21:00;CIDADAO COMUM;S;0;LETICIA;BH;606760.76;809412.33;1649
+1651;2001068229;B06000;LESAO CORPORAL;RUA DES BARCELOS;1500;19904;5/2/2001 00:30:00;INICIATIVA;S;0;JARDIM AMERICA;BH;606729.35;795407.19;1650
+1652;2001068305;B06000;LESAO CORPORAL;RUA LUIZ LOPES;22;94431;5/2/2001 01:13:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606191.02;801329.52;1651
+1653;2001068306;B03000;AMEACA;AV SILVA LOBO;237;65889;5/2/2001 01:11:00;POLICIAL MILITAR;N;;CALAFATE;BH;607663.44;796335.47;1652
+1654;2001068311;B03000;AMEACA;RUA GERALDO FERR;213;96222;5/2/2001 01:16:00;CIDADAO COMUM;S;C;MANTIQUEIRA;BH;606241.53;810809.31;1653
+1655;2001068324;B03000;AMEACA;RUA I;129;36687;5/2/2001 01:32:00;CIDADAO COMUM;S;0;MINASCAIXA;BH;609198.28;809916.80;1654
+1656;2001068361;B06000;LESAO CORPORAL;AV BIAS FORTES;1772;9553;5/2/2001 02:02:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610196.72;797244.85;1655
+1657;2001068440;B06000;LESAO CORPORAL;AV CIVILIZACAO;730;51657;5/2/2001 03:10:00;CIDADAO COMUM;S;;JARDIM FLORENCIA;BH;609311.62;808604.54;1656
+1658;2001068536;B03000;AMEACA;RUA VIANA DO CAS;1167;63640;5/2/2001 06:04:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609175.75;801372.41;1657
+1659;2001068657;B06000;LESAO CORPORAL;RUA TIMOTEO NONA;229;86161;5/2/2001 08:16:00;CIDADAO COMUM;N;;JAQUELINE;BH;611446.46;810532.25;1658
+1660;2001068734;B06000;LESAO CORPORAL;RUA TIRADENTES;90;85607;5/2/2001 09:00:00;CIDADAO COMUM;S;;ALVORADA (SB);SB;615497.04;802314.39;1659
+1661;2001068748;B06000;LESAO CORPORAL;RUA ANTONIO SILV;141;87108;5/2/2001 09:12:00;CIDADAO COMUM;S;0;DA LAGOA;BH;604758.70;808936.59;1660
+1662;2001068943;B03000;AMEACA;RUA FLOR DE MAIO;152;300399;5/2/2001 11:35:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614299.55;794710.96;1661
+1663;2001068976;B03000;AMEACA;RUA ALFREDO ALVE;468;20636;5/2/2001 11:57:00;INICIATIVA;S;0;SAO JOAO BATISTA;BH;608516.97;808041.50;1662
+1664;2001068995;B06000;LESAO CORPORAL;AV OLEGARIO MACI;1206;49699;5/2/2001 12:08:00;INICIATIVA;S;0;LOURDES;BH;610340.00;796469.41;1663
+1665;2001068999;B03000;AMEACA;RUA BOACHA;378;9695;5/2/2001 12:11:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604947.57;797405.33;1664
+1666;2001069095;B03000;AMEACA;RUA JAIR NEGRAO ;5;21944;5/2/2001 13:39:00;INICIATIVA;S;0;JARDIM ESTRELA;BH;607349.55;810148.64;1665
+1667;2001069132;B03000;AMEACA;AV BRASIL;237;10420;5/2/2001 13:59:00;CIDADAO COMUM;N;SL1003;SANTA EFIGENIA;BH;612812.64;796502.70;1666
+1668;2001069146;B06000;LESAO CORPORAL;RUA ALEXANDRE TO;186;2163;5/2/2001 14:06:00;CIDADAO COMUM;S;;HORTO;BH;613173.91;798217.77;1667
+1669;2001069347;B03000;AMEACA;RUA EVARISTO DA ;51;26922;5/2/2001 16:07:00;CIDADAO COMUM;N;FUNDOS;PRADO LOPES;BH;610160.34;798662.11;1668
+1670;2001069374;B03000;AMEACA;RUA SANTO ANDRE;115;26282;5/2/2001 16:19:00;CIDADAO COMUM;S;;TAQUARIL;BH;617403.36;797627.63;1669
+1671;2001069406;B03000;AMEACA;RUA CHIQUINHA GO;120;97200;5/2/2001 16:37:00;CIDADAO COMUM;N;;TUPI;BH;613769.37;806154.10;1670
+1672;2001069466;B03000;AMEACA;RUA CORONEL PEDR;128;18031;5/2/2001 16:59:00;CIDADAO COMUM;S;;CIDADE NOVA;BH;612312.95;800326.26;1671
+1673;2001069495;B04001;HOMICIDIO TENTAD;RUA TIGRE;471;67639;5/2/2001 17:18:00;INICIATIVA;N;0;SAO SALVADOR;BH;603394.12;800043.56;1672
+1674;2001069516;B03000;AMEACA;RUA SERRA DOS AI;154;65025;5/2/2001 17:27:00;CIDADAO COMUM;N;0;JARDIM LEBLON;BH;605851.32;807675.65;1673
+1675;2001069592;B06000;LESAO CORPORAL;RUA PIRACICABA;207;54047;5/2/2001 18:09:00;CIDADAO COMUM;N;0;PEDRO SEGUNDO;BH;608102.79;798417.13;1674
+1676;2001069604;B04001;HOMICIDIO TENTAD;RUA ALGARVE;400;61396;5/2/2001 18:16:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609107.38;801969.00;1675
+1677;2001069634;B03000;AMEACA;RUA SILVA ALVARE;626;65810;5/2/2001 18:32:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615385.74;799442.89;1676
+1678;2001069646;B03000;AMEACA;RUA MOISES;117;46114;5/2/2001 18:38:00;POLICIAL MILITAR;S;;SAO SALVADOR;BH;603000.91;799203.73;1677
+1679;2001069679;B06000;LESAO CORPORAL;ESTRADA DO CERCA;2603;26428;5/2/2001 18:51:00;CIDADAO COMUM;S;;HAVAI;BH;607721.78;793319.05;1678
+1680;2001069712;B03000;AMEACA;RUA PEONIA;411;115799;5/2/2001 19:03:00;CIDADAO COMUM;N;;HAVAI;BH;607162.30;793263.14;1679
+1681;2001069750;B06000;LESAO CORPORAL;AV PRESIDENTE AN;2563;4461;5/2/2001 19:27:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;609975.05;800406.95;1680
+1682;2001069814;B03000;AMEACA;RUA MARIA AMELIA;62;43800;5/2/2001 20:04:00;CIDADAO COMUM;S;0;NOVA GAMELEIRA;BH;605575.64;794758.64;1681
+1683;2001069821;B06000;LESAO CORPORAL;RUA ANA PEREIRA ;127;90415;5/2/2001 20:07:00;CIDADAO COMUM;S;;AARAO REIS;BH;613081.27;803728.83;1682
+1684;2001069849;B03000;AMEACA;RUA SEBASTIAO CL;25;108190;5/2/2001 20:22:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606855.47;811488.80;1683
+1685;2001069941;B06000;LESAO CORPORAL;RUA SETE DE OUTU;102;85030;5/2/2001 21:11:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607536.55;810892.37;1684
+1686;2001069968;B03000;AMEACA;RUA MARECHAL BIT;865;43589;5/2/2001 21:31:00;CIDADAO COMUM;N;AP601;GUTIERREZ;BH;608918.42;795085.07;1685
+1687;2001070040;B03000;AMEACA;RUA JOSE CAMBRAI;378;80786;5/2/2001 22:08:00;CIDADAO COMUM;S;;NOVA BARROCA;BH;607453.81;793052.97;1686
+1688;2001070154;B03000;AMEACA;RUA JOSE GOMES;334;38802;5/2/2001 23:19:00;CIDADAO COMUM;N;;SARANDI (URCA/BH;BH;603682.39;802289.69;1687
+1689;2001070181;B06000;LESAO CORPORAL;RUA DOS VICENTIN;85;63159;5/2/2001 23:42:00;CIDADAO COMUM;S;;PLANALTO;BH;610711.47;805504.00;1688
+1690;2001070204;B03000;AMEACA;RUA JAGUARA;600;36775;5/2/2001 23:58:00;CIDADAO COMUM;N;0;SAUDADE;BH;615333.34;797495.39;1689
+1691;2001070241;B04001;HOMICIDIO TENTAD;AV SARAMENHA;636;64007;6/2/2001 00:30:00;INICIATIVA;N;0;FLORAMAR;BH;612390.88;805800.78;1690
+1692;2001070259;B06000;LESAO CORPORAL;RUA MARECHAL RON;68;43677;6/2/2001 00:43:00;INICIATIVA;N;0;PRIMEIRO DE MAIO;BH;611883.66;803480.80;1691
+1693;2001070283;B06000;LESAO CORPORAL;AV DO CONTORNO;5602;17228;6/2/2001 01:14:00;CIDADAO COMUM;S;0;CARMO;BH;611910.43;794907.67;1692
+1694;2001070288;B03000;AMEACA;RUA DOS BANDOLIN;1;106980;6/2/2001 01:21:00;CIDADAO COMUM;S;0;DOM BOSCO;BH;604085.47;796771.04;1693
+1695;2001070292;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;726;6353;6/2/2001 01:29:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611774.82;797225.12;1694
+1696;2001070320;B03000;AMEACA;RUA NEFELINA;99;81228;6/2/2001 02:01:00;CIDADAO COMUM;N;;SANTA TEREZA;BH;612838.15;797304.69;1695
+1697;2001070324;B03000;AMEACA;RUA CORONEL ALVA;175;17520;6/2/2001 02:04:00;CIDADAO COMUM;N;;FLORAMAR;BH;611562.81;806331.42;1696
+1698;2001070544;B06000;LESAO CORPORAL;AV BARAO HOMEM D;1270;7936;6/2/2001 07:24:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607864.45;794292.87;1697
+1699;2001070603;B06000;LESAO CORPORAL;AV SANTOS DUMONT;680;61950;6/2/2001 08:13:00;INICIATIVA;N;0;CENTRO (BH);BH;610999.13;797614.04;1698
+1700;2001070604;B06000;LESAO CORPORAL;RUA SAO CLEMENTE;807;62197;6/2/2001 08:12:00;CIDADAO COMUM;N;;SENHOR BOM JESUS;BH;609581.73;799913.96;1699
+1701;2001070701;B03000;AMEACA;RUA GUANABARA;15;32040;6/2/2001 09:22:00;CIDADAO COMUM;S;;CONCORDIA;BH;611511.11;798794.06;1700
+1702;2001070754;B03000;AMEACA;RUA M;32;120210;6/2/2001 09:53:00;CIDADAO COMUM;S;AP102;DIAMANTE;BH;602103.71;789532.87;1701
+1703;2001070769;B06000;LESAO CORPORAL;AV ITAU;512;36025;6/2/2001 10:10:00;CIDADAO COMUM;S;;DOM BOSCO;BH;605311.81;797266.71;1702
+1704;2001070816;B03000;AMEACA;AV BERNARDO VASC;288;9411;6/2/2001 10:34:00;CIDADAO COMUM;S;E M PROF. HEONOR;CACHOEIRINHA;BH;609909.14;801037.91;1703
+1705;2001070823;B03000;AMEACA;RUA POLONIA;15;54541;6/2/2001 10:38:00;CIDADAO COMUM;N;0;COPACABANA;BH;605659.23;806545.79;1704
+1706;2001070846;B03000;AMEACA;ESTRADA DOS BORG;104;85893;6/2/2001 10:50:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616597.33;804710.50;1705
+1707;2001070848;B06000;LESAO CORPORAL;RUA QUARENTA E S;84;302843;6/2/2001 10:50:00;INICIATIVA;S;0;NOVO ARAO REIS;BH;614233.65;805810.54;1706
+1708;2001070982;B03000;AMEACA;RUA H;12;78295;6/2/2001 12:20:00;CIDADAO COMUM;S;0;VILA PINHO;BH;601931.42;788161.20;1707
+1709;2001071260;B06000;LESAO CORPORAL;RUA SAO GERALDO;275;170283;6/2/2001 15:35:00;CIDADAO COMUM;S;;CABANA;BH;604775.39;793964.32;1708
+1710;2001071267;B06000;LESAO CORPORAL;RUA JACAREI;353;13154;6/2/2001 15:40:00;INICIATIVA;N;0;COQUEIROS;BH;602568.63;798483.85;1709
+1711;2001071341;B06000;LESAO CORPORAL;RUA DOS TUPIS;666;69965;6/2/2001 16:18:00;INICIATIVA;N;0;BARRO PRETO;BH;610636.56;797022.10;1710
+1712;2001071412;B06000;LESAO CORPORAL;RUA SILVEIRA MAR;283;65977;6/2/2001 16:56:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609501.21;800093.16;1711
+1713;2001071474;B03000;AMEACA;RUA MARIANO PROC;997;44424;6/2/2001 17:33:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604645.59;796389.21;1712
+1714;2001071545;B03000;AMEACA;RUA OLAVO BILAC;311;49660;6/2/2001 18:15:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607863.74;807696.64;1713
+1715;2001071609;B03000;AMEACA;RUA DA FLAGELACA;123;56042;6/2/2001 18:53:00;CIDADAO COMUM;S;CAFRENT;SAO JOSE;BH;605589.94;798801.47;1714
+1716;2001071644;B03000;AMEACA;RUA JOSE JOAO GA;109;24551;6/2/2001 19:08:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600794.39;787466.77;1715
+1717;2001071645;B03000;AMEACA;AV ALTAMIRO AVEL;391;122937;6/2/2001 19:08:00;CIDADAO COMUM;N;0;CASTELO;BH;604570.40;801462.65;1716
+1718;2001071740;B06000;LESAO CORPORAL;AV OIAPOQUE;284;49166;6/2/2001 19:56:00;INICIATIVA;S;0;CENTRO (BH);BH;610899.84;797829.02;1717
+1719;2001071754;B03000;AMEACA;AV NOSSA SENHORA;344;48311;6/2/2001 20:00:00;CIDADAO COMUM;S;CAFR;PRIMEIRO DE NOVE;BH;612802.94;805193.38;1718
+1720;2001071788;B03000;AMEACA;AV DOS ANDRADAS;3520;3761;6/2/2001 20:21:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613892.46;797180.43;1719
+1721;2001071831;B04001;HOMICIDIO TENTAD;RUA ELIAS SALIBA;202;58961;6/2/2001 20:50:00;CIDADAO COMUM;S;0;NOVO GLORIA;BH;602991.88;798853.32;1720
+1722;2001071855;B02000;RIXA;AV PRESIDENTE AN;3860;4461;6/2/2001 21:06:00;INICIATIVA;N;0;CACHOEIRINHA;BH;609645.14;802028.98;1721
+1723;2001071911;B03000;AMEACA;RUA TAMBORIL;536;66793;6/2/2001 21:33:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611236.65;799260.64;1722
+1724;2001071966;B04002;HOMICIDIO CONSUM;RUA TEBAS;892;67090;6/2/2001 21:57:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616165.12;798336.16;1723
+1725;2001072104;B06000;LESAO CORPORAL;RUA JOAQUIM SOAR;466;38190;6/2/2001 23:17:00;CIDADAO COMUM;S;0;FLORAMAR;BH;612307.60;805870.83;1724
+1726;2001072156;B03000;AMEACA;RUA UM;32;27979;6/2/2001 23:45:00;CIDADAO COMUM;N;CAA;CAPITAO EDUARDO;BH;618614.13;806901.22;1725
+1727;2001072171;B04001;HOMICIDIO TENTAD;RUA TENENTE JOAO;85;113450;6/2/2001 23:57:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611899.67;807534.07;1726
+1728;2001072180;B06000;LESAO CORPORAL;AV XIMANGO;600;73856;7/2/2001 00:07:00;INICIATIVA;S;;FLAVIO MARQUES D;BH;604518.35;788396.04;1727
+1729;2001072227;B06000;LESAO CORPORAL;AV OLEGARIO MACI;459;49699;7/2/2001 00:38:00;INICIATIVA;S;0;CENTRO (BH);BH;610594.57;797209.17;1728
+1730;2001072257;B03000;AMEACA;RUA DUARTINA;420;29278;7/2/2001 01:12:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614879.93;800739.70;1729
+1731;2001072274;B03000;AMEACA;AV OLEGARIO MACI;642;49699;7/2/2001 01:25:00;CIDADAO COMUM;S;PR642;CENTRO (BH);BH;610498.04;797083.99;1730
+1732;2001072352;B06000;LESAO CORPORAL;RUA MANOEL CAYLL;121;43043;7/2/2001 02:27:00;CIDADAO COMUM;N;;HORTO;BH;613259.68;798134.49;1731
+1733;2001072388;B04001;HOMICIDIO TENTAD;AV BERNARDO MONT;367;9392;7/2/2001 02:58:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;612374.91;796851.89;1732
+1734;2001072431;B03000;AMEACA;RUA GERALDO PEDR;337;106315;7/2/2001 03:48:00;CIDADAO COMUM;S;;NOVA YORK;BH;608385.57;811231.11;1733
+1735;2001072458;B03000;AMEACA;RUA MACEDONIA;131;38289;7/2/2001 04:19:00;CIDADAO COMUM;N;CAA;COQUEIROS;BH;603334.57;799872.76;1734
+1736;2001072492;B03000;AMEACA;AV ELIAS ANTONIO;490;104726;7/2/2001 06:00:00;CIDADAO COMUM;N;AP401;LETICIA;BH;607244.80;809413.40;1735
+1737;2001072557;B03000;AMEACA;RUA RAMIRO SIQUE;19;128858;7/2/2001 07:26:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617768.11;797161.56;1736
+1738;2001072590;B03000;AMEACA;RUA ALCIDES LINS;455;1914;7/2/2001 07:55:00;CIDADAO COMUM;S;ESCOLA STOS DUMO;VILA SANTO ANTON;BH;609186.90;808524.24;1737
+1739;2001072670;B03000;AMEACA;RUA ITAMARATI;250;48277;7/2/2001 08:58:00;CIDADAO COMUM;N;BAR NOSSO BARZIN;PIRATININGA;BH;605206.37;808939.33;1738
+1740;2001072672;B03000;AMEACA;RUA A;330;41110;7/2/2001 08:59:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602965.99;802835.21;1739
+1741;2001072747;B03000;AMEACA;RUA CORCOVADO;833;14894;7/2/2001 10:08:00;CIDADAO COMUM;S;AP301;JARDIM AMERICA;BH;607334.53;794302.08;1740
+1742;2001072774;B06000;LESAO CORPORAL;RUA ITAJUBA;954;35495;7/2/2001 10:19:00;CIDADAO COMUM;N;0;FLORESTA;BH;612190.33;798386.12;1741
+1743;2001072799;B03000;AMEACA;RUA CARMO DO RIO;288;13687;7/2/2001 10:36:00;CIDADAO COMUM;N;;PRADO LOPES;BH;609993.05;798980.09;1742
+1744;2001072875;B06000;LESAO CORPORAL;ALAMEDA EZEQUIEL;225;27446;7/2/2001 11:21:00;INICIATIVA;N;0;CENTRO (BH);BH;611899.54;796686.86;1743
+1745;2001072881;B04001;HOMICIDIO TENTAD;RUA INDEPENDENCI;340;34391;7/2/2001 11:26:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;604509.30;794718.09;1744
+1746;2001072907;B03000;AMEACA;RUA DAS PETUNIAS;969;11870;7/2/2001 11:48:00;CIDADAO COMUM;N;;LINDEIA;BH;598921.19;791104.13;1745
+1747;2001072911;B03000;AMEACA;RUA JAGUARIBE;883;36822;7/2/2001 11:53:00;CIDADAO COMUM;S;;CONCORDIA;BH;611378.39;799732.86;1746
+1748;2001072953;B06000;LESAO CORPORAL;RUA DESEMBARGADO;430;116202;7/2/2001 12:26:00;CIDADAO COMUM;S;;DONA CLARA;BH;610723.18;803594.67;1747
+1749;2001072956;B03000;AMEACA;RUA MONTE CASTEL;66;127234;7/2/2001 12:30:00;CIDADAO COMUM;S;;VILA OESTE;BH;604489.89;795257.80;1748
+1750;2001072970;B04001;HOMICIDIO TENTAD;RUA MUNIZ;149;170850;7/2/2001 12:38:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608113.39;793880.88;1749
+1751;2001073159;B03000;AMEACA;RUA ARAGUARI;628;5376;7/2/2001 14:48:00;INICIATIVA;S;INICIATIVA DA VP;BARRO PRETO;BH;609954.68;796706.40;1750
+1752;2001073181;B03000;AMEACA;RUA URSULA PAULI;1442;71066;7/2/2001 15:03:00;CIDADAO COMUM;S;0;BETANIA;BH;605777.81;792682.47;1751
+1753;2001073272;B03000;AMEACA;RUA IPE;345;34767;7/2/2001 15:44:00;CIDADAO COMUM;N;0;SAO CRISTOVAO;BH;610494.64;799268.14;1752
+1754;2001073357;B06000;LESAO CORPORAL;RUA CATALUNHA;443;14204;7/2/2001 16:18:00;CIDADAO COMUM;S;0;SARANDI (URCA/BH;BH;603933.81;802539.25;1753
+1755;2001073400;B03000;AMEACA;RUA EXPEDICIONAR;48;31627;7/2/2001 16:43:00;CIDADAO COMUM;N;;MARIA GORETTI;BH;614332.83;803360.97;1754
+1756;2001073819;B04002;HOMICIDIO CONSUM;RUA CINCO;52;78037;7/2/2001 20:40:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601318.63;786154.43;1755
+1757;2001073820;B06000;LESAO CORPORAL;AV DOM JOSE GASP;500;22339;7/2/2001 20:40:00;CIDADAO COMUM;N;CSA;CORACAO EUCARIST;BH;605797.97;796894.62;1756
+1758;2001073833;B03000;AMEACA;ALAMEDA EZEQUIEL;345;27446;7/2/2001 20:46:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611840.81;796451.07;1757
+1759;2001073843;B03000;AMEACA;RUA AMERICANOS;50;3254;7/2/2001 20:52:00;CIDADAO COMUM;S;;FAZENDINHA;BH;603722.29;790086.11;1758
+1760;2001073861;B04001;HOMICIDIO TENTAD;AV AMINTAS JAQUE;60;52546;7/2/2001 21:00:00;CIDADAO COMUM;N;0;COQUEIROS;BH;603487.16;799877.67;1759
+1761;2001073930;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;1982;17228;7/2/2001 21:39:00;CIDADAO COMUM;S;FR2107;CENTRO (BH);BH;612352.69;797370.37;1760
+1762;2001073945;B06000;LESAO CORPORAL;RUA 36;194;302834;7/2/2001 21:45:00;CIDADAO COMUM;S;REF:POSTO FELIPE;NOVO AARAO REIS;BH;613827.91;805532.46;1761
+1763;2001073956;B03000;AMEACA;RUA HELIO RODRIG;304;32950;7/2/2001 21:52:00;CIDADAO COMUM;N;0;BOA VISTA;BH;614343.25;800026.03;1762
+1764;2001073991;B06000;LESAO CORPORAL;RUA ROSEIRAL;54;59416;7/2/2001 22:12:00;CIDADAO COMUM;N;CS;SANTO ANDRE;BH;609832.66;799191.69;1763
+1765;2001074002;B03000;AMEACA;AV AUGUSTO DE LI;1096;6731;7/2/2001 22:17:00;CIDADAO COMUM;S;PX1096;BARRO PRETO;BH;610281.56;796840.01;1764
+1766;2001074043;B06000;LESAO CORPORAL;RUA FREI VICENTE;247;30029;7/2/2001 22:42:00;INICIATIVA;S;0;SANTA MONICA;BH;607277.72;807964.07;1765
+1767;2001074066;B03000;AMEACA;RUA SOROR ANA AN;70;19337;7/2/2001 22:59:00;CIDADAO COMUM;N;;CAMPO ALEGRE;BH;610387.80;807162.63;1766
+1768;2001074150;B02000;RIXA;RUA VICENTINA DE;549;71891;7/2/2001 23:52:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613595.79;798515.06;1767
+1769;2001074222;B08000;VIOLACAO DE DOMI;RUA MARMORE;614;44695;8/2/2001 00:48:00;CIDADAO COMUM;N;CSFU;SANTA TEREZA;BH;613418.76;797408.02;1768
+1770;2001074246;B06000;LESAO CORPORAL;AV PARANA;39;52230;8/2/2001 01:04:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610859.45;797471.75;1769
+1771;2001074658;B03000;AMEACA;RUA H;7;78295;8/2/2001 09:19:00;CIDADAO COMUM;S;;VILA PINHO;BH;601974.30;788329.06;1770
+1772;2001074721;B03000;AMEACA;AV BIAS FORTES;1035;9553;8/2/2001 10:03:00;CIDADAO COMUM;S;;LOURDES;BH;610553.39;796535.86;1771
+1773;2001074812;B03000;AMEACA;AV BARAO HOMEM D;1884;7936;8/2/2001 11:00:00;CIDADAO COMUM;S;;LEONINA;BH;608064.83;793456.63;1772
+1774;2001074849;B03000;AMEACA;AV NOSSA SENHORA;879;47996;8/2/2001 11:33:00;INICIATIVA;S;;CARMO;BH;611483.97;793937.14;1773
+1775;2001074858;B03000;AMEACA;RUA JOSE LAPORTE;237;123826;8/2/2001 11:37:00;INICIATIVA;S;;ESTORIL;BH;608574.77;792517.75;1774
+1776;2001074914;B03000;AMEACA;RUA PARIS;107;52316;8/2/2001 12:19:00;CIDADAO COMUM;N;0;COPACABANA;BH;606011.45;806325.41;1775
+1777;2001074943;B03000;AMEACA;RUA DOUTOR CEZAR;97;80962;8/2/2001 12:39:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605438.05;793395.99;1776
+1778;2001075012;B03000;AMEACA;AV FURQUIM WERNE;80;650;8/2/2001 13:20:00;CIDADAO COMUM;S;LJA;TUPI;BH;613037.46;805818.71;1777
+1779;2001075034;B03000;AMEACA;AV DOM JOAO VI;784;22294;8/2/2001 13:37:00;CIDADAO COMUM;S;CAFR;CINQUENTENARIO;BH;606589.71;791888.93;1778
+1780;2001075122;B03000;AMEACA;AV ARTUR BERNARD;1180;60844;8/2/2001 14:39:00;CIDADAO COMUM;S;0;VILA PARIS;BH;610180.14;793263.99;1779
+1781;2001075157;B06000;LESAO CORPORAL;RUA PONTA PORA;295;54601;8/2/2001 15:04:00;CIDADAO COMUM;S;PX36;SANTA EFIGENIA;BH;613215.57;796976.97;1780
+1782;2001075175;B06000;LESAO CORPORAL;RUA IBIRAPITANGA;59;33880;8/2/2001 15:14:00;CIDADAO COMUM;S;0;DOM CABRAL;BH;605182.78;796323.06;1781
+1783;2001075204;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;8/2/2001 15:31:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;1782
+1784;2001075207;B03000;AMEACA;AV GUANABARA;312;93400;8/2/2001 15:34:00;CIDADAO COMUM;N;CA312;SARANDI (URCA/BH;BH;602854.58;802637.55;1783
+1785;2001075232;B03000;AMEACA;RUA CURITIBA;914;19090;8/2/2001 15:47:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610779.71;797017.51;1784
+1786;2001075335;B06000;LESAO CORPORAL;RUA CARMELA ALUO;249;13558;8/2/2001 16:58:00;CIDADAO COMUM;N;0;ARAGUAIA;BH;605218.59;789628.45;1785
+1787;2001075348;B03000;AMEACA;RUA IPANEMA;1120;34726;8/2/2001 17:05:00;CIDADAO COMUM;S;0;SARANDI (URCA/BH;BH;602824.51;802350.58;1786
+1788;2001075382;B03000;AMEACA;AV AMINTAS VIDAL;1689;118769;8/2/2001 17:21:00;CIDADAO COMUM;S;AP103;NOVA GAMELEIRA;BH;605235.40;794648.57;1787
+1789;2001075421;B03000;AMEACA;RUA EXPEDICIONAR;500;27096;8/2/2001 17:44:00;CIDADAO COMUM;S;0;SAO LUIZ;BH;606853.89;803084.68;1788
+1790;2001075450;B03000;AMEACA;RUA VISEU;1178;62042;8/2/2001 17:59:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609516.82;802452.66;1789
+1791;2001075465;B06000;LESAO CORPORAL;RUA JACUI;1467;36734;8/2/2001 18:08:00;CIDADAO COMUM;N;;CONCORDIA;BH;611633.01;799247.97;1790
+1792;2001075469;B03000;AMEACA;RUA INACIO MURTA;156;34322;8/2/2001 18:10:00;CIDADAO COMUM;S;CA18;COPACABANA;BH;606337.97;805563.86;1791
+1793;2001075470;B06000;LESAO CORPORAL;RUA GERALDO FERR;170;96222;8/2/2001 18:11:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606278.02;810733.96;1792
+1794;2001075486;B03000;AMEACA;RUA YUCATAN;70;36302;8/2/2001 18:17:00;POLICIAL MILITAR;S;0;SAO PEDRO;BH;611188.45;793833.06;1793
+1795;2001075493;B06000;LESAO CORPORAL;RUA JOSE ANTONIO;62;80483;8/2/2001 18:24:00;CIDADAO COMUM;S;;JARDIM ALVORADA;BH;606114.48;800215.54;1794
+1796;2001075514;B06000;LESAO CORPORAL;RUA SAO CRISTOVA;70;25378;8/2/2001 18:35:00;CIDADAO COMUM;N;;TAQUARIL;BH;617039.20;797453.04;1795
+1797;2001075541;B06000;LESAO CORPORAL;RUA M;3;27184;8/2/2001 18:49:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616370.43;806971.69;1796
+1798;2001075618;B03000;AMEACA;RUA JOSE BERNARD;41;83251;8/2/2001 19:26:00;CIDADAO COMUM;N;;SANTA HELENA (BH;BH;603509.72;789328.98;1797
+1799;2001075724;B06000;LESAO CORPORAL;RUA AARAO REIS;194;473;8/2/2001 20:30:00;INICIATIVA;S;0;CENTRO BH;BH;611579.10;797272.30;1798
+1800;2001075739;B03000;AMEACA;RUA V;176;118150;8/2/2001 20:40:00;CIDADAO COMUM;S;;CH TUNEL DE IBIR;BH;599765.67;789621.94;1799
+1801;2001075749;B06000;LESAO CORPORAL;RUA ENGENHO DA E;69;94977;8/2/2001 20:46:00;CIDADAO COMUM;N;CAFU;ENGENHO NOGUEIRA;BH;606438.46;800149.67;1800
+1802;2001075751;B03000;AMEACA;RUA SAUDE;252;64164;8/2/2001 20:47:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605595.24;797841.46;1801
+1803;2001075797;B03000;AMEACA;RUA PEDRO AMERIC;320;113157;8/2/2001 21:14:00;CIDADAO COMUM;S;CSFR;TUPI;BH;613781.51;806534.29;1802
+1804;2001075805;B04001;HOMICIDIO TENTAD;RUA ROMA;105;59227;8/2/2001 21:18:00;CIDADAO COMUM;S;;COPACABANA;BH;606318.49;806279.57;1803
+1805;2001075811;B03000;AMEACA;RUA PROFESSOR AI;808;72608;8/2/2001 21:21:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608500.71;807940.36;1804
+1806;2001076026;B03000;AMEACA;AV ITAITE;504;35441;8/2/2001 23:04:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615257.50;799429.25;1805
+1807;2001076062;B06000;LESAO CORPORAL;RUA SAO CRISTOVA;199;62229;8/2/2001 23:19:00;CIDADAO COMUM;N;0;SAO BERNARDO;BH;610869.22;805058.68;1806
+1808;2001076067;B03000;AMEACA;RUA GENTIOS;1350;30983;8/2/2001 23:19:00;INICIATIVA;S;HT 124.14 SD MAR;CORACAO DE JESUS;BH;608905.13;793585.28;1807
+1809;2001076070;B06000;LESAO CORPORAL;RUA A;128;78673;8/2/2001 23:26:00;CIDADAO COMUM;N;;CH JATOBA IV;BH;600210.63;787810.91;1808
+1810;2001076075;B06000;LESAO CORPORAL;AV AGENOR DE PAU;280;86250;8/2/2001 23:28:00;POLICIAL MILITAR;N;0;JAQUELINE;BH;611517.37;810264.32;1809
+1811;2001076103;B03000;AMEACA;RUA BARAO DE LEO;330;7964;8/2/2001 23:41:00;CIDADAO COMUM;N;;ALTO DOS PINHEIR;BH;604194.18;796281.95;1810
+1812;2001076111;B03000;AMEACA;RUA FREI MARTINH;42;94154;8/2/2001 23:45:00;CIDADAO COMUM;S;0;PAQUETA;BH;605242.03;802751.03;1811
+1813;2001076231;B06000;LESAO CORPORAL;RUA NICOLINA DE ;15;44263;9/2/2001 01:45:00;INICIATIVA;S;0;HAVAI;BH;607302.26;793743.23;1812
+1814;2001076252;B04001;HOMICIDIO TENTAD;RUA JOAQUIM GOUV;10;1422;9/2/2001 01:55:00;INICIATIVA;S;0;SAO PAULO;BH;612535.79;802867.60;1813
+1815;2001076323;B03000;AMEACA;RUA CORONEL NEWT;332;124872;9/2/2001 02:51:00;CIDADAO COMUM;S;0;MANGUEIRAS;BH;600855.58;786772.21;1814
+1816;2001076328;B03000;AMEACA;RUA POTOMAIO;658;54920;9/2/2001 02:57:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;615643.99;799123.70;1815
+1817;2001076354;B06000;LESAO CORPORAL;RUA DIVINO ESPIR;75;96768;9/2/2001 03:27:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;614662.44;806404.94;1816
+1818;2001076375;B06000;LESAO CORPORAL;AV URUGUAI;96;71113;9/2/2001 03:46:00;CIDADAO COMUM;N;0;SION;BH;611525.36;793887.62;1817
+1819;2001076612;B03000;AMEACA;RUA JOAO BATISTA;60;97745;9/2/2001 08:47:00;CIDADAO COMUM;N;;DOM SILVERIO;BH;614734.92;804019.88;1818
+1820;2001076653;B03000;AMEACA;RUA PADRE EUSTAQ;1255;51294;9/2/2001 09:25:00;CIDADAO COMUM;N;LJ02;CARLOS PRATES;BH;608384.30;797938.60;1819
+1821;2001076722;B03000;AMEACA;RUA COPO DE LEIT;40;98606;9/2/2001 10:24:00;CIDADAO COMUM;S;;VILA FREI LEOPOL;BH;611148.28;809422.81;1820
+1822;2001076772;B03000;AMEACA;AV DOM JOAO VI;784;22294;9/2/2001 10:54:00;CIDADAO COMUM;S;CAFR;CINQUENTENARIO;BH;606589.71;791888.93;1821
+1823;2001076992;B06000;LESAO CORPORAL;RUA YUCATAN;70;36302;9/2/2001 13:46:00;INICIATIVA;S;;SAO PEDRO;BH;611188.45;793833.06;1822
+1824;2001077010;B03000;AMEACA;RUA AMERICO MART;310;46228;9/2/2001 14:01:00;CIDADAO COMUM;N;;MINASLANDIA;BH;612269.47;804162.89;1823
+1825;2001077087;B06000;LESAO CORPORAL;RUA GERALDO FERR;78;96222;9/2/2001 14:56:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606284.84;810641.13;1824
+1826;2001077237;B04001;HOMICIDIO TENTAD;AV SILVA LOBO;2425;65889;9/2/2001 16:24:00;INICIATIVA;S;0;GRAJAU;BH;608493.57;794563.18;1825
+1827;2001077285;B04002;HOMICIDIO CONSUM;RUA CAMILA DE SO;100;74294;9/2/2001 16:52:00;CIDADAO COMUM;N;0;SAO JOAO BATISTA;BH;608167.22;807611.94;1826
+1828;2001077311;B06000;LESAO CORPORAL;RUA QUITANDINHA;176;57600;9/2/2001 17:11:00;POLICIAL MILITAR;S;0;SERRANO;BH;603414.69;800598.96;1827
+1829;2001077333;B06000;LESAO CORPORAL;RUA PADRE CORREA;327;51266;9/2/2001 17:26:00;CIDADAO COMUM;S;PX327;SANTA EFIGENIA;BH;614030.80;796078.14;1828
+1830;2001077417;B06000;LESAO CORPORAL;RUA CONCHAS;196;80178;9/2/2001 18:11:00;CIDADAO COMUM;N;;COQUEIROS;BH;602671.11;799789.15;1829
+1831;2001077449;B06000;LESAO CORPORAL;RUA ERNESTO TOGN;37;129850;9/2/2001 18:29:00;CIDADAO COMUM;N;0;GORDURAS;BH;616207.37;803889.32;1830
+1832;2001077475;B03000;AMEACA;RUA VASCO BALBOA;507;102396;9/2/2001 18:47:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616645.98;797621.02;1831
+1833;2001077521;B04001;HOMICIDIO TENTAD;RUA SERRINHA;19;129201;9/2/2001 19:13:00;CIDADAO COMUM;N;0;INDEPENDENCIA;BH;600519.25;786719.95;1832
+1834;2001077570;B04001;HOMICIDIO TENTAD;RUA DEZOITO;47;80225;9/2/2001 19:41:00;INICIATIVA;S;0;NOVA CINTRA;BH;605380.91;793339.84;1833
+1835;2001077754;B03000;AMEACA;RUA E;25;24609;9/2/2001 21:14:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613409.70;798697.81;1834
+1836;2001077877;B03000;AMEACA;AV AMINTAS JAQUE;131;52546;9/2/2001 22:26:00;CIDADAO COMUM;N;;COQUEIROS;BH;602749.04;799120.63;1835
+1837;2001077892;B03000;AMEACA;RUA CLOTILDE RIB;12;72507;9/2/2001 22:35:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608811.96;807889.70;1836
+1838;2001077894;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;527;31400;9/2/2001 22:37:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610800.99;796803.14;1837
+1839;2001077922;B04001;HOMICIDIO TENTAD;RUA DES BRAULIO;1522;19917;9/2/2001 22:52:00;INICIATIVA;N;0;VERA CRUZ;BH;616275.72;797731.58;1838
+1840;2001077945;B06000;LESAO CORPORAL;RUA GOIAS;58;31393;9/2/2001 23:01:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611325.19;796598.30;1839
+1841;2001078018;B06000;LESAO CORPORAL;RUA BRASIL;15;10446;9/2/2001 23:45:00;CIDADAO COMUM;S;;CABANA;BH;604813.51;793739.13;1840
+1842;2001078030;B03000;AMEACA;RUA PRINCESA LEO;110;55327;9/2/2001 23:54:00;CIDADAO COMUM;S;FU;IPIRANGA;BH;611523.35;801138.47;1841
+1843;2001078141;B03000;AMEACA;RUA ESTEVAO MUSS;227;26327;10/2/2001 00:49:00;CIDADAO COMUM;S;;NOVA GAMELEIRA;BH;605568.02;794405.75;1842
+1844;2001078189;B03000;AMEACA;RUA JOSE FERREIR;80;69650;10/2/2001 01:16:00;CIDADAO COMUM;N;;FLORAMAR;BH;611705.38;806398.85;1843
+1845;2001078203;B03000;AMEACA;AV SARAMENHA;1150;64007;10/2/2001 01:24:00;CIDADAO COMUM;S;;GUARANI;BH;612916.89;805724.57;1844
+1846;2001078255;B03000;AMEACA;RUA DELFIM MOREI;11;19730;10/2/2001 01:53:00;CIDADAO COMUM;N;0;BOA VISTA;BH;614618.57;800009.25;1845
+1847;2001078280;B06000;LESAO CORPORAL;RUA OSWALDO JOSE;50;20160;10/2/2001 02:10:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609180.23;809203.87;1846
+1848;2001078281;B04001;HOMICIDIO TENTAD;RUA DOUTOR CRIST;390;55598;10/2/2001 02:12:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604864.19;789415.74;1847
+1849;2001078285;B06000;LESAO CORPORAL;RUA CARLOS ESTEV;7;74496;10/2/2001 02:15:00;INICIATIVA;S;0;TUPI;BH;612542.70;806590.74;1848
+1850;2001078305;B06000;LESAO CORPORAL;RUA DOS VIOLINOS;340;101797;10/2/2001 02:29:00;CIDADAO COMUM;N;;CH CALIFORNIA;BH;603894.90;796720.96;1849
+1851;2001078317;B06000;LESAO CORPORAL;AV JOSE LOPES MU;101;19176;10/2/2001 02:34:00;INICIATIVA;S;L;FLORAMAR;BH;611566.94;806488.49;1850
+1852;2001078346;B06000;LESAO CORPORAL;RUA PADUA;280;51745;10/2/2001 02:54:00;INICIATIVA;S;0;MARIA VIRGINIA;BH;611522.89;802814.14;1851
+1853;2001078410;B02000;RIXA;RUA RAIMUNDO MAG;88;57801;10/2/2001 03:31:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614095.77;803555.29;1852
+1854;2001078422;B03000;AMEACA;AV CORONEL DURVA;652;17688;10/2/2001 03:40:00;CIDADAO COMUM;N;0;DURVAL DE BARROS;BH;598098.20;790874.26;1853
+1855;2001078424;B03000;AMEACA;PRACA CHUI;37;15210;10/2/2001 03:40:00;CIDADAO COMUM;S;B;JOAO PINHEIRO;BH;604582.28;796335.40;1854
+1856;2001078426;B04002;HOMICIDIO CONSUM;RUA MARIANITA;6;101122;10/2/2001 03:40:00;CIDADAO COMUM;S;0;CONJUNTO ALIPIO ;BH;603833.65;799926.48;1855
+1857;2001078457;B02000;RIXA;RUA PARAIBA;993;52170;10/2/2001 04:02:00;CIDADAO COMUM;N;FR993;FUNCIONARIOS;BH;611690.70;795387.82;1856
+1858;2001078490;B03000;AMEACA;RUA DES BRAULIO;1044;19917;10/2/2001 04:26:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616205.73;798039.53;1857
+1859;2001078513;B06000;LESAO CORPORAL;RUA MUNIZ;470;170850;10/2/2001 04:46:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608195.31;793753.03;1858
+1860;2001078614;B06000;LESAO CORPORAL;AV SEN LEVINDO C;1846;14866;10/2/2001 07:02:00;INICIATIVA;S;0;SANTA CECILIA;BH;600957.86;787724.62;1859
+1861;2001078630;B04001;HOMICIDIO TENTAD;RUA JORNALISTA J;222;6470;10/2/2001 07:22:00;CIDADAO COMUM;N;;NOVA CINTRA;BH;606207.46;793674.57;1860
+1862;2001078834;B03000;AMEACA;AV MEM DE SA;1203;45395;10/2/2001 10:22:00;CIDADAO COMUM;N;;PARAISO;BH;614307.18;796365.33;1861
+1863;2001078839;B03000;AMEACA;RUA CASTIGLIANO;377;14056;10/2/2001 10:26:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;607244.05;797116.33;1862
+1864;2001078841;B04002;HOMICIDIO CONSUM;RUA UM;14;27979;10/2/2001 10:27:00;CIDADAO COMUM;N;;CAPITAO EDUARDO;BH;618614.13;806901.22;1863
+1865;2001078880;B03000;AMEACA;RUA ANTONIO JOSE;265;7431;10/2/2001 10:58:00;CIDADAO COMUM;S;INICIATIVA DA MP;CEU AZUL;BH;605135.52;807570.40;1864
+1866;2001078954;B06000;LESAO CORPORAL;RUA CAMOES;400;11971;10/2/2001 12:00:00;CIDADAO COMUM;S;;SAO LUCAS;BH;613224.65;795764.03;1865
+1867;2001078967;B06000;LESAO CORPORAL;RUA TIRADENTES;215;85607;10/2/2001 12:14:00;CIDADAO COMUM;N;0;VILA SAO JORGE;BH;615513.82;802373.44;1866
+1868;2001079037;B03000;AMEACA;RUA SAO PEDRO;169;96046;10/2/2001 12:55:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614537.78;803247.55;1867
+1869;2001079045;B03000;AMEACA;RUA LAMBDA;150;40307;10/2/2001 13:01:00;CIDADAO COMUM;N;0;CAICARA;BH;608190.20;799951.28;1868
+1870;2001079046;B06000;LESAO CORPORAL;RUA JOSE TEIXEIR;210;72995;10/2/2001 13:02:00;CIDADAO COMUM;S;;FLORAMAR;BH;611479.65;807013.94;1869
+1871;2001079083;B03000;AMEACA;RUA NADIR;138;47173;10/2/2001 13:23:00;CIDADAO COMUM;S;0;ADELAIDE;BH;607481.75;798916.11;1870
+1872;2001079097;B03000;AMEACA;RUA RIO DE JANEI;18;58772;10/2/2001 13:34:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611248.04;797676.50;1871
+1873;2001079113;B03000;AMEACA;AV ALVARES CABRA;780;2730;10/2/2001 13:44:00;INICIATIVA;S;0;LOURDES;BH;610742.90;796168.29;1872
+1874;2001079138;B03000;AMEACA;RUA EVARISTO DA ;10;26922;10/2/2001 13:57:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610219.65;798678.72;1873
+1875;2001079201;B06000;LESAO CORPORAL;RUA TEIXEIRAS;40;67222;10/2/2001 14:39:00;CIDADAO COMUM;N;LJB;ERMELINDA;BH;609010.61;801078.91;1874
+1876;2001079258;B03000;AMEACA;RUA SAO TEOFILO;22;105441;10/2/2001 15:33:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616200.84;806211.29;1875
+1877;2001079278;B03000;AMEACA;RUA FREI VICENTE;247;30029;10/2/2001 15:44:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607277.72;807964.07;1876
+1878;2001079318;B06000;LESAO CORPORAL;RUA JACUI;2811;36734;10/2/2001 16:01:00;CIDADAO COMUM;S;;IPIRANGA;BH;611411.53;800497.94;1877
+1879;2001079319;B03000;AMEACA;RUA DA BAHIA;561;81155;10/2/2001 16:01:00;INICIATIVA;S;0;CENTRO (BH);BH;611416.65;797071.68;1878
+1880;2001079321;B03000;AMEACA;AV AUGUSTO DE LI;134;6731;10/2/2001 16:00:00;INICIATIVA;N;0;CENTRO (BH);BH;611209.44;796588.30;1879
+1881;2001079324;B04002;HOMICIDIO CONSUM;RUA REGENCIA;160;301448;10/2/2001 16:03:00;INICIATIVA;N;0;VILA CAFEZAL;BH;614098.82;795476.81;1880
+1882;2001079339;B03000;AMEACA;RUA MUNICIPAL;24;171677;10/2/2001 16:14:00;CIDADAO COMUM;S;;VILA CEMIG;BH;605534.66;788579.65;1881
+1883;2001079375;B06000;LESAO CORPORAL;BECO BELMIRO DIA;15;171015;10/2/2001 16:39:00;CIDADAO COMUM;S;CAFR;CABANA;BH;604778.50;794122.00;1882
+1884;2001079425;B02000;RIXA;RUA PINTOR RENAT;437;26617;10/2/2001 17:03:00;CIDADAO COMUM;N;FU;TUPI;BH;613985.37;806046.29;1883
+1885;2001079426;B06000;LESAO CORPORAL;RUA A;311;78673;10/2/2001 17:02:00;CIDADAO COMUM;S;0;CH JATOBA IV;BH;600108.52;787774.84;1884
+1886;2001079444;B03000;AMEACA;RUA ESTEVAO MUSS;60;26327;10/2/2001 17:12:00;CIDADAO COMUM;S;CAA;NOVA GAMELEIRA;BH;605516.79;794498.15;1885
+1887;2001079478;B03000;AMEACA;RUA CARVALHOS;137;13788;10/2/2001 17:34:00;CIDADAO COMUM;N;CAA;MANGABEIRAS;BH;612119.88;792554.36;1886
+1888;2001079495;B06000;LESAO CORPORAL;RUA ANTONIO MARM;26;102907;10/2/2001 17:45:00;CIDADAO COMUM;N;;CH DA LAGOA;BH;605102.35;802904.34;1887
+1889;2001079500;B03000;AMEACA;RUA MARCO AURELI;127;61821;10/2/2001 17:47:00;CIDADAO COMUM;S;;NAZARE;BH;615586.92;804707.76;1888
+1890;2001079502;B03000;AMEACA;RUA MARCIOS MOUR;280;117306;10/2/2001 17:49:00;CIDADAO COMUM;N;;LINDEIA;BH;600206.92;790444.42;1889
+1891;2001079518;B03000;AMEACA;RUA PADRE JULIO ;1571;51496;10/2/2001 17:55:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616274.14;797626.03;1890
+1892;2001079534;B04001;HOMICIDIO TENTAD;PRACA CARDEAL AR;10;13182;10/2/2001 18:04:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605707.20;793813.75;1891
+1893;2001079582;B06000;LESAO CORPORAL;AV COLETORA;920;78241;10/2/2001 18:31:00;CIDADAO COMUM;S;;VILA PINHO;BH;602212.14;787909.78;1892
+1894;2001079584;B06000;LESAO CORPORAL;RUA MANHUARA;942;42891;10/2/2001 18:31:00;CIDADAO COMUM;S;CACIMA;PROVIDENCIA;BH;612690.19;804281.53;1893
+1895;2001079650;B06000;LESAO CORPORAL;RUA AVILA;26;86739;10/2/2001 19:10:00;CIDADAO COMUM;S;CSB;JARDIM EUROPA;BH;608597.44;810162.74;1894
+1896;2001079661;B03000;AMEACA;RUA CONEGO PINHE;254;16820;10/2/2001 19:17:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;614304.74;797161.13;1895
+1897;2001079668;B03000;AMEACA;RUA CARMO DO RIO;70;13687;10/2/2001 19:23:00;CIDADAO COMUM;N;;PRADO LOPES;BH;609977.20;798867.23;1896
+1898;2001079684;B04001;HOMICIDIO TENTAD;RUA MARZAGANIA;113;88066;10/2/2001 19:33:00;CIDADAO COMUM;S;0;GRANJA FREITAS;BH;617023.58;798845.01;1897
+1899;2001079718;B06000;LESAO CORPORAL;RUA DA RESSURREI;238;58470;10/2/2001 19:52:00;CIDADAO COMUM;S;0;SAO JOSE;BH;605345.40;798739.68;1898
+1900;2001079731;B04002;HOMICIDIO CONSUM;RUA ALICE;100;170949;10/2/2001 19:58:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;607996.88;793885.89;1899
+1901;2001079774;B06000;LESAO CORPORAL;RUA PROFESSOR MI;108;128628;10/2/2001 20:27:00;INICIATIVA;S;0;NOVA ESPERANCA;BH;609336.96;799237.81;1900
+1902;2001079780;B03000;AMEACA;RUA PADRE MANOEL;15;51556;10/2/2001 20:30:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;605001.34;795728.64;1901
+1903;2001079798;B03000;AMEACA;RUA MANOEL PAULI;125;43185;10/2/2001 20:44:00;CIDADAO COMUM;S;;DURVAL DE BARROS;IB;598267.43;791064.47;1902
+1904;2001079848;B06000;LESAO CORPORAL;RUA DINIS DIAS;145;119673;10/2/2001 21:10:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616573.20;797526.82;1903
+1905;2001079851;B04001;HOMICIDIO TENTAD;RUA BATISTA CARN;98;8419;10/2/2001 21:12:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606473.20;794973.26;1904
+1906;2001079885;B03000;AMEACA;RUA TEBAS;670;67090;10/2/2001 21:25:00;INICIATIVA;N;0;VERA CRUZ;BH;615977.89;798300.24;1905
+1907;2001079894;B02000;RIXA;RUA ALCOBACA;1210;62708;10/2/2001 21:30:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;608806.89;801887.18;1906
+1908;2001079932;B06000;LESAO CORPORAL;RUA NIQUELINA;20;47738;10/2/2001 21:56:00;INICIATIVA;N;0;SANTA EFIGENIA;BH;613202.56;796623.13;1907
+1909;2001080034;B03000;AMEACA;RUA SERRA NEGRA;145;65038;10/2/2001 23:05:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610132.74;799274.01;1908
+1910;2001080038;B06000;LESAO CORPORAL;RUA CORONEL ANTO;26;17590;10/2/2001 23:08:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;606351.58;807582.90;1909
+1911;2001080039;B06000;LESAO CORPORAL;AV MENELICK DE C;256;30448;10/2/2001 23:09:00;INICIATIVA;S;0;FLAVIO MARQUES D;BH;604486.70;788882.24;1910
+1912;2001080057;B06000;LESAO CORPORAL;RUA H;432;78295;10/2/2001 23:15:00;CIDADAO COMUM;S;CAA;VILA PINHO;BH;602014.90;788025.16;1911
+1913;2001080082;B03000;AMEACA;RUA CORONEL FULG;186;17750;10/2/2001 23:26:00;CIDADAO COMUM;S;PX186;SAO LUCAS;BH;613210.64;796135.07;1912
+1914;2001080106;B04001;HOMICIDIO TENTAD;RUA ELVIRA AUGUS;461;21222;10/2/2001 23:39:00;POLICIAL MILITAR;N;0;BOA VISTA;BH;615016.28;800012.15;1913
+1915;2001080134;B03000;AMEACA;RUA ARTUR DE SA;564;6211;10/2/2001 23:49:00;CIDADAO COMUM;S;;UNIAO;BH;612425.80;801529.08;1914
+1916;2001080164;B04001;HOMICIDIO TENTAD;RUA PITANGUI;4000;54365;11/2/2001 00:02:00;CIDADAO COMUM;S;0;ESPLANADA;BH;614196.00;798230.33;1915
+1917;2001080172;B06000;LESAO CORPORAL;RUA MONTE CARMEL;197;46420;11/2/2001 00:08:00;CIDADAO COMUM;S;AP04;FLORESTA;BH;612341.65;798167.69;1916
+1918;2001080180;B06000;LESAO CORPORAL;RUA CAMPOS SALES;472;12300;11/2/2001 00:12:00;INICIATIVA;S;0;NOVA SUISSA;BH;607050.85;796279.60;1917
+1919;2001080182;B04002;HOMICIDIO CONSUM;RUA EMIDIO FURTA;737;108525;11/2/2001 00:10:00;INICIATIVA;N;0;LETICIA;BH;606802.06;809377.86;1918
+1920;2001080200;B06000;LESAO CORPORAL;RODOVIA MGT 262;1060;26598;11/2/2001 00:21:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614799.23;802174.37;1919
+1921;2001080240;B03000;AMEACA;RUA JOSUE MENEZE;255;72982;11/2/2001 00:41:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605384.39;795273.46;1920
+1922;2001080247;B06000;LESAO CORPORAL;AV NOSSA SENHORA;3126;48107;11/2/2001 00:46:00;INICIATIVA;S;0;CARLOS PRATES;BH;608689.07;797282.61;1921
+1923;2001080259;B03000;AMEACA;RUA DAS VERBENAS;752;71545;11/2/2001 00:52:00;CIDADAO COMUM;N;;LINDEIA;BH;598936.24;790800.47;1922
+1924;2001080261;B04001;HOMICIDIO TENTAD;RUA RIO JORDAO;258;124816;11/2/2001 00:52:00;CIDADAO COMUM;N;0;CRISTO REDENTOR;BH;605093.51;790501.88;1923
+1925;2001080318;B04001;HOMICIDIO TENTAD;RUA EXPEDICIONAR;65;19570;11/2/2001 01:17:00;INICIATIVA;S;0;MARIA GORETTI;BH;614141.03;803465.87;1924
+1926;2001080406;B04002;HOMICIDIO CONSUM;RUA ANAPURUS;32;20894;11/2/2001 01:56:00;CIDADAO COMUM;N;0;SAO GABRIEL;BH;613070.65;804032.62;1925
+1927;2001080426;B06000;LESAO CORPORAL;RUA SAO VICENTE;16;88126;11/2/2001 02:04:00;CIDADAO COMUM;S;BLOCO 300;GRANJA FREITAS;BH;617082.39;798490.25;1926
+1928;2001080486;B06000;LESAO CORPORAL;RUA JOAO PROCOPI;282;69070;11/2/2001 02:39:00;CIDADAO COMUM;S;;JARDIM ALVORADA;BH;606052.66;800374.59;1927
+1929;2001080515;B06000;LESAO CORPORAL;RUA FLOR DO NATA;166;28741;11/2/2001 02:55:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;606469.77;798943.26;1928
+1930;2001080526;B06000;LESAO CORPORAL;RUA PERNAMBUCO;514;53463;11/2/2001 02:59:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611607.37;795755.17;1929
+1931;2001080528;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;955;40770;11/2/2001 03:00:00;INICIATIVA;N;0;VERA CRUZ;BH;615259.66;798008.79;1930
+1932;2001080529;B04001;HOMICIDIO TENTAD;RUA TEN ANASTACI;550;67263;11/2/2001 03:00:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613431.12;796565.01;1931
+1933;2001080534;B03000;AMEACA;RUA INACIO PARRE;389;21730;11/2/2001 03:02:00;CIDADAO COMUM;S;;ESTRELA DALVA;BH;607308.18;792108.65;1932
+1934;2001080537;B06000;LESAO CORPORAL;RUA EXPEDICIONAR;95;27418;11/2/2001 03:03:00;CIDADAO COMUM;N;0;ADELAIDE;BH;607416.33;798153.36;1933
+1935;2001080567;B06000;LESAO CORPORAL;RUA JOAO GUALBER;16;20450;11/2/2001 03:21:00;CIDADAO COMUM;N;0;CEU AZUL;BH;605094.97;807593.39;1934
+1936;2001080617;B02000;RIXA;AV OTACILIO NEGR;11840;50566;11/2/2001 03:48:00;CIDADAO COMUM;N;;TREVO;BH;604861.56;805383.18;1935
+1937;2001080632;B03000;AMEACA;AV BRIGADEIRO ED;1080;2860;11/2/2001 03:55:00;POLICIAL MILITAR;N;0;GLORIA;BH;604212.05;798647.23;1936
+1938;2001080650;B06000;LESAO CORPORAL;AV SEN LEVINDO C;4405;14866;11/2/2001 04:07:00;CIDADAO COMUM;N;0;CH VALE DO JATOB;BH;601253.14;786620.47;1937
+1939;2001080675;B06000;LESAO CORPORAL;RUA M;46;78790;11/2/2001 04:24:00;CIDADAO COMUM;S;;CH JATOBA IV;BH;600650.50;787805.22;1938
+1940;2001080688;B06000;LESAO CORPORAL;RUA DR PEDRO RUE;280;113853;11/2/2001 04:36:00;CIDADAO COMUM;S;0;LETICIA;BH;606912.50;809559.22;1939
+1941;2001080747;B03000;AMEACA;RUA PAULO ALVES ;18;24580;11/2/2001 05:18:00;CIDADAO COMUM;N;0;CH VALE DO JATOB;BH;600632.65;787523.33;1940
+1942;2001080779;B03000;AMEACA;RUA STA CATARINA;655;60400;11/2/2001 05:43:00;INICIATIVA;N;0;LOURDES;BH;610491.35;796335.53;1941
+1943;2001080781;B03000;AMEACA;AV CIVILIZACAO;90;51657;11/2/2001 05:45:00;CIDADAO COMUM;S;;LEBLON;BH;605103.49;810060.35;1942
+1944;2001080785;B06000;LESAO CORPORAL;RUA HUMAITA;1040;33562;11/2/2001 05:49:00;CIDADAO COMUM;N;LJ;PADRE EUSTAQUIO;BH;606604.09;797013.74;1943
+1945;2001080797;B03000;AMEACA;PRACA QUINZE DE ;9;57565;11/2/2001 06:06:00;INICIATIVA;N;0;BONFIM;BH;609834.50;798492.95;1944
+1946;2001080809;B04002;HOMICIDIO CONSUM;RUA MANHUMIRIM;808;42908;11/2/2001 06:23:00;CIDADAO COMUM;N;0;ADELAIDE;BH;607843.93;798076.55;1945
+1947;2001080827;B03000;AMEACA;RUA SAO MIGUEL;1501;63410;11/2/2001 06:50:00;INICIATIVA;S;0;ITAPOA;BH;609533.82;805627.88;1946
+1948;2001080880;B06000;LESAO CORPORAL;PRACA RAUL SOARE;423;58010;11/2/2001 07:46:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610510.71;796848.26;1947
+1949;2001080911;B06000;LESAO CORPORAL;AV AMAZONAS;166;3140;11/2/2001 08:17:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611331.41;797309.82;1948
+1950;2001080958;B03000;AMEACA;RUA MARIA DE LOU;585;20765;11/2/2001 08:44:00;CIDADAO COMUM;N;;LETICIA;BH;607064.26;809882.88;1949
+1951;2001080969;B06000;LESAO CORPORAL;RUA GUIDO CIOLET;40;19440;11/2/2001 08:55:00;CIDADAO COMUM;N;;BARREIRO;BH;602909.44;790423.89;1950
+1952;2001080977;B06000;LESAO CORPORAL;AV AMINTAS JAQUE;175;52546;11/2/2001 09:00:00;CIDADAO COMUM;N;0;COQUEIROS;BH;603381.96;799800.15;1951
+1953;2001081007;B03000;AMEACA;RUA ALECRIM DA S;15;105596;11/2/2001 09:30:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615935.58;806050.26;1952
+1954;2001081030;B06000;LESAO CORPORAL;RUA ROCHA PITA;409;59000;11/2/2001 09:49:00;CIDADAO COMUM;S;;POMPEIA;BH;615026.15;797886.50;1953
+1955;2001081040;B06000;LESAO CORPORAL;RUA ANTONIO SIMI;80;118526;11/2/2001 09:56:00;CIDADAO COMUM;S;;REGINA;BH;598646.53;790272.89;1954
+1956;2001081042;B06000;LESAO CORPORAL;RUA FORMIGA;50;29136;11/2/2001 09:55:00;CIDADAO COMUM;N;;LAGOINHA;BH;610336.11;798756.88;1955
+1957;2001081053;B04001;HOMICIDIO TENTAD;RUA JUNQUILHOS;1234;39657;11/2/2001 10:09:00;CIDADAO COMUM;N;;JARDIM AMERICA;BH;607397.31;795111.26;1956
+1958;2001081068;B06000;LESAO CORPORAL;RUA MANGARATIBA;238;42822;11/2/2001 10:24:00;INICIATIVA;S;0;SAO GERALDO;BH;614996.90;799256.76;1957
+1959;2001081076;B06000;LESAO CORPORAL;AV BASILIO DA GA;385;8361;11/2/2001 10:31:00;CIDADAO COMUM;N;;TUPI;BH;613167.64;805972.52;1958
+1960;2001081090;B06000;LESAO CORPORAL;RUA ENCANTADO;269;25453;11/2/2001 10:42:00;CIDADAO COMUM;S;;CAICARA;BH;607644.74;799420.19;1959
+1961;2001081100;B03000;AMEACA;RUA CALIFORNIA;831;11653;11/2/2001 10:48:00;INICIATIVA;S;0;SION;BH;611481.57;793037.66;1960
+1962;2001081128;B03000;AMEACA;RUA FRANCISCO GO;64;68569;11/2/2001 11:10:00;CIDADAO COMUM;S;0;ESTRELA DALVA;BH;607396.99;792279.34;1961
+1963;2001081159;B06000;LESAO CORPORAL;AV ITAU;1337;36025;11/2/2001 11:37:00;CIDADAO COMUM;N;0;JOAO PINHEIRO;BH;604300.14;796713.76;1962
+1964;2001081224;B03000;AMEACA;RUA LEOPOLDO GOM;184;40770;11/2/2001 12:22:00;CIDADAO COMUM;S;;POMPEIA;BH;614481.68;797860.86;1963
+1965;2001081231;B04001;HOMICIDIO TENTAD;RUA SERRA NEGRA;135;65038;11/2/2001 12:28:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610139.91;799281.20;1964
+1966;2001081242;B03000;AMEACA;RUA FLORESTAL;36;123611;11/2/2001 12:36:00;CIDADAO COMUM;S;;INSTITUTO AGRONO;BH;613828.23;799199.35;1965
+1967;2001081283;B06000;LESAO CORPORAL;RUA ITAIPU;960;35439;11/2/2001 13:11:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616274.97;798164.89;1966
+1968;2001081314;B06000;LESAO CORPORAL;RUA JULITA NOGUE;403;39597;11/2/2001 13:32:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603725.15;802483.82;1967
+1969;2001081315;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;697;31400;11/2/2001 13:32:00;INICIATIVA;N;0;CENTRO (BH);BH;610556.85;796867.59;1968
+1970;2001081317;B05000;SEQUESTRO E CARC;RUA MOACYR FROES;170;108380;11/2/2001 13:33:00;INICIATIVA;N;0;SAO JOAO BATISTA;BH;608939.36;807397.69;1969
+1971;2001081417;B03000;AMEACA;RUA SILVA ORTIZ;315;7520;11/2/2001 14:50:00;CIDADAO COMUM;N;CS02;JOAO PINHEIRO;BH;604641.80;796156.88;1970
+1972;2001081434;B04002;HOMICIDIO CONSUM;RUA SAO GERALDO;54;62650;11/2/2001 15:06:00;CIDADAO COMUM;N;;NOVA CINTRA;BH;605798.69;794163.16;1971
+1973;2001081501;B03000;AMEACA;RUA CORONEL REMI;367;92928;11/2/2001 15:55:00;CIDADAO COMUM;S;;VILA MARAVILHAS;BH;603166.34;795066.83;1972
+1974;2001081528;B03000;AMEACA;RUA EVARISTO DA ;335;26922;11/2/2001 16:11:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610037.93;798652.33;1973
+1975;2001081588;B03000;AMEACA;RUA COPERNICO PI;78;6630;11/2/2001 16:52:00;CIDADAO COMUM;S;BECO E;SANTO ANTONIO;BH;610449.69;793640.03;1974
+1976;2001081620;B02000;RIXA;RUA RIO DAS FLOR;170;92770;11/2/2001 17:10:00;CIDADAO COMUM;N;;PILAR;BH;607837.36;788169.94;1975
+1977;2001081676;B03000;AMEACA;RUA NARCISO PERE;141;78267;11/2/2001 17:38:00;CIDADAO COMUM;S;CAB;VILA PINHO;BH;601878.96;788485.35;1976
+1978;2001081694;B06000;LESAO CORPORAL;RUA MARIA DA CON;243;107881;11/2/2001 17:42:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606570.12;811671.60;1977
+1979;2001081699;B04001;HOMICIDIO TENTAD;AV DOM PEDRO I;3083;48337;11/2/2001 17:44:00;CIDADAO COMUM;N;;PLANALTO;BH;609678.52;807952.23;1978
+1980;2001081773;B06000;LESAO CORPORAL;RUA GRAO MOGOL;197;31769;11/2/2001 18:20:00;CIDADAO COMUM;N;0;CARMO;BH;611788.50;794682.45;1979
+1981;2001081799;B02000;RIXA;RUA RIO DE JANEI;282;58772;11/2/2001 18:35:00;CIDADAO COMUM;S;FR;CENTRO (BH);BH;611181.78;797418.31;1980
+1982;2001081850;B04001;HOMICIDIO TENTAD;RUA ARTUR DE SA;939;6211;11/2/2001 18:58:00;CIDADAO COMUM;N;;UNIAO;BH;612733.03;801920.16;1981
+1983;2001081899;B04001;HOMICIDIO TENTAD;AV SILVA LOBO;1710;65889;11/2/2001 19:17:00;CIDADAO COMUM;S;;GRAJAU;BH;608050.43;794902.40;1982
+1984;2001081904;B04001;HOMICIDIO TENTAD;RUA DOMINGOS ROC;123;22631;11/2/2001 19:20:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606553.35;795142.98;1983
+1985;2001081928;B06000;LESAO CORPORAL;RUA SABINO JOSE ;207;118210;11/2/2001 19:34:00;CIDADAO COMUM;S;;TIROL;BH;599914.84;789810.06;1984
+1986;2001081946;B04001;HOMICIDIO TENTAD;RUA ARACY DE ALM;211;85648;11/2/2001 19:41:00;CIDADAO COMUM;S;0;GOIANIA;BH;614914.01;803850.11;1985
+1987;2001081962;B04001;HOMICIDIO TENTAD;RUA D;81;79764;11/2/2001 19:51:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;616942.69;804583.48;1986
+1988;2001081965;B06000;LESAO CORPORAL;RUA MARIA ROSA D;31;14591;11/2/2001 19:54:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600813.94;787318.13;1987
+1989;2001081977;B03000;AMEACA;RUA BENEDITO ANI;81;56244;11/2/2001 20:02:00;CIDADAO COMUM;N;;NOVA YORK;BH;608363.76;810624.49;1988
+1990;2001082021;B03000;AMEACA;RUA CINCO;14;302813;11/2/2001 20:22:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614439.74;805916.30;1989
+1991;2001082123;B06000;LESAO CORPORAL;RUA GENERAL SAMP;110;30927;11/2/2001 21:22:00;INICIATIVA;S;0;POMPEIA;BH;614275.40;798137.47;1990
+1992;2001082126;B06000;LESAO CORPORAL;RUA HESPERIA;516;33260;11/2/2001 21:22:00;CIDADAO COMUM;S;0;PARQUE RIACHUELO;BH;609757.21;800624.53;1991
+1993;2001082143;B03000;AMEACA;RUA MAJOR DELFIN;3143;42620;11/2/2001 21:31:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608575.21;800912.64;1992
+1994;2001082148;B03000;AMEACA;RUA PONTA PORA;35;54601;11/2/2001 21:35:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;613128.09;796821.54;1993
+1995;2001082159;B03000;AMEACA;RUA CAMILO GOMES;395;11902;11/2/2001 21:38:00;CIDADAO COMUM;S;CAFR;ITAIPU BH;BH;599526.34;789343.98;1994
+1996;2001082160;B03000;AMEACA;RUA TIBIRICA;20;67613;11/2/2001 21:40:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;608290.82;794241.49;1995
+1997;2001082258;B03000;AMEACA;RUA BRAS;20;170835;11/2/2001 22:23:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608019.79;793890.35;1996
+1998;2001082266;B06000;LESAO CORPORAL;RUA UM;29;302808;11/2/2001 22:28:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614345.23;805792.20;1997
+1999;2001082309;B03000;AMEACA;RUA JANUARIA;480;36936;11/2/2001 22:50:00;CIDADAO COMUM;S;AP402;FLORESTA;BH;611701.44;798121.30;1998
+2000;2001082331;B03000;AMEACA;RUA INTERNA;88;34666;11/2/2001 23:06:00;CIDADAO COMUM;S;;MAGNESITA;BH;603921.34;793691.32;1999
+2001;2001082378;B06000;LESAO CORPORAL;RUA ITABERA;115;35224;11/2/2001 23:27:00;CIDADAO COMUM;N;AP03;SANTA EFIGENIA;BH;614248.22;797046.89;2000
+2002;2001082448;B03000;AMEACA;RUA DURVALIA;100;115704;12/2/2001 00:00:00;CIDADAO COMUM;N;;HAVAI;BH;607390.14;793424.75;2001
+2003;2001082462;B06000;LESAO CORPORAL;RUA CINQUENTA E ;348;106201;12/2/2001 00:16:00;CIDADAO COMUM;N;0;NOVA YORK;BH;608638.63;810805.70;2002
+2004;2001082465;B04001;HOMICIDIO TENTAD;PRACA ESMERALDA;10;25932;12/2/2001 00:19:00;CIDADAO COMUM;N;0;PIRAJA;BH;613180.37;803029.37;2003
+2005;2001082468;B06000;LESAO CORPORAL;RUA STA JULIANA;259;60829;12/2/2001 00:20:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606335.02;794528.18;2004
+2006;2001082508;B04002;HOMICIDIO CONSUM;RUA MODELO;371;46026;12/2/2001 00:56:00;INICIATIVA;N;0;SUZANA;BH;612016.08;802934.75;2005
+2007;2001082548;B05000;SEQUESTRO E CARC;RUA CONCEICAO DO;55;21106;12/2/2001 01:17:00;INICIATIVA;S;0;OURO PRETO;BH;606837.86;802480.63;2006
+2008;2001082579;B06000;LESAO CORPORAL;AV DOUTOR CRISTI;862;62459;12/2/2001 01:49:00;INICIATIVA;N;0;PLANALTO;BH;609793.27;807173.69;2007
+2009;2001082983;B03000;AMEACA;RUA JOAO AFONSO ;407;7457;12/2/2001 09:22:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606679.76;802575.31;2008
+2010;2001083030;B03000;AMEACA;RUA CINCO;14;302813;12/2/2001 09:47:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614439.74;805916.30;2009
+2011;2001083044;B03000;AMEACA;RUA FRUTAL;319;30060;12/2/2001 09:54:00;CIDADAO COMUM;S;AP203;SANTA EFIGENIA;BH;613765.93;796775.54;2010
+2012;2001083112;B04001;HOMICIDIO TENTAD;RUA DOS BANDOLIN;114;106980;12/2/2001 10:39:00;CIDADAO COMUM;N;0;CH CALIFORNIA;BH;604133.35;796768.11;2011
+2013;2001083142;B06000;LESAO CORPORAL;AV DO CONTORNO;1542;17228;12/2/2001 11:01:00;INICIATIVA;S;0;FLORESTA;BH;612129.40;797743.70;2012
+2014;2001083167;B06000;LESAO CORPORAL;AV CLARA NUNES;822;45644;12/2/2001 11:16:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;611029.42;801039.87;2013
+2015;2001083307;B04002;HOMICIDIO CONSUM;RUA DOUTOR ALIPI;25;2365;12/2/2001 12:42:00;CIDADAO COMUM;N;0;SERRA;BH;613823.09;794921.03;2014
+2016;2001083403;B03000;AMEACA;RUA ITAQUERA;587;35920;12/2/2001 13:48:00;CIDADAO COMUM;S;;CONCORDIA;BH;611337.87;799230.32;2015
+2017;2001083469;B06000;LESAO CORPORAL;RUA WENCESLAU BR;77;73727;12/2/2001 14:26:00;CIDADAO COMUM;S;;COPACABANA;BH;606339.57;806993.12;2016
+2018;2001083505;B04002;HOMICIDIO CONSUM;AV OLEGARIO MACI;1611;49699;12/2/2001 14:43:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610311.35;796159.61;2017
+2019;2001083547;B03000;AMEACA;RUA ITAPARICA;221;35731;12/2/2001 15:14:00;CIDADAO COMUM;N;;SERRA;BH;613007.39;795346.68;2018
+2020;2001083570;B06000;LESAO CORPORAL;RUA CARLOS ETIEN;13;13356;12/2/2001 15:32:00;CIDADAO COMUM;S;;SERRA;BH;613992.00;794863.88;2019
+2021;2001083573;B06000;LESAO CORPORAL;AV BARAO HOMEM D;1997;7936;12/2/2001 15:34:00;CIDADAO COMUM;N;;LEONINA;BH;608163.53;793322.71;2020
+2022;2001083664;B06000;LESAO CORPORAL;RUA PADRE PETROL;1160;53577;12/2/2001 16:35:00;CIDADAO COMUM;N;AP205;SAGRADA FAMILIA;BH;613590.37;798532.20;2021
+2023;2001083681;B06000;LESAO CORPORAL;AV FRANCISCO SA;1409;29656;12/2/2001 16:45:00;CIDADAO COMUM;S;;GUTIERREZ;BH;608968.06;795431.45;2022
+2024;2001083794;B06000;LESAO CORPORAL;RUA DA BAHIA;380;81155;12/2/2001 17:42:00;CIDADAO COMUM;S;PX380;CENTRO (BH);BH;611423.82;797248.36;2023
+2025;2001083842;B04001;HOMICIDIO TENTAD;RUA VILA RICA;1989;71992;12/2/2001 18:12:00;CIDADAO COMUM;N;BL1     AP104;JARDIM MONTANHES;BH;606729.96;798841.80;2024
+2026;2001084077;B06000;LESAO CORPORAL;RUA MIOSOTIS;180;45859;12/2/2001 21:02:00;CIDADAO COMUM;N;;SANTO ANDRE;BH;608901.95;798729.73;2025
+2027;2001084081;B06000;LESAO CORPORAL;RUA EPAMINONDAS ;65;25696;12/2/2001 21:04:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604476.95;793805.73;2026
+2028;2001084102;B03000;AMEACA;RUA JOAO PINTO;15;105542;12/2/2001 21:23:00;CIDADAO COMUM;S;APT301;JARDINOPOLIS;BH;605029.47;794803.37;2027
+2029;2001084181;B03000;AMEACA;RUA JOSE DE OLIV;22;63161;12/2/2001 22:12:00;CIDADAO COMUM;N;;ARAGUAIA;BH;604028.76;790381.13;2028
+2030;2001084207;B02000;RIXA;RUA ITANHAEM;345;100173;12/2/2001 22:34:00;INICIATIVA;S;0;PIRATININGA;BH;605634.00;808953.53;2029
+2031;2001084253;B03000;AMEACA;RUA DEMOCRITO;58;26078;12/2/2001 23:07:00;CIDADAO COMUM;S;;BELMONT;BH;615545.74;804744.99;2030
+2032;2001084510;B06000;LESAO CORPORAL;RUA JULIO DE CAS;1132;39470;13/2/2001 03:50:00;CIDADAO COMUM;S;0;CINQUENTENARIO;BH;606683.66;792194.71;2031
+2033;2001084532;B06000;LESAO CORPORAL;AV CIVILIZACAO;889;51657;13/2/2001 04:35:00;INICIATIVA;S;0;JARDIM FLORENCIA;BH;609155.17;808648.71;2032
+2034;2001084876;B04001;HOMICIDIO TENTAD;RUA FLOR DE VIDR;5;13504;13/2/2001 10:45:00;CIDADAO COMUM;N;0;CASTELO;BH;605642.59;799384.30;2033
+2035;2001084975;B04001;HOMICIDIO TENTAD;RUA PACIFICO CAR;250;93426;13/2/2001 12:08:00;INICIATIVA;N;0;INDEPENDENCIA;BH;602007.04;786043.55;2034
+2036;2001085018;B03000;AMEACA;AV AUGUSTO DE LI;486;6731;13/2/2001 12:35:00;CIDADAO COMUM;S;AP403;CENTRO (BH);BH;610871.39;796677.01;2035
+2037;2001085062;B03000;AMEACA;RUA SERRINHA;19;129201;13/2/2001 13:14:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;600519.25;786719.95;2036
+2038;2001085080;B06000;LESAO CORPORAL;RUA ACUCENAS;70;892;13/2/2001 13:31:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;607357.83;795794.04;2037
+2039;2001085093;B03000;AMEACA;RUA MONSENHOR PA;101;46329;13/2/2001 13:35:00;CIDADAO COMUM;N;0;VISTA ALEGRE;BH;604816.75;793484.58;2038
+2040;2001085141;B06000;LESAO CORPORAL;RUA RAIMUNDO CEZ;45;130280;13/2/2001 14:09:00;CIDADAO COMUM;S;;CASTANHEIRA 2;BH;601563.68;788756.45;2039
+2041;2001085182;B06000;LESAO CORPORAL;AV LUXEMBURGO;9;127612;13/2/2001 14:39:00;INICIATIVA;N;0;JARDIM EUROPA;BH;607808.50;810256.46;2040
+2042;2001085186;B03000;AMEACA;RUA ITAMAR;230;35527;13/2/2001 14:42:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616310.09;798514.15;2041
+2043;2001085206;B03000;AMEACA;RUA IRLANDA;51;35063;13/2/2001 15:00:00;POLICIAL MILITAR;N;0;ITAPOA;BH;608317.79;805800.24;2042
+2044;2001085210;B03000;AMEACA;RUA JOAO ALEXAND;267;71384;13/2/2001 15:07:00;CIDADAO COMUM;N;;MILIONARIOS;BH;603980.36;789980.34;2043
+2045;2001085222;B03000;AMEACA;RUA CARVALHO DE ;59;13810;13/2/2001 15:11:00;CIDADAO COMUM;S;CAB;BOA VISTA;BH;614427.79;799810.56;2044
+2046;2001085244;B06000;LESAO CORPORAL;RUA DAVIDSON PIM;440;124189;13/2/2001 15:22:00;CIDADAO COMUM;S;0;TOPAZIO;BH;607419.22;811909.65;2045
+2047;2001085305;B03000;AMEACA;RUA MILTON VIEIR;80;45786;13/2/2001 15:53:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612458.82;800064.95;2046
+2048;2001085421;B08000;VIOLACAO DE DOMI;RUA DONA NAIR;120;22962;13/2/2001 17:11:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604635.38;792141.95;2047
+2049;2001085596;B03000;AMEACA;RUA PLATAO;180;63187;13/2/2001 18:48:00;CIDADAO COMUM;S;;NAZARE;BH;615718.21;804422.79;2048
+2050;2001085644;B03000;AMEACA;RUA LEO MARENTE;112;94807;13/2/2001 19:21:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606371.05;799398.56;2049
+2051;2001085724;B03000;AMEACA;RUA CONSELHEIRO ;2015;17041;13/2/2001 20:05:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612870.41;799864.95;2050
+2052;2001085727;B06000;LESAO CORPORAL;RUA DEZESSETE;130;32862;13/2/2001 20:07:00;CIDADAO COMUM;N;0;CONJUNTO FELICID;BH;612198.23;807435.95;2051
+2053;2001085789;B03000;AMEACA;RUA FERNAO DIAS;1022;28133;13/2/2001 20:48:00;INICIATIVA;N;0;VERA CRUZ;BH;616049.67;798294.87;2052
+2054;2001085814;B03000;AMEACA;RUA ITANHAEM;345;100173;13/2/2001 21:10:00;CIDADAO COMUM;S;0;PIRATININGA;BH;605634.00;808953.53;2053
+2055;2001085825;B06000;LESAO CORPORAL;RUA FRANCISCO BI;1590;29353;13/2/2001 21:13:00;CIDADAO COMUM;S;AP203;MONSENHOR MESSIA;BH;607087.58;798304.09;2054
+2056;2001085836;B04001;HOMICIDIO TENTAD;BECO HELIOTERIO;12;170863;13/2/2001 21:26:00;INICIATIVA;S;0;LEONINA;BH;608284.91;793801.92;2055
+2057;2001085869;B03000;AMEACA;RUA JOSE FERNAND;122;119948;13/2/2001 21:52:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;616040.45;799464.74;2056
+2058;2001085875;B06000;LESAO CORPORAL;RUA SAO TOMAS DE;133;63782;13/2/2001 21:58:00;CIDADAO COMUM;S;;SAO PEDRO;BH;610990.24;793846.72;2057
+2059;2001085899;B04001;HOMICIDIO TENTAD;RUA VILA ISABEL;25;84370;13/2/2001 22:10:00;CIDADAO COMUM;S;0;VILA SANTA BRANC;BH;605053.21;809820.25;2058
+2060;2001085961;B06000;LESAO CORPORAL;RUA CHAPINHA;170;15061;13/2/2001 22:56:00;CIDADAO COMUM;N;;JARDINOPOLIS;BH;604518.33;794265.31;2059
+2061;2001085976;B06000;LESAO CORPORAL;RUA PINTOR RENAT;258;26617;13/2/2001 23:03:00;CIDADAO COMUM;S;;TUPI;BH;613981.53;805995.61;2060
+2062;2001085979;B06000;LESAO CORPORAL;RUA MARIA BEATRI;54;43881;13/2/2001 23:04:00;CIDADAO COMUM;N;0;HAVAI;BH;606696.13;793615.49;2061
+2063;2001086053;B04002;HOMICIDIO CONSUM;AV UM;595;301245;13/2/2001 23:45:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614648.71;805739.64;2062
+2064;2001086084;B06000;LESAO CORPORAL;RUA NUBIA REZEND;278;97950;14/2/2001 00:10:00;CIDADAO COMUM;N;0;DOM SILVERIO;BH;615162.22;804356.62;2063
+2065;2001086115;B03000;AMEACA;RUA ARIOLINO ARI;192;85811;14/2/2001 00:38:00;CIDADAO COMUM;S;;SERRA VERDE;BH;609175.05;810135.20;2064
+2066;2001086131;B03000;AMEACA;RUA CORNELIA;172;17404;14/2/2001 00:57:00;CIDADAO COMUM;S;;DOM JOAQUIM;BH;613726.12;801994.35;2065
+2067;2001086263;B04002;HOMICIDIO CONSUM;AV BARAO HOMEM D;1280;7936;14/2/2001 03:49:00;CIDADAO COMUM;N;PX1280;JARDIM AMERICA;BH;607865.97;794285.50;2066
+2068;2001086280;B06000;LESAO CORPORAL;RUA DES BARCELOS;574;19904;14/2/2001 04:08:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;607344.70;796068.28;2067
+2069;2001086355;B03000;AMEACA;RUA DINIS DIAS;389;119673;14/2/2001 07:04:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616573.20;797526.82;2068
+2070;2001086372;B06000;LESAO CORPORAL;RUA MICHEL GARIB;219;85490;14/2/2001 07:17:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608812.41;809462.99;2069
+2071;2001086380;B03000;AMEACA;RUA SERRA DA MOE;161;120796;14/2/2001 07:21:00;CIDADAO COMUM;N;AP201;ANTONIO RIBEIRO ;BH;614997.56;807384.95;2070
+2072;2001086619;B03000;AMEACA;RUA SALINAS;432;59992;14/2/2001 10:04:00;CIDADAO COMUM;S;0;FLORESTA;BH;612149.51;798050.73;2071
+2073;2001086645;B03000;AMEACA;RUA FLOR DE LIMA;16;23810;14/2/2001 10:20:00;CIDADAO COMUM;S;0;FILADELFIA;BH;602168.34;797463.32;2072
+2074;2001086693;B03000;AMEACA;RUA PIRAQUARA;320;54189;14/2/2001 10:49:00;CIDADAO COMUM;S;;VILA OESTE;BH;604522.65;795351.05;2073
+2075;2001086791;B03000;AMEACA;AV AUGUSTO DE LI;215;6731;14/2/2001 12:15:00;INICIATIVA;S;;CENTRO (BH);BH;611184.43;796546.36;2074
+2076;2001086853;B03000;AMEACA;RUA PRINCESA LEO;220;55327;14/2/2001 13:08:00;CIDADAO COMUM;S;;IPIRANGA;BH;611610.24;801056.09;2075
+2077;2001086872;B06000;LESAO CORPORAL;RUA PADRE ADOLFO;79;85332;14/2/2001 13:31:00;INICIATIVA;N;0;MINASCAIXA;BH;609204.95;809728.62;2076
+2078;2001086890;B03000;AMEACA;RUA ROGERIO APAR;100;96682;14/2/2001 13:44:00;POLICIAL MILITAR;S;SOL PM/SOMENTE R;ANTONIO RIBEIRO ;BH;615004.45;806026.02;2077
+2079;2001086902;B03000;AMEACA;RUA ACALIFA;209;98385;14/2/2001 13:53:00;CIDADAO COMUM;S;;JULIANA;BH;611057.85;809064.48;2078
+2080;2001087048;B03000;AMEACA;AV URUGUAI;335;71113;14/2/2001 15:31:00;CIDADAO COMUM;S;SL14;SION;BH;611750.13;793745.62;2079
+2081;2001087196;B03000;AMEACA;RUA AMANDO COUTO;230;3037;14/2/2001 16:53:00;CIDADAO COMUM;N;SL101;SAO TOMAZ;BH;609922.73;805494.21;2080
+2082;2001087204;B03000;AMEACA;AV SIDERAL;371;65721;14/2/2001 16:58:00;CIDADAO COMUM;S;0;VISTA ALEGRE;BH;604340.08;793439.54;2081
+2083;2001087261;B03000;AMEACA;RUA GETULIO DRUM;155;26040;14/2/2001 17:25:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605566.99;793350.25;2082
+2084;2001087335;B03000;AMEACA;RUA STA CATARINA;352;60400;14/2/2001 18:16:00;POLICIAL MILITAR;N;0;CENTRO (BH);BH;610547.19;796653.24;2083
+2085;2001087379;B06000;LESAO CORPORAL;AV SERRANA;647;65040;14/2/2001 18:36:00;CIDADAO COMUM;S;LJ6;SERRANO;BH;603476.59;801568.74;2084
+2086;2001087398;B04001;HOMICIDIO TENTAD;RUA PROFESSORA G;450;86335;14/2/2001 18:49:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611770.58;807594.40;2085
+2087;2001087466;B03000;AMEACA;RUA H;440;78295;14/2/2001 19:22:00;CIDADAO COMUM;S;;VILA PINHO;BH;602017.92;788016.06;2086
+2088;2001087483;B03000;AMEACA;RUA F;85;302327;14/2/2001 19:38:00;CIDADAO COMUM;S;;BONSUCESSO;BH;606318.82;789810.40;2087
+2089;2001087486;B04001;HOMICIDIO TENTAD;RUA OSCAR NEGRAO;29;17776;14/2/2001 19:42:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605045.53;795084.05;2088
+2090;2001087493;B03000;AMEACA;RUA JOSE DE ALEN;269;82274;14/2/2001 19:43:00;CIDADAO COMUM;S;;GUARANI;BH;611909.31;804949.94;2089
+2091;2001087596;B03000;AMEACA;RUA SERENATA;68;172351;14/2/2001 20:37:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614101.09;795309.49;2090
+2092;2001087611;B06000;LESAO CORPORAL;RUA SAO PAULO;409;63464;14/2/2001 20:47:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611057.56;797364.72;2091
+2093;2001087632;B06000;LESAO CORPORAL;RUA GERALDO ILID;283;107680;14/2/2001 20:56:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606527.82;812020.77;2092
+2094;2001087748;B02000;RIXA;RUA VEREADOR JUL;17;125456;14/2/2001 22:07:00;INICIATIVA;S;0;NOVA GAMELEIRA;BH;605709.31;795133.42;2093
+2095;2001087762;B06000;LESAO CORPORAL;RUA LAJEDO;335;130034;14/2/2001 22:10:00;CIDADAO COMUM;S;FU;SAO GABRIEL;BH;614399.48;804590.63;2094
+2096;2001087818;B02000;RIXA;AV CRISTIANO MAC;4000;18652;14/2/2001 22:50:00;INICIATIVA;N;0;DOS PALMARES;BH;612434.91;802092.92;2095
+2097;2001087866;B04001;HOMICIDIO TENTAD;RUA CARMELITA CO;100;93366;14/2/2001 23:14:00;POLICIAL MILITAR;S;0;MINEIRAO;BH;600997.54;785906.69;2096
+2098;2001087869;B06000;LESAO CORPORAL;RUA CRISTAL;312;18611;14/2/2001 23:16:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;612754.03;797170.88;2097
+2099;2001087872;B03000;AMEACA;RUA NIQUELINA;892;47738;14/2/2001 23:17:00;INICIATIVA;N;0;SANTA EFIGENIA;BH;613866.59;797105.70;2098
+2100;2001087874;B05000;SEQUESTRO E CARC;RUA LUIZ BALENA;70;114796;14/2/2001 23:19:00;CIDADAO COMUM;N;AP201;VILA SILVEIRA;BH;611916.32;800099.52;2099
+2101;2001087892;B06000;LESAO CORPORAL;RUA ARAGUARI;525;5376;14/2/2001 23:26:00;CIDADAO COMUM;N;AP-1406;BARRO PRETO;BH;610030.23;796776.44;2100
+2102;2001087908;B03000;AMEACA;RUA ANGRA DOS RE;101;4027;14/2/2001 23:35:00;CIDADAO COMUM;N;0;NOVA GRANADA;BH;607661.15;795094.51;2101
+2103;2001087946;B03000;AMEACA;AV DOM JOAO VI;1010;22294;15/2/2001 00:01:00;INICIATIVA;S;0;PALMEIRAS;BH;606644.46;791666.74;2102
+2104;2001087977;B03000;AMEACA;RUA MANOEL CAYLL;121;43043;15/2/2001 00:22:00;CIDADAO COMUM;S;;HORTO;BH;613259.68;798134.49;2103
+2105;2001088110;B06000;LESAO CORPORAL;RUA VOLTS;280;73626;15/2/2001 02:23:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612030.29;803549.80;2104
+2106;2001088114;B06000;LESAO CORPORAL;BECO NOSSA SENHO;930;170113;15/2/2001 02:25:00;CIDADAO COMUM;N;3 AGUA;CAFEZAL;BH;614339.35;794970.47;2105
+2107;2001088177;B04001;HOMICIDIO TENTAD;RUA ITUMIRIM;16;36230;15/2/2001 03:56:00;CIDADAO COMUM;S;CSA;SANTA INES;BH;614584.65;800620.95;2106
+2108;2001088220;B06000;LESAO CORPORAL;RUA DOS GUARANIS;26;32181;15/2/2001 04:53:00;INICIATIVA;S;0;CENTRO (BH);BH;610757.73;797608.11;2107
+2109;2001088358;B03000;AMEACA;RUA CIRILO GASPA;326;63348;15/2/2001 08:10:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608684.85;800162.78;2108
+2110;2001088395;B09000;ABANDONO DE INCA;RUA JUNQUEIRA FR;20;39644;15/2/2001 08:37:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;607163.35;807956.23;2109
+2111;2001088397;B03000;AMEACA;RUA RIO GRANDE D;708;58731;15/2/2001 08:36:00;CIDADAO COMUM;N;PX2300;FUNCIONARIOS;BH;611896.05;795752.13;2110
+2112;2001088614;B06000;LESAO CORPORAL;AV DOS ANDRADAS;356;3761;15/2/2001 10:53:00;INICIATIVA;S;0;CENTRO BH;BH;611480.30;797265.49;2111
+2113;2001088676;B03000;AMEACA;RUA CARANGOLA;228;13094;15/2/2001 11:44:00;CIDADAO COMUM;S;PX230;SANTO ANTONIO;BH;610754.02;794740.44;2112
+2114;2001088695;B04001;HOMICIDIO TENTAD;RUA ROSA ROCHA C;54;19453;15/2/2001 11:54:00;INICIATIVA;N;0;CARDOSO;BH;603554.58;788167.67;2113
+2115;2001088939;B06000;LESAO CORPORAL;RUA ANGOLA;790;4001;15/2/2001 15:19:00;CIDADAO COMUM;S;;SAO PAULO;BH;613029.32;802881.46;2114
+2116;2001089077;B03000;AMEACA;AV DO CONTORNO;1781;17228;15/2/2001 16:37:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;612253.65;797644.51;2115
+2117;2001089086;B06000;LESAO CORPORAL;RUA UARIRA;350;70136;15/2/2001 16:40:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;616162.91;799326.26;2116
+2118;2001089167;B03000;AMEACA;RUA DO LAGO;510;40161;15/2/2001 17:24:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614189.26;802411.99;2117
+2119;2001089275;B03000;AMEACA;RUA NOVA ESPERAN;205;83898;15/2/2001 18:20:00;CIDADAO COMUM;S;CAC;CEU AZUL;BH;604285.81;807801.26;2118
+2120;2001089356;B04001;HOMICIDIO TENTAD;RUA CRISTIANO OT;212;29192;15/2/2001 18:53:00;CIDADAO COMUM;S;AP201;SANTA TEREZINHA;BH;604360.17;802644.76;2119
+2121;2001089401;B03000;AMEACA;RUA CONTENDAS;63;17215;15/2/2001 19:14:00;CIDADAO COMUM;S;0;BARROCA;BH;607701.63;795996.98;2120
+2122;2001089485;B03000;AMEACA;RUA DES SARAIVA;1075;66535;15/2/2001 20:03:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616101.45;797681.72;2121
+2123;2001089505;B03000;AMEACA;RUA GUAICUI;151;31999;15/2/2001 20:16:00;INICIATIVA;N;0;CORACAO DE JESUS;BH;609829.07;794224.02;2122
+2124;2001089636;B03000;AMEACA;AV RAJA GABAGLIA;1710;57830;15/2/2001 21:38:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608719.62;793771.09;2123
+2125;2001089652;B04001;HOMICIDIO TENTAD;AV MARIA CONCEIC;1356;32052;15/2/2001 21:52:00;CIDADAO COMUM;N;;GOIANIA;BH;615166.56;803057.27;2124
+2126;2001089657;B03000;AMEACA;RUA RADIALISTA M;330;98864;15/2/2001 21:53:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604309.77;808868.97;2125
+2127;2001089658;B06000;LESAO CORPORAL;RUA PRATINHA;49;88485;15/2/2001 21:54:00;CIDADAO COMUM;S;CAC;CAICARA;BH;606915.08;799459.94;2126
+2128;2001089664;B03000;AMEACA;RUA ARAL;59;5389;15/2/2001 21:56:00;CIDADAO COMUM;S;;CH BETANIA;BH;605281.73;792385.15;2127
+2129;2001089665;B06000;LESAO CORPORAL;RUA CASTELO BRAN;110;14030;15/2/2001 21:56:00;CIDADAO COMUM;N;CAA;SANTA TEREZINHA;BH;604414.63;802592.40;2128
+2130;2001089677;B06000;LESAO CORPORAL;RUA ARARIBA;235;5540;15/2/2001 22:05:00;CIDADAO COMUM;N;;SAO CRISTOVAO;BH;610149.82;799166.33;2129
+2131;2001089724;B03000;AMEACA;RUA TRINTA E SET;31;34190;15/2/2001 22:32:00;CIDADAO COMUM;S;31;CONJUNTO FELICID;BH;612467.97;807431.31;2130
+2132;2001089766;B06000;LESAO CORPORAL;RUA JOAO PAULINO;50;87048;15/2/2001 23:01:00;CIDADAO COMUM;S;0;DA LAGOA;BH;604692.66;809030.76;2131
+2133;2001089832;B03000;AMEACA;RUA AROEIRA;892;81385;15/2/2001 23:35:00;INICIATIVA;S;0;SAO JOAO BATISTA;BH;610748.85;801927.11;2132
+2134;2001089909;B03000;AMEACA;AV CACHOEIRINHA;861;11250;16/2/2001 00:20:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610468.79;801301.88;2133
+2135;2001089951;B06000;LESAO CORPORAL;AV BRASIL;41;10420;16/2/2001 00:56:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;612997.74;796618.26;2134
+2136;2001089970;B03000;AMEACA;AV OLINTO MEIREL;1400;49847;16/2/2001 01:07:00;INICIATIVA;S;0;SANTA HELENA (BH;BH;603611.60;790119.35;2135
+2137;2001089972;B03000;AMEACA;RUA PARAIBA;1255;52170;16/2/2001 01:09:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611617.62;795132.74;2136
+2138;2001089982;B06000;LESAO CORPORAL;RUA ALFREDINA AM;135;2251;16/2/2001 01:21:00;CIDADAO COMUM;S;AN2;MILIONARIOS;BH;604399.69;790520.39;2137
+2139;2001090014;B04001;HOMICIDIO TENTAD;AV CORONEL DURVA;732;17688;16/2/2001 01:54:00;CIDADAO COMUM;S;;DURVAL DE BARROS;BH;598151.28;790894.64;2138
+2140;2001090047;B03000;AMEACA;RUA ATTILIO DE M;351;111630;16/2/2001 02:29:00;CIDADAO COMUM;S;CAA     FU;DIAMANTE;BH;601521.26;789910.34;2139
+2141;2001090073;B06000;LESAO CORPORAL;AV DO CONTORNO;6244;17228;16/2/2001 03:04:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611257.58;794841.55;2140
+2142;2001090159;B02000;RIXA;RUA OURO PRETO;300;50730;16/2/2001 04:42:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609908.33;797015.97;2141
+2143;2001090187;B06000;LESAO CORPORAL;AV SANTOS DUMONT;680;61950;16/2/2001 05:42:00;INICIATIVA;N;0;CENTRO BH;BH;610999.13;797614.04;2142
+2144;2001090391;B03000;AMEACA;RUA E;70;130743;16/2/2001 08:50:00;CIDADAO COMUM;N;0;INSTITUTO AGRONO;BH;614047.53;799573.40;2143
+2145;2001090441;B03000;AMEACA;AV OLEGARIO MACI;698;49699;16/2/2001 09:29:00;CIDADAO COMUM;S;MERCADO NOVO;CENTRO (BH);BH;610483.21;797000.62;2144
+2146;2001090443;B03000;AMEACA;RUA JOSE OVIDIO ;970;10298;16/2/2001 09:30:00;CIDADAO COMUM;N;0;CARDOSO;BH;603504.94;787842.27;2145
+2147;2001090488;B03000;AMEACA;RUA ILHA DE MALT;90;20926;16/2/2001 10:15:00;INICIATIVA;N;0;SAO GABRIEL;BH;614020.17;803939.85;2146
+2148;2001090518;B03000;AMEACA;RUA IRMAOS RODRI;110;35108;16/2/2001 10:27:00;CIDADAO COMUM;N;;AARAO REIS;BH;613324.76;805089.21;2147
+2149;2001090564;B03000;AMEACA;RUA BEBEDOURO;80;128010;16/2/2001 10:50:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;615701.66;800447.38;2148
+2150;2001090574;B06000;LESAO CORPORAL;RUA SAO RAFAEL;128;63580;16/2/2001 10:59:00;CIDADAO COMUM;S;FUNDOS;FLORESTA;BH;612235.40;798259.74;2149
+2151;2001090580;B03000;AMEACA;RUA SABINOPOLIS;391;59790;16/2/2001 11:03:00;INICIATIVA;N;0;CARLOS PRATES;BH;608912.23;798344.41;2150
+2152;2001090640;B04002;HOMICIDIO CONSUM;RUA ACALIFA;8;98385;16/2/2001 11:46:00;CIDADAO COMUM;S;ACAMPAMENTO MARI;JULIANA;BH;611001.95;809141.12;2151
+2153;2001090712;B06000;LESAO CORPORAL;RUA HORACIO DOLA;175;11565;16/2/2001 12:29:00;INICIATIVA;S;0;CEU AZUL;BH;604118.20;807543.82;2152
+2154;2001090756;B03000;AMEACA;RUA PITANGUI;33;54365;16/2/2001 13:05:00;CIDADAO COMUM;N;0;SAO CRISTOVAO;BH;610543.96;799415.99;2153
+2155;2001090775;B03000;AMEACA;RUA PADRE FEIJO;549;51326;16/2/2001 13:19:00;POLICIAL MILITAR;S;;SAUDADE;BH;615464.89;797595.09;2154
+2156;2001090908;B04001;HOMICIDIO TENTAD;RUA ALEXANDRITA;284;91304;16/2/2001 14:49:00;CIDADAO COMUM;S;;BETANIA;BH;605673.10;793001.80;2155
+2157;2001090915;B03000;AMEACA;RUA GETULIO DRUM;280;26040;16/2/2001 14:55:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605578.88;793232.64;2156
+2158;2001090916;B03000;AMEACA;RUA CAMILO DE BR;636;11896;16/2/2001 14:55:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605855.99;798012.24;2157
+2159;2001090975;B03000;AMEACA;RUA PADRE JULIO ;1571;51496;16/2/2001 15:36:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616274.14;797626.03;2158
+2160;2001090979;B03000;AMEACA;RUA RAIMUNDO TIN;182;301229;16/2/2001 15:37:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610702.97;793142.76;2159
+2161;2001091133;B06000;LESAO CORPORAL;AV CHURCHILL;39;15222;16/2/2001 16:57:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;613209.68;796790.66;2160
+2162;2001091142;B03000;AMEACA;RUA ANTONIO CARL;21;108670;16/2/2001 17:03:00;CIDADAO COMUM;S;;MINASCAIXA;BH;608872.80;809582.96;2161
+2163;2001091174;B06000;LESAO CORPORAL;RUA ARIOLINO ARI;159;85811;16/2/2001 17:15:00;CIDADAO COMUM;S;0;SERRA VERDE;BH;609207.39;810119.05;2162
+2164;2001091292;B06000;LESAO CORPORAL;AV PRUDENTE DE M;1965;55774;16/2/2001 18:22:00;CIDADAO COMUM;S;AP701;SANTO ANTONIO;BH;610208.70;793775.64;2163
+2165;2001091329;B06000;LESAO CORPORAL;RUA E;62;302329;16/2/2001 18:43:00;CIDADAO COMUM;S;0;BOM SUCESSO;BH;606194.00;789731.97;2164
+2166;2001091359;B03000;AMEACA;RUA FRANCELINA A;549;29265;16/2/2001 19:07:00;CIDADAO COMUM;S;;PIRAJA;BH;614287.13;803103.73;2165
+2167;2001091364;B06000;LESAO CORPORAL;RUA ITABIRA;450;35237;16/2/2001 19:11:00;INICIATIVA;S;0;LAGOINHA;BH;610968.63;798450.39;2166
+2168;2001091369;B06000;LESAO CORPORAL;RUA PARA DE MINA;845;52070;16/2/2001 19:14:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;605807.00;797725.10;2167
+2169;2001091385;B03000;AMEACA;RUA DO CARMO;117;13646;16/2/2001 19:27:00;CIDADAO COMUM;S;0;ITAIPU BH;BH;598973.23;789319.66;2168
+2170;2001091400;B06000;LESAO CORPORAL;RUA ALVARO FERNA;148;102415;16/2/2001 19:37:00;INICIATIVA;S;0;VERA CRUZ;BH;616786.53;797450.04;2169
+2171;2001091428;B03000;AMEACA;RUA GRAVETEIRO;50;95853;16/2/2001 19:51:00;CIDADAO COMUM;N;;GOIANIA;BH;615297.87;802503.50;2170
+2172;2001091464;B03000;AMEACA;RUA ARISCO;152;74758;16/2/2001 20:14:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616713.81;804674.58;2171
+2173;2001091477;B03000;AMEACA;RUA DAS PERPETUA;1071;911;16/2/2001 20:29:00;CIDADAO COMUM;N;0;LINDEIA;BH;599244.38;790367.98;2172
+2174;2001091483;B04001;HOMICIDIO TENTAD;RUA FREI MANOEL ;577;29974;16/2/2001 20:32:00;CIDADAO COMUM;S;BLB     AP902;LIBERDADE;BH;609905.49;803627.17;2173
+2175;2001091502;B06000;LESAO CORPORAL;RUA RIACHO;87;24927;16/2/2001 20:44:00;CIDADAO COMUM;N;0;TAQUARIL;BH;617229.41;797173.93;2174
+2176;2001091582;B03000;AMEACA;BECO PRIMEIRO DE;13;302438;16/2/2001 21:31:00;CIDADAO COMUM;S;CAB;MANTIQUEIRA;BH;606906.19;811699.13;2175
+2177;2001091604;B06000;LESAO CORPORAL;RUA ELOI MENDES;201;25277;16/2/2001 21:47:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612761.04;798110.17;2176
+2178;2001091615;B03000;AMEACA;RUA PADRE MANOEL;143;51569;16/2/2001 21:52:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;614135.75;796233.74;2177
+2179;2001091627;B06000;LESAO CORPORAL;RUA REGIA;207;58209;16/2/2001 22:05:00;CIDADAO COMUM;N;;NOVA CINTRA;BH;605661.54;794056.19;2178
+2180;2001091634;B03000;AMEACA;RUA BADARO JUNIO;15;7532;16/2/2001 22:09:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612042.23;803554.37;2179
+2181;2001091663;B03000;AMEACA;RUA PROFESSOR RU;450;86754;16/2/2001 22:32:00;CIDADAO COMUM;N;CAB;JARDIM GUANABARA;BH;611585.01;807365.63;2180
+2182;2001091668;B03000;AMEACA;RUA DOS CACTOS;57;73119;16/2/2001 22:37:00;INICIATIVA;S;0;LINDEIA;BH;598831.75;791014.25;2181
+2183;2001091699;B04001;HOMICIDIO TENTAD;RUA FAISAO;700;27710;16/2/2001 22:48:00;POLICIAL MILITAR;N;0;FLAVIO MARQUES D;BH;605210.94;788677.86;2182
+2184;2001091769;B03000;AMEACA;AV SETE DE ABRIL;519;65560;16/2/2001 23:29:00;CIDADAO COMUM;S;;ESPLANADA;BH;614504.08;798488.31;2183
+2185;2001091779;B06000;LESAO CORPORAL;RUA JOSE BARBOSA;157;85304;16/2/2001 23:32:00;CIDADAO COMUM;S;;JAQUELINE;BH;610514.81;810125.87;2184
+2186;2001091815;B06000;LESAO CORPORAL;RUA 35;42;302833;17/2/2001 00:00:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;613934.25;805520.40;2185
+2187;2001091831;B04002;HOMICIDIO CONSUM;RUA FAUSTINO ASS;148;27824;17/2/2001 00:05:00;CIDADAO COMUM;N;0;MAGNESITA;BH;604163.70;793810.66;2186
+2188;2001091840;B03000;AMEACA;RUA JOSE ROMANO;121;15796;17/2/2001 00:14:00;CIDADAO COMUM;S;;SAO JOSE;BH;605134.23;798826.00;2187
+2189;2001091851;B06000;LESAO CORPORAL;RUA JOSE BARBOSA;517;85304;17/2/2001 00:22:00;CIDADAO COMUM;N;0;JAQUELINE;BH;610735.42;810323.17;2188
+2190;2001091864;B06000;LESAO CORPORAL;RUA BANDONION;211;170139;17/2/2001 00:30:00;CIDADAO COMUM;S;PX472;VILA CAFEZAL;BH;614041.90;794984.61;2189
+2191;2001091883;B03000;AMEACA;RUA BANDONION;79;170139;17/2/2001 00:40:00;INICIATIVA;N;0;VILA CAFEZAL;BH;614016.06;795069.25;2190
+2192;2001091884;B06000;LESAO CORPORAL;RUA DONA LUCI;408;86004;17/2/2001 00:41:00;INICIATIVA;N;0;CINQUENTENARIO;BH;606438.83;791862.80;2191
+2193;2001091942;B04001;HOMICIDIO TENTAD;AV BRIGADEIRO ED;870;2860;17/2/2001 01:11:00;CIDADAO COMUM;S;0;GLORIA;BH;604398.53;798513.15;2192
+2194;2001091999;B03000;AMEACA;RUA ESTRELA;26;86310;17/2/2001 01:45:00;CIDADAO COMUM;N;0;CELESTINO;BH;610886.12;808672.60;2193
+2195;2001092003;B03000;AMEACA;RUA HELVECIO MON;97;33001;17/2/2001 01:48:00;CIDADAO COMUM;N;;VILA OESTE;BH;604410.60;795565.96;2194
+2196;2001092030;B06000;LESAO CORPORAL;AV SINFRONIO BRO;350;66116;17/2/2001 02:07:00;CIDADAO COMUM;N;0;BARREIRO;BH;603002.38;790928.20;2195
+2197;2001092056;B03000;AMEACA;RUA PARA DE MINA;139;52070;17/2/2001 02:21:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;606589.43;797648.14;2196
+2198;2001092069;B03000;AMEACA;RUA CONTAGEM;1600;70293;17/2/2001 02:35:00;CIDADAO COMUM;S;;SANTA INES;BH;614360.04;801201.70;2197
+2199;2001092115;B06000;LESAO CORPORAL;RUA SAO PAULO;279;63464;17/2/2001 02:59:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611088.02;797493.26;2198
+2200;2001092138;B06000;LESAO CORPORAL;RUA PONTA GROSSA;905;14900;17/2/2001 03:18:00;CIDADAO COMUM;S;0;CRISTO REDENTOR;BH;604801.53;790245.22;2199
+2201;2001092142;B06000;LESAO CORPORAL;RUA QUARENTA E S;50;302841;17/2/2001 03:19:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614267.81;805802.32;2200
+2202;2001092155;B03000;AMEACA;RUA DR BROCHADO;16;23215;17/2/2001 03:28:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615833.96;798332.84;2201
+2203;2001092195;B04001;HOMICIDIO TENTAD;RUA TEBAS;401;67090;17/2/2001 03:47:00;INICIATIVA;N;0;VERA CRUZ;BH;615721.64;798265.77;2202
+2204;2001092237;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;877;6731;17/2/2001 04:22:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;610561.38;796714.77;2203
+2205;2001092245;B06000;LESAO CORPORAL;RUA PRELUDIO;239;101642;17/2/2001 04:30:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;607538.25;806790.64;2204
+2206;2001092278;B06000;LESAO CORPORAL;RUA DOUTOR CRIST;312;55598;17/2/2001 05:14:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;604751.25;789297.85;2205
+2207;2001092325;B03000;AMEACA;AV ITAITE;50;35441;17/2/2001 06:17:00;CIDADAO COMUM;S;;SAO GERALDO;BH;614822.25;799362.74;2206
+2208;2001092338;B03000;AMEACA;RUA CLOTILDE RIB;83;72507;17/2/2001 06:42:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608840.66;807990.84;2207
+2209;2001092503;B03000;AMEACA;AV CECILIA PINTO;125;14447;17/2/2001 09:08:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;610655.78;805320.47;2208
+2210;2001092544;B03000;AMEACA;RUA DO CAMPO;120;12136;17/2/2001 09:42:00;INICIATIVA;S;0;HAVAI;BH;607432.47;793601.64;2209
+2211;2001092547;B03000;AMEACA;RUA ERNESTO CARN;43;28099;17/2/2001 09:46:00;CIDADAO COMUM;N;CAA;PADRE EUSTAQUIO;BH;606439.90;797104.09;2210
+2212;2001092694;B03000;AMEACA;RUA AMERICA;41;3239;17/2/2001 11:46:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;611091.64;804986.46;2211
+2213;2001092801;B06000;LESAO CORPORAL;RUA FERNAO GOMES;160;119705;17/2/2001 13:13:00;INICIATIVA;S;0;VERA CRUZ;BH;616951.95;797377.70;2212
+2214;2001092891;B06000;LESAO CORPORAL;RUA A;335;78673;17/2/2001 14:05:00;CIDADAO COMUM;N;;CH JATOBA IV;BH;600123.46;788004.17;2213
+2215;2001092911;B03000;AMEACA;RUA ITABERA;296;35224;17/2/2001 14:23:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;614214.74;797171.59;2214
+2216;2001092913;B06000;LESAO CORPORAL;AV PRESIDENTE AN;758;4461;17/2/2001 14:21:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610544.46;798745.75;2215
+2217;2001093016;B03000;AMEACA;AV PRUDENTE DE M;393;55774;17/2/2001 15:23:00;CIDADAO COMUM;S;LJ01;CIDADE JARDIM;BH;610187.86;794922.92;2216
+2218;2001093022;B04001;HOMICIDIO TENTAD;RUA JULIO DE CAS;1232;39470;17/2/2001 15:25:00;CIDADAO COMUM;N;;CINQUENTENARIO;BH;606605.39;792116.47;2217
+2219;2001093134;B06000;LESAO CORPORAL;RUA PONTA PORA;28;54601;17/2/2001 16:29:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613149.37;796815.00;2218
+2220;2001093139;B03000;AMEACA;RUA TULIPA;1274;69851;17/2/2001 16:30:00;INICIATIVA;S;0;ESPLANADA;BH;615286.17;798382.46;2219
+2221;2001093251;B06000;LESAO CORPORAL;RUA FLOR DA ROMA;88;23808;17/2/2001 17:35:00;CIDADAO COMUM;S;;VILA IPE;BH;605882.08;799902.76;2220
+2222;2001093260;B03000;AMEACA;RUA DAS PRINCESA;101;55330;17/2/2001 17:45:00;CIDADAO COMUM;N;;VILA OESTE;BH;604262.01;794976.39;2221
+2223;2001093305;B03000;AMEACA;RUA CINQUENTA E ;89;106201;17/2/2001 18:13:00;CIDADAO COMUM;S;;NOVA YORK;BH;608593.49;810710.03;2222
+2224;2001093338;B03000;AMEACA;RUA SAO JOAO DE ;285;110073;17/2/2001 18:29:00;CIDADAO COMUM;S;;PILAR;BH;607532.32;788462.72;2223
+2225;2001093342;B03000;AMEACA;RUA DOS VIOLINOS;123;101797;17/2/2001 18:32:00;CIDADAO COMUM;S;AP202;CH CALIFORNIA;BH;603794.84;796641.72;2224
+2226;2001093355;B03000;AMEACA;RUA MARIA APAREC;100;43853;17/2/2001 18:45:00;CIDADAO COMUM;S;0;SAO MARCOS;BH;613901.71;802711.93;2225
+2227;2001093370;B03000;AMEACA;RUA DUZENTOS E T;73;24536;17/2/2001 18:50:00;CIDADAO COMUM;S;0;CH VALE DO JATOB;BH;600454.11;787414.72;2226
+2228;2001093392;B03000;AMEACA;RUA SANTA FRANCI;685;60655;17/2/2001 19:03:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608451.88;800571.03;2227
+2229;2001093398;B03000;AMEACA;RUA CAMASSARI;141;11754;17/2/2001 19:06:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;605030.60;790317.84;2228
+2230;2001093401;B06000;LESAO CORPORAL;RUA WALTER IANNI;80;82186;17/2/2001 19:08:00;INICIATIVA;N;0;SAO GABRIEL;BH;613192.78;803761.07;2229
+2231;2001093468;B06000;LESAO CORPORAL;RUA ENCOSTA;12;20406;17/2/2001 19:45:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607344.77;807411.00;2230
+2232;2001093531;B03000;AMEACA;RUA SAO MATIAS;320;63408;17/2/2001 20:13:00;CIDADAO COMUM;S;;SERRANO;BH;603539.80;800675.01;2231
+2233;2001093536;B02000;RIXA;RUA TOME DE SOUZ;935;67998;17/2/2001 20:15:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611457.69;795178.33;2232
+2234;2001093551;B04001;HOMICIDIO TENTAD;RUA BONFIM;641;10096;17/2/2001 20:21:00;CIDADAO COMUM;S;;BONFIM;BH;610151.96;798046.05;2233
+2235;2001093571;B06000;LESAO CORPORAL;RUA TOME DE SOUZ;935;67998;17/2/2001 20:32:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611457.69;795178.33;2234
+2236;2001093618;B03000;AMEACA;RUA DOS TUPIS;1642;69965;17/2/2001 20:50:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609682.21;797276.24;2235
+2237;2001093629;B03000;AMEACA;RUA JOSE JOAQUIM;255;38871;17/2/2001 20:54:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610954.46;802060.45;2236
+2238;2001093645;B06000;LESAO CORPORAL;AV DO CONTORNO;1955;17228;17/2/2001 20:57:00;CIDADAO COMUM;S;FR;CENTRO (BH);BH;612342.06;797489.86;2237
+2239;2001093660;B06000;LESAO CORPORAL;RUA PAU FERRO;335;102138;17/2/2001 21:08:00;CIDADAO COMUM;S;0;SOLIMOES;BH;612656.52;807906.15;2238
+2240;2001093665;B03000;AMEACA;RUA GEORGINA PEN;150;31006;17/2/2001 21:07:00;CIDADAO COMUM;S;A;SAO LUCAS;BH;614133.28;795705.78;2239
+2241;2001093683;B03000;AMEACA;RUA BOA VISTA;235;170170;17/2/2001 21:17:00;CIDADAO COMUM;S;;CABANA;BH;604488.55;794283.53;2240
+2242;2001093691;B02000;RIXA;RUA CANDELARIA;95;12501;17/2/2001 21:20:00;CIDADAO COMUM;S;CAC;VILA OESTE;BH;604307.70;795241.24;2241
+2243;2001093702;B04001;HOMICIDIO TENTAD;ESTRADA DO CERCA;2090;26428;17/2/2001 21:24:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607493.80;793552.14;2242
+2244;2001093794;B06000;LESAO CORPORAL;RUA BOAVENTURA;67;9783;17/2/2001 22:13:00;CIDADAO COMUM;S;;VILA INDAIA;BH;609601.28;804249.81;2243
+2245;2001093818;B03000;AMEACA;RUA VINTE E TRES;43;85550;17/2/2001 22:28:00;INICIATIVA;N;0;SERRA VERDE;BH;609894.94;810467.98;2244
+2246;2001093884;B06000;LESAO CORPORAL;RUA PORTO SEGURO;1331;60595;17/2/2001 23:07:00;CIDADAO COMUM;S;CAFR;NOVA VISTA;BH;615617.40;800842.65;2245
+2247;2001093995;B06000;LESAO CORPORAL;RUA TENENTE VITO;10;67351;17/2/2001 23:24:00;INICIATIVA;S;0;SANTA TEREZA;BH;613424.95;797503.01;2246
+2248;2001094047;B04001;HOMICIDIO TENTAD;RUA VINTE E SEIS;160;72780;17/2/2001 23:59:00;POLICIAL MILITAR;S;0;LEONINA;BH;608498.24;793329.27;2247
+2249;2001094074;B03000;AMEACA;RUA VIOLETA DE M;26;80253;18/2/2001 00:17:00;CIDADAO COMUM;S;0;SAO JOSE;BH;605328.14;799159.14;2248
+2250;2001094114;B03000;AMEACA;AV RAJA GABAGLIA;3500;57830;18/2/2001 00:48:00;INICIATIVA;N;0;ESTORIL;BH;609202.60;792327.00;2249
+2251;2001094130;B03000;AMEACA;RUA GABRO;412;30435;18/2/2001 00:59:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612889.45;797274.75;2250
+2252;2001094202;B06000;LESAO CORPORAL;RUA JOAQUIM RAMO;587;38175;18/2/2001 01:37:00;CIDADAO COMUM;N;0;PARAISO;BH;614891.10;796559.44;2251
+2253;2001094203;B02000;RIXA;RUA URSULA PAULI;1619;71066;18/2/2001 01:38:00;CIDADAO COMUM;S;AP04;ESTRELA DO ORIEN;BH;605719.59;792476.26;2252
+2254;2001094232;B04002;HOMICIDIO CONSUM;RUA FLAMENGO;16;130601;18/2/2001 01:59:00;CIDADAO COMUM;N;0;LEBLON;BH;605783.10;809975.35;2253
+2255;2001094234;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;470;63782;18/2/2001 02:00:00;INICIATIVA;N;0;MORRO DO PAPAGAI;BH;610865.34;793549.62;2254
+2256;2001094241;B06000;LESAO CORPORAL;RUA BONFIM;513;10096;18/2/2001 02:05:00;CIDADAO COMUM;S;;BONFIM;BH;610224.47;797941.04;2255
+2257;2001094250;B03000;AMEACA;RUA U;5;27260;18/2/2001 02:14:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616607.44;806842.86;2256
+2258;2001094269;B03000;AMEACA;AV COLETORA;204;78241;18/2/2001 02:34:00;CIDADAO COMUM;S;;VILA PINHO;BH;601871.72;788550.76;2257
+2259;2001094271;B03000;AMEACA;AV DO CONTORNO;6001;17228;18/2/2001 02:35:00;INICIATIVA;S;0;CARMO;BH;611659.17;794835.24;2258
+2260;2001094303;B06000;LESAO CORPORAL;RUA CORONEL ANTO;245;17619;18/2/2001 03:02:00;CIDADAO COMUM;S;;REGINA;BH;599153.96;790105.62;2259
+2261;2001094354;B06000;LESAO CORPORAL;RUA RITMO;168;301436;18/2/2001 04:01:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614143.53;795296.98;2260
+2262;2001094359;B06000;LESAO CORPORAL;RUA GUAICURUS;538;32009;18/2/2001 04:10:00;INICIATIVA;S;0;CENTRO BH;BH;611143.63;797659.74;2261
+2263;2001094388;B03000;AMEACA;RUA DUZENTOS E T;73;24536;18/2/2001 04:45:00;CIDADAO COMUM;S;0;CH VALE DO JATOB;BH;600454.11;787414.72;2262
+2264;2001094417;B03000;AMEACA;RUA EGITO;190;25189;18/2/2001 05:20:00;CIDADAO COMUM;S;0;SAO SALVADOR;BH;603437.23;799645.18;2263
+2265;2001094432;B04002;HOMICIDIO CONSUM;RUA CONDOR;445;16773;18/2/2001 05:38:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605847.00;793807.25;2264
+2266;2001094434;B03000;AMEACA;RUA TRIPUI;20;69763;18/2/2001 05:42:00;CIDADAO COMUM;S;;GUARANI;BH;612802.62;805718.90;2265
+2267;2001094445;B02000;RIXA;AV SARAMENHA;720;64007;18/2/2001 06:01:00;INICIATIVA;N;0;FLORAMAR;BH;612541.25;805817.83;2266
+2268;2001094448;B04001;HOMICIDIO TENTAD;RUA GENERAL LADA;171;36520;18/2/2001 06:14:00;CIDADAO COMUM;N;CA3;GOIANIA;BH;615050.81;802764.73;2267
+2269;2001094466;B04002;HOMICIDIO CONSUM;BECO SANTO ANTON;58;302091;18/2/2001 06:49:00;CIDADAO COMUM;N;;VILA CALIFORNIA;BH;603966.86;797275.61;2268
+2270;2001094515;B03000;AMEACA;RUA SAO PEDRO DO;19;63842;18/2/2001 07:54:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612040.86;803799.62;2269
+2271;2001094559;B03000;AMEACA;RUA FLOR DA PAIX;42;28782;18/2/2001 08:35:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;605881.83;799262.46;2270
+2272;2001094577;B03000;AMEACA;RUA CANARIO;703;50106;18/2/2001 08:50:00;CIDADAO COMUM;S;0;GOIANIA;BH;615544.37;803013.49;2271
+2273;2001094689;B06000;LESAO CORPORAL;RUA REGENCIA;100;301448;18/2/2001 10:29:00;INICIATIVA;S;0;VILA CAFEZAL;BH;614118.47;795470.66;2272
+2274;2001094709;B03000;AMEACA;RUA FREI LEOPOLD;153;29946;18/2/2001 10:40:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606823.65;802833.82;2273
+2275;2001094815;B06000;LESAO CORPORAL;AV OLEGARIO MACI;5;49699;18/2/2001 12:01:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610698.51;797640.81;2274
+2276;2001094854;B06000;LESAO CORPORAL;AV OIAPOQUE;264;49166;18/2/2001 12:30:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610918.13;797828.76;2275
+2277;2001094864;B04001;HOMICIDIO TENTAD;AV WALDIR SOEIRO;10;118904;18/2/2001 12:39:00;CIDADAO COMUM;N;0;MILIONARIOS;BH;603541.81;789510.67;2276
+2278;2001094868;B04001;HOMICIDIO TENTAD;RUA GENERAL OZOR;707;30901;18/2/2001 12:41:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;615594.65;797934.45;2277
+2279;2001094874;B06000;LESAO CORPORAL;RUA PIRAPORA;99;54176;18/2/2001 12:44:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;613695.01;796551.73;2278
+2280;2001094913;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;3792;17095;18/2/2001 13:15:00;INICIATIVA;N;0;SAGRADA FAMILIA;BH;613741.51;798439.29;2279
+2281;2001094970;B06000;LESAO CORPORAL;RUA DALMI CECILI;144;101176;18/2/2001 13:55:00;CIDADAO COMUM;N;CSC;FLORAMAR;BH;610937.76;807364.76;2280
+2282;2001095011;B06000;LESAO CORPORAL;AV MEM DE SA;1728;45395;18/2/2001 14:20:00;INICIATIVA;S;0;FAZENDINHA;BH;614290.42;795998.55;2281
+2283;2001095020;B03000;AMEACA;RUA BONFIM;544;10096;18/2/2001 14:27:00;CIDADAO COMUM;S;FU;BONFIM;BH;610213.22;797986.51;2282
+2284;2001095021;B03000;AMEACA;PRACA BAGATELLE;35;84720;18/2/2001 14:30:00;CIDADAO COMUM;S;;AEROPORTO DA PAM;BH;609214.07;804691.90;2283
+2285;2001095037;B06000;LESAO CORPORAL;RUA MARQUES DO L;482;44755;18/2/2001 14:36:00;CIDADAO COMUM;N;CA01;JOAO PINHEIRO;BH;604482.56;796269.88;2284
+2286;2001095043;B03000;AMEACA;RUA RADIALISTA M;1111;98864;18/2/2001 14:43:00;CIDADAO COMUM;S;;CEU AZUL;BH;604226.17;808393.41;2285
+2287;2001095089;B03000;AMEACA;RUA ITAPECERICA;42;35757;18/2/2001 15:19:00;CIDADAO COMUM;N;;LAGOINHA;BH;610796.43;798065.06;2286
+2288;2001095093;B03000;AMEACA;RUA CINABRIO;300;15276;18/2/2001 15:22:00;CIDADAO COMUM;S;CAFR;PRADO LOPES;BH;610021.42;798566.35;2287
+2289;2001095105;B06000;LESAO CORPORAL;RUA EDUARDO CARL;42;130582;18/2/2001 15:28:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604696.58;789263.56;2288
+2290;2001095106;B03000;AMEACA;RUA REIS DE ABRE;224;63363;18/2/2001 15:31:00;CIDADAO COMUM;N;;APARECIDA SETIMA;BH;608553.03;800581.70;2289
+2291;2001095119;B03000;AMEACA;RUA SAO TOMAS DE;595;63782;18/2/2001 15:39:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610837.70;793388.15;2290
+2292;2001095121;B03000;AMEACA;AV WASHINGTON LU;115;73701;18/2/2001 15:43:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;611072.54;804833.84;2291
+2293;2001095129;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS;6;63770;18/2/2001 15:46:00;CIDADAO COMUM;S;;PLANALTO;BH;610641.48;805609.77;2292
+2294;2001095179;B06000;LESAO CORPORAL;RUA MILTON DIAS;111;82712;18/2/2001 16:26:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;617080.52;803920.41;2293
+2295;2001095231;B06000;LESAO CORPORAL;BECO PRINCIPAL;230;170504;18/2/2001 17:00:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608596.19;793933.42;2294
+2296;2001095306;B06000;LESAO CORPORAL;AV DJALMA VIEIRA;994;53410;18/2/2001 17:56:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600495.77;787406.59;2295
+2297;2001095314;B06000;LESAO CORPORAL;RUA F;80;27487;18/2/2001 18:01:00;CIDADAO COMUM;S;0;VILA MARAVILHAS;BH;603084.51;795584.66;2296
+2298;2001095333;B03000;AMEACA;RUA JULITA NOGUE;406;39597;18/2/2001 18:18:00;CIDADAO COMUM;N;;SARANDI (URCA/BH;BH;603772.02;802478.16;2297
+2299;2001095337;B06000;LESAO CORPORAL;AV DOM JOAO VI;169;22294;18/2/2001 18:20:00;CIDADAO COMUM;N;;CINQUENTENARIO;BH;606195.21;792895.55;2298
+2300;2001095354;B03000;AMEACA;RUA ENGENHO DO O;73;103102;18/2/2001 18:35:00;CIDADAO COMUM;S;CAB;ENGENHO NOGUEIRA;BH;606446.26;800361.51;2299
+2301;2001095367;B03000;AMEACA;RUA BEIRA MAR;422;94992;18/2/2001 18:40:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603081.96;802265.91;2300
+2302;2001095389;B06000;LESAO CORPORAL;RUA CAMILO DE BR;248;11896;18/2/2001 18:52:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606212.93;797959.97;2301
+2303;2001095415;B06000;LESAO CORPORAL;RUA FREI LUIZ DE;140;29961;18/2/2001 19:06:00;CIDADAO COMUM;N;;ALTO DOS PINHEIR;BH;604876.04;795919.50;2302
+2304;2001095471;B04002;HOMICIDIO CONSUM;RUA FERNAO DIAS;1853;28133;18/2/2001 19:45:00;CIDADAO COMUM;N;0;JONAS VEIGA;BH;616249.53;797464.28;2303
+2305;2001095477;B03000;AMEACA;RUA ARIOLINO ARI;159;85811;18/2/2001 19:48:00;CIDADAO COMUM;S;0;SERRA VERDE;BH;609207.39;810119.05;2304
+2306;2001095530;B06000;LESAO CORPORAL;RUA JOSE PINTO D;10;100901;18/2/2001 20:18:00;CIDADAO COMUM;S;0;JARDIM GUANABARA;BH;611479.65;807085.75;2305
+2307;2001095609;B06000;LESAO CORPORAL;RUA CONEGO SANTA;546;16859;18/2/2001 20:58:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610600.04;801826.61;2306
+2308;2001095611;B03000;AMEACA;RUA JOEL JOSE DE;281;68698;18/2/2001 20:59:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;605046.83;791261.70;2307
+2309;2001095623;B06000;LESAO CORPORAL;RUA DOS TUPIS;369;69965;18/2/2001 21:06:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610933.97;796910.36;2308
+2310;2001095643;B04001;HOMICIDIO TENTAD;RUA REIS DE ABRE;440;63363;18/2/2001 21:18:00;CIDADAO COMUM;S;LJ1;APARECIDA SETIMA;BH;608751.51;800785.16;2309
+2311;2001095665;B03000;AMEACA;RUA MARIA PIETRA;125;2668;18/2/2001 21:28:00;INICIATIVA;N;0;SAO PAULO;BH;612440.02;802941.04;2310
+2312;2001095682;B03000;AMEACA;RUA PARANAMIRIM;24;52269;18/2/2001 21:41:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;605341.80;790124.53;2311
+2313;2001095693;B04001;HOMICIDIO TENTAD;RUA MUNIZ;149;170850;18/2/2001 21:47:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608113.39;793880.88;2312
+2314;2001095699;B03000;AMEACA;RUA CALDAS DA RA;2559;61100;18/2/2001 21:51:00;CIDADAO COMUM;S;CSA;SAO FRANCISCO;BH;608467.61;800980.26;2313
+2315;2001095707;B04001;HOMICIDIO TENTAD;RUA JOSE FELIX M;800;7416;18/2/2001 21:56:00;INICIATIVA;N;0;MANTIQUEIRA;BH;606465.11;810558.08;2314
+2316;2001095715;B03000;AMEACA;RUA CASCALHEIRA;177;13889;18/2/2001 22:01:00;CIDADAO COMUM;N;;VENDA NOVA;BH;609380.40;808731.30;2315
+2317;2001095755;B06000;LESAO CORPORAL;RUA DOS AFONSOS;371;1319;18/2/2001 22:28:00;CIDADAO COMUM;N;CA02;BOA VISTA;BH;615950.95;800243.51;2316
+2318;2001095758;B03000;AMEACA;RUA MANGARATIBA;174;42822;18/2/2001 22:31:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615031.70;799151.60;2317
+2319;2001095759;B03000;AMEACA;RUA CAMPOS SALES;472;12300;18/2/2001 22:31:00;CIDADAO COMUM;S;0;CALAFATE;BH;607050.85;796279.60;2318
+2320;2001095797;B03000;AMEACA;RUA SAO TOMAS DE;609;63782;18/2/2001 22:57:00;CIDADAO COMUM;N;0;MORRO DO PAPAGAI;BH;610837.70;793388.15;2319
+2321;2001095831;B03000;AMEACA;RUA STO ANTONIO;233;61759;18/2/2001 23:11:00;POLICIAL MILITAR;N;;SAO TOMAZ;BH;609990.56;805531.55;2320
+2322;2001095866;B03000;AMEACA;RUA CALDAS DA RA;805;61100;18/2/2001 23:29:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609644.68;802276.32;2321
+2323;2001095872;B04001;HOMICIDIO TENTAD;RUA JOAQUIM ANAC;23;118932;18/2/2001 23:32:00;CIDADAO COMUM;S;0;TEIXEIRA DIAS;BH;603052.88;789295.61;2322
+2324;2001095883;B06000;LESAO CORPORAL;AV DJALMA VIEIRA;764;53410;18/2/2001 23:40:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600529.64;787199.48;2323
+2325;2001095901;B03000;AMEACA;RUA AMERICO MAGA;560;3314;18/2/2001 23:48:00;CIDADAO COMUM;S;0;BARREIRO;BH;602218.78;790571.99;2324
+2326;2001095907;B06000;LESAO CORPORAL;RUA DOUTOR BENED;473;12252;18/2/2001 23:50:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;612581.15;803808.71;2325
+2327;2001095922;B06000;LESAO CORPORAL;RUA ANTONIO TEIX;715;119037;19/2/2001 00:01:00;CIDADAO COMUM;S;AP202;TEIXEIRA DIAS;BH;602289.75;790401.66;2326
+2328;2001095946;B04001;HOMICIDIO TENTAD;RUA ICO;126;34020;19/2/2001 00:21:00;CIDADAO COMUM;N;0;SAUDADE;BH;615030.21;797547.97;2327
+2329;2001095954;B06000;LESAO CORPORAL;RUA AGUIA;265;104625;19/2/2001 00:25:00;CIDADAO COMUM;S;;GOIANIA;BH;615619.21;803362.78;2328
+2330;2001095955;B03000;AMEACA;AV WALDOMIRO LOB;1500;66548;19/2/2001 00:26:00;CIDADAO COMUM;N;;GUARANI;BH;612111.73;805291.94;2329
+2331;2001096017;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;1368;31400;19/2/2001 01:05:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609964.47;797064.77;2330
+2332;2001096038;B03000;AMEACA;RUA LIGNITO;36;41050;19/2/2001 01:18:00;CIDADAO COMUM;S;AP 202;SANTA EFIGENIA;BH;613978.82;796630.25;2331
+2333;2001096442;B03000;AMEACA;RUA MODESTINO GO;119;84430;19/2/2001 09:48:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614906.32;800737.33;2332
+2334;2001096450;B06000;LESAO CORPORAL;AV SARAMENHA;170;64007;19/2/2001 09:57:00;CIDADAO COMUM;S;;FLORAMAR;BH;611924.76;805561.32;2333
+2335;2001096544;B06000;LESAO CORPORAL;RUA OSCAR LOBO P;27;104480;19/2/2001 11:02:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612321.28;803479.45;2334
+2336;2001096593;B06000;LESAO CORPORAL;RUA SAO PAULO;1106;63464;19/2/2001 11:42:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610856.65;796731.49;2335
+2337;2001096634;B03000;AMEACA;RUA PASSA TEMPO;600;52432;19/2/2001 12:15:00;INICIATIVA;S;;CARMO;BH;611611.62;794303.33;2336
+2338;2001096635;B03000;AMEACA;RUA LOURDES;84;108106;19/2/2001 12:17:00;CIDADAO COMUM;N;CA12;SANTA MONICA DO ;BH;605821.64;808586.26;2337
+2339;2001096677;B03000;AMEACA;RUA MARIO SOARES;980;44641;19/2/2001 12:50:00;CIDADAO COMUM;N;A;DOM BOSCO;BH;604460.37;797645.73;2338
+2340;2001096678;B03000;AMEACA;RUA SAO RICARDO;124;83920;19/2/2001 12:52:00;CIDADAO COMUM;N;;PAULO SEXTO;BH;616411.25;806313.89;2339
+2341;2001096679;B06000;LESAO CORPORAL;RUA JOEL SANTANA;50;100205;19/2/2001 12:53:00;CIDADAO COMUM;S;;BRAUNAS;BH;603823.79;804620.90;2340
+2342;2001096737;B03000;AMEACA;RUA ANTONIO LUCI;83;14709;19/2/2001 13:43:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600810.66;787478.72;2341
+2343;2001096750;B08000;VIOLACAO DE DOMI;RUA SANTOS;1639;61910;19/2/2001 13:50:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607707.17;793808.83;2342
+2344;2001097001;B06000;LESAO CORPORAL;RUA LAGOA DA PRA;454;40187;19/2/2001 16:24:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606490.48;794951.41;2343
+2345;2001097013;B03000;AMEACA;RUA SAO CLEMENTE;1258;62197;19/2/2001 16:31:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609535.38;800385.58;2344
+2346;2001097029;B03000;AMEACA;RUA TEBAS;820;67090;19/2/2001 16:45:00;INICIATIVA;N;0;VERA CRUZ;BH;616073.41;798319.09;2345
+2347;2001097050;B06000;LESAO CORPORAL;RUA RADIALISTA M;162;81127;19/2/2001 17:02:00;CIDADAO COMUM;N;;CEU AZUL;BH;604385.56;808571.36;2346
+2348;2001097165;B03000;AMEACA;RUA JAIME SALSE;118;36848;19/2/2001 18:21:00;CIDADAO COMUM;N;0;MAGNESITA;BH;604098.60;793775.56;2347
+2349;2001097191;B06000;LESAO CORPORAL;AV MEIER;570;83857;19/2/2001 18:37:00;INICIATIVA;S;;ZOOLOGICO;BH;603156.99;802837.24;2348
+2350;2001097200;B03000;AMEACA;RUA DA BOLIVIA;758;9884;19/2/2001 18:40:00;CIDADAO COMUM;N;;SION;BH;610943.73;793524.50;2349
+2351;2001097207;B02000;RIXA;RUA NHONHO BROCH;214;47580;19/2/2001 18:45:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;604635.54;792049.77;2350
+2352;2001097218;B03000;AMEACA;RODOVIA MG 20;68;26620;19/2/2001 18:52:00;CIDADAO COMUM;S;0;BELO HORIZONTE (;BH;614262.81;805994.36;2351
+2353;2001097225;B03000;AMEACA;RUA GILBERTO FRE;40;92593;19/2/2001 18:56:00;CIDADAO COMUM;N;0;CHACARAS REUNIDA;BH;605821.94;789605.11;2352
+2354;2001097292;B06000;LESAO CORPORAL;RUA BEGONIA;71;94889;19/2/2001 19:37:00;INICIATIVA;S;0;LINDEIA;BH;599348.67;790354.44;2353
+2355;2001097302;B06000;LESAO CORPORAL;RUA CECILIA MARI;132;78759;19/2/2001 19:50:00;CIDADAO COMUM;S;0;CH JATOBA IV;BH;600506.19;787792.37;2354
+2356;2001097305;B06000;LESAO CORPORAL;RUA CINCO;25;27128;19/2/2001 19:52:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616801.10;806900.75;2355
+2357;2001097357;B03000;AMEACA;RUA DOM LUCIO AN;411;22382;19/2/2001 20:31:00;CIDADAO COMUM;S;AP502;CORACAO EUCARIST;BH;605812.96;796643.35;2356
+2358;2001097370;B03000;AMEACA;RUA FILEMON MATO;121;91824;19/2/2001 20:39:00;INICIATIVA;S;0;LINDEIA;BH;599659.84;791195.04;2357
+2359;2001097451;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;1472;6731;19/2/2001 21:34:00;CIDADAO COMUM;S;PX1454;BARRO PRETO;BH;609889.16;796941.60;2358
+2360;2001097482;B03000;AMEACA;RUA ERNESTO TOGN;22;129850;19/2/2001 22:01:00;CIDADAO COMUM;S;0;GORDURAS;BH;616254.09;803812.57;2359
+2361;2001097533;B03000;AMEACA;RUA BARROQUINHA;50;170498;19/2/2001 22:51:00;CIDADAO COMUM;N;AN2;CABANA;BH;604310.01;794399.73;2360
+2362;2001097539;B04001;HOMICIDIO TENTAD;RUA DEZ;84;108538;19/2/2001 22:56:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;604982.91;791211.23;2361
+2363;2001097639;B03000;AMEACA;RUA DOUTOR CAMIL;17;23228;20/2/2001 00:17:00;CIDADAO COMUM;S;PX17;SAO LUCAS;BH;613282.55;795474.81;2362
+2364;2001097640;B03000;AMEACA;RUA MARECHAL HEN;75;38351;20/2/2001 00:18:00;CIDADAO COMUM;N;;TUPI;BH;612646.28;806452.90;2363
+2365;2001097819;B03000;AMEACA;RUA REMI PEREIRA;120;96727;20/2/2001 06:27:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;614954.59;806157.68;2364
+2366;2001097842;B03000;AMEACA;RUA CABEDELO;18;82016;20/2/2001 06:57:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614170.46;804650.36;2365
+2367;2001097945;B03000;AMEACA;RUA PONTA GROSSA;892;14900;20/2/2001 08:13:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604828.64;790426.10;2366
+2368;2001098267;B03000;AMEACA;RUA ANGOLA;28;4001;20/2/2001 12:18:00;CIDADAO COMUM;S;;SAO PAULO;BH;612347.81;802847.99;2367
+2369;2001098314;B03000;AMEACA;RUA JAIR AFONSO ;11;53104;20/2/2001 12:57:00;CIDADAO COMUM;N;;PIRATININGA;BH;606718.57;809902.65;2368
+2370;2001098373;B03000;AMEACA;RUA BONFIM DE AB;23;10102;20/2/2001 13:50:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610768.91;802546.50;2369
+2371;2001098400;B04001;HOMICIDIO TENTAD;RUA MARTA GONCAL;139;102847;20/2/2001 14:08:00;POLICIAL MILITAR;N;0;CH DA LAGOA;BH;604899.39;802953.25;2370
+2372;2001098481;B06000;LESAO CORPORAL;RUA JOAO GOMIDE ;193;68921;20/2/2001 15:03:00;CIDADAO COMUM;N;;COQUEIROS;BH;602301.00;798690.19;2371
+2373;2001098536;B03000;AMEACA;AV DOM PEDRO II;1426;53145;20/2/2001 15:35:00;CIDADAO COMUM;N;;BONFIM;BH;609360.60;798114.20;2372
+2374;2001098539;B03000;AMEACA;RUA RADIALISTA J;45;99031;20/2/2001 15:36:00;INICIATIVA;S;0;CEU AZUL;BH;604501.89;808357.72;2373
+2375;2001098547;B03000;AMEACA;RUA J;329;47350;20/2/2001 15:41:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601281.34;788532.74;2374
+2376;2001098696;B03000;AMEACA;RUA URCA;800;71040;20/2/2001 16:59:00;CIDADAO COMUM;N;;SARANDI (URCA/BH;BH;602998.93;802378.25;2375
+2377;2001098874;B03000;AMEACA;AV ABILIO MACHAD;1054;634;20/2/2001 18:34:00;CIDADAO COMUM;S;;CONJUNTO ALIPIO ;BH;604787.27;798591.50;2376
+2378;2001098894;B04002;HOMICIDIO CONSUM;RUA RAIMUNDO TIN;150;301229;20/2/2001 18:45:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610732.45;793209.20;2377
+2379;2001099048;B03000;AMEACA;RUA JOAQUIM RAMO;326;38175;20/2/2001 20:20:00;CIDADAO COMUM;S;;PARAISO;BH;614858.19;796846.14;2378
+2380;2001099086;B03000;AMEACA;RUA BARAO DE CAM;188;7850;20/2/2001 20:43:00;CIDADAO COMUM;S;;SAO JOSE;BH;605155.86;798480.70;2379
+2381;2001099109;B03000;AMEACA;AV MARIA CONCEIC;1075;32052;20/2/2001 20:58:00;CIDADAO COMUM;S;CAFU;GOIANIA;BH;615361.70;803442.89;2380
+2382;2001099173;B03000;AMEACA;AV DOUTOR CRISTI;2152;62459;20/2/2001 21:38:00;CIDADAO COMUM;S;;ITAPOA;BH;609739.69;806030.28;2381
+2383;2001099274;B06000;LESAO CORPORAL;RUA LUPERCIO PAI;50;57335;20/2/2001 22:40:00;INICIATIVA;N;0;TIROL;BH;599917.53;789181.52;2382
+2384;2001099286;B03000;AMEACA;RUA DONA SINVALI;435;59863;20/2/2001 22:48:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615490.44;807265.68;2383
+2385;2001099327;B03000;AMEACA;RUA JOAO PAULO I;65;300458;20/2/2001 23:10:00;CIDADAO COMUM;N;;SAO DOMINGOS;BH;607677.28;793509.05;2384
+2386;2001099335;B06000;LESAO CORPORAL;RUA RADIALISTA C;25;57348;20/2/2001 23:15:00;INICIATIVA;N;0;CEU AZUL;BH;604520.56;807229.82;2385
+2387;2001099387;B03000;AMEACA;RUA JACOB MARRA ;53;119847;20/2/2001 23:49:00;CIDADAO COMUM;S;AP103;SERRA VERDE;BH;609498.28;810533.01;2386
+2388;2001099418;B04001;HOMICIDIO TENTAD;RUA RAMIRO SIQUE;95;128858;21/2/2001 00:08:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617771.12;797214.62;2387
+2389;2001099453;B03000;AMEACA;RUA JOAQUIM GOUV;12;1422;21/2/2001 00:43:00;CIDADAO COMUM;S;0;SAO PAULO;BH;612535.79;802867.60;2388
+2390;2001099486;B06000;LESAO CORPORAL;RUA CELIO DINIZ;215;111656;21/2/2001 01:11:00;CIDADAO COMUM;S;0;RIO BRANCO;BH;606714.88;808783.28;2389
+2391;2001099659;B03000;AMEACA;RUA CABEDELO;70;82016;21/2/2001 06:42:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614177.56;804723.53;2390
+2392;2001099661;B03000;AMEACA;RUA UBA;313;70149;21/2/2001 06:44:00;CIDADAO COMUM;S;APT214;FLORESTA;BH;611232.61;798155.29;2391
+2393;2001099688;B06000;LESAO CORPORAL;AV CRISTIANO MAC;4000;18652;21/2/2001 07:13:00;INICIATIVA;N;0;PALMARES;BH;612434.91;802092.92;2392
+2394;2001099706;B04001;HOMICIDIO TENTAD;RUA SANTA CRUZ;5;23360;21/2/2001 07:25:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617658.23;797386.88;2393
+2395;2001099720;B03000;AMEACA;RUA MUNHOZ;578;13573;21/2/2001 07:36:00;CIDADAO COMUM;N;AP202;SANTA ROSA;BH;610348.81;803561.40;2394
+2396;2001099721;B06000;LESAO CORPORAL;RUA DOS GUARANIS;6;32181;21/2/2001 07:37:00;INICIATIVA;S;0;CENTRO BH;BH;610799.21;797579.92;2395
+2397;2001099846;B03000;AMEACA;RUA HERCULANO MO;105;37967;21/2/2001 09:00:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605544.73;793496.43;2396
+2398;2001099870;B03000;AMEACA;PRACA DUQUE DE C;15;24145;21/2/2001 09:19:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;613412.06;797495.79;2397
+2399;2001099926;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;1663;40770;21/2/2001 09:57:00;INICIATIVA;S;0;VERA CRUZ;BH;616032.33;798192.27;2398
+2400;2001099942;B03000;AMEACA;RUA REYNALDO SMI;104;111177;21/2/2001 10:06:00;CIDADAO COMUM;S;APTO 201;SANTA AMELIA;BH;606951.74;805850.94;2399
+2401;2001099998;B03000;AMEACA;RUA JOSE DE LIMA;52;38897;21/2/2001 10:49:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611909.78;805737.84;2400
+2402;2001100060;B06000;LESAO CORPORAL;RUA FERNAO DIAS;923;28133;21/2/2001 11:49:00;INICIATIVA;N;0;CAETANO FURQUIM;BH;616127.28;798063.59;2401
+2403;2001100061;B06000;LESAO CORPORAL;AV PRESIDENTE AN;2747;4461;21/2/2001 11:49:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;609898.08;800576.10;2402
+2404;2001100130;B06000;LESAO CORPORAL;AV FRANCISCO DES;364;29400;21/2/2001 12:47:00;INICIATIVA;S;0;ANCHIETA;BH;612071.32;794111.30;2403
+2405;2001100180;B03000;AMEACA;AV SEBASTIAO DE ;97;116101;21/2/2001 13:27:00;CIDADAO COMUM;S;0;DONA CLARA;BH;610312.62;803707.12;2404
+2406;2001100259;B03000;AMEACA;RUA VINTE E TRES;71;101730;21/2/2001 14:33:00;CIDADAO COMUM;N;;SAO MARCOS;BH;614482.87;802741.97;2405
+2407;2001100349;B02000;RIXA;RUA DOS COMERCIA;187;101251;21/2/2001 15:34:00;CIDADAO COMUM;N;0;CONJUNTO ALIPIO ;BH;604650.57;799721.85;2406
+2408;2001100382;B06000;LESAO CORPORAL;RUA GUAICURUS;547;32009;21/2/2001 15:53:00;INICIATIVA;N;0;CENTRO (BH);BH;611125.89;797629.28;2407
+2409;2001100404;B06000;LESAO CORPORAL;RUA DOS CAETES;920;11376;21/2/2001 16:12:00;INICIATIVA;S;0;CENTRO BH;BH;610732.50;797574.81;2408
+2410;2001100413;B03000;AMEACA;RUA DONA CONCEIC;365;16528;21/2/2001 16:14:00;CIDADAO COMUM;S;;JARDIM FLORENCIA;BH;604771.69;810125.01;2409
+2411;2001100497;B04001;HOMICIDIO TENTAD;RUA UM;29;302808;21/2/2001 16:59:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614345.23;805792.20;2410
+2412;2001100543;B03000;AMEACA;RUA DA OLARIA;388;18640;21/2/2001 17:18:00;CIDADAO COMUM;S;;OLARIA;BH;601188.13;789175.19;2411
+2413;2001100583;B03000;AMEACA;RUA OITO;491;117287;21/2/2001 17:34:00;CIDADAO COMUM;S;CAA;LINDEIA;BH;599818.67;790753.26;2412
+2414;2001100600;B04001;HOMICIDIO TENTAD;RUA BEZERRA DE M;99;9525;21/2/2001 17:39:00;INICIATIVA;N;0;NAZARE;BH;615471.18;804578.13;2413
+2415;2001100669;B03000;AMEACA;RUA CURITIBA;914;19090;21/2/2001 18:14:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610779.71;797017.51;2414
+2416;2001100684;B03000;AMEACA;AV BALEARES;319;89333;21/2/2001 18:23:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;608067.53;809872.95;2415
+2417;2001100700;B06000;LESAO CORPORAL;RUA F;62;105278;21/2/2001 18:32:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;614864.40;807874.65;2416
+2418;2001100707;B03000;AMEACA;RUA DES BRAULIO;1359;19917;21/2/2001 18:35:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616284.49;797815.10;2417
+2419;2001100722;B03000;AMEACA;RUA MONTE BRANCO;470;46417;21/2/2001 18:51:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606655.16;795731.00;2418
+2420;2001100750;B03000;AMEACA;PRACA SAO VICENT;60;63902;21/2/2001 19:04:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605439.94;797844.56;2419
+2421;2001100778;B03000;AMEACA;AV CARANDAI;219;13081;21/2/2001 19:18:00;INICIATIVA;S;0;FUNCIONARIOS;BH;612589.23;796026.58;2420
+2422;2001100783;B03000;AMEACA;AV ARTUR BERNARD;2848;60844;21/2/2001 19:20:00;INICIATIVA;S;0;VILA PARIS;BH;610410.67;793282.74;2421
+2423;2001100826;B04002;HOMICIDIO CONSUM;RUA MALVA;10;115760;21/2/2001 19:45:00;INICIATIVA;S;0;HAVAI;BH;607288.35;793433.20;2422
+2424;2001100881;B03000;AMEACA;RUA AMUR;48;3497;21/2/2001 20:14:00;CIDADAO COMUM;S;0;CH BETANIA;BH;605011.02;792353.02;2423
+2425;2001100901;B03000;AMEACA;AV PRESIDENTE AN;7920;4461;21/2/2001 20:23:00;CIDADAO COMUM;S;0;SAO LUIZ;BH;608635.14;804693.17;2424
+2426;2001100941;B03000;AMEACA;RUA PADRE EUSTAQ;2401;51294;21/2/2001 20:50:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;607335.24;797620.70;2425
+2427;2001100943;B04001;HOMICIDIO TENTAD;RUA VINTE E DOIS;23;118702;21/2/2001 20:51:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604092.74;807628.21;2426
+2428;2001100968;B03000;AMEACA;RUA ARACA;52;5262;21/2/2001 21:07:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;609876.75;799484.37;2427
+2429;2001101001;B06000;LESAO CORPORAL;RUA DOMINGOS ROC;343;22631;21/2/2001 21:32:00;CIDADAO COMUM;S;CAD;SALGADO FILHO;BH;606524.25;795445.27;2428
+2430;2001101004;B03000;AMEACA;RUA RADIALISTA O;122;103446;21/2/2001 21:32:00;CIDADAO COMUM;S;CSB;CEU AZUL;BH;604457.63;808510.55;2429
+2431;2001101041;B03000;AMEACA;RUA FREDERICO BR;300;51080;21/2/2001 21:57:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608056.63;797436.64;2430
+2432;2001101211;B03000;AMEACA;RUA JACUTINGA;90;36750;21/2/2001 23:44:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606244.30;797617.34;2431
+2433;2001101246;B04001;HOMICIDIO TENTAD;AV FREI ANDREONI;609;75533;22/2/2001 00:05:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606840.37;793987.35;2432
+2434;2001101267;B06000;LESAO CORPORAL;RUA LISBOA;598;41252;22/2/2001 00:18:00;CIDADAO COMUM;N;0;COPACABANA;BH;606187.97;806472.44;2433
+2435;2001101290;B06000;LESAO CORPORAL;RUA W QUATRO;514;122634;22/2/2001 00:35:00;CIDADAO COMUM;S;;PONGELUPE;BH;603929.62;787324.64;2434
+2436;2001101310;B03000;AMEACA;RUA ALCEU AMOROS;73;102024;22/2/2001 00:54:00;CIDADAO COMUM;N;;MINEIRAO;BH;601744.06;785344.75;2435
+2437;2001101452;B06000;LESAO CORPORAL;RUA PINTOR AUGUS;285;128091;22/2/2001 04:24:00;CIDADAO COMUM;N;;TUPI;BH;613297.04;805806.56;2436
+2438;2001101460;B02000;RIXA;AV OLEGARIO MACI;579;49699;22/2/2001 04:48:00;INICIATIVA;N;VAGA LUME CENTER;CENTRO BH;BH;610560.87;797092.76;2437
+2439;2001101499;B03000;AMEACA;BECO LORENCO SIL;260;302105;22/2/2001 05:55:00;CIDADAO COMUM;N;0;JARDIM LEBLON;BH;605709.69;807233.04;2438
+2440;2001101671;B03000;AMEACA;RUA DOUTOR ANTON;60;23130;22/2/2001 08:49:00;CIDADAO COMUM;S;0;SAO CRISTOVAO;BH;610229.36;799732.11;2439
+2441;2001101860;B03000;AMEACA;RUA JURUA;955;39799;22/2/2001 10:40:00;CIDADAO COMUM;N;0;DA GRACA;BH;612096.46;799861.01;2440
+2442;2001101898;B03000;AMEACA;RUA TEBAS;253;67090;22/2/2001 11:07:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615547.45;798229.16;2441
+2443;2001101930;B06000;LESAO CORPORAL;RUA SAO PAULO;249;63464;22/2/2001 11:31:00;CIDADAO COMUM;N;SALA 308;CENTRO (BH);BH;611100.20;797529.33;2442
+2444;2001101935;B03000;AMEACA;AV STA ROSA;166;61301;22/2/2001 11:34:00;CIDADAO COMUM;S;0;SAO LUIZ;BH;608988.02;804670.34;2443
+2445;2001102015;B06000;LESAO CORPORAL;RUA BURI;51;10764;22/2/2001 12:27:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;610328.10;801370.73;2444
+2446;2001102059;B03000;AMEACA;RUA POUSO ALEGRE;1314;54932;22/2/2001 13:04:00;CIDADAO COMUM;S;;FLORESTA;BH;612350.46;797901.33;2445
+2447;2001102067;B06000;LESAO CORPORAL;RUA AMELIA NAVES;62;91345;22/2/2001 13:13:00;CIDADAO COMUM;S;;PALMEIRAS;BH;606759.30;791240.11;2446
+2448;2001102218;B03000;AMEACA;RUA CAICARA;1381;11451;22/2/2001 14:58:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;616106.59;799365.14;2447
+2449;2001102250;B06000;LESAO CORPORAL;AV SILVIANO BRAN;652;66002;22/2/2001 15:18:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612067.13;798452.85;2448
+2450;2001102414;B03000;AMEACA;RUA JOSE GONCALV;99;38828;22/2/2001 16:36:00;CIDADAO COMUM;N;;BARREIRO;BH;602247.62;791245.80;2449
+2451;2001102436;B03000;AMEACA;AV DOM PEDRO I;1680;48337;22/2/2001 16:48:00;CIDADAO COMUM;S;;ITAPOA;BH;608647.29;806767.29;2450
+2452;2001102504;B06000;LESAO CORPORAL;RUA ESPINOSA;183;26024;22/2/2001 17:32:00;CIDADAO COMUM;N;;SANTO ANDRE;BH;609102.22;798462.10;2451
+2453;2001102675;B03000;AMEACA;RUA JULIO DE CAS;1227;39470;22/2/2001 19:08:00;INICIATIVA;S;0;CINQUENTENARIO;BH;606610.98;792052.30;2452
+2454;2001102682;B03000;AMEACA;RUA ARTUR ALVIM;265;6110;22/2/2001 19:12:00;CIDADAO COMUM;S;;INSTITUTO AGRONO;BH;613624.18;798721.80;2453
+2455;2001102701;B06000;LESAO CORPORAL;RUA MARIA BEATRI;1038;43881;22/2/2001 19:29:00;CIDADAO COMUM;N;;HAVAI;BH;607183.31;792946.88;2454
+2456;2001102705;B03000;AMEACA;RUA CONDOR;253;16773;22/2/2001 19:31:00;CIDADAO COMUM;N;CAB;NOVA CINTRA;BH;605677.65;793973.38;2455
+2457;2001102769;B03000;AMEACA;RUA CONDE DE PAL;200;16685;22/2/2001 20:02:00;CIDADAO COMUM;S;AP103;CABANA;BH;604461.38;793915.85;2456
+2458;2001102795;B03000;AMEACA;RUA DOUTOR CRIST;185;55598;22/2/2001 20:23:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604650.82;789126.07;2457
+2459;2001102845;B03000;AMEACA;RUA MARIA AMELIA;721;43812;22/2/2001 21:03:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610257.12;805510.06;2458
+2460;2001102872;B04001;HOMICIDIO TENTAD;BECO HELIOTERIO;100;170863;22/2/2001 21:22:00;INICIATIVA;S;0;LEONINA;BH;608285.06;793705.32;2459
+2461;2001102887;B03000;AMEACA;RUA SAO PEDRO;51;96046;22/2/2001 21:32:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614466.68;803349.59;2460
+2462;2001102946;B04001;HOMICIDIO TENTAD;RUA DOS FRANCISC;50;62723;22/2/2001 22:21:00;CIDADAO COMUM;N;CA1;PLANALTO;BH;610878.58;805675.14;2461
+2463;2001102961;B06000;LESAO CORPORAL;RUA SAO PAULO;78;63464;22/2/2001 22:27:00;INICIATIVA;N;0;CENTRO BH;BH;611107.57;797698.12;2462
+2464;2001102980;B06000;LESAO CORPORAL;RUA MARIA ROSA D;719;107800;22/2/2001 22:42:00;INICIATIVA;N;0;MANTIQUEIRA;BH;606463.33;811640.07;2463
+2465;2001103016;B06000;LESAO CORPORAL;AV BRIGADEIRO ED;980;2860;22/2/2001 22:59:00;CIDADAO COMUM;S;0;GLORIA;BH;604325.87;798595.64;2464
+2466;2001103020;B06000;LESAO CORPORAL;AV MEM DE SA;1310;45395;22/2/2001 23:09:00;CIDADAO COMUM;N;0;PARAISO;BH;614204.17;796304.90;2465
+2467;2001103029;B06000;LESAO CORPORAL;RUA AMERICO SCOT;63;3342;22/2/2001 23:12:00;CIDADAO COMUM;N;;SERRA;BH;612649.72;795554.59;2466
+2468;2001103096;B04002;HOMICIDIO CONSUM;AV RAJA GABAGLIA;2222;57830;22/2/2001 23:57:00;INICIATIVA;S;0;ESTORIL;BH;608853.99;793279.32;2467
+2469;2001103238;B03000;AMEACA;RUA CUIABA;1243;81269;23/2/2001 01:19:00;CIDADAO COMUM;S;AP401;BARROCA;BH;607852.76;795971.31;2468
+2470;2001103353;B03000;AMEACA;RUA MANOEL COUTO;560;43056;23/2/2001 03:23:00;CIDADAO COMUM;S;;CIDADE JARDIM;BH;609733.64;794645.46;2469
+2471;2001103382;B04002;HOMICIDIO CONSUM;PRACA BERNARDO D;50;9424;23/2/2001 03:54:00;CIDADAO COMUM;N;0;ERMELINDA;BH;609134.84;801050.78;2470
+2472;2001103393;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;4000;18652;23/2/2001 03:58:00;INICIATIVA;S;0;DOS PALMARES;BH;612434.91;802092.92;2471
+2473;2001103394;B03000;AMEACA;RUA MARFIM;734;50207;23/2/2001 04:03:00;CIDADAO COMUM;S;;COQUEIROS;BH;602183.65;798513.40;2472
+2474;2001103445;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;322;51657;23/2/2001 05:10:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;609650.08;808286.90;2473
+2475;2001103487;B06000;LESAO CORPORAL;AV OLEGARIO MACI;657;49699;23/2/2001 05:59:00;POLICIAL MILITAR;N;0;CENTRO (BH);BH;610536.33;797017.45;2474
+2476;2001103551;B06000;LESAO CORPORAL;RUA CAETES;16;31208;23/2/2001 07:13:00;CIDADAO COMUM;S;;CONJ HAB JARDIM ;BH;603845.30;798142.06;2475
+2477;2001103582;B03000;AMEACA;RUA SANTA CRUZ;140;23360;23/2/2001 07:35:00;CIDADAO COMUM;N;0;TAQUARIL;BH;617675.20;797420.56;2476
+2478;2001103607;B04001;HOMICIDIO TENTAD;RUA TEBAS;267;67090;23/2/2001 07:49:00;INICIATIVA;N;0;VERA CRUZ;BH;615547.45;798229.16;2477
+2479;2001103731;B03000;AMEACA;RUA ANITA BLUMBE;19;38815;23/2/2001 08:53:00;CIDADAO COMUM;S;;BANDEIRANTES;BH;606031.12;802912.13;2478
+2480;2001103762;B03000;AMEACA;RUA DOS GUARANIS;100;32181;23/2/2001 09:12:00;INICIATIVA;N;0;CENTRO (BH);BH;610735.90;797543.55;2479
+2481;2001103903;B03000;AMEACA;RUA JORNALISTA M;97;20488;23/2/2001 10:41:00;CIDADAO COMUM;N;0;ANTONIO RIBEIRO ;BH;615929.10;806739.07;2480
+2482;2001104110;B03000;AMEACA;RUA PADRE JULIO ;1070;51496;23/2/2001 13:10:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615893.98;797514.95;2481
+2483;2001104345;B03000;AMEACA;AV BRASIL;723;10420;23/2/2001 15:36:00;CIDADAO COMUM;S;AP1404;SANTA EFIGENIA;BH;612425.27;796268.81;2482
+2484;2001104401;B02000;RIXA;RUA SEBASTIAO FE;170;29063;23/2/2001 16:33:00;CIDADAO COMUM;N;0;CALIFORNIA;BH;603429.75;796223.66;2483
+2485;2001104402;B06000;LESAO CORPORAL;RUA DIVA;180;109950;23/2/2001 16:34:00;CIDADAO COMUM;S;0;SANTA MONICA DO ;BH;606025.20;808435.76;2484
+2486;2001104404;B06000;LESAO CORPORAL;RUA NARCISA PERE;325;78720;23/2/2001 16:34:00;INICIATIVA;N;0;CH JATOBA IV;BH;600341.04;787842.12;2485
+2487;2001104406;B06000;LESAO CORPORAL;RUA BIMBARRA;350;9641;23/2/2001 16:34:00;CIDADAO COMUM;S;;CALAFATE;BH;607195.50;796594.64;2486
+2488;2001104409;B03000;AMEACA;RUA SAO MANOEL;197;63335;23/2/2001 16:35:00;CIDADAO COMUM;S;0;FLORESTA;BH;611949.84;798441.30;2487
+2489;2001104410;B03000;AMEACA;RUA JOAQUIM DE F;1313;38033;23/2/2001 16:35:00;CIDADAO COMUM;S;;SANTA HELENA (BH;BH;603050.87;790075.16;2488
+2490;2001104431;B04001;HOMICIDIO TENTAD;RUA LUIZ LOPES;232;94431;23/2/2001 16:40:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606295.93;801150.74;2489
+2491;2001104600;B06000;LESAO CORPORAL;RUA SENHORA DO P;2842;62231;23/2/2001 17:54:00;CIDADAO COMUM;N;;CINQUENTENARIO;BH;606406.64;790677.98;2490
+2492;2001104609;B06000;LESAO CORPORAL;RUA PAULO KRUGER;204;55910;23/2/2001 18:01:00;CIDADAO COMUM;S;;FLORAMAR;BH;611701.18;806916.68;2491
+2493;2001104889;B06000;LESAO CORPORAL;RUA CONCEICAO CH;117;20387;23/2/2001 20:23:00;CIDADAO COMUM;S;0;SAO JOAO BATISTA;BH;608745.78;808046.24;2492
+2494;2001104903;B06000;LESAO CORPORAL;AV PARANA;523;52230;23/2/2001 20:34:00;INICIATIVA;N;0;CENTRO (BH);BH;610725.40;796994.57;2493
+2495;2001104918;B03000;AMEACA;RUA G;50;47435;23/2/2001 20:39:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601086.93;788642.82;2494
+2496;2001105009;B03000;AMEACA;AV PRESIDENTE AN;4040;4461;23/2/2001 21:22:00;INICIATIVA;N;0;SAO FRANCISCO;BH;609574.90;802239.54;2495
+2497;2001105146;B06000;LESAO CORPORAL;RUA SAO PAULO;271;63464;23/2/2001 22:37:00;INICIATIVA;S;VP7782;CENTRO (BH);BH;611088.90;797498.96;2496
+2498;2001105154;B06000;LESAO CORPORAL;RUA MENDES;99;26963;23/2/2001 22:41:00;INICIATIVA;N;0;PIRAJA;BH;613234.27;802879.31;2497
+2499;2001105165;B06000;LESAO CORPORAL;AV SARAMENHA;1072;64007;23/2/2001 22:47:00;INICIATIVA;S;0;GUARANI;BH;612916.89;805724.57;2498
+2500;2001105214;B03000;AMEACA;RUA CORONEL ALVA;25;17520;23/2/2001 23:25:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611475.38;806507.14;2499
+2501;2001105223;B03000;AMEACA;RUA DESEMBARGADO;1456;94891;23/2/2001 23:27:00;CIDADAO COMUM;S;;ENGENHO NOGUEIRA;BH;606512.31;801019.24;2500
+2502;2001105264;B06000;LESAO CORPORAL;AV GUARAPARI;1234;20711;23/2/2001 23:54:00;CIDADAO COMUM;S;0;JARDIM ATLANTICO;BH;607413.32;806390.79;2501
+2503;2001105265;B04001;HOMICIDIO TENTAD;RUA RAIMUNDO TIN;65;301229;23/2/2001 23:57:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610757.06;793273.56;2502
+2504;2001105279;B06000;LESAO CORPORAL;RUA AMARANTO VER;62;110120;24/2/2001 00:01:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;615845.03;805907.88;2503
+2505;2001105293;B03000;AMEACA;RUA PIRATININGA;20;54210;24/2/2001 00:08:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;609977.00;797713.87;2504
+2506;2001105310;B03000;AMEACA;RUA CONSELHEIRO ;15;17095;24/2/2001 00:23:00;CIDADAO COMUM;S;;CENTRO (BH);BH;612543.94;797025.95;2505
+2507;2001105406;B04001;HOMICIDIO TENTAD;AV JOSE RACHEL D;397;85912;24/2/2001 01:15:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616985.36;804671.06;2506
+2508;2001105422;B06000;LESAO CORPORAL;RUA PITT;187;54380;24/2/2001 01:25:00;CIDADAO COMUM;S;;UNIAO;BH;612621.52;801125.76;2507
+2509;2001105450;B03000;AMEACA;RUA BENJAMIN FLO;60;9162;24/2/2001 01:43:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606255.12;793325.23;2508
+2510;2001105465;B03000;AMEACA;RUA MATIAS AIRES;296;34032;24/2/2001 01:51:00;CIDADAO COMUM;S;;VILA MARAVILHAS;BH;603072.43;795117.27;2509
+2511;2001105473;B03000;AMEACA;AV FRANCISCO SA;830;29656;24/2/2001 01:58:00;CIDADAO COMUM;S;0;GUTIERREZ;BH;608886.90;796021.80;2510
+2512;2001105503;B04001;HOMICIDIO TENTAD;RUA PROFESSOR CA;240;89853;24/2/2001 02:22:00;CIDADAO COMUM;N;;PALMEIRAS;BH;606944.81;791601.05;2511
+2513;2001105518;B06000;LESAO CORPORAL;RUA DOS CAETES;499;11376;24/2/2001 02:32:00;INICIATIVA;N;0;CENTRO BH;BH;611125.13;797436.34;2512
+2514;2001105526;B03000;AMEACA;RUA TIRADENTES;26;85607;24/2/2001 02:36:00;CIDADAO COMUM;S;0;ALVORADA;BH;615497.04;802314.39;2513
+2515;2001105568;B03000;AMEACA;RUA ANDIROBA;30;102935;24/2/2001 03:08:00;INICIATIVA;N;0;SAO PAULO;BH;612437.66;803008.77;2514
+2516;2001105649;B05000;SEQUESTRO E CARC;RUA JOAQUIM RAMO;173;38175;24/2/2001 04:41:00;CIDADAO COMUM;S;0;PARAISO;BH;614826.55;797125.45;2515
+2517;2001105688;B08000;VIOLACAO DE DOMI;RUA SEVERINO LAR;351;57221;24/2/2001 05:16:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609620.22;809012.12;2516
+2518;2001105699;B06000;LESAO CORPORAL;PRACA MODESTINO ;39;46039;24/2/2001 05:35:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604068.02;788748.39;2517
+2519;2001105712;B03000;AMEACA;RUA DAVID FONSEC;380;19696;24/2/2001 06:04:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604476.46;790256.25;2518
+2520;2001105717;B04002;HOMICIDIO CONSUM;RUA ECA DE QUEIR;202;24968;24/2/2001 06:07:00;INICIATIVA;N;0;COPACABANA;BH;606539.78;806907.32;2519
+2521;2001105721;B06000;LESAO CORPORAL;RUA FLOR DE LIMA;64;23810;24/2/2001 06:07:00;CIDADAO COMUM;S;0;PINDORAMA;BH;602279.39;797503.89;2520
+2522;2001105742;B06000;LESAO CORPORAL;RUA ALFREDO ALVE;45;108175;24/2/2001 06:37:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606710.57;811632.81;2521
+2523;2001105763;B06000;LESAO CORPORAL;RUA THIAGO SALLE;26;65012;24/2/2001 07:06:00;CIDADAO COMUM;S;0;JARDIM ESTRELA;BH;607320.11;810230.39;2522
+2524;2001105764;B03000;AMEACA;RUA DOM RAFAEL;5;23026;24/2/2001 07:06:00;INICIATIVA;N;0;TAQUARIL;BH;617052.78;797306.19;2523
+2525;2001105853;B03000;AMEACA;BECO SOL NASCENT;141;301434;24/2/2001 08:10:00;CIDADAO COMUM;S;PX135;CAFEZAL;BH;614209.99;795215.91;2524
+2526;2001105883;B06000;LESAO CORPORAL;RUA OSWALDO BRAG;34;72185;24/2/2001 08:30:00;CIDADAO COMUM;N;;SANTA AMELIA;BH;607351.55;806454.90;2525
+2527;2001105976;B03000;AMEACA;RUA ANTONIO MARZ;347;94520;24/2/2001 09:26:00;CIDADAO COMUM;S;CA347;OURO PRETO;BH;606195.44;800699.90;2526
+2528;2001106002;B03000;AMEACA;RUA AURELIANO LE;107;6832;24/2/2001 09:48:00;CIDADAO COMUM;S;;LIBERDADE;BH;609500.21;803405.43;2527
+2529;2001106210;B03000;AMEACA;RUA AGUANIL;640;1564;24/2/2001 12:20:00;CIDADAO COMUM;S;CAFR;VISTA ALEGRE;BH;605291.18;793463.89;2528
+2530;2001106230;B03000;AMEACA;RUA DAS PERPETUA;12;911;24/2/2001 12:30:00;CIDADAO COMUM;S;;LINDEIA;BH;599704.53;791168.04;2529
+2531;2001106327;B06000;LESAO CORPORAL;RUA OSCAR LOBO P;270;104480;24/2/2001 13:34:00;CIDADAO COMUM;S;0;PRIMEIRO DE MAIO;BH;612347.11;803516.89;2530
+2532;2001106334;B03000;AMEACA;RUA APORE;575;5099;24/2/2001 13:39:00;CIDADAO COMUM;N;;PARQUE RIACHUELO;BH;609511.92;800464.70;2531
+2533;2001106408;B06000;LESAO CORPORAL;RUA ROSA DE PEDR;20;124494;24/2/2001 14:25:00;CIDADAO COMUM;S;;ETELVINA CARNEIR;BH;611390.80;809189.08;2532
+2534;2001106409;B06000;LESAO CORPORAL;AV PRESIDENTE AN;4013;4461;24/2/2001 14:26:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609536.57;802154.10;2533
+2535;2001106490;B03000;AMEACA;RUA LUIZ BRANDAO;727;41656;24/2/2001 15:25:00;CIDADAO COMUM;S;;PARAISO;BH;614745.37;796750.21;2534
+2536;2001106523;B03000;AMEACA;RUA JAIR AFONSO ;9;53104;24/2/2001 15:37:00;CIDADAO COMUM;S;;PIRATININGA;BH;606827.32;809921.05;2535
+2537;2001106558;B06000;LESAO CORPORAL;RUA TENENTE VITO;71;67351;24/2/2001 15:59:00;CIDADAO COMUM;N;;SANTA TEREZA;BH;613395.47;797441.30;2536
+2538;2001106561;B03000;AMEACA;RUA ALMADA;174;2393;24/2/2001 16:01:00;CIDADAO COMUM;N;;PINDORAMA;BH;602539.53;797812.24;2537
+2539;2001106594;B03000;AMEACA;AV JOAO XXIII;227;37926;24/2/2001 16:17:00;CIDADAO COMUM;S;0;CONJUNTO ALIPIO ;BH;604398.40;799487.39;2538
+2540;2001106610;B06000;LESAO CORPORAL;RUA CAMPINA VERD;237;12110;24/2/2001 16:25:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;606135.94;794519.08;2539
+2541;2001106615;B03000;AMEACA;RUA KEPLER;173;39990;24/2/2001 16:30:00;CIDADAO COMUM;N;;SANTA LUCIA;BH;609519.93;791702.20;2540
+2542;2001106634;B03000;AMEACA;BECO SOL NASCENT;240;301434;24/2/2001 16:38:00;CIDADAO COMUM;N;0;CAFEZAL;BH;614453.31;795387.14;2541
+2543;2001106669;B06000;LESAO CORPORAL;RUA PIRAMBO;412;54090;24/2/2001 16:56:00;CIDADAO COMUM;S;0;SAO JOAO BATISTA;BH;610666.17;801718.53;2542
+2544;2001106765;B06000;LESAO CORPORAL;RUA PITANGUI;2218;54365;24/2/2001 17:51:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612464.06;798517.38;2543
+2545;2001106790;B06000;LESAO CORPORAL;AV VEREADOR CICE;615;19756;24/2/2001 18:01:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604877.79;796469.45;2544
+2546;2001106795;B03000;AMEACA;RUA SAO TOMAS DE;478;63782;24/2/2001 18:04:00;CIDADAO COMUM;S;PX77;MORRO DO PAPAGAI;BH;610863.39;793538.47;2545
+2547;2001106867;B04001;HOMICIDIO TENTAD;AV VINTE E OITO ;356;72970;24/2/2001 18:46:00;INICIATIVA;N;0;ESPLANADA;BH;614552.43;798837.28;2546
+2548;2001106875;B06000;LESAO CORPORAL;RUA SAO PAULO;100;63464;24/2/2001 18:49:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611108.08;797692.28;2547
+2549;2001106902;B03000;AMEACA;RUA JOSE DE ARAU;508;24725;24/2/2001 19:03:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;607209.92;793937.31;2548
+2550;2001106918;B03000;AMEACA;RUA REAL GRANDEZ;119;58089;24/2/2001 19:11:00;CIDADAO COMUM;S;;NOVO GLORIA;BH;603101.41;798931.25;2549
+2551;2001106943;B06000;LESAO CORPORAL;RUA EPHIGENIA NA;12;98533;24/2/2001 19:26:00;CIDADAO COMUM;S;0;CASTELO;BH;605318.52;799860.30;2550
+2552;2001106960;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;2400;57830;24/2/2001 19:36:00;INICIATIVA;S;0;ESTORIL;BH;609018.00;793117.61;2551
+2553;2001106969;B06000;LESAO CORPORAL;RUA TRINTA E UM;23;95490;24/2/2001 19:38:00;POLICIAL MILITAR;S;0;MARIA GORETTI;BH;614564.25;803088.11;2552
+2554;2001107051;B06000;LESAO CORPORAL;RUA PITANGUI;3225;54365;24/2/2001 20:21:00;INICIATIVA;N;0;CONCORDIA;BH;613314.48;798412.93;2553
+2555;2001107087;B04001;HOMICIDIO TENTAD;RUA OESTE;519;49125;24/2/2001 20:36:00;CIDADAO COMUM;S;;CALAFATE;BH;608042.76;796702.89;2554
+2556;2001107110;B04002;HOMICIDIO CONSUM;RUA RAIMUNDO TIN;129;301229;24/2/2001 20:49:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610720.17;793143.45;2555
+2557;2001107139;B03000;AMEACA;RUA SAO TIAGO;10;21682;24/2/2001 21:02:00;CIDADAO COMUM;S;0;SAO TOMAZ;BH;610320.61;805512.06;2556
+2558;2001107221;B06000;LESAO CORPORAL;RUA PINHAL;90;12108;24/2/2001 21:46:00;CIDADAO COMUM;S;;PIRATININGA;BH;606126.70;809852.49;2557
+2559;2001107259;B03000;AMEACA;RUA MARCELINA FR;117;124655;24/2/2001 22:04:00;CIDADAO COMUM;S;;JAQUELINE;BH;611565.58;810539.70;2558
+2560;2001107267;B06000;LESAO CORPORAL;RUA FAGUNDES VAR;68;27689;24/2/2001 22:08:00;CIDADAO COMUM;S;;LAGOINHA;BH;610273.99;798496.34;2559
+2561;2001107301;B03000;AMEACA;RUA ROSALVO DE M;220;70439;24/2/2001 22:27:00;CIDADAO COMUM;S;A;GOIANIA;BH;615275.20;803488.95;2560
+2562;2001107322;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;320;26052;24/2/2001 22:36:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611297.21;797352.55;2561
+2563;2001107340;B06000;LESAO CORPORAL;RUA FORMIGA;50;29136;24/2/2001 22:48:00;CIDADAO COMUM;S;;LAGOINHA;BH;610336.11;798756.88;2562
+2564;2001107426;B06000;LESAO CORPORAL;AV FURQUIM WERNE;11;650;24/2/2001 23:28:00;INICIATIVA;N;0;SOLIMOES;BH;612945.73;805797.12;2563
+2565;2001107440;B06000;LESAO CORPORAL;RUA PERNAMBUCO;1077;53463;24/2/2001 23:37:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611502.50;795210.22;2564
+2566;2001107453;B04001;HOMICIDIO TENTAD;RUA COPERNICO PI;55;6630;24/2/2001 23:41:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610405.30;793669.43;2565
+2567;2001107490;B03000;AMEACA;RUA PROFESSORA A;313;130479;24/2/2001 23:57:00;CIDADAO COMUM;S;0;OLARIA;BH;601738.06;789041.13;2566
+2568;2001107553;B03000;AMEACA;RUA STA JOSEFINA;885;60803;25/2/2001 00:34:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608456.09;800930.17;2567
+2569;2001107593;B06000;LESAO CORPORAL;RUA EDSON LUIZ M;72;25062;25/2/2001 00:58:00;INICIATIVA;S;0;MARIA GORETTI;BH;614153.98;803689.74;2568
+2570;2001107620;B03000;AMEACA;RUA NATAL;373;47306;25/2/2001 01:10:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609189.92;799371.29;2569
+2571;2001107662;B06000;LESAO CORPORAL;AV FURQUIM WERNE;120;650;25/2/2001 01:32:00;CIDADAO COMUM;S;;TUPI;BH;613071.54;805851.16;2570
+2572;2001107666;B06000;LESAO CORPORAL;RUA CARVALHOS;5;13788;25/2/2001 01:32:00;CIDADAO COMUM;N;;MANGABEIRAS;BH;612030.85;792390.04;2571
+2573;2001107714;B04001;HOMICIDIO TENTAD;RUA JOAQUIM DE P;945;38147;25/2/2001 02:04:00;CIDADAO COMUM;N;CAB;ALIPIO DE MELO;BH;604655.51;799121.62;2572
+2574;2001107730;B06000;LESAO CORPORAL;RUA PARA DE MINA;1186;52070;25/2/2001 02:10:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605500.40;797813.06;2573
+2575;2001107740;B04001;HOMICIDIO TENTAD;RUA NELSON HUNGR;273;46634;25/2/2001 02:15:00;CIDADAO COMUM;S;;TUPI;BH;612567.47;806138.51;2574
+2576;2001107745;B06000;LESAO CORPORAL;AV WALDOMIRO LOB;1665;66548;25/2/2001 02:18:00;INICIATIVA;S;0;GUARANI;BH;611916.93;805178.94;2575
+2577;2001107781;B06000;LESAO CORPORAL;AV JOAQUIM CLEME;18;38018;25/2/2001 02:39:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611922.55;805613.83;2576
+2578;2001107799;B06000;LESAO CORPORAL;RUA CHAFARIZ;119;93568;25/2/2001 02:51:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601522.62;786428.24;2577
+2579;2001107809;B06000;LESAO CORPORAL;RUA OURO PRETO;285;50730;25/2/2001 02:56:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609961.08;797017.98;2578
+2580;2001107892;B04001;HOMICIDIO TENTAD;RUA RAMIRO SIQUE;55;128858;25/2/2001 03:59:00;INICIATIVA;S;0;CASTANHEIRAS (TA;BH;617767.11;797185.33;2579
+2581;2001107955;B06000;LESAO CORPORAL;RODOVIA BR 356;5100;10317;25/2/2001 04:55:00;CIDADAO COMUM;N;;BELVEDERE;BH;610345.89;791069.48;2580
+2582;2001108010;B02000;RIXA;RUA CURITIBA;275;19090;25/2/2001 05:59:00;POLICIAL MILITAR;N;;CENTRO (BH);BH;610963.21;797560.80;2581
+2583;2001108110;B06000;LESAO CORPORAL;RUA OLENKA DIAS ;46;33506;25/2/2001 08:05:00;CIDADAO COMUM;N;;NOVA BARROCA;BH;607432.41;792756.34;2582
+2584;2001108239;B06000;LESAO CORPORAL;AV OLEGARIO MACI;459;49699;25/2/2001 09:32:00;INICIATIVA;S;0;CENTRO BH;BH;610594.57;797209.17;2583
+2585;2001108265;B03000;AMEACA;RUA TRINTA E SEI;201;34310;25/2/2001 09:52:00;CIDADAO COMUM;N;0;CONJUNTO FELICID;BH;612501.14;807529.70;2584
+2586;2001108381;B04001;HOMICIDIO TENTAD;RUA MUNIZ;149;170850;25/2/2001 11:30:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608113.39;793880.88;2585
+2587;2001108404;B04001;HOMICIDIO TENTAD;AV BIAS FORTES;1696;9553;25/2/2001 11:43:00;INICIATIVA;N;0;CENTRO BH;BH;610237.36;797177.50;2586
+2588;2001108413;B03000;AMEACA;AV AMAZONAS;2267;3140;25/2/2001 11:52:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;609538.15;796202.90;2587
+2589;2001108419;B03000;AMEACA;RUA RIBEIRAO DAS;72;46688;25/2/2001 11:57:00;CIDADAO COMUM;N;CSB;PARAISO;BH;614172.67;796041.86;2588
+2590;2001108433;B06000;LESAO CORPORAL;RUA ALEXANDRE SI;205;2135;25/2/2001 12:04:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;605987.96;793132.08;2589
+2591;2001108456;B03000;AMEACA;RUA GERALDO RIBE;49;43680;25/2/2001 12:25:00;CIDADAO COMUM;N;;NOVO GLORIA;BH;603076.41;798841.74;2590
+2592;2001108541;B06000;LESAO CORPORAL;RUA POTENGI;27;61428;25/2/2001 13:43:00;POLICIAL MILITAR;S;;SAO GABRIEL;BH;613898.77;803936.09;2591
+2593;2001108579;B03000;AMEACA;ALAMEDA ALVARO C;100;2816;25/2/2001 14:11:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;612069.23;796731.22;2592
+2594;2001108619;B03000;AMEACA;RUA PADRE PEDRO ;4950;51657;25/2/2001 14:38:00;CIDADAO COMUM;N;APTO.:104 - BLOC;MANTIQUEIRA;BH;606693.60;809984.49;2593
+2595;2001108645;B04002;HOMICIDIO CONSUM;RUA TREZE DE MAI;164;120944;25/2/2001 14:57:00;CIDADAO COMUM;N;;MARIA HELENA;BH;605148.22;810689.31;2594
+2596;2001108653;B06000;LESAO CORPORAL;RUA JOSE ANTENOR;10;16049;25/2/2001 15:03:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612546.74;803795.50;2595
+2597;2001108683;B03000;AMEACA;RUA COSTA RICA;86;68685;25/2/2001 15:21:00;CIDADAO COMUM;N;0;COQUEIROS;BH;602114.03;799090.79;2596
+2598;2001108722;B06000;LESAO CORPORAL;AV BRASIL;1460;10420;25/2/2001 15:49:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611745.06;795947.58;2597
+2599;2001108742;B03000;AMEACA;RUA SERRA NEGRA;1747;65038;25/2/2001 16:01:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;608895.81;799098.28;2598
+2600;2001108773;B06000;LESAO CORPORAL;RUA PASSARELA;83;302328;25/2/2001 16:22:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;606149.87;789752.27;2599
+2601;2001108810;B06000;LESAO CORPORAL;AV PRESIDENTE AN;2957;4461;25/2/2001 16:47:00;INICIATIVA;N;0;PARQUE RIACHUELO;BH;609797.06;800844.62;2600
+2602;2001108832;B06000;LESAO CORPORAL;RUA SAPUCAI;100;63943;25/2/2001 17:03:00;CIDADAO COMUM;N;;FLORESTA;BH;611873.41;797692.97;2601
+2603;2001108861;B03000;AMEACA;RUA EUFRATES;278;26821;25/2/2001 17:23:00;CIDADAO COMUM;N;0;COQUEIROS;BH;603482.30;800034.96;2602
+2604;2001108942;B03000;AMEACA;RUA CINCO;154;302813;25/2/2001 18:16:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614537.55;805974.74;2603
+2605;2001108957;B03000;AMEACA;RUA DONA GENI;92;22874;25/2/2001 18:19:00;CIDADAO COMUM;N;0;JARDIM FLORENCIA;BH;605132.66;810238.28;2604
+2606;2001109034;B04001;HOMICIDIO TENTAD;RUA ARARIBA;255;5540;25/2/2001 19:06:00;CIDADAO COMUM;N;;SAO CRISTOVAO;BH;610179.08;799177.02;2605
+2607;2001109039;B06000;LESAO CORPORAL;RUA ZURICK;640;74092;25/2/2001 19:10:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606662.78;795875.98;2606
+2608;2001109073;B03000;AMEACA;RUA MARANGUAPE;355;43447;25/2/2001 19:27:00;CIDADAO COMUM;S;AP-303;BARROCA;BH;607967.88;796076.63;2607
+2609;2001109075;B06000;LESAO CORPORAL;RUA COPAIBA;10;104801;25/2/2001 19:30:00;CIDADAO COMUM;S;;INDUSTRIAL RODRI;BH;615815.87;808158.86;2608
+2610;2001109107;B03000;AMEACA;AV PARANA;246;52230;25/2/2001 19:42:00;INICIATIVA;N;0;CENTRO (BH);BH;610752.57;797284.29;2609
+2611;2001109129;B06000;LESAO CORPORAL;RUA VERGARA;123;109178;25/2/2001 19:55:00;CIDADAO COMUM;S;;COQUEIROS;BH;602357.56;799632.39;2610
+2612;2001109169;B03000;AMEACA;RUA OFICINAS;153;49140;25/2/2001 20:11:00;CIDADAO COMUM;S;0;ESPLANADA;BH;614750.88;798897.40;2611
+2613;2001109198;B03000;AMEACA;RUA PROFESSORA A;205;22008;25/2/2001 20:26:00;INICIATIVA;S;0;CANDELARIA;BH;608013.33;808737.70;2612
+2614;2001109199;B03000;AMEACA;AV PRESIDENTE AN;7920;4461;25/2/2001 20:28:00;CIDADAO COMUM;S;;SAO LUIZ;BH;608635.14;804693.17;2613
+2615;2001109255;B04001;HOMICIDIO TENTAD;AV SEN LEVINDO C;2270;14866;25/2/2001 20:58:00;CIDADAO COMUM;S;;SANTA CECILIA;BH;600975.64;787380.04;2614
+2616;2001109274;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;2225;57830;25/2/2001 21:04:00;INICIATIVA;N;0;LEONINA;BH;609138.65;793053.24;2615
+2617;2001109340;B03000;AMEACA;RUA VILA RICA;1929;71992;25/2/2001 21:32:00;INICIATIVA;S;401;JARDIM MONTANHES;BH;606729.96;798841.80;2616
+2618;2001109342;B06000;LESAO CORPORAL;RUA FLOR BRANCA;25;28509;25/2/2001 21:32:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;605799.54;799045.82;2617
+2619;2001109345;B06000;LESAO CORPORAL;RUA CLELIA;175;16008;25/2/2001 21:33:00;CIDADAO COMUM;N;;SANTA MONICA;BH;606886.03;807994.52;2618
+2620;2001109365;B06000;LESAO CORPORAL;RUA JOANA DARC;31;170141;25/2/2001 21:48:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614352.14;794982.51;2619
+2621;2001109389;B06000;LESAO CORPORAL;RUA HOFFMAN;630;33320;25/2/2001 22:01:00;CIDADAO COMUM;S;0;SANTA CRUZ (BARR;BH;603165.37;789052.57;2620
+2622;2001109395;B06000;LESAO CORPORAL;RUA VICOSA;816;71910;25/2/2001 22:02:00;CIDADAO COMUM;S;PX342;SANTO ANTONIO;BH;610915.33;793946.00;2621
+2623;2001109432;B06000;LESAO CORPORAL;RUA BARAO DO MON;810;63653;25/2/2001 22:15:00;CIDADAO COMUM;S;;CARDOSO;BH;604036.31;787823.06;2622
+2624;2001109491;B02000;RIXA;RUA DOS AFONSOS;439;1319;25/2/2001 22:51:00;CIDADAO COMUM;S;0;BOA VISTA;BH;616017.53;800220.24;2623
+2625;2001109500;B06000;LESAO CORPORAL;RUA DA FLAGELACA;143;56042;25/2/2001 22:54:00;CIDADAO COMUM;N;0;SAO JOSE;BH;605583.59;798817.24;2624
+2626;2001109536;B03000;AMEACA;AV NEMEN LARA RO;250;104537;25/2/2001 23:17:00;CIDADAO COMUM;S;;SERRA VERDE;BH;609434.17;810322.36;2625
+2627;2001109563;B06000;LESAO CORPORAL;AV PRESIDENTE AN;4013;4461;25/2/2001 23:31:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609536.57;802154.10;2626
+2628;2001109578;B06000;LESAO CORPORAL;RUA FAGUNDES VAR;108;27689;25/2/2001 23:38:00;CIDADAO COMUM;S;;LAGOINHA;BH;610267.48;798536.31;2627
+2629;2001109589;B04001;HOMICIDIO TENTAD;AV ARTUR BERNARD;1200;60844;25/2/2001 23:43:00;POLICIAL MILITAR;S;0;VILA PARIS;BH;610180.14;793263.99;2628
+2630;2001109652;B03000;AMEACA;RUA DOS AFONSOS;156;1319;26/2/2001 00:14:00;CIDADAO COMUM;S;CAB;BOA VISTA;BH;615727.67;800287.75;2629
+2631;2001109693;B06000;LESAO CORPORAL;RUA RIO GRANDE;719;97238;26/2/2001 00:33:00;CIDADAO COMUM;N;0;MINASLANDIA;BH;611610.44;804160.03;2630
+2632;2001109701;B06000;LESAO CORPORAL;RUA JOAQUIM TEIX;63;38207;26/2/2001 00:40:00;CIDADAO COMUM;S;0;CARDOSO;BH;604078.65;788100.48;2631
+2633;2001109706;B03000;AMEACA;RUA DOIS;12;27130;26/2/2001 00:42:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616403.95;806778.34;2632
+2634;2001109712;B03000;AMEACA;RUA NOVE;75;81013;26/2/2001 00:44:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605202.66;793145.62;2633
+2635;2001109814;B03000;AMEACA;RUA FAISAO;730;27710;26/2/2001 01:49:00;INICIATIVA;S;0;FLAVIO MARQUES D;BH;605277.76;788638.67;2634
+2636;2001109878;B05000;SEQUESTRO E CARC;RUA LASSANCE;235;84415;26/2/2001 02:31:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;615719.21;799981.01;2635
+2637;2001109955;B06000;LESAO CORPORAL;RUA CRISTAL;256;18611;26/2/2001 03:26:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;612735.35;797203.71;2636
+2638;2001110036;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;526;6353;26/2/2001 04:50:00;INICIATIVA;S;0;FLORESTA;BH;611816.86;797247.91;2637
+2639;2001110038;B06000;LESAO CORPORAL;RUA SILVA ALVARE;271;65810;26/2/2001 04:53:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615444.32;799061.06;2638
+2640;2001110067;B03000;AMEACA;RUA PAULO BRANDA;286;52710;26/2/2001 05:48:00;CIDADAO COMUM;S;CAB;SANTA EFIGENIA;BH;613634.47;796180.78;2639
+2641;2001110086;B06000;LESAO CORPORAL;RUA DOUTOR RIBEI;38;23650;26/2/2001 06:13:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;603413.75;793166.39;2640
+2642;2001110279;B06000;LESAO CORPORAL;RUA CONDOR;425;16773;26/2/2001 09:43:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605857.42;793824.01;2641
+2643;2001110342;B03000;AMEACA;RUA ATTILIO DE M;456;111630;26/2/2001 10:35:00;CIDADAO COMUM;N;0;DIAMANTE;BH;601519.35;789800.80;2642
+2644;2001110411;B04001;HOMICIDIO TENTAD;RUA TREZE;98;302331;26/2/2001 11:28:00;CIDADAO COMUM;N;;BONSUCESSO;BH;606355.86;789862.18;2643
+2645;2001110507;B03000;AMEACA;RUA JAGUARIBE;116;36822;26/2/2001 12:38:00;CIDADAO COMUM;S;;CONCORDIA;BH;610734.26;799522.66;2644
+2646;2001110624;B06000;LESAO CORPORAL;RUA JAGUARIBE;116;36822;26/2/2001 14:27:00;CIDADAO COMUM;N;CAB;CONCORDIA;BH;610734.26;799522.66;2645
+2647;2001110638;B06000;LESAO CORPORAL;RUA JOAO SILVA;45;89548;26/2/2001 14:31:00;CIDADAO COMUM;N;0;JARDIM VITORIA;BH;617433.32;804609.88;2646
+2648;2001110661;B03000;AMEACA;RUA ALBERTO MART;221;85244;26/2/2001 15:02:00;CIDADAO COMUM;S;0;JAQUELINE;BH;610706.28;810149.56;2647
+2649;2001110667;B03000;AMEACA;RUA FELICIO ROXO;5;27912;26/2/2001 15:04:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;611328.66;801692.14;2648
+2650;2001110674;B04001;HOMICIDIO TENTAD;RUA CAMETA;89;11883;26/2/2001 15:08:00;CIDADAO COMUM;S;;SAUDADE;BH;615105.71;797645.06;2649
+2651;2001110683;B06000;LESAO CORPORAL;RUA TRES;10;126837;26/2/2001 15:13:00;CIDADAO COMUM;S;;CONJUNTO VISTA A;BH;605133.98;792598.37;2650
+2652;2001110693;B04001;HOMICIDIO TENTAD;RUA ESTANISLAU P;18;86842;26/2/2001 15:24:00;INICIATIVA;N;0;CEU AZUL;BH;603281.88;806905.01;2651
+2653;2001110699;B03000;AMEACA;RUA CLORITA;100;16051;26/2/2001 15:26:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612847.22;797209.80;2652
+2654;2001110730;B06000;LESAO CORPORAL;RUA FELISBURGO;108;3950;26/2/2001 15:45:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612659.95;804501.51;2653
+2655;2001110764;B03000;AMEACA;RUA DOS JAVAES;315;37198;26/2/2001 16:11:00;CIDADAO COMUM;S;;SANTA MONICA;BH;606537.47;807752.17;2654
+2656;2001110773;B03000;AMEACA;AV AMAZONAS;6556;3140;26/2/2001 16:15:00;CIDADAO COMUM;S;0;GAMELEIRA;BH;605457.51;795682.06;2655
+2657;2001110801;B03000;AMEACA;RUA TUCA;80;69808;26/2/2001 16:32:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614229.42;803814.92;2656
+2658;2001110831;B06000;LESAO CORPORAL;RUA BERTOPOLIS;256;41873;26/2/2001 16:48:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612487.20;804200.25;2657
+2659;2001110881;B03000;AMEACA;RUA COSME E DAMI;444;18246;26/2/2001 17:21:00;CIDADAO COMUM;N;;UNIVERSITARIO;BH;610495.10;802666.38;2658
+2660;2001110889;B06000;LESAO CORPORAL;RUA GERALDO MART;143;86086;26/2/2001 17:25:00;CIDADAO COMUM;N;0;JAQUELINE;BH;611308.77;810320.43;2659
+2661;2001110918;B06000;LESAO CORPORAL;RUA MAJOR DELFIN;2614;42620;26/2/2001 17:40:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;608955.78;801400.33;2660
+2662;2001110968;B06000;LESAO CORPORAL;RUA BANDEIRANTES;42;71908;26/2/2001 18:13:00;CIDADAO COMUM;S;CAFR;NOVA CINTRA;BH;606042.17;793837.55;2661
+2663;2001111064;B06000;LESAO CORPORAL;RUA ANTONIO BICA;69;84875;26/2/2001 19:08:00;CIDADAO COMUM;N;0;DA LAGOA;BH;604696.70;809222.53;2662
+2664;2001111071;B03000;AMEACA;RUA PADRE CAFE;1230;51253;26/2/2001 19:12:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616158.27;797878.23;2663
+2665;2001111077;B03000;AMEACA;RUA LEOPOLDO GOM;241;40770;26/2/2001 19:16:00;CIDADAO COMUM;N;;POMPEIA;BH;614535.33;797876.85;2664
+2666;2001111203;B03000;AMEACA;RUA JORNALISTA C;185;120682;26/2/2001 20:26:00;CIDADAO COMUM;S;0;CHACARAS REUNIDA;BH;605748.54;789323.77;2665
+2667;2001111212;B03000;AMEACA;RUA ALBERTO MART;221;85244;26/2/2001 20:28:00;CIDADAO COMUM;N;0;JAQUELINE;BH;610706.28;810149.56;2666
+2668;2001111280;B04001;HOMICIDIO TENTAD;RUA ANAPURUS;79;20894;26/2/2001 21:07:00;INICIATIVA;S;0;SAO GABRIEL;BH;613199.76;804134.53;2667
+2669;2001111334;B04002;HOMICIDIO CONSUM;ESTRADA DO CERCA;2700;26428;26/2/2001 21:34:00;CIDADAO COMUM;N;;HAVAI;BH;607731.88;793293.52;2668
+2670;2001111478;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;2555;17095;26/2/2001 22:58:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613979.96;797400.79;2669
+2671;2001111532;B04001;HOMICIDIO TENTAD;RUA JOSE FELIX M;800;7416;26/2/2001 23:29:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606465.11;810558.08;2670
+2672;2001111562;B06000;LESAO CORPORAL;RUA ABILIO FERNA;195;95421;26/2/2001 23:43:00;CIDADAO COMUM;N;0;JARDIM VITORIA;BH;616838.69;804321.77;2671
+2673;2001111585;B06000;LESAO CORPORAL;RUA MICA;159;45685;26/2/2001 23:59:00;CIDADAO COMUM;S;0;SAO LUCAS;BH;613254.73;795968.68;2672
+2674;2001111600;B06000;LESAO CORPORAL;RUA MANJERICAO;543;34464;27/2/2001 00:09:00;CIDADAO COMUM;N;;LINDEIA;BH;599654.37;791207.03;2673
+2675;2001111659;B06000;LESAO CORPORAL;RUA DOS BENEDITI;85;63310;27/2/2001 00:57:00;CIDADAO COMUM;S;;PLANALTO;BH;610768.63;805419.05;2674
+2676;2001111732;B06000;LESAO CORPORAL;RUA DAS GABIROBA;95;30375;27/2/2001 01:40:00;CIDADAO COMUM;N;PRONTO SOCORRO J;VILA CLORIS;BH;610034.72;808298.49;2675
+2677;2001111738;B06000;LESAO CORPORAL;AV SANTOS DUMONT;477;61950;27/2/2001 01:48:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611172.34;797512.69;2676
+2678;2001111758;B06000;LESAO CORPORAL;RUA FRANCISCO LE;422;29495;27/2/2001 02:04:00;CIDADAO COMUM;N;0;SAO MARCOS;BH;614241.44;802567.46;2677
+2679;2001111784;B03000;AMEACA;RUA HUMAITA;47;33562;27/2/2001 02:20:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607640.09;796954.54;2678
+2680;2001111829;B06000;LESAO CORPORAL;AV SANTOS DUMONT;574;61950;27/2/2001 02:58:00;INICIATIVA;S;0;CENTRO (BH);BH;611085.24;797586.10;2679
+2681;2001111903;B06000;LESAO CORPORAL;AV PARANA;368;52230;27/2/2001 04:17:00;POLICIAL MILITAR;S;;CENTRO (BH);BH;610721.21;797160.64;2680
+2682;2001111924;B06000;LESAO CORPORAL;AV CRISTIANO MAC;1460;18652;27/2/2001 04:39:00;INICIATIVA;S;0;CELESTINO;BH;612408.10;799806.41;2681
+2683;2001111936;B03000;AMEACA;AV ESPLANADA;56;126244;27/2/2001 04:57:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613206.75;804342.60;2682
+2684;2001111982;B02000;RIXA;AV DOS ANDRADAS;377;3761;27/2/2001 06:11:00;INICIATIVA;N;0;CENTRO (BH);BH;611545.35;797222.18;2683
+2685;2001112028;B06000;LESAO CORPORAL;RUA RUI GUERRA;90;301669;27/2/2001 07:26:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614477.59;795128.95;2684
+2686;2001112105;B03000;AMEACA;RUA DAS CARMELIT;103;121401;27/2/2001 08:30:00;CIDADAO COMUM;N;;PLANALTO;BH;610572.62;805546.84;2685
+2687;2001112380;B04002;HOMICIDIO CONSUM;RUA SAUL;22;170891;27/2/2001 12:29:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608144.99;793571.20;2686
+2688;2001112418;B03000;AMEACA;RUA ROSALINA BAN;215;59302;27/2/2001 13:01:00;CIDADAO COMUM;S;;MINASLANDIA;BH;611890.83;803991.25;2687
+2689;2001112444;B03000;AMEACA;RUA RAMIRO SIQUE;45;128858;27/2/2001 13:30:00;CIDADAO COMUM;N;;CASTANHEIRAS (TA;BH;617763.55;797138.45;2688
+2690;2001112456;B03000;AMEACA;RUA NANA;689;47186;27/2/2001 13:47:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;603866.49;789493.30;2689
+2691;2001112459;B03000;AMEACA;RUA ALTINOPOLIS;829;36296;27/2/2001 13:49:00;CIDADAO COMUM;S;LJA;PIRATININGA;BH;605549.05;809289.01;2690
+2692;2001112463;B06000;LESAO CORPORAL;RUA DA PEDREIRA;347;301298;27/2/2001 13:52:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608679.64;794084.76;2691
+2693;2001112488;B06000;LESAO CORPORAL;RUA JERUSALEM;348;37320;27/2/2001 14:13:00;INICIATIVA;S;0;SAO SALVADOR;BH;603256.17;799675.78;2692
+2694;2001112512;B06000;LESAO CORPORAL;RUA DOUTOR CRIST;175;55598;27/2/2001 14:33:00;INICIATIVA;S;0;BONSUCESSO;BH;604650.82;789126.07;2693
+2695;2001112597;B03000;AMEACA;RUA DR JOSE ERNE;26;1362;27/2/2001 15:32:00;CIDADAO COMUM;S;FU;JARDIM MONTANHES;BH;606642.37;799044.19;2694
+2696;2001112615;B03000;AMEACA;RUA JOSE BARBOSA;675;85304;27/2/2001 15:47:00;CIDADAO COMUM;S;0;JAQUELINE;BH;610743.31;810454.35;2695
+2697;2001112618;B03000;AMEACA;RUA DOMICIO GABR;407;14623;27/2/2001 15:49:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600606.12;787280.28;2696
+2698;2001112636;B03000;AMEACA;RUA FRANCISCO DU;1057;46316;27/2/2001 16:04:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604095.29;803005.00;2697
+2699;2001112670;B03000;AMEACA;AV DORA TOMICH L;135;100060;27/2/2001 16:19:00;CIDADAO COMUM;S;;BRAUNAS;BH;604689.70;805481.65;2698
+2700;2001112701;B06000;LESAO CORPORAL;RUA COUTO DE MAG;271;18463;27/2/2001 16:32:00;CIDADAO COMUM;S;;PARAISO;BH;614290.78;796749.32;2699
+2701;2001112722;B06000;LESAO CORPORAL;RUA PAU BRASIL;516;109401;27/2/2001 16:39:00;CIDADAO COMUM;N;SOLIMOES;SOLIMOES;BH;612440.90;807719.97;2700
+2702;2001112740;B04001;HOMICIDIO TENTAD;RUA GUAICURUS;538;32009;27/2/2001 16:56:00;INICIATIVA;S;0;CENTRO BH;BH;611143.63;797659.74;2701
+2703;2001112787;B06000;LESAO CORPORAL;RUA ESTORIL;1507;63827;27/2/2001 17:31:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;608967.89;801689.91;2702
+2704;2001112797;B03000;AMEACA;RUA MIKHAIL NIME;88;130481;27/2/2001 17:38:00;INICIATIVA;S;0;HELIOPOLIS;BH;611319.96;805188.66;2703
+2705;2001112830;B03000;AMEACA;RUA MARIO SOARES;492;44641;27/2/2001 17:56:00;CIDADAO COMUM;N;0;DOM BOSCO;BH;604170.41;797305.50;2704
+2706;2001112918;B04002;HOMICIDIO CONSUM;RUA PADRE PEDRO ;175;51657;27/2/2001 18:48:00;POLICIAL MILITAR;N;0;VENDA NOVA;BH;609671.68;808130.71;2705
+2707;2001112963;B04002;HOMICIDIO CONSUM;RUA CANDIDO DE S;840;12628;27/2/2001 19:07:00;CIDADAO COMUM;N;0;GAMELEIRA;BH;605603.59;794333.92;2706
+2708;2001112972;B03000;AMEACA;ALAMEDA CHICO ME;100;96018;27/2/2001 19:13:00;CIDADAO COMUM;N;;VILA CASTANHEIRA;BH;601310.13;788681.30;2707
+2709;2001112973;B04001;HOMICIDIO TENTAD;AV GUARATA;633;32267;27/2/2001 19:13:00;CIDADAO COMUM;S;;PRADO;BH;608528.64;797229.38;2708
+2710;2001113033;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;27/2/2001 19:44:00;CIDADAO COMUM;S;;TIROL;BH;600947.66;789885.51;2709
+2711;2001113064;B03000;AMEACA;RUA PONTE NOVA;354;54655;27/2/2001 19:57:00;POLICIAL MILITAR;S;;COLEGIO BATISTA;BH;611261.34;798370.33;2710
+2712;2001113095;B03000;AMEACA;AV MANOEL GOMES;106;43103;27/2/2001 20:16:00;CIDADAO COMUM;S;;NOVA CACHOEIRINH;BH;609780.82;801385.63;2711
+2713;2001113141;B03000;AMEACA;AV CRISTIANO MAC;1616;18652;27/2/2001 20:38:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612314.39;800010.13;2712
+2714;2001113202;B03000;AMEACA;RUA DEPUTADO SEB;923;89724;27/2/2001 21:14:00;CIDADAO COMUM;N;0;PALMEIRAS;BH;606848.85;790779.26;2713
+2715;2001113227;B03000;AMEACA;RUA TAPIRA;20;66939;27/2/2001 21:23:00;CIDADAO COMUM;N;FE;CONCORDIA;BH;610810.13;799594.08;2714
+2716;2001113261;B06000;LESAO CORPORAL;RUA JOSE HONORAT;320;100826;27/2/2001 21:38:00;CIDADAO COMUM;S;CAFU;JARDIM GUANABARA;BH;611008.01;807522.85;2715
+2717;2001113288;B03000;AMEACA;RUA STIBINA;279;66434;27/2/2001 21:49:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;614304.97;796464.86;2716
+2718;2001113371;B03000;AMEACA;RUA OSWALDO GOEL;68;97470;27/2/2001 22:23:00;CIDADAO COMUM;N;;TUPI;BH;613632.96;806410.86;2717
+2719;2001113386;B03000;AMEACA;RUA ANTONIO DA C;132;98937;27/2/2001 22:31:00;CIDADAO COMUM;S;0;LAGOA;BH;604752.28;809599.37;2718
+2720;2001113418;B06000;LESAO CORPORAL;PRACA MINERVA;39;45833;27/2/2001 22:45:00;INICIATIVA;N;0;PROFESSOR WASHIN;IB;598848.60;789287.98;2719
+2721;2001113482;B03000;AMEACA;RUA MARECHAL RON;108;43677;27/2/2001 23:17:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611883.66;803480.80;2720
+2722;2001113492;B06000;LESAO CORPORAL;RUA AGUA DE COLO;12;105570;27/2/2001 23:25:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;616067.52;806207.89;2721
+2723;2001113519;B03000;AMEACA;RUA DES SARAIVA;931;66535;27/2/2001 23:43:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616054.70;797928.23;2722
+2724;2001113572;B06000;LESAO CORPORAL;RUA ANTONIO JOSE;216;7431;28/2/2001 00:25:00;INICIATIVA;S;0;CEU AZUL;BH;605133.43;807821.38;2723
+2725;2001113731;B03000;AMEACA;RUA SAFIRA;95;59835;28/2/2001 02:24:00;INICIATIVA;S;0;PRADO;BH;608617.43;796702.89;2724
+2726;2001113752;B06000;LESAO CORPORAL;RUA OSWALDO GOEL;68;97470;28/2/2001 02:37:00;CIDADAO COMUM;N;;TUPI;BH;613632.96;806410.86;2725
+2727;2001113759;B04001;HOMICIDIO TENTAD;AV DOM PEDRO II;4205;53145;28/2/2001 02:43:00;INICIATIVA;S;0;PADRE EUSTAQUIO;BH;606744.93;797901.91;2726
+2728;2001113860;B04001;HOMICIDIO TENTAD;ESTRADA DOS BORG;5;85893;28/2/2001 04:34:00;INICIATIVA;S;0;JARDIM VITORIA;BH;616433.49;804527.60;2727
+2729;2001114009;B03000;AMEACA;RUA FORMIGA;50;29136;28/2/2001 07:58:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610336.11;798756.88;2728
+2730;2001114092;B04001;HOMICIDIO TENTAD;AV PRESIDENTE AN;3710;4461;28/2/2001 09:09:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;609808.70;801577.71;2729
+2731;2001114187;B03000;AMEACA;RUA DR JOSE ERNE;26;1362;28/2/2001 10:07:00;CIDADAO COMUM;S;FU;JARDIM MONTANHES;BH;606642.37;799044.19;2730
+2732;2001114239;B06000;LESAO CORPORAL;AV BARBACENA;415;8084;28/2/2001 10:44:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609507.27;796845.22;2731
+2733;2001114276;B03000;AMEACA;RUA CIRILO GASPA;326;63348;28/2/2001 11:20:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608684.85;800162.78;2732
+2734;2001114472;B03000;AMEACA;RUA PROFESSOR JO;95;55529;28/2/2001 14:08:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611231.92;799402.77;2733
+2735;2001114499;B04001;HOMICIDIO TENTAD;AV CECILIA PINTO;33;14447;28/2/2001 14:32:00;CIDADAO COMUM;S;0;SAO BERNARDO;BH;610600.26;805253.80;2734
+2736;2001114536;B03000;AMEACA;RUA DOS MACARICO;158;42170;28/2/2001 14:54:00;CIDADAO COMUM;S;AP04;VILA CLORIS;BH;610202.02;807689.91;2735
+2737;2001114552;B06000;LESAO CORPORAL;RUA MARCAZITA;162;43488;28/2/2001 15:07:00;CIDADAO COMUM;N;0;SAO CRISTOVAO;BH;610040.06;799407.54;2736
+2738;2001114596;B03000;AMEACA;AV JOAO XXIII;41;37926;28/2/2001 15:34:00;INICIATIVA;N;0;CONJUNTO ALIPIO ;BH;604194.53;799545.38;2737
+2739;2001114644;B03000;AMEACA;RUA AGRIPINO GRI;86;1450;28/2/2001 15:57:00;CIDADAO COMUM;S;0;TUPI;BH;613304.20;806016.33;2738
+2740;2001114678;B03000;AMEACA;RUA ITABIRA;493;35237;28/2/2001 16:16:00;CIDADAO COMUM;N;AP102;LAGOINHA;BH;610931.11;798451.36;2739
+2741;2001114681;B06000;LESAO CORPORAL;RUA OSCAR LOBO P;270;104480;28/2/2001 16:18:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612347.11;803516.89;2740
+2742;2001114688;B04001;HOMICIDIO TENTAD;RUA MUNIZ;100;170850;28/2/2001 16:25:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608081.16;793922.64;2741
+2743;2001114757;B03000;AMEACA;RUA ASTOLFO DUTR;542;6426;28/2/2001 17:12:00;INICIATIVA;S;0;ESPLANADA;BH;615215.48;798283.62;2742
+2744;2001114765;B06000;LESAO CORPORAL;RUA PIRATUBA;71;54236;28/2/2001 17:17:00;CIDADAO COMUM;N;0;SANTO ANDRE;BH;609779.72;799545.81;2743
+2745;2001114779;B03000;AMEACA;RUA DOS GUAJAJAR;1268;32037;28/2/2001 17:26:00;CIDADAO COMUM;S;AP2822;SANTO AGOSTINHO;BH;610359.02;796667.12;2744
+2746;2001114924;B03000;AMEACA;RUA CAMPANARIO;557;12010;28/2/2001 19:05:00;CIDADAO COMUM;S;;SANTA INES;BH;614359.44;800809.14;2745
+2747;2001114998;B04001;HOMICIDIO TENTAD;BECO UNIAO;5;302591;28/2/2001 19:58:00;CIDADAO COMUM;N;;HORIZONTE (NEVES;RN;603390.24;807473.62;2746
+2748;2001115013;B03000;AMEACA;RUA HILDEBRANDO ;304;129788;28/2/2001 20:09:00;CIDADAO COMUM;S;0;COPACABANA;BH;606515.65;806259.16;2747
+2749;2001115022;B03000;AMEACA;RUA BOM DESPACHO;390;9944;28/2/2001 20:16:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;614081.01;797685.62;2748
+2750;2001115062;B08000;VIOLACAO DE DOMI;AV FRANCISCO SA;55;29656;28/2/2001 20:42:00;CIDADAO COMUM;S;;PRADO;BH;609022.99;796771.47;2749
+2751;2001115065;B06000;LESAO CORPORAL;RUA CAETANO PIRR;520;45773;28/2/2001 20:44:00;INICIATIVA;S;0;MILIONARIOS;BH;604100.25;790093.56;2750
+2752;2001115077;B06000;LESAO CORPORAL;RUA JABOTICABAL;822;36517;28/2/2001 20:52:00;CIDADAO COMUM;S;0;JARDIM AMERICA;BH;607756.01;794117.46;2751
+2753;2001115118;B06000;LESAO CORPORAL;AV CIVILIZACAO;911;51657;28/2/2001 21:20:00;CIDADAO COMUM;N;BL12 APTO203;JARDIM FLORENCIA;BH;609133.74;808652.87;2752
+2754;2001115135;B06000;LESAO CORPORAL;RUA YUCATAN;8;36302;28/2/2001 21:33:00;INICIATIVA;S;0;SAO PEDRO;BH;611235.19;793829.00;2753
+2755;2001115172;B03000;AMEACA;AV JOAO FIRMINO ;249;47259;28/2/2001 21:55:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601168.35;788608.66;2754
+2756;2001115204;B03000;AMEACA;RUA AUGUSTO DE A;189;6643;28/2/2001 22:18:00;CIDADAO COMUM;S;0;BOA VISTA;BH;615915.90;799869.09;2755
+2757;2001115225;B06000;LESAO CORPORAL;RUA DOUTOR BENED;2090;12252;28/2/2001 22:34:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;613267.66;805156.63;2756
+2758;2001115248;B03000;AMEACA;RUA JOSE MAURICI;97;58035;28/2/2001 22:54:00;CIDADAO COMUM;S;CAA;VILA HUMAITA;BH;610284.60;801833.76;2757
+2759;2001115326;B06000;LESAO CORPORAL;RUA JOSE MARIA B;373;38380;28/2/2001 23:39:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;607751.02;807597.60;2758
+2760;2001115488;B03000;AMEACA;AV NELIO CERQUEI;15;72359;1/3/2001 02:40:00;CIDADAO COMUM;S;0;TIROL;BH;600947.66;789885.51;2759
+2761;2001115505;B03000;AMEACA;RUA EMILIO RICAL;141;102806;1/3/2001 03:07:00;CIDADAO COMUM;S;AP104;JOAO PINHEIRO;BH;605108.25;795890.74;2760
+2762;2001115858;B03000;AMEACA;RUA FERREIRA DOS;95;28234;1/3/2001 10:05:00;CIDADAO COMUM;S;;PIRAJA;BH;613165.96;802804.35;2761
+2763;2001115889;B03000;AMEACA;RUA ALVARES MACI;670;2756;1/3/2001 10:50:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;612469.08;796685.32;2762
+2764;2001115966;B03000;AMEACA;RUA CORNELIO CER;753;17417;1/3/2001 11:36:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605629.54;797930.61;2763
+2765;2001115976;B03000;AMEACA;RUA Q;144;78415;1/3/2001 11:44:00;CIDADAO COMUM;N;;VILA PINHO;BH;602175.50;788033.53;2764
+2766;2001115985;B03000;AMEACA;RUA MARIA AMELIA;841;43812;1/3/2001 11:56:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;610257.12;805510.06;2765
+2767;2001116096;B04001;HOMICIDIO TENTAD;RUA BOGOTA;23;9856;1/3/2001 13:19:00;CIDADAO COMUM;S;CASA C;JARDIM AMERICA;BH;607651.60;794611.02;2766
+2768;2001116146;B06000;LESAO CORPORAL;RUA CRISANTEMO;210;18564;1/3/2001 13:57:00;CIDADAO COMUM;S;;MARAJO;BH;606640.47;793158.42;2767
+2769;2001116150;B03000;AMEACA;RUA JOSE ISIDORO;67;38869;1/3/2001 13:58:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614288.39;803379.27;2768
+2770;2001116165;B03000;AMEACA;RUA CHAFARIZ;40;300275;1/3/2001 14:09:00;CIDADAO COMUM;S;CAB;HAVAI;BH;607407.04;793804.07;2769
+2771;2001116187;B04001;HOMICIDIO TENTAD;RUA CORCOVADO;1133;14894;1/3/2001 14:26:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607494.97;794011.81;2770
+2772;2001116188;B06000;LESAO CORPORAL;RUA PASSA QUATRO;325;52420;1/3/2001 14:26:00;CIDADAO COMUM;S;AP02;CAICARA;BH;607592.67;799403.42;2771
+2773;2001116190;B03000;AMEACA;RUA SAO RAFAEL;138;63580;1/3/2001 14:26:00;CIDADAO COMUM;N;;FLORESTA;BH;612241.79;798264.50;2772
+2774;2001116251;B06000;LESAO CORPORAL;RUA DEMETRIO RIB;1363;19797;1/3/2001 15:03:00;CIDADAO COMUM;S;0;SAUDADE;BH;615883.06;797293.92;2773
+2775;2001116256;B03000;AMEACA;RUA MARCO ANTONI;53;54829;1/3/2001 15:06:00;CIDADAO COMUM;N;0;MARIA VIRGINIA;BH;612035.38;802855.52;2774
+2776;2001116258;B03000;AMEACA;RUA MECA;53;45281;1/3/2001 15:06:00;CIDADAO COMUM;S;0;CH BETANIA;BH;605413.35;792348.38;2775
+2777;2001116317;B06000;LESAO CORPORAL;AV BARBACENA;653;8084;1/3/2001 15:52:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609636.01;796640.35;2776
+2778;2001116490;B03000;AMEACA;RUA AUGUSTO DE A;189;6643;1/3/2001 17:28:00;CIDADAO COMUM;S;0;BOA VISTA;BH;615915.90;799869.09;2777
+2779;2001116610;B06000;LESAO CORPORAL;RUA WILSON ABRAO;165;113286;1/3/2001 18:27:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608897.10;809883.65;2778
+2780;2001116617;B03000;AMEACA;AV AUGUSTO DE LI;1640;6731;1/3/2001 18:32:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609741.31;796987.79;2779
+2781;2001116619;B03000;AMEACA;RUA JOAQUIM ANAC;23;118932;1/3/2001 18:33:00;INICIATIVA;N;0;TEIXEIRA DIAS;BH;603052.88;789295.61;2780
+2782;2001116923;B03000;AMEACA;RUA GLAUBER ROCH;75;94139;1/3/2001 21:18:00;CIDADAO COMUM;S;0;PAQUETA;BH;605378.45;802809.61;2781
+2783;2001116936;B03000;AMEACA;RUA DARIO FARIA ;352;39240;1/3/2001 21:24:00;CIDADAO COMUM;S;0;DAS INDUSTRIAS;BH;604227.17;792565.96;2782
+2784;2001116939;B06000;LESAO CORPORAL;RUA SAO MIGUEL;995;63410;1/3/2001 21:28:00;CIDADAO COMUM;S;0;ITAPOA;BH;609281.94;805595.11;2783
+2785;2001116945;B03000;AMEACA;RUA PADRE AUGUST;15;51238;1/3/2001 21:32:00;CIDADAO COMUM;S;;HELIOPOLIS;BH;611053.12;806066.34;2784
+2786;2001116973;B06000;LESAO CORPORAL;RUA DA PEDREIRA;328;301298;1/3/2001 21:50:00;CIDADAO COMUM;N;AGUARDA NA 125 C;MORRO DAS PEDRAS;BH;608618.39;794087.94;2785
+2787;2001117029;B04001;HOMICIDIO TENTAD;RUA BARAO DE COR;45;7910;1/3/2001 22:26:00;CIDADAO COMUM;S;0;SAO TOMAZ;BH;609532.40;805277.88;2786
+2788;2001117050;B06000;LESAO CORPORAL;RUA MUCURI;5;46880;1/3/2001 22:38:00;INICIATIVA;N;0;FLORESTA;BH;612422.07;797232.88;2787
+2789;2001117063;B06000;LESAO CORPORAL;RUA FREI ZACARIA;330;37610;1/3/2001 22:46:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603812.96;802146.64;2788
+2790;2001117079;B03000;AMEACA;RUA CLORITA;100;16051;1/3/2001 22:57:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612847.22;797209.80;2789
+2791;2001117099;B03000;AMEACA;RUA JOSE LUIZ DI;406;83945;1/3/2001 23:11:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;605070.02;789748.80;2790
+2792;2001117103;B06000;LESAO CORPORAL;RUA ANTONIO EUST;85;72103;1/3/2001 23:14:00;CIDADAO COMUM;S;;TIROL;BH;600127.68;789465.93;2791
+2793;2001117130;B06000;LESAO CORPORAL;RUA PAI TOMAS;90;51760;1/3/2001 23:33:00;CIDADAO COMUM;N;CA;CABANA;BH;604944.65;794453.85;2792
+2794;2001117136;B03000;AMEACA;RUA FERNAO DIAS;60;28133;1/3/2001 23:41:00;INICIATIVA;S;0;CASA BRANCA;BH;616318.93;799741.71;2793
+2795;2001117223;B04002;HOMICIDIO CONSUM;RUA HUMAITA;1234;33562;2/3/2001 01:09:00;CIDADAO COMUM;N;CAA;PADRE EUSTAQUIO;BH;606390.98;797020.45;2794
+2796;2001117236;B03000;AMEACA;AV AUGUSTO DE LI;46;6731;2/3/2001 01:25:00;INICIATIVA;N;0;CENTRO BH;BH;611284.46;796568.91;2795
+2797;2001117250;B08000;VIOLACAO DE DOMI;RUA PIRATININGA;225;54150;2/3/2001 01:45:00;CIDADAO COMUM;S;CS;CARDOSO;BH;603928.77;788099.60;2796
+2798;2001117262;B03000;AMEACA;RUA CARMESIA;617;13618;2/3/2001 01:57:00;CIDADAO COMUM;S;;SANTA INES;BH;614301.69;800789.19;2797
+2799;2001117363;B06000;LESAO CORPORAL;AV CRISTIANO MAC;10727;18652;2/3/2001 04:13:00;INICIATIVA;N;0;VILA CLORIS;BH;611116.34;806188.75;2798
+2800;2001117372;B04001;HOMICIDIO TENTAD;RUA DOS COMANCHE;105;16367;2/3/2001 04:35:00;INICIATIVA;N;0;ITAMARATI;BH;606988.32;806826.23;2799
+2801;2001117503;B06000;LESAO CORPORAL;RUA COSTA MACHAD;382;18334;2/3/2001 07:55:00;CIDADAO COMUM;N;;UNIVERSITARIO;BH;610772.74;802837.58;2800
+2802;2001117571;B04001;HOMICIDIO TENTAD;RUA VIGIA;185;71977;2/3/2001 08:42:00;CIDADAO COMUM;N;;SAO GERALDO;BH;615575.02;798840.43;2801
+2803;2001117677;B09000;ABANDONO DE INCA;RUA ABAIBA;289;561;2/3/2001 09:50:00;CIDADAO COMUM;S;;SAO PAULO;BH;612405.72;802787.54;2802
+2804;2001117690;B03000;AMEACA;RUA JORDAO;100;96090;2/3/2001 10:01:00;CIDADAO COMUM;N;;OLARIA;BH;601797.43;789255.76;2803
+2805;2001117733;B08000;VIOLACAO DE DOMI;AV SEN LEVINDO C;4007;14866;2/3/2001 10:27:00;INICIATIVA;S;0;CH VALE DO JATOB;BH;601309.73;786551.23;2804
+2806;2001117800;B03000;AMEACA;RUA MENDES DE OL;1084;45430;2/3/2001 11:10:00;CIDADAO COMUM;N;0;SANTO ANDRE;BH;609718.74;799470.77;2805
+2807;2001117812;B03000;AMEACA;RUA ALFREDINA AM;220;2251;2/3/2001 11:23:00;CIDADAO COMUM;N;LJ1;MILIONARIOS;BH;604422.87;790414.37;2806
+2808;2001117876;B03000;AMEACA;RUA PADRE CYR AS;57;12091;2/3/2001 12:20:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612109.79;803534.32;2807
+2809;2001117924;B03000;AMEACA;RUA VOLUNTARIOS ;117;73639;2/3/2001 13:01:00;CIDADAO COMUM;N;;IPIRANGA;BH;611544.61;800681.01;2808
+2810;2001117955;B03000;AMEACA;RUA JACUI;2664;36734;2/3/2001 13:20:00;CIDADAO COMUM;S;;NOVA FLORESTA;BH;611427.64;800343.72;2809
+2811;2001117997;B06000;LESAO CORPORAL;AV DOS ANDRADAS;318;3761;2/3/2001 13:47:00;CIDADAO COMUM;S;PX333;CENTRO (BH);BH;611498.16;797301.08;2810
+2812;2001118025;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;1740;57830;2/3/2001 14:01:00;INICIATIVA;N;0;GUTIERREZ;BH;608719.62;793771.09;2811
+2813;2001118066;B03000;AMEACA;AV PRESIDENTE CO;163;55140;2/3/2001 14:27:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;603598.49;792896.47;2812
+2814;2001118095;B06000;LESAO CORPORAL;RUA MORRINHOS;194;46808;2/3/2001 14:43:00;CIDADAO COMUM;S;0;CAETANO FURQUIM;BH;616454.98;798919.85;2813
+2815;2001118103;B03000;AMEACA;RUA AMENDITA;71;3213;2/3/2001 14:49:00;CIDADAO COMUM;S;CSB;FILADELFIA;BH;602278.57;797876.85;2814
+2816;2001118189;B03000;AMEACA;RUA PONTA PORA;45;54601;2/3/2001 15:51:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;613127.25;796831.17;2815
+2817;2001118205;B06000;LESAO CORPORAL;AV LUXEMBURGO;29;127612;2/3/2001 16:01:00;CIDADAO COMUM;S;0;JARDIM EUROPA;BH;607874.09;810280.10;2816
+2818;2001118211;B03000;AMEACA;RUA IARA;370;33751;2/3/2001 16:03:00;CIDADAO COMUM;S;0;POMPEIA;BH;614672.10;797859.09;2817
+2819;2001118329;B06000;LESAO CORPORAL;BECO LORENCO SIL;137;302105;2/3/2001 17:15:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605675.37;807175.93;2818
+2820;2001118396;B03000;AMEACA;RUA DONA HONORIN;46;22395;2/3/2001 17:57:00;CIDADAO COMUM;N;CSFR;ENGENHO NOGUEIRA;BH;606991.70;800313.31;2819
+2821;2001118437;B04001;HOMICIDIO TENTAD;RUA MANAIRA;90;96235;2/3/2001 18:19:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614046.95;805015.29;2820
+2822;2001118472;B03000;AMEACA;RUA FERNAO DIAS;237;28133;2/3/2001 18:38:00;CIDADAO COMUM;N;CSFR;CASA BRANCA;BH;615994.86;798666.47;2821
+2823;2001118488;B03000;AMEACA;RUA ALEM PARAIBA;274;81357;2/3/2001 18:50:00;CIDADAO COMUM;S;0;BONFIM;BH;610523.78;798150.33;2822
+2824;2001118490;B04001;HOMICIDIO TENTAD;RUA NHONHO BROCH;215;47580;2/3/2001 18:52:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604663.85;792029.41;2823
+2825;2001118644;B03000;AMEACA;RUA BERNADETH JO;89;94230;2/3/2001 20:18:00;CIDADAO COMUM;S;;CARDOSO;BH;603122.39;788415.38;2824
+2826;2001118646;B03000;AMEACA;RUA ADAMINA;385;993;2/3/2001 20:20:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;613245.80;797540.93;2825
+2827;2001118668;B04001;HOMICIDIO TENTAD;BECO COPACABANA;150;170460;2/3/2001 20:35:00;CIDADAO COMUM;N;;CABANA;BH;604709.11;794310.50;2826
+2828;2001118767;B03000;AMEACA;RUA MANOEL CAYLL;121;43043;2/3/2001 21:31:00;CIDADAO COMUM;S;;HORTO;BH;613259.68;798134.49;2827
+2829;2001118838;B04001;HOMICIDIO TENTAD;RUA GABRO;379;30435;2/3/2001 22:21:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612925.79;797244.47;2828
+2830;2001118845;B06000;LESAO CORPORAL;RUA GUARAIBA;98;96291;2/3/2001 22:25:00;CIDADAO COMUM;S;CSA;SAO GABRIEL;BH;614482.79;804612.97;2829
+2831;2001118885;B06000;LESAO CORPORAL;RUA JOAO GUALBER;150;68414;2/3/2001 22:54:00;INICIATIVA;N;0;SAO JOAO BATISTA;BH;608949.69;808085.04;2830
+2832;2001118895;B06000;LESAO CORPORAL;RUA SEIS;84;86174;2/3/2001 22:57:00;CIDADAO COMUM;N;;JAQUELINE;BH;611389.70;810027.38;2831
+2833;2001118896;B03000;AMEACA;RUA LEOPOLDO GOM;148;40770;2/3/2001 22:59:00;CIDADAO COMUM;S;;POMPEIA;BH;614465.15;797866.77;2832
+2834;2001118907;B03000;AMEACA;AV B;346;93643;2/3/2001 23:07:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;601444.33;786227.25;2833
+2835;2001118950;B03000;AMEACA;RUA ANTONIO TEIX;23;119037;2/3/2001 23:28:00;CIDADAO COMUM;N;;TEIXEIRA DIAS;BH;603001.89;789757.04;2834
+2836;2001118952;B03000;AMEACA;AV DOS ANDRADAS;6001;3761;2/3/2001 23:27:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615410.70;798622.38;2835
+2837;2001118960;B06000;LESAO CORPORAL;RUA CHACARAS REU;107;120411;2/3/2001 23:35:00;CIDADAO COMUM;S;;CHACARAS REUNIDA;BH;605765.30;789253.09;2836
+2838;2001118963;B03000;AMEACA;RUA BRAGA;155;10332;2/3/2001 23:39:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;607240.53;794200.41;2837
+2839;2001118969;B03000;AMEACA;RUA GASPAR DE LE;45;119720;2/3/2001 23:43:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616869.52;797183.90;2838
+2840;2001119053;B02000;RIXA;AV WALDOMIRO LOB;1536;66548;3/3/2001 00:33:00;CIDADAO COMUM;S;;GUARANI;BH;612089.63;805263.76;2839
+2841;2001119069;B04001;HOMICIDIO TENTAD;RUA JULIO DE CAS;6;39470;3/3/2001 00:45:00;CIDADAO COMUM;S;0;CINQUENTENARIO;BH;606321.36;793163.73;2840
+2842;2001119070;B03000;AMEACA;RUA ORLANDO RODR;20;128630;3/3/2001 00:45:00;CIDADAO COMUM;S;CAA;SALGADO FILHO;BH;607282.69;794204.34;2841
+2843;2001119071;B06000;LESAO CORPORAL;RUA JULIO FERREI;265;20995;3/3/2001 00:46:00;CIDADAO COMUM;S;0;SANTA AMELIA;BH;607245.17;806503.88;2842
+2844;2001119107;B06000;LESAO CORPORAL;RUA JOSE DE ALEN;50;116980;3/3/2001 01:05:00;CIDADAO COMUM;S;;CAPITAO EDUARDO;BH;618262.11;806584.69;2843
+2845;2001119129;B06000;LESAO CORPORAL;AV DOM PEDRO II;4205;53145;3/3/2001 01:15:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606744.93;797901.91;2844
+2846;2001119159;B06000;LESAO CORPORAL;RUA DAS GABIROBA;95;30375;3/3/2001 01:36:00;CIDADAO COMUM;S;;VILA CLORIS;BH;610034.72;808298.49;2845
+2847;2001119180;B03000;AMEACA;RUA ORDALIA;2;50310;3/3/2001 01:59:00;CIDADAO COMUM;S;;PATROCINIO;BH;603533.64;798879.31;2846
+2848;2001119195;B04001;HOMICIDIO TENTAD;RUA MARIA BEATRI;710;43881;3/3/2001 02:04:00;CIDADAO COMUM;N;LJB;HAVAI;BH;606975.56;793180.58;2847
+2849;2001119210;B06000;LESAO CORPORAL;RUA MARCELINA FR;48;124655;3/3/2001 02:16:00;CIDADAO COMUM;S;;JAQUELINE;BH;611484.77;810591.71;2848
+2850;2001119258;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;8665;18652;3/3/2001 02:38:00;CIDADAO COMUM;N;;DONA CLARA;BH;611659.92;803708.12;2849
+2851;2001119315;B06000;LESAO CORPORAL;RUA ESMERALDO BO;255;75650;3/3/2001 03:28:00;CIDADAO COMUM;N;201;BURITIS;BH;608019.94;790475.98;2850
+2852;2001119344;B06000;LESAO CORPORAL;AV SANTOS DUMONT;270;61950;3/3/2001 03:56:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611379.38;797507.11;2851
+2853;2001119367;B03000;AMEACA;RUA LEOPOLDO GOM;1591;40770;3/3/2001 04:14:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615861.34;798144.40;2852
+2854;2001119377;B04001;HOMICIDIO TENTAD;AV VEREADOR CICE;105;19756;3/3/2001 04:20:00;INICIATIVA;N;0;CORACAO EUCARIST;BH;605300.75;796090.62;2853
+2855;2001119403;B03000;AMEACA;RUA PIRANGUINHO;145;54122;3/3/2001 04:52:00;CIDADAO COMUM;S;;SAO GERALDO;BH;616037.88;799139.11;2854
+2856;2001119419;B06000;LESAO CORPORAL;RUA AARAO REIS;364;473;3/3/2001 05:33:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611579.10;797272.30;2855
+2857;2001119439;B03000;AMEACA;RUA LEOPOLDO GOM;1591;40770;3/3/2001 06:51:00;INICIATIVA;S;0;VERA CRUZ;BH;615861.34;798144.40;2856
+2858;2001119446;B03000;AMEACA;RUA LUIZ CASTANH;240;41697;3/3/2001 07:05:00;CIDADAO COMUM;N;0;SANTA CRUZ;BH;611154.40;801888.99;2857
+2859;2001119489;B06000;LESAO CORPORAL;RUA SERENATA;115;172351;3/3/2001 08:02:00;CIDADAO COMUM;S;0;SERRA;BH;614062.04;795309.15;2858
+2860;2001119504;B03000;AMEACA;RUA MURILO PINTO;84;91691;3/3/2001 08:15:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;607074.69;793938.12;2859
+2861;2001119507;B03000;AMEACA;RUA VINTE E SEIS;75;72780;3/3/2001 08:16:00;INICIATIVA;S;0;LEONINA;BH;608491.67;793462.89;2860
+2862;2001119538;B03000;AMEACA;RUA NOVA LIMA;292;48453;3/3/2001 08:45:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;609248.22;798009.84;2861
+2863;2001119550;B09000;ABANDONO DE INCA;RUA FRANCISCO LE;72;29495;3/3/2001 09:00:00;CIDADAO COMUM;S;FU;SAO MARCOS;BH;614356.83;802276.53;2862
+2864;2001119611;B03000;AMEACA;AV DO CONTORNO;1341;17228;3/3/2001 09:57:00;INICIATIVA;N;0;CENTRO (BH);BH;611909.94;797822.35;2863
+2865;2001119613;B06000;LESAO CORPORAL;RUA BOLIVAR;458;9871;3/3/2001 09:58:00;CIDADAO COMUM;N;0;UNIAO;BH;612866.19;801674.00;2864
+2866;2001119616;B03000;AMEACA;RUA INDEPENDENCI;831;34391;3/3/2001 10:01:00;CIDADAO COMUM;S;0;CABANA;BH;605985.71;793145.38;2865
+2867;2001119633;B03000;AMEACA;RUA FLOR DE VIDR;44;13504;3/3/2001 10:23:00;CIDADAO COMUM;S;;CASTELO;BH;605631.15;799432.80;2866
+2868;2001119638;B08000;VIOLACAO DE DOMI;RUA TEBAS;480;67090;3/3/2001 10:25:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615811.31;798263.72;2867
+2869;2001119639;B06000;LESAO CORPORAL;RUA SA E BENEVID;36;10708;3/3/2001 10:25:00;CIDADAO COMUM;S;;UNIVERSITARIO;BH;610216.40;802593.25;2868
+2870;2001119686;B03000;AMEACA;RUA OSWALDO DE S;433;50553;3/3/2001 11:04:00;CIDADAO COMUM;N;0;DOM BOSCO;BH;604169.56;797430.90;2869
+2871;2001119695;B03000;AMEACA;RUA PENALVA;51;96276;3/3/2001 11:14:00;CIDADAO COMUM;N;REF///DEPOSITO J;DOM SILVERIO;BH;614562.09;804374.72;2870
+2872;2001119728;B04001;HOMICIDIO TENTAD;RUA DES CINTRA N;864;62966;3/3/2001 11:47:00;CIDADAO COMUM;N;0;MILIONARIOS;BH;604725.20;790121.59;2871
+2873;2001119742;B03000;AMEACA;RUA JOAO LIRIO D;26;108581;3/3/2001 12:05:00;CIDADAO COMUM;S;REF///SUPERM. FO;VENDA NOVA;BH;608643.28;808563.86;2872
+2874;2001119753;B03000;AMEACA;RUA ARACI;429;5335;3/3/2001 12:13:00;CIDADAO COMUM;S;CSA;PINDORAMA;BH;602526.65;797595.21;2873
+2875;2001119811;B03000;AMEACA;RUA SAO MATIAS;150;63408;3/3/2001 13:01:00;CIDADAO COMUM;N;0;SERRANO;BH;603286.89;800380.66;2874
+2876;2001119829;B03000;AMEACA;RUA TUCA;370;69808;3/3/2001 13:14:00;CIDADAO COMUM;S;CAA;MARIA GORETTI;BH;614517.00;803684.53;2875
+2877;2001119864;B03000;AMEACA;RUA SAO PAULO;118;63464;3/3/2001 13:42:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611103.76;797674.75;2876
+2878;2001119877;B03000;AMEACA;RUA CINCO;154;302813;3/3/2001 13:53:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614537.55;805974.74;2877
+2879;2001119929;B03000;AMEACA;RUA DEMETRIO RIB;1397;19797;3/3/2001 14:29:00;POLICIAL MILITAR;S;0;SAUDADE;BH;615890.15;797259.25;2878
+2880;2001119972;B06000;LESAO CORPORAL;RUA MADRE ISABEL;100;120768;3/3/2001 15:00:00;CIDADAO COMUM;S;;SAO GERALDO;BH;616215.65;799943.84;2879
+2881;2001119982;B03000;AMEACA;RUA JOSE TEIXEIR;187;72995;3/3/2001 15:10:00;CIDADAO COMUM;N;;FLORAMAR;BH;611473.63;806945.13;2880
+2882;2001120095;B06000;LESAO CORPORAL;RUA FRANCISCO MA;445;89447;3/3/2001 16:12:00;CIDADAO COMUM;S;;CH JATOBA IV;BH;600342.66;787631.44;2881
+2883;2001120122;B06000;LESAO CORPORAL;RUA Z;5;29123;3/3/2001 16:30:00;CIDADAO COMUM;N;CAA;CAPITAO EDUARDO;BH;618671.14;807129.45;2882
+2884;2001120124;B03000;AMEACA;RUA DES BRAULIO;20;19917;3/3/2001 16:32:00;POLICIAL MILITAR;S;0;VERA CRUZ;BH;616057.65;798818.48;2883
+2885;2001120159;B03000;AMEACA;RUA RIACHO;5;24927;3/3/2001 16:56:00;CIDADAO COMUM;S;;TAQUARIL;BH;617267.94;797108.52;2884
+2886;2001120165;B06000;LESAO CORPORAL;AV SALAMANCA;175;21480;3/3/2001 17:00:00;CIDADAO COMUM;S;CAFR;JARDIM EUROPA;BH;608328.18;809912.26;2885
+2887;2001120220;B03000;AMEACA;RUA AGUA BOA;87;130567;3/3/2001 17:36:00;CIDADAO COMUM;S;;ARAGUAIA;BH;603962.80;789155.02;2886
+2888;2001120239;B04002;HOMICIDIO CONSUM;RUA AGUA DOCE DO;225;1523;3/3/2001 17:51:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605966.04;807870.45;2887
+2889;2001120287;B06000;LESAO CORPORAL;RUA N;121;37780;3/3/2001 18:28:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608881.39;810032.40;2888
+2890;2001120292;B06000;LESAO CORPORAL;RUA PERNAMBUCO;1077;53463;3/3/2001 18:30:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611502.50;795210.22;2889
+2891;2001120323;B06000;LESAO CORPORAL;RUA CURITIBA;767;19090;3/3/2001 18:49:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610846.44;797113.78;2890
+2892;2001120343;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;853;67682;3/3/2001 19:00:00;INICIATIVA;N;0;BARRO PRETO;BH;611886.69;796078.48;2891
+2893;2001120350;B04001;HOMICIDIO TENTAD;RUA PADRE JULIO ;471;51496;3/3/2001 19:04:00;POLICIAL MILITAR;N;CAA;VERA CRUZ;BH;615410.34;797432.56;2892
+2894;2001120390;B06000;LESAO CORPORAL;RUA ATTILIO DE M;363;111630;3/3/2001 19:31:00;POLICIAL MILITAR;S;0;DIAMANTE;BH;601525.46;789900.12;2893
+2895;2001120433;B03000;AMEACA;RUA CORCOVADO;55;95015;3/3/2001 19:55:00;INICIATIVA;S;0;SARANDI (URCA/BH;BH;603193.23;802354.91;2894
+2896;2001120441;B03000;AMEACA;AV IVAI;1178;80629;3/3/2001 20:02:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604605.18;797950.15;2895
+2897;2001120528;B04001;HOMICIDIO TENTAD;RUA JOAQUIM LEIT;87;64413;3/3/2001 20:55:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606801.78;810035.40;2896
+2898;2001120610;B03000;AMEACA;RUA ATAULFO ALVE;99;6482;3/3/2001 21:37:00;CIDADAO COMUM;S;;TUPI;BH;613317.31;806200.20;2897
+2899;2001120622;B06000;LESAO CORPORAL;RUA GEORGINA PEN;90;31006;3/3/2001 21:42:00;CIDADAO COMUM;S;PX305;SAO LUCAS;BH;614133.28;795705.78;2898
+2900;2001120624;B03000;AMEACA;RUA PADRE JULIO ;48;51496;3/3/2001 21:43:00;CIDADAO COMUM;N;FU;VERA CRUZ;BH;614971.95;797313.30;2899
+2901;2001120629;B03000;AMEACA;RUA REAL MADRID;209;58091;3/3/2001 21:46:00;CIDADAO COMUM;S;;COQUEIROS;BH;603451.26;800201.70;2900
+2902;2001120725;B03000;AMEACA;RUA JOAO GUALBER;1438;37692;3/3/2001 22:41:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612708.10;799896.97;2901
+2903;2001120754;B06000;LESAO CORPORAL;AV FURQUIM WERNE;30;650;3/3/2001 23:04:00;INICIATIVA;N;0;TUPI;BH;613005.07;805799.44;2902
+2904;2001120765;B06000;LESAO CORPORAL;RUA DR BROCHADO;103;23215;3/3/2001 23:11:00;CIDADAO COMUM;N;CA55;VERA CRUZ;BH;615814.74;798592.95;2903
+2905;2001120767;B03000;AMEACA;RUA QUARENTA E S;25;302841;3/3/2001 23:12:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614269.60;805745.84;2904
+2906;2001120841;B06000;LESAO CORPORAL;RUA MARANHAO;1737;43462;3/3/2001 23:54:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612357.28;795160.76;2905
+2907;2001120845;B06000;LESAO CORPORAL;AV SINFRONIO BRO;80;66116;3/3/2001 23:55:00;CIDADAO COMUM;S;;BARREIRO;BH;603269.29;790982.81;2906
+2908;2001120891;B03000;AMEACA;RUA MARIA DO CAR;192;83236;4/3/2001 00:20:00;CIDADAO COMUM;N;;SANTA CRUZ (BARR;BH;603418.68;788956.00;2907
+2909;2001120957;B04001;HOMICIDIO TENTAD;RUA DOS TUPINAMB;908;69940;4/3/2001 00:57:00;INICIATIVA;N;0;CENTRO (BH);BH;610686.75;797442.02;2908
+2910;2001120981;B06000;LESAO CORPORAL;PRACA RAUL SOARE;10;58010;4/3/2001 01:07:00;INICIATIVA;S;0;CENTRO (BH);BH;610534.96;796717.53;2909
+2911;2001120985;B04001;HOMICIDIO TENTAD;RUA DOIS;42;27130;4/3/2001 01:07:00;CIDADAO COMUM;N;0;PAULO SEXTO;BH;616599.36;806788.61;2910
+2912;2001121076;B03000;AMEACA;RUA LUCIA MIGUEL;38;41555;4/3/2001 02:04:00;INICIATIVA;S;0;TUPI;BH;612616.49;805975.44;2911
+2913;2001121110;B06000;LESAO CORPORAL;RUA TOME DE SOUZ;1380;67998;4/3/2001 02:32:00;POLICIAL MILITAR;S;0;LOURDES;BH;611029.66;795329.53;2912
+2914;2001121147;B03000;AMEACA;RUA PIRAI;204;54062;4/3/2001 03:05:00;CIDADAO COMUM;S;FR168;CONCORDIA;BH;610712.96;799396.54;2913
+2915;2001121185;B06000;LESAO CORPORAL;AV GENERAL OLIMP;556;329;4/3/2001 03:34:00;CIDADAO COMUM;N;;ITAPOA;BH;609185.49;806725.82;2914
+2916;2001121201;B03000;AMEACA;AV SEN LEVINDO C;23;14866;4/3/2001 03:47:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;600967.99;789592.58;2915
+2917;2001121205;B06000;LESAO CORPORAL;RUA PEDRO LUIZ D;289;100841;4/3/2001 03:51:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611454.51;807362.84;2916
+2918;2001121213;B06000;LESAO CORPORAL;RUA BADARO JUNIO;38;7532;4/3/2001 04:01:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612064.33;803545.79;2917
+2919;2001121256;B04001;HOMICIDIO TENTAD;AV GETULIO VARGA;1238;81256;4/3/2001 04:44:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611530.70;795136.03;2918
+2920;2001121281;B06000;LESAO CORPORAL;RUA PARA DE MINA;972;52070;4/3/2001 05:03:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605685.93;797784.68;2919
+2921;2001121406;B02000;RIXA;AV SARAMENHA;303;64007;4/3/2001 08:01:00;CIDADAO COMUM;N;;FLORAMAR;BH;612061.08;805691.75;2920
+2922;2001121429;B06000;LESAO CORPORAL;RUA RAMIRO SIQUE;66;128858;4/3/2001 08:20:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617650.40;797388.81;2921
+2923;2001121431;B06000;LESAO CORPORAL;RUA B;160;47637;4/3/2001 08:12:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601142.40;788544.37;2922
+2924;2001121452;B06000;LESAO CORPORAL;RUA DOUTOR JULIO;85;112315;4/3/2001 08:42:00;CIDADAO COMUM;N;CA;OURO PRETO;BH;605834.18;802796.95;2923
+2925;2001121453;B03000;AMEACA;RUA NELSON SOARE;157;47450;4/3/2001 08:42:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604257.72;796952.69;2924
+2926;2001121563;B03000;AMEACA;RUA OURO BRANCO;124;50701;4/3/2001 10:22:00;CIDADAO COMUM;S;;POMPEIA;BH;614764.54;797598.86;2925
+2927;2001121583;B03000;AMEACA;RUA VERA LUCIA;226;71520;4/3/2001 10:35:00;CIDADAO COMUM;S;0;SINIMBU;BH;606703.86;808030.07;2926
+2928;2001121612;B03000;AMEACA;RUA GENTIOS;1350;30983;4/3/2001 10:58:00;CIDADAO COMUM;S;0;LUXEMBURGO;BH;608905.13;793585.28;2927
+2929;2001121653;B03000;AMEACA;RUA ARANTINA;274;58697;4/3/2001 11:29:00;CIDADAO COMUM;S;CAA;MINASLANDIA;BH;612171.98;804515.39;2928
+2930;2001121663;B03000;AMEACA;RUA DESEMBARGADO;601;19986;4/3/2001 11:42:00;CIDADAO COMUM;S;;SERRA;BH;613943.78;794925.46;2929
+2931;2001121679;B09000;ABANDONO DE INCA;AV AMINTAS JAQUE;1100;52546;4/3/2001 11:56:00;CIDADAO COMUM;S;;COQUEIROS;BH;602729.07;799162.42;2930
+2932;2001121693;B06000;LESAO CORPORAL;RUA COPERNICO PI;15;6630;4/3/2001 12:04:00;CIDADAO COMUM;S;;SANTO ANTONIO;BH;610369.73;793668.93;2931
+2933;2001121780;B04001;HOMICIDIO TENTAD;RUA EDMAR COLINI;348;104638;4/3/2001 13:23:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;605882.85;811488.28;2932
+2934;2001121829;B06000;LESAO CORPORAL;RUA RIBATEJO;112;63058;4/3/2001 13:56:00;INICIATIVA;N;0;SAO FRANCISCO;BH;609796.03;802014.20;2933
+2935;2001121839;B03000;AMEACA;RUA DES TEOFILO;55;20015;4/3/2001 14:07:00;CIDADAO COMUM;S;;PEDRO SEGUNDO;BH;608657.91;798601.08;2934
+2936;2001121845;B06000;LESAO CORPORAL;RUA DOS TUPINAMB;688;69940;4/3/2001 14:11:00;INICIATIVA;N;0;CENTRO BH;BH;610916.87;797380.59;2935
+2937;2001121850;B03000;AMEACA;RUA PORTO SEGURO;480;60595;4/3/2001 14:12:00;CIDADAO COMUM;S;;NOVA VISTA;BH;614968.49;800704.88;2936
+2938;2001121910;B06000;LESAO CORPORAL;RUA MARIA AMBROS;241;86206;4/3/2001 15:04:00;CIDADAO COMUM;N;;VILA FREI LEOPOL;BH;611121.44;810097.63;2937
+2939;2001121919;B04002;HOMICIDIO CONSUM;RUA DOS INDUSTRI;225;34480;4/3/2001 15:12:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;604608.18;792459.57;2938
+2940;2001121989;B04001;HOMICIDIO TENTAD;VIA PASSAGEM PED;14;35744;4/3/2001 15:52:00;CIDADAO COMUM;N;0;CAPITAO EDUARDO;BH;618468.35;807122.91;2939
+2941;2001121995;B06000;LESAO CORPORAL;RUA JULIO CESAR;245;39483;4/3/2001 15:55:00;CIDADAO COMUM;N;0;NAZARE;BH;615538.35;804353.02;2940
+2942;2001122058;B03000;AMEACA;AV CACHOEIRINHA;1000;11250;4/3/2001 16:35:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610539.92;801314.88;2941
+2943;2001122096;B03000;AMEACA;RUA JATAI;1351;37116;4/3/2001 17:01:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611142.78;799513.14;2942
+2944;2001122213;B06000;LESAO CORPORAL;RUA CORNELIO CER;16;17417;4/3/2001 18:07:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606458.19;797838.52;2943
+2945;2001122224;B03000;AMEACA;RUA AMANDO COUTO;230;3037;4/3/2001 18:12:00;CIDADAO COMUM;S;0;SAO TOMAZ;BH;609922.73;805494.21;2944
+2946;2001122232;B03000;AMEACA;AV PRESIDENTE AN;4013;4461;4/3/2001 18:18:00;POLICIAL MILITAR;N;0;SAO FRANCISCO;BH;609536.57;802154.10;2945
+2947;2001122240;B03000;AMEACA;RUA BRISTOL;27;97543;4/3/2001 18:20:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;607783.31;810421.22;2946
+2948;2001122248;B03000;AMEACA;RUA DOUTOR CRIST;5800;55598;4/3/2001 18:32:00;CIDADAO COMUM;N;;ARAGUAIA;BH;605425.77;789436.02;2947
+2949;2001122273;B04002;HOMICIDIO CONSUM;RUA CORONEL JOAQ;400;17864;4/3/2001 18:49:00;CIDADAO COMUM;N;;HELIOPOLIS;BH;610982.98;806034.03;2948
+2950;2001122323;B03000;AMEACA;RUA TRINTA;102;106141;4/3/2001 19:17:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;608088.16;810913.29;2949
+2951;2001122343;B03000;AMEACA;RUA BONINAS;265;94863;4/3/2001 19:31:00;CIDADAO COMUM;S;;LINDEIA;BH;599815.61;790501.68;2950
+2952;2001122369;B06000;LESAO CORPORAL;RUA VEREADOR ANT;41;93602;4/3/2001 19:49:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;601665.13;786440.78;2951
+2953;2001122371;B03000;AMEACA;RUA MANOEL ALEXA;300;1580;4/3/2001 19:49:00;INICIATIVA;S;0;SAO PAULO;BH;612667.88;802769.94;2952
+2954;2001122471;B03000;AMEACA;RUA MANOEL PASSO;151;43160;4/3/2001 20:51:00;CIDADAO COMUM;S;0;VILA HUMAITA;BH;610414.87;801554.81;2953
+2955;2001122474;B04001;HOMICIDIO TENTAD;RUA SOFRE;42;85588;4/3/2001 20:53:00;CIDADAO COMUM;S;0;GOIANIA;BH;615466.95;802363.54;2954
+2956;2001122500;B06000;LESAO CORPORAL;AV ALFREDO CARAM;310;2277;4/3/2001 21:04:00;CIDADAO COMUM;S;;SAO LUIZ;BH;607189.83;803094.77;2955
+2957;2001122521;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;725;51657;4/3/2001 21:11:00;INICIATIVA;N;0;CANDELARIA;BH;609314.30;808555.78;2956
+2958;2001122536;B04001;HOMICIDIO TENTAD;RUA SACRAMENTO;170;59822;4/3/2001 21:20:00;CIDADAO COMUM;N;AP401;SERRA;BH;613713.64;795025.29;2957
+2959;2001122557;B06000;LESAO CORPORAL;RUA IRACI SANSAO;140;78443;4/3/2001 21:36:00;CIDADAO COMUM;S;;VILA PINHO;BH;602369.97;787512.60;2958
+2960;2001122599;B06000;LESAO CORPORAL;RUA VEREADOR ANT;81;93602;4/3/2001 21:59:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;601901.25;786466.11;2959
+2961;2001122607;B06000;LESAO CORPORAL;RUA JURACY CAMAR;304;39720;4/3/2001 22:05:00;CIDADAO COMUM;S;0;TUPI;BH;613245.23;805753.50;2960
+2962;2001122628;B06000;LESAO CORPORAL;RUA BARAO DO MON;757;63653;4/3/2001 22:18:00;CIDADAO COMUM;S;;CARDOSO;BH;604068.44;787904.09;2961
+2963;2001122641;B03000;AMEACA;RODOVIA BRASILIA;190;124400;4/3/2001 22:26:00;CIDADAO COMUM;S;0;SAO BENEDITO (SL;SL;610627.87;810496.47;2962
+2964;2001122646;B03000;AMEACA;RUA MEDEIA;628;64426;4/3/2001 22:32:00;CIDADAO COMUM;S;;VILA CAPRI;BH;608913.64;809686.79;2963
+2965;2001122660;B03000;AMEACA;RUA VICENTE SOLL;86;24781;4/3/2001 22:43:00;CIDADAO COMUM;S;CAA;NOVA GAMELEIRA;BH;605568.33;794890.84;2964
+2966;2001122671;B04001;HOMICIDIO TENTAD;RUA BACO;485;85461;4/3/2001 22:51:00;CIDADAO COMUM;N;;VILA CAPRI;BH;608762.35;809576.72;2965
+2967;2001122699;B03000;AMEACA;RUA DOS MOICANOS;315;92741;4/3/2001 23:11:00;CIDADAO COMUM;N;0;PILAR;BH;607410.73;788295.46;2966
+2968;2001122720;B06000;LESAO CORPORAL;RUA DOS TUPIS;751;69965;4/3/2001 23:25:00;INICIATIVA;N;PPM.1;CENTRO (BH);BH;610541.84;797015.87;2967
+2969;2001122815;B03000;AMEACA;RUA ALCINDO VIEI;150;1968;5/3/2001 00:30:00;CIDADAO COMUM;N;;BARREIRO;BH;602801.65;791079.84;2968
+2970;2001122903;B04002;HOMICIDIO CONSUM;RUA ANTONIO MARI;180;103420;5/3/2001 01:31:00;CIDADAO COMUM;N;;BELMONT;BH;615617.05;805562.96;2969
+2971;2001122936;B06000;LESAO CORPORAL;RUA MAFRA;538;66488;5/3/2001 02:19:00;CIDADAO COMUM;S;;COQUEIROS;BH;602417.29;798939.66;2970
+2972;2001122943;B06000;LESAO CORPORAL;AV PRESIDENTE AN;400;4461;5/3/2001 02:27:00;CIDADAO COMUM;N;;LAGOINHA;BH;610659.00;798426.12;2971
+2973;2001123277;B03000;AMEACA;RUA SAO SALVADOR;46;63612;5/3/2001 09:00:00;CIDADAO COMUM;S;;BONFIM;BH;610151.37;797963.59;2972
+2974;2001123527;B03000;AMEACA;RUA SANTO AGOSTI;1271;61557;5/3/2001 12:07:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613648.90;799370.40;2973
+2975;2001123609;B04002;HOMICIDIO CONSUM;RUA SAO SIMAO;200;92161;5/3/2001 13:20:00;CIDADAO COMUM;N;;ARAGUAIA;BH;605420.44;789857.68;2974
+2976;2001123757;B03000;AMEACA;AV GENERAL OLIMP;604;329;5/3/2001 15:04:00;CIDADAO COMUM;S;;ITAPOA;BH;609214.29;806688.46;2975
+2977;2001123814;B06000;LESAO CORPORAL;RUA ARIOLINO ARI;159;85811;5/3/2001 15:36:00;CIDADAO COMUM;N;;SERRA VERDE;BH;609207.39;810119.05;2976
+2978;2001123894;B03000;AMEACA;RUA PADRE FELIPE;11;51339;5/3/2001 16:18:00;CIDADAO COMUM;N;0;SANTA CRUZ;BH;610690.00;802397.32;2977
+2979;2001123898;B03000;AMEACA;RUA JOAO ANTONIO;160;122054;5/3/2001 16:19:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607884.02;810802.11;2978
+2980;2001123903;B03000;AMEACA;RUA JOSE GONCALV;127;99901;5/3/2001 16:28:00;CIDADAO COMUM;S;NR/EXATO: 129;MARIA GORETTI;BH;614573.12;802978.70;2979
+2981;2001123907;B03000;AMEACA;RUA PRIMEIRO DE ;35;23978;5/3/2001 16:31:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617547.71;797272.25;2980
+2982;2001124154;B06000;LESAO CORPORAL;RUA PROFESSOR RA;276;55673;5/3/2001 18:50:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;606499.51;797431.02;2981
+2983;2001124239;B03000;AMEACA;RUA SAO PEDRO;230;96046;5/3/2001 19:31:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614553.53;803184.78;2982
+2984;2001124243;B06000;LESAO CORPORAL;RUA MARIA;75;43737;5/3/2001 19:33:00;CIDADAO COMUM;N;;VILA MARAVILHAS;BH;603288.12;795483.45;2983
+2985;2001124249;B06000;LESAO CORPORAL;RUA JUIZ MILTON ;165;78342;5/3/2001 19:37:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;615036.21;806160.82;2984
+2986;2001124308;B06000;LESAO CORPORAL;RUA ERNESTO AUST;65;25784;5/3/2001 20:17:00;CIDADAO COMUM;S;;BOA VISTA;BH;614683.32;799433.40;2985
+2987;2001124315;B06000;LESAO CORPORAL;RUA DR BROCHADO;931;23215;5/3/2001 20:20:00;CIDADAO COMUM;S;CAFU;VERA CRUZ;BH;615979.15;797788.31;2986
+2988;2001124317;B04001;HOMICIDIO TENTAD;AV DOS ANDRADAS;5455;3761;5/3/2001 20:21:00;CIDADAO COMUM;S;0;ESPLANADA;BH;615393.94;798623.14;2987
+2989;2001124326;B06000;LESAO CORPORAL;RUA PARA DE MINA;1170;52070;5/3/2001 20:26:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605500.40;797813.06;2988
+2990;2001124344;B04001;HOMICIDIO TENTAD;RUA DAS TABOADAS;10;300190;5/3/2001 20:31:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608781.80;807946.76;2989
+2991;2001124358;B04001;HOMICIDIO TENTAD;RUA TEBAS;1215;67090;5/3/2001 20:39:00;CIDADAO COMUM;S;CSB;VERA CRUZ;BH;616361.69;798406.61;2990
+2992;2001124364;B09000;ABANDONO DE INCA;RUA STA MARIA;475;61024;5/3/2001 20:43:00;POLICIAL MILITAR;N;- P/2 16 BPM;SAO MARCOS;BH;614312.59;802504.64;2991
+2993;2001124445;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;10677;17228;5/3/2001 21:32:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609554.35;797409.14;2992
+2994;2001124605;B03000;AMEACA;RUA BOTAFOGO;102;10257;5/3/2001 23:28:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610941.52;804934.38;2993
+2995;2001124767;B03000;AMEACA;RUA DOS GOITACAZ;1203;31400;6/3/2001 03:05:00;CIDADAO COMUM;N;;BARRO PRETO;BH;610116.39;796977.69;2994
+2996;2001124803;B04001;HOMICIDIO TENTAD;PRACA RUI BARBOS;10;59558;6/3/2001 04:19:00;INICIATIVA;N;0;CENTRO BH;BH;611488.17;797485.82;2995
+2997;2001124923;B03000;AMEACA;RUA CORNELIO CER;306;17417;6/3/2001 07:47:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;606165.11;797879.98;2996
+2998;2001125042;B05000;SEQUESTRO E CARC;RUA JOAO BATISTA;10;97745;6/3/2001 09:16:00;CIDADAO COMUM;N;0;DOM SILVERIO;BH;614734.92;804019.88;2997
+2999;2001125140;B03000;AMEACA;RUA FRANCISCO AL;70;29325;6/3/2001 10:04:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;606448.55;805403.41;2998
+3000;2001125232;B03000;AMEACA;RUA CASTIGLIANO;708;14056;6/3/2001 11:04:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607285.74;797447.96;2999
+3001;2001125299;B03000;AMEACA;RUA IRACEMA;96;34896;6/3/2001 11:58:00;CIDADAO COMUM;N;;VILA HUMAITA;BH;610308.42;801607.23;3000
+3002;2001125347;B03000;AMEACA;RUA NAZARE;18;25771;6/3/2001 12:22:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617252.57;797798.96;3001
+3003;2001125399;B06000;LESAO CORPORAL;RUA ANTONIO JORG;92;100551;6/3/2001 13:04:00;CIDADAO COMUM;S;;CEU AZUL;BH;603811.20;807646.41;3002
+3004;2001125498;B08000;VIOLACAO DE DOMI;RUA ANTONIO SILV;141;87108;6/3/2001 14:14:00;CIDADAO COMUM;N;NUMERO CORRETO 1;DA LAGOA;BH;604758.70;808936.59;3003
+3005;2001125518;B03000;AMEACA;RUA CRUZEIRO DO ;1031;75168;6/3/2001 14:36:00;CIDADAO COMUM;N;;COQUEIROS;BH;602379.47;799714.08;3004
+3006;2001125636;B03000;AMEACA;RUA MARIA DA CON;123;107881;6/3/2001 15:51:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606501.70;811563.34;3005
+3007;2001125736;B06000;LESAO CORPORAL;AV BARAO HOMEM D;797;7936;6/3/2001 16:39:00;CIDADAO COMUM;S;0;JARDIM AMERICA;BH;607684.12;794788.83;3006
+3008;2001125762;B06000;LESAO CORPORAL;RUA RUBENS DE SO;631;63060;6/3/2001 16:52:00;CIDADAO COMUM;S;;AARAO REIS;BH;612567.12;805018.45;3007
+3009;2001125868;B03000;AMEACA;AV CENTRAL;1229;14812;6/3/2001 17:56:00;CIDADAO COMUM;S;LJ03;COPACABANA;BH;605957.82;807450.11;3008
+3010;2001125909;B06000;LESAO CORPORAL;AV SILVIANO BRAN;2099;66002;6/3/2001 18:25:00;CIDADAO COMUM;S;LJ02;HORTO;BH;613305.97;798057.81;3009
+3011;2001125912;B03000;AMEACA;RUA JOVINO RODRI;244;85083;6/3/2001 18:26:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606548.35;810771.26;3010
+3012;2001125923;B06000;LESAO CORPORAL;RUA JASSAPE;255;37103;6/3/2001 18:34:00;CIDADAO COMUM;N;;VILA MARAVILHAS;BH;603073.29;795519.68;3011
+3013;2001125940;B03000;AMEACA;RUA FERNANDO CAN;33;80818;6/3/2001 18:42:00;CIDADAO COMUM;N;FU;ESTRELA DO ORIEN;BH;605862.69;791985.49;3012
+3014;2001126007;B03000;AMEACA;RUA JOSE BENJAMI;36;95;6/3/2001 19:21:00;INICIATIVA;S;0;PLANALTO;BH;610484.66;806769.49;3013
+3015;2001126043;B04001;HOMICIDIO TENTAD;RUA INGLATERRA;138;34552;6/3/2001 19:45:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;606114.00;807514.48;3014
+3016;2001126104;B03000;AMEACA;RUA JANAUBA;75;36891;6/3/2001 20:23:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604696.85;793369.28;3015
+3017;2001126109;B03000;AMEACA;RUA ITAPETINGA;53;35817;6/3/2001 20:21:00;CIDADAO COMUM;S;0;PIRATININGA;BH;605923.68;809900.61;3016
+3018;2001126112;B03000;AMEACA;RUA MALVINA PALH;70;96714;6/3/2001 20:25:00;CIDADAO COMUM;S;;SERRA VERDE;BH;609317.97;810139.24;3017
+3019;2001126128;B04001;HOMICIDIO TENTAD;RUA DOMINGOS FRA;10;103244;6/3/2001 20:40:00;CIDADAO COMUM;N;;OURO PRETO;BH;606343.45;800732.42;3018
+3020;2001126136;B06000;LESAO CORPORAL;RUA CINQUENTA E ;6;33900;6/3/2001 20:42:00;CIDADAO COMUM;S;ZZ;CONJUNTO FELICID;BH;612556.58;806824.33;3019
+3021;2001126176;B03000;AMEACA;RUA DELEGADO PAU;180;90469;6/3/2001 21:11:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614606.28;802323.69;3020
+3022;2001126204;B09000;ABANDONO DE INCA;RUA BIMBARRA;326;9641;6/3/2001 21:32:00;CIDADAO COMUM;S;0;CALAFATE;BH;607195.50;796594.64;3021
+3023;2001126303;B06000;LESAO CORPORAL;RUA SILVA RESEND;170;28511;6/3/2001 22:47:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606058.40;799084.79;3022
+3024;2001126305;B03000;AMEACA;RUA ANTONIO ORLI;559;55907;6/3/2001 22:50:00;CIDADAO COMUM;S;NUMERO CORRETO 5;SAO JOAO BATISTA;BH;608243.75;807563.95;3023
+3025;2001126315;B08000;VIOLACAO DE DOMI;RUA BABACU;40;126925;6/3/2001 22:58:00;CIDADAO COMUM;N;0;OLARIA;BH;601691.41;789264.08;3024
+3026;2001126322;B04001;HOMICIDIO TENTAD;RUA LAJEDO;410;130034;6/3/2001 23:02:00;CIDADAO COMUM;N;;SAO GABRIEL;BH;614464.85;804546.93;3025
+3027;2001126334;B06000;LESAO CORPORAL;RUA IMBARE;221;82491;6/3/2001 23:06:00;INICIATIVA;N;0;GUARANI;BH;612018.59;805507.76;3026
+3028;2001126345;B03000;AMEACA;RUA FLOR BRANCA;39;28509;6/3/2001 23:12:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;605828.36;799059.89;3027
+3029;2001126385;B06000;LESAO CORPORAL;RUA PADRE ESPECH;42;51281;6/3/2001 23:36:00;CIDADAO COMUM;N;;GLORIA;BH;604236.49;798539.26;3028
+3030;2001126390;B06000;LESAO CORPORAL;RUA JOSIAS CASIM;161;63814;6/3/2001 23:33:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;613459.62;798877.69;3029
+3031;2001126398;B06000;LESAO CORPORAL;RUA OSCAR TROMPO;1396;50452;6/3/2001 23:44:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608530.75;794473.15;3030
+3032;2001126428;B06000;LESAO CORPORAL;RUA DOS CARIJOS;930;81243;6/3/2001 23:57:00;INICIATIVA;S;0;CENTRO BH;BH;610563.81;797327.45;3031
+3033;2001126457;B03000;AMEACA;RUA MONTANA;92;121745;7/3/2001 00:20:00;CIDADAO COMUM;N;;COQUEIROS;BH;603179.87;800404.09;3032
+3034;2001126547;B03000;AMEACA;PRACA RAUL SOARE;423;58010;7/3/2001 01:38:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610510.71;796848.26;3033
+3035;2001126634;B03000;AMEACA;RUA FLOR BRANCA;33;28509;7/3/2001 03:33:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;605816.65;799060.78;3034
+3036;2001126760;B06000;LESAO CORPORAL;RUA EXPEDICIONAR;12;31627;7/3/2001 07:24:00;CIDADAO COMUM;N;0;MARIA GORETTI;BH;614326.24;803386.64;3035
+3037;2001126795;B06000;LESAO CORPORAL;RUA CURITIBA;580;19090;7/3/2001 08:08:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610868.49;797331.11;3036
+3038;2001126866;B03000;AMEACA;RUA DO LAGO;325;40161;7/3/2001 08:58:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614131.46;802654.70;3037
+3039;2001126874;B03000;AMEACA;RUA WAGNER BUENO;406;86492;7/3/2001 09:06:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611620.07;807780.87;3038
+3040;2001126977;B03000;AMEACA;RUA ESPINOSA;987;26024;7/3/2001 10:06:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608773.85;797707.87;3039
+3041;2001127041;B03000;AMEACA;RUA HERCULANO DE;190;33130;7/3/2001 10:45:00;CIDADAO COMUM;S;AP301;GUTIERREZ;BH;609428.58;795499.24;3040
+3042;2001127077;B05000;SEQUESTRO E CARC;RUA HELGA TAVEIR;67;100693;7/3/2001 11:08:00;INICIATIVA;N;0;CEU AZUL;BH;603759.90;807691.36;3041
+3043;2001127098;B03000;AMEACA;RUA MARIA AMELIA;33;119024;7/3/2001 11:23:00;CIDADAO COMUM;S;0;TEIXEIRA DIAS;BH;602594.03;789712.61;3042
+3044;2001127124;B03000;AMEACA;RUA YUCATAN;100;36302;7/3/2001 11:38:00;CIDADAO COMUM;N;0;SAO PEDRO;BH;611188.45;793833.06;3043
+3045;2001127148;B04002;HOMICIDIO CONSUM;RUA BRASILIANITA;150;113894;7/3/2001 11:51:00;CIDADAO COMUM;N;;CANDELARIA;BH;607690.06;809275.37;3044
+3046;2001127201;B03000;AMEACA;RUA TABATINGA;208;66680;7/3/2001 12:21:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604637.99;796344.27;3045
+3047;2001127247;B03000;AMEACA;RUA TAMBORIL;596;66793;7/3/2001 12:55:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611198.91;799313.87;3046
+3048;2001127289;B03000;AMEACA;RUA MARIA AMELIA;33;119024;7/3/2001 13:30:00;CIDADAO COMUM;N;;TEIXEIRA DIAS;BH;602594.03;789712.61;3047
+3049;2001127360;B03000;AMEACA;AV FRANCISCO SAL;898;29669;7/3/2001 14:27:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612234.65;796788.78;3048
+3050;2001127377;B03000;AMEACA;PRACA SANTO ANTO;125;61761;7/3/2001 14:36:00;CIDADAO COMUM;S;;JARAGUA;BH;609416.64;804336.33;3049
+3051;2001127405;B03000;AMEACA;RUA PURUS;394;55819;7/3/2001 14:59:00;CIDADAO COMUM;S;0;CONCORDIA;BH;610938.91;799271.58;3050
+3052;2001127436;B03000;AMEACA;AV DOM JOSE GASP;14;22339;7/3/2001 15:18:00;CIDADAO COMUM;S;0;CORACAO EUCARIST;BH;606024.82;797122.38;3051
+3053;2001127482;B06000;LESAO CORPORAL;AV FRANCISCO SAL;263;29669;7/3/2001 15:41:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611966.14;797352.42;3052
+3054;2001127528;B06000;LESAO CORPORAL;RUA CAMPINA VERD;312;12110;7/3/2001 16:12:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606172.49;794445.71;3053
+3055;2001127548;B06000;LESAO CORPORAL;RUA SEMIRAMIS;160;64656;7/3/2001 16:22:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;605337.72;789588.60;3054
+3056;2001127572;B06000;LESAO CORPORAL;RUA GALDINO;4;75590;7/3/2001 16:37:00;CIDADAO COMUM;N;0;LINDEIA;BH;599722.92;790847.61;3055
+3057;2001127591;B06000;LESAO CORPORAL;BECO SAO CRISTOV;5;301295;7/3/2001 16:47:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610556.36;793177.37;3056
+3058;2001127606;B06000;LESAO CORPORAL;RUA LUIZ LOPES;82;94431;7/3/2001 16:57:00;CIDADAO COMUM;S;;OURO PRETO;BH;606237.42;801258.18;3057
+3059;2001127633;B06000;LESAO CORPORAL;RUA MUQUICABA;370;65343;7/3/2001 17:12:00;CIDADAO COMUM;S;;GLORIA;BH;602088.07;798145.49;3058
+3060;2001127638;B06000;LESAO CORPORAL;RUA PROFESSOR EU;110;91418;7/3/2001 17:15:00;CIDADAO COMUM;S;;BURITIS;BH;607528.16;791585.70;3059
+3061;2001127708;B06000;LESAO CORPORAL;RUA COLUNA PREST;405;16354;7/3/2001 17:58:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612497.26;803910.18;3060
+3062;2001127720;B06000;LESAO CORPORAL;RUA MANOEL PASSO;369;43160;7/3/2001 18:04:00;CIDADAO COMUM;S;0;VILA HUMAITA;BH;610429.05;801721.18;3061
+3063;2001127743;B06000;LESAO CORPORAL;AV BELEM;320;8913;7/3/2001 18:15:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;614947.36;797209.43;3062
+3064;2001127891;B03000;AMEACA;RUA DONA CARMEM;582;22820;7/3/2001 19:30:00;CIDADAO COMUM;N;0;SARANDI (URCA/BH;BH;603959.19;802338.10;3063
+3065;2001127929;B03000;AMEACA;RUA FICUS;125;28310;7/3/2001 19:46:00;CIDADAO COMUM;S;;INCONFIDENCIA;BH;605124.31;798223.07;3064
+3066;2001128029;B06000;LESAO CORPORAL;RUA ARROJADO LIS;120;6076;7/3/2001 20:54:00;CIDADAO COMUM;N;;INCONFIDENCIA;BH;605153.45;798173.45;3065
+3067;2001128053;B03000;AMEACA;RUA JESUINA FERR;167;119011;7/3/2001 21:06:00;INICIATIVA;S;0;TEIXEIRA DIAS;BH;602856.34;789660.64;3066
+3068;2001128088;B06000;LESAO CORPORAL;AV PORTUGAL;4984;54816;7/3/2001 21:26:00;CIDADAO COMUM;S;;ITAPOA;BH;609353.03;805409.84;3067
+3069;2001128093;B03000;AMEACA;RUA MARTINS SOAR;740;45049;7/3/2001 21:28:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604912.80;792944.99;3068
+3070;2001128121;B03000;AMEACA;AV BERNARDO VASC;1252;9411;7/3/2001 21:41:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610951.68;801058.28;3069
+3071;2001128132;B09000;ABANDONO DE INCA;RUA DOS TABAIARE;42;66649;7/3/2001 21:46:00;CIDADAO COMUM;S;202;FLORESTA;BH;611831.98;797292.90;3070
+3072;2001128236;B03000;AMEACA;RUA FLOR DE MAIO;174;300399;7/3/2001 22:52:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614434.55;794786.90;3071
+3073;2001128265;B06000;LESAO CORPORAL;AV BIAS FORTES;722;9553;7/3/2001 23:10:00;INICIATIVA;N;0;LOURDES;BH;610734.57;796310.95;3072
+3074;2001128300;B06000;LESAO CORPORAL;RUA SAO MANOEL;94;63335;7/3/2001 23:26:00;CIDADAO COMUM;S;;FLORESTA;BH;611886.96;798345.12;3073
+3075;2001128303;B06000;LESAO CORPORAL;RUA DES RIBEIRO ;166;20002;7/3/2001 23:29:00;INICIATIVA;N;0;BARREIRO;BH;603033.13;791206.79;3074
+3076;2001128309;B03000;AMEACA;RUA MONTE DAS OL;65;99508;7/3/2001 23:31:00;CIDADAO COMUM;S;;OLARIA;BH;601547.09;789148.77;3075
+3077;2001128388;B04002;HOMICIDIO CONSUM;BECO CATARINO;430;301514;8/3/2001 00:23:00;CIDADAO COMUM;N;;SAO LUCAS;BH;613394.52;795818.55;3076
+3078;2001128417;B06000;LESAO CORPORAL;RUA QUINANTE;231;57234;8/3/2001 00:43:00;INICIATIVA;N;0;MINASCAIXA;BH;609661.87;808945.92;3077
+3079;2001128420;B06000;LESAO CORPORAL;RUA L;125;78787;8/3/2001 00:48:00;CIDADAO COMUM;S;0;CH JATOBA IV;BH;600586.54;787827.43;3078
+3080;2001128426;B03000;AMEACA;RUA ITAPETINGA;2228;35804;8/3/2001 00:46:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610220.10;801479.69;3079
+3081;2001128460;B03000;AMEACA;RUA 51;239;302847;8/3/2001 01:30:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614103.15;805588.83;3080
+3082;2001128522;B03000;AMEACA;RUA FLORIANO PEI;5;29022;8/3/2001 02:56:00;CIDADAO COMUM;N;C;SAO GABRIEL;BH;613239.65;804432.77;3081
+3083;2001128528;B06000;LESAO CORPORAL;RUA CURITIBA;792;19090;8/3/2001 03:03:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610814.12;797122.12;3082
+3084;2001128544;B03000;AMEACA;RUA JACUI;3489;36734;8/3/2001 03:31:00;CIDADAO COMUM;S;;IPIRANGA;BH;611609.85;801193.35;3083
+3085;2001128610;B03000;AMEACA;RUA JACUI;3493;36734;8/3/2001 05:50:00;INICIATIVA;N;0;IPIRANGA;BH;611618.36;801205.40;3084
+3086;2001128617;B06000;LESAO CORPORAL;RUA JULIO MESQUI;33;81849;8/3/2001 06:01:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599314.94;788609.30;3085
+3087;2001128793;B03000;AMEACA;RUA STA APOLONIA;120;60352;8/3/2001 08:51:00;CIDADAO COMUM;N;0;DOM JOAQUIM;BH;614079.87;802000.80;3086
+3088;2001128821;B03000;AMEACA;RUA SALGUEIRO;48;3226;8/3/2001 09:13:00;CIDADAO COMUM;S;0;IPIRANGA;BH;611541.64;800461.93;3087
+3089;2001128825;B06000;LESAO CORPORAL;RUA PARAIBA;330;52170;8/3/2001 09:16:00;CIDADAO COMUM;N;AN19;FUNCIONARIOS;BH;611835.74;796063.52;3088
+3090;2001128859;B03000;AMEACA;RUA BERTOPOLIS;169;41873;8/3/2001 09:44:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612404.11;803929.57;3089
+3091;2001128883;B06000;LESAO CORPORAL;ALAMEDA DAS LATH;1200;84572;8/3/2001 10:00:00;CIDADAO COMUM;N;;SAO JOSE;BH;608808.73;803906.61;3090
+3092;2001128942;B03000;AMEACA;RUA ITABIRA;493;35237;8/3/2001 10:40:00;CIDADAO COMUM;S;CAP;LAGOINHA;BH;610931.11;798451.36;3091
+3093;2001128957;B03000;AMEACA;RUA JOSE AMARAL;155;80584;8/3/2001 10:53:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606532.81;801594.14;3092
+3094;2001128991;B03000;AMEACA;RUA DOS NAMORADO;57;48210;8/3/2001 11:19:00;CIDADAO COMUM;S;LJB;PIRAJA;BH;614090.68;802963.39;3093
+3095;2001128994;B06000;LESAO CORPORAL;RUA MARTIM DE CA;256;44944;8/3/2001 11:20:00;CIDADAO COMUM;N;0;SANTO AGOSTINHO;BH;609741.45;795972.83;3094
+3096;2001129021;B06000;LESAO CORPORAL;RUA CHOPOTO;490;80180;8/3/2001 11:37:00;CIDADAO COMUM;N;;PINDORAMA;BH;601788.76;797759.65;3095
+3097;2001129204;B06000;LESAO CORPORAL;RUA SANTO AGOSTI;1381;61557;8/3/2001 13:46:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613758.52;799384.75;3096
+3098;2001129302;B03000;AMEACA;RUA CARMO DA MAT;357;13661;8/3/2001 15:00:00;CIDADAO COMUM;S;;VERA CRUZ;BH;615362.69;797800.57;3097
+3099;2001129362;B06000;LESAO CORPORAL;RUA CORCOVADO;1720;14894;8/3/2001 15:47:00;CIDADAO COMUM;N;;SAO DOMINGOS;BH;607813.13;793342.15;3098
+3100;2001129373;B04001;HOMICIDIO TENTAD;RUA DOUTOR CRIST;312;55598;8/3/2001 15:53:00;CIDADAO COMUM;N;0;ARAGUAIA;BH;604751.25;789297.85;3099
+3101;2001129425;B06000;LESAO CORPORAL;RUA CINQUENTA E ;45;106416;8/3/2001 16:26:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;608342.42;811076.87;3100
+3102;2001129466;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;8/3/2001 16:47:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605855.99;798012.24;3101
+3103;2001129508;B03000;AMEACA;RUA JOANESIA;10;37406;8/3/2001 17:13:00;INICIATIVA;S;0;SERRA;BH;612962.48;795111.42;3102
+3104;2001129512;B03000;AMEACA;RUA MONTEIRO LOB;92;46590;8/3/2001 17:16:00;CIDADAO COMUM;S;;PROFESSOR WASHIN;IB;598851.29;789377.12;3103
+3105;2001129520;B03000;AMEACA;RUA MARIA EUSTAQ;106;69460;8/3/2001 17:19:00;INICIATIVA;S;0;FLORAMAR;BH;611579.16;806666.38;3104
+3106;2001129599;B06000;LESAO CORPORAL;RUA DAVID NASSER;587;68382;8/3/2001 18:10:00;CIDADAO COMUM;N;0;PLANALTO;BH;609458.50;806627.41;3105
+3107;2001129625;B06000;LESAO CORPORAL;RUA EXPEDITO FLA;345;84847;8/3/2001 18:22:00;INICIATIVA;S;0;DA LAGOA;BH;604545.28;809198.83;3106
+3108;2001129662;B06000;LESAO CORPORAL;RUA DO LEBLON;330;40612;8/3/2001 18:45:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602981.47;802543.20;3107
+3109;2001129685;B04002;HOMICIDIO CONSUM;RUA CINQUENTA;318;302845;8/3/2001 18:54:00;CIDADAO COMUM;S;0;TUPI;BH;614150.27;805475.49;3108
+3110;2001129778;B09000;ABANDONO DE INCA;ALAMEDA CHICO ME;37;96018;8/3/2001 19:34:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601335.72;788785.36;3109
+3111;2001129840;B05000;SEQUESTRO E CARC;RUA JULIA FREITA;32;92262;8/3/2001 20:09:00;CIDADAO COMUM;N;0;ALVARO CAMARGOS;BH;604119.95;797579.85;3110
+3112;2001129857;B03000;AMEACA;RUA VILA DA BARR;512;8069;8/3/2001 20:19:00;CIDADAO COMUM;N;;BARREIRO;BH;602200.76;790298.47;3111
+3113;2001130090;B06000;LESAO CORPORAL;PRACA MILTON CAM;16;18867;8/3/2001 23:02:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612371.63;794891.33;3112
+3114;2001130119;B06000;LESAO CORPORAL;RUA CAJUI;30;11580;8/3/2001 23:12:00;CIDADAO COMUM;S;;VILA SUZANA;BH;611836.44;803207.06;3113
+3115;2001130234;B06000;LESAO CORPORAL;RUA SOFRE;42;85588;9/3/2001 00:26:00;CIDADAO COMUM;S;0;GOIANIA;BH;615466.95;802363.54;3114
+3116;2001130302;B06000;LESAO CORPORAL;AV OLEGARIO MACI;735;49699;9/3/2001 01:19:00;INICIATIVA;N;0;CENTRO (BH);BH;610517.79;796937.79;3115
+3117;2001130451;B03000;AMEACA;AV GUANABARA;147;93400;9/3/2001 03:48:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603018.25;802662.19;3116
+3118;2001130457;B06000;LESAO CORPORAL;RUA BRASIL;57;10446;9/3/2001 03:52:00;CIDADAO COMUM;S;;CABANA;BH;604945.57;793506.57;3117
+3119;2001130762;B06000;LESAO CORPORAL;RUA EMANUEL;224;87010;9/3/2001 09:31:00;CIDADAO COMUM;S;0;PILAR;BH;607677.72;788684.08;3118
+3120;2001130815;B03000;AMEACA;AV SILVA LOBO;1665;65889;9/3/2001 10:11:00;INICIATIVA;S;0;GRAJAU;BH;607998.83;795075.02;3119
+3121;2001130845;B06000;LESAO CORPORAL;RUA P SETE;31;36343;9/3/2001 10:32:00;CIDADAO COMUM;S;;SERRA VERDE;BH;608973.20;809822.11;3120
+3122;2001130880;B03000;AMEACA;RUA DES BRAULIO;2070;19917;9/3/2001 10:55:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616352.52;797404.60;3121
+3123;2001130905;B03000;AMEACA;RUA CURA D'ARS;658;19019;9/3/2001 11:14:00;CIDADAO COMUM;N;;PRADO;BH;608458.95;796162.03;3122
+3124;2001130957;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;75;7936;9/3/2001 11:43:00;CIDADAO COMUM;S;0;ESTORIL;BH;607588.49;794818.58;3123
+3125;2001130967;B06000;LESAO CORPORAL;RUA JORNALISTA J;20;86423;9/3/2001 11:50:00;CIDADAO COMUM;N;;VILA FREI LEOPOL;BH;611387.13;809456.99;3124
+3126;2001130988;B03000;AMEACA;RUA Q;49;78415;9/3/2001 12:07:00;CIDADAO COMUM;S;;VILA PINHO;BH;602108.64;787980.59;3125
+3127;2001131001;B03000;AMEACA;RUA VINTE E UM;150;302827;9/3/2001 12:17:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614559.08;805708.38;3126
+3128;2001131024;B06000;LESAO CORPORAL;RUA JOSE BENEDIT;95;14097;9/3/2001 12:36:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608678.04;799900.10;3127
+3129;2001131052;B06000;LESAO CORPORAL;RUA DA BAHIA;1201;81155;9/3/2001 12:57:00;INICIATIVA;N;0;LOURDES;BH;611247.00;796466.91;3128
+3130;2001131062;B03000;AMEACA;AV PORTUGAL;1615;54816;9/3/2001 13:03:00;CIDADAO COMUM;N;LJ;JARDIM ATLANTICO;BH;606624.57;805076.59;3129
+3131;2001131084;B03000;AMEACA;AV BRIGADEIRO ED;146;2860;9/3/2001 13:15:00;CIDADAO COMUM;N;0;DOM BOSCO;BH;604415.87;797954.64;3130
+3132;2001131141;B03000;AMEACA;RUA FREI LEOPOLD;153;29946;9/3/2001 13:53:00;CIDADAO COMUM;S;;OURO PRETO;BH;606823.65;802833.82;3131
+3133;2001131326;B06000;LESAO CORPORAL;BECO BELMIRO DIA;12;171015;9/3/2001 15:51:00;CIDADAO COMUM;N;EN22;CABANA;BH;604788.98;794084.00;3132
+3134;2001131385;B03000;AMEACA;RUA JUATUBA;42;39367;9/3/2001 16:24:00;CIDADAO COMUM;N;0;VISTA ALEGRE;BH;605262.83;793420.62;3133
+3135;2001131589;B06000;LESAO CORPORAL;RUA FERNAO DIAS;1724;28133;9/3/2001 18:15:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616225.47;797490.06;3134
+3136;2001131607;B03000;AMEACA;AV SANTA MATILDE;100;61125;9/3/2001 18:21:00;CIDADAO COMUM;S;0;DOM CABRAL;BH;604671.57;796695.46;3135
+3137;2001131626;B03000;AMEACA;RUA PERNAMBUCO;1408;53463;9/3/2001 18:29:00;CIDADAO COMUM;S;PX257;FUNCIONARIOS;BH;611366.54;794888.79;3136
+3138;2001131647;B06000;LESAO CORPORAL;RUA ANTONIO MARC;56;48539;9/3/2001 18:39:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606640.65;810340.57;3137
+3139;2001131681;B03000;AMEACA;BECO ALIPIO GOUL;25;301607;9/3/2001 19:04:00;INICIATIVA;S;0;CAFEZAL;BH;614372.36;794514.88;3138
+3140;2001131697;B03000;AMEACA;AV OLEGARIO MACI;742;49699;9/3/2001 19:12:00;CIDADAO COMUM;S;LJ1186;LOURDES;BH;610475.34;796973.70;3139
+3141;2001131743;B04001;HOMICIDIO TENTAD;RUA OPALA;52;50263;9/3/2001 19:39:00;CIDADAO COMUM;S;;CRUZEIRO;BH;612382.32;794474.41;3140
+3142;2001131750;B03000;AMEACA;RUA VINTE E UM;96;38727;9/3/2001 19:42:00;CIDADAO COMUM;S;0;EYMARD;BH;613449.25;803612.99;3141
+3143;2001131806;B06000;LESAO CORPORAL;RUA PINDARE;264;53725;9/3/2001 20:19:00;CIDADAO COMUM;S;;JARDIM FLORENCIA;BH;604842.13;810280.47;3142
+3144;2001131820;B03000;AMEACA;RUA SAO PEDRO;125;25642;9/3/2001 20:30:00;CIDADAO COMUM;S;;TAQUARIL;BH;617086.49;797642.21;3143
+3145;2001131823;B09000;ABANDONO DE INCA;RUA LINCOLN;116;41136;9/3/2001 20:31:00;CIDADAO COMUM;S;0;UNIAO;BH;612529.82;801293.20;3144
+3146;2001131845;B06000;LESAO CORPORAL;RUA UM;40;126811;9/3/2001 20:39:00;CIDADAO COMUM;S;CASA B/PROXIMO F;BETANIA;BH;605248.47;792522.98;3145
+3147;2001131935;B03000;AMEACA;RUA POROROCAS;157;54730;9/3/2001 21:33:00;CIDADAO COMUM;S;0;APARECIDA;BH;609174.80;799926.58;3146
+3148;2001131978;B06000;LESAO CORPORAL;AV DOM JOAO VI;500;22294;9/3/2001 22:00:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606436.28;792638.35;3147
+3149;2001132045;B09000;ABANDONO DE INCA;RUA ROMA;425;59227;9/3/2001 22:52:00;CIDADAO COMUM;S;;COPACABANA;BH;606404.89;806324.07;3148
+3150;2001132053;B06000;LESAO CORPORAL;RUA MARIA HELENA;45;116763;9/3/2001 22:55:00;CIDADAO COMUM;N;0;GORDURAS;BH;618471.78;806457.72;3149
+3151;2001132080;B03000;AMEACA;RUA B;145;99463;9/3/2001 23:11:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615056.13;808241.11;3150
+3152;2001132097;B03000;AMEACA;RUA ALUIZIO DAVI;47;9770;9/3/2001 23:19:00;CIDADAO COMUM;N;;OURO PRETO;BH;606077.06;800835.16;3151
+3153;2001132123;B04001;HOMICIDIO TENTAD;RUA RIO DE JANEI;661;58772;9/3/2001 23:46:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611114.77;797039.90;3152
+3154;2001132179;B03000;AMEACA;AV JOAO XXIII;495;37926;10/3/2001 00:14:00;INICIATIVA;N;0;SAO JOSE;BH;604237.06;799490.03;3153
+3155;2001132215;B06000;LESAO CORPORAL;RUA ALBERTO BRES;416;1779;10/3/2001 00:43:00;MILITARES DAS FO;S;AP301;SAO LUCAS;BH;613739.06;795923.53;3154
+3156;2001132278;B06000;LESAO CORPORAL;RUA AGUANIL;621;1564;10/3/2001 01:19:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;605153.02;793405.94;3155
+3157;2001132312;B03000;AMEACA;RUA PILAR;143;53652;10/3/2001 01:38:00;CIDADAO COMUM;S;0;GRAJAU;BH;608312.73;795173.39;3156
+3158;2001132328;B06000;LESAO CORPORAL;RUA PENALVA;55;96276;10/3/2001 01:49:00;CIDADAO COMUM;S;;DOM SILVERIO;BH;614572.76;804374.21;3157
+3159;2001132364;B06000;LESAO CORPORAL;RUA ARCEBURGO;242;5754;10/3/2001 02:09:00;CIDADAO COMUM;N;0;BONFIM;BH;610028.45;797978.48;3158
+3160;2001132366;B06000;LESAO CORPORAL;RUA DES BRAULIO;1460;19917;10/3/2001 02:13:00;INICIATIVA;S;0;VERA CRUZ;BH;616272.96;797748.52;3159
+3161;2001132379;B06000;LESAO CORPORAL;RUA AMPERE;165;3484;10/3/2001 02:19:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612179.88;803639.20;3160
+3162;2001132393;B04001;HOMICIDIO TENTAD;RUA ANTONIO JOSE;387;7431;10/3/2001 02:33:00;INICIATIVA;S;0;CEU AZUL;BH;605094.73;807852.13;3161
+3163;2001132421;B04001;HOMICIDIO TENTAD;RUA JOAO LUCIO B;207;37737;10/3/2001 02:56:00;CIDADAO COMUM;N;0;PRADO;BH;609066.20;796836.45;3162
+3164;2001132424;B06000;LESAO CORPORAL;RUA SOCRATES;704;85953;10/3/2001 03:00:00;CIDADAO COMUM;S;;DOM SILVERIO;BH;615328.85;804470.89;3163
+3165;2001132437;B02000;RIXA;RUA DESEMBARGADO;86;115569;10/3/2001 03:09:00;CIDADAO COMUM;S;0;SANTA ROSA;BH;610450.04;803515.63;3164
+3166;2001132463;B06000;LESAO CORPORAL;AV DEPUTADO ULTI;922;82549;10/3/2001 03:31:00;CIDADAO COMUM;N;0;PLANALTO;BH;610685.49;806327.55;3165
+3167;2001132471;B06000;LESAO CORPORAL;AV SANTOS DUMONT;574;61950;10/3/2001 03:37:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611085.24;797586.10;3166
+3168;2001132479;B04001;HOMICIDIO TENTAD;RUA DOS CAETES;904;11376;10/3/2001 03:44:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610737.67;797573.19;3167
+3169;2001132489;B03000;AMEACA;RUA DOM HENRIQUE;145;102531;10/3/2001 03:51:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616541.52;797463.00;3168
+3170;2001132512;B03000;AMEACA;AV CECILIA PINTO;10;14447;10/3/2001 04:04:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;610447.02;805109.36;3169
+3171;2001132562;B06000;LESAO CORPORAL;RUA JANUARIA;130;36936;10/3/2001 04:45:00;INICIATIVA;N;0;FLORESTA;BH;611623.24;797867.33;3170
+3172;2001132583;B03000;AMEACA;RUA CARMO DO PAR;24;13674;10/3/2001 05:08:00;INICIATIVA;S;0;SANTA BRANCA;BH;608430.17;806537.36;3171
+3173;2001132619;B06000;LESAO CORPORAL;RUA MANHUARA;754;42891;10/3/2001 05:48:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612620.57;804097.74;3172
+3174;2001132724;B03000;AMEACA;RUA JOSE SANTIAG;217;39152;10/3/2001 08:13:00;CIDADAO COMUM;S;;PIRAJA;BH;613907.92;803290.60;3173
+3175;2001132783;B03000;AMEACA;RUA B;233;99463;10/3/2001 08:55:00;CIDADAO COMUM;S;CONJUNTO HABITAC;ANTONIO RIBEIRO ;BH;615108.83;808304.73;3174
+3176;2001132826;B03000;AMEACA;RUA JOAO ALPHONS;358;56900;10/3/2001 09:37:00;CIDADAO COMUM;S;;SANTA MARIA;BH;603482.31;795442.09;3175
+3177;2001132836;B03000;AMEACA;RUA E;25;24609;10/3/2001 09:42:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;613409.70;798697.81;3176
+3178;2001132854;B03000;AMEACA;RUA DESEMBARGADO;524;56837;10/3/2001 10:01:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606619.76;801988.28;3177
+3179;2001132858;B03000;AMEACA;RUA ALGA MARINHA;837;66623;10/3/2001 10:04:00;CIDADAO COMUM;S;0;FLORAMAR;BH;610880.29;807307.57;3178
+3180;2001132875;B06000;LESAO CORPORAL;RUA EURITA;464;26910;10/3/2001 10:12:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;613248.91;797355.88;3179
+3181;2001132915;B06000;LESAO CORPORAL;AV DOM PEDRO II;5092;53145;10/3/2001 10:42:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606214.33;798752.85;3180
+3182;2001132939;B03000;AMEACA;RUA LAGOA DO OUR;60;96310;10/3/2001 11:05:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614514.29;804670.38;3181
+3183;2001132964;B03000;AMEACA;RUA ONZE DE AGOS;170;14800;10/3/2001 11:24:00;CIDADAO COMUM;S;0;LEONINA;BH;608260.71;793318.58;3182
+3184;2001133010;B06000;LESAO CORPORAL;RUA PONTA PORA;234;54601;10/3/2001 11:57:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613187.23;796919.20;3183
+3185;2001133018;B06000;LESAO CORPORAL;RUA AFONSO TAUNA;55;1287;10/3/2001 12:06:00;CIDADAO COMUM;N;;TUPI;BH;613048.27;805895.79;3184
+3186;2001133071;B03000;AMEACA;AV ABILIO MACHAD;1850;634;10/3/2001 12:46:00;INICIATIVA;N;0;GLORIA;BH;604280.89;799156.78;3185
+3187;2001133125;B06000;LESAO CORPORAL;RUA DOS CARIJOS;244;81243;10/3/2001 13:20:00;INICIATIVA;N;0;CENTRO (BH);BH;611237.36;797154.26;3186
+3188;2001133148;B03000;AMEACA;AV PERIMETRAL;575;78531;10/3/2001 13:34:00;CIDADAO COMUM;S;0;VILA PINHO;BH;601770.82;788354.35;3187
+3189;2001133167;B03000;AMEACA;RUA ITAQUERA;61;35920;10/3/2001 13:48:00;CIDADAO COMUM;S;0;CONCORDIA;BH;610845.53;799056.35;3188
+3190;2001133210;B04001;HOMICIDIO TENTAD;AV PRESIDENTE AN;50;4461;10/3/2001 14:14:00;INICIATIVA;N;0;LAGOINHA;BH;610871.52;798167.64;3189
+3191;2001133221;B03000;AMEACA;RUA CACHOEIRA DO;87;11221;10/3/2001 14:19:00;CIDADAO COMUM;N;0;CALAFATE;BH;607823.36;796524.67;3190
+3192;2001133233;B03000;AMEACA;RUA JOSE DO CARM;135;69559;10/3/2001 14:26:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609514.03;809256.67;3191
+3193;2001133266;B06000;LESAO CORPORAL;RUA RAMIRO SIQUE;125;128858;10/3/2001 14:48:00;INICIATIVA;S;0;CASTANHEIRAS (TA;BH;617779.12;797270.76;3192
+3194;2001133288;B06000;LESAO CORPORAL;RUA NICIAS CONTI;840;56115;10/3/2001 15:06:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605487.26;795114.95;3193
+3195;2001133323;B03000;AMEACA;RUA SEBASTIAO MA;6;67150;10/3/2001 15:25:00;CIDADAO COMUM;S;;UNIAO;BH;613320.67;801418.37;3194
+3196;2001133324;B06000;LESAO CORPORAL;RUA JOAQUIM CARD;399;71835;10/3/2001 15:26:00;POLICIAL MILITAR;N;FU;TUPI;BH;613424.10;806433.65;3195
+3197;2001133332;B03000;AMEACA;RUA BENEDITO NEV;80;9061;10/3/2001 15:27:00;CIDADAO COMUM;S;;NAZARE;BH;616036.74;804426.63;3196
+3198;2001133370;B06000;LESAO CORPORAL;RUA ANGRA DOS RE;101;4027;10/3/2001 15:56:00;CIDADAO COMUM;S;0;NOVA GRANADA;BH;607661.15;795094.51;3197
+3199;2001133372;B03000;AMEACA;AV ANTONIO ABRAH;1000;4320;10/3/2001 15:56:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;3198
+3200;2001133376;B03000;AMEACA;RUA Y;26;78497;10/3/2001 15:58:00;CIDADAO COMUM;S;;VILA PINHO;BH;602512.92;787531.28;3199
+3201;2001133431;B03000;AMEACA;RUA ARARIBA;317;5540;10/3/2001 16:27:00;CIDADAO COMUM;S;0;SAO CRISTOVAO;BH;610222.10;799194.68;3200
+3202;2001133453;B03000;AMEACA;RUA CAMBUI;329;11827;10/3/2001 16:43:00;CIDADAO COMUM;S;;GUARANI;BH;612340.28;805479.91;3201
+3203;2001133493;B03000;AMEACA;AV DOM JOAO VI;1015;22294;10/3/2001 17:04:00;CIDADAO COMUM;N;;PALMEIRAS;BH;606671.01;791769.47;3202
+3204;2001133517;B03000;AMEACA;RUA MONSENHOR NO;627;82968;10/3/2001 17:16:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603609.05;802750.23;3203
+3205;2001133608;B03000;AMEACA;RUA DOS TUPIS;642;69965;10/3/2001 18:18:00;INICIATIVA;N;0;CENTRO (BH);BH;610664.10;797017.51;3204
+3206;2001133614;B06000;LESAO CORPORAL;RUA CINCO;18;27128;10/3/2001 18:23:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616655.75;806912.57;3205
+3207;2001133637;B03000;AMEACA;AV COLETORA;259;78241;10/3/2001 18:34:00;CIDADAO COMUM;S;CA;VILA PINHO;BH;601857.39;788584.95;3206
+3208;2001133639;B04001;HOMICIDIO TENTAD;RUA DO BATISMO;252;8390;10/3/2001 18:38:00;CIDADAO COMUM;S;;SAO JOSE;BH;605523.60;798732.42;3207
+3209;2001133661;B03000;AMEACA;RUA FLOR DA AMIZ;77;94646;10/3/2001 18:50:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606195.05;799625.17;3208
+3210;2001133668;B06000;LESAO CORPORAL;AV ANTONIO ABRAH;1000;4320;10/3/2001 18:56:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;3209
+3211;2001133685;B06000;LESAO CORPORAL;AV CECILIA PINTO;11;14447;10/3/2001 19:14:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610600.26;805253.80;3210
+3212;2001133726;B06000;LESAO CORPORAL;AV OTACILIO NEGR;1814;50566;10/3/2001 19:30:00;INICIATIVA;S;0;SAO LUIZ;BH;607161.46;804037.88;3211
+3213;2001133756;B06000;LESAO CORPORAL;RUA BEIRA ALTA;1016;62777;10/3/2001 19:45:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609672.34;802505.06;3212
+3214;2001133825;B03000;AMEACA;RUA PINTOR ATAID;800;53870;10/3/2001 20:24:00;CIDADAO COMUM;S;CAFU;TUPI;BH;613715.53;806266.08;3213
+3215;2001133830;B04002;HOMICIDIO CONSUM;RUA BENTO;140;170807;10/3/2001 20:22:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;608443.37;794109.13;3214
+3216;2001133843;B06000;LESAO CORPORAL;AV NOSSA SENHORA;2458;48107;10/3/2001 20:32:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;609576.83;797656.73;3215
+3217;2001133878;B03000;AMEACA;RUA JOAQUIM PURI;183;96087;10/3/2001 20:54:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614518.23;803271.68;3216
+3218;2001133925;B06000;LESAO CORPORAL;RUA PINHEIROS;840;53794;10/3/2001 21:13:00;INICIATIVA;S;0;APARECIDA;BH;609294.20;800486.27;3217
+3219;2001133942;B04002;HOMICIDIO CONSUM;RUA RADIALISTA J;170;113664;10/3/2001 21:22:00;CIDADAO COMUM;N;LJ1;CEU AZUL;BH;604317.03;807560.85;3218
+3220;2001133970;B06000;LESAO CORPORAL;RUA CONEGO SANTA;71;16846;10/3/2001 21:38:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;609967.00;801045.34;3219
+3221;2001134000;B06000;LESAO CORPORAL;AV ALVARO DA SIL;120;2872;10/3/2001 21:58:00;CIDADAO COMUM;S;;BARREIRO;BH;602794.32;791345.50;3220
+3222;2001134002;B06000;LESAO CORPORAL;RUA JOAIMA;5;37359;10/3/2001 21:58:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605520.04;808206.04;3221
+3223;2001134015;B06000;LESAO CORPORAL;RUA SAO PAULO;855;63464;10/3/2001 22:11:00;INICIATIVA;S;0;CENTRO (BH);BH;610942.81;796944.19;3222
+3224;2001134022;B04001;HOMICIDIO TENTAD;RUA ANTONIO VIEI;365;4925;10/3/2001 22:12:00;CIDADAO COMUM;S;;GLALIJA;BH;603373.75;794204.83;3223
+3225;2001134034;B03000;AMEACA;RUA DO LEBLON;425;40612;10/3/2001 22:24:00;CIDADAO COMUM;N;CAFR;SARANDI (URCA/BH;BH;602909.50;802449.12;3224
+3226;2001134053;B06000;LESAO CORPORAL;RUA ARMANDO RIBE;236;82435;10/3/2001 22:39:00;CIDADAO COMUM;N;0;SAO BERNARDO;BH;611325.66;805084.25;3225
+3227;2001134061;B03000;AMEACA;RUA JOSE DO CARM;130;40997;10/3/2001 22:47:00;INICIATIVA;S;0;VILA SUZANA;BH;611633.88;802983.51;3226
+3228;2001134090;B03000;AMEACA;RUA JOSE DOS SAN;595;118917;10/3/2001 23:02:00;CIDADAO COMUM;S;;TEIXEIRA DIAS;BH;602852.09;789247.61;3227
+3229;2001134095;B03000;AMEACA;RUA CLAUDINOR ME;125;113610;10/3/2001 23:05:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609632.17;809246.02;3228
+3230;2001134157;B06000;LESAO CORPORAL;RUA SAIDE HADDAD;453;32632;10/3/2001 23:34:00;CIDADAO COMUM;N;;COPACABANA;BH;606667.30;806118.72;3229
+3231;2001134200;B06000;LESAO CORPORAL;RUA JACUI;520;36734;11/3/2001 00:08:00;CIDADAO COMUM;S;0;FLORESTA;BH;611817.14;798323.18;3230
+3232;2001134233;B06000;LESAO CORPORAL;AV JOSE BONIFACI;407;38579;11/3/2001 00:33:00;CIDADAO COMUM;N;0;PRADO LOPES;BH;610154.66;799019.14;3231
+3233;2001134292;B06000;LESAO CORPORAL;RUA AQUIDABAN;765;5190;11/3/2001 01:06:00;CIDADAO COMUM;N;AP201;PADRE EUSTAQUIO;BH;607112.28;797085.44;3232
+3234;2001134309;B06000;LESAO CORPORAL;RUA PECANHA;456;52880;11/3/2001 01:14:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;610082.65;797547.31;3233
+3235;2001134366;B06000;LESAO CORPORAL;RUA FRANCISCO GO;11;68569;11/3/2001 01:47:00;CIDADAO COMUM;S;0;ESTRELA DALVA;BH;607532.57;792322.04;3234
+3236;2001134391;B06000;LESAO CORPORAL;RUA FLOR DA NOIV;220;28767;11/3/2001 02:06:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606155.93;799519.51;3235
+3237;2001134424;B02000;RIXA;RUA DOUTOR ALBER;40;23114;11/3/2001 02:30:00;CIDADAO COMUM;S;;HELIOPOLIS;BH;610784.10;805344.10;3236
+3238;2001134426;B04001;HOMICIDIO TENTAD;RUA VINTE E UM;150;302827;11/3/2001 02:16:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614559.08;805708.38;3237
+3239;2001134439;B03000;AMEACA;AV SILVA LOBO;953;65889;11/3/2001 02:49:00;CIDADAO COMUM;S;0;CALAFATE;BH;607671.69;795612.00;3238
+3240;2001134493;B06000;LESAO CORPORAL;AV BIAS FORTES;1772;9553;11/3/2001 03:31:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610196.72;797244.85;3239
+3241;2001134611;B06000;LESAO CORPORAL;RUA PADRE EUSTAQ;245;51294;11/3/2001 05:44:00;INICIATIVA;N;0;CARLOS PRATES;BH;609259.76;797673.34;3240
+3242;2001134770;B06000;LESAO CORPORAL;RUA ARGENTINA;330;5870;11/3/2001 08:40:00;CIDADAO COMUM;N;;COPACABANA;BH;606266.99;806343.30;3241
+3243;2001134910;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;2221;57830;11/3/2001 10:43:00;INICIATIVA;S;0;ESTORIL;BH;609072.11;793144.52;3242
+3244;2001134955;B03000;AMEACA;RUA DOS MOICANOS;27;84024;11/3/2001 11:10:00;CIDADAO COMUM;N;;SANTA MONICA;BH;606518.83;807252.81;3243
+3245;2001135047;B03000;AMEACA;RUA PARACATU;812;52095;11/3/2001 12:31:00;CIDADAO COMUM;N;0;SANTO AGOSTINHO;BH;609642.16;796526.05;3244
+3246;2001135061;B03000;AMEACA;RUA OLIVER;286;49950;11/3/2001 12:47:00;CIDADAO COMUM;S;;UNIAO;BH;612796.31;801453.59;3245
+3247;2001135100;B03000;AMEACA;RUA VERISSIMO GU;475;102720;11/3/2001 13:23:00;INICIATIVA;S;;REGINA;BH;599062.14;790155.01;3246
+3248;2001135107;B03000;AMEACA;RUA CECILIO EMIG;95;14131;11/3/2001 13:33:00;CIDADAO COMUM;N;0;PRIMEIRO DE MAIO;BH;612420.25;803804.17;3247
+3249;2001135112;B04001;HOMICIDIO TENTAD;RUA ADAMINA;285;993;11/3/2001 13:44:00;CIDADAO COMUM;N;CAB;SANTA TEREZA;BH;613245.80;797540.93;3248
+3250;2001135139;B04001;HOMICIDIO TENTAD;BECO PEDRA VERDE;195;301698;11/3/2001 14:07:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614674.76;794885.65;3249
+3251;2001135140;B03000;AMEACA;RUA KEPLER;125;39990;11/3/2001 14:06:00;CIDADAO COMUM;S;0;SANTA LUCIA;BH;609926.77;792542.84;3250
+3252;2001135161;B06000;LESAO CORPORAL;RUA BABEL;453;7460;11/3/2001 14:29:00;CIDADAO COMUM;S;;SAO SALVADOR;BH;603180.30;799419.94;3251
+3253;2001135207;B03000;AMEACA;RUA CATALUNHA;400;14204;11/3/2001 15:13:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603903.59;802481.58;3252
+3254;2001135286;B03000;AMEACA;RUA COMPASSO;79;301444;11/3/2001 15:51:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614292.21;795356.13;3253
+3255;2001135350;B03000;AMEACA;RUA HERCILIA GOM;126;104389;11/3/2001 16:27:00;INICIATIVA;N;0;DAS INDUSTRIAS;BH;605366.03;791053.96;3254
+3256;2001135402;B03000;AMEACA;BECO DA AGUA;209;172308;11/3/2001 16:55:00;CIDADAO COMUM;S;;CAFEZAL;BH;614062.90;794471.00;3255
+3257;2001135454;B03000;AMEACA;RUA PROFESSOR NE;85;55617;11/3/2001 17:22:00;CIDADAO COMUM;S;AP204;LIBERDADE;BH;609112.67;804157.20;3256
+3258;2001135545;B06000;LESAO CORPORAL;RUA JOAO SILVA;36;89548;11/3/2001 18:16:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;617409.75;804658.18;3257
+3259;2001135556;B03000;AMEACA;RUA MONTE ALEGRE;974;46357;11/3/2001 18:22:00;CIDADAO COMUM;S;0;SAO LUCAS;BH;613142.34;795894.02;3258
+3260;2001135565;B03000;AMEACA;RUA ITAPAGIPE;299;35729;11/3/2001 18:32:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611258.92;798905.89;3259
+3261;2001135582;B03000;AMEACA;RUA CENTRO SOCIA;481;14853;11/3/2001 18:39:00;CIDADAO COMUM;S;;CABANA;BH;604988.44;794481.77;3260
+3262;2001135642;B03000;AMEACA;RUA RAMIRO SIQUE;75;128858;11/3/2001 19:15:00;CIDADAO COMUM;N;;CASTANHEIRAS (TA;BH;617772.39;797223.77;3261
+3263;2001135655;B06000;LESAO CORPORAL;RUA PADRE JULIO ;1074;51496;11/3/2001 19:20:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615907.15;797512.07;3262
+3264;2001135672;B03000;AMEACA;RUA JOSE AGUILAR;52;65371;11/3/2001 19:31:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608388.25;808451.24;3263
+3265;2001135704;B03000;AMEACA;RUA JULITA NUNES;210;130047;11/3/2001 19:51:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609164.95;809748.79;3264
+3266;2001135711;B03000;AMEACA;AV ITAITUBA;450;35454;11/3/2001 19:58:00;CIDADAO COMUM;S;;BOA VISTA;BH;615072.17;799768.56;3265
+3267;2001135734;B06000;LESAO CORPORAL;RUA SILVIO GUEDE;80;89610;11/3/2001 20:08:00;CIDADAO COMUM;S;A;PALMEIRAS;BH;606793.47;790943.10;3266
+3268;2001135755;B06000;LESAO CORPORAL;RUA DOM LARA;36;22354;11/3/2001 20:20:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;604948.00;793141.08;3267
+3269;2001135759;B03000;AMEACA;AV AUGUSTO DE LI;566;6731;11/3/2001 20:22:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610794.74;796703.04;3268
+3270;2001135807;B03000;AMEACA;RUA CARLINDO COS;116;97294;11/3/2001 20:47:00;CIDADAO COMUM;S;;EYMARD;BH;613796.27;803705.16;3269
+3271;2001135814;B06000;LESAO CORPORAL;RUA OSCAR TROMPO;1396;50452;11/3/2001 20:52:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608530.75;794473.15;3270
+3272;2001135832;B06000;LESAO CORPORAL;RUA IPE;75;107002;11/3/2001 20:59:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605934.79;794017.44;3271
+3273;2001135950;B06000;LESAO CORPORAL;RUA DR BROCHADO;347;23215;11/3/2001 22:07:00;CIDADAO COMUM;S;LJ;VERA CRUZ;BH;615924.06;798038.94;3272
+3274;2001135984;B06000;LESAO CORPORAL;RUA CORONEL ANTO;187;17619;11/3/2001 22:25:00;INICIATIVA;N;0;REGINA;BH;599173.76;790169.22;3273
+3275;2001136008;B06000;LESAO CORPORAL;RUA VEREADOR CAM;310;21005;11/3/2001 22:40:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615839.95;806852.22;3274
+3276;2001136016;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;11/3/2001 22:50:00;INICIATIVA;S;0;TIROL;BH;600947.66;789885.51;3275
+3277;2001136021;B03000;AMEACA;RUA ARARUAMA;95;77945;11/3/2001 22:52:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606533.50;795254.31;3276
+3278;2001136023;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;11/3/2001 22:55:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;3277
+3279;2001136032;B06000;LESAO CORPORAL;AV LEONTINO FRAN;716;445;11/3/2001 23:00:00;CIDADAO COMUM;N;;SERRA VERDE;BH;608934.38;810294.22;3278
+3280;2001136046;B04001;HOMICIDIO TENTAD;RUA CONDE DE PRA;329;16704;11/3/2001 23:08:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;607817.82;797193.08;3279
+3281;2001136048;B04001;HOMICIDIO TENTAD;RUA DOS COMANCHE;835;16367;11/3/2001 23:09:00;CIDADAO COMUM;S;CA102;SANTA MONICA;BH;606520.24;807304.69;3280
+3282;2001136058;B04001;HOMICIDIO TENTAD;AV BRIGADEIRO ED;1250;2860;11/3/2001 23:15:00;CIDADAO COMUM;S;;GLORIA;BH;604129.27;798741.46;3281
+3283;2001136065;B06000;LESAO CORPORAL;AV COLETORA;706;78241;11/3/2001 23:18:00;CIDADAO COMUM;S;0;VILA PINHO;BH;602173.18;788104.09;3282
+3284;2001136072;B03000;AMEACA;RUA IBIRAPITANGA;13;33880;11/3/2001 23:20:00;CIDADAO COMUM;S;;DOM CABRAL;BH;605218.23;796295.85;3283
+3285;2001136083;B03000;AMEACA;RUA DR BROCHADO;786;23215;11/3/2001 23:28:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615903.09;797998.69;3284
+3286;2001136122;B06000;LESAO CORPORAL;RUA UM;1;27979;11/3/2001 23:56:00;CIDADAO COMUM;S;0;CAPITAO EDUARDO;BH;618570.61;806854.95;3285
+3287;2001136133;B06000;LESAO CORPORAL;RUA MONTE ALEGRE;956;46357;12/3/2001 00:03:00;CIDADAO COMUM;N;;SAO LUCAS;BH;613132.69;795877.59;3286
+3288;2001136154;B06000;LESAO CORPORAL;RUA CISNE;29;15897;12/3/2001 00:21:00;CIDADAO COMUM;S;0;SANTA CRUZ (BARR;BH;603604.65;788616.62;3287
+3289;2001136176;B03000;AMEACA;RUA TREM DE FERR;500;9377;12/3/2001 00:38:00;CIDADAO COMUM;S;;ITAIPU BH;BH;598843.35;789728.92;3288
+3290;2001136186;B03000;AMEACA;AV IVAI;1283;80629;12/3/2001 00:41:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604508.73;797938.76;3289
+3291;2001136197;B06000;LESAO CORPORAL;RUA VOLTS;281;73626;12/3/2001 00:47:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612018.39;803526.32;3290
+3292;2001136248;B03000;AMEACA;AV AGENOR DE PAU;285;86250;12/3/2001 01:19:00;CIDADAO COMUM;S;REF///FABRICA DE;JAQUELINE;BH;611475.70;810215.54;3291
+3293;2001136304;B03000;AMEACA;RUA DOS CARIJOS;758;81243;12/3/2001 02:24:00;INICIATIVA;N;0;CENTRO BH;BH;610724.95;797294.54;3292
+3294;2001136750;B06000;LESAO CORPORAL;RUA SAO PAULO;279;63464;12/3/2001 11:01:00;INICIATIVA;N;0;CENTRO (BH);BH;611088.02;797493.26;3293
+3295;2001136769;B03000;AMEACA;RUA REAL MADRID;94;58091;12/3/2001 11:13:00;INICIATIVA;S;0;COQUEIROS;BH;603542.26;800110.20;3294
+3296;2001136822;B06000;LESAO CORPORAL;RUA RIACHO;90;24927;12/3/2001 11:49:00;CIDADAO COMUM;N;0;TAQUARIL;BH;617243.77;797186.28;3295
+3297;2001136898;B06000;LESAO CORPORAL;RUA UM;18;103128;12/3/2001 12:39:00;CIDADAO COMUM;S;0;OLHOS DAGUA;BH;605995.69;793120.57;3296
+3298;2001136922;B04002;HOMICIDIO CONSUM;RUA GILBERTO FRE;150;92593;12/3/2001 12:58:00;CIDADAO COMUM;N;0;CHACARAS REUNIDA;BH;605824.74;789594.96;3297
+3299;2001136943;B03000;AMEACA;RUA ITAPEVA;721;35820;12/3/2001 13:10:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611512.69;799189.30;3298
+3300;2001136965;B03000;AMEACA;AV DOS BANDEIRAN;325;7775;12/3/2001 13:27:00;CIDADAO COMUM;S;0;SION;BH;611990.67;793015.07;3299
+3301;2001136997;B03000;AMEACA;RUA ALIPIO DE ME;735;2378;12/3/2001 14:00:00;CIDADAO COMUM;S;0;JARDIM MONTANHES;BH;606267.32;798788.92;3300
+3302;2001137181;B04001;HOMICIDIO TENTAD;AV GETULIO VARGA;1444;81256;12/3/2001 16:00:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;611346.34;795024.47;3301
+3303;2001137233;B03000;AMEACA;RUA IBIRAPITANGA;285;33880;12/3/2001 16:25:00;CIDADAO COMUM;S;0;DOM CABRAL;BH;605026.43;796485.74;3302
+3304;2001137242;B03000;AMEACA;AV SARAMENHA;1525;64007;12/3/2001 16:30:00;CIDADAO COMUM;S;0;GUARANI;BH;613298.64;805560.73;3303
+3305;2001137298;B03000;AMEACA;RUA GRAUNAS;213;31797;12/3/2001 16:54:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;605268.99;788621.91;3304
+3306;2001137310;B06000;LESAO CORPORAL;AV DOS ANDRADAS;1120;3761;12/3/2001 17:04:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;612076.67;796872.70;3305
+3307;2001137316;B06000;LESAO CORPORAL;RUA I;155;41454;12/3/2001 17:06:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602858.57;802861.67;3306
+3308;2001137333;B03000;AMEACA;RUA MARIA GERTRU;325;98993;12/3/2001 17:18:00;CIDADAO COMUM;N;;CEU AZUL;BH;604660.09;808431.77;3307
+3309;2001137337;B06000;LESAO CORPORAL;RUA PROFESSOR AN;62;4358;12/3/2001 17:19:00;CIDADAO COMUM;S;AP201;LOURDES;BH;610900.31;795508.58;3308
+3310;2001137432;B03000;AMEACA;PRACA RAUL SOARE;423;58010;12/3/2001 18:23:00;INICIATIVA;N;0;CENTRO BH;BH;610510.71;796848.26;3309
+3311;2001137546;B06000;LESAO CORPORAL;RUA SILVIANOPOLI;153;66015;12/3/2001 19:33:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;614056.98;797864.30;3310
+3312;2001137569;B03000;AMEACA;RUA DA COLINA;122;102270;12/3/2001 19:47:00;CIDADAO COMUM;S;0;TIROL;BH;601154.85;789668.92;3311
+3313;2001137582;B06000;LESAO CORPORAL;RUA MIRIAM WANDE;73;116041;12/3/2001 19:56:00;CIDADAO COMUM;N;0;DONA CLARA;BH;611425.09;803472.66;3312
+3314;2001137633;B03000;AMEACA;RUA CONDE D'EU;923;16631;12/3/2001 20:35:00;INICIATIVA;S;0;SAUDADE;BH;615588.75;797702.47;3313
+3315;2001137641;B06000;LESAO CORPORAL;RUA I;195;41454;12/3/2001 20:41:00;CIDADAO COMUM;N;CAFU;CH CONFISCO;BH;602841.28;802896.95;3314
+3316;2001137648;B03000;AMEACA;RUA IRACEMA BRAS;18;91405;12/3/2001 20:44:00;INICIATIVA;N;0;PALMEIRAS;BH;607490.84;791887.56;3315
+3317;2001137655;B03000;AMEACA;RUA CALMA;65;11679;12/3/2001 20:51:00;CIDADAO COMUM;S;0;BOA VISTA;BH;616096.68;800314.24;3316
+3318;2001137672;B03000;AMEACA;RUA GUAPORE;17;32125;12/3/2001 21:00:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605507.08;794128.89;3317
+3319;2001137741;B09000;ABANDONO DE INCA;RUA JOSE MAURO D;255;102125;12/3/2001 21:50:00;CIDADAO COMUM;N;CAA;MINEIRAO;BH;601633.89;785370.24;3318
+3320;2001137835;B03000;AMEACA;RUA PORTO SEGURO;544;60595;12/3/2001 22:55:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615015.28;800738.31;3319
+3321;2001137851;B04001;HOMICIDIO TENTAD;RUA REGENCIA;271;301448;12/3/2001 23:03:00;CIDADAO COMUM;S;PX271;VILA CAFEZAL;BH;614107.56;795461.45;3320
+3322;2001137864;B03000;AMEACA;RUA ODILIA GONCA;163;49080;12/3/2001 23:10:00;CIDADAO COMUM;S;;PIRAJA;BH;614130.19;803011.41;3321
+3323;2001138002;B06000;LESAO CORPORAL;RUA ATALIBA LAGO;119;710;13/3/2001 01:09:00;CIDADAO COMUM;N;0;NOVA SUISSA;BH;607254.89;795684.00;3322
+3324;2001138145;B03000;AMEACA;RUA CURI;749;19047;13/3/2001 04:12:00;CIDADAO COMUM;S;CAFRENT;SAO GERALDO;BH;615768.04;799053.75;3323
+3325;2001138173;B06000;LESAO CORPORAL;RUA GONCALVES DI;2700;31513;13/3/2001 05:25:00;CIDADAO COMUM;S;0;SANTO AGOSTINHO;BH;609946.31;796198.75;3324
+3326;2001138221;B06000;LESAO CORPORAL;RUA QUATRO DE MA;140;57118;13/3/2001 07:00:00;CIDADAO COMUM;S;0;LEONINA;BH;608669.25;793470.73;3325
+3327;2001138408;B03000;AMEACA;AV CORONEL DURVA;842;17688;13/3/2001 09:11:00;CIDADAO COMUM;S;;DURVAL DE BARROS;BH;598151.28;790894.64;3326
+3328;2001138499;B03000;AMEACA;RUA JOSEFINA PIR;200;39253;13/3/2001 10:24:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599776.55;789186.36;3327
+3329;2001138511;B03000;AMEACA;RUA FELIPE CAMAR;21;27938;13/3/2001 10:28:00;CIDADAO COMUM;S;;ESPLANADA;BH;614109.28;798485.73;3328
+3330;2001138568;B03000;AMEACA;AV MARIA CONCEIC;322;32052;13/3/2001 10:59:00;CIDADAO COMUM;S;;GOIANIA;BH;615551.34;803923.05;3329
+3331;2001138578;B06000;LESAO CORPORAL;RUA DUZENTOS E Q;76;24321;13/3/2001 11:04:00;CIDADAO COMUM;N;0;CH VALE DO JATOB;BH;600636.59;787113.12;3330
+3332;2001138653;B06000;LESAO CORPORAL;RUA VERISSIMO GU;462;102720;13/3/2001 11:57:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599091.26;790147.08;3331
+3333;2001138702;B03000;AMEACA;AV DOUTOR CRISTI;2213;62459;13/3/2001 12:35:00;CIDADAO COMUM;S;;ITAPOA;BH;609823.89;806007.84;3332
+3334;2001138747;B06000;LESAO CORPORAL;RUA SILVA VIANA;89;65923;13/3/2001 13:01:00;CIDADAO COMUM;S;CSA;SALGADO FILHO;BH;606569.99;794493.65;3333
+3335;2001138752;B06000;LESAO CORPORAL;RUA STA EFIGENIA;50;60539;13/3/2001 13:08:00;CIDADAO COMUM;S;0;SAO MARCOS;BH;614184.47;802711.80;3334
+3336;2001138946;B03000;AMEACA;RUA ITAPEMA;162;35760;13/3/2001 15:29:00;INICIATIVA;S;0;ANCHIETA;BH;612289.18;793841.58;3335
+3337;2001139028;B06000;LESAO CORPORAL;RUA HERCULANO MO;205;37967;13/3/2001 16:17:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605544.73;793496.43;3336
+3338;2001139330;B03000;AMEACA;RUA JACUI;2811;36734;13/3/2001 18:47:00;CIDADAO COMUM;N;;IPIRANGA;BH;611411.53;800497.94;3337
+3339;2001139401;B06000;LESAO CORPORAL;RUA BRANT HORTA;5;104593;13/3/2001 19:29:00;CIDADAO COMUM;S;;MARIA HELENA;BH;605831.72;810788.33;3338
+3340;2001139446;B04001;HOMICIDIO TENTAD;RUA JOSE FELIX M;1700;7416;13/3/2001 19:55:00;INICIATIVA;S;0;MANTIQUEIRA;BH;606728.71;811705.78;3339
+3341;2001139482;B03000;AMEACA;RUA ANGOLA;300;4001;13/3/2001 20:17:00;INICIATIVA;S;0;SAO PAULO;BH;612605.92;802886.01;3340
+3342;2001139492;B09000;ABANDONO DE INCA;RUA PATATIVA;105;52518;13/3/2001 20:19:00;CIDADAO COMUM;S;PRACA IRERE;FLAVIO MARQUES D;BH;604802.99;789000.10;3341
+3343;2001139542;B06000;LESAO CORPORAL;RUA GENERAL ARAN;189;30813;13/3/2001 20:57:00;CIDADAO COMUM;S;0;JARAGUA;BH;609466.26;804067.62;3342
+3344;2001139588;B03000;AMEACA;RUA TRINTA E SET;54;34190;13/3/2001 21:26:00;CIDADAO COMUM;S;0;CONJUNTO FELICID;BH;612530.17;807443.42;3343
+3345;2001139594;B06000;LESAO CORPORAL;RUA CALDAS DA RA;2178;61100;13/3/2001 21:31:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609144.55;801773.57;3344
+3346;2001139684;B03000;AMEACA;RUA BARROCA;5;24611;13/3/2001 22:26:00;CIDADAO COMUM;S;NR125;TAQUARIL;BH;617467.89;797401.78;3345
+3347;2001139719;B03000;AMEACA;RUA IGUACU;508;34118;13/3/2001 22:52:00;CIDADAO COMUM;S;;CONCORDIA;BH;611371.61;799012.35;3346
+3348;2001139723;B03000;AMEACA;RUA SERRA JOSE V;140;52499;13/3/2001 22:56:00;CIDADAO COMUM;S;;SANTA CECILIA;BH;601470.84;787774.23;3347
+3349;2001139782;B03000;AMEACA;AV AMINTAS VIDAL;1729;118769;13/3/2001 23:24:00;CIDADAO COMUM;S;0;NOVA GAMELEIRA;BH;605199.95;794638.45;3348
+3350;2001139791;B04001;HOMICIDIO TENTAD;RUA JOSE JORGE F;321;38884;13/3/2001 23:30:00;CIDADAO COMUM;S;0;NOVA BARROCA;BH;607534.36;793019.31;3349
+3351;2001139814;B03000;AMEACA;RUA DES CINTRA N;656;62966;13/3/2001 23:44:00;CIDADAO COMUM;0;0;MILIONARIOS;BH;604451.86;789966.96;3350
+3352;2001139816;B03000;AMEACA;RUA PROFESSOR MI;1935;128628;13/3/2001 23:47:00;CIDADAO COMUM;S;;NOVA ESPERANCA;BH;608960.31;799824.11;3351
+3353;2001139825;B03000;AMEACA;RUA TREZE DE SET;180;69168;13/3/2001 23:54:00;CIDADAO COMUM;S;CAB;LEONINA;BH;608442.23;793344.13;3352
+3354;2001139829;B03000;AMEACA;AV FLOR DE SEDA;1290;748;13/3/2001 23:57:00;INICIATIVA;S;0;LINDEIA;BH;599939.54;790359.54;3353
+3355;2001139851;B04001;HOMICIDIO TENTAD;RUA DO CRUZEIRO;55;18854;14/3/2001 00:16:00;CIDADAO COMUM;S;;SAO MARCOS;BH;613597.78;802791.01;3354
+3356;2001140018;B03000;AMEACA;AV ANTONIO ABRAH;1000;4320;14/3/2001 03:26:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;3355
+3357;2001140054;B04001;HOMICIDIO TENTAD;RUA 39;176;302835;14/3/2001 04:59:00;INICIATIVA;N;0;NOVO AARAO REIS;BH;613952.77;805354.20;3356
+3358;2001140062;B08000;VIOLACAO DE DOMI;RUA CEARA;179;14406;14/3/2001 05:30:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;612485.49;796745.96;3357
+3359;2001140070;B06000;LESAO CORPORAL;RUA DOS CARIJOS;1022;81243;14/3/2001 05:48:00;INICIATIVA;S;0;CENTRO BH;BH;610474.65;797355.45;3358
+3360;2001140080;B03000;AMEACA;RUA LUCIO FLAVIO;20;50972;14/3/2001 06:11:00;CIDADAO COMUM;S;0;MINASCAIXA;BH;609454.19;809673.48;3359
+3361;2001140086;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;421;6353;14/3/2001 06:15:00;CIDADAO COMUM;S;;FLORESTA;BH;611953.21;797271.49;3360
+3362;2001140106;B06000;LESAO CORPORAL;RUA GENERAL EPHI;115;50059;14/3/2001 07:06:00;CIDADAO COMUM;S;;ITAPOA;BH;609233.80;805997.47;3361
+3363;2001140112;B06000;LESAO CORPORAL;RUA LEOPOLDINA;13;40739;14/3/2001 07:12:00;CIDADAO COMUM;N;0;SANTO ANTONIO;BH;610963.61;794854.30;3362
+3364;2001140131;B02000;RIXA;RUA MANAUS;346;42747;14/3/2001 07:34:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;612940.29;796427.76;3363
+3365;2001140321;B03000;AMEACA;RUA DAVIDSON PIM;214;124189;14/3/2001 09:35:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607258.18;811738.99;3364
+3366;2001140457;B03000;AMEACA;RUA SAO CLARET;190;114755;14/3/2001 11:03:00;CIDADAO COMUM;N;AP302;VILA SILVEIRA;BH;611777.60;800427.71;3365
+3367;2001140661;B02000;RIXA;AV DOM PEDRO II;3400;53145;14/3/2001 13:38:00;INICIATIVA;N;;ADELAIDE;BH;607623.64;797937.10;3366
+3368;2001140669;B06000;LESAO CORPORAL;RUA PROFESSOR MO;725;55585;14/3/2001 13:40:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611848.20;794904.52;3367
+3369;2001140698;B08000;VIOLACAO DE DOMI;RUA ALFREDO NOHM;199;22704;14/3/2001 13:57:00;INICIATIVA;S;0;DAS INDUSTRIAS;BH;604541.99;792319.73;3368
+3370;2001140875;B03000;AMEACA;RUA PONTA PORA;140;54601;14/3/2001 16:03:00;POLICIAL MILITAR;N;;SANTA EFIGENIA;BH;613187.23;796919.20;3369
+3371;2001140906;B03000;AMEACA;RUA STA JUDITE;565;60816;14/3/2001 16:18:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608890.87;800502.72;3370
+3372;2001141013;B06000;LESAO CORPORAL;AV GETULIO VARGA;809;81256;14/3/2001 17:19:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611927.12;795308.34;3371
+3373;2001141071;B03000;AMEACA;RUA ALDO DE SA B;49;98750;14/3/2001 17:51:00;CIDADAO COMUM;N;;DA LAGOA;BH;604924.09;809416.56;3372
+3374;2001141121;B06000;LESAO CORPORAL;AV GETULIO VARGA;613;81256;14/3/2001 18:15:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612093.15;795403.01;3373
+3375;2001141197;B03000;AMEACA;RUA SOFRE;42;85588;14/3/2001 18:58:00;CIDADAO COMUM;S;0;GOIANIA;BH;615466.95;802363.54;3374
+3376;2001141259;B04001;HOMICIDIO TENTAD;RUA CAPELINHA;20;300406;14/3/2001 19:24:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610483.17;793376.89;3375
+3377;2001141269;B06000;LESAO CORPORAL;RUA ARANTINA;165;58697;14/3/2001 19:35:00;CIDADAO COMUM;N;;MINASLANDIA;BH;612211.61;804489.48;3376
+3378;2001141276;B03000;AMEACA;RUA W QUATRO;514;122634;14/3/2001 19:38:00;CIDADAO COMUM;N;;PONGELUPE;BH;603929.62;787324.64;3377
+3379;2001141312;B03000;AMEACA;RUA RIO POMBA;1246;54567;14/3/2001 19:54:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;607109.63;797801.63;3378
+3380;2001141380;B06000;LESAO CORPORAL;AV CORONEL JOSE ;181;84604;14/3/2001 20:33:00;CIDADAO COMUM;S;;SAO JOSE;BH;608832.60;803978.64;3379
+3381;2001141402;B06000;LESAO CORPORAL;RUA MARIANA BARC;145;62994;14/3/2001 20:47:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608869.02;800147.51;3380
+3382;2001141441;B03000;AMEACA;RUA CEARA;279;14406;14/3/2001 21:09:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612470.16;796689.96;3381
+3383;2001141449;B03000;AMEACA;RUA JOSE DE OLIV;25;63161;14/3/2001 21:13:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604052.63;790469.09;3382
+3384;2001141461;B03000;AMEACA;RUA OITENTA E TR;50;124280;14/3/2001 21:20:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607669.40;811934.97;3383
+3385;2001141469;B03000;AMEACA;RUA MARTINS AFON;388;71457;14/3/2001 21:23:00;CIDADAO COMUM;N;0;PATROCINIO;BH;603630.03;799348.03;3384
+3386;2001141515;B06000;LESAO CORPORAL;RUA JULIO KLEIM ;344;7302;14/3/2001 21:53:00;INICIATIVA;N;0;BETANIA;BH;605961.02;792449.57;3385
+3387;2001141665;B06000;LESAO CORPORAL;RUA CORONEL JOAQ;372;87063;14/3/2001 23:26:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604738.67;807922.80;3386
+3388;2001141677;B09000;ABANDONO DE INCA;RUA CONEGO PINHE;708;16820;14/3/2001 23:33:00;CIDADAO COMUM;S;;PARAISO;BH;614349.66;796709.82;3387
+3389;2001141900;B06000;LESAO CORPORAL;RUA HENRIQUE DIA;93;33042;15/3/2001 03:13:00;CIDADAO COMUM;N;0;APARECIDA;BH;609281.26;800060.96;3388
+3390;2001141953;B03000;AMEACA;RUA JOANESIA;9;37406;15/3/2001 04:25:00;CIDADAO COMUM;N;AP03;SERRA;BH;612963.67;795138.79;3389
+3391;2001142178;B03000;AMEACA;RUA NOGUEIRA DE ;28;47800;15/3/2001 08:54:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604732.74;795679.00;3390
+3392;2001142412;B06000;LESAO CORPORAL;RUA SESSENTA E O;31;106066;15/3/2001 11:32:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607962.18;811691.00;3391
+3393;2001142522;B06000;LESAO CORPORAL;RUA NELSON JOSE ;59;98877;15/3/2001 12:52:00;CIDADAO COMUM;S;;DA LAGOA;BH;604821.51;809427.80;3392
+3394;2001142577;B03000;AMEACA;RUA SILVA ORTIZ;300;7520;15/3/2001 13:26:00;CIDADAO COMUM;N;;JOAO PINHEIRO;BH;604675.35;796257.53;3393
+3395;2001142606;B03000;AMEACA;RUA MALVA;156;115760;15/3/2001 13:49:00;CIDADAO COMUM;S;;HAVAI;BH;607321.62;793409.57;3394
+3396;2001142647;B03000;AMEACA;RUA LUTHER KING;20;41946;15/3/2001 14:12:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612652.26;799995.01;3395
+3397;2001142773;B06000;LESAO CORPORAL;RUA CARLOS EDUAR;436;92073;15/3/2001 15:31:00;CIDADAO COMUM;S;0;FILADELFIA;BH;602312.89;797192.51;3396
+3398;2001142875;B02000;RIXA;RUA CONCEICAO DA;180;14258;15/3/2001 16:17:00;INICIATIVA;S;0;SANTA TEREZINHA;BH;604616.08;802515.97;3397
+3399;2001142985;B03000;AMEACA;RUA SANTOS;2200;61910;15/3/2001 17:24:00;INICIATIVA;S;0;SAO DOMINGOS;BH;607908.90;793256.53;3398
+3400;2001143090;B03000;AMEACA;RUA ASCENCAO;26;6278;15/3/2001 18:09:00;CIDADAO COMUM;S;;SAO JOSE;BH;605379.29;798810.81;3399
+3401;2001143142;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;351;16988;15/3/2001 18:33:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606657.62;794080.67;3400
+3402;2001143187;B03000;AMEACA;AV SANTOS DUMONT;381;61950;15/3/2001 18:55:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611250.50;797490.44;3401
+3403;2001143202;B04001;HOMICIDIO TENTAD;RUA JOSE CHRISTI;105;106949;15/3/2001 19:02:00;INICIATIVA;N;0;NOVA CINTRA;BH;605792.55;793322.96;3402
+3404;2001143346;B03000;AMEACA;RUA CONDE D'EU;926;16631;15/3/2001 20:27:00;INICIATIVA;S;0;SAUDADE;BH;615552.91;797716.18;3403
+3405;2001143397;B03000;AMEACA;RUA CONDE D'EU;923;16631;15/3/2001 20:56:00;CIDADAO COMUM;S;FU;SAUDADE;BH;615588.75;797702.47;3404
+3406;2001143398;B03000;AMEACA;RUA UM;114;96005;15/3/2001 20:56:00;CIDADAO COMUM;S;0;MARIA GORETTI;BH;614583.51;803368.88;3405
+3407;2001143408;B03000;AMEACA;RUA CINCO;407;81647;15/3/2001 21:02:00;CIDADAO COMUM;N;;OLHOS DAGUA;BH;608262.81;788625.24;3406
+3408;2001143418;B05000;SEQUESTRO E CARC;RUA ABAETE;55;546;15/3/2001 21:04:00;CIDADAO COMUM;N;0;BONFIM;BH;610111.42;797998.63;3407
+3409;2001143426;B03000;AMEACA;RUA FATIMA SIMOE;44;117205;15/3/2001 21:15:00;CIDADAO COMUM;S;0;CAPITAO EDUARDO;BH;618332.22;806602.98;3408
+3410;2001143452;B03000;AMEACA;RUA JOSE SABINO ;125;98911;15/3/2001 21:28:00;CIDADAO COMUM;N;;DA LAGOA;BH;604731.93;809431.45;3409
+3411;2001143454;B03000;AMEACA;RUA PROFESSORA R;305;51887;15/3/2001 21:30:00;CIDADAO COMUM;S;;REGINA;BH;598852.69;790207.85;3410
+3412;2001143478;B04002;HOMICIDIO CONSUM;RUA DA BOLIVIA;136;9884;15/3/2001 21:47:00;CIDADAO COMUM;N;AP202;SAO PEDRO;BH;611293.61;793900.87;3411
+3413;2001143483;B06000;LESAO CORPORAL;RUA JACINTO FERR;209;36674;15/3/2001 21:49:00;CIDADAO COMUM;S;;NOVA BARROCA;BH;607663.08;792741.35;3412
+3414;2001143485;B06000;LESAO CORPORAL;RUA MANOEL CAYLL;121;43043;15/3/2001 21:52:00;CIDADAO COMUM;S;;HORTO;BH;613259.68;798134.49;3413
+3415;2001143512;B06000;LESAO CORPORAL;RUA VIRTULINO PI;155;130438;15/3/2001 22:06:00;CIDADAO COMUM;N;0;OLARIA;BH;602074.19;789195.72;3414
+3416;2001143628;B06000;LESAO CORPORAL;RUA MENDES DE OL;1084;45430;15/3/2001 23:17:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609718.74;799470.77;3415
+3417;2001143672;B06000;LESAO CORPORAL;RUA DOS AGRONOMO;270;103459;15/3/2001 23:48:00;CIDADAO COMUM;N;;CONJUNTO ALIPIO ;BH;604645.46;800074.41;3416
+3418;2001143686;B06000;LESAO CORPORAL;RUA JOSE DE LIMA;37;38897;15/3/2001 23:58:00;INICIATIVA;S;0;FLORAMAR;BH;611871.50;805757.42;3417
+3419;2001143707;B03000;AMEACA;RUA CONDE D'EU;923;16631;16/3/2001 00:07:00;CIDADAO COMUM;S;0;SAUDADE;BH;615588.75;797702.47;3418
+3420;2001143721;B03000;AMEACA;RUA CAMPOS SALES;472;12300;16/3/2001 00:17:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;607050.85;796279.60;3419
+3421;2001143726;B06000;LESAO CORPORAL;RUA CARLOS FREDE;70;20610;16/3/2001 00:21:00;INICIATIVA;S;0;OURO PRETO;BH;606320.33;802238.74;3420
+3422;2001143738;B03000;AMEACA;RUA GUILHERME DE;400;32484;16/3/2001 00:28:00;CIDADAO COMUM;S;AP202;SANTO ANTONIO;BH;610616.72;793886.05;3421
+3423;2001143787;B03000;AMEACA;RUA SAO PAULO;848;63464;16/3/2001 01:17:00;INICIATIVA;N;APT1302;CENTRO BH;BH;610915.13;796961.87;3422
+3424;2001143833;B06000;LESAO CORPORAL;RUA ALCIDES PERE;866;107711;16/3/2001 01:54:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606811.68;811564.61;3423
+3425;2001143851;B02000;RIXA;RUA MAJOR LOPES;760;42646;16/3/2001 02:16:00;CIDADAO COMUM;N;0;SAO PEDRO;BH;611405.26;794100.40;3424
+3426;2001143859;B04002;HOMICIDIO CONSUM;RUA DOUTOR ARGEM;160;23155;16/3/2001 02:25:00;CIDADAO COMUM;N;;SAO LUCAS;BH;614033.70;795650.47;3425
+3427;2001143974;B04001;HOMICIDIO TENTAD;RUA INDIANA;1270;34410;16/3/2001 04:58:00;INICIATIVA;S;0;JARDIM AMERICA;BH;607710.69;794088.68;3426
+3428;2001144154;B03000;AMEACA;RUA LUIZA SAN MA;861;41858;16/3/2001 08:34:00;CIDADAO COMUM;S;;PARAISO;BH;614280.39;796336.59;3427
+3429;2001144327;B03000;AMEACA;RUA A;709;41110;16/3/2001 10:17:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602648.51;802862.42;3428
+3430;2001144365;B06000;LESAO CORPORAL;RUA JOAO ZACARIA;100;15500;16/3/2001 10:40:00;CIDADAO COMUM;N;;COPACABANA;BH;605379.27;806582.71;3429
+3431;2001144404;B03000;AMEACA;RUA PROFESSORA M;1090;70987;16/3/2001 11:06:00;CIDADAO COMUM;S;0;VILA OESTE;BH;604347.01;795429.68;3430
+3432;2001144467;B06000;LESAO CORPORAL;RUA PRINCIPAL;38;102699;16/3/2001 11:40:00;CIDADAO COMUM;S;;TIROL;BH;600913.57;789222.97;3431
+3433;2001144509;B03000;AMEACA;RUA CINCO;10;27128;16/3/2001 12:04:00;INICIATIVA;S;0;PAULO SEXTO;BH;616475.28;806960.67;3432
+3434;2001144526;B04002;HOMICIDIO CONSUM;RUA DOS BANDOLIN;540;106980;16/3/2001 12:17:00;CIDADAO COMUM;S;0;CH CALIFORNIA;BH;603983.54;797176.08;3433
+3435;2001144569;B06000;LESAO CORPORAL;RUA DOS TUPIS;820;69965;16/3/2001 12:48:00;INICIATIVA;S;0;CENTRO (BH);BH;610499.24;797065.06;3434
+3436;2001144598;B03000;AMEACA;AV DOM PEDRO II;5092;53145;16/3/2001 13:03:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606214.33;798752.85;3435
+3437;2001144639;B02000;RIXA;RUA HELIO GILBER;15;55991;16/3/2001 13:36:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611891.86;806760.29;3436
+3438;2001144721;B03000;AMEACA;RUA GONCALVES DI;146;31513;16/3/2001 14:32:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;612406.58;795539.25;3437
+3439;2001144748;B03000;AMEACA;RUA CEARA;640;14406;16/3/2001 14:49:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;612330.77;796303.86;3438
+3440;2001145048;B06000;LESAO CORPORAL;RUA JOSE MARIANO;11;50480;16/3/2001 17:42:00;CIDADAO COMUM;S;CAA;TUPI;BH;612132.07;806501.28;3439
+3441;2001145123;B03000;AMEACA;RUA PADRE EUSTAQ;2408;51294;16/3/2001 18:22:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607296.09;797652.98;3440
+3442;2001145159;B03000;AMEACA;RUA MARIA COLARE;37;93832;16/3/2001 18:38:00;CIDADAO COMUM;S;0;DIAMANTE;BH;601312.46;789810.08;3441
+3443;2001145277;B04001;HOMICIDIO TENTAD;RUA FERNAO DIAS;1084;28133;16/3/2001 19:37:00;INICIATIVA;S;0;VERA CRUZ;BH;616058.53;798249.96;3442
+3444;2001145292;B06000;LESAO CORPORAL;AV OLEGARIO MACI;228;49699;16/3/2001 19:45:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610607.36;797465.13;3443
+3445;2001145345;B03000;AMEACA;RUA GENERAL OZOR;958;30901;16/3/2001 20:19:00;CIDADAO COMUM;S;CSA;VERA CRUZ;BH;616275.74;798043.34;3444
+3446;2001145353;B03000;AMEACA;RUA SAMBEATIBA;292;60163;16/3/2001 20:20:00;CIDADAO COMUM;N;CSA;CACHOEIRINHA;BH;610595.78;801153.89;3445
+3447;2001145392;B04001;HOMICIDIO TENTAD;RUA CAPIVARI;547;12918;16/3/2001 20:43:00;INICIATIVA;S;0;SERRA;BH;613619.59;794775.30;3446
+3448;2001145393;B03000;AMEACA;RUA TIZIU;562;95881;16/3/2001 20:41:00;CIDADAO COMUM;S;0;GOIANIA;BH;615351.18;802590.79;3447
+3449;2001145406;B06000;LESAO CORPORAL;RUA JOSE DO CARM;135;69559;16/3/2001 20:47:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609514.03;809256.67;3448
+3450;2001145411;B06000;LESAO CORPORAL;RUA ALFEU DE CAR;235;2223;16/3/2001 20:53:00;CIDADAO COMUM;S;;TUPI;BH;613587.67;805832.09;3449
+3451;2001145528;B06000;LESAO CORPORAL;RUA ARTUR DE SA;1081;6211;16/3/2001 21:51:00;CIDADAO COMUM;S;;UNIAO;BH;612820.90;801929.81;3450
+3452;2001145532;B06000;LESAO CORPORAL;RUA CARLOS MUZZI;167;89967;16/3/2001 21:52:00;INICIATIVA;S;0;PALMEIRAS;BH;606570.26;791453.47;3451
+3453;2001145575;B03000;AMEACA;RUA MAURILIO GOM;653;43941;16/3/2001 22:18:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604472.94;789934.70;3452
+3454;2001145625;B06000;LESAO CORPORAL;AV ITAU;1307;36025;16/3/2001 22:53:00;CIDADAO COMUM;N;0;JOAO PINHEIRO;BH;604313.94;796735.81;3453
+3455;2001145635;B03000;AMEACA;RUA ALMADA;97;2393;16/3/2001 22:56:00;CIDADAO COMUM;S;;PINDORAMA;BH;602560.67;797874.36;3454
+3456;2001145654;B03000;AMEACA;RUA TAMBORIL;536;66793;16/3/2001 23:08:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611236.65;799260.64;3455
+3457;2001145661;B03000;AMEACA;RUA SERRINHA;100;129201;16/3/2001 23:13:00;INICIATIVA;S;0;MANGUEIRAS;BH;600477.81;786778.57;3456
+3458;2001145706;B03000;AMEACA;RUA ENGENHO VERM;113;94835;16/3/2001 23:38:00;CIDADAO COMUM;N;;ENGENHO NOGUEIRA;BH;606509.65;800521.34;3457
+3459;2001145734;B03000;AMEACA;RUA CANDIDO LUCI;639;12568;16/3/2001 23:49:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609554.18;800062.48;3458
+3460;2001145800;B03000;AMEACA;RUA BENJAMIM JAC;98;9207;17/3/2001 00:31:00;CIDADAO COMUM;S;0;GUTIERREZ;BH;608757.98;794815.62;3459
+3461;2001145809;B03000;AMEACA;RUA NEFELINA;99;81228;17/3/2001 00:36:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612838.15;797304.69;3460
+3462;2001145819;B03000;AMEACA;AV CLARA NUNES;736;45644;17/3/2001 00:39:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;611029.42;800977.57;3461
+3463;2001145919;B04001;HOMICIDIO TENTAD;RUA PADRE CYR AS;10;12091;17/3/2001 01:34:00;CIDADAO COMUM;S;CS1;PRIMEIRO DE MAIO;BH;612115.88;803483.73;3462
+3464;2001145937;B03000;AMEACA;RUA EDSON LUIZ M;112;25062;17/3/2001 01:47:00;CIDADAO COMUM;N;CAB;MARIA GORETTI;BH;614197.63;803631.48;3463
+3465;2001145961;B06000;LESAO CORPORAL;RUA ALEM PARAIBA;504;81357;17/3/2001 02:04:00;CIDADAO COMUM;S;0;BONFIM;BH;610323.38;798258.43;3464
+3466;2001145973;B06000;LESAO CORPORAL;RUA MATA DA CORD;80;45111;17/3/2001 02:15:00;INICIATIVA;N;0;MANGABEIRAS;BH;613257.08;793831.98;3465
+3467;2001145992;B06000;LESAO CORPORAL;AV LEONTINO FRAN;130;445;17/3/2001 02:30:00;CIDADAO COMUM;N;0;SERRA VERDE;BH;609625.47;810530.91;3466
+3468;2001146010;B09000;ABANDONO DE INCA;RUA XAPURI;945;73815;17/3/2001 02:46:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607567.46;794124.12;3467
+3469;2001146013;B08000;VIOLACAO DE DOMI;RUA MARIA ANALIA;32;300366;17/3/2001 02:49:00;CIDADAO COMUM;N;0;POMPEIA;BH;606878.92;808915.74;3468
+3470;2001146058;B02000;RIXA;AV JOSE LOPES MU;280;19176;17/3/2001 03:17:00;CIDADAO COMUM;S;BAR DO NADINHO;FLORAMAR;BH;611600.65;806347.17;3469
+3471;2001146078;B09000;ABANDONO DE INCA;RUA PADRE JULIO ;689;51496;17/3/2001 03:30:00;INICIATIVA;S;0;VERA CRUZ;BH;615671.77;797489.47;3470
+3472;2001146094;B03000;AMEACA;RUA ALAGOAS;1498;1678;17/3/2001 03:42:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611220.75;794842.31;3471
+3473;2001146100;B04001;HOMICIDIO TENTAD;RUA MANOEL TAVAR;303;1536;17/3/2001 03:48:00;CIDADAO COMUM;N;;GOIANIA;BH;614997.46;802812.46;3472
+3474;2001146163;B06000;LESAO CORPORAL;RUA DOS CARIJOS;91;81243;17/3/2001 04:51:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611378.20;797082.80;3473
+3475;2001146168;B06000;LESAO CORPORAL;RUA TREMEDAL;10;68240;17/3/2001 04:54:00;INICIATIVA;S;0;CARLOS PRATES;BH;609440.09;797845.02;3474
+3476;2001146172;B03000;AMEACA;RUA ITALO DINELI;99;93063;17/3/2001 04:58:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;601209.85;786107.68;3475
+3477;2001146366;B06000;LESAO CORPORAL;RUA DOS GUARANIS;319;32181;17/3/2001 08:58:00;INICIATIVA;N;0;CENTRO BH;BH;610709.97;797311.90;3476
+3478;2001146390;B06000;LESAO CORPORAL;RUA VINTE;44;102342;17/3/2001 09:13:00;CIDADAO COMUM;N;;CEU AZUL;BH;604034.56;807504.41;3477
+3479;2001146418;B06000;LESAO CORPORAL;PRACA CARDEAL AR;16;13182;17/3/2001 09:24:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605707.20;793813.75;3478
+3480;2001146428;B03000;AMEACA;RUA BARREIRO;771;84342;17/3/2001 09:33:00;CIDADAO COMUM;S;;SAO GERALDO;BH;616339.91;799085.95;3479
+3481;2001146534;B06000;LESAO CORPORAL;RUA SEN FIRMINO;118;80616;17/3/2001 10:59:00;CIDADAO COMUM;S;CA1;OURO PRETO;BH;606298.47;801983.26;3480
+3482;2001146568;B04001;HOMICIDIO TENTAD;AV ARTUR BERNARD;2772;60844;17/3/2001 11:21:00;CIDADAO COMUM;S;;VILA PARIS;BH;610407.76;793270.00;3481
+3483;2001146634;B06000;LESAO CORPORAL;RUA DO CERCADINH;415;14881;17/3/2001 12:02:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606735.94;794868.66;3482
+3484;2001146649;B06000;LESAO CORPORAL;RUA GERALDO LOPE;88;46940;17/3/2001 12:11:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606827.06;812118.20;3483
+3485;2001146661;B06000;LESAO CORPORAL;RUA DOS INCAS;75;34335;17/3/2001 12:19:00;CIDADAO COMUM;N;;SANTA MONICA;BH;606866.81;806924.00;3484
+3486;2001146766;B03000;AMEACA;RUA MONTE CASSIN;235;46432;17/3/2001 13:40:00;CIDADAO COMUM;S;;SANTA BRANCA;BH;607986.57;806091.99;3485
+3487;2001146775;B06000;LESAO CORPORAL;RUA TEBAS;818;67090;17/3/2001 13:47:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616044.45;798315.21;3486
+3488;2001146785;B03000;AMEACA;RUA CAMOES;197;11971;17/3/2001 13:56:00;POLICIAL MILITAR;S;0;SAO LUCAS;BH;613046.92;795889.39;3487
+3489;2001146845;B08000;VIOLACAO DE DOMI;RUA ALEM PARAIBA;127;81357;17/3/2001 14:36:00;CIDADAO COMUM;N;0;BONFIM;BH;610651.10;798047.31;3488
+3490;2001146854;B03000;AMEACA;RUA FLAVIO MARQU;212;28436;17/3/2001 14:43:00;CIDADAO COMUM;N;CAFU;BARREIRO;BH;603060.95;791135.44;3489
+3491;2001146865;B03000;AMEACA;RUA JOAQUINA ANG;100;84761;17/3/2001 14:56:00;CIDADAO COMUM;S;;DA LAGOA;BH;604531.65;809462.44;3490
+3492;2001146909;B06000;LESAO CORPORAL;RUA NELSON;633;47407;17/3/2001 15:16:00;CIDADAO COMUM;S;;UNIAO;BH;613054.57;801287.70;3491
+3493;2001146913;B03000;AMEACA;RUA ARACY DE ALM;11;85648;17/3/2001 15:20:00;INICIATIVA;N;0;GOIANIA;BH;614691.72;803615.96;3492
+3494;2001146921;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;1892;17026;17/3/2001 15:27:00;CIDADAO COMUM;N;;JARDIM AMERICA;BH;607532.92;793643.55;3493
+3495;2001146935;B03000;AMEACA;RUA LIVRAMENTO;275;41325;17/3/2001 15:32:00;CIDADAO COMUM;S;APT 103;VILA OESTE;BH;604678.91;795400.30;3494
+3496;2001147012;B03000;AMEACA;RUA CARANCHO;22;13079;17/3/2001 16:20:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604506.63;788542.81;3495
+3497;2001147051;B03000;AMEACA;AV PROFESSOR ALF;400;2264;17/3/2001 16:36:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;611944.42;796416.90;3496
+3498;2001147124;B06000;LESAO CORPORAL;RUA JOSE LAVARIN;237;40537;17/3/2001 17:21:00;CIDADAO COMUM;S;;PARAISO;BH;614295.70;796691.51;3497
+3499;2001147147;B06000;LESAO CORPORAL;RUA PAVAO;60;171510;17/3/2001 17:34:00;CIDADAO COMUM;S;0;VILA CEMIG;BH;605536.69;788858.86;3498
+3500;2001147176;B03000;AMEACA;RUA CINCO DE JUL;114;15670;17/3/2001 17:50:00;CIDADAO COMUM;N;0;PRIMEIRO DE MAIO;BH;612338.42;803849.66;3499
+3501;2001147190;B03000;AMEACA;RUA OITENTA E TR;7;124280;17/3/2001 18:02:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607733.73;811916.10;3500
+3502;2001147202;B06000;LESAO CORPORAL;RUA MARIA AMELIA;151;43812;17/3/2001 18:10:00;INICIATIVA;N;0;SAO TOMAZ;BH;610196.88;805486.32;3501
+3503;2001147220;B03000;AMEACA;RUA CRUZ DE MALT;19;18813;17/3/2001 18:17:00;CIDADAO COMUM;S;CA;NAZARE;BH;615899.65;804621.81;3502
+3504;2001147259;B03000;AMEACA;RUA MARIO SOARES;464;44641;17/3/2001 18:35:00;CIDADAO COMUM;N;FU;DOM BOSCO;BH;604167.26;797273.60;3503
+3505;2001147303;B04001;HOMICIDIO TENTAD;RUA TEBAS;670;67090;17/3/2001 19:00:00;INICIATIVA;N;0;VERA CRUZ;BH;615977.89;798300.24;3504
+3506;2001147318;B06000;LESAO CORPORAL;AV PRESIDENTE AN;845;4461;17/3/2001 19:06:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610492.26;798773.24;3505
+3507;2001147322;B06000;LESAO CORPORAL;AV ANTONIO ABRAH;1000;4320;17/3/2001 19:08:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;3506
+3508;2001147330;B06000;LESAO CORPORAL;RUA MARIO MARTIN;232;44600;17/3/2001 19:13:00;CIDADAO COMUM;S;0;POMPEIA;BH;614937.63;797990.94;3507
+3509;2001147345;B03000;AMEACA;RUA ITAPOA;274;35873;17/3/2001 19:17:00;CIDADAO COMUM;S;;GLORIA;BH;602804.26;798134.63;3508
+3510;2001147381;B03000;AMEACA;RUA PARA DE MINA;821;52070;17/3/2001 19:31:00;INICIATIVA;S;0;PADRE EUSTAQUIO;BH;605833.93;797706.32;3509
+3511;2001147383;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;1001;26052;17/3/2001 19:31:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611161.78;796678.49;3510
+3512;2001147390;B03000;AMEACA;RUA RADIALISTA D;196;99334;17/3/2001 19:31:00;CIDADAO COMUM;N;;CEU AZUL;BH;605026.18;807770.66;3511
+3513;2001147410;B04001;HOMICIDIO TENTAD;RUA JACAREI;1190;13154;17/3/2001 19:44:00;CIDADAO COMUM;N;0;PINDORAMA;BH;602313.10;797841.05;3512
+3514;2001147411;B06000;LESAO CORPORAL;RUA GALDINO;4;75590;17/3/2001 19:46:00;CIDADAO COMUM;N;;LINDEIA;BH;599722.92;790847.61;3513
+3515;2001147421;B04002;HOMICIDIO CONSUM;RUA CINQUENTA E ;114;106201;17/3/2001 19:50:00;CIDADAO COMUM;N;0;NOVA YORK;BH;608696.88;810953.35;3514
+3516;2001147431;B03000;AMEACA;RUA MAJOR LOPES;511;42646;17/3/2001 19:56:00;CIDADAO COMUM;N;;SAO PEDRO;BH;611467.06;794345.31;3515
+3517;2001147502;B04001;HOMICIDIO TENTAD;RUA JOANA DARC;326;170141;17/3/2001 20:22:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614576.09;794880.91;3516
+3518;2001147504;B06000;LESAO CORPORAL;RUA JOSE LEAL DO;119;110593;17/3/2001 20:24:00;CIDADAO COMUM;N;;JARDIM GUANABARA;BH;611553.51;807888.66;3517
+3519;2001147523;B06000;LESAO CORPORAL;RUA DOS ALAMOS;234;90080;17/3/2001 20:30:00;CIDADAO COMUM;S;;MARAJO;BH;606897.14;792529.00;3518
+3520;2001147617;B02000;RIXA;RUA MONTE ALEGRE;285;46357;17/3/2001 21:14:00;CIDADAO COMUM;S;;SERRA;BH;612735.09;795362.92;3519
+3521;2001147651;B03000;AMEACA;RUA CORACAO EUCA;284;17344;17/3/2001 21:29:00;CIDADAO COMUM;S;AP301;CORACAO EUCARIST;BH;605751.72;796518.06;3520
+3522;2001147658;B04001;HOMICIDIO TENTAD;RUA LONDRES;286;41366;17/3/2001 21:34:00;CIDADAO COMUM;N;;COPACABANA;BH;606209.73;806102.86;3521
+3523;2001147672;B06000;LESAO CORPORAL;RUA TABOAO DA SE;36;53347;17/3/2001 21:41:00;INICIATIVA;S;0;ITAIPU BH;BH;599335.27;788659.59;3522
+3524;2001147676;B06000;LESAO CORPORAL;RUA CRACOVIA;620;85317;17/3/2001 21:43:00;CIDADAO COMUM;S;CA620C;JARDIM EUROPA;BH;608692.32;810242.32;3523
+3525;2001147725;B06000;LESAO CORPORAL;RUA CAMIG;54;83453;17/3/2001 22:07:00;CIDADAO COMUM;S;;BETANIA;BH;604759.31;792879.57;3524
+3526;2001147744;B03000;AMEACA;RODOVIA MGT 262;248;26598;17/3/2001 22:18:00;CIDADAO COMUM;S;0;VILA BRASILIA;BH;614638.21;803650.72;3525
+3527;2001147745;B06000;LESAO CORPORAL;RUA IMPERATRIZ;30;122357;17/3/2001 22:18:00;CIDADAO COMUM;N;;SAO TOMAZ;BH;609306.94;805400.92;3526
+3528;2001147758;B06000;LESAO CORPORAL;RUA CHAFARIZ;100;300275;17/3/2001 22:23:00;CIDADAO COMUM;S;;HAVAI;BH;607371.53;793762.11;3527
+3529;2001147909;B04002;HOMICIDIO CONSUM;RUA SERRINHA;74;129201;17/3/2001 23:57:00;CIDADAO COMUM;N;0;MANGUEIRAS;BH;600452.04;787052.18;3528
+3530;2001147918;B04001;HOMICIDIO TENTAD;RUA BRAS;90;170835;18/3/2001 00:03:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608062.97;793879.17;3529
+3531;2001147927;B03000;AMEACA;RUA EMANUEL;77;87010;18/3/2001 00:07:00;CIDADAO COMUM;S;;PILAR;BH;607761.58;788553.01;3530
+3532;2001147937;B06000;LESAO CORPORAL;RUA COARI;241;16092;18/3/2001 00:15:00;INICIATIVA;S;0;SAO GERALDO;BH;615219.20;799212.31;3531
+3533;2001148061;B06000;LESAO CORPORAL;RUA LAVRAS;107;40540;18/3/2001 01:35:00;CIDADAO COMUM;S;0;SAO PEDRO;BH;611511.59;794723.74;3532
+3534;2001148065;B04002;HOMICIDIO CONSUM;RUA DA PEDREIRA;350;301298;18/3/2001 01:36:00;INICIATIVA;S;L;MORRO DAS PEDRAS;BH;608618.39;794087.94;3533
+3535;2001148069;B06000;LESAO CORPORAL;RUA LUIZ LOPES;333;94431;18/3/2001 01:40:00;CIDADAO COMUM;S;;OURO PRETO;BH;606306.33;801223.55;3534
+3536;2001148077;B06000;LESAO CORPORAL;RUA HERACLITO;210;125598;18/3/2001 01:46:00;CIDADAO COMUM;N;;BELMONT;BH;615384.05;804976.88;3535
+3537;2001148121;B06000;LESAO CORPORAL;RUA OLIMPIO DA S;59;28045;18/3/2001 02:10:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612549.53;803816.58;3536
+3538;2001148173;B06000;LESAO CORPORAL;AV FURQUIM WERNE;100;650;18/3/2001 02:43:00;INICIATIVA;N;0;TUPI;BH;613046.58;805827.69;3537
+3539;2001148195;B03000;AMEACA;RUA LUIZA EFIGEN;275;119560;18/3/2001 03:02:00;CIDADAO COMUM;N;APTO309;VILA MAGNESITA;BH;602642.26;795177.79;3538
+3540;2001148220;B03000;AMEACA;AV CRISTIANO MAC;2020;18652;18/3/2001 03:24:00;CIDADAO COMUM;S;AP203;CIDADE NOVA;BH;612192.14;800401.14;3539
+3541;2001148232;B04001;HOMICIDIO TENTAD;RUA SOARES NOGUE;550;66220;18/3/2001 03:31:00;CIDADAO COMUM;N;0;VILA MAGNESITA;BH;602599.93;794792.84;3540
+3542;2001148242;B04001;HOMICIDIO TENTAD;RUA ALICE;182;170949;18/3/2001 03:39:00;CIDADAO COMUM;N;PX109;MORRO DAS PEDRAS;BH;608002.45;793792.58;3541
+3543;2001148332;B04001;HOMICIDIO TENTAD;AV CENTRAL;22;14812;18/3/2001 05:01:00;INICIATIVA;N;0;JARDIM LEBLON;BH;606118.45;806004.26;3542
+3544;2001148366;B04002;HOMICIDIO CONSUM;RUA FARADAY;50;27764;18/3/2001 05:49:00;CIDADAO COMUM;N;FU;PRIMEIRO DE MAIO;BH;612221.44;803449.31;3543
+3545;2001148395;B03000;AMEACA;AV PADRE JOSE MA;292;53448;18/3/2001 06:59:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605582.54;793667.41;3544
+3546;2001148431;B06000;LESAO CORPORAL;RUA OLARIA;30;49560;18/3/2001 07:57:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610900.05;805173.88;3545
+3547;2001148433;B06000;LESAO CORPORAL;RUA FLOR D'AGUA;600;28565;18/3/2001 07:55:00;CIDADAO COMUM;S;ESTA NO H. ALBER;JARDIM MONTANHES;BH;605734.71;800020.84;3546
+3548;2001148499;B08000;VIOLACAO DE DOMI;RUA SAO LUIZ;16;63288;18/3/2001 08:47:00;CIDADAO COMUM;N;CA16;SAO TOMAZ;BH;609860.89;805286.87;3547
+3549;2001148531;B03000;AMEACA;RUA FREDERICO AU;15;29785;18/3/2001 09:21:00;CIDADAO COMUM;N;;UNIVERSITARIO;BH;610671.05;802759.35;3548
+3550;2001148532;B03000;AMEACA;RUA SANTA FRANCI;630;60655;18/3/2001 09:14:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608507.50;800521.15;3549
+3551;2001148612;B03000;AMEACA;RUA HORTENCIA;767;33433;18/3/2001 10:15:00;CIDADAO COMUM;N;;ESPLANADA;BH;614778.34;798272.90;3550
+3552;2001148657;B02000;RIXA;AV ALVARES CABRA;211;2730;18/3/2001 10:51:00;INICIATIVA;N;0;LOURDES;BH;611296.92;796433.12;3551
+3553;2001148692;B03000;AMEACA;RUA LAGOA DOURAD;471;40174;18/3/2001 11:22:00;CIDADAO COMUM;S;;PRADO;BH;608581.17;796507.97;3552
+3554;2001148699;B06000;LESAO CORPORAL;RUA GRAUNAS;429;31797;18/3/2001 11:27:00;CIDADAO COMUM;N;;VILA CEMIG;BH;605560.06;788702.39;3553
+3555;2001148799;B06000;LESAO CORPORAL;RUA SERRA DOS AI;91;65025;18/3/2001 13:02:00;CIDADAO COMUM;N;FU;JARDIM LEBLON;BH;605955.53;807662.83;3554
+3556;2001148843;B04001;HOMICIDIO TENTAD;RUA SERRINHA;168;129201;18/3/2001 13:41:00;CIDADAO COMUM;S;;MANGUEIRAS;BH;600395.13;787259.05;3555
+3557;2001148861;B06000;LESAO CORPORAL;RUA DONA SINVALI;224;59863;18/3/2001 13:59:00;CIDADAO COMUM;N;0;ANTONIO RIBEIRO ;BH;615423.36;806998.20;3556
+3558;2001148866;B06000;LESAO CORPORAL;RUA AMARANTO VER;119;110120;18/3/2001 14:01:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615899.69;806141.36;3557
+3559;2001148880;B06000;LESAO CORPORAL;RUA JOSE ANTENOR;165;16049;18/3/2001 14:09:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612330.81;803766.42;3558
+3560;2001148885;B03000;AMEACA;RUA DR BROCHADO;1076;23215;18/3/2001 14:13:00;CIDADAO COMUM;S;;VERA CRUZ;BH;615982.91;797659.64;3559
+3561;2001148905;B03000;AMEACA;RUA BADARO JUNIO;38;7532;18/3/2001 14:26:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612064.33;803545.79;3560
+3562;2001148907;B06000;LESAO CORPORAL;RUA ARTUR ITABIR;655;6177;18/3/2001 14:28:00;CIDADAO COMUM;N;0;SAO JOSE;BH;607806.80;803463.71;3561
+3563;2001148959;B06000;LESAO CORPORAL;RUA EDMAR COLINI;857;104638;18/3/2001 15:09:00;CIDADAO COMUM;N;0;MANTIQUEIRA;BH;605904.97;812041.11;3562
+3564;2001148973;B04001;HOMICIDIO TENTAD;AV ARTUR BERNARD;1334;60844;18/3/2001 15:15:00;INICIATIVA;N;0;VILA PARIS;BH;610228.38;793304.17;3563
+3565;2001148994;B03000;AMEACA;RUA FRANCISCO GO;65;68569;18/3/2001 15:25:00;CIDADAO COMUM;S;FR23;ESTRELA DALVA;BH;607466.26;792294.61;3564
+3566;2001148998;B04002;HOMICIDIO CONSUM;RUA FLOR DE PITA;119;42949;18/3/2001 15:27:00;CIDADAO COMUM;N;0;INDEPENDENCIA;BH;601600.30;786045.97;3565
+3567;2001149029;B03000;AMEACA;AV AUGUSTO DE LI;1105;6731;18/3/2001 15:46:00;CIDADAO COMUM;N;;BARRO PRETO;BH;610249.02;796782.22;3566
+3568;2001149148;B03000;AMEACA;RUA DELFIM;194;19728;18/3/2001 16:56:00;CIDADAO COMUM;S;;SANTA CRUZ (BARR;BH;603557.64;789073.38;3567
+3569;2001149150;B02000;RIXA;RUA CARMELITA IN;281;121137;18/3/2001 16:57:00;CIDADAO COMUM;S;FU;MALDONADO;BH;602056.77;790380.15;3568
+3570;2001149161;B06000;LESAO CORPORAL;RUA JOAO SAMAHA;1282;7397;18/3/2001 17:02:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608383.18;807945.10;3569
+3571;2001149164;B03000;AMEACA;ALAMEDA INDAIA;105;34363;18/3/2001 17:05:00;CIDADAO COMUM;S;;DOM CABRAL;BH;604920.54;796718.55;3570
+3572;2001149183;B03000;AMEACA;RUA FURTADO DE M;144;30158;18/3/2001 17:15:00;INICIATIVA;S;0;SAO TOMAZ;BH;609931.80;805638.24;3571
+3573;2001149223;B06000;LESAO CORPORAL;RUA DELMO RENAUL;6;70596;18/3/2001 17:46:00;CIDADAO COMUM;S;;AARAO REIS;BH;612821.17;804943.88;3572
+3574;2001149224;B06000;LESAO CORPORAL;RUA MACEDO;285;42182;18/3/2001 17:48:00;CIDADAO COMUM;S;0;FLORESTA;BH;612120.19;798390.29;3573
+3575;2001149235;B03000;AMEACA;RUA DOS PINTASSI;43;53813;18/3/2001 17:55:00;CIDADAO COMUM;N;;VILA CLORIS;BH;610040.49;807382.22;3574
+3576;2001149262;B06000;LESAO CORPORAL;AV JOAO XXIII;287;37926;18/3/2001 18:17:00;CIDADAO COMUM;S;0;CONJUNTO ALIPIO ;BH;604398.40;799487.39;3575
+3577;2001149265;B03000;AMEACA;RUA ARAGAO;140;5350;18/3/2001 18:21:00;CIDADAO COMUM;S;0;DOM BOSCO;BH;604648.22;797203.56;3576
+3578;2001149267;B06000;LESAO CORPORAL;RUA VOLTA GRANDE;134;73594;18/3/2001 18:20:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612934.80;798672.43;3577
+3579;2001149286;B06000;LESAO CORPORAL;RUA ALBERTO MART;18;85244;18/3/2001 18:36:00;CIDADAO COMUM;S;;JAQUELINE;BH;610475.11;809992.93;3578
+3580;2001149289;B06000;LESAO CORPORAL;RUA ALZIRA MARIA;79;49254;18/3/2001 18:36:00;CIDADAO COMUM;N;LJ1;SANTA MONICA;BH;607065.04;807373.38;3579
+3581;2001149322;B03000;AMEACA;BECO SARGENTO SO;60;300412;18/3/2001 18:56:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;614210.46;797140.33;3580
+3582;2001149334;B06000;LESAO CORPORAL;RUA PEDRO AMERIC;40;113157;18/3/2001 19:03:00;CIDADAO COMUM;N;;TUPI;BH;613644.24;806540.35;3581
+3583;2001149351;B03000;AMEACA;RUA JOAO CAETANO;834;37510;18/3/2001 19:13:00;INICIATIVA;S;0;NOVA SUISSA;BH;606534.92;795367.16;3582
+3584;2001149376;B03000;AMEACA;RUA MARIA GERTRU;823;98993;18/3/2001 19:32:00;CIDADAO COMUM;S;;CEU AZUL;BH;604453.51;808797.46;3583
+3585;2001149378;B06000;LESAO CORPORAL;RUA DOS INCONFID;937;34350;18/3/2001 19:34:00;CIDADAO COMUM;S;PX937;FUNCIONARIOS;BH;611530.18;795303.43;3584
+3586;2001149413;B03000;AMEACA;RUA TAIOBEIRAS;420;17168;18/3/2001 19:54:00;CIDADAO COMUM;S;;COQUEIROS;BH;602218.51;799284.00;3585
+3587;2001149422;B03000;AMEACA;RUA SAO JOAQUIM;698;62940;18/3/2001 20:04:00;CIDADAO COMUM;N;0;SAGRADA FAMILIA;BH;613152.40;799476.16;3586
+3588;2001149424;B03000;AMEACA;RUA ANTONIO SILV;85;103607;18/3/2001 20:04:00;CIDADAO COMUM;S;0;LINDEIA;BH;600014.68;790841.11;3587
+3589;2001149497;B06000;LESAO CORPORAL;RUA CABROBO;33;11187;18/3/2001 20:49:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613112.62;798985.69;3588
+3590;2001149505;B09000;ABANDONO DE INCA;RUA CAMILO PRATE;301;11915;18/3/2001 20:50:00;CIDADAO COMUM;S;0;UNIAO;BH;613325.68;801204.49;3589
+3591;2001149511;B06000;LESAO CORPORAL;RUA VOLTA GRANDE;278;73594;18/3/2001 20:53:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612839.11;798622.81;3590
+3592;2001149521;B06000;LESAO CORPORAL;RUA ITAMI;423;35671;18/3/2001 21:00:00;INICIATIVA;S;0;GUARANI;BH;612816.24;805557.38;3591
+3593;2001149523;B06000;LESAO CORPORAL;RUA PADRE SILVEI;540;51704;18/3/2001 21:01:00;INICIATIVA;S;0;SAO LUIZ;BH;608955.34;804515.98;3592
+3594;2001149533;B04001;HOMICIDIO TENTAD;RUA SERRA NEGRA;652;65038;18/3/2001 21:05:00;INICIATIVA;S;0;SANTO ANDRE;BH;609806.47;799141.42;3593
+3595;2001149547;B06000;LESAO CORPORAL;RUA SAN MARTIN;169;60208;18/3/2001 21:12:00;CIDADAO COMUM;S;0;UNIAO;BH;612658.97;801715.38;3594
+3596;2001149592;B04001;HOMICIDIO TENTAD;RUA EMERSON PEIX;26;116619;18/3/2001 21:48:00;CIDADAO COMUM;S;0;PARAISO;BH;614664.42;796179.44;3595
+3597;2001149657;B03000;AMEACA;RUA JUDA;148;12340;18/3/2001 22:31:00;INICIATIVA;S;0;SAO SALVADOR;BH;603624.77;799671.12;3596
+3598;2001149677;B03000;AMEACA;AV NOSSA SENHORA;1612;48107;18/3/2001 22:46:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;610355.98;797806.10;3597
+3599;2001149680;B03000;AMEACA;RUA CAMETA;125;11883;18/3/2001 22:44:00;CIDADAO COMUM;S;;SAUDADE;BH;615111.61;797615.51;3598
+3600;2001149691;B04001;HOMICIDIO TENTAD;RUA SOLIMOES;410;66273;18/3/2001 22:51:00;CIDADAO COMUM;N;;CABANA;BH;604890.13;794350.83;3599
+3601;2001149705;B06000;LESAO CORPORAL;RUA ITAMAR;691;35527;18/3/2001 22:55:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616421.36;798118.78;3600
+3602;2001149716;B06000;LESAO CORPORAL;RUA CARAVELAS;811;13141;18/3/2001 23:02:00;INICIATIVA;S;0;VERA CRUZ;BH;615714.70;797598.16;3601
+3603;2001149739;B04002;HOMICIDIO CONSUM;RUA ARISTOLINO B;190;41089;18/3/2001 23:15:00;CIDADAO COMUM;N;0;REGINA;BH;598888.42;789981.76;3602
+3604;2001149762;B02000;RIXA;RUA DOS CARIJOS;412;81243;18/3/2001 23:23:00;CIDADAO COMUM;S;PX244;CENTRO (BH);BH;611080.93;797191.84;3603
+3605;2001149768;B03000;AMEACA;RUA ROSA DE PEDR;20;124494;18/3/2001 23:27:00;CIDADAO COMUM;S;;ETELVINA CARNEIR;BH;611390.80;809189.08;3604
+3606;2001149841;B06000;LESAO CORPORAL;RUA OURO PRETO;293;50730;19/3/2001 00:00:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609961.08;797017.98;3605
+3607;2001149850;B04001;HOMICIDIO TENTAD;RUA PONTA GROSSA;420;14900;19/3/2001 00:11:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604863.70;789804.10;3606
+3608;2001149909;B06000;LESAO CORPORAL;AV VINTE E OITO ;1300;72970;19/3/2001 00:47:00;CIDADAO COMUM;S;CSA;ESPLANADA;BH;614446.33;798009.59;3607
+3609;2001149972;B06000;LESAO CORPORAL;AV DO CONTORNO;2600;17228;19/3/2001 01:15:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;612669.56;796877.24;3608
+3610;2001149990;B03000;AMEACA;AV PRESIDENTE TA;3587;35366;19/3/2001 01:27:00;CIDADAO COMUM;S;0;PAQUETA;BH;605080.35;802485.42;3609
+3611;2001150250;B03000;AMEACA;RUA OURO PRETO;1329;50730;19/3/2001 07:25:00;CIDADAO COMUM;S;AP202;SANTO AGOSTINHO;BH;609682.00;795988.07;3610
+3612;2001150271;B03000;AMEACA;RUA DOS GUARANIS;177;32181;19/3/2001 07:46:00;CIDADAO COMUM;S;EN177;CENTRO (BH);BH;610747.14;797450.62;3611
+3613;2001150385;B06000;LESAO CORPORAL;AV PARANA;246;52230;19/3/2001 08:54:00;INICIATIVA;S;0;CENTRO BH;BH;610752.57;797284.29;3612
+3614;2001150595;B03000;AMEACA;RUA MACEDO;184;42182;19/3/2001 11:03:00;CIDADAO COMUM;S;FU;FLORESTA;BH;612053.24;798305.99;3613
+3615;2001150602;B03000;AMEACA;RUA PARATI;337;110099;19/3/2001 11:03:00;CIDADAO COMUM;S;0;PILAR;BH;607573.03;788581.48;3614
+3616;2001150626;B09000;ABANDONO DE INCA;RUA VALAO;155;80238;19/3/2001 11:25:00;CIDADAO COMUM;S;;COQUEIROS;BH;602499.62;799683.99;3615
+3617;2001150660;B03000;AMEACA;RUA AURELIANO MA;156;6845;19/3/2001 11:47:00;CIDADAO COMUM;S;;PARAISO;BH;615026.70;796950.70;3616
+3618;2001150676;B03000;AMEACA;RUA ORLANDO MORE;6;87110;19/3/2001 12:03:00;CIDADAO COMUM;N;;DOM JOAQUIM;BH;614045.60;801793.68;3617
+3619;2001150725;B03000;AMEACA;RUA PADRE FEIJO;917;51326;19/3/2001 12:36:00;CIDADAO COMUM;S;0;SAUDADE;BH;615646.25;797648.91;3618
+3620;2001150732;B06000;LESAO CORPORAL;RUA GIBRALTAR;468;31223;19/3/2001 12:40:00;CIDADAO COMUM;S;0;NOVO GLORIA;BH;603168.59;798993.83;3619
+3621;2001150773;B03000;AMEACA;RUA CACHOEIRA DA;443;31958;19/3/2001 13:06:00;CIDADAO COMUM;S;0;GLORIA;BH;602888.75;798160.55;3620
+3622;2001150790;B03000;AMEACA;RUA PROFESSOR ES;830;26342;19/3/2001 13:14:00;CIDADAO COMUM;S;0;SERRA;BH;612840.03;794598.41;3621
+3623;2001150805;B04001;HOMICIDIO TENTAD;RUA RAIMUNDO TIN;44;301229;19/3/2001 13:29:00;INICIATIVA;N;0;MORRO DO PAPAGAI;BH;610762.74;793311.54;3622
+3624;2001151196;B06000;LESAO CORPORAL;AV SILVA LOBO;1397;65889;19/3/2001 17:09:00;CIDADAO COMUM;S;0;GRAJAU;BH;607823.81;795270.53;3623
+3625;2001151235;B03000;AMEACA;RUA RIO PETROPOL;295;91893;19/3/2001 17:30:00;CIDADAO COMUM;N;0;PINDORAMA;BH;602111.84;797838.19;3624
+3626;2001151257;B06000;LESAO CORPORAL;BECO OPALA;53;300769;19/3/2001 17:38:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;608757.86;797782.63;3625
+3627;2001151260;B03000;AMEACA;RUA CORONEL COST;135;10809;19/3/2001 17:39:00;CIDADAO COMUM;N;0;PLANALTO;BH;610637.95;806592.04;3626
+3628;2001151305;B06000;LESAO CORPORAL;RUA REMI PEREIRA;230;96727;19/3/2001 18:05:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;614854.85;806306.99;3627
+3629;2001151462;B03000;AMEACA;RUA DAVID CAMPIS;80;19683;19/3/2001 19:29:00;INICIATIVA;S;0;FLORESTA;BH;612121.55;797462.14;3628
+3630;2001151533;B06000;LESAO CORPORAL;RUA LOTUS;455;100564;19/3/2001 20:11:00;CIDADAO COMUM;S;;BETANIA;BH;604877.82;792364.78;3629
+3631;2001151545;B03000;AMEACA;RUA ANITA GARIBA;5;4184;19/3/2001 20:17:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608751.79;794649.99;3630
+3632;2001151574;B06000;LESAO CORPORAL;RUA OLIVER;234;49950;19/3/2001 20:37:00;CIDADAO COMUM;N;0;UNIAO;BH;612739.53;801366.60;3631
+3633;2001151596;B06000;LESAO CORPORAL;RUA INDIANOPOLIS;508;34423;19/3/2001 20:54:00;CIDADAO COMUM;N;0;RENASCENCA;BH;610662.86;800609.57;3632
+3634;2001151609;B06000;LESAO CORPORAL;RUA BRASILINO VI;143;89589;19/3/2001 21:01:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;617170.18;804550.42;3633
+3635;2001151632;B03000;AMEACA;RUA ASTOLFO DUTR;651;6426;19/3/2001 21:18:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615314.92;798329.61;3634
+3636;2001151644;B03000;AMEACA;RUA GIRASSOL;234;31277;19/3/2001 21:26:00;CIDADAO COMUM;S;0;LINDEIA;BH;599424.88;790984.00;3635
+3637;2001151716;B02000;RIXA;RUA HONORIO BICA;90;29959;19/3/2001 22:17:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615452.20;800576.26;3636
+3638;2001151869;B03000;AMEACA;AV PROFESSOR ALF;110;2264;19/3/2001 23:53:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612047.80;796468.72;3637
+3639;2001151875;B08000;VIOLACAO DE DOMI;RUA CONDE RIBEIR;607;16717;19/3/2001 23:55:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612740.88;798926.93;3638
+3640;2001151892;B03000;AMEACA;RUA BOREAL;56;10184;20/3/2001 00:08:00;CIDADAO COMUM;N;APTO 301;ADELAIDE;BH;606950.84;798500.09;3639
+3641;2001151908;B06000;LESAO CORPORAL;RUA DOIS;22;27130;20/3/2001 00:35:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616441.48;806767.08;3640
+3642;2001151929;B03000;AMEACA;AV ARTUR BERNARD;60;60844;20/3/2001 00:51:00;CIDADAO COMUM;S;;VILA PARIS;BH;610150.40;793809.60;3641
+3643;2001152119;B06000;LESAO CORPORAL;RUA MARIA ANTONI;108;93089;20/3/2001 06:41:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601439.44;786074.51;3642
+3644;2001152376;B04002;HOMICIDIO CONSUM;RUA DOUTOR ARGEM;160;23155;20/3/2001 09:54:00;CIDADAO COMUM;N;0;SAO LUCAS;BH;614033.70;795650.47;3643
+3645;2001152468;B03000;AMEACA;AV BIAS FORTES;1171;9553;20/3/2001 10:44:00;INICIATIVA;S;0;LOURDES;BH;610488.02;796648.12;3644
+3646;2001152491;B03000;AMEACA;RUA LUIZ CASTANH;625;41697;20/3/2001 10:57:00;CIDADAO COMUM;S;CAA;SANTA CRUZ;BH;610814.26;802068.61;3645
+3647;2001152582;B03000;AMEACA;RUA PADRE BELCHI;267;51240;20/3/2001 11:51:00;CIDADAO COMUM;S;AP201;CENTRO (BH);BH;610814.67;796746.33;3646
+3648;2001152677;B03000;AMEACA;AV AUGUSTO DE LI;744;6731;20/3/2001 13:04:00;CIDADAO COMUM;N;LJ76;CENTRO (BH);BH;610661.75;796747.31;3647
+3649;2001152776;B03000;AMEACA;RUA COMENDADOR W;18;16430;20/3/2001 14:10:00;CIDADAO COMUM;S;0;SAO TOMAZ;BH;609994.29;805766.64;3648
+3650;2001152810;B04001;HOMICIDIO TENTAD;RUA MARZAGANIA;5;88066;20/3/2001 14:27:00;INICIATIVA;0;0;VERA CRUZ;BH;617023.58;798845.01;3649
+3651;2001152869;B03000;AMEACA;RUA DOS GUAJAJAR;2429;32037;20/3/2001 15:05:00;INICIATIVA;N;0;BARRO PRETO;BH;609225.26;796929.95;3650
+3652;2001152882;B06000;LESAO CORPORAL;RUA JOANA LOPES ;300;77340;20/3/2001 15:14:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;602100.12;786426.51;3651
+3653;2001153024;B03000;AMEACA;RUA DOS CONSTRUT;701;101249;20/3/2001 16:34:00;INICIATIVA;N;0;CONJUNTO ALIPIO ;BH;604117.89;800080.17;3652
+3654;2001153045;B06000;LESAO CORPORAL;RUA DUARTE DA CO;136;24117;20/3/2001 16:39:00;INICIATIVA;S;0;VILA INDAIA;BH;609723.00;803384.28;3653
+3655;2001153190;B03000;AMEACA;RUA DOS ECONOMIS;612;103272;20/3/2001 17:52:00;INICIATIVA;S;0;CONJUNTO ALIPIO ;BH;604238.00;800485.06;3654
+3656;2001153226;B06000;LESAO CORPORAL;RUA VEREADOR ANT;96;93602;20/3/2001 18:09:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;602105.45;786483.33;3655
+3657;2001153273;B04002;HOMICIDIO CONSUM;RUA BOLIVAR;571;9871;20/3/2001 18:43:00;CIDADAO COMUM;N;;UNIAO;BH;612952.36;801829.38;3656
+3658;2001153294;B03000;AMEACA;RUA ICA;265;33979;20/3/2001 18:56:00;CIDADAO COMUM;N;0;RENASCENCA;BH;611007.28;799791.40;3657
+3659;2001153343;B06000;LESAO CORPORAL;AV AMAZONAS;8063;3140;20/3/2001 19:25:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;604590.39;794944.77;3658
+3660;2001153371;B06000;LESAO CORPORAL;AV BIAS FORTES;1772;9553;20/3/2001 19:35:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610196.72;797244.85;3659
+3661;2001153376;B06000;LESAO CORPORAL;RUA DOS INCONFID;20;25340;20/3/2001 19:37:00;CIDADAO COMUM;S;;TAQUARIL;BH;617047.89;797408.42;3660
+3662;2001153393;B03000;AMEACA;RUA SAO GERALDO;110;170283;20/3/2001 19:44:00;CIDADAO COMUM;S;0;CABANA;BH;604668.39;794124.46;3661
+3663;2001153453;B03000;AMEACA;RUA ARMINDA MORE;80;5997;20/3/2001 20:17:00;CIDADAO COMUM;S;;NOVA BARROCA;BH;607377.03;792889.19;3662
+3664;2001153597;B04001;HOMICIDIO TENTAD;RUA CARLOS PINHE;260;13498;20/3/2001 21:41:00;CIDADAO COMUM;N;CSF;JARDIM MONTANHES;BH;606565.14;798867.92;3663
+3665;2001153603;B06000;LESAO CORPORAL;AV VEREADOR CICE;520;19756;20/3/2001 21:45:00;CIDADAO COMUM;N;;DOM CABRAL;BH;605030.08;796406.17;3664
+3666;2001153655;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;5;170504;20/3/2001 22:17:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;608571.78;793994.63;3665
+3667;2001153712;B03000;AMEACA;RUA POUSO ALEGRE;1314;54932;20/3/2001 22:57:00;CIDADAO COMUM;N;;FLORESTA;BH;612350.46;797901.33;3666
+3668;2001153716;B03000;AMEACA;RUA LOTUS;420;100564;20/3/2001 22:58:00;CIDADAO COMUM;S;;BETANIA;BH;604969.15;792317.38;3667
+3669;2001153763;B02000;RIXA;RUA DOM PEDRITO;361;51300;20/3/2001 23:24:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614749.56;800708.97;3668
+3670;2001153777;B06000;LESAO CORPORAL;RUA DOS GUARANIS;200;32181;20/3/2001 23:37:00;INICIATIVA;S;0;CENTRO (BH);BH;610701.30;797475.97;3669
+3671;2001153806;B03000;AMEACA;RUA FERNAO DIAS;368;28133;20/3/2001 23:52:00;CIDADAO COMUM;S;LJ;CASA BRANCA;BH;615960.65;799305.77;3670
+3672;2001153862;B03000;AMEACA;RUA CAMPOS ELISE;897;12265;21/3/2001 00:39:00;CIDADAO COMUM;S;CAA;ALTO BARROCA;BH;607686.86;795553.41;3671
+3673;2001153880;B06000;LESAO CORPORAL;RUA ASA BRANCA;512;95737;21/3/2001 01:01:00;CIDADAO COMUM;S;;GOIANIA;BH;615345.92;802410.58;3672
+3674;2001153897;B04001;HOMICIDIO TENTAD;AV COLETORA;1160;78241;21/3/2001 01:11:00;CIDADAO COMUM;S;0;VILA PINHO;BH;602428.44;787588.34;3673
+3675;2001153911;B03000;AMEACA;RUA PATRIARCA;182;52559;21/3/2001 01:37:00;CIDADAO COMUM;S;AP202;IPIRANGA;BH;611538.59;800876.99;3674
+3676;2001153944;B03000;AMEACA;RUA CLORITA;100;16051;21/3/2001 02:12:00;CIDADAO COMUM;N;AP 1003;SANTA TEREZA;BH;612847.22;797209.80;3675
+3677;2001153948;B06000;LESAO CORPORAL;AV OLEGARIO MACI;515;49699;21/3/2001 02:19:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610571.41;797149.18;3676
+3678;2001154155;B03000;AMEACA;RUA DOS TIMBIRAS;1228;67682;21/3/2001 07:11:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611538.87;796208.86;3677
+3679;2001154212;B03000;AMEACA;RUA ESMERALDA;776;25920;21/3/2001 07:58:00;CIDADAO COMUM;S;;PRADO;BH;608599.45;795975.60;3678
+3680;2001154369;B03000;AMEACA;RUA CORONEL PEDR;164;18031;21/3/2001 09:36:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612313.72;800359.78;3679
+3681;2001154380;B03000;AMEACA;RUA RIO GRANDE D;499;58744;21/3/2001 09:42:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610383.31;797003.64;3680
+3682;2001154412;B03000;AMEACA;RUA ARAUA;312;5600;21/3/2001 10:00:00;CIDADAO COMUM;N;CA;SAO PAULO;BH;612777.64;803071.62;3681
+3683;2001154492;B03000;AMEACA;RUA BARAO DE COR;349;7891;21/3/2001 10:59:00;CIDADAO COMUM;N;0;BARREIRO;BH;602959.46;791015.32;3682
+3684;2001154559;B06000;LESAO CORPORAL;RUA CONGONHAS;606;16890;21/3/2001 11:50:00;INICIATIVA;N;0;SANTO ANTONIO;BH;610840.10;794487.88;3683
+3685;2001154562;B09000;ABANDONO DE INCA;RUA ITAPERUNA;160;35785;21/3/2001 11:53:00;CIDADAO COMUM;S;FU;SAUDADE;BH;614985.30;797412.99;3684
+3686;2001154626;B03000;AMEACA;RUA SIMAO TAMM;357;66084;21/3/2001 12:37:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610301.98;800541.54;3685
+3687;2001154645;B03000;AMEACA;RUA ILDEU MOREIR;99;80947;21/3/2001 12:52:00;CIDADAO COMUM;N;CAA;NOVA CINTRA;BH;605770.46;793443.77;3686
+3688;2001154676;B06000;LESAO CORPORAL;RUA WALFRIDO TEI;200;7154;21/3/2001 13:14:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609178.70;809605.33;3687
+3689;2001154678;B08000;VIOLACAO DE DOMI;RUA ITAMI;326;35671;21/3/2001 13:18:00;INICIATIVA;S;0;GUARANI;BH;613009.51;805481.70;3688
+3690;2001154734;B04001;HOMICIDIO TENTAD;RUA ALIPIO DE ME;763;2378;21/3/2001 14:06:00;INICIATIVA;S;0;JARDIM MONTANHES;BH;606232.66;798813.74;3689
+3691;2001154831;B03000;AMEACA;RUA F;93;302327;21/3/2001 15:26:00;CIDADAO COMUM;S;;BONSUCESSO;BH;606318.82;789810.40;3690
+3692;2001154913;B03000;AMEACA;RUA ROGERIO APAR;25;96682;21/3/2001 15:59:00;CIDADAO COMUM;S;CAA;ANTONIO RIBEIRO ;BH;614926.02;805954.24;3691
+3693;2001154939;B03000;AMEACA;RUA RAMIRO SIQUE;8;128858;21/3/2001 16:10:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617650.40;797388.81;3692
+3694;2001154955;B06000;LESAO CORPORAL;AV OLEGARIO MACI;338;49699;21/3/2001 16:20:00;CIDADAO COMUM;N;LJ42;CENTRO (BH);BH;610579.39;797366.71;3693
+3695;2001154996;B03000;AMEACA;RUA INGLATERRA;410;34552;21/3/2001 16:47:00;INICIATIVA;S;;JARDIM LEBLON;BH;606157.81;807087.68;3694
+3696;2001155110;B06000;LESAO CORPORAL;RUA MENDES DE OL;474;45430;21/3/2001 17:52:00;CIDADAO COMUM;S;LJFU;SANTO ANDRE;BH;609733.99;799040.75;3695
+3697;2001155302;B06000;LESAO CORPORAL;AV DOM PEDRO II;1020;53145;21/3/2001 19:22:00;INICIATIVA;S;0;JARDIM MONTANHES;BH;609572.19;797764.43;3696
+3698;2001155322;B03000;AMEACA;RUA CORONEL JOAQ;20;17864;21/3/2001 19:31:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611040.89;806104.13;3697
+3699;2001155354;B06000;LESAO CORPORAL;RUA ALEXANDRE LE;36;50162;21/3/2001 19:45:00;INICIATIVA;S;0;ESTRELA DALVA;BH;607674.96;792406.67;3698
+3700;2001155381;B04002;HOMICIDIO CONSUM;RUA ALIPIO DE ME;927;2378;21/3/2001 20:02:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606079.76;798879.74;3699
+3701;2001155504;B04002;HOMICIDIO CONSUM;RUA JAIR DE MATO;5;93703;21/3/2001 21:03:00;INICIATIVA;N;0;INDEPENDENCIA;BH;601631.28;786418.61;3700
+3702;2001155550;B03000;AMEACA;RUA MARIA LUCIA ;330;114061;21/3/2001 21:34:00;INICIATIVA;S;0;SANTA MONICA DO ;BH;606272.35;808701.83;3701
+3703;2001155566;B03000;AMEACA;RUA MARECHAL HEN;30;38351;21/3/2001 21:47:00;CIDADAO COMUM;S;;TUPI;BH;612620.28;806401.73;3702
+3704;2001155633;B04002;HOMICIDIO CONSUM;RUA JAVARI;431;37204;21/3/2001 22:33:00;CIDADAO COMUM;N;0;RENASCENCA;BH;610659.27;799750.92;3703
+3705;2001155656;B03000;AMEACA;AV AMAZONAS;333;3140;21/3/2001 22:50:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611084.15;797100.95;3704
+3706;2001155658;B03000;AMEACA;RUA MANGARATIBA;174;42822;21/3/2001 22:55:00;CIDADAO COMUM;N;;SAO GERALDO;BH;615031.70;799151.60;3705
+3707;2001155747;B06000;LESAO CORPORAL;RUA MAURA;388;82205;21/3/2001 23:55:00;CIDADAO COMUM;N;;IPIRANGA;BH;611731.38;801595.73;3706
+3708;2001155757;B06000;LESAO CORPORAL;RUA E;361;41211;22/3/2001 00:03:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602757.46;802918.53;3707
+3709;2001155779;B03000;AMEACA;RUA DOM PEDRITO;513;51300;22/3/2001 00:16:00;CIDADAO COMUM;S;0;NOVA VISTA (SB);SB;614792.29;800828.38;3708
+3710;2001155798;B04001;HOMICIDIO TENTAD;RUA SETE DE SETE;375;170167;22/3/2001 00:32:00;CIDADAO COMUM;S;0;CABANA;BH;604560.04;794283.05;3709
+3711;2001155820;B06000;LESAO CORPORAL;RUA CLAUDIO GOME;100;117060;22/3/2001 00:47:00;CIDADAO COMUM;S;AP201;DOS PALMARES;BH;611064.87;802289.97;3710
+3712;2001155828;B06000;LESAO CORPORAL;RUA FLOR DA AMIZ;10;94646;22/3/2001 00:57:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606160.75;799560.96;3711
+3713;2001155932;B03000;AMEACA;AV PARANA;26;52230;22/3/2001 02:20:00;INICIATIVA;S;0;CENTRO (BH);BH;610802.35;797494.35;3712
+3714;2001155956;B03000;AMEACA;RUA DES BRAULIO;1553;19917;22/3/2001 02:42:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616310.09;797705.61;3713
+3715;2001155980;B06000;LESAO CORPORAL;RUA MAJOR MESSIA;221;115200;22/3/2001 03:03:00;INICIATIVA;N;0;BANDEIRANTES;BH;604706.99;804294.47;3714
+3716;2001156089;B03000;AMEACA;RUA NELSON SOARE;316;47450;22/3/2001 06:22:00;CIDADAO COMUM;N;;DOM BOSCO;BH;604236.64;797100.59;3715
+3717;2001156367;B03000;AMEACA;RUA CONEGO SANTA;103;16859;22/3/2001 10:04:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610538.66;801482.66;3716
+3718;2001156449;B06000;LESAO CORPORAL;RUA LUIZ DA SILV;50;82158;22/3/2001 10:49:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;613336.01;803981.77;3717
+3719;2001156540;B03000;AMEACA;RUA CONDOR;186;16773;22/3/2001 11:46:00;CIDADAO COMUM;S;CAA;NOVA CINTRA;BH;605641.34;793929.45;3718
+3720;2001156595;B03000;AMEACA;RUA PEDRO LESSA;963;53117;22/3/2001 12:32:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609375.22;798807.26;3719
+3721;2001156844;B03000;AMEACA;RUA DONA LUIZA;491;22947;22/3/2001 15:25:00;INICIATIVA;S;0;MILIONARIOS;BH;604145.21;789897.69;3720
+3722;2001156885;B06000;LESAO CORPORAL;RUA CLORITA;100;16051;22/3/2001 15:50:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612847.22;797209.80;3721
+3723;2001156964;B06000;LESAO CORPORAL;AV DOS ANDRADAS;302;3761;22/3/2001 16:32:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611502.37;797321.65;3722
+3724;2001156986;B04001;HOMICIDIO TENTAD;RUA AMAROS;201;3125;22/3/2001 16:44:00;CIDADAO COMUM;S;0;SAO PAULO;BH;612908.14;802687.28;3723
+3725;2001156989;B06000;LESAO CORPORAL;RUA CARMO DA CAC;10;13659;22/3/2001 16:46:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606146.59;794290.29;3724
+3726;2001157104;B06000;LESAO CORPORAL;AV NELSON LEMOS ;119;89172;22/3/2001 17:38:00;CIDADAO COMUM;S;LJ5;DOS PALMARES;BH;612117.64;802505.91;3725
+3727;2001157129;B03000;AMEACA;AV WALDOMIRO LOB;1665;66548;22/3/2001 17:52:00;CIDADAO COMUM;N;;GUARANI;BH;611916.93;805178.94;3726
+3728;2001157315;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;175;51657;22/3/2001 19:32:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;3727
+3729;2001157326;B03000;AMEACA;RUA CLORITA;100;16051;22/3/2001 19:41:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612847.22;797209.80;3728
+3730;2001157335;B03000;AMEACA;RUA CAITITE;261;11524;22/3/2001 19:43:00;CIDADAO COMUM;S;;GLORIA;BH;603611.95;798765.39;3729
+3731;2001157405;B03000;AMEACA;RUA SAN SALVADOR;51;130728;22/3/2001 20:18:00;CIDADAO COMUM;S;0;ESTRELA DALVA;BH;607903.57;792246.82;3730
+3732;2001157415;B06000;LESAO CORPORAL;RUA FUNCIONARIOS;65;25163;22/3/2001 20:23:00;POLICIAL MILITAR;S;;TAQUARIL;BH;617149.42;797082.15;3731
+3733;2001157427;B06000;LESAO CORPORAL;RUA ESTRELA;90;86310;22/3/2001 20:38:00;CIDADAO COMUM;S;;CELESTINO;BH;610886.12;808672.60;3732
+3734;2001157429;B03000;AMEACA;RUA LUIZ DELFINO;220;35211;22/3/2001 20:39:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;607532.77;807525.06;3733
+3735;2001157488;B03000;AMEACA;RUA JOSE PEDRO D;392;78560;22/3/2001 21:10:00;CIDADAO COMUM;S;CAFR;VILA SANTA RITA;BH;601530.38;787287.41;3734
+3736;2001157533;B08000;VIOLACAO DE DOMI;RUA LEOPOLDO GOM;287;40770;22/3/2001 21:34:00;CIDADAO COMUM;N;0;POMPEIA;BH;614583.76;797883.74;3735
+3737;2001157534;B04002;HOMICIDIO CONSUM;RUA MUNIZ;450;170850;22/3/2001 21:34:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;608189.72;793769.03;3736
+3738;2001157538;B06000;LESAO CORPORAL;RUA VINTE E NOVE;274;73061;22/3/2001 21:38:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604371.26;796671.42;3737
+3739;2001157586;B03000;AMEACA;RUA AUGUSTO JOSE;40;6729;22/3/2001 22:04:00;CIDADAO COMUM;S;0;BETANIA;BH;605990.32;793126.57;3738
+3740;2001157597;B06000;LESAO CORPORAL;RUA EDUARDO LEIT;104;95258;22/3/2001 22:11:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;604948.63;791383.04;3739
+3741;2001157639;B06000;LESAO CORPORAL;RUA ROBERTSON PI;365;87149;22/3/2001 22:36:00;CIDADAO COMUM;S;;PONGELUPE;BH;603958.75;787192.76;3740
+3742;2001157641;B03000;AMEACA;RUA DOS BENEDITI;91;63310;22/3/2001 22:37:00;CIDADAO COMUM;S;;PLANALTO;BH;610767.07;805432.04;3741
+3743;2001157642;B03000;AMEACA;RUA CONSELHEIRO ;1517;17095;22/3/2001 22:37:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;613099.23;797328.67;3742
+3744;2001157644;B04002;HOMICIDIO CONSUM;RUA DOUTOR ARIST;596;89576;22/3/2001 22:39:00;CIDADAO COMUM;N;;PALMEIRAS;BH;606530.11;790740.76;3743
+3745;2001157653;B03000;AMEACA;RUA GENTIOS;1350;30983;22/3/2001 22:47:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;608905.13;793585.28;3744
+3746;2001157710;B04001;HOMICIDIO TENTAD;RUA JAGUARA;396;36775;22/3/2001 23:16:00;CIDADAO COMUM;N;CAB;SAUDADE;BH;615317.98;797573.75;3745
+3747;2001157773;B06000;LESAO CORPORAL;RUA ITAJUBA;2168;35495;22/3/2001 23:58:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612394.62;799485.99;3746
+3748;2001157795;B06000;LESAO CORPORAL;RUA GUAICURUS;690;32009;23/3/2001 00:15:00;INICIATIVA;S;0;CENTRO (BH);BH;611000.88;797693.04;3747
+3749;2001157828;B06000;LESAO CORPORAL;RUA JOAO PROCOPI;211;69070;23/3/2001 00:44:00;CIDADAO COMUM;S;0;JARDIM ALVORADA;BH;605929.92;800245.45;3748
+3750;2001157863;B03000;AMEACA;AV AGENOR DE PAU;85;86250;23/3/2001 01:09:00;CIDADAO COMUM;N;;VILA FREI LEOPOL;BH;611303.39;810132.56;3749
+3751;2001157873;B06000;LESAO CORPORAL;RUA BARAO DE SAR;445;8043;23/3/2001 01:15:00;CIDADAO COMUM;S;AP304;HORTO;BH;613709.90;797916.68;3750
+3752;2001157916;B03000;AMEACA;RUA SAO RAFAEL;138;63580;23/3/2001 02:08:00;CIDADAO COMUM;S;;FLORESTA;BH;612241.79;798264.50;3751
+3753;2001158255;B03000;AMEACA;RUA ITAPERUNA;3;35785;23/3/2001 08:29:00;CIDADAO COMUM;S;0;SAUDADE;BH;614974.32;797593.43;3752
+3754;2001158287;B03000;AMEACA;RUA PRINCIPAL;300;170504;23/3/2001 08:47:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608596.19;793933.42;3753
+3755;2001158329;B03000;AMEACA;RUA DAVID RABELO;948;19702;23/3/2001 09:12:00;INICIATIVA;S;A;INCONFIDENCIA;BH;604928.15;798979.46;3754
+3756;2001158331;B03000;AMEACA;RUA DOS GUAJAJAR;190;32037;23/3/2001 09:17:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611392.58;796387.87;3755
+3757;2001158559;B06000;LESAO CORPORAL;AV TERESA CRISTI;175;67512;23/3/2001 12:10:00;CIDADAO COMUM;S;FR175;CARLOS PRATES;BH;609052.83;797141.23;3756
+3758;2001158587;B03000;AMEACA;RUA MARMORE;206;44695;23/3/2001 12:27:00;CIDADAO COMUM;N;CONJ7;SANTA TEREZA;BH;613022.23;797513.82;3757
+3759;2001158621;B03000;AMEACA;RUA VISCONDE DE ;472;73380;23/3/2001 12:42:00;CIDADAO COMUM;S;CASA 05.;SAO JOAO BATISTA;BH;607907.71;807824.31;3758
+3760;2001158630;B03000;AMEACA;RUA JOAQUIM GONC;495;119428;23/3/2001 12:48:00;CIDADAO COMUM;S;BL/16 APT/103;VILA MAGNESITA;BH;602540.14;795033.90;3759
+3761;2001158686;B03000;AMEACA;RUA JACAREI;187;13154;23/3/2001 13:15:00;CIDADAO COMUM;S;;COQUEIROS;BH;602705.00;798554.24;3760
+3762;2001158722;B03000;AMEACA;RUA DR BROCHADO;93;23215;23/3/2001 13:37:00;CIDADAO COMUM;S;CAA;VERA CRUZ;BH;615809.92;798594.98;3761
+3763;2001158767;B06000;LESAO CORPORAL;RUA MARIA BEATRI;90;126792;23/3/2001 14:11:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605181.92;790926.68;3762
+3764;2001158796;B03000;AMEACA;AV AVAI;238;6946;23/3/2001 14:41:00;CIDADAO COMUM;S;LJ03;DOM BOSCO;BH;604297.83;797579.83;3763
+3765;2001158914;B06000;LESAO CORPORAL;RUA AROEIRA NEVE;151;92423;23/3/2001 15:37:00;CIDADAO COMUM;N;;ALVARO CAMARGOS;BH;604095.41;797469.10;3764
+3766;2001158941;B03000;AMEACA;RUA VIOLETA DE M;34;80253;23/3/2001 15:46:00;CIDADAO COMUM;S;;ALIPIO DE MELO;BH;605328.14;799159.14;3765
+3767;2001158990;B06000;LESAO CORPORAL;RUA MARIA BEATRI;90;126792;23/3/2001 16:05:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;605181.92;790926.68;3766
+3768;2001159015;B03000;AMEACA;RUA DOMINGOS ROC;122;22631;23/3/2001 16:17:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606564.17;795287.65;3767
+3769;2001159044;B03000;AMEACA;RUA RIO GRANDE D;697;58744;23/3/2001 16:35:00;CIDADAO COMUM;S;SL804;BARRO PRETO;BH;610340.32;796860.88;3768
+3770;2001159091;B03000;AMEACA;RUA JASMIM;25;37071;23/3/2001 16:57:00;CIDADAO COMUM;S;;LINDEIA;BH;599163.11;790914.30;3769
+3771;2001159117;B03000;AMEACA;RUA ZILAH RODRIG;277;74008;23/3/2001 17:05:00;CIDADAO COMUM;0;0;NOVA BARROCA;BH;607736.18;792540.41;3770
+3772;2001159170;B03000;AMEACA;AV PADRE JOSE MA;781;53448;23/3/2001 17:28:00;CIDADAO COMUM;S;0;VISTA ALEGRE;BH;605084.94;793257.67;3771
+3773;2001159215;B03000;AMEACA;RUA SUASSUI;460;66447;23/3/2001 17:50:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608932.68;797321.00;3772
+3774;2001159241;B03000;AMEACA;RUA DR ANTONIO P;25;95030;23/3/2001 18:00:00;MILITARES DAS FO;S;0;COQUEIROS;BH;602118.47;799218.16;3773
+3775;2001159286;B06000;LESAO CORPORAL;AV PRESIDENTE CA;2020;55125;23/3/2001 18:23:00;CIDADAO COMUM;S;0;CAICARA;BH;608432.84;800193.57;3774
+3776;2001159312;B06000;LESAO CORPORAL;RUA IBERTIOGA;256;33809;23/3/2001 18:35:00;CIDADAO COMUM;S;FU;SAO JOAO BATISTA;BH;611151.93;801287.85;3775
+3777;2001159325;B03000;AMEACA;RUA SANTAREM;337;61484;23/3/2001 18:39:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605761.62;793824.26;3776
+3778;2001159372;B03000;AMEACA;AV AMAZONAS;148;3140;23/3/2001 19:00:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611346.52;797320.11;3777
+3779;2001159443;B03000;AMEACA;RUA ZENITE;520;73957;23/3/2001 19:42:00;CIDADAO COMUM;S;AP301;ADELAIDE;BH;606967.94;799056.74;3778
+3780;2001159445;B06000;LESAO CORPORAL;RUA GUAICURUS;177;32009;23/3/2001 19:44:00;POLICIAL MILITAR;S;0;CENTRO (BH);BH;611334.76;797567.17;3779
+3781;2001159499;B06000;LESAO CORPORAL;RUA EDSON LUIZ M;112;25062;23/3/2001 20:09:00;CIDADAO COMUM;S;CAB;MARIA GORETTI;BH;614197.63;803631.48;3780
+3782;2001159512;B03000;AMEACA;RUA FRANCISCO JO;545;118223;23/3/2001 20:14:00;POLICIAL MILITAR;N;0;ITAIPU BH;BH;599752.96;789472.97;3781
+3783;2001159524;B03000;AMEACA;RUA ANTONIO PEIX;192;12379;23/3/2001 20:20:00;CIDADAO COMUM;S;;ADELAIDE;BH;607407.69;798098.04;3782
+3784;2001159527;B06000;LESAO CORPORAL;RUA CARMELITA CO;17;93366;23/3/2001 20:23:00;INICIATIVA;S;0;MINEIRAO;BH;601088.47;785895.52;3783
+3785;2001159603;B03000;AMEACA;RUA AUGUSTO JOSE;401;6729;23/3/2001 20:59:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605834.73;791972.39;3784
+3786;2001159663;B03000;AMEACA;RUA MARROCOS;1380;44869;23/3/2001 21:21:00;CIDADAO COMUM;N;0;JARDIM LEBLON;BH;605477.74;807935.17;3785
+3787;2001159725;B06000;LESAO CORPORAL;RUA QUARENTA E O;218;35048;23/3/2001 21:57:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612674.73;807062.29;3786
+3788;2001159755;B06000;LESAO CORPORAL;RUA LAGOA DOURAD;255;40174;23/3/2001 22:11:00;CIDADAO COMUM;N;PX300;PRADO;BH;608792.86;796447.49;3787
+3789;2001159850;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;1614;40770;23/3/2001 23:16:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615965.80;798142.50;3788
+3790;2001159951;B06000;LESAO CORPORAL;RUA DOS TUPIS;597;69965;24/3/2001 00:26:00;INICIATIVA;N;0;CENTRO BH;BH;610730.23;796962.57;3789
+3791;2001159980;B06000;LESAO CORPORAL;RUA DES BRAULIO;1138;19917;24/3/2001 00:41:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616228.18;797935.95;3790
+3792;2001159986;B06000;LESAO CORPORAL;RUA VIOLETA DE M;430;80253;24/3/2001 00:45:00;INICIATIVA;S;0;SAO JOSE;BH;604587.45;799319.51;3791
+3793;2001159993;B06000;LESAO CORPORAL;RUA JOANA LOPES ;300;77340;24/3/2001 00:49:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;602100.12;786426.51;3792
+3794;2001159994;B06000;LESAO CORPORAL;RUA RADIALISTA W;49;99983;24/3/2001 00:50:00;CIDADAO COMUM;S;;CEU AZUL;BH;604193.21;808558.49;3793
+3795;2001160050;B06000;LESAO CORPORAL;RUA DR GERALDO S;280;23372;24/3/2001 01:20:00;INICIATIVA;S;0;REGINA;BH;599010.61;790221.47;3794
+3796;2001160057;B06000;LESAO CORPORAL;RUA ANTONIO DE F;410;4550;24/3/2001 01:22:00;CIDADAO COMUM;N;0;PIRAJA;BH;613437.47;803121.36;3795
+3797;2001160064;B06000;LESAO CORPORAL;RUA FLOR DE PITA;107;42949;24/3/2001 01:26:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;601600.30;786045.97;3796
+3798;2001160122;B04001;HOMICIDIO TENTAD;RUA UNIAO;100;23587;24/3/2001 02:15:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617415.17;796910.53;3797
+3799;2001160162;B06000;LESAO CORPORAL;RUA ELI PINHEIRO;499;42734;24/3/2001 02:41:00;CIDADAO COMUM;S;;PINDORAMA;BH;601964.61;797707.33;3798
+3800;2001160208;B06000;LESAO CORPORAL;RUA NADIR;519;47173;24/3/2001 03:13:00;CIDADAO COMUM;S;AP102;ADELAIDE;BH;607116.61;798871.94;3799
+3801;2001160228;B06000;LESAO CORPORAL;RUA CARLOS SCHET;625;118771;24/3/2001 03:25:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;604966.86;794527.69;3800
+3802;2001160261;B03000;AMEACA;RUA ARISTOTELES;150;22427;24/3/2001 03:55:00;CIDADAO COMUM;S;;NAZARE;BH;615473.36;804481.47;3801
+3803;2001160271;B06000;LESAO CORPORAL;RUA CHAPADA;108;42721;24/3/2001 04:01:00;CIDADAO COMUM;S;0;PRIMAVERA;BH;604251.15;798747.54;3802
+3804;2001160281;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;429;6353;24/3/2001 04:06:00;CIDADAO COMUM;S;0;FLORESTA;BH;611933.16;797254.59;3803
+3805;2001160287;B06000;LESAO CORPORAL;RUA FELIPE DOS S;508;27953;24/3/2001 04:17:00;INICIATIVA;N;0;LOURDES;BH;610309.76;795521.03;3804
+3806;2001160297;B06000;LESAO CORPORAL;ESTRADA DO CERCA;1570;26428;24/3/2001 04:27:00;CIDADAO COMUM;S;0;JARDIM AMERICA;BH;607375.69;794003.07;3805
+3807;2001160309;B04001;HOMICIDIO TENTAD;RUA ENGENHEIRO A;111;4588;24/3/2001 04:51:00;CIDADAO COMUM;N;;JOAO PINHEIRO;BH;605231.12;795804.48;3806
+3808;2001160328;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;283;26052;24/3/2001 05:22:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611347.16;797371.80;3807
+3809;2001160354;B06000;LESAO CORPORAL;RUA SILVA ALVARE;619;65810;24/3/2001 05:55:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615346.41;799416.06;3808
+3810;2001160374;B03000;AMEACA;AV PRESIDENTE AN;1000;4461;24/3/2001 06:32:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610467.56;799002.85;3809
+3811;2001160376;B03000;AMEACA;RUA NORONHA GUAR;140;47867;24/3/2001 06:40:00;CIDADAO COMUM;N;;BARREIRO;BH;602096.60;791122.57;3810
+3812;2001160398;B03000;AMEACA;AV NOSSA SENHORA;2654;48107;24/3/2001 07:15:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;609400.94;797538.83;3811
+3813;2001160401;B06000;LESAO CORPORAL;RUA LAZARO FERRE;53;56143;24/3/2001 07:17:00;CIDADAO COMUM;N;;JARDIM GUANABARA;BH;611818.49;807543.63;3812
+3814;2001160402;B06000;LESAO CORPORAL;RUA DOS CAETES;540;11376;24/3/2001 07:20:00;INICIATIVA;S;0;CENTRO (BH);BH;611085.09;797483.48;3813
+3815;2001160471;B03000;AMEACA;RUA DOUTOR ALBER;149;23114;24/3/2001 08:13:00;CIDADAO COMUM;N;0;HELIOPOLIS;BH;610892.27;805316.02;3814
+3816;2001160486;B06000;LESAO CORPORAL;RUA MARIA CANDID;123;114957;24/3/2001 08:22:00;CIDADAO COMUM;S;FU;PAQUETA;BH;605581.25;802467.74;3815
+3817;2001160490;B06000;LESAO CORPORAL;RUA CARLOS MUZZI;137;89967;24/3/2001 08:24:00;CIDADAO COMUM;S;;PALMEIRAS;BH;606607.86;791463.13;3816
+3818;2001160552;B03000;AMEACA;RUA LEOPOLDINA;120;40739;24/3/2001 09:08:00;INICIATIVA;S;0;SANTO ANTONIO;BH;610885.17;794753.81;3817
+3819;2001160680;B03000;AMEACA;RUA TRES CORACOE;131;68805;24/3/2001 10:34:00;CIDADAO COMUM;S;;CALAFATE;BH;607965.67;796506.72;3818
+3820;2001160683;B03000;AMEACA;RUA SERGIPE;1211;64961;24/3/2001 10:35:00;CIDADAO COMUM;S;ARMADO DE REV;FUNCIONARIOS;BH;611200.95;795166.34;3819
+3821;2001160756;B04001;HOMICIDIO TENTAD;RUA SAO VICENTE;22;88126;24/3/2001 11:20:00;INICIATIVA;S;0;GRANJA FREITAS;BH;617082.39;798490.25;3820
+3822;2001160829;B04001;HOMICIDIO TENTAD;RUA 31;300;302830;24/3/2001 12:07:00;CIDADAO COMUM;S;AP703;NOVO AARAO REIS;BH;614073.73;805523.06;3821
+3823;2001160850;B06000;LESAO CORPORAL;RUA PAULINO CAET;300;20881;24/3/2001 12:16:00;CIDADAO COMUM;S;;CEU AZUL;BH;604892.28;807442.71;3822
+3824;2001160963;B06000;LESAO CORPORAL;RUA 36;94;302834;24/3/2001 13:42:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;613775.82;805485.10;3823
+3825;2001160980;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;215;63782;24/3/2001 13:53:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610955.95;793822.34;3824
+3826;2001160990;B06000;LESAO CORPORAL;RUA RIACHO;80;24927;24/3/2001 13:57:00;CIDADAO COMUM;S;;TAQUARIL;BH;617249.69;797177.50;3825
+3827;2001161069;B03000;AMEACA;RUA Y;55;41817;24/3/2001 14:54:00;CIDADAO COMUM;N;;CH CONFISCO (CO);CO;602477.29;802958.98;3826
+3828;2001161092;B04002;HOMICIDIO CONSUM;RUA CHAFARIZ;54;93568;24/3/2001 15:18:00;CIDADAO COMUM;N;0;PETROPOLIS;BH;601454.00;786602.56;3827
+3829;2001161110;B03000;AMEACA;RUA PADRE EUSTAQ;1340;51294;24/3/2001 15:31:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;608296.40;797908.26;3828
+3830;2001161139;B03000;AMEACA;RUA DOS TAMOIOS;19;66825;24/3/2001 15:45:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611310.59;796955.28;3829
+3831;2001161166;B03000;AMEACA;AV JOAQUIM ABEL ;185;123996;24/3/2001 15:47:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606602.10;812230.32;3830
+3832;2001161190;B03000;AMEACA;RUA EXPEDITO FLA;44;84847;24/3/2001 16:07:00;CIDADAO COMUM;S;BL10;DA LAGOA;BH;604775.59;809097.83;3831
+3833;2001161203;B06000;LESAO CORPORAL;RUA HEMATITA;608;33014;24/3/2001 16:13:00;CIDADAO COMUM;S;;ADELAIDE;BH;607683.27;798277.79;3832
+3834;2001161224;B06000;LESAO CORPORAL;RUA CIPRIANO DE ;745;15856;24/3/2001 16:25:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606346.75;792973.08;3833
+3835;2001161319;B06000;LESAO CORPORAL;RUA DOM SILVERIO;300;22496;24/3/2001 17:15:00;CIDADAO COMUM;S;;BELMONT;BH;615222.25;805374.99;3834
+3836;2001161335;B03000;AMEACA;RUA BRASIL;21;10446;24/3/2001 17:25:00;CIDADAO COMUM;S;;CABANA;BH;604813.51;793739.13;3835
+3837;2001161368;B03000;AMEACA;RUA ANTONIO PEIX;192;12379;24/3/2001 17:47:00;CIDADAO COMUM;S;;ADELAIDE;BH;607407.69;798098.04;3836
+3838;2001161386;B06000;LESAO CORPORAL;RUA NICOLINA DE ;69;44263;24/3/2001 17:56:00;INICIATIVA;S;0;HAVAI;BH;607317.75;793714.27;3837
+3839;2001161392;B03000;AMEACA;AV MIGUEL MOYSES;70;10811;24/3/2001 17:58:00;CIDADAO COMUM;N;;NOVA GAMELEIRA;BH;605508.31;794694.74;3838
+3840;2001161447;B03000;AMEACA;RUA DOS TIMBIRAS;2163;67682;24/3/2001 18:24:00;CIDADAO COMUM;S;AP401;LOURDES;BH;610609.99;796418.01;3839
+3841;2001161488;B06000;LESAO CORPORAL;RUA RIO DE JANEI;328;58772;24/3/2001 18:49:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611168.31;797376.15;3840
+3842;2001161515;B03000;AMEACA;RUA H;152;41441;24/3/2001 19:04:00;POLICIAL MILITAR;S;0;CH CONFISCO;BH;602941.36;803114.92;3841
+3843;2001161545;B03000;AMEACA;RUA POVOA DE VAR;381;54958;24/3/2001 19:13:00;INICIATIVA;N;0;PAQUETA;BH;605370.76;802630.89;3842
+3844;2001161549;B06000;LESAO CORPORAL;AV NOSSA SENHORA;2299;48107;24/3/2001 19:15:00;INICIATIVA;N;0;CARLOS PRATES;BH;609679.55;797662.00;3843
+3845;2001161577;B03000;AMEACA;RUA RAMIRO SIQUE;73;128858;24/3/2001 19:26:00;INICIATIVA;S;0;CASTANHEIRAS (TA;BH;617772.39;797223.77;3844
+3846;2001161579;B04001;HOMICIDIO TENTAD;RUA DURVAL DE BA;10;24914;24/3/2001 19:27:00;INICIATIVA;N;0;TAQUARIL;BH;617311.85;797132.61;3845
+3847;2001161605;B06000;LESAO CORPORAL;RUA CORONEL ABIL;228;17518;24/3/2001 19:38:00;CIDADAO COMUM;S;0;CAETANO FURQUIM;BH;616532.45;799490.62;3846
+3848;2001161610;B06000;LESAO CORPORAL;RUA PROFESSOR ME;295;77920;24/3/2001 19:42:00;CIDADAO COMUM;S;0;MANGABEIRAS;BH;612132.44;792715.35;3847
+3849;2001161724;B04002;HOMICIDIO CONSUM;RUA REGENCIA;100;301448;24/3/2001 20:46:00;CIDADAO COMUM;N;0;VILA CAFEZAL;BH;614118.47;795470.66;3848
+3850;2001161744;B03000;AMEACA;RUA JULITA NUNES;211;130047;24/3/2001 20:54:00;CIDADAO COMUM;N;;MINASCAIXA;BH;609211.34;809819.89;3849
+3851;2001161766;B06000;LESAO CORPORAL;RUA FREI VICENTE;235;30029;24/3/2001 21:01:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;607275.87;807974.29;3850
+3852;2001161789;B03000;AMEACA;RUA RIO PARNAIBA;230;52344;24/3/2001 21:10:00;CIDADAO COMUM;S;0;MINASLANDIA;BH;612194.90;804722.15;3851
+3853;2001161853;B03000;AMEACA;RUA SAO GONCALO ;165;62689;24/3/2001 21:44:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605834.54;807920.69;3852
+3854;2001161854;B06000;LESAO CORPORAL;RUA BOM JARDIM;310;9972;24/3/2001 21:45:00;CIDADAO COMUM;N;;SARANDI (URCA/BH;BH;604021.54;802515.54;3853
+3855;2001161865;B03000;AMEACA;RUA PIO XI;560;53927;24/3/2001 21:48:00;CIDADAO COMUM;S;;IPIRANGA;BH;612058.97;800797.20;3854
+3856;2001161904;B06000;LESAO CORPORAL;RUA K;45;78774;24/3/2001 22:05:00;CIDADAO COMUM;N;0;CH JATOBA IV;BH;600642.62;787884.73;3855
+3857;2001161955;B06000;LESAO CORPORAL;RUA BEBERIBE;155;8550;24/3/2001 22:49:00;CIDADAO COMUM;N;;SAO CRISTOVAO;BH;610639.39;799190.15;3856
+3858;2001161982;B03000;AMEACA;RUA RITMO;273;301436;24/3/2001 23:01:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614052.17;795226.81;3857
+3859;2001162002;B03000;AMEACA;RUA ALETES;200;2075;24/3/2001 23:10:00;CIDADAO COMUM;S;;PINDORAMA;BH;602582.06;797448.37;3858
+3860;2001162011;B03000;AMEACA;RUA STA INES;255;60730;24/3/2001 23:16:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614319.43;802711.42;3859
+3861;2001162046;B03000;AMEACA;RUA MAURA;513;82205;24/3/2001 23:31:00;CIDADAO COMUM;S;FU;IPIRANGA;BH;611834.45;801543.11;3860
+3862;2001162097;B04002;HOMICIDIO CONSUM;AV BUENO CERQUEI;143;71343;25/3/2001 00:00:00;CIDADAO COMUM;N;CSA;UNIVERSITARIO;BH;610578.63;802883.10;3861
+3863;2001162126;B06000;LESAO CORPORAL;RUA DOS CARIJOS;412;81243;25/3/2001 00:14:00;INICIATIVA;N;0;CENTRO (BH);BH;611080.93;797191.84;3862
+3864;2001162128;B06000;LESAO CORPORAL;AV PRESIDENTE CA;800;55125;25/3/2001 00:15:00;CIDADAO COMUM;N;0;CAICARA;BH;608266.95;799059.21;3863
+3865;2001162156;B06000;LESAO CORPORAL;RUA PONTA GROSSA;20;14900;25/3/2001 00:34:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604918.03;789453.17;3864
+3866;2001162169;B04001;HOMICIDIO TENTAD;RUA JOSE CHRISTI;110;106949;25/3/2001 00:41:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605812.26;793381.78;3865
+3867;2001162225;B02000;RIXA;AV PROFESSOR MAR;1430;91130;25/3/2001 01:10:00;CIDADAO COMUM;S;0;BURITIS;BH;608335.60;791553.16;3866
+3868;2001162251;B03000;AMEACA;PRACA CINQUENTEN;10;8462;25/3/2001 01:25:00;POLICIAL MILITAR;S;;CINQUENTENARIO;BH;606358.33;793267.49;3867
+3869;2001162257;B03000;AMEACA;RUA MARIA MARTIN;633;82680;25/3/2001 01:28:00;CIDADAO COMUM;S;0;CELESTINO;BH;611032.06;808645.30;3868
+3870;2001162281;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;2200;57830;25/3/2001 01:37:00;INICIATIVA;N;0;ESTORIL;BH;608853.99;793279.32;3869
+3871;2001162284;B06000;LESAO CORPORAL;RUA MIGUEL PINTO;1595;128757;25/3/2001 01:35:00;CIDADAO COMUM;S;;NOVA ESPERANCA;BH;609001.69;799454.98;3870
+3872;2001162310;B03000;AMEACA;BECO A;18;302717;25/3/2001 01:45:00;CIDADAO COMUM;S;0;VILA CASTANHEIRA;BH;601391.47;788282.32;3871
+3873;2001162322;B06000;LESAO CORPORAL;AV PEDREIRA;66;52952;25/3/2001 01:52:00;INICIATIVA;S;0;PROVIDENCIA;BH;612837.94;804549.46;3872
+3874;2001162331;B03000;AMEACA;RUA EDSON TOMAS ;700;68556;25/3/2001 01:56:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;611116.83;804710.84;3873
+3875;2001162364;B03000;AMEACA;RUA REGINO GONZA;11;95522;25/3/2001 02:11:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;617056.30;804188.87;3874
+3876;2001162406;B06000;LESAO CORPORAL;AV AMAZONAS;3615;3140;25/3/2001 02:32:00;CIDADAO COMUM;N;0;BARROCA;BH;608219.93;795824.43;3875
+3877;2001162408;B03000;AMEACA;RUA ANTONIO VERG;11;4900;25/3/2001 02:33:00;INICIATIVA;S;0;OURO PRETO;BH;605613.02;802592.15;3876
+3878;2001162430;B06000;LESAO CORPORAL;AV SILVIANO BRAN;427;66002;25/3/2001 02:47:00;CIDADAO COMUM;N;CAFU;SAGRADA FAMILIA;BH;612050.15;798570.93;3877
+3879;2001162484;B03000;AMEACA;RUA GABRO;267;30435;25/3/2001 03:27:00;CIDADAO COMUM;S;CAB;SANTA TEREZA;BH;612913.80;797341.46;3878
+3880;2001162560;B06000;LESAO CORPORAL;AV PRESIDENTE CA;800;55125;25/3/2001 04:18:00;INICIATIVA;S;0;CAICARA;BH;608266.95;799059.21;3879
+3881;2001162590;B06000;LESAO CORPORAL;AV SANTOS DUMONT;673;61950;25/3/2001 04:41:00;CIDADAO COMUM;S;PX734;CENTRO (BH);BH;610982.01;797558.77;3880
+3882;2001162693;B04002;HOMICIDIO CONSUM;RUA VEREADOR ANT;67;93602;25/3/2001 06:40:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;601901.25;786466.11;3881
+3883;2001162695;B03000;AMEACA;RUA OLAU FERREIR;19;49598;25/3/2001 06:41:00;CIDADAO COMUM;S;0;CAICARA;BH;607753.24;799849.35;3882
+3884;2001162703;B03000;AMEACA;RUA NATAL;373;47306;25/3/2001 07:00:00;CIDADAO COMUM;N;0;SANTO ANDRE;BH;609189.92;799371.29;3883
+3885;2001162749;B03000;AMEACA;RUA SAO JOAO;31;62780;25/3/2001 07:56:00;CIDADAO COMUM;S;0;FLAVIO MARQUES D;BH;604144.35;788857.30;3884
+3886;2001162812;B04002;HOMICIDIO CONSUM;RUA 51;227;302847;25/3/2001 08:38:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614103.15;805588.83;3885
+3887;2001162894;B03000;AMEACA;RUA DEPUTADA IVE;124;87325;25/3/2001 09:57:00;CIDADAO COMUM;N;;PONGELUPE;BH;603758.88;787112.87;3886
+3888;2001162938;B03000;AMEACA;RUA EXPEDITO FLA;359;84847;25/3/2001 10:29:00;CIDADAO COMUM;N;;DA LAGOA;BH;604520.36;809212.26;3887
+3889;2001162959;B02000;RIXA;RUA ASSEMBLEIA;90;6338;25/3/2001 10:42:00;CIDADAO COMUM;N;;LUXEMBURGO;BH;609657.18;794608.63;3888
+3890;2001162994;B06000;LESAO CORPORAL;RUA ITAMAR;70;35527;25/3/2001 11:10:00;INICIATIVA;N;0;VERA CRUZ;BH;616278.93;798658.76;3889
+3891;2001162997;B06000;LESAO CORPORAL;RUA PASSOS;41;52458;25/3/2001 11:10:00;CIDADAO COMUM;N;CSB;CARLOS PRATES;BH;609255.16;798152.08;3890
+3892;2001163036;B06000;LESAO CORPORAL;RUA BEZERRA DE M;82;9525;25/3/2001 11:46:00;CIDADAO COMUM;S;;NAZARE;BH;615434.80;804565.98;3891
+3893;2001163106;B04001;HOMICIDIO TENTAD;RUA DR JOAO CARV;137;36012;25/3/2001 12:42:00;CIDADAO COMUM;N;;PRADO LOPES;BH;610144.49;798836.55;3892
+3894;2001163241;B03000;AMEACA;RUA ABILIO BARRE;75;129661;25/3/2001 14:37:00;CIDADAO COMUM;S;;TUPI;BH;613770.88;806593.53;3893
+3895;2001163256;B06000;LESAO CORPORAL;RUA VINTE E QUAT;7;300270;25/3/2001 14:46:00;CIDADAO COMUM;S;PROX ESC. MURILO;VISTA DO SOL;BH;615774.88;804917.15;3894
+3896;2001163264;B06000;LESAO CORPORAL;RUA CORONEL ANTO;342;17590;25/3/2001 14:52:00;CIDADAO COMUM;N;CAFU;JARDIM LEBLON;BH;606018.67;807546.54;3895
+3897;2001163310;B03000;AMEACA;RUA NOSSA SENHOR;340;48021;25/3/2001 15:25:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610236.98;800129.30;3896
+3898;2001163362;B06000;LESAO CORPORAL;AV SANTOS DUMONT;305;61950;25/3/2001 15:54:00;CIDADAO COMUM;N;PX305;CENTRO (BH);BH;611328.73;797470.25;3897
+3899;2001163415;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;491;63782;25/3/2001 16:21:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610857.53;793450.63;3898
+3900;2001163424;B03000;AMEACA;RUA CARLINDO COS;75;97294;25/3/2001 16:27:00;CIDADAO COMUM;N;;EYMARD;BH;613736.10;803676.67;3899
+3901;2001163461;B06000;LESAO CORPORAL;AV MENELICK DE C;1420;30448;25/3/2001 16:46:00;CIDADAO COMUM;S;0;FLAVIO MARQUES D;BH;605358.05;788416.82;3900
+3902;2001163466;B06000;LESAO CORPORAL;RUA NIZIO TORRES;205;94659;25/3/2001 16:48:00;CIDADAO COMUM;S;CA2;OURO PRETO;BH;606256.94;800864.38;3901
+3903;2001163471;B06000;LESAO CORPORAL;RUA MARIA ROSA D;205;107800;25/3/2001 16:54:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;605990.28;811335.34;3902
+3904;2001163528;B06000;LESAO CORPORAL;RUA Q;74;78415;25/3/2001 17:31:00;CIDADAO COMUM;N;CA57;VILA PINHO;BH;602137.45;787979.37;3903
+3905;2001163541;B04001;HOMICIDIO TENTAD;RUA RIO NOVO;64;58817;25/3/2001 17:40:00;CIDADAO COMUM;N;0;LAGOINHA;BH;610575.70;798394.02;3904
+3906;2001163585;B06000;LESAO CORPORAL;RUA CLAUDIO BRAN;210;15960;25/3/2001 18:01:00;CIDADAO COMUM;N;;TUPI;BH;612776.24;806486.34;3905
+3907;2001163610;B04001;HOMICIDIO TENTAD;RUA ENGENHO DO S;760;80427;25/3/2001 18:07:00;INICIATIVA;N;0;ENGENHO NOGUEIRA;BH;606376.46;800209.42;3906
+3908;2001163631;B06000;LESAO CORPORAL;AV DOUTOR CRISTI;1109;62459;25/3/2001 18:21:00;INICIATIVA;S;0;PLANALTO;BH;610111.47;805715.27;3907
+3909;2001163646;B04001;HOMICIDIO TENTAD;RUA REGINO GONZA;11;95522;25/3/2001 18:33:00;POLICIAL MILITAR;N;SOL MILITAR REFO;JARDIM VITORIA;BH;617056.30;804188.87;3908
+3910;2001163677;B03000;AMEACA;RUA JOAQUIM CORR;14;57288;25/3/2001 18:47:00;CIDADAO COMUM;S;;CAMARGOS;BH;602174.27;794614.42;3909
+3911;2001163687;B03000;AMEACA;AV SANTA ALBERTI;200;116170;25/3/2001 18:54:00;CIDADAO COMUM;N;;CAETANO FURQUIM;BH;616505.24;799988.35;3910
+3912;2001163688;B03000;AMEACA;RUA MUNICIPAL;20;84239;25/3/2001 18:53:00;CIDADAO COMUM;S;CAC;RIO BRANCO;BH;606795.56;808729.34;3911
+3913;2001163709;B03000;AMEACA;RUA ALEXANDRE LE;27;50162;25/3/2001 19:04:00;CIDADAO COMUM;N;;ESTRELA DALVA;BH;607685.49;792465.04;3912
+3914;2001163727;B06000;LESAO CORPORAL;RUA DOS SALESIAN;680;9087;25/3/2001 19:13:00;CIDADAO COMUM;S;0;PLANALTO;BH;610416.78;805536.12;3913
+3915;2001163746;B06000;LESAO CORPORAL;AV DO CONTORNO;9530;17228;25/3/2001 19:24:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609166.33;796740.91;3914
+3916;2001163767;B03000;AMEACA;AV MONTESE;1090;46675;25/3/2001 19:35:00;CIDADAO COMUM;S;;SANTA BRANCA;BH;607998.64;806599.40;3915
+3917;2001163773;B06000;LESAO CORPORAL;RUA BOM JESUS DA;250;99680;25/3/2001 19:34:00;CIDADAO COMUM;N;;SANTA TEREZINHA;BH;604196.12;802710.04;3916
+3918;2001163797;B03000;AMEACA;RUA TRES;86;300266;25/3/2001 19:51:00;CIDADAO COMUM;S;;VISTA DO SOL;BH;616379.13;804683.65;3917
+3919;2001163809;B03000;AMEACA;RUA SAO RAFAEL;138;63580;25/3/2001 19:58:00;CIDADAO COMUM;S;;FLORESTA;BH;612241.79;798264.50;3918
+3920;2001163825;B03000;AMEACA;RUA VINTE E SETE;191;33115;25/3/2001 20:05:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612303.47;807232.65;3919
+3921;2001163846;B04001;HOMICIDIO TENTAD;AV JOSE CANDIDO ;1200;12602;25/3/2001 20:15:00;INICIATIVA;N;0;UNIAO;BH;613277.34;800584.46;3920
+3922;2001163858;B06000;LESAO CORPORAL;RUA ALETES;134;2075;25/3/2001 20:20:00;CIDADAO COMUM;S;CAA;PINDORAMA;BH;602646.60;797535.96;3921
+3923;2001163859;B04001;HOMICIDIO TENTAD;RUA SETENTA E TR;25;124264;25/3/2001 20:21:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607860.04;811786.76;3922
+3924;2001163876;B03000;AMEACA;RUA NAVAJOS;393;47334;25/3/2001 20:27:00;CIDADAO COMUM;S;CASA 103;SANTA MONICA;BH;607322.84;807248.25;3923
+3925;2001163898;B03000;AMEACA;RUA ROCHA LAGOA;249;58990;25/3/2001 20:42:00;CIDADAO COMUM;N;CAA;CACHOEIRINHA;BH;609953.51;801281.16;3924
+3926;2001163963;B06000;LESAO CORPORAL;RUA DES BRAULIO;1235;19917;25/3/2001 21:11:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616276.33;797850.05;3925
+3927;2001164004;B04001;HOMICIDIO TENTAD;RUA JULITA NOGUE;1000;39597;25/3/2001 21:31:00;CIDADAO COMUM;S;0;SANTA TEREZINHA;BH;604381.61;802818.36;3926
+3928;2001164012;B03000;AMEACA;RUA ANA SEVERINA;100;99955;25/3/2001 21:35:00;INICIATIVA;S;0;BRAUNAS;BH;603437.58;804941.90;3927
+3929;2001164056;B06000;LESAO CORPORAL;RUA MAUREA DE OL;215;117592;25/3/2001 21:50:00;CIDADAO COMUM;N;PROX.ORFANATO ST;VENDA NOVA;BH;607285.12;809101.82;3928
+3930;2001164061;B03000;AMEACA;RUA DOS TUPINAMB;518;69940;25/3/2001 21:56:00;CIDADAO COMUM;N;PX518;CENTRO (BH);BH;611073.31;797352.77;3929
+3931;2001164068;B04002;HOMICIDIO CONSUM;AV MARIA CONCEIC;1015;32052;25/3/2001 21:58:00;CIDADAO COMUM;N;CAB;GOIANIA;BH;615379.04;803475.97;3930
+3932;2001164083;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;25/3/2001 22:08:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;3931
+3933;2001164085;B03000;AMEACA;AV WALDOMIRO LOB;1220;66548;25/3/2001 22:08:00;CIDADAO COMUM;S;0;GUARANI;BH;612147.10;805326.19;3932
+3934;2001164094;B04001;HOMICIDIO TENTAD;RUA FLOR DE MAIO;447;300399;25/3/2001 22:12:00;INICIATIVA;S;0;VILA CAFEZAL;BH;614645.76;794817.74;3933
+3935;2001164110;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;4052;17228;25/3/2001 22:19:00;CIDADAO COMUM;S;AP101;SAO LUCAS;BH;612793.97;795966.61;3934
+3936;2001164111;B03000;AMEACA;RUA INDUSTRIAL J;597;34477;25/3/2001 22:19:00;CIDADAO COMUM;S;A;NOVA GRANADA;BH;608020.74;794556.86;3935
+3937;2001164112;B03000;AMEACA;RUA GIBRALTAR;188;31223;25/3/2001 22:20:00;CIDADAO COMUM;N;PROX. A R:GUARAR;NOVO GLORIA;BH;603456.01;799013.92;3936
+3938;2001164146;B04001;HOMICIDIO TENTAD;RUA CONEGO TRIND;1445;16861;25/3/2001 22:39:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605675.61;808311.01;3937
+3939;2001164167;B03000;AMEACA;RUA SAO JOSE;400;63045;25/3/2001 22:56:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605876.86;794133.51;3938
+3940;2001164168;B03000;AMEACA;AV MENELICK DE C;205;30448;25/3/2001 22:57:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604170.93;788789.23;3939
+3941;2001164264;B06000;LESAO CORPORAL;RUA SAO RODRIGUE;120;103420;25/3/2001 23:49:00;INICIATIVA;S;0;ANTONIO RIBEIRO ;BH;615617.05;805562.96;3940
+3942;2001164284;B03000;AMEACA;AV MANOEL GOMES;250;43103;26/3/2001 00:11:00;CIDADAO COMUM;S;0;NOVA CACHOEIRINH;BH;609668.41;801466.24;3941
+3943;2001164294;B03000;AMEACA;RUA ANTONIO VIEI;321;4925;26/3/2001 00:20:00;CIDADAO COMUM;S;0;GLALIJA;BH;603417.19;794194.43;3942
+3944;2001164434;B03000;AMEACA;RUA DIVINESIA;84;82199;26/3/2001 02:23:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612651.00;804712.28;3943
+3945;2001164499;B03000;AMEACA;PRACA CRISTO RED;50;18693;26/3/2001 04:15:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;604707.83;790851.38;3944
+3946;2001164617;B06000;LESAO CORPORAL;AV AMAZONAS;1313;3140;26/3/2001 07:35:00;INICIATIVA;N;0;BARRO PRETO;BH;610339.94;796671.36;3945
+3947;2001164662;B03000;AMEACA;RUA DIVISA SANTA;260;21452;26/3/2001 08:07:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604225.39;790674.08;3946
+3948;2001164679;B03000;AMEACA;RUA CALDAS DA RA;855;61100;26/3/2001 08:15:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609607.84;802228.80;3947
+3949;2001164717;B03000;AMEACA;RUA TEOFILO PIRE;117;67465;26/3/2001 08:36:00;CIDADAO COMUM;S;FU;BOA VISTA;BH;615282.49;800096.43;3948
+3950;2001164754;B03000;AMEACA;AV RAJA GABAGLIA;1740;57830;26/3/2001 09:02:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608719.62;793771.09;3949
+3951;2001164896;B03000;AMEACA;AV FLOR DE SEDA;781;748;26/3/2001 10:37:00;CIDADAO COMUM;S;0;LINDEIA;BH;599486.14;790600.03;3950
+3952;2001164927;B08000;VIOLACAO DE DOMI;RUA GUARATINGA;15;32282;26/3/2001 11:03:00;CIDADAO COMUM;S;;SION;BH;611644.45;793087.67;3951
+3953;2001164988;B03000;AMEACA;RUA VILA RICA;1795;71992;26/3/2001 11:48:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606750.79;798775.44;3952
+3954;2001165099;B06000;LESAO CORPORAL;RUA JOSUE AZEVED;10;56487;26/3/2001 13:17:00;CIDADAO COMUM;S;0;PLANALTO;BH;610223.03;806345.30;3953
+3955;2001165108;B03000;AMEACA;RUA PEDRA DO IND;75;32774;26/3/2001 13:24:00;CIDADAO COMUM;N;;CANDELARIA;BH;608469.25;808762.11;3954
+3956;2001165115;B06000;LESAO CORPORAL;RUA DURVALIA;65;115704;26/3/2001 13:26:00;CIDADAO COMUM;N;;HAVAI;BH;607425.30;793431.31;3955
+3957;2001165160;B03000;AMEACA;AV SANTOS DUMONT;260;61950;26/3/2001 13:55:00;CIDADAO COMUM;N;PX262;CENTRO (BH);BH;611389.56;797503.41;3956
+3958;2001165167;B06000;LESAO CORPORAL;RUA CHEIK NAGIB ;205;52892;26/3/2001 14:00:00;POLICIAL MILITAR;S;0;JARDIM ATLANTICO;BH;607950.82;805633.54;3957
+3959;2001165259;B03000;AMEACA;RUA VIANA DO CAS;490;63640;26/3/2001 15:05:00;CIDADAO COMUM;N;;SAO FRANCISCO;BH;609580.11;801875.33;3958
+3960;2001165331;B06000;LESAO CORPORAL;AV AMAZONAS;555;3140;26/3/2001 15:47:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611012.14;797068.58;3959
+3961;2001165381;B03000;AMEACA;RUA SEBASTIAO MO;409;93555;26/3/2001 16:19:00;INICIATIVA;S;0;TIROL;BH;600565.02;789378.17;3960
+3962;2001165452;B06000;LESAO CORPORAL;RUA DAVIDSON PIM;53;124189;26/3/2001 16:54:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607054.62;811628.39;3961
+3963;2001165537;B06000;LESAO CORPORAL;RUA GUARDA CUSTO;143;32330;26/3/2001 17:43:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606669.33;802899.77;3962
+3964;2001165544;B03000;AMEACA;RUA SEIS;289;21465;26/3/2001 17:47:00;CIDADAO COMUM;S;0;FLAVIO MARQUES D;BH;604570.80;788685.75;3963
+3965;2001165604;B03000;AMEACA;RUA DONA LUCI;74;86004;26/3/2001 18:17:00;INICIATIVA;S;0;CINQUENTENARIO;BH;606844.52;791890.31;3964
+3966;2001165647;B03000;AMEACA;RUA JAVARI;1176;37204;26/3/2001 18:41:00;CIDADAO COMUM;S;0;RENASCENCA;BH;610764.64;800500.36;3965
+3967;2001165791;B03000;AMEACA;RUA COLETORA A;219;103780;26/3/2001 19:41:00;CIDADAO COMUM;S;;PETROPOLIS;BH;601557.17;786612.31;3966
+3968;2001165812;B06000;LESAO CORPORAL;RUA SAO JOAQUIM;1189;62940;26/3/2001 19:58:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613255.69;799389.27;3967
+3969;2001165838;B03000;AMEACA;RUA MADRE TEREZA;264;96594;26/3/2001 20:11:00;CIDADAO COMUM;N;0;JARDIM EUROPA;BH;608301.76;809616.81;3968
+3970;2001165845;B03000;AMEACA;RUA 1;100;300686;26/3/2001 20:18:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607517.47;811158.32;3969
+3971;2001165865;B06000;LESAO CORPORAL;AV DOS ENGENHEIR;570;103027;26/3/2001 20:27:00;CIDADAO COMUM;N;AP204;CONJUNTO ALIPIO ;BH;604325.61;800713.15;3970
+3972;2001165906;B06000;LESAO CORPORAL;RUA PADRE BELCHI;323;51240;26/3/2001 20:54:00;INICIATIVA;S;0;CENTRO (BH);BH;610835.72;796709.76;3971
+3973;2001166016;B06000;LESAO CORPORAL;RUA BOLIVAR;206;9871;26/3/2001 22:09:00;CIDADAO COMUM;N;;UNIAO;BH;612670.70;801380.95;3972
+3974;2001166068;B03000;AMEACA;RUA JOAO CANDIDO;30;93240;26/3/2001 22:37:00;INICIATIVA;S;0;INDEPENDENCIA;BH;601117.42;785918.74;3973
+3975;2001166095;B03000;AMEACA;RUA NOVA FRIBURG;389;48438;26/3/2001 22:55:00;CIDADAO COMUM;S;0;SENHOR BOM JESUS;BH;609623.52;799755.41;3974
+3976;2001166131;B03000;AMEACA;RUA DOS BOROROS;58;10216;26/3/2001 23:15:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;606568.60;807503.10;3975
+3977;2001166142;B03000;AMEACA;RUA JOAO BATISTA;10;97745;26/3/2001 23:21:00;CIDADAO COMUM;S;0;DOM SILVERIO;BH;614734.92;804019.88;3976
+3978;2001166237;B03000;AMEACA;RUA EXPEDICIONAR;119;27068;27/3/2001 00:38:00;CIDADAO COMUM;N;0;ADELAIDE;BH;607311.27;798455.73;3977
+3979;2001166301;B03000;AMEACA;RUA CHAFARIZ;101;300275;27/3/2001 01:46:00;CIDADAO COMUM;S;;HAVAI;BH;607375.81;793751.13;3978
+3980;2001166424;B04001;HOMICIDIO TENTAD;RUA CABROBO;179;11187;27/3/2001 03:42:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;613152.24;799131.49;3979
+3981;2001166592;B03000;AMEACA;RUA CURITIBA;34;19090;27/3/2001 08:02:00;INICIATIVA;S;0;CENTRO BH;BH;610999.16;797826.98;3980
+3982;2001166788;B03000;AMEACA;RUA DARIO FARIA ;172;39240;27/3/2001 09:52:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604413.16;792527.74;3981
+3983;2001166852;B03000;AMEACA;RUA RIO NEGRO;490;58804;27/3/2001 10:37:00;CIDADAO COMUM;S;;BARROCA;BH;608240.20;796055.77;3982
+3984;2001166886;B03000;AMEACA;AV PRESIDENTE CA;3001;55125;27/3/2001 10:53:00;POLICIAL MILITAR;S;0;CAICARA;BH;608178.06;800324.32;3983
+3985;2001166925;B03000;AMEACA;RUA INES GLANSMA;880;34511;27/3/2001 11:20:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615208.26;807133.98;3984
+3986;2001166932;B03000;AMEACA;RUA MARIA DO CAR;15;83236;27/3/2001 11:24:00;CIDADAO COMUM;S;0;SANTA CRUZ (BARR;BH;603386.16;789142.95;3985
+3987;2001167019;B03000;AMEACA;RUA GUANABARA;714;32040;27/3/2001 12:16:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611362.74;799465.31;3986
+3988;2001167193;B06000;LESAO CORPORAL;RUA MOEMA;384;46070;27/3/2001 14:16:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606492.20;797861.20;3987
+3989;2001167241;B04002;HOMICIDIO CONSUM;BECO PAI JOAQUIM;251;171056;27/3/2001 14:43:00;CIDADAO COMUM;N;;CABANA;BH;604642.25;793982.11;3988
+3990;2001167247;B03000;AMEACA;RUA DA PAZ;30;31236;27/3/2001 14:46:00;CIDADAO COMUM;S;;CONJ HAB JARDIM ;BH;603953.08;798167.57;3989
+3991;2001167277;B03000;AMEACA;RUA HUMBERTO ROD;31;15480;27/3/2001 15:01:00;CIDADAO COMUM;N;CAFU;GOIANIA;BH;615645.47;803559.43;3990
+3992;2001167280;B06000;LESAO CORPORAL;RUA SERGIO MIRAN;47;80644;27/3/2001 15:03:00;CIDADAO COMUM;S;;OURO PRETO;BH;606189.60;801803.75;3991
+3993;2001167507;B03000;AMEACA;RUA DOS CAETES;657;11376;27/3/2001 17:10:00;POLICIAL MILITAR;N;0;CENTRO (BH);BH;610996.07;797471.77;3992
+3994;2001167580;B04001;HOMICIDIO TENTAD;ESTRADA DO CERCA;2350;26428;27/3/2001 17:45:00;CIDADAO COMUM;N;0;JARDIM AMERICA;BH;607601.11;793409.02;3993
+3995;2001167669;B03000;AMEACA;RUA SAO SALVADOR;46;63612;27/3/2001 18:31:00;CIDADAO COMUM;S;AP001;BONFIM;BH;610151.37;797963.59;3994
+3996;2001167896;B06000;LESAO CORPORAL;BECO TIA ANASTAC;25;301677;27/3/2001 20:22:00;CIDADAO COMUM;S;0;FAZENDINHA;BH;614673.21;795432.98;3995
+3997;2001167906;B03000;AMEACA;RUA FLOR DE VIDR;20;13504;27/3/2001 20:26:00;CIDADAO COMUM;S;AGUARDA NO FINAL;CASTELO;BH;605624.05;799447.30;3996
+3998;2001167922;B04001;HOMICIDIO TENTAD;AV PORTUGAL;3009;54816;27/3/2001 20:39:00;INICIATIVA;S;0;JARDIM ATLANTICO;BH;605742.12;805959.60;3997
+3999;2001167934;B03000;AMEACA;RODOVIA MGT 262;300;26598;27/3/2001 20:44:00;CIDADAO COMUM;S;;VILA BRASILIA;BH;614660.37;803506.34;3998
+4000;2001167943;B02000;RIXA;AV PRUDENTE DE M;720;55774;27/3/2001 20:51:00;CIDADAO COMUM;S;AP501;CORACAO DE JESUS;BH;610001.43;794654.44;3999
+4001;2001167958;B03000;AMEACA;RUA ENEIDA;328;25494;27/3/2001 21:03:00;CIDADAO COMUM;S;;PATROCINIO;BH;603602.88;799173.27;4000
+4002;2001167977;B03000;AMEACA;RUA ADAO MACIEL;185;106429;27/3/2001 21:15:00;CIDADAO COMUM;S;0;PRIMEIRO DE NOVE;BH;612581.61;805228.97;4001
+4003;2001167993;B06000;LESAO CORPORAL;RUA MARIA AMELIA;841;43812;27/3/2001 21:29:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610257.12;805510.06;4002
+4004;2001168075;B04001;HOMICIDIO TENTAD;RUA XINGU;560;73871;27/3/2001 22:21:00;CIDADAO COMUM;S;0;SANTA LUCIA;BH;609764.51;791271.71;4003
+4005;2001168080;B03000;AMEACA;RUA MARIA DE LOU;344;50540;27/3/2001 22:24:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;604339.53;792318.45;4004
+4006;2001168087;B06000;LESAO CORPORAL;RUA JACUI;3930;36734;27/3/2001 22:32:00;CIDADAO COMUM;S;;IPIRANGA;BH;611988.07;801551.26;4005
+4007;2001168118;B06000;LESAO CORPORAL;RUA BOM JESUS DO;39;42012;27/3/2001 22:46:00;CIDADAO COMUM;N;CAFRENT;CAMPO ALEGRE;BH;610264.60;806691.71;4006
+4008;2001168179;B04001;HOMICIDIO TENTAD;BECO LORENCO SIL;127;302105;27/3/2001 23:17:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605675.37;807168.57;4007
+4009;2001168190;B03000;AMEACA;RUA PROCOPIO FER;153;92552;27/3/2001 23:22:00;CIDADAO COMUM;S;;CALIFORNIA;BH;603463.88;796859.04;4008
+4010;2001168195;B06000;LESAO CORPORAL;RUA JORNALISTA D;65;122810;27/3/2001 23:23:00;CIDADAO COMUM;S;;BELVEDERE;BH;610550.50;791457.63;4009
+4011;2001168232;B05000;SEQUESTRO E CARC;AV BRAULIO GOMES;1453;81710;27/3/2001 23:46:00;CIDADAO COMUM;N;0;TIROL;BH;599864.95;789210.47;4010
+4012;2001168235;B03000;AMEACA;RUA ITAMBACURI;291;35570;27/3/2001 23:46:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608250.07;797536.60;4011
+4013;2001168245;B06000;LESAO CORPORAL;AV SANTOS DUMONT;574;61950;27/3/2001 23:52:00;INICIATIVA;S;0;CENTRO BH;BH;611085.24;797586.10;4012
+4014;2001168246;B03000;AMEACA;RUA CALAFATE;35;24044;27/3/2001 23:51:00;CIDADAO COMUM;N;;TAQUARIL;BH;617670.37;797320.52;4013
+4015;2001168283;B06000;LESAO CORPORAL;RUA CORNELIO CER;23;17417;28/3/2001 00:29:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606440.81;797810.81;4014
+4016;2001168289;B03000;AMEACA;RUA FLORALIA;40;28883;28/3/2001 00:32:00;INICIATIVA;S;0;ANCHIETA;BH;612042.63;794110.01;4015
+4017;2001168303;B03000;AMEACA;RUA JOAO DE MATO;6;37800;28/3/2001 00:47:00;CIDADAO COMUM;N;FR;IPIRANGA;BH;611683.83;800766.83;4016
+4018;2001168318;B03000;AMEACA;RUA CONCEICAO OL;275;108579;28/3/2001 01:05:00;CIDADAO COMUM;S;0;VILA SANTO ANTON;BH;609315.71;808212.65;4017
+4019;2001168326;B03000;AMEACA;AV VILARINHOS;1271;109988;28/3/2001 01:11:00;INICIATIVA;N;0;VENDA NOVA;BH;608853.02;808991.96;4018
+4020;2001168350;B04001;HOMICIDIO TENTAD;AV SILVIANO BRAN;2301;66002;28/3/2001 01:34:00;CIDADAO COMUM;S;;HORTO;BH;613485.88;798221.24;4019
+4021;2001168379;B03000;AMEACA;RUA AUGUSTA ANDR;1163;99104;28/3/2001 02:02:00;CIDADAO COMUM;S;;JAQUELINE;BH;611767.30;810612.10;4020
+4022;2001168393;B03000;AMEACA;RUA DO BATISMO;493;8390;28/3/2001 02:19:00;CIDADAO COMUM;N;;SAO JOSE;BH;605325.95;798900.22;4021
+4023;2001168607;B03000;AMEACA;RUA RADIALISTA A;120;122445;28/3/2001 07:54:00;CIDADAO COMUM;N;;CEU AZUL;BH;604759.99;808626.41;4022
+4024;2001168620;B03000;AMEACA;BECO SANTA CATAR;26;170255;28/3/2001 07:59:00;CIDADAO COMUM;S;FU;CABANA;BH;604766.78;794259.59;4023
+4025;2001168649;B03000;AMEACA;RUA JOAO ANTONIO;160;122054;28/3/2001 08:17:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607884.02;810802.11;4024
+4026;2001168712;B03000;AMEACA;AV FRANCISCO SA;334;29656;28/3/2001 08:55:00;CIDADAO COMUM;S;0;PRADO;BH;608934.20;796443.88;4025
+4027;2001168746;B03000;AMEACA;RUA SAO FELICISS;153;62373;28/3/2001 09:09:00;INICIATIVA;S;0;ESTRELA DO ORIEN;BH;605823.49;792412.58;4026
+4028;2001168771;B03000;AMEACA;AV BRIGADEIRO ED;1921;2860;28/3/2001 09:23:00;CIDADAO COMUM;S;0;PATROCINIO;BH;603691.51;799509.80;4027
+4029;2001168810;B09000;ABANDONO DE INCA;RUA CAMILO PRATE;35;11915;28/3/2001 09:47:00;CIDADAO COMUM;N;CAA;UNIAO;BH;613017.76;801351.18;4028
+4030;2001168828;B03000;AMEACA;RUA TOME DE SOUZ;248;67998;28/3/2001 09:56:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;612136.30;795032.33;4029
+4031;2001168833;B06000;LESAO CORPORAL;AV SARAMENHA;354;64007;28/3/2001 10:00:00;INICIATIVA;S;0;FLORAMAR;BH;612099.17;805663.93;4030
+4032;2001169124;B06000;LESAO CORPORAL;RUA PADRE EUSTAQ;2232;51294;28/3/2001 13:34:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;607452.58;797649.52;4031
+4033;2001169162;B03000;AMEACA;AV NELIO CERQUEI;15;72359;28/3/2001 14:05:00;CIDADAO COMUM;S;UNIDADE DE URGEN;TIROL;BH;600947.66;789885.51;4032
+4034;2001169278;B03000;AMEACA;RUA ANTONIO JOSE;67;4635;28/3/2001 15:10:00;CIDADAO COMUM;S;201;CAICARA;BH;607554.63;800226.83;4033
+4035;2001169311;B03000;AMEACA;AV AFONSO PENA;1452;1259;28/3/2001 15:28:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611506.40;796458.35;4034
+4036;2001169314;B04002;HOMICIDIO CONSUM;RUA GONCALVES MA;25;31567;28/3/2001 15:31:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607990.26;807452.46;4035
+4037;2001169339;B06000;LESAO CORPORAL;RUA RADIALISTA P;120;98909;28/3/2001 15:44:00;CIDADAO COMUM;S;;CEU AZUL;BH;604177.44;808465.20;4036
+4038;2001169403;B03000;AMEACA;RUA JOSE BARTOLO;129;38525;28/3/2001 16:19:00;CIDADAO COMUM;S;0;CONJUNTO ALIPIO ;BH;603704.00;799565.04;4037
+4039;2001169447;B03000;AMEACA;RUA BARAO DE GUA;260;7923;28/3/2001 16:50:00;CIDADAO COMUM;S;AP04;JOAO PINHEIRO;BH;604824.14;796178.48;4038
+4040;2001169462;B03000;AMEACA;RUA POUSO ALEGRE;538;54932;28/3/2001 16:56:00;CIDADAO COMUM;S;0;FLORESTA;BH;611588.94;797985.47;4039
+4041;2001169483;B03000;AMEACA;RUA AVEIRO;865;60715;28/3/2001 17:07:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;608907.00;801541.82;4040
+4042;2001169527;B03000;AMEACA;RUA ERNESTO TOGN;83;129850;28/3/2001 17:37:00;CIDADAO COMUM;S;;GORDURAS;BH;616434.31;803881.80;4041
+4043;2001169558;B03000;AMEACA;RUA CAMBOATA;90;106230;28/3/2001 17:53:00;CIDADAO COMUM;S;;PATROCINIO;BH;605068.16;794132.71;4042
+4044;2001169597;B03000;AMEACA;RUA INDEPENDENCI;1009;34391;28/3/2001 18:15:00;CIDADAO COMUM;S;;CABANA;BH;605985.71;793145.38;4043
+4045;2001169603;B03000;AMEACA;RUA DONA LUIZA;600;22947;28/3/2001 18:20:00;CIDADAO COMUM;N;BL L,APTO 303;MILIONARIOS;BH;604360.74;789993.13;4044
+4046;2001169616;B03000;AMEACA;RUA ALVARES RUBI;98;2769;28/3/2001 18:28:00;INICIATIVA;N;0;TUPI;BH;612206.64;806160.80;4045
+4047;2001169636;B03000;AMEACA;RUA SAFIRA;95;59835;28/3/2001 18:44:00;CIDADAO COMUM;S;;PRADO;BH;608617.43;796702.89;4046
+4048;2001169681;B03000;AMEACA;RODOVIA BRASILIA;80;124400;28/3/2001 19:05:00;INICIATIVA;N;0;SAO BENEDITO (SL;SL;610627.87;810496.47;4047
+4049;2001169694;B03000;AMEACA;RUA ISLANDIA;25;83683;28/3/2001 19:10:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;607785.96;810027.21;4048
+4050;2001169699;B03000;AMEACA;RUA JACAREI;123;36586;28/3/2001 19:11:00;CIDADAO COMUM;S;0;PIRATININGA;BH;606579.01;809587.17;4049
+4051;2001169844;B06000;LESAO CORPORAL;RUA MARECHAL RON;186;43677;28/3/2001 20:28:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611903.65;803402.26;4050
+4052;2001169849;B03000;AMEACA;RUA MONTE VIRGIN;295;46587;28/3/2001 20:31:00;INICIATIVA;S;0;MINASLANDIA;BH;612149.14;804944.69;4051
+4053;2001169914;B06000;LESAO CORPORAL;RUA CARMEM MIRAN;35;13605;28/3/2001 21:03:00;CIDADAO COMUM;S;0;TUPI;BH;612518.22;806227.57;4052
+4054;2001169921;B03000;AMEACA;RUA SANTA CLARA ;159;49295;28/3/2001 21:12:00;CIDADAO COMUM;S;;MINASLANDIA;BH;611739.23;804154.31;4053
+4055;2001169989;B03000;AMEACA;RUA VILA REAL;904;60683;28/3/2001 21:56:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609535.45;801659.70;4054
+4056;2001170010;B03000;AMEACA;RUA JAIME SALSE;278;36848;28/3/2001 22:13:00;INICIATIVA;S;0;MAGNESITA;BH;604022.14;793879.98;4055
+4057;2001170051;B03000;AMEACA;RUA CASABLANCA;839;13850;28/3/2001 22:41:00;CIDADAO COMUM;N;CAB;SANTA TEREZINHA;BH;604208.62;803104.88;4056
+4058;2001170094;B09000;ABANDONO DE INCA;RUA A;135;99489;28/3/2001 23:05:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;614971.05;808005.92;4057
+4059;2001170095;B06000;LESAO CORPORAL;RUA GUARATINGUET;87;32295;28/3/2001 23:08:00;CIDADAO COMUM;S;0;GUARANI;BH;612643.64;805626.34;4058
+4060;2001170096;B06000;LESAO CORPORAL;RUA DOS VIOLINOS;135;101797;28/3/2001 23:07:00;CIDADAO COMUM;S;0;CH CALIFORNIA;BH;603865.45;796695.57;4059
+4061;2001170160;B04001;HOMICIDIO TENTAD;RUA FELIPE CAMAR;12;27938;28/3/2001 23:48:00;CIDADAO COMUM;N;0;ESPLANADA;BH;613862.69;798419.73;4060
+4062;2001170163;B03000;AMEACA;RUA DO CARMO;170;13646;28/3/2001 23:51:00;CIDADAO COMUM;S;0;ITAIPU BH;BH;599008.41;789438.00;4061
+4063;2001170278;B06000;LESAO CORPORAL;RUA ANTONIO DE A;156;4345;29/3/2001 01:43:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611821.42;794964.79;4062
+4064;2001170285;B06000;LESAO CORPORAL;PRACA DUQUE DE C;39;24145;29/3/2001 01:54:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;613405.86;797477.21;4063
+4065;2001170301;B03000;AMEACA;RUA FLOR DO ORIE;398;50190;29/3/2001 02:21:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606173.97;799884.28;4064
+4066;2001170313;B03000;AMEACA;RUA ESTADOS UNID;271;26239;29/3/2001 02:36:00;CIDADAO COMUM;S;;COPACABANA;BH;606171.40;806197.79;4065
+4067;2001170328;B02000;RIXA;RUA DOS CAETES;409;11376;29/3/2001 02:52:00;CIDADAO COMUM;S;PX409;CENTRO (BH);BH;611212.90;797410.52;4066
+4068;2001170385;B06000;LESAO CORPORAL;RUA JUAZEIRO DO ;8;64873;29/3/2001 04:16:00;CIDADAO COMUM;N;0;ANTONIO RIBEIRO ;BH;615003.76;806779.18;4067
+4069;2001170507;B03000;AMEACA;RUA OTAVIANO NEV;235;94517;29/3/2001 07:16:00;CIDADAO COMUM;N;AP601;OURO PRETO;BH;606299.39;801104.52;4068
+4070;2001170640;B06000;LESAO CORPORAL;RUA JACUI;1131;36734;29/3/2001 08:36:00;CIDADAO COMUM;N;;CONCORDIA;BH;611706.90;799025.84;4069
+4071;2001170642;B03000;AMEACA;RUA SAO JOAO DE ;36;110073;29/3/2001 08:35:00;CIDADAO COMUM;N;0;PILAR;BH;607619.96;788690.43;4070
+4072;2001170910;B06000;LESAO CORPORAL;RUA GONCALVES DI;1116;31513;29/3/2001 11:38:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611468.71;795788.77;4071
+4073;2001171007;B03000;AMEACA;RUA OSORIO DUQUE;102;128136;29/3/2001 12:45:00;CIDADAO COMUM;S;;CAMPO ALEGRE;BH;610441.32;806709.79;4072
+4074;2001171073;B06000;LESAO CORPORAL;RUA MONTE ALEGRE;28;46357;29/3/2001 13:33:00;INICIATIVA;S;0;SERRA;BH;612538.37;795198.21;4073
+4075;2001171095;B03000;AMEACA;RUA C;53;102503;29/3/2001 13:47:00;CIDADAO COMUM;N;0;INDEPENDENCIA;BH;601649.58;786316.25;4074
+4076;2001171102;B06000;LESAO CORPORAL;RUA ITABIRA;493;35237;29/3/2001 13:56:00;CIDADAO COMUM;N;;LAGOINHA;BH;610931.11;798451.36;4075
+4077;2001171104;B06000;LESAO CORPORAL;RUA JOAO CAMPOS;114;48019;29/3/2001 13:58:00;CIDADAO COMUM;N;;CASTANHEIRA 2;BH;601623.61;788750.02;4076
+4078;2001171119;B06000;LESAO CORPORAL;RUA SERRINHA;53;129201;29/3/2001 14:07:00;CIDADAO COMUM;N;;MANGUEIRAS;BH;600519.25;786719.95;4077
+4079;2001171125;B06000;LESAO CORPORAL;RUA SAO DOMINGOS;360;62332;29/3/2001 14:10:00;CIDADAO COMUM;S;AP01;SANTO ANTONIO;BH;611078.05;794339.79;4078
+4080;2001171137;B03000;AMEACA;RUA RUBI;486;59517;29/3/2001 14:13:00;INICIATIVA;S;0;PRADO;BH;608575.67;796298.16;4079
+4081;2001171180;B03000;AMEACA;RUA DOS GUAJAJAR;496;32037;29/3/2001 14:37:00;CIDADAO COMUM;N;;LOURDES;BH;611128.51;796461.69;4080
+4082;2001171302;B03000;AMEACA;RUA SAO RAFAEL;138;63580;29/3/2001 15:38:00;CIDADAO COMUM;S;;FLORESTA;BH;612241.79;798264.50;4081
+4083;2001171305;B03000;AMEACA;RUA MERCEDES LUI;519;45483;29/3/2001 15:39:00;CIDADAO COMUM;S;;PIRAJA;BH;613947.54;803042.92;4082
+4084;2001171354;B03000;AMEACA;RUA DAS ARTEMISI;292;6091;29/3/2001 16:00:00;INICIATIVA;S;0;PARQUE SAO JOSE;BH;606852.54;792578.14;4083
+4085;2001171357;B06000;LESAO CORPORAL;AV JOAO PINHEIRO;467;37853;29/3/2001 16:01:00;CIDADAO COMUM;S;AP203;FUNCIONARIOS;BH;611292.51;796021.38;4084
+4086;2001171376;B03000;AMEACA;RUA NUNES VIEIRA;227;48932;29/3/2001 16:09:00;CIDADAO COMUM;S;POSTO MENINI DE ;SANTO ANTONIO;BH;610298.96;794576.25;4085
+4087;2001171419;B03000;AMEACA;RUA CAMILO PRATE;255;11915;29/3/2001 16:32:00;CIDADAO COMUM;N;CA3;UNIAO;BH;613231.52;801243.96;4086
+4088;2001171447;B03000;AMEACA;RUA HORIZONTE;375;33405;29/3/2001 16:53:00;CIDADAO COMUM;S;FR1661;PARAISO;BH;614681.90;796440.16;4087
+4089;2001171451;B06000;LESAO CORPORAL;RUA SATELITE;411;64076;29/3/2001 16:54:00;CIDADAO COMUM;S;;ADELAIDE;BH;607421.50;799006.29;4088
+4090;2001171470;B03000;AMEACA;RUA DES BRAULIO;1670;19917;29/3/2001 17:04:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;616312.54;797548.95;4089
+4091;2001171499;B03000;AMEACA;RUA TEREZOPOLIS;65;26140;29/3/2001 17:15:00;CIDADAO COMUM;S;;TAQUARIL;BH;617459.03;797908.71;4090
+4092;2001171517;B06000;LESAO CORPORAL;RUA GUIA LOBO;30;32430;29/3/2001 17:24:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604560.55;789502.59;4091
+4093;2001171567;B06000;LESAO CORPORAL;PRACA DA LIBERDA;87;40870;29/3/2001 17:51:00;INICIATIVA;N;0;LOURDES;BH;611248.83;795658.19;4092
+4094;2001171622;B06000;LESAO CORPORAL;RUA DOM SEBASTIA;576;22455;29/3/2001 18:21:00;CIDADAO COMUM;N;;COPACABANA;BH;605770.79;806817.25;4093
+4095;2001171623;B06000;LESAO CORPORAL;RUA COSTA MACHAD;402;18334;29/3/2001 18:20:00;CIDADAO COMUM;S;;UNIVERSITARIO;BH;610772.74;802837.58;4094
+4096;2001171630;B06000;LESAO CORPORAL;RUA PAULO TIMOTE;175;41918;29/3/2001 18:25:00;CIDADAO COMUM;S;;VILA HUMAITA;BH;610336.11;801567.61;4095
+4097;2001171682;B03000;AMEACA;RUA DOS INDUSTRI;1247;34480;29/3/2001 18:50:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605216.21;791703.04;4096
+4098;2001171691;B06000;LESAO CORPORAL;RUA PARANAN;401;52271;29/3/2001 18:55:00;CIDADAO COMUM;N;FU;BONSUCESSO;BH;605204.95;790235.82;4097
+4099;2001171802;B03000;AMEACA;RUA HOFFMAN;80;33320;29/3/2001 19:37:00;CIDADAO COMUM;S;;SANTA CRUZ (BARR;BH;603694.24;789400.31;4098
+4100;2001171878;B06000;LESAO CORPORAL;RUA SAO TOMAS DE;787;63782;29/3/2001 20:29:00;CIDADAO COMUM;S;;MORRO DO PAPAGAI;BH;610797.04;793270.28;4099
+4101;2001171901;B03000;AMEACA;RUA DR BROCHADO;103;23215;29/3/2001 20:43:00;CIDADAO COMUM;N;CA55;VERA CRUZ;BH;615814.74;798592.95;4100
+4102;2001172111;B06000;LESAO CORPORAL;AV PRESIDENTE AN;2873;4461;29/3/2001 22:51:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;609839.13;800672.59;4101
+4103;2001172118;B06000;LESAO CORPORAL;RUA PATRICIO BAR;159;106661;29/3/2001 22:56:00;CIDADAO COMUM;N;;CH CALIFORNIA DO;BH;603497.76;797154.52;4102
+4104;2001172134;B03000;AMEACA;RUA CONSELHEIRO ;2957;17095;29/3/2001 23:08:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;614206.34;797690.26;4103
+4105;2001172324;B06000;LESAO CORPORAL;RUA NUMA NOGUEIR;111;48920;30/3/2001 01:07:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611850.13;806046.56;4104
+4106;2001172327;B08000;VIOLACAO DE DOMI;RUA SESSENTA E U;161;33689;30/3/2001 01:11:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612458.15;806921.58;4105
+4107;2001172331;B03000;AMEACA;RUA FERNAO DIAS;1223;28133;30/3/2001 01:15:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616164.18;797853.81;4106
+4108;2001172372;B06000;LESAO CORPORAL;RUA SERGIPE;1456;64961;30/3/2001 01:45:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611092.98;794935.73;4107
+4109;2001172427;B03000;AMEACA;RUA ARACAJU;169;5275;30/3/2001 02:52:00;CIDADAO COMUM;N;;SANTO ANDRE;BH;609468.69;799249.95;4108
+4110;2001172428;B06000;LESAO CORPORAL;AV GETULIO VARGA;263;81256;30/3/2001 02:52:00;CIDADAO COMUM;N;PX263;FUNCIONARIOS;BH;612405.05;795576.33;4109
+4111;2001172518;B04001;HOMICIDIO TENTAD;RUA SANTO AGOSTI;1271;61557;30/3/2001 05:29:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613648.90;799370.40;4110
+4112;2001172710;B03000;AMEACA;RUA SALINAS;2113;59992;30/3/2001 08:43:00;CIDADAO COMUM;N;;SANTA TEREZA;BH;613571.20;797710.20;4111
+4113;2001172712;B06000;LESAO CORPORAL;AV BIAS FORTES;1772;9553;30/3/2001 08:45:00;CIDADAO COMUM;S;PX1772;BARRO PRETO;BH;610196.72;797244.85;4112
+4114;2001172843;B06000;LESAO CORPORAL;BECO CARTOLA;10;301689;30/3/2001 10:01:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614408.03;795249.56;4113
+4115;2001172891;B03000;AMEACA;RUA DAS CLARINET;75;9119;30/3/2001 10:35:00;CIDADAO COMUM;S;;CH CALIFORNIA;BH;603994.02;796604.11;4114
+4116;2001173002;B03000;AMEACA;RUA IRIBA;276;35007;30/3/2001 11:51:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610507.65;800899.30;4115
+4117;2001173075;B06000;LESAO CORPORAL;RUA ANTONIO TEIX;2056;119037;30/3/2001 12:48:00;CIDADAO COMUM;S;;TEIXEIRA DIAS;BH;603154.87;789443.56;4116
+4118;2001173132;B03000;AMEACA;AV DOM PEDRO II;3249;53145;30/3/2001 13:19:00;CIDADAO COMUM;S;;ADELAIDE;BH;607698.05;797913.20;4117
+4119;2001173160;B03000;AMEACA;RUA RAMIRO SIQUE;165;128858;30/3/2001 13:34:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617702.63;797351.00;4118
+4120;2001173205;B06000;LESAO CORPORAL;RUA TEREZINHA FR;155;105136;30/3/2001 14:01:00;CIDADAO COMUM;S;0;DAS INDUSTRIAS;BH;605492.99;791083.70;4119
+4121;2001173330;B03000;AMEACA;RUA CINQUENTA;203;302845;30/3/2001 15:25:00;CIDADAO COMUM;S;;TUPI;BH;614197.66;805513.25;4120
+4122;2001173412;B06000;LESAO CORPORAL;RUA PADRE LAGE;19;4610;30/3/2001 16:10:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604640.37;797142.70;4121
+4123;2001173413;B06000;LESAO CORPORAL;RUA JOSAFA BELO;77;38364;30/3/2001 16:11:00;INICIATIVA;N;0;CIDADE JARDIM;BH;610011.54;795221.71;4122
+4124;2001173552;B04002;HOMICIDIO CONSUM;RUA MARIA ROSA D;150;107800;30/3/2001 17:26:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606011.75;811304.95;4123
+4125;2001173597;B06000;LESAO CORPORAL;RUA CELIA COSTA;31;105149;30/3/2001 17:45:00;CIDADAO COMUM;S;;PATROCINIO;BH;604016.70;799013.81;4124
+4126;2001173605;B04001;HOMICIDIO TENTAD;RUA LASSANCE;548;84415;30/3/2001 17:49:00;INICIATIVA;N;0;BOA VISTA;BH;615768.49;799690.36;4125
+4127;2001173695;B06000;LESAO CORPORAL;RUA TIMOTEO;448;69688;30/3/2001 18:43:00;CIDADAO COMUM;N;;SANTA INES;BH;614007.96;800435.59;4126
+4128;2001173701;B03000;AMEACA;RUA QUATRO;221;79588;30/3/2001 18:47:00;CIDADAO COMUM;S;;LINDEIA;BH;599659.25;790421.07;4127
+4129;2001173712;B03000;AMEACA;RUA EX-COMBATENT;180;19784;30/3/2001 18:55:00;CIDADAO COMUM;S;;SAO PAULO;BH;613081.65;802874.53;4128
+4130;2001173727;B06000;LESAO CORPORAL;AV BERNARDO MONT;879;9392;30/3/2001 19:05:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;612245.04;796346.92;4129
+4131;2001173744;B03000;AMEACA;RUA CORONEL ANTO;182;17590;30/3/2001 19:13:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;606140.28;807563.65;4130
+4132;2001173821;B03000;AMEACA;RUA FRANCA;48;29224;30/3/2001 19:57:00;CIDADAO COMUM;S;0;JARDIM AMERICA;BH;607503.92;794169.65;4131
+4133;2001173833;B04001;HOMICIDIO TENTAD;AV AUGUSTO DE LI;2109;6731;30/3/2001 20:08:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;609263.62;797044.80;4132
+4134;2001173857;B04002;HOMICIDIO CONSUM;AV COLETORA;478;78241;30/3/2001 20:21:00;INICIATIVA;N;0;VILA PINHO;BH;602113.34;788183.02;4133
+4135;2001173869;B04001;HOMICIDIO TENTAD;RUA ALGARVE;735;61396;30/3/2001 20:28:00;CIDADAO COMUM;N;CAA;SAO FRANCISCO;BH;609186.09;801896.95;4134
+4136;2001173891;B04002;HOMICIDIO CONSUM;RUA PRINCIPAL;428;300224;30/3/2001 20:39:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610510.27;793309.97;4135
+4137;2001173905;B03000;AMEACA;RUA DOUTOR BENED;1540;12252;30/3/2001 20:52:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;613682.32;803992.93;4136
+4138;2001173954;B03000;AMEACA;RUA JOSE BARTOLO;38;38525;30/3/2001 21:13:00;CIDADAO COMUM;S;;CONJUNTO ALIPIO ;BH;603707.54;799638.81;4137
+4139;2001174009;B03000;AMEACA;RUA HENRIQUE HOR;1324;88170;30/3/2001 21:52:00;CIDADAO COMUM;S;0;PLANALTO;BH;609649.18;806260.00;4138
+4140;2001174055;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;4000;18652;30/3/2001 22:25:00;INICIATIVA;N;0;DOS PALMARES;BH;612434.91;802092.92;4139
+4141;2001174066;B06000;LESAO CORPORAL;RUA ROSA NEGRA;227;124481;30/3/2001 22:34:00;CIDADAO COMUM;S;FU;ETELVINA CARNEIR;BH;611506.11;809123.86;4140
+4142;2001174092;B03000;AMEACA;AV GANDHI;293;76160;30/3/2001 22:54:00;CIDADAO COMUM;N;;VILA SANTA LUZIA;CO;603027.36;801996.15;4141
+4143;2001174111;B06000;LESAO CORPORAL;AV NOSSA SENHORA;1800;47996;30/3/2001 23:05:00;INICIATIVA;S;0;SAO PEDRO;BH;611086.35;793436.77;4142
+4144;2001174167;B06000;LESAO CORPORAL;RUA FLOR DE PAU;23;80294;30/3/2001 23:38:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;605654.63;799232.62;4143
+4145;2001174173;B06000;LESAO CORPORAL;RUA INHAMBU;40;56490;30/3/2001 23:39:00;CIDADAO COMUM;S;0;GOIANIA;BH;615378.23;802857.04;4144
+4146;2001174186;B03000;AMEACA;RUA MARIA BEATRI;606;43881;30/3/2001 23:52:00;CIDADAO COMUM;S;AP202;HAVAI;BH;606879.73;793253.08;4145
+4147;2001174232;B03000;AMEACA;RODOVIA MGT 262;291;26598;31/3/2001 00:19:00;CIDADAO COMUM;S;0;VILA BRASILIA;BH;614731.31;803443.10;4146
+4148;2001174260;B03000;AMEACA;RUA POUSO ALEGRE;2312;54932;31/3/2001 00:33:00;CIDADAO COMUM;S;BLC     AP106;FLORESTA;BH;613332.91;797870.75;4147
+4149;2001174296;B06000;LESAO CORPORAL;RUA AUGUSTO MEIE;230;6757;31/3/2001 00:52:00;CIDADAO COMUM;S;0;TUPI;BH;613793.27;806006.25;4148
+4150;2001174333;B04001;HOMICIDIO TENTAD;RUA MELODIA;53;301462;31/3/2001 01:09:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614240.36;795425.90;4149
+4151;2001174340;B06000;LESAO CORPORAL;RUA MARIA REGINA;759;124771;31/3/2001 01:12:00;INICIATIVA;S;0;CEU AZUL;BH;604595.45;807095.92;4150
+4152;2001174489;B02000;RIXA;AV SANTOS DUMONT;574;61950;31/3/2001 02:41:00;CIDADAO COMUM;S;PX587;CENTRO (BH);BH;611085.24;797586.10;4151
+4153;2001174547;B06000;LESAO CORPORAL;AV ERICO VERISSI;1000;41671;31/3/2001 03:19:00;INICIATIVA;S;0;SANTA MONICA;BH;607768.47;808762.85;4152
+4154;2001174555;B06000;LESAO CORPORAL;RUA CELIA DE SOU;671;14488;31/3/2001 03:23:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612595.85;798676.48;4153
+4155;2001174608;B03000;AMEACA;RUA CLOVIS DE CA;20;16064;31/3/2001 04:00:00;INICIATIVA;S;0;FLORAMAR;BH;612214.25;805793.87;4154
+4156;2001174621;B04001;HOMICIDIO TENTAD;RUA CAMBOATA;3;106230;31/3/2001 04:08:00;INICIATIVA;N;0;PATROCINIO;BH;605142.92;794077.66;4155
+4157;2001174721;B06000;LESAO CORPORAL;RUA DES CAMPOS;117;19920;31/3/2001 06:04:00;CIDADAO COMUM;S;;INCONFIDENCIA;BH;605053.40;798174.04;4156
+4158;2001174790;B06000;LESAO CORPORAL;RUA INDEPENDENCI;1009;34391;31/3/2001 07:21:00;CIDADAO COMUM;S;;CABANA;BH;605985.71;793145.38;4157
+4159;2001174807;B06000;LESAO CORPORAL;RUA VINTE E OITO;95;106182;31/3/2001 07:47:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;608112.67;810710.07;4158
+4160;2001174832;B03000;AMEACA;RUA PADRE MANOEL;143;51569;31/3/2001 08:07:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;614135.75;796233.74;4159
+4161;2001174957;B08000;VIOLACAO DE DOMI;RUA AGUA MARINHA;39;87744;31/3/2001 09:37:00;CIDADAO COMUM;S;CA;CANDELARIA;BH;607662.50;809375.47;4160
+4162;2001174969;B06000;LESAO CORPORAL;RUA R;2;27231;31/3/2001 09:49:00;CIDADAO COMUM;S;;PAULO SEXTO;BH;616521.94;806858.96;4161
+4163;2001175043;B06000;LESAO CORPORAL;RUA MADRE PAULIN;245;15538;31/3/2001 10:34:00;CIDADAO COMUM;S;;DIAMANTE;BH;601308.14;789709.42;4162
+4164;2001175055;B03000;AMEACA;RUA MUNIZ;360;170850;31/3/2001 10:50:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608153.90;793811.95;4163
+4165;2001175118;B06000;LESAO CORPORAL;RUA DOS CARIJOS;645;81243;31/3/2001 11:33:00;POLICIAL CIVIL;N;;CENTRO (BH);BH;610833.39;797215.72;4164
+4166;2001175169;B03000;AMEACA;AV PARANAIBA;547;52256;31/3/2001 12:06:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609858.31;800010.80;4165
+4167;2001175193;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;1030;300224;31/3/2001 12:32:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610701.80;792989.02;4166
+4168;2001175240;B03000;AMEACA;RUA FILOMENA GAS;177;62083;31/3/2001 13:04:00;CIDADAO COMUM;N;;APARECIDA SETIMA;BH;608447.47;800337.13;4167
+4169;2001175256;B03000;AMEACA;RUA SAO LEOPOLDO;10;63221;31/3/2001 13:17:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610817.96;801203.39;4168
+4170;2001175305;B03000;AMEACA;RUA FLOR DO ORIE;329;50190;31/3/2001 13:54:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606029.07;799987.90;4169
+4171;2001175328;B03000;AMEACA;RUA PARAIBUNA;57;52196;31/3/2001 14:07:00;CIDADAO COMUM;S;CAA;MINASLANDIA;BH;611940.42;804599.42;4170
+4172;2001175359;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;535;63782;31/3/2001 14:26:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610849.00;793420.56;4171
+4173;2001175411;B06000;LESAO CORPORAL;AV BARBACENA;653;8084;31/3/2001 15:02:00;CIDADAO COMUM;N;PRONTO SOCORRO;BARRO PRETO;BH;609636.01;796640.35;4172
+4174;2001175446;B03000;AMEACA;RUA 51;5;302847;31/3/2001 15:30:00;CIDADAO COMUM;N;0;NOVO AARAO REIS;BH;614188.75;805564.70;4173
+4175;2001175500;B03000;AMEACA;RUA K;500;41495;31/3/2001 16:00:00;INICIATIVA;N;0;CH CONFISCO (CO);CO;602570.39;802980.95;4174
+4176;2001175534;B03000;AMEACA;RUA GABRO;23;30435;31/3/2001 16:22:00;CIDADAO COMUM;N;BECO BRILHANTINA;SANTA TEREZA;BH;613006.52;797578.51;4175
+4177;2001175557;B03000;AMEACA;RUA JOVIANO COEL;10;39294;31/3/2001 16:35:00;CIDADAO COMUM;S;AN2;RIO BRANCO;BH;606938.05;808860.20;4176
+4178;2001175560;B03000;AMEACA;RUA PIRAI;54;54062;31/3/2001 16:41:00;CIDADAO COMUM;S;CAC;CONCORDIA;BH;610781.50;799320.53;4177
+4179;2001175564;B04001;HOMICIDIO TENTAD;RUA CAMILA DE SO;37;74294;31/3/2001 16:45:00;CIDADAO COMUM;N;QUI;SAO JOAO BATISTA;BH;608148.92;807536.43;4178
+4180;2001175608;B06000;LESAO CORPORAL;RUA LIGNITO;343;41050;31/3/2001 17:11:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613799.80;796334.31;4179
+4181;2001175617;B03000;AMEACA;RUA MAJOR DELFIN;1214;42620;31/3/2001 17:17:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609652.80;802187.36;4180
+4182;2001175632;B04001;HOMICIDIO TENTAD;RUA MUSAS;206;46993;31/3/2001 17:22:00;CIDADAO COMUM;N;;SANTA LUCIA;BH;610285.02;791421.66;4181
+4183;2001175657;B04001;HOMICIDIO TENTAD;RUA GUAPE;850;32100;31/3/2001 17:38:00;CIDADAO COMUM;N;PADARIA SANTA CR;SANTO ANDRE;BH;609843.76;799014.55;4182
+4184;2001175666;B06000;LESAO CORPORAL;RUA CASTELO DE B;41;124021;31/3/2001 17:40:00;CIDADAO COMUM;N;0;CASTELO;BH;605332.82;801428.56;4183
+4185;2001175688;B06000;LESAO CORPORAL;RUA NEY WERNECK;266;80382;31/3/2001 18:00:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606001.11;800117.22;4184
+4186;2001175806;B06000;LESAO CORPORAL;RUA HELIO LAZZAR;488;127694;31/3/2001 18:57:00;CIDADAO COMUM;S;;CAICARA;BH;607119.32;799646.13;4185
+4187;2001175876;B03000;AMEACA;RUA VISCONDE DE ;166;73380;31/3/2001 19:33:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608052.72;807550.20;4186
+4188;2001175924;B06000;LESAO CORPORAL;RUA NEY WERNECK;200;80382;31/3/2001 19:57:00;CIDADAO COMUM;S;CA03;JARDIM MONTANHES;BH;605920.10;800059.06;4187
+4189;2001175972;B03000;AMEACA;RUA SAO PAULO;124;63464;31/3/2001 20:21:00;INICIATIVA;N;0;CENTRO (BH);BH;611102.49;797669.42;4188
+4190;2001176092;B03000;AMEACA;BECO SAO MIGUEL;19;171002;31/3/2001 21:15:00;CIDADAO COMUM;S;FUNDOS CEM COLIN;CABANA;BH;604847.29;794027.97;4189
+4191;2001176111;B06000;LESAO CORPORAL;RUA CURI;742;19047;31/3/2001 21:29:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615733.51;799053.01;4190
+4192;2001176152;B06000;LESAO CORPORAL;RUA OZANAM;475;50796;31/3/2001 21:56:00;CIDADAO COMUM;N;0;IPIRANGA;BH;611931.96;801078.35;4191
+4193;2001176153;B02000;RIXA;RUA LARANJEIRAS;305;40423;31/3/2001 21:56:00;CIDADAO COMUM;N;0;LEBLON;BH;605695.40;809792.54;4192
+4194;2001176169;B04001;HOMICIDIO TENTAD;RUA ANA FRANCA;200;3529;31/3/2001 22:05:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604638.14;791892.60;4193
+4195;2001176199;B06000;LESAO CORPORAL;AV GOVERNADOR BE;826;67670;31/3/2001 22:25:00;CIDADAO COMUM;N;0;GAMELEIRA;BH;604830.93;795345.21;4194
+4196;2001176220;B06000;LESAO CORPORAL;RUA DOS AEROVIAR;59;1186;31/3/2001 22:38:00;CIDADAO COMUM;S;;LIBERDADE;BH;609063.15;804069.27;4195
+4197;2001176269;B06000;LESAO CORPORAL;AV SILVIANO BRAN;2503;66002;31/3/2001 23:17:00;CIDADAO COMUM;S;;HORTO;BH;613666.26;798305.11;4196
+4198;2001176280;B06000;LESAO CORPORAL;RUA NOSSA SENHOR;25;64905;31/3/2001 23:22:00;CIDADAO COMUM;N;0;JARDIM AMERICA;BH;607765.22;794520.66;4197
+4199;2001176304;B02000;RIXA;RUA MANTENA;80;43273;31/3/2001 23:34:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606459.52;802813.73;4198
+4200;2001176309;B06000;LESAO CORPORAL;RUA MONTE ALEGRE;1055;46357;31/3/2001 23:36:00;CIDADAO COMUM;S;;SAO LUCAS;BH;613156.17;795981.81;4199
+4201;2001235488;B03000;AMEACA;RUA GRACILIANO R;124;31683;1/5/2001 01:58:00;CIDADAO COMUM;S;;TUPI;BH;612710.78;805937.90;4200
+4202;2001235683;B03000;AMEACA;RUA CORONEL ALTI;267;119100;1/5/2001 05:13:00;CIDADAO COMUM;S;0;TEIXEIRA DIAS;BH;602544.15;789909.92;4201
+4203;2001235684;B06000;LESAO CORPORAL;RUA OURO PRETO;285;50730;1/5/2001 05:14:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609961.08;797017.98;4202
+4204;2001235688;B04001;HOMICIDIO TENTAD;RUA PADRE VENANC;78;51717;1/5/2001 05:17:00;INICIATIVA;S;0;GLORIA;BH;603605.95;798587.38;4203
+4205;2001235690;B06000;LESAO CORPORAL;RUA DOS TUPIS;546;69965;1/5/2001 05:24:00;INICIATIVA;N;0;CENTRO (BH);BH;610760.44;796995.95;4204
+4206;2001235694;B06000;LESAO CORPORAL;RUA AMILCAR CABR;960;5146;1/5/2001 05:26:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604353.05;789957.05;4205
+4207;2001235725;B06000;LESAO CORPORAL;AV OLEGARIO MACI;663;49699;1/5/2001 06:45:00;POLICIAL MILITAR;N;;CENTRO (BH);BH;610536.72;797015.09;4206
+4208;2001235747;B04002;HOMICIDIO CONSUM;RUA JOAQUIM GONC;777;119428;1/5/2001 07:41:00;CIDADAO COMUM;N;;VILA MAGNESITA;BH;602285.91;795055.04;4207
+4209;2001235792;B06000;LESAO CORPORAL;RUA LUZIA SALOMA;445;85042;1/5/2001 08:20:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606713.75;810778.88;4208
+4210;2001235893;B03000;AMEACA;AV SEN LEVINDO C;3320;14866;1/5/2001 09:54:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;601145.74;787029.27;4209
+4211;2001235921;B04002;HOMICIDIO CONSUM;RUA DO GROTAO;112;107217;1/5/2001 10:16:00;CIDADAO COMUM;N;0;HAVAI;BH;607513.23;793290.01;4210
+4212;2001235942;B06000;LESAO CORPORAL;ALAMEDA EZEQUIEL;225;27446;1/5/2001 10:33:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611899.54;796686.86;4211
+4213;2001235991;B04001;HOMICIDIO TENTAD;RUA JOAO LUCIO B;120;37737;1/5/2001 11:16:00;CIDADAO COMUM;S;;PRADO;BH;609122.06;796967.46;4212
+4214;2001235992;B03000;AMEACA;RUA URSULA PAULI;1750;71066;1/5/2001 11:18:00;CIDADAO COMUM;N;LJ4;ESTRELA DO ORIEN;BH;605775.64;792584.24;4213
+4215;2001236053;B06000;LESAO CORPORAL;RUA FLOR DE LIZ;42;28640;1/5/2001 12:11:00;CIDADAO COMUM;N;;JARDIM MONTANHES;BH;606502.24;799018.81;4214
+4216;2001236098;B06000;LESAO CORPORAL;RUA DOS ANDRADAS;11;3787;1/5/2001 12:55:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609178.72;808615.38;4215
+4217;2001236194;B03000;AMEACA;RUA PERDIGAO PEQ;110;83006;1/5/2001 14:19:00;CIDADAO COMUM;S;;OURO PRETO;BH;605834.34;802999.45;4216
+4218;2001236220;B02000;RIXA;RUA VASSOURAS;750;71369;1/5/2001 14:37:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609096.59;799624.01;4217
+4219;2001236278;B06000;LESAO CORPORAL;RUA GERALDA MARI;42;69662;1/5/2001 15:24:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608535.68;807364.54;4218
+4220;2001236328;B06000;LESAO CORPORAL;RUA CARLINDO AUG;4;97124;1/5/2001 15:59:00;CIDADAO COMUM;S;0;SAO MARCOS;BH;614603.58;802449.51;4219
+4221;2001236456;B06000;LESAO CORPORAL;RUA FRUTAL;113;30060;1/5/2001 17:15:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613818.79;796965.01;4220
+4222;2001236537;B06000;LESAO CORPORAL;RUA VIOLETA DE M;400;80253;1/5/2001 17:59:00;INICIATIVA;S;0;SAO JOSE;BH;604478.74;799349.35;4221
+4223;2001236567;B06000;LESAO CORPORAL;RUA GUAICURUS;538;32009;1/5/2001 18:14:00;INICIATIVA;S;0;CENTRO (BH);BH;611143.63;797659.74;4222
+4224;2001236587;B03000;AMEACA;RUA ESPORA;779;117319;1/5/2001 18:28:00;CIDADAO COMUM;S;;LINDEIA;BH;600383.46;790393.09;4223
+4225;2001236590;B04001;HOMICIDIO TENTAD;RUA MARIO FILHO;495;44579;1/5/2001 18:29:00;INICIATIVA;N;0;ERMELINDA;BH;609263.47;800331.22;4224
+4226;2001236620;B06000;LESAO CORPORAL;RUA SEBASTIAO GO;101;119821;1/5/2001 18:44:00;CIDADAO COMUM;S;;SERRA VERDE;BH;609664.46;810990.23;4225
+4227;2001236627;B03000;AMEACA;RUA HONORIO BICA;830;29959;1/5/2001 18:51:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;615468.71;800578.81;4226
+4228;2001236701;B04001;HOMICIDIO TENTAD;AV PROFESSOR MAR;1390;91130;1/5/2001 19:25:00;CIDADAO COMUM;N;0;BURITIS;BH;608356.66;791712.79;4227
+4229;2001236733;B03000;AMEACA;RUA ADELIA CARME;297;1031;1/5/2001 19:41:00;CIDADAO COMUM;S;0;ITAIPU BH;BH;599573.53;789407.34;4228
+4230;2001236743;B04001;HOMICIDIO TENTAD;RUA SAO ROQUE;1570;63600;1/5/2001 19:47:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613633.57;799210.41;4229
+4231;2001236753;B06000;LESAO CORPORAL;AV PARANA;466;52230;1/5/2001 19:56:00;POLICIAL CIVIL;N;0;CENTRO (BH);BH;610691.17;797079.45;4230
+4232;2001236757;B06000;LESAO CORPORAL;RUA DES TINOCO;547;20028;1/5/2001 19:57:00;CIDADAO COMUM;S;;MONSENHOR MESSIA;BH;606692.07;798141.20;4231
+4233;2001236774;B06000;LESAO CORPORAL;RUA ITATIAIA;86;17499;1/5/2001 20:05:00;CIDADAO COMUM;S;;BONFIM;BH;610307.06;798033.40;4232
+4234;2001236822;B06000;LESAO CORPORAL;RUA JANAITIBA;916;36889;1/5/2001 20:31:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;616237.80;799193.05;4233
+4235;2001236852;B04002;HOMICIDIO CONSUM;RUA MICA;175;45685;1/5/2001 20:51:00;INICIATIVA;N;0;SAO LUCAS;BH;613254.99;795969.19;4234
+4236;2001236855;B03000;AMEACA;RUA GERALDO JARD;60;302051;1/5/2001 20:51:00;CIDADAO COMUM;S;0;CASTELO;BH;610589.31;804979.41;4235
+4237;2001236872;B06000;LESAO CORPORAL;RUA VISTA ALEGRE;627;73409;1/5/2001 21:01:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;614626.92;796908.04;4236
+4238;2001236917;B03000;AMEACA;RUA LUNDS FERREI;187;41920;1/5/2001 21:28:00;CIDADAO COMUM;N;;NOVA VISTA;BH;615004.25;800832.46;4237
+4239;2001236921;B04002;HOMICIDIO CONSUM;RUA DA BOLIVIA;222;9884;1/5/2001 21:30:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;611248.65;793837.13;4238
+4240;2001236922;B03000;AMEACA;RUA ALUISIO DE A;30;2642;1/5/2001 21:29:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607420.66;808150.58;4239
+4241;2001236943;B06000;LESAO CORPORAL;RUA ITAJUBA;1057;35495;1/5/2001 21:46:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612183.27;798466.57;4240
+4242;2001236962;B03000;AMEACA;RUA NATERCIA;95;47321;1/5/2001 21:54:00;CIDADAO COMUM;S;;SANTA INES;BH;614017.02;801360.75;4241
+4243;2001236984;B02000;RIXA;RUA SAO JOAQUIM;1388;62940;1/5/2001 22:11:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613458.25;799298.92;4242
+4244;2001237029;B03000;AMEACA;RUA ARAPE;141;29798;1/5/2001 22:30:00;CIDADAO COMUM;N;CAFR;UNIAO;BH;613068.53;801117.75;4243
+4245;2001237036;B06000;LESAO CORPORAL;RUA PINTO MARTIN;428;53854;1/5/2001 22:33:00;CIDADAO COMUM;N;0;VILA OESTE;BH;604042.43;795007.75;4244
+4246;2001237148;B06000;LESAO CORPORAL;RUA WALTER IANNI;80;82186;1/5/2001 23:39:00;INICIATIVA;N;0;SAO GABRIEL;BH;613192.78;803761.07;4245
+4247;2001237180;B03000;AMEACA;AV FLOR DE SEDA;1370;748;1/5/2001 23:59:00;CIDADAO COMUM;N;;LINDEIA;BH;599978.29;790345.69;4246
+4248;2001237184;B04002;HOMICIDIO CONSUM;BECO JOSE BONIFA;235;300984;1/5/2001 23:59:00;CIDADAO COMUM;N;0;PRADO LOPES;BH;610199.16;798938.94;4247
+4249;2001237255;B06000;LESAO CORPORAL;RUA MARIA DELFIN;99;43970;2/5/2001 01:08:00;CIDADAO COMUM;N;0;CINQUENTENARIO;BH;606411.72;793418.98;4248
+4250;2001237261;B03000;AMEACA;RUA CARLOS NIEME;455;13472;2/5/2001 01:24:00;INICIATIVA;S;0;SAGRADA FAMILIA;BH;613542.53;798883.75;4249
+4251;2001237280;B04001;HOMICIDIO TENTAD;ESTRADA DO CERCA;2178;26428;2/5/2001 01:41:00;CIDADAO COMUM;S;;SAO DOMINGOS;BH;607554.57;793526.69;4250
+4252;2001237465;B06000;LESAO CORPORAL;RUA CORONEL ANTO;784;17590;2/5/2001 07:11:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605558.64;807500.35;4251
+4253;2001237627;B04001;HOMICIDIO TENTAD;RUA CAIO VIANA M;65;11477;2/5/2001 08:50:00;CIDADAO COMUM;S;FU;ARAGUAIA;BH;604494.91;789155.55;4252
+4254;2001237680;B06000;LESAO CORPORAL;RUA HILDEBRANDO ;556;129788;2/5/2001 09:17:00;CIDADAO COMUM;S;0;COPACABANA;BH;606580.08;806418.27;4253
+4255;2001237829;B06000;LESAO CORPORAL;AV BARBACENA;653;8084;2/5/2001 10:59:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609636.01;796640.35;4254
+4256;2001237849;B03000;AMEACA;RUA PONTA GROSSA;1441;14900;2/5/2001 11:17:00;INICIATIVA;N;0;CRISTO REDENTOR;BH;604877.50;790823.59;4255
+4257;2001237884;B06000;LESAO CORPORAL;RUA DOUTOR ALIPI;389;2365;2/5/2001 11:42:00;CIDADAO COMUM;S;;SERRA;BH;613860.47;794632.24;4256
+4258;2001238076;B03000;AMEACA;RUA QUIARI;90;57161;2/5/2001 13:59:00;POLICIAL MILITAR;N;;SAO GERALDO;BH;615497.49;799877.42;4257
+4259;2001238189;B03000;AMEACA;RUA ORION RIGEL ;191;128961;2/5/2001 15:16:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611775.11;807103.70;4258
+4260;2001238225;B03000;AMEACA;RUA DINIS DIAS;145;119673;2/5/2001 15:32:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616573.20;797526.82;4259
+4261;2001238276;B06000;LESAO CORPORAL;RUA BONFIM;1120;10096;2/5/2001 15:59:00;CIDADAO COMUM;S;;BONFIM;BH;609801.52;798284.45;4260
+4262;2001238313;B03000;AMEACA;RUA CURITIBA;949;19090;2/5/2001 16:16:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610799.92;796919.51;4261
+4263;2001238333;B03000;AMEACA;RUA MAJOR DELFIN;2450;42620;2/5/2001 16:29:00;INICIATIVA;S;;SAO FRANCISCO;BH;609055.69;801501.27;4262
+4264;2001238360;B03000;AMEACA;RUA BARAO DE SAR;559;8043;2/5/2001 16:44:00;CIDADAO COMUM;N;0;HORTO;BH;613733.24;797809.77;4263
+4265;2001238364;B03000;AMEACA;RUA VOLTS;25;73626;2/5/2001 16:45:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612240.98;803326.26;4264
+4266;2001238367;B03000;AMEACA;RUA G;11;36721;2/5/2001 16:48:00;INICIATIVA;S;0;MINASCAIXA;BH;609150.38;809830.09;4265
+4267;2001238396;B03000;AMEACA;RUA JUATUBA;42;39367;2/5/2001 17:05:00;CIDADAO COMUM;S;NR CORRETO/57;VISTA ALEGRE;BH;605262.83;793420.62;4266
+4268;2001238560;B04001;HOMICIDIO TENTAD;RUA AFONSO PEREI;10;107752;2/5/2001 19:00:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606653.03;811490.84;4267
+4269;2001238608;B03000;AMEACA;AV ITAITUBA;450;35454;2/5/2001 19:19:00;CIDADAO COMUM;N;0;BOA VISTA;BH;615072.17;799768.56;4268
+4270;2001238679;B03000;AMEACA;RUA BARAO DE MAC;449;7980;2/5/2001 19:55:00;CIDADAO COMUM;S;;SANTO ANTONIO;BH;610174.15;794888.88;4269
+4271;2001238686;B03000;AMEACA;RUA JOSE MOREIRA;422;55368;2/5/2001 20:01:00;CIDADAO COMUM;N;CSFU;SAO MARCOS;BH;614483.67;802473.88;4270
+4272;2001238703;B03000;AMEACA;RUA JOAO WESLEY;69;64441;2/5/2001 20:10:00;CIDADAO COMUM;S;0;SAO JOAO BATISTA;BH;608579.52;808541.11;4271
+4273;2001238742;B03000;AMEACA;RUA CARLOS ETIEN;84;13356;2/5/2001 20:37:00;INICIATIVA;N;0;SERRA;BH;613964.61;794958.91;4272
+4274;2001238770;B06000;LESAO CORPORAL;RUA URANO;338;71000;2/5/2001 20:48:00;CIDADAO COMUM;S;CAC;VILA SATELITE;BH;610013.62;808625.58;4273
+4275;2001238798;B06000;LESAO CORPORAL;AV MEM DE SA;1457;45395;2/5/2001 21:07:00;CIDADAO COMUM;S;;PARAISO;BH;614255.88;796144.29;4274
+4276;2001238874;B06000;LESAO CORPORAL;RUA DOS OTONI;637;50667;2/5/2001 22:04:00;INICIATIVA;N;0;SANTA EFIGENIA;BH;612405.45;796371.31;4275
+4277;2001238880;B03000;AMEACA;RUA CRISTAL;312;18611;2/5/2001 22:07:00;CIDADAO COMUM;N;;SANTA TEREZA;BH;612754.03;797170.88;4276
+4278;2001238894;B03000;AMEACA;RUA HORACIO DOLA;127;11565;2/5/2001 22:21:00;CIDADAO COMUM;N;;CEU AZUL;BH;604125.19;807520.28;4277
+4279;2001238912;B03000;AMEACA;RUA MEXICO;579;45660;2/5/2001 22:32:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605377.49;807191.43;4278
+4280;2001238926;B03000;AMEACA;BECO ORIENTAL;150;301495;2/5/2001 22:42:00;CIDADAO COMUM;S;0;SAO LUCAS;BH;613207.58;795848.83;4279
+4281;2001238979;B03000;AMEACA;RUA LUPERCIO PAI;280;57335;2/5/2001 23:07:00;CIDADAO COMUM;S;0;TIROL;BH;599911.01;789035.54;4280
+4282;2001238987;B03000;AMEACA;RUA LOURIVAL SOA;26;109341;2/5/2001 23:13:00;CIDADAO COMUM;S;;CEU AZUL;BH;604657.01;807776.85;4281
+4283;2001238996;B03000;AMEACA;RUA SABARA;21;59750;2/5/2001 23:24:00;CIDADAO COMUM;S;0;FLORESTA;BH;611202.63;798017.88;4282
+4284;2001238998;B03000;AMEACA;AV SEN LEVINDO C;1070;14866;2/5/2001 23:24:00;CIDADAO COMUM;N;;SANTA CECILIA;BH;601290.55;786629.80;4283
+4285;2001239044;B02000;RIXA;RUA ITAQUERA;428;35920;2/5/2001 23:54:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611178.14;799141.23;4284
+4286;2001239088;B03000;AMEACA;RUA TIZIU;542;95881;3/5/2001 00:38:00;CIDADAO COMUM;N;0;GOIANIA;BH;615351.18;802590.79;4285
+4287;2001239107;B03000;AMEACA;RUA DINIS DIAS;145;119673;3/5/2001 00:54:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616573.20;797526.82;4286
+4288;2001239179;B04001;HOMICIDIO TENTAD;RUA DOUTOR BENED;400;12252;3/5/2001 01:59:00;INICIATIVA;N;0;ANTONIO RIBEIRO ;BH;612542.70;803696.47;4287
+4289;2001239180;B06000;LESAO CORPORAL;AV DO CONTORNO;10360;17228;3/5/2001 02:00:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609614.39;797316.12;4288
+4290;2001239192;B06000;LESAO CORPORAL;RUA ZODIACO;637;74036;3/5/2001 02:16:00;CIDADAO COMUM;N;;SANTA LUCIA;BH;610296.58;791986.51;4289
+4291;2001239263;B03000;AMEACA;RUA DONATO DA FO;44;23067;3/5/2001 03:32:00;CIDADAO COMUM;S;AP 301;CORACAO DE JESUS;BH;610024.42;794463.88;4290
+4292;2001239507;B03000;AMEACA;RUA OURO PRETO;1421;50730;3/5/2001 08:27:00;CIDADAO COMUM;N;APT.203;SANTO AGOSTINHO;BH;609659.90;795880.65;4291
+4293;2001239604;B03000;AMEACA;RUA MARQUES DO L;470;44755;3/5/2001 09:18:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604486.51;796277.77;4292
+4294;2001239649;B03000;AMEACA;RUA SAO LAZARO;831;63219;3/5/2001 09:39:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;612468.94;799392.66;4293
+4295;2001239730;B06000;LESAO CORPORAL;RUA SAO FIDELIS;701;48309;3/5/2001 10:31:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615514.94;800550.35;4294
+4296;2001239779;B06000;LESAO CORPORAL;RUA FLOR DO AMEN;283;94910;3/5/2001 11:05:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606038.51;799794.54;4295
+4297;2001239942;B03000;AMEACA;RUA ANHEMBI;168;84396;3/5/2001 12:52:00;CIDADAO COMUM;S;;PIRATININGA;BH;605469.33;809069.82;4296
+4298;2001240172;B03000;AMEACA;AV ARTUR GUIMARA;1010;6151;3/5/2001 15:22:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610759.65;802050.82;4297
+4299;2001240206;B06000;LESAO CORPORAL;RUA GUARARAPES;1544;32241;3/5/2001 15:40:00;CIDADAO COMUM;S;0;NOVO GLORIA;BH;602656.25;798267.93;4298
+4300;2001240309;B06000;LESAO CORPORAL;RUA CELINA DIAS ;67;86307;3/5/2001 16:27:00;CIDADAO COMUM;S;;JAQUELINE;BH;610884.16;810367.55;4299
+4301;2001240424;B03000;AMEACA;RUA JEQUIRICA;157;37258;3/5/2001 17:32:00;CIDADAO COMUM;S;;CONCORDIA;BH;611254.76;799443.34;4300
+4302;2001240584;B03000;AMEACA;RUA GERALDO SILV;121;56588;3/5/2001 18:57:00;CIDADAO COMUM;S;AP02;RIO BRANCO;BH;606686.40;808809.56;4301
+4303;2001240720;B03000;AMEACA;RUA NELSON DE SE;91;47448;3/5/2001 20:04:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606350.59;792901.24;4302
+4304;2001240732;B03000;AMEACA;RUA TREM DE FERR;145;9377;3/5/2001 20:10:00;INICIATIVA;S;0;ITAIPU BH;BH;598907.42;789366.11;4303
+4305;2001240758;B03000;AMEACA;PRACA CARLOS CHA;35;13328;3/5/2001 20:20:00;INICIATIVA;N;0;SANTO AGOSTINHO;BH;610136.92;795881.25;4304
+4306;2001240945;B06000;LESAO CORPORAL;RUA DOS INDEPEND;180;109165;3/5/2001 22:15:00;CIDADAO COMUM;S;;VILA SANTA RITA;BH;601157.29;787604.80;4305
+4307;2001240953;B03000;AMEACA;RUA EGEU;70;18680;3/5/2001 22:18:00;CIDADAO COMUM;S;;MINASLANDIA;BH;611648.78;804462.61;4306
+4308;2001241105;B06000;LESAO CORPORAL;RUA PADRE CAFE;1053;51253;3/5/2001 23:58:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616124.40;797897.91;4307
+4309;2001241108;B06000;LESAO CORPORAL;RUA JOSE NILTON ;248;113144;4/5/2001 00:00:00;CIDADAO COMUM;N;0;TIROL;BH;599992.30;789975.91;4308
+4310;2001241114;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;1820;40770;4/5/2001 00:04:00;INICIATIVA;N;0;VERA CRUZ;BH;616129.07;798179.53;4309
+4311;2001241171;B03000;AMEACA;AV OLINTO MEIREL;1634;49847;4/5/2001 00:57:00;CIDADAO COMUM;N;0;MILIONARIOS;BH;603690.86;789825.51;4310
+4312;2001241221;B06000;LESAO CORPORAL;RUA ANTONIO SIMI;268;118526;4/5/2001 01:51:00;CIDADAO COMUM;S;;REGINA;BH;598714.08;790387.69;4311
+4313;2001241357;B04001;HOMICIDIO TENTAD;PRACA CARDEAL AR;96;13182;4/5/2001 04:39:00;CIDADAO COMUM;N;;NOVA CINTRA;BH;605691.12;793887.54;4312
+4314;2001241449;B03000;AMEACA;AV CARANDAI;897;13081;4/5/2001 07:39:00;CIDADAO COMUM;S;0;FUNCIONARIOS;BH;611934.68;796197.56;4313
+4315;2001241458;B03000;AMEACA;RUA CORONEL CAMI;460;17650;4/5/2001 07:48:00;CIDADAO COMUM;S;0;VILA OESTE;BH;604170.06;795259.34;4314
+4316;2001241522;B03000;AMEACA;RUA ITAPEVA;821;35820;4/5/2001 08:31:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611604.06;799219.61;4315
+4317;2001241538;B06000;LESAO CORPORAL;RUA PRIMEIRO DE ;50;23978;4/5/2001 08:39:00;CIDADAO COMUM;S;CAST07;TAQUARIL;BH;617532.48;797226.06;4316
+4318;2001241586;B03000;AMEACA;RUA HERMILO ALVE;168;33216;4/5/2001 09:08:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;612592.79;797429.00;4317
+4319;2001241733;B04001;HOMICIDIO TENTAD;RUA SEIS;80;86174;4/5/2001 10:48:00;CIDADAO COMUM;S;;JAQUELINE;BH;611389.70;810027.38;4318
+4320;2001241818;B06000;LESAO CORPORAL;RUA VENERO CAETA;76;91459;4/5/2001 11:49:00;CIDADAO COMUM;S;FU;PALMEIRAS;BH;606859.87;791116.66;4319
+4321;2001241823;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;3792;17095;4/5/2001 11:53:00;INICIATIVA;N;0;HORTO;BH;613741.51;798439.29;4320
+4322;2001241856;B02000;RIXA;RUA ITAPEMA;185;35760;4/5/2001 12:17:00;INICIATIVA;N;0;ANCHIETA;BH;612293.88;793797.78;4321
+4323;2001241898;B03000;AMEACA;RUA EDUARDO QUEN;27;25047;4/5/2001 12:50:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;610548.55;805019.11;4322
+4324;2001241908;B04001;HOMICIDIO TENTAD;RUA BENJAMIM JAC;800;9207;4/5/2001 12:57:00;CIDADAO COMUM;N;;GUTIERREZ;BH;609111.97;794709.49;4323
+4325;2001241973;B06000;LESAO CORPORAL;RUA BUENO DO PRA;866;10676;4/5/2001 13:38:00;CIDADAO COMUM;N;;ALTO DOS PINHEIR;BH;604211.61;796222.13;4324
+4326;2001242005;B03000;AMEACA;RUA FURTADO NUNE;25;30160;4/5/2001 13:57:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606302.42;797166.69;4325
+4327;2001242011;B06000;LESAO CORPORAL;RUA RIO DE JANEI;821;58772;4/5/2001 14:06:00;INICIATIVA;N;0;CENTRO BH;BH;611082.48;796907.81;4326
+4328;2001242025;B06000;LESAO CORPORAL;RUA TOME DE SOUZ;935;67998;4/5/2001 14:16:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611457.69;795178.33;4327
+4329;2001242058;B06000;LESAO CORPORAL;RUA JOSE NUNES C;60;119456;4/5/2001 14:39:00;CIDADAO COMUM;N;;VILA MAGNESITA;BH;602578.26;794932.48;4328
+4330;2001242109;B03000;AMEACA;RUA JOSE NILTON ;312;113144;4/5/2001 15:21:00;CIDADAO COMUM;S;;TIROL;BH;599975.29;790055.55;4329
+4331;2001242161;B04001;HOMICIDIO TENTAD;RUA BANDONION;54;170139;4/5/2001 15:44:00;CIDADAO COMUM;S;AP302;VILA CAFEZAL;BH;613977.41;795089.89;4330
+4332;2001242281;B06000;LESAO CORPORAL;RUA PADRE FEIJO;98;51326;4/5/2001 16:56:00;CIDADAO COMUM;N;;SAUDADE;BH;614957.36;797460.62;4331
+4333;2001242449;B06000;LESAO CORPORAL;RUA SUZANA;45;23284;4/5/2001 18:15:00;CIDADAO COMUM;S;SETOR 9;TAQUARIL;BH;617621.30;797027.01;4332
+4334;2001242573;B03000;AMEACA;RUA GASTAO DA CU;44;30712;4/5/2001 19:20:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608652.47;794813.51;4333
+4335;2001242588;B04002;HOMICIDIO CONSUM;RUA LAUDIVINA LU;74;15380;4/5/2001 19:26:00;CIDADAO COMUM;N;;LETICIA;BH;607823.42;809796.60;4334
+4336;2001242654;B03000;AMEACA;RUA PORTO SEGURO;835;60595;4/5/2001 19:57:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615303.96;800806.89;4335
+4337;2001242668;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;4/5/2001 20:04:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;4336
+4338;2001242705;B06000;LESAO CORPORAL;AV PRESIDENTE AN;1240;4461;4/5/2001 20:27:00;POLICIAL MILITAR;S;;SAO CRISTOVAO;BH;610402.72;799177.41;4337
+4339;2001242735;B06000;LESAO CORPORAL;RUA LEOPOLDO GOM;256;40770;4/5/2001 20:41:00;CIDADAO COMUM;S;0;POMPEIA;BH;614562.10;797847.38;4338
+4340;2001242798;B06000;LESAO CORPORAL;AV NOSSA SENHORA;1900;47996;4/5/2001 21:17:00;INICIATIVA;S;0;SAO PEDRO;BH;610981.82;793299.68;4339
+4341;2001242860;B06000;LESAO CORPORAL;RUA FIRMINO DUAR;287;89879;4/5/2001 21:55:00;POLICIAL MILITAR;S;0;PALMEIRAS;BH;607127.95;791538.27;4340
+4342;2001242964;B03000;AMEACA;RUA QUARENTA E S;91;302841;4/5/2001 23:00:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614268.33;805792.06;4341
+4343;2001243177;B04001;HOMICIDIO TENTAD;AV NOSSA SENHORA;1900;47996;5/5/2001 00:59:00;INICIATIVA;S;0;SAO PEDRO;BH;610981.82;793299.68;4342
+4344;2001243210;B03000;AMEACA;RUA MONTE ALVERN;579;46385;5/5/2001 01:15:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;607879.30;808121.62;4343
+4345;2001243324;B06000;LESAO CORPORAL;RUA DANIEL DE CA;1679;19630;5/5/2001 02:44:00;CIDADAO COMUM;S;0;NOVA GRANADA;BH;609232.04;794835.81;4344
+4346;2001243372;B04001;HOMICIDIO TENTAD;RUA ANGATURAMA;411;3935;5/5/2001 03:09:00;CIDADAO COMUM;S;;SAO PAULO;BH;612782.45;802779.28;4345
+4347;2001243418;B04002;HOMICIDIO CONSUM;RUA ALIPIO DE ME;667;2378;5/5/2001 03:50:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606333.50;798725.89;4346
+4348;2001243424;B06000;LESAO CORPORAL;RUA ITAMBE;27;35596;5/5/2001 04:00:00;CIDADAO COMUM;N;;FLORESTA;BH;611768.53;797139.48;4347
+4349;2001243440;B03000;AMEACA;RUA DA BAHIA;1196;81155;5/5/2001 04:18:00;CIDADAO COMUM;S;;LOURDES;BH;611215.54;796459.72;4348
+4350;2001243443;B06000;LESAO CORPORAL;AV CIVILIZACAO;1800;51657;5/5/2001 04:21:00;CIDADAO COMUM;S;;VILA SANTA BRANC;BH;608373.95;809140.92;4349
+4351;2001243461;B04001;HOMICIDIO TENTAD;RUA ITAMIRIM;780;35615;5/5/2001 04:35:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615978.04;798604.99;4350
+4352;2001243469;B06000;LESAO CORPORAL;AV SANTOS DUMONT;436;61950;5/5/2001 04:46:00;CIDADAO COMUM;S;PX436;CENTRO (BH);BH;611217.57;797550.79;4351
+4353;2001243484;B06000;LESAO CORPORAL;AV CIVILIZACAO;1500;51657;5/5/2001 05:02:00;INICIATIVA;S;0;VILA SANTA BRANC;BH;608670.39;808930.49;4352
+4354;2001243499;B06000;LESAO CORPORAL;RUA VINTE E UM D;157;72286;5/5/2001 05:31:00;CIDADAO COMUM;S;PX207;CENTRO (BH);BH;610959.73;797725.04;4353
+4355;2001243537;B03000;AMEACA;AV BARAO HOMEM D;3163;7936;5/5/2001 06:25:00;CIDADAO COMUM;S;;ESTORIL;BH;608238.29;793044.57;4354
+4356;2001243742;B04001;HOMICIDIO TENTAD;RUA JOEL DE MATO;106;84660;5/5/2001 09:19:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;607187.82;793819.19;4355
+4357;2001243783;B05000;SEQUESTRO E CARC;RUA OLINTO MAGAL;560;49834;5/5/2001 09:49:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;606154.07;797798.82;4356
+4358;2001243795;B04001;HOMICIDIO TENTAD;RUA TIZIU;566;95881;5/5/2001 09:56:00;CIDADAO COMUM;N;CASA B;GOIANIA;BH;615351.18;802590.79;4357
+4359;2001243925;B03000;AMEACA;RUA FORMIGA;294;29136;5/5/2001 11:24:00;CIDADAO COMUM;S;0;SAO CRISTOVAO;BH;610521.09;798844.04;4358
+4360;2001243928;B03000;AMEACA;RUA GASTAO DA CU;44;30712;5/5/2001 11:26:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;608652.47;794813.51;4359
+4361;2001243955;B06000;LESAO CORPORAL;RUA DES BRAULIO;648;19917;5/5/2001 11:42:00;INICIATIVA;N;0;VERA CRUZ;BH;616109.45;798454.20;4360
+4362;2001244005;B03000;AMEACA;RUA SAIRA;10;48670;5/5/2001 12:09:00;CIDADAO COMUM;S;0;GOIANIA;BH;615390.10;802975.69;4361
+4363;2001244036;B06000;LESAO CORPORAL;RUA CORONEL SEVE;721;18072;5/5/2001 12:36:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604669.06;789748.35;4362
+4364;2001244056;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;360;63782;5/5/2001 12:49:00;INICIATIVA;N;0;MORRO DO PAPAGAI;BH;610920.76;793642.68;4363
+4365;2001244106;B02000;RIXA;RUA FREI VICENTE;247;30029;5/5/2001 13:23:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607277.72;807964.07;4364
+4366;2001244141;B03000;AMEACA;RUA CURITIBA;1832;19090;5/5/2001 13:45:00;INICIATIVA;S;0;LOURDES;BH;610540.51;796105.15;4365
+4367;2001244144;B03000;AMEACA;RUA ITAIPU;767;35439;5/5/2001 13:46:00;CIDADAO COMUM;N;;VERA CRUZ;BH;616248.63;798433.00;4366
+4368;2001244209;B06000;LESAO CORPORAL;RUA ALCIDA TORRE;186;112936;5/5/2001 14:29:00;CIDADAO COMUM;N;0;CH SANTA MARIA;BH;608957.30;793494.58;4367
+4369;2001244210;B03000;AMEACA;RUA PALESTINA;984;51861;5/5/2001 14:31:00;CIDADAO COMUM;S;;COQUEIROS;BH;603317.91;800262.15;4368
+4370;2001244220;B04001;HOMICIDIO TENTAD;RUA CAPIVARI;792;12918;5/5/2001 14:36:00;CIDADAO COMUM;S;;SERRA;BH;613862.34;794772.93;4369
+4371;2001244251;B04001;HOMICIDIO TENTAD;RUA FILOMENA REI;376;107967;5/5/2001 14:57:00;CIDADAO COMUM;N;0;MANTIQUEIRA;BH;606947.09;811786.56;4370
+4372;2001244255;B06000;LESAO CORPORAL;AV BERNARDO MONT;17;9392;5/5/2001 15:00:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;612464.12;797183.95;4371
+4373;2001244274;B06000;LESAO CORPORAL;RUA FLUORINA;605;29091;5/5/2001 15:11:00;CIDADAO COMUM;S;0;POMPEIA;BH;614642.94;797560.93;4372
+4374;2001244288;B03000;AMEACA;RUA ANTENOR PRAT;10;86896;5/5/2001 15:23:00;CIDADAO COMUM;N;;NOVO PAQUETA;BH;605663.03;802024.87;4373
+4375;2001244294;B06000;LESAO CORPORAL;RUA ANTONIO FERR;360;70798;5/5/2001 15:27:00;CIDADAO COMUM;S;;SANTA HELENA (BH;BH;603091.88;790204.68;4374
+4376;2001244431;B06000;LESAO CORPORAL;AV VEREADOR CICE;34;19756;5/5/2001 16:37:00;CIDADAO COMUM;S;CAFU;CORACAO EUCARIST;BH;604819.38;796509.78;4375
+4377;2001244466;B03000;AMEACA;AV DO CONTORNO;11428;17228;5/5/2001 16:56:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;610540.75;797564.41;4376
+4378;2001244481;B03000;AMEACA;RUA WALDEMAR FAL;114;36429;5/5/2001 17:07:00;CIDADAO COMUM;N;;PLANALTO;BH;610860.67;806612.32;4377
+4379;2001244504;B03000;AMEACA;RUA BINARIO;190;301457;5/5/2001 17:19:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614311.76;795528.44;4378
+4380;2001244535;B03000;AMEACA;RUA ASTOLFO DUTR;953;6426;5/5/2001 17:36:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615614.18;798400.93;4379
+4381;2001244546;B03000;AMEACA;RUA PERDIGAO PEQ;110;83006;5/5/2001 17:41:00;CIDADAO COMUM;N;;OURO PRETO;BH;605834.34;802999.45;4380
+4382;2001244568;B03000;AMEACA;RUA JUVENTUDE;345;99274;5/5/2001 17:54:00;CIDADAO COMUM;N;FR1;CEU AZUL;BH;604514.48;808009.59;4381
+4383;2001244594;B03000;AMEACA;RUA JACAREI;363;13154;5/5/2001 18:11:00;CIDADAO COMUM;S;0;COQUEIROS;BH;602568.63;798483.85;4382
+4384;2001244616;B03000;AMEACA;RUA CIPRIANO DE ;278;15856;5/5/2001 18:20:00;CIDADAO COMUM;S;FU;CINQUENTENARIO;BH;606286.24;793387.96;4383
+4385;2001244668;B06000;LESAO CORPORAL;RUA ANTONIO FERR;360;70798;5/5/2001 18:52:00;CIDADAO COMUM;N;;SANTA HELENA (BH;BH;603091.88;790204.68;4384
+4386;2001244713;B06000;LESAO CORPORAL;RUA CORONEL ANTO;757;17590;5/5/2001 19:12:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605502.27;807469.46;4385
+4387;2001244763;B03000;AMEACA;RUA COCAIS;671;16140;5/5/2001 19:36:00;CIDADAO COMUM;S;0;ESPLANADA;BH;615173.47;798832.72;4386
+4388;2001244779;B04001;HOMICIDIO TENTAD;AV CATULO DA PAI;655;59081;5/5/2001 19:45:00;INICIATIVA;S;0;DAS INDUSTRIAS;BH;604432.91;792729.44;4387
+4389;2001244804;B03000;AMEACA;RUA PEDRA DO IND;10;32774;5/5/2001 20:01:00;INICIATIVA;N;0;CANDELARIA;BH;608567.02;808676.74;4388
+4390;2001244827;B06000;LESAO CORPORAL;RUA ICARAI;412;34004;5/5/2001 20:09:00;CIDADAO COMUM;S;0;ALTO DOS CAICARA;BH;607901.24;798457.83;4389
+4391;2001244863;B06000;LESAO CORPORAL;RUA N;50;37780;5/5/2001 20:32:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608946.55;810184.24;4390
+4392;2001244882;B03000;AMEACA;RUA WEAVER;65;25021;5/5/2001 20:41:00;CIDADAO COMUM;S;;DURVAL DE BARROS;IB;598280.05;790991.94;4391
+4393;2001244887;B03000;AMEACA;AV RAJA GABAGLIA;1000;57830;5/5/2001 20:44:00;INICIATIVA;N;0;GUTIERREZ;BH;609199.03;794395.98;4392
+4394;2001244897;B03000;AMEACA;RUA FREI LUIZ DE;175;29961;5/5/2001 20:51:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604838.14;795915.30;4393
+4395;2001244917;B03000;AMEACA;BECO NOSSA SENHO;880;170113;5/5/2001 21:04:00;CIDADAO COMUM;S;0;CAFEZAL;BH;614316.22;794914.87;4394
+4396;2001244922;B03000;AMEACA;RUA TUBARAO;14;69791;5/5/2001 21:04:00;CIDADAO COMUM;S;0;CARDOSO;BH;604249.55;787840.85;4395
+4397;2001244943;B06000;LESAO CORPORAL;RUA FURTADO DE M;353;30145;5/5/2001 21:13:00;CIDADAO COMUM;S;;SANTA ROSA;BH;610023.23;803520.42;4396
+4398;2001244996;B03000;AMEACA;RUA BABEL;682;7460;5/5/2001 21:48:00;CIDADAO COMUM;S;0;SAO SALVADOR;BH;603045.44;799312.42;4397
+4399;2001245008;B03000;AMEACA;AV CRISTIANO MAC;4000;18652;5/5/2001 21:54:00;INICIATIVA;N;0;DOS PALMARES;BH;612434.91;802092.92;4398
+4400;2001245028;B06000;LESAO CORPORAL;RUA AUREO DRUMON;60;117435;5/5/2001 22:06:00;INICIATIVA;N;0;CASA BRANCA;BH;616476.94;799773.65;4399
+4401;2001245043;B06000;LESAO CORPORAL;RUA ANIBAL BENEV;75;4083;5/5/2001 22:15:00;INICIATIVA;N;0;SANTA EFIGENIA;BH;613526.59;796519.01;4400
+4402;2001245059;B04001;HOMICIDIO TENTAD;RUA PASSARELA;97;302328;5/5/2001 22:22:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;606149.87;789752.27;4401
+4403;2001245061;B09000;ABANDONO DE INCA;RUA ARTUR DE SA;1107;6211;5/5/2001 22:20:00;CIDADAO COMUM;S;;UNIAO;BH;612854.19;801930.79;4402
+4404;2001245072;B03000;AMEACA;RUA HIGINO DE OL;221;83630;5/5/2001 22:25:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604607.93;789209.81;4403
+4405;2001245077;B06000;LESAO CORPORAL;RUA ITATINGA;15;36000;5/5/2001 22:29:00;INICIATIVA;N;0;FLORAMAR;BH;611719.65;805792.24;4404
+4406;2001245104;B06000;LESAO CORPORAL;AV SIDERAL;579;65721;5/5/2001 22:49:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604300.41;793606.82;4405
+4407;2001245204;B05000;SEQUESTRO E CARC;RUA CINQUENTA E ;38;33900;5/5/2001 23:32:00;CIDADAO COMUM;N;0;CONJUNTO FELICID;BH;612593.41;806824.84;4406
+4408;2001245208;B06000;LESAO CORPORAL;RUA CURITIBA;1099;19090;5/5/2001 23:35:00;INICIATIVA;N;0;CENTRO (BH);BH;610750.03;796765.47;4407
+4409;2001245264;B06000;LESAO CORPORAL;RUA DOMINGOS FRA;70;103244;6/5/2001 00:09:00;CIDADAO COMUM;S;;OURO PRETO;BH;606342.21;800670.65;4408
+4410;2001245281;B03000;AMEACA;RUA TAMBORIL;930;66793;6/5/2001 00:14:00;CIDADAO COMUM;S;;CONCORDIA;BH;610977.60;799570.66;4409
+4411;2001245295;B06000;LESAO CORPORAL;AV BIAS FORTES;1526;9553;6/5/2001 00:24:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610343.53;796985.22;4410
+4412;2001245318;B03000;AMEACA;AV ABILIO MACHAD;762;634;6/5/2001 00:38:00;CIDADAO COMUM;S;;INCONFIDENCIA;BH;604926.99;798292.43;4411
+4413;2001245337;B03000;AMEACA;BECO SAO CAETANO;100;300716;6/5/2001 00:48:00;CIDADAO COMUM;N;0;PRADO LOPES;BH;609992.00;799125.07;4412
+4414;2001245350;B06000;LESAO CORPORAL;RUA JOSE FELIX M;680;7416;6/5/2001 00:55:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606479.01;810419.90;4413
+4415;2001245369;B03000;AMEACA;RUA RAMIRO ATHAN;35;94790;6/5/2001 01:10:00;CIDADAO COMUM;S;;ENGENHO NOGUEIRA;BH;606229.15;800580.68;4414
+4416;2001245420;B02000;RIXA;AV TERESA CRISTI;175;67512;6/5/2001 01:39:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;609052.83;797141.23;4415
+4417;2001245481;B05000;SEQUESTRO E CARC;AV AMAZONAS;4434;3140;6/5/2001 02:09:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;607491.23;795998.20;4416
+4418;2001245482;B06000;LESAO CORPORAL;RUA RADIALISTA G;80;109442;6/5/2001 02:10:00;CIDADAO COMUM;S;;CEU AZUL;BH;604543.26;808886.65;4417
+4419;2001245488;B03000;AMEACA;RUA EXPEDICIONAR;505;82970;6/5/2001 02:13:00;CIDADAO COMUM;S;;SAO LUIZ;BH;606781.64;803296.30;4418
+4420;2001245531;B06000;LESAO CORPORAL;RUA DOS CAETES;180;11376;6/5/2001 02:43:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611446.97;797386.75;4419
+4421;2001245549;B04002;HOMICIDIO CONSUM;RUA BINARIO;128;301457;6/5/2001 02:59:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614311.76;795528.44;4420
+4422;2001245585;B03000;AMEACA;RUA EMBU;51;81810;6/5/2001 03:23:00;CIDADAO COMUM;S;0;ITAIPU BH;BH;599072.38;789121.58;4421
+4423;2001245602;B04002;HOMICIDIO CONSUM;RUA AMPERE;117;3484;6/5/2001 03:35:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612156.78;803570.63;4422
+4424;2001245671;B02000;RIXA;RUA JANUARIA;65;36936;6/5/2001 04:28:00;CIDADAO COMUM;S;0;FLORESTA;BH;611563.51;797768.28;4423
+4425;2001245681;B06000;LESAO CORPORAL;RUA BIMBARRA;300;9641;6/5/2001 04:39:00;CIDADAO COMUM;S;;CALAFATE;BH;607195.50;796594.64;4424
+4426;2001245711;B06000;LESAO CORPORAL;AV BRIGADEIRO ED;2520;2860;6/5/2001 05:12:00;CIDADAO COMUM;N;0;SAO SALVADOR;BH;603671.98;799787.66;4425
+4427;2001245736;B02000;RIXA;RUA CONTAGEM;1275;70293;6/5/2001 05:37:00;CIDADAO COMUM;N;L;NOVA VISTA;BH;614505.49;800932.51;4426
+4428;2001245742;B06000;LESAO CORPORAL;RUA POTOMAIO;722;54920;6/5/2001 05:44:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615767.01;799159.51;4427
+4429;2001245962;B06000;LESAO CORPORAL;AV AMAZONAS;1684;3140;6/5/2001 10:00:00;INICIATIVA;N;0;BARRO PRETO;BH;610031.46;796551.75;4428
+4430;2001245983;B03000;AMEACA;RUA ITAPOA;260;82218;6/5/2001 10:14:00;CIDADAO COMUM;N;0;GUARANI;BH;612898.19;805462.56;4429
+4431;2001246031;B03000;AMEACA;RUA DOM PEDRITO;42;51300;6/5/2001 10:49:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614692.46;800392.26;4430
+4432;2001246072;B03000;AMEACA;RUA JULITA NUNES;211;130047;6/5/2001 11:22:00;CIDADAO COMUM;N;;MINASCAIXA;BH;609211.34;809819.89;4431
+4433;2001246111;B06000;LESAO CORPORAL;RUA CRUCILANDIA;200;18781;6/5/2001 11:53:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605921.59;807710.06;4432
+4434;2001246133;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;6/5/2001 12:14:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;4433
+4435;2001246138;B03000;AMEACA;RUA CIPRESTE;341;73087;6/5/2001 12:21:00;CIDADAO COMUM;S;CAFU;MARAJO;BH;606844.91;792758.83;4434
+4436;2001246139;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;865;6731;6/5/2001 12:22:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;610544.42;796719.11;4435
+4437;2001246190;B06000;LESAO CORPORAL;AV DOUTOR ALVARO;91;117665;6/5/2001 13:03:00;CIDADAO COMUM;S;APTO 704;SANTA MONICA;BH;608473.61;807215.71;4436
+4438;2001246226;B04001;HOMICIDIO TENTAD;RUA G;5;36721;6/5/2001 13:29:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609150.38;809830.09;4437
+4439;2001246285;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;1843;7936;6/5/2001 14:07:00;CIDADAO COMUM;S;;NOVA GRANADA;BH;608102.37;793516.46;4438
+4440;2001246379;B06000;LESAO CORPORAL;RUA LAGOINHAS;140;40221;6/5/2001 15:26:00;CIDADAO COMUM;S;;JARDIM FLORENCIA;BH;604925.31;810345.40;4439
+4441;2001246395;B04001;HOMICIDIO TENTAD;BECO MARCO ANTON;220;170750;6/5/2001 15:36:00;CIDADAO COMUM;N;;MORRO DAS PEDRAS;BH;608957.14;794564.47;4440
+4442;2001246412;B03000;AMEACA;RUA CRECIUMA;90;18549;6/5/2001 15:45:00;CIDADAO COMUM;N;APB;CARDOSO;BH;603433.71;787957.69;4441
+4443;2001246424;B03000;AMEACA;RUA JOAQUIM DE P;165;15349;6/5/2001 15:55:00;CIDADAO COMUM;S;ESCOLA ANTONIA F;SAO JOAO BATISTA;BH;608533.39;808412.51;4442
+4444;2001246447;B03000;AMEACA;BECO PRINCIPAL;240;301983;6/5/2001 16:13:00;CIDADAO COMUM;S;PROX. AO CAMPO;SAO JOSE;BH;605159.47;799250.89;4443
+4445;2001246487;B06000;LESAO CORPORAL;RUA FERNAO DIAS;388;28133;6/5/2001 16:34:00;CIDADAO COMUM;S;;CASA BRANCA;BH;616135.79;799507.45;4444
+4446;2001246555;B06000;LESAO CORPORAL;RUA LAURO SOARES;278;106599;6/5/2001 17:17:00;CIDADAO COMUM;S;;NOVA YORK;BH;608565.48;811276.66;4445
+4447;2001246610;B06000;LESAO CORPORAL;RUA JEQUIRICA;440;37258;6/5/2001 17:49:00;CIDADAO COMUM;S;;CONCORDIA;BH;611201.11;799723.09;4446
+4448;2001246650;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;175;51657;6/5/2001 18:06:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;4447
+4449;2001246669;B03000;AMEACA;RUA SAO GREGORIO;120;62710;6/5/2001 18:14:00;CIDADAO COMUM;N;0;AARAO REIS;BH;612875.24;803517.95;4448
+4450;2001246713;B06000;LESAO CORPORAL;RUA SAO JOAO;70;105426;6/5/2001 18:42:00;CIDADAO COMUM;N;;PAULO SEXTO;BH;616253.42;806196.50;4449
+4451;2001246717;B03000;AMEACA;AV NOSSA SENHORA;2078;47996;6/5/2001 18:42:00;CIDADAO COMUM;N;EM FRENTE RUA PA;SAO PEDRO;BH;610858.87;793078.63;4450
+4452;2001246731;B04001;HOMICIDIO TENTAD;RUA PROFESSOR CA;63;55443;6/5/2001 18:49:00;CIDADAO COMUM;S;;INDUSTRIAL RODRI;BH;615917.11;808278.38;4451
+4453;2001246821;B06000;LESAO CORPORAL;RUA MARILANDIA;71;96525;6/5/2001 19:41:00;CIDADAO COMUM;N;CAA;ANTONIO RIBEIRO ;BH;615507.36;806041.85;4452
+4454;2001246920;B03000;AMEACA;AV CRISTIANO MAC;7505;18652;6/5/2001 20:39:00;CIDADAO COMUM;S;0;VILA SUZANA;BH;611862.37;803269.47;4453
+4455;2001246959;B06000;LESAO CORPORAL;AV PARANA;33;52230;6/5/2001 21:00:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610863.26;797477.33;4454
+4456;2001247166;B03000;AMEACA;RUA CURVELO;50;19150;6/5/2001 23:10:00;CIDADAO COMUM;S;AP102;FLORESTA;BH;612139.97;797829.32;4455
+4457;2001247198;B02000;RIXA;RUA SILVA ALVARE;614;65810;6/5/2001 23:33:00;INICIATIVA;N;0;SAO GERALDO;BH;615391.08;799419.26;4456
+4458;2001247265;B03000;AMEACA;PRACA DIVINA PAS;5;68846;7/5/2001 00:17:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614186.09;804239.54;4457
+4459;2001247283;B06000;LESAO CORPORAL;RUA SILVESTRE FE;510;65992;7/5/2001 00:31:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612773.97;798453.23;4458
+4460;2001247292;B06000;LESAO CORPORAL;RUA CERRO CORA;184;21553;7/5/2001 00:42:00;CIDADAO COMUM;S;;COQUEIROS;BH;602113.72;798098.87;4459
+4461;2001247338;B03000;AMEACA;RUA PEDRA SABAO;389;86509;7/5/2001 01:40:00;CIDADAO COMUM;N;0;PIRATININGA;BH;606405.34;809276.69;4460
+4462;2001247372;B06000;LESAO CORPORAL;RUA MARIETA ALEX;240;51036;7/5/2001 02:17:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609420.35;809489.23;4461
+4463;2001247456;B03000;AMEACA;RUA MARIETA ALEX;210;51036;7/5/2001 04:07:00;CIDADAO COMUM;N;0;MINASCAIXA;BH;609447.04;809466.64;4462
+4464;2001247509;B03000;AMEACA;RUA JOEL JOSE DE;489;68698;7/5/2001 06:42:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605136.14;791090.50;4463
+4465;2001247608;B06000;LESAO CORPORAL;RUA W QUATRO;514;122634;7/5/2001 08:15:00;CIDADAO COMUM;N;0;PONGELUPE;BH;603929.62;787324.64;4464
+4466;2001247906;B04001;HOMICIDIO TENTAD;RUA JOSE FELIX M;1716;7416;7/5/2001 11:22:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606727.06;811723.89;4465
+4467;2001247964;B03000;AMEACA;RUA BARAO DE AIU;271;7835;7/5/2001 11:56:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604506.82;796526.27;4466
+4468;2001247991;B06000;LESAO CORPORAL;RUA GOIAS;151;31393;7/5/2001 12:17:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611426.58;796490.69;4467
+4469;2001248003;B06000;LESAO CORPORAL;RUA CONDE DE VAL;175;16758;7/5/2001 12:26:00;CIDADAO COMUM;N;0;NOVA CACHOEIRINH;BH;609756.08;801316.65;4468
+4470;2001248046;B03000;AMEACA;RUA BARAO DE COR;665;7910;7/5/2001 12:59:00;CIDADAO COMUM;N;0;SAO TOMAZ;BH;610090.94;805370.91;4469
+4471;2001248128;B06000;LESAO CORPORAL;RUA CURITIBA;400;19090;7/5/2001 14:06:00;INICIATIVA;S;0;CENTRO (BH);BH;610902.12;797451.92;4470
+4472;2001248142;B06000;LESAO CORPORAL;RUA FELIPE CAMAR;12;27938;7/5/2001 14:19:00;INICIATIVA;N;0;ESPLANADA;BH;613862.69;798419.73;4471
+4473;2001248286;B06000;LESAO CORPORAL;RUA DOS GUARANIS;169;32181;7/5/2001 15:49:00;INICIATIVA;S;0;CENTRO (BH);BH;610753.12;797462.10;4472
+4474;2001248370;B03000;AMEACA;RUA JOAQUIM ALVE;21;80887;7/5/2001 16:36:00;CIDADAO COMUM;N;;BETANIA;BH;605381.69;792920.20;4473
+4475;2001248490;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;88;17067;7/5/2001 17:39:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609523.31;798729.48;4474
+4476;2001248493;B03000;AMEACA;RUA BELA EMILIA;200;96175;7/5/2001 17:40:00;CIDADAO COMUM;S;;OLARIA;BH;601337.35;789370.00;4475
+4477;2001248512;B03000;AMEACA;RUA CASABLANCA;3;13850;7/5/2001 17:50:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604682.45;802172.96;4476
+4478;2001248543;B04002;HOMICIDIO CONSUM;RUA GUAICURUS;500;32009;7/5/2001 18:03:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611180.98;797650.33;4477
+4479;2001248631;B03000;AMEACA;RUA AMERICANOS;20;3254;7/5/2001 18:51:00;CIDADAO COMUM;S;0;FAZENDINHA;BH;603696.78;790070.38;4478
+4480;2001248736;B06000;LESAO CORPORAL;AV ABILIO MACHAD;3848;634;7/5/2001 19:41:00;CIDADAO COMUM;S;;SERRANO;BH;603259.17;800621.53;4479
+4481;2001248817;B06000;LESAO CORPORAL;RUA BARAO DO MON;960;63653;7/5/2001 20:24:00;CIDADAO COMUM;N;APTO-104;CARDOSO;BH;604059.47;787725.48;4480
+4482;2001248840;B04001;HOMICIDIO TENTAD;RUA RIO NOVO;129;58817;7/5/2001 20:41:00;INICIATIVA;N;0;LAGOINHA;BH;610648.13;798503.93;4481
+4483;2001248918;B03000;AMEACA;RUA CLAUDIO BRAN;340;15960;7/5/2001 21:34:00;CIDADAO COMUM;S;;TUPI;BH;612814.66;806637.99;4482
+4484;2001248981;B03000;AMEACA;AV PORTUGAL;1809;54816;7/5/2001 22:20:00;INICIATIVA;N;0;JARDIM ATLANTICO;BH;606307.50;805239.45;4483
+4485;2001249078;B06000;LESAO CORPORAL;RUA RODRIGUES AL;410;59126;7/5/2001 23:37:00;CIDADAO COMUM;N;AP101;PRADO LOPES;BH;610095.84;798792.47;4484
+4486;2001249185;B06000;LESAO CORPORAL;RUA SAIRA;307;48670;8/5/2001 01:54:00;CIDADAO COMUM;N;;GOIANIA;BH;615401.41;803182.53;4485
+4487;2001249218;B06000;LESAO CORPORAL;AV MONTESE;672;46675;8/5/2001 02:21:00;INICIATIVA;S;0;SANTA BRANCA;BH;608400.48;806406.08;4486
+4488;2001249666;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;253;6731;8/5/2001 10:25:00;INICIATIVA;N;0;CENTRO (BH);BH;611160.79;796551.47;4487
+4489;2001249723;B03000;AMEACA;RUA DO SERMAO;148;64990;8/5/2001 11:01:00;CIDADAO COMUM;S;;SAO JOSE;BH;605777.82;798909.90;4488
+4490;2001249731;B03000;AMEACA;RUA JANAITIBA;888;36889;8/5/2001 11:07:00;CIDADAO COMUM;S;;SAO GERALDO;BH;616130.34;799168.86;4489
+4491;2001249752;B06000;LESAO CORPORAL;RUA DAMASCO;451;19614;8/5/2001 11:19:00;INICIATIVA;S;0;SAO SALVADOR;BH;603250.69;799385.12;4490
+4492;2001249903;B03000;AMEACA;RUA CAMPESTRE;428;12063;8/5/2001 13:03:00;CIDADAO COMUM;S;FU;SAGRADA FAMILIA;BH;612910.03;798086.76;4491
+4493;2001249924;B03000;AMEACA;RUA JAIR LOPES C;48;122101;8/5/2001 13:12:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607851.73;810870.09;4492
+4494;2001249938;B03000;AMEACA;RUA ALEXANDRE LE;35;50162;8/5/2001 13:20:00;CIDADAO COMUM;N;;ESTRELA DALVA;BH;607696.16;792453.23;4493
+4495;2001249952;B03000;AMEACA;RUA NASCIMENTO;580;47261;8/5/2001 13:28:00;CIDADAO COMUM;S;0;FLAVIO MARQUES D;BH;604508.07;788992.97;4494
+4496;2001250073;B03000;AMEACA;RUA DA BAHIA;1148;81155;8/5/2001 14:49:00;INICIATIVA;S;SL1202;LOURDES;BH;611230.12;796512.50;4495
+4497;2001250149;B03000;AMEACA;RUA 51;114;302847;8/5/2001 15:29:00;CIDADAO COMUM;S;FU;NOVO AARAO REIS;BH;614109.28;805610.20;4496
+4498;2001250158;B03000;AMEACA;AV DOM PEDRO II;1900;53145;8/5/2001 15:35:00;CIDADAO COMUM;S;LJ154;CARLOS PRATES;BH;608983.67;798422.37;4497
+4499;2001250327;B06000;LESAO CORPORAL;RUA JANAITIBA;1347;36889;8/5/2001 17:02:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;616608.63;799314.07;4498
+4500;2001250329;B04001;HOMICIDIO TENTAD;RUA JAGUARA;601;36775;8/5/2001 17:03:00;CIDADAO COMUM;S;L;SAUDADE;BH;615359.14;797487.70;4499
+4501;2001250339;B03000;AMEACA;RUA SANTA LUZIA;175;60904;8/5/2001 17:10:00;CIDADAO COMUM;N;0;NOVA CINTRA;BH;605214.60;793215.43;4500
+4502;2001250587;B06000;LESAO CORPORAL;RUA SEBASTIAO MO;409;93555;8/5/2001 19:18:00;INICIATIVA;S;0;TIROL;BH;600565.02;789378.17;4501
+4503;2001250608;B06000;LESAO CORPORAL;RUA CORONEL ABIL;52;17518;8/5/2001 19:30:00;CIDADAO COMUM;S;0;CAETANO FURQUIM;BH;616348.03;799463.87;4502
+4504;2001250693;B06000;LESAO CORPORAL;RUA ANTONIO DE A;1080;4345;8/5/2001 20:24:00;INICIATIVA;S;0;LOURDES;BH;610929.46;795211.87;4503
+4505;2001250704;B06000;LESAO CORPORAL;RUA CANDIDO SIQU;307;12615;8/5/2001 20:29:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615150.40;800896.13;4504
+4506;2001250799;B05000;SEQUESTRO E CARC;AV PRESIDENTE AN;7823;4461;8/5/2001 21:25:00;CIDADAO COMUM;S;;SAO LUIZ;BH;608734.45;804398.54;4505
+4507;2001250835;B03000;AMEACA;RUA ALCINDO GUAN;31;98707;8/5/2001 21:47:00;CIDADAO COMUM;S;;CAMPO ALEGRE;BH;610349.19;806959.33;4506
+4508;2001250838;B03000;AMEACA;RUA REGENCIA;61;301448;8/5/2001 21:51:00;CIDADAO COMUM;N;CAB;VILA CAFEZAL;BH;614150.86;795438.09;4507
+4509;2001250851;B04002;HOMICIDIO CONSUM;RUA ESPIRITO SAN;946;26052;8/5/2001 21:58:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611138.96;796746.01;4508
+4510;2001250879;B03000;AMEACA;RUA SANTA INES D;44;94227;8/5/2001 22:19:00;CIDADAO COMUM;S;FU;SANTA CECILIA;BH;601180.74;788442.37;4509
+4511;2001250957;B03000;AMEACA;RUA CRUZEIRO DO ;291;75168;8/5/2001 23:08:00;CIDADAO COMUM;S;;COQUEIROS;BH;602379.66;799734.65;4510
+4512;2001250967;B08000;VIOLACAO DE DOMI;RUA MONTE SIAO;231;46559;8/5/2001 23:18:00;CIDADAO COMUM;N;0;SERRA;BH;613107.73;795189.59;4511
+4513;2001250992;B06000;LESAO CORPORAL;RUA GUAICURUS;451;32009;8/5/2001 23:37:00;INICIATIVA;N;0;CENTRO BH;BH;611210.22;797600.57;4512
+4514;2001251009;B03000;AMEACA;RUA DOS UAICAS;360;18970;8/5/2001 23:50:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;606735.24;807473.53;4513
+4515;2001251028;B04001;HOMICIDIO TENTAD;AV ANTONIO FRANC;33;53390;9/5/2001 00:07:00;INICIATIVA;N;0;BANDEIRANTES;BH;604326.94;804327.93;4514
+4516;2001251082;B03000;AMEACA;AV AMAZONAS;6768;3140;9/5/2001 00:39:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605414.68;795606.90;4515
+4517;2001251129;B06000;LESAO CORPORAL;RUA MARTE;400;44929;9/5/2001 01:33:00;CIDADAO COMUM;S;0;VILA SATELITE;BH;610232.40;808735.34;4516
+4518;2001251167;B06000;LESAO CORPORAL;RUA BORDA DA MAT;78;10171;9/5/2001 02:21:00;CIDADAO COMUM;S;;BONFIM;BH;609993.99;798314.38;4517
+4519;2001251309;B06000;LESAO CORPORAL;RUA JOSE CHRISTI;25;106949;9/5/2001 07:19:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605857.11;793405.06;4518
+4520;2001251441;B03000;AMEACA;RUA FREI GASPAR;157;29886;9/5/2001 08:54:00;CIDADAO COMUM;N;;CABANA;BH;604297.25;794201.39;4519
+4521;2001251538;B03000;AMEACA;RUA CAMILO DE BR;636;11896;9/5/2001 10:09:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;4520
+4522;2001251557;B03000;AMEACA;RUA DOUTOR SYLVI;925;123274;9/5/2001 10:17:00;CIDADAO COMUM;N;AP104;CASTELO;BH;604372.86;800845.50;4521
+4523;2001251581;B03000;AMEACA;RUA SANTO ANTONI;35;25986;9/5/2001 10:34:00;CIDADAO COMUM;S;;TAQUARIL;BH;617296.15;797925.88;4522
+4524;2001251679;B03000;AMEACA;RUA ZILDA REVERT;111;110612;9/5/2001 11:28:00;CIDADAO COMUM;N;;JARDIM GUANABARA;BH;611726.73;807911.32;4523
+4525;2001251715;B06000;LESAO CORPORAL;RUA RONDONIA;235;17127;9/5/2001 11:57:00;CIDADAO COMUM;S;0;GLORIA;BH;603466.48;798566.15;4524
+4526;2001251728;B04001;HOMICIDIO TENTAD;PRACA SAO VICENT;10;63902;9/5/2001 12:08:00;POLICIAL MILITAR;N;0;PADRE EUSTAQUIO;BH;605483.12;797829.06;4525
+4527;2001251748;B04001;HOMICIDIO TENTAD;RUA JOSE MAURO D;255;102125;9/5/2001 12:24:00;CIDADAO COMUM;S;;MINEIRAO;BH;601633.89;785370.24;4526
+4528;2001251750;B06000;LESAO CORPORAL;BECO CRAVO;20;301263;9/5/2001 12:27:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610463.43;793275.60;4527
+4529;2001251862;B06000;LESAO CORPORAL;AV AFONSO PENA;590;1259;9/5/2001 13:51:00;INICIATIVA;N;0;CENTRO BH;BH;611078.27;797193.62;4528
+4530;2001251905;B06000;LESAO CORPORAL;RUA PLATINA;1640;54453;9/5/2001 14:22:00;CIDADAO COMUM;N;0;CALAFATE;BH;607780.27;796697.87;4529
+4531;2001251930;B03000;AMEACA;AV GUARAPARI;126;20711;9/5/2001 14:38:00;CIDADAO COMUM;S;;JARDIM ATLANTICO;BH;607081.25;805991.12;4530
+4532;2001252019;B06000;LESAO CORPORAL;RUA QUINTA DA BO;60;99841;9/5/2001 15:33:00;CIDADAO COMUM;S;;VILA SANTA BRANC;BH;605014.26;809772.21;4531
+4533;2001252026;B04001;HOMICIDIO TENTAD;RUA JOAO PIRES;397;37866;9/5/2001 15:38:00;CIDADAO COMUM;S;;CABANA;BH;604773.50;794306.75;4532
+4534;2001252171;B06000;LESAO CORPORAL;RUA JOAO PIRES;1;37866;9/5/2001 16:58:00;CIDADAO COMUM;S;0;JARDINOPOLIS;BH;604514.03;794634.06;4533
+4535;2001252172;B04001;HOMICIDIO TENTAD;RUA ABILIO FERNA;381;95421;9/5/2001 17:02:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616838.69;804321.77;4534
+4536;2001252178;B03000;AMEACA;RUA MIRAI;122;45919;9/5/2001 17:05:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609482.35;798454.10;4535
+4537;2001252223;B03000;AMEACA;RUA BURI;61;10764;9/5/2001 17:29:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610312.98;801362.88;4536
+4538;2001252455;B04001;HOMICIDIO TENTAD;RUA JOAO LUIZ DE;410;37765;9/5/2001 19:30:00;CIDADAO COMUM;S;0;NOVA CACHOEIRINH;BH;609353.56;800937.01;4537
+4539;2001252497;B06000;LESAO CORPORAL;RUA F;198;41280;9/5/2001 19:55:00;CIDADAO COMUM;S;CAFR;CH CONFISCO;BH;602835.56;803046.97;4538
+4540;2001252506;B03000;AMEACA;RUA ILMENITA;237;82117;9/5/2001 19:59:00;CIDADAO COMUM;S;AP206;GLALIJA;BH;603069.39;794320.03;4539
+4541;2001252550;B03000;AMEACA;RUA MINERVA;640;45846;9/5/2001 20:29:00;CIDADAO COMUM;S;AP101;ADELAIDE;BH;607168.91;798964.10;4540
+4542;2001252585;B03000;AMEACA;RUA ARACATI;71;5307;9/5/2001 21:03:00;CIDADAO COMUM;S;AP302;NOVA SUISSA;BH;607257.82;795899.28;4541
+4543;2001252624;B03000;AMEACA;RUA JOAO SOARES ;23;74111;9/5/2001 21:22:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607768.98;811531.53;4542
+4544;2001252725;B03000;AMEACA;RUA SIRIUS;93;88113;9/5/2001 22:16:00;INICIATIVA;S;0;SANTA CRUZ (BARR;BH;603753.99;789251.72;4543
+4545;2001252726;B03000;AMEACA;RUA JOSE FELIX M;1716;7416;9/5/2001 22:16:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606727.06;811723.89;4544
+4546;2001252732;B06000;LESAO CORPORAL;RUA K;35;36599;9/5/2001 22:17:00;CIDADAO COMUM;N;0;MINASCAIXA;BH;609084.97;809987.42;4545
+4547;2001252750;B03000;AMEACA;RUA MODELO;152;46026;9/5/2001 22:34:00;CIDADAO COMUM;N;0;MARIA VIRGINIA;BH;612120.40;802858.31;4546
+4548;2001252842;B06000;LESAO CORPORAL;AV SILVA LOBO;1600;65889;9/5/2001 23:38:00;CIDADAO COMUM;S;;GRAJAU;BH;607981.65;795035.94;4547
+4549;2001252859;B06000;LESAO CORPORAL;AV AFONSO PENA;3357;1259;9/5/2001 23:54:00;CIDADAO COMUM;S;0;CRUZEIRO;BH;612514.75;794823.74;4548
+4550;2001252865;B03000;AMEACA;RUA GUSTAVO DA S;1693;32617;10/5/2001 00:01:00;CIDADAO COMUM;N;;SANTA INES;BH;613754.67;800364.22;4549
+4551;2001252876;B03000;AMEACA;RUA JOAO ERMES;4;116561;10/5/2001 00:09:00;CIDADAO COMUM;S;0;PARAISO;BH;614519.97;796126.23;4550
+4552;2001252886;B03000;AMEACA;RUA TORONTO;70;100350;10/5/2001 00:13:00;CIDADAO COMUM;S;0;TREVO;BH;604033.51;806095.79;4551
+4553;2001252988;B03000;AMEACA;RUA CAMBE;126;40250;10/5/2001 01:52:00;CIDADAO COMUM;S;0;COQUEIROS;BH;602264.49;799116.82;4552
+4554;2001253024;B06000;LESAO CORPORAL;RUA FLOR DAS PED;690;28801;10/5/2001 02:38:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;606323.95;799397.43;4553
+4555;2001253106;B03000;AMEACA;RUA JANAUBA;320;36891;10/5/2001 05:00:00;CIDADAO COMUM;N;0;VISTA ALEGRE;BH;604453.47;793310.88;4554
+4556;2001253244;B03000;AMEACA;RUA JACUTINGA;808;36750;10/5/2001 08:18:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;605679.99;797701.48;4555
+4557;2001253246;B03000;AMEACA;RUA QUEOPS;131;60021;10/5/2001 08:17:00;CIDADAO COMUM;N;0;VISTA ALEGRE;BH;604351.56;793342.99;4556
+4558;2001253429;B06000;LESAO CORPORAL;RUA DO LAGO;147;40161;10/5/2001 10:38:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614062.40;802766.77;4557
+4559;2001253441;B06000;LESAO CORPORAL;RUA SANTA ALEXAN;1030;60309;10/5/2001 10:50:00;CIDADAO COMUM;S;CS;ARAGUAIA;BH;604760.87;789628.98;4558
+4560;2001253475;B06000;LESAO CORPORAL;RUA CODAJAS;980;77898;10/5/2001 11:20:00;INICIATIVA;S;0;SAO GABRIEL;BH;613552.43;804595.92;4559
+4561;2001253510;B03000;AMEACA;RUA STA HELENA;103;60670;10/5/2001 11:46:00;INICIATIVA;N;0;SERRA;BH;613322.81;794435.59;4560
+4562;2001253541;B03000;AMEACA;RUA CORCOVADO;136;14894;10/5/2001 12:18:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;606973.95;794896.86;4561
+4563;2001253573;B03000;AMEACA;RUA VIOLETA DOS ;146;3989;10/5/2001 12:47:00;CIDADAO COMUM;S;;LINDEIA;BH;599182.03;790934.89;4562
+4564;2001253608;B03000;AMEACA;RUA ENGENHO DO S;1031;80427;10/5/2001 13:14:00;CIDADAO COMUM;S;0;ENGENHO NOGUEIRA;BH;606142.82;800344.91;4563
+4565;2001253831;B03000;AMEACA;AV JOSE BONIFACI;189;38579;10/5/2001 15:50:00;INICIATIVA;S;;PRADO LOPES;BH;610210.56;798939.37;4564
+4566;2001253991;B03000;AMEACA;RUA SANTA FRANCI;179;60655;10/5/2001 17:05:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608755.22;800253.46;4565
+4567;2001254092;B03000;AMEACA;AV ERICO VERISSI;500;41671;10/5/2001 17:50:00;INICIATIVA;N;0;SAO JOAO BATISTA;BH;608155.75;808592.03;4566
+4568;2001254109;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;1492;57830;10/5/2001 17:57:00;INICIATIVA;N;0;CIDADE JARDIM;BH;608850.52;794091.22;4567
+4569;2001254114;B03000;AMEACA;RUA FERNAO DIAS;251;28133;10/5/2001 17:58:00;CIDADAO COMUM;N;0;CASA BRANCA;BH;615998.48;798638.40;4568
+4570;2001254147;B06000;LESAO CORPORAL;RUA CORONEL JOSE;20;17892;10/5/2001 18:14:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610767.91;802211.31;4569
+4571;2001254205;B06000;LESAO CORPORAL;RUA PASSOS;346;52458;10/5/2001 18:42:00;CIDADAO COMUM;S;AP204;CARLOS PRATES;BH;608956.39;798267.55;4570
+4572;2001254256;B03000;AMEACA;RUA ANTONIO SILV;90;87108;10/5/2001 19:07:00;CIDADAO COMUM;S;BLOCO 201;DA LAGOA;BH;604689.68;808944.30;4571
+4573;2001254276;B03000;AMEACA;RUA PORTO;890;60601;10/5/2001 19:13:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;608967.59;801936.11;4572
+4574;2001254344;B03000;AMEACA;RUA ALEXANDRE LE;6;50162;10/5/2001 19:55:00;CIDADAO COMUM;S;;ESTRELA DALVA;BH;607625.18;792478.81;4573
+4575;2001254455;B02000;RIXA;RUA PINTOR ATAID;390;53870;10/5/2001 20:55:00;CIDADAO COMUM;S;;TUPI;BH;613618.30;805975.02;4574
+4576;2001254485;B03000;AMEACA;RUA TUBARAO;56;69791;10/5/2001 21:11:00;CIDADAO COMUM;S;;CARDOSO;BH;604185.10;788056.10;4575
+4577;2001254513;B06000;LESAO CORPORAL;RUA LINCOLN;167;41136;10/5/2001 21:26:00;CIDADAO COMUM;N;0;UNIAO;BH;612532.35;801354.69;4576
+4578;2001254514;B06000;LESAO CORPORAL;RUA LUIZ CASTANH;495;41697;10/5/2001 21:26:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610908.25;802008.16;4577
+4579;2001254518;B04001;HOMICIDIO TENTAD;RUA SAO PEDRO DA;38;102989;10/5/2001 21:31:00;INICIATIVA;S;0;OLHOS DAGUA;BH;608147.07;788329.74;4578
+4580;2001254545;B03000;AMEACA;RUA JOAQUIM DE F;1265;38033;10/5/2001 21:46:00;CIDADAO COMUM;S;0;SANTA HELENA (BH;BH;603033.64;790158.08;4579
+4581;2001254652;B04002;HOMICIDIO CONSUM;RUA SERENATA;467;172351;10/5/2001 23:04:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614363.58;795470.27;4580
+4582;2001254691;B03000;AMEACA;RUA ARTUR DE SA;956;6211;10/5/2001 23:24:00;CIDADAO COMUM;S;0;UNIAO;BH;612941.69;801856.30;4581
+4583;2001254693;B03000;AMEACA;RUA ONOFRE D`OLI;225;84746;10/5/2001 23:26:00;CIDADAO COMUM;N;LJB;DA LAGOA;BH;604554.22;809621.65;4582
+4584;2001254717;B04001;HOMICIDIO TENTAD;AV ELISIO DE BRI;777;25251;10/5/2001 23:43:00;CIDADAO COMUM;N;;BOA VISTA;BH;615141.65;799844.87;4583
+4585;2001254722;B04001;HOMICIDIO TENTAD;RUA STO ANTONIO ;671;61806;10/5/2001 23:46:00;CIDADAO COMUM;S;AP101;SANTO ANTONIO;BH;610832.25;793990.71;4584
+4586;2001254870;B03000;AMEACA;RUA BRUGES;29;86694;11/5/2001 02:02:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;608435.52;810233.73;4585
+4587;2001254908;B06000;LESAO CORPORAL;AV PRUDENTE DE M;569;55774;11/5/2001 02:59:00;CIDADAO COMUM;S;;SANTO ANTONIO;BH;610114.08;794733.79;4586
+4588;2001254923;B06000;LESAO CORPORAL;AV AFONSO PENA;329;1259;11/5/2001 03:25:00;CIDADAO COMUM;S;PX262;CENTRO (BH);BH;610993.53;797462.63;4587
+4589;2001254939;B06000;LESAO CORPORAL;AV GETULIO VARGA;710;81256;11/5/2001 03:43:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611981.03;795397.59;4588
+4590;2001255241;B03000;AMEACA;RUA QUINTINO SIM;85;96903;11/5/2001 09:19:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615085.10;805917.04;4589
+4591;2001255370;B04001;HOMICIDIO TENTAD;RUA POUSO ALEGRE;1333;54932;11/5/2001 10:47:00;INICIATIVA;N;0;FLORESTA;BH;612371.12;797930.27;4590
+4592;2001255480;B03000;AMEACA;AV DO CONTORNO;9384;17228;11/5/2001 11:59:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609125.98;796561.06;4591
+4593;2001255571;B02000;RIXA;RUA BOAVENTURA;1878;9783;11/5/2001 13:08:00;INICIATIVA;N;0;LIBERDADE;BH;609483.47;804149.44;4592
+4594;2001255627;B06000;LESAO CORPORAL;AV DO CONTORNO;12;17228;11/5/2001 13:40:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610893.99;797847.30;4593
+4595;2001255641;B06000;LESAO CORPORAL;PRACA CARLOS CHA;60;13328;11/5/2001 13:48:00;CIDADAO COMUM;S;INICIATIVA POV 5;SANTO AGOSTINHO;BH;610052.84;795756.23;4594
+4596;2001255646;B06000;LESAO CORPORAL;RUA DOM FERRAO;74;22225;11/5/2001 13:51:00;CIDADAO COMUM;S;;SAO JOSE;BH;605189.39;798429.64;4595
+4597;2001255733;B03000;AMEACA;AV FRANCISCO SA;787;29656;11/5/2001 14:58:00;CIDADAO COMUM;S;;PRADO;BH;608927.04;796068.26;4596
+4598;2001255870;B04001;HOMICIDIO TENTAD;RUA CAPELINHA;400;12785;11/5/2001 16:14:00;INICIATIVA;N;0;SERRA;BH;613522.48;794649.03;4597
+4599;2001255937;B06000;LESAO CORPORAL;RUA DOS EXPEDICI;570;26989;11/5/2001 16:44:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;606784.87;805558.89;4598
+4600;2001256002;B03000;AMEACA;AV TERESA CRISTI;2900;67512;11/5/2001 17:23:00;CIDADAO COMUM;S;;CALAFATE;BH;606779.86;796797.64;4599
+4601;2001256059;B06000;LESAO CORPORAL;RUA SAO PAULO;779;63464;11/5/2001 17:49:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610959.32;797010.67;4600
+4602;2001256203;B08000;VIOLACAO DE DOMI;RUA ALBUQUERQUE ;77;10880;11/5/2001 19:06:00;CIDADAO COMUM;N;;CAMPO ALEGRE;BH;610445.17;807211.91;4601
+4603;2001256263;B03000;AMEACA;AV TERESA CRISTI;685;67512;11/5/2001 19:38:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;602258.86;791337.75;4602
+4604;2001256401;B03000;AMEACA;RUA JOAQUIM FRAN;739;38046;11/5/2001 20:46:00;CIDADAO COMUM;S;;IPIRANGA;BH;611821.21;801601.31;4603
+4605;2001256429;B03000;AMEACA;RUA VERISSIMO GU;119;102720;11/5/2001 20:58:00;INICIATIVA;S;0;ITAIPU BH;BH;598941.05;789762.58;4604
+4606;2001256448;B06000;LESAO CORPORAL;RUA PROGRESSO;112;55759;11/5/2001 21:14:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607146.45;796825.23;4605
+4607;2001256494;B06000;LESAO CORPORAL;RUA DAVID RABELO;769;19702;11/5/2001 21:36:00;CIDADAO COMUM;S;CSCSA;INCONFIDENCIA;BH;604970.59;798819.86;4606
+4608;2001256569;B04001;HOMICIDIO TENTAD;RUA CONCEICAO DE;378;16515;11/5/2001 22:30:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605972.65;807322.31;4607
+4609;2001256632;B03000;AMEACA;RUA DAS TABOADAS;55;300190;11/5/2001 23:08:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608788.79;808021.90;4608
+4610;2001256740;B03000;AMEACA;AV DOM JOAO VI;1010;22294;12/5/2001 00:12:00;INICIATIVA;S;0;PALMEIRAS;BH;606644.46;791666.74;4609
+4611;2001256745;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;652;67682;12/5/2001 00:15:00;INICIATIVA;N;0;FUNCIONARIOS;BH;612095.69;796055.44;4610
+4612;2001256755;B06000;LESAO CORPORAL;RUA LINDOLFO DE ;1263;41164;12/5/2001 00:25:00;INICIATIVA;N;0;JARDIM AMERICA;BH;607430.53;794486.80;4611
+4613;2001256780;B04002;HOMICIDIO CONSUM;RUA CARACA;1071;12990;12/5/2001 00:37:00;CIDADAO COMUM;N;AP502;SERRA;BH;613823.56;794597.43;4612
+4614;2001256786;B03000;AMEACA;RUA CONSELHEIRO ;2303;17095;12/5/2001 00:39:00;CIDADAO COMUM;S;CS;SANTA EFIGENIA;BH;613771.63;797289.73;4613
+4615;2001256796;B06000;LESAO CORPORAL;RUA BRAZOPOLIS;121;10521;12/5/2001 00:46:00;CIDADAO COMUM;N;;FLORESTA;BH;612251.86;797133.18;4614
+4616;2001256802;B03000;AMEACA;RUA AGUAS DA PRA;11;13706;12/5/2001 00:50:00;CIDADAO COMUM;S;0;ITAIPU BH;BH;599099.77;789179.92;4615
+4617;2001256838;B06000;LESAO CORPORAL;RUA APORE;200;5099;12/5/2001 01:12:00;INICIATIVA;N;0;PARQUE RIACHUELO;BH;609728.86;800605.94;4616
+4618;2001256881;B06000;LESAO CORPORAL;RUA GUAICURUS;618;32009;12/5/2001 01:40:00;CIDADAO COMUM;S;EN618;CENTRO (BH);BH;611072.00;797681.10;4617
+4619;2001256912;B02000;RIXA;AV ITAITUBA;184;35454;12/5/2001 02:08:00;CIDADAO COMUM;S;0;BOA VISTA;BH;614838.03;799461.10;4618
+4620;2001256996;B06000;LESAO CORPORAL;RUA FREI CRISTOV;149;58278;12/5/2001 03:10:00;CIDADAO COMUM;N;;VILA OESTE;BH;605116.46;795770.62;4619
+4621;2001256998;B06000;LESAO CORPORAL;RUA ANGATURAMA;20;3935;12/5/2001 03:12:00;INICIATIVA;S;0;SAO PAULO;BH;612443.80;802655.56;4620
+4622;2001257019;B04001;HOMICIDIO TENTAD;BECO SANTA CATAR;40;170255;12/5/2001 03:36:00;CIDADAO COMUM;S;;CABANA;BH;604766.78;794259.59;4621
+4623;2001257030;B03000;AMEACA;RUA SAO CRISTOVA;5;25378;12/5/2001 03:46:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617079.81;797404.89;4622
+4624;2001257031;B06000;LESAO CORPORAL;PRACA IRAJA;10;34928;12/5/2001 03:47:00;INICIATIVA;N;0;SAO CRISTOVAO;BH;610536.61;799448.54;4623
+4625;2001257035;B03000;AMEACA;RUA CANTORA MAYS;47;129431;12/5/2001 03:48:00;CIDADAO COMUM;S;0;TUPI;BH;614037.14;806688.21;4624
+4626;2001257078;B06000;LESAO CORPORAL;RUA ISABEL BUENO;1421;35136;12/5/2001 04:21:00;CIDADAO COMUM;S;0;JARAGUA;BH;609989.71;804029.32;4625
+4627;2001257096;B06000;LESAO CORPORAL;RUA ALOIZIO NOGU;45;73005;12/5/2001 04:33:00;CIDADAO COMUM;S;;PLANALTO;BH;609451.75;807323.17;4626
+4628;2001257201;B03000;AMEACA;RUA QUITANDINHA;123;57600;12/5/2001 06:32:00;CIDADAO COMUM;N;;SERRANO;BH;603488.06;800504.16;4627
+4629;2001257238;B06000;LESAO CORPORAL;RUA ARTUR DE SA;1098;6211;12/5/2001 07:18:00;CIDADAO COMUM;S;;UNIAO;BH;613434.92;801356.54;4628
+4630;2001257424;B03000;AMEACA;RUA RIO DAS FLOR;180;92770;12/5/2001 09:56:00;CIDADAO COMUM;S;0;PILAR;BH;607838.63;788171.21;4629
+4631;2001257509;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;9;300224;12/5/2001 11:07:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610432.17;793618.37;4630
+4632;2001257550;B03000;AMEACA;RUA GRAO MOGOL;202;31769;12/5/2001 11:30:00;INICIATIVA;S;0;CARMO;BH;611751.26;794655.75;4631
+4633;2001257562;B06000;LESAO CORPORAL;RUA BURI;51;10764;12/5/2001 11:39:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610328.10;801370.73;4632
+4634;2001257579;B03000;AMEACA;RUA CORONEL JOAQ;1210;87063;12/5/2001 11:51:00;CIDADAO COMUM;S;CA3;CEU AZUL;BH;605036.32;808629.66;4633
+4635;2001257598;B06000;LESAO CORPORAL;RUA CASTIGLIANO;728;14056;12/5/2001 12:00:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607280.97;797470.91;4634
+4636;2001257617;B03000;AMEACA;RUA MESSIAS COUT;200;127580;12/5/2001 12:18:00;INICIATIVA;N;0;CEU AZUL;BH;604895.88;807321.01;4635
+4637;2001257650;B03000;AMEACA;RUA SAO PAULO;834;63464;12/5/2001 12:38:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610919.36;796978.01;4636
+4638;2001257662;B03000;AMEACA;RUA JULIO MESQUI;283;81849;12/5/2001 12:41:00;CIDADAO COMUM;N;0;ITAIPU BH;BH;599468.18;788771.65;4637
+4639;2001257669;B03000;AMEACA;RUA SERRA DA MAN;965;109240;12/5/2001 12:49:00;CIDADAO COMUM;N;AP301;ANTONIO RIBEIRO ;BH;614881.68;807326.00;4638
+4640;2001257680;B06000;LESAO CORPORAL;RUA ALBERT SCHAR;7;1854;12/5/2001 12:57:00;CIDADAO COMUM;S;;MAGNESITA;BH;604047.83;793934.04;4639
+4641;2001257717;B06000;LESAO CORPORAL;AV DOUTOR ALVARO;800;117665;12/5/2001 13:25:00;CIDADAO COMUM;S;0;SANTA BRANCA;BH;608440.88;807202.81;4640
+4642;2001257731;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;990;6353;12/5/2001 13:34:00;INICIATIVA;S;0;FLORESTA;BH;611413.87;797012.89;4641
+4643;2001257750;B06000;LESAO CORPORAL;RUA LEVI FREIRE;250;116546;12/5/2001 13:44:00;CIDADAO COMUM;N;0;PARAISO;BH;614520.44;796034.35;4642
+4644;2001257817;B06000;LESAO CORPORAL;RUA E;153;78718;12/5/2001 14:20:00;CIDADAO COMUM;N;;CH JATOBA IV;BH;600281.70;787829.99;4643
+4645;2001257833;B06000;LESAO CORPORAL;RUA RONDONIA;236;17127;12/5/2001 14:29:00;CIDADAO COMUM;N;CAFR;GLORIA;BH;603443.13;798525.97;4644
+4646;2001257838;B03000;AMEACA;RUA MARIA GERTRU;219;98993;12/5/2001 14:34:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604827.21;808352.50;4645
+4647;2001257858;B03000;AMEACA;AV UM;860;301245;12/5/2001 14:49:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614827.68;805630.99;4646
+4648;2001257878;B03000;AMEACA;RUA PROMISSOES;202;55761;12/5/2001 14:58:00;CIDADAO COMUM;S;0;NOVA ESPERANCA;BH;608818.71;799315.46;4647
+4649;2001257922;B06000;LESAO CORPORAL;RUA RADIALISTA M;15;79562;12/5/2001 15:23:00;CIDADAO COMUM;S;;CEU AZUL;BH;604475.94;808710.04;4648
+4650;2001257973;B03000;AMEACA;AV CRISTIANO MAC;542;18652;12/5/2001 15:43:00;CIDADAO COMUM;S;;DA GRACA;BH;612039.80;798916.59;4649
+4651;2001258015;B03000;AMEACA;RUA CAPITAO NELS;315;72002;12/5/2001 16:04:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609032.48;808918.34;4650
+4652;2001258028;B03000;AMEACA;RUA QUATRO DE MA;5;57118;12/5/2001 16:15:00;INICIATIVA;S;0;LEONINA;BH;608663.34;793662.61;4651
+4653;2001258049;B06000;LESAO CORPORAL;RUA CONCEICAO DA;500;14258;12/5/2001 16:23:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604382.93;802978.96;4652
+4654;2001258098;B06000;LESAO CORPORAL;RUA LUIZ VAZ DE ;61;105089;12/5/2001 16:49:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616937.66;797132.02;4653
+4655;2001258176;B03000;AMEACA;RUA JOAO ALFREDO;55;37447;12/5/2001 17:29:00;CIDADAO COMUM;N;CS;HORTO;BH;613927.89;798257.61;4654
+4656;2001258215;B06000;LESAO CORPORAL;RUA CORONEL PEDR;199;18031;12/5/2001 17:46:00;CIDADAO COMUM;N;0;CIDADE NOVA;BH;612288.62;800421.50;4655
+4657;2001258223;B03000;AMEACA;AV ARI BARROSO;430;5902;12/5/2001 17:51:00;CIDADAO COMUM;S;FU;TUPI;BH;612787.40;806269.41;4656
+4658;2001258271;B06000;LESAO CORPORAL;RUA DOS INDEPEND;121;109165;12/5/2001 18:11:00;CIDADAO COMUM;S;;VILA SANTA RITA;BH;601142.53;787637.02;4657
+4659;2001258273;B03000;AMEACA;RUA DOS AEROVIAR;290;1186;12/5/2001 18:11:00;CIDADAO COMUM;S;0;LIBERDADE;BH;609377.19;803887.06;4658
+4660;2001258286;B03000;AMEACA;RUA SAGRES;101;59889;12/5/2001 18:19:00;CIDADAO COMUM;N;AP301;BARROCA;BH;607891.35;796012.94;4659
+4661;2001258297;B06000;LESAO CORPORAL;RUA ODILIA GONCA;52;49080;12/5/2001 18:33:00;CIDADAO COMUM;N;;PIRAJA;BH;614070.68;803150.89;4660
+4662;2001258304;B03000;AMEACA;RUA JOAQUIM CARD;414;71835;12/5/2001 18:35:00;CIDADAO COMUM;S;;TUPI;BH;613454.61;806454.28;4661
+4663;2001258307;B06000;LESAO CORPORAL;RUA DEZESSEIS;49;32821;12/5/2001 18:36:00;CIDADAO COMUM;S;SUPERMERCADO VEM;CONJUNTO FELICID;BH;612162.50;807188.97;4662
+4664;2001258333;B06000;LESAO CORPORAL;RUA L;117;78787;12/5/2001 18:51:00;CIDADAO COMUM;S;;CH JATOBA IV;BH;600594.32;787827.80;4663
+4665;2001258352;B06000;LESAO CORPORAL;RUA SENHOR DOS P;175;64817;12/5/2001 18:58:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609781.32;802567.71;4664
+4666;2001258372;B06000;LESAO CORPORAL;AV AFONSO PENA;1901;1259;12/5/2001 19:07:00;INICIATIVA;N;0;FUNCIONARIOS;BH;611800.51;796073.43;4665
+4667;2001258405;B03000;AMEACA;RUA ELIZABETH;194;80200;12/5/2001 19:18:00;CIDADAO COMUM;S;;COQUEIROS;BH;602038.28;798951.11;4666
+4668;2001258412;B04001;HOMICIDIO TENTAD;RUA OTAVIANO FAB;110;63307;12/5/2001 19:23:00;CIDADAO COMUM;S;CSFR;APARECIDA SETIMA;BH;608857.09;801112.17;4667
+4669;2001258432;B03000;AMEACA;AV PRESIDENTE AN;852;4461;12/5/2001 19:30:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610473.85;798803.90;4668
+4670;2001258474;B03000;AMEACA;RUA MUQUICABA;210;65343;12/5/2001 19:50:00;CIDADAO COMUM;0;;COQUEIROS;BH;602234.45;798202.08;4669
+4671;2001258510;B03000;AMEACA;RUA JOAQUIM ASSI;26;92679;12/5/2001 20:11:00;CIDADAO COMUM;S;;CALIFORNIA;BH;603354.37;796982.95;4670
+4672;2001258518;B03000;AMEACA;RUA AUGUSTO MEIE;95;6757;12/5/2001 20:14:00;CIDADAO COMUM;S;CAA;TUPI;BH;613750.20;805945.30;4671
+4673;2001258559;B04002;HOMICIDIO CONSUM;RUA MONSENHOR PA;3;46329;12/5/2001 20:34:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;604730.86;793414.75;4672
+4674;2001258618;B06000;LESAO CORPORAL;RUA JOSE MARIA B;425;38380;12/5/2001 21:07:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;607704.21;807669.09;4673
+4675;2001258644;B03000;AMEACA;RUA ALBERT SCHAR;84;1854;12/5/2001 21:16:00;CIDADAO COMUM;N;0;MAGNESITA;BH;603931.13;793864.90;4674
+4676;2001258665;B04001;HOMICIDIO TENTAD;RUA APORE;193;5099;12/5/2001 21:25:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;609739.93;800581.13;4675
+4677;2001258690;B03000;AMEACA;AV PRESIDENTE CA;3001;55125;12/5/2001 21:37:00;INICIATIVA;S;INICIATIVA VP780;CAICARA;BH;608178.06;800324.32;4676
+4678;2001258700;B03000;AMEACA;RUA NOVA PONTE;308;48466;12/5/2001 21:46:00;INICIATIVA;S;102;SALGADO FILHO;BH;606459.09;794174.01;4677
+4679;2001258701;B06000;LESAO CORPORAL;RUA PEREIRA PASS;287;53375;12/5/2001 21:46:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610162.72;798759.81;4678
+4680;2001258710;B06000;LESAO CORPORAL;RUA CONCEICAO DE;488;16515;12/5/2001 21:47:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605827.11;807322.29;4679
+4681;2001258721;B06000;LESAO CORPORAL;RUA EXPEDITO FLA;557;84847;12/5/2001 21:57:00;CIDADAO COMUM;S;;DA LAGOA;BH;604351.06;809302.59;4680
+4682;2001258729;B06000;LESAO CORPORAL;RUA PERNAMBUCO;1299;53463;12/5/2001 22:02:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;611431.27;794981.10;4681
+4683;2001258731;B03000;AMEACA;RUA SAO JERONIMO;1271;79102;12/5/2001 22:03:00;CIDADAO COMUM;N;0;INSTITUTO AGRONO;BH;613760.56;799445.72;4682
+4684;2001258748;B03000;AMEACA;AV PRESIDENTE CA;3001;55125;12/5/2001 22:14:00;INICIATIVA;S;0;CAICARA;BH;608178.06;800324.32;4683
+4685;2001258751;B03000;AMEACA;RUA CASTELO DO P;167;47930;12/5/2001 22:14:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;613593.07;804563.66;4684
+4686;2001258784;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;12/5/2001 22:32:00;CIDADAO COMUM;S;0;VENDA NOVA;BH;609671.68;808130.71;4685
+4687;2001258791;B06000;LESAO CORPORAL;RUA DA BAHIA;2115;81155;12/5/2001 22:39:00;CIDADAO COMUM;S;0;LOURDES;BH;611025.25;795571.99;4686
+4688;2001258840;B03000;AMEACA;RUA CASSITERITA;292;5612;12/5/2001 23:07:00;CIDADAO COMUM;S;FU;SANTA INES;BH;614227.45;800375.00;4687
+4689;2001258888;B05000;SEQUESTRO E CARC;AV PRESIDENTE AN;4013;4461;12/5/2001 23:28:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609536.57;802154.10;4688
+4690;2001258889;B06000;LESAO CORPORAL;RUA JOSE BARTOLO;80;38525;12/5/2001 23:31:00;CIDADAO COMUM;S;;CONJUNTO ALIPIO ;BH;603707.54;799638.81;4689
+4691;2001258894;B03000;AMEACA;RUA MARIA MARTIN;1594;44248;12/5/2001 23:33:00;CIDADAO COMUM;S;AP102;SAGRADA FAMILIA;BH;613282.33;799066.17;4690
+4692;2001258932;B06000;LESAO CORPORAL;AV DOUTOR ALVARO;850;117665;13/5/2001 00:04:00;INICIATIVA;N;0;SANTA MONICA;BH;608763.01;807333.73;4691
+4693;2001258938;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;1051;7936;13/5/2001 00:09:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607839.34;794525.74;4692
+4694;2001259004;B04001;HOMICIDIO TENTAD;RUA VINTE E UM;112;122095;13/5/2001 00:56:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607804.35;811033.87;4693
+4695;2001259034;B06000;LESAO CORPORAL;AV SANTOS DUMONT;680;61950;13/5/2001 01:18:00;INICIATIVA;S;0;CENTRO BH;BH;610999.13;797614.04;4694
+4696;2001259042;B08000;VIOLACAO DE DOMI;RUA DIAMANTINA;983;21162;13/5/2001 01:23:00;CIDADAO COMUM;N;;LAGOINHA;BH;610536.33;798826.01;4695
+4697;2001259058;B06000;LESAO CORPORAL;RUA FORMIGA;50;29136;13/5/2001 01:29:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610336.11;798756.88;4696
+4698;2001259073;B06000;LESAO CORPORAL;RUA DOS CARIJOS;412;81243;13/5/2001 01:38:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611080.93;797191.84;4697
+4699;2001259088;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;13/5/2001 01:49:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;4698
+4700;2001259091;B06000;LESAO CORPORAL;RUA DIRAMIR LOUR;384;70530;13/5/2001 01:50:00;CIDADAO COMUM;N;AN      CA2;TIROL;BH;600155.33;789384.39;4699
+4701;2001259106;B04001;HOMICIDIO TENTAD;RUA RAMIRO SIQUE;325;128858;13/5/2001 02:02:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617477.62;797374.15;4700
+4702;2001259137;B06000;LESAO CORPORAL;RUA PROGRESSO;1375;55759;13/5/2001 02:21:00;CIDADAO COMUM;S;0;MONSENHOR MESSIA;BH;607167.73;798091.18;4701
+4703;2001259187;B06000;LESAO CORPORAL;RUA SAO BORJA;568;61620;13/5/2001 02:57:00;CIDADAO COMUM;N;;BOA VISTA;BH;615135.57;800346.41;4702
+4704;2001259312;B06000;LESAO CORPORAL;RUA FERNANDES TO;245;81271;13/5/2001 04:27:00;CIDADAO COMUM;S;FR250;FUNCIONARIOS;BH;611285.26;794930.19;4703
+4705;2001259339;B04002;HOMICIDIO CONSUM;RUA CURITIBA;32;19090;13/5/2001 04:57:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610999.16;797826.98;4704
+4706;2001259357;B06000;LESAO CORPORAL;AV OLINTO MEIREL;2507;49847;13/5/2001 05:24:00;INICIATIVA;N;0;ARAGUAIA;BH;603968.63;788996.75;4705
+4707;2001259390;B06000;LESAO CORPORAL;RUA MAJOR WALTER;129;72390;13/5/2001 06:31:00;CIDADAO COMUM;N;CASA 03;PLANALTO;BH;609728.93;807677.63;4706
+4708;2001259396;B04001;HOMICIDIO TENTAD;RUA ARAPARI;43;5410;13/5/2001 06:38:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615934.87;799624.71;4707
+4709;2001259453;B04001;HOMICIDIO TENTAD;AV DOM PEDRO I;175;48337;13/5/2001 08:02:00;CIDADAO COMUM;N;0;JARDIM ATLANTICO;BH;608131.43;805671.13;4708
+4710;2001259543;B03000;AMEACA;RUA GUARAIBA;198;96291;13/5/2001 09:15:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614587.96;804585.04;4709
+4711;2001259612;B06000;LESAO CORPORAL;RUA CAVAQUINHO;15;301465;13/5/2001 10:20:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614161.77;795395.78;4710
+4712;2001259659;B03000;AMEACA;AV AMAZONAS;5681;3140;13/5/2001 11:02:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606524.08;795878.14;4711
+4713;2001259679;B03000;AMEACA;RUA ANTONIO MARZ;386;94520;13/5/2001 11:27:00;CIDADAO COMUM;S;0;OURO PRETO;BH;606238.36;800769.75;4712
+4714;2001259693;B06000;LESAO CORPORAL;RUA PORTO ALEGRE;590;44061;13/5/2001 11:46:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;608751.81;797637.69;4713
+4715;2001259698;B03000;AMEACA;RUA CONSELHEIRO ;51;17095;13/5/2001 11:50:00;CIDADAO COMUM;N;;CENTRO (BH);BH;612543.94;797025.95;4714
+4716;2001259729;B06000;LESAO CORPORAL;RUA QUARENTA E U;83;302837;13/5/2001 12:15:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614183.34;805806.43;4715
+4717;2001259756;B03000;AMEACA;RUA ESTANCIA;20;51597;13/5/2001 12:39:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615503.60;800840.93;4716
+4718;2001259768;B03000;AMEACA;AV ARTUR BERNARD;132;60844;13/5/2001 12:53:00;CIDADAO COMUM;S;0;VILA PARIS;BH;610081.34;793505.68;4717
+4719;2001259775;B03000;AMEACA;RUA ARMANDO ZILL;22;9235;13/5/2001 12:59:00;CIDADAO COMUM;N;0;PLANALTO;BH;609811.97;807080.31;4718
+4720;2001259843;B06000;LESAO CORPORAL;RUA PALMIRA;642;51950;13/5/2001 13:57:00;INICIATIVA;S;0;SERRA;BH;613125.73;794915.16;4719
+4721;2001259867;B08000;VIOLACAO DE DOMI;RUA DES DRUMOND;72;19958;13/5/2001 14:16:00;INICIATIVA;N;0;SERRA;BH;612661.90;795485.42;4720
+4722;2001259953;B06000;LESAO CORPORAL;RUA ESTRELA DALV;107;97080;13/5/2001 15:12:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614946.94;806014.91;4721
+4723;2001260002;B03000;AMEACA;RUA JOSE DE LIMA;516;38897;13/5/2001 15:43:00;CIDADAO COMUM;S;;FLORAMAR;BH;612310.27;805965.70;4722
+4724;2001260033;B03000;AMEACA;RUA ARMINDA MORE;61;5997;13/5/2001 15:58:00;CIDADAO COMUM;S;CAA;NOVA BARROCA;BH;607411.92;792906.03;4723
+4725;2001260048;B06000;LESAO CORPORAL;RUA ARACI;556;5335;13/5/2001 16:04:00;CIDADAO COMUM;N;;PINDORAMA;BH;602554.36;797419.36;4724
+4726;2001260112;B06000;LESAO CORPORAL;RUA MARIANA OLIV;178;94573;13/5/2001 16:42:00;CIDADAO COMUM;S;;OURO PRETO;BH;606307.92;800693.24;4725
+4727;2001260121;B03000;AMEACA;AV WASHINGTON LU;1571;73701;13/5/2001 16:45:00;CIDADAO COMUM;N;;SAO BERNARDO;BH;610155.55;805082.41;4726
+4728;2001260133;B03000;AMEACA;RUA HELIO GILBER;132;55991;13/5/2001 16:51:00;CIDADAO COMUM;S;;FLORAMAR;BH;611809.55;806797.10;4727
+4729;2001260148;B06000;LESAO CORPORAL;RUA MARQUESA DE ;55;44830;13/5/2001 17:00:00;CIDADAO COMUM;N;;JARDIM ROMA;BH;612053.62;805151.76;4728
+4730;2001260169;B06000;LESAO CORPORAL;RUA ANTONIO PEIX;120;12379;13/5/2001 17:10:00;INICIATIVA;S;0;ADELAIDE;BH;607417.84;798044.53;4729
+4731;2001260177;B04001;HOMICIDIO TENTAD;RUA DAS PETUNIAS;1449;11870;13/5/2001 17:15:00;INICIATIVA;S;0;LINDEIA;BH;598916.78;790521.90;4730
+4732;2001260221;B04002;HOMICIDIO CONSUM;RUA MUNICIPAL;180;171677;13/5/2001 17:44:00;CIDADAO COMUM;N;;VILA CEMIG;BH;605640.33;788590.82;4731
+4733;2001260257;B03000;AMEACA;RUA JOAQUIM HENR;145;94371;13/5/2001 18:04:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606357.63;801486.70;4732
+4734;2001260321;B03000;AMEACA;RUA ADELIA CARME;250;1031;13/5/2001 18:40:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599636.37;789371.37;4733
+4735;2001260324;B03000;AMEACA;RUA DOUTOR ALBER;149;23114;13/5/2001 18:43:00;CIDADAO COMUM;S;0;HELIOPOLIS;BH;610892.27;805316.02;4734
+4736;2001260366;B03000;AMEACA;RUA PAULO GONCAL;113;96538;13/5/2001 19:06:00;CIDADAO COMUM;N;0;SERRA VERDE;BH;608906.50;810218.95;4735
+4737;2001260376;B06000;LESAO CORPORAL;RUA DONA LALA FE;518;18712;13/5/2001 19:12:00;CIDADAO COMUM;S;CAFR;MILIONARIOS;BH;604501.36;790651.11;4736
+4738;2001260405;B06000;LESAO CORPORAL;RUA NARCISIO TEI;327;99072;13/5/2001 19:27:00;CIDADAO COMUM;N;;CEU AZUL;BH;605477.17;808266.38;4737
+4739;2001260431;B03000;AMEACA;RUA OSCAR NEGRAO;190;17776;13/5/2001 19:40:00;CIDADAO COMUM;S;;GAMELEIRA;BH;605051.19;794788.68;4738
+4740;2001260457;B03000;AMEACA;RUA MAJOR DELFIN;1900;42620;13/5/2001 19:53:00;CIDADAO COMUM;S;L;SAO FRANCISCO;BH;609452.74;801950.14;4739
+4741;2001260466;B03000;AMEACA;RUA LOURIVAL CAR;300;72318;13/5/2001 19:58:00;CIDADAO COMUM;S;0;PLANALTO;BH;610813.53;806285.84;4740
+4742;2001260469;B06000;LESAO CORPORAL;RUA MARIA CANDID;169;114957;13/5/2001 20:00:00;CIDADAO COMUM;S;AP101;PAQUETA;BH;605538.04;802484.02;4741
+4743;2001260507;B03000;AMEACA;RUA F;98;302327;13/5/2001 20:23:00;CIDADAO COMUM;S;0;BONSUCESSO;BH;606197.92;789828.69;4742
+4744;2001260519;B06000;LESAO CORPORAL;RUA REDENTOR;26;58177;13/5/2001 20:29:00;POLICIAL MILITAR;S;0;SAO JOSE;BH;605803.83;798763.19;4743
+4745;2001260531;B06000;LESAO CORPORAL;RUA ANIL;135;4130;13/5/2001 20:37:00;CIDADAO COMUM;S;CA03;COQUEIROS;BH;603022.64;799841.35;4744
+4746;2001260545;B09000;ABANDONO DE INCA;RUA PAPOULA;36;31844;13/5/2001 20:45:00;CIDADAO COMUM;S;LJA;REGINA;BH;598758.69;790411.48;4745
+4747;2001260558;B03000;AMEACA;RUA POTOMAIO;748;54920;13/5/2001 20:53:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615802.83;799168.91;4746
+4748;2001260574;B04001;HOMICIDIO TENTAD;RUA CINCO;354;81647;13/5/2001 21:03:00;CIDADAO COMUM;N;;OLHOS DAGUA;BH;605646.00;790609.97;4747
+4749;2001260592;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;300;170504;13/5/2001 21:13:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608596.19;793933.42;4748
+4750;2001260602;B03000;AMEACA;RUA VINTE E SEIS;355;72780;13/5/2001 21:17:00;CIDADAO COMUM;N;;LEONINA;BH;608535.90;793292.69;4749
+4751;2001260613;B03000;AMEACA;RUA WALTER IANNI;163;82186;13/5/2001 21:22:00;INICIATIVA;S;0;SAO GABRIEL;BH;613063.80;804020.31;4750
+4752;2001260619;B03000;AMEACA;RUA LUIZ LOPES;233;94431;13/5/2001 21:26:00;CIDADAO COMUM;S;;OURO PRETO;BH;606306.33;801223.55;4751
+4753;2001260637;B03000;AMEACA;RUA MIRAMAR;11;96929;13/5/2001 21:36:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;614767.26;805814.49;4752
+4754;2001260657;B06000;LESAO CORPORAL;RUA AFONSO DE CA;94;1246;13/5/2001 21:48:00;CIDADAO COMUM;S;;UNIVERSITARIO;BH;610387.82;802693.09;4753
+4755;2001260665;B03000;AMEACA;RUA ITAJOBI;21;35482;13/5/2001 21:50:00;CIDADAO COMUM;S;;POMPEIA;BH;614481.76;797983.31;4754
+4756;2001260704;B06000;LESAO CORPORAL;RUA MOACYR JOSE ;200;91068;13/5/2001 22:19:00;INICIATIVA;N;0;BURITIS;BH;607346.74;791431.83;4755
+4757;2001260710;B03000;AMEACA;RUA GUARARAPES;1860;32241;13/5/2001 22:21:00;CIDADAO COMUM;S;;GLORIA;BH;602480.24;798079.29;4756
+4758;2001260719;B06000;LESAO CORPORAL;RUA AVELINO GIAR;218;99350;13/5/2001 22:27:00;INICIATIVA;N;0;CEU AZUL;BH;604476.31;807597.49;4757
+4759;2001260722;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;2985;57830;13/5/2001 22:28:00;INICIATIVA;N;0;ESTORIL;BH;609208.29;792438.19;4758
+4760;2001260781;B03000;AMEACA;RUA ANTARES;25;4244;13/5/2001 23:06:00;CIDADAO COMUM;S;0;SANTA LUCIA;BH;610164.63;793156.54;4759
+4761;2001260805;B02000;RIXA;RUA JOAQUIM DE F;1690;38033;13/5/2001 23:21:00;CIDADAO COMUM;N;;SANTA HELENA (BH;BH;603165.47;789641.23;4760
+4762;2001260847;B04001;HOMICIDIO TENTAD;RUA TAQUARACU;41;42167;13/5/2001 23:55:00;CIDADAO COMUM;S;0;CH CELSO MACHADO;BH;603814.57;800865.65;4761
+4763;2001260848;B03000;AMEACA;RUA DOM PEDRITO;138;51300;13/5/2001 23:56:00;CIDADAO COMUM;S;0;NOVA VISTA;BH;614713.80;800489.83;4762
+4764;2001260908;B03000;AMEACA;RUA MARQUES DE B;312;44730;14/5/2001 00:45:00;CIDADAO COMUM;S;0;SAUDADE;BH;615167.15;797589.14;4763
+4765;2001260921;B03000;AMEACA;RUA DIAS DE FARI;95;21250;14/5/2001 00:56:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613724.89;798608.18;4764
+4766;2001260923;B06000;LESAO CORPORAL;RUA CINCO DE JUL;110;15670;14/5/2001 00:57:00;CIDADAO COMUM;N;0;PRIMEIRO DE MAIO;BH;612393.58;803875.40;4765
+4767;2001260948;B03000;AMEACA;RUA VEREADOR ORL;201;71573;14/5/2001 01:22:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;603759.63;792842.36;4766
+4768;2001261104;B06000;LESAO CORPORAL;RUA OSORIO DA RO;69;125153;14/5/2001 06:12:00;CIDADAO COMUM;N;SUPERMERCADO CAR;MINEIRAO;BH;602016.31;785808.46;4767
+4769;2001261120;B03000;AMEACA;RUA CANA DA INDI;394;94848;14/5/2001 06:37:00;CIDADAO COMUM;N;;LINDEIA;BH;599823.12;790690.41;4768
+4770;2001261277;B03000;AMEACA;AV DO CONTORNO;677;17228;14/5/2001 08:48:00;CIDADAO COMUM;S;11 ANDAR;CENTRO (BH);BH;611305.43;797755.06;4769
+4771;2001261402;B06000;LESAO CORPORAL;RUA CANDIDA MARI;342;108830;14/5/2001 10:04:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;605976.13;811733.65;4770
+4772;2001261442;B03000;AMEACA;RUA PADRE ANTONI;230;82347;14/5/2001 10:31:00;CIDADAO COMUM;S;CAA;SAO BERNARDO;BH;611345.47;805007.03;4771
+4773;2001261507;B03000;AMEACA;RUA CINQUENTA A;77;302846;14/5/2001 11:13:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614230.31;805549.12;4772
+4774;2001261516;B03000;AMEACA;RUA JORNALISTA J;173;38336;14/5/2001 11:19:00;INICIATIVA;S;APTO 202;CRUZEIRO;BH;612754.67;794039.36;4773
+4775;2001261526;B03000;AMEACA;RUA MENDES DE OL;1084;45430;14/5/2001 11:23:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609718.74;799470.77;4774
+4776;2001261577;B03000;AMEACA;RUA MARIA MARTIN;1594;44248;14/5/2001 12:02:00;CIDADAO COMUM;S;AP 102;SAGRADA FAMILIA;BH;613282.33;799066.17;4775
+4777;2001261580;B03000;AMEACA;RUA JACAREI;123;36586;14/5/2001 12:04:00;CIDADAO COMUM;S;0;PIRATININGA;BH;606579.01;809587.17;4776
+4778;2001261628;B04002;HOMICIDIO CONSUM;RUA QUATRO DE JU;40;170910;14/5/2001 12:28:00;CIDADAO COMUM;S;;LEONINA;BH;608611.71;793487.56;4777
+4779;2001261639;B03000;AMEACA;RUA FALCAO;705;27749;14/5/2001 12:42:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;605316.73;788384.43;4778
+4780;2001261644;B04002;HOMICIDIO CONSUM;AV COLETORA;5;78241;14/5/2001 12:44:00;CIDADAO COMUM;N;0;VILA PINHO;BH;601752.97;788537.18;4779
+4781;2001261668;B03000;AMEACA;RUA OSCAR LOBO P;20;104480;14/5/2001 13:06:00;INICIATIVA;N;0;PRIMEIRO DE MAIO;BH;612345.92;803542.19;4780
+4782;2001261679;B08000;VIOLACAO DE DOMI;AV FRANCISCO SA;1007;29656;14/5/2001 13:10:00;INICIATIVA;N;0;GUTIERREZ;BH;608964.99;795860.37;4781
+4783;2001261715;B03000;AMEACA;RUA MAR DE ESPAN;770;43318;14/5/2001 13:43:00;CIDADAO COMUM;S;0;SANTO ANTONIO;BH;610593.29;794090.63;4782
+4784;2001261738;B06000;LESAO CORPORAL;RUA ALVARENGA PE;1366;2683;14/5/2001 14:02:00;CIDADAO COMUM;S;;SANTO AGOSTINHO;BH;609629.53;796137.77;4783
+4785;2001261807;B03000;AMEACA;RUA BENJAMIM JAC;274;9207;14/5/2001 14:56:00;CIDADAO COMUM;S;;GUTIERREZ;BH;608759.50;794812.82;4784
+4786;2001261861;B03000;AMEACA;RUA TRINTA E OIT;21;34681;14/5/2001 15:38:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612484.12;807437.95;4785
+4787;2001261880;B08000;VIOLACAO DE DOMI;RUA ESPIRITO SAN;54;26052;14/5/2001 15:48:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611361.32;797556.04;4786
+4788;2001261973;B04001;HOMICIDIO TENTAD;RUA JOAO CANDIDO;113;93240;14/5/2001 16:43:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;601016.84;786016.92;4787
+4789;2001262021;B03000;AMEACA;RUA MUNIZ;149;170850;14/5/2001 17:11:00;INICIATIVA;S;INICIATIVA;MORRO DAS PEDRAS;BH;608113.39;793880.88;4788
+4790;2001262118;B06000;LESAO CORPORAL;RUA DOS AIMORES;2896;1640;14/5/2001 18:01:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;609843.89;796509.28;4789
+4791;2001262131;B06000;LESAO CORPORAL;RUA MIRAMAR;11;96929;14/5/2001 18:06:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614767.26;805814.49;4790
+4792;2001262200;B06000;LESAO CORPORAL;RUA DOZE;105;74178;14/5/2001 18:53:00;CIDADAO COMUM;S;;NOVA YORK;BH;608520.95;810739.19;4791
+4793;2001262257;B03000;AMEACA;RUA DA BALANCA;9;7605;14/5/2001 19:17:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615261.54;806909.29;4792
+4794;2001262280;B06000;LESAO CORPORAL;RUA DO ACRE;114;877;14/5/2001 19:40:00;INICIATIVA;S;0;CENTRO (BH);BH;610717.96;797611.34;4793
+4795;2001262341;B04001;HOMICIDIO TENTAD;RUA MAE D'AGUA;42;82489;14/5/2001 20:08:00;CIDADAO COMUM;S;CS;SAO GABRIEL;BH;613698.17;805073.78;4794
+4796;2001262410;B04001;HOMICIDIO TENTAD;RUA MARIA FRANCI;40;121906;14/5/2001 21:02:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;602238.64;786114.07;4795
+4797;2001262425;B06000;LESAO CORPORAL;RUA E 1;10;28073;14/5/2001 21:08:00;CIDADAO COMUM;N;0;CAPITAO EDUARDO;BH;618588.44;806798.16;4796
+4798;2001262426;B06000;LESAO CORPORAL;RUA BARAO DE MAU;282;7992;14/5/2001 21:11:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603487.33;802924.92;4797
+4799;2001262449;B03000;AMEACA;BECO SAO SEBASTI;34;93470;14/5/2001 21:30:00;CIDADAO COMUM;S;;DOZE DE OUTUBRO;BH;606183.04;790631.55;4798
+4800;2001262485;B06000;LESAO CORPORAL;RUA MARIA BEATRI;301;43881;14/5/2001 21:58:00;CIDADAO COMUM;N;FR301;HAVAI;BH;606834.07;793558.59;4799
+4801;2001262487;B03000;AMEACA;RUA JAVARI;964;37204;14/5/2001 22:01:00;INICIATIVA;S;0;RENASCENCA;BH;610741.99;800276.63;4800
+4802;2001262505;B03000;AMEACA;RUA ARISTIDES FE;93;20793;14/5/2001 22:11:00;CIDADAO COMUM;S;;TIROL;BH;600120.66;789714.99;4801
+4803;2001262506;B03000;AMEACA;AV MARIA CONCEIC;286;32052;14/5/2001 22:10:00;CIDADAO COMUM;N;;GOIANIA;BH;615643.14;803997.94;4802
+4804;2001262515;B06000;LESAO CORPORAL;RUA REMI PEREIRA;234;96727;14/5/2001 22:19:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;614854.85;806306.99;4803
+4805;2001262546;B03000;AMEACA;RUA CABO FRIO;250;82031;14/5/2001 22:41:00;CIDADAO COMUM;S;CAA;SAO GABRIEL;BH;614311.41;804741.76;4804
+4806;2001262549;B03000;AMEACA;RUA BENVINDA DE ;120;9276;14/5/2001 22:42:00;CIDADAO COMUM;S;AP002;SANTO ANTONIO;BH;611009.60;794652.84;4805
+4807;2001262564;B03000;AMEACA;RUA CINQUENTA;115;106100;14/5/2001 22:52:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;608191.83;810920.50;4806
+4808;2001262583;B04001;HOMICIDIO TENTAD;RUA SAN MARINO;38;96409;14/5/2001 23:02:00;CIDADAO COMUM;S;0;JARDIM EUROPA;BH;607798.16;810368.84;4807
+4809;2001262616;B04001;HOMICIDIO TENTAD;RUA ONZE DE DEZE;86;112687;14/5/2001 23:20:00;CIDADAO COMUM;S;0;LEONINA;BH;608758.16;793556.94;4808
+4810;2001262685;B06000;LESAO CORPORAL;AV AFONSO PENA;758;1259;15/5/2001 00:21:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611140.69;797058.18;4809
+4811;2001262731;B06000;LESAO CORPORAL;AV SANTOS DUMONT;109;61950;15/5/2001 01:11:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611469.19;797433.51;4810
+4812;2001262795;B06000;LESAO CORPORAL;RUA JOAO DE CARV;25;37550;15/5/2001 02:57:00;POLICIAL MILITAR;S;;DOM BOSCO;BH;604376.29;797736.45;4811
+4813;2001262829;B03000;AMEACA;AV OLEGARIO MACI;660;49699;15/5/2001 04:00:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610493.31;797062.69;4812
+4814;2001262833;B06000;LESAO CORPORAL;RUA JOSE CLEMENT;304;38667;15/5/2001 04:01:00;CIDADAO COMUM;S;;FLORAMAR;BH;612226.70;806061.56;4813
+4815;2001262899;B06000;LESAO CORPORAL;RUA ANTENOR VALE;119;100882;15/5/2001 06:45:00;CIDADAO COMUM;N;;FLORAMAR;BH;611247.72;807310.71;4814
+4816;2001262919;B03000;AMEACA;BECO SANTA MARIA;83;48960;15/5/2001 07:08:00;INICIATIVA;S;83-A;VILA PARAISO;BH;606118.68;790661.45;4815
+4817;2001263090;B03000;AMEACA;RUA ABILIO FERNA;375;95421;15/5/2001 09:18:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616838.69;804321.77;4816
+4818;2001263151;B03000;AMEACA;RUA PEDRO LUCIO ;372;64293;15/5/2001 09:58:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608988.43;809546.51;4817
+4819;2001263181;B06000;LESAO CORPORAL;RUA ENCANTADO;241;25453;15/5/2001 10:14:00;CIDADAO COMUM;S;0;CAICARA;BH;607683.35;799393.01;4818
+4820;2001263205;B03000;AMEACA;RUA JUIZ DE FORA;397;39455;15/5/2001 10:25:00;CIDADAO COMUM;S;LJ5;BARRO PRETO;BH;609618.99;796869.79;4819
+4821;2001263247;B06000;LESAO CORPORAL;RUA JOSE RAIMUND;13;123983;15/5/2001 10:52:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606781.66;812080.95;4820
+4822;2001263268;B03000;AMEACA;RUA DOS URUGUAIO;85;46710;15/5/2001 11:05:00;CIDADAO COMUM;S;;GORDURAS;BH;616569.96;804408.86;4821
+4823;2001263274;B03000;AMEACA;RUA COSME E DAMI;26;18246;15/5/2001 11:08:00;CIDADAO COMUM;N;;UNIVERSITARIO;BH;610117.24;802600.75;4822
+4824;2001263385;B06000;LESAO CORPORAL;RUA BEIRA LINHA;278;121732;15/5/2001 12:27:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615460.33;805397.29;4823
+4825;2001263424;B03000;AMEACA;AV PRESIDENTE AN;845;4461;15/5/2001 12:53:00;CIDADAO COMUM;N;;LAGOINHA;BH;610492.26;798773.24;4824
+4826;2001263462;B03000;AMEACA;RUA LOPES TROVAO;121;41394;15/5/2001 13:28:00;CIDADAO COMUM;N;;FLORESTA;BH;611901.95;798312.61;4825
+4827;2001263481;B03000;AMEACA;RUA MILTON PALME;84;85837;15/5/2001 13:40:00;CIDADAO COMUM;N;SL737;SERRA VERDE;BH;609178.25;810223.10;4826
+4828;2001263487;B06000;LESAO CORPORAL;AV RAUL MOURAO G;499;89900;15/5/2001 13:47:00;CIDADAO COMUM;N;0;PALMEIRAS;BH;606963.83;791845.95;4827
+4829;2001263491;B04001;HOMICIDIO TENTAD;RUA JULIO CESAR ;110;91792;15/5/2001 13:50:00;CIDADAO COMUM;S;;CH ATILA DE PAIV;BH;601531.01;790750.83;4828
+4830;2001263505;B03000;AMEACA;RUA MODESTINO GO;53;84430;15/5/2001 13:58:00;CIDADAO COMUM;N;;NOVA VISTA;BH;614965.79;800757.80;4829
+4831;2001263534;B03000;AMEACA;RUA DOS JESUITAS;114;63391;15/5/2001 14:13:00;CIDADAO COMUM;S;LJ2;PLANALTO;BH;610253.29;805590.30;4830
+4832;2001263805;B03000;AMEACA;RUA JOSE ROMAO D;200;84850;15/5/2001 16:49:00;INICIATIVA;S;0;DA LAGOA;BH;604558.08;809126.53;4831
+4833;2001263867;B03000;AMEACA;RUA MODESTINO GO;53;84430;15/5/2001 17:17:00;CIDADAO COMUM;N;;NOVA VISTA;BH;614965.79;800757.80;4832
+4834;2001263893;B03000;AMEACA;RUA SAO SALVADOR;13;63612;15/5/2001 17:30:00;INICIATIVA;S;0;BONFIM;BH;610184.38;797952.86;4833
+4835;2001263979;B03000;AMEACA;RUA ITANAJE;24;35643;15/5/2001 18:16:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;606560.35;795249.35;4834
+4836;2001263984;B06000;LESAO CORPORAL;AV AFONSO PENA;3160;1259;15/5/2001 18:19:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;612365.19;794973.12;4835
+4837;2001264048;B04001;HOMICIDIO TENTAD;RUA DOS GOITACAZ;1789;31400;15/5/2001 18:49:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;609552.62;797129.26;4836
+4838;2001264215;B03000;AMEACA;AV ITAU;460;36025;15/5/2001 20:14:00;CIDADAO COMUM;S;APTO.:103.;DOM BOSCO;BH;605316.00;797316.62;4837
+4839;2001264258;B03000;AMEACA;RUA O;56;78396;15/5/2001 20:41:00;CIDADAO COMUM;N;0;VILA PINHO;BH;602074.09;788052.68;4838
+4840;2001264320;B03000;AMEACA;RUA DOS TABAIARE;42;66649;15/5/2001 21:19:00;CIDADAO COMUM;N;AP703;FLORESTA;BH;611831.98;797292.90;4839
+4841;2001264326;B03000;AMEACA;AV AUGUSTO DE LI;1327;6731;15/5/2001 21:22:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;610051.77;796842.69;4840
+4842;2001264362;B06000;LESAO CORPORAL;RUA PROFESSOR OT;92;55632;15/5/2001 21:46:00;INICIATIVA;0;0;SANTA EFIGENIA;BH;612987.19;796926.84;4841
+4843;2001264368;B03000;AMEACA;RUA BENTO;90;170807;15/5/2001 21:50:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608443.37;794109.13;4842
+4844;2001264382;B06000;LESAO CORPORAL;AV BIAS FORTES;661;9553;15/5/2001 21:54:00;INICIATIVA;S;0;LOURDES;BH;610743.50;796207.75;4843
+4845;2001264421;B03000;AMEACA;RUA PROFESSOR OT;92;55632;15/5/2001 22:24:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;612987.19;796926.84;4844
+4846;2001264462;B04002;HOMICIDIO CONSUM;RUA JOANA DARC;225;170141;15/5/2001 22:46:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614511.87;794982.94;4845
+4847;2001264537;B03000;AMEACA;RUA JOSE JOAQUIM;255;38871;15/5/2001 23:35:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610954.46;802060.45;4846
+4848;2001264644;B03000;AMEACA;RUA DOS TUPIS;1044;69965;16/5/2001 01:22:00;INICIATIVA;N;0;BARRO PRETO;BH;610269.70;797121.45;4847
+4849;2001264670;B03000;AMEACA;RUA MAGNO MOURA;149;42545;16/5/2001 02:00:00;CIDADAO COMUM;S;;NOVA VISTA;BH;615900.66;800588.01;4848
+4850;2001264811;B06000;LESAO CORPORAL;RUA CONEGO SANTA;957;16859;16/5/2001 06:15:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;610495.45;800852.05;4849
+4851;2001264827;B06000;LESAO CORPORAL;RUA SATURNINO FE;39;64108;16/5/2001 06:49:00;CIDADAO COMUM;S;;LETICIA;BH;607622.21;809926.71;4850
+4852;2001265006;B03000;AMEACA;RUA JOAQUIM CHAV;161;50931;16/5/2001 09:40:00;CIDADAO COMUM;N;0;MINASCAIXA;BH;609225.46;809596.53;4851
+4853;2001265080;B03000;AMEACA;RUA COPENHAGUE;76;63524;16/5/2001 10:17:00;INICIATIVA;S;0;TREVO;BH;604077.22;805831.39;4852
+4854;2001265109;B06000;LESAO CORPORAL;RUA DOS ADVOGADO;405;103130;16/5/2001 10:43:00;INICIATIVA;S;0;CONJUNTO ALIPIO ;BH;604499.30;800376.34;4853
+4855;2001265138;B06000;LESAO CORPORAL;RUA JAIME SALSE;278;36848;16/5/2001 11:08:00;INICIATIVA;N;0;MAGNESITA;BH;604022.14;793879.98;4854
+4856;2001265467;B03000;AMEACA;RUA JANAITIBA;803;36889;16/5/2001 14:47:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;616039.65;799186.15;4855
+4857;2001265476;B06000;LESAO CORPORAL;RUA SAO TOMAS DE;535;63782;16/5/2001 14:54:00;CIDADAO COMUM;N;0;MORRO DO PAPAGAI;BH;610849.00;793420.56;4856
+4858;2001265482;B03000;AMEACA;RUA PAULO DE FRO;11;52722;16/5/2001 14:56:00;INICIATIVA;N;0;CENTRO BH;BH;610740.91;797637.21;4857
+4859;2001265634;B06000;LESAO CORPORAL;RUA DOM SILVERIO;300;22496;16/5/2001 16:18:00;CIDADAO COMUM;N;;BELMONT;BH;615222.25;805374.99;4858
+4860;2001265662;B06000;LESAO CORPORAL;RUA GEORGINA PEN;150;31006;16/5/2001 16:36:00;CIDADAO COMUM;S;CAFR;SAO LUCAS;BH;614133.28;795705.78;4859
+4861;2001265740;B03000;AMEACA;RUA ANDARAI;286;3720;16/5/2001 17:24:00;CIDADAO COMUM;N;0;NOVA VISTA (SB);SB;615301.42;800837.38;4860
+4862;2001265905;B04001;HOMICIDIO TENTAD;RUA GRAUNAS;338;31797;16/5/2001 18:58:00;CIDADAO COMUM;N;A;FLAVIO MARQUES D;BH;605357.25;788696.63;4861
+4863;2001266102;B03000;AMEACA;RUA SALINAS;1584;59992;16/5/2001 20:53:00;INICIATIVA;S;0;HORTO;BH;613059.02;797579.96;4862
+4864;2001266129;B03000;AMEACA;RUA SAO JERONIMO;47;62764;16/5/2001 21:12:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612475.53;799757.38;4863
+4865;2001266295;B06000;LESAO CORPORAL;RUA MARCAZITA;1;43488;16/5/2001 23:13:00;CIDADAO COMUM;S;;SAO CRISTOVAO;BH;610116.75;799181.06;4864
+4866;2001266311;B03000;AMEACA;RUA DOUTOR BENED;1689;12252;16/5/2001 23:22:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;612974.25;804856.37;4865
+4867;2001266313;B03000;AMEACA;RUA NESTOR VERAS;105;85852;16/5/2001 23:27:00;CIDADAO COMUM;N;AN2;SERRA VERDE;BH;609293.01;810251.97;4866
+4868;2001266378;B06000;LESAO CORPORAL;RUA ANGATURAMA;14;3935;17/5/2001 00:17:00;INICIATIVA;S;0;SAO PAULO;BH;612414.84;802648.96;4867
+4869;2001266446;B06000;LESAO CORPORAL;RUA GIRASSOL;440;31277;17/5/2001 01:51:00;CIDADAO COMUM;N;;LINDEIA;BH;599263.27;791099.17;4868
+4870;2001266489;B06000;LESAO CORPORAL;RUA NAVARRA;39;113576;17/5/2001 02:51:00;CIDADAO COMUM;N;CAA;JARDIM EUROPA;BH;608746.87;810211.38;4869
+4871;2001266905;B06000;LESAO CORPORAL;RUA GENERAL OZOR;1131;30901;17/5/2001 10:46:00;CIDADAO COMUM;S;;VERA CRUZ;BH;615951.92;798005.52;4870
+4872;2001267080;B06000;LESAO CORPORAL;RUA JOAO AVELINO;235;83075;17/5/2001 13:01:00;CIDADAO COMUM;N;;CALIFORNIA;BH;603313.10;796473.50;4871
+4873;2001267167;B03000;AMEACA;RUA DOS ECONOMIS;612;103272;17/5/2001 14:15:00;INICIATIVA;S;MP6953 CB VICTOR;CONJUNTO ALIPIO ;BH;604238.00;800485.06;4872
+4874;2001267178;B03000;AMEACA;AV DOS BANDEIRAN;492;7775;17/5/2001 14:22:00;CIDADAO COMUM;S;FLORICULT. CIA D;SION;BH;612063.30;793124.76;4873
+4875;2001267208;B06000;LESAO CORPORAL;RUA VIOLETA DE M;9;80253;17/5/2001 14:38:00;CIDADAO COMUM;S;0;SAO JOSE;BH;604156.53;799475.93;4874
+4876;2001267270;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;200;170504;17/5/2001 15:14:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608596.19;793933.42;4875
+4877;2001267337;B03000;AMEACA;AV BARBACENA;252;8084;17/5/2001 15:47:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609389.65;796964.49;4876
+4878;2001267379;B03000;AMEACA;RUA DOUTOR JOSE ;79;91547;17/5/2001 16:11:00;CIDADAO COMUM;S;0;SAO BENTO;BH;609872.53;793003.40;4877
+4879;2001267401;B03000;AMEACA;RUA CANA DA INDI;394;94848;17/5/2001 16:22:00;CIDADAO COMUM;N;0;LINDEIA;BH;599823.12;790690.41;4878
+4880;2001267513;B03000;AMEACA;AV PRESIDENTE AN;295;4461;17/5/2001 17:28:00;POLICIAL MILITAR;S;0;LAGOINHA;BH;610689.55;798286.65;4879
+4881;2001267545;B03000;AMEACA;AV ARQUITETO MOR;47;6050;17/5/2001 17:43:00;CIDADAO COMUM;N;FU;BARREIRO;BH;602994.37;791488.05;4880
+4882;2001267683;B06000;LESAO CORPORAL;RUA DOS GUARANIS;301;32181;17/5/2001 19:02:00;INICIATIVA;N;0;CENTRO BH;BH;610722.99;797339.12;4881
+4883;2001267743;B06000;LESAO CORPORAL;RUA GONCALVES DI;1041;31513;17/5/2001 19:31:00;CIDADAO COMUM;S;AP102;FUNCIONARIOS;BH;611538.79;795731.57;4882
+4884;2001267778;B03000;AMEACA;RUA CACILDA BECK;36;11262;17/5/2001 19:52:00;CIDADAO COMUM;S;0;TUPI;BH;613323.37;806316.54;4883
+4885;2001267853;B06000;LESAO CORPORAL;AV SEN LEVINDO C;1070;14866;17/5/2001 20:34:00;INICIATIVA;N;0;SANTA CECILIA;BH;601290.55;786629.80;4884
+4886;2001267905;B06000;LESAO CORPORAL;RUA BUARQUE DE M;85;10650;17/5/2001 21:13:00;CIDADAO COMUM;S;;FLORESTA;BH;611837.94;798205.68;4885
+4887;2001267924;B04001;HOMICIDIO TENTAD;AV SIDERAL;265;65721;17/5/2001 21:19:00;INICIATIVA;S;0;VISTA ALEGRE;BH;604262.37;793431.83;4886
+4888;2001268039;B06000;LESAO CORPORAL;RUA SEBASTIAO DE;151;64209;17/5/2001 22:18:00;INICIATIVA;S;;NOVA GRANADA;BH;607929.60;794787.71;4887
+4889;2001268119;B06000;LESAO CORPORAL;AV OLEGARIO MACI;372;49699;17/5/2001 23:09:00;INICIATIVA;S;0;CENTRO (BH);BH;610569.33;797339.29;4888
+4890;2001268126;B03000;AMEACA;RUA LEILOEIRO JO;121;85229;17/5/2001 23:11:00;CIDADAO COMUM;N;AP203;SANTA AMELIA;BH;606958.53;805966.94;4889
+4891;2001268139;B09000;ABANDONO DE INCA;RUA PEDRINOPOLIS;400;52980;17/5/2001 23:23:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605848.57;807100.75;4890
+4892;2001268218;B06000;LESAO CORPORAL;RUA CONSUELO;146;106296;18/5/2001 00:25:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607848.43;811390.89;4891
+4893;2001268236;B06000;LESAO CORPORAL;RUA AUGUSTA ANDR;1167;99104;18/5/2001 00:41:00;CIDADAO COMUM;S;;JAQUELINE;BH;611759.56;810626.88;4892
+4894;2001268268;B03000;AMEACA;RUA DOUTOR CRIST;312;55598;18/5/2001 01:12:00;CIDADAO COMUM;N;;ARAGUAIA;BH;604751.25;789297.85;4893
+4895;2001268310;B03000;AMEACA;RUA RIO BONITO;184;110174;18/5/2001 02:00:00;CIDADAO COMUM;S;;PILAR;BH;607753.16;788709.99;4894
+4896;2001268369;B03000;AMEACA;RUA DOS TIMBIRAS;2796;67682;18/5/2001 03:04:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610033.69;796605.59;4895
+4897;2001268417;B06000;LESAO CORPORAL;RUA RADIALISTA E;36;12381;18/5/2001 04:23:00;CIDADAO COMUM;S;CAFR;CEU AZUL;BH;603996.65;808758.62;4896
+4898;2001268435;B06000;LESAO CORPORAL;RUA FERNAO DIAS;799;28133;18/5/2001 04:56:00;INICIATIVA;N;0;CAETANO FURQUIM;BH;615910.87;799034.52;4897
+4899;2001268774;B03000;AMEACA;RUA AUGUSTO MORE;512;6760;18/5/2001 10:30:00;CIDADAO COMUM;S;0;SANTA AMELIA;BH;606752.48;805506.78;4898
+4900;2001268820;B06000;LESAO CORPORAL;RUA MARIA ISABEL;15;118481;18/5/2001 11:00:00;CIDADAO COMUM;N;;MALDONADO;BH;601683.64;790179.32;4899
+4901;2001268899;B06000;LESAO CORPORAL;RUA EDUARDO QUEN;81;25047;18/5/2001 11:47:00;CIDADAO COMUM;S;0;SAO BERNARDO;BH;610496.41;805089.06;4900
+4902;2001268932;B03000;AMEACA;RUA CARMESIA;452;13618;18/5/2001 12:20:00;CIDADAO COMUM;S;BLF     AP403;SANTA INES;BH;614353.47;800610.41;4901
+4903;2001268938;B03000;AMEACA;RUA ALEM PARAIBA;1035;81357;18/5/2001 12:20:00;CIDADAO COMUM;S;0;BONFIM;BH;609842.01;798489.63;4902
+4904;2001268950;B06000;LESAO CORPORAL;RUA IPANEMA;785;34726;18/5/2001 12:33:00;CIDADAO COMUM;N;CA01;SARANDI (URCA/BH;BH;602941.78;802385.88;4903
+4905;2001268996;B03000;AMEACA;RUA VATICANO;349;71371;18/5/2001 13:05:00;CIDADAO COMUM;N;0;GLORIA;BH;604160.24;797994.67;4904
+4906;2001269010;B03000;AMEACA;AV OLEGARIO MACI;308;49699;18/5/2001 13:17:00;INICIATIVA;S;0;CENTRO (BH);BH;610578.92;797398.38;4905
+4907;2001269019;B03000;AMEACA;RUA TREZE DE SET;323;69168;18/5/2001 13:21:00;CIDADAO COMUM;S;;LEONINA;BH;608612.10;793426.03;4906
+4908;2001269080;B03000;AMEACA;RUA EXPEDICIONAR;158;27001;18/5/2001 14:06:00;CIDADAO COMUM;S;0;ADELAIDE;BH;607662.37;798580.43;4907
+4909;2001269088;B03000;AMEACA;RUA SAO BORJA;346;61620;18/5/2001 14:11:00;CIDADAO COMUM;N;CAA;BOA VISTA;BH;614926.86;800315.28;4908
+4910;2001269345;B03000;AMEACA;RUA PEDRO LESSA;137;53117;18/5/2001 16:46:00;CIDADAO COMUM;0;PANIFICADORA LAG;LAGOINHA;BH;610203.19;798737.46;4909
+4911;2001269348;B05000;SEQUESTRO E CARC;RUA JOSE CLETO;412;38682;18/5/2001 16:45:00;CIDADAO COMUM;S;AP301;DOS PALMARES;BH;610976.99;802305.66;4910
+4912;2001269644;B03000;AMEACA;RUA DES TORRES;131;81344;18/5/2001 19:09:00;CIDADAO COMUM;S;0;PEDRO SEGUNDO;BH;608747.06;798694.06;4911
+4913;2001269696;B06000;LESAO CORPORAL;RUA ETEL NOGUEIR;550;94416;18/5/2001 19:32:00;INICIATIVA;S;0;OURO PRETO;BH;606438.05;800864.00;4912
+4914;2001269721;B06000;LESAO CORPORAL;RUA JOSE ANTONIO;73;80483;18/5/2001 19:45:00;CIDADAO COMUM;S;A;JARDIM ALVORADA;BH;606135.30;800181.37;4913
+4915;2001269730;B03000;AMEACA;RUA BOLIVAR FERR;101;89995;18/5/2001 19:49:00;CIDADAO COMUM;S;PROX. PADARIA SA;PALMEIRAS;BH;607269.62;791505.60;4914
+4916;2001269765;B03000;AMEACA;RUA PAULO PAPINI;75;9190;18/5/2001 20:09:00;CIDADAO COMUM;S;0;PARAISO;BH;614770.70;797028.44;4915
+4917;2001269767;B06000;LESAO CORPORAL;RUA OURO FINO;16;50714;18/5/2001 20:11:00;CIDADAO COMUM;N;AP101;CRUZEIRO;BH;612074.49;794639.35;4916
+4918;2001269810;B03000;AMEACA;RUA DELIO JOSE C;65;74427;18/5/2001 20:34:00;INICIATIVA;S;0;PLANALTO;BH;610551.00;806441.67;4917
+4919;2001269818;B06000;LESAO CORPORAL;RUA MEDEIROS;204;62420;18/5/2001 20:38:00;CIDADAO COMUM;S;RUA DA GARAGEM D;MINASLANDIA;BH;612156.90;804581.93;4918
+4920;2001269827;B05000;SEQUESTRO E CARC;AV PRESIDENTE AN;901;4461;18/5/2001 20:42:00;CIDADAO COMUM;N;VITIMA NO DI;SAO CRISTOVAO;BH;610492.26;798773.24;4919
+4921;2001269885;B03000;AMEACA;RUA POVOA DE VAR;437;54958;18/5/2001 21:19:00;CIDADAO COMUM;N;;PAQUETA;BH;605302.03;802656.56;4920
+4922;2001269890;B03000;AMEACA;RUA W DOIS;155;122619;18/5/2001 21:22:00;CIDADAO COMUM;S;;PONGELUPE;BH;603965.42;787409.50;4921
+4923;2001269928;B03000;AMEACA;ALAMEDA VARGEM G;40;95967;18/5/2001 21:37:00;CIDADAO COMUM;S;0;VILA CASTANHEIRA;BH;601365.77;788667.34;4922
+4924;2001270019;B02000;RIXA;RUA NILO APARECI;425;7384;18/5/2001 22:24:00;CIDADAO COMUM;S;;PLANALTO;BH;609419.95;807033.99;4923
+4925;2001270055;B03000;AMEACA;RUA ALCINDO VIEI;583;1968;18/5/2001 22:47:00;CIDADAO COMUM;N;B;BARREIRO;BH;602841.65;790669.84;4924
+4926;2001270099;B04001;HOMICIDIO TENTAD;RUA ANDIROBA;7;102935;18/5/2001 23:12:00;INICIATIVA;S;0;SAO PAULO;BH;612393.94;802957.18;4925
+4927;2001270116;B03000;AMEACA;RUA DEZESSEIS;548;32821;18/5/2001 23:21:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612269.18;807345.95;4926
+4928;2001270148;B03000;AMEACA;RUA RIO GRANDE D;555;58744;18/5/2001 23:37:00;INICIATIVA;N;0;BARRO PRETO;BH;610367.39;796966.84;4927
+4929;2001270155;B04001;HOMICIDIO TENTAD;AV NELIO CERQUEI;15;72359;18/5/2001 23:39:00;CIDADAO COMUM;S;;TIROL;BH;600947.66;789885.51;4928
+4930;2001270163;B03000;AMEACA;RUA TOME DE SOUZ;950;67998;18/5/2001 23:48:00;CIDADAO COMUM;S;FR888;FUNCIONARIOS;BH;611435.66;795218.32;4929
+4931;2001270166;B03000;AMEACA;RUA MARIA DA FE;415;44046;18/5/2001 23:50:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606364.70;794639.09;4930
+4932;2001270264;B06000;LESAO CORPORAL;AV HENFIL;219;103550;19/5/2001 00:53:00;CIDADAO COMUM;N;0;SARANDI (URCA/BH;BH;603229.57;801700.39;4931
+4933;2001270266;B04001;HOMICIDIO TENTAD;RUA C;53;47693;19/5/2001 01:02:00;CIDADAO COMUM;S;0;VILA CASTANHEIRA;BH;601080.99;788618.39;4932
+4934;2001270268;B06000;LESAO CORPORAL;RUA DOS CAETES;342;11376;19/5/2001 01:02:00;CIDADAO COMUM;N;FR;CENTRO (BH);BH;611282.38;797431.89;4933
+4935;2001270307;B04002;HOMICIDIO CONSUM;RUA UM;43;94923;19/5/2001 01:25:00;CIDADAO COMUM;N;0;LINDEIA;BH;599399.40;790259.57;4934
+4936;2001270322;B04002;HOMICIDIO CONSUM;RUA BANDONION;100;170139;19/5/2001 01:39:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;613977.41;795089.89;4935
+4937;2001270333;B06000;LESAO CORPORAL;AV DOS ANDRADAS;346;3761;19/5/2001 01:48:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611480.77;797265.49;4936
+4938;2001270402;B03000;AMEACA;RUA LIBANIA PENA;65;40855;19/5/2001 02:37:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610749.14;805180.30;4937
+4939;2001270410;B06000;LESAO CORPORAL;RUA QUIXADA;793;57612;19/5/2001 02:43:00;CIDADAO COMUM;S;;IPIRANGA;BH;611561.33;800355.15;4938
+4940;2001270432;B03000;AMEACA;RUA JULIO CESAR;140;39483;19/5/2001 02:59:00;CIDADAO COMUM;S;0;NAZARE;BH;615490.97;804461.80;4939
+4941;2001270514;B06000;LESAO CORPORAL;AV SANTOS DUMONT;680;61950;19/5/2001 04:09:00;INICIATIVA;S;0;CENTRO BH;BH;610999.13;797614.04;4940
+4942;2001270544;B06000;LESAO CORPORAL;AV AMAZONAS;5274;3140;19/5/2001 04:41:00;INICIATIVA;S;0;NOVA SUISSA;BH;606875.02;796011.33;4941
+4943;2001270551;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;1679;31400;19/5/2001 04:46:00;INICIATIVA;N;0;BARRO PRETO;BH;609632.92;797106.27;4942
+4944;2001270624;B03000;AMEACA;RUA PADRE PEDRO ;2277;51657;19/5/2001 06:54:00;INICIATIVA;S;;JARDIM EUROPA;BH;608046.88;809283.20;4943
+4945;2001270706;B03000;AMEACA;RUA SATURNINO DE;50;64089;19/5/2001 10:00:00;INICIATIVA;N;0;CENTRO (BH);BH;610855.98;797753.13;4944
+4946;2001270828;B06000;LESAO CORPORAL;RUA CORONEL LOUR;25;109200;19/5/2001 10:54:00;CIDADAO COMUM;N;;JARDIM ALVORADA;BH;605889.74;800220.31;4945
+4947;2001270972;B03000;AMEACA;RUA CABROBO;573;11187;19/5/2001 13:30:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613270.28;799510.57;4946
+4948;2001271000;B03000;AMEACA;RUA PORTO SEGURO;327;60595;19/5/2001 13:43:00;CIDADAO COMUM;S;;NOVA VISTA;BH;614852.94;800555.19;4947
+4949;2001271082;B06000;LESAO CORPORAL;RUA PADRE BELCHI;227;51240;19/5/2001 14:26:00;INICIATIVA;S;0;CENTRO (BH);BH;610792.57;796787.63;4948
+4950;2001271105;B06000;LESAO CORPORAL;AV AFONSO PENA;394;1259;19/5/2001 14:44:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610976.70;797371.57;4949
+4951;2001271134;B03000;AMEACA;RUA OITO;56;84819;19/5/2001 15:13:00;CIDADAO COMUM;S;;DA LAGOA;BH;604483.44;809351.75;4950
+4952;2001271145;B03000;AMEACA;RUA AARAO REIS;540;473;19/5/2001 15:17:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611545.12;797121.03;4951
+4953;2001271244;B03000;AMEACA;RUA DR BROCHADO;340;23215;19/5/2001 16:14:00;POLICIAL MILITAR;S;0;VERA CRUZ;BH;615875.51;798147.95;4952
+4954;2001271270;B03000;AMEACA;RUA PUBLICITARIO;95;21695;19/5/2001 16:26:00;CIDADAO COMUM;S;FU;AARAO REIS;BH;612736.33;804984.01;4953
+4955;2001271283;B06000;LESAO CORPORAL;RUA MARAVILHAS;251;41426;19/5/2001 16:35:00;CIDADAO COMUM;S;;PROVIDENCIA;BH;612382.90;804177.17;4954
+4956;2001271291;B06000;LESAO CORPORAL;RUA RIO GRANDE D;456;58744;19/5/2001 16:40:00;INICIATIVA;N;0;CENTRO BH;BH;610351.17;797021.88;4955
+4957;2001271420;B03000;AMEACA;AV SEN LEVINDO C;1923;14866;19/5/2001 17:58:00;CIDADAO COMUM;S;LJC;SANTA CECILIA;BH;601016.38;787684.29;4956
+4958;2001271430;B06000;LESAO CORPORAL;RUA DES BRAULIO;1380;19917;19/5/2001 18:01:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616260.28;797776.23;4957
+4959;2001271431;B06000;LESAO CORPORAL;RUA CEL JOAO CAM;275;17808;19/5/2001 18:01:00;CIDADAO COMUM;S;;SINIMBU;BH;606419.60;808235.56;4958
+4960;2001271473;B03000;AMEACA;ESTRADA DOS BORG;42;85893;19/5/2001 18:21:00;CIDADAO COMUM;N;0;JARDIM VITORIA;BH;616427.41;804519.29;4959
+4961;2001271495;B03000;AMEACA;RUA JAIR NEGRAO ;21;21944;19/5/2001 18:35:00;CIDADAO COMUM;S;0;JARDIM ESTRELA;BH;607350.38;810168.77;4960
+4962;2001271524;B03000;AMEACA;RUA PARA DE MINA;390;52070;19/5/2001 18:58:00;CIDADAO COMUM;S;AP203;PADRE EUSTAQUIO;BH;606291.28;797707.27;4961
+4963;2001271536;B03000;AMEACA;RUA ALBA;37;1738;19/5/2001 19:03:00;CIDADAO COMUM;N;0;CAICARA;BH;608338.85;800029.22;4962
+4964;2001271550;B03000;AMEACA;RUA MARIA ANALIA;60;300366;19/5/2001 19:13:00;CIDADAO COMUM;S;;POMPEIA;BH;606878.92;808915.74;4963
+4965;2001271579;B06000;LESAO CORPORAL;RUA ARARUAMA;111;77945;19/5/2001 19:29:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606533.50;795254.31;4964
+4966;2001271659;B06000;LESAO CORPORAL;AV ARTUR GUIMARA;1000;6151;19/5/2001 20:15:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610780.22;802042.44;4965
+4967;2001271703;B04002;HOMICIDIO CONSUM;RUA DOS JAVAES;357;37198;19/5/2001 20:37:00;CIDADAO COMUM;S;;SANTA MONICA;BH;606525.85;807799.24;4966
+4968;2001271747;B03000;AMEACA;RUA MARIA CARMEM;905;127206;19/5/2001 21:01:00;CIDADAO COMUM;N;CAA;SANTA EFIGENIA;BH;614070.11;796009.57;4967
+4969;2001271750;B02000;RIXA;RUA GRAO PARA;389;31771;19/5/2001 21:04:00;CIDADAO COMUM;N;;SANTA EFIGENIA;BH;612830.65;796401.48;4968
+4970;2001271824;B06000;LESAO CORPORAL;AV ARTUR BERNARD;1150;60844;19/5/2001 21:39:00;INICIATIVA;S;0;VILA PARIS;BH;610180.14;793263.99;4969
+4971;2001271871;B04001;HOMICIDIO TENTAD;RUA REPUBLICA AR;20;58379;19/5/2001 22:10:00;CIDADAO COMUM;N;AP101;SION;BH;611786.71;793814.45;4970
+4972;2001271898;B03000;AMEACA;RUA NILO PECANHA;742;47665;19/5/2001 22:27:00;CIDADAO COMUM;S;0;BOA VISTA;BH;614370.93;800093.85;4971
+4973;2001271920;B06000;LESAO CORPORAL;RUA CLEANTO;69;46499;19/5/2001 22:38:00;CIDADAO COMUM;S;B;BELMONT;BH;615311.95;804929.64;4972
+4974;2001271964;B06000;LESAO CORPORAL;RUA OSCAR NEGRAO;200;17776;19/5/2001 23:10:00;CIDADAO COMUM;S;EM FRENTE A CADE;GAMELEIRA;BH;605051.19;794788.68;4973
+4975;2001271999;B06000;LESAO CORPORAL;RUA SILVA REIS;80;65908;19/5/2001 23:28:00;CIDADAO COMUM;N;;NOVA VISTA;BH;615541.63;800479.89;4974
+4976;2001272038;B04001;HOMICIDIO TENTAD;RUA EVOCACAO;375;26948;19/5/2001 23:52:00;INICIATIVA;N;SOCORRIDO AO ALB;SAO JOSE;BH;605821.48;798726.88;4975
+4977;2001272060;B06000;LESAO CORPORAL;ESTRADA BEIRA LI;286;10878;20/5/2001 00:03:00;INICIATIVA;S;0;SAO GABRIEL;BH;616550.18;806626.14;4976
+4978;2001272135;B03000;AMEACA;RUA PADRE PEDRO ;11;51657;20/5/2001 00:49:00;INICIATIVA;S;0;VENDA NOVA;BH;605831.31;809997.06;4977
+4979;2001272202;B06000;LESAO CORPORAL;AV ABILIO MACHAD;3123;634;20/5/2001 01:35:00;CIDADAO COMUM;S;0;ALIPIO DE MELO;BH;603784.55;799976.88;4978
+4980;2001272208;B04002;HOMICIDIO CONSUM;RUA OSCAR LOBO P;270;104480;20/5/2001 01:39:00;CIDADAO COMUM;N;;PRIMEIRO DE MAIO;BH;612347.11;803516.89;4979
+4981;2001272257;B02000;RIXA;RUA BOM RETIRO;210;10030;20/5/2001 02:05:00;CIDADAO COMUM;0;;JARDIM MONTANHES;BH;606360.47;798202.25;4980
+4982;2001272275;B04001;HOMICIDIO TENTAD;RUA CLAUDIO GOME;150;117060;20/5/2001 02:16:00;CIDADAO COMUM;N;CASA 09;DOS PALMARES;BH;611064.87;802289.97;4981
+4983;2001272289;B06000;LESAO CORPORAL;AV DO CONTORNO;6969;17228;20/5/2001 02:25:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610714.40;794917.94;4982
+4984;2001272302;B04002;HOMICIDIO CONSUM;RUA CLEMENTE BAR;525;16010;20/5/2001 02:32:00;INICIATIVA;N;0;ALIPIO DE MELO;BH;604567.10;799155.53;4983
+4985;2001272369;B06000;LESAO CORPORAL;AV OLEGARIO MACI;220;49699;20/5/2001 03:25:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610608.26;797483.18;4984
+4986;2001272379;B02000;RIXA;RUA CONSUELO;181;106296;20/5/2001 03:30:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607835.55;811463.55;4985
+4987;2001272417;B06000;LESAO CORPORAL;RUA VERISSIMO GU;475;102720;20/5/2001 04:13:00;INICIATIVA;N;0;REGINA;BH;599062.14;790155.01;4986
+4988;2001272490;B03000;AMEACA;RUA GUIDO CIOLET;76;19440;20/5/2001 05:22:00;CIDADAO COMUM;S;;BARREIRO;BH;602875.39;790418.81;4987
+4989;2001272530;B03000;AMEACA;RUA FLUORINA;570;29091;20/5/2001 06:39:00;CIDADAO COMUM;S;;POMPEIA;BH;614606.92;797613.73;4988
+4990;2001272690;B03000;AMEACA;AV BERNARDO VASC;1277;9411;20/5/2001 09:30:00;INICIATIVA;N;0;CACHOEIRINHA;BH;611028.41;801154.68;4989
+4991;2001272729;B06000;LESAO CORPORAL;AV SARAMENHA;165;64007;20/5/2001 10:09:00;INICIATIVA;N;0;FLORAMAR;BH;611941.98;805631.36;4990
+4992;2001272767;B06000;LESAO CORPORAL;AV BASILIO DA GA;36;8361;20/5/2001 10:36:00;CIDADAO COMUM;N;;TUPI;BH;613149.68;805708.58;4991
+4993;2001272828;B06000;LESAO CORPORAL;RUA BARAO DE COR;803;7910;20/5/2001 11:33:00;CIDADAO COMUM;S;CA2;SAO TOMAZ;BH;610349.02;805430.19;4992
+4994;2001272833;B03000;AMEACA;RUA LINCOLN;446;41136;20/5/2001 11:37:00;CIDADAO COMUM;S;0;UNIAO;BH;612776.31;801654.48;4993
+4995;2001272877;B03000;AMEACA;RUA CATAS ALTAS;105;51990;20/5/2001 12:15:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612519.37;804119.57;4994
+4996;2001272878;B03000;AMEACA;RUA DOUTOR CAMIL;268;23228;20/5/2001 12:11:00;CIDADAO COMUM;S;;SAO LUCAS;BH;613449.89;795496.32;4995
+4997;2001272901;B03000;AMEACA;RUA GERALDO BERN;36;103461;20/5/2001 12:34:00;CIDADAO COMUM;S;;OURO PRETO;BH;606396.19;800721.24;4996
+4998;2001272904;B06000;LESAO CORPORAL;RUA JOSE CLETO;755;38682;20/5/2001 12:37:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610608.49;802484.40;4997
+4999;2001272974;B03000;AMEACA;RUA CLEBER SOARE;57;20116;20/5/2001 13:38:00;CIDADAO COMUM;S;;SANTA MONICA;BH;607150.82;807842.20;4998
+5000;2001273001;B03000;AMEACA;RUA FLOR DE VIDR;227;13504;20/5/2001 14:03:00;INICIATIVA;S;0;CASTELO;BH;605603.23;799571.25;4999
+5001;2001273007;B03000;AMEACA;RUA DA BAHIA;637;81155;20/5/2001 14:08:00;INICIATIVA;S;0;CENTRO (BH);BH;611390.26;797003.62;5000
+5002;2001273047;B06000;LESAO CORPORAL;RUA SERRA NEGRA;1392;65038;20/5/2001 14:31:00;CIDADAO COMUM;S;CAC;SANTO ANDRE;BH;609041.92;799138.87;5001
+5003;2001273068;B06000;LESAO CORPORAL;RUA COROA DE FRA;266;77189;20/5/2001 14:49:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600562.13;786921.65;5002
+5004;2001273118;B06000;LESAO CORPORAL;BECO TIA ANASTAC;46;301677;20/5/2001 15:32:00;CIDADAO COMUM;S;FU;FAZENDINHA;BH;614694.46;795507.37;5003
+5005;2001273131;B03000;AMEACA;RUA PADRE LUIZ C;142;42472;20/5/2001 15:41:00;CIDADAO COMUM;N;;DAS INDUSTRIAS;BH;603753.25;793019.65;5004
+5006;2001273211;B04001;HOMICIDIO TENTAD;RUA ARAUA;126;5600;20/5/2001 16:35:00;CIDADAO COMUM;S;;SAO PAULO;BH;612543.10;803149.82;5005
+5007;2001273270;B03000;AMEACA;RUA PASSARO LIRA;146;68442;20/5/2001 17:09:00;CIDADAO COMUM;S;0;GOIANIA;BH;615530.18;803239.52;5006
+5008;2001273299;B06000;LESAO CORPORAL;RUA PADRE EUSTAQ;685;51294;20/5/2001 17:22:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;608908.98;797876.89;5007
+5009;2001273353;B03000;AMEACA;AV TERESA CRISTI;724;67512;20/5/2001 17:53:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608524.82;797475.69;5008
+5010;2001273364;B03000;AMEACA;AV ERICO VERISSI;1167;41671;20/5/2001 17:59:00;CIDADAO COMUM;S;0;SANTA MONICA;BH;607617.30;808717.70;5009
+5011;2001273381;B06000;LESAO CORPORAL;RUA JULIO MESQUI;8;81849;20/5/2001 18:13:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599193.51;788636.30;5010
+5012;2001273390;B03000;AMEACA;RUA BERTALHA;160;110187;20/5/2001 18:19:00;CIDADAO COMUM;N;;ANTONIO RIBEIRO ;BH;615738.53;806166.25;5011
+5013;2001273408;B06000;LESAO CORPORAL;RUA LUPERCIO PAI;221;57335;20/5/2001 18:30:00;CIDADAO COMUM;S;0;TIROL;BH;599950.08;789076.85;5012
+5014;2001273433;B03000;AMEACA;RUA LUME;269;41961;20/5/2001 18:47:00;CIDADAO COMUM;N;;COQUEIROS;BH;603305.77;800449.88;5013
+5015;2001273446;B03000;AMEACA;RUA EXPEDITO FLA;90;84847;20/5/2001 18:51:00;CIDADAO COMUM;N;CASA 41 / BLOCO ;DA LAGOA;BH;604749.70;809113.09;5014
+5016;2001273450;B06000;LESAO CORPORAL;RUA SAO FELICISS;440;62373;20/5/2001 18:54:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;606148.08;792191.84;5015
+5017;2001273454;B06000;LESAO CORPORAL;RUA TEOFILO FILH;150;91070;20/5/2001 18:55:00;CIDADAO COMUM;N;;JARDIM AMERICA;BH;605989.94;793124.95;5016
+5018;2001273499;B03000;AMEACA;RUA AMIRO RODRIG;26;61862;20/5/2001 19:17:00;INICIATIVA;S;0;APARECIDA SETIMA;BH;609026.94;800161.98;5017
+5019;2001273523;B03000;AMEACA;RUA POVOA DE VAR;437;54958;20/5/2001 19:26:00;CIDADAO COMUM;N;;PAQUETA;BH;605302.03;802656.56;5018
+5020;2001273580;B03000;AMEACA;AV AMAZONAS;1877;3140;20/5/2001 20:06:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609886.56;796413.42;5019
+5021;2001273587;B03000;AMEACA;RUA AARAO REIS;554;473;20/5/2001 20:12:00;INICIATIVA;N;0;CENTRO (BH);BH;611545.12;797119.64;5020
+5022;2001273623;B03000;AMEACA;AV RAJA GABAGLIA;3077;57830;20/5/2001 20:31:00;CIDADAO COMUM;S;0;ESTORIL;BH;609208.29;792438.19;5021
+5023;2001273629;B06000;LESAO CORPORAL;RUA COMENDADOR A;287;16382;20/5/2001 20:35:00;CIDADAO COMUM;N;;ITAMARATI;BH;606664.16;807899.34;5022
+5024;2001273668;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;379;17095;20/5/2001 21:01:00;CIDADAO COMUM;S;0;FLORESTA;BH;612028.06;797010.00;5023
+5025;2001273698;B06000;LESAO CORPORAL;AV ABILIO MACHAD;469;634;20/5/2001 21:20:00;CIDADAO COMUM;S;0;INCONFIDENCIA;BH;605007.68;798009.39;5024
+5026;2001273734;B06000;LESAO CORPORAL;RUA DANIEL LOPES;37;34449;20/5/2001 21:39:00;CIDADAO COMUM;N;0;DAS INDUSTRIAS;BH;603834.56;793135.67;5025
+5027;2001273802;B03000;AMEACA;RUA JOAQUIM LEMO;18;37724;20/5/2001 22:21:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609275.23;810024.59;5026
+5028;2001273829;B03000;AMEACA;RUA CARLOS NIEME;825;13472;20/5/2001 22:36:00;CIDADAO COMUM;S;FU;SAGRADA FAMILIA;BH;613695.14;799445.07;5027
+5029;2001273889;B06000;LESAO CORPORAL;AV JOSE BONIFACI;190;38579;20/5/2001 23:04:00;CIDADAO COMUM;S;0;PRADO LOPES;BH;610155.34;799025.63;5028
+5030;2001273908;B03000;AMEACA;RUA MARIA FELICI;185;44059;20/5/2001 23:15:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603734.72;802316.09;5029
+5031;2001274017;B03000;AMEACA;RUA NEFELINA;117;81228;21/5/2001 00:40:00;INICIATIVA;N;0;SANTA TEREZA;BH;612835.00;797309.03;5030
+5032;2001274031;B06000;LESAO CORPORAL;RUA LUIS AUGUSTO;5;124857;21/5/2001 00:52:00;CIDADAO COMUM;N;;MANGUEIRAS;BH;600721.87;786584.83;5031
+5033;2001274046;B02000;RIXA;RUA VISEU;908;62042;21/5/2001 01:08:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609672.72;802306.32;5032
+5034;2001274196;B06000;LESAO CORPORAL;RUA BONAPARTE;75;10083;21/5/2001 06:48:00;CIDADAO COMUM;N;;PADRE EUSTAQUIO;BH;607584.10;797552.96;5033
+5035;2001274197;B03000;AMEACA;RUA MARACA;1154;43346;21/5/2001 06:53:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;616526.60;799181.02;5034
+5036;2001274450;B06000;LESAO CORPORAL;RUA CENTAURO;541;14563;21/5/2001 09:48:00;CIDADAO COMUM;S;;SANTA LUCIA;BH;610100.51;792567.18;5035
+5037;2001274496;B03000;AMEACA;RUA CURITIBA;632;19090;21/5/2001 10:22:00;POLICIAL MILITAR;S;0;CENTRO (BH);BH;610853.82;797287.53;5036
+5038;2001274552;B03000;AMEACA;RUA DOS TUPINAMB;761;69940;21/5/2001 10:58:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610842.81;797365.98;5037
+5039;2001274570;B03000;AMEACA;RUA PLATINA;1457;54453;21/5/2001 11:11:00;CIDADAO COMUM;S;0;CALAFATE;BH;607792.63;796609.73;5038
+5040;2001274665;B03000;AMEACA;RUA TREZE;150;302331;21/5/2001 12:21:00;CIDADAO COMUM;S;;BONSUCESSO;BH;606355.86;789862.18;5039
+5041;2001274764;B03000;AMEACA;RUA FAGUNDES VAR;256;27689;21/5/2001 13:30:00;CIDADAO COMUM;N;0;LAGOINHA;BH;610256.27;798704.22;5040
+5042;2001274886;B03000;AMEACA;RUA PINTOR AUGUS;180;128091;21/5/2001 15:06:00;CIDADAO COMUM;S;;TUPI;BH;613389.00;805635.15;5041
+5043;2001274908;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;1600;57830;21/5/2001 15:16:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608784.38;794022.15;5042
+5044;2001274931;B03000;AMEACA;RUA SAO PAULO;114;63464;21/5/2001 15:31:00;CIDADAO COMUM;S;EN114   AN1;CENTRO (BH);BH;611103.00;797681.10;5043
+5045;2001274945;B06000;LESAO CORPORAL;RUA PITT;343;54380;21/5/2001 15:38:00;INICIATIVA;N;0;UNIAO;BH;612765.60;801021.57;5044
+5046;2001274949;B03000;AMEACA;AV JEQUITINHONHA;45;37305;21/5/2001 15:39:00;CIDADAO COMUM;S;;VERA CRUZ;BH;615703.97;798584.81;5045
+5047;2001274973;B03000;AMEACA;AV VINTE E OITO ;283;72970;21/5/2001 15:54:00;CIDADAO COMUM;S;;ESPLANADA;BH;614619.31;798893.34;5046
+5048;2001275004;B06000;LESAO CORPORAL;RUA EXPEDICIONAR;185;27027;21/5/2001 16:14:00;CIDADAO COMUM;N;0;SAO LUIZ;BH;606686.05;803437.82;5047
+5049;2001275221;B06000;LESAO CORPORAL;RUA ARIOLINO ARI;151;85811;21/5/2001 18:01:00;CIDADAO COMUM;N;CAFU;SERRA VERDE;BH;609228.75;810106.96;5048
+5050;2001275330;B04001;HOMICIDIO TENTAD;AV A;930;34099;21/5/2001 19:04:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612389.02;807268.89;5049
+5051;2001275338;B03000;AMEACA;RUA MONTE BRANCO;585;46417;21/5/2001 19:07:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606551.97;795683.29;5050
+5052;2001275344;B04002;HOMICIDIO CONSUM;RUA JOAO PAULO I;5;300458;21/5/2001 19:09:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607634.38;793575.75;5051
+5053;2001275414;B03000;AMEACA;RUA PAULA DIAS;66;52634;21/5/2001 19:50:00;INICIATIVA;N;0;UNIAO;BH;612328.98;801534.33;5052
+5054;2001275472;B06000;LESAO CORPORAL;RUA ALFEU DE CAR;276;2223;21/5/2001 20:28:00;CIDADAO COMUM;S;;TUPI;BH;613601.59;805893.87;5053
+5055;2001275546;B03000;AMEACA;RUA PARA DE MINA;271;52070;21/5/2001 21:35:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;606412.82;797640.03;5054
+5056;2001275600;B04001;HOMICIDIO TENTAD;RUA JOSUE MARTIN;146;84821;21/5/2001 22:05:00;CIDADAO COMUM;N;;DA LAGOA;BH;604509.51;809508.04;5055
+5057;2001275603;B03000;AMEACA;RUA JOSE PINTO D;389;100901;21/5/2001 22:06:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611512.23;807703.49;5056
+5058;2001275640;B04001;HOMICIDIO TENTAD;RUA CURITIBA;258;19090;21/5/2001 22:33:00;INICIATIVA;N;0;CENTRO (BH);BH;610943.75;797629.80;5057
+5059;2001275833;B06000;LESAO CORPORAL;AV SANTA ALBERTI;903;116170;22/5/2001 01:47:00;CIDADAO COMUM;S;;CASA BRANCA;BH;616511.53;800054.35;5058
+5060;2001276130;B03000;AMEACA;RUA FERREIRA;288;28161;22/5/2001 08:52:00;CIDADAO COMUM;N;;EYMARD;BH;613694.20;803637.73;5059
+5061;2001276167;B04001;HOMICIDIO TENTAD;RUA SANTOS;2200;61910;22/5/2001 09:18:00;CIDADAO COMUM;N;0;SAO DOMINGOS;BH;607908.90;793256.53;5060
+5062;2001276251;B06000;LESAO CORPORAL;RUA ALIANCA;92;2324;22/5/2001 10:27:00;CIDADAO COMUM;N;0;SAO GABRIEL;BH;613401.48;804083.87;5061
+5063;2001276350;B06000;LESAO CORPORAL;AV ELIAS ANTONIO;502;104726;22/5/2001 11:38:00;CIDADAO COMUM;N;0;VENDA NOVA;BH;607224.67;809399.71;5062
+5064;2001276366;B03000;AMEACA;RUA FREI LUIZ DE;481;29961;22/5/2001 11:49:00;CIDADAO COMUM;S;;JOAO PINHEIRO;BH;604477.25;796175.73;5063
+5065;2001276411;B06000;LESAO CORPORAL;RUA AMERICO MAGA;422;3314;22/5/2001 12:20:00;CIDADAO COMUM;S;;BARREIRO;BH;602220.18;790566.15;5064
+5066;2001276422;B06000;LESAO CORPORAL;RUA DOS CARIJOS;504;81243;22/5/2001 12:32:00;INICIATIVA;N;0;CENTRO (BH);BH;610976.67;797223.89;5065
+5067;2001276488;B06000;LESAO CORPORAL;RUA GENTIL PORTU;449;119370;22/5/2001 13:23:00;CIDADAO COMUM;S;0;VILA MAGNESITA;BH;602070.13;795047.24;5066
+5068;2001276570;B06000;LESAO CORPORAL;RUA ESPINOSA;315;26024;22/5/2001 14:28:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;609029.44;798321.28;5067
+5069;2001276579;B03000;AMEACA;RUA JOSE MOREIRA;1053;55368;22/5/2001 14:33:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614395.90;802801.54;5068
+5070;2001276697;B03000;AMEACA;RUA FLOR DA CACH;330;28524;22/5/2001 15:39:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;605682.14;799348.85;5069
+5071;2001276698;B06000;LESAO CORPORAL;RUA RIO GRANDE D;441;58744;22/5/2001 15:40:00;CIDADAO COMUM;S;LJ;CENTRO (BH);BH;610401.04;797083.20;5070
+5072;2001276808;B06000;LESAO CORPORAL;AV DOUTOR ALVARO;754;117665;22/5/2001 16:40:00;CIDADAO COMUM;S;0;SANTA BRANCA;BH;608440.88;807202.81;5071
+5073;2001277070;B06000;LESAO CORPORAL;RUA ANTONIO PRAC;98;109805;22/5/2001 18:49:00;CIDADAO COMUM;S;;BONSUCESSO;BH;605541.58;789914.87;5072
+5074;2001277095;B03000;AMEACA;RUA FERNAO DIAS;60;28133;22/5/2001 18:58:00;CIDADAO COMUM;S;0;CASA BRANCA;BH;616318.93;799741.71;5073
+5075;2001277203;B03000;AMEACA;RUA W QUATRO;339;122634;22/5/2001 20:05:00;CIDADAO COMUM;S;0;PONGELUPE;BH;604000.81;787302.07;5074
+5076;2001277223;B06000;LESAO CORPORAL;RUA SAO VICENTE;54;88126;22/5/2001 20:15:00;CIDADAO COMUM;S;BLOCO 390;GRANJA FREITAS;BH;617022.85;798456.93;5075
+5077;2001277336;B03000;AMEACA;RUA MARTINS SOAR;740;45049;22/5/2001 21:33:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604912.80;792944.99;5076
+5078;2001277339;B03000;AMEACA;RUA VINTE;52;302826;22/5/2001 21:36:00;CIDADAO COMUM;S;;NOVO AARAO REIS;BH;614620.50;805688.82;5077
+5079;2001277380;B06000;LESAO CORPORAL;RUA MADALENA;307;42315;22/5/2001 22:01:00;CIDADAO COMUM;S;AP01;SENHOR BOM JESUS;BH;609701.82;799838.82;5078
+5080;2001277394;B06000;LESAO CORPORAL;AV FLOR DE SEDA;580;748;22/5/2001 22:12:00;CIDADAO COMUM;S;;LINDEIA;BH;599238.03;790679.79;5079
+5081;2001277399;B06000;LESAO CORPORAL;RUA DAS GABIROBA;95;30375;22/5/2001 22:18:00;CIDADAO COMUM;S;;VILA CLORIS;BH;610034.72;808298.49;5080
+5082;2001277400;B03000;AMEACA;RUA BELA EMILIA;200;96175;22/5/2001 22:16:00;CIDADAO COMUM;S;0;OLARIA;BH;601337.35;789370.00;5081
+5083;2001277466;B04001;HOMICIDIO TENTAD;RUA ALVARO OLIVE;175;58381;22/5/2001 23:04:00;CIDADAO COMUM;S;0;MARIA VIRGINIA;BH;611835.32;802870.75;5082
+5084;2001277478;B06000;LESAO CORPORAL;RUA SEARA;378;68685;22/5/2001 23:10:00;CIDADAO COMUM;S;0;COQUEIROS;BH;602279.67;798769.43;5083
+5085;2001277567;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;23/5/2001 00:39:00;INICIATIVA;S;0;TIROL;BH;600947.66;789885.51;5084
+5086;2001277681;B03000;AMEACA;RUA ANTONIO JULI;216;111379;23/5/2001 03:03:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;606775.18;806180.58;5085
+5087;2001277768;B06000;LESAO CORPORAL;RUA EXPEDITO FLA;40;84847;23/5/2001 05:56:00;CIDADAO COMUM;N;CA 41;DA LAGOA;BH;604784.62;809092.91;5086
+5088;2001277777;B06000;LESAO CORPORAL;RUA DOS GUARANIS;124;32181;23/5/2001 06:32:00;INICIATIVA;N;0;CENTRO (BH);BH;610723.61;797512.51;5087
+5089;2001278167;B03000;AMEACA;RUA ESTANISLAU F;111;26267;23/5/2001 11:25:00;CIDADAO COMUM;S;;BANDEIRANTES;BH;606222.65;802875.95;5088
+5090;2001278187;B03000;AMEACA;RUA DOS CARIJOS;408;81243;23/5/2001 11:39:00;CIDADAO COMUM;N;SOBRE LOJA;CENTRO (BH);BH;611064.18;797198.94;5089
+5091;2001278248;B03000;AMEACA;RUA BERNARDINO D;231;9336;23/5/2001 12:41:00;CIDADAO COMUM;S;;GUTIERREZ;BH;608913.93;795852.97;5090
+5092;2001278280;B03000;AMEACA;RUA ITAPETINGA;87;35804;23/5/2001 12:59:00;CIDADAO COMUM;S;0;SAO CRISTOVAO;BH;610402.29;799494.96;5091
+5093;2001278287;B03000;AMEACA;AV AFONSO PENA;4183;1259;23/5/2001 13:10:00;INICIATIVA;N;0;CRUZEIRO;BH;612944.53;794095.63;5092
+5094;2001278426;B03000;AMEACA;RUA OURO FINO;16;50714;23/5/2001 14:44:00;CIDADAO COMUM;S;AP901;CRUZEIRO;BH;612074.49;794639.35;5093
+5095;2001278451;B09000;ABANDONO DE INCA;RUA DOMINGOS DE ;73;102112;23/5/2001 15:03:00;CIDADAO COMUM;S;;ITAIPU BH;BH;599757.23;788374.16;5094
+5096;2001278476;B03000;AMEACA;RUA GUARAIBA;3;96291;23/5/2001 15:15:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614395.92;804666.82;5095
+5097;2001278552;B03000;AMEACA;RUA BANDONION;442;170139;23/5/2001 15:52:00;CIDADAO COMUM;N;PX472;VILA CAFEZAL;BH;614122.39;794785.34;5096
+5098;2001278610;B03000;AMEACA;RUA TOMBOS;38;67985;23/5/2001 16:16:00;CIDADAO COMUM;S;;CALAFATE;BH;607983.96;796880.16;5097
+5099;2001278633;B03000;AMEACA;RUA POUSO ALEGRE;105;54932;23/5/2001 16:29:00;CIDADAO COMUM;N;;FLORESTA;BH;611138.61;798018.14;5098
+5100;2001278753;B03000;AMEACA;RUA DOS BOROROS;19;10216;23/5/2001 17:35:00;INICIATIVA;S;0;SANTA MONICA;BH;606549.06;807469.90;5099
+5101;2001278850;B06000;LESAO CORPORAL;RUA QUARENTA E U;106;34801;23/5/2001 18:24:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612521.64;807196.19;5100
+5102;2001278927;B03000;AMEACA;RUA CANTAGALO;80;12697;23/5/2001 19:04:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609858.05;799342.85;5101
+5103;2001278946;B03000;AMEACA;AV SARAMENHA;1400;64007;23/5/2001 19:14:00;CIDADAO COMUM;S;;GUARANI;BH;613120.71;805643.66;5102
+5104;2001278966;B03000;AMEACA;RUA CINQUENTA;368;302845;23/5/2001 19:22:00;CIDADAO COMUM;S;;TUPI;BH;614150.27;805475.49;5103
+5105;2001278984;B03000;AMEACA;RUA CORONEL OTAV;29;13620;23/5/2001 19:36:00;CIDADAO COMUM;S;0;PARAISO;BH;614424.13;797386.27;5104
+5106;2001279009;B03000;AMEACA;RUA IPANEMA;1135;34726;23/5/2001 19:50:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;602814.25;802311.29;5105
+5107;2001279047;B03000;AMEACA;RUA MARIA BEATRI;166;43881;23/5/2001 20:11:00;CIDADAO COMUM;N;AP 103;HAVAI;BH;606737.06;793607.05;5106
+5108;2001279168;B06000;LESAO CORPORAL;AV NELIO CERQUEI;15;72359;23/5/2001 21:13:00;INICIATIVA;S;0;TIROL;BH;600947.66;789885.51;5107
+5109;2001279277;B03000;AMEACA;RUA BOLIVAR;458;9871;23/5/2001 22:26:00;CIDADAO COMUM;S;;UNIAO;BH;612866.19;801674.00;5108
+5110;2001279278;B04002;HOMICIDIO CONSUM;RUA RAINHA DAS F;162;92159;23/5/2001 22:26:00;CIDADAO COMUM;N;0;FILADELFIA;BH;602100.52;797477.94;5109
+5111;2001279344;B06000;LESAO CORPORAL;RUA DOS CAETES;372;11376;23/5/2001 23:04:00;CIDADAO COMUM;N;AN2;CENTRO (BH);BH;611253.80;797440.40;5110
+5112;2001279381;B03000;AMEACA;RUA JOAO ALVES T;75;84963;23/5/2001 23:20:00;CIDADAO COMUM;S;;MANTIQUEIRA;BH;606095.35;810560.19;5111
+5113;2001279416;B06000;LESAO CORPORAL;AV GETULIO VARGA;671;81256;23/5/2001 23:41:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;612052.08;795376.53;5112
+5114;2001279426;B06000;LESAO CORPORAL;AV ITAITUBA;450;35454;23/5/2001 23:50:00;CIDADAO COMUM;N;0;BOA VISTA;BH;615072.17;799768.56;5113
+5115;2001279517;B06000;LESAO CORPORAL;BECO PAI JOAQUIM;130;171056;24/5/2001 01:13:00;CIDADAO COMUM;S;;CABANA;BH;604615.44;794171.61;5114
+5116;2001279549;B06000;LESAO CORPORAL;RUA DAS PETUNIAS;845;11870;24/5/2001 01:53:00;CIDADAO COMUM;N;;LINDEIA;BH;598835.03;791076.43;5115
+5117;2001279573;B03000;AMEACA;RUA PROFESSOR RU;337;86754;24/5/2001 02:39:00;CIDADAO COMUM;N;;JARDIM GUANABARA;BH;611623.53;807570.50;5116
+5118;2001279836;B03000;AMEACA;RUA ENGENHO DA P;72;85622;24/5/2001 09:04:00;INICIATIVA;S;0;ENGENHO NOGUEIRA;BH;606453.65;800474.17;5117
+5119;2001279952;B03000;AMEACA;RUA JOSUE MARTIN;768;84821;24/5/2001 10:08:00;CIDADAO COMUM;N;;DA LAGOA;BH;604376.66;809326.50;5118
+5120;2001280107;B06000;LESAO CORPORAL;RUA CANDIDO DE S;657;12628;24/5/2001 11:59:00;CIDADAO COMUM;N;;GAMELEIRA;BH;605715.13;794396.26;5119
+5121;2001280115;B03000;AMEACA;RUA JABOATAO;33;36498;24/5/2001 12:03:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;605038.10;794746.42;5120
+5122;2001280171;B03000;AMEACA;RUA DOS TUPINAMB;861;69940;24/5/2001 12:55:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610736.01;797388.04;5121
+5123;2001280174;B06000;LESAO CORPORAL;RUA BENJAMIM JAC;294;9207;24/5/2001 12:59:00;CIDADAO COMUM;N;CAFU;GUTIERREZ;BH;608971.75;794756.23;5122
+5124;2001280327;B06000;LESAO CORPORAL;RUA CARANGOLA;288;13094;24/5/2001 14:45:00;CIDADAO COMUM;N;3 ANDAR;SANTO ANTONIO;BH;610731.49;794680.82;5123
+5125;2001280338;B06000;LESAO CORPORAL;AV CRISTIANO MAC;4000;18652;24/5/2001 14:54:00;INICIATIVA;N;0;DOS PALMARES;BH;612434.91;802092.92;5124
+5126;2001280343;B03000;AMEACA;RUA JULITA NOGUE;815;39597;24/5/2001 14:56:00;CIDADAO COMUM;S;LJ1;SANTA TEREZINHA;BH;604270.87;802788.56;5125
+5127;2001280372;B03000;AMEACA;RUA JOAO ALEXAND;267;71384;24/5/2001 15:15:00;CIDADAO COMUM;S;;MILIONARIOS;BH;603980.36;789980.34;5126
+5128;2001280491;B06000;LESAO CORPORAL;RUA CURITIBA;618;19090;24/5/2001 16:12:00;CIDADAO COMUM;S;FR601;CENTRO (BH);BH;610854.28;797299.45;5127
+5129;2001280502;B06000;LESAO CORPORAL;RUA GRAUNAS;414;31797;24/5/2001 16:19:00;CIDADAO COMUM;S;PROX. PADARIA GR;VILA CEMIG;BH;605539.74;788730.01;5128
+5130;2001280592;B03000;AMEACA;RUA RIO DE JANEI;1226;58772;24/5/2001 17:03:00;CIDADAO COMUM;S;0;LOURDES;BH;610936.28;796511.14;5129
+5131;2001280616;B03000;AMEACA;RUA SEBASTIAO DE;154;64209;24/5/2001 17:16:00;INICIATIVA;S;0;NOVA GRANADA;BH;607921.86;794816.01;5130
+5132;2001280644;B03000;AMEACA;RUA ITAOCA;135;35703;24/5/2001 17:31:00;CIDADAO COMUM;N;;FLORAMAR;BH;611520.36;805977.45;5131
+5133;2001280745;B03000;AMEACA;RUA MOREIRA DIAS;7;31191;24/5/2001 18:26:00;CIDADAO COMUM;N;LJ;CONJ HAB JARDIM ;BH;603860.94;798157.37;5132
+5134;2001280853;B03000;AMEACA;AV PRESIDENTE AN;2241;4461;24/5/2001 19:10:00;INICIATIVA;S;0;CACHOEIRINHA;BH;609932.46;800069.95;5133
+5135;2001280949;B03000;AMEACA;RUA IPANEMA;1061;34726;24/5/2001 20:04:00;CIDADAO COMUM;S;0;SARANDI (URCA/BH;BH;602857.04;802334.16;5134
+5136;2001280964;B05000;SEQUESTRO E CARC;RUA DEPUTADO ALV;416;66030;24/5/2001 20:08:00;CIDADAO COMUM;S;APTO 102;SANTO ANTONIO;BH;610586.47;793838.70;5135
+5137;2001280989;B05000;SEQUESTRO E CARC;RUA CORONEL JOAQ;257;17864;24/5/2001 20:18:00;CIDADAO COMUM;N;FU;HELIOPOLIS;BH;611086.49;806159.62;5136
+5138;2001281063;B03000;AMEACA;RUA EMANUEL;224;87010;24/5/2001 21:04:00;CIDADAO COMUM;S;0;PILAR;BH;607677.72;788684.08;5137
+5139;2001281065;B03000;AMEACA;AV DOS BANDEIRAN;2323;7775;24/5/2001 21:06:00;CIDADAO COMUM;S;;MANGABEIRAS;BH;613280.67;794128.20;5138
+5140;2001281119;B06000;LESAO CORPORAL;AV FRANCISCO SA;1369;29656;24/5/2001 21:31:00;CIDADAO COMUM;S;0;GUTIERREZ;BH;608976.96;795456.85;5139
+5141;2001281127;B03000;AMEACA;RUA DOS GOITACAZ;182;31400;24/5/2001 21:35:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611092.06;796762.15;5140
+5142;2001281197;B04001;HOMICIDIO TENTAD;RUA ALFREDO ALVE;10;20636;24/5/2001 22:19:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608779.25;807888.15;5141
+5143;2001281392;B03000;AMEACA;RUA GONCALVES DI;2299;31513;25/5/2001 00:16:00;INICIATIVA;N;0;LOURDES;BH;610326.03;796058.66;5142
+5144;2001281409;B03000;AMEACA;AV PARANA;26;52230;25/5/2001 00:34:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610802.35;797494.35;5143
+5145;2001281522;B03000;AMEACA;RUA MAJOR LOPES;729;42646;25/5/2001 02:47:00;CIDADAO COMUM;N;;SAO PEDRO;BH;611437.36;794125.71;5144
+5146;2001281898;B03000;AMEACA;RUA INDIANA;509;34410;25/5/2001 09:43:00;CIDADAO COMUM;S;AP301;JARDIM AMERICA;BH;607373.55;794767.27;5145
+5147;2001281946;B03000;AMEACA;RUA PADRE PEDRO ;3260;51657;25/5/2001 10:11:00;CIDADAO COMUM;N;0;LETICIA;BH;607007.69;809969.06;5146
+5148;2001282081;B02000;RIXA;AV OLEGARIO MACI;583;49699;25/5/2001 11:46:00;CIDADAO COMUM;S;LJ31;CENTRO (BH);BH;610565.00;797105.59;5147
+5149;2001282088;B06000;LESAO CORPORAL;VIA PRESIDENTE J;4500;130006;25/5/2001 11:50:00;CIDADAO COMUM;N;;CALIFORNIA;BH;607778.73;796821.76;5148
+5150;2001282089;B03000;AMEACA;RUA SAO LUIZ;5;63288;25/5/2001 11:51:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609870.41;805338.58;5149
+5151;2001282334;B03000;AMEACA;RUA CRUZEIRO DO ;209;18927;25/5/2001 14:41:00;CIDADAO COMUM;S;;SANTA HELENA (BH;BH;603532.73;789011.35;5150
+5152;2001282410;B06000;LESAO CORPORAL;AV PRESIDENTE CA;525;55125;25/5/2001 15:36:00;CIDADAO COMUM;N;0;ALTO DOS CAICARA;BH;608340.47;798800.45;5151
+5153;2001282491;B06000;LESAO CORPORAL;RUA DOUTOR GERVA;40;87050;25/5/2001 16:25:00;CIDADAO COMUM;N;0;OLHOS DAGUA;BH;608108.50;788523.67;5152
+5154;2001282503;B03000;AMEACA;RUA CINCO DE JAN;228;119604;25/5/2001 16:34:00;CIDADAO COMUM;N;NR CORRETO E 254;SAO GERALDO;BH;616284.75;799825.01;5153
+5155;2001282546;B06000;LESAO CORPORAL;AV AMAZONAS;478;3140;25/5/2001 16:53:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611039.88;797135.69;5154
+5156;2001282551;B04001;HOMICIDIO TENTAD;AV MANOEL SALLES;200;432;25/5/2001 16:56:00;CIDADAO COMUM;N;;CARDOSO;BH;603752.13;788401.90;5155
+5157;2001282566;B06000;LESAO CORPORAL;RUA SERRINHA;45;129201;25/5/2001 17:01:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;600519.25;786719.95;5156
+5158;2001282631;B03000;AMEACA;RUA GERALDA GONC;60;84254;25/5/2001 17:33:00;CIDADAO COMUM;S;RUA IZAUTINA MAR;JARDIM VITORIA;BH;617144.90;804912.86;5157
+5159;2001282726;B04001;HOMICIDIO TENTAD;RUA BENTO;30;170807;25/5/2001 18:27:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608443.37;794109.13;5158
+5160;2001282731;B03000;AMEACA;RUA I;130;104700;25/5/2001 18:26:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;607030.39;793937.19;5159
+5161;2001282982;B06000;LESAO CORPORAL;AV PARANA;33;52230;25/5/2001 20:32:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610863.26;797477.33;5160
+5162;2001283047;B06000;LESAO CORPORAL;RUA JOAQUIM TEIX;63;38207;25/5/2001 21:06:00;CIDADAO COMUM;S;;CARDOSO;BH;604078.65;788100.48;5161
+5163;2001283053;B06000;LESAO CORPORAL;RUA RADIALISTA A;178;99003;25/5/2001 21:10:00;CIDADAO COMUM;S;;CEU AZUL;BH;604527.89;807566.31;5162
+5164;2001283176;B05000;SEQUESTRO E CARC;RUA SESSENTA E U;100;65167;25/5/2001 22:18:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608098.40;808395.62;5163
+5165;2001283214;B03000;AMEACA;AV DOM PEDRO II;2885;53145;25/5/2001 22:41:00;INICIATIVA;S;0;CARLOS PRATES;BH;608077.06;798049.51;5164
+5166;2001283237;B06000;LESAO CORPORAL;RUA CENTRALINA;270;14840;25/5/2001 22:52:00;CIDADAO COMUM;S;0;SANTA INES;BH;614171.90;800275.69;5165
+5167;2001283243;B03000;AMEACA;RUA MINISTRO OLI;72;46619;25/5/2001 22:57:00;CIDADAO COMUM;S;CAA;SANTA MONICA;BH;607953.66;807394.94;5166
+5168;2001283278;B03000;AMEACA;RUA OSWALDO FERR;70;39382;25/5/2001 23:12:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604732.86;792044.18;5167
+5169;2001283305;B08000;VIOLACAO DE DOMI;RUA PROFESSOR AR;323;5801;25/5/2001 23:29:00;CIDADAO COMUM;S;AP02;SANTO ANTONIO;BH;610205.23;794414.18;5168
+5170;2001283337;B04001;HOMICIDIO TENTAD;RUA NOSSA SENHOR;10;170182;25/5/2001 23:43:00;CIDADAO COMUM;S;0;CABANA;BH;604634.49;794225.93;5169
+5171;2001283373;B06000;LESAO CORPORAL;RUA DESENGANO;32;19860;26/5/2001 00:02:00;CIDADAO COMUM;N;;MANGABEIRAS;BH;612211.82;792481.68;5170
+5172;2001283425;B06000;LESAO CORPORAL;RUA PLATINA;580;54453;26/5/2001 00:43:00;CIDADAO COMUM;S;0;PRADO;BH;608677.53;796816.06;5171
+5173;2001283430;B03000;AMEACA;AV PRESIDENTE AN;3633;4461;26/5/2001 00:48:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;609764.82;801488.12;5172
+5174;2001283477;B02000;RIXA;RUA COBRE;200;16124;26/5/2001 01:11:00;CIDADAO COMUM;S;;CRUZEIRO;BH;612541.79;794425.08;5173
+5175;2001283500;B06000;LESAO CORPORAL;RUA DOUTOR RIBEI;355;23650;26/5/2001 01:26:00;CIDADAO COMUM;S;0;DAS INDUSTRIAS;BH;603537.51;792795.69;5174
+5176;2001283517;B03000;AMEACA;AV PRESIDENTE AN;3633;4461;26/5/2001 01:36:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;609764.82;801488.12;5175
+5177;2001283535;B02000;RIXA;RUA CURITIBA;343;19090;26/5/2001 01:50:00;INICIATIVA;N;0;CENTRO (BH);BH;610968.29;797543.53;5176
+5178;2001283543;B06000;LESAO CORPORAL;RUA DANTE;416;19642;26/5/2001 01:58:00;CIDADAO COMUM;S;;SAO LUCAS;BH;612910.82;795728.90;5177
+5179;2001283616;B06000;LESAO CORPORAL;RUA MARMORE;582;44695;26/5/2001 02:57:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;613395.01;797414.73;5178
+5180;2001283663;B02000;RIXA;RUA SILVA ALVARE;507;65810;26/5/2001 03:30:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615370.54;799332.02;5179
+5181;2001283700;B06000;LESAO CORPORAL;RUA SAO PAULO;175;63464;26/5/2001 04:26:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611119.54;797591.18;5180
+5182;2001283757;B04001;HOMICIDIO TENTAD;AV AMAZONAS;5253;3140;26/5/2001 05:45:00;INICIATIVA;S;0;NOVA SUISSA;BH;606825.09;795951.48;5181
+5183;2001283767;B06000;LESAO CORPORAL;RUA STA MARGARID;439;60986;26/5/2001 06:05:00;CIDADAO COMUM;S;;NAZARE;BH;615391.93;804360.13;5182
+5184;2001283791;B03000;AMEACA;RUA SILVA ALVARE;507;65810;26/5/2001 06:47:00;CIDADAO COMUM;N;;SAO GERALDO;BH;615370.54;799332.02;5183
+5185;2001283799;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;361;26052;26/5/2001 06:59:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611326.30;797302.57;5184
+5186;2001283851;B06000;LESAO CORPORAL;AV NOSSA SENHORA;1890;47996;26/5/2001 07:51:00;INICIATIVA;N;0;SAO PEDRO;BH;611009.80;793343.42;5185
+5187;2001283940;B03000;AMEACA;RUA ITAPECERICA;769;35757;26/5/2001 08:52:00;INICIATIVA;S;0;LAGOINHA;BH;610386.11;798482.47;5186
+5188;2001283965;B03000;AMEACA;AV AMAZONAS;4410;3140;26/5/2001 09:14:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;607487.10;796000.98;5187
+5189;2001283997;B03000;AMEACA;AV PORTUGAL;5101;54816;26/5/2001 09:34:00;CIDADAO COMUM;S;;ITAPOA;BH;609450.94;805490.11;5188
+5190;2001284134;B06000;LESAO CORPORAL;RUA SERRA FORMOS;20;109225;26/5/2001 11:14:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615180.89;807887.67;5189
+5191;2001284207;B03000;AMEACA;RUA TERCIA CABRA;50;118135;26/5/2001 12:13:00;CIDADAO COMUM;N;;CH TUNEL DE IBIR;BH;599852.03;789754.31;5190
+5192;2001284300;B06000;LESAO CORPORAL;RUA QUATRO;46;126840;26/5/2001 13:32:00;CIDADAO COMUM;S;0;BETANIA;BH;605305.32;792543.78;5191
+5193;2001284304;B06000;LESAO CORPORAL;AV GUARAPARI;1201;20711;26/5/2001 13:34:00;CIDADAO COMUM;N;;JARDIM ATLANTICO;BH;607346.51;806392.63;5192
+5194;2001284336;B03000;AMEACA;RUA ICARAI;978;34004;26/5/2001 13:55:00;CIDADAO COMUM;N;AP301;ALTO DOS CAICARA;BH;607895.02;799025.63;5193
+5195;2001284398;B03000;AMEACA;RUA NOSSA SENHOR;25;64905;26/5/2001 14:37:00;CIDADAO COMUM;S;0;JARDIM AMERICA;BH;607765.22;794520.66;5194
+5196;2001284399;B03000;AMEACA;RUA CATALUNHA;166;14204;26/5/2001 14:38:00;INICIATIVA;S;0;SARANDI (URCA/BH;BH;603684.17;802323.97;5195
+5197;2001284477;B03000;AMEACA;RUA INFANTIL;81;80660;26/5/2001 15:22:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604563.01;797057.53;5196
+5198;2001284495;B06000;LESAO CORPORAL;RUA MARCELINO FE;727;43490;26/5/2001 15:32:00;CIDADAO COMUM;S;;SANTA INES;BH;614209.93;801758.02;5197
+5199;2001284503;B03000;AMEACA;RUA GUTIERREZ;5;24637;26/5/2001 15:35:00;CIDADAO COMUM;S;NUMERO CORRETO E;TAQUARIL;BH;617427.50;797417.78;5198
+5200;2001284543;B03000;AMEACA;RUA MARATAIZES;310;51092;26/5/2001 16:01:00;CIDADAO COMUM;S;;IPANEMA;BH;604675.62;798245.47;5199
+5201;2001284555;B04002;HOMICIDIO CONSUM;RUA DONA JUDITE ;794;39414;26/5/2001 16:10:00;CIDADAO COMUM;N;CAA;REGINA;BH;598670.03;790410.17;5200
+5202;2001284564;B06000;LESAO CORPORAL;AV SIDERAL;89;65721;26/5/2001 16:14:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;603852.38;793551.54;5201
+5203;2001284651;B03000;AMEACA;RUA VIOLETA DE M;90;80253;26/5/2001 17:06:00;INICIATIVA;N;0;SAO JOSE;BH;605267.44;799157.87;5202
+5204;2001284653;B03000;AMEACA;RUA JOAO DE MATO;190;37800;26/5/2001 17:04:00;CIDADAO COMUM;N;0;IPIRANGA;BH;611502.45;800913.64;5203
+5205;2001284663;B03000;AMEACA;RUA DES CINTRA N;540;62966;26/5/2001 17:15:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604305.96;789885.00;5204
+5206;2001284692;B04002;HOMICIDIO CONSUM;RUA MARIA RITA B;285;121934;26/5/2001 17:31:00;INICIATIVA;N;0;INDEPENDENCIA;BH;602404.76;786326.03;5205
+5207;2001284716;B03000;AMEACA;RUA UM;505;27979;26/5/2001 17:42:00;CIDADAO COMUM;N;;CAPITAO EDUARDO;BH;618631.70;807113.56;5206
+5208;2001284719;B06000;LESAO CORPORAL;RUA LUNARDI;12;41899;26/5/2001 17:45:00;CIDADAO COMUM;N;0;PEDRO SEGUNDO;BH;608406.08;798297.52;5207
+5209;2001284743;B03000;AMEACA;RUA MAUREA DE OL;320;117592;26/5/2001 17:58:00;CIDADAO COMUM;N;;VENDA NOVA;BH;607368.76;809104.72;5208
+5210;2001284752;B03000;AMEACA;RUA ODILON DIAS ;268;49112;26/5/2001 18:03:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604281.61;797258.86;5209
+5211;2001284758;B03000;AMEACA;RUA DEUSDALMA;112;20069;26/5/2001 18:06:00;CIDADAO COMUM;N;0;NOVA GAMELEIRA;BH;605634.14;794503.99;5210
+5212;2001284763;B06000;LESAO CORPORAL;RUA PAULO DUARTE;275;94066;26/5/2001 18:13:00;CIDADAO COMUM;S;CAUN;SANTA CECILIA;BH;601223.87;788340.04;5211
+5213;2001284770;B03000;AMEACA;AV SIDERAL;89;65721;26/5/2001 18:16:00;CIDADAO COMUM;S;0;VISTA ALEGRE;BH;603852.38;793551.54;5212
+5214;2001284778;B06000;LESAO CORPORAL;AV PADRE JOSE MA;1191;53448;26/5/2001 18:25:00;CIDADAO COMUM;S;;VISTA ALEGRE;BH;604787.25;793141.38;5213
+5215;2001284802;B03000;AMEACA;RUA JOSE DE ARAU;595;24725;26/5/2001 18:41:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;607367.03;793894.95;5214
+5216;2001284811;B03000;AMEACA;RUA ITANAJE;124;35643;26/5/2001 18:47:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606436.88;795219.48;5215
+5217;2001284904;B03000;AMEACA;RUA ANCHIETA;130;23559;26/5/2001 19:31:00;INICIATIVA;S;0;TAQUARIL;BH;617463.18;796945.34;5216
+5218;2001284921;B03000;AMEACA;RUA DAS OLIVEIRA;279;119620;26/5/2001 19:38:00;CIDADAO COMUM;S;CA1;SAO GERALDO;BH;616314.78;799827.01;5217
+5219;2001284930;B06000;LESAO CORPORAL;RUA NELSON SOARE;417;47463;26/5/2001 19:41:00;CIDADAO COMUM;N;AP201;CIDADE NOVA;BH;612293.70;800251.52;5218
+5220;2001284964;B03000;AMEACA;RUA CINQUENTA E ;36;106416;26/5/2001 20:02:00;CIDADAO COMUM;N;0;JARDIM DOS COMER;BH;608384.93;811048.95;5219
+5221;2001285018;B03000;AMEACA;RUA JOSE CLETO;1075;38682;26/5/2001 20:36:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610463.70;802431.79;5220
+5222;2001285049;B06000;LESAO CORPORAL;RUA MADRE TEREZA;264;96594;26/5/2001 20:51:00;CIDADAO COMUM;S;;JARDIM EUROPA;BH;608301.76;809616.81;5221
+5223;2001285093;B03000;AMEACA;RUA CHAFARIZ;60;300275;26/5/2001 21:11:00;CIDADAO COMUM;S;;HAVAI;BH;607388.59;793775.52;5222
+5224;2001285181;B06000;LESAO CORPORAL;RUA BOACHA;407;9695;26/5/2001 21:59:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604961.28;797374.77;5223
+5225;2001285183;B04001;HOMICIDIO TENTAD;RUA JOAO PAULO I;230;300458;26/5/2001 21:57:00;CIDADAO COMUM;N;0;SAO DOMINGOS;BH;607666.14;793505.29;5224
+5226;2001285203;B06000;LESAO CORPORAL;AV VINTE E OITO ;356;72970;26/5/2001 22:10:00;CIDADAO COMUM;N;0;ESPLANADA;BH;614552.43;798837.28;5225
+5227;2001285214;B06000;LESAO CORPORAL;RUA AVELINO GIAR;218;99350;26/5/2001 22:14:00;CIDADAO COMUM;N;;CEU AZUL;BH;604476.31;807597.49;5226
+5228;2001285233;B03000;AMEACA;AV AMAZONAS;8524;3140;26/5/2001 22:29:00;CIDADAO COMUM;S;;JARDINOPOLIS;BH;604277.23;794566.59;5227
+5229;2001285235;B06000;LESAO CORPORAL;RUA PADRE FRANCI;412;51341;26/5/2001 22:30:00;CIDADAO COMUM;N;0;VILA PARIS;BH;609790.49;793465.90;5228
+5230;2001285319;B06000;LESAO CORPORAL;RUA CONDE DE LIN;994;16657;26/5/2001 23:11:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;609936.78;794362.75;5229
+5231;2001285332;B06000;LESAO CORPORAL;AV AMAZONAS;1040;3140;26/5/2001 23:17:00;INICIATIVA;S;0;CENTRO (BH);BH;610552.12;796862.46;5230
+5232;2001285381;B03000;AMEACA;RUA JARAGUA;70;23851;26/5/2001 23:41:00;CIDADAO COMUM;S;;TAQUARIL;BH;617279.96;796983.51;5231
+5233;2001285406;B06000;LESAO CORPORAL;RUA SERRA AZUL;62;65100;26/5/2001 23:53:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616095.92;797406.02;5232
+5234;2001285415;B06000;LESAO CORPORAL;RUA MARCO AURELI;127;61821;27/5/2001 00:02:00;CIDADAO COMUM;S;LJA;NAZARE;BH;615586.92;804707.76;5233
+5235;2001285464;B04002;HOMICIDIO CONSUM;RUA DOS GUARANIS;597;32181;27/5/2001 00:38:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610645.29;797060.64;5234
+5236;2001285473;B04001;HOMICIDIO TENTAD;RUA PINTARROXO;150;95954;27/5/2001 00:39:00;CIDADAO COMUM;S;0;GOIANIA;BH;615369.55;802331.82;5235
+5237;2001285512;B06000;LESAO CORPORAL;RUA JOSE FELIX M;852;7416;27/5/2001 01:01:00;INICIATIVA;S;0;MANTIQUEIRA;BH;606455.66;810642.94;5236
+5238;2001285583;B04001;HOMICIDIO TENTAD;RUA SERGIO MIRAN;260;80644;27/5/2001 01:45:00;CIDADAO COMUM;N;0;OURO PRETO;BH;606220.07;801489.47;5237
+5239;2001285600;B06000;LESAO CORPORAL;AV JEQUITINHONHA;867;37305;27/5/2001 01:52:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615872.02;797817.83;5238
+5240;2001285643;B04002;HOMICIDIO CONSUM;RUA VOLTS;40;73626;27/5/2001 02:24:00;CIDADAO COMUM;N;0;PRIMEIRO DE MAIO;BH;612172.58;803421.57;5239
+5241;2001285647;B06000;LESAO CORPORAL;RUA LUIS RODRIGU;144;85749;27/5/2001 02:25:00;CIDADAO COMUM;S;;CEU AZUL;BH;604852.37;807579.06;5240
+5242;2001285656;B08000;VIOLACAO DE DOMI;ALAMEDA INDAIA;125;34363;27/5/2001 02:28:00;CIDADAO COMUM;N;;DOM CABRAL;BH;604902.65;796728.21;5241
+5243;2001285687;B06000;LESAO CORPORAL;AV BRASIL;342;10420;27/5/2001 02:48:00;CIDADAO COMUM;S;PX342;SAO LUCAS;BH;612723.24;796515.30;5242
+5244;2001285700;B04001;HOMICIDIO TENTAD;RUA OLNEY BARREI;159;48973;27/5/2001 02:58:00;CIDADAO COMUM;S;0;DOM JOAQUIM;BH;613552.48;801797.81;5243
+5245;2001285715;B04001;HOMICIDIO TENTAD;RUA FLOR DE PITA;114;42949;27/5/2001 03:08:00;CIDADAO COMUM;N;0;INDEPENDENCIA;BH;601585.95;786070.71;5244
+5246;2001285841;B06000;LESAO CORPORAL;RUA MONLEVADE;110;46183;27/5/2001 04:41:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610853.97;800937.94;5245
+5247;2001285872;B02000;RIXA;RUA JANUARIA;65;36936;27/5/2001 05:06:00;CIDADAO COMUM;S;0;FLORESTA;BH;611563.51;797768.28;5246
+5248;2001285881;B04001;HOMICIDIO TENTAD;RUA DIAMANTINA;70;21175;27/5/2001 05:17:00;CIDADAO COMUM;S;;CABANA;BH;604767.01;794055.25;5247
+5249;2001285924;B03000;AMEACA;AV COLETORA;127;78241;27/5/2001 06:11:00;CIDADAO COMUM;S;;VILA PINHO;BH;601784.22;788552.93;5248
+5250;2001285948;B03000;AMEACA;RUA DESENGANO;5;19860;27/5/2001 06:45:00;CIDADAO COMUM;N;;MANGABEIRAS;BH;612147.19;792537.48;5249
+5251;2001286123;B03000;AMEACA;RUA JOAQUIM RAMO;394;38175;27/5/2001 10:06:00;CIDADAO COMUM;S;FU;PARAISO;BH;614835.48;796823.96;5250
+5252;2001286145;B06000;LESAO CORPORAL;PRACA MARABU;112;43333;27/5/2001 10:24:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;604605.44;788619.51;5251
+5253;2001286178;B03000;AMEACA;RUA JULIO DE CAS;1227;39470;27/5/2001 10:51:00;INICIATIVA;N;0;CINQUENTENARIO;BH;606610.98;792052.30;5252
+5254;2001286277;B06000;LESAO CORPORAL;RUA RADIALISTA J;70;109367;27/5/2001 12:01:00;CIDADAO COMUM;N;;CEU AZUL;BH;605246.76;808308.68;5253
+5255;2001286322;B06000;LESAO CORPORAL;RUA SAO ROQUE;620;63600;27/5/2001 12:34:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612678.13;799449.80;5254
+5256;2001286387;B06000;LESAO CORPORAL;RUA DOM HENRIQUE;145;102531;27/5/2001 13:24:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616541.52;797463.00;5255
+5257;2001286408;B06000;LESAO CORPORAL;AV DOM JOAO VI;169;22294;27/5/2001 13:40:00;CIDADAO COMUM;N;;CINQUENTENARIO;BH;606195.21;792895.55;5256
+5258;2001286469;B06000;LESAO CORPORAL;RUA NELSON JOSE ;250;98877;27/5/2001 14:23:00;CIDADAO COMUM;S;;DA LAGOA;BH;604911.80;809367.50;5257
+5259;2001286481;B06000;LESAO CORPORAL;PRACA TEJO;12;67235;27/5/2001 14:33:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605960.64;797956.52;5258
+5260;2001286489;B06000;LESAO CORPORAL;RUA DR BROCHADO;888;23215;27/5/2001 14:37:00;INICIATIVA;S;0;VERA CRUZ;BH;615934.25;797872.40;5259
+5261;2001286498;B06000;LESAO CORPORAL;RUA JAIR LOPES C;192;89359;27/5/2001 14:42:00;CIDADAO COMUM;S;0;JARDIM ESTRELA;BH;607211.19;810184.65;5260
+5262;2001286502;B06000;LESAO CORPORAL;RUA SAO MIGUEL;1296;63410;27/5/2001 14:43:00;CIDADAO COMUM;S;BLE     CA48;ITAPOA;BH;609541.66;805574.12;5261
+5263;2001286521;B04001;HOMICIDIO TENTAD;BECO ARANA;118;79780;27/5/2001 15:03:00;CIDADAO COMUM;N;;SAO PAULO;BH;612523.47;803161.32;5262
+5264;2001286536;B06000;LESAO CORPORAL;RUA FLOR DE PEQU;35;94810;27/5/2001 15:12:00;CIDADAO COMUM;S;0;JARDIM ALVORADA;BH;606186.87;800088.39;5263
+5265;2001286545;B06000;LESAO CORPORAL;RUA JOAQUIM TEIX;140;128845;27/5/2001 15:18:00;CIDADAO COMUM;S;0;CASTANHEIRAS (TA;BH;617405.88;796871.94;5264
+5266;2001286551;B03000;AMEACA;RUA SAO LUIZ;10;26112;27/5/2001 15:19:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617354.11;797763.63;5265
+5267;2001286558;B04001;HOMICIDIO TENTAD;ALAMEDA DAS PRIN;763;55342;27/5/2001 15:31:00;INICIATIVA;N;0;SAO JOSE;BH;608047.19;803545.43;5266
+5268;2001286573;B03000;AMEACA;RUA DOZE DE DEZE;90;24060;27/5/2001 15:40:00;CIDADAO COMUM;N;0;BELMONT;BH;615655.26;804957.06;5267
+5269;2001286583;B03000;AMEACA;RUA MARTINS SOAR;570;45049;27/5/2001 15:48:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;605080.53;792957.62;5268
+5270;2001286597;B03000;AMEACA;RUA CARACA;948;12990;27/5/2001 15:59:00;CIDADAO COMUM;S;;SERRA;BH;613753.87;794503.33;5269
+5271;2001286684;B03000;AMEACA;RUA G;90;78282;27/5/2001 17:04:00;CIDADAO COMUM;N;0;VILA PINHO;BH;601884.79;788409.89;5270
+5272;2001286726;B06000;LESAO CORPORAL;AV TERESA CRISTI;7836;67512;27/5/2001 17:32:00;CIDADAO COMUM;S;0;BETANIA;BH;604911.31;792765.55;5271
+5273;2001286830;B06000;LESAO CORPORAL;RUA BARAO DE COR;290;7910;27/5/2001 18:40:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609705.85;805280.22;5272
+5274;2001286831;B04002;HOMICIDIO CONSUM;AV OLINTO MEIREL;2480;49847;27/5/2001 18:39:00;CIDADAO COMUM;N;0;FLAVIO MARQUES D;BH;603783.40;789476.90;5273
+5275;2001286870;B03000;AMEACA;AV SETE DE ABRIL;711;65560;27/5/2001 19:00:00;CIDADAO COMUM;S;AP402;ESPLANADA;BH;614701.23;798401.70;5274
+5276;2001286920;B06000;LESAO CORPORAL;ALAMEDA DIOGO GU;405;21336;27/5/2001 19:22:00;CIDADAO COMUM;N;;VILA CASTANHEIRA;BH;601539.04;788530.12;5275
+5277;2001286933;B06000;LESAO CORPORAL;AV DEPUTADO ULTI;890;82549;27/5/2001 19:26:00;CIDADAO COMUM;N;;PLANALTO;BH;610672.89;806325.59;5276
+5278;2001287054;B06000;LESAO CORPORAL;RUA DOS BANDOLIN;489;106980;27/5/2001 20:41:00;CIDADAO COMUM;N;;CH CALIFORNIA;BH;603972.58;797126.87;5277
+5279;2001287058;B03000;AMEACA;RUA OZANAM;716;50796;27/5/2001 20:43:00;CIDADAO COMUM;N;0;IPIRANGA;BH;612055.67;800906.36;5278
+5280;2001287142;B03000;AMEACA;RUA CAMBE;557;40250;27/5/2001 21:21:00;CIDADAO COMUM;N;CAAN;COQUEIROS;BH;602564.33;798526.49;5279
+5281;2001287186;B03000;AMEACA;RUA MARIO SOARES;446;44641;27/5/2001 21:50:00;CIDADAO COMUM;S;AP201;DOM BOSCO;BH;604166.48;797249.18;5280
+5282;2001287210;B03000;AMEACA;RUA FREI ALBINO ;10;93048;27/5/2001 22:00:00;CIDADAO COMUM;S;0;INDEPENDENCIA;BH;601296.99;786093.21;5281
+5283;2001287232;B03000;AMEACA;RUA DES BRAULIO;2157;19917;27/5/2001 22:12:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616414.12;797300.11;5282
+5284;2001287243;B06000;LESAO CORPORAL;AV WASHINGTON LU;913;73701;27/5/2001 22:17:00;CIDADAO COMUM;N;0;SAO BERNARDO;BH;610643.18;804939.91;5283
+5285;2001287256;B03000;AMEACA;RUA ARLEI QUEIRO;184;106356;27/5/2001 22:24:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607916.37;811372.01;5284
+5286;2001287283;B06000;LESAO CORPORAL;RUA EXPEDICIONAR;327;86666;27/5/2001 22:40:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;611848.25;807663.34;5285
+5287;2001287289;B03000;AMEACA;RUA CONSELHEIRO ;30;15869;27/5/2001 22:43:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606636.12;794589.81;5286
+5288;2001287293;B03000;AMEACA;RUA MANOEL NUNES;269;43157;27/5/2001 22:44:00;CIDADAO COMUM;S;0;TUPI;BH;613856.56;806029.52;5287
+5289;2001287387;B06000;LESAO CORPORAL;RUA MADUREIRA;326;42416;27/5/2001 23:44:00;CIDADAO COMUM;N;0;PARQUE RIACHUELO;BH;609675.92;800149.35;5288
+5290;2001287407;B03000;AMEACA;RUA FLOR D'AGUA;295;28565;28/5/2001 00:02:00;CIDADAO COMUM;S;CAFR;JARDIM MONTANHES;BH;605689.51;799604.37;5289
+5291;2001287431;B06000;LESAO CORPORAL;RUA DIVISA NOVA;209;21440;28/5/2001 00:25:00;CIDADAO COMUM;N;0;SALGADO FILHO;BH;606192.97;794563.10;5290
+5292;2001287447;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;580;18652;28/5/2001 00:39:00;INICIATIVA;S;0;CIDADE NOVA;BH;612034.84;801109.08;5291
+5293;2001287514;B03000;AMEACA;RUA JEQUIRICA;157;37258;28/5/2001 01:54:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611254.76;799443.34;5292
+5294;2001287586;B03000;AMEACA;RUA GOUVEIA;1096;31630;28/5/2001 03:53:00;CIDADAO COMUM;S;0;BOA VISTA;BH;615182.93;800074.33;5293
+5295;2001287718;B03000;AMEACA;RUA DES SARAIVA;157;66535;28/5/2001 08:03:00;CIDADAO COMUM;N;0;VERA CRUZ;BH;615887.76;798678.76;5294
+5296;2001287725;B03000;AMEACA;RUA CAPA PRETA;111;14232;28/5/2001 08:08:00;CIDADAO COMUM;N;0;JOAO PINHEIRO;BH;605084.93;796075.85;5295
+5297;2001287841;B03000;AMEACA;RUA SEBASTIAO NE;57;15478;28/5/2001 09:17:00;CIDADAO COMUM;S;;ITAPOA;BH;609616.49;805847.33;5296
+5298;2001288081;B03000;AMEACA;AV BELEM;1093;8913;28/5/2001 12:04:00;CIDADAO COMUM;S;0;POMPEIA;BH;615054.50;797767.32;5297
+5299;2001288153;B06000;LESAO CORPORAL;RUA CORONEL JOSE;39;17892;28/5/2001 13:04:00;CIDADAO COMUM;N;;SANTA CRUZ;BH;610739.96;802185.68;5298
+5300;2001288185;B06000;LESAO CORPORAL;RUA CAPA PRETA;111;14232;28/5/2001 13:30:00;CIDADAO COMUM;N;0;JOAO PINHEIRO;BH;605084.93;796075.85;5299
+5301;2001288222;B03000;AMEACA;RUA DEZENOVE;41;130191;28/5/2001 13:59:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604918.87;791473.08;5300
+5302;2001288305;B06000;LESAO CORPORAL;RUA NEFELINA;99;81228;28/5/2001 15:00:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;612838.15;797304.69;5301
+5303;2001288312;B03000;AMEACA;RUA BARAO DE MAC;449;7980;28/5/2001 15:05:00;CIDADAO COMUM;S;;SANTO ANTONIO;BH;610174.15;794888.88;5302
+5304;2001288352;B03000;AMEACA;RUA SAO FELIPE;282;62386;28/5/2001 15:32:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;613372.54;798722.04;5303
+5305;2001288453;B06000;LESAO CORPORAL;RUA DOS CARIJOS;504;81243;28/5/2001 16:24:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610976.67;797223.89;5304
+5306;2001288483;B03000;AMEACA;RUA REGENCIA;195;301448;28/5/2001 16:39:00;CIDADAO COMUM;S;PX271;VILA CAFEZAL;BH;614107.56;795461.45;5305
+5307;2001288582;B03000;AMEACA;RUA DAVID RABELO;1023;19702;28/5/2001 17:28:00;CIDADAO COMUM;S;;INCONFIDENCIA;BH;604852.48;799008.93;5306
+5308;2001288590;B06000;LESAO CORPORAL;AV SOUZA AGUIAR;2184;84402;28/5/2001 17:36:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;616305.52;798833.55;5307
+5309;2001288599;B06000;LESAO CORPORAL;RUA PAULO KRUGER;175;55910;28/5/2001 17:41:00;CIDADAO COMUM;S;;FLORAMAR;BH;611687.19;806856.30;5308
+5310;2001288601;B03000;AMEACA;AV OLEGARIO MACI;735;49699;28/5/2001 17:41:00;POLICIAL MILITAR;S;0;CENTRO (BH);BH;610517.79;796937.79;5309
+5311;2001288682;B06000;LESAO CORPORAL;RUA DAS VERBENAS;81;71545;28/5/2001 18:22:00;CIDADAO COMUM;S;;LINDEIA;BH;598801.30;790941.81;5310
+5312;2001288690;B06000;LESAO CORPORAL;AV FRANCISCO SA;1373;29656;28/5/2001 18:25:00;CIDADAO COMUM;S;AP2;GUTIERREZ;BH;608976.96;795456.85;5311
+5313;2001288701;B06000;LESAO CORPORAL;RUA LUCIA;20;41527;28/5/2001 18:33:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614026.99;803819.45;5312
+5314;2001288770;B06000;LESAO CORPORAL;AV PROFESSOR ALF;400;2264;28/5/2001 19:07:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;611944.42;796416.90;5313
+5315;2001288976;B06000;LESAO CORPORAL;RUA TOBIAS MOSCO;55;97947;28/5/2001 20:48:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612286.60;803830.35;5314
+5316;2001289022;B03000;AMEACA;AV AGENOR DE PAU;482;86250;28/5/2001 21:20:00;CIDADAO COMUM;S;;JAQUELINE;BH;611517.37;810264.32;5315
+5317;2001289080;B06000;LESAO CORPORAL;RUA GERALDO CAST;112;107812;28/5/2001 21:48:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606674.34;811207.21;5316
+5318;2001289160;B03000;AMEACA;RUA DOS TIMBIRAS;2469;67682;28/5/2001 22:40:00;CIDADAO COMUM;N;0;SANTO AGOSTINHO;BH;610326.19;796489.72;5317
+5319;2001289187;B03000;AMEACA;RUA INDIANOPOLIS;907;34423;28/5/2001 22:57:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;610919.83;800890.40;5318
+5320;2001289223;B06000;LESAO CORPORAL;RUA PLATINA;1281;54453;28/5/2001 23:17:00;CIDADAO COMUM;S;;CALAFATE;BH;607934.16;796732.35;5319
+5321;2001289256;B06000;LESAO CORPORAL;RUA JURITI;33;171450;28/5/2001 23:37:00;CIDADAO COMUM;S;;VILA CEMIG;BH;605430.16;788887.55;5320
+5322;2001289298;B03000;AMEACA;RUA HERCULANO PE;483;33143;29/5/2001 00:21:00;CIDADAO COMUM;S;NUMERO E O 483;SALGADO FILHO;BH;606642.48;795383.85;5321
+5323;2001289340;B03000;AMEACA;RUA ITAPETINGA;1341;35804;29/5/2001 01:05:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;609965.84;800605.10;5322
+5324;2001289349;B06000;LESAO CORPORAL;RUA JACAREI;1123;13154;29/5/2001 01:12:00;CIDADAO COMUM;S;;PINDORAMA;BH;602398.69;797917.94;5323
+5325;2001289434;B06000;LESAO CORPORAL;RUA POUSO ALEGRE;219;54932;29/5/2001 03:15:00;CIDADAO COMUM;S;BLB     AP108;FLORESTA;BH;611250.38;798020.65;5324
+5326;2001289609;B06000;LESAO CORPORAL;RUA NACIP RAYDAN;33;47132;29/5/2001 08:01:00;CIDADAO COMUM;S;INICIATIVA HT 14;RIO BRANCO;BH;606908.68;808543.95;5325
+5327;2001289648;B06000;LESAO CORPORAL;RUA RECIFE;726;58149;29/5/2001 08:29:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;608741.90;799254.55;5326
+5328;2001289666;B03000;AMEACA;AV OLEGARIO MACI;572;49699;29/5/2001 08:38:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610516.97;797139.20;5327
+5329;2001289698;B03000;AMEACA;RUA CESARIO ALVI;688;15018;29/5/2001 08:59:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;607391.04;797458.15;5328
+5330;2001289700;B06000;LESAO CORPORAL;AV SEN LEVINDO C;958;14866;29/5/2001 08:59:00;CIDADAO COMUM;N;;MANGUEIRAS;BH;601356.47;786363.54;5329
+5331;2001289708;B03000;AMEACA;RUA DOUTOR ALIPI;25;2365;29/5/2001 09:10:00;CIDADAO COMUM;S;;SERRA;BH;613823.09;794921.03;5330
+5332;2001289733;B03000;AMEACA;RUA JUNIA CRISTI;110;96377;29/5/2001 09:27:00;CIDADAO COMUM;S;;VISTA DO SOL;BH;616293.01;804590.04;5331
+5333;2001289778;B06000;LESAO CORPORAL;RUA AVE DO PARAI;237;6959;29/5/2001 09:52:00;CIDADAO COMUM;S;;FLAVIO MARQUES D;BH;604667.15;788706.56;5332
+5334;2001289920;B06000;LESAO CORPORAL;RUA JORDELINA MA;531;84948;29/5/2001 11:33:00;CIDADAO COMUM;N;CAFR;MANTIQUEIRA;BH;606139.38;810993.07;5333
+5335;2001289960;B03000;AMEACA;BECO SAO JOAQUIM;39;301212;29/5/2001 12:18:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610959.40;793684.37;5334
+5336;2001289999;B03000;AMEACA;ESTRADA DO CERCA;2251;26428;29/5/2001 12:49:00;INICIATIVA;S;0;SAO DOMINGOS;BH;607619.37;793428.63;5335
+5337;2001290169;B03000;AMEACA;RUA JOSE FERNAND;34;119948;29/5/2001 15:00:00;CIDADAO COMUM;N;0;SAO GERALDO;BH;615957.39;799439.10;5336
+5338;2001290263;B03000;AMEACA;RUA MORRO DA GRA;303;46823;29/5/2001 15:56:00;CIDADAO COMUM;S;CAA;JARDIM MONTANHES;BH;606309.98;798371.21;5337
+5339;2001290265;B03000;AMEACA;RUA MARIO SOARES;298;44641;29/5/2001 15:58:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604166.68;797141.11;5338
+5340;2001290302;B03000;AMEACA;RUA JOSE ANTENOR;130;16049;29/5/2001 16:21:00;CIDADAO COMUM;N;CSA;PRIMEIRO DE MAIO;BH;612312.80;803782.08;5339
+5341;2001290342;B06000;LESAO CORPORAL;PRACA GREVILEA;30;1334;29/5/2001 16:39:00;CIDADAO COMUM;N;;PATROCINIO;BH;605248.49;794497.92;5340
+5342;2001290360;B04001;HOMICIDIO TENTAD;RUA BANDONION;122;170139;29/5/2001 16:48:00;INICIATIVA;S;0;VILA CAFEZAL;BH;613977.41;795089.89;5341
+5343;2001290368;B03000;AMEACA;RUA FERNAO DIAS;1210;28133;29/5/2001 16:53:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616131.10;797898.69;5342
+5344;2001290372;B03000;AMEACA;RUA FERNAO DIAS;428;28133;29/5/2001 16:57:00;CIDADAO COMUM;S;;CASA BRANCA;BH;616090.44;799485.48;5343
+5345;2001290400;B03000;AMEACA;RUA ANTARES;170;4244;29/5/2001 17:12:00;CIDADAO COMUM;S;0;SANTA LUCIA;BH;610301.90;793066.15;5344
+5346;2001290423;B06000;LESAO CORPORAL;RUA DO FLAMENGO;84;28410;29/5/2001 17:24:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610992.47;804908.91;5345
+5347;2001290448;B06000;LESAO CORPORAL;AV JOSE BONIFACI;189;38579;29/5/2001 17:38:00;CIDADAO COMUM;S;0;PRADO LOPES;BH;610210.56;798939.37;5346
+5348;2001290479;B06000;LESAO CORPORAL;AV MEM DE SA;600;45395;29/5/2001 17:48:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613969.89;796740.47;5347
+5349;2001290557;B06000;LESAO CORPORAL;RUA CINQUENTA E ;317;74137;29/5/2001 18:18:00;CIDADAO COMUM;S;;NOVA YORK;BH;608575.18;810924.30;5348
+5350;2001290570;B06000;LESAO CORPORAL;RUA ARTUR DE SA;1096;6211;29/5/2001 18:27:00;CIDADAO COMUM;S;;UNIAO;BH;613434.92;801356.54;5349
+5351;2001290619;B06000;LESAO CORPORAL;RUA CONCEICAO DO;536;81978;29/5/2001 18:51:00;CIDADAO COMUM;N;LJA;SAO GABRIEL;BH;614391.87;804594.70;5350
+5352;2001290787;B03000;AMEACA;RUA QUARENTA E U;83;302837;29/5/2001 20:19:00;CIDADAO COMUM;N;0;NOVO AARAO REIS;BH;614183.34;805806.43;5351
+5353;2001290830;B03000;AMEACA;RUA OZENIL JOSE ;112;86058;29/5/2001 20:44:00;CIDADAO COMUM;S;;VILA FREI LEOPOL;BH;611716.17;809676.58;5352
+5354;2001290846;B03000;AMEACA;ESTRADA DOS BORG;5;85893;29/5/2001 20:57:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616433.49;804527.60;5353
+5355;2001290853;B06000;LESAO CORPORAL;RUA XAVIER DA VE;152;73843;29/5/2001 21:00:00;CIDADAO COMUM;S;;MINAS BRASIL;BH;605794.49;797401.06;5354
+5356;2001290906;B04001;HOMICIDIO TENTAD;AV ALVARES CABRA;1030;2730;29/5/2001 21:34:00;INICIATIVA;N;0;LOURDES;BH;610560.65;796057.42;5355
+5357;2001290914;B04002;HOMICIDIO CONSUM;AV RAJA GABAGLIA;1961;57830;29/5/2001 21:38:00;INICIATIVA;N;0;LEONINA;BH;608875.32;793451.62;5356
+5358;2001290924;B06000;LESAO CORPORAL;RUA FLOR DA IMPE;448;28600;29/5/2001 21:46:00;CIDADAO COMUM;S;0;JARDIM MONTANHES;BH;605810.72;799740.52;5357
+5359;2001290979;B03000;AMEACA;RUA CORONEL ANTO;172;17590;29/5/2001 22:23:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;606140.28;807563.65;5358
+5360;2001291055;B03000;AMEACA;RUA MAURICIO PER;61;40666;29/5/2001 23:28:00;CIDADAO COMUM;S;0;JAQUELINE;BH;610598.71;810084.72;5359
+5361;2001291060;B03000;AMEACA;RUA ANTARES;170;4244;29/5/2001 23:31:00;CIDADAO COMUM;S;0;SANTA LUCIA;BH;610301.90;793066.15;5360
+5362;2001291099;B06000;LESAO CORPORAL;RUA ITANHOMI;85;35669;29/5/2001 23:56:00;CIDADAO COMUM;N;0;CARLOS PRATES;BH;608749.52;798284.45;5361
+5363;2001291719;B03000;AMEACA;RUA COROCOCO;33;76700;30/5/2001 11:10:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;614301.94;806027.12;5362
+5364;2001291737;B06000;LESAO CORPORAL;RUA DINIS DIAS;145;119673;30/5/2001 11:21:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616573.20;797526.82;5363
+5365;2001291778;B04001;HOMICIDIO TENTAD;RUA PENALVA;71;96276;30/5/2001 11:54:00;INICIATIVA;N;0;DOM SILVERIO;BH;614598.66;804371.67;5364
+5366;2001291817;B03000;AMEACA;RUA TOBIAS MOSCO;55;97947;30/5/2001 12:26:00;POLICIAL MILITAR;N;0;PROVIDENCIA;BH;612286.60;803830.35;5365
+5367;2001291892;B03000;AMEACA;RUA JULITA NOGUE;700;39597;30/5/2001 13:22:00;CIDADAO COMUM;N;;SANTA TEREZINHA;BH;604160.72;802710.37;5366
+5368;2001291966;B03000;AMEACA;RUA SANTO ANTONI;101;29832;30/5/2001 14:28:00;CIDADAO COMUM;S;CASA A;SALGADO FILHO;BH;606572.22;793836.55;5367
+5369;2001292012;B03000;AMEACA;RUA CURI;773;19047;30/5/2001 15:04:00;CIDADAO COMUM;N;BLB     AP302;SAO GERALDO;BH;615774.12;799043.09;5368
+5370;2001292059;B06000;LESAO CORPORAL;RUA JULITA NUNES;210;130047;30/5/2001 15:30:00;CIDADAO COMUM;S;0;MINASCAIXA;BH;609164.95;809748.79;5369
+5371;2001292063;B03000;AMEACA;AV CATULO DA PAI;526;59081;30/5/2001 15:32:00;CIDADAO COMUM;S;PRACA DOS INDUST;DAS INDUSTRIAS;BH;604336.90;792747.38;5370
+5372;2001292069;B04001;HOMICIDIO TENTAD;RUA CARLOS QUADR;96;13431;30/5/2001 15:38:00;CIDADAO COMUM;N;;SALGADO FILHO;BH;606077.39;794694.97;5371
+5373;2001292289;B03000;AMEACA;RUA GIRASSOL;35;170242;30/5/2001 17:44:00;CIDADAO COMUM;S;;CABANA;BH;604914.68;794410.67;5372
+5374;2001292318;B03000;AMEACA;RUA FRANCISCO LE;165;29495;30/5/2001 17:59:00;CIDADAO COMUM;S;0;SAO MARCOS;BH;614281.87;802378.50;5373
+5375;2001292324;B06000;LESAO CORPORAL;RUA BARAO DE MAC;449;7980;30/5/2001 18:03:00;CIDADAO COMUM;S;;SANTO ANTONIO;BH;610174.15;794888.88;5374
+5376;2001292371;B06000;LESAO CORPORAL;RUA FORMIGA;544;29136;30/5/2001 18:27:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610753.25;798994.38;5375
+5377;2001292381;B03000;AMEACA;RUA CURI;773;19047;30/5/2001 18:33:00;CIDADAO COMUM;S;CA01;SAO GERALDO;BH;615774.12;799043.09;5376
+5378;2001292397;B06000;LESAO CORPORAL;RUA CARANGOLA;288;13094;30/5/2001 18:42:00;CIDADAO COMUM;S;0;SANTO ANTONIO;BH;610731.49;794680.82;5377
+5379;2001292477;B05000;SEQUESTRO E CARC;RUA ROGERIO FAJA;160;59167;30/5/2001 19:15:00;INICIATIVA;S;0;ANCHIETA;BH;612526.71;793523.78;5378
+5380;2001292523;B03000;AMEACA;RUA SEBASTIAO NE;57;15478;30/5/2001 19:35:00;CIDADAO COMUM;S;0;ITAPOA;BH;609616.49;805847.33;5379
+5381;2001292525;B06000;LESAO CORPORAL;RUA CINQUENTA E ;400;74137;30/5/2001 19:37:00;CIDADAO COMUM;S;CS;NOVA YORK;BH;608560.84;810967.05;5380
+5382;2001292547;B03000;AMEACA;RUA PEDRA DE ANI;265;24016;30/5/2001 19:47:00;CIDADAO COMUM;S;;PIRATININGA;BH;606397.61;809067.54;5381
+5383;2001292561;B03000;AMEACA;RUA DOUTOR JOSE ;80;72488;30/5/2001 19:55:00;CIDADAO COMUM;S;;PLANALTO;BH;610724.20;806179.76;5382
+5384;2001292584;B06000;LESAO CORPORAL;RUA GLEUCY JOSE ;5;128860;30/5/2001 20:05:00;INICIATIVA;S;0;CASTANHEIRAS (TA;BH;617303.66;796895.30;5383
+5385;2001292611;B04002;HOMICIDIO CONSUM;AV SIDERAL;635;65721;30/5/2001 20:22:00;CIDADAO COMUM;N;;VISTA ALEGRE;BH;604330.64;793630.31;5384
+5386;2001292640;B03000;AMEACA;RUA PITANGUI;530;54365;30/5/2001 20:40:00;CIDADAO COMUM;S;;CONCORDIA;BH;610812.36;798951.44;5385
+5387;2001292680;B03000;AMEACA;RUA CADIZ;200;21090;30/5/2001 21:06:00;INICIATIVA;S;0;JARDIM EUROPA;BH;608241.44;809904.76;5386
+5388;2001292712;B03000;AMEACA;RUA E;155;78254;30/5/2001 21:22:00;CIDADAO COMUM;S;;VILA PINHO;BH;601857.50;788531.20;5387
+5389;2001292750;B06000;LESAO CORPORAL;RUA SAO CRISTOVA;460;62260;30/5/2001 21:44:00;CIDADAO COMUM;S;;LEBLON;BH;605482.14;809635.82;5388
+5390;2001292773;B03000;AMEACA;RUA PINHAL;43;12108;30/5/2001 21:57:00;CIDADAO COMUM;N;0;PIRATININGA;BH;606115.25;809906.56;5389
+5391;2001292781;B04001;HOMICIDIO TENTAD;RUA SAO COSME;60;62216;30/5/2001 22:02:00;CIDADAO COMUM;S;0;GLORIA;BH;603350.23;798467.27;5390
+5392;2001292791;B04001;HOMICIDIO TENTAD;RUA CINQUENTA;203;302845;30/5/2001 22:11:00;CIDADAO COMUM;S;;TUPI;BH;614197.66;805513.25;5391
+5393;2001292812;B06000;LESAO CORPORAL;RODOVIA BR 356;5000;10317;30/5/2001 22:23:00;INICIATIVA;S;0;BELVEDERE;BH;610345.89;791069.48;5392
+5394;2001292839;B04001;HOMICIDIO TENTAD;AV NELIO CERQUEI;15;72359;30/5/2001 22:41:00;CIDADAO COMUM;S;0;TIROL;BH;600947.66;789885.51;5393
+5395;2001292849;B03000;AMEACA;RUA PEDRO NAVA;28;109631;30/5/2001 22:48:00;CIDADAO COMUM;S;0;TUPI;BH;613021.05;806403.70;5394
+5396;2001292864;B04001;HOMICIDIO TENTAD;AV PRESIDENTE AN;7440;4461;30/5/2001 22:52:00;CIDADAO COMUM;N;;LIBERDADE;BH;608848.82;804317.22;5395
+5397;2001292909;B02000;RIXA;RUA MANOEL PAULI;122;43185;30/5/2001 23:20:00;CIDADAO COMUM;S;;DURVAL DE BARROS;IB;598281.11;791094.85;5396
+5398;2001293035;B06000;LESAO CORPORAL;AV DOM PEDRO II;3573;53145;31/5/2001 00:47:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;607359.84;797881.47;5397
+5399;2001293069;B06000;LESAO CORPORAL;AV DAS PALMEIRAS;847;51921;31/5/2001 01:11:00;INICIATIVA;N;0;SAO JOSE;BH;607761.79;803424.91;5398
+5400;2001293093;B02000;RIXA;RUA STO ANTONIO ;525;61806;31/5/2001 01:27:00;CIDADAO COMUM;S;AP601;SANTO ANTONIO;BH;610914.49;794114.23;5399
+5401;2001293159;B06000;LESAO CORPORAL;AV PRESIDENTE AN;1694;4461;31/5/2001 02:26:00;CIDADAO COMUM;S;0;SAO CRISTOVAO;BH;610133.22;799644.13;5400
+5402;2001293171;B06000;LESAO CORPORAL;RUA NANA;171;47186;31/5/2001 02:38:00;INICIATIVA;N;0;MILIONARIOS;BH;603968.42;790001.17;5401
+5403;2001293192;B04001;HOMICIDIO TENTAD;AV PRUDENTE DE M;914;55774;31/5/2001 03:15:00;CIDADAO COMUM;S;0;CORACAO DE JESUS;BH;610064.80;794421.13;5402
+5404;2001293300;B03000;AMEACA;RUA IZABEL;17;170734;31/5/2001 06:42:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608601.43;794604.87;5403
+5405;2001293593;B03000;AMEACA;RUA SABINO JOSE ;50;118210;31/5/2001 10:22:00;INICIATIVA;S;0;TIROL;BH;599830.93;789972.56;5404
+5406;2001293618;B03000;AMEACA;AV AUGUSTO DE LI;1142;6731;31/5/2001 10:36:00;CIDADAO COMUM;0;AP 1404;BARRO PRETO;BH;610231.87;796856.58;5405
+5407;2001293677;B03000;AMEACA;RUA HENRIQUE DIA;81;33042;31/5/2001 11:18:00;CIDADAO COMUM;S;CA3;APARECIDA;BH;609285.64;800049.41;5406
+5408;2001293750;B03000;AMEACA;RUA GUIMARAES;900;62953;31/5/2001 12:07:00;INICIATIVA;S;0;SAO FRANCISCO;BH;608835.37;801449.62;5407
+5409;2001293894;B03000;AMEACA;PRACA AFONSO ARI;60;1205;31/5/2001 14:00:00;INICIATIVA;S;HOTEL DEL REY;CENTRO (BH);BH;611340.42;796563.87;5408
+5410;2001293957;B06000;LESAO CORPORAL;RUA PONTA PORA;200;54601;31/5/2001 14:35:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613187.23;796919.20;5409
+5411;2001294028;B03000;AMEACA;AV TERESA CRISTI;625;67512;31/5/2001 15:26:00;CIDADAO COMUM;N;0;CARLOS PRATES;BH;603730.45;793544.44;5410
+5412;2001294064;B06000;LESAO CORPORAL;RUA CLORITA;100;16051;31/5/2001 15:47:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612847.22;797209.80;5411
+5413;2001294080;B03000;AMEACA;RUA PIRAPETINGA;436;54148;31/5/2001 15:55:00;INICIATIVA;S;0;SERRA;BH;612727.63;794527.29;5412
+5414;2001294088;B03000;AMEACA;RUA EMILIO RICAL;141;102806;31/5/2001 15:54:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;605108.25;795890.74;5413
+5415;2001294138;B06000;LESAO CORPORAL;RUA ANTONIO FAUS;76;97528;31/5/2001 16:20:00;CIDADAO COMUM;N;FU;DOM SILVERIO;BH;614828.18;804494.38;5414
+5416;2001294183;B06000;LESAO CORPORAL;RUA JOSE CUSTODI;131;84733;31/5/2001 16:47:00;CIDADAO COMUM;S;0;DA LAGOA;BH;604676.60;809611.69;5415
+5417;2001294228;B06000;LESAO CORPORAL;RUA MANOEL PAULI;214;43185;31/5/2001 17:23:00;CIDADAO COMUM;S;CAA;DURVAL DE BARROS;IB;598180.67;791056.45;5416
+5418;2001294299;B06000;LESAO CORPORAL;RUA SAPUCAI;499;63943;31/5/2001 17:54:00;INICIATIVA;N;0;FLORESTA;BH;611751.63;797265.20;5417
+5419;2001294323;B06000;LESAO CORPORAL;RUA DOS CAETES;273;11376;31/5/2001 18:10:00;INICIATIVA;S;0;CENTRO (BH);BH;611347.27;797380.42;5418
+5420;2001294356;B06000;LESAO CORPORAL;RUA CLORITA;100;16051;31/5/2001 18:25:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612847.22;797209.80;5419
+5421;2001294378;B03000;AMEACA;AV WASHINGTON LU;1300;73701;31/5/2001 18:36:00;CIDADAO COMUM;N;0;SAO BERNARDO;BH;610297.76;805044.70;5420
+5422;2001294406;B03000;AMEACA;RUA MARIO MACHAD;50;84484;31/5/2001 18:51:00;CIDADAO COMUM;N;0;DOM SILVERIO;BH;615329.03;804272.61;5421
+5423;2001294421;B03000;AMEACA;RUA FREI LUIZ DE;481;29961;31/5/2001 18:57:00;INICIATIVA;S;0;JOAO PINHEIRO;BH;604477.25;796175.73;5422
+5424;2001294473;B06000;LESAO CORPORAL;RUA PIROLOZITO;55;54292;31/5/2001 19:18:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;614090.56;797908.92;5423
+5425;2001294484;B03000;AMEACA;AV ABILIO MACHAD;289;634;31/5/2001 19:24:00;CIDADAO COMUM;N;;INCONFIDENCIA;BH;605159.11;797994.37;5424
+5426;2001294498;B06000;LESAO CORPORAL;RUA FLOR DE MAIO;36;300399;31/5/2001 19:32:00;CIDADAO COMUM;S;PX472;VILA CAFEZAL;BH;614158.56;794801.41;5425
+5427;2001294580;B03000;AMEACA;RUA POTOMAIO;658;54920;31/5/2001 20:21:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;615643.99;799123.70;5426
+5428;2001294636;B06000;LESAO CORPORAL;RUA LAVRAS;1038;40540;31/5/2001 20:58:00;INICIATIVA;N;0;SAO PEDRO;BH;611111.90;793838.67;5427
+5429;2001294659;B03000;AMEACA;RUA MERCEDES LUI;192;45483;31/5/2001 21:09:00;CIDADAO COMUM;S;0;PIRAJA;BH;613955.91;803348.34;5428
+5430;2001294667;B03000;AMEACA;RUA GUIA LOBO;200;32430;31/5/2001 21:12:00;INICIATIVA;S;0;ARAGUAIA;BH;604780.15;789332.65;5429
+5431;2001294721;B06000;LESAO CORPORAL;ESTRADA DO CERCA;2112;26428;31/5/2001 21:49:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607514.35;793543.05;5430
+5432;2001294758;B06000;LESAO CORPORAL;RUA ENGENHO DO O;173;103102;31/5/2001 22:07:00;CIDADAO COMUM;S;CAB;ENGENHO NOGUEIRA;BH;606374.39;800410.53;5431
+5433;2001294932;B04002;HOMICIDIO CONSUM;AV UM;241;301245;1/6/2001 00:12:00;CIDADAO COMUM;S;0;NOVO AARAO REIS;BH;614419.15;805879.87;5432
+5434;2001294956;B06000;LESAO CORPORAL;RUA DES SARAIVA;608;66535;1/6/2001 00:35:00;CIDADAO COMUM;N;BECO TANCREDO NE;VERA CRUZ;BH;615953.00;798263.22;5433
+5435;2001294996;B04001;HOMICIDIO TENTAD;AV DO CONTORNO;6557;17228;1/6/2001 01:25:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611103.01;794818.70;5434
+5436;2001295050;B04002;HOMICIDIO CONSUM;RUA GAMA CERQUEI;850;30564;1/6/2001 02:30:00;CIDADAO COMUM;N;PROX. A BARAO;JARDIM AMERICA;BH;607640.84;794403.25;5435
+5437;2001295097;B03000;AMEACA;AV MONTESE;672;46675;1/6/2001 03:49:00;INICIATIVA;N;0;ITAPOA;BH;608400.48;806406.08;5436
+5438;2001295173;B03000;AMEACA;RUA CAPITAO DUAR;155;96701;1/6/2001 07:09:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614915.48;806363.75;5437
+5439;2001295194;B03000;AMEACA;RUA SAO SALVADOR;46;63612;1/6/2001 07:22:00;CIDADAO COMUM;S;;BONFIM;BH;610151.37;797963.59;5438
+5440;2001295386;B03000;AMEACA;RUA JOAQUIM DE P;1000;38147;1/6/2001 09:46:00;CIDADAO COMUM;N;0;ALIPIO DE MELO;BH;604681.70;799201.87;5439
+5441;2001295394;B03000;AMEACA;RUA RIO DE JANEI;882;58772;1/6/2001 09:51:00;CIDADAO COMUM;N;LOJA MOURA CALCA;CENTRO (BH);BH;611020.00;796841.48;5440
+5442;2001295478;B06000;LESAO CORPORAL;RUA FLOR DE VIDR;44;13504;1/6/2001 11:01:00;CIDADAO COMUM;N;0;CASTELO;BH;605631.15;799432.80;5441
+5443;2001295497;B06000;LESAO CORPORAL;AV BIAS FORTES;1889;9553;1/6/2001 11:12:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;610128.59;797270.32;5442
+5444;2001295536;B08000;VIOLACAO DE DOMI;RUA ABAETE;379;546;1/6/2001 11:46:00;CIDADAO COMUM;S;CAFR;BONFIM;BH;609826.63;797835.67;5443
+5445;2001295638;B03000;AMEACA;RUA DONA NOEMI;61;22988;1/6/2001 13:09:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606252.90;797217.31;5444
+5446;2001295692;B03000;AMEACA;RUA PATROCINIO;209;52574;1/6/2001 13:45:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;609810.09;797518.64;5445
+5447;2001295737;B03000;AMEACA;RUA DA APRESENTA;59;5118;1/6/2001 14:12:00;CIDADAO COMUM;S;;SAO JOSE;BH;605407.63;798641.22;5446
+5448;2001295785;B03000;AMEACA;RUA ROSALINA BAN;215;59302;1/6/2001 14:57:00;CIDADAO COMUM;S;0;MINASLANDIA;BH;611890.83;803991.25;5447
+5449;2001295871;B06000;LESAO CORPORAL;RUA DOS GOITACAZ;790;31400;1/6/2001 15:50:00;INICIATIVA;N;0;BARRO PRETO;BH;610517.27;796910.59;5448
+5450;2001295875;B03000;AMEACA;RUA CABO VALERIO;78;111920;1/6/2001 15:53:00;CIDADAO COMUM;S;;CH ATILA DE PAIV;BH;601444.34;790687.78;5449
+5451;2001295926;B03000;AMEACA;RUA SERRA NEGRA;1224;65038;1/6/2001 16:21:00;CIDADAO COMUM;S;0;SANTO ANDRE;BH;609224.13;799135.37;5450
+5452;2001295929;B04001;HOMICIDIO TENTAD;RUA PRINCIPAL;701;300224;1/6/2001 16:20:00;CIDADAO COMUM;N;0;MORRO DO PAPAGAI;BH;610540.12;793166.02;5451
+5453;2001296069;B03000;AMEACA;RUA CIRILO GASPA;326;63348;1/6/2001 17:26:00;CIDADAO COMUM;S;0;APARECIDA SETIMA;BH;608684.85;800162.78;5452
+5454;2001296095;B06000;LESAO CORPORAL;RUA CARIOCA;114;81634;1/6/2001 17:46:00;INICIATIVA;S;0;SAO PAULO;BH;612315.00;802612.78;5453
+5455;2001296108;B03000;AMEACA;RUA GODOFREDO DE;375;31352;1/6/2001 17:49:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612726.57;799375.77;5454
+5456;2001296199;B03000;AMEACA;RUA MONTALVANIA;28;46344;1/6/2001 18:37:00;CIDADAO COMUM;S;;SANTA INES;BH;613916.00;800191.38;5455
+5457;2001296204;B03000;AMEACA;RUA LIMOEIRO;294;41108;1/6/2001 18:45:00;INICIATIVA;S;102;NOVA SUISSA;BH;607267.86;795880.77;5456
+5458;2001296341;B03000;AMEACA;RUA DA APRESENTA;59;5118;1/6/2001 19:52:00;INICIATIVA;S;;SAO JOSE;BH;605407.63;798641.22;5457
+5459;2001296413;B03000;AMEACA;RUA ARAGUARI;165;5376;1/6/2001 20:36:00;CIDADAO COMUM;S;;BARRO PRETO;BH;610131.21;797120.08;5458
+5460;2001296556;B03000;AMEACA;RUA NELSON HUNGR;10;46634;1/6/2001 21:58:00;CIDADAO COMUM;S;;TUPI;BH;612851.92;806239.44;5459
+5461;2001296572;B03000;AMEACA;RUA DES BRAULIO;1938;19917;1/6/2001 22:05:00;INICIATIVA;S;0;VERA CRUZ;BH;616339.91;797391.22;5460
+5462;2001296635;B06000;LESAO CORPORAL;BECO NOSSA SENHO;20;300897;1/6/2001 22:52:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608649.57;793925.65;5461
+5463;2001296638;B03000;AMEACA;RUA FREI LUIZ DE;59;29961;1/6/2001 22:54:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604955.30;795833.82;5462
+5464;2001296645;B04002;HOMICIDIO CONSUM;RUA DOS CARIJOS;787;81243;1/6/2001 22:57:00;INICIATIVA;N;0;CENTRO (BH);BH;610711.74;797261.24;5463
+5465;2001296724;B06000;LESAO CORPORAL;AV SILVA LOBO;2366;65889;1/6/2001 23:46:00;INICIATIVA;S;0;GRAJAU;BH;608534.06;794486.36;5464
+5466;2001296730;B06000;LESAO CORPORAL;RUA JANUARIO PER;170;86363;1/6/2001 23:47:00;CIDADAO COMUM;N;;JAQUELINE;BH;611007.43;810129.96;5465
+5467;2001296741;B03000;AMEACA;AV RAJA GABAGLIA;1987;57830;1/6/2001 23:56:00;INICIATIVA;N;0;LEONINA;BH;608875.32;793451.62;5466
+5468;2001296747;B03000;AMEACA;RUA FEIRA DE SAN;358;12946;1/6/2001 23:58:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;615488.77;806619.60;5467
+5469;2001296755;B06000;LESAO CORPORAL;RUA SEIS;62;302814;2/6/2001 00:08:00;INICIATIVA;N;0;NOVO ARAO REIS;BH;614490.26;805888.76;5468
+5470;2001296774;B04001;HOMICIDIO TENTAD;RUA ITAJOBI;10;35482;2/6/2001 00:17:00;INICIATIVA;S;0;POMPEIA;BH;614467.30;798001.31;5469
+5471;2001296853;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;2/6/2001 01:09:00;CIDADAO COMUM;0;;VENDA NOVA;BH;609671.68;808130.71;5470
+5472;2001296947;B06000;LESAO CORPORAL;RUA OUTONO;535;50768;2/6/2001 02:30:00;CIDADAO COMUM;N;;CRUZEIRO;BH;612086.42;794535.17;5471
+5473;2001296952;B06000;LESAO CORPORAL;RUA PERNAMBUCO;1184;53463;2/6/2001 02:30:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611453.01;795164.24;5472
+5474;2001297020;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;510;7936;2/6/2001 03:17:00;CIDADAO COMUM;N;;NOVA SUISSA;BH;607529.85;795029.50;5473
+5475;2001297053;B03000;AMEACA;RUA INGAI;693;36964;2/6/2001 03:52:00;CIDADAO COMUM;S;AP201;PADRE EUSTAQUIO;BH;607942.26;797392.70;5474
+5476;2001297084;B08000;VIOLACAO DE DOMI;RUA FRANCE JOSE ;328;85751;2/6/2001 04:21:00;CIDADAO COMUM;N;;SERRA VERDE;BH;609703.97;810229.05;5475
+5477;2001297169;B03000;AMEACA;RUA BINARIO;30;301457;2/6/2001 06:41:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614325.07;795529.96;5476
+5478;2001297170;B04001;HOMICIDIO TENTAD;RUA JAIR NEGRAO ;5;21944;2/6/2001 06:42:00;CIDADAO COMUM;N;;JARDIM ESTRELA;BH;607349.55;810148.64;5477
+5479;2001297172;B03000;AMEACA;RUA DOS TUPIS;1110;69965;2/6/2001 06:44:00;CIDADAO COMUM;N;;BARRO PRETO;BH;610202.12;797135.97;5478
+5480;2001297344;B03000;AMEACA;RUA IPACARAI;365;34694;2/6/2001 09:16:00;INICIATIVA;S;0;GLORIA;BH;602745.45;798057.80;5479
+5481;2001297377;B06000;LESAO CORPORAL;RUA ONDINA PEDRO;30;82882;2/6/2001 09:36:00;CIDADAO COMUM;N;0;SERRANO;BH;603640.89;801660.33;5480
+5482;2001297399;B09000;ABANDONO DE INCA;RUA CORONEL JOAO;400;17836;2/6/2001 09:54:00;CIDADAO COMUM;0;0;FLORAMAR;BH;611414.14;806536.86;5481
+5483;2001297411;B03000;AMEACA;RUA M;100;37812;2/6/2001 10:01:00;CIDADAO COMUM;S;;MINASCAIXA;BH;609121.71;810078.66;5482
+5484;2001297452;B08000;VIOLACAO DE DOMI;RUA XAVIER DA VE;166;73843;2/6/2001 10:28:00;CIDADAO COMUM;N;;MINAS BRASIL;BH;605784.32;797406.65;5483
+5485;2001297468;B03000;AMEACA;RUA CAMPINA VERD;312;12110;2/6/2001 10:37:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606172.49;794445.71;5484
+5486;2001297604;B06000;LESAO CORPORAL;RUA MARIA ANGELI;65;43825;2/6/2001 12:09:00;CIDADAO COMUM;S;CAFU;MARIA GORETTI;BH;614078.28;803663.57;5485
+5487;2001297620;B03000;AMEACA;RUA FERNANDO LOB;400;28118;2/6/2001 12:25:00;POLICIAL MILITAR;N;0;SANTA EFIGENIA;BH;614428.02;796990.29;5486
+5488;2001297682;B03000;AMEACA;RUA ROBERTO ALVA;488;125888;2/6/2001 13:09:00;CIDADAO COMUM;S;0;MANGABEIRAS;BH;613717.09;794096.65;5487
+5489;2001297739;B06000;LESAO CORPORAL;RUA DEUSDEDITH D;45;20071;2/6/2001 13:53:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604180.22;796804.73;5488
+5490;2001297824;B06000;LESAO CORPORAL;RUA CAETANO VASC;11;98202;2/6/2001 15:00:00;CIDADAO COMUM;S;0;JARDIM VITORIA;BH;616275.04;804051.71;5489
+5491;2001297851;B03000;AMEACA;RUA PROFESSOR LE;396;84052;2/6/2001 15:19:00;CIDADAO COMUM;S;;ITAMARATI;BH;606383.37;807880.96;5490
+5492;2001297882;B03000;AMEACA;RUA TAPIRA;81;66939;2/6/2001 15:33:00;CIDADAO COMUM;S;0;CONCORDIA;BH;610785.63;799662.42;5491
+5493;2001297894;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;2/6/2001 15:44:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;5492
+5494;2001297924;B03000;AMEACA;AV DOS ESPORTES;550;26065;2/6/2001 16:08:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606264.57;797115.43;5493
+5495;2001297963;B06000;LESAO CORPORAL;RUA EVEREST;169;26935;2/6/2001 16:29:00;CIDADAO COMUM;S;0;BELMONT;BH;615458.96;805318.06;5494
+5496;2001297972;B06000;LESAO CORPORAL;RUA INTENDENTE C;420;34653;2/6/2001 16:35:00;CIDADAO COMUM;S;AP302;VILA INDAIA;BH;609729.35;803429.79;5495
+5497;2001297976;B04001;HOMICIDIO TENTAD;RUA GRAUNAS;42;31797;2/6/2001 16:37:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;605204.19;788456.55;5496
+5498;2001297977;B03000;AMEACA;RUA CONSELHEIRO ;231;17041;2/6/2001 16:37:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;612529.23;798131.69;5497
+5499;2001298009;B03000;AMEACA;RUA STA APOLONIA;548;60352;2/6/2001 16:52:00;CIDADAO COMUM;S;;DOM JOAQUIM;BH;613932.42;802281.61;5498
+5500;2001298039;B03000;AMEACA;RUA LUIZ LOPES;232;94431;2/6/2001 17:08:00;CIDADAO COMUM;S;;OURO PRETO;BH;606295.93;801150.74;5499
+5501;2001298063;B03000;AMEACA;RUA REGINA;17;58224;2/6/2001 17:23:00;CIDADAO COMUM;S;;EYMARD;BH;613648.70;803339.62;5500
+5502;2001298065;B03000;AMEACA;RUA FLOR DE VIDR;44;13504;2/6/2001 17:21:00;CIDADAO COMUM;S;0;CASTELO;BH;605631.15;799432.80;5501
+5503;2001298084;B06000;LESAO CORPORAL;RUA PEDRA DOURAD;158;127060;2/6/2001 17:32:00;CIDADAO COMUM;S;0;PIRATININGA;BH;605914.83;809333.11;5502
+5504;2001298101;B03000;AMEACA;RUA SARARE;25;64035;2/6/2001 17:48:00;CIDADAO COMUM;N;;JARDINOPOLIS;BH;604534.76;794804.54;5503
+5505;2001298102;B06000;LESAO CORPORAL;RUA HERCILIA GOM;186;104389;2/6/2001 17:50:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605402.11;791022.21;5504
+5506;2001298284;B03000;AMEACA;RUA ITANHAEM;20;100173;2/6/2001 19:16:00;CIDADAO COMUM;S;;PIRATININGA;BH;605396.91;809225.25;5505
+5507;2001298286;B06000;LESAO CORPORAL;RUA PADRE FEIJO;2190;51326;2/6/2001 19:18:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616394.07;797774.76;5506
+5508;2001298296;B03000;AMEACA;AV AUGUSTO DE LI;170;6731;2/6/2001 19:21:00;CIDADAO COMUM;S;1502;CENTRO (BH);BH;611167.70;796596.57;5507
+5509;2001298323;B06000;LESAO CORPORAL;RUA AVELINO GIAR;65;99350;2/6/2001 19:39:00;INICIATIVA;N;0;CEU AZUL;BH;604887.51;807674.66;5508
+5510;2001298328;B06000;LESAO CORPORAL;RUA SARANDI;18;64010;2/6/2001 19:42:00;INICIATIVA;S;0;ESPLANADA;BH;615019.62;798459.96;5509
+5511;2001298355;B03000;AMEACA;RUA ESTEVAO DE O;207;26330;2/6/2001 19:55:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606323.57;798272.26;5510
+5512;2001298367;B03000;AMEACA;AV AFONSO PENA;590;1259;2/6/2001 20:01:00;INICIATIVA;N;0;CENTRO BH;BH;611078.27;797193.62;5511
+5513;2001298443;B04001;HOMICIDIO TENTAD;RUA MANTIQUEIRA;276;43286;2/6/2001 20:45:00;CIDADAO COMUM;N;0;SANTA INES;BH;614324.07;800485.83;5512
+5514;2001298469;B06000;LESAO CORPORAL;AV WALDIR SOEIRO;97;118904;2/6/2001 21:00:00;INICIATIVA;N;0;BETANIA;BH;601638.75;788954.48;5513
+5515;2001298474;B06000;LESAO CORPORAL;RUA NICIAS CONTI;115;56115;2/6/2001 21:02:00;CIDADAO COMUM;S;0;GAMELEIRA;BH;604986.20;794809.65;5514
+5516;2001298484;B03000;AMEACA;RUA DA BOLIVIA;648;9884;2/6/2001 21:07:00;INICIATIVA;S;0;SION;BH;610943.73;793524.50;5515
+5517;2001298496;B06000;LESAO CORPORAL;RUA DOS AMERICAN;1297;3254;2/6/2001 21:16:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604811.91;790698.06;5516
+5518;2001298527;B03000;AMEACA;AV ITAITE;99;35441;2/6/2001 21:28:00;CIDADAO COMUM;S;0;SAO GERALDO;BH;614875.88;799394.79;5517
+5519;2001298538;B06000;LESAO CORPORAL;RUA GUARARAPES;951;32241;2/6/2001 21:33:00;CIDADAO COMUM;N;0;GLORIA;BH;603067.32;798685.03;5518
+5520;2001298558;B06000;LESAO CORPORAL;RUA ANA DE FREIT;87;3531;2/6/2001 21:42:00;CIDADAO COMUM;N;;DURVAL DE BARROS;IB;598543.34;790677.20;5519
+5521;2001298566;B03000;AMEACA;RUA ITAGUA;195;35338;2/6/2001 21:45:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615942.80;798772.06;5520
+5522;2001298601;B03000;AMEACA;AV BELEM;906;8913;2/6/2001 22:04:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615138.21;797926.24;5521
+5523;2001298619;B06000;LESAO CORPORAL;RUA AMARANTO;68;3080;2/6/2001 22:12:00;CIDADAO COMUM;S;;LINDEIA;BH;599564.60;790850.68;5522
+5524;2001298655;B03000;AMEACA;RUA ANTONIA DE C;162;65457;2/6/2001 22:30:00;CIDADAO COMUM;N;;MINASCAIXA;BH;608892.64;809255.94;5523
+5525;2001298692;B04002;HOMICIDIO CONSUM;AV ESPLANADA;600;126244;2/6/2001 22:47:00;CIDADAO COMUM;N;0;SAO GABRIEL;BH;613295.56;804506.46;5524
+5526;2001298703;B06000;LESAO CORPORAL;RUA DES ONOFRE M;18;108770;2/6/2001 22:55:00;INICIATIVA;N;0;RIO BRANCO;BH;607470.11;808742.09;5525
+5527;2001298717;B06000;LESAO CORPORAL;RUA SAO VICENTE;10;113680;2/6/2001 23:00:00;CIDADAO COMUM;S;;TIROL;BH;600949.68;789154.18;5526
+5528;2001298726;B03000;AMEACA;RUA OTAVIO CARNE;456;50594;2/6/2001 23:06:00;CIDADAO COMUM;S;0;BOA VISTA;BH;614836.31;799825.99;5527
+5529;2001298740;B04001;HOMICIDIO TENTAD;RUA CLORITA;100;16051;2/6/2001 23:11:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612847.22;797209.80;5528
+5530;2001298741;B06000;LESAO CORPORAL;RUA VISCONDE DE ;584;73308;2/6/2001 23:11:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605857.28;807175.17;5529
+5531;2001298768;B06000;LESAO CORPORAL;RUA BERNARDO CIS;183;9351;2/6/2001 23:23:00;CIDADAO COMUM;N;;PARQUE RIACHUELO;BH;609725.24;799999.49;5530
+5532;2001298777;B06000;LESAO CORPORAL;RUA JOSE MOREIRA;481;95232;2/6/2001 23:25:00;CIDADAO COMUM;S;0;TIROL;BH;600268.32;789248.46;5531
+5533;2001298824;B02000;RIXA;AV ITAITE;654;35441;2/6/2001 23:55:00;CIDADAO COMUM;N;;SAO GERALDO;BH;615408.86;799462.18;5532
+5534;2001298831;B03000;AMEACA;RUA GUARARAPES;951;32241;2/6/2001 23:59:00;CIDADAO COMUM;S;;GLORIA;BH;603067.32;798685.03;5533
+5535;2001298875;B03000;AMEACA;RUA ANTONIO JOSE;102;7431;3/6/2001 00:31:00;CIDADAO COMUM;S;;CEU AZUL;BH;605149.79;807714.83;5534
+5536;2001298885;B03000;AMEACA;RUA PEDRO LUIZ D;199;100841;3/6/2001 00:38:00;CIDADAO COMUM;S;;FLORAMAR;BH;611505.95;807230.49;5535
+5537;2001298930;B06000;LESAO CORPORAL;RUA GABRO;379;30435;3/6/2001 01:04:00;CIDADAO COMUM;N;0;SANTA TEREZA;BH;612925.79;797244.47;5536
+5538;2001298943;B06000;LESAO CORPORAL;RUA MOREIRA DIAS;7;31191;3/6/2001 01:11:00;CIDADAO COMUM;S;0;CONJ HAB JARDIM ;BH;603860.94;798157.37;5537
+5539;2001298998;B03000;AMEACA;RUA ANTONIO MARZ;354;94520;3/6/2001 01:43:00;CIDADAO COMUM;N;;OURO PRETO;BH;606237.09;800709.30;5538
+5540;2001299037;B04001;HOMICIDIO TENTAD;RUA DAVID FONSEC;450;19696;3/6/2001 02:01:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;604513.19;789975.34;5539
+5541;2001299104;B06000;LESAO CORPORAL;RUA SAO PAULO;550;90213;3/6/2001 02:42:00;CIDADAO COMUM;S;CA;SARANDI (URCA/BH;BH;602793.89;802510.17;5540
+5542;2001299106;B06000;LESAO CORPORAL;AV SILVIANO BRAN;2400;66002;3/6/2001 02:44:00;INICIATIVA;S;0;HORTO;BH;613573.09;798218.66;5541
+5543;2001299181;B04001;HOMICIDIO TENTAD;RUA DOS GOITACAZ;1361;31400;3/6/2001 03:35:00;CIDADAO COMUM;N;;BARRO PRETO;BH;609953.61;797025.02;5542
+5544;2001299188;B06000;LESAO CORPORAL;RUA PROFESSOR SA;15;122722;3/6/2001 03:44:00;CIDADAO COMUM;S;0;BELVEDERE;BH;611311.76;791412.70;5543
+5545;2001299204;B03000;AMEACA;RUA MARIA;27;43737;3/6/2001 04:01:00;CIDADAO COMUM;N;;VILA MARAVILHAS;BH;603342.50;795417.91;5544
+5546;2001299247;B06000;LESAO CORPORAL;AV FLOR DE SEDA;883;748;3/6/2001 04:32:00;CIDADAO COMUM;S;0;LINDEIA;BH;599539.85;790575.26;5545
+5547;2001299256;B06000;LESAO CORPORAL;RUA OITO;95;81606;3/6/2001 04:40:00;CIDADAO COMUM;S;;OLHOS DAGUA;BH;608583.83;788592.29;5546
+5548;2001299298;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;322;51657;3/6/2001 05:34:00;CIDADAO COMUM;S;0;VILA SANTO ANTON;BH;609650.08;808286.90;5547
+5549;2001299361;B06000;LESAO CORPORAL;RUA ARTUR DE SA;1095;6211;3/6/2001 07:16:00;CIDADAO COMUM;S;;UNIAO;BH;612867.65;801923.71;5548
+5550;2001299401;B03000;AMEACA;RUA FERNAO DIAS;428;28133;3/6/2001 08:03:00;CIDADAO COMUM;S;;CASA BRANCA;BH;616090.44;799485.48;5549
+5551;2001299440;B03000;AMEACA;RUA D;114;79764;3/6/2001 08:30:00;CIDADAO COMUM;S;;JARDIM VITORIA;BH;616892.23;804514.53;5550
+5552;2001299493;B03000;AMEACA;RUA P;9;27216;3/6/2001 09:32:00;CIDADAO COMUM;S;0;PAULO SEXTO;BH;616464.31;806936.03;5551
+5553;2001299532;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;744;6731;3/6/2001 10:00:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610661.75;796747.31;5552
+5554;2001299539;B03000;AMEACA;RUA LEONCIO JOSE;49;86350;3/6/2001 10:05:00;CIDADAO COMUM;S;;JARDIM GUANABARA;BH;611933.98;807194.50;5553
+5555;2001299564;B09000;ABANDONO DE INCA;RUA CLOVIS DE CA;65;16064;3/6/2001 10:26:00;CIDADAO COMUM;S;;FLORAMAR;BH;612155.53;805842.63;5554
+5556;2001299571;B06000;LESAO CORPORAL;RUA CARLINDO AUG;5;97124;3/6/2001 10:30:00;CIDADAO COMUM;N;;SAO MARCOS;BH;614652.76;802454.88;5555
+5557;2001299638;B06000;LESAO CORPORAL;RUA ANTONIO JULI;218;111379;3/6/2001 11:18:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;606775.18;806180.58;5556
+5558;2001299725;B06000;LESAO CORPORAL;RUA TRUCAL;92;95825;3/6/2001 12:15:00;CIDADAO COMUM;S;;GOIANIA;BH;615359.86;803216.58;5557
+5559;2001299825;B06000;LESAO CORPORAL;AV ALVARES CABRA;17;2730;3/6/2001 13:09:00;INICIATIVA;N;0;CENTRO BH;BH;611448.04;796520.02;5558
+5560;2001299832;B06000;LESAO CORPORAL;RUA CLOVIS DE SO;210;118642;3/6/2001 13:14:00;CIDADAO COMUM;N;;REGINA;BH;598820.84;789899.77;5559
+5561;2001299854;B03000;AMEACA;RUA VITORIA REGI;400;73540;3/6/2001 13:28:00;CIDADAO COMUM;S;CSB;LINDEIA;BH;599149.38;790905.76;5560
+5562;2001299857;B04001;HOMICIDIO TENTAD;RUA LA PAZ;151;40350;3/6/2001 13:27:00;CIDADAO COMUM;S;0;SION;BH;611089.07;793827.88;5561
+5563;2001299869;B03000;AMEACA;RUA SERVIDAO;27;106734;3/6/2001 13:38:00;CIDADAO COMUM;N;;JARDIM DOS COMER;BH;607267.69;811545.81;5562
+5564;2001299871;B03000;AMEACA;RUA SAO JERONIMO;1271;62764;3/6/2001 13:40:00;CIDADAO COMUM;N;0;SAGRADA FAMILIA;BH;612648.00;799754.06;5563
+5565;2001299997;B03000;AMEACA;RUA CAMPOS SALES;1023;12300;3/6/2001 15:06:00;CIDADAO COMUM;S;CAZZ;CALAFATE;BH;606539.69;796004.69;5564
+5566;2001300030;B06000;LESAO CORPORAL;RUA LAGUNA;104;94167;3/6/2001 15:25:00;CIDADAO COMUM;S;;SANTA CECILIA;BH;601002.03;787950.46;5565
+5567;2001300195;B03000;AMEACA;RUA QUINANTE;350;57234;3/6/2001 16:56:00;CIDADAO COMUM;N;;MINASCAIXA;BH;609756.82;808965.48;5566
+5568;2001300228;B06000;LESAO CORPORAL;RUA SAO JOAO BAT;93;62824;3/6/2001 17:13:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605813.84;808139.15;5567
+5569;2001300229;B04001;HOMICIDIO TENTAD;RUA GAMA CERQUEI;1117;30564;3/6/2001 17:09:00;INICIATIVA;S;0;JARDIM AMERICA;BH;607837.58;794041.01;5568
+5570;2001300243;B03000;AMEACA;RUA ESTRELA DO S;226;26718;3/6/2001 17:27:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;613340.29;797293.43;5569
+5571;2001300251;B03000;AMEACA;RUA MARIA;27;43737;3/6/2001 17:29:00;CIDADAO COMUM;S;0;VILA MARAVILHAS;BH;603342.50;795417.91;5570
+5572;2001300280;B06000;LESAO CORPORAL;RUA PARANOA;94;27521;3/6/2001 17:46:00;CIDADAO COMUM;S;;CH CELSO MACHADO;BH;603709.56;801171.39;5571
+5573;2001300307;B03000;AMEACA;RUA NATAL;166;47306;3/6/2001 17:57:00;CIDADAO COMUM;N;AP10;SANTO ANDRE;BH;609468.39;799440.41;5572
+5574;2001300310;B06000;LESAO CORPORAL;RUA GASPAR DE LE;45;119720;3/6/2001 17:58:00;INICIATIVA;S;0;VERA CRUZ;BH;616869.52;797183.90;5573
+5575;2001300364;B06000;LESAO CORPORAL;RUA IBIAPABA;389;33837;3/6/2001 18:23:00;CIDADAO COMUM;N;0;VILA IPIRANGA;BH;604922.07;789751.90;5574
+5576;2001300383;B06000;LESAO CORPORAL;RUA PARA DE MINA;10;52070;3/6/2001 18:32:00;INICIATIVA;N;0;PADRE EUSTAQUIO;BH;606706.69;797678.03;5575
+5577;2001300388;B03000;AMEACA;RUA GERALDO FERR;1510;41007;3/6/2001 18:33:00;CIDADAO COMUM;N;CAF;JARDIM VITORIA;BH;617152.34;804043.58;5576
+5578;2001300394;B06000;LESAO CORPORAL;RUA CONCEICAO CH;27;20387;3/6/2001 18:36:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;608844.59;808153.20;5577
+5579;2001300430;B06000;LESAO CORPORAL;RUA APERE;389;5020;3/6/2001 18:52:00;CIDADAO COMUM;0;0;SAO GERALDO;BH;615435.75;799736.04;5578
+5580;2001300432;B06000;LESAO CORPORAL;AV AMAZONAS;6000;3140;3/6/2001 18:53:00;POLICIAL MILITAR;S;0;GAMELEIRA;BH;606048.05;795827.62;5579
+5581;2001300451;B04001;HOMICIDIO TENTAD;BECO OPALA;75;300769;3/6/2001 19:00:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;608739.85;797746.86;5580
+5582;2001300466;B03000;AMEACA;RUA MOTOQUEIRO L;26;69505;3/6/2001 19:05:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611770.40;806402.82;5581
+5583;2001300472;B03000;AMEACA;RUA MONTE SIMPLO;300;46574;3/6/2001 19:07:00;MILITARES DAS FO;S;;NOVA SUISSA;BH;606574.34;795868.64;5582
+5584;2001300493;B06000;LESAO CORPORAL;AV DOS CLARINS;54;118337;3/6/2001 19:16:00;CIDADAO COMUM;S;;CH CALIFORNIA;BH;604017.86;796719.43;5583
+5585;2001300517;B06000;LESAO CORPORAL;AV PRESIDENTE AN;3330;4461;3/6/2001 19:30:00;INICIATIVA;S;0;CACHOEIRINHA;BH;609917.41;801202.78;5584
+5586;2001300521;B06000;LESAO CORPORAL;AV ANTONIO ABRAH;1000;4320;3/6/2001 19:32:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;5585
+5587;2001300524;B06000;LESAO CORPORAL;AV PARANA;42;52230;3/6/2001 19:33:00;INICIATIVA;N;0;CENTRO (BH);BH;610805.41;797476.32;5586
+5588;2001300530;B03000;AMEACA;RUA FLOR DA SEIV;120;28739;3/6/2001 19:38:00;CIDADAO COMUM;S;LJA;JARDIM MONTANHES;BH;606072.83;799591.68;5587
+5589;2001300632;B06000;LESAO CORPORAL;RUA CINQUENTA E ;187;33736;3/6/2001 20:35:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612647.11;806904.94;5588
+5590;2001300686;B06000;LESAO CORPORAL;RUA MARIA BEATRI;76;43881;3/6/2001 21:06:00;CIDADAO COMUM;S;;HAVAI;BH;606696.13;793615.49;5589
+5591;2001300722;B06000;LESAO CORPORAL;BECO SAO SEBASTI;80;93470;3/6/2001 21:25:00;CIDADAO COMUM;S;CAFRENT;DOZE DE OUTUBRO;BH;606084.20;790709.65;5590
+5592;2001300797;B06000;LESAO CORPORAL;RUA IPE CLARO;300;124440;3/6/2001 22:13:00;INICIATIVA;N;0;ETELVINA CARNEIR;BH;611601.13;808955.15;5591
+5593;2001300817;B03000;AMEACA;RUA SAO PAULO;1031;63464;3/6/2001 22:25:00;INICIATIVA;S;0;CENTRO BH;BH;610900.59;796770.40;5592
+5594;2001300873;B05000;SEQUESTRO E CARC;RUA LAUDELINA CA;295;15594;3/6/2001 22:47:00;INICIATIVA;N;0;BRAUNAS;BH;604477.36;805759.23;5593
+5595;2001300876;B06000;LESAO CORPORAL;PRACA RUI BARBOS;50;59558;3/6/2001 22:50:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611488.17;797485.82;5594
+5596;2001300956;B03000;AMEACA;RUA NELSON HUNGR;10;46634;3/6/2001 23:29:00;CIDADAO COMUM;N;;TUPI;BH;612851.92;806239.44;5595
+5597;2001300966;B06000;LESAO CORPORAL;RUA PIO XI;560;53927;3/6/2001 23:40:00;INICIATIVA;S;0;IPIRANGA;BH;612058.97;800797.20;5596
+5598;2001301005;B06000;LESAO CORPORAL;RUA POMBA;405;57464;4/6/2001 00:04:00;CIDADAO COMUM;N;;GOIANIA;BH;615455.09;803054.45;5597
+5599;2001301078;B04001;HOMICIDIO TENTAD;RUA CONCEICAO DE;479;16515;4/6/2001 00:56:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605887.75;807297.08;5598
+5600;2001301123;B03000;AMEACA;RUA ANTERO DE QU;405;4298;4/6/2001 01:44:00;CIDADAO COMUM;N;;SANTA BRANCA;BH;608270.89;806423.86;5599
+5601;2001301146;B04002;HOMICIDIO CONSUM;AV AMERICO VESPU;667;3355;4/6/2001 02:14:00;INICIATIVA;N;0;ERMELINDA;BH;609288.35;800370.16;5600
+5602;2001301308;B03000;AMEACA;RUA FLOR DA AMEI;263;77539;4/6/2001 07:31:00;CIDADAO COMUM;S;;JARDIM ALVORADA;BH;606349.66;800027.37;5601
+5603;2001301331;B06000;LESAO CORPORAL;AV OLEGARIO MACI;103;49699;4/6/2001 07:58:00;INICIATIVA;N;0;CENTRO (BH);BH;610681.26;797548.71;5602
+5604;2001301509;B03000;AMEACA;RUA CARMO DA CAC;10;13659;4/6/2001 09:58:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606146.59;794290.29;5603
+5605;2001301637;B03000;AMEACA;RUA VENEZUELA;643;71460;4/6/2001 11:22:00;INICIATIVA;N;0;SION;BH;611300.07;793371.41;5604
+5606;2001301647;B03000;AMEACA;RUA LADAINHA;45;40118;4/6/2001 11:33:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612013.16;803584.39;5605
+5607;2001301650;B04001;HOMICIDIO TENTAD;RUA CURRAL DEL R;194;19122;4/6/2001 11:33:00;CIDADAO COMUM;S;;CABANA;BH;604750.80;793811.34;5606
+5608;2001301663;B06000;LESAO CORPORAL;RUA MUNIZ;83;170850;4/6/2001 11:45:00;CIDADAO COMUM;S;;MORRO DAS PEDRAS;BH;608088.74;793990.65;5607
+5609;2001301677;B06000;LESAO CORPORAL;RUA ERNESTO GAZZ;110;99117;4/6/2001 11:57:00;CIDADAO COMUM;N;;CEU AZUL;BH;605033.43;808548.91;5608
+5610;2001301688;B03000;AMEACA;RUA CONSELHEIRO ;375;17041;4/6/2001 12:00:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612564.61;798267.52;5609
+5611;2001301723;B03000;AMEACA;RUA ARAPE;26;29798;4/6/2001 12:32:00;CIDADAO COMUM;S;26A;UNIAO;BH;612951.72;801000.18;5610
+5612;2001301746;B03000;AMEACA;RUA AQUILES LOBO;12;5219;4/6/2001 12:51:00;CIDADAO COMUM;S;;FLORESTA;BH;612358.94;797328.31;5611
+5613;2001301759;B06000;LESAO CORPORAL;RUA VILA REAL;87;60683;4/6/2001 13:03:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609915.68;801999.03;5612
+5614;2001301793;B06000;LESAO CORPORAL;AV AMAZONAS;2267;3140;4/6/2001 13:33:00;INICIATIVA;N;INICIATIVA POV5.;BARRO PRETO;BH;609538.15;796202.90;5613
+5615;2001301844;B04001;HOMICIDIO TENTAD;RUA ONZE DE NOVE;56;81054;4/6/2001 14:10:00;INICIATIVA;S;0;LEONINA;BH;608376.82;793204.43;5614
+5616;2001301853;B06000;LESAO CORPORAL;RUA DO CALVARIO;258;11700;4/6/2001 14:16:00;CIDADAO COMUM;N;CSA;SAO MARCOS;BH;613836.82;802510.54;5615
+5617;2001301864;B03000;AMEACA;RUA STA JOSEFINA;821;60803;4/6/2001 14:20:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608530.91;800871.09;5616
+5618;2001301885;B06000;LESAO CORPORAL;RUA FLOR DE ABRI;5;28464;4/6/2001 14:38:00;CIDADAO COMUM;S;0;JARDIM MONTANHES;BH;606020.27;798873.31;5617
+5619;2001301937;B06000;LESAO CORPORAL;AV PRESIDENTE AN;4013;4461;4/6/2001 15:13:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609536.57;802154.10;5618
+5620;2001301938;B06000;LESAO CORPORAL;RUA BIMBARRA;343;9641;4/6/2001 15:13:00;CIDADAO COMUM;N;CAA;CALAFATE;BH;607141.45;796609.73;5619
+5621;2001301987;B06000;LESAO CORPORAL;RUA COSTA JUNIOR;119;18321;4/6/2001 15:41:00;CIDADAO COMUM;S;0;NOVA CACHOEIRINH;BH;609688.67;801513.50;5620
+5622;2001302005;B06000;LESAO CORPORAL;RUA CAPELINHA;20;300406;4/6/2001 15:52:00;CIDADAO COMUM;N;;MORRO DO PAPAGAI;BH;610483.17;793376.89;5621
+5623;2001302121;B06000;LESAO CORPORAL;AV AMAZONAS;1735;3140;4/6/2001 16:58:00;CIDADAO COMUM;N;0;BARRO PRETO;BH;610011.95;796485.92;5622
+5624;2001302139;B03000;AMEACA;AV WALDOMIRO LOB;1560;66548;4/6/2001 17:06:00;CIDADAO COMUM;N;0;GUARANI;BH;612066.64;805250.22;5623
+5625;2001302180;B03000;AMEACA;RUA WALESKA DE S;90;107954;4/6/2001 17:28:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606465.56;811841.30;5624
+5626;2001302284;B03000;AMEACA;RUA DOS GUAJAJAR;2127;32037;4/6/2001 18:20:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;609531.05;796845.76;5625
+5627;2001302375;B06000;LESAO CORPORAL;RUA AROEIRA DO S;105;105757;4/6/2001 19:02:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615836.12;805770.66;5626
+5628;2001302503;B03000;AMEACA;RUA PLINIO TEIXE;25;98155;4/6/2001 20:08:00;CIDADAO COMUM;N;CA5;DOM SILVERIO;BH;615278.38;804834.14;5627
+5629;2001302525;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;4/6/2001 20:21:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;5628
+5630;2001302590;B03000;AMEACA;AV AMERICO VESPU;990;3355;4/6/2001 21:00:00;CIDADAO COMUM;S;0;APARECIDA;BH;609042.75;800120.55;5629
+5631;2001302630;B03000;AMEACA;AV A;455;34099;4/6/2001 21:24:00;CIDADAO COMUM;N;CAFR;CONJUNTO FELICID;BH;612533.56;807079.22;5630
+5632;2001302726;B03000;AMEACA;AV A;84;302850;4/6/2001 22:28:00;CIDADAO COMUM;N;;NOVO AARAO REIS;BH;613873.98;805539.35;5631
+5633;2001302935;B03000;AMEACA;RUA ANTONIO DE A;156;4345;5/6/2001 01:03:00;INICIATIVA;S;0;FUNCIONARIOS;BH;611821.42;794964.79;5632
+5634;2001303015;B04001;HOMICIDIO TENTAD;AV IBIRAPUERA;20;33893;5/6/2001 03:15:00;CIDADAO COMUM;N;0;ITAIPU BH;BH;599290.35;789040.69;5633
+5635;2001303179;B03000;AMEACA;PRACA SILVA GUIM;22;65850;5/6/2001 08:01:00;CIDADAO COMUM;N;0;CARMO;BH;611990.82;794859.98;5634
+5636;2001303214;B06000;LESAO CORPORAL;RUA MARCOS DONAT;125;99422;5/6/2001 08:18:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614912.51;808004.53;5635
+5637;2001303354;B03000;AMEACA;RUA GENTIL TEODO;87;66333;5/6/2001 10:02:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;611230.41;801186.56;5636
+5638;2001303385;B06000;LESAO CORPORAL;RUA SAO BORJA;884;61620;5/6/2001 10:20:00;CIDADAO COMUM;N;;BOA VISTA;BH;615470.78;800428.06;5637
+5639;2001303520;B04001;HOMICIDIO TENTAD;RUA CAMILO PRATE;242;11915;5/6/2001 11:48:00;CIDADAO COMUM;N;;UNIAO;BH;613203.18;801235.39;5638
+5640;2001303527;B03000;AMEACA;RUA MARTINHO DE ;80;44985;5/6/2001 11:54:00;CIDADAO COMUM;N;CAA;NOVA CACHOEIRINH;BH;609773.94;801245.03;5639
+5641;2001303654;B03000;AMEACA;RUA ALCIDES LINS;502;1914;5/6/2001 13:28:00;CIDADAO COMUM;0;;VILA SANTO ANTON;BH;609215.72;808481.71;5640
+5642;2001303671;B06000;LESAO CORPORAL;AV URUGUAI;335;71113;5/6/2001 13:39:00;CIDADAO COMUM;N;SALA 14;SION;BH;611750.13;793745.62;5641
+5643;2001303768;B03000;AMEACA;RUA ITAPURA;397;35918;5/6/2001 14:41:00;CIDADAO COMUM;S;CAA;SAUDADE;BH;615292.38;797464.66;5642
+5644;2001303884;B06000;LESAO CORPORAL;RUA FERNANDES TO;1020;81271;5/6/2001 15:46:00;CIDADAO COMUM;S;0;LOURDES;BH;610527.63;795180.24;5643
+5645;2001304089;B04001;HOMICIDIO TENTAD;AV DEL REY;155;35381;5/6/2001 17:42:00;CIDADAO COMUM;N;;CAICARA;BH;608155.87;800189.74;5644
+5646;2001304105;B06000;LESAO CORPORAL;RUA RAINHA DAS F;150;92159;5/6/2001 17:54:00;CIDADAO COMUM;N;0;FILADELFIA;BH;602077.15;797500.80;5645
+5647;2001304131;B03000;AMEACA;AV SEN LEVINDO C;3363;14866;5/6/2001 18:06:00;CIDADAO COMUM;S;LJ;CH VALE DO JATOB;BH;601209.33;786916.79;5646
+5648;2001304139;B06000;LESAO CORPORAL;RUA PARA DE MINA;390;52070;5/6/2001 18:09:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606291.28;797707.27;5647
+5649;2001304248;B06000;LESAO CORPORAL;RUA DOMINGOS VIE;587;22660;5/6/2001 19:02:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;612419.49;796795.17;5648
+5650;2001304287;B03000;AMEACA;RUA FRUTAL;379;30060;5/6/2001 19:20:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613747.13;796713.04;5649
+5651;2001304404;B03000;AMEACA;RUA CASA BRANCA;251;13848;5/6/2001 20:22:00;CIDADAO COMUM;S;;POMPEIA;BH;614924.14;798019.77;5650
+5652;2001304472;B04001;HOMICIDIO TENTAD;RUA AMAZONITA;495;3153;5/6/2001 20:58:00;CIDADAO COMUM;S;VITIMA JA SOCORR;POMPEIA;BH;614858.36;797726.26;5651
+5653;2001304477;B06000;LESAO CORPORAL;RUA JEQUIRICA;132;37258;5/6/2001 21:02:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611258.32;799494.73;5652
+5654;2001304478;B06000;LESAO CORPORAL;RUA AGUA COMPRID;63;1508;5/6/2001 21:03:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605882.52;808251.63;5653
+5655;2001304484;B04001;HOMICIDIO TENTAD;RUA PEDRO LESSA;100;53117;5/6/2001 21:09:00;INICIATIVA;S;0;LAGOINHA;BH;610197.53;798760.14;5654
+5656;2001304489;B06000;LESAO CORPORAL;RUA DO CAFE;234;11389;5/6/2001 21:11:00;CIDADAO COMUM;N;;SANTA CRUZ (BARR;BH;603108.90;788912.18;5655
+5657;2001304533;B06000;LESAO CORPORAL;RUA MATO GROSSO;457;45200;5/6/2001 21:39:00;INICIATIVA;S;0;BARRO PRETO;BH;610181.58;796806.67;5656
+5658;2001304575;B04002;HOMICIDIO CONSUM;RUA DEZ DE NOVEM;84;20374;5/6/2001 22:02:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609772.92;805395.37;5657
+5659;2001304582;B03000;AMEACA;AV OTACILIO NEGR;17447;50566;5/6/2001 22:11:00;INICIATIVA;N;0;JARDIM ATLANTICO;BH;607861.37;805251.64;5658
+5660;2001304606;B06000;LESAO CORPORAL;RUA JOAQUIM NABU;122;38121;5/6/2001 22:26:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;606973.16;795764.37;5659
+5661;2001304619;B04002;HOMICIDIO CONSUM;RUA DEPUTADA IVE;100;87325;5/6/2001 22:35:00;CIDADAO COMUM;N;0;PONGELUPE;BH;603758.88;787112.87;5660
+5662;2001304630;B03000;AMEACA;RUA EVORA;136;26950;5/6/2001 22:41:00;CIDADAO COMUM;S;;PRIMAVERA;BH;604493.86;798763.19;5661
+5663;2001304673;B03000;AMEACA;RUA RIBATEJO;112;63058;5/6/2001 23:09:00;CIDADAO COMUM;N;0;SAO FRANCISCO;BH;609796.03;802014.20;5662
+5664;2001304706;B06000;LESAO CORPORAL;AV DO CONTORNO;4470;17228;5/6/2001 23:27:00;CIDADAO COMUM;S;PX50;CENTRO (BH);BH;612554.26;795566.52;5663
+5665;2001304715;B04001;HOMICIDIO TENTAD;RUA DEZESSETE;9;100306;5/6/2001 23:42:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614505.24;802575.32;5664
+5666;2001304796;B03000;AMEACA;RUA VITORIA;5;301511;6/6/2001 00:59:00;INICIATIVA;S;0;SAO LUCAS;BH;613449.25;795834.03;5665
+5667;2001304807;B04001;HOMICIDIO TENTAD;RUA POTOMAIO;658;54920;6/6/2001 01:17:00;INICIATIVA;N;0;SAO GERALDO;BH;615643.99;799123.70;5666
+5668;2001304813;B03000;AMEACA;RUA CAICARA;24;11451;6/6/2001 01:32:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616320.61;799419.93;5667
+5669;2001304818;B03000;AMEACA;RUA CORONEL EGID;415;17690;6/6/2001 01:35:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;614439.06;796945.79;5668
+5670;2001304822;B04001;HOMICIDIO TENTAD;RUA MARIA CARMEM;549;127206;6/6/2001 01:45:00;CIDADAO COMUM;S;BLA     AP304;SANTA EFIGENIA;BH;614141.69;796132.08;5669
+5671;2001304838;B06000;LESAO CORPORAL;AV PRESIDENTE AN;2866;4461;6/6/2001 02:07:00;CIDADAO COMUM;S;;CACHOEIRINHA;BH;609879.81;800682.86;5670
+5672;2001305231;B06000;LESAO CORPORAL;RUA HELGA TAVEIR;530;100693;6/6/2001 09:47:00;CIDADAO COMUM;N;0;CEU AZUL;BH;603941.82;807926.54;5671
+5673;2001305240;B03000;AMEACA;RUA PIRANGUINHO;165;54122;6/6/2001 09:52:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616057.71;799113.24;5672
+5674;2001305249;B03000;AMEACA;AV MEM DE SA;1397;45395;6/6/2001 09:55:00;CIDADAO COMUM;N;PX1397;PARAISO;BH;614236.79;796216.14;5673
+5675;2001305267;B03000;AMEACA;RUA TOME DE SOUZ;395;67998;6/6/2001 10:09:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611948.04;795039.05;5674
+5676;2001305270;B03000;AMEACA;AV AFONSO PENA;867;1259;6/6/2001 10:13:00;INICIATIVA;S;0;CENTRO (BH);BH;611254.14;797008.25;5675
+5677;2001305283;B03000;AMEACA;RUA BELMIRO BRAG;1195;8982;6/6/2001 10:18:00;CIDADAO COMUM;S;AP204;ADELAIDE;BH;607026.45;798575.71;5676
+5678;2001305287;B03000;AMEACA;RUA UNIVERSO;680;70961;6/6/2001 10:18:00;CIDADAO COMUM;S;0;COPACABANA;BH;606119.55;806713.20;5677
+5679;2001305446;B03000;AMEACA;AV DO CONTORNO;3219;17228;6/6/2001 11:52:00;INICIATIVA;S;INICIATIVA DO VP;CENTRO (BH);BH;613212.31;796734.16;5678
+5680;2001305554;B03000;AMEACA;RUA DA BAHIA;1596;81155;6/6/2001 13:01:00;CIDADAO COMUM;S;AP202;LOURDES;BH;611120.55;796111.28;5679
+5681;2001305572;B06000;LESAO CORPORAL;AV OLINTO MEIREL;2632;49847;6/6/2001 13:11:00;CIDADAO COMUM;N;0;SANTA CRUZ (BARR;BH;603957.46;789009.43;5680
+5682;2001305579;B06000;LESAO CORPORAL;RUA AGUAS DE LIN;247;40902;6/6/2001 13:18:00;CIDADAO COMUM;N;CAA;ITAIPU BH;BH;599247.70;788871.68;5681
+5683;2001305696;B03000;AMEACA;RUA FRANCISCO LU;71;29514;6/6/2001 14:34:00;CIDADAO COMUM;N;;SANTA CRUZ;BH;610916.00;802176.45;5682
+5684;2001305756;B03000;AMEACA;AV DOM PEDRO II;3337;53145;6/6/2001 15:10:00;CIDADAO COMUM;N;;ADELAIDE;BH;607614.75;797887.86;5683
+5685;2001305843;B03000;AMEACA;RUA ITAPECERICA;685;35757;6/6/2001 15:54:00;CIDADAO COMUM;N;0;LAGOINHA;BH;610477.87;798369.81;5684
+5686;2001305910;B03000;AMEACA;BECO PEDRA VERDE;182;301698;6/6/2001 16:27:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614697.65;795170.79;5685
+5687;2001305994;B03000;AMEACA;AV DO CONTORNO;6777;17228;6/6/2001 17:10:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610892.04;794878.43;5686
+5688;2001306024;B03000;AMEACA;RUA CRAVEIRO LOP;860;18489;6/6/2001 17:24:00;CIDADAO COMUM;N;GALPAO EXPOMINAS;GAMELEIRA;BH;605727.56;796248.05;5687
+5689;2001306033;B02000;RIXA;RUA ALEXANDRE MA;324;52789;6/6/2001 17:30:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;606006.18;793576.28;5688
+5690;2001306195;B06000;LESAO CORPORAL;AV PETIT;740;53551;6/6/2001 18:43:00;CIDADAO COMUM;S;FU;NOVA VISTA;BH;615847.28;800394.38;5689
+5691;2001306308;B06000;LESAO CORPORAL;RUA LOTUS;510;100564;6/6/2001 19:47:00;CIDADAO COMUM;S;;BETANIA;BH;604905.14;792400.97;5690
+5692;2001306315;B06000;LESAO CORPORAL;RUA CAPITAO GUST;312;32598;6/6/2001 19:45:00;CIDADAO COMUM;S;0;ADELAIDE;BH;607626.17;798233.85;5691
+5693;2001306384;B06000;LESAO CORPORAL;RUA IMBIACA;95;34206;6/6/2001 20:24:00;CIDADAO COMUM;S;;DOM CABRAL;BH;604742.86;797020.53;5692
+5694;2001306488;B03000;AMEACA;RUA NIQUELINA;1445;47738;6/6/2001 21:17:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;614355.92;797450.36;5693
+5695;2001306523;B03000;AMEACA;AV JOAO XXIII;287;37926;6/6/2001 21:35:00;CIDADAO COMUM;S;;CONJUNTO ALIPIO ;BH;604398.40;799487.39;5694
+5696;2001306643;B04001;HOMICIDIO TENTAD;RUA CORURIPE;177;18233;6/6/2001 22:50:00;CIDADAO COMUM;S;0;NOVA GRANADA;BH;607718.16;795040.31;5695
+5697;2001306647;B06000;LESAO CORPORAL;RUA SEIS;84;86174;6/6/2001 22:55:00;CIDADAO COMUM;N;CA4;JAQUELINE;BH;611389.70;810027.38;5696
+5698;2001306653;B06000;LESAO CORPORAL;AV CECILIA PINTO;11;14447;6/6/2001 23:00:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610600.26;805253.80;5697
+5699;2001306657;B06000;LESAO CORPORAL;RUA JOAO ALVES T;446;84963;6/6/2001 23:03:00;CIDADAO COMUM;S;0;MANTIQUEIRA;BH;606089.89;810927.39;5698
+5700;2001306660;B06000;LESAO CORPORAL;RUA DAVIDSON PIM;466;124189;6/6/2001 23:04:00;CIDADAO COMUM;S;;TOPAZIO;BH;607497.32;812001.15;5699
+5701;2001306678;B06000;LESAO CORPORAL;RUA CORCOVADO;1614;14894;6/6/2001 23:18:00;INICIATIVA;S;0;SAO DOMINGOS;BH;607706.18;793576.66;5700
+5702;2001306712;B04001;HOMICIDIO TENTAD;RUA GUAICURUS;446;32009;6/6/2001 23:45:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611231.02;797639.92;5701
+5703;2001306720;B06000;LESAO CORPORAL;RUA DAS TABOADAS;124;300190;6/6/2001 23:51:00;CIDADAO COMUM;S;CSB;SAO JOAO BATISTA;BH;608839.98;808049.60;5702
+5704;2001306736;B09000;ABANDONO DE INCA;RUA FREI ZACARIA;376;37610;7/6/2001 00:03:00;CIDADAO COMUM;S;CAA;SARANDI (URCA/BH;BH;603887.13;802202.26;5703
+5705;2001306746;B03000;AMEACA;RUA ALVARES MACI;591;2756;7/6/2001 00:13:00;POLICIAL MILITAR;S;0;SANTA EFIGENIA;BH;612545.42;796667.48;5704
+5706;2001306768;B03000;AMEACA;RUA MAJOR MESSIA;343;115200;7/6/2001 00:29:00;CIDADAO COMUM;N;0;BANDEIRANTES;BH;604713.16;804349.62;5705
+5707;2001306865;B04001;HOMICIDIO TENTAD;RUA MARIA RITA B;163;121934;7/6/2001 02:36:00;CIDADAO COMUM;S;;INDEPENDENCIA;BH;602335.41;786241.08;5706
+5708;2001306931;B06000;LESAO CORPORAL;RUA DOS CAETES;409;11376;7/6/2001 05:06:00;CIDADAO COMUM;N;PX409;CENTRO (BH);BH;611212.90;797410.52;5707
+5709;2001306986;B03000;AMEACA;RUA ALAIR PEREIR;325;128873;7/6/2001 07:16:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617363.96;797160.02;5708
+5710;2001307031;B03000;AMEACA;RUA CABO FRIO;250;82031;7/6/2001 07:49:00;CIDADAO COMUM;S;CAA;SAO GABRIEL;BH;614311.41;804741.76;5709
+5711;2001307062;B08000;VIOLACAO DE DOMI;AV JOSE BONIFACI;189;38579;7/6/2001 08:08:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610210.56;798939.37;5710
+5712;2001307250;B06000;LESAO CORPORAL;AV SILVIANO BRAN;444;66002;7/6/2001 10:07:00;CIDADAO COMUM;S;0;SAGRADA FAMILIA;BH;612009.58;798561.76;5711
+5713;2001307252;B06000;LESAO CORPORAL;RUA ESCRAVO ISID;572;25885;7/6/2001 10:09:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609868.46;799047.90;5712
+5714;2001307268;B06000;LESAO CORPORAL;RUA H;12;78295;7/6/2001 10:27:00;CIDADAO COMUM;S;0;VILA PINHO;BH;601931.42;788161.20;5713
+5715;2001307358;B03000;AMEACA;RUA CONSELHEIRO ;25;17054;7/6/2001 11:27:00;CIDADAO COMUM;N;;ALTO DOS CAICARA;BH;608118.02;799129.56;5714
+5716;2001307564;B03000;AMEACA;RUA GONCALVES DI;1896;31513;7/6/2001 14:09:00;CIDADAO COMUM;N;;LOURDES;BH;610731.97;795987.14;5715
+5717;2001307635;B04001;HOMICIDIO TENTAD;RUA ITAIPU;787;35439;7/6/2001 14:38:00;INICIATIVA;N;0;VERA CRUZ;BH;616254.15;798399.12;5716
+5718;2001307790;B06000;LESAO CORPORAL;RUA OURO PRETO;573;50730;7/6/2001 16:10:00;INICIATIVA;N;0;BARRO PRETO;BH;609882.70;796735.88;5717
+5719;2001307850;B06000;LESAO CORPORAL;RUA AURELIANO MA;107;6845;7/6/2001 16:39:00;CIDADAO COMUM;S;;PARAISO;BH;615050.99;797005.85;5718
+5720;2001307919;B06000;LESAO CORPORAL;RUA DEPUTADO RAI;147;83438;7/6/2001 17:17:00;CIDADAO COMUM;S;;MARIZE;BH;610957.10;807744.36;5719
+5721;2001307955;B06000;LESAO CORPORAL;RUA JOAO SOARES ;23;74111;7/6/2001 17:32:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607768.98;811531.53;5720
+5722;2001308062;B03000;AMEACA;RUA ITAQUERA;843;35920;7/6/2001 18:18:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611598.52;799291.25;5721
+5723;2001308099;B03000;AMEACA;RUA ONZE DE DEZE;110;112687;7/6/2001 18:33:00;CIDADAO COMUM;S;CAA;LEONINA;BH;608758.16;793565.97;5722
+5724;2001308173;B03000;AMEACA;RUA CARMELITA PR;722;17316;7/6/2001 19:05:00;CIDADAO COMUM;S;;SALGADO FILHO;BH;606261.79;794694.17;5723
+5725;2001308181;B03000;AMEACA;RUA MANOEL PASSO;450;43160;7/6/2001 19:08:00;CIDADAO COMUM;S;CSA;VILA HUMAITA;BH;610453.77;801846.66;5724
+5726;2001308244;B03000;AMEACA;RUA CUCO;652;90112;7/6/2001 19:33:00;CIDADAO COMUM;S;;GOIANIA;BH;615741.29;803187.70;5725
+5727;2001308250;B03000;AMEACA;AV OLEGARIO MACI;742;49699;7/6/2001 19:36:00;CIDADAO COMUM;S;;LOURDES;BH;610475.34;796973.70;5726
+5728;2001308307;B06000;LESAO CORPORAL;AV OLINTO MEIREL;1500;49847;7/6/2001 20:06:00;CIDADAO COMUM;S;0;MILIONARIOS;BH;603642.11;789991.70;5727
+5729;2001308317;B03000;AMEACA;RUA DR RAUL DE B;9;57956;7/6/2001 20:10:00;INICIATIVA;S;0;CASA BRANCA;BH;616356.49;799755.26;5728
+5730;2001308336;B06000;LESAO CORPORAL;RUA AUGUSTA ANDR;1240;99104;7/6/2001 20:21:00;CIDADAO COMUM;S;REF:PROXIMO FINA;JAQUELINE;BH;611721.24;810630.60;5729
+5731;2001308356;B06000;LESAO CORPORAL;RUA CAMPINA VERD;312;12110;7/6/2001 20:34:00;CIDADAO COMUM;S;0;SALGADO FILHO;BH;606172.49;794445.71;5730
+5732;2001308400;B03000;AMEACA;RUA NELSON SOARE;235;47463;7/6/2001 20:53:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612344.14;800069.91;5731
+5733;2001308423;B03000;AMEACA;AV ARTUR GUIMARA;1010;6151;7/6/2001 21:05:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610759.65;802050.82;5732
+5734;2001308424;B06000;LESAO CORPORAL;RUA SERRA DOS OR;138;40578;7/6/2001 21:05:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615451.58;807727.88;5733
+5735;2001308484;B03000;AMEACA;RUA JACUI;2722;36734;7/6/2001 21:40:00;CIDADAO COMUM;N;;NOVA FLORESTA;BH;611430.18;800387.15;5734
+5736;2001308533;B06000;LESAO CORPORAL;RUA DAS DRACENAS;427;33461;7/6/2001 22:03:00;CIDADAO COMUM;N;;LINDEIA;BH;598862.48;790625.78;5735
+5737;2001308701;B06000;LESAO CORPORAL;AV A;679;34099;7/6/2001 23:55:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612341.99;807254.84;5736
+5738;2001308802;B03000;AMEACA;RUA AUGUSTUS WIL;321;50090;8/6/2001 01:14:00;CIDADAO COMUM;S;;SANTA AMELIA;BH;607670.65;806516.20;5737
+5739;2001308803;B06000;LESAO CORPORAL;RUA JOAO LUIZ DE;360;37765;8/6/2001 01:15:00;CIDADAO COMUM;S;0;NOVA CACHOEIRINH;BH;609312.42;800902.42;5738
+5740;2001308967;B03000;AMEACA;AV PARANA;122;52230;8/6/2001 06:07:00;INICIATIVA;N;0;CENTRO (BH);BH;610785.23;797422.18;5739
+5741;2001309085;B03000;AMEACA;RUA CACHOEIRA DO;328;11234;8/6/2001 08:10:00;POLICIAL CIVIL;N;0;SANTA EFIGENIA;BH;614546.78;797375.65;5740
+5742;2001309250;B03000;AMEACA;AV URUGUAI;335;71113;8/6/2001 09:38:00;CIDADAO COMUM;S;SL14;SION;BH;611750.13;793745.62;5741
+5743;2001309509;B06000;LESAO CORPORAL;AV ERICO VERISSI;777;41671;8/6/2001 12:12:00;INICIATIVA;N;0;CANDELARIA;BH;607923.53;808663.31;5742
+5744;2001309569;B06000;LESAO CORPORAL;RUA AMANDA;350;91317;8/6/2001 12:53:00;CIDADAO COMUM;N;;CONJUNTO VISTA A;BH;605638.25;792913.17;5743
+5745;2001309636;B03000;AMEACA;RUA CARAVELAS;191;13141;8/6/2001 13:39:00;CIDADAO COMUM;S;CA1;VERA CRUZ;BH;615541.02;798435.24;5744
+5746;2001309686;B06000;LESAO CORPORAL;RUA GUAICURUS;451;32009;8/6/2001 14:14:00;CIDADAO COMUM;N;PX428;CENTRO (BH);BH;611210.22;797600.57;5745
+5747;2001309744;B03000;AMEACA;BECO PRIMEIRO DE;75;302438;8/6/2001 14:51:00;INICIATIVA;S;0;MANTIQUEIRA;BH;607062.15;811576.33;5746
+5748;2001309976;B03000;AMEACA;RUA BARBOSA;39;51178;8/6/2001 17:00:00;CIDADAO COMUM;N;0;COQUEIROS;BH;603046.78;799686.07;5747
+5749;2001309980;B06000;LESAO CORPORAL;RUA PONTE NOVA;888;54655;8/6/2001 17:03:00;CIDADAO COMUM;N;;FLORESTA;BH;611744.63;798218.29;5748
+5750;2001310074;B03000;AMEACA;RUA DOS GOITACAZ;771;31400;8/6/2001 18:01:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610520.96;796873.90;5749
+5751;2001310083;B03000;AMEACA;RUA JACUI;2722;36734;8/6/2001 18:04:00;CIDADAO COMUM;N;CASA 08;NOVA FLORESTA;BH;611430.18;800387.15;5750
+5752;2001310141;B06000;LESAO CORPORAL;RUA I;295;41454;8/6/2001 18:34:00;CIDADAO COMUM;S;;CH CONFISCO;BH;602797.84;802986.83;5751
+5753;2001310154;B06000;LESAO CORPORAL;RUA PROFESSOR MA;697;42498;8/6/2001 18:39:00;CIDADAO COMUM;S;CJ901;LIBERDADE;BH;609041.43;803974.87;5752
+5754;2001310310;B06000;LESAO CORPORAL;RUA DES SARAIVA;1075;66535;8/6/2001 20:03:00;CIDADAO COMUM;S;CS1;VERA CRUZ;BH;616101.45;797681.72;5753
+5755;2001310334;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;8/6/2001 20:18:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;5754
+5756;2001310337;B04002;HOMICIDIO CONSUM;AV OTACILIO NEGR;17676;50566;8/6/2001 20:18:00;CIDADAO COMUM;N;0;JARDIM ATLANTICO;BH;607848.71;805488.96;5755
+5757;2001310355;B03000;AMEACA;RUA CARLOS PINTO;325;107220;8/6/2001 20:32:00;CIDADAO COMUM;S;;CH JATOBA IV;BH;600627.32;787544.42;5756
+5758;2001310454;B03000;AMEACA;RUA RAIMUNDO TIN;50;301229;8/6/2001 21:29:00;INICIATIVA;S;0;MORRO DO PAPAGAI;BH;610762.74;793311.54;5757
+5759;2001310655;B04001;HOMICIDIO TENTAD;RUA POUSO ALEGRE;94;54932;8/6/2001 23:15:00;CIDADAO COMUM;S;0;FLORESTA;BH;611136.07;797991.21;5758
+5760;2001310678;B04001;HOMICIDIO TENTAD;ESTRADA DO CERCA;1035;26428;8/6/2001 23:29:00;INICIATIVA;0;0;JARDIM AMERICA;BH;607094.07;794616.79;5759
+5761;2001310683;B03000;AMEACA;RUA RENATO GONCA;31;14475;8/6/2001 23:32:00;CIDADAO COMUM;S;0;DOM JOAQUIM;BH;613661.46;801938.79;5760
+5762;2001310706;B06000;LESAO CORPORAL;RUA BRUGES;190;86694;8/6/2001 23:44:00;CIDADAO COMUM;N;;JARDIM EUROPA;BH;608594.89;810230.41;5761
+5763;2001310715;B06000;LESAO CORPORAL;RUA FRANCISCO BI;2370;29353;8/6/2001 23:51:00;INICIATIVA;S;;ADELAIDE;BH;607087.54;798984.64;5762
+5764;2001310746;B04001;HOMICIDIO TENTAD;RUA FERNAO DIAS;771;28133;9/6/2001 00:07:00;INICIATIVA;S;INICIATIVA DO HT;CAETANO FURQUIM;BH;615918.16;799039.80;5763
+5765;2001310802;B06000;LESAO CORPORAL;AV PRESIDENTE AN;191;4461;9/6/2001 00:43:00;POLICIAL MILITAR;S;;LAGOINHA;BH;610755.18;798205.83;5764
+5766;2001310805;B04001;HOMICIDIO TENTAD;RUA TREZE DE SET;180;69168;9/6/2001 00:43:00;CIDADAO COMUM;N;REF:FINAL 9202;LEONINA;BH;608442.23;793344.13;5765
+5767;2001310871;B04002;HOMICIDIO CONSUM;RUA QUELUZITA;12;40915;9/6/2001 01:32:00;CIDADAO COMUM;N;0;SAO PAULO;BH;612785.37;802514.84;5766
+5768;2001310879;B06000;LESAO CORPORAL;RUA ARIOLINO ARI;159;85811;9/6/2001 01:38:00;CIDADAO COMUM;N;;SERRA VERDE;BH;609207.39;810119.05;5767
+5769;2001310902;B03000;AMEACA;RUA RIO DE JANEI;842;58772;9/6/2001 01:55:00;CIDADAO COMUM;S;FR842;CENTRO (BH);BH;611039.08;796883.84;5768
+5770;2001310942;B04002;HOMICIDIO CONSUM;RUA TRES MARIAS;32;68833;9/6/2001 02:26:00;CIDADAO COMUM;N;0;SANTA CRUZ (BARR;BH;603509.09;788918.41;5769
+5771;2001310981;B06000;LESAO CORPORAL;RUA DOS GUAJAJAR;1022;32037;9/6/2001 02:53:00;INICIATIVA;S;INICIATIVA POV6.;CENTRO BH;BH;610486.05;796628.40;5770
+5772;2001310986;B03000;AMEACA;RUA QUARENTA E U;102;34801;9/6/2001 02:58:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612521.64;807196.19;5771
+5773;2001311035;B06000;LESAO CORPORAL;RUA ALMIRANTE AL;700;2494;9/6/2001 03:46:00;INICIATIVA;S;0;GUTIERREZ;BH;609108.08;795079.04;5772
+5774;2001311042;B06000;LESAO CORPORAL;RUA DAS PRINCESA;367;55330;9/6/2001 03:50:00;CIDADAO COMUM;S;;VILA OESTE;BH;603936.55;795087.90;5773
+5775;2001311043;B06000;LESAO CORPORAL;RUA SERGIPE;1221;64961;9/6/2001 03:50:00;CIDADAO COMUM;S;;FUNCIONARIOS;BH;611202.39;795153.85;5774
+5776;2001311055;B03000;AMEACA;RUA ESPIRITO SAN;946;26052;9/6/2001 04:01:00;CIDADAO COMUM;S;AP301;CENTRO (BH);BH;611138.96;796746.01;5775
+5777;2001311072;B06000;LESAO CORPORAL;AV JEQUITINHONHA;231;37305;9/6/2001 04:15:00;INICIATIVA;N;0;VERA CRUZ;BH;615747.31;798399.78;5776
+5778;2001311117;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;3929;17095;9/6/2001 05:02:00;INICIATIVA;N;0;SAGRADA FAMILIA;BH;613749.08;798435.50;5777
+5779;2001311135;B06000;LESAO CORPORAL;AV DOS ANDRADAS;364;3761;9/6/2001 05:23:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611480.30;797265.49;5778
+5780;2001311248;B02000;RIXA;RUA PADRE PEDRO ;2630;51657;9/6/2001 08:06:00;CIDADAO COMUM;S;;JARDIM EUROPA;BH;607686.72;809797.55;5779
+5781;2001311338;B04001;HOMICIDIO TENTAD;RUA JEQUIRICA;357;37258;9/6/2001 09:03:00;CIDADAO COMUM;N;CAC;CONCORDIA;BH;611192.98;799637.47;5780
+5782;2001311399;B03000;AMEACA;RUA SAO LAZARO;70;63219;9/6/2001 09:51:00;CIDADAO COMUM;S;FUNDOS;SAGRADA FAMILIA;BH;612389.37;798744.88;5781
+5783;2001311455;B03000;AMEACA;RUA OTAVIANO PEN;549;128454;9/6/2001 10:31:00;CIDADAO COMUM;S;0;SERRA VERDE;BH;609655.77;810567.19;5782
+5784;2001311507;B06000;LESAO CORPORAL;RUA JACUI;487;36734;9/6/2001 11:10:00;CIDADAO COMUM;N;0;FLORESTA;BH;611774.16;798289.34;5783
+5785;2001311529;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;345;6731;9/6/2001 11:26:00;INICIATIVA;N;0;CENTRO (BH);BH;611069.26;796574.94;5784
+5786;2001311536;B06000;LESAO CORPORAL;AV VILARINHOS;2640;109988;9/6/2001 11:30:00;CIDADAO COMUM;S;;JARDIM EUROPA;BH;607859.01;809852.86;5785
+5787;2001311570;B06000;LESAO CORPORAL;RUA DEZESSETE;291;32862;9/6/2001 11:56:00;CIDADAO COMUM;N;CAA;CONJUNTO FELICID;BH;612252.68;807568.31;5786
+5788;2001311574;B06000;LESAO CORPORAL;RUA EXPEDITO RIB;406;41467;9/6/2001 11:58:00;CIDADAO COMUM;S;;VILA SUZANA;BH;611755.26;803117.98;5787
+5789;2001311597;B03000;AMEACA;AV NOSSA SENHORA;316;48311;9/6/2001 12:14:00;CIDADAO COMUM;S;0;PRIMEIRO DE NOVE;BH;612821.93;805191.13;5788
+5790;2001311689;B06000;LESAO CORPORAL;RUA PARA DE MINA;275;52070;9/6/2001 13:21:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606411.19;797635.97;5789
+5791;2001311721;B03000;AMEACA;AV AMERICO VESPU;954;3355;9/6/2001 13:37:00;CIDADAO COMUM;S;CAA;APARECIDA;BH;609067.36;800150.52;5790
+5792;2001311724;B03000;AMEACA;RUA DES BARCELOS;450;19904;9/6/2001 13:39:00;CIDADAO COMUM;S;;NOVA SUISSA;BH;607399.05;796128.14;5791
+5793;2001311814;B03000;AMEACA;AV CRISTIANO MAC;2000;18652;9/6/2001 14:43:00;CIDADAO COMUM;S;0;CIDADE NOVA;BH;612196.70;800379.26;5792
+5794;2001311829;B02000;RIXA;RUA AUGUSTO FRAN;300;69230;9/6/2001 14:51:00;CIDADAO COMUM;N;0;SAO JOAO BATISTA;BH;608837.25;807592.10;5793
+5795;2001311830;B06000;LESAO CORPORAL;AV PRESIDENTE TA;746;35366;9/6/2001 14:55:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;605537.23;799893.01;5794
+5796;2001311831;B04001;HOMICIDIO TENTAD;RUA BRAGANCA;2;109092;9/6/2001 14:56:00;CIDADAO COMUM;N;CA02;COQUEIROS;BH;602175.97;799441.69;5795
+5797;2001311853;B03000;AMEACA;RUA ALCIDES PERE;236;107711;9/6/2001 15:06:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606777.90;811900.92;5796
+5798;2001311954;B03000;AMEACA;RUA KIMBERLITA;201;57190;9/6/2001 16:07:00;CIDADAO COMUM;S;;SANTA TEREZA;BH;613732.10;797577.05;5797
+5799;2001311969;B06000;LESAO CORPORAL;RUA JUIZ ELYSEU ;285;62588;9/6/2001 16:14:00;CIDADAO COMUM;S;0;DAS INDUSTRIAS;BH;603441.90;792866.98;5798
+5800;2001311977;B03000;AMEACA;RUA SAO LAZARO;70;63219;9/6/2001 16:17:00;CIDADAO COMUM;N;;SAGRADA FAMILIA;BH;612389.37;798744.88;5799
+5801;2001312028;B06000;LESAO CORPORAL;RUA PROFESSOR ZI;317;55718;9/6/2001 16:46:00;CIDADAO COMUM;N;;MINAS BRASIL;BH;605757.79;797222.69;5800
+5802;2001312052;B06000;LESAO CORPORAL;RUA GUARAREMA;65;111010;9/6/2001 17:04:00;CIDADAO COMUM;N;CAA;CACHOEIRINHA;BH;610247.41;801060.78;5801
+5803;2001312055;B06000;LESAO CORPORAL;RUA FARMACEUTICO;16;61733;9/6/2001 17:06:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605821.57;793571.67;5802
+5804;2001312057;B03000;AMEACA;RUA CARLOS DE LA;46;13371;9/6/2001 17:06:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;607983.09;807505.27;5803
+5805;2001312076;B06000;LESAO CORPORAL;RUA ESCRITOR HUM;9;129659;9/6/2001 17:14:00;CIDADAO COMUM;N;;TUPI;BH;613614.95;806792.88;5804
+5806;2001312081;B06000;LESAO CORPORAL;AV PRESIDENTE AN;7267;4461;9/6/2001 17:18:00;CIDADAO COMUM;N;;LIBERDADE;BH;608919.61;803884.14;5805
+5807;2001312151;B03000;AMEACA;RUA CARMELA ALUO;259;13558;9/6/2001 17:57:00;CIDADAO COMUM;N;0;BONSUCESSO;BH;605218.59;789645.48;5806
+5808;2001312184;B03000;AMEACA;RUA PONTA GROSSA;200;14900;9/6/2001 18:10:00;CIDADAO COMUM;N;0;ARAGUAIA;BH;604860.92;789716.01;5807
+5809;2001312219;B03000;AMEACA;RUA CASTRO ALVES;232;14103;9/6/2001 18:28:00;CIDADAO COMUM;N;A;COPACABANA;BH;605790.25;806502.86;5808
+5810;2001312285;B06000;LESAO CORPORAL;AV DOS JARDINS;409;117290;9/6/2001 19:05:00;CIDADAO COMUM;N;;LINDEIA;BH;599962.61;790648.30;5809
+5811;2001312309;B03000;AMEACA;RUA PALESTINA;50;51861;9/6/2001 19:15:00;CIDADAO COMUM;S;;SAO SALVADOR;BH;603317.09;799323.41;5810
+5812;2001312310;B06000;LESAO CORPORAL;RUA LUCIA MIGUEL;383;41555;9/6/2001 19:15:00;POLICIAL MILITAR;S;0;TUPI;BH;612536.99;806309.34;5811
+5813;2001312365;B06000;LESAO CORPORAL;RUA 18;32;21828;9/6/2001 19:42:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;608204.82;811136.31;5812
+5814;2001312436;B06000;LESAO CORPORAL;RUA STA RITA DUR;759;61270;9/6/2001 20:19:00;CIDADAO COMUM;S;AP201;FUNCIONARIOS;BH;611737.20;795391.37;5813
+5815;2001312482;B04001;HOMICIDIO TENTAD;RUA PROFESSOR CO;284;57310;9/6/2001 20:48:00;POLICIAL MILITAR;S;;PLANALTO;BH;609325.21;806811.45;5814
+5816;2001312528;B06000;LESAO CORPORAL;RUA CURITIBANOS;837;19107;9/6/2001 21:18:00;CIDADAO COMUM;S;;JARDIM AMERICA;BH;607514.33;793818.10;5815
+5817;2001312559;B06000;LESAO CORPORAL;AV DO CONTORNO;5602;17228;9/6/2001 21:34:00;CIDADAO COMUM;S;;CARMO;BH;611910.43;794907.67;5816
+5818;2001312574;B03000;AMEACA;RUA ZOROASTRO DE;54;74064;9/6/2001 21:43:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604415.82;797027.21;5817
+5819;2001312602;B06000;LESAO CORPORAL;RUA ARTHUR LUCCH;730;83277;9/6/2001 21:56:00;CIDADAO COMUM;N;0;SANTA HELENA (BH;BH;603564.41;789534.30;5818
+5820;2001312631;B06000;LESAO CORPORAL;RUA LAURA SOARES;240;100867;9/6/2001 22:13:00;CIDADAO COMUM;S;0;FLORAMAR;BH;611217.50;807328.23;5819
+5821;2001312667;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;4000;18652;9/6/2001 22:33:00;INICIATIVA;S;0;DOS PALMARES;BH;612434.91;802092.92;5820
+5822;2001312712;B04001;HOMICIDIO TENTAD;RUA ALTINOPOLIS;585;36296;9/6/2001 23:01:00;CIDADAO COMUM;S;;PIRATININGA;BH;605592.82;809341.84;5821
+5823;2001312745;B04001;HOMICIDIO TENTAD;RUA PAPOULA AZUL;51;119774;9/6/2001 23:21:00;CIDADAO COMUM;S;;HAVAI;BH;606864.21;793618.62;5822
+5824;2001312792;B04002;HOMICIDIO CONSUM;RUA ANAPURUS;600;20894;9/6/2001 23:48:00;CIDADAO COMUM;N;0;SAO GABRIEL;BH;613458.94;804196.63;5823
+5825;2001312851;B06000;LESAO CORPORAL;RUA CAVAQUINHO;15;301465;10/6/2001 00:31:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;614161.77;795395.78;5824
+5826;2001312904;B03000;AMEACA;RUA DINIS DIAS;145;119673;10/6/2001 01:13:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616573.20;797526.82;5825
+5827;2001312925;B06000;LESAO CORPORAL;RUA J;320;47350;10/6/2001 01:26:00;CIDADAO COMUM;S;;VILA CASTANHEIRA;BH;601249.95;788553.98;5826
+5828;2001312937;B04001;HOMICIDIO TENTAD;RUA JOSE BARBOSA;197;85304;10/6/2001 01:34:00;CIDADAO COMUM;S;;JAQUELINE;BH;610514.81;810125.87;5827
+5829;2001312972;B06000;LESAO CORPORAL;RUA BETULA;90;9500;10/6/2001 01:53:00;CIDADAO COMUM;N;;ARAGUAIA;BH;604981.38;789649.75;5828
+5830;2001312987;B03000;AMEACA;RUA URSULA PAULI;985;71066;10/6/2001 02:01:00;CIDADAO COMUM;S;;BETANIA;BH;606238.79;793107.91;5829
+5831;2001313063;B04001;HOMICIDIO TENTAD;RUA TIRADENTES;80;85607;10/6/2001 02:53:00;CIDADAO COMUM;S;;ALVORADA;BH;615497.04;802314.39;5830
+5832;2001313122;B04002;HOMICIDIO CONSUM;RUA SAO GERALDO;10;170283;10/6/2001 03:31:00;CIDADAO COMUM;N;0;CABANA;BH;604668.39;794124.46;5831
+5833;2001313145;B03000;AMEACA;RUA DA BAHIA;479;81155;10/6/2001 03:53:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611431.82;797150.49;5832
+5834;2001313165;B06000;LESAO CORPORAL;RUA GUAICURUS;690;32009;10/6/2001 04:08:00;INICIATIVA;N;0;CENTRO BH;BH;611000.88;797693.04;5833
+5835;2001313315;B03000;AMEACA;RUA FRANCISCA LE;212;29441;10/6/2001 07:58:00;INICIATIVA;N;0;UNIAO;BH;613207.57;800943.92;5834
+5836;2001313329;B04001;HOMICIDIO TENTAD;RUA AVELINO DOS ;132;6990;10/6/2001 08:13:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;608938.77;798986.00;5835
+5837;2001313355;B06000;LESAO CORPORAL;RUA JOAO NEPOMUC;83;124176;10/6/2001 08:36:00;INICIATIVA;S;INIC.VP5867;JARDIM DOS COMER;BH;607184.27;811813.31;5836
+5838;2001313365;B04001;HOMICIDIO TENTAD;RUA JOAQUINA ANG;151;84761;10/6/2001 08:47:00;CIDADAO COMUM;N;PANIFICADORA BRA;DA LAGOA;BH;604460.97;809500.24;5837
+5839;2001313408;B06000;LESAO CORPORAL;AV ERICO VERISSI;1001;41671;10/6/2001 09:28:00;CIDADAO COMUM;N;AP301;SANTA MONICA;BH;607738.22;808727.73;5838
+5840;2001313549;B03000;AMEACA;RUA GERALDO RIBE;127;43680;10/6/2001 11:24:00;CIDADAO COMUM;S;CAA;NOVO GLORIA;BH;603097.99;798785.86;5839
+5841;2001313561;B03000;AMEACA;RUA TRES;98;32301;10/6/2001 11:36:00;CIDADAO COMUM;N;;CONJUNTO FELICID;BH;612209.41;807411.82;5840
+5842;2001313598;B03000;AMEACA;RUA FLORESTAL;36;123611;10/6/2001 12:04:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613828.23;799199.35;5841
+5843;2001313650;B03000;AMEACA;AV CORONEL DURVA;860;17688;10/6/2001 12:46:00;CIDADAO COMUM;S;;DURVAL DE BARROS;BH;598151.28;790894.64;5842
+5844;2001313720;B03000;AMEACA;RUA PROFESSOR MA;637;42498;10/6/2001 13:32:00;CIDADAO COMUM;S;;SAO LUIZ;BH;609027.03;804041.57;5843
+5845;2001313735;B03000;AMEACA;RUA RIO DE JANEI;430;58772;10/6/2001 13:43:00;INICIATIVA;N;0;CENTRO (BH);BH;611148.38;797276.61;5844
+5846;2001313791;B04001;HOMICIDIO TENTAD;RUA SEBASTIAO MO;390;93555;10/6/2001 14:36:00;INICIATIVA;S;0;TIROL;BH;600537.35;789420.62;5845
+5847;2001313803;B03000;AMEACA;RUA VIOLETA DE M;430;80253;10/6/2001 14:44:00;CIDADAO COMUM;S;BECO SAO JOAO;SAO JOSE;BH;604587.45;799319.51;5846
+5848;2001313812;B03000;AMEACA;RUA SANTO ANDRE;55;26282;10/6/2001 14:56:00;CIDADAO COMUM;S;CAB;TAQUARIL;BH;617350.27;797630.94;5847
+5849;2001313846;B06000;LESAO CORPORAL;RUA MARCO AURELI;137;61821;10/6/2001 15:15:00;CIDADAO COMUM;S;CAA;NAZARE;BH;615636.15;804705.79;5848
+5850;2001313934;B06000;LESAO CORPORAL;RUA CRUZEIRO DO ;170;18927;10/6/2001 15:57:00;CIDADAO COMUM;N;0;SANTA HELENA (BH;BH;603493.85;789033.21;5849
+5851;2001313947;B03000;AMEACA;RUA WALDEMAR FAL;92;36429;10/6/2001 16:02:00;CIDADAO COMUM;S;0;PLANALTO;BH;610846.65;806603.67;5850
+5852;2001313989;B03000;AMEACA;RUA PURUS;668;55819;10/6/2001 16:22:00;CIDADAO COMUM;S;;CONCORDIA;BH;610705.32;799540.90;5851
+5853;2001313990;B06000;LESAO CORPORAL;RUA GALENA;79;30491;10/6/2001 16:22:00;CIDADAO COMUM;S;AP01;LAGOINHA;BH;611030.10;798682.21;5852
+5854;2001313995;B03000;AMEACA;AV BIAS FORTES;1526;9553;10/6/2001 16:26:00;CIDADAO COMUM;S;0;BARRO PRETO;BH;610343.53;796985.22;5853
+5855;2001314100;B03000;AMEACA;AV AUGUSTO DE LI;1324;6731;10/6/2001 17:16:00;CIDADAO COMUM;S;AP701;BARRO PRETO;BH;610063.55;796892.75;5854
+5856;2001314150;B06000;LESAO CORPORAL;RUA JOVIANO COEL;55;39294;10/6/2001 17:35:00;CIDADAO COMUM;S;;RIO BRANCO;BH;606857.20;808664.47;5855
+5857;2001314246;B04001;HOMICIDIO TENTAD;RUA DOUTOR CRIST;390;55598;10/6/2001 18:19:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604864.19;789415.74;5856
+5858;2001314279;B06000;LESAO CORPORAL;RUA STO ANTONIO;207;61759;10/6/2001 18:36:00;CIDADAO COMUM;S;0;SAO TOMAZ;BH;609983.70;805566.23;5857
+5859;2001314296;B02000;RIXA;RUA CALDAS DA RA;575;61100;10/6/2001 18:46:00;CIDADAO COMUM;N;CAFU;SAO FRANCISCO;BH;609793.95;802422.17;5858
+5860;2001314303;B06000;LESAO CORPORAL;RUA CARMO DA MAT;644;13661;10/6/2001 18:47:00;CIDADAO COMUM;N;;VERA CRUZ;BH;615391.83;797554.64;5859
+5861;2001314331;B03000;AMEACA;AV SILVA LOBO;1035;65889;10/6/2001 19:00:00;INICIATIVA;N;0;NOVA GRANADA;BH;607680.38;795529.41;5860
+5862;2001314355;B06000;LESAO CORPORAL;RUA MARMORE;588;44695;10/6/2001 19:13:00;INICIATIVA;N;0;SANTA TEREZA;BH;613395.01;797414.73;5861
+5863;2001314372;B03000;AMEACA;RUA GERALDO FRAN;45;86060;10/6/2001 19:21:00;CIDADAO COMUM;S;;JAQUELINE;BH;611229.28;810256.18;5862
+5864;2001314382;B03000;AMEACA;RUA MONTE SIAO;573;46559;10/6/2001 19:25:00;INICIATIVA;N;0;SERRA;BH;613412.29;795061.49;5863
+5865;2001314428;B06000;LESAO CORPORAL;RUA FERNAO DIAS;840;28133;10/6/2001 19:46:00;INICIATIVA;S;0;CAETANO FURQUIM;BH;615877.50;799055.02;5864
+5866;2001314431;B02000;RIXA;RUA EDNA BRANDAO;75;99160;10/6/2001 19:47:00;INICIATIVA;S;0;SANTA AMELIA;BH;606976.14;805701.15;5865
+5867;2001314449;B02000;RIXA;RUA JOSE DE OLIV;72;63161;10/6/2001 19:58:00;CIDADAO COMUM;S;;ARAGUAIA;BH;604164.27;789183.07;5866
+5868;2001314488;B05000;SEQUESTRO E CARC;RUA VERONA;261;71661;10/6/2001 20:12:00;CIDADAO COMUM;S;;BANDEIRANTES;BH;605870.97;803359.12;5867
+5869;2001314508;B06000;LESAO CORPORAL;AV TERESA CRISTI;869;67512;10/6/2001 20:24:00;CIDADAO COMUM;S;0;CARLOS PRATES;BH;608268.22;797339.78;5868
+5870;2001314523;B03000;AMEACA;RUA JOSE JACINTO;270;67538;10/6/2001 20:31:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604623.93;791960.37;5869
+5871;2001314617;B06000;LESAO CORPORAL;AV ERICO VERISSI;561;41671;10/6/2001 21:25:00;INICIATIVA;N;0;CANDELARIA;BH;608128.88;808577.02;5870
+5872;2001314649;B03000;AMEACA;RUA ADAMINA;234;993;10/6/2001 21:38:00;CIDADAO COMUM;N;CSA;SANTA TEREZA;BH;613193.20;797342.09;5871
+5873;2001314738;B06000;LESAO CORPORAL;AV PRESIDENTE CA;3001;55125;10/6/2001 22:31:00;CIDADAO COMUM;S;;CAICARA;BH;608178.06;800324.32;5872
+5874;2001314752;B04001;HOMICIDIO TENTAD;RUA SAO FELICISS;51;62373;10/6/2001 22:44:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605772.68;792439.17;5873
+5875;2001314780;B04001;HOMICIDIO TENTAD;RUA SAO TOMAS DE;739;63782;10/6/2001 23:03:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610819.02;793333.13;5874
+5876;2001314795;B03000;AMEACA;RUA NARCISA PERE;90;78720;10/6/2001 23:11:00;CIDADAO COMUM;N;0;CH JATOBA IV;BH;600614.17;787750.61;5875
+5877;2001314946;B04001;HOMICIDIO TENTAD;RUA PADRE PETROL;31;53577;11/6/2001 01:22:00;INICIATIVA;S;0;SAGRADA FAMILIA;BH;612764.71;799184.30;5876
+5878;2001315078;B06000;LESAO CORPORAL;AV AFONSO PENA;398;1259;11/6/2001 05:06:00;CIDADAO COMUM;S;PX398;CENTRO (BH);BH;610976.65;797364.82;5877
+5879;2001315356;B06000;LESAO CORPORAL;RUA NILOPOLIS;50;87441;11/6/2001 09:52:00;INICIATIVA;S;0;PILAR;BH;608050.29;788327.07;5878
+5880;2001315390;B03000;AMEACA;RUA CLARA;31;171840;11/6/2001 10:08:00;CIDADAO COMUM;N;;VILA CEMIG;BH;605580.88;788660.00;5879
+5881;2001315428;B06000;LESAO CORPORAL;RUA PIUMA;413;92855;11/6/2001 10:31:00;CIDADAO COMUM;N;;SAO SALVADOR;BH;602763.71;799950.93;5880
+5882;2001315497;B06000;LESAO CORPORAL;RUA DOS APIACAS;76;5032;11/6/2001 11:20:00;CIDADAO COMUM;S;0;GLORIA;BH;602560.03;798017.10;5881
+5883;2001315634;B03000;AMEACA;RUA MARIA APAREC;77;116849;11/6/2001 13:12:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610181.84;802182.01;5882
+5884;2001315672;B03000;AMEACA;RUA MARIA APAREC;115;43853;11/6/2001 13:42:00;POLICIAL MILITAR;N;0;SAO MARCOS;BH;613924.81;802705.15;5883
+5885;2001315799;B06000;LESAO CORPORAL;RUA FREI GASPAR;157;29886;11/6/2001 15:14:00;CIDADAO COMUM;S;0;CABANA;BH;604297.25;794201.39;5884
+5886;2001315820;B03000;AMEACA;RUA SEBASTIAO EV;55;100104;11/6/2001 15:29:00;CIDADAO COMUM;S;;SAO MARCOS;BH;614617.98;802826.35;5885
+5887;2001315851;B06000;LESAO CORPORAL;RUA HUMBERTO DE ;581;33590;11/6/2001 15:46:00;CIDADAO COMUM;S;;COPACABANA;BH;606089.56;807059.06;5886
+5888;2001316035;B06000;LESAO CORPORAL;RUA CINCO DE JAN;6;119604;11/6/2001 17:24:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616273.08;799779.17;5887
+5889;2001316103;B03000;AMEACA;AV DOM PEDRO II;4155;53145;11/6/2001 17:55:00;CIDADAO COMUM;S;CAFU;PADRE EUSTAQUIO;BH;606790.98;797901.91;5888
+5890;2001316117;B06000;LESAO CORPORAL;RUA BRANDAO;32;10360;11/6/2001 18:03:00;CIDADAO COMUM;S;0;EYMARD;BH;613565.17;803366.01;5889
+5891;2001316141;B06000;LESAO CORPORAL;RUA MARIA AMELIA;520;43812;11/6/2001 18:16:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610736.86;805313.62;5890
+5892;2001316202;B03000;AMEACA;RUA MEDEIA;143;64426;11/6/2001 18:49:00;CIDADAO COMUM;S;A;VILA CAPRI;BH;608606.25;809304.68;5891
+5893;2001316277;B06000;LESAO CORPORAL;RUA DA BAHIA;1070;81155;11/6/2001 19:31:00;CIDADAO COMUM;N;MILITAR NO LOCAL;CENTRO (BH);BH;611250.10;796582.72;5892
+5894;2001316315;B04002;HOMICIDIO CONSUM;RUA QUATRO DE MA;26;57118;11/6/2001 19:53:00;CIDADAO COMUM;N;;LEONINA;BH;608650.17;793654.44;5893
+5895;2001316336;B03000;AMEACA;RUA VINTE;163;97140;11/6/2001 20:08:00;CIDADAO COMUM;N;;SAO MARCOS;BH;614596.78;802636.22;5894
+5896;2001316349;B03000;AMEACA;RUA IVO ROCHA;153;36330;11/6/2001 20:19:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606520.91;793061.86;5895
+5897;2001316354;B05000;SEQUESTRO E CARC;RUA LEOPOLDINA;120;40739;11/6/2001 20:22:00;CIDADAO COMUM;S;AP404;SANTO ANTONIO;BH;610885.17;794753.81;5896
+5898;2001316355;B03000;AMEACA;RUA ANA HILBERT;111;3544;11/6/2001 20:16:00;CIDADAO COMUM;S;0;SANTA HELENA (BH;BH;603446.72;790142.99;5897
+5899;2001316371;B04001;HOMICIDIO TENTAD;AV RAJA GABAGLIA;1750;57830;11/6/2001 20:36:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608719.62;793771.09;5898
+5900;2001316421;B03000;AMEACA;RUA DOM LUCIO AN;101;22382;11/6/2001 21:07:00;CIDADAO COMUM;S;0;CORACAO EUCARIST;BH;605436.95;796211.96;5899
+5901;2001316490;B03000;AMEACA;RUA AUGUSTO JOSE;560;6729;11/6/2001 21:55:00;CIDADAO COMUM;S;;ESTRELA DO ORIEN;BH;605916.80;791810.80;5900
+5902;2001316531;B04001;HOMICIDIO TENTAD;RUA MAJOR DELFIN;2700;42620;11/6/2001 22:22:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;608893.52;801341.34;5901
+5903;2001316541;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;2900;67682;11/6/2001 22:27:00;INICIATIVA;S;0;BARRO PRETO;BH;609912.78;796638.75;5902
+5904;2001316592;B03000;AMEACA;RUA CAMPO DO MEI;55;12177;11/6/2001 23:05:00;CIDADAO COMUM;S;;JARDIM LEBLON;BH;605703.85;807563.76;5903
+5905;2001316625;B06000;LESAO CORPORAL;RUA BONAPARTE;606;10083;11/6/2001 23:22:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;607739.08;797055.95;5904
+5906;2001316644;B06000;LESAO CORPORAL;RUA URSULA PAULI;2465;71066;11/6/2001 23:42:00;INICIATIVA;S;0;CH BONSUCESSO;BH;605460.77;791671.99;5905
+5907;2001316803;B03000;AMEACA;RUA NEFELINA;117;81228;12/6/2001 03:12:00;CIDADAO COMUM;N;;SANTA TEREZA;BH;612835.00;797309.03;5906
+5908;2001316961;B06000;LESAO CORPORAL;RUA PURUS;125;55819;12/6/2001 07:55:00;CIDADAO COMUM;S;BECO DOS CAQUIS ;CONCORDIA;BH;611069.17;799069.41;5907
+5909;2001317004;B03000;AMEACA;RUA RIO POMBA;631;54567;12/6/2001 08:24:00;CIDADAO COMUM;S;CAA;PADRE EUSTAQUIO;BH;607685.08;797757.01;5908
+5910;2001317159;B06000;LESAO CORPORAL;RUA LUIZ CASTANH;773;41697;12/6/2001 09:48:00;CIDADAO COMUM;S;;SANTA CRUZ;BH;610661.48;802130.20;5909
+5911;2001317204;B03000;AMEACA;RUA JAIME SALSE;278;36848;12/6/2001 10:18:00;INICIATIVA;S;0;MAGNESITA;BH;604022.14;793879.98;5910
+5912;2001317237;B03000;AMEACA;RUA FRANCA;48;29224;12/6/2001 10:42:00;CIDADAO COMUM;S;BL18    AP09;JARDIM AMERICA;BH;607503.92;794169.65;5911
+5913;2001317308;B06000;LESAO CORPORAL;RUA DOUTOR BENED;1500;12252;12/6/2001 11:25:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;612933.21;804714.67;5912
+5914;2001317393;B06000;LESAO CORPORAL;RUA BELO ORIENTE;850;42923;12/6/2001 12:29:00;CIDADAO COMUM;N;CAFR;PROVIDENCIA;BH;612677.75;804042.59;5913
+5915;2001317467;B03000;AMEACA;AV RAJA GABAGLIA;1710;57830;12/6/2001 13:22:00;INICIATIVA;S;0;MORRO DAS PEDRAS;BH;608719.62;793771.09;5914
+5916;2001317551;B03000;AMEACA;RUA CECILIO EMIG;82;14131;12/6/2001 14:09:00;CIDADAO COMUM;S;REF:IGREJA SANTO;PRIMEIRO DE MAIO;BH;612455.98;803751.51;5915
+5917;2001317569;B06000;LESAO CORPORAL;RUA NOSSA SENHOR;855;48021;12/6/2001 14:22:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;610156.25;800645.51;5916
+5918;2001317579;B06000;LESAO CORPORAL;RUA TRES;5;126837;12/6/2001 14:25:00;CIDADAO COMUM;N;;CONJUNTO VISTA A;BH;605113.84;792582.18;5917
+5919;2001317731;B03000;AMEACA;RUA CASTELO DE A;70;124034;12/6/2001 15:53:00;CIDADAO COMUM;N;;CASTELO;BH;605287.78;801402.95;5918
+5920;2001317796;B06000;LESAO CORPORAL;RUA ROGERIO APAR;25;96682;12/6/2001 16:22:00;CIDADAO COMUM;S;0;ANTONIO RIBEIRO ;BH;614926.02;805954.24;5919
+5921;2001318172;B03000;AMEACA;AV NOSSA SENHORA;1700;48107;12/6/2001 20:07:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;610293.44;797814.94;5920
+5922;2001318184;B03000;AMEACA;RUA CAPIVARI;1036;12918;12/6/2001 20:14:00;CIDADAO COMUM;S;;SERRA;BH;613966.21;794792.76;5921
+5923;2001318287;B03000;AMEACA;RUA VINTE E UM;85;122095;12/6/2001 21:21:00;CIDADAO COMUM;N;;JARDIM DOS COMER;BH;607810.43;810991.30;5922
+5924;2001318330;B04001;HOMICIDIO TENTAD;RUA FLOR DO AMEN;89;94910;12/6/2001 21:54:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;605876.71;799791.72;5923
+5925;2001318380;B06000;LESAO CORPORAL;RUA CONTAGEM;1225;70293;12/6/2001 22:28:00;CIDADAO COMUM;S;RESTAURANTE PALA;NOVA VISTA;BH;614534.83;800862.24;5924
+5926;2001318398;B03000;AMEACA;RUA RIACHUELO;501;58527;12/6/2001 22:36:00;CIDADAO COMUM;S;BLA     AP102;CARLOS PRATES;BH;608088.93;797566.54;5925
+5927;2001318418;B04001;HOMICIDIO TENTAD;RUA CAMILO DE BR;636;11896;12/6/2001 22:46:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;5926
+5928;2001318481;B03000;AMEACA;RUA BEGONIA;758;8812;12/6/2001 23:22:00;CIDADAO COMUM;S;0;ESPLANADA;BH;615103.97;798724.96;5927
+5929;2001318482;B03000;AMEACA;RUA FLOR DAS PED;360;28801;12/6/2001 23:25:00;CIDADAO COMUM;N;CA;JARDIM MONTANHES;BH;606148.99;799101.27;5928
+5930;2001318500;B03000;AMEACA;RUA MARIA BEATRI;56;43881;12/6/2001 23:36:00;CIDADAO COMUM;S;0;HAVAI;BH;606696.13;793615.49;5929
+5931;2001318514;B02000;RIXA;AV GETULIO VARGA;216;81256;12/6/2001 23:55:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;612417.35;795645.38;5930
+5932;2001318545;B04002;HOMICIDIO CONSUM;RUA B;81;47637;13/6/2001 00:20:00;CIDADAO COMUM;N;0;VILA CASTANHEIRA;BH;601122.18;788570.67;5931
+5933;2001318554;B06000;LESAO CORPORAL;AV PARANA;365;52230;13/6/2001 00:30:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610769.16;797164.79;5932
+5934;2001318593;B06000;LESAO CORPORAL;RUA ENGENHO NOVO;209;25630;13/6/2001 01:07:00;CIDADAO COMUM;S;;POMPEIA;BH;614830.73;797567.55;5933
+5935;2001318600;B06000;LESAO CORPORAL;RUA AURELIANO PI;112;6858;13/6/2001 01:17:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;609016.12;800210.99;5934
+5936;2001319261;B06000;LESAO CORPORAL;RUA GUIMARAES PA;144;87873;13/6/2001 12:34:00;CIDADAO COMUM;S;;VILA OESTE;BH;604338.90;795567.29;5935
+5937;2001319281;B09000;ABANDONO DE INCA;RUA PETRINA ALVE;312;1350;13/6/2001 12:52:00;CIDADAO COMUM;N;;GOIANIA;BH;615082.31;802831.51;5936
+5938;2001319437;B03000;AMEACA;RUA SAO LUIZ;410;63288;13/6/2001 14:39:00;INICIATIVA;S;0;SAO TOMAZ;BH;609850.88;805509.35;5937
+5939;2001319468;B06000;LESAO CORPORAL;RUA CUBATAO;316;84560;13/6/2001 15:05:00;CIDADAO COMUM;S;;RENASCENCA;BH;611087.08;800639.81;5938
+5940;2001319520;B03000;AMEACA;RUA MARIA AMELIA;550;43812;13/6/2001 15:33:00;CIDADAO COMUM;S;;SAO BERNARDO;BH;610819.92;805277.80;5939
+5941;2001319533;B06000;LESAO CORPORAL;RUA MARTINHO CAM;25;44972;13/6/2001 15:37:00;CIDADAO COMUM;S;;CRUZEIRO;BH;612259.84;794643.53;5940
+5942;2001319600;B06000;LESAO CORPORAL;RUA JACI NOGUEIR;212;36659;13/6/2001 16:12:00;CIDADAO COMUM;S;;FLORAMAR;BH;611955.57;806101.15;5941
+5943;2001319649;B06000;LESAO CORPORAL;RUA DAVID RABELO;221;19702;13/6/2001 16:44:00;CIDADAO COMUM;N;CAC;INCONFIDENCIA;BH;605006.34;798378.12;5942
+5944;2001319690;B03000;AMEACA;RUA SAO CLEMENTE;196;62197;13/6/2001 17:07:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609647.96;799330.51;5943
+5945;2001319777;B03000;AMEACA;RUA DOS ECONOMIS;612;103272;13/6/2001 17:54:00;INICIATIVA;S;0;CONJUNTO ALIPIO ;BH;604238.00;800485.06;5944
+5946;2001319875;B06000;LESAO CORPORAL;RUA SAO CLEMENTE;147;62197;13/6/2001 18:40:00;CIDADAO COMUM;S;;SANTO ANDRE;BH;609623.42;799280.71;5945
+5947;2001319979;B04001;HOMICIDIO TENTAD;RUA EXPEDICIONAR;49;31627;13/6/2001 19:25:00;CIDADAO COMUM;N;;MARIA GORETTI;BH;614368.17;803366.53;5946
+5948;2001320018;B06000;LESAO CORPORAL;RUA MUQUICABA;180;65343;13/6/2001 19:45:00;CIDADAO COMUM;S;;COQUEIROS;BH;602620.44;798332.25;5947
+5949;2001320081;B04001;HOMICIDIO TENTAD;RUA BENEDITO ANI;15;56244;13/6/2001 20:22:00;INICIATIVA;N;0;NOVA YORK;BH;608352.11;810599.17;5948
+5950;2001320155;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;13/6/2001 21:06:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;5949
+5951;2001320160;B04001;HOMICIDIO TENTAD;BECO HELIOTERIO;90;170863;13/6/2001 21:09:00;INICIATIVA;S;0;LEONINA;BH;608285.06;793705.32;5950
+5952;2001320173;B06000;LESAO CORPORAL;AV BALEARES;529;89333;13/6/2001 21:19:00;CIDADAO COMUM;S;;JARDIM EUROPA;BH;608358.52;810091.95;5951
+5953;2001320203;B04002;HOMICIDIO CONSUM;RUA REGENCIA;82;301448;13/6/2001 21:38:00;CIDADAO COMUM;N;;VILA CAFEZAL;BH;614123.87;795468.74;5952
+5954;2001320297;B06000;LESAO CORPORAL;PRACA RAUL SOARE;441;58010;13/6/2001 22:30:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610514.66;796843.53;5953
+5955;2001320312;B06000;LESAO CORPORAL;AV ELISIO DE BRI;23;25251;13/6/2001 22:42:00;CIDADAO COMUM;S;0;BOA VISTA;BH;614321.28;799654.60;5954
+5956;2001320313;B03000;AMEACA;RUA GIL DE OLIVE;215;112545;13/6/2001 22:42:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604297.85;808055.70;5955
+5957;2001320362;B03000;AMEACA;PRACA CARDEAL AR;46;13182;13/6/2001 23:19:00;INICIATIVA;S;0;NOVA CINTRA;BH;605685.61;793811.72;5956
+5958;2001320418;B03000;AMEACA;RUA SATURNINO FE;58;64108;14/6/2001 00:03:00;CIDADAO COMUM;S;CAB;LETICIA;BH;607664.20;809941.98;5957
+5959;2001320459;B06000;LESAO CORPORAL;AV SINFRONIO BRO;1355;66116;14/6/2001 00:33:00;CIDADAO COMUM;S;0;BARREIRO;BH;602021.17;790667.36;5958
+5960;2001320570;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;1025;26052;14/6/2001 02:12:00;CIDADAO COMUM;N;APTO 703;CENTRO (BH);BH;611153.91;796654.06;5959
+5961;2001320571;B02000;RIXA;RUA PADRE PEDRO ;870;51657;14/6/2001 02:13:00;CIDADAO COMUM;S;0;VENDA NOVA;BH;609186.76;808667.02;5960
+5962;2001320578;B03000;AMEACA;RUA JULIO PEREIR;28;102239;14/6/2001 02:20:00;INICIATIVA;S;0;CIDADE NOVA;BH;612273.13;800429.88;5961
+5963;2001320598;B02000;RIXA;RUA PADRE PEDRO ;870;51657;14/6/2001 02:47:00;CIDADAO COMUM;S;0;VENDA NOVA;BH;609186.76;808667.02;5962
+5964;2001320624;B03000;AMEACA;RUA FLOR DA ROMA;115;23808;14/6/2001 03:07:00;CIDADAO COMUM;S;;VILA IPE;BH;605905.20;799936.77;5963
+5965;2001320666;B06000;LESAO CORPORAL;AV AMAZONAS;333;3140;14/6/2001 03:43:00;INICIATIVA;S;0;CENTRO (BH);BH;611084.15;797100.95;5964
+5966;2001320699;B06000;LESAO CORPORAL;AV DO CONTORNO;1813;17228;14/6/2001 04:21:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;612273.73;797607.09;5965
+5967;2001320702;B06000;LESAO CORPORAL;RUA FERNANDES TO;390;81271;14/6/2001 04:25:00;CIDADAO COMUM;N;0;LOURDES;BH;611239.41;794977.80;5966
+5968;2001320784;B03000;AMEACA;RUA RIO DE JANEI;147;58772;14/6/2001 06:53:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611252.60;797543.60;5967
+5969;2001320796;B03000;AMEACA;RUA FLAVIO MARQU;376;28436;14/6/2001 07:15:00;CIDADAO COMUM;N;;BARREIRO;BH;603097.24;790974.11;5968
+5970;2001320806;B06000;LESAO CORPORAL;RUA LOTUS;385;100564;14/6/2001 07:21:00;CIDADAO COMUM;S;;BETANIA;BH;604933.19;792316.58;5969
+5971;2001320877;B06000;LESAO CORPORAL;RUA BERILO;2;9289;14/6/2001 08:33:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612085.16;803501.30;5970
+5972;2001320944;B03000;AMEACA;RUA LOURENCO VOL;237;97603;14/6/2001 09:26:00;CIDADAO COMUM;S;FR220;DOM SILVERIO;BH;614553.44;804153.08;5971
+5973;2001320965;B03000;AMEACA;AV DO CONTORNO;1277;17228;14/6/2001 09:45:00;INICIATIVA;N;0;BARRO PRETO;BH;611851.77;797784.50;5972
+5974;2001320978;B03000;AMEACA;AV OLINTO MEIREL;2511;49847;14/6/2001 09:55:00;CIDADAO COMUM;N;;ARAGUAIA;BH;603791.58;789431.89;5973
+5975;2001321018;B03000;AMEACA;RUA FREI CONCEIC;1196;29873;14/6/2001 10:22:00;CIDADAO COMUM;S;0;JOAO PINHEIRO;BH;604263.93;796522.94;5974
+5976;2001321103;B03000;AMEACA;RUA ANTONIO RODR;480;11537;14/6/2001 11:32:00;CIDADAO COMUM;N;;VENDA NOVA;BH;607247.00;809301.40;5975
+5977;2001321150;B06000;LESAO CORPORAL;RUA CARLOS MARQU;40;84200;14/6/2001 12:10:00;CIDADAO COMUM;N;;COPACABANA;BH;606242.68;805806.40;5976
+5978;2001321196;B06000;LESAO CORPORAL;AV AFONSO VAZ DE;65;1306;14/6/2001 12:44:00;CIDADAO COMUM;N;0;BARREIRO;BH;602931.29;791287.07;5977
+5979;2001321220;B06000;LESAO CORPORAL;RUA POUSO ALEGRE;2522;54932;14/6/2001 13:00:00;CIDADAO COMUM;N;;FLORESTA;BH;613435.30;798084.21;5978
+5980;2001321256;B06000;LESAO CORPORAL;RUA FARADAY;149;27764;14/6/2001 13:29:00;CIDADAO COMUM;N;CSA;PRIMEIRO DE MAIO;BH;612224.89;803549.14;5979
+5981;2001321283;B03000;AMEACA;AV JEQUITINHONHA;347;37305;14/6/2001 13:56:00;CIDADAO COMUM;N;CA1;VERA CRUZ;BH;615765.43;798316.29;5980
+5982;2001321285;B08000;VIOLACAO DE DOMI;RUA NETUNO;58;130021;14/6/2001 13:57:00;CIDADAO COMUM;N;;VILA SATELITE;BH;610007.16;808805.46;5981
+5983;2001321292;B03000;AMEACA;RUA CORONEL BERN;132;89941;14/6/2001 13:59:00;CIDADAO COMUM;S;0;PALMEIRAS;BH;606632.74;791582.00;5982
+5984;2001321331;B02000;RIXA;RUA PINTARROXO;167;95954;14/6/2001 14:28:00;CIDADAO COMUM;S;;GOIANIA;BH;615366.02;802364.10;5983
+5985;2001321333;B03000;AMEACA;RUA JORNALISTA J;192;6470;14/6/2001 14:30:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;606205.43;793698.70;5984
+5986;2001321362;B06000;LESAO CORPORAL;AV COLETORA;580;78241;14/6/2001 14:52:00;CIDADAO COMUM;S;;VILA PINHO;BH;602113.34;788183.02;5985
+5987;2001321427;B03000;AMEACA;RUA PADRE TIAGO ;60;119430;14/6/2001 15:36:00;CIDADAO COMUM;S;APTO 103;VILA MAGNESITA;BH;602516.78;794930.47;5986
+5988;2001321460;B03000;AMEACA;AV OLEGARIO MACI;170;49699;14/6/2001 15:58:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610621.91;797526.25;5987
+5989;2001321476;B03000;AMEACA;RUA BOREAL;56;10184;14/6/2001 16:08:00;CIDADAO COMUM;S;AP301;ADELAIDE;BH;606950.84;798500.09;5988
+5990;2001321512;B04001;HOMICIDIO TENTAD;RUA DIMAS PEREIR;48;107780;14/6/2001 16:33:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606086.92;811647.38;5989
+5991;2001321516;B06000;LESAO CORPORAL;RUA SAO PAULO;157;63464;14/6/2001 16:35:00;INICIATIVA;S;0;CENTRO BH;BH;611124.36;797602.35;5990
+5992;2001321540;B03000;AMEACA;RUA NIQUELINA;1158;47738;14/6/2001 16:57:00;POLICIAL MILITAR;S;0;SANTA EFIGENIA;BH;614131.84;797245.39;5991
+5993;2001321574;B03000;AMEACA;RUA JOSE JACINTO;262;67538;14/6/2001 17:13:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;604619.48;791960.34;5992
+5994;2001321616;B04001;HOMICIDIO TENTAD;RUA DELIO VIEIRA;168;23344;14/6/2001 17:36:00;CIDADAO COMUM;S;;GLORIA;BH;603163.67;798723.49;5993
+5995;2001321618;B06000;LESAO CORPORAL;RUA SAO TIAGO;151;21682;14/6/2001 17:38:00;INICIATIVA;N;0;SAO TOMAZ;BH;610186.02;805592.90;5994
+5996;2001321655;B03000;AMEACA;RUA DOS TIMBIRAS;2500;67682;14/6/2001 17:56:00;POLICIAL MILITAR;S;0;SANTO AGOSTINHO;BH;610281.40;796553.09;5995
+5997;2001321670;B03000;AMEACA;RUA NIQUELINA;1158;47738;14/6/2001 18:03:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;614131.84;797245.39;5996
+5998;2001321776;B08000;VIOLACAO DE DOMI;AV DO CONTORNO;12;17228;14/6/2001 18:58:00;INICIATIVA;N;0;CENTRO BH;BH;610893.99;797847.30;5997
+5999;2001321839;B04001;HOMICIDIO TENTAD;RUA CORONEL SEVE;800;18072;14/6/2001 19:18:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604766.76;789755.34;5998
+6000;2001321853;B06000;LESAO CORPORAL;RUA DR JOAO CARV;142;36012;14/6/2001 19:25:00;CIDADAO COMUM;S;;PRADO LOPES;BH;610121.75;798846.43;5999
+6001;2001321886;B06000;LESAO CORPORAL;RUA PARACATU;724;52095;14/6/2001 19:48:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609642.16;796526.05;6000
+6002;2001321943;B06000;LESAO CORPORAL;RUA PSI;16;49991;14/6/2001 20:20:00;CIDADAO COMUM;N;0;CAICARA;BH;608003.95;799396.57;6001
+6003;2001321960;B03000;AMEACA;AV PRESIDENTE CA;3001;55125;14/6/2001 20:29:00;INICIATIVA;S;0;CAICARA;BH;608178.06;800324.32;6002
+6004;2001321976;B03000;AMEACA;RUA PIRANGUINHO;157;54122;14/6/2001 20:42:00;CIDADAO COMUM;N;;SAO GERALDO;BH;616053.38;799126.91;6003
+6005;2001322019;B03000;AMEACA;RUA ANTONIO DE P;158;119254;14/6/2001 21:06:00;CIDADAO COMUM;S;AP301;SERRA VERDE;BH;609376.50;811110.92;6004
+6006;2001322034;B06000;LESAO CORPORAL;AV BIAS FORTES;1770;9553;14/6/2001 21:15:00;INICIATIVA;N;0;BARRO PRETO;BH;610196.72;797244.85;6005
+6007;2001322047;B04002;HOMICIDIO CONSUM;RUA ESPIRITO SAN;361;26052;14/6/2001 21:21:00;INICIATIVA;S;0;CENTRO BH;BH;611326.30;797302.57;6006
+6008;2001322054;B06000;LESAO CORPORAL;AV ASSIS CHATEAU;615;6353;14/6/2001 21:24:00;INICIATIVA;S;0;FLORESTA;BH;611764.60;797160.68;6007
+6009;2001322176;B04002;HOMICIDIO CONSUM;RUA APOLO OITO;345;83797;14/6/2001 22:28:00;CIDADAO COMUM;N;;CH ATILA DE PAIV;BH;601455.09;790798.99;6008
+6010;2001322178;B03000;AMEACA;RUA DAS VIOLAS;805;101670;14/6/2001 22:28:00;CIDADAO COMUM;S;0;VILA CALIFORNIA;BH;603660.18;796896.20;6009
+6011;2001322221;B06000;LESAO CORPORAL;RUA SAO VICENTE;86;88126;14/6/2001 22:48:00;CIDADAO COMUM;S;;GRANJA FREITAS;BH;617022.85;798456.93;6010
+6012;2001322232;B04001;HOMICIDIO TENTAD;AV CORONEL DURVA;38;17688;14/6/2001 22:57:00;CIDADAO COMUM;N;0;DURVAL DE BARROS;BH;598767.92;791083.00;6011
+6013;2001322300;B06000;LESAO CORPORAL;RUA DONA CARMEM;392;22820;14/6/2001 23:28:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603768.76;802208.64;6012
+6014;2001322484;B04002;HOMICIDIO CONSUM;BECO PRINCIPAL;5;301983;15/6/2001 01:47:00;CIDADAO COMUM;N;;SAO JOSE;BH;604808.72;799278.97;6013
+6015;2001322511;B06000;LESAO CORPORAL;RUA LUCIO PETIT ;46;114121;15/6/2001 02:13:00;CIDADAO COMUM;S;;RIO BRANCO;BH;606256.19;808682.91;6014
+6016;2001322522;B03000;AMEACA;RUA FLOR DA VERD;253;28842;15/6/2001 02:23:00;CIDADAO COMUM;N;0;JARDIM ALVORADA;BH;606254.68;799470.06;6015
+6017;2001322576;B06000;LESAO CORPORAL;RUA RIO DE JANEI;462;58772;15/6/2001 03:46:00;CIDADAO COMUM;S;FR;CENTRO (BH);BH;611136.20;797245.88;6016
+6018;2001322607;B03000;AMEACA;RUA GRAJAU;261;31715;15/6/2001 05:13:00;CIDADAO COMUM;N;;ANCHIETA;BH;612355.52;793641.12;6017
+6019;2001322634;B06000;LESAO CORPORAL;AV CRISTIANO MAC;5387;18652;15/6/2001 06:25:00;CIDADAO COMUM;S;;DOS PALMARES;BH;612255.52;802177.46;6018
+6020;2001322638;B03000;AMEACA;RUA FRANCISCO DU;139;46316;15/6/2001 06:39:00;INICIATIVA;N;0;SANTA TEREZINHA;BH;604475.97;802319.26;6019
+6021;2001322803;B06000;LESAO CORPORAL;RUA JOAO SAMAHA;261;7397;15/6/2001 09:09:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;608633.12;807211.33;6020
+6022;2001322825;B06000;LESAO CORPORAL;RUA SUASSUI;393;66447;15/6/2001 09:25:00;CIDADAO COMUM;N;CAA;CARLOS PRATES;BH;608993.56;797367.98;6021
+6023;2001322896;B06000;LESAO CORPORAL;AV JEQUITINHONHA;1027;37305;15/6/2001 10:05:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615981.31;797493.07;6022
+6024;2001322955;B03000;AMEACA;RUA PEDRO GLANSM;55;53044;15/6/2001 10:45:00;CIDADAO COMUM;S;0;INDUSTRIAL RODRI;BH;615807.17;808659.59;6023
+6025;2001322993;B03000;AMEACA;RUA ALVARO OLIVE;111;58381;15/6/2001 11:17:00;CIDADAO COMUM;S;;MARIA VIRGINIA;BH;611875.97;802851.94;6024
+6026;2001323021;B03000;AMEACA;RUA LUCIA MIGUEL;140;41555;15/6/2001 11:34:00;CIDADAO COMUM;S;;TUPI;BH;612588.93;806074.09;6025
+6027;2001323029;B06000;LESAO CORPORAL;RUA HILARINO BEN;64;33298;15/6/2001 11:42:00;CIDADAO COMUM;S;;MAGNESITA;BH;604274.73;793891.55;6026
+6028;2001323035;B03000;AMEACA;RUA SOBRAL;404;66232;15/6/2001 11:44:00;CIDADAO COMUM;N;0;SANTA LUCIA;BH;610299.27;792033.67;6027
+6029;2001323057;B03000;AMEACA;BECO FREI MARIAN;120;300767;15/6/2001 12:02:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608761.56;797834.53;6028
+6030;2001323105;B03000;AMEACA;RUA MANAUS;611;42747;15/6/2001 12:42:00;INICIATIVA;S;0;SANTA EFIGENIA;BH;612917.36;796183.64;6029
+6031;2001323106;B04001;HOMICIDIO TENTAD;RUA MANAIRA;10;96235;15/6/2001 12:42:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;614046.95;805015.29;6030
+6032;2001323251;B04001;HOMICIDIO TENTAD;AV NOSSA SENHORA;2128;47996;15/6/2001 14:32:00;CIDADAO COMUM;S;0;SAO PEDRO;BH;610842.82;793056.52;6031
+6033;2001323264;B06000;LESAO CORPORAL;AV JEQUITINHONHA;1027;37305;15/6/2001 14:44:00;CIDADAO COMUM;S;CAFU;VERA CRUZ;BH;615981.31;797493.07;6032
+6034;2001323284;B06000;LESAO CORPORAL;AV BIAS FORTES;1836;9553;15/6/2001 15:00:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;610196.72;797244.85;6033
+6035;2001323290;B06000;LESAO CORPORAL;RUA DOS EXPEDICI;59;26989;15/6/2001 15:03:00;CIDADAO COMUM;S;CA;SANTA AMELIA;BH;606863.60;806683.97;6034
+6036;2001323304;B03000;AMEACA;RUA MARIA ROSA D;599;107800;15/6/2001 15:12:00;CIDADAO COMUM;N;CSA;MANTIQUEIRA;BH;606348.34;811601.38;6035
+6037;2001323321;B03000;AMEACA;RUA TIJUCA;77;67667;15/6/2001 15:21:00;CIDADAO COMUM;S;0;LEBLON;BH;605675.09;809917.57;6036
+6038;2001323483;B06000;LESAO CORPORAL;RUA RIO PETROPOL;276;91893;15/6/2001 17:10:00;CIDADAO COMUM;N;0;PINDORAMA;BH;602095.17;797898.68;6037
+6039;2001323504;B03000;AMEACA;RUA ANTENOR PERD;178;74266;15/6/2001 17:24:00;CIDADAO COMUM;N;0;SAO JOAO BATISTA;BH;609049.41;808143.38;6038
+6040;2001323515;B08000;VIOLACAO DE DOMI;RUA BRAZILINA FE;120;89840;15/6/2001 17:34:00;CIDADAO COMUM;N;0;BETANIA;BH;605521.19;792493.46;6039
+6041;2001323560;B03000;AMEACA;RUA EDSON TOMAS ;276;68556;15/6/2001 18:08:00;INICIATIVA;N;0;SAO BERNARDO;BH;611475.18;804538.49;6040
+6042;2001323604;B03000;AMEACA;RUA NAIR PENTAGN;165;97657;15/6/2001 18:33:00;CIDADAO COMUM;S;0;HELIOPOLIS;BH;611056.37;805379.55;6041
+6043;2001323606;B03000;AMEACA;RUA DAVIDSON PIM;234;124189;15/6/2001 18:30:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607280.34;811756.73;6042
+6044;2001323827;B03000;AMEACA;RUA GUARARAPES;1860;32241;15/6/2001 20:49:00;CIDADAO COMUM;S;0;GLORIA;BH;602480.24;798079.29;6043
+6045;2001323838;B06000;LESAO CORPORAL;RUA RAIMUNDO GIL;320;63086;15/6/2001 20:55:00;CIDADAO COMUM;S;CAA;NOVA CINTRA;BH;605210.75;793177.47;6044
+6046;2001323839;B06000;LESAO CORPORAL;RUA MARECHAL GUA;100;96802;15/6/2001 20:56:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615270.76;806183.72;6045
+6047;2001323866;B04002;HOMICIDIO CONSUM;AV AMINTAS JAQUE;313;52546;15/6/2001 21:17:00;CIDADAO COMUM;N;0;COQUEIROS;BH;603210.01;799696.54;6046
+6048;2001323869;B06000;LESAO CORPORAL;AV NELIO CERQUEI;687;72359;15/6/2001 21:18:00;CIDADAO COMUM;S;0;TIROL;BH;600383.74;789115.36;6047
+6049;2001323892;B03000;AMEACA;RUA MARIA JOANA ;266;119267;15/6/2001 21:34:00;CIDADAO COMUM;S;0;ALVORADA;BH;615255.07;802225.21;6048
+6050;2001323904;B06000;LESAO CORPORAL;RUA G;70;78733;15/6/2001 21:38:00;CIDADAO COMUM;S;;CH JATOBA IV;BH;600404.89;787792.43;6049
+6051;2001323905;B06000;LESAO CORPORAL;RUA RADIALISTA Z;81;15437;15/6/2001 21:39:00;CIDADAO COMUM;S;;CEU AZUL;BH;604523.50;807871.15;6050
+6052;2001323919;B04002;HOMICIDIO CONSUM;RUA SACRAMENTO;30;59822;15/6/2001 21:45:00;CIDADAO COMUM;S;0;SERRA;BH;613575.35;795041.52;6051
+6053;2001323947;B09000;ABANDONO DE INCA;RUA ANA PAULA;33;3598;15/6/2001 22:05:00;CIDADAO COMUM;S;;VILA SUZANA;BH;611442.14;802914.74;6052
+6054;2001323973;B03000;AMEACA;RUA DELMO RENAUL;43;70596;15/6/2001 22:17:00;CIDADAO COMUM;S;0;AARAO REIS;BH;612822.44;804930.93;6053
+6055;2001323985;B04001;HOMICIDIO TENTAD;RUA CAMBUQUIRA;798;11830;15/6/2001 22:28:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608642.63;798179.48;6054
+6056;2001324040;B06000;LESAO CORPORAL;RUA SAO JOSE;23;302037;15/6/2001 23:00:00;CIDADAO COMUM;S;CAC;DOZE DE OUTUBRO;BH;606186.44;790674.49;6055
+6057;2001324128;B04002;HOMICIDIO CONSUM;RUA P;16;78402;15/6/2001 23:56:00;CIDADAO COMUM;N;;VILA PINHO;BH;602081.24;787982.68;6056
+6058;2001324129;B06000;LESAO CORPORAL;RUA MOEMA;394;46070;15/6/2001 23:55:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606488.15;797836.90;6057
+6059;2001324170;B03000;AMEACA;RUA PADRE LUIZ C;119;42472;16/6/2001 00:24:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;603784.38;793050.81;6058
+6060;2001324171;B03000;AMEACA;RUA PADRE PEDRO ;148;51657;16/6/2001 00:27:00;CIDADAO COMUM;S;0;VENDA NOVA;BH;609719.17;808135.92;6059
+6061;2001324241;B06000;LESAO CORPORAL;RUA DAS GABIROBA;95;30375;16/6/2001 01:28:00;POLICIAL CIVIL;S;;VILA CLORIS;BH;610034.72;808298.49;6060
+6062;2001324313;B03000;AMEACA;ESTRADA BEIRA LI;10;10878;16/6/2001 02:41:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;616178.24;806739.23;6061
+6063;2001324382;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;951;51657;16/6/2001 04:08:00;CIDADAO COMUM;N;SJ;VENDA NOVA;BH;609054.57;808684.17;6062
+6064;2001324400;B06000;LESAO CORPORAL;RUA CAPANEMA;331;56979;16/6/2001 04:42:00;CIDADAO COMUM;N;;COQUEIROS;BH;602389.39;798785.86;6063
+6065;2001324511;B03000;AMEACA;RUA JOSE CLETO;425;38682;16/6/2001 07:50:00;CIDADAO COMUM;S;0;SANTA CRUZ;BH;610927.84;802291.16;6064
+6066;2001324607;B03000;AMEACA;RUA RAMIRO SIQUE;10;128858;16/6/2001 09:12:00;CIDADAO COMUM;S;;CASTANHEIRAS (TA;BH;617650.40;797388.81;6065
+6067;2001324666;B03000;AMEACA;RUA OLIVER;225;49950;16/6/2001 10:01:00;CIDADAO COMUM;N;;UNIAO;BH;612718.71;801397.71;6066
+6068;2001324724;B06000;LESAO CORPORAL;AV AUGUSTO DE LI;635;6731;16/6/2001 10:47:00;CIDADAO COMUM;N;;CENTRO (BH);BH;610790.65;796647.21;6067
+6069;2001324740;B03000;AMEACA;RUA FREDERICO BR;285;51080;16/6/2001 10:58:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608098.92;797431.78;6068
+6070;2001324751;B03000;AMEACA;RUA OZANAM;207;50796;16/6/2001 11:12:00;CIDADAO COMUM;S;AP104;IPIRANGA;BH;611657.56;801318.05;6069
+6071;2001324842;B03000;AMEACA;RUA TRINTA E TRE;137;34133;16/6/2001 12:14:00;CIDADAO COMUM;S;;CONJUNTO FELICID;BH;612435.60;807334.47;6070
+6072;2001324923;B03000;AMEACA;RUA GENTIL TEODO;87;66333;16/6/2001 13:13:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;611230.41;801186.56;6071
+6073;2001324937;B04001;HOMICIDIO TENTAD;RUA SERRINHA;658;129201;16/6/2001 13:24:00;CIDADAO COMUM;N;;CH VALE DO JATOB;BH;600157.51;787603.35;6072
+6074;2001324982;B03000;AMEACA;RUA DOUTOR LUIZ ;34;23505;16/6/2001 13:52:00;CIDADAO COMUM;S;0;MAGNESITA;BH;603885.26;793861.02;6073
+6075;2001324999;B04001;HOMICIDIO TENTAD;RUA NASCIMENTO G;620;47274;16/6/2001 14:09:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608659.42;794728.52;6074
+6076;2001325029;B06000;LESAO CORPORAL;RUA MARIA JOANA ;516;7328;16/6/2001 14:34:00;CIDADAO COMUM;S;;CARDOSO;BH;603100.97;788196.41;6075
+6077;2001325064;B06000;LESAO CORPORAL;RUA DAVID RABELO;416;19702;16/6/2001 15:01:00;CIDADAO COMUM;S;0;INCONFIDENCIA;BH;605050.70;798560.71;6076
+6078;2001325179;B03000;AMEACA;RUA IMPERATRIZ;32;122357;16/6/2001 16:11:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609306.94;805400.92;6077
+6079;2001325203;B06000;LESAO CORPORAL;RUA PADRE PEDRO ;175;51657;16/6/2001 16:25:00;CIDADAO COMUM;S;;VENDA NOVA;BH;609671.68;808130.71;6078
+6080;2001325207;B06000;LESAO CORPORAL;RUA CRUCIFICACAO;55;18766;16/6/2001 16:26:00;CIDADAO COMUM;S;;SAO JOSE;BH;605621.95;798926.66;6079
+6081;2001325250;B06000;LESAO CORPORAL;RUA ROBERTO DE M;100;130412;16/6/2001 16:55:00;CIDADAO COMUM;S;;OLARIA;BH;602109.78;789254.89;6080
+6082;2001325265;B03000;AMEACA;AV SILVA LOBO;1969;65889;16/6/2001 17:05:00;INICIATIVA;N;0;GRAJAU;BH;608248.61;794746.76;6081
+6083;2001325268;B06000;LESAO CORPORAL;RUA VEREADOR CAM;210;21005;16/6/2001 17:05:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;615766.93;806676.50;6082
+6084;2001325283;B03000;AMEACA;RUA DARIO GONCAL;379;19670;16/6/2001 17:16:00;INICIATIVA;N;0;FLORAMAR;BH;612133.58;805984.63;6083
+6085;2001325302;B03000;AMEACA;RUA ANTONIO LUCI;83;14709;16/6/2001 17:25:00;CIDADAO COMUM;N;CAFU;CH VALE DO JATOB;BH;600810.66;787478.72;6084
+6086;2001325333;B04002;HOMICIDIO CONSUM;RUA BENTO;12;170807;16/6/2001 17:38:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608443.37;794109.13;6085
+6087;2001325366;B04001;HOMICIDIO TENTAD;RUA PARINTINS;305;61560;16/6/2001 17:52:00;CIDADAO COMUM;S;AP301;SAO GABRIEL;BH;613301.07;804534.83;6086
+6088;2001325377;B03000;AMEACA;RUA MADRID;110;42403;16/6/2001 18:02:00;CIDADAO COMUM;S;CSXX;COPACABANA;BH;606215.50;806159.29;6087
+6089;2001325399;B03000;AMEACA;RUA ALFINETE;151;2249;16/6/2001 18:18:00;CIDADAO COMUM;S;;LINDEIA;BH;599467.32;790906.24;6088
+6090;2001325459;B06000;LESAO CORPORAL;AV ERICO VERISSI;2291;41671;16/6/2001 18:50:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;606975.53;807805.13;6089
+6091;2001325524;B03000;AMEACA;AV WALDOMIRO LOB;330;66548;16/6/2001 19:16:00;CIDADAO COMUM;N;;GUARANI;BH;612929.48;805371.63;6090
+6092;2001325536;B03000;AMEACA;RUA SILVA BARBOS;123;126490;16/6/2001 19:23:00;CIDADAO COMUM;N;0;TIROL;BH;600046.40;789883.53;6091
+6093;2001325540;B03000;AMEACA;RUA OTAVIO TARQU;58;50639;16/6/2001 19:25:00;CIDADAO COMUM;S;CS;TUPI;BH;612691.45;805903.79;6092
+6094;2001325647;B06000;LESAO CORPORAL;RUA ESTEVAO MUSS;10;26327;16/6/2001 20:29:00;CIDADAO COMUM;S;0;NOVA GAMELEIRA;BH;605516.79;794498.15;6093
+6095;2001325677;B04001;HOMICIDIO TENTAD;RUA PORTO VELHO;490;62506;16/6/2001 20:46:00;CIDADAO COMUM;S;;GLORIA;BH;603911.24;798307.42;6094
+6096;2001325679;B03000;AMEACA;RUA AUGUSTA;73;6615;16/6/2001 20:51:00;CIDADAO COMUM;S;CAB;ITAIPU BH;BH;598978.25;789462.02;6095
+6097;2001325717;B06000;LESAO CORPORAL;RUA URSULA PAULI;2338;71066;16/6/2001 21:10:00;INICIATIVA;N;0;CH BONSUCESSO;BH;605473.82;791757.57;6096
+6098;2001325737;B06000;LESAO CORPORAL;RUA ANTONIO MARC;293;48539;16/6/2001 21:21:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606469.80;810190.14;6097
+6099;2001325776;B06000;LESAO CORPORAL;AV SILVIANO BRAN;2700;66002;16/6/2001 21:41:00;INICIATIVA;S;0;HORTO;BH;613805.02;798316.76;6098
+6100;2001325826;B06000;LESAO CORPORAL;RUA APERE;196;5020;16/6/2001 22:19:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615542.42;799519.99;6099
+6101;2001325838;B06000;LESAO CORPORAL;AV AFONSO PENA;590;1259;16/6/2001 22:25:00;INICIATIVA;N;0;CENTRO (BH);BH;611078.27;797193.62;6100
+6102;2001325969;B04001;HOMICIDIO TENTAD;RUA DOS LAZARIST;94;122486;16/6/2001 23:37:00;CIDADAO COMUM;S;CAB;PLANALTO;BH;610826.79;805918.07;6101
+6103;2001325972;B06000;LESAO CORPORAL;RUA GUAICURUS;451;32009;16/6/2001 23:40:00;CIDADAO COMUM;S;PX428;CENTRO (BH);BH;611210.22;797600.57;6102
+6104;2001325980;B03000;AMEACA;RUA MANJERICAO;637;34464;16/6/2001 23:43:00;CIDADAO COMUM;S;;LINDEIA;BH;599654.37;791207.03;6103
+6105;2001326019;B06000;LESAO CORPORAL;RUA BARRA DA TIJ;140;100098;17/6/2001 00:01:00;CIDADAO COMUM;N;CAB;VILA SANTA BRANC;BH;605384.20;809444.62;6104
+6106;2001326045;B03000;AMEACA;RUA FERNAO DIAS;1201;28133;17/6/2001 00:17:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;616149.41;797919.40;6105
+6107;2001326046;B04001;HOMICIDIO TENTAD;RUA JOSE JORGE F;70;38884;17/6/2001 00:19:00;CIDADAO COMUM;N;;NOVA BARROCA;BH;607287.63;792753.33;6106
+6108;2001326102;B04001;HOMICIDIO TENTAD;RUA ESTOCOLMO;12;100390;17/6/2001 00:57:00;CIDADAO COMUM;N;;TREVO;BH;604166.43;805838.05;6107
+6109;2001326104;B03000;AMEACA;RUA PASCOA;72;52404;17/6/2001 00:57:00;CIDADAO COMUM;S;0;SAO JOSE;BH;605753.40;798866.19;6108
+6110;2001326108;B06000;LESAO CORPORAL;RUA IPE AMARELO;19;117362;17/6/2001 01:02:00;CIDADAO COMUM;S;CAB;LINDEIA;BH;600282.81;790534.78;6109
+6111;2001326119;B03000;AMEACA;AV MEM DE SA;942;45395;17/6/2001 01:09:00;CIDADAO COMUM;N;;PARAISO;BH;614245.94;796551.31;6110
+6112;2001326137;B03000;AMEACA;BECO DA AGUA;155;172308;17/6/2001 01:23:00;CIDADAO COMUM;S;CAZZZ;CAFEZAL;BH;614122.88;794504.57;6111
+6113;2001326211;B02000;RIXA;RUA URANO;258;71000;17/6/2001 02:10:00;CIDADAO COMUM;S;;VILA SATELITE;BH;610063.87;808693.02;6112
+6114;2001326215;B03000;AMEACA;RUA NOVE DE DEZE;10;48872;17/6/2001 02:13:00;CIDADAO COMUM;N;CAB;LEONINA;BH;608380.02;793403.51;6113
+6115;2001326223;B06000;LESAO CORPORAL;RUA SAIRA;285;48670;17/6/2001 02:22:00;CIDADAO COMUM;S;0;GOIANIA;BH;615408.70;803160.66;6114
+6116;2001326234;B02000;RIXA;AV SARAMENHA;1000;64007;17/6/2001 02:32:00;CIDADAO COMUM;S;0;TUPI;BH;612916.89;805724.57;6115
+6117;2001326253;B03000;AMEACA;RUA STA ALIANCA;17;60311;17/6/2001 02:47:00;CIDADAO COMUM;S;;DOM JOAQUIM;BH;613911.96;802400.90;6116
+6118;2001326283;B04001;HOMICIDIO TENTAD;RUA ALCANTARA;269;1870;17/6/2001 03:04:00;CIDADAO COMUM;S;0;NOVA GRANADA;BH;607795.92;794870.02;6117
+6119;2001326294;B03000;AMEACA;RUA BURI;51;10764;17/6/2001 03:13:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610328.10;801370.73;6118
+6120;2001326298;B03000;AMEACA;RUA GAMA CERQUEI;756;30564;17/6/2001 03:16:00;CIDADAO COMUM;S;CAC;JARDIM AMERICA;BH;607596.70;794467.83;6119
+6121;2001326364;B03000;AMEACA;RUA SACRAMENTO;170;59822;17/6/2001 04:23:00;CIDADAO COMUM;N;0;SERRA;BH;613713.64;795025.29;6120
+6122;2001326378;B03000;AMEACA;RUA MARIO SOARES;700;44641;17/6/2001 04:37:00;CIDADAO COMUM;S;0;DOM BOSCO;BH;604285.11;797448.93;6121
+6123;2001326389;B04002;HOMICIDIO CONSUM;RUA PADRE PEDRO ;322;51657;17/6/2001 04:54:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;609650.08;808286.90;6122
+6124;2001326409;B03000;AMEACA;RUA OLARIA;80;25110;17/6/2001 05:14:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617221.65;797115.07;6123
+6125;2001326472;B04002;HOMICIDIO CONSUM;RUA SAO VICENTE;140;63855;17/6/2001 07:22:00;CIDADAO COMUM;N;0;VENDA NOVA;BH;608585.03;808760.44;6124
+6126;2001326507;B06000;LESAO CORPORAL;RUA JOAQUIM ALVE;73;80887;17/6/2001 08:05:00;CIDADAO COMUM;N;CAB;BETANIA;BH;605405.07;792912.81;6125
+6127;2001326683;B03000;AMEACA;PRACA JOSE CAVAL;50;38639;17/6/2001 10:22:00;INICIATIVA;S;0;CORACAO DE JESUS;BH;609777.00;794213.05;6126
+6128;2001326729;B03000;AMEACA;RUA DOS AIMORES;1630;1640;17/6/2001 10:57:00;CIDADAO COMUM;S;AP21;LOURDES;BH;611057.68;796189.83;6127
+6129;2001326872;B06000;LESAO CORPORAL;RUA DUZENTOS E O;99;24261;17/6/2001 12:46:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600758.52;787074.86;6128
+6130;2001326900;B03000;AMEACA;RUA SAO MIGUEL;1501;63410;17/6/2001 13:11:00;CIDADAO COMUM;S;;ITAPOA;BH;609533.82;805627.88;6129
+6131;2001326950;B06000;LESAO CORPORAL;RUA DIVINO ESPIR;85;96768;17/6/2001 13:46:00;CIDADAO COMUM;S;;ANTONIO RIBEIRO ;BH;614662.44;806416.62;6130
+6132;2001327023;B03000;AMEACA;RUA CORACAO EUCA;75;17344;17/6/2001 14:37:00;CIDADAO COMUM;N;0;CORACAO EUCARIST;BH;605859.87;796363.89;6131
+6133;2001327035;B06000;LESAO CORPORAL;RUA INGLATERRA;226;34552;17/6/2001 14:45:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;606129.97;807391.13;6132
+6134;2001327046;B02000;RIXA;RUA CAMPOS SALES;350;12300;17/6/2001 14:59:00;CIDADAO COMUM;N;0;CALAFATE;BH;607187.46;796294.85;6133
+6135;2001327075;B03000;AMEACA;AV PRESIDENTE TA;3735;35366;17/6/2001 15:16:00;CIDADAO COMUM;S;;PAQUETA;BH;605051.03;802496.83;6134
+6136;2001327076;B06000;LESAO CORPORAL;RUA EVOCACAO;473;26948;17/6/2001 15:17:00;CIDADAO COMUM;S;;SAO JOSE;BH;605849.93;798746.20;6135
+6137;2001327109;B04001;HOMICIDIO TENTAD;RUA GUSTAVO DA S;1693;32617;17/6/2001 15:40:00;CIDADAO COMUM;N;;SANTA INES;BH;613754.67;800364.22;6136
+6138;2001327143;B06000;LESAO CORPORAL;RUA NOSSA SENHOR;37;102834;17/6/2001 16:02:00;CIDADAO COMUM;S;;CEU AZUL;BH;603522.11;807505.18;6137
+6139;2001327192;B06000;LESAO CORPORAL;RUA FRANCISCO SE;2;119699;17/6/2001 16:36:00;CIDADAO COMUM;S;;VERA CRUZ;BH;617010.39;797762.35;6138
+6140;2001327224;B06000;LESAO CORPORAL;RUA BEIRA ALTA;85;62777;17/6/2001 16:53:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609881.41;802314.78;6139
+6141;2001327236;B03000;AMEACA;RUA MONTE SILVES;108;46561;17/6/2001 16:59:00;CIDADAO COMUM;S;;MINASLANDIA;BH;612316.79;804895.21;6140
+6142;2001327321;B04001;HOMICIDIO TENTAD;RUA ARTUR DE SA;1305;6211;17/6/2001 17:54:00;CIDADAO COMUM;S;;UNIAO;BH;613170.84;801684.18;6141
+6143;2001327344;B06000;LESAO CORPORAL;RUA TAMAREIRA;120;99740;17/6/2001 18:02:00;CIDADAO COMUM;S;;OLARIA;BH;601456.59;789210.66;6142
+6144;2001327348;B03000;AMEACA;RUA OLINTO MAGAL;1850;49834;17/6/2001 18:04:00;CIDADAO COMUM;S;;IPANEMA;BH;604865.84;797988.70;6143
+6145;2001327477;B03000;AMEACA;RUA ABRAHAO JOAO;86;80859;17/6/2001 19:07:00;CIDADAO COMUM;S;;PARQUE SAO JOSE;BH;607070.62;792177.61;6144
+6146;2001327494;B03000;AMEACA;PRACA NOSSA SENH;95;47942;17/6/2001 19:19:00;CIDADAO COMUM;S;;MILIONARIOS;BH;604200.40;790234.15;6145
+6147;2001327534;B06000;LESAO CORPORAL;RUA A;162;36460;17/6/2001 19:42:00;CIDADAO COMUM;S;0;MINASCAIXA;BH;609181.68;810054.73;6146
+6148;2001327554;B06000;LESAO CORPORAL;RUA VICENTE CUNH;55;71848;17/6/2001 19:55:00;CIDADAO COMUM;S;0;BOA VISTA;BH;615551.80;800264.65;6147
+6149;2001327575;B03000;AMEACA;RUA CAICARA;1696;11451;17/6/2001 20:05:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;615995.71;799311.10;6148
+6150;2001327576;B06000;LESAO CORPORAL;RUA JANE EYRE;1227;36910;17/6/2001 20:05:00;CIDADAO COMUM;S;CSA;MINASLANDIA;BH;611848.15;804028.58;6149
+6151;2001327582;B06000;LESAO CORPORAL;RUA LIMA;15;41063;17/6/2001 20:09:00;CIDADAO COMUM;S;LJ1;COPACABANA;BH;606113.57;806114.27;6150
+6152;2001327590;B06000;LESAO CORPORAL;RUA ANA RAFAEL D;513;78572;17/6/2001 20:12:00;CIDADAO COMUM;N;;VILA SANTA RITA;BH;601339.91;787583.63;6151
+6153;2001327630;B03000;AMEACA;RUA SAN MARTIN;150;60208;17/6/2001 20:27:00;CIDADAO COMUM;S;CAB;UNIAO;BH;612640.75;801688.68;6152
+6154;2001327649;B06000;LESAO CORPORAL;RUA FREI ZACARIA;186;37610;17/6/2001 20:34:00;CIDADAO COMUM;S;PROX. FINAL DO 3;SARANDI (URCA/BH;BH;603664.32;802044.70;6153
+6155;2001327742;B04002;HOMICIDIO CONSUM;AV JOSE CANDIDO ;2468;12602;17/6/2001 21:29:00;CIDADAO COMUM;N;DROGARIA DROGAZA;DOM JOAQUIM;BH;613887.75;801512.24;6154
+6156;2001327772;B03000;AMEACA;RUA DA ABOLICAO;401;42242;17/6/2001 21:44:00;CIDADAO COMUM;S;;JARDIM DOS COMER;BH;607586.54;810989.54;6155
+6157;2001327817;B03000;AMEACA;RUA ESTRELA DA J;138;26705;17/6/2001 22:17:00;CIDADAO COMUM;N;FR462;VISTA ALEGRE;BH;604749.69;793333.72;6156
+6158;2001327832;B06000;LESAO CORPORAL;AV BRIGADEIRO ED;1099;2860;17/6/2001 22:26:00;CIDADAO COMUM;N;;GLORIA;BH;604209.92;798598.54;6157
+6159;2001327868;B03000;AMEACA;RUA JANAUBA;370;36891;17/6/2001 22:45:00;CIDADAO COMUM;0;;VISTA ALEGRE;BH;604535.02;793331.14;6158
+6160;2001327870;B03000;AMEACA;RUA NIASSA;60;47592;17/6/2001 22:47:00;CIDADAO COMUM;S;;SAO SALVADOR;BH;602868.95;799108.68;6159
+6161;2001327892;B06000;LESAO CORPORAL;RUA MARIA ROSA D;758;107800;17/6/2001 22:58:00;CIDADAO COMUM;N;;MANTIQUEIRA;BH;606487.47;811625.86;6160
+6162;2001327956;B06000;LESAO CORPORAL;RUA TUIUTI;1131;69849;17/6/2001 23:43:00;CIDADAO COMUM;N;0;PADRE EUSTAQUIO;BH;606881.12;797315.71;6161
+6163;2001327960;B06000;LESAO CORPORAL;BECO BOA ESPERAN;38;302223;17/6/2001 23:45:00;CIDADAO COMUM;S;0;MORRO DO PAPAGAI;BH;610876.57;793768.26;6162
+6164;2001327985;B03000;AMEACA;RUA DAS OLIVEIRA;86;78922;17/6/2001 23:58:00;CIDADAO COMUM;S;0;PADRE EUSTAQUIO;BH;606298.52;796974.69;6163
+6165;2001328011;B09000;ABANDONO DE INCA;RUA GARRET;1186;30678;18/6/2001 00:21:00;INICIATIVA;S;0;JARDIM AMERICA;BH;607366.16;794291.41;6164
+6166;2001328079;B06000;LESAO CORPORAL;RUA JOAO PIRES;508;37866;18/6/2001 01:33:00;CIDADAO COMUM;S;;CABANA;BH;604906.04;794212.99;6165
+6167;2001328087;B06000;LESAO CORPORAL;RUA AGGEO PIO;40;89711;18/6/2001 01:40:00;CIDADAO COMUM;S;0;PALMEIRAS;BH;606610.57;790431.18;6166
+6168;2001328091;B04001;HOMICIDIO TENTAD;AV BARAO HOMEM D;1500;7936;18/6/2001 01:51:00;INICIATIVA;N;0;LEONINA;BH;607932.09;793780.23;6167
+6169;2001328365;B06000;LESAO CORPORAL;RUA MARIA REGINA;759;124771;18/6/2001 08:52:00;INICIATIVA;S;0;CEU AZUL;BH;604595.45;807095.92;6168
+6170;2001328473;B06000;LESAO CORPORAL;AV BELEM;875;8913;18/6/2001 10:02:00;CIDADAO COMUM;S;0;VERA CRUZ;BH;615290.39;798197.24;6169
+6171;2001328662;B03000;AMEACA;RUA UARIRA;350;70136;18/6/2001 12:17:00;INICIATIVA;S;0;SAO GERALDO;BH;616162.91;799326.26;6170
+6172;2001328667;B04001;HOMICIDIO TENTAD;AV AFONSO PENA;1650;1259;18/6/2001 12:19:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611599.78;796278.99;6171
+6173;2001328669;B06000;LESAO CORPORAL;RUA DORIVAL MACH;618;42227;18/6/2001 12:20:00;CIDADAO COMUM;N;;SANTA MONICA;BH;607487.17;807388.25;6172
+6174;2001328845;B06000;LESAO CORPORAL;RUA LASSANCE;586;84415;18/6/2001 14:13:00;CIDADAO COMUM;S;;SAO GERALDO;BH;615776.61;799647.18;6173
+6175;2001328929;B03000;AMEACA;RUA CINCO;100;78037;18/6/2001 15:07:00;CIDADAO COMUM;N;;INDEPENDENCIA;BH;601512.54;786086.62;6174
+6176;2001328960;B06000;LESAO CORPORAL;RUA ASSEMBLEIA;217;6338;18/6/2001 15:30:00;CIDADAO COMUM;S;;LUXEMBURGO;BH;609594.93;794581.12;6175
+6177;2001329136;B06000;LESAO CORPORAL;RUA PROFESSORA G;370;86335;18/6/2001 17:08:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611783.09;807548.07;6176
+6178;2001329145;B03000;AMEACA;RUA TRES;71;76476;18/6/2001 17:14:00;CIDADAO COMUM;S;;REGINA;BH;599087.41;789774.50;6177
+6179;2001329160;B03000;AMEACA;RUA DONA CLARA;233;22859;18/6/2001 17:26:00;CIDADAO COMUM;S;;PARQUE RIACHUELO;BH;609877.61;800349.00;6178
+6180;2001329176;B03000;AMEACA;RUA SAO PAULO;1033;63464;18/6/2001 17:32:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;610899.52;796753.82;6179
+6181;2001329379;B03000;AMEACA;RUA SANTO AGOSTI;1271;61557;18/6/2001 19:17:00;CIDADAO COMUM;N;;INSTITUTO AGRONO;BH;613648.90;799370.40;6180
+6182;2001329382;B04001;HOMICIDIO TENTAD;RUA PATROCINIO;118;52574;18/6/2001 19:17:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;609914.10;797517.10;6181
+6183;2001329468;B06000;LESAO CORPORAL;RUA OBI;2;49052;18/6/2001 20:03:00;CIDADAO COMUM;S;;CH BETANIA;BH;605192.56;792417.97;6182
+6184;2001329495;B04002;HOMICIDIO CONSUM;AV CIVILIZACAO;889;51657;18/6/2001 20:20:00;CIDADAO COMUM;N;0;VILA SANTA BRANC;BH;609155.17;808648.71;6183
+6185;2001329508;B06000;LESAO CORPORAL;RUA ALICE TERAIA;200;92767;18/6/2001 20:26:00;INICIATIVA;S;0;PILAR;BH;607185.13;788258.51;6184
+6186;2001329511;B06000;LESAO CORPORAL;RUA BEZERRA DE M;94;9525;18/6/2001 20:28:00;CIDADAO COMUM;N;0;NAZARE;BH;615431.97;804557.49;6185
+6187;2001329529;B03000;AMEACA;RUA RIACHO;80;24927;18/6/2001 20:39:00;CIDADAO COMUM;S;;TAQUARIL;BH;617249.69;797177.50;6186
+6188;2001329603;B08000;VIOLACAO DE DOMI;RUA HENRIQUE BAD;171;86020;18/6/2001 21:35:00;CIDADAO COMUM;S;;PARQUE SAO JOSE;BH;607178.34;792364.15;6187
+6189;2001329650;B03000;AMEACA;ALAMEDA VARGEM G;38;95967;18/6/2001 22:24:00;CIDADAO COMUM;S;0;VILA CASTANHEIRA;BH;601365.77;788667.34;6188
+6190;2001329697;B06000;LESAO CORPORAL;RUA BANDONION;472;170139;18/6/2001 22:55:00;CIDADAO COMUM;S;PX472;VILA CAFEZAL;BH;614136.44;794775.38;6189
+6191;2001329821;B06000;LESAO CORPORAL;AV OIAPOQUE;85;49166;19/6/2001 00:47:00;INICIATIVA;S;0;CENTRO (BH);BH;611176.91;797703.67;6190
+6192;2001329825;B06000;LESAO CORPORAL;RUA CORREGO DA M;400;18160;19/6/2001 00:49:00;CIDADAO COMUM;N;AP902;HORTO;BH;613235.32;798042.59;6191
+6193;2001329874;B03000;AMEACA;AV SERRANA;217;65040;19/6/2001 02:20:00;CIDADAO COMUM;S;;SERRANO;BH;603435.57;801125.64;6192
+6194;2001329900;B06000;LESAO CORPORAL;AV OIAPOQUE;280;49166;19/6/2001 03:19:00;INICIATIVA;S;0;CENTRO (BH);BH;610908.21;797831.05;6193
+6195;2001329991;B04001;HOMICIDIO TENTAD;RUA DAS GABIROBA;5;30375;19/6/2001 07:29:00;CIDADAO COMUM;N;;VILA CLORIS;BH;610034.72;808298.49;6194
+6196;2001330003;B06000;LESAO CORPORAL;RUA PARACATU;1570;52095;19/6/2001 07:44:00;CIDADAO COMUM;S;;SANTO AGOSTINHO;BH;609475.97;795885.87;6195
+6197;2001330261;B03000;AMEACA;RUA ALVARENGA;30;74502;19/6/2001 10:27:00;INICIATIVA;N;INICIATIVA DA VP;PRIMEIRO DE NOVE;BH;612312.21;805334.82;6196
+6198;2001330306;B06000;LESAO CORPORAL;RUA LAGOA DOS PA;41;40190;19/6/2001 10:54:00;CIDADAO COMUM;S;0;JARDIM LEBLON;BH;605679.60;807460.55;6197
+6199;2001330376;B03000;AMEACA;RUA SAO JOAO EVA;676;62865;19/6/2001 11:36:00;CIDADAO COMUM;S;0;SANTO ANTONIO;BH;610809.68;794146.08;6198
+6200;2001330419;B03000;AMEACA;PRACA COMENDADOR;10;16395;19/6/2001 12:12:00;INICIATIVA;S;0;FLORESTA;BH;611966.10;798060.14;6199
+6201;2001330451;B03000;AMEACA;RUA CORONEL MARC;281;17978;19/6/2001 12:43:00;CIDADAO COMUM;S;;SANTA ROSA;BH;610254.94;803257.66;6200
+6202;2001330484;B03000;AMEACA;RUA BOM JESUS DA;659;99680;19/6/2001 13:06:00;CIDADAO COMUM;N;BL47    AP1003;SANTA TEREZINHA;BH;604062.02;802892.42;6201
+6203;2001330499;B06000;LESAO CORPORAL;RUA STA APOLONIA;120;60352;19/6/2001 13:15:00;CIDADAO COMUM;S;0;DOM JOAQUIM;BH;614079.87;802000.80;6202
+6204;2001330555;B03000;AMEACA;RUA FRANCISCO RO;64;10994;19/6/2001 13:44:00;CIDADAO COMUM;S;;DOM JOAQUIM;BH;613740.83;801756.15;6203
+6205;2001330623;B03000;AMEACA;RUA AQUILES LOBO;470;5219;19/6/2001 14:41:00;CIDADAO COMUM;S;;FLORESTA;BH;611971.87;797103.12;6204
+6206;2001330632;B03000;AMEACA;RUA ENGENHEIRO A;103;25500;19/6/2001 14:46:00;CIDADAO COMUM;S;;FLORAMAR;BH;611346.97;806271.04;6205
+6207;2001330720;B03000;AMEACA;AV AUGUSTO DE LI;1549;6731;19/6/2001 15:53:00;INICIATIVA;S;;BARRO PRETO;BH;609833.79;796889.71;6206
+6208;2001330833;B06000;LESAO CORPORAL;RUA PAULO KRUGER;230;55910;19/6/2001 16:46:00;CIDADAO COMUM;N;0;FLORAMAR;BH;611701.18;806916.68;6207
+6209;2001330896;B04001;HOMICIDIO TENTAD;RUA DONA CARMEM;741;22820;19/6/2001 17:22:00;CIDADAO COMUM;S;0;SARANDI (URCA/BH;BH;604141.60;802506.92;6208
+6210;2001330963;B02000;RIXA;RUA DA OLARIA;507;18640;19/6/2001 18:05:00;CIDADAO COMUM;N;REF:PROXIMO COGR;OLARIA;BH;601386.46;789148.72;6209
+6211;2001331052;B03000;AMEACA;RUA VIOLETA DE M;178;80253;19/6/2001 18:56:00;CIDADAO COMUM;S;0;SAO JOSE;BH;605196.32;799173.61;6210
+6212;2001331096;B06000;LESAO CORPORAL;RUA JOSE JORGE F;70;38884;19/6/2001 19:14:00;CIDADAO COMUM;S;;NOVA BARROCA;BH;607287.63;792753.33;6211
+6213;2001331262;B03000;AMEACA;RUA ESTADOS UNID;337;26239;19/6/2001 20:34:00;CIDADAO COMUM;S;LJ1;COPACABANA;BH;606183.03;806063.64;6212
+6214;2001331297;B03000;AMEACA;AV PARANA;200;52230;19/6/2001 20:55:00;INICIATIVA;N;0;CENTRO (BH);BH;610763.62;797326.10;6213
+6215;2001331304;B04002;HOMICIDIO CONSUM;RUA PRINCIPAL;300;170504;19/6/2001 20:59:00;INICIATIVA;N;0;MORRO DAS PEDRAS;BH;608596.19;793933.42;6214
+6216;2001331314;B03000;AMEACA;AV JOSE BONIFACI;189;38579;19/6/2001 21:07:00;INICIATIVA;S;0;PRADO LOPES;BH;610210.56;798939.37;6215
+6217;2001331344;B04002;HOMICIDIO CONSUM;RUA URSULA PAULI;1728;71066;19/6/2001 21:27:00;INICIATIVA;N;0;SALGADO FILHO;BH;605896.08;792802.21;6216
+6218;2001331359;B06000;LESAO CORPORAL;RUA DR PEDRO RUE;700;113853;19/6/2001 21:36:00;CIDADAO COMUM;N;;LETICIA;BH;607002.38;809601.56;6217
+6219;2001331367;B03000;AMEACA;RUA BEIRA MAR;421;94992;19/6/2001 21:40:00;CIDADAO COMUM;S;;SARANDI (URCA/BH;BH;603053.29;802253.83;6218
+6220;2001331373;B03000;AMEACA;RUA CALDAS DA RA;506;61100;19/6/2001 21:43:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609820.95;802507.00;6219
+6221;2001331413;B04001;HOMICIDIO TENTAD;RUA FERNAO DIAS;100;28133;19/6/2001 22:05:00;INICIATIVA;N;0;CASA BRANCA;BH;616308.02;799694.32;6220
+6222;2001331494;B06000;LESAO CORPORAL;RUA DOS TUPIS;337;69965;19/6/2001 23:06:00;CIDADAO COMUM;S;;CENTRO (BH);BH;610958.56;796903.24;6221
+6223;2001331513;B06000;LESAO CORPORAL;RUA OSCAR TROMPO;1372;50452;19/6/2001 23:19:00;INICIATIVA;S;;MORRO DAS PEDRAS;BH;608553.52;794568.52;6222
+6224;2001331519;B04001;HOMICIDIO TENTAD;RUA GENTIOS;1350;30983;19/6/2001 23:21:00;CIDADAO COMUM;S;;CORACAO DE JESUS;BH;608905.13;793585.28;6223
+6225;2001331529;B04001;HOMICIDIO TENTAD;AV PORTUGAL;150;54816;19/6/2001 23:32:00;CIDADAO COMUM;N;;JARDIM ATLANTICO;BH;605670.52;806041.29;6224
+6226;2001331553;B03000;AMEACA;RUA MARIA DA GLO;63;86288;19/6/2001 23:49:00;CIDADAO COMUM;S;CS02;JAQUELINE;BH;611227.16;810173.00;6225
+6227;2001331562;B03000;AMEACA;RUA PROFESSOR MI;220;91128;19/6/2001 23:54:00;CIDADAO COMUM;S;APTO 102;BURITIS;BH;607948.05;790719.17;6226
+6228;2001331618;B06000;LESAO CORPORAL;RUA GUAICURUS;451;32009;20/6/2001 00:44:00;CIDADAO COMUM;S;PX428;CENTRO (BH);BH;611210.22;797600.57;6227
+6229;2001331632;B04002;HOMICIDIO CONSUM;AV CRISTIANO MAC;5397;18652;20/6/2001 00:53:00;CIDADAO COMUM;N;;SAO PAULO;BH;612256.79;802178.98;6228
+6230;2001331635;B03000;AMEACA;RUA PITANGUI;33;54365;20/6/2001 00:56:00;CIDADAO COMUM;N;0;SAO CRISTOVAO;BH;610543.96;799415.99;6229
+6231;2001331739;B04001;HOMICIDIO TENTAD;RUA BARAO DE COR;586;7910;20/6/2001 03:47:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;610052.00;805335.74;6230
+6232;2001331772;B06000;LESAO CORPORAL;RUA DOUTOR CEZAR;145;80962;20/6/2001 05:06:00;CIDADAO COMUM;N;;NOVA CINTRA;BH;605479.20;793361.18;6231
+6233;2001331818;B04002;HOMICIDIO CONSUM;RUA QUATRO DE MA;6;57118;20/6/2001 06:56:00;CIDADAO COMUM;N;0;LEONINA;BH;608650.19;793692.46;6232
+6234;2001332186;B06000;LESAO CORPORAL;RUA DAS FLORES;200;170214;20/6/2001 11:18:00;CIDADAO COMUM;N;CAB;CABANA;BH;604375.80;794455.85;6233
+6235;2001332248;B03000;AMEACA;AV PRESIDENTE CA;1185;55125;20/6/2001 12:04:00;CIDADAO COMUM;S;CS;CAICARA;BH;608290.93;799772.80;6234
+6236;2001332295;B06000;LESAO CORPORAL;RUA JACUI;1131;36734;20/6/2001 12:36:00;INICIATIVA;N;0;CONCORDIA;BH;611706.90;799025.84;6235
+6237;2001332335;B03000;AMEACA;RUA IBIRAPITANGA;59;33880;20/6/2001 13:11:00;CIDADAO COMUM;S;;DOM CABRAL;BH;605182.78;796323.06;6236
+6238;2001332348;B03000;AMEACA;RUA JOSUE MARTIN;464;84821;20/6/2001 13:18:00;CIDADAO COMUM;N;;DA LAGOA;BH;604491.32;809555.61;6237
+6239;2001332393;B03000;AMEACA;RUA RUI GUERRA;20;301669;20/6/2001 13:45:00;CIDADAO COMUM;S;;VILA CAFEZAL;BH;614477.59;795128.95;6238
+6240;2001332458;B03000;AMEACA;RUA VASCO DA GAM;334;71330;20/6/2001 14:26:00;CIDADAO COMUM;S;0;SAO BERNARDO;BH;611151.08;804995.87;6239
+6241;2001332506;B03000;AMEACA;RUA VOLTS;40;73626;20/6/2001 15:02:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612172.58;803421.57;6240
+6242;2001332547;B06000;LESAO CORPORAL;RUA CARDEAL;18;103001;20/6/2001 15:26:00;INICIATIVA;N;0;CONJUNTO ALIPIO ;BH;604210.73;799874.42;6241
+6243;2001332720;B06000;LESAO CORPORAL;RUA ANTARES;70;4244;20/6/2001 16:57:00;INICIATIVA;S;0;SANTA LUCIA;BH;610151.02;793124.83;6242
+6244;2001332733;B05000;SEQUESTRO E CARC;RUA JULIO PEREIR;298;102239;20/6/2001 17:02:00;INICIATIVA;N;0;CIDADE NOVA;BH;612286.60;800677.40;6243
+6245;2001332761;B03000;AMEACA;AV CIVILIZACAO;911;51657;20/6/2001 17:16:00;CIDADAO COMUM;S;;JARDIM FLORENCIA;BH;609133.74;808652.87;6244
+6246;2001332797;B03000;AMEACA;RUA ANGELINA DE ;1076;96207;20/6/2001 17:36:00;CIDADAO COMUM;S;;DOM SILVERIO;BH;615236.49;804525.63;6245
+6247;2001332806;B03000;AMEACA;AV SANTA TEREZIN;355;61415;20/6/2001 17:42:00;CIDADAO COMUM;S;;SANTA TEREZINHA;BH;604513.16;802496.64;6246
+6248;2001332833;B06000;LESAO CORPORAL;RUA SESSENTA E U;160;33689;20/6/2001 17:54:00;CIDADAO COMUM;S;0;CONJUNTO FELICID;BH;612483.89;806937.99;6247
+6249;2001332933;B03000;AMEACA;RUA ESTORIL;133;63827;20/6/2001 18:41:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609800.46;802609.37;6248
+6250;2001333044;B06000;LESAO CORPORAL;RUA DA PAZ;110;31236;20/6/2001 19:32:00;CIDADAO COMUM;S;;CONJ HAB JARDIM ;BH;603850.05;798083.86;6249
+6251;2001333048;B06000;LESAO CORPORAL;AV BERNARDO VASC;837;9411;20/6/2001 19:33:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;610594.13;800829.58;6250
+6252;2001333051;B03000;AMEACA;RUA PROFESSORA A;90;59923;20/6/2001 19:28:00;CIDADAO COMUM;S;;CAETANO FURQUIM;BH;616394.40;799545.27;6251
+6253;2001333134;B04001;HOMICIDIO TENTAD;RUA PROFESSOR PI;29;55658;20/6/2001 20:37:00;CIDADAO COMUM;N;0;CIDADE NOVA;BH;612187.10;800801.34;6252
+6254;2001333224;B03000;AMEACA;RUA DOS TUPINAMB;953;69940;20/6/2001 21:36:00;CIDADAO COMUM;S;APTO 1207;CENTRO (BH);BH;610646.84;797421.18;6253
+6255;2001333234;B03000;AMEACA;RUA CRISTAL;83;18611;20/6/2001 21:38:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612657.77;797382.69;6254
+6256;2001333296;B03000;AMEACA;RUA ARISTIDES VI;75;84471;20/6/2001 22:24:00;CIDADAO COMUM;S;;MARIA GORETTI;BH;614483.20;803729.27;6255
+6257;2001333297;B06000;LESAO CORPORAL;AV OIAPOQUE;242;49166;20/6/2001 22:26:00;INICIATIVA;S;0;CENTRO (BH);BH;610939.71;797820.89;6256
+6258;2001333303;B03000;AMEACA;RUA EUCLASIO;474;26787;20/6/2001 22:25:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613904.16;796503.28;6257
+6259;2001333380;B03000;AMEACA;RUA ITAI;959;35413;20/6/2001 23:12:00;CIDADAO COMUM;S;0;SANTA EFIGENIA;BH;613839.32;796099.97;6258
+6260;2001333415;B04002;HOMICIDIO CONSUM;RUA STO ANTONIO;5;61759;20/6/2001 23:29:00;CIDADAO COMUM;S;;SAO TOMAZ;BH;609947.81;805765.49;6259
+6261;2001333440;B06000;LESAO CORPORAL;RUA PURUS;125;55819;20/6/2001 23:40:00;CIDADAO COMUM;N;0;CONCORDIA;BH;611069.17;799069.41;6260
+6262;2001333517;B06000;LESAO CORPORAL;RUA ANDARAI;286;3720;21/6/2001 01:05:00;CIDADAO COMUM;N;0;NOVA VISTA (SB);SB;615301.42;800837.38;6261
+6263;2001333630;B03000;AMEACA;AV PRESIDENTE CA;320;55125;21/6/2001 04:18:00;INICIATIVA;S;0;CAMPUS UFMG;BH;608476.86;798679.56;6262
+6264;2001333881;B03000;AMEACA;AV PARANAIBA;429;52256;21/6/2001 09:18:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609777.38;799943.11;6263
+6265;2001333883;B03000;AMEACA;AV DOS ANDRADAS;3540;3761;21/6/2001 09:20:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;613913.55;797194.26;6264
+6266;2001333922;B03000;AMEACA;RUA CRUCILANDIA;55;18781;21/6/2001 09:44:00;CIDADAO COMUM;N;;JARDIM LEBLON;BH;605926.67;807569.38;6265
+6267;2001333998;B06000;LESAO CORPORAL;RUA ERNESTO AUST;420;25784;21/6/2001 10:37:00;CIDADAO COMUM;N;;BOA VISTA;BH;614936.22;799730.60;6266
+6268;2001334006;B04001;HOMICIDIO TENTAD;RUA CINQUENTA;350;302845;21/6/2001 10:42:00;INICIATIVA;S;0;TUPI;BH;614150.27;805475.49;6267
+6269;2001334147;B06000;LESAO CORPORAL;RUA AUGUSTO JOSE;283;6729;21/6/2001 12:10:00;CIDADAO COMUM;N;;BETANIA;BH;605791.54;792055.74;6268
+6270;2001334211;B08000;VIOLACAO DE DOMI;RUA OFICINAS;329;49140;21/6/2001 13:01:00;CIDADAO COMUM;N;;ESPLANADA;BH;614686.26;798740.80;6269
+6271;2001334490;B03000;AMEACA;RUA LAJEDO;530;130034;21/6/2001 15:53:00;CIDADAO COMUM;S;;SAO GABRIEL;BH;614592.06;804513.45;6270
+6272;2001334502;B04001;HOMICIDIO TENTAD;RUA JUSCELINO KU;45;74861;21/6/2001 16:00:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616747.23;804553.20;6271
+6273;2001334566;B03000;AMEACA;RUA F DOIS;1;28653;21/6/2001 16:25:00;CIDADAO COMUM;S;;CAPITAO EDUARDO;BH;618568.08;806941.06;6272
+6274;2001334584;B03000;AMEACA;RUA TOME DE SOUZ;920;67998;21/6/2001 16:36:00;CIDADAO COMUM;N;;FUNCIONARIOS;BH;611510.63;795206.41;6273
+6275;2001334682;B03000;AMEACA;RUA SAO TOMAS;17;63770;21/6/2001 17:25:00;CIDADAO COMUM;N;;PLANALTO;BH;610686.83;805550.99;6274
+6276;2001334696;B03000;AMEACA;AV AMAZONAS;345;3140;21/6/2001 17:32:00;INICIATIVA;N;0;CENTRO (BH);BH;611084.15;797100.95;6275
+6277;2001334831;B06000;LESAO CORPORAL;RUA BANDONION;172;170139;21/6/2001 18:43:00;CIDADAO COMUM;S;0;VILA CAFEZAL;BH;613977.41;795089.89;6276
+6278;2001335098;B04001;HOMICIDIO TENTAD;RUA SERINGUEIRA;300;90471;21/6/2001 21:06:00;CIDADAO COMUM;S;0;PATROCINIO;BH;605268.53;794551.84;6277
+6279;2001335107;B06000;LESAO CORPORAL;RUA JOAQUIM DE F;1479;38033;21/6/2001 21:15:00;INICIATIVA;S;;SANTA HELENA (BH;BH;603134.26;789846.88;6278
+6280;2001335108;B09000;ABANDONO DE INCA;RUA CANDIDA FERR;5;12542;21/6/2001 21:14:00;POLICIAL MILITAR;S;;NOVA GAMELEIRA;BH;605763.19;794511.59;6279
+6281;2001335112;B06000;LESAO CORPORAL;RUA HELIUM;449;32976;21/6/2001 21:18:00;CIDADAO COMUM;S;;NOVA FLORESTA;BH;611770.19;800159.48;6280
+6282;2001335155;B06000;LESAO CORPORAL;AV OIAPOQUE;184;49166;21/6/2001 21:50:00;CIDADAO COMUM;N;0;CENTRO BH;BH;610988.22;797810.47;6281
+6283;2001335157;B03000;AMEACA;RUA DOS MAIAS;114;83999;21/6/2001 21:52:00;CIDADAO COMUM;S;CA03;SANTA MONICA;BH;607253.67;807274.56;6282
+6284;2001335172;B04001;HOMICIDIO TENTAD;AV JOSE BONIFACI;284;38579;21/6/2001 22:02:00;INICIATIVA;N;0;PRADO LOPES;BH;610129.14;799078.88;6283
+6285;2001335185;B04001;HOMICIDIO TENTAD;AV CRISTIANO MAC;5555;18652;21/6/2001 22:12:00;POLICIAL MILITAR;S;0;DOS PALMARES;BH;612227.11;802603.49;6284
+6286;2001335235;B03000;AMEACA;RUA PROFESSORA G;520;86335;21/6/2001 22:56:00;CIDADAO COMUM;S;;FLORAMAR;BH;611761.04;807676.30;6285
+6287;2001335261;B03000;AMEACA;RUA JULIA LOPES ;108;95333;21/6/2001 23:09:00;CIDADAO COMUM;S;;SANTA MARIA;BH;603320.49;795112.03;6286
+6288;2001335286;B03000;AMEACA;RUA FELICIDADE;70;25743;21/6/2001 23:28:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617179.69;797703.11;6287
+6289;2001335330;B03000;AMEACA;RUA TABELIAO FER;207;66692;22/6/2001 00:05:00;INICIATIVA;S;0;CIDADE NOVA;BH;612332.83;800624.31;6288
+6290;2001335365;B04001;HOMICIDIO TENTAD;RUA RODRIGUES DO;45;59154;22/6/2001 00:31:00;CIDADAO COMUM;N;0;ERMELINDA;BH;608945.83;801127.50;6289
+6291;2001335427;B06000;LESAO CORPORAL;AV AMAZONAS;1746;3140;22/6/2001 01:38:00;CIDADAO COMUM;S;;BARRO PRETO;BH;609974.58;796529.68;6290
+6292;2001335428;B03000;AMEACA;RUA ANTONIO JOSE;300;7431;22/6/2001 01:38:00;CIDADAO COMUM;0;0;CEU AZUL;BH;605178.86;807552.02;6291
+6293;2001335492;B02000;RIXA;RUA PADRE PEDRO ;5631;51657;22/6/2001 02:50:00;INICIATIVA;N;0;MANTIQUEIRA;BH;606035.58;809984.17;6292
+6294;2001335562;B03000;AMEACA;RUA CLAUDIO MANO;47;15972;22/6/2001 04:52:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;612460.15;795339.86;6293
+6295;2001335644;B03000;AMEACA;RUA OITO;56;84819;22/6/2001 07:30:00;CIDADAO COMUM;N;;DA LAGOA;BH;604483.44;809351.75;6294
+6296;2001335668;B04001;HOMICIDIO TENTAD;RUA BOAVENTURA;361;9783;22/6/2001 07:53:00;CIDADAO COMUM;S;;VILA INDAIA;BH;607139.57;802390.07;6295
+6297;2001335967;B03000;AMEACA;AV DO CONTORNO;3800;17228;22/6/2001 11:23:00;CIDADAO COMUM;S;;SAO LUCAS;BH;612975.85;796174.37;6296
+6298;2001336449;B06000;LESAO CORPORAL;AV DO CONTORNO;8372;17228;22/6/2001 16:53:00;CIDADAO COMUM;N;;CENTRO (BH);BH;609515.14;795627.09;6297
+6299;2001336490;B06000;LESAO CORPORAL;RUA CLOVIS DE SO;138;118642;22/6/2001 17:14:00;INICIATIVA;N;0;REGINA;BH;598943.95;789862.49;6298
+6300;2001336510;B03000;AMEACA;RUA BOM JESUS DA;497;99680;22/6/2001 17:23:00;CIDADAO COMUM;S;0;SANTA TEREZINHA;BH;604100.08;802814.35;6299
+6301;2001336624;B03000;AMEACA;RUA VOLGA;37;73581;22/6/2001 18:25:00;CIDADAO COMUM;S;;COQUEIROS;BH;602559.03;799047.10;6300
+6302;2001336641;B03000;AMEACA;RUA LIMEIRA;275;54050;22/6/2001 18:32:00;CIDADAO COMUM;S;;PIRATININGA;BH;606243.18;809547.88;6301
+6303;2001336650;B03000;AMEACA;RUA IPAMERI;310;14825;22/6/2001 18:33:00;CIDADAO COMUM;N;;ARAGUAIA;BH;605162.04;789659.13;6302
+6304;2001336843;B04001;HOMICIDIO TENTAD;RUA SAO GERALDO;73;170283;22/6/2001 19:52:00;CIDADAO COMUM;N;;CABANA;BH;604695.64;794127.52;6303
+6305;2001336866;B03000;AMEACA;RUA AUREO DRUMON;35;117435;22/6/2001 20:06:00;CIDADAO COMUM;S;0;CASA BRANCA;BH;616403.94;799816.82;6304
+6306;2001336877;B03000;AMEACA;RUA SAO PAULO;848;63464;22/6/2001 20:12:00;CIDADAO COMUM;S;AP1104;CENTRO (BH);BH;610915.13;796961.87;6305
+6307;2001336880;B06000;LESAO CORPORAL;RUA IRACEMA;34;34896;22/6/2001 20:14:00;CIDADAO COMUM;S;C;VILA HUMAITA;BH;610298.98;801523.27;6306
+6308;2001336908;B06000;LESAO CORPORAL;RUA FLOR DE ABRI;75;28464;22/6/2001 20:27:00;CIDADAO COMUM;N;0;JARDIM MONTANHES;BH;605861.84;799044.97;6307
+6309;2001336942;B06000;LESAO CORPORAL;AV AMAZONAS;5253;3140;22/6/2001 20:48:00;INICIATIVA;S;0;NOVA SUISSA;BH;606825.09;795951.48;6308
+6310;2001337020;B03000;AMEACA;RUA JULIO DE CAS;234;39470;22/6/2001 21:33:00;CIDADAO COMUM;S;;CINQUENTENARIO;BH;606434.93;792926.11;6309
+6311;2001337044;B06000;LESAO CORPORAL;RUA ZONA DA MATA;110;74049;22/6/2001 21:48:00;CIDADAO COMUM;S;0;SANTA AMELIA;BH;607020.99;806347.09;6310
+6312;2001337108;B04001;HOMICIDIO TENTAD;RUA BARREIRO GRA;120;8258;22/6/2001 22:27:00;INICIATIVA;N;0;MARIA GORETTI;BH;614113.53;803391.42;6311
+6313;2001337246;B04001;HOMICIDIO TENTAD;RUA PADRE PEDRO ;322;51657;22/6/2001 23:46:00;CIDADAO COMUM;S;UPA VENDA NOVA;VILA SANTO ANTON;BH;609650.08;808286.90;6312
+6314;2001337247;B06000;LESAO CORPORAL;AV TERESA CRISTI;6778;67512;22/6/2001 23:48:00;INICIATIVA;S;0;CINQUENTENARIO;BH;606046.64;793197.39;6313
+6315;2001337286;B06000;LESAO CORPORAL;RUA CONEGO SANTA;881;16859;23/6/2001 00:15:00;CIDADAO COMUM;S;0;CACHOEIRINHA;BH;610516.02;800779.29;6314
+6316;2001337321;B06000;LESAO CORPORAL;RUA URANDI;150;70974;23/6/2001 00:41:00;CIDADAO COMUM;S;;CONCORDIA;BH;611599.58;799038.35;6315
+6317;2001337385;B06000;LESAO CORPORAL;RUA SAO PAULO;279;63464;23/6/2001 01:22:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611088.02;797493.26;6316
+6318;2001337403;B03000;AMEACA;RUA IARA;312;33751;23/6/2001 01:36:00;CIDADAO COMUM;N;;POMPEIA;BH;614667.76;797898.82;6317
+6319;2001337488;B06000;LESAO CORPORAL;RUA MARCO AURELI;32;61821;23/6/2001 02:44:00;INICIATIVA;S;0;NAZARE;BH;615693.25;804691.63;6318
+6320;2001337508;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;101;26052;23/6/2001 02:58:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;611395.36;797540.06;6319
+6321;2001337521;B04001;HOMICIDIO TENTAD;AV BERNARDO VASC;2717;9411;23/6/2001 03:11:00;CIDADAO COMUM;N;;IPIRANGA;BH;612138.82;801992.11;6320
+6322;2001337610;B04002;HOMICIDIO CONSUM;AV CORONEL DURVA;732;17688;23/6/2001 04:42:00;CIDADAO COMUM;N;;DURVAL DE BARROS;BH;598151.28;790894.64;6321
+6323;2001337677;B03000;AMEACA;RUA DES BRAULIO;247;19917;23/6/2001 06:15:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616279.66;797686.69;6322
+6324;2001337752;B04001;HOMICIDIO TENTAD;RUA CINQUENTA;290;106100;23/6/2001 08:12:00;CIDADAO COMUM;N;;JARDIM DOS COMER;BH;608410.77;810960.29;6323
+6325;2001337761;B03000;AMEACA;RUA DES SARAIVA;1001;66535;23/6/2001 08:16:00;CIDADAO COMUM;S;CAFU;VERA CRUZ;BH;616098.29;797767.22;6324
+6326;2001337775;B03000;AMEACA;RUA AMILCAR CABR;250;5146;23/6/2001 08:26:00;CIDADAO COMUM;S;AP303;MILIONARIOS;BH;604246.18;790098.14;6325
+6327;2001337780;B06000;LESAO CORPORAL;RUA RIBEIRAO DAS;54;46688;23/6/2001 08:33:00;CIDADAO COMUM;N;0;PARAISO;BH;614140.00;796036.93;6326
+6328;2001337790;B04001;HOMICIDIO TENTAD;BECO SAO JOAO DE;220;171084;23/6/2001 08:37:00;CIDADAO COMUM;N;0;CABANA;BH;604606.84;793833.50;6327
+6329;2001337799;B03000;AMEACA;RUA ALICE;234;170949;23/6/2001 08:45:00;CIDADAO COMUM;N;0;MORRO DAS PEDRAS;BH;608002.45;793792.58;6328
+6330;2001337820;B03000;AMEACA;RUA CARACA;948;12990;23/6/2001 09:08:00;CIDADAO COMUM;S;;SERRA;BH;613753.87;794503.33;6329
+6331;2001337934;B03000;AMEACA;RUA TIPUANA;590;74300;23/6/2001 10:45:00;CIDADAO COMUM;S;;JULIANA;BH;610702.83;809126.98;6330
+6332;2001337941;B03000;AMEACA;AV WALDIR SOEIRO;345;118904;23/6/2001 10:49:00;CIDADAO COMUM;S;CAFDS;DAS INDUSTRIAS;BH;601686.77;788954.10;6331
+6333;2001337964;B06000;LESAO CORPORAL;RUA AUGUSTO FERR;410;85575;23/6/2001 11:11:00;CIDADAO COMUM;N;;SERRA VERDE;BH;609753.87;810385.88;6332
+6334;2001338027;B03000;AMEACA;RUA JORGE ANTONI;86;86391;23/6/2001 11:55:00;CIDADAO COMUM;0;;LETICIA;BH;606706.48;809837.19;6333
+6335;2001338105;B03000;AMEACA;RUA TEN ANASTACI;486;67263;23/6/2001 12:50:00;CIDADAO COMUM;N;0;SANTA EFIGENIA;BH;613443.83;796627.00;6334
+6336;2001338144;B03000;AMEACA;RUA TEBAS;840;67090;23/6/2001 13:28:00;POLICIAL MILITAR;S;0;VERA CRUZ;BH;616073.41;798319.09;6335
+6337;2001338191;B03000;AMEACA;RUA CONEGO ROCHA;47;16833;23/6/2001 13:52:00;CIDADAO COMUM;S;AP302;GUTIERREZ;BH;609565.01;795498.13;6336
+6338;2001338232;B03000;AMEACA;RUA ROSA MARIA S;106;20131;23/6/2001 14:22:00;CIDADAO COMUM;S;0;ITAPOA;BH;609283.13;806438.01;6337
+6339;2001338238;B04001;HOMICIDIO TENTAD;RUA ALICE;5;170949;23/6/2001 14:25:00;CIDADAO COMUM;S;0;MORRO DAS PEDRAS;BH;608015.47;793880.36;6338
+6340;2001338275;B06000;LESAO CORPORAL;RUA JOSE OVIDIO ;671;10298;23/6/2001 14:50:00;CIDADAO COMUM;N;;CARDOSO;BH;603962.71;787984.77;6339
+6341;2001338325;B03000;AMEACA;RUA NICOLAU COEL;45;119759;23/6/2001 15:18:00;CIDADAO COMUM;S;;VERA CRUZ;BH;616495.40;797313.44;6340
+6342;2001338332;B03000;AMEACA;AV SANTOS DUMONT;596;61950;23/6/2001 15:23:00;CIDADAO COMUM;S;AN1;CENTRO (BH);BH;611062.63;797591.94;6341
+6343;2001338345;B03000;AMEACA;RUA BERTOPOLIS;404;41873;23/6/2001 15:31:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612526.93;804327.60;6342
+6344;2001338347;B03000;AMEACA;RUA TEFE;483;67121;23/6/2001 15:33:00;CIDADAO COMUM;S;;RENASCENCA;BH;610906.55;800086.84;6343
+6345;2001338369;B06000;LESAO CORPORAL;AV RAJA GABAGLIA;1740;57830;23/6/2001 15:48:00;INICIATIVA;S;0;LUXEMBURGO;BH;608719.62;793771.09;6344
+6346;2001338391;B03000;AMEACA;RUA VOLTA GRANDE;645;73594;23/6/2001 16:02:00;CIDADAO COMUM;S;;SAGRADA FAMILIA;BH;612975.31;798813.56;6345
+6347;2001338512;B03000;AMEACA;AV DO CONTORNO;6117;17228;23/6/2001 17:10:00;CIDADAO COMUM;N;0;CENTRO (BH);BH;611505.72;794818.76;6346
+6348;2001338573;B06000;LESAO CORPORAL;RUA DOS CONSTRUT;845;101249;23/6/2001 17:53:00;CIDADAO COMUM;S;0;CONJUNTO ALIPIO ;BH;604027.49;800198.33;6347
+6349;2001338577;B04001;HOMICIDIO TENTAD;RUA ALCIDA TORRE;120;112936;23/6/2001 17:53:00;INICIATIVA;N;0;CONJUNTO SANTA M;BH;608957.30;793494.58;6348
+6350;2001338618;B04001;HOMICIDIO TENTAD;RUA DOUTOR ALBER;15;4994;23/6/2001 18:15:00;INICIATIVA;S;0;PADRE EUSTAQUIO;BH;605823.47;797781.18;6349
+6351;2001338630;B04002;HOMICIDIO CONSUM;RUA SAO TOMAS DE;1079;63782;23/6/2001 18:24:00;CIDADAO COMUM;N;PX1079;MORRO DO PAPAGAI;BH;610696.43;793067.40;6350
+6352;2001338747;B03000;AMEACA;AV DOS ANDRADAS;4000;3761;23/6/2001 19:19:00;CIDADAO COMUM;S;;SANTA EFIGENIA;BH;614232.48;798106.24;6351
+6353;2001338771;B03000;AMEACA;RUA JOSE OSORIO;25;105091;23/6/2001 19:31:00;CIDADAO COMUM;S;;DAS INDUSTRIAS;BH;605474.09;790849.03;6352
+6354;2001338773;B03000;AMEACA;RUA ALICEDRO;77;2340;23/6/2001 19:30:00;CIDADAO COMUM;S;0;PINDORAMA;BH;602424.18;797655.47;6353
+6355;2001338837;B06000;LESAO CORPORAL;BECO PARAISO;12;302036;23/6/2001 20:03:00;INICIATIVA;S;0;PALMEIRAS;BH;606213.48;790637.47;6354
+6356;2001338908;B06000;LESAO CORPORAL;RUA CONDE D'EU;987;16631;23/6/2001 20:44:00;CIDADAO COMUM;S;;SAUDADE;BH;615598.60;797674.91;6355
+6357;2001338910;B06000;LESAO CORPORAL;RUA PERIMETRAL;178;53407;23/6/2001 20:45:00;CIDADAO COMUM;S;EM FRENTE A QUAD;CARLOS PRATES;BH;608223.50;797279.43;6356
+6358;2001338949;B06000;LESAO CORPORAL;RUA SARACA;700;63997;23/6/2001 21:07:00;CIDADAO COMUM;S;;SENHOR BOM JESUS;BH;609001.06;799557.24;6357
+6359;2001339077;B06000;LESAO CORPORAL;RUA NOVE;75;81013;23/6/2001 22:14:00;CIDADAO COMUM;S;;NOVA CINTRA;BH;605202.66;793145.62;6358
+6360;2001339116;B06000;LESAO CORPORAL;RUA ALVARO MATA;165;2844;23/6/2001 22:34:00;CIDADAO COMUM;S;0;ERMELINDA;BH;609096.01;801009.66;6359
+6361;2001339153;B03000;AMEACA;RUA DOZE DE DEZE;101;24060;23/6/2001 23:05:00;CIDADAO COMUM;S;CAFR;BELMONT;BH;615616.59;804938.16;6360
+6362;2001339195;B03000;AMEACA;RUA STA JUDITE;465;60816;23/6/2001 23:34:00;CIDADAO COMUM;S;CX6;APARECIDA SETIMA;BH;608750.85;800357.87;6361
+6363;2001339223;B03000;AMEACA;RUA CORNELIO PRO;40;36706;23/6/2001 23:48:00;CIDADAO COMUM;S;;NOVA VISTA;BH;614638.60;800712.32;6362
+6364;2001339233;B06000;LESAO CORPORAL;RUA JURUA;790;39799;23/6/2001 23:54:00;CIDADAO COMUM;N;AP303;DA GRACA;BH;612261.50;799605.83;6363
+6365;2001339247;B06000;LESAO CORPORAL;RUA DAS GABIROBA;95;30375;24/6/2001 00:05:00;CIDADAO COMUM;N;;VILA CLORIS;BH;610034.72;808298.49;6364
+6366;2001339266;B03000;AMEACA;RUA SERRA NEGRA;1372;65038;24/6/2001 00:23:00;CIDADAO COMUM;S;CAA;SANTO ANDRE;BH;609056.02;799135.06;6365
+6367;2001339299;B06000;LESAO CORPORAL;RUA JOSE SANGUIN;69;107028;24/6/2001 00:43:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;609033.61;807855.07;6366
+6368;2001339398;B02000;RIXA;AV SERRANA;774;65040;24/6/2001 02:04:00;CIDADAO COMUM;S;;SERRANO;BH;603492.23;801710.41;6367
+6369;2001339405;B06000;LESAO CORPORAL;RUA ANTONIO TEIX;1280;119037;24/6/2001 02:10:00;INICIATIVA;N;0;TEIXEIRA DIAS;BH;602642.10;789958.00;6368
+6370;2001339433;B02000;RIXA;RUA ALIANCA;99;2324;24/6/2001 02:29:00;CIDADAO COMUM;S;0;SAO GABRIEL;BH;613443.00;804094.68;6369
+6371;2001339474;B06000;LESAO CORPORAL;RUA CASCALHEIRA;52;13889;24/6/2001 03:03:00;INICIATIVA;S;0;VENDA NOVA;BH;609356.04;808626.75;6370
+6372;2001339485;B03000;AMEACA;AV JOSE LOPES MU;225;19176;24/6/2001 03:11:00;CIDADAO COMUM;N;;FLORAMAR;BH;611602.39;806414.44;6371
+6373;2001339515;B06000;LESAO CORPORAL;RUA HORIZONTE;69;33405;24/6/2001 03:32:00;CIDADAO COMUM;S;AP202;PARAISO;BH;614458.83;796413.39;6372
+6374;2001339551;B06000;LESAO CORPORAL;RUA MARCO AURELI;196;61821;24/6/2001 04:12:00;CIDADAO COMUM;S;;NAZARE;BH;615704.53;804641.91;6373
+6375;2001339585;B04001;HOMICIDIO TENTAD;AV SANTOS DUMONT;673;61950;24/6/2001 04:55:00;INICIATIVA;S;0;CENTRO BH;BH;610982.01;797558.77;6374
+6376;2001339826;B03000;AMEACA;RUA ESPINOSA;842;26024;24/6/2001 09:38:00;CIDADAO COMUM;S;;CARLOS PRATES;BH;608835.49;797841.84;6375
+6377;2001339854;B06000;LESAO CORPORAL;RODOVIA MGT 262;780;26598;24/6/2001 09:58:00;CIDADAO COMUM;S;;GOIANIA;BH;614725.95;803156.17;6376
+6378;2001339955;B03000;AMEACA;RUA CINQUENTA;280;106100;24/6/2001 11:19:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;608385.69;810923.86;6377
+6379;2001340050;B03000;AMEACA;RUA MADRE DOS AN;458;37172;24/6/2001 12:36:00;CIDADAO COMUM;S;0;PROVIDENCIA;BH;612440.57;804452.14;6378
+6380;2001340053;B03000;AMEACA;RUA PAULO TIMOTE;99;41918;24/6/2001 12:38:00;CIDADAO COMUM;N;;VILA HUMAITA;BH;610259.40;801578.24;6379
+6381;2001340067;B02000;RIXA;RUA CRISPIM JAQU;1000;18609;24/6/2001 12:54:00;CIDADAO COMUM;S;0;VISTA ALEGRE;BH;604692.26;793120.54;6380
+6382;2001340072;B04001;HOMICIDIO TENTAD;AV FURQUIM WERNE;7;650;24/6/2001 12:57:00;CIDADAO COMUM;N;;TUPI;BH;612940.53;805718.72;6381
+6383;2001340100;B06000;LESAO CORPORAL;RUA CANDIDO LUCI;411;12568;24/6/2001 13:19:00;CIDADAO COMUM;N;0;PARQUE RIACHUELO;BH;609781.70;800106.89;6382
+6384;2001340192;B06000;LESAO CORPORAL;RUA JOSE LUIZ DI;518;83945;24/6/2001 14:33:00;CIDADAO COMUM;S;FU;ARAGUAIA;BH;605111.03;789825.22;6383
+6385;2001340194;B03000;AMEACA;AV BARBACENA;1009;8084;24/6/2001 14:35:00;CIDADAO COMUM;S;;SANTO AGOSTINHO;BH;609814.42;796318.09;6384
+6386;2001340208;B06000;LESAO CORPORAL;RUA LIBANIA PENA;619;40855;24/6/2001 14:47:00;POLICIAL MILITAR;N;;SAO BERNARDO;BH;610581.29;805061.10;6385
+6387;2001340245;B06000;LESAO CORPORAL;RUA MARECHAL RON;337;43677;24/6/2001 15:03:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611964.72;803360.61;6386
+6388;2001340400;B03000;AMEACA;RUA PADRE EUSTAQ;2183;51294;24/6/2001 16:22:00;INICIATIVA;S;;PADRE EUSTAQUIO;BH;607503.34;797614.57;6387
+6389;2001340449;B03000;AMEACA;RUA CINCO DE JUL;23;15670;24/6/2001 16:45:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612552.07;803842.49;6388
+6390;2001340457;B03000;AMEACA;RUA LENI AMARAL;344;75130;24/6/2001 16:51:00;CIDADAO COMUM;S;;PARQUE NOVO PROG;CO;602711.02;799959.00;6389
+6391;2001340462;B06000;LESAO CORPORAL;RUA CINQUENTA E ;127;74137;24/6/2001 16:52:00;CIDADAO COMUM;S;;NOVA YORK;BH;608631.53;811073.66;6390
+6392;2001340463;B03000;AMEACA;RUA F;52;47388;24/6/2001 16:53:00;CIDADAO COMUM;S;;VILA PINHO;BH;601062.53;788698.15;6391
+6393;2001340471;B06000;LESAO CORPORAL;RUA JOSE CLETO;1100;38682;24/6/2001 16:58:00;INICIATIVA;N;0;DOS PALMARES;BH;610290.19;802437.88;6392
+6394;2001340488;B06000;LESAO CORPORAL;AV AFONSO PENA;2300;1259;24/6/2001 17:05:00;CIDADAO COMUM;S;PX2300;FUNCIONARIOS;BH;611928.21;795711.43;6393
+6395;2001340501;B06000;LESAO CORPORAL;RUA JULIO MESQUI;43;81849;24/6/2001 17:11:00;CIDADAO COMUM;N;0;ITAIPU BH;BH;599327.39;788616.41;6394
+6396;2001340524;B03000;AMEACA;RUA 76;170;124249;24/6/2001 17:29:00;CIDADAO COMUM;S;0;JARDIM DOS COMER;BH;607613.29;811768.50;6395
+6397;2001340526;B06000;LESAO CORPORAL;AV ABILIO MACHAD;1989;634;24/6/2001 17:33:00;INICIATIVA;N;0;GLORIA;BH;604187.17;799269.85;6396
+6398;2001340534;B02000;RIXA;RUA RIO DE JANEI;282;58772;24/6/2001 17:36:00;INICIATIVA;S;0;CENTRO (BH);BH;611181.78;797418.31;6397
+6399;2001340569;B06000;LESAO CORPORAL;RUA PURUS;540;55819;24/6/2001 17:56:00;CIDADAO COMUM;N;0;CONCORDIA;BH;610829.80;799382.32;6398
+6400;2001340573;B06000;LESAO CORPORAL;RUA DOUTOR ROBER;10;85610;24/6/2001 17:57:00;INICIATIVA;N;0;SERRA VERDE;BH;609549.68;809984.85;6399
+6401;2001340677;B06000;LESAO CORPORAL;RUA CORONEL OTAV;114;13620;24/6/2001 18:51:00;CIDADAO COMUM;N;;PARAISO;BH;614395.86;797635.16;6400
+6402;2001340697;B03000;AMEACA;RUA ALINE;907;2352;24/6/2001 18:59:00;INICIATIVA;N;0;PINDORAMA;BH;602382.96;798113.38;6401
+6403;2001340782;B04002;HOMICIDIO CONSUM;RUA DOZE;130;74178;24/6/2001 19:49:00;CIDADAO COMUM;N;;NOVA YORK;BH;608552.95;810735.96;6402
+6404;2001340784;B06000;LESAO CORPORAL;RUA CURITIBA;175;19090;24/6/2001 19:50:00;INICIATIVA;S;0;CENTRO (BH);BH;611005.46;797704.71;6403
+6405;2001340806;B06000;LESAO CORPORAL;RUA VEREADOR SOC;714;71586;24/6/2001 20:04:00;CIDADAO COMUM;N;;CARLOS PRATES;BH;608704.45;797784.61;6404
+6406;2001340868;B06000;LESAO CORPORAL;AV CIVILIZACAO;315;51657;24/6/2001 20:36:00;INICIATIVA;S;0;JARDIM FLORENCIA;BH;604827.53;810045.09;6405
+6407;2001340871;B03000;AMEACA;RUA MARIA MERCES;225;69284;24/6/2001 20:37:00;INICIATIVA;S;0;TIROL;BH;600618.46;789134.05;6406
+6408;2001340883;B06000;LESAO CORPORAL;RUA DR BROCHADO;864;23215;24/6/2001 20:44:00;CIDADAO COMUM;S;LJ;VERA CRUZ;BH;615928.19;797908.73;6407
+6409;2001340891;B03000;AMEACA;RUA VINTE E TRES;133;300330;24/6/2001 20:48:00;CIDADAO COMUM;S;0;VILA CALIFORNIA;BH;604003.11;797234.46;6408
+6410;2001340977;B03000;AMEACA;RUA BARAO DE SAR;488;8043;24/6/2001 21:31:00;CIDADAO COMUM;S;AP903;HORTO;BH;613702.53;797827.39;6409
+6411;2001340990;B06000;LESAO CORPORAL;RUA CASTELO BRAN;271;14030;24/6/2001 21:37:00;INICIATIVA;S;0;SANTA TEREZINHA;BH;604254.63;802847.80;6410
+6412;2001340993;B03000;AMEACA;RUA JOSE LAVARIN;750;40537;24/6/2001 21:42:00;CIDADAO COMUM;S;;PARAISO;BH;614679.14;796705.60;6411
+6413;2001340995;B03000;AMEACA;RUA PEPERI;1000;53259;24/6/2001 21:41:00;CIDADAO COMUM;S;0;NOVA GRANADA;BH;608160.45;794166.42;6412
+6414;2001341005;B03000;AMEACA;RUA VALAO;96;80238;24/6/2001 21:50:00;CIDADAO COMUM;N;0;COQUEIROS;BH;602714.03;799499.21;6413
+6415;2001341087;B06000;LESAO CORPORAL;RUA ITAQUERA;232;35920;24/6/2001 22:35:00;CIDADAO COMUM;S;0;CONCORDIA;BH;611011.46;799088.18;6414
+6416;2001341133;B06000;LESAO CORPORAL;RUA RADIALISTA C;182;99132;24/6/2001 23:01:00;CIDADAO COMUM;S;0;CEU AZUL;BH;604926.16;808509.27;6415
+6417;2001341147;B04001;HOMICIDIO TENTAD;RUA COSTA DAS PA;1;74846;24/6/2001 23:06:00;CIDADAO COMUM;N;;JARDIM VITORIA;BH;616667.46;804539.72;6416
+6418;2001341173;B04001;HOMICIDIO TENTAD;RUA PERUIBE;691;79610;24/6/2001 23:17:00;CIDADAO COMUM;N;0;PIRATININGA;BH;605780.79;809382.10;6417
+6419;2001341234;B04002;HOMICIDIO CONSUM;RUA RADIALISTA M;325;98864;25/6/2001 00:16:00;CIDADAO COMUM;N;;CEU AZUL;BH;604276.82;808882.62;6418
+6420;2001341291;B06000;LESAO CORPORAL;RUA DOUTOR CRIST;312;55598;25/6/2001 01:12:00;CIDADAO COMUM;S;0;ARAGUAIA;BH;604751.25;789297.85;6419
+6421;2001341296;B03000;AMEACA;AV LEONTINO FRAN;516;445;25/6/2001 01:21:00;CIDADAO COMUM;N;;SERRA VERDE;BH;609081.19;810348.74;6420
+6422;2001341312;B06000;LESAO CORPORAL;AV SARAMENHA;480;64007;25/6/2001 01:42:00;CIDADAO COMUM;S;INCI TPO4851 BPE;FLORAMAR;BH;612665.01;805817.21;6421
+6423;2001341326;B04002;HOMICIDIO CONSUM;AV PRESIDENTE AN;3073;4461;25/6/2001 02:13:00;CIDADAO COMUM;N;;CACHOEIRINHA;BH;609842.22;801019.10;6422
+6424;2001341328;B03000;AMEACA;RUA LUCIO FLAVIO;20;50972;25/6/2001 02:15:00;CIDADAO COMUM;N;;MINASCAIXA;BH;609454.19;809673.48;6423
+6425;2001341344;B06000;LESAO CORPORAL;RUA CONSELHEIRO ;3963;17095;25/6/2001 02:35:00;INICIATIVA;S;0;SAGRADA FAMILIA;BH;613739.23;798444.60;6424
+6426;2001341467;B03000;AMEACA;RUA ALUISIO DE A;30;2642;25/6/2001 07:30:00;CIDADAO COMUM;N;BL 13  APTO 202;SANTA MONICA;BH;607420.66;808150.58;6425
+6427;2001341524;B03000;AMEACA;RUA CURRAL DEL R;60;19122;25/6/2001 08:25:00;CIDADAO COMUM;S;0;CABANA;BH;604726.85;793857.84;6426
+6428;2001341538;B06000;LESAO CORPORAL;AV BARAO HOMEM D;1843;7936;25/6/2001 08:34:00;CIDADAO COMUM;S;;NOVA GRANADA;BH;608102.37;793516.46;6427
+6429;2001341689;B03000;AMEACA;RUA ITABIRA;510;35237;25/6/2001 10:10:00;CIDADAO COMUM;S;0;LAGOINHA;BH;610932.37;798497.33;6428
+6430;2001341703;B06000;LESAO CORPORAL;RUA DOS TIMBIRAS;138;67682;25/6/2001 10:18:00;CIDADAO COMUM;S;SL 501;FUNCIONARIOS;BH;612597.62;795925.49;6429
+6431;2001341736;B03000;AMEACA;RUA STA CATARINA;1234;60400;25/6/2001 10:48:00;INICIATIVA;N;0;LOURDES;BH;610316.02;795806.92;6430
+6432;2001341773;B06000;LESAO CORPORAL;RUA CAMILO DE BR;636;11896;25/6/2001 11:08:00;CIDADAO COMUM;S;;PADRE EUSTAQUIO;BH;605855.99;798012.24;6431
+6433;2001341899;B06000;LESAO CORPORAL;RUA BOACHA;381;9695;25/6/2001 12:33:00;CIDADAO COMUM;S;;DOM BOSCO;BH;604969.79;797397.60;6432
+6434;2001341931;B06000;LESAO CORPORAL;ALAMEDA DIOGO GU;479;21336;25/6/2001 12:48:00;CIDADAO COMUM;S;CA4;VILA CASTANHEIRA;BH;601475.52;788466.09;6433
+6435;2001341976;B06000;LESAO CORPORAL;RUA NEFELINA;127;81228;25/6/2001 13:31:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;612851.15;797300.76;6434
+6436;2001342212;B06000;LESAO CORPORAL;RUA BERNARDO GUI;20;9364;25/6/2001 16:05:00;CIDADAO COMUM;N;0;FUNCIONARIOS;BH;612577.23;795634.07;6435
+6437;2001342216;B03000;AMEACA;RUA SESSENTA E N;98;78976;25/6/2001 16:06:00;CIDADAO COMUM;S;0;NOVA YORK;BH;608040.39;811378.70;6436
+6438;2001342219;B03000;AMEACA;RUA MARGARIDA AS;525;61226;25/6/2001 16:09:00;CIDADAO COMUM;S;;CALIFORNIA;BH;603087.78;796379.85;6437
+6439;2001342236;B03000;AMEACA;RUA CANA DA INDI;394;94848;25/6/2001 16:20:00;CIDADAO COMUM;S;;LINDEIA;BH;599823.12;790690.41;6438
+6440;2001342239;B03000;AMEACA;RUA OHM;12;49153;25/6/2001 16:22:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;612164.04;803384.40;6439
+6441;2001342267;B06000;LESAO CORPORAL;RUA STO ANTONIO;218;61645;25/6/2001 16:42:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;609460.12;808275.49;6440
+6442;2001342592;B03000;AMEACA;RUA AQUIRI;105;5234;25/6/2001 19:38:00;INICIATIVA;S;;AARAO REIS;BH;612521.48;804887.66;6441
+6443;2001342609;B03000;AMEACA;RUA JABIRU;408;36485;25/6/2001 19:53:00;CIDADAO COMUM;N;;FLAVIO MARQUES D;BH;604475.87;788500.08;6442
+6444;2001342650;B03000;AMEACA;RUA CARMELITA PR;1189;17316;25/6/2001 20:16:00;CIDADAO COMUM;S;CAA;SALGADO FILHO;BH;606197.02;794264.22;6443
+6445;2001342661;B03000;AMEACA;RUA RITA DE CASS;80;61267;25/6/2001 20:26:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605839.44;793359.44;6444
+6446;2001342731;B03000;AMEACA;RUA DEZESSETE;573;32862;25/6/2001 21:15:00;CIDADAO COMUM;S;AP1;CONJUNTO FELICID;BH;612405.99;807435.12;6445
+6447;2001342784;B06000;LESAO CORPORAL;RUA JOSE BARTOLO;80;38525;25/6/2001 21:48:00;CIDADAO COMUM;N;BLC     AP107;CONJUNTO ALIPIO ;BH;603707.54;799638.81;6446
+6448;2001342991;B03000;AMEACA;AV AMAZONAS;4041;3140;26/6/2001 00:24:00;CIDADAO COMUM;S;;BARROCA;BH;607766.16;795855.52;6447
+6449;2001343131;B06000;LESAO CORPORAL;AV OLEGARIO MACI;579;49699;26/6/2001 03:36:00;CIDADAO COMUM;S;0;CENTRO (BH);BH;610560.87;797092.76;6448
+6450;2001343515;B03000;AMEACA;RUA DEZOITO;30;80225;26/6/2001 10:15:00;CIDADAO COMUM;S;0;NOVA CINTRA;BH;605414.94;793346.67;6449
+6451;2001343616;B06000;LESAO CORPORAL;RUA MARECHAL RON;87;43677;26/6/2001 11:18:00;CIDADAO COMUM;S;;PRIMEIRO DE MAIO;BH;611937.37;803522.85;6450
+6452;2001343618;B04001;HOMICIDIO TENTAD;AV ANTONIO ABRAH;1000;4320;26/6/2001 11:20:00;INICIATIVA;N;0;SAO LUIZ;BH;607791.03;803406.56;6451
+6453;2001343735;B03000;AMEACA;RUA DESCALVADO;204;19857;26/6/2001 12:37:00;CIDADAO COMUM;N;0;RENASCENCA;BH;611194.49;800550.72;6452
+6454;2001343766;B03000;AMEACA;RUA ALCINDO VIEI;583;1968;26/6/2001 12:54:00;CIDADAO COMUM;S;;BARREIRO;BH;602841.65;790669.84;6453
+6455;2001343767;B04001;HOMICIDIO TENTAD;RUA FLOR DE ABRI;27;28464;26/6/2001 12:54:00;CIDADAO COMUM;S;;JARDIM MONTANHES;BH;606010.63;798889.05;6454
+6456;2001343772;B03000;AMEACA;RUA JORNALISTA G;90;72172;26/6/2001 12:58:00;CIDADAO COMUM;S;;VILA SANTO ANTON;BH;608897.05;807828.39;6455
+6457;2001343786;B03000;AMEACA;RUA AMIRO RODRIG;96;61862;26/6/2001 13:09:00;CIDADAO COMUM;S;;APARECIDA SETIMA;BH;608980.16;800113.60;6456
+6458;2001343970;B03000;AMEACA;PRACA PAULO VI;20;120424;26/6/2001 15:19:00;INICIATIVA;S;0;CONJUNTO ALIPIO ;BH;604118.40;799596.48;6457
+6459;2001344044;B06000;LESAO CORPORAL;AV DOM PEDRO II;2679;53145;26/6/2001 16:04:00;CIDADAO COMUM;S;SL3A;CARLOS PRATES;BH;608253.87;798143.37;6458
+6460;2001344097;B03000;AMEACA;RUA DOM SILVERIO;300;22496;26/6/2001 16:30:00;INICIATIVA;N;0;BELMONT;BH;615222.25;805374.99;6459
+6461;2001344115;B03000;AMEACA;RUA JOSE CLEMENT;70;84862;26/6/2001 16:36:00;CIDADAO COMUM;N;;DA LAGOA;BH;604781.02;809128.05;6460
+6462;2001344155;B03000;AMEACA;RUA ITAPETINGA;1341;35804;26/6/2001 17:02:00;CIDADAO COMUM;N;0;CACHOEIRINHA;BH;609965.84;800605.10;6461
+6463;2001344199;B03000;AMEACA;RUA RIO DE JANEI;909;58772;26/6/2001 17:27:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611055.94;796826.34;6462
+6464;2001344224;B03000;AMEACA;RUA ODILON BRAGA;1058;49100;26/6/2001 17:37:00;CIDADAO COMUM;N;0;MANGABEIRAS;BH;612805.67;793445.11;6463
+6465;2001344256;B06000;LESAO CORPORAL;RUA DOS BANDOLIN;555;106980;26/6/2001 17:49:00;CIDADAO COMUM;S;BOLCO B.;CH CALIFORNIA;BH;603953.43;797197.40;6464
+6466;2001344299;B03000;AMEACA;RUA MARIA DA SIL;677;44323;26/6/2001 18:17:00;CIDADAO COMUM;N;0;GLORIA;BH;603855.74;798980.34;6465
+6467;2001344395;B06000;LESAO CORPORAL;RUA SENHORA DO P;10;62231;26/6/2001 19:10:00;CIDADAO COMUM;S;0;CINQUENTENARIO;BH;606327.84;791562.32;6466
+6468;2001344548;B03000;AMEACA;RUA CURIATA;60;19062;26/6/2001 20:53:00;CIDADAO COMUM;S;0;GUARANI;BH;612579.40;805613.07;6467
+6469;2001344656;B04002;HOMICIDIO CONSUM;RUA JURAMENTO;800;39732;26/6/2001 22:09:00;CIDADAO COMUM;S;0;SAUDADE;BH;615203.20;796976.91;6468
+6470;2001344657;B03000;AMEACA;AV AUGUSTO DE LI;361;6731;26/6/2001 22:09:00;INICIATIVA;S;APTO 904;CENTRO BH;BH;611054.26;796579.41;6469
+6471;2001344725;B03000;AMEACA;RUA DIVISA SANTA;306;21452;26/6/2001 22:45:00;CIDADAO COMUM;N;0;MILIONARIOS;BH;604260.70;790692.63;6470
+6472;2001344746;B06000;LESAO CORPORAL;RUA ARISTOLINO B;300;41089;26/6/2001 22:55:00;INICIATIVA;S;0;REGINA;BH;598924.48;790096.71;6471
+6473;2001344807;B04001;HOMICIDIO TENTAD;RUA ZURICK;9;74092;26/6/2001 23:30:00;CIDADAO COMUM;S;0;NOVA SUISSA;BH;606533.22;796470.48;6472
+6474;2001344809;B06000;LESAO CORPORAL;AV AMAZONAS;139;3140;26/6/2001 23:32:00;CIDADAO COMUM;S;;CENTRO (BH);BH;611360.40;797271.51;6473
+6475;2001344816;B03000;AMEACA;RUA MARIA PIETRA;125;2668;26/6/2001 23:35:00;INICIATIVA;N;0;SAO PAULO;BH;612440.02;802941.04;6474
+6476;2001344842;B03000;AMEACA;RUA JOAO ALFREDO;66;37447;26/6/2001 23:51:00;CIDADAO COMUM;S;;HORTO;BH;613906.31;798281.36;6475
+6477;2001344871;B03000;AMEACA;RUA ALABANDINA;629;35400;27/6/2001 00:15:00;CIDADAO COMUM;N;APT 102;CAICARA;BH;607975.49;799959.05;6476
+6478;2001345042;B02000;RIXA;RUA ANDALUZITA;13;3718;27/6/2001 05:36:00;CIDADAO COMUM;N;;CARMO;BH;611931.63;794855.16;6477
+6479;2001345207;B03000;AMEACA;RUA SAO PEDRO DA;12;102989;27/6/2001 08:30:00;CIDADAO COMUM;S;;OLHOS DAGUA;BH;608155.44;788331.27;6478
+6480;2001345348;B03000;AMEACA;RUA VISEU;1178;62042;27/6/2001 10:04:00;CIDADAO COMUM;S;;SAO FRANCISCO;BH;609516.82;802452.66;6479
+6481;2001345361;B06000;LESAO CORPORAL;PRACA RIO BRANCO;100;58630;27/6/2001 10:21:00;INICIATIVA;S;0;CENTRO BH;BH;610794.50;797743.33;6480
+6482;2001345428;B03000;AMEACA;RUA ALCIDES GONC;61;1901;27/6/2001 11:15:00;CIDADAO COMUM;S;;CAMARGOS;BH;602711.47;794464.61;6481
+6483;2001345480;B03000;AMEACA;RUA MONTE ALVERN;563;46385;27/6/2001 12:03:00;CIDADAO COMUM;N;;SAO JOAO BATISTA;BH;607879.30;808121.62;6482
+6484;2001345568;B03000;AMEACA;RUA QUINTIL;536;96897;27/6/2001 13:17:00;CIDADAO COMUM;S;0;JARDIM ANA LUCIA;BH;609938.92;808861.42;6483
+6485;2001345579;B06000;LESAO CORPORAL;AV PARANA;523;52230;27/6/2001 13:24:00;INICIATIVA;N;PPM1.1;CENTRO (BH);BH;610725.40;796994.57;6484
+6486;2001345630;B03000;AMEACA;RUA LAGUNA;40;23170;27/6/2001 13:54:00;CIDADAO COMUM;S;0;TAQUARIL;BH;617501.43;797020.37;6485
+6487;2001345723;B06000;LESAO CORPORAL;RUA PITANGUI;34;54365;27/6/2001 15:10:00;CIDADAO COMUM;S;FR168;SAO CRISTOVAO;BH;610522.93;799402.64;6486
+6488;2001345793;B06000;LESAO CORPORAL;RUA ESPIRITO SAN;785;26052;27/6/2001 15:55:00;CIDADAO COMUM;N;;CENTRO (BH);BH;611219.33;796898.46;6487
+6489;2001345931;B06000;LESAO CORPORAL;RUA MONTE ALVERN;563;46385;27/6/2001 17:09:00;CIDADAO COMUM;S;;SAO JOAO BATISTA;BH;607879.30;808121.62;6488
+6490;2001345982;B06000;LESAO CORPORAL;RUA FRANCISCO FE;40;29426;27/6/2001 17:34:00;CIDADAO COMUM;N;0;TUPI;BH;613135.84;805984.96;6489
+6491;2001346037;B06000;LESAO CORPORAL;RUA LILIA;96;83730;27/6/2001 18:03:00;CIDADAO COMUM;N;0;SANTA MONICA;BH;606213.48;808831.98;6490
+6492;2001346067;B03000;AMEACA;RUA ABAIBA;218;561;27/6/2001 18:16:00;INICIATIVA;S;0;SAO PAULO;BH;612454.75;802727.11;6491
+6493;2001346081;B06000;LESAO CORPORAL;RUA ANTONIO ACAC;46;24564;27/6/2001 18:20:00;CIDADAO COMUM;S;;CH VALE DO JATOB;BH;600609.06;787448.50;6492
+6494;2001346145;B04001;HOMICIDIO TENTAD;RUA VILA REAL;87;60683;27/6/2001 18:58:00;CIDADAO COMUM;S;0;SAO FRANCISCO;BH;609915.68;801999.03;6493
+6495;2001346204;B04002;HOMICIDIO CONSUM;RUA CARACA;1071;12990;27/6/2001 19:27:00;INICIATIVA;N;0;SERRA;BH;613823.56;794597.43;6494
+6496;2001346328;B03000;AMEACA;RUA SAO MATEUS;171;20522;27/6/2001 20:41:00;CIDADAO COMUM;S;;CARDOSO;BH;603578.33;788323.16;6495
+6497;2001346357;B06000;LESAO CORPORAL;RUA TRINTA E OIT;212;34681;27/6/2001 21:01:00;CIDADAO COMUM;N;CAA;CONJUNTO FELICID;BH;612582.28;807355.59;6496
+6498;2001346377;B03000;AMEACA;RUA ORIENTAL;19;50364;27/6/2001 21:17:00;CIDADAO COMUM;S;CASA 160 NO BECO;SAO LUCAS;BH;613100.81;796033.16;6497
+6499;2001346396;B03000;AMEACA;RUA DIVINOPOLIS;253;21424;27/6/2001 21:30:00;CIDADAO COMUM;S;0;SANTA TEREZA;BH;613916.97;797543.46;6498
+6500;2001346469;B06000;LESAO CORPORAL;RUA SERVIDAO;93;170201;27/6/2001 22:26:00;CIDADAO COMUM;N;0;CABANA;BH;604396.96;794232.57;6499
+6501;2001346478;B03000;AMEACA;RUA CORONEL OTAV;20;13620;27/6/2001 22:32:00;CIDADAO COMUM;N;;POMPEIA;BH;614397.44;797674.95;6500
diff --git a/examples/data/OcorrenciasPoA.dbf b/examples/data/OcorrenciasPoA.dbf
old mode 100755
new mode 100644
diff --git a/examples/data/OcorrenciasPoA.shp b/examples/data/OcorrenciasPoA.shp
old mode 100755
new mode 100644
diff --git a/examples/data/OcorrenciasPoA.shx b/examples/data/OcorrenciasPoA.shx
old mode 100755
new mode 100644
diff --git a/examples/data/SOCEC.dbf b/examples/data/SOCEC.dbf
old mode 100755
new mode 100644
diff --git a/examples/data/elevation.raw b/examples/data/elevation.raw
old mode 100755
new mode 100644
diff --git a/examples/data/nat1.tif b/examples/data/nat1.tif
old mode 100755
new mode 100644
diff --git a/examples/data/nat2.tif b/examples/data/nat2.tif
old mode 100755
new mode 100644
diff --git a/examples/data/sampa.jpg b/examples/data/sampa.jpg
old mode 100755
new mode 100644
diff --git a/examples/data/samples.spr b/examples/data/samples.spr
index 773779b..c5adbd6 100644
--- a/examples/data/samples.spr
+++ b/examples/data/samples.spr
@@ -1,22878 +1,22878 @@
-
-SAMPLE
-INFO
-//Amostras de Modelagem Num�rica
-//Arquivo ASCII gerado pelo Sistema SPRING
-//Projeto: Brasilia - Plano de informa��o: Mapa Altimetrico
-//Categoria: Altimetria - Modelo: DIGITALMODEL
-PROJECTION	UTM/SAD69, HEMIS 1, ORIG.LAT n 0   0   0.00, ORIG.LONG o 45  0   0.00, LAT1 n 0   0   0.00, LAT2 n 0   0   0.00
-DATUM	SAD69, Prd 6378160.000000, Pflt 0.003353, Pdx 0.000000, Pdy 0.000000, Pdz 0.000000
-OFFSETX  500000.000000   OFFSETY  10000000.000000   SCALEFACTOR  0.999600
-BOX	183557.000000, 8246277.000000, 195017.000000, 8258937.000000
-UNITS Metros
-SCALE	25000.000000
-INFO_END
-POINT3D
-183763.136324     8246449.883481   1051.000000
-184772.200422     8246432.858473   1055.000000
-184933.756147     8246310.125748   1053.000000
-187045.291487     8246576.788397   1039.000000
-187629.400857     8246523.169623   1028.000000
-187935.089403     8246543.527406   1024.000000
-191516.337040     8246284.351177   1039.000000
-192200.352801     8246555.336354   1033.000000
-192350.927497     8246958.982785   1024.000000
-194569.636946     8246399.594222   1004.000000
-194856.376362     8246508.565860   1007.000000
-183581.777412     8247569.058595   1081.000000
-186808.168262     8247622.477620   1067.000000
-189137.849654     8247749.747966   1039.000000
-190013.552762     8247853.385130   1024.000000
-191642.101449     8247529.090454   1016.000000
-192648.485403     8247173.305625   1022.000000
-192592.347356     8247045.343808   1024.000000
-193243.309165     8247581.285668   1011.000000
-193560.350509     8247673.819406   1009.000000
-184395.125114     8248163.848770   1099.000000
-185523.431897     8248591.936516   1095.000000
-185290.544174     8248170.118365   1097.000000
-186627.238229     8248404.192659   1083.000000
-186142.892820     8248053.010047   1088.000000
-187695.841631     8248537.095232   1068.000000
-188722.987421     8248446.469126   1066.000000
-189372.130636     8248823.354853   1068.000000
-190981.520773     8248794.909293   1019.000000
-191753.958859     8248083.030257   1007.000000
-192191.650408     8248222.500210   1004.000000
-184643.833397     8249079.901098   1094.000000
-185279.791036     8249070.907225   1094.000000
-185776.928104     8249171.848138   1089.000000
-187173.053629     8249096.293056   1069.000000
-187525.819440     8249302.074228   1084.000000
-194835.865056     8249375.150502   1009.000000
-183696.646807     8250966.779061   1116.000000
-187994.714711     8250884.552777   1114.000000
-188157.974162     8250656.035656   1114.000000
-188341.115398     8250591.862557   1116.000000
-189221.750814     8250544.685928   1118.000000
-192360.864133     8250616.171156   1066.000000
-192344.580872     8250850.080348   1065.000000
-193238.690102     8250354.826261   1052.000000
-194099.246060     8250427.551725   1041.000000
-194626.234236     8250617.857655   1039.000000
-185708.103458     8251502.375029   1146.000000
-186267.110719     8251725.105398   1156.000000
-187786.399506     8251151.820053   1119.000000
-189638.414815     8251484.610618   1124.000000
-190924.509897     8251596.443768   1095.000000
-191262.884122     8251646.730943   1083.000000
-190854.921987     8251921.202739   1091.000000
-191983.029415     8251769.281982   1071.000000
-192770.408228     8251182.205617   1066.000000
-193668.766373     8251355.688547   1049.000000
-194043.497654     8251363.335240   1048.000000
-194340.156191     8251516.913088   1039.000000
-194508.921666     8251024.267138   1036.000000
-187520.769322     8252840.698960   1172.000000
-187638.190285     8252590.499903   1167.000000
-189963.770381     8252148.899609   1126.000000
-190940.785974     8252147.109632   1095.000000
-192092.326594     8252874.127279   1046.000000
-193629.280597     8252680.529512   1005.000000
-193950.865361     8252219.036945   1021.000000
-194765.073028     8252294.179475   1014.000000
-187865.316483     8253827.357148   1146.000000
-190029.123691     8253647.530356   1114.000000
-193159.419932     8253877.908770   1029.000000
-192316.432307     8253102.971933   1046.000000
-184327.119988     8254484.507995   1111.000000
-185276.553666     8254323.189033   1128.000000
-186617.762720     8254820.919697   1144.000000
-192226.024445     8254247.964593   1051.000000
-192697.220994     8254599.571137   1035.000000
-194163.203690     8254344.149789   1011.000000
-184437.453500     8255638.224856   1098.000000
-189652.770070     8255061.726606   1088.000000
-193001.067716     8255589.099723   1006.000000
-193216.822682     8255442.784077   1008.000000
-193387.790742     8255163.045163   1012.000000
-188573.581405     8256246.595460   1095.000000
-191259.137951     8256658.584110   1035.000000
-188066.824095     8258575.908150   1012.000000
-190559.364669     8258400.759301   1006.000000
-192364.754900     8258041.180620   1034.000000
-193023.369720     8258138.802827   1032.000000
-194515.894805     8257985.046612   1018.000000
-END
-LINE3D
-HEIGHT 1030.000000
-192017.710448     8246277.000000
-192028.960661     8246302.084291
-192038.021544     8246322.258334
-192047.778796     8246338.060362
-192052.581878     8246350.655890
-192058.646093     8246362.644458
-192064.053665     8246376.501522
-192077.362993     8246404.879874
-192088.805168     8246432.603627
-192093.556868     8246448.328815
-192104.535521     8246466.027785
-192109.923609     8246481.136806
-192118.974371     8246501.936631
-192127.954266     8246527.118074
-192135.743137     8246548.524465
-192146.045663     8246569.343887
-192152.694885     8246583.845948
-192159.374475     8246596.470282
-192163.439933     8246615.941323
-192167.546645     8246632.908867
-192168.585059     8246646.072542
-192175.769432     8246666.217779
-192178.685113     8246679.410654
-192180.288291     8246696.339385
-192186.745162     8246722.734353
-192190.872122     8246738.449952
-192194.403185     8246752.278210
-192194.170344     8246766.674626
-192193.897006     8246783.574933
-192193.684413     8246796.719404
-192178.628021     8246798.992791
-192164.823400     8246801.285392
-192154.065313     8246808.633021
-192146.355275     8246821.036464
-192154.922261     8246833.063834
-192166.678271     8246841.383388
-192180.310790     8246849.731749
-192185.053127     8246866.083113
-192179.229726     8246877.889198
-192162.154329     8246888.897002
-192149.509605     8246896.841989
-192129.911952     8246909.062949
-192108.457275     8246920.003146
-192090.242998     8246924.106249
-192077.659013     8246928.295782
-192063.268621     8246928.074879
-192046.285108     8246933.448750
-192036.142397     8246941.432144
-192025.324322     8246952.536003
-192001.316250     8246966.567453
-191971.001765     8246983.632544
-191943.865414     8246997.615973
-191919.333074     8247005.378476
-191896.123366     8247008.778959
-191865.929601     8247018.332749
-191833.213575     8247029.100076
-191806.208829     8247034.946433
-191781.182592     8247034.562263
-191756.277833     8247026.667185
-191722.644877     8247016.759547
-191692.109068     8247008.777646
-191670.332595     8247000.930207
-191646.073594     8246991.792403
-191623.681738     8246983.309581
-191607.495824     8246978.052473
-191590.129007     8246968.394532
-191574.649583     8246958.139627
-191561.662815     8246948.548923
-191543.156354     8246931.986269
-191520.421691     8246905.967744
-191488.434564     8246871.667714
-191461.935997     8246846.217347
-191439.252715     8246817.069161
-191418.939841     8246796.096455
-191401.776258     8246773.919836
-191385.772574     8246757.395603
-191362.351668     8246735.122930
-191345.146825     8246715.450190
-191331.615542     8246700.842485
-191321.212544     8246686.282419
-191307.710865     8246669.796975
-191296.743103     8246651.471852
-191282.707037     8246629.343243
-191268.106206     8246603.449578
-191243.444415     8246580.531920
-191227.369864     8246568.389304
-191213.242683     8246551.894258
-191197.844253     8246536.631571
-191184.464823     8246512.634849
-191169.268865     8246484.853473
-191155.767951     8246468.368041
-191142.276400     8246451.256433
-191117.574119     8246430.842283
-191095.374614     8246410.466553
-191083.215820     8246388.366761
-191065.577825     8246356.791512
-191045.951956     8246332.072965
-191019.514134     8246302.866763
-190997.960375     8246281.249071
-190994.928643     8246277.000000
-END
-LINE3D
-HEIGHT 1020.000000
-190762.652027     8246277.000000
-190763.339402     8246277.647474
-190784.933653     8246296.761657
-190796.023663     8246307.575501
-190804.580527     8246320.228653
-190815.629283     8246333.545993
-190825.941936     8246353.739252
-190835.618201     8246374.548679
-190845.274218     8246396.610051
-190862.448685     8246418.160900
-190886.514578     8246439.191218
-190906.837574     8246459.538142
-190920.328367     8246476.649356
-190936.302446     8246495.051329
-190950.983500     8246515.937583
-190970.004871     8246539.394976
-190985.947817     8246559.674664
-191000.771367     8246571.797694
-191016.785179     8246587.695764
-191030.901470     8246604.816962
-191041.900365     8246621.264369
-191050.951127     8246642.064194
-191064.360927     8246664.183189
-191074.764695     8246678.742885
-191083.351928     8246689.518309
-191094.400684     8246702.835650
-191105.419828     8246718.031111
-191116.326851     8246740.111687
-191130.806198     8246773.516642
-191143.630991     8246793.122145
-191150.240479     8246810.128108
-191157.535446     8246823.388208
-191167.181342     8246846.075362
-191178.653893     8246871.921006
-191195.998302     8246921.648507
-191218.086450     8246948.909364
-191247.087030     8246974.398138
-191272.909476     8247002.968575
-191295.007745     8247029.603650
-191308.518781     8247045.463301
-191318.922549     8247060.022997
-191338.074761     8247075.343307
-191360.909896     8247095.102475
-191381.797656     8247119.214456
-191395.299328     8247135.700282
-191413.734929     8247156.644171
-191436.448580     8247183.914629
-191464.248771     8247206.254527
-191490.252677     8247223.558209
-191514.440818     8247237.077248
-191525.561198     8247246.013365
-191538.537845     8247256.229850
-191550.828243     8247270.192570
-191561.271738     8247282.248746
-191583.583370     8247295.738979
-191604.057455     8247306.696875
-191627.630214     8247319.580531
-191646.873541     8247329.267278
-191660.526309     8247336.363693
-191677.318242     8247342.882360
-191696.642557     8247347.561707
-191716.027610     8247348.485601
-191738.530829     8247350.082915
-191762.931563     8247350.457483
-191782.326744     8247350.755213
-191798.614651     8247349.753370
-191814.326915     8247345.611858
-191833.813211     8247340.276025
-191855.237519     8247331.213555
-191878.467470     8247326.561508
-191899.225778     8247319.993327
-191914.948170     8247315.225652
-191930.054410     8247309.822964
-191945.807171     8247303.177562
-191960.934423     8247296.522940
-191976.041432     8247291.119882
-191995.507474     8247287.036376
-192023.127602     8247281.825402
-192049.495960     8247276.595213
-192076.480458     8247272.000802
-192105.977089     8247266.819016
-192136.715376     8247262.281846
-192154.950659     8247256.927191
-192171.913930     8247252.804883
-192191.411110     8247246.843280
-192217.184335     8247239.725762
-192247.942864     8247233.937028
-192275.491362     8247233.107661
-192298.722077     8247228.455626
-192323.809053     8247225.084342
-192347.644265     8247221.693461
-192373.357508     8247218.331791
-192394.023944     8247217.396779
-192414.691143     8247216.461779
-192434.711827     8247216.769110
-192452.230499     8247217.038034
-192475.369335     8247218.019551
-192507.843163     8247222.274433
-192528.438732     8247225.721039
-192550.941945     8247227.318735
-192573.445921     8247228.916443
-192597.200139     8247230.533343
-192623.468025     8247231.562511
-192642.863206     8247231.860241
-192656.617210     8247232.697311
-192669.735583     8247234.150944
-192692.188941     8247238.878324
-192707.173703     8247240.986544
-192719.636204     8247244.308301
-192733.905111     8247252.040494
-192752.593802     8247257.336021
-192765.096793     8247258.154270
-192783.744993     8247265.953306
-192796.146748     8247273.030899
-192808.619376     8247275.726493
-192822.272138     8247282.823290
-192837.873046     8247285.566905
-192865.402059     8247285.989495
-192879.278305     8247279.315669
-192885.929686     8247255.000115
-192891.319170     8247231.291508
-192892.177514     8247216.904694
-192893.793731     8247194.390421
-192887.840879     8247175.516345
-192878.022887     8247163.469771
-192863.290451     8247145.713178
-192852.765205     8247138.664390
-192837.689329     8247142.189733
-192823.843453     8247146.985832
-192809.009781     8247135.488583
-192799.888159     8247119.069994
-192790.232142     8247097.008622
-192785.450067     8247083.161542
-192780.051858     8247068.678303
-192773.422885     8247052.924297
-192766.309371     8247028.397824
-192755.452966     8247003.187575
-192750.690381     8246988.088156
-192729.812743     8246963.350394
-192719.369248     8246951.294219
-192703.385806     8246933.518422
-192692.911178     8246923.339961
-192674.949226     8246911.794692
-192653.809141     8246903.331084
-192635.059712     8246901.791011
-192613.161754     8246901.454862
-192589.366275     8246902.341841
-192572.957641     8246910.855368
-192554.671740     8246919.339696
-192540.776010     8246927.265479
-192528.807401     8246932.090777
-192516.243665     8246935.028364
-192497.433496     8246937.243745
-192485.616747     8246932.679644
-192472.136081     8246914.942266
-192466.132611     8246899.197862
-192462.610906     8246884.743811
-192462.874117     8246868.469667
-192463.218321     8246847.187742
-192467.225957     8246831.597016
-192475.128344     8246807.300665
-192479.780962     8246790.467965
-192480.710936     8246771.699544
-192488.562706     8246750.532866
-192492.599948     8246733.064400
-192492.832789     8246718.667984
-192493.096006     8246702.393459
-192487.920511     8246674.139967
-192483.209302     8246655.911269
-192478.477087     8246638.934124
-192472.433126     8246625.693228
-192466.368911     8246613.704660
-192453.564366     8246592.847211
-192439.325828     8246583.237292
-192430.739358     8246572.461879
-192420.325469     8246558.527965
-192409.388077     8246538.325116
-192396.007883     8246514.328382
-192391.831068     8246501.742467
-192382.719567     8246484.698096
-192366.170597     8246463.157232
-192360.732655     8246451.177895
-192344.345666     8246419.621849
-192338.443432     8246397.618100
-192330.664688     8246375.585546
-192318.576761     8246349.104136
-192304.692548     8246317.586510
-192293.703774     8246300.513322
-192285.773177     8246287.869784
-192277.890707     8246277.000000
-END
-LINE3D
-HEIGHT 1010.000000
-189554.337430     8246277.000000
-189562.967347     8246281.760004
-189587.215463     8246291.523578
-189605.833287     8246301.200722
-189630.102416     8246309.712362
-189654.966672     8246320.111714
-189679.810686     8246331.762628
-189700.921165     8246342.103974
-189720.870983     8246346.792923
-189753.334683     8246351.673969
-189789.551403     8246356.612627
-189823.901740     8246360.896315
-189850.704014     8246367.568647
-189885.679848     8246371.862319
-189923.148344     8246376.819810
-189952.534382     8246378.523163
-189983.109924     8246384.001161
-190018.712025     8246388.304447
-190045.594523     8246389.969369
-190078.078472     8246393.598469
-190112.418688     8246398.507939
-190153.025578     8246402.888052
-190181.119355     8246407.075698
-190208.587624     8246411.254123
-190237.922287     8246416.086754
-190278.519056     8246421.092649
-190302.859044     8246425.223053
-190321.557862     8246429.892417
-190338.359152     8246435.785290
-190358.259116     8246443.603923
-190382.517359     8246452.741333
-190409.218398     8246465.673010
-190432.185133     8246477.295489
-190452.024357     8246488.869577
-190470.561194     8246503.554121
-190491.035279     8246514.512017
-190510.319867     8246521.694884
-190527.766908     8246526.345414
-190539.512791     8246535.291133
-190551.268801     8246543.610688
-190563.024811     8246551.930243
-190575.396197     8246560.885563
-190590.239233     8246571.756636
-190605.113395     8246580.750376
-190620.683927     8246585.372100
-190633.701065     8246593.085078
-190651.551659     8246611.515474
-190659.493141     8246623.533241
-190668.675508     8246636.195995
-190697.584980     8246667.317950
-190734.547290     8246703.572547
-190772.185722     8246736.707073
-190791.277959     8246755.782848
-190807.281650     8246772.306700
-190815.889132     8246781.830179
-190831.852326     8246800.857921
-190844.727731     8246817.334134
-190860.711173     8246835.109931
-190887.138874     8246864.941915
-190917.198880     8246902.342431
-190941.052174     8246936.517602
-190960.134291     8246956.219159
-190971.768053     8246972.049992
-190981.566560     8246985.348523
-190994.966238     8247008.093300
-191012.634603     8247037.790822
-191029.132186     8247062.461729
-191039.414470     8247084.532715
-191047.253958     8247102.809434
-191052.550938     8247123.551636
-191056.596140     8247144.275004
-191063.750145     8247166.297969
-191071.427652     8247194.589868
-191078.500669     8247221.620232
-191086.117438     8247253.667585
-191096.166880     8247290.134988
-191100.969198     8247302.730504
-191103.239127     8247317.165722
-191106.790439     8247329.742034
-191115.003105     8247363.676729
-191121.156268     8247408.849731
-191122.134700     8247425.769254
-191126.683929     8247454.013132
-191131.264290     8247480.379295
-191142.554618     8247517.491683
-191150.888762     8247543.915469
-191157.386130     8247567.806547
-191161.512326     8247583.522134
-191165.679777     8247596.734224
-191174.104272     8247617.524435
-191186.747606     8247648.396693
-191198.381368     8247664.227527
-191212.630027     8247673.211665
-191230.581852     8247685.383098
-191251.712579     8247694.472499
-191270.300034     8247706.027371
-191283.932547     8247714.376113
-191298.978818     8247712.728509
-191312.742943     8247712.939798
-191337.012065     8247721.451820
-191377.416490     8247738.350240
-191405.872554     8247758.822013
-191422.048347     8247764.704902
-191439.374668     8247776.866734
-191468.557471     8247791.088764
-191500.859197     8247805.984609
-191513.291328     8247811.184093
-191528.256605     8247814.544270
-191559.377420     8247825.039664
-191585.593925     8247829.198492
-191617.441485     8247833.443761
-191639.319194     8247835.031855
-191657.392503     8247839.691999
-191671.106010     8247843.032960
-191691.732712     8247844.601850
-191712.329045     8247848.048468
-191729.211329     8247848.933560
-191746.709752     8247850.454429
-191770.413353     8247855.201002
-191791.614941     8247859.909166
-191804.077441     8247863.230924
-191817.841566     8247863.442213
-191832.928327     8247859.291100
-191863.020863     8247855.996273
-191880.670376     8247848.128113
-191892.649099     8247842.677415
-191908.936249     8247841.675178
-191930.471920     8247825.727200
-191938.304199     8247805.812861
-191940.403429     8247792.071032
-191933.169201     8247775.055478
-191921.413191     8247766.735923
-191908.345435     8247762.152619
-191889.565636     8247762.490272
-191873.227869     8247766.622182
-191849.533625     8247761.249816
-191844.196156     8247743.011123
-191860.604783     8247734.497978
-191876.246182     8247734.738084
-191889.385567     8247734.939783
-191914.523167     8247728.438445
-191925.885751     8247722.351970
-191940.367252     8247716.939692
-191957.472255     8247704.054149
-191975.788526     8247693.692094
-191994.720184     8247683.965041
-192012.995964     8247676.106495
-192029.414719     8247666.967187
-192043.330698     8247657.789458
-192062.373714     8247641.177279
-192083.929627     8247623.977737
-192109.783839     8247611.852820
-192138.110457     8247601.644049
-192160.221008     8247588.835727
-192186.741983     8247574.216533
-192214.453220     8247563.372379
-192243.415463     8247552.547428
-192269.895178     8247540.432113
-192287.616321     8247528.182347
-192307.163356     8247519.091060
-192322.179251     8247519.321564
-192337.195146     8247519.552069
-192355.954702     8247520.465978
-192378.951812     8247530.210348
-192398.901630     8247534.899298
-192419.427097     8247542.727533
-192442.474825     8247549.342230
-192466.814820     8247553.472253
-192493.647464     8247558.266858
-192513.032524     8247559.190369
-192533.618730     8247563.263151
-192551.055650     8247568.539462
-192566.636309     8247572.535023
-192582.903211     8247572.784731
-192599.796379     8247573.044053
-192618.505312     8247577.088017
-192635.962480     8247581.112383
-192652.169400     8247585.117939
-192672.028110     8247595.440069
-192696.922741     8247603.961311
-192716.236935     8247609.266440
-192739.265178     8247617.133095
-192767.348829     8247621.946904
-192787.924150     8247626.645455
-192811.588024     8247633.895548
-192841.598801     8247635.608491
-192870.954470     8247639.189570
-192899.744611     8247639.005582
-192919.917149     8247629.923897
-192941.916342     8247624.000701
-192958.315619     8247616.112967
-192976.621005     8247606.376683
-192996.087816     8247602.292806
-193013.172565     8247590.659591
-193032.094096     8247581.558701
-193048.583717     8247568.037775
-193064.397218     8247557.636919
-193078.445565     8247540.322131
-193096.882562     8247522.448393
-193110.981528     8247502.003932
-193126.886137     8247485.969895
-193135.282422     8247469.820218
-193139.915561     8247454.239093
-193143.902185     8247439.900300
-193147.293675     8247423.674178
-193148.878765     8247403.037239
-193150.454485     8247383.026857
-193154.471484     8247366.809955
-193154.815682     8247345.528412
-193158.197051     8247329.928071
-193158.440020     8247314.905491
-193155.162046     8247285.428872
-193154.799754     8247269.145126
-193150.067538     8247252.167980
-193146.647833     8247231.454596
-193142.460133     8247219.494451
-193129.726455     8247194.255386
-193119.313329     8247180.321483
-193107.567440     8247171.376147
-193089.544750     8247163.586331
-193069.564563     8247160.775108
-193052.045891     8247160.506185
-193023.448094     8247148.797647
-192998.685068     8247132.139333
-192988.897446     8247118.215033
-192984.104486     8247104.993723
-192967.576534     8247082.200543
-192956.628250     8247062.623846
-192941.574018     8247026.079616
-192934.924803     8247011.577173
-192923.925901     8246995.130149
-192911.020121     8246980.532045
-192901.131263     8246972.867089
-192881.817069     8246967.561960
-192863.743761     8246962.901817
-192844.419446     8246958.222469
-192832.159417     8246942.382023
-192822.926432     8246932.848942
-192812.059136     8246908.264845
-192807.943066     8246891.923095
-192799.406451     8246878.017998
-192794.643860     8246862.918961
-192789.882039     8246847.819554
-192785.765200     8246831.478174
-192782.264507     8246815.772189
-192780.701832     8246796.339185
-192774.738852     8246778.091272
-192768.028128     8246767.344654
-192753.043367     8246765.236434
-192734.283816     8246764.322143
-192716.684151     8246769.061000
-192700.346390     8246773.192527
-192675.269535     8246775.938029
-192660.990500     8246768.832000
-192651.142132     8246758.663536
-192633.876550     8246742.746250
-192627.873081     8246727.001846
-192627.470297     8246713.221609
-192618.520771     8246686.162440
-192614.343957     8246673.576525
-192613.294658     8246661.038620
-192604.355259     8246633.353287
-192598.412529     8246613.853429
-192585.012856     8246591.108269
-192575.336591     8246570.298843
-192568.152217     8246550.153605
-192562.310722     8246524.394402
-192558.306010     8246501.167525
-192558.044953     8246478.624435
-192554.524018     8246464.170013
-192553.656942     8246440.365364
-192552.740013     8246419.690399
-192551.791950     8246400.893150
-192547.675875     8246384.551781
-192543.488939     8246372.591648
-192533.862528     8246348.652538
-192529.110828     8246332.927349
-192523.097237     8246317.808726
-192518.334647     8246302.709689
-192514.904820     8246282.622087
-192514.154572     8246277.000000
-END
-LINE3D
-HEIGHT 1010.000000
-194093.713045     8246277.000000
-194095.101105     8246281.209294
-194102.981848     8246296.982516
-194112.759343     8246311.532980
-194120.689941     8246324.176518
-194134.363721     8246330.020999
-194145.513706     8246337.079377
-194162.255021     8246346.727716
-194178.349826     8246357.618005
-194193.839371     8246367.247129
-194211.831691     8246376.914671
-194223.001925     8246382.721104
-194244.031411     8246398.070231
-194263.193751     8246412.764377
-194284.233364     8246427.487341
-194297.290999     8246432.696427
-194313.416931     8246441.709383
-194330.319463     8246441.342529
-194349.311854     8246427.860404
-194367.668628     8246414.994077
-194389.163802     8246401.549989
-194401.182259     8246393.595389
-194411.960595     8246384.995815
-194416.572728     8246370.666242
-194419.933848     8246356.317847
-194426.605472     8246330.750729
-194427.544810     8246311.356133
-194429.059791     8246295.101205
-194432.471529     8246277.623138
-194432.709425     8246277.000000
-END
-LINE3D
-HEIGHT 1010.000000
-194985.449425     8246277.000000
-194992.473317     8246283.715046
-195009.174898     8246295.867287
-195017.000000     8246301.350941
-END
-LINE3D
-HEIGHT 1040.000000
-183655.558467     8246277.000000
-183659.717134     8246280.045811
-183677.083570     8246289.703746
-183694.480566     8246297.483957
-183714.975282     8246307.189913
-183739.940780     8246311.329537
-183762.454304     8246312.301455
-183785.603650     8246312.656814
-183806.875913     8246312.983358
-183825.019897     8246313.261881
-183841.902562     8246314.146978
-183866.908551     8246315.783094
-183892.550170     8246316.802648
-183913.822624     8246317.129195
-183929.545009     8246312.361902
-183941.574166     8246303.781147
-183964.875175     8246294.747486
-184004.514327     8246281.582303
-184012.826955     8246277.000000
-END
-LINE3D
-HEIGHT 1040.000000
-186145.811522     8246277.000000
-186152.231041     8246285.750898
-186169.960146     8246311.692966
-186187.698995     8246337.008865
-186205.519220     8246357.316988
-186220.292147     8246372.570073
-186235.105188     8246385.319261
-186249.282606     8246398.684628
-186268.364334     8246418.386562
-186278.717102     8246436.075924
-186285.386572     8246449.326040
-186292.722417     8246460.082254
-186304.992567     8246475.296919
-186320.391003     8246490.559224
-186340.239967     8246501.507524
-186360.108798     8246511.203872
-186386.264939     8246519.118542
-186403.096986     8246523.133313
-186419.939155     8246526.522301
-186434.954668     8246526.752800
-186449.345060     8246526.973702
-186467.488852     8246527.252222
-186484.926148     8246532.528922
-186511.062047     8246541.695155
-186522.131427     8246553.760938
-186529.477400     8246563.890989
-186543.725677     8246572.875121
-186564.876647     8246580.712958
-186572.848123     8246590.852611
-186576.944332     8246608.445931
-186579.183892     8246624.758876
-186592.745545     8246637.488854
-186615.692419     8246650.362902
-186642.463942     8246658.912956
-186666.168307     8246663.659540
-186687.339143     8246670.245426
-186704.171191     8246674.260196
-186720.417844     8246675.761850
-186736.685127     8246676.011564
-186750.449634     8246676.222859
-186764.920631     8246671.436356
-186788.140843     8246667.410097
-186811.925819     8246667.148894
-186825.710568     8246666.108626
-186843.854361     8246666.387146
-186851.190213     8246677.142978
-186860.795612     8246702.334023
-186861.077292     8246723.625555
-186854.587892     8246737.925929
-186846.857225     8246751.581312
-186842.779486     8246771.553668
-186863.253953     8246782.511570
-186876.372333     8246783.964820
-186894.324157     8246796.136254
-186905.846944     8246818.852219
-186910.639898     8246832.073911
-186917.944992     8246844.707847
-186930.739798     8246866.191082
-186946.249584     8246874.568643
-186959.943231     8246879.161173
-186976.764769     8246883.802101
-186989.227270     8246887.123859
-187011.629628     8246894.980905
-187032.104095     8246905.938807
-187045.161730     8246911.147893
-187054.404836     8246920.055193
-187071.024291     8246937.214434
-187081.407428     8246953.026069
-187092.476808     8246965.091852
-187101.669297     8246977.128824
-187113.384816     8246987.951888
-187125.120196     8246997.523382
-187138.066849     8247009.617983
-187149.731363     8247023.571095
-187160.770755     8247037.514611
-187175.442070     8247059.026652
-187189.992277     8247088.050372
-187202.948675     8247099.518803
-187212.171539     8247109.677665
-187223.240919     8247121.743449
-187235.007050     8247129.437222
-187251.061359     8247142.831401
-187268.347189     8247157.496742
-187277.570047     8247167.655986
-187286.075912     8247183.438804
-187289.506127     8247203.526030
-187301.644672     8247226.877767
-187320.513425     8247259.724166
-187339.554281     8247281.929602
-187350.603800     8247295.246954
-187363.529823     8247308.593494
-187373.933209     8247323.153184
-187384.285978     8247340.842547
-187397.171510     8247356.692596
-187413.256188     8247368.209048
-187426.233211     8247378.425922
-187436.727711     8247387.352049
-187455.224051     8247404.540483
-187467.565068     8247415.373531
-187486.828643     8247423.808332
-187504.851334     8247431.598148
-187517.807732     8247443.066579
-187529.533367     8247453.264243
-187540.623001     8247464.077699
-187552.964018     8247474.910747
-187564.709519     8247483.856459
-187575.193892     8247493.408750
-187589.411800     8247504.270609
-187607.454739     8247510.808480
-187622.399774     8247515.420220
-187637.395038     8247516.902664
-187655.478468     8247520.937026
-187674.772413     8247527.494100
-187690.403690     8247528.359988
-187703.481955     8247532.317135
-187720.313614     8247536.332281
-187748.407392     8247540.519927
-187773.413380     8247542.156042
-187791.496816     8247546.190022
-187815.210920     8247550.310819
-187842.719685     8247551.985354
-187870.197698     8247555.537610
-187894.578190     8247557.163742
-187923.297465     8247561.361371
-187957.062789     8247563.131949
-187986.418076     8247566.713023
-188010.828556     8247566.461421
-188024.613311     8247565.420771
-188050.295802     8247563.936822
-188070.316487     8247564.244153
-188092.850450     8247563.964129
-188126.020265     8247563.846989
-188151.682127     8247563.614980
-188179.221261     8247563.411788
-188209.273300     8247562.620852
-188243.058109     8247563.139472
-188274.351032     8247562.993521
-188297.561499     8247559.593432
-188320.155826     8247555.557565
-188340.247376     8247551.483279
-188369.714402     8247548.179232
-188391.632608     8247547.263436
-188414.156068     8247547.609187
-188436.054026     8247547.945336
-188464.834046     8247548.387129
-188496.671479     8247553.258562
-188519.760468     8247557.369380
-188543.443820     8247563.367898
-188563.949038     8247572.448079
-188585.079766     8247581.537479
-188610.004767     8247588.180994
-188626.150185     8247595.941992
-188639.147074     8247604.906915
-188655.241879     8247615.797204
-188674.475843     8247626.110126
-188688.118484     8247633.832705
-188709.803848     8247647.313325
-188723.456616     8247654.409740
-188739.592670     8247662.796914
-188759.532367     8247668.111645
-188779.451815     8247674.678321
-188797.545372     8247678.086519
-188819.392712     8247681.552341
-188842.461452     8247686.915104
-188867.467440     8247688.551220
-188886.781634     8247693.856349
-188901.676045     8247701.598144
-188919.092717     8247708.126400
-188937.751038     8247715.299655
-188956.378983     8247724.351018
-188970.073005     8247728.943936
-188986.854053     8247736.088373
-189006.712762     8247746.410503
-189029.751127     8247753.651376
-189052.203721     8247758.378745
-189073.445806     8247760.583019
-189088.400962     8247764.568977
-189103.233870     8247776.066214
-189112.446607     8247786.851240
-189123.506247     8247799.542811
-189133.293869     8247813.467111
-189145.442541     8247836.192685
-189159.417863     8247862.077130
-189172.333765     8247876.049452
-189192.717505     8247892.640540
-189226.127740     8247916.318813
-189258.963854     8247936.857822
-189277.439952     8247955.297820
-189295.280419     8247974.354380
-189314.916409     8247998.447145
-189340.325181     8248013.863498
-189376.945447     8248032.582404
-189399.225945     8248047.950353
-189417.864018     8248056.375552
-189434.000071     8248064.762726
-189449.560482     8248070.010232
-189471.982707     8248076.615327
-189500.621000     8248085.819974
-189522.952111     8248098.058633
-189547.755628     8248112.213438
-189569.380247     8248129.449894
-189586.070944     8248142.227905
-189610.894710     8248155.130765
-189633.215699     8248167.995205
-189656.767452     8248182.130413
-189675.890059     8248199.328461
-189694.457265     8248212.135278
-189711.086453     8248228.669114
-189734.588352     8248245.934006
-189754.305328     8248265.019371
-189775.365184     8248278.490771
-189792.660372     8248292.530318
-189810.602075     8248305.327534
-189829.723924     8248322.525188
-189857.584854     8248341.109632
-189879.077869     8248366.483160
-189898.139730     8248387.437045
-189920.450598     8248400.927267
-189942.135963     8248414.407887
-189967.534614     8248430.450021
-189994.840914     8248444.642863
-190010.905343     8248457.411261
-190026.334136     8248470.796602
-190041.086821     8248487.301250
-190064.506963     8248509.573911
-190091.076402     8248530.642278
-190115.768556     8248551.682592
-190132.448368     8248565.086373
-190149.693696     8248582.255986
-190171.903328     8248602.005553
-190192.811336     8248624.865588
-190213.780082     8248643.970169
-190235.435072     8248659.328898
-190248.411718     8248669.545384
-190263.800027     8248685.433852
-190280.419100     8248702.593087
-190299.521458     8248721.043081
-190321.054970     8248743.912718
-190347.552773     8248769.363073
-190371.680163     8248786.638331
-190383.385561     8248798.087176
-190405.666053     8248813.455507
-190422.345865     8248826.859288
-190437.179531     8248838.356919
-190454.928884     8248863.047042
-190465.240779     8248883.239907
-190473.777389     8248897.145386
-190485.422048     8248912.349685
-190500.850841     8248925.735026
-190520.598194     8248942.942283
-190533.030319     8248948.142150
-190552.244046     8248959.706253
-190578.339060     8248971.376753
-190594.555344     8248974.756134
-190612.063894     8248975.650839
-190632.013718     8248980.339407
-190651.257046     8248990.026153
-190673.578798     8249002.890605
-190690.884101     8249016.304753
-190714.487236     8249027.310299
-190739.290759     8249041.464722
-190764.729894     8249055.003730
-190785.789756     8249068.474748
-190801.259058     8249079.355435
-190827.343951     8249091.651717
-190858.393900     8249106.528728
-190882.551678     8249121.925112
-190903.500171     8249142.282021
-190927.668069     8249157.052624
-190949.444537     8249164.900445
-190969.363985     8249171.467121
-190991.110089     8249181.192287
-191013.501950     8249189.674728
-191027.135227     8249198.023482
-191041.464116     8249201.999827
-191055.743151     8249209.105856
-191075.016842     8249216.915258
-191109.255822     8249228.084072
-191138.468995     8249240.428375
-191161.446626     8249251.424320
-191190.710417     8249260.638951
-191225.554645     8249273.069695
-191256.685588     8249282.938925
-191277.150310     8249294.522996
-191297.049516     8249302.341236
-191311.369048     8249306.943374
-191339.351456     8249318.016910
-191364.185343     8249330.293988
-191385.275580     8249341.886897
-191398.231972     8249353.355710
-191413.721517     8249362.984834
-191433.519487     8249377.062418
-191467.677474     8249393.239014
-191490.584233     8249408.616958
-191502.400988     8249413.180677
-191521.059297     8249420.354695
-191532.875288     8249424.918403
-191540.745910     8249441.317406
-191553.005939     8249457.157853
-191576.457208     8249477.553181
-191601.754623     8249499.854660
-191617.788690     8249514.500402
-191636.325520     8249529.185328
-191648.081536     8249537.504501
-191662.299056     8249548.366737
-191677.788601     8249557.995860
-191700.664996     8249575.251150
-191727.355150     8249588.808597
-191744.691592     8249600.344647
-191757.617622     8249613.690805
-191770.533517     8249627.663509
-191784.650577     8249644.784336
-191792.551562     8249659.305995
-191803.549700     8249675.753008
-191818.282143     8249693.509219
-191839.331871     8249707.606783
-191852.903645     8249719.710980
-191862.691273     8249733.634898
-191873.095035     8249748.194976
-191885.859089     8249771.555933
-191900.480162     8249796.198035
-191910.852797     8249812.635446
-191918.148534     8249825.895175
-191927.239786     8249844.191491
-191947.914183     8249881.448313
-191964.250555     8249916.134031
-191969.062993     8249928.103766
-191981.807569     8249952.716298
-192000.615578     8249989.318532
-192011.654212     8250003.261654
-192024.631611     8250013.478916
-192037.648754     8250021.191511
-192053.895413     8250022.692783
-192067.639284     8250024.156399
-192092.554164     8250031.425696
-192113.715261     8250038.637369
-192131.788563     8250043.297895
-192146.733598     8250047.909635
-192167.298792     8250053.234350
-192191.013284     8250057.354770
-192221.589596     8250062.832398
-192242.164911     8250067.531332
-192259.673461     8250068.426037
-192278.422897     8250069.965728
-192300.300599     8250071.554205
-192335.337179     8250072.092041
-192364.743465     8250072.543448
-192389.244671     8250066.658660
-192409.357234     8250061.332440
-192430.700548     8250057.277751
-192452.124092     8250048.215270
-192472.277152     8250040.385159
-192493.085314     8250030.687294
-192516.427392     8250019.149751
-192539.122949     8250008.854921
-192568.044701     8250000.533479
-192603.233134     8249991.682299
-192633.416777     8249982.754291
-192662.953912     8249975.068232
-192694.418925     8249964.282083
-192722.079550     8249956.567219
-192740.990961     8249948.092111
-192762.425390     8249938.403860
-192790.721639     8249930.072816
-192824.043683     8249920.567047
-192853.590939     8249912.255207
-192873.743222     8249904.425849
-192896.378816     8249897.885722
-192925.280314     8249890.816607
-192957.895110     8249886.308242
-192983.567093     8249885.450451
-193001.772006     8249881.973523
-193017.413404     8249882.213630
-193032.439421     8249881.818352
-193048.726576     8249880.815733
-193070.039527     8249878.638390
-193084.440040     8249878.233511
-193105.106470     8249877.298881
-193123.260766     8249876.951625
-193147.610882     8249880.455866
-193169.427858     8249885.799032
-193182.505741     8249889.756173
-193199.327273     8249894.397483
-193222.970904     8249902.899139
-193242.173735     8249915.089777
-193265.161488     8249925.459940
-193286.907591     8249935.185106
-193308.805549     8249935.521255
-193333.205519     8249935.895812
-193363.862812     8249936.366423
-193390.140819     8249936.769808
-193413.915286     8249937.134763
-193440.132542     8249941.294367
-193465.703301     8249946.695157
-193491.889430     8249952.732094
-193513.080891     8249958.066422
-193530.498326     8249964.594691
-193550.417775     8249971.161367
-193567.875707     8249975.185745
-193584.636512     8249983.581745
-193596.422892     8249990.023573
-193616.281589     8250000.346467
-193626.776478     8250009.272218
-193641.619501     8250020.144055
-193658.198841     8250039.807193
-193676.008932     8250060.741862
-193694.566017     8250074.174461
-193710.015065     8250086.307475
-193726.099749     8250097.823545
-193742.184421     8250109.340380
-193751.417407     8250118.873460
-193767.451473     8250133.519203
-193778.470617     8250148.714665
-193788.318984     8250158.883129
-193796.906212     8250169.658935
-193815.947067     8250191.864372
-193846.341150     8250208.609126
-193866.703872     8250226.452530
-193885.281212     8250238.632802
-193897.006840     8250248.830848
-193918.742823     8250259.181795
-193934.242488     8250268.185137
-193949.187523     8250272.796877
-END
-LINE3D
-HEIGHT 1040.000000
-193961.761381     8250269.233508
-193981.528975     8250285.189202
-193990.126336     8250295.338462
-194003.143480     8250303.051057
-194016.242369     8250305.756647
-194031.156264     8250312.246484
-194046.162038     8250313.102771
-194066.798856     8250314.046262
-194094.267130     8250318.224305
-194123.611914     8250322.431155
-194144.752757     8250330.895155
-194162.836193     8250334.929135
-194175.863457     8250342.015949
-194195.823403     8250346.078734
-194215.703118     8250355.149313
-194239.386470     8250361.147831
-194256.198657     8250366.414170
-194277.379233     8250372.374268
-194299.660489     8250387.742611
-194328.731929     8250408.850150
-194353.413974     8250430.515481
-194366.259010     8250448.869420
-194384.170337     8250463.544744
-194403.917690     8250480.752001
-194425.633418     8250492.355276
-194442.445605     8250497.621615
-194454.150991     8250509.071225
-194473.908464     8250525.652700
-194491.667938     8250549.717041
-194507.570393     8250572.500237
-194516.026021     8250591.412733
-194526.267045     8250615.987598
-194536.004055     8250633.041189
-194546.830848     8250660.129558
-194551.007663     8250672.715473
-194552.006343     8250688.383050
-194556.626444     8250712.244929
-194560.168386     8250725.447799
-194559.844436     8250745.477396
-194559.571104     8250762.377321
-194543.727235     8250774.655904
-194532.293014     8250785.124367
-194517.186004     8250790.527426
-194501.534485     8250790.913101
-194484.571221     8250795.035026
-194458.151481     8250803.394876
-194428.462493     8250820.469951
-194410.085483     8250834.587460
-194395.594619     8250840.625914
-194384.059163     8250857.353721
-194372.009573     8250867.186037
-194367.326579     8250885.896846
-194367.002630     8250905.926443
-194365.447152     8250924.685262
-194365.133324     8250944.089078
-194373.538334     8250966.131246
-194380.116690     8250985.014925
-194384.737541     8251008.877579
-194393.102055     8251033.423638
-194402.011091     8251062.986316
-194409.587363     8251097.537560
-194418.022737     8251117.702384
-194431.524415     8251134.187828
-194446.286456     8251150.066682
-194459.010778     8251175.931542
-194473.519730     8251207.458758
-194483.822256     8251228.278181
-194491.692114     8251244.677172
-194497.665221     8251262.298922
-194497.815672     8251291.727914
-194498.580754     8251321.791514
-194499.497677     8251342.466861
-194502.312128     8251361.918698
-194502.069160     8251376.941278
-194489.625512     8251411.185202
-194484.275754     8251432.390288
-194477.695246     8251452.323843
-194463.001146     8251470.880974
-194443.826525     8251495.630226
-194416.860874     8251537.790701
-194391.166483     8251578.718053
-194371.325862     8251605.961593
-194353.442744     8251628.226157
-194333.128474     8251646.071078
-194312.208191     8251662.654058
-194283.073846     8251684.119971
-194259.005029     8251701.907257
-194242.576153     8251711.672347
-194228.054913     8251719.588910
-194207.276363     8251727.408654
-194187.194927     8251730.857541
-194161.522181     8251731.715320
-194138.352975     8251732.611531
-194113.942108     8251732.863508
-194076.402752     8251732.287253
-194035.109614     8251731.653374
-194001.949544     8251731.144344
-193980.677854     8251730.817808
-193947.598778     8251725.300997
-193916.326102     8251724.195002
-193878.786747     8251723.618747
-193848.765078     8251722.531956
-193818.108549     8251722.061357
-193787.431013     8251722.842309
-193762.969540     8251726.223195
-193737.862310     8251730.846806
-193722.150051     8251734.987935
-193705.802156     8251739.746008
-193684.428466     8251745.678806
-193656.213211     8251749.002068
-193636.050794     8251757.457972
-193615.282365     8251764.651935
-193590.124516     8251772.405218
-193561.828267     8251780.736262
-193522.744331     8251798.292291
-193486.798020     8251815.271312
-193462.154318     8251829.919324
-193441.275295     8251843.998425
-193419.235605     8251852.425511
-193389.677465     8251861.363121
-193368.152685     8251876.684948
-193349.190657     8251888.289728
-193331.439138     8251902.417602
-193316.745039     8251920.974734
-193292.575762     8251945.020612
-193269.687843     8251967.209113
-193251.148858     8251991.341420
-193235.930492     8252003.629605
-193223.204768     8252016.582755
-193205.352026     8252036.969210
-193183.705756     8252059.802709
-193150.948476     8252073.073533
-193129.453308     8252086.517239
-193113.670177     8252095.040368
-193095.970040     8252106.038582
-193078.833903     8252120.801840
-193059.216008     8252134.274363
-193028.881275     8252152.591400
-193004.660604     8252179.767703
-192984.971837     8252197.622226
-192963.446293     8252212.944040
-192950.084958     8252226.512606
-192937.863259     8252246.986266
-192919.445753     8252263.607665
-192890.734439     8252297.601869
-192856.503427     8252324.624506
-192834.948283     8252341.823678
-192817.166389     8252357.829661
-192792.532820     8252371.851127
-192770.997155     8252387.798724
-192755.072292     8252405.085088
-192741.115817     8252416.766707
-192728.995366     8252430.980258
-192713.625146     8252452.657460
-192691.362730     8252474.855563
-192668.484944     8252496.417519
-192643.709643     8252519.202220
-192620.155736     8252543.884246
-192601.626860     8252567.391536
-192586.327512     8252584.686738
-192571.130152     8252595.723371
-192554.670136     8252607.366559
-192529.996834     8252623.891927
-192505.998890     8252637.297213
-192490.780523     8252649.585398
-192477.953564     8252668.797893
-192464.571986     8252683.618022
-192455.630421     8252694.750686
-192442.783219     8252715.214744
-192434.366698     8252732.615602
-192429.612068     8252755.708399
-192428.077609     8252773.214902
-192423.383731     8252792.551481
-192422.322909     8252819.457367
-192430.748162     8252840.247972
-192439.143051     8252862.915922
-192453.026500     8252894.433537
-192471.815030     8252932.287346
-192485.285569     8252950.650888
-192494.457815     8252963.939423
-192508.019468     8252976.669401
-192537.767805     8252994.656117
-192558.766916     8253011.883353
-192574.165346     8253027.146039
-192584.044088     8253035.436395
-192593.922819     8253043.727514
-192604.346835     8253057.035265
-192614.749833     8253071.595331
-192624.577958     8253083.015359
-192634.759006     8253111.345689
-192635.605070     8253136.402272
-192635.260865     8253157.684197
-192629.275484     8253179.505463
-192623.381217     8253195.693165
-192615.045677     8253208.087006
-192609.232392     8253219.267692
-192605.901640     8253231.738360
-192595.739445     8253240.973711
-192583.639237     8253253.935699
-192566.412749     8253274.332532
-192548.671364     8253287.833861
-192526.641795     8253295.635165
-192502.674226     8253307.162343
-192490.069993     8253312.603821
-192466.234787     8253315.994320
-192446.142467     8253320.068976
-192425.405164     8253325.385606
-192400.368806     8253325.627217
-192375.251455     8253330.876610
-192349.518733     8253335.489855
-192328.084304     8253345.178107
-192309.768021     8253355.540925
-192292.754139     8253362.792523
-192269.462679     8253371.200394
-192241.761569     8253381.418385
-192225.968317     8253390.567295
-192213.283090     8253401.016555
-192201.122907     8253417.734008
-192192.806845     8253428.876274
-192185.702069     8253442.540882
-192173.591727     8253456.129416
-192165.275678     8253467.270918
-192169.392517     8253483.612298
-192172.227210     8253501.812572
-192181.358960     8253517.604997
-192193.023849     8253531.558497
-192204.667745     8253546.762785
-192223.820721     8253562.083106
-192250.964270     8253586.291500
-192286.272791     8253608.746656
-192303.527488     8253625.289712
-192312.043855     8253640.446754
-192321.195859     8253654.986852
-192332.144131     8253674.564313
-192342.506644     8253691.627506
-192352.365133     8253701.170189
-192364.736519     8253710.125509
-192379.620814     8253718.492703
-192402.568070     8253731.366757
-192419.832889     8253747.284031
-192436.371732     8253769.451060
-192447.914379     8253790.915456
-192457.621778     8253809.847168
-192464.876254     8253825.610776
-192485.280236     8253840.950301
-192512.021008     8253851.378076
-192539.993296     8253863.077393
-192565.432443     8253876.615637
-192574.655307     8253886.774499
-192589.357374     8253906.408819
-192597.298856     8253918.426587
-192609.477891     8253939.274816
-192622.272309     8253960.758427
-192634.965503     8253988.500620
-192645.146551     8254016.830950
-192652.732944     8254050.756413
-192657.847700     8254082.765359
-192663.577826     8254115.410452
-192669.419321     8254141.169655
-192669.842352     8254153.697947
-192677.148210     8254166.331894
-192679.407255     8254181.392882
-192679.164286     8254196.415462
-192677.528591     8254220.181309
-192673.410362     8254242.657174
-192673.096521     8254262.061754
-192673.306960     8254287.734517
-192672.952635     8254309.642223
-192672.659049     8254327.794475
-192672.335099     8254347.824073
-192668.206749     8254370.925719
-192667.237042     8254392.198042
-192663.229406     8254407.788769
-192663.016813     8254420.933240
-192654.559782     8254440.838753
-192649.321394     8254455.157949
-192640.298836     8254471.298395
-192628.723659     8254490.529341
-192615.200348     8254514.112705
-192599.133753     8254540.162305
-192584.872806     8254570.621946
-192576.557520     8254581.763460
-192561.903918     8254597.816700
-192541.549151     8254618.165512
-192526.956287     8254630.463299
-192516.743474     8254642.828322
-192497.054706     8254660.682845
-192478.485346     8254686.693262
-192463.236604     8254700.859555
-192437.876296     8254721.130764
-192418.167275     8254740.237614
-192392.262445     8254755.492204
-192360.059808     8254773.153866
-192338.545136     8254787.850675
-192318.896102     8254803.201295
-192296.765322     8254817.260416
-192279.075294     8254827.633613
-192267.045958     8254836.213601
-192248.719554     8254847.202201
-192229.040908     8254864.430942
-192208.767135     8254879.771972
-192195.374660     8254895.218635
-192187.654514     8254908.247096
-192173.041408     8254921.796446
-192161.567455     8254934.768812
-192146.359222     8254946.430451
-192131.796709     8254956.851657
-192120.363265     8254967.319367
-192104.377675     8254988.360422
-192092.186352     8255006.955973
-192079.914036     8255030.559305
-192070.073636     8255058.582292
-192064.744897     8255078.535062
-192060.142134     8255092.238078
-192048.556811     8255112.096334
-192029.361948     8255138.097149
-192011.397849     8255165.368730
-191993.605845     8255181.999731
-191974.552703     8255199.238074
-191956.176444     8255213.356359
-191944.045873     8255228.195692
-191931.884901     8255244.914662
-191913.386401     8255266.543842
-191893.444557     8255300.045963
-191879.981986     8255319.873873
-191872.250943     8255333.528868
-191858.183110     8255352.095613
-191846.546406     8255375.083529
-191841.974782     8255386.908448
-191832.820636     8255411.184819
-191827.593109     8255424.879773
-191823.020721     8255436.704680
-191819.013849     8255452.295418
-191818.710141     8255471.073452
-191821.514471     8255491.151071
-191826.206183     8255510.632490
-191836.173887     8255552.106515
-191839.725199     8255564.682828
-191855.728877     8255581.207444
-191872.389198     8255595.863564
-191888.403010     8255611.761634
-191906.152375     8255636.450993
-191918.875920     8255662.316605
-191922.427231     8255674.892917
-191927.240446     8255686.861900
-191934.464546     8255704.503617
-191938.530755     8255723.975434
-191939.538806     8255739.016454
-191942.413996     8255754.712837
-191942.624422     8255780.386363
-191944.924727     8255792.943472
-191931.421671     8255815.274509
-191921.188616     8255828.891096
-191911.581038     8255842.518813
-191899.490951     8255854.855019
-191881.800184     8255865.226675
-191858.499366     8255874.260340
-191837.639835     8255887.087101
-191821.745347     8255902.495357
-191808.171407     8255929.209157
-191790.318652     8255949.596377
-191780.781960     8255958.841330
-191768.692637     8255971.177548
-191758.438575     8255986.045686
-191726.277186     8256001.204233
-191702.148394     8256022.746985
-191689.987422     8256039.465955
-191674.062583     8256056.750791
-191650.609148     8256075.173461
-191622.777191     8256093.528917
-191585.004988     8256107.349460
-191561.673031     8256118.261221
-191532.065037     8256130.328515
-191513.183990     8256136.926278
-191484.897886     8256144.630012
-191472.828041     8256155.714655
-191463.845992     8256169.350446
-191442.279939     8256187.176915
-191432.107635     8256197.037284
-191423.196445     8256206.291839
-191418.533694     8256223.751085
-191405.101474     8256241.702414
-191395.524297     8256253.450494
-191380.688477     8256280.770097
-191364.712996     8256301.186134
-191337.729256     8256305.780939
-191315.002560     8256317.953866
-191301.177684     8256321.498795
-191288.028953     8256321.922125
-191260.317710     8256332.766662
-191235.785365     8256340.529547
-191206.995236     8256340.712771
-191181.242260     8256346.578344
-191156.104654     8256353.080064
-191142.319523     8256354.120326
-191113.549612     8256353.053515
-191087.414113     8256343.886142
-191073.730218     8256338.667060
-191060.067329     8256332.196426
-191033.921673     8256323.657126
-191016.463753     8256319.631984
-190998.945081     8256319.363060
-190983.919816     8256319.759113
-190951.385250     8256319.259685
-190928.236286     8256318.904332
-190900.152654     8256314.089377
-190875.853156     8256307.455464
-190852.775052     8256302.718875
-190824.711638     8256296.653885
-190798.545000     8256289.364608
-190778.655927     8256280.919823
-190758.826818     8256268.720336
-190732.701428     8256258.927945
-190699.713454     8256247.778334
-190674.839071     8256238.005147
-190663.678958     8256231.572933
-190643.758746     8256225.006245
-190618.742642     8256223.995529
-190586.269566     8256219.741422
-190561.263596     8256218.104160
-190542.564779     8256213.434797
-190529.527393     8256206.973765
-190514.582358     8256202.362025
-190495.288413     8256195.804951
-190468.476004     8256189.759164
-190443.510519     8256185.618775
-190425.427096     8256181.584032
-190404.165514     8256180.632479
-190381.651423     8256179.660170
-190355.999683     8256179.266398
-190327.845166     8256178.834206
-190309.055246     8256179.797642
-190284.603894     8256182.552746
-190270.839769     8256182.341457
-190253.886613     8256185.838365
-190237.598706     8256186.840208
-190224.419575     8256189.143176
-190231.068815     8256203.644091
-190232.097847     8256217.435087
-190237.757125     8256254.460652
-190237.240812     8256286.383921
-190232.395093     8256315.108753
-190226.501577     8256331.297232
-190221.574864     8256365.029845
-190212.976101     8256393.698594
-190205.113446     8256415.491042
-190201.147083     8256428.577126
-190196.423581     8256449.792589
-190191.709448     8256470.381496
-190192.071753     8256486.664477
-190195.502350     8256506.751709
-190198.729687     8256539.359147
-190202.179762     8256558.194805
-190211.987633     8256570.867160
-190225.408330     8256592.359621
-190238.071148     8256621.979923
-190251.298718     8256655.366044
-190264.648530     8256681.241270
-190271.267395     8256697.620293
-190274.132451     8256713.943222
-190273.859120     8256730.843147
-190273.555412     8256749.621181
-190273.251705     8256768.399215
-190272.897380     8256790.306922
-190267.648871     8256805.251899
-190266.780387     8256820.265641
-190262.117636     8256837.724887
-190257.484496     8256853.306012
-190257.241540     8256868.327828
-190256.281954     8256888.974369
-190254.787992     8256903.976981
-190254.494393     8256922.129998
-190252.252686     8256944.633904
-190250.708081     8256962.767717
-190248.608094     8256976.509152
-END
-LINE3D-MASTER
-HEIGHT 1050.000000
-183557.000000     8246655.540109
-183559.642744     8246663.554871
-183580.722657     8246675.774323
-183600.037041     8246681.079455
-183616.132031     8246691.970129
-183627.786615     8246706.549025
-183638.149504     8246723.612606
-183647.835896     8246743.795869
-183651.336781     8246759.501857
-183651.729628     8246773.908260
-183655.260888     8246787.736139
-183667.561407     8246801.073077
-183683.091449     8246808.198310
-183712.114622     8246793.617909
-183736.041324     8246784.593852
-183758.141753     8246772.411312
-183773.400425     8246757.619233
-183788.084213     8246739.687880
-183801.506293     8246722.363479
-183814.221883     8246710.036874
-183836.443797     8246690.343044
-183851.631788     8246679.932968
-183869.301931     8246670.812869
-183888.253838     8246659.833871
-183901.615364     8246646.265308
-183914.987024     8246632.070200
-183931.476639     8246618.549655
-183947.986700     8246603.776786
-183962.538876     8246593.982887
-183973.942339     8246585.392528
-183988.484202     8246576.224407
-184006.154536     8246567.104311
-184020.696400     8246557.936191
-184035.863958     8246548.777675
-184051.122821     8246533.985600
-184072.073098     8246515.524505
-184084.677325     8246510.083409
-184105.516244     8246498.507441
-184123.802145     8246490.023113
-184147.738975     8246480.372893
-184163.522100     8246471.850146
-184177.367600     8246467.053660
-184191.848719     8246461.641375
-184206.350092     8246454.976764
-184224.605623     8246448.370163
-184251.711223     8246436.264456
-184273.094843     8246429.705873
-184291.299572     8246426.228560
-184305.165315     8246420.180510
-184314.722256     8246409.683612
-184329.274241     8246399.889710
-184350.093103     8246389.565690
-184377.168333     8246379.337709
-184396.634565     8246375.254206
-184419.239211     8246370.592179
-184433.074386     8246366.422235
-184450.754848     8246356.675975
-184472.128347     8246350.743175
-184498.578074     8246340.505592
-184522.423783     8246336.489317
-184541.930518     8246329.901541
-184558.298846     8246323.891908
-184575.898123     8246319.153427
-184595.374483     8246314.443760
-184625.486878     8246309.897364
-184653.783128     8246301.566320
-184675.126257     8246297.511246
-184697.751145     8246291.597655
-184719.821204     8246281.292842
-184732.604514     8246277.000000
-END
-LINE3D-MASTER
-HEIGHT 1050.000000
-184977.156443     8246277.000000
-184989.489068     8246284.806496
-185010.548738     8246298.277511
-185024.130825     8246309.755929
-185034.645574     8246317.430111
-185047.652966     8246325.769257
-185059.469340     8246330.332970
-185069.973955     8246338.633698
-185091.689689     8246350.236591
-185107.895852     8246354.241753
-185127.825803     8246360.182653
-185151.438677     8246370.562413
-185171.398998     8246374.625586
-185190.067440     8246381.173059
-185212.530544     8246385.274269
-185238.101296     8246390.675441
-185262.451412     8246394.179682
-185278.627199     8246400.062953
-185291.039082     8246406.514383
-185304.035977     8246415.478923
-185318.294757     8246423.837280
-185331.866538     8246435.941094
-185349.787993     8246449.990255
-185361.473137     8246462.691428
-185379.252483     8246485.503436
-185395.155314     8246508.287020
-185406.113337     8246527.237930
-185415.255213     8246542.404191
-185429.815165     8246570.801741
-185443.871474     8246591.678787
-185456.131503     8246607.519234
-185462.790852     8246621.395131
-185471.942843     8246635.935993
-185484.152255     8246654.906113
-185500.791952     8246670.813791
-185518.632037     8246689.870345
-185538.379771     8246707.077607
-185560.680894     8246721.193999
-185580.509228     8246733.394238
-185604.697369     8246746.913277
-185631.317038     8246764.852348
-185651.034397     8246783.937719
-185666.412578     8246800.452351
-185680.569747     8246815.069664
-185696.705425     8246823.456450
-185714.737855     8246830.620479
-185735.323685     8246834.692872
-185765.294736     8246838.909335
-185787.131948     8246843.001320
-185800.250322     8246844.454953
-185818.323636     8246849.114714
-185848.101955     8246865.224079
-185873.682829     8246869.999469
-185895.570659     8246870.961782
-185915.541107     8246874.398791
-185931.808008     8246874.648500
-185949.326680     8246874.917424
-185966.855097     8246874.560178
-185985.695641     8246870.466688
-186007.684707     8246865.169656
-186022.155704     8246860.383153
-186041.783732     8246846.284084
-186054.468947     8246835.835589
-186072.744733     8246827.976661
-186090.828162     8246832.011023
-186100.696778     8246840.927542
-186111.857272     8246847.359762
-186131.746727     8246855.804554
-186149.739048     8246865.472096
-186164.673574     8246870.709995
-186185.865041     8246876.043941
-186198.357911     8246877.487971
-186217.651856     8246884.045046
-186231.960878     8246889.273342
-186256.260377     8246895.907255
-186276.765213     8246904.987430
-186292.890770     8246913.999997
-186305.292525     8246921.077591
-186317.068402     8246928.145195
-186334.465207     8246935.925403
-186346.897339     8246941.124887
-186376.191887     8246948.461415
-186391.782667     8246951.831193
-186407.373447     8246955.200972
-186422.974349     8246957.944969
-186437.939626     8246961.305146
-186450.422375     8246963.374958
-186463.520500     8246966.080536
-186479.484076     8246985.108284
-186479.886859     8246998.888521
-186475.264229     8247013.843488
-186462.538511     8247026.796256
-186450.448806     8247039.132468
-186440.891871     8247049.628985
-186431.264064     8247064.507501
-186412.846552     8247081.129282
-186396.972312     8247095.285592
-186387.919390     8247113.303383
-186382.620639     8247131.378420
-186382.993435     8247147.036390
-186397.322700     8247151.013123
-186409.957302     8247143.693918
-186420.745383     8247134.468174
-186431.522961     8247125.868206
-186441.120393     8247112.867799
-186456.490613     8247091.190597
-186464.170662     8247080.664887
-186476.926749     8247065.834392
-186492.154855     8247052.920420
-186516.071818     8247044.522151
-186530.168242     8247062.895300
-186534.325190     8247076.733166
-186529.601324     8247097.947478
-186518.712008     8247113.432566
-186509.134818     8247125.181410
-186500.819144     8247136.323300
-186488.688561     8247151.163396
-186478.384638     8247169.161601
-186472.368881     8247192.860976
-186472.761925     8247207.267000
-186483.871802     8247216.828893
-186500.754467     8247217.713990
-186518.566337     8247199.831038
-186526.922508     8247186.185257
-186534.037411     8247171.894485
-186541.778206     8247157.612939
-186550.134370     8247143.967541
-186558.450432     8247132.825275
-186566.150342     8247121.047995
-186575.747780     8247108.047206
-186590.330516     8247096.375583
-186603.056233     8247083.422815
-186615.024454     8247078.597893
-186626.427911     8247070.007915
-186637.831756     8247061.417561
-186657.852440     8247061.724893
-186672.746851     8247069.466687
-186686.873650     8247085.961727
-186701.697195     8247098.085140
-186713.412326     8247108.908579
-186723.856209     8247120.964379
-186737.438492     8247132.442418
-186750.486000     8247138.277668
-186763.432653     8247150.372268
-186777.004815     8247162.476089
-186796.177276     8247176.544453
-186814.683743     8247193.106724
-186829.547785     8247202.726246
-186842.615540     8247207.309551
-186861.243485     8247216.360914
-186886.158365     8247223.630211
-186902.344279     8247228.887318
-186917.874315     8247236.012933
-186940.256431     8247245.121543
-186961.972159     8247256.724818
-186985.595154     8247266.478796
-187008.501537     8247281.856353
-187027.623380     8247299.054389
-187047.310370     8247320.017488
-187068.218371     8247342.877905
-187088.087202     8247352.574254
-187107.976663     8247361.018663
-187126.039850     8247366.304588
-187135.867969     8247377.724998
-187149.369259     8247394.210818
-187161.629288     8247410.051265
-187171.467534     8247420.845511
-187182.496799     8247435.415191
-187198.348636     8247461.328060
-187218.671249     8247481.674978
-187244.665416     8247499.604447
-187260.729846     8247512.372845
-187282.303847     8247532.738973
-187298.277550     8247551.140558
-187310.486962     8247570.110677
-187321.485475     8247586.558078
-187340.093178     8247596.861005
-187365.593065     8247606.643794
-187388.550060     8247618.892060
-187410.235425     8247632.372680
-187426.310357     8247644.515302
-187444.241557     8247657.938293
-187465.825680     8247677.678640
-187483.080759     8247694.221702
-187495.401527     8247706.306694
-187509.548957     8247721.549795
-187529.982927     8247735.011588
-187549.842019     8247745.333724
-187570.992607     8247753.171555
-187604.616205     8247763.704986
-187640.066070     8247777.397283
-187671.176771     8247788.518076
-187704.204847     8247797.164554
-187742.843737     8247807.149036
-187778.394462     8247814.581601
-187817.164958     8247816.429011
-187863.413031     8247820.269401
-187909.589857     8247828.491403
-187948.228747     8247838.475885
-187998.735010     8247849.894413
-188031.208068     8247854.149666
-188064.317519     8247857.788369
-188098.102710     8247858.306995
-188141.273122     8247858.969691
-188175.684198     8247859.497925
-188214.999209     8247866.362337
-188263.679193     8247874.622764
-188294.769645     8247886.995503
-188334.669281     8247896.373401
-188379.020596     8247901.436930
-188411.412672     8247910.699201
-188443.845239     8247917.457962
-188486.248415     8247926.874291
-188521.102771     8247938.678872
-188554.040121     8247952.958537
-188591.870903     8247974.200155
-188633.990620     8248001.142573
-188664.353569     8248019.765043
-188689.197577     8248031.416339
-188717.149622     8248044.367220
-188743.850661     8248057.298898
-188762.478612     8248066.349879
-188778.684768     8248070.355423
-188795.517198     8248074.370199
-188817.898926     8248083.479185
-188849.655371     8248093.358017
-188881.421945     8248102.610685
-188909.394238     8248114.309621
-188939.899678     8248124.169249
-188981.636090     8248136.079856
-189019.578999     8248150.435977
-189051.890081     8248164.706029
-189083.545291     8248180.844205
-189120.831557     8248197.068823
-189137.572872     8248206.717162
-189147.411112     8248217.511790
-189162.001815     8248244.031618
-189170.578164     8248255.432813
-189190.245287     8248277.647862
-189211.244403     8248294.874717
-189240.406964     8248310.348310
-189259.498438     8248329.424074
-189279.317414     8248342.250107
-189294.715844     8248357.512793
-189308.216758     8248373.998225
-189323.080800     8248383.617747
-189338.539968     8248395.124980
-189360.911575     8248404.859747
-189379.519278     8248415.162674
-189395.634326     8248424.801399
-189415.524162     8248433.246196
-189434.233101     8248437.289778
-189457.311205     8248442.026367
-189474.829876     8248442.295290
-189492.953033     8248443.826132
-END
-LINE3D-MASTER
-HEIGHT 1050.000000
-189507.989182     8248442.804309
-189526.102981     8248444.960944
-189544.186417     8248448.994924
-189567.122788     8248462.494748
-189603.158048     8248478.700161
-189629.757087     8248497.891171
-189653.945228     8248511.410211
-189686.852208     8248527.567603
-189730.263422     8248552.025716
-189762.584632     8248565.669604
-189776.217909     8248574.018358
-189790.526556     8248579.246266
-189810.446768     8248585.812954
-189832.788000     8248597.425831
-189865.653719     8248616.087103
-189894.110553     8248636.558505
-189913.837651     8248655.018089
-189934.786156     8248675.374234
-189957.621279     8248695.134166
-189989.761036     8248720.044428
-190012.928088     8248757.965451
-190035.591879     8248788.365975
-190057.003899     8248818.747285
-190079.142671     8248842.878087
-190106.398341     8248860.201366
-190128.073585     8248874.307768
-190149.102307     8248889.656883
-190176.378231     8248905.727834
-190208.053695     8248920.613684
-190237.257511     8248933.583780
-190258.942863     8248947.065164
-190281.243610     8248961.181168
-190307.853534     8248979.746408
-190340.709133     8248999.033461
-190372.333979     8249017.048982
-190397.804254     8249028.709892
-190424.534905     8249039.763449
-190454.424962     8249048.987693
-190487.391917     8249061.389619
-190513.477574     8249073.685913
-190541.429619     8249086.636794
-190565.638003     8249098.904270
-190599.876983     8249110.073085
-190624.680506     8249124.227508
-190648.756514     8249144.632426
-190675.406935     8249160.693775
-190699.564701     8249176.090924
-190731.825172     8249193.490266
-190760.927751     8249212.719707
-190791.896719     8249232.603735
-190827.062743     8249263.822115
-190870.382855     8249293.913028
-190900.746562     8249312.535891
-190923.006812     8249329.155785
-190947.820444     8249342.685191
-190975.802865     8249353.757963
-190996.216969     8249368.471706
-191018.487340     8249384.465819
-191041.403469     8249399.217206
-191061.847948     8249412.052841
-191089.870854     8249420.622486
-191110.385442     8249429.076109
-191134.684940     8249435.710022
-191156.461407     8249443.557843
-191183.919560     8249448.361669
-191205.766900     8249451.827490
-191226.353112     8249455.899889
-191240.681989     8249459.876998
-191259.996188     8249465.181745
-191279.250401     8249474.242722
-191299.139473     8249482.687507
-191313.952897     8249495.436701
-191339.926433     8249514.618109
-191362.691472     8249538.758525
-191383.033952     8249557.853493
-191402.822552     8249572.557635
-191418.251358     8249585.942212
-191436.848940     8249596.870920
-191460.380438     8249612.258455
-191485.758835     8249629.552916
-191508.604855     8249648.686315
-191523.962800     8249666.452128
-191538.766102     8249679.827104
-191555.456035     8249692.605103
-191574.577872     8249709.803522
-191597.413771     8249729.562703
-191616.454627     8249751.768139
-191626.756389     8249772.587549
-191632.709241     8249791.461626
-191636.896953     8249803.421007
-191641.668895     8249817.894632
-191642.091926     8249830.422923
-191643.100728     8249845.464719
-191643.483263     8249860.496901
-191643.209931     8249877.396826
-191642.865727     8249898.678751
-191642.572141     8249916.831003
-191642.207694     8249939.364491
-191645.576789     8249963.207166
-191650.086284     8249993.954947
-191652.688130     8250026.552019
-191656.733345     8250047.274623
-191662.040439     8250067.391425
-191671.101329     8250087.565086
-191675.227525     8250103.280673
-191682.533383     8250115.914621
-191689.061120     8250137.927972
-191704.801600     8250170.725967
-191718.242527     8250190.967629
-191728.635404     8250206.153477
-191739.654560     8250221.348174
-191751.308565     8250235.927444
-191766.010631     8250255.561764
-191783.749862     8250280.877669
-191791.721720     8250291.017328
-191807.836768     8250300.656053
-191822.165645     8250304.633162
-191844.538015     8250314.367942
-191862.661184     8250315.898019
-191875.164181     8250316.715886
-191890.815701     8250316.330211
-191908.405232     8250312.217899
-191929.758680     8250307.536665
-191966.915501     8250293.080738
-191985.251262     8250281.466344
-192003.486539     8250276.112071
-192022.337211     8250271.392418
-192039.876124     8250270.409778
-192054.286007     8250269.378342
-192069.937526     8250268.992667
-192093.722878     8250268.731851
-192113.763817     8250267.786856
-192135.036271     8250268.113403
-192160.698132     8250267.881393
-192195.735475     8250268.419241
-192232.648564     8250268.985883
-192262.054851     8250269.437290
-192286.516324     8250266.056404
-192306.547129     8250265.737954
-192325.962564     8250264.783356
-192345.984012     8250265.090700
-192366.630200     8250265.407633
-192389.779927     8250265.762998
-192417.328419     8250264.934012
-192455.575035     8250260.512100
-192489.986111     8250261.040334
-192502.499230     8250261.232419
-192516.293718     8250259.566363
-192530.744849     8250256.031812
-192561.462130     8250252.746193
-192599.072345     8250248.941213
-192622.918436     8250244.924944
-192638.015325     8250240.147667
-192651.234940     8250235.341572
-192670.075478     8250231.248465
-192704.547293     8250228.021245
-192737.707363     8250228.530275
-192765.235612     8250228.952853
-192794.026517     8250228.768877
-192831.010478     8250224.953519
-192862.374256     8250220.426714
-192880.599424     8250215.697459
-192898.188956     8250211.585147
-192917.725869     8250203.119641
-192943.448482     8250199.131413
-192971.098973     8250192.043095
-192994.409912     8250182.383649
-193015.158099     8250176.441250
-193045.200010     8250176.276477
-193085.312251     8250172.509141
-193112.932379     8250167.298167
-193131.783038     8250162.579278
-193153.126365     8250158.523825
-193177.527099     8250158.898393
-193205.681615     8250159.330585
-193233.836132     8250159.762776
-193251.283167     8250164.413688
-193271.162883     8250173.484267
-193295.391521     8250184.499416
-193319.599140     8250196.766880
-193348.752338     8250212.866649
-193381.022930     8250229.640209
-193411.376515     8250248.888854
-193437.329809     8250269.321826
-193467.723880     8250286.067344
-193486.754614     8250308.898562
-193499.014643     8250324.739009
-193512.607436     8250335.590890
-193525.503089     8250350.815157
-193545.876709     8250368.032027
-193567.592437     8250379.635302
-193584.262128     8250393.664865
-193605.281492     8250409.639774
-193621.789196     8250433.684900
-193637.167384     8250450.199150
-193650.780418     8250459.799467
-193664.301575     8250475.033337
-193684.725812     8250489.120534
-193699.508096     8250503.747826
-193711.223616     8250514.570889
-193715.411315     8250526.531034
-193726.913466     8250550.499321
-193732.673967     8250581.266305
-193738.011449     8250599.504234
-193738.414226     8250613.284853
-193737.414156     8250636.434521
-193735.636716     8250668.964368
-193730.317334     8250688.291345
-193724.220596     8250716.997737
-193719.436367     8250741.967891
-193709.737700     8250761.227643
-193705.730827     8250776.818381
-193699.211058     8250792.996482
-193693.891664     8250812.324223
-193689.915167     8250826.036853
-193688.340211     8250846.047246
-193683.707072     8250861.628371
-193682.858843     8250875.389786
-193683.170517     8250894.803204
-193696.176138     8250941.959590
-193707.042664     8250966.544056
-193716.789796     8250982.971866
-193728.434443     8250998.176929
-193743.822751     8251014.065397
-193753.519265     8251033.622879
-193757.625983     8251050.590040
-193759.926288     8251063.147149
-193768.391274     8251081.433852
-193769.853483     8251107.125830
-193770.256260     8251120.906448
-193753.624912     8251143.190228
-193738.102838     8251174.256447
-193724.105866     8251188.441957
-193705.890831     8251192.544667
-193687.604924     8251201.029376
-193663.082712     8251208.165716
-193649.176854     8251216.717662
-193629.629820     8251225.808950
-193619.447382     8251236.295864
-193608.063779     8251243.634655
-193598.970373     8251264.155572
-193592.470845     8251279.082110
-193587.868833     8251292.785901
-193585.031986     8251313.402861
-193580.984617     8251331.497490
-193579.489878     8251346.500855
-193575.462764     8251363.343157
-193566.379466     8251383.239056
-193551.111246     8251398.656925
-193529.494599     8251419.611539
-193514.668889     8251446.306124
-193500.621299     8251463.621306
-193485.947454     8251480.926110
-193470.648094     8251498.222076
-193444.621786     8251520.987574
-193410.421149     8251546.132102
-193384.364466     8251570.775708
-193361.638534     8251582.948647
-193340.697996     8251600.783954
-193317.880949     8251618.590456
-193293.812896     8251636.377753
-193287.857891     8251656.320910
-193278.936580     8251666.201247
-193269.853282     8251686.097146
-193261.406385     8251705.376114
-193244.774274     8251727.659882
-193235.641122     8251750.685466
-193222.127169     8251773.643037
-193216.193169     8251792.334642
-193218.946881     8251815.541933
-193210.600444     8251828.562308
-193198.459739     8251844.028186
-193172.494170     8251863.038230
-193147.103487     8251885.187548
-193122.994173     8251905.478724
-193105.747443     8251927.127121
-193091.618872     8251949.449320
-193075.694021     8251966.734920
-193058.659120     8251975.238833
-193041.584486     8251986.246649
-193026.426859     8251994.779380
-193010.058722     8252000.789016
-193000.511908     8252010.659751
-192987.846936     8252019.856683
-192969.520544     8252030.844519
-192951.718407     8252048.102066
-192928.326475     8252062.769294
-192903.733391     8252074.287633
-192875.951288     8252089.513405
-192846.242057     8252107.840044
-192821.466756     8252130.624745
-192795.531551     8252147.757444
-192768.960733     8252165.505558
-192754.276755     8252183.436908
-192736.545491     8252196.312455
-192718.088239     8252215.438521
-192697.742842     8252235.160775
-192665.601695     8252249.067758
-192637.123229     8252268.665164
-192609.662922     8252302.678572
-192576.774794     8252324.086862
-192548.357066     8252339.928814
-192530.071159     8252348.413524
-192510.341895     8252368.771937
-192483.791320     8252385.268488
-192469.249075     8252394.436602
-192457.875606     8252401.148847
-192447.723531     8252409.758417
-192436.834596     8252425.243511
-192426.692643     8252433.227299
-192415.268556     8252443.069216
-192398.778941     8252456.589761
-192380.351301     8252473.837706
-192369.411748     8252492.452472
-192355.454509     8252504.134079
-192340.043804     8252528.314408
-192325.965839     8252547.507699
-192301.836283     8252569.050439
-192273.388192     8252586.769735
-192251.227012     8252602.708494
-192232.901384     8252613.696342
-192216.976520     8252630.982706
-192193.583825     8252645.649922
-192179.011979     8252656.695393
-192158.808302     8252667.655176
-192138.615522     8252677.988425
-192119.108984     8252684.575821
-192105.908847     8252688.130341
-192084.333450     8252706.581839
-192074.746139     8252718.956465
-192057.640378     8252731.841614
-192045.570546     8252742.925493
-192029.736797     8252754.578294
-192021.381002     8252768.224462
-192017.424748     8252780.685529
-192008.412323     8252796.199428
-192002.507935     8252813.012913
-191998.470687     8252830.481760
-191998.247973     8252844.252013
-191997.974641     8252861.151938
-191992.009502     8252881.721641
-191991.776655     8252896.118439
-191987.194897     8252908.569903
-191977.435491     8252931.585109
-191965.839296     8252952.068371
-191956.907864     8252962.574490
-191946.543197     8252984.328530
-191935.553026     8253006.072969
-191929.425912     8253036.657470
-191927.789454     8253060.423306
-191923.025467     8253084.141896
-191913.840946     8253110.296377
-191912.144499     8253137.818442
-191901.607724     8253170.213827
-191897.357132     8253200.826370
-191892.008138     8253222.031468
-191887.829158     8253248.263551
-191881.661560     8253281.351179
-191879.944107     8253310.124796
-191874.040471     8253326.939056
-191873.777260     8253343.213200
-191872.918146     8253357.600384
-191866.297141     8253380.037830
-191852.138194     8253404.238138
-191837.059406     8253446.580321
-191831.044413     8253470.279708
-191825.089407     8253490.222864
-191824.684464     8253515.260243
-191828.496832     8253550.379646
-191836.114352     8253582.427775
-191840.805313     8253601.908418
-191853.004603     8253621.504319
-191867.040669     8253643.632928
-191880.339112     8253672.637050
-191893.215287     8253689.112892
-191909.895086     8253702.517437
-191933.427361     8253717.904220
-191960.046642     8253735.843666
-191988.492579     8253756.941603
-192014.557994     8253770.489460
-192033.216315     8253777.662714
-192053.105387     8253786.107499
-192073.580243     8253797.065025
-192095.891111     8253810.555247
-192118.120985     8253829.053250
-192142.268629     8253845.076180
-192160.795339     8253860.386888
-192175.548023     8253876.891536
-192186.515785     8253895.216658
-192199.199610     8253923.585408
-192208.835384     8253946.898344
-192221.710796     8253963.374174
-192233.899952     8253983.596621
-192247.966394     8254003.847121
-192267.410027     8254039.833175
-192285.582424     8254077.050826
-192302.584783     8254109.243019
-192312.210436     8254133.181736
-192315.065372     8254150.130446
-192314.680683     8254173.915498
-192318.059886     8254197.133155
-192318.412058     8254214.042682
-192319.360120     8254232.839931
-192324.524731     8254261.719193
-192327.793340     8254291.821988
-192327.520009     8254308.721913
-192315.640361     8254346.730882
-192308.786508     8254383.565126
-192304.658145     8254406.667536
-192298.723382     8254425.359130
-192286.532059     8254443.954681
-192269.325826     8254463.099186
-192252.189689     8254477.862444
-192239.534851     8254486.432831
-192219.281319     8254500.522297
-192194.546502     8254520.803872
-192171.033092     8254542.982007
-192145.067523     8254561.992051
-192112.279867     8254577.140984
-192083.841886     8254594.235264
-192061.024851     8254612.041001
-192036.935780     8254631.080614
-192010.889230     8254655.097675
-191984.893285     8254675.985828
-191967.121524     8254691.365266
-191954.365437     8254706.195761
-191941.599229     8254721.652037
-191925.028621     8254740.180363
-191909.688776     8254759.979456
-191894.954932     8254781.041254
-191878.333705     8254802.699252
-191862.459484     8254816.854416
-191851.005009     8254828.575206
-191842.709214     8254838.464381
-191834.383783     8254850.233204
-191823.494084     8254865.718287
-191817.590460     8254882.531783
-191812.372302     8254895.600179
-191805.903163     8254908.647844
-191795.589113     8254927.272212
-191785.325682     8254942.766908
-191772.498722     8254961.979403
-191761.629266     8254976.212922
-191750.790949     8254988.568343
-191726.116883     8255005.093700
-191714.713051     8255013.683290
-191700.120951     8255025.981089
-191685.517955     8255038.905421
-191673.468377     8255048.736972
-191649.995439     8255068.412745
-191621.466355     8255091.139823
-191600.525830     8255108.974367
-191589.758373     8255116.948553
-191577.063025     8255128.023594
-191560.522792     8255144.673810
-191542.014159     8255166.929537
-191525.514435     8255181.075099
-191515.362348     8255189.685432
-191496.349714     8255204.419121
-191482.422838     8255214.223383
-191467.184229     8255227.763131
-191453.126530     8255245.703330
-191445.910385     8255266.253829
-191445.657295     8255281.902191
-191444.748327     8255299.419060
-191443.223225     8255316.299769
-191442.899276     8255336.329366
-191443.241314     8255353.865439
-191444.209619     8255371.411125
-191443.743924     8255400.204722
-191437.647198     8255428.910350
-191429.209658     8255447.563525
-191422.770870     8255458.734608
-191411.347534     8255468.577301
-191388.540633     8255485.756493
-191361.979161     8255502.879578
-191331.583676     8255524.952833
-191310.653260     8255542.162358
-191294.143402     8255556.934466
-191280.125424     8255572.371527
-191274.242042     8255587.933460
-191273.352553     8255604.198754
-191273.089354     8255620.472133
-191272.755271     8255641.128276
-191272.400946     8255663.035983
-191272.036487     8255685.570235
-191271.773289     8255701.843614
-191271.459448     8255721.248194
-191271.165874     8255739.399682
-191269.651645     8255755.655386
-191264.826931     8255783.128666
-191258.286907     8255800.559095
-191251.110507     8255818.604927
-191239.606178     8255833.455401
-191224.499180     8255838.857696
-191206.899515     8255843.596553
-191194.921562     8255849.046881
-191170.964101     8255859.949040
-191146.391272     8255870.215052
-191128.226830     8255871.189618
-191110.678571     8255872.797287
-191085.591583     8255876.169334
-191059.939843     8255875.775562
-191041.805802     8255874.870491
-191028.101640     8255870.904500
-191010.593865     8255870.009042
-190982.459591     8255868.325287
-190952.549279     8255860.353370
-190934.516474     8255853.188954
-190914.052516     8255841.604894
-190894.132303     8255835.038206
-190874.757365     8255833.488913
-190852.930267     8255828.771529
-190828.529533     8255828.396960
-190807.267976     8255827.443879
-190791.626578     8255827.203773
-190775.358913     8255826.954053
-190752.189682     8255827.851791
-190716.456740     8255831.685589
-190688.241497     8255835.008087
-190670.097322     8255834.729562
-190651.953147     8255834.451036
-190629.439795     8255833.480267
-190601.295412     8255832.421530
-190578.792194     8255830.824216
-190560.103510     8255825.528307
-190541.333832     8255825.240179
-190516.307595     8255824.856009
-190490.655091     8255824.462225
-190456.799422     8255828.324840
-190432.327803     8255832.333035
-190406.544476     8255840.075189
-190378.248214     8255848.406997
-190346.258157     8255852.924952
-190316.771665     8255857.479809
-190294.106460     8255865.898058
-190276.405559     8255876.896260
-190262.469338     8255887.325551
-190246.655844     8255897.726025
-190225.231536     8255906.788495
-190200.699191     8255914.551381
-190185.561818     8255921.831784
-190172.311827     8255928.515988
-190158.365497     8255939.570297
-190144.448755     8255948.748013
-190132.480910     8255953.573323
-190113.539136     8255963.925775
-190092.699822     8255975.502502
-190077.613067     8255979.653233
-190064.423828     8255982.581218
-190044.372768     8255984.151996
-190033.624814     8255990.873079
-190017.983416     8255990.632972
-190002.937145     8255992.280577
-189986.034607     8255992.647812
-189972.895986     8255992.446125
-189959.100721     8255994.112934
-189940.694112     8256010.107799
-189944.063194     8256033.951238
-189954.435816     8256050.389413
-189966.212087     8256057.456258
-189978.634079     8256063.282671
-189988.512834     8256071.572262
-189998.340947     8256082.993054
-190006.796575     8256101.905550
-190010.347886     8256114.481862
-190014.282484     8256142.091133
-190013.826923     8256170.258184
-190009.224159     8256183.961200
-190008.981203     8256198.983016
-190008.092477     8256215.248321
-190003.510720     8256227.699786
-189997.444345     8256254.528833
-189997.090019     8256276.436539
-189996.120324     8256297.708098
-189995.867235     8256313.356460
-189991.163236     8256333.318820
-189990.930388     8256347.715619
-189986.822280     8256369.565702
-189987.042840     8256394.612683
-190002.178060     8256426.149513
-190013.812585     8256441.980358
-190028.534907     8256460.362351
-190038.836669     8256481.181762
-190046.504807     8256510.100218
-190050.550010     8256530.823587
-190055.201237     8256552.808132
-190059.811981     8256577.295804
-190059.589267     8256591.066056
-190064.087877     8256622.439607
-190067.870621     8256659.437894
-190067.485945     8256683.222182
-190067.232855     8256698.870543
-190066.929148     8256717.648578
-190062.921512     8256733.239304
-190053.182348     8256755.002947
-190040.213668     8256782.977913
-190033.704019     8256798.530232
-190029.101995     8256812.234788
-190028.838796     8256828.508167
-190029.190968     8256845.417694
-190028.856885     8256866.073837
-190028.462051     8256890.486199
-190026.947846     8256906.740374
-190026.069253     8256922.379134
-190028.995061     8256934.945845
-190036.956034     8256945.711273
-190046.834765     8256954.002393
-190062.879716     8256968.022366
-190080.185019     8256981.436513
-190089.407871     8256991.596139
-END
-LINE3D
-HEIGHT 1060.000000
-183577.345605     8247000.662898
-183725.729241     8247151.324068
-183765.852361     8247146.931343
-183777.830900     8247141.480260
-183793.614025     8247132.957514
-183813.867747     8247118.868050
-183842.951665     8247100.531812
-183880.169034     8247082.320428
-183901.654081     8247069.502504
-183925.692140     8247053.593322
-183956.118371     8247029.642728
-183985.232658     8247009.428763
-184011.813991     8246991.054109
-184028.929306     8246977.542787
-184041.624648     8246966.468128
-184056.883511     8246951.676053
-184069.538356     8246943.105285
-184081.567513     8246934.524530
-184094.858180     8246925.337202
-184111.963368     8246912.452045
-184130.380689     8246895.830260
-184144.388164     8246881.018975
-184158.405761     8246865.581908
-184171.756975     8246852.639124
-184183.241616     8246839.041368
-184196.623397     8246824.220478
-184213.143388     8246808.821824
-184239.068651     8246792.315674
-184262.430596     8246779.526180
-184280.696063     8246772.293413
-184300.101556     8246771.965364
-184324.623584     8246764.828639
-184351.536833     8246764.615839
-184379.065847     8246765.038429
-184402.295989     8246760.386385
-184425.556698     8246753.856236
-184446.899827     8246749.801162
-184465.205786     8246740.064886
-184479.112025     8246731.512946
-184493.028195     8246722.335221
-184511.959847     8246712.608550
-184532.203633     8246699.145252
-184551.821725     8246685.672350
-184569.522238     8246674.674524
-184585.991802     8246662.405546
-184606.810473     8246652.081523
-184633.280443     8246640.592377
-184655.945827     8246632.174896
-184677.924771     8246627.503645
-184697.955768     8246627.185198
-184724.919832     8246623.842347
-184755.698419     8246616.801665
-184779.544128     8246612.785390
-184804.106843     8246603.144778
-184833.644162     8246595.459104
-184866.360570     8246584.691783
-184892.184603     8246574.444595
-184909.864867     8246564.698715
-184925.002055     8246557.417926
-184942.087192     8246545.784335
-184958.526387     8246535.393084
-184977.377052     8246530.673812
-184997.468793     8246526.599529
-185019.366751     8246526.935678
-185039.448365     8246523.487558
-185053.828635     8246524.334242
-185065.574136     8246533.279955
-185080.972566     8246548.542642
-185098.944645     8246559.461748
-185118.147475     8246571.652385
-185142.315368     8246586.423370
-185160.226320     8246601.098306
-185183.778831     8246615.233908
-185209.126864     8246634.405714
-185238.803946     8246656.774424
-185266.594011     8246679.740485
-185286.301248     8246699.451638
-185303.627187     8246711.613464
-185322.234890     8246721.916391
-185339.601326     8246731.574326
-185358.824787     8246742.513024
-185385.464705     8246759.200149
-185405.848057     8246775.791614
-185419.369602     8246791.025107
-185432.245007     8246807.501319
-185451.377359     8246824.073198
-185476.735513     8246842.619223
-185510.792264     8246865.055163
-185535.545169     8246882.339259
-185556.019636     8246893.297160
-185576.504606     8246903.629286
-185601.903257     8246919.671420
-185634.749117     8246939.584260
-185653.316323     8246952.391078
-185671.278274     8246963.936347
-185687.978710     8246976.088571
-185712.186718     8246988.355660
-185741.954909     8247005.091188
-185769.825967     8247023.049468
-185792.106841     8247038.417805
-185810.017793     8247053.092742
-185831.057406     8247067.815705
-185850.916497     8247078.137841
-185873.934231     8247086.630654
-185888.172388     8247096.240568
-185902.400423     8247106.476263
-185918.464853     8247119.244661
-185931.431754     8247130.087316
-185943.803146     8247139.042255
-185958.021054     8247149.904114
-185974.085484     8247162.672511
-185995.145339     8247176.143912
-186013.117418     8247187.063018
-186029.252708     8247195.450180
-186046.710258     8247199.474552
-186070.353502     8247207.976584
-186097.176025     8247213.396971
-186127.772191     8247217.623412
-186148.347894     8247222.321969
-186166.411081     8247227.607895
-186180.730225     8247232.210409
-186203.183207     8247236.937402
-186218.773988     8247240.307180
-186235.646144     8247241.818436
-186256.847732     8247246.526601
-186275.506053     8247253.699855
-186291.036088     8247260.825470
-186303.478340     8247265.399172
-186315.264720     8247271.841000
-186334.589040     8247276.519966
-186353.318221     8247279.311984
-186386.396922     8247284.828408
-186388.687099     8247298.011680
-186384.619106     8247317.357867
-186383.165628     8247329.857353
-186392.358117     8247341.894324
-186407.434375     8247338.368987
-186422.531257     8247333.592092
-186441.462910     8247323.865421
-186462.896963     8247314.176782
-186479.860616     8247310.054480
-186494.917002     8247307.781476
-186509.387999     8247302.994973
-186534.515472     8247297.119799
-186547.664221     8247296.695322
-186565.263880     8247291.956847
-186580.854660     8247295.326626
-186598.816230     8247306.871890
-186628.533803     8247326.737090
-186647.757270     8247337.675406
-186673.166042     8247353.091759
-186692.964388     8247367.169731
-186710.270085     8247380.583120
-186722.046337     8247387.651112
-186745.568096     8247403.664434
-186762.268539     8247415.816276
-186782.692388     8247429.903850
-186795.638659     8247441.998445
-186817.929660     8247456.740618
-186836.557612     8247465.791599
-186858.888722     8247478.030258
-186881.189845     8247492.146649
-186899.777299     8247503.701521
-186916.477353     8247515.853739
-186930.705770     8247526.089440
-186946.800570     8247536.980111
-186965.993279     8247549.796530
-186990.715809     8247568.958734
-187011.079301     8247586.801768
-187033.339551     8247603.421663
-187051.856139     8247619.358152
-187076.538172     8247641.024247
-187110.503808     8247669.093751
-187139.535146     8247692.704422
-187164.227300     8247713.744735
-187185.892416     8247728.477301
-187208.203284     8247741.967523
-187228.082617     8247751.038095
-187247.982199     8247758.856723
-187266.589902     8247769.159649
-187290.727044     8247785.808355
-187310.505141     8247801.138273
-187325.379304     8247810.132013
-187347.700293     8247822.996453
-187378.608522     8247846.635936
-187405.793331     8247868.340450
-187426.761696     8247887.445025
-187444.713520     8247899.616459
-187465.157618     8247912.452088
-187495.501083     8247932.326514
-187516.459326     8247952.056871
-187529.314865     8247969.785035
-187539.778996     8247980.588889
-187557.054317     8247995.880387
-187573.179486     8248004.893331
-187603.119786     8248010.987515
-187617.510178     8248011.208418
-187641.315396     8248009.695651
-187654.454018     8248009.897338
-187673.667357     8248021.461818
-187689.197392     8248028.587433
-187708.430599     8248038.899961
-187728.935435     8248047.980136
-187746.403107     8248051.378726
-187773.871381     8248055.556770
-187790.743919     8248057.068031
-187807.565840     8248061.708965
-187828.060555     8248071.414921
-187859.705644     8248088.178880
-187875.810952     8248098.443393
-187890.715102     8248105.559400
-187903.793367     8248109.516547
-187916.851001     8248114.725633
-187932.381036     8248121.851248
-187947.900950     8248129.602644
-187960.978833     8248133.559785
-187972.139710     8248139.992011
-187985.136599     8248148.956934
-187993.744081     8248158.480413
-188001.644690     8248173.001683
-188003.934492     8248186.184568
-188003.651033     8248203.710657
-188002.762313     8248219.975580
-187993.729640     8248236.741425
-187984.132208     8248249.741833
-187968.217472     8248266.402033
-187959.225677     8248280.663994
-187946.520208     8248292.364816
-187934.308643     8248312.211930
-187928.475497     8248324.644185
-187927.647141     8248337.153267
-187926.748294     8248354.044354
-187933.972788     8248371.685313
-187948.917429     8248376.297811
-187968.393985     8248371.587765
-187982.915607     8248363.671208
-187995.610942     8248352.596931
-188004.673604     8248333.953353
-188009.932246     8248318.381830
-188017.763767     8248298.467097
-188024.232925     8248285.418287
-188029.461192     8248271.724873
-188036.565975     8248258.059883
-188044.962642     8248241.910211
-188055.175838     8248229.545194
-188068.213223     8248236.006225
-188087.486920     8248243.815245
-188103.077701     8248247.185024
-188120.606493     8248246.828166
-188135.713121     8248241.425102
-188152.071513     8248236.041635
-188178.903781     8248240.835852
-188193.212797     8248246.064530
-188206.906062     8248250.657055
-188220.670951     8248250.868356
-188238.188858     8248251.137268
-188252.579250     8248251.358171
-188273.851705     8248251.684718
-188292.621382     8248251.972845
-188308.878156     8248252.848717
-188328.222720     8248256.276119
-188355.751733     8248256.698709
-188380.767849     8248257.708661
-188405.077468     8248263.716792
-188433.746131     8248271.043712
-188462.465406     8248275.241342
-188491.164438     8248280.690535
-188511.074529     8248287.883004
-188532.286239     8248291.965387
-188554.103209     8248297.308936
-188577.816937     8248301.429345
-188612.207764     8248303.209524
-188644.095815     8248304.951284
-188671.564090     8248309.129328
-188697.084225     8248317.660172
-188721.393844     8248323.668303
-188753.150290     8248333.547135
-188782.343984     8248347.143013
-188805.310718     8248358.765492
-188821.476384     8248365.274545
-188837.612450     8248373.660955
-188855.604007     8248383.328486
-188880.377155     8248399.361018
-188906.956703     8248419.804367
-188939.640969     8248449.732012
-188970.498568     8248476.501931
-188989.005035     8248493.064202
-189009.438630     8248506.525607
-189034.887899     8248519.438068
-189059.671167     8248534.844819
-189089.490365     8248548.450299
-189120.580811     8248560.823420
-189142.891678     8248574.313642
-189170.208099     8248587.880702
-189198.069030     8248606.465146
-189235.324920     8248624.567872
-189259.533316     8248636.834585
-189285.043324     8248645.991592
-189309.917707     8248655.764779
-189349.172361     8248666.384651
-189382.129195     8248679.412359
-189414.491654     8248690.553132
-189444.350584     8248701.654710
-189482.989856     8248711.639198
-189507.803500     8248725.167839
-189530.114356     8248738.658825
-189551.153975     8248753.381407
-189568.580768     8248759.283882
-189587.188471     8248769.586808
-189613.314625     8248779.379211
-189629.449915     8248787.766373
-189648.077860     8248796.817736
-189661.074762     8248805.781895
-189680.862598     8248820.486025
-189699.470301     8248830.788951
-189720.601023     8248839.878734
-189742.911891     8248853.368956
-189765.727536     8248874.380463
-189784.829130     8248892.830445
-189800.934057     8248903.094952
-189829.491363     8248917.306999
-189864.255362     8248934.745535
-189885.334714     8248946.964215
-189901.420150     8248958.481061
-189920.007598     8248970.036314
-189944.205097     8248982.929561
-189967.798111     8248994.560889
-189985.820795     8249002.351087
-190003.802995     8249012.644411
-190023.015959     8249024.208503
-190040.392134     8249033.240651
-190063.400129     8249042.359251
-190083.309456     8249049.551708
-190109.465973     8249057.466766
-190123.774620     8249062.694675
-190135.591363     8249067.259158
-190148.023500     8249072.458260
-190162.332898     8249077.686944
-190177.277169     8249082.298673
-190194.724968     8249086.949596
-190208.408112     8249092.167902
-190230.164337     8249101.267287
-190247.510912     8249112.176791
-190260.477426     8249123.019823
-190272.818449     8249133.852488
-190290.124527     8249147.265883
-190301.900773     8249154.334257
-190316.077809     8249167.699619
-190340.820593     8249185.609496
-190362.424964     8249204.097897
-190372.919841     8249213.024412
-190402.173510     8249222.864824
-190428.359639     8249228.901762
-190455.797538     8249234.957914
-190484.456080     8249242.910616
-190501.207515     8249251.933173
-190518.573569     8249261.591102
-190536.586145     8249270.006318
-190560.875509     8249277.266777
-190588.323542     8249282.696384
-190611.946155     8249292.450355
-190634.984526     8249299.690846
-190653.642834     8249306.864864
-190674.733071     8249318.457774
-190702.028474     8249333.277150
-190743.038923     8249351.436747
-190769.567090     8249375.009757
-190788.628200     8249395.962866
-190812.796087     8249410.734232
-190843.210412     8249426.227423
-190861.797873     8249437.781913
-190877.933163     8249446.169075
-190890.324803     8249453.872068
-190903.937838     8249463.472386
-190921.919262     8249473.766463
-190939.860965     8249486.563678
-190969.054659     8249500.159556
-190993.080062     8249523.693383
-191019.781100     8249536.625060
-191044.533993     8249553.909919
-191076.804586     8249570.683480
-191105.886923     8249591.164484
-191132.516325     8249608.478149
-191154.090333     8249628.843896
-191179.408754     8249649.893823
-191199.206725     8249663.971407
-191219.722064     8249672.425806
-191235.191366     8249683.306493
-191253.162681     8249694.225587
-191270.489002     8249706.387419
-191282.799649     8249719.098193
-191296.209449     8249741.217189
-191315.170075     8249768.430418
-191332.272918     8249794.362491
-191347.055966     8249808.989794
-191359.860517     8249829.846860
-191367.700763     8249848.123972
-191371.130597     8249868.211193
-191375.670455     8249897.081628
-191383.277103     8249929.754764
-191390.339992     8249957.411291
-191393.871061     8249971.239167
-191395.433742     8249990.671789
-191403.494549     8250033.995882
-191410.537196     8250062.903973
-191413.392131     8250079.852683
-191413.734182     8250097.387992
-191413.995226     8250119.931846
-191417.959448     8250145.662231
-191422.570179     8250170.150667
-191428.411674     8250195.909870
-191437.239716     8250230.480330
-191446.834994     8250256.297156
-191453.948501     8250280.824011
-191459.962092     8250295.942634
-191468.305600     8250321.740245
-191476.680247     8250345.659758
-191483.248468     8250365.169982
-191486.760059     8250380.249433
-191490.240498     8250397.207746
-191493.700694     8250415.417621
-191495.839024     8250437.989529
-191496.241814     8250451.769384
-191495.292349     8250471.790143
-191489.367719     8250489.855191
-191480.980797     8250505.378692
-191475.753281     8250519.072882
-191470.545257     8250531.514733
-191468.466276     8250544.004617
-191470.705078     8250560.317168
-191484.973992     8250568.048978
-191501.744906     8250575.819961
-191516.750680     8250576.676247
-191540.363936     8250587.056012
-191549.536182     8250600.344547
-191544.963782     8250612.170218
-191528.010638     8250615.666362
-191513.549374     8250619.827459
-191503.830464     8250640.338774
-191503.506502     8250660.369135
-191514.576264     8250672.434924
-191528.885675     8250677.662844
-191543.153812     8250685.395407
-191562.982922     8250697.594894
-191580.440078     8250701.620024
-191597.877769     8250706.895966
-191612.257276     8250707.742638
-191629.755693     8250709.263890
-191642.248569     8250710.707538
-191660.896756     8250718.507338
-191681.543707     8250718.824283
-191700.434876     8250711.600739
-191716.873873     8250701.209867
-191728.357947     8250687.611719
-191737.309621     8250675.854038
-191749.419963     8250662.265504
-191759.572037     8250653.655934
-191777.807314     8250648.301661
-191797.273368     8250644.217391
-191817.244198     8250647.654407
-191830.382819     8250647.856094
-191849.223357     8250643.762986
-191863.704100     8250638.350314
-191880.164116     8250626.707126
-191894.140833     8250613.773944
-191905.534557     8250605.809372
-191913.264836     8250592.154365
-191924.780038     8250576.678885
-191934.932113     8250568.069315
-191951.209135     8250567.693242
-191957.898847     8250579.691794
-191958.816547     8250600.366389
-191958.583699     8250614.763187
-191962.659278     8250633.608446
-191967.472480     8250645.578193
-191979.843866     8250654.533514
-191995.647252     8250644.758057
-192003.519264     8250622.339815
-192008.131384     8250608.011006
-192009.616002     8250593.633423
-192013.572256     8250581.172357
-192018.143893     8250569.346674
-192025.824318     8250558.821352
-192038.712016     8250535.853404
-192048.329690     8250521.601433
-192065.444821     8250508.089727
-192083.145709     8250497.092288
-192102.107738     8250485.487508
-192115.347595     8250479.429851
-192131.675235     8250475.924105
-192156.075969     8250476.298673
-192182.979480     8250476.711661
-192214.262276     8250477.191874
-192245.545072     8250477.672087
-192271.196813     8250478.065859
-192294.416649     8250474.039212
-192318.202001     8250473.778397
-192344.570359     8250468.548208
-192366.549297     8250463.877340
-192390.385267     8250460.486852
-192411.102327     8250456.421786
-192439.893232     8250456.237810
-192472.447277     8250455.485663
-192499.996545     8250454.655925
-192526.960030     8250451.313447
-192556.437177     8250447.383619
-192592.180253     8250442.923275
-192621.041267     8250438.357287
-192645.522982     8250433.724839
-192680.004930     8250429.871073
-192718.230528     8250426.701476
-192743.266886     8250426.459865
-192766.527971     8250419.930103
-192794.834341     8250410.973278
-192819.880833     8250410.105121
-192846.168197     8250409.882713
-192868.066155     8250410.218862
-192891.195628     8250411.826554
-192911.145452     8250416.515121
-192938.654223     8250418.189274
-192967.988873     8250423.022669
-192989.200589     8250427.104670
-193003.520120     8250431.706809
-193021.582538     8250436.993104
-193037.769209     8250442.250606
-193050.826850     8250447.459310
-193068.284018     8250451.483676
-193085.075951     8250458.002343
-193098.647725     8250470.106540
-193110.968493     8250482.191532
-193125.166535     8250494.305343
-193136.184915     8250509.500793
-193144.529186     8250535.298415
-193147.948898     8250556.011417
-193152.731725     8250569.859273
-193153.770139     8250583.022948
-193157.947717     8250595.608874
-193164.505830     8250615.744116
-193170.377688     8250639.625974
-193173.303496     8250652.192684
-193178.539730     8250676.690722
-193183.261067     8250694.293256
-193186.772645     8250709.373471
-193190.949459     8250721.959386
-193198.254553     8250734.593321
-193202.391635     8250749.683138
-193209.524633     8250772.957654
-193210.573931     8250785.495559
-193210.875473     8250805.535523
-END
-LINE3D
-HEIGHT 1060.000000
-193209.926020     8250825.555518
-193210.802446     8250848.734756
-193193.525353     8250872.260497
-193183.311776     8250884.625509
-193171.303434     8250891.954710
-193157.457564     8250896.750426
-193138.586651     8250902.721643
-193117.223082     8250908.028659
-193093.387876     8250911.419158
-193068.361639     8250911.034988
-193052.720240     8250910.794882
-193038.329849     8250910.573979
-193019.560171     8250910.285851
-193011.860255     8250922.063513
-193018.479107     8250938.443301
-193027.610856     8250954.235726
-193031.797791     8250966.195859
-193039.759528     8250976.961299
-193055.591111     8251004.126496
-193059.132301     8251017.328590
-193070.161566     8251031.898270
-193085.147097     8251034.006119
-193097.105573     8251029.807367
-193107.883151     8251021.207399
-193126.189300     8251011.471126
-193141.729462     8251017.970577
-193148.267321     8251039.358146
-193151.687033     8251060.071149
-193152.110064     8251072.599440
-193141.150257     8251092.466534
-193130.342316     8251102.943847
-193107.625741     8251114.490992
-193091.903350     8251119.258667
-193064.314361     8251122.591543
-193047.360453     8251126.087675
-193025.320763     8251134.514761
-193013.362288     8251138.713513
-192991.938744     8251147.775995
-192978.698123     8251153.833641
-192967.940787     8251161.182045
-192957.173343     8251169.155467
-192948.867402     8251179.671952
-192939.300346     8251190.794250
-192927.270998     8251199.375002
-192913.919784     8251212.317786
-192904.302097     8251226.570521
-192904.038887     8251242.844664
-192904.996307     8251261.016120
-192908.538261     8251274.218226
-192913.955960     8251287.449126
-192919.989794     8251301.316186
-192936.731108     8251310.964525
-192953.684264     8251307.467617
-192975.754317     8251297.163186
-192992.829715     8251286.155381
-193005.423815     8251281.340449
-193018.007806     8251277.150535
-193025.978887     8251287.290946
-193030.034988     8251307.387780
-193034.120687     8251325.607258
-193016.934697     8251343.500200
-192997.437516     8251349.461803
-192979.788009     8251357.329581
-192965.911764     8251364.003406
-192961.259134     8251380.836870
-192961.661923     8251394.616725
-192969.562908     8251409.138383
-192976.807263     8251425.527773
-192985.273013     8251443.814488
-192988.763585     8251460.146254
-192993.424934     8251481.505018
-192993.161723     8251497.779161
-192987.034609     8251528.363662
-192972.885796     8251551.937425
-192961.985964     8251568.049053
-192950.582895     8251576.638655
-192922.286646     8251584.969698
-192906.523757     8251592.241264
-192881.859813     8251608.140839
-192866.671822     8251618.550915
-192844.611890     8251628.229565
-192825.649862     8251639.834345
-192805.487445     8251648.290248
-192785.212907     8251663.631267
-192760.538842     8251680.156624
-192749.741009     8251690.008919
-192737.580062     8251706.726361
-192727.347007     8251720.342947
-192719.626836     8251733.372936
-192710.685283     8251744.504836
-192703.560252     8251759.421772
-192690.702930     8251780.511612
-192673.354200     8251808.419341
-192653.080427     8251823.760371
-192640.405333     8251833.583084
-192623.370433     8251842.086998
-192606.214817     8251858.101831
-192579.078460     8251872.085642
-192551.882139     8251889.824154
-192521.062859     8251899.369106
-192499.547449     8251914.064375
-192477.426765     8251927.499243
-192463.470290     8251939.180861
-192448.292420     8251948.965156
-192436.746855     8251966.317981
-192420.832113     8251982.978564
-192407.339166     8252004.684583
-192398.266002     8252023.953937
-192392.947384     8252043.280926
-192382.027310     8252060.644117
-192371.743636     8252077.390376
-192355.828894     8252094.050959
-192342.406819     8252111.374979
-192325.291689     8252124.886685
-192311.283844     8252139.697200
-192287.891912     8252154.364428
-192268.233520     8252170.340841
-192251.814002     8252179.480138
-192239.108533     8252191.180961
-192226.311949     8252208.515347
-192214.868383     8252219.608839
-192200.265387     8252232.533172
-192188.175300     8252244.869378
-192178.618365     8252255.365894
-192165.439246     8252257.668098
-192151.029376     8252258.698770
-192136.618730     8252259.730195
-192114.639791     8252264.401063
-192098.312151     8252267.906809
-192083.265880     8252269.554414
-192068.875488     8252269.333511
-192055.111363     8252269.122222
-192037.270896     8252250.065662
-192031.328165     8252230.565804
-192024.033192     8252217.306086
-192008.976813     8252219.578708
-191998.662763     8252238.203077
-191996.522267     8252254.449167
-191983.604205     8252279.294460
-191976.458932     8252295.462959
-191966.932361     8252304.082131
-191958.596057     8252316.475960
-191946.587727     8252323.804397
-191932.711482     8252330.478222
-191913.719078     8252343.961111
-191897.280081     8252354.351983
-191880.942319     8252358.483511
-191869.548595     8252366.448083
-191858.629285     8252383.811286
-191853.935407     8252403.147865
-191853.006196     8252421.916297
-191867.839874     8252433.413164
-191885.984049     8252433.691690
-191909.758516     8252434.056644
-191927.277187     8252434.325568
-191939.810548     8252433.266090
-191966.734301     8252432.427515
-191982.244100     8252440.804311
-191990.769824     8252455.335559
-191977.307253     8252475.163470
-191961.655734     8252475.549145
-191946.710699     8252470.937405
-191943.904979     8252489.677031
-191937.949973     8252509.620188
-191924.083849     8252515.668232
-191907.816947     8252515.418524
-191890.894167     8252517.037322
-191877.755545     8252516.835635
-191859.943288     8252534.718964
-191850.305359     8252550.223262
-191842.009552     8252560.113200
-191830.646968     8252566.199676
-191813.118175     8252566.556533
-191799.959299     8252567.607174
-191778.626106     8252571.036081
-191756.041906     8252574.445784
-191738.835673     8252593.590289
-191724.121319     8252613.399748
-191713.604798     8252644.542806
-191709.567563     8252662.010889
-191704.752194     8252688.859140
-191696.244558     8252711.893562
-191691.560801     8252730.604359
-191681.297369     8252746.099055
-191673.415224     8252769.143842
-191658.065258     8252789.568717
-191646.469063     8252810.051979
-191634.944504     8252826.153253
-191627.737728     8252846.077194
-191611.126623     8252867.109410
-191605.696636     8252893.322289
-191599.741630     8252913.265446
-191599.539158     8252925.784136
-191593.381681     8252958.245982
-191589.293815     8252978.844502
-191588.990108     8252997.622536
-191588.635783     8253019.530242
-191588.058744     8253055.208201
-191588.319788     8253077.752055
-191588.378373     8253112.813835
-191587.447009     8253170.399500
-191588.121728     8253206.097439
-191588.311924     8253233.021765
-191588.068956     8253248.044345
-191587.775370     8253266.196597
-191587.259070     8253298.119103
-191583.181337     8253318.091077
-191579.052211     8253341.193476
-191571.200441     8253362.360154
-191563.812200     8253393.551233
-191559.572493     8253423.538006
-191559.329524     8253438.560586
-191562.133854     8253458.638205
-191562.405032     8253480.555513
-191570.102782     8253507.595849
-191573.361271     8253538.324426
-191578.728353     8253554.684998
-191588.486369     8253570.487038
-191597.537125     8253591.287245
-191602.883964     8253608.899380
-191626.950615     8253629.930092
-191642.176949     8253655.833359
-191661.965550     8253670.537500
-191685.930214     8253697.826781
-191705.052814     8253715.025211
-191720.410760     8253732.791025
-191734.516923     8253750.538386
-191755.908701     8253782.171259
-191774.344308     8253803.114765
-191784.172421     8253814.535557
-191792.113903     8253826.553325
-191803.031811     8253848.008131
-191821.941068     8253878.350257
-191829.195544     8253894.113865
-191833.978371     8253907.961721
-191840.546605     8253927.471181
-191844.703177     8253941.308659
-191856.791098     8253967.790450
-191861.573937     8253981.637542
-191869.766354     8254016.824181
-191873.659704     8254046.936566
-191878.361549     8254065.791439
-191892.386731     8254088.545818
-191897.027837     8254111.156145
-191900.961684     8254138.764640
-191901.081772     8254170.070977
-191900.565471     8254201.993482
-191900.130153     8254228.908970
-191899.593610     8254262.083038
-191903.264246     8254305.965676
-191903.001023     8254322.240584
-191902.173048     8254334.749671
-191896.228164     8254354.067046
-191887.104382     8254376.466072
-191876.104090     8254398.836293
-191858.755361     8254426.744022
-191840.640159     8254463.405396
-191820.779296     8254491.900499
-191800.302287     8254519.760207
-191778.645132     8254543.219476
-191760.299249     8254555.459651
-191737.562432     8254568.258359
-191710.930864     8254589.762692
-191686.074569     8254617.555175
-191659.957146     8254645.954235
-191636.393118     8254671.262043
-191612.990301     8254686.555040
-191591.969534     8254709.398140
-191569.555277     8254740.984497
-191551.026401     8254764.491786
-191537.594206     8254782.441588
-191526.109380     8254796.038959
-191503.857097     8254817.610516
-191481.019795     8254836.669345
-191469.575454     8254847.763590
-191455.568373     8254862.574117
-191435.839109     8254882.932531
-191422.426392     8254899.630757
-191414.756839     8254909.531073
-191403.272013     8254923.128445
-191387.306665     8254942.917936
-191369.485050     8254961.427058
-191352.419786     8254971.808316
-191335.264159     8254987.823913
-191314.899283     8255008.797742
-191291.314236     8255035.357866
-191268.456693     8255055.668258
-191226.748478     8255080.698304
-191191.114617     8255117.089990
-191159.728431     8255161.686355
-191136.810136     8255185.752966
-191117.221853     8255197.347368
-191091.972903     8255210.733450
-191065.351443     8255231.612765
-191038.012638     8255258.113737
-191013.096356     8255289.662450
-190983.366119     8255309.240640
-190958.036175     8255327.634504
-190938.942547     8255347.375973
-190924.178327     8255370.315880
-190911.764291     8255402.681684
-190898.291586     8255423.136140
-190872.921157     8255444.033130
-190845.128920     8255459.885448
-190822.413122     8255471.431841
-190804.157578     8255478.039206
-190782.713028     8255488.353239
-190756.838574     8255501.729719
-190729.661732     8255518.216657
-190711.375812     8255526.702130
-190693.746560     8255533.317581
-190671.061112     8255542.987392
-190644.580633     8255555.102696
-190609.392200     8255563.953877
-190578.038544     8255567.854900
-190551.043931     8255573.074711
-190528.449586     8255577.111724
-190509.629290     8255579.953268
-190491.414255     8255584.055978
-190477.014519     8255584.460105
-190463.875897     8255584.258418
-190446.306608     8255587.119166
-190426.759573     8255596.210454
-190401.682718     8255598.955956
-190373.447208     8255603.531546
-190344.596328     8255607.470988
-190331.396191     8255611.025507
-190308.811979     8255614.435974
-190280.566360     8255619.636582
-190243.500654     8255628.458945
-190219.039932     8255631.840607
-190200.260146     8255632.177496
-190176.928189     8255643.089258
-190147.360679     8255652.653425
-190127.904771     8255656.110386
-190109.074342     8255659.578476
-190090.869440     8255663.054640
-190069.526101     8255667.110857
-190043.147622     8255672.966827
-190021.804308     8255677.021516
-190006.778304     8255677.416029
-189979.148055     8255683.252784
-189951.446921     8255693.472303
-189933.797426     8255701.339316
-189918.619544     8255711.124375
-189902.160305     8255722.766810
-189886.296168     8255736.298484
-189867.202540     8255756.039954
-189847.534028     8255772.642149
-189827.269624     8255787.356622
-189808.831851     8255805.231113
-189789.062102     8255828.092653
-189769.150609     8255859.718193
-189751.924146     8255880.113497
-189742.276084     8255896.244341
-189738.288690     8255910.583505
-189729.246653     8255927.975525
-189720.788871     8255947.880262
-189715.520120     8255964.076803
-189713.370254     8255980.949451
-189712.522037     8255994.710101
-189712.198087     8256014.739699
-189716.364768     8256027.952159
-189726.162530     8256041.249532
-189744.587991     8256062.820348
-189762.740146     8256101.289562
-189765.362246     8256132.634307
-189770.598468     8256157.133108
-189774.068811     8256174.715674
-189788.436782     8256215.006902
-189804.086160     8256253.437696
-189811.240164     8256275.460660
-189816.526239     8256296.829778
-189817.373066     8256321.886373
-189822.084282     8256340.114688
-189826.816503     8256357.091452
-189837.430691     8256397.325056
-189848.811364     8256428.804251
-189855.299380     8256453.320740
-189858.063201     8256475.903014
-189858.273653     8256501.575012
-189857.888952     8256525.360828
-189857.595353     8256543.513844
-189857.977900     8256558.545262
-189863.849759     8256582.427120
-189866.522477     8256610.642193
-189866.168152     8256632.549899
-189867.095209     8256652.598700
-189867.519004     8256665.127003
-189867.276048     8256680.148819
-189867.496608     8256705.195800
-189870.531607     8256749.695382
-189869.954568     8256785.373341
-189869.741963     8256798.518576
-189869.215542     8256831.066863
-189862.564173     8256855.381653
-189857.941906     8256870.337773
-189848.172366     8256893.979524
-189838.544571     8256908.857276
-189825.020485     8256932.441393
-189819.813224     8256944.883255
-189818.308364     8256960.512402
-189816.483269     8256995.441932
-END
-LINE3D
-HEIGHT 1070.000000
-183557.000000     8247312.202083
-183565.300327     8247319.783831
-183580.830362     8247326.909445
-183596.370524     8247333.408896
-183615.069342     8247338.078260
-183636.331478     8247339.030968
-183651.347182     8247339.261469
-183666.988580     8247339.501576
-183689.522359     8247339.221166
-183705.769203     8247340.722823
-183713.649564     8247356.496038
-183723.538613     8247364.160997
-183740.986036     8247368.811533
-183758.453899     8247372.210126
-183772.904654     8247368.675187
-183790.514243     8247363.310927
-183811.231678     8247359.246249
-183837.590291     8247354.642229
-183868.348629     8247348.853492
-183894.122045     8247341.735978
-183918.068995     8247331.459976
-183943.923398     8247319.335062
-183969.737304     8247309.714038
-183998.648929     8247302.018760
-184016.944958     8247292.908268
-184036.542610     8247280.687309
-184051.064423     8247272.770755
-184068.754808     8247262.399092
-184088.383027     8247248.300026
-184113.702844     8247230.532326
-184134.622751     8247213.948959
-184149.235672     8247200.399224
-184165.786224     8247183.122846
-184175.948419     8247173.887495
-184188.603270     8247165.316345
-184196.949505     8247152.296731
-184209.756210     8247134.336563
-184219.979335     8247121.345761
-184232.302072     8247094.613135
-184247.086904     8247070.422435
-184259.934100     8247049.958759
-184269.703633     8247026.317389
-184279.341562     8247010.813092
-184288.313305     8246997.802698
-184298.536431     8246984.811895
-184310.646575     8246971.223741
-184324.633802     8246957.664401
-184339.216156     8246945.992772
-184356.311414     8246933.733399
-184380.288735     8246921.579670
-184400.573018     8246905.612482
-184416.437130     8246892.082335
-184429.707554     8246884.146572
-184444.168424     8246879.986233
-184461.788140     8246873.995809
-184485.038531     8246868.091820
-184510.226749     8246858.460810
-184525.333561     8246853.058130
-184541.035705     8246849.542401
-184556.122466     8246845.391287
-184574.347437     8246840.662411
-184596.972324     8246834.748820
-184628.346229     8246829.595852
-184648.468340     8246823.643842
-184667.339254     8246817.672625
-184683.041397     8246814.156895
-184703.748896     8246810.718383
-184723.840637     8246806.644100
-184747.635926     8246805.757118
-184765.790030     8246805.409860
-184778.928843     8246805.611550
-184795.135005     8246809.616712
-184810.150900     8246809.847217
-184833.905501     8246811.464122
-184854.531822     8246813.033007
-184867.660513     8246813.860479
-184892.656381     8246816.122376
-184917.067045     8246815.871160
-184930.296972     8246810.439287
-184946.120594     8246799.412649
-184963.882036     8246784.659372
-184977.737467     8246779.237101
-184994.731489     8246773.237072
-185012.249779     8246773.505990
-185027.891368     8246773.746100
-185040.333620     8246778.319803
-185053.320388     8246787.910507
-185069.283582     8246806.938249
-185081.009222     8246817.135531
-185092.159590     8246824.193915
-185106.397746     8246833.803829
-185121.302284     8246840.919460
-185140.545611     8246850.606206
-185161.000212     8246862.816059
-185175.248496     8246871.799809
-185188.891518     8246879.522394
-185199.385631     8246888.448897
-185213.583678     8246900.562326
-185225.288689     8246912.011547
-185233.855674     8246924.038917
-185245.530315     8246937.365865
-185259.082223     8246950.722013
-185271.362500     8246965.310515
-185281.180874     8246977.357094
-185291.664865     8246986.909379
-185302.128996     8246997.713233
-185311.372103     8247006.620532
-185320.564591     8247018.657504
-185330.957856     8247033.842975
-185338.283580     8247045.224971
-185347.465948     8247057.887725
-185357.324436     8247067.430408
-185377.616680     8247089.655053
-185394.841765     8247108.076230
-185411.420341     8247127.739356
-185430.421082     8247152.448688
-185450.591842     8247182.184624
-185472.186092     8247201.298807
-185498.836131     8247217.360151
-185514.305427     8247228.241220
-185529.179596     8247237.234578
-185540.904848     8247247.432236
-185556.959539     8247260.826421
-185566.172276     8247271.611447
-185584.668615     8247288.799882
-185595.173237     8247297.100227
-185613.246164     8247301.760365
-185630.088332     8247305.149353
-185648.212265     8247306.679443
-185662.582026     8247308.152285
-185680.090189     8247309.047366
-185700.111255     8247309.354704
-185720.767951     8247309.045479
-185739.537629     8247309.333607
-185757.681803     8247309.612133
-185773.252335     8247314.233857
-185790.699759     8247318.884393
-185807.491309     8247325.403054
-185823.031472     8247331.902505
-185838.561513     8247339.027738
-185854.717051     8247346.162954
-185872.123984     8247353.316999
-185887.079140     8247357.302957
-185902.013659     8247362.541237
-185914.476160     8247365.862995
-185927.594921     8247367.316251
-185942.549689     8247371.302586
-185958.816973     8247371.552300
-185980.714930     8247371.888449
-186005.105161     8247372.888793
-186020.060311     8247376.875134
-186034.399703     8247380.225703
-186046.852082     8247384.173242
-186070.505447     8247392.049492
-186085.369488     8247401.669014
-186104.602695     8247411.981542
-186119.497105     8247419.723337
-186133.180625     8247424.942031
-186146.843896     8247431.412671
-186161.173160     8247435.389403
-186176.067196     8247443.130810
-186192.273734     8247447.136360
-186207.228508     8247451.122313
-186225.988058     8247452.036604
-186244.737494     8247453.576296
-186259.117758     8247454.423362
-186278.482570     8247456.598818
-186305.748373     8247473.295552
-186329.926005     8247487.440749
-186349.866083     8247492.755486
-186366.677876     8247498.022583
-186385.860465     8247511.464784
-186400.189736     8247515.441134
-186413.832758     8247523.163719
-186437.465874     8247532.291915
-186454.893437     8247538.194020
-186467.971314     8247542.151543
-186484.803361     8247546.166314
-186501.009517     8247550.171858
-186517.892183     8247551.056956
-186532.261944     8247552.529798
-186553.534399     8247552.856345
-186576.552139     8247561.348775
-186590.810544     8247569.706744
-186611.940883     8247578.796520
-186627.470925     8247585.921753
-186641.770202     8247591.776219
-186656.674358     8247598.891844
-186672.214520     8247605.391295
-186685.282658     8247609.974606
-186700.237432     8247613.960558
-186720.792886     8247619.911061
-186740.682347     8247628.355470
-186757.453649     8247636.126076
-186772.963442     8247644.503254
-186790.996254     8247651.667288
-186800.885118     8247659.331862
-186812.590504     8247670.781471
-186827.958570     8247687.921503
-186843.942007     8247705.697682
-186866.888881     8247718.571730
-186882.358183     8247729.452417
-186894.729569     8247738.407737
-186910.854738     8247747.420681
-186931.904478     8247761.517481
-186950.441309     8247776.202407
-186965.234108     8247790.203158
-186981.792811     8247811.118618
-187003.952207     8247833.997863
-187023.679305     8247852.457447
-187045.919689     8247870.329292
-187063.901507     8247880.622611
-187077.544529     8247888.345196
-187089.996909     8247892.292735
-187102.388543     8247899.996110
-187117.293075     8247907.112123
-187129.715085     8247912.937389
-187149.432444     8247932.022761
-187163.589613     8247946.640074
-187179.583176     8247963.790089
-187196.283612     8247975.942313
-187209.936762     8247983.038734
-187230.411229     8247993.996636
-187248.352932     8248006.793851
-187264.386993     8248021.439976
-187276.717888     8248032.898805
-187285.910376     8248044.935777
-187297.514533     8248062.644349
-187310.914205     8248085.389508
-187336.050027     8248117.705791
-187351.397839     8248136.098150
-187363.708486     8248148.808924
-187372.850363     8248163.975186
-187385.059774     8248182.945306
-187392.990753     8248195.588849
-187399.528611     8248216.976418
-187409.255876     8248234.656179
-187416.470238     8248252.923684
-187422.331981     8248277.430941
-187426.508795     8248290.016856
-187429.343495     8248308.216747
-187433.247347     8248337.703357
-187441.530880     8248367.256433
-187444.385815     8248384.205144
-187446.564260     8248404.273155
-187446.947177     8248419.305343
-187446.521992     8248445.594285
-187446.208163     8248464.998100
-187445.995558     8248478.143336
-187439.767221     8248514.986417
-187433.761967     8248538.060016
-187429.149464     8248552.388820
-187425.081458     8248571.735771
-187423.617859     8248584.861038
-187413.838198     8248609.128571
-187405.339919     8248631.537199
-187403.189696     8248648.408313
-187393.389793     8248673.927409
-187387.242807     8248705.764244
-187381.277680     8248726.333182
-187376.019419     8248741.904711
-187373.848942     8248760.028152
-187376.734253     8248775.098753
-187388.459512     8248785.296029
-187392.464612     8248808.522530
-187392.160905     8248827.300564
-187376.891920     8248842.718421
-187361.805535     8248846.869922
-187336.779297     8248846.485752
-187323.085663     8248841.892457
-187300.511585     8248844.676379
-187287.200473     8248855.116030
-187271.326240     8248869.271958
-187258.580274     8248883.476672
-187248.347218     8248897.093259
-187234.440979     8248905.645199
-187218.779326     8248906.657420
-187205.004698     8248907.071907
-187186.143906     8248912.417342
-187169.745405     8248920.304324
-187153.387007     8248925.688172
-187138.250016     8248932.968582
-187122.497249     8248939.614366
-187104.837239     8248948.107919
-187092.253248     8248952.297834
-187070.778322     8248964.489976
-187047.386008     8248979.157197
-187022.752821     8248993.178669
-187002.498908     8249007.268130
-186981.034103     8249018.834491
-186963.989463     8249027.964192
-186952.565758     8249037.806115
-186937.297155     8249053.223978
-186925.852826     8249064.317459
-186916.891401     8249076.701692
-186905.457562     8249087.170161
-186895.850009     8249100.796350
-186889.975985     8249115.732489
-186885.262234     8249136.321401
-186884.978781     8249153.847108
-186890.870894     8249176.476639
-186894.351715     8249193.434957
-186902.817082     8249211.721666
-186911.353704     8249225.626380
-186926.106007     8249242.131022
-186936.549884     8249254.187204
-186948.961766     8249260.638633
-186961.404025     8249265.211954
-186980.123085     8249268.629754
-186999.992297     8249278.326109
-187020.578115     8249282.399266
-187034.221144     8249290.121469
-187050.427306     8249294.126631
-187073.515913     8249298.237444
-187102.861066     8249302.445063
-187121.630744     8249302.733191
-187139.149034     8249303.002109
-187158.544596     8249303.299845
-187182.400439     8249298.657024
-187211.261452     8249294.091036
-187241.373842     8249289.545022
-187267.712206     8249286.192948
-187290.871685     8249285.921761
-187312.235242     8249280.615509
-187338.048969     8249270.993718
-187358.827137     8249263.173968
-187373.954389     8249256.519346
-187391.009163     8249246.763100
-187408.063542     8249237.007611
-187420.082757     8249229.053405
-187430.214589     8249221.695398
-187443.647179     8249203.744839
-187463.325813     8249186.516862
-187477.908173     8249174.844851
-187489.352515     8249163.750606
-187502.047850     8249152.676329
-187514.005956     8249148.476807
-187526.620310     8249142.409547
-187541.798180     8249132.625253
-187555.704420     8249124.073312
-187570.246283     8249114.905192
-187587.987287     8249101.403857
-187600.057131     8249090.319215
-187608.423417     8249076.048034
-187617.384842     8249063.663801
-187631.957464     8249052.617578
-187645.853188     8249044.692177
-187664.552005     8249049.361540
-187686.934115     8249058.470533
-187708.832073     8249058.806682
-187723.918458     8249054.655180
-187725.402681     8249040.278356
-187714.394040     8249024.457119
-187704.021024     8249008.019702
-187702.982241     8248994.855257
-187710.320246     8248966.793856
-187716.870379     8248948.738410
-187735.216644     8248936.498241
-187752.968162     8248922.370366
-187771.920069     8248911.391368
-187792.254582     8248892.294884
-187812.447744     8248881.961641
-187827.615493     8248872.803128
-187850.341425     8248860.630190
-187868.799428     8248841.504900
-187885.440909     8248818.594574
-187900.144748     8248799.411655
-187911.599210     8248787.691629
-187921.135903     8248778.446676
-187937.000015     8248764.916529
-187950.946369     8248753.860692
-187971.765416     8248743.537057
-187991.948075     8248733.829590
-188007.791945     8248721.551007
-188024.332572     8248704.900032
-188041.478448     8248689.510986
-188054.829662     8248676.568202
-188069.371526     8248667.400082
-188086.416166     8248658.270381
-188106.558710     8248651.066811
-188124.773375     8248646.963331
-188144.986792     8248635.377760
-188162.646801     8248626.884207
-188178.440053     8248617.735297
-188191.659669     8248612.929202
-188205.606787     8248601.873377
-188225.850185     8248588.410456
-188244.176589     8248577.421855
-188256.165440     8248571.344994
-188269.959928     8248569.678938
-188289.344988     8248570.602449
-188300.475489     8248578.912784
-188316.137141     8248577.900563
-188331.555813     8248591.911687
-188362.223240     8248591.755752
-188374.282951     8248581.297655
-188381.347243     8248570.136173
-188394.536483     8248567.208188
-188409.985530     8248579.341202
-188428.068966     8248583.375182
-188440.229913     8248566.657740
-188445.477671     8248551.711987
-188458.626413     8248551.287892
-188481.766020     8248552.269038
-188493.582763     8248556.833521
-188505.933906     8248567.040405
-188517.073777     8248574.724183
-188527.538278     8248585.528807
-188539.273276     8248595.100295
-188550.988795     8248605.923359
-188560.191405     8248617.334549
-188572.643784     8248621.282088
-188572.410949     8248635.678122
-188560.290487     8248649.892438
-188549.462291     8248661.622078
-188539.259598     8248673.361320
-188528.309161     8248692.601856
-188527.954836     8248714.509562
-188527.056001     8248731.399885
-188526.187529     8248746.412864
-188529.718598     8248760.240740
-188543.997621     8248767.347533
-188562.364521     8248753.855042
-188579.056608     8248727.815808
-188601.964770     8248704.375743
-188619.090009     8248690.239019
-188635.631018     8248673.588050
-188653.956646     8248662.600202
-188673.433585     8248657.890162
-188689.135722     8248654.374815
-188702.294598     8248653.324174
-188717.371232     8248649.799225
-188744.213240     8248653.967655
-188769.128107     8248661.237716
-188792.751484     8248670.991699
-188813.912582     8248678.203373
-188843.862627     8248683.671387
-188873.137302     8248692.260248
-188890.523598     8248700.666614
-188906.104258     8248704.662174
-188920.948057     8248715.533259
-188933.924704     8248725.749745
-188955.035171     8248736.091855
-188979.284051     8248745.855440
-188996.115716     8248749.870205
-189014.753795     8248758.295022
-189028.992333     8248767.904942
-189041.989222     8248776.869864
-189058.154888     8248783.378917
-189080.536616     8248792.487903
-189109.801170     8248801.702546
-189130.871153     8248814.547782
-189153.212397     8248826.159895
-189171.123724     8248840.835220
-189194.070216     8248853.709262
-189219.458746     8248870.377178
-189243.677250     8248882.018872
-189264.767488     8248893.611781
-189279.005262     8248903.221689
-189290.781508     8248910.290063
-189309.348714     8248923.096880
-189332.346588     8248932.841261
-189362.881640     8248940.822769
-189378.442044     8248946.070656
-189401.460173     8248954.562711
-189416.374832     8248961.052560
-189436.233541     8248971.374690
-189460.462167     8248982.390603
-189478.424124     8248993.935491
-189491.360275     8249006.655867
-189505.618291     8249015.014212
-189523.691606     8249019.673973
-189541.734545     8249026.211844
-189559.131726     8249033.992440
-189576.568652     8249039.268369
-189601.503775     8249045.286103
-189619.546713     8249051.823973
-189636.327761     8249058.968410
-189649.365911     8249065.429453
-189663.623927     8249073.787798
-189675.379931     8249082.107735
-189693.341889     8249093.652623
-189713.765350     8249107.740573
-189731.626072     8249125.544805
-189744.552101     8249138.890964
-189758.003149     8249158.506844
-189769.637675     8249174.337689
-189786.882251     8249191.506526
-189798.618012     8249201.078027
-189812.907168     8249207.558274
-189828.528324     8249209.049944
-189846.046232     8249209.318856
-189860.517605     8249204.532741
-189882.496556     8249199.861109
-189903.758889     8249200.813437
-189916.836759     8249204.771343
-189929.914642     8249208.728484
-189951.065618     8249216.565939
-189965.364132     8249222.420393
-189977.140390     8249229.488002
-189992.004432     8249239.107524
-190004.375818     8249248.062844
-190016.757325     8249256.392383
-190029.835207     8249260.349524
-190043.508981     8249266.194388
-190064.669315     8249273.406050
-190092.056596     8249282.591875
-190115.186081     8249284.198803
-190131.432740     8249285.700074
-190155.176832     8249287.943138
-190173.875649     8249292.612502
-190186.944162     8249297.196200
-190199.991669     8249303.031450
-190218.690487     8249307.700814
-190232.363497     8249313.545666
-190248.529163     8249320.054719
-190262.152319     8249329.029255
-190281.980665     8249341.228730
-190296.854827     8249350.222470
-190319.155562     8249364.339238
-190337.732902     8249376.519509
-190350.689294     8249387.988322
-190362.414934     8249398.185604
-190377.238479     8249410.309016
-190390.255623     8249418.021611
-190408.258065     8249427.063373
-190428.167392     8249434.255831
-190439.974014     8249439.446095
-190452.477011     8249440.263962
-190471.851938     8249441.814019
-190484.971081     8249443.267281
-190499.330333     8249445.366281
-190512.408216     8249449.323422
-190533.640173     8249452.153860
-190550.513100     8249453.664745
-190563.005976     8249455.108394
-190580.402393     8249462.888978
-190602.097879     8249475.743816
-190619.414079     8249488.531430
-190634.842884     8249501.916007
-190647.102913     8249517.756454
-190667.445393     8249536.851421
-190684.115848     8249550.880996
-190697.082361     8249561.724028
-190714.459300     8249570.756187
-190733.702628     8249580.442934
-190746.689396     8249590.033638
-190760.311800     8249599.007398
-190770.816798     8249607.308131
-190785.650463     8249618.805762
-190807.254847     8249637.293399
-190823.268659     8249653.191469
-190838.152942     8249661.559428
-190849.908183     8249669.879353
-190871.583426     8249683.985755
-190885.872582     8249690.466002
-190898.879592     8249698.805143
-190914.440009     8249704.052266
-190925.519892     8249715.492274
-190940.454806     8249720.729796
-190954.631829     8249734.095922
-190975.025691     8249750.061229
-190987.204738     8249770.908693
-190995.812221     8249780.432172
-191004.368321     8249793.085311
-191012.965682     8249803.234572
-191020.907164     8249815.252340
-191030.644162     8249832.306695
-191037.252893     8249849.312264
-191042.630859     8249865.047067
-191049.057361     8249893.319762
-191056.857110     8249914.100765
-191064.020484     8249935.497173
-191079.246806     8249961.401204
-191093.969127     8249979.783196
-191106.672430     8250006.900371
-191117.509356     8250033.362195
-191125.429820     8250046.632278
-191130.222780     8250059.853588
-191134.399595     8250072.439503
-191147.627941     8250105.824872
-191155.962079     8250132.249040
-191160.602422     8250154.859355
-191164.769879     8250168.071063
-191172.710597     8250180.088819
-191179.965837     8250195.852439
-191187.805320     8250214.129540
-191191.972777     8250227.341247
-191199.630042     8250256.884710
-191203.564652     8250284.493217
-191204.582811     8250298.909219
-191211.090306     8250322.174133
-191215.085655     8250346.027185
-191216.103827     8250360.442424
-191219.966800     8250392.432918
-191224.607907     8250415.043245
-191224.929703     8250433.830881
-191227.804893     8250449.527264
-191229.165866     8250481.478586
-191222.050956     8250495.769740
-191208.698978     8250508.712513
-191194.268853     8250510.995512
-191178.546474     8250515.762423
-191165.245877     8250525.575535
-191153.720542     8250541.677561
-191157.897357     8250554.263476
-191174.729786     8250558.278252
-191194.205960     8250553.568200
-191209.292716     8250549.417469
-191222.492076     8250545.863702
-191234.288589     8250551.678984
-191242.865696     8250563.080572
-191250.170790     8250575.714508
-191250.583700     8250588.868581
-191240.451868     8250596.226587
-191227.878010     8250599.789956
-191213.345886     8250608.332289
-191198.733544     8250621.881651
-191192.889895     8250634.939681
-191200.225353     8250645.696272
-191214.474024     8250654.679646
-191238.269497     8250653.793049
-191252.527514     8250662.151394
-191258.551238     8250676.643470
-191258.923652     8250692.301434
-191262.374491     8250711.137103
-191262.101147     8250728.037792
-191243.774755     8250739.025628
-191229.938994     8250743.196328
-191224.519141     8250768.782661
-191224.911809     8250783.188297
-191242.410226     8250784.709549
-191254.811988     8250791.786760
-191262.702088     8250806.934188
-191266.253399     8250819.510501
-191277.394033     8250827.194290
-191306.143678     8250829.514193
-191328.667138     8250829.859944
-191340.101359     8250819.391481
-191350.858682     8250812.043840
-191370.961123     8250807.343402
-191387.258388     8250805.715766
-191404.685945     8250811.618253
-191414.564688     8250819.908608
-191419.296133     8250836.886124
-191394.774685     8250844.022476
-191380.949057     8250847.566629
-191370.746365     8250859.305871
-191366.154486     8250872.383117
-191377.284223     8250880.693440
-191394.238130     8250877.197308
-191413.866158     8250863.098239
-191427.004780     8250863.299926
-191451.405514     8250863.674495
-191466.441651     8250862.653436
-191480.557948     8250879.774252
-191485.290169     8250896.751016
-191492.534512     8250913.141170
-191496.661472     8250928.856768
-191496.408382     8250944.505130
-191477.557723     8250949.224019
-191461.290058     8250948.974299
-191443.751896     8250949.957715
-191419.915926     8250953.348202
-191400.984274     8250963.074873
-191385.846901     8250970.355277
-191374.494437     8250975.815970
-191358.731549     8250983.087536
-191342.363412     8250989.097172
-191332.170089     8251000.209857
-191328.163217     8251015.800595
-191337.910348     8251032.228404
-191362.936585     8251032.612575
-191381.202238     8251025.380192
-191400.698655     8251019.418577
-191421.467084     8251012.224614
-191434.040954     8251008.660482
-191457.311395     8251001.504926
-191474.285557     8250996.756467
-191493.196955     8250988.282123
-191511.422124     8250983.552868
-191525.085013     8250990.023501
-191531.703865     8251006.403289
-191519.623899     8251018.113714
-191502.792233     8251014.098950
-191488.432217     8251011.999938
-191474.556735     8251018.673775
-191468.682711     8251033.609915
-191462.768190     8251051.049945
-191458.771438     8251066.014902
-191472.364231     8251076.866783
-191484.068853     8251088.316380
-191491.394966     8251099.698001
-191499.224327     8251118.600883
-191501.463893     8251134.913446
-191512.875693     8251164.515308
-191517.597793     8251182.117853
-191529.261918     8251196.071341
-191535.972649     8251206.817578
-191545.215755     8251215.724877
-191557.617517     8251222.802089
-191571.381642     8251223.013378
-191574.752890     8251208.038819
-191575.056597     8251189.260785
-191575.259068     8251176.742095
-191570.445854     8251164.773113
-191565.210383     8251140.275087
-191562.920200     8251127.092196
-191558.732500     8251115.132052
-191558.380341     8251098.221761
-191558.582813     8251085.703071
-191560.672679     8251072.587418
-191577.091434     8251063.448109
-191590.926419     8251059.278162
-191606.084046     8251050.745431
-191616.266484     8251040.258517
-191626.459819     8251029.145068
-191643.453460     8251023.145034
-191656.612324     8251022.095158
-191673.515625     8251021.727934
-191688.297909     8251036.355225
-191696.269767     8251046.494884
-191699.709722     8251065.956323
-191703.180039     8251083.540417
-191702.896574     8251101.066888
-191702.542249     8251122.974594
-191702.844566     8251143.013805
-191711.198195     8251168.185634
-191716.606537     8251182.042327
-191728.271426     8251195.995827
-191737.484169     8251206.780472
-191754.962344     8251209.553286
-191768.736590     8251209.138794
-191770.816335     8251196.648922
-191771.099800     8251179.122451
-191770.131483     8251161.577529
-191769.123445     8251146.535745
-191767.509382     8251130.232784
-191767.792847     8251112.706313
-191768.630943     8251099.571444
-191782.557807     8251089.767946
-191802.760720     8251078.808151
-191817.847475     8251074.657420
-191831.702715     8251069.235146
-191845.609336     8251060.683211
-191861.422830     8251050.282738
-191874.158675     8251036.703806
-191884.936253     8251028.103838
-191899.589855     8251012.050597
-191909.177165     8250999.675972
-191919.944610     8250991.702550
-191934.990881     8250990.054945
-191947.493878     8250990.872812
-191961.065652     8251002.977009
-191968.401886     8251013.732847
-191973.204203     8251026.328364
-191977.250170     8251047.051744
-191982.001870     8251062.776933
-191986.804951     8251075.372461
-191995.825344     8251098.050013
-191999.941419     8251114.391381
-192002.846973     8251128.210419
-192002.472405     8251151.369689
-191987.194063     8251167.413340
-191968.958774     8251172.768377
-191955.759413     8251176.322144
-191935.031469     8251181.012980
-191914.939924     8251185.086884
-191901.104163     8251189.257583
-191874.110302     8251194.478170
-191858.377801     8251199.870863
-191847.024575     8251205.331544
-191834.995227     8251213.912297
-191819.786981     8251225.574700
-191817.576401     8251246.201273
-191834.962697     8251254.607639
-191848.727586     8251254.818940
-191868.284742     8251245.101871
-191884.652879     8251239.092234
-191902.212047     8251236.857267
-191922.273228     8251234.660708
-191935.432092     8251233.610832
-191952.487235     8251223.855355
-191967.563881     8251220.329642
-191988.361922     8251211.257558
-192000.935780     8251207.694189
-192022.914718     8251203.023321
-192041.160129     8251197.042502
-192059.344800     8251194.817137
-192074.350574     8251195.673423
-192088.033706     8251200.892494
-192103.533383     8251209.895072
-192117.257012     8251212.610251
-192129.770130     8251212.802336
-192142.354109     8251208.613186
-192152.638559     8251191.866174
-192167.190162     8251182.072266
-192181.772904     8251170.400261
-192196.890035     8251164.371421
-192207.133212     8251150.129053
-192219.172681     8251140.922519
-192232.463156     8251131.735189
-192245.713135     8251125.051749
-192261.384908     8251123.413747
-192273.918269     8251122.354269
-192288.004954     8251141.353205
-192295.560983     8251177.156013
-192299.708186     8251191.620048
-192306.337159     8251207.374054
-192312.996508     8251221.249952
-192326.416428     8251242.743165
-192334.276929     8251259.767950
-192338.382871     8251276.735865
-192344.376220     8251293.106051
-192353.224516     8251326.424183
-192358.521489     8251347.166767
-192363.848838     8251366.031241
-192368.408951     8251393.649350
-192372.322555     8251422.509408
-192378.164050     8251448.268611
-192382.815278     8251470.253156
-192386.224856     8251491.592704
-192389.735671     8251506.672907
-192394.397020     8251528.031671
-192398.462477     8251547.502712
-192398.865266     8251561.282566
-192399.904444     8251574.446253
-192400.297100     8251588.852653
-192403.172290     8251604.549036
-192404.775468     8251621.477767
-192409.196517     8251636.302325
-END
-LINE3D
-HEIGHT 1010.000000
-188325.171102     8246277.000000
-188325.176649     8246277.785358
-188324.660349     8246309.707863
-188324.133922     8246342.256532
-188322.599457     8246359.763417
-188321.659355     8246379.158001
-188316.360986     8246397.233045
-188311.626611     8246419.073514
-188310.707522     8246437.216165
-188305.943541     8246460.934373
-188301.178796     8246484.652570
-188292.802759     8246499.550302
-188283.689098     8246521.323546
-188272.658437     8246545.571494
-188258.549344     8246566.642118
-188247.095645     8246578.362156
-188236.882068     8246590.727168
-188225.962764     8246608.089989
-188215.790447     8246617.951122
-188205.557003     8246631.568085
-188192.114674     8246650.144432
-188181.174739     8246668.759192
-188170.901187     8246684.879670
-188160.001743     8246700.990922
-188149.031439     8246721.483409
-188140.049383     8246735.119582
-188130.522818     8246743.738372
-188118.463482     8246754.196857
-188101.368224     8246766.456230
-188092.436786     8246776.962730
-188082.889973     8246786.833465
-188073.898172     8246801.095808
-188064.229874     8246818.477833
-188057.094340     8246834.020544
-188053.117837     8246847.733556
-188042.854406     8246863.228252
-188030.118573     8246876.806419
-188020.571753     8246886.677536
-188011.045188     8246895.296325
-188001.478120     8246906.419388
-187991.840191     8246921.923686
-187987.197313     8246938.130598
-187996.399929     8246949.541406
-188015.774861     8246951.091081
-188032.819501     8246941.961380
-188049.864142     8246932.831679
-188065.001139     8246925.550888
-188080.764021     8246918.279704
-188097.173031     8246909.766565
-188118.637454     8246898.200198
-188142.625277     8246885.420694
-188162.868681     8246871.957391
-188179.943691     8246860.949963
-188195.787561     8246848.671380
-188214.759710     8246836.440818
-188243.732462     8246824.989710
-188273.299960     8246815.426306
-188293.503631     8246804.466906
-188311.839392     8246792.852512
-188330.841911     8246778.744223
-188347.907182     8246768.362583
-188360.491166     8246764.173050
-188385.740124     8246750.786586
-188398.364599     8246744.093545
-188412.260329     8246736.167762
-188430.617103     8246723.301435
-188454.493569     8246717.407056
-188468.883197     8246717.627947
-188485.776365     8246717.887269
-188513.304615     8246718.309847
-188531.347554     8246724.847718
-188546.262213     8246731.337567
-188556.786695     8246738.386343
-188567.947572     8246744.818569
-188580.389824     8246749.392272
-188595.314611     8246755.255957
-188610.249518     8246760.493861
-188638.191436     8246774.070906
-188651.208574     8246781.783883
-188659.816056     8246791.307362
-188671.439697     8246807.763977
-188684.315872     8246824.239819
-188692.851724     8246838.144904
-188702.003721     8246852.685384
-188715.515521     8246868.545047
-188733.426848     8246883.220371
-188753.255188     8246895.420228
-188767.544344     8246901.900476
-188776.777329     8246911.433556
-188797.200796     8246925.521125
-188810.278679     8246929.478266
-188835.193553     8246936.747944
-188852.702103     8246937.642650
-188879.605614     8246938.055638
-188897.749025     8246938.334152
-188910.262143     8246938.526237
-188925.257790     8246940.008687
-188945.823754     8246945.333031
-188971.323640     8246955.115821
-188996.208145     8246964.263226
-189022.374031     8246971.551727
-189035.503289     8246972.379589
-189050.498178     8246973.861645
-189067.229366     8246984.136148
-189080.256630     8246991.222962
-189089.469367     8247002.007988
-189101.830632     8247011.589090
-189113.586642     8247019.908645
-189133.404855     8247032.734666
-189147.017890     8247042.334984
-189162.002651     8247044.443203
-189182.639475     8247045.386312
-189201.480019     8247041.292822
-189212.379075     8247025.181947
-189219.474500     8247012.142750
-189224.712131     8246997.823160
-189226.287856     8246977.812396
-189230.284601     8246962.847822
-189243.423223     8246963.049509
-189258.922895     8246972.052468
-189275.784930     8246974.189506
-189297.047257     8246975.142216
-189315.221801     8246973.543015
-189327.734920     8246973.735100
-189345.879094     8246974.013626
-189360.834250     8246977.999585
-189375.778515     8246982.611695
-189383.730124     8246994.003299
-189395.969905     8247011.095692
-189403.830400     8247028.120859
-189404.192692     8247044.404604
-189403.959851     8247058.801020
-189401.708004     8247081.931855
-189400.173539     8247099.438740
-189399.748348     8247125.728064
-189401.381889     8247140.779450
-189409.252511     8247157.178453
-189417.224368     8247167.318112
-189427.011991     8247181.242412
-189446.224948     8247192.806886
-189460.473608     8247201.791024
-189472.986726     8247201.983109
-189492.260423     8247209.792129
-189516.337201     8247230.196677
-189536.639190     8247251.795153
-189552.703620     8247264.563551
-189566.952279     8247273.547689
-189578.123283     8247279.353751
-189591.776045     8247286.450548
-189616.660556     8247295.597572
-189639.032163     8247305.332340
-189659.466515     8247318.794138
-189679.345473     8247327.864323
-189707.226651     8247345.196822
-189727.671131     8247358.032456
-189745.693821     8247365.822272
-189758.186691     8247367.266303
-189783.071202     8247376.413326
-189803.565536     8247386.119277
-189818.500437     8247391.357563
-189831.618817     8247392.810813
-189845.948463     8247396.787552
-189868.390937     8247402.140702
-189892.700556     8247408.148834
-189912.004628     8247414.079744
-189932.570592     8247419.404089
-189953.720798     8247427.241914
-189980.512946     8247434.540410
-190002.350164     8247438.632013
-190018.556326     8247442.637176
-190036.024380     8247446.035772
-190051.534167     8247454.413332
-190069.506245     8247465.332438
-190082.543631     8247471.793470
-190096.771278     8247482.029542
-190115.985000     8247493.594027
-190132.089927     8247503.858534
-190143.866179     8247510.926526
-190155.016170     8247517.984522
-190165.531295     8247525.659091
-190172.816141     8247539.544972
-190183.188775     8247555.982383
-190203.390287     8247583.840598
-190231.360420     8247634.357149
-190253.478938     8247659.740279
-190257.656516     8247672.326205
-190275.990881     8247699.529439
-190285.203618     8247710.314465
-190291.873088     8247723.564580
-190300.308468     8247743.729022
-190304.414416     8247760.696554
-190315.281712     8247785.280650
-190331.769173     8247810.577340
-190344.563591     8247832.060951
-190351.233824     8247845.311079
-190361.626701     8247860.496926
-190368.901426     8247875.008589
-190375.571653     8247888.259099
-190384.713530     8247903.425360
-190391.362751     8247917.927421
-190401.593653     8247943.128068
-190417.990764     8247974.058332
-190426.970660     8247999.239774
-190434.164397     8248018.758836
-190450.076973     8248040.916251
-190458.008334     8248053.559801
-190471.539611     8248068.167888
-190481.377858     8248078.962134
-190491.872734     8248087.888649
-190510.338704     8248106.954811
-190525.585281     8248131.606514
-190538.389825     8248152.463963
-190546.997307     8248161.987442
-190557.440808     8248174.043235
-190577.188919     8248191.250885
-190590.125069     8248203.971262
-190599.337805     8248214.756288
-190612.858962     8248229.990157
-190623.282978     8248243.297908
-190630.598193     8248255.306062
-190640.355446     8248271.108089
-190650.173444     8248283.154281
-190662.463842     8248297.117001
-190680.273940     8248318.051288
-190698.073911     8248339.611738
-190715.884008     8248360.546025
-190733.744718     8248378.351022
-190748.456142     8248397.359549
-190766.296609     8248416.416108
-190785.377962     8248436.117654
-190805.105823     8248454.577250
-190819.919247     8248467.326443
-190834.742040     8248479.449080
-190851.412482     8248493.479419
-190872.421726     8248510.080109
-190893.399830     8248528.558897
-190909.444781     8248542.578870
-190925.509211     8248555.347268
-190939.131603     8248564.321792
-190950.928104     8248570.137838
-190965.176763     8248579.121976
-190983.784466     8248589.424903
-190997.931126     8248604.668374
-191006.992015     8248624.842035
-191020.896470     8248655.108098
-191034.367021     8248673.470875
-191049.251305     8248681.838833
-191062.217831     8248692.681101
-191081.471279     8248701.742066
-191101.996740     8248709.570683
-191118.162405     8248716.079736
-191132.431319     8248723.811547
-191147.870246     8248736.570343
-191168.293719     8248750.657529
-191188.163313     8248760.353889
-191205.549610     8248768.760255
-191219.243638     8248773.352791
-191234.743304     8248782.356133
-191246.529683     8248788.797961
-191263.209495     8248802.201742
-191279.939913     8248812.476615
-191299.738647     8248826.554211
-191311.484530     8248835.499930
-191323.855916     8248844.455251
-191337.498562     8248852.177448
-191349.244445     8248861.123166
-191363.472098     8248871.358856
-191373.321230     8248881.527332
-191381.282190     8248892.293525
-191392.967334     8248904.994697
-191407.851630     8248913.361891
-191416.367997     8248928.518934
-191423.077964     8248939.265158
-191425.902536     8248958.091214
-191425.619071     8248975.617685
-191420.985932     8248991.198809
-191418.886708     8249004.940256
-191418.562746     8249024.970618
-191422.073561     8249040.050821
-191436.927481     8249050.296124
-191453.285497     8249044.912270
-191455.446235     8249027.414616
-191461.562452     8248997.456649
-191466.144973     8248985.005197
-191467.669324     8248968.123711
-191472.282208     8248953.794914
-191484.947181     8248944.597982
-191499.417802     8248939.811091
-191521.315760     8248940.147240
-191533.828878     8248940.339326
-191561.973274     8248941.397299
-191579.471691     8248942.918550
-191604.477686     8248944.554284
-191621.944975     8248947.952868
-191636.325246     8248948.799552
-191666.326660     8248951.138671
-191684.389078     8248956.424966
-191697.467724     8248960.382119
-191714.279148     8248965.648446
-191737.892391     8248976.028976
-191751.454044     8248988.758954
-191768.154111     8249000.910408
-191780.434382     8249015.499292
-191795.832812     8249030.761978
-191812.462770     8249047.295443
-191833.573249     8249057.636789
-191850.344163     8249065.407772
-191873.977674     8249074.535209
-191890.072467     8249085.426262
-191906.894011     8249090.066808
-191918.690512     8249095.882854
-191941.092495     8249103.739513
-191954.756147     8249110.210159
-191985.311441     8249116.940103
-192010.135207     8249129.842962
-192032.487323     8249140.830069
-192046.180587     8249145.422594
-192056.069439     8249153.087932
-192080.994440     8249159.731447
-192107.827091     8249164.525670
-192128.382163     8249170.476167
-192149.593879     8249174.558168
-192188.283769     8249181.412984
-192228.870410     8249187.045042
-192248.204852     8249191.098225
-192273.069114     8249201.497194
-192285.460755     8249209.200188
-192303.442942     8249219.494276
-192328.337580     8249228.015136
-192348.297526     8249232.077922
-192370.023375     8249243.055415
-192393.656873     8249252.183617
-192419.802517     8249260.723681
-192437.946692     8249261.002207
-192456.090866     8249261.280732
-192480.511079     8249260.403726
-192500.603399     8249256.329069
-192517.505925     8249255.962598
-192541.372270     8249250.694001
-192562.745960     8249244.761204
-192584.169505     8249235.698722
-192608.086455     8249227.301217
-192628.875139     8249218.854927
-192649.067932     8249208.520914
-192668.625087     8249198.803845
-192688.849007     8249186.592499
-192712.805691     8249175.691092
-192733.685489     8249161.611238
-192743.222182     8249152.366285
-192752.173868     8249140.607839
-192762.386682     8249128.242816
-192772.034731     8249112.112736
-192786.687570     8249096.059484
-192802.673172     8249075.017665
-192816.620290     8249063.961840
-192831.202256     8249052.290587
-192852.555704     8249047.609353
-192867.581720     8249047.214076
-192888.228671     8249047.531021
-192911.306775     8249052.267609
-192939.380298     8249057.707582
-192971.903980     8249058.832781
-192999.997757     8249063.020426
-193019.302587     8249068.951731
-193037.981150     8249074.873421
-193057.295350     8249080.178168
-193082.220352     8249086.821683
-193111.615741     8249087.899624
-193127.257139     8249088.139731
-193143.524041     8249088.389439
-193160.417209     8249088.648761
-193176.684110     8249088.898470
-193200.459341     8249089.263436
-193224.859311     8249089.637993
-193248.009039     8249089.993357
-193266.707856     8249094.662721
-193288.524820     8249100.006651
-193316.618598     8249104.194297
-193350.948693     8249109.729548
-193383.391381     8249115.862528
-193412.060044     8249123.189448
-193440.729458     8249130.517143
-193476.946183     8249135.455419
-193505.716082     8249136.522994
-193530.005459     8249143.782689
-193552.468169     8249147.884658
-193578.009316     8249155.163568
-193611.057265     8249162.557713
-193635.992387     8249168.575446
-193657.204102     8249172.657447
-193677.780193     8249177.355628
-193696.489120     8249181.399974
-193720.192727     8249186.146164
-193745.137970     8249191.538116
-193764.472412     8249195.591300
-193776.924792     8249199.538839
-193793.121597     8249204.169795
-193813.091663     8249207.606799
-193839.985040     8249208.646332
-193867.503168     8249209.694692
-193887.433502     8249215.635598
-193901.752270     8249220.237725
-193922.771634     8249236.212633
-193941.359083     8249247.767887
-193978.029979     8249263.356357
-194012.076596     8249286.418843
-194034.458337     8249295.527065
-194056.860307     8249303.384488
-194078.051780     8249308.718053
-194104.269036     8249312.877657
-194125.469866     8249317.585428
-194146.641085     8249324.171319
-194160.960617     8249328.773458
-194179.044040     8249332.808202
-194193.988311     8249337.419930
-194213.989517     8249338.978837
-194232.738940     8249340.519292
-194258.390680     8249340.913064
-194274.677836     8249339.910445
-194293.508253     8249336.443119
-194312.984415     8249331.733831
-194344.893478     8249332.223657
-194372.431862     8249332.019690
-194391.888545     8249328.561977
-194416.935025     8249327.694584
-194446.966051     8249328.155581
-194477.623344     8249328.626192
-194504.455994     8249333.420416
-194526.252716     8249340.015909
-194542.458878     8249344.021072
-194557.454519     8249345.503904
-194578.019725     8249350.827854
-194594.842021     8249355.469176
-194612.269577     8249361.371663
-194636.517694     8249371.135237
-194650.827104     8249376.363157
-194672.038056     8249380.445146
-194686.418314     8249381.292594
-194704.571859     8249380.944563
-194718.972372     8249380.539684
-194731.566471     8249375.724752
-194733.019949     8249363.225266
-194733.283172     8249346.950359
-194714.283565     8249322.241808
-194705.827173     8249303.329300
-194701.670613     8249289.491058
-194700.036308     8249274.439660
-194700.400754     8249251.906172
-194701.906377     8249236.277038
-194704.641225     8249221.919411
-194706.195939     8249203.160581
-194710.183333     8249188.821417
-194718.620873     8249170.168243
-194725.795758     8249152.121624
-194730.397757     8249138.418596
-194737.452692     8249127.882908
-194748.998257     8249110.530082
-194756.122524     8249095.613135
-194763.248318     8249080.696211
-194772.280222     8249063.930736
-194780.707641     8249045.903344
-194790.315194     8249032.277155
-194800.457911     8249024.293379
-194808.228687     8249008.134482
-194809.763159     8248990.627215
-194815.658189     8248974.439524
-194817.111667     8248961.940038
-194836.576944     8248957.856520
-194850.957215     8248958.703205
-194865.337486     8248959.549889
-194887.831334     8248961.773761
-194907.165013     8248965.826933
-194925.249212     8248969.860924
-194942.060623     8248975.128016
-194955.198481     8248975.329691
-194970.850012     8248974.943252
-194990.892466     8248973.999043
-195007.158604     8248974.248740
-195017.000000     8248976.963678
-END
-LINE3D
-HEIGHT 1010.000000
-195017.000000     8249037.008800
-195011.151799     8249036.919026
-194998.426088     8249049.871412
-194996.901737     8249066.752897
-195009.202263     8249080.089453
-195017.000000     8249086.533439
-END
-LINE3D
-HEIGHT 1010.000000
-195017.000000     8252434.473920
-194999.895687     8252441.423277
-194967.774031     8252454.077922
-194921.869536     8252467.772864
-194886.074314     8252475.362856
-194867.870165     8252478.839796
-194849.716633     8252479.187064
-194834.618980     8252483.964329
-194810.067156     8252492.978789
-194784.970059     8252496.975855
-194770.488553     8252502.388515
-194752.747155     8252515.890608
-194740.718583     8252524.470608
-194718.587779     8252538.531257
-194685.083505     8252559.304152
-194632.215190     8252577.901219
-194597.561145     8252592.395565
-194575.602449     8252595.814870
-194547.326454     8252602.893587
-194509.593984     8252614.210227
-194479.309868     8252629.397592
-194450.296238     8252643.352585
-194431.960476     8252654.966979
-194405.550870     8252662.700282
-194385.983581     8252673.043897
-194368.262438     8252685.293663
-194347.322676     8252703.128218
-194328.905158     8252719.750381
-194314.292052     8252733.299731
-194302.828232     8252745.645551
-194290.041770     8252762.354155
-194276.003549     8252779.042779
-194253.569037     8252811.881463
-194231.195277     8252840.963928
-194215.957431     8252854.503688
-194198.216034     8252868.005781
-194177.962515     8252882.094484
-194158.414716     8252891.185759
-194144.004834     8252892.217196
-194119.604100     8252891.842628
-194103.337199     8252891.592919
-194078.936465     8252891.218351
-194062.104799     8252887.203587
-194035.332900     8252878.653145
-194022.214521     8252877.199895
-194012.366166     8252867.030666
-194003.910537     8252848.118170
-193994.819272     8252829.822618
-193987.019523     8252809.041615
-193986.616734     8252795.261760
-193981.370378     8252771.389504
-193971.007865     8252754.326311
-193954.266550     8252744.677972
-193939.372909     8252736.935807
-193912.773106     8252717.744785
-193885.659157     8252691.659035
-193875.266280     8252676.473188
-193862.340251     8252663.127029
-193849.312223     8252656.040204
-193833.217429     8252645.149152
-193818.211656     8252644.292865
-193796.384558     8252639.575481
-193763.962112     8252632.190938
-193745.888810     8252627.530412
-193724.000974     8252626.568481
-193708.359576     8252626.328375
-193692.728299     8252625.462487
-193680.215180     8252625.270402
-193657.056095     8252625.540831
-193630.031107     8252632.638751
-193609.253308     8252640.459271
-193593.490432     8252647.730073
-193580.178938     8252658.169718
-193566.313578     8252664.217774
-193544.858906     8252675.157589
-193516.562657     8252683.488633
-193493.261840     8252692.522297
-193476.257314     8252699.148101
-193461.151068     8252704.551172
-193455.337783     8252715.731857
-193454.449069     8252731.996399
-193454.216222     8252746.393197
-193453.872030     8252767.674358
-193458.583233     8252785.903437
-193462.770932     8252797.863582
-193467.583371     8252809.833317
-193475.383133     8252830.613556
-193483.161876     8252852.646110
-193487.329321     8252865.858582
-193493.998791     8252879.108698
-193498.165484     8252892.320394
-193497.952892     8252905.464865
-193493.219280     8252927.305346
-193492.381184     8252940.440216
-193486.527402     8252954.124792
-193481.955766     8252965.950474
-193476.122238     8252978.382723
-193468.330456     8252995.793172
-193464.313463     8253012.009692
-193457.722820     8253032.569792
-193453.766566     8253045.030859
-193449.769815     8253059.995816
-193444.521293     8253074.941557
-193440.565039     8253087.402623
-193435.326651     8253101.721819
-193430.694276     8253117.302955
-193425.425512     8253133.500260
-193418.905730     8253149.679125
-193408.551196     8253170.806620
-193398.650045     8253202.585825
-193386.902772     8253232.457352
-193375.921959     8253253.575997
-193370.694456     8253267.269423
-193365.486431     8253279.711273
-193353.920612     8253298.316426
-193345.554696     8253312.588376
-193331.506342     8253329.903546
-193319.406898     8253342.865546
-193310.465345     8253353.997446
-193294.026335     8253364.389082
-193283.258127     8253372.362492
-193266.859614     8253380.250238
-193256.071916     8253389.475987
-193247.140484     8253399.982106
-193243.174096     8253413.069718
-193242.335236     8253426.204575
-193246.492572     8253440.042064
-193263.172384     8253453.445846
-193276.169273     8253462.410768
-193292.254709     8253473.927614
-193304.009962     8253482.246776
-193317.562245     8253495.603311
-193336.018095     8253515.295255
-193354.403084     8253539.368434
-193369.639539     8253564.645919
-193385.653351     8253580.543989
-193399.204870     8253593.900513
-193413.998052     8253607.901271
-193428.094857     8253626.274426
-193448.265241     8253656.009974
-193464.601613     8253690.695691
-193480.453450     8253716.608560
-193499.524669     8253736.936651
-193524.196581     8253759.228528
-193546.991983     8253781.491599
-193563.519941     8253804.284398
-193579.341403     8253832.075375
-193600.925532     8253851.815340
-193620.714132     8253866.519482
-193641.147727     8253879.980886
-193666.576753     8253894.144911
-193685.689233     8253911.969123
-193696.687371     8253928.416136
-193703.316344     8253944.170143
-193709.935959     8253960.549942
-193720.944218     8253976.371174
-193738.825182     8253992.923843
-193761.700802     8254010.179885
-193789.420012     8254037.526800
-193806.412250     8254070.344775
-193821.770196     8254088.110588
-193839.681523     8254102.785912
-193860.771748     8254114.379585
-193883.748616     8254125.375519
-193908.673617     8254132.019034
-193934.203879     8254139.923714
-193955.334601     8254149.013496
-193979.532863     8254161.906754
-194004.316132     8254177.313505
-194032.832941     8254194.029441
-194050.169383     8254205.565491
-194068.160941     8254215.233023
-194081.834715     8254221.077886
-194098.091495     8254221.953376
-194118.102058     8254222.886489
-194136.810997     8254226.930071
-194162.342010     8254234.835527
-194183.522599     8254240.794862
-194200.889416     8254250.452803
-194222.050501     8254257.665240
-194236.207294     8254272.282165
-194251.706960     8254281.285507
-194257.155787     8254292.639074
-194261.837390     8254312.745510
-194260.918301     8254330.888161
-194244.306431     8254351.920365
-194232.267726     8254361.126911
-194215.232838     8254369.630060
-194201.256108     8254382.564006
-194200.932158     8254402.593604
-194206.259507     8254421.458078
-194210.284468     8254443.433010
-194213.835779     8254456.009323
-194223.663892     8254467.430115
-194239.133194     8254478.310801
-194261.465068     8254490.549472
-194261.211978     8254506.197833
-194252.541603     8254539.247042
-194241.308465     8254576.014061
-194235.474937     8254588.446309
-194218.884074     8254608.226963
-194206.107745     8254624.309021
-194187.619366     8254645.312420
-194173.520406     8254665.756498
-194158.573982     8254699.962003
-194141.296112     8254723.488497
-194130.356560     8254742.103263
-194107.377538     8254769.924563
-194092.068057     8254787.846311
-194081.794504     8254803.966789
-194077.080384     8254824.554931
-194063.113787     8254836.862332
-194049.782803     8254848.554316
-194031.405805     8254862.671061
-194005.994867     8254886.072706
-193985.518622     8254913.932426
-193967.797479     8254926.182191
-193948.805088     8254939.664316
-193938.632758     8254949.526213
-193929.681085     8254961.283895
-193909.508547     8254970.365580
-193867.769192     8254997.273724
-193831.600931     8255028.023009
-193801.194574     8255050.721270
-193781.242596     8255084.849936
-193753.247888     8255113.220943
-193718.381251     8255140.859760
-193699.731661     8255171.877970
-193685.612447     8255193.574375
-193672.099258     8255216.531958
-193659.796590     8255242.011871
-193644.991886     8255267.454905
-193628.157290     8255302.258126
-193613.393095     8255325.196505
-193598.245588     8255333.103454
-193585.509756     8255346.681622
-193567.193486     8255357.043677
-193552.086488     8255362.445971
-193538.836497     8255369.130174
-193514.364903     8255373.136842
-193482.304750     8255382.036044
-193460.860200     8255392.350077
-193429.354665     8255405.641645
-193409.676044     8255422.868858
-193393.984028     8255425.758424
-193368.866663     8255431.008581
-193350.096986     8255430.720453
-193336.353103     8255429.257601
-193309.520477     8255424.461849
-193290.760908     8255423.548706
-193278.308541     8255419.600401
-193262.041640     8255419.350692
-193240.153791     8255418.389526
-193225.763399     8255418.168623
-193212.564051     8255421.721626
-193194.510979     8255415.810301
-193178.355447     8255408.674703
-193165.358545     8255399.710544
-193151.079523     8255392.603751
-193138.738500     8255381.771086
-193103.782914     8255376.225468
-193078.131174     8255375.831696
-193064.356916     8255376.246953
-193042.266620     8255387.802947
-193025.150738     8255401.313878
-193004.362806     8255409.760944
-192971.030640     8255419.892494
-192948.264224     8255434.568559
-192928.040304     8255446.779905
-192917.888217     8255455.390239
-192903.286009     8255468.313055
-192873.727868     8255477.250665
-192848.499160     8255489.385184
-192832.070271     8255499.151039
-192818.174535     8255507.077203
-192793.097680     8255509.822705
-192774.267275     8255513.289268
-192767.212329     8255523.825720
-192762.529335     8255542.536529
-192765.999678     8255560.119095
-192775.807548     8255572.791450
-192786.917807     8255582.353348
-192808.058649     8255590.817349
-192820.480641     8255596.643761
-192834.789300     8255601.870906
-192845.274055     8255611.423202
-192847.564227     8255624.606857
-192838.974833     8255652.649048
-192821.576250     8255683.686461
-192806.236405     8255703.485554
-192793.277834     8255730.835502
-192769.632061     8255761.150315
-192752.415707     8255780.920603
-192737.772226     8255796.348062
-192728.043171     8255817.486687
-192716.528733     8255832.962179
-192707.536574     8255847.222987
-192707.303727     8255861.619786
-192703.124759     8255887.851105
-192688.066201     8255928.942488
-192674.965910     8255965.054908
-192667.225497     8255979.336460
-192648.676379     8256004.095313
-192627.664994     8256026.311092
-192608.480240     8256051.686889
-192595.663414     8256070.272838
-192575.298538     8256091.246667
-192554.862777     8256116.603260
-192531.267622     8256143.788401
-192511.991765     8256174.796996
-192491.302915     8256215.801951
-192451.904375     8256252.762548
-192423.213303     8256285.505189
-192409.619121     8256313.470553
-192404.885509     8256335.311035
-192398.294892     8256355.869607
-192385.457799     8256375.708648
-192370.006610     8256402.392103
-192345.340499     8256457.109675
-192318.303987     8256503.651386
-192299.684009     8256532.791475
-192284.717318     8256568.250071
-192266.813970     8256591.765435
-192260.344806     8256604.814627
-192248.345821     8256611.518035
-192230.625442     8256623.767812
-192214.741088     8256638.549521
-192199.512587     8256651.464252
-192180.882501     8256681.229358
-192165.289542     8256716.678341
-192151.928207     8256730.246907
-192137.991986     8256740.676198
-192118.494805     8256746.637801
-192083.306372     8256755.488982
-192078.023025     8256785.514335
-END
-LINE3D-MASTER
-HEIGHT 1000.000000
-191770.932099     8248364.845893
-191795.857100     8248371.489408
-191810.852741     8248372.972240
-191830.318794     8248368.887970
-191853.548745     8248364.235923
-191871.067417     8248364.504847
-191884.841663     8248364.090354
-191896.800144     8248359.891220
-191909.374002     8248356.327851
-191931.271959     8248356.664000
-191946.287854     8248356.894505
-191964.442156     8248356.546867
-191978.852033     8248355.515812
-191997.621710     8248355.803940
-192011.396720     8248355.389459
-192029.480156     8248359.423439
-192039.994517     8248367.097997
-192059.359328     8248369.273453
-192074.950109     8248372.643232
-192091.217010     8248372.892940
-192103.730129     8248373.085025
-192118.120520     8248373.305928
-192133.085797     8248376.666105
-192146.102929     8248384.379464
-192161.602607     8248393.382042
-192180.129316     8248408.692750
-192195.124957     8248410.175582
-192213.208392     8248414.209561
-192230.726300     8248414.478474
-192252.806487     8248403.547496
-192262.363422     8248393.050980
-192272.515496     8248384.441410
-192286.563844     8248367.126622
-192291.771105     8248354.684760
-192305.890318     8248332.988354
-192314.256228     8248318.716786
-192325.054818     8248308.864885
-192335.862766     8248298.387190
-192343.533070     8248288.487649
-192354.895654     8248282.401174
-192370.719275     8248271.374537
-192376.028536     8248252.673341
-192377.542759     8248236.418020
-192379.027370     8248222.040819
-192379.260211     8248207.644403
-192375.708136     8248195.068078
-192360.976464     8248177.311497
-192349.250829     8248167.113833
-192333.176272     8248154.971599
-192318.937734     8248145.361679
-192308.453743     8248135.809394
-192303.025158     8248123.204264
-192291.289396     8248113.632764
-192284.014672     8248099.121101
-192274.276904     8248082.067116
-192274.540121     8248065.792591
-192316.107263     8247856.064631
-192323.776804     8247846.165079
-192332.758859     8247832.528906
-192340.458775     8247820.751245
-192351.862614     8247812.161273
-192375.102692     8247806.883062
-192387.061174     8247802.683928
-192402.097317     8247801.662487
-192420.877116     8247801.324833
-192437.133897     8247802.200323
-192460.828134     8247807.573071
-192486.419135     8247811.722297
-192514.442046     8247820.291560
-192533.715743     8247828.100580
-192547.944160     8247838.336281
-192566.511367     8247851.143099
-192589.498349     8247861.513632
-192609.973198     8247872.471540
-192634.817212     8247884.122454
-192652.667043     8247902.552839
-192671.779523     8247920.377051
-192685.956558     8247933.742413
-192702.687751     8247944.016533
-192718.782551     8247954.907204
-192745.492947     8247967.213088
-192761.649255     8247974.347934
-192777.804793     8247981.483151
-192795.150605     8247992.392644
-192819.429855     8248000.278502
-192839.441176     8248001.212009
-192863.841146     8248001.586566
-192882.610823     8248001.874693
-192905.124927     8248002.846238
-192925.155732     8248002.527787
-192943.945658     8248001.563970
-192965.278858     8247998.134681
-192982.857504     8247994.648139
-193006.693474     8247991.257652
-193024.272891     8247987.770739
-193046.191097     8247986.854943
-193060.600967     8247985.824271
-193079.390893     8247984.860453
-193110.048186     8247985.331064
-193137.577200     8247985.753654
-193163.228940     8247986.147426
-193181.312376     8247990.181406
-193196.943646     8247991.047676
-193211.323153     8247991.894348
-193230.032092     8247995.937930
-193258.075246     8248003.255630
-193286.764921     8248009.330616
-193312.335668     8248014.732170
-193334.162765     8248019.449555
-193367.867344     8248024.975968
-193399.028663     8248032.967089
-193430.815478     8248040.968194
-193473.803666     8248052.897634
-193514.228333     8248068.544491
-193538.486571     8248077.682283
-193554.673249     8248082.939402
-193571.494787     8248087.580330
-193587.126064     8248088.446218
-193600.224189     8248091.151796
-193620.810401     8248095.224195
-193644.524129     8248099.344604
-193659.469158     8248103.956726
-193679.944007     8248114.914634
-193693.021889     8248118.871775
-193720.973934     8248131.822656
-193740.923752     8248136.511605
-193755.939647     8248136.742110
-193780.965884     8248137.126280
-193797.313773     8248132.368589
-193812.955171     8248132.608695
-193830.494091     8248131.625674
-193846.771114     8248131.249601
-193864.289785     8248131.518525
-193888.135118     8248127.501862
-193915.664132     8248127.924451
-193939.500102     8248124.533964
-193962.084307     8248121.123879
-193983.427628     8248117.068808
-194009.775731     8248113.090946
-194029.262027     8248107.755113
-194041.795394     8248106.695253
-194055.096754     8248096.882153
-194062.847288     8248081.974819
-194067.439167     8248068.897573
-194075.815968     8248053.999853
-194084.233259     8248036.598624
-194088.855514     8248021.643269
-194096.727526     8247999.225028
-194097.647379     8247981.082389
-194097.991577     8247959.800846
-194098.305411     8247940.396648
-194092.494286     8247912.759718
-194082.120894     8247896.321914
-194071.031641     8247885.508464
-194059.235141     8247879.692417
-194045.541118     8247875.099499
-194025.056906     8247864.767767
-194005.742712     8247859.462638
-193987.709900     8247852.298604
-193968.486822     8247841.359912
-193942.411286     8247828.437836
-193923.945316     8247809.371674
-193911.766274     8247788.523828
-193900.111500     8247773.944929
-193884.057191     8247760.550749
-193856.105146     8247747.599868
-193834.450157     8247732.241139
-193817.780472     8247718.211194
-193803.643170     8247702.341930
-193788.870237     8247687.089227
-193777.266851     8247669.380285
-193765.622197     8247654.175604
-193753.291302     8247642.716774
-193740.980655     8247630.006000
-193730.495900     8247620.453703
-193720.617169     8247612.162584
-193704.562860     8247598.768404
-193688.640163     8247577.236771
-193672.020327     8247560.077524
-193653.574605     8247539.759417
-193637.016277     8247518.844346
-193613.504263     8247502.204854
-193597.520821     8247484.429057
-193584.615040     8247469.830953
-193569.862362     8247453.325923
-193557.703568     8247431.226132
-193546.786418     8247409.771719
-193538.925923     8247392.746552
-193529.118053     8247380.074197
-193518.673794     8247368.018010
-193497.059296     8247350.155772
-193484.072528     8247340.565068
-193467.362346     8247329.039014
-193450.147382     8247309.992056
-193433.558685     8247290.954711
-193421.954529     8247273.246139
-193409.028506     8247259.899599
-193394.911446     8247242.778772
-193376.425233     8247224.964173
-193362.258319     8247210.973029
-193347.556259     8247191.338327
-193337.839497     8247173.032791
-193330.665250     8247152.261390
-193320.312864     8247134.572033
-193312.482739     8247115.669139
-193302.130352     8247097.979783
-193290.516075     8247080.896992
-193278.982785     8247058.806803
-193266.259227     8247032.941955
-193249.034142     8247014.520779
-193233.736942     8246992.999130
-193217.158372     8246973.335622
-193202.980573     8246959.970248
-193197.562880     8246946.738966
-193180.358037     8246927.066226
-193167.502874     8246909.338450
-193152.246170     8246885.312911
-193135.616219     8246868.779063
-193120.763062     8246858.533772
-193107.220894     8246844.551836
-193088.754923     8246825.485674
-193069.703946     8246803.906020
-193055.042377     8246781.767809
-193044.003742     8246767.824687
-193034.225484     8246753.274211
-193018.908035     8246733.004507
-192997.919810     8246715.151501
-192981.884986     8246700.505364
-192967.728199     8246685.888057
-192952.350011     8246669.373807
-192937.759308     8246642.853978
-192925.539775     8246624.509641
-192913.269619     8246609.295358
-192900.343596     8246595.948818
-192884.289287     8246582.554638
-192870.121616     8246568.563101
-192856.004562     8246551.441891
-192844.451787     8246530.603658
-192837.872668     8246511.719968
-192829.397555     8246494.059429
-192818.429029     8246475.734295
-192809.973401     8246456.821799
-192800.912518     8246436.647756
-192792.487259     8246415.857533
-192784.749006     8246391.321470
-192775.092989     8246369.260097
-192763.509081     8246350.299580
-192754.962344     8246337.020265
-192750.149135     8246325.050901
-192739.766380     8246309.239271
-192730.705497     8246289.065228
-192725.509429     8246277.000000
-END
-LINE3D-MASTER
-HEIGHT 1000.000000
-193863.147324     8246277.000000
-193868.502602     8246284.618066
-193876.433200     8246297.261604
-193884.949573     8246312.418264
-193895.968717     8246327.613725
-193904.504569     8246341.518810
-193911.668700     8246362.915611
-193915.855636     8246374.875744
-193921.142488     8246396.244109
-193930.909868     8246411.419973
-193938.104362     8246430.939429
-193952.795544     8246451.199519
-193963.804567     8246467.020762
-193981.614658     8246487.955431
-194001.341762     8246506.414633
-194019.746988     8246529.236631
-194033.894417     8246544.479732
-194043.086906     8246556.516703
-194054.125534     8246570.460208
-194071.431613     8246583.873603
-194083.843496     8246590.325032
-194098.031416     8246603.064624
-194133.278434     8246629.275223
-194164.680555     8246661.061761
-194181.966379     8246675.727483
-194194.953147     8246685.318188
-194206.073533     8246694.253922
-194219.635186     8246706.983901
-194240.150532     8246715.437917
-194260.100350     8246720.126867
-194281.866702     8246728.600087
-194295.559960     8246733.192994
-194308.002213     8246737.766697
-194320.959375     8246749.235140
-194334.510901     8246762.591282
-194346.256790     8246771.536618
-194359.243558     8246781.127323
-194387.831227     8246793.462024
-194407.135300     8246799.392934
-194422.746322     8246801.511150
-194444.725273     8246796.839518
-194461.628563     8246796.473058
-194479.833476     8246792.996130
-194512.478642     8246786.610038
-194535.698472     8246782.583773
-194551.976258     8246782.207711
-194572.784421     8246772.509846
-194591.726200     8246762.157012
-194603.694803     8246757.332095
-194623.170978     8246752.622044
-194645.836165     8246744.204941
-194660.873072     8246743.183512
-194676.060305     8246732.773043
-194689.230060     8246731.097014
-194703.710039     8246725.684330
-194716.940533     8246720.252848
-194743.379757     8246710.641042
-194755.963736     8246706.451891
-194771.051261     8246702.300790
-194784.199246     8246701.876301
-194801.152390     8246698.380158
-194819.236589     8246702.414149
-194832.303581     8246706.997442
-194845.392349     8246710.328813
-194865.978554     8246714.401594
-194891.568792     8246718.550809
-194910.247355     8246724.472500
-194928.915797     8246731.019972
-194946.969627     8246736.931691
-194964.407311     8246742.208014
-194985.608135     8246746.916167
-195006.808960     8246751.624320
-195017.000000     8246753.760645
-END
-LINE3D-MASTER
-HEIGHT 1000.000000
-195017.000000     8255986.006361
-195009.298154     8256000.261844
-194999.096213     8256012.001862
-194989.498793     8256025.001505
-194976.045567     8256044.204386
-194960.019468     8256067.750095
-194937.574847     8256101.213796
-194919.610748     8256128.485378
-194907.521425     8256140.821596
-194902.878916     8256157.029278
-194887.004671     8256171.185970
-194872.884693     8256192.882364
-194846.879391     8256214.396310
-194829.107630     8256229.775748
-194815.141034     8256242.083148
-194803.767577     8256248.794629
-194792.414338     8256254.256075
-194781.010505     8256262.845665
-194766.439412     8256273.891912
-194742.481952     8256284.794072
-194707.838028     8256298.662636
-194678.753537     8256316.998865
-194650.366198     8256330.961943
-194618.799937     8256348.008201
-194575.829843     8256373.644049
-194547.452588     8256386.983639
-194526.584450     8256400.436970
-194502.586506     8256413.842256
-194480.445592     8256428.527923
-194456.356521     8256447.567536
-194430.461824     8256462.195580
-194414.043069     8256471.334889
-194402.608837     8256481.804116
-194391.205004     8256490.393706
-194379.791802     8256499.609853
-194368.962855     8256511.338718
-194348.739699     8256523.550075
-194328.425416     8256541.395760
-194306.808770     8256562.350374
-194287.775870     8256578.337154
-194275.029904     8256592.541867
-194256.673149     8256605.407048
-194228.921422     8256618.754711
-194211.251660     8256627.874816
-194197.355160     8256635.800969
-194183.530284     8256639.345898
-194170.824827     8256651.045957
-194152.437672     8256665.790775
-194135.958190     8256678.684774
-194113.837519     8256692.118878
-194098.619152     8256704.407062
-194076.589584     8256712.208367
-194060.867192     8256716.976042
-194048.908716     8256721.174794
-194021.833874     8256731.402399
-194002.962960     8256737.373616
-193982.860519     8256742.074054
-193960.891701     8256746.119141
-193933.281694     8256750.704332
-193898.164121     8256755.174278
-193876.830916     8256758.603949
-193859.867651     8256762.725874
-193826.011218     8256766.588477
-193806.595795     8256767.542311
-193780.257800     8256770.895155
-193763.243154     8256778.146741
-193742.455246     8256786.592279
-193729.810516     8256794.537648
-193714.663010     8256802.444597
-193698.890000     8256810.341944
-193689.353308     8256819.586897
-193671.006661     8256831.827061
-193656.454307     8256841.620193
-193636.907273     8256850.711480
-193616.078856     8256861.661673
-193587.014607     8256878.746338
-193556.145473     8256891.420974
-193537.859578     8256899.904920
-193524.619720     8256905.962578
-193511.985124     8256913.281400
-193501.206770     8256921.882120
-193479.258194     8256924.675644
-193454.140855     8256929.924272
-193435.976438     8256930.897310
-193423.463320     8256930.705225
-193410.334807     8256929.878520
-193387.811346     8256929.532769
-193369.667171     8256929.254243
-193352.764658     8256929.619951
-193335.185235     8256933.107245
-193315.113933     8256935.929586
-193289.452084     8256936.160831
-193276.181087     8256944.096586
-193259.914186     8256943.846878
-193242.315285     8256948.585747
-193229.115148     8256952.140266
-193205.945942     8256953.036477
-193188.992811     8256956.531856
-193176.348081     8256964.477225
-193163.743835     8256969.919467
-193158.962766     8256986.091834
-193153.438372     8257015.742421
-END
-LINE3D-MASTER
-HEIGHT 1000.000000
-191766.552813     8248364.778668
-191746.199442     8248346.309852
-191729.388025     8248341.043143
-191704.432654     8248336.277355
-191687.065836     8248326.619414
-191675.935329     8248318.309461
-191661.697555     8248308.699553
-191644.885380     8248303.432449
-191631.767001     8248301.979199
-191610.000655     8248293.505596
-191596.246651     8248292.668526
-191583.794271     8248288.720986
-191562.714168     8248276.501532
-191545.418216     8248262.461973
-191531.886932     8248247.854268
-191517.779999     8248230.107276
-191506.802110     8248212.408318
-191501.393774     8248198.551242
-191497.277705     8248182.209492
-191493.110248     8248168.997784
-191489.558936     8248156.421471
-191481.164047     8248133.753521
-191477.078347     8248115.534044
-191462.477517     8248089.640379
-191452.115009     8248072.576804
-191437.311713     8248059.201446
-191425.616442     8248047.126437
-191416.525189     8248028.830121
-191403.771262     8248004.843001
-191396.526144     8247988.453599
-191382.974617     8247975.097457
-191371.854232     8247966.161722
-191349.523122     8247953.923064
-191333.993080     8247946.797831
-191317.353765     8247930.890159
-191298.211674     8247914.944068
-191280.290219     8247900.894907
-191268.483591     8247895.705024
-191255.436084     8247889.869774
-191241.742062     8247885.276856
-191223.598651     8247884.998342
-191201.074426     8247884.652579
-191187.249556     8247888.197126
-191170.235674     8247895.448724
-191150.819481     8247896.402928
-191134.532331     8247897.405165
-191113.290246     8247895.200891
-191099.153708     8247879.331638
-191098.165154     8247863.037897
-191094.613843     8247850.461585
-191094.190811     8247837.933293
-191088.812845     8247822.198491
-191088.420183     8247807.792473
-191081.246694     8247787.021465
-191071.731646     8247756.196846
-191059.694331     8247726.586146
-191054.317128     8247710.851355
-191042.107717     8247691.881236
-191032.955725     8247677.340374
-191028.294370     8247655.981992
-191026.054810     8247639.669048
-191021.938735     8247623.327679
-191017.247011     8247603.847025
-191012.505438     8247587.495672
-191006.704440     8247559.232578
-191006.381880     8247540.444931
-191002.972295     8247519.105765
-190999.532347     8247499.643944
-190994.739387     8247486.422634
-190994.972228     8247472.026218
-190995.275936     8247453.248183
-190995.620140     8247431.966259
-190995.913726     8247413.814006
-190996.116198     8247401.295317
-190997.106911     8247378.771442
-190994.535428     8247344.297025
-190993.546869     8247328.003666
-190985.121616     8247307.213061
-190972.871708     8247290.746833
-190960.642048     8247273.028659
-190956.505731     8247257.938853
-190952.339037     8247244.727157
-190948.797090     8247231.524669
-190944.650645     8247217.061028
-190939.292927     8247200.074280
-190926.518751     8247177.339105
-190920.535530     8247160.342755
-190910.768150     8247145.166891
-190904.088559     8247132.542557
-190895.027676     8247112.368514
-190884.654284     8247095.930709
-190879.882336     8247081.457466
-190865.785524     8247063.084693
-190861.073557     8247044.855602
-190854.393966     8247032.231268
-190842.204803     8247012.009203
-190821.296796     8246989.149168
-190807.059021     8246979.539260
-190791.599846     8246968.032410
-190769.904360     8246955.177571
-190746.896365     8246946.058971
-190726.402032     8246936.353021
-190713.465882     8246923.632644
-190698.006707     8246912.125794
-190675.765941     8246894.253942
-190657.310098     8246874.561617
-190638.712522     8246863.632527
-190614.474527     8246853.243171
-190591.496902     8246842.246844
-190569.760919     8246831.895897
-190557.318667     8246827.322194
-190541.122632     8246822.690868
-190526.268711     8246812.445565
-190508.902657     8246802.787635
-190498.448272     8246791.357612
-190484.311733     8246775.488359
-190467.117017     8246755.189456
-190451.103205     8246739.291386
-190437.500298     8246729.064904
-190425.704555     8246723.249252
-190410.265628     8246710.490456
-190400.426624     8246699.695816
-190379.397902     8246684.346701
-190356.501264     8246668.342974
-190336.128408     8246651.126116
-190320.740100     8246635.237648
-190305.382167     8246617.471070
-190291.789374     8246606.619189
-190278.106243     8246601.400119
-190261.334552     8246593.629889
-190247.651421     8246588.410819
-190229.053839     8246577.482111
-190229.256311     8246564.963421
-190225.089623     8246551.751343
-190220.912045     8246539.165417
-190207.360513     8246525.809657
-190190.578708     8246518.664826
-190169.881903     8246521.477565
-190144.713933     8246529.856630
-190127.104147     8246535.221270
-190107.658348     8246538.053212
-190087.637664     8246537.745881
-190062.611427     8246537.361710
-190038.210693     8246536.987142
-190013.890953     8246531.604792
-189988.239212     8246531.211020
-189966.906013     8246534.640309
-189950.618863     8246535.642546
-189938.055127     8246538.580133
-189909.839871     8246541.903396
-189887.316410     8246541.557645
-189858.525506     8246541.741621
-189836.002045     8246541.395870
-189815.295113     8246544.834773
-189794.577295     8246548.899445
-189772.679338     8246548.563296
-189743.889197     8246548.747284
-189717.611190     8246548.343899
-189696.339499     8246548.017363
-189673.815275     8246547.671601
-189652.543584     8246547.345065
-189626.285825     8246545.689734
-189601.945830     8246541.559712
-189582.570898     8246540.010037
-189564.497590     8246535.349893
-189551.429834     8246530.766588
-189537.050327     8246529.919916
-189523.356305     8246525.326997
-189505.929506     8246519.424904
-189490.399471     8246512.299289
-189475.667034     8246494.542696
-189463.477872     8246474.320632
-189453.821855     8246452.259259
-189444.033469     8246438.334947
-189433.569720     8246427.531099
-189418.685436     8246419.163141
-189400.753854     8246405.740144
-189372.862548     8246389.033809
-189350.017292     8246369.900422
-189325.940514     8246349.495874
-189303.075009     8246331.614433
-189283.872178     8246319.423795
-189196.259589     8246277.000000
-END
-LINE3D-MASTER
-HEIGHT 1000.000000
-188457.180542     8246277.000000
-188457.230394     8246277.307964
-188457.612929     8246292.340146
-188457.400336     8246305.484617
-188457.137119     8246321.759142
-188456.732176     8246346.796521
-188451.342692     8246370.505127
-188444.762177     8246390.439064
-188438.242407     8246406.617165
-188431.107256     8246422.159882
-188424.557110     8246440.216092
-188419.207359     8246461.420796
-188407.580794     8246483.781785
-188401.081273     8246498.707940
-188390.898829     8246509.195237
-188380.070633     8246520.924877
-188365.447400     8246535.100391
-188355.900587     8246544.971126
-188346.313276     8246557.345751
-188334.839329     8246570.317735
-188322.749242     8246582.653941
-188314.352199     8246598.803224
-188309.155059     8246610.619305
-188305.773690     8246626.219645
-188300.474557     8246644.294677
-188295.781436     8246663.631650
-188295.568844     8246676.776121
-188310.675090     8246671.373051
-188320.292770     8246657.120698
-188329.849711     8246646.623800
-188347.672089     8246628.114689
-188360.942316     8246620.179305
-188379.157357     8246616.076213
-188396.211737     8246606.320724
-188412.015110     8246596.546032
-188435.962442     8246586.270036
-188458.062871     8246574.087496
-188471.262238     8246570.533347
-188485.037248     8246570.118866
-188501.314270     8246569.742793
-188527.510526     8246575.153566
-188549.347745     8246579.245169
-188564.242156     8246586.986964
-188584.696756     8246599.196816
-188598.883913     8246611.936397
-188617.491616     8246622.239323
-188639.187102     8246635.094162
-188657.744187     8246648.526760
-188673.172986     8246661.911720
-188691.699702     8246677.222046
-188709.651526     8246689.393479
-188728.198484     8246703.452242
-188745.453945     8246719.995309
-188763.980654     8246735.306017
-188778.803441     8246747.429035
-188793.596616     8246761.430175
-188810.922937     8246773.592006
-188829.540761     8246783.269151
-188846.886567     8246794.179026
-188864.909263     8246801.968459
-188889.198634     8246809.228536
-188909.703859     8246818.308335
-188930.864186     8246825.520378
-188950.743908     8246834.590575
-188971.915126     8246841.176467
-188994.296854     8246850.285453
-189023.601142     8246856.996193
-189047.850022     8246866.759779
-189070.938247     8246870.870586
-189089.637058     8246875.540331
-189110.233391     8246878.986949
-189129.567827     8246883.040514
-189147.066256     8246884.561001
-189163.938413     8246886.072257
-189179.579811     8246886.312363
-189195.846712     8246886.562072
-189212.114377     8246886.811792
-189231.509558     8246887.109521
-189257.786802     8246887.512896
-189274.760957     8246882.764818
-189290.412476     8246882.379143
-189304.257595     8246877.582651
-189323.098133     8246873.489543
-189350.001643     8246873.902530
-189380.648052     8246874.998911
-189404.362543     8246879.119332
-189423.676731     8246884.424843
-189442.980803     8246890.355753
-189464.131773     8246898.193591
-189482.790094     8246905.366845
-189497.735123     8246909.978967
-189515.727444     8246919.646510
-189524.909811     8246932.309263
-189530.953772     8246945.550159
-189537.017986     8246957.538727
-189547.208392     8246985.243264
-189554.382644     8247006.014283
-189563.473897     8247024.310600
-189571.313386     8247042.587318
-189579.860123     8247055.866633
-189592.008795     8247078.592207
-189607.921371     8247100.749621
-189622.613310     8247121.010105
-189639.889019     8247136.301227
-189651.532903     8247151.506279
-189662.643161     8247161.068177
-189681.785253     8247177.014269
-189695.993421     8247188.501915
-189709.585444     8247199.354167
-189721.966957     8247207.683324
-189741.220406     8247216.744289
-189767.265572     8247231.544091
-189789.556191     8247246.286258
-189805.671239     8247255.924984
-189821.251892     8247259.920926
-189839.325206     8247264.580688
-189861.787922     8247268.682275
-189881.112237     8247273.361622
-189897.298914     8247278.618741
-189909.710797     8247285.070171
-189932.728156     8247293.562596
-189953.294119     8247298.886940
-189980.751503     8247303.691136
-190011.963433     8247308.552966
-190030.672372     8247312.596548
-190049.381304     8247316.640512
-190066.203612     8247321.281070
-190094.186027     8247332.354224
-190127.142861     8247345.381932
-190148.899086     8247354.481316
-190165.599910     8247366.633164
-190184.116499     8247382.569653
-190197.133636     8247390.282630
-190209.484774     8247400.489896
-190233.067660     8247412.747388
-190258.547298     8247423.782123
-190269.666914     8247432.718228
-190289.445400     8247448.047769
-190299.929391     8247457.600054
-190310.424268     8247466.526569
-190320.232138     8247479.198924
-190330.574404     8247497.514062
-190343.399191     8247517.119947
-190355.013468     8247534.202737
-190369.150770     8247550.072002
-190374.488246     8247568.310313
-190379.229819     8247584.661665
-190383.911422     8247604.768101
-190392.810324     8247634.957325
-190403.585742     8247665.174973
-190413.283020     8247684.732466
-190422.878291     8247710.549675
-190433.714454     8247737.011486
-190447.578419     8247769.781058
-190463.521364     8247790.060745
-190487.588021     8247811.091075
-190508.384666     8247840.836619
-190525.406516     8247871.776473
-190546.122174     8247906.529416
-190566.928946     8247935.648795
-190588.381463     8247963.526214
-190617.250438     8247997.152060
-190647.905571     8248036.440286
-190671.154381     8248069.353540
-190686.461696     8248090.249789
-190698.055731     8248108.584143
-190713.927810     8248133.245448
-190737.267728     8248160.525520
-190753.261292     8248177.675536
-190766.782454     8248192.909023
-190782.201133     8248206.919764
-190798.174448     8248225.321725
-190809.778604     8248243.030297
-190815.207189     8248255.635427
-190829.364739     8248270.252746
-190852.764633     8248293.777353
-190874.358883     8248312.891536
-190887.284912     8248326.237694
-190898.354674     8248338.303483
-190914.297625     8248358.582789
-190930.189947     8248381.992531
-190944.912256     8248400.375288
-190963.418723     8248416.937559
-190989.403144     8248435.493197
-191009.079636     8248457.081689
-191034.265682     8248486.269058
-191056.293097     8248517.284987
-191073.508061     8248536.331945
-191093.265522     8248552.914184
-191112.479250     8248564.478288
-191127.352649     8248573.472016
-191142.186314     8248584.969646
-191160.128017     8248597.766862
-191175.587199     8248609.273330
-191193.528902     8248622.070545
-191217.676546     8248638.093475
-191241.177669     8248655.359119
-191264.074307     8248671.362846
-191282.045622     8248682.281940
-191299.392198     8248693.191444
-191314.871609     8248703.447113
-191332.863930     8248713.114656
-191352.783378     8248719.681333
-191367.032049     8248728.664706
-191384.993995     8248740.210358
-191404.176583     8248753.652559
-191416.466975     8248767.615661
-191430.725004     8248775.973242
-191454.953630     8248786.989154
-191474.894097     8248792.303515
-191489.888973     8248793.786335
-191510.465064     8248798.484516
-191530.364271     8248806.302756
-191545.863936     8248815.306097
-191562.625493     8248823.702873
-191579.366044     8248833.351200
-191605.512452     8248841.891276
-191624.745646     8248852.204568
-191646.471507     8248863.181298
-191665.018471     8248877.239678
-191689.186358     8248892.011045
-191710.861602     8248906.117447
-191736.361488     8248915.900236
-191754.394293     8248923.064652
-191773.052614     8248930.237906
-191786.745879     8248934.830431
-191801.116016     8248936.303661
-191816.070409     8248940.289608
-191839.139155     8248945.651990
-191860.320495     8248951.612100
-191873.438862     8248953.066114
-191902.824143     8248954.769073
-191920.322572     8248956.289560
-191942.210396     8248957.252255
-191963.482850     8248957.578802
-191989.760093     8248957.982176
-192015.411834     8248958.375948
-192036.583052     8248964.961840
-192063.385327     8248971.634172
-192088.330583     8248977.025360
-192115.777839     8248982.455719
-192141.369604     8248986.604957
-192161.370046     8248988.163852
-192183.883373     8248989.136149
-192197.021995     8248989.337836
-192223.915384     8248990.376605
-192238.911037     8248991.858673
-192253.785199     8249000.852413
-192269.163387     8249017.366663
-192275.863220     8249028.739433
-192283.178435     8249040.747588
-192296.124719     8249052.841418
-192317.346555     8249056.297638
-192331.192425     8249051.501921
-192344.442403     8249044.818482
-192357.046637     8249039.377004
-192377.864932     8249029.052593
-192396.019228     8249028.705337
-192412.983256     8249024.583423
-192429.885782     8249024.216952
-192448.726332     8249020.123080
-192477.587333     8249015.557856
-192502.170297     8249004.665299
-192520.496701     8248993.676698
-192537.530825     8248985.173537
-192558.299267     8248977.978810
-192579.087187     8248969.532508
-192604.881411     8248961.163821
-192625.598471     8248957.098755
-192648.889931     8248948.690884
-192665.227692     8248944.559357
-192681.626205     8248936.671611
-192698.660330     8248928.168450
-192714.514333     8248915.263321
-192729.086942     8248904.217862
-192748.654231     8248893.874247
-192761.187592     8248892.814769
-192774.952480     8248893.026070
-192796.052075     8248903.993185
-192811.551741     8248912.996527
-192828.918558     8248922.654468
-192849.484516     8248927.979195
-192868.183334     8248932.648558
-192886.326745     8248932.927072
-192899.466130     8248933.128771
-192921.364087     8248933.464920
-192944.583911     8248929.439037
-192962.748341     8248928.465236
-192985.907425     8248928.194807
-193004.677103     8248928.482935
-193020.944005     8248928.732643
-193039.663064     8248932.150443
-193057.171615     8248933.045148
-193080.936712     8248934.036661
-193105.336682     8248934.411217
-193120.372832     8248933.389394
-193143.613674     8248928.111196
-193157.438538     8248924.567031
-193173.079936     8248924.807137
-193187.470328     8248925.028040
-193214.271839     8248931.700361
-193233.031395     8248932.614270
-193247.361036     8248936.591391
-193269.198254     8248940.682994
-193294.718395     8248949.213456
-193312.771455     8248955.125545
-193332.711146     8248960.440657
-193351.420085     8248964.484239
-193373.882806     8248968.585444
-193396.396910     8248969.556988
-193415.771836     8248971.107045
-193435.772278     8248972.665940
-193457.649981     8248974.254417
-193484.533249     8248975.918968
-193505.128818     8248979.365574
-193523.837757     8248983.409155
-193540.730926     8248983.668477
-193561.326495     8248987.115083
-193582.578695     8248988.693958
-193603.164907     8248992.766357
-193618.130184     8248996.126534
-193632.469194     8248999.477097
-193646.808968     8249002.827672
-193661.764124     8249006.813630
-193674.882503     8249008.266881
-193688.596010     8249011.607842
-193707.960816     8249013.783681
-193726.104990     8249014.062207
-193744.874668     8249014.350334
-193765.531740     8249014.041498
-193780.547635     8249014.272002
-193793.686257     8249014.473689
-193810.588783     8249014.107218
-193836.240523     8249014.500990
-193866.786459     8249021.856727
-193887.957678     8249028.442619
-193911.540558     8249040.700493
-193925.162963     8249049.674254
-193939.431864     8249057.406828
-193953.135250     8249061.373571
-193978.100748     8249065.513196
-193991.804134     8249069.479939
-194005.498150     8249074.073239
-194023.561344     8249079.358782
-194045.993689     8249085.338096
-194072.825564     8249090.133072
-194103.381621     8249096.863028
-194125.824100     8249102.215796
-194150.769344     8249107.607748
-194170.770550     8249109.166654
-194183.222929     8249113.114193
-194211.286331     8249119.179948
-194238.168823     8249120.845251
-194254.416246     8249122.346535
-194278.795974     8249123.972655
-194296.294391     8249125.493906
-194318.807730     8249126.465439
-194345.075616     8249127.494606
-194364.551779     8249122.785318
-194379.658788     8249117.382260
-194394.765034     8249111.979190
-194408.015777     8249105.295762
-194425.029671     8249098.043400
-194443.254827     8249093.314909
-194468.432918     8249084.310062
-194491.662875     8249079.657633
-194516.901705     8249066.897333
-194540.768051     8249061.628736
-194563.504104     8249048.830016
-194591.205213     8249038.612025
-194615.788177     8249027.719468
-194635.374944     8249016.124278
-194653.681857     8249006.388017
-194680.716979     8248998.663551
-194707.115701     8248991.556017
-194727.904384     8248983.109726
-194744.312255     8248974.596188
-194756.956972     8248966.651583
-194767.775047     8248955.547725
-194778.604770     8248943.818108
-194792.611851     8248929.007581
-194807.174351     8248918.587139
-194826.690246     8248911.373949
-194848.054579     8248906.066945
-194861.818704     8248906.278234
-194875.027422     8248902.098674
-194887.540540     8248902.290759
-194903.808206     8248902.540479
-194923.204150     8248902.838220
-194940.650434     8248907.488356
-194964.364926     8248911.608777
-194991.884582     8248912.657160
-195011.783776     8248920.476163
-195017.000000     8248922.557037
-END
-LINE3D-MASTER
-HEIGHT 1000.000000
-195017.000000     8252581.206382
-195010.080383     8252585.580290
-194993.076621     8252592.206107
-194977.364363     8252596.347236
-194949.098489     8252602.800171
-194927.028424     8252613.105366
-194896.834659     8252622.659156
-194880.445516     8252629.920344
-194867.206422     8252635.978013
-194858.284335     8252645.859102
-194848.072285     8252658.224137
-194837.213726     8252671.831122
-194818.775202     8252689.704837
-194808.512534     8252705.199545
-194799.600581     8252714.454088
-194789.398652     8252726.193342
-194782.949755     8252737.989443
-194775.268553     8252748.515518
-194760.818950     8252752.050093
-194745.782049     8252753.071140
-194729.485536     8252754.699552
-194713.914998     8252750.078210
-194696.477320     8252744.801505
-194684.507947     8252749.626791
-194668.785568     8252754.393702
-194645.424011     8252767.182820
-194633.334688     8252779.519038
-194613.675520     8252795.496204
-194597.821530     8252808.400569
-194586.377200     8252819.494050
-194574.974883     8252828.084427
-194562.954893     8252836.039386
-194537.101444     8252848.164315
-194499.974236     8252860.742121
-194469.135477     8252871.538647
-194433.219541     8252886.639559
-194401.703910     8252900.555381
-194375.900316     8252909.550626
-194358.916797     8252914.924879
-194343.184284     8252920.318335
-194321.114231     8252930.622767
-194300.920675     8252940.956768
-194270.060910     8252953.004846
-194242.996188     8252962.606669
-194222.248002     8252968.549068
-194200.783197     8252980.115429
-194176.887252     8252987.261382
-194157.431332     8252990.719107
-194143.040940     8252990.498204
-194129.276815     8252990.286915
-194113.706277     8252985.665573
-194099.941388     8252985.454272
-194078.760049     8252979.494162
-194056.307448     8252974.767176
-194041.372547     8252969.528890
-194028.335161     8252963.067858
-194004.753044     8252950.809995
-193993.673149     8252939.370752
-193985.126419     8252926.091055
-193975.379287     8252909.663246
-193970.021563     8252892.676880
-193963.443208     8252873.793202
-193963.665934     8252860.022185
-193965.190272     8252843.141463
-193965.392743     8252830.622774
-193965.676209     8252813.096303
-193955.959440     8252794.791149
-193945.505824     8252783.360755
-193933.729566     8252776.293146
-193913.244590     8252765.961402
-193893.849409     8252765.663672
-193874.454228     8252765.365943
-193856.340429     8252763.209308
-193843.282801     8252757.999839
-193830.144179     8252757.798152
-193807.408113     8252770.597637
-193795.429396     8252776.047952
-193784.055914     8252782.760961
-193770.866675     8252785.688947
-193758.232078     8252793.007769
-193745.607603     8252799.700811
-193734.021528     8252819.558291
-193726.321625     8252831.335188
-193719.882836     8252842.506272
-193711.576908     8252853.021992
-193698.286432     8252862.209322
-193686.327944     8252866.408838
-193675.803456     8252859.360444
-193662.826821     8252849.143195
-193648.628768     8252837.030148
-193634.583344     8252815.527333
-193611.636088     8252802.653279
-193593.481792     8252803.000535
-193571.350987     8252817.061184
-193563.651084     8252828.838081
-193555.193289     8252848.743583
-193550.550793     8252864.950501
-193549.520346     8252889.978278
-193542.304201     8252910.528777
-193541.889137     8252936.191937
-193545.389830     8252951.897922
-193545.600269     8252977.570684
-193545.780332     8253005.121556
-193545.102057     8253047.058860
-193543.273999     8253082.718379
-193541.688159     8253103.354542
-193541.435069     8253119.002904
-193542.251521     8253145.937608
-193544.984978     8253170.397226
-193544.559793     8253196.686168
-193544.266206     8253214.838421
-193544.013117     8253230.486782
-193538.027736     8253252.308048
-193525.109674     8253277.153342
-193518.438050     8253302.720460
-193513.785433     8253319.553160
-193509.152294     8253335.134285
-193508.828332     8253355.164646
-193509.200745     8253370.822610
-193510.875547     8253383.370117
-193503.175631     8253395.147778
-193491.781920     8253403.111586
-193485.171035     8253424.923250
-193493.555791     8253448.217746
-193502.788776     8253457.750827
-193520.306684     8253458.019739
-193533.456203     8253457.594892
-193554.163129     8253454.156371
-193564.577012     8253468.090668
-193564.232820     8253489.371828
-193558.974178     8253504.943351
-193556.248675     8253518.675949
-193555.329586     8253536.818599
-193563.048354     8253562.606620
-193570.312951     8253577.744446
-193578.900191     8253588.519489
-193595.529385     8253605.052942
-193616.417138     8253629.165305
-193626.225009     8253641.837660
-193635.356758     8253657.630086
-193642.682871     8253669.011706
-193652.923894     8253693.586571
-193665.738554     8253713.818619
-193683.852365     8253715.974490
-193701.885183     8253723.138142
-193714.155333     8253738.352807
-193724.588707     8253751.034764
-193738.705754     8253768.156356
-193756.556355     8253786.586370
-193775.123561     8253799.393187
-193790.471373     8253817.785546
-193800.894626     8253831.093285
-193816.282935     8253846.981753
-193825.485544     8253858.392943
-193834.698287     8253869.177587
-193849.511711     8253881.926781
-193867.937184     8253903.496834
-193900.640929     8253932.172904
-193916.079856     8253944.931699
-193928.400624     8253957.016692
-193943.819308     8253971.027051
-193952.426790     8253980.550530
-193965.352807     8253993.897453
-193985.151541     8254007.975049
-194000.560092     8254022.611954
-194015.403891     8254033.483038
-194034.637097     8254043.795567
-194060.560015     8254066.106647
-194077.260833     8254078.258877
-194096.554778     8254084.815951
-194109.673158     8254086.269202
-194129.673587     8254087.828861
-194177.849552     8254088.568396
-194216.579175     8254092.919311
-194232.068719     8254102.548432
-194248.860652     8254109.067099
-194261.928414     8254113.650022
-194276.782321     8254123.896089
-194297.800922     8254139.870986
-194320.072057     8254155.865110
-194337.871276     8254177.424785
-194344.571873     8254188.797568
-194362.926487     8254214.748856
-194385.862858     8254228.248680
-194400.141880     8254235.355473
-194432.916498     8254259.649543
-194455.176748     8254276.269437
-194468.144025     8254287.112480
-194483.633569     8254296.741604
-194505.258195     8254313.977678
-194534.825693     8254304.414274
-194551.728219     8254304.047803
-194574.110710     8254313.156801
-194590.093395     8254330.932204
-194606.663365     8254351.221900
-194621.496280     8254362.718754
-194640.780867     8254369.901622
-194661.264304     8254380.234107
-194678.006382     8254389.882457
-194691.537672     8254404.489781
-194700.598549     8254424.664206
-194707.206516     8254441.669764
-194705.520191     8254468.566048
-194698.274446     8254490.993903
-194692.349040     8254509.059703
-194683.377875     8254522.069724
-194668.006891     8254543.746914
-194658.954733     8254561.764717
-194649.882333     8254581.034082
-194643.342320     8254598.463746
-194630.576112     8254613.920023
-194618.373893     8254633.142108
-194603.669672     8254652.325021
-194591.185527     8254689.072836
-194577.479224     8254723.923315
-194567.246931     8254737.539913
-194555.044724     8254756.761234
-194535.859969     8254782.137031
-194524.717945     8254813.270487
-194518.107061     8254835.082151
-194508.408406     8254854.341138
-194496.843350     8254872.946303
-194486.559651     8254889.694090
-194465.517891     8254913.787978
-194448.281294     8254934.809829
-194434.141814     8254957.759326
-194415.139313     8254971.866469
-194391.706884     8254989.037586
-194370.806844     8255004.369003
-194346.223880     8255015.261561
-194334.820812     8255023.851162
-194317.704905     8255037.363621
-194298.036392     8255053.965817
-194277.509529     8255084.955209
-194262.220303     8255101.624629
-194250.725343     8255115.848546
-194233.579849     8255131.237598
-194217.130718     8255142.255016
-194202.466995     8255158.934038
-194184.635271     8255178.068178
-194173.573452     8255204.195368
-194158.930734     8255219.622839
-194141.652890     8255243.147805
-194112.548896     8255262.737137
-194097.148325     8255286.290920
-194081.808455     8255306.091541
-194070.747425     8255332.217215
-194070.453851     8255350.368703
-194065.073730     8255373.451134
-194058.927126     8255405.287975
-194054.354738     8255417.112881
-194054.142133     8255430.258117
-194053.646087     8255460.928294
-194051.567106     8255473.418178
-194040.738134     8255485.148570
-194026.348506     8255484.927680
-194013.209121     8255484.725981
-193996.154754     8255494.480705
-193981.632751     8255502.397256
-193972.722325     8255511.651823
-193961.308359     8255520.867959
-193956.625366     8255539.578768
-193947.683801     8255550.711432
-193946.219425     8255563.837452
-193960.417479     8255575.950498
-193972.213992     8255581.765780
-193984.615741     8255588.843756
-193981.203997     8255606.322205
-193967.256879     8255617.378031
-193957.023823     8255630.994617
-193946.226015     8255640.845384
-193938.545565     8255651.372235
-193925.224739     8255662.436146
-193910.582021     8255677.863617
-193895.485133     8255682.640893
-193866.220566     8255673.427015
-193852.648804     8255661.322054
-193838.975781     8255655.477966
-193824.121874     8255645.231899
-193808.541202     8255641.237103
-193779.124806     8255641.410713
-193753.462933     8255641.643487
-193729.769459     8255636.270750
-193705.388968     8255634.644619
-193692.966951     8255628.819735
-193675.025248     8255616.022519
-193663.218627     8255610.832255
-193645.913324     8255597.418107
-193608.596682     8255583.071599
-193583.015038     8255578.296580
-193564.326354     8255573.000671
-193541.187524     8255572.018772
-193504.385016     8255564.567756
-193466.845660     8255563.991501
-193449.175899     8255573.111606
-193414.542109     8255586.353624
-193363.660896     8255598.094359
-193330.954998     8255608.235523
-193298.411062     8255608.362652
-193273.232971     8255617.367499
-193238.033666     8255626.843686
-193221.706013     8255630.350195
-193206.588882     8255636.379036
-193182.087676     8255642.263824
-193155.738809     8255646.241673
-193139.864563     8255660.398365
-193120.932898     8255670.125801
-193089.971898     8255688.433224
-193075.369690     8255701.356040
-193069.394417     8255722.552288
-193056.053324     8255734.869290
-193041.288364     8255757.807657
-193023.446507     8255777.568343
-193000.961377     8255813.536699
-192964.832861     8255841.781318
-192941.390299     8255859.578981
-192927.352079     8255876.267606
-192910.710610     8255899.177167
-192898.438293     8255922.780499
-192889.224160     8255950.813100
-192870.725660     8255972.442281
-192849.017887     8255999.031222
-192835.595801     8256016.356005
-192824.141350     8256028.075268
-192819.519108     8256043.029859
-192818.559522     8256063.676400
-192819.486579     8256083.725201
-192814.854203     8256099.306338
-192803.308626     8256116.659927
-192794.174723     8256139.684735
-192783.103559     8256166.436955
-192776.996699     8256195.769129
-192760.395715     8256216.175564
-192748.759035     8256239.161952
-192725.245613     8256261.340851
-192713.608933     8256284.327240
-192704.082349     8256292.947176
-192684.998855     8256312.062099
-192665.289834     8256331.168950
-192644.410035     8256345.248803
-192627.839427     8256363.777129
-192610.521837     8256389.806761
-192588.279687     8256410.751772
-192572.858849     8256435.558647
-192559.548132     8256445.997540
-192549.406178     8256453.981328
-192540.484855     8256463.862429
-192525.922367     8256474.282106
-192509.331517     8256494.061995
-192488.996992     8256513.159244
-192461.637920     8256540.913307
-192446.791967     8256568.859456
-192429.646473     8256584.248507
-192424.397964     8256599.193484
-192407.070241     8256625.849662
-192396.120555     8256645.090974
-192376.360176     8256667.325957
-192357.084319     8256698.334553
-192329.232120     8256717.941572
-192308.261195     8256737.655752
-192290.469192     8256754.286754
-192267.631915     8256773.344054
-192245.217645     8256804.931175
-192221.805458     8256820.850729
-192206.637710     8256830.009242
-192194.567890     8256841.092356
-192176.231352     8256852.707502
-192161.578526     8256868.759991
-192142.505141     8256887.249897
-192119.455234     8256919.453961
-192108.413682     8256944.328061
-192092.590079     8256955.353552
-192076.049821     8256972.005297
-192060.175601     8256986.160461
-192050.557915     8257000.413196
-192043.483489     8257012.201223
-192032.664676     8257023.303541
-192024.924263     8257037.585093
-191941.285119     8257101.415438
-191922.958740     8257112.402510
-191907.266724     8257115.292076
-191873.288788     8257126.667116
-191836.091470     8257143.626933
-191817.937187     8257143.973425
-191806.564469     8257150.686445
-191787.632829     8257160.412352
-191762.343369     8257176.303090
-191735.510603     8257221.552377
-END
-LINE3D
-HEIGHT 1020.000000
-187766.346848     8246277.000000
-187768.816524     8246278.636188
-187776.778255     8246289.402011
-187786.656991     8246297.692748
-187801.531160     8246306.686106
-187813.973412     8246311.259809
-187832.803829     8246307.792483
-187857.264926     8246304.411209
-187870.414051     8246303.987120
-187891.050499     8246304.929841
-187909.042438     8246314.597378
-187925.763122     8246325.497657
-187940.627164     8246335.117178
-187948.598633     8246345.257213
-187957.104880     8246361.040037
-187961.291821     8246372.999788
-187968.587170     8246386.259893
-187975.196283     8246403.265469
-187976.032219     8246428.948215
-187975.809499     8246442.718850
-187975.434931     8246465.878119
-187975.029988     8246490.915498
-187974.776898     8246506.563860
-187978.247598     8246524.147960
-187982.161584     8246553.008024
-187982.432762     8246574.925332
-187982.078436     8246596.833038
-187981.703863     8246619.992690
-187980.219633     8246634.369897
-187975.586876     8246649.951028
-187974.576678     8246673.726859
-187970.458443     8246696.203106
-187969.508608     8246716.223096
-187962.312711     8246735.521649
-187948.264745     8246752.836443
-187936.124040     8246768.302321
-187924.669960     8246780.022354
-187913.821140     8246793.003551
-187901.105550     8246805.330155
-187885.786329     8246823.877691
-187864.785435     8246845.468458
-187848.941565     8246857.747041
-187830.554422     8246872.491095
-187808.413502     8246887.177144
-187791.308117     8246900.062681
-187777.391757     8246909.240404
-187765.393166     8246915.943053
-187752.132679     8246923.252650
-187731.950020     8246932.960117
-187722.413327     8246942.205070
-187722.048875     8246964.738940
-187726.780714     8246981.715698
-187745.246684     8247000.781860
-187763.147509     8247016.082960
-187780.967728     8247036.391465
-187795.781151     8247049.140659
-187813.732599     8247061.311705
-187837.940983     8247073.579181
-187864.712506     8247082.129235
-187892.049169     8247094.444732
-187915.560807     8247111.083836
-187930.999734     8247123.842632
-187944.026993     8247130.929827
-187961.545282     8247131.198745
-187991.577072     8247131.659754
-188023.011722     8247122.750950
-188043.789903     8247114.930436
-188060.804167     8247107.678844
-188076.607546     8247097.903769
-188095.559447     8247086.925153
-188127.166200     8247067.375387
-188152.475896     8247050.233468
-188172.719300     8247036.770165
-188194.224595     8247022.700296
-188213.801999     8247011.731281
-188242.108370     8247002.774456
-188266.650836     8246994.385789
-188283.725464     8246983.378355
-188297.753563     8246967.315512
-188313.144032     8246944.386365
-188329.765258     8246922.728367
-188347.001867     8246901.705752
-188369.173162     8246885.141594
-188393.100247     8246876.117544
-188417.571841     8246872.110876
-188445.716236     8246873.168850
-188479.369440     8246881.824542
-188514.961420     8246886.753609
-188539.866173     8246894.649070
-188558.575112     8246898.692651
-188577.808312     8246909.005562
-188596.416015     8246919.308488
-188614.327348     8246933.983430
-188629.100275     8246949.236515
-188640.531565     8246977.586038
-188653.225517     8247005.328624
-188665.495667     8247020.543289
-188675.252920     8247036.345317
-188688.118204     8247053.447311
-188701.517882     8247076.192088
-188722.395514     8247100.930232
-188746.462171     8247121.960562
-188770.670555     8247134.228038
-188789.924009     8247143.288621
-188813.577756     8247151.164877
-188838.472388     8247159.686119
-188873.438101     8247164.605573
-188903.317273     8247174.455587
-188929.453548     8247183.622209
-188959.989363     8247191.603727
-188991.160796     8247198.969449
-189019.920568     8247200.663188
-189044.250441     8247205.418992
-189063.574756     8247210.098339
-189079.841658     8247210.348047
-189092.344649     8247211.166296
-189106.108774     8247211.377585
-189127.371107     8247212.329914
-189147.311567     8247217.644656
-189163.477233     8247224.153710
-189177.866861     8247224.374600
-189198.503685     8247225.317709
-189217.202502     8247229.987073
-189240.805631     8247240.993002
-189256.890309     8247252.509454
-189271.693605     8247265.884812
-189285.820023     8247282.379846
-189298.100300     8247296.968347
-189315.961010     8247314.773344
-189335.052483     8247333.849108
-189364.709706     8247357.469387
-189398.130826     8247380.521889
-189427.313629     8247394.743919
-189457.122705     8247408.975181
-189490.160527     8247416.995489
-189522.563488     8247425.631990
-189556.135699     8247439.295463
-189586.661386     8247447.903146
-189617.812577     8247456.520430
-189650.790424     8247468.296205
-189683.071137     8247484.443983
-189718.460645     8247501.891740
-189756.483772     8247511.240833
-189778.219754     8247521.591781
-189799.955731     8247531.943110
-189824.779496     8247544.845970
-189846.505358     8247555.822699
-189864.538169     8247562.986734
-189879.411574     8247571.980080
-189893.670354     8247580.338436
-189906.051868     8247588.667593
-189918.403011     8247598.874477
-189928.826258     8247612.182598
-189942.348184     8247627.416096
-189956.474596     8247643.911513
-189976.202463     8247662.370726
-189998.482956     8247677.739057
-190008.300953     8247689.785249
-190024.677816     8247721.967458
-190034.756864     8247756.557121
-190043.777256     8247779.234673
-190051.516267     8247803.771131
-190058.104749     8247822.028646
-190063.391601     8247843.397011
-190073.017249     8247867.336110
-190089.958111     8247903.283364
-190113.923532     8247930.573038
-190131.693133     8247954.011215
-190147.040945     8247972.403574
-190165.314571     8248003.362262
-190188.644362     8248031.268498
-190220.137597     8248057.421473
-190247.302158     8248080.377933
-190268.280269     8248098.856339
-190281.761698     8248116.593728
-190290.944066     8248129.256481
-190302.023185     8248140.696477
-190319.319143     8248154.735654
-190335.353197     8248169.382160
-190353.305027     8248181.553212
-190381.115340     8248203.267328
-190406.311519     8248231.828152
-190430.104838     8248269.758788
-190454.130998     8248293.293008
-190481.951438     8248314.380961
-190504.756204     8248336.017857
-190523.181677     8248357.587909
-190535.279732     8248383.443155
-190545.592379     8248403.636796
-190553.482492     8248418.783460
-190561.363235     8248434.556682
-190575.368162     8248458.563388
-190595.498813     8248490.802838
-190615.740821     8248516.157162
-190625.599309     8248525.699845
-190641.663739     8248538.468243
-190657.102666     8248551.227039
-190676.285254     8248564.669239
-190697.940243     8248580.027969
-190722.087887     8248596.050899
-190745.004004     8248610.803050
-190762.895089     8248626.729938
-190781.976442     8248646.431483
-190800.513272     8248661.116409
-190816.629084     8248670.755146
-190833.964774     8248682.290420
-190856.285763     8248695.154861
-190874.822594     8248709.839787
-190889.595520     8248725.092872
-190904.953466     8248742.858685
-190922.117812     8248765.035315
-190943.631069     8248789.157280
-190969.009477     8248806.450977
-190988.837811     8248818.651216
-191001.188955     8248828.858100
-191017.233893     8248842.878837
-191033.923826     8248855.656836
-191048.162365     8248865.266756
-191062.944661     8248879.893283
-191089.514088     8248900.962414
-191118.666522     8248917.062171
-191140.402504     8248927.413119
-191156.528437     8248936.426074
-191172.704224     8248942.309346
-191192.633805     8248948.249476
-191214.400151     8248956.723079
-191239.284656     8248965.870485
-191257.297231     8248974.285700
-191279.638463     8248985.898577
-191295.763631     8248994.911521
-191316.137251     8249012.128391
-191342.757296     8249030.067850
-191364.503400     8249039.793016
-191376.874786     8249048.748336
-191389.871687     8249057.712495
-191407.864008     8249067.380038
-191418.983624     8249076.316143
-191430.770004     8249082.757971
-191445.755523     8249084.866584
-191459.489285     8249086.955218
-191482.578261     8249091.066801
-191495.706761     8249091.894269
-191511.338038     8249092.760158
-191533.831123     8249094.984017
-191546.959624     8249095.811486
-191563.155665     8249100.442430
-191578.797063     8249100.682537
-191598.172754     8249102.232605
-191611.876139     8249106.199348
-191631.876581     8249107.758243
-191646.831737     8249111.744202
-191661.110760     8249118.850995
-191679.708342     8249129.779703
-191695.843632     8249138.166865
-191713.856207     8249146.582080
-191723.745059     8249154.247418
-191739.860107     8249163.886144
-191756.631797     8249171.656374
-191768.982941     8249181.863258
-191785.108109     8249190.876201
-191795.592101     8249200.428486
-191824.704802     8249219.032146
-191852.545490     8249238.868153
-191871.697702     8249254.188463
-191883.362604     8249268.141199
-191891.969322     8249277.664666
-191906.136988     8249291.656585
-191921.575915     8249304.415381
-191938.841496     8249320.332667
-191951.223016     8249328.661442
-191969.143701     8249342.710972
-191984.592761     8249354.843223
-191995.077516     8249364.395519
-192008.689787     8249373.995825
-192024.179332     8249383.624948
-192038.992755     8249396.374142
-192056.238083     8249413.543755
-192077.933568     8249426.398594
-192105.289722     8249437.461752
-192122.676782     8249445.868130
-192143.756886     8249458.087585
-192166.693257     8249471.587408
-192192.789047     8249483.257156
-192220.145189     8249494.321079
-192248.713380     8249507.907355
-192267.351446     8249516.332936
-192284.243851     8249516.592247
-192296.746848     8249517.410114
-192320.471461     8249520.904752
-192343.600183     8249522.511668
-192362.359739     8249523.425578
-192378.001137     8249523.665684
-192393.037275     8249522.644626
-192413.189570     8249514.814503
-192432.040229     8249510.095614
-192453.393677     8249505.414379
-192470.377196     8249500.040127
-192489.288594     8249491.565783
-192501.913082     8249484.871978
-192515.143570     8249479.440878
-192529.120300     8249466.506931
-192558.335626     8249440.034001
-192577.933279     8249427.813041
-192598.843440     8249411.855843
-192615.999068     8249395.840246
-192632.459071     8249384.197822
-192655.820640     8249371.407940
-192674.106535     8249362.923995
-192689.859302     8249356.278211
-192716.268145     8249348.544895
-192750.185329     8249340.926073
-192772.204764     8249333.751314
-192790.460296     8249327.144714
-192811.864362     8249319.333807
-192840.180853     8249309.751200
-192869.051988     8249304.559431
-192894.804964     8249298.693858
-192921.153067     8249294.715997
-192947.431075     8249295.119382
-192974.333821     8249295.532358
-192996.766943     8249301.510920
-193016.676258     8249308.704142
-193037.887973     8249312.786143
-193055.961288     8249317.445905
-193076.587221     8249319.015165
-193102.844986     8249320.670115
-193125.933210     8249324.780921
-193150.333944     8249325.155490
-193170.293889     8249329.218275
-193190.930707     8249330.161766
-193219.014364     8249334.975194
-193250.760688     8249345.479807
-193276.956938     8249350.890963
-193296.958144     8249352.449869
-193316.918089     8249356.512655
-193345.647491     8249360.084121
-193369.402467     8249361.701414
-193386.860400     8249365.725792
-193403.117180     8249366.601282
-193422.451622     8249370.654466
-193443.653204     8249375.363013
-193461.736639     8249379.396993
-193482.927336     8249384.731309
-193495.894626     8249395.573588
-193510.757903     8249405.193098
-193526.904090     8249412.953726
-193544.936132     8249420.118131
-193566.097229     8249427.329804
-193591.062728     8249431.469429
-193614.080844     8249439.962247
-193629.025115     8249444.573975
-193645.221920     8249449.204931
-193663.264095     8249455.742790
-193679.460887     8249460.374510
-193695.021304     8249465.621633
-193714.981237     8249469.685183
-193733.044431     8249474.970726
-193749.876096     8249478.985490
-193764.256355     8249479.832939
-193779.252007     8249481.315007
-193793.621393     8249482.787461
-193812.965956     8249486.214863
-193832.926653     8249490.278424
-193854.824610     8249490.614573
-193871.717015     8249490.873883
-193886.743043     8249490.477842
-193901.779180     8249489.456783
-193927.451163     8249488.598992
-193943.092561     8249488.839099
-193964.990518     8249489.175248
-193981.812063     8249493.815794
-193997.937995     8249502.828749
-194016.525456     8249514.383239
-194028.290817     8249522.077383
-194042.509113     8249532.938865
-194055.465506     8249544.407679
-194068.462395     8249553.372601
-194082.761684     8249559.226303
-194098.947592     8249564.483792
-194114.528251     8249568.479353
-194131.370802     8249571.868347
-194147.587085     8249575.247728
-194170.725928     8249576.228862
-194196.367535     8249577.249180
-194216.953747     8249581.321579
-194238.841583     8249582.283510
-194260.668680     8249587.000895
-194277.500334     8249591.016423
-194299.286934     8249598.237699
-194318.510783     8249609.176020
-194339.005117     8249618.881971
-194356.412431     8249626.036021
-194370.055066     8249633.758982
-194388.672890     8249643.436127
-194402.265683     8249654.288008
-194415.837457     8249666.392205
-194429.348492     8249682.251855
-194446.664692     8249695.039469
-194460.903230     8249704.649388
-194478.350278     8249709.299536
-194500.732006     8249718.408522
-194520.046957     8249723.714045
-194536.817884     8249731.484263
-194551.762906     8249736.096768
-194573.509010     8249745.821934
-194590.290821     8249752.966382
-194607.132608     8249756.355365
-194629.503451     8249766.090121
-194643.843225     8249769.440696
-194666.992189     8249769.796049
-194687.639140     8249770.112994
-194710.788104     8249770.468347
-194728.306775     8249770.737271
-194745.300416     8249764.737236
-194769.197137     8249757.590531
-194781.186752     8249751.513681
-194793.790972     8249746.072967
-194809.624721     8249734.420166
-194826.709476     8249722.786568
-194842.502728     8249713.637658
-194856.509821     8249698.826366
-194866.733520     8249685.835573
-194878.822843     8249673.499355
-194888.460771     8249657.995057
-194899.258591     8249648.143526
-194905.103004     8249635.085507
-194911.643028     8249617.655079
-194912.510736     8249602.642089
-194915.912347     8249585.790186
-194920.061716     8249561.436223
-194924.785206     8249540.221524
-194931.870504     8249527.808490
-194939.610904     8249513.527702
-194951.085622     8249500.555349
-194960.077028     8249486.293765
-194973.398643     8249475.228337
-194984.277457     8249460.369025
-194998.355410     8249441.176498
-195009.325326     8249420.684387
-195017.000000     8249411.761649
-END
-LINE3D
-HEIGHT 1020.000000
-195017.000000     8252107.484824
-194980.547385     8252128.707267
-194955.278180     8252143.345677
-194938.868795     8252151.858428
-194921.794161     8252162.866244
-194904.679042     8252176.377187
-194881.164092     8252198.556062
-194857.660803     8252220.108416
-194839.274436     8252234.851718
-194824.085670     8252245.262546
-194802.611507     8252257.454700
-194766.009330     8252276.301464
-194734.988354     8252298.364353
-194709.082760     8252313.618931
-194696.387413     8252324.693972
-194688.707751     8252335.219306
-194673.520511     8252345.630158
-194648.886179     8252359.651612
-194628.663023     8252371.862970
-194612.263747     8252379.750703
-194597.763525     8252386.414951
-194563.119602     8252400.283515
-194515.305930     8252415.827725
-194490.148094     8252423.580245
-194469.349289     8252432.652317
-194447.966229     8252439.211672
-194431.566965     8252447.098641
-194400.738328     8252457.269386
-194367.396041     8252468.026718
-194340.340677     8252477.002747
-194327.181801     8252478.053388
-194305.212983     8252482.098474
-194288.895464     8252484.978438
-194264.988622     8252492.750926
-194247.924121     8252503.132196
-194232.827233     8252507.909473
-194216.448974     8252514.544891
-194192.602884     8252518.561160
-194169.342563     8252525.090933
-194140.481549     8252529.656921
-194114.708331     8252536.774057
-194093.294144     8252545.210745
-194076.390855     8252545.577205
-194056.360037     8252545.896419
-194042.595912     8252545.685130
-194023.907228     8252540.389221
-194010.223333     8252535.170139
-193992.806661     8252528.641882
-193976.640232     8252522.132817
-193960.545427     8252511.242529
-193948.748926     8252505.426482
-193931.382872     8252495.768553
-193919.566117     8252491.204834
-193903.471323     8252480.313781
-193879.273061     8252467.420524
-193851.987004     8252451.976118
-193827.657142     8252447.219550
-193807.091936     8252441.895599
-193795.285314     8252436.705334
-193782.853189     8252431.505468
-193767.999269     8252421.260165
-193751.309336     8252408.482165
-193725.880310     8252394.318140
-193704.144327     8252383.967192
-193688.685158     8252372.459960
-193668.139443     8252365.883670
-193636.302004     8252361.012620
-193616.341307     8252356.949058
-193601.951679     8252356.728167
-193588.782682     8252358.404589
-193574.372047     8252359.435250
-193561.182808     8252362.363235
-193545.521155     8252363.375456
-193518.445549     8252373.603049
-193494.387617     8252390.764565
-193470.318800     8252408.551851
-193444.424104     8252423.179895
-193408.558786     8252435.151134
-193380.262537     8252443.482178
-193359.464496     8252452.554262
-193344.932371     8252461.096595
-193320.319045     8252473.866497
-193306.423308     8252481.792662
-193286.240649     8252491.500129
-193265.451966     8252499.946419
-193249.023089     8252509.711510
-193225.681011     8252521.249053
-193213.591688     8252533.585271
-193206.536766     8252544.120195
-193201.299130     8252558.440166
-193196.070863     8252572.133580
-193190.156342     8252589.573610
-193183.000948     8252606.367891
-193177.076305     8252624.433703
-193175.592452     8252638.811297
-193170.232574     8252660.642165
-193163.722925     8252676.194484
-193155.286149     8252694.847670
-193148.786633     8252709.773444
-193146.524659     8252733.530442
-193146.301945     8252747.300694
-193150.841804     8252776.171130
-193153.767612     8252788.737841
-193164.897361     8252797.047400
-193177.874772     8252807.263897
-193190.912158     8252813.724929
-193207.693193     8252820.870130
-193220.771076     8252824.827271
-193242.507058     8252835.178219
-193254.303559     8252840.994265
-193266.755939     8252844.941804
-193280.409470     8252852.038231
-193291.508844     8252862.225899
-193302.527988     8252877.421361
-193309.177203     8252891.923804
-193309.428139     8252915.092675
-193308.559667     8252930.105654
-193304.573037     8252944.444829
-193296.165873     8252961.219894
-193287.718976     8252980.498861
-193276.758405     8253000.365943
-193270.924877     8253012.798192
-193265.112368     8253023.978125
-193259.863846     8253038.923867
-193250.124682     8253060.687509
-193240.426015     8253079.947261
-193235.177494     8253094.893002
-193225.559807     8253109.145737
-193213.954267     8253130.254028
-193204.306205     8253146.384872
-193195.141926     8253171.287789
-193190.499430     8253187.494707
-193185.250909     8253202.440448
-193175.653477     8253215.440855
-193162.180785     8253235.894547
-193145.650660     8253251.919746
-193129.746052     8253267.953783
-193116.353577     8253283.400446
-193107.997794     8253297.045851
-193097.209331     8253306.271588
-193085.715136     8253320.495517
-193072.979303     8253334.073685
-193054.541542     8253351.947412
-193040.554704     8253365.506375
-193029.090120     8253377.852183
-193015.819887     8253385.787950
-193003.144794     8253395.610664
-192991.670089     8253408.582253
-192979.045601     8253415.276059
-192966.380629     8253424.472990
-192957.398579     8253438.108781
-192946.610880     8253447.334531
-192952.019222     8253461.191224
-192965.046475     8253468.278801
-192980.001631     8253472.264760
-192998.014206     8253480.679975
-193023.493838     8253491.715092
-193053.796806     8253514.093410
-193077.247324     8253534.487962
-193101.706643     8253569.924309
-193125.066797     8253595.953200
-193141.746609     8253609.356982
-193157.215911     8253620.237669
-193177.579397     8253638.081085
-193197.942132     8253655.923725
-193216.235994     8253685.631231
-193228.465660     8253703.349023
-193240.796549     8253714.808234
-193253.753705     8253726.277059
-193270.474013     8253737.176950
-193296.396932     8253759.488030
-193314.822405     8253781.058083
-193328.888847     8253801.308583
-193336.789833     8253815.830241
-193348.464092     8253829.157184
-193359.533853     8253841.222973
-193376.142805     8253859.007990
-193397.172291     8253874.357117
-193415.103873     8253887.780114
-193426.143259     8253901.724012
-193438.413409     8253916.938677
-193446.344006     8253929.582215
-193459.178921     8253948.561936
-193472.024732     8253966.915123
-193488.623551     8253985.326686
-193503.890369     8254008.726826
-193516.715162     8254028.332329
-193527.582452     8254052.916807
-193539.690628     8254078.146271
-193553.029567     8254104.646502
-193568.154665     8254136.809114
-193582.109738     8254163.945504
-193597.809722     8254199.247390
-193616.113717     8254228.328351
-193645.002940     8254260.702251
-193670.048030     8254298.652104
-193690.248777     8254326.510306
-193703.760576     8254342.369969
-193719.723770     8254361.397711
-193735.788200     8254374.166109
-193764.829277     8254397.150993
-193773.426625     8254407.301017
-193788.067953     8254430.690792
-193792.042296     8254455.795396
-193804.150471     8254481.024859
-193810.133699     8254498.020827
-193809.910972     8254511.791844
-193809.597144     8254531.195660
-193803.622647     8254552.391156
-193796.527229     8254565.429970
-193789.402198     8254580.346906
-193781.651664     8254595.254240
-193767.018316     8254610.055153
-193751.739198     8254626.099556
-193734.522844     8254645.869843
-193719.919859     8254658.793412
-193707.779918     8254674.259302
-193703.167021     8254688.588863
-193694.861857     8254699.104596
-193682.832509     8254707.685348
-193668.804410     8254723.748190
-193647.965872     8254735.324165
-193619.679744     8254743.029427
-193597.650187     8254750.829967
-193579.313662     8254762.444349
-193558.494615     8254772.767985
-193544.598879     8254780.694149
-193533.164670     8254791.161848
-193520.469323     8254802.236889
-193501.537658     8254811.964324
-193485.754539     8254820.486689
-193473.180669     8254824.050822
-193453.714628     8254828.134328
-193427.376658     8254831.485644
-193412.289878     8254835.637903
-193399.695791     8254840.452071
-193387.101679     8254845.267768
-193358.190047     8254852.963428
-193334.847982     8254864.500207
-193314.019565     8254875.450400
-193292.504130     8254890.147197
-193267.113459     8254912.295750
-193246.799176     8254930.141435
-193222.125111     8254946.666792
-193205.675980     8254957.684210
-193186.703831     8254969.914772
-193173.402483     8254979.727107
-193158.891377     8254987.017125
-193139.415202     8254991.727176
-193119.333003     8254995.176051
-193092.944415     8255001.657039
-193071.601076     8255005.713256
-193050.318513     8255006.011726
-193030.287695     8255006.330941
-193000.770064     8255012.763896
-192969.931305     8255023.560423
-192931.522702     8255037.997898
-192902.570586     8255048.196685
-192879.915514     8255055.988387
-192864.838892     8255059.512573
-192843.384209     8255070.453152
-192822.606410     8255078.273672
-192801.202344     8255086.084579
-192784.198595     8255092.709631
-192771.553865     8255100.654999
-192755.184964     8255106.664624
-192740.098973     8255110.815367
-192725.062836     8255111.836426
-192709.350553     8255115.979083
-192686.725856     8255121.892677
-192671.023731     8255125.407260
-192652.193302     8255128.875351
-192638.983057     8255133.054888
-192607.578782     8255140.085583
-192585.579589     8255146.008778
-192575.427502     8255154.619112
-192564.548701     8255169.477660
-192554.931015     8255183.730395
-192545.928723     8255198.617749
-192541.326723     8255212.320777
-192531.769764     8255222.818821
-192515.713314     8255248.241111
-192506.670513     8255265.633120
-192496.477941     8255276.746580
-192483.721867     8255291.576311
-192471.641888     8255303.287500
-192465.697016     8255322.604111
-192464.152411     8255340.737924
-192469.549881     8255355.219623
-192481.356503     8255360.409887
-192494.383755     8255367.497465
-192508.622293     8255377.107385
-192517.804661     8255389.770138
-192520.679851     8255405.466521
-192520.447004     8255419.863319
-192523.826219     8255443.080212
-192523.623747     8255455.598902
-192524.026537     8255469.378756
-192528.789134     8255484.477411
-192531.563088     8255506.433139
-192530.692450     8255560.264114
-192530.994004     8255580.303314
-192531.346176     8255597.212841
-192531.082953     8255613.487748
-192530.698252     8255637.273564
-192526.488908     8255665.382992
-192521.633819     8255694.734381
-192516.415661     8255707.802777
-192514.962183     8255720.302263
-192508.310814     8255744.617053
-192493.525612     8255768.806984
-192479.346411     8255794.259619
-192458.132529     8255828.995616
-192437.767653     8255849.969445
-192428.139858     8255864.847197
-192420.368306     8255881.006847
-192393.595017     8255911.273650
-192368.526117     8255952.211368
-192356.395546     8255967.050701
-192340.541543     8255979.955830
-192321.458024     8255999.072282
-192302.838810     8256028.212382
-192283.017680     8256054.203583
-192270.806879     8256074.050709
-192258.564938     8256095.775932
-192246.928258     8256118.762320
-192229.610644     8256144.793480
-192214.048085     8256178.362826
-192204.369673     8256196.370250
-192192.299828     8256207.454893
-192181.491887     8256217.932206
-192171.924818     8256229.055268
-192160.520961     8256237.646386
-192148.420766     8256250.607610
-192131.657794     8256281.029608
-192100.918117     8256324.384023
-192073.629931     8256347.755323
-192059.531723     8256368.200177
-192052.395807     8256383.742883
-192043.384146     8256399.256794
-192042.555407     8256411.765870
-192024.531321     8256442.793681
-192011.623368     8256467.013957
-191996.232905     8256489.942723
-191976.453023     8256513.430808
-191953.301906     8256551.892689
-191944.218620     8256571.787824
-191934.661686     8256582.284341
-191921.784108     8256604.626508
-191908.866047     8256629.471802
-191896.573488     8256654.326697
-191879.255898     8256680.356329
-191869.001836     8256695.224468
-191849.948693     8256712.462811
-191826.475780     8256732.137055
-191808.643268     8256751.272711
-191794.030926     8256764.822073
-191784.413240     8256779.074808
-191774.623458     8256803.968122
-191760.625722     8256818.153620
-191752.300315     8256829.920916
-191744.629998     8256839.821220
-191733.872675     8256847.168861
-191717.595640     8256847.545698
-191701.934000     8256848.557155
-191685.667099     8256848.307446
-191672.527713     8256848.105748
-191656.876206     8256848.490659
-191641.234808     8256848.250552
-191630.941001     8256865.623357
-191630.515815     8256891.912299
-191630.100739     8256917.576224
-191623.499988     8256938.761342
-191610.088010     8256955.461108
-191596.161922     8256965.263854
-191576.008863     8256973.093964
-191562.022024     8256986.652928
-191545.542518     8256999.548455
-191533.513182     8257008.128443
-191518.778574     8257029.190229
-191503.327385     8257055.873684
-191495.648687     8257091.413528
-END
-LINE3D
-HEIGHT 1080.000000
-183557.000000     8247520.567119
-183561.211203     8247524.915206
-183578.527564     8247537.703699
-183601.565616     8247544.945234
-183621.475436     8247552.139000
-183638.266926     8247558.658439
-183657.601475     8247562.712480
-183668.852931     8247563.511614
-183668.842846     8247564.137786
-183669.448365     8247565.399377
-183673.182116     8247566.708739
-183678.792720     8247568.047372
-183686.300537     8247568.162937
-183698.248239     8247564.590411
-183708.329167     8247560.362825
-183720.286954     8247556.164128
-183731.568652     8247555.085511
-183735.332639     8247554.517504
-183742.214773     8247554.623438
-183750.973765     8247554.758262
-183761.508995     8247561.181401
-183764.536408     8247567.488976
-183768.149177     8247576.310103
-183771.771841     8247584.505055
-183778.573326     8247589.618451
-183782.932754     8247590.937826
-183790.440380     8247591.053387
-183804.951306     8247583.763503
-183834.568211     8247571.071491
-183867.293374     8247559.679212
-183886.133295     8247555.586449
-183901.885312     8247548.941995
-183924.569874     8247539.273381
-183953.490717     8247530.953414
-183986.750640     8247525.204397
-184013.784354     8247517.481326
-184034.602137     8247507.158033
-184059.799320     8247496.902150
-184095.682760     8247483.680270
-184132.757267     8247474.233537
-184161.637598     8247468.417107
-184179.266670     8247461.801163
-184193.737078     8247457.015197
-184210.185347     8247445.998702
-184232.264384     8247435.068878
-184255.604872     8247423.532145
-184271.447622     8247411.254057
-184276.513191     8247407.575598
-184277.148959     8247406.959057
-184286.705010     8247396.462799
-184301.992646     8247379.793408
-184317.875724     8247365.011399
-184328.057464     8247354.524389
-184340.116057     8247344.066652
-184359.167687     8247326.828872
-184378.279795     8247305.835973
-184394.990180     8247278.544749
-184408.642903     8247246.824083
-184425.403502     8247216.403145
-184441.528525     8247186.598750
-184450.539738     8247171.085020
-184463.990646     8247151.883197
-184492.547921     8247127.278870
-184515.969057     8247110.734675
-184533.648345     8247100.989017
-184548.855518     8247089.327473
-184565.888958     8247080.824145
-184582.852020     8247076.702492
-184598.503225     8247076.317461
-184617.292740     8247075.354409
-184641.702937     8247075.104201
-184661.743818     8247074.160412
-184680.533333     8247073.197360
-184693.066397     8247072.138005
-184706.911122     8247067.342409
-184720.675389     8247067.554277
-184734.459629     8247066.514181
-184746.367195     8247065.445580
-184755.772034     8247064.338074
-184772.109222     8247060.206788
-184785.257884     8247059.783235
-184786.569742     8247056.046614
-184791.201172     8247040.465468
-184791.513687     8247021.061410
-184792.340995     8247008.552196
-184793.844391     8246992.922901
-184795.367760     8246976.041642
-184799.403941     8246958.573117
-184808.344394     8246947.441057
-184828.455845     8246942.115595
-184854.329117     8246928.739632
-184880.686743     8246924.136641
-184896.428681     8246918.117976
-184907.074801     8246917.655903
-184917.771334     8246914.063737
-184935.915002     8246914.343016
-184956.551127     8246915.286986
-184972.696967     8246923.048377
-184995.684606     8246933.420005
-185014.847583     8246948.115138
-185030.186273     8246967.134164
-185043.083096     8246982.359171
-185055.313725     8247000.078085
-185066.888236     8247019.665115
-185075.365147     8247037.326249
-185086.253676     8247060.659534
-185094.780992     8247075.190956
-185107.667355     8247091.041747
-185126.194755     8247106.353424
-185143.410304     8247125.401340
-185163.118506     8247145.113569
-185180.182837     8247173.550618
-185195.350145     8247203.210739
-185208.721242     8247227.834509
-185217.823645     8247245.505271
-185229.378375     8247266.344268
-185247.037956     8247296.668696
-185258.582601     8247318.133864
-185264.566857     8247335.130685
-185271.792402     8247352.772557
-185276.575698     8247366.620405
-185285.758749     8247379.283705
-185292.449153     8247391.282310
-185305.295570     8247409.637029
-185329.332577     8247432.546376
-185358.031823     8247437.997218
-185389.929488     8247439.114151
-185409.829230     8247446.933706
-185428.457448     8247455.985578
-185445.228965     8247463.756981
-185463.261545     8247470.921851
-185480.608154     8247481.832212
-185501.648365     8247496.556623
-185516.452296     8247509.932387
-185526.856089     8247524.492694
-185537.845812     8247541.566562
-185547.624113     8247556.117240
-185557.412493     8247570.042129
-185564.113357     8247581.414951
-185568.967223     8247590.881126
-185576.263331     8247604.141708
-185589.149694     8247619.992499
-185607.656936     8247636.555755
-185629.888029     8247655.054928
-185651.493254     8247673.544086
-185670.040818     8247687.603802
-185684.945179     8247694.720138
-185698.023462     8247698.678261
-185711.706699     8247703.897585
-185735.410947     8247708.645214
-185758.539344     8247710.253491
-185782.939653     8247710.629076
-185807.410532     8247706.622988
-185832.577472     8247698.244856
-185863.314499     8247693.709276
-185892.225454     8247686.015101
-185913.577804     8247681.335066
-185931.812396     8247675.980715
-185953.144583     8247672.552641
-185983.801343     8247673.024529
-186016.334961     8247673.525306
-186043.156973     8247678.946870
-186067.496797     8247683.077955
-186090.534461     8247690.319867
-186118.607839     8247695.760692
-186125.470000     8247697.118590
-186126.095492     8247697.128218
-186126.085414     8247697.754008
-186126.691124     8247699.015603
-186136.600480     8247705.429108
-186157.812079     8247709.512042
-186187.772395     8247714.355968
-186227.692472     8247722.483688
-186258.198014     8247732.344710
-186273.728249     8247739.470680
-186287.381619     8247746.568142
-186310.339023     8247758.817139
-186343.326751     8247769.968639
-186373.811747     8247781.081616
-186390.603428     8247787.601058
-186401.098336     8247796.527738
-186405.982445     8247804.116163
-186409.625647     8247811.059542
-186410.866553     8247811.704588
-186414.540004     8247816.769835
-186421.290892     8247825.012939
-186436.770715     8247835.269002
-186456.004643     8247845.582469
-186485.954880     8247851.052185
-186502.140844     8247856.310414
-186507.045116     8247862.646878
-186508.286404     8247863.291930
-186511.889285     8247872.738849
-186514.836050     8247884.053885
-186515.249833     8247897.208530
-186518.721278     8247914.792617
-186522.062050     8247940.513882
-186525.129784     8247944.317917
-186528.207604     8247947.495780
-186538.833567     8247948.285286
-186547.531884     8247952.175607
-186556.805662     8247959.205656
-186569.157266     8247969.413186
-186582.689667     8247984.021650
-186586.928119     8247992.852408
-186587.462878     8247998.495669
-186596.585445     8248014.914470
-186607.554622     8248033.240293
-186619.200085     8248048.445657
-186630.149098     8248068.023441
-186651.593020     8248096.527904
-186677.497188     8248120.091937
-186703.582811     8248132.389467
-186730.939582     8248143.454292
-186755.198758     8248152.592840
-186778.176319     8248163.590257
-186802.364537     8248177.110853
-186827.834752     8248188.772584
-186852.689172     8248199.798891
-186872.498186     8248213.251697
-186885.434955     8248225.972777
-186895.303984     8248234.890204
-186900.813972     8248242.487881
-186910.128078     8248247.014008
-186914.487506     8248248.333383
-186915.102920     8248248.968800
-186915.728794     8248248.978434
-186916.354286     8248248.988062
-186916.979779     8248248.997690
-186917.595568     8248249.633495
-186929.321298     8248259.831391
-186938.574919     8248268.113019
-186942.883941     8248272.562104
-186954.599967     8248283.386178
-186975.528906     8248304.995795
-187008.910643     8248330.553525
-187031.787398     8248347.809984
-187044.128911     8248358.644067
-187057.731881     8248368.870858
-187073.211710     8248379.126540
-187085.482659     8248394.341913
-187090.316368     8248405.059668
-187098.318616     8248413.322416
-187101.900958     8248424.020908
-187106.745127     8248434.112879
-187114.666721     8248447.383471
-187118.198657     8248461.211675
-187123.082771     8248468.799718
-187126.039609     8248479.489346
-187129.632411     8248489.562055
-187129.561848     8248493.943345
-187129.299727     8248510.218456
-187129.037618     8248526.492802
-187127.725767     8248530.229041
-187127.655203     8248534.610331
-187128.119386     8248544.635647
-187133.558811     8248556.614614
-187138.463083     8248562.951078
-187139.593468     8248570.482106
-187140.592804     8248586.149924
-187140.532319     8248589.905425
-187140.481913     8248593.035136
-187139.856039     8248593.025502
-187129.089318     8248600.999347
-187118.443198     8248601.461420
-187106.545711     8248601.904231
-187091.540538     8248601.047318
-187080.218137     8248604.629468
-187069.411101     8248615.106470
-187059.158600     8248629.975149
-187047.604708     8248647.954283
-187033.013325     8248660.251633
-187016.423731     8248680.031088
-186996.060632     8248701.005113
-186976.332722     8248721.362970
-186958.038027     8248730.472829
-186946.059885     8248735.923484
-186934.061586     8248742.625718
-186920.196889     8248748.673278
-186910.085527     8248754.778612
-186894.303262     8248763.301199
-186879.056150     8248777.466289
-186854.968818     8248796.504390
-186819.610243     8248815.995706
-186787.985228     8248836.796380
-186757.732561     8248850.104551
-186730.002402     8248862.199660
-186699.850548     8248869.248408
-186676.530217     8248879.533562
-186658.235522     8248888.643421
-186643.724411     8248895.932920
-186634.905125     8248899.553600
-186630.404552     8248906.997953
-186624.087616     8248910.657150
-186619.687867     8248911.841316
-186609.597045     8248916.695077
-186599.515932     8248920.922279
-186581.160740     8248933.788402
-186558.980897     8248950.977266
-186541.271367     8248962.600675
-186529.797748     8248975.571959
-186520.261855     8248984.816638
-186519.616192     8248986.059354
-186515.801990     8248989.757075
-186510.029893     8248998.433744
-186499.858428     8249008.294585
-186491.482786     8249023.192154
-186486.235763     8249038.137116
-186481.634377     8249051.840891
-186480.151533     8249066.217848
-186479.929739     8249079.989037
-186484.743277     8249091.959134
-186491.918422     8249112.730336
-186497.872436     8249131.604907
-186503.220733     8249149.218265
-186506.581663     8249173.687952
-186515.946644     8249213.901729
-186519.902818     8249240.259176
-186524.655871     8249255.984774
-186529.923909     8249278.605218
-186533.960355     8249299.954816
-186537.442267     8249316.912737
-186544.122585     8249329.537514
-186553.901262     8249344.088580
-186577.433746     8249359.477298
-186595.426005     8249369.145708
-186610.905834     8249379.401389
-186634.458869     8249393.537770
-186656.174979     8249405.142097
-186681.705303     8249413.047940
-186714.743432     8249421.070111
-186743.382206     8249430.275689
-186767.701478     8249435.659112
-186796.380567     8249442.361532
-186833.778130     8249451.702696
-186865.504420     8249463.460342
-186887.331420     8249468.179457
-186912.932308     8249471.704009
-186947.272221     8249476.614966
-186985.366222     8249481.584473
-187020.271143     8249490.260560
-187052.078457     8249497.011132
-187088.900551     8249503.212950
-187116.368601     8249507.392187
-187143.836269     8249511.571418
-187168.236578     8249511.947003
-187190.749555     8249512.920245
-187216.401231     8249513.315092
-187237.047441     8249513.632891
-187258.410258     8249508.326690
-187279.692039     8249508.028328
-187299.712756     8249508.336499
-187322.175340     8249512.438689
-187349.613141     8249518.496058
-187374.578458     8249522.636772
-187397.081369     8249524.235040
-187419.604819     8249524.581734
-187453.480155     8249519.468135
-187486.154901     8249511.206332
-187511.967885     8249501.585490
-187532.795549     8249490.636787
-187546.075082     8249482.075677
-187558.698873     8249475.383071
-187582.654775     8249464.481755
-187614.855258     8249446.820426
-187647.691312     8249428.542935
-187679.820838     8249415.263654
-187701.879711     8249405.585792
-187701.889790     8249404.960002
-187712.031018     8249396.976530
-187732.323923     8249380.384565
-187753.242333     8249363.801465
-187771.032887     8249347.170983
-187790.730167     8249328.691252
-187812.264359     8249312.744339
-187832.456083     8249302.411027
-187845.685591     8249296.979634
-187855.241642     8249286.483375
-187867.320214     8249274.773292
-187876.835938     8249266.780955
-187881.296184     8249261.840525
-187882.547551     8249261.859787
-187883.183122     8249261.243625
-187886.381923     8249256.909722
-187891.468031     8249251.979690
-187892.154008     8249248.233817
-187901.629417     8249242.744639
-187911.084668     8249238.507039
-187912.336034     8249238.526301
-187912.961527     8249238.535929
-187917.331027     8249239.229896
-187924.142406     8249243.717117
-187933.406112     8249251.372573
-187940.853432     8249255.244403
-187953.245363     8249262.948011
-187975.011879     8249271.422627
-187991.833808     8249276.063937
-188005.527511     8249280.657095
-188010.522504     8249281.360690
-188011.844447     8249276.997898
-188015.688897     8249271.422044
-188015.698976     8249270.796254
-188015.769540     8249266.414964
-188015.910679     8249257.651620
-188015.920758     8249257.025830
-188003.669966     8249240.558878
-187993.861422     8249227.885950
-187993.296045     8249224.120051
-187988.401852     8249217.157797
-187987.867093     8249211.514536
-187987.422673     8249200.238400
-187986.938320     8249191.465427
-187987.018975     8249186.457583
-187987.220599     8249173.938738
-187987.916654     8249169.567076
-187994.879633     8249164.665169
-188008.189402     8249154.226690
-188024.022073     8249142.574392
-188041.691276     8249133.454906
-188063.104499     8249125.018994
-188090.118050     8249118.547884
-188112.166845     8249109.495811
-188129.916689     8249095.369245
-188143.943078     8249079.306003
-188158.554619     8249065.757074
-188176.244361     8249055.386015
-188192.046796     8249045.611085
-188207.768564     8249040.844763
-188224.751408     8249035.471144
-188242.360508     8249030.107164
-188260.574930     8249026.005155
-188278.818837     8249020.025002
-188298.981076     8249011.569834
-188325.429237     8249001.333590
-188355.601644     8248993.032505
-188379.577321     8248980.879604
-188400.465864     8248966.174642
-188418.155606     8248955.803583
-188431.990067     8248951.633390
-188448.397825     8248943.120432
-188467.933795     8248934.656388
-188487.450384     8248927.443172
-188500.659341     8248923.264116
-188508.862844     8248919.007248
-188513.262975     8248917.823089
-188522.708135     8248914.212043
-188534.060021     8248908.751748
-188543.454775     8248908.270413
-188556.038251     8248904.080965
-188561.669209     8248904.167640
-188562.920958     8248904.186908
-188567.310246     8248903.628526
-188567.935739     8248903.638154
-188572.315712     8248903.705573
-188578.511678     8248907.557377
-188590.277340     8248915.252109
-188602.729756     8248919.200217
-188608.280060     8248924.294736
-188612.013620     8248925.604094
-188619.501661     8248926.971244
-188635.707782     8248930.977894
-188648.220683     8248931.170501
-188656.455186     8248925.036277
-188660.299637     8248919.460423
-188664.123930     8248915.136148
-188664.144087     8248913.884569
-188664.154166     8248913.258780
-188664.779658     8248913.268408
-188672.287857     8248913.383979
-188682.923517     8248913.547689
-188696.061910     8248913.749923
-188709.109570     8248919.585791
-188722.723001     8248929.186799
-188736.971252     8248938.170870
-188749.343013     8248947.126820
-188761.785338     8248951.701481
-188771.675300     8248959.366577
-188779.092001     8248965.115769
-188788.365786     8248972.145436
-188798.880477     8248979.820149
-188810.707388     8248983.759392
-188818.205508     8248984.500752
-188830.728488     8248984.067569
-188842.705866     8248978.616902
-188856.490684     8248977.576433
-188865.875360     8248977.720888
-188877.762768     8248977.903866
-188894.019295     8248978.780805
-188908.903881     8248987.148726
-188925.715337     8248992.416584
-188940.044993     8248996.393587
-188953.788721     8248997.857028
-188966.231046     8249002.431688
-188972.477418     8249003.153781
-188973.092831     8249003.789198
-188973.718323     8249003.798826
-188974.970072     8249003.818094
-188978.098297     8249003.866246
-188978.723789     8249003.875874
-188982.467428     8249004.559442
-188985.535156     8249008.363859
-188990.480137     8249012.196407
-188995.424354     8249016.028943
-189002.922474     8249016.770304
-189009.178925     8249016.866607
-189020.500562     8249013.284444
-189031.772557     8249012.832005
-189036.788101     8249012.283263
-189038.039086     8249012.302519
-189041.792803     8249012.360299
-189045.496115     8249015.547789
-189046.112292     8249016.183219
-189049.230438     8249016.857160
-189065.941082     8249028.384440
-189088.312933     8249038.120263
-189097.647202     8249041.394429
-189098.878793     8249042.665275
-189101.996940     8249043.339217
-189105.700251     8249046.526707
-189110.634377     8249050.985797
-189111.260633     8249050.995437
-189118.697505     8249055.492286
-189119.948489     8249055.511542
-189121.200238     8249055.530810
-189121.825730     8249055.540438
-189123.056557     8249056.811273
-189126.174691     8249057.485978
-189126.164612     8249058.111767
-189126.730384     8249061.876908
-189129.858609     8249061.925059
-189130.463944     8249063.186266
-189131.039030     8249066.325605
-189135.357743     8249070.149278
-189135.963841     8249071.410496
-189136.528849     8249075.175625
-189136.518770     8249075.801415
-189136.508679     8249076.427968
-189136.438115     8249080.809259
-189136.206243     8249095.206236
-189136.145758     8249098.961737
-189135.510187     8249099.577899
-189130.898341     8249113.907457
-189125.712184     8249125.096924
-189124.450357     8249125.703446
-189120.615985     8249130.653510
-189116.125885     8249137.471315
-189110.959122     8249147.409191
-189110.878468     8249152.417035
-189106.428694     8249156.730918
-189099.990777     8249167.901881
-189086.084989     8249176.453352
-189081.645295     8249180.141445
-189077.214915     8249183.203737
-189075.943773     8249184.436060
-189075.933682     8249185.062614
-189075.923603     8249185.688403
-189075.913524     8249186.314193
-189075.903446     8249186.939982
-189077.134261     8249188.211581
-189077.760517     8249188.221221
-189078.386009     8249188.230849
-189079.011501     8249188.240477
-189078.386009     8249188.230849
-189077.124182     8249188.837371
-189075.863118     8249189.443904
-189072.018668     8249195.019758
-189071.312533     8249200.017210
-189070.050694     8249200.624496
-189069.334481     8249206.247737
-189068.618255     8249211.871742
-189068.527522     8249217.505375
-189072.220754     8249221.318656
-189078.416720     8249225.170460
-189078.981715     8249228.936352
-189083.361689     8249229.003772
-189088.366391     8249229.080807
-189097.730909     8249230.476841
-189110.243809     8249230.669447
-189119.083647     8249225.796430
-189123.553578     8249220.230968
-189131.858657     8249209.714690
-189135.773671     8249199.757546
-189141.616332     8249186.699586
-189150.607388     8249172.437435
-189154.492154     8249164.358424
-189158.346683     8249158.156780
-189166.550950     8249153.899925
-189175.481509     8249143.394039
-189185.652973     8249133.533198
-189197.035108     8249126.194771
-189206.500425     8249121.332146
-189221.596714     8249116.555432
-189229.750562     8249115.429052
-189237.883489     8249115.554239
-189247.207680     8249119.454194
-189250.952082     8249120.137775
-189257.137969     8249124.615368
-189267.622411     8249134.168213
-189279.994173     8249143.124164
-189293.566513     8249155.229082
-189313.950995     8249171.821233
-189348.099364     8249188.625247
-189390.805279     8249218.083696
-189437.618228     8249264.508925
-189487.145601     8249297.828807
-189521.687601     8249329.038662
-189545.745147     8249350.696437
-189553.727620     8249360.210769
-189558.722243     8249360.913594
-189561.800062     8249364.091457
-189565.503374     8249367.278948
-189582.295436     8249373.798396
-189615.071074     8249398.094908
-189648.301592     8249433.041772
-189672.934224     8249457.838886
-189678.464370     8249464.184984
-189679.089862     8249464.194612
-189679.079784     8249464.820401
-189683.449678     8249465.513610
-189688.968982     8249472.485486
-189697.001861     8249478.870107
-189711.200457     8249490.984665
-189719.252730     8249496.117696
-189719.817737     8249499.882825
-189720.443993     8249499.892464
-189723.521812     8249503.070327
-189724.147305     8249503.079955
-189727.265451     8249503.753896
-189728.496266     8249505.025495
-189732.189499     8249508.838775
-189733.441247     8249508.858043
-189737.144558     8249512.045534
-189740.777306     8249519.614315
-189742.008885     8249520.885926
-189743.169148     8249526.538051
-189742.987682     8249537.805317
-189742.896948     8249543.438951
-189741.575400     8249547.800985
-189735.863788     8249552.722154
-189723.825161     8249561.928309
-189714.309437     8249569.920646
-189705.489757     8249573.542084
-189693.461222     8249582.121686
-189683.925328     8249591.366366
-189683.824516     8249597.625788
-189683.501910     8249617.656399
-189686.539402     8249623.338184
-189694.027443     8249624.705334
-189708.406742     8249625.552614
-189722.867447     8249621.392825
-189727.327311     8249616.452389
-189736.237712     8249607.198082
-189743.341437     8249593.533588
-189750.950447     8249587.389736
-189761.707089     8249580.041681
-189773.685219     8249574.591790
-189787.539837     8249569.170019
-189795.068206     8249568.033247
-189801.950148     8249568.139178
-189824.967649     8249576.633050
-189852.889803     8249591.463392
-189870.751395     8249609.268599
-189888.552491     8249630.830070
-189901.489259     8249643.551150
-189922.539562     8249657.649007
-189944.295999     8249666.749413
-189973.509465     8249679.095089
-189996.517650     8249688.214762
-190014.015095     8249689.735983
-190037.699179     8249695.735573
-190071.403509     8249701.263456
-190109.507219     8249705.606403
-190132.010130     8249707.204671
-190138.892072     8249707.310602
-190139.518328     8249707.320242
-190140.143821     8249707.329870
-190140.759234     8249707.965287
-190141.374635     8249708.601469
-190142.000128     8249708.611097
-190142.626384     8249708.620737
-190143.251876     8249708.630365
-190143.877368     8249708.639992
-190151.384803     8249708.755552
-190174.544219     8249708.485327
-190204.574722     8249708.947575
-190235.231482     8249709.419462
-190245.241650     8249709.573545
-190252.759927     8249709.063326
-190260.327847     8249705.423385
-190274.717988     8249705.644886
-190289.107366     8249705.866377
-190305.939755     8249709.881903
-190329.623075     8249715.881481
-190360.844842     8249720.118498
-190384.549083     8249724.866509
-190412.632546     8249729.681163
-190441.936745     8249736.393206
-190471.736140     8249751.252443
-190498.346837     8249769.818266
-190522.504431     8249785.216606
-190539.821173     8249798.005105
-190551.638006     8249802.570138
-190559.135362     8249803.311486
-190570.326715     8249807.866127
-190584.030115     8249811.833490
-190597.077775     8249817.669357
-190607.694029     8249819.085423
-190618.793885     8249829.273685
-190637.391860     8249840.203307
-190654.638027     8249857.373860
-190676.828423     8249878.376186
-190694.084680     8249894.920186
-190708.838193     8249911.426426
-190721.109155     8249926.641035
-190724.661248     8249939.217660
-190728.869070     8249949.926545
-190729.767976     8249971.853792
-190730.625791     8249996.284949
-190731.402964     8250025.723186
-190731.100528     8250044.501454
-190730.626716     8250073.920436
-190730.344438     8250091.447125
-190731.414719     8250102.733659
-190737.863178     8250129.754649
-190747.399521     8250159.328477
-190756.461603     8250179.502779
-190771.770045     8250200.399937
-190789.520746     8250225.090356
-190810.944499     8250254.847162
-190834.901232     8250282.764360
-190847.061291     8250304.864945
-190858.080504     8250320.060287
-190870.331284     8250336.528004
-190870.886976     8250340.918934
-190872.087555     8250344.067901
-190881.159715     8250363.616413
-190885.327222     8250376.828456
-190885.317131     8250377.455009
-190885.630873     8250396.868706
-190889.031748     8250418.834465
-190891.726489     8250445.797676
-190892.594383     8250469.603044
-190893.563852     8250487.149001
-190894.562807     8250502.816814
-190897.883040     8250529.789652
-190898.327065     8250541.066547
-190901.900092     8250552.390841
-190907.904513     8250568.135701
-190918.762417     8250593.346730
-190931.487471     8250619.213209
-190945.524770     8250641.342690
-190957.795731     8250656.557300
-190962.104365     8250661.006761
-190963.335956     8250662.277608
-190966.978783     8250669.220600
-190970.672003     8250673.034644
-190973.739744     8250676.838296
-190980.520874     8250683.203650
-190980.500717     8250684.455229
-190985.425528     8250689.540120
-190985.980457     8250693.931038
-190995.203836     8250704.090417
-191009.261292     8250724.968319
-191018.999272     8250742.022538
-191018.989181     8250742.649091
-191019.534031     8250747.665799
-191023.692211     8250761.504406
-191028.495289     8250774.100287
-191033.278973     8250787.947759
-191033.137834     8250796.711103
-191036.064435     8250809.278100
-191039.697183     8250816.846882
-191044.005817     8250821.296343
-191051.312391     8250833.930760
-191054.380132     8250837.734412
-191058.133849     8250837.792192
-191066.207056     8250841.672891
-191069.900288     8250845.486171
-191077.337147     8250849.983785
-191081.000144     8250855.674434
-191085.269214     8250862.627829
-191093.857022     8250873.403369
-191100.617995     8250881.020302
-191104.291058     8250886.085925
-191108.619862     8250889.283044
-191109.246118     8250889.292683
-191117.379045     8250889.417870
-191121.759018     8250889.485290
-191122.384511     8250889.494918
-191123.010003     8250889.504546
-191122.999924     8250890.130335
-191123.625417     8250890.139963
-191123.615338     8250890.765752
-191124.240830     8250890.775380
-191124.230739     8250891.401934
-191131.103367     8250892.133666
-191135.432170     8250895.330785
-191136.673076     8250895.975831
-191144.171196     8250896.717191
-191152.859804     8250901.234072
-191161.598066     8250902.620466
-191169.681351     8250905.875376
-191182.749180     8250910.458900
-191196.372690     8250919.434119
-191209.834139     8250938.424249
-191225.717666     8250962.460747
-191242.045996     8250997.773387
-191258.222343     8251042.475149
-191273.298924     8251077.768521
-191276.820769     8251092.223279
-191283.521245     8251103.596476
-191295.651067     8251127.574430
-191310.122313     8251161.606596
-191322.887707     8251184.968388
-191330.779446     8251200.116354
-191343.494421     8251226.608623
-191355.644401     8251249.334998
-191356.825586     8251253.735556
-191357.995916     8251258.762655
-191364.696404     8251270.135089
-191364.645998     8251273.264800
-191369.540561     8251280.227824
-191373.829050     8251285.928100
-191373.778644     8251289.057812
-191374.404136     8251289.067440
-191378.552237     8251303.531837
-191382.739901     8251315.492300
-191383.314988     8251318.631640
-191384.476003     8251324.284541
-191388.703994     8251333.741082
-191389.885179     8251338.141640
-191393.548163     8251343.833053
-191394.778990     8251345.103888
-191404.728674     8251349.013471
-191414.052852     8251352.914191
-191424.689276     8251353.077913
-191432.822203     8251353.203100
-191449.099676     8251352.826944
-191466.708000     8251347.463717
-191483.691607     8251342.090109
-191502.460958     8251342.379018
-191523.802854     8251338.324385
-191541.401863     8251333.586959
-191551.482607     8251329.358987
-191563.370015     8251329.541966
-191576.528566     8251328.492621
-191584.672335     8251327.992030
-191593.431519     8251328.126857
-191594.682503     8251328.146113
-191602.169781     8251329.513251
-191606.539675     8251330.206460
-191610.293393     8251330.264239
-191611.544378     8251330.283495
-191615.278689     8251331.593629
-191615.904181     8251331.603257
-191622.160632     8251331.699560
-191623.401537     8251332.344606
-191627.044364     8251339.287598
-191630.637548     8251349.360312
-191634.159393     8251363.815070
-191638.377306     8251373.897401
-191638.357136     8251375.149744
-191638.336979     8251376.401323
-191638.316822     8251377.652902
-191630.547265     8251393.812453
-191619.678981     8251408.044944
-191618.427997     8251408.025688
-191609.668813     8251407.890862
-191604.047934     8251407.178397
-191599.043232     8251407.101362
-191593.977282     8251410.779815
-191590.213485     8251411.347825
-191578.174859     8251420.553981
-191562.927353     8251434.719829
-191558.376767     8251445.293134
-191558.275955     8251451.552557
-191563.059627     8251465.400793
-191567.176728     8251481.742546
-191566.985183     8251493.635602
-191567.449378     8251503.660154
-191570.981314     8251517.488358
-191570.789769     8251529.381414
-191571.395855     8251530.643396
-191577.511178     8251539.502280
-191577.450681     8251543.258545
-191580.578906     8251543.306696
-191587.390286     8251547.793918
-191590.508432     8251548.467859
-191591.053270     8251553.485331
-191595.200619     8251567.948952
-191596.321307     8251576.105775
-191597.421073     8251585.514165
-191601.599423     8251598.100429
-191605.777009     8251610.686682
-191606.826369     8251623.224784
-191607.947057     8251631.381607
-191609.077072     8251638.911864
-191612.568680     8251655.243990
-191615.323894     8251678.452464
-191618.503751     8251714.188659
-191622.883423     8251753.073810
-191622.399521     8251783.119344
-191625.860881     8251801.329603
-191625.840723     8251802.581181
-191626.991660     8251808.859872
-191631.229730     8251817.690624
-191632.310103     8251828.350605
-191639.000500     8251840.349592
-191643.853984     8251849.815761
-191648.012164     8251863.654369
-191651.685239     8251868.719228
-191652.290561     8251869.981199
-191657.780392     8251878.830455
-191663.179478     8251893.314108
-191664.369978     8251897.088865
-191667.992635     8251905.284199
-191671.605976     8251914.105335
-191671.545492     8251917.860836
-191667.442116     8251929.328295
-191672.140748     8251919.747832
-191672.766240     8251919.757460
-191673.391732     8251919.767088
-191674.017225     8251919.776716
-191677.145450     8251919.824868
-191676.519958     8251919.815240
-191675.268973     8251919.795984
-191675.894465     8251919.805612
-END
-LINE3D
-HEIGHT 1090.000000
-183557.000000     8249326.432006
-183577.244018     8249327.070372
-183616.033895     8249327.667448
-183644.813605     8249328.110443
-183669.899891     8249324.740155
-183691.807546     8249324.451426
-183709.971384     8249323.478362
-183725.713322     8249317.459697
-183739.578401     8249311.412142
-183747.156590     8249307.146414
-183754.189942     8249297.863214
-183771.980318     8249281.231965
-183796.783684     8249256.569855
-183823.453818     8249232.563189
-183841.264351     8249214.680361
-183845.119071     8249208.478721
-183848.983680     8249201.651288
-183849.044177     8249197.895024
-183852.454668     8249180.417250
-183858.458638     8249157.343603
-183863.271523     8249130.495954
-183867.368195     8249109.271546
-183875.814019     8249089.992682
-183882.403154     8249069.432584
-183883.956957     8249050.673578
-183887.327133     8249035.698962
-183888.345974     8249011.297456
-183889.314420     8248990.024897
-183889.485808     8248979.383419
-183889.647105     8248969.368496
-183884.994672     8248947.383472
-183881.068926     8248919.148660
-183880.685194     8248904.116261
-183879.726172     8248885.945285
-183876.194058     8248872.116314
-183876.214215     8248870.864735
-183875.124337     8248860.830553
-183869.109838     8248845.711482
-183863.660537     8248834.357544
-183855.042493     8248825.459372
-183837.736211     8248812.045090
-183816.555052     8248806.084026
-183786.604618     8248800.614690
-183757.209494     8248799.536277
-183735.332088     8248797.946873
-183712.879392     8248793.218891
-183684.180337     8248787.768053
-183656.207764     8248776.068186
-183635.732942     8248765.108910
-183614.602189     8248756.018135
-183586.700192     8248739.936214
-183558.778026     8248725.106636
-183557.000000     8248724.288663
-END
-LINE3D
-HEIGHT 1090.000000
-183557.000000     8247743.984493
-183572.072541     8247744.216497
-183592.718942     8247744.534299
-183607.108701     8247744.755795
-183625.888137     8247744.418533
-183650.378983     8247739.160864
-183665.455107     8247735.636111
-183677.402809     8247732.063585
-183693.043935     8247732.304343
-183712.459133     8247731.350922
-183724.356430     8247730.908108
-183728.735830     8247730.975519
-183731.864055     8247731.023670
-183732.419169     8247735.414974
-183733.650378     8247736.685814
-183740.340966     8247748.684804
-183745.739867     8247763.168072
-183753.469928     8247788.330956
-183763.046796     8247815.400483
-183769.697057     8247829.903395
-183770.262255     8247833.668527
-183776.932495     8247846.919093
-183782.422314     8247855.769112
-183786.055056     8247863.338276
-183795.964602     8247869.751784
-183806.580481     8247871.167461
-183810.334389     8247871.225244
-183814.985984     8247854.392136
-183816.590192     8247832.503419
-183818.042992     8247820.003832
-183818.930790     8247803.738735
-183820.434187     8247788.109440
-183825.196672     8247764.391120
-183832.431648     8247742.589075
-183835.620357     8247738.881726
-183836.871724     8247738.900987
-183838.122899     8247738.920246
-183841.987705     8247732.092435
-183847.719284     8247725.919684
-183860.978837     8247718.610920
-183883.703721     8247706.438766
-183908.900904     8247696.182884
-183930.324015     8247687.121180
-183954.300265     8247674.968288
-183970.022040     8247670.201584
-183981.979827     8247666.002887
-183995.199059     8247661.197662
-184021.728066     8247645.953577
-184048.852705     8247632.596876
-184070.820851     8247628.552264
-184085.210610     8247628.773761
-184109.055615     8247624.758039
-184136.069357     8247618.286932
-184161.851896     8247610.544602
-184185.797713     8247600.269458
-184207.210745     8247591.833543
-184228.694341     8247579.016339
-184252.710918     8247564.359525
-184274.355817     8247541.527015
-184301.812943     8247507.514292
-184335.991091     8247483.622812
-184373.246874     8247462.908810
-184399.251200     8247441.395674
-184425.860856     8247421.144127
-184453.197197     8247394.642791
-184477.869509     8247378.117854
-184502.541821     8247361.592918
-184513.278675     8247355.497212
-184522.128395     8247349.998785
-184539.757276     8247343.382838
-184563.097758     8247331.846487
-184593.976115     8247318.547565
-184634.350037     8247298.507886
-184662.271550     8247274.519718
-184678.164706     8247259.111919
-184689.628055     8247246.766421
-184700.394961     8247238.792961
-184710.475889     8247234.565375
-184728.801018     8247223.577769
-184751.465416     8247215.161116
-184767.207354     8247209.142451
-184772.293278     8247204.212034
-184777.298361     8247204.289075
-184782.949292     8247203.123786
-184788.025137     8247198.819158
-184797.470297     8247195.208112
-184810.053767     8247191.019046
-184825.775542     8247186.252342
-184836.411393     8247186.416056
-184845.170385     8247186.550880
-184857.057793     8247186.733858
-184868.319328     8247186.907202
-184877.683840     8247188.303618
-184889.419839     8247197.875727
-184906.100629     8247211.280382
-184924.577622     8247229.721770
-184943.014295     8247250.666698
-184952.126777     8247267.711670
-184960.553090     8247288.502513
-184968.969319     8247309.919527
-184977.980995     8247333.223540
-184987.719160     8247350.278143
-185000.555308     8247369.258648
-185011.514597     8247388.210264
-185021.888142     8247404.648703
-185026.086273     8247415.983001
-185029.779888     8247419.796287
-185030.264241     8247428.569259
-185037.499864     8247445.585342
-185042.202512     8247464.440651
-185042.142027     8247468.196152
-185042.565895     8247480.724626
-185043.686207     8247488.881061
-185044.937574     8247488.900322
-185052.364742     8247494.023349
-185064.716340     8247504.231261
-185080.125599     8247518.868615
-185094.243165     8247535.990628
-185113.355736     8247553.815473
-185125.697255     8247564.649174
-185138.563836     8247581.751932
-185150.229081     8247595.705329
-185153.155682     8247608.272326
-185156.768642     8247617.093456
-185160.976852     8247627.801964
-185165.689585     8247646.031102
-185169.736492     8247666.754916
-185175.650185     8247688.133027
-185183.501221     8247705.784527
-185193.309765     8247718.457455
-185209.354978     8247732.478653
-185230.475462     8247742.195215
-185246.611407     8247750.582779
-185258.973090     8247760.164520
-185276.370099     8247767.945551
-185293.716702     8247778.856294
-185314.171366     8247791.067149
-185337.673614     8247808.333235
-185370.611318     8247822.614453
-185396.696559     8247834.911977
-185423.448383     8247844.715220
-185457.616915     8247860.267272
-185494.328119     8247873.354302
-185519.788249     8247885.642205
-185544.501535     8247905.431475
-185567.973534     8247924.575694
-185592.151674     8247938.722079
-185618.893413     8247949.151493
-185641.265263     8247958.887316
-185662.396214     8247967.977711
-185683.607425     8247972.061021
-185704.203229     8247975.508532
-185727.967967     8247976.500278
-185747.342647     8247978.050776
-185772.318042     8247981.565700
-185799.786092     8247985.744937
-185832.884712     8247990.011225
-185867.224625     8247994.922183
-185889.102038     8247996.511205
-185900.938658     8247999.823888
-185917.669848     8248010.099214
-185936.197253     8248025.410508
-185964.704960     8248042.754024
-185994.927847     8248070.141347
-186017.199268     8248086.136599
-186033.234020     8248100.783580
-186044.950046     8248111.607653
-186063.578258     8248120.659907
-186080.945025     8248130.318689
-186103.942749     8248140.064146
-186123.801788     8248150.387235
-186141.744023     8248163.185362
-186152.844254     8248173.374012
-186161.381656     8248187.279263
-186170.574786     8248199.316773
-186171.190199     8248199.952191
-186171.805989     8248200.587996
-186172.431481     8248200.597624
-186173.056973     8248200.607252
-186176.134792     8248203.785115
-186186.024366     8248211.450587
-186200.172181     8248226.694469
-186221.706830     8248249.565681
-186247.641241     8248271.251963
-186257.459869     8248283.298719
-186262.323814     8248292.139105
-186262.899282     8248295.278451
-186264.140570     8248295.923502
-186265.179839     8248309.088157
-186269.186431     8248332.315129
-186272.617937     8248352.402761
-186272.386064     8248366.799739
-186272.184440     8248379.318584
-186271.882004     8248398.096852
-186271.690459     8248409.989908
-186267.058837     8248425.571052
-186259.732937     8248453.006728
-186250.550730     8248479.161176
-186243.891031     8248504.102564
-186237.957637     8248522.794157
-186230.086899     8248545.212361
-186220.288897     8248570.731387
-186215.597160     8248590.068801
-186209.714172     8248605.630683
-186198.785785     8248623.618681
-186189.734626     8248641.636338
-186177.484297     8248663.987129
-186165.102907     8248694.475475
-186152.247243     8248715.565059
-186134.982133     8248738.464603
-186120.269385     8248758.273713
-186108.170656     8248771.235375
-186104.295587     8248778.688591
-186094.779851     8248786.681692
-186078.846368     8248804.593413
-186064.840531     8248819.404318
-186054.698933     8248827.387020
-186045.788914     8248836.641333
-186033.114716     8248846.463651
-186019.713820     8248862.536521
-186004.416302     8248879.831322
-185991.661450     8248894.661483
-185976.313132     8248915.086754
-185952.710535     8248942.897833
-185931.711483     8248964.488014
-185918.341230     8248978.681993
-185917.695186     8248979.924702
-185917.049536     8248981.166653
-185912.538884     8248989.236795
-185906.111058     8248999.781205
-185900.318803     8249009.709453
-185891.328129     8249023.971610
-185886.121421     8249036.413414
-185880.833689     8249053.862292
-185871.611142     8249082.521427
-185861.863546     8249104.910741
-185860.380319     8249119.287693
-185859.654015     8249125.537488
-185863.064969     8249146.877458
-185871.330170     8249177.683609
-185875.346459     8249200.284785
-185883.268447     8249213.554619
-185891.149726     8249229.328368
-185899.081411     8249241.972407
-185910.131231     8249255.291150
-185926.186528     8249268.686177
-185944.118302     8249282.110087
-185968.256502     8249298.760018
-185991.728501     8249317.904237
-186013.979370     8249335.151826
-186030.629923     8249350.433848
-186042.315707     8249363.135672
-186058.410938     8249374.027535
-186075.767625     8249384.312106
-186091.287782     8249392.063866
-186110.521698     8249402.378096
-186137.162249     8249419.066545
-186159.362724     8249439.443081
-186172.309954     8249451.538377
-186180.897380     8249462.313911
-186190.110667     8249473.099843
-186198.072983     8249483.865754
-186207.871448     8249497.164472
-186218.255460     8249512.976745
-186221.868038     8249521.797869
-186231.091416     8249531.957248
-186240.910421     8249544.004392
-186253.161213     8249560.471345
-186267.884107     8249578.854947
-186269.085067     8249582.003920
-186269.710560     8249582.013548
-186270.336434     8249582.023182
-186270.961926     8249582.032810
-186271.587800     8249582.042444
-186272.213293     8249582.052072
-186272.223371     8249581.426282
-186272.848864     8249581.435910
-186274.100230     8249581.455172
-186282.667868     8249593.483055
-186299.388985     8249604.383788
-186313.082294     8249608.977704
-186334.293893     8249613.060638
-186357.432757     8249614.042750
-186382.327498     8249622.565518
-186412.247493     8249629.912984
-186445.871181     8249640.447947
-186483.329228     8249646.033609
-186503.783905     8249658.243700
-186526.054944     8249674.238946
-186536.630488     8249678.158927
-186542.251368     8249678.871392
-186556.489909     8249688.482022
-186584.936756     8249709.580651
-186611.567216     8249726.895653
-186627.057124     8249736.525545
-186640.740749     8249741.744492
-186663.758631     8249750.238370
-186692.992648     8249761.331709
-186727.826994     8249774.389850
-186754.598593     8249782.941507
-186773.862758     8249791.377606
-186795.548631     8249804.859302
-186824.086199     8249820.325061
-186855.146669     8249834.577001
-186881.908190     8249843.754448
-186906.298420     8249844.755822
-186927.570504     8249845.083255
-186945.088489     8249845.352902
-186966.935659     8249848.819675
-186988.126707     8249854.154946
-187010.519109     8249862.638432
-187036.009106     8249873.048196
-187062.720220     8249885.355354
-187096.323739     8249897.142660
-187119.856222     8249912.531378
-187144.660242     8249926.687015
-187172.652972     8249937.135302
-187201.967632     8249943.221561
-187230.636260     8249950.549766
-187258.053903     8249957.858714
-187279.800261     8249967.584909
-187296.672584     8249969.097272
-187314.745497     8249973.757837
-187337.208463     8249977.860033
-187355.271285     8249983.147152
-187370.912411     8249983.387910
-187374.040636     8249983.436062
-187378.420228     8249983.503475
-187390.933129     8249983.696081
-187414.707564     8249984.062032
-187446.009973     8249983.291969
-187472.428280     8249974.933099
-187495.829253     8249959.640865
-187516.081843     8249945.552058
-187533.902264     8249927.043437
-187559.321235     8249903.016748
-187587.152205     8249884.662216
-187605.588027     8249866.789777
-187618.282395     8249855.715117
-187631.642951     8249842.146933
-187646.990887     8249821.721656
-187665.477510     8249800.718748
-187696.385917     8249785.542073
-187725.387600     8249772.214646
-187745.620020     8249759.378183
-187762.643191     8249751.500641
-187775.882778     8249745.443459
-187790.433834     8249735.650031
-187810.736830     8249718.431513
-187832.957000     8249698.738727
-187855.056201     8249686.556943
-187877.720409     8249678.140287
-187896.661135     8249667.788483
-187921.212662     8249658.774934
-187950.113163     8249651.706160
-187977.752588     8249645.244684
-187999.740898     8249639.948112
-188016.754360     8249632.697130
-188030.689633     8249622.267515
-188048.339048     8249614.400377
-188062.910274     8249603.354607
-188080.024547     8249589.844202
-188099.176989     8249566.347000
-188113.293717     8249544.650882
-188125.382749     8249532.315015
-188125.392828     8249531.689226
-188129.863153     8249526.123006
-188136.896314     8249516.839803
-188145.847042     8249505.081574
-188153.455671     8249498.937716
-188154.716734     8249498.331182
-188155.988258     8249497.098865
-188156.624211     8249496.482710
-188157.955850     8249491.494122
-188164.333270     8249484.079423
-188169.469797     8249476.018915
-188173.919570     8249471.705033
-188177.108292     8249467.996919
-188184.727382     8249461.227278
-188189.116670     8249460.668896
-188195.373120     8249460.765199
-188207.865864     8249462.209384
-188220.933681     8249466.793673
-188225.303576     8249467.486882
-188231.549947     8249468.208974
-188239.037212     8249469.576876
-188248.421888     8249469.721331
-188255.303830     8249469.827262
-188261.630857     8249465.541511
-188262.326912     8249461.169848
-188263.023744     8249456.797434
-188263.084229     8249453.041933
-188263.144714     8249449.286432
-188263.154793     8249448.660643
-188258.986522     8249435.448589
-188246.705494     8249420.859004
-188246.090080     8249420.223587
-188245.535164     8249415.831905
-188241.912495     8249407.637334
-188241.548347     8249391.353348
-188241.094243     8249380.702243
-188244.989100     8249371.996678
-188258.430693     8249353.420656
-188271.710213     8249344.860310
-188276.190234     8249338.668294
-188276.835897     8249337.425579
-188288.814038     8249331.974924
-188307.058709     8249325.994783
-188326.574522     8249318.782319
-188355.475010     8249311.714309
-188381.268207     8249303.345817
-188406.394821     8249297.471607
-188424.749619     8249284.606242
-188436.082111     8249280.397538
-188454.387266     8249270.661895
-188473.963576     8249259.693166
-188485.931627     8249254.869065
-188490.391491     8249249.928629
-188499.836651     8249246.317582
-188518.081322     8249240.337441
-188535.033917     8249236.841954
-188542.562286     8249235.705182
-188543.823349     8249235.098648
-188543.833428     8249234.472859
-188551.402111     8249230.832929
-188565.165997     8249231.044791
-188581.432615     8249231.295177
-188605.782518     8249234.800473
-188628.921000     8249235.782579
-188649.497028     8249240.481675
-188678.216050     8249244.680931
-188714.988133     8249254.011703
-188747.450793     8249258.894529
-188771.770460     8249264.277193
-188801.035096     8249273.493169
-188828.441885     8249281.428660
-188856.485021     8249288.747236
-188887.585818     8249300.495254
-188911.774412     8249314.016237
-188938.516157     8249324.445269
-188958.385275     8249334.142569
-188978.850412     8249345.726876
-188996.126064     8249361.019285
-189017.146118     8249376.995275
-189035.653360     8249393.558530
-189056.713729     8249407.031362
-189080.912414     8249419.925792
-189100.115724     8249432.116622
-189116.200876     8249443.634274
-189128.572637     8249452.590225
-189152.166000     8249464.222684
-189181.924303     8249481.585832
-189227.879425     8249503.580667
-189262.693613     8249517.890387
-189291.322677     8249527.722525
-189324.350345     8249536.370479
-189366.067397     8249549.534563
-189393.939157     8249567.493852
-189424.908894     8249587.379425
-189456.544438     8249604.771469
-189488.815566     8249621.546587
-189514.245078     8249635.711851
-189531.632384     8249644.119060
-189540.956575     8249648.019015
-189541.561897     8249649.280986
-189542.187390     8249649.290614
-189542.167232     8249650.542193
-189542.783409     8249651.177622
-189543.388732     8249652.439593
-189549.544370     8249658.795319
-189550.775197     8249660.066154
-189551.390611     8249660.701572
-189551.380532     8249661.327361
-189551.996697     8249661.963554
-189551.986618     8249662.589344
-189551.976540     8249663.215133
-189551.966461     8249663.840923
-189552.531468     8249667.606051
-189553.096464     8249671.371944
-189553.025900     8249675.753235
-189552.945245     8249680.761078
-189553.429611     8249689.533287
-189553.248144     8249700.800553
-189553.056599     8249712.693609
-189552.824738     8249727.089823
-189552.613023     8249740.235222
-189556.276020     8249745.925871
-189567.971883     8249758.001905
-189582.927032     8249761.988536
-189596.045255     8249763.443113
-189606.681679     8249763.606835
-189616.691847     8249763.760918
-189623.573789     8249763.866849
-189631.697402     8249764.617837
-189635.430961     8249765.927196
-189638.478532     8249770.983191
-189642.787178     8249775.431889
-189651.435459     8249782.452692
-189663.746735     8249795.164144
-189684.191703     8249808.000794
-189706.503068     8249821.492118
-189732.467340     8249841.300644
-189752.196082     8249859.761300
-189763.790369     8249878.096745
-189779.209713     8249892.107927
-189799.584117     8249909.325868
-189825.649188     8249922.875735
-189847.335062     8249936.357431
-189857.285508     8249940.267026
-189868.405522     8249949.203709
-189875.843157     8249953.700570
-189877.084063     8249954.345616
-189877.073971     8249954.972169
-189877.699464     8249954.981797
-189878.324956     8249954.991425
-189878.951212     8249955.001065
-189879.576704     8249955.010693
-189887.094230     8249954.499699
-189904.602506     8249955.395906
-189922.039466     8249960.672627
-189927.609940     8249964.514803
-189928.235432     8249964.524431
-189943.170411     8249969.763405
-189969.871829     8249982.696358
-189981.557613     8249995.398182
-189982.808598     8249995.417438
-189991.487127     8250000.560108
-190010.054853     8250013.367863
-190018.753552     8250017.258191
-190022.497191     8250017.941760
-190028.077743     8250021.158146
-190037.987099     8250027.571652
-190041.095166     8250028.871382
-190047.916612     8250032.733578
-190051.599766     8250037.172648
-190061.509122     8250043.586153
-190074.597872     8250046.918111
-190084.587883     8250048.323772
-190092.014663     8250053.447175
-190100.683113     8250059.215635
-190108.756319     8250063.096335
-190115.577777     8250066.957767
-190119.876332     8250072.033018
-190123.609892     8250073.342376
-190123.599813     8250073.968166
-190128.534703     8250078.427267
-190134.074928     8250084.147576
-190135.255349     8250088.548122
-190139.574838     8250092.371042
-190140.765338     8250096.145799
-190141.320254     8250100.537481
-190141.875183     8250104.928399
-190144.832020     8250115.618028
-190144.711051     8250123.129029
-190144.640487     8250127.510320
-190144.418693     8250141.281508
-190144.338051     8250146.288588
-190143.611747     8250152.538383
-190135.297353     8250163.680462
-190127.587530     8250176.083737
-190123.137757     8250180.397620
-190115.538825     8250185.915682
-190104.106285     8250196.383820
-190096.507365     8250201.901119
-190095.205975     8250205.011574
-190093.823929     8250213.129873
-190089.938388     8250221.209637
-190089.867824     8250225.590928
-190089.847667     8250226.842507
-190093.511415     8250232.533931
-190098.435462     8250237.618810
-190102.118616     8250242.057880
-190107.124082     8250242.134927
-190113.461174     8250237.224151
-190121.766253     8250226.707872
-190133.844443     8250214.997783
-190141.443363     8250209.480485
-190150.323528     8250202.103546
-190159.798937     8250196.614367
-190166.125951     8250192.329380
-190170.515239     8250191.770998
-190181.221475     8250187.552654
-190188.164666     8250183.903096
-190191.292891     8250183.951248
-190195.046609     8250184.009027
-190205.056777     8250184.163110
-190210.687735     8250184.249785
-190211.928641     8250184.894831
-190212.544042     8250185.531012
-190213.109813     8250189.296153
-190213.735305     8250189.305781
-190213.715148     8250190.557360
-190213.694978     8250191.809703
-190213.019080     8250194.929786
-190211.696768     8250199.291809
-190207.246995     8250203.605691
-190202.786367     8250208.546116
-190198.921758     8250215.373549
-190188.790609     8250222.731232
-190183.674252     8250229.539397
-190183.613767     8250233.294897
-190182.261971     8250239.535064
-190181.616321     8250240.777015
-190181.596151     8250242.029358
-190187.802196     8250245.255373
-190192.171327     8250245.948569
-190197.802285     8250246.035245
-190207.822531     8250245.563538
-190216.662369     8250240.690521
-190221.738398     8250236.386278
-190233.766182     8250227.805900
-190250.800196     8250219.302581
-190272.717930     8250218.388063
-190282.102605     8250218.532517
-190293.909371     8250223.722575
-190321.972665     8250229.789573
-190346.877484     8250237.686551
-190366.837335     8250241.750217
-190386.161615     8250246.430045
-190419.190047     8250255.078011
-190449.200393     8250256.791838
-190463.530049     8250260.768841
-190472.823992     8250266.546929
-190491.432046     8250276.850762
-190504.348645     8250290.824184
-190507.406307     8250295.253626
-190507.961223     8250299.645308
-190514.571742     8250316.651387
-190522.957162     8250339.945760
-190527.640022     8250360.053419
-190532.958465     8250379.544151
-190537.580076     8250403.407299
-190541.072449     8250419.739436
-190546.480861     8250433.596524
-190558.620750     8250456.949453
-190567.148073     8250471.480493
-190573.848549     8250482.853691
-190581.074481     8250500.495187
-190590.156721     8250519.417910
-190598.643704     8250536.453636
-190601.681196     8250542.135421
-190605.858782     8250554.721674
-190608.866037     8250562.280827
-190613.094029     8250571.737369
-190616.697292     8250581.184294
-190620.138495     8250600.646131
-190624.951652     8250612.616223
-190629.200564     8250620.821197
-190629.725245     8250627.090248
-190630.845181     8250635.246295
-190631.945711     8250644.654697
-190633.085805     8250651.559165
-190633.640722     8250655.950847
-190633.539910     8250662.210270
-190633.489503     8250665.339981
-190632.652308     8250678.474988
-190624.973498     8250689.000142
-190619.836972     8250697.060650
-190619.150994     8250700.806523
-190613.439382     8250705.727691
-190601.431004     8250713.055715
-190591.915268     8250721.048815
-190586.214510     8250725.343442
-190580.502897     8250730.264611
-190574.105308     8250738.931652
-190569.039357     8250742.610106
-190568.353380     8250746.355978
-190562.631689     8250751.902937
-190556.849513     8250761.205395
-190552.349333     8250768.648990
-190542.157699     8250779.762173
-190536.385601     8250788.438843
-190535.578655     8250799.695717
-190535.518170     8250803.451218
-190536.093256     8250806.590557
-190547.345081     8250807.390461
-190559.857982     8250807.583068
-190578.071653     8250803.480283
-190587.587377     8250795.487947
-190595.266963     8250784.962040
-190599.777221     8250776.892657
-190608.001646     8250771.384222
-190615.630062     8250763.988016
-190621.957076     8250759.703028
-190623.279388     8250755.341006
-190627.033106     8250755.398785
-190632.057977     8250754.223478
-190637.144085     8250749.293445
-190640.897803     8250749.351225
-190649.051664     8250748.224081
-190652.189968     8250747.646443
-190655.943685     8250747.704222
-190656.569177     8250747.713850
-190657.699956     8250755.244120
-190658.880365     8250759.645430
-190659.990210     8250768.428030
-190663.633801     8250775.371034
-190667.841635     8250786.079154
-190669.082541     8250786.724200
-190679.073302     8250788.130637
-190688.457978     8250788.275092
-190691.586203     8250788.323243
-190695.339921     8250788.381023
-190699.709052     8250789.074220
-190705.269446     8250793.542185
-190710.204336     8250798.001287
-190710.749186     8250803.017995
-190716.249084     8250811.242225
-190724.210635     8250822.008125
-190724.815958     8250823.270096
-190726.007221     8250827.044864
-190729.760939     8250827.102644
-190733.504578     8250827.786213
-190743.514745     8250827.940295
-190746.642971     8250827.988447
-190747.269227     8250827.998087
-190747.904798     8250827.381925
-190747.914876     8250826.756136
-190749.165861     8250826.775392
-190749.791353     8250826.785020
-190750.417609     8250826.794659
-190750.427688     8250826.168870
-190751.053180     8250826.178498
-190751.063271     8250825.551944
-190751.073350     8250824.926155
-190751.083429     8250824.300365
-190752.344492     8250823.693832
-190756.118379     8250822.499268
-190761.133924     8250821.950526
-190765.523212     8250821.392144
-190775.534144     8250821.546239
-190784.858335     8250825.446194
-190797.926152     8250830.030483
-190814.747699     8250834.671787
-190833.375911     8250843.724041
-190843.325594     8250847.633624
-190848.260496     8250852.091962
-190859.986595     8250862.290628
-190872.893128     8250876.889076
-190883.963499     8250888.955482
-190890.098980     8250896.562787
-190896.890189     8250902.302351
-190903.641071     8250910.545837
-190914.065028     8250923.854183
-190922.672994     8250933.378144
-190928.778226     8250942.863581
-190942.250517     8250961.227934
-190953.794399     8250982.693090
-190957.317020     8250997.147095
-190960.919519     8251006.594009
-190961.333309     8251019.748272
-190964.885402     8251032.324897
-190967.943051     8251036.755102
-190970.920058     8251046.192388
-190971.404411     8251054.965361
-190974.997596     8251065.038075
-190974.876626     8251072.549077
-190976.016720     8251079.453545
-190977.126565     8251088.236146
-190977.045911     8251093.243990
-190976.975347     8251097.625280
-190976.854365     8251105.137046
-190976.803959     8251108.266757
-190977.430215     8251108.276397
-190978.055708     8251108.286025
-190978.045629     8251108.911814
-190977.944817     8251115.171237
-190977.793599     8251124.560371
-190977.047137     8251132.061744
-190975.603843     8251143.935533
-190971.688829     8251153.892677
-190971.002852     8251157.638550
-190966.471660     8251166.960264
-190965.836077     8251167.577190
-190964.564935     8251168.809513
-190960.094228     8251174.375727
-190954.383392     8251179.296143
-190944.311963     8251182.898314
-190936.804528     8251182.782755
-190931.173570     8251182.696080
-190918.670760     8251181.876920
-190904.452758     8251171.014717
-190890.859485     8251160.162130
-190885.864874     8251159.458541
-190877.115769     8251158.697924
-190868.992157     8251157.946936
-190857.731005     8251157.773598
-190848.971821     8251157.638771
-190845.218104     8251157.580991
-190840.767567     8251161.894862
-190834.995470     8251170.571532
-190830.545684     8251174.886179
-190826.630670     8251184.843323
-190826.509700     8251192.354324
-190827.024302     8251199.249164
-190831.848301     8251210.593478
-190832.917819     8251221.880001
-190836.540488     8251230.074571
-190836.913950     8251245.732756
-190841.687543     8251260.206781
-190842.111412     8251272.735254
-190845.693754     8251283.433747
-190849.337344     8251290.376750
-190849.882182     8251295.394222
-190852.939843     8251299.823664
-190856.633064     8251303.637708
-190857.863891     8251304.908543
-190864.726440     8251306.266065
-190871.608382     8251306.371996
-190878.480234     8251307.104481
-190885.352098     8251307.836201
-190898.480412     8251308.664225
-190911.609490     8251309.492260
-190920.357831     8251310.252865
-190924.102221     8251310.937210
-190932.225070     8251311.688186
-190940.974174     8251312.448802
-190944.717813     8251313.132371
-190945.343305     8251313.141999
-190949.077617     8251314.452134
-190955.273582     8251318.303938
-190958.976894     8251321.491428
-190965.172859     8251325.343232
-190968.906419     8251326.652591
-190968.896328     8251327.279144
-190970.096907     8251330.428112
-190973.114241     8251337.361475
-190976.737674     8251345.556058
-190980.370410     8251353.125603
-190981.490346     8251361.281650
-190982.681597     8251365.057183
-190983.307089     8251365.066810
-190983.851939     8251370.083518
-190984.366541     8251376.978358
-190984.941627     8251380.117698
-190985.467071     8251386.386760
-190986.627323     8251392.039649
-190986.607153     8251393.291992
-190987.091518     8251402.064201
-190987.081427     8251402.690754
-190987.071348     8251403.316544
-190987.051191     8251404.568123
-190982.601405     8251408.882769
-190977.535455     8251412.561223
-190976.909962     8251412.551595
-190967.515208     8251413.032930
-190956.859390     8251414.120798
-190945.536977     8251417.703713
-190939.906019     8251417.617038
-190927.332634     8251421.179932
-190914.759248     8251424.742827
-190903.477938     8251425.821067
-190899.077795     8251427.005991
-190894.052935     8251428.180534
-190887.776315     8251429.336574
-190884.283519     8251428.051231
-END
-LINE3D-MASTER
-HEIGHT 1100.000000
-183557.000000     8249745.357085
-183566.735702     8249746.393910
-183603.628564     8249748.213676
-183629.845235     8249752.374416
-183656.112133     8249753.404676
-183677.384026     8249753.732107
-183710.553406     8249753.616725
-183742.531917     8249749.725818
-183779.515499     8249745.912715
-183830.293597     8249740.433349
-183872.393167     8249729.811311
-183895.703406     8249720.152711
-183914.573569     8249714.182197
-183928.963329     8249714.403693
-183966.037645     8249704.956958
-184003.767892     8249693.641720
-184036.361995     8249690.386997
-184067.785386     8249682.105168
-184101.015060     8249678.234283
-184121.812679     8249669.162951
-184138.785635     8249664.415124
-184148.281201     8249657.674367
-184156.616326     8249645.280717
-184172.580057     8249625.490864
-184190.420636     8249605.730664
-184203.044427     8249599.038058
-184213.872014     8249587.308719
-184230.390854     8249571.910551
-184248.867206     8249551.533429
-184271.188188     8249525.581220
-184295.335623     8249502.787612
-184318.726517     8249488.121168
-184345.790474     8249478.520347
-184371.088475     8249462.004659
-184393.883922     8249445.451216
-184428.556508     8249429.706537
-184475.852898     8249407.268488
-184512.533403     8249383.415143
-184542.806418     8249368.855397
-184589.295658     8249357.674983
-184622.535423     8249353.177545
-184657.026542     8249348.700132
-184697.209116     8249340.553130
-184731.710327     8249335.449164
-184757.532996     8249325.203292
-184778.260051     8249320.513250
-184796.423877     8249319.540950
-184814.567545     8249319.820228
-184841.470396     8249320.234333
-184864.508257     8249327.475865
-184891.915630     8249335.410600
-184919.323183     8249343.346102
-184949.283505     8249348.189646
-184975.560673     8249348.594120
-184998.709615     8249348.950443
-185025.602197     8249349.990335
-185053.695739     8249354.179200
-185078.085575     8249355.181332
-185091.799436     8249358.522912
-185096.784362     8249359.851532
-185102.344757     8249364.319497
-185107.905139     8249368.788227
-185118.530721     8249369.577727
-185127.895239     8249370.973760
-185138.480875     8249374.267188
-185145.363199     8249374.373125
-185150.368283     8249374.450167
-185158.491501     8249375.201913
-185161.619726     8249375.250065
-185162.891263     8249374.016983
-185167.976989     8249369.086945
-185172.497720     8249360.391014
-185176.342170     8249354.815160
-185180.923386     8249342.363728
-185182.356219     8249331.115723
-185186.897108     8249321.168213
-185192.103816     8249308.726409
-185195.988581     8249300.647397
-185203.052372     8249289.486068
-185213.869499     8249278.382512
-185218.955607     8249273.452479
-185222.709325     8249273.510259
-185227.088916     8249273.577672
-185230.792228     8249276.765163
-185235.030680     8249285.595921
-185236.040107     8249300.637186
-185237.099929     8249312.549504
-185237.453221     8249329.460032
-185237.786368     8249347.621374
-185237.655308     8249355.758930
-185237.564574     8249361.392563
-185244.275523     8249372.139213
-185252.197129     8249385.409041
-185263.206634     8249401.230942
-185280.230637     8249432.171913
-185300.039652     8249445.624720
-185331.857044     8249451.749502
-185368.043568     8249458.567482
-185403.644926     8249462.871912
-185444.221120     8249469.131515
-185488.571189     8249474.197320
-185524.101985     8249482.883040
-185565.323828     8249487.900693
-185604.638577     8249494.766824
-185628.968323     8249499.523699
-185648.837822     8249509.221004
-185679.938608     8249520.969786
-185723.491821     8249536.665911
-185753.815514     8249557.794194
-185784.744924     8249580.183689
-185822.627221     8249598.297831
-185859.813081     8249620.783629
-185887.543702     8249647.506263
-185916.616411     8249668.615289
-185938.191393     8249688.982197
-185957.394691     8249701.173791
-185975.276441     8249717.727418
-185991.301108     8249733.000571
-186003.592227     8249746.963602
-186014.056881     8249757.768796
-186029.486304     8249771.154188
-186049.900654     8249785.868201
-186079.619012     8249805.735277
-186105.654241     8249821.161754
-186123.000838     8249832.072879
-186144.162031     8249839.285524
-186170.338387     8249845.949421
-186210.329034     8249849.695469
-186243.427660     8249853.961375
-186269.704827     8249854.365850
-186298.404074     8249859.816691
-186342.713828     8249867.385653
-186373.865019     8249876.004724
-186400.606382     8249886.433750
-186429.870636     8249895.649721
-186467.288369     8249903.738541
-186492.193201     8249911.634755
-186518.984958     8249918.934834
-186549.490499     8249928.795856
-186586.867904     8249939.388598
-186612.327653     8249951.676494
-186635.930712     8249962.683158
-186658.948594     8249971.177036
-186676.365767     8249977.706106
-186701.270599     8249985.602320
-186723.693237     8249992.208438
-186746.680883     8250002.579684
-186774.047739     8250013.018338
-186810.749233     8250026.731928
-186851.174222     8250042.379901
-186879.711789     8250057.845661
-186904.505718     8250072.627851
-186927.453037     8250085.503019
-186954.830353     8250095.315890
-186974.719640     8250103.760846
-186992.671954     8250115.933183
-187008.626057     8250135.587627
-187029.504972     8250160.326961
-187051.695356     8250181.330051
-187082.655014     8250201.841413
-187108.084895     8250216.007448
-187131.001978     8250230.759985
-187153.293174     8250245.503652
-187182.446537     8250261.604834
-187210.429188     8250272.678911
-187227.170462     8250282.328065
-187248.866414     8250295.183971
-187273.054639     8250308.704185
-187299.705269     8250324.766844
-187333.944358     8250335.937988
-187358.173291     8250346.954286
-187375.005299     8250350.969806
-187393.704074     8250355.640770
-187413.028354     8250360.320598
-187443.039070     8250362.035195
-187468.054792     8250363.046197
-187488.146086     8250358.972313
-187507.016249     8250353.001800
-187527.168015     8250345.173180
-187549.993519     8250326.741601
-187579.085935     8250307.780541
-187596.341360     8250285.506028
-187611.719533     8250263.203383
-187624.665918     8250236.480930
-187638.177705     8250213.522848
-187651.114011     8250187.426184
-187662.031950     8250170.063206
-187671.638407     8250156.437236
-187685.543814     8250147.885759
-187699.328238     8250146.846048
-187718.097589     8250147.134958
-187736.866941     8250147.423867
-187753.698948     8250151.439388
-187764.334990     8250151.603104
-187776.857970     8250151.169921
-187789.471682     8250145.103105
-187806.454526     8250139.729485
-187820.975728     8250131.813432
-187836.778151     8250122.039266
-187846.324123     8250112.168797
-187858.978163     8250103.598059
-187871.682609     8250091.897609
-187886.970048     8250075.228598
-187907.212560     8250061.765580
-187928.080551     8250048.312955
-187956.395875     8250038.731396
-187977.233630     8250027.156139
-187999.968783     8250014.358199
-188018.939758     8250002.128263
-188037.900655     8249990.524116
-188055.125832     8249970.127735
-188073.107549     8249941.604191
-188093.460939     8249921.256726
-188108.223710     8249898.317899
-188126.064289     8249878.557700
-188138.879626     8249859.972038
-188156.104803     8249839.575657
-188177.093776     8249818.611266
-188206.165640     8249800.902544
-188227.709924     8249784.329077
-188242.977587     8249768.911650
-188256.297435     8249757.847382
-188268.416716     8249743.633382
-188284.148575     8249738.240507
-188301.222140     8249727.234018
-188327.064979     8249715.735803
-188346.682380     8249702.263163
-188362.474724     8249693.114787
-188374.542823     8249682.031251
-188387.813040     8249674.095942
-188399.154835     8249669.262201
-188407.379259     8249663.753767
-188414.281371     8249662.607355
-188425.603772     8249659.025204
-188436.864925     8249659.198543
-188440.628721     8249658.630533
-188444.383202     8249658.688324
-188451.265145     8249658.794255
-188458.762501     8249659.535604
-188463.747797     8249660.864994
-188471.870645     8249661.615970
-188479.984179     8249662.992748
-188484.343219     8249664.312499
-188489.964098     8249665.024963
-188498.077632     8249666.401741
-188499.318537     8249667.046786
-188502.446763     8249667.094938
-188503.698511     8249667.114205
-188504.959574     8249666.507672
-188505.595145     8249665.891510
-188505.615303     8249664.639932
-188506.361777     8249657.137794
-188506.381934     8249655.886215
-188506.452510     8249651.504161
-188500.458169     8249635.133511
-188495.655091     8249622.537630
-188495.120332     8249616.894369
-188493.939147     8249612.493811
-188489.781719     8249598.655979
-188490.023670     8249583.633212
-188493.353519     8249571.162518
-188498.549767     8249559.346498
-188499.176023     8249559.356137
-188502.929740     8249559.413917
-188508.500213     8249563.256093
-188520.306204     8249568.446903
-188532.052473     8249577.393226
-188546.311566     8249585.751519
-188562.346311     8249600.398883
-188578.370978     8249615.672036
-188593.881056     8249624.049585
-188601.903856     8249631.059996
-188615.556838     8249638.157834
-188631.742814     8249643.415300
-188644.185139     8249647.989960
-188659.765780     8249651.986219
-188680.412372     8249652.304024
-188700.563768     8249644.474634
-188723.238818     8249635.432201
-188740.877391     8249628.190841
-188754.722694     8249623.394871
-188769.303617     8249611.723305
-188786.357788     8249601.968407
-188799.516339     8249600.919062
-188816.418528     8249600.553287
-188845.016593     8249612.262781
-188871.647435     8249629.577789
-188892.031917     8249646.169940
-188908.692168     8249660.826168
-188929.742458     8249674.924789
-188954.506150     8249691.584348
-188974.899948     8249707.550698
-188982.902579     8249715.813452
-188983.507913     8249717.074659
-188984.699177     8249720.849428
-188996.454761     8249729.169949
-189022.399638     8249750.230066
-189054.065431     8249765.743977
-189091.422667     8249777.589062
-189120.515163     8249797.445740
-189146.490277     8249816.628488
-189174.331788     8249836.465910
-189207.794167     8249857.016560
-189234.444415     8249873.079214
-189254.929710     8249883.411942
-189274.173335     8249893.099614
-189296.555265     8249902.209647
-189322.085589     8249910.115489
-189350.118646     8249918.059855
-189371.895240     8249925.908682
-189389.887881     8249935.577097
-189412.168998     8249950.946553
-189444.935334     8249975.868102
-189477.671408     8250002.668547
-189503.000108     8250023.093235
-189522.778492     8250038.424167
-189545.645538     8250056.307185
-189579.056760     8250079.986771
-189601.843163     8250102.876869
-189625.224047     8250127.654715
-189650.543420     8250148.705968
-189683.319070     8250173.001715
-189719.808862     8250199.859940
-189749.497378     8250221.603626
-189777.389284     8250238.312100
-189805.200559     8250260.026890
-189836.745370     8250283.052567
-189867.694949     8250304.189719
-189889.350574     8250319.549547
-189895.546540     8250323.401351
-189896.172032     8250323.410979
-189902.357907     8250327.889336
-189906.041061     8250332.328406
-189910.360549     8250336.151326
-189910.895308     8250341.794588
-189914.548214     8250348.111790
-189921.874182     8250359.494615
-189929.816340     8250371.512106
-189931.006828     8250375.287627
-189932.258576     8250375.306895
-189953.591157     8250371.878063
-189978.111672     8250364.742634
-189997.598012     8250359.407550
-190012.612882     8250359.638668
-190024.500291     8250359.821646
-190028.819779     8250363.644566
-190039.899465     8250375.085171
-190044.148378     8250383.290146
-190047.266524     8250383.964087
-190047.206040     8250387.719588
-190060.243621     8250394.181244
-190072.595225     8250404.388774
-190084.351572     8250412.709308
-190096.046672     8250424.785330
-190111.455937     8250439.422302
-190124.312815     8250457.151237
-190130.407969     8250467.262464
-190134.040717     8250474.831245
-190142.588185     8250488.111471
-190152.810518     8250513.938661
-190158.239852     8250526.544182
-190159.390025     8250532.822861
-190165.505336     8250541.682508
-190170.278941     8250556.155769
-190176.999587     8250566.276624
-190183.245946     8250566.999481
-190192.640713     8250566.517382
-190212.802176     8250558.062967
-190229.896674     8250545.804147
-190243.186285     8250536.617247
-190253.357762     8250526.755642
-190264.074828     8250521.912285
-190268.544771     8250516.346059
-190271.683075     8250515.768421
-190277.929447     8250516.490514
-190287.132656     8250527.902235
-190297.011775     8250536.193109
-190301.290937     8250542.519950
-190302.481436     8250546.294707
-190306.154499     8250551.360331
-190307.355842     8250554.509310
-190311.109559     8250554.567089
-190314.722137     8250563.388213
-190319.596555     8250571.602052
-190318.970299     8250571.592412
-190317.719314     8250571.573156
-190308.758507     8250583.957175
-190304.248237     8250592.027322
-190297.901053     8250597.564652
-190293.430346     8250603.130866
-190284.470302     8250615.514897
-190278.667969     8250626.068935
-190274.106529     8250637.268782
-190273.995638     8250644.153994
-190273.783935     8250657.298629
-190279.596810     8250684.936545
-190294.804452     8250712.092362
-190309.991923     8250740.500522
-190313.615344     8250748.695868
-190317.137189     8250763.150626
-190323.666289     8250785.164536
-190333.878544     8250811.617517
-190347.825110     8250839.380631
-190353.093147     8250862.001076
-190356.049996     8250872.689940
-190357.280811     8250873.961539
-190358.522481     8250874.606596
-190359.147973     8250874.616224
-190359.682732     8250880.259485
-190360.177176     8250888.405904
-190360.752262     8250891.545244
-190365.495607     8250907.897401
-190366.676028     8250912.297947
-190367.302284     8250912.307587
-190367.806807     8250919.828217
-190370.874535     8250923.632633
-190371.449621     8250926.771972
-190372.014629     8250930.537101
-190366.929284     8250935.467146
-190358.674612     8250942.853712
-190353.598582     8250947.157956
-190352.277022     8250951.520754
-190347.766764     8250959.590138
-190341.308689     8250972.012680
-190337.372742     8250983.222155
-190337.352584     8250984.473734
-190340.309421     8250995.163363
-190340.844957     8251000.805871
-190343.963091     8251001.480577
-190350.794627     8251004.716219
-190362.146513     8250999.255924
-190366.011885     8250992.428503
-190369.896663     8250984.348728
-190379.412399     8250976.355627
-190383.186274     8250975.161828
-190391.955536     8250974.670865
-190407.041745     8250970.519941
-190418.948548     8250969.451328
-190422.076773     8250969.499480
-190426.981427     8250975.835950
-190436.820219     8250986.630746
-190437.445711     8250986.640374
-190446.003270     8250999.294046
-190450.887754     8251006.882859
-190459.384829     8251023.292032
-190466.700718     8251035.300647
-190473.996450     8251048.560841
-190473.976293     8251049.812419
-190475.046575     8251061.098954
-190478.094145     8251066.154949
-190478.023582     8251070.536239
-190477.963097     8251074.291740
-190477.811879     8251083.680874
-190476.418991     8251092.424951
-190475.006710     8251102.420619
-190470.567015     8251106.108712
-190470.546846     8251107.361055
-190469.870184     8251110.481127
-190461.616287     8251117.866941
-190456.459603     8251127.179028
-190455.834111     8251127.169400
-190437.881797     8251114.997063
-190416.357221     8251091.500443
-190415.741807     8251090.865026
-190407.002794     8251089.477856
-190399.505437     8251088.736508
-190389.485191     8251089.208215
-190377.496970     8251095.284659
-190376.770666     8251101.534454
-190375.297124     8251115.286374
-190371.251049     8251133.381074
-190365.993553     8251148.952583
-190365.933068     8251152.708084
-190370.837722     8251159.044554
-190381.201195     8251176.108400
-190384.955676     8251176.166191
-190385.560998     8251177.428162
-190392.422783     8251178.785672
-190401.181967     8251178.920499
-190411.192134     8251179.074582
-190425.602433     8251178.044505
-190435.683177     8251173.816533
-190447.661319     8251168.365878
-190458.417948     8251161.018587
-190462.171666     8251161.076367
-190465.925383     8251161.134146
-190475.330216     8251160.027022
-190487.288201     8251155.827946
-190491.112481     8251151.504435
-190492.374309     8251150.897913
-190496.824094     8251146.583267
-190501.930372     8251140.400891
-190510.083457     8251139.274499
-190515.774899     8251135.605674
-190521.405858     8251135.692349
-190525.764910     8251137.011335
-190528.832650     8251140.814988
-190534.917713     8251151.552768
-190538.460491     8251164.755194
-190542.022663     8251176.706029
-190546.018795     8251200.558785
-190549.701936     8251204.998619
-190561.397812     8251217.073889
-190567.593765     8251220.926457
-190575.051558     8251224.171739
-190583.184485     8251224.296926
-190588.169793     8251225.625552
-190596.232157     8251230.132029
-190604.204539     8251240.272916
-190605.334554     8251247.803173
-190608.968065     8251255.371966
-190608.867253     8251261.631389
-190609.371764     8251269.152783
-190609.997256     8251269.162411
-190610.622748     8251269.172039
-190610.612670     8251269.797828
-190611.238162     8251269.807456
-190611.177677     8251273.562957
-190611.006289     8251284.204434
-190606.385141     8251299.159030
-190606.233922     8251308.548164
-190604.982938     8251308.528908
-190603.620286     8251315.395616
-190599.685115     8251326.604339
-190598.172021     8251342.859430
-190597.323971     8251356.620978
-190597.172753     8251366.010112
-190597.456246     8251387.301942
-190602.087948     8251410.538536
-190605.145610     8251414.967978
-190605.135519     8251415.594531
-190606.296546     8251421.246668
-190610.524538     8251430.703210
-190613.531781     8251438.263127
-190617.769852     8251447.093879
-190620.817435     8251452.149110
-190620.666217     8251461.538244
-190623.612975     8251472.853663
-190623.542412     8251477.234953
-190623.532333     8251477.860742
-190622.906841     8251477.851114
-190619.153123     8251477.793335
-190619.143032     8251478.419888
-190615.379236     8251478.987898
-190611.625518     8251478.930119
-190597.517656     8251461.181928
-190596.367483     8251454.903249
-190592.713814     8251448.586035
-190592.804547     8251442.952402
-190592.885190     8251437.945322
-190588.586634     8251432.870071
-190583.026240     8251428.402105
-190582.410826     8251427.766688
-190576.265279     8251420.784408
-190571.279971     8251419.455782
-190567.596817     8251415.016712
-190566.345832     8251414.997457
-190553.843023     8251414.178297
-190549.473128     8251413.485088
-190548.625842     8251427.246649
-190547.637428     8251449.770790
-190547.526538     8251456.656002
-190547.435804     8251462.289635
-190551.078631     8251469.232627
-190554.015311     8251481.173834
-190553.208364     8251492.430709
-190548.071838     8251500.491217
-190547.335455     8251507.366801
-190545.963488     8251514.859311
-190545.862676     8251521.118733
-190545.802192     8251524.874234
-190546.427684     8251524.883862
-190547.053176     8251524.893490
-190547.043098     8251525.519279
-190551.937673     8251532.481539
-190555.630905     8251536.294819
-190561.211457     8251539.511206
-190569.900065     8251544.028087
-190578.648405     8251544.788691
-190591.777483     8251545.616727
-190601.162159     8251545.761181
-190611.182406     8251545.289475
-190623.140378     8251541.091163
-190632.585550     8251537.479352
-190640.153470     8251533.839411
-190643.997921     8251528.263557
-190652.857916     8251522.138961
-190662.383718     8251513.520835
-190670.598064     8251508.638190
-190673.736368     8251508.060552
-190678.135747     8251506.875617
-190683.161371     8251505.701085
-190692.566204     8251504.593961
-190701.385120     8251500.972511
-190705.139601     8251501.030302
-190705.765094     8251501.039930
-190707.016078     8251501.059186
-190713.908100     8251500.539328
-190714.534356     8251500.548967
-190715.775262     8251501.194013
-190718.802675     8251507.501587
-190720.003253     8251510.650554
-190720.609340     8251511.912537
-190721.184426     8251515.051876
-190721.174347     8251515.677666
-190724.090869     8251528.870452
-190724.655877     8251532.635581
-190725.261199     8251533.897552
-190726.321402     8251545.809876
-190727.421169     8251555.218266
-190730.983353     8251567.168337
-190730.852293     8251575.305892
-190733.829300     8251584.743178
-190737.896759     8251604.214655
-190741.872720     8251629.319753
-190742.821269     8251648.117277
-190742.599475     8251661.888466
-190745.576482     8251671.325751
-190745.395028     8251682.592254
-190745.223640     8251693.233731
-190745.072422     8251702.622865
-190745.011937     8251706.378366
-190744.890967     8251713.889367
-190740.370618     8251722.585304
-190740.300055     8251726.966595
-190739.049070     8251726.947339
-190732.782529     8251727.477589
-190723.276884     8251734.844136
-190715.082708     8251738.474438
-190706.242870     8251743.347455
-190700.541349     8251747.642070
-190694.901075     8251748.181196
-190689.078572     8251759.987577
-190687.665527     8251769.983233
-190686.878726     8251779.989292
-190690.622364     8251780.672861
-190696.192838     8251784.515037
-190700.562732     8251785.208246
-190709.937329     8251785.978490
-190716.879757     8251782.328921
-190725.022762     8251781.828318
-190731.976032     8251777.552971
-190738.232483     8251777.649274
-190741.986200     8251777.707053
-190745.739918     8251777.764833
-190749.483556     8251778.448402
-190753.813124     8251781.645533
-190758.101600     8251787.346573
-190759.271943     8251792.372909
-190760.362394     8251802.407100
-190760.796341     8251814.309784
-190760.584638     8251827.454419
-190760.988337     8251841.235235
-190764.025829     8251846.917020
-190765.156607     8251854.447289
-190769.374520     8251864.529620
-190777.286417     8251878.426008
-190786.429154     8251893.592466
-190792.514216     8251904.330246
-190800.415283     8251918.851647
-190808.307023     8251933.999613
-190811.334436     8251940.307187
-190812.575342     8251940.952232
-190815.693476     8251941.626937
-190816.308890     8251942.262355
-190816.925067     8251942.897784
-190817.540480     8251943.533201
-190817.530402     8251944.158991
-190817.520311     8251944.785544
-190818.145803     8251944.795172
-190818.135724     8251945.420962
-190818.761216     8251945.430590
-190819.386709     8251945.440218
-190819.376630     8251946.066007
-190819.275818     8251952.325430
-190819.215333     8251956.080931
-190820.446912     8251957.352541
-190820.356191     8251962.985411
-190820.981683     8251962.995039
-190820.759889     8251976.766227
-190820.699404     8251980.521728
-190819.993257     8251985.519944
-190814.977713     8251986.068686
-190808.015128     8251990.969835
-190792.928919     8251995.120759
-190774.028519     8252002.968641
-190760.163822     8252009.016201
-190754.512694     8252010.181869
-190744.431963     8252014.409077
-190733.724963     8252018.627409
-190719.870357     8252024.048416
-190714.794315     8252028.353423
-190700.304126     8252034.391355
-190687.740819     8252037.328460
-190683.249955     8252044.146253
-190683.118894     8252052.283808
-190683.098737     8252053.535387
-190683.674587     8252056.674738
-190693.604100     8252061.836665
-190701.101456     8252062.578013
-190708.589497     8252063.945163
-190718.599665     8252064.099246
-190728.619912     8252063.627539
-190742.484609     8252057.579978
-190761.385021     8252049.731333
-190785.311055     8252040.708155
-190800.397253     8252036.557995
-190801.022745     8252036.567623
-190804.150970     8252036.615774
-190812.274582     8252037.366763
-190827.865302     8252040.737232
-190833.485418     8252041.449685
-190839.005473     8252048.422336
-190846.392702     8252056.048909
-190853.718670     8252067.431734
-190862.245993     8252081.962775
-190869.582040     8252092.719811
-190877.574604     8252101.607590
-190884.204517     8252117.362078
-190888.907546     8252136.217393
-190888.625268     8252153.744083
-190877.121400     8252168.593499
-190865.849405     8252169.045939
-190849.643272     8252165.040052
-190835.324470     8252160.436507
-190812.195303     8252158.828600
-190783.274645     8252167.148953
-190751.810939     8252177.933939
-190733.465456     8252190.173503
-190721.962352     8252205.022932
-190706.724925     8252218.562991
-190693.758370     8252246.537786
-190685.261758     8252268.946357
-190672.406094     8252290.035940
-190658.329694     8252309.228136
-190653.828751     8252316.671718
-190653.193180     8252317.287880
-190653.173010     8252318.540223
-190653.112525     8252322.295724
-190653.727939     8252322.931141
-190657.976851     8252331.136115
-190660.903453     8252343.703112
-190660.842968     8252347.458613
-190647.916740     8252372.929487
-190643.073034     8252401.655260
-190637.775974     8252419.730703
-190627.332310     8252446.492443
-190613.699172     8252476.961522
-190601.096764     8252521.220303
-190596.343791     8252544.312443
-190583.488127     8252565.402026
-190573.740530     8252587.791341
-190564.759553     8252601.427702
-190560.259374     8252608.871296
-190560.188810     8252613.252587
-190551.248160     8252624.385027
-190544.759837     8252638.685701
-190535.123132     8252654.189803
-190519.088849     8252678.360183
-190503.024305     8252704.409459
-190492.661295     8252726.163356
-190484.325980     8252738.557002
-190473.942812     8252761.562478
-190464.215373     8252782.700213
-190452.651785     8252801.305143
-190439.210192     8252819.881165
-190428.847182     8252841.635062
-190427.939411     8252859.152123
-190427.092137     8252872.912920
-190426.910671     8252884.180186
-190426.618326     8252902.331901
-190426.396532     8252916.103089
-190426.053768     8252937.385279
-190425.731175     8252957.415126
-190426.114716     8252972.447522
-190427.234652     8252980.603569
-190428.435994     8252983.752548
-190429.051395     8252984.388729
-190430.302380     8252984.407985
-190430.928636     8252984.417625
-190430.918557     8252985.043414
-190431.533971     8252985.678832
-190431.513813     8252986.930410
-190432.129215     8252987.566592
-190438.163883     8253001.433319
-190438.143726     8253002.684898
-190438.123556     8253003.937241
-190438.103399     8253005.188820
-190438.093320     8253005.814610
-190437.730387     8253028.349143
-190437.367466     8253050.882912
-190437.226327     8253059.646256
-190437.054951     8253070.286969
-190436.671860     8253094.073081
-190439.094401     8253137.937192
-190443.110690     8253160.538368
-190446.158273     8253165.593599
-190446.582905     8253178.122085
-190447.692750     8253186.904685
-190452.466343     8253201.378710
-190458.390121     8253222.130650
-190465.050270     8253236.007769
-190472.335923     8253249.893753
-190483.779756     8253277.618344
-190497.039582     8253309.127320
-190516.062189     8253332.585427
-190533.731460     8253362.284442
-190550.130353     8253393.215792
-190566.518403     8253424.772919
-190581.655469     8253456.310790
-190598.750430     8253482.869714
-190611.495653     8253507.483849
-190628.741832     8253524.653638
-190647.188577     8253544.973159
-190670.629958     8253565.994740
-190690.762411     8253598.235448
-190712.145836     8253630.496176
-190727.898315     8253662.669465
-190740.825005     8253676.016334
-190753.650883     8253695.622626
-190773.298971     8253719.091126
-190790.322604     8253750.031327
-190796.417746     8253760.143318
-190799.930288     8253775.223113
-190811.494326     8253795.436690
-190824.058859     8253831.317340
-190835.421274     8253864.049763
-190841.012368     8253905.458104
-190841.961680     8253924.255639
-190842.950555     8253940.549241
-190845.665454     8253966.260873
-190845.917934     8253989.430824
-190845.544934     8254012.590382
-190840.772555     8254036.934876
-190834.879488     8254053.122547
-190828.946094     8254071.814140
-190823.023542     8254089.879955
-190816.555389     8254102.928287
-190809.895691     8254127.869675
-190798.856019     8254152.743643
-190794.234858     8254167.699003
-190792.771406     8254180.824370
-190787.534832     8254195.144313
-190781.712341     8254206.949930
-190776.555657     8254216.262016
-190770.854887     8254220.557407
-190769.593060     8254221.163929
-190764.527873     8254224.842394
-190763.901617     8254224.832755
-190753.084490     8254235.936311
-190734.708771     8254250.053243
-190719.491513     8254262.340959
-190706.131326     8254275.909913
-190684.072453     8254285.587775
-190664.627204     8254288.418949
-190650.802834     8254291.962588
-190626.927205     8254297.856054
-190599.852775     8254308.083423
-190575.261697     8254319.600142
-190548.207437     8254328.575168
-190529.902269     8254338.311574
-190506.582332     8254348.595970
-190475.078299     8254361.884879
-190454.754763     8254380.354970
-190438.195788     8254398.257063
-190425.440936     8254413.087224
-190413.907596     8254429.814021
-190400.617221     8254439.000909
-190385.451133     8254448.158925
-190350.253091     8254457.635306
-190321.261869     8254470.336948
-190290.383328     8254483.635485
-190250.816931     8254492.417916
-190219.393540     8254500.699745
-190189.301788     8254503.992986
-190158.584544     8254507.276600
-190116.525492     8254515.394718
-190073.930918     8254517.869563
-190043.214438     8254521.153188
-190002.476935     8254524.909272
-189966.703819     8254531.245549
-189928.458970     8254535.665946
-189893.362516     8254538.882152
-189841.312703     8254545.593833
-189815.641239     8254546.451335
-189796.185911     8254549.908299
-189781.160199     8254550.302959
-189766.709573     8254553.836957
-189737.244077     8254557.139838
-189715.901417     8254561.194460
-189692.682293     8254565.219433
-189675.002629     8254574.964703
-189656.677304     8254585.952688
-189641.965333     8254605.761045
-189611.682035     8254620.947342
-189583.790568     8254643.058139
-189552.215971     8254660.728338
-189516.302479     8254675.827971
-189484.233426     8254685.352515
-189455.857618     8254698.689576
-189438.702635     8254714.703896
-189428.480764     8254727.694449
-189424.525423     8254740.155515
-189418.571871     8254760.098686
-189410.025605     8254785.637744
-189399.026247     8254808.008554
-189389.198009     8254835.404948
-189368.784516     8254859.507920
-189350.116415     8254891.778860
-189325.988756     8254913.320882
-189306.210847     8254936.806929
-189280.842269     8254957.704670
-189257.320709     8254980.507912
-189224.585085     8254992.525974
-189200.599316     8255005.305428
-189166.653047     8255014.799548
-189131.405363     8255027.405652
-189078.114656     8255033.471524
-189040.515457     8255036.649970
-188992.946430     8255037.169647
-188947.132885     8255045.230738
-188903.287326     8255047.686328
-188875.133300     8255047.252964
-188852.135957     8255037.507513
-188822.225684     8255029.532723
-188795.463769     8255020.356034
-188764.272238     8255014.241650
-188733.060574     8255009.377315
-188713.201523     8254999.054991
-188695.148410     8254993.141312
-188676.449623     8254988.471112
-188656.530099     8254981.903524
-188626.589553     8254975.808395
-188594.792712     8254968.431275
-188570.462966     8254963.674401
-188547.949989     8254962.701158
-188529.886760     8254957.415561
-188510.502007     8254956.490470
-188473.649295     8254952.166014
-188447.372509     8254951.761546
-188431.731383     8254951.520788
-188412.951941     8254951.858432
-188388.541540     8254952.109401
-188366.573401     8254956.153631
-188347.783892     8254957.116300
-188333.959510     8254960.660703
-188318.197414     8254967.930947
-188304.241232     8254979.611365
-188292.859110     8254986.949028
-188292.849019     8254987.575581
-188292.838928     8254988.202135
-188292.828862     8254988.827160
-188292.818771     8254989.453714
-188292.808704     8254990.078739
-188292.182448     8254990.069099
-188280.840641     8254994.903604
-188263.887270     8254998.399844
-188241.747755     8255013.084786
-188209.547641     8255030.746885
-188182.302612     8255051.614215
-188151.353507     8255069.294042
-188127.831158     8255092.098800
-188111.887596     8255110.636310
-188105.419455     8255123.683878
-188100.929342     8255130.502446
-188100.142566     8255140.506978
-188091.060764     8255160.403526
-188078.013579     8255193.384638
-188062.433388     8255228.206886
-188051.959475     8255256.846760
-188050.466170     8255271.849501
-188049.628962     8255284.985272
-188050.042764     8255298.138771
-188058.176918     8255337.081713
-188066.028411     8255393.551338
-188076.190616     8255423.135564
-188086.958181     8255453.979468
-188098.301215     8255487.962718
-188117.302876     8255512.673921
-188130.088427     8255534.784134
-188136.092847     8255550.528994
-188148.303312     8255569.499869
-188160.110528     8255613.508434
-188172.685153     8255648.762530
-188187.135465     8255684.047027
-188199.619344     8255724.935520
-188215.946897     8255760.248913
-188229.832978     8255791.767528
-188242.608462     8255814.502767
-188252.245631     8255837.816408
-188257.594310     8255855.429773
-188258.744482     8255861.708451
-188258.734391     8255862.335005
-188259.309478     8255865.474344
-188265.424801     8255874.333228
-188269.068379     8255881.276995
-188269.058313     8255881.902021
-188269.048222     8255882.528574
-188269.028064     8255883.780153
-188270.218552     8255887.555674
-188273.800894     8255898.254167
-188279.169731     8255914.615952
-188286.314257     8255937.264516
-188291.057602     8255953.616674
-188291.531876     8255963.015436
-188298.101316     8255982.524660
-188302.673285     8256009.517531
-188309.807720     8256032.792648
-188317.417169     8256065.468068
-188322.624721     8256091.844012
-188322.513843     8256098.728461
-188322.312219     8256111.247306
-188322.050098     8256127.522416
-188321.737570     8256146.927238
-188315.894922     8256159.984434
-188315.178684     8256165.609203
-188310.778553     8256166.793363
-188310.758395     8256168.044942
-188310.748304     8256168.671495
-188304.481788     8256169.200217
-188303.836138     8256170.442168
-188292.504397     8256174.651648
-188286.732312     8256183.327553
-188276.661647     8256186.929736
-188265.934502     8256192.398883
-188235.702375     8256204.455480
-188197.992297     8256214.518374
-188178.546284     8256217.349536
-188178.536193     8256217.976090
-188174.782476     8256217.918310
-188173.531491     8256217.899054
-188168.536116     8256217.195454
-188162.965631     8256213.354042
-188149.292491     8256207.507782
-188123.762167     8256199.601940
-188087.635758     8256189.027690
-188047.089800     8256180.890718
-188017.189976     8256172.290909
-187974.726820     8256166.629733
-187934.080074     8256164.750655
-187896.561530     8256162.921258
-187859.032894     8256161.718414
-187817.114600     8256161.073181
-187770.181156     8256160.975933
-187723.207372     8256163.383371
-187666.899319     8256162.516643
-187625.677463     8256157.499754
-187560.670724     8256152.741935
-187504.372737     8256151.250181
-187448.155429     8256144.749055
-187398.790173     8256140.233528
-187344.358978     8256139.395689
-187300.634389     8256134.340277
-187254.962378     8256133.637265
-187201.227264     8256128.426236
-187152.517749     8256122.042204
-187114.454366     8256115.195334
-187053.231568     8256108.618690
-187011.555620     8256092.949932
-186972.957085     8256080.460560
-186939.242663     8256075.559230
-186904.206694     8256075.019935
-186870.320897     8256080.759318
-186832.651159     8256088.317527
-186802.569868     8256090.984984
-186773.164475     8256090.532358
-186742.618976     8256083.176028
-186696.512648     8256070.569563
-186662.213049     8256063.155447
-186631.132422     8256050.155086
-186588.729787     8256040.736117
-186546.306971     8256032.570256
-186511.371432     8256025.771532
-186470.805316     8256018.886139
-186428.271597     8256017.606253
-186392.064916     8256012.039853
-186349.591693     8256007.003702
-186305.231163     8256002.563682
-186270.195194     8256002.024386
-186225.219239     8255996.949712
-186177.044495     8255996.208177
-186140.706753     8255998.779331
-186106.286209     8255998.874690
-186067.435644     8256002.033874
-186035.527900     8256001.542730
-186001.823570     8255996.014847
-185949.340179     8255990.824614
-185910.741644     8255978.335242
-185883.384510     8255967.269264
-185860.396851     8255956.898782
-185827.439365     8255943.869531
-185793.280918     8255927.691307
-185756.610054     8255912.099591
-185716.154817     8255898.329750
-185681.935898     8255885.906262
-185642.025498     8255877.153893
-185595.899013     8255865.799006
-185552.870862     8255856.371938
-185527.915624     8255851.605435
-185504.312565     8255840.598771
-185465.673714     8255830.612557
-185436.449788     8255818.892664
-185410.404492     8255804.091212
-185384.995138     8255788.674368
-185350.776218     8255776.250881
-185314.104947     8255760.660687
-185279.310942     8255745.097860
-185240.793061     8255727.600644
-185209.752748     8255712.097125
-185187.481710     8255696.101879
-185164.766264     8255668.829733
-185139.427115     8255649.030065
-185105.329141     8255629.097104
-185067.992063     8255616.000440
-185047.487005     8255606.918532
-185016.961663     8255598.310624
-184976.466136     8255587.042412
-184929.774606     8255571.924689
-184899.289247     8255560.810560
-184863.728215     8255554.002208
-184823.222573     8255543.362078
-184787.661732     8255536.553730
-184762.736743     8255529.909094
-184725.319010     8255521.820274
-184690.353438     8255516.898157
-184665.973477     8255515.270997
-184657.214485     8255515.136173
-184653.460577     8255515.078391
-184635.942401     8255514.808740
-184595.880999     8255515.443980
-184563.287075     8255518.699470
-184533.175344     8255523.245057
-184505.495783     8255532.210458
-184480.863792     8255546.231854
-184451.892549     8255557.681151
-184429.177757     8255569.226751
-184413.385413     8255578.375127
-184393.839160     8255587.465721
-184373.596827     8255600.929505
-184361.528168     8255612.012268
-184352.647991     8255619.389971
-184348.248432     8255620.574140
-184348.187960     8255624.328876
-184342.446290     8255631.128180
-184337.350294     8255636.684005
-184333.455234     8255645.390332
-184323.263599     8255656.503515
-184311.729687     8255673.230304
-184306.643948     8255678.161106
-184292.233840     8255679.191186
-184264.634933     8255683.148743
-184225.088312     8255690.679590
-184177.448530     8255695.580555
-184144.148268     8255703.834258
-184116.458449     8255713.424681
-184073.147828     8255721.524299
-184043.661996     8255726.077992
-184025.397143     8255733.311240
-184012.188187     8255737.490296
-183991.451065     8255742.805363
-183960.068001     8255748.583270
-183929.946370     8255753.755414
-183905.384967     8255763.393991
-183879.572174     8255773.014836
-183850.590840     8255785.090686
-183817.835440     8255798.360333
-183791.336681     8255811.726286
-183762.355347     8255823.802136
-183723.959090     8255837.611664
-183681.809114     8255851.363413
-183652.837871     8255862.812710
-183630.143236     8255873.106731
-183601.817809     8255883.315608
-183563.461891     8255894.620450
-183557.000000     8255896.915596
-END
-LINE3D
-HEIGHT 1110.000000
-183557.000000     8255579.169455
-183557.906957     8255578.982443
-183600.551555     8255573.377881
-183643.327214     8255559.635763
-183675.557742     8255540.097062
-183704.690294     8255518.632078
-183733.086285     8255504.041911
-183752.622446     8255495.577870
-183769.070722     8255484.560993
-183783.682263     8255471.012064
-183808.425157     8255450.104692
-183841.967524     8255426.830516
-183878.002201     8255404.218356
-183905.237712     8255383.977589
-183932.442808     8255365.613423
-183962.100232     8255350.417492
-183994.270097     8255334.633525
-184010.708281     8255324.243201
-184019.608425     8255315.613916
-184025.360353     8255308.189590
-184036.167580     8255297.712590
-184053.352417     8255279.820895
-184066.712807     8255266.251180
-184075.612926     8255257.623423
-184091.445585     8255245.971889
-184122.374366     8255229.542110
-184143.333079     8255210.456616
-184152.374540     8255193.064753
-184164.554103     8255175.096014
-184181.940398     8255144.683943
-184200.547978     8255116.170796
-184223.514634     8255088.975108
-184252.162630     8255058.737913
-184270.245362     8255023.954185
-184282.495489     8255001.604155
-184286.430864     8254990.394671
-184287.742536     8254986.657665
-184292.233006     8254979.840630
-184301.849554     8254965.588107
-184317.823365     8254945.172464
-184335.643786     8254926.663844
-184350.911449     8254911.246417
-184359.771254     8254905.121818
-184367.430098     8254895.848246
-184376.280002     8254890.350204
-184384.473808     8254886.719132
-184394.484167     8254886.873217
-184414.524851     8254885.929806
-184440.176336     8254886.324650
-184471.398115     8254890.560902
-184494.486561     8254894.673490
-184514.436524     8254899.362948
-184528.110045     8254905.209214
-184540.471728     8254914.790954
-184552.207727     8254924.363064
-184567.637163     8254937.747692
-184594.217420     8254958.191645
-184635.066252     8254986.369620
-184655.935088     8255011.734744
-184668.841608     8255026.333956
-184676.723078     8255042.107708
-184685.734754     8255065.411721
-184693.535378     8255086.193315
-184705.614807     8255113.300216
-184714.485331     8255145.368338
-184727.765696     8255175.625741
-184740.561529     8255197.109404
-184745.465801     8255203.445868
-184748.573868     8255204.745598
-184749.189460     8255205.381783
-184755.395505     8255208.607797
-184762.166735     8255215.599708
-184777.051142     8255223.966862
-184790.734564     8255229.186571
-184801.350448     8255230.601866
-184805.730040     8255230.669279
-184812.622049     8255230.150185
-184827.778834     8255221.617206
-184857.325163     8255213.307249
-184888.062386     8255208.771290
-184910.040617     8255204.100507
-184935.692293     8255204.495353
-184963.159948     8255208.675348
-184989.366552     8255213.461113
-185008.650493     8255220.645626
-185019.730942     8255232.086243
-185038.177700     8255252.405000
-185057.108822     8255281.495965
-185076.080236     8255308.085300
-185091.348362     8255331.485616
-185108.019073     8255345.516060
-185123.448483     8255358.902217
-185146.355487     8255374.280543
-185168.586210     8255392.778947
-185192.754647     8255407.551509
-185216.317367     8255421.062859
-185251.656617     8255441.641635
-185278.912963     8255458.965507
-185303.686735     8255474.999276
-185321.638654     8255487.172372
-185342.093331     8255499.382463
-185371.902816     8255513.615147
-185397.312146     8255529.033519
-185420.874891     8255542.543340
-185451.985767     8255553.665569
-185479.998642     8255562.863041
-185503.631950     8255571.991573
-185525.418623     8255579.214610
-185549.072471     8255587.091568
-185573.957145     8255596.239361
-185598.851886     8255604.762129
-185626.935349     8255609.576783
-185643.141470     8255613.583434
-185652.465649     8255617.484154
-185659.953308     8255618.851297
-185669.267420     8255623.377042
-185681.154446     8255623.560015
-185703.677897     8255623.906710
-185725.565382     8255624.870324
-185738.683618     8255626.324137
-185738.673551     8255626.949163
-185746.090622     8255632.699125
-185759.703671     8255642.300127
-185777.655615     8255654.471694
-185793.236244     8255658.468717
-185806.324613     8255661.800669
-185821.955672     8255662.666452
-185838.787668     8255666.682736
-185847.415409     8255674.955112
-185857.345304     8255680.117045
-185862.279824     8255684.575376
-185881.432728     8255699.895917
-185895.106250     8255705.742182
-185903.734397     8255714.013036
-185904.339707     8255715.275771
-185907.962389     8255723.469578
-185917.831787     8255732.387775
-185921.514941     8255736.826845
-185935.793797     8255743.934317
-185946.985150     8255748.488958
-185951.313954     8255751.686076
-185961.829026     8255759.360795
-185977.934717     8255769.626874
-185988.459499     8255776.675033
-185995.856412     8255783.676574
-186006.946571     8255794.490631
-186019.853473     8255809.089849
-186024.717430     8255817.929471
-186033.900482     8255830.592771
-186036.867398     8255840.656610
-186037.492890     8255840.666238
-186038.118764     8255840.675872
-186041.872482     8255840.733652
-186052.518615     8255840.270815
-186076.111583     8255851.904032
-186104.063986     8255864.856241
-186109.069070     8255864.933283
-186112.197295     8255864.981434
-186121.581970     8255865.125889
-186139.655266     8255869.786461
-186154.670899     8255870.017591
-186158.364120     8255873.831635
-186162.723554     8255875.150627
-186167.032582     8255879.599331
-186167.597577     8255883.365224
-186176.296288     8255887.254787
-186186.245959     8255891.165135
-186196.861843     8255892.580430
-186204.319254     8255895.825706
-186214.309264     8255897.231368
-186214.299173     8255897.857922
-186219.364754     8255894.178698
-186237.094429     8255881.304475
-186256.055338     8255869.699564
-186271.212099     8255861.168113
-186284.451304     8255855.110925
-186298.296225     8255850.314949
-186310.809126     8255850.507556
-186325.198886     8255850.729052
-186335.209435     8255850.883140
-186338.963153     8255850.940920
-186347.177116     8255846.058269
-186365.421787     8255840.078127
-186378.630744     8255835.899071
-186393.646377     8255836.130201
-186405.523695     8255836.939733
-186426.694585     8255843.526583
-186454.788139     8255847.714684
-186488.472312     8255854.494146
-186512.761336     8255861.755701
-186540.108404     8255873.446703
-186561.844695     8255883.797924
-186582.359845     8255892.253278
-186601.684506     8255896.933112
-186622.250061     8255902.258755
-186644.036735     8255909.481792
-186659.041920     8255910.337941
-186671.534639     8255911.783654
-186676.540104     8255911.860702
-186677.165597     8255911.870330
-186680.919314     8255911.928109
-186707.196482     8255912.332583
-186747.933997     8255908.575735
-186775.573410     8255902.115023
-186800.043901     8255898.109312
-186830.771249     8255894.198381
-186865.807218     8255894.737676
-186891.438711     8255896.385630
-186902.064687     8255897.174372
-186910.823488     8255897.309193
-186936.979687     8255905.224668
-186983.166669     8255912.823290
-187024.933363     8255922.857651
-187059.273276     8255927.768608
-187094.299536     8255928.934463
-187132.413325     8255932.651621
-187160.567351     8255933.084985
-187186.834453     8255934.114485
-187205.533216     8255938.786212
-187213.656458     8255939.536431
-187226.098796     8255944.110327
-187247.814905     8255955.714655
-187272.013590     8255968.609085
-187291.883090     8255978.306390
-187325.566881     8255985.085846
-187371.127989     8255992.674834
-187396.022730     8256001.197602
-187409.776930     8256002.034495
-187419.777389     8256002.815137
-187435.973444     8256007.446813
-187460.363662     8256008.448951
-187490.999882     8256010.172412
-187503.502716     8256010.990044
-187503.492625     8256011.616597
-187507.872217     8256011.684011
-187522.362788     8256005.646084
-187534.946252     8256001.457400
-187547.459153     8256001.650006
-187564.977138     8256001.919654
-187590.002939     8256002.304866
-187626.290657     8256002.863429
-187651.941951     8256003.258270
-187680.721469     8256003.701262
-187701.993553     8256004.028695
-187713.880962     8256004.211673
-187737.655397     8256004.577624
-187762.610635     8256009.344127
-187784.447714     8256013.437453
-187808.787169     8256017.567768
-187825.588916     8256023.462185
-187850.534087     8256028.853713
-187869.848658     8256034.160100
-187882.280904     8256039.360550
-187894.733307     8256043.309421
-187907.861634     8256044.136681
-187934.764294     8256044.550783
-187954.895890     8256037.974506
-187977.509704     8256032.686798
-187988.953087     8256021.592882
-187998.579702     8256006.715333
-188006.601288     8255974.907225
-188015.894755     8255941.868334
-188024.532125     8255910.696413
-188024.945464     8255885.032169
-188020.948963     8255861.178644
-188013.864934     8255834.773815
-188000.382945     8255817.035258
-187980.846130     8255786.681552
-187960.128513     8255751.927294
-187945.526575     8255726.033454
-187934.728786     8255697.066153
-187921.952920     8255674.330908
-187907.381256     8255646.557408
-187896.452025     8255625.727657
-187890.447604     8255609.982797
-187880.790279     8255587.920735
-187866.894488     8255557.028679
-187855.359922     8255534.937721
-187843.159549     8255515.340293
-187832.341577     8255487.626100
-187820.534361     8255443.617534
-187808.565835     8255409.624657
-187798.333042     8255384.423249
-187786.465353     8255344.169421
-187774.042711     8255299.526202
-187765.717024     8255272.475552
-187762.094367     8255264.280218
-187758.511643     8255253.581719
-187752.497157     8255238.461885
-187741.870719     8255198.855400
-187733.070758     8255162.405988
-187729.094414     8255137.300883
-187729.356535     8255121.025773
-187734.694686     8255100.446420
-187739.396489     8255080.483980
-187740.728510     8255075.495398
-187743.947456     8255069.910680
-187754.785122     8255057.555552
-187770.738776     8255038.391488
-187790.395715     8255022.416443
-187808.166112     8255007.037540
-187826.591868     8254989.790126
-187851.355110     8254967.631177
-187877.904465     8254951.135516
-187901.264717     8254938.347962
-187922.123024     8254925.520368
-187946.068834     8254915.245606
-187979.409411     8254904.488745
-188014.606690     8254895.012353
-188039.218689     8254882.244066
-188060.127020     8254866.286755
-188084.324861     8254840.363436
-188108.422271     8254820.699546
-188135.616919     8254802.960399
-188159.633675     8254788.304353
-188181.107383     8254776.112940
-188203.801827     8254765.818916
-188220.764501     8254761.697640
-188234.024652     8254754.387356
-188249.786748     8254747.117112
-188262.390369     8254741.676849
-188269.988550     8254736.158011
-188283.247913     8254728.849244
-188304.600639     8254724.169597
-188334.803294     8254713.990379
-188380.555565     8254709.686306
-188411.948708     8254703.282609
-188440.173310     8254699.333919
-188467.711923     8254699.131865
-188497.116935     8254699.584486
-188515.886286     8254699.873395
-188534.574982     8254705.170148
-188548.329553     8254706.007812
-188570.741730     8254713.239713
-188587.512871     8254721.010728
-188613.679518     8254728.301184
-188638.624665     8254733.694241
-188661.712753     8254737.805294
-188684.791514     8254742.542913
-188719.141494     8254746.828845
-188752.905558     8254748.600452
-188773.491652     8254752.674522
-188797.185814     8254758.048322
-188853.221680     8254775.815186
-188894.453627     8254780.205521
-188921.982162     8254780.629257
-188944.595951     8254775.343077
-188969.097072     8254769.459239
-188989.278717     8254759.751717
-189012.003410     8254747.579560
-189035.485407     8254727.280252
-189060.298279     8254701.992345
-189096.918681     8254681.894507
-189135.476033     8254658.070816
-189162.045940     8254640.322818
-189177.343088     8254623.027247
-189184.477825     8254607.484633
-189192.156635     8254596.959479
-189197.353647     8254585.143470
-189205.022378     8254575.244106
-189213.357693     8254562.850459
-189224.194977     8254550.495324
-189248.847317     8254535.222352
-189271.047329     8254516.781145
-189282.469778     8254506.939560
-189287.616383     8254498.253263
-189296.012183     8254482.104115
-189314.427478     8254465.482485
-189337.848990     8254448.938678
-189371.805363     8254438.817240
-189401.301095     8254433.636991
-189418.283939     8254428.263372
-189435.307874     8254420.385842
-189451.705540     8254412.499437
-189478.759800     8254403.524411
-189517.771281     8254390.350297
-189546.247901     8254370.753814
-189585.319866     8254353.824200
-189618.126054     8254337.424847
-189657.742857     8254325.512704
-189688.601241     8254313.465747
-189715.070336     8254301.977171
-189752.134000     8254293.156216
-189779.137854     8254287.310901
-189786.080282     8254283.661332
-189786.705774     8254283.670960
-189790.460255     8254283.728751
-189802.983234     8254283.295568
-189802.993326     8254282.669014
-189807.443099     8254278.355131
-189808.764647     8254273.993097
-189809.411073     8254272.750394
-189813.245432     8254267.801094
-189822.014707     8254267.309367
-189832.761258     8254260.587865
-189840.369505     8254254.444002
-189873.054723     8254245.555651
-189909.038778     8254226.074727
-189956.789272     8254214.287783
-189988.323554     8254199.120742
-190023.440941     8254194.652205
-190053.067734     8254181.334401
-190071.927819     8254175.989677
-190088.365812     8254165.599350
-190102.251443     8254158.299458
-190144.340731     8254148.303971
-190179.013316     8254132.559292
-190209.962433     8254114.878701
-190230.749401     8254106.433150
-190259.660744     8254098.738599
-190277.884481     8254094.010789
-190286.724319     8254089.137772
-190297.451476     8254083.667861
-190320.902473     8254065.245909
-190340.609831     8254046.140389
-190349.641202     8254029.375080
-190355.352815     8254024.453912
-190361.962107     8254002.642235
-190370.468034     8253979.607864
-190374.434218     8253966.521020
-190382.133198     8253954.743523
-190396.896352     8253931.804703
-190410.458150     8253905.717667
-190418.399082     8253878.917403
-190423.051243     8253862.084687
-190427.803452     8253838.992536
-190431.889855     8253818.393915
-190432.141885     8253802.745358
-190432.928674     8253792.740062
-190433.261358     8253772.083662
-190433.180254     8253738.272998
-190428.770333     8253701.265980
-190424.753292     8253678.664028
-190415.620647     8253662.871016
-190409.051219     8253643.361028
-190401.179637     8253626.961483
-190389.029657     8253604.235107
-190368.222070     8253575.114494
-190351.258170     8253540.418016
-190342.992968     8253509.611865
-190332.215718     8253479.392992
-190324.021080     8253444.205551
-190308.924342     8253410.163758
-190293.918324     8253370.489095
-190280.536766     8253346.491109
-190267.610076     8253333.144240
-190249.768653     8253314.086690
-190237.558188     8253295.115816
-190221.583928     8253276.712952
-190204.519979     8253248.275908
-190188.665924     8253222.362030
-190175.113742     8253209.005533
-190162.772229     8253198.171449
-190144.819915     8253185.999112
-190126.938165     8253169.445484
-190103.516954     8253147.171560
-190083.172799     8253128.075487
-190065.937462     8253110.279920
-190053.626186     8253097.568468
-190030.123569     8253080.301612
-189992.241641     8253062.188240
-189961.947814     8253039.181819
-189940.372832     8253018.814911
-189928.172446     8252999.218247
-189911.633178     8252977.050254
-189888.281779     8252950.394264
-189870.500841     8252927.581213
-189858.835214     8252913.627811
-189854.022057     8252901.657719
-189849.177888     8252891.565749
-189845.726607     8252872.729701
-189840.629958     8252839.467780
-189840.952551     8252819.437933
-189841.013036     8252815.682432
-189841.023127     8252815.055878
-189841.819995     8252804.424793
-189850.800960     8252790.789196
-189861.669256     8252776.555940
-189880.700716     8252760.570503
-189915.403550     8252742.947692
-189946.291419     8252729.022590
-189973.951001     8252721.309535
-190006.009964     8252712.411545
-190048.190748     8252696.782436
-190076.031810     8252677.801351
-190098.887550     8252657.492403
-190124.972341     8252630.971420
-190150.461875     8252602.563441
-190175.780034     8252584.796175
-190189.755622     8252571.863402
-190205.043443     8252555.194397
-190218.494364     8252535.991809
-190231.976271     8252514.912629
-190248.726792     8252485.117480
-190264.085189     8252464.066420
-190283.146898     8252446.202851
-190303.479748     8252427.106959
-190315.740156     8252404.130379
-190330.563031     8252377.436045
-190344.710758     8252353.862571
-190356.254189     8252336.509221
-190366.486902     8252322.892891
-190377.979927     8252308.669252
-190386.860080     8252301.293077
-190393.873083     8252293.261453
-190400.845759     8252287.733750
-190421.038234     8252277.401215
-190440.715356     8252260.173063
-190455.347449     8252245.371797
-190469.968687     8252231.197074
-190482.733618     8252215.741123
-190495.528797     8252198.407040
-190512.784592     8252176.133297
-190518.797877     8252152.433848
-190519.766884     8252131.162062
-190519.644688     8252099.855309
-190509.573586     8252064.638220
-190503.770789     8252036.374514
-190500.056937     8251994.995070
-190499.985147     8251960.558605
-190496.564102     8251939.845189
-190492.426843     8251924.755014
-190492.658716     8251910.358036
-190491.608592     8251897.819923
-190491.880779     8251880.919788
-190490.992716     8251858.366763
-190490.810799     8251830.815522
-190491.173720     8251808.281753
-190487.136510     8251786.932144
-190481.949891     8251759.303868
-190475.561166     8251728.526601
-190467.781081     8251706.493434
-190463.632968     8251692.029801
-190458.174161     8251681.301661
-190447.164275     8251665.479753
-190426.416409     8251632.603628
-190405.002735     8251602.221032
-190397.696924     8251589.586628
-190393.953286     8251588.903059
-190394.023849     8251584.521769
-190390.410507     8251575.700633
-190378.765814     8251560.494899
-190372.751315     8251545.375828
-190364.940218     8251525.220783
-190357.906607     8251495.685478
-190349.651484     8251464.253538
-190344.403604     8251440.381515
-190338.399184     8251424.636655
-190329.932358     8251406.349350
-190323.423415     8251383.083860
-190317.550055     8251359.201445
-190307.922978     8251335.261250
-190300.626482     8251322.001045
-190292.664930     8251311.235145
-190281.624808     8251297.290606
-190271.231087     8251282.104892
-190258.455627     8251259.368125
-190249.322982     8251243.575113
-190239.483426     8251232.780306
-190227.858890     8251216.322993
-190214.336192     8251201.088352
-190199.552431     8251186.460244
-190179.118306     8251172.997816
-190155.656004     8251153.227802
-190137.370556     8251122.893358
-190120.911930     8251095.718285
-190106.218902     8251075.456544
-190099.568820     8251060.954399
-190090.325284     8251052.046600
-190081.071669     8251043.764590
-190068.750301     8251031.679692
-190047.700011     8251017.581070
-190030.544565     8250994.777648
-190017.194007     8250968.902305
-190001.280231     8250946.743940
-189989.745665     8250924.652982
-189980.007697     8250907.598000
-189972.146193     8250890.572665
-189962.014593     8250859.111841
-189948.633035     8250835.113855
-189932.113924     8250811.694283
-189914.282580     8250792.010944
-189902.112443     8250770.536148
-189890.557719     8250749.696769
-189877.872980     8250721.327132
-189860.688050     8250700.401854
-189842.876876     8250679.466172
-189821.826573     8250665.368315
-189800.181027     8250649.382697
-189774.842248     8250629.583799
-189752.086093     8250604.815569
-189737.373660     8250585.806183
-189712.630137     8250567.894281
-189687.270437     8250549.346950
-189661.275917     8250531.416556
-189642.708190     8250518.608802
-189629.791591     8250504.635379
-189616.289051     8250488.149159
-189607.105999     8250475.485859
-189599.830425     8250460.974086
-189590.717949     8250443.928731
-189574.753767     8250424.900077
-189553.774040     8250406.420166
-189537.093633     8250393.015517
-189517.849244     8250383.327834
-189499.261347     8250371.772422
-189485.598274     8250365.301137
-189473.276918     8250353.215475
-189447.817170     8250340.927578
-189411.125742     8250326.588963
-189378.258607     8250307.926073
-189354.050606     8250295.657445
-189337.944521     8250285.392123
-189318.710975     8250275.078663
-189299.527847     8250261.634726
-189280.465676     8250240.680552
-189266.468704     8250216.047149
-189254.258239     8250197.076275
-189245.034860     8250186.916896
-189235.216238     8250174.869758
-189224.772123     8250162.812991
-189216.789650     8250153.298658
-189216.184315     8250152.037452
-189215.568902     8250151.402034
-189214.962816     8250150.140051
-189210.028677     8250145.681726
-189206.285038     8250144.998157
-189200.099164     8250140.519799
-189199.482987     8250139.884370
-189198.242081     8250139.239325
-189194.498442     8250138.555756
-189188.302489     8250134.703188
-189187.050740     8250134.683920
-189182.732015     8250130.861012
-189178.988377     8250130.177443
-189178.423369     8250126.412314
-189172.187089     8250125.063668
-189167.877679     8250120.614958
-189167.887757     8250119.989169
-189163.599281     8250114.288128
-189158.684548     8250108.577448
-189154.385981     8250103.502960
-189153.154402     8250102.231350
-189148.220264     8250097.773024
-189140.247870     8250087.632902
-189132.831168     8250081.883709
-189126.665451     8250076.153773
-189122.356041     8250071.705063
-189121.740640     8250071.068882
-189120.489655     8250071.049626
-189115.484189     8250070.972579
-189109.873389     8250069.634325
-189106.119671     8250069.576545
-189100.488713     8250069.489870
-189091.679888     8250072.484766
-189087.229351     8250076.798637
-189079.419480     8250095.461347
-189077.673750     8250126.113403
-189085.181949     8250126.228974
-189093.304797     8250126.979950
-189097.674679     8250127.673923
-189097.654522     8250128.925502
-189104.415495     8250136.542435
-189104.395325     8250137.794778
-189104.839363     8250149.070908
-189104.738551     8250155.330331
-189103.981998     8250163.458258
-189098.189744     8250173.386506
-189091.287631     8250174.532918
-189081.227057     8250177.508547
-189066.312236     8250171.017994
-189053.335152     8250160.800072
-189046.018486     8250148.792210
-189046.109219     8250143.158577
-189045.554303     8250138.766894
-189041.961882     8250128.694191
-189033.969331     8250119.805648
-189029.045271     8250114.721533
-189020.497790     8250101.442071
-189003.261703     8250083.645728
-188990.345091     8250069.673070
-188982.898153     8250065.801246
-188982.918311     8250064.549667
-188978.548416     8250063.856458
-188967.367918     8250058.675276
-188942.473165     8250050.153272
-188921.342220     8250041.062495
-188902.663603     8250035.139952
-188887.718533     8250030.527532
-188870.291663     8250024.624257
-188853.489522     8250018.730598
-188838.564622     8250012.865835
-188832.378735     8250008.388241
-188824.871300     8250008.272682
-188812.358399     8250008.080076
-188791.146800     8250003.997142
-188778.028577     8250002.542565
-188768.088973     8249998.007192
-188753.698831     8249997.785690
-188740.550360     8249998.209246
-188740.540281     8249998.835035
-188739.894619     8250000.077750
-188727.200264     8250011.151646
-188711.922521     8250027.194863
-188696.069680     8250040.099504
-188680.842344     8250053.013009
-188661.831041     8250067.746867
-188639.015628     8250085.551892
-188621.235140     8250101.557349
-188604.787068     8250112.573466
-188589.075366     8250116.714762
-188566.481734     8250120.749364
-188547.016327     8250124.832117
-188530.042798     8250129.579935
-188514.230297     8250139.979890
-188502.182343     8250149.812611
-188490.103401     8250161.521925
-188469.759696     8250181.244359
-188436.167483     8250207.649018
-188401.898596     8250237.174514
-188373.462290     8250254.267839
-188352.674572     8250262.712614
-188324.995583     8250271.678024
-188285.448580     8250279.208865
-188253.470272     8250283.099011
-188229.685364     8250283.359608
-188217.111979     8250286.922503
-188206.990920     8250293.653632
-188189.371742     8250299.643402
-188169.250594     8250305.594659
-188155.365357     8250312.893793
-188141.459951     8250321.445269
-188126.898803     8250331.865250
-188108.553702     8250344.104820
-188088.906447     8250359.454834
-188064.274660     8250373.475469
-188047.251107     8250381.353004
-188046.605075     8250382.594949
-188045.898928     8250387.593165
-188044.566919     8250392.580983
-188039.491260     8250396.885996
-188029.339953     8250405.495258
-188017.200514     8250420.960836
-188003.164059     8250437.649104
-187994.183476     8250451.284708
-187984.566928     8250465.537231
-187971.721343     8250486.001025
-187959.026988     8250497.074921
-187957.715137     8250500.811160
-187957.634482     8250505.819004
-187953.103672     8250515.140725
-187952.407617     8250519.512387
-187951.731336     8250522.632465
-187947.261011     8250528.198684
-187936.453963     8250538.676451
-187930.691957     8250546.726567
-187929.995889     8250551.098993
-187928.552990     8250562.972023
-187927.675085     8250578.610946
-187927.231510     8250606.152559
-187927.484372     8250629.322515
-187930.905417     8250650.035931
-187930.663466     8250665.058699
-187923.469008     8250684.356825
-187912.298658     8250717.368355
-187896.193799     8250745.920788
-187884.124924     8250757.005077
-187873.489264     8250756.841366
-187860.410986     8250752.882861
-187843.538651     8250751.371263
-187826.101321     8250746.093771
-187802.397449     8250741.346530
-187773.123117     8250732.756349
-187740.690311     8250725.996149
-187706.915787     8250724.850326
-187663.877175     8250716.049041
-187637.105575     8250707.497384
-187607.276314     8250694.516284
-187571.866501     8250678.318798
-187538.919093     8250664.663758
-187522.187897     8250654.388815
-187508.564769     8250645.413602
-187485.587215     8250634.415802
-187462.640278     8250621.540640
-187448.330779     8250616.312059
-187432.750138     8250612.315800
-187409.672153     8250607.577429
-187378.460464     8250602.714623
-187352.263951     8250597.302305
-187322.333878     8250590.580628
-187279.305357     8250581.152789
-187240.767318     8250564.907152
-187200.352421     8250548.632625
-187144.346804     8250528.987629
-187108.301407     8250513.407068
-187071.529337     8250504.075533
-187033.455876     8250497.854453
-187007.814661     8250496.833823
-186982.173064     8250495.813187
-186959.114854     8250489.823231
-186931.737920     8250480.010367
-186904.996557     8250469.581341
-186885.298445     8250449.242559
-186874.995075     8250428.423206
-186867.678804     8250416.414585
-186852.885346     8250402.412272
-186831.239800     8250386.426655
-186800.845149     8250369.680421
-186772.267255     8250356.718583
-186747.372501     8250348.196580
-186728.108337     8250339.760481
-186708.915117     8250326.943098
-186676.028194     8250309.532557
-186646.895001     8250292.179032
-186625.209128     8250278.697336
-186599.153742     8250264.522437
-186566.862075     8250248.998892
-186535.196282     8250233.484981
-186511.633550     8250219.974396
-186494.316807     8250207.185897
-186482.641484     8250193.858289
-186467.847644     8250179.855971
-186438.109116     8250161.241239
-186401.488251     8250142.521333
-186371.083904     8250126.400895
-186352.385128     8250121.729931
-186348.005537     8250121.662518
-186347.380045     8250121.652890
-186346.754170     8250121.643256
-186342.394736     8250120.324263
-186318.176276     8250108.681418
-186282.695886     8250096.865987
-186252.250842     8250083.248700
-186224.914223     8250070.932678
-186200.049730     8250060.531778
-186182.612388     8250055.255050
-186168.282731     8250051.278048
-186146.496058     8250044.055011
-186114.093870     8250035.417448
-186058.552448     8250025.797003
-186015.574334     8250013.239453
-185988.227635     8250001.549220
-185963.948308     8249993.661870
-185932.756790     8249987.546721
-185903.492524     8249978.331515
-185881.050110     8249972.976982
-185863.663186     8249964.569779
-185846.871505     8249958.050337
-185841.240547     8249957.963662
-185836.871416     8249957.270465
-185832.491825     8249957.203051
-185810.614406     8249955.614412
-185795.134577     8249945.358730
-185780.865799     8249937.625469
-185775.315483     8249932.531714
-185770.401133     8249926.821039
-185766.778094     8249918.625698
-185760.642613     8249911.018394
-185753.851404     8249905.278829
-185747.756250     8249895.167603
-185743.396828     8249893.847846
-185739.107958     8249888.147564
-185738.553041     8249883.755881
-185732.922083     8249883.669206
-185721.660549     8249883.495862
-185720.409182     8249883.476600
-185716.029973     8249883.409193
-185712.215389     8249887.106908
-185707.200214     8249887.656420
-185697.644163     8249898.152678
-185676.049485     8249917.855093
-185656.251393     8249942.594246
-185647.330901     8249952.475107
-185635.988725     8249957.308842
-185625.928151     8249960.284471
-185619.671700     8249960.188168
-185598.540756     8249951.097390
-185558.660999     8249940.466130
-185527.509796     8249931.847823
-185510.223302     8249917.181192
-185489.889607     8249897.459335
-185465.812286     8249877.053145
-185446.689248     8249859.854466
-185440.543688     8249852.872951
-185435.013924     8249846.526859
-185428.838128     8249841.422712
-185417.222908     8249824.339598
-185408.150747     8249804.791086
-185398.463185     8249784.606392
-185386.898370     8249764.393567
-185377.069669     8249752.972218
-185367.180089     8249745.307127
-185362.255659     8249740.222242
-185350.438815     8249735.657974
-185336.210352     8249725.421554
-185318.218093     8249715.753145
-185307.016674     8249711.823529
-185306.391182     8249711.813901
-185305.139815     8249711.794640
-185303.888449     8249711.775378
-185303.262957     8249711.765750
-185298.883365     8249711.698336
-185295.129647     8249711.640557
-185273.857563     8249711.313124
-185258.842312     8249711.082000
-185258.832221     8249711.708553
-185250.062959     8249712.199516
-185231.919100     8249711.920235
-185225.662650     8249711.823932
-185221.283440     8249711.756524
-185212.534335     8249710.995908
-185203.775152     8249710.861081
-185199.395942     8249710.793674
-185193.775075     8249710.080445
-185189.405562     8249709.387242
-185183.845550     8249704.919283
-185179.536534     8249700.469815
-185174.602013     8249696.011483
-185174.612092     8249695.385694
-185174.733074     8249687.873928
-185174.914528     8249676.607426
-185175.035510     8249669.095660
-185175.267370     8249654.699446
-185176.699822     8249643.451436
-185181.291116     8249630.374214
-185184.610887     8249618.529310
-185184.741935     8249610.392519
-185185.519027     8249601.013018
-185185.700494     8249589.745752
-185185.781148     8249584.737908
-185185.225838     8249580.346984
-185180.906731     8249576.524070
-185174.024788     8249576.418139
-185167.768338     8249576.321836
-185161.511887     8249576.225532
-185160.260521     8249576.206271
-185155.870851     8249576.764647
-185155.164704     8249581.762863
-185150.078978     8249586.692901
-185150.018493     8249590.448402
-185144.882348     8249598.508916
-185144.105256     8249607.888416
-185138.303304     8249618.442459
-185129.978068     8249630.210317
-185116.527160     8249649.412140
-185093.711734     8249667.217930
-185077.354001     8249672.601171
-185067.969325     8249672.456717
-185046.707702     8249671.503500
-185021.146760     8249665.475020
-184996.201613     8249660.081964
-184973.133312     8249654.718562
-184936.916552     8249649.777950
-184906.330547     8249644.924775
-184875.744542     8249640.071600
-184848.286775     8249635.265813
-184818.265777     8249634.177766
-184800.747793     8249633.908119
-184784.480983     8249633.657730
-184762.502753     8249638.328513
-184745.499560     8249644.953708
-184736.014073     8249651.068676
-184729.666889     8249656.606007
-184717.608105     8249667.063741
-184689.847889     8249681.036986
-184660.795992     8249697.494127
-184633.681629     8249710.224659
-184615.396822     8249718.708725
-184599.634726     8249725.978969
-184573.862260     8249733.095891
-184551.228109     8249739.634412
-184539.885921     8249744.468911
-184539.240080     8249745.710859
-184524.678945     8249756.130076
-184520.864539     8249759.828558
-184516.404306     8249764.768225
-184511.268161     8249772.828739
-184506.141917     8249780.262696
-184501.621377     8249788.958630
-184496.454805     8249798.896509
-184492.610354     8249804.472363
-184491.298503     8249808.208602
-184491.248097     8249811.338313
-184489.895919     8249817.578474
-184489.774937     8249825.090240
-184489.664046     8249831.975452
-184489.563234     8249838.234875
-184489.512828     8249841.364586
-184492.620896     8249842.664317
-184498.806770     8249847.142674
-184511.299513     8249848.586859
-184520.664031     8249849.982893
-184526.284898     8249850.696122
-184536.870343     8249853.989547
-184553.127074     8249854.865725
-184569.959081     8249858.881245
-184588.657869     8249863.551445
-184601.665201     8249871.891234
-184613.451798     8249878.333635
-184617.145031     8249882.146916
-184617.084546     8249885.902417
-184617.064376     8249887.154760
-184608.739522     8249898.922623
-184593.572861     8249908.080630
-184584.743305     8249912.327096
-184580.353635     8249912.885472
-184561.523799     8249916.352064
-184528.193300     8249926.483135
-184502.370440     8249936.729005
-184480.896923     8249948.920420
-184454.387883     8249962.912924
-184422.237996     8249977.444545
-184396.263918     8249997.079548
-184369.755068     8250011.072055
-184343.114980     8250033.201349
-184315.748586     8250061.580439
-184289.148825     8250081.205811
-184271.348562     8250098.462853
-184259.784400     8250117.067774
-184250.198101     8250129.442164
-184249.411312     8250139.447460
-184248.785628     8250139.437829
-184244.295146     8250146.255628
-184243.377105     8250164.398476
-184236.031430     8250193.085736
-184227.504760     8250217.372442
-184221.571557     8250236.064038
-184216.243867     8250256.017608
-184215.356075     8250272.282323
-184213.560321     8250306.064097
-184209.241868     8250341.058928
-184207.718505     8250357.939805
-184207.698335     8250359.192148
-184206.205030     8250374.194890
-184200.826934     8250397.278171
-184192.996523     8250417.192453
-184186.598934     8250425.859494
-184180.958088     8250426.398612
-184165.861990     8250431.175329
-184147.597353     8250438.407052
-184135.064283     8250439.466788
-184133.792759     8250440.699106
-184132.541392     8250440.679844
-184122.470740     8250444.281262
-184101.703357     8250451.475225
-184081.602188     8250456.174137
-184072.711944     8250464.176865
-184071.965483     8250471.678239
-184070.441916     8250488.559877
-184068.948611     8250503.562618
-184068.101325     8250517.324179
-184067.597264     8250548.621292
-184067.284749     8250568.025350
-184062.673285     8250582.354915
-184062.663206     8250582.980704
-184061.966960     8250587.352363
-184049.888197     8250599.062444
-184044.146539     8250605.860984
-184039.625808     8250614.556915
-184026.376333     8250621.239890
-184008.777694     8250625.978086
-184004.398103     8250625.910673
-183994.529074     8250616.993246
-183980.835370     8250612.400087
-183967.858096     8250602.182163
-183958.564141     8250596.404839
-183936.192100     8250586.669013
-183903.234613     8250573.639762
-183882.850524     8250557.046852
-183859.317838     8250541.658896
-183838.388708     8250520.049275
-183817.419251     8250500.943577
-183795.097616     8250488.078040
-183782.735933     8250478.496300
-183769.829222     8250463.897085
-183750.736624     8250444.820276
-183734.297976     8250416.392857
-183715.467487     8250381.041703
-183700.239688     8250355.137464
-183678.028943     8250335.386715
-183658.936345     8250316.309907
-183639.854029     8250296.606547
-183620.922728     8250267.514816
-183601.981348     8250239.048873
-183588.418704     8250226.318160
-183575.471857     8250214.222869
-183557.000000     8250201.635035
-END
-LINE3D
-HEIGHT 1120.000000
-183557.000000     8255163.135756
-183566.649126     8255152.744035
-183582.592688     8255134.206525
-183602.380879     8255110.093928
-183628.576764     8255076.686972
-183644.893325     8255034.989903
-183656.103800     8254999.475213
-183665.326538     8254970.816081
-183679.665428     8254935.349545
-183693.418976     8254897.368692
-183707.021280     8254868.778502
-183719.927363     8254844.558443
-183733.428664     8254822.227672
-183749.644414     8254786.790026
-183764.649328     8254748.828435
-183777.161575     8254710.203295
-183787.151123     8254672.791214
-183795.576339     8254615.945421
-183807.533466     8254572.929360
-183824.768081     8254513.088679
-183844.818393     8254472.700972
-183858.370113     8254447.239726
-183868.602254     8254433.623387
-183875.040171     8254422.452424
-183884.828094     8254397.559187
-183897.814807     8254368.332813
-183908.268741     8254340.945285
-183914.978846     8254312.874186
-183919.216657     8254282.886434
-183919.640062     8254256.597164
-183920.164280     8254224.048472
-183920.708668     8254190.247437
-183916.298186     8254153.239645
-183912.008865     8254108.720856
-183912.613738     8254071.164319
-183918.042239     8254044.951327
-183924.742253     8254017.506781
-183930.705896     8253996.937056
-183935.196187     8253990.119254
-183935.206266     8253989.493465
-183935.892446     8253985.746831
-183937.153891     8253985.140303
-183944.762329     8253978.996442
-183952.370958     8253972.852585
-183961.230762     8253966.727986
-183961.927009     8253962.356326
-183962.693832     8253953.602613
-183967.950946     8253938.031097
-183976.356442     8253921.256154
-183977.193841     8253908.120386
-183978.707316     8253891.865302
-183978.969425     8253875.590956
-183979.060158     8253869.957322
-183979.070237     8253869.331533
-183978.757069     8253849.917844
-183975.063645     8253846.104561
-183968.504117     8253825.968016
-183960.774056     8253800.805132
-183960.450809     8253782.017233
-183955.869131     8253755.650922
-183949.480979     8253724.873664
-183945.625605     8253692.257558
-183941.770434     8253659.640691
-183931.053097     8253625.666308
-183926.360528     8253606.185209
-183916.057158     8253585.365856
-183903.432916     8253553.239955
-183897.347841     8253542.502939
-183896.843128     8253534.982306
-183888.366414     8253517.320793
-183882.341836     8253502.827512
-183881.090470     8253502.808250
-183871.301893     8253488.883741
-183856.074094     8253462.979502
-183851.250476     8253451.635195
-183851.431931     8253440.368692
-183850.301546     8253432.837665
-183846.073363     8253423.381120
-183837.001203     8253403.832608
-183832.076582     8253398.747720
-183820.350662     8253388.549821
-183815.547202     8253375.953934
-183811.389392     8253362.116096
-183810.440462     8253343.318566
-183815.122489     8253324.607712
-183821.570485     8253312.810959
-183825.465533     8253304.105397
-183833.871029     8253287.330454
-183843.648874     8253263.063007
-183848.996913     8253241.857861
-183853.688828     8253222.521214
-183860.429181     8253192.571983
-183869.217960     8253152.010931
-183881.669722     8253117.141292
-183893.919860     8253094.790498
-183907.996642     8253075.598309
-183920.206466     8253055.750673
-183929.974220     8253032.109780
-183935.342225     8253009.653052
-183941.981766     8252985.963244
-183951.961235     8252949.176951
-183964.029456     8252899.274917
-183973.423557     8252859.975836
-183978.246533     8252832.501634
-183982.554908     8252798.132591
-183983.906445     8252753.073920
-183988.890909     8252715.584797
-183997.487951     8252686.916799
-184007.316202     8252659.519641
-184011.947824     8252643.938497
-184015.207097     8252635.849858
-184018.476462     8252627.134665
-184021.826468     8252613.412392
-184022.724161     8252596.521120
-184022.966112     8252581.498353
-184018.707681     8252573.919941
-184013.177726     8252567.573846
-184003.580694     8252541.756280
-183997.051402     8252519.742366
-183992.217706     8252509.023848
-183991.692835     8252502.754794
-183972.055196     8252478.661275
-183966.636132     8252465.429968
-183956.231962     8252450.869274
-183943.426254     8252430.010639
-183928.339594     8252395.343056
-183901.819822     8252371.143603
-183883.231937     8252359.587427
-183864.543228     8252354.291438
-183849.083569     8252342.783414
-183834.855106     8252332.546994
-183816.862657     8252322.878582
-183800.050819     8252317.610718
-183781.352031     8252312.940519
-183752.087778     8252303.724548
-183733.499893     8252292.168372
-183732.389845     8252283.386533
-183727.697097     8252263.904667
-183727.928957     8252249.508453
-183728.362454     8252222.592630
-183732.600253     8252192.605642
-183733.810651     8252156.310315
-183735.515671     8252128.162175
-183736.998719     8252113.784456
-183737.230580     8252099.388242
-183737.401968     8252088.746765
-183726.543682     8252063.535730
-183710.952308     8252021.347514
-183696.077351     8251973.535297
-183680.284366     8251943.865163
-183657.679990     8251909.708572
-183644.248407     8251888.840303
-183643.642881     8251887.579093
-183627.648272     8251870.427805
-183604.186352     8251850.657796
-183578.382996     8251820.834341
-183557.000000     8251788.734878
-END
-LINE3D
-HEIGHT 1120.000000
-186007.222746     8255388.783431
-186007.232813     8255388.158405
-186007.858687     8255388.168039
-186018.494729     8255388.331756
-186019.745713     8255388.351012
-186020.987013     8255388.995299
-186021.612887     8255389.004933
-186025.881194     8255395.958316
-186031.381092     8255404.182547
-186035.680053     8255409.256276
-186041.825601     8255416.238555
-186051.583738     8255432.041194
-186070.050653     8255451.108372
-186081.786844     8255460.680484
-186097.902244     8255470.320004
-186125.188839     8255485.765744
-186126.440205     8255485.785005
-186139.467695     8255492.873216
-186167.399940     8255507.077004
-186207.138939     8255526.471615
-186227.714586     8255531.170704
-186253.820353     8255542.217420
-186281.772756     8255555.169629
-186304.860844     8255559.280683
-186316.122760     8255559.454033
-186327.364137     8255560.878957
-186347.364673     8255562.440235
-186373.500332     8255571.607284
-186389.636271     8255579.995231
-186401.362013     8255590.192363
-186418.052881     8255602.971228
-186437.216234     8255617.666749
-186442.786313     8255621.509683
-186455.763803     8255631.726082
-186475.501860     8255649.560937
-186500.901506     8255665.604340
-186513.323661     8255671.431344
-186529.539873     8255674.811441
-186557.058341     8255675.860202
-186592.094310     8255676.399498
-186629.067993     8255673.212952
-186654.547911     8255684.248505
-186678.130813     8255696.506748
-186702.420219     8255703.768309
-186734.802619     8255713.658220
-186771.554162     8255724.240565
-186806.449362     8255733.543974
-186838.357106     8255734.035118
-186870.900815     8255733.909342
-186897.874039     8255729.942154
-186929.247012     8255724.790800
-186960.670415     8255716.508207
-186998.855149     8255715.844081
-187025.192432     8255712.492285
-187053.972333     8255712.935283
-187087.070946     8255717.201953
-187117.707548     8255718.925419
-187139.544628     8255723.018745
-187163.258590     8255727.139433
-187190.090662     8255731.936354
-187220.646610     8255738.667664
-187241.212189     8255743.991779
-187257.973621     8255752.389354
-187276.591754     8255762.067397
-187289.629335     8255768.529054
-187309.629895     8255770.088804
-187332.768747     8255771.071680
-187364.141720     8255765.920327
-187390.509251     8255760.690398
-187411.216315     8255757.253466
-187436.877700     8255757.021753
-187460.722699     8255753.006414
-187478.866557     8255753.285695
-187490.067619     8255757.213776
-187510.027840     8255761.278212
-187526.910241     8255762.164786
-187538.171775     8255762.338130
-187558.878482     8255758.899664
-187586.517920     8255752.437424
-187606.618885     8255747.739274
-187607.870252     8255747.758536
-187614.813073     8255744.108208
-187624.369124     8255733.611949
-187635.983501     8255711.877314
-187648.122557     8255696.411730
-187652.078281     8255683.950670
-187652.320244     8255668.927139
-187646.416636     8255646.922856
-187637.990113     8255626.133157
-187629.069183     8255597.194746
-187617.837434     8255556.325526
-187602.881835     8255513.520388
-187584.182203     8255470.032440
-187569.377822     8255417.838168
-187555.058164     8255374.417638
-187549.295707     8255343.649247
-187548.669833     8255343.639613
-187543.351760     8255324.149650
-187538.658821     8255304.667782
-187532.573746     8255293.930765
-187528.910774     8255288.238589
-187520.989156     8255274.969525
-187511.987571     8255251.038958
-187495.599139     8255219.481825
-187471.612169     8255193.441996
-187459.200080     8255186.989967
-187443.074589     8255177.977001
-187436.202737     8255177.244516
-187420.753144     8255165.111466
-187400.873554     8255156.040715
-187393.436325     8255151.542331
-187384.878766     8255138.888659
-187379.510286     8255122.528408
-187378.510950     8255106.860589
-187379.338066     8255094.351372
-187390.882261     8255076.998033
-187397.360493     8255063.323912
-187405.725675     8255049.052127
-187421.679328     8255029.888063
-187446.987383     8255012.748114
-187466.039013     8254995.510334
-187479.368964     8254983.818749
-187493.395327     8254967.757034
-187511.215748     8254949.248414
-187523.324938     8254935.660968
-187527.795275     8254930.093984
-187537.865916     8254926.493330
-187562.508189     8254911.845383
-187590.934403     8254895.378611
-187609.219007     8254886.895306
-187619.935703     8254882.051179
-187640.733131     8254872.979844
-187663.488454     8254858.929561
-187681.964616     8254838.552436
-187697.232279     8254823.135009
-187715.587447     8254810.270414
-187733.307437     8254798.021222
-187747.363692     8254780.079841
-187756.405154     8254762.687979
-187760.986370     8254750.236547
-187768.140500     8254733.442342
-187772.943498     8254707.220486
-187779.018031     8254679.765548
-187787.463855     8254660.486684
-187794.557501     8254647.447980
-187795.808867     8254647.467242
-187801.550716     8254640.668705
-187812.983638     8254630.200572
-187823.780977     8254620.349365
-187831.369066     8254615.457080
-187846.566154     8254604.421708
-187859.775123     8254600.241888
-187875.517061     8254594.223223
-187903.842463     8254584.015874
-187933.459559     8254571.323865
-187955.498275     8254562.897581
-187976.245296     8254556.955958
-188001.896972     8254557.350804
-188028.809711     8254557.139117
-188056.418900     8254552.555009
-188084.673738     8254546.728951
-188123.574316     8254540.440813
-188164.967548     8254534.816989
-188200.115171     8254528.471084
-188221.457067     8254524.416450
-188247.179688     8254520.430012
-188270.328249     8254520.786329
-188287.917179     8254516.674692
-188298.623415     8254512.456349
-188312.528440     8254503.904866
-188338.331715     8254494.910585
-188362.741339     8254494.660368
-188385.265172     8254495.007069
-188404.024444     8254495.921767
-188422.773625     8254497.463020
-188428.343335     8254501.305184
-188431.471560     8254501.353336
-188432.097816     8254501.362975
-188442.107984     8254501.517058
-188455.185892     8254505.474793
-188458.939610     8254505.532573
-188459.565102     8254505.542200
-188469.515549     8254509.451796
-188489.455230     8254514.767805
-188521.907812     8254520.276420
-188564.351168     8254527.190709
-188611.829474     8254532.303901
-188653.111815     8254533.565288
-188683.122912     8254535.279891
-188705.010410     8254536.242742
-188723.154269     8254536.522023
-188748.290961     8254530.022023
-188784.033077     8254525.563103
-188815.527032     8254512.899984
-188846.335009     8254503.982737
-188878.948900     8254499.475665
-188912.814527     8254494.988625
-188938.546475     8254490.375621
-188959.969777     8254481.313920
-188991.968255     8254476.171430
-189026.620683     8254461.678330
-189043.160252     8254445.028592
-189062.100979     8254434.676789
-189086.066578     8254423.149678
-189110.678590     8254410.380627
-189137.753019     8254400.153258
-189151.607638     8254394.731487
-189167.410061     8254384.957322
-189182.112717     8254365.774766
-189200.568327     8254346.649978
-189219.024700     8254327.525202
-189238.812713     8254303.411838
-189268.591500     8254280.704147
-189288.500482     8254249.079781
-189298.974383     8254220.440672
-189309.236581     8254204.946198
-189320.185520     8254185.705863
-189330.488045     8254167.707467
-189343.212649     8254154.755438
-189361.679113     8254135.004109
-189373.848788     8254117.661162
-189389.691538     8254105.383074
-189409.943746     8254091.294262
-189424.555669     8254077.745339
-189437.229867     8254067.923022
-189449.257651     8254059.342644
-189470.186521     8254042.133760
-189489.288545     8254021.767033
-189507.654197     8254008.275126
-189512.134219     8254002.083111
-189517.280824     8253993.396813
-189535.706949     8253976.150169
-189556.140612     8253950.794854
-189570.196854     8253932.854238
-189579.672263     8253927.365059
-189586.726345     8253916.830289
-189593.799833     8253905.043164
-189606.595013     8253887.709081
-189616.917695     8253868.459106
-189628.522375     8253847.350267
-189640.731613     8253827.503386
-189656.029525     8253810.207827
-189668.239527     8253790.360958
-189677.270911     8253773.594885
-189688.168680     8253757.484250
-189698.592174     8253731.974852
-189702.022836     8253713.244735
-189706.019268     8253698.279759
-189706.190644     8253687.639046
-189706.513250     8253667.608435
-189707.390772     8253651.969506
-189707.481493     8253646.336637
-189707.794020     8253626.931815
-189709.649877     8253589.394535
-189715.774804     8253558.810650
-189720.022503     8253528.197106
-189720.345109     8253508.166495
-189720.647545     8253489.388226
-189718.457327     8253469.945645
-189717.831835     8253469.936017
-189713.674407     8253456.098185
-189713.603381     8253421.661733
-189707.830833     8253391.519895
-189698.424774     8253353.809264
-189697.415740     8253338.767241
-189696.235319     8253334.366695
-189687.132923     8253316.695551
-189672.490289     8253293.304862
-189659.775301     8253266.813358
-189646.514712     8253235.304371
-189636.272222     8253210.728759
-189631.024354     8253186.855972
-189622.628092     8253164.187376
-189609.933274     8253136.443529
-189603.111354     8253093.764354
-189594.755419     8253068.591836
-189590.082638     8253047.858389
-189584.834770     8253023.985602
-189580.374444     8252990.108295
-189575.852880     8252959.985713
-189572.381442     8252942.401244
-189571.352239     8252928.611564
-189559.192180     8252906.510978
-189549.069895     8252874.424353
-189540.734130     8252847.999492
-189529.815729     8252826.544728
-189517.615355     8252806.947300
-189506.595378     8252791.751946
-189502.286744     8252787.302484
-189498.613669     8252782.237625
-189488.088148     8252775.187926
-189483.103603     8252773.859312
-189473.253969     8252763.690294
-189459.076294     8252750.324169
-189452.365739     8252739.576761
-189442.495947     8252730.659322
-189441.951097     8252725.642614
-189435.845865     8252716.157177
-189426.703140     8252700.989955
-189423.140968     8252689.039119
-189419.447736     8252685.225839
-189419.457814     8252684.600050
-189420.264773     8252673.342411
-189424.280600     8252657.125844
-189425.137964     8252642.738494
-189429.073900     8252631.529783
-189438.094428     8252615.390252
-189454.623931     8252599.365539
-189471.687417     8252588.984840
-189479.831187     8252588.484249
-189488.034690     8252584.227382
-189510.164127     8252570.168229
-189534.211143     8252553.633286
-189554.493588     8252537.667105
-189570.416980     8252520.381938
-189588.883445     8252500.630608
-189603.666756     8252476.440209
-189615.220253     8252458.461833
-189619.236092     8252442.244502
-189620.053881     8252430.361850
-189620.295832     8252415.339082
-189630.759654     8252387.325763
-189645.158660     8252348.102956
-189654.321092     8252323.200092
-189661.444986     8252308.283256
-189674.300637     8252287.194436
-189688.468535     8252262.368619
-189699.527613     8252236.242296
-189708.569062     8252218.851198
-189720.031839     8252206.505691
-189730.748917     8252201.661569
-189741.455141     8252197.443990
-189755.239960     8252196.403521
-189773.999232     8252197.318220
-189808.339133     8252202.229941
-189836.321784     8252213.304018
-189851.084624     8252229.183693
-189860.772950     8252249.368399
-189869.895516     8252265.787200
-189888.372510     8252284.228588
-189905.718737     8252295.138942
-189926.254438     8252302.341960
-189932.510888     8252302.438263
-189941.905643     8252301.956928
-189953.914021     8252294.628905
-189972.884996     8252282.398969
-189993.843351     8252263.311940
-190014.983912     8252232.959185
-190019.514340     8252223.637459
-190020.836664     8252219.274672
-190025.447734     8252204.945866
-190031.461783     8252181.246429
-190039.382544     8252155.698508
-190043.539510     8252130.718596
-190047.576270     8252113.249698
-190049.028879     8252100.750109
-190049.089363     8252096.994608
-190049.099442     8252096.368819
-190049.391799     8252078.216340
-190054.285148     8252046.360844
-190054.839614     8252011.934020
-190051.014871     8251977.439787
-190047.028831     8251952.960478
-190042.981542     8251932.236658
-190038.935004     8251911.513614
-190029.913250     8251888.835391
-190026.148240     8251850.584882
-190020.375680     8251820.443808
-190015.663335     8251802.214294
-190015.178982     8251793.441321
-190010.940148     8251784.610557
-190009.709321     8251783.339723
-190009.719399     8251782.713933
-190005.530971     8251770.753458
-189995.419529     8251738.041055
-189981.604024     8251702.140385
-189964.600560     8251669.947840
-189950.694321     8251639.680804
-189942.348465     8251613.882497
-189935.173702     8251593.111301
-189924.224313     8251573.533129
-189917.564152     8251559.656774
-189913.326082     8251550.826022
-189907.866499     8251540.098633
-189899.349267     8251524.941039
-189889.137013     8251498.488059
-189875.240853     8251467.595233
-189870.972534     8251460.642613
-189870.457945     8251453.747009
-189864.917708     8251448.027465
-189858.277717     8251432.898766
-189852.858461     8251419.667456
-189844.411805     8251400.127808
-189831.706897     8251373.010514
-189820.293312     8251343.407791
-189803.774201     8251319.988219
-189785.993263     8251297.175168
-189775.043862     8251277.597760
-189761.027497     8251254.215948
-189749.573572     8251227.117910
-189741.147074     8251206.326683
-189733.901748     8251189.936778
-189732.649999     8251189.917510
-189727.240835     8251176.059646
-189715.586051     8251161.480466
-189711.982788     8251152.033541
-189705.262142     8251141.912686
-189697.361087     8251127.390521
-189686.916209     8251115.333743
-189677.087495     8251103.913158
-189661.103156     8251086.136083
-189638.276425     8251065.749907
-189617.347868     8251044.140296
-189600.061374     8251029.473664
-189590.232661     8251018.053079
-189585.297771     8251013.593978
-189573.521253     8251006.525787
-189552.461636     8250993.053731
-189530.290645     8250970.799051
-189510.522340     8250954.842329
-189495.143323     8250938.327225
-189483.397054     8250929.380902
-189472.912612     8250919.828057
-189453.699235     8250908.262253
-189420.196517     8250890.216289
-189392.920012     8250874.143996
-189377.995112     8250868.279233
-189372.980331     8250868.827987
-189365.451975     8250869.963995
-189339.185268     8250868.933737
-189298.074302     8250857.031636
-189261.282074     8250848.951680
-189230.695878     8250844.098502
-189207.072280     8250834.343411
-189173.984127     8250829.450957
-189140.441081     8250813.908915
-189121.237783     8250801.717321
-189104.566703     8250787.686107
-189099.027229     8250781.966575
-189091.700497     8250770.583737
-189086.927668     8250756.109724
-189075.322526     8250738.400821
-189063.747632     8250718.813785
-189054.534345     8250708.027853
-189054.544423     8250707.402064
-189042.929203     8250690.318950
-189023.907371     8250666.860090
-189007.347933     8250645.944440
-189000.545881     8250640.830653
-188995.611743     8250636.372327
-188989.990876     8250635.659098
-188976.489099     8250619.172890
-188964.904127     8250600.211644
-188951.937109     8250589.368696
-188940.786084     8250582.310134
-188932.097477     8250577.793253
-188918.343670     8250576.955601
-188901.531450     8250571.687732
-188882.832663     8250567.017532
-188876.596370     8250565.669650
-188867.848042     8250564.908282
-188859.714351     8250564.783083
-188845.253633     8250568.943635
-188830.188358     8250571.842228
-188824.547321     8250572.381343
-188816.242254     8250582.896857
-188800.107147     8250613.327423
-188794.800009     8250632.028656
-188802.580094     8250654.061822
-188823.933283     8250688.199919
-188836.618021     8250716.569555
-188836.426476     8250728.462611
-188836.881356     8250739.112964
-188844.490054     8250771.787608
-188854.561933     8250807.003944
-188864.178931     8250831.569928
-188871.817889     8250862.365675
-188878.932918     8250886.893148
-188887.309011     8250910.814086
-188899.458991     8250933.540462
-188918.339695     8250965.761902
-188937.099418     8251005.495108
-188949.794235     8251033.238955
-188957.070574     8251047.750740
-188960.662994     8251057.823443
-188964.971628     8251062.272904
-188969.866203     8251069.235164
-188981.572145     8251080.685409
-188988.746908     8251101.456604
-188993.369283     8251125.319763
-189000.039523     8251138.570329
-189006.629108     8251156.828739
-189014.520847     8251171.976705
-189018.183844     8251177.667354
-189023.067564     8251185.256155
-189034.702942     8251201.087690
-189053.623974     8251230.805209
-189066.339713     8251257.297488
-189076.723343     8251273.109756
-189085.775346     8251293.909847
-189091.124025     8251311.523211
-189094.060705     8251323.464419
-189095.059660     8251339.132232
-189095.342401     8251360.423286
-189094.212848     8251391.710771
-189089.016601     8251403.526792
-189083.890153     8251410.961510
-189073.153681     8251417.057222
-189061.881686     8251417.509661
-189037.430971     8251420.263788
-189018.651541     8251420.600668
-189002.384923     8251420.350282
-188984.251143     8251419.445212
-188955.542200     8251414.620165
-188911.898266     8251404.556909
-188879.546484     8251392.789635
-188849.575701     8251388.571875
-188817.143277     8251381.811680
-188779.069052     8251375.590589
-188749.139361     8251368.868918
-188722.952544     8251362.830804
-188695.495337     8251358.025790
-188643.647148     8251352.218625
-188599.317237     8251345.901242
-188551.939742     8251334.528628
-188512.715345     8251322.028857
-188479.081578     8251312.119684
-188447.335131     8251301.613617
-188408.030079     8251294.121690
-188380.057519     8251282.421060
-188350.198391     8251271.318099
-188319.733177     8251258.953155
-188280.397889     8251253.338597
-188252.334595     8251247.271599
-188225.502880     8251242.476213
-188196.723362     8251242.033221
-188163.584027     8251240.271230
-188144.824767     8251239.355767
-188132.937358     8251239.172789
-188115.419374     8251238.903142
-188094.147671     8251238.575714
-188065.367771     8251238.132716
-188024.135836     8251233.741617
-187990.421415     8251228.840288
-187959.946504     8251217.101139
-187932.569187     8251207.288269
-187903.163794     8251206.835643
-187882.447009     8251210.899899
-187866.099748     8251215.656592
-187849.752094     8251220.414045
-187831.558211     8251223.264480
-187814.029765     8251223.620616
-187790.235173     8251224.506245
-187770.779833     8251227.963972
-187752.010481     8251227.675063
-187726.358806     8251227.280216
-187694.572044     8251219.277307
-187662.189643     8251209.387395
-187638.586584     8251198.380732
-187624.973535     8251188.779730
-187607.072009     8251173.477687
-187586.031798     8251158.753276
-187561.177372     8251147.727350
-187524.506114     8251132.136392
-187490.953371     8251117.220145
-187456.754609     8251103.545079
-187431.334794     8251088.754019
-187406.480380     8251077.727329
-187387.256913     8251066.788079
-187364.299515     8251054.538700
-187340.746862     8251040.402325
-187322.148899     8251029.471938
-187302.279399     8251019.774633
-187281.138745     8251011.310415
-187263.196511     8250998.512288
-187245.264355     8250985.088372
-187234.779913     8250975.535527
-187228.089133     8250963.536534
-187218.966567     8250947.117733
-187211.640217     8250935.734902
-187203.103197     8250921.829657
-187187.057991     8250907.808077
-187166.623484     8250894.345642
-187142.485665     8250877.695718
-187120.789713     8250864.839811
-187102.857557     8250851.415895
-187079.950566     8250836.036805
-187057.790418     8250813.156347
-187034.933833     8250794.647545
-187017.718284     8250775.599630
-186992.944513     8250759.565860
-186969.452357     8250741.673220
-186942.781175     8250726.862898
-186921.115471     8250712.128860
-186900.105878     8250695.527086
-186879.731868     8250678.308387
-186867.440749     8250664.345357
-186851.991168     8250652.211543
-186837.177159     8250639.461568
-186822.373228     8250626.085803
-186803.775253     8250615.156181
-186782.765672     8250598.553643
-186760.625300     8250574.421600
-186734.135966     8250548.344018
-186711.329787     8250526.705505
-186697.757447     8250514.600587
-186684.134319     8250505.625374
-186664.910470     8250494.686118
-186640.076213     8250482.407849
-186622.104112     8250471.487861
-186610.307437     8250465.671249
-186599.136636     8250459.864272
-186578.722299     8250445.149495
-186552.737476     8250426.593306
-186529.194914     8250411.830377
-186508.730170     8250400.245311
-186486.337768     8250391.761825
-186462.694394     8250383.258320
-186440.917787     8250375.410257
-186422.884819     8250368.245763
-186409.887565     8250359.280185
-186399.412820     8250349.101545
-186398.787328     8250349.091917
-186394.478312     8250344.642449
-186384.548787     8250339.481286
-186378.988404     8250335.012557
-186372.802517     8250330.534964
-186364.053413     8250329.774347
-186358.483334     8250325.931413
-186347.352848     8250317.621278
-186339.855110     8250316.879923
-186335.556173     8250311.804666
-186334.930680     8250311.795038
-186329.299722     8250311.708363
-186317.967625     8250315.916309
-186308.562779     8250317.024197
-186302.911664     8250318.189101
-186299.107540     8250321.261033
-186299.097461     8250321.886822
-186294.576731     8250330.582753
-186288.834882     8250337.381290
-186283.769301     8250341.060514
-186278.078240     8250344.729345
-186272.447282     8250344.642670
-186267.442198     8250344.565629
-186263.062606     8250344.498216
-186252.436643     8250343.708710
-186246.826236     8250342.369697
-186241.286012     8250336.649389
-186222.032295     8250327.588271
-186202.889100     8250311.641171
-186179.275974     8250301.259533
-186169.336370     8250296.724160
-186155.087368     8250287.739313
-186133.936635     8250279.900884
-186110.343667     8250268.267667
-186083.612001     8250257.212846
-186043.096291     8250247.197742
-186009.503234     8250234.784652
-185982.671137     8250229.989260
-185967.726079     8250225.376075
-185953.437132     8250218.895157
-185922.911421     8250210.286478
-185896.180148     8250199.230899
-185876.916353     8250190.795570
-185858.832992     8250186.760024
-185843.887922     8250182.147604
-185827.681788     8250178.141717
-185803.927523     8250176.523423
-185784.542376     8250175.599091
-185763.896167     8250175.281291
-185735.116648     8250174.838299
-185685.145687     8250169.060795
-185642.056681     8250163.388457
-185612.116529     8250157.292570
-185597.121053     8250155.809861
-185581.550503     8250151.187049
-185557.221139     8250146.430180
-185527.916558     8250139.718131
-185506.079467     8250135.625569
-185484.333109     8250125.899374
-185465.049156     8250118.715625
-185435.088465     8250113.871311
-185407.701452     8250104.684236
-185384.733963     8250093.061411
-185356.741233     8250082.613123
-185320.726098     8250065.153666
-185290.391932     8250044.651932
-185266.203707     8250031.131718
-185243.296716     8250015.752628
-185220.995059     8250001.634745
-185196.736259     8249992.496586
-185173.698219     8249985.254286
-185153.788393     8249978.060903
-185135.755807     8249970.896415
-185122.697686     8249965.686331
-185118.964126     8249964.376973
-185114.029606     8249959.918641
-185100.345993     8249954.698930
-185081.071738     8249946.889385
-185063.624329     8249942.237683
-185042.352627     8249941.910256
-185022.957401     8249941.611712
-185004.188050     8249941.322803
-184984.167333     8249941.014632
-184966.649348     8249940.744984
-184950.382730     8249940.494598
-184931.603300     8249940.831478
-184905.184993     8249949.190349
-184876.869670     8249958.771908
-184851.117373     8249964.636487
-184829.058488     8249974.315114
-184810.107682     8249985.292707
-184808.745616     8249992.158660
-184803.609280     8250000.219171
-184794.012902     8250013.219352
-184778.604290     8250037.400126
-184771.359236     8250059.827961
-184766.758041     8250073.531739
-184761.490657     8250089.729041
-184756.849148     8250105.935977
-184745.254738     8250126.419030
-184740.582992     8250144.503334
-184729.644514     8250163.117886
-184718.120859     8250179.219652
-184708.544650     8250190.967489
-184700.249841     8250200.857980
-184686.274062     8250213.790750
-184674.215278     8250224.248485
-184665.335304     8250231.625427
-184653.296868     8250240.831586
-184639.956660     8250253.148194
-184634.790279     8250263.086076
-184630.350203     8250266.774163
-184620.753825     8250279.774344
-184600.884966     8250308.895549
-184580.491440     8250331.746939
-184561.449901     8250348.358165
-184546.838157     8250361.907854
-184531.530357     8250379.829206
-184516.061260     8250407.765481
-184502.398459     8250440.111937
-184496.455177     8250459.429322
-184490.602616     8250473.113838
-184484.629097     8250494.308592
-184474.599222     8250534.224595
-184465.094027     8250580.409650
-184457.677776     8250613.478965
-184452.753809     8250647.211823
-184447.668533     8250690.960368
-184447.214879     8250719.127770
-184450.807478     8250729.201240
-184451.947954     8250736.105714
-184459.092659     8250758.755045
-184468.488067     8250797.091457
-184476.157834     8250826.009844
-184485.179576     8250848.688832
-184496.138674     8250867.640445
-184505.816361     8250888.450167
-184512.436386     8250904.830447
-184513.526252     8250914.865393
-184514.565916     8250928.029290
-184514.243322     8250948.059137
-184510.186977     8250966.779623
-184504.284010     8250983.593850
-184498.502025     8250992.896312
-184492.659364     8251005.954272
-184485.454828     8251025.878188
-184476.837425     8251055.798527
-184465.303703     8251072.525318
-184458.199776     8251086.190572
-184453.033395     8251096.128454
-184445.818589     8251116.678157
-184438.523117     8251142.236467
-184433.831010     8251161.573111
-184429.926074     8251170.904466
-184430.481003     8251175.295384
-184436.555987     8251186.658954
-184442.479765     8251207.410894
-184450.906264     8251228.202121
-184458.696809     8251249.609504
-184466.457119     8251272.894255
-184474.591260     8251311.837961
-184485.429389     8251338.300575
-184494.441064     8251361.604588
-184500.909859     8251387.374767
-184509.114385     8251421.936416
-184517.288675     8251458.375433
-184526.239854     8251485.435711
-184533.304095     8251513.092888
-184536.453131     8251550.707207
-184543.426461     8251583.997251
-184552.882353     8251618.578162
-184557.091019     8251668.104795
-184563.348123     8251707.018844
-184571.068284     8251732.808285
-184578.293644     8251750.449772
-184589.787692     8251775.044648
-184605.994657     8251817.869048
-184620.385070     8251856.908290
-184633.170812     8251879.018507
-184641.667695     8251895.427677
-184658.822950     8251918.231096
-184674.736726     8251940.389462
-184682.678681     8251952.407714
-184682.608105     8251956.789768
-184688.683101     8251968.152573
-184695.202314     8251990.792276
-184702.811393     8252023.466926
-184713.337007     8252069.333598
-184719.129712     8252098.223857
-184724.438076     8252118.340379
-184727.294114     8252135.288666
-184734.428728     8252158.564551
-184741.432484     8252189.977229
-184748.557032     8252213.878139
-184752.583781     8252235.853532
-184762.866981     8252257.925228
-184775.521471     8252288.172997
-184789.397283     8252320.317399
-184799.085036     8252340.502095
-184803.202327     8252356.843852
-184812.375300     8252370.132942
-184819.631087     8252385.897063
-184823.818942     8252397.857530
-184827.220008     8252419.823292
-184838.603166     8252451.303381
-184846.838131     8252483.986900
-184853.882024     8252512.895653
-184857.848277     8252538.627311
-184861.198937     8252563.722785
-184864.650218     8252582.558832
-184865.084368     8252594.460755
-184867.980721     8252608.905884
-184870.826667     8252626.480725
-184874.338637     8252641.560511
-184874.651793     8252660.974964
-184877.336455     8252688.563964
-184880.777836     8252708.026568
-184885.561138     8252721.874034
-184892.907658     8252732.004522
-184902.050383     8252747.171744
-184909.951819     8252761.693915
-184916.592014     8252776.821852
-184917.046309     8252787.472960
-184921.234355     8252799.433429
-184925.311129     8252818.279105
-184928.328463     8252825.212469
-184934.423617     8252835.323695
-184951.134643     8252846.850982
-184964.687207     8252860.207485
-184965.918416     8252861.478325
-184965.847840     8252865.860380
-184965.736949     8252872.745592
-184960.711708     8252873.920129
-184951.760979     8252885.678359
-184941.589515     8252895.539199
-184930.862739     8252901.009116
-184925.777001     8252905.939919
-184915.554748     8252918.930465
-184897.724249     8252938.064875
-184879.934077     8252954.695363
-184869.752330     8252965.182755
-184860.166030     8252977.557145
-184852.991540     8252995.603690
-184847.492486     8253026.197209
-184839.399955     8253062.386601
-184831.519138     8253085.430595
-184825.656499     8253099.740900
-184819.753544     8253116.554364
-184814.556915     8253128.370378
-184814.405697     8253137.759512
-184814.163745     8253152.782280
-184813.064250     8253182.191630
-184808.110023     8253217.803384
-184807.535399     8253253.481788
-184806.738981     8253302.931381
-184806.820277     8253336.742047
-184810.796621     8253361.847151
-184814.046278     8253393.202044
-184818.951394     8253438.356257
-184828.730343     8253491.725064
-184833.363068     8253553.780174
-184832.899335     8253582.573365
-184835.523500     8253613.918631
-184842.275227     8253660.979866
-184854.456096     8253720.646619
-184860.541159     8253731.384399
-184860.521001     8253732.635978
-184860.268971     8253748.284535
-184860.693030     8253760.813011
-184860.945523     8253783.982197
-184864.740400     8253820.354568
-184872.268837     8253858.036297
-184877.002565     8253913.831987
-184891.827116     8253964.773916
-184897.115120     8253986.142779
-184902.272075     8254015.648432
-184910.870412     8254064.616690
-184920.871345     8254104.214311
-184926.593487     8254137.485860
-184929.399119     8254157.563858
-184929.792738     8254171.970464
-184932.578200     8254193.300806
-184935.939130     8254217.770493
-184944.123308     8254253.583717
-184950.461245     8254287.490690
-184954.235582     8254325.114634
-184958.262332     8254347.090026
-184962.551190     8254352.791073
-184962.531032     8254354.042652
-184963.621102     8254364.076837
-184971.906079     8254393.631403
-184976.377249     8254426.882932
-184976.639820     8254449.426329
-184977.659314     8254463.842569
-184977.528253     8254471.980124
-184978.143667     8254472.615542
-184978.123509     8254473.867121
-184977.407284     8254479.491126
-184972.957129     8254483.805003
-184972.271139     8254487.551640
-184968.446477     8254491.875145
-184968.375913     8254496.256435
-184968.305337     8254500.638489
-184969.415564     8254509.421096
-184970.545961     8254516.951359
-184974.723929     8254529.537618
-184979.527389     8254542.133505
-184980.052069     8254548.402555
-184987.297777     8254564.792466
-184998.943234     8254579.998212
-185013.060806     8254597.119844
-185022.223687     8254611.035487
-185035.705688     8254628.773280
-185043.566797     8254645.799373
-185053.284608     8254664.105934
-185064.637708     8254697.464158
-185078.593995     8254724.599950
-185085.334786     8254733.469989
-185085.324720     8254734.095015
-185085.314628     8254734.721568
-185085.940503     8254734.731202
-185090.178967     8254743.561196
-185108.444258     8254775.147219
-185124.408440     8254794.175873
-185132.955908     8254807.456099
-185148.203877     8254832.107994
-185157.336522     8254847.901005
-185164.642333     8254860.535410
-185172.523994     8254876.309165
-185190.930412     8254899.132608
-185214.644813     8254942.072566
-185238.480589     8254977.500001
-185271.256609     8255001.796519
-185287.261106     8255018.322015
-185292.155693     8255025.283510
-185305.082371     8255038.631143
-185316.071718     8255055.704623
-185325.244678     8255068.994477
-185337.555955     8255081.705929
-185357.960226     8255097.045731
-185367.284404     8255100.946451
-185377.184075     8255107.984987
-185395.146086     8255119.531529
-185408.819607     8255125.377795
-185422.442747     8255134.352243
-185438.558147     8255143.991763
-185461.586121     8255151.859088
-185488.317405     8255162.913903
-185508.843003     8255170.744238
-185522.496009     8255177.840548
-185549.177270     8255192.025081
-185586.484099     8255206.999877
-185621.833034     8255226.953622
-185653.973495     8255251.865537
-185678.545642     8255280.418152
-185706.205675     8255311.523604
-185727.780658     8255331.890512
-185747.630000     8255342.839396
-185751.373626     8255343.523729
-185756.358934     8255344.852355
-185772.444086     8255356.370008
-185795.956424     8255373.009540
-185802.162469     8255376.235555
-185806.491654     8255379.432680
-185813.898659     8255385.807667
-185826.875743     8255396.025589
-185836.805638     8255401.187522
-185849.227818     8255407.012997
-185854.807988     8255410.229378
-185859.177489     8255410.923345
-185872.871192     8255415.516503
-185882.195395     8255419.415694
-185882.820888     8255419.425322
-185883.446762     8255419.434956
-185892.205563     8255419.569777
-185902.216113     8255419.723865
-185903.467097     8255419.743121
-185907.846689     8255419.810535
-185911.600788     8255419.868320
-185914.729014     8255419.916472
-185917.857239     8255419.964623
-185925.374740     8255419.455157
-185930.450769     8255415.150914
-185934.224669     8255413.955586
-185943.064482     8255409.084097
-185955.658037     8255404.268860
-185962.550071     8255403.748238
-185966.939729     8255403.190626
-185971.399975     8255398.250195
-185987.182253     8255389.726844
-185992.812829     8255389.813513
-END
-LINE3D
-HEIGHT 1130.000000
-186208.529306     8255401.273527
-186214.150173     8255401.986755
-186222.212919     8255406.493239
-186245.936948     8255409.988901
-186266.522660     8255414.062965
-186274.656351     8255414.188164
-186289.116699     8255410.026841
-186316.079831     8255406.686207
-186348.613450     8255407.186984
-186385.526278     8255407.755169
-186413.125375     8255403.797615
-186438.151177     8255404.182828
-186462.541420     8255405.183437
-186501.179888     8255415.169646
-186538.981531     8255438.291632
-186573.624344     8255463.242064
-186602.232869     8255474.325775
-186629.115347     8255475.992985
-186658.500582     8255477.697189
-186693.516394     8255479.488064
-186739.067436     8255487.702077
-186772.791923     8255491.978381
-186803.387829     8255496.205000
-186837.112316     8255500.481304
-186880.191255     8255506.778667
-186914.541235     8255511.064599
-186947.619691     8255516.582848
-186986.984846     8255520.319268
-187018.892590     8255520.810412
-187047.732988     8255517.497145
-187080.952571     8255514.252814
-187121.074661     8255509.861312
-187148.047884     8255505.894124
-187166.282107     8255500.539002
-187181.408619     8255493.885684
-187190.248457     8255489.012667
-187200.964771     8255484.168534
-187216.686552     8255479.401448
-187227.504061     8255468.297898
-187238.987376     8255454.700818
-187251.732150     8255440.496446
-187263.286411     8255422.518082
-187264.638208     8255416.277915
-187269.169017     8255406.956195
-187275.001599     8255394.524024
-187276.484838     8255380.146308
-187277.997920     8255363.891982
-187278.280198     8255346.365293
-187273.759017     8255316.242717
-187268.451034     8255296.126201
-187263.172919     8255274.131546
-187257.622615     8255269.037027
-187242.728333     8255261.294901
-187233.979241     8255260.533521
-187222.798361     8255255.352333
-187210.497151     8255242.015856
-187199.437240     8255229.323666
-187191.576119     8255212.298337
-187184.905510     8255199.047001
-187175.823270     8255180.124279
-187166.710782     8255163.079688
-187158.879909     8255144.176227
-187147.415907     8255117.703979
-187138.374007     8255096.276570
-187133.086182     8255074.908475
-187128.383534     8255056.053165
-187128.625497     8255041.029634
-187128.231471     8255026.624551
-187127.787446     8255015.347656
-187127.564820     8254990.300331
-187128.078971     8254958.376664
-187131.801977     8254921.494833
-187133.506998     8254893.346693
-187135.141455     8254869.579843
-187139.479887     8254833.332665
-187147.027557     8254792.127329
-187158.813333     8254759.750452
-187173.686971     8254729.927942
-187190.669746     8254685.735821
-187203.060833     8254654.621680
-187212.021640     8254642.237661
-187226.703757     8254624.306679
-187253.323688     8254603.428963
-187275.089360     8254573.085830
-187284.040088     8254561.327601
-187287.864381     8254557.003326
-187301.800024     8254546.574481
-187323.293890     8254533.131490
-187334.636078     8254528.296990
-187342.839951     8254524.040893
-187347.290119     8254519.726252
-187354.878578     8254514.834737
-187361.770611     8254514.314115
-187364.979479     8254509.355187
-187370.741497     8254501.304307
-187379.126837     8254485.780943
-187379.197400     8254481.399653
-187382.396201     8254477.065750
-187382.557498     8254467.050826
-187385.947832     8254450.824632
-187389.186948     8254443.987571
-187389.247433     8254440.232070
-187393.627024     8254440.299484
-187400.508967     8254440.405415
-187414.898726     8254440.626911
-187441.175894     8254441.031385
-187466.827570     8254441.426231
-187492.468785     8254442.446861
-187513.064589     8254445.894372
-187534.316515     8254447.473384
-187555.527732     8254451.556312
-187577.990686     8254455.659271
-187606.064070     8254461.099715
-187647.296005     8254465.490814
-187682.897351     8254469.796008
-187715.501545     8254465.914731
-187751.294437     8254458.326869
-187787.147444     8254446.982737
-187817.259366     8254442.437152
-187850.549524     8254434.810767
-187889.460575     8254427.896082
-187918.411469     8254417.698361
-187946.101300     8254408.107173
-187981.207846     8254404.264414
-188024.448069     8254400.547618
-188052.672672     8254396.598928
-188079.020021     8254392.622106
-188107.880195     8254388.057254
-188144.853889     8254384.869944
-188176.842276     8254380.354008
-188203.836051     8254375.134483
-188228.397657     8254365.495144
-188258.700360     8254349.056492
-188290.214472     8254335.141794
-188321.082947     8254322.468283
-188343.777391     8254312.174259
-188370.266644     8254299.434104
-188396.048998     8254291.691389
-188418.017138     8254287.647160
-188438.784711     8254280.453199
-188458.260197     8254275.744657
-188481.479334     8254271.718920
-188515.274397     8254271.613169
-188541.561262     8254271.391848
-188562.217932     8254271.083864
-188587.374794     8254263.331521
-188617.496795     8254258.160148
-188649.404539     8254258.651292
-188663.178503     8254258.237364
-188675.691404     8254258.429971
-188702.604524     8254258.218289
-188724.572664     8254254.174060
-188752.222180     8254247.086030
-188776.066797     8254243.070685
-188803.211790     8254228.462026
-188830.235038     8254221.365121
-188845.381732     8254213.458695
-188863.051317     8254204.339215
-188886.270441     8254200.314241
-188907.068251     8254191.242912
-188931.114504     8254174.707957
-188948.925228     8254156.825132
-188968.007094     8254137.709984
-188995.908628     8254114.974162
-189025.767293     8254087.259380
-189044.263994     8254065.630681
-189059.632470     8254043.953832
-189080.731952     8254016.104223
-189104.405506     8253983.911095
-189120.601099     8253949.725028
-189125.988879     8253926.016716
-189131.942443     8253906.072780
-189140.045423     8253869.258368
-189151.336361     8253828.735831
-189158.782861     8253793.788383
-189164.827146     8253768.211578
-189168.903457     8253748.239511
-189170.376999     8253734.487590
-189174.312171     8253723.278867
-189182.797941     8253701.496074
-189190.023410     8253680.319827
-189194.089643     8253660.973549
-189195.017571     8253642.204909
-189196.742380     8253612.804420
-189201.121891     8253574.054096
-189202.967669     8253537.142605
-189203.461650     8253506.471281
-189203.905213     8253478.930432
-189204.298383     8253454.518531
-189206.154240     8253416.981250
-189211.028195     8253386.377346
-189214.862104     8253342.609538
-189215.396413     8253309.434292
-189215.264890     8253278.754104
-189214.527293     8253246.811169
-189211.257466     8253216.708619
-189210.510541     8253185.392250
-189206.705204     8253149.645663
-189202.961102     8253110.144351
-189202.819513     8253080.089188
-189198.842788     8253054.984078
-189195.492318     8253029.888607
-189194.614333     8253006.709793
-189190.657778     8252980.352340
-189190.435534     8252955.305021
-189185.853474     8252928.938704
-189176.902295     8252901.878426
-189167.840213     8252881.704124
-189164.227635     8252872.883000
-189164.328447     8252866.623578
-189153.954895     8252850.185521
-189140.149469     8252813.659061
-189125.173700     8252772.106267
-189115.859138     8252728.762014
-189115.465506     8252714.356173
-189115.606645     8252705.592828
-189116.635385     8252680.564765
-189127.109286     8252651.925656
-189137.179489     8252609.505731
-189149.893551     8252558.361748
-189164.272387     8252520.391285
-189176.129097     8252483.633888
-189186.683652     8252449.986936
-189202.263831     8252415.165451
-189216.622509     8252378.446566
-189227.187907     8252344.173836
-189235.028027     8252323.632994
-189242.141830     8252309.342712
-189253.060532     8252291.979745
-189262.181873     8252269.580791
-189271.515680     8252234.037214
-189283.513529     8252188.516473
-189293.321610     8252162.371658
-189299.224768     8252145.557433
-189300.737861     8252129.302343
-189306.973692     8252091.832482
-189308.022590     8252065.552840
-189302.704159     8252046.061343
-189292.370935     8252027.119364
-189276.467237     8252004.335209
-189258.706457     8251980.270580
-189243.367767     8251961.251554
-189228.594085     8251945.997657
-189208.179366     8251931.282874
-189170.408341     8251906.283526
-189129.751030     8251866.214023
-189094.563392     8251836.245355
-189069.183522     8251818.950367
-189049.869333     8251813.643986
-189027.447077     8251807.037874
-189026.821585     8251807.028246
-189023.067867     8251806.970466
-189012.027733     8251793.026692
-188992.945404     8251773.324097
-188978.837541     8251755.575906
-188955.850277     8251745.204665
-188935.375061     8251734.246147
-188902.932558     8251728.111742
-188875.535085     8251719.550451
-188836.886537     8251710.190032
-188785.169396     8251696.246076
-188726.529986     8251684.700111
-188676.004109     8251674.530924
-188619.786789     8251668.030563
-188577.979768     8251660.500124
-188511.751516     8251653.845669
-188453.647641     8251647.942213
-188403.031030     8251643.406659
-188362.354024     8251643.406478
-188331.626689     8251647.316645
-188305.975395     8251646.921804
-188282.200578     8251646.555847
-188277.821369     8251646.488440
-188269.667520     8251647.614820
-188247.709459     8251651.033260
-188227.062867     8251650.715455
-188213.359467     8251646.748092
-188187.173414     8251640.709990
-188136.657234     8251629.915008
-188097.382812     8251620.544955
-188058.693556     8251613.688451
-188013.667194     8251611.743489
-187968.741645     8251603.539103
-187917.569736     8251594.611861
-187876.438613     8251583.961339
-187843.481127     8251570.932089
-187808.626242     8251559.125521
-187755.668196     8251544.536520
-187715.919500     8251525.767705
-187686.241457     8251503.397471
-187657.108252     8251486.044710
-187636.178931     8251464.435087
-187611.001461     8251434.620501
-187582.594560     8251411.017945
-187555.954009     8251394.329496
-187537.981920     8251383.408744
-187528.728292     8251375.127498
-187516.386780     8251364.293415
-187502.793888     8251353.440833
-187494.751312     8251347.682007
-187483.580129     8251341.875024
-187467.384075     8251337.243348
-187445.567153     8251331.898443
-187421.903609     8251324.647280
-187397.644439     8251315.508351
-187370.237256     8251307.573619
-187330.952374     8251298.829349
-187291.617455     8251293.215561
-187260.425937     8251287.100412
-187236.086494     8251282.969333
-187216.792081     8251276.411367
-187192.452639     8251272.280287
-187167.507492     8251266.887231
-187140.150333     8251255.822782
-187120.876471     8251248.012479
-187120.250597     8251248.002845
-187114.700663     8251242.909096
-187106.698033     8251234.646342
-187096.334560     8251217.582496
-187086.081609     8251193.632667
-187081.318476     8251178.532858
-187070.439639     8251154.574160
-187055.807478     8251130.556924
-187033.061783     8251105.162911
-187011.163744     8251066.008107
-186987.822424     8251038.726327
-186971.767509     8251025.331306
-186953.209861     8251011.897762
-186919.021177     8250997.596906
-186887.365463     8250981.457206
-186866.274834     8250969.863270
-186854.558813     8250959.038815
-186840.370678     8250946.298473
-186818.139967     8250927.799306
-186785.253044     8250910.388765
-186762.991702     8250893.767724
-186741.376405     8250875.903973
-186710.416746     8250855.392611
-186675.269042     8250822.920779
-186635.772376     8250788.503407
-186603.117326     8250756.695888
-186564.831318     8250724.801694
-186525.970223     8250689.768160
-186492.588486     8250664.210430
-186465.988262     8250645.018060
-186440.538211     8250632.104368
-186415.068384     8250620.442261
-186389.598544     8250608.780918
-186367.296888     8250594.663035
-186342.472710     8250581.758977
-186323.239164     8250571.445516
-186297.718549     8250562.913114
-186265.962023     8250553.032837
-186242.288400     8250546.407463
-186228.614854     8250540.562726
-186213.740359     8250531.568251
-186186.958681     8250523.642383
-186149.631682     8250509.919930
-186118.561133     8250496.293779
-186082.495579     8250481.964798
-186042.000039     8250470.697350
-186007.175773     8250457.013420
-185971.160243     8250439.554722
-185932.077367     8250418.291613
-185891.722954     8250398.261585
-185870.703282     8250382.285601
-185870.087487     8250381.650177
-185865.142900     8250377.816871
-185861.409340     8250376.507513
-185861.419419     8250375.881723
-185852.125476     8250370.103635
-185844.072440     8250364.970593
-185844.082519     8250364.344803
-185843.457026     8250364.335175
-185834.778485     8250359.193269
-185817.270592     8250358.297068
-185803.566809     8250354.329699
-185796.059375     8250354.214140
-185778.541008     8250353.944486
-185760.397531     8250353.665211
-185742.273830     8250352.134351
-185723.564964     8250348.089940
-185716.036989     8250349.225954
-185711.637622     8250350.410126
-185701.526260     8250356.515460
-185672.585432     8250366.088155
-185637.256736     8250383.700569
-185602.574059     8250400.071801
-185564.127598     8250417.010280
-185518.748395     8250436.973297
-185487.456064     8250437.117571
-185461.986225     8250425.456228
-185422.721882     8250415.460385
-185392.922487     8250400.601147
-185368.784669     8250383.951222
-185355.191790     8250373.097877
-185339.046141     8250365.336490
-185315.372136     8250358.711111
-185287.843984     8250358.287380
-185277.207942     8250358.123664
-185267.197774     8250357.969581
-185247.318196     8250348.898065
-185217.599825     8250329.031754
-185188.517026     8250308.549281
-185174.944304     8250296.444357
-185163.066974     8250295.635589
-185140.624560     8250290.281056
-185118.787469     8250286.188495
-185103.721429     8250289.087076
-185094.175457     8250298.957545
-185080.744706     8250316.907789
-185058.020014     8250329.079946
-185050.966314     8250339.614722
-185049.654463     8250343.350961
-185045.699121     8250355.812027
-185040.906190     8250381.408858
-185039.867371     8250407.062710
-185038.353896     8250423.317795
-185036.971469     8250431.436088
-185032.400344     8250443.260966
-185024.499740     8250467.557309
-185008.425117     8250494.232374
-184986.114214     8250519.558794
-184963.056455     8250552.387345
-184944.620442     8250570.259781
-184931.300391     8250581.324810
-184926.154168     8250590.011114
-184922.188557     8250603.097966
-184916.285602     8250619.911429
-184911.674138     8250634.240994
-184895.549109     8250664.045771
-184885.095378     8250691.432537
-184873.490890     8250712.541379
-184859.858324     8250743.010466
-184847.376313     8250779.758238
-184835.288125     8250830.911854
-184830.192770     8250875.286189
-184823.896634     8250916.512318
-184818.286678     8250953.991813
-184807.641211     8250993.271632
-184798.842353     8251034.458473
-184793.343288     8251065.052756
-184793.141664     8251077.571601
-184792.808979     8251098.228002
-184792.446058     8251120.761771
-184803.294266     8251146.598596
-184812.861049     8251174.294294
-184821.771913     8251203.857730
-184831.833319     8251239.700614
-184847.424692     8251281.888830
-184864.146259     8251331.608069
-184877.184685     8251376.887475
-184889.546818     8251425.287723
-184908.286574     8251466.272511
-184932.647018     8251507.969761
-184952.941039     8251569.013285
-184973.396536     8251620.042654
-184988.856658     8251670.368421
-185005.023308     8251715.695979
-185026.891098     8251756.728915
-185051.716120     8251808.450722
-185066.086172     8251848.742304
-185076.167748     8251883.332846
-185089.347301     8251919.849671
-185104.272663     8251964.532177
-185122.477470     8251999.873701
-185139.017120     8252022.041700
-185154.910726     8252045.452409
-185177.626184     8252072.723791
-185194.730842     8252098.656918
-185216.285655     8252120.276169
-185237.235133     8252140.634214
-185253.239642     8252157.158946
-185274.854952     8252175.021932
-185298.226139     8252200.425573
-185309.145292     8252221.881114
-185313.242223     8252239.475210
-185315.967200     8252264.561053
-185319.822574     8252297.177159
-185328.511644     8252340.511783
-185339.864743     8252373.870007
-185353.730285     8252406.640196
-185363.993328     8252429.963471
-185375.537591     8252451.428633
-185387.172969     8252467.260168
-185401.926494     8252483.765644
-185419.817941     8252499.693477
-185436.387827     8252519.984107
-185446.075401     8252540.168037
-185455.107235     8252562.220471
-185470.425755     8252582.491840
-185488.095802     8252612.190103
-185509.630457     8252635.060933
-185519.418831     8252648.986204
-185524.959068     8252654.705748
-185535.322910     8252671.770364
-185547.361999     8252701.381952
-185553.265607     8252723.386234
-185556.242615     8252732.823520
-185556.676561     8252744.726204
-185562.570091     8252767.356276
-185568.100687     8252812.520881
-185578.787598     8252848.372629
-185589.575702     8252877.964961
-185596.054397     8252903.108583
-185599.465351     8252924.448552
-185603.643318     8252937.034811
-185610.253443     8252954.041648
-185619.285276     8252976.094082
-185627.055665     8252998.753044
-185642.101997     8253035.924549
-185662.688185     8253078.815592
-185676.685156     8253103.448995
-185686.423137     8253120.503213
-185699.905125     8253138.241771
-185717.635275     8253164.184527
-185732.782420     8253195.096609
-185746.819719     8253217.226090
-185765.811314     8253242.562318
-185786.639822     8253270.431364
-185803.058121     8253300.110359
-185813.290915     8253325.311766
-185823.624521     8253344.253751
-185837.631190     8253368.261359
-185856.532433     8253399.231226
-185875.513950     8253425.193244
-185886.543624     8253439.762802
-185889.621443     8253442.940665
-185896.382786     8253450.558368
-185908.694062     8253463.269819
-185921.540098     8253481.624532
-185934.386146     8253499.978481
-185943.538949     8253514.519914
-185952.096508     8253527.173586
-185962.520847     8253540.481937
-185971.734135     8253551.267869
-185988.384688     8253566.549892
-186005.721206     8253578.086806
-186021.826528     8253588.352115
-186034.208368     8253596.682277
-186043.441825     8253606.215865
-186051.464243     8253613.226270
-186062.019631     8253618.397831
-186070.637687     8253627.295238
-186078.034601     8253634.296779
-186090.436611     8253641.374598
-186100.931132     8253650.301653
-186109.609673     8253655.443559
-186115.724984     8253664.303207
-186121.255130     8253670.649305
-186124.867708     8253679.470429
-186125.241170     8253695.128614
-186124.999219     8253710.151381
-186121.154780     8253715.726471
-186116.664285     8253722.545034
-186105.080158     8253742.401536
-186091.124345     8253754.082724
-186086.724596     8253755.266890
-186079.196991     8253756.403674
-186070.982658     8253761.285555
-186061.507249     8253766.774733
-186053.949408     8253769.788886
-186039.498782     8253773.322884
-186004.341831     8253780.295355
-185965.360229     8253791.590566
-185938.306351     8253800.565598
-185918.204979     8253805.265271
-185893.805052     8253804.889692
-185862.522800     8253804.408176
-185835.064829     8253799.603150
-185806.920894     8253798.543232
-185780.643726     8253798.138758
-185747.474524     8253798.254906
-185715.425653     8253806.526343
-185678.926220     8253819.113179
-185642.992571     8253835.464392
-185613.405712     8253846.279032
-185598.844577     8253856.698249
-185592.537720     8253859.731657
-185582.456607     8253863.958859
-185568.440310     8253879.395548
-185550.589640     8253899.782301
-185529.580510     8253921.998271
-185500.317088     8253951.600813
-185479.347903     8253971.312855
-185462.849412     8253985.459447
-185453.959180     8253993.461412
-185448.812957     8254002.147715
-185441.113595     8254013.925206
-185430.246062     8254028.158473
-185421.719214     8254052.444412
-185412.547074     8254077.973835
-185402.254258     8254095.345672
-185391.306083     8254114.586019
-185386.734946     8254126.411661
-185386.018338     8254132.035661
-185386.331698     8254151.449352
-185393.900462     8254186.627159
-185397.200525     8254214.852341
-185398.149455     8254233.649871
-185402.912588     8254248.749680
-185407.019980     8254265.717993
-185407.444230     8254278.246472
-185414.538338     8254304.025512
-185426.577427     8254333.637099
-185441.209970     8254357.654341
-185459.686963     8254376.095729
-185467.588412     8254390.617136
-185472.391872     8254403.213022
-185480.818370     8254424.004250
-185496.550692     8254457.429117
-185508.700660     8254480.156257
-185513.484344     8254494.003728
-185520.669185     8254514.149134
-185525.321809     8254536.134161
-185528.167755     8254553.709002
-185529.328007     8254559.361891
-185529.943802     8254559.997314
-185530.508810     8254563.762443
-185531.498067     8254580.056051
-185532.557888     8254591.968369
-185533.728600     8254596.995474
-185537.280694     8254609.572099
-185540.056077     8254631.528230
-185540.974771     8254652.203129
-185544.971272     8254676.056654
-185550.602692     8254714.961072
-185551.470586     8254738.766440
-185554.942407     8254756.350915
-185562.026818     8254782.755750
-185574.509933     8254823.644231
-185575.670578     8254829.296362
-185578.798803     8254829.344514
-185586.175560     8254837.597634
-185590.474115     8254842.672885
-185591.099989     8254842.682519
-185597.285876     8254847.160113
-185604.622317     8254857.916391
-185604.612226     8254858.542944
-185609.556813     8254862.376250
-185640.617283     8254876.628190
-185662.353575     8254886.979411
-185678.610102     8254887.856350
-185691.002033     8254895.559958
-185707.773556     8254903.330979
-185726.956684     8254916.774916
-185754.192873     8254935.350366
-185766.463811     8254950.566504
-185779.895393     8254971.434773
-185797.121033     8254989.856135
-185803.175859     8255002.471283
-185806.869079     8255006.285328
-185817.323679     8255017.714783
-185830.775419     8255037.331472
-185843.681940     8255051.930684
-185859.616255     8255072.837477
-185875.570371     8255092.491156
-185878.638099     8255096.295572
-185891.030030     8255103.999180
-185912.080332     8255118.097038
-185922.019937     8255122.632411
-185928.225981     8255125.858425
-185938.236531     8255126.012514
-185957.550719     8255131.318895
-185973.121282     8255135.940943
-185986.239493     8255137.396284
-186000.609477     8255138.869365
-186013.112311     8255139.686997
-186020.559249     8255143.558821
-186024.938840     8255143.626234
-186037.381178     8255148.200131
-186052.285908     8255155.317237
-186060.923740     8255162.963059
-186070.772981     8255173.132835
-186086.676690     8255195.916226
-186111.814214     8255228.234739
-186127.798554     8255246.011814
-186127.748148     8255249.141526
-186131.451459     8255252.329017
-186131.956364     8255259.849652
-186139.888049     8255272.493690
-186144.066017     8255285.079949
-186147.739080     8255290.145573
-186147.678607     8255293.900309
-186148.243984     8255297.666208
-186153.662870     8255310.896748
-186160.141946     8255336.040376
-186163.714197     8255347.365422
-186163.663791     8255350.495133
-186163.583136     8255355.502977
-186164.693376     8255364.284819
-186165.853997     8255369.938479
-186169.466587     8255378.758839
-186169.456496     8255379.385392
-186169.385933     8255383.766682
-186173.058996     8255388.832306
-186173.624397     8255392.596676
-186174.239798     8255393.232858
-186174.865673     8255393.242492
-186175.481074     8255393.878673
-186180.476091     8255394.580740
-186181.101966     8255394.590374
-186184.855683     8255394.648153
-186189.850676     8255395.351748
-186193.604775     8255395.409534
-186196.733000     8255395.457685
-END
-LINE3D
-HEIGHT 1140.000000
-186422.928660     8255067.107781
-186423.554152     8255067.117409
-186427.308252     8255067.175194
-186431.051903     8255067.857999
-186435.411312     8255069.178519
-186440.406330     8255069.880586
-186454.785998     8255070.728636
-186472.293916     8255071.623309
-186492.244046     8255076.314298
-186506.522927     8255083.420242
-186515.282110     8255083.555069
-186525.918152     8255083.718786
-186537.684209     8255091.412760
-186551.913041     8255101.649949
-186571.701504     8255116.355092
-186597.666169     8255136.162860
-186633.651069     8255155.499685
-186664.661108     8255172.882865
-186695.751827     8255185.256672
-186731.908484     8255193.952791
-186762.312832     8255210.073229
-186775.895632     8255221.552364
-186784.503598     8255231.076325
-186791.869905     8255239.954464
-186805.482955     8255249.555466
-186818.551166     8255254.138997
-186822.869879     8255257.962669
-186833.495854     8255258.751411
-186850.327849     8255262.767695
-186883.305493     8255274.545367
-186903.174993     8255284.242673
-186910.672743     8255284.983263
-186918.806052     8255285.108456
-186926.394499     8255280.217705
-186934.759681     8255265.945920
-186943.145020     8255250.422556
-186944.688756     8255232.288575
-186945.707405     8255207.887066
-186941.842347     8255175.895991
-186937.855912     8255151.417441
-186931.901898     8255132.542869
-186926.533061     8255116.181084
-186922.950719     8255105.482591
-186913.272854     8255084.672102
-186901.243832     8255054.435490
-186889.234991     8255022.945770
-186877.902431     8254988.335972
-186874.127712     8254950.712023
-186874.500736     8254927.550936
-186875.024953     8254895.002244
-186875.438268     8254869.339527
-186870.735620     8254850.484218
-186866.164033     8254823.491353
-186862.682121     8254806.533432
-186857.979474     8254787.678123
-186857.616102     8254771.393384
-186857.676600     8254767.637120
-186862.317906     8254751.430945
-186875.910335     8254723.465783
-186880.309252     8254683.463104
-186883.679428     8254668.488488
-186883.840725     8254658.473565
-186884.062519     8254644.702376
-186879.824054     8254635.872383
-186871.256798     8254623.844506
-186866.382775     8254615.629909
-186865.212051     8254610.603568
-186854.767554     8254598.546795
-186845.594582     8254585.257706
-186831.436695     8254570.639232
-186817.127590     8254565.409892
-186798.368318     8254564.495193
-186782.878410     8254554.865301
-186753.684719     8254541.268040
-186718.103531     8254535.711268
-186691.816272     8254535.933347
-186676.750614     8254538.831934
-186649.222080     8254538.408198
-186612.550821     8254522.817240
-186588.160973     8254521.815872
-186570.208659     8254509.643534
-186549.733837     8254498.684258
-186531.872245     8254480.879052
-186509.026120     8254461.744466
-186476.996562     8254429.946575
-186453.080156     8254399.525456
-186440.173623     8254384.927008
-186424.834933     8254365.907982
-186399.526021     8254344.230946
-186375.509184     8254320.069255
-186347.687830     8254298.980255
-186325.376095     8254285.488161
-186303.710379     8254270.754886
-186283.871510     8254259.179454
-186250.893472     8254247.402540
-186220.448809     8254233.785260
-186203.082043     8254224.126478
-186192.516564     8254219.581471
-186172.626907     8254211.135745
-186148.307240     8254205.753081
-186110.768538     8254205.175262
-186093.725210     8254214.304382
-186077.306991     8254223.443125
-186060.808513     8254237.588953
-186049.365512     8254248.682875
-186044.854860     8254256.753016
-186035.763004     8254277.273826
-186024.078052     8254303.390516
-186019.971492     8254325.240716
-186019.628741     8254346.522141
-186019.124681     8254377.819255
-186018.781918     8254399.101445
-186019.528842     8254430.417815
-186022.708305     8254466.154768
-186025.978132     8254496.257318
-186028.894655     8254509.450104
-186029.238250     8254526.986427
-186032.013633     8254548.942559
-186032.346768     8254567.104665
-186036.393688     8254587.827715
-186039.744157     8254612.923185
-186042.539697     8254633.627738
-186048.453384     8254655.006231
-186052.470055     8254677.607413
-186052.843517     8254693.265598
-186055.739870     8254707.710727
-186060.432833     8254727.191068
-186067.557177     8254751.092739
-186071.160059     8254760.539658
-186074.802873     8254767.483414
-186078.546906     8254768.166225
-186085.983753     8254772.664603
-186097.175105     8254777.219243
-186110.172371     8254786.184058
-186125.712685     8254792.684238
-186140.516604     8254806.060767
-186155.976263     8254817.568792
-186168.953371     8254827.785185
-186178.126332     8254841.075039
-186184.816741     8254853.073262
-186192.668154     8254870.725150
-186197.976136     8254890.841666
-186205.282329     8254903.476077
-186211.357313     8254914.839646
-186214.404883     8254919.895642
-186219.975369     8254923.737054
-186236.806982     8254927.753332
-186257.352762     8254934.330560
-186266.606377     8254942.612570
-186274.033157     8254947.735973
-186285.194261     8254954.168746
-186300.007889     8254966.918715
-186312.995446     8254976.510089
-186324.731254     8254986.082196
-186335.185854     8254997.511651
-186346.891796     8255008.961895
-186364.813492     8255023.011595
-186382.755726     8255035.809722
-186387.064730     8255040.259954
-186390.112325     8255045.314421
-186396.298187     8255049.793543
-186399.365940     8255053.596431
-186408.003772     8255061.242254
-186409.245047     8255061.888069
-186409.870540     8255061.897697
-186411.121906     8255061.916959
-END
-LINE3D
-HEIGHT 1140.000000
-187767.546630     8254187.476533
-187768.172504     8254187.486167
-187769.423489     8254187.505422
-187773.803080     8254187.572836
-187785.700567     8254187.130025
-187809.575814     8254181.236553
-187832.169459     8254177.201187
-187855.399044     8254172.550430
-187875.429840     8254172.232812
-187903.684679     8254166.406753
-187923.775972     8254162.332870
-187938.871866     8254157.556915
-187955.976074     8254144.671535
-187972.424528     8254133.655424
-187988.226951     8254123.881259
-188020.346410     8254111.227003
-188054.534643     8254086.709352
-188072.173597     8254079.467998
-188095.453600     8254071.686765
-188138.117974     8254064.830618
-188180.107213     8254061.094566
-188202.085444     8254056.423783
-188227.121324     8254056.183206
-188258.464060     8254052.909221
-188289.140990     8254052.128766
-188316.113832     8254048.161572
-188343.642366     8254048.585308
-188348.021576     8254048.652715
-188348.647832     8254048.662355
-188367.427261     8254048.325475
-188408.174843     8254043.943602
-188450.233895     8254035.825483
-188494.210501     8254025.233103
-188530.639358     8254017.028321
-188558.348595     8254006.184779
-188587.996322     8253991.614643
-188616.533427     8253968.262660
-188634.393793     8253947.250111
-188652.224674     8253928.115707
-188667.552823     8253908.942779
-188682.264806     8253889.133658
-188698.945515     8253863.720576
-188711.275735     8253836.361929
-188729.247756     8253808.464181
-188750.348002     8253780.614584
-188769.641571     8253748.354801
-188783.364678     8253712.252077
-188792.557346     8253685.471845
-188799.913113     8253656.158031
-188804.140642     8253626.796829
-188808.196795     8253608.076341
-188808.983584     8253598.071045
-188810.487363     8253582.441756
-188815.955810     8253553.724836
-188819.537690     8253525.605585
-188819.991344     8253497.438183
-188820.606295     8253459.255857
-188822.483073     8253420.467010
-188823.642874     8253387.301391
-188824.146934     8253356.004278
-188824.085987     8253320.942036
-188819.715642     8253281.430320
-188815.366218     8253240.667037
-188811.470135     8253210.554847
-188803.134370     8253184.129986
-188794.223506     8253154.566550
-188784.697241     8253124.366933
-188775.191133     8253092.915737
-188769.307682     8253069.659875
-188764.019488     8253048.291010
-188756.854816     8253026.893261
-188752.767188     8253008.674127
-188742.504539     8252985.350094
-188738.639469     8252953.359784
-188733.522650     8252921.350205
-188729.101899     8252884.968201
-188724.166546     8252841.691356
-188717.869306     8252805.281232
-188713.328337     8252776.411005
-188707.666680     8252739.383955
-188701.005305     8252686.689080
-188697.170483     8252652.820637
-188692.598501     8252625.828531
-188691.881825     8252592.634029
-188688.904356     8252544.379000
-188680.961760     8252493.542238
-188677.468925     8252438.392357
-188672.292385     8252410.138292
-188663.109333     8252397.474992
-188659.021717     8252379.255094
-188648.849790     8252350.298191
-188641.704512     8252327.648852
-188636.941762     8252312.549049
-188632.168168     8252298.075024
-188624.236865     8252285.430991
-188613.287464     8252265.853583
-188591.107159     8252244.224705
-188569.572504     8252221.353875
-188538.017602     8252198.954751
-188503.283305     8252179.637176
-188467.964607     8252157.806063
-188418.901417     8252134.511497
-188374.288776     8252106.902296
-188343.399682     8252082.009643
-188311.319336     8252053.341457
-188286.505250     8252039.810846
-188263.497816     8252030.691949
-188237.533557     8252010.882658
-188204.595846     8251996.601823
-188171.607729     8251985.450699
-188136.087407     8251976.138431
-188088.053802     8251966.633551
-188025.115836     8251950.012335
-187978.959090     8251940.536345
-187934.124274     8251926.698326
-187875.525573     8251912.648445
-187837.007704     8251895.150465
-187797.298941     8251873.878486
-187753.352121     8251843.774991
-187710.232404     8251801.163042
-187655.659620     8251770.270041
-187609.764983     8251744.519705
-187576.222319     8251728.977668
-187534.020914     8251707.040612
-187491.789643     8251686.981695
-187451.465479     8251665.073534
-187398.023080     8251641.711561
-187346.457551     8251618.377713
-187289.230804     8251596.836086
-187238.936418     8251572.269915
-187201.074659     8251552.904201
-187155.765569     8251529.667420
-187111.737712     8251504.571763
-187062.775716     8251475.017780
-186988.353590     8251433.175895
-186928.795498     8251400.954267
-186869.833031     8251370.620407
-186820.800472     8251345.447714
-186765.813516     8251301.400444
-186711.987194     8251263.006069
-186664.407625     8251225.333793
-186623.346234     8251171.483468
-186599.419736     8251141.688902
-186569.267419     8251109.919907
-186529.265849     8251067.981899
-186488.618247     8251027.285837
-186455.438516     8250989.209267
-186415.275649     8250957.286184
-186385.112871     8250926.142972
-186360.570972     8250895.712225
-186341.589456     8250869.750207
-186312.667953     8250839.252810
-186274.412193     8250805.480484
-186241.171596     8250771.159409
-186210.252265     8250748.144124
-186170.483400     8250730.627652
-186133.176570     8250715.652856
-186105.264495     8250700.196724
-186077.998069     8250683.498642
-186031.922347     8250669.015578
-185988.328819     8250655.822610
-185944.069101     8250645.123167
-185892.907259     8250635.570900
-185852.310908     8250630.562875
-185801.109132     8250623.513771
-185754.205912     8250621.539919
-185722.923660     8250621.058403
-185690.914722     8250626.826676
-185648.915786     8250631.188524
-185613.103107     8250640.028735
-185581.740200     8250644.555063
-185558.530773     8250647.954241
-185528.984240     8250656.264960
-185496.148186     8250674.542450
-185464.503013     8250696.594704
-185440.405972     8250716.259364
-185411.273611     8250737.724352
-185389.739419     8250753.671265
-185375.158114     8250765.342825
-185367.499079     8250774.616394
-185355.914951     8250794.472896
-185337.953391     8250821.744862
-185324.481944     8250842.198258
-185304.108384     8250863.798066
-185290.697791     8250880.496732
-185290.617149     8250885.503812
-185289.840439     8250894.883318
-185289.477505     8250917.417851
-185294.765331     8250938.785946
-185300.184573     8250952.018020
-185308.166664     8250961.532347
-185314.110600     8250981.032708
-185317.461069     8251006.128178
-185312.143470     8251025.455194
-185301.376368     8251033.429033
-185279.166277     8251052.496030
-185265.170531     8251066.680381
-185256.835216     8251079.074028
-185245.766059     8251105.826141
-185240.256533     8251137.046207
-185235.131312     8251183.298680
-185229.925067     8251234.558228
-185233.013427     8251275.928044
-185239.079164     8251326.735916
-185247.748077     8251371.322120
-185257.002154     8251418.421873
-185266.962760     8251460.523416
-185286.398763     8251497.136544
-185315.683637     8251543.918679
-185338.701982     8251591.230300
-185358.117827     8251629.095008
-185379.874726     8251677.013156
-185399.895906     8251716.139071
-185424.347072     8251752.203451
-185449.373718     8251791.406413
-185465.661338     8251829.222968
-185480.353996     8251849.483940
-185493.240741     8251865.334736
-185511.697565     8251885.028467
-185534.392471     8251913.552187
-185556.986948     8251948.335334
-185562.436451     8251959.688512
-185569.237739     8251964.802287
-185576.564102     8251976.184354
-185587.593764     8251990.754676
-185601.650838     8252011.632573
-185618.099768     8252039.433441
-185638.797216     8252075.440042
-185655.135242     8252110.126887
-185671.563619     8252139.180092
-185680.413986     8252172.499793
-185683.159133     8252196.333292
-185684.087893     8252216.383165
-185687.519399     8252236.470798
-185697.085991     8252264.166493
-185707.238143     8252294.374980
-185719.711167     8252335.890016
-185740.277566     8252380.033408
-185760.278589     8252420.410901
-185778.503553     8252454.500846
-185793.166344     8252476.639955
-185808.434458     8252500.041035
-185815.599142     8252521.438020
-185816.003222     8252535.218843
-185819.424267     8252555.932259
-185823.895042     8252589.184546
-185827.306378     8252610.524522
-185828.416605     8252619.307128
-185833.795152     8252635.042354
-185837.902556     8252652.009903
-185838.376830     8252661.408665
-185839.517305     8252668.313139
-185843.049611     8252682.142113
-185844.250189     8252685.291080
-185844.865985     8252685.926504
-185854.079285     8252696.711671
-185862.131939     8252701.844708
-185870.790311     8252708.238957
-185879.498706     8252711.503490
-185890.114590     8252712.918785
-185907.582169     8252716.318144
-185923.213216     8252717.184691
-185935.595056     8252725.514853
-185944.768029     8252738.803942
-185949.561410     8252752.025618
-185952.518247     8252762.715247
-185953.628475     8252771.497853
-185954.668138     8252784.661750
-185960.420528     8252816.055167
-185971.107439     8252851.906915
-185986.415880     8252872.804074
-185996.860377     8252884.860846
-186013.460524     8252903.272580
-186037.982265     8252934.954906
-186060.122243     8252959.087707
-186076.752627     8252975.622073
-186092.666403     8252997.780438
-186116.502167     8253033.208637
-186148.178883     8253086.914508
-186173.225304     8253124.865885
-186192.762119     8253155.219590
-186207.314020     8253184.243912
-186224.913109     8253218.324223
-186242.603314     8253246.770907
-186262.906760     8253268.370896
-186282.373011     8253303.105892
-186305.391356     8253350.417513
-186328.016081     8253383.322528
-186352.588228     8253411.875143
-186391.590462     8253438.145332
-186421.197930     8253464.897620
-186441.541703     8253483.993687
-186466.941349     8253500.037090
-186492.825347     8253524.853466
-186519.839361     8253557.200099
-186544.381272     8253587.630082
-186572.707518     8253616.240482
-186595.432661     8253642.886833
-186628.209075     8253667.182592
-186665.213469     8253700.935657
-186690.421187     8253728.872110
-186719.352768     8253758.743717
-186744.661299     8253780.420748
-186780.605871     8253802.261495
-186808.366728     8253827.106760
-186834.765710     8253858.817982
-186860.094410     8253879.242670
-186887.905673     8253900.958224
-186913.244452     8253920.757122
-186931.650882     8253943.579800
-186950.723502     8253963.908955
-186964.326472     8253974.135746
-186968.070111     8253974.819315
-186968.695603     8253974.828943
-186976.072359     8253983.082063
-187000.210559     8253999.731994
-187025.609823     8254015.775391
-187045.993924     8254032.367537
-187067.084541     8254043.962236
-187090.667443     8254056.220479
-187123.524118     8254075.509152
-187158.258033     8254094.826722
-187186.815758     8254109.040902
-187204.818477     8254118.083528
-187225.283233     8254129.667830
-187257.645463     8254140.810084
-187279.987077     8254152.423276
-187292.944386     8254163.892782
-187304.004296     8254176.584972
-187321.240014     8254194.380545
-187344.076430     8254214.141689
-187359.475617     8254229.404450
-187377.467875     8254239.072860
-187397.973328     8254248.154010
-187408.538412     8254252.699775
-187409.103801     8254256.464909
-187414.108885     8254256.541951
-187430.375504     8254256.792336
-187445.391137     8254257.023466
-187461.032263     8254257.264224
-187472.929750     8254256.821413
-187488.631373     8254253.305906
-187507.531773     8254245.458024
-187525.776061     8254239.477877
-187548.995580     8254235.452145
-187572.255413     8254228.923256
-187586.110414     8254223.501491
-187599.329449     8254218.696645
-187614.435816     8254213.294142
-187641.429210     8254208.074611
-187665.304457     8254202.181139
-187679.068724     8254202.393007
-187682.822441     8254202.450787
-187691.581624     8254202.585613
-187695.335342     8254202.643393
-187701.662356     8254198.358406
-187709.180251     8254197.848181
-187712.994466     8254194.149696
-187718.635503     8254193.610582
-187724.286618     8254192.445678
-187731.188731     8254191.299266
-187736.880174     8254187.630440
-187738.131158     8254187.649696
-187741.885257     8254187.707482
-187745.013483     8254187.755633
-187748.141708     8254187.803785
-187748.767200     8254187.813413
-187753.146792     8254187.880826
-187753.156870     8254187.255037
-187754.408237     8254187.274298
-187755.659603     8254187.293560
-END
-LINE3D-MASTER
-HEIGHT 1150.000000
-187904.619647     8253779.684910
-187911.267046     8253773.333963
-187915.091327     8253769.010452
-187924.102541     8253753.496722
-187936.150876     8253743.664007
-187947.483356     8253739.456067
-187959.996257     8253739.648674
-187978.765608     8253739.937583
-188001.833514     8253745.301744
-188032.379383     8253752.658844
-188058.585987     8253757.444608
-188076.103972     8253757.714256
-188084.863155     8253757.849082
-188102.371061     8253758.744520
-188139.283889     8253759.312704
-188157.447905     8253758.340407
-188173.149516     8253754.825664
-188194.492176     8253750.771043
-188223.342258     8253746.832744
-188239.709688     8253740.823708
-188250.567894     8253727.217006
-188268.559320     8253698.066902
-188288.478381     8253665.816747
-188302.222410     8253628.462457
-188317.186424     8253593.004779
-188335.229008     8253560.725740
-188358.881629     8253529.784943
-188382.029728     8253491.323517
-188408.417718     8253446.024278
-188422.796554     8253408.053814
-188434.754076     8253365.036995
-188442.382030     8253318.823045
-188450.998848     8253288.903462
-188460.827099     8253261.506304
-188464.924343     8253240.281905
-188469.858019     8253205.922488
-188471.098463     8253167.749790
-188467.334204     8253129.500057
-188464.225686     8253089.381819
-188459.653717     8253062.388948
-188448.250199     8253032.161199
-188432.003288     8252991.840728
-188418.984650     8252945.308973
-188408.338449     8252906.953308
-188398.095195     8252882.377685
-188386.086354     8252850.887965
-188376.055566     8252813.167718
-188366.680519     8252773.578966
-188356.558234     8252741.492341
-188348.919289     8252710.695830
-188348.596232     8252691.907934
-188344.407792     8252679.948223
-188339.776102     8252656.710865
-188331.995253     8252634.677687
-188328.059619     8252607.068666
-188324.143378     8252578.208055
-188323.699340     8252566.931925
-188322.720555     8252550.011769
-188318.784157     8252522.402737
-188314.202861     8252496.036432
-188310.589519     8252487.215296
-188310.054760     8252481.572035
-188295.998055     8252460.694908
-188266.289394     8252440.202037
-188239.719024     8252419.132293
-188215.591678     8252401.855820
-188195.933500     8252379.013874
-188176.750359     8252365.570702
-188157.567219     8252352.127530
-188129.685392     8252334.793266
-188105.082996     8252308.118783
-188083.407202     8252294.011298
-188063.638514     8252278.054570
-188031.992509     8252261.288310
-187991.688503     8252238.128571
-187961.586592     8252203.229864
-187923.744609     8252182.612565
-187882.048491     8252168.196150
-187852.864879     8252153.973100
-187824.246275     8252143.515178
-187790.643139     8252131.727878
-187763.185168     8252126.922852
-187743.255184     8252120.981047
-187718.350352     8252113.084833
-187685.493678     8252093.796160
-187646.461208     8252069.403339
-187619.840826     8252051.462548
-187596.247845     8252039.830095
-187570.838121     8252024.412481
-187532.390816     8252002.533210
-187499.049789     8251974.471564
-187475.779414     8251942.808500
-187456.141775     8251918.714981
-187421.448187     8251896.893490
-187382.355220     8251876.256934
-187353.837822     8251859.538832
-187325.865250     8251847.838965
-187290.334467     8251839.152481
-187252.795765     8251838.574662
-187226.508518     8251838.795977
-187198.445212     8251832.729744
-187156.133299     8251817.677906
-187108.917114     8251796.289604
-187062.911573     8251777.425244
-187003.132081     8251758.974047
-186947.126464     8251739.329051
-186891.736261     8251720.319472
-186857.053134     8251697.872197
-186831.774458     8251674.317792
-186806.405443     8251656.396262
-186769.169177     8251637.040175
-186736.463720     8251608.362368
-186704.090554     8251559.028918
-186669.558645     8251527.192509
-186647.943348     8251509.328759
-186646.762545     8251504.928207
-186643.018918     8251504.243874
-186636.368454     8251489.741723
-186625.439604     8251468.911978
-186610.857837     8251441.765795
-186596.285779     8251413.993052
-186589.524818     8251406.375355
-186589.534897     8251405.749566
-186577.869270     8251391.796163
-186568.020399     8251381.627157
-186556.929871     8251370.812330
-186543.266798     8251364.341045
-186533.982934     8251357.937167
-186525.304393     8251352.795261
-186514.668351     8251352.631544
-186501.459395     8251356.810600
-186489.330035     8251371.650389
-186476.645758     8251382.098496
-186465.212836     8251392.566629
-186454.445746     8251400.539703
-186442.427659     8251408.494286
-186424.283800     8251408.215005
-186404.343737     8251402.898990
-186390.740767     8251392.672198
-186375.341592     8251377.408673
-186348.196518     8251353.199595
-186311.484482     8251301.294051
-186271.634130     8251249.966910
-186234.034099     8251214.326843
-186197.806797     8251171.194278
-186156.352237     8251141.755854
-186121.638861     8251121.186712
-186097.551079     8251101.406305
-186078.993431     8251087.972761
-186057.357963     8251071.361354
-186033.290339     8251050.329369
-186011.019300     8251034.334123
-185986.295935     8251015.170642
-185957.818852     8250995.949382
-185932.388958     8250981.784111
-185924.901299     8250980.416968
-185911.823403     8250976.458469
-185893.114537     8250972.414058
-185869.965594     8250972.057736
-185854.324468     8250971.816978
-185839.843975     8250977.229115
-185833.516962     8250981.514102
-185825.868005     8250990.161882
-185811.206046     8251006.841285
-185791.438203     8251029.702307
-185785.060783     8251037.117005
-185784.303848     8251045.244926
-185771.690980     8251090.129492
-185759.723380     8251133.772100
-185750.228645     8251179.331371
-185744.548126     8251221.192156
-185740.400857     8251245.546272
-185739.341868     8251272.452468
-185738.716838     8251311.260583
-185737.395359     8251354.441118
-185737.396203     8251393.258867
-185744.047117     8251446.579525
-185752.221204     8251483.019304
-185754.794963     8251517.494280
-185757.479613     8251545.084045
-185761.334987     8251577.700150
-185767.309158     8251595.323143
-185774.615351     8251607.957553
-185788.652268     8251630.087029
-185808.713776     8251666.709021
-185818.533230     8251717.574673
-185821.893791     8251742.043590
-185826.112073     8251752.126691
-185827.222313     8251760.908533
-185834.588990     8251769.787442
-185853.762040     8251783.857168
-185876.517825     8251808.624628
-185900.625777     8251827.152692
-185922.927052     8251841.270569
-185947.650417     8251860.434050
-185964.755075     8251886.367178
-185982.455358     8251914.188072
-185989.408709     8251948.730462
-185992.174013     8251971.312382
-185991.851419     8251991.342229
-185991.448171     8252016.379920
-185997.866381     8252045.279043
-186009.713912     8252086.784450
-186029.906468     8252115.269652
-186059.463541     8252145.150887
-186087.356291     8252200.677110
-186109.779392     8252246.100971
-186119.285500     8252277.552167
-186120.274757     8252293.845775
-186120.093291     8252305.113041
-186120.971658     8252328.291862
-186125.018183     8252349.015670
-186129.085260     8252368.487141
-186133.808065     8252386.090871
-186140.872318     8252413.747285
-186154.556394     8252457.784740
-186171.338827     8252503.748485
-186188.776620     8252547.843719
-186205.588920     8252591.929326
-186222.603227     8252623.496093
-186235.338371     8252648.736018
-186244.380283     8252670.162663
-186257.095271     8252696.654167
-186271.667329     8252724.426909
-186288.782065     8252749.734248
-186304.686145     8252772.518408
-186318.137515     8252792.134328
-186329.651912     8252815.477629
-186345.333827     8252852.032208
-186372.933388     8252886.892397
-186412.369950     8252925.065276
-186438.566926     8252969.295337
-186459.395435     8252997.164383
-186473.967111     8253024.937120
-186486.783292     8253045.169207
-186502.081655     8253066.692155
-186517.369939     8253088.840892
-186536.472425     8253107.291908
-186547.481929     8253123.113809
-186569.097226     8253140.977559
-186594.406151     8253162.653832
-186617.878150     8253181.798051
-186639.453120     8253202.165723
-186667.304711     8253221.377355
-186686.427366     8253238.576028
-186695.045410     8253247.474199
-186695.035331     8253248.099989
-186695.600339     8253251.865117
-186696.841614     8253252.510933
-186709.637638     8253273.994599
-186722.453425     8253294.227444
-186736.651639     8253306.341996
-186754.018406     8253316.000778
-186783.777486     8253333.363173
-186802.335134     8253346.796718
-186809.822399     8253348.164620
-186817.269731     8253352.035685
-186842.083830     8253365.565533
-186873.739925     8253381.705239
-186892.993630     8253390.767121
-186911.652090     8253397.941243
-186927.081513     8253411.326635
-186941.895522     8253424.076611
-186953.611161     8253434.901060
-186957.879862     8253441.853686
-186967.617842     8253458.907904
-186979.212893     8253477.243361
-186999.031987     8253490.070378
-187011.978834     8253502.165668
-187022.463658     8253511.718518
-187027.943398     8253521.194328
-187033.382429     8253533.174053
-187034.573311     8253536.948816
-187038.791606     8253547.031152
-187047.368940     8253558.433240
-187062.051902     8253579.320006
-187078.601631     8253600.862216
-187100.812184     8253620.612962
-187121.882644     8253633.459241
-187141.681568     8253647.538600
-187159.623421     8253660.336721
-187160.249295     8253660.346355
-187160.239216     8253660.972145
-187160.854630     8253661.607562
-187160.834472     8253662.859141
-187161.459964     8253662.868769
-187167.605512     8253669.851048
-187167.555106     8253672.980760
-187173.125579     8253676.822936
-187174.356788     8253678.093776
-187182.348958     8253686.982314
-187194.690483     8253697.815633
-187203.389169     8253701.706725
-187209.585135     8253705.558529
-187218.343936     8253705.693350
-187230.856837     8253705.885956
-187244.005690     8253705.462407
-187254.086434     8253701.234435
-187269.122225     8253700.213986
-187281.695611     8253696.651091
-187297.346827     8253696.265296
-187313.532791     8253701.523525
-187327.841896     8253706.752865
-187337.226572     8253706.897320
-187352.857619     8253707.763867
-187372.676712     8253720.590884
-187387.581455     8253727.707226
-187411.144187     8253741.217811
-187419.206920     8253745.725058
-187419.751770     8253750.741766
-187428.349657     8253760.891516
-187435.130787     8253767.256870
-187446.130582     8253783.705331
-187460.359045     8253793.941750
-187471.459283     8253804.130018
-187474.567350     8253805.429749
-187474.557259     8253806.056302
-187475.182751     8253806.065930
-187475.172673     8253806.691720
-187475.162594     8253807.317509
-187475.152515     8253807.943299
-187480.067248     8253813.653979
-187483.185394     8253814.327920
-187502.348365     8253829.023435
-187514.770532     8253834.849675
-187522.742545     8253844.989791
-187539.372928     8253861.524157
-187553.692124     8253866.126944
-187562.431138     8253867.514113
-187573.632187     8253871.442959
-187603.532012     8253880.042768
-187627.932321     8253880.418352
-187641.706679     8253880.003667
-187648.608779     8253878.858019
-187662.383125     8253878.444098
-187675.592094     8253874.264277
-187688.740948     8253873.840728
-187705.703622     8253869.719452
-187719.488059     8253868.678977
-187733.322889     8253864.509554
-187749.730647     8253855.996596
-187770.518378     8253847.551056
-187788.167411     8253839.683913
-187800.791202     8253832.991307
-187802.042569     8253833.010568
-187805.180885     8253832.432166
-187811.517977     8253827.521390
-187815.897187     8253827.588797
-187816.523061     8253827.598431
-187817.148554     8253827.608059
-187825.352439     8253823.351198
-187829.187180     8253818.401903
-187839.893798     8253814.183566
-187846.866462     8253808.656627
-187856.311634     8253805.044817
-187867.714295     8253796.455581
-187875.232203     8253795.944593
-187885.323013     8253791.091596
-187895.343642     8253790.619895
-187904.619647     8253779.684910
-END
-LINE3D
-HEIGHT 1160.000000
-187436.064830     8253476.135935
-187436.639916     8253479.275274
-187437.245621     8253480.537251
-187440.858199     8253489.358375
-187449.435928     8253500.759704
-187455.470584     8253514.627196
-187465.309376     8253525.421991
-187477.065724     8253533.742525
-187481.435237     8253534.435727
-187500.759517     8253539.115555
-187528.288051     8253539.539291
-187543.303303     8253539.770415
-187556.442078     8253539.972655
-187567.713691     8253539.520210
-187580.428216     8253527.193971
-187597.542490     8253513.683566
-187609.621062     8253501.973483
-187620.509134     8253486.488643
-187634.676649     8253461.662820
-187645.776424     8253433.033345
-187654.323072     8253407.494293
-187658.379226     8253388.773805
-187658.530444     8253379.384671
-187658.732068     8253366.865825
-187658.308200     8253354.337352
-187649.841362     8253336.050810
-187636.429937     8253313.930963
-187632.151539     8253307.604133
-187621.616309     8253301.180993
-187602.947770     8253294.632661
-187588.628586     8253290.029111
-187582.442699     8253285.551518
-187573.068103     8253284.781273
-187561.261349     8253279.590451
-187547.597894     8253273.119160
-187543.319114     8253266.792324
-187538.465248     8253257.326149
-187534.327608     8253242.235968
-187534.549390     8253228.465544
-187538.404301     8253222.263907
-187547.879710     8253216.774728
-187552.904951     8253215.600191
-187561.654056     8253216.360807
-187574.631152     8253226.577964
-187587.588078     8253238.047465
-187611.827091     8253248.437973
-187633.099175     8253248.765406
-187658.669826     8253254.167327
-187670.446331     8253261.236281
-187684.644558     8253273.350069
-187695.583486     8253293.554025
-187698.419354     8253311.754655
-187701.245143     8253330.581075
-187710.226570     8253355.763220
-187715.080436     8253365.229396
-187715.464371     8253380.261033
-187728.320486     8253397.989956
-187743.719660     8253413.253481
-187762.327714     8253423.557314
-187787.979008     8253423.952155
-187818.635768     8253424.424042
-187851.169386     8253424.924820
-187885.125364     8253414.804140
-187925.933431     8253406.666766
-187953.593026     8253398.952947
-187978.749876     8253391.201368
-188009.598180     8253379.780200
-188034.835685     8253367.020778
-188044.371578     8253357.776098
-188048.296684     8253347.192401
-188049.548050     8253347.211663
-188053.937720     8253346.653287
-188059.043616     8253340.470905
-188059.063774     8253339.219326
-188062.302902     8253332.381502
-188071.959765     8253315.625821
-188081.546065     8253303.251430
-188089.215178     8253293.352071
-188098.185683     8253280.342257
-188106.036263     8253259.175632
-188112.786695     8253228.600611
-188117.074721     8253195.483145
-188113.946033     8253156.617250
-188114.601311     8253115.931002
-188110.937483     8253071.421841
-188110.180098     8253040.731255
-188109.473501     8253006.910963
-188109.422250     8252971.222926
-188113.074706     8252938.721621
-188113.498111     8252912.432351
-188113.669487     8252901.791638
-188113.961844     8252883.639159
-188106.503983     8252841.575376
-188097.048282     8252806.994468
-188087.551871     8252774.917476
-188079.035021     8252759.759888
-188068.600603     8252747.077326
-188049.043618     8252717.975964
-188014.037053     8252676.740787
-187981.573548     8252633.040212
-187934.457330     8252566.574738
-187865.322555     8252507.283969
-187826.017434     8252460.973541
-187801.455366     8252431.795137
-187765.480545     8252411.832522
-187736.407837     8252390.723496
-187706.649139     8252373.361106
-187674.982964     8252357.847189
-187627.726452     8252338.962809
-187579.158076     8252323.815432
-187526.179872     8252310.478010
-187482.616592     8252295.406910
-187459.083726     8252280.018186
-187423.623889     8252266.950418
-187365.670455     8252251.658580
-187310.986780     8252227.650791
-187251.418991     8252196.054960
-187201.700061     8252174.628898
-187143.736943     8252159.962092
-187090.173179     8252144.111878
-187039.172646     8252124.543923
-186988.192665     8252103.723631
-186946.021496     8252079.909206
-186896.363063     8252054.726880
-186857.229781     8252036.593482
-186827.945357     8252028.629855
-186807.914943     8252028.947479
-186767.732368     8252037.094481
-186730.708268     8252043.411502
-186697.397939     8252052.290231
-186657.780754     8252064.202368
-186631.281793     8252077.569082
-186618.607595     8252087.391399
-186606.559272     8252097.223350
-186605.862834     8252101.595007
-186598.809503     8252112.130553
-186589.889023     8252122.010649
-186579.687310     8252133.749623
-186566.225942     8252153.577230
-186554.540990     8252179.693919
-186549.233469     8252198.395146
-186545.056346     8252224.626636
-186544.763989     8252242.779115
-186544.481723     8252260.305040
-186544.169195     8252279.709862
-186547.963703     8252316.081462
-186553.130928     8252344.961329
-186562.192997     8252365.136395
-186569.953307     8252388.421146
-186581.457625     8252412.390237
-186593.042215     8252431.351477
-186601.054937     8252438.987678
-186613.315807     8252454.828841
-186641.187555     8252472.788894
-186678.292773     8252500.281772
-186702.733860     8252536.971942
-186722.644137     8252582.983832
-186748.962094     8252619.702128
-186781.001731     8252650.874230
-186811.184297     8252680.765093
-186828.914817     8252706.708618
-186838.572142     8252728.770681
-186851.358075     8252750.880900
-186867.160960     8252779.924478
-186882.217384     8252816.469429
-186896.072834     8252849.866171
-186910.665062     8252876.386570
-186921.573754     8252898.467894
-186925.055654     8252915.426580
-186929.919598     8252924.266965
-186930.444279     8252930.536016
-186935.217502     8252945.009271
-186941.131189     8252966.387764
-186954.552693     8252987.881823
-186966.692594     8253011.233987
-186979.438200     8253035.848129
-186993.485196     8253057.351815
-187006.250589     8253080.713607
-187029.097096     8253099.848198
-187052.559016     8253119.618207
-187072.257127     8253139.956989
-187093.902673     8253155.942607
-187111.158549     8253172.486601
-187135.155610     8253197.899876
-187168.476480     8253227.213101
-187190.556355     8253255.101409
-187216.470602     8253278.039652
-187240.467281     8253303.452921
-187268.288623     8253324.542686
-187279.974407     8253337.244510
-187281.225774     8253337.263772
-187281.851266     8253337.273400
-187282.476758     8253337.283028
-187282.466680     8253337.908817
-187282.456601     8253338.534606
-187283.697889     8253339.179658
-187287.996826     8253344.254915
-187294.808205     8253348.742136
-187300.287945     8253358.217945
-187311.428497     8253365.903056
-187325.606554     8253379.269187
-187338.008564     8253386.347005
-187341.116619     8253387.647500
-187351.611534     8253396.573797
-187360.219499     8253406.097757
-187360.794586     8253409.237097
-187371.894811     8253419.426129
-187384.185930     8253433.389159
-187396.608097     8253439.215399
-187401.593406     8253440.544025
-187405.286638     8253444.357305
-187418.950093     8253450.828596
-187420.201460     8253450.847858
-187430.416348     8253466.975569
-187435.905179     8253476.055810
-END
-LINE3D
-HEIGHT 1170.000000
-187480.683822     8253143.025094
-187485.848670     8253143.818702
-187492.730995     8253143.924639
-187501.489796     8253144.059460
-187515.254064     8253144.271328
-187530.895189     8253144.512085
-187540.895660     8253145.291963
-187550.189603     8253151.070051
-187559.554121     8253152.466085
-187567.061556     8253152.581644
-187572.067021     8253152.658691
-187576.456310     8253152.100309
-187581.744042     8253134.651431
-187581.834775     8253129.017798
-187572.692051     8253113.850576
-187563.569484     8253097.431775
-187558.089744     8253087.955966
-187545.052163     8253081.494309
-187528.865818     8253076.236074
-187515.808067     8253071.026760
-187505.999142     8253058.353826
-187496.150283     8253048.184055
-187491.326653     8253036.840512
-187487.017637     8253032.391044
-187487.088201     8253028.009754
-187485.836835     8253027.990492
-187489.156605     8253016.145587
-187496.109493     8253011.870234
-187500.569357     8253006.929798
-187506.825808     8253007.026101
-187515.595070     8253006.535138
-187532.416999     8253011.176448
-187541.085067     8253016.944902
-187558.411888     8253029.107612
-187571.933822     8253044.342241
-187578.755661     8253048.203679
-187585.567041     8253052.690900
-187599.169999     8253062.918456
-187608.332893     8253076.833335
-187612.651999     8253080.656249
-187623.167060     8253088.331731
-187636.204641     8253094.793388
-187640.533826     8253097.990513
-187645.639722     8253091.808132
-187657.849737     8253071.960499
-187663.802906     8253052.017321
-187671.643408     8253031.476485
-187678.726975     8253019.063571
-187690.886571     8253002.346414
-187701.390720     8252971.829172
-187711.259298     8252941.928092
-187717.222929     8252921.359131
-187718.120621     8252904.467859
-187721.531112     8252886.990086
-187721.863797     8252866.333685
-187722.135984     8252849.433549
-187723.003810     8252834.420416
-187723.528028     8252801.871723
-187710.842907     8252773.502081
-187698.924800     8252736.378728
-187681.386195     8252698.542916
-187668.590184     8252677.058486
-187646.359473     8252658.559318
-187631.565620     8252644.557764
-187616.822569     8252627.425740
-187598.466544     8252601.473351
-187586.881572     8252582.512104
-187569.555133     8252570.349401
-187554.731032     8252558.225979
-187538.655959     8252546.082537
-187522.500232     8252538.946939
-187508.826698     8252533.101438
-187495.768578     8252527.891354
-187474.002050     8252519.417502
-187454.687861     8252514.111121
-187441.549468     8252513.908887
-187415.887714     8252514.139830
-187397.057878     8252517.606421
-187378.147388     8252526.080856
-187361.669067     8252538.975105
-187335.735112     8252556.106948
-187317.309357     8252573.354362
-187303.172090     8252596.302052
-187283.505059     8252612.903651
-187265.714493     8252629.534897
-187251.577608     8252652.482593
-187246.744362     8252680.582582
-187246.260459     8252710.628117
-187246.432297     8252738.805147
-187247.391306     8252756.976887
-187252.154451     8252772.075932
-187259.379989     8252789.718186
-187263.608363     8252799.174733
-187277.080273     8252817.539080
-187287.473981     8252832.725558
-187301.026546     8252846.082061
-187312.116704     8252856.896119
-187322.006272     8252864.561973
-187332.551593     8252870.358558
-187343.732473     8252875.539747
-187355.478360     8252884.486064
-187366.043839     8252889.031070
-187377.123906     8252900.471681
-187386.357364     8252910.005270
-187398.154039     8252915.821882
-187403.098638     8252919.654424
-187403.714434     8252920.289847
-187419.143857     8252933.675240
-187424.653451     8252941.273675
-187425.279325     8252941.283309
-187425.904817     8252941.292937
-187429.567814     8252946.983585
-187430.728447     8252952.636481
-187431.959644     8252953.908085
-187431.949565     8252954.533875
-187436.793352     8252964.625840
-187436.783273     8252965.251629
-187439.730032     8252976.567047
-187440.870508     8252983.471521
-187441.425436     8252987.862439
-187441.980735     8252992.254128
-187441.890001     8252997.887761
-187441.869844     8252999.139340
-187441.748874     8253006.650341
-187441.658141     8253012.283975
-187441.476674     8253023.551241
-187441.254893     8253037.321665
-187440.861723     8253061.733567
-187443.818573     8253072.422431
-187447.986450     8253085.635244
-187448.531300     8253090.651951
-187452.204363     8253095.717575
-187452.679019     8253105.116343
-187456.190785     8253120.196889
-187456.736017     8253125.213603
-187459.803757     8253129.017255
-187462.881576     8253132.195118
-187465.999710     8253132.869823
-187470.944310     8253136.702366
-187476.504322     8253141.170325
-187477.130196     8253141.179959
-187480.683822     8253143.025094
-END
-LINE3D
-HEIGHT 1130.000000
-183557.000000     8254093.718503
-183563.352666     8254075.179740
-183570.758839     8254042.736214
-183580.798792     8254002.194421
-183589.012293     8253958.494027
-183590.999580     8253912.819962
-183595.055284     8253855.280966
-183602.037576     8253810.309731
-183609.433657     8253778.492759
-183613.671469     8253748.505007
-183614.104953     8253721.589948
-183613.701064     8253707.809129
-183613.711142     8253707.183339
-183613.993421     8253689.656650
-183608.735654     8253666.410419
-183603.548462     8253638.782134
-183603.770243     8253625.011710
-183583.849888     8253579.625609
-183564.897775     8253512.967710
-183557.000000     8253483.900430
-END
-LINE3D
-HEIGHT 1090.000000
-183557.000000     8256156.845503
-183566.775917     8256155.128611
-183601.882665     8256151.285091
-183628.966767     8256140.433455
-183659.098465     8256134.636286
-183692.328354     8256130.763876
-183735.638951     8256122.665787
-183769.433835     8256122.559269
-183812.764589     8256113.209601
-183869.869701     8256103.445247
-183911.313530     8256094.691714
-183968.438824     8256083.674253
-184016.815001     8256071.896940
-184071.427662     8256061.467512
-184130.601166     8256039.839756
-184163.447312     8256020.935712
-184195.637525     8256003.900169
-184227.101219     8255993.115947
-184256.577009     8255989.185751
-184279.261553     8255979.518284
-184297.546373     8255971.033453
-184324.035231     8255958.294057
-184352.966159     8255949.347918
-184384.419786     8255939.188720
-184414.026613     8255927.122498
-184451.060626     8255920.178156
-184486.217755     8255913.206453
-184513.211327     8255907.987689
-184539.599207     8255901.506184
-184574.100405     8255896.402982
-184613.596812     8255892.001850
-184651.831570     8255888.208006
-184683.184385     8255884.308231
-184730.168260     8255881.274240
-184768.332645     8255881.861690
-184807.122714     8255882.458770
-184835.892333     8255883.528319
-184861.523469     8255885.174738
-184885.287837     8255886.165714
-184911.565005     8255886.570189
-184949.053301     8255890.277719
-184984.705054     8255891.453201
-185009.650201     8255896.846258
-185038.328907     8255903.548673
-185068.249296     8255910.895380
-185099.430736     8255917.636319
-185125.636934     8255922.423606
-185144.971687     8255926.476886
-185166.092171     8255936.193447
-185202.097610     8255954.278699
-185231.290906     8255967.876718
-185254.218067     8255982.003465
-185277.145228     8255996.130212
-185302.544491     8256012.173609
-185335.482202     8256026.454445
-185363.434605     8256039.406654
-185380.720717     8256054.073280
-185394.858446     8256069.943333
-185411.498908     8256085.851909
-185438.230193     8256096.906724
-185471.843802     8256108.067477
-185503.580146     8256119.200861
-185532.178223     8256130.909592
-185562.693831     8256140.145588
-185593.804707     8256151.267817
-185626.842848     8256159.289224
-185651.717432     8256169.063571
-185679.770646     8256175.756357
-185719.751584     8256180.128965
-185760.953283     8256186.397432
-185794.677770     8256190.673736
-185822.741076     8256196.739970
-185860.138626     8256206.081897
-185891.905243     8256215.335621
-185924.247329     8256227.728691
-185962.280463     8256236.453693
-185997.881809     8256240.758886
-186022.272052     8256241.759496
-186052.857841     8256246.614197
-186112.142901     8256256.918210
-186147.804745     8256257.467140
-186179.712871     8256257.958289
-186224.133516     8256258.642039
-186268.463439     8256264.958658
-186312.198095     8256269.389045
-186355.922684     8256274.444457
-186377.820260     8256274.781518
-186399.102435     8256274.482397
-186416.630486     8256274.127020
-186438.023564     8256266.941923
-186467.509587     8256262.388233
-186497.550564     8256262.223933
-186526.976114     8256261.424980
-186558.278524     8256260.654917
-186595.191352     8256261.223102
-186629.601829     8256261.752769
-186659.007222     8256262.205395
-186700.229078     8256267.222284
-186746.516897     8256268.559955
-186784.035417     8256270.390881
-186832.099282     8256278.016864
-186878.931914     8256284.373535
-186917.651420     8256289.351906
-186956.370543     8256294.330271
-186998.288837     8256294.975503
-187042.699772     8256296.285812
-187091.479851     8256298.288554
-187137.777355     8256299.001194
-187171.501867     8256303.275970
-187216.487889     8256307.725619
-187260.192320     8256314.032610
-187289.506968     8256320.119633
-187325.713649     8256325.686034
-187366.915347     8256331.954501
-187394.423724     8256333.629816
-187426.896845     8256337.886859
-187448.784355     8256338.848945
-187480.066607     8256339.330461
-187508.846126     8256339.773453
-187545.759336     8256340.341644
-187583.863033     8256344.685355
-187616.951580     8256349.577051
-187647.487370     8256357.559940
-187673.633477     8256366.101970
-187703.593799     8256370.945514
-187731.737735     8256372.005431
-187762.999829     8256373.738526
-187790.467485     8256377.918521
-187827.320222     8256382.241449
-187853.577208     8256383.899030
-187874.798504     8256387.356169
-187896.686014     8256388.318255
-187926.041001     8256391.900592
-187949.795278     8256393.518122
-187983.570172     8256394.664715
-188003.570732     8256396.224465
-188025.448151     8256397.813105
-188041.028779     8256401.810127
-188057.820460     8256408.329570
-188074.652073     8256412.345848
-188090.858219     8256416.350971
-188110.183262     8256421.030810
-188131.313431     8256430.122340
-188152.525043     8256434.204510
-188156.228354     8256437.392001
-188164.987537     8256437.526828
-188187.510606     8256437.873516
-188226.361529     8256434.715866
-188263.294896     8256434.032478
-188284.011312     8256429.967453
-188304.667970     8256429.660233
-188333.437423     8256430.728250
-188365.769035     8256443.747867
-188386.889901     8256453.464434
-188409.807353     8256468.217741
-188452.128975     8256482.643019
-188494.400931     8256500.199549
-188517.378117     8256511.196579
-188518.629865     8256511.215847
-188529.880951     8256512.014211
-188555.360844     8256523.051292
-188599.651217     8256531.871081
-188619.611055     8256535.935511
-188633.233814     8256544.909954
-188654.334498     8256555.879628
-188669.289659     8256559.865495
-188677.372944     8256563.120405
-188693.518592     8256570.881792
-188709.775119     8256571.758732
-188715.385920     8256573.096986
-188735.971251     8256577.171044
-188759.271794     8256568.138238
-188775.679563     8256559.624515
-188787.082607     8256551.035285
-188803.722224     8256528.126113
-188812.582220     8256522.001517
-188822.057641     8256516.511574
-188828.394721     8256511.601562
-188838.465386     8256507.999379
-188852.239362     8256507.584688
-188863.571842     8256503.376748
-188879.919115     8256498.619290
-188888.688364     8256498.129091
-188897.336669     8256505.148366
-188907.800929     8256515.954318
-188920.727632     8256529.300423
-188936.086479     8256547.067870
-188949.679752     8256557.920457
-188957.701776     8256564.931620
-188970.709109     8256573.271410
-188978.156835     8256577.141717
-188990.538675     8256585.471879
-189006.078989     8256591.972059
-189015.453574     8256592.743067
-189019.832783     8256592.810475
-189028.117692     8256583.546540
-189039.560311     8256572.452612
-189044.010848     8256568.138741
-189044.636341     8256568.148369
-189045.513863     8256552.509440
-189046.502289     8256529.984535
-189046.754319     8256514.335978
-189030.265456     8256489.038273
-189014.906609     8256471.270826
-188983.432362     8256443.863859
-188950.090940     8256415.802971
-188924.782398     8256394.126705
-188905.285540     8256361.268307
-188890.694076     8256334.747919
-188884.123872     8256315.238683
-188868.149624     8256296.835054
-188850.944524     8256277.162119
-188832.517948     8256255.590256
-188818.450401     8256235.338907
-188818.460492     8256234.712353
-188818.470558     8256234.087328
-188818.480649     8256233.460774
-188818.490716     8256232.835749
-188813.575995     8256227.124304
-188805.029266     8256213.845619
-188792.101825     8256200.497974
-188781.647631     8256189.066996
-188761.990204     8256166.225826
-188748.366707     8256157.249844
-188748.386864     8256155.998265
-188725.510491     8256138.741812
-188703.945600     8256117.748351
-188682.511769     8256088.617334
-188668.393815     8256071.495696
-188654.458091     8256043.106804
-188636.051649     8256020.284890
-188627.544496     8256004.501506
-188617.917419     8255980.561312
-188593.355362     8255951.382143
-188574.514222     8255916.656769
-188555.512535     8255891.947095
-188542.757233     8255867.958748
-188531.162170     8255849.624055
-188521.424214     8255832.568309
-188506.751332     8255811.055753
-188492.684548     8255790.804416
-188471.795554     8255766.690871
-188459.595181     8255747.093443
-188450.169703     8255710.635931
-188445.062987     8255677.999035
-188437.978194     8255651.594195
-188437.705544     8255629.676587
-188433.174654     8255600.180571
-188429.399553     8255562.556615
-188426.049083     8255537.461145
-188426.422083     8255514.301586
-188426.744676     8255494.271739
-188436.613255     8255464.370659
-188445.230848     8255434.450324
-188459.337485     8255413.380760
-188478.530266     8255387.378871
-188494.060026     8255355.687862
-188505.643772     8255335.831354
-188508.973622     8255323.360660
-188512.788600     8255319.662186
-188517.884023     8255314.106353
-188528.691847     8255303.627834
-188540.063878     8255296.916724
-188550.154700     8255292.062963
-188565.230831     8255288.537828
-188595.262098     8255289.000088
-188622.164376     8255289.414184
-188642.800877     8255290.358543
-188654.042636     8255291.783472
-188668.381607     8255295.134674
-188680.894508     8255295.327280
-188696.535634     8255295.568038
-188710.996339     8255291.408249
-188726.102693     8255286.006510
-188752.540788     8255276.395291
-188773.318441     8255268.575541
-188792.208761     8255261.353449
-188804.741820     8255260.294476
-188822.340077     8255255.556274
-188853.612238     8255256.664343
-188882.967606     8255260.246686
-188906.126258     8255259.976450
-188926.772850     8255260.294255
-188959.840858     8255266.437523
-188981.728343     8255267.401138
-189001.749442     8255267.709315
-189013.010595     8255267.882653
-189032.425596     8255266.929612
-189052.537441     8255261.603392
-189080.156696     8255256.394259
-189114.667985     8255250.664503
-189154.849783     8255242.518253
-189182.448906     8255238.559171
-189216.849292     8255239.715392
-189251.259769     8255240.245059
-189273.934055     8255231.202614
-189300.948000     8255224.730746
-189326.145177     8255214.475245
-189360.111629     8255203.728018
-189383.461813     8255191.565489
-189401.080992     8255185.575720
-189419.305481     8255180.848686
-189435.854378     8255163.572383
-189462.958280     8255151.467634
-189493.897318     8255134.412832
-189525.552570     8255111.734789
-189545.926511     8255090.134987
-189567.470019     8255073.562272
-189589.014315     8255056.988042
-189610.659399     8255034.155916
-189634.655997     8255020.751448
-189642.344899     8255009.599741
-189646.885393     8254999.652989
-189651.366178     8254993.460986
-189651.991671     8254993.470614
-189652.617163     8254993.480242
-189653.252746     8254992.863316
-189653.899160     8254991.621377
-189654.524652     8254991.631005
-189654.534743     8254991.004451
-189655.160235     8254991.014079
-189655.220708     8254987.259342
-189661.608219     8254979.218090
-189667.380329     8254970.540657
-189671.940980     8254959.342326
-189677.642526     8254955.046183
-189680.851382     8254950.088019
-189684.675687     8254945.762980
-189688.560441     8254937.684732
-189694.927794     8254930.895059
-189700.730128     8254920.341021
-189708.450041     8254907.311193
-189716.764435     8254896.169114
-189725.785715     8254880.030358
-189741.013064     8254867.116089
-189758.036235     8254859.238548
-189761.184618     8254858.035120
-189773.172838     8254851.958676
-189797.673959     8254846.074838
-189832.790583     8254841.606289
-189850.994914     8254838.130834
-189851.005005     8254837.504280
-189856.009707     8254837.581316
-189864.789048     8254836.464564
-189887.443177     8254828.673698
-189901.288481     8254823.877728
-189925.769420     8254819.246997
-189967.778077     8254814.257826
-189999.140984     8254809.731497
-190021.129281     8254804.435689
-190049.384120     8254798.609631
-190074.086865     8254780.206947
-190098.163354     8254761.794624
-190131.050196     8254740.387428
-190158.891246     8254721.407106
-190184.713927     8254711.160470
-190201.071266     8254705.777986
-190218.033953     8254701.655946
-190246.258543     8254697.708019
-190268.852951     8254693.672666
-190283.938384     8254689.522494
-190299.670243     8254684.129618
-190318.066132     8254668.760343
-190338.894178     8254657.811645
-190355.312015     8254648.672897
-190369.307772     8254634.487781
-190388.298905     8254621.006267
-190399.752367     8254609.286561
-190404.242467     8254602.468756
-190409.994407     8254595.043666
-190413.899343     8254585.712311
-190418.995542     8254580.155725
-190427.916022     8254570.275628
-190441.114899     8254566.722362
-190458.633266     8254566.992015
-190482.982405     8254570.497299
-190504.234332     8254572.076311
-190526.696903     8254576.179265
-190539.836060     8254576.381511
-190551.097212     8254576.554850
-190569.311647     8254572.452077
-190591.965764     8254564.661975
-190604.629883     8254555.465447
-190614.196025     8254544.342635
-190627.515884     8254533.277603
-190650.967645     8254514.855663
-190670.715331     8254493.246221
-190689.020486     8254483.510579
-190710.373212     8254478.830932
-190736.861714     8254466.090002
-190775.802618     8254457.297942
-190807.791768     8254452.782018
-190826.045754     8254446.176076
-190842.333306     8254445.174130
-190868.045084     8254441.813470
-190886.209101     8254440.841172
-190899.993156     8254439.800692
-190919.408157     8254438.847650
-190941.406545     8254432.925288
-190957.148483     8254426.906623
-190992.456652     8254410.545019
-191024.768408     8254385.998483
-191052.063843     8254362.001442
-191076.131018     8254344.214920
-191097.645053     8254329.519586
-191117.362490     8254309.788276
-191138.341003     8254289.449669
-191162.559395     8254262.274013
-191177.978277     8254237.467452
-191183.891501     8254220.028202
-191193.518128     8254205.149889
-191200.016530     8254190.223425
-191200.894052     8254174.584496
-191201.196488     8254155.806228
-191195.383613     8254128.168312
-191184.535024     8254102.331482
-191170.013372     8254071.429028
-191144.906466     8254037.233152
-191118.578811     8254001.140651
-191109.041691     8253971.567576
-191104.924603     8253955.225058
-191093.955032     8253936.899993
-191086.830687     8253912.998322
-191081.683632     8253882.866112
-191076.476080     8253856.490167
-191068.806885     8253827.571789
-191057.958296     8253801.734958
-191050.218538     8253777.197870
-191042.588908     8253745.775557
-191029.823526     8253722.413001
-191013.354058     8253695.863705
-190992.445659     8253673.002515
-190977.308593     8253641.464644
-190960.203553     8253615.531510
-190948.033416     8253594.056714
-190936.549256     8253568.836044
-190920.080563     8253542.285997
-190905.165279     8253496.977701
-190883.771763     8253465.343527
-190872.973580     8253436.376985
-190863.951825     8253413.698761
-190857.634440     8253378.539451
-190853.829854     8253342.793640
-190854.475053     8253302.733182
-190853.989474     8253255.142454
-190853.868042     8253223.835713
-190854.190636     8253203.805866
-190854.412429     8253190.034677
-190854.644290     8253175.638464
-190854.856005     8253162.493065
-190856.520316     8253136.848840
-190857.044534     8253104.300148
-190857.457861     8253078.636668
-190854.268701     8253043.525510
-190849.909186     8253003.388780
-190849.373213     8252958.927000
-190844.377363     8252919.406420
-190840.592947     8252882.408266
-190840.521921     8252847.971813
-190837.171452     8252822.876342
-190836.887959     8252801.584513
-190837.442425     8252767.157688
-190849.349541     8252727.270580
-190857.290460     8252700.471080
-190861.993040     8252680.507888
-190862.850392     8252666.121302
-190864.363486     8252649.866212
-190864.917952     8252615.439387
-190864.816690     8252582.880302
-190863.837893     8252565.960911
-190863.373697     8252555.936359
-190863.666055     8252537.783880
-190868.579573     8252504.676042
-190880.254816     8252479.185912
-190889.325751     8252459.916669
-190895.723340     8252451.249628
-190910.335263     8252437.700705
-190928.680746     8252425.461141
-190939.598685     8252408.098163
-190943.019267     8252389.993836
-190946.147493     8252390.041987
-190945.723624     8252377.513514
-190944.563373     8252371.860625
-190944.644015     8252366.853545
-190944.744827     8252360.594122
-190943.644297     8252351.185721
-190943.180102     8252341.161169
-190943.391817     8252328.015770
-190947.347158     8252315.554704
-190953.149492     8252305.000666
-190957.064506     8252295.043522
-190962.160705     8252289.486936
-190972.251528     8252284.633175
-190981.010711     8252284.768002
-190992.888028     8252285.577534
-191008.448512     8252290.825371
-191014.058537     8252292.164378
-191018.428431     8252292.857586
-191022.787484     8252294.176573
-191038.983526     8252298.809013
-191042.061345     8252301.986876
-191043.313093     8252302.006144
-191048.297638     8252303.334758
-191051.425863     8252303.382910
-191051.415784     8252304.008699
-191051.405706     8252304.634488
-191052.031962     8252304.644128
-191057.036664     8252304.721164
-191063.908515     8252305.453648
-191067.026662     8252306.127589
-191070.781143     8252306.185381
-191072.032128     8252306.204636
-191072.647541     8252306.840054
-191080.155740     8252306.955625
-191085.160442     8252307.032660
-191089.631149     8252301.466446
-191094.020437     8252300.908064
-191097.794312     8252299.714265
-191102.295267     8252292.269918
-191107.471345     8252281.706241
-191120.185870     8252269.380002
-191121.518273     8252264.391426
-191122.769257     8252264.410681
-191124.090805     8252260.048647
-191128.571591     8252253.856644
-191133.081861     8252245.786496
-191140.225913     8252229.618081
-191143.515435     8252219.651309
-191143.575919     8252215.895808
-191143.586011     8252215.269255
-191143.696901     8252208.384042
-191142.526559     8252203.357707
-191138.157440     8252202.663746
-191137.611826     8252197.647026
-191136.360842     8252197.627770
-191129.539384     8252193.766338
-191128.913892     8252193.756710
-191127.662143     8252193.737443
-191123.272855     8252194.295825
-191119.498980     8252195.489624
-191114.433029     8252199.168078
-191109.993323     8252202.856935
-191104.251474     8252209.655472
-191099.760609     8252216.473265
-191095.926237     8252221.423329
-191095.805268     8252228.934331
-191094.403065     8252238.304209
-191090.538457     8252245.131642
-191089.861795     8252248.251713
-191084.161025     8252252.547104
-191080.315823     8252258.122182
-191075.855958     8252263.062619
-191071.426343     8252266.124922
-191065.119486     8252269.158331
-191061.365005     8252269.100539
-191055.815465     8252264.006032
-191047.792665     8252256.995621
-191032.282587     8252248.618072
-191022.908003     8252247.847064
-191017.287124     8252247.134599
-191004.148731     8252246.932365
-190999.769521     8252246.864958
-190994.743885     8252248.040253
-190984.723639     8252248.511960
-190979.032196     8252252.180786
-190970.252855     8252253.297538
-190968.941373     8252257.034547
-190963.885502     8252260.087211
-190962.634517     8252260.067955
-190953.189357     8252263.679001
-190945.620673     8252267.318931
-190939.919915     8252271.613558
-190934.904359     8252272.163065
-190926.700104     8252276.419156
-190916.639530     8252279.394785
-190900.937920     8252282.909528
-190896.498225     8252286.597621
-190889.555785     8252290.247955
-190884.499914     8252293.300619
-190879.494448     8252293.223572
-190875.095081     8252294.407743
-190862.562022     8252295.466716
-190858.788135     8252296.661279
-190853.772591     8252297.210022
-190846.890648     8252297.104090
-190842.511438     8252297.036683
-190838.202028     8252292.587973
-190838.212119     8252291.961420
-190838.403652     8252280.069128
-190838.575040     8252269.427651
-190841.814156     8252262.590590
-190846.325190     8252254.520454
-190856.405922     8252250.293247
-190868.394142     8252244.216802
-190885.467719     8252233.209550
-190906.205032     8252227.894486
-190920.675064     8252223.108132
-190934.449792     8252222.694216
-190942.643204     8252219.063903
-190952.048049     8252217.956014
-190957.114000     8252214.277561
-190960.928202     8252210.579839
-190961.553694     8252210.589467
-190964.681919     8252210.637619
-190965.307412     8252210.647247
-190965.317490     8252210.021457
-190965.327581     8252209.394904
-190965.337660     8252208.769114
-190965.357818     8252207.517536
-190966.629736     8252206.284460
-190970.403611     8252205.090661
-190974.217813     8252201.392940
-190979.868941     8252200.227272
-190979.879019     8252199.601482
-190981.140083     8252198.994949
-190981.150162     8252198.369159
-190981.160240     8252197.743370
-190981.230816     8252193.361316
-190981.240895     8252192.735526
-190981.937714     8252188.363876
-190981.957884     8252187.111533
-190982.018369     8252183.356032
-190982.078854     8252179.600531
-190982.088932     8252178.974741
-190982.159508     8252174.592687
-190982.240150     8252169.585607
-190982.310726     8252165.203553
-190982.401460     8252159.569920
-190982.411538     8252158.944130
-190981.230354     8252154.543572
-190980.049945     8252150.142262
-190979.525264     8252143.873211
-190975.871595     8252137.555997
-190972.299332     8252126.231715
-190972.379987     8252121.223872
-190968.131825     8252113.019673
-190963.933318     8252101.684987
-190959.624672     8252097.236290
-190953.519440     8252087.750852
-190949.241042     8252081.424022
-190944.316231     8252076.339131
-190936.192619     8252075.588143
-190928.140346     8252070.455112
-190924.396707     8252069.771543
-190920.702711     8252065.958251
-190915.082595     8252065.245798
-190906.393988     8252060.728917
-190900.228271     8252054.998981
-190896.585444     8252048.055989
-190892.336519     8252039.851779
-190892.356689     8252038.599436
-190895.565556     8252033.640508
-190900.036263     8252028.074293
-190905.807596     8252019.397612
-190909.662890     8252013.195981
-190918.958315     8252001.104338
-END
-LINE3D
-HEIGHT 1090.000000
-190918.958315     8252001.104338
-190941.449202     8251982.380383
-190942.135179     8251978.634510
-190943.406333     8251977.401423
-190944.031825     8251977.411051
-190945.283574     8251977.430319
-190945.303731     8251976.178740
-190944.738724     8251972.413611
-190944.112468     8251972.403971
-190942.871562     8251971.758926
-190934.798368     8251967.877462
-190924.223193     8251963.958251
-190918.662798     8251959.490285
-190914.293667     8251958.797088
-190913.748829     8251953.779617
-190908.188435     8251949.311651
-190903.434999     8251933.586047
-190899.257413     8251920.999794
-190899.327989     8251916.617740
-190895.644835     8251912.178670
-190891.557219     8251893.958772
-190881.950299     8251868.766999
-190877.802962     8251854.302613
-190873.029357     8251839.829352
-190868.215436     8251827.859249
-190867.095512     8251819.702438
-190862.261422     8251808.984678
-190858.023352     8251800.153926
-190858.093915     8251795.772636
-190853.926408     8251782.560593
-190854.087717     8251772.544906
-190853.047672     8251759.381003
-190851.978142     8251748.095245
-190850.817127     8251742.442344
-190849.717360     8251733.033954
-190845.479290     8251724.203202
-190844.873191     8251722.941983
-190844.267869     8251721.680012
-190839.908816     8251720.361026
-190839.918895     8251719.735236
-190839.939065     8251718.482893
-190838.697395     8251717.837836
-190834.963835     8251716.528478
-190830.645123     8251712.704805
-190826.901484     8251712.021236
-190826.275228     8251712.011597
-190825.659814     8251711.376179
-190825.034322     8251711.366551
-190824.408830     8251711.356923
-190824.418909     8251710.731134
-190824.439078     8251709.478791
-190823.823665     8251708.843373
-190822.571917     8251708.824106
-190821.320932     8251708.804850
-190815.689974     8251708.718175
-190810.684508     8251708.641127
-190802.551581     8251708.515940
-190796.920623     8251708.429265
-190792.541413     8251708.361858
-190786.910455     8251708.275182
-190780.714489     8251704.423379
-190779.533305     8251700.022821
-190775.870320     8251694.331408
-190771.561686     8251689.881946
-190771.642329     8251684.874866
-190771.087412     8251680.483184
-190770.461156     8251680.473544
-190770.592204     8251672.336753
-190770.652689     8251668.581252
-190770.047367     8251667.319281
-190770.138100     8251661.685648
-190770.248991     8251654.800436
-190770.400209     8251645.411302
-190775.556893     8251636.099215
-190780.622080     8251632.420750
-190786.384098     8251624.369870
-190790.147894     8251623.801860
-190796.565642     8251613.883239
-190801.006100     8251610.195158
-190801.016179     8251609.569368
-190801.207724     8251597.676312
-190801.399269     8251585.783256
-190801.469833     8251581.401966
-190801.479924     8251580.775413
-190801.500081     8251579.523834
-190801.590815     8251573.890200
-190801.671457     8251568.883121
-190801.883172     8251555.737722
-190796.423589     8251545.010334
-190795.273417     8251538.731655
-190794.647161     8251538.722015
-190793.406255     8251538.076970
-190792.175440     8251536.805371
-190791.569342     8251535.544152
-190791.660075     8251529.910519
-190790.580466     8251519.250550
-190790.721605     8251510.487206
-190790.822417     8251504.227783
-190795.262112     8251500.539690
-190799.016593     8251500.597481
-190808.401269     8251500.741936
-190824.496511     8251511.633034
-190833.820702     8251515.532990
-190837.554250     8251516.843112
-190842.559716     8251516.920160
-190853.205454     8251516.458081
-190860.733059     8251515.321297
-190871.379562     8251514.859230
-190882.539902     8251521.291991
-190887.363901     8251532.636305
-190887.011059     8251554.544284
-190886.264597     8251562.045658
-190876.083054     8251572.532288
-190871.592177     8251579.350845
-190871.360317     8251593.747059
-190870.957069     8251618.784750
-190871.471670     8251625.679590
-190874.933794     8251643.889860
-190879.746951     8251655.859951
-190890.776994     8251670.430280
-190898.143302     8251679.308419
-190903.723854     8251682.524806
-190911.867624     8251682.024215
-190925.066502     8251678.470948
-190938.154489     8251681.802894
-190949.870522     8251692.626585
-190951.121506     8251692.645841
-190954.875224     8251692.703621
-190959.265276     8251692.145251
-190959.325761     8251688.389750
-190959.951253     8251688.399378
-190963.079478     8251688.447529
-190966.338764     8251680.358126
-190970.808695     8251674.792664
-190970.818786     8251674.166110
-190970.838943     8251672.914531
-190971.485357     8251671.672592
-190972.857323     8251664.180083
-190973.573549     8251658.556077
-190974.209120     8251657.939916
-190974.219199     8251657.314126
-190974.229277     8251656.688337
-190974.299853     8251652.306282
-190975.006751     8251647.308842
-190975.319266     8251627.904785
-190975.379763     8251624.148520
-190975.389842     8251623.522731
-190975.480575     8251617.889097
-190975.581387     8251611.629675
-190975.692278     8251604.744462
-190975.833417     8251595.981118
-190975.964466     8251587.844327
-190975.408786     8251583.452633
-190974.803451     8251582.191426
-190974.248522     8251577.800508
-190969.404365     8251567.707773
-190968.950249     8251557.057432
-190964.581118     8251556.364235
-190964.651693     8251551.982180
-190960.998788     8251545.664978
-190960.453174     8251540.648259
-190956.770032     8251536.208425
-190956.225182     8251531.191717
-190956.235261     8251530.565928
-190955.085089     8251524.287249
-190954.529408     8251519.895555
-190952.188736     8251509.842120
-190952.198815     8251509.216330
-190951.683450     8251502.321478
-190949.897706     8251496.658961
-190945.648793     8251488.453987
-190941.481286     8251475.241944
-190940.946527     8251469.598683
-190936.657287     8251463.897631
-190935.486945     8251458.871295
-190934.861452     8251458.861667
-190934.235960     8251458.852039
-190928.070243     8251453.122103
-190927.443987     8251453.112463
-190926.818495     8251453.102835
-190922.439285     8251453.035428
-190914.931086     8251452.919857
-190903.044442     8251452.736890
-190899.279882     8251453.304888
-190898.018818     8251453.911422
-190893.629518     8251454.470568
-190887.352910     8251455.625844
-190881.651388     8251459.920459
-190876.645922     8251459.843412
-190875.394938     8251459.824156
-190874.143189     8251459.804888
-190869.743810     8251460.989824
-190864.718187     8251462.164355
-190864.082616     8251462.780517
-190863.436954     8251464.023232
-190862.811461     8251464.013604
-190862.185969     8251464.003976
-190860.308728     8251463.975080
-190859.057744     8251463.955824
-190857.805995     8251463.936557
-190857.180503     8251463.926929
-190855.929519     8251463.907673
-190855.303263     8251463.898033
-190854.677770     8251463.888405
-190853.426786     8251463.869149
-190852.175037     8251463.849881
-190848.441490     8251462.539759
-190844.142922     8251457.465272
-190839.228190     8251451.754591
-190838.784164     8251440.477697
-190838.854728     8251436.096406
-190839.490299     8251435.480245
-190840.125870     8251434.864084
-190840.762217     8251434.247170
-190841.397788     8251433.631008
-190842.658851     8251433.024475
-190843.920678     8251432.417953
-190847.058982     8251431.840315
-190849.591200     8251430.000694
-190852.779910     8251426.293345
-190853.406166     8251426.302985
-190858.410868     8251426.380020
-190863.416333     8251426.457068
-190864.667318     8251426.476323
-190867.795543     8251426.524475
-190871.549261     8251426.582255
-190875.303742     8251426.640046
-190875.929234     8251426.649674
-190879.057459     8251426.697825
-190882.801098     8251427.381394
-190883.426590     8251427.391022
-END
-LINE3D
-HEIGHT 1080.000000
-183557.000000     8256388.595916
-183588.122079     8256383.982753
-183622.037933     8256376.365234
-183646.518706     8256371.732972
-183679.213633     8256362.218062
-183719.436319     8256351.568663
-183749.033270     8256340.127469
-183777.994256     8256329.303194
-183813.877881     8256316.081699
-183863.364273     8256313.087756
-183890.902707     8256312.884936
-183912.790192     8256313.848551
-183947.816286     8256315.012874
-183980.955430     8256316.774861
-184009.664361     8256321.600672
-184030.300695     8256322.543499
-184057.829039     8256322.967232
-184086.608748     8256323.410227
-184119.838422     8256319.539343
-184149.304313     8256316.235704
-184180.586564     8256316.717219
-184214.441922     8256312.855965
-184248.852399     8256313.385633
-184280.760334     8256313.876779
-184322.113417     8256310.757644
-184364.041610     8256310.776319
-184401.105847     8256301.955373
-184434.335712     8256298.084491
-184452.560035     8256293.355926
-184485.295277     8256281.337858
-184514.226014     8256272.391716
-184543.106536     8256266.575288
-184571.896337     8256266.391730
-184603.269310     8256261.240376
-184635.873491     8256257.359863
-184664.733665     8256252.795012
-184697.993778     8256247.045997
-184743.171167     8256239.601823
-184772.041598     8256234.411949
-184794.655603     8256229.124243
-184814.767041     8256223.799545
-184843.627215     8256219.234694
-184866.856812     8256214.583173
-184885.696727     8256210.490792
-184900.086486     8256210.712288
-184917.604471     8256210.981935
-184938.876555     8256211.309368
-184967.030581     8256211.742732
-184988.242168     8256215.826430
-185005.699680     8256219.850815
-185026.245078     8256226.428037
-185053.672800     8256233.111195
-185081.110207     8256239.169323
-185108.537930     8256245.852482
-185132.161147     8256255.607567
-185155.148805     8256265.978049
-185176.269289     8256275.694610
-185193.666661     8256283.476793
-185219.812411     8256292.017289
-185245.928270     8256302.437451
-185272.720027     8256309.737529
-185304.567680     8256313.983415
-185345.174111     8256318.365651
-185390.150066     8256323.440325
-185415.750954     8256326.964877
-185431.331583     8256330.961899
-185452.543194     8256335.044069
-185484.995776     8256340.552684
-185509.275116     8256348.439271
-185526.732603     8256352.465183
-185538.549448     8256357.029452
-185562.212980     8256364.281379
-185585.251044     8256371.522149
-185617.057976     8256378.272716
-185638.219157     8256385.486125
-185658.784712     8256390.811768
-185688.038887     8256400.653528
-185729.886618     8256405.680050
-185761.784295     8256406.796219
-185785.538548     8256408.415277
-185813.622011     8256413.229932
-185853.542477     8256421.357276
-185885.329251     8256429.359421
-185910.960769     8256431.005846
-185935.300200     8256435.137690
-185964.624938     8256440.598159
-185997.723576     8256444.863302
-186020.872519     8256445.219624
-186035.262278     8256445.441120
-186052.215243     8256441.946403
-186078.421848     8256446.732168
-186112.681107     8256456.650969
-186136.253917     8256469.535765
-186154.872050     8256479.213809
-186167.324454     8256483.162680
-186180.392284     8256487.746204
-186205.963305     8256493.148895
-186237.820643     8256496.769750
-186259.647655     8256501.488101
-186278.972317     8256506.167934
-186303.291590     8256511.551357
-186332.626419     8256516.385273
-186363.273088     8256517.483714
-186389.015127     8256512.244157
-186411.538196     8256512.590846
-186441.034310     8256507.410603
-186470.449794     8256507.236675
-186491.186725     8256501.921605
-186503.699625     8256502.114212
-186525.597202     8256502.451273
-186556.879453     8256502.932788
-186592.470733     8256507.863008
-186615.549113     8256512.600621
-186636.820815     8256512.928048
-186657.467406     8256513.245853
-186676.872316     8256512.919365
-186693.209522     8256508.786932
-186711.363448     8256508.441188
-186735.208446     8256504.425849
-186756.551118     8256500.370463
-186775.340627     8256499.407794
-186794.795943     8256495.951594
-186826.138691     8256492.676845
-186861.175043     8256493.216146
-186883.072619     8256493.553207
-186906.221180     8256493.909524
-186934.435703     8256490.586623
-186967.665759     8256486.715744
-187000.824870     8256487.226150
-187020.865745     8256486.282742
-187037.818352     8256482.786491
-187061.653642     8256479.397711
-187094.822843     8256479.281563
-187120.544700     8256475.295113
-187138.698650     8256474.947841
-187161.847593     8256475.304163
-187184.370662     8256475.650852
-187205.652812     8256475.353260
-187232.010253     8256470.749885
-187250.920731     8256462.276214
-187274.079764     8256462.005983
-187294.191203     8256456.681285
-187309.832329     8256456.922043
-187337.370954     8256456.719225
-187367.411931     8256456.554926
-187390.560873     8256456.911248
-187409.259636     8256461.582976
-187424.830199     8256466.205024
-187447.787226     8256478.453633
-187472.036317     8256488.218352
-187496.931058     8256496.741119
-187510.624762     8256501.334278
-187524.943958     8256505.937064
-187541.059358     8256515.576584
-187569.728356     8256522.905558
-187595.884554     8256530.821034
-187625.219002     8256535.654944
-187647.056081     8256539.748270
-187675.815824     8256541.442847
-187708.288945     8256545.699889
-187747.684349     8256547.558177
-187766.403294     8256550.976798
-187786.413920     8256551.911522
-187803.881499     8256555.310881
-187828.836737     8256560.077384
-187847.606088     8256560.366293
-187868.252298     8256560.684093
-187890.210371     8256557.264889
-187903.974638     8256557.476757
-187917.748972     8256557.063599
-187934.651173     8256556.697060
-187952.784941     8256557.602895
-187978.931073     8256566.143396
-187990.747511     8256570.709187
-188009.365644     8256580.387230
-188021.061520     8256592.462500
-188033.403045     8256603.295820
-188051.304940     8256618.598633
-188066.209695     8256625.714211
-188088.631952     8256632.320322
-188114.767586     8256641.488899
-188135.283142     8256649.942731
-188157.796119     8256650.915974
-188184.699161     8256651.330082
-188207.232321     8256651.050217
-188229.815862     8256647.642170
-188244.831496     8256647.873299
-188262.228129     8256655.653943
-188274.680532     8256659.602814
-188288.324212     8256667.325690
-188306.932279     8256677.628758
-188329.173068     8256695.502136
-188355.854329     8256709.686669
-188375.652858     8256723.766787
-188401.556645     8256747.330814
-188439.439324     8256765.444961
-188477.341422     8256782.305990
-188506.544809     8256795.277456
-188530.168408     8256805.032546
-188563.832423     8256813.063587
-188596.920564     8256817.956805
-188619.989258     8256823.319450
-188639.858376     8256833.016749
-188664.773274     8256840.287938
-188685.873983     8256851.256084
-188711.404307     8256859.161926
-188735.108536     8256863.910701
-188760.023459     8256871.180362
-188790.588709     8256877.286635
-188819.934011     8256881.494003
-188853.072582     8256883.255982
-188880.550711     8256886.809429
-188906.838327     8256886.588884
-188932.489621     8256886.983725
-188963.146380     8256887.455612
-188985.669449     8256887.802301
-189004.438800     8256888.091211
-189021.956403     8256888.360852
-189036.972036     8256888.591982
-189065.822119     8256884.653686
-189092.725161     8256885.067792
-189117.811459     8256881.696740
-189139.709035     8256882.033801
-189157.852894     8256882.313082
-189173.504111     8256881.927287
-189188.600375     8256877.152101
-189207.450380     8256872.433166
-189236.239990     8256872.249605
-189254.454412     8256868.147596
-189267.673460     8256863.341986
-189282.779815     8256857.940247
-189305.393629     8256852.652539
-189326.140269     8256846.710909
-189343.123864     8256841.338066
-189354.495919     8256834.625428
-189370.409233     8256817.966050
-189383.053194     8256810.021101
-189392.578997     8256801.402975
-189412.277040     8256782.923256
-189424.981474     8256771.223571
-189432.660309     8256760.696889
-189440.379434     8256747.668577
-189455.808407     8256722.235462
-189469.390363     8256694.896848
-189478.522546     8256671.872116
-189478.925794     8256646.834425
-189471.902262     8256616.673332
-189462.940992     8256590.239607
-189458.147242     8256577.017161
-189449.629997     8256561.860331
-189444.241767     8256546.750136
-189438.247413     8256530.380251
-189424.089144     8256515.761771
-189419.436521     8256493.776745
-189411.616121     8256474.246736
-189396.912990     8256454.612312
-189387.094379     8256442.564410
-189374.773012     8256430.479512
-189365.559712     8256419.694344
-189350.755793     8256406.317815
-189341.512245     8256397.410780
-189331.723883     8256383.484745
-189321.309241     8256369.550598
-189309.624220     8256356.848786
-189294.214967     8256342.211050
-189281.287501     8256328.864934
-189262.679459     8256318.560337
-189244.091574     8256307.004161
-189231.053993     8256300.542504
-189206.976278     8256280.137072
-189177.268368     8256259.644977
-189152.100977     8256229.204602
-189137.932617     8256215.212676
-189124.955533     8256204.994754
-189104.439978     8256196.540922
-189090.131254     8256191.311588
-189075.912489     8256180.449373
-189050.553565     8256161.901290
-189038.857689     8256149.826019
-189029.725044     8256134.033008
-189016.314001     8256111.913166
-189005.990104     8256092.344622
-188995.666946     8256072.777618
-188985.787839     8256064.485980
-188970.963763     8256052.361030
-188953.162656     8256030.800323
-188939.620552     8256016.818036
-188930.407252     8256006.032869
-188919.932137     8255995.853459
-188911.384669     8255982.573233
-188902.211684     8255969.284908
-188885.177984     8255938.969731
-188874.823839     8255921.279320
-188868.133429     8255909.281097
-188853.996082     8255893.411050
-188847.284751     8255882.664394
-188836.194999     8255871.848814
-188820.291289     8255849.065423
-188808.726474     8255828.852598
-188797.343126     8255797.372506
-188789.653023     8255769.704931
-188783.658669     8255753.335045
-188776.483919     8255732.563086
-188772.982231     8255716.856749
-188772.598703     8255701.823590
-188773.728255     8255670.536104
-188790.862305     8255655.774115
-188811.195931     8255636.677470
-188830.752059     8255626.961848
-188842.103957     8255621.500789
-188867.301134     8255611.245289
-188892.468063     8255602.867921
-188905.667716     8255599.313902
-188919.552571     8255592.014763
-188934.104022     8255582.220577
-188953.589586     8255576.886245
-188968.059618     8255572.099892
-188985.668706     8255566.736676
-188999.593900     8255556.932850
-189014.710346     8255550.904558
-189026.698566     8255544.828113
-189035.639216     8255533.695673
-189045.195267     8255523.199415
-189062.349474     8255507.185847
-189070.654565     8255496.668804
-189084.730953     8255477.477373
-189097.354757     8255470.784003
-189111.220218     8255464.736454
-189133.743287     8255465.083143
-189159.414738     8255464.226405
-189176.306848     8255464.486419
-189206.973699     8255464.331753
-189237.004966     8255464.794012
-189273.291920     8255465.352564
-189302.072202     8255465.795567
-189324.655743     8255462.387520
-189347.804304     8255462.743836
-189376.018828     8255459.420936
-189401.145441     8255453.546725
-189421.176607     8255453.229877
-189441.277597     8255448.530199
-189461.388679     8255443.203967
-189489.633426     8255438.004462
-189507.232447     8255433.266271
-189521.087054     8255427.845264
-189534.357271     8255419.909955
-189550.724701     8255413.900918
-189563.953815     8255408.470283
-189577.909258     8255396.788325
-189598.333606     8255372.058812
-189618.575723     8255358.596553
-189630.654664     8255346.887239
-189643.449844     8255329.553156
-189653.076483     8255314.674079
-189670.160126     8255303.041801
-189678.455127     8255293.151312
-189693.621978     8255283.993308
-189705.004100     8255276.655645
-189719.474896     8255271.869303
-189732.239827     8255256.413353
-189749.303313     8255246.032653
-189758.859364     8255235.536395
-189780.968655     8255222.728057
-189792.391856     8255212.887248
-189804.985411     8255208.072011
-189817.003880     8255200.117434
-189834.077457     8255189.110181
-189846.852455     8255173.029205
-189861.444220     8255160.731862
-189875.480293     8255144.043588
-189888.850558     8255129.848844
-189897.781117     8255119.342958
-189916.318158     8255095.209574
-189929.567429     8255088.527360
-189953.009124     8255070.730446
-189965.612745     8255065.290183
-189982.000333     8255058.029567
-190003.978564     8255053.358785
-190025.876140     8255053.695846
-190048.419366     8255052.790956
-190068.520356     8255048.091277
-190086.038723     8255048.360931
-190099.822766     8255047.321214
-190114.293561     8255042.534872
-190131.256235     8255038.413595
-190146.332366     8255034.888460
-190165.787707     8255031.430733
-190184.647779     8255026.086773
-190201.601150     8255022.590534
-190217.322906     8255017.824976
-190234.911097     8255013.711799
-190247.504627     8255008.898090
-190257.070769     8254997.775278
-190262.923509     8254984.091529
-190267.515198     8254971.013549
-190280.925778     8254954.315648
-190284.901277     8254940.603003
-190291.359352     8254928.180461
-190302.913638     8254910.200568
-190323.186003     8254894.860177
-190331.501161     8254883.718109
-190348.413429     8254882.726544
-190372.198312     8254882.467475
-190387.213182     8254882.698593
-190412.047450     8254894.976098
-190423.834047     8254901.418499
-190434.985060     8254908.477825
-190463.704106     8254912.675554
-190482.463366     8254913.591017
-190497.479000     8254913.822147
-190513.200780     8254909.055061
-190532.746842     8254899.964464
-190548.589592     8254887.686376
-190561.374680     8254870.978847
-190575.451093     8254851.785888
-190593.877230     8254834.538480
-190605.250025     8254827.827382
-190620.991963     8254821.808717
-190638.640626     8254813.940804
-190651.931001     8254804.753916
-190663.958772     8254796.174302
-190682.889433     8254786.447523
-190690.649661     8254770.914537
-190692.152676     8254755.285237
-190697.379923     8254741.591859
-190704.493739     8254727.300813
-190712.263282     8254711.142025
-190721.879831     8254696.889502
-190730.194976     8254685.748199
-190738.510133     8254674.606131
-190758.631281     8254668.654874
-190770.589253     8254664.456562
-190795.514242     8254671.101197
-190820.419074     8254678.997411
-190843.507150     8254683.109229
-190867.261797     8254684.727528
-190884.779400     8254684.997170
-190899.169542     8254685.218672
-190921.218336     8254676.166599
-190938.281834     8254665.785135
-190958.504558     8254653.574467
-190988.121272     8254640.882452
-191013.954032     8254630.010026
-191034.146507     8254619.677490
-191046.770298     8254612.984884
-191058.172590     8254604.394878
-191071.483122     8254593.956411
-191086.043888     8254583.536425
-191104.389371     8254571.296861
-191124.571003     8254561.590102
-191144.723163     8254553.760724
-191159.273838     8254543.967291
-191173.240111     8254531.660319
-191189.264315     8254508.115729
-191201.323111     8254497.657231
-191211.454249     8254490.300312
-191224.764029     8254479.861069
-191233.704667     8254468.729393
-191250.717759     8254461.477641
-191270.283978     8254451.135466
-191284.230094     8254440.080073
-191296.954697     8254427.128044
-191310.375357     8254409.804353
-191324.482005     8254388.734026
-191341.021587     8254372.083523
-191350.587717     8254360.961476
-191358.276619     8254349.809768
-191372.858305     8254338.138214
-191389.992355     8254323.376225
-191400.214238     8254310.384908
-191406.056899     8254297.326949
-191410.889763     8254269.226954
-191416.893720     8254246.154071
-191420.909547     8254229.937504
-191421.151498     8254214.914737
-191417.064646     8254196.694850
-191416.751668     8254177.281165
-191412.109123     8254154.670349
-191411.241229     8254130.864981
-191407.052801     8254118.904506
-191406.709575     8254101.368953
-191403.177652     8254087.539985
-191402.198855     8254070.620593
-191394.377679     8254051.091337
-191381.703031     8254022.095147
-191372.065863     8253998.781506
-191359.279548     8253976.671280
-191350.833643     8253957.132408
-191346.120535     8253938.902882
-191335.171134     8253919.325474
-191330.034921     8253888.567486
-191324.686241     8253870.954122
-191318.237783     8253843.933131
-191314.099761     8253828.842945
-191304.402108     8253809.284805
-191299.719248     8253789.177146
-191294.431805     8253767.809057
-191289.759024     8253747.075609
-191284.955182     8253734.479716
-191280.807845     8253720.015331
-191264.228249     8253700.351260
-191252.623107     8253682.642356
-191236.669016     8253662.987149
-191219.422837     8253645.817360
-191202.096016     8253633.654650
-191192.852480     8253624.746851
-191179.169237     8253619.527909
-191166.817633     8253609.320379
-191173.285799     8253596.271283
-191195.324502     8253587.845764
-191211.782665     8253576.203094
-191216.434839     8253559.369613
-191220.561556     8253536.267834
-191225.464983     8253503.786549
-191228.925893     8253483.178300
-191229.238408     8253463.774243
-191229.661826     8253437.484209
-191225.625367     8253416.135375
-191222.224492     8253394.169616
-191217.571868     8253372.184590
-191211.193986     8253340.781545
-191204.695134     8253316.889502
-191197.580105     8253292.362030
-191191.696654     8253269.106168
-191182.674899     8253246.427945
-191173.562424     8253229.382590
-191165.721854     8253211.104924
-191151.624058     8253192.731708
-191137.062078     8253164.333176
-191129.241678     8253144.803167
-191117.737348     8253120.834841
-191110.137966     8253087.534396
-191101.176696     8253061.100672
-191097.099922     8253042.254996
-191091.922619     8253014.000919
-191087.179262     8252997.649525
-191082.547572     8252974.412167
-191081.507526     8252961.248265
-191077.360189     8252946.783879
-191076.946399     8252933.629617
-191074.806587     8252911.057324
-191071.587179     8252877.824298
-191071.990427     8252852.786608
-191072.192051     8252840.267762
-191081.919478     8252819.130791
-191087.176210     8252803.559270
-191093.069289     8252787.370834
-191100.758942     8252776.219903
-191104.724362     8252763.133047
-191117.569948     8252742.669253
-191129.224269     8252718.430690
-191137.720881     8252696.022120
-191141.091058     8252681.047504
-191144.017196     8252654.796758
-191146.377576     8252624.780107
-191150.474821     8252603.555709
-191158.244364     8252587.396922
-191165.943345     8252575.619425
-191179.849121     8252567.068718
-191194.309074     8252562.908154
-191206.367858     8252552.450419
-191212.291174     8252534.384616
-191216.256594     8252521.297760
-191216.498545     8252506.274993
-191213.319451     8252470.538810
-191204.892953     8252449.747582
-191200.856507     8252428.397985
-191197.385055     8252410.814280
-191196.970515     8252397.659241
-191196.718022     8252374.490055
-191197.545138     8252361.980838
-191205.315446     8252345.822062
-191217.525460     8252325.974429
-191233.136337     8252328.093320
-191242.258904     8252344.512121
-191247.021655     8252359.611923
-191251.744842     8252377.215660
-191255.650240     8252406.702048
-191258.506278     8252423.650336
-191259.526153     8252438.066581
-191263.027841     8252453.772917
-191270.858332     8252472.676373
-191290.576995     8252491.762818
-191303.634733     8252496.972896
-191316.702563     8252501.556420
-191334.220929     8252501.826074
-191349.862055     8252502.066832
-191363.111339     8252495.383854
-191376.986115     8252488.710504
-191388.429498     8252477.616588
-191392.465494     8252460.147678
-191392.747760     8252442.621753
-191383.171089     8252415.551847
-191380.880059     8252402.368688
-191373.705309     8252381.596729
-191367.156039     8252360.835161
-191361.706547     8252349.481219
-191355.843266     8252324.973015
-191351.755638     8252306.753881
-191350.080785     8252294.206152
-191343.592012     8252269.688319
-191338.959558     8252246.450950
-191331.128303     8252227.547483
-191327.061608     8252208.076018
-191326.032405     8252194.286337
-191325.738834     8252173.620297
-191326.051349     8252154.216239
-191333.811578     8252138.683253
-191339.068310     8252123.111732
-191351.833241     8252107.655782
-191367.534851     8252104.141039
-191376.072253     8252118.046290
-191375.850459     8252131.817478
-191376.830020     8252148.736881
-191376.577990     8252164.385438
-191383.147417     8252183.895427
-191399.767328     8252201.056340
-191415.983540     8252204.436438
-191426.962727     8252183.317970
-191432.199302     8252168.998027
-191436.225971     8252152.155683
-191440.342609     8252129.679694
-191455.650600     8252111.758345
-191482.229822     8252093.384545
-191498.718234     8252079.863743
-191509.475628     8252072.516463
-191524.682043     8252060.854525
-191534.824023     8252052.871829
-191543.743751     8252042.990956
-191551.433404     8252031.840025
-191547.244976     8252019.879549
-191540.009729     8252002.863855
-191514.994019     8252001.852088
-191500.674441     8251997.249296
-191504.115181     8251977.893390
-191518.505322     8251978.114892
-191531.653794     8251977.691337
-191617.743328     8251957.571762
-191667.442116     8251929.328295
-END
-LINE3D
-HEIGHT 1070.000000
-183557.000000     8256623.276550
-183573.685428     8256619.798967
-183611.244287     8256619.125207
-183640.023997     8256619.568202
-183666.391911     8256614.338279
-183695.252084     8256609.773427
-183712.285704     8256601.270866
-183729.299165     8256594.019884
-183745.696844     8256586.132715
-183773.336282     8256579.670475
-183798.442713     8256575.049372
-183828.574410     8256569.252203
-183847.414350     8256565.158294
-183867.495540     8256561.711728
-183886.345545     8256556.992794
-183903.934093     8256552.881151
-183935.912592     8256548.991007
-183970.323069     8256549.520675
-184007.175615     8256553.843599
-184034.007712     8256558.638992
-184065.289964     8256559.120508
-184097.823582     8256559.621285
-184122.223700     8256559.996867
-184145.998326     8256560.362820
-184163.516311     8256560.632468
-184186.685411     8256559.737212
-184217.473040     8256552.071541
-184258.765651     8256552.707143
-184295.063053     8256552.640674
-184330.745054     8256551.938024
-184353.288304     8256551.031606
-184368.404750     8256545.003313
-184383.551229     8256537.098413
-184400.534276     8256531.724033
-184423.814279     8256523.942800
-184452.694801     8256518.126373
-184491.575399     8256513.090581
-184512.231891     8256512.781830
-184529.184665     8256509.287110
-184544.825791     8256509.527867
-184573.070563     8256504.326834
-184610.740301     8256496.768626
-184640.256597     8256490.335276
-184667.300385     8256481.986797
-184694.354454     8256473.011769
-184730.772850     8256465.432770
-184753.992356     8256461.407803
-184767.776615     8256460.366561
-184805.335474     8256459.692801
-184835.992234     8256460.164689
-184865.316972     8256465.625158
-184889.666494     8256469.130448
-184907.123981     8256473.156361
-184928.345659     8256476.613505
-184953.290831     8256482.005033
-184990.668224     8256492.598540
-185029.276826     8256504.462887
-185064.817699     8256512.522817
-185100.348100     8256521.209296
-185137.775924     8256528.671563
-185174.527825     8256539.255441
-185213.257396     8256543.608787
-185233.217641     8256547.671694
-185245.720451     8256548.490854
-185273.642605     8256563.321196
-185294.097282     8256575.531287
-185314.047436     8256580.220749
-185330.233399     8256585.478978
-185350.133147     8256593.298151
-185373.151030     8256601.792029
-185403.656189     8256611.653045
-185428.550930     8256620.175813
-185442.305131     8256621.012706
-185458.440688     8256629.400647
-185477.099136     8256636.575533
-185494.496533     8256644.356188
-185515.667423     8256650.943038
-185540.067733     8256651.318622
-185576.980561     8256651.886807
-185612.652495     8256651.809183
-185628.354093     8256648.295204
-185648.364744     8256649.228400
-185662.673849     8256654.457740
-185675.731970     8256659.667824
-185687.538342     8256664.858640
-185705.510825     8256675.778635
-185725.390415     8256684.849386
-185741.475567     8256696.367039
-185756.945317     8256707.248510
-185772.465449     8256715.001797
-185794.917954     8256719.729776
-185814.313179     8256720.028320
-185851.851881     8256720.606138
-185891.913092     8256719.970896
-185935.102934     8256719.382283
-185978.898087     8256720.056405
-186012.057197     8256720.566810
-186038.939676     8256722.234020
-186069.515805     8256727.712223
-186098.295324     8256728.155215
-186118.305950     8256729.089940
-186142.696169     8256730.092078
-186168.286990     8256734.241655
-186192.687299     8256734.617240
-186208.247770     8256739.865841
-186231.316058     8256745.230008
-186261.195726     8256755.081396
-186276.079917     8256763.450075
-186288.481939     8256770.527129
-186306.504828     8256778.317412
-186336.515532     8256780.032773
-186367.172291     8256780.504661
-186393.530114     8256775.901292
-186414.811907     8256775.602165
-186439.898181     8256772.232641
-186475.640679     8256767.773726
-186504.551258     8256760.079163
-186534.673246     8256754.908554
-186556.035694     8256749.601583
-186576.147133     8256744.276885
-186608.751314     8256740.396373
-186638.983824     8256728.339781
-186659.125535     8256721.135423
-186672.384898     8256713.826655
-186686.260044     8256707.154075
-186703.293688     8256698.649986
-186718.450066     8256690.118529
-186737.925946     8256685.409229
-186757.391353     8256681.326476
-186773.113133     8256676.559390
-186804.415543     8256675.789327
-186825.687627     8256676.116760
-186851.843825     8256684.032236
-186870.542613     8256688.702435
-186889.241400     8256693.372635
-186916.749370     8256695.049472
-186940.463333     8256699.170160
-186969.243234     8256699.613158
-187003.593214     8256703.899090
-187031.050803     8256708.704110
-187055.451112     8256709.079695
-187079.346516     8256701.934644
-187108.822473     8256698.005980
-187136.996682     8256697.186237
-187158.167953     8256703.773092
-187191.145597     8256715.550764
-187226.100912     8256721.097903
-187256.061234     8256725.941448
-187291.097585     8256726.480749
-187321.854775     8256720.693208
-187361.361438     8256715.667053
-187386.447737     8256712.296001
-187416.478622     8256712.758255
-187442.129916     8256713.153095
-187475.914901     8256713.673134
-187497.762071     8256717.139907
-187522.717309     8256721.906409
-187542.677529     8256725.970845
-187568.883752     8256730.756604
-187592.648478     8256731.749114
-187616.352349     8256736.496355
-187634.445420     8256739.905342
-187660.026532     8256744.681479
-187686.293609     8256745.712507
-187728.827329     8256746.992392
-187751.350397     8256747.339081
-187778.333687     8256742.746868
-187794.691433     8256737.362862
-187813.531347     8256733.270481
-187848.042636     8256727.540726
-187974.393224     8256770.181926
-187984.827642     8256782.864488
-188001.397541     8256803.154354
-188018.572750     8256824.706956
-188040.238478     8256839.439467
-188061.318622     8256851.660714
-188091.178514     8256862.763687
-188116.073255     8256871.286454
-188136.537616     8256882.871514
-188153.329678     8256889.390962
-188168.960738     8256890.256746
-188189.586408     8256891.826118
-188207.104775     8256892.095771
-188222.130475     8256891.701876
-188237.771601     8256891.942634
-188250.183689     8256898.394663
-188264.957384     8256913.647796
-188276.763374     8256918.838606
-188290.982140     8256929.700821
-188300.820932     8256940.495617
-188308.773157     8256951.888082
-188317.764650     8256976.445202
-188334.263604     8257001.116353
-188350.864133     8257019.528093
-188364.476800     8257029.129090
-188386.919214     8257034.483622
-188417.021045     8257030.564592
-188433.973652     8257027.068341
-188466.507652     8257027.569124
-188502.068302     8257034.377470
-188529.516182     8257039.809050
-188545.702145     8257045.067279
-188569.305587     8257056.073949
-188604.139932     8257069.132090
-188627.682112     8257083.895012
-188653.778195     8257095.566759
-188679.278271     8257105.350734
-188702.326020     8257111.966473
-188730.379234     8257118.659260
-188745.324305     8257123.271680
-188763.468163     8257123.550962
-188784.054258     8257127.625031
-188814.649781     8257131.851644
-188842.803808     8257132.285008
-188863.430242     8257133.854392
-188880.888111     8257137.880311
-188898.405714     8257138.149952
-188910.908524     8257138.969112
-188927.791332     8257139.854163
-188945.308934     8257140.123805
-188965.340100     8257139.806956
-188981.677307     8257135.674524
-188998.710544     8257127.171957
-189015.128380     8257118.033209
-189035.290607     8257109.578805
-189064.191120     8257102.509268
-189096.885641     8257092.995880
-189115.745737     8257087.650392
-189133.980317     8257082.296804
-189157.815631     8257078.906496
-189187.926764     8257074.362428
-189221.217317     8257066.735284
-189243.135051     8257065.820766
-189263.165478     8257065.502378
-189284.457719     8257064.578232
-189300.169409     8257060.437700
-189316.446118     8257060.061532
-189335.296124     8257055.342598
-189354.146129     8257050.623663
-189373.692954     8257041.533078
-189392.542935     8257036.815672
-189413.370230     8257025.866199
-189436.680864     8257016.206840
-189463.784766     8257004.102091
-189484.622891     8256992.527604
-189501.726716     8256979.642219
-189518.801057     8256968.634978
-189539.547697     8256962.693348
-189564.210103     8256946.795351
-189584.401814     8256936.462803
-189602.646485     8256930.482662
-189619.781323     8256915.719156
-189637.561022     8256899.715215
-189649.185871     8256877.354033
-189655.179763     8256854.906175
-189663.040040     8256833.113754
-189668.973434     8256814.422161
-189669.871114     8256797.531654
-189670.234022     8256774.998649
-189666.731897     8256720.473041
-189661.271852     8256670.927910
-189651.986762     8256625.706278
-189648.323328     8256581.196358
-189634.669119     8256535.280764
-189626.201819     8256478.176480
-189619.985245     8256436.757747
-189614.838190     8256406.625538
-189610.408112     8256370.870098
-189604.201605     8256328.826341
-189598.318154     8256305.570479
-189592.384297     8256285.444329
-189580.779167     8256267.734662
-189572.927755     8256250.082773
-189563.199866     8256232.402002
-189552.139574     8256219.709806
-189534.924407     8256200.661896
-189515.731188     8256187.844513
-189500.200941     8256180.719307
-189472.278787     8256165.888965
-189445.062779     8256146.060408
-189432.206665     8256128.331484
-189419.500980     8256101.214943
-189413.516742     8256084.216976
-189408.340202     8256055.962910
-189398.096935     8256031.388051
-189384.221709     8255999.242893
-189378.247513     8255981.621429
-189359.245087     8255956.910215
-189338.215706     8255941.560790
-189320.313811     8255926.257977
-189308.022692     8255912.294947
-189290.130863     8255896.367108
-189278.495485     8255880.535573
-189265.720000     8255857.800334
-189256.516792     8255846.388613
-189245.617809     8255823.680730
-189244.618854     8255808.012917
-189256.273927     8255783.775130
-189265.344874     8255764.505123
-189276.192988     8255751.524975
-189285.769222     8255739.775610
-189301.662378     8255724.367811
-189336.304727     8255710.500500
-189372.198037     8255696.653973
-189394.176268     8255691.983191
-189411.159887     8255686.608819
-189436.871654     8255683.248922
-189453.844419     8255678.501092
-189468.860052     8255678.732222
-189483.330848     8255673.945880
-189511.706656     8255660.608820
-189552.019515     8255644.325015
-189589.820338     8255628.627724
-189604.835972     8255628.858853
-189626.874675     8255620.433334
-189638.893144     8255612.478757
-189652.122258     8255607.048122
-189663.545484     8255597.205785
-189680.568655     8255589.328243
-189698.914138     8255577.088679
-189719.277224     8255556.115419
-189740.115374     8255544.539404
-189769.177147     8255527.457235
-189796.503619     8255501.580545
-189825.706543     8255475.734267
-189857.856227     8255461.203408
-189880.611168     8255447.153119
-189892.750606     8255431.687540
-189911.802236     8255414.449760
-189921.963622     8255405.214709
-189943.457487     8255391.771718
-189964.941286     8255378.953752
-189986.283934     8255374.899894
-190012.580877     8255374.052784
-190042.612145     8255374.515044
-190069.423702     8255380.562009
-190090.554634     8255389.653551
-190110.565667     8255390.586753
-190139.980745     8255390.414348
-190162.110194     8255376.354431
-190181.726819     8255362.882544
-190203.815953     8255351.325785
-190248.448288     8255338.865664
-190281.153664     8255328.725735
-190305.664876     8255322.215343
-190327.147911     8255309.397365
-190349.216863     8255299.093713
-190386.957189     8255287.152687
-190410.338386     8255273.112037
-190429.309362     8255260.882101
-190441.347988     8255251.675946
-190455.737366     8255251.897436
-190489.522350     8255252.417475
-190509.552752     8255252.100615
-190525.274533     8255247.333529
-190546.072343     8255238.262200
-190573.802501     8255226.167091
-190609.695835     8255212.319036
-190647.476476     8255197.874851
-190666.457543     8255185.018362
-190677.265342     8255174.541371
-190686.255634     8255160.279208
-190695.993152     8255138.515684
-190704.520000     8255114.229745
-190709.201646     8255095.518884
-190713.198091     8255080.553144
-190722.238764     8255063.162798
-190746.154733     8255054.764646
-190760.554940     8255054.361123
-190785.045231     8255049.102298
-190811.433660     8255042.622330
-190832.776332     8255038.566945
-190856.116426     8255027.030970
-190885.904527     8255003.697478
-190896.782890     8254988.839197
-190904.542355     8254973.306199
-190920.516166     8254952.890557
-190954.623744     8254933.380749
-190989.790774     8254925.782489
-191017.389872     8254921.824935
-191035.614385     8254917.096372
-191046.381106     8254909.122528
-191061.063592     8254891.192315
-191079.509887     8254872.693328
-191096.028536     8254857.295157
-191111.911625     8254842.512384
-191126.522784     8254828.963450
-191139.853474     8254817.273404
-191159.560845     8254798.167119
-191183.042090     8254777.867036
-191204.071760     8254754.399493
-191226.877095     8254737.220257
-191254.001931     8254723.863176
-191283.104043     8254704.276321
-191311.600833     8254683.427496
-191342.620514     8254661.365614
-191388.110226     8254634.517379
-191414.114362     8254613.004240
-191433.771314     8254597.028431
-191451.481226     8254585.405029
-191467.394540     8254568.745651
-191483.307866     8254552.085509
-191499.251428     8254533.547999
-191521.582488     8254506.970001
-191536.940885     8254485.918940
-191547.818497     8254471.059884
-191569.443423     8254449.479337
-191582.097463     8254440.908599
-191592.924668     8254429.179254
-191615.245650     8254403.227045
-191633.903648     8254371.583423
-191644.296907     8254347.951394
-191645.881327     8254327.315025
-191646.163606     8254309.788336
-191646.375309     8254296.643701
-191640.643088     8254263.997941
-191634.355927     8254226.962027
-191633.487269     8254203.156648
-191622.568880     8254181.701119
-191611.720291     8254155.864289
-191596.502571     8254129.334261
-191579.397544     8254103.400363
-191566.581744     8254083.168282
-191543.886837     8254054.644563
-191512.533560     8254019.726594
-191491.664724     8253994.361470
-191473.944271     8253967.792919
-191456.808995     8253943.737154
-191448.918019     8253928.589199
-191438.170242     8253896.492946
-191428.189860     8253855.642988
-191417.986933     8253828.563442
-191408.440498     8253799.616168
-191400.155126     8253770.062360
-191396.643360     8253754.981813
-191397.006281     8253732.448044
-191386.118141     8253709.114383
-191377.610988     8253693.331000
-191369.063507     8253680.051538
-191363.059087     8253664.306678
-191356.409005     8253649.804533
-191350.465081     8253630.303408
-191345.731803     8253613.326225
-191337.295214     8253593.161552
-191326.386903     8253571.080234
-191319.160983     8253553.437973
-191319.473498     8253534.033916
-191319.765856     8253515.881437
-191320.654220     8253499.616731
-191324.074803     8253481.512404
-191329.331535     8253465.940882
-191330.188900     8253451.553532
-191333.599392     8253434.075759
-191337.696636     8253412.851360
-191338.856437     8253379.685742
-191343.003312     8253355.332384
-191347.099793     8253334.107974
-191347.371993     8253317.207074
-191347.583695     8253304.062439
-191347.936538     8253282.154460
-191343.920249     8253259.553283
-191339.893117     8253237.577884
-191335.725610     8253224.365842
-191327.339439     8253201.070693
-191323.313071     8253179.095306
-191319.892026     8253158.381890
-191318.912478     8253141.461722
-191318.690234     8253116.414403
-191317.792091     8253094.487168
-191316.933500     8253070.056763
-191312.160671     8253055.582750
-191308.153697     8253032.355772
-191302.905830     8253008.482985
-191298.869383     8252987.133387
-191294.065541     8252974.537495
-191289.928283     8252959.447320
-191278.827664     8252949.259046
-191267.667323     8252942.826285
-191255.951290     8252932.002594
-191249.250814     8252920.629396
-191250.158573     8252903.113099
-191260.985779     8252891.383753
-191291.894568     8252876.207084
-191319.856599     8252849.714997
-191341.350465     8252836.272006
-191350.977092     8252821.393693
-191361.239290     8252805.899219
-191369.927447     8252771.597593
-191377.323528     8252739.780621
-191381.430088     8252717.930421
-191394.941493     8252694.972333
-191407.736660     8252677.639014
-191419.240527     8252662.789597
-191426.989914     8252647.882389
-191440.440822     8252628.680565
-191452.630666     8252610.085275
-191470.330499     8252599.087662
-191498.565168     8252594.513947
-191546.245099     8252587.108293
-191587.598003     8252583.988391
-191605.116370     8252584.258044
-191629.688054     8252573.992916
-191650.475022     8252565.547364
-191671.928572     8252554.607531
-191690.849141     8252545.507306
-191702.887768     8252536.301150
-191713.634319     8252529.579649
-191724.492524     8252515.972947
-191738.982714     8252509.935014
-191752.888502     8252501.383544
-191766.137786     8252494.700566
-191781.859566     8252489.933480
-191794.443030     8252485.744796
-191809.650209     8252474.082870
-191805.492030     8252460.244262
-191782.979040     8252459.271784
-191764.835181     8252458.992502
-191751.061217     8252459.406429
-191737.195756     8252465.453978
-191723.381465     8252468.371827
-191710.192666     8252471.299304
-191698.234682     8252475.498380
-191681.968063     8252475.247995
-191671.513106     8252463.817006
-191664.893272     8252447.436728
-191659.615156     8252425.442074
-191663.156708     8252399.826745
-191670.281366     8252384.909921
-191686.719360     8252374.519593
-191694.408261     8252363.367886
-191707.153035     8252349.163514
-191720.472882     8252338.099246
-191728.818276     8252325.079810
-191740.957714     8252309.614232
-191749.342672     8252294.090862
-191755.820916     8252280.415977
-191765.538264     8252259.904795
-191769.514539     8252246.191398
-191784.286995     8252222.627540
-191792.006909     8252209.597712
-191810.987963     8252196.741986
-191832.501234     8252182.046640
-191845.185510     8252171.598533
-191847.496248     8252144.711606
-191847.838999     8252123.430180
-191849.392420     8252104.671168
-191861.996054     8252099.230141
-191877.011687     8252099.461270
-191897.577637     8252104.786155
-191915.721495     8252105.065437
-191933.400395     8252095.320155
-191946.861382     8252075.492542
-191964.702354     8252055.731584
-191973.884943     8252029.577141
-191978.536340     8252012.744413
-191980.060288     8251995.862781
-191980.342555     8251978.336856
-191979.988499     8251961.426316
-191975.861319     8251945.710352
-191970.502549     8251928.723541
-191960.714175     8251914.798270
-191956.667637     8251894.075226
-191947.454350     8251883.289294
-191942.065331     8251868.180616
-191941.641462     8251855.652143
-191941.953990     8251836.247321
-191957.776570     8251825.221576
-191977.463770     8251807.367635
-191989.451991     8251801.291191
-192005.244335     8251792.142814
-192021.046758     8251782.368649
-192048.796322     8251769.021185
-192091.723568     8251745.890703
-192113.126713     8251738.080581
-192128.808166     8251735.817417
-192143.207622     8251735.413117
-192161.351481     8251735.692399
-192190.141079     8251735.509601
-192203.986382     8251730.713631
-192221.564470     8251727.227772
-192240.414463     8251722.509602
-192256.105995     8251719.620649
-192268.063979     8251715.421572
-192296.994716     8251706.475430
-192317.136785     8251699.272606
-192329.730341     8251694.457368
-192351.022582     8251693.533222
-192366.097937     8251690.008840
-192383.111793     8251682.757100
-192392.657765     8251672.886631
-192402.940120     8251656.140578
-192409.196517     8251636.302325
-END
-LINE3D
-HEIGHT 1060.000000
-183557.000000     8256823.953132
-183571.438661     8256824.084612
-183594.621542     8256823.042508
-183616.552034     8256821.989001
-183639.735106     8256820.946899
-183657.275915     8256820.480214
-183673.564336     8256820.002124
-183689.220627     8256820.144692
-183707.381886     8256820.310070
-183726.795724     8256820.486854
-183748.726216     8256819.433346
-183777.574725     8256815.310003
-183798.873083     8256814.877535
-183817.069398     8256811.283605
-183834.019164     8256807.051911
-183856.599313     8256803.498284
-183876.732725     8256793.656714
-183896.245883     8256783.182700
-183908.817653     8256778.284726
-183935.213776     8256768.499803
-183954.007165     8256768.044524
-183971.577190     8256764.444891
-183989.738449     8256764.610269
-184012.909835     8256764.821270
-184037.959900     8256765.049378
-184059.878706     8256765.248973
-184078.666255     8256765.420054
-184099.999665     8256761.228660
-184123.855573     8256755.180232
-184152.704082     8256751.056889
-184172.158817     8256746.848006
-184189.102740     8256743.243054
-184204.770715     8256742.132519
-184218.559821     8256741.004875
-184236.732765     8256739.917151
-184258.686624     8256736.357820
-184284.368823     8256735.964889
-184303.168054     8256734.883250
-184320.703214     8256735.042926
-184337.617737     8256734.570156
-184355.152897     8256734.729833
-184373.314156     8256734.895211
-184398.990511     8256735.129022
-184421.523731     8256736.587420
-184444.683432     8256738.051523
-184464.711875     8256739.487113
-184486.630682     8256739.686708
-184514.185523     8256739.937625
-184538.609489     8256740.160031
-184558.023137     8256740.336814
-184575.558488     8256740.496492
-184596.213033     8256741.937401
-184620.010518     8256742.154103
-184649.444421     8256742.422131
-184671.351542     8256743.874828
-184689.506766     8256744.666947
-184707.030435     8256746.079345
-184727.690818     8256746.894276
-184747.098624     8256747.697419
-184775.824635     8256756.731080
-184802.126897     8256756.970591
-184822.793506     8256757.158783
-184840.954574     8256757.324159
-184858.489543     8256757.483834
-184879.782251     8256757.677728
-184899.810694     8256759.113317
-184914.202723     8256760.497199
-184936.677520     8256768.220727
-184950.408395     8256773.358215
-184967.229631     8256782.909884
-184984.688647     8256791.214534
-185002.141827     8256800.145162
-185022.761698     8256805.345382
-185042.093553     8256814.293500
-185060.810993     8256821.982813
-185077.649755     8256829.655020
-185103.864766     8256839.292229
-185123.196623     8256848.239965
-185150.675899     8256856.635478
-185171.272018     8256864.341899
-185190.621398     8256871.410554
-185205.616537     8256875.306346
-185219.382464     8256876.684908
-185234.365536     8256881.833799
-185254.990867     8256886.407655
-185281.867414     8256892.291262
-185300.602381     8256898.101113
-185318.102297     8256902.019713
-185334.373001     8256903.421084
-185354.378074     8256907.362879
-185374.406520     8256908.798086
-185397.577907     8256909.009087
-185415.112876     8256909.168762
-185428.890488     8256909.294222
-185445.798976     8256909.448193
-185460.823323     8256910.211801
-185475.197822     8256913.475528
-185488.337650     8256914.848389
-185502.729680     8256916.232271
-185525.889381     8256917.696374
-185544.665244     8256919.120558
-185559.665842     8256922.389986
-185573.443454     8256922.515446
-185594.747848     8256921.456236
-185608.490022     8256925.341001
-185627.845628     8256931.782917
-185657.853051     8256937.695034
-185678.484223     8256941.642530
-185701.608872     8256946.865558
-185715.971686     8256951.382387
-185734.677445     8256960.324421
-185752.768787     8256968.008034
-185765.884865     8256971.886714
-185788.319149     8256983.995914
-185808.282946     8256992.322990
-185831.390065     8256999.425864
-185850.136721     8257003.982230
-185867.045591     8257004.136204
-185885.792243     8257008.692952
-185906.458470     8257008.881141
-185923.367340     8257009.035115
-185937.771051     8257009.166276
-185952.807083     8257008.676782
-185969.089472     8257008.825051
-185982.235145     8257009.571170
-185999.108577     8257013.484448
-186017.861074     8257017.414454
-186034.717362     8257023.207198
-186047.792926     8257031.471550
-186062.132374     8257038.494201
-186076.477662     8257044.890493
-186089.599581     8257048.142814
-186106.438344     8257055.815020
-186125.225892     8257055.986101
-186150.960861     8257049.954784
-186171.714722     8257040.745277
-186193.674425     8257036.559204
-186215.001803     8257032.994169
-186235.703468     8257029.423053
-186258.289266     8257025.243064
-186282.127648     8257021.074098
-186302.214514     8257016.244558
-186319.170125     8257011.386121
-186332.362149     8257007.120591
-186349.271019     8257007.274565
-186373.694985     8257007.496972
-186406.833667     8257013.437602
-186428.085096     8257018.017159
-186444.326971     8257022.551099
-186458.730681     8257022.682261
-186476.265650     8257022.841936
-186493.841516     8257018.615943
-186513.290597     8257015.033804
-186531.457510     8257014.572438
-186544.620708     8257013.439094
-186557.157422     8257012.300428
-186574.077978     8257011.201299
-186598.513247     8257010.170600
-186622.972265     8257006.634082
-186653.658365     8257006.913512
-186674.951073     8257007.107405
-186691.239307     8257006.628932
-186705.678452     8257003.001172
-186718.256066     8256997.476455
-186735.252188     8256988.232730
-186754.144897     8256977.126654
-186773.025920     8256967.273679
-186788.097009     8256963.024878
-186814.440550     8256958.878724
-186831.987204     8256957.785297
-186852.033173     8256957.341424
-186870.194241     8256957.506800
-186890.860850     8256957.694992
-186910.888911     8256959.130579
-186929.647248     8256962.434225
-186946.556118     8256962.588198
-186962.838890     8256962.736471
-186977.909596     8256958.487666
-186998.581667     8256958.049112
-187022.414587     8256954.506892
-187047.511389     8256949.722973
-187065.678301     8256949.261607
-187081.966913     8256948.783519
-187102.006659     8256948.966003
-187125.189731     8256947.923901
-187154.658686     8256944.433003
-187176.009816     8256938.361766
-187194.176728     8256937.900400
-187214.257750     8256933.697602
-187236.808500     8256933.276156
-187266.254087     8256932.291081
-187301.365300     8256928.225149
-187315.769011     8256928.356311
-187334.603301     8256923.514982
-187354.016948     8256923.691764
-187372.798652     8256924.489588
-187402.232555     8256924.757615
-187427.908718     8256924.991425
-187452.326844     8256925.840192
-187476.054221     8256933.575126
-187501.075074     8256936.935800
-187524.246461     8256937.146800
-187541.775589     8256937.932835
-187555.553201     8256938.058296
-187576.172687     8256943.258894
-187594.334137     8256943.424274
-187614.374265     8256943.606761
-187639.424330     8256943.834869
-187668.852009     8256944.729254
-187690.729919     8256949.314516
-187711.946678     8256957.653002
-187732.560706     8256963.479964
-187752.512818     8256973.060143
-187776.246421     8256980.168339
-187798.727063     8256987.265125
-187814.933500     8256995.558369
-187829.267489     8257003.207384
-187842.383564     8257007.086447
-187864.864206     8257014.183233
-187879.227402     8257018.700066
-187898.594312     8257023.888876
-187922.954011     8257031.003156
-187945.417127     8257039.979404
-187965.392606     8257047.053761
-187983.478107     8257055.363733
-188005.929537     8257065.593085
-188022.751156     8257075.144757
-188037.704634     8257083.426209
-188055.146507     8257093.610325
-188070.077379     8257104.397990
-188091.235716     8257119.001606
-188106.206720     8257125.403595
-188124.280536     8257134.966670
-188145.479769     8257145.184619
-188157.946379     8257151.563803
-188170.418829     8257157.316628
-188182.873754     8257164.948914
-188197.213583     8257171.971570
-188211.546804     8257179.620960
-188228.356737     8257190.425735
-188244.504754     8257204.983727
-188259.458997     8257213.265186
-188276.274010     8257223.443212
-188297.467399     8257234.287903
-188317.378614     8257248.253750
-188335.440745     8257259.069927
-188350.991875     8257270.489653
-188373.402409     8257285.104672
-188393.396182     8257290.299190
-188410.246247     8257296.718290
-188435.202834     8257306.970836
-188457.683476     8257314.067622
-188480.785136     8257321.796859
-188507.660915     8257327.680842
-188532.032303     8257333.541636
-188545.136697     8257338.673419
-188559.476523     8257345.696457
-188570.052386     8257353.311633
-188587.505948     8257362.242264
-188600.598656     8257368.627150
-188620.585820     8257374.448404
-188644.974734     8257378.429735
-188668.772602     8257378.646441
-188690.071150     8257378.213974
-188706.985483     8257377.741202
-188726.399130     8257377.917984
-188748.908980     8257381.882588
-188772.677636     8257385.231858
-188786.449025     8257385.983675
-188810.205995     8257390.586048
-188825.206976     8257393.855480
-188839.604463     8257394.612998
-188854.628811     8257395.376606
-188874.042458     8257395.553389
-188902.223781     8257395.810010
-188927.273846     8257396.038119
-188948.566554     8257396.232012
-188968.607064     8257396.414503
-188988.646810     8257396.596986
-189003.688687     8257395.480750
-189016.254616     8257391.209136
-189038.799522     8257391.414432
-189054.461653     8257390.930640
-189074.513084     8257389.860021
-189094.600332     8257385.030484
-189114.019824     8257384.580524
-189134.094622     8257381.004083
-189157.933386     8257376.835120
-189174.888612     8257371.977063
-189188.081404     8257367.711158
-189201.267587     8257364.071988
-189215.717653     8257359.191118
-189228.910445     8257354.925213
-189257.067799     8257340.040754
-END
-LINE3D
-HEIGHT 1060.000000
-189257.067799     8257340.040754
-189281.233567     8257318.434112
-189298.815655     8257313.581763
-189317.064739     8257304.349447
-189334.657749     8257298.243988
-189356.026405     8257290.293289
-189377.389221     8257282.968949
-189393.098094     8257277.472747
-189411.920694     8257273.884903
-189426.991783     8257269.636101
-189445.193365     8257265.415807
-189460.264450     8257261.167388
-189474.112552     8257253.774618
-189488.585988     8257246.387544
-189504.312387     8257239.011879
-189525.043260     8257232.308580
-189543.274817     8257224.955727
-189556.525268     8257214.424685
-189576.079128     8257199.565384
-189589.938151     8257190.919506
-189605.676234     8257182.290738
-189623.246638     8257178.691491
-189641.495722     8257169.459176
-189660.961951     8257163.997188
-189672.913463     8257158.467153
-189684.238115     8257152.931027
-189701.861100     8257143.693010
-189722.006007     8257132.598336
-189735.216325     8257126.452968
-189745.317991     8257117.772875
-189756.654325     8257110.984029
-189774.920935     8257099.872251
-189788.833301     8257085.587992
-189797.096803     8257072.505120
-189806.636634     8257056.927835
-189814.274799     8257043.839651
-189818.166527     8257029.464143
-189816.483269     8256995.441932
-END
-LINE3D
-HEIGHT 1060.000000
-183557.000000     8257203.155951
-183568.465922     8257210.022181
-183585.907604     8257220.206296
-183602.746178     8257227.878118
-183617.717948     8257234.280115
-183636.464599     8257238.836863
-183655.872402     8257239.640388
-183669.644174     8257240.392208
-183683.427627     8257239.891309
-183697.240103     8257236.257459
-183711.690743     8257231.376595
-183724.888611     8257226.484323
-183737.413644     8257226.598377
-183752.443835     8257226.735243
-183769.972963     8257227.521278
-183785.588357     8257232.049513
-183798.704627     8257235.928195
-183811.826738     8257239.180518
-183836.824221     8257245.047396
-183853.071558     8257248.954590
-183869.342453     8257250.355963
-183884.992899     8257251.125273
-183900.017059     8257251.888498
-183922.556315     8257252.720156
-183935.695952     8257254.093015
-183949.444352     8257257.351040
-183965.720897     8257258.126052
-183980.095588     8257261.389780
-183995.716826     8257265.291273
-184014.469323     8257269.221279
-184034.474204     8257273.163072
-184049.469343     8257277.058864
-184074.484352     8257281.046279
-184088.853011     8257284.936366
-184107.611348     8257288.240012
-184131.906593     8257302.245780
-184145.011177     8257307.377565
-184157.506998     8257310.624184
-184174.410028     8257311.404518
-184190.686572     8257312.179529
-184203.170708     8257316.679251
-184217.516187     8257323.075544
-184232.476084     8257330.730259
-184250.567234     8257338.413870
-184276.788086     8257347.424719
-184296.120134     8257356.372456
-184309.821603     8257364.642890
-184321.638556     8257373.522194
-184339.068556     8257384.959028
-184354.613842     8257397.005496
-184367.683371     8257405.896589
-184387.612307     8257417.982592
-184409.426144     8257429.459346
-184428.740472     8257440.286927
-184447.411176     8257452.988268
-184468.569512     8257467.591884
-184486.607890     8257480.914264
-184502.153179     8257492.960349
-184522.673349     8257508.811363
-184531.347547     8257518.915640
-184540.630320     8257530.904699
-184557.978335     8257551.112867
-184573.494410     8257566.291900
-184589.010488     8257581.470551
-184605.199781     8257591.643261
-184622.026479     8257600.568184
-184640.117821     8257608.251796
-184654.451424     8257615.901190
-184668.147243     8257624.797986
-184683.692532     8257636.844071
-184701.098970     8257650.787109
-184719.775514     8257662.862091
-184733.453811     8257673.637966
-184748.396368     8257683.172528
-184764.567753     8257695.224697
-184779.481099     8257707.891824
-184788.143233     8257719.248818
-184797.385106     8257735.623926
-184812.263400     8257752.049978
-184822.804594     8257763.424082
-184832.093208     8257774.786781
-184840.743656     8257787.396877
-184848.791372     8257797.495449
-184866.818450     8257812.070552
-184881.157897     8257819.093204
-184894.274355     8257822.972270
-184907.361222     8257829.983516
-184923.579344     8257837.023657
-184942.290944     8257845.339331
-184960.376445     8257853.649304
-184979.731670     8257860.091217
-185003.476955     8257865.946692
-185023.481649     8257869.888101
-185045.266084     8257884.497419
-185058.359175     8257890.882308
-185070.849152     8257894.755669
-185088.986852     8257897.426868
-185102.138366     8257897.546627
-185126.561949     8257897.769030
-185140.966042     8257897.900195
-185160.391375     8257896.823875
-185176.685446     8257895.719424
-185195.496365     8257893.384300
-185212.446132     8257889.152606
-185239.392401     8257887.518359
-185259.438370     8257887.074486
-185278.852400     8257887.251272
-185295.128948     8257888.025901
-185311.352915     8257894.439300
-185325.716111     8257898.956133
-185339.481656     8257900.334692
-185368.845454     8257908.120570
-185395.721615     8257914.004556
-185416.932530     8257922.969784
-185437.511123     8257932.555668
-185453.717945     8257940.848533
-185479.891677     8257954.871407
-185510.472999     8257966.427999
-185527.949545     8257972.852804
-185541.662894     8257979.869754
-185554.106133     8257988.755144
-185564.618115     8258003.261813
-185577.629031     8258018.418034
-185588.129328     8258034.177806
-185594.274999     8258046.765094
-185602.867406     8258065.640324
-185616.451842     8258086.440633
-185625.073460     8258102.183298
-185632.495081     8258112.275787
-185645.441733     8258134.323498
-185650.247190     8258156.297075
-185654.490812     8258171.373460
-185656.229278     8258186.426650
-185657.365012     8258198.968317
-185657.810380     8258218.396154
-185657.640957     8258236.564803
-185656.880101     8258250.969203
-185651.729952     8258265.959665
-185645.309693     8258282.818566
-185639.544745     8258296.550604
-185629.999073     8258312.754249
-185621.114935     8258325.204673
-185613.482993     8258337.666501
-185605.213268     8258351.375729
-185593.823970     8258363.803342
-185579.876930     8258381.846912
-185565.356374     8258394.246011
-185548.962602     8258406.001257
-185529.408739     8258420.860940
-185507.390612     8258431.312143
-185493.572107     8258435.571968
-185469.083874     8258442.241434
-185446.463020     8258450.180731
-185426.341098     8258458.769579
-185410.023657     8258462.380235
-185391.224423     8258463.462256
-185369.896663     8258467.027288
-185352.981948     8258467.500057
-185338.543185     8258471.127821
-185322.231585     8258474.112117
-185308.424761     8258477.119222
-185294.612097     8258480.752687
-185273.243819     8258488.703772
-185256.896784     8258495.446990
-185236.195505     8258499.017727
-185218.561217     8258509.508850
-185205.316225     8258519.413529
-185190.772298     8258534.318833
-185174.291277     8258555.471395
-185152.220566     8258571.561751
-185125.760183     8258588.237782
-185098.673701     8258604.908112
-185077.826358     8258624.142439
-185063.896848     8258640.306164
-185051.254971     8258652.722371
-185037.922348     8258672.024363
-185018.936161     8258693.154877
-184997.491938     8258709.250173
-184982.362430     8258719.763722
-184970.382085     8258728.426708
-184958.395518     8258737.716051
-184945.150912     8258747.620351
-184933.129285     8258760.669383
-184915.430736     8258778.051614
-184898.294016     8258802.331801
-184881.871411     8258817.219998
-184869.235374     8258829.009844
-184857.874905     8258838.304888
-184845.244716     8258849.467609
-184830.086372     8258863.114492
-184814.910124     8258878.640451
-184802.847993     8258896.074008
-184790.165215     8258912.876264
-184779.349441     8258930.947583
-184773.187197     8258937.000000
-END
-LINE3D-MASTER
-HEIGHT 1050.000000
-185209.482965     8258937.000000
-185227.247876     8258921.242035
-185237.987705     8258911.314926
-185254.381098     8258899.559295
-185269.493083     8258890.924826
-185279.594750     8258882.244733
-185299.142765     8258868.012174
-185316.133428     8258859.394813
-185330.653985     8258846.995714
-185343.858080     8258841.476703
-185357.044263     8258837.837533
-185372.080296     8258837.348039
-185385.266479     8258833.708869
-185409.081494     8258832.045726
-185424.158427     8258827.170182
-185443.583756     8258826.094245
-185460.574419     8258817.476883
-185476.938984     8258808.853820
-185493.303159     8258800.231519
-185509.667342     8258791.608452
-185522.900648     8258782.956876
-185534.880993     8258774.293890
-185548.746239     8258765.021655
-185561.985386     8258755.743718
-185575.212463     8258747.719263
-185587.784236     8258742.820907
-185600.993790     8258736.675532
-185617.949401     8258731.817096
-185639.294684     8258726.372984
-185654.997715     8258721.503141
-185672.602789     8258714.144966
-185689.587611     8258706.153965
-185702.779635     8258701.888435
-185719.109148     8258697.024297
-185741.033795     8258696.597531
-185763.619601     8258692.416777
-185779.316785     8258688.174060
-185793.135290     8258683.914235
-185806.959643     8258679.027285
-185822.030345     8258674.778862
-185838.991797     8258669.294066
-185859.078667     8258664.464143
-185882.940415     8258657.789355
-185903.665065     8258651.712413
-185922.505196     8258646.244724
-185940.736750     8258638.892253
-185957.071721     8258633.401752
-185972.195388     8258623.514563
-185989.800468     8258616.155623
-186015.575947     8258605.739017
-186034.451130     8258596.512403
-186048.937016     8258587.872232
-186062.164093     8258579.847777
-186074.103926     8258575.570080
-186087.342692     8258566.292140
-186101.810666     8258559.531811
-186116.881751     8258555.283392
-186142.604655     8258550.504792
-186160.209729     8258543.146616
-186173.402142     8258538.880325
-186187.846746     8258534.626201
-186204.170035     8258530.388420
-186219.896430     8258523.013137
-186243.752720     8258516.964713
-186263.213105     8258512.129467
-186278.284193     8258507.880666
-186291.505433     8258500.482189
-186303.462789     8258494.325411
-186316.666498     8258488.806779
-186332.363685     8258484.563679
-186351.794859     8258482.860999
-186364.360788     8258478.589385
-186379.390980     8258478.726251
-186393.806376     8258477.604310
-186413.232091     8258476.527994
-186432.025480     8258476.072715
-186448.945653     8258474.973582
-186464.613629     8258473.863047
-186477.173714     8258470.218176
-186493.491541     8258466.607141
-186507.310046     8258462.347316
-186521.204121     8258449.942512
-186525.745701     8258433.066504
-186525.880073     8258418.656781
-186526.026129     8258402.993955
-186520.518625     8258389.159270
-186509.386006     8258374.020153
-186497.604300     8258361.381543
-186487.718416     8258346.880575
-186483.445965     8258334.936759
-186474.806817     8258321.073939
-186464.423365     8258292.783906
-186463.293475     8258279.615497
-186452.758504     8258267.615036
-186447.268144     8258251.900885
-186435.462688     8258241.768094
-186426.788870     8258231.664203
-186408.633265     8258230.872081
-186393.562558     8258235.120886
-186383.460510     8258243.800976
-186372.094582     8258253.722383
-186362.578118     8258266.793846
-186353.716968     8258276.738062
-186343.574408     8258289.803440
-186332.840420     8258299.104189
-186315.211973     8258308.968952
-186301.405150     8258311.976057
-186284.537176     8258307.436415
-186266.469583     8258297.246984
-186250.877560     8258290.212543
-186234.664896     8258282.546038
-186223.474233     8258273.672438
-186212.968095     8258258.539025
-186198.698756     8258243.998141
-186188.801569     8258230.750279
-186177.042852     8258215.605460
-186168.386563     8258203.621724
-186157.857054     8258190.994517
-186146.742340     8258173.976324
-186138.068143     8258163.872047
-186118.783026     8258149.911901
-186108.241833     8258138.537797
-186097.671427     8258130.296257
-186078.357099     8258119.468677
-186061.541704     8258109.290648
-186039.084051     8258099.687653
-186022.854243     8258093.900614
-186009.708953     8258093.154499
-185992.208658     8258089.235513
-185969.663752     8258089.030217
-185950.841148     8258092.618443
-185927.634709     8258096.166368
-185910.070529     8258099.139258
-185893.747243     8258103.376657
-185874.936324     8258105.711781
-185861.129501     8258108.718886
-185841.071846     8258110.415861
-185827.973297     8258104.657335
-185817.432103     8258093.283231
-185808.184386     8258077.534865
-185801.406393     8258065.568233
-185787.932959     8258032.864405
-185778.673559     8258018.368759
-185761.957484     8257997.539932
-185740.208101     8257979.171689
-185731.528059     8257969.694155
-185714.127465     8257955.124374
-185700.455013     8257943.721756
-185684.283625     8257931.669969
-185665.718086     8257907.691087
-185654.544949     8257896.938024
-185640.843289     8257888.667589
-185628.985249     8257884.173951
-185610.308705     8257872.098969
-185595.395740     8257859.431846
-185579.844610     8257848.012121
-185568.624357     8257842.270699
-185555.525804     8257836.512556
-185539.927936     8257830.104858
-185521.859965     8257819.915041
-185507.491306     8257816.024954
-185486.889347     8257808.944893
-185463.191177     8257798.077775
-185443.812204     8257794.141682
-185431.322223     8257790.268703
-185416.924357     8257789.510799
-185393.793864     8257784.914513
-185362.528024     8257779.616968
-185343.775527     8257775.686961
-185316.273267     8257769.797274
-185293.142774     8257765.200988
-185266.840129     8257764.961474
-185241.801750     8257763.480263
-185223.049257     8257759.549875
-185202.418082     8257755.602761
-185179.914074     8257751.011798
-185152.405587     8257745.748850
-185126.143839     8257741.123668
-185105.489297     8257739.682377
-185087.415481     8257730.119302
-185072.449935     8257723.090949
-185052.497441     8257713.510766
-185026.340854     8257697.608426
-184992.698764     8257678.505092
-184970.287848     8257663.890069
-184955.351516     8257653.728769
-184943.540217     8257644.222721
-184929.867765     8257632.820103
-184918.091900     8257619.555133
-184893.228788     8257599.278532
-184867.048830     8257585.882397
-184846.540345     8257568.778280
-184828.501585     8257555.455898
-184809.280732     8257534.604262
-184787.519668     8257517.488740
-184758.892973     8257497.804662
-184734.609605     8257482.545794
-184720.902097     8257474.902483
-184699.082610     8257464.052091
-184684.760692     8257455.149594
-184671.064870     8257446.253181
-184656.748793     8257436.724324
-184639.939242     8257425.919553
-184619.413231     8257410.694899
-184600.168625     8257392.349465
-184579.660140     8257375.245348
-184559.754384     8257360.653138
-184535.453490     8257347.273732
-184498.006923     8257333.148207
-184468.063385     8257320.344214
-184446.876220     8257308.873166
-184429.446411     8257297.436333
-184411.395966     8257285.367053
-184389.582319     8257273.890300
-184367.739461     8257265.546113
-184347.757756     8257259.098496
-184329.666605     8257251.414885
-184303.480997     8257238.645112
-184263.511742     8257226.376619
-184233.539374     8257216.705195
-184211.690676     8257208.987368
-184186.710719     8257201.241027
-184156.738352     8257191.569603
-184113.579419     8257185.537345
-184086.709098     8257179.026999
-184064.257477     8257168.797646
-184049.906348     8257163.027714
-184024.300098     8257155.276053
-183990.552656     8257147.449874
-183966.198989     8257139.709236
-183948.716411     8257133.910790
-183930.590205     8257129.986486
-183910.555917     8257129.177639
-183888.051908     8257124.586676
-183868.638070     8257124.409891
-183850.488496     8257122.991411
-183831.712633     8257121.567227
-183812.960137     8257117.637221
-183797.935789     8257116.873612
-183784.790499     8257116.127497
-183769.134209     8257115.984929
-183749.099921     8257115.176082
-183734.069921     8257115.039218
-183710.898534     8257114.828217
-183698.373502     8257114.714163
-183685.848469     8257114.600109
-183667.060921     8257114.429028
-183652.025079     8257114.918523
-183626.975015     8257114.690415
-183609.445887     8257113.904380
-183594.456591     8257109.381846
-183575.744992     8257101.066172
-183557.000000     8257092.907279
-END
-LINE3D-MASTER
-HEIGHT 1050.000000
-183557.000000     8256961.170905
-183567.027948     8256961.262221
-183593.330401     8256961.501733
-183628.400530     8256961.821085
-183657.213984     8256961.457050
-183676.627822     8256961.633834
-183700.431148     8256961.224176
-183724.866608     8256960.193478
-183746.797100     8256959.139970
-183767.475204     8256958.075058
-183783.763434     8256957.596967
-183801.304438     8256957.129901
-183823.861216     8256956.082479
-183853.921218     8256956.356208
-183890.881710     8256955.439564
-183924.710945     8256954.494407
-183952.277854     8256953.492225
-183975.489946     8256949.317556
-184001.798431     8256948.930711
-184030.646941     8256944.807368
-184044.471099     8256939.920798
-184056.996132     8256940.034852
-184074.583873     8256934.555759
-184096.543573     8256930.370068
-184116.636092     8256924.913784
-184139.216241     8256921.360156
-184159.929209     8256916.535935
-184172.512664     8256910.384859
-184185.710724     8256905.492588
-184205.791749     8256901.289407
-184230.268102     8256895.873425
-184260.913496     8256900.538525
-184291.564735     8256904.576882
-184317.773905     8256914.840451
-184349.712776     8256915.131290
-184384.150770     8256916.071681
-184419.846998     8256916.396734
-184444.862011     8256920.383767
-184473.611392     8256926.911224
-184507.996808     8256933.490003
-184546.759836     8256940.735440
-184574.244955     8256948.504211
-184600.489177     8256955.008855
-184624.871864     8256959.616926
-184651.174509     8256959.856440
-184674.942782     8256963.205707
-184699.325852     8256967.813782
-184720.612719     8256968.634035
-184739.388582     8256970.058219
-184756.923551     8256970.217894
-184772.579842     8256970.360461
-184795.751228     8256970.571462
-184815.164875     8256970.748244
-184830.195067     8256970.885111
-184848.321079     8256974.809795
-184865.803470     8256980.607857
-184886.996858     8256991.452548
-184913.808756     8257004.228024
-184932.473618     8257017.555726
-184946.795536     8257026.458223
-184959.203723     8257039.102537
-184979.127006     8257051.815285
-184991.611142     8257056.315006
-185015.373574     8257060.290634
-185045.984108     8257068.714660
-185077.887732     8257072.764804
-185105.367007     8257081.160317
-185134.162743     8257082.675743
-185158.557498     8257086.030715
-185174.202103     8257087.426385
-185189.191402     8257091.948536
-185204.812637     8257095.850412
-185228.528332     8257104.838066
-185242.259203     8257109.975937
-185254.099332     8257116.349416
-185275.948034     8257124.066861
-185293.377839     8257135.504076
-185308.958181     8257143.791237
-185321.413106     8257151.423524
-185335.747094     8257159.072539
-185351.982742     8257164.233218
-185373.848971     8257170.071200
-185397.014513     8257170.908943
-185415.169739     8257171.700680
-185427.694772     8257171.814734
-185440.231490     8257170.675685
-185453.423899     8257166.409777
-185465.948932     8257166.523831
-185487.826842     8257171.109093
-185502.160445     8257178.758487
-185527.122875     8257188.384290
-185544.593581     8257195.435456
-185562.064283     8257202.487003
-185576.427479     8257207.003836
-185593.289229     8257212.169834
-185611.433153     8257214.214676
-185635.833749     8257216.943288
-185657.746715     8257217.769243
-185677.786461     8257217.951726
-185693.442751     8257218.094294
-185715.999724     8257217.046491
-185730.403435     8257217.177652
-185744.151836     8257220.435678
-185764.783007     8257224.383174
-185789.774649     8257230.876412
-185812.255291     8257237.973198
-185835.988895     8257245.081394
-185864.088424     8257254.109351
-185890.958745     8257260.619697
-185911.619131     8257261.434245
-185927.240366     8257265.336120
-185944.769494     8257266.122155
-185964.177679     8257266.925684
-185986.722584     8257267.130980
-186013.651327     8257267.376195
-186034.955721     8257266.316986
-186051.279006     8257262.079587
-186071.319135     8257262.262074
-186092.611843     8257262.455968
-186115.782847     8257262.666965
-186137.689968     8257264.119662
-186162.740033     8257264.347770
-186184.032741     8257264.541663
-186205.951548     8257264.741258
-186224.124683     8257263.653535
-186242.958969     8257258.812589
-186261.125881     8257258.351223
-186278.046433     8257257.252476
-186304.354922     8257256.865248
-186323.768569     8257257.042030
-186348.192535     8257257.264437
-186375.121278     8257257.509653
-186408.939018     8257257.817600
-186425.847506     8257257.971570
-186441.538849     8257254.355213
-186459.109256     8257250.755583
-186476.017744     8257250.909554
-186493.553095     8257251.069232
-186512.966742     8257251.246014
-186536.764227     8257251.462716
-186554.919833     8257252.254839
-186575.551008     8257256.201952
-186589.919663     8257260.092421
-186603.059494     8257261.464900
-186618.089304     8257261.601763
-186642.513270     8257261.824170
-186666.310755     8257262.040872
-186684.478046     8257261.579892
-186698.934338     8257256.072283
-186717.762780     8257251.858079
-186732.798434     8257251.368199
-186747.863678     8257247.746140
-186765.398647     8257247.905815
-186781.054937     8257248.048383
-186796.085129     8257248.185249
-186811.741420     8257248.327817
-186829.890802     8257249.746296
-186850.545730     8257251.187208
-186867.448373     8257251.967920
-186883.731145     8257252.116193
-186900.013534     8257252.264462
-186912.544411     8257251.751773
-186935.797587     8257243.191821
-186958.435970     8257233.372679
-186970.381642     8257228.469004
-186986.090510     8257222.973184
-187003.666376     8257218.747191
-187023.764927     8257212.664548
-187042.634269     8257204.064294
-187061.474396     8257198.596988
-187075.930688     8257193.089379
-187099.148812     8257188.288352
-187119.855936     8257184.090873
-187149.950989     8257180.605677
-187170.652654     8257177.034561
-187186.320630     8257175.924026
-187199.506813     8257172.284856
-187224.562719     8257171.886604
-187240.845108     8257172.034873
-187270.852913     8257177.946994
-187292.110183     8257181.900191
-187305.876114     8257183.278371
-187333.390441     8257187.914959
-187355.274192     8257191.873861
-187379.662724     8257195.855190
-187408.464687     8257196.743876
-187429.130914     8257196.932065
-187447.327034     8257193.338516
-187464.868226     8257192.871834
-187482.438250     8257189.272202
-187501.857738     8257188.822624
-187531.929425     8257187.843251
-187557.646867     8257183.691396
-187584.587296     8257182.683509
-187617.157915     8257182.353687
-187648.470496     8257182.638822
-187664.115101     8257184.034492
-187675.967297     8257189.154872
-187692.179579     8257196.821374
-187710.259239     8257205.757707
-187726.459835     8257214.677311
-187743.919237     8257222.981582
-187763.894716     8257230.055938
-187783.233179     8257238.377320
-187800.674291     8257248.561047
-187814.961538     8257261.222473
-187838.583373     8257280.234562
-187858.507038     8257292.947313
-187879.032667     8257308.171963
-187898.962176     8257320.257972
-187914.542515     8257328.545515
-187925.721110     8257338.672215
-187938.802898     8257346.310210
-187953.727165     8257357.724227
-187965.532624     8257367.856635
-187981.739060     8257376.149879
-188001.651044     8257390.115350
-188012.232748     8257397.104166
-188029.083578     8257403.523274
-188040.262174     8257413.649974
-188052.020891     8257428.794792
-188060.068993     8257438.892985
-188073.056542     8257456.555029
-188081.730739     8257466.659306
-188091.025194     8257477.395644
-188108.396197     8257495.097604
-188118.322595     8257505.212901
-188126.370694     8257515.311476
-188143.103914     8257534.260837
-188156.133123     8257547.537220
-188164.168775     8257558.888509
-188178.350863     8257582.827092
-188192.532182     8257606.766051
-188202.447659     8257618.134458
-188224.150301     8257641.515111
-188240.321689     8257653.566897
-188262.141177     8257664.417290
-188283.334565     8257675.261981
-188299.541006     8257683.554843
-188312.657085     8257687.433523
-188328.933629     8257688.208535
-188345.837041     8257688.988872
-188365.250688     8257689.165654
-188388.427533     8257688.750291
-188414.144593     8257684.598433
-188433.594057     8257681.016297
-188448.658540     8257677.393849
-188464.355728     8257673.150749
-188478.765661     8257672.655554
-188498.190994     8257671.579234
-188524.494021     8257671.818751
-188545.154021     8257672.633679
-188560.172531     8257674.023265
-188583.888605     8257683.011306
-188596.337689     8257691.269953
-188607.533811     8257699.517190
-188621.171589     8257714.679119
-188641.129542     8257723.632938
-188662.346301     8257731.971424
-188677.967539     8257735.872917
-188692.945149     8257741.648554
-188706.687327     8257745.532935
-188719.200674     8257746.900092
-188734.230866     8257747.036958
-188754.896710     8257747.225143
-188776.821358     8257746.798378
-188790.611037     8257745.670739
-188811.323620     8257740.846896
-188823.889549     8257736.575283
-188837.708440     8257732.315079
-188853.411468     8257727.445619
-188874.762598     8257721.374382
-188903.019870     8257713.486410
-188926.301879     8257701.793507
-188945.194587     8257690.687431
-188965.937145     8257682.731030
-188989.201628     8257672.917589
-189009.288112     8257668.088045
-189034.384914     8257663.304126
-189055.086579     8257659.733010
-189073.253869     8257659.272030
-189088.945212     8257655.655672
-189102.734127     8257654.528026
-189129.745046     8257646.001910
-189155.502999     8257637.464767
-189171.229398     8257630.089101
-189185.047524     8257625.828891
-189208.336138     8257613.509634
-189222.792049     8257608.002022
-189239.818146     8257595.625739
-189255.585438     8257583.864788
-189270.047189     8257577.730816
-189285.176700     8257567.216885
-189298.380413     8257561.697870
-189310.905446     8257561.811924
-189324.057341     8257561.931686
-189339.713632     8257562.074254
-189353.479176     8257563.452813
-189377.891457     8257564.928322
-189406.657982     8257569.576313
-189438.555765     8257574.252817
-189459.848473     8257574.446710
-189478.647707     8257573.364689
-189501.239350     8257568.557957
-189530.146091     8257558.169482
-189549.613084     8257552.707501
-189564.718461     8257544.699768
-189589.867845     8257534.277078
-189610.598717     8257527.573780
-189631.341275     8257519.617379
-189658.977528     8257511.096957
-189678.467889     8257503.129154
-189692.953011     8257494.488977
-189706.818639     8257485.216745
-189723.188662     8257475.967318
-189741.496169     8257460.469873
-189764.198817     8257443.759241
-189788.106920     8257432.072421
-189805.138863     8257419.069395
-189824.698567     8257403.583352
-189844.240741     8257389.977154
-189863.812131     8257373.238008
-189886.492172     8257359.033588
-189909.224031     8257339.190391
-189923.205740     8257317.387892
-189937.141477     8257300.597428
-189950.473717     8257281.295432
-189965.017261     8257266.390125
-189980.784556     8257254.628792
-189993.408904     8257244.092431
-190006.039101     8257232.928944
-190019.928096     8257221.150890
-190032.605029     8257204.975376
-190045.270274     8257190.053347
-190055.430363     8257175.108124
-190064.367463     8257157.019315
-190073.901453     8257142.068390
-190084.763589     8257118.984275
-190091.821628     8257100.878355
-190094.484529     8257083.985239
-190094.648112     8257066.442951
-190095.478690     8257044.520696
-190095.659803     8257025.098563
-190095.208972     8257006.297471
-END
-LINE3D
-HEIGHT 1040.000000
-186139.767052     8258937.000000
-186161.018099     8258926.612199
-186178.014603     8258917.368477
-186190.592218     8258911.843761
-186208.841301     8258902.611446
-186223.941215     8258895.230458
-186242.793028     8258888.510049
-186264.822839     8258876.805743
-186283.071923     8258867.573428
-186297.545745     8258860.185974
-186312.681093     8258849.046065
-186332.205745     8258837.318947
-186353.591928     8258827.488785
-186372.490481     8258815.755965
-186392.015133     8258804.028847
-186404.621959     8258795.371566
-186415.367629     8258784.818097
-186427.980295     8258775.534456
-186441.236590     8258764.376671
-186450.712150     8258755.691641
-186462.757141     8258740.137168
-186476.019277     8258728.353024
-186489.919575     8258715.321863
-186509.455916     8258702.341260
-186521.495058     8258687.413912
-186531.637625     8258674.347769
-186544.308714     8258658.798997
-186559.496644     8258642.020318
-186572.735409     8258632.742378
-186583.457716     8258624.694350
-186594.180015     8258616.647086
-186605.522579     8258609.231119
-186626.978866     8258591.883106
-186643.987059     8258581.385900
-186657.945398     8258562.089606
-186671.272180     8258543.413974
-186680.138789     8258532.843394
-186685.265953     8258520.358758
-186692.874145     8258510.402750
-186703.695767     8258491.704306
-186712.627026     8258474.241857
-186720.879225     8258462.412091
-186727.287798     8258446.806293
-186731.829374     8258429.930667
-186736.335902     8258416.813583
-186736.470273     8258402.403860
-186735.340380     8258389.235834
-186726.034240     8258379.752598
-186716.763155     8258366.510055
-186702.441234     8258357.607940
-186691.911726     8258344.980733
-186678.894587     8258330.450869
-186662.752410     8258315.266517
-186653.463796     8258303.903819
-186640.365247     8258298.145293
-186626.007892     8258293.002100
-186610.972241     8258293.491598
-186602.070194     8258307.821481
-186590.002215     8258325.882163
-186577.348652     8258339.551472
-186563.518462     8258345.064399
-186551.040167     8258339.938317
-186540.522344     8258326.058008
-186533.844049     8258303.440964
-186514.031771     8258278.824316
-186502.852793     8258268.697612
-186484.843241     8258252.243047
-186474.893476     8258244.633572
-186458.715864     8258233.208142
-186449.415569     8258223.098164
-186439.495015     8258212.356124
-186418.418468     8258188.981555
-186403.558086     8258170.675662
-186385.501796     8258159.233124
-186363.582990     8258159.033529
-186347.259704     8258163.270928
-186325.955314     8258164.329755
-186305.283243     8258164.768309
-186289.673690     8258159.613714
-186278.453819     8258153.872296
-186262.873477     8258145.585135
-186251.653224     8258139.843714
-186238.642305     8258124.687875
-186227.463331     8258114.560789
-186215.652032     8258105.054741
-186203.882011     8258091.163029
-186197.092329     8258080.449882
-186186.556980     8258068.449035
-186170.964953     8258061.414977
-186159.803505     8258049.408429
-186144.246534     8258038.615063
-186126.184786     8258027.798889
-186110.668707     8258012.620239
-186092.033060     8257996.159589
-186077.710757     8257987.257472
-186056.482698     8257980.171709
-186044.630502     8257975.051329
-186029.682482     8257966.143513
-186009.718306     8257957.816051
-185984.141076     8257946.931822
-185961.075236     8257935.443285
-185945.524105     8257924.023559
-185929.949605     8257915.110039
-185914.989521     8257907.454940
-185899.391653     8257901.047242
-185876.319586     8257890.185444
-185858.240312     8257881.248732
-185835.788499     8257871.019377
-185820.869694     8257858.978614
-185802.181461     8257848.157118
-185784.125175     8257836.714198
-185771.055834     8257827.823489
-185757.324959     8257822.686001
-185743.617455     8257815.042309
-185728.089695     8257801.116378
-185709.477415     8257782.149906
-185694.599121     8257765.723854
-185684.052468     8257754.976113
-185662.905817     8257739.119395
-185650.445052     8257732.113468
-185636.111445     8257724.464456
-185610.510852     8257716.085668
-185591.178994     8257707.137933
-185566.866033     8257695.011626
-185543.144497     8257686.650331
-185518.779335     8257680.162797
-185488.759848     8257675.503397
-185461.877843     8257670.246154
-185437.506841     8257664.384980
-185415.008291     8257659.167653
-185389.384705     8257653.295456
-185365.639802     8257647.439984
-185346.260825     8257643.504273
-185330.019332     8257638.970336
-185316.247565     8257638.218134
-185302.510846     8257633.707388
-185286.269353     8257629.173452
-185264.397284     8257623.961830
-185236.303595     8257614.307513
-185209.444960     8257606.544064
-185189.480780     8257598.216984
-185170.780866     8257588.648208
-185148.949693     8257579.050918
-185117.736431     8257568.114985
-185090.953745     8257552.206944
-185061.109526     8257528.752153
-185031.248164     8257507.176828
-184995.738695     8257486.803663
-184970.208588     8257470.907028
-184954.663302     8257458.860560
-184941.611490     8257448.090007
-184929.168248     8257439.205000
-184914.266587     8257425.284771
-184898.112728     8257411.353139
-184878.827229     8257397.392990
-184861.450002     8257380.317387
-184840.315033     8257363.207948
-184821.035761     8257348.621060
-184804.255418     8257334.684106
-184789.968552     8257322.022684
-184778.789578     8257311.895598
-184760.107190     8257300.447359
-184739.598705     8257283.343243
-184722.806680     8257270.659009
-184708.508129     8257259.250689
-184687.379004     8257241.514508
-184671.213460     8257228.835979
-184653.186382     8257214.260876
-184631.390265     8257200.904278
-184615.207195     8257190.105212
-184598.409326     8257178.047720
-184582.266771     8257162.862982
-184569.238326     8257149.586606
-184554.922249     8257140.057750
-184534.425449     8257121.700531
-184522.573253     8257116.580150
-184510.124170     8257108.321503
-184498.266133     8257103.827483
-184478.308180     8257094.873664
-184464.583146     8257089.109816
-184447.732699     8257082.690712
-184433.439992     8257070.655650
-184424.128008     8257061.799157
-184424.250698     8257048.642154
-184426.872320     8257036.134702
-184441.323151     8257031.253840
-184458.875646     8257029.534052
-184480.173816     8257029.101199
-184493.951428     8257029.226659
-184512.107033     8257030.018782
-184530.836159     8257036.454993
-184547.083496     8257040.362187
-184560.814371     8257045.499675
-184575.171341     8257050.643246
-184587.029381     8257055.136884
-184605.172919     8257057.182106
-184623.322687     8257058.600206
-184646.459018     8257062.570514
-184663.958935     8257066.489114
-184688.312793     8257074.229754
-184706.989337     8257086.304735
-184726.286139     8257099.011778
-184741.884006     8257105.419476
-184762.474285     8257113.752257
-184789.332920     8257121.515705
-184811.819785     8257127.986135
-184830.572281     8257131.916141
-184848.095565     8257133.328919
-184864.342902     8257137.236113
-184884.371345     8257138.671702
-184918.072240     8257151.509910
-184938.621621     8257164.228359
-184959.779958     8257178.831975
-184981.593604     8257190.308728
-185005.917869     8257201.181929
-185034.649724     8257209.588848
-185053.402217     8257213.519237
-185069.655394     8257216.800071
-185088.407891     8257220.730077
-185109.033221     8257225.303933
-185122.729040     8257234.200729
-185138.321067     8257241.234787
-185151.390405     8257250.125877
-185163.184178     8257261.511388
-185178.091684     8257274.804875
-185193.601917     8257290.610268
-185211.020041     8257303.300203
-185227.858803     8257310.972409
-185247.243239     8257314.281757
-185271.005672     8257318.257384
-185294.142003     8257322.227692
-185319.777269     8257326.847169
-185345.395393     8257333.346113
-185376.632025     8257341.775841
-185406.627762     8257348.941060
-185429.102560     8257356.664588
-185449.728272     8257361.238448
-185469.692070     8257369.565525
-185489.697146     8257373.506937
-185515.953049     8257378.758861
-185539.662900     8257388.373259
-185558.409556     8257392.929625
-185576.571006     8257393.095005
-185594.105975     8257393.254680
-185615.357786     8257397.834241
-185637.218170     8257404.298965
-185658.434547     8257412.637448
-185678.357830     8257425.350196
-185697.683843     8257434.924673
-185715.178297     8257439.470019
-185730.834588     8257439.612587
-185750.868489     8257440.421813
-185779.670452     8257441.310500
-185804.053140     8257445.918571
-185829.688789     8257450.538051
-185859.684526     8257457.703271
-185897.183675     8257466.190025
-185928.420307     8257474.619753
-185952.176895     8257479.222123
-185972.831437     8257480.663414
-185994.738559     8257482.116111
-186023.511310     8257486.137363
-186049.773058     8257490.762545
-186075.402484     8257496.008382
-186099.756342     8257503.749021
-186130.372334     8257511.546684
-186159.110030     8257519.327244
-186182.843252     8257526.435436
-186207.834894     8257532.928674
-186232.200055     8257539.416208
-186265.976899     8257544.109823
-186295.375749     8257548.136776
-186321.637497     8257552.761957
-186345.394085     8257557.364327
-186372.908031     8257562.000912
-186409.184193     8257567.343699
-186434.169994     8257574.463297
-186457.932423     8257578.439307
-186475.455711     8257579.851702
-186491.106157     8257580.621012
-186509.267607     8257580.786392
-186525.549996     8257580.934661
-186538.086713     8257579.795612
-186555.054006     8257573.684456
-186570.716138     8257573.200663
-186588.929787     8257567.727269
-186616.525908     8257563.592522
-186630.941304     8257562.470581
-186644.730598     8257561.343321
-186659.766634     8257560.853445
-186682.955164     8257559.184979
-186697.359257     8257559.316144
-186717.399003     8257559.498628
-186741.782073     8257564.106702
-186774.306337     8257568.788911
-186798.694868     8257572.770240
-186817.470732     8257574.194423
-186833.127022     8257574.336991
-186848.789157     8257573.852816
-186870.122758     8257569.661424
-186894.593465     8257564.871421
-186914.053850     8257560.036176
-186930.347924     8257558.931342
-186943.552016     8257553.412713
-186964.311722     8257543.576464
-186988.829163     8257533.774815
-187004.526350     8257529.531715
-187018.965113     8257525.903952
-187030.904561     8257521.626633
-187051.049849     8257510.531962
-187066.138464     8257504.403699
-187079.359703     8257497.005221
-187090.690578     8257490.842739
-187107.049298     8257482.846418
-187124.677746     8257472.981656
-187145.419922     8257465.025251
-187157.985851     8257460.753638
-187170.569306     8257454.602562
-187181.894337     8257449.066822
-187197.649947     8257438.558592
-187222.085598     8257437.527896
-187235.236729     8257437.647651
-187247.755917     8257438.388448
-187263.991951     8257443.548748
-187282.153019     8257443.714124
-187306.588670     8257442.683428
-187319.739801     8257442.803184
-187334.143894     8257442.934349
-187349.173704     8257443.071212
-187361.687051     8257444.438368
-187377.934770     8257448.345566
-187404.828457     8257452.350089
-187424.827693     8257456.917861
-187443.574345     8257461.474610
-187461.062576     8257466.646313
-187482.905430     8257474.990882
-187502.898821     8257480.185397
-187527.281508     8257484.793468
-187544.155326     8257488.706367
-187557.265561     8257493.211790
-187575.983001     8257500.901104
-187597.199761     8257509.239590
-187615.911360     8257517.555264
-187635.289955     8257521.490971
-187650.905349     8257526.019207
-187664.613236     8257533.662903
-187685.203132     8257541.995681
-187703.282788     8257550.932396
-187717.570036     8257563.593821
-187733.747265     8257575.019248
-187747.407649     8257587.674965
-187765.452254     8257600.370605
-187784.134642     8257611.818844
-187795.319843     8257621.319191
-187806.515965     8257629.566428
-187815.810420     8257640.302767
-187828.224447     8257652.320721
-187839.959798     8257669.971362
-187849.230886     8257683.213523
-187857.249773     8257696.444664
-187865.882313     8257710.934219
-187874.562354     8257720.411754
-187885.092245     8257733.038964
-187897.488747     8257746.936381
-187911.119920     8257762.724663
-187924.130839     8257777.880502
-187932.799195     8257788.611139
-187942.105335     8257798.094375
-187952.020048     8257809.462775
-187962.520727     8257825.222550
-187973.084906     8257834.090829
-187997.403712     8257845.590393
-188020.522134     8257851.440161
-188037.396334     8257855.353063
-188049.909681     8257856.720220
-188077.417403     8257861.983161
-188091.154501     8257866.494292
-188108.027937     8257870.407187
-188126.774589     8257874.963936
-188149.272757     8257880.181260
-188166.141113     8257884.720904
-188182.991178     8257891.140005
-188198.577360     8257898.800805
-188209.159833     8257905.789245
-188220.970368     8257915.295287
-188240.841451     8257933.646808
-188255.725586     8257949.446500
-188273.131642     8257963.389534
-188285.569041     8257972.901283
-188302.384818     8257983.079316
-188318.591258     8257991.372178
-188339.216207     8257995.946030
-188362.341238     8258001.169062
-188375.486524     8258001.915560
-188394.274073     8258002.086641
-188412.435523     8258002.252021
-188425.621710     8257998.612469
-188445.047039     8257997.536531
-188469.517746     8257992.746528
-188483.933521     8257991.624973
-188497.722436     8257990.497327
-188510.885252     8257989.363980
-188523.416125     8257988.851674
-188537.217490     8257986.470932
-188558.526960     8257984.785356
-188582.950926     8257985.007763
-188598.572164     8257988.909255
-188616.727770     8257989.701378
-188634.228068     8257993.619981
-188648.631397     8257993.751139
-188668.033359     8257995.181024
-188686.177283     8257997.225867
-188699.322573     8257997.971982
-188724.331741     8258002.585758
-188739.952976     8258006.487633
-188755.609267     8258006.630200
-188768.128458     8258007.370615
-188792.552424     8258007.593021
-188806.330418     8258007.718485
-188822.653704     8258003.481086
-188837.683896     8258003.617953
-188850.214769     8258003.105647
-188865.279252     8257999.483198
-188880.321126     8257998.367344
-188894.134176     8257994.733500
-188910.422406     8257994.255409
-188924.211321     8257993.127763
-188937.397504     8257989.488594
-188951.848338     8257984.607349
-188976.342409     8257977.311905
-188993.917892     8257973.085909
-189017.171454     8257964.525578
-189036.684421     8257954.051562
-189054.921819     8257946.072349
-189071.274316     8257938.702386
-189086.374613     8257931.321401
-189100.818838     8257927.066892
-189116.533551     8257920.944329
-189134.741738     8257916.097681
-189152.979141     8257908.118086
-189165.556751     8257902.593752
-189181.265624     8257897.097550
-189194.457651     8257892.831637
-189220.807416     8257888.059127
-189233.993599     8257884.419958
-189262.256715     8257875.905244
-189280.424006     8257875.444264
-189296.718080     8257874.339430
-189313.041366     8257870.102031
-189332.490066     8257866.519888
-189351.318511     8257862.305302
-189367.009853     8257858.688944
-189390.228363     8257853.887538
-189412.182222     8257850.328208
-189427.258387     8257845.453039
-189444.834634     8257841.227050
-189461.848283     8257830.103863
-189476.948582     8257822.722496
-189494.524830     8257818.496507
-189515.858435     8257814.304733
-189542.839374     8257808.911557
-189567.350974     8257799.736268
-189588.690419     8257794.918134
-189612.563475     8257786.989857
-189637.069230     8257778.441311
-189667.796609     8257774.335078
-189691.055247     8257765.148379
-189715.549321     8257757.852554
-189738.152650     8257751.792719
-189758.239898     8257746.963182
-189771.490348     8257736.432140
-189786.602329     8257727.798053
-189806.115296     8257717.324038
-189824.399436     8257704.332415
-189842.636834     8257696.353202
-189858.386600     8257686.471714
-189880.387200     8257677.899973
-189896.716326     8257673.036214
-189913.004557     8257672.558123
-189939.359401     8257667.158864
-189955.056588     8257662.915764
-189973.223878     8257662.454783
-189991.432066     8257657.608136
-190013.350872     8257657.807730
-190037.189636     8257653.638768
-190060.360641     8257653.849765
-190084.825503     8257649.686504
-190101.739832     8257649.214115
-190119.310239     8257645.614485
-190143.148238     8257641.445516
-190161.362267     8257635.972508
-190178.950200     8257630.493417
-190193.376895     8257628.118752
-190207.827729     8257623.237507
-190220.469607     8257610.821301
-190232.462016     8257600.905598
-190245.133105     8257585.356826
-190256.539547     8257571.049748
-190269.849184     8257554.253582
-190278.101001     8257542.423813
-190291.444927     8257521.868715
-190295.945992     8257509.378378
-190299.246674     8257491.238243
-190300.650773     8257474.960078
-190304.630135     8257451.186874
-190305.432266     8257432.397192
-190305.566638     8257417.987469
-190305.706854     8257402.951003
-190307.146005     8257382.913913
-190308.567626     8257364.756667
-190311.283109     8257342.224781
-190314.554580     8257327.217212
-190319.114068     8257308.461744
-190324.252153     8257294.723999
-190331.286825     8257279.123901
-190335.822942     8257262.874639
-190336.653520     8257240.952384
-190330.519535     8257227.111994
-190323.753610     8257213.892263
-190313.862264     8257200.018041
-190308.430326     8257178.038759
-190307.364317     8257157.978857
-190308.804233     8257137.941773
-190313.322060     8257123.571966
-190308.458562     8257107.863523
-190302.938990     8257095.281937
-190290.571700     8257078.251955
-190276.898866     8257066.849333
-190261.951232     8257057.941139
-190252.680144     8257044.698978
-190247.148887     8257033.370494
-190244.134474     8257020.811720
-190241.775371     8257005.126083
-END
-LINE3D
-HEIGHT 1020.000000
-191271.566073     8258937.000000
-191273.454688     8258936.198941
-191287.917204     8258930.064976
-191308.003684     8258925.235814
-191331.298146     8258912.289433
-191347.047912     8258902.407946
-191373.431967     8258893.876121
-191399.201605     8258884.085875
-191423.098789     8258873.652165
-191439.498023     8258861.270174
-191457.782159     8258848.278933
-191473.549454     8258836.517600
-191492.418796     8258827.917346
-191507.507411     8258821.789082
-191527.640632     8258811.947510
-191542.144048     8258801.427495
-191557.887972     8258792.172367
-191575.562768     8258777.296338
-191583.809508     8258766.092936
-191597.686054     8258755.567977
-191609.081582     8258742.513243
-191622.981498     8258729.482079
-191639.404103     8258714.593883
-191657.699921     8258700.349922
-191670.967898     8258687.939417
-191681.105381     8258675.500405
-191695.040356     8258658.709551
-191707.032765     8258648.793849
-191722.144750     8258640.159380
-191732.925090     8258625.846982
-191745.016821     8258605.280100
-191757.787226     8258579.080913
-191766.689277     8258564.750646
-191782.573414     8258540.459436
-191789.596400     8258526.112441
-191799.124549     8258511.787876
-191806.738579     8258501.205890
-191815.605574     8258490.634932
-191827.615512     8258478.839384
-191845.911333     8258464.595041
-191858.529841     8258454.685040
-191871.774450     8258444.780357
-191881.255859     8258435.468202
-191893.324216     8258417.407907
-191911.689381     8258395.645324
-191921.891131     8258376.314440
-191930.277320     8258350.074947
-191934.186574     8258333.819977
-191935.620645     8258314.409635
-191940.138476     8258300.039446
-191944.686278     8258282.537081
-191948.607218     8258265.029008
-191952.580740     8258241.882164
-191958.971787     8258228.155829
-191964.818524     8258205.652838
-191971.221257     8258190.673400
-191975.739084     8258176.303593
-191983.394774     8258161.335947
-191987.924287     8258145.713037
-192001.314953     8258120.145529
-192014.623826     8258103.349357
-192027.910093     8258089.059396
-192043.654018     8258079.804268
-192058.098243     8258075.549759
-192071.928816     8258070.036835
-192093.220759     8258070.230721
-192117.703148     8258064.187997
-192131.545409     8258057.421588
-192156.677264     8258048.878744
-192176.178545     8258039.657831
-192197.570572     8258029.200926
-192209.591428     8258016.152652
-192224.270108     8257986.837628
-192231.971775     8257966.857565
-192245.345677     8257943.169909
-192255.459028     8257933.236713
-192276.270930     8257917.762072
-192289.522141     8257907.231419
-192300.876005     8257898.562728
-192314.747474     8257888.664136
-192333.610975     8257880.690242
-192358.034177     8257880.912642
-192386.233026     8257879.289801
-192410.692044     8257875.753283
-192426.389231     8257871.510183
-192438.966845     8257865.985467
-192456.057207     8257846.717693
-192466.790812     8257837.416941
-192479.368427     8257831.892225
-192493.209920     8257825.126191
-192514.520154     8257823.440622
-192531.435251     8257822.967857
-192546.476360     8257821.851996
-192562.144336     8257820.741461
-192575.331287     8257817.101916
-192589.155254     8257812.215345
-192602.358964     8257806.696712
-192615.545151     8257803.057160
-192634.385278     8257797.589854
-192653.178671     8257797.134192
-192673.886176     8257792.936717
-192688.928050     8257791.820863
-192706.497692     8257788.221227
-192719.661273     8257787.087886
-192735.323404     8257786.604094
-192748.474536     8257786.723849
-192767.888183     8257786.900632
-192786.049633     8257787.066011
-192799.838548     8257785.938366
-192817.414796     8257781.712376
-192834.364177     8257777.481061
-192855.083368     8257772.030483
-192874.602175     8257760.930108
-192899.125461     8257750.501717
-192917.432967     8257735.004271
-192932.579240     8257722.610870
-192952.098812     8257711.510501
-192964.043719     8257706.606819
-192986.108582     8257691.143589
-192998.071783     8257684.360069
-193017.561379     8257676.392258
-193043.355152     8257664.095814
-193067.274941     8257651.155892
-193081.795880     8257638.756797
-193093.794133     8257628.214352
-193104.539424     8257617.660497
-193114.061729     8257603.962675
-193130.484331     8257589.074860
-193155.101094     8257568.622032
-193179.085912     8257548.790626
-193196.128775     8257534.534491
-193207.530137     8257520.854162
-193218.919053     8257508.426546
-193236.009418     8257489.158390
-193250.623067     8257466.735232
-193265.793474     8257451.835633
-193282.227761     8257435.694716
-193296.772070     8257420.789416
-193310.683671     8257406.505150
-193323.998385     8257389.082617
-193336.014165     8257376.660709
-193344.295957     8257361.698382
-193353.794892     8257350.506764
-193368.930244     8257339.366473
-193382.841845     8257325.082206
-193404.251399     8257312.745839
-193423.776050     8257301.018721
-193440.789699     8257289.895534
-193460.297589     8257280.047885
-193476.679294     8257269.545739
-193493.031791     8257262.175775
-193514.417977     8257252.345230
-193533.299001     8257242.492256
-193556.545954     8257234.558660
-193572.869240     8257230.321262
-193584.814911     8257225.417587
-193599.845103     8257225.554453
-193616.127492     8257225.702722
-193633.042589     8257225.229957
-193658.092653     8257225.458065
-193677.506301     8257225.634847
-193690.037174     8257225.122541
-193703.849456     8257221.489073
-193716.415385     8257217.217459
-193727.758328     8257209.801878
-193742.208394     8257204.921008
-193754.803534     8257197.516829
-193769.897990     8257190.762205
-193790.634707     8257183.432165
-193805.735007     8257176.050798
-193818.944560     8257169.905423
-193833.406312     8257163.771451
-193849.742047     8257158.280957
-193863.560170     8257154.021128
-193877.372456     8257150.387277
-193891.823286     8257145.506415
-193905.600516     8257145.631871
-193918.752412     8257145.751634
-193938.797999     8257145.307757
-193958.217490     8257144.857797
-193973.908833     8257141.241440
-193987.095020     8257137.601887
-194002.166105     8257133.353468
-194016.651991     8257124.713298
-194034.245000     8257118.607839
-194049.994766     8257108.726352
-194062.566539     8257103.827996
-194090.180951     8257097.813793
-194102.746876     8257093.542561
-194127.814470     8257091.890825
-194145.986837     8257090.803477
-194159.138733     8257090.923240
-194176.041380     8257091.703570
-194189.127483     8257098.714809
-194200.986285     8257103.208836
-194213.505473     8257103.949632
-194229.781257     8257104.724254
-194246.070251     8257104.246170
-194260.509400     8257100.618028
-194274.321682     8257096.984559
-194286.846714     8257097.098613
-194309.351488     8257101.689584
-194325.001937     8257102.458511
-194343.783645     8257103.255952
-194356.308677     8257103.370006
-194371.338105     8257103.506866
-194385.162072     8257098.620295
-194398.354864     8257094.354389
-194411.569494     8257087.582648
-194425.383305     8257083.949193
-194446.681093     8257083.516337
-194467.336017     8257084.957631
-194492.999731     8257086.444536
-194515.029542     8257074.740231
-194523.908983     8257062.916559
-194536.539180     8257051.753073
-194561.020804     8257045.710342
-194574.254489     8257037.059152
-194587.504175     8257026.528102
-194596.360249     8257017.210253
-194602.118589     8257004.104951
-194603.487631     8256991.586094
-194612.425499     8256973.496909
-194621.309255     8256961.046481
-194630.200382     8256947.969707
-194642.859789     8256933.673656
-194661.705760     8256927.579606
-194681.891563     8256912.099265
-194690.155826     8256899.016782
-194696.692930     8256869.627621
-194702.509692     8256850.257189
-194707.021678     8256836.513742
-194709.029270     8256822.747490
-194717.907182     8256810.923804
-194726.159763     8256799.094042
-194737.590340     8256782.280765
-194755.867871     8256769.915877
-194774.076823     8256765.069236
-194791.623859     8256763.975812
-194807.285990     8256763.492020
-194819.828549     8256761.726611
-194834.359644     8256748.074399
-194847.001522     8256735.658193
-194857.824290     8256716.959760
-194866.069498     8256705.756726
-194874.925573     8256696.438877
-194891.962591     8256682.809484
-194907.706516     8256673.554356
-194927.220247     8256663.080348
-194940.411510     8256658.814428
-194956.120379     8256653.318608
-194973.069764     8256649.086911
-194988.737739     8256647.976376
-195001.268612     8256647.464070
-195017.000000     8256647.607321
-END
-LINE3D
-HEIGHT 1020.000000
-195017.000000     8256981.784216
-194997.494296     8256985.148664
-194971.770631     8256989.926876
-194957.981715     8256991.054522
-194945.444998     8256992.193570
-194917.181882     8257000.708284
-194897.077872     8257007.417290
-194876.956333     8257016.006142
-194862.476291     8257024.019570
-194852.385545     8257031.446554
-194845.281534     8257054.564508
-194843.875906     8257070.842659
-194843.081148     8257089.005613
-194842.273172     8257108.422038
-194842.109590     8257125.964326
-194841.355725     8257139.741995
-194841.186301     8257157.910643
-194844.796836     8257173.607676
-194849.643569     8257191.195971
-194858.856234     8257210.703263
-194859.366252     8257223.239231
-194859.816318     8257242.040316
-194859.541730     8257271.486505
-194854.367829     8257288.983168
-194849.154559     8257310.865514
-194844.570936     8257332.127179
-194838.812597     8257345.232481
-194832.984150     8257365.856015
-194821.460098     8257392.693347
-194811.270033     8257410.771129
-194801.706831     8257428.854619
-194796.573826     8257441.965615
-194795.749854     8257463.261517
-194791.156078     8257485.775916
-194787.135054     8257513.934780
-194786.883837     8257540.874764
-194786.644302     8257566.562027
-194782.710912     8257585.323196
-194781.957051     8257599.100482
-194777.357431     8257622.241624
-194768.320244     8257650.981607
-194759.395595     8257667.817320
-194751.119643     8257682.153287
-194741.644079     8257690.838700
-194720.217764     8257705.054536
-194702.583093     8257715.545656
-194680.570808     8257725.370499
-194652.921344     8257735.143627
-194625.308462     8257741.157844
-194599.538059     8257750.948083
-194575.607346     8257765.141497
-194550.452121     8257776.190546
-194519.659714     8257787.188264
-194497.022098     8257797.007030
-194482.536212     8257805.647200
-194470.560565     8257813.683433
-194456.064522     8257823.576720
-194433.888658     8257850.943469
-194416.797528     8257870.211618
-194392.146480     8257894.422997
-194370.029035     8257915.524998
-194354.865236     8257929.797861
-194344.751124     8257939.730668
-194328.948776     8257955.250926
-194319.443997     8257967.069286
-194304.876321     8257984.480409
-194289.015551     8258006.265797
-194270.041049     8258026.143209
-194252.347956     8258042.899459
-194237.184157     8258057.172322
-194220.766632     8258071.433770
-194207.487735     8258085.097384
-194191.046839     8258101.865036
-194174.613317     8258118.005960
-194162.579247     8258132.307323
-194151.177881     8258145.988035
-194141.012716     8258161.559625
-194127.738131     8258174.596866
-194117.608021     8258186.409149
-194109.998300     8258196.365143
-194101.723881     8258210.700742
-194094.079107     8258224.415662
-194083.228656     8258246.246674
-194075.567886     8258261.841070
-194064.137312     8258278.653964
-194052.093086     8258294.208444
-194042.576622     8258307.279906
-194029.296196     8258320.943507
-194010.966087     8258338.946782
-193991.956532     8258362.583120
-193976.037340     8258390.633638
-193964.004031     8258404.935391
-193953.890683     8258414.868204
-193938.059124     8258433.521027
-193926.663603     8258446.574996
-193915.894942     8258459.635056
-193900.736219     8258473.281553
-193888.691229     8258488.836025
-193879.818393     8258500.033344
-193874.697838     8258511.891245
-193870.196772     8258524.381582
-193860.060054     8258536.820600
-193854.886149     8258554.317647
-193852.253227     8258568.077822
-193849.596166     8258584.344578
-193848.771432     8258605.640090
-193847.957612     8258625.683257
-193847.788192     8258643.851523
-193848.895097     8258659.525758
-193855.040768     8258672.113045
-193863.720809     8258681.590580
-193874.934457     8258687.958354
-193889.894537     8258695.613836
-193901.717526     8258703.866399
-193911.006136     8258715.229480
-193912.118118     8258730.277348
-193892.634366     8258737.618416
-193872.594620     8258737.435932
-193853.244472     8258730.367652
-193838.887884     8258725.224084
-193827.673472     8258718.856303
-193815.201014     8258713.104243
-193795.892531     8258701.649921
-193779.703616     8258691.477596
-193767.851424     8258686.356834
-193747.295819     8258674.264741
-193732.359867     8258664.103827
-193718.031719     8258655.828451
-193703.048268     8258650.679175
-193682.452528     8258642.973139
-193659.965281     8258636.502706
-193633.668866     8258635.636071
-193610.550437     8258629.787068
-193589.304470     8258624.580765
-193570.551974     8258620.650759
-193551.764425     8258620.479677
-193530.512617     8258615.899734
-193509.231591     8258614.453121
-193484.848518     8258609.845429
-193461.092315     8258605.242680
-193438.582462     8258601.278459
-193416.036792     8258601.073156
-193388.418069     8258607.713733
-193359.498878     8258619.355304
-193334.314439     8258633.537301
-193311.635165     8258647.741346
-193290.846634     8258660.709781
-193271.321218     8258672.436892
-193251.176308     8258683.531949
-193235.403172     8258695.919641
-193219.606666     8258710.813539
-193200.638008     8258730.064209
-193181.628457     8258753.700164
-193166.458050     8258768.599763
-193153.195914     8258780.383908
-193135.532036     8258794.007210
-193113.426272     8258813.856491
-193093.187887     8258834.975603
-193076.712707     8258855.501805
-193064.632665     8258874.815203
-193053.219614     8258889.749017
-193039.916585     8258905.918447
-193024.090867     8258923.944910
-193009.262954     8258937.000000
-END
-LINE3D
-HEIGHT 1020.000000
-186941.659145     8258937.000000
-186951.411983     8258926.917520
-186963.439451     8258913.242128
-186975.466529     8258899.567497
-186991.871987     8258886.559148
-187013.304529     8258871.716573
-187027.860137     8258855.558549
-187041.742913     8258844.406469
-187058.803681     8258828.271257
-187068.969611     8258812.699673
-187077.216351     8258801.496271
-187086.123853     8258786.540406
-187097.513152     8258774.112793
-187107.626889     8258764.179218
-187130.323692     8258748.095329
-187143.521939     8258743.203442
-187155.467232     8258738.299381
-187171.205315     8258729.670614
-187193.252649     8258716.087228
-187205.894527     8258703.671021
-187216.669415     8258689.984223
-187228.655983     8258680.694880
-187245.055218     8258668.312889
-187258.270612     8258661.541154
-187268.384342     8258651.608344
-187279.726900     8258644.193141
-187291.116198     8258631.765529
-187296.283880     8258614.894839
-187300.205198     8258597.387152
-187300.351255     8258581.724326
-187300.514841     8258564.181656
-187295.703544     8258542.834439
-187291.471603     8258526.505334
-187287.210452     8258513.308794
-187283.599152     8258497.611754
-187283.715997     8258485.081493
-187279.460690     8258471.258211
-187270.271395     8258449.244714
-187270.405767     8258434.834991
-187266.881719     8258409.740252
-187268.379675     8258383.438035
-187269.760785     8258369.666078
-187273.032259     8258354.658126
-187273.154945     8258341.501506
-187267.026801     8258327.034756
-187261.571496     8258307.561297
-187256.069832     8258293.100252
-187244.293585     8258279.835278
-187226.892987     8258265.265880
-187213.782753     8258260.760457
-187186.326848     8258249.858739
-187171.378449     8258240.950538
-187157.021476     8258235.807348
-187140.774139     8258231.900154
-187122.624374     8258230.481672
-187103.918619     8258221.539256
-187079.541773     8258216.304825
-187055.784802     8258211.702452
-187038.876314     8258211.548481
-187023.220024     8258211.405914
-187006.264412     8258216.264350
-186986.844542     8258216.713924
-186974.284457     8258220.358796
-186960.472172     8258223.992646
-186943.388033     8258242.634063
-186928.873322     8258254.406420
-186918.110122     8258266.839734
-186905.468244     8258279.255940
-186895.354511     8258289.189132
-186879.604745     8258299.070620
-186857.516511     8258317.040056
-186841.755061     8258328.174647
-186826.011136     8258337.429774
-186812.824953     8258341.068944
-186800.984442     8258334.695461
-186791.046358     8258325.833266
-186780.481798     8258316.964985
-186763.619665     8258311.798983
-186750.480219     8258310.426125
-186740.547980     8258300.937188
-186728.122267     8258290.172336
-186715.151863     8258270.630827
-186707.139199     8258256.773329
-186699.120690     8258243.542574
-186688.573656     8258232.794830
-186678.020777     8258222.673828
-186658.741505     8258208.086940
-186644.396216     8258201.690648
-186618.239629     8258185.788309
-186601.377496     8258180.622307
-186588.284788     8258174.237422
-186570.210972     8258164.674347
-186556.503468     8258157.030654
-186537.850291     8258142.449850
-186520.484746     8258124.121526
-186506.209565     8258110.207002
-186496.932637     8258097.591201
-186495.188330     8258083.164371
-186487.906925     8258058.035417
-186483.692514     8258039.826466
-186477.564370     8258025.359716
-186471.430384     8258011.519326
-186465.904971     8257999.564100
-186454.761046     8257985.678472
-186441.720919     8257973.654816
-186429.318573     8257960.384142
-186419.479430     8257940.870763
-186410.220028     8257926.375500
-186400.293629     8257916.260202
-186387.891287     8257902.989145
-186372.351842     8257890.316317
-186367.482118     8257875.234613
-186376.342889     8257865.290011
-186388.885448     8257863.524603
-186410.195682     8257861.839034
-186425.225874     8257861.975900
-186445.183830     8257870.929336
-186463.251802     8257881.119154
-186478.843828     8257888.153212
-186493.189117     8257894.549503
-186506.299733     8257899.054930
-186520.041911     8257902.939312
-186533.158369     8257906.818378
-186548.738710     8257915.105539
-186583.796963     8257916.677991
-186596.913424     8257920.556675
-186613.781015     8257925.096313
-186631.234573     8257934.027327
-186648.090483     8257939.819685
-186661.833039     8257943.704452
-186676.230909     8257944.461974
-186692.513680     8257944.610246
-186706.326345     8257940.976781
-186719.483320     8257940.469794
-186737.685667     8257936.249506
-186763.320934     8257940.868983
-186777.069334     8257944.127009
-186788.921148     8257949.247386
-186807.661956     8257954.430877
-186825.805880     8257956.475719
-186843.340849     8257956.635394
-186858.458674     8257947.374565
-186870.561705     8257925.554959
-186881.324905     8257913.121645
-186896.448575     8257903.234073
-186914.082860     8257892.743333
-186927.901368     8257888.483125
-186941.678980     8257888.608586
-186956.082691     8257888.739747
-186968.068877     8257879.450401
-186975.694977     8257867.614934
-186986.493229     8257851.422695
-187001.651951     8257837.776198
-187016.716813     8257834.154136
-187023.500650     8257845.494025
-187023.372119     8257859.277388
-187023.237748     8257873.687111
-187022.447684     8257891.223695
-187021.541157     8257921.290542
-187025.140772     8257938.240685
-187033.762390     8257953.983350
-187048.681195     8257966.024113
-187064.290748     8257971.178708
-187084.945672     8257972.620002
-187105.043841     8257966.537356
-187119.500516     8257961.029751
-187132.663332     8257959.896404
-187148.354675     8257956.280046
-187161.570073     8257949.507929
-187174.756639     8257945.868762
-187187.287512     8257945.356456
-187206.753741     8257939.894469
-187223.674297     8257938.795340
-187236.825428     8257938.915095
-187258.106451     8257940.362091
-187271.872377     8257941.740654
-187284.959245     8257948.751899
-187305.555364     8257956.458321
-187319.941931     8257958.468948
-187339.320522     8257962.405038
-187351.125981     8257972.537446
-187370.311778     8257997.148389
-187383.375276     8258006.665840
-187399.605469     8258012.452500
-187422.080266     8258020.176029
-187434.529350     8258028.434676
-187443.823805     8258039.171014
-187452.498005     8258049.274909
-187467.323335     8258071.339727
-187479.725678     8258084.610784
-187492.766190     8258096.634061
-187503.962690     8258104.881684
-187514.521410     8258114.376326
-187526.308961     8258126.388193
-187537.429895     8258142.780413
-187545.425032     8258158.517373
-187554.713646     8258169.880071
-187565.822516     8258187.525007
-187580.103541     8258200.812789
-187598.183197     8258209.749504
-187616.830148     8258224.957047
-187629.279231     8258233.215694
-187642.396075     8258237.094382
-187652.977779     8258244.083197
-187674.153642     8258256.807351
-187694.105754     8258266.387530
-187712.753090     8258281.594694
-187723.973343     8258287.336116
-187733.917267     8258295.571951
-187744.475605     8258305.066589
-187757.498970     8258318.969714
-187773.032574     8258332.268902
-187788.542808     8258348.074296
-187796.584301     8258358.799224
-187807.722764     8258373.311599
-187815.108947     8258387.163391
-187823.783148     8258397.267286
-187833.083444     8258407.377264
-187854.235939     8258422.607241
-187876.699051     8258431.583872
-187891.688347     8258436.106406
-187912.852524     8258450.083662
-187924.680589     8258457.709858
-187947.799775     8258463.559632
-187972.803103     8258468.799768
-187993.428051     8258473.373621
-188015.938669     8258477.337849
-188029.060588     8258480.590169
-188043.423020     8258485.106995
-188055.912997     8258488.980357
-188075.918455     8258492.921772
-188094.091590     8258491.834050
-188115.418586     8258488.269011
-188129.822679     8258488.400176
-188149.862425     8258488.582660
-188165.507030     8258489.978330
-188177.991170     8258494.477669
-188190.486991     8258497.724288
-188219.295177     8258497.986618
-188243.718378     8258498.209018
-188268.768443     8258498.437126
-188285.677696     8258498.591103
-188304.465244     8258498.762184
-188325.131089     8258498.950369
-188343.918637     8258499.121450
-188368.348444     8258498.717497
-188398.449725     8258494.605562
-188417.278170     8258490.390975
-188434.859494     8258485.538619
-188447.425423     8258481.267006
-188462.461455     8258480.777512
-188476.906445     8258476.523009
-188495.108792     8258472.302721
-188512.023120     8258471.830332
-188530.219622     8258468.236786
-188542.750499     8258467.724098
-188557.153828     8258467.855256
-188570.931822     8258467.980719
-188591.597667     8258468.168904
-188606.001760     8258468.300069
-188625.386196     8258471.609417
-188644.788158     8258473.039302
-188659.783298     8258476.935093
-188674.175705     8258478.319361
-188687.923724     8258481.577382
-188707.917497     8258486.771901
-188721.688882     8258487.524100
-188735.431060     8258491.408482
-188752.925514     8258495.953828
-188770.396602     8258503.004997
-188786.626409     8258508.792036
-188799.707432     8258516.430024
-188814.638305     8258527.217688
-188826.455449     8258536.096993
-188840.776984     8258544.999487
-188853.840485     8258554.516555
-188869.455875     8258559.045173
-188884.451015     8258562.940964
-188897.590464     8258564.313440
-188910.086285     8258567.560059
-188935.751524     8258569.047360
-188950.154853     8258569.178518
-188967.736945     8258564.325786
-188988.414472     8258563.261251
-189016.636695     8258559.131823
-189035.465136     8258554.917619
-189049.278183     8258551.284157
-189063.137206     8258542.638279
-189080.081510     8258539.033331
-189095.790383     8258533.537128
-189110.240449     8258528.656258
-189123.461688     8258521.257781
-189141.072988     8258513.272867
-189157.454696     8258502.770338
-189171.934738     8258494.756910
-189189.521907     8258489.277811
-189210.223568     8258485.707078
-189229.104595     8258475.853721
-189233.733423     8258449.580397
-189243.284940     8258432.750009
-189254.633724     8258424.708068
-189284.781741     8258415.584105
-189303.580975     8258414.502083
-189318.662984     8258409.000173
-189331.855776     8258404.734267
-189344.380809     8258404.848321
-189360.663198     8258404.996590
-189375.740127     8258400.121429
-189387.679193     8258395.844107
-189405.354756     8258380.967702
-189416.105888     8258369.787488
-189426.863629     8258357.980537
-189445.124398     8258347.495119
-189469.594337     8258342.705491
-189484.051012     8258337.197886
-189497.874980     8258332.311315
-189509.820651     8258327.407640
-189524.950162     8258316.893709
-189539.412678     8258310.759744
-189558.943170     8258298.406265
-189580.317668     8258289.829206
-189595.387992     8258285.580398
-189608.586625     8258280.688132
-189628.041169     8258276.479247
-189651.885009     8258271.683918
-189670.730980     8258265.589869
-189686.439853     8258260.093666
-189705.936058     8258251.499120
-189730.481946     8258238.564900
-189750.610090     8258229.349695
-189773.897940     8258217.030432
-189794.084507     8258201.550097
-189812.965531     8258191.697123
-189827.456493     8258182.430585
-189839.437220     8258173.767603
-189851.406262     8258166.357723
-189865.241914     8258160.218049
-189880.348055     8258152.210323
-189896.700552     8258144.840359
-189913.650701     8258140.608668
-189926.866096     8258133.836934
-189942.569124     8258128.967473
-189963.902728     8258124.775699
-189982.110151     8258119.929044
-189998.440042     8258115.065292
-190017.859534     8258114.615332
-190033.556721     8258110.372232
-190046.087594     8258109.859926
-190063.698130     8258101.875005
-190081.379538     8258086.371858
-190097.211097     8258067.719035
-190109.238561     8258054.044025
-190118.111397     8258042.846706
-190140.152893     8258029.889298
-190154.602959     8258025.008428
-190170.967138     8258016.385744
-190183.550593     8258010.234668
-190195.490423     8258005.957353
-190210.526460     8258005.467477
-190231.784112     8258009.420678
-190244.894346     8258013.926101
-190259.257546     8258018.442551
-190271.108974     8258023.563307
-190287.322024     8258031.229433
-190306.648037     8258040.803911
-190322.854474     8258049.097155
-190337.826243     8258055.499151
-190352.798012     8258061.901148
-190370.888593     8258069.584371
-190392.778188     8258072.916531
-190412.818699     8258073.099021
-190428.515882     8258068.856304
-190451.160107     8258058.410802
-190463.105778     8258053.507127
-190478.182711     8258048.631583
-190497.046208     8258040.658071
-190522.172222     8258032.741586
-190542.299602     8258023.526375
-190556.791329     8258014.259844
-190571.931761     8258002.492803
-190585.838282     8257988.835287
-190596.630311     8257973.269404
-190604.929630     8257956.427614
-190608.803832     8257943.931568
-190613.345030     8257927.055557
-190619.220979     8257901.420001
-190623.745415     8257886.423459
-190628.251557     8257873.306755
-190635.286228     8257857.706657
-190645.434632     8257844.014536
-190659.955571     8257831.615441
-190670.115660     8257816.670217
-190682.780904     8257801.748188
-190689.786365     8257789.280656
-190696.780908     8257778.065851
-190705.102829     8257758.718231
-190709.650632     8257741.215866
-190709.779163     8257727.432503
-190709.971957     8257706.757650
-190710.182281     8257684.202952
-190709.783264     8257659.763465
-190706.242072     8257636.548192
-190706.429026     8257616.499699
-190706.627661     8257595.198486
-190706.826299     8257573.896890
-190706.346257     8257558.228363
-190706.550737     8257536.300408
-190706.726005     8257517.505017
-190706.924644     8257496.203421
-190707.076541     8257479.914236
-190707.245969     8257461.745205
-190707.438763     8257441.070352
-190707.614031     8257422.274961
-190707.765929     8257405.985776
-190707.917830     8257389.696208
-190708.098939     8257370.274457
-190708.309259     8257347.720141
-190708.542950     8257322.659620
-190708.759115     8257299.478562
-190708.957754     8257278.176966
-190709.138863     8257258.755216
-190709.337501     8257237.453620
-190705.228633     8257207.967515
-190705.438953     8257185.413200
-190701.230002     8257166.577886
-190701.364373     8257152.168163
-190699.708083     8257128.343641
-190695.458238     8257113.893612
-190691.899516     8257092.558184
-190687.656276     8257077.481802
-190687.157944     8257063.692731
-190680.397856     8257049.847022
-190671.822978     8257029.091948
-190663.237176     8257009.590365
-190658.355388     8256995.761377
-190658.536497     8256976.339626
-190663.066009     8256960.716717
-190664.441661     8256947.571124
-190665.892494     8256926.281313
-190666.038551     8256910.618488
-190666.184607     8256894.955662
-190667.560259     8256881.810069
-190673.336125     8256866.825304
-190681.571180     8256856.875005
-190699.252588     8256841.371858
-190709.190668     8256850.234435
-190719.678897     8256867.247306
-190733.954460     8256881.161834
-190748.223417     8256895.702715
-190766.853223     8256912.789724
-190789.252836     8256928.657852
-190801.034160     8256941.296459
-190813.407295     8256957.699698
-190824.463965     8256980.983408
-190835.602428     8256995.495782
-190843.643921     8257006.220711
-190851.680338     8257017.572007
-190863.485797     8257027.704415
-190878.410060     8257039.118815
-190898.942298     8257053.716730
-190923.863832     8257067.728201
-190939.391596     8257081.653749
-190953.637947     8257098.700842
-190964.793172     8257111.333747
-190975.990058     8257119.580991
-190987.186176     8257127.828611
-191002.152104     8257134.856967
-191022.128351     8257141.930948
-191043.971205     8257150.275518
-191064.561101     8257158.608296
-191081.400246     8257166.280506
-191097.641742     8257170.814060
-191113.871549     8257176.601099
-191132.618201     8257181.157847
-191153.278969     8257181.972400
-191173.289504     8257185.287448
-191192.703151     8257185.464231
-191207.727499     8257186.227839
-191221.469676     8257190.112221
-191235.873769     8257190.243386
-191252.782257     8257190.397356
-191270.323449     8257189.930675
-191294.133002     8257188.894278
-191309.830189     8257184.651178
-191323.613260     8257184.150274
-191343.073648     8257179.314647
-191360.649892     8257175.089040
-191375.059065     8257174.593456
-191390.715356     8257174.736023
-191407.624608     8257174.890000
-191420.729002     8257180.021783
-191431.920044     8257188.895770
-191444.357442     8257198.407519
-191464.929812     8257208.619760
-191481.798167     8257213.159405
-191486.942093     8257198.795299
-191487.076465     8257184.385576
-191487.228366     8257168.096008
-191488.082311     8257143.667931
-191492.630114     8257126.165566
-191499.740738     8257102.420494
-191495.648687     8257091.413528
-END
-LINE3D
-HEIGHT 1030.000000
-186601.474090     8258937.000000
-186607.552957     8258928.798380
-186616.478371     8258911.962674
-186627.294152     8258893.890590
-186639.473129     8258863.926773
-186651.617442     8258837.721120
-186661.906058     8258808.992916
-186670.217062     8258790.898023
-186677.222522     8258778.430491
-186686.715613     8258767.865616
-186698.104911     8258755.438004
-186715.107256     8258745.567922
-186735.890328     8258733.225850
-186764.176815     8258722.204932
-186781.846159     8258707.954501
-186797.004878     8258694.308387
-186808.429228     8258678.121849
-186822.967314     8258663.842905
-186838.775502     8258647.696287
-186855.807059     8258634.693641
-186872.212516     8258621.685292
-186892.363267     8258609.963876
-186908.780413     8258595.702043
-186925.800288     8258583.952116
-186938.442166     8258571.535910
-186951.054832     8258562.252268
-186967.454067     8258549.870277
-186988.857773     8258538.161035
-187007.750485     8258527.054575
-187023.500250     8258517.173088
-187034.268912     8258504.113028
-187045.600170     8258497.950549
-187053.225884     8258486.115461
-187067.202135     8258464.939325
-187076.759492     8258447.482578
-187081.271861     8258433.739134
-187086.404483     8258420.628135
-187096.547428     8258407.562377
-187109.183462     8258395.772913
-187114.316088     8258382.661531
-187114.462145     8258366.998706
-187107.742572     8258348.767326
-187093.479077     8258333.599699
-187084.805258     8258323.495808
-187072.362019     8258314.610419
-187057.425302     8258304.449497
-187041.769012     8258304.306929
-187024.813404     8258309.164983
-187005.984959     8258313.379570
-186991.505299     8258321.393001
-186978.295746     8258327.538376
-186965.688923     8258336.195275
-186951.817833     8258346.094252
-186935.406531     8258359.729343
-186913.382564     8258370.806906
-186898.908745     8258378.193978
-186878.213307     8258381.138354
-186861.298596     8258381.610741
-186845.630620     8258382.721275
-186831.853008     8258382.595815
-186814.329724     8258381.183038
-186794.956974     8258376.620588
-186780.629212     8258368.344834
-186768.782860     8258362.597711
-186755.075352     8258354.954400
-186745.160643     8258343.585618
-186733.958295     8258335.965120
-186718.986526     8258329.563123
-186702.809300     8258318.137314
-186690.348531     8258311.131770
-186680.491859     8258293.498236
-186671.203245     8258282.135538
-186661.891264     8258273.278662
-186649.459706     8258263.140553
-186627.540900     8258262.940958
-186614.354716     8258266.580128
-186601.817999     8258267.719176
-186585.488490     8258272.582932
-186566.735993     8258268.652925
-186552.367338     8258264.762456
-186544.319619     8258254.664266
-186523.161282     8258240.060650
-186504.461368     8258230.491874
-186488.278298     8258219.692807
-186475.273223     8258203.910226
-186467.277703     8258188.173263
-186461.149559     8258173.706513
-186449.373697     8258160.441160
-186436.947984     8258149.676309
-186414.618858     8258126.290333
-186397.229946     8258110.467833
-186377.962355     8258094.628225
-186351.834979     8258075.593320
-186336.353956     8258056.655362
-186325.204193     8258043.395711
-186314.054427     8258030.136443
-186300.376134     8258019.360185
-186283.584110     8258006.675950
-186266.136775     8257997.118580
-186252.429271     8257989.474887
-186236.883981     8257977.428802
-186220.167909     8257956.599592
-186199.179378     8257923.827331
-186185.582879     8257904.279738
-186167.520748     8257893.463561
-186155.054139     8257887.084376
-186127.668720     8257868.664811
-186102.717975     8257857.785905
-186090.233839     8257853.286184
-186072.780278     8257844.355552
-186049.726119     8257831.614295
-186021.638275     8257821.333235
-185994.164840     8257812.311362
-185976.694138     8257805.259814
-185962.337165     8257800.116625
-185945.434136     8257799.336291
-185927.389531     8257786.640651
-185903.697210     8257775.146409
-185873.742369     8257763.595522
-185850.693669     8257750.227901
-185826.995503     8257739.360401
-185806.428595     8257728.521415
-185790.221773     8257720.228549
-185772.142498     8257711.291838
-185750.978317     8257697.314964
-185736.059130     8257685.274197
-185724.897682     8257673.267649
-185715.597383     8257663.158053
-185699.536999     8257639.202366
-185689.019176     8257625.322056
-185677.828516     8257616.448073
-185667.269796     8257606.953431
-185655.499390     8257593.062098
-185646.199094     8257582.952120
-185635.693335     8257567.819093
-185630.864129     8257548.351336
-185630.372401     8257533.935912
-185634.878925     8257520.819211
-185647.491592     8257511.535569
-185658.213898     8257503.487541
-185680.752959     8257504.319579
-185691.311679     8257513.814221
-185703.684814     8257530.217461
-185712.352788     8257540.948094
-185717.252102     8257552.897619
-185730.268862     8257567.427098
-185743.964684     8257576.323511
-185767.060118     8257584.679487
-185783.933554     8257588.592382
-185799.560633     8257591.867515
-185813.338245     8257591.992975
-185829.661913     8257587.755579
-185849.075560     8257587.932362
-185870.368268     8257588.126255
-185898.549591     8257588.382877
-185918.589337     8257588.565361
-185937.991682     8257589.995249
-185955.491598     8257593.913849
-185976.146140     8257595.355140
-186005.539146     8257600.008835
-186036.804989     8257605.305998
-186063.681151     8257611.189984
-186085.512323     8257620.787274
-186104.821193     8257632.241218
-186122.280213     8257640.545485
-186136.596290     8257650.074342
-186154.681791     8257658.384315
-186165.889976     8257665.378835
-186179.000211     8257669.884258
-186192.748611     8257673.142284
-186213.379786     8257677.089397
-186235.890022     8257681.053622
-186258.434927     8257681.258918
-186275.302901     8257685.798559
-186293.405546     8257692.229066
-186312.790364     8257695.538417
-186326.532920     8257699.423184
-186340.901579     8257703.313271
-186353.379874     8257708.439353
-186363.317953     8257717.301930
-186376.405203     8257724.313179
-186389.486226     8257731.951167
-186402.543883     8257742.094978
-186418.692279     8257756.653356
-186436.771557     8257765.589685
-186463.636415     8257772.726776
-186486.140427     8257777.317358
-186516.826910     8257777.596791
-186541.876975     8257777.824900
-186560.664523     8257777.995981
-186578.831432     8257777.534997
-186598.865719     8257778.343844
-186626.350835     8257786.112997
-186653.847254     8257792.629044
-186677.603843     8257797.231414
-186698.241241     8257800.552171
-186718.907468     8257800.740359
-186743.331052     8257800.962763
-186774.017534     8257801.242197
-186795.942181     8257800.815431
-186817.269945     8257797.250017
-186834.810755     8257796.783332
-186852.357409     8257795.689904
-186869.927430     8257792.090654
-186884.963466     8257791.600778
-186898.746919     8257791.099878
-186918.160566     8257791.276660
-186933.190758     8257791.413527
-186946.967988     8257791.538983
-186969.560013     8257786.732255
-186984.022147     8257780.598286
-187003.576010     8257765.738603
-187018.699677     8257755.851414
-187036.907868     8257751.004384
-187051.323260     8257749.882825
-187074.500491     8257749.467083
-187091.403134     8257750.247796
-187112.034691     8257754.194913
-187138.296057     8257758.820092
-187162.690812     8257762.175064
-187178.335417     8257763.570734
-187192.739128     8257763.701895
-187205.264160     8257763.815949
-187232.866125     8257759.054459
-187251.688726     8257755.466615
-187279.875890     8257755.096877
-187300.588858     8257750.272655
-187319.382247     8257749.817376
-187340.048474     8257750.005565
-187359.468345     8257749.555991
-187384.518409     8257749.784099
-187413.290779     8257753.805347
-187433.921954     8257757.752461
-187452.633550     8257766.068517
-187468.869584     8257771.228817
-187482.600076     8257776.366301
-187503.805150     8257785.957890
-187526.221525     8257799.946549
-187544.874702     8257814.527353
-187562.246470     8257832.229319
-187575.251544     8257848.011900
-187587.653887     8257861.282957
-187600.056233     8257874.553632
-187609.362373     8257884.036868
-187616.766082     8257896.009198
-187626.066382     8257906.118794
-187642.741943     8257931.333292
-187663.162412     8257957.835100
-187677.385396     8257977.388016
-187690.402156     8257991.917494
-187700.932046     8258004.544705
-187710.214816     8258016.534145
-187721.996140     8258029.172752
-187733.128759     8258044.311869
-187745.519420     8258058.835646
-187756.060231     8258070.209747
-187771.552939     8258087.894602
-187788.918863     8258106.223311
-187801.912252     8258123.258995
-187811.195025     8258135.248053
-187819.851696     8258147.231793
-187827.272935     8258157.324278
-187841.490074     8258177.503936
-187851.387261     8258190.751798
-187864.415702     8258204.028557
-187877.491649     8258212.292912
-187889.964100     8258218.045736
-187906.199751     8258223.206033
-187921.200732     8258226.475464
-187936.851181     8258227.244392
-187951.845553     8258231.140558
-187969.345852     8258235.059162
-187991.258818     8258235.885117
-188021.910244     8258239.923858
-188046.299158     8258243.905190
-188068.217965     8258244.104785
-188088.872124     8258245.546072
-188110.790931     8258245.745667
-188140.219375     8258246.640058
-188170.278994     8258246.913784
-188197.828374     8258247.791447
-188225.342701     8258252.428034
-188255.349742     8258258.340148
-188288.459590     8258267.413729
-188315.353664     8258271.417873
-188341.023983     8258272.278425
-188369.193624     8258273.787767
-188397.374947     8258274.044389
-188422.425012     8258274.272497
-188448.089490     8258275.759409
-188476.861856     8258279.781039
-188512.552816     8258280.732457
-188545.117594     8258281.028995
-188570.167659     8258281.257103
-188590.195720     8258282.692690
-188613.993587     8258282.909395
-188635.327192     8258278.717621
-188650.398280     8258274.468819
-188662.987576     8258267.691383
-188675.588557     8258259.660844
-188691.291589     8258254.791002
-188705.753340     8258248.657030
-188719.578072     8258243.770466
-188734.660077     8258238.268937
-188756.619781     8258234.082864
-188776.080930     8258229.247626
-188788.646859     8258224.976012
-188801.171891     8258225.090066
-188819.332577     8258225.255439
-188838.746989     8258225.432228
-188858.757523     8258228.747277
-188873.752663     8258232.643069
-188895.636414     8258236.601971
-188917.508483     8258241.813593
-188934.984647     8258248.238395
-188947.468783     8258252.738117
-188974.333644     8258259.874826
-189003.106014     8258263.896074
-189038.802815     8258264.221132
-189060.721622     8258264.420727
-189077.056589     8258258.930608
-189091.494973     8258255.302458
-189112.846104     8258249.231221
-189139.833652     8258243.211310
-189162.442821     8258236.525116
-189181.909050     8258231.063128
-189197.664657     8258220.555280
-189212.805853     8258208.788246
-189225.459416     8258195.118937
-189243.731867     8258183.380799
-189268.278523     8258170.446203
-189292.806885     8258159.391445
-189311.676226     8258150.791191
-189324.909912     8258142.140000
-189341.262409     8258134.770036
-189356.994648     8258126.768011
-189374.564291     8258123.168375
-189390.284845     8258116.419453
-189408.487191     8258112.199165
-189420.432862     8258107.295490
-189432.992947     8258103.650619
-189446.184975     8258099.384706
-189460.647490     8258093.250741
-189476.379730     8258085.248716
-189498.374489     8258077.303335
-189522.886089     8258068.128047
-189547.408606     8258057.700031
-189566.910652     8258048.479125
-189588.296074     8258038.648574
-189608.435904     8258028.180267
-189635.457740     8258018.401423
-189663.118124     8258007.375186
-189688.267508     8257996.952496
-189705.884653     8257988.340839
-189723.495188     8257980.355918
-189739.244953     8257970.474430
-189756.253525     8257959.977609
-189777.018689     8257949.514997
-189790.264060     8257939.610704
-189804.123083     8257930.964825
-189816.103806     8257922.302225
-189829.325045     8257914.903748
-189839.438397     8257904.970552
-189859.589908     8257893.249524
-189877.832387     8257884.643562
-189904.223048     8257875.485384
-189921.745949     8257876.898158
-189932.316737     8257885.139701
-189942.213920     8257898.387946
-189953.410806     8257906.635190
-189966.474303     8257916.152641
-189999.653495     8257917.707982
-190022.187483     8257919.166005
-190038.469872     8257919.314274
-190051.667741     8257914.422002
-190073.065609     8257903.338737
-190087.480623     8257902.216793
-190103.804673     8257897.979401
-190124.482199     8257896.914866
-190143.907532     8257895.838546
-190162.080667     8257894.750823
-190179.030816     8257890.519133
-190196.617981     8257885.040416
-190211.121394     8257874.520784
-190224.968731     8257867.128007
-190244.464172     8257858.533455
-190267.138369     8257844.955777
-190292.299438     8257833.279985
-190315.569762     8257822.840184
-190333.824687     8257812.981508
-190353.337653     8257802.507493
-190374.700469     8257795.183154
-190394.166695     8257789.721548
-190417.413651     8257781.787570
-190438.793993     8257772.583768
-190459.571604     8257760.868442
-190473.453994     8257749.716741
-190486.733655     8257736.053133
-190503.812335     8257718.038080
-190524.665133     8257698.177772
-190543.592894     8257683.312770
-190557.499419     8257669.654871
-190569.526884     8257655.979860
-190579.043344     8257642.908781
-190590.432260     8257630.481165
-190595.038486     8257606.713669
-190593.960792     8257587.906869
-190584.086976     8257572.152802
-190569.179474     8257558.858933
-190550.403610     8257557.434749
-190532.904076     8257553.516152
-190517.335420     8257543.975889
-190516.210988     8257530.181117
-190516.362886     8257513.891931
-190516.479731     8257501.361671
-190512.289070     8257480.646902
-190512.476023     8257460.598408
-190512.042719     8257439.917854
-190512.826560     8257423.007627
-190517.361917     8257406.757975
-190517.490444     8257392.974995
-190518.889462     8257377.323579
-190519.035519     8257361.660753
-190519.901153     8257335.979191
-190520.099788     8257314.677978
-190520.257530     8257297.762050
-190520.374376     8257285.231789
-190520.514592     8257270.195324
-190508.808452     8257249.412118
-190499.613317     8257228.024982
-190491.067647     8257204.137724
-190487.456347     8257188.440684
-190482.632981     8257168.346566
-190482.135410     8257154.557885
-190482.258100     8257141.400882
-190482.386630     8257127.617519
-190483.141256     8257113.840239
-190487.729956     8257091.952207
-190491.024800     8257074.438050
-190492.411369     8257060.039729
-190497.076017     8257030.007104
-190499.182164     8257005.590047
-190499.954319     8256989.932923
-190500.838240     8256962.372288
-190501.698030     8256937.317468
-190503.113810     8256919.786583
-190504.506988     8256904.761527
-190506.022088     8256876.579843
-190506.191515     8256858.410813
-190506.372624     8256838.989062
-190506.547892     8256820.193672
-190506.699790     8256803.904486
-190507.501157     8256785.114797
-190508.906020     8256768.836638
-190512.809433     8256753.208028
-190519.223847     8256736.975869
-190525.649946     8256719.490608
-190530.232041     8256698.228928
-190537.899416     8256682.008179
-190541.878782     8256658.234593
-190543.282877     8256641.956811
-190544.681896     8256626.305395
-190545.477422     8256608.142065
-190546.284630     8256588.726016
-190547.665358     8256574.954056
-190550.316574     8256559.314042
-190554.190776     8256546.817997
-190559.990777     8256529.327034
-190566.358453     8256518.106903
-190578.333336     8256510.070663
-190602.763146     8256509.666328
-190619.039691     8256510.441339
-190635.287028     8256514.348533
-190651.528520     8256518.882470
-190666.552871     8256519.645696
-190683.374490     8256529.197368
-190698.908090     8256542.496939
-190710.022422     8256559.515129
-190720.546469     8256572.769082
-190731.034698     8256589.781953
-190739.071115     8256601.133249
-190757.161693     8256608.816855
-190770.898794     8256613.327603
-190792.811756     8256614.153941
-190809.053249     8256618.687877
-190825.288900     8256623.848174
-190842.133889     8256630.893641
-190858.948899     8256641.072049
-190883.279390     8256651.318511
-190902.582033     8256663.399194
-190921.270265     8256674.220691
-190939.859175     8256695.693367
-190947.239517     8256710.171520
-190958.296188     8256733.455230
-190967.485482     8256755.468726
-190978.501256     8256783.138103
-190987.684710     8256805.777960
-190995.661939     8256823.394379
-191001.152300     8256839.108530
-191008.497586     8256857.345990
-191018.348800     8256875.605887
-191029.486496     8256890.118637
-191044.382316     8256904.665226
-191056.146878     8256919.183302
-191069.807262     8256931.839019
-191080.986622     8256941.965726
-191093.365598     8256957.742606
-191103.291992     8256967.858285
-191113.171653     8256982.985610
-191129.366408     8256992.531574
-191141.809647     8257001.416964
-191154.920646     8257005.922394
-191169.885810     8257012.950743
-191189.282696     8257015.006995
-191211.224869     8257012.700767
-191226.927897     8257007.831307
-191245.826451     8256996.098488
-191257.156944     8256989.936002
-191270.981675     8256985.049438
-191284.904962     8256969.512069
-191296.914900     8256957.716521
-191308.942365     8256944.041511
-191324.094478     8256931.021750
-191336.753882     8256916.726081
-191349.407445     8256903.056772
-191361.434910     8256889.381762
-191374.714571     8256875.718154
-191385.519046     8256858.899559
-191398.851290     8256839.597181
-191413.395595     8256824.692263
-191427.277989     8256813.540179
-191437.414707     8256801.101161
-191448.166604     8256789.920953
-191462.136628     8256769.371557
-191469.177140     8256753.145099
-191477.488144     8256735.050207
-191485.827596     8256713.822742
-191496.608703     8256699.509969
-191506.745422     8256687.070951
-191528.775229     8256675.367027
-191543.290327     8256663.594292
-191556.529092     8256654.316352
-191574.174683     8256642.572123
-191591.873618     8256625.189513
-191603.292509     8256609.629339
-191614.113749     8256590.930892
-191624.876566     8256578.497574
-191634.990679     8256568.564768
-191645.168294     8256551.740082
-191655.925270     8256539.933125
-191664.809791     8256527.482703
-191676.187786     8256516.308197
-191684.422074     8256506.358272
-191692.680496     8256493.902150
-191704.209628     8256466.438069
-191713.726088     8256453.366989
-191721.346727     8256442.158267
-191735.896112     8256426.626600
-191745.383365     8256416.687703
-191757.387459     8256405.518897
-191769.374026     8256396.229555
-191781.939955     8256391.957941
-191797.730617     8256377.690786
-191810.349125     8256367.780785
-191822.353222     8256356.611597
-191834.398212     8256341.057124
-191847.701241     8256324.887694
-191860.986744     8256310.597726
-191872.370583     8256298.796477
-191885.012461     8256286.380271
-191898.274593     8256274.596508
-191916.558733     8256261.604885
-191931.096433     8256247.326320
-191941.233152     8256234.887302
-191949.520785     8256219.298614
-191958.434518     8256203.715628
-191966.066077     8256191.253797
-191974.956439     8256178.177016
-191982.605527     8256163.835340
-191990.243692     8256150.747156
-191999.110687     8256140.176198
-END
-LINE3D
-HEIGHT 1030.000000
-192002.914781     8256135.198385
-192018.769710     8256114.039357
-192025.149072     8256101.566123
-192037.094743     8256096.662448
-192045.966814     8256085.465123
-192057.414917     8256066.772383
-192063.858542     8256047.407660
-192073.456796     8256025.565245
-192081.111726     8256010.597209
-192096.323026     8255991.312324
-192104.634031     8255973.217432
-192113.536078     8255958.887548
-192122.413993     8255947.063480
-192149.518387     8255928.513308
-192166.555406     8255914.883915
-192181.064659     8255903.737923
-192189.931654     8255893.166964
-192199.459800     8255878.842781
-192208.976260     8255865.771702
-192221.056306     8255846.457921
-192231.895072     8255825.880011
-192240.141809     8255814.676991
-192249.037251     8255800.973460
-192256.646204     8255791.017842
-192261.772604     8255778.533199
-192264.423820     8255762.893185
-192265.172609     8255749.741884
-192251.740071     8255712.652388
-192246.881653     8255696.317196
-192238.834316     8255686.219010
-192230.189326     8255672.982550
-192219.654359     8255660.981706
-192204.231760     8255635.778618
-192192.525620     8255614.995412
-192187.087841     8255593.642491
-192182.211894     8255579.187143
-192171.097566     8255562.168571
-192160.591042     8255547.035537
-192148.159488     8255536.897046
-192128.903583     8255519.804335
-192118.339401     8255510.936439
-192107.844566     8255494.549921
-192102.981068     8255478.841478
-192102.594501     8255453.148896
-192102.113695     8255437.480362
-192102.869089     8255423.702707
-192107.462865     8255401.188308
-192112.027433     8255381.806091
-192119.097921     8255362.447075
-192123.048072     8255341.806437
-192129.456645     8255326.200638
-192135.859377     8255311.221200
-192148.600573     8255288.154387
-192163.753452     8255275.134442
-192178.899725     8255262.741040
-192195.323093     8255247.853042
-192209.872478     8255232.321375
-192220.061777     8255214.243777
-192232.065873     8255203.074781
-192242.179222     8255193.141776
-192253.568903     8255180.714167
-192272.531719     8255162.089857
-192295.842938     8255147.264580
-192309.076625     8255138.613199
-192319.786862     8255131.818460
-192333.043153     8255120.661058
-192345.041406     8255110.118613
-192355.183967     8255097.053043
-192367.790791     8255088.395953
-192380.432669     8255075.979747
-192392.419237     8255066.690404
-192409.467939     8255051.808100
-192422.742522     8255038.771051
-192435.981288     8255029.493111
-192453.691142     8255010.857391
-192471.395919     8254992.848231
-192490.364578     8254973.597370
-192505.488247     8254963.709989
-192521.232171     8254954.454862
-192538.187397     8254949.596804
-192552.696650     8254938.450811
-192567.146718     8254933.569750
-192579.765227     8254923.659558
-192596.832220     8254906.897798
-192611.334867     8254896.378158
-192622.063395     8254887.703964
-192636.536832     8254880.316890
-192653.522033     8254872.326274
-192674.310566     8254859.357647
-192702.602891     8254847.710560
-192724.644386     8254834.753343
-192747.927158     8254823.060638
-192767.451808     8254811.333711
-192796.376075     8254799.065773
-192826.594200     8254782.423578
-192857.479319     8254761.401607
-192880.924911     8254732.166416
-192906.840606     8254706.713345
-192932.124362     8254681.880932
-192953.574812     8254665.158897
-192966.240058     8254650.236677
-192978.870253     8254639.073382
-192989.627227     8254627.266616
-193000.384966     8254615.459857
-193012.470853     8254595.519716
-193027.002711     8254581.867703
-193042.173117     8254566.968295
-193063.570987     8254555.884839
-193080.590478     8254544.135100
-193095.731672     8254532.368257
-193108.391078     8254518.072397
-193121.038796     8254505.029830
-193129.308904     8254491.320605
-193137.630827     8254471.972794
-193145.268993     8254458.884419
-193155.440764     8254442.686476
-193169.352367     8254428.402018
-193181.420726     8254410.341532
-193192.212755     8254394.775649
-193197.369130     8254379.158448
-193201.348493     8254355.385245
-193205.995615     8254327.232082
-193206.855405     8254302.177262
-193207.697668     8254279.001905
-193207.948885     8254252.061922
-193208.217630     8254223.242285
-193204.108762     8254193.756180
-193204.278187     8254175.587341
-193203.223862     8254154.274527
-193202.146933     8254135.467733
-193200.495721     8254111.016653
-193196.919475     8254091.560496
-193193.308175     8254075.863456
-193188.414701     8254063.287571
-193180.999307     8254052.568343
-193175.485578     8254039.360206
-193164.921397     8254030.492119
-193157.528607     8254017.266870
-193148.883618     8254004.030411
-193129.656924     8253983.805135
-193118.548436     8253966.160203
-193108.673856     8253950.406128
-193098.144729     8253937.778925
-193088.856117     8253926.416035
-193069.594369     8253909.949876
-193059.029424     8253901.081782
-193047.839145     8253892.207993
-193038.533005     8253882.724757
-193026.686652     8253876.977826
-193017.386354     8253866.868038
-193007.448272     8253858.005653
-192995.005032     8253849.120454
-192985.061109     8253840.884429
-192973.875908     8253831.384082
-192952.740941     8253814.274452
-192936.557871     8253803.475385
-192916.025633     8253788.877470
-192899.245676     8253774.940137
-192887.463587     8253762.301524
-192878.151605     8253753.444839
-192850.818387     8253729.386405
-192835.940859     8253712.960169
-192816.742611     8253689.602417
-192795.637620     8253669.360133
-192783.223592     8253657.342274
-192764.535361     8253646.520491
-192752.097963     8253637.008741
-192735.867389     8253631.221886
-192719.666793     8253622.302378
-192702.278263     8253606.479881
-192682.348755     8253594.393681
-192666.739203     8253589.238990
-192656.192550     8253578.491345
-192645.621763     8253570.249706
-192634.425642     8253562.002373
-192616.410249     8253546.174168
-192606.553959     8253528.540638
-192602.930975     8253514.096605
-192599.313068     8253499.026013
-192599.552601     8253473.339037
-192603.491833     8253453.951316
-192608.629917     8253440.213667
-192612.527488     8253425.211607
-192622.055635     8253410.887329
-192634.071414     8253398.465421
-192651.746980     8253383.588730
-192666.823909     8253378.713569
-192682.538623     8253372.591006
-192699.493849     8253367.732853
-192712.059777     8253363.461335
-192724.081399     8253350.412876
-192736.740804     8253336.117111
-192747.468567     8253327.442910
-192760.689805     8253320.044529
-192775.801789     8253311.410155
-192793.418932     8253302.798690
-192811.000257     8253297.946238
-192829.214287     8253292.473039
-192844.946527     8253284.470918
-192860.643713     8253280.227913
-192874.515184     8253270.329131
-192887.086955     8253265.431061
-192899.072758     8253256.141712
-192910.398173     8253250.605784
-192921.120095     8253242.558039
-192931.848622     8253233.883845
-192943.225854     8253222.709236
-192955.838520     8253213.425595
-192976.645345     8253198.577417
-192989.907478     8253186.793463
-193001.882362     8253178.757128
-193012.042449     8253163.812095
-193027.815585     8253151.424402
-193042.974306     8253137.778001
-193055.060194     8253117.837861
-193063.968083     8253102.881426
-193070.985228     8253089.160887
-193076.170050     8253070.411114
-193080.665274     8253058.547232
-193082.040159     8253045.401918
-193085.340843     8253027.261497
-193080.471503     8253012.179605
-193068.706942     8252997.661434
-193052.582294     8252980.597333
-193042.655133     8252970.481885
-193030.241103     8252958.464074
-193019.062509     8252948.337231
-193004.746050     8252938.808370
-192994.176028     8252930.566739
-192970.500849     8252917.193269
-192956.787884     8252910.176179
-192935.588652     8252899.958087
-192918.175989     8252886.641597
-192907.605966     8252878.400013
-192898.925925     8252868.922479
-192886.628741     8252844.374407
-192872.453261     8252819.809232
-192858.856377     8252800.261874
-192850.838253     8252787.030979
-192842.251687     8252767.529246
-192834.221114     8252755.551351
-192828.087128     8252741.711009
-192823.838044     8252727.261322
-192823.340476     8252713.472305
-192822.830458     8252700.936337
-192826.189564     8252676.530881
-192833.868626     8252659.056934
-192842.149653     8252644.094742
-192855.494343     8252623.539604
-192867.602835     8252601.093443
-192877.798740     8252582.389301
-192887.958828     8252567.444244
-192899.997976     8252552.516299
-192910.128852     8252540.703784
-192918.990004     8252530.759424
-192934.153804     8252516.486465
-192949.956151     8252500.966207
-192961.960245     8252489.797330
-192972.688773     8252481.123112
-192991.466875     8252461.571466
-193006.656920     8252439.510903
-END
-LINE3D
-HEIGHT 1070.000000
-184374.024909     8258937.000000
-184387.584827     8258923.679239
-184400.932600     8258902.496268
-184412.314657     8258890.694051
-184433.815035     8258868.331806
-184453.413254     8258848.458817
-184472.350638     8258832.338344
-184491.908291     8258816.850645
-184509.599321     8258800.093279
-184525.475133     8258776.426699
-184541.379915     8258749.628316
-184559.140114     8258725.352324
-184573.728624     8258705.434137
-184586.403776     8258689.257166
-184598.505013     8258667.436536
-184613.099317     8258646.891989
-184627.055963     8258627.594514
-184639.719520     8258612.671029
-184648.602325     8258600.219851
-184657.462329     8258590.274884
-184667.591863     8258578.461367
-184677.710191     8258567.900575
-184689.729906     8258554.851285
-184701.796371     8258536.789584
-184718.257680     8258517.514706
-184735.965717     8258498.877490
-184749.870202     8258485.218792
-184759.367872     8258474.025987
-184770.825266     8258454.079551
-184775.319021     8258442.215188
-184779.835956     8258427.845000
-184785.083283     8258402.202909
-184789.095853     8258374.670439
-184793.044290     8258354.029462
-184797.039095     8258328.376071
-184800.355669     8258308.355807
-184801.799443     8258287.692233
-184805.052264     8258274.563849
-184806.426494     8258261.418133
-184810.920246     8258249.554152
-184813.030660     8258224.510555
-184814.497618     8258201.340774
-184814.045031     8258182.539713
-184809.197597     8258164.952210
-184803.706706     8258149.238523
-184798.192253     8258136.030658
-184787.685473     8258120.898513
-184777.799352     8258106.398381
-184762.914732     8258090.599943
-184746.145724     8258075.410918
-184733.737172     8258062.767650
-184726.321325     8258052.049047
-184717.675752     8258038.813315
-184707.186362     8258021.801324
-184695.468012     8258002.272210
-184683.731896     8257984.622175
-184663.849156     8257967.525819
-184645.195761     8257952.946206
-184622.761993     8257940.839286
-184606.004578     8257924.397157
-184596.727141     8257911.782137
-184586.220361     8257896.649993
-184577.575175     8257883.413882
-184567.688672     8257868.913746
-184553.459481     8257849.988393
-184543.538588     8257839.247189
-184531.141624     8257825.351200
-184520.571099     8257817.110169
-184506.875248     8257808.214912
-184494.437718     8257798.704212
-184478.921234     8257783.526487
-184464.680452     8257765.854237
-184453.570785     8257748.210237
-184441.869442     8257726.801273
-184432.667346     8257706.041652
-184422.276481     8257678.378852
-184419.910908     8257663.320157
-184403.860698     8257638.112715
-184395.203729     8257626.129707
-184376.567716     8257609.671012
-184361.677493     8257594.498937
-184351.750611     8257584.384475
-184341.197663     8257574.263982
-184330.024053     8257563.511859
-184313.875513     8257548.954845
-184303.334153     8257537.581631
-184290.287747     8257526.185816
-184273.460784     8257517.261927
-184242.236560     8257507.581734
-184210.374673     8257499.148996
-184179.764927     8257490.727554
-184152.274896     8257483.587468
-184120.372252     8257479.540017
-184097.868941     8257474.950955
-184074.072346     8257474.736262
-184054.044908     8257473.302749
-184030.288883     8257468.702385
-184000.230248     8257468.431196
-183969.585922     8257463.768685
-183939.567665     8257459.111823
-183910.767156     8257458.225573
-183877.612181     8257454.166824
-183847.553546     8257453.895635
-183828.140590     8257453.720492
-183804.343995     8257453.505799
-183781.840681     8257448.917119
-183756.171291     8257448.058735
-183733.047321     8257442.837660
-183707.412703     8257438.220347
-183687.425835     8257432.401162
-183664.945516     8257425.305890
-183634.996994     8257413.131172
-183600.084939     8257395.898839
-183573.939971     8257378.745603
-183557.000000     8257369.222942
-END
-LINE3D
-HEIGHT 1080.000000
-184045.482525     8258937.000000
-184051.877018     8258926.289735
-184067.283045     8258885.701942
-184083.883639     8258851.390586
-184104.125700     8258829.643402
-184129.371675     8258808.567776
-184148.436558     8258778.664309
-184162.404601     8258758.114112
-184176.361253     8258738.815873
-184188.392748     8258724.513863
-184193.518367     8258712.028788
-184204.320721     8258695.208508
-184218.445438     8258657.741985
-184232.552575     8258622.155307
-184247.187643     8258597.224707
-184268.119524     8258568.591675
-184280.243753     8258544.264835
-184287.961350     8258522.404655
-184295.661371     8258502.423939
-184307.142140     8258479.971297
-184318.634310     8258456.265551
-184331.442755     8258425.679225
-184343.097390     8258384.431174
-184353.313857     8258363.219953
-184361.680899     8258338.859216
-184372.627943     8258306.376857
-184381.023963     8258278.883552
-184385.592868     8258258.874587
-184391.408689     8258239.503666
-184398.482449     8258219.517299
-184403.109500     8258193.243199
-184407.162257     8258161.325053
-184411.777716     8258136.304057
-184412.635990     8258111.249163
-184412.763492     8258097.465786
-184412.954744     8258076.790912
-184408.768155     8258055.449747
-184403.955492     8258034.103315
-184398.562744     8258007.738816
-184388.653251     8257995.744507
-184381.248801     8257983.773181
-184373.212108     8257972.422181
-184362.763475     8257951.024902
-184356.031462     8257934.046809
-184346.829366     8257913.287189
-184339.511661     8257891.917774
-184333.411704     8257874.318971
-184327.300155     8257857.973271
-184318.753302     8257834.086350
-184308.953922     8257810.188511
-184302.801804     8257798.228484
-184291.721119     8257777.451533
-184277.526509     8257754.767248
-184258.322382     8257732.037769
-184240.944499     8257714.963629
-184226.083253     8257696.658986
-184209.934710     8257682.102354
-184198.767088     8257670.723490
-184191.345064     8257660.631244
-184178.930714     8257648.614719
-184161.547228     8257632.166942
-184144.731854     8257621.990332
-184122.245737     8257615.521803
-184100.374291     8257610.312028
-184076.021173     8257602.573447
-184055.390657     8257598.628076
-184037.896864     8257594.084210
-184009.757391     8257589.444298
-183994.148176     8257584.291021
-183978.498395     8257583.523033
-183966.014498     8257579.024748
-183951.617239     8257578.268061
-183927.820836     8257578.053370
-183912.750758     8257582.303446
-183890.769198     8257588.997201
-183866.282781     8257595.668740
-183848.702245     8257600.522579
-183835.493566     8257606.669070
-183821.044146     8257611.551159
-183808.484908     8257615.197474
-183792.174090     8257618.183148
-183777.765049     8257618.679563
-183750.217062     8257617.804612
-183724.588242     8257612.560556
-183703.308281     8257611.115743
-183687.061216     8257607.209537
-183671.498365     8257597.044227
-183656.492231     8257594.402426
-183640.877221     8257589.875509
-183627.732291     8257589.130503
-183614.593349     8257587.758755
-183599.024704     8257578.219806
-183584.087922     8257568.060145
-183562.935467     8257552.831572
-183557.000000     8257547.261108
-END
-LINE3D
-HEIGHT 1090.000000
-183623.974043     8258937.000000
-183634.203489     8258920.641487
-183644.431735     8258898.177545
-183652.752410     8258878.829223
-183662.302241     8258861.997643
-183669.323836     8258847.650434
-183678.253390     8258830.186844
-183685.280786     8258815.212510
-183693.578278     8258798.370396
-183703.174469     8258776.527165
-183716.528037     8258754.717833
-183727.944866     8258739.156687
-183739.344312     8258725.474624
-183750.111886     8258712.414037
-183763.419087     8258695.617120
-183773.589378     8258679.418315
-183785.069963     8258656.964907
-183795.907081     8258636.386463
-183807.967561     8258618.951120
-183819.407573     8258600.883767
-183833.323645     8258585.972347
-183845.384125     8258568.537005
-183858.053476     8258552.987159
-183870.798172     8258529.292330
-183887.294444     8258506.258526
-183901.274082     8258484.454843
-183913.937639     8258469.531358
-183923.441099     8258457.712575
-183939.282136     8258437.805306
-183947.527470     8258426.601585
-183958.312243     8258411.661150
-183965.322441     8258398.566664
-183977.945428     8258388.028851
-183994.975235     8258375.024762
-184016.440649     8258356.421445
-184027.196636     8258344.613580
-184037.998795     8258327.793680
-184047.513847     8258314.721793
-184055.179287     8258298.500007
-184063.551932     8258273.512908
-184073.171303     8258249.163852
-184081.451413     8258234.200819
-184089.076089     8258222.365086
-184096.753121     8258204.890196
-184107.572666     8258186.190832
-184119.041843     8258164.991295
-184129.258501     8258143.780075
-184138.164677     8258128.823073
-184145.800949     8258115.733853
-184149.714806     8258098.851808
-184154.347651     8258071.951347
-184155.808620     8258049.408307
-184157.356717     8258017.467182
-184158.858447     8257990.538472
-184159.617814     8257976.134383
-184159.756908     8257961.097903
-184159.936568     8257941.676133
-184159.466977     8257924.754540
-184158.440478     8257900.309437
-184154.236503     8257880.847735
-184153.766913     8257863.926142
-184148.878718     8257850.724309
-184141.480065     8257838.126240
-184131.025447     8257817.355319
-184123.006330     8257804.124857
-184117.515057     8257788.411167
-184108.231823     8257776.422890
-184084.615083     8257756.786047
-184068.454948     8257743.482519
-184051.645562     8257732.679168
-184036.030552     8257728.152251
-184017.296016     8257722.344365
-183993.534196     8257718.370361
-183975.385351     8257716.953796
-183957.851180     8257716.795603
-183940.322614     8257716.010666
-183921.535920     8257715.841172
-183898.986051     8257716.264523
-183863.279857     8257717.195208
-183837.569895     8257720.722878
-183817.501700     8257723.674653
-183798.680233     8257727.264089
-183776.727648     8257730.825658
-183755.424511     8257731.886287
-183732.219593     8257735.436558
-183712.800843     8257735.887775
-183691.497703     8257736.948787
-183672.711008     8257736.779294
-183656.429168     8257736.632399
-183639.521066     8257736.479854
-183620.113904     8257735.678350
-183599.494984     8257730.479493
-183580.760447     8257724.671607
-183560.784983     8257717.598934
-183557.000000     8257715.774871
-END
-LINE3D-MASTER
-HEIGHT 1100.000000
-183557.000000     8258352.931453
-183566.876256     8258345.473027
-183582.641947     8258333.710742
-183598.413437     8258321.321713
-183613.564462     8258308.300292
-183629.353338     8258294.031799
-183643.286612     8258277.240148
-183655.353073     8258259.178829
-183666.155232     8258242.358929
-183676.308137     8258228.039589
-183684.553284     8258216.835484
-183694.683006     8258205.022351
-183702.916752     8258195.071351
-183712.472373     8258177.613792
-183722.062766     8258156.397304
-183732.911289     8258134.565372
-183741.145035     8258124.614372
-183755.147853     8258100.304864
-183759.026938     8258087.181747
-183759.780702     8258073.404020
-183761.241671     8258050.860981
-183756.985726     8258037.038057
-183752.114917     8258021.956760
-183746.606449     8258008.122535
-183731.095758     8257992.318450
-183721.163083     8257982.830348
-183708.696575     8257976.452217
-183683.821515     8257957.430816
-183665.092775     8257950.996187
-183646.990298     8257944.567207
-183622.016713     8257936.196615
-183598.289856     8257928.463684
-183581.433916     8257922.672364
-183564.578163     8257916.881427
-183557.000000     8257914.277799
-END
-LINE3D
-HEIGHT 1040.000000
-191856.529579     8258937.000000
-191859.574504     8258934.700483
-191875.328611     8258924.190536
-191888.572636     8258914.285122
-191903.044854     8258906.897205
-191914.386727     8258899.480281
-191931.445128     8258883.343620
-191951.536889     8258877.885641
-191979.734313     8258876.260799
-192002.278194     8258876.464190
-192029.832165     8258876.712781
-192049.871000     8258876.893571
-192066.790315     8258875.792626
-192086.870480     8258871.588134
-192111.293336     8258871.808476
-192143.242152     8258870.843892
-192164.574465     8258866.649932
-192179.614798     8258865.532799
-192192.766095     8258865.651450
-192207.162975     8258866.407751
-192218.342571     8258876.533516
-192239.506805     8258890.509368
-192253.208071     8258898.777879
-192261.859437     8258911.387250
-192275.410014     8258935.945728
-192275.491862     8258937.000000
-END
-LINE3D
-HEIGHT 1030.000000
-191546.312349     8258937.000000
-191555.241801     8258930.701207
-191572.289372     8258915.818039
-191593.690464     8258904.106214
-191615.747368     8258889.267476
-191645.922296     8258877.008395
-191666.767625     8258857.773070
-191686.331073     8258841.659010
-191707.779296     8258824.934777
-191726.693489     8258811.321276
-191751.243087     8258797.757852
-191775.799235     8258783.568840
-191800.338002     8258771.258910
-191818.631926     8258757.012635
-191835.667144     8258743.382182
-191859.632001     8258725.427828
-191883.607682     8258706.220745
-191913.811588     8258690.829096
-191934.633741     8258674.099214
-191952.909511     8258661.732779
-191974.317162     8258649.394600
-191993.869014     8258634.534026
-192020.912826     8258622.246697
-192042.384233     8258603.016256
-192061.947680     8258586.902196
-192083.992989     8258573.316943
-192102.901392     8258560.329421
-192128.634343     8258554.295924
-192153.178904     8258541.359633
-192172.046737     8258532.757782
-192190.914567     8258524.156314
-192204.789695     8258513.629798
-192223.043050     8258503.769195
-192236.930531     8258491.989964
-192248.300614     8258481.440848
-192260.291734     8258471.524130
-192272.323426     8258457.221357
-192281.206614     8258444.770182
-192285.815894     8258420.375926
-192286.598444     8258403.465629
-192282.957169     8258390.901459
-192276.202163     8258376.429575
-192270.815209     8258349.438716
-192267.249278     8258328.729563
-192268.031825     8258311.819649
-192269.423059     8258296.794465
-192277.767110     8258274.939937
-192288.012554     8258250.596147
-192293.810990     8258233.104691
-192294.593540     8258216.194395
-192301.713663     8258191.195995
-192302.508566     8258173.032984
-192302.630274     8258159.875968
-192302.746184     8258147.345696
-192301.626576     8258132.924655
-192297.376616     8258118.475372
-192297.527298     8258102.186170
-192297.133049     8258077.119976
-192297.359076     8258052.685791
-192298.159012     8258033.896030
-192308.369681     8258013.311551
-192312.926804     8257994.555687
-192326.194012     8257982.144065
-192342.579980     8257971.013789
-192360.189114     8257963.026995
-192382.112718     8257962.598377
-192396.516157     8257962.728325
-192414.636212     8257967.277841
-192427.647654     8257982.432583
-192436.919293     8257995.674346
-192448.707573     8258007.685223
-192457.353142     8258020.921337
-192467.929083     8258028.535621
-192486.014366     8258036.844066
-192498.504057     8258040.715991
-192514.148044     8258042.110339
-192531.055764     8258042.262880
-192546.091066     8258041.772115
-192562.419082     8258036.906593
-192575.575410     8258036.398876
-192588.105667     8258035.885511
-192605.640221     8258036.043708
-192623.174775     8258036.201904
-192645.718656     8258036.405295
-192665.757491     8258036.586085
-192685.135484     8258040.520155
-192704.520035     8258043.827872
-192729.603733     8258040.294934
-192744.690433     8258034.165387
-192762.891626     8258029.943560
-192789.877483     8258023.921366
-192808.710541     8258019.078827
-192825.038557     8258014.213305
-192840.763679     8258006.836691
-192852.841736     8257987.521886
-192866.751636     8257973.236441
-192886.872374     8257964.645894
-192913.219804     8257959.871149
-192936.395549     8257959.453828
-192961.496636     8257954.041043
-192981.571008     8257950.462911
-193002.276482     8257946.263677
-193027.998607     8257941.483291
-193054.351834     8257936.081803
-193073.196484     8257929.986160
-193089.524497     8257925.121020
-193106.467752     8257921.514639
-193118.998013     8257921.000892
-193144.087508     8257916.841211
-193166.712524     8257908.273640
-193183.063720     8257900.902292
-193200.029395     8257894.789697
-193218.903022     8257885.561486
-193236.570873     8257871.309945
-193256.771982     8257853.948430
-193283.844772     8257838.528532
-193304.643741     8257824.304857
-193326.056422     8257811.340311
-193342.472132     8257797.077473
-193357.634172     8257782.803325
-193374.049886     8257768.540105
-193391.757541     8257749.902885
-193404.484847     8257728.087903
-193417.148401     8257713.164801
-193427.916362     8257700.103835
-193440.562529     8257687.060197
-193450.709449     8257673.367215
-193461.459256     8257662.186090
-193472.238804     8257647.872403
-193487.383459     8257635.477719
-193500.679645     8257619.933529
-193515.824300     8257607.538845
-193534.083449     8257597.051881
-193557.352689     8257586.610119
-193576.220518     8257578.008651
-193595.059374     8257572.539368
-193614.524300     8257567.075734
-193637.734817     8257562.899483
-193660.325064     8257558.090459
-193681.042892     8257552.638511
-193700.513612     8257546.548516
-193721.863307     8257540.475474
-193741.936918     8257536.896952
-193762.614176     8257535.830676
-193786.422553     8257534.792267
-193805.209248     8257534.961760
-193822.116967     8257535.114301
-193835.273298     8257534.606202
-193849.676736     8257534.736150
-193862.827269     8257534.854794
-193886.624055     8257535.069488
-193903.525977     8257535.848772
-193917.267808     8257539.731993
-193932.911795     8257541.126341
-193947.274664     8257545.641961
-193959.103510     8257553.267548
-193974.057677     8257561.547745
-193987.787917     8257566.684070
-193997.714608     8257576.798531
-194010.070999     8257595.080575
-194016.136181     8257616.438689
-194019.644160     8257643.412597
-194019.528250     8257655.942869
-194004.916938     8257678.367267
-193990.948319     8257698.917841
-193986.420174     8257714.541137
-193981.915210     8257727.658607
-193981.660209     8257755.224978
-193980.239232     8257773.382723
-193980.007411     8257798.443269
-193979.665473     8257835.407726
-193975.119943     8257852.910486
-193974.354782     8257867.940936
-193972.858464     8257894.243282
-193968.359297     8257906.734009
-193968.191226     8257924.903057
-193966.781841     8257941.807699
-193962.195741     8257963.696130
-193960.816102     8257977.467828
-193959.377739     8257997.505037
-193957.812639     8258031.325630
-193952.593910     8258053.834767
-193944.308580     8258069.424165
-193942.939764     8258081.943135
-193930.844322     8258103.137404
-193921.880763     8258124.359547
-193901.655706     8258144.227263
-193889.050104     8258152.885612
-193865.109195     8258168.333766
-193843.695750     8258181.298305
-193822.346055     8258187.371348
-193800.393470     8258190.932917
-193774.660518     8258196.966414
-193752.076071     8258201.148313
-193733.869080     8258205.996883
-193717.500498     8258215.247695
-193705.428240     8258233.935757
-193699.566055     8258258.318711
-193693.187913     8258270.792486
-193684.327905     8258280.737835
-193674.192577     8258293.177713
-193664.063047     8258304.990848
-193653.306678     8258316.798710
-193644.447438     8258326.743684
-193633.685276     8258339.177906
-193617.252941     8258355.320597
-193597.005468     8258377.694146
-193579.378187     8258387.560014
-193564.939973     8258391.189378
-193547.997482     8258394.795766
-193531.089763     8258394.643225
-193509.171953     8258394.445482
-193490.460599     8258386.131388
-193478.620162     8258379.758905
-193461.792817     8258370.835013
-193446.247351     8258358.790239
-193434.459839     8258346.778986
-193425.176605     8258334.790710
-193412.773850     8258321.520698
-193391.632792     8258305.039403
-193369.801915     8258295.443956
-193354.818770     8258290.296327
-193332.999484     8258279.447777
-193321.147455     8258274.328397
-193306.158516     8258269.807129
-193293.645644     8258268.441030
-193271.095970     8258268.864000
-193252.888978     8258273.712570
-193235.279848     8258281.698981
-193218.928651     8258289.070329
-193206.334645     8258296.475191
-193198.065936     8258310.185118
-193191.079109     8258320.773780
-193179.006851     8258339.461842
-193162.615085     8258351.218862
-193147.516033     8258358.601123
-193129.929318     8258364.081703
-193112.395528     8258363.923513
-193093.608834     8258363.754020
-193078.567734     8258364.871528
-193048.404398     8258375.877505
-193021.378736     8258386.285377
-192997.506609     8258394.215283
-192981.155413     8258401.586631
-192969.749794     8258415.894669
-192960.890555     8258425.839643
-192950.099414     8258441.406434
-192947.321978     8258470.830051
-192942.759059     8258490.212658
-192941.964920     8258508.375676
-192940.561329     8258524.653956
-192936.038982     8258539.650509
-192934.526043     8258567.832326
-192929.973951     8258585.961822
-192925.411031     8258605.344428
-192920.864740     8258622.846799
-192913.848932     8258636.568412
-192903.702016     8258650.261011
-192885.413893     8258663.880160
-192868.401851     8258675.005171
-192853.308593     8258681.761072
-192831.982081     8258685.327907
-192814.413513     8258688.929411
-192784.922611     8258694.929004
-192756.075933     8258699.054405
-192737.277650     8258700.137633
-192717.186654     8258705.595619
-192705.201328     8258714.885976
-192685.678447     8258726.614747
-192667.987416     8258743.372113
-192653.450678     8258757.652285
-192638.978461     8258765.040202
-192625.114160     8258774.313608
-192608.716600     8258786.696988
-192588.544465     8258800.926317
-192573.387458     8258814.573715
-192563.246329     8258827.640719
-192553.713894     8258842.591688
-192549.179184     8258858.842102
-192543.984404     8258878.845038
-192539.449701     8258895.094687
-192534.266508     8258913.844903
-192529.781035     8258937.000000
-END
-LINE3D
-HEIGHT 1010.000000
-187460.099470     8258937.000000
-187463.152225     8258931.376393
-187477.050915     8258918.344055
-187490.960811     8258904.058992
-187503.554825     8258896.653365
-187519.906400     8258889.282404
-187529.995368     8258881.854176
-187538.234714     8258871.277196
-187542.734263     8258858.786473
-187544.125880     8258843.761293
-187544.311334     8258823.713162
-187544.531567     8258799.905338
-187543.400748     8258786.737404
-187539.133020     8258774.167582
-187533.682696     8258754.068605
-187528.823676     8258737.733441
-187523.413535     8258713.249172
-187511.161466     8258683.689576
-187501.941984     8258664.809420
-187493.940254     8258649.699493
-187489.666725     8258637.756797
-187481.636017     8258625.779438
-187476.127361     8258611.944830
-187469.998423     8258597.478977
-187465.162580     8258578.638370
-187461.521304     8258566.074200
-187454.829670     8258544.710434
-187442.490664     8258524.548925
-187435.729865     8258510.703403
-187425.252063     8258492.438690
-187416.623880     8258477.323111
-187407.387013     8258460.322419
-187402.551170     8258441.481813
-187397.674757     8258427.026878
-187390.919752     8258412.554994
-187381.653907     8258398.686871
-187377.397771     8258384.863945
-187368.786970     8258367.869285
-187366.404015     8258354.689672
-187355.897236     8258339.557527
-187350.371191     8258327.602765
-187344.880300     8258311.889078
-187342.531735     8258294.950533
-187338.896253     8258281.760002
-187334.645911     8258267.310716
-187329.810068     8258248.470109
-187333.717940     8258232.214422
-187345.082608     8258222.292052
-187361.335661     8258225.571517
-187373.807967     8258231.322905
-187387.509225     8258239.592181
-187399.969939     8258246.596674
-187414.900923     8258257.383078
-187429.222844     8258266.283984
-187439.167299     8258274.519366
-187454.706967     8258287.190883
-187476.990049     8258315.587387
-187494.907264     8258342.064499
-187509.814682     8258355.357108
-187523.498941     8258365.505469
-187534.052080     8258375.625963
-187545.190724     8258390.137396
-187558.799642     8258408.430358
-187573.028832     8258427.355711
-187585.901177     8258457.547316
-187594.488794     8258477.048184
-187603.128569     8258490.910659
-187611.153100     8258503.514375
-187621.063169     8258515.508307
-187628.479017     8258526.226909
-187639.008594     8258538.853226
-187648.889685     8258553.979726
-187656.920011     8258565.957081
-187666.869878     8258573.566098
-187681.806660     8258583.725760
-187693.658693     8258588.844757
-187706.130994     8258594.596528
-187718.597502     8258600.974660
-187732.321945     8258606.737728
-187747.931156     8258611.891388
-187764.173004     8258616.423577
-187776.651100     8258621.548988
-187795.959550     8258633.000916
-187816.491155     8258647.597474
-187838.293055     8258660.325489
-187850.127698     8258667.324333
-187865.742711     8258671.850867
-187880.725852     8258676.998878
-187893.209750     8258681.497164
-187906.882031     8258692.899007
-187921.215926     8258700.546813
-187934.325886     8258705.051511
-187951.188010     8258710.215709
-187967.429086     8258714.748656
-187983.699147     8258716.148271
-188006.805348     8258723.248807
-188028.039133     8258729.706037
-188039.879570     8258736.078520
-188053.609807     8258741.215228
-188066.053131     8258750.099567
-188089.142708     8258759.079957
-188102.217903     8258767.342819
-188115.293092     8258775.606447
-188128.995122     8258783.874964
-188140.817406     8258792.127288
-188156.293325     8258811.690302
-188163.054885     8258825.536214
-188170.424369     8258841.266850
-188177.811242     8258855.117639
-188183.343081     8258866.446039
-188199.497231     8258880.375926
-188219.415126     8258893.713357
-188233.783028     8258897.602227
-188250.030663     8258901.508820
-188271.315845     8258902.327267
-188286.936652     8258906.227441
-188311.318942     8258910.833073
-188326.922359     8258916.613093
-188345.610525     8258927.433777
-188369.952250     8258936.424699
-188371.018232     8258937.000000
-END
-LINE3D
-HEIGHT 1010.000000
-189073.089853     8258937.000000
-189085.824139     8258932.231969
-189104.651399     8258928.016173
-189120.353345     8258923.145002
-189138.571160     8258917.043704
-189156.186853     8258908.430557
-189166.913480     8258899.755256
-189177.043771     8258887.942511
-189189.678351     8258876.151594
-189202.967978     8258861.233757
-189216.889470     8258845.695209
-189231.449385     8258828.909594
-189250.392563     8258812.162760
-189268.692281     8258797.290124
-189281.958725     8258784.878495
-189291.433204     8258776.192663
-189303.441713     8258764.396098
-189313.037904     8258742.552867
-189323.306532     8258715.702870
-189327.243378     8258696.314997
-189334.914226     8258679.467229
-189340.057617     8258665.102310
-189350.876971     8258646.402944
-189362.323159     8258627.709234
-189377.503350     8258611.555628
-189391.413254     8258597.269801
-189401.594942     8258579.818273
-189409.846265     8258567.987810
-189420.607663     8258555.553581
-189440.166081     8258540.065888
-189451.512984     8258532.022597
-189463.480920     8258524.612086
-189476.672023     8258520.345058
-189491.747895     8258515.468621
-189508.667206     8258514.368059
-189529.344467     8258513.301401
-189542.506592     8258512.166941
-189555.668717     8258511.032481
-189568.831603     8258509.898410
-189583.900917     8258505.648327
-189596.436972     8258504.508219
-189623.956171     8258508.515740
-189644.592864     8258511.834753
-189659.622372     8258511.970349
-189684.682886     8258510.943619
-189709.249866     8258495.501113
-189723.740237     8258486.233356
-189745.756572     8258475.780290
-189765.917115     8258462.804064
-189782.941510     8258450.426340
-189794.938424     8258439.883261
-189805.699822     8258427.449031
-189816.438040     8258417.520627
-189832.807387     8258408.269822
-189854.759969     8258404.708635
-189869.782919     8258405.470585
-189887.891382     8258411.273206
-189901.639772     8258414.530073
-189919.109813     8258421.579760
-189940.349391     8258427.410629
-189963.484571     8258431.378597
-189977.888009     8258431.508545
-189996.094997     8258426.660357
-190011.165075     8258422.410281
-190026.861223     8258418.165853
-190048.239131     8258408.960236
-190059.598387     8258399.664230
-190070.951844     8258390.994967
-190083.534263     8258384.842826
-190094.284069     8258373.661700
-190104.378832     8258365.607112
-190114.485182     8258356.299802
-190125.241547     8258344.492323
-190135.997151     8258332.684454
-190150.504909     8258321.537233
-190165.000309     8258311.643108
-190178.232746     8258302.990415
-190191.447029     8258296.217562
-190205.310565     8258286.944149
-190218.507465     8258282.050378
-190232.325399     8258277.789388
-190248.647618     8258273.550609
-190271.197296     8258273.127256
-190286.232599     8258272.636491
-190301.888177     8258272.777736
-190313.711229     8258281.029684
-190328.026970     8258290.557329
-190337.948627     8258301.298540
-190351.615114     8258313.326744
-190364.075828     8258320.331237
-190375.916266     8258326.703720
-190388.411751     8258329.949284
-190405.945541     8258330.107473
-190429.116256     8258330.316519
-190452.326776     8258326.139886
-190464.920786     8258318.734642
-190476.894520     8258310.697388
-190490.103009     8258304.550895
-190509.596909     8258295.955075
-190526.545962     8258291.721952
-190537.869681     8258286.184868
-190552.302097     8258283.182247
-190570.468515     8258282.719731
-190593.018194     8258282.296379
-190617.493207     8258276.878328
-190631.269811     8258277.002620
-190648.850728     8258272.148784
-190664.506307     8258272.290029
-190680.196661     8258268.671962
-190695.904398     8258263.174813
-190711.623729     8258256.424178
-190729.853901     8258249.069782
-190747.451440     8258242.336475
-190764.400493     8258238.103351
-190779.516170     8258228.841235
-190799.642702     8258219.624328
-190810.972216     8258213.460883
-190823.560428     8258206.682381
-190848.099194     8258194.372451
-190861.301889     8258188.852319
-190876.400944     8258181.469675
-190892.746343     8258174.725071
-190907.828013     8258169.221891
-190926.063978     8258161.241135
-190943.023855     8258155.755283
-190963.179365     8258143.405807
-190975.170488     8258133.488706
-190988.396363     8258125.462749
-191002.248308     8258117.442441
-191019.881386     8258106.949829
-191037.542678     8258093.324642
-191048.919319     8258082.149172
-191066.598762     8258066.644527
-191079.239135     8258054.227250
-191086.231756     8258043.012227
-191091.380177     8258028.020940
-191095.932265     8258009.891827
-191096.709022     8257993.607891
-191098.790840     8257971.696866
-191099.538615     8257958.545881
-191099.666117     8257944.762504
-191099.793620     8257930.979127
-191094.968986     8257910.885413
-191085.703138     8257897.017672
-191076.402521     8257886.908478
-191060.799100     8257881.128840
-191045.775389     8257880.366501
-191034.428490     8257888.409410
-191024.954004     8257897.096008
-191014.847653     8257906.403317
-191007.825291     8257920.750901
-191002.676870     8257935.742188
-190998.182736     8257947.606165
-190992.419837     8257961.338699
-190987.276450     8257975.703235
-190978.346895     8257993.166825
-190968.808660     8258008.744920
-190952.370534     8258025.513589
-190941.005481     8258035.436338
-190930.899131     8258044.743648
-190918.287735     8258054.028357
-190899.373538     8258067.642240
-190883.636824     8258076.271957
-190869.205172     8258079.274585
-190868.097156     8258063.600440
-190869.523926     8258044.816335
-190879.665049     8258031.750096
-190891.064109     8258018.068411
-190901.843658     8258003.754724
-190908.842076     8257991.912958
-190915.915835     8257971.926591
-190923.593246     8257954.452087
-190929.988774     8257940.098848
-190938.337854     8257917.617953
-190944.084131     8257905.764890
-190949.210133     8257893.279818
-190961.293219     8257873.338645
-190969.608292     8257854.616686
-190977.894387     8257839.027294
-190984.910191     8257825.306064
-190993.160746     8257813.475977
-191001.412069     8257801.645515
-191010.973484     8257783.561595
-191016.760332     8257767.322860
-191010.666168     8257749.097697
-191000.147418     8257735.218270
-190989.681594     8257715.700074
-190981.662092     8257702.469990
-190973.631766     8257690.492635
-190963.118810     8257675.986848
-190953.221097     8257662.739819
-190939.525633     8257653.844183
-190927.070717     8257646.212947
-190912.058594     8257644.197887
-190888.261808     8257643.983192
-190866.965035     8257644.417849
-190845.597954     8257652.370356
-190826.104054     8257660.966176
-190809.131817     8257667.705507
-190783.393071     8257674.365365
-190765.916473     8257667.942032
-190761.075214     8257649.728172
-190766.212043     8257635.989989
-190766.362729     8257619.700405
-190757.096881     8257605.832664
-190757.241769     8257590.169823
-190757.375069     8257575.759703
-190774.329916     8257570.900219
-190790.727476     8257558.516839
-190808.980827     8257548.656618
-190821.586429     8257539.998270
-190841.723789     8257529.528251
-190859.356864     8257519.036022
-190870.761722     8257504.727594
-190880.259388     8257493.535172
-190884.260751     8257467.255426
-190885.078073     8257446.586201
-190884.689618     8257420.893646
-190883.552624     8257408.352070
-190878.693983     8257392.017291
-190871.961393     8257375.039576
-190869.573023     8257362.486710
-190863.490455     8257343.008059
-190859.848415     8257330.443882
-190855.604249     8257315.368239
-190851.412248     8257294.653437
-190846.512270     8257282.704706
-190837.901473     8257265.709663
-190832.410200     8257249.995973
-190827.586331     8257229.902266
-190823.324015     8257216.706079
-190818.482760     8257198.491837
-190809.234301     8257182.744249
-190804.398076     8257163.903639
-190800.177094     8257146.321788
-190797.851708     8257126.877417
-190809.813854     8257120.092885
-190826.709981     8257121.498530
-190836.654058     8257129.733526
-190846.535146     8257144.860408
-190859.540791     8257160.641893
-190870.650075     8257178.285890
-190881.748531     8257197.182998
-190889.733258     8257214.172393
-190901.480204     8257230.568935
-190910.137365     8257242.551945
-190920.069849     8257252.040045
-190928.089351     8257265.270128
-190936.734920     8257278.506243
-190946.638427     8257291.126911
-190955.944842     8257300.609362
-190967.721530     8257313.873342
-190977.648220     8257323.987803
-190994.463209     8257334.164794
-191005.016734     8257344.284907
-191024.313588     8257356.990322
-191037.429346     8257360.868277
-191050.504539     8257369.131522
-191062.333384     8257376.757109
-191083.532397     8257386.973268
-191095.384427     8257392.092648
-191109.746531     8257396.608261
-191130.377429     8257400.553635
-191144.142441     8257401.931031
-191158.505310     8257406.446651
-191170.995001     8257410.318575
-191194.112791     8257416.166390
-191219.788551     8257416.398036
-191233.565155     8257416.522328
-191247.335964     8257417.272981
-191261.733605     8257418.029672
-191284.903556     8257418.238711
-191303.064180     8257418.402556
-191317.467618     8257418.532503
-191332.543491     8257413.656067
-191345.734593     8257409.389039
-191360.172042     8257405.759668
-191372.116799     8257400.854983
-191394.701249     8257396.672701
-191407.852546     8257396.791352
-191426.645035     8257396.334485
-191441.673779     8257396.470074
-191458.570671     8257397.875725
-191471.089340     8257398.615082
-191485.532583     8257394.359350
-191492.607104     8257374.373373
-191493.488178     8257346.812268
-191494.891001     8257330.534363
-191500.028595     8257316.796187
-191510.123353     8257308.741982
-191525.268772     8257296.347305
-191542.814154     8257295.252391
-191554.793685     8257286.588394
-191570.536197     8257277.331933
-191580.642548     8257268.024624
-191600.206759     8257251.910571
-191618.552077     8257232.025896
-191625.557053     8257219.557776
-191631.401088     8257197.054280
-191641.641503     8257173.336858
-191653.730383     8257152.769324
-191662.601978     8257141.571253
-191677.747398     8257129.176576
-191689.750109     8257118.006754
-191702.361505     8257108.722045
-191720.649632     8257095.102514
-191731.364667     8257087.680317
-191743.993448     8257076.516143
-191766.009783     8257066.063077
-191778.569018     8257062.417144
-191801.188240     8257054.475933
-191813.127202     8257050.197608
-191824.457480     8257044.034171
-191837.689152     8257035.381471
-191847.163635     8257026.695256
-191854.173645     8257013.600386
-191866.814018     8257001.183109
-191878.144296     8256995.019671
-191893.300542     8256981.371883
-191906.509795     8256975.225398
-191919.132780     8256964.687967
-191929.876792     8256954.133202
-191969.787004     8256904.994410
-191985.599063     8256888.219710
-192003.289329     8256871.462337
-192033.000464     8256841.654920
-192046.887181     8256829.875682
-192058.287006     8256816.194004
-192078.023025     8256785.514335
-END
-LINE3D
-HEIGHT 1010.000000
-191160.220704     8258937.000000
-191165.047281     8258933.446537
-191178.916611     8258923.546764
-191192.756964     8258916.779559
-191204.081448     8258911.242482
-191219.777593     8258906.998437
-191234.870850     8258900.242536
-191256.249523     8258891.036925
-191276.369497     8258882.446371
-191293.985190     8258873.833224
-191310.336383     8258866.462259
-191326.125261     8258852.193383
-191344.413385     8258838.574234
-191362.080474     8258824.322304
-191382.850466     8258813.231198
-191398.621956     8258800.842169
-191413.755779     8258789.700979
-191424.534567     8258775.386902
-191439.053916     8258762.986577
-191451.102227     8258746.804716
-191464.404207     8258730.634165
-191478.389448     8258708.204119
-191494.213098     8258690.176315
-191508.105613     8258677.770334
-191521.361233     8258666.611433
-191536.546453     8258649.831460
-191544.177500     8258637.368989
-191552.468625     8258621.153230
-191558.904722     8258602.414318
-191567.185023     8258587.451288
-191576.068211     8258575.000113
-191585.589060     8258561.301483
-191602.015597     8258545.785535
-191621.555865     8258532.177300
-191639.264284     8258513.540087
-191657.558205     8258499.294195
-191668.418128     8258476.209157
-191678.617206     8258456.877782
-191686.868529     8258445.047320
-191699.508902     8258432.630042
-191712.126093     8258422.718972
-191722.267218     8258409.652352
-191733.051797     8258394.712297
-191743.257436     8258374.754186
-191754.818771     8258343.530196
-191763.777299     8258322.934420
-191772.747420     8258301.085541
-191781.665383     8258284.875055
-191789.962305     8258268.032553
-191798.236808     8258253.696266
-191805.942432     8258233.089186
-191810.477135     8258216.839537
-191818.124807     8258202.497212
-191823.285580     8258186.253211
-191827.158677     8258173.756836
-191831.686821     8258158.133540
-191826.833975     8258141.172401
-191815.005129     8258133.546814
-191801.262533     8258129.663586
-191797.006779     8258115.840664
-191797.145869     8258100.804566
-191802.300849     8258085.186926
-191811.792721     8258074.620864
-191828.161303     8258065.370052
-191842.639318     8258057.355392
-191855.802207     8258056.220939
-191874.600493     8258055.137328
-191902.118929     8258059.144842
-191917.142640     8258059.907181
-191939.727090     8258055.724900
-191953.579799     8258047.704598
-191980.640232     8258033.537797
-191993.872669     8258024.885104
-192012.102076     8258017.530702
-192029.074309     8258010.791752
-192041.024863     8258005.260324
-192052.360170     8257998.470519
-192063.696246     8257991.680338
-192076.313436     8257981.769268
-192088.275578     8257974.985118
-192097.767450     8257964.419056
-192103.559326     8257947.553954
-192104.365821     8257928.137839
-192111.404809     8257911.910401
-192112.175767     8257896.253209
-192112.981497     8257876.837087
-192113.132183     8257860.547503
-192113.311843     8257841.125733
-192121.574755     8257828.042549
-192144.159205     8257823.860268
-192159.826375     8257822.748408
-192177.360929     8257822.906605
-192194.888925     8257823.691155
-192215.687891     8257809.467863
-192235.233952     8257795.233268
-192247.219278     8257785.942910
-192258.606747     8257773.514329
-192274.976093     8257764.263524
-192291.941768     8257758.150929
-192317.709491     8257748.358503
-192330.326685     8257738.447051
-192344.202577     8257727.920542
-192358.066114     8257718.647129
-192370.057233     8257708.730411
-192387.022908     8257702.617816
-192404.603826     8257697.763980
-192424.723800     8257689.173426
-192444.188722     8257683.710174
-192460.540683     8257676.338833
-192476.862901     8257672.100054
-192493.845961     8257664.107995
-192515.833319     8257656.787497
-192539.676468     8257651.990158
-192559.181963     8257642.140852
-192574.889700     8257636.643703
-192593.716964     8257632.427524
-192616.979642     8257622.612498
-192638.358314     8257613.406887
-192665.367355     8257604.878486
-192682.327235     8257599.392252
-192701.171885     8257593.296609
-192718.144118     8257586.557660
-192741.992300     8257581.133571
-192763.353584     8257573.807807
-192792.206063     8257569.055280
-192811.050713     8257562.959637
-192831.756949     8257558.760793
-192845.579919     8257553.872670
-192860.649994     8257549.622977
-192875.725869     8257544.746158
-192900.224066     8257536.821899
-192920.349834     8257527.604985
-192937.982913     8257517.112373
-192951.875427     8257504.706392
-192966.417956     8257489.800242
-192981.608974     8257472.393526
-192994.272531     8257457.470041
-193011.337495     8257440.706644
-193027.735054     8257428.323264
-193044.758684     8257415.945532
-193057.393260     8257404.154998
-193069.407564     8257391.732072
-193081.445050     8257376.802939
-193094.085424     8257364.385662
-193102.962817     8257352.560848
-193114.303919     8257345.144682
-193127.559539     8257333.985781
-193147.708487     8257322.263041
-193166.616890     8257309.275519
-193179.245672     8257298.111345
-193192.529501     8257283.820252
-193200.166343     8257270.731420
-193208.451673     8257255.142022
-193213.021151     8257235.133061
-193214.447158     8257216.348949
-193218.355030     8257200.093262
-193225.997665     8257186.378069
-193232.410582     8257170.144983
-193243.166183     8257158.337496
-193253.324695     8257143.391411
-193267.217973     8257130.985437
-193278.657603     8257112.918080
-193293.176952     8257100.517755
-193300.175367     8257088.676372
-193312.862104     8257071.247062
-193329.294439     8257055.104370
-193348.782545     8257047.134911
-193364.438123     8257047.276155
-193380.720537     8257047.423055
-193397.002186     8257047.569948
-193410.778789     8257047.694240
-193425.808298     8257047.829836
-193442.089947     8257047.976729
-193456.493385     8257048.106677
-193470.890265     8257048.862978
-193484.656041     8257050.240381
-193500.908713     8257053.519842
-193518.443267     8257053.678038
-193538.482102     8257053.858829
-193560.434684     8257050.297642
-193574.211287     8257050.421934
-193589.246594     8257049.930787
-193613.136106     8257040.121416
-193628.264139     8257029.606203
-193642.707383     8257025.350472
-193664.677351     8257019.909821
-193682.304635     8257010.043570
-193697.374710     8257005.793876
-193713.082450     8257000.296345
-193725.032239     8256994.764909
-193740.073336     8256993.647784
-193752.597799     8256993.760779
-193774.446066     8257001.476379
-193800.051515     8257009.226259
-193816.925223     8257013.138118
-193831.293125     8257017.026988
-193844.444423     8257017.145639
-193856.968886     8257017.258634
-193879.663449     8257001.172823
-193892.883529     8256993.773227
-193907.327537     8256989.517502
-193923.620778     8256988.411292
-193938.035044     8256987.288128
-193958.121007     8256982.456893
-193970.651264     8256981.943528
-193983.216296     8256977.670851
-193995.792920     8256972.145071
-194012.167296     8256962.267898
-194029.161949     8256953.022735
-194048.668205     8256943.173818
-194061.916499     8256932.641647
-194077.670602     8256922.132083
-194089.668284     8256911.588628
-194100.394907     8256902.913710
-194121.182285     8256889.943140
-194142.571785     8256879.484418
-194157.021587     8256874.602333
-194171.465595     8256870.346609
-194190.287061     8256866.757173
-194207.206372     8256865.656610
-194225.360434     8256866.447192
-194242.848625     8256871.617421
-194269.706979     8256879.378604
-194282.858277     8256879.497255
-194296.008046     8256879.615892
-194319.799037     8256880.456947
-194341.159560     8256873.130793
-194363.164303     8256863.930831
-194377.666266     8256853.409970
-194400.332616     8256840.456734
-194420.440998     8256833.119284
-194433.673431     8256824.466973
-194443.767429     8256816.412378
-194453.874544     8256807.105075
-194464.595372     8256799.056518
-194474.069855     8256790.370303
-194482.940690     8256779.171843
-194498.781723     8256759.264957
-194503.322988     8256742.388571
-194508.476438     8256726.770917
-194519.320504     8256705.565358
-194529.455068     8256693.125473
-194537.694799     8256682.548114
-194545.313490     8256671.338740
-194552.330059     8256657.617516
-194556.231369     8256641.988566
-194557.612537     8256628.216882
-194558.423300     8256608.174010
-194557.948680     8256591.878785
-194553.060294     8256578.676950
-194541.932860     8256562.912411
-194530.162734     8256549.021694
-194524.051184     8256532.675994
-194519.776516     8256520.732523
-194518.646080     8256507.564592
-194528.172723     8256493.239602
-194545.730461     8256490.891591
-194561.391834     8256490.406474
-194583.234303     8256498.748817
-194600.768857     8256498.907014
-194627.174243     8256487.867132
-194643.572567     8256475.483759
-194661.186731     8256466.870598
-194673.751763     8256462.597922
-194686.949424     8256457.704540
-194700.749211     8256455.322625
-194723.317036     8256453.020197
-194750.957176     8256443.871077
-194767.899671     8256440.264307
-194787.992193     8256434.806717
-194807.450556     8256429.969819
-194824.393051     8256426.363049
-194846.386203     8256418.416190
-194859.543294     8256417.908481
-194876.503175     8256412.422246
-194894.084092     8256407.568410
-194908.539692     8256402.059582
-194926.126404     8256396.579385
-194941.874713     8256386.696182
-194960.138892     8256375.582850
-194975.277752     8256363.814527
-194989.785509     8256352.667306
-195004.322244     8256338.387516
-195017.000000     8256328.706466
-END
-LINE3D
-HEIGHT 1010.000000
-195017.000000     8257709.622469
-195016.678964     8257710.678384
-195012.787717     8257725.054218
-195003.203118     8257745.644345
-194993.595335     8257768.740679
-194984.602796     8257793.095773
-194980.103629     8257805.586500
-194973.081266     8257819.934084
-194962.366231     8257827.356281
-194952.264914     8257836.036841
-194939.670904     8257843.442085
-194906.395367     8257852.540363
-194875.628377     8257861.034860
-194854.331607     8257861.469134
-194839.266559     8257865.092842
-194824.232020     8257865.583613
-194811.045951     8257869.223892
-194794.695519     8257876.595246
-194773.942916     8257885.806505
-194759.469931     8257893.194798
-194740.642667     8257897.410976
-194728.083432     8257901.056910
-194711.100372     8257909.048970
-194693.473087     8257918.915221
-194675.834215     8257930.034193
-194662.603307     8257938.686900
-194639.977527     8257947.254464
-194625.516133     8257953.389653
-194612.262045     8257964.548185
-194598.375325     8257976.327805
-194591.968206     8257991.934148
-194583.676317     8258008.149900
-194572.247514     8258024.964147
-194559.554979     8258043.020200
-194547.518260     8258057.948957
-194536.112638     8258072.257378
-194520.317969     8258087.152232
-194502.609549     8258105.789445
-194482.941015     8258133.181049
-194464.566720     8258156.198293
-194450.674206     8258168.604273
-194439.918605     8258180.411760
-194429.765127     8258194.731095
-194416.474735     8258209.648924
-194400.048962     8258225.164880
-194386.764368     8258239.455966
-194370.946515     8258256.857027
-194360.185116     8258269.291257
-194351.314282     8258280.489717
-194339.281828     8258294.792100
-194327.864617     8258310.353242
-194314.575758     8258325.270703
-194300.039020     8258339.550876
-194284.284920     8258350.060057
-194262.268585     8258360.513123
-194241.440641     8258377.868984
-194224.376441     8258394.632387
-194212.988208     8258407.060961
-194200.359427     8258418.225135
-194188.982782     8258429.400988
-194176.336614     8258442.444626
-194160.541941     8258457.339862
-194142.277762     8258468.453193
-194128.373657     8258482.112277
-194123.241861     8258495.223710
-194107.377645     8258517.636803
-194092.771363     8258539.434833
-194076.953506     8258556.836277
-194065.559479     8258569.891212
-194061.681353     8258583.013955
-194059.042243     8258597.401467
-194050.653362     8258624.267659
-194050.514268     8258639.304139
-194047.869364     8258654.318012
-194038.296356     8258673.655036
-194033.779800     8258688.025610
-194024.218381     8258706.109911
-194009.617901     8258727.280816
-193998.862296     8258739.088685
-193993.110224     8258751.568108
-193976.057617     8258767.078408
-193962.239676     8258771.340163
-193936.547297     8258772.987606
-193921.506194     8258774.105496
-193907.103520     8258773.975555
-193890.195036     8258773.823007
-193874.539457     8258773.681763
-193855.752763     8258773.512270
-193838.213179     8258773.980441
-193822.546012     8258775.091918
-193807.504908     8258776.209808
-193791.194281     8258779.195483
-193772.355433     8258784.664001
-193744.702933     8258795.066600
-193718.854071     8258813.630370
-193694.222577     8258835.964366
-193672.125107     8258855.188393
-193651.256594     8258876.929925
-193624.799044     8258893.608965
-193598.364684     8258907.781032
-193574.446194     8258920.722971
-193554.291448     8258933.072454
-193544.093042     8258937.000000
-END
-LINE3D
-HEIGHT 1010.000000
-195017.000000     8258791.327309
-195015.471374     8258788.987302
-195005.545448     8258778.872848
-194996.337555     8258758.739971
-194990.920862     8258734.881290
-194989.252053     8258712.310014
-194989.431713     8258692.888244
-194992.701923     8258677.880012
-195006.019764     8258659.829601
-195012.397906     8258647.355826
-195017.000000     8258643.311692
-END
-LINE3D-MASTER
-HEIGHT 1000.000000
-191735.510603     8257221.552377
-191709.685698     8257264.802811
-191699.561193     8257275.989961
-191687.530269     8257290.292358
-191680.531090     8257302.133735
-191668.523345     8257313.930306
-191659.043065     8257323.243264
-191648.889586     8257337.562600
-191639.879661     8257363.797158
-191629.731976     8257377.490133
-191627.100193     8257391.250916
-191621.939420     8257407.494916
-191619.312670     8257420.628950
-191614.146863     8257437.499700
-191611.502723     8257452.513580
-191602.567378     8257470.603148
-191597.290691     8257499.377804
-191586.540884     8257510.558930
-191560.726794     8257525.363771
-191549.367538     8257534.659777
-191540.507534     8257544.604744
-191524.167930     8257550.722987
-191508.500759     8257551.834847
-191492.897342     8257546.054827
-191477.954766     8257536.521526
-191460.444157     8257533.857511
-191438.543736     8257531.779922
-191426.019273     8257531.666927
-191413.494810     8257531.553931
-191397.213161     8257531.407038
-191382.183652     8257531.271442
-191367.154144     8257531.135846
-191352.756499     8257530.379538
-191331.465524     8257530.187451
-191318.941061     8257530.074456
-191304.537622     8257529.944508
-191288.244382     8257531.050719
-191272.559825     8257534.042043
-191254.996294     8257537.016415
-191237.421935     8257541.243897
-191222.328677     8257547.999798
-191209.769442     8257551.645732
-191197.198612     8257556.545151
-191184.598808     8257564.576757
-191175.101141     8257575.769179
-191169.847638     8257602.037627
-191165.974541     8257614.534003
-191159.561627     8257630.766707
-191155.016097     8257648.269467
-191154.261760     8257662.047188
-191155.398754     8257674.588765
-191160.297964     8257686.537871
-191170.202236     8257699.158546
-191176.986219     8257710.497861
-191191.783906     8257735.694003
-191199.831621     8257745.791511
-191222.735740     8257774.820414
-191235.770363     8257787.469331
-191242.560140     8257798.182285
-191253.739736     8257808.308049
-191263.643243     8257820.928717
-191271.644591     8257836.038640
-191275.280837     8257849.229178
-191284.477134     8257870.615542
-191291.203162     8257888.219993
-191293.476387     8257913.303139
-191293.302521     8257932.098549
-191294.438751     8257944.640118
-191294.259091     8257964.061888
-191294.096817     8257981.604194
-191294.525838     8258002.911459
-191294.328788     8258024.213076
-191293.557830     8258039.870268
-191285.289124     8258053.579813
-191278.910982     8258066.053588
-191271.912564     8258077.895354
-191263.621439     8258094.111113
-191252.169453     8258113.431566
-191240.781220     8258125.860141
-191229.411137     8258136.409257
-191218.666364     8258146.963633
-191206.658619     8258158.760205
-191194.006654     8258172.430586
-191181.980759     8258186.106615
-191169.989639     8258196.023334
-191159.860105     8258207.836851
-191150.976917     8258220.288025
-191138.295978     8258237.090592
-191125.655604     8258249.507870
-191111.165233     8258258.775627
-191094.756082     8258272.412110
-191080.857770     8258285.444834
-191069.510106     8258293.487736
-191058.169001     8258300.904285
-191044.930771     8258310.183338
-191034.215739     8258317.605153
-191019.099298     8258326.867261
-191001.466984     8258337.359880
-190979.439057     8258349.066050
-190958.651682     8258362.036238
-190944.149719     8258372.557099
-190927.699999     8258390.579255
-190917.599446     8258399.259822
-190906.245985     8258407.929467
-190893.031702     8258414.702320
-190870.412480     8258422.643530
-190849.584533     8258439.999773
-190835.077540     8258451.147001
-190823.683513     8258464.201936
-190812.307636     8258475.377413
-190796.536147     8258487.766442
-190780.166800     8258497.017247
-190765.752535     8258498.140410
-190740.060152     8258499.788235
-190718.130750     8258500.843596
-190696.212940     8258500.645854
-190681.809502     8258500.515907
-190663.034399     8258499.093310
-190637.991267     8258498.240958
-190612.316271     8258498.009318
-190589.139761     8258498.426633
-190562.774942     8258505.081225
-190533.916672     8258510.459730
-190508.183720     8258516.493227
-190489.350659     8258521.336149
-190473.010290     8258527.454386
-190456.682277     8258532.319525
-190440.336879     8258539.064130
-190421.469046     8258547.665980
-190404.462802     8258558.164248
-190393.109340     8258566.833893
-190376.734964     8258576.711065
-190365.346731     8258589.139640
-190353.344023     8258600.309079
-190341.968143     8258611.484939
-190330.608887     8258620.780945
-190315.451880     8258634.428343
-190302.857866     8258641.833970
-190288.408833     8258646.715680
-190269.552587     8258654.064809
-190250.087661     8258659.528443
-190236.901592     8258663.168721
-190224.951802     8258668.700157
-190210.490409     8258674.835345
-190197.925380     8258679.107639
-190182.223434     8258683.978810
-190170.278681     8258688.883113
-190152.077484     8258693.105323
-190124.454734     8258700.374596
-190107.511478     8258703.980977
-190092.418220     8258710.736878
-190077.319925     8258718.119911
-190063.490396     8258723.634388
-190047.823229     8258724.745865
-190030.880738     8258728.352253
-190015.219365     8258728.837369
-189999.552191     8258729.949611
-189983.264748     8258730.429078
-189965.104124     8258730.265234
-189946.943499     8258730.101389
-189930.661850     8258729.954496
-189912.495432     8258730.417012
-189897.465923     8258730.281416
-189879.305299     8258730.117571
-189863.023650     8258729.970678
-189850.499187     8258729.857683
-189821.084387     8258727.713064
-189801.677423     8258726.910797
-189784.768940     8258726.758249
-189762.225059     8258726.554858
-189737.176133     8258726.328867
-189717.757567     8258726.780851
-189703.354129     8258726.650903
-189682.637069     8258732.102476
-189663.804008     8258736.945397
-189639.317402     8258743.616552
-189626.752366     8258747.889611
-189612.331546     8258749.638745
-189588.448592     8258758.821763
-189565.150371     8258772.396476
-189551.304224     8258779.790041
-189533.062461     8258788.397540
-189519.830788     8258797.050240
-189510.964990     8258807.621568
-189501.420961     8258823.826023
-189495.616728     8258841.944222
-189486.733540     8258854.395397
-189477.827933     8258869.352786
-189468.318676     8258881.798312
-189459.452877     8258892.369640
-189444.887162     8258909.782380
-189433.430149     8258929.728819
-189424.545129     8258937.000000
-END
-LINE3D-MASTER
-HEIGHT 1000.000000
-189706.757826     8258937.000000
-189708.411045     8258924.691207
-189709.182768     8258909.034022
-189711.814555     8258895.272856
-189715.700004     8258881.523766
-189728.856332     8258881.016049
-189741.299656     8258889.900389
-189749.951022     8258902.509760
-189757.934988     8258919.498765
-189765.242230     8258937.000000
-END
-LINE3D-MASTER
-HEIGHT 1000.000000
-189845.470104     8258937.000000
-189849.218527     8258935.986472
-189864.288602     8258931.736779
-189881.202887     8258931.262201
-189900.656217     8258927.052053
-189918.230573     8258922.824953
-189934.518787     8258922.344728
-189950.841002     8258918.106331
-189968.415358     8258913.879231
-189989.092623     8258912.812190
-190016.658183     8258911.808060
-190037.328882     8258911.368138
-190056.742411     8258911.543287
-190081.791337     8258911.769278
-190111.223520     8258912.034814
-190141.282537     8258912.306006
-190160.069231     8258912.475500
-190176.976951     8258912.628041
-190192.006459     8258912.763637
-190207.035968     8258912.899233
-190222.679958     8258914.293199
-190242.689816     8258917.606557
-190260.815668     8258921.529331
-190279.596569     8258922.325185
-190292.109436     8258923.691666
-190306.500522     8258925.074328
-190323.368433     8258929.612931
-190339.018218     8258930.380536
-190357.149864     8258933.676949
-190378.417656     8258936.375243
-190386.176854     8258937.000000
-END
-LINE3D-MASTER
-HEIGHT 1000.000000
-190972.433766     8258937.000000
-190987.211341     8258930.589278
-191006.050197     8258925.119995
-191024.889052     8258919.650713
-191039.970715     8258914.148298
-191056.913213     8258910.541146
-191072.609358     8258906.297100
-191086.397550     8258905.168671
-191106.512494     8258897.204485
-191122.846304     8258891.712602
-191142.293841     8258888.128815
-191157.381304     8258881.999274
-191176.892590     8258871.523990
-191194.502489     8258863.537203
-191209.647908     8258851.142526
-191227.900495     8258841.282299
-191241.770590     8258831.382533
-191258.747860     8258824.016452
-191273.835324     8258817.886911
-191292.743723     8258804.899771
-191314.168763     8258790.681745
-191324.269312     8258782.001561
-191336.243050     8258773.963925
-191347.572563     8258767.800480
-191370.841800     8258757.359100
-191384.085067     8258747.452914
-191396.661684     8258741.927898
-191405.521695     8258731.982166
-191414.381699     8258722.037199
-191431.463284     8258703.394331
-191442.839922     8258692.219243
-191455.567229     8258670.404261
-191463.811993     8258659.200153
-191474.643700     8258639.248072
-191484.808005     8258623.675626
-191496.259230     8258604.354783
-191501.379431     8258592.496837
-191510.297397     8258576.285969
-191520.455905     8258561.340266
-191528.782570     8258541.365203
-191537.085286     8258523.896340
-191542.205490     8258512.038011
-191551.123453     8258495.827525
-191564.540579     8258467.126695
-191569.051338     8258453.382864
-191584.272098     8258432.843586
-191593.769764     8258421.651163
-191612.086868     8258404.899064
-191630.977882     8258393.791388
-191644.197962     8258386.391791
-191652.449285     8258374.561329
-191668.214977     8258362.799044
-191679.660401     8258344.105326
-191686.682002     8258329.757353
-191694.365207     8258311.656488
-191698.910737     8258294.153728
-191702.824403     8258277.271681
-191704.888836     8258257.240120
-191708.906821     8258229.080903
-191710.293022     8258214.682469
-191714.206688     8258197.800422
-191715.580534     8258184.655085
-191723.252150     8258167.806942
-191730.273748     8258153.459351
-191736.651890     8258140.985575
-191745.564056     8258125.401833
-191751.350138     8258109.163091
-191760.842010     8258098.597029
-191770.380246     8258083.018935
-191781.113431     8258073.717280
-191791.863238     8258062.536155
-191796.983441     8258050.677826
-191804.602136     8258039.468069
-191812.865047     8258026.384885
-191817.375806     8258012.641054
-191828.833586     8257992.694240
-191833.953025     8257980.835904
-191839.693505     8257969.609585
-191844.819507     8257957.124513
-191855.604089     8257942.184076
-191870.732122     8257931.668863
-191887.715183     8257923.676804
-191905.325078     8257915.690399
-191928.008052     8257900.857310
-191945.015061     8257890.359049
-191954.501135     8257880.419731
-191967.738601     8257871.140670
-191987.313640     8257853.773506
-191998.063447     8257842.592380
-192012.565410     8257832.071519
-192027.687649     8257822.182668
-192038.425864     8257812.254646
-192046.659798     8257802.304030
-192055.519805     8257792.358681
-192065.029063     8257779.913155
-192078.324484     8257764.368958
-192088.442427     8257753.808544
-192098.647298     8257733.850809
-192106.289937     8257720.135233
-192117.683203     8257707.079909
-192126.560593     8257695.255478
-192137.919849     8257685.959472
-192153.023934     8257677.950460
-192166.250576     8257669.924128
-192177.591678     8257662.507962
-192190.191486     8257654.475974
-192208.456429     8257643.362650
-192224.193143     8257634.732932
-192239.263221     8257630.482857
-192251.799276     8257629.342748
-192273.085222     8257630.161203
-192288.694433     8257635.314862
-192303.097107     8257635.444803
-192321.924371     8257631.228624
-192337.759613     8257611.947716
-192348.608709     8257590.115789
-192365.609155     8257580.244265
-192391.324721     8257576.090232
-192404.521618     8257571.196844
-192418.988806     8257564.435294
-192430.939360     8257558.903865
-192442.884116     8257553.999180
-192454.822314     8257549.720848
-192467.398938     8257544.195068
-192491.908727     8257535.017706
-192507.599077     8257531.400021
-192524.548130     8257527.166898
-192543.334825     8257527.336391
-192570.261962     8257527.579327
-192584.050921     8257526.450522
-192609.157803     8257520.411377
-192621.688060     8257519.898012
-192639.262419     8257515.670530
-192667.494618     8257510.286376
-192685.145083     8257497.914300
-192701.513665     8257488.663488
-192714.733745     8257481.263892
-192731.723368     8257472.645096
-192746.166611     8257468.389364
-192763.799686     8257457.897135
-192779.501632     8257453.025964
-192796.449917     8257448.793216
-192811.560565     8257440.157468
-192826.653823     8257433.401567
-192840.482587     8257427.887083
-192853.720054     8257418.608023
-192870.072014     8257411.236682
-192884.567415     8257401.342557
-192902.797586     8257393.988162
-192919.171962     8257384.110990
-192934.282610     8257375.475242
-192943.165797     8257363.024067
-192953.886626     8257354.975510
-192963.378498     8257344.409448
-192979.781852     8257331.399707
-192989.900559     8257320.839301
-193000.621388     8257312.790743
-193015.105965     8257304.149347
-193028.360817     8257292.990822
-193039.725105     8257283.068066
-193052.353887     8257271.903892
-193071.256492     8257259.543113
-193082.656317     8257245.861435
-193092.803233     8257232.168836
-193100.434281     8257219.706364
-193104.985609     8257201.576861
-193107.606565     8257189.069189
-193112.140503     8257172.819533
-193116.652026     8257159.075709
-193121.858402     8257137.819286
-193129.582176     8257115.332749
-193134.133504     8257097.203246
-193134.892871     8257082.799157
-193135.692807     8257064.009397
-193140.221716     8257048.386108
-193146.594064     8257036.538694
-193153.438372     8257015.742421
-END
-LINE3D
-HEIGHT 1030.000000
-193006.656920     8252439.510903
-193031.973661     8252417.450339
-193052.227054     8252398.267240
-193105.168051     8252371.313464
-193120.106395     8252361.784889
-193129.406376     8252351.677366
-193142.510781     8252347.178398
-193155.576739     8252338.292426
-193169.236215     8252325.641337
-193191.042363     8252314.174225
-193207.270557     8252309.021155
-193220.336515     8252300.135183
-193233.353051     8252285.609979
-193250.169272     8252276.065296
-193260.105945     8252267.206164
-193279.457934     8252261.399758
-193303.734706     8252246.150664
-193333.610630     8252227.093520
-193350.997637     8252211.276977
-193361.499603     8252195.519488
-193377.662660     8252182.846926
-193388.839760     8252172.724068
-193398.787421     8252165.118694
-193409.965278     8252154.995064
-193428.027417     8252144.813152
-193436.696209     8252134.085264
-193457.233706     8252120.748638
-193476.596676     8252116.195225
-193491.535020     8252106.666649
-193511.480527     8252097.095126
-193524.590424     8252093.222655
-193540.192913     8252088.074952
-193552.704565     8252087.341094
-193571.452819     8252084.046806
-193593.983522     8252083.853556
-193615.894011     8252084.292170
-193628.427632     8252086.065063
-193647.872988     8252090.912155
-193662.300958     8252094.548430
-193682.953784     8252094.371287
-193721.170120     8252098.430069
-193736.816548     8252098.295868
-193760.598660     8252098.091885
-193781.866974     8252096.656376
-193796.854747     8252092.767798
-193812.495678     8252092.006335
-193842.525379     8252090.495679
-193859.380042     8252085.337236
-193871.864234     8252081.470131
-193894.444366     8252086.916879
-193910.101775     8252088.035670
-193937.013936     8252087.804841
-193953.906282     8252087.033409
-193970.161943     8252085.014351
-193987.016605     8252079.855909
-194000.741218     8252074.724313
-194018.254541     8252073.321011
-194030.771683     8252073.213650
-194043.980431     8252080.620408
-194057.200166     8252089.280924
-194068.537298     8252097.331044
-194085.517513     8252106.585849
-194103.157148     8252119.595024
-194119.561088     8252134.495193
-194132.791804     8252144.408702
-194147.236253     8252149.925231
-194158.556142     8252156.095103
-194171.759398     8252162.875365
-194197.513512     8252173.308002
-194208.844389     8252180.731632
-194229.563880     8252188.073970
-194242.130451     8252193.606606
-194252.830126     8252200.408341
-194267.263593     8252204.671877
-194281.065095     8252208.313526
-194298.035086     8252216.314567
-194320.631697     8252223.641569
-194336.305585     8252226.640614
-194352.583208     8252227.127542
-194367.609422     8252227.625203
-194385.759431     8252227.469528
-194400.779390     8252227.340699
-194413.296533     8252227.233338
-194435.806031     8252224.533331
-194450.189305     8252223.156877
-194463.914682     8252218.025275
-194485.121821     8252209.696783
-194498.813483     8252200.805444
-194518.072876     8252184.346298
-194529.809773     8252166.697821
-194540.954686     8252152.815213
-194552.753521     8252142.059714
-194568.301098     8252130.646283
-194588.223871     8252118.568016
-194605.000888     8252104.637101
-194614.300868     8252094.529578
-194623.611843     8252085.676578
-194632.900842     8252074.316062
-194643.314939     8252048.532336
-194654.415914     8252029.636227
-194661.750147     8252009.518575
-194675.331977     8251988.095013
-194681.447753     8251971.747837
-194692.543237     8251952.225232
-194707.942527     8251923.891809
-194725.868132     8251898.043656
-194740.091374     8251878.494223
-194753.702185     8251860.203130
-194761.727267     8251847.600369
-194772.866683     8251833.090499
-194780.250352     8251818.613609
-194785.153166     8251806.664171
-194796.303570     8251793.408059
-194815.530005     8251773.188405
-194827.931818     8251759.921560
-194839.751101     8251751.673589
-194848.430110     8251742.198701
-194859.596986     8251730.822078
-194863.823903     8251713.238016
-194872.449521     8251697.496621
-194879.195733     8251681.771346
-194882.825177     8251667.326656
-194895.150101     8251645.286567
-194904.395168     8251628.913315
-194924.873012     8251608.682928
-194935.396948     8251595.432189
-194950.285099     8251580.263623
-194958.916208     8251565.148724
-194968.150294     8251547.522480
-194972.987207     8251528.053556
-194976.587656     8251510.474867
-194976.362488     8251484.782396
-194976.236170     8251470.369154
-194976.670420     8251448.431053
-194980.869884     8251427.714509
-194983.878343     8251413.900924
-194988.116248     8251397.570620
-194997.960324     8251378.058748
-195010.937648     8251359.146545
-195017.000000     8251352.723160
-END
-LINE3D
-HEIGHT 1030.000000
-195017.000000     8250030.721394
-195014.952128     8250031.768681
-194992.488097     8250039.482175
-194968.787600     8250049.085905
-194935.057827     8250056.895262
-194888.803894     8250064.185497
-194851.329356     8250073.280826
-194806.976797     8250083.061691
-194758.866956     8250092.874784
-194727.031539     8250102.548288
-194690.170953     8250110.384499
-194654.502900     8250111.317737
-194627.601720     8250112.801560
-194611.324861     8250112.314625
-194599.394212     8250108.029622
-194585.614680     8250106.894724
-194569.935301     8250103.269183
-194545.516497     8250102.224775
-194528.607679     8250101.116717
-194516.057587     8250097.464335
-194497.917795     8250098.873010
-194479.686171     8250089.628938
-194462.024567     8250074.113013
-194452.477443     8250056.020549
-194440.493408     8250045.469804
-194432.889304     8250034.881492
-194422.155907     8250024.319255
-194410.770118     8250010.629896
-194398.746872     8249995.692153
-194389.276636     8249986.372934
-194379.164217     8249975.178827
-194365.944488     8249966.519076
-194349.633144     8249962.271646
-194333.350031     8249961.158222
-194312.708186     8249962.588357
-194293.377402     8249970.901521
-194275.305046     8249979.830433
-194254.064192     8249984.399189
-194235.947133     8249988.314607
-194220.300705     8249988.448809
-194206.532154     8249988.566904
-194185.252860     8249988.749420
-194160.185625     8249985.204399
-194137.605492     8249979.757651
-194119.993318     8249969.881723
-194108.063439     8249965.597478
-194091.643020     8249948.817055
-194083.385752     8249935.100862
-194073.223904     8249918.266758
-194063.078542     8249903.313673
-194045.444398     8249890.930995
-194026.652206     8249889.211783
-194007.881983     8249889.999321
-193990.358442     8249890.149623
-193981.513911     8249880.825037
-193961.903803     8249857.179229
-193949.254853     8249842.246853
-193935.436109     8249836.724957
-193919.712792     8249828.085915
-193902.771024     8249823.218114
-193890.758759     8249809.533364
-193868.716462     8249794.055012
-193854.887501     8249787.280117
-193840.410102     8249778.003845
-193822.820661     8249770.634660
-193799.542662     8249757.046538
-193775.062691     8249749.109911
-193760.629988     8249744.846368
-193736.858100     8249746.304115
-193718.093368     8249747.718150
-193700.575317     8249748.494949
-193664.906494     8249749.427429
-193634.865811     8249749.685093
-193600.443670     8249749.980336
-193566.016038     8249749.649084
-193532.170172     8249744.298964
-193495.815234     8249738.343821
-193461.343671     8249732.999833
-193437.501142     8249726.310060
-193420.564100     8249722.068763
-193396.644690     8249706.606511
-193382.172782     8249697.956735
-193367.656943     8249684.294224
-193355.018973     8249670.614840
-193337.369122     8249656.352666
-193318.505538     8249646.487471
-193299.010754     8249636.000382
-193280.772875     8249626.129820
-193266.937659     8249618.728435
-193250.616098     8249613.228006
-193237.412841     8249606.447745
-193221.727966     8249602.194942
-193202.233188     8249591.708617
-193184.044731     8249587.477288
-193165.850790     8249582.620228
-193148.266839     8249575.877540
-193126.938116     8249570.420058
-193106.284525     8249570.597207
-193086.872120     8249569.509858
-193069.968792     8249569.028297
-193052.444488     8249569.178606
-193033.043070     8249569.345015
-193016.770938     8249569.484583
-192997.984243     8249568.392633
-192977.945369     8249567.310657
-192956.040370     8249567.498540
-192934.761075     8249567.681055
-192914.761413     8249570.986078
-192894.745279     8249572.411611
-192876.628220     8249576.327030
-192857.259753     8249580.253182
-192839.795858     8249587.296481
-192821.689787     8249592.465657
-192799.839708     8249598.920033
-192780.498700     8249605.979432
-192764.297966     8249614.265748
-192743.726754     8249623.842638
-192722.540820     8249634.677887
-192699.483270     8249646.156497
-192668.300254     8249658.957888
-192640.246522     8249671.732439
-192614.701863     8249685.112012
-192591.056286     8249700.982235
-192565.500645     8249713.108816
-192536.799240     8249723.381983
-192517.469221     8249731.695139
-192493.154001     8249742.557229
-192472.571808     8249750.881125
-192450.101515     8249757.967365
-192418.237875     8249764.507628
-192388.256838     8249771.658289
-192359.500513     8249775.664962
-192332.632290     8249780.909292
-192300.746680     8249784.942806
-192273.208815     8249785.179002
-192250.052407     8249785.377618
-192235.026193     8249784.879957
-192220.593490     8249780.616414
-192206.198471     8249780.739882
-192191.754029     8249775.224118
-192176.058173     8249769.718323
-192160.988784     8249764.207154
-192142.750905     8249754.336592
-192126.434835     8249749.462660
-192113.857282     8249742.677031
-192099.994607     8249732.142400
-192083.662058     8249725.388213
-192070.442329     8249716.728462
-192059.736393     8249709.299472
-192046.412316     8249688.733230
-192040.038408     8249675.626662
-192033.033313     8249661.899730
-192023.541108     8249650.073760
-192016.557981     8249638.853578
-192001.959756     8249615.790560
-191991.161223     8249597.708830
-191982.256281     8249581.491254
-191970.814808     8249561.535408
-191958.764866     8249543.464412
-191947.378312     8249529.775060
-191936.013721     8249518.591693
-191923.392230     8249506.792564
-191912.033900     8249496.236452
-191897.523551     8249483.200436
-191886.785428     8249472.011696
-191874.163938     8249460.212567
-191863.397597     8249445.891351
-191851.408066     8249434.713345
-191840.669179     8249423.524612
-191826.823746     8249414.870227
-191811.100429     8249406.231185
-191786.609470     8249397.040801
-191769.640235     8249389.038988
-191755.783051     8249379.130853
-191740.685438     8249370.486444
-191726.203313     8249360.583669
-191707.970925     8249351.339603
-191689.085373     8249338.967658
-191667.685258     8249325.364194
-191650.079338     8249316.114756
-191635.629399     8249309.971730
-191622.415154     8249301.937711
-191609.826614     8249293.898324
-191594.729009     8249285.254680
-191576.491123     8249275.383354
-191558.242263     8249264.259799
-191536.254885     8249255.047941
-191513.005110     8249244.593059
-191501.036790     8249235.922575
-191479.038424     8249225.456959
-191467.674603     8249214.274351
-191455.069584     8249204.354710
-191436.831705     8249194.484149
-191416.095736     8249185.261557
-191387.229573     8249176.735243
-191367.142040     8249170.014029
-191346.450009     8249165.804938
-191323.260651     8249162.243811
-191303.199808     8249158.655085
-191283.765440     8249155.061751
-191266.202694     8249150.825820
-191249.881133     8249145.325391
-191229.173387     8249139.236040
-191210.951980     8249131.244968
-191182.069345     8249120.839164
-191155.700509     8249111.664887
-191132.478200     8249104.344016
-191112.988906     8249094.483423
-191087.212824     8249081.544036
-191062.634758     8249062.327408
-191031.221082     8249048.809832
-191012.341021     8249037.064383
-190993.482928     8249027.825684
-190977.743133     8249017.306388
-190961.997854     8249006.161360
-190948.146160     8248996.879721
-190933.620097     8248981.963445
-190907.168881     8248963.389427
-190886.960522     8248942.881468
-190865.554917     8248928.651507
-190842.930846     8248918.191258
-190824.050791     8248906.446574
-190796.430546     8248897.283030
-190775.112804     8248893.078541
-190762.535251     8248886.292913
-190749.299044     8248875.752908
-190737.978391     8248869.583042
-190724.758656     8248860.922526
-190708.985910     8248846.643486
-190701.388061     8248836.681664
-190687.475957     8248820.507035
-190667.898793     8248800.620205
-190654.031391     8248789.459070
-190642.030114     8248777.028078
-190629.408623     8248765.228948
-190616.155937     8248752.808689
-190605.417050     8248741.619956
-190590.896484     8248727.330941
-190573.816647     8248706.796148
-190551.082744     8248683.803676
-190534.700773     8248671.410258
-190517.660147     8248655.262462
-190497.489465     8248639.140749
-190477.917798     8248619.881181
-190460.217754     8248599.979016
-190445.647752     8248580.049239
-190434.870424     8248564.474266
-190417.846277     8248550.206724
-190399.569950     8248535.949158
-190381.277152     8248519.812103
-190366.745598     8248504.269331
-190353.487422     8248491.222575
-190338.960595     8248476.306306
-190318.081836     8248450.790984
-190295.375386     8248430.930994
-190272.701893     8248414.831513
-190260.052943     8248399.899137
-190246.147093     8248384.350998
-190233.509131     8248370.672379
-190223.390458     8248358.851782
-190216.989097     8248342.612733
-190205.542891     8248322.029619
-190196.006754     8248305.190913
-190187.134763     8248292.733080
-190171.976740     8248277.195681
-190152.432533     8248261.069359
-190133.514031     8248244.937671
-190119.591702     8248227.509278
-190106.255874     8248205.689285
-190092.959250     8248188.255525
-190079.014959     8248168.321146
-190063.851446     8248152.157250
-190039.925781     8248136.068509
-190016.615596     8248118.720637
-189998.300829     8248100.076831
-189983.120837     8248082.032682
-189969.840692     8248066.479176
-189957.806465     8248050.288440
-189945.135549     8248032.849696
-189929.978290     8248017.312290
-189904.784738     8247999.354028
-189884.564634     8247977.593083
-189868.083808     8247953.920052
-189849.758056     8247934.022871
-189835.199042     8247915.346852
-189820.699678     8247903.564211
-189806.178341     8247889.274438
-189787.924751     8247877.523999
-189767.172307     8247866.421536
-189752.700399     8247857.771760
-189735.714692     8247847.890458
-189718.685048     8247832.995656
-189696.027266     8247818.776053
-189675.259107     8247805.793329
-189648.270060     8247797.251297
-189629.428443     8247789.892470
-189614.363784     8247785.008187
-189598.009273     8247775.748015
-189587.271153     8247764.559657
-189575.319302     8247757.768279
-189562.659370     8247741.582910
-189544.344603     8247722.939105
-189522.225416     8247698.687509
-189499.540939     8247681.334652
-189479.414963     8247670.226816
-189463.037718     8247658.459900
-189444.817078     8247650.469204
-189428.472788     8247642.462414
-189409.631170     8247635.103587
-189394.550800     8247628.339425
-189376.966082     8247621.596361
-189359.353908     8247611.720433
-189336.060201     8247596.252815
-189312.145517     8247581.417067
-189283.279357     8247572.891135
-189251.267434     8247562.511790
-189227.402178     8247553.316038
-189202.280021     8247543.504142
-189177.795319     8247534.940630
-189143.285305     8247525.209254
-189109.400998     8247515.472895
-189077.998303     8247503.208311
-189049.077221     8247488.415503
-189003.817341     8247466.242784
-188968.599247     8247447.117417
-188939.678164     8247432.324609
-188911.410245     8247420.659682
-188881.264453     8247409.011243
-188856.751525     8247397.314108
-188836.631039     8247386.832768
-188814.616201     8247374.487664
-188789.488556     8247364.049653
-188759.364730     8247354.907583
-188738.047755     8247350.703470
-188717.383180     8247349.627244
-188696.724099     8247349.177896
-188670.438405     8247349.403353
-188642.867586     8247345.879423
-188619.019570     8247338.563537
-188596.411217     8247329.983931
-188573.155955     8247318.902935
-188546.754929     8247305.968525
-188515.955973     8247291.192207
-188493.315431     8247278.852469
-188475.072058     8247268.355029
-188466.227526     8247259.030442
-188454.215265     8247245.346075
-188444.695600     8247230.386858
-188426.424771     8247216.756553
-188402.538310     8247205.054045
-188386.227734     8247200.806991
-188371.832715     8247200.930460
-188351.860512     8247207.368729
-188336.933152     8247218.150680
-188326.990986     8247226.382933
-188311.437922     8247237.170250
-188293.381276     8247247.979041
-188265.250656     8247251.980348
-188240.896996     8247258.456198
-188220.880858     8247259.881348
-188200.260218     8247263.818241
-188179.008383     8247267.134003
-188157.756548     8247270.449766
-188139.013788     8247274.370933
-188124.026779     8247278.259505
-188110.910628     8247281.505487
-188092.173359     8247286.053151
-188075.281013     8247286.824583
-188050.883418     8247288.287314
-188016.488736     8247291.715805
-187988.956746     8247292.578877
-187960.798667     8247293.446936
-187938.899158     8247294.261315
-187908.858093     8247294.518982
-187878.185451     8247294.155522
-187852.487018     8247289.988990
-187832.454023     8247289.534272
-187811.136284     8247285.330166
-187776.039010     8247279.990779
-187745.311448     8247273.360826
-187726.497290     8247269.135246
-187707.051938     8247264.288537
-187688.852500     8247258.804215
-187659.283365     8247241.510409
-187646.716797     8247235.978156
-187627.282426     8247232.384439
-187605.273082     8247220.666213
-187581.358780     8247205.830461
-187563.098932     8247193.453149
-187542.352360     8247182.977179
-187516.593516     8247171.917657
-187498.361128     8247162.673592
-187484.493341     8247151.512078
-187474.358956     8247137.811603
-187472.936916     8247118.396363
-187468.896345     8247085.842726
-187468.786506     8247073.309739
-187468.594287     8247051.377011
-187468.473464     8247037.590648
-187468.347150     8247023.177790
-187465.728236     8247010.039397
-187464.943267     8246991.872162
-187462.236483     8246968.707532
-187458.322225     8246950.566755
-187456.949614     8246936.791511
-187446.842308     8246926.224287
-187433.688476     8246925.083640
-187416.751814     8246920.841956
-187394.144225     8246912.262344
-187382.796494     8246902.959228
-187373.929993     8246891.127891
-187369.428094     8246877.379106
-187372.365161     8246855.419538
-187376.586973     8246837.209359
-187382.082541     8246821.494811
-187381.939748     8246805.201698
-187377.964698     8246780.167933
-187371.568829     8246764.555380
-187367.066929     8246750.806595
-187363.125215     8246729.532953
-187361.758091     8246716.383823
-187356.624997     8246702.013908
-187352.106622     8246686.385251
-187351.316159     8246667.591137
-187347.434473     8246653.210489
-187346.693439     8246640.056372
-187346.561631     8246625.016634
-187346.418842     8246608.723903
-187350.673600     8246594.273085
-187357.415087     8246577.921307
-187367.231321     8246555.276192
-187375.252054     8246542.046541
-187398.227610     8246521.168569
-187414.389903     8246508.496014
-187423.058692     8246497.767744
-187432.929464     8246481.389125
-187449.618989     8246457.431587
-187462.553139     8246433.505877
-187470.590351     8246422.156481
-187471.682877     8246403.973142
-187471.556559     8246389.559901
-187465.792270     8246374.568856
-187465.034375     8246359.534488
-187460.505016     8246342.652456
-187454.751711     8246328.914787
-187445.215571     8246312.075698
-187435.102773     8246300.881977
-187423.079909     8246285.944231
-187413.990739     8246277.000000
-END
+
+SAMPLE
+INFO
+//Amostras de Modelagem Num�rica
+//Arquivo ASCII gerado pelo Sistema SPRING
+//Projeto: Brasilia - Plano de informa��o: Mapa Altimetrico
+//Categoria: Altimetria - Modelo: DIGITALMODEL
+PROJECTION	UTM/SAD69, HEMIS 1, ORIG.LAT n 0   0   0.00, ORIG.LONG o 45  0   0.00, LAT1 n 0   0   0.00, LAT2 n 0   0   0.00
+DATUM	SAD69, Prd 6378160.000000, Pflt 0.003353, Pdx 0.000000, Pdy 0.000000, Pdz 0.000000
+OFFSETX  500000.000000   OFFSETY  10000000.000000   SCALEFACTOR  0.999600
+BOX	183557.000000, 8246277.000000, 195017.000000, 8258937.000000
+UNITS Metros
+SCALE	25000.000000
+INFO_END
+POINT3D
+183763.136324     8246449.883481   1051.000000
+184772.200422     8246432.858473   1055.000000
+184933.756147     8246310.125748   1053.000000
+187045.291487     8246576.788397   1039.000000
+187629.400857     8246523.169623   1028.000000
+187935.089403     8246543.527406   1024.000000
+191516.337040     8246284.351177   1039.000000
+192200.352801     8246555.336354   1033.000000
+192350.927497     8246958.982785   1024.000000
+194569.636946     8246399.594222   1004.000000
+194856.376362     8246508.565860   1007.000000
+183581.777412     8247569.058595   1081.000000
+186808.168262     8247622.477620   1067.000000
+189137.849654     8247749.747966   1039.000000
+190013.552762     8247853.385130   1024.000000
+191642.101449     8247529.090454   1016.000000
+192648.485403     8247173.305625   1022.000000
+192592.347356     8247045.343808   1024.000000
+193243.309165     8247581.285668   1011.000000
+193560.350509     8247673.819406   1009.000000
+184395.125114     8248163.848770   1099.000000
+185523.431897     8248591.936516   1095.000000
+185290.544174     8248170.118365   1097.000000
+186627.238229     8248404.192659   1083.000000
+186142.892820     8248053.010047   1088.000000
+187695.841631     8248537.095232   1068.000000
+188722.987421     8248446.469126   1066.000000
+189372.130636     8248823.354853   1068.000000
+190981.520773     8248794.909293   1019.000000
+191753.958859     8248083.030257   1007.000000
+192191.650408     8248222.500210   1004.000000
+184643.833397     8249079.901098   1094.000000
+185279.791036     8249070.907225   1094.000000
+185776.928104     8249171.848138   1089.000000
+187173.053629     8249096.293056   1069.000000
+187525.819440     8249302.074228   1084.000000
+194835.865056     8249375.150502   1009.000000
+183696.646807     8250966.779061   1116.000000
+187994.714711     8250884.552777   1114.000000
+188157.974162     8250656.035656   1114.000000
+188341.115398     8250591.862557   1116.000000
+189221.750814     8250544.685928   1118.000000
+192360.864133     8250616.171156   1066.000000
+192344.580872     8250850.080348   1065.000000
+193238.690102     8250354.826261   1052.000000
+194099.246060     8250427.551725   1041.000000
+194626.234236     8250617.857655   1039.000000
+185708.103458     8251502.375029   1146.000000
+186267.110719     8251725.105398   1156.000000
+187786.399506     8251151.820053   1119.000000
+189638.414815     8251484.610618   1124.000000
+190924.509897     8251596.443768   1095.000000
+191262.884122     8251646.730943   1083.000000
+190854.921987     8251921.202739   1091.000000
+191983.029415     8251769.281982   1071.000000
+192770.408228     8251182.205617   1066.000000
+193668.766373     8251355.688547   1049.000000
+194043.497654     8251363.335240   1048.000000
+194340.156191     8251516.913088   1039.000000
+194508.921666     8251024.267138   1036.000000
+187520.769322     8252840.698960   1172.000000
+187638.190285     8252590.499903   1167.000000
+189963.770381     8252148.899609   1126.000000
+190940.785974     8252147.109632   1095.000000
+192092.326594     8252874.127279   1046.000000
+193629.280597     8252680.529512   1005.000000
+193950.865361     8252219.036945   1021.000000
+194765.073028     8252294.179475   1014.000000
+187865.316483     8253827.357148   1146.000000
+190029.123691     8253647.530356   1114.000000
+193159.419932     8253877.908770   1029.000000
+192316.432307     8253102.971933   1046.000000
+184327.119988     8254484.507995   1111.000000
+185276.553666     8254323.189033   1128.000000
+186617.762720     8254820.919697   1144.000000
+192226.024445     8254247.964593   1051.000000
+192697.220994     8254599.571137   1035.000000
+194163.203690     8254344.149789   1011.000000
+184437.453500     8255638.224856   1098.000000
+189652.770070     8255061.726606   1088.000000
+193001.067716     8255589.099723   1006.000000
+193216.822682     8255442.784077   1008.000000
+193387.790742     8255163.045163   1012.000000
+188573.581405     8256246.595460   1095.000000
+191259.137951     8256658.584110   1035.000000
+188066.824095     8258575.908150   1012.000000
+190559.364669     8258400.759301   1006.000000
+192364.754900     8258041.180620   1034.000000
+193023.369720     8258138.802827   1032.000000
+194515.894805     8257985.046612   1018.000000
+END
+LINE3D
+HEIGHT 1030.000000
+192017.710448     8246277.000000
+192028.960661     8246302.084291
+192038.021544     8246322.258334
+192047.778796     8246338.060362
+192052.581878     8246350.655890
+192058.646093     8246362.644458
+192064.053665     8246376.501522
+192077.362993     8246404.879874
+192088.805168     8246432.603627
+192093.556868     8246448.328815
+192104.535521     8246466.027785
+192109.923609     8246481.136806
+192118.974371     8246501.936631
+192127.954266     8246527.118074
+192135.743137     8246548.524465
+192146.045663     8246569.343887
+192152.694885     8246583.845948
+192159.374475     8246596.470282
+192163.439933     8246615.941323
+192167.546645     8246632.908867
+192168.585059     8246646.072542
+192175.769432     8246666.217779
+192178.685113     8246679.410654
+192180.288291     8246696.339385
+192186.745162     8246722.734353
+192190.872122     8246738.449952
+192194.403185     8246752.278210
+192194.170344     8246766.674626
+192193.897006     8246783.574933
+192193.684413     8246796.719404
+192178.628021     8246798.992791
+192164.823400     8246801.285392
+192154.065313     8246808.633021
+192146.355275     8246821.036464
+192154.922261     8246833.063834
+192166.678271     8246841.383388
+192180.310790     8246849.731749
+192185.053127     8246866.083113
+192179.229726     8246877.889198
+192162.154329     8246888.897002
+192149.509605     8246896.841989
+192129.911952     8246909.062949
+192108.457275     8246920.003146
+192090.242998     8246924.106249
+192077.659013     8246928.295782
+192063.268621     8246928.074879
+192046.285108     8246933.448750
+192036.142397     8246941.432144
+192025.324322     8246952.536003
+192001.316250     8246966.567453
+191971.001765     8246983.632544
+191943.865414     8246997.615973
+191919.333074     8247005.378476
+191896.123366     8247008.778959
+191865.929601     8247018.332749
+191833.213575     8247029.100076
+191806.208829     8247034.946433
+191781.182592     8247034.562263
+191756.277833     8247026.667185
+191722.644877     8247016.759547
+191692.109068     8247008.777646
+191670.332595     8247000.930207
+191646.073594     8246991.792403
+191623.681738     8246983.309581
+191607.495824     8246978.052473
+191590.129007     8246968.394532
+191574.649583     8246958.139627
+191561.662815     8246948.548923
+191543.156354     8246931.986269
+191520.421691     8246905.967744
+191488.434564     8246871.667714
+191461.935997     8246846.217347
+191439.252715     8246817.069161
+191418.939841     8246796.096455
+191401.776258     8246773.919836
+191385.772574     8246757.395603
+191362.351668     8246735.122930
+191345.146825     8246715.450190
+191331.615542     8246700.842485
+191321.212544     8246686.282419
+191307.710865     8246669.796975
+191296.743103     8246651.471852
+191282.707037     8246629.343243
+191268.106206     8246603.449578
+191243.444415     8246580.531920
+191227.369864     8246568.389304
+191213.242683     8246551.894258
+191197.844253     8246536.631571
+191184.464823     8246512.634849
+191169.268865     8246484.853473
+191155.767951     8246468.368041
+191142.276400     8246451.256433
+191117.574119     8246430.842283
+191095.374614     8246410.466553
+191083.215820     8246388.366761
+191065.577825     8246356.791512
+191045.951956     8246332.072965
+191019.514134     8246302.866763
+190997.960375     8246281.249071
+190994.928643     8246277.000000
+END
+LINE3D
+HEIGHT 1020.000000
+190762.652027     8246277.000000
+190763.339402     8246277.647474
+190784.933653     8246296.761657
+190796.023663     8246307.575501
+190804.580527     8246320.228653
+190815.629283     8246333.545993
+190825.941936     8246353.739252
+190835.618201     8246374.548679
+190845.274218     8246396.610051
+190862.448685     8246418.160900
+190886.514578     8246439.191218
+190906.837574     8246459.538142
+190920.328367     8246476.649356
+190936.302446     8246495.051329
+190950.983500     8246515.937583
+190970.004871     8246539.394976
+190985.947817     8246559.674664
+191000.771367     8246571.797694
+191016.785179     8246587.695764
+191030.901470     8246604.816962
+191041.900365     8246621.264369
+191050.951127     8246642.064194
+191064.360927     8246664.183189
+191074.764695     8246678.742885
+191083.351928     8246689.518309
+191094.400684     8246702.835650
+191105.419828     8246718.031111
+191116.326851     8246740.111687
+191130.806198     8246773.516642
+191143.630991     8246793.122145
+191150.240479     8246810.128108
+191157.535446     8246823.388208
+191167.181342     8246846.075362
+191178.653893     8246871.921006
+191195.998302     8246921.648507
+191218.086450     8246948.909364
+191247.087030     8246974.398138
+191272.909476     8247002.968575
+191295.007745     8247029.603650
+191308.518781     8247045.463301
+191318.922549     8247060.022997
+191338.074761     8247075.343307
+191360.909896     8247095.102475
+191381.797656     8247119.214456
+191395.299328     8247135.700282
+191413.734929     8247156.644171
+191436.448580     8247183.914629
+191464.248771     8247206.254527
+191490.252677     8247223.558209
+191514.440818     8247237.077248
+191525.561198     8247246.013365
+191538.537845     8247256.229850
+191550.828243     8247270.192570
+191561.271738     8247282.248746
+191583.583370     8247295.738979
+191604.057455     8247306.696875
+191627.630214     8247319.580531
+191646.873541     8247329.267278
+191660.526309     8247336.363693
+191677.318242     8247342.882360
+191696.642557     8247347.561707
+191716.027610     8247348.485601
+191738.530829     8247350.082915
+191762.931563     8247350.457483
+191782.326744     8247350.755213
+191798.614651     8247349.753370
+191814.326915     8247345.611858
+191833.813211     8247340.276025
+191855.237519     8247331.213555
+191878.467470     8247326.561508
+191899.225778     8247319.993327
+191914.948170     8247315.225652
+191930.054410     8247309.822964
+191945.807171     8247303.177562
+191960.934423     8247296.522940
+191976.041432     8247291.119882
+191995.507474     8247287.036376
+192023.127602     8247281.825402
+192049.495960     8247276.595213
+192076.480458     8247272.000802
+192105.977089     8247266.819016
+192136.715376     8247262.281846
+192154.950659     8247256.927191
+192171.913930     8247252.804883
+192191.411110     8247246.843280
+192217.184335     8247239.725762
+192247.942864     8247233.937028
+192275.491362     8247233.107661
+192298.722077     8247228.455626
+192323.809053     8247225.084342
+192347.644265     8247221.693461
+192373.357508     8247218.331791
+192394.023944     8247217.396779
+192414.691143     8247216.461779
+192434.711827     8247216.769110
+192452.230499     8247217.038034
+192475.369335     8247218.019551
+192507.843163     8247222.274433
+192528.438732     8247225.721039
+192550.941945     8247227.318735
+192573.445921     8247228.916443
+192597.200139     8247230.533343
+192623.468025     8247231.562511
+192642.863206     8247231.860241
+192656.617210     8247232.697311
+192669.735583     8247234.150944
+192692.188941     8247238.878324
+192707.173703     8247240.986544
+192719.636204     8247244.308301
+192733.905111     8247252.040494
+192752.593802     8247257.336021
+192765.096793     8247258.154270
+192783.744993     8247265.953306
+192796.146748     8247273.030899
+192808.619376     8247275.726493
+192822.272138     8247282.823290
+192837.873046     8247285.566905
+192865.402059     8247285.989495
+192879.278305     8247279.315669
+192885.929686     8247255.000115
+192891.319170     8247231.291508
+192892.177514     8247216.904694
+192893.793731     8247194.390421
+192887.840879     8247175.516345
+192878.022887     8247163.469771
+192863.290451     8247145.713178
+192852.765205     8247138.664390
+192837.689329     8247142.189733
+192823.843453     8247146.985832
+192809.009781     8247135.488583
+192799.888159     8247119.069994
+192790.232142     8247097.008622
+192785.450067     8247083.161542
+192780.051858     8247068.678303
+192773.422885     8247052.924297
+192766.309371     8247028.397824
+192755.452966     8247003.187575
+192750.690381     8246988.088156
+192729.812743     8246963.350394
+192719.369248     8246951.294219
+192703.385806     8246933.518422
+192692.911178     8246923.339961
+192674.949226     8246911.794692
+192653.809141     8246903.331084
+192635.059712     8246901.791011
+192613.161754     8246901.454862
+192589.366275     8246902.341841
+192572.957641     8246910.855368
+192554.671740     8246919.339696
+192540.776010     8246927.265479
+192528.807401     8246932.090777
+192516.243665     8246935.028364
+192497.433496     8246937.243745
+192485.616747     8246932.679644
+192472.136081     8246914.942266
+192466.132611     8246899.197862
+192462.610906     8246884.743811
+192462.874117     8246868.469667
+192463.218321     8246847.187742
+192467.225957     8246831.597016
+192475.128344     8246807.300665
+192479.780962     8246790.467965
+192480.710936     8246771.699544
+192488.562706     8246750.532866
+192492.599948     8246733.064400
+192492.832789     8246718.667984
+192493.096006     8246702.393459
+192487.920511     8246674.139967
+192483.209302     8246655.911269
+192478.477087     8246638.934124
+192472.433126     8246625.693228
+192466.368911     8246613.704660
+192453.564366     8246592.847211
+192439.325828     8246583.237292
+192430.739358     8246572.461879
+192420.325469     8246558.527965
+192409.388077     8246538.325116
+192396.007883     8246514.328382
+192391.831068     8246501.742467
+192382.719567     8246484.698096
+192366.170597     8246463.157232
+192360.732655     8246451.177895
+192344.345666     8246419.621849
+192338.443432     8246397.618100
+192330.664688     8246375.585546
+192318.576761     8246349.104136
+192304.692548     8246317.586510
+192293.703774     8246300.513322
+192285.773177     8246287.869784
+192277.890707     8246277.000000
+END
+LINE3D
+HEIGHT 1010.000000
+189554.337430     8246277.000000
+189562.967347     8246281.760004
+189587.215463     8246291.523578
+189605.833287     8246301.200722
+189630.102416     8246309.712362
+189654.966672     8246320.111714
+189679.810686     8246331.762628
+189700.921165     8246342.103974
+189720.870983     8246346.792923
+189753.334683     8246351.673969
+189789.551403     8246356.612627
+189823.901740     8246360.896315
+189850.704014     8246367.568647
+189885.679848     8246371.862319
+189923.148344     8246376.819810
+189952.534382     8246378.523163
+189983.109924     8246384.001161
+190018.712025     8246388.304447
+190045.594523     8246389.969369
+190078.078472     8246393.598469
+190112.418688     8246398.507939
+190153.025578     8246402.888052
+190181.119355     8246407.075698
+190208.587624     8246411.254123
+190237.922287     8246416.086754
+190278.519056     8246421.092649
+190302.859044     8246425.223053
+190321.557862     8246429.892417
+190338.359152     8246435.785290
+190358.259116     8246443.603923
+190382.517359     8246452.741333
+190409.218398     8246465.673010
+190432.185133     8246477.295489
+190452.024357     8246488.869577
+190470.561194     8246503.554121
+190491.035279     8246514.512017
+190510.319867     8246521.694884
+190527.766908     8246526.345414
+190539.512791     8246535.291133
+190551.268801     8246543.610688
+190563.024811     8246551.930243
+190575.396197     8246560.885563
+190590.239233     8246571.756636
+190605.113395     8246580.750376
+190620.683927     8246585.372100
+190633.701065     8246593.085078
+190651.551659     8246611.515474
+190659.493141     8246623.533241
+190668.675508     8246636.195995
+190697.584980     8246667.317950
+190734.547290     8246703.572547
+190772.185722     8246736.707073
+190791.277959     8246755.782848
+190807.281650     8246772.306700
+190815.889132     8246781.830179
+190831.852326     8246800.857921
+190844.727731     8246817.334134
+190860.711173     8246835.109931
+190887.138874     8246864.941915
+190917.198880     8246902.342431
+190941.052174     8246936.517602
+190960.134291     8246956.219159
+190971.768053     8246972.049992
+190981.566560     8246985.348523
+190994.966238     8247008.093300
+191012.634603     8247037.790822
+191029.132186     8247062.461729
+191039.414470     8247084.532715
+191047.253958     8247102.809434
+191052.550938     8247123.551636
+191056.596140     8247144.275004
+191063.750145     8247166.297969
+191071.427652     8247194.589868
+191078.500669     8247221.620232
+191086.117438     8247253.667585
+191096.166880     8247290.134988
+191100.969198     8247302.730504
+191103.239127     8247317.165722
+191106.790439     8247329.742034
+191115.003105     8247363.676729
+191121.156268     8247408.849731
+191122.134700     8247425.769254
+191126.683929     8247454.013132
+191131.264290     8247480.379295
+191142.554618     8247517.491683
+191150.888762     8247543.915469
+191157.386130     8247567.806547
+191161.512326     8247583.522134
+191165.679777     8247596.734224
+191174.104272     8247617.524435
+191186.747606     8247648.396693
+191198.381368     8247664.227527
+191212.630027     8247673.211665
+191230.581852     8247685.383098
+191251.712579     8247694.472499
+191270.300034     8247706.027371
+191283.932547     8247714.376113
+191298.978818     8247712.728509
+191312.742943     8247712.939798
+191337.012065     8247721.451820
+191377.416490     8247738.350240
+191405.872554     8247758.822013
+191422.048347     8247764.704902
+191439.374668     8247776.866734
+191468.557471     8247791.088764
+191500.859197     8247805.984609
+191513.291328     8247811.184093
+191528.256605     8247814.544270
+191559.377420     8247825.039664
+191585.593925     8247829.198492
+191617.441485     8247833.443761
+191639.319194     8247835.031855
+191657.392503     8247839.691999
+191671.106010     8247843.032960
+191691.732712     8247844.601850
+191712.329045     8247848.048468
+191729.211329     8247848.933560
+191746.709752     8247850.454429
+191770.413353     8247855.201002
+191791.614941     8247859.909166
+191804.077441     8247863.230924
+191817.841566     8247863.442213
+191832.928327     8247859.291100
+191863.020863     8247855.996273
+191880.670376     8247848.128113
+191892.649099     8247842.677415
+191908.936249     8247841.675178
+191930.471920     8247825.727200
+191938.304199     8247805.812861
+191940.403429     8247792.071032
+191933.169201     8247775.055478
+191921.413191     8247766.735923
+191908.345435     8247762.152619
+191889.565636     8247762.490272
+191873.227869     8247766.622182
+191849.533625     8247761.249816
+191844.196156     8247743.011123
+191860.604783     8247734.497978
+191876.246182     8247734.738084
+191889.385567     8247734.939783
+191914.523167     8247728.438445
+191925.885751     8247722.351970
+191940.367252     8247716.939692
+191957.472255     8247704.054149
+191975.788526     8247693.692094
+191994.720184     8247683.965041
+192012.995964     8247676.106495
+192029.414719     8247666.967187
+192043.330698     8247657.789458
+192062.373714     8247641.177279
+192083.929627     8247623.977737
+192109.783839     8247611.852820
+192138.110457     8247601.644049
+192160.221008     8247588.835727
+192186.741983     8247574.216533
+192214.453220     8247563.372379
+192243.415463     8247552.547428
+192269.895178     8247540.432113
+192287.616321     8247528.182347
+192307.163356     8247519.091060
+192322.179251     8247519.321564
+192337.195146     8247519.552069
+192355.954702     8247520.465978
+192378.951812     8247530.210348
+192398.901630     8247534.899298
+192419.427097     8247542.727533
+192442.474825     8247549.342230
+192466.814820     8247553.472253
+192493.647464     8247558.266858
+192513.032524     8247559.190369
+192533.618730     8247563.263151
+192551.055650     8247568.539462
+192566.636309     8247572.535023
+192582.903211     8247572.784731
+192599.796379     8247573.044053
+192618.505312     8247577.088017
+192635.962480     8247581.112383
+192652.169400     8247585.117939
+192672.028110     8247595.440069
+192696.922741     8247603.961311
+192716.236935     8247609.266440
+192739.265178     8247617.133095
+192767.348829     8247621.946904
+192787.924150     8247626.645455
+192811.588024     8247633.895548
+192841.598801     8247635.608491
+192870.954470     8247639.189570
+192899.744611     8247639.005582
+192919.917149     8247629.923897
+192941.916342     8247624.000701
+192958.315619     8247616.112967
+192976.621005     8247606.376683
+192996.087816     8247602.292806
+193013.172565     8247590.659591
+193032.094096     8247581.558701
+193048.583717     8247568.037775
+193064.397218     8247557.636919
+193078.445565     8247540.322131
+193096.882562     8247522.448393
+193110.981528     8247502.003932
+193126.886137     8247485.969895
+193135.282422     8247469.820218
+193139.915561     8247454.239093
+193143.902185     8247439.900300
+193147.293675     8247423.674178
+193148.878765     8247403.037239
+193150.454485     8247383.026857
+193154.471484     8247366.809955
+193154.815682     8247345.528412
+193158.197051     8247329.928071
+193158.440020     8247314.905491
+193155.162046     8247285.428872
+193154.799754     8247269.145126
+193150.067538     8247252.167980
+193146.647833     8247231.454596
+193142.460133     8247219.494451
+193129.726455     8247194.255386
+193119.313329     8247180.321483
+193107.567440     8247171.376147
+193089.544750     8247163.586331
+193069.564563     8247160.775108
+193052.045891     8247160.506185
+193023.448094     8247148.797647
+192998.685068     8247132.139333
+192988.897446     8247118.215033
+192984.104486     8247104.993723
+192967.576534     8247082.200543
+192956.628250     8247062.623846
+192941.574018     8247026.079616
+192934.924803     8247011.577173
+192923.925901     8246995.130149
+192911.020121     8246980.532045
+192901.131263     8246972.867089
+192881.817069     8246967.561960
+192863.743761     8246962.901817
+192844.419446     8246958.222469
+192832.159417     8246942.382023
+192822.926432     8246932.848942
+192812.059136     8246908.264845
+192807.943066     8246891.923095
+192799.406451     8246878.017998
+192794.643860     8246862.918961
+192789.882039     8246847.819554
+192785.765200     8246831.478174
+192782.264507     8246815.772189
+192780.701832     8246796.339185
+192774.738852     8246778.091272
+192768.028128     8246767.344654
+192753.043367     8246765.236434
+192734.283816     8246764.322143
+192716.684151     8246769.061000
+192700.346390     8246773.192527
+192675.269535     8246775.938029
+192660.990500     8246768.832000
+192651.142132     8246758.663536
+192633.876550     8246742.746250
+192627.873081     8246727.001846
+192627.470297     8246713.221609
+192618.520771     8246686.162440
+192614.343957     8246673.576525
+192613.294658     8246661.038620
+192604.355259     8246633.353287
+192598.412529     8246613.853429
+192585.012856     8246591.108269
+192575.336591     8246570.298843
+192568.152217     8246550.153605
+192562.310722     8246524.394402
+192558.306010     8246501.167525
+192558.044953     8246478.624435
+192554.524018     8246464.170013
+192553.656942     8246440.365364
+192552.740013     8246419.690399
+192551.791950     8246400.893150
+192547.675875     8246384.551781
+192543.488939     8246372.591648
+192533.862528     8246348.652538
+192529.110828     8246332.927349
+192523.097237     8246317.808726
+192518.334647     8246302.709689
+192514.904820     8246282.622087
+192514.154572     8246277.000000
+END
+LINE3D
+HEIGHT 1010.000000
+194093.713045     8246277.000000
+194095.101105     8246281.209294
+194102.981848     8246296.982516
+194112.759343     8246311.532980
+194120.689941     8246324.176518
+194134.363721     8246330.020999
+194145.513706     8246337.079377
+194162.255021     8246346.727716
+194178.349826     8246357.618005
+194193.839371     8246367.247129
+194211.831691     8246376.914671
+194223.001925     8246382.721104
+194244.031411     8246398.070231
+194263.193751     8246412.764377
+194284.233364     8246427.487341
+194297.290999     8246432.696427
+194313.416931     8246441.709383
+194330.319463     8246441.342529
+194349.311854     8246427.860404
+194367.668628     8246414.994077
+194389.163802     8246401.549989
+194401.182259     8246393.595389
+194411.960595     8246384.995815
+194416.572728     8246370.666242
+194419.933848     8246356.317847
+194426.605472     8246330.750729
+194427.544810     8246311.356133
+194429.059791     8246295.101205
+194432.471529     8246277.623138
+194432.709425     8246277.000000
+END
+LINE3D
+HEIGHT 1010.000000
+194985.449425     8246277.000000
+194992.473317     8246283.715046
+195009.174898     8246295.867287
+195017.000000     8246301.350941
+END
+LINE3D
+HEIGHT 1040.000000
+183655.558467     8246277.000000
+183659.717134     8246280.045811
+183677.083570     8246289.703746
+183694.480566     8246297.483957
+183714.975282     8246307.189913
+183739.940780     8246311.329537
+183762.454304     8246312.301455
+183785.603650     8246312.656814
+183806.875913     8246312.983358
+183825.019897     8246313.261881
+183841.902562     8246314.146978
+183866.908551     8246315.783094
+183892.550170     8246316.802648
+183913.822624     8246317.129195
+183929.545009     8246312.361902
+183941.574166     8246303.781147
+183964.875175     8246294.747486
+184004.514327     8246281.582303
+184012.826955     8246277.000000
+END
+LINE3D
+HEIGHT 1040.000000
+186145.811522     8246277.000000
+186152.231041     8246285.750898
+186169.960146     8246311.692966
+186187.698995     8246337.008865
+186205.519220     8246357.316988
+186220.292147     8246372.570073
+186235.105188     8246385.319261
+186249.282606     8246398.684628
+186268.364334     8246418.386562
+186278.717102     8246436.075924
+186285.386572     8246449.326040
+186292.722417     8246460.082254
+186304.992567     8246475.296919
+186320.391003     8246490.559224
+186340.239967     8246501.507524
+186360.108798     8246511.203872
+186386.264939     8246519.118542
+186403.096986     8246523.133313
+186419.939155     8246526.522301
+186434.954668     8246526.752800
+186449.345060     8246526.973702
+186467.488852     8246527.252222
+186484.926148     8246532.528922
+186511.062047     8246541.695155
+186522.131427     8246553.760938
+186529.477400     8246563.890989
+186543.725677     8246572.875121
+186564.876647     8246580.712958
+186572.848123     8246590.852611
+186576.944332     8246608.445931
+186579.183892     8246624.758876
+186592.745545     8246637.488854
+186615.692419     8246650.362902
+186642.463942     8246658.912956
+186666.168307     8246663.659540
+186687.339143     8246670.245426
+186704.171191     8246674.260196
+186720.417844     8246675.761850
+186736.685127     8246676.011564
+186750.449634     8246676.222859
+186764.920631     8246671.436356
+186788.140843     8246667.410097
+186811.925819     8246667.148894
+186825.710568     8246666.108626
+186843.854361     8246666.387146
+186851.190213     8246677.142978
+186860.795612     8246702.334023
+186861.077292     8246723.625555
+186854.587892     8246737.925929
+186846.857225     8246751.581312
+186842.779486     8246771.553668
+186863.253953     8246782.511570
+186876.372333     8246783.964820
+186894.324157     8246796.136254
+186905.846944     8246818.852219
+186910.639898     8246832.073911
+186917.944992     8246844.707847
+186930.739798     8246866.191082
+186946.249584     8246874.568643
+186959.943231     8246879.161173
+186976.764769     8246883.802101
+186989.227270     8246887.123859
+187011.629628     8246894.980905
+187032.104095     8246905.938807
+187045.161730     8246911.147893
+187054.404836     8246920.055193
+187071.024291     8246937.214434
+187081.407428     8246953.026069
+187092.476808     8246965.091852
+187101.669297     8246977.128824
+187113.384816     8246987.951888
+187125.120196     8246997.523382
+187138.066849     8247009.617983
+187149.731363     8247023.571095
+187160.770755     8247037.514611
+187175.442070     8247059.026652
+187189.992277     8247088.050372
+187202.948675     8247099.518803
+187212.171539     8247109.677665
+187223.240919     8247121.743449
+187235.007050     8247129.437222
+187251.061359     8247142.831401
+187268.347189     8247157.496742
+187277.570047     8247167.655986
+187286.075912     8247183.438804
+187289.506127     8247203.526030
+187301.644672     8247226.877767
+187320.513425     8247259.724166
+187339.554281     8247281.929602
+187350.603800     8247295.246954
+187363.529823     8247308.593494
+187373.933209     8247323.153184
+187384.285978     8247340.842547
+187397.171510     8247356.692596
+187413.256188     8247368.209048
+187426.233211     8247378.425922
+187436.727711     8247387.352049
+187455.224051     8247404.540483
+187467.565068     8247415.373531
+187486.828643     8247423.808332
+187504.851334     8247431.598148
+187517.807732     8247443.066579
+187529.533367     8247453.264243
+187540.623001     8247464.077699
+187552.964018     8247474.910747
+187564.709519     8247483.856459
+187575.193892     8247493.408750
+187589.411800     8247504.270609
+187607.454739     8247510.808480
+187622.399774     8247515.420220
+187637.395038     8247516.902664
+187655.478468     8247520.937026
+187674.772413     8247527.494100
+187690.403690     8247528.359988
+187703.481955     8247532.317135
+187720.313614     8247536.332281
+187748.407392     8247540.519927
+187773.413380     8247542.156042
+187791.496816     8247546.190022
+187815.210920     8247550.310819
+187842.719685     8247551.985354
+187870.197698     8247555.537610
+187894.578190     8247557.163742
+187923.297465     8247561.361371
+187957.062789     8247563.131949
+187986.418076     8247566.713023
+188010.828556     8247566.461421
+188024.613311     8247565.420771
+188050.295802     8247563.936822
+188070.316487     8247564.244153
+188092.850450     8247563.964129
+188126.020265     8247563.846989
+188151.682127     8247563.614980
+188179.221261     8247563.411788
+188209.273300     8247562.620852
+188243.058109     8247563.139472
+188274.351032     8247562.993521
+188297.561499     8247559.593432
+188320.155826     8247555.557565
+188340.247376     8247551.483279
+188369.714402     8247548.179232
+188391.632608     8247547.263436
+188414.156068     8247547.609187
+188436.054026     8247547.945336
+188464.834046     8247548.387129
+188496.671479     8247553.258562
+188519.760468     8247557.369380
+188543.443820     8247563.367898
+188563.949038     8247572.448079
+188585.079766     8247581.537479
+188610.004767     8247588.180994
+188626.150185     8247595.941992
+188639.147074     8247604.906915
+188655.241879     8247615.797204
+188674.475843     8247626.110126
+188688.118484     8247633.832705
+188709.803848     8247647.313325
+188723.456616     8247654.409740
+188739.592670     8247662.796914
+188759.532367     8247668.111645
+188779.451815     8247674.678321
+188797.545372     8247678.086519
+188819.392712     8247681.552341
+188842.461452     8247686.915104
+188867.467440     8247688.551220
+188886.781634     8247693.856349
+188901.676045     8247701.598144
+188919.092717     8247708.126400
+188937.751038     8247715.299655
+188956.378983     8247724.351018
+188970.073005     8247728.943936
+188986.854053     8247736.088373
+189006.712762     8247746.410503
+189029.751127     8247753.651376
+189052.203721     8247758.378745
+189073.445806     8247760.583019
+189088.400962     8247764.568977
+189103.233870     8247776.066214
+189112.446607     8247786.851240
+189123.506247     8247799.542811
+189133.293869     8247813.467111
+189145.442541     8247836.192685
+189159.417863     8247862.077130
+189172.333765     8247876.049452
+189192.717505     8247892.640540
+189226.127740     8247916.318813
+189258.963854     8247936.857822
+189277.439952     8247955.297820
+189295.280419     8247974.354380
+189314.916409     8247998.447145
+189340.325181     8248013.863498
+189376.945447     8248032.582404
+189399.225945     8248047.950353
+189417.864018     8248056.375552
+189434.000071     8248064.762726
+189449.560482     8248070.010232
+189471.982707     8248076.615327
+189500.621000     8248085.819974
+189522.952111     8248098.058633
+189547.755628     8248112.213438
+189569.380247     8248129.449894
+189586.070944     8248142.227905
+189610.894710     8248155.130765
+189633.215699     8248167.995205
+189656.767452     8248182.130413
+189675.890059     8248199.328461
+189694.457265     8248212.135278
+189711.086453     8248228.669114
+189734.588352     8248245.934006
+189754.305328     8248265.019371
+189775.365184     8248278.490771
+189792.660372     8248292.530318
+189810.602075     8248305.327534
+189829.723924     8248322.525188
+189857.584854     8248341.109632
+189879.077869     8248366.483160
+189898.139730     8248387.437045
+189920.450598     8248400.927267
+189942.135963     8248414.407887
+189967.534614     8248430.450021
+189994.840914     8248444.642863
+190010.905343     8248457.411261
+190026.334136     8248470.796602
+190041.086821     8248487.301250
+190064.506963     8248509.573911
+190091.076402     8248530.642278
+190115.768556     8248551.682592
+190132.448368     8248565.086373
+190149.693696     8248582.255986
+190171.903328     8248602.005553
+190192.811336     8248624.865588
+190213.780082     8248643.970169
+190235.435072     8248659.328898
+190248.411718     8248669.545384
+190263.800027     8248685.433852
+190280.419100     8248702.593087
+190299.521458     8248721.043081
+190321.054970     8248743.912718
+190347.552773     8248769.363073
+190371.680163     8248786.638331
+190383.385561     8248798.087176
+190405.666053     8248813.455507
+190422.345865     8248826.859288
+190437.179531     8248838.356919
+190454.928884     8248863.047042
+190465.240779     8248883.239907
+190473.777389     8248897.145386
+190485.422048     8248912.349685
+190500.850841     8248925.735026
+190520.598194     8248942.942283
+190533.030319     8248948.142150
+190552.244046     8248959.706253
+190578.339060     8248971.376753
+190594.555344     8248974.756134
+190612.063894     8248975.650839
+190632.013718     8248980.339407
+190651.257046     8248990.026153
+190673.578798     8249002.890605
+190690.884101     8249016.304753
+190714.487236     8249027.310299
+190739.290759     8249041.464722
+190764.729894     8249055.003730
+190785.789756     8249068.474748
+190801.259058     8249079.355435
+190827.343951     8249091.651717
+190858.393900     8249106.528728
+190882.551678     8249121.925112
+190903.500171     8249142.282021
+190927.668069     8249157.052624
+190949.444537     8249164.900445
+190969.363985     8249171.467121
+190991.110089     8249181.192287
+191013.501950     8249189.674728
+191027.135227     8249198.023482
+191041.464116     8249201.999827
+191055.743151     8249209.105856
+191075.016842     8249216.915258
+191109.255822     8249228.084072
+191138.468995     8249240.428375
+191161.446626     8249251.424320
+191190.710417     8249260.638951
+191225.554645     8249273.069695
+191256.685588     8249282.938925
+191277.150310     8249294.522996
+191297.049516     8249302.341236
+191311.369048     8249306.943374
+191339.351456     8249318.016910
+191364.185343     8249330.293988
+191385.275580     8249341.886897
+191398.231972     8249353.355710
+191413.721517     8249362.984834
+191433.519487     8249377.062418
+191467.677474     8249393.239014
+191490.584233     8249408.616958
+191502.400988     8249413.180677
+191521.059297     8249420.354695
+191532.875288     8249424.918403
+191540.745910     8249441.317406
+191553.005939     8249457.157853
+191576.457208     8249477.553181
+191601.754623     8249499.854660
+191617.788690     8249514.500402
+191636.325520     8249529.185328
+191648.081536     8249537.504501
+191662.299056     8249548.366737
+191677.788601     8249557.995860
+191700.664996     8249575.251150
+191727.355150     8249588.808597
+191744.691592     8249600.344647
+191757.617622     8249613.690805
+191770.533517     8249627.663509
+191784.650577     8249644.784336
+191792.551562     8249659.305995
+191803.549700     8249675.753008
+191818.282143     8249693.509219
+191839.331871     8249707.606783
+191852.903645     8249719.710980
+191862.691273     8249733.634898
+191873.095035     8249748.194976
+191885.859089     8249771.555933
+191900.480162     8249796.198035
+191910.852797     8249812.635446
+191918.148534     8249825.895175
+191927.239786     8249844.191491
+191947.914183     8249881.448313
+191964.250555     8249916.134031
+191969.062993     8249928.103766
+191981.807569     8249952.716298
+192000.615578     8249989.318532
+192011.654212     8250003.261654
+192024.631611     8250013.478916
+192037.648754     8250021.191511
+192053.895413     8250022.692783
+192067.639284     8250024.156399
+192092.554164     8250031.425696
+192113.715261     8250038.637369
+192131.788563     8250043.297895
+192146.733598     8250047.909635
+192167.298792     8250053.234350
+192191.013284     8250057.354770
+192221.589596     8250062.832398
+192242.164911     8250067.531332
+192259.673461     8250068.426037
+192278.422897     8250069.965728
+192300.300599     8250071.554205
+192335.337179     8250072.092041
+192364.743465     8250072.543448
+192389.244671     8250066.658660
+192409.357234     8250061.332440
+192430.700548     8250057.277751
+192452.124092     8250048.215270
+192472.277152     8250040.385159
+192493.085314     8250030.687294
+192516.427392     8250019.149751
+192539.122949     8250008.854921
+192568.044701     8250000.533479
+192603.233134     8249991.682299
+192633.416777     8249982.754291
+192662.953912     8249975.068232
+192694.418925     8249964.282083
+192722.079550     8249956.567219
+192740.990961     8249948.092111
+192762.425390     8249938.403860
+192790.721639     8249930.072816
+192824.043683     8249920.567047
+192853.590939     8249912.255207
+192873.743222     8249904.425849
+192896.378816     8249897.885722
+192925.280314     8249890.816607
+192957.895110     8249886.308242
+192983.567093     8249885.450451
+193001.772006     8249881.973523
+193017.413404     8249882.213630
+193032.439421     8249881.818352
+193048.726576     8249880.815733
+193070.039527     8249878.638390
+193084.440040     8249878.233511
+193105.106470     8249877.298881
+193123.260766     8249876.951625
+193147.610882     8249880.455866
+193169.427858     8249885.799032
+193182.505741     8249889.756173
+193199.327273     8249894.397483
+193222.970904     8249902.899139
+193242.173735     8249915.089777
+193265.161488     8249925.459940
+193286.907591     8249935.185106
+193308.805549     8249935.521255
+193333.205519     8249935.895812
+193363.862812     8249936.366423
+193390.140819     8249936.769808
+193413.915286     8249937.134763
+193440.132542     8249941.294367
+193465.703301     8249946.695157
+193491.889430     8249952.732094
+193513.080891     8249958.066422
+193530.498326     8249964.594691
+193550.417775     8249971.161367
+193567.875707     8249975.185745
+193584.636512     8249983.581745
+193596.422892     8249990.023573
+193616.281589     8250000.346467
+193626.776478     8250009.272218
+193641.619501     8250020.144055
+193658.198841     8250039.807193
+193676.008932     8250060.741862
+193694.566017     8250074.174461
+193710.015065     8250086.307475
+193726.099749     8250097.823545
+193742.184421     8250109.340380
+193751.417407     8250118.873460
+193767.451473     8250133.519203
+193778.470617     8250148.714665
+193788.318984     8250158.883129
+193796.906212     8250169.658935
+193815.947067     8250191.864372
+193846.341150     8250208.609126
+193866.703872     8250226.452530
+193885.281212     8250238.632802
+193897.006840     8250248.830848
+193918.742823     8250259.181795
+193934.242488     8250268.185137
+193949.187523     8250272.796877
+END
+LINE3D
+HEIGHT 1040.000000
+193961.761381     8250269.233508
+193981.528975     8250285.189202
+193990.126336     8250295.338462
+194003.143480     8250303.051057
+194016.242369     8250305.756647
+194031.156264     8250312.246484
+194046.162038     8250313.102771
+194066.798856     8250314.046262
+194094.267130     8250318.224305
+194123.611914     8250322.431155
+194144.752757     8250330.895155
+194162.836193     8250334.929135
+194175.863457     8250342.015949
+194195.823403     8250346.078734
+194215.703118     8250355.149313
+194239.386470     8250361.147831
+194256.198657     8250366.414170
+194277.379233     8250372.374268
+194299.660489     8250387.742611
+194328.731929     8250408.850150
+194353.413974     8250430.515481
+194366.259010     8250448.869420
+194384.170337     8250463.544744
+194403.917690     8250480.752001
+194425.633418     8250492.355276
+194442.445605     8250497.621615
+194454.150991     8250509.071225
+194473.908464     8250525.652700
+194491.667938     8250549.717041
+194507.570393     8250572.500237
+194516.026021     8250591.412733
+194526.267045     8250615.987598
+194536.004055     8250633.041189
+194546.830848     8250660.129558
+194551.007663     8250672.715473
+194552.006343     8250688.383050
+194556.626444     8250712.244929
+194560.168386     8250725.447799
+194559.844436     8250745.477396
+194559.571104     8250762.377321
+194543.727235     8250774.655904
+194532.293014     8250785.124367
+194517.186004     8250790.527426
+194501.534485     8250790.913101
+194484.571221     8250795.035026
+194458.151481     8250803.394876
+194428.462493     8250820.469951
+194410.085483     8250834.587460
+194395.594619     8250840.625914
+194384.059163     8250857.353721
+194372.009573     8250867.186037
+194367.326579     8250885.896846
+194367.002630     8250905.926443
+194365.447152     8250924.685262
+194365.133324     8250944.089078
+194373.538334     8250966.131246
+194380.116690     8250985.014925
+194384.737541     8251008.877579
+194393.102055     8251033.423638
+194402.011091     8251062.986316
+194409.587363     8251097.537560
+194418.022737     8251117.702384
+194431.524415     8251134.187828
+194446.286456     8251150.066682
+194459.010778     8251175.931542
+194473.519730     8251207.458758
+194483.822256     8251228.278181
+194491.692114     8251244.677172
+194497.665221     8251262.298922
+194497.815672     8251291.727914
+194498.580754     8251321.791514
+194499.497677     8251342.466861
+194502.312128     8251361.918698
+194502.069160     8251376.941278
+194489.625512     8251411.185202
+194484.275754     8251432.390288
+194477.695246     8251452.323843
+194463.001146     8251470.880974
+194443.826525     8251495.630226
+194416.860874     8251537.790701
+194391.166483     8251578.718053
+194371.325862     8251605.961593
+194353.442744     8251628.226157
+194333.128474     8251646.071078
+194312.208191     8251662.654058
+194283.073846     8251684.119971
+194259.005029     8251701.907257
+194242.576153     8251711.672347
+194228.054913     8251719.588910
+194207.276363     8251727.408654
+194187.194927     8251730.857541
+194161.522181     8251731.715320
+194138.352975     8251732.611531
+194113.942108     8251732.863508
+194076.402752     8251732.287253
+194035.109614     8251731.653374
+194001.949544     8251731.144344
+193980.677854     8251730.817808
+193947.598778     8251725.300997
+193916.326102     8251724.195002
+193878.786747     8251723.618747
+193848.765078     8251722.531956
+193818.108549     8251722.061357
+193787.431013     8251722.842309
+193762.969540     8251726.223195
+193737.862310     8251730.846806
+193722.150051     8251734.987935
+193705.802156     8251739.746008
+193684.428466     8251745.678806
+193656.213211     8251749.002068
+193636.050794     8251757.457972
+193615.282365     8251764.651935
+193590.124516     8251772.405218
+193561.828267     8251780.736262
+193522.744331     8251798.292291
+193486.798020     8251815.271312
+193462.154318     8251829.919324
+193441.275295     8251843.998425
+193419.235605     8251852.425511
+193389.677465     8251861.363121
+193368.152685     8251876.684948
+193349.190657     8251888.289728
+193331.439138     8251902.417602
+193316.745039     8251920.974734
+193292.575762     8251945.020612
+193269.687843     8251967.209113
+193251.148858     8251991.341420
+193235.930492     8252003.629605
+193223.204768     8252016.582755
+193205.352026     8252036.969210
+193183.705756     8252059.802709
+193150.948476     8252073.073533
+193129.453308     8252086.517239
+193113.670177     8252095.040368
+193095.970040     8252106.038582
+193078.833903     8252120.801840
+193059.216008     8252134.274363
+193028.881275     8252152.591400
+193004.660604     8252179.767703
+192984.971837     8252197.622226
+192963.446293     8252212.944040
+192950.084958     8252226.512606
+192937.863259     8252246.986266
+192919.445753     8252263.607665
+192890.734439     8252297.601869
+192856.503427     8252324.624506
+192834.948283     8252341.823678
+192817.166389     8252357.829661
+192792.532820     8252371.851127
+192770.997155     8252387.798724
+192755.072292     8252405.085088
+192741.115817     8252416.766707
+192728.995366     8252430.980258
+192713.625146     8252452.657460
+192691.362730     8252474.855563
+192668.484944     8252496.417519
+192643.709643     8252519.202220
+192620.155736     8252543.884246
+192601.626860     8252567.391536
+192586.327512     8252584.686738
+192571.130152     8252595.723371
+192554.670136     8252607.366559
+192529.996834     8252623.891927
+192505.998890     8252637.297213
+192490.780523     8252649.585398
+192477.953564     8252668.797893
+192464.571986     8252683.618022
+192455.630421     8252694.750686
+192442.783219     8252715.214744
+192434.366698     8252732.615602
+192429.612068     8252755.708399
+192428.077609     8252773.214902
+192423.383731     8252792.551481
+192422.322909     8252819.457367
+192430.748162     8252840.247972
+192439.143051     8252862.915922
+192453.026500     8252894.433537
+192471.815030     8252932.287346
+192485.285569     8252950.650888
+192494.457815     8252963.939423
+192508.019468     8252976.669401
+192537.767805     8252994.656117
+192558.766916     8253011.883353
+192574.165346     8253027.146039
+192584.044088     8253035.436395
+192593.922819     8253043.727514
+192604.346835     8253057.035265
+192614.749833     8253071.595331
+192624.577958     8253083.015359
+192634.759006     8253111.345689
+192635.605070     8253136.402272
+192635.260865     8253157.684197
+192629.275484     8253179.505463
+192623.381217     8253195.693165
+192615.045677     8253208.087006
+192609.232392     8253219.267692
+192605.901640     8253231.738360
+192595.739445     8253240.973711
+192583.639237     8253253.935699
+192566.412749     8253274.332532
+192548.671364     8253287.833861
+192526.641795     8253295.635165
+192502.674226     8253307.162343
+192490.069993     8253312.603821
+192466.234787     8253315.994320
+192446.142467     8253320.068976
+192425.405164     8253325.385606
+192400.368806     8253325.627217
+192375.251455     8253330.876610
+192349.518733     8253335.489855
+192328.084304     8253345.178107
+192309.768021     8253355.540925
+192292.754139     8253362.792523
+192269.462679     8253371.200394
+192241.761569     8253381.418385
+192225.968317     8253390.567295
+192213.283090     8253401.016555
+192201.122907     8253417.734008
+192192.806845     8253428.876274
+192185.702069     8253442.540882
+192173.591727     8253456.129416
+192165.275678     8253467.270918
+192169.392517     8253483.612298
+192172.227210     8253501.812572
+192181.358960     8253517.604997
+192193.023849     8253531.558497
+192204.667745     8253546.762785
+192223.820721     8253562.083106
+192250.964270     8253586.291500
+192286.272791     8253608.746656
+192303.527488     8253625.289712
+192312.043855     8253640.446754
+192321.195859     8253654.986852
+192332.144131     8253674.564313
+192342.506644     8253691.627506
+192352.365133     8253701.170189
+192364.736519     8253710.125509
+192379.620814     8253718.492703
+192402.568070     8253731.366757
+192419.832889     8253747.284031
+192436.371732     8253769.451060
+192447.914379     8253790.915456
+192457.621778     8253809.847168
+192464.876254     8253825.610776
+192485.280236     8253840.950301
+192512.021008     8253851.378076
+192539.993296     8253863.077393
+192565.432443     8253876.615637
+192574.655307     8253886.774499
+192589.357374     8253906.408819
+192597.298856     8253918.426587
+192609.477891     8253939.274816
+192622.272309     8253960.758427
+192634.965503     8253988.500620
+192645.146551     8254016.830950
+192652.732944     8254050.756413
+192657.847700     8254082.765359
+192663.577826     8254115.410452
+192669.419321     8254141.169655
+192669.842352     8254153.697947
+192677.148210     8254166.331894
+192679.407255     8254181.392882
+192679.164286     8254196.415462
+192677.528591     8254220.181309
+192673.410362     8254242.657174
+192673.096521     8254262.061754
+192673.306960     8254287.734517
+192672.952635     8254309.642223
+192672.659049     8254327.794475
+192672.335099     8254347.824073
+192668.206749     8254370.925719
+192667.237042     8254392.198042
+192663.229406     8254407.788769
+192663.016813     8254420.933240
+192654.559782     8254440.838753
+192649.321394     8254455.157949
+192640.298836     8254471.298395
+192628.723659     8254490.529341
+192615.200348     8254514.112705
+192599.133753     8254540.162305
+192584.872806     8254570.621946
+192576.557520     8254581.763460
+192561.903918     8254597.816700
+192541.549151     8254618.165512
+192526.956287     8254630.463299
+192516.743474     8254642.828322
+192497.054706     8254660.682845
+192478.485346     8254686.693262
+192463.236604     8254700.859555
+192437.876296     8254721.130764
+192418.167275     8254740.237614
+192392.262445     8254755.492204
+192360.059808     8254773.153866
+192338.545136     8254787.850675
+192318.896102     8254803.201295
+192296.765322     8254817.260416
+192279.075294     8254827.633613
+192267.045958     8254836.213601
+192248.719554     8254847.202201
+192229.040908     8254864.430942
+192208.767135     8254879.771972
+192195.374660     8254895.218635
+192187.654514     8254908.247096
+192173.041408     8254921.796446
+192161.567455     8254934.768812
+192146.359222     8254946.430451
+192131.796709     8254956.851657
+192120.363265     8254967.319367
+192104.377675     8254988.360422
+192092.186352     8255006.955973
+192079.914036     8255030.559305
+192070.073636     8255058.582292
+192064.744897     8255078.535062
+192060.142134     8255092.238078
+192048.556811     8255112.096334
+192029.361948     8255138.097149
+192011.397849     8255165.368730
+191993.605845     8255181.999731
+191974.552703     8255199.238074
+191956.176444     8255213.356359
+191944.045873     8255228.195692
+191931.884901     8255244.914662
+191913.386401     8255266.543842
+191893.444557     8255300.045963
+191879.981986     8255319.873873
+191872.250943     8255333.528868
+191858.183110     8255352.095613
+191846.546406     8255375.083529
+191841.974782     8255386.908448
+191832.820636     8255411.184819
+191827.593109     8255424.879773
+191823.020721     8255436.704680
+191819.013849     8255452.295418
+191818.710141     8255471.073452
+191821.514471     8255491.151071
+191826.206183     8255510.632490
+191836.173887     8255552.106515
+191839.725199     8255564.682828
+191855.728877     8255581.207444
+191872.389198     8255595.863564
+191888.403010     8255611.761634
+191906.152375     8255636.450993
+191918.875920     8255662.316605
+191922.427231     8255674.892917
+191927.240446     8255686.861900
+191934.464546     8255704.503617
+191938.530755     8255723.975434
+191939.538806     8255739.016454
+191942.413996     8255754.712837
+191942.624422     8255780.386363
+191944.924727     8255792.943472
+191931.421671     8255815.274509
+191921.188616     8255828.891096
+191911.581038     8255842.518813
+191899.490951     8255854.855019
+191881.800184     8255865.226675
+191858.499366     8255874.260340
+191837.639835     8255887.087101
+191821.745347     8255902.495357
+191808.171407     8255929.209157
+191790.318652     8255949.596377
+191780.781960     8255958.841330
+191768.692637     8255971.177548
+191758.438575     8255986.045686
+191726.277186     8256001.204233
+191702.148394     8256022.746985
+191689.987422     8256039.465955
+191674.062583     8256056.750791
+191650.609148     8256075.173461
+191622.777191     8256093.528917
+191585.004988     8256107.349460
+191561.673031     8256118.261221
+191532.065037     8256130.328515
+191513.183990     8256136.926278
+191484.897886     8256144.630012
+191472.828041     8256155.714655
+191463.845992     8256169.350446
+191442.279939     8256187.176915
+191432.107635     8256197.037284
+191423.196445     8256206.291839
+191418.533694     8256223.751085
+191405.101474     8256241.702414
+191395.524297     8256253.450494
+191380.688477     8256280.770097
+191364.712996     8256301.186134
+191337.729256     8256305.780939
+191315.002560     8256317.953866
+191301.177684     8256321.498795
+191288.028953     8256321.922125
+191260.317710     8256332.766662
+191235.785365     8256340.529547
+191206.995236     8256340.712771
+191181.242260     8256346.578344
+191156.104654     8256353.080064
+191142.319523     8256354.120326
+191113.549612     8256353.053515
+191087.414113     8256343.886142
+191073.730218     8256338.667060
+191060.067329     8256332.196426
+191033.921673     8256323.657126
+191016.463753     8256319.631984
+190998.945081     8256319.363060
+190983.919816     8256319.759113
+190951.385250     8256319.259685
+190928.236286     8256318.904332
+190900.152654     8256314.089377
+190875.853156     8256307.455464
+190852.775052     8256302.718875
+190824.711638     8256296.653885
+190798.545000     8256289.364608
+190778.655927     8256280.919823
+190758.826818     8256268.720336
+190732.701428     8256258.927945
+190699.713454     8256247.778334
+190674.839071     8256238.005147
+190663.678958     8256231.572933
+190643.758746     8256225.006245
+190618.742642     8256223.995529
+190586.269566     8256219.741422
+190561.263596     8256218.104160
+190542.564779     8256213.434797
+190529.527393     8256206.973765
+190514.582358     8256202.362025
+190495.288413     8256195.804951
+190468.476004     8256189.759164
+190443.510519     8256185.618775
+190425.427096     8256181.584032
+190404.165514     8256180.632479
+190381.651423     8256179.660170
+190355.999683     8256179.266398
+190327.845166     8256178.834206
+190309.055246     8256179.797642
+190284.603894     8256182.552746
+190270.839769     8256182.341457
+190253.886613     8256185.838365
+190237.598706     8256186.840208
+190224.419575     8256189.143176
+190231.068815     8256203.644091
+190232.097847     8256217.435087
+190237.757125     8256254.460652
+190237.240812     8256286.383921
+190232.395093     8256315.108753
+190226.501577     8256331.297232
+190221.574864     8256365.029845
+190212.976101     8256393.698594
+190205.113446     8256415.491042
+190201.147083     8256428.577126
+190196.423581     8256449.792589
+190191.709448     8256470.381496
+190192.071753     8256486.664477
+190195.502350     8256506.751709
+190198.729687     8256539.359147
+190202.179762     8256558.194805
+190211.987633     8256570.867160
+190225.408330     8256592.359621
+190238.071148     8256621.979923
+190251.298718     8256655.366044
+190264.648530     8256681.241270
+190271.267395     8256697.620293
+190274.132451     8256713.943222
+190273.859120     8256730.843147
+190273.555412     8256749.621181
+190273.251705     8256768.399215
+190272.897380     8256790.306922
+190267.648871     8256805.251899
+190266.780387     8256820.265641
+190262.117636     8256837.724887
+190257.484496     8256853.306012
+190257.241540     8256868.327828
+190256.281954     8256888.974369
+190254.787992     8256903.976981
+190254.494393     8256922.129998
+190252.252686     8256944.633904
+190250.708081     8256962.767717
+190248.608094     8256976.509152
+END
+LINE3D-MASTER
+HEIGHT 1050.000000
+183557.000000     8246655.540109
+183559.642744     8246663.554871
+183580.722657     8246675.774323
+183600.037041     8246681.079455
+183616.132031     8246691.970129
+183627.786615     8246706.549025
+183638.149504     8246723.612606
+183647.835896     8246743.795869
+183651.336781     8246759.501857
+183651.729628     8246773.908260
+183655.260888     8246787.736139
+183667.561407     8246801.073077
+183683.091449     8246808.198310
+183712.114622     8246793.617909
+183736.041324     8246784.593852
+183758.141753     8246772.411312
+183773.400425     8246757.619233
+183788.084213     8246739.687880
+183801.506293     8246722.363479
+183814.221883     8246710.036874
+183836.443797     8246690.343044
+183851.631788     8246679.932968
+183869.301931     8246670.812869
+183888.253838     8246659.833871
+183901.615364     8246646.265308
+183914.987024     8246632.070200
+183931.476639     8246618.549655
+183947.986700     8246603.776786
+183962.538876     8246593.982887
+183973.942339     8246585.392528
+183988.484202     8246576.224407
+184006.154536     8246567.104311
+184020.696400     8246557.936191
+184035.863958     8246548.777675
+184051.122821     8246533.985600
+184072.073098     8246515.524505
+184084.677325     8246510.083409
+184105.516244     8246498.507441
+184123.802145     8246490.023113
+184147.738975     8246480.372893
+184163.522100     8246471.850146
+184177.367600     8246467.053660
+184191.848719     8246461.641375
+184206.350092     8246454.976764
+184224.605623     8246448.370163
+184251.711223     8246436.264456
+184273.094843     8246429.705873
+184291.299572     8246426.228560
+184305.165315     8246420.180510
+184314.722256     8246409.683612
+184329.274241     8246399.889710
+184350.093103     8246389.565690
+184377.168333     8246379.337709
+184396.634565     8246375.254206
+184419.239211     8246370.592179
+184433.074386     8246366.422235
+184450.754848     8246356.675975
+184472.128347     8246350.743175
+184498.578074     8246340.505592
+184522.423783     8246336.489317
+184541.930518     8246329.901541
+184558.298846     8246323.891908
+184575.898123     8246319.153427
+184595.374483     8246314.443760
+184625.486878     8246309.897364
+184653.783128     8246301.566320
+184675.126257     8246297.511246
+184697.751145     8246291.597655
+184719.821204     8246281.292842
+184732.604514     8246277.000000
+END
+LINE3D-MASTER
+HEIGHT 1050.000000
+184977.156443     8246277.000000
+184989.489068     8246284.806496
+185010.548738     8246298.277511
+185024.130825     8246309.755929
+185034.645574     8246317.430111
+185047.652966     8246325.769257
+185059.469340     8246330.332970
+185069.973955     8246338.633698
+185091.689689     8246350.236591
+185107.895852     8246354.241753
+185127.825803     8246360.182653
+185151.438677     8246370.562413
+185171.398998     8246374.625586
+185190.067440     8246381.173059
+185212.530544     8246385.274269
+185238.101296     8246390.675441
+185262.451412     8246394.179682
+185278.627199     8246400.062953
+185291.039082     8246406.514383
+185304.035977     8246415.478923
+185318.294757     8246423.837280
+185331.866538     8246435.941094
+185349.787993     8246449.990255
+185361.473137     8246462.691428
+185379.252483     8246485.503436
+185395.155314     8246508.287020
+185406.113337     8246527.237930
+185415.255213     8246542.404191
+185429.815165     8246570.801741
+185443.871474     8246591.678787
+185456.131503     8246607.519234
+185462.790852     8246621.395131
+185471.942843     8246635.935993
+185484.152255     8246654.906113
+185500.791952     8246670.813791
+185518.632037     8246689.870345
+185538.379771     8246707.077607
+185560.680894     8246721.193999
+185580.509228     8246733.394238
+185604.697369     8246746.913277
+185631.317038     8246764.852348
+185651.034397     8246783.937719
+185666.412578     8246800.452351
+185680.569747     8246815.069664
+185696.705425     8246823.456450
+185714.737855     8246830.620479
+185735.323685     8246834.692872
+185765.294736     8246838.909335
+185787.131948     8246843.001320
+185800.250322     8246844.454953
+185818.323636     8246849.114714
+185848.101955     8246865.224079
+185873.682829     8246869.999469
+185895.570659     8246870.961782
+185915.541107     8246874.398791
+185931.808008     8246874.648500
+185949.326680     8246874.917424
+185966.855097     8246874.560178
+185985.695641     8246870.466688
+186007.684707     8246865.169656
+186022.155704     8246860.383153
+186041.783732     8246846.284084
+186054.468947     8246835.835589
+186072.744733     8246827.976661
+186090.828162     8246832.011023
+186100.696778     8246840.927542
+186111.857272     8246847.359762
+186131.746727     8246855.804554
+186149.739048     8246865.472096
+186164.673574     8246870.709995
+186185.865041     8246876.043941
+186198.357911     8246877.487971
+186217.651856     8246884.045046
+186231.960878     8246889.273342
+186256.260377     8246895.907255
+186276.765213     8246904.987430
+186292.890770     8246913.999997
+186305.292525     8246921.077591
+186317.068402     8246928.145195
+186334.465207     8246935.925403
+186346.897339     8246941.124887
+186376.191887     8246948.461415
+186391.782667     8246951.831193
+186407.373447     8246955.200972
+186422.974349     8246957.944969
+186437.939626     8246961.305146
+186450.422375     8246963.374958
+186463.520500     8246966.080536
+186479.484076     8246985.108284
+186479.886859     8246998.888521
+186475.264229     8247013.843488
+186462.538511     8247026.796256
+186450.448806     8247039.132468
+186440.891871     8247049.628985
+186431.264064     8247064.507501
+186412.846552     8247081.129282
+186396.972312     8247095.285592
+186387.919390     8247113.303383
+186382.620639     8247131.378420
+186382.993435     8247147.036390
+186397.322700     8247151.013123
+186409.957302     8247143.693918
+186420.745383     8247134.468174
+186431.522961     8247125.868206
+186441.120393     8247112.867799
+186456.490613     8247091.190597
+186464.170662     8247080.664887
+186476.926749     8247065.834392
+186492.154855     8247052.920420
+186516.071818     8247044.522151
+186530.168242     8247062.895300
+186534.325190     8247076.733166
+186529.601324     8247097.947478
+186518.712008     8247113.432566
+186509.134818     8247125.181410
+186500.819144     8247136.323300
+186488.688561     8247151.163396
+186478.384638     8247169.161601
+186472.368881     8247192.860976
+186472.761925     8247207.267000
+186483.871802     8247216.828893
+186500.754467     8247217.713990
+186518.566337     8247199.831038
+186526.922508     8247186.185257
+186534.037411     8247171.894485
+186541.778206     8247157.612939
+186550.134370     8247143.967541
+186558.450432     8247132.825275
+186566.150342     8247121.047995
+186575.747780     8247108.047206
+186590.330516     8247096.375583
+186603.056233     8247083.422815
+186615.024454     8247078.597893
+186626.427911     8247070.007915
+186637.831756     8247061.417561
+186657.852440     8247061.724893
+186672.746851     8247069.466687
+186686.873650     8247085.961727
+186701.697195     8247098.085140
+186713.412326     8247108.908579
+186723.856209     8247120.964379
+186737.438492     8247132.442418
+186750.486000     8247138.277668
+186763.432653     8247150.372268
+186777.004815     8247162.476089
+186796.177276     8247176.544453
+186814.683743     8247193.106724
+186829.547785     8247202.726246
+186842.615540     8247207.309551
+186861.243485     8247216.360914
+186886.158365     8247223.630211
+186902.344279     8247228.887318
+186917.874315     8247236.012933
+186940.256431     8247245.121543
+186961.972159     8247256.724818
+186985.595154     8247266.478796
+187008.501537     8247281.856353
+187027.623380     8247299.054389
+187047.310370     8247320.017488
+187068.218371     8247342.877905
+187088.087202     8247352.574254
+187107.976663     8247361.018663
+187126.039850     8247366.304588
+187135.867969     8247377.724998
+187149.369259     8247394.210818
+187161.629288     8247410.051265
+187171.467534     8247420.845511
+187182.496799     8247435.415191
+187198.348636     8247461.328060
+187218.671249     8247481.674978
+187244.665416     8247499.604447
+187260.729846     8247512.372845
+187282.303847     8247532.738973
+187298.277550     8247551.140558
+187310.486962     8247570.110677
+187321.485475     8247586.558078
+187340.093178     8247596.861005
+187365.593065     8247606.643794
+187388.550060     8247618.892060
+187410.235425     8247632.372680
+187426.310357     8247644.515302
+187444.241557     8247657.938293
+187465.825680     8247677.678640
+187483.080759     8247694.221702
+187495.401527     8247706.306694
+187509.548957     8247721.549795
+187529.982927     8247735.011588
+187549.842019     8247745.333724
+187570.992607     8247753.171555
+187604.616205     8247763.704986
+187640.066070     8247777.397283
+187671.176771     8247788.518076
+187704.204847     8247797.164554
+187742.843737     8247807.149036
+187778.394462     8247814.581601
+187817.164958     8247816.429011
+187863.413031     8247820.269401
+187909.589857     8247828.491403
+187948.228747     8247838.475885
+187998.735010     8247849.894413
+188031.208068     8247854.149666
+188064.317519     8247857.788369
+188098.102710     8247858.306995
+188141.273122     8247858.969691
+188175.684198     8247859.497925
+188214.999209     8247866.362337
+188263.679193     8247874.622764
+188294.769645     8247886.995503
+188334.669281     8247896.373401
+188379.020596     8247901.436930
+188411.412672     8247910.699201
+188443.845239     8247917.457962
+188486.248415     8247926.874291
+188521.102771     8247938.678872
+188554.040121     8247952.958537
+188591.870903     8247974.200155
+188633.990620     8248001.142573
+188664.353569     8248019.765043
+188689.197577     8248031.416339
+188717.149622     8248044.367220
+188743.850661     8248057.298898
+188762.478612     8248066.349879
+188778.684768     8248070.355423
+188795.517198     8248074.370199
+188817.898926     8248083.479185
+188849.655371     8248093.358017
+188881.421945     8248102.610685
+188909.394238     8248114.309621
+188939.899678     8248124.169249
+188981.636090     8248136.079856
+189019.578999     8248150.435977
+189051.890081     8248164.706029
+189083.545291     8248180.844205
+189120.831557     8248197.068823
+189137.572872     8248206.717162
+189147.411112     8248217.511790
+189162.001815     8248244.031618
+189170.578164     8248255.432813
+189190.245287     8248277.647862
+189211.244403     8248294.874717
+189240.406964     8248310.348310
+189259.498438     8248329.424074
+189279.317414     8248342.250107
+189294.715844     8248357.512793
+189308.216758     8248373.998225
+189323.080800     8248383.617747
+189338.539968     8248395.124980
+189360.911575     8248404.859747
+189379.519278     8248415.162674
+189395.634326     8248424.801399
+189415.524162     8248433.246196
+189434.233101     8248437.289778
+189457.311205     8248442.026367
+189474.829876     8248442.295290
+189492.953033     8248443.826132
+END
+LINE3D-MASTER
+HEIGHT 1050.000000
+189507.989182     8248442.804309
+189526.102981     8248444.960944
+189544.186417     8248448.994924
+189567.122788     8248462.494748
+189603.158048     8248478.700161
+189629.757087     8248497.891171
+189653.945228     8248511.410211
+189686.852208     8248527.567603
+189730.263422     8248552.025716
+189762.584632     8248565.669604
+189776.217909     8248574.018358
+189790.526556     8248579.246266
+189810.446768     8248585.812954
+189832.788000     8248597.425831
+189865.653719     8248616.087103
+189894.110553     8248636.558505
+189913.837651     8248655.018089
+189934.786156     8248675.374234
+189957.621279     8248695.134166
+189989.761036     8248720.044428
+190012.928088     8248757.965451
+190035.591879     8248788.365975
+190057.003899     8248818.747285
+190079.142671     8248842.878087
+190106.398341     8248860.201366
+190128.073585     8248874.307768
+190149.102307     8248889.656883
+190176.378231     8248905.727834
+190208.053695     8248920.613684
+190237.257511     8248933.583780
+190258.942863     8248947.065164
+190281.243610     8248961.181168
+190307.853534     8248979.746408
+190340.709133     8248999.033461
+190372.333979     8249017.048982
+190397.804254     8249028.709892
+190424.534905     8249039.763449
+190454.424962     8249048.987693
+190487.391917     8249061.389619
+190513.477574     8249073.685913
+190541.429619     8249086.636794
+190565.638003     8249098.904270
+190599.876983     8249110.073085
+190624.680506     8249124.227508
+190648.756514     8249144.632426
+190675.406935     8249160.693775
+190699.564701     8249176.090924
+190731.825172     8249193.490266
+190760.927751     8249212.719707
+190791.896719     8249232.603735
+190827.062743     8249263.822115
+190870.382855     8249293.913028
+190900.746562     8249312.535891
+190923.006812     8249329.155785
+190947.820444     8249342.685191
+190975.802865     8249353.757963
+190996.216969     8249368.471706
+191018.487340     8249384.465819
+191041.403469     8249399.217206
+191061.847948     8249412.052841
+191089.870854     8249420.622486
+191110.385442     8249429.076109
+191134.684940     8249435.710022
+191156.461407     8249443.557843
+191183.919560     8249448.361669
+191205.766900     8249451.827490
+191226.353112     8249455.899889
+191240.681989     8249459.876998
+191259.996188     8249465.181745
+191279.250401     8249474.242722
+191299.139473     8249482.687507
+191313.952897     8249495.436701
+191339.926433     8249514.618109
+191362.691472     8249538.758525
+191383.033952     8249557.853493
+191402.822552     8249572.557635
+191418.251358     8249585.942212
+191436.848940     8249596.870920
+191460.380438     8249612.258455
+191485.758835     8249629.552916
+191508.604855     8249648.686315
+191523.962800     8249666.452128
+191538.766102     8249679.827104
+191555.456035     8249692.605103
+191574.577872     8249709.803522
+191597.413771     8249729.562703
+191616.454627     8249751.768139
+191626.756389     8249772.587549
+191632.709241     8249791.461626
+191636.896953     8249803.421007
+191641.668895     8249817.894632
+191642.091926     8249830.422923
+191643.100728     8249845.464719
+191643.483263     8249860.496901
+191643.209931     8249877.396826
+191642.865727     8249898.678751
+191642.572141     8249916.831003
+191642.207694     8249939.364491
+191645.576789     8249963.207166
+191650.086284     8249993.954947
+191652.688130     8250026.552019
+191656.733345     8250047.274623
+191662.040439     8250067.391425
+191671.101329     8250087.565086
+191675.227525     8250103.280673
+191682.533383     8250115.914621
+191689.061120     8250137.927972
+191704.801600     8250170.725967
+191718.242527     8250190.967629
+191728.635404     8250206.153477
+191739.654560     8250221.348174
+191751.308565     8250235.927444
+191766.010631     8250255.561764
+191783.749862     8250280.877669
+191791.721720     8250291.017328
+191807.836768     8250300.656053
+191822.165645     8250304.633162
+191844.538015     8250314.367942
+191862.661184     8250315.898019
+191875.164181     8250316.715886
+191890.815701     8250316.330211
+191908.405232     8250312.217899
+191929.758680     8250307.536665
+191966.915501     8250293.080738
+191985.251262     8250281.466344
+192003.486539     8250276.112071
+192022.337211     8250271.392418
+192039.876124     8250270.409778
+192054.286007     8250269.378342
+192069.937526     8250268.992667
+192093.722878     8250268.731851
+192113.763817     8250267.786856
+192135.036271     8250268.113403
+192160.698132     8250267.881393
+192195.735475     8250268.419241
+192232.648564     8250268.985883
+192262.054851     8250269.437290
+192286.516324     8250266.056404
+192306.547129     8250265.737954
+192325.962564     8250264.783356
+192345.984012     8250265.090700
+192366.630200     8250265.407633
+192389.779927     8250265.762998
+192417.328419     8250264.934012
+192455.575035     8250260.512100
+192489.986111     8250261.040334
+192502.499230     8250261.232419
+192516.293718     8250259.566363
+192530.744849     8250256.031812
+192561.462130     8250252.746193
+192599.072345     8250248.941213
+192622.918436     8250244.924944
+192638.015325     8250240.147667
+192651.234940     8250235.341572
+192670.075478     8250231.248465
+192704.547293     8250228.021245
+192737.707363     8250228.530275
+192765.235612     8250228.952853
+192794.026517     8250228.768877
+192831.010478     8250224.953519
+192862.374256     8250220.426714
+192880.599424     8250215.697459
+192898.188956     8250211.585147
+192917.725869     8250203.119641
+192943.448482     8250199.131413
+192971.098973     8250192.043095
+192994.409912     8250182.383649
+193015.158099     8250176.441250
+193045.200010     8250176.276477
+193085.312251     8250172.509141
+193112.932379     8250167.298167
+193131.783038     8250162.579278
+193153.126365     8250158.523825
+193177.527099     8250158.898393
+193205.681615     8250159.330585
+193233.836132     8250159.762776
+193251.283167     8250164.413688
+193271.162883     8250173.484267
+193295.391521     8250184.499416
+193319.599140     8250196.766880
+193348.752338     8250212.866649
+193381.022930     8250229.640209
+193411.376515     8250248.888854
+193437.329809     8250269.321826
+193467.723880     8250286.067344
+193486.754614     8250308.898562
+193499.014643     8250324.739009
+193512.607436     8250335.590890
+193525.503089     8250350.815157
+193545.876709     8250368.032027
+193567.592437     8250379.635302
+193584.262128     8250393.664865
+193605.281492     8250409.639774
+193621.789196     8250433.684900
+193637.167384     8250450.199150
+193650.780418     8250459.799467
+193664.301575     8250475.033337
+193684.725812     8250489.120534
+193699.508096     8250503.747826
+193711.223616     8250514.570889
+193715.411315     8250526.531034
+193726.913466     8250550.499321
+193732.673967     8250581.266305
+193738.011449     8250599.504234
+193738.414226     8250613.284853
+193737.414156     8250636.434521
+193735.636716     8250668.964368
+193730.317334     8250688.291345
+193724.220596     8250716.997737
+193719.436367     8250741.967891
+193709.737700     8250761.227643
+193705.730827     8250776.818381
+193699.211058     8250792.996482
+193693.891664     8250812.324223
+193689.915167     8250826.036853
+193688.340211     8250846.047246
+193683.707072     8250861.628371
+193682.858843     8250875.389786
+193683.170517     8250894.803204
+193696.176138     8250941.959590
+193707.042664     8250966.544056
+193716.789796     8250982.971866
+193728.434443     8250998.176929
+193743.822751     8251014.065397
+193753.519265     8251033.622879
+193757.625983     8251050.590040
+193759.926288     8251063.147149
+193768.391274     8251081.433852
+193769.853483     8251107.125830
+193770.256260     8251120.906448
+193753.624912     8251143.190228
+193738.102838     8251174.256447
+193724.105866     8251188.441957
+193705.890831     8251192.544667
+193687.604924     8251201.029376
+193663.082712     8251208.165716
+193649.176854     8251216.717662
+193629.629820     8251225.808950
+193619.447382     8251236.295864
+193608.063779     8251243.634655
+193598.970373     8251264.155572
+193592.470845     8251279.082110
+193587.868833     8251292.785901
+193585.031986     8251313.402861
+193580.984617     8251331.497490
+193579.489878     8251346.500855
+193575.462764     8251363.343157
+193566.379466     8251383.239056
+193551.111246     8251398.656925
+193529.494599     8251419.611539
+193514.668889     8251446.306124
+193500.621299     8251463.621306
+193485.947454     8251480.926110
+193470.648094     8251498.222076
+193444.621786     8251520.987574
+193410.421149     8251546.132102
+193384.364466     8251570.775708
+193361.638534     8251582.948647
+193340.697996     8251600.783954
+193317.880949     8251618.590456
+193293.812896     8251636.377753
+193287.857891     8251656.320910
+193278.936580     8251666.201247
+193269.853282     8251686.097146
+193261.406385     8251705.376114
+193244.774274     8251727.659882
+193235.641122     8251750.685466
+193222.127169     8251773.643037
+193216.193169     8251792.334642
+193218.946881     8251815.541933
+193210.600444     8251828.562308
+193198.459739     8251844.028186
+193172.494170     8251863.038230
+193147.103487     8251885.187548
+193122.994173     8251905.478724
+193105.747443     8251927.127121
+193091.618872     8251949.449320
+193075.694021     8251966.734920
+193058.659120     8251975.238833
+193041.584486     8251986.246649
+193026.426859     8251994.779380
+193010.058722     8252000.789016
+193000.511908     8252010.659751
+192987.846936     8252019.856683
+192969.520544     8252030.844519
+192951.718407     8252048.102066
+192928.326475     8252062.769294
+192903.733391     8252074.287633
+192875.951288     8252089.513405
+192846.242057     8252107.840044
+192821.466756     8252130.624745
+192795.531551     8252147.757444
+192768.960733     8252165.505558
+192754.276755     8252183.436908
+192736.545491     8252196.312455
+192718.088239     8252215.438521
+192697.742842     8252235.160775
+192665.601695     8252249.067758
+192637.123229     8252268.665164
+192609.662922     8252302.678572
+192576.774794     8252324.086862
+192548.357066     8252339.928814
+192530.071159     8252348.413524
+192510.341895     8252368.771937
+192483.791320     8252385.268488
+192469.249075     8252394.436602
+192457.875606     8252401.148847
+192447.723531     8252409.758417
+192436.834596     8252425.243511
+192426.692643     8252433.227299
+192415.268556     8252443.069216
+192398.778941     8252456.589761
+192380.351301     8252473.837706
+192369.411748     8252492.452472
+192355.454509     8252504.134079
+192340.043804     8252528.314408
+192325.965839     8252547.507699
+192301.836283     8252569.050439
+192273.388192     8252586.769735
+192251.227012     8252602.708494
+192232.901384     8252613.696342
+192216.976520     8252630.982706
+192193.583825     8252645.649922
+192179.011979     8252656.695393
+192158.808302     8252667.655176
+192138.615522     8252677.988425
+192119.108984     8252684.575821
+192105.908847     8252688.130341
+192084.333450     8252706.581839
+192074.746139     8252718.956465
+192057.640378     8252731.841614
+192045.570546     8252742.925493
+192029.736797     8252754.578294
+192021.381002     8252768.224462
+192017.424748     8252780.685529
+192008.412323     8252796.199428
+192002.507935     8252813.012913
+191998.470687     8252830.481760
+191998.247973     8252844.252013
+191997.974641     8252861.151938
+191992.009502     8252881.721641
+191991.776655     8252896.118439
+191987.194897     8252908.569903
+191977.435491     8252931.585109
+191965.839296     8252952.068371
+191956.907864     8252962.574490
+191946.543197     8252984.328530
+191935.553026     8253006.072969
+191929.425912     8253036.657470
+191927.789454     8253060.423306
+191923.025467     8253084.141896
+191913.840946     8253110.296377
+191912.144499     8253137.818442
+191901.607724     8253170.213827
+191897.357132     8253200.826370
+191892.008138     8253222.031468
+191887.829158     8253248.263551
+191881.661560     8253281.351179
+191879.944107     8253310.124796
+191874.040471     8253326.939056
+191873.777260     8253343.213200
+191872.918146     8253357.600384
+191866.297141     8253380.037830
+191852.138194     8253404.238138
+191837.059406     8253446.580321
+191831.044413     8253470.279708
+191825.089407     8253490.222864
+191824.684464     8253515.260243
+191828.496832     8253550.379646
+191836.114352     8253582.427775
+191840.805313     8253601.908418
+191853.004603     8253621.504319
+191867.040669     8253643.632928
+191880.339112     8253672.637050
+191893.215287     8253689.112892
+191909.895086     8253702.517437
+191933.427361     8253717.904220
+191960.046642     8253735.843666
+191988.492579     8253756.941603
+192014.557994     8253770.489460
+192033.216315     8253777.662714
+192053.105387     8253786.107499
+192073.580243     8253797.065025
+192095.891111     8253810.555247
+192118.120985     8253829.053250
+192142.268629     8253845.076180
+192160.795339     8253860.386888
+192175.548023     8253876.891536
+192186.515785     8253895.216658
+192199.199610     8253923.585408
+192208.835384     8253946.898344
+192221.710796     8253963.374174
+192233.899952     8253983.596621
+192247.966394     8254003.847121
+192267.410027     8254039.833175
+192285.582424     8254077.050826
+192302.584783     8254109.243019
+192312.210436     8254133.181736
+192315.065372     8254150.130446
+192314.680683     8254173.915498
+192318.059886     8254197.133155
+192318.412058     8254214.042682
+192319.360120     8254232.839931
+192324.524731     8254261.719193
+192327.793340     8254291.821988
+192327.520009     8254308.721913
+192315.640361     8254346.730882
+192308.786508     8254383.565126
+192304.658145     8254406.667536
+192298.723382     8254425.359130
+192286.532059     8254443.954681
+192269.325826     8254463.099186
+192252.189689     8254477.862444
+192239.534851     8254486.432831
+192219.281319     8254500.522297
+192194.546502     8254520.803872
+192171.033092     8254542.982007
+192145.067523     8254561.992051
+192112.279867     8254577.140984
+192083.841886     8254594.235264
+192061.024851     8254612.041001
+192036.935780     8254631.080614
+192010.889230     8254655.097675
+191984.893285     8254675.985828
+191967.121524     8254691.365266
+191954.365437     8254706.195761
+191941.599229     8254721.652037
+191925.028621     8254740.180363
+191909.688776     8254759.979456
+191894.954932     8254781.041254
+191878.333705     8254802.699252
+191862.459484     8254816.854416
+191851.005009     8254828.575206
+191842.709214     8254838.464381
+191834.383783     8254850.233204
+191823.494084     8254865.718287
+191817.590460     8254882.531783
+191812.372302     8254895.600179
+191805.903163     8254908.647844
+191795.589113     8254927.272212
+191785.325682     8254942.766908
+191772.498722     8254961.979403
+191761.629266     8254976.212922
+191750.790949     8254988.568343
+191726.116883     8255005.093700
+191714.713051     8255013.683290
+191700.120951     8255025.981089
+191685.517955     8255038.905421
+191673.468377     8255048.736972
+191649.995439     8255068.412745
+191621.466355     8255091.139823
+191600.525830     8255108.974367
+191589.758373     8255116.948553
+191577.063025     8255128.023594
+191560.522792     8255144.673810
+191542.014159     8255166.929537
+191525.514435     8255181.075099
+191515.362348     8255189.685432
+191496.349714     8255204.419121
+191482.422838     8255214.223383
+191467.184229     8255227.763131
+191453.126530     8255245.703330
+191445.910385     8255266.253829
+191445.657295     8255281.902191
+191444.748327     8255299.419060
+191443.223225     8255316.299769
+191442.899276     8255336.329366
+191443.241314     8255353.865439
+191444.209619     8255371.411125
+191443.743924     8255400.204722
+191437.647198     8255428.910350
+191429.209658     8255447.563525
+191422.770870     8255458.734608
+191411.347534     8255468.577301
+191388.540633     8255485.756493
+191361.979161     8255502.879578
+191331.583676     8255524.952833
+191310.653260     8255542.162358
+191294.143402     8255556.934466
+191280.125424     8255572.371527
+191274.242042     8255587.933460
+191273.352553     8255604.198754
+191273.089354     8255620.472133
+191272.755271     8255641.128276
+191272.400946     8255663.035983
+191272.036487     8255685.570235
+191271.773289     8255701.843614
+191271.459448     8255721.248194
+191271.165874     8255739.399682
+191269.651645     8255755.655386
+191264.826931     8255783.128666
+191258.286907     8255800.559095
+191251.110507     8255818.604927
+191239.606178     8255833.455401
+191224.499180     8255838.857696
+191206.899515     8255843.596553
+191194.921562     8255849.046881
+191170.964101     8255859.949040
+191146.391272     8255870.215052
+191128.226830     8255871.189618
+191110.678571     8255872.797287
+191085.591583     8255876.169334
+191059.939843     8255875.775562
+191041.805802     8255874.870491
+191028.101640     8255870.904500
+191010.593865     8255870.009042
+190982.459591     8255868.325287
+190952.549279     8255860.353370
+190934.516474     8255853.188954
+190914.052516     8255841.604894
+190894.132303     8255835.038206
+190874.757365     8255833.488913
+190852.930267     8255828.771529
+190828.529533     8255828.396960
+190807.267976     8255827.443879
+190791.626578     8255827.203773
+190775.358913     8255826.954053
+190752.189682     8255827.851791
+190716.456740     8255831.685589
+190688.241497     8255835.008087
+190670.097322     8255834.729562
+190651.953147     8255834.451036
+190629.439795     8255833.480267
+190601.295412     8255832.421530
+190578.792194     8255830.824216
+190560.103510     8255825.528307
+190541.333832     8255825.240179
+190516.307595     8255824.856009
+190490.655091     8255824.462225
+190456.799422     8255828.324840
+190432.327803     8255832.333035
+190406.544476     8255840.075189
+190378.248214     8255848.406997
+190346.258157     8255852.924952
+190316.771665     8255857.479809
+190294.106460     8255865.898058
+190276.405559     8255876.896260
+190262.469338     8255887.325551
+190246.655844     8255897.726025
+190225.231536     8255906.788495
+190200.699191     8255914.551381
+190185.561818     8255921.831784
+190172.311827     8255928.515988
+190158.365497     8255939.570297
+190144.448755     8255948.748013
+190132.480910     8255953.573323
+190113.539136     8255963.925775
+190092.699822     8255975.502502
+190077.613067     8255979.653233
+190064.423828     8255982.581218
+190044.372768     8255984.151996
+190033.624814     8255990.873079
+190017.983416     8255990.632972
+190002.937145     8255992.280577
+189986.034607     8255992.647812
+189972.895986     8255992.446125
+189959.100721     8255994.112934
+189940.694112     8256010.107799
+189944.063194     8256033.951238
+189954.435816     8256050.389413
+189966.212087     8256057.456258
+189978.634079     8256063.282671
+189988.512834     8256071.572262
+189998.340947     8256082.993054
+190006.796575     8256101.905550
+190010.347886     8256114.481862
+190014.282484     8256142.091133
+190013.826923     8256170.258184
+190009.224159     8256183.961200
+190008.981203     8256198.983016
+190008.092477     8256215.248321
+190003.510720     8256227.699786
+189997.444345     8256254.528833
+189997.090019     8256276.436539
+189996.120324     8256297.708098
+189995.867235     8256313.356460
+189991.163236     8256333.318820
+189990.930388     8256347.715619
+189986.822280     8256369.565702
+189987.042840     8256394.612683
+190002.178060     8256426.149513
+190013.812585     8256441.980358
+190028.534907     8256460.362351
+190038.836669     8256481.181762
+190046.504807     8256510.100218
+190050.550010     8256530.823587
+190055.201237     8256552.808132
+190059.811981     8256577.295804
+190059.589267     8256591.066056
+190064.087877     8256622.439607
+190067.870621     8256659.437894
+190067.485945     8256683.222182
+190067.232855     8256698.870543
+190066.929148     8256717.648578
+190062.921512     8256733.239304
+190053.182348     8256755.002947
+190040.213668     8256782.977913
+190033.704019     8256798.530232
+190029.101995     8256812.234788
+190028.838796     8256828.508167
+190029.190968     8256845.417694
+190028.856885     8256866.073837
+190028.462051     8256890.486199
+190026.947846     8256906.740374
+190026.069253     8256922.379134
+190028.995061     8256934.945845
+190036.956034     8256945.711273
+190046.834765     8256954.002393
+190062.879716     8256968.022366
+190080.185019     8256981.436513
+190089.407871     8256991.596139
+END
+LINE3D
+HEIGHT 1060.000000
+183577.345605     8247000.662898
+183725.729241     8247151.324068
+183765.852361     8247146.931343
+183777.830900     8247141.480260
+183793.614025     8247132.957514
+183813.867747     8247118.868050
+183842.951665     8247100.531812
+183880.169034     8247082.320428
+183901.654081     8247069.502504
+183925.692140     8247053.593322
+183956.118371     8247029.642728
+183985.232658     8247009.428763
+184011.813991     8246991.054109
+184028.929306     8246977.542787
+184041.624648     8246966.468128
+184056.883511     8246951.676053
+184069.538356     8246943.105285
+184081.567513     8246934.524530
+184094.858180     8246925.337202
+184111.963368     8246912.452045
+184130.380689     8246895.830260
+184144.388164     8246881.018975
+184158.405761     8246865.581908
+184171.756975     8246852.639124
+184183.241616     8246839.041368
+184196.623397     8246824.220478
+184213.143388     8246808.821824
+184239.068651     8246792.315674
+184262.430596     8246779.526180
+184280.696063     8246772.293413
+184300.101556     8246771.965364
+184324.623584     8246764.828639
+184351.536833     8246764.615839
+184379.065847     8246765.038429
+184402.295989     8246760.386385
+184425.556698     8246753.856236
+184446.899827     8246749.801162
+184465.205786     8246740.064886
+184479.112025     8246731.512946
+184493.028195     8246722.335221
+184511.959847     8246712.608550
+184532.203633     8246699.145252
+184551.821725     8246685.672350
+184569.522238     8246674.674524
+184585.991802     8246662.405546
+184606.810473     8246652.081523
+184633.280443     8246640.592377
+184655.945827     8246632.174896
+184677.924771     8246627.503645
+184697.955768     8246627.185198
+184724.919832     8246623.842347
+184755.698419     8246616.801665
+184779.544128     8246612.785390
+184804.106843     8246603.144778
+184833.644162     8246595.459104
+184866.360570     8246584.691783
+184892.184603     8246574.444595
+184909.864867     8246564.698715
+184925.002055     8246557.417926
+184942.087192     8246545.784335
+184958.526387     8246535.393084
+184977.377052     8246530.673812
+184997.468793     8246526.599529
+185019.366751     8246526.935678
+185039.448365     8246523.487558
+185053.828635     8246524.334242
+185065.574136     8246533.279955
+185080.972566     8246548.542642
+185098.944645     8246559.461748
+185118.147475     8246571.652385
+185142.315368     8246586.423370
+185160.226320     8246601.098306
+185183.778831     8246615.233908
+185209.126864     8246634.405714
+185238.803946     8246656.774424
+185266.594011     8246679.740485
+185286.301248     8246699.451638
+185303.627187     8246711.613464
+185322.234890     8246721.916391
+185339.601326     8246731.574326
+185358.824787     8246742.513024
+185385.464705     8246759.200149
+185405.848057     8246775.791614
+185419.369602     8246791.025107
+185432.245007     8246807.501319
+185451.377359     8246824.073198
+185476.735513     8246842.619223
+185510.792264     8246865.055163
+185535.545169     8246882.339259
+185556.019636     8246893.297160
+185576.504606     8246903.629286
+185601.903257     8246919.671420
+185634.749117     8246939.584260
+185653.316323     8246952.391078
+185671.278274     8246963.936347
+185687.978710     8246976.088571
+185712.186718     8246988.355660
+185741.954909     8247005.091188
+185769.825967     8247023.049468
+185792.106841     8247038.417805
+185810.017793     8247053.092742
+185831.057406     8247067.815705
+185850.916497     8247078.137841
+185873.934231     8247086.630654
+185888.172388     8247096.240568
+185902.400423     8247106.476263
+185918.464853     8247119.244661
+185931.431754     8247130.087316
+185943.803146     8247139.042255
+185958.021054     8247149.904114
+185974.085484     8247162.672511
+185995.145339     8247176.143912
+186013.117418     8247187.063018
+186029.252708     8247195.450180
+186046.710258     8247199.474552
+186070.353502     8247207.976584
+186097.176025     8247213.396971
+186127.772191     8247217.623412
+186148.347894     8247222.321969
+186166.411081     8247227.607895
+186180.730225     8247232.210409
+186203.183207     8247236.937402
+186218.773988     8247240.307180
+186235.646144     8247241.818436
+186256.847732     8247246.526601
+186275.506053     8247253.699855
+186291.036088     8247260.825470
+186303.478340     8247265.399172
+186315.264720     8247271.841000
+186334.589040     8247276.519966
+186353.318221     8247279.311984
+186386.396922     8247284.828408
+186388.687099     8247298.011680
+186384.619106     8247317.357867
+186383.165628     8247329.857353
+186392.358117     8247341.894324
+186407.434375     8247338.368987
+186422.531257     8247333.592092
+186441.462910     8247323.865421
+186462.896963     8247314.176782
+186479.860616     8247310.054480
+186494.917002     8247307.781476
+186509.387999     8247302.994973
+186534.515472     8247297.119799
+186547.664221     8247296.695322
+186565.263880     8247291.956847
+186580.854660     8247295.326626
+186598.816230     8247306.871890
+186628.533803     8247326.737090
+186647.757270     8247337.675406
+186673.166042     8247353.091759
+186692.964388     8247367.169731
+186710.270085     8247380.583120
+186722.046337     8247387.651112
+186745.568096     8247403.664434
+186762.268539     8247415.816276
+186782.692388     8247429.903850
+186795.638659     8247441.998445
+186817.929660     8247456.740618
+186836.557612     8247465.791599
+186858.888722     8247478.030258
+186881.189845     8247492.146649
+186899.777299     8247503.701521
+186916.477353     8247515.853739
+186930.705770     8247526.089440
+186946.800570     8247536.980111
+186965.993279     8247549.796530
+186990.715809     8247568.958734
+187011.079301     8247586.801768
+187033.339551     8247603.421663
+187051.856139     8247619.358152
+187076.538172     8247641.024247
+187110.503808     8247669.093751
+187139.535146     8247692.704422
+187164.227300     8247713.744735
+187185.892416     8247728.477301
+187208.203284     8247741.967523
+187228.082617     8247751.038095
+187247.982199     8247758.856723
+187266.589902     8247769.159649
+187290.727044     8247785.808355
+187310.505141     8247801.138273
+187325.379304     8247810.132013
+187347.700293     8247822.996453
+187378.608522     8247846.635936
+187405.793331     8247868.340450
+187426.761696     8247887.445025
+187444.713520     8247899.616459
+187465.157618     8247912.452088
+187495.501083     8247932.326514
+187516.459326     8247952.056871
+187529.314865     8247969.785035
+187539.778996     8247980.588889
+187557.054317     8247995.880387
+187573.179486     8248004.893331
+187603.119786     8248010.987515
+187617.510178     8248011.208418
+187641.315396     8248009.695651
+187654.454018     8248009.897338
+187673.667357     8248021.461818
+187689.197392     8248028.587433
+187708.430599     8248038.899961
+187728.935435     8248047.980136
+187746.403107     8248051.378726
+187773.871381     8248055.556770
+187790.743919     8248057.068031
+187807.565840     8248061.708965
+187828.060555     8248071.414921
+187859.705644     8248088.178880
+187875.810952     8248098.443393
+187890.715102     8248105.559400
+187903.793367     8248109.516547
+187916.851001     8248114.725633
+187932.381036     8248121.851248
+187947.900950     8248129.602644
+187960.978833     8248133.559785
+187972.139710     8248139.992011
+187985.136599     8248148.956934
+187993.744081     8248158.480413
+188001.644690     8248173.001683
+188003.934492     8248186.184568
+188003.651033     8248203.710657
+188002.762313     8248219.975580
+187993.729640     8248236.741425
+187984.132208     8248249.741833
+187968.217472     8248266.402033
+187959.225677     8248280.663994
+187946.520208     8248292.364816
+187934.308643     8248312.211930
+187928.475497     8248324.644185
+187927.647141     8248337.153267
+187926.748294     8248354.044354
+187933.972788     8248371.685313
+187948.917429     8248376.297811
+187968.393985     8248371.587765
+187982.915607     8248363.671208
+187995.610942     8248352.596931
+188004.673604     8248333.953353
+188009.932246     8248318.381830
+188017.763767     8248298.467097
+188024.232925     8248285.418287
+188029.461192     8248271.724873
+188036.565975     8248258.059883
+188044.962642     8248241.910211
+188055.175838     8248229.545194
+188068.213223     8248236.006225
+188087.486920     8248243.815245
+188103.077701     8248247.185024
+188120.606493     8248246.828166
+188135.713121     8248241.425102
+188152.071513     8248236.041635
+188178.903781     8248240.835852
+188193.212797     8248246.064530
+188206.906062     8248250.657055
+188220.670951     8248250.868356
+188238.188858     8248251.137268
+188252.579250     8248251.358171
+188273.851705     8248251.684718
+188292.621382     8248251.972845
+188308.878156     8248252.848717
+188328.222720     8248256.276119
+188355.751733     8248256.698709
+188380.767849     8248257.708661
+188405.077468     8248263.716792
+188433.746131     8248271.043712
+188462.465406     8248275.241342
+188491.164438     8248280.690535
+188511.074529     8248287.883004
+188532.286239     8248291.965387
+188554.103209     8248297.308936
+188577.816937     8248301.429345
+188612.207764     8248303.209524
+188644.095815     8248304.951284
+188671.564090     8248309.129328
+188697.084225     8248317.660172
+188721.393844     8248323.668303
+188753.150290     8248333.547135
+188782.343984     8248347.143013
+188805.310718     8248358.765492
+188821.476384     8248365.274545
+188837.612450     8248373.660955
+188855.604007     8248383.328486
+188880.377155     8248399.361018
+188906.956703     8248419.804367
+188939.640969     8248449.732012
+188970.498568     8248476.501931
+188989.005035     8248493.064202
+189009.438630     8248506.525607
+189034.887899     8248519.438068
+189059.671167     8248534.844819
+189089.490365     8248548.450299
+189120.580811     8248560.823420
+189142.891678     8248574.313642
+189170.208099     8248587.880702
+189198.069030     8248606.465146
+189235.324920     8248624.567872
+189259.533316     8248636.834585
+189285.043324     8248645.991592
+189309.917707     8248655.764779
+189349.172361     8248666.384651
+189382.129195     8248679.412359
+189414.491654     8248690.553132
+189444.350584     8248701.654710
+189482.989856     8248711.639198
+189507.803500     8248725.167839
+189530.114356     8248738.658825
+189551.153975     8248753.381407
+189568.580768     8248759.283882
+189587.188471     8248769.586808
+189613.314625     8248779.379211
+189629.449915     8248787.766373
+189648.077860     8248796.817736
+189661.074762     8248805.781895
+189680.862598     8248820.486025
+189699.470301     8248830.788951
+189720.601023     8248839.878734
+189742.911891     8248853.368956
+189765.727536     8248874.380463
+189784.829130     8248892.830445
+189800.934057     8248903.094952
+189829.491363     8248917.306999
+189864.255362     8248934.745535
+189885.334714     8248946.964215
+189901.420150     8248958.481061
+189920.007598     8248970.036314
+189944.205097     8248982.929561
+189967.798111     8248994.560889
+189985.820795     8249002.351087
+190003.802995     8249012.644411
+190023.015959     8249024.208503
+190040.392134     8249033.240651
+190063.400129     8249042.359251
+190083.309456     8249049.551708
+190109.465973     8249057.466766
+190123.774620     8249062.694675
+190135.591363     8249067.259158
+190148.023500     8249072.458260
+190162.332898     8249077.686944
+190177.277169     8249082.298673
+190194.724968     8249086.949596
+190208.408112     8249092.167902
+190230.164337     8249101.267287
+190247.510912     8249112.176791
+190260.477426     8249123.019823
+190272.818449     8249133.852488
+190290.124527     8249147.265883
+190301.900773     8249154.334257
+190316.077809     8249167.699619
+190340.820593     8249185.609496
+190362.424964     8249204.097897
+190372.919841     8249213.024412
+190402.173510     8249222.864824
+190428.359639     8249228.901762
+190455.797538     8249234.957914
+190484.456080     8249242.910616
+190501.207515     8249251.933173
+190518.573569     8249261.591102
+190536.586145     8249270.006318
+190560.875509     8249277.266777
+190588.323542     8249282.696384
+190611.946155     8249292.450355
+190634.984526     8249299.690846
+190653.642834     8249306.864864
+190674.733071     8249318.457774
+190702.028474     8249333.277150
+190743.038923     8249351.436747
+190769.567090     8249375.009757
+190788.628200     8249395.962866
+190812.796087     8249410.734232
+190843.210412     8249426.227423
+190861.797873     8249437.781913
+190877.933163     8249446.169075
+190890.324803     8249453.872068
+190903.937838     8249463.472386
+190921.919262     8249473.766463
+190939.860965     8249486.563678
+190969.054659     8249500.159556
+190993.080062     8249523.693383
+191019.781100     8249536.625060
+191044.533993     8249553.909919
+191076.804586     8249570.683480
+191105.886923     8249591.164484
+191132.516325     8249608.478149
+191154.090333     8249628.843896
+191179.408754     8249649.893823
+191199.206725     8249663.971407
+191219.722064     8249672.425806
+191235.191366     8249683.306493
+191253.162681     8249694.225587
+191270.489002     8249706.387419
+191282.799649     8249719.098193
+191296.209449     8249741.217189
+191315.170075     8249768.430418
+191332.272918     8249794.362491
+191347.055966     8249808.989794
+191359.860517     8249829.846860
+191367.700763     8249848.123972
+191371.130597     8249868.211193
+191375.670455     8249897.081628
+191383.277103     8249929.754764
+191390.339992     8249957.411291
+191393.871061     8249971.239167
+191395.433742     8249990.671789
+191403.494549     8250033.995882
+191410.537196     8250062.903973
+191413.392131     8250079.852683
+191413.734182     8250097.387992
+191413.995226     8250119.931846
+191417.959448     8250145.662231
+191422.570179     8250170.150667
+191428.411674     8250195.909870
+191437.239716     8250230.480330
+191446.834994     8250256.297156
+191453.948501     8250280.824011
+191459.962092     8250295.942634
+191468.305600     8250321.740245
+191476.680247     8250345.659758
+191483.248468     8250365.169982
+191486.760059     8250380.249433
+191490.240498     8250397.207746
+191493.700694     8250415.417621
+191495.839024     8250437.989529
+191496.241814     8250451.769384
+191495.292349     8250471.790143
+191489.367719     8250489.855191
+191480.980797     8250505.378692
+191475.753281     8250519.072882
+191470.545257     8250531.514733
+191468.466276     8250544.004617
+191470.705078     8250560.317168
+191484.973992     8250568.048978
+191501.744906     8250575.819961
+191516.750680     8250576.676247
+191540.363936     8250587.056012
+191549.536182     8250600.344547
+191544.963782     8250612.170218
+191528.010638     8250615.666362
+191513.549374     8250619.827459
+191503.830464     8250640.338774
+191503.506502     8250660.369135
+191514.576264     8250672.434924
+191528.885675     8250677.662844
+191543.153812     8250685.395407
+191562.982922     8250697.594894
+191580.440078     8250701.620024
+191597.877769     8250706.895966
+191612.257276     8250707.742638
+191629.755693     8250709.263890
+191642.248569     8250710.707538
+191660.896756     8250718.507338
+191681.543707     8250718.824283
+191700.434876     8250711.600739
+191716.873873     8250701.209867
+191728.357947     8250687.611719
+191737.309621     8250675.854038
+191749.419963     8250662.265504
+191759.572037     8250653.655934
+191777.807314     8250648.301661
+191797.273368     8250644.217391
+191817.244198     8250647.654407
+191830.382819     8250647.856094
+191849.223357     8250643.762986
+191863.704100     8250638.350314
+191880.164116     8250626.707126
+191894.140833     8250613.773944
+191905.534557     8250605.809372
+191913.264836     8250592.154365
+191924.780038     8250576.678885
+191934.932113     8250568.069315
+191951.209135     8250567.693242
+191957.898847     8250579.691794
+191958.816547     8250600.366389
+191958.583699     8250614.763187
+191962.659278     8250633.608446
+191967.472480     8250645.578193
+191979.843866     8250654.533514
+191995.647252     8250644.758057
+192003.519264     8250622.339815
+192008.131384     8250608.011006
+192009.616002     8250593.633423
+192013.572256     8250581.172357
+192018.143893     8250569.346674
+192025.824318     8250558.821352
+192038.712016     8250535.853404
+192048.329690     8250521.601433
+192065.444821     8250508.089727
+192083.145709     8250497.092288
+192102.107738     8250485.487508
+192115.347595     8250479.429851
+192131.675235     8250475.924105
+192156.075969     8250476.298673
+192182.979480     8250476.711661
+192214.262276     8250477.191874
+192245.545072     8250477.672087
+192271.196813     8250478.065859
+192294.416649     8250474.039212
+192318.202001     8250473.778397
+192344.570359     8250468.548208
+192366.549297     8250463.877340
+192390.385267     8250460.486852
+192411.102327     8250456.421786
+192439.893232     8250456.237810
+192472.447277     8250455.485663
+192499.996545     8250454.655925
+192526.960030     8250451.313447
+192556.437177     8250447.383619
+192592.180253     8250442.923275
+192621.041267     8250438.357287
+192645.522982     8250433.724839
+192680.004930     8250429.871073
+192718.230528     8250426.701476
+192743.266886     8250426.459865
+192766.527971     8250419.930103
+192794.834341     8250410.973278
+192819.880833     8250410.105121
+192846.168197     8250409.882713
+192868.066155     8250410.218862
+192891.195628     8250411.826554
+192911.145452     8250416.515121
+192938.654223     8250418.189274
+192967.988873     8250423.022669
+192989.200589     8250427.104670
+193003.520120     8250431.706809
+193021.582538     8250436.993104
+193037.769209     8250442.250606
+193050.826850     8250447.459310
+193068.284018     8250451.483676
+193085.075951     8250458.002343
+193098.647725     8250470.106540
+193110.968493     8250482.191532
+193125.166535     8250494.305343
+193136.184915     8250509.500793
+193144.529186     8250535.298415
+193147.948898     8250556.011417
+193152.731725     8250569.859273
+193153.770139     8250583.022948
+193157.947717     8250595.608874
+193164.505830     8250615.744116
+193170.377688     8250639.625974
+193173.303496     8250652.192684
+193178.539730     8250676.690722
+193183.261067     8250694.293256
+193186.772645     8250709.373471
+193190.949459     8250721.959386
+193198.254553     8250734.593321
+193202.391635     8250749.683138
+193209.524633     8250772.957654
+193210.573931     8250785.495559
+193210.875473     8250805.535523
+END
+LINE3D
+HEIGHT 1060.000000
+193209.926020     8250825.555518
+193210.802446     8250848.734756
+193193.525353     8250872.260497
+193183.311776     8250884.625509
+193171.303434     8250891.954710
+193157.457564     8250896.750426
+193138.586651     8250902.721643
+193117.223082     8250908.028659
+193093.387876     8250911.419158
+193068.361639     8250911.034988
+193052.720240     8250910.794882
+193038.329849     8250910.573979
+193019.560171     8250910.285851
+193011.860255     8250922.063513
+193018.479107     8250938.443301
+193027.610856     8250954.235726
+193031.797791     8250966.195859
+193039.759528     8250976.961299
+193055.591111     8251004.126496
+193059.132301     8251017.328590
+193070.161566     8251031.898270
+193085.147097     8251034.006119
+193097.105573     8251029.807367
+193107.883151     8251021.207399
+193126.189300     8251011.471126
+193141.729462     8251017.970577
+193148.267321     8251039.358146
+193151.687033     8251060.071149
+193152.110064     8251072.599440
+193141.150257     8251092.466534
+193130.342316     8251102.943847
+193107.625741     8251114.490992
+193091.903350     8251119.258667
+193064.314361     8251122.591543
+193047.360453     8251126.087675
+193025.320763     8251134.514761
+193013.362288     8251138.713513
+192991.938744     8251147.775995
+192978.698123     8251153.833641
+192967.940787     8251161.182045
+192957.173343     8251169.155467
+192948.867402     8251179.671952
+192939.300346     8251190.794250
+192927.270998     8251199.375002
+192913.919784     8251212.317786
+192904.302097     8251226.570521
+192904.038887     8251242.844664
+192904.996307     8251261.016120
+192908.538261     8251274.218226
+192913.955960     8251287.449126
+192919.989794     8251301.316186
+192936.731108     8251310.964525
+192953.684264     8251307.467617
+192975.754317     8251297.163186
+192992.829715     8251286.155381
+193005.423815     8251281.340449
+193018.007806     8251277.150535
+193025.978887     8251287.290946
+193030.034988     8251307.387780
+193034.120687     8251325.607258
+193016.934697     8251343.500200
+192997.437516     8251349.461803
+192979.788009     8251357.329581
+192965.911764     8251364.003406
+192961.259134     8251380.836870
+192961.661923     8251394.616725
+192969.562908     8251409.138383
+192976.807263     8251425.527773
+192985.273013     8251443.814488
+192988.763585     8251460.146254
+192993.424934     8251481.505018
+192993.161723     8251497.779161
+192987.034609     8251528.363662
+192972.885796     8251551.937425
+192961.985964     8251568.049053
+192950.582895     8251576.638655
+192922.286646     8251584.969698
+192906.523757     8251592.241264
+192881.859813     8251608.140839
+192866.671822     8251618.550915
+192844.611890     8251628.229565
+192825.649862     8251639.834345
+192805.487445     8251648.290248
+192785.212907     8251663.631267
+192760.538842     8251680.156624
+192749.741009     8251690.008919
+192737.580062     8251706.726361
+192727.347007     8251720.342947
+192719.626836     8251733.372936
+192710.685283     8251744.504836
+192703.560252     8251759.421772
+192690.702930     8251780.511612
+192673.354200     8251808.419341
+192653.080427     8251823.760371
+192640.405333     8251833.583084
+192623.370433     8251842.086998
+192606.214817     8251858.101831
+192579.078460     8251872.085642
+192551.882139     8251889.824154
+192521.062859     8251899.369106
+192499.547449     8251914.064375
+192477.426765     8251927.499243
+192463.470290     8251939.180861
+192448.292420     8251948.965156
+192436.746855     8251966.317981
+192420.832113     8251982.978564
+192407.339166     8252004.684583
+192398.266002     8252023.953937
+192392.947384     8252043.280926
+192382.027310     8252060.644117
+192371.743636     8252077.390376
+192355.828894     8252094.050959
+192342.406819     8252111.374979
+192325.291689     8252124.886685
+192311.283844     8252139.697200
+192287.891912     8252154.364428
+192268.233520     8252170.340841
+192251.814002     8252179.480138
+192239.108533     8252191.180961
+192226.311949     8252208.515347
+192214.868383     8252219.608839
+192200.265387     8252232.533172
+192188.175300     8252244.869378
+192178.618365     8252255.365894
+192165.439246     8252257.668098
+192151.029376     8252258.698770
+192136.618730     8252259.730195
+192114.639791     8252264.401063
+192098.312151     8252267.906809
+192083.265880     8252269.554414
+192068.875488     8252269.333511
+192055.111363     8252269.122222
+192037.270896     8252250.065662
+192031.328165     8252230.565804
+192024.033192     8252217.306086
+192008.976813     8252219.578708
+191998.662763     8252238.203077
+191996.522267     8252254.449167
+191983.604205     8252279.294460
+191976.458932     8252295.462959
+191966.932361     8252304.082131
+191958.596057     8252316.475960
+191946.587727     8252323.804397
+191932.711482     8252330.478222
+191913.719078     8252343.961111
+191897.280081     8252354.351983
+191880.942319     8252358.483511
+191869.548595     8252366.448083
+191858.629285     8252383.811286
+191853.935407     8252403.147865
+191853.006196     8252421.916297
+191867.839874     8252433.413164
+191885.984049     8252433.691690
+191909.758516     8252434.056644
+191927.277187     8252434.325568
+191939.810548     8252433.266090
+191966.734301     8252432.427515
+191982.244100     8252440.804311
+191990.769824     8252455.335559
+191977.307253     8252475.163470
+191961.655734     8252475.549145
+191946.710699     8252470.937405
+191943.904979     8252489.677031
+191937.949973     8252509.620188
+191924.083849     8252515.668232
+191907.816947     8252515.418524
+191890.894167     8252517.037322
+191877.755545     8252516.835635
+191859.943288     8252534.718964
+191850.305359     8252550.223262
+191842.009552     8252560.113200
+191830.646968     8252566.199676
+191813.118175     8252566.556533
+191799.959299     8252567.607174
+191778.626106     8252571.036081
+191756.041906     8252574.445784
+191738.835673     8252593.590289
+191724.121319     8252613.399748
+191713.604798     8252644.542806
+191709.567563     8252662.010889
+191704.752194     8252688.859140
+191696.244558     8252711.893562
+191691.560801     8252730.604359
+191681.297369     8252746.099055
+191673.415224     8252769.143842
+191658.065258     8252789.568717
+191646.469063     8252810.051979
+191634.944504     8252826.153253
+191627.737728     8252846.077194
+191611.126623     8252867.109410
+191605.696636     8252893.322289
+191599.741630     8252913.265446
+191599.539158     8252925.784136
+191593.381681     8252958.245982
+191589.293815     8252978.844502
+191588.990108     8252997.622536
+191588.635783     8253019.530242
+191588.058744     8253055.208201
+191588.319788     8253077.752055
+191588.378373     8253112.813835
+191587.447009     8253170.399500
+191588.121728     8253206.097439
+191588.311924     8253233.021765
+191588.068956     8253248.044345
+191587.775370     8253266.196597
+191587.259070     8253298.119103
+191583.181337     8253318.091077
+191579.052211     8253341.193476
+191571.200441     8253362.360154
+191563.812200     8253393.551233
+191559.572493     8253423.538006
+191559.329524     8253438.560586
+191562.133854     8253458.638205
+191562.405032     8253480.555513
+191570.102782     8253507.595849
+191573.361271     8253538.324426
+191578.728353     8253554.684998
+191588.486369     8253570.487038
+191597.537125     8253591.287245
+191602.883964     8253608.899380
+191626.950615     8253629.930092
+191642.176949     8253655.833359
+191661.965550     8253670.537500
+191685.930214     8253697.826781
+191705.052814     8253715.025211
+191720.410760     8253732.791025
+191734.516923     8253750.538386
+191755.908701     8253782.171259
+191774.344308     8253803.114765
+191784.172421     8253814.535557
+191792.113903     8253826.553325
+191803.031811     8253848.008131
+191821.941068     8253878.350257
+191829.195544     8253894.113865
+191833.978371     8253907.961721
+191840.546605     8253927.471181
+191844.703177     8253941.308659
+191856.791098     8253967.790450
+191861.573937     8253981.637542
+191869.766354     8254016.824181
+191873.659704     8254046.936566
+191878.361549     8254065.791439
+191892.386731     8254088.545818
+191897.027837     8254111.156145
+191900.961684     8254138.764640
+191901.081772     8254170.070977
+191900.565471     8254201.993482
+191900.130153     8254228.908970
+191899.593610     8254262.083038
+191903.264246     8254305.965676
+191903.001023     8254322.240584
+191902.173048     8254334.749671
+191896.228164     8254354.067046
+191887.104382     8254376.466072
+191876.104090     8254398.836293
+191858.755361     8254426.744022
+191840.640159     8254463.405396
+191820.779296     8254491.900499
+191800.302287     8254519.760207
+191778.645132     8254543.219476
+191760.299249     8254555.459651
+191737.562432     8254568.258359
+191710.930864     8254589.762692
+191686.074569     8254617.555175
+191659.957146     8254645.954235
+191636.393118     8254671.262043
+191612.990301     8254686.555040
+191591.969534     8254709.398140
+191569.555277     8254740.984497
+191551.026401     8254764.491786
+191537.594206     8254782.441588
+191526.109380     8254796.038959
+191503.857097     8254817.610516
+191481.019795     8254836.669345
+191469.575454     8254847.763590
+191455.568373     8254862.574117
+191435.839109     8254882.932531
+191422.426392     8254899.630757
+191414.756839     8254909.531073
+191403.272013     8254923.128445
+191387.306665     8254942.917936
+191369.485050     8254961.427058
+191352.419786     8254971.808316
+191335.264159     8254987.823913
+191314.899283     8255008.797742
+191291.314236     8255035.357866
+191268.456693     8255055.668258
+191226.748478     8255080.698304
+191191.114617     8255117.089990
+191159.728431     8255161.686355
+191136.810136     8255185.752966
+191117.221853     8255197.347368
+191091.972903     8255210.733450
+191065.351443     8255231.612765
+191038.012638     8255258.113737
+191013.096356     8255289.662450
+190983.366119     8255309.240640
+190958.036175     8255327.634504
+190938.942547     8255347.375973
+190924.178327     8255370.315880
+190911.764291     8255402.681684
+190898.291586     8255423.136140
+190872.921157     8255444.033130
+190845.128920     8255459.885448
+190822.413122     8255471.431841
+190804.157578     8255478.039206
+190782.713028     8255488.353239
+190756.838574     8255501.729719
+190729.661732     8255518.216657
+190711.375812     8255526.702130
+190693.746560     8255533.317581
+190671.061112     8255542.987392
+190644.580633     8255555.102696
+190609.392200     8255563.953877
+190578.038544     8255567.854900
+190551.043931     8255573.074711
+190528.449586     8255577.111724
+190509.629290     8255579.953268
+190491.414255     8255584.055978
+190477.014519     8255584.460105
+190463.875897     8255584.258418
+190446.306608     8255587.119166
+190426.759573     8255596.210454
+190401.682718     8255598.955956
+190373.447208     8255603.531546
+190344.596328     8255607.470988
+190331.396191     8255611.025507
+190308.811979     8255614.435974
+190280.566360     8255619.636582
+190243.500654     8255628.458945
+190219.039932     8255631.840607
+190200.260146     8255632.177496
+190176.928189     8255643.089258
+190147.360679     8255652.653425
+190127.904771     8255656.110386
+190109.074342     8255659.578476
+190090.869440     8255663.054640
+190069.526101     8255667.110857
+190043.147622     8255672.966827
+190021.804308     8255677.021516
+190006.778304     8255677.416029
+189979.148055     8255683.252784
+189951.446921     8255693.472303
+189933.797426     8255701.339316
+189918.619544     8255711.124375
+189902.160305     8255722.766810
+189886.296168     8255736.298484
+189867.202540     8255756.039954
+189847.534028     8255772.642149
+189827.269624     8255787.356622
+189808.831851     8255805.231113
+189789.062102     8255828.092653
+189769.150609     8255859.718193
+189751.924146     8255880.113497
+189742.276084     8255896.244341
+189738.288690     8255910.583505
+189729.246653     8255927.975525
+189720.788871     8255947.880262
+189715.520120     8255964.076803
+189713.370254     8255980.949451
+189712.522037     8255994.710101
+189712.198087     8256014.739699
+189716.364768     8256027.952159
+189726.162530     8256041.249532
+189744.587991     8256062.820348
+189762.740146     8256101.289562
+189765.362246     8256132.634307
+189770.598468     8256157.133108
+189774.068811     8256174.715674
+189788.436782     8256215.006902
+189804.086160     8256253.437696
+189811.240164     8256275.460660
+189816.526239     8256296.829778
+189817.373066     8256321.886373
+189822.084282     8256340.114688
+189826.816503     8256357.091452
+189837.430691     8256397.325056
+189848.811364     8256428.804251
+189855.299380     8256453.320740
+189858.063201     8256475.903014
+189858.273653     8256501.575012
+189857.888952     8256525.360828
+189857.595353     8256543.513844
+189857.977900     8256558.545262
+189863.849759     8256582.427120
+189866.522477     8256610.642193
+189866.168152     8256632.549899
+189867.095209     8256652.598700
+189867.519004     8256665.127003
+189867.276048     8256680.148819
+189867.496608     8256705.195800
+189870.531607     8256749.695382
+189869.954568     8256785.373341
+189869.741963     8256798.518576
+189869.215542     8256831.066863
+189862.564173     8256855.381653
+189857.941906     8256870.337773
+189848.172366     8256893.979524
+189838.544571     8256908.857276
+189825.020485     8256932.441393
+189819.813224     8256944.883255
+189818.308364     8256960.512402
+189816.483269     8256995.441932
+END
+LINE3D
+HEIGHT 1070.000000
+183557.000000     8247312.202083
+183565.300327     8247319.783831
+183580.830362     8247326.909445
+183596.370524     8247333.408896
+183615.069342     8247338.078260
+183636.331478     8247339.030968
+183651.347182     8247339.261469
+183666.988580     8247339.501576
+183689.522359     8247339.221166
+183705.769203     8247340.722823
+183713.649564     8247356.496038
+183723.538613     8247364.160997
+183740.986036     8247368.811533
+183758.453899     8247372.210126
+183772.904654     8247368.675187
+183790.514243     8247363.310927
+183811.231678     8247359.246249
+183837.590291     8247354.642229
+183868.348629     8247348.853492
+183894.122045     8247341.735978
+183918.068995     8247331.459976
+183943.923398     8247319.335062
+183969.737304     8247309.714038
+183998.648929     8247302.018760
+184016.944958     8247292.908268
+184036.542610     8247280.687309
+184051.064423     8247272.770755
+184068.754808     8247262.399092
+184088.383027     8247248.300026
+184113.702844     8247230.532326
+184134.622751     8247213.948959
+184149.235672     8247200.399224
+184165.786224     8247183.122846
+184175.948419     8247173.887495
+184188.603270     8247165.316345
+184196.949505     8247152.296731
+184209.756210     8247134.336563
+184219.979335     8247121.345761
+184232.302072     8247094.613135
+184247.086904     8247070.422435
+184259.934100     8247049.958759
+184269.703633     8247026.317389
+184279.341562     8247010.813092
+184288.313305     8246997.802698
+184298.536431     8246984.811895
+184310.646575     8246971.223741
+184324.633802     8246957.664401
+184339.216156     8246945.992772
+184356.311414     8246933.733399
+184380.288735     8246921.579670
+184400.573018     8246905.612482
+184416.437130     8246892.082335
+184429.707554     8246884.146572
+184444.168424     8246879.986233
+184461.788140     8246873.995809
+184485.038531     8246868.091820
+184510.226749     8246858.460810
+184525.333561     8246853.058130
+184541.035705     8246849.542401
+184556.122466     8246845.391287
+184574.347437     8246840.662411
+184596.972324     8246834.748820
+184628.346229     8246829.595852
+184648.468340     8246823.643842
+184667.339254     8246817.672625
+184683.041397     8246814.156895
+184703.748896     8246810.718383
+184723.840637     8246806.644100
+184747.635926     8246805.757118
+184765.790030     8246805.409860
+184778.928843     8246805.611550
+184795.135005     8246809.616712
+184810.150900     8246809.847217
+184833.905501     8246811.464122
+184854.531822     8246813.033007
+184867.660513     8246813.860479
+184892.656381     8246816.122376
+184917.067045     8246815.871160
+184930.296972     8246810.439287
+184946.120594     8246799.412649
+184963.882036     8246784.659372
+184977.737467     8246779.237101
+184994.731489     8246773.237072
+185012.249779     8246773.505990
+185027.891368     8246773.746100
+185040.333620     8246778.319803
+185053.320388     8246787.910507
+185069.283582     8246806.938249
+185081.009222     8246817.135531
+185092.159590     8246824.193915
+185106.397746     8246833.803829
+185121.302284     8246840.919460
+185140.545611     8246850.606206
+185161.000212     8246862.816059
+185175.248496     8246871.799809
+185188.891518     8246879.522394
+185199.385631     8246888.448897
+185213.583678     8246900.562326
+185225.288689     8246912.011547
+185233.855674     8246924.038917
+185245.530315     8246937.365865
+185259.082223     8246950.722013
+185271.362500     8246965.310515
+185281.180874     8246977.357094
+185291.664865     8246986.909379
+185302.128996     8246997.713233
+185311.372103     8247006.620532
+185320.564591     8247018.657504
+185330.957856     8247033.842975
+185338.283580     8247045.224971
+185347.465948     8247057.887725
+185357.324436     8247067.430408
+185377.616680     8247089.655053
+185394.841765     8247108.076230
+185411.420341     8247127.739356
+185430.421082     8247152.448688
+185450.591842     8247182.184624
+185472.186092     8247201.298807
+185498.836131     8247217.360151
+185514.305427     8247228.241220
+185529.179596     8247237.234578
+185540.904848     8247247.432236
+185556.959539     8247260.826421
+185566.172276     8247271.611447
+185584.668615     8247288.799882
+185595.173237     8247297.100227
+185613.246164     8247301.760365
+185630.088332     8247305.149353
+185648.212265     8247306.679443
+185662.582026     8247308.152285
+185680.090189     8247309.047366
+185700.111255     8247309.354704
+185720.767951     8247309.045479
+185739.537629     8247309.333607
+185757.681803     8247309.612133
+185773.252335     8247314.233857
+185790.699759     8247318.884393
+185807.491309     8247325.403054
+185823.031472     8247331.902505
+185838.561513     8247339.027738
+185854.717051     8247346.162954
+185872.123984     8247353.316999
+185887.079140     8247357.302957
+185902.013659     8247362.541237
+185914.476160     8247365.862995
+185927.594921     8247367.316251
+185942.549689     8247371.302586
+185958.816973     8247371.552300
+185980.714930     8247371.888449
+186005.105161     8247372.888793
+186020.060311     8247376.875134
+186034.399703     8247380.225703
+186046.852082     8247384.173242
+186070.505447     8247392.049492
+186085.369488     8247401.669014
+186104.602695     8247411.981542
+186119.497105     8247419.723337
+186133.180625     8247424.942031
+186146.843896     8247431.412671
+186161.173160     8247435.389403
+186176.067196     8247443.130810
+186192.273734     8247447.136360
+186207.228508     8247451.122313
+186225.988058     8247452.036604
+186244.737494     8247453.576296
+186259.117758     8247454.423362
+186278.482570     8247456.598818
+186305.748373     8247473.295552
+186329.926005     8247487.440749
+186349.866083     8247492.755486
+186366.677876     8247498.022583
+186385.860465     8247511.464784
+186400.189736     8247515.441134
+186413.832758     8247523.163719
+186437.465874     8247532.291915
+186454.893437     8247538.194020
+186467.971314     8247542.151543
+186484.803361     8247546.166314
+186501.009517     8247550.171858
+186517.892183     8247551.056956
+186532.261944     8247552.529798
+186553.534399     8247552.856345
+186576.552139     8247561.348775
+186590.810544     8247569.706744
+186611.940883     8247578.796520
+186627.470925     8247585.921753
+186641.770202     8247591.776219
+186656.674358     8247598.891844
+186672.214520     8247605.391295
+186685.282658     8247609.974606
+186700.237432     8247613.960558
+186720.792886     8247619.911061
+186740.682347     8247628.355470
+186757.453649     8247636.126076
+186772.963442     8247644.503254
+186790.996254     8247651.667288
+186800.885118     8247659.331862
+186812.590504     8247670.781471
+186827.958570     8247687.921503
+186843.942007     8247705.697682
+186866.888881     8247718.571730
+186882.358183     8247729.452417
+186894.729569     8247738.407737
+186910.854738     8247747.420681
+186931.904478     8247761.517481
+186950.441309     8247776.202407
+186965.234108     8247790.203158
+186981.792811     8247811.118618
+187003.952207     8247833.997863
+187023.679305     8247852.457447
+187045.919689     8247870.329292
+187063.901507     8247880.622611
+187077.544529     8247888.345196
+187089.996909     8247892.292735
+187102.388543     8247899.996110
+187117.293075     8247907.112123
+187129.715085     8247912.937389
+187149.432444     8247932.022761
+187163.589613     8247946.640074
+187179.583176     8247963.790089
+187196.283612     8247975.942313
+187209.936762     8247983.038734
+187230.411229     8247993.996636
+187248.352932     8248006.793851
+187264.386993     8248021.439976
+187276.717888     8248032.898805
+187285.910376     8248044.935777
+187297.514533     8248062.644349
+187310.914205     8248085.389508
+187336.050027     8248117.705791
+187351.397839     8248136.098150
+187363.708486     8248148.808924
+187372.850363     8248163.975186
+187385.059774     8248182.945306
+187392.990753     8248195.588849
+187399.528611     8248216.976418
+187409.255876     8248234.656179
+187416.470238     8248252.923684
+187422.331981     8248277.430941
+187426.508795     8248290.016856
+187429.343495     8248308.216747
+187433.247347     8248337.703357
+187441.530880     8248367.256433
+187444.385815     8248384.205144
+187446.564260     8248404.273155
+187446.947177     8248419.305343
+187446.521992     8248445.594285
+187446.208163     8248464.998100
+187445.995558     8248478.143336
+187439.767221     8248514.986417
+187433.761967     8248538.060016
+187429.149464     8248552.388820
+187425.081458     8248571.735771
+187423.617859     8248584.861038
+187413.838198     8248609.128571
+187405.339919     8248631.537199
+187403.189696     8248648.408313
+187393.389793     8248673.927409
+187387.242807     8248705.764244
+187381.277680     8248726.333182
+187376.019419     8248741.904711
+187373.848942     8248760.028152
+187376.734253     8248775.098753
+187388.459512     8248785.296029
+187392.464612     8248808.522530
+187392.160905     8248827.300564
+187376.891920     8248842.718421
+187361.805535     8248846.869922
+187336.779297     8248846.485752
+187323.085663     8248841.892457
+187300.511585     8248844.676379
+187287.200473     8248855.116030
+187271.326240     8248869.271958
+187258.580274     8248883.476672
+187248.347218     8248897.093259
+187234.440979     8248905.645199
+187218.779326     8248906.657420
+187205.004698     8248907.071907
+187186.143906     8248912.417342
+187169.745405     8248920.304324
+187153.387007     8248925.688172
+187138.250016     8248932.968582
+187122.497249     8248939.614366
+187104.837239     8248948.107919
+187092.253248     8248952.297834
+187070.778322     8248964.489976
+187047.386008     8248979.157197
+187022.752821     8248993.178669
+187002.498908     8249007.268130
+186981.034103     8249018.834491
+186963.989463     8249027.964192
+186952.565758     8249037.806115
+186937.297155     8249053.223978
+186925.852826     8249064.317459
+186916.891401     8249076.701692
+186905.457562     8249087.170161
+186895.850009     8249100.796350
+186889.975985     8249115.732489
+186885.262234     8249136.321401
+186884.978781     8249153.847108
+186890.870894     8249176.476639
+186894.351715     8249193.434957
+186902.817082     8249211.721666
+186911.353704     8249225.626380
+186926.106007     8249242.131022
+186936.549884     8249254.187204
+186948.961766     8249260.638633
+186961.404025     8249265.211954
+186980.123085     8249268.629754
+186999.992297     8249278.326109
+187020.578115     8249282.399266
+187034.221144     8249290.121469
+187050.427306     8249294.126631
+187073.515913     8249298.237444
+187102.861066     8249302.445063
+187121.630744     8249302.733191
+187139.149034     8249303.002109
+187158.544596     8249303.299845
+187182.400439     8249298.657024
+187211.261452     8249294.091036
+187241.373842     8249289.545022
+187267.712206     8249286.192948
+187290.871685     8249285.921761
+187312.235242     8249280.615509
+187338.048969     8249270.993718
+187358.827137     8249263.173968
+187373.954389     8249256.519346
+187391.009163     8249246.763100
+187408.063542     8249237.007611
+187420.082757     8249229.053405
+187430.214589     8249221.695398
+187443.647179     8249203.744839
+187463.325813     8249186.516862
+187477.908173     8249174.844851
+187489.352515     8249163.750606
+187502.047850     8249152.676329
+187514.005956     8249148.476807
+187526.620310     8249142.409547
+187541.798180     8249132.625253
+187555.704420     8249124.073312
+187570.246283     8249114.905192
+187587.987287     8249101.403857
+187600.057131     8249090.319215
+187608.423417     8249076.048034
+187617.384842     8249063.663801
+187631.957464     8249052.617578
+187645.853188     8249044.692177
+187664.552005     8249049.361540
+187686.934115     8249058.470533
+187708.832073     8249058.806682
+187723.918458     8249054.655180
+187725.402681     8249040.278356
+187714.394040     8249024.457119
+187704.021024     8249008.019702
+187702.982241     8248994.855257
+187710.320246     8248966.793856
+187716.870379     8248948.738410
+187735.216644     8248936.498241
+187752.968162     8248922.370366
+187771.920069     8248911.391368
+187792.254582     8248892.294884
+187812.447744     8248881.961641
+187827.615493     8248872.803128
+187850.341425     8248860.630190
+187868.799428     8248841.504900
+187885.440909     8248818.594574
+187900.144748     8248799.411655
+187911.599210     8248787.691629
+187921.135903     8248778.446676
+187937.000015     8248764.916529
+187950.946369     8248753.860692
+187971.765416     8248743.537057
+187991.948075     8248733.829590
+188007.791945     8248721.551007
+188024.332572     8248704.900032
+188041.478448     8248689.510986
+188054.829662     8248676.568202
+188069.371526     8248667.400082
+188086.416166     8248658.270381
+188106.558710     8248651.066811
+188124.773375     8248646.963331
+188144.986792     8248635.377760
+188162.646801     8248626.884207
+188178.440053     8248617.735297
+188191.659669     8248612.929202
+188205.606787     8248601.873377
+188225.850185     8248588.410456
+188244.176589     8248577.421855
+188256.165440     8248571.344994
+188269.959928     8248569.678938
+188289.344988     8248570.602449
+188300.475489     8248578.912784
+188316.137141     8248577.900563
+188331.555813     8248591.911687
+188362.223240     8248591.755752
+188374.282951     8248581.297655
+188381.347243     8248570.136173
+188394.536483     8248567.208188
+188409.985530     8248579.341202
+188428.068966     8248583.375182
+188440.229913     8248566.657740
+188445.477671     8248551.711987
+188458.626413     8248551.287892
+188481.766020     8248552.269038
+188493.582763     8248556.833521
+188505.933906     8248567.040405
+188517.073777     8248574.724183
+188527.538278     8248585.528807
+188539.273276     8248595.100295
+188550.988795     8248605.923359
+188560.191405     8248617.334549
+188572.643784     8248621.282088
+188572.410949     8248635.678122
+188560.290487     8248649.892438
+188549.462291     8248661.622078
+188539.259598     8248673.361320
+188528.309161     8248692.601856
+188527.954836     8248714.509562
+188527.056001     8248731.399885
+188526.187529     8248746.412864
+188529.718598     8248760.240740
+188543.997621     8248767.347533
+188562.364521     8248753.855042
+188579.056608     8248727.815808
+188601.964770     8248704.375743
+188619.090009     8248690.239019
+188635.631018     8248673.588050
+188653.956646     8248662.600202
+188673.433585     8248657.890162
+188689.135722     8248654.374815
+188702.294598     8248653.324174
+188717.371232     8248649.799225
+188744.213240     8248653.967655
+188769.128107     8248661.237716
+188792.751484     8248670.991699
+188813.912582     8248678.203373
+188843.862627     8248683.671387
+188873.137302     8248692.260248
+188890.523598     8248700.666614
+188906.104258     8248704.662174
+188920.948057     8248715.533259
+188933.924704     8248725.749745
+188955.035171     8248736.091855
+188979.284051     8248745.855440
+188996.115716     8248749.870205
+189014.753795     8248758.295022
+189028.992333     8248767.904942
+189041.989222     8248776.869864
+189058.154888     8248783.378917
+189080.536616     8248792.487903
+189109.801170     8248801.702546
+189130.871153     8248814.547782
+189153.212397     8248826.159895
+189171.123724     8248840.835220
+189194.070216     8248853.709262
+189219.458746     8248870.377178
+189243.677250     8248882.018872
+189264.767488     8248893.611781
+189279.005262     8248903.221689
+189290.781508     8248910.290063
+189309.348714     8248923.096880
+189332.346588     8248932.841261
+189362.881640     8248940.822769
+189378.442044     8248946.070656
+189401.460173     8248954.562711
+189416.374832     8248961.052560
+189436.233541     8248971.374690
+189460.462167     8248982.390603
+189478.424124     8248993.935491
+189491.360275     8249006.655867
+189505.618291     8249015.014212
+189523.691606     8249019.673973
+189541.734545     8249026.211844
+189559.131726     8249033.992440
+189576.568652     8249039.268369
+189601.503775     8249045.286103
+189619.546713     8249051.823973
+189636.327761     8249058.968410
+189649.365911     8249065.429453
+189663.623927     8249073.787798
+189675.379931     8249082.107735
+189693.341889     8249093.652623
+189713.765350     8249107.740573
+189731.626072     8249125.544805
+189744.552101     8249138.890964
+189758.003149     8249158.506844
+189769.637675     8249174.337689
+189786.882251     8249191.506526
+189798.618012     8249201.078027
+189812.907168     8249207.558274
+189828.528324     8249209.049944
+189846.046232     8249209.318856
+189860.517605     8249204.532741
+189882.496556     8249199.861109
+189903.758889     8249200.813437
+189916.836759     8249204.771343
+189929.914642     8249208.728484
+189951.065618     8249216.565939
+189965.364132     8249222.420393
+189977.140390     8249229.488002
+189992.004432     8249239.107524
+190004.375818     8249248.062844
+190016.757325     8249256.392383
+190029.835207     8249260.349524
+190043.508981     8249266.194388
+190064.669315     8249273.406050
+190092.056596     8249282.591875
+190115.186081     8249284.198803
+190131.432740     8249285.700074
+190155.176832     8249287.943138
+190173.875649     8249292.612502
+190186.944162     8249297.196200
+190199.991669     8249303.031450
+190218.690487     8249307.700814
+190232.363497     8249313.545666
+190248.529163     8249320.054719
+190262.152319     8249329.029255
+190281.980665     8249341.228730
+190296.854827     8249350.222470
+190319.155562     8249364.339238
+190337.732902     8249376.519509
+190350.689294     8249387.988322
+190362.414934     8249398.185604
+190377.238479     8249410.309016
+190390.255623     8249418.021611
+190408.258065     8249427.063373
+190428.167392     8249434.255831
+190439.974014     8249439.446095
+190452.477011     8249440.263962
+190471.851938     8249441.814019
+190484.971081     8249443.267281
+190499.330333     8249445.366281
+190512.408216     8249449.323422
+190533.640173     8249452.153860
+190550.513100     8249453.664745
+190563.005976     8249455.108394
+190580.402393     8249462.888978
+190602.097879     8249475.743816
+190619.414079     8249488.531430
+190634.842884     8249501.916007
+190647.102913     8249517.756454
+190667.445393     8249536.851421
+190684.115848     8249550.880996
+190697.082361     8249561.724028
+190714.459300     8249570.756187
+190733.702628     8249580.442934
+190746.689396     8249590.033638
+190760.311800     8249599.007398
+190770.816798     8249607.308131
+190785.650463     8249618.805762
+190807.254847     8249637.293399
+190823.268659     8249653.191469
+190838.152942     8249661.559428
+190849.908183     8249669.879353
+190871.583426     8249683.985755
+190885.872582     8249690.466002
+190898.879592     8249698.805143
+190914.440009     8249704.052266
+190925.519892     8249715.492274
+190940.454806     8249720.729796
+190954.631829     8249734.095922
+190975.025691     8249750.061229
+190987.204738     8249770.908693
+190995.812221     8249780.432172
+191004.368321     8249793.085311
+191012.965682     8249803.234572
+191020.907164     8249815.252340
+191030.644162     8249832.306695
+191037.252893     8249849.312264
+191042.630859     8249865.047067
+191049.057361     8249893.319762
+191056.857110     8249914.100765
+191064.020484     8249935.497173
+191079.246806     8249961.401204
+191093.969127     8249979.783196
+191106.672430     8250006.900371
+191117.509356     8250033.362195
+191125.429820     8250046.632278
+191130.222780     8250059.853588
+191134.399595     8250072.439503
+191147.627941     8250105.824872
+191155.962079     8250132.249040
+191160.602422     8250154.859355
+191164.769879     8250168.071063
+191172.710597     8250180.088819
+191179.965837     8250195.852439
+191187.805320     8250214.129540
+191191.972777     8250227.341247
+191199.630042     8250256.884710
+191203.564652     8250284.493217
+191204.582811     8250298.909219
+191211.090306     8250322.174133
+191215.085655     8250346.027185
+191216.103827     8250360.442424
+191219.966800     8250392.432918
+191224.607907     8250415.043245
+191224.929703     8250433.830881
+191227.804893     8250449.527264
+191229.165866     8250481.478586
+191222.050956     8250495.769740
+191208.698978     8250508.712513
+191194.268853     8250510.995512
+191178.546474     8250515.762423
+191165.245877     8250525.575535
+191153.720542     8250541.677561
+191157.897357     8250554.263476
+191174.729786     8250558.278252
+191194.205960     8250553.568200
+191209.292716     8250549.417469
+191222.492076     8250545.863702
+191234.288589     8250551.678984
+191242.865696     8250563.080572
+191250.170790     8250575.714508
+191250.583700     8250588.868581
+191240.451868     8250596.226587
+191227.878010     8250599.789956
+191213.345886     8250608.332289
+191198.733544     8250621.881651
+191192.889895     8250634.939681
+191200.225353     8250645.696272
+191214.474024     8250654.679646
+191238.269497     8250653.793049
+191252.527514     8250662.151394
+191258.551238     8250676.643470
+191258.923652     8250692.301434
+191262.374491     8250711.137103
+191262.101147     8250728.037792
+191243.774755     8250739.025628
+191229.938994     8250743.196328
+191224.519141     8250768.782661
+191224.911809     8250783.188297
+191242.410226     8250784.709549
+191254.811988     8250791.786760
+191262.702088     8250806.934188
+191266.253399     8250819.510501
+191277.394033     8250827.194290
+191306.143678     8250829.514193
+191328.667138     8250829.859944
+191340.101359     8250819.391481
+191350.858682     8250812.043840
+191370.961123     8250807.343402
+191387.258388     8250805.715766
+191404.685945     8250811.618253
+191414.564688     8250819.908608
+191419.296133     8250836.886124
+191394.774685     8250844.022476
+191380.949057     8250847.566629
+191370.746365     8250859.305871
+191366.154486     8250872.383117
+191377.284223     8250880.693440
+191394.238130     8250877.197308
+191413.866158     8250863.098239
+191427.004780     8250863.299926
+191451.405514     8250863.674495
+191466.441651     8250862.653436
+191480.557948     8250879.774252
+191485.290169     8250896.751016
+191492.534512     8250913.141170
+191496.661472     8250928.856768
+191496.408382     8250944.505130
+191477.557723     8250949.224019
+191461.290058     8250948.974299
+191443.751896     8250949.957715
+191419.915926     8250953.348202
+191400.984274     8250963.074873
+191385.846901     8250970.355277
+191374.494437     8250975.815970
+191358.731549     8250983.087536
+191342.363412     8250989.097172
+191332.170089     8251000.209857
+191328.163217     8251015.800595
+191337.910348     8251032.228404
+191362.936585     8251032.612575
+191381.202238     8251025.380192
+191400.698655     8251019.418577
+191421.467084     8251012.224614
+191434.040954     8251008.660482
+191457.311395     8251001.504926
+191474.285557     8250996.756467
+191493.196955     8250988.282123
+191511.422124     8250983.552868
+191525.085013     8250990.023501
+191531.703865     8251006.403289
+191519.623899     8251018.113714
+191502.792233     8251014.098950
+191488.432217     8251011.999938
+191474.556735     8251018.673775
+191468.682711     8251033.609915
+191462.768190     8251051.049945
+191458.771438     8251066.014902
+191472.364231     8251076.866783
+191484.068853     8251088.316380
+191491.394966     8251099.698001
+191499.224327     8251118.600883
+191501.463893     8251134.913446
+191512.875693     8251164.515308
+191517.597793     8251182.117853
+191529.261918     8251196.071341
+191535.972649     8251206.817578
+191545.215755     8251215.724877
+191557.617517     8251222.802089
+191571.381642     8251223.013378
+191574.752890     8251208.038819
+191575.056597     8251189.260785
+191575.259068     8251176.742095
+191570.445854     8251164.773113
+191565.210383     8251140.275087
+191562.920200     8251127.092196
+191558.732500     8251115.132052
+191558.380341     8251098.221761
+191558.582813     8251085.703071
+191560.672679     8251072.587418
+191577.091434     8251063.448109
+191590.926419     8251059.278162
+191606.084046     8251050.745431
+191616.266484     8251040.258517
+191626.459819     8251029.145068
+191643.453460     8251023.145034
+191656.612324     8251022.095158
+191673.515625     8251021.727934
+191688.297909     8251036.355225
+191696.269767     8251046.494884
+191699.709722     8251065.956323
+191703.180039     8251083.540417
+191702.896574     8251101.066888
+191702.542249     8251122.974594
+191702.844566     8251143.013805
+191711.198195     8251168.185634
+191716.606537     8251182.042327
+191728.271426     8251195.995827
+191737.484169     8251206.780472
+191754.962344     8251209.553286
+191768.736590     8251209.138794
+191770.816335     8251196.648922
+191771.099800     8251179.122451
+191770.131483     8251161.577529
+191769.123445     8251146.535745
+191767.509382     8251130.232784
+191767.792847     8251112.706313
+191768.630943     8251099.571444
+191782.557807     8251089.767946
+191802.760720     8251078.808151
+191817.847475     8251074.657420
+191831.702715     8251069.235146
+191845.609336     8251060.683211
+191861.422830     8251050.282738
+191874.158675     8251036.703806
+191884.936253     8251028.103838
+191899.589855     8251012.050597
+191909.177165     8250999.675972
+191919.944610     8250991.702550
+191934.990881     8250990.054945
+191947.493878     8250990.872812
+191961.065652     8251002.977009
+191968.401886     8251013.732847
+191973.204203     8251026.328364
+191977.250170     8251047.051744
+191982.001870     8251062.776933
+191986.804951     8251075.372461
+191995.825344     8251098.050013
+191999.941419     8251114.391381
+192002.846973     8251128.210419
+192002.472405     8251151.369689
+191987.194063     8251167.413340
+191968.958774     8251172.768377
+191955.759413     8251176.322144
+191935.031469     8251181.012980
+191914.939924     8251185.086884
+191901.104163     8251189.257583
+191874.110302     8251194.478170
+191858.377801     8251199.870863
+191847.024575     8251205.331544
+191834.995227     8251213.912297
+191819.786981     8251225.574700
+191817.576401     8251246.201273
+191834.962697     8251254.607639
+191848.727586     8251254.818940
+191868.284742     8251245.101871
+191884.652879     8251239.092234
+191902.212047     8251236.857267
+191922.273228     8251234.660708
+191935.432092     8251233.610832
+191952.487235     8251223.855355
+191967.563881     8251220.329642
+191988.361922     8251211.257558
+192000.935780     8251207.694189
+192022.914718     8251203.023321
+192041.160129     8251197.042502
+192059.344800     8251194.817137
+192074.350574     8251195.673423
+192088.033706     8251200.892494
+192103.533383     8251209.895072
+192117.257012     8251212.610251
+192129.770130     8251212.802336
+192142.354109     8251208.613186
+192152.638559     8251191.866174
+192167.190162     8251182.072266
+192181.772904     8251170.400261
+192196.890035     8251164.371421
+192207.133212     8251150.129053
+192219.172681     8251140.922519
+192232.463156     8251131.735189
+192245.713135     8251125.051749
+192261.384908     8251123.413747
+192273.918269     8251122.354269
+192288.004954     8251141.353205
+192295.560983     8251177.156013
+192299.708186     8251191.620048
+192306.337159     8251207.374054
+192312.996508     8251221.249952
+192326.416428     8251242.743165
+192334.276929     8251259.767950
+192338.382871     8251276.735865
+192344.376220     8251293.106051
+192353.224516     8251326.424183
+192358.521489     8251347.166767
+192363.848838     8251366.031241
+192368.408951     8251393.649350
+192372.322555     8251422.509408
+192378.164050     8251448.268611
+192382.815278     8251470.253156
+192386.224856     8251491.592704
+192389.735671     8251506.672907
+192394.397020     8251528.031671
+192398.462477     8251547.502712
+192398.865266     8251561.282566
+192399.904444     8251574.446253
+192400.297100     8251588.852653
+192403.172290     8251604.549036
+192404.775468     8251621.477767
+192409.196517     8251636.302325
+END
+LINE3D
+HEIGHT 1010.000000
+188325.171102     8246277.000000
+188325.176649     8246277.785358
+188324.660349     8246309.707863
+188324.133922     8246342.256532
+188322.599457     8246359.763417
+188321.659355     8246379.158001
+188316.360986     8246397.233045
+188311.626611     8246419.073514
+188310.707522     8246437.216165
+188305.943541     8246460.934373
+188301.178796     8246484.652570
+188292.802759     8246499.550302
+188283.689098     8246521.323546
+188272.658437     8246545.571494
+188258.549344     8246566.642118
+188247.095645     8246578.362156
+188236.882068     8246590.727168
+188225.962764     8246608.089989
+188215.790447     8246617.951122
+188205.557003     8246631.568085
+188192.114674     8246650.144432
+188181.174739     8246668.759192
+188170.901187     8246684.879670
+188160.001743     8246700.990922
+188149.031439     8246721.483409
+188140.049383     8246735.119582
+188130.522818     8246743.738372
+188118.463482     8246754.196857
+188101.368224     8246766.456230
+188092.436786     8246776.962730
+188082.889973     8246786.833465
+188073.898172     8246801.095808
+188064.229874     8246818.477833
+188057.094340     8246834.020544
+188053.117837     8246847.733556
+188042.854406     8246863.228252
+188030.118573     8246876.806419
+188020.571753     8246886.677536
+188011.045188     8246895.296325
+188001.478120     8246906.419388
+187991.840191     8246921.923686
+187987.197313     8246938.130598
+187996.399929     8246949.541406
+188015.774861     8246951.091081
+188032.819501     8246941.961380
+188049.864142     8246932.831679
+188065.001139     8246925.550888
+188080.764021     8246918.279704
+188097.173031     8246909.766565
+188118.637454     8246898.200198
+188142.625277     8246885.420694
+188162.868681     8246871.957391
+188179.943691     8246860.949963
+188195.787561     8246848.671380
+188214.759710     8246836.440818
+188243.732462     8246824.989710
+188273.299960     8246815.426306
+188293.503631     8246804.466906
+188311.839392     8246792.852512
+188330.841911     8246778.744223
+188347.907182     8246768.362583
+188360.491166     8246764.173050
+188385.740124     8246750.786586
+188398.364599     8246744.093545
+188412.260329     8246736.167762
+188430.617103     8246723.301435
+188454.493569     8246717.407056
+188468.883197     8246717.627947
+188485.776365     8246717.887269
+188513.304615     8246718.309847
+188531.347554     8246724.847718
+188546.262213     8246731.337567
+188556.786695     8246738.386343
+188567.947572     8246744.818569
+188580.389824     8246749.392272
+188595.314611     8246755.255957
+188610.249518     8246760.493861
+188638.191436     8246774.070906
+188651.208574     8246781.783883
+188659.816056     8246791.307362
+188671.439697     8246807.763977
+188684.315872     8246824.239819
+188692.851724     8246838.144904
+188702.003721     8246852.685384
+188715.515521     8246868.545047
+188733.426848     8246883.220371
+188753.255188     8246895.420228
+188767.544344     8246901.900476
+188776.777329     8246911.433556
+188797.200796     8246925.521125
+188810.278679     8246929.478266
+188835.193553     8246936.747944
+188852.702103     8246937.642650
+188879.605614     8246938.055638
+188897.749025     8246938.334152
+188910.262143     8246938.526237
+188925.257790     8246940.008687
+188945.823754     8246945.333031
+188971.323640     8246955.115821
+188996.208145     8246964.263226
+189022.374031     8246971.551727
+189035.503289     8246972.379589
+189050.498178     8246973.861645
+189067.229366     8246984.136148
+189080.256630     8246991.222962
+189089.469367     8247002.007988
+189101.830632     8247011.589090
+189113.586642     8247019.908645
+189133.404855     8247032.734666
+189147.017890     8247042.334984
+189162.002651     8247044.443203
+189182.639475     8247045.386312
+189201.480019     8247041.292822
+189212.379075     8247025.181947
+189219.474500     8247012.142750
+189224.712131     8246997.823160
+189226.287856     8246977.812396
+189230.284601     8246962.847822
+189243.423223     8246963.049509
+189258.922895     8246972.052468
+189275.784930     8246974.189506
+189297.047257     8246975.142216
+189315.221801     8246973.543015
+189327.734920     8246973.735100
+189345.879094     8246974.013626
+189360.834250     8246977.999585
+189375.778515     8246982.611695
+189383.730124     8246994.003299
+189395.969905     8247011.095692
+189403.830400     8247028.120859
+189404.192692     8247044.404604
+189403.959851     8247058.801020
+189401.708004     8247081.931855
+189400.173539     8247099.438740
+189399.748348     8247125.728064
+189401.381889     8247140.779450
+189409.252511     8247157.178453
+189417.224368     8247167.318112
+189427.011991     8247181.242412
+189446.224948     8247192.806886
+189460.473608     8247201.791024
+189472.986726     8247201.983109
+189492.260423     8247209.792129
+189516.337201     8247230.196677
+189536.639190     8247251.795153
+189552.703620     8247264.563551
+189566.952279     8247273.547689
+189578.123283     8247279.353751
+189591.776045     8247286.450548
+189616.660556     8247295.597572
+189639.032163     8247305.332340
+189659.466515     8247318.794138
+189679.345473     8247327.864323
+189707.226651     8247345.196822
+189727.671131     8247358.032456
+189745.693821     8247365.822272
+189758.186691     8247367.266303
+189783.071202     8247376.413326
+189803.565536     8247386.119277
+189818.500437     8247391.357563
+189831.618817     8247392.810813
+189845.948463     8247396.787552
+189868.390937     8247402.140702
+189892.700556     8247408.148834
+189912.004628     8247414.079744
+189932.570592     8247419.404089
+189953.720798     8247427.241914
+189980.512946     8247434.540410
+190002.350164     8247438.632013
+190018.556326     8247442.637176
+190036.024380     8247446.035772
+190051.534167     8247454.413332
+190069.506245     8247465.332438
+190082.543631     8247471.793470
+190096.771278     8247482.029542
+190115.985000     8247493.594027
+190132.089927     8247503.858534
+190143.866179     8247510.926526
+190155.016170     8247517.984522
+190165.531295     8247525.659091
+190172.816141     8247539.544972
+190183.188775     8247555.982383
+190203.390287     8247583.840598
+190231.360420     8247634.357149
+190253.478938     8247659.740279
+190257.656516     8247672.326205
+190275.990881     8247699.529439
+190285.203618     8247710.314465
+190291.873088     8247723.564580
+190300.308468     8247743.729022
+190304.414416     8247760.696554
+190315.281712     8247785.280650
+190331.769173     8247810.577340
+190344.563591     8247832.060951
+190351.233824     8247845.311079
+190361.626701     8247860.496926
+190368.901426     8247875.008589
+190375.571653     8247888.259099
+190384.713530     8247903.425360
+190391.362751     8247917.927421
+190401.593653     8247943.128068
+190417.990764     8247974.058332
+190426.970660     8247999.239774
+190434.164397     8248018.758836
+190450.076973     8248040.916251
+190458.008334     8248053.559801
+190471.539611     8248068.167888
+190481.377858     8248078.962134
+190491.872734     8248087.888649
+190510.338704     8248106.954811
+190525.585281     8248131.606514
+190538.389825     8248152.463963
+190546.997307     8248161.987442
+190557.440808     8248174.043235
+190577.188919     8248191.250885
+190590.125069     8248203.971262
+190599.337805     8248214.756288
+190612.858962     8248229.990157
+190623.282978     8248243.297908
+190630.598193     8248255.306062
+190640.355446     8248271.108089
+190650.173444     8248283.154281
+190662.463842     8248297.117001
+190680.273940     8248318.051288
+190698.073911     8248339.611738
+190715.884008     8248360.546025
+190733.744718     8248378.351022
+190748.456142     8248397.359549
+190766.296609     8248416.416108
+190785.377962     8248436.117654
+190805.105823     8248454.577250
+190819.919247     8248467.326443
+190834.742040     8248479.449080
+190851.412482     8248493.479419
+190872.421726     8248510.080109
+190893.399830     8248528.558897
+190909.444781     8248542.578870
+190925.509211     8248555.347268
+190939.131603     8248564.321792
+190950.928104     8248570.137838
+190965.176763     8248579.121976
+190983.784466     8248589.424903
+190997.931126     8248604.668374
+191006.992015     8248624.842035
+191020.896470     8248655.108098
+191034.367021     8248673.470875
+191049.251305     8248681.838833
+191062.217831     8248692.681101
+191081.471279     8248701.742066
+191101.996740     8248709.570683
+191118.162405     8248716.079736
+191132.431319     8248723.811547
+191147.870246     8248736.570343
+191168.293719     8248750.657529
+191188.163313     8248760.353889
+191205.549610     8248768.760255
+191219.243638     8248773.352791
+191234.743304     8248782.356133
+191246.529683     8248788.797961
+191263.209495     8248802.201742
+191279.939913     8248812.476615
+191299.738647     8248826.554211
+191311.484530     8248835.499930
+191323.855916     8248844.455251
+191337.498562     8248852.177448
+191349.244445     8248861.123166
+191363.472098     8248871.358856
+191373.321230     8248881.527332
+191381.282190     8248892.293525
+191392.967334     8248904.994697
+191407.851630     8248913.361891
+191416.367997     8248928.518934
+191423.077964     8248939.265158
+191425.902536     8248958.091214
+191425.619071     8248975.617685
+191420.985932     8248991.198809
+191418.886708     8249004.940256
+191418.562746     8249024.970618
+191422.073561     8249040.050821
+191436.927481     8249050.296124
+191453.285497     8249044.912270
+191455.446235     8249027.414616
+191461.562452     8248997.456649
+191466.144973     8248985.005197
+191467.669324     8248968.123711
+191472.282208     8248953.794914
+191484.947181     8248944.597982
+191499.417802     8248939.811091
+191521.315760     8248940.147240
+191533.828878     8248940.339326
+191561.973274     8248941.397299
+191579.471691     8248942.918550
+191604.477686     8248944.554284
+191621.944975     8248947.952868
+191636.325246     8248948.799552
+191666.326660     8248951.138671
+191684.389078     8248956.424966
+191697.467724     8248960.382119
+191714.279148     8248965.648446
+191737.892391     8248976.028976
+191751.454044     8248988.758954
+191768.154111     8249000.910408
+191780.434382     8249015.499292
+191795.832812     8249030.761978
+191812.462770     8249047.295443
+191833.573249     8249057.636789
+191850.344163     8249065.407772
+191873.977674     8249074.535209
+191890.072467     8249085.426262
+191906.894011     8249090.066808
+191918.690512     8249095.882854
+191941.092495     8249103.739513
+191954.756147     8249110.210159
+191985.311441     8249116.940103
+192010.135207     8249129.842962
+192032.487323     8249140.830069
+192046.180587     8249145.422594
+192056.069439     8249153.087932
+192080.994440     8249159.731447
+192107.827091     8249164.525670
+192128.382163     8249170.476167
+192149.593879     8249174.558168
+192188.283769     8249181.412984
+192228.870410     8249187.045042
+192248.204852     8249191.098225
+192273.069114     8249201.497194
+192285.460755     8249209.200188
+192303.442942     8249219.494276
+192328.337580     8249228.015136
+192348.297526     8249232.077922
+192370.023375     8249243.055415
+192393.656873     8249252.183617
+192419.802517     8249260.723681
+192437.946692     8249261.002207
+192456.090866     8249261.280732
+192480.511079     8249260.403726
+192500.603399     8249256.329069
+192517.505925     8249255.962598
+192541.372270     8249250.694001
+192562.745960     8249244.761204
+192584.169505     8249235.698722
+192608.086455     8249227.301217
+192628.875139     8249218.854927
+192649.067932     8249208.520914
+192668.625087     8249198.803845
+192688.849007     8249186.592499
+192712.805691     8249175.691092
+192733.685489     8249161.611238
+192743.222182     8249152.366285
+192752.173868     8249140.607839
+192762.386682     8249128.242816
+192772.034731     8249112.112736
+192786.687570     8249096.059484
+192802.673172     8249075.017665
+192816.620290     8249063.961840
+192831.202256     8249052.290587
+192852.555704     8249047.609353
+192867.581720     8249047.214076
+192888.228671     8249047.531021
+192911.306775     8249052.267609
+192939.380298     8249057.707582
+192971.903980     8249058.832781
+192999.997757     8249063.020426
+193019.302587     8249068.951731
+193037.981150     8249074.873421
+193057.295350     8249080.178168
+193082.220352     8249086.821683
+193111.615741     8249087.899624
+193127.257139     8249088.139731
+193143.524041     8249088.389439
+193160.417209     8249088.648761
+193176.684110     8249088.898470
+193200.459341     8249089.263436
+193224.859311     8249089.637993
+193248.009039     8249089.993357
+193266.707856     8249094.662721
+193288.524820     8249100.006651
+193316.618598     8249104.194297
+193350.948693     8249109.729548
+193383.391381     8249115.862528
+193412.060044     8249123.189448
+193440.729458     8249130.517143
+193476.946183     8249135.455419
+193505.716082     8249136.522994
+193530.005459     8249143.782689
+193552.468169     8249147.884658
+193578.009316     8249155.163568
+193611.057265     8249162.557713
+193635.992387     8249168.575446
+193657.204102     8249172.657447
+193677.780193     8249177.355628
+193696.489120     8249181.399974
+193720.192727     8249186.146164
+193745.137970     8249191.538116
+193764.472412     8249195.591300
+193776.924792     8249199.538839
+193793.121597     8249204.169795
+193813.091663     8249207.606799
+193839.985040     8249208.646332
+193867.503168     8249209.694692
+193887.433502     8249215.635598
+193901.752270     8249220.237725
+193922.771634     8249236.212633
+193941.359083     8249247.767887
+193978.029979     8249263.356357
+194012.076596     8249286.418843
+194034.458337     8249295.527065
+194056.860307     8249303.384488
+194078.051780     8249308.718053
+194104.269036     8249312.877657
+194125.469866     8249317.585428
+194146.641085     8249324.171319
+194160.960617     8249328.773458
+194179.044040     8249332.808202
+194193.988311     8249337.419930
+194213.989517     8249338.978837
+194232.738940     8249340.519292
+194258.390680     8249340.913064
+194274.677836     8249339.910445
+194293.508253     8249336.443119
+194312.984415     8249331.733831
+194344.893478     8249332.223657
+194372.431862     8249332.019690
+194391.888545     8249328.561977
+194416.935025     8249327.694584
+194446.966051     8249328.155581
+194477.623344     8249328.626192
+194504.455994     8249333.420416
+194526.252716     8249340.015909
+194542.458878     8249344.021072
+194557.454519     8249345.503904
+194578.019725     8249350.827854
+194594.842021     8249355.469176
+194612.269577     8249361.371663
+194636.517694     8249371.135237
+194650.827104     8249376.363157
+194672.038056     8249380.445146
+194686.418314     8249381.292594
+194704.571859     8249380.944563
+194718.972372     8249380.539684
+194731.566471     8249375.724752
+194733.019949     8249363.225266
+194733.283172     8249346.950359
+194714.283565     8249322.241808
+194705.827173     8249303.329300
+194701.670613     8249289.491058
+194700.036308     8249274.439660
+194700.400754     8249251.906172
+194701.906377     8249236.277038
+194704.641225     8249221.919411
+194706.195939     8249203.160581
+194710.183333     8249188.821417
+194718.620873     8249170.168243
+194725.795758     8249152.121624
+194730.397757     8249138.418596
+194737.452692     8249127.882908
+194748.998257     8249110.530082
+194756.122524     8249095.613135
+194763.248318     8249080.696211
+194772.280222     8249063.930736
+194780.707641     8249045.903344
+194790.315194     8249032.277155
+194800.457911     8249024.293379
+194808.228687     8249008.134482
+194809.763159     8248990.627215
+194815.658189     8248974.439524
+194817.111667     8248961.940038
+194836.576944     8248957.856520
+194850.957215     8248958.703205
+194865.337486     8248959.549889
+194887.831334     8248961.773761
+194907.165013     8248965.826933
+194925.249212     8248969.860924
+194942.060623     8248975.128016
+194955.198481     8248975.329691
+194970.850012     8248974.943252
+194990.892466     8248973.999043
+195007.158604     8248974.248740
+195017.000000     8248976.963678
+END
+LINE3D
+HEIGHT 1010.000000
+195017.000000     8249037.008800
+195011.151799     8249036.919026
+194998.426088     8249049.871412
+194996.901737     8249066.752897
+195009.202263     8249080.089453
+195017.000000     8249086.533439
+END
+LINE3D
+HEIGHT 1010.000000
+195017.000000     8252434.473920
+194999.895687     8252441.423277
+194967.774031     8252454.077922
+194921.869536     8252467.772864
+194886.074314     8252475.362856
+194867.870165     8252478.839796
+194849.716633     8252479.187064
+194834.618980     8252483.964329
+194810.067156     8252492.978789
+194784.970059     8252496.975855
+194770.488553     8252502.388515
+194752.747155     8252515.890608
+194740.718583     8252524.470608
+194718.587779     8252538.531257
+194685.083505     8252559.304152
+194632.215190     8252577.901219
+194597.561145     8252592.395565
+194575.602449     8252595.814870
+194547.326454     8252602.893587
+194509.593984     8252614.210227
+194479.309868     8252629.397592
+194450.296238     8252643.352585
+194431.960476     8252654.966979
+194405.550870     8252662.700282
+194385.983581     8252673.043897
+194368.262438     8252685.293663
+194347.322676     8252703.128218
+194328.905158     8252719.750381
+194314.292052     8252733.299731
+194302.828232     8252745.645551
+194290.041770     8252762.354155
+194276.003549     8252779.042779
+194253.569037     8252811.881463
+194231.195277     8252840.963928
+194215.957431     8252854.503688
+194198.216034     8252868.005781
+194177.962515     8252882.094484
+194158.414716     8252891.185759
+194144.004834     8252892.217196
+194119.604100     8252891.842628
+194103.337199     8252891.592919
+194078.936465     8252891.218351
+194062.104799     8252887.203587
+194035.332900     8252878.653145
+194022.214521     8252877.199895
+194012.366166     8252867.030666
+194003.910537     8252848.118170
+193994.819272     8252829.822618
+193987.019523     8252809.041615
+193986.616734     8252795.261760
+193981.370378     8252771.389504
+193971.007865     8252754.326311
+193954.266550     8252744.677972
+193939.372909     8252736.935807
+193912.773106     8252717.744785
+193885.659157     8252691.659035
+193875.266280     8252676.473188
+193862.340251     8252663.127029
+193849.312223     8252656.040204
+193833.217429     8252645.149152
+193818.211656     8252644.292865
+193796.384558     8252639.575481
+193763.962112     8252632.190938
+193745.888810     8252627.530412
+193724.000974     8252626.568481
+193708.359576     8252626.328375
+193692.728299     8252625.462487
+193680.215180     8252625.270402
+193657.056095     8252625.540831
+193630.031107     8252632.638751
+193609.253308     8252640.459271
+193593.490432     8252647.730073
+193580.178938     8252658.169718
+193566.313578     8252664.217774
+193544.858906     8252675.157589
+193516.562657     8252683.488633
+193493.261840     8252692.522297
+193476.257314     8252699.148101
+193461.151068     8252704.551172
+193455.337783     8252715.731857
+193454.449069     8252731.996399
+193454.216222     8252746.393197
+193453.872030     8252767.674358
+193458.583233     8252785.903437
+193462.770932     8252797.863582
+193467.583371     8252809.833317
+193475.383133     8252830.613556
+193483.161876     8252852.646110
+193487.329321     8252865.858582
+193493.998791     8252879.108698
+193498.165484     8252892.320394
+193497.952892     8252905.464865
+193493.219280     8252927.305346
+193492.381184     8252940.440216
+193486.527402     8252954.124792
+193481.955766     8252965.950474
+193476.122238     8252978.382723
+193468.330456     8252995.793172
+193464.313463     8253012.009692
+193457.722820     8253032.569792
+193453.766566     8253045.030859
+193449.769815     8253059.995816
+193444.521293     8253074.941557
+193440.565039     8253087.402623
+193435.326651     8253101.721819
+193430.694276     8253117.302955
+193425.425512     8253133.500260
+193418.905730     8253149.679125
+193408.551196     8253170.806620
+193398.650045     8253202.585825
+193386.902772     8253232.457352
+193375.921959     8253253.575997
+193370.694456     8253267.269423
+193365.486431     8253279.711273
+193353.920612     8253298.316426
+193345.554696     8253312.588376
+193331.506342     8253329.903546
+193319.406898     8253342.865546
+193310.465345     8253353.997446
+193294.026335     8253364.389082
+193283.258127     8253372.362492
+193266.859614     8253380.250238
+193256.071916     8253389.475987
+193247.140484     8253399.982106
+193243.174096     8253413.069718
+193242.335236     8253426.204575
+193246.492572     8253440.042064
+193263.172384     8253453.445846
+193276.169273     8253462.410768
+193292.254709     8253473.927614
+193304.009962     8253482.246776
+193317.562245     8253495.603311
+193336.018095     8253515.295255
+193354.403084     8253539.368434
+193369.639539     8253564.645919
+193385.653351     8253580.543989
+193399.204870     8253593.900513
+193413.998052     8253607.901271
+193428.094857     8253626.274426
+193448.265241     8253656.009974
+193464.601613     8253690.695691
+193480.453450     8253716.608560
+193499.524669     8253736.936651
+193524.196581     8253759.228528
+193546.991983     8253781.491599
+193563.519941     8253804.284398
+193579.341403     8253832.075375
+193600.925532     8253851.815340
+193620.714132     8253866.519482
+193641.147727     8253879.980886
+193666.576753     8253894.144911
+193685.689233     8253911.969123
+193696.687371     8253928.416136
+193703.316344     8253944.170143
+193709.935959     8253960.549942
+193720.944218     8253976.371174
+193738.825182     8253992.923843
+193761.700802     8254010.179885
+193789.420012     8254037.526800
+193806.412250     8254070.344775
+193821.770196     8254088.110588
+193839.681523     8254102.785912
+193860.771748     8254114.379585
+193883.748616     8254125.375519
+193908.673617     8254132.019034
+193934.203879     8254139.923714
+193955.334601     8254149.013496
+193979.532863     8254161.906754
+194004.316132     8254177.313505
+194032.832941     8254194.029441
+194050.169383     8254205.565491
+194068.160941     8254215.233023
+194081.834715     8254221.077886
+194098.091495     8254221.953376
+194118.102058     8254222.886489
+194136.810997     8254226.930071
+194162.342010     8254234.835527
+194183.522599     8254240.794862
+194200.889416     8254250.452803
+194222.050501     8254257.665240
+194236.207294     8254272.282165
+194251.706960     8254281.285507
+194257.155787     8254292.639074
+194261.837390     8254312.745510
+194260.918301     8254330.888161
+194244.306431     8254351.920365
+194232.267726     8254361.126911
+194215.232838     8254369.630060
+194201.256108     8254382.564006
+194200.932158     8254402.593604
+194206.259507     8254421.458078
+194210.284468     8254443.433010
+194213.835779     8254456.009323
+194223.663892     8254467.430115
+194239.133194     8254478.310801
+194261.465068     8254490.549472
+194261.211978     8254506.197833
+194252.541603     8254539.247042
+194241.308465     8254576.014061
+194235.474937     8254588.446309
+194218.884074     8254608.226963
+194206.107745     8254624.309021
+194187.619366     8254645.312420
+194173.520406     8254665.756498
+194158.573982     8254699.962003
+194141.296112     8254723.488497
+194130.356560     8254742.103263
+194107.377538     8254769.924563
+194092.068057     8254787.846311
+194081.794504     8254803.966789
+194077.080384     8254824.554931
+194063.113787     8254836.862332
+194049.782803     8254848.554316
+194031.405805     8254862.671061
+194005.994867     8254886.072706
+193985.518622     8254913.932426
+193967.797479     8254926.182191
+193948.805088     8254939.664316
+193938.632758     8254949.526213
+193929.681085     8254961.283895
+193909.508547     8254970.365580
+193867.769192     8254997.273724
+193831.600931     8255028.023009
+193801.194574     8255050.721270
+193781.242596     8255084.849936
+193753.247888     8255113.220943
+193718.381251     8255140.859760
+193699.731661     8255171.877970
+193685.612447     8255193.574375
+193672.099258     8255216.531958
+193659.796590     8255242.011871
+193644.991886     8255267.454905
+193628.157290     8255302.258126
+193613.393095     8255325.196505
+193598.245588     8255333.103454
+193585.509756     8255346.681622
+193567.193486     8255357.043677
+193552.086488     8255362.445971
+193538.836497     8255369.130174
+193514.364903     8255373.136842
+193482.304750     8255382.036044
+193460.860200     8255392.350077
+193429.354665     8255405.641645
+193409.676044     8255422.868858
+193393.984028     8255425.758424
+193368.866663     8255431.008581
+193350.096986     8255430.720453
+193336.353103     8255429.257601
+193309.520477     8255424.461849
+193290.760908     8255423.548706
+193278.308541     8255419.600401
+193262.041640     8255419.350692
+193240.153791     8255418.389526
+193225.763399     8255418.168623
+193212.564051     8255421.721626
+193194.510979     8255415.810301
+193178.355447     8255408.674703
+193165.358545     8255399.710544
+193151.079523     8255392.603751
+193138.738500     8255381.771086
+193103.782914     8255376.225468
+193078.131174     8255375.831696
+193064.356916     8255376.246953
+193042.266620     8255387.802947
+193025.150738     8255401.313878
+193004.362806     8255409.760944
+192971.030640     8255419.892494
+192948.264224     8255434.568559
+192928.040304     8255446.779905
+192917.888217     8255455.390239
+192903.286009     8255468.313055
+192873.727868     8255477.250665
+192848.499160     8255489.385184
+192832.070271     8255499.151039
+192818.174535     8255507.077203
+192793.097680     8255509.822705
+192774.267275     8255513.289268
+192767.212329     8255523.825720
+192762.529335     8255542.536529
+192765.999678     8255560.119095
+192775.807548     8255572.791450
+192786.917807     8255582.353348
+192808.058649     8255590.817349
+192820.480641     8255596.643761
+192834.789300     8255601.870906
+192845.274055     8255611.423202
+192847.564227     8255624.606857
+192838.974833     8255652.649048
+192821.576250     8255683.686461
+192806.236405     8255703.485554
+192793.277834     8255730.835502
+192769.632061     8255761.150315
+192752.415707     8255780.920603
+192737.772226     8255796.348062
+192728.043171     8255817.486687
+192716.528733     8255832.962179
+192707.536574     8255847.222987
+192707.303727     8255861.619786
+192703.124759     8255887.851105
+192688.066201     8255928.942488
+192674.965910     8255965.054908
+192667.225497     8255979.336460
+192648.676379     8256004.095313
+192627.664994     8256026.311092
+192608.480240     8256051.686889
+192595.663414     8256070.272838
+192575.298538     8256091.246667
+192554.862777     8256116.603260
+192531.267622     8256143.788401
+192511.991765     8256174.796996
+192491.302915     8256215.801951
+192451.904375     8256252.762548
+192423.213303     8256285.505189
+192409.619121     8256313.470553
+192404.885509     8256335.311035
+192398.294892     8256355.869607
+192385.457799     8256375.708648
+192370.006610     8256402.392103
+192345.340499     8256457.109675
+192318.303987     8256503.651386
+192299.684009     8256532.791475
+192284.717318     8256568.250071
+192266.813970     8256591.765435
+192260.344806     8256604.814627
+192248.345821     8256611.518035
+192230.625442     8256623.767812
+192214.741088     8256638.549521
+192199.512587     8256651.464252
+192180.882501     8256681.229358
+192165.289542     8256716.678341
+192151.928207     8256730.246907
+192137.991986     8256740.676198
+192118.494805     8256746.637801
+192083.306372     8256755.488982
+192078.023025     8256785.514335
+END
+LINE3D-MASTER
+HEIGHT 1000.000000
+191770.932099     8248364.845893
+191795.857100     8248371.489408
+191810.852741     8248372.972240
+191830.318794     8248368.887970
+191853.548745     8248364.235923
+191871.067417     8248364.504847
+191884.841663     8248364.090354
+191896.800144     8248359.891220
+191909.374002     8248356.327851
+191931.271959     8248356.664000
+191946.287854     8248356.894505
+191964.442156     8248356.546867
+191978.852033     8248355.515812
+191997.621710     8248355.803940
+192011.396720     8248355.389459
+192029.480156     8248359.423439
+192039.994517     8248367.097997
+192059.359328     8248369.273453
+192074.950109     8248372.643232
+192091.217010     8248372.892940
+192103.730129     8248373.085025
+192118.120520     8248373.305928
+192133.085797     8248376.666105
+192146.102929     8248384.379464
+192161.602607     8248393.382042
+192180.129316     8248408.692750
+192195.124957     8248410.175582
+192213.208392     8248414.209561
+192230.726300     8248414.478474
+192252.806487     8248403.547496
+192262.363422     8248393.050980
+192272.515496     8248384.441410
+192286.563844     8248367.126622
+192291.771105     8248354.684760
+192305.890318     8248332.988354
+192314.256228     8248318.716786
+192325.054818     8248308.864885
+192335.862766     8248298.387190
+192343.533070     8248288.487649
+192354.895654     8248282.401174
+192370.719275     8248271.374537
+192376.028536     8248252.673341
+192377.542759     8248236.418020
+192379.027370     8248222.040819
+192379.260211     8248207.644403
+192375.708136     8248195.068078
+192360.976464     8248177.311497
+192349.250829     8248167.113833
+192333.176272     8248154.971599
+192318.937734     8248145.361679
+192308.453743     8248135.809394
+192303.025158     8248123.204264
+192291.289396     8248113.632764
+192284.014672     8248099.121101
+192274.276904     8248082.067116
+192274.540121     8248065.792591
+192316.107263     8247856.064631
+192323.776804     8247846.165079
+192332.758859     8247832.528906
+192340.458775     8247820.751245
+192351.862614     8247812.161273
+192375.102692     8247806.883062
+192387.061174     8247802.683928
+192402.097317     8247801.662487
+192420.877116     8247801.324833
+192437.133897     8247802.200323
+192460.828134     8247807.573071
+192486.419135     8247811.722297
+192514.442046     8247820.291560
+192533.715743     8247828.100580
+192547.944160     8247838.336281
+192566.511367     8247851.143099
+192589.498349     8247861.513632
+192609.973198     8247872.471540
+192634.817212     8247884.122454
+192652.667043     8247902.552839
+192671.779523     8247920.377051
+192685.956558     8247933.742413
+192702.687751     8247944.016533
+192718.782551     8247954.907204
+192745.492947     8247967.213088
+192761.649255     8247974.347934
+192777.804793     8247981.483151
+192795.150605     8247992.392644
+192819.429855     8248000.278502
+192839.441176     8248001.212009
+192863.841146     8248001.586566
+192882.610823     8248001.874693
+192905.124927     8248002.846238
+192925.155732     8248002.527787
+192943.945658     8248001.563970
+192965.278858     8247998.134681
+192982.857504     8247994.648139
+193006.693474     8247991.257652
+193024.272891     8247987.770739
+193046.191097     8247986.854943
+193060.600967     8247985.824271
+193079.390893     8247984.860453
+193110.048186     8247985.331064
+193137.577200     8247985.753654
+193163.228940     8247986.147426
+193181.312376     8247990.181406
+193196.943646     8247991.047676
+193211.323153     8247991.894348
+193230.032092     8247995.937930
+193258.075246     8248003.255630
+193286.764921     8248009.330616
+193312.335668     8248014.732170
+193334.162765     8248019.449555
+193367.867344     8248024.975968
+193399.028663     8248032.967089
+193430.815478     8248040.968194
+193473.803666     8248052.897634
+193514.228333     8248068.544491
+193538.486571     8248077.682283
+193554.673249     8248082.939402
+193571.494787     8248087.580330
+193587.126064     8248088.446218
+193600.224189     8248091.151796
+193620.810401     8248095.224195
+193644.524129     8248099.344604
+193659.469158     8248103.956726
+193679.944007     8248114.914634
+193693.021889     8248118.871775
+193720.973934     8248131.822656
+193740.923752     8248136.511605
+193755.939647     8248136.742110
+193780.965884     8248137.126280
+193797.313773     8248132.368589
+193812.955171     8248132.608695
+193830.494091     8248131.625674
+193846.771114     8248131.249601
+193864.289785     8248131.518525
+193888.135118     8248127.501862
+193915.664132     8248127.924451
+193939.500102     8248124.533964
+193962.084307     8248121.123879
+193983.427628     8248117.068808
+194009.775731     8248113.090946
+194029.262027     8248107.755113
+194041.795394     8248106.695253
+194055.096754     8248096.882153
+194062.847288     8248081.974819
+194067.439167     8248068.897573
+194075.815968     8248053.999853
+194084.233259     8248036.598624
+194088.855514     8248021.643269
+194096.727526     8247999.225028
+194097.647379     8247981.082389
+194097.991577     8247959.800846
+194098.305411     8247940.396648
+194092.494286     8247912.759718
+194082.120894     8247896.321914
+194071.031641     8247885.508464
+194059.235141     8247879.692417
+194045.541118     8247875.099499
+194025.056906     8247864.767767
+194005.742712     8247859.462638
+193987.709900     8247852.298604
+193968.486822     8247841.359912
+193942.411286     8247828.437836
+193923.945316     8247809.371674
+193911.766274     8247788.523828
+193900.111500     8247773.944929
+193884.057191     8247760.550749
+193856.105146     8247747.599868
+193834.450157     8247732.241139
+193817.780472     8247718.211194
+193803.643170     8247702.341930
+193788.870237     8247687.089227
+193777.266851     8247669.380285
+193765.622197     8247654.175604
+193753.291302     8247642.716774
+193740.980655     8247630.006000
+193730.495900     8247620.453703
+193720.617169     8247612.162584
+193704.562860     8247598.768404
+193688.640163     8247577.236771
+193672.020327     8247560.077524
+193653.574605     8247539.759417
+193637.016277     8247518.844346
+193613.504263     8247502.204854
+193597.520821     8247484.429057
+193584.615040     8247469.830953
+193569.862362     8247453.325923
+193557.703568     8247431.226132
+193546.786418     8247409.771719
+193538.925923     8247392.746552
+193529.118053     8247380.074197
+193518.673794     8247368.018010
+193497.059296     8247350.155772
+193484.072528     8247340.565068
+193467.362346     8247329.039014
+193450.147382     8247309.992056
+193433.558685     8247290.954711
+193421.954529     8247273.246139
+193409.028506     8247259.899599
+193394.911446     8247242.778772
+193376.425233     8247224.964173
+193362.258319     8247210.973029
+193347.556259     8247191.338327
+193337.839497     8247173.032791
+193330.665250     8247152.261390
+193320.312864     8247134.572033
+193312.482739     8247115.669139
+193302.130352     8247097.979783
+193290.516075     8247080.896992
+193278.982785     8247058.806803
+193266.259227     8247032.941955
+193249.034142     8247014.520779
+193233.736942     8246992.999130
+193217.158372     8246973.335622
+193202.980573     8246959.970248
+193197.562880     8246946.738966
+193180.358037     8246927.066226
+193167.502874     8246909.338450
+193152.246170     8246885.312911
+193135.616219     8246868.779063
+193120.763062     8246858.533772
+193107.220894     8246844.551836
+193088.754923     8246825.485674
+193069.703946     8246803.906020
+193055.042377     8246781.767809
+193044.003742     8246767.824687
+193034.225484     8246753.274211
+193018.908035     8246733.004507
+192997.919810     8246715.151501
+192981.884986     8246700.505364
+192967.728199     8246685.888057
+192952.350011     8246669.373807
+192937.759308     8246642.853978
+192925.539775     8246624.509641
+192913.269619     8246609.295358
+192900.343596     8246595.948818
+192884.289287     8246582.554638
+192870.121616     8246568.563101
+192856.004562     8246551.441891
+192844.451787     8246530.603658
+192837.872668     8246511.719968
+192829.397555     8246494.059429
+192818.429029     8246475.734295
+192809.973401     8246456.821799
+192800.912518     8246436.647756
+192792.487259     8246415.857533
+192784.749006     8246391.321470
+192775.092989     8246369.260097
+192763.509081     8246350.299580
+192754.962344     8246337.020265
+192750.149135     8246325.050901
+192739.766380     8246309.239271
+192730.705497     8246289.065228
+192725.509429     8246277.000000
+END
+LINE3D-MASTER
+HEIGHT 1000.000000
+193863.147324     8246277.000000
+193868.502602     8246284.618066
+193876.433200     8246297.261604
+193884.949573     8246312.418264
+193895.968717     8246327.613725
+193904.504569     8246341.518810
+193911.668700     8246362.915611
+193915.855636     8246374.875744
+193921.142488     8246396.244109
+193930.909868     8246411.419973
+193938.104362     8246430.939429
+193952.795544     8246451.199519
+193963.804567     8246467.020762
+193981.614658     8246487.955431
+194001.341762     8246506.414633
+194019.746988     8246529.236631
+194033.894417     8246544.479732
+194043.086906     8246556.516703
+194054.125534     8246570.460208
+194071.431613     8246583.873603
+194083.843496     8246590.325032
+194098.031416     8246603.064624
+194133.278434     8246629.275223
+194164.680555     8246661.061761
+194181.966379     8246675.727483
+194194.953147     8246685.318188
+194206.073533     8246694.253922
+194219.635186     8246706.983901
+194240.150532     8246715.437917
+194260.100350     8246720.126867
+194281.866702     8246728.600087
+194295.559960     8246733.192994
+194308.002213     8246737.766697
+194320.959375     8246749.235140
+194334.510901     8246762.591282
+194346.256790     8246771.536618
+194359.243558     8246781.127323
+194387.831227     8246793.462024
+194407.135300     8246799.392934
+194422.746322     8246801.511150
+194444.725273     8246796.839518
+194461.628563     8246796.473058
+194479.833476     8246792.996130
+194512.478642     8246786.610038
+194535.698472     8246782.583773
+194551.976258     8246782.207711
+194572.784421     8246772.509846
+194591.726200     8246762.157012
+194603.694803     8246757.332095
+194623.170978     8246752.622044
+194645.836165     8246744.204941
+194660.873072     8246743.183512
+194676.060305     8246732.773043
+194689.230060     8246731.097014
+194703.710039     8246725.684330
+194716.940533     8246720.252848
+194743.379757     8246710.641042
+194755.963736     8246706.451891
+194771.051261     8246702.300790
+194784.199246     8246701.876301
+194801.152390     8246698.380158
+194819.236589     8246702.414149
+194832.303581     8246706.997442
+194845.392349     8246710.328813
+194865.978554     8246714.401594
+194891.568792     8246718.550809
+194910.247355     8246724.472500
+194928.915797     8246731.019972
+194946.969627     8246736.931691
+194964.407311     8246742.208014
+194985.608135     8246746.916167
+195006.808960     8246751.624320
+195017.000000     8246753.760645
+END
+LINE3D-MASTER
+HEIGHT 1000.000000
+195017.000000     8255986.006361
+195009.298154     8256000.261844
+194999.096213     8256012.001862
+194989.498793     8256025.001505
+194976.045567     8256044.204386
+194960.019468     8256067.750095
+194937.574847     8256101.213796
+194919.610748     8256128.485378
+194907.521425     8256140.821596
+194902.878916     8256157.029278
+194887.004671     8256171.185970
+194872.884693     8256192.882364
+194846.879391     8256214.396310
+194829.107630     8256229.775748
+194815.141034     8256242.083148
+194803.767577     8256248.794629
+194792.414338     8256254.256075
+194781.010505     8256262.845665
+194766.439412     8256273.891912
+194742.481952     8256284.794072
+194707.838028     8256298.662636
+194678.753537     8256316.998865
+194650.366198     8256330.961943
+194618.799937     8256348.008201
+194575.829843     8256373.644049
+194547.452588     8256386.983639
+194526.584450     8256400.436970
+194502.586506     8256413.842256
+194480.445592     8256428.527923
+194456.356521     8256447.567536
+194430.461824     8256462.195580
+194414.043069     8256471.334889
+194402.608837     8256481.804116
+194391.205004     8256490.393706
+194379.791802     8256499.609853
+194368.962855     8256511.338718
+194348.739699     8256523.550075
+194328.425416     8256541.395760
+194306.808770     8256562.350374
+194287.775870     8256578.337154
+194275.029904     8256592.541867
+194256.673149     8256605.407048
+194228.921422     8256618.754711
+194211.251660     8256627.874816
+194197.355160     8256635.800969
+194183.530284     8256639.345898
+194170.824827     8256651.045957
+194152.437672     8256665.790775
+194135.958190     8256678.684774
+194113.837519     8256692.118878
+194098.619152     8256704.407062
+194076.589584     8256712.208367
+194060.867192     8256716.976042
+194048.908716     8256721.174794
+194021.833874     8256731.402399
+194002.962960     8256737.373616
+193982.860519     8256742.074054
+193960.891701     8256746.119141
+193933.281694     8256750.704332
+193898.164121     8256755.174278
+193876.830916     8256758.603949
+193859.867651     8256762.725874
+193826.011218     8256766.588477
+193806.595795     8256767.542311
+193780.257800     8256770.895155
+193763.243154     8256778.146741
+193742.455246     8256786.592279
+193729.810516     8256794.537648
+193714.663010     8256802.444597
+193698.890000     8256810.341944
+193689.353308     8256819.586897
+193671.006661     8256831.827061
+193656.454307     8256841.620193
+193636.907273     8256850.711480
+193616.078856     8256861.661673
+193587.014607     8256878.746338
+193556.145473     8256891.420974
+193537.859578     8256899.904920
+193524.619720     8256905.962578
+193511.985124     8256913.281400
+193501.206770     8256921.882120
+193479.258194     8256924.675644
+193454.140855     8256929.924272
+193435.976438     8256930.897310
+193423.463320     8256930.705225
+193410.334807     8256929.878520
+193387.811346     8256929.532769
+193369.667171     8256929.254243
+193352.764658     8256929.619951
+193335.185235     8256933.107245
+193315.113933     8256935.929586
+193289.452084     8256936.160831
+193276.181087     8256944.096586
+193259.914186     8256943.846878
+193242.315285     8256948.585747
+193229.115148     8256952.140266
+193205.945942     8256953.036477
+193188.992811     8256956.531856
+193176.348081     8256964.477225
+193163.743835     8256969.919467
+193158.962766     8256986.091834
+193153.438372     8257015.742421
+END
+LINE3D-MASTER
+HEIGHT 1000.000000
+191766.552813     8248364.778668
+191746.199442     8248346.309852
+191729.388025     8248341.043143
+191704.432654     8248336.277355
+191687.065836     8248326.619414
+191675.935329     8248318.309461
+191661.697555     8248308.699553
+191644.885380     8248303.432449
+191631.767001     8248301.979199
+191610.000655     8248293.505596
+191596.246651     8248292.668526
+191583.794271     8248288.720986
+191562.714168     8248276.501532
+191545.418216     8248262.461973
+191531.886932     8248247.854268
+191517.779999     8248230.107276
+191506.802110     8248212.408318
+191501.393774     8248198.551242
+191497.277705     8248182.209492
+191493.110248     8248168.997784
+191489.558936     8248156.421471
+191481.164047     8248133.753521
+191477.078347     8248115.534044
+191462.477517     8248089.640379
+191452.115009     8248072.576804
+191437.311713     8248059.201446
+191425.616442     8248047.126437
+191416.525189     8248028.830121
+191403.771262     8248004.843001
+191396.526144     8247988.453599
+191382.974617     8247975.097457
+191371.854232     8247966.161722
+191349.523122     8247953.923064
+191333.993080     8247946.797831
+191317.353765     8247930.890159
+191298.211674     8247914.944068
+191280.290219     8247900.894907
+191268.483591     8247895.705024
+191255.436084     8247889.869774
+191241.742062     8247885.276856
+191223.598651     8247884.998342
+191201.074426     8247884.652579
+191187.249556     8247888.197126
+191170.235674     8247895.448724
+191150.819481     8247896.402928
+191134.532331     8247897.405165
+191113.290246     8247895.200891
+191099.153708     8247879.331638
+191098.165154     8247863.037897
+191094.613843     8247850.461585
+191094.190811     8247837.933293
+191088.812845     8247822.198491
+191088.420183     8247807.792473
+191081.246694     8247787.021465
+191071.731646     8247756.196846
+191059.694331     8247726.586146
+191054.317128     8247710.851355
+191042.107717     8247691.881236
+191032.955725     8247677.340374
+191028.294370     8247655.981992
+191026.054810     8247639.669048
+191021.938735     8247623.327679
+191017.247011     8247603.847025
+191012.505438     8247587.495672
+191006.704440     8247559.232578
+191006.381880     8247540.444931
+191002.972295     8247519.105765
+190999.532347     8247499.643944
+190994.739387     8247486.422634
+190994.972228     8247472.026218
+190995.275936     8247453.248183
+190995.620140     8247431.966259
+190995.913726     8247413.814006
+190996.116198     8247401.295317
+190997.106911     8247378.771442
+190994.535428     8247344.297025
+190993.546869     8247328.003666
+190985.121616     8247307.213061
+190972.871708     8247290.746833
+190960.642048     8247273.028659
+190956.505731     8247257.938853
+190952.339037     8247244.727157
+190948.797090     8247231.524669
+190944.650645     8247217.061028
+190939.292927     8247200.074280
+190926.518751     8247177.339105
+190920.535530     8247160.342755
+190910.768150     8247145.166891
+190904.088559     8247132.542557
+190895.027676     8247112.368514
+190884.654284     8247095.930709
+190879.882336     8247081.457466
+190865.785524     8247063.084693
+190861.073557     8247044.855602
+190854.393966     8247032.231268
+190842.204803     8247012.009203
+190821.296796     8246989.149168
+190807.059021     8246979.539260
+190791.599846     8246968.032410
+190769.904360     8246955.177571
+190746.896365     8246946.058971
+190726.402032     8246936.353021
+190713.465882     8246923.632644
+190698.006707     8246912.125794
+190675.765941     8246894.253942
+190657.310098     8246874.561617
+190638.712522     8246863.632527
+190614.474527     8246853.243171
+190591.496902     8246842.246844
+190569.760919     8246831.895897
+190557.318667     8246827.322194
+190541.122632     8246822.690868
+190526.268711     8246812.445565
+190508.902657     8246802.787635
+190498.448272     8246791.357612
+190484.311733     8246775.488359
+190467.117017     8246755.189456
+190451.103205     8246739.291386
+190437.500298     8246729.064904
+190425.704555     8246723.249252
+190410.265628     8246710.490456
+190400.426624     8246699.695816
+190379.397902     8246684.346701
+190356.501264     8246668.342974
+190336.128408     8246651.126116
+190320.740100     8246635.237648
+190305.382167     8246617.471070
+190291.789374     8246606.619189
+190278.106243     8246601.400119
+190261.334552     8246593.629889
+190247.651421     8246588.410819
+190229.053839     8246577.482111
+190229.256311     8246564.963421
+190225.089623     8246551.751343
+190220.912045     8246539.165417
+190207.360513     8246525.809657
+190190.578708     8246518.664826
+190169.881903     8246521.477565
+190144.713933     8246529.856630
+190127.104147     8246535.221270
+190107.658348     8246538.053212
+190087.637664     8246537.745881
+190062.611427     8246537.361710
+190038.210693     8246536.987142
+190013.890953     8246531.604792
+189988.239212     8246531.211020
+189966.906013     8246534.640309
+189950.618863     8246535.642546
+189938.055127     8246538.580133
+189909.839871     8246541.903396
+189887.316410     8246541.557645
+189858.525506     8246541.741621
+189836.002045     8246541.395870
+189815.295113     8246544.834773
+189794.577295     8246548.899445
+189772.679338     8246548.563296
+189743.889197     8246548.747284
+189717.611190     8246548.343899
+189696.339499     8246548.017363
+189673.815275     8246547.671601
+189652.543584     8246547.345065
+189626.285825     8246545.689734
+189601.945830     8246541.559712
+189582.570898     8246540.010037
+189564.497590     8246535.349893
+189551.429834     8246530.766588
+189537.050327     8246529.919916
+189523.356305     8246525.326997
+189505.929506     8246519.424904
+189490.399471     8246512.299289
+189475.667034     8246494.542696
+189463.477872     8246474.320632
+189453.821855     8246452.259259
+189444.033469     8246438.334947
+189433.569720     8246427.531099
+189418.685436     8246419.163141
+189400.753854     8246405.740144
+189372.862548     8246389.033809
+189350.017292     8246369.900422
+189325.940514     8246349.495874
+189303.075009     8246331.614433
+189283.872178     8246319.423795
+189196.259589     8246277.000000
+END
+LINE3D-MASTER
+HEIGHT 1000.000000
+188457.180542     8246277.000000
+188457.230394     8246277.307964
+188457.612929     8246292.340146
+188457.400336     8246305.484617
+188457.137119     8246321.759142
+188456.732176     8246346.796521
+188451.342692     8246370.505127
+188444.762177     8246390.439064
+188438.242407     8246406.617165
+188431.107256     8246422.159882
+188424.557110     8246440.216092
+188419.207359     8246461.420796
+188407.580794     8246483.781785
+188401.081273     8246498.707940
+188390.898829     8246509.195237
+188380.070633     8246520.924877
+188365.447400     8246535.100391
+188355.900587     8246544.971126
+188346.313276     8246557.345751
+188334.839329     8246570.317735
+188322.749242     8246582.653941
+188314.352199     8246598.803224
+188309.155059     8246610.619305
+188305.773690     8246626.219645
+188300.474557     8246644.294677
+188295.781436     8246663.631650
+188295.568844     8246676.776121
+188310.675090     8246671.373051
+188320.292770     8246657.120698
+188329.849711     8246646.623800
+188347.672089     8246628.114689
+188360.942316     8246620.179305
+188379.157357     8246616.076213
+188396.211737     8246606.320724
+188412.015110     8246596.546032
+188435.962442     8246586.270036
+188458.062871     8246574.087496
+188471.262238     8246570.533347
+188485.037248     8246570.118866
+188501.314270     8246569.742793
+188527.510526     8246575.153566
+188549.347745     8246579.245169
+188564.242156     8246586.986964
+188584.696756     8246599.196816
+188598.883913     8246611.936397
+188617.491616     8246622.239323
+188639.187102     8246635.094162
+188657.744187     8246648.526760
+188673.172986     8246661.911720
+188691.699702     8246677.222046
+188709.651526     8246689.393479
+188728.198484     8246703.452242
+188745.453945     8246719.995309
+188763.980654     8246735.306017
+188778.803441     8246747.429035
+188793.596616     8246761.430175
+188810.922937     8246773.592006
+188829.540761     8246783.269151
+188846.886567     8246794.179026
+188864.909263     8246801.968459
+188889.198634     8246809.228536
+188909.703859     8246818.308335
+188930.864186     8246825.520378
+188950.743908     8246834.590575
+188971.915126     8246841.176467
+188994.296854     8246850.285453
+189023.601142     8246856.996193
+189047.850022     8246866.759779
+189070.938247     8246870.870586
+189089.637058     8246875.540331
+189110.233391     8246878.986949
+189129.567827     8246883.040514
+189147.066256     8246884.561001
+189163.938413     8246886.072257
+189179.579811     8246886.312363
+189195.846712     8246886.562072
+189212.114377     8246886.811792
+189231.509558     8246887.109521
+189257.786802     8246887.512896
+189274.760957     8246882.764818
+189290.412476     8246882.379143
+189304.257595     8246877.582651
+189323.098133     8246873.489543
+189350.001643     8246873.902530
+189380.648052     8246874.998911
+189404.362543     8246879.119332
+189423.676731     8246884.424843
+189442.980803     8246890.355753
+189464.131773     8246898.193591
+189482.790094     8246905.366845
+189497.735123     8246909.978967
+189515.727444     8246919.646510
+189524.909811     8246932.309263
+189530.953772     8246945.550159
+189537.017986     8246957.538727
+189547.208392     8246985.243264
+189554.382644     8247006.014283
+189563.473897     8247024.310600
+189571.313386     8247042.587318
+189579.860123     8247055.866633
+189592.008795     8247078.592207
+189607.921371     8247100.749621
+189622.613310     8247121.010105
+189639.889019     8247136.301227
+189651.532903     8247151.506279
+189662.643161     8247161.068177
+189681.785253     8247177.014269
+189695.993421     8247188.501915
+189709.585444     8247199.354167
+189721.966957     8247207.683324
+189741.220406     8247216.744289
+189767.265572     8247231.544091
+189789.556191     8247246.286258
+189805.671239     8247255.924984
+189821.251892     8247259.920926
+189839.325206     8247264.580688
+189861.787922     8247268.682275
+189881.112237     8247273.361622
+189897.298914     8247278.618741
+189909.710797     8247285.070171
+189932.728156     8247293.562596
+189953.294119     8247298.886940
+189980.751503     8247303.691136
+190011.963433     8247308.552966
+190030.672372     8247312.596548
+190049.381304     8247316.640512
+190066.203612     8247321.281070
+190094.186027     8247332.354224
+190127.142861     8247345.381932
+190148.899086     8247354.481316
+190165.599910     8247366.633164
+190184.116499     8247382.569653
+190197.133636     8247390.282630
+190209.484774     8247400.489896
+190233.067660     8247412.747388
+190258.547298     8247423.782123
+190269.666914     8247432.718228
+190289.445400     8247448.047769
+190299.929391     8247457.600054
+190310.424268     8247466.526569
+190320.232138     8247479.198924
+190330.574404     8247497.514062
+190343.399191     8247517.119947
+190355.013468     8247534.202737
+190369.150770     8247550.072002
+190374.488246     8247568.310313
+190379.229819     8247584.661665
+190383.911422     8247604.768101
+190392.810324     8247634.957325
+190403.585742     8247665.174973
+190413.283020     8247684.732466
+190422.878291     8247710.549675
+190433.714454     8247737.011486
+190447.578419     8247769.781058
+190463.521364     8247790.060745
+190487.588021     8247811.091075
+190508.384666     8247840.836619
+190525.406516     8247871.776473
+190546.122174     8247906.529416
+190566.928946     8247935.648795
+190588.381463     8247963.526214
+190617.250438     8247997.152060
+190647.905571     8248036.440286
+190671.154381     8248069.353540
+190686.461696     8248090.249789
+190698.055731     8248108.584143
+190713.927810     8248133.245448
+190737.267728     8248160.525520
+190753.261292     8248177.675536
+190766.782454     8248192.909023
+190782.201133     8248206.919764
+190798.174448     8248225.321725
+190809.778604     8248243.030297
+190815.207189     8248255.635427
+190829.364739     8248270.252746
+190852.764633     8248293.777353
+190874.358883     8248312.891536
+190887.284912     8248326.237694
+190898.354674     8248338.303483
+190914.297625     8248358.582789
+190930.189947     8248381.992531
+190944.912256     8248400.375288
+190963.418723     8248416.937559
+190989.403144     8248435.493197
+191009.079636     8248457.081689
+191034.265682     8248486.269058
+191056.293097     8248517.284987
+191073.508061     8248536.331945
+191093.265522     8248552.914184
+191112.479250     8248564.478288
+191127.352649     8248573.472016
+191142.186314     8248584.969646
+191160.128017     8248597.766862
+191175.587199     8248609.273330
+191193.528902     8248622.070545
+191217.676546     8248638.093475
+191241.177669     8248655.359119
+191264.074307     8248671.362846
+191282.045622     8248682.281940
+191299.392198     8248693.191444
+191314.871609     8248703.447113
+191332.863930     8248713.114656
+191352.783378     8248719.681333
+191367.032049     8248728.664706
+191384.993995     8248740.210358
+191404.176583     8248753.652559
+191416.466975     8248767.615661
+191430.725004     8248775.973242
+191454.953630     8248786.989154
+191474.894097     8248792.303515
+191489.888973     8248793.786335
+191510.465064     8248798.484516
+191530.364271     8248806.302756
+191545.863936     8248815.306097
+191562.625493     8248823.702873
+191579.366044     8248833.351200
+191605.512452     8248841.891276
+191624.745646     8248852.204568
+191646.471507     8248863.181298
+191665.018471     8248877.239678
+191689.186358     8248892.011045
+191710.861602     8248906.117447
+191736.361488     8248915.900236
+191754.394293     8248923.064652
+191773.052614     8248930.237906
+191786.745879     8248934.830431
+191801.116016     8248936.303661
+191816.070409     8248940.289608
+191839.139155     8248945.651990
+191860.320495     8248951.612100
+191873.438862     8248953.066114
+191902.824143     8248954.769073
+191920.322572     8248956.289560
+191942.210396     8248957.252255
+191963.482850     8248957.578802
+191989.760093     8248957.982176
+192015.411834     8248958.375948
+192036.583052     8248964.961840
+192063.385327     8248971.634172
+192088.330583     8248977.025360
+192115.777839     8248982.455719
+192141.369604     8248986.604957
+192161.370046     8248988.163852
+192183.883373     8248989.136149
+192197.021995     8248989.337836
+192223.915384     8248990.376605
+192238.911037     8248991.858673
+192253.785199     8249000.852413
+192269.163387     8249017.366663
+192275.863220     8249028.739433
+192283.178435     8249040.747588
+192296.124719     8249052.841418
+192317.346555     8249056.297638
+192331.192425     8249051.501921
+192344.442403     8249044.818482
+192357.046637     8249039.377004
+192377.864932     8249029.052593
+192396.019228     8249028.705337
+192412.983256     8249024.583423
+192429.885782     8249024.216952
+192448.726332     8249020.123080
+192477.587333     8249015.557856
+192502.170297     8249004.665299
+192520.496701     8248993.676698
+192537.530825     8248985.173537
+192558.299267     8248977.978810
+192579.087187     8248969.532508
+192604.881411     8248961.163821
+192625.598471     8248957.098755
+192648.889931     8248948.690884
+192665.227692     8248944.559357
+192681.626205     8248936.671611
+192698.660330     8248928.168450
+192714.514333     8248915.263321
+192729.086942     8248904.217862
+192748.654231     8248893.874247
+192761.187592     8248892.814769
+192774.952480     8248893.026070
+192796.052075     8248903.993185
+192811.551741     8248912.996527
+192828.918558     8248922.654468
+192849.484516     8248927.979195
+192868.183334     8248932.648558
+192886.326745     8248932.927072
+192899.466130     8248933.128771
+192921.364087     8248933.464920
+192944.583911     8248929.439037
+192962.748341     8248928.465236
+192985.907425     8248928.194807
+193004.677103     8248928.482935
+193020.944005     8248928.732643
+193039.663064     8248932.150443
+193057.171615     8248933.045148
+193080.936712     8248934.036661
+193105.336682     8248934.411217
+193120.372832     8248933.389394
+193143.613674     8248928.111196
+193157.438538     8248924.567031
+193173.079936     8248924.807137
+193187.470328     8248925.028040
+193214.271839     8248931.700361
+193233.031395     8248932.614270
+193247.361036     8248936.591391
+193269.198254     8248940.682994
+193294.718395     8248949.213456
+193312.771455     8248955.125545
+193332.711146     8248960.440657
+193351.420085     8248964.484239
+193373.882806     8248968.585444
+193396.396910     8248969.556988
+193415.771836     8248971.107045
+193435.772278     8248972.665940
+193457.649981     8248974.254417
+193484.533249     8248975.918968
+193505.128818     8248979.365574
+193523.837757     8248983.409155
+193540.730926     8248983.668477
+193561.326495     8248987.115083
+193582.578695     8248988.693958
+193603.164907     8248992.766357
+193618.130184     8248996.126534
+193632.469194     8248999.477097
+193646.808968     8249002.827672
+193661.764124     8249006.813630
+193674.882503     8249008.266881
+193688.596010     8249011.607842
+193707.960816     8249013.783681
+193726.104990     8249014.062207
+193744.874668     8249014.350334
+193765.531740     8249014.041498
+193780.547635     8249014.272002
+193793.686257     8249014.473689
+193810.588783     8249014.107218
+193836.240523     8249014.500990
+193866.786459     8249021.856727
+193887.957678     8249028.442619
+193911.540558     8249040.700493
+193925.162963     8249049.674254
+193939.431864     8249057.406828
+193953.135250     8249061.373571
+193978.100748     8249065.513196
+193991.804134     8249069.479939
+194005.498150     8249074.073239
+194023.561344     8249079.358782
+194045.993689     8249085.338096
+194072.825564     8249090.133072
+194103.381621     8249096.863028
+194125.824100     8249102.215796
+194150.769344     8249107.607748
+194170.770550     8249109.166654
+194183.222929     8249113.114193
+194211.286331     8249119.179948
+194238.168823     8249120.845251
+194254.416246     8249122.346535
+194278.795974     8249123.972655
+194296.294391     8249125.493906
+194318.807730     8249126.465439
+194345.075616     8249127.494606
+194364.551779     8249122.785318
+194379.658788     8249117.382260
+194394.765034     8249111.979190
+194408.015777     8249105.295762
+194425.029671     8249098.043400
+194443.254827     8249093.314909
+194468.432918     8249084.310062
+194491.662875     8249079.657633
+194516.901705     8249066.897333
+194540.768051     8249061.628736
+194563.504104     8249048.830016
+194591.205213     8249038.612025
+194615.788177     8249027.719468
+194635.374944     8249016.124278
+194653.681857     8249006.388017
+194680.716979     8248998.663551
+194707.115701     8248991.556017
+194727.904384     8248983.109726
+194744.312255     8248974.596188
+194756.956972     8248966.651583
+194767.775047     8248955.547725
+194778.604770     8248943.818108
+194792.611851     8248929.007581
+194807.174351     8248918.587139
+194826.690246     8248911.373949
+194848.054579     8248906.066945
+194861.818704     8248906.278234
+194875.027422     8248902.098674
+194887.540540     8248902.290759
+194903.808206     8248902.540479
+194923.204150     8248902.838220
+194940.650434     8248907.488356
+194964.364926     8248911.608777
+194991.884582     8248912.657160
+195011.783776     8248920.476163
+195017.000000     8248922.557037
+END
+LINE3D-MASTER
+HEIGHT 1000.000000
+195017.000000     8252581.206382
+195010.080383     8252585.580290
+194993.076621     8252592.206107
+194977.364363     8252596.347236
+194949.098489     8252602.800171
+194927.028424     8252613.105366
+194896.834659     8252622.659156
+194880.445516     8252629.920344
+194867.206422     8252635.978013
+194858.284335     8252645.859102
+194848.072285     8252658.224137
+194837.213726     8252671.831122
+194818.775202     8252689.704837
+194808.512534     8252705.199545
+194799.600581     8252714.454088
+194789.398652     8252726.193342
+194782.949755     8252737.989443
+194775.268553     8252748.515518
+194760.818950     8252752.050093
+194745.782049     8252753.071140
+194729.485536     8252754.699552
+194713.914998     8252750.078210
+194696.477320     8252744.801505
+194684.507947     8252749.626791
+194668.785568     8252754.393702
+194645.424011     8252767.182820
+194633.334688     8252779.519038
+194613.675520     8252795.496204
+194597.821530     8252808.400569
+194586.377200     8252819.494050
+194574.974883     8252828.084427
+194562.954893     8252836.039386
+194537.101444     8252848.164315
+194499.974236     8252860.742121
+194469.135477     8252871.538647
+194433.219541     8252886.639559
+194401.703910     8252900.555381
+194375.900316     8252909.550626
+194358.916797     8252914.924879
+194343.184284     8252920.318335
+194321.114231     8252930.622767
+194300.920675     8252940.956768
+194270.060910     8252953.004846
+194242.996188     8252962.606669
+194222.248002     8252968.549068
+194200.783197     8252980.115429
+194176.887252     8252987.261382
+194157.431332     8252990.719107
+194143.040940     8252990.498204
+194129.276815     8252990.286915
+194113.706277     8252985.665573
+194099.941388     8252985.454272
+194078.760049     8252979.494162
+194056.307448     8252974.767176
+194041.372547     8252969.528890
+194028.335161     8252963.067858
+194004.753044     8252950.809995
+193993.673149     8252939.370752
+193985.126419     8252926.091055
+193975.379287     8252909.663246
+193970.021563     8252892.676880
+193963.443208     8252873.793202
+193963.665934     8252860.022185
+193965.190272     8252843.141463
+193965.392743     8252830.622774
+193965.676209     8252813.096303
+193955.959440     8252794.791149
+193945.505824     8252783.360755
+193933.729566     8252776.293146
+193913.244590     8252765.961402
+193893.849409     8252765.663672
+193874.454228     8252765.365943
+193856.340429     8252763.209308
+193843.282801     8252757.999839
+193830.144179     8252757.798152
+193807.408113     8252770.597637
+193795.429396     8252776.047952
+193784.055914     8252782.760961
+193770.866675     8252785.688947
+193758.232078     8252793.007769
+193745.607603     8252799.700811
+193734.021528     8252819.558291
+193726.321625     8252831.335188
+193719.882836     8252842.506272
+193711.576908     8252853.021992
+193698.286432     8252862.209322
+193686.327944     8252866.408838
+193675.803456     8252859.360444
+193662.826821     8252849.143195
+193648.628768     8252837.030148
+193634.583344     8252815.527333
+193611.636088     8252802.653279
+193593.481792     8252803.000535
+193571.350987     8252817.061184
+193563.651084     8252828.838081
+193555.193289     8252848.743583
+193550.550793     8252864.950501
+193549.520346     8252889.978278
+193542.304201     8252910.528777
+193541.889137     8252936.191937
+193545.389830     8252951.897922
+193545.600269     8252977.570684
+193545.780332     8253005.121556
+193545.102057     8253047.058860
+193543.273999     8253082.718379
+193541.688159     8253103.354542
+193541.435069     8253119.002904
+193542.251521     8253145.937608
+193544.984978     8253170.397226
+193544.559793     8253196.686168
+193544.266206     8253214.838421
+193544.013117     8253230.486782
+193538.027736     8253252.308048
+193525.109674     8253277.153342
+193518.438050     8253302.720460
+193513.785433     8253319.553160
+193509.152294     8253335.134285
+193508.828332     8253355.164646
+193509.200745     8253370.822610
+193510.875547     8253383.370117
+193503.175631     8253395.147778
+193491.781920     8253403.111586
+193485.171035     8253424.923250
+193493.555791     8253448.217746
+193502.788776     8253457.750827
+193520.306684     8253458.019739
+193533.456203     8253457.594892
+193554.163129     8253454.156371
+193564.577012     8253468.090668
+193564.232820     8253489.371828
+193558.974178     8253504.943351
+193556.248675     8253518.675949
+193555.329586     8253536.818599
+193563.048354     8253562.606620
+193570.312951     8253577.744446
+193578.900191     8253588.519489
+193595.529385     8253605.052942
+193616.417138     8253629.165305
+193626.225009     8253641.837660
+193635.356758     8253657.630086
+193642.682871     8253669.011706
+193652.923894     8253693.586571
+193665.738554     8253713.818619
+193683.852365     8253715.974490
+193701.885183     8253723.138142
+193714.155333     8253738.352807
+193724.588707     8253751.034764
+193738.705754     8253768.156356
+193756.556355     8253786.586370
+193775.123561     8253799.393187
+193790.471373     8253817.785546
+193800.894626     8253831.093285
+193816.282935     8253846.981753
+193825.485544     8253858.392943
+193834.698287     8253869.177587
+193849.511711     8253881.926781
+193867.937184     8253903.496834
+193900.640929     8253932.172904
+193916.079856     8253944.931699
+193928.400624     8253957.016692
+193943.819308     8253971.027051
+193952.426790     8253980.550530
+193965.352807     8253993.897453
+193985.151541     8254007.975049
+194000.560092     8254022.611954
+194015.403891     8254033.483038
+194034.637097     8254043.795567
+194060.560015     8254066.106647
+194077.260833     8254078.258877
+194096.554778     8254084.815951
+194109.673158     8254086.269202
+194129.673587     8254087.828861
+194177.849552     8254088.568396
+194216.579175     8254092.919311
+194232.068719     8254102.548432
+194248.860652     8254109.067099
+194261.928414     8254113.650022
+194276.782321     8254123.896089
+194297.800922     8254139.870986
+194320.072057     8254155.865110
+194337.871276     8254177.424785
+194344.571873     8254188.797568
+194362.926487     8254214.748856
+194385.862858     8254228.248680
+194400.141880     8254235.355473
+194432.916498     8254259.649543
+194455.176748     8254276.269437
+194468.144025     8254287.112480
+194483.633569     8254296.741604
+194505.258195     8254313.977678
+194534.825693     8254304.414274
+194551.728219     8254304.047803
+194574.110710     8254313.156801
+194590.093395     8254330.932204
+194606.663365     8254351.221900
+194621.496280     8254362.718754
+194640.780867     8254369.901622
+194661.264304     8254380.234107
+194678.006382     8254389.882457
+194691.537672     8254404.489781
+194700.598549     8254424.664206
+194707.206516     8254441.669764
+194705.520191     8254468.566048
+194698.274446     8254490.993903
+194692.349040     8254509.059703
+194683.377875     8254522.069724
+194668.006891     8254543.746914
+194658.954733     8254561.764717
+194649.882333     8254581.034082
+194643.342320     8254598.463746
+194630.576112     8254613.920023
+194618.373893     8254633.142108
+194603.669672     8254652.325021
+194591.185527     8254689.072836
+194577.479224     8254723.923315
+194567.246931     8254737.539913
+194555.044724     8254756.761234
+194535.859969     8254782.137031
+194524.717945     8254813.270487
+194518.107061     8254835.082151
+194508.408406     8254854.341138
+194496.843350     8254872.946303
+194486.559651     8254889.694090
+194465.517891     8254913.787978
+194448.281294     8254934.809829
+194434.141814     8254957.759326
+194415.139313     8254971.866469
+194391.706884     8254989.037586
+194370.806844     8255004.369003
+194346.223880     8255015.261561
+194334.820812     8255023.851162
+194317.704905     8255037.363621
+194298.036392     8255053.965817
+194277.509529     8255084.955209
+194262.220303     8255101.624629
+194250.725343     8255115.848546
+194233.579849     8255131.237598
+194217.130718     8255142.255016
+194202.466995     8255158.934038
+194184.635271     8255178.068178
+194173.573452     8255204.195368
+194158.930734     8255219.622839
+194141.652890     8255243.147805
+194112.548896     8255262.737137
+194097.148325     8255286.290920
+194081.808455     8255306.091541
+194070.747425     8255332.217215
+194070.453851     8255350.368703
+194065.073730     8255373.451134
+194058.927126     8255405.287975
+194054.354738     8255417.112881
+194054.142133     8255430.258117
+194053.646087     8255460.928294
+194051.567106     8255473.418178
+194040.738134     8255485.148570
+194026.348506     8255484.927680
+194013.209121     8255484.725981
+193996.154754     8255494.480705
+193981.632751     8255502.397256
+193972.722325     8255511.651823
+193961.308359     8255520.867959
+193956.625366     8255539.578768
+193947.683801     8255550.711432
+193946.219425     8255563.837452
+193960.417479     8255575.950498
+193972.213992     8255581.765780
+193984.615741     8255588.843756
+193981.203997     8255606.322205
+193967.256879     8255617.378031
+193957.023823     8255630.994617
+193946.226015     8255640.845384
+193938.545565     8255651.372235
+193925.224739     8255662.436146
+193910.582021     8255677.863617
+193895.485133     8255682.640893
+193866.220566     8255673.427015
+193852.648804     8255661.322054
+193838.975781     8255655.477966
+193824.121874     8255645.231899
+193808.541202     8255641.237103
+193779.124806     8255641.410713
+193753.462933     8255641.643487
+193729.769459     8255636.270750
+193705.388968     8255634.644619
+193692.966951     8255628.819735
+193675.025248     8255616.022519
+193663.218627     8255610.832255
+193645.913324     8255597.418107
+193608.596682     8255583.071599
+193583.015038     8255578.296580
+193564.326354     8255573.000671
+193541.187524     8255572.018772
+193504.385016     8255564.567756
+193466.845660     8255563.991501
+193449.175899     8255573.111606
+193414.542109     8255586.353624
+193363.660896     8255598.094359
+193330.954998     8255608.235523
+193298.411062     8255608.362652
+193273.232971     8255617.367499
+193238.033666     8255626.843686
+193221.706013     8255630.350195
+193206.588882     8255636.379036
+193182.087676     8255642.263824
+193155.738809     8255646.241673
+193139.864563     8255660.398365
+193120.932898     8255670.125801
+193089.971898     8255688.433224
+193075.369690     8255701.356040
+193069.394417     8255722.552288
+193056.053324     8255734.869290
+193041.288364     8255757.807657
+193023.446507     8255777.568343
+193000.961377     8255813.536699
+192964.832861     8255841.781318
+192941.390299     8255859.578981
+192927.352079     8255876.267606
+192910.710610     8255899.177167
+192898.438293     8255922.780499
+192889.224160     8255950.813100
+192870.725660     8255972.442281
+192849.017887     8255999.031222
+192835.595801     8256016.356005
+192824.141350     8256028.075268
+192819.519108     8256043.029859
+192818.559522     8256063.676400
+192819.486579     8256083.725201
+192814.854203     8256099.306338
+192803.308626     8256116.659927
+192794.174723     8256139.684735
+192783.103559     8256166.436955
+192776.996699     8256195.769129
+192760.395715     8256216.175564
+192748.759035     8256239.161952
+192725.245613     8256261.340851
+192713.608933     8256284.327240
+192704.082349     8256292.947176
+192684.998855     8256312.062099
+192665.289834     8256331.168950
+192644.410035     8256345.248803
+192627.839427     8256363.777129
+192610.521837     8256389.806761
+192588.279687     8256410.751772
+192572.858849     8256435.558647
+192559.548132     8256445.997540
+192549.406178     8256453.981328
+192540.484855     8256463.862429
+192525.922367     8256474.282106
+192509.331517     8256494.061995
+192488.996992     8256513.159244
+192461.637920     8256540.913307
+192446.791967     8256568.859456
+192429.646473     8256584.248507
+192424.397964     8256599.193484
+192407.070241     8256625.849662
+192396.120555     8256645.090974
+192376.360176     8256667.325957
+192357.084319     8256698.334553
+192329.232120     8256717.941572
+192308.261195     8256737.655752
+192290.469192     8256754.286754
+192267.631915     8256773.344054
+192245.217645     8256804.931175
+192221.805458     8256820.850729
+192206.637710     8256830.009242
+192194.567890     8256841.092356
+192176.231352     8256852.707502
+192161.578526     8256868.759991
+192142.505141     8256887.249897
+192119.455234     8256919.453961
+192108.413682     8256944.328061
+192092.590079     8256955.353552
+192076.049821     8256972.005297
+192060.175601     8256986.160461
+192050.557915     8257000.413196
+192043.483489     8257012.201223
+192032.664676     8257023.303541
+192024.924263     8257037.585093
+191941.285119     8257101.415438
+191922.958740     8257112.402510
+191907.266724     8257115.292076
+191873.288788     8257126.667116
+191836.091470     8257143.626933
+191817.937187     8257143.973425
+191806.564469     8257150.686445
+191787.632829     8257160.412352
+191762.343369     8257176.303090
+191735.510603     8257221.552377
+END
+LINE3D
+HEIGHT 1020.000000
+187766.346848     8246277.000000
+187768.816524     8246278.636188
+187776.778255     8246289.402011
+187786.656991     8246297.692748
+187801.531160     8246306.686106
+187813.973412     8246311.259809
+187832.803829     8246307.792483
+187857.264926     8246304.411209
+187870.414051     8246303.987120
+187891.050499     8246304.929841
+187909.042438     8246314.597378
+187925.763122     8246325.497657
+187940.627164     8246335.117178
+187948.598633     8246345.257213
+187957.104880     8246361.040037
+187961.291821     8246372.999788
+187968.587170     8246386.259893
+187975.196283     8246403.265469
+187976.032219     8246428.948215
+187975.809499     8246442.718850
+187975.434931     8246465.878119
+187975.029988     8246490.915498
+187974.776898     8246506.563860
+187978.247598     8246524.147960
+187982.161584     8246553.008024
+187982.432762     8246574.925332
+187982.078436     8246596.833038
+187981.703863     8246619.992690
+187980.219633     8246634.369897
+187975.586876     8246649.951028
+187974.576678     8246673.726859
+187970.458443     8246696.203106
+187969.508608     8246716.223096
+187962.312711     8246735.521649
+187948.264745     8246752.836443
+187936.124040     8246768.302321
+187924.669960     8246780.022354
+187913.821140     8246793.003551
+187901.105550     8246805.330155
+187885.786329     8246823.877691
+187864.785435     8246845.468458
+187848.941565     8246857.747041
+187830.554422     8246872.491095
+187808.413502     8246887.177144
+187791.308117     8246900.062681
+187777.391757     8246909.240404
+187765.393166     8246915.943053
+187752.132679     8246923.252650
+187731.950020     8246932.960117
+187722.413327     8246942.205070
+187722.048875     8246964.738940
+187726.780714     8246981.715698
+187745.246684     8247000.781860
+187763.147509     8247016.082960
+187780.967728     8247036.391465
+187795.781151     8247049.140659
+187813.732599     8247061.311705
+187837.940983     8247073.579181
+187864.712506     8247082.129235
+187892.049169     8247094.444732
+187915.560807     8247111.083836
+187930.999734     8247123.842632
+187944.026993     8247130.929827
+187961.545282     8247131.198745
+187991.577072     8247131.659754
+188023.011722     8247122.750950
+188043.789903     8247114.930436
+188060.804167     8247107.678844
+188076.607546     8247097.903769
+188095.559447     8247086.925153
+188127.166200     8247067.375387
+188152.475896     8247050.233468
+188172.719300     8247036.770165
+188194.224595     8247022.700296
+188213.801999     8247011.731281
+188242.108370     8247002.774456
+188266.650836     8246994.385789
+188283.725464     8246983.378355
+188297.753563     8246967.315512
+188313.144032     8246944.386365
+188329.765258     8246922.728367
+188347.001867     8246901.705752
+188369.173162     8246885.141594
+188393.100247     8246876.117544
+188417.571841     8246872.110876
+188445.716236     8246873.168850
+188479.369440     8246881.824542
+188514.961420     8246886.753609
+188539.866173     8246894.649070
+188558.575112     8246898.692651
+188577.808312     8246909.005562
+188596.416015     8246919.308488
+188614.327348     8246933.983430
+188629.100275     8246949.236515
+188640.531565     8246977.586038
+188653.225517     8247005.328624
+188665.495667     8247020.543289
+188675.252920     8247036.345317
+188688.118204     8247053.447311
+188701.517882     8247076.192088
+188722.395514     8247100.930232
+188746.462171     8247121.960562
+188770.670555     8247134.228038
+188789.924009     8247143.288621
+188813.577756     8247151.164877
+188838.472388     8247159.686119
+188873.438101     8247164.605573
+188903.317273     8247174.455587
+188929.453548     8247183.622209
+188959.989363     8247191.603727
+188991.160796     8247198.969449
+189019.920568     8247200.663188
+189044.250441     8247205.418992
+189063.574756     8247210.098339
+189079.841658     8247210.348047
+189092.344649     8247211.166296
+189106.108774     8247211.377585
+189127.371107     8247212.329914
+189147.311567     8247217.644656
+189163.477233     8247224.153710
+189177.866861     8247224.374600
+189198.503685     8247225.317709
+189217.202502     8247229.987073
+189240.805631     8247240.993002
+189256.890309     8247252.509454
+189271.693605     8247265.884812
+189285.820023     8247282.379846
+189298.100300     8247296.968347
+189315.961010     8247314.773344
+189335.052483     8247333.849108
+189364.709706     8247357.469387
+189398.130826     8247380.521889
+189427.313629     8247394.743919
+189457.122705     8247408.975181
+189490.160527     8247416.995489
+189522.563488     8247425.631990
+189556.135699     8247439.295463
+189586.661386     8247447.903146
+189617.812577     8247456.520430
+189650.790424     8247468.296205
+189683.071137     8247484.443983
+189718.460645     8247501.891740
+189756.483772     8247511.240833
+189778.219754     8247521.591781
+189799.955731     8247531.943110
+189824.779496     8247544.845970
+189846.505358     8247555.822699
+189864.538169     8247562.986734
+189879.411574     8247571.980080
+189893.670354     8247580.338436
+189906.051868     8247588.667593
+189918.403011     8247598.874477
+189928.826258     8247612.182598
+189942.348184     8247627.416096
+189956.474596     8247643.911513
+189976.202463     8247662.370726
+189998.482956     8247677.739057
+190008.300953     8247689.785249
+190024.677816     8247721.967458
+190034.756864     8247756.557121
+190043.777256     8247779.234673
+190051.516267     8247803.771131
+190058.104749     8247822.028646
+190063.391601     8247843.397011
+190073.017249     8247867.336110
+190089.958111     8247903.283364
+190113.923532     8247930.573038
+190131.693133     8247954.011215
+190147.040945     8247972.403574
+190165.314571     8248003.362262
+190188.644362     8248031.268498
+190220.137597     8248057.421473
+190247.302158     8248080.377933
+190268.280269     8248098.856339
+190281.761698     8248116.593728
+190290.944066     8248129.256481
+190302.023185     8248140.696477
+190319.319143     8248154.735654
+190335.353197     8248169.382160
+190353.305027     8248181.553212
+190381.115340     8248203.267328
+190406.311519     8248231.828152
+190430.104838     8248269.758788
+190454.130998     8248293.293008
+190481.951438     8248314.380961
+190504.756204     8248336.017857
+190523.181677     8248357.587909
+190535.279732     8248383.443155
+190545.592379     8248403.636796
+190553.482492     8248418.783460
+190561.363235     8248434.556682
+190575.368162     8248458.563388
+190595.498813     8248490.802838
+190615.740821     8248516.157162
+190625.599309     8248525.699845
+190641.663739     8248538.468243
+190657.102666     8248551.227039
+190676.285254     8248564.669239
+190697.940243     8248580.027969
+190722.087887     8248596.050899
+190745.004004     8248610.803050
+190762.895089     8248626.729938
+190781.976442     8248646.431483
+190800.513272     8248661.116409
+190816.629084     8248670.755146
+190833.964774     8248682.290420
+190856.285763     8248695.154861
+190874.822594     8248709.839787
+190889.595520     8248725.092872
+190904.953466     8248742.858685
+190922.117812     8248765.035315
+190943.631069     8248789.157280
+190969.009477     8248806.450977
+190988.837811     8248818.651216
+191001.188955     8248828.858100
+191017.233893     8248842.878837
+191033.923826     8248855.656836
+191048.162365     8248865.266756
+191062.944661     8248879.893283
+191089.514088     8248900.962414
+191118.666522     8248917.062171
+191140.402504     8248927.413119
+191156.528437     8248936.426074
+191172.704224     8248942.309346
+191192.633805     8248948.249476
+191214.400151     8248956.723079
+191239.284656     8248965.870485
+191257.297231     8248974.285700
+191279.638463     8248985.898577
+191295.763631     8248994.911521
+191316.137251     8249012.128391
+191342.757296     8249030.067850
+191364.503400     8249039.793016
+191376.874786     8249048.748336
+191389.871687     8249057.712495
+191407.864008     8249067.380038
+191418.983624     8249076.316143
+191430.770004     8249082.757971
+191445.755523     8249084.866584
+191459.489285     8249086.955218
+191482.578261     8249091.066801
+191495.706761     8249091.894269
+191511.338038     8249092.760158
+191533.831123     8249094.984017
+191546.959624     8249095.811486
+191563.155665     8249100.442430
+191578.797063     8249100.682537
+191598.172754     8249102.232605
+191611.876139     8249106.199348
+191631.876581     8249107.758243
+191646.831737     8249111.744202
+191661.110760     8249118.850995
+191679.708342     8249129.779703
+191695.843632     8249138.166865
+191713.856207     8249146.582080
+191723.745059     8249154.247418
+191739.860107     8249163.886144
+191756.631797     8249171.656374
+191768.982941     8249181.863258
+191785.108109     8249190.876201
+191795.592101     8249200.428486
+191824.704802     8249219.032146
+191852.545490     8249238.868153
+191871.697702     8249254.188463
+191883.362604     8249268.141199
+191891.969322     8249277.664666
+191906.136988     8249291.656585
+191921.575915     8249304.415381
+191938.841496     8249320.332667
+191951.223016     8249328.661442
+191969.143701     8249342.710972
+191984.592761     8249354.843223
+191995.077516     8249364.395519
+192008.689787     8249373.995825
+192024.179332     8249383.624948
+192038.992755     8249396.374142
+192056.238083     8249413.543755
+192077.933568     8249426.398594
+192105.289722     8249437.461752
+192122.676782     8249445.868130
+192143.756886     8249458.087585
+192166.693257     8249471.587408
+192192.789047     8249483.257156
+192220.145189     8249494.321079
+192248.713380     8249507.907355
+192267.351446     8249516.332936
+192284.243851     8249516.592247
+192296.746848     8249517.410114
+192320.471461     8249520.904752
+192343.600183     8249522.511668
+192362.359739     8249523.425578
+192378.001137     8249523.665684
+192393.037275     8249522.644626
+192413.189570     8249514.814503
+192432.040229     8249510.095614
+192453.393677     8249505.414379
+192470.377196     8249500.040127
+192489.288594     8249491.565783
+192501.913082     8249484.871978
+192515.143570     8249479.440878
+192529.120300     8249466.506931
+192558.335626     8249440.034001
+192577.933279     8249427.813041
+192598.843440     8249411.855843
+192615.999068     8249395.840246
+192632.459071     8249384.197822
+192655.820640     8249371.407940
+192674.106535     8249362.923995
+192689.859302     8249356.278211
+192716.268145     8249348.544895
+192750.185329     8249340.926073
+192772.204764     8249333.751314
+192790.460296     8249327.144714
+192811.864362     8249319.333807
+192840.180853     8249309.751200
+192869.051988     8249304.559431
+192894.804964     8249298.693858
+192921.153067     8249294.715997
+192947.431075     8249295.119382
+192974.333821     8249295.532358
+192996.766943     8249301.510920
+193016.676258     8249308.704142
+193037.887973     8249312.786143
+193055.961288     8249317.445905
+193076.587221     8249319.015165
+193102.844986     8249320.670115
+193125.933210     8249324.780921
+193150.333944     8249325.155490
+193170.293889     8249329.218275
+193190.930707     8249330.161766
+193219.014364     8249334.975194
+193250.760688     8249345.479807
+193276.956938     8249350.890963
+193296.958144     8249352.449869
+193316.918089     8249356.512655
+193345.647491     8249360.084121
+193369.402467     8249361.701414
+193386.860400     8249365.725792
+193403.117180     8249366.601282
+193422.451622     8249370.654466
+193443.653204     8249375.363013
+193461.736639     8249379.396993
+193482.927336     8249384.731309
+193495.894626     8249395.573588
+193510.757903     8249405.193098
+193526.904090     8249412.953726
+193544.936132     8249420.118131
+193566.097229     8249427.329804
+193591.062728     8249431.469429
+193614.080844     8249439.962247
+193629.025115     8249444.573975
+193645.221920     8249449.204931
+193663.264095     8249455.742790
+193679.460887     8249460.374510
+193695.021304     8249465.621633
+193714.981237     8249469.685183
+193733.044431     8249474.970726
+193749.876096     8249478.985490
+193764.256355     8249479.832939
+193779.252007     8249481.315007
+193793.621393     8249482.787461
+193812.965956     8249486.214863
+193832.926653     8249490.278424
+193854.824610     8249490.614573
+193871.717015     8249490.873883
+193886.743043     8249490.477842
+193901.779180     8249489.456783
+193927.451163     8249488.598992
+193943.092561     8249488.839099
+193964.990518     8249489.175248
+193981.812063     8249493.815794
+193997.937995     8249502.828749
+194016.525456     8249514.383239
+194028.290817     8249522.077383
+194042.509113     8249532.938865
+194055.465506     8249544.407679
+194068.462395     8249553.372601
+194082.761684     8249559.226303
+194098.947592     8249564.483792
+194114.528251     8249568.479353
+194131.370802     8249571.868347
+194147.587085     8249575.247728
+194170.725928     8249576.228862
+194196.367535     8249577.249180
+194216.953747     8249581.321579
+194238.841583     8249582.283510
+194260.668680     8249587.000895
+194277.500334     8249591.016423
+194299.286934     8249598.237699
+194318.510783     8249609.176020
+194339.005117     8249618.881971
+194356.412431     8249626.036021
+194370.055066     8249633.758982
+194388.672890     8249643.436127
+194402.265683     8249654.288008
+194415.837457     8249666.392205
+194429.348492     8249682.251855
+194446.664692     8249695.039469
+194460.903230     8249704.649388
+194478.350278     8249709.299536
+194500.732006     8249718.408522
+194520.046957     8249723.714045
+194536.817884     8249731.484263
+194551.762906     8249736.096768
+194573.509010     8249745.821934
+194590.290821     8249752.966382
+194607.132608     8249756.355365
+194629.503451     8249766.090121
+194643.843225     8249769.440696
+194666.992189     8249769.796049
+194687.639140     8249770.112994
+194710.788104     8249770.468347
+194728.306775     8249770.737271
+194745.300416     8249764.737236
+194769.197137     8249757.590531
+194781.186752     8249751.513681
+194793.790972     8249746.072967
+194809.624721     8249734.420166
+194826.709476     8249722.786568
+194842.502728     8249713.637658
+194856.509821     8249698.826366
+194866.733520     8249685.835573
+194878.822843     8249673.499355
+194888.460771     8249657.995057
+194899.258591     8249648.143526
+194905.103004     8249635.085507
+194911.643028     8249617.655079
+194912.510736     8249602.642089
+194915.912347     8249585.790186
+194920.061716     8249561.436223
+194924.785206     8249540.221524
+194931.870504     8249527.808490
+194939.610904     8249513.527702
+194951.085622     8249500.555349
+194960.077028     8249486.293765
+194973.398643     8249475.228337
+194984.277457     8249460.369025
+194998.355410     8249441.176498
+195009.325326     8249420.684387
+195017.000000     8249411.761649
+END
+LINE3D
+HEIGHT 1020.000000
+195017.000000     8252107.484824
+194980.547385     8252128.707267
+194955.278180     8252143.345677
+194938.868795     8252151.858428
+194921.794161     8252162.866244
+194904.679042     8252176.377187
+194881.164092     8252198.556062
+194857.660803     8252220.108416
+194839.274436     8252234.851718
+194824.085670     8252245.262546
+194802.611507     8252257.454700
+194766.009330     8252276.301464
+194734.988354     8252298.364353
+194709.082760     8252313.618931
+194696.387413     8252324.693972
+194688.707751     8252335.219306
+194673.520511     8252345.630158
+194648.886179     8252359.651612
+194628.663023     8252371.862970
+194612.263747     8252379.750703
+194597.763525     8252386.414951
+194563.119602     8252400.283515
+194515.305930     8252415.827725
+194490.148094     8252423.580245
+194469.349289     8252432.652317
+194447.966229     8252439.211672
+194431.566965     8252447.098641
+194400.738328     8252457.269386
+194367.396041     8252468.026718
+194340.340677     8252477.002747
+194327.181801     8252478.053388
+194305.212983     8252482.098474
+194288.895464     8252484.978438
+194264.988622     8252492.750926
+194247.924121     8252503.132196
+194232.827233     8252507.909473
+194216.448974     8252514.544891
+194192.602884     8252518.561160
+194169.342563     8252525.090933
+194140.481549     8252529.656921
+194114.708331     8252536.774057
+194093.294144     8252545.210745
+194076.390855     8252545.577205
+194056.360037     8252545.896419
+194042.595912     8252545.685130
+194023.907228     8252540.389221
+194010.223333     8252535.170139
+193992.806661     8252528.641882
+193976.640232     8252522.132817
+193960.545427     8252511.242529
+193948.748926     8252505.426482
+193931.382872     8252495.768553
+193919.566117     8252491.204834
+193903.471323     8252480.313781
+193879.273061     8252467.420524
+193851.987004     8252451.976118
+193827.657142     8252447.219550
+193807.091936     8252441.895599
+193795.285314     8252436.705334
+193782.853189     8252431.505468
+193767.999269     8252421.260165
+193751.309336     8252408.482165
+193725.880310     8252394.318140
+193704.144327     8252383.967192
+193688.685158     8252372.459960
+193668.139443     8252365.883670
+193636.302004     8252361.012620
+193616.341307     8252356.949058
+193601.951679     8252356.728167
+193588.782682     8252358.404589
+193574.372047     8252359.435250
+193561.182808     8252362.363235
+193545.521155     8252363.375456
+193518.445549     8252373.603049
+193494.387617     8252390.764565
+193470.318800     8252408.551851
+193444.424104     8252423.179895
+193408.558786     8252435.151134
+193380.262537     8252443.482178
+193359.464496     8252452.554262
+193344.932371     8252461.096595
+193320.319045     8252473.866497
+193306.423308     8252481.792662
+193286.240649     8252491.500129
+193265.451966     8252499.946419
+193249.023089     8252509.711510
+193225.681011     8252521.249053
+193213.591688     8252533.585271
+193206.536766     8252544.120195
+193201.299130     8252558.440166
+193196.070863     8252572.133580
+193190.156342     8252589.573610
+193183.000948     8252606.367891
+193177.076305     8252624.433703
+193175.592452     8252638.811297
+193170.232574     8252660.642165
+193163.722925     8252676.194484
+193155.286149     8252694.847670
+193148.786633     8252709.773444
+193146.524659     8252733.530442
+193146.301945     8252747.300694
+193150.841804     8252776.171130
+193153.767612     8252788.737841
+193164.897361     8252797.047400
+193177.874772     8252807.263897
+193190.912158     8252813.724929
+193207.693193     8252820.870130
+193220.771076     8252824.827271
+193242.507058     8252835.178219
+193254.303559     8252840.994265
+193266.755939     8252844.941804
+193280.409470     8252852.038231
+193291.508844     8252862.225899
+193302.527988     8252877.421361
+193309.177203     8252891.923804
+193309.428139     8252915.092675
+193308.559667     8252930.105654
+193304.573037     8252944.444829
+193296.165873     8252961.219894
+193287.718976     8252980.498861
+193276.758405     8253000.365943
+193270.924877     8253012.798192
+193265.112368     8253023.978125
+193259.863846     8253038.923867
+193250.124682     8253060.687509
+193240.426015     8253079.947261
+193235.177494     8253094.893002
+193225.559807     8253109.145737
+193213.954267     8253130.254028
+193204.306205     8253146.384872
+193195.141926     8253171.287789
+193190.499430     8253187.494707
+193185.250909     8253202.440448
+193175.653477     8253215.440855
+193162.180785     8253235.894547
+193145.650660     8253251.919746
+193129.746052     8253267.953783
+193116.353577     8253283.400446
+193107.997794     8253297.045851
+193097.209331     8253306.271588
+193085.715136     8253320.495517
+193072.979303     8253334.073685
+193054.541542     8253351.947412
+193040.554704     8253365.506375
+193029.090120     8253377.852183
+193015.819887     8253385.787950
+193003.144794     8253395.610664
+192991.670089     8253408.582253
+192979.045601     8253415.276059
+192966.380629     8253424.472990
+192957.398579     8253438.108781
+192946.610880     8253447.334531
+192952.019222     8253461.191224
+192965.046475     8253468.278801
+192980.001631     8253472.264760
+192998.014206     8253480.679975
+193023.493838     8253491.715092
+193053.796806     8253514.093410
+193077.247324     8253534.487962
+193101.706643     8253569.924309
+193125.066797     8253595.953200
+193141.746609     8253609.356982
+193157.215911     8253620.237669
+193177.579397     8253638.081085
+193197.942132     8253655.923725
+193216.235994     8253685.631231
+193228.465660     8253703.349023
+193240.796549     8253714.808234
+193253.753705     8253726.277059
+193270.474013     8253737.176950
+193296.396932     8253759.488030
+193314.822405     8253781.058083
+193328.888847     8253801.308583
+193336.789833     8253815.830241
+193348.464092     8253829.157184
+193359.533853     8253841.222973
+193376.142805     8253859.007990
+193397.172291     8253874.357117
+193415.103873     8253887.780114
+193426.143259     8253901.724012
+193438.413409     8253916.938677
+193446.344006     8253929.582215
+193459.178921     8253948.561936
+193472.024732     8253966.915123
+193488.623551     8253985.326686
+193503.890369     8254008.726826
+193516.715162     8254028.332329
+193527.582452     8254052.916807
+193539.690628     8254078.146271
+193553.029567     8254104.646502
+193568.154665     8254136.809114
+193582.109738     8254163.945504
+193597.809722     8254199.247390
+193616.113717     8254228.328351
+193645.002940     8254260.702251
+193670.048030     8254298.652104
+193690.248777     8254326.510306
+193703.760576     8254342.369969
+193719.723770     8254361.397711
+193735.788200     8254374.166109
+193764.829277     8254397.150993
+193773.426625     8254407.301017
+193788.067953     8254430.690792
+193792.042296     8254455.795396
+193804.150471     8254481.024859
+193810.133699     8254498.020827
+193809.910972     8254511.791844
+193809.597144     8254531.195660
+193803.622647     8254552.391156
+193796.527229     8254565.429970
+193789.402198     8254580.346906
+193781.651664     8254595.254240
+193767.018316     8254610.055153
+193751.739198     8254626.099556
+193734.522844     8254645.869843
+193719.919859     8254658.793412
+193707.779918     8254674.259302
+193703.167021     8254688.588863
+193694.861857     8254699.104596
+193682.832509     8254707.685348
+193668.804410     8254723.748190
+193647.965872     8254735.324165
+193619.679744     8254743.029427
+193597.650187     8254750.829967
+193579.313662     8254762.444349
+193558.494615     8254772.767985
+193544.598879     8254780.694149
+193533.164670     8254791.161848
+193520.469323     8254802.236889
+193501.537658     8254811.964324
+193485.754539     8254820.486689
+193473.180669     8254824.050822
+193453.714628     8254828.134328
+193427.376658     8254831.485644
+193412.289878     8254835.637903
+193399.695791     8254840.452071
+193387.101679     8254845.267768
+193358.190047     8254852.963428
+193334.847982     8254864.500207
+193314.019565     8254875.450400
+193292.504130     8254890.147197
+193267.113459     8254912.295750
+193246.799176     8254930.141435
+193222.125111     8254946.666792
+193205.675980     8254957.684210
+193186.703831     8254969.914772
+193173.402483     8254979.727107
+193158.891377     8254987.017125
+193139.415202     8254991.727176
+193119.333003     8254995.176051
+193092.944415     8255001.657039
+193071.601076     8255005.713256
+193050.318513     8255006.011726
+193030.287695     8255006.330941
+193000.770064     8255012.763896
+192969.931305     8255023.560423
+192931.522702     8255037.997898
+192902.570586     8255048.196685
+192879.915514     8255055.988387
+192864.838892     8255059.512573
+192843.384209     8255070.453152
+192822.606410     8255078.273672
+192801.202344     8255086.084579
+192784.198595     8255092.709631
+192771.553865     8255100.654999
+192755.184964     8255106.664624
+192740.098973     8255110.815367
+192725.062836     8255111.836426
+192709.350553     8255115.979083
+192686.725856     8255121.892677
+192671.023731     8255125.407260
+192652.193302     8255128.875351
+192638.983057     8255133.054888
+192607.578782     8255140.085583
+192585.579589     8255146.008778
+192575.427502     8255154.619112
+192564.548701     8255169.477660
+192554.931015     8255183.730395
+192545.928723     8255198.617749
+192541.326723     8255212.320777
+192531.769764     8255222.818821
+192515.713314     8255248.241111
+192506.670513     8255265.633120
+192496.477941     8255276.746580
+192483.721867     8255291.576311
+192471.641888     8255303.287500
+192465.697016     8255322.604111
+192464.152411     8255340.737924
+192469.549881     8255355.219623
+192481.356503     8255360.409887
+192494.383755     8255367.497465
+192508.622293     8255377.107385
+192517.804661     8255389.770138
+192520.679851     8255405.466521
+192520.447004     8255419.863319
+192523.826219     8255443.080212
+192523.623747     8255455.598902
+192524.026537     8255469.378756
+192528.789134     8255484.477411
+192531.563088     8255506.433139
+192530.692450     8255560.264114
+192530.994004     8255580.303314
+192531.346176     8255597.212841
+192531.082953     8255613.487748
+192530.698252     8255637.273564
+192526.488908     8255665.382992
+192521.633819     8255694.734381
+192516.415661     8255707.802777
+192514.962183     8255720.302263
+192508.310814     8255744.617053
+192493.525612     8255768.806984
+192479.346411     8255794.259619
+192458.132529     8255828.995616
+192437.767653     8255849.969445
+192428.139858     8255864.847197
+192420.368306     8255881.006847
+192393.595017     8255911.273650
+192368.526117     8255952.211368
+192356.395546     8255967.050701
+192340.541543     8255979.955830
+192321.458024     8255999.072282
+192302.838810     8256028.212382
+192283.017680     8256054.203583
+192270.806879     8256074.050709
+192258.564938     8256095.775932
+192246.928258     8256118.762320
+192229.610644     8256144.793480
+192214.048085     8256178.362826
+192204.369673     8256196.370250
+192192.299828     8256207.454893
+192181.491887     8256217.932206
+192171.924818     8256229.055268
+192160.520961     8256237.646386
+192148.420766     8256250.607610
+192131.657794     8256281.029608
+192100.918117     8256324.384023
+192073.629931     8256347.755323
+192059.531723     8256368.200177
+192052.395807     8256383.742883
+192043.384146     8256399.256794
+192042.555407     8256411.765870
+192024.531321     8256442.793681
+192011.623368     8256467.013957
+191996.232905     8256489.942723
+191976.453023     8256513.430808
+191953.301906     8256551.892689
+191944.218620     8256571.787824
+191934.661686     8256582.284341
+191921.784108     8256604.626508
+191908.866047     8256629.471802
+191896.573488     8256654.326697
+191879.255898     8256680.356329
+191869.001836     8256695.224468
+191849.948693     8256712.462811
+191826.475780     8256732.137055
+191808.643268     8256751.272711
+191794.030926     8256764.822073
+191784.413240     8256779.074808
+191774.623458     8256803.968122
+191760.625722     8256818.153620
+191752.300315     8256829.920916
+191744.629998     8256839.821220
+191733.872675     8256847.168861
+191717.595640     8256847.545698
+191701.934000     8256848.557155
+191685.667099     8256848.307446
+191672.527713     8256848.105748
+191656.876206     8256848.490659
+191641.234808     8256848.250552
+191630.941001     8256865.623357
+191630.515815     8256891.912299
+191630.100739     8256917.576224
+191623.499988     8256938.761342
+191610.088010     8256955.461108
+191596.161922     8256965.263854
+191576.008863     8256973.093964
+191562.022024     8256986.652928
+191545.542518     8256999.548455
+191533.513182     8257008.128443
+191518.778574     8257029.190229
+191503.327385     8257055.873684
+191495.648687     8257091.413528
+END
+LINE3D
+HEIGHT 1080.000000
+183557.000000     8247520.567119
+183561.211203     8247524.915206
+183578.527564     8247537.703699
+183601.565616     8247544.945234
+183621.475436     8247552.139000
+183638.266926     8247558.658439
+183657.601475     8247562.712480
+183668.852931     8247563.511614
+183668.842846     8247564.137786
+183669.448365     8247565.399377
+183673.182116     8247566.708739
+183678.792720     8247568.047372
+183686.300537     8247568.162937
+183698.248239     8247564.590411
+183708.329167     8247560.362825
+183720.286954     8247556.164128
+183731.568652     8247555.085511
+183735.332639     8247554.517504
+183742.214773     8247554.623438
+183750.973765     8247554.758262
+183761.508995     8247561.181401
+183764.536408     8247567.488976
+183768.149177     8247576.310103
+183771.771841     8247584.505055
+183778.573326     8247589.618451
+183782.932754     8247590.937826
+183790.440380     8247591.053387
+183804.951306     8247583.763503
+183834.568211     8247571.071491
+183867.293374     8247559.679212
+183886.133295     8247555.586449
+183901.885312     8247548.941995
+183924.569874     8247539.273381
+183953.490717     8247530.953414
+183986.750640     8247525.204397
+184013.784354     8247517.481326
+184034.602137     8247507.158033
+184059.799320     8247496.902150
+184095.682760     8247483.680270
+184132.757267     8247474.233537
+184161.637598     8247468.417107
+184179.266670     8247461.801163
+184193.737078     8247457.015197
+184210.185347     8247445.998702
+184232.264384     8247435.068878
+184255.604872     8247423.532145
+184271.447622     8247411.254057
+184276.513191     8247407.575598
+184277.148959     8247406.959057
+184286.705010     8247396.462799
+184301.992646     8247379.793408
+184317.875724     8247365.011399
+184328.057464     8247354.524389
+184340.116057     8247344.066652
+184359.167687     8247326.828872
+184378.279795     8247305.835973
+184394.990180     8247278.544749
+184408.642903     8247246.824083
+184425.403502     8247216.403145
+184441.528525     8247186.598750
+184450.539738     8247171.085020
+184463.990646     8247151.883197
+184492.547921     8247127.278870
+184515.969057     8247110.734675
+184533.648345     8247100.989017
+184548.855518     8247089.327473
+184565.888958     8247080.824145
+184582.852020     8247076.702492
+184598.503225     8247076.317461
+184617.292740     8247075.354409
+184641.702937     8247075.104201
+184661.743818     8247074.160412
+184680.533333     8247073.197360
+184693.066397     8247072.138005
+184706.911122     8247067.342409
+184720.675389     8247067.554277
+184734.459629     8247066.514181
+184746.367195     8247065.445580
+184755.772034     8247064.338074
+184772.109222     8247060.206788
+184785.257884     8247059.783235
+184786.569742     8247056.046614
+184791.201172     8247040.465468
+184791.513687     8247021.061410
+184792.340995     8247008.552196
+184793.844391     8246992.922901
+184795.367760     8246976.041642
+184799.403941     8246958.573117
+184808.344394     8246947.441057
+184828.455845     8246942.115595
+184854.329117     8246928.739632
+184880.686743     8246924.136641
+184896.428681     8246918.117976
+184907.074801     8246917.655903
+184917.771334     8246914.063737
+184935.915002     8246914.343016
+184956.551127     8246915.286986
+184972.696967     8246923.048377
+184995.684606     8246933.420005
+185014.847583     8246948.115138
+185030.186273     8246967.134164
+185043.083096     8246982.359171
+185055.313725     8247000.078085
+185066.888236     8247019.665115
+185075.365147     8247037.326249
+185086.253676     8247060.659534
+185094.780992     8247075.190956
+185107.667355     8247091.041747
+185126.194755     8247106.353424
+185143.410304     8247125.401340
+185163.118506     8247145.113569
+185180.182837     8247173.550618
+185195.350145     8247203.210739
+185208.721242     8247227.834509
+185217.823645     8247245.505271
+185229.378375     8247266.344268
+185247.037956     8247296.668696
+185258.582601     8247318.133864
+185264.566857     8247335.130685
+185271.792402     8247352.772557
+185276.575698     8247366.620405
+185285.758749     8247379.283705
+185292.449153     8247391.282310
+185305.295570     8247409.637029
+185329.332577     8247432.546376
+185358.031823     8247437.997218
+185389.929488     8247439.114151
+185409.829230     8247446.933706
+185428.457448     8247455.985578
+185445.228965     8247463.756981
+185463.261545     8247470.921851
+185480.608154     8247481.832212
+185501.648365     8247496.556623
+185516.452296     8247509.932387
+185526.856089     8247524.492694
+185537.845812     8247541.566562
+185547.624113     8247556.117240
+185557.412493     8247570.042129
+185564.113357     8247581.414951
+185568.967223     8247590.881126
+185576.263331     8247604.141708
+185589.149694     8247619.992499
+185607.656936     8247636.555755
+185629.888029     8247655.054928
+185651.493254     8247673.544086
+185670.040818     8247687.603802
+185684.945179     8247694.720138
+185698.023462     8247698.678261
+185711.706699     8247703.897585
+185735.410947     8247708.645214
+185758.539344     8247710.253491
+185782.939653     8247710.629076
+185807.410532     8247706.622988
+185832.577472     8247698.244856
+185863.314499     8247693.709276
+185892.225454     8247686.015101
+185913.577804     8247681.335066
+185931.812396     8247675.980715
+185953.144583     8247672.552641
+185983.801343     8247673.024529
+186016.334961     8247673.525306
+186043.156973     8247678.946870
+186067.496797     8247683.077955
+186090.534461     8247690.319867
+186118.607839     8247695.760692
+186125.470000     8247697.118590
+186126.095492     8247697.128218
+186126.085414     8247697.754008
+186126.691124     8247699.015603
+186136.600480     8247705.429108
+186157.812079     8247709.512042
+186187.772395     8247714.355968
+186227.692472     8247722.483688
+186258.198014     8247732.344710
+186273.728249     8247739.470680
+186287.381619     8247746.568142
+186310.339023     8247758.817139
+186343.326751     8247769.968639
+186373.811747     8247781.081616
+186390.603428     8247787.601058
+186401.098336     8247796.527738
+186405.982445     8247804.116163
+186409.625647     8247811.059542
+186410.866553     8247811.704588
+186414.540004     8247816.769835
+186421.290892     8247825.012939
+186436.770715     8247835.269002
+186456.004643     8247845.582469
+186485.954880     8247851.052185
+186502.140844     8247856.310414
+186507.045116     8247862.646878
+186508.286404     8247863.291930
+186511.889285     8247872.738849
+186514.836050     8247884.053885
+186515.249833     8247897.208530
+186518.721278     8247914.792617
+186522.062050     8247940.513882
+186525.129784     8247944.317917
+186528.207604     8247947.495780
+186538.833567     8247948.285286
+186547.531884     8247952.175607
+186556.805662     8247959.205656
+186569.157266     8247969.413186
+186582.689667     8247984.021650
+186586.928119     8247992.852408
+186587.462878     8247998.495669
+186596.585445     8248014.914470
+186607.554622     8248033.240293
+186619.200085     8248048.445657
+186630.149098     8248068.023441
+186651.593020     8248096.527904
+186677.497188     8248120.091937
+186703.582811     8248132.389467
+186730.939582     8248143.454292
+186755.198758     8248152.592840
+186778.176319     8248163.590257
+186802.364537     8248177.110853
+186827.834752     8248188.772584
+186852.689172     8248199.798891
+186872.498186     8248213.251697
+186885.434955     8248225.972777
+186895.303984     8248234.890204
+186900.813972     8248242.487881
+186910.128078     8248247.014008
+186914.487506     8248248.333383
+186915.102920     8248248.968800
+186915.728794     8248248.978434
+186916.354286     8248248.988062
+186916.979779     8248248.997690
+186917.595568     8248249.633495
+186929.321298     8248259.831391
+186938.574919     8248268.113019
+186942.883941     8248272.562104
+186954.599967     8248283.386178
+186975.528906     8248304.995795
+187008.910643     8248330.553525
+187031.787398     8248347.809984
+187044.128911     8248358.644067
+187057.731881     8248368.870858
+187073.211710     8248379.126540
+187085.482659     8248394.341913
+187090.316368     8248405.059668
+187098.318616     8248413.322416
+187101.900958     8248424.020908
+187106.745127     8248434.112879
+187114.666721     8248447.383471
+187118.198657     8248461.211675
+187123.082771     8248468.799718
+187126.039609     8248479.489346
+187129.632411     8248489.562055
+187129.561848     8248493.943345
+187129.299727     8248510.218456
+187129.037618     8248526.492802
+187127.725767     8248530.229041
+187127.655203     8248534.610331
+187128.119386     8248544.635647
+187133.558811     8248556.614614
+187138.463083     8248562.951078
+187139.593468     8248570.482106
+187140.592804     8248586.149924
+187140.532319     8248589.905425
+187140.481913     8248593.035136
+187139.856039     8248593.025502
+187129.089318     8248600.999347
+187118.443198     8248601.461420
+187106.545711     8248601.904231
+187091.540538     8248601.047318
+187080.218137     8248604.629468
+187069.411101     8248615.106470
+187059.158600     8248629.975149
+187047.604708     8248647.954283
+187033.013325     8248660.251633
+187016.423731     8248680.031088
+186996.060632     8248701.005113
+186976.332722     8248721.362970
+186958.038027     8248730.472829
+186946.059885     8248735.923484
+186934.061586     8248742.625718
+186920.196889     8248748.673278
+186910.085527     8248754.778612
+186894.303262     8248763.301199
+186879.056150     8248777.466289
+186854.968818     8248796.504390
+186819.610243     8248815.995706
+186787.985228     8248836.796380
+186757.732561     8248850.104551
+186730.002402     8248862.199660
+186699.850548     8248869.248408
+186676.530217     8248879.533562
+186658.235522     8248888.643421
+186643.724411     8248895.932920
+186634.905125     8248899.553600
+186630.404552     8248906.997953
+186624.087616     8248910.657150
+186619.687867     8248911.841316
+186609.597045     8248916.695077
+186599.515932     8248920.922279
+186581.160740     8248933.788402
+186558.980897     8248950.977266
+186541.271367     8248962.600675
+186529.797748     8248975.571959
+186520.261855     8248984.816638
+186519.616192     8248986.059354
+186515.801990     8248989.757075
+186510.029893     8248998.433744
+186499.858428     8249008.294585
+186491.482786     8249023.192154
+186486.235763     8249038.137116
+186481.634377     8249051.840891
+186480.151533     8249066.217848
+186479.929739     8249079.989037
+186484.743277     8249091.959134
+186491.918422     8249112.730336
+186497.872436     8249131.604907
+186503.220733     8249149.218265
+186506.581663     8249173.687952
+186515.946644     8249213.901729
+186519.902818     8249240.259176
+186524.655871     8249255.984774
+186529.923909     8249278.605218
+186533.960355     8249299.954816
+186537.442267     8249316.912737
+186544.122585     8249329.537514
+186553.901262     8249344.088580
+186577.433746     8249359.477298
+186595.426005     8249369.145708
+186610.905834     8249379.401389
+186634.458869     8249393.537770
+186656.174979     8249405.142097
+186681.705303     8249413.047940
+186714.743432     8249421.070111
+186743.382206     8249430.275689
+186767.701478     8249435.659112
+186796.380567     8249442.361532
+186833.778130     8249451.702696
+186865.504420     8249463.460342
+186887.331420     8249468.179457
+186912.932308     8249471.704009
+186947.272221     8249476.614966
+186985.366222     8249481.584473
+187020.271143     8249490.260560
+187052.078457     8249497.011132
+187088.900551     8249503.212950
+187116.368601     8249507.392187
+187143.836269     8249511.571418
+187168.236578     8249511.947003
+187190.749555     8249512.920245
+187216.401231     8249513.315092
+187237.047441     8249513.632891
+187258.410258     8249508.326690
+187279.692039     8249508.028328
+187299.712756     8249508.336499
+187322.175340     8249512.438689
+187349.613141     8249518.496058
+187374.578458     8249522.636772
+187397.081369     8249524.235040
+187419.604819     8249524.581734
+187453.480155     8249519.468135
+187486.154901     8249511.206332
+187511.967885     8249501.585490
+187532.795549     8249490.636787
+187546.075082     8249482.075677
+187558.698873     8249475.383071
+187582.654775     8249464.481755
+187614.855258     8249446.820426
+187647.691312     8249428.542935
+187679.820838     8249415.263654
+187701.879711     8249405.585792
+187701.889790     8249404.960002
+187712.031018     8249396.976530
+187732.323923     8249380.384565
+187753.242333     8249363.801465
+187771.032887     8249347.170983
+187790.730167     8249328.691252
+187812.264359     8249312.744339
+187832.456083     8249302.411027
+187845.685591     8249296.979634
+187855.241642     8249286.483375
+187867.320214     8249274.773292
+187876.835938     8249266.780955
+187881.296184     8249261.840525
+187882.547551     8249261.859787
+187883.183122     8249261.243625
+187886.381923     8249256.909722
+187891.468031     8249251.979690
+187892.154008     8249248.233817
+187901.629417     8249242.744639
+187911.084668     8249238.507039
+187912.336034     8249238.526301
+187912.961527     8249238.535929
+187917.331027     8249239.229896
+187924.142406     8249243.717117
+187933.406112     8249251.372573
+187940.853432     8249255.244403
+187953.245363     8249262.948011
+187975.011879     8249271.422627
+187991.833808     8249276.063937
+188005.527511     8249280.657095
+188010.522504     8249281.360690
+188011.844447     8249276.997898
+188015.688897     8249271.422044
+188015.698976     8249270.796254
+188015.769540     8249266.414964
+188015.910679     8249257.651620
+188015.920758     8249257.025830
+188003.669966     8249240.558878
+187993.861422     8249227.885950
+187993.296045     8249224.120051
+187988.401852     8249217.157797
+187987.867093     8249211.514536
+187987.422673     8249200.238400
+187986.938320     8249191.465427
+187987.018975     8249186.457583
+187987.220599     8249173.938738
+187987.916654     8249169.567076
+187994.879633     8249164.665169
+188008.189402     8249154.226690
+188024.022073     8249142.574392
+188041.691276     8249133.454906
+188063.104499     8249125.018994
+188090.118050     8249118.547884
+188112.166845     8249109.495811
+188129.916689     8249095.369245
+188143.943078     8249079.306003
+188158.554619     8249065.757074
+188176.244361     8249055.386015
+188192.046796     8249045.611085
+188207.768564     8249040.844763
+188224.751408     8249035.471144
+188242.360508     8249030.107164
+188260.574930     8249026.005155
+188278.818837     8249020.025002
+188298.981076     8249011.569834
+188325.429237     8249001.333590
+188355.601644     8248993.032505
+188379.577321     8248980.879604
+188400.465864     8248966.174642
+188418.155606     8248955.803583
+188431.990067     8248951.633390
+188448.397825     8248943.120432
+188467.933795     8248934.656388
+188487.450384     8248927.443172
+188500.659341     8248923.264116
+188508.862844     8248919.007248
+188513.262975     8248917.823089
+188522.708135     8248914.212043
+188534.060021     8248908.751748
+188543.454775     8248908.270413
+188556.038251     8248904.080965
+188561.669209     8248904.167640
+188562.920958     8248904.186908
+188567.310246     8248903.628526
+188567.935739     8248903.638154
+188572.315712     8248903.705573
+188578.511678     8248907.557377
+188590.277340     8248915.252109
+188602.729756     8248919.200217
+188608.280060     8248924.294736
+188612.013620     8248925.604094
+188619.501661     8248926.971244
+188635.707782     8248930.977894
+188648.220683     8248931.170501
+188656.455186     8248925.036277
+188660.299637     8248919.460423
+188664.123930     8248915.136148
+188664.144087     8248913.884569
+188664.154166     8248913.258780
+188664.779658     8248913.268408
+188672.287857     8248913.383979
+188682.923517     8248913.547689
+188696.061910     8248913.749923
+188709.109570     8248919.585791
+188722.723001     8248929.186799
+188736.971252     8248938.170870
+188749.343013     8248947.126820
+188761.785338     8248951.701481
+188771.675300     8248959.366577
+188779.092001     8248965.115769
+188788.365786     8248972.145436
+188798.880477     8248979.820149
+188810.707388     8248983.759392
+188818.205508     8248984.500752
+188830.728488     8248984.067569
+188842.705866     8248978.616902
+188856.490684     8248977.576433
+188865.875360     8248977.720888
+188877.762768     8248977.903866
+188894.019295     8248978.780805
+188908.903881     8248987.148726
+188925.715337     8248992.416584
+188940.044993     8248996.393587
+188953.788721     8248997.857028
+188966.231046     8249002.431688
+188972.477418     8249003.153781
+188973.092831     8249003.789198
+188973.718323     8249003.798826
+188974.970072     8249003.818094
+188978.098297     8249003.866246
+188978.723789     8249003.875874
+188982.467428     8249004.559442
+188985.535156     8249008.363859
+188990.480137     8249012.196407
+188995.424354     8249016.028943
+189002.922474     8249016.770304
+189009.178925     8249016.866607
+189020.500562     8249013.284444
+189031.772557     8249012.832005
+189036.788101     8249012.283263
+189038.039086     8249012.302519
+189041.792803     8249012.360299
+189045.496115     8249015.547789
+189046.112292     8249016.183219
+189049.230438     8249016.857160
+189065.941082     8249028.384440
+189088.312933     8249038.120263
+189097.647202     8249041.394429
+189098.878793     8249042.665275
+189101.996940     8249043.339217
+189105.700251     8249046.526707
+189110.634377     8249050.985797
+189111.260633     8249050.995437
+189118.697505     8249055.492286
+189119.948489     8249055.511542
+189121.200238     8249055.530810
+189121.825730     8249055.540438
+189123.056557     8249056.811273
+189126.174691     8249057.485978
+189126.164612     8249058.111767
+189126.730384     8249061.876908
+189129.858609     8249061.925059
+189130.463944     8249063.186266
+189131.039030     8249066.325605
+189135.357743     8249070.149278
+189135.963841     8249071.410496
+189136.528849     8249075.175625
+189136.518770     8249075.801415
+189136.508679     8249076.427968
+189136.438115     8249080.809259
+189136.206243     8249095.206236
+189136.145758     8249098.961737
+189135.510187     8249099.577899
+189130.898341     8249113.907457
+189125.712184     8249125.096924
+189124.450357     8249125.703446
+189120.615985     8249130.653510
+189116.125885     8249137.471315
+189110.959122     8249147.409191
+189110.878468     8249152.417035
+189106.428694     8249156.730918
+189099.990777     8249167.901881
+189086.084989     8249176.453352
+189081.645295     8249180.141445
+189077.214915     8249183.203737
+189075.943773     8249184.436060
+189075.933682     8249185.062614
+189075.923603     8249185.688403
+189075.913524     8249186.314193
+189075.903446     8249186.939982
+189077.134261     8249188.211581
+189077.760517     8249188.221221
+189078.386009     8249188.230849
+189079.011501     8249188.240477
+189078.386009     8249188.230849
+189077.124182     8249188.837371
+189075.863118     8249189.443904
+189072.018668     8249195.019758
+189071.312533     8249200.017210
+189070.050694     8249200.624496
+189069.334481     8249206.247737
+189068.618255     8249211.871742
+189068.527522     8249217.505375
+189072.220754     8249221.318656
+189078.416720     8249225.170460
+189078.981715     8249228.936352
+189083.361689     8249229.003772
+189088.366391     8249229.080807
+189097.730909     8249230.476841
+189110.243809     8249230.669447
+189119.083647     8249225.796430
+189123.553578     8249220.230968
+189131.858657     8249209.714690
+189135.773671     8249199.757546
+189141.616332     8249186.699586
+189150.607388     8249172.437435
+189154.492154     8249164.358424
+189158.346683     8249158.156780
+189166.550950     8249153.899925
+189175.481509     8249143.394039
+189185.652973     8249133.533198
+189197.035108     8249126.194771
+189206.500425     8249121.332146
+189221.596714     8249116.555432
+189229.750562     8249115.429052
+189237.883489     8249115.554239
+189247.207680     8249119.454194
+189250.952082     8249120.137775
+189257.137969     8249124.615368
+189267.622411     8249134.168213
+189279.994173     8249143.124164
+189293.566513     8249155.229082
+189313.950995     8249171.821233
+189348.099364     8249188.625247
+189390.805279     8249218.083696
+189437.618228     8249264.508925
+189487.145601     8249297.828807
+189521.687601     8249329.038662
+189545.745147     8249350.696437
+189553.727620     8249360.210769
+189558.722243     8249360.913594
+189561.800062     8249364.091457
+189565.503374     8249367.278948
+189582.295436     8249373.798396
+189615.071074     8249398.094908
+189648.301592     8249433.041772
+189672.934224     8249457.838886
+189678.464370     8249464.184984
+189679.089862     8249464.194612
+189679.079784     8249464.820401
+189683.449678     8249465.513610
+189688.968982     8249472.485486
+189697.001861     8249478.870107
+189711.200457     8249490.984665
+189719.252730     8249496.117696
+189719.817737     8249499.882825
+189720.443993     8249499.892464
+189723.521812     8249503.070327
+189724.147305     8249503.079955
+189727.265451     8249503.753896
+189728.496266     8249505.025495
+189732.189499     8249508.838775
+189733.441247     8249508.858043
+189737.144558     8249512.045534
+189740.777306     8249519.614315
+189742.008885     8249520.885926
+189743.169148     8249526.538051
+189742.987682     8249537.805317
+189742.896948     8249543.438951
+189741.575400     8249547.800985
+189735.863788     8249552.722154
+189723.825161     8249561.928309
+189714.309437     8249569.920646
+189705.489757     8249573.542084
+189693.461222     8249582.121686
+189683.925328     8249591.366366
+189683.824516     8249597.625788
+189683.501910     8249617.656399
+189686.539402     8249623.338184
+189694.027443     8249624.705334
+189708.406742     8249625.552614
+189722.867447     8249621.392825
+189727.327311     8249616.452389
+189736.237712     8249607.198082
+189743.341437     8249593.533588
+189750.950447     8249587.389736
+189761.707089     8249580.041681
+189773.685219     8249574.591790
+189787.539837     8249569.170019
+189795.068206     8249568.033247
+189801.950148     8249568.139178
+189824.967649     8249576.633050
+189852.889803     8249591.463392
+189870.751395     8249609.268599
+189888.552491     8249630.830070
+189901.489259     8249643.551150
+189922.539562     8249657.649007
+189944.295999     8249666.749413
+189973.509465     8249679.095089
+189996.517650     8249688.214762
+190014.015095     8249689.735983
+190037.699179     8249695.735573
+190071.403509     8249701.263456
+190109.507219     8249705.606403
+190132.010130     8249707.204671
+190138.892072     8249707.310602
+190139.518328     8249707.320242
+190140.143821     8249707.329870
+190140.759234     8249707.965287
+190141.374635     8249708.601469
+190142.000128     8249708.611097
+190142.626384     8249708.620737
+190143.251876     8249708.630365
+190143.877368     8249708.639992
+190151.384803     8249708.755552
+190174.544219     8249708.485327
+190204.574722     8249708.947575
+190235.231482     8249709.419462
+190245.241650     8249709.573545
+190252.759927     8249709.063326
+190260.327847     8249705.423385
+190274.717988     8249705.644886
+190289.107366     8249705.866377
+190305.939755     8249709.881903
+190329.623075     8249715.881481
+190360.844842     8249720.118498
+190384.549083     8249724.866509
+190412.632546     8249729.681163
+190441.936745     8249736.393206
+190471.736140     8249751.252443
+190498.346837     8249769.818266
+190522.504431     8249785.216606
+190539.821173     8249798.005105
+190551.638006     8249802.570138
+190559.135362     8249803.311486
+190570.326715     8249807.866127
+190584.030115     8249811.833490
+190597.077775     8249817.669357
+190607.694029     8249819.085423
+190618.793885     8249829.273685
+190637.391860     8249840.203307
+190654.638027     8249857.373860
+190676.828423     8249878.376186
+190694.084680     8249894.920186
+190708.838193     8249911.426426
+190721.109155     8249926.641035
+190724.661248     8249939.217660
+190728.869070     8249949.926545
+190729.767976     8249971.853792
+190730.625791     8249996.284949
+190731.402964     8250025.723186
+190731.100528     8250044.501454
+190730.626716     8250073.920436
+190730.344438     8250091.447125
+190731.414719     8250102.733659
+190737.863178     8250129.754649
+190747.399521     8250159.328477
+190756.461603     8250179.502779
+190771.770045     8250200.399937
+190789.520746     8250225.090356
+190810.944499     8250254.847162
+190834.901232     8250282.764360
+190847.061291     8250304.864945
+190858.080504     8250320.060287
+190870.331284     8250336.528004
+190870.886976     8250340.918934
+190872.087555     8250344.067901
+190881.159715     8250363.616413
+190885.327222     8250376.828456
+190885.317131     8250377.455009
+190885.630873     8250396.868706
+190889.031748     8250418.834465
+190891.726489     8250445.797676
+190892.594383     8250469.603044
+190893.563852     8250487.149001
+190894.562807     8250502.816814
+190897.883040     8250529.789652
+190898.327065     8250541.066547
+190901.900092     8250552.390841
+190907.904513     8250568.135701
+190918.762417     8250593.346730
+190931.487471     8250619.213209
+190945.524770     8250641.342690
+190957.795731     8250656.557300
+190962.104365     8250661.006761
+190963.335956     8250662.277608
+190966.978783     8250669.220600
+190970.672003     8250673.034644
+190973.739744     8250676.838296
+190980.520874     8250683.203650
+190980.500717     8250684.455229
+190985.425528     8250689.540120
+190985.980457     8250693.931038
+190995.203836     8250704.090417
+191009.261292     8250724.968319
+191018.999272     8250742.022538
+191018.989181     8250742.649091
+191019.534031     8250747.665799
+191023.692211     8250761.504406
+191028.495289     8250774.100287
+191033.278973     8250787.947759
+191033.137834     8250796.711103
+191036.064435     8250809.278100
+191039.697183     8250816.846882
+191044.005817     8250821.296343
+191051.312391     8250833.930760
+191054.380132     8250837.734412
+191058.133849     8250837.792192
+191066.207056     8250841.672891
+191069.900288     8250845.486171
+191077.337147     8250849.983785
+191081.000144     8250855.674434
+191085.269214     8250862.627829
+191093.857022     8250873.403369
+191100.617995     8250881.020302
+191104.291058     8250886.085925
+191108.619862     8250889.283044
+191109.246118     8250889.292683
+191117.379045     8250889.417870
+191121.759018     8250889.485290
+191122.384511     8250889.494918
+191123.010003     8250889.504546
+191122.999924     8250890.130335
+191123.625417     8250890.139963
+191123.615338     8250890.765752
+191124.240830     8250890.775380
+191124.230739     8250891.401934
+191131.103367     8250892.133666
+191135.432170     8250895.330785
+191136.673076     8250895.975831
+191144.171196     8250896.717191
+191152.859804     8250901.234072
+191161.598066     8250902.620466
+191169.681351     8250905.875376
+191182.749180     8250910.458900
+191196.372690     8250919.434119
+191209.834139     8250938.424249
+191225.717666     8250962.460747
+191242.045996     8250997.773387
+191258.222343     8251042.475149
+191273.298924     8251077.768521
+191276.820769     8251092.223279
+191283.521245     8251103.596476
+191295.651067     8251127.574430
+191310.122313     8251161.606596
+191322.887707     8251184.968388
+191330.779446     8251200.116354
+191343.494421     8251226.608623
+191355.644401     8251249.334998
+191356.825586     8251253.735556
+191357.995916     8251258.762655
+191364.696404     8251270.135089
+191364.645998     8251273.264800
+191369.540561     8251280.227824
+191373.829050     8251285.928100
+191373.778644     8251289.057812
+191374.404136     8251289.067440
+191378.552237     8251303.531837
+191382.739901     8251315.492300
+191383.314988     8251318.631640
+191384.476003     8251324.284541
+191388.703994     8251333.741082
+191389.885179     8251338.141640
+191393.548163     8251343.833053
+191394.778990     8251345.103888
+191404.728674     8251349.013471
+191414.052852     8251352.914191
+191424.689276     8251353.077913
+191432.822203     8251353.203100
+191449.099676     8251352.826944
+191466.708000     8251347.463717
+191483.691607     8251342.090109
+191502.460958     8251342.379018
+191523.802854     8251338.324385
+191541.401863     8251333.586959
+191551.482607     8251329.358987
+191563.370015     8251329.541966
+191576.528566     8251328.492621
+191584.672335     8251327.992030
+191593.431519     8251328.126857
+191594.682503     8251328.146113
+191602.169781     8251329.513251
+191606.539675     8251330.206460
+191610.293393     8251330.264239
+191611.544378     8251330.283495
+191615.278689     8251331.593629
+191615.904181     8251331.603257
+191622.160632     8251331.699560
+191623.401537     8251332.344606
+191627.044364     8251339.287598
+191630.637548     8251349.360312
+191634.159393     8251363.815070
+191638.377306     8251373.897401
+191638.357136     8251375.149744
+191638.336979     8251376.401323
+191638.316822     8251377.652902
+191630.547265     8251393.812453
+191619.678981     8251408.044944
+191618.427997     8251408.025688
+191609.668813     8251407.890862
+191604.047934     8251407.178397
+191599.043232     8251407.101362
+191593.977282     8251410.779815
+191590.213485     8251411.347825
+191578.174859     8251420.553981
+191562.927353     8251434.719829
+191558.376767     8251445.293134
+191558.275955     8251451.552557
+191563.059627     8251465.400793
+191567.176728     8251481.742546
+191566.985183     8251493.635602
+191567.449378     8251503.660154
+191570.981314     8251517.488358
+191570.789769     8251529.381414
+191571.395855     8251530.643396
+191577.511178     8251539.502280
+191577.450681     8251543.258545
+191580.578906     8251543.306696
+191587.390286     8251547.793918
+191590.508432     8251548.467859
+191591.053270     8251553.485331
+191595.200619     8251567.948952
+191596.321307     8251576.105775
+191597.421073     8251585.514165
+191601.599423     8251598.100429
+191605.777009     8251610.686682
+191606.826369     8251623.224784
+191607.947057     8251631.381607
+191609.077072     8251638.911864
+191612.568680     8251655.243990
+191615.323894     8251678.452464
+191618.503751     8251714.188659
+191622.883423     8251753.073810
+191622.399521     8251783.119344
+191625.860881     8251801.329603
+191625.840723     8251802.581181
+191626.991660     8251808.859872
+191631.229730     8251817.690624
+191632.310103     8251828.350605
+191639.000500     8251840.349592
+191643.853984     8251849.815761
+191648.012164     8251863.654369
+191651.685239     8251868.719228
+191652.290561     8251869.981199
+191657.780392     8251878.830455
+191663.179478     8251893.314108
+191664.369978     8251897.088865
+191667.992635     8251905.284199
+191671.605976     8251914.105335
+191671.545492     8251917.860836
+191667.442116     8251929.328295
+191672.140748     8251919.747832
+191672.766240     8251919.757460
+191673.391732     8251919.767088
+191674.017225     8251919.776716
+191677.145450     8251919.824868
+191676.519958     8251919.815240
+191675.268973     8251919.795984
+191675.894465     8251919.805612
+END
+LINE3D
+HEIGHT 1090.000000
+183557.000000     8249326.432006
+183577.244018     8249327.070372
+183616.033895     8249327.667448
+183644.813605     8249328.110443
+183669.899891     8249324.740155
+183691.807546     8249324.451426
+183709.971384     8249323.478362
+183725.713322     8249317.459697
+183739.578401     8249311.412142
+183747.156590     8249307.146414
+183754.189942     8249297.863214
+183771.980318     8249281.231965
+183796.783684     8249256.569855
+183823.453818     8249232.563189
+183841.264351     8249214.680361
+183845.119071     8249208.478721
+183848.983680     8249201.651288
+183849.044177     8249197.895024
+183852.454668     8249180.417250
+183858.458638     8249157.343603
+183863.271523     8249130.495954
+183867.368195     8249109.271546
+183875.814019     8249089.992682
+183882.403154     8249069.432584
+183883.956957     8249050.673578
+183887.327133     8249035.698962
+183888.345974     8249011.297456
+183889.314420     8248990.024897
+183889.485808     8248979.383419
+183889.647105     8248969.368496
+183884.994672     8248947.383472
+183881.068926     8248919.148660
+183880.685194     8248904.116261
+183879.726172     8248885.945285
+183876.194058     8248872.116314
+183876.214215     8248870.864735
+183875.124337     8248860.830553
+183869.109838     8248845.711482
+183863.660537     8248834.357544
+183855.042493     8248825.459372
+183837.736211     8248812.045090
+183816.555052     8248806.084026
+183786.604618     8248800.614690
+183757.209494     8248799.536277
+183735.332088     8248797.946873
+183712.879392     8248793.218891
+183684.180337     8248787.768053
+183656.207764     8248776.068186
+183635.732942     8248765.108910
+183614.602189     8248756.018135
+183586.700192     8248739.936214
+183558.778026     8248725.106636
+183557.000000     8248724.288663
+END
+LINE3D
+HEIGHT 1090.000000
+183557.000000     8247743.984493
+183572.072541     8247744.216497
+183592.718942     8247744.534299
+183607.108701     8247744.755795
+183625.888137     8247744.418533
+183650.378983     8247739.160864
+183665.455107     8247735.636111
+183677.402809     8247732.063585
+183693.043935     8247732.304343
+183712.459133     8247731.350922
+183724.356430     8247730.908108
+183728.735830     8247730.975519
+183731.864055     8247731.023670
+183732.419169     8247735.414974
+183733.650378     8247736.685814
+183740.340966     8247748.684804
+183745.739867     8247763.168072
+183753.469928     8247788.330956
+183763.046796     8247815.400483
+183769.697057     8247829.903395
+183770.262255     8247833.668527
+183776.932495     8247846.919093
+183782.422314     8247855.769112
+183786.055056     8247863.338276
+183795.964602     8247869.751784
+183806.580481     8247871.167461
+183810.334389     8247871.225244
+183814.985984     8247854.392136
+183816.590192     8247832.503419
+183818.042992     8247820.003832
+183818.930790     8247803.738735
+183820.434187     8247788.109440
+183825.196672     8247764.391120
+183832.431648     8247742.589075
+183835.620357     8247738.881726
+183836.871724     8247738.900987
+183838.122899     8247738.920246
+183841.987705     8247732.092435
+183847.719284     8247725.919684
+183860.978837     8247718.610920
+183883.703721     8247706.438766
+183908.900904     8247696.182884
+183930.324015     8247687.121180
+183954.300265     8247674.968288
+183970.022040     8247670.201584
+183981.979827     8247666.002887
+183995.199059     8247661.197662
+184021.728066     8247645.953577
+184048.852705     8247632.596876
+184070.820851     8247628.552264
+184085.210610     8247628.773761
+184109.055615     8247624.758039
+184136.069357     8247618.286932
+184161.851896     8247610.544602
+184185.797713     8247600.269458
+184207.210745     8247591.833543
+184228.694341     8247579.016339
+184252.710918     8247564.359525
+184274.355817     8247541.527015
+184301.812943     8247507.514292
+184335.991091     8247483.622812
+184373.246874     8247462.908810
+184399.251200     8247441.395674
+184425.860856     8247421.144127
+184453.197197     8247394.642791
+184477.869509     8247378.117854
+184502.541821     8247361.592918
+184513.278675     8247355.497212
+184522.128395     8247349.998785
+184539.757276     8247343.382838
+184563.097758     8247331.846487
+184593.976115     8247318.547565
+184634.350037     8247298.507886
+184662.271550     8247274.519718
+184678.164706     8247259.111919
+184689.628055     8247246.766421
+184700.394961     8247238.792961
+184710.475889     8247234.565375
+184728.801018     8247223.577769
+184751.465416     8247215.161116
+184767.207354     8247209.142451
+184772.293278     8247204.212034
+184777.298361     8247204.289075
+184782.949292     8247203.123786
+184788.025137     8247198.819158
+184797.470297     8247195.208112
+184810.053767     8247191.019046
+184825.775542     8247186.252342
+184836.411393     8247186.416056
+184845.170385     8247186.550880
+184857.057793     8247186.733858
+184868.319328     8247186.907202
+184877.683840     8247188.303618
+184889.419839     8247197.875727
+184906.100629     8247211.280382
+184924.577622     8247229.721770
+184943.014295     8247250.666698
+184952.126777     8247267.711670
+184960.553090     8247288.502513
+184968.969319     8247309.919527
+184977.980995     8247333.223540
+184987.719160     8247350.278143
+185000.555308     8247369.258648
+185011.514597     8247388.210264
+185021.888142     8247404.648703
+185026.086273     8247415.983001
+185029.779888     8247419.796287
+185030.264241     8247428.569259
+185037.499864     8247445.585342
+185042.202512     8247464.440651
+185042.142027     8247468.196152
+185042.565895     8247480.724626
+185043.686207     8247488.881061
+185044.937574     8247488.900322
+185052.364742     8247494.023349
+185064.716340     8247504.231261
+185080.125599     8247518.868615
+185094.243165     8247535.990628
+185113.355736     8247553.815473
+185125.697255     8247564.649174
+185138.563836     8247581.751932
+185150.229081     8247595.705329
+185153.155682     8247608.272326
+185156.768642     8247617.093456
+185160.976852     8247627.801964
+185165.689585     8247646.031102
+185169.736492     8247666.754916
+185175.650185     8247688.133027
+185183.501221     8247705.784527
+185193.309765     8247718.457455
+185209.354978     8247732.478653
+185230.475462     8247742.195215
+185246.611407     8247750.582779
+185258.973090     8247760.164520
+185276.370099     8247767.945551
+185293.716702     8247778.856294
+185314.171366     8247791.067149
+185337.673614     8247808.333235
+185370.611318     8247822.614453
+185396.696559     8247834.911977
+185423.448383     8247844.715220
+185457.616915     8247860.267272
+185494.328119     8247873.354302
+185519.788249     8247885.642205
+185544.501535     8247905.431475
+185567.973534     8247924.575694
+185592.151674     8247938.722079
+185618.893413     8247949.151493
+185641.265263     8247958.887316
+185662.396214     8247967.977711
+185683.607425     8247972.061021
+185704.203229     8247975.508532
+185727.967967     8247976.500278
+185747.342647     8247978.050776
+185772.318042     8247981.565700
+185799.786092     8247985.744937
+185832.884712     8247990.011225
+185867.224625     8247994.922183
+185889.102038     8247996.511205
+185900.938658     8247999.823888
+185917.669848     8248010.099214
+185936.197253     8248025.410508
+185964.704960     8248042.754024
+185994.927847     8248070.141347
+186017.199268     8248086.136599
+186033.234020     8248100.783580
+186044.950046     8248111.607653
+186063.578258     8248120.659907
+186080.945025     8248130.318689
+186103.942749     8248140.064146
+186123.801788     8248150.387235
+186141.744023     8248163.185362
+186152.844254     8248173.374012
+186161.381656     8248187.279263
+186170.574786     8248199.316773
+186171.190199     8248199.952191
+186171.805989     8248200.587996
+186172.431481     8248200.597624
+186173.056973     8248200.607252
+186176.134792     8248203.785115
+186186.024366     8248211.450587
+186200.172181     8248226.694469
+186221.706830     8248249.565681
+186247.641241     8248271.251963
+186257.459869     8248283.298719
+186262.323814     8248292.139105
+186262.899282     8248295.278451
+186264.140570     8248295.923502
+186265.179839     8248309.088157
+186269.186431     8248332.315129
+186272.617937     8248352.402761
+186272.386064     8248366.799739
+186272.184440     8248379.318584
+186271.882004     8248398.096852
+186271.690459     8248409.989908
+186267.058837     8248425.571052
+186259.732937     8248453.006728
+186250.550730     8248479.161176
+186243.891031     8248504.102564
+186237.957637     8248522.794157
+186230.086899     8248545.212361
+186220.288897     8248570.731387
+186215.597160     8248590.068801
+186209.714172     8248605.630683
+186198.785785     8248623.618681
+186189.734626     8248641.636338
+186177.484297     8248663.987129
+186165.102907     8248694.475475
+186152.247243     8248715.565059
+186134.982133     8248738.464603
+186120.269385     8248758.273713
+186108.170656     8248771.235375
+186104.295587     8248778.688591
+186094.779851     8248786.681692
+186078.846368     8248804.593413
+186064.840531     8248819.404318
+186054.698933     8248827.387020
+186045.788914     8248836.641333
+186033.114716     8248846.463651
+186019.713820     8248862.536521
+186004.416302     8248879.831322
+185991.661450     8248894.661483
+185976.313132     8248915.086754
+185952.710535     8248942.897833
+185931.711483     8248964.488014
+185918.341230     8248978.681993
+185917.695186     8248979.924702
+185917.049536     8248981.166653
+185912.538884     8248989.236795
+185906.111058     8248999.781205
+185900.318803     8249009.709453
+185891.328129     8249023.971610
+185886.121421     8249036.413414
+185880.833689     8249053.862292
+185871.611142     8249082.521427
+185861.863546     8249104.910741
+185860.380319     8249119.287693
+185859.654015     8249125.537488
+185863.064969     8249146.877458
+185871.330170     8249177.683609
+185875.346459     8249200.284785
+185883.268447     8249213.554619
+185891.149726     8249229.328368
+185899.081411     8249241.972407
+185910.131231     8249255.291150
+185926.186528     8249268.686177
+185944.118302     8249282.110087
+185968.256502     8249298.760018
+185991.728501     8249317.904237
+186013.979370     8249335.151826
+186030.629923     8249350.433848
+186042.315707     8249363.135672
+186058.410938     8249374.027535
+186075.767625     8249384.312106
+186091.287782     8249392.063866
+186110.521698     8249402.378096
+186137.162249     8249419.066545
+186159.362724     8249439.443081
+186172.309954     8249451.538377
+186180.897380     8249462.313911
+186190.110667     8249473.099843
+186198.072983     8249483.865754
+186207.871448     8249497.164472
+186218.255460     8249512.976745
+186221.868038     8249521.797869
+186231.091416     8249531.957248
+186240.910421     8249544.004392
+186253.161213     8249560.471345
+186267.884107     8249578.854947
+186269.085067     8249582.003920
+186269.710560     8249582.013548
+186270.336434     8249582.023182
+186270.961926     8249582.032810
+186271.587800     8249582.042444
+186272.213293     8249582.052072
+186272.223371     8249581.426282
+186272.848864     8249581.435910
+186274.100230     8249581.455172
+186282.667868     8249593.483055
+186299.388985     8249604.383788
+186313.082294     8249608.977704
+186334.293893     8249613.060638
+186357.432757     8249614.042750
+186382.327498     8249622.565518
+186412.247493     8249629.912984
+186445.871181     8249640.447947
+186483.329228     8249646.033609
+186503.783905     8249658.243700
+186526.054944     8249674.238946
+186536.630488     8249678.158927
+186542.251368     8249678.871392
+186556.489909     8249688.482022
+186584.936756     8249709.580651
+186611.567216     8249726.895653
+186627.057124     8249736.525545
+186640.740749     8249741.744492
+186663.758631     8249750.238370
+186692.992648     8249761.331709
+186727.826994     8249774.389850
+186754.598593     8249782.941507
+186773.862758     8249791.377606
+186795.548631     8249804.859302
+186824.086199     8249820.325061
+186855.146669     8249834.577001
+186881.908190     8249843.754448
+186906.298420     8249844.755822
+186927.570504     8249845.083255
+186945.088489     8249845.352902
+186966.935659     8249848.819675
+186988.126707     8249854.154946
+187010.519109     8249862.638432
+187036.009106     8249873.048196
+187062.720220     8249885.355354
+187096.323739     8249897.142660
+187119.856222     8249912.531378
+187144.660242     8249926.687015
+187172.652972     8249937.135302
+187201.967632     8249943.221561
+187230.636260     8249950.549766
+187258.053903     8249957.858714
+187279.800261     8249967.584909
+187296.672584     8249969.097272
+187314.745497     8249973.757837
+187337.208463     8249977.860033
+187355.271285     8249983.147152
+187370.912411     8249983.387910
+187374.040636     8249983.436062
+187378.420228     8249983.503475
+187390.933129     8249983.696081
+187414.707564     8249984.062032
+187446.009973     8249983.291969
+187472.428280     8249974.933099
+187495.829253     8249959.640865
+187516.081843     8249945.552058
+187533.902264     8249927.043437
+187559.321235     8249903.016748
+187587.152205     8249884.662216
+187605.588027     8249866.789777
+187618.282395     8249855.715117
+187631.642951     8249842.146933
+187646.990887     8249821.721656
+187665.477510     8249800.718748
+187696.385917     8249785.542073
+187725.387600     8249772.214646
+187745.620020     8249759.378183
+187762.643191     8249751.500641
+187775.882778     8249745.443459
+187790.433834     8249735.650031
+187810.736830     8249718.431513
+187832.957000     8249698.738727
+187855.056201     8249686.556943
+187877.720409     8249678.140287
+187896.661135     8249667.788483
+187921.212662     8249658.774934
+187950.113163     8249651.706160
+187977.752588     8249645.244684
+187999.740898     8249639.948112
+188016.754360     8249632.697130
+188030.689633     8249622.267515
+188048.339048     8249614.400377
+188062.910274     8249603.354607
+188080.024547     8249589.844202
+188099.176989     8249566.347000
+188113.293717     8249544.650882
+188125.382749     8249532.315015
+188125.392828     8249531.689226
+188129.863153     8249526.123006
+188136.896314     8249516.839803
+188145.847042     8249505.081574
+188153.455671     8249498.937716
+188154.716734     8249498.331182
+188155.988258     8249497.098865
+188156.624211     8249496.482710
+188157.955850     8249491.494122
+188164.333270     8249484.079423
+188169.469797     8249476.018915
+188173.919570     8249471.705033
+188177.108292     8249467.996919
+188184.727382     8249461.227278
+188189.116670     8249460.668896
+188195.373120     8249460.765199
+188207.865864     8249462.209384
+188220.933681     8249466.793673
+188225.303576     8249467.486882
+188231.549947     8249468.208974
+188239.037212     8249469.576876
+188248.421888     8249469.721331
+188255.303830     8249469.827262
+188261.630857     8249465.541511
+188262.326912     8249461.169848
+188263.023744     8249456.797434
+188263.084229     8249453.041933
+188263.144714     8249449.286432
+188263.154793     8249448.660643
+188258.986522     8249435.448589
+188246.705494     8249420.859004
+188246.090080     8249420.223587
+188245.535164     8249415.831905
+188241.912495     8249407.637334
+188241.548347     8249391.353348
+188241.094243     8249380.702243
+188244.989100     8249371.996678
+188258.430693     8249353.420656
+188271.710213     8249344.860310
+188276.190234     8249338.668294
+188276.835897     8249337.425579
+188288.814038     8249331.974924
+188307.058709     8249325.994783
+188326.574522     8249318.782319
+188355.475010     8249311.714309
+188381.268207     8249303.345817
+188406.394821     8249297.471607
+188424.749619     8249284.606242
+188436.082111     8249280.397538
+188454.387266     8249270.661895
+188473.963576     8249259.693166
+188485.931627     8249254.869065
+188490.391491     8249249.928629
+188499.836651     8249246.317582
+188518.081322     8249240.337441
+188535.033917     8249236.841954
+188542.562286     8249235.705182
+188543.823349     8249235.098648
+188543.833428     8249234.472859
+188551.402111     8249230.832929
+188565.165997     8249231.044791
+188581.432615     8249231.295177
+188605.782518     8249234.800473
+188628.921000     8249235.782579
+188649.497028     8249240.481675
+188678.216050     8249244.680931
+188714.988133     8249254.011703
+188747.450793     8249258.894529
+188771.770460     8249264.277193
+188801.035096     8249273.493169
+188828.441885     8249281.428660
+188856.485021     8249288.747236
+188887.585818     8249300.495254
+188911.774412     8249314.016237
+188938.516157     8249324.445269
+188958.385275     8249334.142569
+188978.850412     8249345.726876
+188996.126064     8249361.019285
+189017.146118     8249376.995275
+189035.653360     8249393.558530
+189056.713729     8249407.031362
+189080.912414     8249419.925792
+189100.115724     8249432.116622
+189116.200876     8249443.634274
+189128.572637     8249452.590225
+189152.166000     8249464.222684
+189181.924303     8249481.585832
+189227.879425     8249503.580667
+189262.693613     8249517.890387
+189291.322677     8249527.722525
+189324.350345     8249536.370479
+189366.067397     8249549.534563
+189393.939157     8249567.493852
+189424.908894     8249587.379425
+189456.544438     8249604.771469
+189488.815566     8249621.546587
+189514.245078     8249635.711851
+189531.632384     8249644.119060
+189540.956575     8249648.019015
+189541.561897     8249649.280986
+189542.187390     8249649.290614
+189542.167232     8249650.542193
+189542.783409     8249651.177622
+189543.388732     8249652.439593
+189549.544370     8249658.795319
+189550.775197     8249660.066154
+189551.390611     8249660.701572
+189551.380532     8249661.327361
+189551.996697     8249661.963554
+189551.986618     8249662.589344
+189551.976540     8249663.215133
+189551.966461     8249663.840923
+189552.531468     8249667.606051
+189553.096464     8249671.371944
+189553.025900     8249675.753235
+189552.945245     8249680.761078
+189553.429611     8249689.533287
+189553.248144     8249700.800553
+189553.056599     8249712.693609
+189552.824738     8249727.089823
+189552.613023     8249740.235222
+189556.276020     8249745.925871
+189567.971883     8249758.001905
+189582.927032     8249761.988536
+189596.045255     8249763.443113
+189606.681679     8249763.606835
+189616.691847     8249763.760918
+189623.573789     8249763.866849
+189631.697402     8249764.617837
+189635.430961     8249765.927196
+189638.478532     8249770.983191
+189642.787178     8249775.431889
+189651.435459     8249782.452692
+189663.746735     8249795.164144
+189684.191703     8249808.000794
+189706.503068     8249821.492118
+189732.467340     8249841.300644
+189752.196082     8249859.761300
+189763.790369     8249878.096745
+189779.209713     8249892.107927
+189799.584117     8249909.325868
+189825.649188     8249922.875735
+189847.335062     8249936.357431
+189857.285508     8249940.267026
+189868.405522     8249949.203709
+189875.843157     8249953.700570
+189877.084063     8249954.345616
+189877.073971     8249954.972169
+189877.699464     8249954.981797
+189878.324956     8249954.991425
+189878.951212     8249955.001065
+189879.576704     8249955.010693
+189887.094230     8249954.499699
+189904.602506     8249955.395906
+189922.039466     8249960.672627
+189927.609940     8249964.514803
+189928.235432     8249964.524431
+189943.170411     8249969.763405
+189969.871829     8249982.696358
+189981.557613     8249995.398182
+189982.808598     8249995.417438
+189991.487127     8250000.560108
+190010.054853     8250013.367863
+190018.753552     8250017.258191
+190022.497191     8250017.941760
+190028.077743     8250021.158146
+190037.987099     8250027.571652
+190041.095166     8250028.871382
+190047.916612     8250032.733578
+190051.599766     8250037.172648
+190061.509122     8250043.586153
+190074.597872     8250046.918111
+190084.587883     8250048.323772
+190092.014663     8250053.447175
+190100.683113     8250059.215635
+190108.756319     8250063.096335
+190115.577777     8250066.957767
+190119.876332     8250072.033018
+190123.609892     8250073.342376
+190123.599813     8250073.968166
+190128.534703     8250078.427267
+190134.074928     8250084.147576
+190135.255349     8250088.548122
+190139.574838     8250092.371042
+190140.765338     8250096.145799
+190141.320254     8250100.537481
+190141.875183     8250104.928399
+190144.832020     8250115.618028
+190144.711051     8250123.129029
+190144.640487     8250127.510320
+190144.418693     8250141.281508
+190144.338051     8250146.288588
+190143.611747     8250152.538383
+190135.297353     8250163.680462
+190127.587530     8250176.083737
+190123.137757     8250180.397620
+190115.538825     8250185.915682
+190104.106285     8250196.383820
+190096.507365     8250201.901119
+190095.205975     8250205.011574
+190093.823929     8250213.129873
+190089.938388     8250221.209637
+190089.867824     8250225.590928
+190089.847667     8250226.842507
+190093.511415     8250232.533931
+190098.435462     8250237.618810
+190102.118616     8250242.057880
+190107.124082     8250242.134927
+190113.461174     8250237.224151
+190121.766253     8250226.707872
+190133.844443     8250214.997783
+190141.443363     8250209.480485
+190150.323528     8250202.103546
+190159.798937     8250196.614367
+190166.125951     8250192.329380
+190170.515239     8250191.770998
+190181.221475     8250187.552654
+190188.164666     8250183.903096
+190191.292891     8250183.951248
+190195.046609     8250184.009027
+190205.056777     8250184.163110
+190210.687735     8250184.249785
+190211.928641     8250184.894831
+190212.544042     8250185.531012
+190213.109813     8250189.296153
+190213.735305     8250189.305781
+190213.715148     8250190.557360
+190213.694978     8250191.809703
+190213.019080     8250194.929786
+190211.696768     8250199.291809
+190207.246995     8250203.605691
+190202.786367     8250208.546116
+190198.921758     8250215.373549
+190188.790609     8250222.731232
+190183.674252     8250229.539397
+190183.613767     8250233.294897
+190182.261971     8250239.535064
+190181.616321     8250240.777015
+190181.596151     8250242.029358
+190187.802196     8250245.255373
+190192.171327     8250245.948569
+190197.802285     8250246.035245
+190207.822531     8250245.563538
+190216.662369     8250240.690521
+190221.738398     8250236.386278
+190233.766182     8250227.805900
+190250.800196     8250219.302581
+190272.717930     8250218.388063
+190282.102605     8250218.532517
+190293.909371     8250223.722575
+190321.972665     8250229.789573
+190346.877484     8250237.686551
+190366.837335     8250241.750217
+190386.161615     8250246.430045
+190419.190047     8250255.078011
+190449.200393     8250256.791838
+190463.530049     8250260.768841
+190472.823992     8250266.546929
+190491.432046     8250276.850762
+190504.348645     8250290.824184
+190507.406307     8250295.253626
+190507.961223     8250299.645308
+190514.571742     8250316.651387
+190522.957162     8250339.945760
+190527.640022     8250360.053419
+190532.958465     8250379.544151
+190537.580076     8250403.407299
+190541.072449     8250419.739436
+190546.480861     8250433.596524
+190558.620750     8250456.949453
+190567.148073     8250471.480493
+190573.848549     8250482.853691
+190581.074481     8250500.495187
+190590.156721     8250519.417910
+190598.643704     8250536.453636
+190601.681196     8250542.135421
+190605.858782     8250554.721674
+190608.866037     8250562.280827
+190613.094029     8250571.737369
+190616.697292     8250581.184294
+190620.138495     8250600.646131
+190624.951652     8250612.616223
+190629.200564     8250620.821197
+190629.725245     8250627.090248
+190630.845181     8250635.246295
+190631.945711     8250644.654697
+190633.085805     8250651.559165
+190633.640722     8250655.950847
+190633.539910     8250662.210270
+190633.489503     8250665.339981
+190632.652308     8250678.474988
+190624.973498     8250689.000142
+190619.836972     8250697.060650
+190619.150994     8250700.806523
+190613.439382     8250705.727691
+190601.431004     8250713.055715
+190591.915268     8250721.048815
+190586.214510     8250725.343442
+190580.502897     8250730.264611
+190574.105308     8250738.931652
+190569.039357     8250742.610106
+190568.353380     8250746.355978
+190562.631689     8250751.902937
+190556.849513     8250761.205395
+190552.349333     8250768.648990
+190542.157699     8250779.762173
+190536.385601     8250788.438843
+190535.578655     8250799.695717
+190535.518170     8250803.451218
+190536.093256     8250806.590557
+190547.345081     8250807.390461
+190559.857982     8250807.583068
+190578.071653     8250803.480283
+190587.587377     8250795.487947
+190595.266963     8250784.962040
+190599.777221     8250776.892657
+190608.001646     8250771.384222
+190615.630062     8250763.988016
+190621.957076     8250759.703028
+190623.279388     8250755.341006
+190627.033106     8250755.398785
+190632.057977     8250754.223478
+190637.144085     8250749.293445
+190640.897803     8250749.351225
+190649.051664     8250748.224081
+190652.189968     8250747.646443
+190655.943685     8250747.704222
+190656.569177     8250747.713850
+190657.699956     8250755.244120
+190658.880365     8250759.645430
+190659.990210     8250768.428030
+190663.633801     8250775.371034
+190667.841635     8250786.079154
+190669.082541     8250786.724200
+190679.073302     8250788.130637
+190688.457978     8250788.275092
+190691.586203     8250788.323243
+190695.339921     8250788.381023
+190699.709052     8250789.074220
+190705.269446     8250793.542185
+190710.204336     8250798.001287
+190710.749186     8250803.017995
+190716.249084     8250811.242225
+190724.210635     8250822.008125
+190724.815958     8250823.270096
+190726.007221     8250827.044864
+190729.760939     8250827.102644
+190733.504578     8250827.786213
+190743.514745     8250827.940295
+190746.642971     8250827.988447
+190747.269227     8250827.998087
+190747.904798     8250827.381925
+190747.914876     8250826.756136
+190749.165861     8250826.775392
+190749.791353     8250826.785020
+190750.417609     8250826.794659
+190750.427688     8250826.168870
+190751.053180     8250826.178498
+190751.063271     8250825.551944
+190751.073350     8250824.926155
+190751.083429     8250824.300365
+190752.344492     8250823.693832
+190756.118379     8250822.499268
+190761.133924     8250821.950526
+190765.523212     8250821.392144
+190775.534144     8250821.546239
+190784.858335     8250825.446194
+190797.926152     8250830.030483
+190814.747699     8250834.671787
+190833.375911     8250843.724041
+190843.325594     8250847.633624
+190848.260496     8250852.091962
+190859.986595     8250862.290628
+190872.893128     8250876.889076
+190883.963499     8250888.955482
+190890.098980     8250896.562787
+190896.890189     8250902.302351
+190903.641071     8250910.545837
+190914.065028     8250923.854183
+190922.672994     8250933.378144
+190928.778226     8250942.863581
+190942.250517     8250961.227934
+190953.794399     8250982.693090
+190957.317020     8250997.147095
+190960.919519     8251006.594009
+190961.333309     8251019.748272
+190964.885402     8251032.324897
+190967.943051     8251036.755102
+190970.920058     8251046.192388
+190971.404411     8251054.965361
+190974.997596     8251065.038075
+190974.876626     8251072.549077
+190976.016720     8251079.453545
+190977.126565     8251088.236146
+190977.045911     8251093.243990
+190976.975347     8251097.625280
+190976.854365     8251105.137046
+190976.803959     8251108.266757
+190977.430215     8251108.276397
+190978.055708     8251108.286025
+190978.045629     8251108.911814
+190977.944817     8251115.171237
+190977.793599     8251124.560371
+190977.047137     8251132.061744
+190975.603843     8251143.935533
+190971.688829     8251153.892677
+190971.002852     8251157.638550
+190966.471660     8251166.960264
+190965.836077     8251167.577190
+190964.564935     8251168.809513
+190960.094228     8251174.375727
+190954.383392     8251179.296143
+190944.311963     8251182.898314
+190936.804528     8251182.782755
+190931.173570     8251182.696080
+190918.670760     8251181.876920
+190904.452758     8251171.014717
+190890.859485     8251160.162130
+190885.864874     8251159.458541
+190877.115769     8251158.697924
+190868.992157     8251157.946936
+190857.731005     8251157.773598
+190848.971821     8251157.638771
+190845.218104     8251157.580991
+190840.767567     8251161.894862
+190834.995470     8251170.571532
+190830.545684     8251174.886179
+190826.630670     8251184.843323
+190826.509700     8251192.354324
+190827.024302     8251199.249164
+190831.848301     8251210.593478
+190832.917819     8251221.880001
+190836.540488     8251230.074571
+190836.913950     8251245.732756
+190841.687543     8251260.206781
+190842.111412     8251272.735254
+190845.693754     8251283.433747
+190849.337344     8251290.376750
+190849.882182     8251295.394222
+190852.939843     8251299.823664
+190856.633064     8251303.637708
+190857.863891     8251304.908543
+190864.726440     8251306.266065
+190871.608382     8251306.371996
+190878.480234     8251307.104481
+190885.352098     8251307.836201
+190898.480412     8251308.664225
+190911.609490     8251309.492260
+190920.357831     8251310.252865
+190924.102221     8251310.937210
+190932.225070     8251311.688186
+190940.974174     8251312.448802
+190944.717813     8251313.132371
+190945.343305     8251313.141999
+190949.077617     8251314.452134
+190955.273582     8251318.303938
+190958.976894     8251321.491428
+190965.172859     8251325.343232
+190968.906419     8251326.652591
+190968.896328     8251327.279144
+190970.096907     8251330.428112
+190973.114241     8251337.361475
+190976.737674     8251345.556058
+190980.370410     8251353.125603
+190981.490346     8251361.281650
+190982.681597     8251365.057183
+190983.307089     8251365.066810
+190983.851939     8251370.083518
+190984.366541     8251376.978358
+190984.941627     8251380.117698
+190985.467071     8251386.386760
+190986.627323     8251392.039649
+190986.607153     8251393.291992
+190987.091518     8251402.064201
+190987.081427     8251402.690754
+190987.071348     8251403.316544
+190987.051191     8251404.568123
+190982.601405     8251408.882769
+190977.535455     8251412.561223
+190976.909962     8251412.551595
+190967.515208     8251413.032930
+190956.859390     8251414.120798
+190945.536977     8251417.703713
+190939.906019     8251417.617038
+190927.332634     8251421.179932
+190914.759248     8251424.742827
+190903.477938     8251425.821067
+190899.077795     8251427.005991
+190894.052935     8251428.180534
+190887.776315     8251429.336574
+190884.283519     8251428.051231
+END
+LINE3D-MASTER
+HEIGHT 1100.000000
+183557.000000     8249745.357085
+183566.735702     8249746.393910
+183603.628564     8249748.213676
+183629.845235     8249752.374416
+183656.112133     8249753.404676
+183677.384026     8249753.732107
+183710.553406     8249753.616725
+183742.531917     8249749.725818
+183779.515499     8249745.912715
+183830.293597     8249740.433349
+183872.393167     8249729.811311
+183895.703406     8249720.152711
+183914.573569     8249714.182197
+183928.963329     8249714.403693
+183966.037645     8249704.956958
+184003.767892     8249693.641720
+184036.361995     8249690.386997
+184067.785386     8249682.105168
+184101.015060     8249678.234283
+184121.812679     8249669.162951
+184138.785635     8249664.415124
+184148.281201     8249657.674367
+184156.616326     8249645.280717
+184172.580057     8249625.490864
+184190.420636     8249605.730664
+184203.044427     8249599.038058
+184213.872014     8249587.308719
+184230.390854     8249571.910551
+184248.867206     8249551.533429
+184271.188188     8249525.581220
+184295.335623     8249502.787612
+184318.726517     8249488.121168
+184345.790474     8249478.520347
+184371.088475     8249462.004659
+184393.883922     8249445.451216
+184428.556508     8249429.706537
+184475.852898     8249407.268488
+184512.533403     8249383.415143
+184542.806418     8249368.855397
+184589.295658     8249357.674983
+184622.535423     8249353.177545
+184657.026542     8249348.700132
+184697.209116     8249340.553130
+184731.710327     8249335.449164
+184757.532996     8249325.203292
+184778.260051     8249320.513250
+184796.423877     8249319.540950
+184814.567545     8249319.820228
+184841.470396     8249320.234333
+184864.508257     8249327.475865
+184891.915630     8249335.410600
+184919.323183     8249343.346102
+184949.283505     8249348.189646
+184975.560673     8249348.594120
+184998.709615     8249348.950443
+185025.602197     8249349.990335
+185053.695739     8249354.179200
+185078.085575     8249355.181332
+185091.799436     8249358.522912
+185096.784362     8249359.851532
+185102.344757     8249364.319497
+185107.905139     8249368.788227
+185118.530721     8249369.577727
+185127.895239     8249370.973760
+185138.480875     8249374.267188
+185145.363199     8249374.373125
+185150.368283     8249374.450167
+185158.491501     8249375.201913
+185161.619726     8249375.250065
+185162.891263     8249374.016983
+185167.976989     8249369.086945
+185172.497720     8249360.391014
+185176.342170     8249354.815160
+185180.923386     8249342.363728
+185182.356219     8249331.115723
+185186.897108     8249321.168213
+185192.103816     8249308.726409
+185195.988581     8249300.647397
+185203.052372     8249289.486068
+185213.869499     8249278.382512
+185218.955607     8249273.452479
+185222.709325     8249273.510259
+185227.088916     8249273.577672
+185230.792228     8249276.765163
+185235.030680     8249285.595921
+185236.040107     8249300.637186
+185237.099929     8249312.549504
+185237.453221     8249329.460032
+185237.786368     8249347.621374
+185237.655308     8249355.758930
+185237.564574     8249361.392563
+185244.275523     8249372.139213
+185252.197129     8249385.409041
+185263.206634     8249401.230942
+185280.230637     8249432.171913
+185300.039652     8249445.624720
+185331.857044     8249451.749502
+185368.043568     8249458.567482
+185403.644926     8249462.871912
+185444.221120     8249469.131515
+185488.571189     8249474.197320
+185524.101985     8249482.883040
+185565.323828     8249487.900693
+185604.638577     8249494.766824
+185628.968323     8249499.523699
+185648.837822     8249509.221004
+185679.938608     8249520.969786
+185723.491821     8249536.665911
+185753.815514     8249557.794194
+185784.744924     8249580.183689
+185822.627221     8249598.297831
+185859.813081     8249620.783629
+185887.543702     8249647.506263
+185916.616411     8249668.615289
+185938.191393     8249688.982197
+185957.394691     8249701.173791
+185975.276441     8249717.727418
+185991.301108     8249733.000571
+186003.592227     8249746.963602
+186014.056881     8249757.768796
+186029.486304     8249771.154188
+186049.900654     8249785.868201
+186079.619012     8249805.735277
+186105.654241     8249821.161754
+186123.000838     8249832.072879
+186144.162031     8249839.285524
+186170.338387     8249845.949421
+186210.329034     8249849.695469
+186243.427660     8249853.961375
+186269.704827     8249854.365850
+186298.404074     8249859.816691
+186342.713828     8249867.385653
+186373.865019     8249876.004724
+186400.606382     8249886.433750
+186429.870636     8249895.649721
+186467.288369     8249903.738541
+186492.193201     8249911.634755
+186518.984958     8249918.934834
+186549.490499     8249928.795856
+186586.867904     8249939.388598
+186612.327653     8249951.676494
+186635.930712     8249962.683158
+186658.948594     8249971.177036
+186676.365767     8249977.706106
+186701.270599     8249985.602320
+186723.693237     8249992.208438
+186746.680883     8250002.579684
+186774.047739     8250013.018338
+186810.749233     8250026.731928
+186851.174222     8250042.379901
+186879.711789     8250057.845661
+186904.505718     8250072.627851
+186927.453037     8250085.503019
+186954.830353     8250095.315890
+186974.719640     8250103.760846
+186992.671954     8250115.933183
+187008.626057     8250135.587627
+187029.504972     8250160.326961
+187051.695356     8250181.330051
+187082.655014     8250201.841413
+187108.084895     8250216.007448
+187131.001978     8250230.759985
+187153.293174     8250245.503652
+187182.446537     8250261.604834
+187210.429188     8250272.678911
+187227.170462     8250282.328065
+187248.866414     8250295.183971
+187273.054639     8250308.704185
+187299.705269     8250324.766844
+187333.944358     8250335.937988
+187358.173291     8250346.954286
+187375.005299     8250350.969806
+187393.704074     8250355.640770
+187413.028354     8250360.320598
+187443.039070     8250362.035195
+187468.054792     8250363.046197
+187488.146086     8250358.972313
+187507.016249     8250353.001800
+187527.168015     8250345.173180
+187549.993519     8250326.741601
+187579.085935     8250307.780541
+187596.341360     8250285.506028
+187611.719533     8250263.203383
+187624.665918     8250236.480930
+187638.177705     8250213.522848
+187651.114011     8250187.426184
+187662.031950     8250170.063206
+187671.638407     8250156.437236
+187685.543814     8250147.885759
+187699.328238     8250146.846048
+187718.097589     8250147.134958
+187736.866941     8250147.423867
+187753.698948     8250151.439388
+187764.334990     8250151.603104
+187776.857970     8250151.169921
+187789.471682     8250145.103105
+187806.454526     8250139.729485
+187820.975728     8250131.813432
+187836.778151     8250122.039266
+187846.324123     8250112.168797
+187858.978163     8250103.598059
+187871.682609     8250091.897609
+187886.970048     8250075.228598
+187907.212560     8250061.765580
+187928.080551     8250048.312955
+187956.395875     8250038.731396
+187977.233630     8250027.156139
+187999.968783     8250014.358199
+188018.939758     8250002.128263
+188037.900655     8249990.524116
+188055.125832     8249970.127735
+188073.107549     8249941.604191
+188093.460939     8249921.256726
+188108.223710     8249898.317899
+188126.064289     8249878.557700
+188138.879626     8249859.972038
+188156.104803     8249839.575657
+188177.093776     8249818.611266
+188206.165640     8249800.902544
+188227.709924     8249784.329077
+188242.977587     8249768.911650
+188256.297435     8249757.847382
+188268.416716     8249743.633382
+188284.148575     8249738.240507
+188301.222140     8249727.234018
+188327.064979     8249715.735803
+188346.682380     8249702.263163
+188362.474724     8249693.114787
+188374.542823     8249682.031251
+188387.813040     8249674.095942
+188399.154835     8249669.262201
+188407.379259     8249663.753767
+188414.281371     8249662.607355
+188425.603772     8249659.025204
+188436.864925     8249659.198543
+188440.628721     8249658.630533
+188444.383202     8249658.688324
+188451.265145     8249658.794255
+188458.762501     8249659.535604
+188463.747797     8249660.864994
+188471.870645     8249661.615970
+188479.984179     8249662.992748
+188484.343219     8249664.312499
+188489.964098     8249665.024963
+188498.077632     8249666.401741
+188499.318537     8249667.046786
+188502.446763     8249667.094938
+188503.698511     8249667.114205
+188504.959574     8249666.507672
+188505.595145     8249665.891510
+188505.615303     8249664.639932
+188506.361777     8249657.137794
+188506.381934     8249655.886215
+188506.452510     8249651.504161
+188500.458169     8249635.133511
+188495.655091     8249622.537630
+188495.120332     8249616.894369
+188493.939147     8249612.493811
+188489.781719     8249598.655979
+188490.023670     8249583.633212
+188493.353519     8249571.162518
+188498.549767     8249559.346498
+188499.176023     8249559.356137
+188502.929740     8249559.413917
+188508.500213     8249563.256093
+188520.306204     8249568.446903
+188532.052473     8249577.393226
+188546.311566     8249585.751519
+188562.346311     8249600.398883
+188578.370978     8249615.672036
+188593.881056     8249624.049585
+188601.903856     8249631.059996
+188615.556838     8249638.157834
+188631.742814     8249643.415300
+188644.185139     8249647.989960
+188659.765780     8249651.986219
+188680.412372     8249652.304024
+188700.563768     8249644.474634
+188723.238818     8249635.432201
+188740.877391     8249628.190841
+188754.722694     8249623.394871
+188769.303617     8249611.723305
+188786.357788     8249601.968407
+188799.516339     8249600.919062
+188816.418528     8249600.553287
+188845.016593     8249612.262781
+188871.647435     8249629.577789
+188892.031917     8249646.169940
+188908.692168     8249660.826168
+188929.742458     8249674.924789
+188954.506150     8249691.584348
+188974.899948     8249707.550698
+188982.902579     8249715.813452
+188983.507913     8249717.074659
+188984.699177     8249720.849428
+188996.454761     8249729.169949
+189022.399638     8249750.230066
+189054.065431     8249765.743977
+189091.422667     8249777.589062
+189120.515163     8249797.445740
+189146.490277     8249816.628488
+189174.331788     8249836.465910
+189207.794167     8249857.016560
+189234.444415     8249873.079214
+189254.929710     8249883.411942
+189274.173335     8249893.099614
+189296.555265     8249902.209647
+189322.085589     8249910.115489
+189350.118646     8249918.059855
+189371.895240     8249925.908682
+189389.887881     8249935.577097
+189412.168998     8249950.946553
+189444.935334     8249975.868102
+189477.671408     8250002.668547
+189503.000108     8250023.093235
+189522.778492     8250038.424167
+189545.645538     8250056.307185
+189579.056760     8250079.986771
+189601.843163     8250102.876869
+189625.224047     8250127.654715
+189650.543420     8250148.705968
+189683.319070     8250173.001715
+189719.808862     8250199.859940
+189749.497378     8250221.603626
+189777.389284     8250238.312100
+189805.200559     8250260.026890
+189836.745370     8250283.052567
+189867.694949     8250304.189719
+189889.350574     8250319.549547
+189895.546540     8250323.401351
+189896.172032     8250323.410979
+189902.357907     8250327.889336
+189906.041061     8250332.328406
+189910.360549     8250336.151326
+189910.895308     8250341.794588
+189914.548214     8250348.111790
+189921.874182     8250359.494615
+189929.816340     8250371.512106
+189931.006828     8250375.287627
+189932.258576     8250375.306895
+189953.591157     8250371.878063
+189978.111672     8250364.742634
+189997.598012     8250359.407550
+190012.612882     8250359.638668
+190024.500291     8250359.821646
+190028.819779     8250363.644566
+190039.899465     8250375.085171
+190044.148378     8250383.290146
+190047.266524     8250383.964087
+190047.206040     8250387.719588
+190060.243621     8250394.181244
+190072.595225     8250404.388774
+190084.351572     8250412.709308
+190096.046672     8250424.785330
+190111.455937     8250439.422302
+190124.312815     8250457.151237
+190130.407969     8250467.262464
+190134.040717     8250474.831245
+190142.588185     8250488.111471
+190152.810518     8250513.938661
+190158.239852     8250526.544182
+190159.390025     8250532.822861
+190165.505336     8250541.682508
+190170.278941     8250556.155769
+190176.999587     8250566.276624
+190183.245946     8250566.999481
+190192.640713     8250566.517382
+190212.802176     8250558.062967
+190229.896674     8250545.804147
+190243.186285     8250536.617247
+190253.357762     8250526.755642
+190264.074828     8250521.912285
+190268.544771     8250516.346059
+190271.683075     8250515.768421
+190277.929447     8250516.490514
+190287.132656     8250527.902235
+190297.011775     8250536.193109
+190301.290937     8250542.519950
+190302.481436     8250546.294707
+190306.154499     8250551.360331
+190307.355842     8250554.509310
+190311.109559     8250554.567089
+190314.722137     8250563.388213
+190319.596555     8250571.602052
+190318.970299     8250571.592412
+190317.719314     8250571.573156
+190308.758507     8250583.957175
+190304.248237     8250592.027322
+190297.901053     8250597.564652
+190293.430346     8250603.130866
+190284.470302     8250615.514897
+190278.667969     8250626.068935
+190274.106529     8250637.268782
+190273.995638     8250644.153994
+190273.783935     8250657.298629
+190279.596810     8250684.936545
+190294.804452     8250712.092362
+190309.991923     8250740.500522
+190313.615344     8250748.695868
+190317.137189     8250763.150626
+190323.666289     8250785.164536
+190333.878544     8250811.617517
+190347.825110     8250839.380631
+190353.093147     8250862.001076
+190356.049996     8250872.689940
+190357.280811     8250873.961539
+190358.522481     8250874.606596
+190359.147973     8250874.616224
+190359.682732     8250880.259485
+190360.177176     8250888.405904
+190360.752262     8250891.545244
+190365.495607     8250907.897401
+190366.676028     8250912.297947
+190367.302284     8250912.307587
+190367.806807     8250919.828217
+190370.874535     8250923.632633
+190371.449621     8250926.771972
+190372.014629     8250930.537101
+190366.929284     8250935.467146
+190358.674612     8250942.853712
+190353.598582     8250947.157956
+190352.277022     8250951.520754
+190347.766764     8250959.590138
+190341.308689     8250972.012680
+190337.372742     8250983.222155
+190337.352584     8250984.473734
+190340.309421     8250995.163363
+190340.844957     8251000.805871
+190343.963091     8251001.480577
+190350.794627     8251004.716219
+190362.146513     8250999.255924
+190366.011885     8250992.428503
+190369.896663     8250984.348728
+190379.412399     8250976.355627
+190383.186274     8250975.161828
+190391.955536     8250974.670865
+190407.041745     8250970.519941
+190418.948548     8250969.451328
+190422.076773     8250969.499480
+190426.981427     8250975.835950
+190436.820219     8250986.630746
+190437.445711     8250986.640374
+190446.003270     8250999.294046
+190450.887754     8251006.882859
+190459.384829     8251023.292032
+190466.700718     8251035.300647
+190473.996450     8251048.560841
+190473.976293     8251049.812419
+190475.046575     8251061.098954
+190478.094145     8251066.154949
+190478.023582     8251070.536239
+190477.963097     8251074.291740
+190477.811879     8251083.680874
+190476.418991     8251092.424951
+190475.006710     8251102.420619
+190470.567015     8251106.108712
+190470.546846     8251107.361055
+190469.870184     8251110.481127
+190461.616287     8251117.866941
+190456.459603     8251127.179028
+190455.834111     8251127.169400
+190437.881797     8251114.997063
+190416.357221     8251091.500443
+190415.741807     8251090.865026
+190407.002794     8251089.477856
+190399.505437     8251088.736508
+190389.485191     8251089.208215
+190377.496970     8251095.284659
+190376.770666     8251101.534454
+190375.297124     8251115.286374
+190371.251049     8251133.381074
+190365.993553     8251148.952583
+190365.933068     8251152.708084
+190370.837722     8251159.044554
+190381.201195     8251176.108400
+190384.955676     8251176.166191
+190385.560998     8251177.428162
+190392.422783     8251178.785672
+190401.181967     8251178.920499
+190411.192134     8251179.074582
+190425.602433     8251178.044505
+190435.683177     8251173.816533
+190447.661319     8251168.365878
+190458.417948     8251161.018587
+190462.171666     8251161.076367
+190465.925383     8251161.134146
+190475.330216     8251160.027022
+190487.288201     8251155.827946
+190491.112481     8251151.504435
+190492.374309     8251150.897913
+190496.824094     8251146.583267
+190501.930372     8251140.400891
+190510.083457     8251139.274499
+190515.774899     8251135.605674
+190521.405858     8251135.692349
+190525.764910     8251137.011335
+190528.832650     8251140.814988
+190534.917713     8251151.552768
+190538.460491     8251164.755194
+190542.022663     8251176.706029
+190546.018795     8251200.558785
+190549.701936     8251204.998619
+190561.397812     8251217.073889
+190567.593765     8251220.926457
+190575.051558     8251224.171739
+190583.184485     8251224.296926
+190588.169793     8251225.625552
+190596.232157     8251230.132029
+190604.204539     8251240.272916
+190605.334554     8251247.803173
+190608.968065     8251255.371966
+190608.867253     8251261.631389
+190609.371764     8251269.152783
+190609.997256     8251269.162411
+190610.622748     8251269.172039
+190610.612670     8251269.797828
+190611.238162     8251269.807456
+190611.177677     8251273.562957
+190611.006289     8251284.204434
+190606.385141     8251299.159030
+190606.233922     8251308.548164
+190604.982938     8251308.528908
+190603.620286     8251315.395616
+190599.685115     8251326.604339
+190598.172021     8251342.859430
+190597.323971     8251356.620978
+190597.172753     8251366.010112
+190597.456246     8251387.301942
+190602.087948     8251410.538536
+190605.145610     8251414.967978
+190605.135519     8251415.594531
+190606.296546     8251421.246668
+190610.524538     8251430.703210
+190613.531781     8251438.263127
+190617.769852     8251447.093879
+190620.817435     8251452.149110
+190620.666217     8251461.538244
+190623.612975     8251472.853663
+190623.542412     8251477.234953
+190623.532333     8251477.860742
+190622.906841     8251477.851114
+190619.153123     8251477.793335
+190619.143032     8251478.419888
+190615.379236     8251478.987898
+190611.625518     8251478.930119
+190597.517656     8251461.181928
+190596.367483     8251454.903249
+190592.713814     8251448.586035
+190592.804547     8251442.952402
+190592.885190     8251437.945322
+190588.586634     8251432.870071
+190583.026240     8251428.402105
+190582.410826     8251427.766688
+190576.265279     8251420.784408
+190571.279971     8251419.455782
+190567.596817     8251415.016712
+190566.345832     8251414.997457
+190553.843023     8251414.178297
+190549.473128     8251413.485088
+190548.625842     8251427.246649
+190547.637428     8251449.770790
+190547.526538     8251456.656002
+190547.435804     8251462.289635
+190551.078631     8251469.232627
+190554.015311     8251481.173834
+190553.208364     8251492.430709
+190548.071838     8251500.491217
+190547.335455     8251507.366801
+190545.963488     8251514.859311
+190545.862676     8251521.118733
+190545.802192     8251524.874234
+190546.427684     8251524.883862
+190547.053176     8251524.893490
+190547.043098     8251525.519279
+190551.937673     8251532.481539
+190555.630905     8251536.294819
+190561.211457     8251539.511206
+190569.900065     8251544.028087
+190578.648405     8251544.788691
+190591.777483     8251545.616727
+190601.162159     8251545.761181
+190611.182406     8251545.289475
+190623.140378     8251541.091163
+190632.585550     8251537.479352
+190640.153470     8251533.839411
+190643.997921     8251528.263557
+190652.857916     8251522.138961
+190662.383718     8251513.520835
+190670.598064     8251508.638190
+190673.736368     8251508.060552
+190678.135747     8251506.875617
+190683.161371     8251505.701085
+190692.566204     8251504.593961
+190701.385120     8251500.972511
+190705.139601     8251501.030302
+190705.765094     8251501.039930
+190707.016078     8251501.059186
+190713.908100     8251500.539328
+190714.534356     8251500.548967
+190715.775262     8251501.194013
+190718.802675     8251507.501587
+190720.003253     8251510.650554
+190720.609340     8251511.912537
+190721.184426     8251515.051876
+190721.174347     8251515.677666
+190724.090869     8251528.870452
+190724.655877     8251532.635581
+190725.261199     8251533.897552
+190726.321402     8251545.809876
+190727.421169     8251555.218266
+190730.983353     8251567.168337
+190730.852293     8251575.305892
+190733.829300     8251584.743178
+190737.896759     8251604.214655
+190741.872720     8251629.319753
+190742.821269     8251648.117277
+190742.599475     8251661.888466
+190745.576482     8251671.325751
+190745.395028     8251682.592254
+190745.223640     8251693.233731
+190745.072422     8251702.622865
+190745.011937     8251706.378366
+190744.890967     8251713.889367
+190740.370618     8251722.585304
+190740.300055     8251726.966595
+190739.049070     8251726.947339
+190732.782529     8251727.477589
+190723.276884     8251734.844136
+190715.082708     8251738.474438
+190706.242870     8251743.347455
+190700.541349     8251747.642070
+190694.901075     8251748.181196
+190689.078572     8251759.987577
+190687.665527     8251769.983233
+190686.878726     8251779.989292
+190690.622364     8251780.672861
+190696.192838     8251784.515037
+190700.562732     8251785.208246
+190709.937329     8251785.978490
+190716.879757     8251782.328921
+190725.022762     8251781.828318
+190731.976032     8251777.552971
+190738.232483     8251777.649274
+190741.986200     8251777.707053
+190745.739918     8251777.764833
+190749.483556     8251778.448402
+190753.813124     8251781.645533
+190758.101600     8251787.346573
+190759.271943     8251792.372909
+190760.362394     8251802.407100
+190760.796341     8251814.309784
+190760.584638     8251827.454419
+190760.988337     8251841.235235
+190764.025829     8251846.917020
+190765.156607     8251854.447289
+190769.374520     8251864.529620
+190777.286417     8251878.426008
+190786.429154     8251893.592466
+190792.514216     8251904.330246
+190800.415283     8251918.851647
+190808.307023     8251933.999613
+190811.334436     8251940.307187
+190812.575342     8251940.952232
+190815.693476     8251941.626937
+190816.308890     8251942.262355
+190816.925067     8251942.897784
+190817.540480     8251943.533201
+190817.530402     8251944.158991
+190817.520311     8251944.785544
+190818.145803     8251944.795172
+190818.135724     8251945.420962
+190818.761216     8251945.430590
+190819.386709     8251945.440218
+190819.376630     8251946.066007
+190819.275818     8251952.325430
+190819.215333     8251956.080931
+190820.446912     8251957.352541
+190820.356191     8251962.985411
+190820.981683     8251962.995039
+190820.759889     8251976.766227
+190820.699404     8251980.521728
+190819.993257     8251985.519944
+190814.977713     8251986.068686
+190808.015128     8251990.969835
+190792.928919     8251995.120759
+190774.028519     8252002.968641
+190760.163822     8252009.016201
+190754.512694     8252010.181869
+190744.431963     8252014.409077
+190733.724963     8252018.627409
+190719.870357     8252024.048416
+190714.794315     8252028.353423
+190700.304126     8252034.391355
+190687.740819     8252037.328460
+190683.249955     8252044.146253
+190683.118894     8252052.283808
+190683.098737     8252053.535387
+190683.674587     8252056.674738
+190693.604100     8252061.836665
+190701.101456     8252062.578013
+190708.589497     8252063.945163
+190718.599665     8252064.099246
+190728.619912     8252063.627539
+190742.484609     8252057.579978
+190761.385021     8252049.731333
+190785.311055     8252040.708155
+190800.397253     8252036.557995
+190801.022745     8252036.567623
+190804.150970     8252036.615774
+190812.274582     8252037.366763
+190827.865302     8252040.737232
+190833.485418     8252041.449685
+190839.005473     8252048.422336
+190846.392702     8252056.048909
+190853.718670     8252067.431734
+190862.245993     8252081.962775
+190869.582040     8252092.719811
+190877.574604     8252101.607590
+190884.204517     8252117.362078
+190888.907546     8252136.217393
+190888.625268     8252153.744083
+190877.121400     8252168.593499
+190865.849405     8252169.045939
+190849.643272     8252165.040052
+190835.324470     8252160.436507
+190812.195303     8252158.828600
+190783.274645     8252167.148953
+190751.810939     8252177.933939
+190733.465456     8252190.173503
+190721.962352     8252205.022932
+190706.724925     8252218.562991
+190693.758370     8252246.537786
+190685.261758     8252268.946357
+190672.406094     8252290.035940
+190658.329694     8252309.228136
+190653.828751     8252316.671718
+190653.193180     8252317.287880
+190653.173010     8252318.540223
+190653.112525     8252322.295724
+190653.727939     8252322.931141
+190657.976851     8252331.136115
+190660.903453     8252343.703112
+190660.842968     8252347.458613
+190647.916740     8252372.929487
+190643.073034     8252401.655260
+190637.775974     8252419.730703
+190627.332310     8252446.492443
+190613.699172     8252476.961522
+190601.096764     8252521.220303
+190596.343791     8252544.312443
+190583.488127     8252565.402026
+190573.740530     8252587.791341
+190564.759553     8252601.427702
+190560.259374     8252608.871296
+190560.188810     8252613.252587
+190551.248160     8252624.385027
+190544.759837     8252638.685701
+190535.123132     8252654.189803
+190519.088849     8252678.360183
+190503.024305     8252704.409459
+190492.661295     8252726.163356
+190484.325980     8252738.557002
+190473.942812     8252761.562478
+190464.215373     8252782.700213
+190452.651785     8252801.305143
+190439.210192     8252819.881165
+190428.847182     8252841.635062
+190427.939411     8252859.152123
+190427.092137     8252872.912920
+190426.910671     8252884.180186
+190426.618326     8252902.331901
+190426.396532     8252916.103089
+190426.053768     8252937.385279
+190425.731175     8252957.415126
+190426.114716     8252972.447522
+190427.234652     8252980.603569
+190428.435994     8252983.752548
+190429.051395     8252984.388729
+190430.302380     8252984.407985
+190430.928636     8252984.417625
+190430.918557     8252985.043414
+190431.533971     8252985.678832
+190431.513813     8252986.930410
+190432.129215     8252987.566592
+190438.163883     8253001.433319
+190438.143726     8253002.684898
+190438.123556     8253003.937241
+190438.103399     8253005.188820
+190438.093320     8253005.814610
+190437.730387     8253028.349143
+190437.367466     8253050.882912
+190437.226327     8253059.646256
+190437.054951     8253070.286969
+190436.671860     8253094.073081
+190439.094401     8253137.937192
+190443.110690     8253160.538368
+190446.158273     8253165.593599
+190446.582905     8253178.122085
+190447.692750     8253186.904685
+190452.466343     8253201.378710
+190458.390121     8253222.130650
+190465.050270     8253236.007769
+190472.335923     8253249.893753
+190483.779756     8253277.618344
+190497.039582     8253309.127320
+190516.062189     8253332.585427
+190533.731460     8253362.284442
+190550.130353     8253393.215792
+190566.518403     8253424.772919
+190581.655469     8253456.310790
+190598.750430     8253482.869714
+190611.495653     8253507.483849
+190628.741832     8253524.653638
+190647.188577     8253544.973159
+190670.629958     8253565.994740
+190690.762411     8253598.235448
+190712.145836     8253630.496176
+190727.898315     8253662.669465
+190740.825005     8253676.016334
+190753.650883     8253695.622626
+190773.298971     8253719.091126
+190790.322604     8253750.031327
+190796.417746     8253760.143318
+190799.930288     8253775.223113
+190811.494326     8253795.436690
+190824.058859     8253831.317340
+190835.421274     8253864.049763
+190841.012368     8253905.458104
+190841.961680     8253924.255639
+190842.950555     8253940.549241
+190845.665454     8253966.260873
+190845.917934     8253989.430824
+190845.544934     8254012.590382
+190840.772555     8254036.934876
+190834.879488     8254053.122547
+190828.946094     8254071.814140
+190823.023542     8254089.879955
+190816.555389     8254102.928287
+190809.895691     8254127.869675
+190798.856019     8254152.743643
+190794.234858     8254167.699003
+190792.771406     8254180.824370
+190787.534832     8254195.144313
+190781.712341     8254206.949930
+190776.555657     8254216.262016
+190770.854887     8254220.557407
+190769.593060     8254221.163929
+190764.527873     8254224.842394
+190763.901617     8254224.832755
+190753.084490     8254235.936311
+190734.708771     8254250.053243
+190719.491513     8254262.340959
+190706.131326     8254275.909913
+190684.072453     8254285.587775
+190664.627204     8254288.418949
+190650.802834     8254291.962588
+190626.927205     8254297.856054
+190599.852775     8254308.083423
+190575.261697     8254319.600142
+190548.207437     8254328.575168
+190529.902269     8254338.311574
+190506.582332     8254348.595970
+190475.078299     8254361.884879
+190454.754763     8254380.354970
+190438.195788     8254398.257063
+190425.440936     8254413.087224
+190413.907596     8254429.814021
+190400.617221     8254439.000909
+190385.451133     8254448.158925
+190350.253091     8254457.635306
+190321.261869     8254470.336948
+190290.383328     8254483.635485
+190250.816931     8254492.417916
+190219.393540     8254500.699745
+190189.301788     8254503.992986
+190158.584544     8254507.276600
+190116.525492     8254515.394718
+190073.930918     8254517.869563
+190043.214438     8254521.153188
+190002.476935     8254524.909272
+189966.703819     8254531.245549
+189928.458970     8254535.665946
+189893.362516     8254538.882152
+189841.312703     8254545.593833
+189815.641239     8254546.451335
+189796.185911     8254549.908299
+189781.160199     8254550.302959
+189766.709573     8254553.836957
+189737.244077     8254557.139838
+189715.901417     8254561.194460
+189692.682293     8254565.219433
+189675.002629     8254574.964703
+189656.677304     8254585.952688
+189641.965333     8254605.761045
+189611.682035     8254620.947342
+189583.790568     8254643.058139
+189552.215971     8254660.728338
+189516.302479     8254675.827971
+189484.233426     8254685.352515
+189455.857618     8254698.689576
+189438.702635     8254714.703896
+189428.480764     8254727.694449
+189424.525423     8254740.155515
+189418.571871     8254760.098686
+189410.025605     8254785.637744
+189399.026247     8254808.008554
+189389.198009     8254835.404948
+189368.784516     8254859.507920
+189350.116415     8254891.778860
+189325.988756     8254913.320882
+189306.210847     8254936.806929
+189280.842269     8254957.704670
+189257.320709     8254980.507912
+189224.585085     8254992.525974
+189200.599316     8255005.305428
+189166.653047     8255014.799548
+189131.405363     8255027.405652
+189078.114656     8255033.471524
+189040.515457     8255036.649970
+188992.946430     8255037.169647
+188947.132885     8255045.230738
+188903.287326     8255047.686328
+188875.133300     8255047.252964
+188852.135957     8255037.507513
+188822.225684     8255029.532723
+188795.463769     8255020.356034
+188764.272238     8255014.241650
+188733.060574     8255009.377315
+188713.201523     8254999.054991
+188695.148410     8254993.141312
+188676.449623     8254988.471112
+188656.530099     8254981.903524
+188626.589553     8254975.808395
+188594.792712     8254968.431275
+188570.462966     8254963.674401
+188547.949989     8254962.701158
+188529.886760     8254957.415561
+188510.502007     8254956.490470
+188473.649295     8254952.166014
+188447.372509     8254951.761546
+188431.731383     8254951.520788
+188412.951941     8254951.858432
+188388.541540     8254952.109401
+188366.573401     8254956.153631
+188347.783892     8254957.116300
+188333.959510     8254960.660703
+188318.197414     8254967.930947
+188304.241232     8254979.611365
+188292.859110     8254986.949028
+188292.849019     8254987.575581
+188292.838928     8254988.202135
+188292.828862     8254988.827160
+188292.818771     8254989.453714
+188292.808704     8254990.078739
+188292.182448     8254990.069099
+188280.840641     8254994.903604
+188263.887270     8254998.399844
+188241.747755     8255013.084786
+188209.547641     8255030.746885
+188182.302612     8255051.614215
+188151.353507     8255069.294042
+188127.831158     8255092.098800
+188111.887596     8255110.636310
+188105.419455     8255123.683878
+188100.929342     8255130.502446
+188100.142566     8255140.506978
+188091.060764     8255160.403526
+188078.013579     8255193.384638
+188062.433388     8255228.206886
+188051.959475     8255256.846760
+188050.466170     8255271.849501
+188049.628962     8255284.985272
+188050.042764     8255298.138771
+188058.176918     8255337.081713
+188066.028411     8255393.551338
+188076.190616     8255423.135564
+188086.958181     8255453.979468
+188098.301215     8255487.962718
+188117.302876     8255512.673921
+188130.088427     8255534.784134
+188136.092847     8255550.528994
+188148.303312     8255569.499869
+188160.110528     8255613.508434
+188172.685153     8255648.762530
+188187.135465     8255684.047027
+188199.619344     8255724.935520
+188215.946897     8255760.248913
+188229.832978     8255791.767528
+188242.608462     8255814.502767
+188252.245631     8255837.816408
+188257.594310     8255855.429773
+188258.744482     8255861.708451
+188258.734391     8255862.335005
+188259.309478     8255865.474344
+188265.424801     8255874.333228
+188269.068379     8255881.276995
+188269.058313     8255881.902021
+188269.048222     8255882.528574
+188269.028064     8255883.780153
+188270.218552     8255887.555674
+188273.800894     8255898.254167
+188279.169731     8255914.615952
+188286.314257     8255937.264516
+188291.057602     8255953.616674
+188291.531876     8255963.015436
+188298.101316     8255982.524660
+188302.673285     8256009.517531
+188309.807720     8256032.792648
+188317.417169     8256065.468068
+188322.624721     8256091.844012
+188322.513843     8256098.728461
+188322.312219     8256111.247306
+188322.050098     8256127.522416
+188321.737570     8256146.927238
+188315.894922     8256159.984434
+188315.178684     8256165.609203
+188310.778553     8256166.793363
+188310.758395     8256168.044942
+188310.748304     8256168.671495
+188304.481788     8256169.200217
+188303.836138     8256170.442168
+188292.504397     8256174.651648
+188286.732312     8256183.327553
+188276.661647     8256186.929736
+188265.934502     8256192.398883
+188235.702375     8256204.455480
+188197.992297     8256214.518374
+188178.546284     8256217.349536
+188178.536193     8256217.976090
+188174.782476     8256217.918310
+188173.531491     8256217.899054
+188168.536116     8256217.195454
+188162.965631     8256213.354042
+188149.292491     8256207.507782
+188123.762167     8256199.601940
+188087.635758     8256189.027690
+188047.089800     8256180.890718
+188017.189976     8256172.290909
+187974.726820     8256166.629733
+187934.080074     8256164.750655
+187896.561530     8256162.921258
+187859.032894     8256161.718414
+187817.114600     8256161.073181
+187770.181156     8256160.975933
+187723.207372     8256163.383371
+187666.899319     8256162.516643
+187625.677463     8256157.499754
+187560.670724     8256152.741935
+187504.372737     8256151.250181
+187448.155429     8256144.749055
+187398.790173     8256140.233528
+187344.358978     8256139.395689
+187300.634389     8256134.340277
+187254.962378     8256133.637265
+187201.227264     8256128.426236
+187152.517749     8256122.042204
+187114.454366     8256115.195334
+187053.231568     8256108.618690
+187011.555620     8256092.949932
+186972.957085     8256080.460560
+186939.242663     8256075.559230
+186904.206694     8256075.019935
+186870.320897     8256080.759318
+186832.651159     8256088.317527
+186802.569868     8256090.984984
+186773.164475     8256090.532358
+186742.618976     8256083.176028
+186696.512648     8256070.569563
+186662.213049     8256063.155447
+186631.132422     8256050.155086
+186588.729787     8256040.736117
+186546.306971     8256032.570256
+186511.371432     8256025.771532
+186470.805316     8256018.886139
+186428.271597     8256017.606253
+186392.064916     8256012.039853
+186349.591693     8256007.003702
+186305.231163     8256002.563682
+186270.195194     8256002.024386
+186225.219239     8255996.949712
+186177.044495     8255996.208177
+186140.706753     8255998.779331
+186106.286209     8255998.874690
+186067.435644     8256002.033874
+186035.527900     8256001.542730
+186001.823570     8255996.014847
+185949.340179     8255990.824614
+185910.741644     8255978.335242
+185883.384510     8255967.269264
+185860.396851     8255956.898782
+185827.439365     8255943.869531
+185793.280918     8255927.691307
+185756.610054     8255912.099591
+185716.154817     8255898.329750
+185681.935898     8255885.906262
+185642.025498     8255877.153893
+185595.899013     8255865.799006
+185552.870862     8255856.371938
+185527.915624     8255851.605435
+185504.312565     8255840.598771
+185465.673714     8255830.612557
+185436.449788     8255818.892664
+185410.404492     8255804.091212
+185384.995138     8255788.674368
+185350.776218     8255776.250881
+185314.104947     8255760.660687
+185279.310942     8255745.097860
+185240.793061     8255727.600644
+185209.752748     8255712.097125
+185187.481710     8255696.101879
+185164.766264     8255668.829733
+185139.427115     8255649.030065
+185105.329141     8255629.097104
+185067.992063     8255616.000440
+185047.487005     8255606.918532
+185016.961663     8255598.310624
+184976.466136     8255587.042412
+184929.774606     8255571.924689
+184899.289247     8255560.810560
+184863.728215     8255554.002208
+184823.222573     8255543.362078
+184787.661732     8255536.553730
+184762.736743     8255529.909094
+184725.319010     8255521.820274
+184690.353438     8255516.898157
+184665.973477     8255515.270997
+184657.214485     8255515.136173
+184653.460577     8255515.078391
+184635.942401     8255514.808740
+184595.880999     8255515.443980
+184563.287075     8255518.699470
+184533.175344     8255523.245057
+184505.495783     8255532.210458
+184480.863792     8255546.231854
+184451.892549     8255557.681151
+184429.177757     8255569.226751
+184413.385413     8255578.375127
+184393.839160     8255587.465721
+184373.596827     8255600.929505
+184361.528168     8255612.012268
+184352.647991     8255619.389971
+184348.248432     8255620.574140
+184348.187960     8255624.328876
+184342.446290     8255631.128180
+184337.350294     8255636.684005
+184333.455234     8255645.390332
+184323.263599     8255656.503515
+184311.729687     8255673.230304
+184306.643948     8255678.161106
+184292.233840     8255679.191186
+184264.634933     8255683.148743
+184225.088312     8255690.679590
+184177.448530     8255695.580555
+184144.148268     8255703.834258
+184116.458449     8255713.424681
+184073.147828     8255721.524299
+184043.661996     8255726.077992
+184025.397143     8255733.311240
+184012.188187     8255737.490296
+183991.451065     8255742.805363
+183960.068001     8255748.583270
+183929.946370     8255753.755414
+183905.384967     8255763.393991
+183879.572174     8255773.014836
+183850.590840     8255785.090686
+183817.835440     8255798.360333
+183791.336681     8255811.726286
+183762.355347     8255823.802136
+183723.959090     8255837.611664
+183681.809114     8255851.363413
+183652.837871     8255862.812710
+183630.143236     8255873.106731
+183601.817809     8255883.315608
+183563.461891     8255894.620450
+183557.000000     8255896.915596
+END
+LINE3D
+HEIGHT 1110.000000
+183557.000000     8255579.169455
+183557.906957     8255578.982443
+183600.551555     8255573.377881
+183643.327214     8255559.635763
+183675.557742     8255540.097062
+183704.690294     8255518.632078
+183733.086285     8255504.041911
+183752.622446     8255495.577870
+183769.070722     8255484.560993
+183783.682263     8255471.012064
+183808.425157     8255450.104692
+183841.967524     8255426.830516
+183878.002201     8255404.218356
+183905.237712     8255383.977589
+183932.442808     8255365.613423
+183962.100232     8255350.417492
+183994.270097     8255334.633525
+184010.708281     8255324.243201
+184019.608425     8255315.613916
+184025.360353     8255308.189590
+184036.167580     8255297.712590
+184053.352417     8255279.820895
+184066.712807     8255266.251180
+184075.612926     8255257.623423
+184091.445585     8255245.971889
+184122.374366     8255229.542110
+184143.333079     8255210.456616
+184152.374540     8255193.064753
+184164.554103     8255175.096014
+184181.940398     8255144.683943
+184200.547978     8255116.170796
+184223.514634     8255088.975108
+184252.162630     8255058.737913
+184270.245362     8255023.954185
+184282.495489     8255001.604155
+184286.430864     8254990.394671
+184287.742536     8254986.657665
+184292.233006     8254979.840630
+184301.849554     8254965.588107
+184317.823365     8254945.172464
+184335.643786     8254926.663844
+184350.911449     8254911.246417
+184359.771254     8254905.121818
+184367.430098     8254895.848246
+184376.280002     8254890.350204
+184384.473808     8254886.719132
+184394.484167     8254886.873217
+184414.524851     8254885.929806
+184440.176336     8254886.324650
+184471.398115     8254890.560902
+184494.486561     8254894.673490
+184514.436524     8254899.362948
+184528.110045     8254905.209214
+184540.471728     8254914.790954
+184552.207727     8254924.363064
+184567.637163     8254937.747692
+184594.217420     8254958.191645
+184635.066252     8254986.369620
+184655.935088     8255011.734744
+184668.841608     8255026.333956
+184676.723078     8255042.107708
+184685.734754     8255065.411721
+184693.535378     8255086.193315
+184705.614807     8255113.300216
+184714.485331     8255145.368338
+184727.765696     8255175.625741
+184740.561529     8255197.109404
+184745.465801     8255203.445868
+184748.573868     8255204.745598
+184749.189460     8255205.381783
+184755.395505     8255208.607797
+184762.166735     8255215.599708
+184777.051142     8255223.966862
+184790.734564     8255229.186571
+184801.350448     8255230.601866
+184805.730040     8255230.669279
+184812.622049     8255230.150185
+184827.778834     8255221.617206
+184857.325163     8255213.307249
+184888.062386     8255208.771290
+184910.040617     8255204.100507
+184935.692293     8255204.495353
+184963.159948     8255208.675348
+184989.366552     8255213.461113
+185008.650493     8255220.645626
+185019.730942     8255232.086243
+185038.177700     8255252.405000
+185057.108822     8255281.495965
+185076.080236     8255308.085300
+185091.348362     8255331.485616
+185108.019073     8255345.516060
+185123.448483     8255358.902217
+185146.355487     8255374.280543
+185168.586210     8255392.778947
+185192.754647     8255407.551509
+185216.317367     8255421.062859
+185251.656617     8255441.641635
+185278.912963     8255458.965507
+185303.686735     8255474.999276
+185321.638654     8255487.172372
+185342.093331     8255499.382463
+185371.902816     8255513.615147
+185397.312146     8255529.033519
+185420.874891     8255542.543340
+185451.985767     8255553.665569
+185479.998642     8255562.863041
+185503.631950     8255571.991573
+185525.418623     8255579.214610
+185549.072471     8255587.091568
+185573.957145     8255596.239361
+185598.851886     8255604.762129
+185626.935349     8255609.576783
+185643.141470     8255613.583434
+185652.465649     8255617.484154
+185659.953308     8255618.851297
+185669.267420     8255623.377042
+185681.154446     8255623.560015
+185703.677897     8255623.906710
+185725.565382     8255624.870324
+185738.683618     8255626.324137
+185738.673551     8255626.949163
+185746.090622     8255632.699125
+185759.703671     8255642.300127
+185777.655615     8255654.471694
+185793.236244     8255658.468717
+185806.324613     8255661.800669
+185821.955672     8255662.666452
+185838.787668     8255666.682736
+185847.415409     8255674.955112
+185857.345304     8255680.117045
+185862.279824     8255684.575376
+185881.432728     8255699.895917
+185895.106250     8255705.742182
+185903.734397     8255714.013036
+185904.339707     8255715.275771
+185907.962389     8255723.469578
+185917.831787     8255732.387775
+185921.514941     8255736.826845
+185935.793797     8255743.934317
+185946.985150     8255748.488958
+185951.313954     8255751.686076
+185961.829026     8255759.360795
+185977.934717     8255769.626874
+185988.459499     8255776.675033
+185995.856412     8255783.676574
+186006.946571     8255794.490631
+186019.853473     8255809.089849
+186024.717430     8255817.929471
+186033.900482     8255830.592771
+186036.867398     8255840.656610
+186037.492890     8255840.666238
+186038.118764     8255840.675872
+186041.872482     8255840.733652
+186052.518615     8255840.270815
+186076.111583     8255851.904032
+186104.063986     8255864.856241
+186109.069070     8255864.933283
+186112.197295     8255864.981434
+186121.581970     8255865.125889
+186139.655266     8255869.786461
+186154.670899     8255870.017591
+186158.364120     8255873.831635
+186162.723554     8255875.150627
+186167.032582     8255879.599331
+186167.597577     8255883.365224
+186176.296288     8255887.254787
+186186.245959     8255891.165135
+186196.861843     8255892.580430
+186204.319254     8255895.825706
+186214.309264     8255897.231368
+186214.299173     8255897.857922
+186219.364754     8255894.178698
+186237.094429     8255881.304475
+186256.055338     8255869.699564
+186271.212099     8255861.168113
+186284.451304     8255855.110925
+186298.296225     8255850.314949
+186310.809126     8255850.507556
+186325.198886     8255850.729052
+186335.209435     8255850.883140
+186338.963153     8255850.940920
+186347.177116     8255846.058269
+186365.421787     8255840.078127
+186378.630744     8255835.899071
+186393.646377     8255836.130201
+186405.523695     8255836.939733
+186426.694585     8255843.526583
+186454.788139     8255847.714684
+186488.472312     8255854.494146
+186512.761336     8255861.755701
+186540.108404     8255873.446703
+186561.844695     8255883.797924
+186582.359845     8255892.253278
+186601.684506     8255896.933112
+186622.250061     8255902.258755
+186644.036735     8255909.481792
+186659.041920     8255910.337941
+186671.534639     8255911.783654
+186676.540104     8255911.860702
+186677.165597     8255911.870330
+186680.919314     8255911.928109
+186707.196482     8255912.332583
+186747.933997     8255908.575735
+186775.573410     8255902.115023
+186800.043901     8255898.109312
+186830.771249     8255894.198381
+186865.807218     8255894.737676
+186891.438711     8255896.385630
+186902.064687     8255897.174372
+186910.823488     8255897.309193
+186936.979687     8255905.224668
+186983.166669     8255912.823290
+187024.933363     8255922.857651
+187059.273276     8255927.768608
+187094.299536     8255928.934463
+187132.413325     8255932.651621
+187160.567351     8255933.084985
+187186.834453     8255934.114485
+187205.533216     8255938.786212
+187213.656458     8255939.536431
+187226.098796     8255944.110327
+187247.814905     8255955.714655
+187272.013590     8255968.609085
+187291.883090     8255978.306390
+187325.566881     8255985.085846
+187371.127989     8255992.674834
+187396.022730     8256001.197602
+187409.776930     8256002.034495
+187419.777389     8256002.815137
+187435.973444     8256007.446813
+187460.363662     8256008.448951
+187490.999882     8256010.172412
+187503.502716     8256010.990044
+187503.492625     8256011.616597
+187507.872217     8256011.684011
+187522.362788     8256005.646084
+187534.946252     8256001.457400
+187547.459153     8256001.650006
+187564.977138     8256001.919654
+187590.002939     8256002.304866
+187626.290657     8256002.863429
+187651.941951     8256003.258270
+187680.721469     8256003.701262
+187701.993553     8256004.028695
+187713.880962     8256004.211673
+187737.655397     8256004.577624
+187762.610635     8256009.344127
+187784.447714     8256013.437453
+187808.787169     8256017.567768
+187825.588916     8256023.462185
+187850.534087     8256028.853713
+187869.848658     8256034.160100
+187882.280904     8256039.360550
+187894.733307     8256043.309421
+187907.861634     8256044.136681
+187934.764294     8256044.550783
+187954.895890     8256037.974506
+187977.509704     8256032.686798
+187988.953087     8256021.592882
+187998.579702     8256006.715333
+188006.601288     8255974.907225
+188015.894755     8255941.868334
+188024.532125     8255910.696413
+188024.945464     8255885.032169
+188020.948963     8255861.178644
+188013.864934     8255834.773815
+188000.382945     8255817.035258
+187980.846130     8255786.681552
+187960.128513     8255751.927294
+187945.526575     8255726.033454
+187934.728786     8255697.066153
+187921.952920     8255674.330908
+187907.381256     8255646.557408
+187896.452025     8255625.727657
+187890.447604     8255609.982797
+187880.790279     8255587.920735
+187866.894488     8255557.028679
+187855.359922     8255534.937721
+187843.159549     8255515.340293
+187832.341577     8255487.626100
+187820.534361     8255443.617534
+187808.565835     8255409.624657
+187798.333042     8255384.423249
+187786.465353     8255344.169421
+187774.042711     8255299.526202
+187765.717024     8255272.475552
+187762.094367     8255264.280218
+187758.511643     8255253.581719
+187752.497157     8255238.461885
+187741.870719     8255198.855400
+187733.070758     8255162.405988
+187729.094414     8255137.300883
+187729.356535     8255121.025773
+187734.694686     8255100.446420
+187739.396489     8255080.483980
+187740.728510     8255075.495398
+187743.947456     8255069.910680
+187754.785122     8255057.555552
+187770.738776     8255038.391488
+187790.395715     8255022.416443
+187808.166112     8255007.037540
+187826.591868     8254989.790126
+187851.355110     8254967.631177
+187877.904465     8254951.135516
+187901.264717     8254938.347962
+187922.123024     8254925.520368
+187946.068834     8254915.245606
+187979.409411     8254904.488745
+188014.606690     8254895.012353
+188039.218689     8254882.244066
+188060.127020     8254866.286755
+188084.324861     8254840.363436
+188108.422271     8254820.699546
+188135.616919     8254802.960399
+188159.633675     8254788.304353
+188181.107383     8254776.112940
+188203.801827     8254765.818916
+188220.764501     8254761.697640
+188234.024652     8254754.387356
+188249.786748     8254747.117112
+188262.390369     8254741.676849
+188269.988550     8254736.158011
+188283.247913     8254728.849244
+188304.600639     8254724.169597
+188334.803294     8254713.990379
+188380.555565     8254709.686306
+188411.948708     8254703.282609
+188440.173310     8254699.333919
+188467.711923     8254699.131865
+188497.116935     8254699.584486
+188515.886286     8254699.873395
+188534.574982     8254705.170148
+188548.329553     8254706.007812
+188570.741730     8254713.239713
+188587.512871     8254721.010728
+188613.679518     8254728.301184
+188638.624665     8254733.694241
+188661.712753     8254737.805294
+188684.791514     8254742.542913
+188719.141494     8254746.828845
+188752.905558     8254748.600452
+188773.491652     8254752.674522
+188797.185814     8254758.048322
+188853.221680     8254775.815186
+188894.453627     8254780.205521
+188921.982162     8254780.629257
+188944.595951     8254775.343077
+188969.097072     8254769.459239
+188989.278717     8254759.751717
+189012.003410     8254747.579560
+189035.485407     8254727.280252
+189060.298279     8254701.992345
+189096.918681     8254681.894507
+189135.476033     8254658.070816
+189162.045940     8254640.322818
+189177.343088     8254623.027247
+189184.477825     8254607.484633
+189192.156635     8254596.959479
+189197.353647     8254585.143470
+189205.022378     8254575.244106
+189213.357693     8254562.850459
+189224.194977     8254550.495324
+189248.847317     8254535.222352
+189271.047329     8254516.781145
+189282.469778     8254506.939560
+189287.616383     8254498.253263
+189296.012183     8254482.104115
+189314.427478     8254465.482485
+189337.848990     8254448.938678
+189371.805363     8254438.817240
+189401.301095     8254433.636991
+189418.283939     8254428.263372
+189435.307874     8254420.385842
+189451.705540     8254412.499437
+189478.759800     8254403.524411
+189517.771281     8254390.350297
+189546.247901     8254370.753814
+189585.319866     8254353.824200
+189618.126054     8254337.424847
+189657.742857     8254325.512704
+189688.601241     8254313.465747
+189715.070336     8254301.977171
+189752.134000     8254293.156216
+189779.137854     8254287.310901
+189786.080282     8254283.661332
+189786.705774     8254283.670960
+189790.460255     8254283.728751
+189802.983234     8254283.295568
+189802.993326     8254282.669014
+189807.443099     8254278.355131
+189808.764647     8254273.993097
+189809.411073     8254272.750394
+189813.245432     8254267.801094
+189822.014707     8254267.309367
+189832.761258     8254260.587865
+189840.369505     8254254.444002
+189873.054723     8254245.555651
+189909.038778     8254226.074727
+189956.789272     8254214.287783
+189988.323554     8254199.120742
+190023.440941     8254194.652205
+190053.067734     8254181.334401
+190071.927819     8254175.989677
+190088.365812     8254165.599350
+190102.251443     8254158.299458
+190144.340731     8254148.303971
+190179.013316     8254132.559292
+190209.962433     8254114.878701
+190230.749401     8254106.433150
+190259.660744     8254098.738599
+190277.884481     8254094.010789
+190286.724319     8254089.137772
+190297.451476     8254083.667861
+190320.902473     8254065.245909
+190340.609831     8254046.140389
+190349.641202     8254029.375080
+190355.352815     8254024.453912
+190361.962107     8254002.642235
+190370.468034     8253979.607864
+190374.434218     8253966.521020
+190382.133198     8253954.743523
+190396.896352     8253931.804703
+190410.458150     8253905.717667
+190418.399082     8253878.917403
+190423.051243     8253862.084687
+190427.803452     8253838.992536
+190431.889855     8253818.393915
+190432.141885     8253802.745358
+190432.928674     8253792.740062
+190433.261358     8253772.083662
+190433.180254     8253738.272998
+190428.770333     8253701.265980
+190424.753292     8253678.664028
+190415.620647     8253662.871016
+190409.051219     8253643.361028
+190401.179637     8253626.961483
+190389.029657     8253604.235107
+190368.222070     8253575.114494
+190351.258170     8253540.418016
+190342.992968     8253509.611865
+190332.215718     8253479.392992
+190324.021080     8253444.205551
+190308.924342     8253410.163758
+190293.918324     8253370.489095
+190280.536766     8253346.491109
+190267.610076     8253333.144240
+190249.768653     8253314.086690
+190237.558188     8253295.115816
+190221.583928     8253276.712952
+190204.519979     8253248.275908
+190188.665924     8253222.362030
+190175.113742     8253209.005533
+190162.772229     8253198.171449
+190144.819915     8253185.999112
+190126.938165     8253169.445484
+190103.516954     8253147.171560
+190083.172799     8253128.075487
+190065.937462     8253110.279920
+190053.626186     8253097.568468
+190030.123569     8253080.301612
+189992.241641     8253062.188240
+189961.947814     8253039.181819
+189940.372832     8253018.814911
+189928.172446     8252999.218247
+189911.633178     8252977.050254
+189888.281779     8252950.394264
+189870.500841     8252927.581213
+189858.835214     8252913.627811
+189854.022057     8252901.657719
+189849.177888     8252891.565749
+189845.726607     8252872.729701
+189840.629958     8252839.467780
+189840.952551     8252819.437933
+189841.013036     8252815.682432
+189841.023127     8252815.055878
+189841.819995     8252804.424793
+189850.800960     8252790.789196
+189861.669256     8252776.555940
+189880.700716     8252760.570503
+189915.403550     8252742.947692
+189946.291419     8252729.022590
+189973.951001     8252721.309535
+190006.009964     8252712.411545
+190048.190748     8252696.782436
+190076.031810     8252677.801351
+190098.887550     8252657.492403
+190124.972341     8252630.971420
+190150.461875     8252602.563441
+190175.780034     8252584.796175
+190189.755622     8252571.863402
+190205.043443     8252555.194397
+190218.494364     8252535.991809
+190231.976271     8252514.912629
+190248.726792     8252485.117480
+190264.085189     8252464.066420
+190283.146898     8252446.202851
+190303.479748     8252427.106959
+190315.740156     8252404.130379
+190330.563031     8252377.436045
+190344.710758     8252353.862571
+190356.254189     8252336.509221
+190366.486902     8252322.892891
+190377.979927     8252308.669252
+190386.860080     8252301.293077
+190393.873083     8252293.261453
+190400.845759     8252287.733750
+190421.038234     8252277.401215
+190440.715356     8252260.173063
+190455.347449     8252245.371797
+190469.968687     8252231.197074
+190482.733618     8252215.741123
+190495.528797     8252198.407040
+190512.784592     8252176.133297
+190518.797877     8252152.433848
+190519.766884     8252131.162062
+190519.644688     8252099.855309
+190509.573586     8252064.638220
+190503.770789     8252036.374514
+190500.056937     8251994.995070
+190499.985147     8251960.558605
+190496.564102     8251939.845189
+190492.426843     8251924.755014
+190492.658716     8251910.358036
+190491.608592     8251897.819923
+190491.880779     8251880.919788
+190490.992716     8251858.366763
+190490.810799     8251830.815522
+190491.173720     8251808.281753
+190487.136510     8251786.932144
+190481.949891     8251759.303868
+190475.561166     8251728.526601
+190467.781081     8251706.493434
+190463.632968     8251692.029801
+190458.174161     8251681.301661
+190447.164275     8251665.479753
+190426.416409     8251632.603628
+190405.002735     8251602.221032
+190397.696924     8251589.586628
+190393.953286     8251588.903059
+190394.023849     8251584.521769
+190390.410507     8251575.700633
+190378.765814     8251560.494899
+190372.751315     8251545.375828
+190364.940218     8251525.220783
+190357.906607     8251495.685478
+190349.651484     8251464.253538
+190344.403604     8251440.381515
+190338.399184     8251424.636655
+190329.932358     8251406.349350
+190323.423415     8251383.083860
+190317.550055     8251359.201445
+190307.922978     8251335.261250
+190300.626482     8251322.001045
+190292.664930     8251311.235145
+190281.624808     8251297.290606
+190271.231087     8251282.104892
+190258.455627     8251259.368125
+190249.322982     8251243.575113
+190239.483426     8251232.780306
+190227.858890     8251216.322993
+190214.336192     8251201.088352
+190199.552431     8251186.460244
+190179.118306     8251172.997816
+190155.656004     8251153.227802
+190137.370556     8251122.893358
+190120.911930     8251095.718285
+190106.218902     8251075.456544
+190099.568820     8251060.954399
+190090.325284     8251052.046600
+190081.071669     8251043.764590
+190068.750301     8251031.679692
+190047.700011     8251017.581070
+190030.544565     8250994.777648
+190017.194007     8250968.902305
+190001.280231     8250946.743940
+189989.745665     8250924.652982
+189980.007697     8250907.598000
+189972.146193     8250890.572665
+189962.014593     8250859.111841
+189948.633035     8250835.113855
+189932.113924     8250811.694283
+189914.282580     8250792.010944
+189902.112443     8250770.536148
+189890.557719     8250749.696769
+189877.872980     8250721.327132
+189860.688050     8250700.401854
+189842.876876     8250679.466172
+189821.826573     8250665.368315
+189800.181027     8250649.382697
+189774.842248     8250629.583799
+189752.086093     8250604.815569
+189737.373660     8250585.806183
+189712.630137     8250567.894281
+189687.270437     8250549.346950
+189661.275917     8250531.416556
+189642.708190     8250518.608802
+189629.791591     8250504.635379
+189616.289051     8250488.149159
+189607.105999     8250475.485859
+189599.830425     8250460.974086
+189590.717949     8250443.928731
+189574.753767     8250424.900077
+189553.774040     8250406.420166
+189537.093633     8250393.015517
+189517.849244     8250383.327834
+189499.261347     8250371.772422
+189485.598274     8250365.301137
+189473.276918     8250353.215475
+189447.817170     8250340.927578
+189411.125742     8250326.588963
+189378.258607     8250307.926073
+189354.050606     8250295.657445
+189337.944521     8250285.392123
+189318.710975     8250275.078663
+189299.527847     8250261.634726
+189280.465676     8250240.680552
+189266.468704     8250216.047149
+189254.258239     8250197.076275
+189245.034860     8250186.916896
+189235.216238     8250174.869758
+189224.772123     8250162.812991
+189216.789650     8250153.298658
+189216.184315     8250152.037452
+189215.568902     8250151.402034
+189214.962816     8250150.140051
+189210.028677     8250145.681726
+189206.285038     8250144.998157
+189200.099164     8250140.519799
+189199.482987     8250139.884370
+189198.242081     8250139.239325
+189194.498442     8250138.555756
+189188.302489     8250134.703188
+189187.050740     8250134.683920
+189182.732015     8250130.861012
+189178.988377     8250130.177443
+189178.423369     8250126.412314
+189172.187089     8250125.063668
+189167.877679     8250120.614958
+189167.887757     8250119.989169
+189163.599281     8250114.288128
+189158.684548     8250108.577448
+189154.385981     8250103.502960
+189153.154402     8250102.231350
+189148.220264     8250097.773024
+189140.247870     8250087.632902
+189132.831168     8250081.883709
+189126.665451     8250076.153773
+189122.356041     8250071.705063
+189121.740640     8250071.068882
+189120.489655     8250071.049626
+189115.484189     8250070.972579
+189109.873389     8250069.634325
+189106.119671     8250069.576545
+189100.488713     8250069.489870
+189091.679888     8250072.484766
+189087.229351     8250076.798637
+189079.419480     8250095.461347
+189077.673750     8250126.113403
+189085.181949     8250126.228974
+189093.304797     8250126.979950
+189097.674679     8250127.673923
+189097.654522     8250128.925502
+189104.415495     8250136.542435
+189104.395325     8250137.794778
+189104.839363     8250149.070908
+189104.738551     8250155.330331
+189103.981998     8250163.458258
+189098.189744     8250173.386506
+189091.287631     8250174.532918
+189081.227057     8250177.508547
+189066.312236     8250171.017994
+189053.335152     8250160.800072
+189046.018486     8250148.792210
+189046.109219     8250143.158577
+189045.554303     8250138.766894
+189041.961882     8250128.694191
+189033.969331     8250119.805648
+189029.045271     8250114.721533
+189020.497790     8250101.442071
+189003.261703     8250083.645728
+188990.345091     8250069.673070
+188982.898153     8250065.801246
+188982.918311     8250064.549667
+188978.548416     8250063.856458
+188967.367918     8250058.675276
+188942.473165     8250050.153272
+188921.342220     8250041.062495
+188902.663603     8250035.139952
+188887.718533     8250030.527532
+188870.291663     8250024.624257
+188853.489522     8250018.730598
+188838.564622     8250012.865835
+188832.378735     8250008.388241
+188824.871300     8250008.272682
+188812.358399     8250008.080076
+188791.146800     8250003.997142
+188778.028577     8250002.542565
+188768.088973     8249998.007192
+188753.698831     8249997.785690
+188740.550360     8249998.209246
+188740.540281     8249998.835035
+188739.894619     8250000.077750
+188727.200264     8250011.151646
+188711.922521     8250027.194863
+188696.069680     8250040.099504
+188680.842344     8250053.013009
+188661.831041     8250067.746867
+188639.015628     8250085.551892
+188621.235140     8250101.557349
+188604.787068     8250112.573466
+188589.075366     8250116.714762
+188566.481734     8250120.749364
+188547.016327     8250124.832117
+188530.042798     8250129.579935
+188514.230297     8250139.979890
+188502.182343     8250149.812611
+188490.103401     8250161.521925
+188469.759696     8250181.244359
+188436.167483     8250207.649018
+188401.898596     8250237.174514
+188373.462290     8250254.267839
+188352.674572     8250262.712614
+188324.995583     8250271.678024
+188285.448580     8250279.208865
+188253.470272     8250283.099011
+188229.685364     8250283.359608
+188217.111979     8250286.922503
+188206.990920     8250293.653632
+188189.371742     8250299.643402
+188169.250594     8250305.594659
+188155.365357     8250312.893793
+188141.459951     8250321.445269
+188126.898803     8250331.865250
+188108.553702     8250344.104820
+188088.906447     8250359.454834
+188064.274660     8250373.475469
+188047.251107     8250381.353004
+188046.605075     8250382.594949
+188045.898928     8250387.593165
+188044.566919     8250392.580983
+188039.491260     8250396.885996
+188029.339953     8250405.495258
+188017.200514     8250420.960836
+188003.164059     8250437.649104
+187994.183476     8250451.284708
+187984.566928     8250465.537231
+187971.721343     8250486.001025
+187959.026988     8250497.074921
+187957.715137     8250500.811160
+187957.634482     8250505.819004
+187953.103672     8250515.140725
+187952.407617     8250519.512387
+187951.731336     8250522.632465
+187947.261011     8250528.198684
+187936.453963     8250538.676451
+187930.691957     8250546.726567
+187929.995889     8250551.098993
+187928.552990     8250562.972023
+187927.675085     8250578.610946
+187927.231510     8250606.152559
+187927.484372     8250629.322515
+187930.905417     8250650.035931
+187930.663466     8250665.058699
+187923.469008     8250684.356825
+187912.298658     8250717.368355
+187896.193799     8250745.920788
+187884.124924     8250757.005077
+187873.489264     8250756.841366
+187860.410986     8250752.882861
+187843.538651     8250751.371263
+187826.101321     8250746.093771
+187802.397449     8250741.346530
+187773.123117     8250732.756349
+187740.690311     8250725.996149
+187706.915787     8250724.850326
+187663.877175     8250716.049041
+187637.105575     8250707.497384
+187607.276314     8250694.516284
+187571.866501     8250678.318798
+187538.919093     8250664.663758
+187522.187897     8250654.388815
+187508.564769     8250645.413602
+187485.587215     8250634.415802
+187462.640278     8250621.540640
+187448.330779     8250616.312059
+187432.750138     8250612.315800
+187409.672153     8250607.577429
+187378.460464     8250602.714623
+187352.263951     8250597.302305
+187322.333878     8250590.580628
+187279.305357     8250581.152789
+187240.767318     8250564.907152
+187200.352421     8250548.632625
+187144.346804     8250528.987629
+187108.301407     8250513.407068
+187071.529337     8250504.075533
+187033.455876     8250497.854453
+187007.814661     8250496.833823
+186982.173064     8250495.813187
+186959.114854     8250489.823231
+186931.737920     8250480.010367
+186904.996557     8250469.581341
+186885.298445     8250449.242559
+186874.995075     8250428.423206
+186867.678804     8250416.414585
+186852.885346     8250402.412272
+186831.239800     8250386.426655
+186800.845149     8250369.680421
+186772.267255     8250356.718583
+186747.372501     8250348.196580
+186728.108337     8250339.760481
+186708.915117     8250326.943098
+186676.028194     8250309.532557
+186646.895001     8250292.179032
+186625.209128     8250278.697336
+186599.153742     8250264.522437
+186566.862075     8250248.998892
+186535.196282     8250233.484981
+186511.633550     8250219.974396
+186494.316807     8250207.185897
+186482.641484     8250193.858289
+186467.847644     8250179.855971
+186438.109116     8250161.241239
+186401.488251     8250142.521333
+186371.083904     8250126.400895
+186352.385128     8250121.729931
+186348.005537     8250121.662518
+186347.380045     8250121.652890
+186346.754170     8250121.643256
+186342.394736     8250120.324263
+186318.176276     8250108.681418
+186282.695886     8250096.865987
+186252.250842     8250083.248700
+186224.914223     8250070.932678
+186200.049730     8250060.531778
+186182.612388     8250055.255050
+186168.282731     8250051.278048
+186146.496058     8250044.055011
+186114.093870     8250035.417448
+186058.552448     8250025.797003
+186015.574334     8250013.239453
+185988.227635     8250001.549220
+185963.948308     8249993.661870
+185932.756790     8249987.546721
+185903.492524     8249978.331515
+185881.050110     8249972.976982
+185863.663186     8249964.569779
+185846.871505     8249958.050337
+185841.240547     8249957.963662
+185836.871416     8249957.270465
+185832.491825     8249957.203051
+185810.614406     8249955.614412
+185795.134577     8249945.358730
+185780.865799     8249937.625469
+185775.315483     8249932.531714
+185770.401133     8249926.821039
+185766.778094     8249918.625698
+185760.642613     8249911.018394
+185753.851404     8249905.278829
+185747.756250     8249895.167603
+185743.396828     8249893.847846
+185739.107958     8249888.147564
+185738.553041     8249883.755881
+185732.922083     8249883.669206
+185721.660549     8249883.495862
+185720.409182     8249883.476600
+185716.029973     8249883.409193
+185712.215389     8249887.106908
+185707.200214     8249887.656420
+185697.644163     8249898.152678
+185676.049485     8249917.855093
+185656.251393     8249942.594246
+185647.330901     8249952.475107
+185635.988725     8249957.308842
+185625.928151     8249960.284471
+185619.671700     8249960.188168
+185598.540756     8249951.097390
+185558.660999     8249940.466130
+185527.509796     8249931.847823
+185510.223302     8249917.181192
+185489.889607     8249897.459335
+185465.812286     8249877.053145
+185446.689248     8249859.854466
+185440.543688     8249852.872951
+185435.013924     8249846.526859
+185428.838128     8249841.422712
+185417.222908     8249824.339598
+185408.150747     8249804.791086
+185398.463185     8249784.606392
+185386.898370     8249764.393567
+185377.069669     8249752.972218
+185367.180089     8249745.307127
+185362.255659     8249740.222242
+185350.438815     8249735.657974
+185336.210352     8249725.421554
+185318.218093     8249715.753145
+185307.016674     8249711.823529
+185306.391182     8249711.813901
+185305.139815     8249711.794640
+185303.888449     8249711.775378
+185303.262957     8249711.765750
+185298.883365     8249711.698336
+185295.129647     8249711.640557
+185273.857563     8249711.313124
+185258.842312     8249711.082000
+185258.832221     8249711.708553
+185250.062959     8249712.199516
+185231.919100     8249711.920235
+185225.662650     8249711.823932
+185221.283440     8249711.756524
+185212.534335     8249710.995908
+185203.775152     8249710.861081
+185199.395942     8249710.793674
+185193.775075     8249710.080445
+185189.405562     8249709.387242
+185183.845550     8249704.919283
+185179.536534     8249700.469815
+185174.602013     8249696.011483
+185174.612092     8249695.385694
+185174.733074     8249687.873928
+185174.914528     8249676.607426
+185175.035510     8249669.095660
+185175.267370     8249654.699446
+185176.699822     8249643.451436
+185181.291116     8249630.374214
+185184.610887     8249618.529310
+185184.741935     8249610.392519
+185185.519027     8249601.013018
+185185.700494     8249589.745752
+185185.781148     8249584.737908
+185185.225838     8249580.346984
+185180.906731     8249576.524070
+185174.024788     8249576.418139
+185167.768338     8249576.321836
+185161.511887     8249576.225532
+185160.260521     8249576.206271
+185155.870851     8249576.764647
+185155.164704     8249581.762863
+185150.078978     8249586.692901
+185150.018493     8249590.448402
+185144.882348     8249598.508916
+185144.105256     8249607.888416
+185138.303304     8249618.442459
+185129.978068     8249630.210317
+185116.527160     8249649.412140
+185093.711734     8249667.217930
+185077.354001     8249672.601171
+185067.969325     8249672.456717
+185046.707702     8249671.503500
+185021.146760     8249665.475020
+184996.201613     8249660.081964
+184973.133312     8249654.718562
+184936.916552     8249649.777950
+184906.330547     8249644.924775
+184875.744542     8249640.071600
+184848.286775     8249635.265813
+184818.265777     8249634.177766
+184800.747793     8249633.908119
+184784.480983     8249633.657730
+184762.502753     8249638.328513
+184745.499560     8249644.953708
+184736.014073     8249651.068676
+184729.666889     8249656.606007
+184717.608105     8249667.063741
+184689.847889     8249681.036986
+184660.795992     8249697.494127
+184633.681629     8249710.224659
+184615.396822     8249718.708725
+184599.634726     8249725.978969
+184573.862260     8249733.095891
+184551.228109     8249739.634412
+184539.885921     8249744.468911
+184539.240080     8249745.710859
+184524.678945     8249756.130076
+184520.864539     8249759.828558
+184516.404306     8249764.768225
+184511.268161     8249772.828739
+184506.141917     8249780.262696
+184501.621377     8249788.958630
+184496.454805     8249798.896509
+184492.610354     8249804.472363
+184491.298503     8249808.208602
+184491.248097     8249811.338313
+184489.895919     8249817.578474
+184489.774937     8249825.090240
+184489.664046     8249831.975452
+184489.563234     8249838.234875
+184489.512828     8249841.364586
+184492.620896     8249842.664317
+184498.806770     8249847.142674
+184511.299513     8249848.586859
+184520.664031     8249849.982893
+184526.284898     8249850.696122
+184536.870343     8249853.989547
+184553.127074     8249854.865725
+184569.959081     8249858.881245
+184588.657869     8249863.551445
+184601.665201     8249871.891234
+184613.451798     8249878.333635
+184617.145031     8249882.146916
+184617.084546     8249885.902417
+184617.064376     8249887.154760
+184608.739522     8249898.922623
+184593.572861     8249908.080630
+184584.743305     8249912.327096
+184580.353635     8249912.885472
+184561.523799     8249916.352064
+184528.193300     8249926.483135
+184502.370440     8249936.729005
+184480.896923     8249948.920420
+184454.387883     8249962.912924
+184422.237996     8249977.444545
+184396.263918     8249997.079548
+184369.755068     8250011.072055
+184343.114980     8250033.201349
+184315.748586     8250061.580439
+184289.148825     8250081.205811
+184271.348562     8250098.462853
+184259.784400     8250117.067774
+184250.198101     8250129.442164
+184249.411312     8250139.447460
+184248.785628     8250139.437829
+184244.295146     8250146.255628
+184243.377105     8250164.398476
+184236.031430     8250193.085736
+184227.504760     8250217.372442
+184221.571557     8250236.064038
+184216.243867     8250256.017608
+184215.356075     8250272.282323
+184213.560321     8250306.064097
+184209.241868     8250341.058928
+184207.718505     8250357.939805
+184207.698335     8250359.192148
+184206.205030     8250374.194890
+184200.826934     8250397.278171
+184192.996523     8250417.192453
+184186.598934     8250425.859494
+184180.958088     8250426.398612
+184165.861990     8250431.175329
+184147.597353     8250438.407052
+184135.064283     8250439.466788
+184133.792759     8250440.699106
+184132.541392     8250440.679844
+184122.470740     8250444.281262
+184101.703357     8250451.475225
+184081.602188     8250456.174137
+184072.711944     8250464.176865
+184071.965483     8250471.678239
+184070.441916     8250488.559877
+184068.948611     8250503.562618
+184068.101325     8250517.324179
+184067.597264     8250548.621292
+184067.284749     8250568.025350
+184062.673285     8250582.354915
+184062.663206     8250582.980704
+184061.966960     8250587.352363
+184049.888197     8250599.062444
+184044.146539     8250605.860984
+184039.625808     8250614.556915
+184026.376333     8250621.239890
+184008.777694     8250625.978086
+184004.398103     8250625.910673
+183994.529074     8250616.993246
+183980.835370     8250612.400087
+183967.858096     8250602.182163
+183958.564141     8250596.404839
+183936.192100     8250586.669013
+183903.234613     8250573.639762
+183882.850524     8250557.046852
+183859.317838     8250541.658896
+183838.388708     8250520.049275
+183817.419251     8250500.943577
+183795.097616     8250488.078040
+183782.735933     8250478.496300
+183769.829222     8250463.897085
+183750.736624     8250444.820276
+183734.297976     8250416.392857
+183715.467487     8250381.041703
+183700.239688     8250355.137464
+183678.028943     8250335.386715
+183658.936345     8250316.309907
+183639.854029     8250296.606547
+183620.922728     8250267.514816
+183601.981348     8250239.048873
+183588.418704     8250226.318160
+183575.471857     8250214.222869
+183557.000000     8250201.635035
+END
+LINE3D
+HEIGHT 1120.000000
+183557.000000     8255163.135756
+183566.649126     8255152.744035
+183582.592688     8255134.206525
+183602.380879     8255110.093928
+183628.576764     8255076.686972
+183644.893325     8255034.989903
+183656.103800     8254999.475213
+183665.326538     8254970.816081
+183679.665428     8254935.349545
+183693.418976     8254897.368692
+183707.021280     8254868.778502
+183719.927363     8254844.558443
+183733.428664     8254822.227672
+183749.644414     8254786.790026
+183764.649328     8254748.828435
+183777.161575     8254710.203295
+183787.151123     8254672.791214
+183795.576339     8254615.945421
+183807.533466     8254572.929360
+183824.768081     8254513.088679
+183844.818393     8254472.700972
+183858.370113     8254447.239726
+183868.602254     8254433.623387
+183875.040171     8254422.452424
+183884.828094     8254397.559187
+183897.814807     8254368.332813
+183908.268741     8254340.945285
+183914.978846     8254312.874186
+183919.216657     8254282.886434
+183919.640062     8254256.597164
+183920.164280     8254224.048472
+183920.708668     8254190.247437
+183916.298186     8254153.239645
+183912.008865     8254108.720856
+183912.613738     8254071.164319
+183918.042239     8254044.951327
+183924.742253     8254017.506781
+183930.705896     8253996.937056
+183935.196187     8253990.119254
+183935.206266     8253989.493465
+183935.892446     8253985.746831
+183937.153891     8253985.140303
+183944.762329     8253978.996442
+183952.370958     8253972.852585
+183961.230762     8253966.727986
+183961.927009     8253962.356326
+183962.693832     8253953.602613
+183967.950946     8253938.031097
+183976.356442     8253921.256154
+183977.193841     8253908.120386
+183978.707316     8253891.865302
+183978.969425     8253875.590956
+183979.060158     8253869.957322
+183979.070237     8253869.331533
+183978.757069     8253849.917844
+183975.063645     8253846.104561
+183968.504117     8253825.968016
+183960.774056     8253800.805132
+183960.450809     8253782.017233
+183955.869131     8253755.650922
+183949.480979     8253724.873664
+183945.625605     8253692.257558
+183941.770434     8253659.640691
+183931.053097     8253625.666308
+183926.360528     8253606.185209
+183916.057158     8253585.365856
+183903.432916     8253553.239955
+183897.347841     8253542.502939
+183896.843128     8253534.982306
+183888.366414     8253517.320793
+183882.341836     8253502.827512
+183881.090470     8253502.808250
+183871.301893     8253488.883741
+183856.074094     8253462.979502
+183851.250476     8253451.635195
+183851.431931     8253440.368692
+183850.301546     8253432.837665
+183846.073363     8253423.381120
+183837.001203     8253403.832608
+183832.076582     8253398.747720
+183820.350662     8253388.549821
+183815.547202     8253375.953934
+183811.389392     8253362.116096
+183810.440462     8253343.318566
+183815.122489     8253324.607712
+183821.570485     8253312.810959
+183825.465533     8253304.105397
+183833.871029     8253287.330454
+183843.648874     8253263.063007
+183848.996913     8253241.857861
+183853.688828     8253222.521214
+183860.429181     8253192.571983
+183869.217960     8253152.010931
+183881.669722     8253117.141292
+183893.919860     8253094.790498
+183907.996642     8253075.598309
+183920.206466     8253055.750673
+183929.974220     8253032.109780
+183935.342225     8253009.653052
+183941.981766     8252985.963244
+183951.961235     8252949.176951
+183964.029456     8252899.274917
+183973.423557     8252859.975836
+183978.246533     8252832.501634
+183982.554908     8252798.132591
+183983.906445     8252753.073920
+183988.890909     8252715.584797
+183997.487951     8252686.916799
+184007.316202     8252659.519641
+184011.947824     8252643.938497
+184015.207097     8252635.849858
+184018.476462     8252627.134665
+184021.826468     8252613.412392
+184022.724161     8252596.521120
+184022.966112     8252581.498353
+184018.707681     8252573.919941
+184013.177726     8252567.573846
+184003.580694     8252541.756280
+183997.051402     8252519.742366
+183992.217706     8252509.023848
+183991.692835     8252502.754794
+183972.055196     8252478.661275
+183966.636132     8252465.429968
+183956.231962     8252450.869274
+183943.426254     8252430.010639
+183928.339594     8252395.343056
+183901.819822     8252371.143603
+183883.231937     8252359.587427
+183864.543228     8252354.291438
+183849.083569     8252342.783414
+183834.855106     8252332.546994
+183816.862657     8252322.878582
+183800.050819     8252317.610718
+183781.352031     8252312.940519
+183752.087778     8252303.724548
+183733.499893     8252292.168372
+183732.389845     8252283.386533
+183727.697097     8252263.904667
+183727.928957     8252249.508453
+183728.362454     8252222.592630
+183732.600253     8252192.605642
+183733.810651     8252156.310315
+183735.515671     8252128.162175
+183736.998719     8252113.784456
+183737.230580     8252099.388242
+183737.401968     8252088.746765
+183726.543682     8252063.535730
+183710.952308     8252021.347514
+183696.077351     8251973.535297
+183680.284366     8251943.865163
+183657.679990     8251909.708572
+183644.248407     8251888.840303
+183643.642881     8251887.579093
+183627.648272     8251870.427805
+183604.186352     8251850.657796
+183578.382996     8251820.834341
+183557.000000     8251788.734878
+END
+LINE3D
+HEIGHT 1120.000000
+186007.222746     8255388.783431
+186007.232813     8255388.158405
+186007.858687     8255388.168039
+186018.494729     8255388.331756
+186019.745713     8255388.351012
+186020.987013     8255388.995299
+186021.612887     8255389.004933
+186025.881194     8255395.958316
+186031.381092     8255404.182547
+186035.680053     8255409.256276
+186041.825601     8255416.238555
+186051.583738     8255432.041194
+186070.050653     8255451.108372
+186081.786844     8255460.680484
+186097.902244     8255470.320004
+186125.188839     8255485.765744
+186126.440205     8255485.785005
+186139.467695     8255492.873216
+186167.399940     8255507.077004
+186207.138939     8255526.471615
+186227.714586     8255531.170704
+186253.820353     8255542.217420
+186281.772756     8255555.169629
+186304.860844     8255559.280683
+186316.122760     8255559.454033
+186327.364137     8255560.878957
+186347.364673     8255562.440235
+186373.500332     8255571.607284
+186389.636271     8255579.995231
+186401.362013     8255590.192363
+186418.052881     8255602.971228
+186437.216234     8255617.666749
+186442.786313     8255621.509683
+186455.763803     8255631.726082
+186475.501860     8255649.560937
+186500.901506     8255665.604340
+186513.323661     8255671.431344
+186529.539873     8255674.811441
+186557.058341     8255675.860202
+186592.094310     8255676.399498
+186629.067993     8255673.212952
+186654.547911     8255684.248505
+186678.130813     8255696.506748
+186702.420219     8255703.768309
+186734.802619     8255713.658220
+186771.554162     8255724.240565
+186806.449362     8255733.543974
+186838.357106     8255734.035118
+186870.900815     8255733.909342
+186897.874039     8255729.942154
+186929.247012     8255724.790800
+186960.670415     8255716.508207
+186998.855149     8255715.844081
+187025.192432     8255712.492285
+187053.972333     8255712.935283
+187087.070946     8255717.201953
+187117.707548     8255718.925419
+187139.544628     8255723.018745
+187163.258590     8255727.139433
+187190.090662     8255731.936354
+187220.646610     8255738.667664
+187241.212189     8255743.991779
+187257.973621     8255752.389354
+187276.591754     8255762.067397
+187289.629335     8255768.529054
+187309.629895     8255770.088804
+187332.768747     8255771.071680
+187364.141720     8255765.920327
+187390.509251     8255760.690398
+187411.216315     8255757.253466
+187436.877700     8255757.021753
+187460.722699     8255753.006414
+187478.866557     8255753.285695
+187490.067619     8255757.213776
+187510.027840     8255761.278212
+187526.910241     8255762.164786
+187538.171775     8255762.338130
+187558.878482     8255758.899664
+187586.517920     8255752.437424
+187606.618885     8255747.739274
+187607.870252     8255747.758536
+187614.813073     8255744.108208
+187624.369124     8255733.611949
+187635.983501     8255711.877314
+187648.122557     8255696.411730
+187652.078281     8255683.950670
+187652.320244     8255668.927139
+187646.416636     8255646.922856
+187637.990113     8255626.133157
+187629.069183     8255597.194746
+187617.837434     8255556.325526
+187602.881835     8255513.520388
+187584.182203     8255470.032440
+187569.377822     8255417.838168
+187555.058164     8255374.417638
+187549.295707     8255343.649247
+187548.669833     8255343.639613
+187543.351760     8255324.149650
+187538.658821     8255304.667782
+187532.573746     8255293.930765
+187528.910774     8255288.238589
+187520.989156     8255274.969525
+187511.987571     8255251.038958
+187495.599139     8255219.481825
+187471.612169     8255193.441996
+187459.200080     8255186.989967
+187443.074589     8255177.977001
+187436.202737     8255177.244516
+187420.753144     8255165.111466
+187400.873554     8255156.040715
+187393.436325     8255151.542331
+187384.878766     8255138.888659
+187379.510286     8255122.528408
+187378.510950     8255106.860589
+187379.338066     8255094.351372
+187390.882261     8255076.998033
+187397.360493     8255063.323912
+187405.725675     8255049.052127
+187421.679328     8255029.888063
+187446.987383     8255012.748114
+187466.039013     8254995.510334
+187479.368964     8254983.818749
+187493.395327     8254967.757034
+187511.215748     8254949.248414
+187523.324938     8254935.660968
+187527.795275     8254930.093984
+187537.865916     8254926.493330
+187562.508189     8254911.845383
+187590.934403     8254895.378611
+187609.219007     8254886.895306
+187619.935703     8254882.051179
+187640.733131     8254872.979844
+187663.488454     8254858.929561
+187681.964616     8254838.552436
+187697.232279     8254823.135009
+187715.587447     8254810.270414
+187733.307437     8254798.021222
+187747.363692     8254780.079841
+187756.405154     8254762.687979
+187760.986370     8254750.236547
+187768.140500     8254733.442342
+187772.943498     8254707.220486
+187779.018031     8254679.765548
+187787.463855     8254660.486684
+187794.557501     8254647.447980
+187795.808867     8254647.467242
+187801.550716     8254640.668705
+187812.983638     8254630.200572
+187823.780977     8254620.349365
+187831.369066     8254615.457080
+187846.566154     8254604.421708
+187859.775123     8254600.241888
+187875.517061     8254594.223223
+187903.842463     8254584.015874
+187933.459559     8254571.323865
+187955.498275     8254562.897581
+187976.245296     8254556.955958
+188001.896972     8254557.350804
+188028.809711     8254557.139117
+188056.418900     8254552.555009
+188084.673738     8254546.728951
+188123.574316     8254540.440813
+188164.967548     8254534.816989
+188200.115171     8254528.471084
+188221.457067     8254524.416450
+188247.179688     8254520.430012
+188270.328249     8254520.786329
+188287.917179     8254516.674692
+188298.623415     8254512.456349
+188312.528440     8254503.904866
+188338.331715     8254494.910585
+188362.741339     8254494.660368
+188385.265172     8254495.007069
+188404.024444     8254495.921767
+188422.773625     8254497.463020
+188428.343335     8254501.305184
+188431.471560     8254501.353336
+188432.097816     8254501.362975
+188442.107984     8254501.517058
+188455.185892     8254505.474793
+188458.939610     8254505.532573
+188459.565102     8254505.542200
+188469.515549     8254509.451796
+188489.455230     8254514.767805
+188521.907812     8254520.276420
+188564.351168     8254527.190709
+188611.829474     8254532.303901
+188653.111815     8254533.565288
+188683.122912     8254535.279891
+188705.010410     8254536.242742
+188723.154269     8254536.522023
+188748.290961     8254530.022023
+188784.033077     8254525.563103
+188815.527032     8254512.899984
+188846.335009     8254503.982737
+188878.948900     8254499.475665
+188912.814527     8254494.988625
+188938.546475     8254490.375621
+188959.969777     8254481.313920
+188991.968255     8254476.171430
+189026.620683     8254461.678330
+189043.160252     8254445.028592
+189062.100979     8254434.676789
+189086.066578     8254423.149678
+189110.678590     8254410.380627
+189137.753019     8254400.153258
+189151.607638     8254394.731487
+189167.410061     8254384.957322
+189182.112717     8254365.774766
+189200.568327     8254346.649978
+189219.024700     8254327.525202
+189238.812713     8254303.411838
+189268.591500     8254280.704147
+189288.500482     8254249.079781
+189298.974383     8254220.440672
+189309.236581     8254204.946198
+189320.185520     8254185.705863
+189330.488045     8254167.707467
+189343.212649     8254154.755438
+189361.679113     8254135.004109
+189373.848788     8254117.661162
+189389.691538     8254105.383074
+189409.943746     8254091.294262
+189424.555669     8254077.745339
+189437.229867     8254067.923022
+189449.257651     8254059.342644
+189470.186521     8254042.133760
+189489.288545     8254021.767033
+189507.654197     8254008.275126
+189512.134219     8254002.083111
+189517.280824     8253993.396813
+189535.706949     8253976.150169
+189556.140612     8253950.794854
+189570.196854     8253932.854238
+189579.672263     8253927.365059
+189586.726345     8253916.830289
+189593.799833     8253905.043164
+189606.595013     8253887.709081
+189616.917695     8253868.459106
+189628.522375     8253847.350267
+189640.731613     8253827.503386
+189656.029525     8253810.207827
+189668.239527     8253790.360958
+189677.270911     8253773.594885
+189688.168680     8253757.484250
+189698.592174     8253731.974852
+189702.022836     8253713.244735
+189706.019268     8253698.279759
+189706.190644     8253687.639046
+189706.513250     8253667.608435
+189707.390772     8253651.969506
+189707.481493     8253646.336637
+189707.794020     8253626.931815
+189709.649877     8253589.394535
+189715.774804     8253558.810650
+189720.022503     8253528.197106
+189720.345109     8253508.166495
+189720.647545     8253489.388226
+189718.457327     8253469.945645
+189717.831835     8253469.936017
+189713.674407     8253456.098185
+189713.603381     8253421.661733
+189707.830833     8253391.519895
+189698.424774     8253353.809264
+189697.415740     8253338.767241
+189696.235319     8253334.366695
+189687.132923     8253316.695551
+189672.490289     8253293.304862
+189659.775301     8253266.813358
+189646.514712     8253235.304371
+189636.272222     8253210.728759
+189631.024354     8253186.855972
+189622.628092     8253164.187376
+189609.933274     8253136.443529
+189603.111354     8253093.764354
+189594.755419     8253068.591836
+189590.082638     8253047.858389
+189584.834770     8253023.985602
+189580.374444     8252990.108295
+189575.852880     8252959.985713
+189572.381442     8252942.401244
+189571.352239     8252928.611564
+189559.192180     8252906.510978
+189549.069895     8252874.424353
+189540.734130     8252847.999492
+189529.815729     8252826.544728
+189517.615355     8252806.947300
+189506.595378     8252791.751946
+189502.286744     8252787.302484
+189498.613669     8252782.237625
+189488.088148     8252775.187926
+189483.103603     8252773.859312
+189473.253969     8252763.690294
+189459.076294     8252750.324169
+189452.365739     8252739.576761
+189442.495947     8252730.659322
+189441.951097     8252725.642614
+189435.845865     8252716.157177
+189426.703140     8252700.989955
+189423.140968     8252689.039119
+189419.447736     8252685.225839
+189419.457814     8252684.600050
+189420.264773     8252673.342411
+189424.280600     8252657.125844
+189425.137964     8252642.738494
+189429.073900     8252631.529783
+189438.094428     8252615.390252
+189454.623931     8252599.365539
+189471.687417     8252588.984840
+189479.831187     8252588.484249
+189488.034690     8252584.227382
+189510.164127     8252570.168229
+189534.211143     8252553.633286
+189554.493588     8252537.667105
+189570.416980     8252520.381938
+189588.883445     8252500.630608
+189603.666756     8252476.440209
+189615.220253     8252458.461833
+189619.236092     8252442.244502
+189620.053881     8252430.361850
+189620.295832     8252415.339082
+189630.759654     8252387.325763
+189645.158660     8252348.102956
+189654.321092     8252323.200092
+189661.444986     8252308.283256
+189674.300637     8252287.194436
+189688.468535     8252262.368619
+189699.527613     8252236.242296
+189708.569062     8252218.851198
+189720.031839     8252206.505691
+189730.748917     8252201.661569
+189741.455141     8252197.443990
+189755.239960     8252196.403521
+189773.999232     8252197.318220
+189808.339133     8252202.229941
+189836.321784     8252213.304018
+189851.084624     8252229.183693
+189860.772950     8252249.368399
+189869.895516     8252265.787200
+189888.372510     8252284.228588
+189905.718737     8252295.138942
+189926.254438     8252302.341960
+189932.510888     8252302.438263
+189941.905643     8252301.956928
+189953.914021     8252294.628905
+189972.884996     8252282.398969
+189993.843351     8252263.311940
+190014.983912     8252232.959185
+190019.514340     8252223.637459
+190020.836664     8252219.274672
+190025.447734     8252204.945866
+190031.461783     8252181.246429
+190039.382544     8252155.698508
+190043.539510     8252130.718596
+190047.576270     8252113.249698
+190049.028879     8252100.750109
+190049.089363     8252096.994608
+190049.099442     8252096.368819
+190049.391799     8252078.216340
+190054.285148     8252046.360844
+190054.839614     8252011.934020
+190051.014871     8251977.439787
+190047.028831     8251952.960478
+190042.981542     8251932.236658
+190038.935004     8251911.513614
+190029.913250     8251888.835391
+190026.148240     8251850.584882
+190020.375680     8251820.443808
+190015.663335     8251802.214294
+190015.178982     8251793.441321
+190010.940148     8251784.610557
+190009.709321     8251783.339723
+190009.719399     8251782.713933
+190005.530971     8251770.753458
+189995.419529     8251738.041055
+189981.604024     8251702.140385
+189964.600560     8251669.947840
+189950.694321     8251639.680804
+189942.348465     8251613.882497
+189935.173702     8251593.111301
+189924.224313     8251573.533129
+189917.564152     8251559.656774
+189913.326082     8251550.826022
+189907.866499     8251540.098633
+189899.349267     8251524.941039
+189889.137013     8251498.488059
+189875.240853     8251467.595233
+189870.972534     8251460.642613
+189870.457945     8251453.747009
+189864.917708     8251448.027465
+189858.277717     8251432.898766
+189852.858461     8251419.667456
+189844.411805     8251400.127808
+189831.706897     8251373.010514
+189820.293312     8251343.407791
+189803.774201     8251319.988219
+189785.993263     8251297.175168
+189775.043862     8251277.597760
+189761.027497     8251254.215948
+189749.573572     8251227.117910
+189741.147074     8251206.326683
+189733.901748     8251189.936778
+189732.649999     8251189.917510
+189727.240835     8251176.059646
+189715.586051     8251161.480466
+189711.982788     8251152.033541
+189705.262142     8251141.912686
+189697.361087     8251127.390521
+189686.916209     8251115.333743
+189677.087495     8251103.913158
+189661.103156     8251086.136083
+189638.276425     8251065.749907
+189617.347868     8251044.140296
+189600.061374     8251029.473664
+189590.232661     8251018.053079
+189585.297771     8251013.593978
+189573.521253     8251006.525787
+189552.461636     8250993.053731
+189530.290645     8250970.799051
+189510.522340     8250954.842329
+189495.143323     8250938.327225
+189483.397054     8250929.380902
+189472.912612     8250919.828057
+189453.699235     8250908.262253
+189420.196517     8250890.216289
+189392.920012     8250874.143996
+189377.995112     8250868.279233
+189372.980331     8250868.827987
+189365.451975     8250869.963995
+189339.185268     8250868.933737
+189298.074302     8250857.031636
+189261.282074     8250848.951680
+189230.695878     8250844.098502
+189207.072280     8250834.343411
+189173.984127     8250829.450957
+189140.441081     8250813.908915
+189121.237783     8250801.717321
+189104.566703     8250787.686107
+189099.027229     8250781.966575
+189091.700497     8250770.583737
+189086.927668     8250756.109724
+189075.322526     8250738.400821
+189063.747632     8250718.813785
+189054.534345     8250708.027853
+189054.544423     8250707.402064
+189042.929203     8250690.318950
+189023.907371     8250666.860090
+189007.347933     8250645.944440
+189000.545881     8250640.830653
+188995.611743     8250636.372327
+188989.990876     8250635.659098
+188976.489099     8250619.172890
+188964.904127     8250600.211644
+188951.937109     8250589.368696
+188940.786084     8250582.310134
+188932.097477     8250577.793253
+188918.343670     8250576.955601
+188901.531450     8250571.687732
+188882.832663     8250567.017532
+188876.596370     8250565.669650
+188867.848042     8250564.908282
+188859.714351     8250564.783083
+188845.253633     8250568.943635
+188830.188358     8250571.842228
+188824.547321     8250572.381343
+188816.242254     8250582.896857
+188800.107147     8250613.327423
+188794.800009     8250632.028656
+188802.580094     8250654.061822
+188823.933283     8250688.199919
+188836.618021     8250716.569555
+188836.426476     8250728.462611
+188836.881356     8250739.112964
+188844.490054     8250771.787608
+188854.561933     8250807.003944
+188864.178931     8250831.569928
+188871.817889     8250862.365675
+188878.932918     8250886.893148
+188887.309011     8250910.814086
+188899.458991     8250933.540462
+188918.339695     8250965.761902
+188937.099418     8251005.495108
+188949.794235     8251033.238955
+188957.070574     8251047.750740
+188960.662994     8251057.823443
+188964.971628     8251062.272904
+188969.866203     8251069.235164
+188981.572145     8251080.685409
+188988.746908     8251101.456604
+188993.369283     8251125.319763
+189000.039523     8251138.570329
+189006.629108     8251156.828739
+189014.520847     8251171.976705
+189018.183844     8251177.667354
+189023.067564     8251185.256155
+189034.702942     8251201.087690
+189053.623974     8251230.805209
+189066.339713     8251257.297488
+189076.723343     8251273.109756
+189085.775346     8251293.909847
+189091.124025     8251311.523211
+189094.060705     8251323.464419
+189095.059660     8251339.132232
+189095.342401     8251360.423286
+189094.212848     8251391.710771
+189089.016601     8251403.526792
+189083.890153     8251410.961510
+189073.153681     8251417.057222
+189061.881686     8251417.509661
+189037.430971     8251420.263788
+189018.651541     8251420.600668
+189002.384923     8251420.350282
+188984.251143     8251419.445212
+188955.542200     8251414.620165
+188911.898266     8251404.556909
+188879.546484     8251392.789635
+188849.575701     8251388.571875
+188817.143277     8251381.811680
+188779.069052     8251375.590589
+188749.139361     8251368.868918
+188722.952544     8251362.830804
+188695.495337     8251358.025790
+188643.647148     8251352.218625
+188599.317237     8251345.901242
+188551.939742     8251334.528628
+188512.715345     8251322.028857
+188479.081578     8251312.119684
+188447.335131     8251301.613617
+188408.030079     8251294.121690
+188380.057519     8251282.421060
+188350.198391     8251271.318099
+188319.733177     8251258.953155
+188280.397889     8251253.338597
+188252.334595     8251247.271599
+188225.502880     8251242.476213
+188196.723362     8251242.033221
+188163.584027     8251240.271230
+188144.824767     8251239.355767
+188132.937358     8251239.172789
+188115.419374     8251238.903142
+188094.147671     8251238.575714
+188065.367771     8251238.132716
+188024.135836     8251233.741617
+187990.421415     8251228.840288
+187959.946504     8251217.101139
+187932.569187     8251207.288269
+187903.163794     8251206.835643
+187882.447009     8251210.899899
+187866.099748     8251215.656592
+187849.752094     8251220.414045
+187831.558211     8251223.264480
+187814.029765     8251223.620616
+187790.235173     8251224.506245
+187770.779833     8251227.963972
+187752.010481     8251227.675063
+187726.358806     8251227.280216
+187694.572044     8251219.277307
+187662.189643     8251209.387395
+187638.586584     8251198.380732
+187624.973535     8251188.779730
+187607.072009     8251173.477687
+187586.031798     8251158.753276
+187561.177372     8251147.727350
+187524.506114     8251132.136392
+187490.953371     8251117.220145
+187456.754609     8251103.545079
+187431.334794     8251088.754019
+187406.480380     8251077.727329
+187387.256913     8251066.788079
+187364.299515     8251054.538700
+187340.746862     8251040.402325
+187322.148899     8251029.471938
+187302.279399     8251019.774633
+187281.138745     8251011.310415
+187263.196511     8250998.512288
+187245.264355     8250985.088372
+187234.779913     8250975.535527
+187228.089133     8250963.536534
+187218.966567     8250947.117733
+187211.640217     8250935.734902
+187203.103197     8250921.829657
+187187.057991     8250907.808077
+187166.623484     8250894.345642
+187142.485665     8250877.695718
+187120.789713     8250864.839811
+187102.857557     8250851.415895
+187079.950566     8250836.036805
+187057.790418     8250813.156347
+187034.933833     8250794.647545
+187017.718284     8250775.599630
+186992.944513     8250759.565860
+186969.452357     8250741.673220
+186942.781175     8250726.862898
+186921.115471     8250712.128860
+186900.105878     8250695.527086
+186879.731868     8250678.308387
+186867.440749     8250664.345357
+186851.991168     8250652.211543
+186837.177159     8250639.461568
+186822.373228     8250626.085803
+186803.775253     8250615.156181
+186782.765672     8250598.553643
+186760.625300     8250574.421600
+186734.135966     8250548.344018
+186711.329787     8250526.705505
+186697.757447     8250514.600587
+186684.134319     8250505.625374
+186664.910470     8250494.686118
+186640.076213     8250482.407849
+186622.104112     8250471.487861
+186610.307437     8250465.671249
+186599.136636     8250459.864272
+186578.722299     8250445.149495
+186552.737476     8250426.593306
+186529.194914     8250411.830377
+186508.730170     8250400.245311
+186486.337768     8250391.761825
+186462.694394     8250383.258320
+186440.917787     8250375.410257
+186422.884819     8250368.245763
+186409.887565     8250359.280185
+186399.412820     8250349.101545
+186398.787328     8250349.091917
+186394.478312     8250344.642449
+186384.548787     8250339.481286
+186378.988404     8250335.012557
+186372.802517     8250330.534964
+186364.053413     8250329.774347
+186358.483334     8250325.931413
+186347.352848     8250317.621278
+186339.855110     8250316.879923
+186335.556173     8250311.804666
+186334.930680     8250311.795038
+186329.299722     8250311.708363
+186317.967625     8250315.916309
+186308.562779     8250317.024197
+186302.911664     8250318.189101
+186299.107540     8250321.261033
+186299.097461     8250321.886822
+186294.576731     8250330.582753
+186288.834882     8250337.381290
+186283.769301     8250341.060514
+186278.078240     8250344.729345
+186272.447282     8250344.642670
+186267.442198     8250344.565629
+186263.062606     8250344.498216
+186252.436643     8250343.708710
+186246.826236     8250342.369697
+186241.286012     8250336.649389
+186222.032295     8250327.588271
+186202.889100     8250311.641171
+186179.275974     8250301.259533
+186169.336370     8250296.724160
+186155.087368     8250287.739313
+186133.936635     8250279.900884
+186110.343667     8250268.267667
+186083.612001     8250257.212846
+186043.096291     8250247.197742
+186009.503234     8250234.784652
+185982.671137     8250229.989260
+185967.726079     8250225.376075
+185953.437132     8250218.895157
+185922.911421     8250210.286478
+185896.180148     8250199.230899
+185876.916353     8250190.795570
+185858.832992     8250186.760024
+185843.887922     8250182.147604
+185827.681788     8250178.141717
+185803.927523     8250176.523423
+185784.542376     8250175.599091
+185763.896167     8250175.281291
+185735.116648     8250174.838299
+185685.145687     8250169.060795
+185642.056681     8250163.388457
+185612.116529     8250157.292570
+185597.121053     8250155.809861
+185581.550503     8250151.187049
+185557.221139     8250146.430180
+185527.916558     8250139.718131
+185506.079467     8250135.625569
+185484.333109     8250125.899374
+185465.049156     8250118.715625
+185435.088465     8250113.871311
+185407.701452     8250104.684236
+185384.733963     8250093.061411
+185356.741233     8250082.613123
+185320.726098     8250065.153666
+185290.391932     8250044.651932
+185266.203707     8250031.131718
+185243.296716     8250015.752628
+185220.995059     8250001.634745
+185196.736259     8249992.496586
+185173.698219     8249985.254286
+185153.788393     8249978.060903
+185135.755807     8249970.896415
+185122.697686     8249965.686331
+185118.964126     8249964.376973
+185114.029606     8249959.918641
+185100.345993     8249954.698930
+185081.071738     8249946.889385
+185063.624329     8249942.237683
+185042.352627     8249941.910256
+185022.957401     8249941.611712
+185004.188050     8249941.322803
+184984.167333     8249941.014632
+184966.649348     8249940.744984
+184950.382730     8249940.494598
+184931.603300     8249940.831478
+184905.184993     8249949.190349
+184876.869670     8249958.771908
+184851.117373     8249964.636487
+184829.058488     8249974.315114
+184810.107682     8249985.292707
+184808.745616     8249992.158660
+184803.609280     8250000.219171
+184794.012902     8250013.219352
+184778.604290     8250037.400126
+184771.359236     8250059.827961
+184766.758041     8250073.531739
+184761.490657     8250089.729041
+184756.849148     8250105.935977
+184745.254738     8250126.419030
+184740.582992     8250144.503334
+184729.644514     8250163.117886
+184718.120859     8250179.219652
+184708.544650     8250190.967489
+184700.249841     8250200.857980
+184686.274062     8250213.790750
+184674.215278     8250224.248485
+184665.335304     8250231.625427
+184653.296868     8250240.831586
+184639.956660     8250253.148194
+184634.790279     8250263.086076
+184630.350203     8250266.774163
+184620.753825     8250279.774344
+184600.884966     8250308.895549
+184580.491440     8250331.746939
+184561.449901     8250348.358165
+184546.838157     8250361.907854
+184531.530357     8250379.829206
+184516.061260     8250407.765481
+184502.398459     8250440.111937
+184496.455177     8250459.429322
+184490.602616     8250473.113838
+184484.629097     8250494.308592
+184474.599222     8250534.224595
+184465.094027     8250580.409650
+184457.677776     8250613.478965
+184452.753809     8250647.211823
+184447.668533     8250690.960368
+184447.214879     8250719.127770
+184450.807478     8250729.201240
+184451.947954     8250736.105714
+184459.092659     8250758.755045
+184468.488067     8250797.091457
+184476.157834     8250826.009844
+184485.179576     8250848.688832
+184496.138674     8250867.640445
+184505.816361     8250888.450167
+184512.436386     8250904.830447
+184513.526252     8250914.865393
+184514.565916     8250928.029290
+184514.243322     8250948.059137
+184510.186977     8250966.779623
+184504.284010     8250983.593850
+184498.502025     8250992.896312
+184492.659364     8251005.954272
+184485.454828     8251025.878188
+184476.837425     8251055.798527
+184465.303703     8251072.525318
+184458.199776     8251086.190572
+184453.033395     8251096.128454
+184445.818589     8251116.678157
+184438.523117     8251142.236467
+184433.831010     8251161.573111
+184429.926074     8251170.904466
+184430.481003     8251175.295384
+184436.555987     8251186.658954
+184442.479765     8251207.410894
+184450.906264     8251228.202121
+184458.696809     8251249.609504
+184466.457119     8251272.894255
+184474.591260     8251311.837961
+184485.429389     8251338.300575
+184494.441064     8251361.604588
+184500.909859     8251387.374767
+184509.114385     8251421.936416
+184517.288675     8251458.375433
+184526.239854     8251485.435711
+184533.304095     8251513.092888
+184536.453131     8251550.707207
+184543.426461     8251583.997251
+184552.882353     8251618.578162
+184557.091019     8251668.104795
+184563.348123     8251707.018844
+184571.068284     8251732.808285
+184578.293644     8251750.449772
+184589.787692     8251775.044648
+184605.994657     8251817.869048
+184620.385070     8251856.908290
+184633.170812     8251879.018507
+184641.667695     8251895.427677
+184658.822950     8251918.231096
+184674.736726     8251940.389462
+184682.678681     8251952.407714
+184682.608105     8251956.789768
+184688.683101     8251968.152573
+184695.202314     8251990.792276
+184702.811393     8252023.466926
+184713.337007     8252069.333598
+184719.129712     8252098.223857
+184724.438076     8252118.340379
+184727.294114     8252135.288666
+184734.428728     8252158.564551
+184741.432484     8252189.977229
+184748.557032     8252213.878139
+184752.583781     8252235.853532
+184762.866981     8252257.925228
+184775.521471     8252288.172997
+184789.397283     8252320.317399
+184799.085036     8252340.502095
+184803.202327     8252356.843852
+184812.375300     8252370.132942
+184819.631087     8252385.897063
+184823.818942     8252397.857530
+184827.220008     8252419.823292
+184838.603166     8252451.303381
+184846.838131     8252483.986900
+184853.882024     8252512.895653
+184857.848277     8252538.627311
+184861.198937     8252563.722785
+184864.650218     8252582.558832
+184865.084368     8252594.460755
+184867.980721     8252608.905884
+184870.826667     8252626.480725
+184874.338637     8252641.560511
+184874.651793     8252660.974964
+184877.336455     8252688.563964
+184880.777836     8252708.026568
+184885.561138     8252721.874034
+184892.907658     8252732.004522
+184902.050383     8252747.171744
+184909.951819     8252761.693915
+184916.592014     8252776.821852
+184917.046309     8252787.472960
+184921.234355     8252799.433429
+184925.311129     8252818.279105
+184928.328463     8252825.212469
+184934.423617     8252835.323695
+184951.134643     8252846.850982
+184964.687207     8252860.207485
+184965.918416     8252861.478325
+184965.847840     8252865.860380
+184965.736949     8252872.745592
+184960.711708     8252873.920129
+184951.760979     8252885.678359
+184941.589515     8252895.539199
+184930.862739     8252901.009116
+184925.777001     8252905.939919
+184915.554748     8252918.930465
+184897.724249     8252938.064875
+184879.934077     8252954.695363
+184869.752330     8252965.182755
+184860.166030     8252977.557145
+184852.991540     8252995.603690
+184847.492486     8253026.197209
+184839.399955     8253062.386601
+184831.519138     8253085.430595
+184825.656499     8253099.740900
+184819.753544     8253116.554364
+184814.556915     8253128.370378
+184814.405697     8253137.759512
+184814.163745     8253152.782280
+184813.064250     8253182.191630
+184808.110023     8253217.803384
+184807.535399     8253253.481788
+184806.738981     8253302.931381
+184806.820277     8253336.742047
+184810.796621     8253361.847151
+184814.046278     8253393.202044
+184818.951394     8253438.356257
+184828.730343     8253491.725064
+184833.363068     8253553.780174
+184832.899335     8253582.573365
+184835.523500     8253613.918631
+184842.275227     8253660.979866
+184854.456096     8253720.646619
+184860.541159     8253731.384399
+184860.521001     8253732.635978
+184860.268971     8253748.284535
+184860.693030     8253760.813011
+184860.945523     8253783.982197
+184864.740400     8253820.354568
+184872.268837     8253858.036297
+184877.002565     8253913.831987
+184891.827116     8253964.773916
+184897.115120     8253986.142779
+184902.272075     8254015.648432
+184910.870412     8254064.616690
+184920.871345     8254104.214311
+184926.593487     8254137.485860
+184929.399119     8254157.563858
+184929.792738     8254171.970464
+184932.578200     8254193.300806
+184935.939130     8254217.770493
+184944.123308     8254253.583717
+184950.461245     8254287.490690
+184954.235582     8254325.114634
+184958.262332     8254347.090026
+184962.551190     8254352.791073
+184962.531032     8254354.042652
+184963.621102     8254364.076837
+184971.906079     8254393.631403
+184976.377249     8254426.882932
+184976.639820     8254449.426329
+184977.659314     8254463.842569
+184977.528253     8254471.980124
+184978.143667     8254472.615542
+184978.123509     8254473.867121
+184977.407284     8254479.491126
+184972.957129     8254483.805003
+184972.271139     8254487.551640
+184968.446477     8254491.875145
+184968.375913     8254496.256435
+184968.305337     8254500.638489
+184969.415564     8254509.421096
+184970.545961     8254516.951359
+184974.723929     8254529.537618
+184979.527389     8254542.133505
+184980.052069     8254548.402555
+184987.297777     8254564.792466
+184998.943234     8254579.998212
+185013.060806     8254597.119844
+185022.223687     8254611.035487
+185035.705688     8254628.773280
+185043.566797     8254645.799373
+185053.284608     8254664.105934
+185064.637708     8254697.464158
+185078.593995     8254724.599950
+185085.334786     8254733.469989
+185085.324720     8254734.095015
+185085.314628     8254734.721568
+185085.940503     8254734.731202
+185090.178967     8254743.561196
+185108.444258     8254775.147219
+185124.408440     8254794.175873
+185132.955908     8254807.456099
+185148.203877     8254832.107994
+185157.336522     8254847.901005
+185164.642333     8254860.535410
+185172.523994     8254876.309165
+185190.930412     8254899.132608
+185214.644813     8254942.072566
+185238.480589     8254977.500001
+185271.256609     8255001.796519
+185287.261106     8255018.322015
+185292.155693     8255025.283510
+185305.082371     8255038.631143
+185316.071718     8255055.704623
+185325.244678     8255068.994477
+185337.555955     8255081.705929
+185357.960226     8255097.045731
+185367.284404     8255100.946451
+185377.184075     8255107.984987
+185395.146086     8255119.531529
+185408.819607     8255125.377795
+185422.442747     8255134.352243
+185438.558147     8255143.991763
+185461.586121     8255151.859088
+185488.317405     8255162.913903
+185508.843003     8255170.744238
+185522.496009     8255177.840548
+185549.177270     8255192.025081
+185586.484099     8255206.999877
+185621.833034     8255226.953622
+185653.973495     8255251.865537
+185678.545642     8255280.418152
+185706.205675     8255311.523604
+185727.780658     8255331.890512
+185747.630000     8255342.839396
+185751.373626     8255343.523729
+185756.358934     8255344.852355
+185772.444086     8255356.370008
+185795.956424     8255373.009540
+185802.162469     8255376.235555
+185806.491654     8255379.432680
+185813.898659     8255385.807667
+185826.875743     8255396.025589
+185836.805638     8255401.187522
+185849.227818     8255407.012997
+185854.807988     8255410.229378
+185859.177489     8255410.923345
+185872.871192     8255415.516503
+185882.195395     8255419.415694
+185882.820888     8255419.425322
+185883.446762     8255419.434956
+185892.205563     8255419.569777
+185902.216113     8255419.723865
+185903.467097     8255419.743121
+185907.846689     8255419.810535
+185911.600788     8255419.868320
+185914.729014     8255419.916472
+185917.857239     8255419.964623
+185925.374740     8255419.455157
+185930.450769     8255415.150914
+185934.224669     8255413.955586
+185943.064482     8255409.084097
+185955.658037     8255404.268860
+185962.550071     8255403.748238
+185966.939729     8255403.190626
+185971.399975     8255398.250195
+185987.182253     8255389.726844
+185992.812829     8255389.813513
+END
+LINE3D
+HEIGHT 1130.000000
+186208.529306     8255401.273527
+186214.150173     8255401.986755
+186222.212919     8255406.493239
+186245.936948     8255409.988901
+186266.522660     8255414.062965
+186274.656351     8255414.188164
+186289.116699     8255410.026841
+186316.079831     8255406.686207
+186348.613450     8255407.186984
+186385.526278     8255407.755169
+186413.125375     8255403.797615
+186438.151177     8255404.182828
+186462.541420     8255405.183437
+186501.179888     8255415.169646
+186538.981531     8255438.291632
+186573.624344     8255463.242064
+186602.232869     8255474.325775
+186629.115347     8255475.992985
+186658.500582     8255477.697189
+186693.516394     8255479.488064
+186739.067436     8255487.702077
+186772.791923     8255491.978381
+186803.387829     8255496.205000
+186837.112316     8255500.481304
+186880.191255     8255506.778667
+186914.541235     8255511.064599
+186947.619691     8255516.582848
+186986.984846     8255520.319268
+187018.892590     8255520.810412
+187047.732988     8255517.497145
+187080.952571     8255514.252814
+187121.074661     8255509.861312
+187148.047884     8255505.894124
+187166.282107     8255500.539002
+187181.408619     8255493.885684
+187190.248457     8255489.012667
+187200.964771     8255484.168534
+187216.686552     8255479.401448
+187227.504061     8255468.297898
+187238.987376     8255454.700818
+187251.732150     8255440.496446
+187263.286411     8255422.518082
+187264.638208     8255416.277915
+187269.169017     8255406.956195
+187275.001599     8255394.524024
+187276.484838     8255380.146308
+187277.997920     8255363.891982
+187278.280198     8255346.365293
+187273.759017     8255316.242717
+187268.451034     8255296.126201
+187263.172919     8255274.131546
+187257.622615     8255269.037027
+187242.728333     8255261.294901
+187233.979241     8255260.533521
+187222.798361     8255255.352333
+187210.497151     8255242.015856
+187199.437240     8255229.323666
+187191.576119     8255212.298337
+187184.905510     8255199.047001
+187175.823270     8255180.124279
+187166.710782     8255163.079688
+187158.879909     8255144.176227
+187147.415907     8255117.703979
+187138.374007     8255096.276570
+187133.086182     8255074.908475
+187128.383534     8255056.053165
+187128.625497     8255041.029634
+187128.231471     8255026.624551
+187127.787446     8255015.347656
+187127.564820     8254990.300331
+187128.078971     8254958.376664
+187131.801977     8254921.494833
+187133.506998     8254893.346693
+187135.141455     8254869.579843
+187139.479887     8254833.332665
+187147.027557     8254792.127329
+187158.813333     8254759.750452
+187173.686971     8254729.927942
+187190.669746     8254685.735821
+187203.060833     8254654.621680
+187212.021640     8254642.237661
+187226.703757     8254624.306679
+187253.323688     8254603.428963
+187275.089360     8254573.085830
+187284.040088     8254561.327601
+187287.864381     8254557.003326
+187301.800024     8254546.574481
+187323.293890     8254533.131490
+187334.636078     8254528.296990
+187342.839951     8254524.040893
+187347.290119     8254519.726252
+187354.878578     8254514.834737
+187361.770611     8254514.314115
+187364.979479     8254509.355187
+187370.741497     8254501.304307
+187379.126837     8254485.780943
+187379.197400     8254481.399653
+187382.396201     8254477.065750
+187382.557498     8254467.050826
+187385.947832     8254450.824632
+187389.186948     8254443.987571
+187389.247433     8254440.232070
+187393.627024     8254440.299484
+187400.508967     8254440.405415
+187414.898726     8254440.626911
+187441.175894     8254441.031385
+187466.827570     8254441.426231
+187492.468785     8254442.446861
+187513.064589     8254445.894372
+187534.316515     8254447.473384
+187555.527732     8254451.556312
+187577.990686     8254455.659271
+187606.064070     8254461.099715
+187647.296005     8254465.490814
+187682.897351     8254469.796008
+187715.501545     8254465.914731
+187751.294437     8254458.326869
+187787.147444     8254446.982737
+187817.259366     8254442.437152
+187850.549524     8254434.810767
+187889.460575     8254427.896082
+187918.411469     8254417.698361
+187946.101300     8254408.107173
+187981.207846     8254404.264414
+188024.448069     8254400.547618
+188052.672672     8254396.598928
+188079.020021     8254392.622106
+188107.880195     8254388.057254
+188144.853889     8254384.869944
+188176.842276     8254380.354008
+188203.836051     8254375.134483
+188228.397657     8254365.495144
+188258.700360     8254349.056492
+188290.214472     8254335.141794
+188321.082947     8254322.468283
+188343.777391     8254312.174259
+188370.266644     8254299.434104
+188396.048998     8254291.691389
+188418.017138     8254287.647160
+188438.784711     8254280.453199
+188458.260197     8254275.744657
+188481.479334     8254271.718920
+188515.274397     8254271.613169
+188541.561262     8254271.391848
+188562.217932     8254271.083864
+188587.374794     8254263.331521
+188617.496795     8254258.160148
+188649.404539     8254258.651292
+188663.178503     8254258.237364
+188675.691404     8254258.429971
+188702.604524     8254258.218289
+188724.572664     8254254.174060
+188752.222180     8254247.086030
+188776.066797     8254243.070685
+188803.211790     8254228.462026
+188830.235038     8254221.365121
+188845.381732     8254213.458695
+188863.051317     8254204.339215
+188886.270441     8254200.314241
+188907.068251     8254191.242912
+188931.114504     8254174.707957
+188948.925228     8254156.825132
+188968.007094     8254137.709984
+188995.908628     8254114.974162
+189025.767293     8254087.259380
+189044.263994     8254065.630681
+189059.632470     8254043.953832
+189080.731952     8254016.104223
+189104.405506     8253983.911095
+189120.601099     8253949.725028
+189125.988879     8253926.016716
+189131.942443     8253906.072780
+189140.045423     8253869.258368
+189151.336361     8253828.735831
+189158.782861     8253793.788383
+189164.827146     8253768.211578
+189168.903457     8253748.239511
+189170.376999     8253734.487590
+189174.312171     8253723.278867
+189182.797941     8253701.496074
+189190.023410     8253680.319827
+189194.089643     8253660.973549
+189195.017571     8253642.204909
+189196.742380     8253612.804420
+189201.121891     8253574.054096
+189202.967669     8253537.142605
+189203.461650     8253506.471281
+189203.905213     8253478.930432
+189204.298383     8253454.518531
+189206.154240     8253416.981250
+189211.028195     8253386.377346
+189214.862104     8253342.609538
+189215.396413     8253309.434292
+189215.264890     8253278.754104
+189214.527293     8253246.811169
+189211.257466     8253216.708619
+189210.510541     8253185.392250
+189206.705204     8253149.645663
+189202.961102     8253110.144351
+189202.819513     8253080.089188
+189198.842788     8253054.984078
+189195.492318     8253029.888607
+189194.614333     8253006.709793
+189190.657778     8252980.352340
+189190.435534     8252955.305021
+189185.853474     8252928.938704
+189176.902295     8252901.878426
+189167.840213     8252881.704124
+189164.227635     8252872.883000
+189164.328447     8252866.623578
+189153.954895     8252850.185521
+189140.149469     8252813.659061
+189125.173700     8252772.106267
+189115.859138     8252728.762014
+189115.465506     8252714.356173
+189115.606645     8252705.592828
+189116.635385     8252680.564765
+189127.109286     8252651.925656
+189137.179489     8252609.505731
+189149.893551     8252558.361748
+189164.272387     8252520.391285
+189176.129097     8252483.633888
+189186.683652     8252449.986936
+189202.263831     8252415.165451
+189216.622509     8252378.446566
+189227.187907     8252344.173836
+189235.028027     8252323.632994
+189242.141830     8252309.342712
+189253.060532     8252291.979745
+189262.181873     8252269.580791
+189271.515680     8252234.037214
+189283.513529     8252188.516473
+189293.321610     8252162.371658
+189299.224768     8252145.557433
+189300.737861     8252129.302343
+189306.973692     8252091.832482
+189308.022590     8252065.552840
+189302.704159     8252046.061343
+189292.370935     8252027.119364
+189276.467237     8252004.335209
+189258.706457     8251980.270580
+189243.367767     8251961.251554
+189228.594085     8251945.997657
+189208.179366     8251931.282874
+189170.408341     8251906.283526
+189129.751030     8251866.214023
+189094.563392     8251836.245355
+189069.183522     8251818.950367
+189049.869333     8251813.643986
+189027.447077     8251807.037874
+189026.821585     8251807.028246
+189023.067867     8251806.970466
+189012.027733     8251793.026692
+188992.945404     8251773.324097
+188978.837541     8251755.575906
+188955.850277     8251745.204665
+188935.375061     8251734.246147
+188902.932558     8251728.111742
+188875.535085     8251719.550451
+188836.886537     8251710.190032
+188785.169396     8251696.246076
+188726.529986     8251684.700111
+188676.004109     8251674.530924
+188619.786789     8251668.030563
+188577.979768     8251660.500124
+188511.751516     8251653.845669
+188453.647641     8251647.942213
+188403.031030     8251643.406659
+188362.354024     8251643.406478
+188331.626689     8251647.316645
+188305.975395     8251646.921804
+188282.200578     8251646.555847
+188277.821369     8251646.488440
+188269.667520     8251647.614820
+188247.709459     8251651.033260
+188227.062867     8251650.715455
+188213.359467     8251646.748092
+188187.173414     8251640.709990
+188136.657234     8251629.915008
+188097.382812     8251620.544955
+188058.693556     8251613.688451
+188013.667194     8251611.743489
+187968.741645     8251603.539103
+187917.569736     8251594.611861
+187876.438613     8251583.961339
+187843.481127     8251570.932089
+187808.626242     8251559.125521
+187755.668196     8251544.536520
+187715.919500     8251525.767705
+187686.241457     8251503.397471
+187657.108252     8251486.044710
+187636.178931     8251464.435087
+187611.001461     8251434.620501
+187582.594560     8251411.017945
+187555.954009     8251394.329496
+187537.981920     8251383.408744
+187528.728292     8251375.127498
+187516.386780     8251364.293415
+187502.793888     8251353.440833
+187494.751312     8251347.682007
+187483.580129     8251341.875024
+187467.384075     8251337.243348
+187445.567153     8251331.898443
+187421.903609     8251324.647280
+187397.644439     8251315.508351
+187370.237256     8251307.573619
+187330.952374     8251298.829349
+187291.617455     8251293.215561
+187260.425937     8251287.100412
+187236.086494     8251282.969333
+187216.792081     8251276.411367
+187192.452639     8251272.280287
+187167.507492     8251266.887231
+187140.150333     8251255.822782
+187120.876471     8251248.012479
+187120.250597     8251248.002845
+187114.700663     8251242.909096
+187106.698033     8251234.646342
+187096.334560     8251217.582496
+187086.081609     8251193.632667
+187081.318476     8251178.532858
+187070.439639     8251154.574160
+187055.807478     8251130.556924
+187033.061783     8251105.162911
+187011.163744     8251066.008107
+186987.822424     8251038.726327
+186971.767509     8251025.331306
+186953.209861     8251011.897762
+186919.021177     8250997.596906
+186887.365463     8250981.457206
+186866.274834     8250969.863270
+186854.558813     8250959.038815
+186840.370678     8250946.298473
+186818.139967     8250927.799306
+186785.253044     8250910.388765
+186762.991702     8250893.767724
+186741.376405     8250875.903973
+186710.416746     8250855.392611
+186675.269042     8250822.920779
+186635.772376     8250788.503407
+186603.117326     8250756.695888
+186564.831318     8250724.801694
+186525.970223     8250689.768160
+186492.588486     8250664.210430
+186465.988262     8250645.018060
+186440.538211     8250632.104368
+186415.068384     8250620.442261
+186389.598544     8250608.780918
+186367.296888     8250594.663035
+186342.472710     8250581.758977
+186323.239164     8250571.445516
+186297.718549     8250562.913114
+186265.962023     8250553.032837
+186242.288400     8250546.407463
+186228.614854     8250540.562726
+186213.740359     8250531.568251
+186186.958681     8250523.642383
+186149.631682     8250509.919930
+186118.561133     8250496.293779
+186082.495579     8250481.964798
+186042.000039     8250470.697350
+186007.175773     8250457.013420
+185971.160243     8250439.554722
+185932.077367     8250418.291613
+185891.722954     8250398.261585
+185870.703282     8250382.285601
+185870.087487     8250381.650177
+185865.142900     8250377.816871
+185861.409340     8250376.507513
+185861.419419     8250375.881723
+185852.125476     8250370.103635
+185844.072440     8250364.970593
+185844.082519     8250364.344803
+185843.457026     8250364.335175
+185834.778485     8250359.193269
+185817.270592     8250358.297068
+185803.566809     8250354.329699
+185796.059375     8250354.214140
+185778.541008     8250353.944486
+185760.397531     8250353.665211
+185742.273830     8250352.134351
+185723.564964     8250348.089940
+185716.036989     8250349.225954
+185711.637622     8250350.410126
+185701.526260     8250356.515460
+185672.585432     8250366.088155
+185637.256736     8250383.700569
+185602.574059     8250400.071801
+185564.127598     8250417.010280
+185518.748395     8250436.973297
+185487.456064     8250437.117571
+185461.986225     8250425.456228
+185422.721882     8250415.460385
+185392.922487     8250400.601147
+185368.784669     8250383.951222
+185355.191790     8250373.097877
+185339.046141     8250365.336490
+185315.372136     8250358.711111
+185287.843984     8250358.287380
+185277.207942     8250358.123664
+185267.197774     8250357.969581
+185247.318196     8250348.898065
+185217.599825     8250329.031754
+185188.517026     8250308.549281
+185174.944304     8250296.444357
+185163.066974     8250295.635589
+185140.624560     8250290.281056
+185118.787469     8250286.188495
+185103.721429     8250289.087076
+185094.175457     8250298.957545
+185080.744706     8250316.907789
+185058.020014     8250329.079946
+185050.966314     8250339.614722
+185049.654463     8250343.350961
+185045.699121     8250355.812027
+185040.906190     8250381.408858
+185039.867371     8250407.062710
+185038.353896     8250423.317795
+185036.971469     8250431.436088
+185032.400344     8250443.260966
+185024.499740     8250467.557309
+185008.425117     8250494.232374
+184986.114214     8250519.558794
+184963.056455     8250552.387345
+184944.620442     8250570.259781
+184931.300391     8250581.324810
+184926.154168     8250590.011114
+184922.188557     8250603.097966
+184916.285602     8250619.911429
+184911.674138     8250634.240994
+184895.549109     8250664.045771
+184885.095378     8250691.432537
+184873.490890     8250712.541379
+184859.858324     8250743.010466
+184847.376313     8250779.758238
+184835.288125     8250830.911854
+184830.192770     8250875.286189
+184823.896634     8250916.512318
+184818.286678     8250953.991813
+184807.641211     8250993.271632
+184798.842353     8251034.458473
+184793.343288     8251065.052756
+184793.141664     8251077.571601
+184792.808979     8251098.228002
+184792.446058     8251120.761771
+184803.294266     8251146.598596
+184812.861049     8251174.294294
+184821.771913     8251203.857730
+184831.833319     8251239.700614
+184847.424692     8251281.888830
+184864.146259     8251331.608069
+184877.184685     8251376.887475
+184889.546818     8251425.287723
+184908.286574     8251466.272511
+184932.647018     8251507.969761
+184952.941039     8251569.013285
+184973.396536     8251620.042654
+184988.856658     8251670.368421
+185005.023308     8251715.695979
+185026.891098     8251756.728915
+185051.716120     8251808.450722
+185066.086172     8251848.742304
+185076.167748     8251883.332846
+185089.347301     8251919.849671
+185104.272663     8251964.532177
+185122.477470     8251999.873701
+185139.017120     8252022.041700
+185154.910726     8252045.452409
+185177.626184     8252072.723791
+185194.730842     8252098.656918
+185216.285655     8252120.276169
+185237.235133     8252140.634214
+185253.239642     8252157.158946
+185274.854952     8252175.021932
+185298.226139     8252200.425573
+185309.145292     8252221.881114
+185313.242223     8252239.475210
+185315.967200     8252264.561053
+185319.822574     8252297.177159
+185328.511644     8252340.511783
+185339.864743     8252373.870007
+185353.730285     8252406.640196
+185363.993328     8252429.963471
+185375.537591     8252451.428633
+185387.172969     8252467.260168
+185401.926494     8252483.765644
+185419.817941     8252499.693477
+185436.387827     8252519.984107
+185446.075401     8252540.168037
+185455.107235     8252562.220471
+185470.425755     8252582.491840
+185488.095802     8252612.190103
+185509.630457     8252635.060933
+185519.418831     8252648.986204
+185524.959068     8252654.705748
+185535.322910     8252671.770364
+185547.361999     8252701.381952
+185553.265607     8252723.386234
+185556.242615     8252732.823520
+185556.676561     8252744.726204
+185562.570091     8252767.356276
+185568.100687     8252812.520881
+185578.787598     8252848.372629
+185589.575702     8252877.964961
+185596.054397     8252903.108583
+185599.465351     8252924.448552
+185603.643318     8252937.034811
+185610.253443     8252954.041648
+185619.285276     8252976.094082
+185627.055665     8252998.753044
+185642.101997     8253035.924549
+185662.688185     8253078.815592
+185676.685156     8253103.448995
+185686.423137     8253120.503213
+185699.905125     8253138.241771
+185717.635275     8253164.184527
+185732.782420     8253195.096609
+185746.819719     8253217.226090
+185765.811314     8253242.562318
+185786.639822     8253270.431364
+185803.058121     8253300.110359
+185813.290915     8253325.311766
+185823.624521     8253344.253751
+185837.631190     8253368.261359
+185856.532433     8253399.231226
+185875.513950     8253425.193244
+185886.543624     8253439.762802
+185889.621443     8253442.940665
+185896.382786     8253450.558368
+185908.694062     8253463.269819
+185921.540098     8253481.624532
+185934.386146     8253499.978481
+185943.538949     8253514.519914
+185952.096508     8253527.173586
+185962.520847     8253540.481937
+185971.734135     8253551.267869
+185988.384688     8253566.549892
+186005.721206     8253578.086806
+186021.826528     8253588.352115
+186034.208368     8253596.682277
+186043.441825     8253606.215865
+186051.464243     8253613.226270
+186062.019631     8253618.397831
+186070.637687     8253627.295238
+186078.034601     8253634.296779
+186090.436611     8253641.374598
+186100.931132     8253650.301653
+186109.609673     8253655.443559
+186115.724984     8253664.303207
+186121.255130     8253670.649305
+186124.867708     8253679.470429
+186125.241170     8253695.128614
+186124.999219     8253710.151381
+186121.154780     8253715.726471
+186116.664285     8253722.545034
+186105.080158     8253742.401536
+186091.124345     8253754.082724
+186086.724596     8253755.266890
+186079.196991     8253756.403674
+186070.982658     8253761.285555
+186061.507249     8253766.774733
+186053.949408     8253769.788886
+186039.498782     8253773.322884
+186004.341831     8253780.295355
+185965.360229     8253791.590566
+185938.306351     8253800.565598
+185918.204979     8253805.265271
+185893.805052     8253804.889692
+185862.522800     8253804.408176
+185835.064829     8253799.603150
+185806.920894     8253798.543232
+185780.643726     8253798.138758
+185747.474524     8253798.254906
+185715.425653     8253806.526343
+185678.926220     8253819.113179
+185642.992571     8253835.464392
+185613.405712     8253846.279032
+185598.844577     8253856.698249
+185592.537720     8253859.731657
+185582.456607     8253863.958859
+185568.440310     8253879.395548
+185550.589640     8253899.782301
+185529.580510     8253921.998271
+185500.317088     8253951.600813
+185479.347903     8253971.312855
+185462.849412     8253985.459447
+185453.959180     8253993.461412
+185448.812957     8254002.147715
+185441.113595     8254013.925206
+185430.246062     8254028.158473
+185421.719214     8254052.444412
+185412.547074     8254077.973835
+185402.254258     8254095.345672
+185391.306083     8254114.586019
+185386.734946     8254126.411661
+185386.018338     8254132.035661
+185386.331698     8254151.449352
+185393.900462     8254186.627159
+185397.200525     8254214.852341
+185398.149455     8254233.649871
+185402.912588     8254248.749680
+185407.019980     8254265.717993
+185407.444230     8254278.246472
+185414.538338     8254304.025512
+185426.577427     8254333.637099
+185441.209970     8254357.654341
+185459.686963     8254376.095729
+185467.588412     8254390.617136
+185472.391872     8254403.213022
+185480.818370     8254424.004250
+185496.550692     8254457.429117
+185508.700660     8254480.156257
+185513.484344     8254494.003728
+185520.669185     8254514.149134
+185525.321809     8254536.134161
+185528.167755     8254553.709002
+185529.328007     8254559.361891
+185529.943802     8254559.997314
+185530.508810     8254563.762443
+185531.498067     8254580.056051
+185532.557888     8254591.968369
+185533.728600     8254596.995474
+185537.280694     8254609.572099
+185540.056077     8254631.528230
+185540.974771     8254652.203129
+185544.971272     8254676.056654
+185550.602692     8254714.961072
+185551.470586     8254738.766440
+185554.942407     8254756.350915
+185562.026818     8254782.755750
+185574.509933     8254823.644231
+185575.670578     8254829.296362
+185578.798803     8254829.344514
+185586.175560     8254837.597634
+185590.474115     8254842.672885
+185591.099989     8254842.682519
+185597.285876     8254847.160113
+185604.622317     8254857.916391
+185604.612226     8254858.542944
+185609.556813     8254862.376250
+185640.617283     8254876.628190
+185662.353575     8254886.979411
+185678.610102     8254887.856350
+185691.002033     8254895.559958
+185707.773556     8254903.330979
+185726.956684     8254916.774916
+185754.192873     8254935.350366
+185766.463811     8254950.566504
+185779.895393     8254971.434773
+185797.121033     8254989.856135
+185803.175859     8255002.471283
+185806.869079     8255006.285328
+185817.323679     8255017.714783
+185830.775419     8255037.331472
+185843.681940     8255051.930684
+185859.616255     8255072.837477
+185875.570371     8255092.491156
+185878.638099     8255096.295572
+185891.030030     8255103.999180
+185912.080332     8255118.097038
+185922.019937     8255122.632411
+185928.225981     8255125.858425
+185938.236531     8255126.012514
+185957.550719     8255131.318895
+185973.121282     8255135.940943
+185986.239493     8255137.396284
+186000.609477     8255138.869365
+186013.112311     8255139.686997
+186020.559249     8255143.558821
+186024.938840     8255143.626234
+186037.381178     8255148.200131
+186052.285908     8255155.317237
+186060.923740     8255162.963059
+186070.772981     8255173.132835
+186086.676690     8255195.916226
+186111.814214     8255228.234739
+186127.798554     8255246.011814
+186127.748148     8255249.141526
+186131.451459     8255252.329017
+186131.956364     8255259.849652
+186139.888049     8255272.493690
+186144.066017     8255285.079949
+186147.739080     8255290.145573
+186147.678607     8255293.900309
+186148.243984     8255297.666208
+186153.662870     8255310.896748
+186160.141946     8255336.040376
+186163.714197     8255347.365422
+186163.663791     8255350.495133
+186163.583136     8255355.502977
+186164.693376     8255364.284819
+186165.853997     8255369.938479
+186169.466587     8255378.758839
+186169.456496     8255379.385392
+186169.385933     8255383.766682
+186173.058996     8255388.832306
+186173.624397     8255392.596676
+186174.239798     8255393.232858
+186174.865673     8255393.242492
+186175.481074     8255393.878673
+186180.476091     8255394.580740
+186181.101966     8255394.590374
+186184.855683     8255394.648153
+186189.850676     8255395.351748
+186193.604775     8255395.409534
+186196.733000     8255395.457685
+END
+LINE3D
+HEIGHT 1140.000000
+186422.928660     8255067.107781
+186423.554152     8255067.117409
+186427.308252     8255067.175194
+186431.051903     8255067.857999
+186435.411312     8255069.178519
+186440.406330     8255069.880586
+186454.785998     8255070.728636
+186472.293916     8255071.623309
+186492.244046     8255076.314298
+186506.522927     8255083.420242
+186515.282110     8255083.555069
+186525.918152     8255083.718786
+186537.684209     8255091.412760
+186551.913041     8255101.649949
+186571.701504     8255116.355092
+186597.666169     8255136.162860
+186633.651069     8255155.499685
+186664.661108     8255172.882865
+186695.751827     8255185.256672
+186731.908484     8255193.952791
+186762.312832     8255210.073229
+186775.895632     8255221.552364
+186784.503598     8255231.076325
+186791.869905     8255239.954464
+186805.482955     8255249.555466
+186818.551166     8255254.138997
+186822.869879     8255257.962669
+186833.495854     8255258.751411
+186850.327849     8255262.767695
+186883.305493     8255274.545367
+186903.174993     8255284.242673
+186910.672743     8255284.983263
+186918.806052     8255285.108456
+186926.394499     8255280.217705
+186934.759681     8255265.945920
+186943.145020     8255250.422556
+186944.688756     8255232.288575
+186945.707405     8255207.887066
+186941.842347     8255175.895991
+186937.855912     8255151.417441
+186931.901898     8255132.542869
+186926.533061     8255116.181084
+186922.950719     8255105.482591
+186913.272854     8255084.672102
+186901.243832     8255054.435490
+186889.234991     8255022.945770
+186877.902431     8254988.335972
+186874.127712     8254950.712023
+186874.500736     8254927.550936
+186875.024953     8254895.002244
+186875.438268     8254869.339527
+186870.735620     8254850.484218
+186866.164033     8254823.491353
+186862.682121     8254806.533432
+186857.979474     8254787.678123
+186857.616102     8254771.393384
+186857.676600     8254767.637120
+186862.317906     8254751.430945
+186875.910335     8254723.465783
+186880.309252     8254683.463104
+186883.679428     8254668.488488
+186883.840725     8254658.473565
+186884.062519     8254644.702376
+186879.824054     8254635.872383
+186871.256798     8254623.844506
+186866.382775     8254615.629909
+186865.212051     8254610.603568
+186854.767554     8254598.546795
+186845.594582     8254585.257706
+186831.436695     8254570.639232
+186817.127590     8254565.409892
+186798.368318     8254564.495193
+186782.878410     8254554.865301
+186753.684719     8254541.268040
+186718.103531     8254535.711268
+186691.816272     8254535.933347
+186676.750614     8254538.831934
+186649.222080     8254538.408198
+186612.550821     8254522.817240
+186588.160973     8254521.815872
+186570.208659     8254509.643534
+186549.733837     8254498.684258
+186531.872245     8254480.879052
+186509.026120     8254461.744466
+186476.996562     8254429.946575
+186453.080156     8254399.525456
+186440.173623     8254384.927008
+186424.834933     8254365.907982
+186399.526021     8254344.230946
+186375.509184     8254320.069255
+186347.687830     8254298.980255
+186325.376095     8254285.488161
+186303.710379     8254270.754886
+186283.871510     8254259.179454
+186250.893472     8254247.402540
+186220.448809     8254233.785260
+186203.082043     8254224.126478
+186192.516564     8254219.581471
+186172.626907     8254211.135745
+186148.307240     8254205.753081
+186110.768538     8254205.175262
+186093.725210     8254214.304382
+186077.306991     8254223.443125
+186060.808513     8254237.588953
+186049.365512     8254248.682875
+186044.854860     8254256.753016
+186035.763004     8254277.273826
+186024.078052     8254303.390516
+186019.971492     8254325.240716
+186019.628741     8254346.522141
+186019.124681     8254377.819255
+186018.781918     8254399.101445
+186019.528842     8254430.417815
+186022.708305     8254466.154768
+186025.978132     8254496.257318
+186028.894655     8254509.450104
+186029.238250     8254526.986427
+186032.013633     8254548.942559
+186032.346768     8254567.104665
+186036.393688     8254587.827715
+186039.744157     8254612.923185
+186042.539697     8254633.627738
+186048.453384     8254655.006231
+186052.470055     8254677.607413
+186052.843517     8254693.265598
+186055.739870     8254707.710727
+186060.432833     8254727.191068
+186067.557177     8254751.092739
+186071.160059     8254760.539658
+186074.802873     8254767.483414
+186078.546906     8254768.166225
+186085.983753     8254772.664603
+186097.175105     8254777.219243
+186110.172371     8254786.184058
+186125.712685     8254792.684238
+186140.516604     8254806.060767
+186155.976263     8254817.568792
+186168.953371     8254827.785185
+186178.126332     8254841.075039
+186184.816741     8254853.073262
+186192.668154     8254870.725150
+186197.976136     8254890.841666
+186205.282329     8254903.476077
+186211.357313     8254914.839646
+186214.404883     8254919.895642
+186219.975369     8254923.737054
+186236.806982     8254927.753332
+186257.352762     8254934.330560
+186266.606377     8254942.612570
+186274.033157     8254947.735973
+186285.194261     8254954.168746
+186300.007889     8254966.918715
+186312.995446     8254976.510089
+186324.731254     8254986.082196
+186335.185854     8254997.511651
+186346.891796     8255008.961895
+186364.813492     8255023.011595
+186382.755726     8255035.809722
+186387.064730     8255040.259954
+186390.112325     8255045.314421
+186396.298187     8255049.793543
+186399.365940     8255053.596431
+186408.003772     8255061.242254
+186409.245047     8255061.888069
+186409.870540     8255061.897697
+186411.121906     8255061.916959
+END
+LINE3D
+HEIGHT 1140.000000
+187767.546630     8254187.476533
+187768.172504     8254187.486167
+187769.423489     8254187.505422
+187773.803080     8254187.572836
+187785.700567     8254187.130025
+187809.575814     8254181.236553
+187832.169459     8254177.201187
+187855.399044     8254172.550430
+187875.429840     8254172.232812
+187903.684679     8254166.406753
+187923.775972     8254162.332870
+187938.871866     8254157.556915
+187955.976074     8254144.671535
+187972.424528     8254133.655424
+187988.226951     8254123.881259
+188020.346410     8254111.227003
+188054.534643     8254086.709352
+188072.173597     8254079.467998
+188095.453600     8254071.686765
+188138.117974     8254064.830618
+188180.107213     8254061.094566
+188202.085444     8254056.423783
+188227.121324     8254056.183206
+188258.464060     8254052.909221
+188289.140990     8254052.128766
+188316.113832     8254048.161572
+188343.642366     8254048.585308
+188348.021576     8254048.652715
+188348.647832     8254048.662355
+188367.427261     8254048.325475
+188408.174843     8254043.943602
+188450.233895     8254035.825483
+188494.210501     8254025.233103
+188530.639358     8254017.028321
+188558.348595     8254006.184779
+188587.996322     8253991.614643
+188616.533427     8253968.262660
+188634.393793     8253947.250111
+188652.224674     8253928.115707
+188667.552823     8253908.942779
+188682.264806     8253889.133658
+188698.945515     8253863.720576
+188711.275735     8253836.361929
+188729.247756     8253808.464181
+188750.348002     8253780.614584
+188769.641571     8253748.354801
+188783.364678     8253712.252077
+188792.557346     8253685.471845
+188799.913113     8253656.158031
+188804.140642     8253626.796829
+188808.196795     8253608.076341
+188808.983584     8253598.071045
+188810.487363     8253582.441756
+188815.955810     8253553.724836
+188819.537690     8253525.605585
+188819.991344     8253497.438183
+188820.606295     8253459.255857
+188822.483073     8253420.467010
+188823.642874     8253387.301391
+188824.146934     8253356.004278
+188824.085987     8253320.942036
+188819.715642     8253281.430320
+188815.366218     8253240.667037
+188811.470135     8253210.554847
+188803.134370     8253184.129986
+188794.223506     8253154.566550
+188784.697241     8253124.366933
+188775.191133     8253092.915737
+188769.307682     8253069.659875
+188764.019488     8253048.291010
+188756.854816     8253026.893261
+188752.767188     8253008.674127
+188742.504539     8252985.350094
+188738.639469     8252953.359784
+188733.522650     8252921.350205
+188729.101899     8252884.968201
+188724.166546     8252841.691356
+188717.869306     8252805.281232
+188713.328337     8252776.411005
+188707.666680     8252739.383955
+188701.005305     8252686.689080
+188697.170483     8252652.820637
+188692.598501     8252625.828531
+188691.881825     8252592.634029
+188688.904356     8252544.379000
+188680.961760     8252493.542238
+188677.468925     8252438.392357
+188672.292385     8252410.138292
+188663.109333     8252397.474992
+188659.021717     8252379.255094
+188648.849790     8252350.298191
+188641.704512     8252327.648852
+188636.941762     8252312.549049
+188632.168168     8252298.075024
+188624.236865     8252285.430991
+188613.287464     8252265.853583
+188591.107159     8252244.224705
+188569.572504     8252221.353875
+188538.017602     8252198.954751
+188503.283305     8252179.637176
+188467.964607     8252157.806063
+188418.901417     8252134.511497
+188374.288776     8252106.902296
+188343.399682     8252082.009643
+188311.319336     8252053.341457
+188286.505250     8252039.810846
+188263.497816     8252030.691949
+188237.533557     8252010.882658
+188204.595846     8251996.601823
+188171.607729     8251985.450699
+188136.087407     8251976.138431
+188088.053802     8251966.633551
+188025.115836     8251950.012335
+187978.959090     8251940.536345
+187934.124274     8251926.698326
+187875.525573     8251912.648445
+187837.007704     8251895.150465
+187797.298941     8251873.878486
+187753.352121     8251843.774991
+187710.232404     8251801.163042
+187655.659620     8251770.270041
+187609.764983     8251744.519705
+187576.222319     8251728.977668
+187534.020914     8251707.040612
+187491.789643     8251686.981695
+187451.465479     8251665.073534
+187398.023080     8251641.711561
+187346.457551     8251618.377713
+187289.230804     8251596.836086
+187238.936418     8251572.269915
+187201.074659     8251552.904201
+187155.765569     8251529.667420
+187111.737712     8251504.571763
+187062.775716     8251475.017780
+186988.353590     8251433.175895
+186928.795498     8251400.954267
+186869.833031     8251370.620407
+186820.800472     8251345.447714
+186765.813516     8251301.400444
+186711.987194     8251263.006069
+186664.407625     8251225.333793
+186623.346234     8251171.483468
+186599.419736     8251141.688902
+186569.267419     8251109.919907
+186529.265849     8251067.981899
+186488.618247     8251027.285837
+186455.438516     8250989.209267
+186415.275649     8250957.286184
+186385.112871     8250926.142972
+186360.570972     8250895.712225
+186341.589456     8250869.750207
+186312.667953     8250839.252810
+186274.412193     8250805.480484
+186241.171596     8250771.159409
+186210.252265     8250748.144124
+186170.483400     8250730.627652
+186133.176570     8250715.652856
+186105.264495     8250700.196724
+186077.998069     8250683.498642
+186031.922347     8250669.015578
+185988.328819     8250655.822610
+185944.069101     8250645.123167
+185892.907259     8250635.570900
+185852.310908     8250630.562875
+185801.109132     8250623.513771
+185754.205912     8250621.539919
+185722.923660     8250621.058403
+185690.914722     8250626.826676
+185648.915786     8250631.188524
+185613.103107     8250640.028735
+185581.740200     8250644.555063
+185558.530773     8250647.954241
+185528.984240     8250656.264960
+185496.148186     8250674.542450
+185464.503013     8250696.594704
+185440.405972     8250716.259364
+185411.273611     8250737.724352
+185389.739419     8250753.671265
+185375.158114     8250765.342825
+185367.499079     8250774.616394
+185355.914951     8250794.472896
+185337.953391     8250821.744862
+185324.481944     8250842.198258
+185304.108384     8250863.798066
+185290.697791     8250880.496732
+185290.617149     8250885.503812
+185289.840439     8250894.883318
+185289.477505     8250917.417851
+185294.765331     8250938.785946
+185300.184573     8250952.018020
+185308.166664     8250961.532347
+185314.110600     8250981.032708
+185317.461069     8251006.128178
+185312.143470     8251025.455194
+185301.376368     8251033.429033
+185279.166277     8251052.496030
+185265.170531     8251066.680381
+185256.835216     8251079.074028
+185245.766059     8251105.826141
+185240.256533     8251137.046207
+185235.131312     8251183.298680
+185229.925067     8251234.558228
+185233.013427     8251275.928044
+185239.079164     8251326.735916
+185247.748077     8251371.322120
+185257.002154     8251418.421873
+185266.962760     8251460.523416
+185286.398763     8251497.136544
+185315.683637     8251543.918679
+185338.701982     8251591.230300
+185358.117827     8251629.095008
+185379.874726     8251677.013156
+185399.895906     8251716.139071
+185424.347072     8251752.203451
+185449.373718     8251791.406413
+185465.661338     8251829.222968
+185480.353996     8251849.483940
+185493.240741     8251865.334736
+185511.697565     8251885.028467
+185534.392471     8251913.552187
+185556.986948     8251948.335334
+185562.436451     8251959.688512
+185569.237739     8251964.802287
+185576.564102     8251976.184354
+185587.593764     8251990.754676
+185601.650838     8252011.632573
+185618.099768     8252039.433441
+185638.797216     8252075.440042
+185655.135242     8252110.126887
+185671.563619     8252139.180092
+185680.413986     8252172.499793
+185683.159133     8252196.333292
+185684.087893     8252216.383165
+185687.519399     8252236.470798
+185697.085991     8252264.166493
+185707.238143     8252294.374980
+185719.711167     8252335.890016
+185740.277566     8252380.033408
+185760.278589     8252420.410901
+185778.503553     8252454.500846
+185793.166344     8252476.639955
+185808.434458     8252500.041035
+185815.599142     8252521.438020
+185816.003222     8252535.218843
+185819.424267     8252555.932259
+185823.895042     8252589.184546
+185827.306378     8252610.524522
+185828.416605     8252619.307128
+185833.795152     8252635.042354
+185837.902556     8252652.009903
+185838.376830     8252661.408665
+185839.517305     8252668.313139
+185843.049611     8252682.142113
+185844.250189     8252685.291080
+185844.865985     8252685.926504
+185854.079285     8252696.711671
+185862.131939     8252701.844708
+185870.790311     8252708.238957
+185879.498706     8252711.503490
+185890.114590     8252712.918785
+185907.582169     8252716.318144
+185923.213216     8252717.184691
+185935.595056     8252725.514853
+185944.768029     8252738.803942
+185949.561410     8252752.025618
+185952.518247     8252762.715247
+185953.628475     8252771.497853
+185954.668138     8252784.661750
+185960.420528     8252816.055167
+185971.107439     8252851.906915
+185986.415880     8252872.804074
+185996.860377     8252884.860846
+186013.460524     8252903.272580
+186037.982265     8252934.954906
+186060.122243     8252959.087707
+186076.752627     8252975.622073
+186092.666403     8252997.780438
+186116.502167     8253033.208637
+186148.178883     8253086.914508
+186173.225304     8253124.865885
+186192.762119     8253155.219590
+186207.314020     8253184.243912
+186224.913109     8253218.324223
+186242.603314     8253246.770907
+186262.906760     8253268.370896
+186282.373011     8253303.105892
+186305.391356     8253350.417513
+186328.016081     8253383.322528
+186352.588228     8253411.875143
+186391.590462     8253438.145332
+186421.197930     8253464.897620
+186441.541703     8253483.993687
+186466.941349     8253500.037090
+186492.825347     8253524.853466
+186519.839361     8253557.200099
+186544.381272     8253587.630082
+186572.707518     8253616.240482
+186595.432661     8253642.886833
+186628.209075     8253667.182592
+186665.213469     8253700.935657
+186690.421187     8253728.872110
+186719.352768     8253758.743717
+186744.661299     8253780.420748
+186780.605871     8253802.261495
+186808.366728     8253827.106760
+186834.765710     8253858.817982
+186860.094410     8253879.242670
+186887.905673     8253900.958224
+186913.244452     8253920.757122
+186931.650882     8253943.579800
+186950.723502     8253963.908955
+186964.326472     8253974.135746
+186968.070111     8253974.819315
+186968.695603     8253974.828943
+186976.072359     8253983.082063
+187000.210559     8253999.731994
+187025.609823     8254015.775391
+187045.993924     8254032.367537
+187067.084541     8254043.962236
+187090.667443     8254056.220479
+187123.524118     8254075.509152
+187158.258033     8254094.826722
+187186.815758     8254109.040902
+187204.818477     8254118.083528
+187225.283233     8254129.667830
+187257.645463     8254140.810084
+187279.987077     8254152.423276
+187292.944386     8254163.892782
+187304.004296     8254176.584972
+187321.240014     8254194.380545
+187344.076430     8254214.141689
+187359.475617     8254229.404450
+187377.467875     8254239.072860
+187397.973328     8254248.154010
+187408.538412     8254252.699775
+187409.103801     8254256.464909
+187414.108885     8254256.541951
+187430.375504     8254256.792336
+187445.391137     8254257.023466
+187461.032263     8254257.264224
+187472.929750     8254256.821413
+187488.631373     8254253.305906
+187507.531773     8254245.458024
+187525.776061     8254239.477877
+187548.995580     8254235.452145
+187572.255413     8254228.923256
+187586.110414     8254223.501491
+187599.329449     8254218.696645
+187614.435816     8254213.294142
+187641.429210     8254208.074611
+187665.304457     8254202.181139
+187679.068724     8254202.393007
+187682.822441     8254202.450787
+187691.581624     8254202.585613
+187695.335342     8254202.643393
+187701.662356     8254198.358406
+187709.180251     8254197.848181
+187712.994466     8254194.149696
+187718.635503     8254193.610582
+187724.286618     8254192.445678
+187731.188731     8254191.299266
+187736.880174     8254187.630440
+187738.131158     8254187.649696
+187741.885257     8254187.707482
+187745.013483     8254187.755633
+187748.141708     8254187.803785
+187748.767200     8254187.813413
+187753.146792     8254187.880826
+187753.156870     8254187.255037
+187754.408237     8254187.274298
+187755.659603     8254187.293560
+END
+LINE3D-MASTER
+HEIGHT 1150.000000
+187904.619647     8253779.684910
+187911.267046     8253773.333963
+187915.091327     8253769.010452
+187924.102541     8253753.496722
+187936.150876     8253743.664007
+187947.483356     8253739.456067
+187959.996257     8253739.648674
+187978.765608     8253739.937583
+188001.833514     8253745.301744
+188032.379383     8253752.658844
+188058.585987     8253757.444608
+188076.103972     8253757.714256
+188084.863155     8253757.849082
+188102.371061     8253758.744520
+188139.283889     8253759.312704
+188157.447905     8253758.340407
+188173.149516     8253754.825664
+188194.492176     8253750.771043
+188223.342258     8253746.832744
+188239.709688     8253740.823708
+188250.567894     8253727.217006
+188268.559320     8253698.066902
+188288.478381     8253665.816747
+188302.222410     8253628.462457
+188317.186424     8253593.004779
+188335.229008     8253560.725740
+188358.881629     8253529.784943
+188382.029728     8253491.323517
+188408.417718     8253446.024278
+188422.796554     8253408.053814
+188434.754076     8253365.036995
+188442.382030     8253318.823045
+188450.998848     8253288.903462
+188460.827099     8253261.506304
+188464.924343     8253240.281905
+188469.858019     8253205.922488
+188471.098463     8253167.749790
+188467.334204     8253129.500057
+188464.225686     8253089.381819
+188459.653717     8253062.388948
+188448.250199     8253032.161199
+188432.003288     8252991.840728
+188418.984650     8252945.308973
+188408.338449     8252906.953308
+188398.095195     8252882.377685
+188386.086354     8252850.887965
+188376.055566     8252813.167718
+188366.680519     8252773.578966
+188356.558234     8252741.492341
+188348.919289     8252710.695830
+188348.596232     8252691.907934
+188344.407792     8252679.948223
+188339.776102     8252656.710865
+188331.995253     8252634.677687
+188328.059619     8252607.068666
+188324.143378     8252578.208055
+188323.699340     8252566.931925
+188322.720555     8252550.011769
+188318.784157     8252522.402737
+188314.202861     8252496.036432
+188310.589519     8252487.215296
+188310.054760     8252481.572035
+188295.998055     8252460.694908
+188266.289394     8252440.202037
+188239.719024     8252419.132293
+188215.591678     8252401.855820
+188195.933500     8252379.013874
+188176.750359     8252365.570702
+188157.567219     8252352.127530
+188129.685392     8252334.793266
+188105.082996     8252308.118783
+188083.407202     8252294.011298
+188063.638514     8252278.054570
+188031.992509     8252261.288310
+187991.688503     8252238.128571
+187961.586592     8252203.229864
+187923.744609     8252182.612565
+187882.048491     8252168.196150
+187852.864879     8252153.973100
+187824.246275     8252143.515178
+187790.643139     8252131.727878
+187763.185168     8252126.922852
+187743.255184     8252120.981047
+187718.350352     8252113.084833
+187685.493678     8252093.796160
+187646.461208     8252069.403339
+187619.840826     8252051.462548
+187596.247845     8252039.830095
+187570.838121     8252024.412481
+187532.390816     8252002.533210
+187499.049789     8251974.471564
+187475.779414     8251942.808500
+187456.141775     8251918.714981
+187421.448187     8251896.893490
+187382.355220     8251876.256934
+187353.837822     8251859.538832
+187325.865250     8251847.838965
+187290.334467     8251839.152481
+187252.795765     8251838.574662
+187226.508518     8251838.795977
+187198.445212     8251832.729744
+187156.133299     8251817.677906
+187108.917114     8251796.289604
+187062.911573     8251777.425244
+187003.132081     8251758.974047
+186947.126464     8251739.329051
+186891.736261     8251720.319472
+186857.053134     8251697.872197
+186831.774458     8251674.317792
+186806.405443     8251656.396262
+186769.169177     8251637.040175
+186736.463720     8251608.362368
+186704.090554     8251559.028918
+186669.558645     8251527.192509
+186647.943348     8251509.328759
+186646.762545     8251504.928207
+186643.018918     8251504.243874
+186636.368454     8251489.741723
+186625.439604     8251468.911978
+186610.857837     8251441.765795
+186596.285779     8251413.993052
+186589.524818     8251406.375355
+186589.534897     8251405.749566
+186577.869270     8251391.796163
+186568.020399     8251381.627157
+186556.929871     8251370.812330
+186543.266798     8251364.341045
+186533.982934     8251357.937167
+186525.304393     8251352.795261
+186514.668351     8251352.631544
+186501.459395     8251356.810600
+186489.330035     8251371.650389
+186476.645758     8251382.098496
+186465.212836     8251392.566629
+186454.445746     8251400.539703
+186442.427659     8251408.494286
+186424.283800     8251408.215005
+186404.343737     8251402.898990
+186390.740767     8251392.672198
+186375.341592     8251377.408673
+186348.196518     8251353.199595
+186311.484482     8251301.294051
+186271.634130     8251249.966910
+186234.034099     8251214.326843
+186197.806797     8251171.194278
+186156.352237     8251141.755854
+186121.638861     8251121.186712
+186097.551079     8251101.406305
+186078.993431     8251087.972761
+186057.357963     8251071.361354
+186033.290339     8251050.329369
+186011.019300     8251034.334123
+185986.295935     8251015.170642
+185957.818852     8250995.949382
+185932.388958     8250981.784111
+185924.901299     8250980.416968
+185911.823403     8250976.458469
+185893.114537     8250972.414058
+185869.965594     8250972.057736
+185854.324468     8250971.816978
+185839.843975     8250977.229115
+185833.516962     8250981.514102
+185825.868005     8250990.161882
+185811.206046     8251006.841285
+185791.438203     8251029.702307
+185785.060783     8251037.117005
+185784.303848     8251045.244926
+185771.690980     8251090.129492
+185759.723380     8251133.772100
+185750.228645     8251179.331371
+185744.548126     8251221.192156
+185740.400857     8251245.546272
+185739.341868     8251272.452468
+185738.716838     8251311.260583
+185737.395359     8251354.441118
+185737.396203     8251393.258867
+185744.047117     8251446.579525
+185752.221204     8251483.019304
+185754.794963     8251517.494280
+185757.479613     8251545.084045
+185761.334987     8251577.700150
+185767.309158     8251595.323143
+185774.615351     8251607.957553
+185788.652268     8251630.087029
+185808.713776     8251666.709021
+185818.533230     8251717.574673
+185821.893791     8251742.043590
+185826.112073     8251752.126691
+185827.222313     8251760.908533
+185834.588990     8251769.787442
+185853.762040     8251783.857168
+185876.517825     8251808.624628
+185900.625777     8251827.152692
+185922.927052     8251841.270569
+185947.650417     8251860.434050
+185964.755075     8251886.367178
+185982.455358     8251914.188072
+185989.408709     8251948.730462
+185992.174013     8251971.312382
+185991.851419     8251991.342229
+185991.448171     8252016.379920
+185997.866381     8252045.279043
+186009.713912     8252086.784450
+186029.906468     8252115.269652
+186059.463541     8252145.150887
+186087.356291     8252200.677110
+186109.779392     8252246.100971
+186119.285500     8252277.552167
+186120.274757     8252293.845775
+186120.093291     8252305.113041
+186120.971658     8252328.291862
+186125.018183     8252349.015670
+186129.085260     8252368.487141
+186133.808065     8252386.090871
+186140.872318     8252413.747285
+186154.556394     8252457.784740
+186171.338827     8252503.748485
+186188.776620     8252547.843719
+186205.588920     8252591.929326
+186222.603227     8252623.496093
+186235.338371     8252648.736018
+186244.380283     8252670.162663
+186257.095271     8252696.654167
+186271.667329     8252724.426909
+186288.782065     8252749.734248
+186304.686145     8252772.518408
+186318.137515     8252792.134328
+186329.651912     8252815.477629
+186345.333827     8252852.032208
+186372.933388     8252886.892397
+186412.369950     8252925.065276
+186438.566926     8252969.295337
+186459.395435     8252997.164383
+186473.967111     8253024.937120
+186486.783292     8253045.169207
+186502.081655     8253066.692155
+186517.369939     8253088.840892
+186536.472425     8253107.291908
+186547.481929     8253123.113809
+186569.097226     8253140.977559
+186594.406151     8253162.653832
+186617.878150     8253181.798051
+186639.453120     8253202.165723
+186667.304711     8253221.377355
+186686.427366     8253238.576028
+186695.045410     8253247.474199
+186695.035331     8253248.099989
+186695.600339     8253251.865117
+186696.841614     8253252.510933
+186709.637638     8253273.994599
+186722.453425     8253294.227444
+186736.651639     8253306.341996
+186754.018406     8253316.000778
+186783.777486     8253333.363173
+186802.335134     8253346.796718
+186809.822399     8253348.164620
+186817.269731     8253352.035685
+186842.083830     8253365.565533
+186873.739925     8253381.705239
+186892.993630     8253390.767121
+186911.652090     8253397.941243
+186927.081513     8253411.326635
+186941.895522     8253424.076611
+186953.611161     8253434.901060
+186957.879862     8253441.853686
+186967.617842     8253458.907904
+186979.212893     8253477.243361
+186999.031987     8253490.070378
+187011.978834     8253502.165668
+187022.463658     8253511.718518
+187027.943398     8253521.194328
+187033.382429     8253533.174053
+187034.573311     8253536.948816
+187038.791606     8253547.031152
+187047.368940     8253558.433240
+187062.051902     8253579.320006
+187078.601631     8253600.862216
+187100.812184     8253620.612962
+187121.882644     8253633.459241
+187141.681568     8253647.538600
+187159.623421     8253660.336721
+187160.249295     8253660.346355
+187160.239216     8253660.972145
+187160.854630     8253661.607562
+187160.834472     8253662.859141
+187161.459964     8253662.868769
+187167.605512     8253669.851048
+187167.555106     8253672.980760
+187173.125579     8253676.822936
+187174.356788     8253678.093776
+187182.348958     8253686.982314
+187194.690483     8253697.815633
+187203.389169     8253701.706725
+187209.585135     8253705.558529
+187218.343936     8253705.693350
+187230.856837     8253705.885956
+187244.005690     8253705.462407
+187254.086434     8253701.234435
+187269.122225     8253700.213986
+187281.695611     8253696.651091
+187297.346827     8253696.265296
+187313.532791     8253701.523525
+187327.841896     8253706.752865
+187337.226572     8253706.897320
+187352.857619     8253707.763867
+187372.676712     8253720.590884
+187387.581455     8253727.707226
+187411.144187     8253741.217811
+187419.206920     8253745.725058
+187419.751770     8253750.741766
+187428.349657     8253760.891516
+187435.130787     8253767.256870
+187446.130582     8253783.705331
+187460.359045     8253793.941750
+187471.459283     8253804.130018
+187474.567350     8253805.429749
+187474.557259     8253806.056302
+187475.182751     8253806.065930
+187475.172673     8253806.691720
+187475.162594     8253807.317509
+187475.152515     8253807.943299
+187480.067248     8253813.653979
+187483.185394     8253814.327920
+187502.348365     8253829.023435
+187514.770532     8253834.849675
+187522.742545     8253844.989791
+187539.372928     8253861.524157
+187553.692124     8253866.126944
+187562.431138     8253867.514113
+187573.632187     8253871.442959
+187603.532012     8253880.042768
+187627.932321     8253880.418352
+187641.706679     8253880.003667
+187648.608779     8253878.858019
+187662.383125     8253878.444098
+187675.592094     8253874.264277
+187688.740948     8253873.840728
+187705.703622     8253869.719452
+187719.488059     8253868.678977
+187733.322889     8253864.509554
+187749.730647     8253855.996596
+187770.518378     8253847.551056
+187788.167411     8253839.683913
+187800.791202     8253832.991307
+187802.042569     8253833.010568
+187805.180885     8253832.432166
+187811.517977     8253827.521390
+187815.897187     8253827.588797
+187816.523061     8253827.598431
+187817.148554     8253827.608059
+187825.352439     8253823.351198
+187829.187180     8253818.401903
+187839.893798     8253814.183566
+187846.866462     8253808.656627
+187856.311634     8253805.044817
+187867.714295     8253796.455581
+187875.232203     8253795.944593
+187885.323013     8253791.091596
+187895.343642     8253790.619895
+187904.619647     8253779.684910
+END
+LINE3D
+HEIGHT 1160.000000
+187436.064830     8253476.135935
+187436.639916     8253479.275274
+187437.245621     8253480.537251
+187440.858199     8253489.358375
+187449.435928     8253500.759704
+187455.470584     8253514.627196
+187465.309376     8253525.421991
+187477.065724     8253533.742525
+187481.435237     8253534.435727
+187500.759517     8253539.115555
+187528.288051     8253539.539291
+187543.303303     8253539.770415
+187556.442078     8253539.972655
+187567.713691     8253539.520210
+187580.428216     8253527.193971
+187597.542490     8253513.683566
+187609.621062     8253501.973483
+187620.509134     8253486.488643
+187634.676649     8253461.662820
+187645.776424     8253433.033345
+187654.323072     8253407.494293
+187658.379226     8253388.773805
+187658.530444     8253379.384671
+187658.732068     8253366.865825
+187658.308200     8253354.337352
+187649.841362     8253336.050810
+187636.429937     8253313.930963
+187632.151539     8253307.604133
+187621.616309     8253301.180993
+187602.947770     8253294.632661
+187588.628586     8253290.029111
+187582.442699     8253285.551518
+187573.068103     8253284.781273
+187561.261349     8253279.590451
+187547.597894     8253273.119160
+187543.319114     8253266.792324
+187538.465248     8253257.326149
+187534.327608     8253242.235968
+187534.549390     8253228.465544
+187538.404301     8253222.263907
+187547.879710     8253216.774728
+187552.904951     8253215.600191
+187561.654056     8253216.360807
+187574.631152     8253226.577964
+187587.588078     8253238.047465
+187611.827091     8253248.437973
+187633.099175     8253248.765406
+187658.669826     8253254.167327
+187670.446331     8253261.236281
+187684.644558     8253273.350069
+187695.583486     8253293.554025
+187698.419354     8253311.754655
+187701.245143     8253330.581075
+187710.226570     8253355.763220
+187715.080436     8253365.229396
+187715.464371     8253380.261033
+187728.320486     8253397.989956
+187743.719660     8253413.253481
+187762.327714     8253423.557314
+187787.979008     8253423.952155
+187818.635768     8253424.424042
+187851.169386     8253424.924820
+187885.125364     8253414.804140
+187925.933431     8253406.666766
+187953.593026     8253398.952947
+187978.749876     8253391.201368
+188009.598180     8253379.780200
+188034.835685     8253367.020778
+188044.371578     8253357.776098
+188048.296684     8253347.192401
+188049.548050     8253347.211663
+188053.937720     8253346.653287
+188059.043616     8253340.470905
+188059.063774     8253339.219326
+188062.302902     8253332.381502
+188071.959765     8253315.625821
+188081.546065     8253303.251430
+188089.215178     8253293.352071
+188098.185683     8253280.342257
+188106.036263     8253259.175632
+188112.786695     8253228.600611
+188117.074721     8253195.483145
+188113.946033     8253156.617250
+188114.601311     8253115.931002
+188110.937483     8253071.421841
+188110.180098     8253040.731255
+188109.473501     8253006.910963
+188109.422250     8252971.222926
+188113.074706     8252938.721621
+188113.498111     8252912.432351
+188113.669487     8252901.791638
+188113.961844     8252883.639159
+188106.503983     8252841.575376
+188097.048282     8252806.994468
+188087.551871     8252774.917476
+188079.035021     8252759.759888
+188068.600603     8252747.077326
+188049.043618     8252717.975964
+188014.037053     8252676.740787
+187981.573548     8252633.040212
+187934.457330     8252566.574738
+187865.322555     8252507.283969
+187826.017434     8252460.973541
+187801.455366     8252431.795137
+187765.480545     8252411.832522
+187736.407837     8252390.723496
+187706.649139     8252373.361106
+187674.982964     8252357.847189
+187627.726452     8252338.962809
+187579.158076     8252323.815432
+187526.179872     8252310.478010
+187482.616592     8252295.406910
+187459.083726     8252280.018186
+187423.623889     8252266.950418
+187365.670455     8252251.658580
+187310.986780     8252227.650791
+187251.418991     8252196.054960
+187201.700061     8252174.628898
+187143.736943     8252159.962092
+187090.173179     8252144.111878
+187039.172646     8252124.543923
+186988.192665     8252103.723631
+186946.021496     8252079.909206
+186896.363063     8252054.726880
+186857.229781     8252036.593482
+186827.945357     8252028.629855
+186807.914943     8252028.947479
+186767.732368     8252037.094481
+186730.708268     8252043.411502
+186697.397939     8252052.290231
+186657.780754     8252064.202368
+186631.281793     8252077.569082
+186618.607595     8252087.391399
+186606.559272     8252097.223350
+186605.862834     8252101.595007
+186598.809503     8252112.130553
+186589.889023     8252122.010649
+186579.687310     8252133.749623
+186566.225942     8252153.577230
+186554.540990     8252179.693919
+186549.233469     8252198.395146
+186545.056346     8252224.626636
+186544.763989     8252242.779115
+186544.481723     8252260.305040
+186544.169195     8252279.709862
+186547.963703     8252316.081462
+186553.130928     8252344.961329
+186562.192997     8252365.136395
+186569.953307     8252388.421146
+186581.457625     8252412.390237
+186593.042215     8252431.351477
+186601.054937     8252438.987678
+186613.315807     8252454.828841
+186641.187555     8252472.788894
+186678.292773     8252500.281772
+186702.733860     8252536.971942
+186722.644137     8252582.983832
+186748.962094     8252619.702128
+186781.001731     8252650.874230
+186811.184297     8252680.765093
+186828.914817     8252706.708618
+186838.572142     8252728.770681
+186851.358075     8252750.880900
+186867.160960     8252779.924478
+186882.217384     8252816.469429
+186896.072834     8252849.866171
+186910.665062     8252876.386570
+186921.573754     8252898.467894
+186925.055654     8252915.426580
+186929.919598     8252924.266965
+186930.444279     8252930.536016
+186935.217502     8252945.009271
+186941.131189     8252966.387764
+186954.552693     8252987.881823
+186966.692594     8253011.233987
+186979.438200     8253035.848129
+186993.485196     8253057.351815
+187006.250589     8253080.713607
+187029.097096     8253099.848198
+187052.559016     8253119.618207
+187072.257127     8253139.956989
+187093.902673     8253155.942607
+187111.158549     8253172.486601
+187135.155610     8253197.899876
+187168.476480     8253227.213101
+187190.556355     8253255.101409
+187216.470602     8253278.039652
+187240.467281     8253303.452921
+187268.288623     8253324.542686
+187279.974407     8253337.244510
+187281.225774     8253337.263772
+187281.851266     8253337.273400
+187282.476758     8253337.283028
+187282.466680     8253337.908817
+187282.456601     8253338.534606
+187283.697889     8253339.179658
+187287.996826     8253344.254915
+187294.808205     8253348.742136
+187300.287945     8253358.217945
+187311.428497     8253365.903056
+187325.606554     8253379.269187
+187338.008564     8253386.347005
+187341.116619     8253387.647500
+187351.611534     8253396.573797
+187360.219499     8253406.097757
+187360.794586     8253409.237097
+187371.894811     8253419.426129
+187384.185930     8253433.389159
+187396.608097     8253439.215399
+187401.593406     8253440.544025
+187405.286638     8253444.357305
+187418.950093     8253450.828596
+187420.201460     8253450.847858
+187430.416348     8253466.975569
+187435.905179     8253476.055810
+END
+LINE3D
+HEIGHT 1170.000000
+187480.683822     8253143.025094
+187485.848670     8253143.818702
+187492.730995     8253143.924639
+187501.489796     8253144.059460
+187515.254064     8253144.271328
+187530.895189     8253144.512085
+187540.895660     8253145.291963
+187550.189603     8253151.070051
+187559.554121     8253152.466085
+187567.061556     8253152.581644
+187572.067021     8253152.658691
+187576.456310     8253152.100309
+187581.744042     8253134.651431
+187581.834775     8253129.017798
+187572.692051     8253113.850576
+187563.569484     8253097.431775
+187558.089744     8253087.955966
+187545.052163     8253081.494309
+187528.865818     8253076.236074
+187515.808067     8253071.026760
+187505.999142     8253058.353826
+187496.150283     8253048.184055
+187491.326653     8253036.840512
+187487.017637     8253032.391044
+187487.088201     8253028.009754
+187485.836835     8253027.990492
+187489.156605     8253016.145587
+187496.109493     8253011.870234
+187500.569357     8253006.929798
+187506.825808     8253007.026101
+187515.595070     8253006.535138
+187532.416999     8253011.176448
+187541.085067     8253016.944902
+187558.411888     8253029.107612
+187571.933822     8253044.342241
+187578.755661     8253048.203679
+187585.567041     8253052.690900
+187599.169999     8253062.918456
+187608.332893     8253076.833335
+187612.651999     8253080.656249
+187623.167060     8253088.331731
+187636.204641     8253094.793388
+187640.533826     8253097.990513
+187645.639722     8253091.808132
+187657.849737     8253071.960499
+187663.802906     8253052.017321
+187671.643408     8253031.476485
+187678.726975     8253019.063571
+187690.886571     8253002.346414
+187701.390720     8252971.829172
+187711.259298     8252941.928092
+187717.222929     8252921.359131
+187718.120621     8252904.467859
+187721.531112     8252886.990086
+187721.863797     8252866.333685
+187722.135984     8252849.433549
+187723.003810     8252834.420416
+187723.528028     8252801.871723
+187710.842907     8252773.502081
+187698.924800     8252736.378728
+187681.386195     8252698.542916
+187668.590184     8252677.058486
+187646.359473     8252658.559318
+187631.565620     8252644.557764
+187616.822569     8252627.425740
+187598.466544     8252601.473351
+187586.881572     8252582.512104
+187569.555133     8252570.349401
+187554.731032     8252558.225979
+187538.655959     8252546.082537
+187522.500232     8252538.946939
+187508.826698     8252533.101438
+187495.768578     8252527.891354
+187474.002050     8252519.417502
+187454.687861     8252514.111121
+187441.549468     8252513.908887
+187415.887714     8252514.139830
+187397.057878     8252517.606421
+187378.147388     8252526.080856
+187361.669067     8252538.975105
+187335.735112     8252556.106948
+187317.309357     8252573.354362
+187303.172090     8252596.302052
+187283.505059     8252612.903651
+187265.714493     8252629.534897
+187251.577608     8252652.482593
+187246.744362     8252680.582582
+187246.260459     8252710.628117
+187246.432297     8252738.805147
+187247.391306     8252756.976887
+187252.154451     8252772.075932
+187259.379989     8252789.718186
+187263.608363     8252799.174733
+187277.080273     8252817.539080
+187287.473981     8252832.725558
+187301.026546     8252846.082061
+187312.116704     8252856.896119
+187322.006272     8252864.561973
+187332.551593     8252870.358558
+187343.732473     8252875.539747
+187355.478360     8252884.486064
+187366.043839     8252889.031070
+187377.123906     8252900.471681
+187386.357364     8252910.005270
+187398.154039     8252915.821882
+187403.098638     8252919.654424
+187403.714434     8252920.289847
+187419.143857     8252933.675240
+187424.653451     8252941.273675
+187425.279325     8252941.283309
+187425.904817     8252941.292937
+187429.567814     8252946.983585
+187430.728447     8252952.636481
+187431.959644     8252953.908085
+187431.949565     8252954.533875
+187436.793352     8252964.625840
+187436.783273     8252965.251629
+187439.730032     8252976.567047
+187440.870508     8252983.471521
+187441.425436     8252987.862439
+187441.980735     8252992.254128
+187441.890001     8252997.887761
+187441.869844     8252999.139340
+187441.748874     8253006.650341
+187441.658141     8253012.283975
+187441.476674     8253023.551241
+187441.254893     8253037.321665
+187440.861723     8253061.733567
+187443.818573     8253072.422431
+187447.986450     8253085.635244
+187448.531300     8253090.651951
+187452.204363     8253095.717575
+187452.679019     8253105.116343
+187456.190785     8253120.196889
+187456.736017     8253125.213603
+187459.803757     8253129.017255
+187462.881576     8253132.195118
+187465.999710     8253132.869823
+187470.944310     8253136.702366
+187476.504322     8253141.170325
+187477.130196     8253141.179959
+187480.683822     8253143.025094
+END
+LINE3D
+HEIGHT 1130.000000
+183557.000000     8254093.718503
+183563.352666     8254075.179740
+183570.758839     8254042.736214
+183580.798792     8254002.194421
+183589.012293     8253958.494027
+183590.999580     8253912.819962
+183595.055284     8253855.280966
+183602.037576     8253810.309731
+183609.433657     8253778.492759
+183613.671469     8253748.505007
+183614.104953     8253721.589948
+183613.701064     8253707.809129
+183613.711142     8253707.183339
+183613.993421     8253689.656650
+183608.735654     8253666.410419
+183603.548462     8253638.782134
+183603.770243     8253625.011710
+183583.849888     8253579.625609
+183564.897775     8253512.967710
+183557.000000     8253483.900430
+END
+LINE3D
+HEIGHT 1090.000000
+183557.000000     8256156.845503
+183566.775917     8256155.128611
+183601.882665     8256151.285091
+183628.966767     8256140.433455
+183659.098465     8256134.636286
+183692.328354     8256130.763876
+183735.638951     8256122.665787
+183769.433835     8256122.559269
+183812.764589     8256113.209601
+183869.869701     8256103.445247
+183911.313530     8256094.691714
+183968.438824     8256083.674253
+184016.815001     8256071.896940
+184071.427662     8256061.467512
+184130.601166     8256039.839756
+184163.447312     8256020.935712
+184195.637525     8256003.900169
+184227.101219     8255993.115947
+184256.577009     8255989.185751
+184279.261553     8255979.518284
+184297.546373     8255971.033453
+184324.035231     8255958.294057
+184352.966159     8255949.347918
+184384.419786     8255939.188720
+184414.026613     8255927.122498
+184451.060626     8255920.178156
+184486.217755     8255913.206453
+184513.211327     8255907.987689
+184539.599207     8255901.506184
+184574.100405     8255896.402982
+184613.596812     8255892.001850
+184651.831570     8255888.208006
+184683.184385     8255884.308231
+184730.168260     8255881.274240
+184768.332645     8255881.861690
+184807.122714     8255882.458770
+184835.892333     8255883.528319
+184861.523469     8255885.174738
+184885.287837     8255886.165714
+184911.565005     8255886.570189
+184949.053301     8255890.277719
+184984.705054     8255891.453201
+185009.650201     8255896.846258
+185038.328907     8255903.548673
+185068.249296     8255910.895380
+185099.430736     8255917.636319
+185125.636934     8255922.423606
+185144.971687     8255926.476886
+185166.092171     8255936.193447
+185202.097610     8255954.278699
+185231.290906     8255967.876718
+185254.218067     8255982.003465
+185277.145228     8255996.130212
+185302.544491     8256012.173609
+185335.482202     8256026.454445
+185363.434605     8256039.406654
+185380.720717     8256054.073280
+185394.858446     8256069.943333
+185411.498908     8256085.851909
+185438.230193     8256096.906724
+185471.843802     8256108.067477
+185503.580146     8256119.200861
+185532.178223     8256130.909592
+185562.693831     8256140.145588
+185593.804707     8256151.267817
+185626.842848     8256159.289224
+185651.717432     8256169.063571
+185679.770646     8256175.756357
+185719.751584     8256180.128965
+185760.953283     8256186.397432
+185794.677770     8256190.673736
+185822.741076     8256196.739970
+185860.138626     8256206.081897
+185891.905243     8256215.335621
+185924.247329     8256227.728691
+185962.280463     8256236.453693
+185997.881809     8256240.758886
+186022.272052     8256241.759496
+186052.857841     8256246.614197
+186112.142901     8256256.918210
+186147.804745     8256257.467140
+186179.712871     8256257.958289
+186224.133516     8256258.642039
+186268.463439     8256264.958658
+186312.198095     8256269.389045
+186355.922684     8256274.444457
+186377.820260     8256274.781518
+186399.102435     8256274.482397
+186416.630486     8256274.127020
+186438.023564     8256266.941923
+186467.509587     8256262.388233
+186497.550564     8256262.223933
+186526.976114     8256261.424980
+186558.278524     8256260.654917
+186595.191352     8256261.223102
+186629.601829     8256261.752769
+186659.007222     8256262.205395
+186700.229078     8256267.222284
+186746.516897     8256268.559955
+186784.035417     8256270.390881
+186832.099282     8256278.016864
+186878.931914     8256284.373535
+186917.651420     8256289.351906
+186956.370543     8256294.330271
+186998.288837     8256294.975503
+187042.699772     8256296.285812
+187091.479851     8256298.288554
+187137.777355     8256299.001194
+187171.501867     8256303.275970
+187216.487889     8256307.725619
+187260.192320     8256314.032610
+187289.506968     8256320.119633
+187325.713649     8256325.686034
+187366.915347     8256331.954501
+187394.423724     8256333.629816
+187426.896845     8256337.886859
+187448.784355     8256338.848945
+187480.066607     8256339.330461
+187508.846126     8256339.773453
+187545.759336     8256340.341644
+187583.863033     8256344.685355
+187616.951580     8256349.577051
+187647.487370     8256357.559940
+187673.633477     8256366.101970
+187703.593799     8256370.945514
+187731.737735     8256372.005431
+187762.999829     8256373.738526
+187790.467485     8256377.918521
+187827.320222     8256382.241449
+187853.577208     8256383.899030
+187874.798504     8256387.356169
+187896.686014     8256388.318255
+187926.041001     8256391.900592
+187949.795278     8256393.518122
+187983.570172     8256394.664715
+188003.570732     8256396.224465
+188025.448151     8256397.813105
+188041.028779     8256401.810127
+188057.820460     8256408.329570
+188074.652073     8256412.345848
+188090.858219     8256416.350971
+188110.183262     8256421.030810
+188131.313431     8256430.122340
+188152.525043     8256434.204510
+188156.228354     8256437.392001
+188164.987537     8256437.526828
+188187.510606     8256437.873516
+188226.361529     8256434.715866
+188263.294896     8256434.032478
+188284.011312     8256429.967453
+188304.667970     8256429.660233
+188333.437423     8256430.728250
+188365.769035     8256443.747867
+188386.889901     8256453.464434
+188409.807353     8256468.217741
+188452.128975     8256482.643019
+188494.400931     8256500.199549
+188517.378117     8256511.196579
+188518.629865     8256511.215847
+188529.880951     8256512.014211
+188555.360844     8256523.051292
+188599.651217     8256531.871081
+188619.611055     8256535.935511
+188633.233814     8256544.909954
+188654.334498     8256555.879628
+188669.289659     8256559.865495
+188677.372944     8256563.120405
+188693.518592     8256570.881792
+188709.775119     8256571.758732
+188715.385920     8256573.096986
+188735.971251     8256577.171044
+188759.271794     8256568.138238
+188775.679563     8256559.624515
+188787.082607     8256551.035285
+188803.722224     8256528.126113
+188812.582220     8256522.001517
+188822.057641     8256516.511574
+188828.394721     8256511.601562
+188838.465386     8256507.999379
+188852.239362     8256507.584688
+188863.571842     8256503.376748
+188879.919115     8256498.619290
+188888.688364     8256498.129091
+188897.336669     8256505.148366
+188907.800929     8256515.954318
+188920.727632     8256529.300423
+188936.086479     8256547.067870
+188949.679752     8256557.920457
+188957.701776     8256564.931620
+188970.709109     8256573.271410
+188978.156835     8256577.141717
+188990.538675     8256585.471879
+189006.078989     8256591.972059
+189015.453574     8256592.743067
+189019.832783     8256592.810475
+189028.117692     8256583.546540
+189039.560311     8256572.452612
+189044.010848     8256568.138741
+189044.636341     8256568.148369
+189045.513863     8256552.509440
+189046.502289     8256529.984535
+189046.754319     8256514.335978
+189030.265456     8256489.038273
+189014.906609     8256471.270826
+188983.432362     8256443.863859
+188950.090940     8256415.802971
+188924.782398     8256394.126705
+188905.285540     8256361.268307
+188890.694076     8256334.747919
+188884.123872     8256315.238683
+188868.149624     8256296.835054
+188850.944524     8256277.162119
+188832.517948     8256255.590256
+188818.450401     8256235.338907
+188818.460492     8256234.712353
+188818.470558     8256234.087328
+188818.480649     8256233.460774
+188818.490716     8256232.835749
+188813.575995     8256227.124304
+188805.029266     8256213.845619
+188792.101825     8256200.497974
+188781.647631     8256189.066996
+188761.990204     8256166.225826
+188748.366707     8256157.249844
+188748.386864     8256155.998265
+188725.510491     8256138.741812
+188703.945600     8256117.748351
+188682.511769     8256088.617334
+188668.393815     8256071.495696
+188654.458091     8256043.106804
+188636.051649     8256020.284890
+188627.544496     8256004.501506
+188617.917419     8255980.561312
+188593.355362     8255951.382143
+188574.514222     8255916.656769
+188555.512535     8255891.947095
+188542.757233     8255867.958748
+188531.162170     8255849.624055
+188521.424214     8255832.568309
+188506.751332     8255811.055753
+188492.684548     8255790.804416
+188471.795554     8255766.690871
+188459.595181     8255747.093443
+188450.169703     8255710.635931
+188445.062987     8255677.999035
+188437.978194     8255651.594195
+188437.705544     8255629.676587
+188433.174654     8255600.180571
+188429.399553     8255562.556615
+188426.049083     8255537.461145
+188426.422083     8255514.301586
+188426.744676     8255494.271739
+188436.613255     8255464.370659
+188445.230848     8255434.450324
+188459.337485     8255413.380760
+188478.530266     8255387.378871
+188494.060026     8255355.687862
+188505.643772     8255335.831354
+188508.973622     8255323.360660
+188512.788600     8255319.662186
+188517.884023     8255314.106353
+188528.691847     8255303.627834
+188540.063878     8255296.916724
+188550.154700     8255292.062963
+188565.230831     8255288.537828
+188595.262098     8255289.000088
+188622.164376     8255289.414184
+188642.800877     8255290.358543
+188654.042636     8255291.783472
+188668.381607     8255295.134674
+188680.894508     8255295.327280
+188696.535634     8255295.568038
+188710.996339     8255291.408249
+188726.102693     8255286.006510
+188752.540788     8255276.395291
+188773.318441     8255268.575541
+188792.208761     8255261.353449
+188804.741820     8255260.294476
+188822.340077     8255255.556274
+188853.612238     8255256.664343
+188882.967606     8255260.246686
+188906.126258     8255259.976450
+188926.772850     8255260.294255
+188959.840858     8255266.437523
+188981.728343     8255267.401138
+189001.749442     8255267.709315
+189013.010595     8255267.882653
+189032.425596     8255266.929612
+189052.537441     8255261.603392
+189080.156696     8255256.394259
+189114.667985     8255250.664503
+189154.849783     8255242.518253
+189182.448906     8255238.559171
+189216.849292     8255239.715392
+189251.259769     8255240.245059
+189273.934055     8255231.202614
+189300.948000     8255224.730746
+189326.145177     8255214.475245
+189360.111629     8255203.728018
+189383.461813     8255191.565489
+189401.080992     8255185.575720
+189419.305481     8255180.848686
+189435.854378     8255163.572383
+189462.958280     8255151.467634
+189493.897318     8255134.412832
+189525.552570     8255111.734789
+189545.926511     8255090.134987
+189567.470019     8255073.562272
+189589.014315     8255056.988042
+189610.659399     8255034.155916
+189634.655997     8255020.751448
+189642.344899     8255009.599741
+189646.885393     8254999.652989
+189651.366178     8254993.460986
+189651.991671     8254993.470614
+189652.617163     8254993.480242
+189653.252746     8254992.863316
+189653.899160     8254991.621377
+189654.524652     8254991.631005
+189654.534743     8254991.004451
+189655.160235     8254991.014079
+189655.220708     8254987.259342
+189661.608219     8254979.218090
+189667.380329     8254970.540657
+189671.940980     8254959.342326
+189677.642526     8254955.046183
+189680.851382     8254950.088019
+189684.675687     8254945.762980
+189688.560441     8254937.684732
+189694.927794     8254930.895059
+189700.730128     8254920.341021
+189708.450041     8254907.311193
+189716.764435     8254896.169114
+189725.785715     8254880.030358
+189741.013064     8254867.116089
+189758.036235     8254859.238548
+189761.184618     8254858.035120
+189773.172838     8254851.958676
+189797.673959     8254846.074838
+189832.790583     8254841.606289
+189850.994914     8254838.130834
+189851.005005     8254837.504280
+189856.009707     8254837.581316
+189864.789048     8254836.464564
+189887.443177     8254828.673698
+189901.288481     8254823.877728
+189925.769420     8254819.246997
+189967.778077     8254814.257826
+189999.140984     8254809.731497
+190021.129281     8254804.435689
+190049.384120     8254798.609631
+190074.086865     8254780.206947
+190098.163354     8254761.794624
+190131.050196     8254740.387428
+190158.891246     8254721.407106
+190184.713927     8254711.160470
+190201.071266     8254705.777986
+190218.033953     8254701.655946
+190246.258543     8254697.708019
+190268.852951     8254693.672666
+190283.938384     8254689.522494
+190299.670243     8254684.129618
+190318.066132     8254668.760343
+190338.894178     8254657.811645
+190355.312015     8254648.672897
+190369.307772     8254634.487781
+190388.298905     8254621.006267
+190399.752367     8254609.286561
+190404.242467     8254602.468756
+190409.994407     8254595.043666
+190413.899343     8254585.712311
+190418.995542     8254580.155725
+190427.916022     8254570.275628
+190441.114899     8254566.722362
+190458.633266     8254566.992015
+190482.982405     8254570.497299
+190504.234332     8254572.076311
+190526.696903     8254576.179265
+190539.836060     8254576.381511
+190551.097212     8254576.554850
+190569.311647     8254572.452077
+190591.965764     8254564.661975
+190604.629883     8254555.465447
+190614.196025     8254544.342635
+190627.515884     8254533.277603
+190650.967645     8254514.855663
+190670.715331     8254493.246221
+190689.020486     8254483.510579
+190710.373212     8254478.830932
+190736.861714     8254466.090002
+190775.802618     8254457.297942
+190807.791768     8254452.782018
+190826.045754     8254446.176076
+190842.333306     8254445.174130
+190868.045084     8254441.813470
+190886.209101     8254440.841172
+190899.993156     8254439.800692
+190919.408157     8254438.847650
+190941.406545     8254432.925288
+190957.148483     8254426.906623
+190992.456652     8254410.545019
+191024.768408     8254385.998483
+191052.063843     8254362.001442
+191076.131018     8254344.214920
+191097.645053     8254329.519586
+191117.362490     8254309.788276
+191138.341003     8254289.449669
+191162.559395     8254262.274013
+191177.978277     8254237.467452
+191183.891501     8254220.028202
+191193.518128     8254205.149889
+191200.016530     8254190.223425
+191200.894052     8254174.584496
+191201.196488     8254155.806228
+191195.383613     8254128.168312
+191184.535024     8254102.331482
+191170.013372     8254071.429028
+191144.906466     8254037.233152
+191118.578811     8254001.140651
+191109.041691     8253971.567576
+191104.924603     8253955.225058
+191093.955032     8253936.899993
+191086.830687     8253912.998322
+191081.683632     8253882.866112
+191076.476080     8253856.490167
+191068.806885     8253827.571789
+191057.958296     8253801.734958
+191050.218538     8253777.197870
+191042.588908     8253745.775557
+191029.823526     8253722.413001
+191013.354058     8253695.863705
+190992.445659     8253673.002515
+190977.308593     8253641.464644
+190960.203553     8253615.531510
+190948.033416     8253594.056714
+190936.549256     8253568.836044
+190920.080563     8253542.285997
+190905.165279     8253496.977701
+190883.771763     8253465.343527
+190872.973580     8253436.376985
+190863.951825     8253413.698761
+190857.634440     8253378.539451
+190853.829854     8253342.793640
+190854.475053     8253302.733182
+190853.989474     8253255.142454
+190853.868042     8253223.835713
+190854.190636     8253203.805866
+190854.412429     8253190.034677
+190854.644290     8253175.638464
+190854.856005     8253162.493065
+190856.520316     8253136.848840
+190857.044534     8253104.300148
+190857.457861     8253078.636668
+190854.268701     8253043.525510
+190849.909186     8253003.388780
+190849.373213     8252958.927000
+190844.377363     8252919.406420
+190840.592947     8252882.408266
+190840.521921     8252847.971813
+190837.171452     8252822.876342
+190836.887959     8252801.584513
+190837.442425     8252767.157688
+190849.349541     8252727.270580
+190857.290460     8252700.471080
+190861.993040     8252680.507888
+190862.850392     8252666.121302
+190864.363486     8252649.866212
+190864.917952     8252615.439387
+190864.816690     8252582.880302
+190863.837893     8252565.960911
+190863.373697     8252555.936359
+190863.666055     8252537.783880
+190868.579573     8252504.676042
+190880.254816     8252479.185912
+190889.325751     8252459.916669
+190895.723340     8252451.249628
+190910.335263     8252437.700705
+190928.680746     8252425.461141
+190939.598685     8252408.098163
+190943.019267     8252389.993836
+190946.147493     8252390.041987
+190945.723624     8252377.513514
+190944.563373     8252371.860625
+190944.644015     8252366.853545
+190944.744827     8252360.594122
+190943.644297     8252351.185721
+190943.180102     8252341.161169
+190943.391817     8252328.015770
+190947.347158     8252315.554704
+190953.149492     8252305.000666
+190957.064506     8252295.043522
+190962.160705     8252289.486936
+190972.251528     8252284.633175
+190981.010711     8252284.768002
+190992.888028     8252285.577534
+191008.448512     8252290.825371
+191014.058537     8252292.164378
+191018.428431     8252292.857586
+191022.787484     8252294.176573
+191038.983526     8252298.809013
+191042.061345     8252301.986876
+191043.313093     8252302.006144
+191048.297638     8252303.334758
+191051.425863     8252303.382910
+191051.415784     8252304.008699
+191051.405706     8252304.634488
+191052.031962     8252304.644128
+191057.036664     8252304.721164
+191063.908515     8252305.453648
+191067.026662     8252306.127589
+191070.781143     8252306.185381
+191072.032128     8252306.204636
+191072.647541     8252306.840054
+191080.155740     8252306.955625
+191085.160442     8252307.032660
+191089.631149     8252301.466446
+191094.020437     8252300.908064
+191097.794312     8252299.714265
+191102.295267     8252292.269918
+191107.471345     8252281.706241
+191120.185870     8252269.380002
+191121.518273     8252264.391426
+191122.769257     8252264.410681
+191124.090805     8252260.048647
+191128.571591     8252253.856644
+191133.081861     8252245.786496
+191140.225913     8252229.618081
+191143.515435     8252219.651309
+191143.575919     8252215.895808
+191143.586011     8252215.269255
+191143.696901     8252208.384042
+191142.526559     8252203.357707
+191138.157440     8252202.663746
+191137.611826     8252197.647026
+191136.360842     8252197.627770
+191129.539384     8252193.766338
+191128.913892     8252193.756710
+191127.662143     8252193.737443
+191123.272855     8252194.295825
+191119.498980     8252195.489624
+191114.433029     8252199.168078
+191109.993323     8252202.856935
+191104.251474     8252209.655472
+191099.760609     8252216.473265
+191095.926237     8252221.423329
+191095.805268     8252228.934331
+191094.403065     8252238.304209
+191090.538457     8252245.131642
+191089.861795     8252248.251713
+191084.161025     8252252.547104
+191080.315823     8252258.122182
+191075.855958     8252263.062619
+191071.426343     8252266.124922
+191065.119486     8252269.158331
+191061.365005     8252269.100539
+191055.815465     8252264.006032
+191047.792665     8252256.995621
+191032.282587     8252248.618072
+191022.908003     8252247.847064
+191017.287124     8252247.134599
+191004.148731     8252246.932365
+190999.769521     8252246.864958
+190994.743885     8252248.040253
+190984.723639     8252248.511960
+190979.032196     8252252.180786
+190970.252855     8252253.297538
+190968.941373     8252257.034547
+190963.885502     8252260.087211
+190962.634517     8252260.067955
+190953.189357     8252263.679001
+190945.620673     8252267.318931
+190939.919915     8252271.613558
+190934.904359     8252272.163065
+190926.700104     8252276.419156
+190916.639530     8252279.394785
+190900.937920     8252282.909528
+190896.498225     8252286.597621
+190889.555785     8252290.247955
+190884.499914     8252293.300619
+190879.494448     8252293.223572
+190875.095081     8252294.407743
+190862.562022     8252295.466716
+190858.788135     8252296.661279
+190853.772591     8252297.210022
+190846.890648     8252297.104090
+190842.511438     8252297.036683
+190838.202028     8252292.587973
+190838.212119     8252291.961420
+190838.403652     8252280.069128
+190838.575040     8252269.427651
+190841.814156     8252262.590590
+190846.325190     8252254.520454
+190856.405922     8252250.293247
+190868.394142     8252244.216802
+190885.467719     8252233.209550
+190906.205032     8252227.894486
+190920.675064     8252223.108132
+190934.449792     8252222.694216
+190942.643204     8252219.063903
+190952.048049     8252217.956014
+190957.114000     8252214.277561
+190960.928202     8252210.579839
+190961.553694     8252210.589467
+190964.681919     8252210.637619
+190965.307412     8252210.647247
+190965.317490     8252210.021457
+190965.327581     8252209.394904
+190965.337660     8252208.769114
+190965.357818     8252207.517536
+190966.629736     8252206.284460
+190970.403611     8252205.090661
+190974.217813     8252201.392940
+190979.868941     8252200.227272
+190979.879019     8252199.601482
+190981.140083     8252198.994949
+190981.150162     8252198.369159
+190981.160240     8252197.743370
+190981.230816     8252193.361316
+190981.240895     8252192.735526
+190981.937714     8252188.363876
+190981.957884     8252187.111533
+190982.018369     8252183.356032
+190982.078854     8252179.600531
+190982.088932     8252178.974741
+190982.159508     8252174.592687
+190982.240150     8252169.585607
+190982.310726     8252165.203553
+190982.401460     8252159.569920
+190982.411538     8252158.944130
+190981.230354     8252154.543572
+190980.049945     8252150.142262
+190979.525264     8252143.873211
+190975.871595     8252137.555997
+190972.299332     8252126.231715
+190972.379987     8252121.223872
+190968.131825     8252113.019673
+190963.933318     8252101.684987
+190959.624672     8252097.236290
+190953.519440     8252087.750852
+190949.241042     8252081.424022
+190944.316231     8252076.339131
+190936.192619     8252075.588143
+190928.140346     8252070.455112
+190924.396707     8252069.771543
+190920.702711     8252065.958251
+190915.082595     8252065.245798
+190906.393988     8252060.728917
+190900.228271     8252054.998981
+190896.585444     8252048.055989
+190892.336519     8252039.851779
+190892.356689     8252038.599436
+190895.565556     8252033.640508
+190900.036263     8252028.074293
+190905.807596     8252019.397612
+190909.662890     8252013.195981
+190918.958315     8252001.104338
+END
+LINE3D
+HEIGHT 1090.000000
+190918.958315     8252001.104338
+190941.449202     8251982.380383
+190942.135179     8251978.634510
+190943.406333     8251977.401423
+190944.031825     8251977.411051
+190945.283574     8251977.430319
+190945.303731     8251976.178740
+190944.738724     8251972.413611
+190944.112468     8251972.403971
+190942.871562     8251971.758926
+190934.798368     8251967.877462
+190924.223193     8251963.958251
+190918.662798     8251959.490285
+190914.293667     8251958.797088
+190913.748829     8251953.779617
+190908.188435     8251949.311651
+190903.434999     8251933.586047
+190899.257413     8251920.999794
+190899.327989     8251916.617740
+190895.644835     8251912.178670
+190891.557219     8251893.958772
+190881.950299     8251868.766999
+190877.802962     8251854.302613
+190873.029357     8251839.829352
+190868.215436     8251827.859249
+190867.095512     8251819.702438
+190862.261422     8251808.984678
+190858.023352     8251800.153926
+190858.093915     8251795.772636
+190853.926408     8251782.560593
+190854.087717     8251772.544906
+190853.047672     8251759.381003
+190851.978142     8251748.095245
+190850.817127     8251742.442344
+190849.717360     8251733.033954
+190845.479290     8251724.203202
+190844.873191     8251722.941983
+190844.267869     8251721.680012
+190839.908816     8251720.361026
+190839.918895     8251719.735236
+190839.939065     8251718.482893
+190838.697395     8251717.837836
+190834.963835     8251716.528478
+190830.645123     8251712.704805
+190826.901484     8251712.021236
+190826.275228     8251712.011597
+190825.659814     8251711.376179
+190825.034322     8251711.366551
+190824.408830     8251711.356923
+190824.418909     8251710.731134
+190824.439078     8251709.478791
+190823.823665     8251708.843373
+190822.571917     8251708.824106
+190821.320932     8251708.804850
+190815.689974     8251708.718175
+190810.684508     8251708.641127
+190802.551581     8251708.515940
+190796.920623     8251708.429265
+190792.541413     8251708.361858
+190786.910455     8251708.275182
+190780.714489     8251704.423379
+190779.533305     8251700.022821
+190775.870320     8251694.331408
+190771.561686     8251689.881946
+190771.642329     8251684.874866
+190771.087412     8251680.483184
+190770.461156     8251680.473544
+190770.592204     8251672.336753
+190770.652689     8251668.581252
+190770.047367     8251667.319281
+190770.138100     8251661.685648
+190770.248991     8251654.800436
+190770.400209     8251645.411302
+190775.556893     8251636.099215
+190780.622080     8251632.420750
+190786.384098     8251624.369870
+190790.147894     8251623.801860
+190796.565642     8251613.883239
+190801.006100     8251610.195158
+190801.016179     8251609.569368
+190801.207724     8251597.676312
+190801.399269     8251585.783256
+190801.469833     8251581.401966
+190801.479924     8251580.775413
+190801.500081     8251579.523834
+190801.590815     8251573.890200
+190801.671457     8251568.883121
+190801.883172     8251555.737722
+190796.423589     8251545.010334
+190795.273417     8251538.731655
+190794.647161     8251538.722015
+190793.406255     8251538.076970
+190792.175440     8251536.805371
+190791.569342     8251535.544152
+190791.660075     8251529.910519
+190790.580466     8251519.250550
+190790.721605     8251510.487206
+190790.822417     8251504.227783
+190795.262112     8251500.539690
+190799.016593     8251500.597481
+190808.401269     8251500.741936
+190824.496511     8251511.633034
+190833.820702     8251515.532990
+190837.554250     8251516.843112
+190842.559716     8251516.920160
+190853.205454     8251516.458081
+190860.733059     8251515.321297
+190871.379562     8251514.859230
+190882.539902     8251521.291991
+190887.363901     8251532.636305
+190887.011059     8251554.544284
+190886.264597     8251562.045658
+190876.083054     8251572.532288
+190871.592177     8251579.350845
+190871.360317     8251593.747059
+190870.957069     8251618.784750
+190871.471670     8251625.679590
+190874.933794     8251643.889860
+190879.746951     8251655.859951
+190890.776994     8251670.430280
+190898.143302     8251679.308419
+190903.723854     8251682.524806
+190911.867624     8251682.024215
+190925.066502     8251678.470948
+190938.154489     8251681.802894
+190949.870522     8251692.626585
+190951.121506     8251692.645841
+190954.875224     8251692.703621
+190959.265276     8251692.145251
+190959.325761     8251688.389750
+190959.951253     8251688.399378
+190963.079478     8251688.447529
+190966.338764     8251680.358126
+190970.808695     8251674.792664
+190970.818786     8251674.166110
+190970.838943     8251672.914531
+190971.485357     8251671.672592
+190972.857323     8251664.180083
+190973.573549     8251658.556077
+190974.209120     8251657.939916
+190974.219199     8251657.314126
+190974.229277     8251656.688337
+190974.299853     8251652.306282
+190975.006751     8251647.308842
+190975.319266     8251627.904785
+190975.379763     8251624.148520
+190975.389842     8251623.522731
+190975.480575     8251617.889097
+190975.581387     8251611.629675
+190975.692278     8251604.744462
+190975.833417     8251595.981118
+190975.964466     8251587.844327
+190975.408786     8251583.452633
+190974.803451     8251582.191426
+190974.248522     8251577.800508
+190969.404365     8251567.707773
+190968.950249     8251557.057432
+190964.581118     8251556.364235
+190964.651693     8251551.982180
+190960.998788     8251545.664978
+190960.453174     8251540.648259
+190956.770032     8251536.208425
+190956.225182     8251531.191717
+190956.235261     8251530.565928
+190955.085089     8251524.287249
+190954.529408     8251519.895555
+190952.188736     8251509.842120
+190952.198815     8251509.216330
+190951.683450     8251502.321478
+190949.897706     8251496.658961
+190945.648793     8251488.453987
+190941.481286     8251475.241944
+190940.946527     8251469.598683
+190936.657287     8251463.897631
+190935.486945     8251458.871295
+190934.861452     8251458.861667
+190934.235960     8251458.852039
+190928.070243     8251453.122103
+190927.443987     8251453.112463
+190926.818495     8251453.102835
+190922.439285     8251453.035428
+190914.931086     8251452.919857
+190903.044442     8251452.736890
+190899.279882     8251453.304888
+190898.018818     8251453.911422
+190893.629518     8251454.470568
+190887.352910     8251455.625844
+190881.651388     8251459.920459
+190876.645922     8251459.843412
+190875.394938     8251459.824156
+190874.143189     8251459.804888
+190869.743810     8251460.989824
+190864.718187     8251462.164355
+190864.082616     8251462.780517
+190863.436954     8251464.023232
+190862.811461     8251464.013604
+190862.185969     8251464.003976
+190860.308728     8251463.975080
+190859.057744     8251463.955824
+190857.805995     8251463.936557
+190857.180503     8251463.926929
+190855.929519     8251463.907673
+190855.303263     8251463.898033
+190854.677770     8251463.888405
+190853.426786     8251463.869149
+190852.175037     8251463.849881
+190848.441490     8251462.539759
+190844.142922     8251457.465272
+190839.228190     8251451.754591
+190838.784164     8251440.477697
+190838.854728     8251436.096406
+190839.490299     8251435.480245
+190840.125870     8251434.864084
+190840.762217     8251434.247170
+190841.397788     8251433.631008
+190842.658851     8251433.024475
+190843.920678     8251432.417953
+190847.058982     8251431.840315
+190849.591200     8251430.000694
+190852.779910     8251426.293345
+190853.406166     8251426.302985
+190858.410868     8251426.380020
+190863.416333     8251426.457068
+190864.667318     8251426.476323
+190867.795543     8251426.524475
+190871.549261     8251426.582255
+190875.303742     8251426.640046
+190875.929234     8251426.649674
+190879.057459     8251426.697825
+190882.801098     8251427.381394
+190883.426590     8251427.391022
+END
+LINE3D
+HEIGHT 1080.000000
+183557.000000     8256388.595916
+183588.122079     8256383.982753
+183622.037933     8256376.365234
+183646.518706     8256371.732972
+183679.213633     8256362.218062
+183719.436319     8256351.568663
+183749.033270     8256340.127469
+183777.994256     8256329.303194
+183813.877881     8256316.081699
+183863.364273     8256313.087756
+183890.902707     8256312.884936
+183912.790192     8256313.848551
+183947.816286     8256315.012874
+183980.955430     8256316.774861
+184009.664361     8256321.600672
+184030.300695     8256322.543499
+184057.829039     8256322.967232
+184086.608748     8256323.410227
+184119.838422     8256319.539343
+184149.304313     8256316.235704
+184180.586564     8256316.717219
+184214.441922     8256312.855965
+184248.852399     8256313.385633
+184280.760334     8256313.876779
+184322.113417     8256310.757644
+184364.041610     8256310.776319
+184401.105847     8256301.955373
+184434.335712     8256298.084491
+184452.560035     8256293.355926
+184485.295277     8256281.337858
+184514.226014     8256272.391716
+184543.106536     8256266.575288
+184571.896337     8256266.391730
+184603.269310     8256261.240376
+184635.873491     8256257.359863
+184664.733665     8256252.795012
+184697.993778     8256247.045997
+184743.171167     8256239.601823
+184772.041598     8256234.411949
+184794.655603     8256229.124243
+184814.767041     8256223.799545
+184843.627215     8256219.234694
+184866.856812     8256214.583173
+184885.696727     8256210.490792
+184900.086486     8256210.712288
+184917.604471     8256210.981935
+184938.876555     8256211.309368
+184967.030581     8256211.742732
+184988.242168     8256215.826430
+185005.699680     8256219.850815
+185026.245078     8256226.428037
+185053.672800     8256233.111195
+185081.110207     8256239.169323
+185108.537930     8256245.852482
+185132.161147     8256255.607567
+185155.148805     8256265.978049
+185176.269289     8256275.694610
+185193.666661     8256283.476793
+185219.812411     8256292.017289
+185245.928270     8256302.437451
+185272.720027     8256309.737529
+185304.567680     8256313.983415
+185345.174111     8256318.365651
+185390.150066     8256323.440325
+185415.750954     8256326.964877
+185431.331583     8256330.961899
+185452.543194     8256335.044069
+185484.995776     8256340.552684
+185509.275116     8256348.439271
+185526.732603     8256352.465183
+185538.549448     8256357.029452
+185562.212980     8256364.281379
+185585.251044     8256371.522149
+185617.057976     8256378.272716
+185638.219157     8256385.486125
+185658.784712     8256390.811768
+185688.038887     8256400.653528
+185729.886618     8256405.680050
+185761.784295     8256406.796219
+185785.538548     8256408.415277
+185813.622011     8256413.229932
+185853.542477     8256421.357276
+185885.329251     8256429.359421
+185910.960769     8256431.005846
+185935.300200     8256435.137690
+185964.624938     8256440.598159
+185997.723576     8256444.863302
+186020.872519     8256445.219624
+186035.262278     8256445.441120
+186052.215243     8256441.946403
+186078.421848     8256446.732168
+186112.681107     8256456.650969
+186136.253917     8256469.535765
+186154.872050     8256479.213809
+186167.324454     8256483.162680
+186180.392284     8256487.746204
+186205.963305     8256493.148895
+186237.820643     8256496.769750
+186259.647655     8256501.488101
+186278.972317     8256506.167934
+186303.291590     8256511.551357
+186332.626419     8256516.385273
+186363.273088     8256517.483714
+186389.015127     8256512.244157
+186411.538196     8256512.590846
+186441.034310     8256507.410603
+186470.449794     8256507.236675
+186491.186725     8256501.921605
+186503.699625     8256502.114212
+186525.597202     8256502.451273
+186556.879453     8256502.932788
+186592.470733     8256507.863008
+186615.549113     8256512.600621
+186636.820815     8256512.928048
+186657.467406     8256513.245853
+186676.872316     8256512.919365
+186693.209522     8256508.786932
+186711.363448     8256508.441188
+186735.208446     8256504.425849
+186756.551118     8256500.370463
+186775.340627     8256499.407794
+186794.795943     8256495.951594
+186826.138691     8256492.676845
+186861.175043     8256493.216146
+186883.072619     8256493.553207
+186906.221180     8256493.909524
+186934.435703     8256490.586623
+186967.665759     8256486.715744
+187000.824870     8256487.226150
+187020.865745     8256486.282742
+187037.818352     8256482.786491
+187061.653642     8256479.397711
+187094.822843     8256479.281563
+187120.544700     8256475.295113
+187138.698650     8256474.947841
+187161.847593     8256475.304163
+187184.370662     8256475.650852
+187205.652812     8256475.353260
+187232.010253     8256470.749885
+187250.920731     8256462.276214
+187274.079764     8256462.005983
+187294.191203     8256456.681285
+187309.832329     8256456.922043
+187337.370954     8256456.719225
+187367.411931     8256456.554926
+187390.560873     8256456.911248
+187409.259636     8256461.582976
+187424.830199     8256466.205024
+187447.787226     8256478.453633
+187472.036317     8256488.218352
+187496.931058     8256496.741119
+187510.624762     8256501.334278
+187524.943958     8256505.937064
+187541.059358     8256515.576584
+187569.728356     8256522.905558
+187595.884554     8256530.821034
+187625.219002     8256535.654944
+187647.056081     8256539.748270
+187675.815824     8256541.442847
+187708.288945     8256545.699889
+187747.684349     8256547.558177
+187766.403294     8256550.976798
+187786.413920     8256551.911522
+187803.881499     8256555.310881
+187828.836737     8256560.077384
+187847.606088     8256560.366293
+187868.252298     8256560.684093
+187890.210371     8256557.264889
+187903.974638     8256557.476757
+187917.748972     8256557.063599
+187934.651173     8256556.697060
+187952.784941     8256557.602895
+187978.931073     8256566.143396
+187990.747511     8256570.709187
+188009.365644     8256580.387230
+188021.061520     8256592.462500
+188033.403045     8256603.295820
+188051.304940     8256618.598633
+188066.209695     8256625.714211
+188088.631952     8256632.320322
+188114.767586     8256641.488899
+188135.283142     8256649.942731
+188157.796119     8256650.915974
+188184.699161     8256651.330082
+188207.232321     8256651.050217
+188229.815862     8256647.642170
+188244.831496     8256647.873299
+188262.228129     8256655.653943
+188274.680532     8256659.602814
+188288.324212     8256667.325690
+188306.932279     8256677.628758
+188329.173068     8256695.502136
+188355.854329     8256709.686669
+188375.652858     8256723.766787
+188401.556645     8256747.330814
+188439.439324     8256765.444961
+188477.341422     8256782.305990
+188506.544809     8256795.277456
+188530.168408     8256805.032546
+188563.832423     8256813.063587
+188596.920564     8256817.956805
+188619.989258     8256823.319450
+188639.858376     8256833.016749
+188664.773274     8256840.287938
+188685.873983     8256851.256084
+188711.404307     8256859.161926
+188735.108536     8256863.910701
+188760.023459     8256871.180362
+188790.588709     8256877.286635
+188819.934011     8256881.494003
+188853.072582     8256883.255982
+188880.550711     8256886.809429
+188906.838327     8256886.588884
+188932.489621     8256886.983725
+188963.146380     8256887.455612
+188985.669449     8256887.802301
+189004.438800     8256888.091211
+189021.956403     8256888.360852
+189036.972036     8256888.591982
+189065.822119     8256884.653686
+189092.725161     8256885.067792
+189117.811459     8256881.696740
+189139.709035     8256882.033801
+189157.852894     8256882.313082
+189173.504111     8256881.927287
+189188.600375     8256877.152101
+189207.450380     8256872.433166
+189236.239990     8256872.249605
+189254.454412     8256868.147596
+189267.673460     8256863.341986
+189282.779815     8256857.940247
+189305.393629     8256852.652539
+189326.140269     8256846.710909
+189343.123864     8256841.338066
+189354.495919     8256834.625428
+189370.409233     8256817.966050
+189383.053194     8256810.021101
+189392.578997     8256801.402975
+189412.277040     8256782.923256
+189424.981474     8256771.223571
+189432.660309     8256760.696889
+189440.379434     8256747.668577
+189455.808407     8256722.235462
+189469.390363     8256694.896848
+189478.522546     8256671.872116
+189478.925794     8256646.834425
+189471.902262     8256616.673332
+189462.940992     8256590.239607
+189458.147242     8256577.017161
+189449.629997     8256561.860331
+189444.241767     8256546.750136
+189438.247413     8256530.380251
+189424.089144     8256515.761771
+189419.436521     8256493.776745
+189411.616121     8256474.246736
+189396.912990     8256454.612312
+189387.094379     8256442.564410
+189374.773012     8256430.479512
+189365.559712     8256419.694344
+189350.755793     8256406.317815
+189341.512245     8256397.410780
+189331.723883     8256383.484745
+189321.309241     8256369.550598
+189309.624220     8256356.848786
+189294.214967     8256342.211050
+189281.287501     8256328.864934
+189262.679459     8256318.560337
+189244.091574     8256307.004161
+189231.053993     8256300.542504
+189206.976278     8256280.137072
+189177.268368     8256259.644977
+189152.100977     8256229.204602
+189137.932617     8256215.212676
+189124.955533     8256204.994754
+189104.439978     8256196.540922
+189090.131254     8256191.311588
+189075.912489     8256180.449373
+189050.553565     8256161.901290
+189038.857689     8256149.826019
+189029.725044     8256134.033008
+189016.314001     8256111.913166
+189005.990104     8256092.344622
+188995.666946     8256072.777618
+188985.787839     8256064.485980
+188970.963763     8256052.361030
+188953.162656     8256030.800323
+188939.620552     8256016.818036
+188930.407252     8256006.032869
+188919.932137     8255995.853459
+188911.384669     8255982.573233
+188902.211684     8255969.284908
+188885.177984     8255938.969731
+188874.823839     8255921.279320
+188868.133429     8255909.281097
+188853.996082     8255893.411050
+188847.284751     8255882.664394
+188836.194999     8255871.848814
+188820.291289     8255849.065423
+188808.726474     8255828.852598
+188797.343126     8255797.372506
+188789.653023     8255769.704931
+188783.658669     8255753.335045
+188776.483919     8255732.563086
+188772.982231     8255716.856749
+188772.598703     8255701.823590
+188773.728255     8255670.536104
+188790.862305     8255655.774115
+188811.195931     8255636.677470
+188830.752059     8255626.961848
+188842.103957     8255621.500789
+188867.301134     8255611.245289
+188892.468063     8255602.867921
+188905.667716     8255599.313902
+188919.552571     8255592.014763
+188934.104022     8255582.220577
+188953.589586     8255576.886245
+188968.059618     8255572.099892
+188985.668706     8255566.736676
+188999.593900     8255556.932850
+189014.710346     8255550.904558
+189026.698566     8255544.828113
+189035.639216     8255533.695673
+189045.195267     8255523.199415
+189062.349474     8255507.185847
+189070.654565     8255496.668804
+189084.730953     8255477.477373
+189097.354757     8255470.784003
+189111.220218     8255464.736454
+189133.743287     8255465.083143
+189159.414738     8255464.226405
+189176.306848     8255464.486419
+189206.973699     8255464.331753
+189237.004966     8255464.794012
+189273.291920     8255465.352564
+189302.072202     8255465.795567
+189324.655743     8255462.387520
+189347.804304     8255462.743836
+189376.018828     8255459.420936
+189401.145441     8255453.546725
+189421.176607     8255453.229877
+189441.277597     8255448.530199
+189461.388679     8255443.203967
+189489.633426     8255438.004462
+189507.232447     8255433.266271
+189521.087054     8255427.845264
+189534.357271     8255419.909955
+189550.724701     8255413.900918
+189563.953815     8255408.470283
+189577.909258     8255396.788325
+189598.333606     8255372.058812
+189618.575723     8255358.596553
+189630.654664     8255346.887239
+189643.449844     8255329.553156
+189653.076483     8255314.674079
+189670.160126     8255303.041801
+189678.455127     8255293.151312
+189693.621978     8255283.993308
+189705.004100     8255276.655645
+189719.474896     8255271.869303
+189732.239827     8255256.413353
+189749.303313     8255246.032653
+189758.859364     8255235.536395
+189780.968655     8255222.728057
+189792.391856     8255212.887248
+189804.985411     8255208.072011
+189817.003880     8255200.117434
+189834.077457     8255189.110181
+189846.852455     8255173.029205
+189861.444220     8255160.731862
+189875.480293     8255144.043588
+189888.850558     8255129.848844
+189897.781117     8255119.342958
+189916.318158     8255095.209574
+189929.567429     8255088.527360
+189953.009124     8255070.730446
+189965.612745     8255065.290183
+189982.000333     8255058.029567
+190003.978564     8255053.358785
+190025.876140     8255053.695846
+190048.419366     8255052.790956
+190068.520356     8255048.091277
+190086.038723     8255048.360931
+190099.822766     8255047.321214
+190114.293561     8255042.534872
+190131.256235     8255038.413595
+190146.332366     8255034.888460
+190165.787707     8255031.430733
+190184.647779     8255026.086773
+190201.601150     8255022.590534
+190217.322906     8255017.824976
+190234.911097     8255013.711799
+190247.504627     8255008.898090
+190257.070769     8254997.775278
+190262.923509     8254984.091529
+190267.515198     8254971.013549
+190280.925778     8254954.315648
+190284.901277     8254940.603003
+190291.359352     8254928.180461
+190302.913638     8254910.200568
+190323.186003     8254894.860177
+190331.501161     8254883.718109
+190348.413429     8254882.726544
+190372.198312     8254882.467475
+190387.213182     8254882.698593
+190412.047450     8254894.976098
+190423.834047     8254901.418499
+190434.985060     8254908.477825
+190463.704106     8254912.675554
+190482.463366     8254913.591017
+190497.479000     8254913.822147
+190513.200780     8254909.055061
+190532.746842     8254899.964464
+190548.589592     8254887.686376
+190561.374680     8254870.978847
+190575.451093     8254851.785888
+190593.877230     8254834.538480
+190605.250025     8254827.827382
+190620.991963     8254821.808717
+190638.640626     8254813.940804
+190651.931001     8254804.753916
+190663.958772     8254796.174302
+190682.889433     8254786.447523
+190690.649661     8254770.914537
+190692.152676     8254755.285237
+190697.379923     8254741.591859
+190704.493739     8254727.300813
+190712.263282     8254711.142025
+190721.879831     8254696.889502
+190730.194976     8254685.748199
+190738.510133     8254674.606131
+190758.631281     8254668.654874
+190770.589253     8254664.456562
+190795.514242     8254671.101197
+190820.419074     8254678.997411
+190843.507150     8254683.109229
+190867.261797     8254684.727528
+190884.779400     8254684.997170
+190899.169542     8254685.218672
+190921.218336     8254676.166599
+190938.281834     8254665.785135
+190958.504558     8254653.574467
+190988.121272     8254640.882452
+191013.954032     8254630.010026
+191034.146507     8254619.677490
+191046.770298     8254612.984884
+191058.172590     8254604.394878
+191071.483122     8254593.956411
+191086.043888     8254583.536425
+191104.389371     8254571.296861
+191124.571003     8254561.590102
+191144.723163     8254553.760724
+191159.273838     8254543.967291
+191173.240111     8254531.660319
+191189.264315     8254508.115729
+191201.323111     8254497.657231
+191211.454249     8254490.300312
+191224.764029     8254479.861069
+191233.704667     8254468.729393
+191250.717759     8254461.477641
+191270.283978     8254451.135466
+191284.230094     8254440.080073
+191296.954697     8254427.128044
+191310.375357     8254409.804353
+191324.482005     8254388.734026
+191341.021587     8254372.083523
+191350.587717     8254360.961476
+191358.276619     8254349.809768
+191372.858305     8254338.138214
+191389.992355     8254323.376225
+191400.214238     8254310.384908
+191406.056899     8254297.326949
+191410.889763     8254269.226954
+191416.893720     8254246.154071
+191420.909547     8254229.937504
+191421.151498     8254214.914737
+191417.064646     8254196.694850
+191416.751668     8254177.281165
+191412.109123     8254154.670349
+191411.241229     8254130.864981
+191407.052801     8254118.904506
+191406.709575     8254101.368953
+191403.177652     8254087.539985
+191402.198855     8254070.620593
+191394.377679     8254051.091337
+191381.703031     8254022.095147
+191372.065863     8253998.781506
+191359.279548     8253976.671280
+191350.833643     8253957.132408
+191346.120535     8253938.902882
+191335.171134     8253919.325474
+191330.034921     8253888.567486
+191324.686241     8253870.954122
+191318.237783     8253843.933131
+191314.099761     8253828.842945
+191304.402108     8253809.284805
+191299.719248     8253789.177146
+191294.431805     8253767.809057
+191289.759024     8253747.075609
+191284.955182     8253734.479716
+191280.807845     8253720.015331
+191264.228249     8253700.351260
+191252.623107     8253682.642356
+191236.669016     8253662.987149
+191219.422837     8253645.817360
+191202.096016     8253633.654650
+191192.852480     8253624.746851
+191179.169237     8253619.527909
+191166.817633     8253609.320379
+191173.285799     8253596.271283
+191195.324502     8253587.845764
+191211.782665     8253576.203094
+191216.434839     8253559.369613
+191220.561556     8253536.267834
+191225.464983     8253503.786549
+191228.925893     8253483.178300
+191229.238408     8253463.774243
+191229.661826     8253437.484209
+191225.625367     8253416.135375
+191222.224492     8253394.169616
+191217.571868     8253372.184590
+191211.193986     8253340.781545
+191204.695134     8253316.889502
+191197.580105     8253292.362030
+191191.696654     8253269.106168
+191182.674899     8253246.427945
+191173.562424     8253229.382590
+191165.721854     8253211.104924
+191151.624058     8253192.731708
+191137.062078     8253164.333176
+191129.241678     8253144.803167
+191117.737348     8253120.834841
+191110.137966     8253087.534396
+191101.176696     8253061.100672
+191097.099922     8253042.254996
+191091.922619     8253014.000919
+191087.179262     8252997.649525
+191082.547572     8252974.412167
+191081.507526     8252961.248265
+191077.360189     8252946.783879
+191076.946399     8252933.629617
+191074.806587     8252911.057324
+191071.587179     8252877.824298
+191071.990427     8252852.786608
+191072.192051     8252840.267762
+191081.919478     8252819.130791
+191087.176210     8252803.559270
+191093.069289     8252787.370834
+191100.758942     8252776.219903
+191104.724362     8252763.133047
+191117.569948     8252742.669253
+191129.224269     8252718.430690
+191137.720881     8252696.022120
+191141.091058     8252681.047504
+191144.017196     8252654.796758
+191146.377576     8252624.780107
+191150.474821     8252603.555709
+191158.244364     8252587.396922
+191165.943345     8252575.619425
+191179.849121     8252567.068718
+191194.309074     8252562.908154
+191206.367858     8252552.450419
+191212.291174     8252534.384616
+191216.256594     8252521.297760
+191216.498545     8252506.274993
+191213.319451     8252470.538810
+191204.892953     8252449.747582
+191200.856507     8252428.397985
+191197.385055     8252410.814280
+191196.970515     8252397.659241
+191196.718022     8252374.490055
+191197.545138     8252361.980838
+191205.315446     8252345.822062
+191217.525460     8252325.974429
+191233.136337     8252328.093320
+191242.258904     8252344.512121
+191247.021655     8252359.611923
+191251.744842     8252377.215660
+191255.650240     8252406.702048
+191258.506278     8252423.650336
+191259.526153     8252438.066581
+191263.027841     8252453.772917
+191270.858332     8252472.676373
+191290.576995     8252491.762818
+191303.634733     8252496.972896
+191316.702563     8252501.556420
+191334.220929     8252501.826074
+191349.862055     8252502.066832
+191363.111339     8252495.383854
+191376.986115     8252488.710504
+191388.429498     8252477.616588
+191392.465494     8252460.147678
+191392.747760     8252442.621753
+191383.171089     8252415.551847
+191380.880059     8252402.368688
+191373.705309     8252381.596729
+191367.156039     8252360.835161
+191361.706547     8252349.481219
+191355.843266     8252324.973015
+191351.755638     8252306.753881
+191350.080785     8252294.206152
+191343.592012     8252269.688319
+191338.959558     8252246.450950
+191331.128303     8252227.547483
+191327.061608     8252208.076018
+191326.032405     8252194.286337
+191325.738834     8252173.620297
+191326.051349     8252154.216239
+191333.811578     8252138.683253
+191339.068310     8252123.111732
+191351.833241     8252107.655782
+191367.534851     8252104.141039
+191376.072253     8252118.046290
+191375.850459     8252131.817478
+191376.830020     8252148.736881
+191376.577990     8252164.385438
+191383.147417     8252183.895427
+191399.767328     8252201.056340
+191415.983540     8252204.436438
+191426.962727     8252183.317970
+191432.199302     8252168.998027
+191436.225971     8252152.155683
+191440.342609     8252129.679694
+191455.650600     8252111.758345
+191482.229822     8252093.384545
+191498.718234     8252079.863743
+191509.475628     8252072.516463
+191524.682043     8252060.854525
+191534.824023     8252052.871829
+191543.743751     8252042.990956
+191551.433404     8252031.840025
+191547.244976     8252019.879549
+191540.009729     8252002.863855
+191514.994019     8252001.852088
+191500.674441     8251997.249296
+191504.115181     8251977.893390
+191518.505322     8251978.114892
+191531.653794     8251977.691337
+191617.743328     8251957.571762
+191667.442116     8251929.328295
+END
+LINE3D
+HEIGHT 1070.000000
+183557.000000     8256623.276550
+183573.685428     8256619.798967
+183611.244287     8256619.125207
+183640.023997     8256619.568202
+183666.391911     8256614.338279
+183695.252084     8256609.773427
+183712.285704     8256601.270866
+183729.299165     8256594.019884
+183745.696844     8256586.132715
+183773.336282     8256579.670475
+183798.442713     8256575.049372
+183828.574410     8256569.252203
+183847.414350     8256565.158294
+183867.495540     8256561.711728
+183886.345545     8256556.992794
+183903.934093     8256552.881151
+183935.912592     8256548.991007
+183970.323069     8256549.520675
+184007.175615     8256553.843599
+184034.007712     8256558.638992
+184065.289964     8256559.120508
+184097.823582     8256559.621285
+184122.223700     8256559.996867
+184145.998326     8256560.362820
+184163.516311     8256560.632468
+184186.685411     8256559.737212
+184217.473040     8256552.071541
+184258.765651     8256552.707143
+184295.063053     8256552.640674
+184330.745054     8256551.938024
+184353.288304     8256551.031606
+184368.404750     8256545.003313
+184383.551229     8256537.098413
+184400.534276     8256531.724033
+184423.814279     8256523.942800
+184452.694801     8256518.126373
+184491.575399     8256513.090581
+184512.231891     8256512.781830
+184529.184665     8256509.287110
+184544.825791     8256509.527867
+184573.070563     8256504.326834
+184610.740301     8256496.768626
+184640.256597     8256490.335276
+184667.300385     8256481.986797
+184694.354454     8256473.011769
+184730.772850     8256465.432770
+184753.992356     8256461.407803
+184767.776615     8256460.366561
+184805.335474     8256459.692801
+184835.992234     8256460.164689
+184865.316972     8256465.625158
+184889.666494     8256469.130448
+184907.123981     8256473.156361
+184928.345659     8256476.613505
+184953.290831     8256482.005033
+184990.668224     8256492.598540
+185029.276826     8256504.462887
+185064.817699     8256512.522817
+185100.348100     8256521.209296
+185137.775924     8256528.671563
+185174.527825     8256539.255441
+185213.257396     8256543.608787
+185233.217641     8256547.671694
+185245.720451     8256548.490854
+185273.642605     8256563.321196
+185294.097282     8256575.531287
+185314.047436     8256580.220749
+185330.233399     8256585.478978
+185350.133147     8256593.298151
+185373.151030     8256601.792029
+185403.656189     8256611.653045
+185428.550930     8256620.175813
+185442.305131     8256621.012706
+185458.440688     8256629.400647
+185477.099136     8256636.575533
+185494.496533     8256644.356188
+185515.667423     8256650.943038
+185540.067733     8256651.318622
+185576.980561     8256651.886807
+185612.652495     8256651.809183
+185628.354093     8256648.295204
+185648.364744     8256649.228400
+185662.673849     8256654.457740
+185675.731970     8256659.667824
+185687.538342     8256664.858640
+185705.510825     8256675.778635
+185725.390415     8256684.849386
+185741.475567     8256696.367039
+185756.945317     8256707.248510
+185772.465449     8256715.001797
+185794.917954     8256719.729776
+185814.313179     8256720.028320
+185851.851881     8256720.606138
+185891.913092     8256719.970896
+185935.102934     8256719.382283
+185978.898087     8256720.056405
+186012.057197     8256720.566810
+186038.939676     8256722.234020
+186069.515805     8256727.712223
+186098.295324     8256728.155215
+186118.305950     8256729.089940
+186142.696169     8256730.092078
+186168.286990     8256734.241655
+186192.687299     8256734.617240
+186208.247770     8256739.865841
+186231.316058     8256745.230008
+186261.195726     8256755.081396
+186276.079917     8256763.450075
+186288.481939     8256770.527129
+186306.504828     8256778.317412
+186336.515532     8256780.032773
+186367.172291     8256780.504661
+186393.530114     8256775.901292
+186414.811907     8256775.602165
+186439.898181     8256772.232641
+186475.640679     8256767.773726
+186504.551258     8256760.079163
+186534.673246     8256754.908554
+186556.035694     8256749.601583
+186576.147133     8256744.276885
+186608.751314     8256740.396373
+186638.983824     8256728.339781
+186659.125535     8256721.135423
+186672.384898     8256713.826655
+186686.260044     8256707.154075
+186703.293688     8256698.649986
+186718.450066     8256690.118529
+186737.925946     8256685.409229
+186757.391353     8256681.326476
+186773.113133     8256676.559390
+186804.415543     8256675.789327
+186825.687627     8256676.116760
+186851.843825     8256684.032236
+186870.542613     8256688.702435
+186889.241400     8256693.372635
+186916.749370     8256695.049472
+186940.463333     8256699.170160
+186969.243234     8256699.613158
+187003.593214     8256703.899090
+187031.050803     8256708.704110
+187055.451112     8256709.079695
+187079.346516     8256701.934644
+187108.822473     8256698.005980
+187136.996682     8256697.186237
+187158.167953     8256703.773092
+187191.145597     8256715.550764
+187226.100912     8256721.097903
+187256.061234     8256725.941448
+187291.097585     8256726.480749
+187321.854775     8256720.693208
+187361.361438     8256715.667053
+187386.447737     8256712.296001
+187416.478622     8256712.758255
+187442.129916     8256713.153095
+187475.914901     8256713.673134
+187497.762071     8256717.139907
+187522.717309     8256721.906409
+187542.677529     8256725.970845
+187568.883752     8256730.756604
+187592.648478     8256731.749114
+187616.352349     8256736.496355
+187634.445420     8256739.905342
+187660.026532     8256744.681479
+187686.293609     8256745.712507
+187728.827329     8256746.992392
+187751.350397     8256747.339081
+187778.333687     8256742.746868
+187794.691433     8256737.362862
+187813.531347     8256733.270481
+187848.042636     8256727.540726
+187974.393224     8256770.181926
+187984.827642     8256782.864488
+188001.397541     8256803.154354
+188018.572750     8256824.706956
+188040.238478     8256839.439467
+188061.318622     8256851.660714
+188091.178514     8256862.763687
+188116.073255     8256871.286454
+188136.537616     8256882.871514
+188153.329678     8256889.390962
+188168.960738     8256890.256746
+188189.586408     8256891.826118
+188207.104775     8256892.095771
+188222.130475     8256891.701876
+188237.771601     8256891.942634
+188250.183689     8256898.394663
+188264.957384     8256913.647796
+188276.763374     8256918.838606
+188290.982140     8256929.700821
+188300.820932     8256940.495617
+188308.773157     8256951.888082
+188317.764650     8256976.445202
+188334.263604     8257001.116353
+188350.864133     8257019.528093
+188364.476800     8257029.129090
+188386.919214     8257034.483622
+188417.021045     8257030.564592
+188433.973652     8257027.068341
+188466.507652     8257027.569124
+188502.068302     8257034.377470
+188529.516182     8257039.809050
+188545.702145     8257045.067279
+188569.305587     8257056.073949
+188604.139932     8257069.132090
+188627.682112     8257083.895012
+188653.778195     8257095.566759
+188679.278271     8257105.350734
+188702.326020     8257111.966473
+188730.379234     8257118.659260
+188745.324305     8257123.271680
+188763.468163     8257123.550962
+188784.054258     8257127.625031
+188814.649781     8257131.851644
+188842.803808     8257132.285008
+188863.430242     8257133.854392
+188880.888111     8257137.880311
+188898.405714     8257138.149952
+188910.908524     8257138.969112
+188927.791332     8257139.854163
+188945.308934     8257140.123805
+188965.340100     8257139.806956
+188981.677307     8257135.674524
+188998.710544     8257127.171957
+189015.128380     8257118.033209
+189035.290607     8257109.578805
+189064.191120     8257102.509268
+189096.885641     8257092.995880
+189115.745737     8257087.650392
+189133.980317     8257082.296804
+189157.815631     8257078.906496
+189187.926764     8257074.362428
+189221.217317     8257066.735284
+189243.135051     8257065.820766
+189263.165478     8257065.502378
+189284.457719     8257064.578232
+189300.169409     8257060.437700
+189316.446118     8257060.061532
+189335.296124     8257055.342598
+189354.146129     8257050.623663
+189373.692954     8257041.533078
+189392.542935     8257036.815672
+189413.370230     8257025.866199
+189436.680864     8257016.206840
+189463.784766     8257004.102091
+189484.622891     8256992.527604
+189501.726716     8256979.642219
+189518.801057     8256968.634978
+189539.547697     8256962.693348
+189564.210103     8256946.795351
+189584.401814     8256936.462803
+189602.646485     8256930.482662
+189619.781323     8256915.719156
+189637.561022     8256899.715215
+189649.185871     8256877.354033
+189655.179763     8256854.906175
+189663.040040     8256833.113754
+189668.973434     8256814.422161
+189669.871114     8256797.531654
+189670.234022     8256774.998649
+189666.731897     8256720.473041
+189661.271852     8256670.927910
+189651.986762     8256625.706278
+189648.323328     8256581.196358
+189634.669119     8256535.280764
+189626.201819     8256478.176480
+189619.985245     8256436.757747
+189614.838190     8256406.625538
+189610.408112     8256370.870098
+189604.201605     8256328.826341
+189598.318154     8256305.570479
+189592.384297     8256285.444329
+189580.779167     8256267.734662
+189572.927755     8256250.082773
+189563.199866     8256232.402002
+189552.139574     8256219.709806
+189534.924407     8256200.661896
+189515.731188     8256187.844513
+189500.200941     8256180.719307
+189472.278787     8256165.888965
+189445.062779     8256146.060408
+189432.206665     8256128.331484
+189419.500980     8256101.214943
+189413.516742     8256084.216976
+189408.340202     8256055.962910
+189398.096935     8256031.388051
+189384.221709     8255999.242893
+189378.247513     8255981.621429
+189359.245087     8255956.910215
+189338.215706     8255941.560790
+189320.313811     8255926.257977
+189308.022692     8255912.294947
+189290.130863     8255896.367108
+189278.495485     8255880.535573
+189265.720000     8255857.800334
+189256.516792     8255846.388613
+189245.617809     8255823.680730
+189244.618854     8255808.012917
+189256.273927     8255783.775130
+189265.344874     8255764.505123
+189276.192988     8255751.524975
+189285.769222     8255739.775610
+189301.662378     8255724.367811
+189336.304727     8255710.500500
+189372.198037     8255696.653973
+189394.176268     8255691.983191
+189411.159887     8255686.608819
+189436.871654     8255683.248922
+189453.844419     8255678.501092
+189468.860052     8255678.732222
+189483.330848     8255673.945880
+189511.706656     8255660.608820
+189552.019515     8255644.325015
+189589.820338     8255628.627724
+189604.835972     8255628.858853
+189626.874675     8255620.433334
+189638.893144     8255612.478757
+189652.122258     8255607.048122
+189663.545484     8255597.205785
+189680.568655     8255589.328243
+189698.914138     8255577.088679
+189719.277224     8255556.115419
+189740.115374     8255544.539404
+189769.177147     8255527.457235
+189796.503619     8255501.580545
+189825.706543     8255475.734267
+189857.856227     8255461.203408
+189880.611168     8255447.153119
+189892.750606     8255431.687540
+189911.802236     8255414.449760
+189921.963622     8255405.214709
+189943.457487     8255391.771718
+189964.941286     8255378.953752
+189986.283934     8255374.899894
+190012.580877     8255374.052784
+190042.612145     8255374.515044
+190069.423702     8255380.562009
+190090.554634     8255389.653551
+190110.565667     8255390.586753
+190139.980745     8255390.414348
+190162.110194     8255376.354431
+190181.726819     8255362.882544
+190203.815953     8255351.325785
+190248.448288     8255338.865664
+190281.153664     8255328.725735
+190305.664876     8255322.215343
+190327.147911     8255309.397365
+190349.216863     8255299.093713
+190386.957189     8255287.152687
+190410.338386     8255273.112037
+190429.309362     8255260.882101
+190441.347988     8255251.675946
+190455.737366     8255251.897436
+190489.522350     8255252.417475
+190509.552752     8255252.100615
+190525.274533     8255247.333529
+190546.072343     8255238.262200
+190573.802501     8255226.167091
+190609.695835     8255212.319036
+190647.476476     8255197.874851
+190666.457543     8255185.018362
+190677.265342     8255174.541371
+190686.255634     8255160.279208
+190695.993152     8255138.515684
+190704.520000     8255114.229745
+190709.201646     8255095.518884
+190713.198091     8255080.553144
+190722.238764     8255063.162798
+190746.154733     8255054.764646
+190760.554940     8255054.361123
+190785.045231     8255049.102298
+190811.433660     8255042.622330
+190832.776332     8255038.566945
+190856.116426     8255027.030970
+190885.904527     8255003.697478
+190896.782890     8254988.839197
+190904.542355     8254973.306199
+190920.516166     8254952.890557
+190954.623744     8254933.380749
+190989.790774     8254925.782489
+191017.389872     8254921.824935
+191035.614385     8254917.096372
+191046.381106     8254909.122528
+191061.063592     8254891.192315
+191079.509887     8254872.693328
+191096.028536     8254857.295157
+191111.911625     8254842.512384
+191126.522784     8254828.963450
+191139.853474     8254817.273404
+191159.560845     8254798.167119
+191183.042090     8254777.867036
+191204.071760     8254754.399493
+191226.877095     8254737.220257
+191254.001931     8254723.863176
+191283.104043     8254704.276321
+191311.600833     8254683.427496
+191342.620514     8254661.365614
+191388.110226     8254634.517379
+191414.114362     8254613.004240
+191433.771314     8254597.028431
+191451.481226     8254585.405029
+191467.394540     8254568.745651
+191483.307866     8254552.085509
+191499.251428     8254533.547999
+191521.582488     8254506.970001
+191536.940885     8254485.918940
+191547.818497     8254471.059884
+191569.443423     8254449.479337
+191582.097463     8254440.908599
+191592.924668     8254429.179254
+191615.245650     8254403.227045
+191633.903648     8254371.583423
+191644.296907     8254347.951394
+191645.881327     8254327.315025
+191646.163606     8254309.788336
+191646.375309     8254296.643701
+191640.643088     8254263.997941
+191634.355927     8254226.962027
+191633.487269     8254203.156648
+191622.568880     8254181.701119
+191611.720291     8254155.864289
+191596.502571     8254129.334261
+191579.397544     8254103.400363
+191566.581744     8254083.168282
+191543.886837     8254054.644563
+191512.533560     8254019.726594
+191491.664724     8253994.361470
+191473.944271     8253967.792919
+191456.808995     8253943.737154
+191448.918019     8253928.589199
+191438.170242     8253896.492946
+191428.189860     8253855.642988
+191417.986933     8253828.563442
+191408.440498     8253799.616168
+191400.155126     8253770.062360
+191396.643360     8253754.981813
+191397.006281     8253732.448044
+191386.118141     8253709.114383
+191377.610988     8253693.331000
+191369.063507     8253680.051538
+191363.059087     8253664.306678
+191356.409005     8253649.804533
+191350.465081     8253630.303408
+191345.731803     8253613.326225
+191337.295214     8253593.161552
+191326.386903     8253571.080234
+191319.160983     8253553.437973
+191319.473498     8253534.033916
+191319.765856     8253515.881437
+191320.654220     8253499.616731
+191324.074803     8253481.512404
+191329.331535     8253465.940882
+191330.188900     8253451.553532
+191333.599392     8253434.075759
+191337.696636     8253412.851360
+191338.856437     8253379.685742
+191343.003312     8253355.332384
+191347.099793     8253334.107974
+191347.371993     8253317.207074
+191347.583695     8253304.062439
+191347.936538     8253282.154460
+191343.920249     8253259.553283
+191339.893117     8253237.577884
+191335.725610     8253224.365842
+191327.339439     8253201.070693
+191323.313071     8253179.095306
+191319.892026     8253158.381890
+191318.912478     8253141.461722
+191318.690234     8253116.414403
+191317.792091     8253094.487168
+191316.933500     8253070.056763
+191312.160671     8253055.582750
+191308.153697     8253032.355772
+191302.905830     8253008.482985
+191298.869383     8252987.133387
+191294.065541     8252974.537495
+191289.928283     8252959.447320
+191278.827664     8252949.259046
+191267.667323     8252942.826285
+191255.951290     8252932.002594
+191249.250814     8252920.629396
+191250.158573     8252903.113099
+191260.985779     8252891.383753
+191291.894568     8252876.207084
+191319.856599     8252849.714997
+191341.350465     8252836.272006
+191350.977092     8252821.393693
+191361.239290     8252805.899219
+191369.927447     8252771.597593
+191377.323528     8252739.780621
+191381.430088     8252717.930421
+191394.941493     8252694.972333
+191407.736660     8252677.639014
+191419.240527     8252662.789597
+191426.989914     8252647.882389
+191440.440822     8252628.680565
+191452.630666     8252610.085275
+191470.330499     8252599.087662
+191498.565168     8252594.513947
+191546.245099     8252587.108293
+191587.598003     8252583.988391
+191605.116370     8252584.258044
+191629.688054     8252573.992916
+191650.475022     8252565.547364
+191671.928572     8252554.607531
+191690.849141     8252545.507306
+191702.887768     8252536.301150
+191713.634319     8252529.579649
+191724.492524     8252515.972947
+191738.982714     8252509.935014
+191752.888502     8252501.383544
+191766.137786     8252494.700566
+191781.859566     8252489.933480
+191794.443030     8252485.744796
+191809.650209     8252474.082870
+191805.492030     8252460.244262
+191782.979040     8252459.271784
+191764.835181     8252458.992502
+191751.061217     8252459.406429
+191737.195756     8252465.453978
+191723.381465     8252468.371827
+191710.192666     8252471.299304
+191698.234682     8252475.498380
+191681.968063     8252475.247995
+191671.513106     8252463.817006
+191664.893272     8252447.436728
+191659.615156     8252425.442074
+191663.156708     8252399.826745
+191670.281366     8252384.909921
+191686.719360     8252374.519593
+191694.408261     8252363.367886
+191707.153035     8252349.163514
+191720.472882     8252338.099246
+191728.818276     8252325.079810
+191740.957714     8252309.614232
+191749.342672     8252294.090862
+191755.820916     8252280.415977
+191765.538264     8252259.904795
+191769.514539     8252246.191398
+191784.286995     8252222.627540
+191792.006909     8252209.597712
+191810.987963     8252196.741986
+191832.501234     8252182.046640
+191845.185510     8252171.598533
+191847.496248     8252144.711606
+191847.838999     8252123.430180
+191849.392420     8252104.671168
+191861.996054     8252099.230141
+191877.011687     8252099.461270
+191897.577637     8252104.786155
+191915.721495     8252105.065437
+191933.400395     8252095.320155
+191946.861382     8252075.492542
+191964.702354     8252055.731584
+191973.884943     8252029.577141
+191978.536340     8252012.744413
+191980.060288     8251995.862781
+191980.342555     8251978.336856
+191979.988499     8251961.426316
+191975.861319     8251945.710352
+191970.502549     8251928.723541
+191960.714175     8251914.798270
+191956.667637     8251894.075226
+191947.454350     8251883.289294
+191942.065331     8251868.180616
+191941.641462     8251855.652143
+191941.953990     8251836.247321
+191957.776570     8251825.221576
+191977.463770     8251807.367635
+191989.451991     8251801.291191
+192005.244335     8251792.142814
+192021.046758     8251782.368649
+192048.796322     8251769.021185
+192091.723568     8251745.890703
+192113.126713     8251738.080581
+192128.808166     8251735.817417
+192143.207622     8251735.413117
+192161.351481     8251735.692399
+192190.141079     8251735.509601
+192203.986382     8251730.713631
+192221.564470     8251727.227772
+192240.414463     8251722.509602
+192256.105995     8251719.620649
+192268.063979     8251715.421572
+192296.994716     8251706.475430
+192317.136785     8251699.272606
+192329.730341     8251694.457368
+192351.022582     8251693.533222
+192366.097937     8251690.008840
+192383.111793     8251682.757100
+192392.657765     8251672.886631
+192402.940120     8251656.140578
+192409.196517     8251636.302325
+END
+LINE3D
+HEIGHT 1060.000000
+183557.000000     8256823.953132
+183571.438661     8256824.084612
+183594.621542     8256823.042508
+183616.552034     8256821.989001
+183639.735106     8256820.946899
+183657.275915     8256820.480214
+183673.564336     8256820.002124
+183689.220627     8256820.144692
+183707.381886     8256820.310070
+183726.795724     8256820.486854
+183748.726216     8256819.433346
+183777.574725     8256815.310003
+183798.873083     8256814.877535
+183817.069398     8256811.283605
+183834.019164     8256807.051911
+183856.599313     8256803.498284
+183876.732725     8256793.656714
+183896.245883     8256783.182700
+183908.817653     8256778.284726
+183935.213776     8256768.499803
+183954.007165     8256768.044524
+183971.577190     8256764.444891
+183989.738449     8256764.610269
+184012.909835     8256764.821270
+184037.959900     8256765.049378
+184059.878706     8256765.248973
+184078.666255     8256765.420054
+184099.999665     8256761.228660
+184123.855573     8256755.180232
+184152.704082     8256751.056889
+184172.158817     8256746.848006
+184189.102740     8256743.243054
+184204.770715     8256742.132519
+184218.559821     8256741.004875
+184236.732765     8256739.917151
+184258.686624     8256736.357820
+184284.368823     8256735.964889
+184303.168054     8256734.883250
+184320.703214     8256735.042926
+184337.617737     8256734.570156
+184355.152897     8256734.729833
+184373.314156     8256734.895211
+184398.990511     8256735.129022
+184421.523731     8256736.587420
+184444.683432     8256738.051523
+184464.711875     8256739.487113
+184486.630682     8256739.686708
+184514.185523     8256739.937625
+184538.609489     8256740.160031
+184558.023137     8256740.336814
+184575.558488     8256740.496492
+184596.213033     8256741.937401
+184620.010518     8256742.154103
+184649.444421     8256742.422131
+184671.351542     8256743.874828
+184689.506766     8256744.666947
+184707.030435     8256746.079345
+184727.690818     8256746.894276
+184747.098624     8256747.697419
+184775.824635     8256756.731080
+184802.126897     8256756.970591
+184822.793506     8256757.158783
+184840.954574     8256757.324159
+184858.489543     8256757.483834
+184879.782251     8256757.677728
+184899.810694     8256759.113317
+184914.202723     8256760.497199
+184936.677520     8256768.220727
+184950.408395     8256773.358215
+184967.229631     8256782.909884
+184984.688647     8256791.214534
+185002.141827     8256800.145162
+185022.761698     8256805.345382
+185042.093553     8256814.293500
+185060.810993     8256821.982813
+185077.649755     8256829.655020
+185103.864766     8256839.292229
+185123.196623     8256848.239965
+185150.675899     8256856.635478
+185171.272018     8256864.341899
+185190.621398     8256871.410554
+185205.616537     8256875.306346
+185219.382464     8256876.684908
+185234.365536     8256881.833799
+185254.990867     8256886.407655
+185281.867414     8256892.291262
+185300.602381     8256898.101113
+185318.102297     8256902.019713
+185334.373001     8256903.421084
+185354.378074     8256907.362879
+185374.406520     8256908.798086
+185397.577907     8256909.009087
+185415.112876     8256909.168762
+185428.890488     8256909.294222
+185445.798976     8256909.448193
+185460.823323     8256910.211801
+185475.197822     8256913.475528
+185488.337650     8256914.848389
+185502.729680     8256916.232271
+185525.889381     8256917.696374
+185544.665244     8256919.120558
+185559.665842     8256922.389986
+185573.443454     8256922.515446
+185594.747848     8256921.456236
+185608.490022     8256925.341001
+185627.845628     8256931.782917
+185657.853051     8256937.695034
+185678.484223     8256941.642530
+185701.608872     8256946.865558
+185715.971686     8256951.382387
+185734.677445     8256960.324421
+185752.768787     8256968.008034
+185765.884865     8256971.886714
+185788.319149     8256983.995914
+185808.282946     8256992.322990
+185831.390065     8256999.425864
+185850.136721     8257003.982230
+185867.045591     8257004.136204
+185885.792243     8257008.692952
+185906.458470     8257008.881141
+185923.367340     8257009.035115
+185937.771051     8257009.166276
+185952.807083     8257008.676782
+185969.089472     8257008.825051
+185982.235145     8257009.571170
+185999.108577     8257013.484448
+186017.861074     8257017.414454
+186034.717362     8257023.207198
+186047.792926     8257031.471550
+186062.132374     8257038.494201
+186076.477662     8257044.890493
+186089.599581     8257048.142814
+186106.438344     8257055.815020
+186125.225892     8257055.986101
+186150.960861     8257049.954784
+186171.714722     8257040.745277
+186193.674425     8257036.559204
+186215.001803     8257032.994169
+186235.703468     8257029.423053
+186258.289266     8257025.243064
+186282.127648     8257021.074098
+186302.214514     8257016.244558
+186319.170125     8257011.386121
+186332.362149     8257007.120591
+186349.271019     8257007.274565
+186373.694985     8257007.496972
+186406.833667     8257013.437602
+186428.085096     8257018.017159
+186444.326971     8257022.551099
+186458.730681     8257022.682261
+186476.265650     8257022.841936
+186493.841516     8257018.615943
+186513.290597     8257015.033804
+186531.457510     8257014.572438
+186544.620708     8257013.439094
+186557.157422     8257012.300428
+186574.077978     8257011.201299
+186598.513247     8257010.170600
+186622.972265     8257006.634082
+186653.658365     8257006.913512
+186674.951073     8257007.107405
+186691.239307     8257006.628932
+186705.678452     8257003.001172
+186718.256066     8256997.476455
+186735.252188     8256988.232730
+186754.144897     8256977.126654
+186773.025920     8256967.273679
+186788.097009     8256963.024878
+186814.440550     8256958.878724
+186831.987204     8256957.785297
+186852.033173     8256957.341424
+186870.194241     8256957.506800
+186890.860850     8256957.694992
+186910.888911     8256959.130579
+186929.647248     8256962.434225
+186946.556118     8256962.588198
+186962.838890     8256962.736471
+186977.909596     8256958.487666
+186998.581667     8256958.049112
+187022.414587     8256954.506892
+187047.511389     8256949.722973
+187065.678301     8256949.261607
+187081.966913     8256948.783519
+187102.006659     8256948.966003
+187125.189731     8256947.923901
+187154.658686     8256944.433003
+187176.009816     8256938.361766
+187194.176728     8256937.900400
+187214.257750     8256933.697602
+187236.808500     8256933.276156
+187266.254087     8256932.291081
+187301.365300     8256928.225149
+187315.769011     8256928.356311
+187334.603301     8256923.514982
+187354.016948     8256923.691764
+187372.798652     8256924.489588
+187402.232555     8256924.757615
+187427.908718     8256924.991425
+187452.326844     8256925.840192
+187476.054221     8256933.575126
+187501.075074     8256936.935800
+187524.246461     8256937.146800
+187541.775589     8256937.932835
+187555.553201     8256938.058296
+187576.172687     8256943.258894
+187594.334137     8256943.424274
+187614.374265     8256943.606761
+187639.424330     8256943.834869
+187668.852009     8256944.729254
+187690.729919     8256949.314516
+187711.946678     8256957.653002
+187732.560706     8256963.479964
+187752.512818     8256973.060143
+187776.246421     8256980.168339
+187798.727063     8256987.265125
+187814.933500     8256995.558369
+187829.267489     8257003.207384
+187842.383564     8257007.086447
+187864.864206     8257014.183233
+187879.227402     8257018.700066
+187898.594312     8257023.888876
+187922.954011     8257031.003156
+187945.417127     8257039.979404
+187965.392606     8257047.053761
+187983.478107     8257055.363733
+188005.929537     8257065.593085
+188022.751156     8257075.144757
+188037.704634     8257083.426209
+188055.146507     8257093.610325
+188070.077379     8257104.397990
+188091.235716     8257119.001606
+188106.206720     8257125.403595
+188124.280536     8257134.966670
+188145.479769     8257145.184619
+188157.946379     8257151.563803
+188170.418829     8257157.316628
+188182.873754     8257164.948914
+188197.213583     8257171.971570
+188211.546804     8257179.620960
+188228.356737     8257190.425735
+188244.504754     8257204.983727
+188259.458997     8257213.265186
+188276.274010     8257223.443212
+188297.467399     8257234.287903
+188317.378614     8257248.253750
+188335.440745     8257259.069927
+188350.991875     8257270.489653
+188373.402409     8257285.104672
+188393.396182     8257290.299190
+188410.246247     8257296.718290
+188435.202834     8257306.970836
+188457.683476     8257314.067622
+188480.785136     8257321.796859
+188507.660915     8257327.680842
+188532.032303     8257333.541636
+188545.136697     8257338.673419
+188559.476523     8257345.696457
+188570.052386     8257353.311633
+188587.505948     8257362.242264
+188600.598656     8257368.627150
+188620.585820     8257374.448404
+188644.974734     8257378.429735
+188668.772602     8257378.646441
+188690.071150     8257378.213974
+188706.985483     8257377.741202
+188726.399130     8257377.917984
+188748.908980     8257381.882588
+188772.677636     8257385.231858
+188786.449025     8257385.983675
+188810.205995     8257390.586048
+188825.206976     8257393.855480
+188839.604463     8257394.612998
+188854.628811     8257395.376606
+188874.042458     8257395.553389
+188902.223781     8257395.810010
+188927.273846     8257396.038119
+188948.566554     8257396.232012
+188968.607064     8257396.414503
+188988.646810     8257396.596986
+189003.688687     8257395.480750
+189016.254616     8257391.209136
+189038.799522     8257391.414432
+189054.461653     8257390.930640
+189074.513084     8257389.860021
+189094.600332     8257385.030484
+189114.019824     8257384.580524
+189134.094622     8257381.004083
+189157.933386     8257376.835120
+189174.888612     8257371.977063
+189188.081404     8257367.711158
+189201.267587     8257364.071988
+189215.717653     8257359.191118
+189228.910445     8257354.925213
+189257.067799     8257340.040754
+END
+LINE3D
+HEIGHT 1060.000000
+189257.067799     8257340.040754
+189281.233567     8257318.434112
+189298.815655     8257313.581763
+189317.064739     8257304.349447
+189334.657749     8257298.243988
+189356.026405     8257290.293289
+189377.389221     8257282.968949
+189393.098094     8257277.472747
+189411.920694     8257273.884903
+189426.991783     8257269.636101
+189445.193365     8257265.415807
+189460.264450     8257261.167388
+189474.112552     8257253.774618
+189488.585988     8257246.387544
+189504.312387     8257239.011879
+189525.043260     8257232.308580
+189543.274817     8257224.955727
+189556.525268     8257214.424685
+189576.079128     8257199.565384
+189589.938151     8257190.919506
+189605.676234     8257182.290738
+189623.246638     8257178.691491
+189641.495722     8257169.459176
+189660.961951     8257163.997188
+189672.913463     8257158.467153
+189684.238115     8257152.931027
+189701.861100     8257143.693010
+189722.006007     8257132.598336
+189735.216325     8257126.452968
+189745.317991     8257117.772875
+189756.654325     8257110.984029
+189774.920935     8257099.872251
+189788.833301     8257085.587992
+189797.096803     8257072.505120
+189806.636634     8257056.927835
+189814.274799     8257043.839651
+189818.166527     8257029.464143
+189816.483269     8256995.441932
+END
+LINE3D
+HEIGHT 1060.000000
+183557.000000     8257203.155951
+183568.465922     8257210.022181
+183585.907604     8257220.206296
+183602.746178     8257227.878118
+183617.717948     8257234.280115
+183636.464599     8257238.836863
+183655.872402     8257239.640388
+183669.644174     8257240.392208
+183683.427627     8257239.891309
+183697.240103     8257236.257459
+183711.690743     8257231.376595
+183724.888611     8257226.484323
+183737.413644     8257226.598377
+183752.443835     8257226.735243
+183769.972963     8257227.521278
+183785.588357     8257232.049513
+183798.704627     8257235.928195
+183811.826738     8257239.180518
+183836.824221     8257245.047396
+183853.071558     8257248.954590
+183869.342453     8257250.355963
+183884.992899     8257251.125273
+183900.017059     8257251.888498
+183922.556315     8257252.720156
+183935.695952     8257254.093015
+183949.444352     8257257.351040
+183965.720897     8257258.126052
+183980.095588     8257261.389780
+183995.716826     8257265.291273
+184014.469323     8257269.221279
+184034.474204     8257273.163072
+184049.469343     8257277.058864
+184074.484352     8257281.046279
+184088.853011     8257284.936366
+184107.611348     8257288.240012
+184131.906593     8257302.245780
+184145.011177     8257307.377565
+184157.506998     8257310.624184
+184174.410028     8257311.404518
+184190.686572     8257312.179529
+184203.170708     8257316.679251
+184217.516187     8257323.075544
+184232.476084     8257330.730259
+184250.567234     8257338.413870
+184276.788086     8257347.424719
+184296.120134     8257356.372456
+184309.821603     8257364.642890
+184321.638556     8257373.522194
+184339.068556     8257384.959028
+184354.613842     8257397.005496
+184367.683371     8257405.896589
+184387.612307     8257417.982592
+184409.426144     8257429.459346
+184428.740472     8257440.286927
+184447.411176     8257452.988268
+184468.569512     8257467.591884
+184486.607890     8257480.914264
+184502.153179     8257492.960349
+184522.673349     8257508.811363
+184531.347547     8257518.915640
+184540.630320     8257530.904699
+184557.978335     8257551.112867
+184573.494410     8257566.291900
+184589.010488     8257581.470551
+184605.199781     8257591.643261
+184622.026479     8257600.568184
+184640.117821     8257608.251796
+184654.451424     8257615.901190
+184668.147243     8257624.797986
+184683.692532     8257636.844071
+184701.098970     8257650.787109
+184719.775514     8257662.862091
+184733.453811     8257673.637966
+184748.396368     8257683.172528
+184764.567753     8257695.224697
+184779.481099     8257707.891824
+184788.143233     8257719.248818
+184797.385106     8257735.623926
+184812.263400     8257752.049978
+184822.804594     8257763.424082
+184832.093208     8257774.786781
+184840.743656     8257787.396877
+184848.791372     8257797.495449
+184866.818450     8257812.070552
+184881.157897     8257819.093204
+184894.274355     8257822.972270
+184907.361222     8257829.983516
+184923.579344     8257837.023657
+184942.290944     8257845.339331
+184960.376445     8257853.649304
+184979.731670     8257860.091217
+185003.476955     8257865.946692
+185023.481649     8257869.888101
+185045.266084     8257884.497419
+185058.359175     8257890.882308
+185070.849152     8257894.755669
+185088.986852     8257897.426868
+185102.138366     8257897.546627
+185126.561949     8257897.769030
+185140.966042     8257897.900195
+185160.391375     8257896.823875
+185176.685446     8257895.719424
+185195.496365     8257893.384300
+185212.446132     8257889.152606
+185239.392401     8257887.518359
+185259.438370     8257887.074486
+185278.852400     8257887.251272
+185295.128948     8257888.025901
+185311.352915     8257894.439300
+185325.716111     8257898.956133
+185339.481656     8257900.334692
+185368.845454     8257908.120570
+185395.721615     8257914.004556
+185416.932530     8257922.969784
+185437.511123     8257932.555668
+185453.717945     8257940.848533
+185479.891677     8257954.871407
+185510.472999     8257966.427999
+185527.949545     8257972.852804
+185541.662894     8257979.869754
+185554.106133     8257988.755144
+185564.618115     8258003.261813
+185577.629031     8258018.418034
+185588.129328     8258034.177806
+185594.274999     8258046.765094
+185602.867406     8258065.640324
+185616.451842     8258086.440633
+185625.073460     8258102.183298
+185632.495081     8258112.275787
+185645.441733     8258134.323498
+185650.247190     8258156.297075
+185654.490812     8258171.373460
+185656.229278     8258186.426650
+185657.365012     8258198.968317
+185657.810380     8258218.396154
+185657.640957     8258236.564803
+185656.880101     8258250.969203
+185651.729952     8258265.959665
+185645.309693     8258282.818566
+185639.544745     8258296.550604
+185629.999073     8258312.754249
+185621.114935     8258325.204673
+185613.482993     8258337.666501
+185605.213268     8258351.375729
+185593.823970     8258363.803342
+185579.876930     8258381.846912
+185565.356374     8258394.246011
+185548.962602     8258406.001257
+185529.408739     8258420.860940
+185507.390612     8258431.312143
+185493.572107     8258435.571968
+185469.083874     8258442.241434
+185446.463020     8258450.180731
+185426.341098     8258458.769579
+185410.023657     8258462.380235
+185391.224423     8258463.462256
+185369.896663     8258467.027288
+185352.981948     8258467.500057
+185338.543185     8258471.127821
+185322.231585     8258474.112117
+185308.424761     8258477.119222
+185294.612097     8258480.752687
+185273.243819     8258488.703772
+185256.896784     8258495.446990
+185236.195505     8258499.017727
+185218.561217     8258509.508850
+185205.316225     8258519.413529
+185190.772298     8258534.318833
+185174.291277     8258555.471395
+185152.220566     8258571.561751
+185125.760183     8258588.237782
+185098.673701     8258604.908112
+185077.826358     8258624.142439
+185063.896848     8258640.306164
+185051.254971     8258652.722371
+185037.922348     8258672.024363
+185018.936161     8258693.154877
+184997.491938     8258709.250173
+184982.362430     8258719.763722
+184970.382085     8258728.426708
+184958.395518     8258737.716051
+184945.150912     8258747.620351
+184933.129285     8258760.669383
+184915.430736     8258778.051614
+184898.294016     8258802.331801
+184881.871411     8258817.219998
+184869.235374     8258829.009844
+184857.874905     8258838.304888
+184845.244716     8258849.467609
+184830.086372     8258863.114492
+184814.910124     8258878.640451
+184802.847993     8258896.074008
+184790.165215     8258912.876264
+184779.349441     8258930.947583
+184773.187197     8258937.000000
+END
+LINE3D-MASTER
+HEIGHT 1050.000000
+185209.482965     8258937.000000
+185227.247876     8258921.242035
+185237.987705     8258911.314926
+185254.381098     8258899.559295
+185269.493083     8258890.924826
+185279.594750     8258882.244733
+185299.142765     8258868.012174
+185316.133428     8258859.394813
+185330.653985     8258846.995714
+185343.858080     8258841.476703
+185357.044263     8258837.837533
+185372.080296     8258837.348039
+185385.266479     8258833.708869
+185409.081494     8258832.045726
+185424.158427     8258827.170182
+185443.583756     8258826.094245
+185460.574419     8258817.476883
+185476.938984     8258808.853820
+185493.303159     8258800.231519
+185509.667342     8258791.608452
+185522.900648     8258782.956876
+185534.880993     8258774.293890
+185548.746239     8258765.021655
+185561.985386     8258755.743718
+185575.212463     8258747.719263
+185587.784236     8258742.820907
+185600.993790     8258736.675532
+185617.949401     8258731.817096
+185639.294684     8258726.372984
+185654.997715     8258721.503141
+185672.602789     8258714.144966
+185689.587611     8258706.153965
+185702.779635     8258701.888435
+185719.109148     8258697.024297
+185741.033795     8258696.597531
+185763.619601     8258692.416777
+185779.316785     8258688.174060
+185793.135290     8258683.914235
+185806.959643     8258679.027285
+185822.030345     8258674.778862
+185838.991797     8258669.294066
+185859.078667     8258664.464143
+185882.940415     8258657.789355
+185903.665065     8258651.712413
+185922.505196     8258646.244724
+185940.736750     8258638.892253
+185957.071721     8258633.401752
+185972.195388     8258623.514563
+185989.800468     8258616.155623
+186015.575947     8258605.739017
+186034.451130     8258596.512403
+186048.937016     8258587.872232
+186062.164093     8258579.847777
+186074.103926     8258575.570080
+186087.342692     8258566.292140
+186101.810666     8258559.531811
+186116.881751     8258555.283392
+186142.604655     8258550.504792
+186160.209729     8258543.146616
+186173.402142     8258538.880325
+186187.846746     8258534.626201
+186204.170035     8258530.388420
+186219.896430     8258523.013137
+186243.752720     8258516.964713
+186263.213105     8258512.129467
+186278.284193     8258507.880666
+186291.505433     8258500.482189
+186303.462789     8258494.325411
+186316.666498     8258488.806779
+186332.363685     8258484.563679
+186351.794859     8258482.860999
+186364.360788     8258478.589385
+186379.390980     8258478.726251
+186393.806376     8258477.604310
+186413.232091     8258476.527994
+186432.025480     8258476.072715
+186448.945653     8258474.973582
+186464.613629     8258473.863047
+186477.173714     8258470.218176
+186493.491541     8258466.607141
+186507.310046     8258462.347316
+186521.204121     8258449.942512
+186525.745701     8258433.066504
+186525.880073     8258418.656781
+186526.026129     8258402.993955
+186520.518625     8258389.159270
+186509.386006     8258374.020153
+186497.604300     8258361.381543
+186487.718416     8258346.880575
+186483.445965     8258334.936759
+186474.806817     8258321.073939
+186464.423365     8258292.783906
+186463.293475     8258279.615497
+186452.758504     8258267.615036
+186447.268144     8258251.900885
+186435.462688     8258241.768094
+186426.788870     8258231.664203
+186408.633265     8258230.872081
+186393.562558     8258235.120886
+186383.460510     8258243.800976
+186372.094582     8258253.722383
+186362.578118     8258266.793846
+186353.716968     8258276.738062
+186343.574408     8258289.803440
+186332.840420     8258299.104189
+186315.211973     8258308.968952
+186301.405150     8258311.976057
+186284.537176     8258307.436415
+186266.469583     8258297.246984
+186250.877560     8258290.212543
+186234.664896     8258282.546038
+186223.474233     8258273.672438
+186212.968095     8258258.539025
+186198.698756     8258243.998141
+186188.801569     8258230.750279
+186177.042852     8258215.605460
+186168.386563     8258203.621724
+186157.857054     8258190.994517
+186146.742340     8258173.976324
+186138.068143     8258163.872047
+186118.783026     8258149.911901
+186108.241833     8258138.537797
+186097.671427     8258130.296257
+186078.357099     8258119.468677
+186061.541704     8258109.290648
+186039.084051     8258099.687653
+186022.854243     8258093.900614
+186009.708953     8258093.154499
+185992.208658     8258089.235513
+185969.663752     8258089.030217
+185950.841148     8258092.618443
+185927.634709     8258096.166368
+185910.070529     8258099.139258
+185893.747243     8258103.376657
+185874.936324     8258105.711781
+185861.129501     8258108.718886
+185841.071846     8258110.415861
+185827.973297     8258104.657335
+185817.432103     8258093.283231
+185808.184386     8258077.534865
+185801.406393     8258065.568233
+185787.932959     8258032.864405
+185778.673559     8258018.368759
+185761.957484     8257997.539932
+185740.208101     8257979.171689
+185731.528059     8257969.694155
+185714.127465     8257955.124374
+185700.455013     8257943.721756
+185684.283625     8257931.669969
+185665.718086     8257907.691087
+185654.544949     8257896.938024
+185640.843289     8257888.667589
+185628.985249     8257884.173951
+185610.308705     8257872.098969
+185595.395740     8257859.431846
+185579.844610     8257848.012121
+185568.624357     8257842.270699
+185555.525804     8257836.512556
+185539.927936     8257830.104858
+185521.859965     8257819.915041
+185507.491306     8257816.024954
+185486.889347     8257808.944893
+185463.191177     8257798.077775
+185443.812204     8257794.141682
+185431.322223     8257790.268703
+185416.924357     8257789.510799
+185393.793864     8257784.914513
+185362.528024     8257779.616968
+185343.775527     8257775.686961
+185316.273267     8257769.797274
+185293.142774     8257765.200988
+185266.840129     8257764.961474
+185241.801750     8257763.480263
+185223.049257     8257759.549875
+185202.418082     8257755.602761
+185179.914074     8257751.011798
+185152.405587     8257745.748850
+185126.143839     8257741.123668
+185105.489297     8257739.682377
+185087.415481     8257730.119302
+185072.449935     8257723.090949
+185052.497441     8257713.510766
+185026.340854     8257697.608426
+184992.698764     8257678.505092
+184970.287848     8257663.890069
+184955.351516     8257653.728769
+184943.540217     8257644.222721
+184929.867765     8257632.820103
+184918.091900     8257619.555133
+184893.228788     8257599.278532
+184867.048830     8257585.882397
+184846.540345     8257568.778280
+184828.501585     8257555.455898
+184809.280732     8257534.604262
+184787.519668     8257517.488740
+184758.892973     8257497.804662
+184734.609605     8257482.545794
+184720.902097     8257474.902483
+184699.082610     8257464.052091
+184684.760692     8257455.149594
+184671.064870     8257446.253181
+184656.748793     8257436.724324
+184639.939242     8257425.919553
+184619.413231     8257410.694899
+184600.168625     8257392.349465
+184579.660140     8257375.245348
+184559.754384     8257360.653138
+184535.453490     8257347.273732
+184498.006923     8257333.148207
+184468.063385     8257320.344214
+184446.876220     8257308.873166
+184429.446411     8257297.436333
+184411.395966     8257285.367053
+184389.582319     8257273.890300
+184367.739461     8257265.546113
+184347.757756     8257259.098496
+184329.666605     8257251.414885
+184303.480997     8257238.645112
+184263.511742     8257226.376619
+184233.539374     8257216.705195
+184211.690676     8257208.987368
+184186.710719     8257201.241027
+184156.738352     8257191.569603
+184113.579419     8257185.537345
+184086.709098     8257179.026999
+184064.257477     8257168.797646
+184049.906348     8257163.027714
+184024.300098     8257155.276053
+183990.552656     8257147.449874
+183966.198989     8257139.709236
+183948.716411     8257133.910790
+183930.590205     8257129.986486
+183910.555917     8257129.177639
+183888.051908     8257124.586676
+183868.638070     8257124.409891
+183850.488496     8257122.991411
+183831.712633     8257121.567227
+183812.960137     8257117.637221
+183797.935789     8257116.873612
+183784.790499     8257116.127497
+183769.134209     8257115.984929
+183749.099921     8257115.176082
+183734.069921     8257115.039218
+183710.898534     8257114.828217
+183698.373502     8257114.714163
+183685.848469     8257114.600109
+183667.060921     8257114.429028
+183652.025079     8257114.918523
+183626.975015     8257114.690415
+183609.445887     8257113.904380
+183594.456591     8257109.381846
+183575.744992     8257101.066172
+183557.000000     8257092.907279
+END
+LINE3D-MASTER
+HEIGHT 1050.000000
+183557.000000     8256961.170905
+183567.027948     8256961.262221
+183593.330401     8256961.501733
+183628.400530     8256961.821085
+183657.213984     8256961.457050
+183676.627822     8256961.633834
+183700.431148     8256961.224176
+183724.866608     8256960.193478
+183746.797100     8256959.139970
+183767.475204     8256958.075058
+183783.763434     8256957.596967
+183801.304438     8256957.129901
+183823.861216     8256956.082479
+183853.921218     8256956.356208
+183890.881710     8256955.439564
+183924.710945     8256954.494407
+183952.277854     8256953.492225
+183975.489946     8256949.317556
+184001.798431     8256948.930711
+184030.646941     8256944.807368
+184044.471099     8256939.920798
+184056.996132     8256940.034852
+184074.583873     8256934.555759
+184096.543573     8256930.370068
+184116.636092     8256924.913784
+184139.216241     8256921.360156
+184159.929209     8256916.535935
+184172.512664     8256910.384859
+184185.710724     8256905.492588
+184205.791749     8256901.289407
+184230.268102     8256895.873425
+184260.913496     8256900.538525
+184291.564735     8256904.576882
+184317.773905     8256914.840451
+184349.712776     8256915.131290
+184384.150770     8256916.071681
+184419.846998     8256916.396734
+184444.862011     8256920.383767
+184473.611392     8256926.911224
+184507.996808     8256933.490003
+184546.759836     8256940.735440
+184574.244955     8256948.504211
+184600.489177     8256955.008855
+184624.871864     8256959.616926
+184651.174509     8256959.856440
+184674.942782     8256963.205707
+184699.325852     8256967.813782
+184720.612719     8256968.634035
+184739.388582     8256970.058219
+184756.923551     8256970.217894
+184772.579842     8256970.360461
+184795.751228     8256970.571462
+184815.164875     8256970.748244
+184830.195067     8256970.885111
+184848.321079     8256974.809795
+184865.803470     8256980.607857
+184886.996858     8256991.452548
+184913.808756     8257004.228024
+184932.473618     8257017.555726
+184946.795536     8257026.458223
+184959.203723     8257039.102537
+184979.127006     8257051.815285
+184991.611142     8257056.315006
+185015.373574     8257060.290634
+185045.984108     8257068.714660
+185077.887732     8257072.764804
+185105.367007     8257081.160317
+185134.162743     8257082.675743
+185158.557498     8257086.030715
+185174.202103     8257087.426385
+185189.191402     8257091.948536
+185204.812637     8257095.850412
+185228.528332     8257104.838066
+185242.259203     8257109.975937
+185254.099332     8257116.349416
+185275.948034     8257124.066861
+185293.377839     8257135.504076
+185308.958181     8257143.791237
+185321.413106     8257151.423524
+185335.747094     8257159.072539
+185351.982742     8257164.233218
+185373.848971     8257170.071200
+185397.014513     8257170.908943
+185415.169739     8257171.700680
+185427.694772     8257171.814734
+185440.231490     8257170.675685
+185453.423899     8257166.409777
+185465.948932     8257166.523831
+185487.826842     8257171.109093
+185502.160445     8257178.758487
+185527.122875     8257188.384290
+185544.593581     8257195.435456
+185562.064283     8257202.487003
+185576.427479     8257207.003836
+185593.289229     8257212.169834
+185611.433153     8257214.214676
+185635.833749     8257216.943288
+185657.746715     8257217.769243
+185677.786461     8257217.951726
+185693.442751     8257218.094294
+185715.999724     8257217.046491
+185730.403435     8257217.177652
+185744.151836     8257220.435678
+185764.783007     8257224.383174
+185789.774649     8257230.876412
+185812.255291     8257237.973198
+185835.988895     8257245.081394
+185864.088424     8257254.109351
+185890.958745     8257260.619697
+185911.619131     8257261.434245
+185927.240366     8257265.336120
+185944.769494     8257266.122155
+185964.177679     8257266.925684
+185986.722584     8257267.130980
+186013.651327     8257267.376195
+186034.955721     8257266.316986
+186051.279006     8257262.079587
+186071.319135     8257262.262074
+186092.611843     8257262.455968
+186115.782847     8257262.666965
+186137.689968     8257264.119662
+186162.740033     8257264.347770
+186184.032741     8257264.541663
+186205.951548     8257264.741258
+186224.124683     8257263.653535
+186242.958969     8257258.812589
+186261.125881     8257258.351223
+186278.046433     8257257.252476
+186304.354922     8257256.865248
+186323.768569     8257257.042030
+186348.192535     8257257.264437
+186375.121278     8257257.509653
+186408.939018     8257257.817600
+186425.847506     8257257.971570
+186441.538849     8257254.355213
+186459.109256     8257250.755583
+186476.017744     8257250.909554
+186493.553095     8257251.069232
+186512.966742     8257251.246014
+186536.764227     8257251.462716
+186554.919833     8257252.254839
+186575.551008     8257256.201952
+186589.919663     8257260.092421
+186603.059494     8257261.464900
+186618.089304     8257261.601763
+186642.513270     8257261.824170
+186666.310755     8257262.040872
+186684.478046     8257261.579892
+186698.934338     8257256.072283
+186717.762780     8257251.858079
+186732.798434     8257251.368199
+186747.863678     8257247.746140
+186765.398647     8257247.905815
+186781.054937     8257248.048383
+186796.085129     8257248.185249
+186811.741420     8257248.327817
+186829.890802     8257249.746296
+186850.545730     8257251.187208
+186867.448373     8257251.967920
+186883.731145     8257252.116193
+186900.013534     8257252.264462
+186912.544411     8257251.751773
+186935.797587     8257243.191821
+186958.435970     8257233.372679
+186970.381642     8257228.469004
+186986.090510     8257222.973184
+187003.666376     8257218.747191
+187023.764927     8257212.664548
+187042.634269     8257204.064294
+187061.474396     8257198.596988
+187075.930688     8257193.089379
+187099.148812     8257188.288352
+187119.855936     8257184.090873
+187149.950989     8257180.605677
+187170.652654     8257177.034561
+187186.320630     8257175.924026
+187199.506813     8257172.284856
+187224.562719     8257171.886604
+187240.845108     8257172.034873
+187270.852913     8257177.946994
+187292.110183     8257181.900191
+187305.876114     8257183.278371
+187333.390441     8257187.914959
+187355.274192     8257191.873861
+187379.662724     8257195.855190
+187408.464687     8257196.743876
+187429.130914     8257196.932065
+187447.327034     8257193.338516
+187464.868226     8257192.871834
+187482.438250     8257189.272202
+187501.857738     8257188.822624
+187531.929425     8257187.843251
+187557.646867     8257183.691396
+187584.587296     8257182.683509
+187617.157915     8257182.353687
+187648.470496     8257182.638822
+187664.115101     8257184.034492
+187675.967297     8257189.154872
+187692.179579     8257196.821374
+187710.259239     8257205.757707
+187726.459835     8257214.677311
+187743.919237     8257222.981582
+187763.894716     8257230.055938
+187783.233179     8257238.377320
+187800.674291     8257248.561047
+187814.961538     8257261.222473
+187838.583373     8257280.234562
+187858.507038     8257292.947313
+187879.032667     8257308.171963
+187898.962176     8257320.257972
+187914.542515     8257328.545515
+187925.721110     8257338.672215
+187938.802898     8257346.310210
+187953.727165     8257357.724227
+187965.532624     8257367.856635
+187981.739060     8257376.149879
+188001.651044     8257390.115350
+188012.232748     8257397.104166
+188029.083578     8257403.523274
+188040.262174     8257413.649974
+188052.020891     8257428.794792
+188060.068993     8257438.892985
+188073.056542     8257456.555029
+188081.730739     8257466.659306
+188091.025194     8257477.395644
+188108.396197     8257495.097604
+188118.322595     8257505.212901
+188126.370694     8257515.311476
+188143.103914     8257534.260837
+188156.133123     8257547.537220
+188164.168775     8257558.888509
+188178.350863     8257582.827092
+188192.532182     8257606.766051
+188202.447659     8257618.134458
+188224.150301     8257641.515111
+188240.321689     8257653.566897
+188262.141177     8257664.417290
+188283.334565     8257675.261981
+188299.541006     8257683.554843
+188312.657085     8257687.433523
+188328.933629     8257688.208535
+188345.837041     8257688.988872
+188365.250688     8257689.165654
+188388.427533     8257688.750291
+188414.144593     8257684.598433
+188433.594057     8257681.016297
+188448.658540     8257677.393849
+188464.355728     8257673.150749
+188478.765661     8257672.655554
+188498.190994     8257671.579234
+188524.494021     8257671.818751
+188545.154021     8257672.633679
+188560.172531     8257674.023265
+188583.888605     8257683.011306
+188596.337689     8257691.269953
+188607.533811     8257699.517190
+188621.171589     8257714.679119
+188641.129542     8257723.632938
+188662.346301     8257731.971424
+188677.967539     8257735.872917
+188692.945149     8257741.648554
+188706.687327     8257745.532935
+188719.200674     8257746.900092
+188734.230866     8257747.036958
+188754.896710     8257747.225143
+188776.821358     8257746.798378
+188790.611037     8257745.670739
+188811.323620     8257740.846896
+188823.889549     8257736.575283
+188837.708440     8257732.315079
+188853.411468     8257727.445619
+188874.762598     8257721.374382
+188903.019870     8257713.486410
+188926.301879     8257701.793507
+188945.194587     8257690.687431
+188965.937145     8257682.731030
+188989.201628     8257672.917589
+189009.288112     8257668.088045
+189034.384914     8257663.304126
+189055.086579     8257659.733010
+189073.253869     8257659.272030
+189088.945212     8257655.655672
+189102.734127     8257654.528026
+189129.745046     8257646.001910
+189155.502999     8257637.464767
+189171.229398     8257630.089101
+189185.047524     8257625.828891
+189208.336138     8257613.509634
+189222.792049     8257608.002022
+189239.818146     8257595.625739
+189255.585438     8257583.864788
+189270.047189     8257577.730816
+189285.176700     8257567.216885
+189298.380413     8257561.697870
+189310.905446     8257561.811924
+189324.057341     8257561.931686
+189339.713632     8257562.074254
+189353.479176     8257563.452813
+189377.891457     8257564.928322
+189406.657982     8257569.576313
+189438.555765     8257574.252817
+189459.848473     8257574.446710
+189478.647707     8257573.364689
+189501.239350     8257568.557957
+189530.146091     8257558.169482
+189549.613084     8257552.707501
+189564.718461     8257544.699768
+189589.867845     8257534.277078
+189610.598717     8257527.573780
+189631.341275     8257519.617379
+189658.977528     8257511.096957
+189678.467889     8257503.129154
+189692.953011     8257494.488977
+189706.818639     8257485.216745
+189723.188662     8257475.967318
+189741.496169     8257460.469873
+189764.198817     8257443.759241
+189788.106920     8257432.072421
+189805.138863     8257419.069395
+189824.698567     8257403.583352
+189844.240741     8257389.977154
+189863.812131     8257373.238008
+189886.492172     8257359.033588
+189909.224031     8257339.190391
+189923.205740     8257317.387892
+189937.141477     8257300.597428
+189950.473717     8257281.295432
+189965.017261     8257266.390125
+189980.784556     8257254.628792
+189993.408904     8257244.092431
+190006.039101     8257232.928944
+190019.928096     8257221.150890
+190032.605029     8257204.975376
+190045.270274     8257190.053347
+190055.430363     8257175.108124
+190064.367463     8257157.019315
+190073.901453     8257142.068390
+190084.763589     8257118.984275
+190091.821628     8257100.878355
+190094.484529     8257083.985239
+190094.648112     8257066.442951
+190095.478690     8257044.520696
+190095.659803     8257025.098563
+190095.208972     8257006.297471
+END
+LINE3D
+HEIGHT 1040.000000
+186139.767052     8258937.000000
+186161.018099     8258926.612199
+186178.014603     8258917.368477
+186190.592218     8258911.843761
+186208.841301     8258902.611446
+186223.941215     8258895.230458
+186242.793028     8258888.510049
+186264.822839     8258876.805743
+186283.071923     8258867.573428
+186297.545745     8258860.185974
+186312.681093     8258849.046065
+186332.205745     8258837.318947
+186353.591928     8258827.488785
+186372.490481     8258815.755965
+186392.015133     8258804.028847
+186404.621959     8258795.371566
+186415.367629     8258784.818097
+186427.980295     8258775.534456
+186441.236590     8258764.376671
+186450.712150     8258755.691641
+186462.757141     8258740.137168
+186476.019277     8258728.353024
+186489.919575     8258715.321863
+186509.455916     8258702.341260
+186521.495058     8258687.413912
+186531.637625     8258674.347769
+186544.308714     8258658.798997
+186559.496644     8258642.020318
+186572.735409     8258632.742378
+186583.457716     8258624.694350
+186594.180015     8258616.647086
+186605.522579     8258609.231119
+186626.978866     8258591.883106
+186643.987059     8258581.385900
+186657.945398     8258562.089606
+186671.272180     8258543.413974
+186680.138789     8258532.843394
+186685.265953     8258520.358758
+186692.874145     8258510.402750
+186703.695767     8258491.704306
+186712.627026     8258474.241857
+186720.879225     8258462.412091
+186727.287798     8258446.806293
+186731.829374     8258429.930667
+186736.335902     8258416.813583
+186736.470273     8258402.403860
+186735.340380     8258389.235834
+186726.034240     8258379.752598
+186716.763155     8258366.510055
+186702.441234     8258357.607940
+186691.911726     8258344.980733
+186678.894587     8258330.450869
+186662.752410     8258315.266517
+186653.463796     8258303.903819
+186640.365247     8258298.145293
+186626.007892     8258293.002100
+186610.972241     8258293.491598
+186602.070194     8258307.821481
+186590.002215     8258325.882163
+186577.348652     8258339.551472
+186563.518462     8258345.064399
+186551.040167     8258339.938317
+186540.522344     8258326.058008
+186533.844049     8258303.440964
+186514.031771     8258278.824316
+186502.852793     8258268.697612
+186484.843241     8258252.243047
+186474.893476     8258244.633572
+186458.715864     8258233.208142
+186449.415569     8258223.098164
+186439.495015     8258212.356124
+186418.418468     8258188.981555
+186403.558086     8258170.675662
+186385.501796     8258159.233124
+186363.582990     8258159.033529
+186347.259704     8258163.270928
+186325.955314     8258164.329755
+186305.283243     8258164.768309
+186289.673690     8258159.613714
+186278.453819     8258153.872296
+186262.873477     8258145.585135
+186251.653224     8258139.843714
+186238.642305     8258124.687875
+186227.463331     8258114.560789
+186215.652032     8258105.054741
+186203.882011     8258091.163029
+186197.092329     8258080.449882
+186186.556980     8258068.449035
+186170.964953     8258061.414977
+186159.803505     8258049.408429
+186144.246534     8258038.615063
+186126.184786     8258027.798889
+186110.668707     8258012.620239
+186092.033060     8257996.159589
+186077.710757     8257987.257472
+186056.482698     8257980.171709
+186044.630502     8257975.051329
+186029.682482     8257966.143513
+186009.718306     8257957.816051
+185984.141076     8257946.931822
+185961.075236     8257935.443285
+185945.524105     8257924.023559
+185929.949605     8257915.110039
+185914.989521     8257907.454940
+185899.391653     8257901.047242
+185876.319586     8257890.185444
+185858.240312     8257881.248732
+185835.788499     8257871.019377
+185820.869694     8257858.978614
+185802.181461     8257848.157118
+185784.125175     8257836.714198
+185771.055834     8257827.823489
+185757.324959     8257822.686001
+185743.617455     8257815.042309
+185728.089695     8257801.116378
+185709.477415     8257782.149906
+185694.599121     8257765.723854
+185684.052468     8257754.976113
+185662.905817     8257739.119395
+185650.445052     8257732.113468
+185636.111445     8257724.464456
+185610.510852     8257716.085668
+185591.178994     8257707.137933
+185566.866033     8257695.011626
+185543.144497     8257686.650331
+185518.779335     8257680.162797
+185488.759848     8257675.503397
+185461.877843     8257670.246154
+185437.506841     8257664.384980
+185415.008291     8257659.167653
+185389.384705     8257653.295456
+185365.639802     8257647.439984
+185346.260825     8257643.504273
+185330.019332     8257638.970336
+185316.247565     8257638.218134
+185302.510846     8257633.707388
+185286.269353     8257629.173452
+185264.397284     8257623.961830
+185236.303595     8257614.307513
+185209.444960     8257606.544064
+185189.480780     8257598.216984
+185170.780866     8257588.648208
+185148.949693     8257579.050918
+185117.736431     8257568.114985
+185090.953745     8257552.206944
+185061.109526     8257528.752153
+185031.248164     8257507.176828
+184995.738695     8257486.803663
+184970.208588     8257470.907028
+184954.663302     8257458.860560
+184941.611490     8257448.090007
+184929.168248     8257439.205000
+184914.266587     8257425.284771
+184898.112728     8257411.353139
+184878.827229     8257397.392990
+184861.450002     8257380.317387
+184840.315033     8257363.207948
+184821.035761     8257348.621060
+184804.255418     8257334.684106
+184789.968552     8257322.022684
+184778.789578     8257311.895598
+184760.107190     8257300.447359
+184739.598705     8257283.343243
+184722.806680     8257270.659009
+184708.508129     8257259.250689
+184687.379004     8257241.514508
+184671.213460     8257228.835979
+184653.186382     8257214.260876
+184631.390265     8257200.904278
+184615.207195     8257190.105212
+184598.409326     8257178.047720
+184582.266771     8257162.862982
+184569.238326     8257149.586606
+184554.922249     8257140.057750
+184534.425449     8257121.700531
+184522.573253     8257116.580150
+184510.124170     8257108.321503
+184498.266133     8257103.827483
+184478.308180     8257094.873664
+184464.583146     8257089.109816
+184447.732699     8257082.690712
+184433.439992     8257070.655650
+184424.128008     8257061.799157
+184424.250698     8257048.642154
+184426.872320     8257036.134702
+184441.323151     8257031.253840
+184458.875646     8257029.534052
+184480.173816     8257029.101199
+184493.951428     8257029.226659
+184512.107033     8257030.018782
+184530.836159     8257036.454993
+184547.083496     8257040.362187
+184560.814371     8257045.499675
+184575.171341     8257050.643246
+184587.029381     8257055.136884
+184605.172919     8257057.182106
+184623.322687     8257058.600206
+184646.459018     8257062.570514
+184663.958935     8257066.489114
+184688.312793     8257074.229754
+184706.989337     8257086.304735
+184726.286139     8257099.011778
+184741.884006     8257105.419476
+184762.474285     8257113.752257
+184789.332920     8257121.515705
+184811.819785     8257127.986135
+184830.572281     8257131.916141
+184848.095565     8257133.328919
+184864.342902     8257137.236113
+184884.371345     8257138.671702
+184918.072240     8257151.509910
+184938.621621     8257164.228359
+184959.779958     8257178.831975
+184981.593604     8257190.308728
+185005.917869     8257201.181929
+185034.649724     8257209.588848
+185053.402217     8257213.519237
+185069.655394     8257216.800071
+185088.407891     8257220.730077
+185109.033221     8257225.303933
+185122.729040     8257234.200729
+185138.321067     8257241.234787
+185151.390405     8257250.125877
+185163.184178     8257261.511388
+185178.091684     8257274.804875
+185193.601917     8257290.610268
+185211.020041     8257303.300203
+185227.858803     8257310.972409
+185247.243239     8257314.281757
+185271.005672     8257318.257384
+185294.142003     8257322.227692
+185319.777269     8257326.847169
+185345.395393     8257333.346113
+185376.632025     8257341.775841
+185406.627762     8257348.941060
+185429.102560     8257356.664588
+185449.728272     8257361.238448
+185469.692070     8257369.565525
+185489.697146     8257373.506937
+185515.953049     8257378.758861
+185539.662900     8257388.373259
+185558.409556     8257392.929625
+185576.571006     8257393.095005
+185594.105975     8257393.254680
+185615.357786     8257397.834241
+185637.218170     8257404.298965
+185658.434547     8257412.637448
+185678.357830     8257425.350196
+185697.683843     8257434.924673
+185715.178297     8257439.470019
+185730.834588     8257439.612587
+185750.868489     8257440.421813
+185779.670452     8257441.310500
+185804.053140     8257445.918571
+185829.688789     8257450.538051
+185859.684526     8257457.703271
+185897.183675     8257466.190025
+185928.420307     8257474.619753
+185952.176895     8257479.222123
+185972.831437     8257480.663414
+185994.738559     8257482.116111
+186023.511310     8257486.137363
+186049.773058     8257490.762545
+186075.402484     8257496.008382
+186099.756342     8257503.749021
+186130.372334     8257511.546684
+186159.110030     8257519.327244
+186182.843252     8257526.435436
+186207.834894     8257532.928674
+186232.200055     8257539.416208
+186265.976899     8257544.109823
+186295.375749     8257548.136776
+186321.637497     8257552.761957
+186345.394085     8257557.364327
+186372.908031     8257562.000912
+186409.184193     8257567.343699
+186434.169994     8257574.463297
+186457.932423     8257578.439307
+186475.455711     8257579.851702
+186491.106157     8257580.621012
+186509.267607     8257580.786392
+186525.549996     8257580.934661
+186538.086713     8257579.795612
+186555.054006     8257573.684456
+186570.716138     8257573.200663
+186588.929787     8257567.727269
+186616.525908     8257563.592522
+186630.941304     8257562.470581
+186644.730598     8257561.343321
+186659.766634     8257560.853445
+186682.955164     8257559.184979
+186697.359257     8257559.316144
+186717.399003     8257559.498628
+186741.782073     8257564.106702
+186774.306337     8257568.788911
+186798.694868     8257572.770240
+186817.470732     8257574.194423
+186833.127022     8257574.336991
+186848.789157     8257573.852816
+186870.122758     8257569.661424
+186894.593465     8257564.871421
+186914.053850     8257560.036176
+186930.347924     8257558.931342
+186943.552016     8257553.412713
+186964.311722     8257543.576464
+186988.829163     8257533.774815
+187004.526350     8257529.531715
+187018.965113     8257525.903952
+187030.904561     8257521.626633
+187051.049849     8257510.531962
+187066.138464     8257504.403699
+187079.359703     8257497.005221
+187090.690578     8257490.842739
+187107.049298     8257482.846418
+187124.677746     8257472.981656
+187145.419922     8257465.025251
+187157.985851     8257460.753638
+187170.569306     8257454.602562
+187181.894337     8257449.066822
+187197.649947     8257438.558592
+187222.085598     8257437.527896
+187235.236729     8257437.647651
+187247.755917     8257438.388448
+187263.991951     8257443.548748
+187282.153019     8257443.714124
+187306.588670     8257442.683428
+187319.739801     8257442.803184
+187334.143894     8257442.934349
+187349.173704     8257443.071212
+187361.687051     8257444.438368
+187377.934770     8257448.345566
+187404.828457     8257452.350089
+187424.827693     8257456.917861
+187443.574345     8257461.474610
+187461.062576     8257466.646313
+187482.905430     8257474.990882
+187502.898821     8257480.185397
+187527.281508     8257484.793468
+187544.155326     8257488.706367
+187557.265561     8257493.211790
+187575.983001     8257500.901104
+187597.199761     8257509.239590
+187615.911360     8257517.555264
+187635.289955     8257521.490971
+187650.905349     8257526.019207
+187664.613236     8257533.662903
+187685.203132     8257541.995681
+187703.282788     8257550.932396
+187717.570036     8257563.593821
+187733.747265     8257575.019248
+187747.407649     8257587.674965
+187765.452254     8257600.370605
+187784.134642     8257611.818844
+187795.319843     8257621.319191
+187806.515965     8257629.566428
+187815.810420     8257640.302767
+187828.224447     8257652.320721
+187839.959798     8257669.971362
+187849.230886     8257683.213523
+187857.249773     8257696.444664
+187865.882313     8257710.934219
+187874.562354     8257720.411754
+187885.092245     8257733.038964
+187897.488747     8257746.936381
+187911.119920     8257762.724663
+187924.130839     8257777.880502
+187932.799195     8257788.611139
+187942.105335     8257798.094375
+187952.020048     8257809.462775
+187962.520727     8257825.222550
+187973.084906     8257834.090829
+187997.403712     8257845.590393
+188020.522134     8257851.440161
+188037.396334     8257855.353063
+188049.909681     8257856.720220
+188077.417403     8257861.983161
+188091.154501     8257866.494292
+188108.027937     8257870.407187
+188126.774589     8257874.963936
+188149.272757     8257880.181260
+188166.141113     8257884.720904
+188182.991178     8257891.140005
+188198.577360     8257898.800805
+188209.159833     8257905.789245
+188220.970368     8257915.295287
+188240.841451     8257933.646808
+188255.725586     8257949.446500
+188273.131642     8257963.389534
+188285.569041     8257972.901283
+188302.384818     8257983.079316
+188318.591258     8257991.372178
+188339.216207     8257995.946030
+188362.341238     8258001.169062
+188375.486524     8258001.915560
+188394.274073     8258002.086641
+188412.435523     8258002.252021
+188425.621710     8257998.612469
+188445.047039     8257997.536531
+188469.517746     8257992.746528
+188483.933521     8257991.624973
+188497.722436     8257990.497327
+188510.885252     8257989.363980
+188523.416125     8257988.851674
+188537.217490     8257986.470932
+188558.526960     8257984.785356
+188582.950926     8257985.007763
+188598.572164     8257988.909255
+188616.727770     8257989.701378
+188634.228068     8257993.619981
+188648.631397     8257993.751139
+188668.033359     8257995.181024
+188686.177283     8257997.225867
+188699.322573     8257997.971982
+188724.331741     8258002.585758
+188739.952976     8258006.487633
+188755.609267     8258006.630200
+188768.128458     8258007.370615
+188792.552424     8258007.593021
+188806.330418     8258007.718485
+188822.653704     8258003.481086
+188837.683896     8258003.617953
+188850.214769     8258003.105647
+188865.279252     8257999.483198
+188880.321126     8257998.367344
+188894.134176     8257994.733500
+188910.422406     8257994.255409
+188924.211321     8257993.127763
+188937.397504     8257989.488594
+188951.848338     8257984.607349
+188976.342409     8257977.311905
+188993.917892     8257973.085909
+189017.171454     8257964.525578
+189036.684421     8257954.051562
+189054.921819     8257946.072349
+189071.274316     8257938.702386
+189086.374613     8257931.321401
+189100.818838     8257927.066892
+189116.533551     8257920.944329
+189134.741738     8257916.097681
+189152.979141     8257908.118086
+189165.556751     8257902.593752
+189181.265624     8257897.097550
+189194.457651     8257892.831637
+189220.807416     8257888.059127
+189233.993599     8257884.419958
+189262.256715     8257875.905244
+189280.424006     8257875.444264
+189296.718080     8257874.339430
+189313.041366     8257870.102031
+189332.490066     8257866.519888
+189351.318511     8257862.305302
+189367.009853     8257858.688944
+189390.228363     8257853.887538
+189412.182222     8257850.328208
+189427.258387     8257845.453039
+189444.834634     8257841.227050
+189461.848283     8257830.103863
+189476.948582     8257822.722496
+189494.524830     8257818.496507
+189515.858435     8257814.304733
+189542.839374     8257808.911557
+189567.350974     8257799.736268
+189588.690419     8257794.918134
+189612.563475     8257786.989857
+189637.069230     8257778.441311
+189667.796609     8257774.335078
+189691.055247     8257765.148379
+189715.549321     8257757.852554
+189738.152650     8257751.792719
+189758.239898     8257746.963182
+189771.490348     8257736.432140
+189786.602329     8257727.798053
+189806.115296     8257717.324038
+189824.399436     8257704.332415
+189842.636834     8257696.353202
+189858.386600     8257686.471714
+189880.387200     8257677.899973
+189896.716326     8257673.036214
+189913.004557     8257672.558123
+189939.359401     8257667.158864
+189955.056588     8257662.915764
+189973.223878     8257662.454783
+189991.432066     8257657.608136
+190013.350872     8257657.807730
+190037.189636     8257653.638768
+190060.360641     8257653.849765
+190084.825503     8257649.686504
+190101.739832     8257649.214115
+190119.310239     8257645.614485
+190143.148238     8257641.445516
+190161.362267     8257635.972508
+190178.950200     8257630.493417
+190193.376895     8257628.118752
+190207.827729     8257623.237507
+190220.469607     8257610.821301
+190232.462016     8257600.905598
+190245.133105     8257585.356826
+190256.539547     8257571.049748
+190269.849184     8257554.253582
+190278.101001     8257542.423813
+190291.444927     8257521.868715
+190295.945992     8257509.378378
+190299.246674     8257491.238243
+190300.650773     8257474.960078
+190304.630135     8257451.186874
+190305.432266     8257432.397192
+190305.566638     8257417.987469
+190305.706854     8257402.951003
+190307.146005     8257382.913913
+190308.567626     8257364.756667
+190311.283109     8257342.224781
+190314.554580     8257327.217212
+190319.114068     8257308.461744
+190324.252153     8257294.723999
+190331.286825     8257279.123901
+190335.822942     8257262.874639
+190336.653520     8257240.952384
+190330.519535     8257227.111994
+190323.753610     8257213.892263
+190313.862264     8257200.018041
+190308.430326     8257178.038759
+190307.364317     8257157.978857
+190308.804233     8257137.941773
+190313.322060     8257123.571966
+190308.458562     8257107.863523
+190302.938990     8257095.281937
+190290.571700     8257078.251955
+190276.898866     8257066.849333
+190261.951232     8257057.941139
+190252.680144     8257044.698978
+190247.148887     8257033.370494
+190244.134474     8257020.811720
+190241.775371     8257005.126083
+END
+LINE3D
+HEIGHT 1020.000000
+191271.566073     8258937.000000
+191273.454688     8258936.198941
+191287.917204     8258930.064976
+191308.003684     8258925.235814
+191331.298146     8258912.289433
+191347.047912     8258902.407946
+191373.431967     8258893.876121
+191399.201605     8258884.085875
+191423.098789     8258873.652165
+191439.498023     8258861.270174
+191457.782159     8258848.278933
+191473.549454     8258836.517600
+191492.418796     8258827.917346
+191507.507411     8258821.789082
+191527.640632     8258811.947510
+191542.144048     8258801.427495
+191557.887972     8258792.172367
+191575.562768     8258777.296338
+191583.809508     8258766.092936
+191597.686054     8258755.567977
+191609.081582     8258742.513243
+191622.981498     8258729.482079
+191639.404103     8258714.593883
+191657.699921     8258700.349922
+191670.967898     8258687.939417
+191681.105381     8258675.500405
+191695.040356     8258658.709551
+191707.032765     8258648.793849
+191722.144750     8258640.159380
+191732.925090     8258625.846982
+191745.016821     8258605.280100
+191757.787226     8258579.080913
+191766.689277     8258564.750646
+191782.573414     8258540.459436
+191789.596400     8258526.112441
+191799.124549     8258511.787876
+191806.738579     8258501.205890
+191815.605574     8258490.634932
+191827.615512     8258478.839384
+191845.911333     8258464.595041
+191858.529841     8258454.685040
+191871.774450     8258444.780357
+191881.255859     8258435.468202
+191893.324216     8258417.407907
+191911.689381     8258395.645324
+191921.891131     8258376.314440
+191930.277320     8258350.074947
+191934.186574     8258333.819977
+191935.620645     8258314.409635
+191940.138476     8258300.039446
+191944.686278     8258282.537081
+191948.607218     8258265.029008
+191952.580740     8258241.882164
+191958.971787     8258228.155829
+191964.818524     8258205.652838
+191971.221257     8258190.673400
+191975.739084     8258176.303593
+191983.394774     8258161.335947
+191987.924287     8258145.713037
+192001.314953     8258120.145529
+192014.623826     8258103.349357
+192027.910093     8258089.059396
+192043.654018     8258079.804268
+192058.098243     8258075.549759
+192071.928816     8258070.036835
+192093.220759     8258070.230721
+192117.703148     8258064.187997
+192131.545409     8258057.421588
+192156.677264     8258048.878744
+192176.178545     8258039.657831
+192197.570572     8258029.200926
+192209.591428     8258016.152652
+192224.270108     8257986.837628
+192231.971775     8257966.857565
+192245.345677     8257943.169909
+192255.459028     8257933.236713
+192276.270930     8257917.762072
+192289.522141     8257907.231419
+192300.876005     8257898.562728
+192314.747474     8257888.664136
+192333.610975     8257880.690242
+192358.034177     8257880.912642
+192386.233026     8257879.289801
+192410.692044     8257875.753283
+192426.389231     8257871.510183
+192438.966845     8257865.985467
+192456.057207     8257846.717693
+192466.790812     8257837.416941
+192479.368427     8257831.892225
+192493.209920     8257825.126191
+192514.520154     8257823.440622
+192531.435251     8257822.967857
+192546.476360     8257821.851996
+192562.144336     8257820.741461
+192575.331287     8257817.101916
+192589.155254     8257812.215345
+192602.358964     8257806.696712
+192615.545151     8257803.057160
+192634.385278     8257797.589854
+192653.178671     8257797.134192
+192673.886176     8257792.936717
+192688.928050     8257791.820863
+192706.497692     8257788.221227
+192719.661273     8257787.087886
+192735.323404     8257786.604094
+192748.474536     8257786.723849
+192767.888183     8257786.900632
+192786.049633     8257787.066011
+192799.838548     8257785.938366
+192817.414796     8257781.712376
+192834.364177     8257777.481061
+192855.083368     8257772.030483
+192874.602175     8257760.930108
+192899.125461     8257750.501717
+192917.432967     8257735.004271
+192932.579240     8257722.610870
+192952.098812     8257711.510501
+192964.043719     8257706.606819
+192986.108582     8257691.143589
+192998.071783     8257684.360069
+193017.561379     8257676.392258
+193043.355152     8257664.095814
+193067.274941     8257651.155892
+193081.795880     8257638.756797
+193093.794133     8257628.214352
+193104.539424     8257617.660497
+193114.061729     8257603.962675
+193130.484331     8257589.074860
+193155.101094     8257568.622032
+193179.085912     8257548.790626
+193196.128775     8257534.534491
+193207.530137     8257520.854162
+193218.919053     8257508.426546
+193236.009418     8257489.158390
+193250.623067     8257466.735232
+193265.793474     8257451.835633
+193282.227761     8257435.694716
+193296.772070     8257420.789416
+193310.683671     8257406.505150
+193323.998385     8257389.082617
+193336.014165     8257376.660709
+193344.295957     8257361.698382
+193353.794892     8257350.506764
+193368.930244     8257339.366473
+193382.841845     8257325.082206
+193404.251399     8257312.745839
+193423.776050     8257301.018721
+193440.789699     8257289.895534
+193460.297589     8257280.047885
+193476.679294     8257269.545739
+193493.031791     8257262.175775
+193514.417977     8257252.345230
+193533.299001     8257242.492256
+193556.545954     8257234.558660
+193572.869240     8257230.321262
+193584.814911     8257225.417587
+193599.845103     8257225.554453
+193616.127492     8257225.702722
+193633.042589     8257225.229957
+193658.092653     8257225.458065
+193677.506301     8257225.634847
+193690.037174     8257225.122541
+193703.849456     8257221.489073
+193716.415385     8257217.217459
+193727.758328     8257209.801878
+193742.208394     8257204.921008
+193754.803534     8257197.516829
+193769.897990     8257190.762205
+193790.634707     8257183.432165
+193805.735007     8257176.050798
+193818.944560     8257169.905423
+193833.406312     8257163.771451
+193849.742047     8257158.280957
+193863.560170     8257154.021128
+193877.372456     8257150.387277
+193891.823286     8257145.506415
+193905.600516     8257145.631871
+193918.752412     8257145.751634
+193938.797999     8257145.307757
+193958.217490     8257144.857797
+193973.908833     8257141.241440
+193987.095020     8257137.601887
+194002.166105     8257133.353468
+194016.651991     8257124.713298
+194034.245000     8257118.607839
+194049.994766     8257108.726352
+194062.566539     8257103.827996
+194090.180951     8257097.813793
+194102.746876     8257093.542561
+194127.814470     8257091.890825
+194145.986837     8257090.803477
+194159.138733     8257090.923240
+194176.041380     8257091.703570
+194189.127483     8257098.714809
+194200.986285     8257103.208836
+194213.505473     8257103.949632
+194229.781257     8257104.724254
+194246.070251     8257104.246170
+194260.509400     8257100.618028
+194274.321682     8257096.984559
+194286.846714     8257097.098613
+194309.351488     8257101.689584
+194325.001937     8257102.458511
+194343.783645     8257103.255952
+194356.308677     8257103.370006
+194371.338105     8257103.506866
+194385.162072     8257098.620295
+194398.354864     8257094.354389
+194411.569494     8257087.582648
+194425.383305     8257083.949193
+194446.681093     8257083.516337
+194467.336017     8257084.957631
+194492.999731     8257086.444536
+194515.029542     8257074.740231
+194523.908983     8257062.916559
+194536.539180     8257051.753073
+194561.020804     8257045.710342
+194574.254489     8257037.059152
+194587.504175     8257026.528102
+194596.360249     8257017.210253
+194602.118589     8257004.104951
+194603.487631     8256991.586094
+194612.425499     8256973.496909
+194621.309255     8256961.046481
+194630.200382     8256947.969707
+194642.859789     8256933.673656
+194661.705760     8256927.579606
+194681.891563     8256912.099265
+194690.155826     8256899.016782
+194696.692930     8256869.627621
+194702.509692     8256850.257189
+194707.021678     8256836.513742
+194709.029270     8256822.747490
+194717.907182     8256810.923804
+194726.159763     8256799.094042
+194737.590340     8256782.280765
+194755.867871     8256769.915877
+194774.076823     8256765.069236
+194791.623859     8256763.975812
+194807.285990     8256763.492020
+194819.828549     8256761.726611
+194834.359644     8256748.074399
+194847.001522     8256735.658193
+194857.824290     8256716.959760
+194866.069498     8256705.756726
+194874.925573     8256696.438877
+194891.962591     8256682.809484
+194907.706516     8256673.554356
+194927.220247     8256663.080348
+194940.411510     8256658.814428
+194956.120379     8256653.318608
+194973.069764     8256649.086911
+194988.737739     8256647.976376
+195001.268612     8256647.464070
+195017.000000     8256647.607321
+END
+LINE3D
+HEIGHT 1020.000000
+195017.000000     8256981.784216
+194997.494296     8256985.148664
+194971.770631     8256989.926876
+194957.981715     8256991.054522
+194945.444998     8256992.193570
+194917.181882     8257000.708284
+194897.077872     8257007.417290
+194876.956333     8257016.006142
+194862.476291     8257024.019570
+194852.385545     8257031.446554
+194845.281534     8257054.564508
+194843.875906     8257070.842659
+194843.081148     8257089.005613
+194842.273172     8257108.422038
+194842.109590     8257125.964326
+194841.355725     8257139.741995
+194841.186301     8257157.910643
+194844.796836     8257173.607676
+194849.643569     8257191.195971
+194858.856234     8257210.703263
+194859.366252     8257223.239231
+194859.816318     8257242.040316
+194859.541730     8257271.486505
+194854.367829     8257288.983168
+194849.154559     8257310.865514
+194844.570936     8257332.127179
+194838.812597     8257345.232481
+194832.984150     8257365.856015
+194821.460098     8257392.693347
+194811.270033     8257410.771129
+194801.706831     8257428.854619
+194796.573826     8257441.965615
+194795.749854     8257463.261517
+194791.156078     8257485.775916
+194787.135054     8257513.934780
+194786.883837     8257540.874764
+194786.644302     8257566.562027
+194782.710912     8257585.323196
+194781.957051     8257599.100482
+194777.357431     8257622.241624
+194768.320244     8257650.981607
+194759.395595     8257667.817320
+194751.119643     8257682.153287
+194741.644079     8257690.838700
+194720.217764     8257705.054536
+194702.583093     8257715.545656
+194680.570808     8257725.370499
+194652.921344     8257735.143627
+194625.308462     8257741.157844
+194599.538059     8257750.948083
+194575.607346     8257765.141497
+194550.452121     8257776.190546
+194519.659714     8257787.188264
+194497.022098     8257797.007030
+194482.536212     8257805.647200
+194470.560565     8257813.683433
+194456.064522     8257823.576720
+194433.888658     8257850.943469
+194416.797528     8257870.211618
+194392.146480     8257894.422997
+194370.029035     8257915.524998
+194354.865236     8257929.797861
+194344.751124     8257939.730668
+194328.948776     8257955.250926
+194319.443997     8257967.069286
+194304.876321     8257984.480409
+194289.015551     8258006.265797
+194270.041049     8258026.143209
+194252.347956     8258042.899459
+194237.184157     8258057.172322
+194220.766632     8258071.433770
+194207.487735     8258085.097384
+194191.046839     8258101.865036
+194174.613317     8258118.005960
+194162.579247     8258132.307323
+194151.177881     8258145.988035
+194141.012716     8258161.559625
+194127.738131     8258174.596866
+194117.608021     8258186.409149
+194109.998300     8258196.365143
+194101.723881     8258210.700742
+194094.079107     8258224.415662
+194083.228656     8258246.246674
+194075.567886     8258261.841070
+194064.137312     8258278.653964
+194052.093086     8258294.208444
+194042.576622     8258307.279906
+194029.296196     8258320.943507
+194010.966087     8258338.946782
+193991.956532     8258362.583120
+193976.037340     8258390.633638
+193964.004031     8258404.935391
+193953.890683     8258414.868204
+193938.059124     8258433.521027
+193926.663603     8258446.574996
+193915.894942     8258459.635056
+193900.736219     8258473.281553
+193888.691229     8258488.836025
+193879.818393     8258500.033344
+193874.697838     8258511.891245
+193870.196772     8258524.381582
+193860.060054     8258536.820600
+193854.886149     8258554.317647
+193852.253227     8258568.077822
+193849.596166     8258584.344578
+193848.771432     8258605.640090
+193847.957612     8258625.683257
+193847.788192     8258643.851523
+193848.895097     8258659.525758
+193855.040768     8258672.113045
+193863.720809     8258681.590580
+193874.934457     8258687.958354
+193889.894537     8258695.613836
+193901.717526     8258703.866399
+193911.006136     8258715.229480
+193912.118118     8258730.277348
+193892.634366     8258737.618416
+193872.594620     8258737.435932
+193853.244472     8258730.367652
+193838.887884     8258725.224084
+193827.673472     8258718.856303
+193815.201014     8258713.104243
+193795.892531     8258701.649921
+193779.703616     8258691.477596
+193767.851424     8258686.356834
+193747.295819     8258674.264741
+193732.359867     8258664.103827
+193718.031719     8258655.828451
+193703.048268     8258650.679175
+193682.452528     8258642.973139
+193659.965281     8258636.502706
+193633.668866     8258635.636071
+193610.550437     8258629.787068
+193589.304470     8258624.580765
+193570.551974     8258620.650759
+193551.764425     8258620.479677
+193530.512617     8258615.899734
+193509.231591     8258614.453121
+193484.848518     8258609.845429
+193461.092315     8258605.242680
+193438.582462     8258601.278459
+193416.036792     8258601.073156
+193388.418069     8258607.713733
+193359.498878     8258619.355304
+193334.314439     8258633.537301
+193311.635165     8258647.741346
+193290.846634     8258660.709781
+193271.321218     8258672.436892
+193251.176308     8258683.531949
+193235.403172     8258695.919641
+193219.606666     8258710.813539
+193200.638008     8258730.064209
+193181.628457     8258753.700164
+193166.458050     8258768.599763
+193153.195914     8258780.383908
+193135.532036     8258794.007210
+193113.426272     8258813.856491
+193093.187887     8258834.975603
+193076.712707     8258855.501805
+193064.632665     8258874.815203
+193053.219614     8258889.749017
+193039.916585     8258905.918447
+193024.090867     8258923.944910
+193009.262954     8258937.000000
+END
+LINE3D
+HEIGHT 1020.000000
+186941.659145     8258937.000000
+186951.411983     8258926.917520
+186963.439451     8258913.242128
+186975.466529     8258899.567497
+186991.871987     8258886.559148
+187013.304529     8258871.716573
+187027.860137     8258855.558549
+187041.742913     8258844.406469
+187058.803681     8258828.271257
+187068.969611     8258812.699673
+187077.216351     8258801.496271
+187086.123853     8258786.540406
+187097.513152     8258774.112793
+187107.626889     8258764.179218
+187130.323692     8258748.095329
+187143.521939     8258743.203442
+187155.467232     8258738.299381
+187171.205315     8258729.670614
+187193.252649     8258716.087228
+187205.894527     8258703.671021
+187216.669415     8258689.984223
+187228.655983     8258680.694880
+187245.055218     8258668.312889
+187258.270612     8258661.541154
+187268.384342     8258651.608344
+187279.726900     8258644.193141
+187291.116198     8258631.765529
+187296.283880     8258614.894839
+187300.205198     8258597.387152
+187300.351255     8258581.724326
+187300.514841     8258564.181656
+187295.703544     8258542.834439
+187291.471603     8258526.505334
+187287.210452     8258513.308794
+187283.599152     8258497.611754
+187283.715997     8258485.081493
+187279.460690     8258471.258211
+187270.271395     8258449.244714
+187270.405767     8258434.834991
+187266.881719     8258409.740252
+187268.379675     8258383.438035
+187269.760785     8258369.666078
+187273.032259     8258354.658126
+187273.154945     8258341.501506
+187267.026801     8258327.034756
+187261.571496     8258307.561297
+187256.069832     8258293.100252
+187244.293585     8258279.835278
+187226.892987     8258265.265880
+187213.782753     8258260.760457
+187186.326848     8258249.858739
+187171.378449     8258240.950538
+187157.021476     8258235.807348
+187140.774139     8258231.900154
+187122.624374     8258230.481672
+187103.918619     8258221.539256
+187079.541773     8258216.304825
+187055.784802     8258211.702452
+187038.876314     8258211.548481
+187023.220024     8258211.405914
+187006.264412     8258216.264350
+186986.844542     8258216.713924
+186974.284457     8258220.358796
+186960.472172     8258223.992646
+186943.388033     8258242.634063
+186928.873322     8258254.406420
+186918.110122     8258266.839734
+186905.468244     8258279.255940
+186895.354511     8258289.189132
+186879.604745     8258299.070620
+186857.516511     8258317.040056
+186841.755061     8258328.174647
+186826.011136     8258337.429774
+186812.824953     8258341.068944
+186800.984442     8258334.695461
+186791.046358     8258325.833266
+186780.481798     8258316.964985
+186763.619665     8258311.798983
+186750.480219     8258310.426125
+186740.547980     8258300.937188
+186728.122267     8258290.172336
+186715.151863     8258270.630827
+186707.139199     8258256.773329
+186699.120690     8258243.542574
+186688.573656     8258232.794830
+186678.020777     8258222.673828
+186658.741505     8258208.086940
+186644.396216     8258201.690648
+186618.239629     8258185.788309
+186601.377496     8258180.622307
+186588.284788     8258174.237422
+186570.210972     8258164.674347
+186556.503468     8258157.030654
+186537.850291     8258142.449850
+186520.484746     8258124.121526
+186506.209565     8258110.207002
+186496.932637     8258097.591201
+186495.188330     8258083.164371
+186487.906925     8258058.035417
+186483.692514     8258039.826466
+186477.564370     8258025.359716
+186471.430384     8258011.519326
+186465.904971     8257999.564100
+186454.761046     8257985.678472
+186441.720919     8257973.654816
+186429.318573     8257960.384142
+186419.479430     8257940.870763
+186410.220028     8257926.375500
+186400.293629     8257916.260202
+186387.891287     8257902.989145
+186372.351842     8257890.316317
+186367.482118     8257875.234613
+186376.342889     8257865.290011
+186388.885448     8257863.524603
+186410.195682     8257861.839034
+186425.225874     8257861.975900
+186445.183830     8257870.929336
+186463.251802     8257881.119154
+186478.843828     8257888.153212
+186493.189117     8257894.549503
+186506.299733     8257899.054930
+186520.041911     8257902.939312
+186533.158369     8257906.818378
+186548.738710     8257915.105539
+186583.796963     8257916.677991
+186596.913424     8257920.556675
+186613.781015     8257925.096313
+186631.234573     8257934.027327
+186648.090483     8257939.819685
+186661.833039     8257943.704452
+186676.230909     8257944.461974
+186692.513680     8257944.610246
+186706.326345     8257940.976781
+186719.483320     8257940.469794
+186737.685667     8257936.249506
+186763.320934     8257940.868983
+186777.069334     8257944.127009
+186788.921148     8257949.247386
+186807.661956     8257954.430877
+186825.805880     8257956.475719
+186843.340849     8257956.635394
+186858.458674     8257947.374565
+186870.561705     8257925.554959
+186881.324905     8257913.121645
+186896.448575     8257903.234073
+186914.082860     8257892.743333
+186927.901368     8257888.483125
+186941.678980     8257888.608586
+186956.082691     8257888.739747
+186968.068877     8257879.450401
+186975.694977     8257867.614934
+186986.493229     8257851.422695
+187001.651951     8257837.776198
+187016.716813     8257834.154136
+187023.500650     8257845.494025
+187023.372119     8257859.277388
+187023.237748     8257873.687111
+187022.447684     8257891.223695
+187021.541157     8257921.290542
+187025.140772     8257938.240685
+187033.762390     8257953.983350
+187048.681195     8257966.024113
+187064.290748     8257971.178708
+187084.945672     8257972.620002
+187105.043841     8257966.537356
+187119.500516     8257961.029751
+187132.663332     8257959.896404
+187148.354675     8257956.280046
+187161.570073     8257949.507929
+187174.756639     8257945.868762
+187187.287512     8257945.356456
+187206.753741     8257939.894469
+187223.674297     8257938.795340
+187236.825428     8257938.915095
+187258.106451     8257940.362091
+187271.872377     8257941.740654
+187284.959245     8257948.751899
+187305.555364     8257956.458321
+187319.941931     8257958.468948
+187339.320522     8257962.405038
+187351.125981     8257972.537446
+187370.311778     8257997.148389
+187383.375276     8258006.665840
+187399.605469     8258012.452500
+187422.080266     8258020.176029
+187434.529350     8258028.434676
+187443.823805     8258039.171014
+187452.498005     8258049.274909
+187467.323335     8258071.339727
+187479.725678     8258084.610784
+187492.766190     8258096.634061
+187503.962690     8258104.881684
+187514.521410     8258114.376326
+187526.308961     8258126.388193
+187537.429895     8258142.780413
+187545.425032     8258158.517373
+187554.713646     8258169.880071
+187565.822516     8258187.525007
+187580.103541     8258200.812789
+187598.183197     8258209.749504
+187616.830148     8258224.957047
+187629.279231     8258233.215694
+187642.396075     8258237.094382
+187652.977779     8258244.083197
+187674.153642     8258256.807351
+187694.105754     8258266.387530
+187712.753090     8258281.594694
+187723.973343     8258287.336116
+187733.917267     8258295.571951
+187744.475605     8258305.066589
+187757.498970     8258318.969714
+187773.032574     8258332.268902
+187788.542808     8258348.074296
+187796.584301     8258358.799224
+187807.722764     8258373.311599
+187815.108947     8258387.163391
+187823.783148     8258397.267286
+187833.083444     8258407.377264
+187854.235939     8258422.607241
+187876.699051     8258431.583872
+187891.688347     8258436.106406
+187912.852524     8258450.083662
+187924.680589     8258457.709858
+187947.799775     8258463.559632
+187972.803103     8258468.799768
+187993.428051     8258473.373621
+188015.938669     8258477.337849
+188029.060588     8258480.590169
+188043.423020     8258485.106995
+188055.912997     8258488.980357
+188075.918455     8258492.921772
+188094.091590     8258491.834050
+188115.418586     8258488.269011
+188129.822679     8258488.400176
+188149.862425     8258488.582660
+188165.507030     8258489.978330
+188177.991170     8258494.477669
+188190.486991     8258497.724288
+188219.295177     8258497.986618
+188243.718378     8258498.209018
+188268.768443     8258498.437126
+188285.677696     8258498.591103
+188304.465244     8258498.762184
+188325.131089     8258498.950369
+188343.918637     8258499.121450
+188368.348444     8258498.717497
+188398.449725     8258494.605562
+188417.278170     8258490.390975
+188434.859494     8258485.538619
+188447.425423     8258481.267006
+188462.461455     8258480.777512
+188476.906445     8258476.523009
+188495.108792     8258472.302721
+188512.023120     8258471.830332
+188530.219622     8258468.236786
+188542.750499     8258467.724098
+188557.153828     8258467.855256
+188570.931822     8258467.980719
+188591.597667     8258468.168904
+188606.001760     8258468.300069
+188625.386196     8258471.609417
+188644.788158     8258473.039302
+188659.783298     8258476.935093
+188674.175705     8258478.319361
+188687.923724     8258481.577382
+188707.917497     8258486.771901
+188721.688882     8258487.524100
+188735.431060     8258491.408482
+188752.925514     8258495.953828
+188770.396602     8258503.004997
+188786.626409     8258508.792036
+188799.707432     8258516.430024
+188814.638305     8258527.217688
+188826.455449     8258536.096993
+188840.776984     8258544.999487
+188853.840485     8258554.516555
+188869.455875     8258559.045173
+188884.451015     8258562.940964
+188897.590464     8258564.313440
+188910.086285     8258567.560059
+188935.751524     8258569.047360
+188950.154853     8258569.178518
+188967.736945     8258564.325786
+188988.414472     8258563.261251
+189016.636695     8258559.131823
+189035.465136     8258554.917619
+189049.278183     8258551.284157
+189063.137206     8258542.638279
+189080.081510     8258539.033331
+189095.790383     8258533.537128
+189110.240449     8258528.656258
+189123.461688     8258521.257781
+189141.072988     8258513.272867
+189157.454696     8258502.770338
+189171.934738     8258494.756910
+189189.521907     8258489.277811
+189210.223568     8258485.707078
+189229.104595     8258475.853721
+189233.733423     8258449.580397
+189243.284940     8258432.750009
+189254.633724     8258424.708068
+189284.781741     8258415.584105
+189303.580975     8258414.502083
+189318.662984     8258409.000173
+189331.855776     8258404.734267
+189344.380809     8258404.848321
+189360.663198     8258404.996590
+189375.740127     8258400.121429
+189387.679193     8258395.844107
+189405.354756     8258380.967702
+189416.105888     8258369.787488
+189426.863629     8258357.980537
+189445.124398     8258347.495119
+189469.594337     8258342.705491
+189484.051012     8258337.197886
+189497.874980     8258332.311315
+189509.820651     8258327.407640
+189524.950162     8258316.893709
+189539.412678     8258310.759744
+189558.943170     8258298.406265
+189580.317668     8258289.829206
+189595.387992     8258285.580398
+189608.586625     8258280.688132
+189628.041169     8258276.479247
+189651.885009     8258271.683918
+189670.730980     8258265.589869
+189686.439853     8258260.093666
+189705.936058     8258251.499120
+189730.481946     8258238.564900
+189750.610090     8258229.349695
+189773.897940     8258217.030432
+189794.084507     8258201.550097
+189812.965531     8258191.697123
+189827.456493     8258182.430585
+189839.437220     8258173.767603
+189851.406262     8258166.357723
+189865.241914     8258160.218049
+189880.348055     8258152.210323
+189896.700552     8258144.840359
+189913.650701     8258140.608668
+189926.866096     8258133.836934
+189942.569124     8258128.967473
+189963.902728     8258124.775699
+189982.110151     8258119.929044
+189998.440042     8258115.065292
+190017.859534     8258114.615332
+190033.556721     8258110.372232
+190046.087594     8258109.859926
+190063.698130     8258101.875005
+190081.379538     8258086.371858
+190097.211097     8258067.719035
+190109.238561     8258054.044025
+190118.111397     8258042.846706
+190140.152893     8258029.889298
+190154.602959     8258025.008428
+190170.967138     8258016.385744
+190183.550593     8258010.234668
+190195.490423     8258005.957353
+190210.526460     8258005.467477
+190231.784112     8258009.420678
+190244.894346     8258013.926101
+190259.257546     8258018.442551
+190271.108974     8258023.563307
+190287.322024     8258031.229433
+190306.648037     8258040.803911
+190322.854474     8258049.097155
+190337.826243     8258055.499151
+190352.798012     8258061.901148
+190370.888593     8258069.584371
+190392.778188     8258072.916531
+190412.818699     8258073.099021
+190428.515882     8258068.856304
+190451.160107     8258058.410802
+190463.105778     8258053.507127
+190478.182711     8258048.631583
+190497.046208     8258040.658071
+190522.172222     8258032.741586
+190542.299602     8258023.526375
+190556.791329     8258014.259844
+190571.931761     8258002.492803
+190585.838282     8257988.835287
+190596.630311     8257973.269404
+190604.929630     8257956.427614
+190608.803832     8257943.931568
+190613.345030     8257927.055557
+190619.220979     8257901.420001
+190623.745415     8257886.423459
+190628.251557     8257873.306755
+190635.286228     8257857.706657
+190645.434632     8257844.014536
+190659.955571     8257831.615441
+190670.115660     8257816.670217
+190682.780904     8257801.748188
+190689.786365     8257789.280656
+190696.780908     8257778.065851
+190705.102829     8257758.718231
+190709.650632     8257741.215866
+190709.779163     8257727.432503
+190709.971957     8257706.757650
+190710.182281     8257684.202952
+190709.783264     8257659.763465
+190706.242072     8257636.548192
+190706.429026     8257616.499699
+190706.627661     8257595.198486
+190706.826299     8257573.896890
+190706.346257     8257558.228363
+190706.550737     8257536.300408
+190706.726005     8257517.505017
+190706.924644     8257496.203421
+190707.076541     8257479.914236
+190707.245969     8257461.745205
+190707.438763     8257441.070352
+190707.614031     8257422.274961
+190707.765929     8257405.985776
+190707.917830     8257389.696208
+190708.098939     8257370.274457
+190708.309259     8257347.720141
+190708.542950     8257322.659620
+190708.759115     8257299.478562
+190708.957754     8257278.176966
+190709.138863     8257258.755216
+190709.337501     8257237.453620
+190705.228633     8257207.967515
+190705.438953     8257185.413200
+190701.230002     8257166.577886
+190701.364373     8257152.168163
+190699.708083     8257128.343641
+190695.458238     8257113.893612
+190691.899516     8257092.558184
+190687.656276     8257077.481802
+190687.157944     8257063.692731
+190680.397856     8257049.847022
+190671.822978     8257029.091948
+190663.237176     8257009.590365
+190658.355388     8256995.761377
+190658.536497     8256976.339626
+190663.066009     8256960.716717
+190664.441661     8256947.571124
+190665.892494     8256926.281313
+190666.038551     8256910.618488
+190666.184607     8256894.955662
+190667.560259     8256881.810069
+190673.336125     8256866.825304
+190681.571180     8256856.875005
+190699.252588     8256841.371858
+190709.190668     8256850.234435
+190719.678897     8256867.247306
+190733.954460     8256881.161834
+190748.223417     8256895.702715
+190766.853223     8256912.789724
+190789.252836     8256928.657852
+190801.034160     8256941.296459
+190813.407295     8256957.699698
+190824.463965     8256980.983408
+190835.602428     8256995.495782
+190843.643921     8257006.220711
+190851.680338     8257017.572007
+190863.485797     8257027.704415
+190878.410060     8257039.118815
+190898.942298     8257053.716730
+190923.863832     8257067.728201
+190939.391596     8257081.653749
+190953.637947     8257098.700842
+190964.793172     8257111.333747
+190975.990058     8257119.580991
+190987.186176     8257127.828611
+191002.152104     8257134.856967
+191022.128351     8257141.930948
+191043.971205     8257150.275518
+191064.561101     8257158.608296
+191081.400246     8257166.280506
+191097.641742     8257170.814060
+191113.871549     8257176.601099
+191132.618201     8257181.157847
+191153.278969     8257181.972400
+191173.289504     8257185.287448
+191192.703151     8257185.464231
+191207.727499     8257186.227839
+191221.469676     8257190.112221
+191235.873769     8257190.243386
+191252.782257     8257190.397356
+191270.323449     8257189.930675
+191294.133002     8257188.894278
+191309.830189     8257184.651178
+191323.613260     8257184.150274
+191343.073648     8257179.314647
+191360.649892     8257175.089040
+191375.059065     8257174.593456
+191390.715356     8257174.736023
+191407.624608     8257174.890000
+191420.729002     8257180.021783
+191431.920044     8257188.895770
+191444.357442     8257198.407519
+191464.929812     8257208.619760
+191481.798167     8257213.159405
+191486.942093     8257198.795299
+191487.076465     8257184.385576
+191487.228366     8257168.096008
+191488.082311     8257143.667931
+191492.630114     8257126.165566
+191499.740738     8257102.420494
+191495.648687     8257091.413528
+END
+LINE3D
+HEIGHT 1030.000000
+186601.474090     8258937.000000
+186607.552957     8258928.798380
+186616.478371     8258911.962674
+186627.294152     8258893.890590
+186639.473129     8258863.926773
+186651.617442     8258837.721120
+186661.906058     8258808.992916
+186670.217062     8258790.898023
+186677.222522     8258778.430491
+186686.715613     8258767.865616
+186698.104911     8258755.438004
+186715.107256     8258745.567922
+186735.890328     8258733.225850
+186764.176815     8258722.204932
+186781.846159     8258707.954501
+186797.004878     8258694.308387
+186808.429228     8258678.121849
+186822.967314     8258663.842905
+186838.775502     8258647.696287
+186855.807059     8258634.693641
+186872.212516     8258621.685292
+186892.363267     8258609.963876
+186908.780413     8258595.702043
+186925.800288     8258583.952116
+186938.442166     8258571.535910
+186951.054832     8258562.252268
+186967.454067     8258549.870277
+186988.857773     8258538.161035
+187007.750485     8258527.054575
+187023.500250     8258517.173088
+187034.268912     8258504.113028
+187045.600170     8258497.950549
+187053.225884     8258486.115461
+187067.202135     8258464.939325
+187076.759492     8258447.482578
+187081.271861     8258433.739134
+187086.404483     8258420.628135
+187096.547428     8258407.562377
+187109.183462     8258395.772913
+187114.316088     8258382.661531
+187114.462145     8258366.998706
+187107.742572     8258348.767326
+187093.479077     8258333.599699
+187084.805258     8258323.495808
+187072.362019     8258314.610419
+187057.425302     8258304.449497
+187041.769012     8258304.306929
+187024.813404     8258309.164983
+187005.984959     8258313.379570
+186991.505299     8258321.393001
+186978.295746     8258327.538376
+186965.688923     8258336.195275
+186951.817833     8258346.094252
+186935.406531     8258359.729343
+186913.382564     8258370.806906
+186898.908745     8258378.193978
+186878.213307     8258381.138354
+186861.298596     8258381.610741
+186845.630620     8258382.721275
+186831.853008     8258382.595815
+186814.329724     8258381.183038
+186794.956974     8258376.620588
+186780.629212     8258368.344834
+186768.782860     8258362.597711
+186755.075352     8258354.954400
+186745.160643     8258343.585618
+186733.958295     8258335.965120
+186718.986526     8258329.563123
+186702.809300     8258318.137314
+186690.348531     8258311.131770
+186680.491859     8258293.498236
+186671.203245     8258282.135538
+186661.891264     8258273.278662
+186649.459706     8258263.140553
+186627.540900     8258262.940958
+186614.354716     8258266.580128
+186601.817999     8258267.719176
+186585.488490     8258272.582932
+186566.735993     8258268.652925
+186552.367338     8258264.762456
+186544.319619     8258254.664266
+186523.161282     8258240.060650
+186504.461368     8258230.491874
+186488.278298     8258219.692807
+186475.273223     8258203.910226
+186467.277703     8258188.173263
+186461.149559     8258173.706513
+186449.373697     8258160.441160
+186436.947984     8258149.676309
+186414.618858     8258126.290333
+186397.229946     8258110.467833
+186377.962355     8258094.628225
+186351.834979     8258075.593320
+186336.353956     8258056.655362
+186325.204193     8258043.395711
+186314.054427     8258030.136443
+186300.376134     8258019.360185
+186283.584110     8258006.675950
+186266.136775     8257997.118580
+186252.429271     8257989.474887
+186236.883981     8257977.428802
+186220.167909     8257956.599592
+186199.179378     8257923.827331
+186185.582879     8257904.279738
+186167.520748     8257893.463561
+186155.054139     8257887.084376
+186127.668720     8257868.664811
+186102.717975     8257857.785905
+186090.233839     8257853.286184
+186072.780278     8257844.355552
+186049.726119     8257831.614295
+186021.638275     8257821.333235
+185994.164840     8257812.311362
+185976.694138     8257805.259814
+185962.337165     8257800.116625
+185945.434136     8257799.336291
+185927.389531     8257786.640651
+185903.697210     8257775.146409
+185873.742369     8257763.595522
+185850.693669     8257750.227901
+185826.995503     8257739.360401
+185806.428595     8257728.521415
+185790.221773     8257720.228549
+185772.142498     8257711.291838
+185750.978317     8257697.314964
+185736.059130     8257685.274197
+185724.897682     8257673.267649
+185715.597383     8257663.158053
+185699.536999     8257639.202366
+185689.019176     8257625.322056
+185677.828516     8257616.448073
+185667.269796     8257606.953431
+185655.499390     8257593.062098
+185646.199094     8257582.952120
+185635.693335     8257567.819093
+185630.864129     8257548.351336
+185630.372401     8257533.935912
+185634.878925     8257520.819211
+185647.491592     8257511.535569
+185658.213898     8257503.487541
+185680.752959     8257504.319579
+185691.311679     8257513.814221
+185703.684814     8257530.217461
+185712.352788     8257540.948094
+185717.252102     8257552.897619
+185730.268862     8257567.427098
+185743.964684     8257576.323511
+185767.060118     8257584.679487
+185783.933554     8257588.592382
+185799.560633     8257591.867515
+185813.338245     8257591.992975
+185829.661913     8257587.755579
+185849.075560     8257587.932362
+185870.368268     8257588.126255
+185898.549591     8257588.382877
+185918.589337     8257588.565361
+185937.991682     8257589.995249
+185955.491598     8257593.913849
+185976.146140     8257595.355140
+186005.539146     8257600.008835
+186036.804989     8257605.305998
+186063.681151     8257611.189984
+186085.512323     8257620.787274
+186104.821193     8257632.241218
+186122.280213     8257640.545485
+186136.596290     8257650.074342
+186154.681791     8257658.384315
+186165.889976     8257665.378835
+186179.000211     8257669.884258
+186192.748611     8257673.142284
+186213.379786     8257677.089397
+186235.890022     8257681.053622
+186258.434927     8257681.258918
+186275.302901     8257685.798559
+186293.405546     8257692.229066
+186312.790364     8257695.538417
+186326.532920     8257699.423184
+186340.901579     8257703.313271
+186353.379874     8257708.439353
+186363.317953     8257717.301930
+186376.405203     8257724.313179
+186389.486226     8257731.951167
+186402.543883     8257742.094978
+186418.692279     8257756.653356
+186436.771557     8257765.589685
+186463.636415     8257772.726776
+186486.140427     8257777.317358
+186516.826910     8257777.596791
+186541.876975     8257777.824900
+186560.664523     8257777.995981
+186578.831432     8257777.534997
+186598.865719     8257778.343844
+186626.350835     8257786.112997
+186653.847254     8257792.629044
+186677.603843     8257797.231414
+186698.241241     8257800.552171
+186718.907468     8257800.740359
+186743.331052     8257800.962763
+186774.017534     8257801.242197
+186795.942181     8257800.815431
+186817.269945     8257797.250017
+186834.810755     8257796.783332
+186852.357409     8257795.689904
+186869.927430     8257792.090654
+186884.963466     8257791.600778
+186898.746919     8257791.099878
+186918.160566     8257791.276660
+186933.190758     8257791.413527
+186946.967988     8257791.538983
+186969.560013     8257786.732255
+186984.022147     8257780.598286
+187003.576010     8257765.738603
+187018.699677     8257755.851414
+187036.907868     8257751.004384
+187051.323260     8257749.882825
+187074.500491     8257749.467083
+187091.403134     8257750.247796
+187112.034691     8257754.194913
+187138.296057     8257758.820092
+187162.690812     8257762.175064
+187178.335417     8257763.570734
+187192.739128     8257763.701895
+187205.264160     8257763.815949
+187232.866125     8257759.054459
+187251.688726     8257755.466615
+187279.875890     8257755.096877
+187300.588858     8257750.272655
+187319.382247     8257749.817376
+187340.048474     8257750.005565
+187359.468345     8257749.555991
+187384.518409     8257749.784099
+187413.290779     8257753.805347
+187433.921954     8257757.752461
+187452.633550     8257766.068517
+187468.869584     8257771.228817
+187482.600076     8257776.366301
+187503.805150     8257785.957890
+187526.221525     8257799.946549
+187544.874702     8257814.527353
+187562.246470     8257832.229319
+187575.251544     8257848.011900
+187587.653887     8257861.282957
+187600.056233     8257874.553632
+187609.362373     8257884.036868
+187616.766082     8257896.009198
+187626.066382     8257906.118794
+187642.741943     8257931.333292
+187663.162412     8257957.835100
+187677.385396     8257977.388016
+187690.402156     8257991.917494
+187700.932046     8258004.544705
+187710.214816     8258016.534145
+187721.996140     8258029.172752
+187733.128759     8258044.311869
+187745.519420     8258058.835646
+187756.060231     8258070.209747
+187771.552939     8258087.894602
+187788.918863     8258106.223311
+187801.912252     8258123.258995
+187811.195025     8258135.248053
+187819.851696     8258147.231793
+187827.272935     8258157.324278
+187841.490074     8258177.503936
+187851.387261     8258190.751798
+187864.415702     8258204.028557
+187877.491649     8258212.292912
+187889.964100     8258218.045736
+187906.199751     8258223.206033
+187921.200732     8258226.475464
+187936.851181     8258227.244392
+187951.845553     8258231.140558
+187969.345852     8258235.059162
+187991.258818     8258235.885117
+188021.910244     8258239.923858
+188046.299158     8258243.905190
+188068.217965     8258244.104785
+188088.872124     8258245.546072
+188110.790931     8258245.745667
+188140.219375     8258246.640058
+188170.278994     8258246.913784
+188197.828374     8258247.791447
+188225.342701     8258252.428034
+188255.349742     8258258.340148
+188288.459590     8258267.413729
+188315.353664     8258271.417873
+188341.023983     8258272.278425
+188369.193624     8258273.787767
+188397.374947     8258274.044389
+188422.425012     8258274.272497
+188448.089490     8258275.759409
+188476.861856     8258279.781039
+188512.552816     8258280.732457
+188545.117594     8258281.028995
+188570.167659     8258281.257103
+188590.195720     8258282.692690
+188613.993587     8258282.909395
+188635.327192     8258278.717621
+188650.398280     8258274.468819
+188662.987576     8258267.691383
+188675.588557     8258259.660844
+188691.291589     8258254.791002
+188705.753340     8258248.657030
+188719.578072     8258243.770466
+188734.660077     8258238.268937
+188756.619781     8258234.082864
+188776.080930     8258229.247626
+188788.646859     8258224.976012
+188801.171891     8258225.090066
+188819.332577     8258225.255439
+188838.746989     8258225.432228
+188858.757523     8258228.747277
+188873.752663     8258232.643069
+188895.636414     8258236.601971
+188917.508483     8258241.813593
+188934.984647     8258248.238395
+188947.468783     8258252.738117
+188974.333644     8258259.874826
+189003.106014     8258263.896074
+189038.802815     8258264.221132
+189060.721622     8258264.420727
+189077.056589     8258258.930608
+189091.494973     8258255.302458
+189112.846104     8258249.231221
+189139.833652     8258243.211310
+189162.442821     8258236.525116
+189181.909050     8258231.063128
+189197.664657     8258220.555280
+189212.805853     8258208.788246
+189225.459416     8258195.118937
+189243.731867     8258183.380799
+189268.278523     8258170.446203
+189292.806885     8258159.391445
+189311.676226     8258150.791191
+189324.909912     8258142.140000
+189341.262409     8258134.770036
+189356.994648     8258126.768011
+189374.564291     8258123.168375
+189390.284845     8258116.419453
+189408.487191     8258112.199165
+189420.432862     8258107.295490
+189432.992947     8258103.650619
+189446.184975     8258099.384706
+189460.647490     8258093.250741
+189476.379730     8258085.248716
+189498.374489     8258077.303335
+189522.886089     8258068.128047
+189547.408606     8258057.700031
+189566.910652     8258048.479125
+189588.296074     8258038.648574
+189608.435904     8258028.180267
+189635.457740     8258018.401423
+189663.118124     8258007.375186
+189688.267508     8257996.952496
+189705.884653     8257988.340839
+189723.495188     8257980.355918
+189739.244953     8257970.474430
+189756.253525     8257959.977609
+189777.018689     8257949.514997
+189790.264060     8257939.610704
+189804.123083     8257930.964825
+189816.103806     8257922.302225
+189829.325045     8257914.903748
+189839.438397     8257904.970552
+189859.589908     8257893.249524
+189877.832387     8257884.643562
+189904.223048     8257875.485384
+189921.745949     8257876.898158
+189932.316737     8257885.139701
+189942.213920     8257898.387946
+189953.410806     8257906.635190
+189966.474303     8257916.152641
+189999.653495     8257917.707982
+190022.187483     8257919.166005
+190038.469872     8257919.314274
+190051.667741     8257914.422002
+190073.065609     8257903.338737
+190087.480623     8257902.216793
+190103.804673     8257897.979401
+190124.482199     8257896.914866
+190143.907532     8257895.838546
+190162.080667     8257894.750823
+190179.030816     8257890.519133
+190196.617981     8257885.040416
+190211.121394     8257874.520784
+190224.968731     8257867.128007
+190244.464172     8257858.533455
+190267.138369     8257844.955777
+190292.299438     8257833.279985
+190315.569762     8257822.840184
+190333.824687     8257812.981508
+190353.337653     8257802.507493
+190374.700469     8257795.183154
+190394.166695     8257789.721548
+190417.413651     8257781.787570
+190438.793993     8257772.583768
+190459.571604     8257760.868442
+190473.453994     8257749.716741
+190486.733655     8257736.053133
+190503.812335     8257718.038080
+190524.665133     8257698.177772
+190543.592894     8257683.312770
+190557.499419     8257669.654871
+190569.526884     8257655.979860
+190579.043344     8257642.908781
+190590.432260     8257630.481165
+190595.038486     8257606.713669
+190593.960792     8257587.906869
+190584.086976     8257572.152802
+190569.179474     8257558.858933
+190550.403610     8257557.434749
+190532.904076     8257553.516152
+190517.335420     8257543.975889
+190516.210988     8257530.181117
+190516.362886     8257513.891931
+190516.479731     8257501.361671
+190512.289070     8257480.646902
+190512.476023     8257460.598408
+190512.042719     8257439.917854
+190512.826560     8257423.007627
+190517.361917     8257406.757975
+190517.490444     8257392.974995
+190518.889462     8257377.323579
+190519.035519     8257361.660753
+190519.901153     8257335.979191
+190520.099788     8257314.677978
+190520.257530     8257297.762050
+190520.374376     8257285.231789
+190520.514592     8257270.195324
+190508.808452     8257249.412118
+190499.613317     8257228.024982
+190491.067647     8257204.137724
+190487.456347     8257188.440684
+190482.632981     8257168.346566
+190482.135410     8257154.557885
+190482.258100     8257141.400882
+190482.386630     8257127.617519
+190483.141256     8257113.840239
+190487.729956     8257091.952207
+190491.024800     8257074.438050
+190492.411369     8257060.039729
+190497.076017     8257030.007104
+190499.182164     8257005.590047
+190499.954319     8256989.932923
+190500.838240     8256962.372288
+190501.698030     8256937.317468
+190503.113810     8256919.786583
+190504.506988     8256904.761527
+190506.022088     8256876.579843
+190506.191515     8256858.410813
+190506.372624     8256838.989062
+190506.547892     8256820.193672
+190506.699790     8256803.904486
+190507.501157     8256785.114797
+190508.906020     8256768.836638
+190512.809433     8256753.208028
+190519.223847     8256736.975869
+190525.649946     8256719.490608
+190530.232041     8256698.228928
+190537.899416     8256682.008179
+190541.878782     8256658.234593
+190543.282877     8256641.956811
+190544.681896     8256626.305395
+190545.477422     8256608.142065
+190546.284630     8256588.726016
+190547.665358     8256574.954056
+190550.316574     8256559.314042
+190554.190776     8256546.817997
+190559.990777     8256529.327034
+190566.358453     8256518.106903
+190578.333336     8256510.070663
+190602.763146     8256509.666328
+190619.039691     8256510.441339
+190635.287028     8256514.348533
+190651.528520     8256518.882470
+190666.552871     8256519.645696
+190683.374490     8256529.197368
+190698.908090     8256542.496939
+190710.022422     8256559.515129
+190720.546469     8256572.769082
+190731.034698     8256589.781953
+190739.071115     8256601.133249
+190757.161693     8256608.816855
+190770.898794     8256613.327603
+190792.811756     8256614.153941
+190809.053249     8256618.687877
+190825.288900     8256623.848174
+190842.133889     8256630.893641
+190858.948899     8256641.072049
+190883.279390     8256651.318511
+190902.582033     8256663.399194
+190921.270265     8256674.220691
+190939.859175     8256695.693367
+190947.239517     8256710.171520
+190958.296188     8256733.455230
+190967.485482     8256755.468726
+190978.501256     8256783.138103
+190987.684710     8256805.777960
+190995.661939     8256823.394379
+191001.152300     8256839.108530
+191008.497586     8256857.345990
+191018.348800     8256875.605887
+191029.486496     8256890.118637
+191044.382316     8256904.665226
+191056.146878     8256919.183302
+191069.807262     8256931.839019
+191080.986622     8256941.965726
+191093.365598     8256957.742606
+191103.291992     8256967.858285
+191113.171653     8256982.985610
+191129.366408     8256992.531574
+191141.809647     8257001.416964
+191154.920646     8257005.922394
+191169.885810     8257012.950743
+191189.282696     8257015.006995
+191211.224869     8257012.700767
+191226.927897     8257007.831307
+191245.826451     8256996.098488
+191257.156944     8256989.936002
+191270.981675     8256985.049438
+191284.904962     8256969.512069
+191296.914900     8256957.716521
+191308.942365     8256944.041511
+191324.094478     8256931.021750
+191336.753882     8256916.726081
+191349.407445     8256903.056772
+191361.434910     8256889.381762
+191374.714571     8256875.718154
+191385.519046     8256858.899559
+191398.851290     8256839.597181
+191413.395595     8256824.692263
+191427.277989     8256813.540179
+191437.414707     8256801.101161
+191448.166604     8256789.920953
+191462.136628     8256769.371557
+191469.177140     8256753.145099
+191477.488144     8256735.050207
+191485.827596     8256713.822742
+191496.608703     8256699.509969
+191506.745422     8256687.070951
+191528.775229     8256675.367027
+191543.290327     8256663.594292
+191556.529092     8256654.316352
+191574.174683     8256642.572123
+191591.873618     8256625.189513
+191603.292509     8256609.629339
+191614.113749     8256590.930892
+191624.876566     8256578.497574
+191634.990679     8256568.564768
+191645.168294     8256551.740082
+191655.925270     8256539.933125
+191664.809791     8256527.482703
+191676.187786     8256516.308197
+191684.422074     8256506.358272
+191692.680496     8256493.902150
+191704.209628     8256466.438069
+191713.726088     8256453.366989
+191721.346727     8256442.158267
+191735.896112     8256426.626600
+191745.383365     8256416.687703
+191757.387459     8256405.518897
+191769.374026     8256396.229555
+191781.939955     8256391.957941
+191797.730617     8256377.690786
+191810.349125     8256367.780785
+191822.353222     8256356.611597
+191834.398212     8256341.057124
+191847.701241     8256324.887694
+191860.986744     8256310.597726
+191872.370583     8256298.796477
+191885.012461     8256286.380271
+191898.274593     8256274.596508
+191916.558733     8256261.604885
+191931.096433     8256247.326320
+191941.233152     8256234.887302
+191949.520785     8256219.298614
+191958.434518     8256203.715628
+191966.066077     8256191.253797
+191974.956439     8256178.177016
+191982.605527     8256163.835340
+191990.243692     8256150.747156
+191999.110687     8256140.176198
+END
+LINE3D
+HEIGHT 1030.000000
+192002.914781     8256135.198385
+192018.769710     8256114.039357
+192025.149072     8256101.566123
+192037.094743     8256096.662448
+192045.966814     8256085.465123
+192057.414917     8256066.772383
+192063.858542     8256047.407660
+192073.456796     8256025.565245
+192081.111726     8256010.597209
+192096.323026     8255991.312324
+192104.634031     8255973.217432
+192113.536078     8255958.887548
+192122.413993     8255947.063480
+192149.518387     8255928.513308
+192166.555406     8255914.883915
+192181.064659     8255903.737923
+192189.931654     8255893.166964
+192199.459800     8255878.842781
+192208.976260     8255865.771702
+192221.056306     8255846.457921
+192231.895072     8255825.880011
+192240.141809     8255814.676991
+192249.037251     8255800.973460
+192256.646204     8255791.017842
+192261.772604     8255778.533199
+192264.423820     8255762.893185
+192265.172609     8255749.741884
+192251.740071     8255712.652388
+192246.881653     8255696.317196
+192238.834316     8255686.219010
+192230.189326     8255672.982550
+192219.654359     8255660.981706
+192204.231760     8255635.778618
+192192.525620     8255614.995412
+192187.087841     8255593.642491
+192182.211894     8255579.187143
+192171.097566     8255562.168571
+192160.591042     8255547.035537
+192148.159488     8255536.897046
+192128.903583     8255519.804335
+192118.339401     8255510.936439
+192107.844566     8255494.549921
+192102.981068     8255478.841478
+192102.594501     8255453.148896
+192102.113695     8255437.480362
+192102.869089     8255423.702707
+192107.462865     8255401.188308
+192112.027433     8255381.806091
+192119.097921     8255362.447075
+192123.048072     8255341.806437
+192129.456645     8255326.200638
+192135.859377     8255311.221200
+192148.600573     8255288.154387
+192163.753452     8255275.134442
+192178.899725     8255262.741040
+192195.323093     8255247.853042
+192209.872478     8255232.321375
+192220.061777     8255214.243777
+192232.065873     8255203.074781
+192242.179222     8255193.141776
+192253.568903     8255180.714167
+192272.531719     8255162.089857
+192295.842938     8255147.264580
+192309.076625     8255138.613199
+192319.786862     8255131.818460
+192333.043153     8255120.661058
+192345.041406     8255110.118613
+192355.183967     8255097.053043
+192367.790791     8255088.395953
+192380.432669     8255075.979747
+192392.419237     8255066.690404
+192409.467939     8255051.808100
+192422.742522     8255038.771051
+192435.981288     8255029.493111
+192453.691142     8255010.857391
+192471.395919     8254992.848231
+192490.364578     8254973.597370
+192505.488247     8254963.709989
+192521.232171     8254954.454862
+192538.187397     8254949.596804
+192552.696650     8254938.450811
+192567.146718     8254933.569750
+192579.765227     8254923.659558
+192596.832220     8254906.897798
+192611.334867     8254896.378158
+192622.063395     8254887.703964
+192636.536832     8254880.316890
+192653.522033     8254872.326274
+192674.310566     8254859.357647
+192702.602891     8254847.710560
+192724.644386     8254834.753343
+192747.927158     8254823.060638
+192767.451808     8254811.333711
+192796.376075     8254799.065773
+192826.594200     8254782.423578
+192857.479319     8254761.401607
+192880.924911     8254732.166416
+192906.840606     8254706.713345
+192932.124362     8254681.880932
+192953.574812     8254665.158897
+192966.240058     8254650.236677
+192978.870253     8254639.073382
+192989.627227     8254627.266616
+193000.384966     8254615.459857
+193012.470853     8254595.519716
+193027.002711     8254581.867703
+193042.173117     8254566.968295
+193063.570987     8254555.884839
+193080.590478     8254544.135100
+193095.731672     8254532.368257
+193108.391078     8254518.072397
+193121.038796     8254505.029830
+193129.308904     8254491.320605
+193137.630827     8254471.972794
+193145.268993     8254458.884419
+193155.440764     8254442.686476
+193169.352367     8254428.402018
+193181.420726     8254410.341532
+193192.212755     8254394.775649
+193197.369130     8254379.158448
+193201.348493     8254355.385245
+193205.995615     8254327.232082
+193206.855405     8254302.177262
+193207.697668     8254279.001905
+193207.948885     8254252.061922
+193208.217630     8254223.242285
+193204.108762     8254193.756180
+193204.278187     8254175.587341
+193203.223862     8254154.274527
+193202.146933     8254135.467733
+193200.495721     8254111.016653
+193196.919475     8254091.560496
+193193.308175     8254075.863456
+193188.414701     8254063.287571
+193180.999307     8254052.568343
+193175.485578     8254039.360206
+193164.921397     8254030.492119
+193157.528607     8254017.266870
+193148.883618     8254004.030411
+193129.656924     8253983.805135
+193118.548436     8253966.160203
+193108.673856     8253950.406128
+193098.144729     8253937.778925
+193088.856117     8253926.416035
+193069.594369     8253909.949876
+193059.029424     8253901.081782
+193047.839145     8253892.207993
+193038.533005     8253882.724757
+193026.686652     8253876.977826
+193017.386354     8253866.868038
+193007.448272     8253858.005653
+192995.005032     8253849.120454
+192985.061109     8253840.884429
+192973.875908     8253831.384082
+192952.740941     8253814.274452
+192936.557871     8253803.475385
+192916.025633     8253788.877470
+192899.245676     8253774.940137
+192887.463587     8253762.301524
+192878.151605     8253753.444839
+192850.818387     8253729.386405
+192835.940859     8253712.960169
+192816.742611     8253689.602417
+192795.637620     8253669.360133
+192783.223592     8253657.342274
+192764.535361     8253646.520491
+192752.097963     8253637.008741
+192735.867389     8253631.221886
+192719.666793     8253622.302378
+192702.278263     8253606.479881
+192682.348755     8253594.393681
+192666.739203     8253589.238990
+192656.192550     8253578.491345
+192645.621763     8253570.249706
+192634.425642     8253562.002373
+192616.410249     8253546.174168
+192606.553959     8253528.540638
+192602.930975     8253514.096605
+192599.313068     8253499.026013
+192599.552601     8253473.339037
+192603.491833     8253453.951316
+192608.629917     8253440.213667
+192612.527488     8253425.211607
+192622.055635     8253410.887329
+192634.071414     8253398.465421
+192651.746980     8253383.588730
+192666.823909     8253378.713569
+192682.538623     8253372.591006
+192699.493849     8253367.732853
+192712.059777     8253363.461335
+192724.081399     8253350.412876
+192736.740804     8253336.117111
+192747.468567     8253327.442910
+192760.689805     8253320.044529
+192775.801789     8253311.410155
+192793.418932     8253302.798690
+192811.000257     8253297.946238
+192829.214287     8253292.473039
+192844.946527     8253284.470918
+192860.643713     8253280.227913
+192874.515184     8253270.329131
+192887.086955     8253265.431061
+192899.072758     8253256.141712
+192910.398173     8253250.605784
+192921.120095     8253242.558039
+192931.848622     8253233.883845
+192943.225854     8253222.709236
+192955.838520     8253213.425595
+192976.645345     8253198.577417
+192989.907478     8253186.793463
+193001.882362     8253178.757128
+193012.042449     8253163.812095
+193027.815585     8253151.424402
+193042.974306     8253137.778001
+193055.060194     8253117.837861
+193063.968083     8253102.881426
+193070.985228     8253089.160887
+193076.170050     8253070.411114
+193080.665274     8253058.547232
+193082.040159     8253045.401918
+193085.340843     8253027.261497
+193080.471503     8253012.179605
+193068.706942     8252997.661434
+193052.582294     8252980.597333
+193042.655133     8252970.481885
+193030.241103     8252958.464074
+193019.062509     8252948.337231
+193004.746050     8252938.808370
+192994.176028     8252930.566739
+192970.500849     8252917.193269
+192956.787884     8252910.176179
+192935.588652     8252899.958087
+192918.175989     8252886.641597
+192907.605966     8252878.400013
+192898.925925     8252868.922479
+192886.628741     8252844.374407
+192872.453261     8252819.809232
+192858.856377     8252800.261874
+192850.838253     8252787.030979
+192842.251687     8252767.529246
+192834.221114     8252755.551351
+192828.087128     8252741.711009
+192823.838044     8252727.261322
+192823.340476     8252713.472305
+192822.830458     8252700.936337
+192826.189564     8252676.530881
+192833.868626     8252659.056934
+192842.149653     8252644.094742
+192855.494343     8252623.539604
+192867.602835     8252601.093443
+192877.798740     8252582.389301
+192887.958828     8252567.444244
+192899.997976     8252552.516299
+192910.128852     8252540.703784
+192918.990004     8252530.759424
+192934.153804     8252516.486465
+192949.956151     8252500.966207
+192961.960245     8252489.797330
+192972.688773     8252481.123112
+192991.466875     8252461.571466
+193006.656920     8252439.510903
+END
+LINE3D
+HEIGHT 1070.000000
+184374.024909     8258937.000000
+184387.584827     8258923.679239
+184400.932600     8258902.496268
+184412.314657     8258890.694051
+184433.815035     8258868.331806
+184453.413254     8258848.458817
+184472.350638     8258832.338344
+184491.908291     8258816.850645
+184509.599321     8258800.093279
+184525.475133     8258776.426699
+184541.379915     8258749.628316
+184559.140114     8258725.352324
+184573.728624     8258705.434137
+184586.403776     8258689.257166
+184598.505013     8258667.436536
+184613.099317     8258646.891989
+184627.055963     8258627.594514
+184639.719520     8258612.671029
+184648.602325     8258600.219851
+184657.462329     8258590.274884
+184667.591863     8258578.461367
+184677.710191     8258567.900575
+184689.729906     8258554.851285
+184701.796371     8258536.789584
+184718.257680     8258517.514706
+184735.965717     8258498.877490
+184749.870202     8258485.218792
+184759.367872     8258474.025987
+184770.825266     8258454.079551
+184775.319021     8258442.215188
+184779.835956     8258427.845000
+184785.083283     8258402.202909
+184789.095853     8258374.670439
+184793.044290     8258354.029462
+184797.039095     8258328.376071
+184800.355669     8258308.355807
+184801.799443     8258287.692233
+184805.052264     8258274.563849
+184806.426494     8258261.418133
+184810.920246     8258249.554152
+184813.030660     8258224.510555
+184814.497618     8258201.340774
+184814.045031     8258182.539713
+184809.197597     8258164.952210
+184803.706706     8258149.238523
+184798.192253     8258136.030658
+184787.685473     8258120.898513
+184777.799352     8258106.398381
+184762.914732     8258090.599943
+184746.145724     8258075.410918
+184733.737172     8258062.767650
+184726.321325     8258052.049047
+184717.675752     8258038.813315
+184707.186362     8258021.801324
+184695.468012     8258002.272210
+184683.731896     8257984.622175
+184663.849156     8257967.525819
+184645.195761     8257952.946206
+184622.761993     8257940.839286
+184606.004578     8257924.397157
+184596.727141     8257911.782137
+184586.220361     8257896.649993
+184577.575175     8257883.413882
+184567.688672     8257868.913746
+184553.459481     8257849.988393
+184543.538588     8257839.247189
+184531.141624     8257825.351200
+184520.571099     8257817.110169
+184506.875248     8257808.214912
+184494.437718     8257798.704212
+184478.921234     8257783.526487
+184464.680452     8257765.854237
+184453.570785     8257748.210237
+184441.869442     8257726.801273
+184432.667346     8257706.041652
+184422.276481     8257678.378852
+184419.910908     8257663.320157
+184403.860698     8257638.112715
+184395.203729     8257626.129707
+184376.567716     8257609.671012
+184361.677493     8257594.498937
+184351.750611     8257584.384475
+184341.197663     8257574.263982
+184330.024053     8257563.511859
+184313.875513     8257548.954845
+184303.334153     8257537.581631
+184290.287747     8257526.185816
+184273.460784     8257517.261927
+184242.236560     8257507.581734
+184210.374673     8257499.148996
+184179.764927     8257490.727554
+184152.274896     8257483.587468
+184120.372252     8257479.540017
+184097.868941     8257474.950955
+184074.072346     8257474.736262
+184054.044908     8257473.302749
+184030.288883     8257468.702385
+184000.230248     8257468.431196
+183969.585922     8257463.768685
+183939.567665     8257459.111823
+183910.767156     8257458.225573
+183877.612181     8257454.166824
+183847.553546     8257453.895635
+183828.140590     8257453.720492
+183804.343995     8257453.505799
+183781.840681     8257448.917119
+183756.171291     8257448.058735
+183733.047321     8257442.837660
+183707.412703     8257438.220347
+183687.425835     8257432.401162
+183664.945516     8257425.305890
+183634.996994     8257413.131172
+183600.084939     8257395.898839
+183573.939971     8257378.745603
+183557.000000     8257369.222942
+END
+LINE3D
+HEIGHT 1080.000000
+184045.482525     8258937.000000
+184051.877018     8258926.289735
+184067.283045     8258885.701942
+184083.883639     8258851.390586
+184104.125700     8258829.643402
+184129.371675     8258808.567776
+184148.436558     8258778.664309
+184162.404601     8258758.114112
+184176.361253     8258738.815873
+184188.392748     8258724.513863
+184193.518367     8258712.028788
+184204.320721     8258695.208508
+184218.445438     8258657.741985
+184232.552575     8258622.155307
+184247.187643     8258597.224707
+184268.119524     8258568.591675
+184280.243753     8258544.264835
+184287.961350     8258522.404655
+184295.661371     8258502.423939
+184307.142140     8258479.971297
+184318.634310     8258456.265551
+184331.442755     8258425.679225
+184343.097390     8258384.431174
+184353.313857     8258363.219953
+184361.680899     8258338.859216
+184372.627943     8258306.376857
+184381.023963     8258278.883552
+184385.592868     8258258.874587
+184391.408689     8258239.503666
+184398.482449     8258219.517299
+184403.109500     8258193.243199
+184407.162257     8258161.325053
+184411.777716     8258136.304057
+184412.635990     8258111.249163
+184412.763492     8258097.465786
+184412.954744     8258076.790912
+184408.768155     8258055.449747
+184403.955492     8258034.103315
+184398.562744     8258007.738816
+184388.653251     8257995.744507
+184381.248801     8257983.773181
+184373.212108     8257972.422181
+184362.763475     8257951.024902
+184356.031462     8257934.046809
+184346.829366     8257913.287189
+184339.511661     8257891.917774
+184333.411704     8257874.318971
+184327.300155     8257857.973271
+184318.753302     8257834.086350
+184308.953922     8257810.188511
+184302.801804     8257798.228484
+184291.721119     8257777.451533
+184277.526509     8257754.767248
+184258.322382     8257732.037769
+184240.944499     8257714.963629
+184226.083253     8257696.658986
+184209.934710     8257682.102354
+184198.767088     8257670.723490
+184191.345064     8257660.631244
+184178.930714     8257648.614719
+184161.547228     8257632.166942
+184144.731854     8257621.990332
+184122.245737     8257615.521803
+184100.374291     8257610.312028
+184076.021173     8257602.573447
+184055.390657     8257598.628076
+184037.896864     8257594.084210
+184009.757391     8257589.444298
+183994.148176     8257584.291021
+183978.498395     8257583.523033
+183966.014498     8257579.024748
+183951.617239     8257578.268061
+183927.820836     8257578.053370
+183912.750758     8257582.303446
+183890.769198     8257588.997201
+183866.282781     8257595.668740
+183848.702245     8257600.522579
+183835.493566     8257606.669070
+183821.044146     8257611.551159
+183808.484908     8257615.197474
+183792.174090     8257618.183148
+183777.765049     8257618.679563
+183750.217062     8257617.804612
+183724.588242     8257612.560556
+183703.308281     8257611.115743
+183687.061216     8257607.209537
+183671.498365     8257597.044227
+183656.492231     8257594.402426
+183640.877221     8257589.875509
+183627.732291     8257589.130503
+183614.593349     8257587.758755
+183599.024704     8257578.219806
+183584.087922     8257568.060145
+183562.935467     8257552.831572
+183557.000000     8257547.261108
+END
+LINE3D
+HEIGHT 1090.000000
+183623.974043     8258937.000000
+183634.203489     8258920.641487
+183644.431735     8258898.177545
+183652.752410     8258878.829223
+183662.302241     8258861.997643
+183669.323836     8258847.650434
+183678.253390     8258830.186844
+183685.280786     8258815.212510
+183693.578278     8258798.370396
+183703.174469     8258776.527165
+183716.528037     8258754.717833
+183727.944866     8258739.156687
+183739.344312     8258725.474624
+183750.111886     8258712.414037
+183763.419087     8258695.617120
+183773.589378     8258679.418315
+183785.069963     8258656.964907
+183795.907081     8258636.386463
+183807.967561     8258618.951120
+183819.407573     8258600.883767
+183833.323645     8258585.972347
+183845.384125     8258568.537005
+183858.053476     8258552.987159
+183870.798172     8258529.292330
+183887.294444     8258506.258526
+183901.274082     8258484.454843
+183913.937639     8258469.531358
+183923.441099     8258457.712575
+183939.282136     8258437.805306
+183947.527470     8258426.601585
+183958.312243     8258411.661150
+183965.322441     8258398.566664
+183977.945428     8258388.028851
+183994.975235     8258375.024762
+184016.440649     8258356.421445
+184027.196636     8258344.613580
+184037.998795     8258327.793680
+184047.513847     8258314.721793
+184055.179287     8258298.500007
+184063.551932     8258273.512908
+184073.171303     8258249.163852
+184081.451413     8258234.200819
+184089.076089     8258222.365086
+184096.753121     8258204.890196
+184107.572666     8258186.190832
+184119.041843     8258164.991295
+184129.258501     8258143.780075
+184138.164677     8258128.823073
+184145.800949     8258115.733853
+184149.714806     8258098.851808
+184154.347651     8258071.951347
+184155.808620     8258049.408307
+184157.356717     8258017.467182
+184158.858447     8257990.538472
+184159.617814     8257976.134383
+184159.756908     8257961.097903
+184159.936568     8257941.676133
+184159.466977     8257924.754540
+184158.440478     8257900.309437
+184154.236503     8257880.847735
+184153.766913     8257863.926142
+184148.878718     8257850.724309
+184141.480065     8257838.126240
+184131.025447     8257817.355319
+184123.006330     8257804.124857
+184117.515057     8257788.411167
+184108.231823     8257776.422890
+184084.615083     8257756.786047
+184068.454948     8257743.482519
+184051.645562     8257732.679168
+184036.030552     8257728.152251
+184017.296016     8257722.344365
+183993.534196     8257718.370361
+183975.385351     8257716.953796
+183957.851180     8257716.795603
+183940.322614     8257716.010666
+183921.535920     8257715.841172
+183898.986051     8257716.264523
+183863.279857     8257717.195208
+183837.569895     8257720.722878
+183817.501700     8257723.674653
+183798.680233     8257727.264089
+183776.727648     8257730.825658
+183755.424511     8257731.886287
+183732.219593     8257735.436558
+183712.800843     8257735.887775
+183691.497703     8257736.948787
+183672.711008     8257736.779294
+183656.429168     8257736.632399
+183639.521066     8257736.479854
+183620.113904     8257735.678350
+183599.494984     8257730.479493
+183580.760447     8257724.671607
+183560.784983     8257717.598934
+183557.000000     8257715.774871
+END
+LINE3D-MASTER
+HEIGHT 1100.000000
+183557.000000     8258352.931453
+183566.876256     8258345.473027
+183582.641947     8258333.710742
+183598.413437     8258321.321713
+183613.564462     8258308.300292
+183629.353338     8258294.031799
+183643.286612     8258277.240148
+183655.353073     8258259.178829
+183666.155232     8258242.358929
+183676.308137     8258228.039589
+183684.553284     8258216.835484
+183694.683006     8258205.022351
+183702.916752     8258195.071351
+183712.472373     8258177.613792
+183722.062766     8258156.397304
+183732.911289     8258134.565372
+183741.145035     8258124.614372
+183755.147853     8258100.304864
+183759.026938     8258087.181747
+183759.780702     8258073.404020
+183761.241671     8258050.860981
+183756.985726     8258037.038057
+183752.114917     8258021.956760
+183746.606449     8258008.122535
+183731.095758     8257992.318450
+183721.163083     8257982.830348
+183708.696575     8257976.452217
+183683.821515     8257957.430816
+183665.092775     8257950.996187
+183646.990298     8257944.567207
+183622.016713     8257936.196615
+183598.289856     8257928.463684
+183581.433916     8257922.672364
+183564.578163     8257916.881427
+183557.000000     8257914.277799
+END
+LINE3D
+HEIGHT 1040.000000
+191856.529579     8258937.000000
+191859.574504     8258934.700483
+191875.328611     8258924.190536
+191888.572636     8258914.285122
+191903.044854     8258906.897205
+191914.386727     8258899.480281
+191931.445128     8258883.343620
+191951.536889     8258877.885641
+191979.734313     8258876.260799
+192002.278194     8258876.464190
+192029.832165     8258876.712781
+192049.871000     8258876.893571
+192066.790315     8258875.792626
+192086.870480     8258871.588134
+192111.293336     8258871.808476
+192143.242152     8258870.843892
+192164.574465     8258866.649932
+192179.614798     8258865.532799
+192192.766095     8258865.651450
+192207.162975     8258866.407751
+192218.342571     8258876.533516
+192239.506805     8258890.509368
+192253.208071     8258898.777879
+192261.859437     8258911.387250
+192275.410014     8258935.945728
+192275.491862     8258937.000000
+END
+LINE3D
+HEIGHT 1030.000000
+191546.312349     8258937.000000
+191555.241801     8258930.701207
+191572.289372     8258915.818039
+191593.690464     8258904.106214
+191615.747368     8258889.267476
+191645.922296     8258877.008395
+191666.767625     8258857.773070
+191686.331073     8258841.659010
+191707.779296     8258824.934777
+191726.693489     8258811.321276
+191751.243087     8258797.757852
+191775.799235     8258783.568840
+191800.338002     8258771.258910
+191818.631926     8258757.012635
+191835.667144     8258743.382182
+191859.632001     8258725.427828
+191883.607682     8258706.220745
+191913.811588     8258690.829096
+191934.633741     8258674.099214
+191952.909511     8258661.732779
+191974.317162     8258649.394600
+191993.869014     8258634.534026
+192020.912826     8258622.246697
+192042.384233     8258603.016256
+192061.947680     8258586.902196
+192083.992989     8258573.316943
+192102.901392     8258560.329421
+192128.634343     8258554.295924
+192153.178904     8258541.359633
+192172.046737     8258532.757782
+192190.914567     8258524.156314
+192204.789695     8258513.629798
+192223.043050     8258503.769195
+192236.930531     8258491.989964
+192248.300614     8258481.440848
+192260.291734     8258471.524130
+192272.323426     8258457.221357
+192281.206614     8258444.770182
+192285.815894     8258420.375926
+192286.598444     8258403.465629
+192282.957169     8258390.901459
+192276.202163     8258376.429575
+192270.815209     8258349.438716
+192267.249278     8258328.729563
+192268.031825     8258311.819649
+192269.423059     8258296.794465
+192277.767110     8258274.939937
+192288.012554     8258250.596147
+192293.810990     8258233.104691
+192294.593540     8258216.194395
+192301.713663     8258191.195995
+192302.508566     8258173.032984
+192302.630274     8258159.875968
+192302.746184     8258147.345696
+192301.626576     8258132.924655
+192297.376616     8258118.475372
+192297.527298     8258102.186170
+192297.133049     8258077.119976
+192297.359076     8258052.685791
+192298.159012     8258033.896030
+192308.369681     8258013.311551
+192312.926804     8257994.555687
+192326.194012     8257982.144065
+192342.579980     8257971.013789
+192360.189114     8257963.026995
+192382.112718     8257962.598377
+192396.516157     8257962.728325
+192414.636212     8257967.277841
+192427.647654     8257982.432583
+192436.919293     8257995.674346
+192448.707573     8258007.685223
+192457.353142     8258020.921337
+192467.929083     8258028.535621
+192486.014366     8258036.844066
+192498.504057     8258040.715991
+192514.148044     8258042.110339
+192531.055764     8258042.262880
+192546.091066     8258041.772115
+192562.419082     8258036.906593
+192575.575410     8258036.398876
+192588.105667     8258035.885511
+192605.640221     8258036.043708
+192623.174775     8258036.201904
+192645.718656     8258036.405295
+192665.757491     8258036.586085
+192685.135484     8258040.520155
+192704.520035     8258043.827872
+192729.603733     8258040.294934
+192744.690433     8258034.165387
+192762.891626     8258029.943560
+192789.877483     8258023.921366
+192808.710541     8258019.078827
+192825.038557     8258014.213305
+192840.763679     8258006.836691
+192852.841736     8257987.521886
+192866.751636     8257973.236441
+192886.872374     8257964.645894
+192913.219804     8257959.871149
+192936.395549     8257959.453828
+192961.496636     8257954.041043
+192981.571008     8257950.462911
+193002.276482     8257946.263677
+193027.998607     8257941.483291
+193054.351834     8257936.081803
+193073.196484     8257929.986160
+193089.524497     8257925.121020
+193106.467752     8257921.514639
+193118.998013     8257921.000892
+193144.087508     8257916.841211
+193166.712524     8257908.273640
+193183.063720     8257900.902292
+193200.029395     8257894.789697
+193218.903022     8257885.561486
+193236.570873     8257871.309945
+193256.771982     8257853.948430
+193283.844772     8257838.528532
+193304.643741     8257824.304857
+193326.056422     8257811.340311
+193342.472132     8257797.077473
+193357.634172     8257782.803325
+193374.049886     8257768.540105
+193391.757541     8257749.902885
+193404.484847     8257728.087903
+193417.148401     8257713.164801
+193427.916362     8257700.103835
+193440.562529     8257687.060197
+193450.709449     8257673.367215
+193461.459256     8257662.186090
+193472.238804     8257647.872403
+193487.383459     8257635.477719
+193500.679645     8257619.933529
+193515.824300     8257607.538845
+193534.083449     8257597.051881
+193557.352689     8257586.610119
+193576.220518     8257578.008651
+193595.059374     8257572.539368
+193614.524300     8257567.075734
+193637.734817     8257562.899483
+193660.325064     8257558.090459
+193681.042892     8257552.638511
+193700.513612     8257546.548516
+193721.863307     8257540.475474
+193741.936918     8257536.896952
+193762.614176     8257535.830676
+193786.422553     8257534.792267
+193805.209248     8257534.961760
+193822.116967     8257535.114301
+193835.273298     8257534.606202
+193849.676736     8257534.736150
+193862.827269     8257534.854794
+193886.624055     8257535.069488
+193903.525977     8257535.848772
+193917.267808     8257539.731993
+193932.911795     8257541.126341
+193947.274664     8257545.641961
+193959.103510     8257553.267548
+193974.057677     8257561.547745
+193987.787917     8257566.684070
+193997.714608     8257576.798531
+194010.070999     8257595.080575
+194016.136181     8257616.438689
+194019.644160     8257643.412597
+194019.528250     8257655.942869
+194004.916938     8257678.367267
+193990.948319     8257698.917841
+193986.420174     8257714.541137
+193981.915210     8257727.658607
+193981.660209     8257755.224978
+193980.239232     8257773.382723
+193980.007411     8257798.443269
+193979.665473     8257835.407726
+193975.119943     8257852.910486
+193974.354782     8257867.940936
+193972.858464     8257894.243282
+193968.359297     8257906.734009
+193968.191226     8257924.903057
+193966.781841     8257941.807699
+193962.195741     8257963.696130
+193960.816102     8257977.467828
+193959.377739     8257997.505037
+193957.812639     8258031.325630
+193952.593910     8258053.834767
+193944.308580     8258069.424165
+193942.939764     8258081.943135
+193930.844322     8258103.137404
+193921.880763     8258124.359547
+193901.655706     8258144.227263
+193889.050104     8258152.885612
+193865.109195     8258168.333766
+193843.695750     8258181.298305
+193822.346055     8258187.371348
+193800.393470     8258190.932917
+193774.660518     8258196.966414
+193752.076071     8258201.148313
+193733.869080     8258205.996883
+193717.500498     8258215.247695
+193705.428240     8258233.935757
+193699.566055     8258258.318711
+193693.187913     8258270.792486
+193684.327905     8258280.737835
+193674.192577     8258293.177713
+193664.063047     8258304.990848
+193653.306678     8258316.798710
+193644.447438     8258326.743684
+193633.685276     8258339.177906
+193617.252941     8258355.320597
+193597.005468     8258377.694146
+193579.378187     8258387.560014
+193564.939973     8258391.189378
+193547.997482     8258394.795766
+193531.089763     8258394.643225
+193509.171953     8258394.445482
+193490.460599     8258386.131388
+193478.620162     8258379.758905
+193461.792817     8258370.835013
+193446.247351     8258358.790239
+193434.459839     8258346.778986
+193425.176605     8258334.790710
+193412.773850     8258321.520698
+193391.632792     8258305.039403
+193369.801915     8258295.443956
+193354.818770     8258290.296327
+193332.999484     8258279.447777
+193321.147455     8258274.328397
+193306.158516     8258269.807129
+193293.645644     8258268.441030
+193271.095970     8258268.864000
+193252.888978     8258273.712570
+193235.279848     8258281.698981
+193218.928651     8258289.070329
+193206.334645     8258296.475191
+193198.065936     8258310.185118
+193191.079109     8258320.773780
+193179.006851     8258339.461842
+193162.615085     8258351.218862
+193147.516033     8258358.601123
+193129.929318     8258364.081703
+193112.395528     8258363.923513
+193093.608834     8258363.754020
+193078.567734     8258364.871528
+193048.404398     8258375.877505
+193021.378736     8258386.285377
+192997.506609     8258394.215283
+192981.155413     8258401.586631
+192969.749794     8258415.894669
+192960.890555     8258425.839643
+192950.099414     8258441.406434
+192947.321978     8258470.830051
+192942.759059     8258490.212658
+192941.964920     8258508.375676
+192940.561329     8258524.653956
+192936.038982     8258539.650509
+192934.526043     8258567.832326
+192929.973951     8258585.961822
+192925.411031     8258605.344428
+192920.864740     8258622.846799
+192913.848932     8258636.568412
+192903.702016     8258650.261011
+192885.413893     8258663.880160
+192868.401851     8258675.005171
+192853.308593     8258681.761072
+192831.982081     8258685.327907
+192814.413513     8258688.929411
+192784.922611     8258694.929004
+192756.075933     8258699.054405
+192737.277650     8258700.137633
+192717.186654     8258705.595619
+192705.201328     8258714.885976
+192685.678447     8258726.614747
+192667.987416     8258743.372113
+192653.450678     8258757.652285
+192638.978461     8258765.040202
+192625.114160     8258774.313608
+192608.716600     8258786.696988
+192588.544465     8258800.926317
+192573.387458     8258814.573715
+192563.246329     8258827.640719
+192553.713894     8258842.591688
+192549.179184     8258858.842102
+192543.984404     8258878.845038
+192539.449701     8258895.094687
+192534.266508     8258913.844903
+192529.781035     8258937.000000
+END
+LINE3D
+HEIGHT 1010.000000
+187460.099470     8258937.000000
+187463.152225     8258931.376393
+187477.050915     8258918.344055
+187490.960811     8258904.058992
+187503.554825     8258896.653365
+187519.906400     8258889.282404
+187529.995368     8258881.854176
+187538.234714     8258871.277196
+187542.734263     8258858.786473
+187544.125880     8258843.761293
+187544.311334     8258823.713162
+187544.531567     8258799.905338
+187543.400748     8258786.737404
+187539.133020     8258774.167582
+187533.682696     8258754.068605
+187528.823676     8258737.733441
+187523.413535     8258713.249172
+187511.161466     8258683.689576
+187501.941984     8258664.809420
+187493.940254     8258649.699493
+187489.666725     8258637.756797
+187481.636017     8258625.779438
+187476.127361     8258611.944830
+187469.998423     8258597.478977
+187465.162580     8258578.638370
+187461.521304     8258566.074200
+187454.829670     8258544.710434
+187442.490664     8258524.548925
+187435.729865     8258510.703403
+187425.252063     8258492.438690
+187416.623880     8258477.323111
+187407.387013     8258460.322419
+187402.551170     8258441.481813
+187397.674757     8258427.026878
+187390.919752     8258412.554994
+187381.653907     8258398.686871
+187377.397771     8258384.863945
+187368.786970     8258367.869285
+187366.404015     8258354.689672
+187355.897236     8258339.557527
+187350.371191     8258327.602765
+187344.880300     8258311.889078
+187342.531735     8258294.950533
+187338.896253     8258281.760002
+187334.645911     8258267.310716
+187329.810068     8258248.470109
+187333.717940     8258232.214422
+187345.082608     8258222.292052
+187361.335661     8258225.571517
+187373.807967     8258231.322905
+187387.509225     8258239.592181
+187399.969939     8258246.596674
+187414.900923     8258257.383078
+187429.222844     8258266.283984
+187439.167299     8258274.519366
+187454.706967     8258287.190883
+187476.990049     8258315.587387
+187494.907264     8258342.064499
+187509.814682     8258355.357108
+187523.498941     8258365.505469
+187534.052080     8258375.625963
+187545.190724     8258390.137396
+187558.799642     8258408.430358
+187573.028832     8258427.355711
+187585.901177     8258457.547316
+187594.488794     8258477.048184
+187603.128569     8258490.910659
+187611.153100     8258503.514375
+187621.063169     8258515.508307
+187628.479017     8258526.226909
+187639.008594     8258538.853226
+187648.889685     8258553.979726
+187656.920011     8258565.957081
+187666.869878     8258573.566098
+187681.806660     8258583.725760
+187693.658693     8258588.844757
+187706.130994     8258594.596528
+187718.597502     8258600.974660
+187732.321945     8258606.737728
+187747.931156     8258611.891388
+187764.173004     8258616.423577
+187776.651100     8258621.548988
+187795.959550     8258633.000916
+187816.491155     8258647.597474
+187838.293055     8258660.325489
+187850.127698     8258667.324333
+187865.742711     8258671.850867
+187880.725852     8258676.998878
+187893.209750     8258681.497164
+187906.882031     8258692.899007
+187921.215926     8258700.546813
+187934.325886     8258705.051511
+187951.188010     8258710.215709
+187967.429086     8258714.748656
+187983.699147     8258716.148271
+188006.805348     8258723.248807
+188028.039133     8258729.706037
+188039.879570     8258736.078520
+188053.609807     8258741.215228
+188066.053131     8258750.099567
+188089.142708     8258759.079957
+188102.217903     8258767.342819
+188115.293092     8258775.606447
+188128.995122     8258783.874964
+188140.817406     8258792.127288
+188156.293325     8258811.690302
+188163.054885     8258825.536214
+188170.424369     8258841.266850
+188177.811242     8258855.117639
+188183.343081     8258866.446039
+188199.497231     8258880.375926
+188219.415126     8258893.713357
+188233.783028     8258897.602227
+188250.030663     8258901.508820
+188271.315845     8258902.327267
+188286.936652     8258906.227441
+188311.318942     8258910.833073
+188326.922359     8258916.613093
+188345.610525     8258927.433777
+188369.952250     8258936.424699
+188371.018232     8258937.000000
+END
+LINE3D
+HEIGHT 1010.000000
+189073.089853     8258937.000000
+189085.824139     8258932.231969
+189104.651399     8258928.016173
+189120.353345     8258923.145002
+189138.571160     8258917.043704
+189156.186853     8258908.430557
+189166.913480     8258899.755256
+189177.043771     8258887.942511
+189189.678351     8258876.151594
+189202.967978     8258861.233757
+189216.889470     8258845.695209
+189231.449385     8258828.909594
+189250.392563     8258812.162760
+189268.692281     8258797.290124
+189281.958725     8258784.878495
+189291.433204     8258776.192663
+189303.441713     8258764.396098
+189313.037904     8258742.552867
+189323.306532     8258715.702870
+189327.243378     8258696.314997
+189334.914226     8258679.467229
+189340.057617     8258665.102310
+189350.876971     8258646.402944
+189362.323159     8258627.709234
+189377.503350     8258611.555628
+189391.413254     8258597.269801
+189401.594942     8258579.818273
+189409.846265     8258567.987810
+189420.607663     8258555.553581
+189440.166081     8258540.065888
+189451.512984     8258532.022597
+189463.480920     8258524.612086
+189476.672023     8258520.345058
+189491.747895     8258515.468621
+189508.667206     8258514.368059
+189529.344467     8258513.301401
+189542.506592     8258512.166941
+189555.668717     8258511.032481
+189568.831603     8258509.898410
+189583.900917     8258505.648327
+189596.436972     8258504.508219
+189623.956171     8258508.515740
+189644.592864     8258511.834753
+189659.622372     8258511.970349
+189684.682886     8258510.943619
+189709.249866     8258495.501113
+189723.740237     8258486.233356
+189745.756572     8258475.780290
+189765.917115     8258462.804064
+189782.941510     8258450.426340
+189794.938424     8258439.883261
+189805.699822     8258427.449031
+189816.438040     8258417.520627
+189832.807387     8258408.269822
+189854.759969     8258404.708635
+189869.782919     8258405.470585
+189887.891382     8258411.273206
+189901.639772     8258414.530073
+189919.109813     8258421.579760
+189940.349391     8258427.410629
+189963.484571     8258431.378597
+189977.888009     8258431.508545
+189996.094997     8258426.660357
+190011.165075     8258422.410281
+190026.861223     8258418.165853
+190048.239131     8258408.960236
+190059.598387     8258399.664230
+190070.951844     8258390.994967
+190083.534263     8258384.842826
+190094.284069     8258373.661700
+190104.378832     8258365.607112
+190114.485182     8258356.299802
+190125.241547     8258344.492323
+190135.997151     8258332.684454
+190150.504909     8258321.537233
+190165.000309     8258311.643108
+190178.232746     8258302.990415
+190191.447029     8258296.217562
+190205.310565     8258286.944149
+190218.507465     8258282.050378
+190232.325399     8258277.789388
+190248.647618     8258273.550609
+190271.197296     8258273.127256
+190286.232599     8258272.636491
+190301.888177     8258272.777736
+190313.711229     8258281.029684
+190328.026970     8258290.557329
+190337.948627     8258301.298540
+190351.615114     8258313.326744
+190364.075828     8258320.331237
+190375.916266     8258326.703720
+190388.411751     8258329.949284
+190405.945541     8258330.107473
+190429.116256     8258330.316519
+190452.326776     8258326.139886
+190464.920786     8258318.734642
+190476.894520     8258310.697388
+190490.103009     8258304.550895
+190509.596909     8258295.955075
+190526.545962     8258291.721952
+190537.869681     8258286.184868
+190552.302097     8258283.182247
+190570.468515     8258282.719731
+190593.018194     8258282.296379
+190617.493207     8258276.878328
+190631.269811     8258277.002620
+190648.850728     8258272.148784
+190664.506307     8258272.290029
+190680.196661     8258268.671962
+190695.904398     8258263.174813
+190711.623729     8258256.424178
+190729.853901     8258249.069782
+190747.451440     8258242.336475
+190764.400493     8258238.103351
+190779.516170     8258228.841235
+190799.642702     8258219.624328
+190810.972216     8258213.460883
+190823.560428     8258206.682381
+190848.099194     8258194.372451
+190861.301889     8258188.852319
+190876.400944     8258181.469675
+190892.746343     8258174.725071
+190907.828013     8258169.221891
+190926.063978     8258161.241135
+190943.023855     8258155.755283
+190963.179365     8258143.405807
+190975.170488     8258133.488706
+190988.396363     8258125.462749
+191002.248308     8258117.442441
+191019.881386     8258106.949829
+191037.542678     8258093.324642
+191048.919319     8258082.149172
+191066.598762     8258066.644527
+191079.239135     8258054.227250
+191086.231756     8258043.012227
+191091.380177     8258028.020940
+191095.932265     8258009.891827
+191096.709022     8257993.607891
+191098.790840     8257971.696866
+191099.538615     8257958.545881
+191099.666117     8257944.762504
+191099.793620     8257930.979127
+191094.968986     8257910.885413
+191085.703138     8257897.017672
+191076.402521     8257886.908478
+191060.799100     8257881.128840
+191045.775389     8257880.366501
+191034.428490     8257888.409410
+191024.954004     8257897.096008
+191014.847653     8257906.403317
+191007.825291     8257920.750901
+191002.676870     8257935.742188
+190998.182736     8257947.606165
+190992.419837     8257961.338699
+190987.276450     8257975.703235
+190978.346895     8257993.166825
+190968.808660     8258008.744920
+190952.370534     8258025.513589
+190941.005481     8258035.436338
+190930.899131     8258044.743648
+190918.287735     8258054.028357
+190899.373538     8258067.642240
+190883.636824     8258076.271957
+190869.205172     8258079.274585
+190868.097156     8258063.600440
+190869.523926     8258044.816335
+190879.665049     8258031.750096
+190891.064109     8258018.068411
+190901.843658     8258003.754724
+190908.842076     8257991.912958
+190915.915835     8257971.926591
+190923.593246     8257954.452087
+190929.988774     8257940.098848
+190938.337854     8257917.617953
+190944.084131     8257905.764890
+190949.210133     8257893.279818
+190961.293219     8257873.338645
+190969.608292     8257854.616686
+190977.894387     8257839.027294
+190984.910191     8257825.306064
+190993.160746     8257813.475977
+191001.412069     8257801.645515
+191010.973484     8257783.561595
+191016.760332     8257767.322860
+191010.666168     8257749.097697
+191000.147418     8257735.218270
+190989.681594     8257715.700074
+190981.662092     8257702.469990
+190973.631766     8257690.492635
+190963.118810     8257675.986848
+190953.221097     8257662.739819
+190939.525633     8257653.844183
+190927.070717     8257646.212947
+190912.058594     8257644.197887
+190888.261808     8257643.983192
+190866.965035     8257644.417849
+190845.597954     8257652.370356
+190826.104054     8257660.966176
+190809.131817     8257667.705507
+190783.393071     8257674.365365
+190765.916473     8257667.942032
+190761.075214     8257649.728172
+190766.212043     8257635.989989
+190766.362729     8257619.700405
+190757.096881     8257605.832664
+190757.241769     8257590.169823
+190757.375069     8257575.759703
+190774.329916     8257570.900219
+190790.727476     8257558.516839
+190808.980827     8257548.656618
+190821.586429     8257539.998270
+190841.723789     8257529.528251
+190859.356864     8257519.036022
+190870.761722     8257504.727594
+190880.259388     8257493.535172
+190884.260751     8257467.255426
+190885.078073     8257446.586201
+190884.689618     8257420.893646
+190883.552624     8257408.352070
+190878.693983     8257392.017291
+190871.961393     8257375.039576
+190869.573023     8257362.486710
+190863.490455     8257343.008059
+190859.848415     8257330.443882
+190855.604249     8257315.368239
+190851.412248     8257294.653437
+190846.512270     8257282.704706
+190837.901473     8257265.709663
+190832.410200     8257249.995973
+190827.586331     8257229.902266
+190823.324015     8257216.706079
+190818.482760     8257198.491837
+190809.234301     8257182.744249
+190804.398076     8257163.903639
+190800.177094     8257146.321788
+190797.851708     8257126.877417
+190809.813854     8257120.092885
+190826.709981     8257121.498530
+190836.654058     8257129.733526
+190846.535146     8257144.860408
+190859.540791     8257160.641893
+190870.650075     8257178.285890
+190881.748531     8257197.182998
+190889.733258     8257214.172393
+190901.480204     8257230.568935
+190910.137365     8257242.551945
+190920.069849     8257252.040045
+190928.089351     8257265.270128
+190936.734920     8257278.506243
+190946.638427     8257291.126911
+190955.944842     8257300.609362
+190967.721530     8257313.873342
+190977.648220     8257323.987803
+190994.463209     8257334.164794
+191005.016734     8257344.284907
+191024.313588     8257356.990322
+191037.429346     8257360.868277
+191050.504539     8257369.131522
+191062.333384     8257376.757109
+191083.532397     8257386.973268
+191095.384427     8257392.092648
+191109.746531     8257396.608261
+191130.377429     8257400.553635
+191144.142441     8257401.931031
+191158.505310     8257406.446651
+191170.995001     8257410.318575
+191194.112791     8257416.166390
+191219.788551     8257416.398036
+191233.565155     8257416.522328
+191247.335964     8257417.272981
+191261.733605     8257418.029672
+191284.903556     8257418.238711
+191303.064180     8257418.402556
+191317.467618     8257418.532503
+191332.543491     8257413.656067
+191345.734593     8257409.389039
+191360.172042     8257405.759668
+191372.116799     8257400.854983
+191394.701249     8257396.672701
+191407.852546     8257396.791352
+191426.645035     8257396.334485
+191441.673779     8257396.470074
+191458.570671     8257397.875725
+191471.089340     8257398.615082
+191485.532583     8257394.359350
+191492.607104     8257374.373373
+191493.488178     8257346.812268
+191494.891001     8257330.534363
+191500.028595     8257316.796187
+191510.123353     8257308.741982
+191525.268772     8257296.347305
+191542.814154     8257295.252391
+191554.793685     8257286.588394
+191570.536197     8257277.331933
+191580.642548     8257268.024624
+191600.206759     8257251.910571
+191618.552077     8257232.025896
+191625.557053     8257219.557776
+191631.401088     8257197.054280
+191641.641503     8257173.336858
+191653.730383     8257152.769324
+191662.601978     8257141.571253
+191677.747398     8257129.176576
+191689.750109     8257118.006754
+191702.361505     8257108.722045
+191720.649632     8257095.102514
+191731.364667     8257087.680317
+191743.993448     8257076.516143
+191766.009783     8257066.063077
+191778.569018     8257062.417144
+191801.188240     8257054.475933
+191813.127202     8257050.197608
+191824.457480     8257044.034171
+191837.689152     8257035.381471
+191847.163635     8257026.695256
+191854.173645     8257013.600386
+191866.814018     8257001.183109
+191878.144296     8256995.019671
+191893.300542     8256981.371883
+191906.509795     8256975.225398
+191919.132780     8256964.687967
+191929.876792     8256954.133202
+191969.787004     8256904.994410
+191985.599063     8256888.219710
+192003.289329     8256871.462337
+192033.000464     8256841.654920
+192046.887181     8256829.875682
+192058.287006     8256816.194004
+192078.023025     8256785.514335
+END
+LINE3D
+HEIGHT 1010.000000
+191160.220704     8258937.000000
+191165.047281     8258933.446537
+191178.916611     8258923.546764
+191192.756964     8258916.779559
+191204.081448     8258911.242482
+191219.777593     8258906.998437
+191234.870850     8258900.242536
+191256.249523     8258891.036925
+191276.369497     8258882.446371
+191293.985190     8258873.833224
+191310.336383     8258866.462259
+191326.125261     8258852.193383
+191344.413385     8258838.574234
+191362.080474     8258824.322304
+191382.850466     8258813.231198
+191398.621956     8258800.842169
+191413.755779     8258789.700979
+191424.534567     8258775.386902
+191439.053916     8258762.986577
+191451.102227     8258746.804716
+191464.404207     8258730.634165
+191478.389448     8258708.204119
+191494.213098     8258690.176315
+191508.105613     8258677.770334
+191521.361233     8258666.611433
+191536.546453     8258649.831460
+191544.177500     8258637.368989
+191552.468625     8258621.153230
+191558.904722     8258602.414318
+191567.185023     8258587.451288
+191576.068211     8258575.000113
+191585.589060     8258561.301483
+191602.015597     8258545.785535
+191621.555865     8258532.177300
+191639.264284     8258513.540087
+191657.558205     8258499.294195
+191668.418128     8258476.209157
+191678.617206     8258456.877782
+191686.868529     8258445.047320
+191699.508902     8258432.630042
+191712.126093     8258422.718972
+191722.267218     8258409.652352
+191733.051797     8258394.712297
+191743.257436     8258374.754186
+191754.818771     8258343.530196
+191763.777299     8258322.934420
+191772.747420     8258301.085541
+191781.665383     8258284.875055
+191789.962305     8258268.032553
+191798.236808     8258253.696266
+191805.942432     8258233.089186
+191810.477135     8258216.839537
+191818.124807     8258202.497212
+191823.285580     8258186.253211
+191827.158677     8258173.756836
+191831.686821     8258158.133540
+191826.833975     8258141.172401
+191815.005129     8258133.546814
+191801.262533     8258129.663586
+191797.006779     8258115.840664
+191797.145869     8258100.804566
+191802.300849     8258085.186926
+191811.792721     8258074.620864
+191828.161303     8258065.370052
+191842.639318     8258057.355392
+191855.802207     8258056.220939
+191874.600493     8258055.137328
+191902.118929     8258059.144842
+191917.142640     8258059.907181
+191939.727090     8258055.724900
+191953.579799     8258047.704598
+191980.640232     8258033.537797
+191993.872669     8258024.885104
+192012.102076     8258017.530702
+192029.074309     8258010.791752
+192041.024863     8258005.260324
+192052.360170     8257998.470519
+192063.696246     8257991.680338
+192076.313436     8257981.769268
+192088.275578     8257974.985118
+192097.767450     8257964.419056
+192103.559326     8257947.553954
+192104.365821     8257928.137839
+192111.404809     8257911.910401
+192112.175767     8257896.253209
+192112.981497     8257876.837087
+192113.132183     8257860.547503
+192113.311843     8257841.125733
+192121.574755     8257828.042549
+192144.159205     8257823.860268
+192159.826375     8257822.748408
+192177.360929     8257822.906605
+192194.888925     8257823.691155
+192215.687891     8257809.467863
+192235.233952     8257795.233268
+192247.219278     8257785.942910
+192258.606747     8257773.514329
+192274.976093     8257764.263524
+192291.941768     8257758.150929
+192317.709491     8257748.358503
+192330.326685     8257738.447051
+192344.202577     8257727.920542
+192358.066114     8257718.647129
+192370.057233     8257708.730411
+192387.022908     8257702.617816
+192404.603826     8257697.763980
+192424.723800     8257689.173426
+192444.188722     8257683.710174
+192460.540683     8257676.338833
+192476.862901     8257672.100054
+192493.845961     8257664.107995
+192515.833319     8257656.787497
+192539.676468     8257651.990158
+192559.181963     8257642.140852
+192574.889700     8257636.643703
+192593.716964     8257632.427524
+192616.979642     8257622.612498
+192638.358314     8257613.406887
+192665.367355     8257604.878486
+192682.327235     8257599.392252
+192701.171885     8257593.296609
+192718.144118     8257586.557660
+192741.992300     8257581.133571
+192763.353584     8257573.807807
+192792.206063     8257569.055280
+192811.050713     8257562.959637
+192831.756949     8257558.760793
+192845.579919     8257553.872670
+192860.649994     8257549.622977
+192875.725869     8257544.746158
+192900.224066     8257536.821899
+192920.349834     8257527.604985
+192937.982913     8257517.112373
+192951.875427     8257504.706392
+192966.417956     8257489.800242
+192981.608974     8257472.393526
+192994.272531     8257457.470041
+193011.337495     8257440.706644
+193027.735054     8257428.323264
+193044.758684     8257415.945532
+193057.393260     8257404.154998
+193069.407564     8257391.732072
+193081.445050     8257376.802939
+193094.085424     8257364.385662
+193102.962817     8257352.560848
+193114.303919     8257345.144682
+193127.559539     8257333.985781
+193147.708487     8257322.263041
+193166.616890     8257309.275519
+193179.245672     8257298.111345
+193192.529501     8257283.820252
+193200.166343     8257270.731420
+193208.451673     8257255.142022
+193213.021151     8257235.133061
+193214.447158     8257216.348949
+193218.355030     8257200.093262
+193225.997665     8257186.378069
+193232.410582     8257170.144983
+193243.166183     8257158.337496
+193253.324695     8257143.391411
+193267.217973     8257130.985437
+193278.657603     8257112.918080
+193293.176952     8257100.517755
+193300.175367     8257088.676372
+193312.862104     8257071.247062
+193329.294439     8257055.104370
+193348.782545     8257047.134911
+193364.438123     8257047.276155
+193380.720537     8257047.423055
+193397.002186     8257047.569948
+193410.778789     8257047.694240
+193425.808298     8257047.829836
+193442.089947     8257047.976729
+193456.493385     8257048.106677
+193470.890265     8257048.862978
+193484.656041     8257050.240381
+193500.908713     8257053.519842
+193518.443267     8257053.678038
+193538.482102     8257053.858829
+193560.434684     8257050.297642
+193574.211287     8257050.421934
+193589.246594     8257049.930787
+193613.136106     8257040.121416
+193628.264139     8257029.606203
+193642.707383     8257025.350472
+193664.677351     8257019.909821
+193682.304635     8257010.043570
+193697.374710     8257005.793876
+193713.082450     8257000.296345
+193725.032239     8256994.764909
+193740.073336     8256993.647784
+193752.597799     8256993.760779
+193774.446066     8257001.476379
+193800.051515     8257009.226259
+193816.925223     8257013.138118
+193831.293125     8257017.026988
+193844.444423     8257017.145639
+193856.968886     8257017.258634
+193879.663449     8257001.172823
+193892.883529     8256993.773227
+193907.327537     8256989.517502
+193923.620778     8256988.411292
+193938.035044     8256987.288128
+193958.121007     8256982.456893
+193970.651264     8256981.943528
+193983.216296     8256977.670851
+193995.792920     8256972.145071
+194012.167296     8256962.267898
+194029.161949     8256953.022735
+194048.668205     8256943.173818
+194061.916499     8256932.641647
+194077.670602     8256922.132083
+194089.668284     8256911.588628
+194100.394907     8256902.913710
+194121.182285     8256889.943140
+194142.571785     8256879.484418
+194157.021587     8256874.602333
+194171.465595     8256870.346609
+194190.287061     8256866.757173
+194207.206372     8256865.656610
+194225.360434     8256866.447192
+194242.848625     8256871.617421
+194269.706979     8256879.378604
+194282.858277     8256879.497255
+194296.008046     8256879.615892
+194319.799037     8256880.456947
+194341.159560     8256873.130793
+194363.164303     8256863.930831
+194377.666266     8256853.409970
+194400.332616     8256840.456734
+194420.440998     8256833.119284
+194433.673431     8256824.466973
+194443.767429     8256816.412378
+194453.874544     8256807.105075
+194464.595372     8256799.056518
+194474.069855     8256790.370303
+194482.940690     8256779.171843
+194498.781723     8256759.264957
+194503.322988     8256742.388571
+194508.476438     8256726.770917
+194519.320504     8256705.565358
+194529.455068     8256693.125473
+194537.694799     8256682.548114
+194545.313490     8256671.338740
+194552.330059     8256657.617516
+194556.231369     8256641.988566
+194557.612537     8256628.216882
+194558.423300     8256608.174010
+194557.948680     8256591.878785
+194553.060294     8256578.676950
+194541.932860     8256562.912411
+194530.162734     8256549.021694
+194524.051184     8256532.675994
+194519.776516     8256520.732523
+194518.646080     8256507.564592
+194528.172723     8256493.239602
+194545.730461     8256490.891591
+194561.391834     8256490.406474
+194583.234303     8256498.748817
+194600.768857     8256498.907014
+194627.174243     8256487.867132
+194643.572567     8256475.483759
+194661.186731     8256466.870598
+194673.751763     8256462.597922
+194686.949424     8256457.704540
+194700.749211     8256455.322625
+194723.317036     8256453.020197
+194750.957176     8256443.871077
+194767.899671     8256440.264307
+194787.992193     8256434.806717
+194807.450556     8256429.969819
+194824.393051     8256426.363049
+194846.386203     8256418.416190
+194859.543294     8256417.908481
+194876.503175     8256412.422246
+194894.084092     8256407.568410
+194908.539692     8256402.059582
+194926.126404     8256396.579385
+194941.874713     8256386.696182
+194960.138892     8256375.582850
+194975.277752     8256363.814527
+194989.785509     8256352.667306
+195004.322244     8256338.387516
+195017.000000     8256328.706466
+END
+LINE3D
+HEIGHT 1010.000000
+195017.000000     8257709.622469
+195016.678964     8257710.678384
+195012.787717     8257725.054218
+195003.203118     8257745.644345
+194993.595335     8257768.740679
+194984.602796     8257793.095773
+194980.103629     8257805.586500
+194973.081266     8257819.934084
+194962.366231     8257827.356281
+194952.264914     8257836.036841
+194939.670904     8257843.442085
+194906.395367     8257852.540363
+194875.628377     8257861.034860
+194854.331607     8257861.469134
+194839.266559     8257865.092842
+194824.232020     8257865.583613
+194811.045951     8257869.223892
+194794.695519     8257876.595246
+194773.942916     8257885.806505
+194759.469931     8257893.194798
+194740.642667     8257897.410976
+194728.083432     8257901.056910
+194711.100372     8257909.048970
+194693.473087     8257918.915221
+194675.834215     8257930.034193
+194662.603307     8257938.686900
+194639.977527     8257947.254464
+194625.516133     8257953.389653
+194612.262045     8257964.548185
+194598.375325     8257976.327805
+194591.968206     8257991.934148
+194583.676317     8258008.149900
+194572.247514     8258024.964147
+194559.554979     8258043.020200
+194547.518260     8258057.948957
+194536.112638     8258072.257378
+194520.317969     8258087.152232
+194502.609549     8258105.789445
+194482.941015     8258133.181049
+194464.566720     8258156.198293
+194450.674206     8258168.604273
+194439.918605     8258180.411760
+194429.765127     8258194.731095
+194416.474735     8258209.648924
+194400.048962     8258225.164880
+194386.764368     8258239.455966
+194370.946515     8258256.857027
+194360.185116     8258269.291257
+194351.314282     8258280.489717
+194339.281828     8258294.792100
+194327.864617     8258310.353242
+194314.575758     8258325.270703
+194300.039020     8258339.550876
+194284.284920     8258350.060057
+194262.268585     8258360.513123
+194241.440641     8258377.868984
+194224.376441     8258394.632387
+194212.988208     8258407.060961
+194200.359427     8258418.225135
+194188.982782     8258429.400988
+194176.336614     8258442.444626
+194160.541941     8258457.339862
+194142.277762     8258468.453193
+194128.373657     8258482.112277
+194123.241861     8258495.223710
+194107.377645     8258517.636803
+194092.771363     8258539.434833
+194076.953506     8258556.836277
+194065.559479     8258569.891212
+194061.681353     8258583.013955
+194059.042243     8258597.401467
+194050.653362     8258624.267659
+194050.514268     8258639.304139
+194047.869364     8258654.318012
+194038.296356     8258673.655036
+194033.779800     8258688.025610
+194024.218381     8258706.109911
+194009.617901     8258727.280816
+193998.862296     8258739.088685
+193993.110224     8258751.568108
+193976.057617     8258767.078408
+193962.239676     8258771.340163
+193936.547297     8258772.987606
+193921.506194     8258774.105496
+193907.103520     8258773.975555
+193890.195036     8258773.823007
+193874.539457     8258773.681763
+193855.752763     8258773.512270
+193838.213179     8258773.980441
+193822.546012     8258775.091918
+193807.504908     8258776.209808
+193791.194281     8258779.195483
+193772.355433     8258784.664001
+193744.702933     8258795.066600
+193718.854071     8258813.630370
+193694.222577     8258835.964366
+193672.125107     8258855.188393
+193651.256594     8258876.929925
+193624.799044     8258893.608965
+193598.364684     8258907.781032
+193574.446194     8258920.722971
+193554.291448     8258933.072454
+193544.093042     8258937.000000
+END
+LINE3D
+HEIGHT 1010.000000
+195017.000000     8258791.327309
+195015.471374     8258788.987302
+195005.545448     8258778.872848
+194996.337555     8258758.739971
+194990.920862     8258734.881290
+194989.252053     8258712.310014
+194989.431713     8258692.888244
+194992.701923     8258677.880012
+195006.019764     8258659.829601
+195012.397906     8258647.355826
+195017.000000     8258643.311692
+END
+LINE3D-MASTER
+HEIGHT 1000.000000
+191735.510603     8257221.552377
+191709.685698     8257264.802811
+191699.561193     8257275.989961
+191687.530269     8257290.292358
+191680.531090     8257302.133735
+191668.523345     8257313.930306
+191659.043065     8257323.243264
+191648.889586     8257337.562600
+191639.879661     8257363.797158
+191629.731976     8257377.490133
+191627.100193     8257391.250916
+191621.939420     8257407.494916
+191619.312670     8257420.628950
+191614.146863     8257437.499700
+191611.502723     8257452.513580
+191602.567378     8257470.603148
+191597.290691     8257499.377804
+191586.540884     8257510.558930
+191560.726794     8257525.363771
+191549.367538     8257534.659777
+191540.507534     8257544.604744
+191524.167930     8257550.722987
+191508.500759     8257551.834847
+191492.897342     8257546.054827
+191477.954766     8257536.521526
+191460.444157     8257533.857511
+191438.543736     8257531.779922
+191426.019273     8257531.666927
+191413.494810     8257531.553931
+191397.213161     8257531.407038
+191382.183652     8257531.271442
+191367.154144     8257531.135846
+191352.756499     8257530.379538
+191331.465524     8257530.187451
+191318.941061     8257530.074456
+191304.537622     8257529.944508
+191288.244382     8257531.050719
+191272.559825     8257534.042043
+191254.996294     8257537.016415
+191237.421935     8257541.243897
+191222.328677     8257547.999798
+191209.769442     8257551.645732
+191197.198612     8257556.545151
+191184.598808     8257564.576757
+191175.101141     8257575.769179
+191169.847638     8257602.037627
+191165.974541     8257614.534003
+191159.561627     8257630.766707
+191155.016097     8257648.269467
+191154.261760     8257662.047188
+191155.398754     8257674.588765
+191160.297964     8257686.537871
+191170.202236     8257699.158546
+191176.986219     8257710.497861
+191191.783906     8257735.694003
+191199.831621     8257745.791511
+191222.735740     8257774.820414
+191235.770363     8257787.469331
+191242.560140     8257798.182285
+191253.739736     8257808.308049
+191263.643243     8257820.928717
+191271.644591     8257836.038640
+191275.280837     8257849.229178
+191284.477134     8257870.615542
+191291.203162     8257888.219993
+191293.476387     8257913.303139
+191293.302521     8257932.098549
+191294.438751     8257944.640118
+191294.259091     8257964.061888
+191294.096817     8257981.604194
+191294.525838     8258002.911459
+191294.328788     8258024.213076
+191293.557830     8258039.870268
+191285.289124     8258053.579813
+191278.910982     8258066.053588
+191271.912564     8258077.895354
+191263.621439     8258094.111113
+191252.169453     8258113.431566
+191240.781220     8258125.860141
+191229.411137     8258136.409257
+191218.666364     8258146.963633
+191206.658619     8258158.760205
+191194.006654     8258172.430586
+191181.980759     8258186.106615
+191169.989639     8258196.023334
+191159.860105     8258207.836851
+191150.976917     8258220.288025
+191138.295978     8258237.090592
+191125.655604     8258249.507870
+191111.165233     8258258.775627
+191094.756082     8258272.412110
+191080.857770     8258285.444834
+191069.510106     8258293.487736
+191058.169001     8258300.904285
+191044.930771     8258310.183338
+191034.215739     8258317.605153
+191019.099298     8258326.867261
+191001.466984     8258337.359880
+190979.439057     8258349.066050
+190958.651682     8258362.036238
+190944.149719     8258372.557099
+190927.699999     8258390.579255
+190917.599446     8258399.259822
+190906.245985     8258407.929467
+190893.031702     8258414.702320
+190870.412480     8258422.643530
+190849.584533     8258439.999773
+190835.077540     8258451.147001
+190823.683513     8258464.201936
+190812.307636     8258475.377413
+190796.536147     8258487.766442
+190780.166800     8258497.017247
+190765.752535     8258498.140410
+190740.060152     8258499.788235
+190718.130750     8258500.843596
+190696.212940     8258500.645854
+190681.809502     8258500.515907
+190663.034399     8258499.093310
+190637.991267     8258498.240958
+190612.316271     8258498.009318
+190589.139761     8258498.426633
+190562.774942     8258505.081225
+190533.916672     8258510.459730
+190508.183720     8258516.493227
+190489.350659     8258521.336149
+190473.010290     8258527.454386
+190456.682277     8258532.319525
+190440.336879     8258539.064130
+190421.469046     8258547.665980
+190404.462802     8258558.164248
+190393.109340     8258566.833893
+190376.734964     8258576.711065
+190365.346731     8258589.139640
+190353.344023     8258600.309079
+190341.968143     8258611.484939
+190330.608887     8258620.780945
+190315.451880     8258634.428343
+190302.857866     8258641.833970
+190288.408833     8258646.715680
+190269.552587     8258654.064809
+190250.087661     8258659.528443
+190236.901592     8258663.168721
+190224.951802     8258668.700157
+190210.490409     8258674.835345
+190197.925380     8258679.107639
+190182.223434     8258683.978810
+190170.278681     8258688.883113
+190152.077484     8258693.105323
+190124.454734     8258700.374596
+190107.511478     8258703.980977
+190092.418220     8258710.736878
+190077.319925     8258718.119911
+190063.490396     8258723.634388
+190047.823229     8258724.745865
+190030.880738     8258728.352253
+190015.219365     8258728.837369
+189999.552191     8258729.949611
+189983.264748     8258730.429078
+189965.104124     8258730.265234
+189946.943499     8258730.101389
+189930.661850     8258729.954496
+189912.495432     8258730.417012
+189897.465923     8258730.281416
+189879.305299     8258730.117571
+189863.023650     8258729.970678
+189850.499187     8258729.857683
+189821.084387     8258727.713064
+189801.677423     8258726.910797
+189784.768940     8258726.758249
+189762.225059     8258726.554858
+189737.176133     8258726.328867
+189717.757567     8258726.780851
+189703.354129     8258726.650903
+189682.637069     8258732.102476
+189663.804008     8258736.945397
+189639.317402     8258743.616552
+189626.752366     8258747.889611
+189612.331546     8258749.638745
+189588.448592     8258758.821763
+189565.150371     8258772.396476
+189551.304224     8258779.790041
+189533.062461     8258788.397540
+189519.830788     8258797.050240
+189510.964990     8258807.621568
+189501.420961     8258823.826023
+189495.616728     8258841.944222
+189486.733540     8258854.395397
+189477.827933     8258869.352786
+189468.318676     8258881.798312
+189459.452877     8258892.369640
+189444.887162     8258909.782380
+189433.430149     8258929.728819
+189424.545129     8258937.000000
+END
+LINE3D-MASTER
+HEIGHT 1000.000000
+189706.757826     8258937.000000
+189708.411045     8258924.691207
+189709.182768     8258909.034022
+189711.814555     8258895.272856
+189715.700004     8258881.523766
+189728.856332     8258881.016049
+189741.299656     8258889.900389
+189749.951022     8258902.509760
+189757.934988     8258919.498765
+189765.242230     8258937.000000
+END
+LINE3D-MASTER
+HEIGHT 1000.000000
+189845.470104     8258937.000000
+189849.218527     8258935.986472
+189864.288602     8258931.736779
+189881.202887     8258931.262201
+189900.656217     8258927.052053
+189918.230573     8258922.824953
+189934.518787     8258922.344728
+189950.841002     8258918.106331
+189968.415358     8258913.879231
+189989.092623     8258912.812190
+190016.658183     8258911.808060
+190037.328882     8258911.368138
+190056.742411     8258911.543287
+190081.791337     8258911.769278
+190111.223520     8258912.034814
+190141.282537     8258912.306006
+190160.069231     8258912.475500
+190176.976951     8258912.628041
+190192.006459     8258912.763637
+190207.035968     8258912.899233
+190222.679958     8258914.293199
+190242.689816     8258917.606557
+190260.815668     8258921.529331
+190279.596569     8258922.325185
+190292.109436     8258923.691666
+190306.500522     8258925.074328
+190323.368433     8258929.612931
+190339.018218     8258930.380536
+190357.149864     8258933.676949
+190378.417656     8258936.375243
+190386.176854     8258937.000000
+END
+LINE3D-MASTER
+HEIGHT 1000.000000
+190972.433766     8258937.000000
+190987.211341     8258930.589278
+191006.050197     8258925.119995
+191024.889052     8258919.650713
+191039.970715     8258914.148298
+191056.913213     8258910.541146
+191072.609358     8258906.297100
+191086.397550     8258905.168671
+191106.512494     8258897.204485
+191122.846304     8258891.712602
+191142.293841     8258888.128815
+191157.381304     8258881.999274
+191176.892590     8258871.523990
+191194.502489     8258863.537203
+191209.647908     8258851.142526
+191227.900495     8258841.282299
+191241.770590     8258831.382533
+191258.747860     8258824.016452
+191273.835324     8258817.886911
+191292.743723     8258804.899771
+191314.168763     8258790.681745
+191324.269312     8258782.001561
+191336.243050     8258773.963925
+191347.572563     8258767.800480
+191370.841800     8258757.359100
+191384.085067     8258747.452914
+191396.661684     8258741.927898
+191405.521695     8258731.982166
+191414.381699     8258722.037199
+191431.463284     8258703.394331
+191442.839922     8258692.219243
+191455.567229     8258670.404261
+191463.811993     8258659.200153
+191474.643700     8258639.248072
+191484.808005     8258623.675626
+191496.259230     8258604.354783
+191501.379431     8258592.496837
+191510.297397     8258576.285969
+191520.455905     8258561.340266
+191528.782570     8258541.365203
+191537.085286     8258523.896340
+191542.205490     8258512.038011
+191551.123453     8258495.827525
+191564.540579     8258467.126695
+191569.051338     8258453.382864
+191584.272098     8258432.843586
+191593.769764     8258421.651163
+191612.086868     8258404.899064
+191630.977882     8258393.791388
+191644.197962     8258386.391791
+191652.449285     8258374.561329
+191668.214977     8258362.799044
+191679.660401     8258344.105326
+191686.682002     8258329.757353
+191694.365207     8258311.656488
+191698.910737     8258294.153728
+191702.824403     8258277.271681
+191704.888836     8258257.240120
+191708.906821     8258229.080903
+191710.293022     8258214.682469
+191714.206688     8258197.800422
+191715.580534     8258184.655085
+191723.252150     8258167.806942
+191730.273748     8258153.459351
+191736.651890     8258140.985575
+191745.564056     8258125.401833
+191751.350138     8258109.163091
+191760.842010     8258098.597029
+191770.380246     8258083.018935
+191781.113431     8258073.717280
+191791.863238     8258062.536155
+191796.983441     8258050.677826
+191804.602136     8258039.468069
+191812.865047     8258026.384885
+191817.375806     8258012.641054
+191828.833586     8257992.694240
+191833.953025     8257980.835904
+191839.693505     8257969.609585
+191844.819507     8257957.124513
+191855.604089     8257942.184076
+191870.732122     8257931.668863
+191887.715183     8257923.676804
+191905.325078     8257915.690399
+191928.008052     8257900.857310
+191945.015061     8257890.359049
+191954.501135     8257880.419731
+191967.738601     8257871.140670
+191987.313640     8257853.773506
+191998.063447     8257842.592380
+192012.565410     8257832.071519
+192027.687649     8257822.182668
+192038.425864     8257812.254646
+192046.659798     8257802.304030
+192055.519805     8257792.358681
+192065.029063     8257779.913155
+192078.324484     8257764.368958
+192088.442427     8257753.808544
+192098.647298     8257733.850809
+192106.289937     8257720.135233
+192117.683203     8257707.079909
+192126.560593     8257695.255478
+192137.919849     8257685.959472
+192153.023934     8257677.950460
+192166.250576     8257669.924128
+192177.591678     8257662.507962
+192190.191486     8257654.475974
+192208.456429     8257643.362650
+192224.193143     8257634.732932
+192239.263221     8257630.482857
+192251.799276     8257629.342748
+192273.085222     8257630.161203
+192288.694433     8257635.314862
+192303.097107     8257635.444803
+192321.924371     8257631.228624
+192337.759613     8257611.947716
+192348.608709     8257590.115789
+192365.609155     8257580.244265
+192391.324721     8257576.090232
+192404.521618     8257571.196844
+192418.988806     8257564.435294
+192430.939360     8257558.903865
+192442.884116     8257553.999180
+192454.822314     8257549.720848
+192467.398938     8257544.195068
+192491.908727     8257535.017706
+192507.599077     8257531.400021
+192524.548130     8257527.166898
+192543.334825     8257527.336391
+192570.261962     8257527.579327
+192584.050921     8257526.450522
+192609.157803     8257520.411377
+192621.688060     8257519.898012
+192639.262419     8257515.670530
+192667.494618     8257510.286376
+192685.145083     8257497.914300
+192701.513665     8257488.663488
+192714.733745     8257481.263892
+192731.723368     8257472.645096
+192746.166611     8257468.389364
+192763.799686     8257457.897135
+192779.501632     8257453.025964
+192796.449917     8257448.793216
+192811.560565     8257440.157468
+192826.653823     8257433.401567
+192840.482587     8257427.887083
+192853.720054     8257418.608023
+192870.072014     8257411.236682
+192884.567415     8257401.342557
+192902.797586     8257393.988162
+192919.171962     8257384.110990
+192934.282610     8257375.475242
+192943.165797     8257363.024067
+192953.886626     8257354.975510
+192963.378498     8257344.409448
+192979.781852     8257331.399707
+192989.900559     8257320.839301
+193000.621388     8257312.790743
+193015.105965     8257304.149347
+193028.360817     8257292.990822
+193039.725105     8257283.068066
+193052.353887     8257271.903892
+193071.256492     8257259.543113
+193082.656317     8257245.861435
+193092.803233     8257232.168836
+193100.434281     8257219.706364
+193104.985609     8257201.576861
+193107.606565     8257189.069189
+193112.140503     8257172.819533
+193116.652026     8257159.075709
+193121.858402     8257137.819286
+193129.582176     8257115.332749
+193134.133504     8257097.203246
+193134.892871     8257082.799157
+193135.692807     8257064.009397
+193140.221716     8257048.386108
+193146.594064     8257036.538694
+193153.438372     8257015.742421
+END
+LINE3D
+HEIGHT 1030.000000
+193006.656920     8252439.510903
+193031.973661     8252417.450339
+193052.227054     8252398.267240
+193105.168051     8252371.313464
+193120.106395     8252361.784889
+193129.406376     8252351.677366
+193142.510781     8252347.178398
+193155.576739     8252338.292426
+193169.236215     8252325.641337
+193191.042363     8252314.174225
+193207.270557     8252309.021155
+193220.336515     8252300.135183
+193233.353051     8252285.609979
+193250.169272     8252276.065296
+193260.105945     8252267.206164
+193279.457934     8252261.399758
+193303.734706     8252246.150664
+193333.610630     8252227.093520
+193350.997637     8252211.276977
+193361.499603     8252195.519488
+193377.662660     8252182.846926
+193388.839760     8252172.724068
+193398.787421     8252165.118694
+193409.965278     8252154.995064
+193428.027417     8252144.813152
+193436.696209     8252134.085264
+193457.233706     8252120.748638
+193476.596676     8252116.195225
+193491.535020     8252106.666649
+193511.480527     8252097.095126
+193524.590424     8252093.222655
+193540.192913     8252088.074952
+193552.704565     8252087.341094
+193571.452819     8252084.046806
+193593.983522     8252083.853556
+193615.894011     8252084.292170
+193628.427632     8252086.065063
+193647.872988     8252090.912155
+193662.300958     8252094.548430
+193682.953784     8252094.371287
+193721.170120     8252098.430069
+193736.816548     8252098.295868
+193760.598660     8252098.091885
+193781.866974     8252096.656376
+193796.854747     8252092.767798
+193812.495678     8252092.006335
+193842.525379     8252090.495679
+193859.380042     8252085.337236
+193871.864234     8252081.470131
+193894.444366     8252086.916879
+193910.101775     8252088.035670
+193937.013936     8252087.804841
+193953.906282     8252087.033409
+193970.161943     8252085.014351
+193987.016605     8252079.855909
+194000.741218     8252074.724313
+194018.254541     8252073.321011
+194030.771683     8252073.213650
+194043.980431     8252080.620408
+194057.200166     8252089.280924
+194068.537298     8252097.331044
+194085.517513     8252106.585849
+194103.157148     8252119.595024
+194119.561088     8252134.495193
+194132.791804     8252144.408702
+194147.236253     8252149.925231
+194158.556142     8252156.095103
+194171.759398     8252162.875365
+194197.513512     8252173.308002
+194208.844389     8252180.731632
+194229.563880     8252188.073970
+194242.130451     8252193.606606
+194252.830126     8252200.408341
+194267.263593     8252204.671877
+194281.065095     8252208.313526
+194298.035086     8252216.314567
+194320.631697     8252223.641569
+194336.305585     8252226.640614
+194352.583208     8252227.127542
+194367.609422     8252227.625203
+194385.759431     8252227.469528
+194400.779390     8252227.340699
+194413.296533     8252227.233338
+194435.806031     8252224.533331
+194450.189305     8252223.156877
+194463.914682     8252218.025275
+194485.121821     8252209.696783
+194498.813483     8252200.805444
+194518.072876     8252184.346298
+194529.809773     8252166.697821
+194540.954686     8252152.815213
+194552.753521     8252142.059714
+194568.301098     8252130.646283
+194588.223871     8252118.568016
+194605.000888     8252104.637101
+194614.300868     8252094.529578
+194623.611843     8252085.676578
+194632.900842     8252074.316062
+194643.314939     8252048.532336
+194654.415914     8252029.636227
+194661.750147     8252009.518575
+194675.331977     8251988.095013
+194681.447753     8251971.747837
+194692.543237     8251952.225232
+194707.942527     8251923.891809
+194725.868132     8251898.043656
+194740.091374     8251878.494223
+194753.702185     8251860.203130
+194761.727267     8251847.600369
+194772.866683     8251833.090499
+194780.250352     8251818.613609
+194785.153166     8251806.664171
+194796.303570     8251793.408059
+194815.530005     8251773.188405
+194827.931818     8251759.921560
+194839.751101     8251751.673589
+194848.430110     8251742.198701
+194859.596986     8251730.822078
+194863.823903     8251713.238016
+194872.449521     8251697.496621
+194879.195733     8251681.771346
+194882.825177     8251667.326656
+194895.150101     8251645.286567
+194904.395168     8251628.913315
+194924.873012     8251608.682928
+194935.396948     8251595.432189
+194950.285099     8251580.263623
+194958.916208     8251565.148724
+194968.150294     8251547.522480
+194972.987207     8251528.053556
+194976.587656     8251510.474867
+194976.362488     8251484.782396
+194976.236170     8251470.369154
+194976.670420     8251448.431053
+194980.869884     8251427.714509
+194983.878343     8251413.900924
+194988.116248     8251397.570620
+194997.960324     8251378.058748
+195010.937648     8251359.146545
+195017.000000     8251352.723160
+END
+LINE3D
+HEIGHT 1030.000000
+195017.000000     8250030.721394
+195014.952128     8250031.768681
+194992.488097     8250039.482175
+194968.787600     8250049.085905
+194935.057827     8250056.895262
+194888.803894     8250064.185497
+194851.329356     8250073.280826
+194806.976797     8250083.061691
+194758.866956     8250092.874784
+194727.031539     8250102.548288
+194690.170953     8250110.384499
+194654.502900     8250111.317737
+194627.601720     8250112.801560
+194611.324861     8250112.314625
+194599.394212     8250108.029622
+194585.614680     8250106.894724
+194569.935301     8250103.269183
+194545.516497     8250102.224775
+194528.607679     8250101.116717
+194516.057587     8250097.464335
+194497.917795     8250098.873010
+194479.686171     8250089.628938
+194462.024567     8250074.113013
+194452.477443     8250056.020549
+194440.493408     8250045.469804
+194432.889304     8250034.881492
+194422.155907     8250024.319255
+194410.770118     8250010.629896
+194398.746872     8249995.692153
+194389.276636     8249986.372934
+194379.164217     8249975.178827
+194365.944488     8249966.519076
+194349.633144     8249962.271646
+194333.350031     8249961.158222
+194312.708186     8249962.588357
+194293.377402     8249970.901521
+194275.305046     8249979.830433
+194254.064192     8249984.399189
+194235.947133     8249988.314607
+194220.300705     8249988.448809
+194206.532154     8249988.566904
+194185.252860     8249988.749420
+194160.185625     8249985.204399
+194137.605492     8249979.757651
+194119.993318     8249969.881723
+194108.063439     8249965.597478
+194091.643020     8249948.817055
+194083.385752     8249935.100862
+194073.223904     8249918.266758
+194063.078542     8249903.313673
+194045.444398     8249890.930995
+194026.652206     8249889.211783
+194007.881983     8249889.999321
+193990.358442     8249890.149623
+193981.513911     8249880.825037
+193961.903803     8249857.179229
+193949.254853     8249842.246853
+193935.436109     8249836.724957
+193919.712792     8249828.085915
+193902.771024     8249823.218114
+193890.758759     8249809.533364
+193868.716462     8249794.055012
+193854.887501     8249787.280117
+193840.410102     8249778.003845
+193822.820661     8249770.634660
+193799.542662     8249757.046538
+193775.062691     8249749.109911
+193760.629988     8249744.846368
+193736.858100     8249746.304115
+193718.093368     8249747.718150
+193700.575317     8249748.494949
+193664.906494     8249749.427429
+193634.865811     8249749.685093
+193600.443670     8249749.980336
+193566.016038     8249749.649084
+193532.170172     8249744.298964
+193495.815234     8249738.343821
+193461.343671     8249732.999833
+193437.501142     8249726.310060
+193420.564100     8249722.068763
+193396.644690     8249706.606511
+193382.172782     8249697.956735
+193367.656943     8249684.294224
+193355.018973     8249670.614840
+193337.369122     8249656.352666
+193318.505538     8249646.487471
+193299.010754     8249636.000382
+193280.772875     8249626.129820
+193266.937659     8249618.728435
+193250.616098     8249613.228006
+193237.412841     8249606.447745
+193221.727966     8249602.194942
+193202.233188     8249591.708617
+193184.044731     8249587.477288
+193165.850790     8249582.620228
+193148.266839     8249575.877540
+193126.938116     8249570.420058
+193106.284525     8249570.597207
+193086.872120     8249569.509858
+193069.968792     8249569.028297
+193052.444488     8249569.178606
+193033.043070     8249569.345015
+193016.770938     8249569.484583
+192997.984243     8249568.392633
+192977.945369     8249567.310657
+192956.040370     8249567.498540
+192934.761075     8249567.681055
+192914.761413     8249570.986078
+192894.745279     8249572.411611
+192876.628220     8249576.327030
+192857.259753     8249580.253182
+192839.795858     8249587.296481
+192821.689787     8249592.465657
+192799.839708     8249598.920033
+192780.498700     8249605.979432
+192764.297966     8249614.265748
+192743.726754     8249623.842638
+192722.540820     8249634.677887
+192699.483270     8249646.156497
+192668.300254     8249658.957888
+192640.246522     8249671.732439
+192614.701863     8249685.112012
+192591.056286     8249700.982235
+192565.500645     8249713.108816
+192536.799240     8249723.381983
+192517.469221     8249731.695139
+192493.154001     8249742.557229
+192472.571808     8249750.881125
+192450.101515     8249757.967365
+192418.237875     8249764.507628
+192388.256838     8249771.658289
+192359.500513     8249775.664962
+192332.632290     8249780.909292
+192300.746680     8249784.942806
+192273.208815     8249785.179002
+192250.052407     8249785.377618
+192235.026193     8249784.879957
+192220.593490     8249780.616414
+192206.198471     8249780.739882
+192191.754029     8249775.224118
+192176.058173     8249769.718323
+192160.988784     8249764.207154
+192142.750905     8249754.336592
+192126.434835     8249749.462660
+192113.857282     8249742.677031
+192099.994607     8249732.142400
+192083.662058     8249725.388213
+192070.442329     8249716.728462
+192059.736393     8249709.299472
+192046.412316     8249688.733230
+192040.038408     8249675.626662
+192033.033313     8249661.899730
+192023.541108     8249650.073760
+192016.557981     8249638.853578
+192001.959756     8249615.790560
+191991.161223     8249597.708830
+191982.256281     8249581.491254
+191970.814808     8249561.535408
+191958.764866     8249543.464412
+191947.378312     8249529.775060
+191936.013721     8249518.591693
+191923.392230     8249506.792564
+191912.033900     8249496.236452
+191897.523551     8249483.200436
+191886.785428     8249472.011696
+191874.163938     8249460.212567
+191863.397597     8249445.891351
+191851.408066     8249434.713345
+191840.669179     8249423.524612
+191826.823746     8249414.870227
+191811.100429     8249406.231185
+191786.609470     8249397.040801
+191769.640235     8249389.038988
+191755.783051     8249379.130853
+191740.685438     8249370.486444
+191726.203313     8249360.583669
+191707.970925     8249351.339603
+191689.085373     8249338.967658
+191667.685258     8249325.364194
+191650.079338     8249316.114756
+191635.629399     8249309.971730
+191622.415154     8249301.937711
+191609.826614     8249293.898324
+191594.729009     8249285.254680
+191576.491123     8249275.383354
+191558.242263     8249264.259799
+191536.254885     8249255.047941
+191513.005110     8249244.593059
+191501.036790     8249235.922575
+191479.038424     8249225.456959
+191467.674603     8249214.274351
+191455.069584     8249204.354710
+191436.831705     8249194.484149
+191416.095736     8249185.261557
+191387.229573     8249176.735243
+191367.142040     8249170.014029
+191346.450009     8249165.804938
+191323.260651     8249162.243811
+191303.199808     8249158.655085
+191283.765440     8249155.061751
+191266.202694     8249150.825820
+191249.881133     8249145.325391
+191229.173387     8249139.236040
+191210.951980     8249131.244968
+191182.069345     8249120.839164
+191155.700509     8249111.664887
+191132.478200     8249104.344016
+191112.988906     8249094.483423
+191087.212824     8249081.544036
+191062.634758     8249062.327408
+191031.221082     8249048.809832
+191012.341021     8249037.064383
+190993.482928     8249027.825684
+190977.743133     8249017.306388
+190961.997854     8249006.161360
+190948.146160     8248996.879721
+190933.620097     8248981.963445
+190907.168881     8248963.389427
+190886.960522     8248942.881468
+190865.554917     8248928.651507
+190842.930846     8248918.191258
+190824.050791     8248906.446574
+190796.430546     8248897.283030
+190775.112804     8248893.078541
+190762.535251     8248886.292913
+190749.299044     8248875.752908
+190737.978391     8248869.583042
+190724.758656     8248860.922526
+190708.985910     8248846.643486
+190701.388061     8248836.681664
+190687.475957     8248820.507035
+190667.898793     8248800.620205
+190654.031391     8248789.459070
+190642.030114     8248777.028078
+190629.408623     8248765.228948
+190616.155937     8248752.808689
+190605.417050     8248741.619956
+190590.896484     8248727.330941
+190573.816647     8248706.796148
+190551.082744     8248683.803676
+190534.700773     8248671.410258
+190517.660147     8248655.262462
+190497.489465     8248639.140749
+190477.917798     8248619.881181
+190460.217754     8248599.979016
+190445.647752     8248580.049239
+190434.870424     8248564.474266
+190417.846277     8248550.206724
+190399.569950     8248535.949158
+190381.277152     8248519.812103
+190366.745598     8248504.269331
+190353.487422     8248491.222575
+190338.960595     8248476.306306
+190318.081836     8248450.790984
+190295.375386     8248430.930994
+190272.701893     8248414.831513
+190260.052943     8248399.899137
+190246.147093     8248384.350998
+190233.509131     8248370.672379
+190223.390458     8248358.851782
+190216.989097     8248342.612733
+190205.542891     8248322.029619
+190196.006754     8248305.190913
+190187.134763     8248292.733080
+190171.976740     8248277.195681
+190152.432533     8248261.069359
+190133.514031     8248244.937671
+190119.591702     8248227.509278
+190106.255874     8248205.689285
+190092.959250     8248188.255525
+190079.014959     8248168.321146
+190063.851446     8248152.157250
+190039.925781     8248136.068509
+190016.615596     8248118.720637
+189998.300829     8248100.076831
+189983.120837     8248082.032682
+189969.840692     8248066.479176
+189957.806465     8248050.288440
+189945.135549     8248032.849696
+189929.978290     8248017.312290
+189904.784738     8247999.354028
+189884.564634     8247977.593083
+189868.083808     8247953.920052
+189849.758056     8247934.022871
+189835.199042     8247915.346852
+189820.699678     8247903.564211
+189806.178341     8247889.274438
+189787.924751     8247877.523999
+189767.172307     8247866.421536
+189752.700399     8247857.771760
+189735.714692     8247847.890458
+189718.685048     8247832.995656
+189696.027266     8247818.776053
+189675.259107     8247805.793329
+189648.270060     8247797.251297
+189629.428443     8247789.892470
+189614.363784     8247785.008187
+189598.009273     8247775.748015
+189587.271153     8247764.559657
+189575.319302     8247757.768279
+189562.659370     8247741.582910
+189544.344603     8247722.939105
+189522.225416     8247698.687509
+189499.540939     8247681.334652
+189479.414963     8247670.226816
+189463.037718     8247658.459900
+189444.817078     8247650.469204
+189428.472788     8247642.462414
+189409.631170     8247635.103587
+189394.550800     8247628.339425
+189376.966082     8247621.596361
+189359.353908     8247611.720433
+189336.060201     8247596.252815
+189312.145517     8247581.417067
+189283.279357     8247572.891135
+189251.267434     8247562.511790
+189227.402178     8247553.316038
+189202.280021     8247543.504142
+189177.795319     8247534.940630
+189143.285305     8247525.209254
+189109.400998     8247515.472895
+189077.998303     8247503.208311
+189049.077221     8247488.415503
+189003.817341     8247466.242784
+188968.599247     8247447.117417
+188939.678164     8247432.324609
+188911.410245     8247420.659682
+188881.264453     8247409.011243
+188856.751525     8247397.314108
+188836.631039     8247386.832768
+188814.616201     8247374.487664
+188789.488556     8247364.049653
+188759.364730     8247354.907583
+188738.047755     8247350.703470
+188717.383180     8247349.627244
+188696.724099     8247349.177896
+188670.438405     8247349.403353
+188642.867586     8247345.879423
+188619.019570     8247338.563537
+188596.411217     8247329.983931
+188573.155955     8247318.902935
+188546.754929     8247305.968525
+188515.955973     8247291.192207
+188493.315431     8247278.852469
+188475.072058     8247268.355029
+188466.227526     8247259.030442
+188454.215265     8247245.346075
+188444.695600     8247230.386858
+188426.424771     8247216.756553
+188402.538310     8247205.054045
+188386.227734     8247200.806991
+188371.832715     8247200.930460
+188351.860512     8247207.368729
+188336.933152     8247218.150680
+188326.990986     8247226.382933
+188311.437922     8247237.170250
+188293.381276     8247247.979041
+188265.250656     8247251.980348
+188240.896996     8247258.456198
+188220.880858     8247259.881348
+188200.260218     8247263.818241
+188179.008383     8247267.134003
+188157.756548     8247270.449766
+188139.013788     8247274.370933
+188124.026779     8247278.259505
+188110.910628     8247281.505487
+188092.173359     8247286.053151
+188075.281013     8247286.824583
+188050.883418     8247288.287314
+188016.488736     8247291.715805
+187988.956746     8247292.578877
+187960.798667     8247293.446936
+187938.899158     8247294.261315
+187908.858093     8247294.518982
+187878.185451     8247294.155522
+187852.487018     8247289.988990
+187832.454023     8247289.534272
+187811.136284     8247285.330166
+187776.039010     8247279.990779
+187745.311448     8247273.360826
+187726.497290     8247269.135246
+187707.051938     8247264.288537
+187688.852500     8247258.804215
+187659.283365     8247241.510409
+187646.716797     8247235.978156
+187627.282426     8247232.384439
+187605.273082     8247220.666213
+187581.358780     8247205.830461
+187563.098932     8247193.453149
+187542.352360     8247182.977179
+187516.593516     8247171.917657
+187498.361128     8247162.673592
+187484.493341     8247151.512078
+187474.358956     8247137.811603
+187472.936916     8247118.396363
+187468.896345     8247085.842726
+187468.786506     8247073.309739
+187468.594287     8247051.377011
+187468.473464     8247037.590648
+187468.347150     8247023.177790
+187465.728236     8247010.039397
+187464.943267     8246991.872162
+187462.236483     8246968.707532
+187458.322225     8246950.566755
+187456.949614     8246936.791511
+187446.842308     8246926.224287
+187433.688476     8246925.083640
+187416.751814     8246920.841956
+187394.144225     8246912.262344
+187382.796494     8246902.959228
+187373.929993     8246891.127891
+187369.428094     8246877.379106
+187372.365161     8246855.419538
+187376.586973     8246837.209359
+187382.082541     8246821.494811
+187381.939748     8246805.201698
+187377.964698     8246780.167933
+187371.568829     8246764.555380
+187367.066929     8246750.806595
+187363.125215     8246729.532953
+187361.758091     8246716.383823
+187356.624997     8246702.013908
+187352.106622     8246686.385251
+187351.316159     8246667.591137
+187347.434473     8246653.210489
+187346.693439     8246640.056372
+187346.561631     8246625.016634
+187346.418842     8246608.723903
+187350.673600     8246594.273085
+187357.415087     8246577.921307
+187367.231321     8246555.276192
+187375.252054     8246542.046541
+187398.227610     8246521.168569
+187414.389903     8246508.496014
+187423.058692     8246497.767744
+187432.929464     8246481.389125
+187449.618989     8246457.431587
+187462.553139     8246433.505877
+187470.590351     8246422.156481
+187471.682877     8246403.973142
+187471.556559     8246389.559901
+187465.792270     8246374.568856
+187465.034375     8246359.534488
+187460.505016     8246342.652456
+187454.751711     8246328.914787
+187445.215571     8246312.075698
+187435.102773     8246300.881977
+187423.079909     8246285.944231
+187413.990739     8246277.000000
+END
 END
\ No newline at end of file
diff --git a/examples/data/sp_589x703.raw b/examples/data/sp_589x703.raw
old mode 100755
new mode 100644
diff --git a/examples/databaseQuery/.cdtproject b/examples/databaseQuery/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/databaseQuery/.cdtproject
+++ b/examples/databaseQuery/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/databaseQuery/.project b/examples/databaseQuery/.project
old mode 100755
new mode 100644
index 64a8d5c..104c3c8
--- a/examples/databaseQuery/.project
+++ b/examples/databaseQuery/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>databaseQuery</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>databaseQuery</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/databaseQuery/Makefile b/examples/databaseQuery/Makefile
old mode 100755
new mode 100644
index 47bd7e1..85a2c09
--- a/examples/databaseQuery/Makefile
+++ b/examples/databaseQuery/Makefile
@@ -1,30 +1,30 @@
-all: databaseQuery
-
-debug: databaseQuery_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-databaseQuery: terralib
-	qmake -o makeDatabaseQuery databaseQuery.pro; make -f makeDatabaseQuery
-
-databaseQuery_dbg: terralib_dbg
-	qmake -o makeDatabaseQuery.debug databaseQuery.pro TE_PROJECT_TYPE=DEBUG;\
-	make -f makeDatabaseQuery.debug
-
-clean:
-	if \
-		test -f makeDatabaseQuery; \
-	then \
-		make -f makeDatabaseQuery distclean; rm -f makeDatabaseQuery; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeDatabaseQuery.debug; \
-	then \
-		make -f makeDatabaseQuery.debug distclean; rm -f makeDatabaseQuery.debug; \
+all: databaseQuery
+
+debug: databaseQuery_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+databaseQuery: terralib
+	qmake -o makeDatabaseQuery databaseQuery.pro; make -f makeDatabaseQuery
+
+databaseQuery_dbg: terralib_dbg
+	qmake -o makeDatabaseQuery.debug databaseQuery.pro TE_PROJECT_TYPE=DEBUG;\
+	make -f makeDatabaseQuery.debug
+
+clean:
+	if \
+		test -f makeDatabaseQuery; \
+	then \
+		make -f makeDatabaseQuery distclean; rm -f makeDatabaseQuery; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeDatabaseQuery.debug; \
+	then \
+		make -f makeDatabaseQuery.debug distclean; rm -f makeDatabaseQuery.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/databaseQuery/databaseQuery.cpp b/examples/databaseQuery/databaseQuery.cpp
old mode 100755
new mode 100644
index 6ca742a..d887bff
--- a/examples/databaseQuery/databaseQuery.cpp
+++ b/examples/databaseQuery/databaseQuery.cpp
@@ -1,141 +1,141 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/* 
-        This file shows an example of how to retrieve an existing layer from a
-        TerraLib database, and execute some queries on its polygon geometry table.
-
-        Author: Lubia Vinhas  
-*/
-
-#include <TeMySQL.h>
-
-int main()
-{
-	unsigned int i, j;
-	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to a MySQL database
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		cout.flush();
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\"!";
-	cout << endl << endl;
-
-	// Load a layer by its name 
-	TeLayer *layer = new TeLayer("Distritos");
-	if (!db->loadLayer(layer))                
-	{                                                                                               
-		cout << "Error: " << db->errorMessage() << endl;
-		db->close();
-		cout << endl << "Press Enter\n";
-		cout.flush();
-		getchar();
-		return 1;
-	}
-
-	// Retrieve the information about the polygons representation
-	TeRepresentation* rep = layer->getRepresentation(TePOLYGONS);
-	if (!rep)
-	{                                                                                               
-		cout << "Layer has no polygons representation!" << endl;
-		db->close();
-		cout << endl << "Press Enter\n";
-		cout.flush();
-		getchar();
-		return 0;
-	}
-
-	string polyTableName = rep->tableName_;
-	TePolygonSet ps;
-	// Retrieve all polygons related to the object with id "33"
-	if (db->loadPolygonSet(polyTableName, "33", ps) && ps.size() > 0)
-	{
-		cout << "Polygon identifiers related to the object id \'33\': " << endl;
-		for (i = 0; i < ps.size(); ++i)
-		{
-			TePolygon pol = ps[i];
-			cout << "Parent id: " << pol[0].geomId() << endl;
-			for (j = 1; j < pol.size(); ++j)
-				cout << "\t Child id: " << pol[j].geomId() << endl;
-		}
-	}
-	else
-	{
-		cout << "No polygons related to the object \'33\' were found!" << endl << endl;
-	}
-	ps.clear();
-
-	// Retrieve all polygons that intersect a certain bounding box
-	// given in the same projection coordinates of the data
-	TeBox box(320000,7390000,338000,7400000);
-	if (db->loadPolygonSet(polyTableName, box, ps) && ps.size() > 0)
-	{
-		cout << "\nPolygons that intersect the bounding box: (320000,7390000,338000,7400000)" << endl;
-		cout << "Number of polygons found: " << ps.size() << endl;
-		for (i = 0; i < ps.size(); ++i)
-		{
-			TePolygon pol = ps[i];
-			cout << "Parent id: " << pol[0].geomId() << ", object id: " << pol.objectId() << endl;
-			for (j = 1; j < pol.size(); ++j)
-				cout << "\t Child id: " << pol[j].geomId() << endl;
-		}
-	}
-	else
-		cout << "No polygons intersect the bounding box (320000,7390000,338000,7400000)!" << endl << endl;
-
-	//! Retrieving polygons that contain a certain point
-	TePolygon poly;
-	cout << endl << "Polygons that contain the point (350000,7395000):" << endl;
-	TeCoord2D pt(350000,7395000);
-	if (db->locatePolygon(polyTableName, pt,poly,0))
-		cout << "Polygon id: " << poly.geomId() << ", object id: " << poly.objectId() << endl;
-	else
-	{
-		cout << "\nNo polygons found!\n\n";
-		db->close();
-		cout << endl << "Press Enter\n";
-		cout.flush();
-		getchar();
-		return 0;
-	}
-
-	db->close();
-	cout << endl << "Press Enter\n";
-	cout.flush();
-	getchar();
-	return 0;
-}
-
-
-
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+        This file shows an example of how to retrieve an existing layer from a
+        TerraLib database, and execute some queries on its polygon geometry table.
+
+        Author: Lubia Vinhas  
+*/
+
+#include <TeMySQL.h>
+
+int main()
+{
+	unsigned int i, j;
+	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to a MySQL database
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		cout.flush();
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\"!";
+	cout << endl << endl;
+
+	// Load a layer by its name 
+	TeLayer *layer = new TeLayer("Distritos");
+	if (!db->loadLayer(layer))                
+	{                                                                                               
+		cout << "Error: " << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		cout.flush();
+		getchar();
+		return 1;
+	}
+
+	// Retrieve the information about the polygons representation
+	TeRepresentation* rep = layer->getRepresentation(TePOLYGONS);
+	if (!rep)
+	{                                                                                               
+		cout << "Layer has no polygons representation!" << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		cout.flush();
+		getchar();
+		return 0;
+	}
+
+	string polyTableName = rep->tableName_;
+	TePolygonSet ps;
+	// Retrieve all polygons related to the object with id "33"
+	if (db->loadPolygonSet(polyTableName, "33", ps) && ps.size() > 0)
+	{
+		cout << "Polygon identifiers related to the object id \'33\': " << endl;
+		for (i = 0; i < ps.size(); ++i)
+		{
+			TePolygon pol = ps[i];
+			cout << "Parent id: " << pol[0].geomId() << endl;
+			for (j = 1; j < pol.size(); ++j)
+				cout << "\t Child id: " << pol[j].geomId() << endl;
+		}
+	}
+	else
+	{
+		cout << "No polygons related to the object \'33\' were found!" << endl << endl;
+	}
+	ps.clear();
+
+	// Retrieve all polygons that intersect a certain bounding box
+	// given in the same projection coordinates of the data
+	TeBox box(320000,7390000,338000,7400000);
+	if (db->loadPolygonSet(polyTableName, box, ps) && ps.size() > 0)
+	{
+		cout << "\nPolygons that intersect the bounding box: (320000,7390000,338000,7400000)" << endl;
+		cout << "Number of polygons found: " << ps.size() << endl;
+		for (i = 0; i < ps.size(); ++i)
+		{
+			TePolygon pol = ps[i];
+			cout << "Parent id: " << pol[0].geomId() << ", object id: " << pol.objectId() << endl;
+			for (j = 1; j < pol.size(); ++j)
+				cout << "\t Child id: " << pol[j].geomId() << endl;
+		}
+	}
+	else
+		cout << "No polygons intersect the bounding box (320000,7390000,338000,7400000)!" << endl << endl;
+
+	//! Retrieving polygons that contain a certain point
+	TePolygon poly;
+	cout << endl << "Polygons that contain the point (350000,7395000):" << endl;
+	TeCoord2D pt(350000,7395000);
+	if (db->locatePolygon(polyTableName, pt,poly,0))
+		cout << "Polygon id: " << poly.geomId() << ", object id: " << poly.objectId() << endl;
+	else
+	{
+		cout << "\nNo polygons found!\n\n";
+		db->close();
+		cout << endl << "Press Enter\n";
+		cout.flush();
+		getchar();
+		return 0;
+	}
+
+	db->close();
+	cout << endl << "Press Enter\n";
+	cout.flush();
+	getchar();
+	return 0;
+}
+
+
+
+ 
diff --git a/examples/databaseQuery/databaseQuery.dsp b/examples/databaseQuery/databaseQuery.dsp
old mode 100755
new mode 100644
index 84292d4..6720cdb
--- a/examples/databaseQuery/databaseQuery.dsp
+++ b/examples/databaseQuery/databaseQuery.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="databaseQuery" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=databaseQuery - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "databaseQuery.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "databaseQuery.mak" CFG="databaseQuery - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "databaseQuery - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "databaseQuery - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "databaseQuery - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/databaseQuery.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "databaseQuery - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/databaseQuery.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "databaseQuery - Win32 Release"
-# Name "databaseQuery - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\databaseQuery.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="databaseQuery" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=databaseQuery - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "databaseQuery.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "databaseQuery.mak" CFG="databaseQuery - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "databaseQuery - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "databaseQuery - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "databaseQuery - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/databaseQuery.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "databaseQuery - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/databaseQuery.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "databaseQuery - Win32 Release"
+# Name "databaseQuery - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\databaseQuery.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/databaseQuery/databaseQuery.dsw b/examples/databaseQuery/databaseQuery.dsw
old mode 100755
new mode 100644
index b8b6c71..f65f451
--- a/examples/databaseQuery/databaseQuery.dsw
+++ b/examples/databaseQuery/databaseQuery.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "databaseQuery"=.\databaseQuery.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "databaseQuery"=.\databaseQuery.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/databaseQuery/databaseQuery.pro b/examples/databaseQuery/databaseQuery.pro
old mode 100755
new mode 100644
index 11cdb19..54c9aa6
--- a/examples/databaseQuery/databaseQuery.pro
+++ b/examples/databaseQuery/databaseQuery.pro
@@ -1,9 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	databaseQuery.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
+TARGET = databaseQuery
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	databaseQuery.cpp
+	
diff --git a/examples/databaseQuery/databaseQuery.sln b/examples/databaseQuery/databaseQuery.sln
old mode 100755
new mode 100644
diff --git a/examples/databaseQuery/databaseQuery.vcproj b/examples/databaseQuery/databaseQuery.vcproj
old mode 100755
new mode 100644
index 1f0f5e2..e8bda99
--- a/examples/databaseQuery/databaseQuery.vcproj
+++ b/examples/databaseQuery/databaseQuery.vcproj
@@ -1,139 +1,133 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="databaseQuery"
-	ProjectGUID="{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\databaseQuery.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				RuntimeLibrary="2"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\databaseQuery.exe"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath=".\databaseQuery.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="databaseQuery"
+	ProjectGUID="{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="."
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\databaseQuery.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="."
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				RuntimeLibrary="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\databaseQuery.exe"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath=".\databaseQuery.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/databaseSQLQuery/.cdtproject b/examples/databaseSQLQuery/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/databaseSQLQuery/.cdtproject
+++ b/examples/databaseSQLQuery/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/databaseSQLQuery/.project b/examples/databaseSQLQuery/.project
old mode 100755
new mode 100644
index 650dd21..4e5268a
--- a/examples/databaseSQLQuery/.project
+++ b/examples/databaseSQLQuery/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>databaseSQLQuery</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>databaseSQLQuery</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/databaseSQLQuery/Makefile b/examples/databaseSQLQuery/Makefile
old mode 100755
new mode 100644
index 8a3522f..7144b8b
--- a/examples/databaseSQLQuery/Makefile
+++ b/examples/databaseSQLQuery/Makefile
@@ -1,30 +1,30 @@
-all: databaseSQLQuery
-
-debug: databaseSQLQuery_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-	
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-databaseSQLQuery: terralib
-	qmake -o makeDatabaseSQLQuery databaseSQLQuery.pro; make -f makeDatabaseSQLQuery
-
-databaseSQLQuery_dbg: terralib_dbg
-	qmake -o makeDatabaseSQLQuery.debug databaseSQLQuery.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeDatabaseSQLQuery.debug
-
-clean:
-	if \
-		test -f makeDatabaseSQLQuery; \
-	then \
-		make -f makeDatabaseSQLQuery distclean; rm -f makeDatabaseSQLQuery; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeDatabaseSQLQuery.debug; \
-	then \
-		make -f makeDatabaseSQLQuery.debug distclean; rm -f makeDatabaseSQLQuery.debug; \
+all: databaseSQLQuery
+
+debug: databaseSQLQuery_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+	
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+databaseSQLQuery: terralib
+	qmake -o makeDatabaseSQLQuery databaseSQLQuery.pro; make -f makeDatabaseSQLQuery
+
+databaseSQLQuery_dbg: terralib_dbg
+	qmake -o makeDatabaseSQLQuery.debug databaseSQLQuery.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeDatabaseSQLQuery.debug
+
+clean:
+	if \
+		test -f makeDatabaseSQLQuery; \
+	then \
+		make -f makeDatabaseSQLQuery distclean; rm -f makeDatabaseSQLQuery; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeDatabaseSQLQuery.debug; \
+	then \
+		make -f makeDatabaseSQLQuery.debug distclean; rm -f makeDatabaseSQLQuery.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/databaseSQLQuery/databaseSQLQuery.cpp b/examples/databaseSQLQuery/databaseSQLQuery.cpp
old mode 100755
new mode 100644
index 3078083..8a9a1c0
--- a/examples/databaseSQLQuery/databaseSQLQuery.cpp
+++ b/examples/databaseSQLQuery/databaseSQLQuery.cpp
@@ -1,138 +1,138 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-    This file shows an example of how retrieve geometries (polygons) using an SQL query 
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeMySQL.h>
-
-int main()
-{
-	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to a MySQL database
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !";
-	cout << endl << endl;
-
-	// Load a layer by its name 
-	TeLayer *layer = new TeLayer("Distritos");
-	if (!db->loadLayer(layer))                
-	{                                                                                               
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Retrieve the information about the polygons representation
-	TeRepresentation* rep = layer->getRepresentation(TePOLYGONS);
-	if (!rep)
-	{                                                                                               
-		cout << "Layer has no polygons representation!" << endl;
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	string geomTableName = rep->tableName_;
-
-	// Build the SQL to get the polygons that are inside a given box
-	TeBox bb(320100,7390100,337900,7599000);
-    string q;
-    q = "SELECT * FROM " + geomTableName + " WHERE ";
-	q +=  db->getSQLBoxWhere (bb, TePOLYGONS);
-
-    // Get a portal to the database
-    TeDatabasePortal *portal = db->getPortal();
-    if (!portal)
-    {                                                                                               
-		cout << "Fail to get a database portal!\n\n";
-		cout << "Press Enter\n";
-		db->close();
-		getchar();
-		return 1;
-    }
-
-    // Submit the query and go to the first position of the portal 
-    if (!portal->query(q) || !portal->fetchRow())
-    {       
-		cout << "Fail to submit the query or no records returned\n";
-		delete portal;
-		db->close();
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-   }
-
-    // Process the polygons found
-    TePolygonSet ps;
-    bool flag = true;
-    do
-    {
-        TePolygon poly;
-        flag = portal->fetchGeometry(poly);
-        ps.add(poly);
-    }
-    while (flag);   // while there is a record to be read
-
-    delete portal;
-
-	// Show the result
-	unsigned int i, j;
-
-	cout << "Number of polygons found: " << ps.size() << endl;
-	for (i=0; i < ps.size(); ++i)
-    {
-		TePolygon pol = ps[i];
-		cout << "Geometry id: " << pol[0].geomId() << ", object id: " << pol.objectId() << endl;
-		for (j = 1; j < pol.size(); ++j)
-			 cout << "\t Child id: " << pol[j].geomId() << endl;
-	}
-
-
-	db->close();
-	cout << endl << "Press Enter\n";
-	cout.flush();
-	getchar();
-	return 0;
-}
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+    This file shows an example of how retrieve geometries (polygons) using an SQL query 
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeMySQL.h>
+
+int main()
+{
+	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to a MySQL database
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !";
+	cout << endl << endl;
+
+	// Load a layer by its name 
+	TeLayer *layer = new TeLayer("Distritos");
+	if (!db->loadLayer(layer))                
+	{                                                                                               
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Retrieve the information about the polygons representation
+	TeRepresentation* rep = layer->getRepresentation(TePOLYGONS);
+	if (!rep)
+	{                                                                                               
+		cout << "Layer has no polygons representation!" << endl;
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	string geomTableName = rep->tableName_;
+
+	// Build the SQL to get the polygons that are inside a given box
+	TeBox bb(320100,7390100,337900,7599000);
+    string q;
+    q = "SELECT * FROM " + geomTableName + " WHERE ";
+	q +=  db->getSQLBoxWhere (bb, TePOLYGONS, geomTableName);
+
+    // Get a portal to the database
+    TeDatabasePortal *portal = db->getPortal();
+    if (!portal)
+    {                                                                                               
+		cout << "Fail to get a database portal!\n\n";
+		cout << "Press Enter\n";
+		db->close();
+		getchar();
+		return 1;
+    }
+
+    // Submit the query and go to the first position of the portal 
+    if (!portal->query(q) || !portal->fetchRow())
+    {       
+		cout << "Fail to submit the query or no records returned\n";
+		delete portal;
+		db->close();
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+   }
+
+    // Process the polygons found
+    TePolygonSet ps;
+    bool flag = true;
+    do
+    {
+        TePolygon poly;
+        flag = portal->fetchGeometry(poly);
+        ps.add(poly);
+    }
+    while (flag);   // while there is a record to be read
+
+    delete portal;
+
+	// Show the result
+	unsigned int i, j;
+
+	cout << "Number of polygons found: " << ps.size() << endl;
+	for (i=0; i < ps.size(); ++i)
+    {
+		TePolygon pol = ps[i];
+		cout << "Geometry id: " << pol[0].geomId() << ", object id: " << pol.objectId() << endl;
+		for (j = 1; j < pol.size(); ++j)
+			 cout << "\t Child id: " << pol[j].geomId() << endl;
+	}
+
+
+	db->close();
+	cout << endl << "Press Enter\n";
+	cout.flush();
+	getchar();
+	return 0;
+}
+
+
+
diff --git a/examples/databaseSQLQuery/databaseSQLQuery.dsp b/examples/databaseSQLQuery/databaseSQLQuery.dsp
old mode 100755
new mode 100644
index cd0450d..2c2851a
--- a/examples/databaseSQLQuery/databaseSQLQuery.dsp
+++ b/examples/databaseSQLQuery/databaseSQLQuery.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="databaseSQLQuery" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=databaseSQLQuery - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "databaseSQLQuery.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "databaseSQLQuery.mak" CFG="databaseSQLQuery - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "databaseSQLQuery - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "databaseSQLQuery - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "databaseSQLQuery - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/databaseSQLQuery.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "databaseSQLQuery - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/databaseSQLQuery.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "databaseSQLQuery - Win32 Release"
-# Name "databaseSQLQuery - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\databaseSQLQuery.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="databaseSQLQuery" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=databaseSQLQuery - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "databaseSQLQuery.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "databaseSQLQuery.mak" CFG="databaseSQLQuery - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "databaseSQLQuery - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "databaseSQLQuery - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "databaseSQLQuery - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/databaseSQLQuery.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "databaseSQLQuery - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/databaseSQLQuery.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "databaseSQLQuery - Win32 Release"
+# Name "databaseSQLQuery - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\databaseSQLQuery.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/databaseSQLQuery/databaseSQLQuery.dsw b/examples/databaseSQLQuery/databaseSQLQuery.dsw
old mode 100755
new mode 100644
index e1c25b3..f524ba7
--- a/examples/databaseSQLQuery/databaseSQLQuery.dsw
+++ b/examples/databaseSQLQuery/databaseSQLQuery.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "databaseSQLQuery"=.\databaseSQLQuery.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "databaseSQLQuery"=.\databaseSQLQuery.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/databaseSQLQuery/databaseSQLQuery.pro b/examples/databaseSQLQuery/databaseSQLQuery.pro
old mode 100755
new mode 100644
index 77fb7c9..b042061
--- a/examples/databaseSQLQuery/databaseSQLQuery.pro
+++ b/examples/databaseSQLQuery/databaseSQLQuery.pro
@@ -1,9 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	databaseSQLQuery.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
+TARGET = databaseSQLQuery
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	databaseSQLQuery.cpp
+	
diff --git a/examples/databaseSQLQuery/databaseSQLQuery.sln b/examples/databaseSQLQuery/databaseSQLQuery.sln
old mode 100755
new mode 100644
index c572ee7..ddd4929
--- a/examples/databaseSQLQuery/databaseSQLQuery.sln
+++ b/examples/databaseSQLQuery/databaseSQLQuery.sln
@@ -1,50 +1,50 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\..\terralibw\terralib\terralib.vcproj", "{99BC87CA-140D-4A99-803C-DF078430A6C8}"
-	ProjectSection(ProjectDependencies) = postProject
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
-		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E} = {5E26C3A1-28D3-40FA-A3F5-115180C98E0E}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\..\terralibw\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "databaseSQLQuery", "databaseSQLQuery.vcproj", "{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}"
-	ProjectSection(ProjectDependencies) = postProject
-		{99BC87CA-140D-4A99-803C-DF078430A6C8} = {99BC87CA-140D-4A99-803C-DF078430A6C8}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\terralibw\tiff\tiff.vcproj", "{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfiguration) = preSolution
-		Debug = Debug
-		Release = Release
-	EndGlobalSection
-	GlobalSection(ProjectDependencies) = postSolution
-	EndGlobalSection
-	GlobalSection(ProjectConfiguration) = postSolution
-		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Debug.ActiveCfg = Debug|Win32
-		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Debug.Build.0 = Debug|Win32
-		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Release.ActiveCfg = Release|Win32
-		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Release.Build.0 = Release|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.ActiveCfg = Debug|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.Build.0 = Debug|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.ActiveCfg = Release|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.Build.0 = Release|Win32
-		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.ActiveCfg = Debug|Win32
-		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.Build.0 = Debug|Win32
-		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.ActiveCfg = Release|Win32
-		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-	EndGlobalSection
-	GlobalSection(ExtensibilityAddIns) = postSolution
-	EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\..\terralibw\terralib\terralib.vcproj", "{99BC87CA-140D-4A99-803C-DF078430A6C8}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E} = {5E26C3A1-28D3-40FA-A3F5-115180C98E0E}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\..\terralibw\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "databaseSQLQuery", "databaseSQLQuery.vcproj", "{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}"
+	ProjectSection(ProjectDependencies) = postProject
+		{99BC87CA-140D-4A99-803C-DF078430A6C8} = {99BC87CA-140D-4A99-803C-DF078430A6C8}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\terralibw\tiff\tiff.vcproj", "{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectDependencies) = postSolution
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Debug.ActiveCfg = Debug|Win32
+		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Debug.Build.0 = Debug|Win32
+		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Release.ActiveCfg = Release|Win32
+		{99BC87CA-140D-4A99-803C-DF078430A6C8}.Release.Build.0 = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.ActiveCfg = Debug|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.Build.0 = Debug|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.ActiveCfg = Release|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.Build.0 = Release|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.ActiveCfg = Debug|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Debug.Build.0 = Debug|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.ActiveCfg = Release|Win32
+		{5E26C3A1-28D3-40FA-A3F5-115180C98E0E}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/databaseSQLQuery/databaseSQLQuery.vcproj b/examples/databaseSQLQuery/databaseSQLQuery.vcproj
old mode 100755
new mode 100644
index ce1f4c6..536c9c4
--- a/examples/databaseSQLQuery/databaseSQLQuery.vcproj
+++ b/examples/databaseSQLQuery/databaseSQLQuery.vcproj
@@ -1,139 +1,133 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="databaseSQLQuery"
-	ProjectGUID="{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\databaseSQLQuery.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="."
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				RuntimeLibrary="2"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\databaseSQLQuery.exe"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath=".\databaseSQLQuery.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="databaseSQLQuery"
+	ProjectGUID="{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="."
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\databaseSQLQuery.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="."
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				RuntimeLibrary="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\databaseSQLQuery.exe"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath=".\databaseSQLQuery.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/examples.pro b/examples/examples.pro
new file mode 100644
index 0000000..fe761b5
--- /dev/null
+++ b/examples/examples.pro
@@ -0,0 +1,41 @@
+TEMPLATE = subdirs
+
+SUBDIRS += addGeomRepresentation \
+		./convertCoordinates \
+		./copyLayer \
+		./createDatabase \
+		./createLayer \
+		./createProximityMatrix \
+		./createSTElementSet \
+		./createSTElementSetFromLayer \
+		./createSTElementSetFromShapeFile \
+		./createSTElementSetFromTheme \
+		./createTable \
+		./createTheme \
+		./createTIN \
+		./databaseQuery \
+		./databaseSQLQuery \
+		./image_processing \
+		./importCSV \
+		./importDBF \
+		./importGeoTab \
+		./importGridData \
+		./importJPEG \
+		./importMIDMIF \
+		./importShape \
+		./mosaicTIFFImages \
+		./proxMatrixAndSpatialStatistics \
+		./querierFromLayer \
+		./querierFromTheme \
+		./querierGroupChronon \
+		./querierGroupElement \
+		./querierGroupSpatialRest \
+		./querierWithSpatialRestBox \
+		./querierWithSpatialRestGeometry \
+		./rasterSlicing \
+		./spatialQuery \
+		./spatialQueryAndBuffer \
+		./themeGrouping		
+win32 {
+	!win32-g++:SUBDIRS += ./createCoverage 
+}
\ No newline at end of file
diff --git a/examples/examples.sln b/examples/examples.sln
old mode 100755
new mode 100644
index cc2a6a1..724a417
--- a/examples/examples.sln
+++ b/examples/examples.sln
@@ -1,332 +1,425 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "addGeomRepresentation", "addGeomRepresentation\addGeomRepresentation.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-		{1CF4791C-050D-4C0F-BF5F-F51F22188FF4} = {1CF4791C-050D-4C0F-BF5F-F51F22188FF4}
-		{7781B164-814A-406B-B1C7-660D95BF3942} = {7781B164-814A-406B-B1C7-660D95BF3942}
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2} = {70DF8CB8-3CDB-4040-A832-A2FDC05758C2}
-		{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703} = {6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convertCoordinates", "convertCoordinates\convertCoordinates.vcproj", "{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copyLayer", "copyLayer\copyLayer.vcproj", "{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createDatabase", "createDatabase\createDatabase.vcproj", "{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createLayer", "createLayer\createLayer.vcproj", "{60593B0C-8CD8-4157-95EC-0185FBAD9268}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createProximityMatrix", "createProximityMatrix\createProximityMatrix.vcproj", "{766E52C5-4D16-483C-A2B1-48388BC89232}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createSTElementSet", "createSTElementSet\createSTElementSet.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createSTElementSetFromLayer", "createSTElementSetFromLayer\createSTElementSetFromLayer.vcproj", "{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createSTElementSetFromTheme", "createSTElementSetFromTheme\createSTElementSetFromTheme.vcproj", "{1BB59FDE-040E-4273-A0E1-2826608FFB95}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createTable", "createTable\createTable.vcproj", "{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "databaseQuery", "databaseQuery\databaseQuery.vcproj", "{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "databaseSQLQuery", "databaseSQLQuery\databaseSQLQuery.vcproj", "{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importCSV", "importCSV\importCSV.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importDBF", "importDBF\importDBF.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importGeoTab", "importGeoTab\importGeoTab.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importGridData", "importGridData\importGridData.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importJPEG", "importJPEG\importJPEG.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importMIDMIF", "importMIDMIF\importMIDMIF.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importShape", "importShape\importShape.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mosaicTIFFImages", "mosaicTIFFImages\mosaicTIFFImages.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proxMatrixAndSpatialStatistics", "proxMatrixAndSpatialStatistics\proxMatrixAndSpatialStatistics.vcproj", "{38377F38-0982-4920-99D7-370934E022B2}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierFromLayer", "querierFromLayer\querierFromLayer.vcproj", "{80AAE397-DA79-440F-B1EF-F7A304FAA94F}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierFromTheme", "querierFromTheme\querierFromTheme.vcproj", "{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierGroupChronon", "querierGroupChronon\querierGroupChronon.vcproj", "{A9396A28-DC43-40CF-A747-54EE8D8D17BD}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierGroupElement", "querierGroupElement\querierGroupElement.vcproj", "{AF583813-177A-4F5C-B60B-C5AD0056474A}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierGroupSpatialRest", "querierGroupSpatialRest\querierGroupSpatialRest.vcproj", "{6123FB08-BEAA-4586-8BDB-F48974A55935}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierWithSpatialRestBox", "querierWithSpatialRestBox\querierWithSpatialRestBox.vcproj", "{B63260EA-95CD-4B78-8EC5-8909737A341D}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierWithSpatialRestGeometry", "querierWithSpatialRestGeometry\querierWithSpatialRestGeometry.vcproj", "{752259B0-62E3-49E0-9E87-DB9175684D0C}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rasterSlicing", "rasterSlicing\rasterSlicing.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spatialQuery", "spatialQuery\spatialQuery.vcproj", "{1175F29C-62AB-4584-99FC-34692ABCFF08}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spatialQueryAndBuffer", "spatialQueryAndBuffer\spatialQueryAndBuffer.vcproj", "{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "themeGrouping", "themeGrouping\themeGrouping.vcproj", "{56B7D410-3CB8-445A-974E-ECCCF4C48232}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\terralibw\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapelib", "..\terralibw\shapelib\shapelib.vcproj", "{7781B164-814A-406B-B1C7-660D95BF3942}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stat", "..\terralibw\stat\stat.vcproj", "{1CF4791C-050D-4C0F-BF5F-F51F22188FF4}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\terralibw\terralib\terralib.vcproj", "{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\terralibw\tiff\tiff.vcproj", "{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createTheme", "createTheme\createTheme.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createTIN", "createTIN\createTIN.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfiguration) = preSolution
-		Debug = Debug
-		Release = Release
-	EndGlobalSection
-	GlobalSection(ProjectDependencies) = postSolution
-	EndGlobalSection
-	GlobalSection(ProjectConfiguration) = postSolution
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}.Debug.ActiveCfg = Debug|Win32
-		{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}.Debug.Build.0 = Debug|Win32
-		{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}.Release.ActiveCfg = Release|Win32
-		{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}.Release.Build.0 = Release|Win32
-		{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}.Debug.ActiveCfg = Debug|Win32
-		{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}.Debug.Build.0 = Debug|Win32
-		{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}.Release.ActiveCfg = Release|Win32
-		{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}.Release.Build.0 = Release|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.ActiveCfg = Debug|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.Build.0 = Debug|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.ActiveCfg = Release|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.Build.0 = Release|Win32
-		{60593B0C-8CD8-4157-95EC-0185FBAD9268}.Debug.ActiveCfg = Debug|Win32
-		{60593B0C-8CD8-4157-95EC-0185FBAD9268}.Debug.Build.0 = Debug|Win32
-		{60593B0C-8CD8-4157-95EC-0185FBAD9268}.Release.ActiveCfg = Release|Win32
-		{60593B0C-8CD8-4157-95EC-0185FBAD9268}.Release.Build.0 = Release|Win32
-		{766E52C5-4D16-483C-A2B1-48388BC89232}.Debug.ActiveCfg = Debug|Win32
-		{766E52C5-4D16-483C-A2B1-48388BC89232}.Debug.Build.0 = Debug|Win32
-		{766E52C5-4D16-483C-A2B1-48388BC89232}.Release.ActiveCfg = Release|Win32
-		{766E52C5-4D16-483C-A2B1-48388BC89232}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}.Debug.ActiveCfg = Debug|Win32
-		{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}.Debug.Build.0 = Debug|Win32
-		{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}.Release.ActiveCfg = Release|Win32
-		{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}.Release.Build.0 = Release|Win32
-		{1BB59FDE-040E-4273-A0E1-2826608FFB95}.Debug.ActiveCfg = Debug|Win32
-		{1BB59FDE-040E-4273-A0E1-2826608FFB95}.Debug.Build.0 = Debug|Win32
-		{1BB59FDE-040E-4273-A0E1-2826608FFB95}.Release.ActiveCfg = Release|Win32
-		{1BB59FDE-040E-4273-A0E1-2826608FFB95}.Release.Build.0 = Release|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.ActiveCfg = Debug|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.Build.0 = Debug|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.ActiveCfg = Release|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.Build.0 = Release|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.ActiveCfg = Debug|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.Build.0 = Debug|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.ActiveCfg = Release|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.Build.0 = Release|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.ActiveCfg = Debug|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.Build.0 = Debug|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.ActiveCfg = Release|Win32
-		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{38377F38-0982-4920-99D7-370934E022B2}.Debug.ActiveCfg = Debug|Win32
-		{38377F38-0982-4920-99D7-370934E022B2}.Debug.Build.0 = Debug|Win32
-		{38377F38-0982-4920-99D7-370934E022B2}.Release.ActiveCfg = Release|Win32
-		{38377F38-0982-4920-99D7-370934E022B2}.Release.Build.0 = Release|Win32
-		{80AAE397-DA79-440F-B1EF-F7A304FAA94F}.Debug.ActiveCfg = Debug|Win32
-		{80AAE397-DA79-440F-B1EF-F7A304FAA94F}.Debug.Build.0 = Debug|Win32
-		{80AAE397-DA79-440F-B1EF-F7A304FAA94F}.Release.ActiveCfg = Release|Win32
-		{80AAE397-DA79-440F-B1EF-F7A304FAA94F}.Release.Build.0 = Release|Win32
-		{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}.Debug.ActiveCfg = Debug|Win32
-		{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}.Debug.Build.0 = Debug|Win32
-		{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}.Release.ActiveCfg = Release|Win32
-		{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}.Release.Build.0 = Release|Win32
-		{A9396A28-DC43-40CF-A747-54EE8D8D17BD}.Debug.ActiveCfg = Debug|Win32
-		{A9396A28-DC43-40CF-A747-54EE8D8D17BD}.Debug.Build.0 = Debug|Win32
-		{A9396A28-DC43-40CF-A747-54EE8D8D17BD}.Release.ActiveCfg = Release|Win32
-		{A9396A28-DC43-40CF-A747-54EE8D8D17BD}.Release.Build.0 = Release|Win32
-		{AF583813-177A-4F5C-B60B-C5AD0056474A}.Debug.ActiveCfg = Debug|Win32
-		{AF583813-177A-4F5C-B60B-C5AD0056474A}.Debug.Build.0 = Debug|Win32
-		{AF583813-177A-4F5C-B60B-C5AD0056474A}.Release.ActiveCfg = Release|Win32
-		{AF583813-177A-4F5C-B60B-C5AD0056474A}.Release.Build.0 = Release|Win32
-		{6123FB08-BEAA-4586-8BDB-F48974A55935}.Debug.ActiveCfg = Debug|Win32
-		{6123FB08-BEAA-4586-8BDB-F48974A55935}.Debug.Build.0 = Debug|Win32
-		{6123FB08-BEAA-4586-8BDB-F48974A55935}.Release.ActiveCfg = Release|Win32
-		{6123FB08-BEAA-4586-8BDB-F48974A55935}.Release.Build.0 = Release|Win32
-		{B63260EA-95CD-4B78-8EC5-8909737A341D}.Debug.ActiveCfg = Debug|Win32
-		{B63260EA-95CD-4B78-8EC5-8909737A341D}.Debug.Build.0 = Debug|Win32
-		{B63260EA-95CD-4B78-8EC5-8909737A341D}.Release.ActiveCfg = Release|Win32
-		{B63260EA-95CD-4B78-8EC5-8909737A341D}.Release.Build.0 = Release|Win32
-		{752259B0-62E3-49E0-9E87-DB9175684D0C}.Debug.ActiveCfg = Debug|Win32
-		{752259B0-62E3-49E0-9E87-DB9175684D0C}.Debug.Build.0 = Debug|Win32
-		{752259B0-62E3-49E0-9E87-DB9175684D0C}.Release.ActiveCfg = Release|Win32
-		{752259B0-62E3-49E0-9E87-DB9175684D0C}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{1175F29C-62AB-4584-99FC-34692ABCFF08}.Debug.ActiveCfg = Debug|Win32
-		{1175F29C-62AB-4584-99FC-34692ABCFF08}.Debug.Build.0 = Debug|Win32
-		{1175F29C-62AB-4584-99FC-34692ABCFF08}.Release.ActiveCfg = Release|Win32
-		{1175F29C-62AB-4584-99FC-34692ABCFF08}.Release.Build.0 = Release|Win32
-		{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}.Debug.ActiveCfg = Debug|Win32
-		{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}.Debug.Build.0 = Debug|Win32
-		{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}.Release.ActiveCfg = Release|Win32
-		{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}.Release.Build.0 = Release|Win32
-		{56B7D410-3CB8-445A-974E-ECCCF4C48232}.Debug.ActiveCfg = Debug|Win32
-		{56B7D410-3CB8-445A-974E-ECCCF4C48232}.Debug.Build.0 = Debug|Win32
-		{56B7D410-3CB8-445A-974E-ECCCF4C48232}.Release.ActiveCfg = Release|Win32
-		{56B7D410-3CB8-445A-974E-ECCCF4C48232}.Release.Build.0 = Release|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
-		{7781B164-814A-406B-B1C7-660D95BF3942}.Debug.ActiveCfg = Debug|Win32
-		{7781B164-814A-406B-B1C7-660D95BF3942}.Debug.Build.0 = Debug|Win32
-		{7781B164-814A-406B-B1C7-660D95BF3942}.Release.ActiveCfg = Release|Win32
-		{7781B164-814A-406B-B1C7-660D95BF3942}.Release.Build.0 = Release|Win32
-		{1CF4791C-050D-4C0F-BF5F-F51F22188FF4}.Debug.ActiveCfg = Debug|Win32
-		{1CF4791C-050D-4C0F-BF5F-F51F22188FF4}.Debug.Build.0 = Debug|Win32
-		{1CF4791C-050D-4C0F-BF5F-F51F22188FF4}.Release.ActiveCfg = Release|Win32
-		{1CF4791C-050D-4C0F-BF5F-F51F22188FF4}.Release.Build.0 = Release|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.ActiveCfg = Debug|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.Build.0 = Debug|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.ActiveCfg = Release|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.Build.0 = Release|Win32
-		{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}.Debug.ActiveCfg = Debug|Win32
-		{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}.Debug.Build.0 = Debug|Win32
-		{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}.Release.ActiveCfg = Release|Win32
-		{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
-		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-	EndGlobalSection
-	GlobalSection(ExtensibilityAddIns) = postSolution
-	EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "addGeomRepresentation", "addGeomRepresentation\addGeomRepresentation.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convertCoordinates", "convertCoordinates\convertCoordinates.vcproj", "{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copyLayer", "copyLayer\copyLayer.vcproj", "{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createDatabase", "createDatabase\createDatabase.vcproj", "{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createLayer", "createLayer\createLayer.vcproj", "{60593B0C-8CD8-4157-95EC-0185FBAD9268}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createProximityMatrix", "createProximityMatrix\createProximityMatrix.vcproj", "{766E52C5-4D16-483C-A2B1-48388BC89232}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createSTElementSet", "createSTElementSet\createSTElementSet.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createSTElementSetFromLayer", "createSTElementSetFromLayer\createSTElementSetFromLayer.vcproj", "{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createSTElementSetFromTheme", "createSTElementSetFromTheme\createSTElementSetFromTheme.vcproj", "{1BB59FDE-040E-4273-A0E1-2826608FFB95}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createTable", "createTable\createTable.vcproj", "{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "databaseQuery", "databaseQuery\databaseQuery.vcproj", "{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "databaseSQLQuery", "databaseSQLQuery\databaseSQLQuery.vcproj", "{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importCSV", "importCSV\importCSV.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importDBF", "importDBF\importDBF.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importGeoTab", "importGeoTab\importGeoTab.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importGridData", "importGridData\importGridData.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importJPEG", "importJPEG\importJPEG.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importMIDMIF", "importMIDMIF\importMIDMIF.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "importShape", "importShape\importShape.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mosaicTIFFImages", "mosaicTIFFImages\mosaicTIFFImages.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proxMatrixAndSpatialStatistics", "proxMatrixAndSpatialStatistics\proxMatrixAndSpatialStatistics.vcproj", "{38377F38-0982-4920-99D7-370934E022B2}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierFromLayer", "querierFromLayer\querierFromLayer.vcproj", "{80AAE397-DA79-440F-B1EF-F7A304FAA94F}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierFromTheme", "querierFromTheme\querierFromTheme.vcproj", "{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierGroupChronon", "querierGroupChronon\querierGroupChronon.vcproj", "{A9396A28-DC43-40CF-A747-54EE8D8D17BD}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierGroupElement", "querierGroupElement\querierGroupElement.vcproj", "{AF583813-177A-4F5C-B60B-C5AD0056474A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierGroupSpatialRest", "querierGroupSpatialRest\querierGroupSpatialRest.vcproj", "{6123FB08-BEAA-4586-8BDB-F48974A55935}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierWithSpatialRestBox", "querierWithSpatialRestBox\querierWithSpatialRestBox.vcproj", "{B63260EA-95CD-4B78-8EC5-8909737A341D}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierWithSpatialRestGeometry", "querierWithSpatialRestGeometry\querierWithSpatialRestGeometry.vcproj", "{752259B0-62E3-49E0-9E87-DB9175684D0C}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rasterSlicing", "rasterSlicing\rasterSlicing.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spatialQuery", "spatialQuery\spatialQuery.vcproj", "{1175F29C-62AB-4584-99FC-34692ABCFF08}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spatialQueryAndBuffer", "spatialQueryAndBuffer\spatialQueryAndBuffer.vcproj", "{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "themeGrouping", "themeGrouping\themeGrouping.vcproj", "{56B7D410-3CB8-445A-974E-ECCCF4C48232}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\build\win32-msvc2003\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapelib", "..\build\win32-msvc2003\shapelib\shapelib.vcproj", "{7781B164-814A-406B-B1C7-660D95BF3942}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stat", "..\build\win32-msvc2003\stat\stat.vcproj", "{1CF4791C-050D-4C0F-BF5F-F51F22188FF4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2} = {70DF8CB8-3CDB-4040-A832-A2FDC05758C2}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\build\win32-msvc2003\terralib\terralib.vcproj", "{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}"
+	ProjectSection(ProjectDependencies) = postProject
+		{7781B164-814A-406B-B1C7-660D95BF3942} = {7781B164-814A-406B-B1C7-660D95BF3942}
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+		{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703} = {6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\build\win32-msvc2003\tiff\tiff.vcproj", "{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createTheme", "createTheme\createTheme.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createTIN", "createTIN\createTIN.vcproj", "{AC29CA10-2B75-494F-A370-6767C7AB5FC1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B} = {877A1388-B3CA-481A-9BFB-C7178EC68D0B}
+		{31C5E1F3-85BD-4580-973D-CA344342DD36} = {31C5E1F3-85BD-4580-973D-CA344342DD36}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_functions", "..\build\win32-msvc2003\te_functions\te_functions.vcproj", "{877A1388-B3CA-481A-9BFB-C7178EC68D0B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2} = {70DF8CB8-3CDB-4040-A832-A2FDC05758C2}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_mysql", "..\build\win32-msvc2003\te_mysql\te_mysql.vcproj", "{31C5E1F3-85BD-4580-973D-CA344342DD36}"
+	ProjectSection(ProjectDependencies) = postProject
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2} = {70DF8CB8-3CDB-4040-A832-A2FDC05758C2}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "te_shapelib", "..\build\win32-msvc2003\te_shapelib\te_shapelib.vcproj", "{18CAE353-F7DD-4FDA-971A-48D856DA0635}"
+	ProjectSection(ProjectDependencies) = postProject
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2} = {70DF8CB8-3CDB-4040-A832-A2FDC05758C2}
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectDependencies) = postSolution
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}.Debug.ActiveCfg = Debug|Win32
+		{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}.Debug.Build.0 = Debug|Win32
+		{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}.Release.ActiveCfg = Release|Win32
+		{7AF97D40-AC01-471B-AE4A-81D2542DFE5A}.Release.Build.0 = Release|Win32
+		{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}.Debug.ActiveCfg = Debug|Win32
+		{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}.Debug.Build.0 = Debug|Win32
+		{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}.Release.ActiveCfg = Release|Win32
+		{BA9A9F9F-CD6E-4203-97C6-EBF862BE6A4D}.Release.Build.0 = Release|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.ActiveCfg = Debug|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.Build.0 = Debug|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.ActiveCfg = Release|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.Build.0 = Release|Win32
+		{60593B0C-8CD8-4157-95EC-0185FBAD9268}.Debug.ActiveCfg = Debug|Win32
+		{60593B0C-8CD8-4157-95EC-0185FBAD9268}.Debug.Build.0 = Debug|Win32
+		{60593B0C-8CD8-4157-95EC-0185FBAD9268}.Release.ActiveCfg = Release|Win32
+		{60593B0C-8CD8-4157-95EC-0185FBAD9268}.Release.Build.0 = Release|Win32
+		{766E52C5-4D16-483C-A2B1-48388BC89232}.Debug.ActiveCfg = Debug|Win32
+		{766E52C5-4D16-483C-A2B1-48388BC89232}.Debug.Build.0 = Debug|Win32
+		{766E52C5-4D16-483C-A2B1-48388BC89232}.Release.ActiveCfg = Release|Win32
+		{766E52C5-4D16-483C-A2B1-48388BC89232}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}.Debug.ActiveCfg = Debug|Win32
+		{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}.Debug.Build.0 = Debug|Win32
+		{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}.Release.ActiveCfg = Release|Win32
+		{13B81AAF-DFE1-4E64-8B6D-1D4251DF8926}.Release.Build.0 = Release|Win32
+		{1BB59FDE-040E-4273-A0E1-2826608FFB95}.Debug.ActiveCfg = Debug|Win32
+		{1BB59FDE-040E-4273-A0E1-2826608FFB95}.Debug.Build.0 = Debug|Win32
+		{1BB59FDE-040E-4273-A0E1-2826608FFB95}.Release.ActiveCfg = Release|Win32
+		{1BB59FDE-040E-4273-A0E1-2826608FFB95}.Release.Build.0 = Release|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.ActiveCfg = Debug|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.Build.0 = Debug|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.ActiveCfg = Release|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.Build.0 = Release|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.ActiveCfg = Debug|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.Build.0 = Debug|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.ActiveCfg = Release|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.Build.0 = Release|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.ActiveCfg = Debug|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Debug.Build.0 = Debug|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.ActiveCfg = Release|Win32
+		{970FF570-5C7F-48A4-B8C7-C0539D3A45DA}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{38377F38-0982-4920-99D7-370934E022B2}.Debug.ActiveCfg = Debug|Win32
+		{38377F38-0982-4920-99D7-370934E022B2}.Debug.Build.0 = Debug|Win32
+		{38377F38-0982-4920-99D7-370934E022B2}.Release.ActiveCfg = Release|Win32
+		{38377F38-0982-4920-99D7-370934E022B2}.Release.Build.0 = Release|Win32
+		{80AAE397-DA79-440F-B1EF-F7A304FAA94F}.Debug.ActiveCfg = Debug|Win32
+		{80AAE397-DA79-440F-B1EF-F7A304FAA94F}.Debug.Build.0 = Debug|Win32
+		{80AAE397-DA79-440F-B1EF-F7A304FAA94F}.Release.ActiveCfg = Release|Win32
+		{80AAE397-DA79-440F-B1EF-F7A304FAA94F}.Release.Build.0 = Release|Win32
+		{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}.Debug.ActiveCfg = Debug|Win32
+		{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}.Debug.Build.0 = Debug|Win32
+		{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}.Release.ActiveCfg = Release|Win32
+		{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}.Release.Build.0 = Release|Win32
+		{A9396A28-DC43-40CF-A747-54EE8D8D17BD}.Debug.ActiveCfg = Debug|Win32
+		{A9396A28-DC43-40CF-A747-54EE8D8D17BD}.Debug.Build.0 = Debug|Win32
+		{A9396A28-DC43-40CF-A747-54EE8D8D17BD}.Release.ActiveCfg = Release|Win32
+		{A9396A28-DC43-40CF-A747-54EE8D8D17BD}.Release.Build.0 = Release|Win32
+		{AF583813-177A-4F5C-B60B-C5AD0056474A}.Debug.ActiveCfg = Debug|Win32
+		{AF583813-177A-4F5C-B60B-C5AD0056474A}.Debug.Build.0 = Debug|Win32
+		{AF583813-177A-4F5C-B60B-C5AD0056474A}.Release.ActiveCfg = Release|Win32
+		{AF583813-177A-4F5C-B60B-C5AD0056474A}.Release.Build.0 = Release|Win32
+		{6123FB08-BEAA-4586-8BDB-F48974A55935}.Debug.ActiveCfg = Debug|Win32
+		{6123FB08-BEAA-4586-8BDB-F48974A55935}.Debug.Build.0 = Debug|Win32
+		{6123FB08-BEAA-4586-8BDB-F48974A55935}.Release.ActiveCfg = Release|Win32
+		{6123FB08-BEAA-4586-8BDB-F48974A55935}.Release.Build.0 = Release|Win32
+		{B63260EA-95CD-4B78-8EC5-8909737A341D}.Debug.ActiveCfg = Debug|Win32
+		{B63260EA-95CD-4B78-8EC5-8909737A341D}.Debug.Build.0 = Debug|Win32
+		{B63260EA-95CD-4B78-8EC5-8909737A341D}.Release.ActiveCfg = Release|Win32
+		{B63260EA-95CD-4B78-8EC5-8909737A341D}.Release.Build.0 = Release|Win32
+		{752259B0-62E3-49E0-9E87-DB9175684D0C}.Debug.ActiveCfg = Debug|Win32
+		{752259B0-62E3-49E0-9E87-DB9175684D0C}.Debug.Build.0 = Debug|Win32
+		{752259B0-62E3-49E0-9E87-DB9175684D0C}.Release.ActiveCfg = Release|Win32
+		{752259B0-62E3-49E0-9E87-DB9175684D0C}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{1175F29C-62AB-4584-99FC-34692ABCFF08}.Debug.ActiveCfg = Debug|Win32
+		{1175F29C-62AB-4584-99FC-34692ABCFF08}.Debug.Build.0 = Debug|Win32
+		{1175F29C-62AB-4584-99FC-34692ABCFF08}.Release.ActiveCfg = Release|Win32
+		{1175F29C-62AB-4584-99FC-34692ABCFF08}.Release.Build.0 = Release|Win32
+		{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}.Debug.ActiveCfg = Debug|Win32
+		{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}.Debug.Build.0 = Debug|Win32
+		{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}.Release.ActiveCfg = Release|Win32
+		{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}.Release.Build.0 = Release|Win32
+		{56B7D410-3CB8-445A-974E-ECCCF4C48232}.Debug.ActiveCfg = Debug|Win32
+		{56B7D410-3CB8-445A-974E-ECCCF4C48232}.Debug.Build.0 = Debug|Win32
+		{56B7D410-3CB8-445A-974E-ECCCF4C48232}.Release.ActiveCfg = Release|Win32
+		{56B7D410-3CB8-445A-974E-ECCCF4C48232}.Release.Build.0 = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
+		{7781B164-814A-406B-B1C7-660D95BF3942}.Debug.ActiveCfg = Debug|Win32
+		{7781B164-814A-406B-B1C7-660D95BF3942}.Debug.Build.0 = Debug|Win32
+		{7781B164-814A-406B-B1C7-660D95BF3942}.Release.ActiveCfg = Release|Win32
+		{7781B164-814A-406B-B1C7-660D95BF3942}.Release.Build.0 = Release|Win32
+		{1CF4791C-050D-4C0F-BF5F-F51F22188FF4}.Debug.ActiveCfg = Debug|Win32
+		{1CF4791C-050D-4C0F-BF5F-F51F22188FF4}.Debug.Build.0 = Debug|Win32
+		{1CF4791C-050D-4C0F-BF5F-F51F22188FF4}.Release.ActiveCfg = Release|Win32
+		{1CF4791C-050D-4C0F-BF5F-F51F22188FF4}.Release.Build.0 = Release|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.ActiveCfg = Debug|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.Build.0 = Debug|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.ActiveCfg = Release|Win32
+		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.Build.0 = Release|Win32
+		{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}.Debug.ActiveCfg = Debug|Win32
+		{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}.Debug.Build.0 = Debug|Win32
+		{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}.Release.ActiveCfg = Release|Win32
+		{6D2D23CE-3FC9-4AFA-AA25-8A5FF7D51703}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.ActiveCfg = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Debug.Build.0 = Debug|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.ActiveCfg = Release|Win32
+		{AC29CA10-2B75-494F-A370-6767C7AB5FC1}.Release.Build.0 = Release|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Debug.ActiveCfg = Debug|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Debug.Build.0 = Debug|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Release.ActiveCfg = Release|Win32
+		{877A1388-B3CA-481A-9BFB-C7178EC68D0B}.Release.Build.0 = Release|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Debug.ActiveCfg = Debug|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Debug.Build.0 = Debug|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Release.ActiveCfg = Release|Win32
+		{31C5E1F3-85BD-4580-973D-CA344342DD36}.Release.Build.0 = Release|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Debug.ActiveCfg = Debug|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Debug.Build.0 = Debug|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Release.ActiveCfg = Release|Win32
+		{18CAE353-F7DD-4FDA-971A-48D856DA0635}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/image_processing/.cvsignore b/examples/image_processing/.cvsignore
new file mode 100644
index 0000000..50f07ec
--- /dev/null
+++ b/examples/image_processing/.cvsignore
@@ -0,0 +1,3 @@
+Makefile_examples
+*.ncb
+*.suo
diff --git a/examples/image_processing/Makefile b/examples/image_processing/Makefile
old mode 100755
new mode 100644
index dc6db05..fc85e64
--- a/examples/image_processing/Makefile
+++ b/examples/image_processing/Makefile
@@ -1,21 +1,51 @@
-buildtests: 
-	qmake -o Makefile_examples;
-	make -f Makefile_examples;
-  
-distclean: 
-	qmake -o Makefile_examples;
-	make -f Makefile_examples distclean;	
-
-clean : distclean	
-
-runalltests :	
-	./run_all_tests_unix.sh;	
-	
-check : distclean buildtests runalltests	
-
-distcheck : check	
-
-all : distclean buildtests
-	
-  
-
+#############################################################################
+# Makefile for building: image_processing
+# Generated by qmake (1.07a) (Qt 3.3.8) on: Wed Feb  9 14:05:38 2011
+# Project:  image_processing.pro
+# Template: subdirs
+# Command: $(QMAKE) -o Makefile image_processing.pro
+#############################################################################
+
+MAKEFILE =	Makefile
+QMAKE    =	qmake
+DEL_FILE =    rm -f
+CHK_DIR_EXISTS= test -d
+MKDIR    = mkdir -p
+INSTALL_FILE= 
+INSTALL_DIR = 
+SUBTARGETS =	 \
+		sub-source
+
+first: all
+
+all: Makefile $(SUBTARGETS)
+
+source/$(MAKEFILE): 
+	@$(CHK_DIR_EXISTS) "source" || $(MKDIR) "source"
+	cd source && $(QMAKE) source.pro -o $(MAKEFILE)
+sub-source: source/$(MAKEFILE) FORCE
+	cd source && $(MAKE) -f $(MAKEFILE)
+
+Makefile: image_processing.pro  /usr/lib/qt3/mkspecs/default/qmake.conf 
+	$(QMAKE) -o Makefile image_processing.pro
+qmake: qmake_all
+	@$(QMAKE) -o Makefile image_processing.pro
+
+all: $(SUBTARGETS)
+qmake_all: source/$(MAKEFILE)
+	 ( [ -d source ] && cd source ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
+clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE
+	 ( [ -d source ] && cd source ; $(MAKE) -f $(MAKEFILE) $@; ) || true
+uninstall_subdirs: qmake_all FORCE
+	 ( [ -d source ] && cd source ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
+install_subdirs: qmake_all FORCE
+	 ( [ -d source ] && cd source ; $(MAKE) -f $(MAKEFILE) install; ) || true
+distclean: qmake_all FORCE
+	 ( [ -d source ] && cd source ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
+
+install:  install_subdirs
+
+uninstall:  uninstall_subdirs
+
+FORCE:
+
diff --git a/examples/image_processing/bin/.cvsignore b/examples/image_processing/bin/.cvsignore
new file mode 100644
index 0000000..a6f7f2a
--- /dev/null
+++ b/examples/image_processing/bin/.cvsignore
@@ -0,0 +1,9 @@
+*.tif
+Te*
+*.dll
+*.dbf
+*.shp
+*.shx
+*.tfw
+*.pdb
+
diff --git a/examples/image_processing/bin/run_all_tests_unix.sh b/examples/image_processing/bin/run_all_tests_unix.sh
old mode 100755
new mode 100644
index 064ba0f..75520a4
--- a/examples/image_processing/bin/run_all_tests_unix.sh
+++ b/examples/image_processing/bin/run_all_tests_unix.sh
@@ -1,48 +1,48 @@
-#!/bin/bash
-
-echo Starting test procedure...
-echo The current directory is:
-pwd
-
-echo Cleanning garbage files...
-find -name "*.tif" -exec rm -f {} \;
-find -name "*.ilk" -exec rm -f {} \;
-find -name "*.pdb" -exec rm -f {} \;
-find -name "*.exe" -exec rm -f {} \;
-echo Cleanning done.
-
-TEST_FAILED=0
-AT_LEAST_ONE_TEST_FAILED=0
-
-for i in $( ls TePDI* ); do
-  if [ -x $i ]; then
-    echo Now running $i test ...
-    
-    TEST_FAILED=0
-    /bin/nice -n +5 $i &> /tmp/terralibupdate.log
-    
-    if [ "$?" -ne "0" ]; then 
-      TEST_FAILED=1
-      AT_LEAST_ONE_TEST_FAILED=1
-      echo Test $i failed.
-    fi
-    
-    if [ -n "$1" ]; then
-      echo ----------------------------------------------------------------
-      cat /tmp/terralibupdate.log
-      echo ----------------------------------------------------------------    
-    else
-      if [ $TEST_FAILED -eq "1" ]; then
-        echo ----------------------------------------------------------------
-        cat /tmp/terralibupdate.log
-        echo ----------------------------------------------------------------    
-      fi      
-    fi
-  fi
-done
-if [ $AT_LEAST_ONE_TEST_FAILED -ne "0" ]; then
-  echo ----------------------------------------------------------------
-  echo Test procedure finished with errors.
-else
-  echo Test procedure finished with no errors.
-fi
+#!/bin/bash
+
+echo Starting test procedure...
+echo The current directory is:
+pwd
+
+echo Cleanning garbage files...
+find -name "*.tif" -exec rm -f {} \;
+find -name "*.ilk" -exec rm -f {} \;
+find -name "*.pdb" -exec rm -f {} \;
+find -name "*.exe" -exec rm -f {} \;
+echo Cleanning done.
+
+TEST_FAILED=0
+AT_LEAST_ONE_TEST_FAILED=0
+
+for i in $( ls TePDI* ); do
+  if [ -x $i ]; then
+    echo Now running $i test ...
+    
+    TEST_FAILED=0
+    /bin/nice -n +5 $i &> /tmp/terralibupdate.log
+    
+    if [ "$?" -ne "0" ]; then 
+      TEST_FAILED=1
+      AT_LEAST_ONE_TEST_FAILED=1
+      echo Test $i failed.
+    fi
+    
+    if [ -n "$1" ]; then
+      echo ----------------------------------------------------------------
+      cat /tmp/terralibupdate.log
+      echo ----------------------------------------------------------------    
+    else
+      if [ $TEST_FAILED -eq "1" ]; then
+        echo ----------------------------------------------------------------
+        cat /tmp/terralibupdate.log
+        echo ----------------------------------------------------------------    
+      fi      
+    fi
+  fi
+done
+if [ $AT_LEAST_ONE_TEST_FAILED -ne "0" ]; then
+  echo ----------------------------------------------------------------
+  echo Test procedure finished with errors.
+else
+  echo Test procedure finished with no errors.
+fi
diff --git a/examples/image_processing/image_processing.pro b/examples/image_processing/image_processing.pro
old mode 100755
new mode 100644
index 1bc3ccb..0635acc
--- a/examples/image_processing/image_processing.pro
+++ b/examples/image_processing/image_processing.pro
@@ -1,7 +1,7 @@
-
-TEMPLATE = subdirs
-
-SUBDIRS = \
-          source
-
-
+
+TEMPLATE = subdirs
+
+SUBDIRS = \
+          source
+
+
diff --git a/examples/image_processing/image_processing.sln b/examples/image_processing/image_processing.sln
old mode 100755
new mode 100644
index a613455..0cbf647
--- a/examples/image_processing/image_processing.sln
+++ b/examples/image_processing/image_processing.sln
@@ -1,348 +1,356 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIArithmetic_test", "source\TePDIArithmetic\TePDIArithmetic_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83} = {56D7AA1F-BA95-4B48-843A-D264BEFF4E83}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIBDFilter_test", "source\TePDIBDFilter\TePDIBDFilter_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIColorTransform_test", "source\TePDIColorTransform\TePDIColorTransform_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIContrast_test", "source\TePDIContrast\TePDIContrast_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIFilterMask_test", "source\TePDIFilterMask\TePDIFilterMask_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIHistogram_test", "source\TePDIHistogram\TePDIHistogram_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDILinearFilter_test", "source\TePDILinearFilter\TePDILinearFilter_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMatrix_test", "source\TePDIMatrix\TePDIMatrix_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMorfFilter_test", "source\TePDIMorfFilter\TePDIMorfFilter_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIParameters_test", "source\TePDIParameters\TePDIParameters_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIPrincipalComponents_test", "source\TePDIPrincipalComponents\TePDIPrincipalComponents_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIRadarFilters_test", "source\TePDIRadarFilters\TePDIRadarFilters_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIRaster2Vector_test", "source\TePDIRaster2Vector\TePDIRaster2Vector_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIRgbPalette_test", "source\TePDIRgbPalette\TePDIRgbPalette_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIStatistic_test", "source\TePDIStatistic\TePDIStatistic_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIUtils_test", "source\TePDIUtils\TePDIUtils_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMosaic_test", "source\TePDIMosaic\TePDIMosaic_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIFusion_test", "source\TePDIFusion\TePDIFusion_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMathFunctions_test", "source\TePDIMathFunctions\TePDIMathFunctions_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMatrixFunctions_test", "source\TePDIMatrixFunctions\TePDIMatrixFunctions_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIWavelets_test", "source\TePDIWavelets\TePDIWavelets_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDISegmentation_test", "source\TePDISegmentation\TePDISegmentation_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\..\terralibw\terralib\terralib.vcproj", "{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}"
-	ProjectSection(ProjectDependencies) = postProject
-		{5E88B863-2CFC-4076-B6B5-6AAD2E75EF07} = {5E88B863-2CFC-4076-B6B5-6AAD2E75EF07}
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
-		{4CF0DECC-273D-438E-A073-8ADBE30F6F5C} = {4CF0DECC-273D-438E-A073-8ADBE30F6F5C}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralibpdi", "..\..\terralibw\image_processing\terralibpdi.vcproj", "{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}"
-	ProjectSection(ProjectDependencies) = postProject
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2} = {70DF8CB8-3CDB-4040-A832-A2FDC05758C2}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\terralibw\tiff\tiff.vcproj", "{5E88B863-2CFC-4076-B6B5-6AAD2E75EF07}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapelib", "..\..\terralibw\shapelib\shapelib.vcproj", "{4CF0DECC-273D-438E-A073-8ADBE30F6F5C}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIInterpolator_test", "source\TePDIInterpolator\TePDIInterpolator_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIRegister_test", "source\TePDIRegister\TePDIRegister_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIBlending_test", "source\TePDIBlending\TePDIBlending_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIHaralick_test", "source\TePDIHaralick\TePDIHaralick_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIClassification_test", "source\TePDIClassification\TePDIClassification_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMixModel_test", "source\TePDIMixModel\TePDIMixModel_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDISensorSimulator_test", "source\TePDISensorSimulator\TePDISensorSimulator_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\..\terralibw\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIPIManager_test", "source\TePDIPIManager\TePDIPIManager_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIDecorrelationEnhancement_test", "source\TePDIDecorrelationEnhancement\TePDIDecorrelationEnhancement_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIOFMatching_test", "source\TePDIOFMatching\TePDIOFMatching_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDICorrelationMatching_test", "source\TePDICorrelationMatching\TePDICorrelationMatching_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMIMatching_test", "source\TePDIMIMatching\TePDIMIMatching_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIJointHistogram_test", "source\TePDIJointHistogram\TePDIJointHistogram_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMMIOMatching_test", "source\TePDIMMIOMatching\TePDIMMIOMatching_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfiguration) = preSolution
-		Debug = Debug
-		Release = Release
-	EndGlobalSection
-	GlobalSection(ProjectDependencies) = postSolution
-	EndGlobalSection
-	GlobalSection(ProjectConfiguration) = postSolution
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.ActiveCfg = Debug|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Debug.Build.0 = Debug|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.ActiveCfg = Release|Win32
-		{70DF8CB8-3CDB-4040-A832-A2FDC05758C2}.Release.Build.0 = Release|Win32
-		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Debug.ActiveCfg = Debug|Win32
-		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Debug.Build.0 = Debug|Win32
-		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Release.ActiveCfg = Release|Win32
-		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Release.Build.0 = Release|Win32
-		{5E88B863-2CFC-4076-B6B5-6AAD2E75EF07}.Debug.ActiveCfg = Debug|Win32
-		{5E88B863-2CFC-4076-B6B5-6AAD2E75EF07}.Debug.Build.0 = Debug|Win32
-		{5E88B863-2CFC-4076-B6B5-6AAD2E75EF07}.Release.ActiveCfg = Release|Win32
-		{5E88B863-2CFC-4076-B6B5-6AAD2E75EF07}.Release.Build.0 = Release|Win32
-		{4CF0DECC-273D-438E-A073-8ADBE30F6F5C}.Debug.ActiveCfg = Debug|Win32
-		{4CF0DECC-273D-438E-A073-8ADBE30F6F5C}.Debug.Build.0 = Debug|Win32
-		{4CF0DECC-273D-438E-A073-8ADBE30F6F5C}.Release.ActiveCfg = Release|Win32
-		{4CF0DECC-273D-438E-A073-8ADBE30F6F5C}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
-		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
-		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-	EndGlobalSection
-	GlobalSection(ExtensibilityAddIns) = postSolution
-	EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIArithmetic_test", "source\TePDIArithmetic\TePDIArithmetic_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83} = {56D7AA1F-BA95-4B48-843A-D264BEFF4E83}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIBDFilter_test", "source\TePDIBDFilter\TePDIBDFilter_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIColorTransform_test", "source\TePDIColorTransform\TePDIColorTransform_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIContrast_test", "source\TePDIContrast\TePDIContrast_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIFilterMask_test", "source\TePDIFilterMask\TePDIFilterMask_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIHistogram_test", "source\TePDIHistogram\TePDIHistogram_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDILinearFilter_test", "source\TePDILinearFilter\TePDILinearFilter_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMatrix_test", "source\TePDIMatrix\TePDIMatrix_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMorfFilter_test", "source\TePDIMorfFilter\TePDIMorfFilter_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIParameters_test", "source\TePDIParameters\TePDIParameters_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIPrincipalComponents_test", "source\TePDIPrincipalComponents\TePDIPrincipalComponents_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIRadarFilters_test", "source\TePDIRadarFilters\TePDIRadarFilters_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83} = {56D7AA1F-BA95-4B48-843A-D264BEFF4E83}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIRaster2Vector_test", "source\TePDIRaster2Vector\TePDIRaster2Vector_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIRgbPalette_test", "source\TePDIRgbPalette\TePDIRgbPalette_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIStatistic_test", "source\TePDIStatistic\TePDIStatistic_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIUtils_test", "source\TePDIUtils\TePDIUtils_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMosaic_test", "source\TePDIMosaic\TePDIMosaic_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIFusion_test", "source\TePDIFusion\TePDIFusion_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMathFunctions_test", "source\TePDIMathFunctions\TePDIMathFunctions_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMatrixFunctions_test", "source\TePDIMatrixFunctions\TePDIMatrixFunctions_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIWavelets_test", "source\TePDIWavelets\TePDIWavelets_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDISegmentation_test", "source\TePDISegmentation\TePDISegmentation_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIInterpolator_test", "source\TePDIInterpolator\TePDIInterpolator_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIRegister_test", "source\TePDIRegister\TePDIRegister_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIHaralick_test", "source\TePDIHaralick\TePDIHaralick_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIClassification_test", "source\TePDIClassification\TePDIClassification_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMixModel_test", "source\TePDIMixModel\TePDIMixModel_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDISensorSimulator_test", "source\TePDISensorSimulator\TePDISensorSimulator_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIPIManager_test", "source\TePDIPIManager\TePDIPIManager_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIDecorrelationEnhancement_test", "source\TePDIDecorrelationEnhancement\TePDIDecorrelationEnhancement_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIOFMatching_test", "source\TePDIOFMatching\TePDIOFMatching_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDICorrelationMatching_test", "source\TePDICorrelationMatching\TePDICorrelationMatching_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMIMatching_test", "source\TePDIMIMatching\TePDIMIMatching_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIJointHistogram_test", "source\TePDIJointHistogram\TePDIJointHistogram_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIMMIOMatching_test", "source\TePDIMMIOMatching\TePDIMMIOMatching_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIParallelSegmenter_test", "source\TePDIParallelSegmenter\TePDIParallelSegmenter.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TePDIBlender_test", "source\TePDIBlender\TePDIBlender_test.vcproj", "{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\..\build\win32-msvc2003\libjpeg\libjpeg.vcproj", "{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapelib", "..\..\build\win32-msvc2003\shapelib\shapelib.vcproj", "{C4A3E074-08E5-4197-ABB7-06611BAC269D}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralib", "..\..\build\win32-msvc2003\terralib\terralib.vcproj", "{1253197A-5710-4924-9706-6449C0C32FE9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D} = {C4A3E074-08E5-4197-ABB7-06611BAC269D}
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+		{DD1ADACD-7990-4793-9952-25197394954A} = {DD1ADACD-7990-4793-9952-25197394954A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terralibpdi", "..\..\build\win32-msvc2003\terralibpdi\terralibpdi.vcproj", "{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1253197A-5710-4924-9706-6449C0C32FE9} = {1253197A-5710-4924-9706-6449C0C32FE9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\build\win32-msvc2003\tiff\tiff.vcproj", "{DD1ADACD-7990-4793-9952-25197394954A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C} = {BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.ActiveCfg = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Debug.Build.0 = Debug|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.ActiveCfg = Release|Win32
+		{D881CFAF-6E61-4842-8ACF-A33287EA5223}.Release.Build.0 = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.ActiveCfg = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Debug.Build.0 = Debug|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.ActiveCfg = Release|Win32
+		{BEDDDA8D-9821-4B3F-AD36-2B1AACE3572C}.Release.Build.0 = Release|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Debug.ActiveCfg = Debug|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Debug.Build.0 = Debug|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Release.ActiveCfg = Release|Win32
+		{C4A3E074-08E5-4197-ABB7-06611BAC269D}.Release.Build.0 = Release|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Debug.ActiveCfg = Debug|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Debug.Build.0 = Debug|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Release.ActiveCfg = Release|Win32
+		{1253197A-5710-4924-9706-6449C0C32FE9}.Release.Build.0 = Release|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Debug.ActiveCfg = Debug|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Debug.Build.0 = Debug|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Release.ActiveCfg = Release|Win32
+		{56D7AA1F-BA95-4B48-843A-D264BEFF4E83}.Release.Build.0 = Release|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Debug.ActiveCfg = Debug|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Debug.Build.0 = Debug|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Release.ActiveCfg = Release|Win32
+		{DD1ADACD-7990-4793-9952-25197394954A}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/image_processing/readme.txt b/examples/image_processing/readme.txt
old mode 100755
new mode 100644
diff --git a/examples/image_processing/resources/.cvsignore b/examples/image_processing/resources/.cvsignore
new file mode 100644
index 0000000..b61e42e
--- /dev/null
+++ b/examples/image_processing/resources/.cvsignore
@@ -0,0 +1 @@
+*.met
diff --git a/examples/image_processing/resources/b3spline.flr b/examples/image_processing/resources/b3spline.flr
new file mode 100644
index 0000000..06e2a9d
--- /dev/null
+++ b/examples/image_processing/resources/b3spline.flr
@@ -0,0 +1,6 @@
+5 5 256
+1 4 6 4 1
+4 16 24 16 4
+6 24 36 24 6
+4 16 24 16 4
+1 4 6 4 1
diff --git a/examples/image_processing/resources/cbers2b.srf b/examples/image_processing/resources/cbers2b.srf
new file mode 100644
index 0000000..1d35044
--- /dev/null
+++ b/examples/image_processing/resources/cbers2b.srf
@@ -0,0 +1,1994 @@
+1993 6 6
+379.835 0.000 0.000 0.000 0.000 0.000 0.000
+380.165 0.000 0.000 0.000 0.000 0.000 0.000
+380.495 0.000 0.000 0.000 0.000 0.000 0.000
+380.825 0.000 0.000 0.000 0.000 0.000 0.000
+381.155 0.000 0.000 0.000 0.000 0.000 0.000
+381.485 0.000 0.000 0.000 0.000 0.000 0.000
+381.815 0.000 0.000 0.000 0.000 0.000 0.000
+382.145 0.000 0.000 0.000 0.000 0.000 0.000
+382.475 0.000 0.000 0.000 0.000 0.000 0.000
+382.805 0.000 0.000 0.000 0.000 0.000 0.000
+383.135 0.000 0.000 0.000 0.000 0.000 0.000
+383.465 0.000 0.000 0.000 0.000 0.000 0.000
+383.795 0.000 0.000 0.000 0.000 0.000 0.000
+384.125 0.000 0.000 0.000 0.000 0.000 0.000
+384.455 0.000 0.000 0.000 0.000 0.000 0.000
+384.785 0.000 0.000 0.000 0.000 0.000 0.000
+385.115 0.000 0.000 0.000 0.000 0.000 0.000
+385.445 0.000 0.000 0.000 0.000 0.000 0.000
+385.775 0.000 0.000 0.000 0.000 0.000 0.000
+386.105 0.000 0.000 0.000 0.000 0.000 0.000
+386.435 0.000 0.000 0.000 0.000 0.000 0.000
+386.765 0.000 0.000 0.000 0.000 0.000 0.000
+387.095 0.000 0.000 0.000 0.000 0.000 0.000
+387.425 0.000 0.000 0.000 0.000 0.000 0.000
+387.755 0.000 0.000 0.000 0.000 0.000 0.000
+388.085 0.000 0.000 0.000 0.000 0.000 0.000
+388.415 0.000 0.000 0.000 0.000 0.000 0.000
+388.745 0.000 0.000 0.000 0.000 0.000 0.000
+389.075 0.000 0.000 0.000 0.000 0.000 0.000
+389.405 0.000 0.000 0.000 0.000 0.000 0.000
+389.735 0.000 0.000 0.000 0.000 0.000 0.000
+390.065 0.000 0.000 0.000 0.000 0.000 0.000
+390.395 0.000 0.000 0.000 0.000 0.000 0.000
+390.725 0.000 0.000 0.000 0.000 0.000 0.000
+391.055 0.000 0.000 0.000 0.000 0.000 0.000
+391.385 0.000 0.000 0.000 0.000 0.000 0.000
+391.715 0.000 0.000 0.000 0.000 0.000 0.000
+392.045 0.000 0.000 0.000 0.000 0.000 0.000
+392.375 0.000 0.000 0.000 0.000 0.000 0.000
+392.705 0.000 0.000 0.000 0.000 0.000 0.000
+393.035 0.000 0.000 0.000 0.000 0.000 0.000
+393.365 0.000 0.000 0.000 0.000 0.000 0.000
+393.695 0.000 0.000 0.000 0.000 0.000 0.000
+394.025 0.000 0.000 0.000 0.000 0.000 0.000
+394.355 0.000 0.000 0.000 0.000 0.000 0.000
+394.685 0.000 0.000 0.000 0.000 0.000 0.000
+395.015 0.000 0.000 0.000 0.000 0.000 0.000
+395.345 0.000 0.000 0.000 0.000 0.000 0.000
+395.675 0.000 0.000 0.000 0.000 0.000 0.000
+396.005 0.000 0.000 0.000 0.000 0.000 0.000
+396.335 0.000 0.000 0.000 0.000 0.000 0.000
+396.665 0.000 0.000 0.000 0.000 0.000 0.000
+396.995 0.000 0.000 0.000 0.000 0.000 0.000
+397.325 0.000 0.000 0.000 0.000 0.000 0.000
+397.655 0.000 0.000 0.000 0.000 0.000 0.000
+397.985 0.000 0.000 0.000 0.000 0.000 0.000
+398.315 0.000 0.000 0.000 0.000 0.000 0.000
+398.645 0.000 0.000 0.000 0.000 0.000 0.000
+398.975 0.000 0.000 0.000 0.000 0.000 0.000
+399.305 0.000 0.000 0.000 0.000 0.000 0.000
+399.635 0.000 0.000 0.000 0.000 0.000 0.000
+399.965 0.000 0.000 0.000 0.000 0.000 0.000
+400.295 0.000 0.000 0.000 0.000 0.000 0.000
+400.625 0.000 0.000 0.000 0.000 0.000 0.000
+400.955 0.000 0.000 0.000 0.000 0.000 0.000
+401.285 0.000 0.000 0.000 0.000 0.000 0.000
+401.615 0.000 0.000 0.000 0.000 0.000 0.000
+401.945 0.000 0.000 0.000 0.000 0.000 0.000
+402.275 0.000 0.000 0.000 0.000 0.000 0.000
+402.605 0.000 0.000 0.000 0.000 0.000 0.000
+402.935 0.000 0.000 0.000 0.000 0.000 0.000
+403.265 0.000 0.000 0.000 0.000 0.000 0.000
+403.595 0.000 0.000 0.000 0.000 0.000 0.000
+403.925 0.000 0.000 0.000 0.000 0.000 0.000
+404.255 0.000 0.000 0.000 0.000 0.000 0.000
+404.585 0.000 0.000 0.000 0.000 0.000 0.000
+404.915 0.000 0.000 0.000 0.000 0.000 0.000
+405.245 0.000 0.000 0.000 0.000 0.000 0.000
+405.575 0.000 0.000 0.000 0.000 0.000 0.000
+405.905 0.000 0.000 0.000 0.000 0.000 0.000
+406.235 0.000 0.000 0.000 0.000 0.000 0.000
+406.565 0.000 0.000 0.000 0.000 0.000 0.000
+406.895 0.000 0.000 0.000 0.000 0.000 0.000
+407.225 0.000 0.000 0.000 0.000 0.000 0.000
+407.555 0.000 0.000 0.000 0.000 0.000 0.000
+407.885 0.000 0.000 0.000 0.000 0.000 0.000
+408.215 0.000 0.000 0.000 0.000 0.000 0.000
+408.545 0.000 0.000 0.000 0.000 0.000 0.000
+408.875 0.000 0.000 0.000 0.000 0.000 0.000
+409.205 0.000 0.000 0.000 0.000 0.000 0.000
+409.535 0.000 0.000 0.000 0.000 0.000 0.000
+409.865 0.000 0.000 0.000 0.000 0.000 0.000
+410.195 0.000 0.000 0.000 0.000 0.000 0.000
+410.525 0.000 0.000 0.000 0.000 0.000 0.000
+410.855 0.000 0.000 0.000 0.000 0.000 0.000
+411.185 0.000 0.000 0.000 0.000 0.000 0.000
+411.515 0.000 0.000 0.000 0.000 0.000 0.000
+411.845 0.000 0.000 0.000 0.000 0.000 0.000
+412.175 0.000 0.000 0.000 0.000 0.000 0.000
+412.505 0.000 0.000 0.000 0.000 0.000 0.000
+412.835 0.000 0.000 0.000 0.000 0.000 0.000
+413.165 0.000 0.000 0.000 0.000 0.000 0.000
+413.495 0.000 0.000 0.000 0.000 0.000 0.000
+413.825 0.000 0.000 0.000 0.000 0.000 0.000
+414.155 0.000 0.000 0.000 0.000 0.000 0.000
+414.485 0.000 0.000 0.000 0.000 0.000 0.000
+414.815 0.000 0.000 0.000 0.000 0.000 0.000
+415.145 0.000 0.000 0.000 0.000 0.000 0.000
+415.475 0.000 0.000 0.000 0.000 0.000 0.000
+415.805 0.000 0.000 0.000 0.000 0.000 0.000
+416.135 0.000 0.000 0.000 0.000 0.000 0.000
+416.465 0.000 0.000 0.000 0.000 0.000 0.000
+416.795 0.000 0.000 0.000 0.000 0.000 0.000
+417.125 0.000 0.000 0.000 0.000 0.000 0.000
+417.455 0.000 0.000 0.000 0.000 0.000 0.000
+417.785 0.000 0.000 0.000 0.000 0.000 0.000
+418.115 0.000 0.000 0.000 0.000 0.000 0.000
+418.445 0.000 0.000 0.000 0.000 0.000 0.000
+418.775 0.000 0.000 0.000 0.000 0.000 0.000
+419.105 0.000 0.000 0.000 0.000 0.000 0.000
+419.435 0.000 0.000 0.000 0.000 0.000 0.000
+419.765 0.000 0.000 0.000 0.000 0.000 0.000
+420.095 0.000 0.000 0.000 0.000 0.000 0.000
+420.425 0.000 0.000 0.000 0.000 0.000 0.000
+420.755 0.000 0.000 0.000 0.000 0.000 0.000
+421.085 0.000 0.000 0.000 0.000 0.000 0.000
+421.415 0.000 0.000 0.000 0.000 0.000 0.000
+421.745 0.000 0.000 0.000 0.000 0.000 0.000
+422.075 0.000 0.000 0.000 0.000 0.000 0.000
+422.405 0.000 0.000 0.000 0.000 0.000 0.000
+422.735 0.000 0.000 0.000 0.000 0.000 0.000
+423.065 0.000 0.000 0.000 0.000 0.000 0.000
+423.395 0.000 0.000 0.000 0.000 0.000 0.000
+423.725 0.000 0.000 0.000 0.000 0.000 0.000
+424.055 0.000 0.000 0.000 0.000 0.000 0.000
+424.385 0.001 0.000 0.000 0.000 0.000 0.000
+424.715 0.001 0.000 0.000 0.000 0.000 0.000
+425.045 0.001 0.000 0.000 0.000 0.000 0.000
+425.375 0.001 0.000 0.000 0.000 0.000 0.000
+425.705 0.001 0.000 0.000 0.000 0.000 0.000
+426.035 0.001 0.000 0.000 0.000 0.000 0.000
+426.365 0.001 0.000 0.000 0.000 0.000 0.000
+426.695 0.002 0.000 0.000 0.000 0.000 0.000
+427.025 0.002 0.000 0.000 0.000 0.000 0.000
+427.355 0.002 0.000 0.000 0.000 0.000 0.000
+427.685 0.002 0.000 0.000 0.000 0.000 0.000
+428.015 0.002 0.000 0.000 0.000 0.000 0.000
+428.345 0.002 0.000 0.000 0.000 0.000 0.000
+428.675 0.002 0.000 0.000 0.000 0.000 0.000
+429.005 0.002 0.000 0.000 0.000 0.000 0.000
+429.335 0.003 0.000 0.000 0.000 0.000 0.000
+429.665 0.003 0.000 0.000 0.000 0.000 0.000
+429.995 0.003 0.000 0.000 0.000 0.000 0.000
+430.325 0.003 0.000 0.000 0.000 0.000 0.000
+430.655 0.003 0.000 0.000 0.000 0.000 0.000
+430.985 0.003 0.000 0.000 0.000 0.000 0.000
+431.315 0.003 0.000 0.000 0.000 0.000 0.000
+431.645 0.004 0.000 0.000 0.000 0.000 0.000
+431.975 0.004 0.000 0.000 0.000 0.000 0.000
+432.305 0.004 0.000 0.000 0.000 0.000 0.000
+432.635 0.004 0.000 0.000 0.000 0.000 0.000
+432.965 0.004 0.000 0.000 0.000 0.000 0.000
+433.295 0.005 0.000 0.000 0.000 0.000 0.000
+433.625 0.005 0.000 0.000 0.000 0.000 0.000
+433.955 0.005 0.000 0.000 0.000 0.000 0.000
+434.285 0.005 0.000 0.000 0.000 0.000 0.000
+434.615 0.005 0.000 0.000 0.000 0.000 0.000
+434.945 0.006 0.000 0.000 0.000 0.000 0.000
+435.275 0.006 0.000 0.000 0.000 0.000 0.000
+435.605 0.006 0.000 0.000 0.000 0.000 0.000
+435.935 0.006 0.000 0.000 0.000 0.000 0.000
+436.265 0.006 0.000 0.000 0.000 0.000 0.000
+436.595 0.007 0.000 0.000 0.000 0.000 0.000
+436.925 0.007 0.000 0.000 0.000 0.000 0.000
+437.255 0.007 0.000 0.000 0.000 0.000 0.000
+437.585 0.007 0.000 0.000 0.000 0.000 0.000
+437.915 0.007 0.000 0.000 0.000 0.000 0.000
+438.245 0.008 0.000 0.000 0.000 0.000 0.000
+438.575 0.008 0.000 0.000 0.000 0.000 0.000
+438.905 0.008 0.000 0.000 0.000 0.000 0.000
+439.235 0.009 0.000 0.000 0.000 0.000 0.000
+439.565 0.009 0.000 0.000 0.000 0.000 0.000
+439.895 0.009 0.000 0.000 0.000 0.000 0.000
+440.225 0.010 0.000 0.000 0.000 0.000 0.000
+440.555 0.010 0.000 0.000 0.000 0.000 0.000
+440.885 0.010 0.000 0.000 0.000 0.000 0.000
+441.215 0.011 0.000 0.000 0.000 0.000 0.000
+441.545 0.011 0.000 0.000 0.000 0.000 0.000
+441.875 0.011 0.000 0.000 0.000 0.000 0.000
+442.205 0.011 0.000 0.000 0.000 0.000 0.000
+442.535 0.012 0.000 0.000 0.000 0.000 0.000
+442.865 0.012 0.000 0.000 0.000 0.000 0.000
+443.195 0.013 0.000 0.000 0.000 0.000 0.000
+443.525 0.013 0.000 0.000 0.000 0.000 0.000
+443.855 0.014 0.000 0.000 0.000 0.000 0.000
+444.185 0.014 0.000 0.000 0.000 0.000 0.000
+444.515 0.014 0.000 0.000 0.000 0.000 0.000
+444.845 0.015 0.000 0.000 0.000 0.000 0.000
+445.175 0.015 0.000 0.000 0.000 0.000 0.000
+445.505 0.016 0.000 0.000 0.000 0.000 0.000
+445.835 0.016 0.000 0.000 0.000 0.000 0.000
+446.165 0.017 0.000 0.000 0.000 0.000 0.000
+446.495 0.017 0.000 0.000 0.000 0.000 0.000
+446.825 0.017 0.000 0.000 0.000 0.000 0.000
+447.155 0.018 0.000 0.000 0.000 0.000 0.000
+447.485 0.018 0.000 0.000 0.000 0.000 0.000
+447.815 0.019 0.000 0.000 0.000 0.000 0.000
+448.145 0.019 0.000 0.000 0.000 0.000 0.000
+448.475 0.020 0.000 0.000 0.000 0.000 0.000
+448.805 0.021 0.000 0.000 0.000 0.000 0.000
+449.135 0.023 0.000 0.000 0.000 0.000 0.000
+449.465 0.024 0.000 0.000 0.000 0.000 0.000
+449.795 0.025 0.000 0.000 0.000 0.000 0.000
+450.125 0.026 0.000 0.000 0.000 0.000 0.007
+450.455 0.030 0.000 0.000 0.000 0.000 0.007
+450.785 0.035 0.000 0.000 0.000 0.000 0.007
+451.115 0.040 0.000 0.000 0.000 0.000 0.007
+451.445 0.043 0.000 0.000 0.000 0.000 0.007
+451.775 0.045 0.000 0.000 0.000 0.000 0.007
+452.105 0.047 0.000 0.000 0.000 0.000 0.007
+452.435 0.049 0.000 0.000 0.000 0.000 0.007
+452.765 0.051 0.000 0.000 0.000 0.000 0.007
+453.095 0.053 0.000 0.000 0.000 0.000 0.007
+453.425 0.056 0.000 0.000 0.000 0.000 0.007
+453.755 0.060 0.000 0.000 0.000 0.000 0.007
+454.085 0.064 0.000 0.000 0.000 0.000 0.007
+454.415 0.068 0.000 0.000 0.000 0.000 0.007
+454.745 0.071 0.000 0.000 0.000 0.000 0.007
+455.075 0.075 0.000 0.000 0.000 0.000 0.004
+455.405 0.079 0.000 0.000 0.000 0.000 0.004
+455.735 0.083 0.000 0.000 0.000 0.000 0.004
+456.065 0.087 0.000 0.000 0.000 0.000 0.004
+456.395 0.091 0.000 0.000 0.000 0.000 0.004
+456.725 0.095 0.000 0.000 0.000 0.000 0.004
+457.055 0.099 0.000 0.000 0.000 0.000 0.004
+457.385 0.103 0.000 0.000 0.000 0.000 0.004
+457.715 0.107 0.000 0.000 0.000 0.000 0.004
+458.045 0.111 0.000 0.000 0.000 0.000 0.004
+458.375 0.115 0.000 0.000 0.000 0.000 0.004
+458.705 0.119 0.000 0.000 0.000 0.000 0.004
+459.035 0.123 0.000 0.000 0.000 0.000 0.004
+459.365 0.128 0.000 0.000 0.000 0.000 0.004
+459.695 0.137 0.000 0.000 0.000 0.000 0.004
+460.025 0.146 0.000 0.000 0.000 0.000 0.005
+460.355 0.155 0.000 0.000 0.000 0.000 0.005
+460.685 0.165 0.000 0.000 0.000 0.000 0.005
+461.015 0.176 0.000 0.000 0.000 0.000 0.005
+461.345 0.186 0.000 0.000 0.000 0.000 0.005
+461.675 0.196 0.000 0.000 0.000 0.000 0.005
+462.005 0.207 0.000 0.000 0.000 0.001 0.005
+462.335 0.217 0.000 0.000 0.000 0.001 0.005
+462.665 0.227 0.000 0.000 0.000 0.001 0.005
+462.995 0.237 0.000 0.000 0.000 0.002 0.005
+463.325 0.248 0.000 0.000 0.000 0.002 0.005
+463.655 0.258 0.000 0.000 0.000 0.003 0.005
+463.985 0.268 0.000 0.000 0.000 0.003 0.005
+464.315 0.279 0.000 0.000 0.000 0.003 0.005
+464.645 0.289 0.000 0.000 0.000 0.004 0.005
+464.975 0.299 0.000 0.000 0.000 0.004 0.005
+465.305 0.310 0.000 0.000 0.000 0.004 0.017
+465.635 0.319 0.000 0.000 0.000 0.005 0.017
+465.965 0.329 0.000 0.000 0.000 0.005 0.017
+466.295 0.339 0.000 0.000 0.000 0.005 0.017
+466.625 0.349 0.000 0.000 0.000 0.006 0.017
+466.955 0.358 0.000 0.000 0.000 0.006 0.017
+467.285 0.368 0.000 0.000 0.000 0.007 0.017
+467.615 0.378 0.000 0.000 0.000 0.007 0.017
+467.945 0.388 0.000 0.000 0.000 0.007 0.017
+468.275 0.397 0.000 0.000 0.000 0.008 0.017
+468.605 0.407 0.000 0.000 0.000 0.008 0.017
+468.935 0.417 0.000 0.000 0.000 0.007 0.017
+469.265 0.427 0.000 0.000 0.000 0.007 0.017
+469.595 0.434 0.000 0.000 0.000 0.007 0.017
+469.925 0.440 0.000 0.000 0.000 0.007 0.017
+470.255 0.446 0.000 0.000 0.000 0.007 0.072
+470.585 0.453 0.000 0.000 0.000 0.006 0.072
+470.915 0.459 0.000 0.000 0.000 0.006 0.072
+471.245 0.465 0.000 0.000 0.000 0.006 0.072
+471.575 0.471 0.000 0.000 0.000 0.006 0.072
+471.905 0.477 0.000 0.000 0.000 0.006 0.072
+472.235 0.483 0.000 0.000 0.000 0.006 0.072
+472.565 0.489 0.000 0.000 0.000 0.005 0.072
+472.895 0.494 0.000 0.000 0.000 0.005 0.072
+473.225 0.500 0.000 0.000 0.000 0.005 0.072
+473.555 0.506 0.000 0.000 0.000 0.005 0.072
+473.885 0.512 0.000 0.000 0.000 0.005 0.072
+474.215 0.518 0.000 0.000 0.000 0.004 0.072
+474.545 0.523 0.000 0.000 0.000 0.004 0.072
+474.875 0.529 0.000 0.000 0.000 0.004 0.072
+475.205 0.535 0.000 0.000 0.000 0.004 0.193
+475.535 0.541 0.000 0.000 0.000 0.004 0.193
+475.865 0.547 0.000 0.000 0.000 0.004 0.193
+476.195 0.552 0.000 0.000 0.000 0.004 0.193
+476.525 0.558 0.000 0.000 0.000 0.004 0.193
+476.855 0.564 0.000 0.000 0.000 0.004 0.193
+477.185 0.570 0.000 0.000 0.000 0.004 0.193
+477.515 0.576 0.000 0.000 0.000 0.004 0.193
+477.845 0.582 0.000 0.000 0.000 0.004 0.193
+478.175 0.588 0.000 0.000 0.000 0.004 0.193
+478.505 0.594 0.000 0.000 0.000 0.004 0.193
+478.835 0.600 0.000 0.000 0.000 0.004 0.193
+479.165 0.606 0.000 0.000 0.000 0.004 0.193
+479.495 0.612 0.000 0.000 0.000 0.004 0.193
+479.825 0.618 0.000 0.000 0.000 0.004 0.193
+480.155 0.624 0.000 0.000 0.000 0.004 0.324
+480.485 0.630 0.000 0.000 0.000 0.004 0.324
+480.815 0.637 0.000 0.000 0.000 0.004 0.324
+481.145 0.643 0.000 0.000 0.000 0.004 0.324
+481.475 0.650 0.000 0.000 0.000 0.004 0.324
+481.805 0.657 0.000 0.000 0.000 0.004 0.324
+482.135 0.663 0.000 0.000 0.000 0.004 0.324
+482.465 0.670 0.000 0.000 0.000 0.004 0.324
+482.795 0.676 0.000 0.000 0.000 0.004 0.324
+483.125 0.683 0.000 0.000 0.000 0.004 0.324
+483.455 0.690 0.000 0.000 0.000 0.004 0.324
+483.785 0.696 0.000 0.000 0.000 0.004 0.324
+484.115 0.703 0.000 0.000 0.000 0.004 0.324
+484.445 0.709 0.000 0.000 0.000 0.004 0.324
+484.775 0.714 0.000 0.000 0.000 0.004 0.324
+485.105 0.719 0.000 0.000 0.000 0.004 0.463
+485.435 0.723 0.000 0.000 0.000 0.004 0.463
+485.765 0.728 0.000 0.000 0.000 0.004 0.463
+486.095 0.733 0.000 0.000 0.000 0.004 0.463
+486.425 0.738 0.000 0.000 0.000 0.004 0.463
+486.755 0.742 0.000 0.000 0.000 0.004 0.463
+487.085 0.747 0.000 0.000 0.000 0.004 0.463
+487.415 0.752 0.000 0.000 0.000 0.004 0.463
+487.745 0.756 0.000 0.000 0.000 0.004 0.463
+488.075 0.761 0.000 0.000 0.000 0.004 0.463
+488.405 0.766 0.000 0.000 0.000 0.004 0.463
+488.735 0.768 0.000 0.000 0.000 0.004 0.463
+489.065 0.770 0.000 0.000 0.000 0.004 0.463
+489.395 0.772 0.000 0.000 0.000 0.004 0.463
+489.725 0.775 0.000 0.000 0.000 0.004 0.463
+490.055 0.777 0.000 0.000 0.000 0.004 0.593
+490.385 0.779 0.000 0.000 0.000 0.004 0.593
+490.715 0.781 0.000 0.000 0.000 0.004 0.593
+491.045 0.783 0.000 0.000 0.000 0.004 0.593
+491.375 0.785 0.000 0.000 0.000 0.004 0.593
+491.705 0.787 0.000 0.000 0.000 0.004 0.593
+492.035 0.789 0.000 0.000 0.000 0.005 0.593
+492.365 0.791 0.000 0.000 0.000 0.005 0.593
+492.695 0.793 0.000 0.000 0.000 0.005 0.593
+493.025 0.794 0.000 0.000 0.000 0.005 0.593
+493.355 0.796 0.000 0.000 0.000 0.005 0.593
+493.685 0.798 0.000 0.000 0.000 0.005 0.593
+494.015 0.800 0.000 0.000 0.000 0.005 0.593
+494.345 0.802 0.000 0.000 0.000 0.005 0.593
+494.675 0.804 0.000 0.000 0.000 0.005 0.593
+495.005 0.806 0.000 0.000 0.000 0.005 0.710
+495.335 0.808 0.000 0.000 0.000 0.005 0.710
+495.665 0.810 0.000 0.000 0.000 0.005 0.710
+495.995 0.812 0.000 0.000 0.000 0.005 0.710
+496.325 0.814 0.000 0.000 0.000 0.005 0.710
+496.655 0.816 0.000 0.000 0.000 0.005 0.710
+496.985 0.818 0.000 0.000 0.000 0.005 0.710
+497.315 0.820 0.000 0.000 0.000 0.005 0.710
+497.645 0.822 0.000 0.000 0.000 0.005 0.710
+497.975 0.824 0.000 0.000 0.000 0.005 0.710
+498.305 0.826 0.000 0.000 0.000 0.005 0.710
+498.635 0.828 0.000 0.000 0.000 0.006 0.710
+498.965 0.829 0.000 0.000 0.000 0.006 0.710
+499.295 0.830 0.000 0.000 0.000 0.006 0.710
+499.625 0.831 0.000 0.000 0.000 0.006 0.710
+499.955 0.832 0.000 0.000 0.000 0.006 0.710
+500.285 0.833 0.000 0.000 0.000 0.006 0.780
+500.615 0.834 0.000 0.000 0.000 0.006 0.780
+500.945 0.835 0.000 0.000 0.000 0.006 0.780
+501.275 0.836 0.000 0.000 0.000 0.006 0.780
+501.605 0.837 0.000 0.000 0.000 0.006 0.780
+501.935 0.838 0.000 0.000 0.000 0.006 0.780
+502.265 0.839 0.000 0.000 0.000 0.006 0.780
+502.595 0.840 0.000 0.000 0.000 0.006 0.780
+502.925 0.841 0.000 0.000 0.000 0.006 0.780
+503.255 0.842 0.000 0.000 0.000 0.006 0.780
+503.585 0.843 0.000 0.000 0.000 0.006 0.780
+503.915 0.844 0.000 0.000 0.000 0.006 0.780
+504.245 0.845 0.000 0.000 0.000 0.006 0.780
+504.575 0.846 0.008 0.000 0.000 0.006 0.780
+504.905 0.847 0.008 0.000 0.000 0.006 0.780
+505.235 0.848 0.009 0.000 0.000 0.007 0.806
+505.565 0.849 0.010 0.000 0.000 0.007 0.806
+505.895 0.850 0.010 0.000 0.000 0.007 0.806
+506.225 0.851 0.011 0.000 0.000 0.007 0.806
+506.555 0.852 0.012 0.000 0.000 0.007 0.806
+506.885 0.853 0.012 0.000 0.000 0.007 0.806
+507.215 0.854 0.013 0.000 0.000 0.007 0.806
+507.545 0.855 0.013 0.000 0.000 0.007 0.806
+507.875 0.856 0.014 0.000 0.000 0.007 0.806
+508.205 0.857 0.015 0.000 0.000 0.007 0.806
+508.535 0.858 0.015 0.000 0.000 0.007 0.806
+508.865 0.856 0.018 0.000 0.000 0.007 0.806
+509.195 0.854 0.020 0.000 0.000 0.007 0.806
+509.525 0.852 0.023 0.000 0.000 0.007 0.806
+509.855 0.849 0.026 0.000 0.000 0.007 0.806
+510.185 0.847 0.029 0.000 0.000 0.007 0.825
+510.515 0.845 0.032 0.000 0.000 0.007 0.825
+510.845 0.843 0.035 0.000 0.000 0.007 0.825
+511.175 0.840 0.038 0.000 0.000 0.007 0.825
+511.505 0.838 0.041 0.000 0.000 0.007 0.825
+511.835 0.836 0.044 0.000 0.000 0.008 0.825
+512.165 0.833 0.047 0.000 0.000 0.008 0.825
+512.495 0.831 0.050 0.000 0.000 0.008 0.825
+512.825 0.829 0.054 0.000 0.000 0.008 0.825
+513.155 0.827 0.057 0.000 0.000 0.008 0.825
+513.485 0.824 0.060 0.000 0.000 0.009 0.825
+513.815 0.822 0.063 0.000 0.000 0.009 0.825
+514.145 0.819 0.066 0.000 0.000 0.010 0.825
+514.475 0.817 0.069 0.000 0.000 0.010 0.825
+514.805 0.814 0.072 0.000 0.000 0.011 0.825
+515.135 0.812 0.075 0.000 0.000 0.011 0.856
+515.465 0.809 0.078 0.000 0.000 0.011 0.856
+515.795 0.807 0.081 0.000 0.000 0.012 0.856
+516.125 0.804 0.084 0.000 0.000 0.012 0.856
+516.455 0.802 0.087 0.000 0.000 0.013 0.856
+516.785 0.799 0.090 0.000 0.000 0.013 0.856
+517.115 0.797 0.094 0.000 0.000 0.013 0.856
+517.445 0.794 0.097 0.000 0.000 0.014 0.856
+517.775 0.792 0.100 0.000 0.000 0.014 0.856
+518.105 0.789 0.103 0.000 0.000 0.015 0.856
+518.435 0.787 0.106 0.000 0.000 0.015 0.856
+518.765 0.781 0.112 0.000 0.000 0.017 0.856
+519.095 0.773 0.122 0.000 0.000 0.021 0.856
+519.425 0.764 0.131 0.000 0.000 0.025 0.856
+519.755 0.756 0.141 0.000 0.000 0.029 0.856
+520.085 0.748 0.150 0.000 0.000 0.032 0.899
+520.415 0.739 0.160 0.000 0.000 0.036 0.899
+520.745 0.731 0.169 0.000 0.000 0.040 0.899
+521.075 0.722 0.179 0.000 0.000 0.044 0.899
+521.405 0.714 0.188 0.000 0.000 0.047 0.899
+521.735 0.705 0.198 0.000 0.000 0.051 0.899
+522.065 0.697 0.208 0.000 0.000 0.055 0.899
+522.395 0.688 0.217 0.000 0.000 0.059 0.899
+522.725 0.679 0.227 0.000 0.000 0.063 0.899
+523.055 0.670 0.236 0.000 0.000 0.066 0.899
+523.385 0.661 0.246 0.000 0.000 0.070 0.899
+523.715 0.653 0.255 0.000 0.000 0.074 0.899
+524.045 0.644 0.265 0.000 0.000 0.078 0.899
+524.375 0.635 0.274 0.000 0.000 0.083 0.899
+524.705 0.625 0.284 0.000 0.000 0.087 0.899
+525.035 0.612 0.293 0.000 0.000 0.091 0.943
+525.365 0.599 0.303 0.000 0.000 0.095 0.943
+525.695 0.586 0.313 0.000 0.000 0.100 0.943
+526.025 0.572 0.323 0.000 0.000 0.104 0.943
+526.355 0.559 0.333 0.000 0.000 0.108 0.943
+526.685 0.547 0.344 0.000 0.000 0.113 0.943
+527.015 0.540 0.354 0.000 0.000 0.117 0.943
+527.345 0.534 0.365 0.000 0.000 0.121 0.943
+527.675 0.527 0.375 0.000 0.000 0.125 0.943
+528.005 0.520 0.386 0.000 0.000 0.130 0.943
+528.335 0.514 0.396 0.000 0.000 0.134 0.943
+528.665 0.507 0.407 0.000 0.000 0.138 0.943
+528.995 0.501 0.419 0.000 0.000 0.143 0.943
+529.325 0.494 0.431 0.000 0.000 0.148 0.943
+529.655 0.487 0.443 0.000 0.000 0.154 0.943
+529.985 0.481 0.456 0.000 0.000 0.166 0.943
+530.315 0.474 0.468 0.000 0.000 0.179 0.965
+530.645 0.468 0.480 0.000 0.000 0.191 0.965
+530.975 0.442 0.492 0.000 0.000 0.204 0.965
+531.305 0.415 0.504 0.000 0.000 0.216 0.965
+531.635 0.389 0.516 0.000 0.000 0.229 0.965
+531.965 0.379 0.529 0.000 0.000 0.242 0.965
+532.295 0.371 0.541 0.000 0.000 0.255 0.965
+532.625 0.362 0.553 0.000 0.000 0.269 0.965
+532.955 0.354 0.565 0.000 0.000 0.282 0.965
+533.285 0.346 0.577 0.000 0.000 0.295 0.965
+533.615 0.337 0.589 0.000 0.000 0.308 0.965
+533.945 0.329 0.602 0.000 0.000 0.318 0.965
+534.275 0.321 0.614 0.000 0.000 0.328 0.965
+534.605 0.312 0.626 0.000 0.000 0.338 0.965
+534.935 0.300 0.639 0.000 0.000 0.347 0.965
+535.265 0.287 0.652 0.000 0.000 0.357 0.980
+535.595 0.274 0.664 0.000 0.000 0.367 0.980
+535.925 0.261 0.677 0.000 0.000 0.376 0.980
+536.255 0.249 0.690 0.000 0.000 0.386 0.980
+536.585 0.236 0.703 0.000 0.000 0.396 0.980
+536.915 0.223 0.716 0.000 0.000 0.414 0.980
+537.245 0.210 0.729 0.000 0.000 0.437 0.980
+537.575 0.197 0.742 0.000 0.000 0.460 0.980
+537.905 0.184 0.755 0.000 0.000 0.472 0.980
+538.235 0.171 0.768 0.000 0.000 0.478 0.980
+538.565 0.158 0.781 0.000 0.000 0.484 0.980
+538.895 0.151 0.790 0.000 0.000 0.490 0.980
+539.225 0.146 0.798 0.000 0.000 0.497 0.980
+539.555 0.141 0.805 0.000 0.000 0.503 0.980
+539.885 0.137 0.812 0.000 0.000 0.508 0.980
+540.215 0.132 0.818 0.000 0.000 0.512 0.987
+540.545 0.128 0.825 0.000 0.000 0.515 0.987
+540.875 0.123 0.831 0.000 0.000 0.519 0.987
+541.205 0.119 0.837 0.000 0.000 0.523 0.987
+541.535 0.114 0.844 0.000 0.000 0.527 0.987
+541.865 0.110 0.850 0.000 0.000 0.531 0.987
+542.195 0.105 0.856 0.000 0.000 0.534 0.987
+542.525 0.101 0.862 0.000 0.000 0.538 0.987
+542.855 0.096 0.869 0.000 0.000 0.542 0.987
+543.185 0.092 0.875 0.000 0.000 0.544 0.987
+543.515 0.087 0.881 0.000 0.000 0.547 0.987
+543.845 0.083 0.888 0.000 0.000 0.550 0.987
+544.175 0.079 0.894 0.000 0.000 0.553 0.987
+544.505 0.075 0.900 0.000 0.000 0.556 0.987
+544.835 0.071 0.906 0.000 0.000 0.559 0.987
+545.165 0.067 0.913 0.000 0.000 0.562 0.987
+545.495 0.063 0.919 0.000 0.000 0.565 0.985
+545.825 0.059 0.925 0.000 0.000 0.568 0.985
+546.155 0.055 0.932 0.000 0.000 0.571 0.985
+546.485 0.051 0.938 0.000 0.000 0.574 0.985
+546.815 0.047 0.944 0.000 0.000 0.577 0.985
+547.145 0.042 0.950 0.000 0.000 0.580 0.985
+547.475 0.038 0.955 0.000 0.000 0.583 0.985
+547.805 0.034 0.961 0.000 0.000 0.586 0.985
+548.135 0.030 0.967 0.000 0.000 0.589 0.985
+548.465 0.026 0.972 0.000 0.000 0.591 0.985
+548.795 0.023 0.977 0.000 0.000 0.595 0.985
+549.125 0.023 0.978 0.000 0.000 0.598 0.985
+549.455 0.023 0.979 0.000 0.000 0.602 0.985
+549.785 0.022 0.980 0.000 0.000 0.606 0.985
+550.115 0.022 0.981 0.000 0.000 0.610 0.979
+550.445 0.022 0.981 0.000 0.000 0.613 0.979
+550.775 0.022 0.982 0.000 0.000 0.617 0.979
+551.105 0.022 0.983 0.000 0.000 0.621 0.979
+551.435 0.022 0.984 0.000 0.000 0.625 0.979
+551.765 0.021 0.985 0.000 0.000 0.628 0.979
+552.095 0.021 0.985 0.000 0.000 0.632 0.979
+552.425 0.021 0.985 0.000 0.000 0.636 0.979
+552.755 0.021 0.986 0.000 0.000 0.639 0.979
+553.085 0.021 0.986 0.000 0.000 0.643 0.979
+553.415 0.020 0.987 0.000 0.000 0.646 0.979
+553.745 0.020 0.987 0.000 0.000 0.650 0.979
+554.075 0.020 0.987 0.000 0.000 0.654 0.979
+554.405 0.020 0.988 0.000 0.000 0.657 0.979
+554.735 0.020 0.988 0.000 0.000 0.661 0.979
+555.065 0.020 0.988 0.000 0.000 0.664 0.964
+555.395 0.019 0.989 0.000 0.000 0.668 0.964
+555.725 0.019 0.989 0.000 0.000 0.672 0.964
+556.055 0.018 0.989 0.000 0.000 0.675 0.964
+556.385 0.018 0.990 0.000 0.000 0.679 0.964
+556.715 0.017 0.990 0.000 0.000 0.682 0.964
+557.045 0.016 0.991 0.000 0.000 0.686 0.964
+557.375 0.015 0.991 0.000 0.000 0.690 0.964
+557.705 0.014 0.991 0.000 0.000 0.693 0.964
+558.035 0.013 0.992 0.000 0.000 0.697 0.964
+558.365 0.013 0.992 0.000 0.000 0.700 0.964
+558.695 0.012 0.992 0.000 0.000 0.704 0.964
+559.025 0.012 0.993 0.000 0.000 0.706 0.964
+559.355 0.013 0.993 0.000 0.000 0.706 0.964
+559.685 0.013 0.993 0.000 0.000 0.707 0.964
+560.015 0.014 0.993 0.000 0.000 0.708 0.959
+560.345 0.014 0.994 0.000 0.000 0.709 0.959
+560.675 0.015 0.994 0.000 0.000 0.709 0.959
+561.005 0.016 0.994 0.000 0.000 0.710 0.959
+561.335 0.016 0.994 0.000 0.000 0.711 0.959
+561.665 0.017 0.995 0.000 0.000 0.712 0.959
+561.995 0.018 0.995 0.000 0.000 0.712 0.959
+562.325 0.018 0.995 0.000 0.000 0.713 0.959
+562.655 0.019 0.995 0.000 0.000 0.714 0.959
+562.985 0.019 0.996 0.000 0.000 0.715 0.959
+563.315 0.019 0.996 0.000 0.000 0.715 0.959
+563.645 0.019 0.996 0.000 0.000 0.716 0.959
+563.975 0.018 0.996 0.000 0.000 0.717 0.959
+564.305 0.018 0.997 0.000 0.000 0.719 0.959
+564.635 0.018 0.997 0.000 0.000 0.720 0.959
+564.965 0.018 0.997 0.000 0.000 0.722 0.959
+565.295 0.017 0.997 0.000 0.000 0.723 0.953
+565.625 0.017 0.998 0.000 0.000 0.725 0.953
+565.955 0.017 0.998 0.000 0.000 0.726 0.953
+566.285 0.017 0.998 0.000 0.000 0.728 0.953
+566.615 0.016 0.998 0.000 0.000 0.729 0.953
+566.945 0.016 0.999 0.000 0.000 0.731 0.953
+567.275 0.016 0.999 0.000 0.000 0.732 0.953
+567.605 0.016 0.999 0.000 0.000 0.734 0.953
+567.935 0.016 0.999 0.000 0.000 0.735 0.953
+568.265 0.019 1.000 0.000 0.000 0.737 0.953
+568.595 0.021 1.000 0.000 0.000 0.738 0.953
+568.925 0.023 1.000 0.000 0.000 0.739 0.953
+569.255 0.022 1.000 0.000 0.000 0.738 0.953
+569.585 0.022 0.999 0.000 0.000 0.736 0.953
+569.915 0.021 0.999 0.000 0.000 0.735 0.953
+570.245 0.021 0.998 0.000 0.000 0.733 0.956
+570.575 0.020 0.998 0.000 0.000 0.732 0.956
+570.905 0.020 0.997 0.000 0.000 0.730 0.956
+571.235 0.019 0.997 0.000 0.000 0.729 0.956
+571.565 0.019 0.997 0.000 0.000 0.727 0.956
+571.895 0.018 0.996 0.000 0.000 0.726 0.956
+572.225 0.018 0.996 0.000 0.000 0.724 0.956
+572.555 0.017 0.995 0.000 0.000 0.723 0.956
+572.885 0.017 0.995 0.000 0.000 0.721 0.956
+573.215 0.016 0.995 0.000 0.000 0.720 0.956
+573.545 0.016 0.994 0.000 0.000 0.718 0.956
+573.875 0.015 0.994 0.000 0.000 0.717 0.956
+574.205 0.015 0.993 0.000 0.000 0.715 0.956
+574.535 0.015 0.993 0.000 0.000 0.713 0.956
+574.865 0.015 0.992 0.000 0.000 0.712 0.956
+575.195 0.015 0.991 0.000 0.000 0.710 0.963
+575.525 0.014 0.990 0.000 0.000 0.709 0.963
+575.855 0.014 0.989 0.000 0.000 0.707 0.963
+576.185 0.014 0.988 0.000 0.000 0.706 0.963
+576.515 0.014 0.987 0.000 0.000 0.704 0.963
+576.845 0.014 0.986 0.000 0.000 0.703 0.963
+577.175 0.014 0.985 0.000 0.000 0.701 0.963
+577.505 0.013 0.984 0.000 0.000 0.700 0.963
+577.835 0.013 0.983 0.000 0.000 0.698 0.963
+578.165 0.013 0.982 0.000 0.000 0.697 0.963
+578.495 0.013 0.981 0.000 0.000 0.695 0.963
+578.825 0.013 0.980 0.000 0.000 0.694 0.963
+579.155 0.012 0.979 0.000 0.000 0.692 0.963
+579.485 0.012 0.978 0.000 0.000 0.691 0.963
+579.815 0.012 0.977 0.000 0.000 0.689 0.963
+580.145 0.012 0.975 0.000 0.000 0.687 0.967
+580.475 0.012 0.973 0.000 0.000 0.686 0.967
+580.805 0.012 0.970 0.000 0.000 0.684 0.967
+581.135 0.011 0.968 0.000 0.000 0.682 0.967
+581.465 0.011 0.966 0.000 0.000 0.681 0.967
+581.795 0.011 0.964 0.000 0.000 0.679 0.967
+582.125 0.011 0.962 0.000 0.000 0.678 0.967
+582.455 0.011 0.961 0.000 0.000 0.676 0.967
+582.785 0.011 0.959 0.000 0.000 0.674 0.967
+583.115 0.010 0.957 0.000 0.000 0.673 0.967
+583.445 0.010 0.955 0.000 0.000 0.671 0.967
+583.775 0.010 0.954 0.000 0.000 0.669 0.967
+584.105 0.010 0.952 0.000 0.000 0.668 0.967
+584.435 0.010 0.950 0.000 0.000 0.666 0.967
+584.765 0.010 0.949 0.000 0.000 0.664 0.967
+585.095 0.009 0.947 0.000 0.000 0.663 0.968
+585.425 0.009 0.945 0.000 0.000 0.661 0.968
+585.755 0.009 0.944 0.000 0.000 0.660 0.968
+586.085 0.009 0.942 0.000 0.000 0.658 0.968
+586.415 0.009 0.940 0.000 0.000 0.656 0.968
+586.745 0.009 0.938 0.000 0.000 0.655 0.968
+587.075 0.009 0.936 0.000 0.000 0.653 0.968
+587.405 0.008 0.934 0.000 0.000 0.651 0.968
+587.735 0.008 0.932 0.000 0.000 0.650 0.968
+588.065 0.008 0.930 0.000 0.000 0.648 0.968
+588.395 0.008 0.929 0.000 0.000 0.646 0.968
+588.725 0.008 0.927 0.000 0.000 0.645 0.968
+589.055 0.008 0.925 0.000 0.000 0.643 0.968
+589.385 0.007 0.923 0.000 0.000 0.642 0.968
+589.715 0.007 0.921 0.000 0.000 0.641 0.968
+590.045 0.007 0.918 0.000 0.000 0.640 0.965
+590.375 0.007 0.912 0.000 0.000 0.640 0.965
+590.705 0.007 0.905 0.000 0.000 0.641 0.965
+591.035 0.007 0.899 0.000 0.000 0.641 0.965
+591.365 0.007 0.893 0.000 0.000 0.641 0.965
+591.695 0.006 0.886 0.000 0.000 0.642 0.965
+592.025 0.006 0.880 0.000 0.000 0.642 0.965
+592.355 0.006 0.874 0.000 0.000 0.642 0.965
+592.685 0.006 0.867 0.000 0.000 0.643 0.965
+593.015 0.006 0.861 0.000 0.000 0.643 0.965
+593.345 0.006 0.855 0.000 0.000 0.643 0.965
+593.675 0.005 0.849 0.000 0.000 0.643 0.965
+594.005 0.005 0.842 0.000 0.000 0.644 0.965
+594.335 0.005 0.836 0.000 0.000 0.644 0.965
+594.665 0.005 0.830 0.000 0.000 0.644 0.965
+594.995 0.005 0.823 0.000 0.000 0.645 0.965
+595.325 0.005 0.817 0.000 0.000 0.645 0.962
+595.655 0.004 0.811 0.000 0.000 0.645 0.962
+595.985 0.004 0.805 0.000 0.000 0.645 0.962
+596.315 0.004 0.798 0.000 0.000 0.646 0.962
+596.645 0.004 0.792 0.000 0.000 0.646 0.962
+596.975 0.004 0.786 0.000 0.000 0.646 0.962
+597.305 0.004 0.778 0.000 0.000 0.646 0.962
+597.635 0.004 0.770 0.000 0.000 0.647 0.962
+597.965 0.004 0.762 0.000 0.000 0.647 0.962
+598.295 0.004 0.754 0.000 0.000 0.647 0.962
+598.625 0.004 0.746 0.000 0.000 0.647 0.962
+598.955 0.004 0.738 0.000 0.000 0.648 0.962
+599.285 0.004 0.730 0.000 0.000 0.650 0.962
+599.615 0.004 0.722 0.000 0.000 0.652 0.962
+599.945 0.004 0.714 0.000 0.000 0.654 0.962
+600.275 0.004 0.705 0.000 0.000 0.657 0.968
+600.605 0.004 0.696 0.000 0.000 0.659 0.968
+600.935 0.004 0.687 0.000 0.000 0.661 0.968
+601.265 0.004 0.677 0.000 0.000 0.663 0.968
+601.595 0.004 0.668 0.000 0.000 0.666 0.968
+601.925 0.004 0.659 0.000 0.000 0.668 0.968
+602.255 0.004 0.650 0.000 0.000 0.670 0.968
+602.585 0.004 0.640 0.000 0.000 0.673 0.968
+602.915 0.004 0.631 0.000 0.000 0.675 0.968
+603.245 0.004 0.623 0.000 0.000 0.677 0.968
+603.575 0.004 0.614 0.000 0.000 0.680 0.968
+603.905 0.004 0.606 0.001 0.000 0.682 0.968
+604.235 0.004 0.597 0.001 0.000 0.684 0.968
+604.565 0.004 0.589 0.001 0.000 0.687 0.968
+604.895 0.004 0.581 0.002 0.000 0.689 0.968
+605.225 0.004 0.572 0.002 0.000 0.691 0.982
+605.555 0.004 0.564 0.002 0.000 0.694 0.982
+605.885 0.004 0.555 0.002 0.000 0.697 0.982
+606.215 0.000 0.544 0.003 0.000 0.700 0.982
+606.545 0.000 0.530 0.003 0.000 0.702 0.982
+606.875 0.000 0.516 0.003 0.000 0.705 0.982
+607.205 0.000 0.503 0.004 0.000 0.708 0.982
+607.535 0.000 0.489 0.004 0.000 0.711 0.982
+607.865 0.000 0.475 0.004 0.000 0.714 0.982
+608.195 0.000 0.464 0.004 0.000 0.716 0.982
+608.525 0.000 0.455 0.005 0.000 0.719 0.982
+608.855 0.000 0.447 0.005 0.000 0.722 0.982
+609.185 0.000 0.438 0.005 0.000 0.725 0.982
+609.515 0.000 0.430 0.006 0.000 0.727 0.982
+609.845 0.000 0.422 0.006 0.000 0.730 0.982
+610.175 0.000 0.413 0.006 0.000 0.733 0.992
+610.505 0.000 0.405 0.006 0.000 0.734 0.992
+610.835 0.000 0.396 0.007 0.000 0.736 0.992
+611.165 0.000 0.388 0.007 0.000 0.738 0.992
+611.495 0.000 0.379 0.007 0.000 0.740 0.992
+611.825 0.000 0.370 0.007 0.000 0.741 0.992
+612.155 0.000 0.361 0.008 0.000 0.743 0.992
+612.485 0.000 0.353 0.009 0.000 0.745 0.992
+612.815 0.000 0.344 0.009 0.000 0.747 0.992
+613.145 0.000 0.335 0.010 0.000 0.748 0.992
+613.475 0.000 0.326 0.011 0.000 0.750 0.992
+613.805 0.000 0.317 0.011 0.000 0.752 0.992
+614.135 0.000 0.309 0.012 0.000 0.754 0.992
+614.465 0.000 0.302 0.013 0.000 0.755 0.992
+614.795 0.000 0.294 0.014 0.000 0.757 0.992
+615.125 0.000 0.287 0.014 0.000 0.759 0.997
+615.455 0.000 0.280 0.015 0.000 0.762 0.997
+615.785 0.000 0.272 0.016 0.000 0.764 0.997
+616.115 0.000 0.265 0.017 0.000 0.767 0.997
+616.445 0.000 0.258 0.017 0.000 0.769 0.997
+616.775 0.000 0.250 0.018 0.000 0.772 0.997
+617.105 0.000 0.243 0.019 0.000 0.774 0.997
+617.435 0.000 0.236 0.019 0.000 0.777 0.997
+617.765 0.000 0.228 0.020 0.000 0.779 0.997
+618.095 0.000 0.221 0.021 0.000 0.782 0.997
+618.425 0.000 0.214 0.022 0.000 0.784 0.997
+618.755 0.000 0.206 0.022 0.000 0.787 0.997
+619.085 0.000 0.199 0.023 0.000 0.789 0.997
+619.415 0.000 0.192 0.028 0.000 0.789 0.997
+619.745 0.000 0.184 0.033 0.000 0.788 0.997
+620.075 0.000 0.177 0.038 0.000 0.787 1.000
+620.405 0.000 0.173 0.044 0.000 0.786 1.000
+620.735 0.000 0.169 0.049 0.000 0.786 1.000
+621.065 0.000 0.165 0.055 0.000 0.785 1.000
+621.395 0.000 0.161 0.061 0.000 0.784 1.000
+621.725 0.000 0.158 0.066 0.000 0.783 1.000
+622.055 0.000 0.154 0.072 0.000 0.783 1.000
+622.385 0.000 0.150 0.078 0.000 0.782 1.000
+622.715 0.000 0.147 0.085 0.000 0.781 1.000
+623.045 0.000 0.143 0.092 0.000 0.780 1.000
+623.375 0.000 0.140 0.098 0.000 0.780 1.000
+623.705 0.000 0.136 0.105 0.000 0.779 1.000
+624.035 0.000 0.132 0.111 0.000 0.778 1.000
+624.365 0.000 0.129 0.118 0.000 0.777 1.000
+624.695 0.000 0.125 0.125 0.000 0.777 1.000
+625.025 0.000 0.122 0.131 0.000 0.776 0.996
+625.355 0.000 0.118 0.138 0.000 0.775 0.996
+625.685 0.000 0.115 0.144 0.000 0.774 0.996
+626.015 0.000 0.111 0.151 0.000 0.774 0.996
+626.345 0.000 0.108 0.157 0.000 0.773 0.996
+626.675 0.000 0.104 0.162 0.000 0.772 0.996
+627.005 0.000 0.100 0.167 0.000 0.771 0.996
+627.335 0.000 0.097 0.172 0.000 0.771 0.996
+627.665 0.000 0.093 0.177 0.000 0.770 0.996
+627.995 0.000 0.090 0.182 0.000 0.769 0.996
+628.325 0.000 0.087 0.189 0.000 0.768 0.996
+628.655 0.000 0.084 0.198 0.000 0.767 0.996
+628.985 0.000 0.082 0.206 0.000 0.767 0.996
+629.315 0.000 0.080 0.219 0.000 0.767 0.996
+629.645 0.000 0.078 0.235 0.000 0.767 0.996
+629.975 0.000 0.077 0.252 0.000 0.768 0.996
+630.305 0.000 0.076 0.268 0.000 0.769 0.987
+630.635 0.000 0.074 0.285 0.000 0.769 0.987
+630.965 0.000 0.073 0.301 0.000 0.770 0.987
+631.295 0.000 0.072 0.316 0.000 0.770 0.987
+631.625 0.000 0.070 0.330 0.000 0.771 0.987
+631.955 0.000 0.069 0.344 0.000 0.772 0.987
+632.285 0.000 0.068 0.358 0.000 0.772 0.987
+632.615 0.000 0.066 0.372 0.000 0.773 0.987
+632.945 0.000 0.065 0.385 0.000 0.774 0.987
+633.275 0.000 0.064 0.403 0.000 0.774 0.987
+633.605 0.000 0.062 0.426 0.000 0.775 0.987
+633.935 0.000 0.061 0.450 0.000 0.775 0.987
+634.265 0.000 0.059 0.475 0.000 0.776 0.987
+634.595 0.000 0.058 0.500 0.000 0.776 0.987
+634.925 0.000 0.057 0.525 0.000 0.777 0.987
+635.255 0.000 0.055 0.547 0.000 0.777 0.976
+635.585 0.000 0.054 0.561 0.000 0.778 0.976
+635.915 0.000 0.053 0.575 0.000 0.778 0.976
+636.245 0.000 0.051 0.589 0.000 0.779 0.976
+636.575 0.000 0.050 0.603 0.000 0.779 0.976
+636.905 0.000 0.049 0.617 0.000 0.780 0.976
+637.235 0.000 0.047 0.631 0.000 0.780 0.976
+637.565 0.000 0.046 0.652 0.000 0.781 0.976
+637.895 0.000 0.045 0.672 0.000 0.781 0.976
+638.225 0.000 0.043 0.691 0.000 0.782 0.976
+638.555 0.000 0.042 0.699 0.000 0.782 0.976
+638.885 0.000 0.040 0.708 0.000 0.783 0.976
+639.215 0.000 0.039 0.717 0.000 0.783 0.976
+639.545 0.000 0.038 0.726 0.000 0.783 0.976
+639.875 0.000 0.036 0.735 0.000 0.784 0.976
+640.205 0.000 0.035 0.743 0.000 0.784 0.961
+640.535 0.000 0.034 0.750 0.000 0.785 0.961
+640.865 0.000 0.032 0.756 0.000 0.785 0.961
+641.195 0.000 0.031 0.762 0.000 0.786 0.961
+641.525 0.000 0.030 0.766 0.000 0.787 0.961
+641.855 0.000 0.028 0.770 0.000 0.789 0.961
+642.185 0.000 0.027 0.774 0.000 0.790 0.961
+642.515 0.000 0.026 0.778 0.000 0.792 0.961
+642.845 0.000 0.026 0.781 0.000 0.793 0.961
+643.175 0.000 0.025 0.785 0.000 0.795 0.961
+643.505 0.000 0.025 0.788 0.000 0.796 0.961
+643.835 0.000 0.024 0.791 0.000 0.798 0.961
+644.165 0.000 0.024 0.794 0.000 0.800 0.961
+644.495 0.000 0.023 0.796 0.000 0.801 0.961
+644.825 0.000 0.023 0.799 0.000 0.803 0.961
+645.155 0.000 0.022 0.802 0.000 0.804 0.943
+645.485 0.000 0.021 0.805 0.000 0.806 0.943
+645.815 0.000 0.021 0.808 0.000 0.809 0.943
+646.145 0.000 0.020 0.811 0.000 0.811 0.943
+646.475 0.000 0.020 0.813 0.000 0.813 0.943
+646.805 0.000 0.019 0.816 0.000 0.815 0.943
+647.135 0.000 0.019 0.819 0.000 0.817 0.943
+647.465 0.000 0.018 0.823 0.000 0.820 0.943
+647.795 0.000 0.018 0.827 0.000 0.822 0.943
+648.125 0.000 0.017 0.831 0.000 0.824 0.943
+648.455 0.000 0.017 0.836 0.000 0.826 0.943
+648.785 0.000 0.016 0.840 0.000 0.828 0.943
+649.115 0.000 0.016 0.844 0.000 0.831 0.943
+649.445 0.000 0.015 0.848 0.000 0.831 0.943
+649.775 0.000 0.015 0.852 0.000 0.830 0.943
+650.105 0.000 0.015 0.856 0.000 0.829 0.932
+650.435 0.000 0.014 0.859 0.000 0.828 0.932
+650.765 0.000 0.014 0.859 0.000 0.827 0.932
+651.095 0.000 0.014 0.860 0.000 0.826 0.932
+651.425 0.000 0.014 0.861 0.000 0.825 0.932
+651.755 0.000 0.013 0.862 0.000 0.824 0.932
+652.085 0.000 0.013 0.862 0.000 0.822 0.932
+652.415 0.000 0.013 0.863 0.000 0.821 0.932
+652.745 0.000 0.013 0.864 0.000 0.820 0.932
+653.075 0.000 0.012 0.864 0.000 0.819 0.932
+653.405 0.000 0.012 0.865 0.000 0.818 0.932
+653.735 0.000 0.012 0.866 0.000 0.817 0.932
+654.065 0.000 0.012 0.866 0.000 0.816 0.932
+654.395 0.000 0.011 0.867 0.000 0.815 0.932
+654.725 0.000 0.011 0.868 0.000 0.814 0.932
+655.055 0.000 0.011 0.868 0.000 0.813 0.910
+655.385 0.000 0.011 0.869 0.000 0.812 0.910
+655.715 0.000 0.010 0.870 0.000 0.811 0.910
+656.045 0.000 0.010 0.871 0.000 0.810 0.910
+656.375 0.000 0.010 0.871 0.000 0.809 0.910
+656.705 0.000 0.010 0.872 0.000 0.808 0.910
+657.035 0.000 0.009 0.873 0.000 0.807 0.910
+657.365 0.000 0.009 0.873 0.000 0.806 0.910
+657.695 0.000 0.009 0.874 0.000 0.805 0.910
+658.025 0.000 0.009 0.875 0.000 0.804 0.910
+658.355 0.000 0.008 0.875 0.000 0.803 0.910
+658.685 0.000 0.008 0.876 0.000 0.802 0.910
+659.015 0.000 0.008 0.877 0.000 0.801 0.910
+659.345 0.000 0.008 0.877 0.000 0.800 0.910
+659.675 0.000 0.007 0.877 0.000 0.799 0.910
+660.005 0.000 0.007 0.877 0.000 0.798 0.895
+660.335 0.000 0.007 0.876 0.000 0.797 0.895
+660.665 0.000 0.007 0.876 0.000 0.793 0.895
+660.995 0.000 0.007 0.875 0.000 0.789 0.895
+661.325 0.000 0.007 0.875 0.000 0.785 0.895
+661.655 0.000 0.007 0.874 0.000 0.783 0.895
+661.985 0.000 0.007 0.874 0.000 0.780 0.895
+662.315 0.000 0.006 0.874 0.000 0.778 0.895
+662.645 0.000 0.006 0.873 0.000 0.775 0.895
+662.975 0.000 0.006 0.873 0.000 0.773 0.895
+663.305 0.000 0.006 0.872 0.000 0.770 0.895
+663.635 0.000 0.006 0.872 0.000 0.768 0.895
+663.965 0.000 0.006 0.872 0.000 0.765 0.895
+664.295 0.000 0.006 0.871 0.000 0.763 0.895
+664.625 0.000 0.005 0.871 0.000 0.760 0.895
+664.955 0.000 0.005 0.870 0.000 0.758 0.895
+665.285 0.000 0.005 0.870 0.000 0.755 0.869
+665.615 0.000 0.005 0.869 0.000 0.752 0.869
+665.945 0.000 0.005 0.868 0.000 0.748 0.869
+666.275 0.000 0.005 0.867 0.000 0.745 0.869
+666.605 0.000 0.005 0.866 0.000 0.741 0.869
+666.935 0.000 0.004 0.865 0.000 0.738 0.869
+667.265 0.000 0.004 0.864 0.000 0.735 0.869
+667.595 0.000 0.004 0.863 0.000 0.731 0.869
+667.925 0.000 0.004 0.862 0.000 0.728 0.869
+668.255 0.000 0.004 0.861 0.000 0.724 0.869
+668.585 0.000 0.004 0.861 0.000 0.721 0.869
+668.915 0.000 0.004 0.860 0.000 0.717 0.869
+669.245 0.000 0.004 0.859 0.000 0.714 0.869
+669.575 0.000 0.003 0.859 0.000 0.713 0.869
+669.905 0.000 0.003 0.859 0.000 0.712 0.869
+670.235 0.000 0.003 0.860 0.000 0.712 0.806
+670.565 0.000 0.003 0.861 0.000 0.712 0.806
+670.895 0.000 0.003 0.861 0.000 0.712 0.806
+671.225 0.000 0.003 0.862 0.000 0.711 0.806
+671.555 0.000 0.003 0.863 0.000 0.711 0.806
+671.885 0.000 0.003 0.863 0.000 0.711 0.806
+672.215 0.000 0.003 0.864 0.000 0.711 0.806
+672.545 0.000 0.003 0.864 0.000 0.710 0.806
+672.875 0.000 0.003 0.865 0.000 0.710 0.806
+673.205 0.000 0.002 0.866 0.000 0.710 0.806
+673.535 0.000 0.002 0.866 0.000 0.710 0.806
+673.865 0.000 0.002 0.867 0.000 0.709 0.806
+674.195 0.000 0.002 0.868 0.000 0.709 0.806
+674.525 0.000 0.002 0.868 0.000 0.709 0.806
+674.855 0.000 0.002 0.869 0.000 0.709 0.806
+675.185 0.000 0.002 0.869 0.000 0.708 0.678
+675.515 0.000 0.002 0.870 0.000 0.708 0.678
+675.845 0.000 0.002 0.869 0.000 0.708 0.678
+676.175 0.000 0.002 0.869 0.000 0.708 0.678
+676.505 0.000 0.001 0.869 0.000 0.707 0.678
+676.835 0.000 0.001 0.868 0.000 0.707 0.678
+677.165 0.000 0.001 0.868 0.000 0.707 0.678
+677.495 0.000 0.001 0.868 0.000 0.707 0.678
+677.825 0.000 0.001 0.867 0.000 0.706 0.678
+678.155 0.000 0.001 0.867 0.000 0.706 0.678
+678.485 0.000 0.001 0.867 0.000 0.706 0.678
+678.815 0.000 0.001 0.867 0.000 0.705 0.678
+679.145 0.000 0.001 0.866 0.000 0.705 0.678
+679.475 0.000 0.001 0.866 0.000 0.705 0.678
+679.805 0.000 0.000 0.866 0.000 0.706 0.678
+680.135 0.000 0.000 0.866 0.000 0.707 0.502
+680.465 0.000 0.000 0.866 0.000 0.707 0.502
+680.795 0.000 0.000 0.866 0.000 0.708 0.502
+681.125 0.000 0.000 0.866 0.000 0.709 0.502
+681.455 0.000 0.000 0.866 0.000 0.710 0.502
+681.785 0.000 0.000 0.866 0.000 0.710 0.502
+682.115 0.000 0.000 0.866 0.000 0.711 0.502
+682.445 0.000 0.000 0.866 0.000 0.712 0.502
+682.775 0.000 0.000 0.866 0.000 0.712 0.502
+683.105 0.000 0.000 0.866 0.000 0.713 0.502
+683.435 0.000 0.000 0.866 0.000 0.714 0.502
+683.765 0.000 0.000 0.866 0.000 0.715 0.502
+684.095 0.000 0.000 0.866 0.000 0.715 0.502
+684.425 0.000 0.000 0.866 0.000 0.716 0.502
+684.755 0.000 0.000 0.866 0.000 0.717 0.502
+685.085 0.000 0.000 0.866 0.000 0.717 0.327
+685.415 0.000 0.000 0.866 0.000 0.718 0.327
+685.745 0.000 0.000 0.866 0.000 0.719 0.327
+686.075 0.000 0.000 0.866 0.000 0.720 0.327
+686.405 0.000 0.000 0.866 0.000 0.720 0.327
+686.735 0.000 0.000 0.866 0.000 0.721 0.327
+687.065 0.000 0.000 0.866 0.000 0.722 0.327
+687.395 0.000 0.000 0.866 0.000 0.723 0.327
+687.725 0.000 0.000 0.866 0.000 0.723 0.327
+688.055 0.000 0.000 0.866 0.000 0.724 0.327
+688.385 0.000 0.000 0.866 0.000 0.725 0.327
+688.715 0.000 0.000 0.866 0.000 0.726 0.327
+689.045 0.000 0.000 0.866 0.000 0.727 0.327
+689.375 0.000 0.000 0.866 0.000 0.727 0.327
+689.705 0.000 0.000 0.861 0.000 0.728 0.327
+690.035 0.000 0.000 0.855 0.000 0.729 0.195
+690.365 0.000 0.000 0.848 0.000 0.730 0.195
+690.695 0.000 0.000 0.842 0.000 0.731 0.195
+691.025 0.000 0.000 0.836 0.000 0.731 0.195
+691.355 0.000 0.000 0.830 0.000 0.732 0.195
+691.685 0.000 0.000 0.824 0.000 0.733 0.195
+692.015 0.000 0.000 0.820 0.000 0.734 0.195
+692.345 0.000 0.000 0.815 0.000 0.734 0.195
+692.675 0.000 0.000 0.811 0.000 0.735 0.195
+693.005 0.000 0.000 0.806 0.000 0.736 0.195
+693.335 0.000 0.000 0.801 0.000 0.737 0.195
+693.665 0.000 0.000 0.797 0.000 0.738 0.195
+693.995 0.000 0.000 0.792 0.000 0.738 0.195
+694.325 0.000 0.000 0.788 0.000 0.739 0.195
+694.655 0.000 0.000 0.782 0.000 0.740 0.195
+694.985 0.000 0.000 0.775 0.000 0.741 0.195
+695.315 0.000 0.000 0.768 0.000 0.741 0.114
+695.645 0.000 0.000 0.761 0.000 0.742 0.114
+695.975 0.000 0.000 0.754 0.000 0.743 0.114
+696.305 0.000 0.000 0.747 0.000 0.744 0.114
+696.635 0.000 0.000 0.740 0.000 0.744 0.114
+696.965 0.000 0.000 0.734 0.000 0.745 0.114
+697.295 0.000 0.000 0.728 0.000 0.746 0.114
+697.625 0.000 0.000 0.722 0.000 0.747 0.114
+697.955 0.000 0.000 0.715 0.000 0.748 0.114
+698.285 0.000 0.000 0.709 0.000 0.748 0.114
+698.615 0.000 0.000 0.700 0.000 0.749 0.114
+698.945 0.000 0.000 0.688 0.000 0.750 0.114
+699.275 0.000 0.000 0.675 0.000 0.751 0.114
+699.605 0.000 0.000 0.663 0.000 0.751 0.114
+699.935 0.000 0.000 0.650 0.000 0.750 0.114
+700.265 0.000 0.000 0.637 0.000 0.749 0.067
+700.595 0.000 0.000 0.625 0.000 0.749 0.067
+700.925 0.000 0.000 0.611 0.000 0.748 0.067
+701.255 0.000 0.000 0.597 0.000 0.747 0.067
+701.585 0.000 0.000 0.583 0.000 0.746 0.067
+701.915 0.000 0.000 0.569 0.000 0.745 0.067
+702.245 0.000 0.000 0.555 0.000 0.745 0.067
+702.575 0.000 0.000 0.542 0.000 0.744 0.067
+702.905 0.000 0.000 0.529 0.000 0.743 0.067
+703.235 0.000 0.000 0.517 0.000 0.742 0.067
+703.565 0.000 0.000 0.504 0.000 0.742 0.067
+703.895 0.000 0.000 0.491 0.000 0.741 0.067
+704.225 0.000 0.000 0.479 0.000 0.740 0.067
+704.555 0.000 0.000 0.466 0.000 0.739 0.067
+704.885 0.000 0.000 0.452 0.000 0.739 0.067
+705.215 0.000 0.000 0.438 0.000 0.738 0.039
+705.545 0.000 0.000 0.425 0.000 0.737 0.039
+705.875 0.000 0.000 0.411 0.000 0.736 0.039
+706.205 0.000 0.000 0.397 0.000 0.736 0.039
+706.535 0.000 0.000 0.383 0.000 0.735 0.039
+706.865 0.000 0.000 0.359 0.000 0.734 0.039
+707.195 0.000 0.000 0.335 0.000 0.733 0.039
+707.525 0.000 0.000 0.311 0.000 0.733 0.039
+707.855 0.000 0.000 0.304 0.000 0.732 0.039
+708.185 0.000 0.000 0.297 0.000 0.731 0.039
+708.515 0.000 0.000 0.290 0.000 0.730 0.039
+708.845 0.000 0.000 0.283 0.000 0.730 0.039
+709.175 0.000 0.000 0.276 0.000 0.729 0.039
+709.505 0.000 0.000 0.269 0.000 0.728 0.039
+709.835 0.000 0.000 0.253 0.000 0.725 0.039
+710.165 0.000 0.000 0.235 0.000 0.721 0.024
+710.495 0.000 0.000 0.218 0.000 0.718 0.024
+710.825 0.000 0.000 0.210 0.000 0.714 0.024
+711.155 0.000 0.000 0.205 0.000 0.711 0.024
+711.485 0.000 0.000 0.200 0.000 0.707 0.024
+711.815 0.000 0.000 0.195 0.000 0.704 0.024
+712.145 0.000 0.000 0.190 0.000 0.700 0.024
+712.475 0.000 0.000 0.185 0.000 0.697 0.024
+712.805 0.000 0.000 0.177 0.000 0.693 0.024
+713.135 0.000 0.000 0.166 0.000 0.690 0.024
+713.465 0.000 0.000 0.156 0.000 0.686 0.024
+713.795 0.000 0.000 0.151 0.000 0.683 0.024
+714.125 0.000 0.000 0.147 0.000 0.679 0.024
+714.455 0.000 0.000 0.144 0.000 0.676 0.024
+714.785 0.000 0.000 0.141 0.000 0.672 0.024
+715.115 0.000 0.000 0.137 0.000 0.668 0.016
+715.445 0.000 0.000 0.134 0.000 0.664 0.016
+715.775 0.000 0.000 0.130 0.000 0.661 0.016
+716.105 0.000 0.000 0.127 0.000 0.657 0.016
+716.435 0.000 0.000 0.123 0.000 0.653 0.016
+716.765 0.000 0.000 0.120 0.000 0.649 0.016
+717.095 0.000 0.000 0.116 0.000 0.646 0.016
+717.425 0.000 0.000 0.113 0.000 0.642 0.016
+717.755 0.000 0.000 0.108 0.000 0.638 0.016
+718.085 0.000 0.000 0.101 0.000 0.634 0.016
+718.415 0.000 0.000 0.094 0.000 0.630 0.016
+718.745 0.000 0.000 0.087 0.000 0.627 0.016
+719.075 0.000 0.000 0.080 0.000 0.625 0.016
+719.405 0.000 0.000 0.073 0.000 0.622 0.016
+719.735 0.000 0.000 0.068 0.000 0.620 0.016
+720.065 0.000 0.000 0.065 0.000 0.617 0.011
+720.395 0.000 0.000 0.063 0.000 0.615 0.011
+720.725 0.000 0.000 0.060 0.000 0.609 0.011
+721.055 0.000 0.000 0.058 0.000 0.597 0.011
+721.385 0.000 0.000 0.055 0.000 0.585 0.011
+721.715 0.000 0.000 0.053 0.000 0.573 0.011
+722.045 0.000 0.000 0.050 0.000 0.561 0.011
+722.375 0.000 0.000 0.048 0.000 0.549 0.011
+722.705 0.000 0.000 0.045 0.000 0.537 0.011
+723.035 0.000 0.000 0.043 0.000 0.525 0.011
+723.365 0.000 0.000 0.040 0.000 0.513 0.011
+723.695 0.000 0.000 0.038 0.000 0.501 0.011
+724.025 0.000 0.000 0.037 0.000 0.489 0.011
+724.355 0.000 0.000 0.035 0.000 0.477 0.011
+724.685 0.000 0.000 0.034 0.000 0.465 0.011
+725.015 0.000 0.000 0.032 0.000 0.452 0.000
+725.345 0.000 0.000 0.031 0.000 0.439 0.000
+725.675 0.000 0.000 0.029 0.000 0.425 0.000
+726.005 0.000 0.000 0.028 0.000 0.412 0.000
+726.335 0.000 0.000 0.026 0.000 0.399 0.000
+726.665 0.000 0.000 0.025 0.000 0.386 0.000
+726.995 0.000 0.000 0.023 0.000 0.378 0.000
+727.325 0.000 0.000 0.022 0.000 0.369 0.000
+727.655 0.000 0.000 0.020 0.000 0.361 0.000
+727.985 0.000 0.000 0.019 0.000 0.353 0.000
+728.315 0.000 0.000 0.017 0.000 0.344 0.000
+728.645 0.000 0.000 0.016 0.000 0.336 0.000
+728.975 0.000 0.000 0.014 0.000 0.327 0.000
+729.305 0.000 0.000 0.013 0.000 0.319 0.000
+729.635 0.000 0.000 0.012 0.000 0.311 0.000
+729.965 0.000 0.000 0.011 0.000 0.298 0.000
+730.295 0.000 0.000 0.010 0.000 0.286 0.000
+730.625 0.000 0.000 0.009 0.000 0.273 0.000
+730.955 0.000 0.000 0.008 0.000 0.267 0.000
+731.285 0.000 0.000 0.007 0.000 0.262 0.000
+731.615 0.000 0.000 0.007 0.000 0.257 0.000
+731.945 0.000 0.000 0.006 0.000 0.252 0.000
+732.275 0.000 0.000 0.005 0.000 0.247 0.000
+732.605 0.000 0.000 0.004 0.000 0.242 0.000
+732.935 0.000 0.000 0.004 0.000 0.237 0.000
+733.265 0.000 0.000 0.003 0.000 0.232 0.000
+733.595 0.000 0.000 0.003 0.000 0.227 0.000
+733.925 0.000 0.000 0.003 0.000 0.222 0.000
+734.255 0.000 0.000 0.003 0.000 0.217 0.000
+734.585 0.000 0.000 0.003 0.000 0.212 0.000
+734.915 0.000 0.000 0.002 0.000 0.207 0.000
+735.245 0.000 0.000 0.002 0.000 0.203 0.000
+735.575 0.000 0.000 0.002 0.000 0.198 0.000
+735.905 0.000 0.000 0.002 0.000 0.193 0.000
+736.235 0.000 0.000 0.002 0.000 0.188 0.000
+736.565 0.000 0.000 0.001 0.000 0.184 0.000
+736.895 0.000 0.000 0.001 0.000 0.179 0.000
+737.225 0.000 0.000 0.001 0.000 0.174 0.000
+737.555 0.000 0.000 0.001 0.000 0.170 0.000
+737.885 0.000 0.000 0.001 0.000 0.165 0.000
+738.215 0.000 0.000 0.000 0.000 0.160 0.000
+738.545 0.000 0.000 0.000 0.000 0.155 0.000
+738.875 0.000 0.000 0.000 0.000 0.152 0.000
+739.205 0.000 0.000 0.000 0.000 0.148 0.000
+739.535 0.000 0.000 0.000 0.000 0.145 0.000
+739.865 0.000 0.000 0.000 0.000 0.142 0.000
+740.195 0.000 0.000 0.000 0.000 0.139 0.000
+740.525 0.000 0.000 0.000 0.000 0.136 0.000
+740.855 0.000 0.000 0.000 0.000 0.133 0.000
+741.185 0.000 0.000 0.000 0.000 0.130 0.000
+741.515 0.000 0.000 0.000 0.000 0.126 0.000
+741.845 0.000 0.000 0.000 0.000 0.123 0.000
+742.175 0.000 0.000 0.000 0.000 0.120 0.000
+742.505 0.000 0.000 0.000 0.000 0.117 0.000
+742.835 0.000 0.000 0.000 0.000 0.114 0.000
+743.165 0.000 0.000 0.000 0.000 0.111 0.000
+743.495 0.000 0.000 0.000 0.000 0.108 0.000
+743.825 0.000 0.000 0.000 0.000 0.104 0.000
+744.155 0.000 0.000 0.000 0.000 0.101 0.000
+744.485 0.000 0.000 0.000 0.000 0.098 0.000
+744.815 0.000 0.000 0.000 0.001 0.095 0.000
+745.145 0.000 0.000 0.000 0.001 0.092 0.000
+745.475 0.000 0.000 0.000 0.001 0.089 0.000
+745.805 0.000 0.000 0.000 0.001 0.086 0.000
+746.135 0.000 0.000 0.000 0.001 0.083 0.000
+746.465 0.000 0.000 0.000 0.001 0.080 0.000
+746.795 0.000 0.000 0.000 0.002 0.077 0.000
+747.125 0.000 0.000 0.000 0.002 0.074 0.000
+747.455 0.000 0.000 0.000 0.002 0.071 0.000
+747.785 0.000 0.000 0.000 0.002 0.068 0.000
+748.115 0.000 0.000 0.000 0.002 0.065 0.000
+748.445 0.000 0.000 0.000 0.003 0.062 0.000
+748.775 0.000 0.000 0.000 0.003 0.059 0.000
+749.105 0.000 0.000 0.000 0.003 0.056 0.000
+749.435 0.000 0.000 0.000 0.003 0.053 0.000
+749.765 0.000 0.000 0.000 0.003 0.050 0.000
+750.095 0.000 0.000 0.000 0.003 0.049 0.000
+750.425 0.000 0.000 0.000 0.004 0.048 0.000
+750.755 0.000 0.000 0.000 0.004 0.047 0.000
+751.085 0.000 0.000 0.000 0.004 0.045 0.000
+751.415 0.000 0.000 0.000 0.004 0.044 0.000
+751.745 0.000 0.000 0.000 0.005 0.043 0.000
+752.075 0.000 0.000 0.000 0.005 0.042 0.000
+752.405 0.000 0.000 0.000 0.005 0.041 0.000
+752.735 0.000 0.000 0.000 0.005 0.040 0.000
+753.065 0.000 0.000 0.000 0.006 0.039 0.000
+753.395 0.000 0.000 0.000 0.006 0.038 0.000
+753.725 0.000 0.000 0.000 0.006 0.037 0.000
+754.055 0.000 0.000 0.000 0.006 0.036 0.000
+754.385 0.000 0.000 0.000 0.007 0.035 0.000
+754.715 0.000 0.000 0.000 0.007 0.034 0.000
+755.045 0.000 0.000 0.000 0.007 0.033 0.000
+755.375 0.000 0.000 0.000 0.007 0.031 0.000
+755.705 0.000 0.000 0.000 0.008 0.030 0.000
+756.035 0.000 0.000 0.000 0.008 0.029 0.000
+756.365 0.000 0.000 0.000 0.008 0.028 0.000
+756.695 0.000 0.000 0.000 0.008 0.027 0.000
+757.025 0.000 0.000 0.000 0.008 0.026 0.000
+757.355 0.000 0.000 0.000 0.008 0.026 0.000
+757.685 0.000 0.000 0.000 0.008 0.025 0.000
+758.015 0.000 0.000 0.000 0.009 0.024 0.000
+758.345 0.000 0.000 0.000 0.009 0.024 0.000
+758.675 0.000 0.000 0.000 0.009 0.023 0.000
+759.005 0.000 0.000 0.000 0.009 0.023 0.000
+759.335 0.000 0.000 0.000 0.009 0.022 0.000
+759.665 0.000 0.000 0.000 0.009 0.021 0.000
+759.995 0.000 0.000 0.000 0.009 0.021 0.000
+760.325 0.000 0.000 0.000 0.010 0.020 0.000
+760.655 0.000 0.000 0.000 0.010 0.019 0.000
+760.985 0.000 0.000 0.000 0.010 0.019 0.000
+761.315 0.000 0.000 0.000 0.010 0.018 0.000
+761.645 0.000 0.000 0.000 0.010 0.018 0.000
+761.975 0.000 0.000 0.000 0.010 0.017 0.000
+762.305 0.000 0.000 0.000 0.010 0.016 0.000
+762.635 0.000 0.000 0.000 0.011 0.016 0.000
+762.965 0.000 0.000 0.000 0.011 0.015 0.000
+763.295 0.000 0.000 0.000 0.011 0.014 0.000
+763.625 0.000 0.000 0.000 0.011 0.014 0.000
+763.955 0.000 0.000 0.000 0.011 0.013 0.000
+764.285 0.000 0.000 0.000 0.011 0.013 0.000
+764.615 0.000 0.000 0.000 0.011 0.012 0.000
+764.945 0.000 0.000 0.000 0.012 0.011 0.000
+765.275 0.000 0.000 0.000 0.012 0.011 0.000
+765.605 0.000 0.000 0.000 0.013 0.011 0.000
+765.935 0.000 0.000 0.000 0.014 0.010 0.000
+766.265 0.000 0.000 0.000 0.014 0.010 0.000
+766.595 0.000 0.000 0.000 0.015 0.010 0.000
+766.925 0.000 0.000 0.000 0.015 0.009 0.000
+767.255 0.000 0.000 0.000 0.016 0.009 0.000
+767.585 0.000 0.000 0.000 0.017 0.008 0.000
+767.915 0.000 0.000 0.000 0.017 0.008 0.000
+768.245 0.000 0.000 0.000 0.018 0.008 0.000
+768.575 0.000 0.000 0.000 0.019 0.007 0.000
+768.905 0.000 0.000 0.000 0.020 0.007 0.000
+769.235 0.000 0.000 0.000 0.022 0.007 0.000
+769.565 0.000 0.000 0.000 0.024 0.006 0.000
+769.895 0.000 0.000 0.000 0.027 0.006 0.000
+770.225 0.000 0.000 0.000 0.029 0.006 0.000
+770.555 0.000 0.000 0.000 0.031 0.005 0.000
+770.885 0.000 0.000 0.000 0.033 0.005 0.000
+771.215 0.000 0.000 0.000 0.036 0.005 0.000
+771.545 0.000 0.000 0.000 0.038 0.004 0.000
+771.875 0.000 0.000 0.000 0.040 0.004 0.000
+772.205 0.000 0.000 0.000 0.043 0.004 0.000
+772.535 0.000 0.000 0.000 0.045 0.004 0.000
+772.865 0.000 0.000 0.000 0.047 0.004 0.000
+773.195 0.000 0.000 0.000 0.050 0.005 0.000
+773.525 0.000 0.000 0.000 0.052 0.005 0.000
+773.855 0.000 0.000 0.000 0.054 0.005 0.000
+774.185 0.000 0.000 0.000 0.056 0.005 0.000
+774.515 0.000 0.000 0.000 0.059 0.005 0.000
+774.845 0.000 0.000 0.000 0.061 0.005 0.000
+775.175 0.000 0.000 0.000 0.065 0.006 0.000
+775.505 0.000 0.000 0.000 0.069 0.006 0.000
+775.835 0.000 0.000 0.000 0.072 0.006 0.000
+776.165 0.000 0.000 0.000 0.076 0.006 0.000
+776.495 0.000 0.000 0.000 0.080 0.006 0.000
+776.825 0.000 0.000 0.000 0.084 0.006 0.000
+777.155 0.000 0.000 0.000 0.087 0.007 0.000
+777.485 0.000 0.000 0.000 0.091 0.007 0.000
+777.815 0.000 0.000 0.000 0.095 0.007 0.000
+778.145 0.000 0.000 0.000 0.099 0.007 0.000
+778.475 0.000 0.000 0.000 0.102 0.007 0.000
+778.805 0.000 0.000 0.000 0.106 0.007 0.000
+779.135 0.000 0.000 0.000 0.112 0.008 0.000
+779.465 0.000 0.000 0.000 0.118 0.008 0.000
+779.795 0.000 0.000 0.000 0.124 0.008 0.000
+780.125 0.000 0.000 0.000 0.132 0.008 0.000
+780.455 0.000 0.000 0.000 0.141 0.008 0.000
+780.785 0.000 0.000 0.000 0.150 0.008 0.000
+781.115 0.000 0.000 0.000 0.162 0.009 0.000
+781.445 0.000 0.000 0.000 0.175 0.009 0.000
+781.775 0.000 0.000 0.000 0.188 0.009 0.000
+782.105 0.000 0.000 0.000 0.201 0.009 0.000
+782.435 0.000 0.000 0.000 0.215 0.009 0.000
+782.765 0.000 0.000 0.000 0.228 0.009 0.000
+783.095 0.000 0.000 0.000 0.241 0.010 0.000
+783.425 0.000 0.000 0.000 0.253 0.010 0.000
+783.755 0.000 0.000 0.000 0.266 0.010 0.000
+784.085 0.000 0.000 0.000 0.278 0.010 0.000
+784.415 0.000 0.000 0.000 0.291 0.010 0.000
+784.745 0.000 0.000 0.000 0.304 0.011 0.000
+785.075 0.000 0.000 0.000 0.314 0.011 0.000
+785.405 0.000 0.000 0.000 0.322 0.011 0.000
+785.735 0.000 0.000 0.000 0.330 0.011 0.000
+786.065 0.000 0.000 0.000 0.338 0.011 0.000
+786.395 0.000 0.000 0.000 0.346 0.011 0.000
+786.725 0.000 0.000 0.000 0.354 0.012 0.000
+787.055 0.000 0.000 0.000 0.362 0.012 0.000
+787.385 0.000 0.000 0.000 0.370 0.012 0.000
+787.715 0.000 0.000 0.000 0.378 0.012 0.000
+788.045 0.000 0.000 0.000 0.388 0.012 0.000
+788.375 0.000 0.000 0.000 0.401 0.012 0.000
+788.705 0.000 0.000 0.000 0.415 0.013 0.000
+789.035 0.000 0.000 0.000 0.429 0.013 0.000
+789.365 0.000 0.000 0.000 0.443 0.013 0.000
+789.695 0.000 0.000 0.000 0.457 0.013 0.000
+790.025 0.000 0.000 0.000 0.469 0.013 0.000
+790.355 0.000 0.000 0.000 0.475 0.013 0.000
+790.685 0.000 0.000 0.000 0.482 0.014 0.000
+791.015 0.000 0.000 0.000 0.488 0.014 0.000
+791.345 0.000 0.000 0.000 0.494 0.014 0.000
+791.675 0.000 0.000 0.000 0.500 0.014 0.000
+792.005 0.000 0.000 0.000 0.507 0.014 0.000
+792.335 0.000 0.000 0.000 0.513 0.014 0.000
+792.665 0.000 0.000 0.000 0.519 0.015 0.000
+792.995 0.000 0.000 0.000 0.526 0.015 0.000
+793.325 0.000 0.000 0.000 0.532 0.015 0.000
+793.655 0.000 0.000 0.000 0.538 0.015 0.000
+793.985 0.000 0.000 0.000 0.544 0.015 0.000
+794.315 0.000 0.000 0.000 0.551 0.015 0.000
+794.645 0.000 0.000 0.000 0.558 0.015 0.000
+794.975 0.000 0.000 0.000 0.565 0.015 0.000
+795.305 0.000 0.000 0.000 0.572 0.015 0.000
+795.635 0.000 0.000 0.000 0.579 0.015 0.000
+795.965 0.000 0.000 0.000 0.586 0.015 0.000
+796.295 0.000 0.000 0.000 0.593 0.015 0.000
+796.625 0.000 0.000 0.000 0.600 0.015 0.000
+796.955 0.000 0.000 0.000 0.607 0.015 0.000
+797.285 0.000 0.000 0.000 0.614 0.015 0.000
+797.615 0.000 0.000 0.000 0.621 0.015 0.000
+797.945 0.000 0.000 0.000 0.627 0.014 0.000
+798.275 0.000 0.000 0.000 0.635 0.014 0.000
+798.605 0.000 0.000 0.000 0.642 0.014 0.000
+798.935 0.000 0.000 0.000 0.650 0.014 0.000
+799.265 0.000 0.000 0.000 0.656 0.014 0.000
+799.595 0.000 0.000 0.000 0.661 0.014 0.000
+799.925 0.000 0.000 0.000 0.666 0.014 0.000
+800.255 0.000 0.000 0.000 0.671 0.014 0.000
+800.585 0.000 0.000 0.000 0.676 0.014 0.000
+800.915 0.000 0.000 0.000 0.681 0.014 0.000
+801.245 0.000 0.000 0.000 0.682 0.014 0.000
+801.575 0.000 0.000 0.000 0.681 0.014 0.000
+801.905 0.000 0.000 0.000 0.680 0.014 0.000
+802.235 0.000 0.000 0.000 0.680 0.014 0.000
+802.565 0.000 0.000 0.000 0.679 0.014 0.000
+802.895 0.000 0.000 0.000 0.678 0.013 0.000
+803.225 0.000 0.000 0.000 0.678 0.013 0.000
+803.555 0.000 0.000 0.000 0.678 0.013 0.000
+803.885 0.000 0.000 0.000 0.678 0.013 0.000
+804.215 0.000 0.000 0.000 0.677 0.013 0.000
+804.545 0.000 0.000 0.000 0.677 0.013 0.000
+804.875 0.000 0.000 0.000 0.677 0.013 0.000
+805.205 0.000 0.000 0.000 0.677 0.013 0.000
+805.535 0.000 0.000 0.000 0.677 0.013 0.000
+805.865 0.000 0.000 0.000 0.676 0.013 0.000
+806.195 0.000 0.000 0.000 0.676 0.013 0.000
+806.525 0.000 0.000 0.000 0.676 0.013 0.000
+806.855 0.000 0.000 0.000 0.676 0.013 0.000
+807.185 0.000 0.000 0.000 0.676 0.013 0.000
+807.515 0.000 0.000 0.000 0.675 0.012 0.000
+807.845 0.000 0.000 0.000 0.675 0.012 0.000
+808.175 0.000 0.000 0.000 0.675 0.012 0.000
+808.505 0.000 0.000 0.000 0.675 0.012 0.000
+808.835 0.000 0.000 0.000 0.675 0.012 0.000
+809.165 0.000 0.000 0.000 0.675 0.012 0.000
+809.495 0.000 0.000 0.000 0.676 0.012 0.000
+809.825 0.000 0.000 0.000 0.678 0.012 0.000
+810.155 0.000 0.000 0.000 0.679 0.012 0.000
+810.485 0.000 0.000 0.000 0.681 0.012 0.000
+810.815 0.000 0.000 0.000 0.682 0.012 0.000
+811.145 0.000 0.000 0.000 0.684 0.012 0.000
+811.475 0.000 0.000 0.000 0.685 0.012 0.000
+811.805 0.000 0.000 0.000 0.687 0.012 0.000
+812.135 0.000 0.000 0.000 0.688 0.011 0.000
+812.465 0.000 0.000 0.000 0.690 0.011 0.000
+812.795 0.000 0.000 0.000 0.691 0.011 0.000
+813.125 0.000 0.000 0.000 0.693 0.011 0.000
+813.455 0.000 0.000 0.000 0.694 0.011 0.000
+813.785 0.000 0.000 0.000 0.695 0.011 0.000
+814.115 0.000 0.000 0.000 0.697 0.011 0.000
+814.445 0.000 0.000 0.000 0.698 0.011 0.000
+814.775 0.000 0.000 0.000 0.700 0.011 0.000
+815.105 0.000 0.000 0.000 0.701 0.011 0.000
+815.435 0.000 0.000 0.000 0.703 0.011 0.000
+815.765 0.000 0.000 0.000 0.704 0.010 0.000
+816.095 0.000 0.000 0.000 0.705 0.010 0.000
+816.425 0.000 0.000 0.000 0.706 0.010 0.000
+816.755 0.000 0.000 0.000 0.708 0.010 0.000
+817.085 0.000 0.000 0.000 0.709 0.010 0.000
+817.415 0.000 0.000 0.000 0.710 0.010 0.000
+817.745 0.000 0.000 0.000 0.711 0.010 0.000
+818.075 0.000 0.000 0.000 0.713 0.010 0.000
+818.405 0.000 0.000 0.000 0.714 0.010 0.000
+818.735 0.000 0.000 0.000 0.715 0.010 0.000
+819.065 0.000 0.000 0.000 0.716 0.009 0.000
+819.395 0.000 0.000 0.000 0.718 0.009 0.000
+819.725 0.000 0.000 0.000 0.719 0.009 0.000
+820.055 0.000 0.000 0.000 0.720 0.009 0.000
+820.385 0.000 0.000 0.000 0.722 0.009 0.000
+820.715 0.000 0.000 0.000 0.724 0.009 0.000
+821.045 0.000 0.000 0.000 0.726 0.009 0.000
+821.375 0.000 0.000 0.000 0.728 0.009 0.000
+821.705 0.000 0.000 0.000 0.730 0.009 0.000
+822.035 0.000 0.000 0.000 0.732 0.009 0.000
+822.365 0.000 0.000 0.000 0.734 0.008 0.000
+822.695 0.000 0.000 0.000 0.736 0.008 0.000
+823.025 0.000 0.000 0.000 0.738 0.008 0.000
+823.355 0.000 0.000 0.000 0.740 0.008 0.000
+823.685 0.000 0.000 0.000 0.742 0.008 0.000
+824.015 0.000 0.000 0.000 0.744 0.008 0.000
+824.345 0.000 0.000 0.000 0.746 0.008 0.000
+824.675 0.000 0.000 0.000 0.748 0.008 0.000
+825.005 0.000 0.000 0.000 0.750 0.008 0.000
+825.335 0.000 0.000 0.000 0.753 0.008 0.000
+825.665 0.000 0.000 0.000 0.755 0.008 0.000
+825.995 0.000 0.000 0.000 0.758 0.007 0.000
+826.325 0.000 0.000 0.000 0.760 0.007 0.000
+826.655 0.000 0.000 0.000 0.763 0.007 0.000
+826.985 0.000 0.000 0.000 0.765 0.007 0.000
+827.315 0.000 0.000 0.000 0.768 0.007 0.000
+827.645 0.000 0.000 0.000 0.770 0.007 0.000
+827.975 0.000 0.000 0.000 0.773 0.007 0.000
+828.305 0.000 0.000 0.000 0.775 0.007 0.000
+828.635 0.000 0.000 0.000 0.778 0.007 0.000
+828.965 0.000 0.000 0.000 0.780 0.007 0.000
+829.295 0.000 0.000 0.000 0.782 0.007 0.000
+829.625 0.000 0.000 0.000 0.782 0.007 0.000
+829.955 0.000 0.000 0.000 0.783 0.007 0.000
+830.285 0.000 0.000 0.000 0.783 0.007 0.000
+830.615 0.000 0.000 0.000 0.784 0.007 0.000
+830.945 0.000 0.000 0.000 0.784 0.006 0.000
+831.275 0.000 0.000 0.000 0.784 0.006 0.000
+831.605 0.000 0.000 0.000 0.785 0.006 0.000
+831.935 0.000 0.000 0.000 0.785 0.006 0.000
+832.265 0.000 0.000 0.000 0.786 0.006 0.000
+832.595 0.000 0.000 0.000 0.786 0.006 0.000
+832.925 0.000 0.000 0.000 0.786 0.006 0.000
+833.255 0.000 0.000 0.000 0.787 0.006 0.000
+833.585 0.000 0.000 0.000 0.787 0.006 0.000
+833.915 0.000 0.000 0.000 0.787 0.006 0.000
+834.245 0.000 0.000 0.000 0.788 0.006 0.000
+834.575 0.000 0.000 0.000 0.788 0.006 0.000
+834.905 0.000 0.000 0.000 0.789 0.006 0.000
+835.235 0.000 0.000 0.000 0.789 0.006 0.000
+835.565 0.000 0.000 0.000 0.789 0.005 0.000
+835.895 0.000 0.000 0.000 0.790 0.005 0.000
+836.225 0.000 0.000 0.000 0.790 0.005 0.000
+836.555 0.000 0.000 0.000 0.790 0.005 0.000
+836.885 0.000 0.000 0.000 0.791 0.005 0.000
+837.215 0.000 0.000 0.000 0.791 0.005 0.000
+837.545 0.000 0.000 0.000 0.791 0.005 0.000
+837.875 0.000 0.000 0.000 0.792 0.005 0.000
+838.205 0.000 0.000 0.000 0.792 0.005 0.000
+838.535 0.000 0.000 0.000 0.792 0.005 0.000
+838.865 0.000 0.000 0.000 0.793 0.005 0.000
+839.195 0.000 0.000 0.000 0.793 0.005 0.000
+839.525 0.000 0.000 0.000 0.792 0.005 0.000
+839.855 0.000 0.000 0.000 0.792 0.005 0.000
+840.185 0.000 0.000 0.000 0.791 0.004 0.000
+840.515 0.000 0.000 0.000 0.790 0.004 0.000
+840.845 0.000 0.000 0.000 0.789 0.004 0.000
+841.175 0.000 0.000 0.000 0.789 0.004 0.000
+841.505 0.000 0.000 0.000 0.788 0.004 0.000
+841.835 0.000 0.000 0.000 0.787 0.004 0.000
+842.165 0.000 0.000 0.000 0.786 0.004 0.000
+842.495 0.000 0.000 0.000 0.786 0.004 0.000
+842.825 0.000 0.000 0.000 0.785 0.004 0.000
+843.155 0.000 0.000 0.000 0.784 0.004 0.000
+843.485 0.000 0.000 0.000 0.783 0.004 0.000
+843.815 0.000 0.000 0.000 0.783 0.004 0.000
+844.145 0.000 0.000 0.000 0.782 0.004 0.000
+844.475 0.000 0.000 0.000 0.781 0.003 0.000
+844.805 0.000 0.000 0.000 0.780 0.003 0.000
+845.135 0.000 0.000 0.000 0.779 0.003 0.000
+845.465 0.000 0.000 0.000 0.778 0.003 0.000
+845.795 0.000 0.000 0.000 0.777 0.003 0.000
+846.125 0.000 0.000 0.000 0.776 0.003 0.000
+846.455 0.000 0.000 0.000 0.775 0.003 0.000
+846.785 0.000 0.000 0.000 0.774 0.003 0.000
+847.115 0.000 0.000 0.000 0.772 0.003 0.000
+847.445 0.000 0.000 0.000 0.771 0.002 0.000
+847.775 0.000 0.000 0.000 0.770 0.002 0.000
+848.105 0.000 0.000 0.000 0.769 0.002 0.000
+848.435 0.000 0.000 0.000 0.768 0.002 0.000
+848.765 0.000 0.000 0.000 0.767 0.002 0.000
+849.095 0.000 0.000 0.000 0.766 0.002 0.000
+849.425 0.000 0.000 0.000 0.765 0.002 0.000
+849.755 0.000 0.000 0.000 0.764 0.002 0.000
+850.085 0.000 0.000 0.000 0.763 0.002 0.000
+850.415 0.000 0.000 0.000 0.762 0.002 0.000
+850.745 0.000 0.000 0.000 0.761 0.001 0.000
+851.075 0.000 0.000 0.000 0.759 0.001 0.000
+851.405 0.000 0.000 0.000 0.758 0.001 0.000
+851.735 0.000 0.000 0.000 0.757 0.001 0.000
+852.065 0.000 0.000 0.000 0.756 0.001 0.000
+852.395 0.000 0.000 0.000 0.754 0.001 0.000
+852.725 0.000 0.000 0.000 0.753 0.001 0.000
+853.055 0.000 0.000 0.000 0.752 0.001 0.000
+853.385 0.000 0.000 0.000 0.751 0.001 0.000
+853.715 0.000 0.000 0.000 0.749 0.000 0.000
+854.045 0.000 0.000 0.000 0.748 0.000 0.000
+854.375 0.000 0.000 0.000 0.747 0.000 0.000
+854.705 0.000 0.000 0.000 0.746 0.000 0.000
+855.035 0.000 0.000 0.000 0.744 0.000 0.000
+855.365 0.000 0.000 0.000 0.743 0.000 0.000
+855.695 0.000 0.000 0.000 0.741 0.000 0.000
+856.025 0.000 0.000 0.000 0.739 0.000 0.000
+856.355 0.000 0.000 0.000 0.737 0.000 0.000
+856.685 0.000 0.000 0.000 0.735 0.001 0.000
+857.015 0.000 0.000 0.000 0.733 0.001 0.000
+857.345 0.000 0.000 0.000 0.732 0.001 0.000
+857.675 0.000 0.000 0.000 0.730 0.001 0.000
+858.005 0.000 0.000 0.000 0.728 0.001 0.000
+858.335 0.000 0.000 0.000 0.726 0.001 0.000
+858.665 0.000 0.000 0.000 0.724 0.001 0.000
+858.995 0.000 0.000 0.000 0.722 0.002 0.000
+859.325 0.000 0.000 0.000 0.720 0.002 0.000
+859.655 0.000 0.000 0.000 0.721 0.002 0.000
+859.985 0.000 0.000 0.000 0.722 0.002 0.000
+860.315 0.000 0.000 0.000 0.723 0.002 0.000
+860.645 0.000 0.000 0.000 0.724 0.002 0.000
+860.975 0.000 0.000 0.000 0.725 0.002 0.000
+861.305 0.000 0.000 0.000 0.725 0.003 0.000
+861.635 0.000 0.000 0.000 0.726 0.003 0.000
+861.965 0.000 0.000 0.000 0.727 0.003 0.000
+862.295 0.000 0.000 0.000 0.728 0.003 0.000
+862.625 0.000 0.000 0.000 0.729 0.003 0.000
+862.955 0.000 0.000 0.000 0.730 0.003 0.000
+863.285 0.000 0.000 0.000 0.731 0.003 0.000
+863.615 0.000 0.000 0.000 0.731 0.004 0.000
+863.945 0.000 0.000 0.000 0.732 0.004 0.000
+864.275 0.000 0.000 0.000 0.733 0.004 0.000
+864.605 0.000 0.000 0.000 0.734 0.004 0.000
+864.935 0.000 0.000 0.000 0.735 0.004 0.000
+865.265 0.000 0.000 0.000 0.736 0.003 0.000
+865.595 0.000 0.000 0.000 0.736 0.003 0.000
+865.925 0.000 0.000 0.000 0.737 0.003 0.000
+866.255 0.000 0.000 0.000 0.737 0.003 0.000
+866.585 0.000 0.000 0.000 0.738 0.003 0.000
+866.915 0.000 0.000 0.000 0.738 0.003 0.000
+867.245 0.000 0.000 0.000 0.739 0.003 0.000
+867.575 0.000 0.000 0.000 0.739 0.003 0.000
+867.905 0.000 0.000 0.000 0.740 0.002 0.000
+868.235 0.000 0.000 0.000 0.740 0.002 0.000
+868.565 0.000 0.000 0.000 0.741 0.002 0.000
+868.895 0.000 0.000 0.000 0.741 0.002 0.000
+869.225 0.000 0.000 0.000 0.742 0.002 0.000
+869.555 0.000 0.000 0.000 0.742 0.002 0.000
+869.885 0.000 0.000 0.000 0.743 0.002 0.000
+870.215 0.000 0.000 0.000 0.743 0.002 0.000
+870.545 0.000 0.000 0.000 0.745 0.001 0.000
+870.875 0.000 0.000 0.000 0.747 0.001 0.000
+871.205 0.000 0.000 0.000 0.749 0.001 0.000
+871.535 0.000 0.000 0.000 0.751 0.001 0.000
+871.865 0.000 0.000 0.000 0.753 0.001 0.000
+872.195 0.000 0.000 0.000 0.755 0.001 0.000
+872.525 0.000 0.000 0.000 0.757 0.001 0.000
+872.855 0.000 0.000 0.000 0.759 0.001 0.000
+873.185 0.000 0.000 0.000 0.761 0.000 0.000
+873.515 0.000 0.000 0.000 0.764 0.000 0.000
+873.845 0.000 0.000 0.000 0.766 0.000 0.000
+874.175 0.000 0.000 0.000 0.769 0.000 0.000
+874.505 0.000 0.000 0.000 0.771 0.000 0.000
+874.835 0.000 0.000 0.000 0.774 0.000 0.000
+875.165 0.000 0.000 0.000 0.776 0.000 0.000
+875.495 0.000 0.000 0.000 0.779 0.000 0.000
+875.825 0.000 0.000 0.000 0.781 0.000 0.000
+876.155 0.000 0.000 0.000 0.784 0.000 0.000
+876.485 0.000 0.000 0.000 0.786 0.000 0.000
+876.815 0.000 0.000 0.000 0.789 0.000 0.000
+877.145 0.000 0.000 0.000 0.792 0.000 0.000
+877.475 0.000 0.000 0.000 0.795 0.000 0.000
+877.805 0.000 0.000 0.000 0.798 0.000 0.000
+878.135 0.000 0.000 0.000 0.801 0.000 0.000
+878.465 0.000 0.000 0.000 0.804 0.000 0.000
+878.795 0.000 0.000 0.000 0.807 0.000 0.000
+879.125 0.000 0.000 0.000 0.810 0.000 0.000
+879.455 0.000 0.000 0.000 0.811 0.000 0.000
+879.785 0.000 0.000 0.000 0.802 0.000 0.000
+880.115 0.000 0.000 0.000 0.793 0.000 0.000
+880.445 0.000 0.000 0.000 0.785 0.000 0.000
+880.775 0.000 0.000 0.000 0.778 0.000 0.000
+881.105 0.000 0.000 0.000 0.771 0.000 0.000
+881.435 0.000 0.000 0.000 0.765 0.000 0.000
+881.765 0.000 0.000 0.000 0.758 0.000 0.000
+882.095 0.000 0.000 0.000 0.752 0.000 0.000
+882.425 0.000 0.000 0.000 0.745 0.000 0.000
+882.755 0.000 0.000 0.000 0.738 0.000 0.000
+883.085 0.000 0.000 0.000 0.732 0.000 0.000
+883.415 0.000 0.000 0.000 0.725 0.000 0.000
+883.745 0.000 0.000 0.000 0.719 0.000 0.000
+884.075 0.000 0.000 0.000 0.712 0.000 0.000
+884.405 0.000 0.000 0.000 0.705 0.000 0.000
+884.735 0.000 0.000 0.000 0.697 0.000 0.000
+885.065 0.000 0.000 0.000 0.689 0.000 0.000
+885.395 0.000 0.000 0.000 0.680 0.000 0.000
+885.725 0.000 0.000 0.000 0.672 0.000 0.000
+886.055 0.000 0.000 0.000 0.664 0.000 0.000
+886.385 0.000 0.000 0.000 0.655 0.000 0.000
+886.715 0.000 0.000 0.000 0.647 0.000 0.000
+887.045 0.000 0.000 0.000 0.638 0.000 0.000
+887.375 0.000 0.000 0.000 0.630 0.000 0.000
+887.705 0.000 0.000 0.000 0.621 0.000 0.000
+888.035 0.000 0.000 0.000 0.611 0.000 0.000
+888.365 0.000 0.000 0.000 0.601 0.000 0.000
+888.695 0.000 0.000 0.000 0.592 0.000 0.000
+889.025 0.000 0.000 0.000 0.582 0.000 0.000
+889.355 0.000 0.000 0.000 0.572 0.000 0.000
+889.685 0.000 0.000 0.000 0.563 0.000 0.000
+890.015 0.000 0.000 0.000 0.553 0.000 0.000
+890.345 0.000 0.000 0.000 0.543 0.000 0.000
+890.675 0.000 0.000 0.000 0.532 0.000 0.000
+891.005 0.000 0.000 0.000 0.520 0.000 0.000
+891.335 0.000 0.000 0.000 0.508 0.000 0.000
+891.665 0.000 0.000 0.000 0.496 0.000 0.000
+891.995 0.000 0.000 0.000 0.484 0.000 0.000
+892.325 0.000 0.000 0.000 0.472 0.000 0.000
+892.655 0.000 0.000 0.000 0.462 0.000 0.000
+892.985 0.000 0.000 0.000 0.454 0.000 0.000
+893.315 0.000 0.000 0.000 0.445 0.000 0.000
+893.645 0.000 0.000 0.000 0.436 0.000 0.000
+893.975 0.000 0.000 0.000 0.427 0.000 0.000
+894.305 0.000 0.000 0.000 0.418 0.000 0.000
+894.635 0.000 0.000 0.000 0.409 0.000 0.000
+894.965 0.000 0.000 0.000 0.401 0.000 0.000
+895.295 0.000 0.000 0.000 0.392 0.000 0.000
+895.625 0.000 0.000 0.000 0.376 0.000 0.000
+895.955 0.000 0.000 0.000 0.351 0.000 0.000
+896.285 0.000 0.000 0.000 0.325 0.000 0.000
+896.615 0.000 0.000 0.000 0.306 0.000 0.000
+896.945 0.000 0.000 0.000 0.294 0.000 0.000
+897.275 0.000 0.000 0.000 0.282 0.000 0.000
+897.605 0.000 0.000 0.000 0.270 0.000 0.000
+897.935 0.000 0.000 0.000 0.258 0.000 0.000
+898.265 0.000 0.000 0.000 0.246 0.000 0.000
+898.595 0.000 0.000 0.000 0.236 0.000 0.000
+898.925 0.000 0.000 0.000 0.229 0.000 0.000
+899.255 0.000 0.000 0.000 0.223 0.000 0.000
+899.585 0.000 0.000 0.000 0.216 0.000 0.000
+899.915 0.000 0.000 0.000 0.209 0.000 0.000
+900.245 0.000 0.000 0.000 0.201 0.000 0.000
+900.575 0.000 0.000 0.000 0.194 0.000 0.000
+900.905 0.000 0.000 0.000 0.186 0.000 0.000
+901.235 0.000 0.000 0.000 0.179 0.000 0.000
+901.565 0.000 0.000 0.000 0.172 0.000 0.000
+901.895 0.000 0.000 0.000 0.169 0.000 0.000
+902.225 0.000 0.000 0.000 0.166 0.000 0.000
+902.555 0.000 0.000 0.000 0.162 0.000 0.000
+902.885 0.000 0.000 0.000 0.159 0.000 0.000
+903.215 0.000 0.000 0.000 0.156 0.000 0.000
+903.545 0.000 0.000 0.000 0.153 0.000 0.000
+903.875 0.000 0.000 0.000 0.148 0.000 0.000
+904.205 0.000 0.000 0.000 0.143 0.000 0.000
+904.535 0.000 0.000 0.000 0.138 0.000 0.000
+904.865 0.000 0.000 0.000 0.133 0.000 0.000
+905.195 0.000 0.000 0.000 0.128 0.000 0.000
+905.525 0.000 0.000 0.000 0.123 0.000 0.000
+905.855 0.000 0.000 0.000 0.119 0.000 0.000
+906.185 0.000 0.000 0.000 0.116 0.000 0.000
+906.515 0.000 0.000 0.000 0.112 0.000 0.000
+906.845 0.000 0.000 0.000 0.109 0.000 0.000
+907.175 0.000 0.000 0.000 0.105 0.000 0.000
+907.505 0.000 0.000 0.000 0.102 0.000 0.000
+907.835 0.000 0.000 0.000 0.098 0.000 0.000
+908.165 0.000 0.000 0.000 0.095 0.000 0.000
+908.495 0.000 0.000 0.000 0.092 0.000 0.000
+908.825 0.000 0.000 0.000 0.088 0.000 0.000
+909.155 0.000 0.000 0.000 0.085 0.000 0.000
+909.485 0.000 0.000 0.000 0.081 0.000 0.000
+909.815 0.000 0.000 0.000 0.079 0.000 0.000
+910.145 0.000 0.000 0.000 0.078 0.000 0.000
+910.475 0.000 0.000 0.000 0.076 0.000 0.000
+910.805 0.000 0.000 0.000 0.075 0.000 0.000
+911.135 0.000 0.000 0.000 0.073 0.000 0.000
+911.465 0.000 0.000 0.000 0.072 0.000 0.000
+911.795 0.000 0.000 0.000 0.070 0.000 0.000
+912.125 0.000 0.000 0.000 0.069 0.000 0.000
+912.455 0.000 0.000 0.000 0.067 0.000 0.000
+912.785 0.000 0.000 0.000 0.066 0.000 0.000
+913.115 0.000 0.000 0.000 0.064 0.000 0.000
+913.445 0.000 0.000 0.000 0.063 0.000 0.000
+913.775 0.000 0.000 0.000 0.061 0.000 0.000
+914.105 0.000 0.000 0.000 0.060 0.000 0.000
+914.435 0.000 0.000 0.000 0.058 0.000 0.000
+914.765 0.000 0.000 0.000 0.056 0.000 0.000
+915.095 0.000 0.000 0.000 0.054 0.000 0.000
+915.425 0.000 0.000 0.000 0.052 0.000 0.000
+915.755 0.000 0.000 0.000 0.050 0.000 0.000
+916.085 0.000 0.000 0.000 0.048 0.000 0.000
+916.415 0.000 0.000 0.000 0.046 0.000 0.000
+916.745 0.000 0.000 0.000 0.044 0.000 0.000
+917.075 0.000 0.000 0.000 0.042 0.000 0.000
+917.405 0.000 0.000 0.000 0.040 0.000 0.000
+917.735 0.000 0.000 0.000 0.038 0.000 0.000
+918.065 0.000 0.000 0.000 0.036 0.000 0.000
+918.395 0.000 0.000 0.000 0.034 0.000 0.000
+918.725 0.000 0.000 0.000 0.032 0.000 0.000
+919.055 0.000 0.000 0.000 0.030 0.000 0.000
+919.385 0.000 0.000 0.000 0.028 0.000 0.000
+919.715 0.000 0.000 0.000 0.027 0.000 0.000
+920.045 0.000 0.000 0.000 0.026 0.000 0.000
+920.375 0.000 0.000 0.000 0.026 0.000 0.000
+920.705 0.000 0.000 0.000 0.025 0.000 0.000
+921.035 0.000 0.000 0.000 0.024 0.000 0.000
+921.365 0.000 0.000 0.000 0.024 0.000 0.000
+921.695 0.000 0.000 0.000 0.023 0.000 0.000
+922.025 0.000 0.000 0.000 0.023 0.000 0.000
+922.355 0.000 0.000 0.000 0.022 0.000 0.000
+922.685 0.000 0.000 0.000 0.022 0.000 0.000
+923.015 0.000 0.000 0.000 0.021 0.000 0.000
+923.345 0.000 0.000 0.000 0.021 0.000 0.000
+923.675 0.000 0.000 0.000 0.020 0.000 0.000
+924.005 0.000 0.000 0.000 0.020 0.000 0.000
+924.335 0.000 0.000 0.000 0.019 0.000 0.000
+924.665 0.000 0.000 0.000 0.019 0.000 0.000
+924.995 0.000 0.000 0.000 0.018 0.000 0.000
+925.325 0.000 0.000 0.000 0.017 0.000 0.000
+925.655 0.000 0.000 0.000 0.017 0.000 0.000
+925.985 0.000 0.000 0.000 0.016 0.000 0.000
+926.315 0.000 0.000 0.000 0.016 0.000 0.000
+926.645 0.000 0.000 0.000 0.015 0.000 0.000
+926.975 0.000 0.000 0.000 0.015 0.000 0.000
+927.305 0.000 0.000 0.000 0.015 0.000 0.000
+927.635 0.000 0.000 0.000 0.014 0.000 0.000
+927.965 0.000 0.000 0.000 0.014 0.000 0.000
+928.295 0.000 0.000 0.000 0.014 0.000 0.000
+928.625 0.000 0.000 0.000 0.014 0.000 0.000
+928.955 0.000 0.000 0.000 0.013 0.000 0.000
+929.285 0.000 0.000 0.000 0.013 0.000 0.000
+929.615 0.000 0.000 0.000 0.013 0.000 0.000
+929.945 0.000 0.000 0.000 0.013 0.000 0.000
+930.275 0.000 0.000 0.000 0.012 0.000 0.000
+930.605 0.000 0.000 0.000 0.012 0.000 0.000
+930.935 0.000 0.000 0.000 0.012 0.000 0.000
+931.265 0.000 0.000 0.000 0.011 0.000 0.000
+931.595 0.000 0.000 0.000 0.011 0.000 0.000
+931.925 0.000 0.000 0.000 0.011 0.000 0.000
+932.255 0.000 0.000 0.000 0.011 0.000 0.000
+932.585 0.000 0.000 0.000 0.010 0.000 0.000
+932.915 0.000 0.000 0.000 0.010 0.000 0.000
+933.245 0.000 0.000 0.000 0.010 0.000 0.000
+933.575 0.000 0.000 0.000 0.009 0.000 0.000
+933.905 0.000 0.000 0.000 0.009 0.000 0.000
+934.235 0.000 0.000 0.000 0.009 0.000 0.000
+934.565 0.000 0.000 0.000 0.009 0.000 0.000
+934.895 0.000 0.000 0.000 0.008 0.000 0.000
+935.225 0.000 0.000 0.000 0.008 0.000 0.000
+935.555 0.000 0.000 0.000 0.008 0.000 0.000
+935.885 0.000 0.000 0.000 0.008 0.000 0.000
+936.215 0.000 0.000 0.000 0.007 0.000 0.000
+936.545 0.000 0.000 0.000 0.007 0.000 0.000
+936.875 0.000 0.000 0.000 0.007 0.000 0.000
+937.205 0.000 0.000 0.000 0.007 0.000 0.000
+937.535 0.000 0.000 0.000 0.006 0.000 0.000
+937.865 0.000 0.000 0.000 0.006 0.000 0.000
+938.195 0.000 0.000 0.000 0.006 0.000 0.000
+938.525 0.000 0.000 0.000 0.006 0.000 0.000
+938.855 0.000 0.000 0.000 0.005 0.000 0.000
+939.185 0.000 0.000 0.000 0.005 0.000 0.000
+939.515 0.000 0.000 0.000 0.005 0.000 0.000
+939.845 0.000 0.000 0.000 0.005 0.000 0.000
+940.175 0.000 0.000 0.000 0.005 0.000 0.000
+940.505 0.000 0.000 0.000 0.004 0.000 0.000
+940.835 0.000 0.000 0.000 0.004 0.000 0.000
+941.165 0.000 0.000 0.000 0.004 0.000 0.000
+941.495 0.000 0.000 0.000 0.004 0.000 0.000
+941.825 0.000 0.000 0.000 0.003 0.000 0.000
+942.155 0.000 0.000 0.000 0.003 0.000 0.000
+942.485 0.000 0.000 0.000 0.003 0.000 0.000
+942.815 0.000 0.000 0.000 0.003 0.000 0.000
+943.145 0.000 0.000 0.000 0.002 0.000 0.000
+943.475 0.000 0.000 0.000 0.002 0.000 0.000
+943.805 0.000 0.000 0.000 0.002 0.000 0.000
+944.135 0.000 0.000 0.000 0.002 0.000 0.000
+944.465 0.000 0.000 0.000 0.002 0.000 0.000
+944.795 0.000 0.000 0.000 0.001 0.000 0.000
+945.125 0.000 0.000 0.000 0.001 0.000 0.000
+945.455 0.000 0.000 0.000 0.001 0.000 0.000
+945.785 0.000 0.000 0.000 0.001 0.000 0.000
+946.115 0.000 0.000 0.000 0.000 0.000 0.000
+946.445 0.000 0.000 0.000 0.000 0.000 0.000
+946.775 0.000 0.000 0.000 0.000 0.000 0.000
+947.105 0.000 0.000 0.000 0.000 0.000 0.000
+947.435 0.000 0.000 0.000 0.000 0.000 0.000
+947.765 0.000 0.000 0.000 0.000 0.000 0.000
+948.095 0.000 0.000 0.000 0.000 0.000 0.000
+948.425 0.000 0.000 0.000 0.000 0.000 0.000
+948.755 0.000 0.000 0.000 0.000 0.000 0.000
+949.085 0.000 0.000 0.000 0.000 0.000 0.000
+949.415 0.000 0.000 0.000 0.000 0.000 0.000
+949.745 0.000 0.000 0.000 0.000 0.000 0.000
+950.075 0.000 0.000 0.000 0.000 0.000 0.000
+950.405 0.000 0.000 0.000 0.000 0.000 0.000
+950.735 0.000 0.000 0.000 0.000 0.000 0.000
+951.065 0.000 0.000 0.000 0.000 0.000 0.000
+951.395 0.000 0.000 0.000 0.000 0.000 0.000
+951.725 0.000 0.000 0.000 0.000 0.000 0.000
+952.055 0.000 0.000 0.000 0.000 0.000 0.000
+952.385 0.000 0.000 0.000 0.000 0.000 0.000
+952.715 0.000 0.000 0.000 0.000 0.000 0.000
+953.045 0.000 0.000 0.000 0.000 0.000 0.000
+953.375 0.000 0.000 0.000 0.000 0.000 0.000
+953.705 0.000 0.000 0.000 0.000 0.000 0.000
+954.035 0.000 0.000 0.000 0.000 0.000 0.000
+954.365 0.000 0.000 0.000 0.000 0.000 0.000
+954.695 0.000 0.000 0.000 0.000 0.000 0.000
+955.025 0.000 0.000 0.000 0.000 0.000 0.000
+955.355 0.000 0.000 0.000 0.000 0.000 0.000
+955.685 0.000 0.000 0.000 0.000 0.000 0.000
+956.015 0.000 0.000 0.000 0.000 0.000 0.000
+956.345 0.000 0.000 0.000 0.000 0.000 0.000
+956.675 0.000 0.000 0.000 0.000 0.000 0.000
+957.005 0.000 0.000 0.000 0.000 0.000 0.000
+957.335 0.000 0.000 0.000 0.000 0.000 0.000
+957.665 0.000 0.000 0.000 0.000 0.000 0.000
+957.995 0.000 0.000 0.000 0.000 0.000 0.000
+958.325 0.000 0.000 0.000 0.000 0.000 0.000
+958.655 0.000 0.000 0.000 0.000 0.000 0.000
+958.985 0.000 0.000 0.000 0.000 0.000 0.000
+959.315 0.000 0.000 0.000 0.000 0.000 0.000
+959.645 0.000 0.000 0.000 0.000 0.000 0.000
+959.975 0.000 0.000 0.000 0.000 0.000 0.000
+960.305 0.000 0.000 0.000 0.000 0.000 0.000
+960.635 0.000 0.000 0.000 0.000 0.000 0.000
+960.965 0.000 0.000 0.000 0.000 0.000 0.000
+961.295 0.000 0.000 0.000 0.000 0.000 0.000
+961.625 0.000 0.000 0.000 0.000 0.000 0.000
+961.955 0.000 0.000 0.000 0.000 0.000 0.000
+962.285 0.000 0.000 0.000 0.000 0.000 0.000
+962.615 0.000 0.000 0.000 0.000 0.000 0.000
+962.945 0.000 0.000 0.000 0.000 0.000 0.000
+963.275 0.000 0.000 0.000 0.000 0.000 0.000
+963.605 0.000 0.000 0.000 0.000 0.000 0.000
+963.935 0.000 0.000 0.000 0.000 0.000 0.000
+964.265 0.000 0.000 0.000 0.000 0.000 0.000
+964.595 0.000 0.000 0.000 0.000 0.000 0.000
+964.925 0.000 0.000 0.000 0.000 0.000 0.000
+965.255 0.000 0.000 0.000 0.000 0.000 0.000
+965.585 0.000 0.000 0.000 0.000 0.000 0.000
+965.915 0.000 0.000 0.000 0.000 0.000 0.000
+966.245 0.000 0.000 0.000 0.000 0.000 0.000
+966.575 0.000 0.000 0.000 0.000 0.000 0.000
+966.905 0.000 0.000 0.000 0.000 0.000 0.000
+967.235 0.000 0.000 0.000 0.000 0.000 0.000
+967.565 0.000 0.000 0.000 0.000 0.000 0.000
+967.895 0.000 0.000 0.000 0.000 0.000 0.000
+968.225 0.000 0.000 0.000 0.000 0.000 0.000
+968.555 0.000 0.000 0.000 0.000 0.000 0.000
+968.885 0.000 0.000 0.000 0.000 0.000 0.000
+969.215 0.000 0.000 0.000 0.000 0.000 0.000
+969.545 0.000 0.000 0.000 0.000 0.000 0.000
+969.875 0.000 0.000 0.000 0.000 0.000 0.000
+970.205 0.000 0.000 0.000 0.000 0.000 0.000
+970.535 0.000 0.000 0.000 0.000 0.000 0.000
+970.865 0.000 0.000 0.000 0.000 0.000 0.000
+971.195 0.000 0.000 0.000 0.000 0.000 0.000
+971.525 0.000 0.000 0.000 0.000 0.000 0.000
+971.855 0.000 0.000 0.000 0.000 0.000 0.000
+972.185 0.000 0.000 0.000 0.000 0.000 0.000
+972.515 0.000 0.000 0.000 0.000 0.000 0.000
+972.845 0.000 0.000 0.000 0.000 0.000 0.000
+973.175 0.000 0.000 0.000 0.000 0.000 0.000
+973.505 0.000 0.000 0.000 0.000 0.000 0.000
+973.835 0.000 0.000 0.000 0.000 0.000 0.000
+974.165 0.000 0.000 0.000 0.000 0.000 0.000
+974.495 0.000 0.000 0.000 0.000 0.000 0.000
+974.825 0.000 0.000 0.000 0.000 0.000 0.000
+975.155 0.000 0.000 0.000 0.000 0.000 0.000
+975.485 0.000 0.000 0.000 0.000 0.000 0.000
+975.815 0.000 0.000 0.000 0.000 0.000 0.000
+976.145 0.000 0.000 0.000 0.000 0.000 0.000
+976.475 0.000 0.000 0.000 0.000 0.000 0.000
+976.805 0.000 0.000 0.000 0.000 0.000 0.000
+977.135 0.000 0.000 0.000 0.000 0.000 0.000
+977.465 0.000 0.000 0.000 0.000 0.000 0.000
+977.795 0.000 0.000 0.000 0.000 0.000 0.000
+978.125 0.000 0.000 0.000 0.000 0.000 0.000
+978.455 0.000 0.000 0.000 0.000 0.000 0.000
+978.785 0.000 0.000 0.000 0.000 0.000 0.000
+979.115 0.000 0.000 0.000 0.000 0.000 0.000
+979.445 0.000 0.000 0.000 0.000 0.000 0.000
+979.775 0.000 0.000 0.000 0.000 0.000 0.000
+980.105 0.000 0.000 0.000 0.000 0.000 0.000
+980.435 0.000 0.000 0.000 0.000 0.000 0.000
+980.765 0.000 0.000 0.000 0.000 0.000 0.000
+981.095 0.000 0.000 0.000 0.000 0.000 0.000
+981.425 0.000 0.000 0.000 0.000 0.000 0.000
+981.755 0.000 0.000 0.000 0.000 0.000 0.000
+982.085 0.000 0.000 0.000 0.000 0.000 0.000
+982.415 0.000 0.000 0.000 0.000 0.000 0.000
+982.745 0.000 0.000 0.000 0.000 0.000 0.000
+983.075 0.000 0.000 0.000 0.000 0.000 0.000
+983.405 0.000 0.000 0.000 0.000 0.000 0.000
+983.735 0.000 0.000 0.000 0.000 0.000 0.000
+984.065 0.000 0.000 0.000 0.000 0.000 0.000
+984.395 0.000 0.000 0.000 0.000 0.000 0.000
+984.725 0.000 0.000 0.000 0.000 0.000 0.000
+985.055 0.000 0.000 0.000 0.000 0.000 0.000
+985.385 0.000 0.000 0.000 0.000 0.000 0.000
+985.715 0.000 0.000 0.000 0.000 0.000 0.000
+986.045 0.000 0.000 0.000 0.000 0.000 0.000
+986.375 0.000 0.000 0.000 0.000 0.000 0.000
+986.705 0.000 0.000 0.000 0.000 0.000 0.000
+987.035 0.000 0.000 0.000 0.000 0.000 0.000
+987.365 0.000 0.000 0.000 0.000 0.000 0.000
+987.695 0.000 0.000 0.000 0.000 0.000 0.000
+988.025 0.000 0.000 0.000 0.000 0.000 0.000
+988.355 0.000 0.000 0.000 0.000 0.000 0.000
+988.685 0.000 0.000 0.000 0.000 0.000 0.000
+989.015 0.000 0.000 0.000 0.000 0.000 0.000
+989.345 0.000 0.000 0.000 0.000 0.000 0.000
+989.675 0.000 0.000 0.000 0.000 0.000 0.000
+990.005 0.000 0.000 0.000 0.000 0.000 0.000
+990.335 0.000 0.000 0.000 0.000 0.000 0.000
+990.665 0.000 0.000 0.000 0.000 0.000 0.000
+990.995 0.000 0.000 0.000 0.000 0.000 0.000
+991.325 0.000 0.000 0.000 0.000 0.000 0.000
+991.655 0.000 0.000 0.000 0.000 0.000 0.000
+991.985 0.000 0.000 0.000 0.000 0.000 0.000
+992.315 0.000 0.000 0.000 0.000 0.000 0.000
+992.645 0.000 0.000 0.000 0.000 0.000 0.000
+992.975 0.000 0.000 0.000 0.000 0.000 0.000
+993.305 0.000 0.000 0.000 0.000 0.000 0.000
+993.635 0.000 0.000 0.000 0.000 0.000 0.000
+993.965 0.000 0.000 0.000 0.000 0.000 0.000
+994.295 0.000 0.000 0.000 0.000 0.000 0.000
+994.625 0.000 0.000 0.000 0.000 0.000 0.000
+994.955 0.000 0.000 0.000 0.000 0.000 0.000
+995.285 0.000 0.000 0.000 0.000 0.000 0.000
+995.615 0.000 0.000 0.000 0.000 0.000 0.000
+995.945 0.000 0.000 0.000 0.000 0.000 0.000
+996.275 0.000 0.000 0.000 0.000 0.000 0.000
+996.605 0.000 0.000 0.000 0.000 0.000 0.000
+996.935 0.000 0.000 0.000 0.000 0.000 0.000
+997.265 0.000 0.000 0.000 0.000 0.000 0.000
+997.595 0.000 0.000 0.000 0.000 0.000 0.000
+997.925 0.000 0.000 0.000 0.000 0.000 0.000
+998.255 0.000 0.000 0.000 0.000 0.000 0.000
+998.585 0.000 0.000 0.000 0.000 0.000 0.000
+998.915 0.000 0.000 0.000 0.000 0.000 0.000
+999.245 0.000 0.000 0.000 0.000 0.000 0.000
+999.575 0.000 0.000 0.000 0.000 0.000 0.000
+999.905 0.000 0.000 0.000 0.000 0.000 0.000
+1000.235 0.000 0.000 0.000 0.000 0.000 0.000
+1000.565 0.000 0.000 0.000 0.000 0.000 0.000
+1000.895 0.000 0.000 0.000 0.000 0.000 0.000
+1001.225 0.000 0.000 0.000 0.000 0.000 0.000
+1001.555 0.000 0.000 0.000 0.000 0.000 0.000
+1001.885 0.000 0.000 0.000 0.000 0.000 0.000
+1002.215 0.000 0.000 0.000 0.000 0.000 0.000
+1002.545 0.000 0.000 0.000 0.000 0.000 0.000
+1002.875 0.000 0.000 0.000 0.000 0.000 0.000
+1003.205 0.000 0.000 0.000 0.000 0.000 0.000
+1003.535 0.000 0.000 0.000 0.000 0.000 0.000
+1003.865 0.000 0.000 0.000 0.000 0.000 0.000
+1004.195 0.000 0.000 0.000 0.000 0.000 0.000
+1004.525 0.000 0.000 0.000 0.000 0.000 0.000
+1004.855 0.000 0.000 0.000 0.000 0.000 0.000
+1005.185 0.000 0.000 0.000 0.000 0.000 0.000
+1005.515 0.000 0.000 0.000 0.000 0.000 0.000
+1005.845 0.000 0.000 0.000 0.000 0.000 0.000
+1006.175 0.000 0.000 0.000 0.000 0.000 0.000
+1006.505 0.000 0.000 0.000 0.000 0.000 0.000
+1006.835 0.000 0.000 0.000 0.000 0.000 0.000
+1007.165 0.000 0.000 0.000 0.000 0.000 0.000
+1007.495 0.000 0.000 0.000 0.000 0.000 0.000
+1007.825 0.000 0.000 0.000 0.000 0.000 0.000
+1008.155 0.000 0.000 0.000 0.000 0.000 0.000
+1008.485 0.000 0.000 0.000 0.000 0.000 0.000
+1008.815 0.000 0.000 0.000 0.000 0.000 0.000
+1009.145 0.000 0.000 0.000 0.000 0.000 0.000
+1009.475 0.000 0.000 0.000 0.000 0.000 0.000
+1009.805 0.000 0.000 0.000 0.000 0.000 0.000
+1010.135 0.000 0.000 0.000 0.000 0.000 0.000
+1010.465 0.000 0.000 0.000 0.000 0.000 0.000
+1010.795 0.000 0.000 0.000 0.000 0.000 0.000
+1011.125 0.000 0.000 0.000 0.000 0.000 0.000
+1011.455 0.000 0.000 0.000 0.000 0.000 0.000
+1011.785 0.000 0.000 0.000 0.000 0.000 0.000
+1012.115 0.000 0.000 0.000 0.000 0.000 0.000
+1012.445 0.000 0.000 0.000 0.000 0.000 0.000
+1012.775 0.000 0.000 0.000 0.000 0.000 0.000
+1013.105 0.000 0.000 0.000 0.000 0.000 0.000
+1013.435 0.000 0.000 0.000 0.000 0.000 0.000
+1013.765 0.000 0.000 0.000 0.000 0.000 0.000
+1014.095 0.000 0.000 0.000 0.000 0.000 0.000
+1014.425 0.000 0.000 0.000 0.000 0.000 0.000
+1014.755 0.000 0.000 0.000 0.000 0.000 0.000
+1015.085 0.000 0.000 0.000 0.000 0.000 0.000
+1015.415 0.000 0.000 0.000 0.000 0.000 0.000
+1015.745 0.000 0.000 0.000 0.000 0.000 0.000
+1016.075 0.000 0.000 0.000 0.000 0.000 0.000
+1016.405 0.000 0.000 0.000 0.000 0.000 0.000
+1016.735 0.000 0.000 0.000 0.000 0.000 0.000
+1017.065 0.000 0.000 0.000 0.000 0.000 0.000
+1017.395 0.000 0.000 0.000 0.000 0.000 0.000
+1017.725 0.000 0.000 0.000 0.000 0.000 0.000
+1018.055 0.000 0.000 0.000 0.000 0.000 0.000
+1018.385 0.000 0.000 0.000 0.000 0.000 0.000
+1018.715 0.000 0.000 0.000 0.000 0.000 0.000
+1019.045 0.000 0.000 0.000 0.000 0.000 0.000
+1019.375 0.000 0.000 0.000 0.000 0.000 0.000
+1019.705 0.000 0.000 0.000 0.000 0.000 0.000
+1020.035 0.000 0.000 0.000 0.000 0.000 0.000
+1020.365 0.000 0.000 0.000 0.000 0.000 0.000
+1020.695 0.000 0.000 0.000 0.000 0.000 0.000
+1021.025 0.000 0.000 0.000 0.000 0.000 0.000
+1021.355 0.000 0.000 0.000 0.000 0.000 0.000
+1021.685 0.000 0.000 0.000 0.000 0.000 0.000
+1022.015 0.000 0.000 0.000 0.000 0.000 0.000
+1022.345 0.000 0.000 0.000 0.000 0.000 0.000
+1022.675 0.000 0.000 0.000 0.000 0.000 0.000
+1023.005 0.000 0.000 0.000 0.000 0.000 0.000
+1023.335 0.000 0.000 0.000 0.000 0.000 0.000
+1023.665 0.000 0.000 0.000 0.000 0.000 0.000
+1023.995 0.000 0.000 0.000 0.000 0.000 0.000
+1024.325 0.000 0.000 0.000 0.000 0.000 0.000
+1024.655 0.000 0.000 0.000 0.000 0.000 0.000
+1024.985 0.000 0.000 0.000 0.000 0.000 0.000
+1025.315 0.000 0.000 0.000 0.000 0.000 0.000
+1025.645 0.000 0.000 0.000 0.000 0.000 0.000
+1025.975 0.000 0.000 0.000 0.000 0.000 0.000
+1026.305 0.000 0.000 0.000 0.000 0.000 0.000
+1026.635 0.000 0.000 0.000 0.000 0.000 0.000
+1026.965 0.000 0.000 0.000 0.000 0.000 0.000
+1027.295 0.000 0.000 0.000 0.000 0.000 0.000
+1027.625 0.000 0.000 0.000 0.000 0.000 0.000
+1027.955 0.000 0.000 0.000 0.000 0.000 0.000
+1028.285 0.000 0.000 0.000 0.000 0.000 0.000
+1028.615 0.000 0.000 0.000 0.000 0.000 0.000
+1028.945 0.000 0.000 0.000 0.000 0.000 0.000
+1029.275 0.000 0.000 0.000 0.000 0.000 0.000
+1029.605 0.000 0.000 0.000 0.000 0.000 0.000
+1029.935 0.000 0.000 0.000 0.000 0.000 0.000
+1030.265 0.000 0.000 0.000 0.000 0.000 0.000
+1030.595 0.000 0.000 0.000 0.000 0.000 0.000
+1030.925 0.000 0.000 0.000 0.000 0.000 0.000
+1031.255 0.000 0.000 0.000 0.000 0.000 0.000
+1031.585 0.000 0.000 0.000 0.000 0.000 0.000
+1031.915 0.000 0.000 0.000 0.000 0.000 0.000
+1032.245 0.000 0.000 0.000 0.000 0.000 0.000
+1032.575 0.000 0.000 0.000 0.000 0.000 0.000
+1032.905 0.000 0.000 0.000 0.000 0.000 0.000
+1033.235 0.000 0.000 0.000 0.000 0.000 0.000
+1033.565 0.000 0.000 0.000 0.000 0.000 0.000
+1033.895 0.000 0.000 0.000 0.000 0.000 0.000
+1034.225 0.000 0.000 0.000 0.000 0.000 0.000
+1034.555 0.000 0.000 0.000 0.000 0.000 0.000
+1034.885 0.000 0.000 0.000 0.000 0.000 0.000
+1035.215 0.000 0.000 0.000 0.000 0.000 0.000
+1035.545 0.000 0.000 0.000 0.000 0.000 0.000
+1035.875 0.000 0.000 0.000 0.000 0.000 0.000
+1036.205 0.000 0.000 0.000 0.000 0.000 0.000
+1036.535 0.000 0.000 0.000 0.000 0.000 0.000
+1036.865 0.000 0.000 0.000 0.000 0.000 0.000
+1037.195 0.000 0.000 0.000 0.000 0.000 0.000
diff --git a/examples/image_processing/resources/cbers2b_blue_crop.tif b/examples/image_processing/resources/cbers2b_blue_crop.tif
new file mode 100644
index 0000000..bf285f6
Binary files /dev/null and b/examples/image_processing/resources/cbers2b_blue_crop.tif differ
diff --git a/examples/image_processing/resources/cbers2b_green_crop.tif b/examples/image_processing/resources/cbers2b_green_crop.tif
new file mode 100644
index 0000000..cc201c1
Binary files /dev/null and b/examples/image_processing/resources/cbers2b_green_crop.tif differ
diff --git a/examples/image_processing/resources/cbers2b_red_crop.tif b/examples/image_processing/resources/cbers2b_red_crop.tif
new file mode 100644
index 0000000..ba9c6d8
Binary files /dev/null and b/examples/image_processing/resources/cbers2b_red_crop.tif differ
diff --git a/examples/image_processing/resources/cbers_b2_crop.tif b/examples/image_processing/resources/cbers_b2_crop.tif
old mode 100755
new mode 100644
diff --git a/examples/image_processing/resources/cbers_b2_crop_A.tif b/examples/image_processing/resources/cbers_b2_crop_A.tif
old mode 100755
new mode 100644
diff --git a/examples/image_processing/resources/cbers_b2_crop_B_contraste.tif b/examples/image_processing/resources/cbers_b2_crop_B_contraste.tif
old mode 100755
new mode 100644
diff --git a/examples/image_processing/resources/cbers_b2_crop_C.tif b/examples/image_processing/resources/cbers_b2_crop_C.tif
old mode 100755
new mode 100644
diff --git a/examples/image_processing/resources/cbers_b2_crop_contraste.tif b/examples/image_processing/resources/cbers_b2_crop_contraste.tif
old mode 100755
new mode 100644
diff --git a/examples/image_processing/resources/cbers_b2_crop_contraste_halfsampled.tif b/examples/image_processing/resources/cbers_b2_crop_contraste_halfsampled.tif
old mode 100755
new mode 100644
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1.tif b/examples/image_processing/resources/cbers_rgb342_crop1.tif
old mode 100755
new mode 100644
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip0_0.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip0_0.tif
new file mode 100644
index 0000000..ceacef2
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip0_0.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip0_250.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip0_250.tif
new file mode 100644
index 0000000..ce9bfee
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip0_250.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip0_500.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip0_500.tif
new file mode 100644
index 0000000..540ee29
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip0_500.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip0_750.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip0_750.tif
new file mode 100644
index 0000000..ed995a4
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip0_750.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip250_0.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip250_0.tif
new file mode 100644
index 0000000..37a69fd
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip250_0.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip250_250.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip250_250.tif
new file mode 100644
index 0000000..49a8c2d
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip250_250.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip250_500.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip250_500.tif
new file mode 100644
index 0000000..aa0d07c
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip250_500.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip250_750.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip250_750.tif
new file mode 100644
index 0000000..72e103a
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip250_750.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip500_0.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip500_0.tif
new file mode 100644
index 0000000..e6c47ba
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip500_0.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip500_250.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip500_250.tif
new file mode 100644
index 0000000..ec5811e
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip500_250.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip500_500.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip500_500.tif
new file mode 100644
index 0000000..33817dc
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip500_500.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_chip500_750.tif b/examples/image_processing/resources/cbers_rgb342_crop1_chip500_750.tif
new file mode 100644
index 0000000..630d5c5
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_chip500_750.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_cropA.tif b/examples/image_processing/resources/cbers_rgb342_crop1_cropA.tif
new file mode 100644
index 0000000..a295bf5
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_cropA.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_cropB.tif b/examples/image_processing/resources/cbers_rgb342_crop1_cropB.tif
new file mode 100644
index 0000000..96bb2f6
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_cropB.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_halfsampled.tif b/examples/image_processing/resources/cbers_rgb342_crop1_halfsampled.tif
index b3cf9b5..1b7c8f1 100644
Binary files a/examples/image_processing/resources/cbers_rgb342_crop1_halfsampled.tif and b/examples/image_processing/resources/cbers_rgb342_crop1_halfsampled.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_halfsampled_cropA.tif b/examples/image_processing/resources/cbers_rgb342_crop1_halfsampled_cropA.tif
new file mode 100644
index 0000000..2c590cb
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_halfsampled_cropA.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop1_halfsampled_cropB.tif b/examples/image_processing/resources/cbers_rgb342_crop1_halfsampled_cropB.tif
new file mode 100644
index 0000000..ccd8109
Binary files /dev/null and b/examples/image_processing/resources/cbers_rgb342_crop1_halfsampled_cropB.tif differ
diff --git a/examples/image_processing/resources/cbers_rgb342_crop2.tif b/examples/image_processing/resources/cbers_rgb342_crop2.tif
old mode 100755
new mode 100644
diff --git a/examples/image_processing/resources/cbers_rgb342_crop3.tif b/examples/image_processing/resources/cbers_rgb342_crop3.tif
old mode 100755
new mode 100644
diff --git a/examples/image_processing/resources/ikonos.srf b/examples/image_processing/resources/ikonos.srf
new file mode 100644
index 0000000..007461d
--- /dev/null
+++ b/examples/image_processing/resources/ikonos.srf
@@ -0,0 +1,139 @@
+138 5 5
+350 0.001 0.001 0.000 0.001 0.001
+355 0.001 0.001 0.001 0.001 0.001
+360 0.001 0.001 0.000 0.001 0.000
+365 0.001 0.001 0.001 0.001 0.000
+370 0.001 0.001 0.000 0.001 0.000
+375 0.001 0.001 0.001 0.001 0.001
+380 0.002 0.001 0.001 0.001 0.002
+385 0.002 0.001 0.000 0.002 0.005
+390 0.003 0.001 0.001 0.002 0.010
+395 0.005 0.001 0.002 0.004 0.017
+400 0.008 0.001 0.003 0.005 0.026
+405 0.009 0.003 0.004 0.008 0.038
+410 0.012 0.001 0.004 0.011 0.052
+415 0.017 0.001 0.004 0.021 0.066
+420 0.035 0.002 0.008 0.035 0.083
+425 0.085 0.003 0.008 0.045 0.101
+430 0.193 0.003 0.008 0.037 0.124
+435 0.331 0.004 0.005 0.018 0.148
+440 0.419 0.006 0.003 0.016 0.170
+445 0.508 0.009 0.004 0.018 0.193
+450 0.613 0.011 0.005 0.017 0.205
+455 0.674 0.011 0.005 0.017 0.245
+460 0.720 0.013 0.003 0.019 0.261
+465 0.761 0.017 0.002 0.014 0.282
+470 0.760 0.024 0.002 0.010 0.301
+475 0.788 0.037 0.004 0.015 0.318
+480 0.857 0.050 0.004 0.022 0.324
+485 0.889 0.063 0.003 0.027 0.334
+490 0.944 0.109 0.002 0.027 0.343
+495 1.000 0.193 0.001 0.017 0.351
+500 0.987 0.291 0.001 0.007 0.359
+505 0.926 0.440 0.002 0.005 0.375
+510 0.761 0.651 0.002 0.006 0.392
+515 0.542 0.807 0.002 0.004 0.424
+520 0.314 0.872 0.003 0.003 0.456
+525 0.204 0.888 0.003 0.002 0.489
+530 0.152 0.890 0.003 0.003 0.529
+535 0.086 0.875 0.003 0.006 0.569
+540 0.043 0.852 0.004 0.011 0.616
+545 0.031 0.892 0.006 0.013 0.662
+550 0.027 0.998 0.007 0.009 0.699
+555 0.022 0.966 0.009 0.007 0.743
+560 0.022 0.908 0.009 0.007 0.786
+565 0.026 0.893 0.009 0.007 0.825
+570 0.030 0.946 0.010 0.009 0.863
+575 0.027 0.997 0.010 0.013 0.901
+580 0.023 0.960 0.013 0.012 0.945
+585 0.025 0.877 0.020 0.007 0.953
+590 0.031 0.750 0.028 0.004 0.969
+595 0.027 0.502 0.035 0.003 0.978
+600 0.021 0.283 0.043 0.003 0.967
+605 0.022 0.160 0.058 0.003 0.994
+610 0.030 0.107 0.085 0.004 0.993
+615 0.034 0.082 0.125 0.004 0.984
+620 0.027 0.064 0.176 0.004 1.000
+625 0.019 0.047 0.258 0.005 0.993
+630 0.019 0.032 0.419 0.005 1.000
+635 0.019 0.023 0.638 0.005 0.987
+640 0.014 0.017 0.805 0.007 0.973
+645 0.007 0.014 0.878 0.007 0.942
+650 0.006 0.015 0.920 0.008 0.937
+655 0.005 0.016 0.953 0.012 0.903
+660 0.008 0.019 0.956 0.017 0.887
+665 0.012 0.020 0.929 0.019 0.869
+670 0.020 0.019 0.939 0.021 0.884
+675 0.022 0.015 0.987 0.022 0.883
+680 0.021 0.013 0.997 0.023 0.884
+685 0.019 0.012 0.908 0.025 0.895
+690 0.015 0.011 0.770 0.025 0.897
+695 0.010 0.014 0.592 0.027 0.926
+700 0.007 0.017 0.422 0.028 0.923
+705 0.005 0.018 0.305 0.035 0.908
+710 0.005 0.016 0.226 0.044 0.901
+715 0.012 0.011 0.158 0.054 0.905
+720 0.022 0.006 0.105 0.076 0.900
+725 0.024 0.006 0.067 0.105 0.887
+730 0.012 0.003 0.045 0.147 0.893
+735 0.004 0.004 0.030 0.197 0.887
+740 0.002 0.004 0.024 0.259 0.898
+745 0.003 0.003 0.022 0.309 0.911
+750 0.002 0.003 0.018 0.357 0.944
+755 0.003 0.002 0.016 0.444 0.959
+760 0.002 0.003 0.016 0.565 0.935
+765 0.002 0.004 0.016 0.701 0.958
+770 0.004 0.005 0.016 0.837 0.974
+775 0.004 0.007 0.017 0.943 0.974
+780 0.003 0.007 0.016 1.000 0.968
+785 0.002 0.009 0.012 0.996 0.959
+790 0.003 0.010 0.009 0.931 0.950
+795 0.002 0.008 0.007 0.832 0.915
+800 0.002 0.007 0.006 0.791 0.898
+805 0.002 0.006 0.006 0.773 0.913
+810 0.002 0.006 0.004 0.763 0.935
+815 0.002 0.006 0.004 0.709 0.928
+820 0.003 0.005 0.005 0.706 0.940
+825 0.004 0.006 0.004 0.690 0.907
+830 0.006 0.007 0.004 0.656 0.922
+835 0.007 0.007 0.003 0.622 0.936
+840 0.008 0.007 0.003 0.581 0.951
+845 0.008 0.009 0.003 0.534 0.945
+850 0.009 0.013 0.003 0.515 0.953
+855 0.008 0.014 0.003 0.488 0.923
+860 0.009 0.016 0.003 0.418 0.919
+865 0.009 0.017 0.003 0.322 0.861
+870 0.011 0.017 0.003 0.249 0.874
+875 0.013 0.016 0.003 0.171 0.827
+880 0.013 0.015 0.003 0.114 0.809
+885 0.013 0.013 0.003 0.071 0.792
+890 0.012 0.012 0.002 0.058 0.762
+895 0.011 0.011 0.002 0.044 0.749
+900 0.009 0.010 0.002 0.027 0.707
+905 0.009 0.009 0.003 0.019 0.687
+910 0.008 0.010 0.003 0.016 0.681
+915 0.008 0.009 0.003 0.013 0.669
+920 0.008 0.008 0.004 0.011 0.614
+925 0.008 0.008 0.004 0.010 0.578
+930 0.008 0.008 0.004 0.009 0.556
+935 0.008 0.007 0.003 0.007 0.516
+940 0.008 0.006 0.003 0.006 0.481
+945 0.007 0.005 0.002 0.005 0.471
+950 0.005 0.005 0.002 0.005 0.434
+955 0.005 0.004 0.001 0.004 0.396
+960 0.004 0.004 0.001 0.004 0.352
+965 0.004 0.003 0.001 0.004 0.337
+970 0.004 0.003 0.001 0.003 0.309
+975 0.003 0.003 0.001 0.003 0.284
+980 0.003 0.003 0.001 0.003 0.271
+985 0.003 0.002 0.001 0.004 0.249
+990 0.003 0.002 0.002 0.003 0.237
+995 0.002 0.002 0.001 0.003 0.216
+1000 0.002 0.003 0.001 0.003 0.195
+1005 0.003 0.002 0.001 0.004 0.180
+1010 0.003 0.002 0.003 0.004 0.164
+1015 0.003 0.002 0.002 0.002 0.149
+1020 0.002 0.002 0.002 0.002 0.136
+1025 0.002 0.002 0.001 0.003 0.119
+1030 0.002 0.001 0.001 0.000 0.104
+1035 0.001 0.002 0.000 0.000 0.089
diff --git a/examples/image_processing/resources/pattern1.tif b/examples/image_processing/resources/pattern1.tif
new file mode 100644
index 0000000..0112c29
Binary files /dev/null and b/examples/image_processing/resources/pattern1.tif differ
diff --git a/examples/image_processing/resources/quickbird.srf b/examples/image_processing/resources/quickbird.srf
new file mode 100644
index 0000000..76a9fad
--- /dev/null
+++ b/examples/image_processing/resources/quickbird.srf
@@ -0,0 +1,162 @@
+161 5 5
+300 0.000 0.000 0.000 0.000 0.000
+305 0.000 0.000 0.000 0.000 0.000
+310 0.000 0.000 0.000 0.000 0.000
+315 0.000 0.000 0.000 0.000 0.000
+320 0.000 0.000 0.000 0.000 0.000
+325 0.001 0.000 0.000 0.002 0.000
+330 0.002 0.000 0.000 0.003 0.000
+335 0.003 0.000 0.000 0.005 0.000
+340 0.004 0.000 0.000 0.006 0.000
+345 0.004 0.000 0.000 0.006 0.000
+350 0.005 0.003 0.005 0.006 0.001
+355 0.004 0.004 0.003 0.005 0.001
+360 0.003 0.002 0.002 0.003 0.001
+365 0.002 0.002 0.002 0.002 0.001
+370 0.002 0.001 0.001 0.002 0.001
+375 0.001 0.001 0.001 0.002 0.002
+380 0.002 0.001 0.001 0.002 0.005
+385 0.002 0.001 0.001 0.002 0.008
+390 0.002 0.001 0.001 0.001 0.013
+395 0.002 0.001 0.001 0.002 0.019
+400 0.002 0.001 0.001 0.002 0.027
+405 0.002 0.001 0.001 0.001 0.037
+410 0.003 0.001 0.001 0.001 0.048
+415 0.005 0.001 0.001 0.002 0.060
+420 0.010 0.002 0.001 0.001 0.073
+425 0.021 0.002 0.001 0.002 0.085
+430 0.049 0.002 0.002 0.002 0.100
+435 0.110 0.003 0.002 0.003 0.115
+440 0.195 0.005 0.003 0.003 0.127
+445 0.300 0.008 0.003 0.004 0.141
+450 0.433 0.014 0.003 0.004 0.145
+455 0.492 0.019 0.003 0.004 0.168
+460 0.532 0.024 0.003 0.003 0.177
+465 0.561 0.032 0.003 0.003 0.188
+470 0.585 0.046 0.003 0.004 0.199
+475 0.598 0.074 0.003 0.004 0.210
+480 0.599 0.117 0.002 0.004 0.213
+485 0.612 0.169 0.002 0.004 0.216
+490 0.631 0.234 0.002 0.003 0.218
+495 0.620 0.302 0.002 0.002 0.220
+500 0.568 0.378 0.003 0.002 0.224
+505 0.473 0.467 0.003 0.002 0.233
+510 0.348 0.541 0.003 0.002 0.240
+515 0.231 0.579 0.003 0.002 0.253
+520 0.158 0.582 0.004 0.002 0.266
+525 0.094 0.595 0.004 0.002 0.281
+530 0.048 0.614 0.005 0.003 0.299
+535 0.040 0.634 0.005 0.005 0.316
+540 0.036 0.652 0.005 0.006 0.336
+545 0.027 0.658 0.005 0.007 0.360
+550 0.017 0.648 0.006 0.005 0.379
+555 0.010 0.634 0.007 0.003 0.400
+560 0.007 0.621 0.008 0.003 0.418
+565 0.007 0.620 0.009 0.004 0.435
+570 0.007 0.621 0.010 0.005 0.448
+575 0.007 0.602 0.013 0.005 0.458
+580 0.006 0.555 0.018 0.004 0.472
+585 0.005 0.485 0.024 0.003 0.472
+590 0.005 0.398 0.034 0.002 0.477
+595 0.005 0.291 0.045 0.002 0.478
+600 0.005 0.187 0.062 0.002 0.473
+605 0.005 0.121 0.090 0.002 0.484
+610 0.005 0.081 0.143 0.002 0.484
+615 0.004 0.053 0.229 0.003 0.475
+620 0.003 0.032 0.341 0.003 0.477
+625 0.002 0.021 0.451 0.003 0.467
+630 0.001 0.016 0.544 0.003 0.464
+635 0.001 0.015 0.593 0.004 0.450
+640 0.001 0.015 0.606 0.004 0.438
+645 0.001 0.015 0.622 0.005 0.422
+650 0.001 0.013 0.642 0.005 0.418
+655 0.001 0.010 0.647 0.006 0.404
+660 0.001 0.008 0.645 0.006 0.398
+665 0.002 0.007 0.635 0.007 0.391
+670 0.002 0.007 0.605 0.007 0.395
+675 0.004 0.007 0.550 0.007 0.390
+680 0.007 0.006 0.472 0.008 0.384
+685 0.011 0.005 0.373 0.009 0.385
+690 0.012 0.003 0.261 0.010 0.376
+695 0.009 0.002 0.172 0.012 0.382
+700 0.004 0.002 0.100 0.015 0.376
+705 0.003 0.002 0.058 0.017 0.366
+710 0.003 0.002 0.032 0.020 0.361
+715 0.004 0.002 0.018 0.024 0.359
+720 0.005 0.003 0.013 0.029 0.358
+725 0.004 0.004 0.012 0.035 0.352
+730 0.002 0.004 0.012 0.043 0.357
+735 0.001 0.003 0.012 0.056 0.355
+740 0.001 0.002 0.011 0.076 0.359
+745 0.001 0.001 0.008 0.112 0.360
+750 0.001 0.001 0.005 0.165 0.367
+755 0.001 0.001 0.004 0.224 0.365
+760 0.002 0.001 0.003 0.287 0.353
+765 0.001 0.001 0.003 0.359 0.355
+770 0.002 0.001 0.002 0.423 0.352
+775 0.002 0.002 0.003 0.443 0.345
+780 0.001 0.002 0.003 0.439 0.339
+785 0.001 0.002 0.003 0.425 0.332
+790 0.001 0.002 0.004 0.407 0.326
+795 0.001 0.002 0.003 0.389 0.316
+800 0.001 0.002 0.002 0.374 0.313
+805 0.001 0.002 0.002 0.364 0.314
+810 0.001 0.001 0.001 0.356 0.313
+815 0.001 0.001 0.001 0.351 0.312
+820 0.001 0.001 0.001 0.346 0.313
+825 0.002 0.001 0.001 0.342 0.299
+830 0.002 0.001 0.001 0.334 0.301
+835 0.002 0.001 0.001 0.323 0.301
+840 0.002 0.002 0.001 0.307 0.301
+845 0.002 0.002 0.001 0.286 0.292
+850 0.002 0.002 0.001 0.274 0.292
+855 0.002 0.003 0.001 0.261 0.279
+860 0.002 0.003 0.001 0.245 0.279
+865 0.002 0.004 0.001 0.225 0.260
+870 0.002 0.004 0.001 0.210 0.260
+875 0.002 0.004 0.001 0.193 0.248
+880 0.002 0.004 0.001 0.171 0.238
+885 0.002 0.003 0.001 0.137 0.232
+890 0.002 0.003 0.001 0.106 0.221
+895 0.002 0.003 0.001 0.085 0.216
+900 0.002 0.003 0.001 0.061 0.203
+905 0.003 0.003 0.001 0.044 0.196
+910 0.003 0.003 0.001 0.032 0.192
+915 0.004 0.003 0.001 0.025 0.186
+920 0.004 0.003 0.001 0.015 0.171
+925 0.003 0.003 0.001 0.008 0.159
+930 0.003 0.002 0.001 0.005 0.153
+935 0.002 0.002 0.001 0.004 0.141
+940 0.002 0.002 0.000 0.003 0.131
+945 0.001 0.001 0.000 0.002 0.127
+950 0.001 0.001 0.001 0.002 0.116
+955 0.001 0.001 0.000 0.002 0.107
+960 0.001 0.001 0.000 0.001 0.096
+965 0.001 0.001 0.000 0.001 0.091
+970 0.001 0.001 0.000 0.001 0.083
+975 0.000 0.001 0.000 0.001 0.078
+980 0.000 0.000 0.000 0.001 0.073
+985 0.000 0.000 0.000 0.001 0.067
+990 0.000 0.000 0.000 0.001 0.063
+995 0.000 0.000 0.000 0.001 0.059
+1000 0.000 0.000 0.000 0.001 0.053
+1005 0.000 0.000 0.000 0.001 0.048
+1010 0.000 0.000 0.000 0.001 0.044
+1015 0.000 0.000 0.000 0.001 0.040
+1020 0.000 0.000 0.000 0.001 0.036
+1025 0.000 0.000 0.000 0.001 0.031
+1030 0.001 0.000 0.000 0.001 0.027
+1035 0.000 0.000 0.000 0.001 0.024
+1040 0.001 0.000 0.000 0.001 0.020
+1045 0.000 0.000 0.000 0.001 0.018
+1050 0.000 0.000 0.000 0.001 0.015
+1055 0.000 0.000 0.000 0.000 0.013
+1060 0.000 0.000 0.000 0.000 0.003
+1065 0.000 0.000 0.000 0.000 0.000
+1070 0.000 0.000 0.000 0.000 0.000
+1075 0.000 0.000 0.000 0.000 0.000
+1080 0.000 0.000 0.000 0.000 0.000
+1085 0.000 0.000 0.000 0.000 0.000
+1090 0.000 0.000 0.000 0.000 0.000
+1095 0.000 0.000 0.000 0.000 0.000
+1100 0.000 0.000 0.000 0.000 0.000
diff --git a/examples/image_processing/resources/spot5.srf b/examples/image_processing/resources/spot5.srf
new file mode 100644
index 0000000..93dcc30
--- /dev/null
+++ b/examples/image_processing/resources/spot5.srf
@@ -0,0 +1,182 @@
+181 5 5
+450 0.000 0.000 0.000 0.000 0.007
+455 0.000 0.000 0.000 0.000 0.004
+460 0.000 0.000 0.000 0.000 0.005
+465 0.000 0.000 0.000 0.000 0.017
+470 0.000 0.000 0.000 0.000 0.072
+475 0.000 0.000 0.000 0.000 0.193
+480 0.005 0.000 0.000 0.000 0.324
+485 0.039 0.000 0.000 0.000 0.463
+490 0.137 0.000 0.000 0.000 0.593
+495 0.299 0.000 0.000 0.000 0.710
+500 0.461 0.000 0.000 0.000 0.780
+505 0.595 0.000 0.000 0.000 0.806
+510 0.704 0.000 0.000 0.000 0.825
+515 0.787 0.000 0.000 0.000 0.856
+520 0.863 0.000 0.000 0.000 0.899
+525 0.920 0.000 0.000 0.000 0.943
+530 0.965 0.000 0.000 0.000 0.965
+535 0.990 0.000 0.000 0.000 0.980
+540 1.000 0.000 0.000 0.000 0.987
+545 0.992 0.000 0.000 0.000 0.985
+550 0.969 0.000 0.000 0.000 0.979
+555 0.926 0.000 0.000 0.000 0.964
+560 0.877 0.000 0.000 0.000 0.959
+565 0.820 0.000 0.000 0.000 0.953
+570 0.753 0.000 0.000 0.000 0.956
+575 0.685 0.000 0.000 0.000 0.963
+580 0.612 0.000 0.000 0.000 0.967
+585 0.535 0.000 0.000 0.000 0.968
+590 0.448 0.000 0.000 0.000 0.965
+595 0.347 0.000 0.000 0.000 0.962
+600 0.248 0.002 0.000 0.000 0.968
+605 0.156 0.019 0.000 0.000 0.982
+610 0.092 0.104 0.000 0.000 0.992
+615 0.050 0.298 0.000 0.000 0.997
+620 0.026 0.526 0.000 0.000 1.000
+625 0.013 0.714 0.000 0.000 0.996
+630 0.007 0.847 0.000 0.000 0.987
+635 0.004 0.926 0.000 0.000 0.976
+640 0.003 0.975 0.000 0.000 0.961
+645 0.000 0.995 0.000 0.000 0.943
+650 0.000 1.000 0.000 0.000 0.932
+655 0.000 0.987 0.000 0.000 0.910
+660 0.000 0.962 0.000 0.000 0.895
+665 0.000 0.924 0.000 0.000 0.869
+670 0.000 0.875 0.000 0.000 0.806
+675 0.000 0.815 0.000 0.000 0.678
+680 0.000 0.723 0.000 0.000 0.502
+685 0.000 0.595 0.000 0.000 0.327
+690 0.000 0.439 0.000 0.000 0.195
+695 0.000 0.293 0.000 0.000 0.114
+700 0.000 0.178 0.000 0.000 0.067
+705 0.000 0.105 0.000 0.000 0.039
+710 0.000 0.060 0.000 0.000 0.024
+715 0.000 0.035 0.000 0.000 0.016
+720 0.000 0.020 0.000 0.000 0.011
+725 0.000 0.011 0.000 0.000 0.000
+730 0.000 0.007 0.000 0.000 0.000
+735 0.000 0.004 0.000 0.000 0.000
+740 0.000 0.002 0.000 0.000 0.000
+745 0.000 0.000 0.000 0.000 0.000
+750 0.000 0.000 0.001 0.000 0.000
+755 0.000 0.000 0.004 0.000 0.000
+760 0.000 0.000 0.011 0.000 0.000
+765 0.000 0.000 0.030 0.000 0.000
+770 0.000 0.000 0.071 0.000 0.000
+775 0.000 0.000 0.143 0.000 0.000
+780 0.000 0.000 0.244 0.000 0.000
+785 0.000 0.000 0.370 0.000 0.000
+790 0.000 0.000 0.502 0.000 0.000
+795 0.000 0.000 0.630 0.000 0.000
+800 0.000 0.000 0.734 0.000 0.000
+805 0.000 0.000 0.821 0.000 0.000
+810 0.000 0.000 0.884 0.000 0.000
+815 0.000 0.000 0.938 0.000 0.000
+820 0.000 0.000 0.968 0.000 0.000
+825 0.000 0.000 0.985 0.000 0.000
+830 0.000 0.000 0.999 0.000 0.000
+835 0.000 0.000 1.000 0.000 0.000
+840 0.000 0.000 0.994 0.000 0.000
+845 0.000 0.000 0.973 0.000 0.000
+850 0.000 0.000 0.944 0.000 0.000
+855 0.000 0.000 0.918 0.000 0.000
+860 0.000 0.000 0.887 0.000 0.000
+865 0.000 0.000 0.856 0.000 0.000
+870 0.000 0.000 0.803 0.000 0.000
+875 0.000 0.000 0.733 0.000 0.000
+880 0.000 0.000 0.630 0.000 0.000
+885 0.000 0.000 0.494 0.000 0.000
+890 0.000 0.000 0.370 0.000 0.000
+895 0.000 0.000 0.249 0.000 0.000
+900 0.000 0.000 0.157 0.000 0.000
+905 0.000 0.000 0.103 0.000 0.000
+910 0.000 0.000 0.066 0.000 0.000
+915 0.000 0.000 0.041 0.000 0.000
+920 0.000 0.000 0.027 0.000 0.000
+925 0.000 0.000 0.019 0.000 0.000
+930 0.000 0.000 0.012 0.000 0.000
+935 0.000 0.000 0.008 0.000 0.000
+940 0.000 0.000 0.006 0.000 0.000
+945 0.000 0.000 0.004 0.000 0.000
+950 0.000 0.000 0.003 0.000 0.000
+955 0.000 0.000 0.000 0.000 0.000
+960 0.000 0.000 0.000 0.000 0.000
+965 0.000 0.000 0.000 0.000 0.000
+970 0.000 0.000 0.000 0.000 0.000
+975 0.000 0.000 0.000 0.000 0.000
+980 0.000 0.000 0.000 0.000 0.000
+985 0.000 0.000 0.000 0.000 0.000
+990 0.000 0.000 0.000 0.000 0.000
+995 0.000 0.000 0.000 0.000 0.000
+1000 0.000 0.000 0.000 0.000 0.000
+1005 0.000 0.000 0.000 0.000 0.000
+1010 0.000 0.000 0.000 0.000 0.000
+1015 0.000 0.000 0.000 0.000 0.000
+1020 0.000 0.000 0.000 0.000 0.000
+1025 0.000 0.000 0.000 0.000 0.000
+1030 0.000 0.000 0.000 0.000 0.000
+1035 0.000 0.000 0.000 0.000 0.000
+1040 0.000 0.000 0.000 0.000 0.000
+1045 0.000 0.000 0.000 0.000 0.000
+1500 0.000 0.000 0.000 0.000 0.000
+1505 0.000 0.000 0.000 0.000 0.000
+1510 0.000 0.000 0.000 0.000 0.000
+1515 0.000 0.000 0.000 0.000 0.000
+1520 0.000 0.000 0.000 0.018 0.000
+1525 0.000 0.000 0.000 0.023 0.000
+1530 0.000 0.000 0.000 0.029 0.000
+1535 0.000 0.000 0.000 0.038 0.000
+1540 0.000 0.000 0.000 0.047 0.000
+1545 0.000 0.000 0.000 0.065 0.000
+1550 0.000 0.000 0.000 0.083 0.000
+1555 0.000 0.000 0.000 0.125 0.000
+1560 0.000 0.000 0.000 0.167 0.000
+1565 0.000 0.000 0.000 0.242 0.000
+1570 0.000 0.000 0.000 0.315 0.000
+1575 0.000 0.000 0.000 0.403 0.000
+1580 0.000 0.000 0.000 0.489 0.000
+1585 0.000 0.000 0.000 0.575 0.000
+1590 0.000 0.000 0.000 0.663 0.000
+1595 0.000 0.000 0.000 0.760 0.000
+1600 0.000 0.000 0.000 0.856 0.000
+1605 0.000 0.000 0.000 0.932 0.000
+1610 0.000 0.000 0.000 1.000 0.000
+1615 0.000 0.000 0.000 0.994 0.000
+1620 0.000 0.000 0.000 0.991 0.000
+1625 0.000 0.000 0.000 0.933 0.000
+1630 0.000 0.000 0.000 0.879 0.000
+1635 0.000 0.000 0.000 0.864 0.000
+1640 0.000 0.000 0.000 0.842 0.000
+1645 0.000 0.000 0.000 0.868 0.000
+1650 0.000 0.000 0.000 0.893 0.000
+1655 0.000 0.000 0.000 0.893 0.000
+1660 0.000 0.000 0.000 0.840 0.000
+1665 0.000 0.000 0.000 0.772 0.000
+1670 0.000 0.000 0.000 0.690 0.000
+1675 0.000 0.000 0.000 0.607 0.000
+1680 0.000 0.000 0.000 0.529 0.000
+1685 0.000 0.000 0.000 0.446 0.000
+1690 0.000 0.000 0.000 0.366 0.000
+1695 0.000 0.000 0.000 0.290 0.000
+1700 0.000 0.000 0.000 0.227 0.000
+1705 0.000 0.000 0.000 0.166 0.000
+1710 0.000 0.000 0.000 0.127 0.000
+1715 0.000 0.000 0.000 0.086 0.000
+1720 0.000 0.000 0.000 0.066 0.000
+1725 0.000 0.000 0.000 0.046 0.000
+1730 0.000 0.000 0.000 0.036 0.000
+1735 0.000 0.000 0.000 0.026 0.000
+1740 0.000 0.000 0.000 0.022 0.000
+1745 0.000 0.000 0.000 0.018 0.000
+1750 0.000 0.000 0.000 0.015 0.000
+1755 0.000 0.000 0.000 0.012 0.000
+1760 0.000 0.000 0.000 0.009 0.000
+1765 0.000 0.000 0.000 0.007 0.000
+1770 0.000 0.000 0.000 0.005 0.000
+1775 0.000 0.000 0.000 0.004 0.000
+1780 0.000 0.000 0.000 0.003 0.000
+1785 0.000 0.000 0.000 0.002 0.000
+1790 0.000 0.000 0.000 0.002 0.000
+1795 0.000 0.000 0.000 0.001 0.000
+1800 0.000 0.000 0.000 0.001 0.000
diff --git a/examples/image_processing/resources/triangle.flr b/examples/image_processing/resources/triangle.flr
new file mode 100644
index 0000000..7ea52e6
--- /dev/null
+++ b/examples/image_processing/resources/triangle.flr
@@ -0,0 +1,4 @@
+3 3 16
+1 2 1
+2 4 2
+1 2 1
diff --git a/examples/image_processing/run_all_tests_unix.sh b/examples/image_processing/run_all_tests_unix.sh
old mode 100755
new mode 100644
index 5d38e94..d7d75c7
--- a/examples/image_processing/run_all_tests_unix.sh
+++ b/examples/image_processing/run_all_tests_unix.sh
@@ -1,51 +1,51 @@
-#!/bin/bash
-
-echo Starting test procedure...
-
-cd bin
-echo The current directory is:
-pwd
-
-echo Cleanning garbage files...
-find -name "*.tif" -exec rm -f {} \;
-find -name "*.ilk" -exec rm -f {} \;
-find -name "*.pdb" -exec rm -f {} \;
-find -name "*.exe" -exec rm -f {} \;
-echo Cleanning done.
-
-AT_LEAST_ONE_TEST_FAILED=0
-LOGFILE=/tmp/pditestsunit.log
-
-for i in $( ls TePDI* ); do
-  if [ -x $i ]; then
-    echo Now running $i test ...
-    
-    TEST_FAILED=0
-    rm -f $LOGFILE
-    
-    ./$i &> $LOGFILE
-    
-    if [ "$?" -ne "0" ]; then 
-      TEST_FAILED=1
-      AT_LEAST_ONE_TEST_FAILED=1
-      echo Test $i failed.
-      
-      echo ----------------------------------------------------------------
-      cat $LOGFILE
-      echo ----------------------------------------------------------------       
-    else
-      echo Test $i OK.
-    fi
-  fi
-done
-
-if [ $AT_LEAST_ONE_TEST_FAILED -ne "0" ]; then
-  echo ----------------------------------------------------------------
-  echo Test procedure finished with errors.
-  cd ..
-  exit 1
-else
-  echo Test procedure finished with no errors.
-  cd ..
-  exit 0
-fi
+#!/bin/bash
+
+echo Starting test procedure...
+
+cd bin
+echo The current directory is:
+pwd
+
+echo Cleanning garbage files...
+find -name "*.tif" -exec rm -f {} \;
+find -name "*.ilk" -exec rm -f {} \;
+find -name "*.pdb" -exec rm -f {} \;
+find -name "*.exe" -exec rm -f {} \;
+echo Cleanning done.
+
+AT_LEAST_ONE_TEST_FAILED=0
+LOGFILE=/tmp/pditestsunit.log
+
+for i in $( ls TePDI* ); do
+  if [ -x $i ]; then
+    echo Now running $i test ...
+    
+    TEST_FAILED=0
+    rm -f $LOGFILE
+    
+    ./$i &> $LOGFILE
+    
+    if [ "$?" -ne "0" ]; then 
+      TEST_FAILED=1
+      AT_LEAST_ONE_TEST_FAILED=1
+      echo Test $i failed.
+      
+      echo ----------------------------------------------------------------
+      cat $LOGFILE
+      echo ----------------------------------------------------------------       
+    else
+      echo Test $i OK.
+    fi
+  fi
+done
+
+if [ $AT_LEAST_ONE_TEST_FAILED -ne "0" ]; then
+  echo ----------------------------------------------------------------
+  echo Test procedure finished with errors.
+  cd ..
+  exit 1
+else
+  echo Test procedure finished with no errors.
+  cd ..
+  exit 0
+fi
diff --git a/examples/image_processing/source/.cvsignore b/examples/image_processing/source/.cvsignore
new file mode 100644
index 0000000..57fb7dd
--- /dev/null
+++ b/examples/image_processing/source/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+
diff --git a/examples/image_processing/source/TePDIArithmetic/.cvsignore b/examples/image_processing/source/TePDIArithmetic/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIArithmetic/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic.pro b/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic.pro
old mode 100755
new mode 100644
index 014d929..8d3d940
--- a/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic.pro
+++ b/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic.pro
@@ -1,9 +1,9 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIArithmetic_test.cpp
-
-
-QMAKE_CLEAN += \
-  ../../bin/TePDIArith*.tif
-
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIArithmetic_test.cpp
+
+
+QMAKE_CLEAN += \
+  ../../bin/TePDIArith*.tif
+
diff --git a/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic_test.cpp b/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic_test.cpp
old mode 100755
new mode 100644
index 26f95f7..dc95a88
--- a/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic_test.cpp
+++ b/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic_test.cpp
@@ -1,512 +1,145 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIArithmetic.hpp>
-#include <TePDIParameters.hpp>
-#include <TePDIUtils.hpp>
-
-#include <TeRaster.h>
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-#include <TeAgnostic.h>
-
-#include <string>
-
-void TePDIAType1_test()
-{
-  TePDIParameters params;
-
-  params.SetParameter( "arithmetic_type", TePDIArithmetic::TePDIAType1 );
-
-  TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster1->init(), "Unable to init inRaster1" );
-  params.SetParameter( "input_image1", inRaster1 );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "img1_chan", (int)0 );
-  params.SetParameter( "gain", 2. );
-  params.SetParameter( "offset", 0. );
-
-  TePDIArithmetic arith;
-    
-  TEAGN_TRUE_OR_THROW( arith.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( arith.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIArithTePDIAType1_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void TePDIAType1_norm_test()
-{
-  TePDIParameters params;
-
-  params.SetParameter( "arithmetic_type", TePDIArithmetic::TePDIAType1 );
-
-  TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster1->init(), "Unable to init inRaster1" );
-  params.SetParameter( "input_image1", inRaster1 );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "img1_chan", (int)0 );
-  params.SetParameter( "gain", 2. );
-  params.SetParameter( "offset", 0. );
-  params.SetParameter( "normalize_output", (int)1 );
-
-  TePDIArithmetic arith;
-    
-  TEAGN_TRUE_OR_THROW( arith.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( arith.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIArithTePDIAType1_norm_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void TePDIAType2_test()
-{
-  TePDIParameters params;
-
-  params.SetParameter( "arithmetic_type", TePDIArithmetic::TePDIAType2 );
-
-  TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
-    std::string( TEPDIEXAMPLESBINPATH "TePDIArithTePDIAType1_test.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster1->init(), "Unable to init inRaster1" );
-  params.SetParameter( "input_image1", inRaster1 );
-
-  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
-  params.SetParameter( "input_image2", inRaster2 );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "img1_chan", (int)0 );
-  params.SetParameter( "img2_chan", (int)0 );
-  params.SetParameter( "gain", 1. );
-  params.SetParameter( "offset", 0. );
-
-  TePDIArithmetic arith;
-    
-  TEAGN_TRUE_OR_THROW( arith.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( arith.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIArithTePDIAType2_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void TePDIAType2_norm_test()
-{
-  TePDIParameters params;
-
-  params.SetParameter( "arithmetic_type", TePDIArithmetic::TePDIAType2 );
-
-  TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
-    std::string( TEPDIEXAMPLESBINPATH "TePDIArithTePDIAType1_test.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster1->init(), "Unable to init inRaster1" );
-  params.SetParameter( "input_image1", inRaster1 );
-
-  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
-  params.SetParameter( "input_image2", inRaster2 );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "img1_chan", (int)0 );
-  params.SetParameter( "img2_chan", (int)0 );
-  params.SetParameter( "gain", 1. );
-  params.SetParameter( "offset", 0. );
-  params.SetParameter( "normalize_output", (int)1 );
-
-  TePDIArithmetic arith;
-    
-  TEAGN_TRUE_OR_THROW( arith.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( arith.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIArithTePDIAType2_norm_test.tif" ), "GeoTIF generation error" );
-}
-
-void TePDIAType1_numeric_test()
-{
-  /* Creating images */
-  
-  TePDITypes::TePDIRasterPtrType input_image1;
-  TePDITypes::TePDIRasterPtrType input_image2;
-  TePDITypes::TePDIRasterPtrType output_image;
-  
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 1;
-  params.ncols_ = 1;
-  params.setDataType( TeDOUBLE, -1 );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image1, params, false ), "Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image2, params, false ), "Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    output_image, params, false ), "Allocation error" );
-        
-  TEAGN_TRUE_OR_THROW( input_image1->setElement( 0, 0, 2.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_image2->setElement( 0, 0, 3.0, 0 ), 
-    "error defining raster element");
-    
-  /* Calling algorithm */
-  
-  TePDIParameters algo_params;
-  algo_params.SetParameter( "arithmetic_type", 
-    TePDIArithmetic::TePDIAType1 );
-  algo_params.SetParameter( "input_image1", input_image1 );
-  algo_params.SetParameter( "input_image2", input_image2 );
-  algo_params.SetParameter( "img1_chan", (int)0 );
-  algo_params.SetParameter( "img2_chan", (int)0 );
-  algo_params.SetParameter( "gain", (double)2 );
-  algo_params.SetParameter( "offset", (double)1 );
-  algo_params.SetParameter( "output_image", output_image );
-
-  TePDIArithmetic arith_instance;
-    
-  TEAGN_TRUE_OR_THROW( arith_instance.Reset( algo_params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( arith_instance.Apply(),
-    "Apply error" ); 
-    
-  /* Checking values */
-  
-  TEAGN_TRUE_OR_THROW( 
-    ( output_image->params().nlines_ == 
-    input_image1->params().nlines_ ) &&
-    ( output_image->params().ncols_ == 
-    input_image1->params().ncols_ ) &&
-    ( output_image->params().nBands() == 1 ),
-    "Invalid output raster size" )
-  
-  double value = 0; 
-  
-  TEAGN_TRUE_OR_THROW( output_image->getElement( 0, 0, value, 0 ), 
-    "error getting raster element");  
-  TEAGN_CHECK_EPS( value, 5, 0, "Invalid value" );
-}
-
-void TePDIAType2_numeric_test()
-{
-  /* Creating images */
-  
-  TePDITypes::TePDIRasterPtrType input_image1;
-  TePDITypes::TePDIRasterPtrType input_image2;
-  TePDITypes::TePDIRasterPtrType output_image;
-  
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 1;
-  params.ncols_ = 1;
-  params.setDataType( TeDOUBLE, -1 );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image1, params, false ), "Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image2, params, false ), "Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    output_image, params, false ), "Allocation error" );
-        
-  TEAGN_TRUE_OR_THROW( input_image1->setElement( 0, 0, 2.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_image2->setElement( 0, 0, 3.0, 0 ), 
-    "error defining raster element");
-    
-  /* Calling algorithm */
-  
-  TePDIParameters algo_params;
-  algo_params.SetParameter( "arithmetic_type", 
-    TePDIArithmetic::TePDIAType2 );
-  algo_params.SetParameter( "input_image1", input_image1 );
-  algo_params.SetParameter( "input_image2", input_image2 );
-  algo_params.SetParameter( "img1_chan", (int)0 );
-  algo_params.SetParameter( "img2_chan", (int)0 );
-  algo_params.SetParameter( "gain", (double)2 );
-  algo_params.SetParameter( "offset", (double)1 );
-  algo_params.SetParameter( "output_image", output_image );
-
-  TePDIArithmetic arith_instance;
-    
-  TEAGN_TRUE_OR_THROW( arith_instance.Reset( algo_params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( arith_instance.Apply(),
-    "Apply error" ); 
-    
-  /* Checking values */
-  
-  TEAGN_TRUE_OR_THROW( 
-    ( output_image->params().nlines_ == 
-    input_image1->params().nlines_ ) &&
-    ( output_image->params().ncols_ == 
-    input_image1->params().ncols_ ) &&
-    ( output_image->params().nBands() == 1 ),
-    "Invalid output raster size" )  
-  
-  double value = 0; 
-  
-  TEAGN_TRUE_OR_THROW( output_image->getElement( 0, 0, value, 0 ), 
-    "error getting raster element");  
-  TEAGN_CHECK_EPS( value, -1, 0, "Invalid value" );
-}
-
-void TePDIAType3_numeric_test()
-{
-  /* Creating images */
-  
-  TePDITypes::TePDIRasterPtrType input_image1;
-  TePDITypes::TePDIRasterPtrType input_image2;
-  TePDITypes::TePDIRasterPtrType output_image;
-  
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 1;
-  params.ncols_ = 1;
-  params.setDataType( TeDOUBLE, -1 );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image1, params, false ), "Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image2, params, false ), "Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    output_image, params, false ), "Allocation error" );
-        
-  TEAGN_TRUE_OR_THROW( input_image1->setElement( 0, 0, 2.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_image2->setElement( 0, 0, 3.0, 0 ), 
-    "error defining raster element");
-    
-  /* Calling algorithm */
-  
-  TePDIParameters algo_params;
-  algo_params.SetParameter( "arithmetic_type", 
-    TePDIArithmetic::TePDIAType3 );
-  algo_params.SetParameter( "input_image1", input_image1 );
-  algo_params.SetParameter( "input_image2", input_image2 );
-  algo_params.SetParameter( "img1_chan", (int)0 );
-  algo_params.SetParameter( "img2_chan", (int)0 );
-  algo_params.SetParameter( "gain", (double)2 );
-  algo_params.SetParameter( "offset", (double)1 );
-  algo_params.SetParameter( "output_image", output_image );
-
-  TePDIArithmetic arith_instance;
-    
-  TEAGN_TRUE_OR_THROW( arith_instance.Reset( algo_params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( arith_instance.Apply(),
-    "Apply error" ); 
-    
-  /* Checking values */
-  
-  TEAGN_TRUE_OR_THROW( 
-    ( output_image->params().nlines_ == 
-    input_image1->params().nlines_ ) &&
-    ( output_image->params().ncols_ == 
-    input_image1->params().ncols_ ) &&
-    ( output_image->params().nBands() == 1 ),
-    "Invalid output raster size" )  
-  
-  double value = 0; 
-  
-  TEAGN_TRUE_OR_THROW( output_image->getElement( 0, 0, value, 0 ), 
-    "error getting raster element");  
-  TEAGN_CHECK_EPS( value, 11, 0, "Invalid value" );
-}
-
-void TePDIAType4_numeric_test()
-{
-  /* Creating images */
-  
-  TePDITypes::TePDIRasterPtrType input_image1;
-  TePDITypes::TePDIRasterPtrType input_image2;
-  TePDITypes::TePDIRasterPtrType output_image;
-  
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 1;
-  params.ncols_ = 1;
-  params.setDataType( TeDOUBLE, -1 );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image1, params, false ), "Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image2, params, false ), "Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    output_image, params, false ), "Allocation error" );
-        
-  TEAGN_TRUE_OR_THROW( input_image1->setElement( 0, 0, 2.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_image2->setElement( 0, 0, 3.0, 0 ), 
-    "error defining raster element");
-    
-  /* Calling algorithm */
-  
-  TePDIParameters algo_params;
-  algo_params.SetParameter( "arithmetic_type", 
-    TePDIArithmetic::TePDIAType4 );
-  algo_params.SetParameter( "input_image1", input_image1 );
-  algo_params.SetParameter( "input_image2", input_image2 );
-  algo_params.SetParameter( "img1_chan", (int)0 );
-  algo_params.SetParameter( "img2_chan", (int)0 );
-  algo_params.SetParameter( "gain", (double)2 );
-  algo_params.SetParameter( "offset", (double)1 );
-  algo_params.SetParameter( "output_image", output_image );
-
-  TePDIArithmetic arith_instance;
-    
-  TEAGN_TRUE_OR_THROW( arith_instance.Reset( algo_params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( arith_instance.Apply(),
-    "Apply error" ); 
-    
-  /* Checking values */
-  
-  TEAGN_TRUE_OR_THROW( 
-    ( output_image->params().nlines_ == 
-    input_image1->params().nlines_ ) &&
-    ( output_image->params().ncols_ == 
-    input_image1->params().ncols_ ) &&
-    ( output_image->params().nBands() == 1 ),
-    "Invalid output raster size" )  
-  
-  double value = 0; 
-  
-  TEAGN_TRUE_OR_THROW( output_image->getElement( 0, 0, value, 0 ), 
-    "error getting raster element");  
-  TEAGN_CHECK_EPS( value, 2.3333333, 0.00001, "Invalid value" );
-}
-
-void TePDIAType5_numeric_test()
-{
-  /* Creating images */
-  
-  TePDITypes::TePDIRasterPtrType input_image1;
-  TePDITypes::TePDIRasterPtrType input_image2;
-  TePDITypes::TePDIRasterPtrType output_image;
-  
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 1;
-  params.ncols_ = 1;
-  params.setDataType( TeDOUBLE, -1 );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image1, params, false ), "Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image2, params, false ), "Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    output_image, params, false ), "Allocation error" );
-        
-  TEAGN_TRUE_OR_THROW( input_image1->setElement( 0, 0, 2.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_image2->setElement( 0, 0, 3.0, 0 ), 
-    "error defining raster element");
-    
-  /* Calling algorithm */
-  
-  TePDIParameters algo_params;
-  algo_params.SetParameter( "arithmetic_type", 
-    TePDIArithmetic::TePDIAType5 );
-  algo_params.SetParameter( "input_image1", input_image1 );
-  algo_params.SetParameter( "input_image2", input_image2 );
-  algo_params.SetParameter( "img1_chan", (int)0 );
-  algo_params.SetParameter( "img2_chan", (int)0 );
-  algo_params.SetParameter( "gain", (double)2 );
-  algo_params.SetParameter( "offset", (double)1 );
-  algo_params.SetParameter( "output_image", output_image );
-
-  TePDIArithmetic arith_instance;
-    
-  TEAGN_TRUE_OR_THROW( arith_instance.Reset( algo_params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( arith_instance.Apply(),
-    "Apply error" ); 
-    
-  /* Checking values */
-  
-  double value = 0; 
-  
-  TEAGN_TRUE_OR_THROW( 
-    ( output_image->params().nlines_ == 
-    input_image1->params().nlines_ ) &&
-    ( output_image->params().ncols_ == 
-    input_image1->params().ncols_ ) &&
-    ( output_image->params().nBands() == 1 ),
-    "Invalid output raster size" )  
-  
-  TEAGN_TRUE_OR_THROW( output_image->getElement( 0, 0, value, 0 ), 
-    "error getting raster element");  
-  TEAGN_CHECK_EPS( value, 0.6, 0, "Invalid value" );
-}
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
-      
-    TeInitRasterDecoders();
-    
-    TePDIAType1_numeric_test();
-    TePDIAType2_numeric_test();
-    TePDIAType3_numeric_test();
-    TePDIAType4_numeric_test();
-    TePDIAType5_numeric_test();
-
-    TePDIAType1_test();
-    TePDIAType1_norm_test();
-    TePDIAType2_test();
-    TePDIAType2_norm_test();
-
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIArithmetic.hpp>
+#include <TePDIUtils.hpp>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeAgnostic.h>
+
+#include <string>
+
+void TePDIArithmetic_operator_test1( const std::string& operatorToken,
+  const std::string& tifFileNameToken )
+{
+  TePDITypes::TePDIRasterPtrType inputRasterPointer( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inputRasterPointer->init(), "Unable to init inRaster1" );
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( inputRasterPointer );
+  
+  std::string arithmetic_string( 
+    "( R0:0 " + operatorToken + " R0:1 ) " + operatorToken + " R0:2" );
+  TEAGN_WATCH( arithmetic_string );
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );  
+   
+  // Creating algorithm parameters
+    
+  TePDIParameters params;  
+  params.SetParameter( "input_rasters", input_rasters );
+  params.SetParameter( "arithmetic_string", arithmetic_string );
+  params.SetParameter( "output_raster", output_raster );
+  params.SetParameter( "normalize_output", (int)1 );
+
+  // Running the algorithm
+
+  TePDIArithmetic algoInstance;
+  TEAGN_TRUE_OR_THROW( algoInstance.Apply( params ), "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDIArithmetic_operator_test1_" + tifFileNameToken +
+    "_.tif" ), "GeoTIF generation error" );
+}
+
+void TePDIArithmetic_precedence_test()
+{
+  TePDITypes::TePDIRasterPtrType inputRasterPointer( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inputRasterPointer->init(), "Unable to init inRaster1" );
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( inputRasterPointer );
+  input_rasters.push_back( inputRasterPointer );
+  input_rasters.push_back( inputRasterPointer );
+  
+  std::string arithmetic_string( "R0:0 + R0:1 * R0:2" );
+  TEAGN_WATCH( arithmetic_string );
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );  
+   
+  // Creating algorithm parameters
+    
+  TePDIParameters params;  
+  params.SetParameter( "input_rasters", input_rasters );
+  params.SetParameter( "arithmetic_string", arithmetic_string );
+  params.SetParameter( "output_raster", output_raster );
+  params.SetParameter( "normalize_output", (int)1 );
+
+  // Running the algorithm
+
+  TePDIArithmetic algoInstance;
+  TEAGN_TRUE_OR_THROW( algoInstance.Apply( params ), "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDIArithmetic_precedence_test.tif" ), 
+    "GeoTIF generation error" );
+}
+
+void TePDIArithmetic_real_number_test( const std::string& operatorToken,
+  const std::string& tifFileNameToken )
+{
+  TePDITypes::TePDIRasterPtrType inputRasterPointer( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inputRasterPointer->init(), "Unable to init inRaster1" );
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( inputRasterPointer );
+  input_rasters.push_back( inputRasterPointer );
+  input_rasters.push_back( inputRasterPointer );
+  
+  std::string arithmetic_string( "( R0:0 " + operatorToken + " 1.0 ) " + 
+    operatorToken + " ( 1.0 " + operatorToken + " R0:1 )" );
+  TEAGN_WATCH( arithmetic_string );
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );  
+   
+  // Creating algorithm parameters
+    
+  TePDIParameters params;  
+  params.SetParameter( "input_rasters", input_rasters );
+  params.SetParameter( "arithmetic_string", arithmetic_string );
+  params.SetParameter( "output_raster", output_raster );
+  params.SetParameter( "normalize_output", (int)1 );
+
+  // Running the algorithm
+
+  TePDIArithmetic algoInstance;
+  TEAGN_TRUE_OR_THROW( algoInstance.Apply( params ), "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDIArithmetic_real_number_test_" + tifFileNameToken +
+    "_.tif" ), "GeoTIF generation error" );
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  TeStdIOProgress pi;
+  TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
+  
+  TePDIArithmetic_operator_test1( "+", "plus" );
+  TePDIArithmetic_operator_test1( "-", "minus" );
+  TePDIArithmetic_operator_test1( "*", "multi" );
+  TePDIArithmetic_operator_test1( "/", "division" );
+  
+  TePDIArithmetic_precedence_test();
+  
+  TePDIArithmetic_real_number_test( "+", "plus" );
+  TePDIArithmetic_real_number_test( "-", "minus" );
+  TePDIArithmetic_real_number_test( "*", "multi" );
+  TePDIArithmetic_real_number_test( "/", "division" );  
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic_test.vcproj b/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic_test.vcproj
old mode 100755
new mode 100644
index 2c2e7f5..08c89ca
--- a/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic_test.vcproj
+++ b/examples/image_processing/source/TePDIArithmetic/TePDIArithmetic_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIArithmetic_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIArithmetic_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIArithmetic_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIArithmetic_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIArithmetic_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIArithmetic_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIArithmetic_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIArithmetic_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIArithmetic_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIArithmetic_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIBDFilter/.cvsignore b/examples/image_processing/source/TePDIBDFilter/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIBDFilter/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter.pro b/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter.pro
old mode 100755
new mode 100644
index 6192ab5..3051df7
--- a/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter.pro
+++ b/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter.pro
@@ -1,8 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIBDFilter_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/Sobel_test.tif \
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIBDFilter_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/Sobel_test.tif \
   ../../bin/Roberts_test.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter_test.cpp b/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter_test.cpp
old mode 100755
new mode 100644
index c925c93..90d4438
--- a/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter_test.cpp
+++ b/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter_test.cpp
@@ -1,110 +1,110 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIBDFilter.hpp>
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-
-#include <TeInitRasterDecoders.h>
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-
-void Sobel_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  channels.push_back( 1 );
-  channels.push_back( 2 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_type", TePDIBDFilter::TePDISobel );
-
-  params.SetParameter( "iterations", (int)2 );
-
-  TePDIBDFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Sobel_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Roberts_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  channels.push_back( 1 );
-  channels.push_back( 2 );  
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_type", TePDIBDFilter::TePDIRoberts );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  TePDIBDFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Roberts_test.tif" ), "GeoTIF generation error" );
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-  
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
-    
-    TeInitRasterDecoders();
-
-    Sobel_test();
-    Roberts_test();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIBDFilter.hpp>
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+
+#include <TeInitRasterDecoders.h>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+
+void Sobel_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_type", TePDIBDFilter::TePDISobel );
+
+  params.SetParameter( "iterations", (int)2 );
+
+  TePDIBDFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Sobel_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Roberts_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );  
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_type", TePDIBDFilter::TePDIRoberts );
+
+  params.SetParameter( "iterations", (int)1 );
+
+  TePDIBDFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Roberts_test.tif" ), "GeoTIF generation error" );
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+  
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
+    
+    TeInitRasterDecoders();
+
+    Sobel_test();
+    Roberts_test();
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter_test.vcproj b/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter_test.vcproj
old mode 100755
new mode 100644
index b625106..cc7f8c7
--- a/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter_test.vcproj
+++ b/examples/image_processing/source/TePDIBDFilter/TePDIBDFilter_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIBDFilter_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIBDFilter_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIBDFilter_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIBDFilter_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIBDFilter_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIBDFilter_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIBDFilter_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIBDFilter_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIBDFilter_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIBDFilter_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIBlender/.cvsignore b/examples/image_processing/source/TePDIBlender/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIBlender/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIBlender/TePDIBlender.pro b/examples/image_processing/source/TePDIBlender/TePDIBlender.pro
new file mode 100644
index 0000000..ab2b2f2
--- /dev/null
+++ b/examples/image_processing/source/TePDIBlender/TePDIBlender.pro
@@ -0,0 +1,7 @@
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIBlender_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/TePDIBlender*.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIBlender/TePDIBlender_test.cpp b/examples/image_processing/source/TePDIBlender/TePDIBlender_test.cpp
new file mode 100644
index 0000000..98eff31
--- /dev/null
+++ b/examples/image_processing/source/TePDIBlender/TePDIBlender_test.cpp
@@ -0,0 +1,671 @@
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIBlender.hpp>
+#include <TePDIUtils.hpp>
+
+#include <TeAgnostic.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+void noBlendMethodTest1()
+{
+  /* Initializing input rasters */
+
+  TePDITypes::TePDIRasterPtrType raster1Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster1Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  TePDITypes::TePDIRasterPtrType raster2Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop2.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster2Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  // what bands we want to use from each raster ??
+  
+  std::vector< unsigned int > raster1ChannelsVec;
+  raster1ChannelsVec.push_back( 0 );
+  raster1ChannelsVec.push_back( 1 );
+  raster1ChannelsVec.push_back( 2 );
+  
+  std::vector< unsigned int > raster2ChannelsVec;
+  raster2ChannelsVec.push_back( 0 );
+  raster2ChannelsVec.push_back( 1 );
+  raster2ChannelsVec.push_back( 2 );
+  
+  // The geometric transformation parameters telling how the input rasters are 
+  // overlapped
+  
+  TeGTParams transParams;
+  
+  TeCoordPair auxPair;
+  
+  auxPair.pt1.setXY( 38,25 ); // point over input image 1
+  auxPair.pt2.setXY( 333,562 ); // the corresponding point over input image 2
+  transParams.tiepoints_.push_back( auxPair );
+  
+  auxPair.pt1.setXY( 526,43 );
+  auxPair.pt2.setXY( 820,580 );
+  transParams.tiepoints_.push_back( auxPair );  
+  
+  auxPair.pt1.setXY( 276,395 );
+  auxPair.pt2.setXY( 570,932 );
+  transParams.tiepoints_.push_back( auxPair );  
+    
+  /* Initializing blender instance */
+  
+  std::vector< double > pixelScales;
+  pixelScales.push_back( 1 );
+  pixelScales.push_back( 1 );
+  pixelScales.push_back( 1 );
+  
+  std::vector< double > pixelOffsets;
+  pixelOffsets.push_back( 0 );
+  pixelOffsets.push_back( 0 );
+  pixelOffsets.push_back( 0 );
+  
+  TePDIBlender blender;
+  TEAGN_TRUE_OR_THROW( blender.init( raster1Ptr, raster1ChannelsVec,
+    raster2Ptr, raster2ChannelsVec, TePDIBlender::NoBlendMethod,
+    TePDIInterpolator::NNMethod, transParams, 0, pixelOffsets, pixelScales, 
+    pixelOffsets, pixelScales ),
+    "Blender initiation error" );
+    
+  // Creating an output image
+  
+  TeRasterParams outputRasterParams = raster1Ptr->params();
+  
+  outputRasterParams.nBands( 3 );
+  
+  TeBox outputRasterBoundingBox = raster1Ptr->params().boundingBox();
+  updateBox( outputRasterBoundingBox, raster2Ptr->params().boundingBox() );
+  
+  outputRasterParams.boundingBoxResolution( outputRasterBoundingBox.x1(),
+    outputRasterBoundingBox.y1(), outputRasterBoundingBox.x2(),
+    outputRasterBoundingBox.y2(), raster1Ptr->params().resx_,
+    raster1Ptr->params().resy_ );
+  
+  TePDITypes::TePDIRasterPtrType outputRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputRasterParams,
+    outputRaster ), "outputRaster creation error" );    
+  
+  // Generate output raster blended values
+  
+  const int outNLines = outputRaster->params().nlines_;
+  const int outNCols = outputRaster->params().ncols_;
+  double value = 0;
+  const double colOff = ( outputRaster->params().boundingBox().x1() -
+    raster1Ptr->params().boundingBox().x1() ) /
+    outputRaster->params().resx_;
+  const double lineOff = -1.0 * ( outputRaster->params().boundingBox().y2() -
+    raster1Ptr->params().boundingBox().y2() ) /
+    outputRaster->params().resy_;    
+  
+  for( int band = 0 ; band < outputRaster->params().nBands() ; ++band )
+  {
+    for( int line = 0 ; line < outNLines ; ++line )  
+    {
+      for( int col = 0 ; col < outNCols ; ++col )
+      {
+        blender.blend( ((double)line) + lineOff, ((double)col) + colOff, band, 
+          value );
+        
+        TEAGN_TRUE_OR_THROW( outputRaster->setElement( col, line, value, band ),
+          "Error writing value" );
+      }
+    }
+  }
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outputRaster,
+    TEPDIEXAMPLESBINPATH "TePDIBlender_noBlendMethodTest1.tif" ), 
+    "GeoTIF generation error" );
+}
+
+// Testing no-overlaped images (simulated)
+void noBlendMethodNoOverlapTest()
+{
+  /* Initializing input rasters */
+
+  // This image has 875 x 1009 pixels
+  TePDITypes::TePDIRasterPtrType raster1Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster1Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  // This image has 838 x 1009 pixels
+  TePDITypes::TePDIRasterPtrType raster2Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop2.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster2Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  // what bands we want to use from each raster ??
+  
+  std::vector< unsigned int > raster1ChannelsVec;
+  raster1ChannelsVec.push_back( 0 );
+  raster1ChannelsVec.push_back( 1 );
+  raster1ChannelsVec.push_back( 2 );
+  
+  std::vector< unsigned int > raster2ChannelsVec;
+  raster2ChannelsVec.push_back( 0 );
+  raster2ChannelsVec.push_back( 1 );
+  raster2ChannelsVec.push_back( 2 );
+  
+  // The geometric transformation parameters telling how the input rasters are 
+  // overlapped
+  
+  TeGTParams transParams;
+  
+  TeCoordPair auxPair;
+  
+  auxPair.pt1.setXY( 885,0 ); // point over input image 1
+  auxPair.pt2.setXY( 0,0 ); // TopLeft - image 2
+  transParams.tiepoints_.push_back( auxPair );
+  
+  auxPair.pt1.setXY( 885 + 838,0 );
+  auxPair.pt2.setXY( 837,0 ); // TopRight - image 2
+  transParams.tiepoints_.push_back( auxPair );  
+  
+  auxPair.pt1.setXY( 885,1009 );
+  auxPair.pt2.setXY( 0,1008 ); // LowerLeft - image 2
+  transParams.tiepoints_.push_back( auxPair );  
+  
+  auxPair.pt1.setXY( 885 + 838,1009 );
+  auxPair.pt2.setXY( 837,1008 ); // LowerRight - image 2
+  transParams.tiepoints_.push_back( auxPair );    
+    
+  /* Initializing blender instance */
+  
+  std::vector< double > pixelScales;
+  pixelScales.push_back( 1 );
+  pixelScales.push_back( 1 );
+  pixelScales.push_back( 1 );
+  
+  std::vector< double > pixelOffsets;
+  pixelOffsets.push_back( 0 );
+  pixelOffsets.push_back( 0 );
+  pixelOffsets.push_back( 0 );
+  
+  TePDIBlender blender;
+  TEAGN_TRUE_OR_THROW( blender.init( raster1Ptr, raster1ChannelsVec,
+    raster2Ptr, raster2ChannelsVec, TePDIBlender::NoBlendMethod,
+    TePDIInterpolator::NNMethod, transParams, 0, pixelOffsets, pixelScales, 
+    pixelOffsets, pixelScales ),
+    "Blender initiation error" );
+    
+  // Creating an output image
+  
+  TeRasterParams outputRasterParams;
+  outputRasterParams.setDataType( TeUNSIGNEDCHAR, 1 );
+  outputRasterParams.setNLinesNColumns( raster1Ptr->params().nlines_, 
+    10 + raster1Ptr->params().ncols_ + raster2Ptr->params().ncols_ );
+  outputRasterParams.nBands( 3 );
+  outputRasterParams.setPhotometric( TeRasterParams::TeRGB, -1 );
+  
+  TePDITypes::TePDIRasterPtrType outputRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputRasterParams,
+    outputRaster ), "outputRaster creation error" );    
+  
+  // Generate output raster blended values
+  
+  const int outNLines = outputRaster->params().nlines_;
+  const int outNCols = outputRaster->params().ncols_;
+  const int outNBands = outputRaster->params().nBands();
+  double value = 0;
+  
+  for( int band = 0 ; band < outNBands ; ++band )
+  {
+    for( int line = 0 ; line < outNLines ; ++line )  
+    {
+      for( int col = 0 ; col < outNCols ; ++col )
+      {
+        blender.blend( line, col, band, value );
+        
+        TEAGN_TRUE_OR_THROW( outputRaster->setElement( col, line, value, band ),
+          "Error writing value" );
+      }
+    }
+  }
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outputRaster,
+    TEPDIEXAMPLESBINPATH "TePDIBlender_noBlendMethodNoOverlapTest.tif" ), 
+    "GeoTIF generation error" );
+}
+
+void euclideanBlendMethodTest1()
+{
+  /* Initializing input rasters */
+
+  TePDITypes::TePDIRasterPtrType raster1Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster1Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  TePDITypes::TePDIRasterPtrType raster2Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster2Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  // what bands we want to use from each raster ??
+  
+  std::vector< unsigned int > raster1ChannelsVec;
+  raster1ChannelsVec.push_back( 0 );
+  
+  std::vector< unsigned int > raster2ChannelsVec;
+  raster2ChannelsVec.push_back( 0 );
+  
+  // The geometric transformation parameters telling how the input rasters are 
+  // overlapped
+  
+  TeGTParams transParams;
+  
+  TeCoordPair auxPair;
+  
+  auxPair.pt2.setXY( 18,48 ); // point over input image 2
+  auxPair.pt1.setXY( 232,280 ); // the corresponding point over input image 1
+  transParams.tiepoints_.push_back( auxPair );
+  
+  auxPair.pt2.setXY( 148,345 );
+  auxPair.pt1.setXY( 362,577 );
+  transParams.tiepoints_.push_back( auxPair );  
+  
+  auxPair.pt2.setXY( 327,17 );
+  auxPair.pt1.setXY( 541,249 );
+  transParams.tiepoints_.push_back( auxPair );  
+    
+  /* Initializing blender instance */
+  
+  std::vector< double > pixelScales;
+  pixelScales.push_back( 1 );
+
+  std::vector< double > pixelOffsets;
+  pixelOffsets.push_back( 0 );
+  
+  TePDIBlender blender;
+  TEAGN_TRUE_OR_THROW( blender.init( raster1Ptr, raster1ChannelsVec,
+    raster2Ptr, raster2ChannelsVec, TePDIBlender::EuclideanBlendMethod,
+    TePDIInterpolator::NNMethod, transParams, 0, pixelOffsets, pixelScales, 
+    pixelOffsets, pixelScales ),
+    "Blender initiation error" );
+    
+  // Creating an output image
+  
+  TeRasterParams outputRasterParams = raster1Ptr->params();
+  
+  outputRasterParams.nBands( 1 );
+  
+  TeBox outputRasterBoundingBox = raster1Ptr->params().boundingBox();
+  updateBox( outputRasterBoundingBox, raster2Ptr->params().boundingBox() );
+  
+  outputRasterParams.boundingBoxResolution( outputRasterBoundingBox.x1(),
+    outputRasterBoundingBox.y1(), outputRasterBoundingBox.x2(),
+    outputRasterBoundingBox.y2(), raster1Ptr->params().resx_,
+    raster1Ptr->params().resy_ );
+  
+  TePDITypes::TePDIRasterPtrType outputRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputRasterParams,
+    outputRaster ), "outputRaster creation error" );    
+  
+  // Generate output raster blended values
+  
+  const int outNLines = outputRaster->params().nlines_;
+  const int outNCols = outputRaster->params().ncols_;
+  double value = 0;
+  const double colOff = ( outputRaster->params().boundingBox().x1() -
+    raster1Ptr->params().boundingBox().x1() ) /
+    outputRaster->params().resx_;
+  const double lineOff = -1.0 * ( outputRaster->params().boundingBox().y2() -
+    raster1Ptr->params().boundingBox().y2() ) /
+    outputRaster->params().resy_;    
+  
+  for( int band = 0 ; band < outputRaster->params().nBands() ; ++band )
+  {
+    for( int line = 0 ; line < outNLines ; ++line )  
+    {
+      for( int col = 0 ; col < outNCols ; ++col )
+      {
+        blender.blend( ((double)line) + lineOff, ((double)col) + colOff, band, 
+          value );
+        
+        TEAGN_TRUE_OR_THROW( outputRaster->setElement( col, line, value, band ),
+          "Error writing value" );
+      }
+    }
+  }
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outputRaster,
+    TEPDIEXAMPLESBINPATH "TePDIBlender_euclideanBlendMethodTest1.tif" ), 
+    "GeoTIF generation error" );
+}
+
+void euclideanBlendMethodTest2()
+{
+  /* Initializing input rasters */
+
+  TePDITypes::TePDIRasterPtrType raster1Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_C.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster1Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  TePDITypes::TePDIRasterPtrType raster2Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster2Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  // what bands we want to use from each raster ??
+  
+  std::vector< unsigned int > raster1ChannelsVec;
+  raster1ChannelsVec.push_back( 0 );
+  
+  std::vector< unsigned int > raster2ChannelsVec;
+  raster2ChannelsVec.push_back( 0 );
+  
+  // The geometric transformation parameters telling how the input rasters are 
+  // overlapped
+  
+  TeGTParams transParams;
+  
+  TeCoordPair auxPair;
+  
+  auxPair.pt1.setXY( 36,234 ); // point over input image 1
+  auxPair.pt2.setXY( 245,21 ); // the corresponding point over input image 2
+  transParams.tiepoints_.push_back( auxPair );
+  
+  auxPair.pt1.setXY( 319,252 );
+  auxPair.pt2.setXY( 528,39 );
+  transParams.tiepoints_.push_back( auxPair );  
+  
+  auxPair.pt1.setXY( 136,416 );
+  auxPair.pt2.setXY( 345,203 );
+  transParams.tiepoints_.push_back( auxPair );  
+    
+  /* Initializing blender instance */
+  
+  std::vector< double > pixelScales;
+  pixelScales.push_back( 1 );
+
+  std::vector< double > pixelOffsets;
+  pixelOffsets.push_back( 0 );
+  
+  TePDIBlender blender;
+  TEAGN_TRUE_OR_THROW( blender.init( raster1Ptr, raster1ChannelsVec,
+    raster2Ptr, raster2ChannelsVec, TePDIBlender::EuclideanBlendMethod,
+    TePDIInterpolator::NNMethod, transParams, 0, pixelOffsets, pixelScales, 
+    pixelOffsets, pixelScales ),
+    "Blender initiation error" );
+    
+  // Creating an output image
+  
+  TeRasterParams outputRasterParams = raster1Ptr->params();
+  
+  outputRasterParams.nBands( 1 );
+  
+  TeBox outputRasterBoundingBox = raster1Ptr->params().boundingBox();
+  updateBox( outputRasterBoundingBox, raster2Ptr->params().boundingBox() );
+  
+  outputRasterParams.boundingBoxResolution( outputRasterBoundingBox.x1(),
+    outputRasterBoundingBox.y1(), outputRasterBoundingBox.x2(),
+    outputRasterBoundingBox.y2(), raster1Ptr->params().resx_,
+    raster1Ptr->params().resy_ );
+  
+  TePDITypes::TePDIRasterPtrType outputRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputRasterParams,
+    outputRaster ), "outputRaster creation error" );    
+  
+  // Generate output raster blended values
+  
+  const int outNLines = outputRaster->params().nlines_;
+  const int outNCols = outputRaster->params().ncols_;
+  double value = 0;
+  const double colOff = ( outputRaster->params().boundingBox().x1() -
+    raster1Ptr->params().boundingBox().x1() ) /
+    outputRaster->params().resx_;
+  const double lineOff = -1.0 * ( outputRaster->params().boundingBox().y2() -
+    raster1Ptr->params().boundingBox().y2() ) /
+    outputRaster->params().resy_;    
+  
+  for( int band = 0 ; band < outputRaster->params().nBands() ; ++band )
+  {
+    for( int line = 0 ; line < outNLines ; ++line )  
+    {
+      for( int col = 0 ; col < outNCols ; ++col )
+      {
+        blender.blend( ((double)line) + lineOff, ((double)col) + colOff, band, 
+          value );
+        
+        TEAGN_TRUE_OR_THROW( outputRaster->setElement( col, line, value, band ),
+          "Error writing value" );
+      }
+    }
+  }
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outputRaster,
+    TEPDIEXAMPLESBINPATH "TePDIBlender_euclideanBlendMethodTest2.tif" ), 
+    "GeoTIF generation error" );
+}
+
+// Testing no-overlaped images (simulated)
+void euclideanBlendMethodNoOverlapTest()
+{
+  /* Initializing input rasters */
+
+  // This image has 875 x 1009 pixels
+  TePDITypes::TePDIRasterPtrType raster1Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster1Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  // This image has 838 x 1009 pixels
+  TePDITypes::TePDIRasterPtrType raster2Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop2.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster2Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  // what bands we want to use from each raster ??
+  
+  std::vector< unsigned int > raster1ChannelsVec;
+  raster1ChannelsVec.push_back( 0 );
+  raster1ChannelsVec.push_back( 1 );
+  raster1ChannelsVec.push_back( 2 );
+  
+  std::vector< unsigned int > raster2ChannelsVec;
+  raster2ChannelsVec.push_back( 0 );
+  raster2ChannelsVec.push_back( 1 );
+  raster2ChannelsVec.push_back( 2 );
+  
+  // The geometric transformation parameters telling how the input rasters are 
+  // overlapped
+  
+  TeGTParams transParams;
+  
+  TeCoordPair auxPair;
+  
+  auxPair.pt1.setXY( 885,0 ); // point over input image 1
+  auxPair.pt2.setXY( 0,0 ); // TopLeft - image 2
+  transParams.tiepoints_.push_back( auxPair );
+  
+  auxPair.pt1.setXY( 885 + 838,0 );
+  auxPair.pt2.setXY( 837,0 ); // TopRight - image 2
+  transParams.tiepoints_.push_back( auxPair );  
+  
+  auxPair.pt1.setXY( 885,1009 );
+  auxPair.pt2.setXY( 0,1008 ); // LowerLeft - image 2
+  transParams.tiepoints_.push_back( auxPair );  
+  
+  auxPair.pt1.setXY( 885 + 838,1009 );
+  auxPair.pt2.setXY( 837,1008 ); // LowerRight - image 2
+  transParams.tiepoints_.push_back( auxPair );    
+    
+  /* Initializing blender instance */
+  
+  std::vector< double > pixelScales;
+  pixelScales.push_back( 1 );
+  pixelScales.push_back( 1 );
+  pixelScales.push_back( 1 );
+  
+  std::vector< double > pixelOffsets;
+  pixelOffsets.push_back( 0 );
+  pixelOffsets.push_back( 0 );
+  pixelOffsets.push_back( 0 );
+  
+  TePDIBlender blender;
+  TEAGN_TRUE_OR_THROW( blender.init( raster1Ptr, raster1ChannelsVec,
+    raster2Ptr, raster2ChannelsVec, TePDIBlender::EuclideanBlendMethod,
+    TePDIInterpolator::NNMethod, transParams, 0, pixelOffsets, pixelScales, 
+    pixelOffsets, pixelScales ),
+    "Blender initiation error" );
+    
+  // Creating an output image
+  
+  TeRasterParams outputRasterParams;
+  outputRasterParams.setDataType( TeUNSIGNEDCHAR, 1 );
+  outputRasterParams.setNLinesNColumns( raster1Ptr->params().nlines_, 
+    10 + raster1Ptr->params().ncols_ + raster2Ptr->params().ncols_ );
+  outputRasterParams.nBands( 3 );
+  outputRasterParams.setPhotometric( TeRasterParams::TeRGB, -1 );
+  
+  TePDITypes::TePDIRasterPtrType outputRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputRasterParams,
+    outputRaster ), "outputRaster creation error" );    
+  
+  // Generate output raster blended values
+  
+  const int outNLines = outputRaster->params().nlines_;
+  const int outNCols = outputRaster->params().ncols_;
+  const int outNBands = outputRaster->params().nBands();
+  double value = 0;
+  
+  for( int band = 0 ; band < outNBands ; ++band )
+  {
+    for( int line = 0 ; line < outNLines ; ++line )  
+    {
+      for( int col = 0 ; col < outNCols ; ++col )
+      {
+        blender.blend( line, col, band, value );
+        
+        TEAGN_TRUE_OR_THROW( outputRaster->setElement( col, line, value, band ),
+          "Error writing value" );
+      }
+    }
+  }
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outputRaster,
+    TEPDIEXAMPLESBINPATH "TePDIBlender_euclideanBlendMethodNoOverlapTest.tif" ), 
+    "GeoTIF generation error" );
+}
+
+// Testing overlaped images (one image is inside another)
+void euclideanBlendMethodContainsTest()
+{
+  /* Initializing input rasters */
+
+  TePDITypes::TePDIRasterPtrType raster1Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster1Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  // This image has 250 x 250 pixels
+  TePDITypes::TePDIRasterPtrType raster2Ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip500_500.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( raster2Ptr->init(), 
+    "Unable to init raster1Ptr" );
+    
+  // what bands we want to use from each raster ??
+  
+  std::vector< unsigned int > raster1ChannelsVec;
+  raster1ChannelsVec.push_back( 2 );
+  
+  std::vector< unsigned int > raster2ChannelsVec;
+  raster2ChannelsVec.push_back( 1 );
+  
+  // The geometric transformation parameters telling how the input rasters are 
+  // overlapped
+  
+  TeCoord2D topLeftCoord = raster2Ptr->params().index2Coord(
+    TeCoord2D( 0, 0 ) );
+  TeCoord2D topLeftIdxOverR1 = raster1Ptr->params().coord2Index(
+    topLeftCoord );       
+  
+  TeGTParams transParams;
+  TEAGN_TRUE_OR_THROW( transParams.direct_parameters_.Init( 3, 3, 0.0 ),
+    "Matrix init error" );
+  TEAGN_TRUE_OR_THROW( transParams.inverse_parameters_.Init( 3, 3, 0.0 ),
+    "Matrix init error" );
+  transParams.direct_parameters_( 0, 0 ) = 1.0;
+  transParams.direct_parameters_( 0, 2 ) = -500.0;
+  transParams.direct_parameters_( 1, 1 ) = 1.0;
+  transParams.direct_parameters_( 1, 2 ) = -500.0;
+  transParams.inverse_parameters_( 0, 0 ) = 1.0;
+  transParams.inverse_parameters_( 0, 2 ) = 500.0;
+  transParams.inverse_parameters_( 1, 1 ) = 1.0;
+  transParams.inverse_parameters_( 1, 2 ) = 500.0;  
+    
+  /* Initializing blender instance */
+  
+  std::vector< double > pixelScales;
+  pixelScales.push_back( 1 );
+  
+  std::vector< double > pixelOffsets;
+  pixelOffsets.push_back( 0 );
+  
+  TePDIBlender blender;
+  TEAGN_TRUE_OR_THROW( blender.init( raster1Ptr, raster1ChannelsVec,
+    raster2Ptr, raster2ChannelsVec, TePDIBlender::EuclideanBlendMethod,
+    TePDIInterpolator::NNMethod, transParams, 0, pixelOffsets, pixelScales, 
+    pixelOffsets, pixelScales ),
+    "Blender initiation error" );
+    
+  // Creating an output image
+  
+  TeRasterParams outputRasterParams;
+  outputRasterParams.setDataType( TeUNSIGNEDCHAR, 1 );
+  outputRasterParams.setNLinesNColumns( raster1Ptr->params().nlines_, 
+    raster1Ptr->params().ncols_ );
+  outputRasterParams.nBands( 1 );
+  outputRasterParams.setPhotometric( TeRasterParams::TeRGB, -1 );
+  
+  TePDITypes::TePDIRasterPtrType outputRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputRasterParams,
+    outputRaster ), "outputRaster creation error" );    
+  
+  // Generate output raster blended values
+  
+  const int outNLines = outputRaster->params().nlines_;
+  const int outNCols = outputRaster->params().ncols_;
+  double value = 0;
+  
+  for( int line = 0 ; line < outNLines ; ++line )  
+  {
+    for( int col = 0 ; col < outNCols ; ++col )
+    {
+      blender.blend( line, col, 0, value );
+      
+      TEAGN_TRUE_OR_THROW( outputRaster->setElement( col, line, value, 0 ),
+        "Error writing value" );
+    }
+  }
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outputRaster,
+    TEPDIEXAMPLESBINPATH "TePDIBlender_euclideanBlendMethodContainsTest.tif" ), 
+    "GeoTIF generation error" );
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  TeStdIOProgress pi;
+  TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+
+  euclideanBlendMethodContainsTest();
+  euclideanBlendMethodNoOverlapTest();
+  noBlendMethodNoOverlapTest();
+  euclideanBlendMethodTest2();
+  euclideanBlendMethodTest1();
+  noBlendMethodTest1();
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIBlender/TePDIBlender_test.vcproj b/examples/image_processing/source/TePDIBlender/TePDIBlender_test.vcproj
new file mode 100644
index 0000000..83dc090
--- /dev/null
+++ b/examples/image_processing/source/TePDIBlender/TePDIBlender_test.vcproj
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIBlender_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIBlender_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIBlender_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIBlender_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIBlender_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIBlending/TePDIBlending.pro b/examples/image_processing/source/TePDIBlending/TePDIBlending.pro
deleted file mode 100755
index 14a96a1..0000000
--- a/examples/image_processing/source/TePDIBlending/TePDIBlending.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIBlending_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/Blending*.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIBlending/TePDIBlending_test.cpp b/examples/image_processing/source/TePDIBlending/TePDIBlending_test.cpp
deleted file mode 100755
index 2205828..0000000
--- a/examples/image_processing/source/TePDIBlending/TePDIBlending_test.cpp
+++ /dev/null
@@ -1,411 +0,0 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIBlending.hpp>
-
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-#include <vector>
-
-void Noblend_TeOVERPLAPS_RGB_test()
-{
-  TePDIParameters blend_params;
-
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop2.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
-    "Unable to init input_raster1" );
-    
-  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
-    "Unable to init input_raster2" );
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );
-    
-  blend_params.SetParameter( "blending_type" , std::string( "no_blending" ) );
-  blend_params.SetParameter( "input_raster1" , input_raster1 );
-  blend_params.SetParameter( "input_raster2" , input_raster2 );
-  blend_params.SetParameter( "output_raster" , output_raster );
-  
-  std::vector< int > channels1;
-  channels1.push_back( 0 );
-  channels1.push_back( 1 );
-  channels1.push_back( 2 );
-  blend_params.SetParameter( "channels1" , channels1 );
-  
-  std::vector< int > channels2;
-  channels2.push_back( 0 );
-  channels2.push_back( 1 );
-  channels2.push_back( 2 );
-  blend_params.SetParameter( "channels2" , channels2 );
-  
-  TeBox input_raster1_box = input_raster1->params().boundingBox();
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr(
-    new TePolygon );
-  *raster1_pol_ptr = polygonFromBox( input_raster1_box );
-  blend_params.SetParameter( "raster1_pol_ptr" , raster1_pol_ptr );
-
-  TeBox input_raster2_box = input_raster2->params().boundingBox();
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr(
-    new TePolygon );  
-  *raster2_pol_ptr = polygonFromBox( input_raster2_box );
-  blend_params.SetParameter( "raster2_pol_ptr" , raster2_pol_ptr );
-  
-  double raster2_pol_offset_x = 
-    input_raster1->coord2Index(
-      input_raster2->index2Coord( TeCoord2D( 0, 0 ) ) ).x();
-  blend_params.SetParameter( "raster2_pol_offset_x" , raster2_pol_offset_x );
-  
-  double raster2_pol_offset_y = 
-    input_raster1->coord2Index(
-      input_raster2->index2Coord( TeCoord2D( 0, 0 ) ) ).y();
-  blend_params.SetParameter( "raster2_pol_offset_y" , raster2_pol_offset_y );
-
-  blend_params.SetParameter( "auto_equalize" , (int)1 );
-  
-  blend_params.SetParameter( "dummy_value" , (double)0 );
-
-  blend_params.SetParameter( "enable_multi_thread" , (int)1 );
-
-  TePDIBlending blend_instance;
-  TEAGN_TRUE_OR_THROW( blend_instance.Reset(blend_params), "Reset error" );
-  TEAGN_TRUE_OR_THROW( blend_instance.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Blending_noblend_TeOVERPLAPS_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Noblend_TeWITHIN_test()
-{
-  TePDIParameters blend_params;
-
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
-    "Unable to init input_raster1" );
-    
-  TePDITypes::TePDIRasterPtrType input_raster2_disk( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster2_disk->init(), 
-    "Unable to init input_raster2" );
-    
-  /* Building a input_raster2 with 3 bands no projection */
-    
-  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster() );
-  {
-    TeRasterParams input_raster2_params;
-    input_raster2_params.nBands( 1 );
-    input_raster2_params.setDataType( TeUNSIGNEDCHAR, -1 );
-    input_raster2_params.boxResolution( 0, 0, 
-      (double)( input_raster2_disk->params().ncols_ - 1 ),
-      (double)( input_raster2_disk->params().nlines_ - 1 ), 1, 1 );
-      
-    TeProjectionParams projparams;
-    projparams.name = "NoProjection";
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( projparams ) );          
-    input_raster2_params.projection( proj.nakedPointer() );        
-      
-    TEAGN_TRUE_OR_THROW( 
-      ( input_raster2_params.nlines_ == input_raster2_disk->params().nlines_ ),
-      "Invalid box lines" )
-    TEAGN_TRUE_OR_THROW( 
-      ( input_raster2_params.ncols_ == input_raster2_disk->params().ncols_ ),
-      "Invalid box lines" )
-    
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster2,
-      input_raster2_params, false ), "adjust_raster Alloc error" );   
-      
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterBands( input_raster2_disk,
-      input_raster2, false, false ), "Pixel copy error" );
-  }        
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "output_raster Alloc error" );
-    
-  blend_params.SetParameter( "blending_type" , std::string( "no_blending" ) );
-  blend_params.SetParameter( "input_raster1" , input_raster1 );
-  blend_params.SetParameter( "input_raster2" , input_raster2 );
-  blend_params.SetParameter( "output_raster" , output_raster );
-  
-  std::vector< int > channels1;
-  channels1.push_back( 0 );
-  blend_params.SetParameter( "channels1" , channels1 );
-  
-  std::vector< int > channels2;
-  channels2.push_back( 0 );
-  blend_params.SetParameter( "channels2" , channels2 );
-  
-  TeBox input_raster1_box = input_raster1->params().boundingBox();
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr(
-    new TePolygon );
-  *raster1_pol_ptr = polygonFromBox( input_raster1_box );
-  blend_params.SetParameter( "raster1_pol_ptr" , raster1_pol_ptr );
-
-  TeBox input_raster2_box = input_raster2->params().boundingBox();
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr(
-    new TePolygon );  
-  *raster2_pol_ptr = polygonFromBox( input_raster2_box );
-  blend_params.SetParameter( "raster2_pol_ptr" , raster2_pol_ptr );
-  
-  double raster2_pol_offset_x = input_raster1->coord2Index(
-    input_raster2_disk->index2Coord( TeCoord2D( 0, 0 ) ) ).x();
-  blend_params.SetParameter( "raster2_pol_offset_x" , raster2_pol_offset_x );
-  
-  double raster2_pol_offset_y = input_raster1->coord2Index(
-    input_raster2_disk->index2Coord( TeCoord2D( 0, 0 ) ) ).y();
-  blend_params.SetParameter( "raster2_pol_offset_y" , raster2_pol_offset_y );
-
-  blend_params.SetParameter( "auto_equalize" , (int)1 );
-  
-  blend_params.SetParameter( "dummy_value" , (double)0 );
-  
-  blend_params.SetParameter( "enable_multi_thread" , (int)1 );
-    
-  TePDIBlending blend_instance;
-  TEAGN_TRUE_OR_THROW( blend_instance.Reset(blend_params), "Reset error" );
-  TEAGN_TRUE_OR_THROW( blend_instance.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Blending_no_blend_TeWITHIN_test.tif" ), "GeoTIF generation error" );
-}
-
-void Euclidian_TeOVERPLAPS_test()
-{
-  TePDIParameters blend_params;
-
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
-    "Unable to init input_raster1" );
-    
-  TePDITypes::TePDIRasterPtrType input_raster2_disk( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster2_disk->init(), 
-    "Unable to init input_raster2" );
-    
-  /* Building a input_raster2 with no projection */
-    
-  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster() );
-  {
-    TeRasterParams input_raster2_params;
-    input_raster2_params.nBands( 1 );
-    input_raster2_params.setDataType( TeUNSIGNEDCHAR, -1 );
-    input_raster2_params.boxResolution( 0, 0, 
-      (double)( input_raster2_disk->params().ncols_ - 1 ),
-      (double)( input_raster2_disk->params().nlines_ - 1 ), 1, 1 );
-      
-    TeProjectionParams projparams;
-    projparams.name = "NoProjection";
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( projparams ) );          
-    input_raster2_params.projection( proj.nakedPointer() );      
-      
-    TEAGN_TRUE_OR_THROW( 
-      ( input_raster2_params.nlines_ == input_raster2_disk->params().nlines_ ),
-      "Invalid box lines" )
-    TEAGN_TRUE_OR_THROW( 
-      ( input_raster2_params.ncols_ == input_raster2_disk->params().ncols_ ),
-      "Invalid box lines" )
-    
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster2,
-      input_raster2_params, false ), "adjust_raster Alloc error" );   
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterBands( input_raster2_disk,
-      input_raster2, false, false ), "Pixel copy error" );
-  }        
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "output_raster Alloc error" );
-    
-  blend_params.SetParameter( "blending_type" , 
-    std::string( "euclidian_blending" ) );
-  blend_params.SetParameter( "input_raster1" , input_raster1 );
-  blend_params.SetParameter( "input_raster2" , input_raster2 );
-  blend_params.SetParameter( "output_raster" , output_raster );
-  
-  std::vector< int > channels1;
-  channels1.push_back( 0 );
-  blend_params.SetParameter( "channels1" , channels1 );
-  
-  std::vector< int > channels2;
-  channels2.push_back( 0 );
-  blend_params.SetParameter( "channels2" , channels2 );
-  
-  TeBox input_raster1_box = input_raster1->params().boundingBox();
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr(
-    new TePolygon );
-  *raster1_pol_ptr = polygonFromBox( input_raster1_box );
-  blend_params.SetParameter( "raster1_pol_ptr" , raster1_pol_ptr );
-
-  TeBox input_raster2_box = input_raster2->params().boundingBox();
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr(
-    new TePolygon );  
-  *raster2_pol_ptr = polygonFromBox( input_raster2_box );
-  blend_params.SetParameter( "raster2_pol_ptr" , raster2_pol_ptr );
-  
-  double raster2_pol_offset_x = input_raster1->coord2Index(
-    input_raster2_disk->index2Coord( TeCoord2D( 0, 0 ) ) ).x();
-  blend_params.SetParameter( "raster2_pol_offset_x" , raster2_pol_offset_x );
-  
-  double raster2_pol_offset_y = input_raster1->coord2Index(
-    input_raster2_disk->index2Coord( TeCoord2D( 0, 0 ) ) ).y();
-  blend_params.SetParameter( "raster2_pol_offset_y" , raster2_pol_offset_y );
-
-  blend_params.SetParameter( "auto_equalize" , (int)1 );
-  
-  blend_params.SetParameter( "dummy_value" , (double)0 );
-  
-//  blend_params.SetParameter( "draw_blend_lines" , (double)255 );
-
-  blend_params.SetParameter( "enable_multi_thread" , (int)1 );
-    
-  TePDIBlending blend_instance;
-  TEAGN_TRUE_OR_THROW( blend_instance.Reset(blend_params), "Reset error" );
-  TEAGN_TRUE_OR_THROW( blend_instance.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Blending_euclidian_TeOVERPLAPS_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Euclidian_TeWITHIN_test()
-{
-  TePDIParameters blend_params;
-
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
-    "Unable to init input_raster1" );
-    
-  TePDITypes::TePDIRasterPtrType input_raster2_disk( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster2_disk->init(), 
-    "Unable to init input_raster2" );
-    
-  /* Building a input_raster2 with no projection */
-    
-  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster() );
-  {
-    TeRasterParams input_raster2_params;
-    input_raster2_params.nBands( 1 );
-    input_raster2_params.setDataType( TeUNSIGNEDCHAR, -1 );
-    input_raster2_params.boxResolution( 0, 0, 
-      (double)( input_raster2_disk->params().ncols_ - 1 ),
-      (double)( input_raster2_disk->params().nlines_ - 1 ), 1, 1 );
-      
-    TeProjectionParams projparams;
-    projparams.name = "NoProjection";
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( projparams ) );          
-    input_raster2_params.projection( proj.nakedPointer() );      
-      
-    TEAGN_TRUE_OR_THROW( 
-      ( input_raster2_params.nlines_ == input_raster2_disk->params().nlines_ ),
-      "Invalid box lines" )
-    TEAGN_TRUE_OR_THROW( 
-      ( input_raster2_params.ncols_ == input_raster2_disk->params().ncols_ ),
-      "Invalid box lines" )
-    
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster2,
-      input_raster2_params, false ), "adjust_raster Alloc error" );   
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterBands( input_raster2_disk,
-      input_raster2, false, false ), "Pixel copy error" );
-  }        
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "output_raster Alloc error" );
-    
-  blend_params.SetParameter( "blending_type" , 
-    std::string( "euclidian_blending" ) );
-  blend_params.SetParameter( "input_raster1" , input_raster1 );
-  blend_params.SetParameter( "input_raster2" , input_raster2 );
-  blend_params.SetParameter( "output_raster" , output_raster );
-  
-  std::vector< int > channels1;
-  channels1.push_back( 0 );
-  blend_params.SetParameter( "channels1" , channels1 );
-  
-  std::vector< int > channels2;
-  channels2.push_back( 0 );
-  blend_params.SetParameter( "channels2" , channels2 );
-  
-  TeBox input_raster1_box = input_raster1->params().boundingBox();
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr(
-    new TePolygon );
-  *raster1_pol_ptr = polygonFromBox( input_raster1_box );
-  blend_params.SetParameter( "raster1_pol_ptr" , raster1_pol_ptr );
-
-  TeBox input_raster2_box = input_raster2->params().boundingBox();
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr(
-    new TePolygon );  
-  *raster2_pol_ptr = polygonFromBox( input_raster2_box );
-  blend_params.SetParameter( "raster2_pol_ptr" , raster2_pol_ptr );
-  
-  double raster2_pol_offset_x = input_raster1->coord2Index(
-    input_raster2_disk->index2Coord( TeCoord2D( 0, 0 ) ) ).x();
-  blend_params.SetParameter( "raster2_pol_offset_x" , raster2_pol_offset_x );
-  
-  double raster2_pol_offset_y = input_raster1->coord2Index(
-    input_raster2_disk->index2Coord( TeCoord2D( 0, 0 ) ) ).y();
-  blend_params.SetParameter( "raster2_pol_offset_y" , raster2_pol_offset_y );
-
-  blend_params.SetParameter( "auto_equalize" , (int)1 );
-  
-  blend_params.SetParameter( "dummy_value" , (double)0 );
-  
-  blend_params.SetParameter( "draw_blend_lines" , (double)255 );
-  
-  blend_params.SetParameter( "enable_multi_thread" , (int)1 );
-    
-  TePDIBlending blend_instance;
-  TEAGN_TRUE_OR_THROW( blend_instance.Reset(blend_params), "Reset error" );
-  TEAGN_TRUE_OR_THROW( blend_instance.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Blending_euclidian_TeWITHIN_test.tif" ), "GeoTIF generation error" );
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeInitRasterDecoders();
-    
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-
-    Noblend_TeOVERPLAPS_RGB_test();
-    Noblend_TeWITHIN_test();
-    Euclidian_TeOVERPLAPS_test();
-    Euclidian_TeWITHIN_test();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
diff --git a/examples/image_processing/source/TePDIBlending/TePDIBlending_test.vcproj b/examples/image_processing/source/TePDIBlending/TePDIBlending_test.vcproj
deleted file mode 100755
index d952e49..0000000
--- a/examples/image_processing/source/TePDIBlending/TePDIBlending_test.vcproj
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIBlending_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIBlending_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIBlending_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIBlending_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIBlending_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIClassification/.cvsignore b/examples/image_processing/source/TePDIClassification/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIClassification/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIClassification/TePDIClassification.pro b/examples/image_processing/source/TePDIClassification/TePDIClassification.pro
old mode 100755
new mode 100644
index 2dff703..7804c25
--- a/examples/image_processing/source/TePDIClassification/TePDIClassification.pro
+++ b/examples/image_processing/source/TePDIClassification/TePDIClassification.pro
@@ -1,8 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIClassification_test.cpp \
-
-
-QMAKE_CLEAN += \
-  ../../bin/Classification*.tif
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIClassification_test.cpp \
+
+
+QMAKE_CLEAN += \
+  ../../bin/Classification*.tif
diff --git a/examples/image_processing/source/TePDIClassification/TePDIClassification_test.cpp b/examples/image_processing/source/TePDIClassification/TePDIClassification_test.cpp
index 2e74788..2094197 100644
--- a/examples/image_processing/source/TePDIClassification/TePDIClassification_test.cpp
+++ b/examples/image_processing/source/TePDIClassification/TePDIClassification_test.cpp
@@ -1,211 +1,278 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-#include <TePDIIsosegClas.hpp>
-#include <TePDIKMeansClas.hpp>
-#include <TePDIEMClas.hpp>
-#include <TePDIRegGrowSeg.hpp>
-#include <TePDIUtils.hpp>
-
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeAgnostic.h>
-
-#include <vector>
-
-
-void buildData( TePolygonSet& polset, TePDITypes::TePDIRasterPtrType& raster )
-{
-  TePDIParameters params;
-
-  params.SetParameter( "input_image", raster );
-
-  TePDITypes::TePDIPolSetMapPtrType output_polsets( 
-    new TePDITypes::TePDIPolSetMapType );
-  params.SetParameter( "output_polsets", output_polsets );
-  
-  params.SetParameter( "euc_treshold", (double)20 );
-  params.SetParameter( "area_min", (int)15 );  
-  
-  TePDIRegGrowSeg segmenter;
-  
-  TEAGN_TRUE_OR_THROW( segmenter.Reset(params), "Reset failed" );
-  
-  TEAGN_TRUE_OR_THROW( segmenter.Apply(), "Apply error" );    
-  
-  TePDITypes::TePDIPolSetMapType::iterator psmap_it = 
-    output_polsets->begin();
-  TePDITypes::TePDIPolSetMapType::iterator psmap_it_end = 
-    output_polsets->end();
-    
-  polset.clear();
-    
-  while( psmap_it != psmap_it_end ) {
-    TePolygonSet::iterator ps_it = psmap_it->second.begin();
-    TePolygonSet::iterator ps_it_end = psmap_it->second.end();
-    
-    while( ps_it != ps_it_end ) {
-      polset.add( *ps_it );
-      ++ps_it;  
-    }
-    
-    ++psmap_it;
-  }
-}
-
-
-void IsosegClassification_test( TePolygonSet& polset, 
-  TePDITypes::TePDIRasterPtrType& raster)
-{
-  TePDIParameters params;
-
-  vector<int> bands;
-  bands.push_back(0);
-  bands.push_back(1);
-  bands.push_back(2);
-  params.SetParameter("bands", bands);
-
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  input_rasters.push_back( raster );
-  input_rasters.push_back( raster );
-  input_rasters.push_back( raster );
-  params.SetParameter("input_rasters", input_rasters);
-
-  TePDITypes::TePDIPolygonSetPtrType input_polygonset(  &polset, true );
-  params.SetParameter("input_polygonset", input_polygonset);
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster( output_raster, 1, 1, 1, 
-    false, TeDOUBLE, 0), "output_raster Alloc error");
-  params.SetParameter("output_raster", output_raster);
-  
-  params.SetParameter("acceptance_limiar", (double)90.0);
-
-  TePDIIsosegClas classification;
-  
-  TEAGN_TRUE_OR_THROW(classification.Reset(params), "Reset failed");
-  
-  TEAGN_TRUE_OR_THROW(classification.Apply(), "Apply error");
-  
-  TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_raster, 
-    TEPDIEXAMPLESBINPATH "Classification_Isoseg_test.tif"), "GeoTIF generation error");
-}
-
-
-void KMeansClassification_test( TePDITypes::TePDIRasterPtrType& raster)
-{ 
-  TePDIParameters params;
-
-  params.SetParameter("input_raster", raster);
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster( output_raster, 1, 1, 1, 
-    false, TeDOUBLE, 0), "output_raster Alloc error");
-  params.SetParameter("output_raster", output_raster);
-  
-  vector<int> bands;
-  bands.push_back(0);
-  bands.push_back(1);
-  bands.push_back(2);
-  params.SetParameter("bands", bands);  
-  
-  params.SetParameter("classes_number", (int)10);
-  params.SetParameter("sample", (int)1);
-  params.SetParameter("iterations_number", (int)10);
-  params.SetParameter("line_begin", (int)0);
-  params.SetParameter("line_end", (int)( raster->params().nlines_ - 1 ) );
-  params.SetParameter("column_begin", (int)0);
-  params.SetParameter("column_end", (int)( raster->params().ncols_ - 1 ) );
-
-  TePDIKMeansClas classification;
-  
-  TEAGN_TRUE_OR_THROW(classification.Reset(params), "Reset failed");
-  
-  TEAGN_TRUE_OR_THROW(classification.Apply(), "Apply error");
-  
-  TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_raster, 
-    TEPDIEXAMPLESBINPATH "KMeansClassification_test.tif"), "GeoTIF generation error");
-}
-
-
-void EMClassification_test( TePDITypes::TePDIRasterPtrType& raster)
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  input_rasters.push_back( raster );
-  input_rasters.push_back( raster );
-  input_rasters.push_back( raster );
-  params.SetParameter("input_rasters", input_rasters);
-  
-  vector<int> bands;
-  bands.push_back(0);
-  bands.push_back(1);
-  bands.push_back(2);
-  params.SetParameter("bands", bands);
-  
-  params.SetParameter("classes_to_find", (int)5);
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster( output_raster, 1, 1, 1, 
-    false, TeDOUBLE, 0), "output_raster Alloc error");
-  params.SetParameter("output_raster", output_raster);
-  
-  params.SetParameter("sx", (int)5);
-  params.SetParameter("sy", (int)5);
-  params.SetParameter("max_iterations", (int)3);
-  params.SetParameter("epsilon", (double)3.5);
-  params.SetParameter("shift_threshold", (double)35);
-
-  TePDIEMClas classification;
-  
-  TEAGN_TRUE_OR_THROW(classification.Reset(params), "Factory make failed");
-  
-  TEAGN_TRUE_OR_THROW(classification.Apply(), "Apply error");
-  
-  TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_raster, 
-    TEPDIEXAMPLESBINPATH "EMClassification_test.tif"), "GeoTIF generation error");
-}
-
-int main()
-{
-  TEAGN_LOGMSG("Test started.");
-  
-  try
-  {
-    TeInitRasterDecoders();
-    
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf(dynamic_cast< TeProgressBase* >(&pi));
-    
-    /* Opening image */
-    
-    TePDITypes::TePDIRasterPtrType raster;
-    raster.reset( new TeRaster(
-      std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-    TEAGN_TRUE_OR_THROW( raster->init(), "Unable to init inRaster" );
-    
-    /* Polygons independent algorithms */
-    
-    EMClassification_test( raster );
-    KMeansClassification_test( raster );
-    
-    /* Generating polygons */
-    
-    TePolygonSet polset;
-    buildData( polset, raster );
-    
-    /* Polygons dependent algorithms */
-    
-    IsosegClassification_test( polset, raster );
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-  
-  TEAGN_LOGMSG("Test OK.");
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+#include <TePDISAMClassifier.hpp>
+#include <TePDIIsosegClas.hpp>
+#include <TePDIKMeansClas.hpp>
+#include <TePDIEMClas.hpp>
+#include <TePDIRegGrowSeg.hpp>
+#include <TePDIUtils.hpp>
+
+#include <TeInitRasterDecoders.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeAgnostic.h>
+
+#include <vector>
+
+
+void buildData( TePolygonSet& polset, TePDITypes::TePDIRasterPtrType& raster )
+{
+  TePDIParameters params;
+
+  params.SetParameter( "input_image", raster );
+
+  TePDITypes::TePDIPolSetMapPtrType output_polsets( 
+    new TePDITypes::TePDIPolSetMapType );
+  params.SetParameter( "output_polsets", output_polsets );
+  
+  params.SetParameter( "euc_treshold", (double)20 );
+  params.SetParameter( "area_min", (int)15 );  
+  
+  TePDIRegGrowSeg segmenter;
+  
+  TEAGN_TRUE_OR_THROW( segmenter.Reset(params), "Reset failed" );
+  
+  TEAGN_TRUE_OR_THROW( segmenter.Apply(), "Apply error" );    
+  
+  TePDITypes::TePDIPolSetMapType::iterator psmap_it = 
+    output_polsets->begin();
+  TePDITypes::TePDIPolSetMapType::iterator psmap_it_end = 
+    output_polsets->end();
+    
+  polset.clear();
+    
+  while( psmap_it != psmap_it_end ) {
+    TePolygonSet::iterator ps_it = psmap_it->second.begin();
+    TePolygonSet::iterator ps_it_end = psmap_it->second.end();
+    
+    while( ps_it != ps_it_end ) {
+      polset.add( *ps_it );
+      ++ps_it;  
+    }
+    
+    ++psmap_it;
+  }
+}
+
+void TePDISAMClassifier_test( TePDITypes::TePDIRasterPtrType& raster)
+{ 
+  // Initiating the output RAM raster
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster( output_raster, 1, 1, 1, 
+    false, TeUNSIGNEDCHAR, 0), "output_raster Alloc error");
+    
+  // Creating the vector of input raster used bands
+  
+  std::vector< unsigned int > bands;
+  bands.push_back(0);
+  bands.push_back(1);
+  bands.push_back(2);
+    
+  // Creating the spectral samples vector
+  
+  TePDISAMClassifier::ClassSpectralSamples class1Samples;
+  class1Samples.classId_ = 80;
+  class1Samples.maxAngularDist_ = 0.2;
+  class1Samples.samplesMatrix_.Reset( 1, 3 ); // one sample, 3 bands
+  class1Samples.samplesMatrix_( 0, 0) = 166;
+  class1Samples.samplesMatrix_( 0, 1) = 255;
+  class1Samples.samplesMatrix_( 0, 2) = 255;
+  
+  TePDISAMClassifier::ClassSpectralSamples class2Samples;
+  class2Samples.classId_ = 155;
+  class2Samples.maxAngularDist_ = 0.2;
+  class2Samples.samplesMatrix_.Reset( 1, 3 ); // one sample, 3 bands
+  class2Samples.samplesMatrix_( 0, 0) = 36;
+  class2Samples.samplesMatrix_( 0, 1) = 255;
+  class2Samples.samplesMatrix_( 0, 2) = 76;  
+  
+  TePDISAMClassifier::ClassSpectralSamples class3Samples;
+  class3Samples.classId_ = 255;
+  class2Samples.maxAngularDist_ = 0.2;
+  class3Samples.samplesMatrix_.Reset( 1, 3 ); // one sample, 3 bands
+  class3Samples.samplesMatrix_( 0, 0) = 36;
+  class3Samples.samplesMatrix_( 0, 1) = 36;
+  class3Samples.samplesMatrix_( 0, 2) = 76;    
+  
+  TePDISAMClassifier::SpectralSamplesVecPtrT spectral_samples( new
+    TePDISAMClassifier::SpectralSamplesVectorT );
+  spectral_samples->push_back( class1Samples );
+  spectral_samples->push_back( class2Samples );
+  spectral_samples->push_back( class3Samples );
+  
+  TePDIParameters params;
+  params.SetParameter("input_raster", raster);
+  params.SetParameter("bands", bands);
+  params.SetParameter("output_raster", output_raster);
+  params.SetParameter("spectral_samples", spectral_samples);
+  params.SetParameter("output_raster", output_raster);
+  params.SetParameter("enable_multi_thread", (int)1);
+
+  TePDISAMClassifier classification;
+  
+  TEAGN_TRUE_OR_THROW(classification.Reset(params), "Reset failed");
+  
+  TEAGN_TRUE_OR_THROW(classification.Apply(), "Apply error");
+  
+  TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_raster, 
+    TEPDIEXAMPLESBINPATH "TePDISAMClassifier_test.tif"), 
+    "GeoTIF generation error");
+}
+
+void IsosegClassification_test( TePolygonSet& polset, 
+  TePDITypes::TePDIRasterPtrType& raster)
+{
+  TePDIParameters params;
+
+  vector<int> bands;
+  bands.push_back(0);
+  bands.push_back(1);
+  bands.push_back(2);
+  params.SetParameter("bands", bands);
+
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( raster );
+  input_rasters.push_back( raster );
+  input_rasters.push_back( raster );
+  params.SetParameter("input_rasters", input_rasters);
+
+  TePDITypes::TePDIPolygonSetPtrType input_polygonset(  &polset, true );
+  params.SetParameter("input_polygonset", input_polygonset);
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster( output_raster, 1, 1, 1, 
+    false, TeDOUBLE, 0), "output_raster Alloc error");
+  params.SetParameter("output_raster", output_raster);
+  
+  params.SetParameter("acceptance_limiar", (double)90.0);
+
+  TePDIIsosegClas classification;
+  
+  TEAGN_TRUE_OR_THROW(classification.Reset(params), "Reset failed");
+  
+  TEAGN_TRUE_OR_THROW(classification.Apply(), "Apply error");
+  
+  TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_raster, 
+    TEPDIEXAMPLESBINPATH "Classification_Isoseg_test.tif"), "GeoTIF generation error");
+}
+
+
+void KMeansClassification_test( TePDITypes::TePDIRasterPtrType& raster)
+{ 
+  TePDIParameters params;
+
+  params.SetParameter("input_raster", raster);
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster( output_raster, 1, 1, 1, 
+    false, TeDOUBLE, 0), "output_raster Alloc error");
+  params.SetParameter("output_raster", output_raster);
+  
+  vector<int> bands;
+  bands.push_back(0);
+  bands.push_back(1);
+  bands.push_back(2);
+  params.SetParameter("bands", bands);  
+  
+  params.SetParameter("classes_number", (int)10);
+  params.SetParameter("sample", (int)1);
+  params.SetParameter("iterations_number", (int)10);
+  params.SetParameter("line_begin", (int)0);
+  params.SetParameter("line_end", (int)( raster->params().nlines_ - 1 ) );
+  params.SetParameter("column_begin", (int)0);
+  params.SetParameter("column_end", (int)( raster->params().ncols_ - 1 ) );
+
+  TePDIKMeansClas classification;
+  
+  TEAGN_TRUE_OR_THROW(classification.Reset(params), "Reset failed");
+  
+  TEAGN_TRUE_OR_THROW(classification.Apply(), "Apply error");
+  
+  TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_raster, 
+    TEPDIEXAMPLESBINPATH "KMeansClassification_test.tif"), "GeoTIF generation error");
+}
+
+
+void EMClassification_test( TePDITypes::TePDIRasterPtrType& raster)
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( raster );
+  input_rasters.push_back( raster );
+  input_rasters.push_back( raster );
+  params.SetParameter("input_rasters", input_rasters);
+  
+  vector<int> bands;
+  bands.push_back(0);
+  bands.push_back(1);
+  bands.push_back(2);
+  params.SetParameter("bands", bands);
+  
+  params.SetParameter("classes_to_find", (int)5);
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster( output_raster, 1, 1, 1, 
+    false, TeDOUBLE, 0), "output_raster Alloc error");
+  params.SetParameter("output_raster", output_raster);
+  
+  params.SetParameter("sx", (int)5);
+  params.SetParameter("sy", (int)5);
+  params.SetParameter("max_iterations", (int)3);
+  params.SetParameter("epsilon", (double)3.5);
+  params.SetParameter("shift_threshold", (double)35);
+
+  TePDIEMClas classification;
+  
+  TEAGN_TRUE_OR_THROW(classification.Reset(params), "Factory make failed");
+  
+  TEAGN_TRUE_OR_THROW(classification.Apply(), "Apply error");
+  
+  TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_raster, 
+    TEPDIEXAMPLESBINPATH "EMClassification_test.tif"), "GeoTIF generation error");
+}
+
+int main()
+{
+  TEAGN_LOGMSG("Test started.");
+  
+  try
+  {
+    TeInitRasterDecoders();
+    
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf(dynamic_cast< TeProgressBase* >(&pi));
+    
+    /* Opening image */
+    
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+      std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
+      raster, true ), "Error loading raster" );    
+    
+    /* Polygons independent algorithms */
+    
+    TePDISAMClassifier_test( raster );
+    EMClassification_test( raster );
+    KMeansClassification_test( raster );
+    
+    /* Generating polygons */
+    
+    TePolygonSet polset;
+    buildData( polset, raster );
+    
+    /* Polygons dependent algorithms */
+    
+    IsosegClassification_test( polset, raster );
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+  
+  TEAGN_LOGMSG("Test OK.");
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIClassification/TePDIClassification_test.vcproj b/examples/image_processing/source/TePDIClassification/TePDIClassification_test.vcproj
old mode 100755
new mode 100644
index 3d6d42a..025549c
--- a/examples/image_processing/source/TePDIClassification/TePDIClassification_test.vcproj
+++ b/examples/image_processing/source/TePDIClassification/TePDIClassification_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIClassification_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIClassification_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/shapelib;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIClassification_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIClassification_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIClassification_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIClassification_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIClassification_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/shapelib;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIClassification_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIClassification_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIClassification_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIColorTransform/.cvsignore b/examples/image_processing/source/TePDIColorTransform/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIColorTransform/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform.pro b/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform.pro
old mode 100755
new mode 100644
index 815b961..10e7a4a
--- a/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform.pro
+++ b/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform.pro
@@ -1,5 +1,5 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIColorTransform_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIColorTransform_test.cpp
+
diff --git a/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform_test.cpp b/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform_test.cpp
old mode 100755
new mode 100644
index e7be42f..e0457c0
--- a/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform_test.cpp
+++ b/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform_test.cpp
@@ -1,282 +1,322 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIColorTransform.hpp>
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-
-#include <TeRaster.h>
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-
-void RGB2IHS_IHS2RGB_image_test()
-{
-  TePDITypes::TePDIRasterPtrType IHSRasterPtr;
-  
-  /* Testing RGB -> IHS */
-  {
-    TePDIParameters params;
-    
-    TePDITypes::TePDIRasterPtrType rgb_raster( new TeRaster(
-      std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
-    TEAGN_TRUE_OR_THROW( rgb_raster->init(), 
-      "Unable to init input_raster1" );  
-    
-    TePDITypes::TePDIRasterVectorType input_rasters;
-    input_rasters.push_back( rgb_raster );
-    input_rasters.push_back( rgb_raster );
-    input_rasters.push_back( rgb_raster );
-    params.SetParameter( "input_rasters", input_rasters );
-      
-    std::vector< int > input_channels;
-    input_channels.push_back( 0 );
-    input_channels.push_back( 1 );
-    input_channels.push_back( 2 );
-    params.SetParameter( "input_channels", input_channels );   
-    
-    TeRasterParams outRaster_params;
-    outRaster_params.nBands( 3 );
-    outRaster_params.setNLinesNColumns( 1, 1 );
-    outRaster_params.setDataType( TeFLOAT, -1 );
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( IHSRasterPtr,
-      outRaster_params, false ), "output_raster Alloc error" );  
-      
-    TePDITypes::TePDIRasterVectorType output_rasters;
-    output_rasters.push_back( IHSRasterPtr );
-    params.SetParameter( "output_rasters", output_rasters );    
-      
-    params.SetParameter( "transf_type", TePDIColorTransform::Rgb2Ihs ); 
-    params.SetParameter( "rgb_channels_min", (double)0.0 );
-    params.SetParameter( "rgb_channels_max", (double)255.0 );    
-    
-    TePDIColorTransform ct;
-
-    TEAGN_TRUE_OR_THROW( ct.Reset( params ),
-      "Invalid Parameters" );
-
-    TEAGN_TRUE_OR_THROW( ct.Apply(),
-      "Apply error" );   
-
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( IHSRasterPtr,
-      TEPDIEXAMPLESBINPATH 
-      "TePDIColorTransform_RGB2IHS_IHS2RGB_image_test_ihs.tif" ), 
-      "GeoTIF generation error" );
-  }
-  
-  TePDITypes::TePDIRasterPtrType RGBRasterPtr;
-
-  /* Testing IHS -> RGB */
-  {
-    TePDIParameters params;
-    
-    TePDITypes::TePDIRasterVectorType input_rasters;
-    input_rasters.push_back( IHSRasterPtr );
-    input_rasters.push_back( IHSRasterPtr );
-    input_rasters.push_back( IHSRasterPtr );
-    params.SetParameter( "input_rasters", input_rasters );
-      
-    std::vector< int > input_channels;
-    input_channels.push_back( 0 );
-    input_channels.push_back( 1 );
-    input_channels.push_back( 2 );
-    params.SetParameter( "input_channels", input_channels );   
-    
-    TeRasterParams outRaster_params;
-    outRaster_params.nBands( 3 );
-    outRaster_params.setNLinesNColumns( 1, 1 );
-    outRaster_params.setDataType( TeUNSIGNEDCHAR, -1 );
-    outRaster_params.setPhotometric( TeRasterParams::TeRGB, -1 );
-    
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RGBRasterPtr,
-      outRaster_params, false ), "output_raster Alloc error" );  
-      
-    TePDITypes::TePDIRasterVectorType output_rasters;
-    output_rasters.push_back( RGBRasterPtr );
-    params.SetParameter( "output_rasters", output_rasters );    
-      
-    params.SetParameter( "transf_type", TePDIColorTransform::Ihs2Rgb ); 
-    
-    params.SetParameter( "rgb_channels_min", (double)0.0 );
-    params.SetParameter( "rgb_channels_max", (double)255.0 );    
-    
-    TePDIColorTransform ct;
-
-    TEAGN_TRUE_OR_THROW( ct.Reset( params ),
-      "Invalid Parameters" );
-
-    TEAGN_TRUE_OR_THROW( ct.Apply(),
-      "Apply error" );   
-
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( RGBRasterPtr,
-      TEPDIEXAMPLESBINPATH 
-      "TePDIColorTransform_RGB2IHS_IHS2RGB_image_test_rgb.tif" ), 
-      "GeoTIF generation error" );
-  }
-}
-
-void RGB2IHS_IHS2RGB_numeric_test()
-{
-  /* Testing RGB -> IHS */
-
-  TeRasterParams inRaster_params;
-  inRaster_params.mode_ = 'c';
-  inRaster_params.nBands( 3 );
-  inRaster_params.setNLinesNColumns( 1, 2 );
-  inRaster_params.setDataType( TeUNSIGNEDCHAR, -1 );
-  inRaster_params.decoderIdentifier_ = "SMARTMEM";
-  inRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster( inRaster_params ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), 
-    "inRaster allocation error" );
-    
-  TEAGN_TRUE_OR_THROW( inRaster->setElement( 0, 0, 50., 0 ), "value set" );
-  TEAGN_TRUE_OR_THROW( inRaster->setElement( 0, 0, 100., 1 ), "value set" );
-  TEAGN_TRUE_OR_THROW( inRaster->setElement( 0, 0, 150., 2 ), "value set" );
-  TEAGN_TRUE_OR_THROW( inRaster->setElement( 1, 0, 0., 0 ), "value set" );
-  TEAGN_TRUE_OR_THROW( inRaster->setElement( 1, 0, 200., 1 ), "value set" );
-  TEAGN_TRUE_OR_THROW( inRaster->setElement( 1, 0, 255., 2 ), "value set" );
-
-  TeRasterParams outRaster_params;
-  outRaster_params.mode_ = 'c';
-  outRaster_params.nBands( 3 );
-  outRaster_params.setNLinesNColumns( 1, 1 );
-  outRaster_params.setDataType( TeDOUBLE, -1 );
-  outRaster_params.decoderIdentifier_ = "SMARTMEM";
-  TePDITypes::TePDIRasterPtrType outRaster( new TeRaster( outRaster_params ) );
-  TEAGN_TRUE_OR_THROW( outRaster->init(), 
-    "outRaster allocation error" );
-    
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  input_rasters.push_back( inRaster );
-  input_rasters.push_back( inRaster );
-  input_rasters.push_back( inRaster );
-  params.SetParameter( "input_rasters", input_rasters );
-  
-  std::vector< int > input_channels;
-  input_channels.push_back( 0 );
-  input_channels.push_back( 1 );
-  input_channels.push_back( 2 );
-  params.SetParameter( "input_channels", input_channels );
-  
-  TePDITypes::TePDIRasterVectorType output_rasters;
-  output_rasters.push_back( outRaster );
-  params.SetParameter( "output_rasters", output_rasters );
-  
-  params.SetParameter( "transf_type", TePDIColorTransform::Rgb2Ihs );
-  params.SetParameter( "rgb_channels_min", (double)0.0 );
-  params.SetParameter( "rgb_channels_max", (double)255.0 );   
-
-  TePDIColorTransform ct;
-
-  TEAGN_TRUE_OR_THROW( ct.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( ct.Apply(),
-    "Apply error" );
-
-  double value;
-  TEAGN_TRUE_OR_THROW( outRaster->getElement( 0, 0, value, 0 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 0.392157, 0.0001,
-    "Invalid value" );
-  TEAGN_TRUE_OR_THROW( outRaster->getElement( 0, 0, value, 1 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 3.665191, 0.00001,
-    "Invalid value" );
-  TEAGN_TRUE_OR_THROW( outRaster->getElement( 0, 0, value, 2 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 0.50000, 0.0001,
-    "Invalid value" );
-    
-  TEAGN_TRUE_OR_THROW( outRaster->getElement( 1, 0, value, 0 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 0.594771, 0.0001,
-    "Invalid value" );
-  TEAGN_TRUE_OR_THROW( outRaster->getElement( 1, 0, value, 1 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 3.347980, 0.00001,
-    "Invalid value" );
-  TEAGN_TRUE_OR_THROW( outRaster->getElement( 1, 0, value, 2 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 1.0, 0.0001,
-    "Invalid value" );    
-
-  /* Testing IHS -> RGB */
-  
-  params.Clear();
-
-  TeRasterParams outRaster2_params;
-  outRaster2_params.mode_ = 'c';
-  outRaster2_params.nBands( 3 );
-  outRaster2_params.setNLinesNColumns( 1, 1 );
-  outRaster2_params.setDataType( TeDOUBLE, -1 );
-  outRaster2_params.decoderIdentifier_ = "SMARTMEM";
-  outRaster2_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-  TePDITypes::TePDIRasterPtrType outRaster2( new TeRaster( 
-    outRaster2_params ) );
-  TEAGN_TRUE_OR_THROW( outRaster2->init(), 
-    "outRaster2 allocation error" );  
-    
-  TePDITypes::TePDIRasterVectorType input_rasters2;
-  input_rasters2.push_back( outRaster );
-  input_rasters2.push_back( outRaster );
-  input_rasters2.push_back( outRaster );
-  params.SetParameter( "input_rasters", input_rasters2 );
-  
-  std::vector< int > input_channels2;
-  input_channels2.push_back( 0 );
-  input_channels2.push_back( 1 );
-  input_channels2.push_back( 2 );
-  params.SetParameter( "input_channels", input_channels2 );    
-  
-  TePDITypes::TePDIRasterVectorType output_rasters2;
-  output_rasters2.push_back( outRaster2 );
-  params.SetParameter( "output_rasters", output_rasters2 );  
-
-  params.SetParameter( "transf_type", TePDIColorTransform::Ihs2Rgb );
-  params.SetParameter( "rgb_channels_min", (double)0.0 );
-  params.SetParameter( "rgb_channels_max", (double)255.0 );
-
-  TEAGN_TRUE_OR_THROW( ct.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( ct.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 0, 0, value, 0 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 50.000000, 0.000001, "Invalid value" );
-  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 0, 0, value, 1 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 100., 0.000001, "Invalid value" );
-  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 0, 0, value, 2 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 150., 0.000001, "Invalid value" );
-  
-  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 1, 0, value, 0 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 0.0, 0.000001, "Invalid value" );
-  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 1, 0, value, 1 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 200.0, 0.000001, "Invalid value" );
-  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 1, 0, value, 2 ), "Value get" );
-  TEAGN_CHECK_EPS( value, 255.0, 0.000001, "Invalid value" );  
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
-      
-    TeInitRasterDecoders();
-    
-    RGB2IHS_IHS2RGB_image_test();
-    RGB2IHS_IHS2RGB_numeric_test();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIColorTransform.hpp>
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+
+#include <TeRaster.h>
+#include <TeInitRasterDecoders.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+
+void RGB2IHS_IHS2RGB_image_test()
+{
+  TePDITypes::TePDIRasterPtrType IHSRasterPtr;
+  
+  /* Testing RGB -> IHS */
+  {
+    TePDIParameters params;
+    
+    TePDITypes::TePDIRasterPtrType rgb_raster( new TeRaster(
+      std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+    TEAGN_TRUE_OR_THROW( rgb_raster->init(), 
+      "Unable to init input_raster1" );  
+    
+    TePDITypes::TePDIRasterVectorType input_rasters;
+    input_rasters.push_back( rgb_raster );
+    input_rasters.push_back( rgb_raster );
+    input_rasters.push_back( rgb_raster );
+    params.SetParameter( "input_rasters", input_rasters );
+      
+    std::vector< int > input_channels;
+    input_channels.push_back( 0 );
+    input_channels.push_back( 1 );
+    input_channels.push_back( 2 );
+    params.SetParameter( "input_channels", input_channels );   
+    
+    TeRasterParams outRaster_params;
+    outRaster_params.nBands( 3 );
+    outRaster_params.setNLinesNColumns( 1, 1 );
+    outRaster_params.setDataType( TeFLOAT, -1 );
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( IHSRasterPtr,
+      outRaster_params, false ), "output_raster Alloc error" );  
+      
+    TePDITypes::TePDIRasterVectorType output_rasters;
+    output_rasters.push_back( IHSRasterPtr );
+    params.SetParameter( "output_rasters", output_rasters );    
+      
+    params.SetParameter( "transf_type", TePDIColorTransform::Rgb2Ihs ); 
+    params.SetParameter( "rgb_channels_min", (double)0.0 );
+    params.SetParameter( "rgb_channels_max", (double)255.0 );    
+    
+    TePDIColorTransform ct;
+
+    TEAGN_TRUE_OR_THROW( ct.Reset( params ),
+      "Invalid Parameters" );
+
+    TEAGN_TRUE_OR_THROW( ct.Apply(),
+      "Apply error" );   
+
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( IHSRasterPtr,
+      TEPDIEXAMPLESBINPATH 
+      "TePDIColorTransform_RGB2IHS_IHS2RGB_image_test_ihs.tif" ), 
+      "GeoTIF generation error" );
+  }
+  
+  TePDITypes::TePDIRasterPtrType RGBRasterPtr;
+
+  /* Testing IHS -> RGB */
+  {
+    TePDIParameters params;
+    
+    TePDITypes::TePDIRasterVectorType input_rasters;
+    input_rasters.push_back( IHSRasterPtr );
+    input_rasters.push_back( IHSRasterPtr );
+    input_rasters.push_back( IHSRasterPtr );
+    params.SetParameter( "input_rasters", input_rasters );
+      
+    std::vector< int > input_channels;
+    input_channels.push_back( 0 );
+    input_channels.push_back( 1 );
+    input_channels.push_back( 2 );
+    params.SetParameter( "input_channels", input_channels );   
+    
+    TeRasterParams outRaster_params;
+    outRaster_params.nBands( 3 );
+    outRaster_params.setNLinesNColumns( 1, 1 );
+    outRaster_params.setDataType( TeUNSIGNEDCHAR, -1 );
+    outRaster_params.setPhotometric( TeRasterParams::TeRGB, -1 );
+    
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RGBRasterPtr,
+      outRaster_params, false ), "output_raster Alloc error" );  
+      
+    TePDITypes::TePDIRasterVectorType output_rasters;
+    output_rasters.push_back( RGBRasterPtr );
+    params.SetParameter( "output_rasters", output_rasters );    
+      
+    params.SetParameter( "transf_type", TePDIColorTransform::Ihs2Rgb ); 
+    
+    params.SetParameter( "rgb_channels_min", (double)0.0 );
+    params.SetParameter( "rgb_channels_max", (double)255.0 );    
+    
+    TePDIColorTransform ct;
+
+    TEAGN_TRUE_OR_THROW( ct.Reset( params ),
+      "Invalid Parameters" );
+
+    TEAGN_TRUE_OR_THROW( ct.Apply(),
+      "Apply error" );   
+
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( RGBRasterPtr,
+      TEPDIEXAMPLESBINPATH 
+      "TePDIColorTransform_RGB2IHS_IHS2RGB_image_test_rgb.tif" ), 
+      "GeoTIF generation error" );
+  }
+}
+
+void RGB2IHS_IHS2RGB_numeric_test()
+{
+  /* Testing RGB -> IHS */
+
+  TeRasterParams inRaster_params;
+  inRaster_params.mode_ = 'c';
+  inRaster_params.nBands( 3 );
+  inRaster_params.setNLinesNColumns( 1, 4 );
+  inRaster_params.setDataType( TeUNSIGNEDCHAR, -1 );
+  inRaster_params.decoderIdentifier_ = "SMARTMEM";
+  inRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster( inRaster_params ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), 
+    "inRaster allocation error" );
+    
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 0, 0, 50., 0 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 0, 0, 50., 1 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 0, 0, 50., 2 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 1, 0, 0., 0 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 1, 0, 200., 1 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 1, 0, 255., 2 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 2, 0, 0.0, 0 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 2, 0, 0.0, 1 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 2, 0, 0.0, 2 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 3, 0, 255.0, 0 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 3, 0, 255.0, 1 ), "value set" );
+  TEAGN_TRUE_OR_THROW( inRaster->setElement( 3, 0, 255.0, 2 ), "value set" );
+
+  TeRasterParams outRaster_params;
+  outRaster_params.mode_ = 'c';
+  outRaster_params.nBands( 3 );
+  outRaster_params.setNLinesNColumns( 1, 1 );
+  outRaster_params.setDataType( TeDOUBLE, -1 );
+  outRaster_params.decoderIdentifier_ = "SMARTMEM";
+  TePDITypes::TePDIRasterPtrType outRaster( new TeRaster( outRaster_params ) );
+  TEAGN_TRUE_OR_THROW( outRaster->init(), 
+    "outRaster allocation error" );
+    
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( inRaster );
+  input_rasters.push_back( inRaster );
+  input_rasters.push_back( inRaster );
+  params.SetParameter( "input_rasters", input_rasters );
+  
+  std::vector< int > input_channels;
+  input_channels.push_back( 0 );
+  input_channels.push_back( 1 );
+  input_channels.push_back( 2 );
+  params.SetParameter( "input_channels", input_channels );
+  
+  TePDITypes::TePDIRasterVectorType output_rasters;
+  output_rasters.push_back( outRaster );
+  params.SetParameter( "output_rasters", output_rasters );
+  
+  params.SetParameter( "transf_type", TePDIColorTransform::Rgb2Ihs );
+  params.SetParameter( "rgb_channels_min", (double)0.0 );
+  params.SetParameter( "rgb_channels_max", (double)255.0 );   
+
+  TePDIColorTransform ct;
+
+  TEAGN_TRUE_OR_THROW( ct.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( ct.Apply(),
+    "Apply error" );
+
+  double value;
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 0, 0, value, 0 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.196078, 0.0001,
+    "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 0, 0, value, 1 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.00001,
+    "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 0, 0, value, 2 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.0001,
+    "Invalid value" );
+    
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 1, 0, value, 0 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.594771, 0.0001,
+    "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 1, 0, value, 1 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 3.347980, 0.00001,
+    "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 1, 0, value, 2 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 1.0, 0.0001,
+    "Invalid value" );   
+     
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 2, 0, value, 0 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.0001,
+    "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 2, 0, value, 1 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.00001,
+    "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 2, 0, value, 2 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.0001,
+    "Invalid value" );     
+    
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 3, 0, value, 0 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 1.0, 0.0001,
+    "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 3, 0, value, 1 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.00001,
+    "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster->getElement( 3, 0, value, 2 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.0001,
+    "Invalid value" );        
+
+  /* Testing IHS -> RGB */
+  
+  params.Clear();
+
+  TeRasterParams outRaster2_params;
+  outRaster2_params.mode_ = 'c';
+  outRaster2_params.nBands( 3 );
+  outRaster2_params.setNLinesNColumns( 1, 1 );
+  outRaster2_params.setDataType( TeDOUBLE, -1 );
+  outRaster2_params.decoderIdentifier_ = "SMARTMEM";
+  outRaster2_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+  TePDITypes::TePDIRasterPtrType outRaster2( new TeRaster( 
+    outRaster2_params ) );
+  TEAGN_TRUE_OR_THROW( outRaster2->init(), 
+    "outRaster2 allocation error" );  
+    
+  TePDITypes::TePDIRasterVectorType input_rasters2;
+  input_rasters2.push_back( outRaster );
+  input_rasters2.push_back( outRaster );
+  input_rasters2.push_back( outRaster );
+  params.SetParameter( "input_rasters", input_rasters2 );
+  
+  std::vector< int > input_channels2;
+  input_channels2.push_back( 0 );
+  input_channels2.push_back( 1 );
+  input_channels2.push_back( 2 );
+  params.SetParameter( "input_channels", input_channels2 );    
+  
+  TePDITypes::TePDIRasterVectorType output_rasters2;
+  output_rasters2.push_back( outRaster2 );
+  params.SetParameter( "output_rasters", output_rasters2 );  
+
+  params.SetParameter( "transf_type", TePDIColorTransform::Ihs2Rgb );
+  params.SetParameter( "rgb_channels_min", (double)0.0 );
+  params.SetParameter( "rgb_channels_max", (double)255.0 );
+
+  TEAGN_TRUE_OR_THROW( ct.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( ct.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 0, 0, value, 0 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 50.0, 0.000001, "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 0, 0, value, 1 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 50.0, 0.000001, "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 0, 0, value, 2 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 50.0, 0.000001, "Invalid value" );
+  
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 1, 0, value, 0 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.000001, "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 1, 0, value, 1 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 200.0, 0.000001, "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 1, 0, value, 2 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 255.0, 0.000001, "Invalid value" );  
+  
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 2, 0, value, 0 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.000001, "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 2, 0, value, 1 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.000001, "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 2, 0, value, 2 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 0.0, 0.000001, "Invalid value" );    
+  
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 3, 0, value, 0 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 255.0, 0.000001, "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 3, 0, value, 1 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 255.0, 0.000001, "Invalid value" );
+  TEAGN_TRUE_OR_THROW( outRaster2->getElement( 3, 0, value, 2 ), "Value get" );
+  TEAGN_CHECK_EPS( value, 255.0, 0.000001, "Invalid value" );      
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
+      
+    TeInitRasterDecoders();
+    
+    RGB2IHS_IHS2RGB_image_test();
+    RGB2IHS_IHS2RGB_numeric_test();
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform_test.vcproj b/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform_test.vcproj
old mode 100755
new mode 100644
index d0d51ff..13d8ff4
--- a/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform_test.vcproj
+++ b/examples/image_processing/source/TePDIColorTransform/TePDIColorTransform_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIColorTransform_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIColorTransform_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIColorTransform_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIColorTransform_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIColorTransform_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIColorTransform_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIColorTransform_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIColorTransform_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIColorTransform_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIColorTransform_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIContrast/.cvsignore b/examples/image_processing/source/TePDIContrast/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIContrast/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIContrast/TePDIContrast.pro b/examples/image_processing/source/TePDIContrast/TePDIContrast.pro
old mode 100755
new mode 100644
index 5d04a9f..b22729f
--- a/examples/image_processing/source/TePDIContrast/TePDIContrast.pro
+++ b/examples/image_processing/source/TePDIContrast/TePDIContrast.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIContrast_test.cpp
-
-QMAKE_CLEAN += \
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIContrast_test.cpp
+
+QMAKE_CLEAN += \
   ../../bin/TePDIContrast*
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIContrast/TePDIContrast_test.cpp b/examples/image_processing/source/TePDIContrast/TePDIContrast_test.cpp
old mode 100755
new mode 100644
index cd01149..bb132d1
--- a/examples/image_processing/source/TePDIContrast/TePDIContrast_test.cpp
+++ b/examples/image_processing/source/TePDIContrast/TePDIContrast_test.cpp
@@ -1,548 +1,534 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIContrast.hpp>
-#include <TePDIParameters.hpp>
-#include <TePDIUtils.hpp>
-#include <TePDIRgbPaletteFunctions.hpp>
-
-#include <TeRaster.h>
-#include <TeDataTypes.h>
-#include <TeDecoderTIFF.h>
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeTime.h>
-
-#include <TeAgnostic.h>
-
-#include <string>
-
-void TePDIContrastMinMax_autolevels_test()
-{
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastMinMax;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "input_band", (int)0 );
-  params.SetParameter( "output_band", (int)0 );
-  
-  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
-  params.SetParameter( "outlut", outlut );
-
-  TePDIContrast contra;
-
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIContrastMinMax_autolevels_test.tif" ), "GeoTIF generation error" );
-    
-  /* Checking the generated lut */
-  
-  TEAGN_CHECK_EPS( outlut->size(), 256, 0, "Invalid lut size" );
-}
-
-
-void TePDIContrastMinMax_no_input_image_test()
-{
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastMinMax;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDIHistogram::pointer input_histogram( new TePDIHistogram );
-  {
-    TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-      std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-    TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-    
-    input_histogram->reset( inRaster, 0, 0, true, TeBoxPixelIn );
-    params.SetParameter( "input_histogram", input_histogram );
-  }
-  
-  params.SetParameter( "output_channel_min_level", (double)0 );
-  params.SetParameter( "output_channel_max_level", (double)255 );
-  
-  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
-  params.SetParameter( "outlut", outlut );
-
-  TePDIContrast contra;
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );  
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-    
-  /* Checking the generated lut */
-
-  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
-}
-
-
-void TePDIContrastLinear_plus_histo_test()
-{
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastLinear;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-  
-  /* Creating the histogram */
-  
-  TePDIHistogram::pointer input_histogram( new TePDIHistogram );
-  TEAGN_TRUE_OR_THROW( input_histogram->reset( inRaster, 0, 256, 
-    true, TeBoxPixelIn ),
-    "Histogram building error" );
-  TEAGN_TRUE_OR_THROW( ( input_histogram->size() == 256 ),
-    "Invalid Histogram" );    
-  params.SetParameter( "input_histogram", input_histogram );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "input_band", (int)0 );
-  params.SetParameter( "output_band", (int)0 );
-
-  params.SetParameter( "min_level", (double)46 );
-  params.SetParameter( "max_level", (double)102 );
-  
-  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
-  params.SetParameter( "outlut", outlut );  
-
-  TePDIContrast contra;
-
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIContrastLinear_plus_histo_test.tif" ), "GeoTIF generation error" );
-    
-  /* Checking the generated lut */
-  
-  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
-}
-
-void TePDIContrastSquareRoot_test()
-{
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastSquareRoot;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "input_band", (int)0 );
-  params.SetParameter( "output_band", (int)0 );
-
-  params.SetParameter( "histo_levels", (int)256 );
-
-  params.SetParameter( "min_level", (double)46 );
-  params.SetParameter( "max_level", (double)102 );
-  
-  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
-  params.SetParameter( "outlut", outlut );  
-
-  TePDIContrast contra;
-
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIContrastSquareRoot_test.tif" ), "GeoTIF generation error" );
-    
-  /* Checking the generated lut */
-  
-  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
-}
-
-void TePDIContrastSquare_test()
-{
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastSquare;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "input_band", (int)0 );
-  params.SetParameter( "output_band", (int)0 );
-
-  params.SetParameter( "histo_levels", (int)256 );
-
-  params.SetParameter( "min_level", (double)46 );
-  params.SetParameter( "max_level", (double)102 );
-  
-  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
-  params.SetParameter( "outlut", outlut );  
-
-  TePDIContrast contra;
-
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIContrastSquare_test.tif" ), "GeoTIF generation error" );
-    
-  /* Checking the generated lut */
-  
-  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
-}
-
-void TePDIContrastLog_test()
-{
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastLog;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "input_band", (int)0 );
-  params.SetParameter( "output_band", (int)0 );
-
-  params.SetParameter( "histo_levels", (int)256 );
-
-  params.SetParameter( "min_level", (double)46 );
-  params.SetParameter( "max_level", (double)102 );
-  
-  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
-  params.SetParameter( "outlut", outlut );  
-
-  TePDIContrast contra;
-
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIContrastLog_test.tif" ), "GeoTIF generation error" );
-    
-  /* Checking the generated lut */
-  
-  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
-}
-
-
-void TePDIContrastLog_with_use_dummy_test()
-{
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastLog;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "input_band", (int)0 );
-  params.SetParameter( "output_band", (int)0 );
-
-  params.SetParameter( "histo_levels", (int)256 );
-
-  params.SetParameter( "min_level", (double)46 );
-  params.SetParameter( "max_level", (double)102 );
-  
-  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
-  params.SetParameter( "outlut", outlut );  
-  
-  params.SetParameter( "dummy_value", (double)0 );  
-
-  TePDIContrast contra;
-
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIContrastLog_with_use_dummy_test.tif" ), "GeoTIF generation error" );
-    
-  /* Checking the generated lut */
-  
-  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
-}
-
-
-void TePDIContrastNegative_test()
-{
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastNegative;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "input_band", (int)0 );
-  params.SetParameter( "output_band", (int)0 );
-
-  params.SetParameter( "histo_levels", (int)256 );
-
-  params.SetParameter( "min_level", (double)46 );
-  params.SetParameter( "max_level", (double)102 );
-  
-  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
-  params.SetParameter( "outlut", outlut );  
-
-  TePDIContrast contra;
-
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIContrastNegative_test.tif" ), "GeoTIF generation error" );
-    
-  /* Checking the generated lut */
-  
-  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
-}
-
-void TePDIContrastHistEqualizer_test()
-{
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastHistEqualizer;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "input_band", (int)0 );
-  params.SetParameter( "output_band", (int)0 );
-
-  params.SetParameter( "histo_levels", (int)256 );
-
-  params.SetParameter( "min_level", (double)46 );
-  params.SetParameter( "max_level", (double)102 );
-  
-  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
-  params.SetParameter( "outlut", outlut );  
-
-  TePDIContrast contra;
-
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIContrastHistEqualizer_test.tif" ), "GeoTIF generation error" );
-    
-  /* Checking the generated lut */
-  
-  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
-}
-
-void TePDIContrastSimpleSlicer_test()
-{
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastSimpleSlicer;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "input_band", (int)0 );
-  params.SetParameter( "output_band", (int)0 );
-
-  params.SetParameter( "histo_levels", (int)( 102 - 47 + 1 ) );
-
-  params.SetParameter( "min_level", (double)47 );
-  params.SetParameter( "max_level", (double)102 );
-  
-  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
-  params.SetParameter( "outlut", outlut );  
-
-  TePDIRgbPalette::pointer pal =
-    TePDIRgbPaletteFunctions::createLSBPalette( 20 );
-  params.SetParameter( "rgb_palette", pal );
-
-  TePDIContrast contra;
-
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIContrastSimpleSlicer_test.tif" ), "GeoTIF generation error" );
-    
-  /* Checking the generated lut */
-  
-  TEAGN_TRUE_OR_THROW( ( outlut->size() == 56 ), "Invalid lut size" );
-}
-
-
-void TePDIContrastStat_test()
-{
-  /* from "../resources/cbers_b2_crop_contraste.tif" */   
-  double target_mean = 121.809123;
-  double target_variance = 1561.214764;
-  
-  /* Building contrast parameters */
-
-  TePDIParameters params;
-
-  TePDIContrast::TePDIContrastType contrast_type = 
-    TePDIContrast::TePDIContrastStat;
-  params.SetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  params.SetParameter( "input_band", (int)0 );
-  params.SetParameter( "output_band", (int)0 );
-  params.SetParameter( "target_mean", target_mean );
-  params.SetParameter( "target_variance", target_variance );
-
-  TePDIContrast contra;
-
-  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( contra.Apply(),
-    "Apply error" );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDIContrastStat_test.tif" ), "GeoTIF generation error" );
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeInitRasterDecoders();
-    
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );    
-
-    TePDIContrastLinear_plus_histo_test();
-    TePDIContrastStat_test();
-    TePDIContrastMinMax_autolevels_test();
-    TePDIContrastMinMax_no_input_image_test();
-    TePDIContrastSquareRoot_test();
-    TePDIContrastSquare_test();
-    TePDIContrastLog_test();
-    TePDIContrastLog_with_use_dummy_test();
-    TePDIContrastNegative_test();
-    TePDIContrastHistEqualizer_test();
-    TePDIContrastSimpleSlicer_test();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIContrast.hpp>
+#include <TePDIParameters.hpp>
+#include <TePDIUtils.hpp>
+#include <TePDIRgbPaletteFunctions.hpp>
+
+#include <TeRaster.h>
+#include <TeDataTypes.h>
+#include <TeDecoderTIFF.h>
+#include <TeInitRasterDecoders.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeTime.h>
+
+#include <TeAgnostic.h>
+
+#include <string>
+
+void TePDIContrastMinMax_autolevels_test()
+{
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastMinMax;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  params.SetParameter( "input_band", (int)0 );
+  params.SetParameter( "output_band", (int)0 );
+  
+  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
+  params.SetParameter( "outlut", outlut );
+
+  TePDIContrast contra;
+
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDIContrastMinMax_autolevels_test.tif" ), "GeoTIF generation error" );
+    
+  /* Checking the generated lut */
+  
+  TEAGN_CHECK_EPS( outlut->size(), 256, 0, "Invalid lut size" );
+}
+
+
+void TePDIContrastMinMax_no_input_image_test()
+{
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastMinMax;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDIHistogram::pointer input_histogram( new TePDIHistogram );
+  {
+    TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+      std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+    TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+    
+    input_histogram->reset( inRaster, 0, 0, TeBoxPixelIn );
+    params.SetParameter( "input_histogram", input_histogram );
+  }
+  
+  params.SetParameter( "output_channel_min_level", (double)0 );
+  params.SetParameter( "output_channel_max_level", (double)255 );
+  
+  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
+  params.SetParameter( "outlut", outlut );
+
+  TePDIContrast contra;
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );  
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+    
+  /* Checking the generated lut */
+
+  TEAGN_CHECK_EPS( outlut->size(), 180, 0, "Invalid lut size" );
+}
+
+
+void TePDIContrastLinear_plus_histo_test()
+{
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastLinear;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+  
+  /* Creating the histogram */
+  
+  TePDIHistogram::pointer input_histogram( new TePDIHistogram );
+  TEAGN_TRUE_OR_THROW( input_histogram->reset( inRaster, 0, 256, 
+    TeBoxPixelIn ),
+    "Histogram building error" );
+  params.SetParameter( "input_histogram", input_histogram );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  params.SetParameter( "input_band", (int)0 );
+  params.SetParameter( "output_band", (int)0 );
+
+  params.SetParameter( "min_level", (double)46 );
+  params.SetParameter( "max_level", (double)102 );
+  
+  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
+  params.SetParameter( "outlut", outlut );  
+
+  TePDIContrast contra;
+
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDIContrastLinear_plus_histo_test.tif" ), "GeoTIF generation error" );
+}
+
+void TePDIContrastSquareRoot_test()
+{
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastSquareRoot;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  params.SetParameter( "input_band", (int)0 );
+  params.SetParameter( "output_band", (int)0 );
+
+  params.SetParameter( "histo_levels", (int)256 );
+
+  params.SetParameter( "min_level", (double)46 );
+  params.SetParameter( "max_level", (double)102 );
+  
+  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
+  params.SetParameter( "outlut", outlut );  
+
+  TePDIContrast contra;
+
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDIContrastSquareRoot_test.tif" ), "GeoTIF generation error" );
+    
+  /* Checking the generated lut */
+  
+  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
+}
+
+void TePDIContrastSquare_test()
+{
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastSquare;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  params.SetParameter( "input_band", (int)0 );
+  params.SetParameter( "output_band", (int)0 );
+
+  params.SetParameter( "histo_levels", (int)256 );
+
+  params.SetParameter( "min_level", (double)46 );
+  params.SetParameter( "max_level", (double)102 );
+  
+  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
+  params.SetParameter( "outlut", outlut );  
+
+  TePDIContrast contra;
+
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDIContrastSquare_test.tif" ), "GeoTIF generation error" );
+    
+  /* Checking the generated lut */
+  
+  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
+}
+
+void TePDIContrastLog_test()
+{
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastLog;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  params.SetParameter( "input_band", (int)0 );
+  params.SetParameter( "output_band", (int)0 );
+
+  params.SetParameter( "histo_levels", (int)256 );
+
+  params.SetParameter( "min_level", (double)46 );
+  params.SetParameter( "max_level", (double)102 );
+  
+  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
+  params.SetParameter( "outlut", outlut );  
+
+  TePDIContrast contra;
+
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDIContrastLog_test.tif" ), "GeoTIF generation error" );
+    
+  /* Checking the generated lut */
+  
+  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
+}
+
+
+void TePDIContrastLog_with_use_dummy_test()
+{
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastLog;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  params.SetParameter( "input_band", (int)0 );
+  params.SetParameter( "output_band", (int)0 );
+
+  params.SetParameter( "histo_levels", (int)256 );
+
+  params.SetParameter( "min_level", (double)46 );
+  params.SetParameter( "max_level", (double)102 );
+  
+  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
+  params.SetParameter( "outlut", outlut );  
+  
+  params.SetParameter( "dummy_value", (double)0 );  
+
+  TePDIContrast contra;
+
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDIContrastLog_with_use_dummy_test.tif" ), "GeoTIF generation error" );
+    
+  /* Checking the generated lut */
+  
+  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
+}
+
+
+void TePDIContrastNegative_test()
+{
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastNegative;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  params.SetParameter( "input_band", (int)0 );
+  params.SetParameter( "output_band", (int)0 );
+
+  params.SetParameter( "histo_levels", (int)256 );
+
+  params.SetParameter( "min_level", (double)46 );
+  params.SetParameter( "max_level", (double)102 );
+  
+  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
+  params.SetParameter( "outlut", outlut );  
+
+  TePDIContrast contra;
+
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDIContrastNegative_test.tif" ), "GeoTIF generation error" );
+    
+  /* Checking the generated lut */
+  
+  TEAGN_TRUE_OR_THROW( ( outlut->size() == 256 ), "Invalid lut size" );
+}
+
+void TePDIContrastHistEqualizer_test()
+{
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastHistEqualizer;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  params.SetParameter( "input_band", (int)0 );
+  params.SetParameter( "output_band", (int)0 );
+
+  params.SetParameter( "histo_levels", (int)256 );
+
+  params.SetParameter( "min_level", (double)46 );
+  params.SetParameter( "max_level", (double)102 );
+  
+  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
+  params.SetParameter( "outlut", outlut );  
+
+  TePDIContrast contra;
+
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDIContrastHistEqualizer_test.tif" ), "GeoTIF generation error" );
+    
+  /* Checking the generated lut */
+  
+  TEAGN_CHECK_EPS( outlut->size(), 180, 0, "Invalid lut size" );
+}
+
+void TePDIContrastSimpleSlicer_test()
+{
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastSimpleSlicer;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  params.SetParameter( "input_band", (int)0 );
+  params.SetParameter( "output_band", (int)0 );
+
+  params.SetParameter( "histo_levels", (int)( 102 - 47 + 1 ) );
+
+  params.SetParameter( "min_level", (double)47 );
+  params.SetParameter( "max_level", (double)102 );
+  
+  TePDITypes::TePDILutPtrType outlut( new TePDITypes::TePDILutType );
+  params.SetParameter( "outlut", outlut );  
+
+  TePDIRgbPalette::pointer pal =
+    TePDIRgbPaletteFunctions::createLSBPalette( 20 );
+  params.SetParameter( "rgb_palette", pal );
+
+  TePDIContrast contra;
+
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDIContrastSimpleSlicer_test.tif" ), "GeoTIF generation error" );
+    
+  /* Checking the generated lut */
+  
+  TEAGN_TRUE_OR_THROW( ( outlut->size() == 56 ), "Invalid lut size" );
+}
+
+
+void TePDIContrastStat_test()
+{
+  /* from "../resources/cbers_b2_crop_contraste.tif" */   
+  double target_mean = 121.809123;
+  double target_variance = 1561.214764;
+  
+  /* Building contrast parameters */
+
+  TePDIParameters params;
+
+  TePDIContrast::TePDIContrastType contrast_type = 
+    TePDIContrast::TePDIContrastStat;
+  params.SetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  params.SetParameter( "input_band", (int)0 );
+  params.SetParameter( "output_band", (int)0 );
+  params.SetParameter( "target_mean", target_mean );
+  params.SetParameter( "target_variance", target_variance );
+
+  TePDIContrast contra;
+
+  TEAGN_TRUE_OR_THROW( contra.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( contra.Apply(),
+    "Apply error" );
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDIContrastStat_test.tif" ), "GeoTIF generation error" );
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+    
+  TeStdIOProgress pi;
+  TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );    
+
+  TePDIContrastLinear_plus_histo_test();
+  TePDIContrastStat_test();
+  TePDIContrastMinMax_autolevels_test();
+  TePDIContrastMinMax_no_input_image_test();
+  TePDIContrastSquareRoot_test();
+  TePDIContrastSquare_test();
+  TePDIContrastLog_test();
+  TePDIContrastLog_with_use_dummy_test();
+  TePDIContrastNegative_test();
+  TePDIContrastHistEqualizer_test();
+  TePDIContrastSimpleSlicer_test();
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIContrast/TePDIContrast_test.vcproj b/examples/image_processing/source/TePDIContrast/TePDIContrast_test.vcproj
old mode 100755
new mode 100644
index ffb4f4b..6fea4ab
--- a/examples/image_processing/source/TePDIContrast/TePDIContrast_test.vcproj
+++ b/examples/image_processing/source/TePDIContrast/TePDIContrast_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIContrast_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIContrast_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIContrast_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/tiff;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIContrast_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIContrast_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIContrast_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIContrast_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIContrast_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/tiff;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIContrast_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIContrast_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDICorrelationMatching/.cvsignore b/examples/image_processing/source/TePDICorrelationMatching/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDICorrelationMatching/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching.pro b/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching.pro
index 67a1882..429cd0b 100644
--- a/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching.pro
+++ b/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDICorrelationMatching_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/TePDICorrelationMatching*.tif
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDICorrelationMatching_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/TePDICorrelationMatching*.tif
diff --git a/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching_test.cpp b/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching_test.cpp
index d8ae8b5..ecd7e4e 100644
--- a/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching_test.cpp
+++ b/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching_test.cpp
@@ -1,486 +1,588 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDICorrelationMatching.hpp>
-#include <TePDIUtils.hpp>
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeAgnostic.h>
-
-#include <math.h>
-
-
-void raster2Tiff( 
-  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-  unsigned int raster_channel,
-  const std::string& out_file_name,
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr,
-  unsigned int tie_points_space )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
-    "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
-    "Invalid matrix cols" )
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
-    input_raster_ptr->params().ncols_ );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  double value = 0;
-  
-  for( int line = 0 ; 
-    line < input_raster_ptr->params().nlines_ ; ++line ) {
-    for( int col = 0 ; 
-      col < input_raster_ptr->params().ncols_ ; 
-      ++col ) {
-      
-      input_raster_ptr->getElement( col, line, value, 
-        raster_channel );
-      
-
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        value, 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw tie-points */
-  
-  if( out_tie_points_ptr.isActive() ) {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      int x = 0;
-      int y = 0;
-      
-      if( tie_points_space == 0 ) {
-         x = TeRound( it->pt1.x() );
-         y = TeRound( it->pt1.y() );
-      } else {
-         x = TeRound( it->pt2.x() );
-         y = TeRound( it->pt2.y() );
-      }
-      
-      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
-        "Invalid maxima column" )
-      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-        "Invalid maxima column" )      
-      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
-        "Invalid maxima line" )
-      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-        "Invalid maxima line" )      
-      
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-        255.0, 0 ),
-        "Error writing raster" )    
-    
-      ++it;
-    }
-  
-  }
-}
-
-void sameImageTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box1( TeCoord2D( 142, 826 ) , 
-    TeCoord2D( 542, 426 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 238, 689 ) , 
-    TeCoord2D( 391, 473 ) );
-  params.SetParameter( "input_box2" , input_box2 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  double best_cor_value = 0;
-  params.SetParameter( "best_cor_value_ptr" , &best_cor_value ); 
-  
-  TePDICorrelationMatching corr_instance; 
-  corr_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( corr_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( corr_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-  TEAGN_WATCH( best_cor_value );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDICorrelationMatching_test_sameImageTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDICorrelationMatching_test_sameImageTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-
-void sameImageTest2()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box2( TeCoord2D( 142, 826 ) , 
-    TeCoord2D( 542, 426 ) );
-  params.SetParameter( "input_box2" , input_box2 );
-  
-  TeBox input_box1( TeCoord2D( 238, 689 ) , 
-    TeCoord2D( 391, 473 ) );
-  params.SetParameter( "input_box1" , input_box1 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  double best_cor_value = 0;
-  params.SetParameter( "best_cor_value_ptr" , &best_cor_value );  
-  
-  TePDICorrelationMatching corr_instance; 
-  corr_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( corr_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( corr_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  TEAGN_WATCH( best_cor_value );    
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDICorrelationMatching_test_sameImageTest2_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDICorrelationMatching_test_sameImageTest2_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-
-void halfsampledImageTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box1( TeCoord2D( 198, 486 ) , 
-    TeCoord2D( 577, 186 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 143, 180 ) , 
-    TeCoord2D( 227, 113 ) );
-  params.SetParameter( "input_box2" , input_box2 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
-  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
-  
-  double best_cor_value = 0;
-  params.SetParameter( "best_cor_value_ptr" , &best_cor_value );   
-  
-  TePDICorrelationMatching corr_instance; 
-  corr_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( corr_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( corr_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-  TEAGN_WATCH( best_cor_value );    
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDICorrelationMatching_test_halfsampledImageTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDICorrelationMatching_test_halfsampledImageTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-
-void halfsampledImageTest2()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box2( TeCoord2D( 198, 486 ) , 
-    TeCoord2D( 577, 186 ) );
-  params.SetParameter( "input_box2" , input_box2 );
-  
-  TeBox input_box1( TeCoord2D( 143, 180 ) , 
-    TeCoord2D( 227, 113 ) );
-  params.SetParameter( "input_box1" , input_box1 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)2 ); 
-  params.SetParameter( "pixel_y_relation" , (double)2 ); 
-  
-  double best_cor_value = 0;
-  params.SetParameter( "best_cor_value_ptr" , &best_cor_value );   
-  
-  TePDICorrelationMatching corr_instance; 
-  corr_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( corr_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( corr_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-  TEAGN_WATCH( best_cor_value );    
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDICorrelationMatching_test_halfsampledImageTest2_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDICorrelationMatching_test_halfsampledImageTest2_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-    
-    time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-    sameImageTest();
-    sameImageTest2();
-    halfsampledImageTest();
-    halfsampledImageTest2();
-    
-    time_t end_time = clock() / CLOCKS_PER_SEC;
-    
-    TEAGN_LOGMSG( "Total elapsed time: " + 
-      TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-      " seconds" );    
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }  
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDICorrelationMatching.hpp>
+#include <TePDIUtils.hpp>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeAgnostic.h>
+
+#include <math.h>
+
+
+void raster2Tiff( 
+  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+  unsigned int raster_channel,
+  const std::string& out_file_name,
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr,
+  unsigned int tie_points_space )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
+    "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
+    "Invalid matrix cols" )
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
+    input_raster_ptr->params().ncols_ );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  double value = 0;
+  
+  for( int line = 0 ; 
+    line < input_raster_ptr->params().nlines_ ; ++line ) {
+    for( int col = 0 ; 
+      col < input_raster_ptr->params().ncols_ ; 
+      ++col ) {
+      
+      input_raster_ptr->getElement( col, line, value, 
+        raster_channel );
+      
+
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        value, 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw tie-points */
+  
+  if( out_tie_points_ptr.isActive() ) {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      int x = 0;
+      int y = 0;
+      
+      if( tie_points_space == 0 ) {
+         x = TeRound( it->pt1.x() );
+         y = TeRound( it->pt1.y() );
+      } else {
+         x = TeRound( it->pt2.x() );
+         y = TeRound( it->pt2.y() );
+      }
+      
+      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
+        "Invalid maxima column" )
+      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+        "Invalid maxima column" )      
+      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
+        "Invalid maxima line" )
+      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+        "Invalid maxima line" )      
+      
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+        255.0, 0 ),
+        "Error writing raster" )    
+    
+      ++it;
+    }
+  
+  }
+}
+
+void sameImageTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box1( TeCoord2D( 142, 826 ) , 
+    TeCoord2D( 542, 426 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 238, 689 ) , 
+    TeCoord2D( 391, 473 ) );
+  params.SetParameter( "input_box2" , input_box2 );  
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  double best_cor_value = 0;
+  params.SetParameter( "best_cor_value_ptr" , &best_cor_value ); 
+  
+  TePDICorrelationMatching corr_instance; 
+  corr_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( corr_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( corr_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+  TEAGN_WATCH( best_cor_value );
+    
+  /* Displaying and checking tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) 
+    {
+      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0.00000000000000001,
+        "Invalid tie-point" );
+      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0.00000000000000001,
+        "Invalid tie-point" ); 
+            
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDICorrelationMatching_test_sameImageTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDICorrelationMatching_test_sameImageTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+void sameImageTestWithMultiThread()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  // loading raster into memory since multi-thread will be used.
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( TEPDIEXAMPLESRESPATH 
+    "cbers_rgb342_crop1.tif", input_image1_ptr, true ),
+    "raster loading error" );
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+  
+  // loading raster into memory since multi-thread will be used.
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( TEPDIEXAMPLESRESPATH 
+    "cbers_rgb342_crop1.tif", input_image2_ptr, true ),
+    "raster loading error" );
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr );  
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box1( TeCoord2D( 142, 826 ) , 
+    TeCoord2D( 542, 426 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 238, 689 ) , 
+    TeCoord2D( 391, 473 ) );
+  params.SetParameter( "input_box2" , input_box2 );  
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  double best_cor_value = 0;
+  params.SetParameter( "best_cor_value_ptr" , &best_cor_value ); 
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 );
+  params.SetParameter( "enable_threaded_raster_read" , (int)1 );
+  
+  TePDICorrelationMatching corr_instance; 
+  corr_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( corr_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( corr_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+  TEAGN_WATCH( best_cor_value );
+    
+  /* Displaying and checking tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) 
+    {
+      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0.00000000000000001,
+        "Invalid tie-point" );
+      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0.00000000000000001,
+        "Invalid tie-point" );    
+    
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDICorrelationMatching_test_sameImageTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDICorrelationMatching_test_sameImageTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+void sameImageTest2()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box2( TeCoord2D( 142, 826 ) , 
+    TeCoord2D( 542, 426 ) );
+  params.SetParameter( "input_box2" , input_box2 );
+  
+  TeBox input_box1( TeCoord2D( 238, 689 ) , 
+    TeCoord2D( 391, 473 ) );
+  params.SetParameter( "input_box1" , input_box1 );  
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  double best_cor_value = 0;
+  params.SetParameter( "best_cor_value_ptr" , &best_cor_value );  
+  
+  TePDICorrelationMatching corr_instance; 
+  corr_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( corr_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( corr_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  TEAGN_WATCH( best_cor_value );    
+    
+  /* Displaying and checking tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) 
+    {
+      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0.00000000000000001,
+        "Invalid tie-point" );
+      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0.00000000000000001,
+        "Invalid tie-point" );    
+    
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDICorrelationMatching_test_sameImageTest2_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDICorrelationMatching_test_sameImageTest2_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+
+void halfsampledImageTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box1( TeCoord2D( 198, 486 ) , 
+    TeCoord2D( 577, 186 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 143, 180 ) , 
+    TeCoord2D( 227, 113 ) );
+  params.SetParameter( "input_box2" , input_box2 );  
+  
+  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
+  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
+  
+  double best_cor_value = 0;
+  params.SetParameter( "best_cor_value_ptr" , &best_cor_value );   
+  
+  TePDICorrelationMatching corr_instance; 
+  corr_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( corr_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( corr_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+  TEAGN_WATCH( best_cor_value );    
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDICorrelationMatching_test_halfsampledImageTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDICorrelationMatching_test_halfsampledImageTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+
+void halfsampledImageTest2()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box2( TeCoord2D( 198, 486 ) , 
+    TeCoord2D( 577, 186 ) );
+  params.SetParameter( "input_box2" , input_box2 );
+  
+  TeBox input_box1( TeCoord2D( 143, 180 ) , 
+    TeCoord2D( 227, 113 ) );
+  params.SetParameter( "input_box1" , input_box1 );  
+  
+  params.SetParameter( "pixel_x_relation" , (double)2 ); 
+  params.SetParameter( "pixel_y_relation" , (double)2 ); 
+  
+  double best_cor_value = 0;
+  params.SetParameter( "best_cor_value_ptr" , &best_cor_value );   
+  
+  TePDICorrelationMatching corr_instance; 
+  corr_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( corr_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( corr_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+  TEAGN_WATCH( best_cor_value );    
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDICorrelationMatching_test_halfsampledImageTest2_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDICorrelationMatching_test_halfsampledImageTest2_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+    
+    time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+    sameImageTest();
+    sameImageTestWithMultiThread();
+    sameImageTest2();
+    halfsampledImageTest();
+    halfsampledImageTest2();
+    
+    time_t end_time = clock() / CLOCKS_PER_SEC;
+    
+    TEAGN_LOGMSG( "Total elapsed time: " + 
+      TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+      " seconds" );    
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }  
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching_test.vcproj b/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching_test.vcproj
index fc55142..a8fed21 100644
--- a/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching_test.vcproj
+++ b/examples/image_processing/source/TePDICorrelationMatching/TePDICorrelationMatching_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDICorrelationMatching_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDICorrelationMatching_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDICorrelationMatching_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".;../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDICorrelationMatching_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDICorrelationMatching_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDICorrelationMatching_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDICorrelationMatching_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDICorrelationMatching_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDICorrelationMatching_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDICorrelationMatching_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIDecorrelationEnhancement/.cvsignore b/examples/image_processing/source/TePDIDecorrelationEnhancement/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIDecorrelationEnhancement/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement.pro b/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement.pro
index 9018eef..0b14e89 100644
--- a/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement.pro
+++ b/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement.pro
@@ -1,6 +1,6 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIDecorrelationEnhancement_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIDecorrelationEnhancement_test.cpp
+
 QMAKE_CLEAN += 
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement_test.cpp b/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement_test.cpp
index b7fe268..4000ce9 100644
--- a/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement_test.cpp
+++ b/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement_test.cpp
@@ -1,83 +1,86 @@
-
-#define TEAGN_ENABLE_STDOUT_LOG
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIDecorrelationEnhancement.hpp>
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-
-#include <TeRaster.h>
-#include <TeInitRasterDecoders.h>
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-void TePDIDecorrelationEnhancement_test()
-{
-	TePDIParameters params;
-
-	TePDITypes::TePDIRasterVectorType input_rasters;
-	TePDITypes::TePDIRasterPtrType inRaster(new TeRaster(
-	  TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif", 'r'));
-	TEAGN_TRUE_OR_THROW(inRaster->init(), "Unable to init inRaster");
-	input_rasters.push_back(inRaster);
-	input_rasters.push_back(inRaster);
-	input_rasters.push_back(inRaster);
-
-	std::vector<int> bands_direct;
-	bands_direct.push_back(0);
-	bands_direct.push_back(1);
-	bands_direct.push_back(2);
-	
-	TePDITypes::TePDIRasterVectorType output_rasters;
-	TePDITypes::TePDIRasterPtrType outRaster1;
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster1, 1, 1, 1, false, TeDOUBLE, 0), "RAM Raster 1 Alloc error");
-	TePDITypes::TePDIRasterPtrType outRaster2;
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster2, 1, 1, 1, false, TeDOUBLE, 0), "RAM Raster 2 Alloc error");
-	TePDITypes::TePDIRasterPtrType outRaster3;
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster3, 1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster 3 Alloc error");
-	output_rasters.push_back(outRaster1);
-	output_rasters.push_back(outRaster2);
-	output_rasters.push_back(outRaster3);
-	
-	params.SetParameter("input_rasters", input_rasters);
-	params.SetParameter("bands", bands_direct);
-	params.SetParameter("output_rasters", output_rasters);
-	
-	TePDIDecorrelationEnhancement de;
-	TEAGN_TRUE_OR_THROW(de.Reset(params), "Invalid Parameters");
-	TEAGN_TRUE_OR_THROW(de.Apply(), "Apply error");
-	
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_rasters[0], 
-	  TEPDIEXAMPLESBINPATH "TePDIDecorrelationEnhancement0.tif" ), 
-	  "GeoTIFF0 generation error");
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_rasters[1], 
-	  TEPDIEXAMPLESBINPATH "TePDIDecorrelationEnhancement1.tif" ), 
-	  "GeoTIFF1 generation error");
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_rasters[2], 
-	  TEPDIEXAMPLESBINPATH "TePDIDecorrelationEnhancement2.tif" ), 
-	  "GeoTIFF2 generation error");
-}
-
-int main()
-{
-	TEAGN_LOGMSG("Test started.");
-	
-	TEAGN_DEBUG_MODE_CHECK;
-	
-	try
-	{
-		TeStdIOProgress pi;
-		TeProgress::setProgressInterf(dynamic_cast<TeProgressBase*>(&pi));
-		TeInitRasterDecoders();
-		TePDIDecorrelationEnhancement_test();
-	}
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-	
-	TEAGN_LOGMSG("Test OK.");
-	return EXIT_SUCCESS;
-}
+
+#define TEAGN_ENABLE_STDOUT_LOG
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIDecorrelationEnhancement.hpp>
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+
+#include <TeRaster.h>
+#include <TeInitRasterDecoders.h>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+void TePDIDecorrelationEnhancement_test()
+{
+	TePDIParameters params;
+
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TePDITypes::TePDIRasterPtrType inRaster(new TeRaster(
+	  TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif", 'r'));
+	TEAGN_TRUE_OR_THROW(inRaster->init(), "Unable to init inRaster");
+	input_rasters.push_back(inRaster);
+	input_rasters.push_back(inRaster);
+	input_rasters.push_back(inRaster);
+
+	std::vector<int> bands_direct;
+	bands_direct.push_back(0);
+	bands_direct.push_back(1);
+	bands_direct.push_back(2);
+	
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TePDITypes::TePDIRasterPtrType outRaster1;
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster1, 1, 1, 1, 
+	  false, TeUNSIGNEDCHAR, 0), "RAM Raster 1 Alloc error");
+	TePDITypes::TePDIRasterPtrType outRaster2;
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster2, 1, 1, 1, 
+	  false, TeUNSIGNEDCHAR, 0), "RAM Raster 2 Alloc error");
+	TePDITypes::TePDIRasterPtrType outRaster3;
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster3, 1, 1, 1, 
+	  false, TeUNSIGNEDCHAR, 0 ), "RAM Raster 3 Alloc error");
+	output_rasters.push_back(outRaster1);
+	output_rasters.push_back(outRaster2);
+	output_rasters.push_back(outRaster3);
+	
+	params.SetParameter("input_rasters", input_rasters);
+	params.SetParameter("bands", bands_direct);
+	params.SetParameter("output_rasters", output_rasters);
+	
+	TePDIDecorrelationEnhancement de;
+	TEAGN_TRUE_OR_THROW(de.Reset(params), "Invalid Parameters");
+	TEAGN_TRUE_OR_THROW(de.Apply(), "Apply error");
+	
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_rasters[0], 
+	  TEPDIEXAMPLESBINPATH "TePDIDecorrelationEnhancement0.tif" ), 
+	  "GeoTIFF0 generation error");
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_rasters[1], 
+	  TEPDIEXAMPLESBINPATH "TePDIDecorrelationEnhancement1.tif" ), 
+	  "GeoTIFF1 generation error");
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_rasters[2], 
+	  TEPDIEXAMPLESBINPATH "TePDIDecorrelationEnhancement2.tif" ), 
+	  "GeoTIFF2 generation error");
+}
+
+int main()
+{
+	TEAGN_LOGMSG("Test started.");
+	
+	TEAGN_DEBUG_MODE_CHECK;
+	
+	try
+	{
+		TeStdIOProgress pi;
+		TeProgress::setProgressInterf(dynamic_cast<TeProgressBase*>(&pi));
+		TeInitRasterDecoders();
+		TePDIDecorrelationEnhancement_test();
+	}
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+	
+	TEAGN_LOGMSG("Test OK.");
+	return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement_test.vcproj b/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement_test.vcproj
index 7f827d8..2b04ebb 100644
--- a/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement_test.vcproj
+++ b/examples/image_processing/source/TePDIDecorrelationEnhancement/TePDIDecorrelationEnhancement_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIDecorrelationEnhancement_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIDecorrelationEnhancement_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIDecorrelationEnhancement_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIDecorrelationEnhancement_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIDecorrelationEnhancement_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIDecorrelationEnhancement_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIDecorrelationEnhancement_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIDecorrelationEnhancement_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIDecorrelationEnhancement_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIDecorrelationEnhancement_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIFilterMask/.cvsignore b/examples/image_processing/source/TePDIFilterMask/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIFilterMask/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask.pro b/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask.pro
old mode 100755
new mode 100644
index edb357b..d9d8347
--- a/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask.pro
+++ b/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask.pro
@@ -1,4 +1,4 @@
-include( ../base/base.pro )
-
-SOURCES += TePDIFilterMask_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += TePDIFilterMask_test.cpp
+
diff --git a/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask_test.cpp b/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask_test.cpp
old mode 100755
new mode 100644
index af83a7c..b6d07d1
--- a/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask_test.cpp
+++ b/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask_test.cpp
@@ -1,169 +1,173 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIFilterMask.hpp>
-
-#include <TeAgnostic.h>
-
-void printMask( TePDIFilterMask mask )
-{
-  std::cout << std::endl;
-
-  for( unsigned int line = 0 ; line < mask.lines() ; ++line ) {
-    std::cout << std::endl;
-
-    for( unsigned int column = 0 ; column < mask.columns() ; ++column ) {
-      std::cout << " " << mask.get( line, column );
-    }
-  }
-}
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    /* Checking mask creation */
-
-    TePDIFilterMask mask1( 3, 0. );
-
-    mask1.set( 0, 0, 1 );
-    mask1.set( 0, 1, 1 );
-    mask1.set( 0, 2, 1 );
-    mask1.set( 1, 0, 1 );
-    mask1.set( 1, 1, 1 );
-    mask1.set( 1, 2, 1 );
-    mask1.set( 2, 0, 1 );
-    mask1.set( 2, 1, 1 );
-    mask1.set( 2, 2, 1 );
-
-    TEAGN_CHECK_EQUAL( mask1.get( 0, 0 ), 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( mask1.get( 0, 1 ), 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( mask1.get( 0, 2 ), 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( mask1.get( 1, 0 ), 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( mask1.get( 1, 1 ), 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( mask1.get( 1, 2 ), 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( mask1.get( 2, 0 ), 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( mask1.get( 2, 1 ), 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( mask1.get( 2, 2 ), 1., "Invalid value" );
-
-    unsigned int cols = mask1.columns();
-    TEAGN_CHECK_EQUAL( cols, 3, "Invalid columns number" );
-
-    /* Checking weights matrix creation */
-
-    double** wmatrix = mask1.getWeightsMatrix();
-
-    TEAGN_CHECK_EQUAL( wmatrix[ 0 ][ 0 ], 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( wmatrix[ 0 ][ 1 ], 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( wmatrix[ 0 ][ 2 ], 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( wmatrix[ 1 ][ 0 ], 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( wmatrix[ 1 ][ 1 ], 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( wmatrix[ 1 ][ 2 ], 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( wmatrix[ 2 ][ 0 ], 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( wmatrix[ 2 ][ 1 ], 1., "Invalid value" );
-    TEAGN_CHECK_EQUAL( wmatrix[ 2 ][ 2 ], 1., "Invalid value" );
-
-    TePDIFilterMask::deleteWeightsMatrix(
-      wmatrix, mask1.lines() );
-
-
-    /* Checking normalization procedure */
-
-    mask1.normalize();
-
-    TEAGN_CHECK_EPS(
-      mask1.get( 0, 0 ), 0.111111, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS(
-      mask1.get( 0, 1 ), 0.111111, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS(
-      mask1.get( 0, 2 ), 0.111111, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS(
-      mask1.get( 1, 0 ), 0.111111, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS(
-      mask1.get( 1, 1 ), 0.111111, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS(
-      mask1.get( 1, 2 ), 0.111111, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS(
-      mask1.get( 2, 0 ), 0.111111, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS(
-      mask1.get( 2, 1 ), 0.111111, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS(
-      mask1.get( 2, 2 ), 0.111111, 0.000001, "Invalid value" );
-
-    /* Checking pre-defined masks creation */
-
-    TePDIFilterMask::pointer Dummy_mask = TePDIFilterMask::create_Dummy();
-    //printMask( Dummy_mask );
-
-    TePDIFilterMask::pointer Avg3x3_mask = TePDIFilterMask::create_Avg3x3();
-    //printMask( Avg3x3_mask );
-
-    TePDIFilterMask::pointer Avg5x5_mask = TePDIFilterMask::create_Avg5x5();
-    //printMask( Avg5x5_mask );
-
-    TePDIFilterMask::pointer Avg7x7_mask = TePDIFilterMask::create_Avg7x7();
-    //printMask( Avg7x7_mask );
-
-    TePDIFilterMask::pointer S_mask = TePDIFilterMask::create_S();
-    //printMask( S_mask );
-
-    TePDIFilterMask::pointer N_mask = TePDIFilterMask::create_N();
-    //printMask( N_mask );
-
-    TePDIFilterMask::pointer E_mask = TePDIFilterMask::create_E();
-    //printMask( E_mask );
-
-    TePDIFilterMask::pointer W_mask = TePDIFilterMask::create_W();
-    //printMask( W_mask );
-
-    TePDIFilterMask::pointer NW_mask = TePDIFilterMask::create_NW();
-    //printMask( NW_mask );
-
-    TePDIFilterMask::pointer SW_mask = TePDIFilterMask::create_SW();
-    //printMask( SW_mask );
-
-    TePDIFilterMask::pointer NE_mask = TePDIFilterMask::create_NE();
-    //printMask( NE_mask );
-
-    TePDIFilterMask::pointer SE_mask = TePDIFilterMask::create_SE();
-    //printMask( SE_mask );
-
-    TePDIFilterMask::pointer SE_NDLow = TePDIFilterMask::create_NDLow();
-    //printMask( SE_NDLow );
-
-    TePDIFilterMask::pointer SE_NDMed = TePDIFilterMask::create_NDMed();
-    //printMask( SE_NDMed );
-
-    TePDIFilterMask::pointer SE_NDHigh = TePDIFilterMask::create_NDHigh();
-    //printMask( SE_NDHigh );
-
-    TePDIFilterMask::pointer SE_TMEnh = TePDIFilterMask::create_TMEnh();
-    //printMask( SE_TMEnh );
-
-    /* Checking morfological masks creation */
-
-    TePDIFilterMask::pointer MorfD = TePDIFilterMask::create_MorfD();
-    TEAGN_TRUE_OR_THROW( MorfD->isMorfMask(), "Invalid mask" );
-    TePDIFilterMask::pointer MorfE = TePDIFilterMask::create_MorfE();
-    TEAGN_TRUE_OR_THROW( MorfE->isMorfMask(), "Invalid mask" );
-    TePDIFilterMask::pointer MorfM = TePDIFilterMask::create_MorfM();
-    TEAGN_TRUE_OR_THROW( MorfM->isMorfMask(), "Invalid mask" );
-    TePDIFilterMask::pointer MorfM_ = TePDIFilterMask::create_MorfM_();
-    TEAGN_TRUE_OR_THROW( MorfM_->isMorfMask(), "Invalid mask" );
-    TePDIFilterMask::pointer MorfMPlus = TePDIFilterMask::create_MorfMPlus();
-    TEAGN_TRUE_OR_THROW( MorfMPlus->isMorfMask(), "Invalid mask" );
-    TePDIFilterMask::pointer MorfMtot = TePDIFilterMask::create_MorfMtot();
-    TEAGN_TRUE_OR_THROW( MorfMtot->isMorfMask(), "Invalid mask" );
-    TePDIFilterMask::pointer MorfMX = TePDIFilterMask::create_MorfMX();
-    TEAGN_TRUE_OR_THROW( MorfMX->isMorfMask(), "Invalid mask" );
-
-
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIFilterMask.hpp>
+
+#include <TeAgnostic.h>
+
+//STL include files
+#include <stdlib.h>
+
+
+void printMask( TePDIFilterMask mask )
+{
+  std::cout << std::endl;
+
+  for( unsigned int line = 0 ; line < mask.lines() ; ++line ) {
+    std::cout << std::endl;
+
+    for( unsigned int column = 0 ; column < mask.columns() ; ++column ) {
+      std::cout << " " << mask.get( line, column );
+    }
+  }
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    /* Checking mask creation */
+
+    TePDIFilterMask mask1( 3, 0. );
+
+    mask1.set( 0, 0, 1 );
+    mask1.set( 0, 1, 1 );
+    mask1.set( 0, 2, 1 );
+    mask1.set( 1, 0, 1 );
+    mask1.set( 1, 1, 1 );
+    mask1.set( 1, 2, 1 );
+    mask1.set( 2, 0, 1 );
+    mask1.set( 2, 1, 1 );
+    mask1.set( 2, 2, 1 );
+
+    TEAGN_CHECK_EQUAL( mask1.get( 0, 0 ), 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( mask1.get( 0, 1 ), 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( mask1.get( 0, 2 ), 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( mask1.get( 1, 0 ), 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( mask1.get( 1, 1 ), 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( mask1.get( 1, 2 ), 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( mask1.get( 2, 0 ), 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( mask1.get( 2, 1 ), 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( mask1.get( 2, 2 ), 1., "Invalid value" );
+
+    unsigned int cols = mask1.columns();
+    TEAGN_CHECK_EQUAL( cols, 3, "Invalid columns number" );
+
+    /* Checking weights matrix creation */
+
+    double** wmatrix = mask1.getWeightsMatrix();
+
+    TEAGN_CHECK_EQUAL( wmatrix[ 0 ][ 0 ], 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( wmatrix[ 0 ][ 1 ], 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( wmatrix[ 0 ][ 2 ], 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( wmatrix[ 1 ][ 0 ], 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( wmatrix[ 1 ][ 1 ], 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( wmatrix[ 1 ][ 2 ], 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( wmatrix[ 2 ][ 0 ], 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( wmatrix[ 2 ][ 1 ], 1., "Invalid value" );
+    TEAGN_CHECK_EQUAL( wmatrix[ 2 ][ 2 ], 1., "Invalid value" );
+
+    TePDIFilterMask::deleteWeightsMatrix(
+      wmatrix, mask1.lines() );
+
+
+    /* Checking normalization procedure */
+
+    mask1.normalize();
+
+    TEAGN_CHECK_EPS(
+      mask1.get( 0, 0 ), 0.111111, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS(
+      mask1.get( 0, 1 ), 0.111111, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS(
+      mask1.get( 0, 2 ), 0.111111, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS(
+      mask1.get( 1, 0 ), 0.111111, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS(
+      mask1.get( 1, 1 ), 0.111111, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS(
+      mask1.get( 1, 2 ), 0.111111, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS(
+      mask1.get( 2, 0 ), 0.111111, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS(
+      mask1.get( 2, 1 ), 0.111111, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS(
+      mask1.get( 2, 2 ), 0.111111, 0.000001, "Invalid value" );
+
+    /* Checking pre-defined masks creation */
+
+    TePDIFilterMask::pointer Dummy_mask = TePDIFilterMask::create_Dummy();
+    //printMask( Dummy_mask );
+
+    TePDIFilterMask::pointer Avg3x3_mask = TePDIFilterMask::create_Avg3x3();
+    //printMask( Avg3x3_mask );
+
+    TePDIFilterMask::pointer Avg5x5_mask = TePDIFilterMask::create_Avg5x5();
+    //printMask( Avg5x5_mask );
+
+    TePDIFilterMask::pointer Avg7x7_mask = TePDIFilterMask::create_Avg7x7();
+    //printMask( Avg7x7_mask );
+
+    TePDIFilterMask::pointer S_mask = TePDIFilterMask::create_S();
+    //printMask( S_mask );
+
+    TePDIFilterMask::pointer N_mask = TePDIFilterMask::create_N();
+    //printMask( N_mask );
+
+    TePDIFilterMask::pointer E_mask = TePDIFilterMask::create_E();
+    //printMask( E_mask );
+
+    TePDIFilterMask::pointer W_mask = TePDIFilterMask::create_W();
+    //printMask( W_mask );
+
+    TePDIFilterMask::pointer NW_mask = TePDIFilterMask::create_NW();
+    //printMask( NW_mask );
+
+    TePDIFilterMask::pointer SW_mask = TePDIFilterMask::create_SW();
+    //printMask( SW_mask );
+
+    TePDIFilterMask::pointer NE_mask = TePDIFilterMask::create_NE();
+    //printMask( NE_mask );
+
+    TePDIFilterMask::pointer SE_mask = TePDIFilterMask::create_SE();
+    //printMask( SE_mask );
+
+    TePDIFilterMask::pointer SE_NDLow = TePDIFilterMask::create_NDLow();
+    //printMask( SE_NDLow );
+
+    TePDIFilterMask::pointer SE_NDMed = TePDIFilterMask::create_NDMed();
+    //printMask( SE_NDMed );
+
+    TePDIFilterMask::pointer SE_NDHigh = TePDIFilterMask::create_NDHigh();
+    //printMask( SE_NDHigh );
+
+    TePDIFilterMask::pointer SE_TMEnh = TePDIFilterMask::create_TMEnh();
+    //printMask( SE_TMEnh );
+
+    /* Checking morfological masks creation */
+
+    TePDIFilterMask::pointer MorfD = TePDIFilterMask::create_MorfD();
+    TEAGN_TRUE_OR_THROW( MorfD->isMorfMask(), "Invalid mask" );
+    TePDIFilterMask::pointer MorfE = TePDIFilterMask::create_MorfE();
+    TEAGN_TRUE_OR_THROW( MorfE->isMorfMask(), "Invalid mask" );
+    TePDIFilterMask::pointer MorfM = TePDIFilterMask::create_MorfM();
+    TEAGN_TRUE_OR_THROW( MorfM->isMorfMask(), "Invalid mask" );
+    TePDIFilterMask::pointer MorfM_ = TePDIFilterMask::create_MorfM_();
+    TEAGN_TRUE_OR_THROW( MorfM_->isMorfMask(), "Invalid mask" );
+    TePDIFilterMask::pointer MorfMPlus = TePDIFilterMask::create_MorfMPlus();
+    TEAGN_TRUE_OR_THROW( MorfMPlus->isMorfMask(), "Invalid mask" );
+    TePDIFilterMask::pointer MorfMtot = TePDIFilterMask::create_MorfMtot();
+    TEAGN_TRUE_OR_THROW( MorfMtot->isMorfMask(), "Invalid mask" );
+    TePDIFilterMask::pointer MorfMX = TePDIFilterMask::create_MorfMX();
+    TEAGN_TRUE_OR_THROW( MorfMX->isMorfMask(), "Invalid mask" );
+
+
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask_test.vcproj b/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask_test.vcproj
old mode 100755
new mode 100644
index 6c4203e..a8a794c
--- a/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask_test.vcproj
+++ b/examples/image_processing/source/TePDIFilterMask/TePDIFilterMask_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIFilterMask_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIFilterMask_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIFilterMask_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIFilterMask_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIFilterMask_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIFilterMask_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIFilterMask_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIFilterMask_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIFilterMask_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIFilterMask_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIFusion/.cvsignore b/examples/image_processing/source/TePDIFusion/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIFusion/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIFusion/TePDIFusion.pro b/examples/image_processing/source/TePDIFusion/TePDIFusion.pro
old mode 100755
new mode 100644
index b462247..afce1bd
--- a/examples/image_processing/source/TePDIFusion/TePDIFusion.pro
+++ b/examples/image_processing/source/TePDIFusion/TePDIFusion.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIFusion_test.cpp
-
-QMAKE_CLEAN += \
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIFusion_test.cpp
+
+QMAKE_CLEAN += \
   ../../bin/Fusion*.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIFusion/TePDIFusion_test.cpp b/examples/image_processing/source/TePDIFusion/TePDIFusion_test.cpp
old mode 100755
new mode 100644
index 0626d37..8220b4b
--- a/examples/image_processing/source/TePDIFusion/TePDIFusion_test.cpp
+++ b/examples/image_processing/source/TePDIFusion/TePDIFusion_test.cpp
@@ -1,215 +1,697 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIFusion.hpp>
-
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-#include <TePDIPrincipalComponentsFusion.hpp>
-
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeRasterParams.h> 
-
-#include <vector>
-
-void GarguetFusion_test()
-{
-  TePDIParameters params1;
-
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
-    "Unable to init input_raster1" );
-    
-  TePDITypes::TePDIRasterPtrType lowres_raster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
-    'r' ) );
-  TEAGN_TRUE_OR_THROW( lowres_raster->init(), 
-    "Unable to init input_raster2" );    
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "output_raster Alloc error" );
-    
-  params1.SetParameter( "fusion_type" , std::string( "garguet" ) );
-  params1.SetParameter( "reference_raster" , reference_raster );
-  params1.SetParameter( "lowres_raster" , lowres_raster );
-  params1.SetParameter( "output_raster" , output_raster );
-  params1.SetParameter( "reference_raster_band" , 0 );
-  params1.SetParameter( "lowres_raster_band" , 0 );
-  
-  TePDIFusion fusion;
-  
-  TEAGN_TRUE_OR_THROW( fusion.Reset(params1), "Reset failed" );
-  
-  TEAGN_TRUE_OR_THROW( fusion.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Fusion_Garguet_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void VenturaFusion_test()
-{
-  TePDIParameters params1;
-
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
-    "Unable to init input_raster1" );
-    
-  TePDITypes::TePDIRasterPtrType lowres_raster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
-    'r' ) );
-  TEAGN_TRUE_OR_THROW( lowres_raster->init(), 
-    "Unable to init input_raster2" );    
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "output_raster Alloc error" );
-    
-  params1.SetParameter( "fusion_type" , std::string( "ventura" ) );
-  params1.SetParameter( "reference_raster" , reference_raster );
-  params1.SetParameter( "lowres_raster" , lowres_raster );
-  params1.SetParameter( "output_raster" , output_raster );
-  params1.SetParameter( "reference_raster_band" , 0 );
-  params1.SetParameter( "lowres_raster_band" , 0 );
-  
-  TePDIFusion fusion;
-  
-  TEAGN_TRUE_OR_THROW( fusion.Reset(params1), "Reset failed" );
-  
-  TEAGN_TRUE_OR_THROW( fusion.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Fusion_Ventura_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void IHSFusion_test()
-{
-  /* Initializing the reference raster */
-
-  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers2b_hrc_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
-    "Unable to init input_raster1" );
-    
-  /* Initializing the rgb raster */
-  
-  TePDITypes::TePDIRasterPtrType rgb_raster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( rgb_raster->init(), 
-    "Unable to init input_raster1" );
-  
-  /* Building output raster */
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, rgb_raster->params().dataType_[ 0 ], 0 ), "output_raster Alloc error" );
-    
-  /* Building algorithm parameters */
-    
-  TePDIParameters params1;
-    
-  params1.SetParameter( "fusion_type" , std::string( "ihs" ) );
-  params1.SetParameter( "reference_raster" , reference_raster );
-  params1.SetParameter( "lowres_raster" , rgb_raster );
-  params1.SetParameter( "output_raster" , output_raster );
-  params1.SetParameter( "reference_raster_band" , 0 );
-  
-  TePDIFusion fusion;
-  
-  TEAGN_TRUE_OR_THROW( fusion.Reset(params1), "Reset failed" );
-  
-  TEAGN_TRUE_OR_THROW( fusion.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Fusion_IHS_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void TePDIPrincipalComponentsFusion_test()
-{
-	TePDIParameters params;
-
-	TePDITypes::TePDIRasterVectorType input_rasters;
-	TePDITypes::TePDIRasterVectorType output_rasters;
-	std::vector<int> bands_direct;
-
-	for (unsigned int b = 0; b < 3; b++)
-	{
-		TePDITypes::TePDIRasterPtrType inRaster(new TeRaster(
-		  TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif", 'r'));
-		TEAGN_TRUE_OR_THROW(inRaster->init(), "Unable to init inRaster " + 
-		  Te2String(b));
-		input_rasters.push_back(inRaster);
-
-		TePDITypes::TePDIRasterPtrType outRaster;
-		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster, 1, 1, 1, false, TeDOUBLE, 0), "RAM Raster " + Te2String(b+1) + " Alloc error");
-		output_rasters.push_back(outRaster);
-		
-		bands_direct.push_back(0);
-	}
-
-	TePDITypes::TePDIRasterPtrType reference_raster(new TeRaster(
-	  std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r'));
-	TEAGN_TRUE_OR_THROW(reference_raster->init(), "Unable to init reference_raster");
-
-	params.SetParameter("input_rasters", input_rasters);
-	params.SetParameter("bands", bands_direct);
-	params.SetParameter("output_rasters", output_rasters);
-	params.SetParameter("reference_raster", reference_raster);
-	params.SetParameter("reference_raster_band", 0);
-	params.SetParameter("resampling_type", 
-	  TePDIPrincipalComponentsFusion::NNMethod);
-	params.SetParameter("fit_histogram", false);
-	
-	TePDIPrincipalComponentsFusion pcf;
-	TEAGN_TRUE_OR_THROW(pcf.Reset(params), "Invalid Parameters");
-	TEAGN_TRUE_OR_THROW(pcf.Apply(), "Apply error");
-	
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_rasters[ 0 ],
-    TEPDIEXAMPLESBINPATH "Fusion_PC_test_output_b0.tif" ), 
-    "GeoTIF generation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_rasters[ 1 ],
-    TEPDIEXAMPLESBINPATH "Fusion_PC_test_output_b1.tif" ), 
-    "GeoTIF generation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_rasters[ 2 ],
-    TEPDIEXAMPLESBINPATH "Fusion_PC_test_output_b2.tif" ), 
-    "GeoTIF generation error" );        
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeInitRasterDecoders();
-    
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-
-    IHSFusion_test();
-    VenturaFusion_test();
-    GarguetFusion_test();
-    TePDIPrincipalComponentsFusion_test();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+#include <TePDIPrincipalComponentsFusion.hpp>
+#include <TePDIIHSFusion.hpp>
+#include <TePDIVenturaFusion.hpp>
+#include <TePDIGarguetFusion.hpp>
+#include <TePDIGeneralizedIHSFusion.hpp>
+#include <TePDIIHSWaveletFusion.hpp>
+#include <TePDIPCAWaveletFusion.hpp>
+#include <TePDIWaveletAtrousFusion.hpp>
+#include <TePDIWiSpeRFusion.hpp>
+
+#include <TeInitRasterDecoders.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeRasterParams.h> 
+
+#include <vector>
+
+void GarguetFusion_test()
+{
+  TePDIParameters params1;
+
+  /* Building rasters */
+
+  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
+    "Unable to init input_raster1" );
+    
+  TePDITypes::TePDIRasterPtrType lowres_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
+    'r' ) );
+  TEAGN_TRUE_OR_THROW( lowres_raster->init(), 
+    "Unable to init input_raster2" );    
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );
+    
+  params1.SetParameter( "reference_raster" , reference_raster );
+  params1.SetParameter( "lowres_raster" , lowres_raster );
+  params1.SetParameter( "output_raster" , output_raster );
+  params1.SetParameter( "reference_raster_band" , 0 );
+  params1.SetParameter( "lowres_raster_band" , 0 );
+  
+  TePDIGarguetFusion fusion;
+  
+  TEAGN_TRUE_OR_THROW( fusion.Reset(params1), "Reset failed" );
+  
+  TEAGN_TRUE_OR_THROW( fusion.Apply(), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "Fusion_Garguet_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void VenturaFusion_test()
+{
+  TePDIParameters params1;
+
+  /* Building rasters */
+
+  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
+    "Unable to init input_raster1" );
+    
+  TePDITypes::TePDIRasterPtrType lowres_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
+    'r' ) );
+  TEAGN_TRUE_OR_THROW( lowres_raster->init(), 
+    "Unable to init input_raster2" );    
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );
+    
+  params1.SetParameter( "reference_raster" , reference_raster );
+  params1.SetParameter( "lowres_raster" , lowres_raster );
+  params1.SetParameter( "output_raster" , output_raster );
+  params1.SetParameter( "reference_raster_band" , 0 );
+  params1.SetParameter( "lowres_raster_band" , 0 );
+  
+  TePDIVenturaFusion fusion;
+  
+  TEAGN_TRUE_OR_THROW( fusion.Reset(params1), "Reset failed" );
+  
+  TEAGN_TRUE_OR_THROW( fusion.Apply(), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "Fusion_Ventura_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void IHSFusion_test()
+{
+  /* Initializing the reference raster */
+
+  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_hrc_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
+    "Unable to init input_raster1" );
+    
+  /* Initializing the rgb raster */
+  
+  TePDITypes::TePDIRasterPtrType rgb_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( rgb_raster->init(), 
+    "Unable to init input_raster1" );
+
+  TePDITypes::TePDIRasterVectorType lowres_rasters;
+  lowres_rasters.push_back( rgb_raster );
+  lowres_rasters.push_back( rgb_raster );
+  lowres_rasters.push_back( rgb_raster );
+
+  std::vector< int > lowres_channels;
+  lowres_channels.push_back( 0 );
+  lowres_channels.push_back( 1 );
+  lowres_channels.push_back( 2 );
+  
+  /* Building output raster */
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, rgb_raster->params().dataType_[ 0 ], 0 ), "output_raster Alloc error" );
+    
+  /* Building algorithm parameters */
+    
+  TePDIParameters params1;
+    
+  params1.SetParameter( "reference_raster" , reference_raster );
+  params1.SetParameter( "lowres_rasters" , lowres_rasters );
+  params1.SetParameter( "lowres_channels" , lowres_channels );
+  params1.SetParameter( "output_raster" , output_raster );
+  params1.SetParameter( "reference_raster_band" , 0 );
+  params1.SetParameter( "interpol_method" , TePDIInterpolator::NNMethod );
+  
+  TePDIIHSFusion fusion;
+  
+  TEAGN_TRUE_OR_THROW( fusion.Reset(params1), "Reset failed" );
+  
+  TEAGN_TRUE_OR_THROW( fusion.Apply(), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "Fusion_IHS_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void TePDIPrincipalComponentsFusion_test()
+{
+	TePDIParameters params;
+
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	std::vector<int> bands_direct;
+
+	for (unsigned int b = 0; b < 3; b++)
+	{
+		TePDITypes::TePDIRasterPtrType inRaster(new TeRaster(
+		  TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif", 'r'));
+		TEAGN_TRUE_OR_THROW(inRaster->init(), "Unable to init inRaster " + 
+		  Te2String(b));
+		input_rasters.push_back(inRaster);
+
+		TePDITypes::TePDIRasterPtrType outRaster;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster, 1, 1, 1, 
+      false, TeUNSIGNEDCHAR, 0), "RAM Raster " + Te2String(b+1) + " Alloc error");
+		output_rasters.push_back(outRaster);
+		
+		bands_direct.push_back( (int)b );
+	}
+
+	TePDITypes::TePDIRasterPtrType reference_raster(new TeRaster(
+	  std::string( TEPDIEXAMPLESRESPATH "cbers2b_hrc_crop.tif" ), 'r'));
+	TEAGN_TRUE_OR_THROW(reference_raster->init(), "Unable to init reference_raster");
+
+	params.SetParameter("input_rasters", input_rasters);
+	params.SetParameter("bands", bands_direct);
+	params.SetParameter("output_rasters", output_rasters);
+	params.SetParameter("reference_raster", reference_raster);
+	params.SetParameter("reference_raster_band", 0);
+	params.SetParameter("resampling_type", 
+	  TePDIInterpolator::NNMethod);
+	params.SetParameter("fit_histogram", false);
+	
+	TePDIPrincipalComponentsFusion pcf;
+	TEAGN_TRUE_OR_THROW(pcf.Reset(params), "Invalid Parameters");
+	TEAGN_TRUE_OR_THROW(pcf.Apply(), "Apply error");
+	
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_rasters[ 0 ],
+    TEPDIEXAMPLESBINPATH "Fusion_PC_test_output_b0.tif" ), 
+    "GeoTIF generation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_rasters[ 1 ],
+    TEPDIEXAMPLESBINPATH "Fusion_PC_test_output_b1.tif" ), 
+    "GeoTIF generation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_rasters[ 2 ],
+    TEPDIEXAMPLESBINPATH "Fusion_PC_test_output_b2.tif" ), 
+    "GeoTIF generation error" );        
+}
+
+void TePDIGeneralizedIHSFusion_test()
+{
+  /* Initializing the reference raster */
+
+  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_hrc_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
+    "Unable to init input_raster1" );
+    
+  /* Initializing the input rasters */
+  
+  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_red_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
+    "Unable to init input_raster1" );
+    
+  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_green_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
+    "Unable to init input_raster1" );   
+     
+  TePDITypes::TePDIRasterPtrType input_raster3( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_blue_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster3->init(), 
+    "Unable to init input_raster1" );       
+  
+  /* Building output rasters */
+    
+  TePDITypes::TePDIRasterPtrType ihs_output_raster1;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( ihs_output_raster1,
+    1, 1, 1, false, TeFLOAT, 0 ), 
+    "output_raster Alloc error" );
+    
+  TePDITypes::TePDIRasterPtrType ihs_output_raster2;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( ihs_output_raster2,
+    1, 1, 1, false, TeFLOAT, 0 ), 
+    "output_raster Alloc error" );
+        
+  TePDITypes::TePDIRasterPtrType ihs_output_raster3;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( ihs_output_raster3,
+    1, 1, 1, false, TeFLOAT, 0 ), 
+    "output_raster Alloc error" );     
+       
+  TePDITypes::TePDIRasterPtrType rgb_output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( rgb_output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+    "output_raster Alloc error" );           
+    
+  /* Building algorithm parameters */
+  
+  TePDIParameters params;
+  
+  params.SetParameter("pp_type", 
+    TePDIGeneralizedIHSFusion::MeanPreProcessing);
+    
+  params.SetParameter("mean", (double)128 );
+      
+  params.SetParameter("variance", (double)128 );
+      
+  vector<double> bands_center;
+  bands_center.push_back( 0 );
+  bands_center.push_back( 0 );
+  bands_center.push_back( 0 );
+  params.SetParameter("bands_center", bands_center );
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( input_raster1 );
+  input_rasters.push_back( input_raster2 );
+  input_rasters.push_back( input_raster3 );
+  params.SetParameter("input_rasters", input_rasters);
+  
+  params.SetParameter("pansharpening", (bool)false);
+    
+  params.SetParameter("reference_raster", reference_raster);
+  
+  params.SetParameter("reference_raster_band", (int)0 );
+  
+  TePDITypes::TePDIRasterVectorType ihs_output_rasters;
+  ihs_output_rasters.push_back( ihs_output_raster1 );
+  ihs_output_rasters.push_back( ihs_output_raster2 );
+  ihs_output_rasters.push_back( ihs_output_raster3 );
+  params.SetParameter("ihs_output_rasters", ihs_output_rasters);
+  
+  params.SetParameter("rgb_output_raster", rgb_output_raster);
+
+  // Running algorithm
+  
+  TePDIGeneralizedIHSFusion fusion;
+  
+  TEAGN_TRUE_OR_THROW( fusion.Apply( params ), "Apply error" );
+  
+  // Saving data to output files
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( rgb_output_raster,
+    TEPDIEXAMPLESBINPATH "TePDIGeneralizedIHSFusion_test_rgb_output_raster.tif" ), 
+    "GeoTIF generation error" );
+}
+
+void TePDIIHSWaveletFusion_test()
+{
+  /* Initializing the reference raster */
+
+  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_hrc_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
+    "Unable to init input_raster1" );
+    
+  /* Initializing the rgb raster */
+  
+  TePDITypes::TePDIRasterPtrType rgb_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( rgb_raster->init(), 
+    "Unable to init input_raster1" );
+  
+  /* Building output rasters */
+    
+  TePDITypes::TePDIRasterPtrType output_raster1;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster1,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+    "output_raster Alloc error" );
+    
+  TePDITypes::TePDIRasterPtrType output_raster2;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster2,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+    "output_raster Alloc error" );
+        
+  TePDITypes::TePDIRasterPtrType output_raster3;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster3,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+    "output_raster Alloc error" );        
+    
+  /* Building algorithm parameters */
+  
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( rgb_raster );
+  input_rasters.push_back( rgb_raster );
+  input_rasters.push_back( rgb_raster );
+  params.SetParameter("input_rasters", input_rasters);
+  
+  std::vector< int > bands;
+  bands.push_back( 0 );
+  bands.push_back( 1 );
+  bands.push_back( 2 );
+  params.SetParameter("bands", bands);
+  
+  TePDITypes::TePDIRasterVectorType output_rasters;
+  output_rasters.push_back( output_raster1 );
+  output_rasters.push_back( output_raster2 );
+  output_rasters.push_back( output_raster3 );
+  params.SetParameter("output_rasters", output_rasters);
+  
+  params.SetParameter("reference_raster", reference_raster);
+  
+  params.SetParameter("reference_raster_band", (int)0 );
+  
+  params.SetParameter("i_levels", (int)3 );
+  
+  params.SetParameter("filter_file", 
+    std::string( TEPDIEXAMPLESRESPATH "b3spline.flr" ) );
+    
+  params.SetParameter("reference_levels", (int)3 );
+  
+  params.SetParameter("resampling_type", TePDIIHSWaveletFusion::NNMethod );
+  
+  params.SetParameter("fit_histogram", (bool)false );
+  
+  // Running algorithm
+  
+  TePDIIHSWaveletFusion fusion;
+  
+  TEAGN_TRUE_OR_THROW( fusion.Apply( params ), "Apply error" );
+  
+  // Saving data to output files
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster1,
+    TEPDIEXAMPLESBINPATH "TePDIIHSWaveletFusion_test_output_raster1.tif" ), 
+    "GeoTIF generation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster2,
+    TEPDIEXAMPLESBINPATH "TePDIIHSWaveletFusion_test_output_raster2.tif" ), 
+    "GeoTIF generation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster3,
+    TEPDIEXAMPLESBINPATH "TePDIIHSWaveletFusion_test_output_raster3.tif" ), 
+    "GeoTIF generation error" ); 
+}
+
+void TePDIPCAWaveletFusion_test()
+{
+  /* Initializing the reference raster */
+
+  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_hrc_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
+    "Unable to init input_raster1" );
+    
+  /* Initializing the rgb raster */
+  
+  TePDITypes::TePDIRasterPtrType rgb_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( rgb_raster->init(), 
+    "Unable to init input_raster1" );
+  
+  /* Building output rasters */
+    
+  TePDITypes::TePDIRasterPtrType output_raster1;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster1,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+    "output_raster Alloc error" );
+    
+  TePDITypes::TePDIRasterPtrType output_raster2;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster2,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+    "output_raster Alloc error" );
+        
+  TePDITypes::TePDIRasterPtrType output_raster3;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster3,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+    "output_raster Alloc error" );        
+    
+  /* Building algorithm parameters */
+  
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( rgb_raster );
+  input_rasters.push_back( rgb_raster );
+  input_rasters.push_back( rgb_raster );
+  params.SetParameter("input_rasters", input_rasters);
+  
+  std::vector< int > bands;
+  bands.push_back( 0 );
+  bands.push_back( 1 );
+  bands.push_back( 2 );
+  params.SetParameter("bands", bands);
+  
+  TePDITypes::TePDIRasterVectorType output_rasters;
+  output_rasters.push_back( output_raster1 );
+  output_rasters.push_back( output_raster2 );
+  output_rasters.push_back( output_raster3 );
+  params.SetParameter("output_rasters", output_rasters);
+  
+  params.SetParameter("reference_raster", reference_raster);
+  
+  params.SetParameter("reference_raster_band", (int)0 );
+  
+  params.SetParameter("pca1_levels", (int)3 );
+  
+  params.SetParameter("filter_file", 
+    std::string( TEPDIEXAMPLESRESPATH "b3spline.flr" ) );
+    
+  params.SetParameter("reference_levels", (int)3 );
+  
+  params.SetParameter("resampling_type", TePDIPCAWaveletFusion::NNMethod );
+  
+  params.SetParameter("fit_histogram", (bool)false );
+  
+  // Running algorithm
+  
+  TePDIPCAWaveletFusion fusion;
+  
+  TEAGN_TRUE_OR_THROW( fusion.Apply( params ), "Apply error" );
+  
+  // Saving data to output files
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster1,
+    TEPDIEXAMPLESBINPATH "TePDIPCAWaveletFusion_test_output_raster1.tif" ), 
+    "GeoTIF generation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster2,
+    TEPDIEXAMPLESBINPATH "TePDIPCAWaveletFusion_test_output_raster2.tif" ), 
+    "GeoTIF generation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster3,
+    TEPDIEXAMPLESBINPATH "TePDIPCAWaveletFusion_test_output_raster3.tif" ), 
+    "GeoTIF generation error" ); 
+}
+
+void TePDIWaveletAtrousFusion_test()
+{
+  /* Initializing the reference raster */
+
+  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_hrc_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
+    "Unable to init input_raster1" );
+    
+  /* Initializing the rgb raster */
+  
+  TePDITypes::TePDIRasterPtrType rgb_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( rgb_raster->init(), 
+    "Unable to init input_raster1" );
+  
+  /* Building output rasters */
+    
+  TePDITypes::TePDIRasterPtrType output_raster1;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster1,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+    "output_raster Alloc error" );
+    
+  TePDITypes::TePDIRasterPtrType output_raster2;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster2,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+    "output_raster Alloc error" );
+        
+  TePDITypes::TePDIRasterPtrType output_raster3;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster3,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+    "output_raster Alloc error" );        
+    
+  /* Building algorithm parameters */
+  
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( rgb_raster );
+  input_rasters.push_back( rgb_raster );
+  input_rasters.push_back( rgb_raster );
+  params.SetParameter("input_rasters", input_rasters);
+  
+  std::vector< int > bands;
+  bands.push_back( 0 );
+  bands.push_back( 1 );
+  bands.push_back( 2 );
+  params.SetParameter("bands", bands);
+  
+  TePDITypes::TePDIRasterVectorType output_rasters;
+  output_rasters.push_back( output_raster1 );
+  output_rasters.push_back( output_raster2 );
+  output_rasters.push_back( output_raster3 );
+  params.SetParameter("output_rasters", output_rasters);
+  
+  params.SetParameter("reference_raster", reference_raster);
+  
+  params.SetParameter("reference_raster_band", (int)0 );
+  
+  params.SetParameter("rasters_levels", (int)3 );
+  
+  params.SetParameter("filter_type", TePDIWaveletAtrous::B3SplineFilter );    
+    
+  params.SetParameter("reference_levels", (int)3 );
+  
+  params.SetParameter("resampling_type", TePDIWaveletAtrousFusion::NNMethod );
+  
+  params.SetParameter("fit_histogram", (bool)false );
+  
+  // Running algorithm
+  
+  TePDIWaveletAtrousFusion fusion;
+  
+  TEAGN_TRUE_OR_THROW( fusion.Apply( params ), "Apply error" );
+  
+  // Saving data to output files
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster1,
+    TEPDIEXAMPLESBINPATH "TePDIWaveletAtrousFusion_test_output_raster1.tif" ), 
+    "GeoTIF generation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster2,
+    TEPDIEXAMPLESBINPATH "TePDIWaveletAtrousFusion_test_output_raster2.tif" ), 
+    "GeoTIF generation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster3,
+    TEPDIEXAMPLESBINPATH "TePDIWaveletAtrousFusion_test_output_raster3.tif" ), 
+    "GeoTIF generation error" ); 
+}
+
+void TePDIWiSpeRFusion_test()
+{
+  /* Initializing the reference raster */
+
+  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_hrc_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
+    "Unable to init input_raster1" );
+    
+  /* Initializing the rgb raster */
+  
+  TePDITypes::TePDIRasterPtrType rgb_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( rgb_raster->init(), 
+    "Unable to init input_raster1" );
+  
+  /* Building output rasters */
+    
+  TePDITypes::TePDIRasterPtrType output_raster1;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster1,
+    1, 1, 1, false, rgb_raster->params().dataType_[ 0 ], 0 ), 
+    "output_raster Alloc error" );
+    
+  TePDITypes::TePDIRasterPtrType output_raster2;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster2,
+    1, 1, 1, false, rgb_raster->params().dataType_[ 0 ], 0 ), 
+    "output_raster Alloc error" );
+        
+  TePDITypes::TePDIRasterPtrType output_raster3;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster3,
+    1, 1, 1, false, rgb_raster->params().dataType_[ 0 ], 0 ), 
+    "output_raster Alloc error" );        
+    
+  /* Building algorithm parameters */
+  
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( rgb_raster );
+  input_rasters.push_back( rgb_raster );
+  input_rasters.push_back( rgb_raster );
+  params.SetParameter("input_rasters", input_rasters);
+  
+  std::vector< int > bands;
+  bands.push_back( 0 );
+  bands.push_back( 1 );
+  bands.push_back( 2 );
+  params.SetParameter("bands", bands);
+  
+  TePDITypes::TePDIRasterVectorType output_rasters;
+  output_rasters.push_back( output_raster1 );
+  output_rasters.push_back( output_raster2 );
+  output_rasters.push_back( output_raster3 );
+  params.SetParameter("output_rasters", output_rasters);
+  
+  params.SetParameter("reference_raster", reference_raster);
+  
+  params.SetParameter("reference_raster_band", (int)0 );
+  
+  params.SetParameter("rasters_levels", (int)3 );
+  
+  params.SetParameter("filter_file", 
+    std::string( TEPDIEXAMPLESRESPATH "b3spline.flr" ) );
+    
+  params.SetParameter("reference_levels", (int)3 );
+  
+  params.SetParameter("resampling_type", TePDIWiSpeRFusion::NNMethod );
+  
+  params.SetParameter("fit_histogram", (bool)false );
+  
+  params.SetParameter("satelliteName", std::string( 
+    TEPDIEXAMPLESRESPATH "spot5.srf" ) );
+  
+  std::vector<int> bands_order;
+  bands_order.push_back( 0 );
+  bands_order.push_back( 1 );
+  bands_order.push_back( 2 );
+  params.SetParameter("bands_order", bands_order );
+  
+  // Running algorithm
+  
+  TePDIWiSpeRFusion fusion;
+  
+  TEAGN_TRUE_OR_THROW( fusion.Apply( params ), "Apply error" );
+  
+  // Saving data to output files
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster1,
+    TEPDIEXAMPLESBINPATH "TePDIWiSpeRFusion_test_output_raster1.tif" ), 
+    "GeoTIF generation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster2,
+    TEPDIEXAMPLESBINPATH "TePDIWiSpeRFusion_test_output_raster2.tif" ), 
+    "GeoTIF generation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster3,
+    TEPDIEXAMPLESBINPATH "TePDIWiSpeRFusion_test_output_raster3.tif" ), 
+    "GeoTIF generation error" );        
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeInitRasterDecoders();
+    
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+
+//    TePDIGeneralizedIHSFusion_test(); ALGORITHM NOT WORKING !!
+    TePDIIHSWaveletFusion_test();
+    TePDIPCAWaveletFusion_test();
+    TePDIWaveletAtrousFusion_test();
+//    TePDIWiSpeRFusion_test(); ALGORITHM NOT WORKING !!
+    IHSFusion_test();
+    GarguetFusion_test();
+    VenturaFusion_test();
+    TePDIPrincipalComponentsFusion_test();
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIFusion/TePDIFusion_test.vcproj b/examples/image_processing/source/TePDIFusion/TePDIFusion_test.vcproj
old mode 100755
new mode 100644
index 26de34b..2388222
--- a/examples/image_processing/source/TePDIFusion/TePDIFusion_test.vcproj
+++ b/examples/image_processing/source/TePDIFusion/TePDIFusion_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIFusion_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIFusion_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIFusion_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIFusion_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIFusion_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIFusion_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIFusion_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIFusion_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIFusion_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIFusion_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIHaralick/.cvsignore b/examples/image_processing/source/TePDIHaralick/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIHaralick/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIHaralick/TePDIHaralick.pro b/examples/image_processing/source/TePDIHaralick/TePDIHaralick.pro
old mode 100755
new mode 100644
index 1d41e9f..0beeea1
--- a/examples/image_processing/source/TePDIHaralick/TePDIHaralick.pro
+++ b/examples/image_processing/source/TePDIHaralick/TePDIHaralick.pro
@@ -1,5 +1,5 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIHaralick_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIHaralick_test.cpp
+
diff --git a/examples/image_processing/source/TePDIHaralick/TePDIHaralick_test.cpp b/examples/image_processing/source/TePDIHaralick/TePDIHaralick_test.cpp
old mode 100755
new mode 100644
index 15196b0..d49c3a2
--- a/examples/image_processing/source/TePDIHaralick/TePDIHaralick_test.cpp
+++ b/examples/image_processing/source/TePDIHaralick/TePDIHaralick_test.cpp
@@ -1,106 +1,108 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIHaralick.hpp>
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-
-#include <TeInitRasterDecoders.h>
-#include <TeRaster.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeBox.h>
-
-void numeric_test_with_polygonset()
-{
-  /* Building synthetic raster */
-  
-  TePDITypes::TePDIRasterPtrType input_raster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster->init(), "Unable to init inRaster" );
-  
-  TePDIParameters pars;
-  
-  pars.SetParameter( "input_raster", input_raster );
-  
-  /* Building a polygon set based on the raster bounding box */
-  
-  TeBox box = input_raster->params().boundingBox();
-  TePolygon pol = polygonFromBox( box );
-  TePDITypes::TePDIPolygonSetPtrType polset( new TePolygonSet );
-  polset->add( pol );
-  pars.SetParameter( "polygonset", polset );
-  
-  /* Starting algorithm */
-  
-  TePDIHaralick algoinstance( TePDIHaralick::East );    
-  double value = 0;
-
-  TEAGN_TRUE_OR_THROW( algoinstance.Reset( pars ), "Reset error" );
-  
-  TEAGN_TRUE_OR_THROW( algoinstance.getEntropy( 0, 0, value ), 
-    "Error generation value" )
-  TEAGN_CHECK_EPS( value, 5.314640, 0.00001, "Invalid value" );
-
-
-  TEAGN_TRUE_OR_THROW( algoinstance.getEnergy( 0, 0, value ), 
-    "Error generation value" )
-  TEAGN_CHECK_EPS( value, 0.007787, 0.00001, "Invalid value" );
-
-
-  TEAGN_TRUE_OR_THROW( algoinstance.getContrast( 0, 0, value ), 
-    "Error generation value" )
-  TEAGN_CHECK_EPS( value, 0.492876, 0.00001, "Invalid value" );
-
-
-  TEAGN_TRUE_OR_THROW( algoinstance.getHomogeneity( 0, 0, value ), 
-    "Error generation value" )
-  TEAGN_CHECK_EPS( value, 0.572850, 0.00001, "Invalid value" );
-
-
-  TEAGN_TRUE_OR_THROW( algoinstance.getQuiSquare( 0, 0, value ), 
-    "Error generation value" )
-  TEAGN_CHECK_EPS( value, 30.240689, 0.00001, "Invalid value" );
-  
-  TEAGN_TRUE_OR_THROW( algoinstance.getMean( 0, 0, value ), 
-    "Error generation value" )
-  TEAGN_CHECK_EPS( value, 0.000023, 0.00001, "Invalid value" );  
-  
-  TEAGN_TRUE_OR_THROW( algoinstance.getDissimilarity( 0, 0, value ), 
-    "Error generation value" )
-  TEAGN_CHECK_EPS( value, 1.163392, 0.00001, "Invalid value" );   
-  
-  TEAGN_TRUE_OR_THROW( algoinstance.getAngular2ndMoment( 0, 0, value ), 
-    "Error generation value" )
-  TEAGN_CHECK_EPS( value, 0.007787, 0.00001, "Invalid value" );   
-  
-  TEAGN_TRUE_OR_THROW( algoinstance.getStdDev( 0, 0, value ), 
-    "Error generation value" )
-  TEAGN_CHECK_EPS( value, 8.770714, 0.00001, "Invalid value" );   
-  
-}
-
-
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
-      
-    TeInitRasterDecoders();
-
-    numeric_test_with_polygonset();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIHaralick.hpp>
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+
+#include <TeInitRasterDecoders.h>
+#include <TeRaster.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeBox.h>
+
+void numeric_test_with_polygonset()
+{
+  /* Building synthetic raster */
+  
+  TePDITypes::TePDIRasterPtrType input_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster->init(), "Unable to init inRaster" );
+  
+  TePDIParameters pars;
+  
+  pars.SetParameter( "input_raster", input_raster );
+  
+  /* Building a polygon set based on the raster bounding box */
+  
+  TeBox box = input_raster->params().boundingBox();
+  TePolygon pol = polygonFromBox( box );
+  TePDITypes::TePDIPolygonSetPtrType polset( new TePolygonSet );
+  polset->add( pol );
+  pars.SetParameter( "polygonset", polset );
+  
+  pars.SetParameter( "direction", TePDIHaralick::East );
+  
+  /* Starting algorithm */
+  
+  TePDIHaralick algoinstance;    
+  double value = 0;
+
+  TEAGN_TRUE_OR_THROW( algoinstance.Reset( pars ), "Reset error" );
+  
+  TEAGN_TRUE_OR_THROW( algoinstance.getGLCMEntropy( 0, 0, value ), 
+    "Error generation value" )
+  TEAGN_CHECK_EPS( value, 5.314640, 0.00001, "Invalid value" );
+
+
+  TEAGN_TRUE_OR_THROW( algoinstance.getGLCMEnergy( 0, 0, value ), 
+    "Error generation value" )
+  TEAGN_CHECK_EPS( value, 0.007787, 0.00001, "Invalid value" );
+
+
+  TEAGN_TRUE_OR_THROW( algoinstance.getGLCMContrast( 0, 0, value ), 
+    "Error generation value" )
+  TEAGN_CHECK_EPS( value, 3.765557, 0.00001, "Invalid value" );
+
+
+  TEAGN_TRUE_OR_THROW( algoinstance.getGLCMHomogeneity( 0, 0, value ), 
+    "Error generation value" )
+  TEAGN_CHECK_EPS( value, 0.572850, 0.00001, "Invalid value" );
+
+
+  TEAGN_TRUE_OR_THROW( algoinstance.getGLCMQuiSquare( 0, 0, value ), 
+    "Error generation value" )
+  TEAGN_CHECK_EPS( value, 30.240689, 0.00001, "Invalid value" );
+  
+  TEAGN_TRUE_OR_THROW( algoinstance.getGLCMMean( 0, 0, value ), 
+    "Error generation value" )
+  TEAGN_CHECK_EPS( value, 76.925340, 0.00001, "Invalid value" );  
+  
+  TEAGN_TRUE_OR_THROW( algoinstance.getGLCMDissimilarity( 0, 0, value ), 
+    "Error generation value" )
+  TEAGN_CHECK_EPS( value, 1.163392, 0.00001, "Invalid value" );   
+   
+  TEAGN_TRUE_OR_THROW( algoinstance.getGLCMStdDev( 0, 0, value ), 
+    "Error generation value" )
+  TEAGN_CHECK_EPS( value, 8.770714, 0.00001, "Invalid value" );   
+  
+  TEAGN_TRUE_OR_THROW( algoinstance.getGLCMCorrelation( 0, 0, value ), 
+    "Error generation value" )
+  TEAGN_CHECK_EPS( value, 0.955870, 0.00001, "Invalid value" );   
+  
+}
+
+
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
+      
+    TeInitRasterDecoders();
+
+    numeric_test_with_polygonset();
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIHaralick/TePDIHaralick_test.vcproj b/examples/image_processing/source/TePDIHaralick/TePDIHaralick_test.vcproj
old mode 100755
new mode 100644
index a15b55e..7a99697
--- a/examples/image_processing/source/TePDIHaralick/TePDIHaralick_test.vcproj
+++ b/examples/image_processing/source/TePDIHaralick/TePDIHaralick_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIHaralick_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIHaralick_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIHaralick_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIHaralick_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIHaralick_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIHaralick_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIHaralick_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIHaralick_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIHaralick_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIHaralick_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIHistogram/.cvsignore b/examples/image_processing/source/TePDIHistogram/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIHistogram/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIHistogram/TePDIHistogram.pro b/examples/image_processing/source/TePDIHistogram/TePDIHistogram.pro
old mode 100755
new mode 100644
index aa8bb77..a277a5b
--- a/examples/image_processing/source/TePDIHistogram/TePDIHistogram.pro
+++ b/examples/image_processing/source/TePDIHistogram/TePDIHistogram.pro
@@ -1,4 +1,4 @@
-include( ../base/base.pro )
-
-SOURCES += TePDIHistogram_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += TePDIHistogram_test.cpp
+
diff --git a/examples/image_processing/source/TePDIHistogram/TePDIHistogram_test.cpp b/examples/image_processing/source/TePDIHistogram/TePDIHistogram_test.cpp
old mode 100755
new mode 100644
index f3f2b12..7aff53c
--- a/examples/image_processing/source/TePDIHistogram/TePDIHistogram_test.cpp
+++ b/examples/image_processing/source/TePDIHistogram/TePDIHistogram_test.cpp
@@ -1,1202 +1,1109 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIHistogram.hpp>
-
-#include <TePDIUtils.hpp>
-
-#include <TeAgnostic.h>
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-
-
-#include <TeRaster.h>
-#include <TeDataTypes.h>
-#include <TeDecoderTIFF.h>
-#include <TeInitRasterDecoders.h>
-
-
-void display_histogram( TePDIHistogram& hist )
-{
-  TePDIHistogram::iterator it;
-  it = hist.begin();
-  
-  while( it != hist.end() ) {
-    TEAGN_LOGMSG( it->first );
-    TEAGN_LOGMSG( it->second );
-    ++it;
-  }
-}
-
-bool check_histogram_order( TePDIHistogram& hist )
-{
-  TePDIHistogram::iterator it1;
-  TePDIHistogram::iterator it2;
-  it1 = hist.begin();
-  it2 = it1;
-  ++it2;
-  
-  while( it2 != hist.end() ) {
-    if( (*it1) > (*it2) ) {
-      return false;
-    }
-    ++it1;
-    ++it2;
-  }
-  
-  return true;
-}
-
-void discrete_histogram_test_1()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
-      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 0, 1, 2 );
-    raster->setElement( 0, 2, 3 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, false, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );
-      
-    //display_histogram( hist );
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );
-    
-    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-
-    ++it;
-    
-    TEAGN_CHECK_EQUAL( it->first, 2. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    ++it;    
-
-    TEAGN_CHECK_EQUAL( it->first, 3. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 1., "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 3., "" );
-
-    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
-}
-
-void interpolated_histogram_test_1()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
-      TeDOUBLE, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 0, 1, 2 );
-    raster->setElement( 0, 2, 3 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, false, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );
-      
-    //display_histogram( hist );
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
-
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );
-            
-    /* The histogram was generated from a float raster, but it
-       must be a discrete histogram since the step between levels
-       is an integer value ( 1.0 ) */
-    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), 
-      "Discrete verification error" );
-      
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-
-    ++it;
-    
-    TEAGN_CHECK_EQUAL( it->first, 2. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    ++it;    
-
-    TEAGN_CHECK_EQUAL( it->first, 3. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 1., "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 3., "" );
-
-    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
-}
-
-
-void discrete_histogram_test_2()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
-      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 0, 1, 2 );
-    raster->setElement( 0, 2, 3 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, true, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );
-      
-    //display_histogram( hist );
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 4 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );    
-    
-    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-
-    it = hist.begin();
-    
-    TEAGN_CHECK_EQUAL( it->first, 0. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-
-    ++it;    
-
-    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-
-    ++it;
-    
-    TEAGN_CHECK_EQUAL( it->first, 2. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    ++it;    
-
-    TEAGN_CHECK_EQUAL( it->first, 3. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 0., "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 3., "" );
-
-    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 0, "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
-    
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
-}
-
-
-void discrete_histogram_test_16bits()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
-      TeUNSIGNEDSHORT, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 0, 1, 2 );
-    raster->setElement( 0, 2, 3 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, false, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );
-      
-    //display_histogram( hist );
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );    
-    
-    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-
-    ++it;
-    
-    TEAGN_CHECK_EQUAL( it->first, 2. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    ++it;    
-
-    TEAGN_CHECK_EQUAL( it->first, 3. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 1., "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 3., "" );
-
-    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
-}
-
-
-void normal_levels_test2()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 1, 2, false,
-      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 1, 0, 2 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 2, false, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );
-                
-    //display_histogram( hist );
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 2 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 2, 0, "Invalid total count" );
-        
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 2., 0, "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinCount(), 1., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 2, "Invalid pixels number" );
-}
-
-
-void normal_levels_test3()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 1, 3, false,
-      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 1, 0, 2 );
-    raster->setElement( 2, 0, 3 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 3, false, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );      
-      
-    //display_histogram( hist );
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );
-        
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-    
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-    
-
-    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 3., 0, "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinCount(), 1., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
-}
-
-
-void normal_levels_test4()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 2, 2, false,
-      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 1, 0, 2 );
-    raster->setElement( 0, 1, 3 );
-    raster->setElement( 1, 1, 4 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 4, false, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );      
-      
-    //display_histogram( hist );
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 4 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 4, 0, "Invalid total count" );
-        
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 4., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 4., 0, "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinCount(), 1., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 4, "Invalid pixels number" );
-}
-
-
-void auto_levels_test()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 2, 2, false,
-      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 1, 0, 2 );
-    raster->setElement( 0, 1, 3 );
-    raster->setElement( 1, 1, 4 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, true, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );      
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 5 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 4, 0, "Invalid total count" );
-        
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EPS( it->first, 0., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 0., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 4., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinLevel(), 0, 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 4., 0, "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinCount(), 0., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );    
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 4, "Invalid pixels number" );
-}
-
-
-void zero_expansion_test()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 2, 2, false,
-      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 1, 0, 2 );
-    raster->setElement( 0, 1, 3 );
-    raster->setElement( 1, 1, 4 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-    
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 4, true, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );
-      
-    //display_histogram( hist );
-    
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 4 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 4, 0, "Invalid total count" );
-        
-    TEAGN_TRUE_OR_THROW( ( ! hist.hasFixedStep() ), 
-      "Step verification error" );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EPS( it->first, 0., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 0., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 1.3333333, 0.000001, "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 2.666666, 0.000001, "" );
-    TEAGN_CHECK_EPS( it->second, 2., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 4., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinLevel(), 0., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 4., 0, "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinCount(), 0., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxCount(), 2., 0, "" );
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 4, "Invalid pixels number" );
-}
-
-
-
-void discretize_test()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 2, 2, false,
-      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 1, 0, 2 );
-    raster->setElement( 0, 1, 3 );
-    raster->setElement( 1, 1, 4 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 6, false, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );            
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 6 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 4, 0, "Invalid total count" );
-        
-    TEAGN_TRUE_OR_THROW( ( ! hist.hasFixedStep() ), 
-      "Step verification error" );
-    
-    //display_histogram( hist );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 1.6, 0., "" );
-    TEAGN_CHECK_EPS( it->second, 0., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 2.2, 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 2.8, 0.0000001, "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 3.4, 0.0000001, "" );
-    TEAGN_CHECK_EPS( it->second, 0., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 4.0, 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-
-    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 4., 0, "" );
-    
-    TEAGN_CHECK_EPS( hist.GetMinCount(), 0., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );    
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 4, "Invalid pixels number" );
-
-
-    TEAGN_TRUE_OR_THROW( ! hist.IsDiscrete(),
-      "Discretize verification error" );
-    TEAGN_TRUE_OR_THROW( hist.Discretize(), "Unable to discretize" );
-    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discretize verification error" );
-    
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );  
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );  
-    
-    //display_histogram( hist );
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 4 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 4, 0, "Invalid total count" );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 4., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 4., 0, "" );
-
-    TEAGN_CHECK_EPS( hist.GetMinCount(), 1., 0, "" );
-    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );
-
-    it = hist.begin();
-    it_end = hist.end();
-    pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 4, "Invalid pixels number" );
-}
-
-
-void performance_test()
-{
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 
-    'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  
-  TePDIHistogram hist;
-
-  TEAGN_TRUE_OR_THROW( hist.reset( inRaster, 0, 0, true, TeBoxPixelIn ),
-    "Unable to create histogram" );
-    
-  TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-    "Histogram order error" );    
-    
-  TEAGN_TRUE_OR_THROW( hist.size() == 256, "Invalid histogram size" );
-  
-  TEAGN_CHECK_EPS( hist.getTotalCount(), 720657, 0, "Invalid total count" );
-  
-  TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-}
-
-
-void operator_equal_from_map_test()
-{
-  std::map< double, unsigned int > simple_map1;
-  simple_map1[ 0.0 ] = 1;
-  simple_map1[ 1.0 ] = 2;
-  simple_map1[ 2.0 ] = 3;
-  simple_map1[ 3.0 ] = 4;
-  
-  TePDIHistogram hist1;
-  hist1 = simple_map1;
-  
-  TEAGN_TRUE_OR_THROW( ( hist1.size() == 4 ), "Invalid histogram size" );
-  
-  TEAGN_CHECK_EPS( hist1.getTotalCount(), 10, 0, "Invalid total count" );
-  
-  TEAGN_TRUE_OR_THROW( check_histogram_order( hist1 ),
-    "Histogram order error" );
-  TEAGN_CHECK_EPS( hist1.GetMinLevel(), 0, 0, "" );
-  TEAGN_CHECK_EPS( hist1.GetMaxLevel(), 3, 0, "" );
-  TEAGN_CHECK_EPS( hist1.GetMinCount(), 1, 0, "" );
-  TEAGN_CHECK_EPS( hist1.GetMaxCount(), 4, 0, "" );  
-  TEAGN_TRUE_OR_THROW( hist1.hasFixedStep(), "Step verification error" );
-  
-  {
-    TePDIHistogram::iterator it = hist1.begin();
-
-    TEAGN_CHECK_EPS( it->first, 0., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 2., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 3., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 4., 0., "" );  
-  }
-  
-  /* Testing with external floating point levels map */
-  
-  std::map< double, unsigned int > simple_map2;
-  simple_map2[ 0.0 ] = 1;
-  simple_map2[ 1.1 ] = 2;
-  simple_map2[ 2.0 ] = 3;
-  simple_map2[ 3.0 ] = 4;
-  
-  TePDIHistogram hist2;
-  hist2 = simple_map2;
-  
-  //display_histogram( hist2 );
-  
-  TEAGN_TRUE_OR_THROW( ( hist2.size() == 4 ), "Invalid histogram size" );
-  
-  TEAGN_CHECK_EPS( hist2.getTotalCount(), 10, 0, "Invalid total count" );
-  
-  TEAGN_TRUE_OR_THROW( check_histogram_order( hist2 ),
-    "Histogram order error" );
-  TEAGN_CHECK_EPS( hist2.GetMinLevel(), 0, 0, "" );
-  TEAGN_CHECK_EPS( hist2.GetMaxLevel(), 3, 0, "" );
-  TEAGN_CHECK_EPS( hist2.GetMinCount(), 1, 0, "" );
-  TEAGN_CHECK_EPS( hist2.GetMaxCount(), 4, 0, "" );  
-  TEAGN_TRUE_OR_THROW( ( hist2.hasFixedStep() ), "Step verification error" );
-  
-  {
-    TePDIHistogram::iterator it = hist2.begin();
-
-    TEAGN_CHECK_EPS( it->first, 0., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 2., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 3., 0., "" );
-
-    ++it;
-
-    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
-    TEAGN_CHECK_EPS( it->second, 4., 0., "" );  
-  }  
-}
-
-
-void histogram_from_TeCHAR_test()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
-      TeCHAR, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, -1 );
-    raster->setElement( 0, 1, 0 );
-    raster->setElement( 0, 2, 1 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, false, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );
-      
-    //display_histogram( hist );
-      
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );    
-    
-    it = hist.begin();
-
-    TEAGN_CHECK_EQUAL( it->first, -1. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-
-    ++it;
-    
-    TEAGN_CHECK_EQUAL( it->first, 0. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    ++it;    
-
-    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );    
-    
-    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), -1., "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 1., "" );
-
-    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
-}
-
-
-void histogram_from_TeSHORT_test()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
-      TeSHORT, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, -1 );
-    raster->setElement( 0, 1, 0 );
-    raster->setElement( 0, 2, 1 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, false, TeBoxPixelIn ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );
-      
-    //display_histogram( hist );
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );    
-    
-    it = hist.begin();
-
-    TEAGN_CHECK_EQUAL( it->first, -1. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-
-    ++it;
-    
-    TEAGN_CHECK_EQUAL( it->first, 0. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    ++it;    
-
-    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );    
-    
-    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), -1., "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 1., "" );
-
-    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
-}
-
-
-void discrete_histogram_with_external_polygonset_test()
-{
-    TePDITypes::TePDIRasterPtrType raster;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
-      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-
-    raster->setElement( 0, 0, 1 );
-    raster->setElement( 0, 1, 2 );
-    raster->setElement( 0, 2, 3 );
-
-    TePDIHistogram hist;
-
-    TePDIHistogram::iterator it;
-    
-    /* Creating polygon set from raster box */
-    
-    TeSharedPtr< TePolygonSet > polsetptr( new TePolygonSet );
-    TeBox rasterbox( raster->params().boundingBox() );
-    polsetptr->add( polygonFromBox( rasterbox ) );    
-
-    /* Test 1 */
-
-    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, false, 
-      TeBoxPixelIn, polsetptr ),
-      "Unable to create histogram" );
-      
-    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-      "Histogram order error" );
-      
-    //display_histogram( hist );
-
-    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
-    
-    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );    
-    
-    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
-    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-
-    it = hist.begin();
-
-    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-
-    ++it;
-    
-    TEAGN_CHECK_EQUAL( it->first, 2. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    ++it;    
-
-    TEAGN_CHECK_EQUAL( it->first, 3. , "" );
-    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 1., "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 3., "" );
-
-    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
-    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
-
-    it = hist.begin();
-    TePDIHistogram::iterator it_end = hist.end();
-    unsigned int pixelsnmb = 0;
-    while( it != it_end ) {
-      pixelsnmb += it->second;
-      ++it;
-    }
-    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
-}
-
-void palette_based_histogram_test()
-{
-  /* Building palette based raster */
-  
-  TeRasterParams params;
-  params.setNLinesNColumns( 3, 1 );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR );
-  params.setPhotometric( TeRasterParams::TePallete, -1 );
-  params.lutr_.push_back( 1 );
-  params.lutr_.push_back( 2 );
-  params.lutr_.push_back( 4 );
-
-  TePDITypes::TePDIRasterPtrType raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, params,
-    TePDIUtils::TePDIUtilsAutoMemPol ), "Unable to create raster" );
-
-  TEAGN_TRUE_OR_THROW( raster->setElement( 0, 0, 0 ), "setElement error" );
-  TEAGN_TRUE_OR_THROW( raster->setElement( 0, 1, 1 ), "setElement error" );
-  TEAGN_TRUE_OR_THROW( raster->setElement( 0, 2, 2 ), "setElement error" );
-
-  TePDIHistogram hist;
-
-  TePDIHistogram::iterator it;
-
-  /* Test 1 */
-
-  TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, true, 
-    TeBoxPixelIn ),
-    "Unable to create histogram" );
-    
-  TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
-    "Histogram order error" );
-    
-  //display_histogram( hist );
-
-  TEAGN_TRUE_OR_THROW( ( hist.size() == 5 ), "Invalid histogram size" );
-  
-  TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );
-  
-  TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
-  TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
-
-  it = hist.begin();
-
-  TEAGN_CHECK_EQUAL( it->first, 0. , "" );
-  TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-
-  ++it;
-  
-  TEAGN_CHECK_EQUAL( it->first, 1. , "" );
-  TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-  
-  ++it;    
-
-  TEAGN_CHECK_EQUAL( it->first, 2. , "" );
-  TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-  
-  ++it;    
-
-  TEAGN_CHECK_EQUAL( it->first, 3. , "" );
-  TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-
-  ++it;    
-
-  TEAGN_CHECK_EQUAL( it->first, 4. , "" );
-  TEAGN_CHECK_EQUAL( it->second, 1 , "" );
-    
-  
-  TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 0., "" );
-  TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 4., "" );
-
-  TEAGN_CHECK_EQUAL( hist.GetMinCount(), 0, "" );
-  TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
-
-  it = hist.begin();
-  TePDIHistogram::iterator it_end = hist.end();
-  unsigned int pixelsnmb = 0;
-  while( it != it_end ) {
-    pixelsnmb += it->second;
-    ++it;
-  }
-  TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeInitRasterDecoders();
-  
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) ); 
-    
-    discrete_histogram_test_1();
-    discrete_histogram_test_2();
-    discrete_histogram_test_16bits();
-    interpolated_histogram_test_1();
-    normal_levels_test2();
-    normal_levels_test3();
-    normal_levels_test4();
-    auto_levels_test();
-    zero_expansion_test();
-    discretize_test();
-    performance_test();
-    operator_equal_from_map_test();
-    histogram_from_TeCHAR_test();
-    histogram_from_TeSHORT_test();
-    discrete_histogram_with_external_polygonset_test();
-    palette_based_histogram_test();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIHistogram.hpp>
+
+#include <TePDIUtils.hpp>
+
+#include <TeAgnostic.h>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+
+
+#include <TeRaster.h>
+#include <TeDataTypes.h>
+#include <TeDecoderTIFF.h>
+#include <TeInitRasterDecoders.h>
+
+
+void display_histogram( TePDIHistogram& hist )
+{
+  TePDIHistogram::iterator it;
+  it = hist.begin();
+  
+  while( it != hist.end() ) {
+    TEAGN_LOGMSG( it->first );
+    TEAGN_LOGMSG( it->second );
+    ++it;
+  }
+}
+
+bool check_histogram_order( TePDIHistogram& hist )
+{
+  TePDIHistogram::iterator it1;
+  TePDIHistogram::iterator it2;
+  it1 = hist.begin();
+  it2 = it1;
+  ++it2;
+  
+  while( it2 != hist.end() ) {
+    if( (*it1) > (*it2) ) {
+      return false;
+    }
+    ++it1;
+    ++it2;
+  }
+  
+  return true;
+}
+
+void discrete_histogram_test_1()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
+      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, 1 );
+    raster->setElement( 0, 1, 2 );
+    raster->setElement( 0, 2, 3 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    /* Test 1 */
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );
+      
+    //display_histogram( hist );
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );
+    
+    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+
+    ++it;
+    
+    TEAGN_CHECK_EQUAL( it->first, 2. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    ++it;    
+
+    TEAGN_CHECK_EQUAL( it->first, 3. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 1., "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 3., "" );
+
+    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
+}
+
+void interpolated_histogram_test_1()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 5, 1, false,
+      TeDOUBLE, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, 1 );
+    raster->setElement( 0, 1, 1.9 );
+    raster->setElement( 0, 2, 2 );
+    raster->setElement( 0, 3, 2.1 );
+    raster->setElement( 0, 4, 3 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    /* Test 1 */
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_WATCH( hist.toString() );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );
+      
+    //display_histogram( hist );
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
+
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 5, 0, "Invalid total count" );
+            
+    /* The histogram was generated from a float raster, but it
+       must be a discrete histogram since the step between levels
+       is an integer value ( 1.0 ) */
+    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), 
+      "Discrete verification error" );
+      
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+
+    ++it;
+    
+    TEAGN_CHECK_EQUAL( it->first, 2. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 3 , "" );
+    
+    ++it;    
+
+    TEAGN_CHECK_EQUAL( it->first, 3. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 1., "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 3., "" );
+
+    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 3, "" );
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 5, "Invalid pixels number" );
+}
+
+
+void discrete_histogram_test_2()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
+      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, 1 );
+    raster->setElement( 0, 1, 2 );
+    raster->setElement( 0, 2, 3 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    /* Test 1 */
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_WATCH( hist.toString() );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );    
+    
+    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+
+    ++it;
+    
+    TEAGN_CHECK_EQUAL( it->first, 2. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    ++it;    
+
+    TEAGN_CHECK_EQUAL( it->first, 3. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 1., "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 3., "" );
+
+    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
+    
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
+}
+
+
+void discrete_histogram_test_16bits()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
+      TeUNSIGNEDSHORT, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, 1 );
+    raster->setElement( 0, 1, 2 );
+    raster->setElement( 0, 2, 3 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    /* Test 1 */
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );
+      
+    //display_histogram( hist );
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );    
+    
+    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+
+    ++it;
+    
+    TEAGN_CHECK_EQUAL( it->first, 2. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    ++it;    
+
+    TEAGN_CHECK_EQUAL( it->first, 3. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 1., "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 3., "" );
+
+    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
+}
+
+
+void normal_levels_test2()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 1, 2, false,
+      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, 1 );
+    raster->setElement( 1, 0, 2 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    /* Test 1 */
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 2, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );
+                
+    //display_histogram( hist );
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 2 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 2, 0, "Invalid total count" );
+        
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 2., 0, "" );
+
+    TEAGN_CHECK_EPS( hist.GetMinCount(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 2, "Invalid pixels number" );
+}
+
+
+void normal_levels_test3()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 1, 3, false,
+      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, 1 );
+    raster->setElement( 1, 0, 2 );
+    raster->setElement( 2, 0, 3 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    /* Test 1 */
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 3, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );      
+      
+    //display_histogram( hist );
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );
+        
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+    
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+    
+
+    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 3., 0, "" );
+
+    TEAGN_CHECK_EPS( hist.GetMinCount(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
+}
+
+
+void normal_levels_test4()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 2, 2, false,
+      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, 1 );
+    raster->setElement( 1, 0, 2 );
+    raster->setElement( 0, 1, 3 );
+    raster->setElement( 1, 1, 4 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    /* Test 1 */
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 4, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );      
+      
+    //display_histogram( hist );
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 4 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 4, 0, "Invalid total count" );
+        
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 4., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 4., 0, "" );
+
+    TEAGN_CHECK_EPS( hist.GetMinCount(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 4, "Invalid pixels number" );
+}
+
+
+void auto_levels_test()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 2, 2, false,
+      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, 1 );
+    raster->setElement( 1, 0, 2 );
+    raster->setElement( 0, 1, 3 );
+    raster->setElement( 1, 1, 4 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );      
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 4 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 4, 0, "Invalid total count" );
+        
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+    
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 4., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1, 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 4., 0, "" );
+
+    TEAGN_CHECK_EPS( hist.GetMinCount(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );    
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 4, "Invalid pixels number" );
+}
+
+
+void discretize_test()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 2, 2, false,
+      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, 1 );
+    raster->setElement( 1, 0, 2 );
+    raster->setElement( 0, 1, 3 );
+    raster->setElement( 1, 1, 4 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 6, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_WATCH( hist.toString() )
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );            
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 4 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 4, 0, "Invalid total count" );
+        
+    TEAGN_TRUE_OR_THROW( ( ! hist.hasFixedStep() ), 
+      "Step verification error" );
+    
+    //display_histogram( hist );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 2.20, 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 2.8, 0.0000001, "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 4, 0.0000001, "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+
+    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 4., 0, "" );
+    
+    TEAGN_CHECK_EPS( hist.GetMinCount(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );    
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 4, "Invalid pixels number" );
+
+
+    TEAGN_TRUE_OR_THROW( ! hist.IsDiscrete(),
+      "Discretize verification error" );
+    TEAGN_TRUE_OR_THROW( hist.Discretize(), "Unable to discretize" );
+    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discretize verification error" );
+    TEAGN_WATCH( hist.toString() )
+    
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );  
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );  
+    
+    //display_histogram( hist );
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 4 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 4, 0, "Invalid total count" );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 4., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    TEAGN_CHECK_EPS( hist.GetMinLevel(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxLevel(), 4., 0, "" );
+
+    TEAGN_CHECK_EPS( hist.GetMinCount(), 1., 0, "" );
+    TEAGN_CHECK_EPS( hist.GetMaxCount(), 1., 0, "" );
+
+    it = hist.begin();
+    it_end = hist.end();
+    pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 4, "Invalid pixels number" );
+}
+
+
+void performance_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 
+    'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  
+  TePDIHistogram hist;
+
+  TEAGN_TRUE_OR_THROW( hist.reset( inRaster, 0, 0, TeBoxPixelIn ),
+    "Unable to create histogram" );
+    
+  TEAGN_WATCH( hist.toString() )
+    
+  TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+    "Histogram order error" );    
+    
+  TEAGN_CHECK_EPS( hist.size(), 180, 0, "Invalid histogram size" );
+  
+  TEAGN_CHECK_EPS( hist.getTotalCount(), 720657, 0, "Invalid total count" );
+}
+
+
+void operator_equal_from_map_test()
+{
+  std::map< double, unsigned int > simple_map1;
+  simple_map1[ 0.0 ] = 1;
+  simple_map1[ 1.0 ] = 2;
+  simple_map1[ 2.0 ] = 3;
+  simple_map1[ 3.0 ] = 4;
+  
+  TePDIHistogram hist1;
+  hist1 = simple_map1;
+  
+  TEAGN_TRUE_OR_THROW( ( hist1.size() == 4 ), "Invalid histogram size" );
+  
+  TEAGN_CHECK_EPS( hist1.getTotalCount(), 10, 0, "Invalid total count" );
+  
+  TEAGN_TRUE_OR_THROW( check_histogram_order( hist1 ),
+    "Histogram order error" );
+  TEAGN_CHECK_EPS( hist1.GetMinLevel(), 0, 0, "" );
+  TEAGN_CHECK_EPS( hist1.GetMaxLevel(), 3, 0, "" );
+  TEAGN_CHECK_EPS( hist1.GetMinCount(), 1, 0, "" );
+  TEAGN_CHECK_EPS( hist1.GetMaxCount(), 4, 0, "" );  
+  TEAGN_TRUE_OR_THROW( hist1.hasFixedStep(), "Step verification error" );
+  
+  {
+    TePDIHistogram::iterator it = hist1.begin();
+
+    TEAGN_CHECK_EPS( it->first, 0., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 2., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 3., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 4., 0., "" );  
+  }
+  
+  /* Testing with external floating point levels map */
+  
+  std::map< double, unsigned int > simple_map2;
+  simple_map2[ 0.0 ] = 1;
+  simple_map2[ 1.1 ] = 2;
+  simple_map2[ 2.0 ] = 3;
+  simple_map2[ 3.0 ] = 4;
+  
+  TePDIHistogram hist2;
+  hist2 = simple_map2;
+  
+  //display_histogram( hist2 );
+  
+  TEAGN_TRUE_OR_THROW( ( hist2.size() == 4 ), "Invalid histogram size" );
+  
+  TEAGN_CHECK_EPS( hist2.getTotalCount(), 10, 0, "Invalid total count" );
+  
+  TEAGN_TRUE_OR_THROW( check_histogram_order( hist2 ),
+    "Histogram order error" );
+  TEAGN_CHECK_EPS( hist2.GetMinLevel(), 0, 0, "" );
+  TEAGN_CHECK_EPS( hist2.GetMaxLevel(), 3, 0, "" );
+  TEAGN_CHECK_EPS( hist2.GetMinCount(), 1, 0, "" );
+  TEAGN_CHECK_EPS( hist2.GetMaxCount(), 4, 0, "" );  
+  TEAGN_TRUE_OR_THROW( ( hist2.hasFixedStep() ), "Step verification error" );
+  
+  {
+    TePDIHistogram::iterator it = hist2.begin();
+
+    TEAGN_CHECK_EPS( it->first, 0., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 1., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 1., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 2., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 2., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 3., 0., "" );
+
+    ++it;
+
+    TEAGN_CHECK_EPS( it->first, 3., 0., "" );
+    TEAGN_CHECK_EPS( it->second, 4., 0., "" );  
+  }  
+}
+
+
+void histogram_from_TeCHAR_test()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
+      TeCHAR, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, -1 );
+    raster->setElement( 0, 1, 0 );
+    raster->setElement( 0, 2, 1 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    /* Test 1 */
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );
+      
+    //display_histogram( hist );
+      
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );    
+    
+    it = hist.begin();
+
+    TEAGN_CHECK_EQUAL( it->first, -1. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+
+    ++it;
+    
+    TEAGN_CHECK_EQUAL( it->first, 0. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    ++it;    
+
+    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );    
+    
+    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), -1., "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 1., "" );
+
+    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
+}
+
+
+void histogram_from_TeSHORT_test()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
+      TeSHORT, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, -1 );
+    raster->setElement( 0, 1, 0 );
+    raster->setElement( 0, 2, 1 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+
+    /* Test 1 */
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0, TeBoxPixelIn ),
+      "Unable to create histogram" );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );
+      
+    //display_histogram( hist );
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );    
+    
+    it = hist.begin();
+
+    TEAGN_CHECK_EQUAL( it->first, -1. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+
+    ++it;
+    
+    TEAGN_CHECK_EQUAL( it->first, 0. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    ++it;    
+
+    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );    
+    
+    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), -1., "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 1., "" );
+
+    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
+}
+
+
+void discrete_histogram_with_external_polygonset_test()
+{
+    TePDITypes::TePDIRasterPtrType raster;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, 1, 3, 1, false,
+      TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
+
+    raster->setElement( 0, 0, 1 );
+    raster->setElement( 0, 1, 2 );
+    raster->setElement( 0, 2, 3 );
+
+    TePDIHistogram hist;
+
+    TePDIHistogram::iterator it;
+    
+    /* Creating polygon set from raster box */
+    
+    TeSharedPtr< TePolygonSet > polsetptr( new TePolygonSet );
+    TeBox rasterbox( raster->params().boundingBox() );
+    polsetptr->add( polygonFromBox( rasterbox ) );    
+
+    /* Test 1 */
+
+    TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0,  
+      TeBoxPixelIn, polsetptr ),
+      "Unable to create histogram" );
+      
+    TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+      "Histogram order error" );
+      
+    //display_histogram( hist );
+
+    TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
+    
+    TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );    
+    
+    TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
+    TEAGN_TRUE_OR_THROW( hist.hasFixedStep(), "Step verification error" );
+
+    it = hist.begin();
+
+    TEAGN_CHECK_EQUAL( it->first, 1. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+
+    ++it;
+    
+    TEAGN_CHECK_EQUAL( it->first, 2. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    ++it;    
+
+    TEAGN_CHECK_EQUAL( it->first, 3. , "" );
+    TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+    TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 1., "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 3., "" );
+
+    TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
+    TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
+
+    it = hist.begin();
+    TePDIHistogram::iterator it_end = hist.end();
+    unsigned int pixelsnmb = 0;
+    while( it != it_end ) {
+      pixelsnmb += it->second;
+      ++it;
+    }
+    TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
+}
+
+void palette_based_histogram_test()
+{
+  /* Building palette based raster */
+  
+  TeRasterParams params;
+  params.setNLinesNColumns( 3, 1 );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR );
+  params.setPhotometric( TeRasterParams::TePallete, -1 );
+  params.lutr_.push_back( 1 );
+  params.lutr_.push_back( 2 );
+  params.lutr_.push_back( 4 );
+
+  TePDITypes::TePDIRasterPtrType raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster, params,
+    TePDIUtils::TePDIUtilsAutoMemPol ), "Unable to create raster" );
+
+  TEAGN_TRUE_OR_THROW( raster->setElement( 0, 0, 0 ), "setElement error" );
+  TEAGN_TRUE_OR_THROW( raster->setElement( 0, 1, 1 ), "setElement error" );
+  TEAGN_TRUE_OR_THROW( raster->setElement( 0, 2, 2 ), "setElement error" );
+
+  TePDIHistogram hist;
+
+  TePDIHistogram::iterator it;
+
+  /* Test 1 */
+
+  TEAGN_TRUE_OR_THROW( hist.reset( raster, 0, 0,  
+    TeBoxPixelIn ),
+    "Unable to create histogram" );
+    
+  TEAGN_WATCH( hist.toString() )
+    
+  TEAGN_TRUE_OR_THROW( check_histogram_order( hist ),
+    "Histogram order error" );
+    
+  //display_histogram( hist );
+
+  TEAGN_TRUE_OR_THROW( ( hist.size() == 3 ), "Invalid histogram size" );
+  
+  TEAGN_CHECK_EPS( hist.getTotalCount(), 3, 0, "Invalid total count" );
+  
+  TEAGN_TRUE_OR_THROW( hist.IsDiscrete(), "Discrete verification error" );
+
+  it = hist.begin();
+  
+  TEAGN_CHECK_EQUAL( it->first, 1. , "" );
+  TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+  
+  ++it;    
+
+  TEAGN_CHECK_EQUAL( it->first, 2. , "" );
+  TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+
+  ++it;    
+
+  TEAGN_CHECK_EQUAL( it->first, 4. , "" );
+  TEAGN_CHECK_EQUAL( it->second, 1 , "" );
+    
+  
+  TEAGN_CHECK_EQUAL( hist.GetMinLevel(), 1., "" );
+  TEAGN_CHECK_EQUAL( hist.GetMaxLevel(), 4., "" );
+
+  TEAGN_CHECK_EQUAL( hist.GetMinCount(), 1, "" );
+  TEAGN_CHECK_EQUAL( hist.GetMaxCount(), 1, "" );
+
+  it = hist.begin();
+  TePDIHistogram::iterator it_end = hist.end();
+  unsigned int pixelsnmb = 0;
+  while( it != it_end ) {
+    pixelsnmb += it->second;
+    ++it;
+  }
+  TEAGN_TRUE_OR_THROW( pixelsnmb == 3, "Invalid pixels number" );
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeInitRasterDecoders();
+  
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) ); 
+    
+    discrete_histogram_test_1();
+    discrete_histogram_test_2();
+    discrete_histogram_test_16bits();
+    interpolated_histogram_test_1();
+    normal_levels_test2();
+    normal_levels_test3();
+    normal_levels_test4();
+    auto_levels_test();
+    discretize_test();
+    performance_test();
+    operator_equal_from_map_test();
+    histogram_from_TeCHAR_test();
+    histogram_from_TeSHORT_test();
+    discrete_histogram_with_external_polygonset_test();
+    palette_based_histogram_test();
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIHistogram/TePDIHistogram_test.vcproj b/examples/image_processing/source/TePDIHistogram/TePDIHistogram_test.vcproj
old mode 100755
new mode 100644
index 067b715..934c72d
--- a/examples/image_processing/source/TePDIHistogram/TePDIHistogram_test.vcproj
+++ b/examples/image_processing/source/TePDIHistogram/TePDIHistogram_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIHistogram_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIHistogram_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIHistogram_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/tiff;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIHistogram_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIHistogram_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIHistogram_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIHistogram_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIHistogram_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/tiff;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIHistogram_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIHistogram_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIInterpolator/.cvsignore b/examples/image_processing/source/TePDIInterpolator/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIInterpolator/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator.pro b/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator.pro
old mode 100755
new mode 100644
index 8aeef48..db73b31
--- a/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator.pro
+++ b/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator.pro
@@ -1,6 +1,6 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIInterpolator_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIInterpolator_test.cpp
+
 QMAKE_CLEAN += 
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator_test.cpp b/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator_test.cpp
old mode 100755
new mode 100644
index e1e4eaf..7147fff
--- a/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator_test.cpp
+++ b/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator_test.cpp
@@ -1,160 +1,284 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIInterpolator.hpp>
-
-#include <TeAgnostic.h>
-#include <TePDITypes.hpp>
-#include <TePDIUtils.hpp>
-
-#include <TeInitRasterDecoders.h>
-
-void NN_test()
-{
-  TePDITypes::TePDIRasterPtrType input_raster;
-  
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 2;
-  params.ncols_ = 2;
-  params.setDataType( TeDOUBLE, -1 );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster,
-    params, false ), "Allocation error" );
-    
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 0, 1.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 0, 2.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 1, 3.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 1, 4.0, 0 ), 
-    "error defining raster element");
-    
-  TePDIInterpolator interp;
-  
-  TEAGN_TRUE_OR_THROW( interp.reset( input_raster, 
-    TePDIInterpolator::NNMethod, 0 ), "Reset error" );
-    
-  double value = 0;
-    
-  interp.interpolate( 0, 0, 0, value );
-  TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");
-  interp.interpolate( 0, 1, 0, value );
-  TEAGN_CHECK_EPS( 2.0, value , 0.000001, "");
-  interp.interpolate( 1, 0, 0, value );
-  TEAGN_CHECK_EPS( 3.0, value , 0.000001, "");
-  interp.interpolate( 1, 1, 0, value );
-  TEAGN_CHECK_EPS( 4.0, value , 0.000001, "");
-  
-  interp.interpolate( 0.2, 0.2, 0, value );
-  TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");  
-  interp.interpolate( 0.7, 0.7, 0, value );
-  TEAGN_CHECK_EPS( 4.0, value , 0.000001, "");  
-}
-
-
-void bilinear_test()
-{
-  TePDITypes::TePDIRasterPtrType input_raster;
-  
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 2;
-  params.ncols_ = 2;
-  params.setDataType( TeDOUBLE, -1 );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster,
-    params, false ), "Allocation error" );
-    
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 0, 1.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 0, 2.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 1, 3.0, 0 ), 
-    "error defining raster element");
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 1, 4.0, 0 ), 
-    "error defining raster element");
-    
-  TePDIInterpolator interp;
-  
-  TEAGN_TRUE_OR_THROW( interp.reset( input_raster, 
-    TePDIInterpolator::BilinearMethod, 0 ), "Reset error" );
-    
-  double value = 0;
-    
-  interp.interpolate( 0, 0, 0, value );
-  TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");
-  interp.interpolate( 0, 1, 0, value );
-  TEAGN_CHECK_EPS( 2.0, value , 0.000001, "");
-  interp.interpolate( 1, 0, 0, value );
-  TEAGN_CHECK_EPS( 3.0, value , 0.000001, "");
-  interp.interpolate( 1, 1, 0, value );
-  TEAGN_CHECK_EPS( 4.0, value , 0.000001, "");
-  
-  interp.interpolate( 0.5, 0.5, 0, value );
-  TEAGN_CHECK_EPS( 2.5, value , 0.000001, "");  
-}
-
-
-void bicubic_test()
-{
-  TePDITypes::TePDIRasterPtrType input_raster;
-  
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 4;
-  params.ncols_ = 4;
-  params.setDataType( TeDOUBLE, -1 );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster,
-    params, false ), "Allocation error" );
-    
-  unsigned int line = 0;
-  unsigned int col = 0;  
-  
-  for( line = 0 ; line < 4 ; ++line ) {
-    for( col = 0 ; col < 4 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( input_raster->setElement( col, line, 1.0, 0 ), 
-      "error defining raster element");  
-    }
-  }
-    
-  TePDIInterpolator interp;
-  
-  TEAGN_TRUE_OR_THROW( interp.reset( input_raster, 
-    TePDIInterpolator::BicubicMethod, 0 ), "Reset error" );
-    
-  double value = 0;
-  
-  for( line = 0 ; line < 4 ; ++line ) {
-    for( col = 0 ; col < 4 ; ++col ) {
-      interp.interpolate( (double)line, (double)col, 0, value );
-      TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");
-    }
-  }  
-  
-  interp.interpolate( 1.5, 1.5, 0, value );
-  TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");  
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeInitRasterDecoders();
-
-    NN_test();
-    bilinear_test();
-    bicubic_test();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIInterpolator.hpp>
+
+#include <TeAgnostic.h>
+#include <TePDITypes.hpp>
+#include <TePDIUtils.hpp>
+
+#include <TeInitRasterDecoders.h>
+
+void NN_test()
+{
+  TePDITypes::TePDIRasterPtrType input_raster;
+  
+  TeRasterParams params;
+  params.nBands( 1 );
+  params.setNLinesNColumns( 2, 2 );
+  params.setDataType( TeDOUBLE, -1 );
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster,
+    params, false ), "Allocation error" );
+    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 0, 1.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 0, 2.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 1, 3.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 1, 4.0, 0 ), 
+    "error defining raster element");
+    
+  TePDIInterpolator interp;
+  
+  TEAGN_TRUE_OR_THROW( interp.reset( input_raster, 
+    TePDIInterpolator::NNMethod, 0 ), "Reset error" );
+    
+  double value = 0;
+  
+  // Outside image area
+  
+  interp.interpolate( -0.6, -0.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");
+  interp.interpolate( -0.6, 1.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");      
+  interp.interpolate( 1.6, -0.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");
+  interp.interpolate( 1.6, 1.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");  
+  
+  // Inside image area but not over pixel centers
+  
+  interp.interpolate( -0.2, -0.2, 0, value );
+  TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");  
+  interp.interpolate( 1.2, 1.2, 0, value );
+  TEAGN_CHECK_EPS( 4.0, value , 0.000001, "");  
+  interp.interpolate( 1.2, -0.2, 0, value );
+  TEAGN_CHECK_EPS( 3.0, value , 0.000001, "");  
+  interp.interpolate( -0.2, 1.2, 0, value );
+  TEAGN_CHECK_EPS( 2.0, value , 0.000001, "");   
+                
+  // Center of pixels
+    
+  interp.interpolate( 0, 0, 0, value );
+  TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");
+  interp.interpolate( 0, 1, 0, value );
+  TEAGN_CHECK_EPS( 2.0, value , 0.000001, "");
+  interp.interpolate( 1, 0, 0, value );
+  TEAGN_CHECK_EPS( 3.0, value , 0.000001, "");
+  interp.interpolate( 1, 1, 0, value );
+  TEAGN_CHECK_EPS( 4.0, value , 0.000001, "");                
+}
+
+
+void bilinear_test()
+{
+  TePDITypes::TePDIRasterPtrType input_raster;
+  
+  TeRasterParams params;
+  params.nBands( 1 );
+  params.setNLinesNColumns( 2, 2 );
+  params.setDataType( TeDOUBLE, -1 );
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster,
+    params, false ), "Allocation error" );
+    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 0, 1.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 0, 2.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 1, 3.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 1, 4.0, 0 ), 
+    "error defining raster element");
+    
+  TePDIInterpolator interp;
+  
+  TEAGN_TRUE_OR_THROW( interp.reset( input_raster, 
+    TePDIInterpolator::BilinearMethod, 0 ), "Reset error" );
+    
+  double value = 0;
+  
+  // Outside image area
+  
+  interp.interpolate( -0.6, -0.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");
+  interp.interpolate( -0.6, 1.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");      
+  interp.interpolate( 1.6, -0.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");
+  interp.interpolate( 1.6, 1.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, ""); 
+    
+  // Inside image area but not over pixel centers
+  
+  interp.interpolate( -0.2, -0.2, 0, value );
+  TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");  
+  interp.interpolate( 1.2, 1.2, 0, value );
+  TEAGN_CHECK_EPS( 4.0, value , 0.000001, "");  
+  interp.interpolate( 1.2, -0.2, 0, value );
+  TEAGN_CHECK_EPS( 3.0, value , 0.000001, "");  
+  interp.interpolate( -0.2, 1.2, 0, value );
+  TEAGN_CHECK_EPS( 2.0, value , 0.000001, "");     
+  
+  // Center of pixels
+    
+  interp.interpolate( 0, 0, 0, value );
+  TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");
+  interp.interpolate( 0, 1, 0, value );
+  TEAGN_CHECK_EPS( 2.0, value , 0.000001, "");
+  interp.interpolate( 1, 0, 0, value );
+  TEAGN_CHECK_EPS( 3.0, value , 0.000001, "");
+  interp.interpolate( 1, 1, 0, value );
+  TEAGN_CHECK_EPS( 4.0, value , 0.000001, "");
+  
+  // Image center 
+  
+  interp.interpolate( 0.5, 0.5, 0, value );
+  TEAGN_CHECK_EPS( 2.5, value , 0.000001, "");  
+}
+
+
+void bicubic_test()
+{
+  TePDITypes::TePDIRasterPtrType input_raster;
+  
+  TeRasterParams params;
+  params.nBands( 1 );
+  params.setNLinesNColumns( 4, 4 );
+  params.setDataType( TeDOUBLE, -1 );
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster,
+    params, false ), "Allocation error" );
+    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 0, 1.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 0, 2.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 0, 3.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 0, 4.0, 0 ), 
+    "error defining raster element");
+    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 1, 5.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 1, 6.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 1, 7.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 1, 8.0, 0 ), 
+    "error defining raster element");
+    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 2, 9.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 2, 10.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 2, 11.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 2, 12.0, 0 ), 
+    "error defining raster element");
+    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 3, 13.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 3, 14.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 3, 15.0, 0 ), 
+    "error defining raster element");
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 3, 16.0, 0 ), 
+    "error defining raster element");
+    
+  TePDIInterpolator interp;
+  
+  TEAGN_TRUE_OR_THROW( interp.reset( input_raster, 
+    TePDIInterpolator::BicubicMethod, 0 ), "Reset error" );
+    
+  double value = 0;
+  
+  // Outside image area
+  
+  interp.interpolate( -0.6, -0.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");
+  interp.interpolate( -0.6, 3.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");      
+  interp.interpolate( 3.6, -0.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");
+  interp.interpolate( 3.6, 3.6, 0, value );
+  TEAGN_CHECK_EPS( 0.0, value , 0.000001, "");  
+  
+  // Inside image area but not over pixel centers
+  
+  interp.interpolate( -0.2, -0.2, 0, value );
+  TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");  
+  interp.interpolate( 3.2, 3.2, 0, value );
+  TEAGN_CHECK_EPS( 16.0, value , 0.000001, "");  
+  interp.interpolate( 3.2, -0.2, 0, value );
+  TEAGN_CHECK_EPS( 13.0, value , 0.000001, "");  
+  interp.interpolate( -0.2, 3.2, 0, value );
+  TEAGN_CHECK_EPS( 4.0, value , 0.000001, "");    
+  
+  // Center of pixels
+    
+  interp.interpolate( 0, 0, 0, value );
+  TEAGN_CHECK_EPS( 1.0, value , 0.000001, "");
+  interp.interpolate( 0, 1, 0, value );
+  TEAGN_CHECK_EPS( 2.0, value , 0.000001, "");
+  interp.interpolate( 0, 2, 0, value );
+  TEAGN_CHECK_EPS( 3.0, value , 0.000001, "");
+  interp.interpolate( 0, 3, 0, value );
+  TEAGN_CHECK_EPS( 4.0, value , 0.000001, "");
+  
+  interp.interpolate( 1, 0, 0, value );
+  TEAGN_CHECK_EPS( 5.0, value , 0.000001, "");
+  interp.interpolate( 1, 1, 0, value );
+  TEAGN_CHECK_EPS( 6.0, value , 0.000001, "");
+  interp.interpolate( 1, 2, 0, value );
+  TEAGN_CHECK_EPS( 7.0, value , 0.000001, "");
+  interp.interpolate( 1, 3, 0, value );
+  TEAGN_CHECK_EPS( 8.0, value , 0.000001, "");
+  
+  interp.interpolate( 2, 0, 0, value );
+  TEAGN_CHECK_EPS( 9.0, value , 0.000001, "");
+  interp.interpolate( 2, 1, 0, value );
+  TEAGN_CHECK_EPS( 10.0, value , 0.000001, "");
+  interp.interpolate( 2, 2, 0, value );
+  TEAGN_CHECK_EPS( 11.0, value , 0.000001, "");
+  interp.interpolate( 2, 3, 0, value );
+  TEAGN_CHECK_EPS( 12.0, value , 0.000001, "");
+  
+  interp.interpolate( 3, 0, 0, value );
+  TEAGN_CHECK_EPS( 13.0, value , 0.000001, "");
+  interp.interpolate( 3, 1, 0, value );
+  TEAGN_CHECK_EPS( 14.0, value , 0.000001, "");
+  interp.interpolate( 3, 2, 0, value );
+  TEAGN_CHECK_EPS( 15.0, value , 0.000001, "");
+  interp.interpolate( 3, 3, 0, value );
+  TEAGN_CHECK_EPS( 16.0, value , 0.000001, "");
+    
+  // Image center
+  
+  interp.interpolate( 1.5, 1.5, 0, value );
+  TEAGN_CHECK_EPS( 8.5, value , 0.000001, "");  
+  
+  // Inside image area but not over pixel centers
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeInitRasterDecoders();
+
+    NN_test();
+    bilinear_test();
+    bicubic_test();
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator_test.vcproj b/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator_test.vcproj
old mode 100755
new mode 100644
index 0b1845e..cc3c74e
--- a/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator_test.vcproj
+++ b/examples/image_processing/source/TePDIInterpolator/TePDIInterpolator_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIInterpolator_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIInterpolator_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIInterpolator_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIInterpolator_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIInterpolator_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIInterpolator_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIInterpolator_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIInterpolator_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIInterpolator_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIInterpolator_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIJointHistogram/.cvsignore b/examples/image_processing/source/TePDIJointHistogram/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIJointHistogram/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram.pro b/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram.pro
old mode 100755
new mode 100644
index d02b7a9..aa8f72b
--- a/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram.pro
+++ b/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram.pro
@@ -1,4 +1,4 @@
-include( ../base/base.pro )
-
-SOURCES += TePDIJointHistogram_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += TePDIJointHistogram_test.cpp
+
diff --git a/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram_test.cpp b/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram_test.cpp
old mode 100755
new mode 100644
index af18586..1bcb5ac
--- a/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram_test.cpp
+++ b/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram_test.cpp
@@ -1,378 +1,324 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIJointHistogram.hpp>
-#include <TePDIHistogram.hpp>
-
-#include <TePDIUtils.hpp>
-
-#include <TeAgnostic.h>
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-void jointHistogram_8bits_test()
-{
-    // Generating test rasters
-
-    TePDITypes::TePDIRasterPtrType raster1;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster1, 1, 2, 2, 
-      false, TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 0, 1, 0 ), "error" )
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 1, 2, 0 ), "error" )
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 0, 1, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 1, 2, 0 ), "error" );
-    
-    TePDITypes::TePDIRasterPtrType raster2;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster2, 1, 2, 2, 
-      false, TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 0, 1, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 1, 3, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 0, 1, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 1, 3, 0 ), "error" );
-
-    // Generating joint histogram
-
-    TePDIJointHistogram hist;
-
-    TEAGN_TRUE_OR_THROW( hist.update( *raster1, 0, *raster2, 0,
-      TeBoxPixelIn, 0 ), "Unable to create histogram" );
-      
-    // Checking histogram
-    {
-      TEAGN_TRUE_OR_THROW( ( hist.size() == 6 ), "Invalid histogram size" );
-  
-      TePDIJointHistogram::const_iterator it = hist.begin();
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 3 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 3 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-    }
-    // Checking raster 1 histogram
-    
-    {
-      const TePDIHistogram& r1hist = hist.getRaster1Hist();
-      TEAGN_TRUE_OR_THROW( ( r1hist.size() == 2 ), "Invalid histogram size" );
-  
-      TePDIHistogram::const_iterator it = r1hist.begin();
-  
-      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;      
-    }    
-    
-    // Checking raster 2 histogram
- 
-    {
-      const TePDIHistogram& r2hist = hist.getRaster2Hist();
-      TEAGN_TRUE_OR_THROW( ( r2hist.size() == 3 ), "Invalid histogram size" );
-  
-      TePDIHistogram::const_iterator it = r2hist.begin();
-  
-      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-            
-      TEAGN_CHECK_EQUAL( it->first, 3 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;      
-    }     
-}
-
-void jointHistogram_8bits_images_test()
-{
-  // Initializing raster instances
-  
-  TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
-    'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster1->init(), "Unable to init inRaster" );
-
-  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
-    'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster" );
-
-
-  // Generating joint histogram
-
-  TePDIJointHistogram jhist;
-
-  TEAGN_TRUE_OR_THROW( jhist.update( *inRaster1, 0, *inRaster2, 1,
-    TeBoxPixelIn, 0 ), "Unable to create histogram" );  
-  
-  // Generating single histograms (just for comparison)
-  
-  TePDIHistogram hist1;
-  TEAGN_TRUE_OR_THROW( hist1.reset( inRaster1, 0, 0, 0, TeBoxPixelIn ),
-    "Unable to create histogram" );
-
-  TePDIHistogram hist2;
-  TEAGN_TRUE_OR_THROW( hist2.reset( inRaster2, 1, 0, 0, TeBoxPixelIn ),
-    "Unable to create histogram" );
-    
-  // Comparing single histograms with that ones created by the joint histogram.
-  
-  const TePDIHistogram& hist1b = jhist.getRaster1Hist();
-  const TePDIHistogram& hist2b = jhist.getRaster2Hist();
-  
-  TEAGN_TRUE_OR_THROW( hist1 == hist1b, "Histogram mismatch" )
-  TEAGN_TRUE_OR_THROW( hist2 == hist2b, "Histogram mismatch" )
-}
-
-void jointHistogram_float_test()
-{
-    // Generating test rasters
-
-    TePDITypes::TePDIRasterPtrType raster1;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster1, 1, 2, 2, 
-      false, TeDOUBLE, 0 ), "Unable to create raster" );
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 0, 1, 0 ), "error" )
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 1, 2, 0 ), "error" )
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 0, 1, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 1, 2, 0 ), "error" );
-    
-    TePDITypes::TePDIRasterPtrType raster2;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster2, 1, 2, 2, 
-      false, TeDOUBLE, 0 ), "Unable to create raster" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 0, 1, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 1, 3, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 0, 1, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 1, 3, 0 ), "error" );
-
-    // Generating joint histogram
-
-    TePDIJointHistogram hist;
-
-    TEAGN_TRUE_OR_THROW( hist.update( *raster1, 0, *raster2, 0,
-      TeBoxPixelIn, 3 ), "Unable to create histogram" );
-      
-    // Checking histogram
-    {
-      TEAGN_TRUE_OR_THROW( ( hist.size() == 9 ), "Invalid histogram size" );
-  
-      TePDIJointHistogram::const_iterator it = hist.begin();
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 3 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-      
-      TEAGN_CHECK_EQUAL( it->first.first, 1.5 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 1.5 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 1.5 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 3 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;      
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 3 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-    }
-    // Checking raster 1 histogram
-    
-    {
-      const TePDIHistogram& r1hist = hist.getRaster1Hist();
-      TEAGN_TRUE_OR_THROW( ( r1hist.size() == 3 ), "Invalid histogram size" );
-  
-      TePDIHistogram::const_iterator it = r1hist.begin();
-  
-      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-      
-      TEAGN_CHECK_EQUAL( it->first, 1.5 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;      
-  
-      TEAGN_CHECK_EQUAL( it->first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;      
-    }    
-    
-    // Checking raster 2 histogram
- 
-    {
-      const TePDIHistogram& r2hist = hist.getRaster2Hist();
-      TEAGN_TRUE_OR_THROW( ( r2hist.size() == 3 ), "Invalid histogram size" );
-  
-      TePDIHistogram::const_iterator it = r2hist.begin();
-  
-      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 0 , "" );
-      ++it;
-            
-      TEAGN_CHECK_EQUAL( it->first, 3 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;      
-    }     
-}
-
-void jointHistogram_integer_test()
-{
-    // Generating test rasters
-
-    TePDITypes::TePDIRasterPtrType raster1;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster1, 1, 2, 2, 
-      false, TeINTEGER, 0 ), "Unable to create raster" );
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 0, 1, 0 ), "error" )
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 1, 2, 0 ), "error" )
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 0, 1, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 1, 2, 0 ), "error" );
-    
-    TePDITypes::TePDIRasterPtrType raster2;
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster2, 1, 2, 2, 
-      false, TeINTEGER, 0 ), "Unable to create raster" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 0, 1, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 1, 3, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 0, 1, 0 ), "error" );
-    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 1, 3, 0 ), "error" );
-
-    // Generating joint histogram
-
-    TePDIJointHistogram hist;
-
-    TEAGN_TRUE_OR_THROW( hist.update( *raster1, 0, *raster2, 0,
-      TeBoxPixelIn, 0 ), "Unable to create histogram" );
-      
-    // Checking histogram
-    {
-      TEAGN_TRUE_OR_THROW( ( hist.size() == 2 ), "Invalid histogram size" );
-  
-      TePDIJointHistogram::const_iterator it = hist.begin();
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first.first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->first.second, 3 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-    }
-    // Checking raster 1 histogram
-    
-    {
-      const TePDIHistogram& r1hist = hist.getRaster1Hist();
-      TEAGN_TRUE_OR_THROW( ( r1hist.size() == 2 ), "Invalid histogram size" );
-  
-      TePDIHistogram::const_iterator it = r1hist.begin();
-  
-      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-  
-      TEAGN_CHECK_EQUAL( it->first, 2 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;      
-    }    
-    
-    // Checking raster 2 histogram
- 
-    {
-      const TePDIHistogram& r2hist = hist.getRaster2Hist();
-      TEAGN_TRUE_OR_THROW( ( r2hist.size() == 2 ), "Invalid histogram size" );
-  
-      TePDIHistogram::const_iterator it = r2hist.begin();
-  
-      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;
-            
-      TEAGN_CHECK_EQUAL( it->first, 3 , "" );
-      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
-      ++it;      
-    }     
-}
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{ 
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) ); 
-    
-    jointHistogram_8bits_images_test();
-    jointHistogram_8bits_test();
-    jointHistogram_float_test();
-    jointHistogram_integer_test();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIJointHistogram.hpp>
+#include <TePDIHistogram.hpp>
+
+#include <TePDIUtils.hpp>
+
+#include <TeAgnostic.h>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+void jointHistogram_8bits_test()
+{
+    // Generating test rasters
+
+    TePDITypes::TePDIRasterPtrType raster1;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster1, 1, 2, 2, 
+      false, TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 0, 1, 0 ), "error" )
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 1, 2, 0 ), "error" )
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 0, 1, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 1, 2, 0 ), "error" );
+    
+    TePDITypes::TePDIRasterPtrType raster2;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster2, 1, 2, 2, 
+      false, TeUNSIGNEDCHAR, 0 ), "Unable to create raster" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 0, 1, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 1, 3, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 0, 1, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 1, 3, 0 ), "error" );
+
+    // Generating joint histogram
+
+    TePDIJointHistogram hist;
+
+    TEAGN_TRUE_OR_THROW( hist.update( *raster1, 0, *raster2, 0,
+      TeBoxPixelIn, 0 ), "Unable to create histogram" );
+      
+    TEAGN_WATCH( hist.toString() );
+      
+    // Checking histogram
+    {
+      TEAGN_TRUE_OR_THROW( ( hist.size() == 2 ), "Invalid histogram size" );
+      
+      TEAGN_TRUE_OR_THROW( ( hist.getFreqSum() == 4 ), 
+        "Invalid histogram" );
+  
+      TePDIJointHistogram::const_iterator it = hist.begin();
+  
+      TEAGN_CHECK_EQUAL( it->first.first, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->first.second, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+  
+      TEAGN_CHECK_EQUAL( it->first.first, 2 , "" );
+      TEAGN_CHECK_EQUAL( it->first.second, 3 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+    }
+    // Checking raster 1 histogram
+    
+    {
+      const TePDIHistogram& r1hist = hist.getRaster1Hist();
+      TEAGN_TRUE_OR_THROW( ( r1hist.size() == 2 ), "Invalid histogram size" );
+  
+      TePDIHistogram::const_iterator it = r1hist.begin();
+  
+      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+  
+      TEAGN_CHECK_EQUAL( it->first, 2 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;      
+    }    
+    
+    // Checking raster 2 histogram
+ 
+    {
+      const TePDIHistogram& r2hist = hist.getRaster2Hist();
+      TEAGN_TRUE_OR_THROW( ( r2hist.size() == 2 ), "Invalid histogram size" );
+  
+      TePDIHistogram::const_iterator it = r2hist.begin();
+  
+      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+            
+      TEAGN_CHECK_EQUAL( it->first, 3 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;      
+    }     
+}
+
+void jointHistogram_8bits_images_test()
+{
+  // Initializing raster instances
+  
+  TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
+    'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster1->init(), "Unable to init inRaster" );
+
+  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
+    'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster" );
+
+  // Generating joint histogram
+
+  TePDIJointHistogram jhist;
+
+  TEAGN_TRUE_OR_THROW( jhist.update( *inRaster1, 0, *inRaster2, 1,
+    TeBoxPixelIn, 0 ), "Unable to create histogram" );  
+    
+  TEAGN_CHECK_EPS( jhist.getFreqSum(), ( inRaster1->params().nlines_ *
+    inRaster1->params().ncols_ ), 0, "Invalid histogram" );    
+  
+  // Generating single histograms (just for comparison)
+  
+  TePDIHistogram hist1;
+  TEAGN_TRUE_OR_THROW( hist1.reset( inRaster1, 0, 0, TeBoxPixelIn ),
+    "Unable to create histogram" );
+
+  TePDIHistogram hist2;
+  TEAGN_TRUE_OR_THROW( hist2.reset( inRaster2, 1, 0, TeBoxPixelIn ),
+    "Unable to create histogram" );
+    
+  // Comparing single histograms with that ones created by the joint histogram.
+  
+  const TePDIHistogram& hist1b = jhist.getRaster1Hist();
+  const TePDIHistogram& hist2b = jhist.getRaster2Hist();
+  
+  TEAGN_TRUE_OR_THROW( hist1 == hist1b, "Histogram mismatch" )
+  TEAGN_TRUE_OR_THROW( hist2 == hist2b, "Histogram mismatch" )
+}
+
+void jointHistogram_float_test()
+{
+    // Generating test rasters
+
+    TePDITypes::TePDIRasterPtrType raster1;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster1, 1, 2, 2, 
+      false, TeDOUBLE, 0 ), "Unable to create raster" );
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 0, 1, 0 ), "error" )
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 1, 2, 0 ), "error" )
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 0, 1, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 1, 2, 0 ), "error" );
+    
+    TePDITypes::TePDIRasterPtrType raster2;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster2, 1, 2, 2, 
+      false, TeDOUBLE, 0 ), "Unable to create raster" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 0, 1, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 1, 3, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 0, 1, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 1, 3, 0 ), "error" );
+
+    // Generating joint histogram
+
+    TePDIJointHistogram hist;
+
+    TEAGN_TRUE_OR_THROW( hist.update( *raster1, 0, *raster2, 0,
+      TeBoxPixelIn, 3 ), "Unable to create histogram" );
+      
+    TEAGN_WATCH( hist.toString() );
+      
+    // Checking histogram
+    {
+      TEAGN_TRUE_OR_THROW( ( hist.size() == 2 ), "Invalid histogram size" );
+    
+      TEAGN_TRUE_OR_THROW( ( hist.getFreqSum() == 4 ), "Invalid histogram" );          
+  
+      TePDIJointHistogram::const_iterator it = hist.begin();
+  
+      TEAGN_CHECK_EQUAL( it->first.first, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->first.second, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+  
+      TEAGN_CHECK_EQUAL( it->first.first, 2 , "" );
+      TEAGN_CHECK_EQUAL( it->first.second, 3 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+    }
+    // Checking raster 1 histogram
+    
+    {
+      const TePDIHistogram& r1hist = hist.getRaster1Hist();
+      TEAGN_TRUE_OR_THROW( ( r1hist.size() == 2 ), "Invalid histogram size" );
+  
+      TePDIHistogram::const_iterator it = r1hist.begin();
+  
+      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+  
+      TEAGN_CHECK_EQUAL( it->first, 2 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;      
+    }    
+    
+    // Checking raster 2 histogram
+ 
+    {
+      const TePDIHistogram& r2hist = hist.getRaster2Hist();
+      TEAGN_TRUE_OR_THROW( ( r2hist.size() == 2 ), "Invalid histogram size" );
+  
+      TePDIHistogram::const_iterator it = r2hist.begin();
+  
+      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+            
+      TEAGN_CHECK_EQUAL( it->first, 3 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;      
+    }     
+}
+
+void jointHistogram_integer_test()
+{
+    // Generating test rasters
+
+    TePDITypes::TePDIRasterPtrType raster1;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster1, 1, 2, 2, 
+      false, TeINTEGER, 0 ), "Unable to create raster" );
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 0, 1, 0 ), "error" )
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 0, 1, 2, 0 ), "error" )
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 0, 1, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster1->setElement( 1, 1, 2, 0 ), "error" );
+    
+    TePDITypes::TePDIRasterPtrType raster2;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( raster2, 1, 2, 2, 
+      false, TeINTEGER, 0 ), "Unable to create raster" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 0, 1, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 0, 1, 3, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 0, 1, 0 ), "error" );
+    TEAGN_TRUE_OR_THROW( raster2->setElement( 1, 1, 3, 0 ), "error" );
+
+    // Generating joint histogram
+
+    TePDIJointHistogram hist;
+
+    TEAGN_TRUE_OR_THROW( hist.update( *raster1, 0, *raster2, 0,
+      TeBoxPixelIn, 0 ), "Unable to create histogram" );
+      
+    // Checking histogram
+    {
+      TEAGN_TRUE_OR_THROW( ( hist.size() == 2 ), "Invalid histogram size" );
+    
+      TEAGN_TRUE_OR_THROW( ( hist.getFreqSum() == 4 ), "Invalid histogram" );          
+  
+      TePDIJointHistogram::const_iterator it = hist.begin();
+  
+      TEAGN_CHECK_EQUAL( it->first.first, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->first.second, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+  
+      TEAGN_CHECK_EQUAL( it->first.first, 2 , "" );
+      TEAGN_CHECK_EQUAL( it->first.second, 3 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+    }
+    // Checking raster 1 histogram
+    
+    {
+      const TePDIHistogram& r1hist = hist.getRaster1Hist();
+      TEAGN_TRUE_OR_THROW( ( r1hist.size() == 2 ), "Invalid histogram size" );
+  
+      TePDIHistogram::const_iterator it = r1hist.begin();
+  
+      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+  
+      TEAGN_CHECK_EQUAL( it->first, 2 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;      
+    }    
+    
+    // Checking raster 2 histogram
+ 
+    {
+      const TePDIHistogram& r2hist = hist.getRaster2Hist();
+      TEAGN_TRUE_OR_THROW( ( r2hist.size() == 2 ), "Invalid histogram size" );
+  
+      TePDIHistogram::const_iterator it = r2hist.begin();
+  
+      TEAGN_CHECK_EQUAL( it->first, 1 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;
+            
+      TEAGN_CHECK_EQUAL( it->first, 3 , "" );
+      TEAGN_CHECK_EQUAL( it->second, 2 , "" );
+      ++it;      
+    }     
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{ 
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) ); 
+    
+    jointHistogram_8bits_images_test();
+    jointHistogram_8bits_test();
+    jointHistogram_float_test();
+    jointHistogram_integer_test();
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram_test.vcproj b/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram_test.vcproj
old mode 100755
new mode 100644
index f2ad72d..e0580ae
--- a/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram_test.vcproj
+++ b/examples/image_processing/source/TePDIJointHistogram/TePDIJointHistogram_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIJointHistogram_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIJointHistogram_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIJointHistogram_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/tiff;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIJointHistogram_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIJointHistogram_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIJointHistogram_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIJointHistogram_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIJointHistogram_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/tiff;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIJointHistogram_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIJointHistogram_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDILinearFilter/.cvsignore b/examples/image_processing/source/TePDILinearFilter/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDILinearFilter/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter.pro b/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter.pro
old mode 100755
new mode 100644
index 368c914..912716b
--- a/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter.pro
+++ b/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter.pro
@@ -1,8 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDILinearFilter_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/TePDILinearFilter*
-
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDILinearFilter_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/TePDILinearFilter*
+
diff --git a/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter_test.cpp b/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter_test.cpp
old mode 100755
new mode 100644
index 35c34f3..a546e3e
--- a/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter_test.cpp
+++ b/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter_test.cpp
@@ -1,222 +1,222 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDILinearFilter.hpp>
-#include <TePDIFilterMask.hpp>
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeDecoderTIFF.h>
-
-
-void DummyMask_RGB_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-  
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );  
-  
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  channels.push_back( 1 );
-  channels.push_back( 2 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_Dummy() );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  TePDILinearFilter filter;  
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDILinearFilter_DummyMask_RGB.tif" ), 
-    "GeoTIF generation error" );  
-    
-}
-
-
-void Avg3x3_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_Avg3x3() );
-
-  params.SetParameter( "iterations", (int)3 );
-
-  TePDILinearFilter filter;  
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDILinearFilter_Avg3x3_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Avg7x7_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_Avg7x7() );
-
-  params.SetParameter( "iterations", (int)2 );
-
-  TePDILinearFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDILinearFilter_Avg7x7_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void NDHigh_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_NDHigh() );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  params.SetParameter( "level_offset", (double)20 );
-
-  TePDILinearFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDILinearFilter_NDHigh_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void S_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_S() );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  TePDILinearFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "TePDILinearFilter_S_test.tif" ), "GeoTIF generation error" );
-}
-
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeInitRasterDecoders();
-    
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-
-    DummyMask_RGB_test();
-    Avg3x3_test();
-    Avg7x7_test();
-    NDHigh_test();
-    S_test();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDILinearFilter.hpp>
+#include <TePDIFilterMask.hpp>
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+
+#include <TeInitRasterDecoders.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeDecoderTIFF.h>
+
+
+void DummyMask_RGB_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+  
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );  
+  
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_Dummy() );
+
+  params.SetParameter( "iterations", (int)1 );
+
+  TePDILinearFilter filter;  
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDILinearFilter_DummyMask_RGB.tif" ), 
+    "GeoTIF generation error" );  
+    
+}
+
+
+void Avg3x3_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_Avg3x3() );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  TePDILinearFilter filter;  
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDILinearFilter_Avg3x3_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Avg7x7_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_Avg7x7() );
+
+  params.SetParameter( "iterations", (int)2 );
+
+  TePDILinearFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDILinearFilter_Avg7x7_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void NDHigh_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_NDHigh() );
+
+  params.SetParameter( "iterations", (int)1 );
+
+  params.SetParameter( "level_offset", (double)20 );
+
+  TePDILinearFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDILinearFilter_NDHigh_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void S_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_S() );
+
+  params.SetParameter( "iterations", (int)1 );
+
+  TePDILinearFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "TePDILinearFilter_S_test.tif" ), "GeoTIF generation error" );
+}
+
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeInitRasterDecoders();
+    
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+
+    DummyMask_RGB_test();
+    Avg3x3_test();
+    Avg7x7_test();
+    NDHigh_test();
+    S_test();
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter_test.vcproj b/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter_test.vcproj
old mode 100755
new mode 100644
index 4e86498..dbf983f
--- a/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter_test.vcproj
+++ b/examples/image_processing/source/TePDILinearFilter/TePDILinearFilter_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDILinearFilter_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDILinearFilter_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDILinearFilter_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/tiff;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDILinearFilter_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDILinearFilter_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDILinearFilter_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDILinearFilter_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDILinearFilter_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/tiff;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDILinearFilter_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDILinearFilter_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIMIMatching/.cvsignore b/examples/image_processing/source/TePDIMIMatching/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIMIMatching/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching.pro b/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching.pro
index c58faf4..83cb287 100644
--- a/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching.pro
+++ b/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIMIMatching_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/TePDIMIMatching*.tif
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIMIMatching_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/TePDIMIMatching*.tif
diff --git a/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching_test.cpp b/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching_test.cpp
index 302013c..fe52b60 100644
--- a/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching_test.cpp
+++ b/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching_test.cpp
@@ -1,743 +1,743 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIMIMatching.hpp>
-#include <TePDIUtils.hpp>
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeAgnostic.h>
-
-#include <math.h>
-
-
-void raster2Tiff( 
-  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-  unsigned int raster_channel,
-  const std::string& out_file_name,
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr,
-  unsigned int tie_points_space )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
-    "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
-    "Invalid matrix cols" )
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
-    input_raster_ptr->params().ncols_ );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  double value = 0;
-  
-  for( int line = 0 ; 
-    line < input_raster_ptr->params().nlines_ ; ++line ) {
-    for( int col = 0 ; 
-      col < input_raster_ptr->params().ncols_ ; 
-      ++col ) {
-      
-      input_raster_ptr->getElement( col, line, value, 
-        raster_channel );
-      
-
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        value, 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw tie-points */
-  
-  if( out_tie_points_ptr.isActive() ) {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      int x = 0;
-      int y = 0;
-      
-      if( tie_points_space == 0 ) {
-         x = TeRound( it->pt1.x() );
-         y = TeRound( it->pt1.y() );
-      } else {
-         x = TeRound( it->pt2.x() );
-         y = TeRound( it->pt2.y() );
-      }
-      
-      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
-        "Invalid maxima column" )
-      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-        "Invalid maxima column" )      
-      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
-        "Invalid maxima line" )
-      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-        "Invalid maxima line" )      
-      
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-        255.0, 0 ),
-        "Error writing raster" )    
-    
-      ++it;
-    }
-  
-  }
-}
-
-void sameImageTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box1( TeCoord2D( 142, 826 ) , 
-    TeCoord2D( 542, 426 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 238, 689 ) , 
-    TeCoord2D( 391, 473 ) );
-  params.SetParameter( "input_box2" , input_box2 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  TePDIMIMatching match_instance; 
-  match_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_sameImageTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_sameImageTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-/* inverted boxes test */
-void sameImageTest2()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box2( TeCoord2D( 142, 826 ) , 
-    TeCoord2D( 542, 426 ) );
-  params.SetParameter( "input_box2" , input_box2 );
-  
-  TeBox input_box1( TeCoord2D( 238, 689 ) , 
-    TeCoord2D( 391, 473 ) );
-  params.SetParameter( "input_box1" , input_box1 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  TePDIMIMatching match_instance; 
-  match_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_sameImageTest2_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_sameImageTest2_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-
-void halfsampledImageTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box1( TeCoord2D( 198, 486 ) , 
-    TeCoord2D( 577, 186 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 143, 180 ) , 
-    TeCoord2D( 227, 113 ) );
-  params.SetParameter( "input_box2" , input_box2 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
-  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
-  
-  TePDIMIMatching match_instance; 
-  match_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_halfsampledImageTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_halfsampledImageTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-
-void halfsampledImageTest2()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box2( TeCoord2D( 198, 486 ) , 
-    TeCoord2D( 577, 186 ) );
-  params.SetParameter( "input_box2" , input_box2 );
-  
-  TeBox input_box1( TeCoord2D( 143, 180 ) , 
-    TeCoord2D( 227, 113 ) );
-  params.SetParameter( "input_box1" , input_box1 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)2 ); 
-  params.SetParameter( "pixel_y_relation" , (double)2 ); 
-  
-  TePDIMIMatching match_instance; 
-  match_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_halfsampledImageTest2_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_halfsampledImageTest2_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-void sameImageGreenXRedTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)1 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box1( TeCoord2D( 142, 826 ) , 
-    TeCoord2D( 542, 426 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 238, 689 ) , 
-    TeCoord2D( 391, 473 ) );
-  params.SetParameter( "input_box2" , input_box2 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  TePDIMIMatching match_instance; 
-  match_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_sameImageGreenXRedTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 1, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_sameImageGreenXRedTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-void sameImageGreenXBlueTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)1 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)2 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box1( TeCoord2D( 142, 826 ) , 
-    TeCoord2D( 542, 426 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 238, 689 ) , 
-    TeCoord2D( 391, 473 ) );
-  params.SetParameter( "input_box2" , input_box2 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  TePDIMIMatching match_instance; 
-  match_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 1, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_sameImageGreenXBlueTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 2, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_sameImageGreenXBlueTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-void sameInvertedImageTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  {
-    TePDITypes::TePDIRasterPtrType di2_ptr( new TeRaster(
-      std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-    TEAGN_TRUE_OR_THROW( di2_ptr->init(), 
-      "Unable to init input_image2_ptr" ); 
-      
-    TeRasterParams input_image2_pars = di2_ptr->params();
-    input_image2_pars.nBands( 1 );
-    
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_image2_ptr,
-      input_image2_pars, false ), "Raster alloc error" )
-      
-    double value = 0;
-    for( int lin = 0 ; lin < input_image2_pars.nlines_ ; ++lin )
-      for( int col = 0 ; col < input_image2_pars.ncols_ ; ++col )
-      {
-        di2_ptr->getElement( col, lin, value, 0 );
-        input_image2_ptr->setElement( col, lin, 255.0 - value, 0 );
-      }
-  }
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeBox input_box1( TeCoord2D( 142, 826 ) , 
-    TeCoord2D( 542, 426 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 238, 689 ) , 
-    TeCoord2D( 391, 473 ) );
-  params.SetParameter( "input_box2" , input_box2 );  
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  TePDIMIMatching match_instance; 
-  match_instance.ToggleProgInt( true );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_sameInvertedImageTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TeMIMatching_test_sameInvertedImageTest_input_image2.tif",
-    out_tie_points_ptr, 0 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-    
-    time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-    sameImageTest();
-    sameImageTest2();
-    halfsampledImageTest();
-    halfsampledImageTest2();
-    sameImageGreenXRedTest();
-    sameImageGreenXBlueTest();
-    sameInvertedImageTest();
-    
-    time_t end_time = clock() / CLOCKS_PER_SEC;
-    
-    TEAGN_LOGMSG( "Total elapsed time: " + 
-      TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-      " seconds" );    
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }  
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIMIMatching.hpp>
+#include <TePDIUtils.hpp>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeAgnostic.h>
+
+#include <math.h>
+
+
+void raster2Tiff( 
+  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+  unsigned int raster_channel,
+  const std::string& out_file_name,
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr,
+  unsigned int tie_points_space )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
+    "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
+    "Invalid matrix cols" )
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
+    input_raster_ptr->params().ncols_ );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  double value = 0;
+  
+  for( int line = 0 ; 
+    line < input_raster_ptr->params().nlines_ ; ++line ) {
+    for( int col = 0 ; 
+      col < input_raster_ptr->params().ncols_ ; 
+      ++col ) {
+      
+      input_raster_ptr->getElement( col, line, value, 
+        raster_channel );
+      
+
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        value, 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw tie-points */
+  
+  if( out_tie_points_ptr.isActive() ) {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      int x = 0;
+      int y = 0;
+      
+      if( tie_points_space == 0 ) {
+         x = TeRound( it->pt1.x() );
+         y = TeRound( it->pt1.y() );
+      } else {
+         x = TeRound( it->pt2.x() );
+         y = TeRound( it->pt2.y() );
+      }
+      
+      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
+        "Invalid maxima column" )
+      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+        "Invalid maxima column" )      
+      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
+        "Invalid maxima line" )
+      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+        "Invalid maxima line" )      
+      
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+        255.0, 0 ),
+        "Error writing raster" )    
+    
+      ++it;
+    }
+  
+  }
+}
+
+void sameImageTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box1( TeCoord2D( 142, 826 ) , 
+    TeCoord2D( 542, 426 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 238, 689 ) , 
+    TeCoord2D( 391, 473 ) );
+  params.SetParameter( "input_box2" , input_box2 );  
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  TePDIMIMatching match_instance; 
+  match_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_sameImageTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_sameImageTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+/* inverted boxes test */
+void sameImageTest2()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box2( TeCoord2D( 142, 826 ) , 
+    TeCoord2D( 542, 426 ) );
+  params.SetParameter( "input_box2" , input_box2 );
+  
+  TeBox input_box1( TeCoord2D( 238, 689 ) , 
+    TeCoord2D( 391, 473 ) );
+  params.SetParameter( "input_box1" , input_box1 );  
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  TePDIMIMatching match_instance; 
+  match_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_sameImageTest2_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_sameImageTest2_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+
+void halfsampledImageTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box1( TeCoord2D( 198, 486 ) , 
+    TeCoord2D( 577, 186 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 143, 180 ) , 
+    TeCoord2D( 227, 113 ) );
+  params.SetParameter( "input_box2" , input_box2 );  
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
+  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
+  
+  TePDIMIMatching match_instance; 
+  match_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_halfsampledImageTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_halfsampledImageTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+
+void halfsampledImageTest2()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box2( TeCoord2D( 198, 486 ) , 
+    TeCoord2D( 577, 186 ) );
+  params.SetParameter( "input_box2" , input_box2 );
+  
+  TeBox input_box1( TeCoord2D( 143, 180 ) , 
+    TeCoord2D( 227, 113 ) );
+  params.SetParameter( "input_box1" , input_box1 );  
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  params.SetParameter( "pixel_x_relation" , (double)2 ); 
+  params.SetParameter( "pixel_y_relation" , (double)2 ); 
+  
+  TePDIMIMatching match_instance; 
+  match_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_halfsampledImageTest2_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_halfsampledImageTest2_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+void sameImageGreenXRedTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)1 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box1( TeCoord2D( 142, 826 ) , 
+    TeCoord2D( 542, 426 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 238, 689 ) , 
+    TeCoord2D( 391, 473 ) );
+  params.SetParameter( "input_box2" , input_box2 );  
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  TePDIMIMatching match_instance; 
+  match_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_sameImageGreenXRedTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 1, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_sameImageGreenXRedTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+void sameImageGreenXBlueTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)1 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)2 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box1( TeCoord2D( 142, 826 ) , 
+    TeCoord2D( 542, 426 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 238, 689 ) , 
+    TeCoord2D( 391, 473 ) );
+  params.SetParameter( "input_box2" , input_box2 );  
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  TePDIMIMatching match_instance; 
+  match_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 1, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_sameImageGreenXBlueTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 2, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_sameImageGreenXBlueTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+void sameInvertedImageTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  {
+    TePDITypes::TePDIRasterPtrType di2_ptr( new TeRaster(
+      std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+    TEAGN_TRUE_OR_THROW( di2_ptr->init(), 
+      "Unable to init input_image2_ptr" ); 
+      
+    TeRasterParams input_image2_pars = di2_ptr->params();
+    input_image2_pars.nBands( 1 );
+    
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_image2_ptr,
+      input_image2_pars, false ), "Raster alloc error" )
+      
+    double value = 0;
+    for( int lin = 0 ; lin < input_image2_pars.nlines_ ; ++lin )
+      for( int col = 0 ; col < input_image2_pars.ncols_ ; ++col )
+      {
+        di2_ptr->getElement( col, lin, value, 0 );
+        input_image2_ptr->setElement( col, lin, 255.0 - value, 0 );
+      }
+  }
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  TeBox input_box1( TeCoord2D( 142, 826 ) , 
+    TeCoord2D( 542, 426 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 238, 689 ) , 
+    TeCoord2D( 391, 473 ) );
+  params.SetParameter( "input_box2" , input_box2 );  
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  TePDIMIMatching match_instance; 
+  match_instance.ToggleProgInt( true );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_sameInvertedImageTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TeMIMatching_test_sameInvertedImageTest_input_image2.tif",
+    out_tie_points_ptr, 0 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 4, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+    
+    time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+    sameImageTest();
+    sameImageTest2();
+    halfsampledImageTest();
+    halfsampledImageTest2();
+    sameImageGreenXRedTest();
+    sameImageGreenXBlueTest();
+    sameInvertedImageTest();
+    
+    time_t end_time = clock() / CLOCKS_PER_SEC;
+    
+    TEAGN_LOGMSG( "Total elapsed time: " + 
+      TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+      " seconds" );    
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }  
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching_test.vcproj b/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching_test.vcproj
index acf86db..e057cb9 100644
--- a/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching_test.vcproj
+++ b/examples/image_processing/source/TePDIMIMatching/TePDIMIMatching_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIMIMatching_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIMIMatching_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIMIMatching_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".;../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIMIMatching_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIMIMatching_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIMIMatching_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIMIMatching_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIMIMatching_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIMIMatching_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIMIMatching_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIMMIOMatching/.cvsignore b/examples/image_processing/source/TePDIMMIOMatching/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIMMIOMatching/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching.pro b/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching.pro
index f9309a8..e093094 100644
--- a/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching.pro
+++ b/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIMMIOMatching_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/TePDIMMIOMatching*.tif
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIMMIOMatching_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/TePDIMMIOMatching*.tif
diff --git a/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching_test.cpp b/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching_test.cpp
index 3dd2566..d576d63 100644
--- a/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching_test.cpp
+++ b/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching_test.cpp
@@ -1,937 +1,1103 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIMMIOMatching.hpp>
-#include <TePDIUtils.hpp>
-
-#include <TeGTParams.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeAgnostic.h>
-#include <TeDefines.h>
-
-#include <math.h>
-
-#ifndef M_PI
-  #define M_PI       3.14159265358979323846
-#endif
-#ifndef M_PI_2
-  #define M_PI_2     1.57079632679489661923
-#endif
-#ifndef M_PI_4
-  #define M_PI_4     0.785398163397448309616
-#endif
-
-void raster2Tiff( 
-  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-  unsigned int raster_channel,
-  const std::string& out_file_name,
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr,
-  unsigned int tie_points_space )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
-    "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
-    "Invalid matrix cols" )
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
-    input_raster_ptr->params().ncols_ );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  double value = 0;
-  
-  for( int line = 0 ; 
-    line < input_raster_ptr->params().nlines_ ; ++line ) {
-    for( int col = 0 ; 
-      col < input_raster_ptr->params().ncols_ ; 
-      ++col ) {
-      
-      input_raster_ptr->getElement( col, line, value, 
-        raster_channel );
-      
-
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        MIN( 254.0, value ), 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw tie-points */
-  
-  if( out_tie_points_ptr.isActive() ) {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      int x = 0;
-      int y = 0;
-      
-      if( tie_points_space == 0 ) {
-         x = TeRound( it->pt1.x() );
-         y = TeRound( it->pt1.y() );
-      } else {
-         x = TeRound( it->pt2.x() );
-         y = TeRound( it->pt2.y() );
-      }
-      
-      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
-        "Invalid maxima column" )
-      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-        "Invalid maxima column" )      
-      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
-        "Invalid maxima line" )
-      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-        "Invalid maxima line" )      
-      
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-        255.0, 0 ),
-        "Error writing raster" )    
-    
-      ++it;
-    }
-  
-  }
-}
-
-
-void rotateRasterClockWize( 
-  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-  const TePDITypes::TePDIRasterPtrType& output_raster_ptr,
-  double angle )
-{
-  TEAGN_TRUE_OR_THROW( input_raster_ptr.isActive(),
-    "Invalid input pointer" );
-  TEAGN_TRUE_OR_THROW( output_raster_ptr.isActive(),
-    "Invalid output pointer" );    
-    
-  const double input_raster_lines = 
-    (double)input_raster_ptr->params().nlines_;
-  const double input_raster_cols = 
-    (double)input_raster_ptr->params().ncols_;
-  const unsigned int input_raster_channels =
-    (unsigned int)input_raster_ptr->nBands();
-    
-  const double last_x_idx = input_raster_cols - 1.0;
-  const double last_y_idx = input_raster_lines - 1.0;
-    
-  const double angle_cos = cos( angle );
-  const double angle_sin = sin( angle );
-  
-  /* Calc new image geometry */
-    
-  double min_x = MIN( 0.0, ( angle_cos * last_x_idx ) - 
-    ( angle_sin * last_y_idx ) );
-  min_x = MIN( min_x, ( angle_cos * last_x_idx ) );
-  min_x = MIN( min_x, ( -1.0 * angle_sin * last_y_idx ) );
-  
-  double max_x = MAX( 0.0, ( angle_cos * last_x_idx ) - 
-    ( angle_sin * last_y_idx ) );
-  max_x = MAX( max_x, ( angle_cos * last_x_idx ) );
-  max_x = MAX( max_x, ( -1.0 * angle_sin * last_y_idx ) );
-  
-  double min_y = MIN( 0.0, ( angle_sin * last_x_idx ) + 
-    ( angle_cos * last_y_idx ) );
-  min_y = MIN( min_y, ( angle_sin * last_x_idx ) );
-  min_y = MIN( min_y, ( angle_cos * last_y_idx ) );
-  
-  double max_y = MAX( 0.0, ( angle_sin * last_x_idx ) + 
-    ( angle_cos * last_y_idx ) );
-  max_y = MAX( max_y, ( angle_sin * last_x_idx ) );
-  max_y = MAX( max_y, ( angle_cos * last_y_idx ) );
-  
-  const unsigned int out_lines = (unsigned int) ceil(
-    max_y - min_y );
-  const unsigned int out_cols = (unsigned int) ceil(
-    max_x - min_x );
-    
-  /* reseting output raster */
-  
-  TeCoord2D ll_point_input_ref_indexed( min_x,
-    max_y );
-  TeCoord2D ur_point_input_ref_indexed( max_x,
-    min_y );
-    
-  TeCoord2D ll_point_input_ref = 
-    input_raster_ptr->index2Coord( ll_point_input_ref_indexed );
-  TeCoord2D ur_point_input_ref = 
-    input_raster_ptr->index2Coord( ur_point_input_ref_indexed );    
-  
-  TeRasterParams new_out_params = output_raster_ptr->params();
-  
-  new_out_params.boundingBoxLinesColumns(
-    ll_point_input_ref.x(), ll_point_input_ref.y(),
-    ur_point_input_ref.x(), ur_point_input_ref.y(),
-    out_lines, out_cols );
-    
-  TEAGN_TRUE_OR_THROW( output_raster_ptr->init( new_out_params ),
-    "Error reseting output raster" )
-  
-  /* remapping pixels */
-    
-  unsigned int curr_out_x = 0;
-  unsigned int curr_out_y = 0;
-  double value = 0;
-  unsigned int curr_in_x = 0;
-  unsigned int curr_in_y = 0;
-  unsigned int curr_channel = 0;
-  
-  for( curr_channel = 0 ; curr_channel < input_raster_channels ;
-    ++curr_channel ) {
-    for( curr_out_y = 0 ; curr_out_y < out_lines ; ++curr_out_y ) {
-      for( curr_out_x = 0 ; curr_out_x < out_cols ; ++curr_out_x ) {
-        curr_in_x = 
-          TeRound( 
-            ( angle_cos * ( curr_out_x + min_x ) ) + 
-            ( angle_sin * ( curr_out_y + min_y ) )
-          );
-        curr_in_y = 
-          TeRound( 
-            ( -1.0 * angle_sin * ( curr_out_x + min_x ) ) + 
-            ( angle_cos * ( curr_out_y + min_y ) )
-          );
-        
-        if( input_raster_ptr->getElement( curr_in_x, curr_in_y,
-          value, curr_channel ) ) {
-        
-          output_raster_ptr->setElement( curr_out_x, curr_out_y,
-            value, curr_channel );
-        } else {
-          output_raster_ptr->setElement( curr_out_x, curr_out_y,
-            0, curr_channel );        
-        }
-      }
-    }
-  }
-  
-  return;
-}
-
-
-void sameImageAndBoxesTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
-    input_image1_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
-    input_image2_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  params.SetParameter( "matching_method", 
-    TePDIMMIOMatching::NormCrossCorrMethod );
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 2.0;
-  gt_params.max_imap_error_ = 2.0;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1_proj = input_image1_ptr->params().box();
-  TeBox input_box1;
-  TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, 
-    input_image1_ptr, input_box1 );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  params.SetParameter( "input_box2" , input_box1 );
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-  
-  // We can skip the geometry filter for this case since the images
-  // are the same
-  params.SetParameter( "skip_geom_filter" , (int)1 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)1000 ); 
-  params.SetParameter( "corr_window_width" , (unsigned int)13 );
-  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
-  
-  TeGTParams::pointer out_gt_params_ptr( new TeGTParams );
-  params.SetParameter( "out_gt_params_ptr" , out_gt_params_ptr );
-  
-  params.SetParameter( "variance_min_thrs" , (double)1 ); 
-  
-  TePDIMMIOMatching match_instance; 
-
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC ;
-  
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageAndBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_sameImageAndBoxesTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_sameImageAndBoxesTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  /* Checking tie-points */
-  
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0, 
-        "Invalid tie-point" )
-      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0, 
-        "Invalid tie-point" )
-      
-      ++it;
-    }
-  }
-      
-  TEAGN_CHECK_EPS( 775, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-
-void sameImageDifBoxesTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
-    input_image1_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
-    input_image2_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );    
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  params.SetParameter( "matching_method", TePDIMMIOMatching::NormCrossCorrMethod );
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 0.5;
-  gt_params.max_imap_error_ = 0.5;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1( TeCoord2D( 0, 760 ) , TeCoord2D( 680, 0 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( 
-    TeCoord2D( 190, input_image1_ptr->params().nlines_ - 1 ) , 
-    TeCoord2D( input_image1_ptr->params().ncols_ - 1, 227 ) );
-  params.SetParameter( "input_box2" , input_box2 );   
-  
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)1000 ); 
-  params.SetParameter( "corr_window_width" , (unsigned int)13 );
-  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
-  
-  params.SetParameter( "variance_min_thrs" , (double)1 );
-  
-  TePDIMMIOMatching match_instance; 
-
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_sameImageDifBoxesTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_sameImageDifBoxesTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  /* Checking tie-points */
-  
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0, 
-        "Invalid tie-point" )
-      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0, 
-        "Invalid tie-point" )
-      
-      ++it;
-    }
-  }
-      
-  TEAGN_CHECK_EPS( 158, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-
-void halfsampledImageTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 
-    input_image1_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
-    input_image2_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );    
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  params.SetParameter( "matching_method", TePDIMMIOMatching::NormCrossCorrMethod );
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 2.0;
-  gt_params.max_imap_error_ = 2.0;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1( TeCoord2D( 122.0, 698.0 ), 
-    TeCoord2D( 730.0, 138.0 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 110.0, 305.0 ), 
-    TeCoord2D( 385.0, 50.0 ) );
-  params.SetParameter( "input_box2" , input_box2 );   
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  params.SetParameter( "corr_window_width" , (unsigned int)13 );
-  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
-  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)1000 ); 
-  
-  params.SetParameter( "variance_min_thrs" , (double)1 ); 
-  
-  TePDIMMIOMatching match_instance; 
-
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (halfsampledImageTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  
-  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-  
-  while( it != it_end ) {
-    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-      Te2String( it->pt1.y(),1 ) + "] -> [" +
-      Te2String( it->pt2.x(),1 ) + " , " + 
-      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-    
-    ++it;
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_halfsampledImageTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_halfsampledImageTest_input_image2.tif",
-    out_tie_points_ptr, 1 );  
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 44, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )         
-}
-
-
-void halfsampledImageTest2()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
-    input_image1_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 
-    input_image2_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );   
-   
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  params.SetParameter( "matching_method", TePDIMMIOMatching::NormCrossCorrMethod );
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 2.0;
-  gt_params.max_imap_error_ = 2.0;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1( TeCoord2D( 110.0, 305.0 ), 
-    TeCoord2D( 385.0, 50.0 ) );    
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 122.0, 698.0 ), 
-    TeCoord2D( 730.0, 138.0 ) );    
-  params.SetParameter( "input_box2" , input_box2 );   
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)2 ); 
-  params.SetParameter( "pixel_y_relation" , (double)2 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)1000 );
-  params.SetParameter( "corr_window_width" , (unsigned int)13 );
-  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
-  
-  params.SetParameter( "variance_min_thrs" , (double)1 );
-  
-  TePDIMMIOMatching match_instance; 
-
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (halfsampledImageTest2): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  
-  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-  
-  while( it != it_end ) {
-    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-      Te2String( it->pt1.y(),1 ) + "] -> [" +
-      Te2String( it->pt2.x(),1 ) + " , " + 
-      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-    
-    ++it;
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_halfsampledImageTest2_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_halfsampledImageTest2_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 44, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )     
-}
-
-
-void halfsampledRotadedImageTest()
-{
-  /* Open image 1 */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 
-    input_image1_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-  
-  /* Creating the half-sampled-rotated image 2 */
-    
-  TePDITypes::TePDIRasterPtrType input_disk_image2_ptr( new TeRaster(
-    std::string( 
-    TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
-    'r' ) );
-  TEAGN_TRUE_OR_THROW( input_disk_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" );
-      
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image2_ptr, input_disk_image2_ptr->params(), 
-    TePDIUtils::TePDIUtilsAutoMemPol ),
-    "Error allocating raster memory" );
-    
-  rotateRasterClockWize( input_disk_image2_ptr, input_image2_ptr, M_PI_4 );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( input_image2_ptr, 
-    TEPDIEXAMPLESBINPATH "TePDIMMIOMatching_test_rotatedimage.tif", 
-    TeUNSIGNEDCHAR ),
-    "Error saving rotated image" );
-      
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  /* Set the other parameters */
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  params.SetParameter( "matching_method", 
-    TePDIMMIOMatching::NormCrossCorrMethod );
-  
-  TeBox input_box1( TeCoord2D( 122.0, 698.0 ), 
-    TeCoord2D( 730.0, 138.0 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 173.0, 447.0 ), 
-    TeCoord2D( 434.0, 153.0 ) );
-  params.SetParameter( "input_box2" , input_box2 );   
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  params.SetParameter( "corr_window_width" , (unsigned int)13 );
-  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
-  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
-  
-  params.SetParameter( "variance_min_thrs" , (double)1 );
-  
-  TePDIMMIOMatching match_instance; 
-
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (halfsampledRotadedImageTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  
-  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-  
-  while( it != it_end ) {
-    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-      Te2String( it->pt1.y(),1 ) + "] -> [" +
-      Te2String( it->pt2.x(),1 ) + " , " + 
-      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-    
-    ++it;
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_halfsampledRotadedImageTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_halfsampledRotadedImageTest_input_image2.tif",
-    out_tie_points_ptr, 1 );   
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 31, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )
-}
-
-void internalCacheTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
-    input_image1_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
-    input_image2_ptr, true ), "Error loading raster" );
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-
-  params.SetParameter( "matching_method", 
-    TePDIMMIOMatching::NormCrossCorrMethod );
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 2.0;
-  gt_params.max_imap_error_ = 2.0;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1_proj = input_image1_ptr->params().box();
-  TeBox input_box1;
-  TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, 
-    input_image1_ptr, input_box1 );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  params.SetParameter( "input_box2" , input_box1 );
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)1000 ); 
-  params.SetParameter( "corr_window_width" , (unsigned int)13 );
-  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
-  
-  TeGTParams::pointer out_gt_params_ptr( new TeGTParams );
-  params.SetParameter( "out_gt_params_ptr" , out_gt_params_ptr );
-  
-  params.SetParameter( "variance_min_thrs" , (double)1 ); 
-  
-  TePDIMMIOMatching match_instance; 
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr ); 
-  TEAGN_TRUE_OR_THROW( match_instance.Apply( params ),
-    "Algorithm apply error" )     
-       
-  TEAGN_LOGMSG( "Algorithm started" )
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points2_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points2_ptr ); 
-  TEAGN_TRUE_OR_THROW( match_instance.Apply( params ),
-    "Algorithm apply error" )   
-
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_internalCacheTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIMMIOMatching_test_internalCacheTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  /* Checking tie-points */
-  
-  {
-    TEAGN_TRUE_OR_THROW( out_tie_points_ptr->size() ==
-      out_tie_points2_ptr->size(), "Size mismatch" );
-    
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    TeCoordPairVect::iterator it2 = out_tie_points2_ptr->begin();
-    TeCoordPairVect::iterator it2_end = out_tie_points2_ptr->end();    
-    
-    while( it != it_end ) {
-      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0, 
-        "Invalid tie-point" )
-      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0, 
-        "Invalid tie-point" )
-          
-      TEAGN_CHECK_EPS( it->pt1.x(), it2->pt1.x(), 0, 
-        "Invalid tie-point" )          
-      TEAGN_CHECK_EPS( it->pt1.y(), it2->pt1.y(), 0, 
-        "Invalid tie-point" )          
-      TEAGN_CHECK_EPS( it->pt2.x(), it2->pt2.x(), 0, 
-        "Invalid tie-point" )          
-      TEAGN_CHECK_EPS( it->pt2.y(), it2->pt2.y(), 0, 
-        "Invalid tie-point" )          
-      
-      ++it2;
-      ++it;
-    }
-  }
-      
-  TEAGN_CHECK_EPS( 775, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-    
-    time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-    sameImageAndBoxesTest();
-    sameImageDifBoxesTest();
-    halfsampledImageTest();
-    halfsampledImageTest2();
-    halfsampledRotadedImageTest();
-    internalCacheTest();
-    
-    time_t end_time = clock() / CLOCKS_PER_SEC;
-    
-    TEAGN_LOGMSG( "Total elapsed time: " + 
-      TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-      " seconds" );    
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }  
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIMMIOMatching.hpp>
+#include <TePDIUtils.hpp>
+
+#include <TeGTParams.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeAgnostic.h>
+#include <TeDefines.h>
+
+#include <math.h>
+
+#ifndef M_PI
+  #define M_PI       3.14159265358979323846
+#endif
+#ifndef M_PI_2
+  #define M_PI_2     1.57079632679489661923
+#endif
+#ifndef M_PI_4
+  #define M_PI_4     0.785398163397448309616
+#endif
+
+void raster2Tiff( 
+  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+  unsigned int raster_channel,
+  const std::string& out_file_name,
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr,
+  unsigned int tie_points_space )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
+    "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
+    "Invalid matrix cols" )
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
+    input_raster_ptr->params().ncols_ );
+  params.nBands( 3 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.setPhotometric( TeRasterParams::TeRGB );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  double value = 0;
+  
+  for( int line = 0 ; 
+    line < input_raster_ptr->params().nlines_ ; ++line ) {
+    for( int col = 0 ; 
+      col < input_raster_ptr->params().ncols_ ; 
+      ++col ) {
+      
+      input_raster_ptr->getElement( col, line, value, 
+        raster_channel );
+        
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        MIN( 254.0, value ), 0 ),
+        "Error writing raster" )
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        MIN( 254.0, value ), 1 ),
+        "Error writing raster" )
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        MIN( 254.0, value ), 2 ),
+        "Error writing raster" )                
+    }  
+  }
+  
+  /* Draw tie-points */
+  
+  if( out_tie_points_ptr.isActive() ) {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      int x = 0;
+      int y = 0;
+      
+      if( tie_points_space == 0 ) {
+         x = TeRound( it->pt1.x() );
+         y = TeRound( it->pt1.y() );
+      } else {
+         x = TeRound( it->pt2.x() );
+         y = TeRound( it->pt2.y() );
+      }
+      
+      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
+        "Invalid maxima column" )
+      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+        "Invalid maxima column" )      
+      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
+        "Invalid maxima line" )
+      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+        "Invalid maxima line" )      
+      
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+        0, 0 ),
+        "Error writing raster" )    
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+        255, 1 ),
+        "Error writing raster" ) 
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+        0, 2 ),
+        "Error writing raster" ) 
+                    
+      ++it;
+    }
+  
+  }
+}
+
+
+void rotateRasterClockWize( 
+  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+  const TePDITypes::TePDIRasterPtrType& output_raster_ptr,
+  double angle )
+{
+  TEAGN_TRUE_OR_THROW( input_raster_ptr.isActive(),
+    "Invalid input pointer" );
+  TEAGN_TRUE_OR_THROW( output_raster_ptr.isActive(),
+    "Invalid output pointer" );    
+    
+  const double input_raster_lines = 
+    (double)input_raster_ptr->params().nlines_;
+  const double input_raster_cols = 
+    (double)input_raster_ptr->params().ncols_;
+  const unsigned int input_raster_channels =
+    (unsigned int)input_raster_ptr->nBands();
+    
+  const double last_x_idx = input_raster_cols - 1.0;
+  const double last_y_idx = input_raster_lines - 1.0;
+    
+  const double angle_cos = cos( angle );
+  const double angle_sin = sin( angle );
+  
+  /* Calc new image geometry */
+    
+  double min_x = MIN( 0.0, ( angle_cos * last_x_idx ) - 
+    ( angle_sin * last_y_idx ) );
+  min_x = MIN( min_x, ( angle_cos * last_x_idx ) );
+  min_x = MIN( min_x, ( -1.0 * angle_sin * last_y_idx ) );
+  
+  double max_x = MAX( 0.0, ( angle_cos * last_x_idx ) - 
+    ( angle_sin * last_y_idx ) );
+  max_x = MAX( max_x, ( angle_cos * last_x_idx ) );
+  max_x = MAX( max_x, ( -1.0 * angle_sin * last_y_idx ) );
+  
+  double min_y = MIN( 0.0, ( angle_sin * last_x_idx ) + 
+    ( angle_cos * last_y_idx ) );
+  min_y = MIN( min_y, ( angle_sin * last_x_idx ) );
+  min_y = MIN( min_y, ( angle_cos * last_y_idx ) );
+  
+  double max_y = MAX( 0.0, ( angle_sin * last_x_idx ) + 
+    ( angle_cos * last_y_idx ) );
+  max_y = MAX( max_y, ( angle_sin * last_x_idx ) );
+  max_y = MAX( max_y, ( angle_cos * last_y_idx ) );
+  
+  const unsigned int out_lines = (unsigned int) ceil(
+    max_y - min_y );
+  const unsigned int out_cols = (unsigned int) ceil(
+    max_x - min_x );
+    
+  /* reseting output raster */
+  
+  TeCoord2D ll_point_input_ref_indexed( min_x,
+    max_y );
+  TeCoord2D ur_point_input_ref_indexed( max_x,
+    min_y );
+    
+  TeCoord2D ll_point_input_ref = 
+    input_raster_ptr->index2Coord( ll_point_input_ref_indexed );
+  TeCoord2D ur_point_input_ref = 
+    input_raster_ptr->index2Coord( ur_point_input_ref_indexed );    
+  
+  TeRasterParams new_out_params = output_raster_ptr->params();
+  
+  new_out_params.boundingBoxLinesColumns(
+    ll_point_input_ref.x(), ll_point_input_ref.y(),
+    ur_point_input_ref.x(), ur_point_input_ref.y(),
+    out_lines, out_cols );
+    
+  TEAGN_TRUE_OR_THROW( output_raster_ptr->init( new_out_params ),
+    "Error reseting output raster" )
+  
+  /* remapping pixels */
+    
+  unsigned int curr_out_x = 0;
+  unsigned int curr_out_y = 0;
+  double value = 0;
+  unsigned int curr_in_x = 0;
+  unsigned int curr_in_y = 0;
+  unsigned int curr_channel = 0;
+  
+  for( curr_channel = 0 ; curr_channel < input_raster_channels ;
+    ++curr_channel ) {
+    for( curr_out_y = 0 ; curr_out_y < out_lines ; ++curr_out_y ) {
+      for( curr_out_x = 0 ; curr_out_x < out_cols ; ++curr_out_x ) {
+        curr_in_x = 
+          TeRound( 
+            ( angle_cos * ( curr_out_x + min_x ) ) + 
+            ( angle_sin * ( curr_out_y + min_y ) )
+          );
+        curr_in_y = 
+          TeRound( 
+            ( -1.0 * angle_sin * ( curr_out_x + min_x ) ) + 
+            ( angle_cos * ( curr_out_y + min_y ) )
+          );
+        
+        if( input_raster_ptr->getElement( curr_in_x, curr_in_y,
+          value, curr_channel ) ) {
+        
+          output_raster_ptr->setElement( curr_out_x, curr_out_y,
+            value, curr_channel );
+        } else {
+          output_raster_ptr->setElement( curr_out_x, curr_out_y,
+            0, curr_channel );        
+        }
+      }
+    }
+  }
+  
+  return;
+}
+
+
+void sameImageAndBoxesTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
+    input_image1_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
+    input_image2_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  params.SetParameter( "matching_method", 
+    TePDIMMIOMatching::NormCrossCorrMethod );
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 2.0;
+  gt_params.max_imap_error_ = 2.0;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1_proj = input_image1_ptr->params().box();
+  TeBox input_box1;
+  TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, 
+    input_image1_ptr, input_box1 );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  params.SetParameter( "input_box2" , input_box1 );
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  // We can skip the geometry filter for this case since the images
+  // are the same and the boxes are the same
+  params.SetParameter( "skip_geom_filter" , (int)1 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)1000 ); 
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
+  
+  TeGTParams::pointer out_gt_params_ptr( new TeGTParams );
+  params.SetParameter( "out_gt_params_ptr" , out_gt_params_ptr );
+  
+  TePDIMMIOMatching match_instance; 
+
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC ;
+  
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageAndBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_sameImageAndBoxesTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_sameImageAndBoxesTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  /* Checking tie-points */
+  
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0, 
+        "Invalid tie-point" )
+      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0, 
+        "Invalid tie-point" )
+      
+      ++it;
+    }
+  }
+      
+  TEAGN_CHECK_EPS( 769, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+void sameImageAndBoxesWithMaskTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
+    input_image1_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
+    input_image2_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+  
+  // Creating the mask image 1 using the input image 1 parameters
+  
+  TeRasterParams mask1Params = input_image1_ptr->params();
+  mask1Params.nBands( 1 );
+  mask1Params.setDataType( TeUNSIGNEDCHAR, -1 );
+  
+  TePDITypes::TePDIRasterPtrType mask_image1_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( mask1Params,
+    mask_image1_ptr ), "Mask alloc error" );
+  
+  {
+    for( int line = 0 ; line < mask_image1_ptr->params().nlines_ ;
+      ++line )
+    {
+      for( int col = 0 ; col < mask_image1_ptr->params().ncols_ ;
+        ++col )
+      {
+        TEAGN_TRUE_OR_THROW( mask_image1_ptr->setElement( col, line, 1, 0 ),
+          "Error writing mask" );
+      }
+    }
+  }
+  
+  params.SetParameter( "mask_image1_ptr" , mask_image1_ptr );    
+  
+  // Creating the mask image 2 using the input image 2 parameters
+  
+  TeRasterParams mask2Params = input_image2_ptr->params();
+  mask2Params.nBands( 1 );
+  mask2Params.setDataType( TeUNSIGNEDCHAR, -1 );
+  
+  TePDITypes::TePDIRasterPtrType mask_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( mask2Params,
+    mask_image2_ptr ), "Mask alloc error" );
+    
+  {
+    for( int line = 0 ; line < mask_image2_ptr->params().nlines_ ;
+      ++line )
+    {
+      for( int col = 0 ; col < mask_image2_ptr->params().ncols_ ;
+        ++col )
+      {
+        TEAGN_TRUE_OR_THROW( mask_image2_ptr->setElement( col, line, 1, 0 ),
+          "Error writing mask" );
+      }
+    }
+  }
+  
+  params.SetParameter( "mask_image2_ptr" , mask_image2_ptr );
+    
+  // Output tie-points vector
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  params.SetParameter( "matching_method", 
+    TePDIMMIOMatching::NormCrossCorrMethod );
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.  
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 2.0;
+  gt_params.max_imap_error_ = 2.0;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1_proj = input_image1_ptr->params().box();
+  TeBox input_box1;
+  TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, 
+    input_image1_ptr, input_box1 );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  params.SetParameter( "input_box2" , input_box1 );
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  // We can skip the geometry filter for this case since the images
+  // are the same and the boxes are the same
+  params.SetParameter( "skip_geom_filter" , (int)1 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)1000 ); 
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
+  
+  TeGTParams::pointer out_gt_params_ptr( new TeGTParams );
+  params.SetParameter( "out_gt_params_ptr" , out_gt_params_ptr );
+  
+  TePDIMMIOMatching match_instance; 
+
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC ;
+  
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageAndBoxesWithMaskTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_sameImageAndBoxesWithMaskTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_sameImageAndBoxesWithMaskTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  /* Checking tie-points */
+  
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0, 
+        "Invalid tie-point" )
+      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0, 
+        "Invalid tie-point" )
+      
+      ++it;
+    }
+  }
+      
+  TEAGN_CHECK_EPS( 769, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+void sameImageDifBoxesTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
+    input_image1_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
+    input_image2_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );    
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  params.SetParameter( "matching_method", TePDIMMIOMatching::NormCrossCorrMethod );
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.  
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 0.5;
+  gt_params.max_imap_error_ = 0.5;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1( TeCoord2D( 0, 760 ) , TeCoord2D( 680, 0 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( 
+    TeCoord2D( 190, input_image1_ptr->params().nlines_ - 1 ) , 
+    TeCoord2D( input_image1_ptr->params().ncols_ - 1, 227 ) );
+  params.SetParameter( "input_box2" , input_box2 );   
+  
+  //params.SetParameter( "skip_geom_filter" , (int)1 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)1000 ); 
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
+  
+  TePDIMMIOMatching match_instance; 
+
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_sameImageDifBoxesTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_sameImageDifBoxesTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  /* Checking tie-points */
+  
+      
+  TEAGN_CHECK_EPS( 234, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+  
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0, 
+        "Invalid tie-point" )
+      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0, 
+        "Invalid tie-point" )
+      
+      ++it;
+    }
+  }
+}
+
+
+void halfsampledImageTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 
+    input_image1_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
+    input_image2_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );    
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  params.SetParameter( "matching_method", TePDIMMIOMatching::NormCrossCorrMethod );
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.  
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 2.0;
+  gt_params.max_imap_error_ = 2.0;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1( TeCoord2D( 122.0, 698.0 ), 
+    TeCoord2D( 730.0, 138.0 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 110.0, 305.0 ), 
+    TeCoord2D( 385.0, 50.0 ) );
+  params.SetParameter( "input_box2" , input_box2 );   
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+//  params.SetParameter( "skip_geom_filter" , (int)1 );
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
+  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)1000 ); 
+  
+  TePDIMMIOMatching match_instance; 
+
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (halfsampledImageTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  
+  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+  
+  while( it != it_end ) {
+    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+      Te2String( it->pt1.y(),1 ) + "] -> [" +
+      Te2String( it->pt2.x(),1 ) + " , " + 
+      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+    
+    ++it;
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_halfsampledImageTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_halfsampledImageTest_input_image2.tif",
+    out_tie_points_ptr, 1 );  
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 56, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )         
+}
+
+
+void halfsampledImageTest2()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
+    input_image1_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 
+    input_image2_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );   
+   
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  params.SetParameter( "matching_method", TePDIMMIOMatching::NormCrossCorrMethod );
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.  
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 2.0;
+  gt_params.max_imap_error_ = 2.0;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1( TeCoord2D( 110.0, 305.0 ), 
+    TeCoord2D( 385.0, 50.0 ) );    
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 122.0, 698.0 ), 
+    TeCoord2D( 730.0, 138.0 ) );    
+  params.SetParameter( "input_box2" , input_box2 );   
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+//  params.SetParameter( "skip_geom_filter" , (int)1 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)2 ); 
+  params.SetParameter( "pixel_y_relation" , (double)2 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)1000 );
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
+  
+  TePDIMMIOMatching match_instance; 
+
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (halfsampledImageTest2): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  
+  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+  
+  while( it != it_end ) {
+    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+      Te2String( it->pt1.y(),1 ) + "] -> [" +
+      Te2String( it->pt2.x(),1 ) + " , " + 
+      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+    
+    ++it;
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_halfsampledImageTest2_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_halfsampledImageTest2_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 56, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )     
+}
+
+
+void halfsampledRotadedImageTest()
+{
+  /* Open image 1 */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 
+    input_image1_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+  
+  /* Creating the half-sampled-rotated image 2 */
+    
+  TePDITypes::TePDIRasterPtrType input_disk_image2_ptr( new TeRaster(
+    std::string( 
+    TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
+    'r' ) );
+  TEAGN_TRUE_OR_THROW( input_disk_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" );
+      
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
+    input_image2_ptr, input_disk_image2_ptr->params(), 
+    TePDIUtils::TePDIUtilsAutoMemPol ),
+    "Error allocating raster memory" );
+    
+  rotateRasterClockWize( input_disk_image2_ptr, input_image2_ptr, M_PI_4 );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( input_image2_ptr, 
+    TEPDIEXAMPLESBINPATH "TePDIMMIOMatching_test_rotatedimage.tif", 
+    TeUNSIGNEDCHAR ),
+    "Error saving rotated image" );
+      
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  /* Set the other parameters */
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  params.SetParameter( "matching_method", 
+    TePDIMMIOMatching::NormCrossCorrMethod );
+  
+  TeBox input_box1( TeCoord2D( 122.0, 698.0 ), 
+    TeCoord2D( 730.0, 138.0 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 173.0, 447.0 ), 
+    TeCoord2D( 434.0, 153.0 ) );
+  params.SetParameter( "input_box2" , input_box2 );   
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+//  params.SetParameter( "skip_geom_filter" , (int)1 );
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "moravec_window_width" , (unsigned int)11 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
+  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
+  
+  // These rasters are for test purposes only
+  TePDITypes::TePDIRasterPtrType out_maximas_image1_ptr;
+  TePDITypes::TePDIRasterPtrType out_maximas_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster(
+    out_maximas_image1_ptr, 1, 1, 1, false, TeUNSIGNEDCHAR, 0 ),
+    "Raster allocation error" )
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster(
+    out_maximas_image2_ptr, 1, 1, 1, false, TeUNSIGNEDCHAR, 0 ),
+    "Raster allocation error" )
+  params.SetParameter( "out_maximas_image1_ptr" , out_maximas_image1_ptr );
+  params.SetParameter( "out_maximas_image2_ptr" , out_maximas_image2_ptr );   
+  
+  TePDIMMIOMatching match_instance; 
+
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (halfsampledRotadedImageTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  // Generate the output tif maximas images
+  // These rasters are for test purposes only
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( out_maximas_image1_ptr,
+    TEPDIEXAMPLESBINPATH "TePDIMMIOMatching_halfsampledRotadedImageTest_maximas_image1.tif",
+    true ), "Error generating TIF" )
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( out_maximas_image2_ptr,
+    TEPDIEXAMPLESBINPATH "TePDIMMIOMatching_halfsampledRotadedImageTest_maximas_image2.tif",
+    true ), "Error generating TIF" )    
+    
+  /* Displaying tie-points */
+  
+  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+  
+  while( it != it_end ) {
+    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+      Te2String( it->pt1.y(),1 ) + "] -> [" +
+      Te2String( it->pt2.x(),1 ) + " , " + 
+      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+    
+    ++it;
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_halfsampledRotadedImageTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_test_halfsampledRotadedImageTest_input_image2.tif",
+    out_tie_points_ptr, 1 );   
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 22, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )
+}
+
+// Testing two distinct images with different resolutions
+void HRCxCCDTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_hrc_crop.tif" ), 
+    input_image1_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::loadRaster( 
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 
+    input_image2_ptr, true ), "Error loading raster" );
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)2 );    
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  params.SetParameter( "matching_method", TePDIMMIOMatching::NormCrossCorrMethod );
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.  
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 2; // max error over img 2
+  gt_params.max_imap_error_ = 16; // max error over img 1
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  params.SetParameter( "pixel_x_relation" , input_image1_ptr->params().resx_ /
+    input_image2_ptr->params().resx_ ); 
+  params.SetParameter( "pixel_y_relation" , input_image1_ptr->params().resy_ /
+    input_image2_ptr->params().resy_ ); 
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)1000 ); 
+  
+  TePDIMMIOMatching match_instance; 
+
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_HRCxCCDTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIMMIOMatching_HRCxCCDTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  /* Checking tie-points */
+  
+      
+  TEAGN_CHECK_EPS( 22, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  TeStdIOProgress pi;
+  TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+  
+  sameImageAndBoxesTest();
+  sameImageAndBoxesWithMaskTest();
+  sameImageDifBoxesTest();
+  halfsampledImageTest();
+  halfsampledImageTest2();
+  halfsampledRotadedImageTest();
+  HRCxCCDTest();
+  
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Total elapsed time: " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );    
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching_test.vcproj b/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching_test.vcproj
index 115fc2e..cc329d5 100644
--- a/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching_test.vcproj
+++ b/examples/image_processing/source/TePDIMMIOMatching/TePDIMMIOMatching_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIMMIOMatching_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIMMIOMatching_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIMMIOMatching_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".;../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIMMIOMatching_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIMMIOMatching_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIMMIOMatching_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIMMIOMatching_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIMMIOMatching_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIMMIOMatching_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIMMIOMatching_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIMathFunctions/.cvsignore b/examples/image_processing/source/TePDIMathFunctions/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIMathFunctions/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions.pro b/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions.pro
old mode 100755
new mode 100644
index 6a9fa84..bbd46d1
--- a/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions.pro
+++ b/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions.pro
@@ -1,4 +1,4 @@
-include( ../base/base.pro )
-
-SOURCES += TePDIMathFunctions_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += TePDIMathFunctions_test.cpp
+
diff --git a/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions_test.cpp b/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions_test.cpp
old mode 100755
new mode 100644
index ac3a1c7..e7466c5
--- a/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions_test.cpp
+++ b/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions_test.cpp
@@ -1,117 +1,117 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIMathFunctions.hpp>
-#include <TeAgnostic.h>
-
-
-void DecimLevels_test()
-{
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevels( 0 ) == 0 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevels( 1 ) == 0 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevels( 2 ) == 1 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevels( 3 ) == 2 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevels( 4 ) == 2 ),
-    "Invalid result" );
-}
-
-
-void DecimLevelSize_test()
-{
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 1, 2 ) == 1 ),
-    "Invalid result" );
-    
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 1, 3 ) == 2 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 2, 3 ) == 1 ),
-    "Invalid result" );
-    
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 1, 4 ) == 2 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 2, 4 ) == 1 ),
-    "Invalid result" );
-
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 1, 5 ) == 3 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 2, 5 ) == 2 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 3, 5 ) == 1 ),
-    "Invalid result" );
-    
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 1, 6 ) == 3 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 2, 6 ) == 2 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 3, 6 ) == 1 ),
-    "Invalid result" );
-    
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 1, 7 ) == 4 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 2, 7 ) == 2 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 3, 7 ) == 1 ),
-    "Invalid result" );
-    
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 1, 8 ) == 4 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 2, 8 ) == 2 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 3, 8 ) == 1 ),
-    "Invalid result" );
-    
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 1, 9 ) == 5 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 2, 9 ) == 3 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 3, 9 ) == 2 ),
-    "Invalid result" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIMathFunctions::DecimLevelSize( 4, 9 ) == 1 ),
-    "Invalid result" );
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    DecimLevels_test();
-    DecimLevelSize_test();
-  }
-  catch( const TeException& excpt ){
-    TEAGN_LOGERR( excpt.message() )
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIMathFunctions.hpp>
+#include <TeAgnostic.h>
+
+
+void DecimLevels_test()
+{
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevels( 0 ) == 0 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevels( 1 ) == 0 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevels( 2 ) == 1 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevels( 3 ) == 2 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevels( 4 ) == 2 ),
+    "Invalid result" );
+}
+
+
+void DecimLevelSize_test()
+{
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 1, 2 ) == 1 ),
+    "Invalid result" );
+    
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 1, 3 ) == 2 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 2, 3 ) == 1 ),
+    "Invalid result" );
+    
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 1, 4 ) == 2 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 2, 4 ) == 1 ),
+    "Invalid result" );
+
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 1, 5 ) == 3 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 2, 5 ) == 2 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 3, 5 ) == 1 ),
+    "Invalid result" );
+    
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 1, 6 ) == 3 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 2, 6 ) == 2 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 3, 6 ) == 1 ),
+    "Invalid result" );
+    
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 1, 7 ) == 4 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 2, 7 ) == 2 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 3, 7 ) == 1 ),
+    "Invalid result" );
+    
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 1, 8 ) == 4 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 2, 8 ) == 2 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 3, 8 ) == 1 ),
+    "Invalid result" );
+    
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 1, 9 ) == 5 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 2, 9 ) == 3 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 3, 9 ) == 2 ),
+    "Invalid result" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIMathFunctions::DecimLevelSize( 4, 9 ) == 1 ),
+    "Invalid result" );
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    DecimLevels_test();
+    DecimLevelSize_test();
+  }
+  catch( const TeException& excpt ){
+    TEAGN_LOGERR( excpt.message() )
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions_test.vcproj b/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions_test.vcproj
old mode 100755
new mode 100644
index f6efff8..40f9138
--- a/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions_test.vcproj
+++ b/examples/image_processing/source/TePDIMathFunctions/TePDIMathFunctions_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIMathFunctions_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIMathFunctions_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIMathFunctions_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIMathFunctions_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIMathFunctions_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIMathFunctions_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIMathFunctions_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIMathFunctions_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIMathFunctions_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIMathFunctions_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIMatrix/.cvsignore b/examples/image_processing/source/TePDIMatrix/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIMatrix/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIMatrix/TePDIMatrix.pro b/examples/image_processing/source/TePDIMatrix/TePDIMatrix.pro
old mode 100755
new mode 100644
index 0ce669e..0d9f072
--- a/examples/image_processing/source/TePDIMatrix/TePDIMatrix.pro
+++ b/examples/image_processing/source/TePDIMatrix/TePDIMatrix.pro
@@ -1,5 +1,5 @@
-include( ../base/base.pro )
-
-SOURCES += \
-           TePDIMatrix_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += \
+           TePDIMatrix_test.cpp
+
diff --git a/examples/image_processing/source/TePDIMatrix/TePDIMatrix_test.cpp b/examples/image_processing/source/TePDIMatrix/TePDIMatrix_test.cpp
old mode 100755
new mode 100644
index fb77d6e..8721065
--- a/examples/image_processing/source/TePDIMatrix/TePDIMatrix_test.cpp
+++ b/examples/image_processing/source/TePDIMatrix/TePDIMatrix_test.cpp
@@ -1,174 +1,232 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TeAgnostic.h>
-
-#include <TePDIMatrix.hpp>
-
-#include <string>
-
-void ram_numeric_test()
-{
-    /* Checking basic matrix creation and access */
-  
-    TePDIMatrix< double > m1( 2, 2 );
-    
-    TEAGN_TRUE_OR_THROW( ( ! m1.IsEmpty() ), "Empty verification failed." );
-    
-    m1( 0 , 0 ) = 0.0;
-    m1( 0 , 1 ) = 1.0;
-    m1( 1 , 0 ) = 2.0;
-    m1( 1 , 1 ) = 3.0;
-    
-    TEAGN_TRUE_OR_THROW( m1.GetLines() == 2, "Invalid lines number" );
-    TEAGN_TRUE_OR_THROW( m1.GetColumns() == 2, "Invalid columns number" );
-    
-    TEAGN_TRUE_OR_THROW( m1( 0 , 0 ) == 0.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m1( 0 , 1 ) == 1.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m1( 1 , 0 ) == 2.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m1( 1 , 1 ) == 3.0, "Invalid value" );
-    
-    TEAGN_TRUE_OR_THROW( m1[ 0 ][ 0 ] == 0.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m1[ 0 ][ 1 ] == 1.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m1[ 1 ][ 0 ] == 2.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m1[ 1 ][ 1 ] == 3.0, "Invalid value" );    
-    
-    /* Reset test */
-    
-    TEAGN_TRUE_OR_THROW( m1.Reset( 2, 2 ), "Reset error" );
-    
-    m1( 0 , 0 ) = 0.0;
-    m1( 0 , 1 ) = 1.0;
-    m1( 1 , 0 ) = 2.0;
-    m1( 1 , 1 ) = 3.0;
-    
-    TEAGN_TRUE_OR_THROW( m1.GetLines() == 2, "Invalid lines number" );
-    TEAGN_TRUE_OR_THROW( m1.GetColumns() == 2, "Invalid columns number" );
-    
-    TEAGN_TRUE_OR_THROW( m1( 0 , 0 ) == 0.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m1( 0 , 1 ) == 1.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m1( 1 , 0 ) == 2.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m1( 1 , 1 ) == 3.0, "Invalid value" );    
-    
-    /* Checking copy operator */
-    
-    TePDIMatrix< double > m2;
-    TEAGN_TRUE_OR_THROW( m2.IsEmpty(), "Empty verification failed." );
-    
-    TEAGN_TRUE_OR_THROW( m2.GetLines() == 0, "Invalid lines number" );
-    TEAGN_TRUE_OR_THROW( m2.GetColumns() == 0, "Invalid columns number" );
-    
-    m2 = m1;
-    
-    TEAGN_TRUE_OR_THROW( m2.GetLines() == 2, "Invalid lines number" );
-    TEAGN_TRUE_OR_THROW( m2.GetColumns() == 2, "Invalid columns number" );
-    
-    TEAGN_TRUE_OR_THROW( m2( 0 , 0 ) == 0.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m2( 0 , 1 ) == 1.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m2( 1 , 0 ) == 2.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m2( 1 , 1 ) == 3.0, "Invalid value" );
-    
-    /* Checking copy constructor */
-    
-    TePDIMatrix< double > m3;
-    TEAGN_TRUE_OR_THROW( m3.IsEmpty(), "Empty verification failed." );
-    
-    TEAGN_TRUE_OR_THROW( m3.GetLines() == 0, "Invalid lines number" );
-    TEAGN_TRUE_OR_THROW( m3.GetColumns() == 0, "Invalid columns number" );
-    
-    m3 = m1;
-    
-    TEAGN_TRUE_OR_THROW( m3.GetLines() == 2, "Invalid lines number" );
-    TEAGN_TRUE_OR_THROW( m3.GetColumns() == 2, "Invalid columns number" );
-    
-    TEAGN_TRUE_OR_THROW( m3( 0 , 0 ) == 0.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m3( 0 , 1 ) == 1.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m3( 1 , 0 ) == 2.0, "Invalid value" );
-    TEAGN_TRUE_OR_THROW( m3( 1 , 1 ) == 3.0, "Invalid value" );    
-}
-
-void AutoMemPol_test()
-{
-    const unsigned int max_ram  = (unsigned int)
-      ( 0.90 * ( (double)TeGetFreeVirtualMemory() ) );    
-
-    unsigned long int lines = (unsigned long int)(
-      ( (double)( max_ram + ( 256 * 1024 * 1024 ) ) ) /
-      ( ( (double)sizeof( double ) ) * 1000 ) );
-    unsigned long int cols = 1000;
-
-    TePDIMatrix< double > m1( lines, cols, 
-      TePDIMatrix< double >::AutoMemPol );
-      
-    double counter = 0.0;
-  
-    unsigned int line = 0;
-    unsigned int col = 0;
-      
-    for( line = 0 ; line < lines ; ++line ) {
-      for( col = 0 ; col < cols ; ++col ) {
-        m1( line , col ) = counter;
-        
-        ++counter;
-      }
-    }
-    
-    counter = 0.0;
-    
-    for( line = 0 ; line < lines ; ++line ) {
-      for( col = 0 ; col < cols ; ++col ) {
-        TEAGN_TRUE_OR_THROW( ( m1( line , col ) == counter ), 
-          "Element value check failed" );
-          
-        ++counter;          
-      }
-    }
-    
-    return;
-}
-
-void memory_mapped_big_matrix_test()
-{
-    unsigned long int lines = 3000;
-    unsigned long int cols = 4000;
-
-    TePDIMatrix< double > m1( lines, cols, 
-      TePDIMatrix< double >::DiskMemPol );
-      
-    TEAGN_TRUE_OR_THROW( m1.GetLines() == lines, "Invalid lines number" );
-    TEAGN_TRUE_OR_THROW( m1.GetColumns() == cols, "Invalid columns number" );      
-    
-    unsigned int line = 0;
-    unsigned int col = 0;
-      
-    for( line = 0 ; line < lines ; ++line ) {
-      for( col = 0 ; col < cols ; ++col ) {
-        m1( line , col ) = (double)( line + col );
-      }
-    }
-    
-    for( line = 0 ; line < lines ; ++line ) {
-      for( col = 0 ; col < cols ; ++col ) {
-        TEAGN_TRUE_OR_THROW( ( m1( line , col ) == 
-          ( (double)( line + col ) ) ), "Element value check failed" );
-      }
-    }
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    ram_numeric_test();
-    memory_mapped_big_matrix_test();
-    AutoMemPol_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }  
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TeAgnostic.h>
+
+#include <TePDIMatrix.hpp>
+
+#include <string>
+#include <stdlib.h>
+
+void generic_tests()
+{
+    /* Checking basic matrix creation and access */
+  
+    TePDIMatrix< double > m1;
+    TEAGN_TRUE_OR_THROW( m1.Reset( 2, 2,
+      TePDIMatrix< double >::RAMMemPol ), "Matrix reset error" );
+    TEAGN_TRUE_OR_THROW( ( ! m1.IsEmpty() ), "Empty verification failed." );
+    TEAGN_TRUE_OR_THROW( m1.getMemPolicy() == TePDIMatrix< double >::RAMMemPol, 
+      "Invalid policy" );           
+    
+    m1( 0 , 0 ) = 0.0;
+    m1( 0 , 1 ) = 1.0;
+    m1( 1 , 0 ) = 2.0;
+    m1( 1 , 1 ) = 3.0;
+    
+    TEAGN_TRUE_OR_THROW( m1.GetLines() == 2, "Invalid lines number" );
+    TEAGN_TRUE_OR_THROW( m1.GetColumns() == 2, "Invalid columns number" );
+    
+    TEAGN_TRUE_OR_THROW( m1( 0 , 0 ) == 0.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m1( 0 , 1 ) == 1.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m1( 1 , 0 ) == 2.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m1( 1 , 1 ) == 3.0, "Invalid value" );
+    
+    TEAGN_TRUE_OR_THROW( m1[ 0 ][ 0 ] == 0.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m1[ 0 ][ 1 ] == 1.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m1[ 1 ][ 0 ] == 2.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m1[ 1 ][ 1 ] == 3.0, "Invalid value" );    
+    
+    /* Reset test */
+    
+    TEAGN_TRUE_OR_THROW( m1.Reset( 2, 2 ), "Reset error" );
+    TEAGN_TRUE_OR_THROW( m1.getMemPolicy() == TePDIMatrix< double >::RAMMemPol, 
+      "Invalid policy" );           
+    
+    
+    m1( 0 , 0 ) = 0.0;
+    m1( 0 , 1 ) = 1.0;
+    m1( 1 , 0 ) = 2.0;
+    m1( 1 , 1 ) = 3.0;
+    
+    TEAGN_TRUE_OR_THROW( m1.GetLines() == 2, "Invalid lines number" );
+    TEAGN_TRUE_OR_THROW( m1.GetColumns() == 2, "Invalid columns number" );
+    
+    TEAGN_TRUE_OR_THROW( m1( 0 , 0 ) == 0.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m1( 0 , 1 ) == 1.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m1( 1 , 0 ) == 2.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m1( 1 , 1 ) == 3.0, "Invalid value" );    
+    
+    /* Checking copy operator */
+    
+    TePDIMatrix< double > m2;
+    TEAGN_TRUE_OR_THROW( m2.IsEmpty(), "Empty verification failed." );
+    TEAGN_TRUE_OR_THROW( m2.getMemPolicy() == TePDIMatrix< double >::RAMMemPol, 
+      "Invalid policy" );           
+    
+    
+    TEAGN_TRUE_OR_THROW( m2.GetLines() == 0, "Invalid lines number" );
+    TEAGN_TRUE_OR_THROW( m2.GetColumns() == 0, "Invalid columns number" );
+    
+    m2 = m1;
+    
+    TEAGN_TRUE_OR_THROW( m2.GetLines() == 2, "Invalid lines number" );
+    TEAGN_TRUE_OR_THROW( m2.GetColumns() == 2, "Invalid columns number" );
+    
+    TEAGN_TRUE_OR_THROW( m2( 0 , 0 ) == 0.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m2( 0 , 1 ) == 1.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m2( 1 , 0 ) == 2.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m2( 1 , 1 ) == 3.0, "Invalid value" );
+    
+    /* Checking copy constructor */
+    
+    TePDIMatrix< double > m3( m1 );
+    TEAGN_TRUE_OR_THROW( m3.getMemPolicy() == TePDIMatrix< double >::RAMMemPol, 
+      "Invalid policy" );           
+    
+
+    TEAGN_TRUE_OR_THROW( m3.GetLines() == 2, "Invalid lines number" );
+    TEAGN_TRUE_OR_THROW( m3.GetColumns() == 2, "Invalid columns number" );
+    
+    TEAGN_TRUE_OR_THROW( m3( 0 , 0 ) == 0.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m3( 0 , 1 ) == 1.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m3( 1 , 0 ) == 2.0, "Invalid value" );
+    TEAGN_TRUE_OR_THROW( m3( 1 , 1 ) == 3.0, "Invalid value" );    
+}
+
+void RAMMemPol_test()
+{
+    const unsigned int max_ram  = (unsigned int)
+      ( 0.20 * ( (double)TeGetFreeVirtualMemory() ) );    
+
+    unsigned long int lines = (unsigned long int)(
+      ( (double)( max_ram ) ) /
+      ( ( (double)sizeof( double ) ) * 1000.00 ) );
+    unsigned long int cols = 1000;
+
+    TePDIMatrix< double > m1;
+    TEAGN_TRUE_OR_THROW( m1.Reset( lines, cols, 
+      TePDIMatrix< double >::RAMMemPol ), "Matrix reset error" );
+      
+    TEAGN_TRUE_OR_THROW( m1.getMemPolicy() == TePDIMatrix< double >::RAMMemPol, 
+      "Invalid policy" );      
+      
+    double counter = 0.0;
+  
+    unsigned int line = 0;
+    unsigned int col = 0;
+      
+    for( line = 0 ; line < lines ; ++line ) {
+      for( col = 0 ; col < cols ; ++col ) {
+        m1( line , col ) = counter;
+        
+        ++counter;
+      }
+    }
+    
+    counter = 0.0;
+    
+    for( line = 0 ; line < lines ; ++line ) {
+      for( col = 0 ; col < cols ; ++col ) {
+        TEAGN_TRUE_OR_THROW( ( m1( line , col ) == counter ), 
+          "Element value check failed" );
+          
+        ++counter;          
+      }
+    }
+    
+    return;
+}
+
+void AutoMemPol_test()
+{
+    const unsigned int max_ram  = (unsigned int)
+      ( 0.50 * ( (double)TeGetFreeVirtualMemory() ) );    
+
+    unsigned long int lines = (unsigned long int)(
+      ( (double)( max_ram + ( 256 * 1024 * 1024 ) ) ) /
+      ( ( (double)sizeof( double ) ) * 1000.00 ) );
+    unsigned long int cols = 1000;
+
+    TePDIMatrix< double > m1;
+    TEAGN_TRUE_OR_THROW( m1.Reset( lines, cols, 
+      TePDIMatrix< double >::AutoMemPol ), "Matrix reset error" );
+      
+    TEAGN_TRUE_OR_THROW( m1.getMemPolicy() == TePDIMatrix< double >::AutoMemPol, 
+      "Invalid policy" );        
+      
+    double counter = 0.0;
+  
+    unsigned int line = 0;
+    unsigned int col = 0;
+      
+    for( line = 0 ; line < lines ; ++line ) {
+      for( col = 0 ; col < cols ; ++col ) {
+        m1( line , col ) = counter;
+        
+        ++counter;
+      }
+    }
+    
+    counter = 0.0;
+    
+    for( line = 0 ; line < lines ; ++line ) {
+      for( col = 0 ; col < cols ; ++col ) {
+        TEAGN_TRUE_OR_THROW( ( m1( line , col ) == counter ), 
+          "Element value check failed" );
+          
+        ++counter;          
+      }
+    }
+    
+    return;
+}
+
+void DiskMemPol_test()
+{
+    unsigned long int lines = 3000;
+    unsigned long int cols = 4000;
+
+    TePDIMatrix< double > m1;
+    TEAGN_TRUE_OR_THROW( m1.Reset( lines, cols, 
+      TePDIMatrix< double >::DiskMemPol ), "Matrix reset error" );      
+      
+    TEAGN_TRUE_OR_THROW( m1.getMemPolicy() == TePDIMatrix< double >::DiskMemPol, 
+      "Invalid policy" );          
+    TEAGN_TRUE_OR_THROW( m1.GetLines() == lines, "Invalid lines number" );
+    TEAGN_TRUE_OR_THROW( m1.GetColumns() == cols, "Invalid columns number" );      
+    
+    unsigned int line = 0;
+    unsigned int col = 0;
+    double counter = 0.0;
+      
+    for( line = 0 ; line < lines ; ++line ) {
+      for( col = 0 ; col < cols ; ++col ) {
+        m1( line , col ) = counter;
+        ++counter;
+      }
+    }
+    
+    counter = 0.0;
+    
+    for( line = 0 ; line < lines ; ++line ) {
+      for( col = 0 ; col < cols ; ++col ) {
+        TEAGN_TRUE_OR_THROW( ( m1( line , col ) == counter ), 
+          "Element value check failed" );
+        ++counter;
+      }
+    }
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  generic_tests();
+  RAMMemPol_test();
+  DiskMemPol_test();
+  AutoMemPol_test();
+  
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIMatrix/TePDIMatrix_test.vcproj b/examples/image_processing/source/TePDIMatrix/TePDIMatrix_test.vcproj
old mode 100755
new mode 100644
index c4a3326..7f03b44
--- a/examples/image_processing/source/TePDIMatrix/TePDIMatrix_test.vcproj
+++ b/examples/image_processing/source/TePDIMatrix/TePDIMatrix_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIMatrix_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIMatrix_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIMatrix_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIMatrix_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIMatrix_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIMatrix_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIMatrix_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIMatrix_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIMatrix_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIMatrix_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIMatrixFunctions/.cvsignore b/examples/image_processing/source/TePDIMatrixFunctions/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIMatrixFunctions/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions.pro b/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions.pro
old mode 100755
new mode 100644
index 2dc003a..fd6764d
--- a/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions.pro
+++ b/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions.pro
@@ -1,5 +1,5 @@
-include( ../base/base.pro )
-
-SOURCES += \
-           TePDIMatrixFunctions_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += \
+           TePDIMatrixFunctions_test.cpp
+
diff --git a/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions_test.cpp b/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions_test.cpp
old mode 100755
new mode 100644
index 26876e2..318ab13
--- a/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions_test.cpp
+++ b/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions_test.cpp
@@ -1,116 +1,128 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TeAgnostic.h>
-
-#include <TePDIMatrixFunctions.hpp>
-
-#include <string>
-
-void GetCorrelation_test()
-{
-    TePDIMatrix< double > m1( 2, 2 );
-    TePDIMatrix< double > m2( 2, 2 );
-    
-    m1( 0 , 0 ) = 0;
-    m1( 0 , 1 ) = 1;
-    m1( 1 , 0 ) = 2;
-    m1( 1 , 1 ) = 3;
-    
-    m2( 0 , 0 ) = 0;
-    m2( 0 , 1 ) = 1;
-    m2( 1 , 0 ) = 2;
-    m2( 1 , 1 ) = 3;
-
-    TEAGN_CHECK_EPS( TePDIMatrixFunctions::GetCorrelation( m1, m2 ),
-      1.0, 0.000001 , "Invalid GetCorrelation return" );
-}
-
-
-void Abs_test()
-{
-    TePDIMatrix< double > m1( 2, 2 );
-    TePDIMatrix< double > m2;
-    
-    m1( 0 , 0 ) = 0;
-    m1( 0 , 1 ) = -1;
-    m1( 1 , 0 ) = 2;
-    m1( 1 , 1 ) = -3;
-    
-    TEAGN_TRUE_OR_THROW( TePDIMatrixFunctions::Abs( m1, m2 ),
-      "Abs calcule failed" );
-      
-    TEAGN_CHECK_EPS( m2( 0, 0 ), 0.0, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS( m2( 0, 1 ), 1.0, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS( m2( 1, 0 ), 2.0, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS( m2( 1, 1 ), 3.0, 0.000001, "Invalid value" );
-}
-
-
-void WhereIsGreater_test()
-{
-    TePDIMatrix< double > m1( 2, 2 );
-    TePDIMatrix< double > m2( 2, 2 );
-    TePDIMatrix< double > gt;
-    
-    m1( 0 , 0 ) = 0;
-    m1( 0 , 1 ) = 1;
-    m1( 1 , 0 ) = 2;
-    m1( 1 , 1 ) = 3;
-    
-    m2( 0 , 0 ) = 0;
-    m2( 0 , 1 ) = 2;
-    m2( 1 , 0 ) = 2;
-    m2( 1 , 1 ) = 1;
-    
-    TEAGN_TRUE_OR_THROW( TePDIMatrixFunctions::WhereIsGreater( m1, m2, gt ),
-      "WhereIsGreater calcule failed" );    
-
-    TEAGN_CHECK_EPS( gt( 0, 0 ), 0.0, 0.000001 , 
-      "Invalid WhereIsGreater result" );
-    TEAGN_CHECK_EPS( gt( 0, 1 ), 0.0, 0.000001 , 
-      "Invalid WhereIsGreater result" );
-    TEAGN_CHECK_EPS( gt( 1, 0 ), 0.0, 0.000001 , 
-      "Invalid WhereIsGreater result" );
-    TEAGN_CHECK_EPS( gt( 1, 1 ), 1.0, 0.000001 , 
-      "Invalid WhereIsGreater result" );            
-}
-
-
-void Negate_test()
-{
-    TePDIMatrix< double > m1( 2, 2 );
-    TePDIMatrix< double > neg( 2, 2 );
-    
-    m1( 0 , 0 ) = 0;
-    m1( 0 , 1 ) = -1;
-    m1( 1 , 0 ) = 2;
-    m1( 1 , 1 ) = -3;
-    
-    TEAGN_TRUE_OR_THROW( TePDIMatrixFunctions::Negate( m1, neg ),
-      "Abs calcule failed" );
-      
-    TEAGN_CHECK_EPS( neg( 0, 0 ), 1.0, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS( neg( 0, 1 ), 0.0, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS( neg( 1, 0 ), 0.0, 0.000001, "Invalid value" );
-    TEAGN_CHECK_EPS( neg( 1, 1 ), 0.0, 0.000001, "Invalid value" );
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    GetCorrelation_test();
-    Abs_test();
-    WhereIsGreater_test();
-    Negate_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  } 
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TeAgnostic.h>
+
+#include <TePDIMatrixFunctions.hpp>
+
+#include <string>
+
+void GetCorrelation_test()
+{
+    TePDIMatrix< double > m1;
+    TEAGN_TRUE_OR_THROW( m1.Reset( 2, 2 ), "Reset error" );
+    
+    TePDIMatrix< double > m2;
+    TEAGN_TRUE_OR_THROW( m2.Reset( 2, 2 ), "Reset error" );
+    
+    m1( 0 , 0 ) = 0;
+    m1( 0 , 1 ) = 1;
+    m1( 1 , 0 ) = 2;
+    m1( 1 , 1 ) = 3;
+    
+    m2( 0 , 0 ) = 0;
+    m2( 0 , 1 ) = 1;
+    m2( 1 , 0 ) = 2;
+    m2( 1 , 1 ) = 3;
+
+    TEAGN_CHECK_EPS( TePDIMatrixFunctions::GetCorrelation( m1, m2 ),
+      1.0, 0.000001 , "Invalid GetCorrelation return" );
+}
+
+
+void Abs_test()
+{
+    TePDIMatrix< double > m1;
+    TEAGN_TRUE_OR_THROW( m1.Reset( 2, 2 ), "Reset error" );
+    
+    TePDIMatrix< double > m2;
+    
+    m1( 0 , 0 ) = 0;
+    m1( 0 , 1 ) = -1;
+    m1( 1 , 0 ) = 2;
+    m1( 1 , 1 ) = -3;
+    
+    TEAGN_TRUE_OR_THROW( TePDIMatrixFunctions::Abs( m1, m2 ),
+      "Abs calcule failed" );
+      
+    TEAGN_CHECK_EPS( m2( 0, 0 ), 0.0, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS( m2( 0, 1 ), 1.0, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS( m2( 1, 0 ), 2.0, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS( m2( 1, 1 ), 3.0, 0.000001, "Invalid value" );
+}
+
+
+void WhereIsGreater_test()
+{
+    TePDIMatrix< double > m1;
+    TEAGN_TRUE_OR_THROW( m1.Reset( 2, 2 ), "Reset error" );
+    
+    TePDIMatrix< double > m2;
+    TEAGN_TRUE_OR_THROW( m2.Reset( 2, 2 ), "Reset error" );
+    
+    TePDIMatrix< double > gt;
+    
+    m1( 0 , 0 ) = 0;
+    m1( 0 , 1 ) = 1;
+    m1( 1 , 0 ) = 2;
+    m1( 1 , 1 ) = 3;
+    
+    m2( 0 , 0 ) = 0;
+    m2( 0 , 1 ) = 2;
+    m2( 1 , 0 ) = 2;
+    m2( 1 , 1 ) = 1;
+    
+    TEAGN_TRUE_OR_THROW( TePDIMatrixFunctions::WhereIsGreater( m1, m2, gt ),
+      "WhereIsGreater calcule failed" );    
+
+    TEAGN_CHECK_EPS( gt( 0, 0 ), 0.0, 0.000001 , 
+      "Invalid WhereIsGreater result" );
+    TEAGN_CHECK_EPS( gt( 0, 1 ), 0.0, 0.000001 , 
+      "Invalid WhereIsGreater result" );
+    TEAGN_CHECK_EPS( gt( 1, 0 ), 0.0, 0.000001 , 
+      "Invalid WhereIsGreater result" );
+    TEAGN_CHECK_EPS( gt( 1, 1 ), 1.0, 0.000001 , 
+      "Invalid WhereIsGreater result" );            
+}
+
+
+void Negate_test()
+{
+    TePDIMatrix< double > m1;
+    TEAGN_TRUE_OR_THROW( m1.Reset( 2, 2 ), "Reset error" );
+    
+    TePDIMatrix< double > neg;
+    TEAGN_TRUE_OR_THROW( neg.Reset( 2, 2 ), "Reset error" );
+    
+    m1( 0 , 0 ) = 0;
+    m1( 0 , 1 ) = -1;
+    m1( 1 , 0 ) = 2;
+    m1( 1 , 1 ) = -3;
+    
+    TEAGN_TRUE_OR_THROW( TePDIMatrixFunctions::Negate( m1, neg ),
+      "Abs calcule failed" );
+      
+    TEAGN_CHECK_EPS( neg( 0, 0 ), 1.0, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS( neg( 0, 1 ), 0.0, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS( neg( 1, 0 ), 0.0, 0.000001, "Invalid value" );
+    TEAGN_CHECK_EPS( neg( 1, 1 ), 0.0, 0.000001, "Invalid value" );
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    GetCorrelation_test();
+    Abs_test();
+    WhereIsGreater_test();
+    Negate_test();
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  } 
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions_test.vcproj b/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions_test.vcproj
old mode 100755
new mode 100644
index 0078018..04e65ef
--- a/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions_test.vcproj
+++ b/examples/image_processing/source/TePDIMatrixFunctions/TePDIMatrixFunctions_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIMatrixFunctions_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIMatrixFunctions_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIMatrixFunctions_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIMatrixFunctions_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIMatrixFunctions_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIMatrixFunctions_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIMatrixFunctions_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIMatrixFunctions_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIMatrixFunctions_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIMatrixFunctions_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIMixModel/.cvsignore b/examples/image_processing/source/TePDIMixModel/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIMixModel/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIMixModel/TePDIMixModel.pro b/examples/image_processing/source/TePDIMixModel/TePDIMixModel.pro
index 764ddbd..fb1fac5 100644
--- a/examples/image_processing/source/TePDIMixModel/TePDIMixModel.pro
+++ b/examples/image_processing/source/TePDIMixModel/TePDIMixModel.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += TePDIMixModel_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/TePDIPrincoMixModel*.tif
-
+include( ../base/base.pro )
+
+SOURCES += TePDIMixModel_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/TePDIPrincoMixModel*.tif
+
diff --git a/examples/image_processing/source/TePDIMixModel/TePDIMixModel_test.cpp b/examples/image_processing/source/TePDIMixModel/TePDIMixModel_test.cpp
index bc55572..d1409e7 100644
--- a/examples/image_processing/source/TePDIMixModel/TePDIMixModel_test.cpp
+++ b/examples/image_processing/source/TePDIMixModel/TePDIMixModel_test.cpp
@@ -1,180 +1,180 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <vector>
-
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeRasterParams.h>
-#include <TePDITypes.hpp>
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-#include <TeRasterParams.h>
-#include <TePDIMixModel.hpp>
-#include <TePDIMixModelComponentList.hpp>
-#include <TePDIMixModelSpectralBandList.hpp>
-
-void PrincoMixModel_test()
-{
-  #define componentsNumber 3
-  #define spectralBandsNumber 3
-
-  TePDIParameters params;
-
-// ----- Setting spectralbands e components -----
-  TePDIMixModelComponentList componentList;
-  componentList.insertComponent(0, "nuvem");
-  componentList.insertPixel(0, 0, 1.000);
-  componentList.insertPixel(0, 1, 0.725);
-  componentList.insertPixel(0, 2, 1.000);
-  
-  componentList.insertComponent(1, "vegetacao");
-  componentList.insertPixel(1, 0, 0.392);
-  componentList.insertPixel(1, 1, 0.251);
-  componentList.insertPixel(1, 2, 0.604);
-  
-  componentList.insertComponent(2, "sombra");
-  componentList.insertPixel(2, 0, 0.165);
-  componentList.insertPixel(2, 1, 0.098);
-  componentList.insertPixel(2, 2, 0.196);
-  
-  TePDIMixModelSpectralBandList spectralBandList;
-  spectralBandList.insertSpectralBand(TePDIMixModelSpectralBand(250, 2, 0.450000, 0.520000, "CBERS2_CCD_BLUE"));
-  spectralBandList.insertSpectralBand(TePDIMixModelSpectralBand(250, 3, 0.520000, 0.590000, "CBERS2_CCD_GREEN"));
-  spectralBandList.insertSpectralBand(TePDIMixModelSpectralBand(250, 4, 0.630000, 0.690000, "CBERS2_CCD_RED"));
-
-// Setting input rasters parameter
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string(TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r'));
-  TEAGN_TRUE_OR_THROW(inRaster->init(), "Unable to init input_raster" );
-  
-  for(unsigned int i = 0; i < spectralBandsNumber; i++)
-  {
-    input_rasters.push_back(inRaster);
-  }
-  
-// Setting number of bands in each input raster
-  std::vector<int> bands;
-  bands.push_back(0);
-  bands.push_back(1);
-  bands.push_back(2);
-
-// Setting output rasters parameter
-  TePDITypes::TePDIRasterVectorType output_rasters;
-  for(unsigned int i = 0; i < componentsNumber; i++)
-  {
-    TePDITypes::TePDIRasterPtrType outRaster;
-    TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster, 1, 1, 1, false, TeDOUBLE, 0), "RAM raster " + Te2String(i+1) + " alloc error" );
-    output_rasters.push_back(outRaster);
-  }
-
-  int  computeErrorRasters = 1,
-    computeAverageError = 1,
-    normalize = 0;
-
-// Setting the parameters created before
-  params.SetParameter("mixmodel_type", string("princo"));
-  params.SetParameter("component_list", componentList);
-  params.SetParameter("spectral_band_list", spectralBandList);
-  params.SetParameter("input_rasters", input_rasters);
-  params.SetParameter("bands", bands);
-  params.SetParameter("output_rasters", output_rasters);
-  params.SetParameter("compute_error_rasters", computeErrorRasters);
-  params.SetParameter("compute_average_error", computeAverageError);
-  params.SetParameter("normalize", normalize);
-
-// Checking if it's necessary to create error rasters
-  if (computeErrorRasters)
-  {
-    TePDITypes::TePDIRasterVectorType output_error_rasters;
-    for(unsigned int i = 0; i < componentsNumber; i++)
-    {
-      TePDITypes::TePDIRasterPtrType outRaster;
-      TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster, 1, 1, 1, false, TeDOUBLE, 0), "RAM error raster " + Te2String(i+1) + " alloc error" );
-      output_error_rasters.push_back(outRaster);
-    }
-    params.SetParameter("output_error_rasters", output_error_rasters);
-  }
-
-// Checking if it's necessary to create average error double
-  double averageError = 0.0;
-  if (computeAverageError)
-    params.SetParameter("average_error", averageError);
-
-// Making the algorithm and calling its execution
-  TePDIMixModel mixmodel;
-  TEAGN_TRUE_OR_THROW(mixmodel.Reset(params), "Reset failed");
-  TEAGN_TRUE_OR_THROW(mixmodel.Apply(), "Apply error");
-
-// Write output rasters in disk
-  TEAGN_TRUE_OR_THROW(params.GetParameter("output_rasters", output_rasters), "Unable to retrive generated images");
-  TEAGN_TRUE_OR_THROW(output_rasters.size() == componentsNumber, "Invalid output rasters number");
-  for(unsigned int i = 0; i < componentsNumber; i++)
-    TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_rasters[i], TEPDIEXAMPLESBINPATH "TePDIPrincoMixModel" + Te2String(i+1) + ".tif"), "GeoTIFF " + Te2String(i+1) + " generation error");
-
-// Write a color composite raster in disk  
-  TeRasterParams base_raster_params = input_rasters[0]->params();
-  base_raster_params.nBands( componentsNumber );
-  base_raster_params.setDataType( TeDOUBLE, -1 );
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster, 
-    base_raster_params, false ),
-    "RAM Color Raster Alloc error" );
-  for(int k = 0; k < componentsNumber; k++)
-    for (int i = 0; i < base_raster_params.nlines_; i++)
-      for (int j = 0; j < base_raster_params.ncols_; j++)
-      {
-        double p;
-        output_rasters[k]->getElement(j, i, p);
-        outRaster->setElement(j, i, p, k);
-      }
-  TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(outRaster, TEPDIEXAMPLESBINPATH "TePDIPrincoMixModelCOLOR.tif"), "GeoTIFF Color generation error");
-
-// Write output error rasters in disk
-  params.GetParameter("compute_error_rasters", computeErrorRasters);
-  if (computeErrorRasters)
-  {
-    TePDITypes::TePDIRasterVectorType output_error_rasters;
-    TEAGN_TRUE_OR_THROW(params.GetParameter("output_error_rasters", output_error_rasters), "Unable to retrive generated error rasters");
-    TEAGN_TRUE_OR_THROW(output_error_rasters.size() == componentsNumber, "Invalid output error rasters number");
-    for(unsigned int i = 0; i < componentsNumber; i++)
-      TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_error_rasters[i], TEPDIEXAMPLESBINPATH "TePDIPrincoMixModelError" + Te2String(i+1) + ".tif"), "GeoTIFF error " + Te2String(i+1) + " generation error");
-  }
-
-// Parameter don't come back after the algorithm execution
-  params.GetParameter("compute_average_error", computeAverageError);
-  if (computeAverageError)
-  {
-    TEAGN_TRUE_OR_THROW(params.GetParameter("average_error", averageError), "Unable to retrive average error");
-    //cout << "Average Erro = " << averageError << endl;
-  }
-
-}
-
-int main()
-{
-  TEAGN_LOGMSG("Test started.");
-  
-  try
-  {
-    TeInitRasterDecoders();
-    
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf(dynamic_cast< TeProgressBase* >(&pi));
-    
-    PrincoMixModel_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  } 
-  
-  TEAGN_LOGMSG("Test OK.");
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <vector>
+
+#include <TeInitRasterDecoders.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeRasterParams.h>
+#include <TePDITypes.hpp>
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+#include <TeRasterParams.h>
+#include <TePDIMixModel.hpp>
+#include <TePDIMixModelComponentList.hpp>
+#include <TePDIMixModelSpectralBandList.hpp>
+
+void PrincoMixModel_test()
+{
+  #define componentsNumber 3
+  #define spectralBandsNumber 3
+
+  TePDIParameters params;
+
+// ----- Setting spectralbands e components -----
+  TePDIMixModelComponentList componentList;
+  componentList.insertComponent(0, "nuvem");
+  componentList.insertPixel(0, 0, 1.000);
+  componentList.insertPixel(0, 1, 0.725);
+  componentList.insertPixel(0, 2, 1.000);
+  
+  componentList.insertComponent(1, "vegetacao");
+  componentList.insertPixel(1, 0, 0.392);
+  componentList.insertPixel(1, 1, 0.251);
+  componentList.insertPixel(1, 2, 0.604);
+  
+  componentList.insertComponent(2, "sombra");
+  componentList.insertPixel(2, 0, 0.165);
+  componentList.insertPixel(2, 1, 0.098);
+  componentList.insertPixel(2, 2, 0.196);
+  
+  TePDIMixModelSpectralBandList spectralBandList;
+  spectralBandList.insertSpectralBand(TePDIMixModelSpectralBand(250, 2, 0.450000, 0.520000, "CBERS2_CCD_BLUE"));
+  spectralBandList.insertSpectralBand(TePDIMixModelSpectralBand(250, 3, 0.520000, 0.590000, "CBERS2_CCD_GREEN"));
+  spectralBandList.insertSpectralBand(TePDIMixModelSpectralBand(250, 4, 0.630000, 0.690000, "CBERS2_CCD_RED"));
+
+// Setting input rasters parameter
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string(TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r'));
+  TEAGN_TRUE_OR_THROW(inRaster->init(), "Unable to init input_raster" );
+  
+  for(unsigned int i = 0; i < spectralBandsNumber; i++)
+  {
+    input_rasters.push_back(inRaster);
+  }
+  
+// Setting number of bands in each input raster
+  std::vector<int> bands;
+  bands.push_back(0);
+  bands.push_back(1);
+  bands.push_back(2);
+
+// Setting output rasters parameter
+  TePDITypes::TePDIRasterVectorType output_rasters;
+  for(unsigned int i = 0; i < componentsNumber; i++)
+  {
+    TePDITypes::TePDIRasterPtrType outRaster;
+    TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster, 1, 1, 1, false, TeDOUBLE, 0), "RAM raster " + Te2String(i+1) + " alloc error" );
+    output_rasters.push_back(outRaster);
+  }
+
+  int  computeErrorRasters = 1,
+    computeAverageError = 1,
+    normalize = 0;
+
+// Setting the parameters created before
+  params.SetParameter("mixmodel_type", string("princo"));
+  params.SetParameter("component_list", componentList);
+  params.SetParameter("spectral_band_list", spectralBandList);
+  params.SetParameter("input_rasters", input_rasters);
+  params.SetParameter("bands", bands);
+  params.SetParameter("output_rasters", output_rasters);
+  params.SetParameter("compute_error_rasters", computeErrorRasters);
+  params.SetParameter("compute_average_error", computeAverageError);
+  params.SetParameter("normalize", normalize);
+
+// Checking if it's necessary to create error rasters
+  if (computeErrorRasters)
+  {
+    TePDITypes::TePDIRasterVectorType output_error_rasters;
+    for(unsigned int i = 0; i < componentsNumber; i++)
+    {
+      TePDITypes::TePDIRasterPtrType outRaster;
+      TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster, 1, 1, 1, false, TeDOUBLE, 0), "RAM error raster " + Te2String(i+1) + " alloc error" );
+      output_error_rasters.push_back(outRaster);
+    }
+    params.SetParameter("output_error_rasters", output_error_rasters);
+  }
+
+// Checking if it's necessary to create average error double
+  double averageError = 0.0;
+  if (computeAverageError)
+    params.SetParameter("average_error", averageError);
+
+// Making the algorithm and calling its execution
+  TePDIMixModel mixmodel;
+  TEAGN_TRUE_OR_THROW(mixmodel.Reset(params), "Reset failed");
+  TEAGN_TRUE_OR_THROW(mixmodel.Apply(), "Apply error");
+
+// Write output rasters in disk
+  TEAGN_TRUE_OR_THROW(params.GetParameter("output_rasters", output_rasters), "Unable to retrive generated images");
+  TEAGN_TRUE_OR_THROW(output_rasters.size() == componentsNumber, "Invalid output rasters number");
+  for(unsigned int i = 0; i < componentsNumber; i++)
+    TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_rasters[i], TEPDIEXAMPLESBINPATH "TePDIPrincoMixModel" + Te2String(i+1) + ".tif"), "GeoTIFF " + Te2String(i+1) + " generation error");
+
+// Write a color composite raster in disk  
+  TeRasterParams base_raster_params = input_rasters[0]->params();
+  base_raster_params.nBands( componentsNumber );
+  base_raster_params.setDataType( TeDOUBLE, -1 );
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster, 
+    base_raster_params, false ),
+    "RAM Color Raster Alloc error" );
+  for(int k = 0; k < componentsNumber; k++)
+    for (int i = 0; i < base_raster_params.nlines_; i++)
+      for (int j = 0; j < base_raster_params.ncols_; j++)
+      {
+        double p;
+        output_rasters[k]->getElement(j, i, p);
+        outRaster->setElement(j, i, p, k);
+      }
+  TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(outRaster, TEPDIEXAMPLESBINPATH "TePDIPrincoMixModelCOLOR.tif"), "GeoTIFF Color generation error");
+
+// Write output error rasters in disk
+  params.GetParameter("compute_error_rasters", computeErrorRasters);
+  if (computeErrorRasters)
+  {
+    TePDITypes::TePDIRasterVectorType output_error_rasters;
+    TEAGN_TRUE_OR_THROW(params.GetParameter("output_error_rasters", output_error_rasters), "Unable to retrive generated error rasters");
+    TEAGN_TRUE_OR_THROW(output_error_rasters.size() == componentsNumber, "Invalid output error rasters number");
+    for(unsigned int i = 0; i < componentsNumber; i++)
+      TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(output_error_rasters[i], TEPDIEXAMPLESBINPATH "TePDIPrincoMixModelError" + Te2String(i+1) + ".tif"), "GeoTIFF error " + Te2String(i+1) + " generation error");
+  }
+
+// Parameter don't come back after the algorithm execution
+  params.GetParameter("compute_average_error", computeAverageError);
+  if (computeAverageError)
+  {
+    TEAGN_TRUE_OR_THROW(params.GetParameter("average_error", averageError), "Unable to retrive average error");
+    //cout << "Average Erro = " << averageError << endl;
+  }
+
+}
+
+int main()
+{
+  TEAGN_LOGMSG("Test started.");
+  
+  try
+  {
+    TeInitRasterDecoders();
+    
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf(dynamic_cast< TeProgressBase* >(&pi));
+    
+    PrincoMixModel_test();
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  } 
+  
+  TEAGN_LOGMSG("Test OK.");
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIMixModel/TePDIMixModel_test.vcproj b/examples/image_processing/source/TePDIMixModel/TePDIMixModel_test.vcproj
old mode 100755
new mode 100644
index 555b9b2..5cfb63f
--- a/examples/image_processing/source/TePDIMixModel/TePDIMixModel_test.vcproj
+++ b/examples/image_processing/source/TePDIMixModel/TePDIMixModel_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIMixModel_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIMixModel_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIMixModel_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIMixModel_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIMixModel_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIMixModel_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIMixModel_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIMixModel_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIMixModel_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIMixModel_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIMorfFilter/.cvsignore b/examples/image_processing/source/TePDIMorfFilter/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIMorfFilter/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter.pro b/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter.pro
old mode 100755
new mode 100644
index f170b22..3c3002d
--- a/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter.pro
+++ b/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter.pro
@@ -1,9 +1,9 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIMorfFilter_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/Dilation*.tif \
-  ../../bin/Erosion*.tif \
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIMorfFilter_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/Dilation*.tif \
+  ../../bin/Erosion*.tif \
   ../../bin/Median*.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter_test.cpp b/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter_test.cpp
old mode 100755
new mode 100644
index a2efcb3..22dad18
--- a/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter_test.cpp
+++ b/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter_test.cpp
@@ -1,769 +1,769 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-#include <TePDIMorfFilter.hpp>
-#include <TePDIFilterMask.hpp>
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-void Dilation_1_iteration_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMDilationType );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Dilation_test_1_iteration.tif" ), "GeoTIF generation error" );
-}
-
-
-void Dilation_2_iterations_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMDilationType );
-
-  params.SetParameter( "iterations", (int)2 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Dilation_test_2_iterations.tif" ), "GeoTIF generation error" );
-}
-
-
-void Dilation_3_iterations_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMDilationType );
-
-  params.SetParameter( "iterations", (int)3 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Dilation_test_3_iterations.tif" ), "GeoTIF generation error" );
-}
-
-
-void Dilation_4_iterations_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMDilationType );
-
-  params.SetParameter( "iterations", (int)4 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Dilation_test_4_iterations.tif" ), "GeoTIF generation error" );
-}
-
-
-void Dilation_with_dummy_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType diskRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( diskRaster->init(), "Unable to init diskRaster" );
-  
-  TePDITypes::TePDIRasterPtrType inRaster;
-  TeRasterParams inRaster_params = diskRaster->params();
-  inRaster_params.nBands( 3 );
-  inRaster_params.setDummy( 0, -1 );
-  inRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( inRaster,
-    inRaster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
-    "Unable to alloc RAM Raster" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
-    inRaster, 0, false, false ), "Unable to copy raster pixels" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
-    inRaster, 1, false, false ), "Unable to copy raster pixels" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
-    inRaster, 2, false, false ), "Unable to copy raster pixels" );
-  params.SetParameter( "input_image", inRaster );  
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  channels.push_back( 1 );
-  channels.push_back( 2 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMDilationType );
-
-  params.SetParameter( "iterations", (int)3 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Dilation_with_dummy_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Erosion_1_iteration_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMErosionType );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Erosion_1_iteration_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Erosion_2_iterations_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMErosionType );
-
-  params.SetParameter( "iterations", (int)2 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Erosion_2_iterations_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Erosion_3_iterations_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMErosionType );
-
-  params.SetParameter( "iterations", (int)3 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Erosion_3_iteration_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Erosion_4_iterations_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMErosionType );
-
-  params.SetParameter( "iterations", (int)4 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Erosion_4_iteration_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Erosion_with_dummy_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType diskRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( diskRaster->init(), "Unable to init diskRaster" );
-  
-  TePDITypes::TePDIRasterPtrType inRaster;
-  TeRasterParams inRaster_params = diskRaster->params();
-  inRaster_params.nBands( 3 );
-  inRaster_params.setDummy( 0, -1 );
-  inRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( inRaster,
-    inRaster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
-    "Unable to alloc RAM Raster" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
-    inRaster, 0, false, false ), "Unable to copy raster pixels" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
-    inRaster, 1, false, false ), "Unable to copy raster pixels" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
-    inRaster, 2, false, false ), "Unable to copy raster pixels" );
-  params.SetParameter( "input_image", inRaster );  
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  channels.push_back( 1 );
-  channels.push_back( 2 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMErosionType );
-
-  params.SetParameter( "iterations", (int)3 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Erosion_with_dummy_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Median_1_iteration_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMMedianType );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Median_1_iteration_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Median_2_iterations_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMMedianType );
-
-  params.SetParameter( "iterations", (int)2 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Median_2_iterations_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Median_3_iterations_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMMedianType );
-
-  params.SetParameter( "iterations", (int)3 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Median_3_iterations_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Median_4_iterations_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMMedianType );
-
-  params.SetParameter( "iterations", (int)4 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Median_4_iterations_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Median_with_dummy_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType diskRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( diskRaster->init(), "Unable to init diskRaster" );
-  
-  TePDITypes::TePDIRasterPtrType inRaster;
-  TeRasterParams inRaster_params = diskRaster->params();
-  inRaster_params.nBands( 3 );
-  inRaster_params.setDummy( 0, -1 );
-  inRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( inRaster,
-    inRaster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
-    "Unable to alloc RAM Raster" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
-    inRaster, 0, false, false ), "Unable to copy raster pixels" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
-    inRaster, 1, false, false ), "Unable to copy raster pixels" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
-    inRaster, 2, false, false ), "Unable to copy raster pixels" );
-  params.SetParameter( "input_image", inRaster );   
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  channels.push_back( 1 );
-  channels.push_back( 2 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMMedianType );
-
-  params.SetParameter( "iterations", (int)3 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Median_with_dummy_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void Mode_1_iteration_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", 
-    TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", 
-    TePDIMorfFilter::TePDIMModeType );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Mode_1_iteration_test.tif" ), 
-    "GeoTIF generation error" );
-}
-
-void Mode_2_iteration_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", 
-    TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", 
-    TePDIMorfFilter::TePDIMModeType );
-
-  params.SetParameter( "iterations", (int)2 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Mode_2_iteration_test.tif" ), 
-    "GeoTIF generation error" );
-}
-
-void Mode_3_iteration_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_mask", 
-    TePDIFilterMask::create_MorfMtot() );
-
-  params.SetParameter( "filter_type", 
-    TePDIMorfFilter::TePDIMModeType );
-
-  params.SetParameter( "iterations", (int)3 );
-
-  TePDIMorfFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Mode_3_iteration_test.tif" ), 
-    "GeoTIF generation error" );
-}
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
-
-    Mode_1_iteration_test();
-    Mode_2_iteration_test();
-    Mode_3_iteration_test();
-    Dilation_1_iteration_test();
-    Dilation_2_iterations_test();
-    Dilation_3_iterations_test();
-    Dilation_4_iterations_test();
-    Dilation_with_dummy_test();
-    Erosion_1_iteration_test();
-    Erosion_2_iterations_test();
-    Erosion_3_iterations_test();
-    Erosion_4_iterations_test();
-    Erosion_with_dummy_test();
-    Median_1_iteration_test();
-    Median_2_iterations_test();
-    Median_3_iterations_test();
-    Median_4_iterations_test();
-    Median_with_dummy_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  } 
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+#include <TePDIMorfFilter.hpp>
+#include <TePDIFilterMask.hpp>
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+void Dilation_1_iteration_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMDilationType );
+
+  params.SetParameter( "iterations", (int)1 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Dilation_test_1_iteration.tif" ), "GeoTIF generation error" );
+}
+
+
+void Dilation_2_iterations_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMDilationType );
+
+  params.SetParameter( "iterations", (int)2 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Dilation_test_2_iterations.tif" ), "GeoTIF generation error" );
+}
+
+
+void Dilation_3_iterations_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMDilationType );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Dilation_test_3_iterations.tif" ), "GeoTIF generation error" );
+}
+
+
+void Dilation_4_iterations_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMDilationType );
+
+  params.SetParameter( "iterations", (int)4 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Dilation_test_4_iterations.tif" ), "GeoTIF generation error" );
+}
+
+
+void Dilation_with_dummy_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType diskRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( diskRaster->init(), "Unable to init diskRaster" );
+  
+  TePDITypes::TePDIRasterPtrType inRaster;
+  TeRasterParams inRaster_params = diskRaster->params();
+  inRaster_params.nBands( 3 );
+  inRaster_params.setDummy( 0, -1 );
+  inRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( inRaster,
+    inRaster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
+    "Unable to alloc RAM Raster" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
+    inRaster, 0, false, false ), "Unable to copy raster pixels" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
+    inRaster, 1, false, false ), "Unable to copy raster pixels" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
+    inRaster, 2, false, false ), "Unable to copy raster pixels" );
+  params.SetParameter( "input_image", inRaster );  
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMDilationType );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Dilation_with_dummy_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Erosion_1_iteration_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMErosionType );
+
+  params.SetParameter( "iterations", (int)1 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Erosion_1_iteration_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Erosion_2_iterations_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMErosionType );
+
+  params.SetParameter( "iterations", (int)2 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Erosion_2_iterations_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Erosion_3_iterations_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMErosionType );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Erosion_3_iteration_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Erosion_4_iterations_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMErosionType );
+
+  params.SetParameter( "iterations", (int)4 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Erosion_4_iteration_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Erosion_with_dummy_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType diskRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( diskRaster->init(), "Unable to init diskRaster" );
+  
+  TePDITypes::TePDIRasterPtrType inRaster;
+  TeRasterParams inRaster_params = diskRaster->params();
+  inRaster_params.nBands( 3 );
+  inRaster_params.setDummy( 0, -1 );
+  inRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( inRaster,
+    inRaster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
+    "Unable to alloc RAM Raster" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
+    inRaster, 0, false, false ), "Unable to copy raster pixels" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
+    inRaster, 1, false, false ), "Unable to copy raster pixels" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
+    inRaster, 2, false, false ), "Unable to copy raster pixels" );
+  params.SetParameter( "input_image", inRaster );  
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMErosionType );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Erosion_with_dummy_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Median_1_iteration_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMMedianType );
+
+  params.SetParameter( "iterations", (int)1 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Median_1_iteration_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Median_2_iterations_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMMedianType );
+
+  params.SetParameter( "iterations", (int)2 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Median_2_iterations_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Median_3_iterations_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMMedianType );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Median_3_iterations_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Median_4_iterations_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMMedianType );
+
+  params.SetParameter( "iterations", (int)4 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Median_4_iterations_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Median_with_dummy_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType diskRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( diskRaster->init(), "Unable to init diskRaster" );
+  
+  TePDITypes::TePDIRasterPtrType inRaster;
+  TeRasterParams inRaster_params = diskRaster->params();
+  inRaster_params.nBands( 3 );
+  inRaster_params.setDummy( 0, -1 );
+  inRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( inRaster,
+    inRaster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
+    "Unable to alloc RAM Raster" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
+    inRaster, 0, false, false ), "Unable to copy raster pixels" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
+    inRaster, 1, false, false ), "Unable to copy raster pixels" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterPixels( diskRaster, 0,
+    inRaster, 2, false, false ), "Unable to copy raster pixels" );
+  params.SetParameter( "input_image", inRaster );   
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", TePDIMorfFilter::TePDIMMedianType );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Median_with_dummy_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void Mode_1_iteration_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", 
+    TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", 
+    TePDIMorfFilter::TePDIMModeType );
+
+  params.SetParameter( "iterations", (int)1 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Mode_1_iteration_test.tif" ), 
+    "GeoTIF generation error" );
+}
+
+void Mode_2_iteration_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", 
+    TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", 
+    TePDIMorfFilter::TePDIMModeType );
+
+  params.SetParameter( "iterations", (int)2 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Mode_2_iteration_test.tif" ), 
+    "GeoTIF generation error" );
+}
+
+void Mode_3_iteration_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_mask", 
+    TePDIFilterMask::create_MorfMtot() );
+
+  params.SetParameter( "filter_type", 
+    TePDIMorfFilter::TePDIMModeType );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  TePDIMorfFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Mode_3_iteration_test.tif" ), 
+    "GeoTIF generation error" );
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
+
+    Mode_1_iteration_test();
+    Mode_2_iteration_test();
+    Mode_3_iteration_test();
+    Dilation_1_iteration_test();
+    Dilation_2_iterations_test();
+    Dilation_3_iterations_test();
+    Dilation_4_iterations_test();
+    Dilation_with_dummy_test();
+    Erosion_1_iteration_test();
+    Erosion_2_iterations_test();
+    Erosion_3_iterations_test();
+    Erosion_4_iterations_test();
+    Erosion_with_dummy_test();
+    Median_1_iteration_test();
+    Median_2_iterations_test();
+    Median_3_iterations_test();
+    Median_4_iterations_test();
+    Median_with_dummy_test();
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  } 
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter_test.vcproj b/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter_test.vcproj
old mode 100755
new mode 100644
index 0bd2e59..05c6cb7
--- a/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter_test.vcproj
+++ b/examples/image_processing/source/TePDIMorfFilter/TePDIMorfFilter_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIMorfFilter_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIMorfFilter_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIMorfFilter_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIMorfFilter_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIMorfFilter_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIMorfFilter_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIMorfFilter_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIMorfFilter_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIMorfFilter_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIMorfFilter_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIMosaic/.cvsignore b/examples/image_processing/source/TePDIMosaic/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIMosaic/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIMosaic/TePDIMosaic.pro b/examples/image_processing/source/TePDIMosaic/TePDIMosaic.pro
old mode 100755
new mode 100644
index 4bd5f9f..2a961be
--- a/examples/image_processing/source/TePDIMosaic/TePDIMosaic.pro
+++ b/examples/image_processing/source/TePDIMosaic/TePDIMosaic.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIMosaic_test.cpp
-
-QMAKE_CLEAN += \
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIMosaic_test.cpp
+
+QMAKE_CLEAN += \
   ../../bin/Mosaic*.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIMosaic/TePDIMosaic_test.cpp b/examples/image_processing/source/TePDIMosaic/TePDIMosaic_test.cpp
old mode 100755
new mode 100644
index 39b9695..8d1a312
--- a/examples/image_processing/source/TePDIMosaic/TePDIMosaic_test.cpp
+++ b/examples/image_processing/source/TePDIMosaic/TePDIMosaic_test.cpp
@@ -1,233 +1,613 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-#include <TePDIGeoMosaic.hpp>
-#include <TePDIBatchGeoMosaic.hpp>
-
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-#include <vector> 
-
-void GeoMosaic_noblend_test()
-{
-  TePDIParameters params1;
-
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
-    "Unable to init input_raster1" );
-    
-  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
-    "Unable to init input_raster2" );    
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "output_raster Alloc error" );
-    
-  params1.SetParameter( "input_raster1" , input_raster1 );
-  params1.SetParameter( "input_raster2" , input_raster2 );
-  params1.SetParameter( "output_raster" , output_raster );
-  
-  std::vector< int > channels1;
-  channels1.push_back( 0 );
-  params1.SetParameter( "channels1" , channels1 );
-  
-  std::vector< int > channels2;
-  channels2.push_back( 0 );
-  params1.SetParameter( "channels2" , channels2 );
-  
-  params1.SetParameter( "blending_type" , std::string( "no_blending" ) );
-  params1.SetParameter( "dummy_value" , (double)0. );
-  params1.SetParameter( "keep_best_res" , (int)1 );
-  params1.SetParameter( "auto_equalize" , (int)1 );
-  
-  TePDIGeoMosaic mos;
-  TEAGN_TRUE_OR_THROW( mos.Reset(params1), "Reset failed" );
-  TEAGN_TRUE_OR_THROW( mos.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Mosaic_geo_noblend_test.tif" ), "GeoTIF generation error" );
-}
-
-void GeoMosaic_euclidian_test()
-{
-  TePDIParameters params1;
-
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
-    "Unable to init input_raster1" );
-    
-  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
-    "Unable to init input_raster2" );    
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "output_raster Alloc error" );
-    
-  params1.SetParameter( "input_raster1" , input_raster1 );
-  params1.SetParameter( "input_raster2" , input_raster2 );
-  params1.SetParameter( "output_raster" , output_raster );
-  
-  std::vector< int > channels1;
-  channels1.push_back( 0 );
-  params1.SetParameter( "channels1" , channels1 );
-  
-  std::vector< int > channels2;
-  channels2.push_back( 0 );
-  
-  params1.SetParameter( "channels2" , channels2 );
-  params1.SetParameter( "blending_type" , std::string( "euclidian_blending" ) );
-  params1.SetParameter( "dummy_value" , (double)0. );
-  params1.SetParameter( "auto_equalize" , (int)1 );  
-  
-  TePDIGeoMosaic mos;
-  TEAGN_TRUE_OR_THROW( mos.Reset(params1), "Reset failed" );
-  TEAGN_TRUE_OR_THROW( mos.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Mosaic_geo_euclidianblend_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void BatchGeoMosaic_noblend_test()
-{
-  TePDIParameters params1;
-
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
-    "Unable to init input_raster1" );
-    
-  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
-    "Unable to init input_raster2" ); 
-    
-  TePDITypes::TePDIRasterPtrType input_raster3( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_C.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster3->init(), 
-    "Unable to init input_raster2" );      
-    
-  std::vector< int > bands;
-  bands.push_back( 0 );   
-  bands.push_back( 0 );   
-  bands.push_back( 0 );   
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "output_raster Alloc error" );
-    
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  input_rasters.push_back( input_raster1 );
-  input_rasters.push_back( input_raster2 );
-  input_rasters.push_back( input_raster3 );
-    
-  params1.SetParameter( "input_rasters" , input_rasters );
-  params1.SetParameter( "bands" , bands );
-  params1.SetParameter( "output_raster" , output_raster );
-  params1.SetParameter( "blending_type" , std::string( "no_blending" ) );
-  params1.SetParameter( "dummy_value" , (double)0. );
-  params1.SetParameter( "auto_equalize" , (int)1 );
-  
-  TePDIBatchGeoMosaic mos;
-  TEAGN_TRUE_OR_THROW( mos.Reset(params1), "Reset failed" );
-  TEAGN_TRUE_OR_THROW( mos.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Mosaic_batchgeo_noblend_test.tif" ), "GeoTIF generation error" );
-}
-
-
-
-void BatchGeoMosaic_euclidian_test()
-{
-  TePDIParameters params1;
-
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
-    "Unable to init input_raster1" );
-    
-  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
-    "Unable to init input_raster2" ); 
-    
-  TePDITypes::TePDIRasterPtrType input_raster3( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_C.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster3->init(), 
-    "Unable to init input_raster2" );      
-    
-  std::vector< int > bands;
-  bands.push_back( 0 );   
-  bands.push_back( 0 );   
-  bands.push_back( 0 );   
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "output_raster Alloc error" );
-    
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  input_rasters.push_back( input_raster1 );
-  input_rasters.push_back( input_raster2 );
-  input_rasters.push_back( input_raster3 );
-    
-  params1.SetParameter( "input_rasters" , input_rasters );
-  params1.SetParameter( "bands" , bands );
-  params1.SetParameter( "output_raster" , output_raster );
-  params1.SetParameter( "blending_type" , std::string( "euclidian_blending" ) );
-  params1.SetParameter( "dummy_value" , (double)0. );
-  params1.SetParameter( "auto_equalize" , (int)1 );
-  
-  TePDIBatchGeoMosaic mos;
-  TEAGN_TRUE_OR_THROW( mos.Reset(params1), "Reset failed" );
-  TEAGN_TRUE_OR_THROW( mos.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Mosaic_batchgeo_euclidianblend_test.tif" ), "GeoTIF generation error" );
-}
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeInitRasterDecoders();
-    
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-
-    GeoMosaic_noblend_test();
-    BatchGeoMosaic_noblend_test();
-    
-    GeoMosaic_euclidian_test();
-    BatchGeoMosaic_euclidian_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  } 
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIBlender.hpp>
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+#include <TePDIGeoMosaic.hpp>
+#include <TePDIBatchGeoMosaic.hpp>
+#include <TePDITPMosaic.hpp>
+
+#include <TeInitRasterDecoders.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+#include <vector> 
+
+void TPMosaic_test1()
+{
+  // Initiating images
+  
+  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_C.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
+    "Unable to init input_raster1" );
+    
+  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
+    "Unable to init input_raster2" );    
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );
+    
+  // The geometric transformation parameters telling how the input rasters are 
+  // overlapped
+  
+  TeGTParams trans_params;
+  trans_params.transformation_name_ = "affine";
+  trans_params.out_rem_strat_ = TeGTParams::NoOutRemotion;  
+  
+  TeCoordPair auxPair;
+  
+  auxPair.pt1.setXY( 36,234 ); // point over input image 1
+  auxPair.pt2.setXY( 245,21 ); // the corresponding point over input image 2
+  trans_params.tiepoints_.push_back( auxPair );
+  
+  auxPair.pt1.setXY( 319,252 );
+  auxPair.pt2.setXY( 528,39 );
+  trans_params.tiepoints_.push_back( auxPair );  
+  
+  auxPair.pt1.setXY( 136,416 );
+  auxPair.pt2.setXY( 345,203 );
+  trans_params.tiepoints_.push_back( auxPair );
+      
+  // Other parameters
+  
+  std::vector< unsigned int > channels1;
+  channels1.push_back( 0 );  
+  
+  std::vector< unsigned int > channels2;
+  channels2.push_back( 0 );  
+    
+  // Creating algorithm parameters
+    
+  TePDIParameters params;
+  params.SetParameter( "input_raster1" , input_raster1 );
+  params.SetParameter( "input_raster2" , input_raster2 );
+  params.SetParameter( "channels1" , channels1 );
+  params.SetParameter( "channels2" , channels2 );
+  params.SetParameter( "output_raster" , output_raster );
+  params.SetParameter( "trans_params" , trans_params );
+  params.SetParameter( "blend_method", TePDIBlender::EuclideanBlendMethod );
+  params.SetParameter( "interp_method", TePDIInterpolator::NNMethod );
+  params.SetParameter( "dummy_value" , (double)0.0 );
+  params.SetParameter( "auto_equalize" , (int)1 );
+  
+  TePDITPMosaic mos;
+  TEAGN_TRUE_OR_THROW( mos.Apply( params ), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDITPMosaic_test1.tif" ), "GeoTIF generation error" );
+}
+
+// non-overlapped images test (simulated)
+void TPMosaic_test2()
+{
+  // Initiating images
+  
+  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
+    "Unable to init input_raster1" );
+    
+  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop2.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
+    "Unable to init input_raster2" );    
+    
+  // pre-initializing the output raster
+  
+  TeRasterParams outputRasterParams;
+  outputRasterParams.setDataType( TeUNSIGNEDCHAR, 1 );
+  outputRasterParams.setNLinesNColumns( 1, 1 );
+  outputRasterParams.nBands( 3 );
+  outputRasterParams.setPhotometric( TeRasterParams::TeRGB, -1 );  
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputRasterParams,
+    output_raster ), "outputRaster creation error" );
+    
+  // The geometric transformation parameters telling how the input rasters are 
+  // overlapped
+  
+  TeGTParams trans_params;
+  trans_params.transformation_name_ = "affine";
+  trans_params.out_rem_strat_ = TeGTParams::NoOutRemotion;  
+  
+  TeCoordPair auxPair;
+  
+  auxPair.pt1.setXY( 885,0 ); // point over input image 1
+  auxPair.pt2.setXY( 0,0 ); // TopLeft - image 2
+  trans_params.tiepoints_.push_back( auxPair );
+  
+  auxPair.pt1.setXY( 885 + 838,0 );
+  auxPair.pt2.setXY( 837,0 ); // TopRight - image 2
+  trans_params.tiepoints_.push_back( auxPair );  
+  
+  auxPair.pt1.setXY( 885,1009 );
+  auxPair.pt2.setXY( 0,1008 ); // LowerLeft - image 2
+  trans_params.tiepoints_.push_back( auxPair );  
+  
+  auxPair.pt1.setXY( 885 + 838,1009 );
+  auxPair.pt2.setXY( 837,1008 ); // LowerRight - image 2
+  trans_params.tiepoints_.push_back( auxPair ); 
+      
+  // Other parameters
+  
+  std::vector< unsigned int > channels1;
+  channels1.push_back( 0 );
+  channels1.push_back( 1 );  
+  channels1.push_back( 2 );    
+  
+  std::vector< unsigned int > channels2;
+  channels2.push_back( 0 );
+  channels2.push_back( 1 );  
+  channels2.push_back( 2 );    
+    
+  // Creating algorithm parameters
+    
+  TePDIParameters params;
+  params.SetParameter( "input_raster1" , input_raster1 );
+  params.SetParameter( "input_raster2" , input_raster2 );
+  params.SetParameter( "channels1" , channels1 );
+  params.SetParameter( "channels2" , channels2 );
+  params.SetParameter( "output_raster" , output_raster );
+  params.SetParameter( "trans_params" , trans_params );
+  params.SetParameter( "blend_method", TePDIBlender::EuclideanBlendMethod );
+  params.SetParameter( "interp_method", TePDIInterpolator::NNMethod );
+  params.SetParameter( "dummy_value" , (double)0.0 );
+  params.SetParameter( "auto_equalize" , (int)1 );
+  
+  TePDITPMosaic mos;
+  TEAGN_TRUE_OR_THROW( mos.Apply( params ), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDITPMosaic_test2.tif" ), "GeoTIF generation error" );
+}
+
+void GeoMosaic_test1()
+{
+  // Initiating images
+  
+  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
+    "Unable to init input_raster1" );
+    
+  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
+    "Unable to init input_raster2" );    
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );
+    
+  // Creating algorithm parameters
+    
+  TePDIParameters params;
+    
+  params.SetParameter( "blend_method", TePDIBlender::EuclideanBlendMethod );
+  params.SetParameter( "input_raster1" , input_raster1 );
+  params.SetParameter( "input_raster2" , input_raster2 );
+  params.SetParameter( "output_raster" , output_raster );
+  
+  std::vector< unsigned int > channels1;
+  channels1.push_back( 0 );
+  params.SetParameter( "channels1" , channels1 );
+  
+  std::vector< unsigned int > channels2;
+  channels2.push_back( 0 );
+  params.SetParameter( "channels2" , channels2 );
+  
+  params.SetParameter( "interp_method", TePDIInterpolator::BilinearMethod );
+  params.SetParameter( "dummy_value" , (double)0. );
+  params.SetParameter( "auto_equalize" , (int)1 );
+  
+  TePDIGeoMosaic mos;
+  TEAGN_TRUE_OR_THROW( mos.Apply( params ), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDIGeoMosaic_test1.tif" ), "GeoTIF generation error" );
+}
+
+void GeoMosaic_test2()
+{
+  // Initiating images
+  
+  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_C.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
+    "Unable to init input_raster1" );
+    
+  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
+    "Unable to init input_raster2" );    
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );
+    
+  // Creating algorithm parameters
+    
+  TePDIParameters params;
+    
+  params.SetParameter( "blend_method", TePDIBlender::EuclideanBlendMethod );
+  params.SetParameter( "input_raster1" , input_raster1 );
+  params.SetParameter( "input_raster2" , input_raster2 );
+  params.SetParameter( "output_raster" , output_raster );
+  
+  std::vector< unsigned int > channels1;
+  channels1.push_back( 0 );
+  params.SetParameter( "channels1" , channels1 );
+  
+  std::vector< unsigned int > channels2;
+  channels2.push_back( 0 );
+  params.SetParameter( "channels2" , channels2 );
+  
+  params.SetParameter( "interp_method", TePDIInterpolator::BilinearMethod );
+  params.SetParameter( "dummy_value" , (double)0. );
+  params.SetParameter( "auto_equalize" , (int)1 );
+  
+  TePDIGeoMosaic mos;
+  TEAGN_TRUE_OR_THROW( mos.Apply( params ), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDIGeoMosaic_test2.tif" ), "GeoTIF generation error" );
+}
+
+// Non-overlapped images test
+void GeoMosaic_test3()
+{
+  // Initiating images
+  
+  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip0_0.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
+    "Unable to init input_raster1" );
+    
+  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip500_500.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
+    "Unable to init input_raster2" );  
+      
+  // pre-initializing the output raster
+  
+  TeRasterParams outputRasterParams;
+  outputRasterParams.setDataType( TeUNSIGNEDCHAR, 1 );
+  outputRasterParams.setNLinesNColumns( 1, 1 );
+  outputRasterParams.nBands( 3 );
+  outputRasterParams.setPhotometric( TeRasterParams::TeRGB, -1 );  
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputRasterParams,
+    output_raster ), "outputRaster creation error" );      
+    
+  // Creating algorithm parameters
+    
+  TePDIParameters params;
+    
+  params.SetParameter( "blend_method", TePDIBlender::EuclideanBlendMethod );
+  params.SetParameter( "input_raster1" , input_raster1 );
+  params.SetParameter( "input_raster2" , input_raster2 );
+  params.SetParameter( "output_raster" , output_raster );
+  
+  std::vector< unsigned int > channels1;
+  channels1.push_back( 0 );
+  channels1.push_back( 1 );
+  channels1.push_back( 2 );
+  params.SetParameter( "channels1" , channels1 );
+  
+  std::vector< unsigned int > channels2;
+  channels2.push_back( 0 );
+  channels2.push_back( 1 );
+  channels2.push_back( 2 );
+  params.SetParameter( "channels2" , channels2 );
+  
+  params.SetParameter( "interp_method", TePDIInterpolator::BilinearMethod );
+  params.SetParameter( "dummy_value" , (double)0. );
+  //params.SetParameter( "auto_equalize" , (int)1 );
+  
+  TePDIGeoMosaic mos;
+  TEAGN_TRUE_OR_THROW( mos.Apply( params ), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDIGeoMosaic_test3.tif" ), "GeoTIF generation error" );
+}
+
+// Testing images with different resolutions
+void GeoMosaic_test4()
+{
+  // Initiating images
+  
+  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_halfsampled_cropB.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
+    "Unable to init input_raster1" );
+    
+  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_cropA.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
+    "Unable to init input_raster2" );    
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );
+    
+  // Creating algorithm parameters
+    
+  TePDIParameters params;
+    
+  params.SetParameter( "blend_method", TePDIBlender::EuclideanBlendMethod );
+  params.SetParameter( "input_raster1" , input_raster1 );
+  params.SetParameter( "input_raster2" , input_raster2 );
+  params.SetParameter( "output_raster" , output_raster );
+  
+  std::vector< unsigned int > channels1;
+  channels1.push_back( 2 );
+  params.SetParameter( "channels1" , channels1 );
+  
+  std::vector< unsigned int > channels2;
+  channels2.push_back( 0 );
+  params.SetParameter( "channels2" , channels2 );
+  
+  params.SetParameter( "interp_method", TePDIInterpolator::NNMethod );
+  params.SetParameter( "dummy_value" , (double)0. );
+  //params.SetParameter( "auto_equalize" , (int)1 );
+  
+  TePDIGeoMosaic mos;
+  TEAGN_TRUE_OR_THROW( mos.Apply( params ), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDIGeoMosaic_test4.tif" ), "GeoTIF generation error" );
+}
+
+void BatchGeoMosaic_test1()
+{
+  TePDIParameters params1;
+
+  /* Building rasters */
+
+  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
+    "Unable to init input_raster1" );
+    
+  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
+    "Unable to init input_raster2" ); 
+    
+  TePDITypes::TePDIRasterPtrType input_raster3( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_C.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster3->init(), 
+    "Unable to init input_raster2" );      
+    
+  std::vector< unsigned int > bands;
+  bands.push_back( 0 );  // from raster 1
+  bands.push_back( 0 );  // from raster 2 
+  bands.push_back( 0 );  // from raster 3 
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "output_raster Alloc error" );
+    
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( input_raster1 );
+  input_rasters.push_back( input_raster2 );
+  input_rasters.push_back( input_raster3 );
+  
+  // Building algorithm parameters
+    
+  TePDIParameters params;
+  params.SetParameter( "input_rasters" , input_rasters );
+  params.SetParameter( "bands" , bands );
+  params.SetParameter( "output_raster" , output_raster );
+  params.SetParameter( "blend_method", TePDIBlender::EuclideanBlendMethod );
+  params.SetParameter( "interp_method", TePDIInterpolator::BilinearMethod );
+  params.SetParameter( "dummy_value" , (double)0. );
+  params.SetParameter( "auto_equalize" , (int)1 );
+  
+  TePDIBatchGeoMosaic mos;
+  TEAGN_TRUE_OR_THROW( mos.Apply( params ), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDIBatchGeoMosaic_test1.tif" ), 
+    "GeoTIF generation error" );
+}
+
+// Non-overlapped images test
+void BatchGeoMosaic_test2()
+{
+  TePDIParameters params1;
+
+  /* Initializing input rasters */
+
+  TePDITypes::TePDIRasterPtrType input_raster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip0_0.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster1->init(), 
+    "Unable to init input raster" );
+    
+  TePDITypes::TePDIRasterPtrType input_raster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip0_250.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster2->init(), 
+    "Unable to init input raster" ); 
+    
+  TePDITypes::TePDIRasterPtrType input_raster3( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip0_500.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster3->init(), 
+    "Unable to init input raster" );      
+    
+  TePDITypes::TePDIRasterPtrType input_raster4( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip0_750.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster4->init(), 
+    "Unable to init input raster" );      
+    
+  TePDITypes::TePDIRasterPtrType input_raster5( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip250_0.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster5->init(), 
+    "Unable to init input raster" );      
+    
+  TePDITypes::TePDIRasterPtrType input_raster6( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip250_250.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster6->init(), 
+    "Unable to init input raster" );      
+    
+  TePDITypes::TePDIRasterPtrType input_raster7( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip250_500.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster7->init(), 
+    "Unable to init input raster" );      
+    
+  TePDITypes::TePDIRasterPtrType input_raster8( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip250_750.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster8->init(), 
+    "Unable to init input raster" );      
+    
+  TePDITypes::TePDIRasterPtrType input_raster9( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip500_0.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster9->init(), 
+    "Unable to init input raster" );      
+    
+  TePDITypes::TePDIRasterPtrType input_raster10( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip500_250.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster10->init(), 
+    "Unable to init input raster" );      
+    
+  TePDITypes::TePDIRasterPtrType input_raster11( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip500_500.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster11->init(), 
+    "Unable to init input raster" );      
+    
+  TePDITypes::TePDIRasterPtrType input_raster12( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip500_750.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster12->init(), 
+    "Unable to init input raster" );      
+    
+  // Input bands from each raster  
+    
+  std::vector< unsigned int > bands;
+  
+  bands.push_back( 0 );  // from raster 0 
+  bands.push_back( 1 );  // from raster 0 
+  bands.push_back( 2 );  // from raster 0
+  
+  bands.push_back( 0 );  // from raster 1 
+  bands.push_back( 1 );  // from raster 1 
+  bands.push_back( 2 );  // from raster 1 
+  
+  bands.push_back( 0 );  // from raster 2 
+  bands.push_back( 1 );  // from raster 2 
+  bands.push_back( 2 );  // from raster 2 
+  
+  bands.push_back( 0 );   
+  bands.push_back( 1 );   
+  bands.push_back( 2 );   
+  
+  bands.push_back( 0 );   
+  bands.push_back( 1 );   
+  bands.push_back( 2 );  
+   
+  bands.push_back( 0 );   
+  bands.push_back( 1 );   
+  bands.push_back( 2 );  
+   
+  bands.push_back( 0 );   
+  bands.push_back( 1 );   
+  bands.push_back( 2 );  
+   
+  bands.push_back( 0 );   
+  bands.push_back( 1 );   
+  bands.push_back( 2 );  
+   
+  bands.push_back( 0 );   
+  bands.push_back( 1 );   
+  bands.push_back( 2 );  
+   
+  bands.push_back( 0 );   
+  bands.push_back( 1 );   
+  bands.push_back( 2 );   
+  
+  bands.push_back( 0 );   
+  bands.push_back( 1 );   
+  bands.push_back( 2 ); 
+    
+  bands.push_back( 0 );   
+  bands.push_back( 1 );   
+  bands.push_back( 2 );   
+  
+  // pre-initializing the output raster
+  
+  TeRasterParams outputRasterParams;
+  outputRasterParams.setDataType( TeUNSIGNEDCHAR, 1 );
+  outputRasterParams.setNLinesNColumns( 1, 1 );
+  outputRasterParams.nBands( 3 );
+  outputRasterParams.setPhotometric( TeRasterParams::TeRGB, -1 );  
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputRasterParams,
+    output_raster ), "outputRaster creation error" );     
+    
+  // Creating the input rasters pointers vector
+    
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  input_rasters.push_back( input_raster1 );
+  input_rasters.push_back( input_raster2 );
+  input_rasters.push_back( input_raster3 );
+  input_rasters.push_back( input_raster4 );
+  input_rasters.push_back( input_raster5 );
+  input_rasters.push_back( input_raster6 );
+  input_rasters.push_back( input_raster7 );
+  input_rasters.push_back( input_raster8 );
+  input_rasters.push_back( input_raster9 );
+  input_rasters.push_back( input_raster10 );
+  input_rasters.push_back( input_raster11 );
+  input_rasters.push_back( input_raster12 );
+  
+  // Building algorithm parameters
+    
+  TePDIParameters params;
+  params.SetParameter( "input_rasters" , input_rasters );
+  params.SetParameter( "bands" , bands );
+  params.SetParameter( "output_raster" , output_raster );
+  params.SetParameter( "blend_method", TePDIBlender::NoBlendMethod );
+  //params.SetParameter( "blend_method", TePDIBlender::MeanBlendMethod );
+  //params.SetParameter( "blend_method", TePDIBlender::EuclideanBlendMethod );
+  //params.SetParameter( "interp_method", TePDIInterpolator::NNMethod );
+  //params.SetParameter( "interp_method", TePDIInterpolator::BilinearMethod );
+  params.SetParameter( "interp_method", TePDIInterpolator::BicubicMethod );
+  params.SetParameter( "dummy_value" , (double)0. );
+  params.SetParameter( "auto_equalize" , (int)1 );
+  
+  TePDIBatchGeoMosaic mos;
+  TEAGN_TRUE_OR_THROW( mos.Apply( params ), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDIBatchGeoMosaic_test2.tif" ), 
+    "GeoTIF generation error" );
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  TeStdIOProgress pi;
+  TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+
+  GeoMosaic_test4();
+  BatchGeoMosaic_test2();
+  GeoMosaic_test3();
+  TPMosaic_test2();
+  TPMosaic_test1();
+  GeoMosaic_test1();
+  GeoMosaic_test2();
+  BatchGeoMosaic_test1();
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIMosaic/TePDIMosaic_test.vcproj b/examples/image_processing/source/TePDIMosaic/TePDIMosaic_test.vcproj
old mode 100755
new mode 100644
index 68cec50..29195c0
--- a/examples/image_processing/source/TePDIMosaic/TePDIMosaic_test.vcproj
+++ b/examples/image_processing/source/TePDIMosaic/TePDIMosaic_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIMosaic_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIMosaic_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIMosaic_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIMosaic_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIMosaic_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIMosaic_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIMosaic_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIMosaic_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIMosaic_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIMosaic_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIOFMatching/.cvsignore b/examples/image_processing/source/TePDIOFMatching/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIOFMatching/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching.pro b/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching.pro
index 3f785d6..1aa8d7b 100644
--- a/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching.pro
+++ b/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIOFMatching_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/TePDIOFMatching*.tif
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIOFMatching_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/TePDIOFMatching*.tif
diff --git a/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching_test.cpp b/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching_test.cpp
index c439872..bebde41 100644
--- a/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching_test.cpp
+++ b/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching_test.cpp
@@ -1,903 +1,964 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIOFMatching.hpp>
-#include <TePDIUtils.hpp>
-
-#include <TeGTParams.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeAgnostic.h>
-#include <TeDefines.h>
-
-#include <math.h>
-
-#ifndef M_PI
-  #define M_PI       3.14159265358979323846
-#endif
-#ifndef M_PI_2
-  #define M_PI_2     1.57079632679489661923
-#endif
-#ifndef M_PI_4
-  #define M_PI_4     0.785398163397448309616
-#endif
-
-void raster2Tiff( 
-  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-  unsigned int raster_channel,
-  const std::string& out_file_name,
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr,
-  unsigned int tie_points_space )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
-    "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
-    "Invalid matrix cols" )
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
-    input_raster_ptr->params().ncols_ );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  double value = 0;
-  
-  for( int line = 0 ; 
-    line < input_raster_ptr->params().nlines_ ; ++line ) {
-    for( int col = 0 ; 
-      col < input_raster_ptr->params().ncols_ ; 
-      ++col ) {
-      
-      input_raster_ptr->getElement( col, line, value, 
-        raster_channel );
-      
-
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        value, 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw tie-points */
-  
-  if( out_tie_points_ptr.isActive() ) {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      int x = 0;
-      int y = 0;
-      
-      if( tie_points_space == 0 ) {
-         x = TeRound( it->pt1.x() );
-         y = TeRound( it->pt1.y() );
-      } else {
-         x = TeRound( it->pt2.x() );
-         y = TeRound( it->pt2.y() );
-      }
-      
-      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
-        "Invalid maxima column" )
-      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-        "Invalid maxima column" )      
-      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
-        "Invalid maxima line" )
-      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-        "Invalid maxima line" )      
-      
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-        255.0, 0 ),
-        "Error writing raster" )    
-    
-      ++it;
-    }
-  
-  }
-}
-
-
-void rotateRasterClockWize( 
-  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-  const TePDITypes::TePDIRasterPtrType& output_raster_ptr,
-  double angle )
-{
-  TEAGN_TRUE_OR_THROW( input_raster_ptr.isActive(),
-    "Invalid input pointer" );
-  TEAGN_TRUE_OR_THROW( output_raster_ptr.isActive(),
-    "Invalid output pointer" );    
-    
-  const double input_raster_lines = 
-    (double)input_raster_ptr->params().nlines_;
-  const double input_raster_cols = 
-    (double)input_raster_ptr->params().ncols_;
-  const unsigned int input_raster_channels =
-    (unsigned int)input_raster_ptr->nBands();
-    
-  const double last_x_idx = input_raster_cols - 1.0;
-  const double last_y_idx = input_raster_lines - 1.0;
-    
-  const double angle_cos = cos( angle );
-  const double angle_sin = sin( angle );
-  
-  /* Calc new image geometry */
-    
-  double min_x = MIN( 0.0, ( angle_cos * last_x_idx ) - 
-    ( angle_sin * last_y_idx ) );
-  min_x = MIN( min_x, ( angle_cos * last_x_idx ) );
-  min_x = MIN( min_x, ( -1.0 * angle_sin * last_y_idx ) );
-  
-  double max_x = MAX( 0.0, ( angle_cos * last_x_idx ) - 
-    ( angle_sin * last_y_idx ) );
-  max_x = MAX( max_x, ( angle_cos * last_x_idx ) );
-  max_x = MAX( max_x, ( -1.0 * angle_sin * last_y_idx ) );
-  
-  double min_y = MIN( 0.0, ( angle_sin * last_x_idx ) + 
-    ( angle_cos * last_y_idx ) );
-  min_y = MIN( min_y, ( angle_sin * last_x_idx ) );
-  min_y = MIN( min_y, ( angle_cos * last_y_idx ) );
-  
-  double max_y = MAX( 0.0, ( angle_sin * last_x_idx ) + 
-    ( angle_cos * last_y_idx ) );
-  max_y = MAX( max_y, ( angle_sin * last_x_idx ) );
-  max_y = MAX( max_y, ( angle_cos * last_y_idx ) );
-  
-  const unsigned int out_lines = (unsigned int) ceil(
-    max_y - min_y );
-  const unsigned int out_cols = (unsigned int) ceil(
-    max_x - min_x );
-    
-  /* reseting output raster */
-  
-  TeCoord2D ll_point_input_ref_indexed( min_x,
-    max_y );
-  TeCoord2D ur_point_input_ref_indexed( max_x,
-    min_y );
-    
-  TeCoord2D ll_point_input_ref = 
-    input_raster_ptr->index2Coord( ll_point_input_ref_indexed );
-  TeCoord2D ur_point_input_ref = 
-    input_raster_ptr->index2Coord( ur_point_input_ref_indexed );    
-  
-  TeRasterParams new_out_params = output_raster_ptr->params();
-  
-  new_out_params.boundingBoxLinesColumns(
-    ll_point_input_ref.x(), ll_point_input_ref.y(),
-    ur_point_input_ref.x(), ur_point_input_ref.y(),
-    out_lines, out_cols );
-    
-  TEAGN_TRUE_OR_THROW( output_raster_ptr->init( new_out_params ),
-    "Error reseting output raster" )
-  
-  /* remapping pixels */
-    
-  unsigned int curr_out_x = 0;
-  unsigned int curr_out_y = 0;
-  double value = 0;
-  unsigned int curr_in_x = 0;
-  unsigned int curr_in_y = 0;
-  unsigned int curr_channel = 0;
-  
-  for( curr_channel = 0 ; curr_channel < input_raster_channels ;
-    ++curr_channel ) {
-    for( curr_out_y = 0 ; curr_out_y < out_lines ; ++curr_out_y ) {
-      for( curr_out_x = 0 ; curr_out_x < out_cols ; ++curr_out_x ) {
-        curr_in_x = 
-          TeRound( 
-            ( angle_cos * ( curr_out_x + min_x ) ) + 
-            ( angle_sin * ( curr_out_y + min_y ) )
-          );
-        curr_in_y = 
-          TeRound( 
-            ( -1.0 * angle_sin * ( curr_out_x + min_x ) ) + 
-            ( angle_cos * ( curr_out_y + min_y ) )
-          );
-        
-        if( input_raster_ptr->getElement( curr_in_x, curr_in_y,
-          value, curr_channel ) ) {
-        
-          output_raster_ptr->setElement( curr_out_x, curr_out_y,
-            value, curr_channel );
-        } else {
-          output_raster_ptr->setElement( curr_out_x, curr_out_y,
-            0, curr_channel );        
-        }
-      }
-    }
-  }
-  
-  return;
-}
-
-
-void sameImageAndBoxesTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 1.0;
-  gt_params.max_imap_error_ = 1.0;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1_proj = input_image1_ptr->params().box();
-  TeBox input_box1;
-  TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, 
-    input_image1_ptr, input_box1 );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  params.SetParameter( "input_box2" , input_box1 );
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)529 ); 
-  params.SetParameter( "corr_sens" , (double)0.5 );
-  params.SetParameter( "corr_window_width" , (unsigned int)21 );
-  params.SetParameter( "maximas_sens" , (double)0.02 );
-  
-  TeGTParams::pointer out_gt_params_ptr( new TeGTParams );
-  params.SetParameter( "out_gt_params_ptr" , out_gt_params_ptr );
-  
-  TePDIOFMatching match_instance; 
-  match_instance.ToggleProgInt( false );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC ;
-  
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageAndBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_sameImageAndBoxesTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_sameImageAndBoxesTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  /* Checking tie-points */
-  
-  TEAGN_WATCH( (unsigned int) out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 389, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )      
-  
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0, 
-        "Invalid tie-point" )
-      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0, 
-        "Invalid tie-point" )
-      
-      ++it;
-    }
-  }    
-}
-
-
-void sameImageDifBoxesTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 1.0;
-  gt_params.max_imap_error_ = 1.0;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1( TeCoord2D( 0, 760 ) , TeCoord2D( 680, 0 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( 
-    TeCoord2D( 190, input_image1_ptr->params().nlines_ - 1 ) , 
-    TeCoord2D( input_image1_ptr->params().ncols_ - 1, 227 ) );
-  params.SetParameter( "input_box2" , input_box2 );   
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)1 ); 
-  params.SetParameter( "pixel_y_relation" , (double)1 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)529 ); 
-  params.SetParameter( "corr_sens" , (double)0.5 );
-  params.SetParameter( "corr_window_width" , (unsigned int)21 );
-  params.SetParameter( "maximas_sens" , (double)0.02 );
-  
-  TePDIOFMatching match_instance; 
-  match_instance.ToggleProgInt( false );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-        Te2String( it->pt1.y(),1 ) + "] -> [" +
-        Te2String( it->pt2.x(),1 ) + " , " + 
-        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-      
-      ++it;
-    }
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_sameImageDifBoxesTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_sameImageDifBoxesTest_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 98, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )    
-}
-
-
-void halfsampledImageTest()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( 
-    TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
-    'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 1.0;
-  gt_params.max_imap_error_ = 1.0;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1( TeCoord2D( 122.0, 698.0 ), 
-    TeCoord2D( 730.0, 138.0 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 110.0, 305.0 ), 
-    TeCoord2D( 385.0, 50.0 ) );
-  params.SetParameter( "input_box2" , input_box2 );   
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  params.SetParameter( "corr_window_width" , (unsigned int)21 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
-  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)529 ); 
-  params.SetParameter( "corr_sens" , (double)0.5 );
-  params.SetParameter( "maximas_sens" , (double)0.02 );
-  
-  TePDIOFMatching match_instance; 
-  match_instance.ToggleProgInt( false );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (halfsampledImageTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  
-  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-  
-  while( it != it_end ) {
-    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-      Te2String( it->pt1.y(),1 ) + "] -> [" +
-      Te2String( it->pt2.x(),1 ) + " , " + 
-      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-    
-    ++it;
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_halfsampledImageTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_halfsampledImageTest_input_image2.tif",
-    out_tie_points_ptr, 1 );  
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 130, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )         
-}
-
-
-void halfsampledImageTest2()
-{
-  /* Creating parameters */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
-    std::string( 
-    TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 
-    'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" ); 
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 1.0;
-  gt_params.max_imap_error_ = 1.0;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1( TeCoord2D( 110.0, 305.0 ), 
-    TeCoord2D( 385.0, 50.0 ) );    
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 122.0, 698.0 ), 
-    TeCoord2D( 730.0, 138.0 ) );    
-  params.SetParameter( "input_box2" , input_box2 );   
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)2 ); 
-  params.SetParameter( "pixel_y_relation" , (double)2 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)529 );
-  params.SetParameter( "corr_sens" , (double)0.5 ); 
-  params.SetParameter( "corr_window_width" , (unsigned int)21 );
-  params.SetParameter( "maximas_sens" , (double)0.02 );
-  
-  TePDIOFMatching match_instance; 
-  match_instance.ToggleProgInt( false );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (halfsampledImageTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  
-  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-  
-  while( it != it_end ) {
-    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-      Te2String( it->pt1.y(),1 ) + "] -> [" +
-      Te2String( it->pt2.x(),1 ) + " , " + 
-      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-    
-    ++it;
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_halfsampledImageTest2_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_halfsampledImageTest2_input_image2.tif",
-    out_tie_points_ptr, 1 );    
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 130, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )     
-}
-
-
-void halfsampledRotadedImageTest()
-{
-  /* Open image 1 */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-  
-  /* Creating the half-sampled-rotated image 2 */
-    
-  TePDITypes::TePDIRasterPtrType input_disk_image2_ptr( new TeRaster(
-    std::string( 
-    TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
-    'r' ) );
-  TEAGN_TRUE_OR_THROW( input_disk_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" );
-      
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image2_ptr, input_disk_image2_ptr->params(), 
-    TePDIUtils::TePDIUtilsAutoMemPol ),
-    "Error allocating raster memory" );
-    
-  rotateRasterClockWize( input_disk_image2_ptr, input_image2_ptr, M_PI_4 );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( input_image2_ptr, 
-    TEPDIEXAMPLESBINPATH "TePDIOFMatching_test_rotatedimage.tif", 
-    TeUNSIGNEDCHAR ),
-    "Error saving rotated image" );
-      
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  /* Set the other parameters */
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 1.0;
-  gt_params.max_imap_error_ = 1.0;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1( TeCoord2D( 122.0, 698.0 ), 
-    TeCoord2D( 730.0, 138.0 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 173.0, 447.0 ), 
-    TeCoord2D( 434.0, 153.0 ) );
-  params.SetParameter( "input_box2" , input_box2 );   
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  
-  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
-  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)529 ); 
-  params.SetParameter( "corr_sens" , (double)0.5 );
-  params.SetParameter( "corr_window_width" , (unsigned int)21 );
-  params.SetParameter( "maximas_sens" , (double)0.02 );
-  
-  TePDIOFMatching match_instance; 
-  match_instance.ToggleProgInt( false );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (halfsampledRotadedImageTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  
-  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-  
-  while( it != it_end ) {
-    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-      Te2String( it->pt1.y(),1 ) + "] -> [" +
-      Te2String( it->pt2.x(),1 ) + " , " + 
-      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-    
-    ++it;
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_halfsampledRotadedImageTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_halfsampledRotadedImageTest_input_image2.tif",
-    out_tie_points_ptr, 1 );   
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 28, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )
-}
-
-void halfsampledRotadedImageWithDownsampleTest()
-{
-  /* Open image 1 */
-
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
-    "Unable to init input_image1_ptr" );    
-  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
-  
-  params.SetParameter( "input_channel1" , (unsigned int)0 );
-  
-  /* Creating the half-sampled-rotated image 2 */
-    
-  TePDITypes::TePDIRasterPtrType input_disk_image2_ptr( new TeRaster(
-    std::string( 
-    TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
-    'r' ) );
-  TEAGN_TRUE_OR_THROW( input_disk_image2_ptr->init(), 
-    "Unable to init input_image2_ptr" );
-      
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
-    input_image2_ptr, input_disk_image2_ptr->params(), 
-    TePDIUtils::TePDIUtilsAutoMemPol ),
-    "Error allocating raster memory" );
-    
-  rotateRasterClockWize( input_disk_image2_ptr, input_image2_ptr, M_PI_4 );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( input_image2_ptr, 
-    TEPDIEXAMPLESBINPATH "TePDIOFMatching_test_rotatedimage.tif", 
-    TeUNSIGNEDCHAR ),
-    "Error saving rotated image" );
-      
-  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
-  
-  /* Set the other parameters */
-  
-  params.SetParameter( "input_channel2" , (unsigned int)0 );       
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
-  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = "affine";
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_rmse_ = 1.0;
-  gt_params.max_imap_rmse_ = 1.0;
-  params.SetParameter( "gt_params" , gt_params ); 
-  
-  TeBox input_box1( TeCoord2D( 122.0, 698.0 ), 
-    TeCoord2D( 730.0, 138.0 ) );
-  params.SetParameter( "input_box1" , input_box1 );
-  
-  TeBox input_box2( TeCoord2D( 173.0, 447.0 ), 
-    TeCoord2D( 434.0, 153.0 ) );
-  params.SetParameter( "input_box2" , input_box2 );   
-  
-  params.SetParameter( "enable_multi_thread" , (int)1 ); 
-//  params.SetParameter( "skip_geom_filter" , (int)1 );
-  params.SetParameter( "max_size_opt" , (unsigned int)( 200 * 200 ) );
-  
-  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
-  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
-  
-  params.SetParameter( "max_tie_points" , (unsigned int)529 ); 
-  params.SetParameter( "corr_sens" , (double)0.5 );
-  params.SetParameter( "corr_window_width" , (unsigned int)21 );
-  params.SetParameter( "maximas_sens" , (double)0.02 );
-  
-  TePDIOFMatching match_instance; 
-  match_instance.ToggleProgInt( false );
-  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
-    "Algorithm reset error" )
-    
-  TEAGN_LOGMSG( "Algorithm started" )
-  
-  time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
-    "Algorithm apply error" )      
-    
-  time_t end_time = clock() / CLOCKS_PER_SEC;
-  
-  TEAGN_LOGMSG( "Time elapsed (halfsampledRotadedImageWithDownsampleTest): " + 
-    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-    " seconds" );
-    
-  /* Displaying tie-points */
-  
-  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-  
-  while( it != it_end ) {
-    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
-      Te2String( it->pt1.y(),1 ) + "] -> [" +
-      Te2String( it->pt2.x(),1 ) + " , " + 
-      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
-    
-    ++it;
-  }
-  
-  /* Tie-points draw */
-  
-  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_halfsampledRotadedImageWithDownsampleTest_input_image1.tif",
-    out_tie_points_ptr, 0 );
-  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
-    "TePDIOFMatching_test_halfsampledRotadedImageWithDownsampleTest_input_image2.tif",
-    out_tie_points_ptr, 1 );   
-    
-  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
-  TEAGN_CHECK_EPS( 33, out_tie_points_ptr->size(),
-    0, "Invalid tie-points number" )       
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-    
-    time_t init_time = clock() / CLOCKS_PER_SEC;
-    
-    sameImageAndBoxesTest();
-    sameImageDifBoxesTest();
-    halfsampledImageTest();
-    halfsampledImageTest2();
-    halfsampledRotadedImageTest();
-    halfsampledRotadedImageWithDownsampleTest();
-    
-    time_t end_time = clock() / CLOCKS_PER_SEC;
-    
-    TEAGN_LOGMSG( "Total elapsed time: " + 
-      TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
-      " seconds" );    
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }  
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIOFMatching.hpp>
+#include <TePDIUtils.hpp>
+
+#include <TeGTParams.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeAgnostic.h>
+#include <TeDefines.h>
+
+#include <math.h>
+
+#ifndef M_PI
+  #define M_PI       3.14159265358979323846
+#endif
+#ifndef M_PI_2
+  #define M_PI_2     1.57079632679489661923
+#endif
+#ifndef M_PI_4
+  #define M_PI_4     0.785398163397448309616
+#endif
+
+bool loadRaster( const std::string& fileName, 
+    TePDITypes::TePDIRasterPtrType& memRasterPtr, bool enable_progress )
+{
+  // opening input raster
+  
+  TeRaster inRaster( fileName, 'r' );
+  TEAGN_TRUE_OR_RETURN( inRaster.init(), "Input disk raster init error" );
+  
+  // creating the memory raster
+    
+  TeRasterParams internal_params = inRaster.params();
+  
+  internal_params.mode_ = 'c';
+  internal_params.decoderIdentifier_ = "MEM";
+  
+  if( memRasterPtr.isActive() ) {
+    memRasterPtr->updateParams( internal_params );
+    TEAGN_TRUE_OR_RETURN( memRasterPtr->init( internal_params ), 
+      "raster init error" );
+  } else {
+    memRasterPtr.reset( new TeRaster( internal_params ) );
+    TEAGN_TRUE_OR_RETURN( memRasterPtr->init(), 
+      "raster init error" );
+  }    
+    
+  // copying data
+  
+  unsigned int band = 0;
+  const unsigned int bandsN = (unsigned int)inRaster.params().nBands();
+  unsigned int line = 0;
+  const unsigned int linesN = (unsigned int)inRaster.params().nlines_;
+  unsigned int col = 0;
+  const unsigned int colsN = (unsigned int)inRaster.params().ncols_;
+  TeRaster& memRaster = *memRasterPtr;
+  double value = 0;
+  
+  TePDIPIManager progress( "Loading raster", 
+    bandsN * linesN, enable_progress );       
+  
+  for( band = 0 ; band < bandsN ; ++band )
+    for( line = 0 ; line < linesN ; ++line )
+    {
+      for( col = 0 ; col < colsN ; ++col )
+      {
+        inRaster.getElement( col, line, value, band );
+        memRaster.setElement( col, line, value, band );
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),  
+        "Canceled by the user" );
+    }
+  
+  return true;
+}
+
+void raster2Tiff( 
+  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+  unsigned int raster_channel,
+  const std::string& out_file_name,
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr,
+  unsigned int tie_points_space )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
+    "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
+    "Invalid matrix cols" )
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
+    input_raster_ptr->params().ncols_ );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  double value = 0;
+  
+  for( int line = 0 ; 
+    line < input_raster_ptr->params().nlines_ ; ++line ) {
+    for( int col = 0 ; 
+      col < input_raster_ptr->params().ncols_ ; 
+      ++col ) {
+      
+      input_raster_ptr->getElement( col, line, value, 
+        raster_channel );
+      
+
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        value, 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw tie-points */
+  
+  if( out_tie_points_ptr.isActive() ) {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      int x = 0;
+      int y = 0;
+      
+      if( tie_points_space == 0 ) {
+         x = TeRound( it->pt1.x() );
+         y = TeRound( it->pt1.y() );
+      } else {
+         x = TeRound( it->pt2.x() );
+         y = TeRound( it->pt2.y() );
+      }
+      
+      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
+        "Invalid maxima column" )
+      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+        "Invalid maxima column" )      
+      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
+        "Invalid maxima line" )
+      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+        "Invalid maxima line" )      
+      
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+        255.0, 0 ),
+        "Error writing raster" )    
+    
+      ++it;
+    }
+  
+  }
+}
+
+
+void rotateRasterClockWize( 
+  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+  const TePDITypes::TePDIRasterPtrType& output_raster_ptr,
+  double angle )
+{
+  TEAGN_TRUE_OR_THROW( input_raster_ptr.isActive(),
+    "Invalid input pointer" );
+  TEAGN_TRUE_OR_THROW( output_raster_ptr.isActive(),
+    "Invalid output pointer" );    
+    
+  const double input_raster_lines = 
+    (double)input_raster_ptr->params().nlines_;
+  const double input_raster_cols = 
+    (double)input_raster_ptr->params().ncols_;
+  const unsigned int input_raster_channels =
+    (unsigned int)input_raster_ptr->nBands();
+    
+  const double last_x_idx = input_raster_cols - 1.0;
+  const double last_y_idx = input_raster_lines - 1.0;
+    
+  const double angle_cos = cos( angle );
+  const double angle_sin = sin( angle );
+  
+  /* Calc new image geometry */
+    
+  double min_x = MIN( 0.0, ( angle_cos * last_x_idx ) - 
+    ( angle_sin * last_y_idx ) );
+  min_x = MIN( min_x, ( angle_cos * last_x_idx ) );
+  min_x = MIN( min_x, ( -1.0 * angle_sin * last_y_idx ) );
+  
+  double max_x = MAX( 0.0, ( angle_cos * last_x_idx ) - 
+    ( angle_sin * last_y_idx ) );
+  max_x = MAX( max_x, ( angle_cos * last_x_idx ) );
+  max_x = MAX( max_x, ( -1.0 * angle_sin * last_y_idx ) );
+  
+  double min_y = MIN( 0.0, ( angle_sin * last_x_idx ) + 
+    ( angle_cos * last_y_idx ) );
+  min_y = MIN( min_y, ( angle_sin * last_x_idx ) );
+  min_y = MIN( min_y, ( angle_cos * last_y_idx ) );
+  
+  double max_y = MAX( 0.0, ( angle_sin * last_x_idx ) + 
+    ( angle_cos * last_y_idx ) );
+  max_y = MAX( max_y, ( angle_sin * last_x_idx ) );
+  max_y = MAX( max_y, ( angle_cos * last_y_idx ) );
+  
+  const unsigned int out_lines = (unsigned int) ceil(
+    max_y - min_y );
+  const unsigned int out_cols = (unsigned int) ceil(
+    max_x - min_x );
+    
+  /* reseting output raster */
+  
+  TeCoord2D ll_point_input_ref_indexed( min_x,
+    max_y );
+  TeCoord2D ur_point_input_ref_indexed( max_x,
+    min_y );
+    
+  TeCoord2D ll_point_input_ref = 
+    input_raster_ptr->index2Coord( ll_point_input_ref_indexed );
+  TeCoord2D ur_point_input_ref = 
+    input_raster_ptr->index2Coord( ur_point_input_ref_indexed );    
+  
+  TeRasterParams new_out_params = output_raster_ptr->params();
+  
+  new_out_params.boundingBoxLinesColumns(
+    ll_point_input_ref.x(), ll_point_input_ref.y(),
+    ur_point_input_ref.x(), ur_point_input_ref.y(),
+    out_lines, out_cols );
+    
+  TEAGN_TRUE_OR_THROW( output_raster_ptr->init( new_out_params ),
+    "Error reseting output raster" )
+  
+  /* remapping pixels */
+    
+  unsigned int curr_out_x = 0;
+  unsigned int curr_out_y = 0;
+  double value = 0;
+  unsigned int curr_in_x = 0;
+  unsigned int curr_in_y = 0;
+  unsigned int curr_channel = 0;
+  
+  for( curr_channel = 0 ; curr_channel < input_raster_channels ;
+    ++curr_channel ) {
+    for( curr_out_y = 0 ; curr_out_y < out_lines ; ++curr_out_y ) {
+      for( curr_out_x = 0 ; curr_out_x < out_cols ; ++curr_out_x ) {
+        curr_in_x = 
+          TeRound( 
+            ( angle_cos * ( curr_out_x + min_x ) ) + 
+            ( angle_sin * ( curr_out_y + min_y ) )
+          );
+        curr_in_y = 
+          TeRound( 
+            ( -1.0 * angle_sin * ( curr_out_x + min_x ) ) + 
+            ( angle_cos * ( curr_out_y + min_y ) )
+          );
+        
+        if( input_raster_ptr->getElement( curr_in_x, curr_in_y,
+          value, curr_channel ) ) {
+        
+          output_raster_ptr->setElement( curr_out_x, curr_out_y,
+            value, curr_channel );
+        } else {
+          output_raster_ptr->setElement( curr_out_x, curr_out_y,
+            0, curr_channel );        
+        }
+      }
+    }
+  }
+  
+  return;
+}
+
+
+void sameImageAndBoxesTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.   
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 1.0;
+  gt_params.max_imap_error_ = 1.0;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1_proj = input_image1_ptr->params().box();
+  TeBox input_box1;
+  TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, 
+    input_image1_ptr, input_box1 );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  params.SetParameter( "input_box2" , input_box1 );
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+//  params.SetParameter( "skip_geom_filter" , (int)1 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)529 ); 
+  params.SetParameter( "corr_sens" , (double)0.5 );
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "maximas_sens" , (double)0.02 );
+  
+  TeGTParams::pointer out_gt_params_ptr( new TeGTParams );
+  params.SetParameter( "out_gt_params_ptr" , out_gt_params_ptr );
+  
+  TePDIOFMatching match_instance; 
+  match_instance.ToggleProgInt( false );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC ;
+  
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageAndBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_sameImageAndBoxesTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_sameImageAndBoxesTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  /* Checking tie-points */
+  
+  TEAGN_WATCH( (unsigned int) out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 389, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )      
+  
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      TEAGN_CHECK_EPS( it->pt1.x(), it->pt2.x(), 0, 
+        "Invalid tie-point" )
+      TEAGN_CHECK_EPS( it->pt1.y(), it->pt2.y(), 0, 
+        "Invalid tie-point" )
+      
+      ++it;
+    }
+  }    
+}
+
+
+void sameImageDifBoxesTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.   
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 1.0;
+  gt_params.max_imap_error_ = 1.0;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1( TeCoord2D( 0, 760 ) , TeCoord2D( 680, 0 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( 
+    TeCoord2D( 190, input_image1_ptr->params().nlines_ - 1 ) , 
+    TeCoord2D( input_image1_ptr->params().ncols_ - 1, 227 ) );
+  params.SetParameter( "input_box2" , input_box2 );   
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+//  params.SetParameter( "skip_geom_filter" , (int)1 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)1 ); 
+  params.SetParameter( "pixel_y_relation" , (double)1 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)529 ); 
+  params.SetParameter( "corr_sens" , (double)0.5 );
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "maximas_sens" , (double)0.02 );
+  
+  TePDIOFMatching match_instance; 
+  match_instance.ToggleProgInt( false );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (sameImageDifBoxesTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+        Te2String( it->pt1.y(),1 ) + "] -> [" +
+        Te2String( it->pt2.x(),1 ) + " , " + 
+        Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+      
+      ++it;
+    }
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_sameImageDifBoxesTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_sameImageDifBoxesTest_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 98, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )    
+}
+
+
+void halfsampledImageTest()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( 
+    TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
+    'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.   
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 1.0;
+  gt_params.max_imap_error_ = 1.0;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1( TeCoord2D( 122.0, 698.0 ), 
+    TeCoord2D( 730.0, 138.0 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 110.0, 305.0 ), 
+    TeCoord2D( 385.0, 50.0 ) );
+  params.SetParameter( "input_box2" , input_box2 );   
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+//  params.SetParameter( "skip_geom_filter" , (int)1 );
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
+  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)529 ); 
+  params.SetParameter( "corr_sens" , (double)0.5 );
+  params.SetParameter( "maximas_sens" , (double)0.02 );
+  
+  TePDIOFMatching match_instance; 
+  match_instance.ToggleProgInt( false );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (halfsampledImageTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  
+  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+  
+  while( it != it_end ) {
+    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+      Te2String( it->pt1.y(),1 ) + "] -> [" +
+      Te2String( it->pt2.x(),1 ) + " , " + 
+      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+    
+    ++it;
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_halfsampledImageTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_halfsampledImageTest_input_image2.tif",
+    out_tie_points_ptr, 1 );  
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 130, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )         
+}
+
+
+void halfsampledImageTest2()
+{
+  /* Creating parameters */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr( new TeRaster(
+    std::string( 
+    TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 
+    'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" ); 
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.   
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 1.0;
+  gt_params.max_imap_error_ = 1.0;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1( TeCoord2D( 110.0, 305.0 ), 
+    TeCoord2D( 385.0, 50.0 ) );    
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 122.0, 698.0 ), 
+    TeCoord2D( 730.0, 138.0 ) );    
+  params.SetParameter( "input_box2" , input_box2 );   
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+//  params.SetParameter( "skip_geom_filter" , (int)1 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)2 ); 
+  params.SetParameter( "pixel_y_relation" , (double)2 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)529 );
+  params.SetParameter( "corr_sens" , (double)0.5 ); 
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "maximas_sens" , (double)0.02 );
+  
+  TePDIOFMatching match_instance; 
+  match_instance.ToggleProgInt( false );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (halfsampledImageTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  
+  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+  
+  while( it != it_end ) {
+    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+      Te2String( it->pt1.y(),1 ) + "] -> [" +
+      Te2String( it->pt2.x(),1 ) + " , " + 
+      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+    
+    ++it;
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_halfsampledImageTest2_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_halfsampledImageTest2_input_image2.tif",
+    out_tie_points_ptr, 1 );    
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 130, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )     
+}
+
+
+void halfsampledRotadedImageTest()
+{
+  /* Open image 1 */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+  
+  /* Creating the half-sampled-rotated image 2 */
+    
+  TePDITypes::TePDIRasterPtrType input_disk_image2_ptr( new TeRaster(
+    std::string( 
+    TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
+    'r' ) );
+  TEAGN_TRUE_OR_THROW( input_disk_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" );
+      
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
+    input_image2_ptr, input_disk_image2_ptr->params(), 
+    TePDIUtils::TePDIUtilsAutoMemPol ),
+    "Error allocating raster memory" );
+    
+  rotateRasterClockWize( input_disk_image2_ptr, input_image2_ptr, M_PI_4 );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( input_image2_ptr, 
+    TEPDIEXAMPLESBINPATH "TePDIOFMatching_test_rotatedimage.tif", 
+    TeUNSIGNEDCHAR ),
+    "Error saving rotated image" );
+      
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  /* Set the other parameters */
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.   
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_error_ = 1.0;
+  gt_params.max_imap_error_ = 1.0;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1( TeCoord2D( 122.0, 698.0 ), 
+    TeCoord2D( 730.0, 138.0 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 173.0, 447.0 ), 
+    TeCoord2D( 434.0, 153.0 ) );
+  params.SetParameter( "input_box2" , input_box2 );   
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+//  params.SetParameter( "skip_geom_filter" , (int)1 );
+  
+  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
+  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)529 ); 
+  params.SetParameter( "corr_sens" , (double)0.5 );
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "maximas_sens" , (double)0.02 );
+  
+  TePDIOFMatching match_instance; 
+  match_instance.ToggleProgInt( false );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (halfsampledRotadedImageTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  
+  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+  
+  while( it != it_end ) {
+    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+      Te2String( it->pt1.y(),1 ) + "] -> [" +
+      Te2String( it->pt2.x(),1 ) + " , " + 
+      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+    
+    ++it;
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_halfsampledRotadedImageTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_halfsampledRotadedImageTest_input_image2.tif",
+    out_tie_points_ptr, 1 );   
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 28, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )
+}
+
+void halfsampledRotadedImageWithDownsampleTest()
+{
+  /* Open image 1 */
+
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image1_ptr->init(), 
+    "Unable to init input_image1_ptr" );    
+  params.SetParameter( "input_image1_ptr" , input_image1_ptr );
+  
+  params.SetParameter( "input_channel1" , (unsigned int)0 );
+  
+  /* Creating the half-sampled-rotated image 2 */
+    
+  TePDITypes::TePDIRasterPtrType input_disk_image2_ptr( new TeRaster(
+    std::string( 
+    TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste_halfsampled.tif" ), 
+    'r' ) );
+  TEAGN_TRUE_OR_THROW( input_disk_image2_ptr->init(), 
+    "Unable to init input_image2_ptr" );
+      
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( 
+    input_image2_ptr, input_disk_image2_ptr->params(), 
+    TePDIUtils::TePDIUtilsAutoMemPol ),
+    "Error allocating raster memory" );
+    
+  rotateRasterClockWize( input_disk_image2_ptr, input_image2_ptr, M_PI_4 );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( input_image2_ptr, 
+    TEPDIEXAMPLESBINPATH "TePDIOFMatching_test_rotatedimage.tif", 
+    TeUNSIGNEDCHAR ),
+    "Error saving rotated image" );
+      
+  params.SetParameter( "input_image2_ptr" , input_image2_ptr ); 
+  
+  /* Set the other parameters */
+  
+  params.SetParameter( "input_channel2" , (unsigned int)0 );       
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr( new TeCoordPairVect );
+  params.SetParameter( "out_tie_points_ptr" , out_tie_points_ptr );        
+  
+  // The default geometric transformation parameters will be 
+  // changed here for testing purposes.   
+  TeGTParams gt_params;
+  gt_params.transformation_name_ = "affine";
+  gt_params.out_rem_strat_ = TeGTParams::LWOutRemotion;
+  gt_params.max_dmap_rmse_ = 1.0;
+  gt_params.max_imap_rmse_ = 1.0;
+  params.SetParameter( "gt_params" , gt_params ); 
+  
+  TeBox input_box1( TeCoord2D( 122.0, 698.0 ), 
+    TeCoord2D( 730.0, 138.0 ) );
+  params.SetParameter( "input_box1" , input_box1 );
+  
+  TeBox input_box2( TeCoord2D( 173.0, 447.0 ), 
+    TeCoord2D( 434.0, 153.0 ) );
+  params.SetParameter( "input_box2" , input_box2 );   
+  
+  params.SetParameter( "enable_multi_thread" , (int)1 ); 
+//  params.SetParameter( "skip_geom_filter" , (int)1 );
+  params.SetParameter( "max_size_opt" , (unsigned int)( 200 * 200 ) );
+  
+  params.SetParameter( "pixel_x_relation" , (double)0.5 ); 
+  params.SetParameter( "pixel_y_relation" , (double)0.5 ); 
+  
+  params.SetParameter( "max_tie_points" , (unsigned int)529 ); 
+  params.SetParameter( "corr_sens" , (double)0.5 );
+  params.SetParameter( "corr_window_width" , (unsigned int)21 );
+  params.SetParameter( "maximas_sens" , (double)0.02 );
+  
+  TePDIOFMatching match_instance; 
+  match_instance.ToggleProgInt( false );
+  TEAGN_TRUE_OR_THROW( match_instance.Reset( params ),
+    "Algorithm reset error" )
+    
+  TEAGN_LOGMSG( "Algorithm started" )
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+    
+  TEAGN_TRUE_OR_THROW( match_instance.Apply(),
+    "Algorithm apply error" )      
+    
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Time elapsed (halfsampledRotadedImageWithDownsampleTest): " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );
+    
+  /* Displaying tie-points */
+  
+  TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+  TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+  
+  while( it != it_end ) {
+    std::cout << "[" + Te2String( it->pt1.x(),1 ) + " , " +
+      Te2String( it->pt1.y(),1 ) + "] -> [" +
+      Te2String( it->pt2.x(),1 ) + " , " + 
+      Te2String( it->pt2.y(),1 ) + "]" << std::endl;
+    
+    ++it;
+  }
+  
+  /* Tie-points draw */
+  
+  raster2Tiff( input_image1_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_halfsampledRotadedImageWithDownsampleTest_input_image1.tif",
+    out_tie_points_ptr, 0 );
+  raster2Tiff( input_image2_ptr, 0, TEPDIEXAMPLESBINPATH
+    "TePDIOFMatching_test_halfsampledRotadedImageWithDownsampleTest_input_image2.tif",
+    out_tie_points_ptr, 1 );   
+    
+  TEAGN_WATCH( (unsigned int)out_tie_points_ptr->size() );
+  TEAGN_CHECK_EPS( 33, out_tie_points_ptr->size(),
+    0, "Invalid tie-points number" )       
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  TeStdIOProgress pi;
+  TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+  
+  time_t init_time = clock() / CLOCKS_PER_SEC;
+  
+  sameImageAndBoxesTest();
+  sameImageDifBoxesTest();
+  halfsampledImageTest();
+  halfsampledImageTest2();
+  halfsampledRotadedImageTest();
+  halfsampledRotadedImageWithDownsampleTest();
+  
+  time_t end_time = clock() / CLOCKS_PER_SEC;
+  
+  TEAGN_LOGMSG( "Total elapsed time: " + 
+    TeAgnostic::to_string( (long int)( end_time - init_time ) ) +
+    " seconds" );    
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching_test.vcproj b/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching_test.vcproj
index 3e2ebfb..89cad8b 100644
--- a/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching_test.vcproj
+++ b/examples/image_processing/source/TePDIOFMatching/TePDIOFMatching_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIOFMatching_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIOFMatching_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIOFMatching_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".;../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIOFMatching_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIOFMatching_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIOFMatching_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIOFMatching_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIOFMatching_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIOFMatching_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIOFMatching_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIPIManager/.cvsignore b/examples/image_processing/source/TePDIPIManager/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIPIManager/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIPIManager/TePDIPIManager.pro b/examples/image_processing/source/TePDIPIManager/TePDIPIManager.pro
index d93b3b6..2f83529 100644
--- a/examples/image_processing/source/TePDIPIManager/TePDIPIManager.pro
+++ b/examples/image_processing/source/TePDIPIManager/TePDIPIManager.pro
@@ -1,5 +1,5 @@
-include( ../base/base.pro )
-
-SOURCES += TePDIPIManager_test.cpp
-
-QMAKE_CLEAN += 
+include( ../base/base.pro )
+
+SOURCES += TePDIPIManager_test.cpp
+
+QMAKE_CLEAN += 
diff --git a/examples/image_processing/source/TePDIPIManager/TePDIPIManager_test.cpp b/examples/image_processing/source/TePDIPIManager/TePDIPIManager_test.cpp
old mode 100755
new mode 100644
index ae51bf5..5b87781
--- a/examples/image_processing/source/TePDIPIManager/TePDIPIManager_test.cpp
+++ b/examples/image_processing/source/TePDIPIManager/TePDIPIManager_test.cpp
@@ -1,64 +1,65 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIPIManager.hpp>
-
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeAgnostic.h>
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );  
-    
-    /* Test 0 */
-    {
-      TePDIPIManager manager1( "Manager1", 100, true );
-      manager1.Update( 50 );
-      manager1.Update( 100 );
-    }    
-  
-    /* Test 1 */
-    {
-      TePDIPIManager manager1( "Manager1", 100, true );
-      manager1.Update( 25 );
-      
-      TePDIPIManager manager2( "Manager2", 100, true );
-      manager2.Update( 50 );
-      
-      TePDIPIManager manager3( "Manager3", 100, true );
-      manager3.Update( 75 );   
-      
-      manager1.Update( 100 );  
-      manager2.Update( 100 ); 
-      manager3.Update( 100 );  
-    }
-    
-    /* Test 2 */
-    {
-      TePDIPIManager manager1( "Manager1", 100, true );
-      TePDIPIManager manager2( "Manager2", 100, true );
-      TePDIPIManager manager3( "Manager3", 100, true );
-      
-      manager1.Update( 50 );
-      manager2.Update( 50 );
-      manager3.Update( 50 ); 
-      
-      manager1.Update( 100 );
-      manager2.Update( 100 );
-      manager3.Update( 100 );       
-    }    
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }  
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIPIManager.hpp>
+
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeAgnostic.h>
+
+#include <stdlib.h>
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );  
+    
+    /* Test 0 */
+    {
+      TePDIPIManager manager1( "Manager1", 100, true );
+      manager1.Update( 50 );
+      manager1.Update( 100 );
+    }    
+  
+    /* Test 1 */
+    {
+      TePDIPIManager manager1( "Manager1", 100, true );
+      manager1.Update( 25 );
+      
+      TePDIPIManager manager2( "Manager2", 100, true );
+      manager2.Update( 50 );
+      
+      TePDIPIManager manager3( "Manager3", 100, true );
+      manager3.Update( 75 );   
+      
+      manager1.Update( 100 );  
+      manager2.Update( 100 ); 
+      manager3.Update( 100 );  
+    }
+    
+    /* Test 2 */
+    {
+      TePDIPIManager manager1( "Manager1", 100, true );
+      TePDIPIManager manager2( "Manager2", 100, true );
+      TePDIPIManager manager3( "Manager3", 100, true );
+      
+      manager1.Update( 50 );
+      manager2.Update( 50 );
+      manager3.Update( 50 ); 
+      
+      manager1.Update( 100 );
+      manager2.Update( 100 );
+      manager3.Update( 100 );       
+    }    
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }  
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIPIManager/TePDIPIManager_test.vcproj b/examples/image_processing/source/TePDIPIManager/TePDIPIManager_test.vcproj
index 9edec36..7310e78 100644
--- a/examples/image_processing/source/TePDIPIManager/TePDIPIManager_test.vcproj
+++ b/examples/image_processing/source/TePDIPIManager/TePDIPIManager_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIPIManager_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIPIManager_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIPIManager_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIPIManager_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIPIManager_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIPIManager_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIPIManager_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIPIManager_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIPIManager_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIPIManager_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIParallelSegmenter/.cvsignore b/examples/image_processing/source/TePDIParallelSegmenter/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIParallelSegmenter/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIParallelSegmenter/TePDIParallelSegmenter.pro b/examples/image_processing/source/TePDIParallelSegmenter/TePDIParallelSegmenter.pro
new file mode 100644
index 0000000..bf7fbfb
--- /dev/null
+++ b/examples/image_processing/source/TePDIParallelSegmenter/TePDIParallelSegmenter.pro
@@ -0,0 +1,8 @@
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIParallelSegmenter_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/TePDIParallelSegmenter*
+  
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIParallelSegmenter/TePDIParallelSegmenter.vcproj b/examples/image_processing/source/TePDIParallelSegmenter/TePDIParallelSegmenter.vcproj
new file mode 100644
index 0000000..14c247f
--- /dev/null
+++ b/examples/image_processing/source/TePDIParallelSegmenter/TePDIParallelSegmenter.vcproj
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIParallelSegmenter_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIParallelSegmenter_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/shapelib;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIParallelSegmenter_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIParallelSegmenter_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIParallelSegmenter_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIParallelSegmenter/TePDIParallelSegmenter_test.cpp b/examples/image_processing/source/TePDIParallelSegmenter/TePDIParallelSegmenter_test.cpp
new file mode 100644
index 0000000..abafa50
--- /dev/null
+++ b/examples/image_processing/source/TePDIParallelSegmenter/TePDIParallelSegmenter_test.cpp
@@ -0,0 +1,199 @@
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+#include <TePDIParallelSegmenter.hpp>
+#include <TePDIBaatz.hpp>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+void RegionGrowing_Strategy_pattern1_test()
+{
+  // Input data
+  
+  TePDITypes::TePDIRasterPtrType input_image_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "pattern1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image_ptr->init(), "Unable to init inRaster" );
+  
+  std::vector< unsigned int > input_channels;
+  input_channels.push_back( 0 );
+  
+  TeRasterParams outputImageParams;
+  outputImageParams.nBands( 1 );
+  outputImageParams.setNLinesNColumns( 1, 1 );
+  outputImageParams.setDataType( TeUNSIGNEDLONG, -1 );
+  
+  TePDITypes::TePDIRasterPtrType output_image_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputImageParams,
+    output_image_ptr ), "RAM Raster Alloc error" );    
+    
+  // Creating segmenter startegy specific parameters 
+  // TePDIParaSegRegGrowStrategy
+  
+  TePDIParameters strategy_params;
+  strategy_params.SetParameter( "euc_treshold", (double)1 );
+  strategy_params.SetParameter( "area_min", (int)5 );
+  
+  // Creating segmenter parameters
+  
+  TePDIParameters segmenterParams;
+  segmenterParams.SetParameter( "input_image_ptr", input_image_ptr );
+  segmenterParams.SetParameter( "input_channels", input_channels );
+  segmenterParams.SetParameter( "strategy_name", 
+    std::string( "RegionGrowing") );
+  segmenterParams.SetParameter( "output_image_ptr", output_image_ptr );
+  segmenterParams.SetParameter( "strategy_params", strategy_params );
+  segmenterParams.SetParameter( "max_seg_threads", (unsigned int)0 );
+  segmenterParams.SetParameter( "max_block_size", (unsigned int)128 );
+  //segmenterParams.SetParameter( "merge_adjacent_blocks", (bool)false );
+  
+  // Running segmenter
+  
+  TePDIParallelSegmenter segmenter;
+  
+  TEAGN_TRUE_OR_THROW( segmenter.Apply( segmenterParams ), "Apply error" );
+    
+  // Saving result to disk
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_image_ptr,
+    TEPDIEXAMPLESBINPATH "TePDIParallelSegmenter_RG_pattern1_test.tif" ), 
+    "GeoTIF generation error" );   
+}
+
+
+void RegionGrowing_Strategy_test()
+{
+  // Input data
+  
+  TePDITypes::TePDIRasterPtrType input_image_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image_ptr->init(), "Unable to init inRaster" );
+  
+  std::vector< unsigned int > input_channels;
+  input_channels.push_back( 0 );
+  input_channels.push_back( 1 );
+  input_channels.push_back( 2 );
+  
+  TeRasterParams outputImageParams;
+  outputImageParams.nBands( 1 );
+  outputImageParams.setNLinesNColumns( 1, 1 );
+  outputImageParams.setDataType( TeUNSIGNEDLONG, -1 );
+  
+  TePDITypes::TePDIRasterPtrType output_image_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputImageParams,
+    output_image_ptr ), "RAM Raster Alloc error" );    
+    
+  // Creating segmenter startegy specific parameters 
+  // TePDIParaSegRegGrowStrategy
+  
+  TePDIParameters strategy_params;
+  strategy_params.SetParameter( "euc_treshold", (double)20 );
+  strategy_params.SetParameter( "area_min", (int)5 );
+  
+  // Creating segmenter parameters
+  
+  TePDIParameters segmenterParams;
+  segmenterParams.SetParameter( "input_image_ptr", input_image_ptr );
+  segmenterParams.SetParameter( "input_channels", input_channels );
+  segmenterParams.SetParameter( "strategy_name", 
+    std::string( "RegionGrowing") );
+  segmenterParams.SetParameter( "output_image_ptr", output_image_ptr );
+  segmenterParams.SetParameter( "strategy_params", strategy_params );
+  //segmenterParams.SetParameter( "max_seg_threads", (unsigned int)1 );
+  //segmenterParams.SetParameter( "max_block_size", (unsigned int)100 );
+  //segmenterParams.SetParameter( "merge_adjacent_blocks", (bool)false );
+  
+  // Running segmenter
+  
+  TePDIParallelSegmenter segmenter;
+  
+  TEAGN_TRUE_OR_THROW( segmenter.Apply( segmenterParams ), "Apply error" );
+    
+  // Saving result to disk
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_image_ptr,
+    TEPDIEXAMPLESBINPATH "TePDIParallelSegmenter_RG_test.tif" ), 
+    "GeoTIF generation error" );   
+}
+
+void Baatz_Strategy_test()
+{
+  // Input data
+  
+  TePDITypes::TePDIRasterPtrType input_image_ptr( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_image_ptr->init(), "Unable to init inRaster" );
+  
+  std::vector< unsigned int > input_channels;
+  input_channels.push_back( 0 );
+  input_channels.push_back( 1 );
+  input_channels.push_back( 2 );
+  
+  TeRasterParams outputImageParams;
+  outputImageParams.nBands( 1 );
+  outputImageParams.setNLinesNColumns( 1, 1 );
+  outputImageParams.setDataType( TeUNSIGNEDLONG, -1 );
+  
+  TePDITypes::TePDIRasterPtrType output_image_ptr;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputImageParams,
+    output_image_ptr ), "RAM Raster Alloc error" );    
+    
+  // Creating segmenter startegy specific parameters 
+  // TePDIParaSegBaatzStrategy
+  
+  TePDIParameters strategy_params;
+  strategy_params.SetParameter( "scale", (float)20 );
+  strategy_params.SetParameter( "compactness", (float)0.5 );
+  strategy_params.SetParameter( "color", (float)0.5 );
+  strategy_params.SetParameter( "euc_treshold", (double)20 );
+  
+  std::vector<float> input_weights;
+  input_weights.push_back( (float) 0.33 );
+  input_weights.push_back( (float) 0.33 );
+  input_weights.push_back( (float) 0.33 );
+  strategy_params.SetParameter( "input_weights", input_weights );  
+  
+  // Creating segmenter parameters
+  
+  TePDIParameters segmenterParams;
+  segmenterParams.SetParameter( "input_image_ptr", input_image_ptr );
+  segmenterParams.SetParameter( "input_channels", input_channels );
+  segmenterParams.SetParameter( "strategy_name", 
+    std::string( "Baatz") );
+  segmenterParams.SetParameter( "output_image_ptr", output_image_ptr );
+  segmenterParams.SetParameter( "strategy_params", strategy_params );
+  //segmenterParams.SetParameter( "max_seg_threads", (unsigned int)0 );
+  //segmenterParams.SetParameter( "max_block_size", (unsigned int)100 );
+  //segmenterParams.SetParameter( "merge_adjacent_blocks", (bool)false );
+  
+  // Running segmenter
+  
+  TePDIParallelSegmenter segmenter;
+  
+  TEAGN_TRUE_OR_THROW( segmenter.Apply( segmenterParams ), "Apply error" );
+    
+  // Saving result to disk
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_image_ptr,
+    TEPDIEXAMPLESBINPATH "TePDIParallelSegmenter_Baatz_test.tif" ), 
+    "GeoTIF generation error" );   
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  TeStdIOProgress pi;
+  TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+  
+  RegionGrowing_Strategy_pattern1_test();
+  Baatz_Strategy_test();
+  RegionGrowing_Strategy_test();
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIParameters/.cvsignore b/examples/image_processing/source/TePDIParameters/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIParameters/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIParameters/TePDIParameters.pro b/examples/image_processing/source/TePDIParameters/TePDIParameters.pro
old mode 100755
new mode 100644
index ad61b18..ddc4f98
--- a/examples/image_processing/source/TePDIParameters/TePDIParameters.pro
+++ b/examples/image_processing/source/TePDIParameters/TePDIParameters.pro
@@ -1,4 +1,4 @@
-include( ../base/base.pro )
-
-SOURCES += TePDIParameters_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += TePDIParameters_test.cpp
+
diff --git a/examples/image_processing/source/TePDIParameters/TePDIParameters_test.cpp b/examples/image_processing/source/TePDIParameters/TePDIParameters_test.cpp
old mode 100755
new mode 100644
index 92fd5aa..928fbe7
--- a/examples/image_processing/source/TePDIParameters/TePDIParameters_test.cpp
+++ b/examples/image_processing/source/TePDIParameters/TePDIParameters_test.cpp
@@ -1,69 +1,69 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TePDIParameters params_copy;
-    
-    const int x1_int = 1;
-    const double x1_double = 1;
-    
-    {
-      TePDIParameters params;
-      
-      params.SetParameter( "int", x1_int );
-      params.SetParameter( "double", x1_double );    
-      
-      TEAGN_TRUE_OR_THROW( params.CheckParameter< int >( "int" ), "" )
-      TEAGN_TRUE_OR_THROW( params.CheckParameter< double >( "double" ), "" )
-      
-      int x2_int = 0;
-      TEAGN_TRUE_OR_THROW( params.GetParameter( "int", x2_int ),
-        "Missing parameter" );    
-      TEAGN_CHECK_EPS( x2_int, x1_int, 0, "" )
-      
-      double x2_double = 0;
-      TEAGN_TRUE_OR_THROW( params.GetParameter( "double", 
-        x2_double ), "Missing parameter" );
-      TEAGN_CHECK_EPS( x2_double, x1_double, 0, "" )      
-      
-      params_copy = params;
-      
-      TEAGN_TRUE_OR_THROW( ( params_copy == params ),
-        "Invalid ==operator result" )
-    }
-    
-    TEAGN_TRUE_OR_THROW( params_copy.CheckParameter< int >( "int" ), "" )
-    TEAGN_TRUE_OR_THROW( params_copy.CheckParameter< double >( "double" ), "" )
-    
-    int x2_int = 0;
-    TEAGN_TRUE_OR_THROW( params_copy.GetParameter( "int", x2_int ),
-      "Missing paramter" );    
-    TEAGN_CHECK_EPS( x2_int, x1_int, 0, "" )
-    
-    double x2_double = 0;
-    TEAGN_TRUE_OR_THROW( params_copy.GetParameter( "double", 
-      x2_double ), "Missing parameter" );
-    TEAGN_CHECK_EPS( x2_double, x1_double, 0, "" )
-    
-    /* Checking parameter remotion */
-    
-    TEAGN_TRUE_OR_THROW( params_copy.CheckParameter< double >( 
-      "double" ), "" )
-    params_copy.RemoveParameter( "double" );
-    TEAGN_TRUE_OR_THROW( ! params_copy.CheckParameter< double >( 
-      "double" ), "" )    
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }  
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TePDIParameters params_copy;
+    
+    const int x1_int = 1;
+    const double x1_double = 1;
+    
+    {
+      TePDIParameters params;
+      
+      params.SetParameter( "int", x1_int );
+      params.SetParameter( "double", x1_double );    
+      
+      TEAGN_TRUE_OR_THROW( params.CheckParameter< int >( "int" ), "" )
+      TEAGN_TRUE_OR_THROW( params.CheckParameter< double >( "double" ), "" )
+      
+      int x2_int = 0;
+      TEAGN_TRUE_OR_THROW( params.GetParameter( "int", x2_int ),
+        "Missing parameter" );    
+      TEAGN_CHECK_EPS( x2_int, x1_int, 0, "" )
+      
+      double x2_double = 0;
+      TEAGN_TRUE_OR_THROW( params.GetParameter( "double", 
+        x2_double ), "Missing parameter" );
+      TEAGN_CHECK_EPS( x2_double, x1_double, 0, "" )      
+      
+      params_copy = params;
+      
+      TEAGN_TRUE_OR_THROW( ( params_copy == params ),
+        "Invalid ==operator result" )
+    }
+    
+    TEAGN_TRUE_OR_THROW( params_copy.CheckParameter< int >( "int" ), "" )
+    TEAGN_TRUE_OR_THROW( params_copy.CheckParameter< double >( "double" ), "" )
+    
+    int x2_int = 0;
+    TEAGN_TRUE_OR_THROW( params_copy.GetParameter( "int", x2_int ),
+      "Missing paramter" );    
+    TEAGN_CHECK_EPS( x2_int, x1_int, 0, "" )
+    
+    double x2_double = 0;
+    TEAGN_TRUE_OR_THROW( params_copy.GetParameter( "double", 
+      x2_double ), "Missing parameter" );
+    TEAGN_CHECK_EPS( x2_double, x1_double, 0, "" )
+    
+    /* Checking parameter remotion */
+    
+    TEAGN_TRUE_OR_THROW( params_copy.CheckParameter< double >( 
+      "double" ), "" )
+    params_copy.RemoveParameter( "double" );
+    TEAGN_TRUE_OR_THROW( ! params_copy.CheckParameter< double >( 
+      "double" ), "" )    
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }  
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIParameters/TePDIParameters_test.vcproj b/examples/image_processing/source/TePDIParameters/TePDIParameters_test.vcproj
old mode 100755
new mode 100644
index 2801a6b..9d2d235
--- a/examples/image_processing/source/TePDIParameters/TePDIParameters_test.vcproj
+++ b/examples/image_processing/source/TePDIParameters/TePDIParameters_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIParameters_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIParameters_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIParameters_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIParameters_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIParameters_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIParameters_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIParameters_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIParameters_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIParameters_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIParameters_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIPrincipalComponents/.cvsignore b/examples/image_processing/source/TePDIPrincipalComponents/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIPrincipalComponents/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents.pro b/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents.pro
old mode 100755
new mode 100644
index 261534e..1b8dc52
--- a/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents.pro
+++ b/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIPrincipalComponents_test.cpp
-
-QMAKE_CLEAN += \
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIPrincipalComponents_test.cpp
+
+QMAKE_CLEAN += \
   ../../bin/TePDIPrincipalComponents*.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents_test.cpp b/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents_test.cpp
old mode 100755
new mode 100644
index babb557..6d52bf4
--- a/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents_test.cpp
+++ b/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents_test.cpp
@@ -1,172 +1,172 @@
-#include <TePDIPrincipalComponents.hpp>
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-
-#include <TeRaster.h>
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-#include <TePDIExamplesBase.hpp>
-
-void pca_test()
-{
-/********* Direct analysis *********/
-
-	TePDIPrincipalComponents::TePDIPCAType analysis_type = 
-	  TePDIPrincipalComponents::TePDIPCADirect;
-
-	TePDIParameters params_direct;
-
-	TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
-	  std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
-	  'r') );
-	TEAGN_TRUE_OR_THROW(inRaster1->init(), 
-	  "Unable to init inRaster1");
-	  
-	TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
-	  std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ),
-	  'r') );
-	TEAGN_TRUE_OR_THROW(inRaster2->init(), 
-	  "Unable to init inRaster2");
-	
-	TePDITypes::TePDIRasterPtrType inRaster3(new TeRaster(
-	  std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ),
-	  'r') );
-	TEAGN_TRUE_OR_THROW(inRaster3->init(), "Unable to init inRaster3");
-	
-	TePDITypes::TePDIRasterVectorType input_rasters;
-	input_rasters.push_back(inRaster1);
-	input_rasters.push_back(inRaster2);
-	input_rasters.push_back(inRaster3);
-
-	std::vector<int> bands_direct;
-	bands_direct.push_back(0);
-	bands_direct.push_back(1);
-	bands_direct.push_back(2);
-	
-	TePDITypes::TePDIRasterPtrType outRaster1_direct;
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
-	  outRaster1_direct, 1, 1, 1, false, TeDOUBLE, 0), 
-	  "RAM Raster 1 Alloc error");
-	  
-	TePDITypes::TePDIRasterPtrType outRaster2_direct;
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
-	  outRaster2_direct, 1, 1, 1, false, TeDOUBLE, 0), 
-	  "RAM Raster 2 Alloc error");
-	  
-	TePDITypes::TePDIRasterPtrType outRaster3_direct;
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
-	  outRaster3_direct, 1, 1, 1, false, TeDOUBLE, 0 ), 
-	  "RAM Raster 3 Alloc error");
-	
-	TePDITypes::TePDIRasterVectorType output_rasters_direct;
-	output_rasters_direct.push_back(outRaster1_direct);
-	output_rasters_direct.push_back(outRaster2_direct);
-	output_rasters_direct.push_back(outRaster3_direct);
-	
-	TeSharedPtr<TeMatrix> covariance_matrix(new TeMatrix);
-	
-	params_direct.SetParameter("analysis_type", analysis_type);
-	params_direct.SetParameter("input_rasters", input_rasters);
-	params_direct.SetParameter("bands", bands_direct);
-	params_direct.SetParameter("output_rasters", output_rasters_direct);
-	params_direct.SetParameter("covariance_matrix", covariance_matrix);
-	
-	TePDIPrincipalComponents pc_direct;
-	TEAGN_TRUE_OR_THROW(pc_direct.Reset(params_direct), "Invalid Parameters");
-	TEAGN_TRUE_OR_THROW(pc_direct.Apply(), "Apply error");
-	
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
-	  output_rasters_direct[0], 
-	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_pca0.tif" ), 
-	  "GeoTIFF0 generation error");
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
-	  output_rasters_direct[1], 
-	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_pca1.tif" ), 
-	  "GeoTIFF1 generation error");
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
-	  output_rasters_direct[2], 
-	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_pca2.tif" ), 
-	  "GeoTIFF2 generation error");
-
-/********* Inverse analysis *********/
-	
-	analysis_type = TePDIPrincipalComponents::TePDIPCAInverse;
-	
-	TePDIParameters params_inverse;
-
-	std::vector< int > bands_inverse;
-	bands_inverse.push_back(0);
-	bands_inverse.push_back(0);
-	bands_inverse.push_back(0);
-
-	TePDITypes::TePDIRasterPtrType outRaster1_inverse;
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
-	  outRaster1_inverse, 1, 1, 1, false, TeDOUBLE, 0 ), 
-	  "RAM Raster 1 Alloc error");
-	  
-	TePDITypes::TePDIRasterPtrType outRaster2_inverse;
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
-	  outRaster2_inverse, 1, 1, 1, false, TeDOUBLE, 0 ), 
-	  "RAM Raster 2 Alloc error");
-	  
-	TePDITypes::TePDIRasterPtrType outRaster3_inverse;
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
-	  outRaster3_inverse, 1, 1, 1, false, TeDOUBLE, 0 ), 
-	  "RAM Raster 3 Alloc error");
-	
-	TePDITypes::TePDIRasterVectorType output_rasters_inverse;
-	output_rasters_inverse.push_back(outRaster1_inverse);
-	output_rasters_inverse.push_back(outRaster2_inverse);
-	output_rasters_inverse.push_back(outRaster3_inverse);
-	
-	params_inverse.SetParameter("analysis_type", analysis_type);
-	params_inverse.SetParameter("input_rasters", 
-	  output_rasters_direct);
-	params_inverse.SetParameter("bands", bands_inverse);
-	params_inverse.SetParameter("output_rasters", 
-	  output_rasters_inverse);
-	params_inverse.SetParameter("covariance_matrix", 
-	  covariance_matrix);
-	
-	TePDIPrincipalComponents pc_inverse;
-	TEAGN_TRUE_OR_THROW(pc_inverse.Reset(params_inverse), 
-	  "Invalid Parameters");
-	TEAGN_TRUE_OR_THROW(pc_inverse.Apply(), "Apply error");
-	
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
-	  output_rasters_inverse[0], 
-	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_band0.tif"), 
-	  "GeoTIFF0 generation error");
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
-	  output_rasters_inverse[1], 
-	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_band1.tif"), 
-	  "GeoTIFF1 generation error");
-	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
-	  output_rasters_inverse[2], 
-	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_band2.tif"), 
-	  "GeoTIFF2 generation error");
-}
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  TEAGN_DEBUG_MODE_CHECK;
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
-
-    pca_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }  
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#include <TePDIPrincipalComponents.hpp>
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+
+#include <TeRaster.h>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+#include <TePDIExamplesBase.hpp>
+
+void pca_test()
+{
+/********* Direct analysis *********/
+
+	TePDIPrincipalComponents::TePDIPCAType analysis_type = 
+	  TePDIPrincipalComponents::TePDIPCADirect;
+
+	TePDIParameters params_direct;
+
+	TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
+	  std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 
+	  'r') );
+	TEAGN_TRUE_OR_THROW(inRaster1->init(), 
+	  "Unable to init inRaster1");
+	  
+	TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
+	  std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ),
+	  'r') );
+	TEAGN_TRUE_OR_THROW(inRaster2->init(), 
+	  "Unable to init inRaster2");
+	
+	TePDITypes::TePDIRasterPtrType inRaster3(new TeRaster(
+	  std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ),
+	  'r') );
+	TEAGN_TRUE_OR_THROW(inRaster3->init(), "Unable to init inRaster3");
+	
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	input_rasters.push_back(inRaster1);
+	input_rasters.push_back(inRaster2);
+	input_rasters.push_back(inRaster3);
+
+	std::vector<int> bands_direct;
+	bands_direct.push_back(0);
+	bands_direct.push_back(1);
+	bands_direct.push_back(2);
+	
+	TePDITypes::TePDIRasterPtrType outRaster1_direct;
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
+	  outRaster1_direct, 1, 1, 1, false, TeDOUBLE, 0), 
+	  "RAM Raster 1 Alloc error");
+	  
+	TePDITypes::TePDIRasterPtrType outRaster2_direct;
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
+	  outRaster2_direct, 1, 1, 1, false, TeDOUBLE, 0), 
+	  "RAM Raster 2 Alloc error");
+	  
+	TePDITypes::TePDIRasterPtrType outRaster3_direct;
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
+	  outRaster3_direct, 1, 1, 1, false, TeDOUBLE, 0 ), 
+	  "RAM Raster 3 Alloc error");
+	
+	TePDITypes::TePDIRasterVectorType output_rasters_direct;
+	output_rasters_direct.push_back(outRaster1_direct);
+	output_rasters_direct.push_back(outRaster2_direct);
+	output_rasters_direct.push_back(outRaster3_direct);
+	
+	TeSharedPtr<TeMatrix> covariance_matrix(new TeMatrix);
+	
+	params_direct.SetParameter("analysis_type", analysis_type);
+	params_direct.SetParameter("input_rasters", input_rasters);
+	params_direct.SetParameter("bands", bands_direct);
+	params_direct.SetParameter("output_rasters", output_rasters_direct);
+	params_direct.SetParameter("covariance_matrix", covariance_matrix);
+	
+	TePDIPrincipalComponents pc_direct;
+	TEAGN_TRUE_OR_THROW(pc_direct.Reset(params_direct), "Invalid Parameters");
+	TEAGN_TRUE_OR_THROW(pc_direct.Apply(), "Apply error");
+	
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
+	  output_rasters_direct[0], 
+	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_pca0.tif" ), 
+	  "GeoTIFF0 generation error");
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
+	  output_rasters_direct[1], 
+	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_pca1.tif" ), 
+	  "GeoTIFF1 generation error");
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
+	  output_rasters_direct[2], 
+	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_pca2.tif" ), 
+	  "GeoTIFF2 generation error");
+
+/********* Inverse analysis *********/
+	
+	analysis_type = TePDIPrincipalComponents::TePDIPCAInverse;
+	
+	TePDIParameters params_inverse;
+
+	std::vector< int > bands_inverse;
+	bands_inverse.push_back(0);
+	bands_inverse.push_back(0);
+	bands_inverse.push_back(0);
+
+	TePDITypes::TePDIRasterPtrType outRaster1_inverse;
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
+	  outRaster1_inverse, 1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+	  "RAM Raster 1 Alloc error");
+	  
+	TePDITypes::TePDIRasterPtrType outRaster2_inverse;
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
+	  outRaster2_inverse, 1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+	  "RAM Raster 2 Alloc error");
+	  
+	TePDITypes::TePDIRasterPtrType outRaster3_inverse;
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
+	  outRaster3_inverse, 1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), 
+	  "RAM Raster 3 Alloc error");
+	
+	TePDITypes::TePDIRasterVectorType output_rasters_inverse;
+	output_rasters_inverse.push_back(outRaster1_inverse);
+	output_rasters_inverse.push_back(outRaster2_inverse);
+	output_rasters_inverse.push_back(outRaster3_inverse);
+	
+	params_inverse.SetParameter("analysis_type", analysis_type);
+	params_inverse.SetParameter("input_rasters", 
+	  output_rasters_direct);
+	params_inverse.SetParameter("bands", bands_inverse);
+	params_inverse.SetParameter("output_rasters", 
+	  output_rasters_inverse);
+	params_inverse.SetParameter("covariance_matrix", 
+	  covariance_matrix);
+	
+	TePDIPrincipalComponents pc_inverse;
+	TEAGN_TRUE_OR_THROW(pc_inverse.Reset(params_inverse), 
+	  "Invalid Parameters");
+	TEAGN_TRUE_OR_THROW(pc_inverse.Apply(), "Apply error");
+	
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
+	  output_rasters_inverse[0], 
+	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_band0.tif"), 
+	  "GeoTIFF0 generation error");
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
+	  output_rasters_inverse[1], 
+	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_band1.tif"), 
+	  "GeoTIFF1 generation error");
+	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(
+	  output_rasters_inverse[2], 
+	  TEPDIEXAMPLESBINPATH "TePDIPrincipalComponents_band2.tif"), 
+	  "GeoTIFF2 generation error");
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  TEAGN_DEBUG_MODE_CHECK;
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
+
+    pca_test();
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }  
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents_test.vcproj b/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents_test.vcproj
old mode 100755
new mode 100644
index 02ccc1a..b26cc42
--- a/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents_test.vcproj
+++ b/examples/image_processing/source/TePDIPrincipalComponents/TePDIPrincipalComponents_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIPrincipalComponents_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIPrincipalComponents_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIPrincipalComponents_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIPrincipalComponents_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIPrincipalComponents_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIPrincipalComponents_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIPrincipalComponents_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIPrincipalComponents_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIPrincipalComponents_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIPrincipalComponents_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIRadarFilters/.cvsignore b/examples/image_processing/source/TePDIRadarFilters/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIRadarFilters/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters.pro b/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters.pro
old mode 100755
new mode 100644
index ba1eff3..e9827d7
--- a/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters.pro
+++ b/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIRadarFilters_test.cpp
-
-QMAKE_CLEAN += \
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIRadarFilters_test.cpp
+
+QMAKE_CLEAN += \
   ../../bin/Radar*.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters_test.cpp b/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters_test.cpp
old mode 100755
new mode 100644
index a57eb7c..b1d58c9
--- a/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters_test.cpp
+++ b/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters_test.cpp
@@ -1,260 +1,322 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIRadarLeeFilter.hpp>
-#include <TePDIRadarKuanFilter.hpp>
-#include <TePDIRadarFrostFilter.hpp>
-
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-
-#include <TeInitRasterDecoders.h>
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-void LeeFixed_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_type", TePDIRadarLeeFilter::TePDILeeFixedType );
-
-  params.SetParameter( "det_type", TePDIRadarLeeFilter::TePDILeeDTLinear );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  params.SetParameter( "mask_width", (int)3 );
-
-  params.SetParameter( "look_number", (double)1. );
-
-  params.SetParameter( "variance_threshold", (double)0.1 );
-
-  TePDIRadarLeeFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "RadarLeeFixed_test.tif" ), "GeoTIF generation error" );
-  
-}
-
-
-void LeeAdaptative_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_type", TePDIRadarLeeFilter::TePDILeeAdaptType );
-
-  params.SetParameter( "det_type", TePDIRadarLeeFilter::TePDILeeDTLinear );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  params.SetParameter( "mask_width", (int)3 );
-
-  params.SetParameter( "look_number", (double)1. );
-
-  params.SetParameter( "variance_threshold", (double)0.1 );
-
-  TePDIRadarLeeFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "RadarLeeAdaptative_test.tif" ), "GeoTIF generation error" );
-
-}
-
-void KuanFixed_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_type", TePDIRadarKuanFilter::TePDIKuanFixedType );
-
-  params.SetParameter( "det_type", TePDIRadarKuanFilter::TePDIKuanDTLinear );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  params.SetParameter( "mask_width", (int)3 );
-
-  params.SetParameter( "look_number", (double)1. );
-
-  params.SetParameter( "variance_threshold", (double)0.1 );
-
-  TePDIRadarKuanFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "RadarKuanFixed_test.tif" ), "GeoTIF generation error" );
-    
-}
-
-
-void KuanAdaptative_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "filter_type", TePDIRadarKuanFilter::TePDIKuanAdaptType );
-
-  params.SetParameter( "det_type", TePDIRadarKuanFilter::TePDIKuanDTLinear );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  params.SetParameter( "mask_width", (int)3 );
-
-  params.SetParameter( "look_number", (double)1. );
-
-  params.SetParameter( "variance_threshold", (double)0.1 );
-
-  TePDIRadarKuanFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "RadarKuanAdaptative_test.tif" ), "GeoTIF generation error" );
-
-}
-
-
-void Frost_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
-  params.SetParameter( "output_image", outRaster );
-
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  params.SetParameter( "channels", channels );
-
-  params.SetParameter( "det_type", TePDIRadarFrostFilter::TePDIFrostDTLinear );
-
-  params.SetParameter( "iterations", (int)1 );
-
-  params.SetParameter( "look_number", (double)1. );
-
-  params.SetParameter( "variance_threshold", (double)0.1 );
-
-  params.SetParameter( "corr_coef", (double)0.89 );
-
-  TePDIRadarFrostFilter filter;
-
-  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
-    "Invalid Parameters" );
-
-  TEAGN_TRUE_OR_THROW( filter.Apply(),
-    "Apply error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "RadarFrost_test.tif" ), "GeoTIF generation error" );
- 
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );  
-  
-    TeInitRasterDecoders();
-
-    LeeFixed_test();
-    LeeAdaptative_test();
-
-    KuanFixed_test();
-    KuanAdaptative_test();
-
-    Frost_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }  
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIRadarLeeFilter.hpp>
+#include <TePDIRadarKuanFilter.hpp>
+#include <TePDIRadarFrostFilter.hpp>
+#include <TePDIRadarGammaFilter.hpp>
+
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+
+#include <TeInitRasterDecoders.h>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+void LeeFixed_test()
+{
+  TePDIParameters params;
+
+  // Despite this filter is intended to be used with radar images a 
+  // CBERS image will be used just for testing purposes
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_type", TePDIRadarLeeFilter::TePDILeeFixedType );
+
+  params.SetParameter( "det_type", TePDIRadarLeeFilter::TePDILeeDTLinear );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  params.SetParameter( "mask_width", (int)3 );
+
+  params.SetParameter( "look_number", (double)1. );
+
+  params.SetParameter( "variance_threshold", (double)0.1 );
+
+  TePDIRadarLeeFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "RadarLeeFixed_test.tif" ), "GeoTIF generation error" );
+  
+}
+
+
+void LeeAdaptative_test()
+{
+  TePDIParameters params;
+
+  // Despite this filter is intended to be used with radar images a 
+  // CBERS image will be used just for testing purposes
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_type", TePDIRadarLeeFilter::TePDILeeAdaptType );
+
+  params.SetParameter( "det_type", TePDIRadarLeeFilter::TePDILeeDTLinear );
+
+  params.SetParameter( "iterations", (int)1 );
+
+  params.SetParameter( "mask_width", (int)3 );
+
+  params.SetParameter( "look_number", (double)1. );
+
+  params.SetParameter( "variance_threshold", (double)0.1 );
+
+  TePDIRadarLeeFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "RadarLeeAdaptative_test.tif" ), "GeoTIF generation error" );
+
+}
+
+void KuanFixed_test()
+{
+  TePDIParameters params;
+
+  // Despite this filter is intended to be used with radar images a 
+  // CBERS image will be used just for testing purposes
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );  
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_type", TePDIRadarKuanFilter::TePDIKuanFixedType );
+
+  params.SetParameter( "det_type", TePDIRadarKuanFilter::TePDIKuanDTLinear );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  params.SetParameter( "mask_width", (int)3 );
+
+  params.SetParameter( "look_number", (double)1. );
+
+  params.SetParameter( "variance_threshold", (double)0.1 );
+
+  TePDIRadarKuanFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "RadarKuanFixed_test.tif" ), "GeoTIF generation error" );
+    
+}
+
+
+void KuanAdaptative_test()
+{
+  TePDIParameters params;
+
+  // Despite this filter is intended to be used with radar images a 
+  // CBERS image will be used just for testing purposes
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_type", TePDIRadarKuanFilter::TePDIKuanAdaptType );
+
+  params.SetParameter( "det_type", TePDIRadarKuanFilter::TePDIKuanDTLinear );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  params.SetParameter( "mask_width", (int)3 );
+
+  params.SetParameter( "look_number", (double)1. );
+
+  params.SetParameter( "variance_threshold", (double)0.1 );
+
+  TePDIRadarKuanFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "RadarKuanAdaptative_test.tif" ), "GeoTIF generation error" );
+
+}
+
+
+void Frost_test()
+{
+  TePDIParameters params;
+
+  // Despite this filter is intended to be used with radar images a 
+  // CBERS image will be used just for testing purposes
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "det_type", TePDIRadarFrostFilter::TePDIFrostDTLinear );
+
+  params.SetParameter( "iterations", (int)3 );
+
+  params.SetParameter( "look_number", (double)1. );
+
+  params.SetParameter( "variance_threshold", (double)0.1 );
+
+  params.SetParameter( "corr_coef", (double)0.89 );
+
+  TePDIRadarFrostFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "RadarFrost_test.tif" ), "GeoTIF generation error" );
+ 
+}
+
+void Gamma_test()
+{
+  TePDIParameters params;
+
+  // Despite this filter is intended to be used with radar images a 
+  // CBERS image will be used just for testing purposes
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, false, TeDOUBLE, 0 ), "RAM Raster Alloc error" );
+  params.SetParameter( "output_image", outRaster );
+
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );  
+  params.SetParameter( "channels", channels );
+
+  params.SetParameter( "filter_type", TePDIRadarGammaFilter::TePDIGammaFixedType );
+
+  params.SetParameter( "det_type", TePDIRadarGammaFilter::TePDIGammaDTQuadratic );
+
+  params.SetParameter( "iterations", (int)1 );
+
+  params.SetParameter( "mask_width", (int)3 );
+
+  params.SetParameter( "look_number", (double)1. );
+
+  TePDIRadarGammaFilter filter;
+
+  TEAGN_TRUE_OR_THROW( filter.Reset( params ),
+    "Invalid Parameters" );
+
+  TEAGN_TRUE_OR_THROW( filter.Apply(),
+    "Apply error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "RadarGammaFixed_test.tif" ), "GeoTIF generation error" );
+    
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  TeStdIOProgress pi;
+  TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );  
+
+  TeInitRasterDecoders();
+
+  LeeFixed_test();
+  LeeAdaptative_test();
+
+  KuanFixed_test();
+  KuanAdaptative_test();
+
+  Frost_test();
+
+  Gamma_test();
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters_test.vcproj b/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters_test.vcproj
old mode 100755
new mode 100644
index 5c0d30d..d19b983
--- a/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters_test.vcproj
+++ b/examples/image_processing/source/TePDIRadarFilters/TePDIRadarFilters_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIRadarFilters_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIRadarFilters_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIRadarFilters_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIRadarFilters_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIRadarFilters_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIRadarFilters_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIRadarFilters_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIRadarFilters_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIRadarFilters_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIRadarFilters_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIRaster2Vector/.cvsignore b/examples/image_processing/source/TePDIRaster2Vector/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIRaster2Vector/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector.pro b/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector.pro
old mode 100755
new mode 100644
index 499c9e0..0351ce8
--- a/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector.pro
+++ b/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector.pro
@@ -1,11 +1,11 @@
-include( ../base/base.pro )
-
-
-SOURCES += \
-  TePDIRaster2Vector_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/Raster2Vector*.dbf \
-  ../../bin/Raster2Vector*.shp \
-  ../../bin/Raster2Vector*.shx \
-  ../../bin/Raster2Vector*.tif
+include( ../base/base.pro )
+
+
+SOURCES += \
+  TePDIRaster2Vector_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/Raster2Vector*.dbf \
+  ../../bin/Raster2Vector*.shp \
+  ../../bin/Raster2Vector*.shx \
+  ../../bin/Raster2Vector*.tif
diff --git a/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector_test.cpp b/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector_test.cpp
old mode 100755
new mode 100644
index 1a53120..0e45585
--- a/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector_test.cpp
+++ b/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector_test.cpp
@@ -1,570 +1,570 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-#include <TePDIRaster2Vector.hpp>
-#include <TeInitRasterDecoders.h>
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-#include <shapefil.h> // Needed by exportPS2SHP
-
-bool exportPS2SHP( const TePolygonSet& ps, 
-    const std::string& base_file_name  )
-{
-    // creating files names
-    std::string dbfFilename = base_file_name + ".dbf";
-    std::string shpFilename = base_file_name + ".shp";
-
-    // creating polygons attribute list ( max attribute size == 12 )
-    TeAttributeList attList;
-    
-    TeAttribute at;
-    at.rep_.type_ = TeSTRING;               //the id of the cell
-    at.rep_.numChar_ = 10;
-    at.rep_.name_ = "object_id_";
-    at.rep_.isPrimaryKey_ = true;
-    
-    attList.push_back(at);
-    
-    /* DBF output file handle creation */
-
-    DBFHandle hDBF = DBFCreate( dbfFilename.c_str() );
-    TEAGN_TRUE_OR_RETURN( ( hDBF != 0 ), "DBF file creation error" );
-    
-    /* Writing attributes */
-
-    TeAttributeList::iterator it=attList.begin();
-    while ( it != attList.end() )
-    {
-      TeAttribute at = (*it);
-      string atName = at.rep_.name_;
-
-      // *OBS****atributos podem ter no maximo 12 caracteres
-      // max attribute size == 12
-      if (at.rep_.type_ == TeSTRING )
-      {
-        TEAGN_TRUE_OR_THROW( 
-          ( DBFAddField( hDBF, atName.c_str(), FTString, at.rep_.numChar_, 0 ) 
-           != -1 ), "Error writing TeSTRING attribute" );
-      }
-      else if (at.rep_.type_ == TeINT)
-      {
-        TEAGN_TRUE_OR_THROW( 
-          ( DBFAddField( hDBF, atName.c_str(), FTInteger, 10, 0 ) != -1 ), 
-          "Error writing TeINT attribute" );
-      }
-      else if (at.rep_.type_ == TeREAL)
-      {
-        TEAGN_TRUE_OR_THROW( 
-          ( DBFAddField( hDBF, atName.c_str(), FTDouble, 10, 5 ) != -1 ), 
-          "Error writing TeREAL attribute" );
-          
-      }
-      else if (at.rep_.type_ == TeDATETIME)
-      {
-        TEAGN_TRUE_OR_THROW( 
-          ( DBFAddField( hDBF, atName.c_str(), FTDate, 8, 0 ) != -1 ), 
-          "Error writing TeDATETIME attribute" );
-      }
-                
-      ++it;
-    }
-    
-    /* SHP output file handle creation */
-
-    SHPHandle hSHP = SHPCreate( shpFilename.c_str(), SHPT_POLYGON );
-    if( hSHP == 0 ) {
-      TEAGN_LOGERR( "DBF file creation error" );
-      DBFClose( hDBF );
-      return false;
-    }
-    
-    /* Writing polygons */
-
-    int iRecord = 0;
-    int totpoints = 0;
-    double  *padfX, *padfY;
-    SHPObject       *psObject;
-    int posXY, npoints, nelem;
-    int nVertices;
-    int* panParts;
-
-    TePolygonSet::iterator itps;
-    TePolygon poly;
-
-    for (itps = ps.begin() ; itps != ps.end() ; itps++ ) {
-      poly=(*itps);
-      totpoints = 0;
-      nVertices = poly.size();
-      for (unsigned int n=0; n<poly.size();n++) {
-        totpoints += poly[n].size();
-      }
-
-      panParts = (int *) malloc(sizeof(int) * nVertices);
-      padfX = (double *) malloc(sizeof(double) * totpoints);
-      padfY = (double *) malloc(sizeof(double) * totpoints);
-      posXY = 0;
-      nelem = 0;
-      
-      for (unsigned int l=0; l<poly.size(); ++l) {
-        if (l==0) {
-          if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) {
-            TeReverseLine(poly[l]);
-          }
-        } else {
-          if (TeOrientation(poly[l]) == TeCLOCKWISE) {
-            TeReverseLine(poly[l]);
-          }
-        }
-        
-        npoints = poly[l].size();
-        panParts[nelem]=posXY;
-        
-        for (int m=0; m<npoints; m++ ) {
-          padfX[posXY] = poly[l][m].x_;
-          padfY[posXY] = poly[l][m].y_;
-          posXY++;
-        }
-        
-        nelem++;
-      }
-                
-      psObject = SHPCreateObject( SHPT_POLYGON, -1, nelem, panParts, NULL,
-        posXY, padfX, padfY, NULL, NULL );
-        
-      int shpRes = SHPWriteObject( hSHP, -1, psObject );
-      TEAGN_TRUE_OR_THROW( ( shpRes != -1 ), 
-        "Unable to create a shape write object" )
-        
-      SHPDestroyObject( psObject );
-      free( panParts );
-      free( padfX );
-      free( padfY );
-
-      // writing attributes - same creation order
-      for (unsigned int j=0; j<attList.size();j++) {
-        if ( attList[j].rep_.type_ == TeSTRING ) {
-          DBFWriteStringAttribute(hDBF, iRecord, j, poly.objectId().c_str() );
-        } /*else if ( attList[j].rep_.type_ == TeINT) {
-          DBFWriteIntegerAttribute(hDBF, iRecord, j,  VALOR INT );        
-        } else if ( attList[j].rep_.type_ == TeREAL) {
-          DBFWriteDoubleAttribute(hDBF, iRecord, j,  VALOR DOUBLE);
-        } else if ( attList[j].rep_.type_ == TeDATETIME) {
-          TeTime time =  VALOR DATA;
-          char dd[8];
-          sprintf(dd,"%04d%02d%02d",time.year(),time.month(),time.day());
-          DBFWriteDateAttribute(hDBF, iRecord, j, dd );
-        }*/
-      }
-                
-      iRecord++;
-    }
-        
-    DBFClose( hDBF );
-    SHPClose( hSHP );
-
-    return true;  
-}
-
-TePDITypes::TePDIRasterPtrType generateTestRaster()
-{
-  TeRasterParams RAMRaster_params;
-  RAMRaster_params.nBands( 1 );
-  RAMRaster_params.setDataType( TeUNSIGNEDLONG );
-  RAMRaster_params.setDummy( 0, -1 );
-  RAMRaster_params.setNLinesNColumns( 100, 100 );
-  
-  TePDITypes::TePDIRasterPtrType RAMRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster,
-    RAMRaster_params, false ), "RAM Raster Alloc error" );
-    
-  int line = 0;
-  int col = 0;
-  
-  /* Area 1 */
-    
-  for( line = 10 ; line < 20; ++line ) {
-    for( col = 10 ; col < 20 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 10.0, 0 ), "Raster fill error" );
-    }
-  }
-  
-  /* Area 1 dummy hole */
-    
-  for( line = 13 ; line < 18; ++line ) {
-    for( col = 13 ; col < 18 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 0.0, 0 ), "Raster fill error" );
-    }
-  }  
-  
-  /* Area 2 */
-  
-  for( line = 10 ; line < 20; ++line ) {
-    for( col = 30 ; col < 40 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 20.0, 0 ), "Raster fill error" );
-    }
-  }  
-  
-  /* Area 2 hole */
-    
-  for( line = 13 ; line < 18; ++line ) {
-    for( col = 33 ; col < 38 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 10.0, 0 ), "Raster fill error" );
-    }
-  }  
-  
-  /* Area 3 */
-  
-  for( line = 10 ; line < 20; ++line ) {
-    for( col = 50 ; col < 60 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 30.0, 0 ), "Raster fill error" );
-    }
-  } 
-  
-  /* Area 4 */
-  
-  for( line = 0 ; line < 9; ++line ) {
-    for( col = 70 ; col < 100 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
-    }
-  } 
-  
-  for( line = 0 ; line < 40; ++line ) {
-    for( col = 90 ; col < 100 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
-    }
-  } 
-  
-  for( line = 30 ; line < 40; ++line ) {
-    for( col = 70 ; col < 100 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
-    }
-  } 
-  
-  for( line = 20 ; line < 30; ++line ) {
-    for( col = 70 ; col < 80 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
-    }
-  }   
-  
-  /* Area 5 */
-  
-  for( line = 50 ; line < 90; ++line ) {
-    for( col = 10 ; col < 90 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 50.0, 0 ), "Raster fill error" );
-    }
-  }
-  
-  /* Area 6 */
-    
-  for( line = 60 ; line < 70; ++line ) {
-    for( col = 20 ; col < 30 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 10.0, 0 ), "Raster fill error" );
-    }
-  }    
-  
-  /* Area 7 */
-    
-  for( line = 60 ; line < 70; ++line ) {
-    for( col = 40 ; col < 50 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 20.0, 0 ), "Raster fill error" );
-    }
-  }    
-
-  /* Area 8 */
-    
-  for( line = 60 ; line < 70; ++line ) {
-    for( col = 60 ; col < 70 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 30.0, 0 ), "Raster fill error" );
-    }
-  }    
-
-  /* Area 9 */
-    
-  for( line = 70 ; line < 80; ++line ) {
-    for( col = 20 ; col < 70 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 0.0, 0 ), "Raster fill error" );
-    }
-  }  
-  
-  /* Area 10 */
-    
-  for( line = 95 ; line < 100; ++line ) {
-    for( col = 95 ; col < 100 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
-    }
-  }     
-  
-  /* Area 11 */
-    
-  for( line = 0 ; line < 5; ++line ) {
-    for( col = 0 ; col < 5 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
-    }
-  }  
-  
-  /* Area 12 */
-    
-  for( line = 95 ; line < 100; ++line ) {
-    for( col = 0 ; col < 5 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
-    }
-  }      
-  
-  /* Area 13 */
-    
-  for( line = 40 ; line < 43; ++line ) {
-    for( col = 10 ; col < 13 ; ++col ) {
-      TEAGN_TRUE_OR_THROW( 
-        RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
-    }
-  }   
-  
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 11, 39, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 13, 41, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 11, 43, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 9, 41, 60.0, 0 ), "Raster fill error" );   
-    
-  /* Area 14 */
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 31, 39, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 31, 40, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 31, 41, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 31, 42, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 31, 43, 60.0, 0 ), "Raster fill error" );   
-
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 29, 41, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 30, 41, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 31, 41, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 32, 41, 60.0, 0 ), "Raster fill error" );   
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 33, 41, 60.0, 0 ), "Raster fill error" );   
-        
-  /* Area 15 */
-  
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 42, 39, 60.0, 0 ), "Raster fill error" );  
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 46, 39, 60.0, 0 ), "Raster fill error" );  
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 43, 40, 60.0, 0 ), "Raster fill error" );
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 45, 40, 60.0, 0 ), "Raster fill error" );
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 44, 41, 60.0, 0 ), "Raster fill error" );
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 43, 42, 60.0, 0 ), "Raster fill error" );
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 45, 42, 60.0, 0 ), "Raster fill error" );
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 42, 43, 60.0, 0 ), "Raster fill error" );
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 46, 43, 60.0, 0 ), "Raster fill error" );
-    
-  /* Area 16 */
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 55, 39, 60.0, 0 ), "Raster fill error" );  
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 56, 40, 60.0, 0 ), "Raster fill error" );      
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 57, 41, 60.0, 0 ), "Raster fill error" );      
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 58, 42, 60.0, 0 ), "Raster fill error" );      
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 59, 43, 60.0, 0 ), "Raster fill error" );      
-    
-  /* Area 17 */
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 10, 30, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 11, 29, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 12, 28, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 13, 27, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 14, 26, 60.0, 0 ), "Raster fill error" );     
-    
-  /* Area 18 */
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 10, 2, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 11, 2, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 9, 3, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 10, 3, 60.0, 0 ), "Raster fill error" ); 
-
-  /* Area 19 */
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 15, 2, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 16, 2, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 16, 3, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 17, 3, 60.0, 0 ), "Raster fill error" ); 
-    
-  /* Area 20 */
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 20, 2, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 20, 3, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 21, 3, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 21, 4, 60.0, 0 ), "Raster fill error" );    
-    
-  /* Area 20 */
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 25, 3, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 25, 4, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 26, 3, 60.0, 0 ), "Raster fill error" ); 
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 26, 2, 60.0, 0 ), "Raster fill error" );     
-    
-                      
-  /* Line 1 */
-    
-  for( line = 35 ; line < 55; ++line ) {
-    TEAGN_TRUE_OR_THROW( 
-      RAMRaster->setElement( 85, line, 200.0, 0 ), "Raster fill error" );
-  } 
-  
-  /* Line 2 */
-    
-  for( col = 25 ; col < 45; ++col ) {
-    TEAGN_TRUE_OR_THROW( 
-      RAMRaster->setElement( col, 65, 10.0, 0 ), "Raster fill error" );
-  }      
-  
-  /* Points */
-
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 55, 15, 250.0, 0 ), "Raster fill error" );  
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 55, 5, 251.0, 0 ), "Raster fill error" );      
-    
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 15, 15, 251.0, 0 ), "Raster fill error" );     
-
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->setElement( 35, 15, 0, 0 ), "Raster fill error" );     
-      
-  return RAMRaster; 
-}
-
-
-void Raster2Vector_test()
-{
-  TePDITypes::TePDIRasterPtrType RAMRaster = generateTestRaster();
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( RAMRaster,
-    TEPDIEXAMPLESBINPATH "Raster2Vector_test.tif" ), "GeoTIF generation error" );
-    
-  TePDITypes::TePDIPolSetMapPtrType output_polsets( 
-    new TePDITypes::TePDIPolSetMapType );
-
-  TePDIParameters params2;
-  params2.SetParameter( "rotulated_image", RAMRaster );
-  params2.SetParameter( "channel", (unsigned int)0 );
-  params2.SetParameter( "output_polsets", output_polsets );
-  params2.SetParameter( "max_pols", (unsigned long int)200 );
-  
-  TePDIRaster2Vector raster2Vector;  
-
-  TEAGN_TRUE_OR_THROW( raster2Vector.Reset( params2 ),
-    "Invalid Parameters for raster2Vector" );
-
-  TEAGN_TRUE_OR_THROW( raster2Vector.Apply(),
-    "Apply error" );
-    
-  TePDITypes::TePDIPolSetMapType::iterator it = output_polsets->begin();
-  TePDITypes::TePDIPolSetMapType::iterator it_end = output_polsets->end();
-  
-  unsigned int pols_number = 0;
-    
-  while( it != it_end ) {
-    TEAGN_TRUE_OR_THROW( exportPS2SHP( it->second, TEPDIEXAMPLESBINPATH "Raster2Vector_test_ps" +
-      Te2String( (int)it->first ) ),  "Polygonset export error" )
-      
-    pols_number += it->second.size();
-      
-    ++it;
-  }
-  
-  TEAGN_CHECK_EPS( output_polsets->size(), 9, 0.0,
-    "Invalid generated polygon set size" );
-  TEAGN_CHECK_EPS( pols_number, 41, 0.0,
-    "Invalid generated polygon set size" );
-    
-}
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );  
-  
-    TeInitRasterDecoders();
-
-    Raster2Vector_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+#include <TePDIRaster2Vector.hpp>
+#include <TeInitRasterDecoders.h>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+#include <shapefil.h> // Needed by exportPS2SHP
+
+bool exportPS2SHP( const TePolygonSet& ps, 
+    const std::string& base_file_name  )
+{
+    // creating files names
+    std::string dbfFilename = base_file_name + ".dbf";
+    std::string shpFilename = base_file_name + ".shp";
+
+    // creating polygons attribute list ( max attribute size == 12 )
+    TeAttributeList attList;
+    
+    TeAttribute at;
+    at.rep_.type_ = TeSTRING;               //the id of the cell
+    at.rep_.numChar_ = 10;
+    at.rep_.name_ = "object_id_";
+    at.rep_.isPrimaryKey_ = true;
+    
+    attList.push_back(at);
+    
+    /* DBF output file handle creation */
+
+    DBFHandle hDBF = DBFCreate( dbfFilename.c_str() );
+    TEAGN_TRUE_OR_RETURN( ( hDBF != 0 ), "DBF file creation error" );
+    
+    /* Writing attributes */
+
+    TeAttributeList::iterator it=attList.begin();
+    while ( it != attList.end() )
+    {
+      TeAttribute at = (*it);
+      string atName = at.rep_.name_;
+
+      // *OBS****atributos podem ter no maximo 12 caracteres
+      // max attribute size == 12
+      if (at.rep_.type_ == TeSTRING )
+      {
+        TEAGN_TRUE_OR_THROW( 
+          ( DBFAddField( hDBF, atName.c_str(), FTString, at.rep_.numChar_, 0 ) 
+           != -1 ), "Error writing TeSTRING attribute" );
+      }
+      else if (at.rep_.type_ == TeINT)
+      {
+        TEAGN_TRUE_OR_THROW( 
+          ( DBFAddField( hDBF, atName.c_str(), FTInteger, 10, 0 ) != -1 ), 
+          "Error writing TeINT attribute" );
+      }
+      else if (at.rep_.type_ == TeREAL)
+      {
+        TEAGN_TRUE_OR_THROW( 
+          ( DBFAddField( hDBF, atName.c_str(), FTDouble, 10, 5 ) != -1 ), 
+          "Error writing TeREAL attribute" );
+          
+      }
+      else if (at.rep_.type_ == TeDATETIME)
+      {
+        TEAGN_TRUE_OR_THROW( 
+          ( DBFAddField( hDBF, atName.c_str(), FTDate, 8, 0 ) != -1 ), 
+          "Error writing TeDATETIME attribute" );
+      }
+                
+      ++it;
+    }
+    
+    /* SHP output file handle creation */
+
+    SHPHandle hSHP = SHPCreate( shpFilename.c_str(), SHPT_POLYGON );
+    if( hSHP == 0 ) {
+      TEAGN_LOGERR( "DBF file creation error" );
+      DBFClose( hDBF );
+      return false;
+    }
+    
+    /* Writing polygons */
+
+    int iRecord = 0;
+    int totpoints = 0;
+    double  *padfX, *padfY;
+    SHPObject       *psObject;
+    int posXY, npoints, nelem;
+    int nVertices;
+    int* panParts;
+
+    TePolygonSet::iterator itps;
+    TePolygon poly;
+
+    for (itps = ps.begin() ; itps != ps.end() ; itps++ ) {
+      poly=(*itps);
+      totpoints = 0;
+      nVertices = poly.size();
+      for (unsigned int n=0; n<poly.size();n++) {
+        totpoints += poly[n].size();
+      }
+
+      panParts = (int *) malloc(sizeof(int) * nVertices);
+      padfX = (double *) malloc(sizeof(double) * totpoints);
+      padfY = (double *) malloc(sizeof(double) * totpoints);
+      posXY = 0;
+      nelem = 0;
+      
+      for (unsigned int l=0; l<poly.size(); ++l) {
+        if (l==0) {
+          if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) {
+            TeReverseLine(poly[l]);
+          }
+        } else {
+          if (TeOrientation(poly[l]) == TeCLOCKWISE) {
+            TeReverseLine(poly[l]);
+          }
+        }
+        
+        npoints = poly[l].size();
+        panParts[nelem]=posXY;
+        
+        for (int m=0; m<npoints; m++ ) {
+          padfX[posXY] = poly[l][m].x_;
+          padfY[posXY] = poly[l][m].y_;
+          posXY++;
+        }
+        
+        nelem++;
+      }
+                
+      psObject = SHPCreateObject( SHPT_POLYGON, -1, nelem, panParts, NULL,
+        posXY, padfX, padfY, NULL, NULL );
+        
+      int shpRes = SHPWriteObject( hSHP, -1, psObject );
+      TEAGN_TRUE_OR_THROW( ( shpRes != -1 ), 
+        "Unable to create a shape write object" )
+        
+      SHPDestroyObject( psObject );
+      free( panParts );
+      free( padfX );
+      free( padfY );
+
+      // writing attributes - same creation order
+      for (unsigned int j=0; j<attList.size();j++) {
+        if ( attList[j].rep_.type_ == TeSTRING ) {
+          DBFWriteStringAttribute(hDBF, iRecord, j, poly.objectId().c_str() );
+        } /*else if ( attList[j].rep_.type_ == TeINT) {
+          DBFWriteIntegerAttribute(hDBF, iRecord, j,  VALOR INT );        
+        } else if ( attList[j].rep_.type_ == TeREAL) {
+          DBFWriteDoubleAttribute(hDBF, iRecord, j,  VALOR DOUBLE);
+        } else if ( attList[j].rep_.type_ == TeDATETIME) {
+          TeTime time =  VALOR DATA;
+          char dd[8];
+          sprintf(dd,"%04d%02d%02d",time.year(),time.month(),time.day());
+          DBFWriteDateAttribute(hDBF, iRecord, j, dd );
+        }*/
+      }
+                
+      iRecord++;
+    }
+        
+    DBFClose( hDBF );
+    SHPClose( hSHP );
+
+    return true;  
+}
+
+TePDITypes::TePDIRasterPtrType generateTestRaster()
+{
+  TeRasterParams RAMRaster_params;
+  RAMRaster_params.nBands( 1 );
+  RAMRaster_params.setDataType( TeUNSIGNEDLONG );
+  RAMRaster_params.setDummy( 0, -1 );
+  RAMRaster_params.setNLinesNColumns( 100, 100 );
+  
+  TePDITypes::TePDIRasterPtrType RAMRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster,
+    RAMRaster_params, false ), "RAM Raster Alloc error" );
+    
+  int line = 0;
+  int col = 0;
+  
+  /* Area 1 */
+    
+  for( line = 10 ; line < 20; ++line ) {
+    for( col = 10 ; col < 20 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 10.0, 0 ), "Raster fill error" );
+    }
+  }
+  
+  /* Area 1 dummy hole */
+    
+  for( line = 13 ; line < 18; ++line ) {
+    for( col = 13 ; col < 18 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 0.0, 0 ), "Raster fill error" );
+    }
+  }  
+  
+  /* Area 2 */
+  
+  for( line = 10 ; line < 20; ++line ) {
+    for( col = 30 ; col < 40 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 20.0, 0 ), "Raster fill error" );
+    }
+  }  
+  
+  /* Area 2 hole */
+    
+  for( line = 13 ; line < 18; ++line ) {
+    for( col = 33 ; col < 38 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 10.0, 0 ), "Raster fill error" );
+    }
+  }  
+  
+  /* Area 3 */
+  
+  for( line = 10 ; line < 20; ++line ) {
+    for( col = 50 ; col < 60 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 30.0, 0 ), "Raster fill error" );
+    }
+  } 
+  
+  /* Area 4 */
+  
+  for( line = 0 ; line < 9; ++line ) {
+    for( col = 70 ; col < 100 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
+    }
+  } 
+  
+  for( line = 0 ; line < 40; ++line ) {
+    for( col = 90 ; col < 100 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
+    }
+  } 
+  
+  for( line = 30 ; line < 40; ++line ) {
+    for( col = 70 ; col < 100 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
+    }
+  } 
+  
+  for( line = 20 ; line < 30; ++line ) {
+    for( col = 70 ; col < 80 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
+    }
+  }   
+  
+  /* Area 5 */
+  
+  for( line = 50 ; line < 90; ++line ) {
+    for( col = 10 ; col < 90 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 50.0, 0 ), "Raster fill error" );
+    }
+  }
+  
+  /* Area 6 */
+    
+  for( line = 60 ; line < 70; ++line ) {
+    for( col = 20 ; col < 30 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 10.0, 0 ), "Raster fill error" );
+    }
+  }    
+  
+  /* Area 7 */
+    
+  for( line = 60 ; line < 70; ++line ) {
+    for( col = 40 ; col < 50 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 20.0, 0 ), "Raster fill error" );
+    }
+  }    
+
+  /* Area 8 */
+    
+  for( line = 60 ; line < 70; ++line ) {
+    for( col = 60 ; col < 70 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 30.0, 0 ), "Raster fill error" );
+    }
+  }    
+
+  /* Area 9 */
+    
+  for( line = 70 ; line < 80; ++line ) {
+    for( col = 20 ; col < 70 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 0.0, 0 ), "Raster fill error" );
+    }
+  }  
+  
+  /* Area 10 */
+    
+  for( line = 95 ; line < 100; ++line ) {
+    for( col = 95 ; col < 100 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
+    }
+  }     
+  
+  /* Area 11 */
+    
+  for( line = 0 ; line < 5; ++line ) {
+    for( col = 0 ; col < 5 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
+    }
+  }  
+  
+  /* Area 12 */
+    
+  for( line = 95 ; line < 100; ++line ) {
+    for( col = 0 ; col < 5 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
+    }
+  }      
+  
+  /* Area 13 */
+    
+  for( line = 40 ; line < 43; ++line ) {
+    for( col = 10 ; col < 13 ; ++col ) {
+      TEAGN_TRUE_OR_THROW( 
+        RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
+    }
+  }   
+  
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 11, 39, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 13, 41, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 11, 43, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 9, 41, 60.0, 0 ), "Raster fill error" );   
+    
+  /* Area 14 */
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 31, 39, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 31, 40, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 31, 41, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 31, 42, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 31, 43, 60.0, 0 ), "Raster fill error" );   
+
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 29, 41, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 30, 41, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 31, 41, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 32, 41, 60.0, 0 ), "Raster fill error" );   
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 33, 41, 60.0, 0 ), "Raster fill error" );   
+        
+  /* Area 15 */
+  
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 42, 39, 60.0, 0 ), "Raster fill error" );  
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 46, 39, 60.0, 0 ), "Raster fill error" );  
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 43, 40, 60.0, 0 ), "Raster fill error" );
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 45, 40, 60.0, 0 ), "Raster fill error" );
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 44, 41, 60.0, 0 ), "Raster fill error" );
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 43, 42, 60.0, 0 ), "Raster fill error" );
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 45, 42, 60.0, 0 ), "Raster fill error" );
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 42, 43, 60.0, 0 ), "Raster fill error" );
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 46, 43, 60.0, 0 ), "Raster fill error" );
+    
+  /* Area 16 */
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 55, 39, 60.0, 0 ), "Raster fill error" );  
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 56, 40, 60.0, 0 ), "Raster fill error" );      
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 57, 41, 60.0, 0 ), "Raster fill error" );      
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 58, 42, 60.0, 0 ), "Raster fill error" );      
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 59, 43, 60.0, 0 ), "Raster fill error" );      
+    
+  /* Area 17 */
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 10, 30, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 11, 29, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 12, 28, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 13, 27, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 14, 26, 60.0, 0 ), "Raster fill error" );     
+    
+  /* Area 18 */
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 10, 2, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 11, 2, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 9, 3, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 10, 3, 60.0, 0 ), "Raster fill error" ); 
+
+  /* Area 19 */
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 15, 2, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 16, 2, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 16, 3, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 17, 3, 60.0, 0 ), "Raster fill error" ); 
+    
+  /* Area 20 */
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 20, 2, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 20, 3, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 21, 3, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 21, 4, 60.0, 0 ), "Raster fill error" );    
+    
+  /* Area 20 */
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 25, 3, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 25, 4, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 26, 3, 60.0, 0 ), "Raster fill error" ); 
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 26, 2, 60.0, 0 ), "Raster fill error" );     
+    
+                      
+  /* Line 1 */
+    
+  for( line = 35 ; line < 55; ++line ) {
+    TEAGN_TRUE_OR_THROW( 
+      RAMRaster->setElement( 85, line, 200.0, 0 ), "Raster fill error" );
+  } 
+  
+  /* Line 2 */
+    
+  for( col = 25 ; col < 45; ++col ) {
+    TEAGN_TRUE_OR_THROW( 
+      RAMRaster->setElement( col, 65, 10.0, 0 ), "Raster fill error" );
+  }      
+  
+  /* Points */
+
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 55, 15, 250.0, 0 ), "Raster fill error" );  
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 55, 5, 251.0, 0 ), "Raster fill error" );      
+    
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 15, 15, 251.0, 0 ), "Raster fill error" );     
+
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->setElement( 35, 15, 0, 0 ), "Raster fill error" );     
+      
+  return RAMRaster; 
+}
+
+
+void Raster2Vector_test()
+{
+  TePDITypes::TePDIRasterPtrType RAMRaster = generateTestRaster();
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( RAMRaster,
+    TEPDIEXAMPLESBINPATH "Raster2Vector_test.tif" ), "GeoTIF generation error" );
+    
+  TePDITypes::TePDIPolSetMapPtrType output_polsets( 
+    new TePDITypes::TePDIPolSetMapType );
+
+  TePDIParameters params2;
+  params2.SetParameter( "rotulated_image", RAMRaster );
+  params2.SetParameter( "channel", (unsigned int)0 );
+  params2.SetParameter( "output_polsets", output_polsets );
+  params2.SetParameter( "max_pols", (unsigned long int)200 );
+  
+  TePDIRaster2Vector raster2Vector;  
+
+  TEAGN_TRUE_OR_THROW( raster2Vector.Reset( params2 ),
+    "Invalid Parameters for raster2Vector" );
+
+  TEAGN_TRUE_OR_THROW( raster2Vector.Apply(),
+    "Apply error" );
+    
+  TePDITypes::TePDIPolSetMapType::iterator it = output_polsets->begin();
+  TePDITypes::TePDIPolSetMapType::iterator it_end = output_polsets->end();
+  
+  unsigned int pols_number = 0;
+    
+  while( it != it_end ) {
+    TEAGN_TRUE_OR_THROW( exportPS2SHP( it->second, TEPDIEXAMPLESBINPATH "Raster2Vector_test_ps" +
+      Te2String( (int)it->first ) ),  "Polygonset export error" )
+      
+    pols_number += it->second.size();
+      
+    ++it;
+  }
+  
+  TEAGN_CHECK_EPS( output_polsets->size(), 9, 0.0,
+    "Invalid generated polygon set size" );
+  TEAGN_CHECK_EPS( pols_number, 41, 0.0,
+    "Invalid generated polygon set size" );
+    
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );  
+  
+    TeInitRasterDecoders();
+
+    Raster2Vector_test();
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector_test.vcproj b/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector_test.vcproj
old mode 100755
new mode 100644
index 15a6d1f..6daf826
--- a/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector_test.vcproj
+++ b/examples/image_processing/source/TePDIRaster2Vector/TePDIRaster2Vector_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIRaster2Vector_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIRaster2Vector_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/shapelib;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIRaster2Vector_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIRaster2Vector_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIRaster2Vector_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIRaster2Vector_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIRaster2Vector_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/shapelib;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIRaster2Vector_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIRaster2Vector_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIRaster2Vector_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIRegister/.cvsignore b/examples/image_processing/source/TePDIRegister/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIRegister/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIRegister/TePDIRegister.pro b/examples/image_processing/source/TePDIRegister/TePDIRegister.pro
old mode 100755
new mode 100644
index d244568..4c3519b
--- a/examples/image_processing/source/TePDIRegister/TePDIRegister.pro
+++ b/examples/image_processing/source/TePDIRegister/TePDIRegister.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIRegister_test.cpp
-
-QMAKE_CLEAN += \
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIRegister_test.cpp
+
+QMAKE_CLEAN += \
   ../../bin/Register*.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIRegister/TePDIRegister_test.cpp b/examples/image_processing/source/TePDIRegister/TePDIRegister_test.cpp
old mode 100755
new mode 100644
index ca473e5..7c8adda
--- a/examples/image_processing/source/TePDIRegister/TePDIRegister_test.cpp
+++ b/examples/image_processing/source/TePDIRegister/TePDIRegister_test.cpp
@@ -1,138 +1,138 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIRegister.hpp>
-
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TePrecision.h>
-
-
-void Register_test1()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
-    "Unable to init reference_raster" );
-    
-  TePDITypes::TePDIRasterPtrType adjust_disk_raster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( adjust_disk_raster->init(), 
-    "Unable to init adjust_disk_raster" );     
-    
-  TePDITypes::TePDIRasterPtrType adjust_raster( new TeRaster() );
-  {
-    TeRasterParams adjust_raster_params;
-    
-    adjust_raster_params.setDataType( TeUNSIGNEDCHAR, -1 );
-    adjust_raster_params.nBands( 1 );
-    adjust_raster_params.setNLinesNColumns( 
-      adjust_disk_raster->params().nlines_,
-      adjust_disk_raster->params().ncols_ );
-    
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( adjust_raster,
-      adjust_raster_params, false ), "adjust_raster Alloc error" );   
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterBands( adjust_disk_raster,
-      adjust_raster, false, false ), "Pixel copy error" );
-  }
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );   
-    
-  TePDITypes::TeProjParamsPtrType proj_params( new TeProjectionParams );
-  *proj_params = reference_raster->projection()->params();
-  params.SetParameter( "proj_params" , proj_params );  
-
-  params.SetParameter( "res_x" , reference_raster->params().resx_ );
-  params.SetParameter( "res_y" , reference_raster->params().resy_ );
-      
-  params.SetParameter( "adjust_raster" , adjust_raster );
-  params.SetParameter( "output_raster" , output_raster );
-  params.SetParameter( "gt_name" , std::string( "affine" ) );
-  params.SetParameter( "dummy_value" , (double)0.0 );
-  params.SetParameter( "interpolator" , TePDIInterpolator::NNMethod );
-  
-  std::vector< int > adjust_channels;
-  adjust_channels.push_back( 0 );
-  params.SetParameter( "adjust_channels" , adjust_channels );
-  
-  TePDITypes::TeCoordPairVectPtrType tie_points( new TeCoordPairVect );
-  
-  tie_points->push_back( 
-    TeCoordPair( TeCoord2D( 278, 269 ),
-    reference_raster->index2Coord( TeCoord2D( 492, 502 ) ) ) );
-  tie_points->push_back( 
-    TeCoordPair( TeCoord2D( 282, 88 ),
-    reference_raster->index2Coord( TeCoord2D( 495, 320 ) ) ) );  
-  tie_points->push_back( 
-    TeCoordPair( TeCoord2D( 66, 12 ),
-    reference_raster->index2Coord( TeCoord2D( 279, 245 ) ) ) );  
-    
-    
-  params.SetParameter( "tie_points" , tie_points );
-  
-  TePDIRegister algo; 
-  TEAGN_TRUE_OR_THROW( algo.Reset(params), "Apply error" );
-  TEAGN_TRUE_OR_THROW( algo.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "Register_test1.tif" ), "GeoTIF generation error" );  
-  
-  TEAGN_CHECK_EPS( output_raster->params().nlines_, 
-    adjust_disk_raster->params().nlines_, 7.0, "Invalid lines number" );
-  TEAGN_CHECK_EPS( output_raster->params().ncols_, 
-    adjust_disk_raster->params().ncols_, 2.0, "Invalid cols number" );
-  TEAGN_CHECK_EPS( output_raster->params().nBands(), 
-    adjust_disk_raster->params().nBands(), 0.0001, "Invalid bands number" );    
-  TEAGN_CHECK_EPS( output_raster->params().resx_, 
-    adjust_disk_raster->params().resx_, 0.0001, "Invalid x res" );
-  TEAGN_CHECK_EPS( output_raster->params().resy_, 
-    adjust_disk_raster->params().resy_, 0.0001, "Invalid y res" );
-  TEAGN_CHECK_EPS( output_raster->params().box().x1(), 
-    adjust_disk_raster->params().box().x1(), 29.0, "Invalid box x1" );    
-  TEAGN_CHECK_EPS( output_raster->params().box().x2(), 
-    adjust_disk_raster->params().box().x2(), 22.0, "Invalid box x2" );    
-  TEAGN_CHECK_EPS( output_raster->params().box().y1(), 
-    adjust_disk_raster->params().box().y1(), 100.0, "Invalid box y1" );    
-  TEAGN_CHECK_EPS( output_raster->params().box().y2(), 
-    adjust_disk_raster->params().box().y2(), 51.0, "Invalid box y2" );    
-
-  reference_raster.reset();
-  adjust_disk_raster.reset();
-  adjust_raster.reset();
-  output_raster.reset();
-  tie_points.reset();
-}
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeInitRasterDecoders();
-    
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-    
-    TePrecision::instance().setPrecision( 0.000000000001 );
-
-    Register_test1();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIRegister.hpp>
+
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+
+#include <TeInitRasterDecoders.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TePrecision.h>
+
+
+void Register_test1()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType reference_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_A.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( reference_raster->init(), 
+    "Unable to init reference_raster" );
+    
+  TePDITypes::TePDIRasterPtrType adjust_disk_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_B_contraste.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( adjust_disk_raster->init(), 
+    "Unable to init adjust_disk_raster" );     
+    
+  TePDITypes::TePDIRasterPtrType adjust_raster( new TeRaster() );
+  {
+    TeRasterParams adjust_raster_params;
+    
+    adjust_raster_params.setDataType( TeUNSIGNEDCHAR, -1 );
+    adjust_raster_params.nBands( 1 );
+    adjust_raster_params.setNLinesNColumns( 
+      adjust_disk_raster->params().nlines_,
+      adjust_disk_raster->params().ncols_ );
+    
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( adjust_raster,
+      adjust_raster_params, false ), "adjust_raster Alloc error" );   
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterBands( adjust_disk_raster,
+      adjust_raster, false, false ), "Pixel copy error" );
+  }
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );   
+    
+  TePDITypes::TeProjParamsPtrType proj_params( new TeProjectionParams );
+  *proj_params = reference_raster->projection()->params();
+  params.SetParameter( "proj_params" , proj_params );  
+
+  params.SetParameter( "res_x" , reference_raster->params().resx_ );
+  params.SetParameter( "res_y" , reference_raster->params().resy_ );
+      
+  params.SetParameter( "adjust_raster" , adjust_raster );
+  params.SetParameter( "output_raster" , output_raster );
+  params.SetParameter( "gt_name" , std::string( "affine" ) );
+  params.SetParameter( "dummy_value" , (double)0.0 );
+  params.SetParameter( "interpolator" , TePDIInterpolator::NNMethod );
+  
+  std::vector< int > adjust_channels;
+  adjust_channels.push_back( 0 );
+  params.SetParameter( "adjust_channels" , adjust_channels );
+  
+  TePDITypes::TeCoordPairVectPtrType tie_points( new TeCoordPairVect );
+  
+  tie_points->push_back( 
+    TeCoordPair( TeCoord2D( 278, 269 ),
+    reference_raster->index2Coord( TeCoord2D( 492, 502 ) ) ) );
+  tie_points->push_back( 
+    TeCoordPair( TeCoord2D( 282, 88 ),
+    reference_raster->index2Coord( TeCoord2D( 495, 320 ) ) ) );  
+  tie_points->push_back( 
+    TeCoordPair( TeCoord2D( 66, 12 ),
+    reference_raster->index2Coord( TeCoord2D( 279, 245 ) ) ) );  
+    
+    
+  params.SetParameter( "tie_points" , tie_points );
+  
+  TePDIRegister algo; 
+  TEAGN_TRUE_OR_THROW( algo.Reset(params), "Apply error" );
+  TEAGN_TRUE_OR_THROW( algo.Apply(), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "Register_test1.tif" ), "GeoTIF generation error" );  
+  
+  TEAGN_CHECK_EPS( output_raster->params().nlines_, 
+    adjust_disk_raster->params().nlines_, 7.0, "Invalid lines number" );
+  TEAGN_CHECK_EPS( output_raster->params().ncols_, 
+    adjust_disk_raster->params().ncols_, 2.0, "Invalid cols number" );
+  TEAGN_CHECK_EPS( output_raster->params().nBands(), 
+    adjust_disk_raster->params().nBands(), 0.0001, "Invalid bands number" );    
+  TEAGN_CHECK_EPS( output_raster->params().resx_, 
+    adjust_disk_raster->params().resx_, 0.0001, "Invalid x res" );
+  TEAGN_CHECK_EPS( output_raster->params().resy_, 
+    adjust_disk_raster->params().resy_, 0.0001, "Invalid y res" );
+  TEAGN_CHECK_EPS( output_raster->params().box().x1(), 
+    adjust_disk_raster->params().box().x1(), 29.0, "Invalid box x1" );    
+  TEAGN_CHECK_EPS( output_raster->params().box().x2(), 
+    adjust_disk_raster->params().box().x2(), 22.0, "Invalid box x2" );    
+  TEAGN_CHECK_EPS( output_raster->params().box().y1(), 
+    adjust_disk_raster->params().box().y1(), 100.0, "Invalid box y1" );    
+  TEAGN_CHECK_EPS( output_raster->params().box().y2(), 
+    adjust_disk_raster->params().box().y2(), 51.0, "Invalid box y2" );    
+
+  reference_raster.reset();
+  adjust_disk_raster.reset();
+  adjust_raster.reset();
+  output_raster.reset();
+  tie_points.reset();
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeInitRasterDecoders();
+    
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+    
+    TePrecision::instance().setPrecision( 0.000000000001 );
+
+    Register_test1();
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIRegister/TePDIRegister_test.vcproj b/examples/image_processing/source/TePDIRegister/TePDIRegister_test.vcproj
old mode 100755
new mode 100644
index eaa4c42..1fdfac4
--- a/examples/image_processing/source/TePDIRegister/TePDIRegister_test.vcproj
+++ b/examples/image_processing/source/TePDIRegister/TePDIRegister_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIRegister_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIRegister_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIRegister_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIRegister_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIRegister_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIRegister_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIRegister_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIRegister_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIRegister_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIRegister_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIRgbPalette/.cvsignore b/examples/image_processing/source/TePDIRgbPalette/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIRgbPalette/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette.pro b/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette.pro
old mode 100755
new mode 100644
index a21913f..5bbdcc9
--- a/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette.pro
+++ b/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette.pro
@@ -1,4 +1,4 @@
-include( ../base/base.pro )
-
-SOURCES += TePDIRgbPalette_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += TePDIRgbPalette_test.cpp
+
diff --git a/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette_test.cpp b/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette_test.cpp
old mode 100755
new mode 100644
index d50a5ae..d3b3fb9
--- a/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette_test.cpp
+++ b/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette_test.cpp
@@ -1,34 +1,34 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIUtils.hpp>
-
-#include <TeInitRasterDecoders.h>
-
-#include <TeAgnostic.h>
-#include <TePDIRgbPalette.hpp>
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TePDIRgbPalette pal;
-
-    pal[ 1.0 ] = TePDIRgbPaletteNode( 1, 1, 1 );
-
-    TePDIRgbPalette::iterator it = pal.begin();
-
-    TEAGN_TRUE_OR_THROW( ( it->first == 1. ), "Invalid value" );
-    TEAGN_TRUE_OR_THROW( ( it->second.red_ == 1 ), "Invalid value" );
-    TEAGN_TRUE_OR_THROW( ( it->second.green_ == 1 ), "Invalid value" );
-    TEAGN_TRUE_OR_THROW( ( it->second.blue_ == 1 ), "Invalid value" );
-
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIUtils.hpp>
+
+#include <TeInitRasterDecoders.h>
+
+#include <TeAgnostic.h>
+#include <TePDIRgbPalette.hpp>
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TePDIRgbPalette pal;
+
+    pal[ 1.0 ] = TePDIRgbPaletteNode( 1, 1, 1 );
+
+    TePDIRgbPalette::iterator it = pal.begin();
+
+    TEAGN_TRUE_OR_THROW( ( it->first == 1. ), "Invalid value" );
+    TEAGN_TRUE_OR_THROW( ( it->second.red_ == 1 ), "Invalid value" );
+    TEAGN_TRUE_OR_THROW( ( it->second.green_ == 1 ), "Invalid value" );
+    TEAGN_TRUE_OR_THROW( ( it->second.blue_ == 1 ), "Invalid value" );
+
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette_test.vcproj b/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette_test.vcproj
old mode 100755
new mode 100644
index 10d07aa..ff0c9ae
--- a/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette_test.vcproj
+++ b/examples/image_processing/source/TePDIRgbPalette/TePDIRgbPalette_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIRgbPalette_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIRgbPalette_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIRgbPalette_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIRgbPalette_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIRgbPalette_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIRgbPalette_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIRgbPalette_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIRgbPalette_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIRgbPalette_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIRgbPalette_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDISegmentation/.cvsignore b/examples/image_processing/source/TePDISegmentation/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDISegmentation/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDISegmentation/TePDISegmentation.pro b/examples/image_processing/source/TePDISegmentation/TePDISegmentation.pro
old mode 100755
new mode 100644
index ffbd4bd..f331fe6
--- a/examples/image_processing/source/TePDISegmentation/TePDISegmentation.pro
+++ b/examples/image_processing/source/TePDISegmentation/TePDISegmentation.pro
@@ -1,8 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDISegmentation_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/Segmentation*
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDISegmentation_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/Segmentation*
   
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDISegmentation/TePDISegmentation_test.cpp b/examples/image_processing/source/TePDISegmentation/TePDISegmentation_test.cpp
old mode 100755
new mode 100644
index 98c3ec3..43d53f6
--- a/examples/image_processing/source/TePDISegmentation/TePDISegmentation_test.cpp
+++ b/examples/image_processing/source/TePDISegmentation/TePDISegmentation_test.cpp
@@ -1,328 +1,342 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-#include <TePDIRegGrowSeg.hpp>
-#include <TePDIBaatz.hpp>
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-#include <shapefil.h> // Needed by exportPS2SHP
-
-bool exportPS2SHP( const TePolygonSet& ps, 
-    const std::string& base_file_name  )
-{
-    // creating files names
-    std::string dbfFilename = base_file_name + ".dbf";
-    std::string shpFilename = base_file_name + ".shp";
-
-    // creating polygons attribute list ( max attribute size == 12 )
-    TeAttributeList attList;
-    
-    TeAttribute at;
-    at.rep_.type_ = TeSTRING;               //the id of the cell
-    at.rep_.numChar_ = 10;
-    at.rep_.name_ = "object_id_";
-    at.rep_.isPrimaryKey_ = true;
-    
-    attList.push_back(at);
-    
-    /* DBF output file handle creation */
-
-    DBFHandle hDBF = DBFCreate( dbfFilename.c_str() );
-    TEAGN_TRUE_OR_RETURN( ( hDBF != 0 ), "DBF file creation error" );
-    
-    /* Writing attributes */
-
-    TeAttributeList::iterator it=attList.begin();
-    while ( it != attList.end() )
-    {
-      TeAttribute at = (*it);
-      string atName = at.rep_.name_;
-
-      // *OBS****atributos podem ter no maximo 12 caracteres
-      // max attribute size == 12
-      if (at.rep_.type_ == TeSTRING )
-      {
-        TEAGN_TRUE_OR_THROW( 
-          ( DBFAddField( hDBF, atName.c_str(), FTString, at.rep_.numChar_, 0 ) 
-           != -1 ), "Error writing TeSTRING attribute" );
-      }
-      else if (at.rep_.type_ == TeINT)
-      {
-        TEAGN_TRUE_OR_THROW( 
-          ( DBFAddField( hDBF, atName.c_str(), FTInteger, 10, 0 ) != -1 ), 
-          "Error writing TeINT attribute" );
-      }
-      else if (at.rep_.type_ == TeREAL)
-      {
-        TEAGN_TRUE_OR_THROW( 
-          ( DBFAddField( hDBF, atName.c_str(), FTDouble, 10, 5 ) != -1 ), 
-          "Error writing TeREAL attribute" );
-          
-      }
-      else if (at.rep_.type_ == TeDATETIME)
-      {
-        TEAGN_TRUE_OR_THROW( 
-          ( DBFAddField( hDBF, atName.c_str(), FTDate, 8, 0 ) != -1 ), 
-          "Error writing TeDATETIME attribute" );
-      }
-                
-      ++it;
-    }
-    
-    /* SHP output file handle creation */
-
-    SHPHandle hSHP = SHPCreate( shpFilename.c_str(), SHPT_POLYGON );
-    if( hSHP == 0 ) {
-      TEAGN_LOGERR( "DBF file creation error" );
-      DBFClose( hDBF );
-      return false;
-    }
-    
-    /* Writing polygons */
-
-    int iRecord = 0;
-    int totpoints = 0;
-    double  *padfX, *padfY;
-    SHPObject       *psObject;
-    int posXY, npoints, nelem;
-    int nVertices;
-    int* panParts;
-
-    TePolygonSet::iterator itps;
-    TePolygon poly;
-
-    for (itps = ps.begin() ; itps != ps.end() ; itps++ ) {
-      poly=(*itps);
-      totpoints = 0;
-      nVertices = poly.size();
-      for (unsigned int n=0; n<poly.size();n++) {
-        totpoints += poly[n].size();
-      }
-
-      panParts = (int *) malloc(sizeof(int) * nVertices);
-      padfX = (double *) malloc(sizeof(double) * totpoints);
-      padfY = (double *) malloc(sizeof(double) * totpoints);
-      posXY = 0;
-      nelem = 0;
-      
-      for (unsigned int l=0; l<poly.size(); ++l) {
-        if (l==0) {
-          if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) {
-            TeReverseLine(poly[l]);
-          }
-        } else {
-          if (TeOrientation(poly[l]) == TeCLOCKWISE) {
-            TeReverseLine(poly[l]);
-          }
-        }
-        
-        npoints = poly[l].size();
-        panParts[nelem]=posXY;
-        
-        for (int m=0; m<npoints; m++ ) {
-          padfX[posXY] = poly[l][m].x_;
-          padfY[posXY] = poly[l][m].y_;
-          posXY++;
-        }
-        
-        nelem++;
-      }
-                
-      psObject = SHPCreateObject( SHPT_POLYGON, -1, nelem, panParts, NULL,
-        posXY, padfX, padfY, NULL, NULL );
-        
-      int shpRes = SHPWriteObject( hSHP, -1, psObject );
-      TEAGN_TRUE_OR_THROW( ( shpRes != -1 ), 
-        "Unable to create a shape write object" )
-        
-      SHPDestroyObject( psObject );
-      free( panParts );
-      free( padfX );
-      free( padfY );
-
-      // writing attributes - same creation order
-      for (unsigned int j=0; j<attList.size();j++) {
-        if ( attList[j].rep_.type_ == TeSTRING ) {
-          DBFWriteStringAttribute(hDBF, iRecord, j, poly.objectId().c_str() );
-        } /*else if ( attList[j].rep_.type_ == TeINT) {
-          DBFWriteIntegerAttribute(hDBF, iRecord, j,  VALOR INT );        
-        } else if ( attList[j].rep_.type_ == TeREAL) {
-          DBFWriteDoubleAttribute(hDBF, iRecord, j,  VALOR DOUBLE);
-        } else if ( attList[j].rep_.type_ == TeDATETIME) {
-          TeTime time =  VALOR DATA;
-          char dd[8];
-          sprintf(dd,"%04d%02d%02d",time.year(),time.month(),time.day());
-          DBFWriteDateAttribute(hDBF, iRecord, j, dd );
-        }*/
-      }
-                
-      iRecord++;
-    }
-        
-    DBFClose( hDBF );
-    SHPClose( hSHP );
-
-    return true;  
-}
-
-
-bool checkNumberCells(TePDITypes::TePDIRasterPtrType outRaster, long nbCell)
-{
-        double val;
-        long max=0;
-        for (int i=0 ; i<outRaster->params().nlines_ ; i++)
-                for (int j=0 ; j<outRaster->params().ncols_ ; j++){
-                        outRaster->getElement(j,i,val,0);
-                        if (val>max)
-                                max=(long)val;
-                }
-        if (max!=nbCell)
-                return false;
-
-        return true;
-}
-
-
-void RegionGrowingStrategy_test()
-{
-  TePDIParameters params;
-  
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-    1, 1, 1, true, TeUNSIGNEDLONG, 0 ), "RAM Raster Alloc error" );    
-  params.SetParameter( "output_image", outRaster );
-
-  TePDITypes::TePDIRasterPtrType dummy_ptr;
-  params.SetParameter( "exclusion_image", dummy_ptr );
-  params.SetParameter( "euc_treshold", (double)20 );
-  params.SetParameter( "area_min", (int)15 );
-  
-  TePDITypes::TePDIPolSetMapPtrType output_polsets( 
-    new TePDITypes::TePDIPolSetMapType );
-  params.SetParameter( "output_polsets", output_polsets );
-  
-  TePDIRegGrowSeg segmenter;
-  
-  TEAGN_TRUE_OR_THROW( segmenter.Reset(params), "Reset failed" );
-  
-  TEAGN_TRUE_OR_THROW( segmenter.Apply(), "Apply error" );  
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Segmentation_RegionGrowing_test.tif", TeUNSIGNEDCHAR ), 
-    "GeoTIF generation error" );   
-  
-  TePDITypes::TePDIPolSetMapType::iterator it = output_polsets->begin();
-  TePDITypes::TePDIPolSetMapType::iterator it_end = output_polsets->end();  
-  
-  unsigned int pols_number = 0;
-    
-  while( it != it_end ) {
-    TEAGN_TRUE_OR_THROW( exportPS2SHP( it->second, 
-      TEPDIEXAMPLESBINPATH "Segmentation_RegionGrowingPols_ps" +
-      Te2String( (int)it->first ) ),  "Polygonset export error" )
-      
-    pols_number += it->second.size();
-      
-    ++it;
-  }
-  
-  TEAGN_CHECK_EPS( output_polsets->size(), 23, 0.0,
-    "Invalid generated polygon set size" );
-  TEAGN_CHECK_EPS( pols_number, 23, 0.0,
-    "Invalid generated polygon set size" );    
-
-  //with an euclidian treshold of 20 and an area min of 15
-  //you are suppose to find 23 cells
-  //(you can use the spring software to check that number with
-  // others images and/or paramaters)
-  TEAGN_TRUE_OR_THROW( checkNumberCells(outRaster, 23),
-    "Check number of cell Error" );
-}
-
-void Baatz_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  params.SetParameter( "input_image", inRaster );
-
-  std::vector<unsigned> input_bands;
-  input_bands.push_back( 0 );
-  input_bands.push_back( 1 );
-  input_bands.push_back( 2 );
-  params.SetParameter( "input_bands", input_bands );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
-  1, 1, 1, true, TeUNSIGNEDLONG, 0 ), "RAM Raster Alloc error" );    
-  params.SetParameter( "output_image", outRaster );
-  params.SetParameter( "scale", (float) 30 );
-  params.SetParameter( "compactness", (float) 0.4 );
-  params.SetParameter( "color", (float) 0.5 );
-
-  vector<float> input_weights;
-  input_weights.push_back( (float) 0.7 );
-  input_weights.push_back( (float) 0.2 );
-  input_weights.push_back( (float) 0.1 );
-  params.SetParameter( "input_weights", input_weights );
-
-  TePDITypes::TePDIPolSetMapPtrType output_polsets( 
-  new TePDITypes::TePDIPolSetMapType );
-  params.SetParameter( "output_polsets", output_polsets );
-
-  TePDIBaatz segmenter;
-
-  TEAGN_TRUE_OR_THROW( segmenter.Reset(params), "Reset failed" );
-
-  TEAGN_TRUE_OR_THROW( segmenter.Apply(), "Apply error" );  
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Segmentation_Baatz_test.tif", TeUNSIGNEDCHAR ), 
-    "GeoTIF generation error" );   
-
-  TePDITypes::TePDIPolSetMapType::iterator it = output_polsets->begin();
-  TePDITypes::TePDIPolSetMapType::iterator it_end = output_polsets->end();  
-  TePolygonSet pols;
-  while( it != it_end ) 
-  {
-    pols.copyElements(it->second);
-    ++it;
-  }
-  exportPS2SHP( pols, TEPDIEXAMPLESBINPATH "Segmentation_BaatzPols_ps");
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-  
-    TeInitRasterDecoders();
-    
-    Baatz_test();
-    RegionGrowingStrategy_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+#include <TePDIRegGrowSeg.hpp>
+#include <TePDIBaatz.hpp>
+#include <TeInitRasterDecoders.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+#include <shapefil.h> // Needed by exportPS2SHP
+
+#include <time.h>
+
+bool exportPS2SHP( const TePolygonSet& ps, 
+    const std::string& base_file_name  )
+{
+    // creating files names
+    std::string dbfFilename = base_file_name + ".dbf";
+    std::string shpFilename = base_file_name + ".shp";
+
+    // creating polygons attribute list ( max attribute size == 12 )
+    TeAttributeList attList;
+    
+    TeAttribute at;
+    at.rep_.type_ = TeSTRING;               //the id of the cell
+    at.rep_.numChar_ = 10;
+    at.rep_.name_ = "object_id_";
+    at.rep_.isPrimaryKey_ = true;
+    
+    attList.push_back(at);
+    
+    /* DBF output file handle creation */
+
+    DBFHandle hDBF = DBFCreate( dbfFilename.c_str() );
+    TEAGN_TRUE_OR_RETURN( ( hDBF != 0 ), "DBF file creation error" );
+    
+    /* Writing attributes */
+
+    TeAttributeList::iterator it=attList.begin();
+    while ( it != attList.end() )
+    {
+      TeAttribute at = (*it);
+      string atName = at.rep_.name_;
+
+      // *OBS****atributos podem ter no maximo 12 caracteres
+      // max attribute size == 12
+      if (at.rep_.type_ == TeSTRING )
+      {
+        TEAGN_TRUE_OR_THROW( 
+          ( DBFAddField( hDBF, atName.c_str(), FTString, at.rep_.numChar_, 0 ) 
+           != -1 ), "Error writing TeSTRING attribute" );
+      }
+      else if (at.rep_.type_ == TeINT)
+      {
+        TEAGN_TRUE_OR_THROW( 
+          ( DBFAddField( hDBF, atName.c_str(), FTInteger, 10, 0 ) != -1 ), 
+          "Error writing TeINT attribute" );
+      }
+      else if (at.rep_.type_ == TeREAL)
+      {
+        TEAGN_TRUE_OR_THROW( 
+          ( DBFAddField( hDBF, atName.c_str(), FTDouble, 10, 5 ) != -1 ), 
+          "Error writing TeREAL attribute" );
+          
+      }
+      else if (at.rep_.type_ == TeDATETIME)
+      {
+        TEAGN_TRUE_OR_THROW( 
+          ( DBFAddField( hDBF, atName.c_str(), FTDate, 8, 0 ) != -1 ), 
+          "Error writing TeDATETIME attribute" );
+      }
+                
+      ++it;
+    }
+    
+    /* SHP output file handle creation */
+
+    SHPHandle hSHP = SHPCreate( shpFilename.c_str(), SHPT_POLYGON );
+    if( hSHP == 0 ) {
+      TEAGN_LOGERR( "DBF file creation error" );
+      DBFClose( hDBF );
+      return false;
+    }
+    
+    /* Writing polygons */
+
+    int iRecord = 0;
+    int totpoints = 0;
+    double  *padfX, *padfY;
+    SHPObject       *psObject;
+    int posXY, npoints, nelem;
+    int nVertices;
+    int* panParts;
+
+    TePolygonSet::iterator itps;
+    TePolygon poly;
+
+    for (itps = ps.begin() ; itps != ps.end() ; itps++ ) {
+      poly=(*itps);
+      totpoints = 0;
+      nVertices = poly.size();
+      for (unsigned int n=0; n<poly.size();n++) {
+        totpoints += poly[n].size();
+      }
+
+      panParts = (int *) malloc(sizeof(int) * nVertices);
+      padfX = (double *) malloc(sizeof(double) * totpoints);
+      padfY = (double *) malloc(sizeof(double) * totpoints);
+      posXY = 0;
+      nelem = 0;
+      
+      for (unsigned int l=0; l<poly.size(); ++l) {
+        if (l==0) {
+          if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) {
+            TeReverseLine(poly[l]);
+          }
+        } else {
+          if (TeOrientation(poly[l]) == TeCLOCKWISE) {
+            TeReverseLine(poly[l]);
+          }
+        }
+        
+        npoints = poly[l].size();
+        panParts[nelem]=posXY;
+        
+        for (int m=0; m<npoints; m++ ) {
+          padfX[posXY] = poly[l][m].x_;
+          padfY[posXY] = poly[l][m].y_;
+          posXY++;
+        }
+        
+        nelem++;
+      }
+                
+      psObject = SHPCreateObject( SHPT_POLYGON, -1, nelem, panParts, NULL,
+        posXY, padfX, padfY, NULL, NULL );
+        
+      int shpRes = SHPWriteObject( hSHP, -1, psObject );
+      TEAGN_TRUE_OR_THROW( ( shpRes != -1 ), 
+        "Unable to create a shape write object" )
+        
+      SHPDestroyObject( psObject );
+      free( panParts );
+      free( padfX );
+      free( padfY );
+
+      // writing attributes - same creation order
+      for (unsigned int j=0; j<attList.size();j++) {
+        if ( attList[j].rep_.type_ == TeSTRING ) {
+          DBFWriteStringAttribute(hDBF, iRecord, j, poly.objectId().c_str() );
+        } /*else if ( attList[j].rep_.type_ == TeINT) {
+          DBFWriteIntegerAttribute(hDBF, iRecord, j,  VALOR INT );        
+        } else if ( attList[j].rep_.type_ == TeREAL) {
+          DBFWriteDoubleAttribute(hDBF, iRecord, j,  VALOR DOUBLE);
+        } else if ( attList[j].rep_.type_ == TeDATETIME) {
+          TeTime time =  VALOR DATA;
+          char dd[8];
+          sprintf(dd,"%04d%02d%02d",time.year(),time.month(),time.day());
+          DBFWriteDateAttribute(hDBF, iRecord, j, dd );
+        }*/
+      }
+                
+      iRecord++;
+    }
+        
+    DBFClose( hDBF );
+    SHPClose( hSHP );
+
+    return true;  
+}
+
+
+bool checkNumberCells(TePDITypes::TePDIRasterPtrType outRaster, long nbCell)
+{
+        double val;
+        long max=0;
+        for (int i=0 ; i<outRaster->params().nlines_ ; i++)
+                for (int j=0 ; j<outRaster->params().ncols_ ; j++){
+                        outRaster->getElement(j,i,val,0);
+                        if (val>max)
+                                max=(long)val;
+                }
+        if (max!=nbCell)
+                return false;
+
+        return true;
+}
+
+
+void TePDIRegGrowSeg_test()
+{
+  TePDIParameters params;
+  
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+    1, 1, 1, true, TeUNSIGNEDLONG, 0 ), "RAM Raster Alloc error" );    
+  params.SetParameter( "output_image", outRaster );
+
+  TePDITypes::TePDIRasterPtrType dummy_ptr;
+  params.SetParameter( "exclusion_image", dummy_ptr );
+  params.SetParameter( "euc_treshold", (double)20 );
+  params.SetParameter( "area_min", (int)15 );
+  
+  TePDITypes::TePDIPolSetMapPtrType output_polsets( 
+    new TePDITypes::TePDIPolSetMapType );
+  params.SetParameter( "output_polsets", output_polsets );
+  
+  TePDIRegGrowSeg segmenter;
+  
+  TEAGN_TRUE_OR_THROW( segmenter.Reset(params), "Reset failed" );
+  
+  double initTime = ((double)clock()) / ((double)CLOCKS_PER_SEC) ;
+  
+  TEAGN_TRUE_OR_THROW( segmenter.Apply(), "Apply error" ); 
+   
+  double endTime = ((double)clock()) / ((double)CLOCKS_PER_SEC) ;
+  
+  TEAGN_WATCH( endTime - initTime );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Segmentation_RegionGrowing_test.tif", TeUNSIGNEDCHAR ), 
+    "GeoTIF generation error" );   
+  
+  TePDITypes::TePDIPolSetMapType::iterator it = output_polsets->begin();
+  TePDITypes::TePDIPolSetMapType::iterator it_end = output_polsets->end();  
+  
+  unsigned int pols_number = 0;
+    
+  while( it != it_end ) {
+    TEAGN_TRUE_OR_THROW( exportPS2SHP( it->second, 
+      TEPDIEXAMPLESBINPATH "Segmentation_RegionGrowingPols_ps" +
+      Te2String( (int)it->first ) ),  "Polygonset export error" )
+      
+    pols_number += it->second.size();
+      
+    ++it;
+  }
+  
+  TEAGN_CHECK_EPS( output_polsets->size(), 23, 0.0,
+    "Invalid generated polygon set size" );
+  TEAGN_CHECK_EPS( pols_number, 23, 0.0,
+    "Invalid generated polygon set size" );    
+
+  //with an euclidian treshold of 20 and an area min of 15
+  //you are suppose to find 23 cells
+  //(you can use the spring software to check that number with
+  // others images and/or paramaters)
+  TEAGN_TRUE_OR_THROW( checkNumberCells(outRaster, 23),
+    "Check number of cell Error" );
+}
+
+void TePDIBaatz_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  params.SetParameter( "input_image", inRaster );
+
+  std::vector<unsigned> input_channels;
+  input_channels.push_back( 0 );
+  input_channels.push_back( 1 );
+  input_channels.push_back( 2 );
+  params.SetParameter( "input_channels", input_channels );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster,
+  1, 1, 1, true, TeUNSIGNEDLONG, 0 ), "RAM Raster Alloc error" );    
+  params.SetParameter( "output_image", outRaster );
+  params.SetParameter( "scale", (float) 30 );
+  params.SetParameter( "compactness", (float) 0.4 );
+  params.SetParameter( "color", (float) 0.5 );
+
+  vector<float> input_weights;
+  input_weights.push_back( (float) 0.7 );
+  input_weights.push_back( (float) 0.2 );
+  input_weights.push_back( (float) 0.1 );
+  params.SetParameter( "input_weights", input_weights );
+
+  TePDITypes::TePDIPolSetMapPtrType output_polsets( 
+  new TePDITypes::TePDIPolSetMapType );
+  params.SetParameter( "output_polsets", output_polsets );
+
+  TePDIBaatz segmenter;
+
+  TEAGN_TRUE_OR_THROW( segmenter.Reset(params), "Reset failed" );
+  
+  double initTime = ((double)clock()) / ((double)CLOCKS_PER_SEC) ;
+
+  TEAGN_TRUE_OR_THROW( segmenter.Apply(), "Apply error" );
+    
+  double endTime = ((double)clock()) / ((double)CLOCKS_PER_SEC) ;
+  
+  TEAGN_WATCH( endTime - initTime );    
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Segmentation_Baatz_test.tif", TeUNSIGNEDCHAR ), 
+    "GeoTIF generation error" );   
+
+  TePDITypes::TePDIPolSetMapType::iterator it = output_polsets->begin();
+  TePDITypes::TePDIPolSetMapType::iterator it_end = output_polsets->end();  
+  TePolygonSet pols;
+  while( it != it_end ) 
+  {
+    pols.copyElements(it->second);
+    ++it;
+  }
+  exportPS2SHP( pols, TEPDIEXAMPLESBINPATH "Segmentation_BaatzPols_ps");
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+  
+    TeInitRasterDecoders();
+    
+    TePDIBaatz_test();
+    TePDIRegGrowSeg_test();
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDISegmentation/TePDISegmentation_test.vcproj b/examples/image_processing/source/TePDISegmentation/TePDISegmentation_test.vcproj
old mode 100755
new mode 100644
index 1d2bed4..964033f
--- a/examples/image_processing/source/TePDISegmentation/TePDISegmentation_test.vcproj
+++ b/examples/image_processing/source/TePDISegmentation/TePDISegmentation_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDISegmentation_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDISegmentation_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/shapelib;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDISegmentation_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDISegmentation_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDISegmentation_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDISegmentation_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDISegmentation_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/shapelib;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDISegmentation_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDISegmentation_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDISegmentation_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDISensorSimulator/.cvsignore b/examples/image_processing/source/TePDISensorSimulator/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDISensorSimulator/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator.pro b/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator.pro
old mode 100755
new mode 100644
index d872ff3..4033230
--- a/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator.pro
+++ b/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDISensorSimulator_test.cpp
-
-QMAKE_CLEAN += \
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDISensorSimulator_test.cpp
+
+QMAKE_CLEAN += \
   ../../bin/TePDISensorSimulator*.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator_test.cpp b/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator_test.cpp
old mode 100755
new mode 100644
index 692aadd..27ee6bd
--- a/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator_test.cpp
+++ b/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator_test.cpp
@@ -1,67 +1,67 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-#include <TePDIUtils.hpp>
-#include <TePDISensorSimulator.hpp>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeAgnostic.h>
-
-void TePDISensorSimulator_test()
-{
-  TePDIParameters params;
-
-  TePDITypes::TePDIRasterPtrType input_raster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( input_raster->init(), 
-    "Unable to init input_raster" );
-  params.SetParameter( "input_raster" , input_raster );  
-    
-  std::vector<int> channels;
-  channels.push_back( 0 );
-  channels.push_back( 1 );
-  channels.push_back( 2 );
-  params.SetParameter( "channels" , channels );
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
-    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );    
-  params.SetParameter( "output_raster" , output_raster ); 
-  
-  params.SetParameter( "ifov_in" , (double)20.0 );
-  params.SetParameter( "eifov_in_across" , (double)35.0 );
-  params.SetParameter( "eifov_in_long" , (double)64.0 );
-
-  params.SetParameter( "ifov_out" , (double)73.0 );
-  params.SetParameter( "eifov_out_across" , (double)108.0 );
-  params.SetParameter( "eifov_out_long" , (double)111.0 );
-    
-
-  TePDISensorSimulator algo;
-  
-  TEAGN_TRUE_OR_THROW( algo.Reset(params), "Reset failed" );
-  TEAGN_TRUE_OR_THROW( algo.Apply(), "Apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
-    TEPDIEXAMPLESBINPATH "TePDISensorSimulator_test.tif" ), "GeoTIF generation error" );  
-}
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-    
-    TePDISensorSimulator_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+#include <TePDIUtils.hpp>
+#include <TePDISensorSimulator.hpp>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeAgnostic.h>
+
+void TePDISensorSimulator_test()
+{
+  TePDIParameters params;
+
+  TePDITypes::TePDIRasterPtrType input_raster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( input_raster->init(), 
+    "Unable to init input_raster" );
+  params.SetParameter( "input_raster" , input_raster );  
+    
+  std::vector<int> channels;
+  channels.push_back( 0 );
+  channels.push_back( 1 );
+  channels.push_back( 2 );
+  params.SetParameter( "channels" , channels );
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster,
+    1, 1, 1, false, TeUNSIGNEDCHAR, 0 ), "output_raster Alloc error" );    
+  params.SetParameter( "output_raster" , output_raster ); 
+  
+  params.SetParameter( "ifov_in" , (double)20.0 );
+  params.SetParameter( "eifov_in_across" , (double)35.0 );
+  params.SetParameter( "eifov_in_long" , (double)64.0 );
+
+  params.SetParameter( "ifov_out" , (double)73.0 );
+  params.SetParameter( "eifov_out_across" , (double)108.0 );
+  params.SetParameter( "eifov_out_long" , (double)111.0 );
+    
+
+  TePDISensorSimulator algo;
+  
+  TEAGN_TRUE_OR_THROW( algo.Reset(params), "Reset failed" );
+  TEAGN_TRUE_OR_THROW( algo.Apply(), "Apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( output_raster,
+    TEPDIEXAMPLESBINPATH "TePDISensorSimulator_test.tif" ), "GeoTIF generation error" );  
+}
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+    
+    TePDISensorSimulator_test();
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator_test.vcproj b/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator_test.vcproj
old mode 100755
new mode 100644
index 398f537..50a9195
--- a/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator_test.vcproj
+++ b/examples/image_processing/source/TePDISensorSimulator/TePDISensorSimulator_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDISensorSimulator_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDISensorSimulator_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDISensorSimulator_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDISensorSimulator_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDISensorSimulator_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDISensorSimulator_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDISensorSimulator_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDISensorSimulator_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDISensorSimulator_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDISensorSimulator_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIStatistic/.cvsignore b/examples/image_processing/source/TePDIStatistic/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIStatistic/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIStatistic/TePDIStatistic.pro b/examples/image_processing/source/TePDIStatistic/TePDIStatistic.pro
old mode 100755
new mode 100644
index c325843..0d227d4
--- a/examples/image_processing/source/TePDIStatistic/TePDIStatistic.pro
+++ b/examples/image_processing/source/TePDIStatistic/TePDIStatistic.pro
@@ -1,5 +1,5 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIStatistic_test.cpp
-
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIStatistic_test.cpp
+
diff --git a/examples/image_processing/source/TePDIStatistic/TePDIStatistic_test.cpp b/examples/image_processing/source/TePDIStatistic/TePDIStatistic_test.cpp
old mode 100755
new mode 100644
index d151a2c..7ce27a6
--- a/examples/image_processing/source/TePDIStatistic/TePDIStatistic_test.cpp
+++ b/examples/image_processing/source/TePDIStatistic/TePDIStatistic_test.cpp
@@ -1,360 +1,338 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIStatistic.hpp>
-#include <TePDIParameters.hpp>
-#include <TeAgnostic.h>
-
-#include <TeInitRasterDecoders.h>
-#include <TeRaster.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TeGeometry.h>
-#include <TeBox.h>
-
-void numeric_test_with_polygonset()
-{
-  TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster1->init(), "Unable to init inRaster1" );
-
-  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
-
-  TePDIParameters pars;
-  
-  TePDITypes::TePDIRasterVectorType rasters;
-  rasters.push_back( inRaster1 );
-  rasters.push_back( inRaster2 );
-  
-  pars.SetParameter( "rasters", rasters );
-  
-  std::vector< int > bands;
-  bands.push_back( 0 );
-  bands.push_back( 0 );
-  
-  pars.SetParameter( "bands", bands );
-  
-  TeBox box = inRaster1->params().boundingBox();
-  TePolygon pol = polygonFromBox( box );
-  TePDITypes::TePDIPolygonSetPtrType polset( new TePolygonSet );
-  polset->add( pol );
-  pars.SetParameter( "polygonset", polset );
-
-  TePDIStatistic stat;
-
-  TEAGN_TRUE_OR_THROW( stat.Reset( pars ), "Reset error" );
-  
-  // Checking generated histograms
-  
-  TePDIHistogram hist1a = stat.getHistogram( 0 );
-  TEAGN_CHECK_EPS( hist1a.size(), 209, 0, "Invalid histogram size" );
-  
-  TePDIHistogram hist2a = stat.getHistogram( 1 );
-  TEAGN_CHECK_EPS( hist2a.size(), 256, 0, "Invalid histogram size" ); 
-  
-  const TePDIJointHistogram& jhist01 = stat.getJointHistogram( 0, 1, 0 );
-  const TePDIJointHistogram& jhist10 = stat.getJointHistogram( 1, 0, 0 );
-  
-  // it is also possible to get histograms from joint histograms
-  const TePDIHistogram hist1b = jhist01.getRaster1Hist();
-  const TePDIHistogram hist2b = jhist01.getRaster2Hist();
-  
-  // Checking generated histograms consistency 
-  TEAGN_TRUE_OR_THROW( hist1a == hist1b, "Histograms inconsistency" )
-  TEAGN_TRUE_OR_THROW( hist2a == hist2b, "Histograms inconsistency" )
-  
-   // Checking single raster stat values 
-  
-  TEAGN_CHECK_EPS( stat.getSum( 0 ), 55438975.000000, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getSum( 1 ), 87782597.000000, 0.0001, "" );
-  
-  TEAGN_CHECK_EPS( stat.getSum3( 0 ), 340982998465.000000, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getSum3( 1 ), 1689469326995.000000, 0.0001, "" );
-
-  TEAGN_CHECK_EPS( stat.getSum4( 0 ), 27381030612693.000000, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getSum4( 1 ), 252981440505241.000000, 0.0001, "" );  
-  
-  TEAGN_CHECK_EPS( stat.getMean( 0 ), 76.928379, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getMean( 1 ), 121.809123, 0.0001, "" );
-
-  TEAGN_CHECK_EPS( stat.getVariance( 0 ), 75.432528, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getVariance( 1 ), 1561.214764, 0.0001, "" );
-  
-  TEAGN_CHECK_EPS( stat.getStdDev( 0 ), 8.685190, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getStdDev( 1 ), 39.512210, 0.0001, "" );
-  
-  TEAGN_CHECK_EPS( stat.getEntropy( 0 ), 5.004244, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getEntropy( 1 ), 4.998273, 0.0001, "" );  
-  
-  TEAGN_CHECK_EPS( stat.getMin( 0 ), 47, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getMin( 1 ), 0, 0.0001, "" );
-
-  TEAGN_CHECK_EPS( stat.getMax( 0 ), 255, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getMax( 1 ), 255, 0.0001, "" );
-
-  TEAGN_CHECK_EPS( stat.getMode( 0 ), 81, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getMode( 1 ), 141, 0.0001, "" );
-  
-  TEAGN_CHECK_EPS( stat.getPercentile( 0., 0, 0 ), 47, 0, 
-    "Invalid Percentile" );
-  TEAGN_CHECK_EPS( stat.getPercentile( 50., 0, 0 ), 78, 0, 
-    "Invalid Percentile" );
-  TEAGN_CHECK_EPS( stat.getPercentile( 51., 0, 0 ), 78, 0, 
-    "Invalid Percentile" );
-  TEAGN_CHECK_EPS( stat.getPercentile( 100., 0, 0 ), 255, 0, 
-    "Invalid Percentile" );
-          
-  TEAGN_CHECK_EPS( stat.getCovariance( 0, 0, 0 ),
-    75.432528, 0.001, "" );
-    
-  TEAGN_CHECK_EPS( stat.getCovariance( 0, 1, 0 ),
-    335.166257, 0.001, "" );
-
-  TEAGN_CHECK_EPS( stat.getCovariance( 1, 0, 0 ),
-    335.166257, 0.001, "" );
-        
-  TEAGN_CHECK_EPS( stat.getCovariance( 1, 1, 0 ),
-    1561.214764, 0.001, "" );
-    
-  TEAGN_CHECK_EPS( stat.getCorrelation( 0, 0, 0 ),
-     1.0, 0.000001, "" );
-
-  TEAGN_CHECK_EPS( stat.getCorrelation( 0, 1, 0 ),
-     0.976674, 0.000001, "" );
-
-  TEAGN_CHECK_EPS( stat.getCorrelation( 1, 0, 0 ),
-     0.976674, 0.000001, "" );
-     
-  TEAGN_CHECK_EPS( stat.getCorrelation( 1, 1, 0 ),
-     1.0000, 0.000001, "" );
-
-  // Checking functions generating a matrix       
-     
-  TeMatrix VarMatrix = stat.getVarMatrix();
-  TEAGN_CHECK_EPS( VarMatrix( 0, 0 ), 75.432528, 0.000001, "" );
-  TEAGN_CHECK_EPS( VarMatrix( 1, 0 ), 1561.214764, 0.000001, "" );  
-
-  TeMatrix StdDevMatrix = stat.getStdDevMatrix();
-  TEAGN_CHECK_EPS( StdDevMatrix( 0, 0 ), 8.685190, 0.000001, "" );
-  TEAGN_CHECK_EPS( StdDevMatrix( 1, 0 ), 39.512210, 0.000001, "" );  
-  
-  TeMatrix CMMatrix = stat.getCMMatrix();
-  TEAGN_CHECK_EPS( CMMatrix( 0, 0 ), 75.432528, 0.0001, "" );
-  TEAGN_CHECK_EPS( CMMatrix( 0, 1 ), 1561.214764, 0.000001, "" );
-  TEAGN_CHECK_EPS( CMMatrix( 1, 0 ), 486.770730, 0.00001, "" );
-  TEAGN_CHECK_EPS( CMMatrix( 1, 1 ), -33502.920720, 0.000001, "" );
-  TEAGN_CHECK_EPS( CMMatrix( 2, 0 ), 143871.693264, 0.00001, "" );
-  TEAGN_CHECK_EPS( CMMatrix( 2, 1 ), 8229548.372509, 0.000001, "" );
-
-  TeMatrix CovMatrix = stat.getCovMatrix();
-  TEAGN_CHECK_EPS( CovMatrix( 0, 0 ), 75.432528, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CovMatrix( 0, 1 ), 335.166257, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CovMatrix( 1, 0 ), 335.166257, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CovMatrix( 1, 1 ), 1561.214764, 0.000001, "" );  
-
-  TeMatrix CorMatrix = stat.getCorMatrix();
-  TEAGN_CHECK_EPS( CorMatrix( 0, 0 ), 1.0, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CorMatrix( 0, 1 ), 0.976674, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CorMatrix( 1, 0 ), 0.976674, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CorMatrix( 1, 1 ), 1.0, 0.000001, "" );  
-    
-  TeMatrix AssMatrix = stat.getAssimetryMatrix();
-  TEAGN_CHECK_EPS( AssMatrix( 0, 0 ), 0.742996, 0.000001, "" );
-  TEAGN_CHECK_EPS( AssMatrix( 0, 1 ), -0.543111, 0.000001, "" );
-
-  TeMatrix KurMatrix = stat.getKurtosisMatrix();
-  TEAGN_CHECK_EPS( KurMatrix( 0, 0 ), 22.284713, 0.000001, "" );
-  TEAGN_CHECK_EPS( KurMatrix( 0, 1 ), 0.376375, 0.000001, "" );
-
-  TeMatrix VarCoefMatrix = stat.getVarCoefMatrix();
-  TEAGN_CHECK_EPS( VarCoefMatrix( 0, 0 ), 0.112900, 0.000001, "" );
-  TEAGN_CHECK_EPS( VarCoefMatrix( 0, 1 ), 0.324378, 0.000001, "" );
-}
-
-
-void numeric_with_histograms_test()
-{
-  TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster1->init(), "Unable to init inRaster1" );
-
-  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
-  
-  /* Building histograms */
-  
-  std::vector< TePDIHistogram::pointer > histograms;
-  
-  TePDIHistogram::pointer user_hist1_ptr( new TePDIHistogram );
-  TEAGN_TRUE_OR_THROW( user_hist1_ptr->reset( inRaster1, 0, 0, 
-    false, TeBoxPixelIn ),
-    "Histogram generation error" );
-  histograms.push_back( user_hist1_ptr );
-    
-  TePDIHistogram::pointer user_hist2_ptr( new TePDIHistogram );
-  TEAGN_TRUE_OR_THROW( user_hist2_ptr->reset( inRaster2, 0, 0, 
-    false, TeBoxPixelIn ),
-    "Histogram generation error" );
-  histograms.push_back( user_hist2_ptr );
-  
-  /* Building statistic parameters */
-
-  TePDIParameters pars;
-  
-  pars.SetParameter( "histograms", histograms );
-  
-  TePDITypes::TePDIRasterVectorType rasters;
-  rasters.push_back( inRaster1 );
-  rasters.push_back( inRaster2 );
-  
-  pars.SetParameter( "rasters", rasters );
-  
-  std::vector< int > bands;
-  bands.push_back( 0 );
-  bands.push_back( 0 );
-  
-  pars.SetParameter( "bands", bands );
-  
-  TePDIStatistic stat;
-
-  TEAGN_TRUE_OR_THROW( stat.Reset( pars ), "Reset error" );
-  
-  TePDIHistogram hist1 = stat.getHistogram( 0 );
-  TEAGN_TRUE_OR_THROW( ( hist1.size() == user_hist1_ptr->size() ), 
-    "Invalid histogram1 size" );
-
-  TePDIHistogram hist2 = stat.getHistogram( 1 );
-  TEAGN_TRUE_OR_THROW( ( hist2.size() == user_hist2_ptr->size() ), 
-    "Invalid histogram2 size" );
-      
-  TEAGN_CHECK_EPS( stat.getSum( 0 ), 55438975.000000, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getSum( 1 ), 87782597.000000, 0.0001, "" );
-
-  TEAGN_CHECK_EPS( stat.getSum3( 0 ), 340982998465.000000, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getSum3( 1 ), 1689469326995.000000, 0.0001, "" );
-
-  TEAGN_CHECK_EPS( stat.getSum4( 0 ), 27381030612693.000000, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getSum4( 1 ), 252981440505241.000000, 0.0001, "" );  
-    
-  TEAGN_CHECK_EPS( stat.getMean( 0 ), 76.928379, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getMean( 1 ), 121.809123, 0.0001, "" );
-
-  TEAGN_CHECK_EPS( stat.getVariance( 0 ), 75.432528, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getVariance( 1 ), 1561.214764, 0.0001, "" );
-  
-  TEAGN_CHECK_EPS( stat.getStdDev( 0 ), 8.685190, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getStdDev( 1 ), 39.512210, 0.0001, "" );
-  
-  TEAGN_CHECK_EPS( stat.getEntropy( 0 ), 5.004244, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getEntropy( 1 ), 4.998273, 0.0001, "" );  
-  
-  TEAGN_CHECK_EPS( stat.getMin( 0 ), 47, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getMin( 1 ), 0, 0.0001, "" );
-
-  TEAGN_CHECK_EPS( stat.getMax( 0 ), 255, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getMax( 1 ), 255, 0.0001, "" );
-
-  TEAGN_CHECK_EPS( stat.getMode( 0 ), 81, 0.0001, "" );
-  TEAGN_CHECK_EPS( stat.getMode( 1 ), 141, 0.0001, "" );
-  
-  TEAGN_CHECK_EPS( stat.getPercentile( 0., 0, 0 ), 47, 0, 
-    "Invalid Percentile" );
-  TEAGN_CHECK_EPS( stat.getPercentile( 50., 0, 0 ), 78, 0, 
-    "Invalid Percentile" );
-  TEAGN_CHECK_EPS( stat.getPercentile( 51., 0, 0 ), 78, 0, 
-    "Invalid Percentile" );
-  TEAGN_CHECK_EPS( stat.getPercentile( 100., 0, 0 ), 255, 0, 
-    "Invalid Percentile" );  
-          
-  TEAGN_CHECK_EPS( stat.getCovariance( 0, 0 ),
-    75.432528, 0.001, "" );
-    
-  TEAGN_CHECK_EPS( stat.getCovariance( 0, 1 ),
-    335.166, 0.001, "" );
-
-  TEAGN_CHECK_EPS( stat.getCovariance( 1, 0 ),
-    335.166, 0.001, "" );
-        
-  TEAGN_CHECK_EPS( stat.getCovariance( 1, 1 ),
-    1561.214764, 0.001, "" );
-    
-  TEAGN_CHECK_EPS( stat.getCorrelation( 0, 0 ),
-     1.0, 0.000001, "" );
-
-  TEAGN_CHECK_EPS( stat.getCorrelation( 0, 1 ),
-     0.976674, 0.000001, "" );
-
-  TEAGN_CHECK_EPS( stat.getCorrelation( 1, 0 ),
-     0.976674, 0.000001, "" );
-     
-  TeMatrix VarMatrix = stat.getVarMatrix();
-  TEAGN_CHECK_EPS( VarMatrix( 0, 0 ), 75.432528, 0.000001, "" );
-  TEAGN_CHECK_EPS( VarMatrix( 1, 0 ), 1561.214764, 0.000001, "" );  
-
-  TeMatrix StdDevMatrix = stat.getStdDevMatrix();
-  TEAGN_CHECK_EPS( StdDevMatrix( 0, 0 ), 8.685190, 0.000001, "" );
-  TEAGN_CHECK_EPS( StdDevMatrix( 1, 0 ), 39.512210, 0.000001, "" );  
-  
-  TeMatrix CMMatrix = stat.getCMMatrix();
-  TEAGN_CHECK_EPS( CMMatrix( 0, 0 ), 75.432528, 0.0001, "" );
-  TEAGN_CHECK_EPS( CMMatrix( 0, 1 ), 1561.214764, 0.000001, "" );
-  TEAGN_CHECK_EPS( CMMatrix( 1, 0 ), 486.770730, 0.00001, "" );
-  TEAGN_CHECK_EPS( CMMatrix( 1, 1 ), -33502.920720, 0.000001, "" );
-  TEAGN_CHECK_EPS( CMMatrix( 2, 0 ), 143871.693264, 0.00001, "" );
-  TEAGN_CHECK_EPS( CMMatrix( 2, 1 ), 8229548.372509, 0.000001, "" );
-
-  TeMatrix CovMatrix = stat.getCovMatrix();
-  TEAGN_CHECK_EPS( CovMatrix( 0, 0 ), 75.432528, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CovMatrix( 0, 1 ), 335.166257, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CovMatrix( 1, 0 ), 335.166257, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CovMatrix( 1, 1 ), 1561.214764, 0.000001, "" );  
-
-  TeMatrix CorMatrix = stat.getCorMatrix();
-  TEAGN_CHECK_EPS( CorMatrix( 0, 0 ), 1.0, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CorMatrix( 0, 1 ), 0.976674, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CorMatrix( 1, 0 ), 0.976674, 0.000001, "" );  
-  TEAGN_CHECK_EPS( CorMatrix( 1, 1 ), 1.0, 0.000001, "" );  
-    
-  TeMatrix AssMatrix = stat.getAssimetryMatrix();
-  TEAGN_CHECK_EPS( AssMatrix( 0, 0 ), 0.742996, 0.000001, "" );
-  TEAGN_CHECK_EPS( AssMatrix( 0, 1 ), -0.543111, 0.000001, "" );
-
-  TeMatrix KurMatrix = stat.getKurtosisMatrix();
-  TEAGN_CHECK_EPS( KurMatrix( 0, 0 ), 22.284713, 0.000001, "" );
-  TEAGN_CHECK_EPS( KurMatrix( 0, 1 ), 0.376375, 0.000001, "" );
-
-  TeMatrix VarCoefMatrix = stat.getVarCoefMatrix();
-  TEAGN_CHECK_EPS( VarCoefMatrix( 0, 0 ), 0.112900, 0.000001, "" );
-  TEAGN_CHECK_EPS( VarCoefMatrix( 0, 1 ), 0.324378, 0.000001, "" );
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
-      
-    TeInitRasterDecoders();
-
-    numeric_test_with_polygonset();
-    numeric_with_histograms_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIStatistic.hpp>
+#include <TePDIParameters.hpp>
+#include <TeAgnostic.h>
+
+#include <TeInitRasterDecoders.h>
+#include <TeRaster.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TeGeometry.h>
+#include <TeBox.h>
+
+void numeric_test_with_polygonset()
+{
+  TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster1->init(), "Unable to init inRaster1" );
+
+  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
+  
+  TePDITypes::TePDIRasterPtrType inRaster3( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster3->init(), "Unable to init inRaster2" );  
+
+  TePDIParameters pars;
+  
+  TePDITypes::TePDIRasterVectorType rasters;
+  rasters.push_back( inRaster1 );
+  rasters.push_back( inRaster2 );
+  rasters.push_back( inRaster3 );
+  
+  pars.SetParameter( "rasters", rasters );
+  
+  std::vector< int > bands;
+  bands.push_back( 0 );
+  bands.push_back( 1 );
+  bands.push_back( 2 );
+  
+  pars.SetParameter( "bands", bands );
+  
+  TeBox box = inRaster1->params().boundingBox();
+  TePolygon pol = polygonFromBox( box );
+  TePDITypes::TePDIPolygonSetPtrType polset( new TePolygonSet );
+  polset->add( pol );
+  pars.SetParameter( "polygonset", polset );
+
+  TePDIStatistic stat;
+
+  TEAGN_TRUE_OR_THROW( stat.Reset( pars ), "Reset error" );
+  
+  TEAGN_CHECK_EPS( stat.getMin( 0 ), 15, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMin( 1 ), 61, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMin( 2 ), 10, 0.0001, "" );
+
+  TEAGN_CHECK_EPS( stat.getMax( 0 ), 255, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMax( 1 ), 255, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMax( 2 ), 255, 0.0001, "" );
+  
+  TEAGN_CHECK_EPS( stat.getMean( 0 ), 134.405948, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMean( 1 ), 209.620141, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMean( 2 ), 148.682201, 0.0001, "" );
+  
+  TEAGN_CHECK_EPS( stat.getStdDev( 0 ), 46.058313, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getStdDev( 1 ), 29.600182, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getStdDev( 2 ), 36.111183, 0.0001, "" );    
+
+  TEAGN_CHECK_EPS( stat.getVariance( 0 ), 2121.368232, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getVariance( 1 ), 876.170773, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getVariance( 2 ), 1304.017573, 0.0001, "" );
+  
+  TEAGN_CHECK_EPS( stat.getCovariance( 0, 0, 0 ), 2121.368232, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getCovariance( 0, 1, 0 ), -135.178860, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getCovariance( 0, 2, 0 ), 1307.875240, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getCovariance( 1, 0, 0 ), -135.178860, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getCovariance( 1, 1, 0 ), 876.170773, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getCovariance( 1, 2, 0 ), 482.378791, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getCovariance( 2, 0, 0 ), 1307.875240, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getCovariance( 2, 1, 0 ), 482.378791, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getCovariance( 2, 2, 0 ), 1304.017573, 0.0001, "" );
+      
+  TEAGN_CHECK_EPS( stat.getCorrelation( 0, 0, 0 ), 1, 0.000001, "" );
+  TEAGN_CHECK_EPS( stat.getCorrelation( 0, 1, 0 ), -0.099153, 0.000001, "" );
+  TEAGN_CHECK_EPS( stat.getCorrelation( 0, 2, 0 ), 0.786351, 0.000001, "" );
+  TEAGN_CHECK_EPS( stat.getCorrelation( 1, 0, 0 ), -0.099153, 0.000001, "" );
+  TEAGN_CHECK_EPS( stat.getCorrelation( 1, 1, 0 ), 1, 0.000001, "" );
+  TEAGN_CHECK_EPS( stat.getCorrelation( 1, 2, 0 ), 0.451286, 0.000001, "" );
+  TEAGN_CHECK_EPS( stat.getCorrelation( 2, 0, 0 ), 0.786351, 0.000001, "" );
+  TEAGN_CHECK_EPS( stat.getCorrelation( 2, 1, 0 ), 0.451286, 0.000001, "" );      
+  TEAGN_CHECK_EPS( stat.getCorrelation( 2, 2, 0 ), 1, 0.000001, "" );            
+  
+  TEAGN_CHECK_EPS( stat.getSum( 0 ), 17408124.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getSum( 1 ), 27149791.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getSum( 2 ), 19257170.000000, 0.0001, "" );
+  
+  TEAGN_CHECK_EPS( stat.getSum3( 0 ), 428939435700.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getSum3( 1 ), 1262662900207.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getSum3( 2 ), 499433085194.000000, 0.0001, "" );
+
+  TEAGN_CHECK_EPS( stat.getSum4( 0 ), 75997706109496.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getSum4( 1 ), 278887661881795.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getSum4( 2 ), 85455958573178.000000, 0.0001, "" );    
+  
+  TEAGN_CHECK_EPS( stat.getEntropy( 0 ), 5.110813, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getEntropy( 1 ), 5.304196, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getEntropy( 2 ), 3.823902, 0.0001, "" );    
+  
+  TEAGN_CHECK_EPS( stat.getMode( 0 ), 133.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMode( 1 ), 255.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMode( 2 ), 163.000000, 0.0001, "" );
+  
+  TEAGN_CHECK_EPS( stat.getPercentile( 0., 0, 0 ), 15.000000, 0, 
+    "Invalid Percentile" );
+  TEAGN_CHECK_EPS( stat.getPercentile( 50., 0, 0 ), 133.000000, 0, 
+    "Invalid Percentile" );
+  TEAGN_CHECK_EPS( stat.getPercentile( 75., 0, 0 ), 158.000000, 0, 
+    "Invalid Percentile" );
+  TEAGN_CHECK_EPS( stat.getPercentile( 100., 0, 0 ), 255, 0, 
+    "Invalid Percentile" );
+     
+  TeMatrix VarMatrix = stat.getVarMatrix();
+
+  TeMatrix StdDevMatrix = stat.getStdDevMatrix();
+  
+  TeMatrix CMMatrix = stat.getCMMatrix();
+  TEAGN_CHECK_EPS( CMMatrix( 0, 0 ), 2121.368232, 0.0001, "" );
+  TEAGN_CHECK_EPS( CMMatrix( 0, 1 ), 876.170773, 0.000001, "" );
+  TEAGN_CHECK_EPS( CMMatrix( 1, 0 ), 28376.279826, 0.00001, "" );
+  TEAGN_CHECK_EPS( CMMatrix( 1, 1 ), -12962.252229, 0.000001, "" );
+  TEAGN_CHECK_EPS( CMMatrix( 2, 0 ), 15235700.947282, 0.00001, "" );
+  TEAGN_CHECK_EPS( CMMatrix( 2, 1 ), 2351893.787613, 0.000001, "" );
+
+  TeMatrix CovMatrix = stat.getCovMatrix();
+
+  TeMatrix CorMatrix = stat.getCorMatrix();
+    
+  TeMatrix AssMatrix = stat.getAssimetryMatrix();
+  TEAGN_CHECK_EPS( AssMatrix( 0, 0 ), 0.290423, 0.000001, "" );
+  TEAGN_CHECK_EPS( AssMatrix( 0, 1 ), -0.499801, 0.000001, "" );
+
+  TeMatrix KurMatrix = stat.getKurtosisMatrix();
+  TEAGN_CHECK_EPS( KurMatrix( 0, 0 ), 0.385558, 0.000001, "" );
+  TEAGN_CHECK_EPS( KurMatrix( 0, 1 ), 0.063657, 0.000001, "" );
+
+  TeMatrix VarCoefMatrix = stat.getVarCoefMatrix();
+  TEAGN_CHECK_EPS( VarCoefMatrix( 0, 0 ), 0.342681, 0.000001, "" );
+  TEAGN_CHECK_EPS( VarCoefMatrix( 0, 1 ), 0.141209, 0.000001, "" );
+}
+
+
+void numeric_with_histograms_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster1( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster1->init(), "Unable to init inRaster1" );
+
+  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop_contraste.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
+  
+  /* Building histograms */
+  
+  std::vector< TePDIHistogram::pointer > histograms;
+  
+  TePDIHistogram::pointer user_hist1_ptr( new TePDIHistogram );
+  TEAGN_TRUE_OR_THROW( user_hist1_ptr->reset( inRaster1, 0, 0, 
+    TeBoxPixelIn ),
+    "Histogram generation error" );
+  histograms.push_back( user_hist1_ptr );
+    
+  TePDIHistogram::pointer user_hist2_ptr( new TePDIHistogram );
+  TEAGN_TRUE_OR_THROW( user_hist2_ptr->reset( inRaster2, 0, 0, 
+    TeBoxPixelIn ),
+    "Histogram generation error" );
+  histograms.push_back( user_hist2_ptr );
+  
+  /* Building statistic parameters */
+
+  TePDIParameters pars;
+  
+  pars.SetParameter( "histograms", histograms );
+  
+  TePDITypes::TePDIRasterVectorType rasters;
+  rasters.push_back( inRaster1 );
+  rasters.push_back( inRaster2 );
+  
+  pars.SetParameter( "rasters", rasters );
+  
+  std::vector< int > bands;
+  bands.push_back( 0 );
+  bands.push_back( 0 );
+  
+  pars.SetParameter( "bands", bands );
+  
+  TePDIStatistic stat;
+
+  TEAGN_TRUE_OR_THROW( stat.Reset( pars ), "Reset error" );
+  
+  TePDIHistogram hist1 = stat.getHistogram( 0 );
+  TEAGN_TRUE_OR_THROW( ( hist1.size() == user_hist1_ptr->size() ), 
+    "Invalid histogram1 size" );
+
+  TePDIHistogram hist2 = stat.getHistogram( 1 );
+  TEAGN_TRUE_OR_THROW( ( hist2.size() == user_hist2_ptr->size() ), 
+    "Invalid histogram2 size" );
+      
+  TEAGN_CHECK_EPS( stat.getSum( 0 ), 55438975.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getSum( 1 ), 87782597.000000, 0.0001, "" );
+
+  TEAGN_CHECK_EPS( stat.getSum3( 0 ), 340982998465.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getSum3( 1 ), 1689469326995.000000, 0.0001, "" );
+
+  TEAGN_CHECK_EPS( stat.getSum4( 0 ), 27381030612693.000000, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getSum4( 1 ), 252981440505241.000000, 0.0001, "" );  
+    
+  TEAGN_CHECK_EPS( stat.getMean( 0 ), 76.928379, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMean( 1 ), 121.809123, 0.0001, "" );
+
+  TEAGN_CHECK_EPS( stat.getVariance( 0 ), 75.432528, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getVariance( 1 ), 1561.214764, 0.0001, "" );
+  
+  TEAGN_CHECK_EPS( stat.getStdDev( 0 ), 8.685190, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getStdDev( 1 ), 39.512210, 0.0001, "" );
+  
+  TEAGN_CHECK_EPS( stat.getEntropy( 0 ), 5.004244, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getEntropy( 1 ), 4.998273, 0.0001, "" );  
+  
+  TEAGN_CHECK_EPS( stat.getMin( 0 ), 47, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMin( 1 ), 0, 0.0001, "" );
+
+  TEAGN_CHECK_EPS( stat.getMax( 0 ), 255, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMax( 1 ), 255, 0.0001, "" );
+
+  TEAGN_CHECK_EPS( stat.getMode( 0 ), 81, 0.0001, "" );
+  TEAGN_CHECK_EPS( stat.getMode( 1 ), 141, 0.0001, "" );
+  
+  TEAGN_CHECK_EPS( stat.getPercentile( 0., 0, 0 ), 47, 0, 
+    "Invalid Percentile" );
+  TEAGN_CHECK_EPS( stat.getPercentile( 50., 0, 0 ), 78, 0, 
+    "Invalid Percentile" );
+  TEAGN_CHECK_EPS( stat.getPercentile( 51., 0, 0 ), 78, 0, 
+    "Invalid Percentile" );
+  TEAGN_CHECK_EPS( stat.getPercentile( 100., 0, 0 ), 255, 0, 
+    "Invalid Percentile" );  
+          
+  TEAGN_CHECK_EPS( stat.getCovariance( 0, 0 ),
+    75.432528, 0.001, "" );
+    
+  TEAGN_CHECK_EPS( stat.getCovariance( 0, 1 ),
+    335.166, 0.001, "" );
+
+  TEAGN_CHECK_EPS( stat.getCovariance( 1, 0 ),
+    335.166, 0.001, "" );
+        
+  TEAGN_CHECK_EPS( stat.getCovariance( 1, 1 ),
+    1561.214764, 0.001, "" );
+    
+  TEAGN_CHECK_EPS( stat.getCorrelation( 0, 0 ),
+     1.0, 0.000001, "" );
+
+  TEAGN_CHECK_EPS( stat.getCorrelation( 0, 1 ),
+     0.976674, 0.000001, "" );
+
+  TEAGN_CHECK_EPS( stat.getCorrelation( 1, 0 ),
+     0.976674, 0.000001, "" );
+     
+  TeMatrix VarMatrix = stat.getVarMatrix();
+  TEAGN_CHECK_EPS( VarMatrix( 0, 0 ), 75.432528, 0.000001, "" );
+  TEAGN_CHECK_EPS( VarMatrix( 1, 0 ), 1561.214764, 0.000001, "" );  
+
+  TeMatrix StdDevMatrix = stat.getStdDevMatrix();
+  TEAGN_CHECK_EPS( StdDevMatrix( 0, 0 ), 8.685190, 0.000001, "" );
+  TEAGN_CHECK_EPS( StdDevMatrix( 1, 0 ), 39.512210, 0.000001, "" );  
+  
+  TeMatrix CMMatrix = stat.getCMMatrix();
+  TEAGN_CHECK_EPS( CMMatrix( 0, 0 ), 75.432528, 0.0001, "" );
+  TEAGN_CHECK_EPS( CMMatrix( 0, 1 ), 1561.214764, 0.000001, "" );
+  TEAGN_CHECK_EPS( CMMatrix( 1, 0 ), 486.770730, 0.00001, "" );
+  TEAGN_CHECK_EPS( CMMatrix( 1, 1 ), -33502.920720, 0.000001, "" );
+  TEAGN_CHECK_EPS( CMMatrix( 2, 0 ), 143871.693264, 0.00001, "" );
+  TEAGN_CHECK_EPS( CMMatrix( 2, 1 ), 8229548.372509, 0.000001, "" );
+
+  TeMatrix CovMatrix = stat.getCovMatrix();
+  TEAGN_CHECK_EPS( CovMatrix( 0, 0 ), 75.432528, 0.000001, "" );  
+  TEAGN_CHECK_EPS( CovMatrix( 0, 1 ), 335.166257, 0.000001, "" );  
+  TEAGN_CHECK_EPS( CovMatrix( 1, 0 ), 335.166257, 0.000001, "" );  
+  TEAGN_CHECK_EPS( CovMatrix( 1, 1 ), 1561.214764, 0.000001, "" );  
+
+  TeMatrix CorMatrix = stat.getCorMatrix();
+  TEAGN_CHECK_EPS( CorMatrix( 0, 0 ), 1.0, 0.000001, "" );  
+  TEAGN_CHECK_EPS( CorMatrix( 0, 1 ), 0.976674, 0.000001, "" );  
+  TEAGN_CHECK_EPS( CorMatrix( 1, 0 ), 0.976674, 0.000001, "" );  
+  TEAGN_CHECK_EPS( CorMatrix( 1, 1 ), 1.0, 0.000001, "" );  
+    
+  TeMatrix AssMatrix = stat.getAssimetryMatrix();
+  TEAGN_CHECK_EPS( AssMatrix( 0, 0 ), 0.742996, 0.000001, "" );
+  TEAGN_CHECK_EPS( AssMatrix( 0, 1 ), -0.543111, 0.000001, "" );
+
+  TeMatrix KurMatrix = stat.getKurtosisMatrix();
+  TEAGN_CHECK_EPS( KurMatrix( 0, 0 ), 22.284713, 0.000001, "" );
+  TEAGN_CHECK_EPS( KurMatrix( 0, 1 ), 0.376375, 0.000001, "" );
+
+  TeMatrix VarCoefMatrix = stat.getVarCoefMatrix();
+  TEAGN_CHECK_EPS( VarCoefMatrix( 0, 0 ), 0.112900, 0.000001, "" );
+  TEAGN_CHECK_EPS( VarCoefMatrix( 0, 1 ), 0.324378, 0.000001, "" );
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );
+      
+    TeInitRasterDecoders();
+
+    numeric_test_with_polygonset();
+    numeric_with_histograms_test();
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIStatistic/TePDIStatistic_test.vcproj b/examples/image_processing/source/TePDIStatistic/TePDIStatistic_test.vcproj
old mode 100755
new mode 100644
index 4e7968b..150a384
--- a/examples/image_processing/source/TePDIStatistic/TePDIStatistic_test.vcproj
+++ b/examples/image_processing/source/TePDIStatistic/TePDIStatistic_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIStatistic_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIStatistic_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIStatistic_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIStatistic_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIStatistic_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIStatistic_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIStatistic_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIStatistic_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIStatistic_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIStatistic_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIUtils/.cvsignore b/examples/image_processing/source/TePDIUtils/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIUtils/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIUtils/TePDIUtils.pro b/examples/image_processing/source/TePDIUtils/TePDIUtils.pro
old mode 100755
new mode 100644
index e48f203..fe41f24
--- a/examples/image_processing/source/TePDIUtils/TePDIUtils.pro
+++ b/examples/image_processing/source/TePDIUtils/TePDIUtils.pro
@@ -1,13 +1,13 @@
-include( ../base/base.pro )
-
-SOURCES += TePDIUtils_test.cpp
-
-QMAKE_CLEAN += \
-  ../../bin/TeAllocMemoryMappedRaster_test.tif \
-  ../../bin/TeAllocRAMRaster_test.tif \
-  ../../bin/TeRaster2Geotiff_test.tif \
-  ../../bin/TeResetRaster_test.tif \
-  ../../bin/TePDIUtils_TeAllocRAMRaster3_test.tif \
-  ../../bin/TePDIUtils_exportPS2SHP_test.dbf \
-  ../../bin/TePDIUtils_exportPS2SHP_test.shp \
+include( ../base/base.pro )
+
+SOURCES += TePDIUtils_test.cpp
+
+QMAKE_CLEAN += \
+  ../../bin/TeAllocMemoryMappedRaster_test.tif \
+  ../../bin/TeAllocRAMRaster_test.tif \
+  ../../bin/TeRaster2Geotiff_test.tif \
+  ../../bin/TeResetRaster_test.tif \
+  ../../bin/TePDIUtils_TeAllocRAMRaster3_test.tif \
+  ../../bin/TePDIUtils_exportPS2SHP_test.dbf \
+  ../../bin/TePDIUtils_exportPS2SHP_test.shp \
   ../../bin/TePDIUtils_exportPS2SHP_test.shx
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIUtils/TePDIUtils_test.cpp b/examples/image_processing/source/TePDIUtils/TePDIUtils_test.cpp
old mode 100755
new mode 100644
index 66b6cbf..c1912a8
--- a/examples/image_processing/source/TePDIUtils/TePDIUtils_test.cpp
+++ b/examples/image_processing/source/TePDIUtils/TePDIUtils_test.cpp
@@ -1,1023 +1,1062 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIUtils.hpp>
-
-#include <TeInitRasterDecoders.h>
-
-#include <TeAgnostic.h>
-
-#include <string>
-
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-#include <TePrecision.h>
-
-
-void raster_compare_test()
-{
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-
-  TEAGN_TRUE_OR_THROW(
-    TePDIUtils::rasterCompare( inRaster, inRaster ),
-    "Raster compare error" );
-}
-
-
-void TeGetRasterMinMaxBounds_test()
-{
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-
-  double min = 0;
-  double max = 0;
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds( inRaster, 0, min, max ),
-    "Unable to get bounds" );
-
-  TEAGN_CHECK_EQUAL( min, 0, "Invalid min value" );
-  TEAGN_CHECK_EQUAL( max, 255, "Invalid max value" );
-
-}
-
-
-void TeRaster2Geotiff_deprecated_test()
-{
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  
-  double pixel_value = 0;
-  TEAGN_TRUE_OR_THROW( inRaster->getElement( 0, 0, pixel_value, 0 ),
-    "Unable to get element" );
-  TEAGN_CHECK_EPS( pixel_value, 88., 0.00001, 
-    "Pixel value inversion detected" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( inRaster,
-    TEPDIEXAMPLESBINPATH "TeRaster2Geotiff_test.tif" ), "GeoTIF generation error" );
-
-  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
-    std::string( TEPDIEXAMPLESBINPATH "TeRaster2Geotiff_test.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
-  
-  TEAGN_TRUE_OR_THROW( inRaster2->getElement( 0, 0, pixel_value, 0 ),
-    "Unable to get element" );
-  TEAGN_CHECK_EPS( pixel_value, 88., 0.00001, 
-    "Pixel value inversion detected" );
-
-  TEAGN_TRUE_OR_THROW(
-    TePDIUtils::rasterCompare( inRaster, inRaster2 ),
-    "Raster compare error" );
-}
-
-
-void TeRaster2Geotiff_test()
-{
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  
-  double pixel_value = 0;
-  TEAGN_TRUE_OR_THROW( inRaster->getElement( 0, 0, pixel_value, 0 ),
-    "Unable to get element" );
-  TEAGN_CHECK_EPS( pixel_value, 88., 0.00001, 
-    "Pixel value inversion detected" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( inRaster,
-    TEPDIEXAMPLESBINPATH "TeRaster2Geotiff_test.tif",
-    true ), "GeoTIF generation error" );
-
-  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
-    std::string( TEPDIEXAMPLESBINPATH "TeRaster2Geotiff_test.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
-  
-  TEAGN_TRUE_OR_THROW( inRaster2->getElement( 0, 0, pixel_value, 0 ),
-    "Unable to get element" );
-  TEAGN_CHECK_EPS( pixel_value, 88., 0.00001, 
-    "Pixel value inversion detected" );
-
-  TEAGN_TRUE_OR_THROW(
-    TePDIUtils::rasterCompare( inRaster, inRaster2 ),
-    "Raster compare error" );
-}
-
-
-void TeGetRasterReqMem_test()
-{
-  TePDITypes::TePDIRasterPtrType RAMRaster;
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster, 10,
-    10, 10, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Allocation error" );
-    
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeGetRasterReqMem( RAMRaster->params() ) == 1000 ),
-    "Invalid TeGetRasterReqMem result" );
-}
-
-
-void TeAllocRAMRaster1_test()
-{
-  TePDITypes::TePDIRasterPtrType RAMRaster;
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster, 10,
-    10, 10, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Allocation error" );
-
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->params().status_ == TeRasterParams::TeReadyToWrite, 
-    "Raster status error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().nlines_ == 10, "Lines error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().ncols_ == 10, "Columns error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->nBands() == 10, "Bands error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().dataType_[ 0 ] == TeUNSIGNEDCHAR,
-    "data type error" );
-}
-
-
-void TeAllocRAMRaster_templateraster_test()
-{
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-
-  TePDITypes::TePDIRasterPtrType RAMRaster( new TeRaster );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( inRaster, RAMRaster, 0,
-    true, false, TeUNSIGNEDCHAR ), "RAM Raster Allocation error" );
-
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().dataType_[ 0 ] == TeUNSIGNEDCHAR,
-    "data type error" );
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->params().status_ == TeRasterParams::TeReadyToWrite, 
-    "Raster status error" );
-    
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().nlines_ == 
-    inRaster->params().nlines_, "Checking error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().ncols_ == 
-    inRaster->params().ncols_, "Checking error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().dataType_[ 0 ] == 
-    inRaster->params().dataType_[ 0 ], "Checking error" );
-  TEAGN_TRUE_OR_THROW( ( *(RAMRaster->params().projection()) ) == 
-    ( *(inRaster->params().projection()) ), "Checking error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().box() == 
-    inRaster->params().box(), "Checking error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().resx_ == 
-    inRaster->params().resx_, "Checking error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().resy_ == 
-    inRaster->params().resy_, "Checking error" );
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->params().status_ == TeRasterParams::TeReadyToWrite, 
-    "Raster status error" );    
-}
-
-
-void TeAllocRAMRaster_usingparams_test()
-{
-  TePDITypes::TePDIRasterPtrType RAMRaster;
-  
-  TeRasterParams params;
-  params.nBands( 10 );
-  params.nlines_ = 10;
-  params.ncols_ = 10;
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster, params, 
-    TePDIUtils::TePDIUtilsAutoMemPol ), "RAM Raster Allocation error" );
-
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->params().status_ == TeRasterParams::TeReadyToWrite, 
-    "Raster status error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().nlines_ == 10, "Lines error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().ncols_ == 10, "Columns error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->nBands() == 10, "Bands error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().dataType_[ 0 ] == TeUNSIGNEDCHAR,
-    "data type error" );
-}
-
-
-void TeAllocMemoryMappedRaster_test()
-{
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-
-  TePDITypes::TePDIRasterPtrType RAMRaster;
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( inRaster, RAMRaster, 0,
-    true, true, TeUNSIGNEDCHAR ), "RAM Raster Allocation error" );
-
-  TEAGN_TRUE_OR_THROW( RAMRaster->params().dataType_[ 0 ] == TeUNSIGNEDCHAR,
-    "data type error" );
-  TEAGN_TRUE_OR_THROW( 
-    RAMRaster->params().status_ == TeRasterParams::TeReadyToWrite, 
-    "Raster status error" );    
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterBands( inRaster,
-    RAMRaster, false, false ), "Raster band copy error" );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( RAMRaster,
-    TEPDIEXAMPLESBINPATH "TeAllocMemoryMappedRaster_test.tif" ), "GeoTIF generation error" );
-}
-
-
-void IsFloatBand_test()
-{
-
-  TePDITypes::TePDIRasterPtrType RAMRaster_int;
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster_int, 10,
-    10, 10, false, TeINTEGER, 0 ), "RAM Raster Allocation error" );
-    
-  TEAGN_TRUE_OR_THROW( ( ! TePDIUtils::IsFloatBand( RAMRaster_int, 0 ) ),
-    "Invalid result" );
-  
-  TePDITypes::TePDIRasterPtrType RAMRaster_uchar;
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster_uchar, 10,
-    10, 10, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Allocation error" );    
-    
-  TEAGN_TRUE_OR_THROW( ( ! TePDIUtils::IsFloatBand( RAMRaster_uchar, 0 ) ),
-    "Invalid result" );
-    
-  TePDITypes::TePDIRasterPtrType RAMRaster_float;
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster_float, 10,
-    10, 10, false, TeFLOAT, 0 ), "RAM Raster Allocation error" );    
-    
-  TEAGN_TRUE_OR_THROW( ( TePDIUtils::IsFloatBand( RAMRaster_float, 0 ) ),
-    "Invalid result" );    
-    
-  TePDITypes::TePDIRasterPtrType RAMRaster_double;
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster_double, 10,
-    10, 10, false, TeDOUBLE, 0 ), "RAM Raster Allocation error" );    
-    
-  TEAGN_TRUE_OR_THROW( ( TePDIUtils::IsFloatBand( RAMRaster_double, 0 ) ),
-    "Invalid result" );     
-};
-
-
-void buildDetailedBox_test()
-{
-  TeNoProjection proj;
-
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 3;
-  params.ncols_ = 3;
-  params.projection( &proj );
-  
-  TePDITypes::TePDIRasterPtrType ram_raster;
-  TEAGN_TRUE_OR_THROW( 
-    TePDIUtils::TeAllocRAMRaster( ram_raster, params, false ), 
-    "RAM Raster Allocation error" );
-    
-  TePolygon box_polygon;
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::buildDetailedBox( ram_raster,
-    box_polygon), "detailed box building error" );
-    
-  TEAGN_TRUE_OR_THROW( ( box_polygon.size() == 1 ), 
-    "Invalid linear rings number" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ].size() == 9 ), 
-    "Invalid points number" );
-    
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 0 ] == 
-    ram_raster->index2Coord( TeCoord2D( 0, 0 ) ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 1 ] == 
-    ram_raster->index2Coord( TeCoord2D( 1, 0 ) ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 2 ] == 
-    ram_raster->index2Coord( TeCoord2D( 2, 0 ) ) ), 
-    "Invalid point" );
-  
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 3 ] == 
-    ram_raster->index2Coord( TeCoord2D( 2, 1 ) ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 4 ] == 
-    ram_raster->index2Coord( TeCoord2D( 2, 2 ) ) ), 
-    "Invalid point" );
-    
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 5 ] == 
-    ram_raster->index2Coord( TeCoord2D( 1, 2 ) ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 6 ] == 
-    ram_raster->index2Coord( TeCoord2D( 0, 2 ) ) ), 
-    "Invalid point" );
-    
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 7 ] == 
-    ram_raster->index2Coord( TeCoord2D( 0, 1 ) ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 8 ] == 
-    ram_raster->index2Coord( TeCoord2D( 0, 0 ) ) ), 
-    "Invalid point" );
-            
-}
-
-
-void buildDetailedBBox_test()
-{
-  TeNoProjection proj;
-
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 2;
-  params.ncols_ = 2;
-  params.projection( &proj );
-  
-  TePDITypes::TePDIRasterPtrType ram_raster;
-  TEAGN_TRUE_OR_THROW( 
-    TePDIUtils::TeAllocRAMRaster( ram_raster, params, false ), 
-    "RAM Raster Allocation error" );
-    
-  TePolygon box_polygon;
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::buildDetailedBBox( ram_raster,
-    box_polygon), "detailed box building error" );
-    
-  TEAGN_TRUE_OR_THROW( ( box_polygon.size() == 1 ), 
-    "Invalid linear rings number" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ].size() == 9 ), 
-    "Invalid points number" );
-    
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 0 ] == 
-    ram_raster->index2Coord( TeCoord2D( -0.5, -0.5 ) ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 1 ] == 
-    ram_raster->index2Coord( TeCoord2D( 0.5, -0.5 ) ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 2 ] == 
-    ram_raster->index2Coord( TeCoord2D( 1.5, -0.5 ) ) ), 
-    "Invalid point" );
-  
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 3 ] == 
-    ram_raster->index2Coord( TeCoord2D( 1.5, 0.5 ) ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 4 ] == 
-    ram_raster->index2Coord( TeCoord2D( 1.5, 1.5 ) ) ), 
-    "Invalid point" );
-    
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 5 ] == 
-    ram_raster->index2Coord( TeCoord2D( 0.5, 1.5 ) ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 6 ] == 
-    ram_raster->index2Coord( TeCoord2D( -0.5, 1.5 ) ) ), 
-    "Invalid point" );
-    
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 7 ] == 
-    ram_raster->index2Coord( TeCoord2D( -0.5, 0.5 ) ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 8 ] == 
-    ram_raster->index2Coord( TeCoord2D( -0.5, -0.5 ) ) ), 
-    "Invalid point" );    
-}
-
-void getGeodeticPixelRes_test()
-{
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  
-  double x_res = 0;
-  double y_res = 0;
-  
-  TePDIUtils::getGeodeticPixelRes( inRaster->params(), x_res, y_res );
-  
-  TEAGN_CHECK_EPS( x_res, 0.000003, 0.000001, "Invalid x_res" );
-  TEAGN_CHECK_EPS( y_res, 0.000003, 0.000001, "Invalid y_res" );
-}
-
-
-void reprojectRaster_test()
-{
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-  
-  TePDITypes::TePDIRasterPtrType ram_raster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( ram_raster, 10,
-    10, 10, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Allocation error" ); 
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::reprojectRaster( inRaster,
-     *(inRaster->projection()), inRaster->params().resx_,
-     inRaster->params().resy_, ram_raster ),
-    "Raster reprojection error" );
-    
-  TEAGN_TRUE_OR_THROW( ( inRaster->projection()->name() ==
-    ram_raster->projection()->name() ),
-    "Invalid projection name" );
-  TEAGN_CHECK_EPS( inRaster->params().box().x1(),
-    ram_raster->params().box().x1(), 0.000001, "Invalid box" );
-  TEAGN_CHECK_EPS( inRaster->params().box().x2(),
-    ram_raster->params().box().x2(), 0.000001, "Invalid box" );    
-  TEAGN_CHECK_EPS( inRaster->params().box().y1(),
-    ram_raster->params().box().y1(), 0.0001, "Invalid box" );
-  TEAGN_CHECK_EPS( inRaster->params().box().y2(),
-    ram_raster->params().box().y2(), 0.0001, "Invalid box" );    
-  TEAGN_CHECK_EPS( inRaster->params().resx_,
-    ram_raster->params().resx_, 0.0001, "Invalid box" );    
-  TEAGN_CHECK_EPS( inRaster->params().resy_,
-    ram_raster->params().resy_, 0.0001, "Invalid box" );    
-    
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( ram_raster,
-    TEPDIEXAMPLESBINPATH "TePDIUtils_reprojectRaster_test.tif" ), "GeoTIF generation error" );    
-}
-
-
-void TeRelation_test()
-{
-  TeLinearRing r1;
-  r1.add( TeCoord2D( 0, 0 ) );
-  r1.add( TeCoord2D( 3, 0 ) );
-  r1.add( TeCoord2D( 3, 3 ) );
-  r1.add( TeCoord2D( 0, 3.3 ) );
-  r1.add( TeCoord2D( 0, 0 ) );
-  
-  TeLinearRing r2;
-  r2.add( TeCoord2D( 1, 1 ) );
-  r2.add( TeCoord2D( 2, 1 ) );
-  r2.add( TeCoord2D( 2, 2 ) );
-  r2.add( TeCoord2D( 1, 2 ) );
-  r2.add( TeCoord2D( 1, 1 ) );
-  
-  TePolygon pol1;
-  pol1.add( r1 );
-  pol1.add( r2 );
-  
-  TeTileIndexer ti( pol1, 0.3 ); 
-  
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( 1.5, 0.5 ), ti ) == TeINSIDE ),
-    "Invalid relation" );   
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( 2.5, 1.5 ), ti ) == TeINSIDE ),
-    "Invalid relation" );   
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( 1.5, 2.5 ), ti ) == TeINSIDE ),
-    "Invalid relation" );   
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( 0.5, 1.5 ), ti ) == TeINSIDE ),
-    "Invalid relation" );   
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( 0.5, 1.5 ), ti ) == TeINSIDE ),
-    "Invalid relation" );   
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( 0.1, 3.1 ), ti ) == TeINSIDE ),
-    "Invalid relation" );     
-      
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( 1.5, 1.5 ), ti ) == TeOUTSIDE ),
-    "Invalid relation" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( 2.5, 3.5 ), ti ) == TeOUTSIDE ),
-    "Invalid relation" );
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( -1.0, 1.0 ), ti ) == TeOUTSIDE ),
-    "Invalid relation" );    
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( -1.0, -1.0 ), ti ) == TeOUTSIDE ),
-    "Invalid relation" );    
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( 1.0, -1.0 ), ti ) == TeOUTSIDE ),
-    "Invalid relation" );  
-  TEAGN_TRUE_OR_THROW( 
-    ( TePDIUtils::TeRelation( TeCoord2D( 4.0, 4.0 ), ti ) == TeOUTSIDE ),
-    "Invalid relation" );        
-}
-
-
-void makeSegmentSet_test()
-{
-  TeLine2D l1;
-  l1.add( TeCoord2D( 0,0 ) );
-  l1.add( TeCoord2D( 1,0 ) );
-  l1.add( TeCoord2D( 0,1 ) );
-  l1.add( TeCoord2D( 0,0 ) );
-  
-  TeLinearRing lr1( l1 );
-  
-  TePolygon p1;
-  p1.add( lr1 );
-  
-  TeLineSet ls1;
-  TePDIUtils::makeSegmentSet( p1, ls1 );
-  
-  TEAGN_TRUE_OR_THROW( ( ls1.size() == 3 ), "Invalid line set size" );
-  
-  TEAGN_TRUE_OR_THROW( ( ls1[ 0 ].size() == 2 ), "Invalid segment size" );
-  TEAGN_TRUE_OR_THROW( ( ls1[ 1 ].size() == 2 ), "Invalid segment size" );
-  TEAGN_TRUE_OR_THROW( ( ls1[ 2 ].size() == 2 ), "Invalid segment size" );
-  
-  TEAGN_TRUE_OR_THROW( ( ls1[ 0 ][ 0 ] == TeCoord2D( 0, 0 ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( ls1[ 0 ][ 1 ] == TeCoord2D( 1, 0 ) ), 
-    "Invalid point" );  
-    
-  TEAGN_TRUE_OR_THROW( ( ls1[ 1 ][ 0 ] == TeCoord2D( 1, 0 ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( ls1[ 1 ][ 1 ] == TeCoord2D( 0, 1 ) ), 
-    "Invalid point" );      
-
-  TEAGN_TRUE_OR_THROW( ( ls1[ 2 ][ 0 ] == TeCoord2D( 0, 1 ) ), 
-    "Invalid point" );
-  TEAGN_TRUE_OR_THROW( ( ls1[ 2 ][ 1 ] == TeCoord2D( 0, 0 ) ), 
-    "Invalid point" );      
-}
-
-
-void TeSegSetIntersection_test()
-{
-  {
-    /* X test */
-  
-    TeLine2D line1;
-    line1.add( TeCoord2D( -1, -1 ) );
-    line1.add( TeCoord2D( 1, 1 ) );
-    
-    TeLineSet ls1;
-    ls1.add( line1 );
-    
-    TeLine2D line2;
-    line2.add( TeCoord2D( -1, 1 ) );
-    line2.add( TeCoord2D( 1, -1 ) );
-    
-    TeLineSet ls2;
-    ls2.add( line2 );    
-    
-    TePointSet ps1;
-    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
-    
-    TEAGN_TRUE_OR_THROW( ( ps1.size() == 1 ), "Invalid point set size" )
-    TEAGN_TRUE_OR_THROW( ( ps1[ 0 ].elem() == TeCoord2D( 0, 0 ) ), 
-      "Invalid intersection point" )
-  }
-  
-  {
-    /* + Test */
-  
-    TeLine2D line1;
-    line1.add( TeCoord2D( -1, 0 ) );
-    line1.add( TeCoord2D( 1, 0 ) );
-    
-    TeLineSet ls1;
-    ls1.add( line1 );
-    
-    TeLine2D line2;
-    line2.add( TeCoord2D( 0, 1 ) );
-    line2.add( TeCoord2D( 0, -1 ) );
-    
-    TeLineSet ls2;
-    ls2.add( line2 );    
-    
-    TePointSet ps1;
-    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
-    
-    TEAGN_TRUE_OR_THROW( ( ps1.size() == 1 ), "Invalid point set size" )
-    TEAGN_TRUE_OR_THROW( ( ps1[ 0 ].elem() == TeCoord2D( 0, 0 ) ), 
-      "Invalid intersection point" )
-  }  
-  
-  {
-    /* Y Axis Parallel line 1 Test */
-  
-    TeLine2D line1;
-    line1.add( TeCoord2D( 0, 1 ) );
-    line1.add( TeCoord2D( 0, -1 ) );
-    
-    TeLineSet ls1;
-    ls1.add( line1 );
-    
-    TeLine2D line2;
-    line2.add( TeCoord2D( -1, -1 ) );
-    line2.add( TeCoord2D( 1, 1 ) );
-    
-    TeLineSet ls2;
-    ls2.add( line2 );    
-    
-    TePointSet ps1;
-    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
-    
-    TEAGN_TRUE_OR_THROW( ( ps1.size() == 1 ), "Invalid point set size" )
-    TEAGN_TRUE_OR_THROW( ( ps1[ 0 ].elem() == TeCoord2D( 0, 0 ) ), 
-      "Invalid intersection point" )
-  }  
-  
-  {
-    /* Y Axis Parallel line 2 Test */
-  
-    TeLine2D line1;
-    line1.add( TeCoord2D( -1, -1 ) );
-    line1.add( TeCoord2D( 1, 1 ) );
-    
-    TeLineSet ls1;
-    ls1.add( line1 );
-    
-    TeLine2D line2;
-    line2.add( TeCoord2D( 0, 1 ) );
-    line2.add( TeCoord2D( 0, -1 ) );
-    
-    TeLineSet ls2;
-    ls2.add( line2 );    
-    
-    TePointSet ps1;
-    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
-    
-    TEAGN_TRUE_OR_THROW( ( ps1.size() == 1 ), "Invalid point set size" )
-    TEAGN_TRUE_OR_THROW( ( ps1[ 0 ].elem() == TeCoord2D( 0, 0 ) ), 
-      "Invalid intersection point" )
-  }    
-  
-  {
-    /* Y Axis Parallel line 2 and line 2 Test */
-  
-    TeLine2D line1;
-    line1.add( TeCoord2D( 0, 1 ) );
-    line1.add( TeCoord2D( 0, 1 ) );
-    
-    TeLineSet ls1;
-    ls1.add( line1 );
-    
-    TeLine2D line2;
-    line2.add( TeCoord2D( 0, 1 ) );
-    line2.add( TeCoord2D( 0, 1 ) );
-    
-    TeLineSet ls2;
-    ls2.add( line2 );    
-    
-    TePointSet ps1;
-    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
-    
-    TEAGN_TRUE_OR_THROW( ( ps1.size() == 0 ), "Invalid point set size" )
-  }
-  
-  {
-    /* Parallel lines Test */
-  
-    TeLine2D line1;
-    line1.add( TeCoord2D( -1, 1 ) );
-    line1.add( TeCoord2D( 1, 1 ) );
-    
-    TeLineSet ls1;
-    ls1.add( line1 );
-    
-    TeLine2D line2;
-    line2.add( TeCoord2D( -1, -1 ) );
-    line2.add( TeCoord2D( 1, -1 ) );
-    
-    TeLineSet ls2;
-    ls2.add( line2 );    
-    
-    TePointSet ps1;
-    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
-    
-    TEAGN_TRUE_OR_THROW( ( ps1.size() == 0 ), "Invalid point set size" )
-  }  
-  
-  {
-    /* Non-intercepted segments Test */
-  
-    TeLine2D line1;
-    line1.add( TeCoord2D( 0, 0 ) );
-    line1.add( TeCoord2D( 2, 2 ) );
-    
-    TeLineSet ls1;
-    ls1.add( line1 );
-    
-    TeLine2D line2;
-    line2.add( TeCoord2D( 1, 0 ) );
-    line2.add( TeCoord2D( 2, 0 ) );
-    
-    TeLineSet ls2;
-    ls2.add( line2 );    
-    
-    TePointSet ps1;
-    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
-    
-    TEAGN_TRUE_OR_THROW( ( ps1.size() == 0 ), "Invalid point set size" )
-  }  
-  
-}
-
-
-void getBandMinMaxValues_test()
-{
-  TePDITypes::TePDIRasterPtrType RAMRaster;
-  
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.nlines_ = 1;
-  params.ncols_ = 3;
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster, params, 
-    TePDIUtils::TePDIUtilsAutoMemPol ), "RAM Raster Allocation error" );
-    
-  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 0, 0, 0.0, 0 ),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 1, 0, 1.0, 0 ),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 2, 0, 2.0, 0 ),
-    "setElement error" );
-   
-  double min = -1.0;
-  double max = 10.0;
-  TePDIUtils::getBandMinMaxValues( RAMRaster, 0, false, 0, min, max );
-  
-  TEAGN_CHECK_EPS( min, 0.0, 0.0, "invalid min value" )
-  TEAGN_CHECK_EPS( max, 2.0, 0.0, "invalid max value" )
-}
-
-
-void convert2MultiBand_test()
-{
-  TePDITypes::TePDIRasterPtrType RAMRaster;
-  
-  TeRasterParams params;
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  
-  TeProjectionParams projparams;
-  projparams.name = "NoProjection";
-  TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-    projparams ) );          
-  params.projection( proj.nakedPointer() );   
-  
-  params.setNLinesNColumns( 1, 3 );
-  
-  params.setPhotometric( TeRasterParams::TePallete );
-  
-  params.lutr_.push_back( 255 );
-  params.lutg_.push_back( 0 );
-  params.lutb_.push_back( 0 );
-
-  params.lutr_.push_back( 0 );
-  params.lutg_.push_back( 255 );
-  params.lutb_.push_back( 0 );
-  
-  params.lutr_.push_back( 0 );
-  params.lutg_.push_back( 0 );
-  params.lutb_.push_back( 255 );  
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster, params, 
-    TePDIUtils::TePDIUtilsAutoMemPol ), "RAM Raster Allocation error" );
-    
-  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 0, 0, 0, 0), 
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 1, 0, 1, 0),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 2, 0, 2, 0),
-    "setElement error" );
-    
-  TePDITypes::TePDIRasterPtrType RAMRaster2;
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::convert2MultiBand( RAMRaster, true, 
-    RAMRaster2 ), "MultiBand conversion error" );
-    
-  TEAGN_TRUE_OR_THROW( RAMRaster2.isActive(), "Inactive pointer" )
-  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().nlines_ == 1 ), 
-    "Invalid lines" )
-  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().ncols_ == 3 ), 
-    "Invalid columns" )
-  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().nBands() == 3 ), 
-    "Invalid lines" )
-    
-  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().photometric_[ 0 ] == 
-    TeRasterParams::TeMultiBand ), "Invalid photometric interpretation" )
-  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().photometric_[ 1 ] == 
-    TeRasterParams::TeMultiBand ), "Invalid photometric interpretation" )
-  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().photometric_[ 2 ] == 
-    TeRasterParams::TeMultiBand ), "Invalid photometric interpretation" )
-    
-  double value = -1.0;
-  
-  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 0,0, value, 0),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 255, 0, "wrong value" );
-  
-  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 0,0, value, 1),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );
-  
-  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 0,0, value, 2),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );    
-  
-  
-  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 1,0, value, 0),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );
-  
-  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 1,0, value, 1),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 255, 0, "wrong value" );
-
-  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 1,0, value, 2),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );
-  
-  
-  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 2,0, value, 0),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );
-  
-  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 2,0, value, 1),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );
-
-  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 2,0, value, 2),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 255, 0, "wrong value" );
-}
-
-
-void compareGeometryPoints_tests()
-{
-  TePolygonSet ps1;
-  {
-    TeLinearRing lr;
-    lr.add( TeCoord2D( 0, 0 ) );
-    lr.add( TeCoord2D( 1, 0 ) );
-    lr.add( TeCoord2D( 1, 1 ) );
-    lr.add( TeCoord2D( 0, 1 ) );
-    lr.add( TeCoord2D( 0, 0 ) );
-    
-    TePolygon pol;
-    pol.add( lr );
-    
-    ps1.add( pol );
-  }
-  
-  TePolygonSet ps2;
-  {
-    TeLinearRing lr;
-    lr.add( TeCoord2D( 0, 0 ) );
-    lr.add( TeCoord2D( 1, 0 ) );
-    lr.add( TeCoord2D( 1, 1 ) );
-    lr.add( TeCoord2D( 0, 1 ) );
-    lr.add( TeCoord2D( 0, 0 ) );
-    
-    TePolygon pol;
-    pol.add( lr );
-    
-    ps2.add( pol );
-  }  
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::compareGeometryPoints( ps1, ps2 ),
-    "Invalid compareGeometryPoints result" )
-}
-
-
-void resampleRaster_test()
-{
-  TePDITypes::TePDIRasterPtrType input_raster;
-  TePDITypes::TePDIRasterPtrType output_raster;
-
-  TeRasterParams input_raster_params;
-  input_raster_params.nBands( 1 );
-  input_raster_params.setDataType( TeDOUBLE, -1 );
-  input_raster_params.setNLinesNColumns( 4, 4 );
-    
-  TeRasterParams output_raster_params;
-  output_raster_params.nBands( 1 );
-  output_raster_params.setDataType( TeDOUBLE, -1 );
-  output_raster_params.setNLinesNColumns( 2, 2 );
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster, 
-    input_raster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
-    "RAM Raster Allocation error" );
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster, 
-    output_raster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
-    "RAM Raster Allocation error" );
-    
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 0, 1.0, 0 ),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 0, 1.0, 0 ),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 0, 1.0, 0 ),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 0, 1.0, 0 ),
-    "setElement error" );
-        
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 1, 1.0, 0 ),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 1, 1.0, 0 ),
-    "setElement error" );    
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 1, 1.0, 0 ),
-    "setElement error" );  
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 1, 1.0, 0 ),
-    "setElement error" );       
-
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 2, 1.0, 0 ),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 2, 1.0, 0 ),
-    "setElement error" );    
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 2, 1.0, 0 ),
-    "setElement error" );    
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 2, 1.0, 0 ),
-    "setElement error" ); 
-    
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 3, 1.0, 0 ),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 3, 1.0, 0 ),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 3, 1.0, 0 ),
-    "setElement error" );
-  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 3, 1.0, 0 ),
-    "setElement error" );
-    
-  double resolution_ratio = 2.0;
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::resampleRasterByRes( input_raster, 
-    output_raster,
-    resolution_ratio , resolution_ratio, 
-    TePDIInterpolator::NNMethod,
-    true ), 
-    "Raster resample error" )
-  
-  
-  TEAGN_CHECK_EPS( output_raster->params().nlines_, 
-    ( input_raster->params().nlines_ / resolution_ratio ), 0.0, 
-    "invalid number of lines" )
-  TEAGN_CHECK_EPS( output_raster->params().ncols_, 
-    ( input_raster->params().ncols_ / resolution_ratio ), 0.0, 
-    "invalid number of columns" )
-  TEAGN_CHECK_EPS( output_raster->params().resx_, 3, 0.0, 
-    "invalid X resolution" )
-  TEAGN_CHECK_EPS( output_raster->params().resy_, 3, 0.0, 
-    "invalid Y() resolution" )
-  TEAGN_CHECK_EPS( output_raster->params().nBands(), 
-    input_raster->params().nBands(), 0.0, 
-    "invalid bands number" )
-    
-  double value = 0;
-    
-  TEAGN_TRUE_OR_THROW( output_raster->getElement( 0, 0, value, 0 ),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 1.0, 0.0, "Incorrect value" )
-  
-  TEAGN_TRUE_OR_THROW( output_raster->getElement( 0, 1, value, 0 ),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 1.0, 0.0, "Incorrect value" )
-  
-  TEAGN_TRUE_OR_THROW( output_raster->getElement( 1, 0, value, 0 ),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 1.0, 0.0, "Incorrect value" )  
-  
-  TEAGN_TRUE_OR_THROW( output_raster->getElement( 1, 1, value, 0 ),
-    "getElement error" )
-  TEAGN_CHECK_EPS( value, 1.0, 0.0, "Incorrect value" )  
-}
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );  
-  
-    TeInitRasterDecoders();
-    
-    buildDetailedBox_test();
-    buildDetailedBBox_test();
-    resampleRaster_test();
-    getBandMinMaxValues_test();
-    makeSegmentSet_test();
-    TeSegSetIntersection_test();
-    TeRelation_test();
-    TeAllocRAMRaster_usingparams_test();
-    TeAllocRAMRaster1_test();
-    TeAllocRAMRaster_templateraster_test();
-    raster_compare_test();
-    TeGetRasterMinMaxBounds_test();
-    TeGetRasterReqMem_test();    
-    IsFloatBand_test();
-    TeRaster2Geotiff_test();
-    TeRaster2Geotiff_deprecated_test();
-    TeAllocMemoryMappedRaster_test();
-    convert2MultiBand_test();
-    compareGeometryPoints_tests();
-    reprojectRaster_test();
-    getGeodeticPixelRes_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIUtils.hpp>
+
+#include <TeAgnostic.h>
+
+#include <string>
+
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+#include <TePrecision.h>
+#include <TeInitRasterDecoders.h>
+
+
+void raster_compare_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+
+  TEAGN_TRUE_OR_THROW(
+    TePDIUtils::rasterCompare( inRaster, inRaster ),
+    "Raster compare error" );
+}
+
+
+void TeGetRasterMinMaxBounds_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+
+  double min = 0;
+  double max = 0;
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds( inRaster, 0, min, max ),
+    "Unable to get bounds" );
+
+  TEAGN_CHECK_EQUAL( min, 0, "Invalid min value" );
+  TEAGN_CHECK_EQUAL( max, 255, "Invalid max value" );
+
+}
+
+
+void TeRaster2Geotiff_deprecated_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  
+  double pixel_value = 0;
+  TEAGN_TRUE_OR_THROW( inRaster->getElement( 0, 0, pixel_value, 0 ),
+    "Unable to get element" );
+  TEAGN_CHECK_EPS( pixel_value, 88., 0.00001, 
+    "Pixel value inversion detected" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( inRaster,
+    TEPDIEXAMPLESBINPATH "TeRaster2Geotiff_test.tif" ), "GeoTIF generation error" );
+
+  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
+    std::string( TEPDIEXAMPLESBINPATH "TeRaster2Geotiff_test.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
+  
+  TEAGN_TRUE_OR_THROW( inRaster2->getElement( 0, 0, pixel_value, 0 ),
+    "Unable to get element" );
+  TEAGN_CHECK_EPS( pixel_value, 88., 0.00001, 
+    "Pixel value inversion detected" );
+
+  TEAGN_TRUE_OR_THROW(
+    TePDIUtils::rasterCompare( inRaster, inRaster2 ),
+    "Raster compare error" );
+}
+
+
+void TeRaster2Geotiff_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  
+  double pixel_value = 0;
+  TEAGN_TRUE_OR_THROW( inRaster->getElement( 0, 0, pixel_value, 0 ),
+    "Unable to get element" );
+  TEAGN_CHECK_EPS( pixel_value, 88., 0.00001, 
+    "Pixel value inversion detected" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( inRaster,
+    TEPDIEXAMPLESBINPATH "TeRaster2Geotiff_test.tif",
+    true ), "GeoTIF generation error" );
+
+  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
+    std::string( TEPDIEXAMPLESBINPATH "TeRaster2Geotiff_test.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
+  
+  TEAGN_TRUE_OR_THROW( inRaster2->getElement( 0, 0, pixel_value, 0 ),
+    "Unable to get element" );
+  TEAGN_CHECK_EPS( pixel_value, 88., 0.00001, 
+    "Pixel value inversion detected" );
+
+  TEAGN_TRUE_OR_THROW(
+    TePDIUtils::rasterCompare( inRaster, inRaster2 ),
+    "Raster compare error" );
+}
+
+void TeRaster2RGBGeotiff_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_rgb342_crop1_chip0_0.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2RGBGeotiff( inRaster,
+    TEPDIEXAMPLESBINPATH "TeRaster2RGBGeotiff_test.tif",
+    true ), "GeoTIF generation error" );
+
+  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
+    std::string( TEPDIEXAMPLESBINPATH "TeRaster2RGBGeotiff_test.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
+
+  TEAGN_TRUE_OR_THROW(
+    TePDIUtils::rasterCompare( inRaster, inRaster2 ),
+    "Raster compare error" );
+}
+
+void TeRaster2Jpeg_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  
+  double pixel_value = 0;
+  TEAGN_TRUE_OR_THROW( inRaster->getElement( 0, 0, pixel_value, 0 ),
+    "Unable to get element" );
+  TEAGN_CHECK_EPS( pixel_value, 88., 0.00001, 
+    "Pixel value inversion detected" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Jpeg( inRaster,
+    TEPDIEXAMPLESBINPATH "TeRaster2Jpeg_test.jpg",
+    true, 100 ), "GeoTIF generation error" );
+
+  TePDITypes::TePDIRasterPtrType inRaster2( new TeRaster(
+    std::string( TEPDIEXAMPLESBINPATH "TeRaster2Jpeg_test.jpg" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster2->init(), "Unable to init inRaster2" );
+  
+  TEAGN_TRUE_OR_THROW( inRaster2->getElement( 0, 0, pixel_value, 0 ),
+    "Unable to get element" );
+  TEAGN_CHECK_EPS( pixel_value, 88., 0.00001, 
+    "Pixel value inversion detected" );
+}
+
+
+void TeGetRasterReqMem_test()
+{
+  TePDITypes::TePDIRasterPtrType RAMRaster;
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster, 10,
+    10, 10, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Allocation error" );
+    
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeGetRasterReqMem( RAMRaster->params() ) == 1000 ),
+    "Invalid TeGetRasterReqMem result" );
+}
+
+
+void TeAllocRAMRaster1_test()
+{
+  TePDITypes::TePDIRasterPtrType RAMRaster;
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster, 10,
+    10, 10, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Allocation error" );
+
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->params().status_ == TeRasterParams::TeReadyToWrite, 
+    "Raster status error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().nlines_ == 10, "Lines error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().ncols_ == 10, "Columns error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->nBands() == 10, "Bands error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().dataType_[ 0 ] == TeUNSIGNEDCHAR,
+    "data type error" );
+}
+
+
+void TeAllocRAMRaster_templateraster_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+
+  TePDITypes::TePDIRasterPtrType RAMRaster( new TeRaster );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( inRaster, RAMRaster, 0,
+    true, false, TeUNSIGNEDCHAR ), "RAM Raster Allocation error" );
+
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().dataType_[ 0 ] == TeUNSIGNEDCHAR,
+    "data type error" );
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->params().status_ == TeRasterParams::TeReadyToWrite, 
+    "Raster status error" );
+    
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().nlines_ == 
+    inRaster->params().nlines_, "Checking error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().ncols_ == 
+    inRaster->params().ncols_, "Checking error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().dataType_[ 0 ] == 
+    inRaster->params().dataType_[ 0 ], "Checking error" );
+  TEAGN_TRUE_OR_THROW( ( *(RAMRaster->params().projection()) ) == 
+    ( *(inRaster->params().projection()) ), "Checking error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().box() == 
+    inRaster->params().box(), "Checking error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().resx_ == 
+    inRaster->params().resx_, "Checking error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().resy_ == 
+    inRaster->params().resy_, "Checking error" );
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->params().status_ == TeRasterParams::TeReadyToWrite, 
+    "Raster status error" );    
+}
+
+
+void TeAllocRAMRaster_usingparams_test()
+{
+  TePDITypes::TePDIRasterPtrType RAMRaster;
+  
+  TeRasterParams params;
+  params.nBands( 10 );
+  params.nlines_ = 10;
+  params.ncols_ = 10;
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster, params, 
+    TePDIUtils::TePDIUtilsAutoMemPol ), "RAM Raster Allocation error" );
+
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->params().status_ == TeRasterParams::TeReadyToWrite, 
+    "Raster status error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().nlines_ == 10, "Lines error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().ncols_ == 10, "Columns error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->nBands() == 10, "Bands error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().dataType_[ 0 ] == TeUNSIGNEDCHAR,
+    "data type error" );
+}
+
+
+void TeAllocMemoryMappedRaster_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+
+  TePDITypes::TePDIRasterPtrType RAMRaster;
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( inRaster, RAMRaster, 0,
+    true, true, TeUNSIGNEDCHAR ), "RAM Raster Allocation error" );
+
+  TEAGN_TRUE_OR_THROW( RAMRaster->params().dataType_[ 0 ] == TeUNSIGNEDCHAR,
+    "data type error" );
+  TEAGN_TRUE_OR_THROW( 
+    RAMRaster->params().status_ == TeRasterParams::TeReadyToWrite, 
+    "Raster status error" );    
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeCopyRasterBands( inRaster,
+    RAMRaster, false, false ), "Raster band copy error" );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( RAMRaster,
+    TEPDIEXAMPLESBINPATH "TeAllocMemoryMappedRaster_test.tif" ), "GeoTIF generation error" );
+}
+
+
+void IsFloatBand_test()
+{
+
+  TePDITypes::TePDIRasterPtrType RAMRaster_int;
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster_int, 10,
+    10, 10, false, TeINTEGER, 0 ), "RAM Raster Allocation error" );
+    
+  TEAGN_TRUE_OR_THROW( ( ! TePDIUtils::IsFloatBand( RAMRaster_int, 0 ) ),
+    "Invalid result" );
+  
+  TePDITypes::TePDIRasterPtrType RAMRaster_uchar;
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster_uchar, 10,
+    10, 10, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Allocation error" );    
+    
+  TEAGN_TRUE_OR_THROW( ( ! TePDIUtils::IsFloatBand( RAMRaster_uchar, 0 ) ),
+    "Invalid result" );
+    
+  TePDITypes::TePDIRasterPtrType RAMRaster_float;
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster_float, 10,
+    10, 10, false, TeFLOAT, 0 ), "RAM Raster Allocation error" );    
+    
+  TEAGN_TRUE_OR_THROW( ( TePDIUtils::IsFloatBand( RAMRaster_float, 0 ) ),
+    "Invalid result" );    
+    
+  TePDITypes::TePDIRasterPtrType RAMRaster_double;
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster_double, 10,
+    10, 10, false, TeDOUBLE, 0 ), "RAM Raster Allocation error" );    
+    
+  TEAGN_TRUE_OR_THROW( ( TePDIUtils::IsFloatBand( RAMRaster_double, 0 ) ),
+    "Invalid result" );     
+};
+
+
+void buildDetailedBox_test()
+{
+  TeNoProjection proj;
+
+  TeRasterParams params;
+  params.nBands( 1 );
+  params.nlines_ = 3;
+  params.ncols_ = 3;
+  params.projection( &proj );
+  
+  TePDITypes::TePDIRasterPtrType ram_raster;
+  TEAGN_TRUE_OR_THROW( 
+    TePDIUtils::TeAllocRAMRaster( ram_raster, params, false ), 
+    "RAM Raster Allocation error" );
+    
+  TePolygon box_polygon;
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::buildDetailedBox( ram_raster,
+    box_polygon), "detailed box building error" );
+    
+  TEAGN_TRUE_OR_THROW( ( box_polygon.size() == 1 ), 
+    "Invalid linear rings number" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ].size() == 9 ), 
+    "Invalid points number" );
+    
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 0 ] == 
+    ram_raster->index2Coord( TeCoord2D( 0, 0 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 1 ] == 
+    ram_raster->index2Coord( TeCoord2D( 1, 0 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 2 ] == 
+    ram_raster->index2Coord( TeCoord2D( 2, 0 ) ) ), 
+    "Invalid point" );
+  
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 3 ] == 
+    ram_raster->index2Coord( TeCoord2D( 2, 1 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 4 ] == 
+    ram_raster->index2Coord( TeCoord2D( 2, 2 ) ) ), 
+    "Invalid point" );
+    
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 5 ] == 
+    ram_raster->index2Coord( TeCoord2D( 1, 2 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 6 ] == 
+    ram_raster->index2Coord( TeCoord2D( 0, 2 ) ) ), 
+    "Invalid point" );
+    
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 7 ] == 
+    ram_raster->index2Coord( TeCoord2D( 0, 1 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 8 ] == 
+    ram_raster->index2Coord( TeCoord2D( 0, 0 ) ) ), 
+    "Invalid point" );
+            
+}
+
+
+void buildDetailedBBox_test()
+{
+  TeNoProjection proj;
+
+  TeRasterParams params;
+  params.nBands( 1 );
+  params.nlines_ = 3;
+  params.ncols_ = 3;
+  params.projection( &proj );
+  
+  TePDITypes::TePDIRasterPtrType ram_raster;
+  TEAGN_TRUE_OR_THROW( 
+    TePDIUtils::TeAllocRAMRaster( ram_raster, params, false ), 
+    "RAM Raster Allocation error" );
+    
+  TePolygon box_polygon;
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::buildDetailedBBox( ram_raster,
+    box_polygon), "detailed box building error" );
+    
+  TEAGN_TRUE_OR_THROW( ( box_polygon.size() == 1 ), 
+    "Invalid linear rings number" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ].size() == 13 ), 
+    "Invalid points number" );
+    
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 0 ] == 
+    ram_raster->index2Coord( TeCoord2D( -0.5, -0.5 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 1 ] == 
+    ram_raster->index2Coord( TeCoord2D( 0.5, -0.5 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 2 ] == 
+    ram_raster->index2Coord( TeCoord2D( 1.5, -0.5 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 3 ] == 
+    ram_raster->index2Coord( TeCoord2D( 2.5, -0.5 ) ) ), 
+    "Invalid point" );    
+  
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 4 ] == 
+    ram_raster->index2Coord( TeCoord2D( 2.5, 0.5 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 5 ] == 
+    ram_raster->index2Coord( TeCoord2D( 2.5, 1.5 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 6 ] == 
+    ram_raster->index2Coord( TeCoord2D( 2.5, 2.5 ) ) ), 
+    "Invalid point" );    
+    
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 7 ] == 
+    ram_raster->index2Coord( TeCoord2D( 1.5, 2.5 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 8 ] == 
+    ram_raster->index2Coord( TeCoord2D( 0.5, 2.5 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 9 ] == 
+    ram_raster->index2Coord( TeCoord2D( -0.5, 2.5 ) ) ), 
+    "Invalid point" );    
+    
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 10 ] == 
+    ram_raster->index2Coord( TeCoord2D( -0.5, 1.5 ) ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 11 ] == 
+    ram_raster->index2Coord( TeCoord2D( -0.5, 0.5 ) ) ), 
+    "Invalid point" );    
+  TEAGN_TRUE_OR_THROW( ( box_polygon[ 0 ][ 12 ] == 
+    ram_raster->index2Coord( TeCoord2D( -0.5, -0.5 ) ) ), 
+    "Invalid point" );    
+}
+
+void reprojectRaster_test()
+{
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+  
+  TePDITypes::TePDIRasterPtrType ram_raster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( ram_raster, 10,
+    10, 10, false, TeUNSIGNEDCHAR, 0 ), "RAM Raster Allocation error" ); 
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::reprojectRaster( *inRaster,
+     inRaster->params().nlines_, inRaster->params().ncols_,
+     *(inRaster->projection()), true, *ram_raster ),
+    "Raster reprojection error" );
+    
+  TEAGN_TRUE_OR_THROW( ( inRaster->projection()->name() ==
+    ram_raster->projection()->name() ),
+    "Invalid projection name" );
+  TEAGN_CHECK_EPS( inRaster->params().box().x1(),
+    ram_raster->params().box().x1(), 0.000001, "Invalid box" );
+  TEAGN_CHECK_EPS( inRaster->params().box().x2(),
+    ram_raster->params().box().x2(), 0.000001, "Invalid box" );    
+  TEAGN_CHECK_EPS( inRaster->params().box().y1(),
+    ram_raster->params().box().y1(), 0.0001, "Invalid box" );
+  TEAGN_CHECK_EPS( inRaster->params().box().y2(),
+    ram_raster->params().box().y2(), 0.0001, "Invalid box" );    
+  TEAGN_CHECK_EPS( inRaster->params().resx_,
+    ram_raster->params().resx_, 0.0001, "Invalid box" );    
+  TEAGN_CHECK_EPS( inRaster->params().resy_,
+    ram_raster->params().resy_, 0.0001, "Invalid box" );    
+    
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( ram_raster,
+    TEPDIEXAMPLESBINPATH "TePDIUtils_reprojectRaster_test.tif" ), "GeoTIF generation error" );    
+}
+
+
+void TeRelation_test()
+{
+  TeLinearRing r1;
+  r1.add( TeCoord2D( 0, 0 ) );
+  r1.add( TeCoord2D( 3, 0 ) );
+  r1.add( TeCoord2D( 3, 3 ) );
+  r1.add( TeCoord2D( 0, 3.3 ) );
+  r1.add( TeCoord2D( 0, 0 ) );
+  
+  TeLinearRing r2;
+  r2.add( TeCoord2D( 1, 1 ) );
+  r2.add( TeCoord2D( 2, 1 ) );
+  r2.add( TeCoord2D( 2, 2 ) );
+  r2.add( TeCoord2D( 1, 2 ) );
+  r2.add( TeCoord2D( 1, 1 ) );
+  
+  TePolygon pol1;
+  pol1.add( r1 );
+  pol1.add( r2 );
+  
+  TePDITileIndexer ti( pol1, 0.3 ); 
+  
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( 1.5, 0.5 ), ti ) == TeINSIDE ),
+    "Invalid relation" );   
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( 2.5, 1.5 ), ti ) == TeINSIDE ),
+    "Invalid relation" );   
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( 1.5, 2.5 ), ti ) == TeINSIDE ),
+    "Invalid relation" );   
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( 0.5, 1.5 ), ti ) == TeINSIDE ),
+    "Invalid relation" );   
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( 0.5, 1.5 ), ti ) == TeINSIDE ),
+    "Invalid relation" );   
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( 0.1, 3.1 ), ti ) == TeINSIDE ),
+    "Invalid relation" );     
+      
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( 1.5, 1.5 ), ti ) == TeOUTSIDE ),
+    "Invalid relation" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( 2.5, 3.5 ), ti ) == TeOUTSIDE ),
+    "Invalid relation" );
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( -1.0, 1.0 ), ti ) == TeOUTSIDE ),
+    "Invalid relation" );    
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( -1.0, -1.0 ), ti ) == TeOUTSIDE ),
+    "Invalid relation" );    
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( 1.0, -1.0 ), ti ) == TeOUTSIDE ),
+    "Invalid relation" );  
+  TEAGN_TRUE_OR_THROW( 
+    ( TePDIUtils::TeRelation( TeCoord2D( 4.0, 4.0 ), ti ) == TeOUTSIDE ),
+    "Invalid relation" );        
+}
+
+
+void makeSegmentSet_test()
+{
+  TeLine2D l1;
+  l1.add( TeCoord2D( 0,0 ) );
+  l1.add( TeCoord2D( 1,0 ) );
+  l1.add( TeCoord2D( 0,1 ) );
+  l1.add( TeCoord2D( 0,0 ) );
+  
+  TeLinearRing lr1( l1 );
+  
+  TePolygon p1;
+  p1.add( lr1 );
+  
+  TeLineSet ls1;
+  TePDIUtils::makeSegmentSet( p1, ls1 );
+  
+  TEAGN_TRUE_OR_THROW( ( ls1.size() == 3 ), "Invalid line set size" );
+  
+  TEAGN_TRUE_OR_THROW( ( ls1[ 0 ].size() == 2 ), "Invalid segment size" );
+  TEAGN_TRUE_OR_THROW( ( ls1[ 1 ].size() == 2 ), "Invalid segment size" );
+  TEAGN_TRUE_OR_THROW( ( ls1[ 2 ].size() == 2 ), "Invalid segment size" );
+  
+  TEAGN_TRUE_OR_THROW( ( ls1[ 0 ][ 0 ] == TeCoord2D( 0, 0 ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( ls1[ 0 ][ 1 ] == TeCoord2D( 1, 0 ) ), 
+    "Invalid point" );  
+    
+  TEAGN_TRUE_OR_THROW( ( ls1[ 1 ][ 0 ] == TeCoord2D( 1, 0 ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( ls1[ 1 ][ 1 ] == TeCoord2D( 0, 1 ) ), 
+    "Invalid point" );      
+
+  TEAGN_TRUE_OR_THROW( ( ls1[ 2 ][ 0 ] == TeCoord2D( 0, 1 ) ), 
+    "Invalid point" );
+  TEAGN_TRUE_OR_THROW( ( ls1[ 2 ][ 1 ] == TeCoord2D( 0, 0 ) ), 
+    "Invalid point" );      
+}
+
+
+void TeSegSetIntersection_test()
+{
+  {
+    /* X test */
+  
+    TeLine2D line1;
+    line1.add( TeCoord2D( -1, -1 ) );
+    line1.add( TeCoord2D( 1, 1 ) );
+    
+    TeLineSet ls1;
+    ls1.add( line1 );
+    
+    TeLine2D line2;
+    line2.add( TeCoord2D( -1, 1 ) );
+    line2.add( TeCoord2D( 1, -1 ) );
+    
+    TeLineSet ls2;
+    ls2.add( line2 );    
+    
+    TePointSet ps1;
+    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
+    
+    TEAGN_TRUE_OR_THROW( ( ps1.size() == 1 ), "Invalid point set size" )
+    TEAGN_TRUE_OR_THROW( ( ps1[ 0 ].elem() == TeCoord2D( 0, 0 ) ), 
+      "Invalid intersection point" )
+  }
+  
+  {
+    /* + Test */
+  
+    TeLine2D line1;
+    line1.add( TeCoord2D( -1, 0 ) );
+    line1.add( TeCoord2D( 1, 0 ) );
+    
+    TeLineSet ls1;
+    ls1.add( line1 );
+    
+    TeLine2D line2;
+    line2.add( TeCoord2D( 0, 1 ) );
+    line2.add( TeCoord2D( 0, -1 ) );
+    
+    TeLineSet ls2;
+    ls2.add( line2 );    
+    
+    TePointSet ps1;
+    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
+    
+    TEAGN_TRUE_OR_THROW( ( ps1.size() == 1 ), "Invalid point set size" )
+    TEAGN_TRUE_OR_THROW( ( ps1[ 0 ].elem() == TeCoord2D( 0, 0 ) ), 
+      "Invalid intersection point" )
+  }  
+  
+  {
+    /* Y Axis Parallel line 1 Test */
+  
+    TeLine2D line1;
+    line1.add( TeCoord2D( 0, 1 ) );
+    line1.add( TeCoord2D( 0, -1 ) );
+    
+    TeLineSet ls1;
+    ls1.add( line1 );
+    
+    TeLine2D line2;
+    line2.add( TeCoord2D( -1, -1 ) );
+    line2.add( TeCoord2D( 1, 1 ) );
+    
+    TeLineSet ls2;
+    ls2.add( line2 );    
+    
+    TePointSet ps1;
+    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
+    
+    TEAGN_TRUE_OR_THROW( ( ps1.size() == 1 ), "Invalid point set size" )
+    TEAGN_TRUE_OR_THROW( ( ps1[ 0 ].elem() == TeCoord2D( 0, 0 ) ), 
+      "Invalid intersection point" )
+  }  
+  
+  {
+    /* Y Axis Parallel line 2 Test */
+  
+    TeLine2D line1;
+    line1.add( TeCoord2D( -1, -1 ) );
+    line1.add( TeCoord2D( 1, 1 ) );
+    
+    TeLineSet ls1;
+    ls1.add( line1 );
+    
+    TeLine2D line2;
+    line2.add( TeCoord2D( 0, 1 ) );
+    line2.add( TeCoord2D( 0, -1 ) );
+    
+    TeLineSet ls2;
+    ls2.add( line2 );    
+    
+    TePointSet ps1;
+    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
+    
+    TEAGN_TRUE_OR_THROW( ( ps1.size() == 1 ), "Invalid point set size" )
+    TEAGN_TRUE_OR_THROW( ( ps1[ 0 ].elem() == TeCoord2D( 0, 0 ) ), 
+      "Invalid intersection point" )
+  }    
+  
+  {
+    /* Y Axis Parallel line 2 and line 2 Test */
+  
+    TeLine2D line1;
+    line1.add( TeCoord2D( 0, 1 ) );
+    line1.add( TeCoord2D( 0, 1 ) );
+    
+    TeLineSet ls1;
+    ls1.add( line1 );
+    
+    TeLine2D line2;
+    line2.add( TeCoord2D( 0, 1 ) );
+    line2.add( TeCoord2D( 0, 1 ) );
+    
+    TeLineSet ls2;
+    ls2.add( line2 );    
+    
+    TePointSet ps1;
+    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
+    
+    TEAGN_TRUE_OR_THROW( ( ps1.size() == 0 ), "Invalid point set size" )
+  }
+  
+  {
+    /* Parallel lines Test */
+  
+    TeLine2D line1;
+    line1.add( TeCoord2D( -1, 1 ) );
+    line1.add( TeCoord2D( 1, 1 ) );
+    
+    TeLineSet ls1;
+    ls1.add( line1 );
+    
+    TeLine2D line2;
+    line2.add( TeCoord2D( -1, -1 ) );
+    line2.add( TeCoord2D( 1, -1 ) );
+    
+    TeLineSet ls2;
+    ls2.add( line2 );    
+    
+    TePointSet ps1;
+    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
+    
+    TEAGN_TRUE_OR_THROW( ( ps1.size() == 0 ), "Invalid point set size" )
+  }  
+  
+  {
+    /* Non-intercepted segments Test */
+  
+    TeLine2D line1;
+    line1.add( TeCoord2D( 0, 0 ) );
+    line1.add( TeCoord2D( 2, 2 ) );
+    
+    TeLineSet ls1;
+    ls1.add( line1 );
+    
+    TeLine2D line2;
+    line2.add( TeCoord2D( 1, 0 ) );
+    line2.add( TeCoord2D( 2, 0 ) );
+    
+    TeLineSet ls2;
+    ls2.add( line2 );    
+    
+    TePointSet ps1;
+    TePDIUtils::TeSegSetIntersection( ls1, ls2, ps1 );
+    
+    TEAGN_TRUE_OR_THROW( ( ps1.size() == 0 ), "Invalid point set size" )
+  }  
+  
+}
+
+
+void getBandMinMaxValues_test()
+{
+  TePDITypes::TePDIRasterPtrType RAMRaster;
+  
+  TeRasterParams params;
+  params.nBands( 1 );
+  params.nlines_ = 1;
+  params.ncols_ = 3;
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster, params, 
+    TePDIUtils::TePDIUtilsAutoMemPol ), "RAM Raster Allocation error" );
+    
+  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 0, 0, 0.0, 0 ),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 1, 0, 1.0, 0 ),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 2, 0, 2.0, 0 ),
+    "setElement error" );
+   
+  double min = -1.0;
+  double max = 10.0;
+  TePDIUtils::getBandMinMaxValues( RAMRaster, 0, false, 0, min, max );
+  
+  TEAGN_CHECK_EPS( min, 0.0, 0.0, "invalid min value" )
+  TEAGN_CHECK_EPS( max, 2.0, 0.0, "invalid max value" )
+}
+
+
+void convert2MultiBand_test()
+{
+  TePDITypes::TePDIRasterPtrType RAMRaster;
+  
+  TeRasterParams params;
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  
+  TeProjectionParams projparams;
+  projparams.name = "NoProjection";
+  TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+    projparams ) );          
+  params.projection( proj.nakedPointer() );   
+  
+  params.setNLinesNColumns( 1, 3 );
+  
+  params.setPhotometric( TeRasterParams::TePallete );
+  
+  params.lutr_.push_back( 255 );
+  params.lutg_.push_back( 0 );
+  params.lutb_.push_back( 0 );
+
+  params.lutr_.push_back( 0 );
+  params.lutg_.push_back( 255 );
+  params.lutb_.push_back( 0 );
+  
+  params.lutr_.push_back( 0 );
+  params.lutg_.push_back( 0 );
+  params.lutb_.push_back( 255 );  
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster, params, 
+    TePDIUtils::TePDIUtilsAutoMemPol ), "RAM Raster Allocation error" );
+    
+  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 0, 0, 0, 0), 
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 1, 0, 1, 0),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( RAMRaster->setElement( 2, 0, 2, 0),
+    "setElement error" );
+    
+  TePDITypes::TePDIRasterPtrType RAMRaster2;
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::convert2MultiBand( RAMRaster, true, 
+    RAMRaster2 ), "MultiBand conversion error" );
+    
+  TEAGN_TRUE_OR_THROW( RAMRaster2.isActive(), "Inactive pointer" )
+  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().nlines_ == 1 ), 
+    "Invalid lines" )
+  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().ncols_ == 3 ), 
+    "Invalid columns" )
+  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().nBands() == 3 ), 
+    "Invalid lines" )
+    
+  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().photometric_[ 0 ] == 
+    TeRasterParams::TeMultiBand ), "Invalid photometric interpretation" )
+  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().photometric_[ 1 ] == 
+    TeRasterParams::TeMultiBand ), "Invalid photometric interpretation" )
+  TEAGN_TRUE_OR_THROW( ( RAMRaster2->params().photometric_[ 2 ] == 
+    TeRasterParams::TeMultiBand ), "Invalid photometric interpretation" )
+    
+  double value = -1.0;
+  
+  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 0,0, value, 0),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 255, 0, "wrong value" );
+  
+  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 0,0, value, 1),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );
+  
+  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 0,0, value, 2),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );    
+  
+  
+  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 1,0, value, 0),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );
+  
+  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 1,0, value, 1),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 255, 0, "wrong value" );
+
+  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 1,0, value, 2),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );
+  
+  
+  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 2,0, value, 0),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );
+  
+  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 2,0, value, 1),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 0, 0, "wrong value" );
+
+  TEAGN_TRUE_OR_THROW( RAMRaster2->getElement( 2,0, value, 2),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 255, 0, "wrong value" );
+}
+
+
+void compareGeometryPoints_tests()
+{
+  TePolygonSet ps1;
+  {
+    TeLinearRing lr;
+    lr.add( TeCoord2D( 0, 0 ) );
+    lr.add( TeCoord2D( 1, 0 ) );
+    lr.add( TeCoord2D( 1, 1 ) );
+    lr.add( TeCoord2D( 0, 1 ) );
+    lr.add( TeCoord2D( 0, 0 ) );
+    
+    TePolygon pol;
+    pol.add( lr );
+    
+    ps1.add( pol );
+  }
+  
+  TePolygonSet ps2;
+  {
+    TeLinearRing lr;
+    lr.add( TeCoord2D( 0, 0 ) );
+    lr.add( TeCoord2D( 1, 0 ) );
+    lr.add( TeCoord2D( 1, 1 ) );
+    lr.add( TeCoord2D( 0, 1 ) );
+    lr.add( TeCoord2D( 0, 0 ) );
+    
+    TePolygon pol;
+    pol.add( lr );
+    
+    ps2.add( pol );
+  }  
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::compareGeometryPoints( ps1, ps2 ),
+    "Invalid compareGeometryPoints result" )
+}
+
+
+void resampleRaster_test()
+{
+  TePDITypes::TePDIRasterPtrType input_raster;
+  TePDITypes::TePDIRasterPtrType output_raster;
+
+  TeRasterParams input_raster_params;
+  input_raster_params.nBands( 1 );
+  input_raster_params.setDataType( TeDOUBLE, -1 );
+  input_raster_params.setNLinesNColumns( 4, 4 );
+    
+  TeRasterParams output_raster_params;
+  output_raster_params.nBands( 1 );
+  output_raster_params.setDataType( TeDOUBLE, -1 );
+  output_raster_params.setNLinesNColumns( 2, 2 );
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( input_raster, 
+    input_raster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
+    "RAM Raster Allocation error" );
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster, 
+    output_raster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
+    "RAM Raster Allocation error" );
+    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 0, 1.0, 0 ),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 0, 1.0, 0 ),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 0, 1.0, 0 ),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 0, 1.0, 0 ),
+    "setElement error" );
+        
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 1, 1.0, 0 ),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 1, 1.0, 0 ),
+    "setElement error" );    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 1, 1.0, 0 ),
+    "setElement error" );  
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 1, 1.0, 0 ),
+    "setElement error" );       
+
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 2, 1.0, 0 ),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 2, 1.0, 0 ),
+    "setElement error" );    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 2, 1.0, 0 ),
+    "setElement error" );    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 2, 1.0, 0 ),
+    "setElement error" ); 
+    
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 0, 3, 1.0, 0 ),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 1, 3, 1.0, 0 ),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 2, 3, 1.0, 0 ),
+    "setElement error" );
+  TEAGN_TRUE_OR_THROW( input_raster->setElement( 3, 3, 1.0, 0 ),
+    "setElement error" );
+    
+  double resolution_ratio = 2.0;
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::resampleRasterByRes( input_raster, 
+    output_raster,
+    resolution_ratio , resolution_ratio, 
+    TePDIInterpolator::NNMethod,
+    true ), 
+    "Raster resample error" )
+  
+  
+  TEAGN_CHECK_EPS( output_raster->params().nlines_, 
+    ( input_raster->params().nlines_ / resolution_ratio ), 0.0, 
+    "invalid number of lines" )
+  TEAGN_CHECK_EPS( output_raster->params().ncols_, 
+    ( input_raster->params().ncols_ / resolution_ratio ), 0.0, 
+    "invalid number of columns" )
+  TEAGN_CHECK_EPS( output_raster->params().resx_, 3, 0.0, 
+    "invalid X resolution" )
+  TEAGN_CHECK_EPS( output_raster->params().resy_, 3, 0.0, 
+    "invalid Y() resolution" )
+  TEAGN_CHECK_EPS( output_raster->params().nBands(), 
+    input_raster->params().nBands(), 0.0, 
+    "invalid bands number" )
+    
+  double value = 0;
+    
+  TEAGN_TRUE_OR_THROW( output_raster->getElement( 0, 0, value, 0 ),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 1.0, 0.0, "Incorrect value" )
+  
+  TEAGN_TRUE_OR_THROW( output_raster->getElement( 0, 1, value, 0 ),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 1.0, 0.0, "Incorrect value" )
+  
+  TEAGN_TRUE_OR_THROW( output_raster->getElement( 1, 0, value, 0 ),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 1.0, 0.0, "Incorrect value" )  
+  
+  TEAGN_TRUE_OR_THROW( output_raster->getElement( 1, 1, value, 0 ),
+    "getElement error" )
+  TEAGN_CHECK_EPS( value, 1.0, 0.0, "Incorrect value" )  
+}
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  TeStdIOProgress pi;
+  TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );  
+  
+  TeInitRasterDecoders();
+  
+  buildDetailedBox_test();
+  buildDetailedBBox_test();
+  resampleRaster_test();
+  getBandMinMaxValues_test();
+  makeSegmentSet_test();
+  TeSegSetIntersection_test();
+  TeRelation_test();
+  TeAllocRAMRaster_usingparams_test();
+  TeAllocRAMRaster1_test();
+  TeAllocRAMRaster_templateraster_test();
+  raster_compare_test();
+  TeGetRasterMinMaxBounds_test();
+  TeGetRasterReqMem_test();    
+  IsFloatBand_test();
+  TeRaster2Geotiff_test();
+  TeRaster2RGBGeotiff_test();
+  TeRaster2Geotiff_deprecated_test();
+  TeRaster2Jpeg_test();
+  TeAllocMemoryMappedRaster_test();
+  convert2MultiBand_test();
+  compareGeometryPoints_tests();
+  reprojectRaster_test();
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
diff --git a/examples/image_processing/source/TePDIUtils/TePDIUtils_test.vcproj b/examples/image_processing/source/TePDIUtils/TePDIUtils_test.vcproj
old mode 100755
new mode 100644
index 13d9b55..87333c1
--- a/examples/image_processing/source/TePDIUtils/TePDIUtils_test.vcproj
+++ b/examples/image_processing/source/TePDIUtils/TePDIUtils_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIUtils_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIUtils_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIUtils_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIUtils_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIUtils_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIUtils_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIUtils_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIUtils_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIUtils_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIUtils_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/TePDIWavelets/.cvsignore b/examples/image_processing/source/TePDIWavelets/.cvsignore
new file mode 100644
index 0000000..d4daa4b
--- /dev/null
+++ b/examples/image_processing/source/TePDIWavelets/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+*.sln
+*.suo
+Debug
+Release
diff --git a/examples/image_processing/source/TePDIWavelets/TePDIWavelets.pro b/examples/image_processing/source/TePDIWavelets/TePDIWavelets.pro
old mode 100755
new mode 100644
index 7fd7ead..47dce0e
--- a/examples/image_processing/source/TePDIWavelets/TePDIWavelets.pro
+++ b/examples/image_processing/source/TePDIWavelets/TePDIWavelets.pro
@@ -1,7 +1,7 @@
-include( ../base/base.pro )
-
-SOURCES += \
-  TePDIWavelets_test.cpp
-
-QMAKE_CLEAN += \
+include( ../base/base.pro )
+
+SOURCES += \
+  TePDIWavelets_test.cpp
+
+QMAKE_CLEAN += \
   ../../bin/Wavelets*.tif
\ No newline at end of file
diff --git a/examples/image_processing/source/TePDIWavelets/TePDIWavelets_test.cpp b/examples/image_processing/source/TePDIWavelets/TePDIWavelets_test.cpp
old mode 100755
new mode 100644
index f604e31..bc2ccb7
--- a/examples/image_processing/source/TePDIWavelets/TePDIWavelets_test.cpp
+++ b/examples/image_processing/source/TePDIWavelets/TePDIWavelets_test.cpp
@@ -1,265 +1,378 @@
-#define TEAGN_ENABLE_STDOUT_LOG
-
-#include <TePDIExamplesBase.hpp>
-
-#include <TePDIMallatWavelets.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-
-#include <TeInitRasterDecoders.h>
-#include <TeProgress.h>
-#include <TeStdIOProgress.h>
-
-
-void Mallat_low_low_swap_test()
-{
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster, 1, 1, 1, false,
-    TeDOUBLE, 0 ), "RAM Raster Alloc error" );    
-    
-  TePDITypes::TePDIRasterPtrType lowlow;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( lowlow, 1, 1, 1, false,
-    TeDOUBLE, 0 ), "Unable to create temporary low-low raster" );
-    
- /* Building filters  - Reference coef 07 */
-  
-  std::vector< double > a_filter_l;
-  a_filter_l.push_back( -0.05 );
-  a_filter_l.push_back( 0.25 );
-  a_filter_l.push_back( 0.6 );
-  a_filter_l.push_back( 0.25 );
-  a_filter_l.push_back( -0.05 );
-  
-  std::vector< double > a_filter_h;
-  a_filter_h.push_back( 0.0107143 );
-  a_filter_h.push_back( -0.0535714 );
-  a_filter_h.push_back( -0.2607143 );
-  a_filter_h.push_back( 0.6071429 );
-  a_filter_h.push_back( -0.2607143 );
-  a_filter_h.push_back( -0.0535714 );
-  a_filter_h.push_back( 0.0107143 );
-  
-  std::vector< double > s_filter_l;
-  s_filter_l.push_back( -0.0107143 );
-  s_filter_l.push_back( -0.0535714 );
-  s_filter_l.push_back( 0.2607143 );
-  s_filter_l.push_back( 0.6071429 );
-  s_filter_l.push_back( 0.2607143 );
-  s_filter_l.push_back( -0.0535714 );
-  s_filter_l.push_back( -0.0107143 );
-  
-  std::vector< double > s_filter_h;
-  s_filter_h.push_back( -0.05 );
-  s_filter_h.push_back( -0.25 );
-  s_filter_h.push_back( 0.6 );
-  s_filter_h.push_back( -0.25 );
-  s_filter_h.push_back( -0.05 );  
-  
-  /* Building parameters for the two filters */  
-  
-  TePDIParameters params1;
-  params1.SetParameter( "wavelets_type", std::string( "mallat" ) );
-  params1.SetParameter( "filter_task", std::string( "SBExtract" ) );
-  params1.SetParameter( "input_image", inRaster );
-  params1.SetParameter( "band", (int)0 );
-  params1.SetParameter( "a_filter_l", a_filter_l );
-  params1.SetParameter( "a_filter_h", a_filter_h );
-  params1.SetParameter( "s_filter_l", s_filter_l );
-  params1.SetParameter( "s_filter_h", s_filter_h );
-  params1.SetParameter( "filters_scale", (double)0.71 );         
-  params1.SetParameter( "levels", (int)3 );  
-  params1.SetParameter( "sub_band", lowlow );  
-  params1.SetParameter( "sub_band_index", (int)0 );  
-  
-  TePDIParameters params2;
-  params2.SetParameter( "wavelets_type", std::string( "mallat" ) );
-  params2.SetParameter( "filter_task", std::string( "SBSwap" ) );
-  params2.SetParameter( "input_image", inRaster );
-  params2.SetParameter( "band", (int)0 );
-  params2.SetParameter( "output_image", outRaster );
-  params2.SetParameter( "a_filter_l", a_filter_l );
-  params2.SetParameter( "a_filter_h", a_filter_h );
-  params2.SetParameter( "s_filter_l", s_filter_l );
-  params2.SetParameter( "s_filter_h", s_filter_h );    
-  params2.SetParameter( "filters_scale", (double)0.71 );         
-  params2.SetParameter( "levels", (int)3 );  
-  params2.SetParameter( "sub_band", lowlow ); 
-  params2.SetParameter( "sub_band_index", (int)0 );   
-  
-  /* starting filters */
-  
-  TePDIMallatWavelets filter1;  
-  TEAGN_TRUE_OR_THROW( filter1.Reset( params1 ),
-    "Invalid Parameters1" );
-  TEAGN_TRUE_OR_THROW( filter1.Apply(), "Filter1 apply error" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( lowlow,
-    TEPDIEXAMPLESBINPATH "Wavelets_Mallat_llswap_test_lowlow.tif" ), "Low-low GeoTIF generation error" );  
-    
-  TePDIMallatWavelets filter2;  
-  TEAGN_TRUE_OR_THROW( filter2.Reset( params2 ),
-    "Invalid Parameters2" );  
-  TEAGN_TRUE_OR_THROW( filter2.Apply(), "Filter2 apply error" );
-  
-  TEAGN_TRUE_OR_THROW( ( ( outRaster->params().nlines_ ==
-    inRaster->params().nlines_ ) && ( outRaster->params().ncols_ ==
-    inRaster->params().ncols_ ) ), "Invalid output raster dimensions" );  
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Wavelets_Mallat_llswap_test_recomposed.tif" ), 
-    "Recomposition GeoTIF generation error" );   
-    
-}
-
-
-void Mallat_GetPyramid_and_RecomposePyramid_test()
-{
-  /* Building rasters */
-
-  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
-    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
-  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster, 1, 1, 1, false,
-    TeDOUBLE, 0 ), "RAM Raster Alloc error" );    
-    
- /* Building filters  - Reference coef 07 */
-  
-  std::vector< double > a_filter_l;
-  a_filter_l.push_back( -0.05 );
-  a_filter_l.push_back( 0.25 );
-  a_filter_l.push_back( 0.6 );
-  a_filter_l.push_back( 0.25 );
-  a_filter_l.push_back( -0.05 );
-  
-  std::vector< double > a_filter_h;
-  a_filter_h.push_back( 0.0107143 );
-  a_filter_h.push_back( -0.0535714 );
-  a_filter_h.push_back( -0.2607143 );
-  a_filter_h.push_back( 0.6071429 );
-  a_filter_h.push_back( -0.2607143 );
-  a_filter_h.push_back( -0.0535714 );
-  a_filter_h.push_back( 0.0107143 );
-  
-  std::vector< double > s_filter_l;
-  s_filter_l.push_back( -0.0107143 );
-  s_filter_l.push_back( -0.0535714 );
-  s_filter_l.push_back( 0.2607143 );
-  s_filter_l.push_back( 0.6071429 );
-  s_filter_l.push_back( 0.2607143 );
-  s_filter_l.push_back( -0.0535714 );
-  s_filter_l.push_back( -0.0107143 );
-  
-  std::vector< double > s_filter_h;
-  s_filter_h.push_back( -0.05 );
-  s_filter_h.push_back( -0.25 );
-  s_filter_h.push_back( 0.6 );
-  s_filter_h.push_back( -0.25 );
-  s_filter_h.push_back( -0.05 );  
-  
-  /* Applying filter 1 - Pyramid Generation */
-  
-  TePDITypes::TePDIRasterVectorPtrType pyramid( 
-    new TePDITypes::TePDIRasterVectorType );
-  
-  TePDIParameters params1;
-  params1.SetParameter( "wavelets_type", std::string( "mallat" ) );
-  params1.SetParameter( "filter_task", std::string( "GetPyramid" ) );
-  params1.SetParameter( "input_image", inRaster );
-  params1.SetParameter( "band", (int)0 );
-  params1.SetParameter( "a_filter_l", a_filter_l );
-  params1.SetParameter( "a_filter_h", a_filter_h );
-  params1.SetParameter( "s_filter_l", s_filter_l );
-  params1.SetParameter( "s_filter_h", s_filter_h );
-  params1.SetParameter( "filters_scale", (double)0.71 );         
-  params1.SetParameter( "levels", (int)3 );  
-  params1.SetParameter( "pyramid", pyramid );  
-  
-  TePDIMallatWavelets filter1;  
-  
-  TEAGN_TRUE_OR_THROW( filter1.Reset( params1 ),
-    "Invalid Parameters1" );   
-  TEAGN_TRUE_OR_THROW( filter1.Apply(), "Filter1 apply error" );
-  
-  /* Checking the generated pyramid */
-  
-  TEAGN_TRUE_OR_THROW( pyramid.isActive(), "Inactive generated pyramid" );
-  TEAGN_TRUE_OR_THROW( ( pyramid->size() == 12 ), "Invalid pyramid size" );
-  
-  for( unsigned int py_index = 0 ; py_index < pyramid->size() ; ++py_index ) {
-    TEAGN_TRUE_OR_THROW( (*pyramid)[ py_index ].isActive(),
-      "Inactive pyramid raster found at " + Te2String( py_index ) );
-  
-    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( 
-      (*pyramid)[ py_index ],
-      TEPDIEXAMPLESBINPATH "Wavelets_Mallat_OutPyramid_index" + Te2String( py_index ) + ".tif" ), 
-      "GeoTIF generation error" );      
-  }
-  
-  /* Applying the second filter - Pyramid Recomposition */
-  
-  TePDIParameters params2;
-  params2.SetParameter( "wavelets_type", std::string( "mallat" ) );
-  params2.SetParameter( "filter_task", std::string( "RecomposePyramid" ) );
-  params2.SetParameter( "input_image", inRaster );
-  params2.SetParameter( "band", (int)0 );
-  params2.SetParameter( "output_image", outRaster );
-  params2.SetParameter( "a_filter_l", a_filter_l );
-  params2.SetParameter( "a_filter_h", a_filter_h );
-  params2.SetParameter( "s_filter_l", s_filter_l );
-  params2.SetParameter( "s_filter_h", s_filter_h );    
-  params2.SetParameter( "filters_scale", (double)0.71 );
-  params2.SetParameter( "pyramid", pyramid );
-  
-  TePDIMallatWavelets filter2;  
-  TEAGN_TRUE_OR_THROW( filter2.Reset( params2 ),
-    "Invalid Parameters2" );  
-  TEAGN_TRUE_OR_THROW( filter2.Apply(), "Filter2 apply error" );
-  
-  TEAGN_TRUE_OR_THROW( ( ( outRaster->params().nlines_ ==
-    inRaster->params().nlines_ ) && ( outRaster->params().ncols_ ==
-    inRaster->params().ncols_ ) ), "Invalid output raster dimensions" );
-  
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
-    TEPDIEXAMPLESBINPATH "Wavelets_Mallat_GetPyramid_and_RecomposePyramid_test.tif" ), 
-    "GeoTIF generation error" );     
-}
-
-
-void TePDIWaveletAtrous_test()
-{
-
-
-};
-
-
-int main()
-{
-  TEAGN_LOGMSG( "Test started." );
-
-  try{
-    TeInitRasterDecoders();
-    
-    TeStdIOProgress pi;
-    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
-
-    Mallat_low_low_swap_test();
-    Mallat_GetPyramid_and_RecomposePyramid_test();
-    TePDIWaveletAtrous_test();
-  }
-  catch( const TeException& e ){
-    TEAGN_LOGERR( "Test Failed - " + e.message() );
-    return EXIT_FAILURE;
-  }
-
-  TEAGN_LOGMSG( "Test OK." );
-  return EXIT_SUCCESS;
-}
-
+#define TEAGN_ENABLE_STDOUT_LOG
+
+#include <TePDIExamplesBase.hpp>
+
+#include <TePDIMallatWavelets.hpp>
+#include <TePDIWaveletAtrous.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+
+#include <TeInitRasterDecoders.h>
+#include <TeProgress.h>
+#include <TeStdIOProgress.h>
+
+
+void Mallat_low_low_swap_test()
+{
+  /* Building rasters */
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster, 1, 1, 1, false,
+    TeDOUBLE, 0 ), "RAM Raster Alloc error" );    
+    
+  TePDITypes::TePDIRasterPtrType lowlow;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( lowlow, 1, 1, 1, false,
+    TeDOUBLE, 0 ), "Unable to create temporary low-low raster" );
+    
+ /* Building filters  - Reference coef 07 */
+  
+  std::vector< double > a_filter_l;
+  a_filter_l.push_back( -0.05 );
+  a_filter_l.push_back( 0.25 );
+  a_filter_l.push_back( 0.6 );
+  a_filter_l.push_back( 0.25 );
+  a_filter_l.push_back( -0.05 );
+  
+  std::vector< double > a_filter_h;
+  a_filter_h.push_back( 0.0107143 );
+  a_filter_h.push_back( -0.0535714 );
+  a_filter_h.push_back( -0.2607143 );
+  a_filter_h.push_back( 0.6071429 );
+  a_filter_h.push_back( -0.2607143 );
+  a_filter_h.push_back( -0.0535714 );
+  a_filter_h.push_back( 0.0107143 );
+  
+  std::vector< double > s_filter_l;
+  s_filter_l.push_back( -0.0107143 );
+  s_filter_l.push_back( -0.0535714 );
+  s_filter_l.push_back( 0.2607143 );
+  s_filter_l.push_back( 0.6071429 );
+  s_filter_l.push_back( 0.2607143 );
+  s_filter_l.push_back( -0.0535714 );
+  s_filter_l.push_back( -0.0107143 );
+  
+  std::vector< double > s_filter_h;
+  s_filter_h.push_back( -0.05 );
+  s_filter_h.push_back( -0.25 );
+  s_filter_h.push_back( 0.6 );
+  s_filter_h.push_back( -0.25 );
+  s_filter_h.push_back( -0.05 );  
+  
+  /* Building parameters for the two filters */  
+  
+  TePDIParameters params1;
+  params1.SetParameter( "wavelets_type", std::string( "mallat" ) );
+  params1.SetParameter( "filter_task", std::string( "SBExtract" ) );
+  params1.SetParameter( "input_image", inRaster );
+  params1.SetParameter( "band", (int)0 );
+  params1.SetParameter( "a_filter_l", a_filter_l );
+  params1.SetParameter( "a_filter_h", a_filter_h );
+  params1.SetParameter( "s_filter_l", s_filter_l );
+  params1.SetParameter( "s_filter_h", s_filter_h );
+  params1.SetParameter( "filters_scale", (double)0.71 );         
+  params1.SetParameter( "levels", (int)3 );  
+  params1.SetParameter( "sub_band", lowlow );  
+  params1.SetParameter( "sub_band_index", (int)0 );  
+  
+  TePDIParameters params2;
+  params2.SetParameter( "wavelets_type", std::string( "mallat" ) );
+  params2.SetParameter( "filter_task", std::string( "SBSwap" ) );
+  params2.SetParameter( "input_image", inRaster );
+  params2.SetParameter( "band", (int)0 );
+  params2.SetParameter( "output_image", outRaster );
+  params2.SetParameter( "a_filter_l", a_filter_l );
+  params2.SetParameter( "a_filter_h", a_filter_h );
+  params2.SetParameter( "s_filter_l", s_filter_l );
+  params2.SetParameter( "s_filter_h", s_filter_h );    
+  params2.SetParameter( "filters_scale", (double)0.71 );         
+  params2.SetParameter( "levels", (int)3 );  
+  params2.SetParameter( "sub_band", lowlow ); 
+  params2.SetParameter( "sub_band_index", (int)0 );   
+  
+  /* starting filters */
+  
+  TePDIMallatWavelets filter1;  
+  TEAGN_TRUE_OR_THROW( filter1.Reset( params1 ),
+    "Invalid Parameters1" );
+  TEAGN_TRUE_OR_THROW( filter1.Apply(), "Filter1 apply error" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( lowlow,
+    TEPDIEXAMPLESBINPATH "Wavelets_Mallat_llswap_test_lowlow.tif" ), "Low-low GeoTIF generation error" );  
+    
+  TePDIMallatWavelets filter2;  
+  TEAGN_TRUE_OR_THROW( filter2.Reset( params2 ),
+    "Invalid Parameters2" );  
+  TEAGN_TRUE_OR_THROW( filter2.Apply(), "Filter2 apply error" );
+  
+  TEAGN_TRUE_OR_THROW( ( ( outRaster->params().nlines_ ==
+    inRaster->params().nlines_ ) && ( outRaster->params().ncols_ ==
+    inRaster->params().ncols_ ) ), "Invalid output raster dimensions" );  
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Wavelets_Mallat_llswap_test_recomposed.tif" ), 
+    "Recomposition GeoTIF generation error" );   
+    
+}
+
+
+void Mallat_GetPyramid_and_RecomposePyramid_test()
+{
+  /* Building rasters */
+
+  TePDITypes::TePDIRasterPtrType inRaster( new TeRaster(
+    std::string( TEPDIEXAMPLESRESPATH "cbers_b2_crop.tif" ), 'r' ) );
+  TEAGN_TRUE_OR_THROW( inRaster->init(), "Unable to init inRaster" );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outRaster, 1, 1, 1, false,
+    TeDOUBLE, 0 ), "RAM Raster Alloc error" );    
+    
+ /* Building filters  - Reference coef 07 */
+  
+  std::vector< double > a_filter_l;
+  a_filter_l.push_back( -0.05 );
+  a_filter_l.push_back( 0.25 );
+  a_filter_l.push_back( 0.6 );
+  a_filter_l.push_back( 0.25 );
+  a_filter_l.push_back( -0.05 );
+  
+  std::vector< double > a_filter_h;
+  a_filter_h.push_back( 0.0107143 );
+  a_filter_h.push_back( -0.0535714 );
+  a_filter_h.push_back( -0.2607143 );
+  a_filter_h.push_back( 0.6071429 );
+  a_filter_h.push_back( -0.2607143 );
+  a_filter_h.push_back( -0.0535714 );
+  a_filter_h.push_back( 0.0107143 );
+  
+  std::vector< double > s_filter_l;
+  s_filter_l.push_back( -0.0107143 );
+  s_filter_l.push_back( -0.0535714 );
+  s_filter_l.push_back( 0.2607143 );
+  s_filter_l.push_back( 0.6071429 );
+  s_filter_l.push_back( 0.2607143 );
+  s_filter_l.push_back( -0.0535714 );
+  s_filter_l.push_back( -0.0107143 );
+  
+  std::vector< double > s_filter_h;
+  s_filter_h.push_back( -0.05 );
+  s_filter_h.push_back( -0.25 );
+  s_filter_h.push_back( 0.6 );
+  s_filter_h.push_back( -0.25 );
+  s_filter_h.push_back( -0.05 );  
+  
+  /* Applying filter 1 - Pyramid Generation */
+  
+  TePDITypes::TePDIRasterVectorPtrType pyramid( 
+    new TePDITypes::TePDIRasterVectorType );
+  
+  TePDIParameters params1;
+  params1.SetParameter( "wavelets_type", std::string( "mallat" ) );
+  params1.SetParameter( "filter_task", std::string( "GetPyramid" ) );
+  params1.SetParameter( "input_image", inRaster );
+  params1.SetParameter( "band", (int)0 );
+  params1.SetParameter( "a_filter_l", a_filter_l );
+  params1.SetParameter( "a_filter_h", a_filter_h );
+  params1.SetParameter( "s_filter_l", s_filter_l );
+  params1.SetParameter( "s_filter_h", s_filter_h );
+  params1.SetParameter( "filters_scale", (double)0.71 );         
+  params1.SetParameter( "levels", (int)3 );  
+  params1.SetParameter( "pyramid", pyramid );  
+  
+  TePDIMallatWavelets filter1;  
+  
+  TEAGN_TRUE_OR_THROW( filter1.Reset( params1 ),
+    "Invalid Parameters1" );   
+  TEAGN_TRUE_OR_THROW( filter1.Apply(), "Filter1 apply error" );
+  
+  /* Checking the generated pyramid */
+  
+  TEAGN_TRUE_OR_THROW( pyramid.isActive(), "Inactive generated pyramid" );
+  TEAGN_TRUE_OR_THROW( ( pyramid->size() == 12 ), "Invalid pyramid size" );
+  
+  for( unsigned int py_index = 0 ; py_index < pyramid->size() ; ++py_index ) {
+    TEAGN_TRUE_OR_THROW( (*pyramid)[ py_index ].isActive(),
+      "Inactive pyramid raster found at " + Te2String( py_index ) );
+  
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( 
+      (*pyramid)[ py_index ],
+      TEPDIEXAMPLESBINPATH "Wavelets_Mallat_OutPyramid_index" + Te2String( py_index ) + ".tif" ), 
+      "GeoTIF generation error" );      
+  }
+  
+  /* Applying the second filter - Pyramid Recomposition */
+  
+  TePDIParameters params2;
+  params2.SetParameter( "wavelets_type", std::string( "mallat" ) );
+  params2.SetParameter( "filter_task", std::string( "RecomposePyramid" ) );
+  params2.SetParameter( "input_image", inRaster );
+  params2.SetParameter( "band", (int)0 );
+  params2.SetParameter( "output_image", outRaster );
+  params2.SetParameter( "a_filter_l", a_filter_l );
+  params2.SetParameter( "a_filter_h", a_filter_h );
+  params2.SetParameter( "s_filter_l", s_filter_l );
+  params2.SetParameter( "s_filter_h", s_filter_h );    
+  params2.SetParameter( "filters_scale", (double)0.71 );
+  params2.SetParameter( "pyramid", pyramid );
+  
+  TePDIMallatWavelets filter2;  
+  TEAGN_TRUE_OR_THROW( filter2.Reset( params2 ),
+    "Invalid Parameters2" );  
+  TEAGN_TRUE_OR_THROW( filter2.Apply(), "Filter2 apply error" );
+  
+  TEAGN_TRUE_OR_THROW( ( ( outRaster->params().nlines_ ==
+    inRaster->params().nlines_ ) && ( outRaster->params().ncols_ ==
+    inRaster->params().ncols_ ) ), "Invalid output raster dimensions" );
+  
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( outRaster,
+    TEPDIEXAMPLESBINPATH "Wavelets_Mallat_GetPyramid_and_RecomposePyramid_test.tif" ), 
+    "GeoTIF generation error" );     
+}
+
+
+void TePDIWaveletAtrous_test()
+{
+  TePDITypes::TePDIRasterVectorType output_wavelets;
+  
+  // Testing decomposition
+  
+  {
+    TePDIParameters waveletAtrousParams;
+    
+    waveletAtrousParams.SetParameter("direction", 
+      (int)TePDIWaveletAtrous::DECOMPOSE);
+      
+    TePDITypes::TePDIRasterPtrType input_raster( new TeRaster(
+      std::string( TEPDIEXAMPLESRESPATH "cbers2b_rgb342_crop.tif" ), 'r' ) );
+    TEAGN_TRUE_OR_THROW( input_raster->init(), "Unable to init inRaster" );    
+    waveletAtrousParams.SetParameter("input_raster", input_raster);
+    
+    waveletAtrousParams.SetParameter("band", (int)0);
+    
+    waveletAtrousParams.SetParameter("levels", (int)2);
+    
+    waveletAtrousParams.SetParameter("filter_type", 
+      TePDIWaveletAtrous::TriangleFilter );
+      
+    TeRasterParams outputWaveletParams = input_raster->params();
+    outputWaveletParams.nBands( 2 ); // Desired Wavelet planes number
+    outputWaveletParams.setDataType( TeFLOAT, -1 );
+    TePDITypes::TePDIRasterPtrType output_wavelet0;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputWaveletParams,
+      output_wavelet0 ), "RAM Raster Alloc error" );
+    TePDITypes::TePDIRasterPtrType output_wavelet1;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputWaveletParams,
+      output_wavelet1 ), "RAM Raster Alloc error" );
+    TePDITypes::TePDIRasterPtrType output_wavelet2;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( outputWaveletParams,
+      output_wavelet2 ), "RAM Raster Alloc error" );          
+    output_wavelets.push_back( output_wavelet0 );
+    output_wavelets.push_back( output_wavelet1 );  
+    output_wavelets.push_back( output_wavelet2 );
+    waveletAtrousParams.SetParameter("output_wavelets", 
+      output_wavelets);
+    
+    TePDIWaveletAtrous wa;
+    TEAGN_TRUE_OR_THROW(wa.Apply( waveletAtrousParams ), "Apply error");
+    
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( 
+      output_wavelet0,
+      TEPDIEXAMPLESBINPATH "TePDIWaveletAtrous_test_output_wavelet0.tif" ), 
+      "GeoTIF generation error" );     
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( 
+      output_wavelet1,
+      TEPDIEXAMPLESBINPATH "TePDIWaveletAtrous_test_output_wavelet1.tif" ), 
+      "GeoTIF generation error" );     
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( 
+      output_wavelet2,
+      TEPDIEXAMPLESBINPATH "TePDIWaveletAtrous_test_output_wavelet2.tif" ), 
+      "GeoTIF generation error" );                 
+  }
+  
+  // Testing recomposition
+  
+  {
+    TePDIParameters waveletAtrousParams;
+    
+    waveletAtrousParams.SetParameter("direction", 
+      (int)TePDIWaveletAtrous::RECOMPOSE);
+      
+    std::vector<TePDITypes::TePDIRasterVectorType> input_rasters_wavelets;
+    input_rasters_wavelets.push_back( output_wavelets );
+    waveletAtrousParams.SetParameter("input_rasters_wavelets", 
+      input_rasters_wavelets );
+      
+    waveletAtrousParams.SetParameter("rasters_levels", (int)2);  
+      
+    // We are using output_wavelets as reference_raster_wavelets
+    // just for test.
+    waveletAtrousParams.SetParameter("reference_raster_wavelets", 
+      output_wavelets );
+      
+    waveletAtrousParams.SetParameter("reference_levels", (int)2);  
+      
+    TeRasterParams output_raster_params = output_wavelets[ 0 ]->params();
+    output_raster_params.nBands( 1 );
+    output_raster_params.setDataType( TeUNSIGNEDCHAR, -1 );
+    TePDITypes::TePDIRasterPtrType output_raster0;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster_params,
+      output_raster0 ), "RAM Raster Alloc error" );
+    TePDITypes::TePDIRasterPtrType output_raster1;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster_params,
+      output_raster1 ), "RAM Raster Alloc error" );   
+    TePDITypes::TePDIRasterPtrType output_raster2;
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( output_raster_params,
+      output_raster2 ), "RAM Raster Alloc error" );        
+    TePDITypes::TePDIRasterVectorType output_rasters;
+    output_rasters.push_back( output_raster0 );
+    output_rasters.push_back( output_raster1 );  
+    output_rasters.push_back( output_raster2 );
+    waveletAtrousParams.SetParameter( "output_rasters", 
+      output_rasters );
+    
+    TePDIWaveletAtrous wa;
+    TEAGN_TRUE_OR_THROW(wa.Apply( waveletAtrousParams ), "Apply error");
+    
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( 
+      output_raster0,
+      TEPDIEXAMPLESBINPATH "TePDIWaveletAtrous_test_output_raster0.tif" ), 
+      "GeoTIF generation error" );   
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( 
+      output_raster1,
+      TEPDIEXAMPLESBINPATH "TePDIWaveletAtrous_test_output_raster1.tif" ), 
+      "GeoTIF generation error" );    
+    TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( 
+      output_raster2,
+      TEPDIEXAMPLESBINPATH "TePDIWaveletAtrous_test_output_raster2.tif" ), 
+      "GeoTIF generation error" );                  
+  }  
+};
+
+
+int main()
+{
+  TEAGN_LOGMSG( "Test started." );
+
+  try{
+    TeInitRasterDecoders();
+    
+    TeStdIOProgress pi;
+    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );     
+
+    TePDIWaveletAtrous_test();
+    Mallat_low_low_swap_test();
+    Mallat_GetPyramid_and_RecomposePyramid_test();
+  }
+  catch( const TeException& e ){
+    TEAGN_LOGERR( "Test Failed - " + e.message() );
+    return EXIT_FAILURE;
+  }
+
+  TEAGN_LOGMSG( "Test OK." );
+  return EXIT_SUCCESS;
+}
+
diff --git a/examples/image_processing/source/TePDIWavelets/TePDIWavelets_test.vcproj b/examples/image_processing/source/TePDIWavelets/TePDIWavelets_test.vcproj
old mode 100755
new mode 100644
index 1ae8224..89bd93b
--- a/examples/image_processing/source/TePDIWavelets/TePDIWavelets_test.vcproj
+++ b/examples/image_processing/source/TePDIWavelets/TePDIWavelets_test.vcproj
@@ -1,146 +1,146 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="TePDIWavelets_test"
-	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
-	RootNamespace="TePDIWavelets_test"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="0">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="FALSE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
-				OutputFile="$(OutDir)/TePDIWavelets_test.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreAllDefaultLibraries="FALSE"
-				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"
-				TargetMachine="0"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\bin"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
-				OutputFile="$(OutDir)/TePDIWavelets_test.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\TePDIWavelets_test.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="TePDIWavelets_test"
+	ProjectGUID="{D881CFAF-6E61-4842-8ACF-A33287EA5223}"
+	RootNamespace="TePDIWavelets_test"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../base;../../../../src/terralib/image_processing;../../../../src/terralib/kernel;../../../../src/tiff"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PDIAGN_ENABLE_STDOUT_LOG"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Debug/terralibpdi/terralibpdi.lib ../../../../Debug/terralib/terralib.lib ../../../../Debug/tiff/tiff.lib ../../../../dependencies/win32/zlib/lib/zlibstat.lib ../../../../Debug/libjpeg/libjpeg.lib ../../../../Debug/shapelib/shapelib.lib user32.lib $(NOINHERIT)"
+				OutputFile="$(OutDir)/TePDIWavelets_test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="msvcrt.lib,libcmt.lib;libc.lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"
+				TargetMachine="0"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\bin"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../../../src/terralib/image_processing;../base;../../../../src/terralib/kernel;../../../../src/shapelib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../../../Release/terralibpdi/terralibpdi.lib ../../../../Release/terralib/terralib.lib ../../../../Release/tiff/tiff.lib ../../../../terralibw/zlib/zlibstat.lib ../../../../Release/libjpeg/libjpeg.lib ../../../../Release/shapelib/shapelib.lib"
+				OutputFile="$(OutDir)/TePDIWavelets_test.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\TePDIWavelets_test.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/image_processing/source/base/.cvsignore b/examples/image_processing/source/base/.cvsignore
new file mode 100644
index 0000000..85afbce
--- /dev/null
+++ b/examples/image_processing/source/base/.cvsignore
@@ -0,0 +1,11 @@
+Makefile
+*.o
+*.obj
+*.dsp
+*.dsw
+*.opt
+*.plg
+*.ncb
+*.pdb
+Debug
+Release
diff --git a/examples/image_processing/source/base/TePDIExamplesBase.hpp b/examples/image_processing/source/base/TePDIExamplesBase.hpp
index 253289f..5e3c04d 100644
--- a/examples/image_processing/source/base/TePDIExamplesBase.hpp
+++ b/examples/image_processing/source/base/TePDIExamplesBase.hpp
@@ -1,16 +1,16 @@
-#ifndef TEPDIEXAMPLESBASE_HPP
-  #define TEPDIEXAMPLESBASE_HPP
-
-  #include "TeDefines.h"
-
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    #define TEPDIEXAMPLESRESPATH "..\\..\\resources\\"
-    #define TEPDIEXAMPLESBINPATH "..\\..\\bin\\"
-  #elif TePLATFORM == TePLATFORMCODE_LINUX
-    #define TEPDIEXAMPLESRESPATH "../resources/"
-    #define TEPDIEXAMPLESBINPATH "../bin/"
-  #else
-    #error "ERROR: Unsupported platform"
-  #endif
-
-#endif
+#ifndef TEPDIEXAMPLESBASE_HPP
+  #define TEPDIEXAMPLESBASE_HPP
+
+  #include "TeDefines.h"
+
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    #define TEPDIEXAMPLESRESPATH "..\\..\\resources\\"
+    #define TEPDIEXAMPLESBINPATH "..\\..\\bin\\"
+  #elif TePLATFORM == TePLATFORMCODE_LINUX
+    #define TEPDIEXAMPLESRESPATH "../resources/"
+    #define TEPDIEXAMPLESBINPATH "../bin/"
+  #else
+    #error "ERROR: Unsupported platform"
+  #endif
+
+#endif
diff --git a/examples/image_processing/source/base/base.pro b/examples/image_processing/source/base/base.pro
old mode 100755
new mode 100644
index 46af4c0..50fffe1
--- a/examples/image_processing/source/base/base.pro
+++ b/examples/image_processing/source/base/base.pro
@@ -1,42 +1,40 @@
-
-TERRALIB_PATH = ../../../../
-
-win32 {
-  error( "To compile LibPDI tests you must use the Visual Studio projects of each test" )
-}
-
-CONFIG = qt warn_on debug rtti exceptions
-
-TEMPLATE = app
-
-LANGUAGE = C++
-
-DESTDIR = ../../bin
-
-DEFINES += PDIAGN_DEBUG_MODE
-
-debug {
-  DEFINES += PDIAGN_ENABLE_STDOUT_LOG
-}
-
-INCLUDEPATH = \
-  ../base \
-  $$TERRALIB_PATH/src/tiff \
-  $$TERRALIB_PATH/src/shapelib \
-  $$TERRALIB_PATH/src/terralib/kernel \
-  $$TERRALIB_PATH/src/terralib/functions \
-  $$TERRALIB_PATH/src/terralib/image_processing \
-  $$TERRALIB_PATH/src/terralib/image_processing/data_structs \
-  $$INCLUDEPATH
-
-# Library depencencies
-
-LIBS = -L$$TERRALIB_PATH/terralibx/Debug \
-  -L$$TERRALIB_PATH/terralibx/Release
-LIBS += -ljpeg
-LIBS += -lz
-LIBS += -lterralibtiff 
-LIBS += -lshapelib
-LIBS += -lterralib
-LIBS += -lterralibpdi
-
+
+TERRALIB_PATH = ../../../../
+
+win32 {
+  error( "To compile LibPDI tests you must use the Visual Studio projects of each test" )
+}
+
+CONFIG = qt warn_on debug rtti exceptions
+
+TEMPLATE = app
+
+LANGUAGE = C++
+
+DESTDIR = ../../bin
+
+DEFINES += PDIAGN_DEBUG_MODE
+
+debug {
+  DEFINES += PDIAGN_ENABLE_STDOUT_LOG
+}
+
+INCLUDEPATH = \
+  ../base \
+  $$TERRALIB_PATH/src/tiff \
+  $$TERRALIB_PATH/src/shapelib \
+  $$TERRALIB_PATH/src/terralib/kernel \
+  $$TERRALIB_PATH/src/terralib/functions \
+  $$TERRALIB_PATH/src/terralib/image_processing \
+  $$TERRALIB_PATH/src/terralib/image_processing/data_structs \
+  $$INCLUDEPATH
+
+# Library depencencies
+
+LIBS = -L$$TERRALIB_PATH/Debug/linux-g++ -L$$TERRALIB_PATH/Release/linux-g++
+LIBS += -lz
+LIBS += -lterralibtiff 
+LIBS += -lshapelib
+LIBS += -lterralib
+LIBS += -lterralibpdi
+
diff --git a/examples/image_processing/source/source.pro b/examples/image_processing/source/source.pro
old mode 100755
new mode 100644
index 2958c28..22ef96d
--- a/examples/image_processing/source/source.pro
+++ b/examples/image_processing/source/source.pro
@@ -1,41 +1,42 @@
-
-TEMPLATE = subdirs
-
-SUBDIRS = \
-          TePDIArithmetic \
-          TePDIBDFilter \
-          TePDIBlending \
-          TePDIClassification \
-          TePDIColorTransform \
-          TePDIContrast \
-          TePDICorrelationMatching \
-          TePDIDecorrelationEnhancement \
-          TePDIFilterMask \
-          TePDIFusion \
-          TePDIHaralick \
-          TePDIHistogram \
-          TePDIInterpolator \
-          TePDIJointHistogram \
-          TePDILinearFilter \
-          TePDIMathFunctions \
-          TePDIMatrix \
-          TePDIMatrixFunctions \
-          TePDIMIMatching \
-          TePDIMixModel \
-          TePDIMMIOMatching \
-          TePDIMorfFilter \
-          TePDIMosaic \
-          TePDIOFMatching \
-          TePDIParameters \
-          TePDIPIManager \
-          TePDIPrincipalComponents \
-          TePDIRadarFilters \
-          TePDIRaster2Vector \ 
-          TePDIRegister \
-          TePDIRgbPalette \
-          TePDISegmentation \
-          TePDISensorSimulator \
-          TePDIStatistic \
-          TePDIUtils \
-          TePDIWavelets
-
+
+TEMPLATE = subdirs
+
+SUBDIRS = \
+          TePDIArithmetic \
+          TePDIBDFilter \
+          TePDIClassification \
+          TePDIColorTransform \
+          TePDIContrast \
+          TePDICorrelationMatching \
+          TePDIDecorrelationEnhancement \
+          TePDIFilterMask \
+          TePDIFusion \
+          TePDIHaralick \
+          TePDIHistogram \
+          TePDIInterpolator \
+          TePDIJointHistogram \
+          TePDILinearFilter \
+          TePDIMathFunctions \
+          TePDIMatrix \
+          TePDIMatrixFunctions \
+          TePDIMIMatching \
+          TePDIMixModel \
+          TePDIMMIOMatching \
+          TePDIMorfFilter \
+          TePDIMosaic \
+          TePDIOFMatching \
+          TePDIParameters \
+          TePDIPIManager \
+          TePDIPrincipalComponents \
+          TePDIRadarFilters \
+          TePDIRaster2Vector \ 
+          TePDIRegister \
+          TePDIRgbPalette \
+          TePDISegmentation \
+          TePDISensorSimulator \
+          TePDIStatistic \
+          TePDIUtils \
+          TePDIWavelets \
+          TePDIParallelSegmenter \
+          TePDIBlender
+
diff --git a/examples/importCSV/.cdtproject b/examples/importCSV/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/importCSV/.cdtproject
+++ b/examples/importCSV/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/importCSV/.project b/examples/importCSV/.project
old mode 100755
new mode 100644
index c3f2cfa..d4c6408
--- a/examples/importCSV/.project
+++ b/examples/importCSV/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>importCSV</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>importCSV</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/importCSV/Makefile b/examples/importCSV/Makefile
old mode 100755
new mode 100644
index 9a1bbbe..6341aaf
--- a/examples/importCSV/Makefile
+++ b/examples/importCSV/Makefile
@@ -1,31 +1,31 @@
-all: importCSV
-
-debug: importCSV_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-importCSV: terralib
-	qmake -o makeImportCSV importCSV.pro; make -f makeImportCSV
-
-importCSV_dbg: terralib_dbg
-	qmake -o makeImportCSV.debug importCSV.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeImportCSV.debug
-
-
-clean:
-	if \
-		test -f makeImportCSV; \
-	then \
-		make -f makeImportCSV distclean; rm -f makeImportCSV; \
-	fi
-
-clean_debug:
-	if \
-		test -f makeImportCSV.debug; \
-	then \
-		make -f makeImportCSV.debug distclean; rm -f makeImportCSV.debug; \
+all: importCSV
+
+debug: importCSV_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+importCSV: terralib
+	qmake -o makeImportCSV importCSV.pro; make -f makeImportCSV
+
+importCSV_dbg: terralib_dbg
+	qmake -o makeImportCSV.debug importCSV.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeImportCSV.debug
+
+
+clean:
+	if \
+		test -f makeImportCSV; \
+	then \
+		make -f makeImportCSV distclean; rm -f makeImportCSV; \
+	fi
+
+clean_debug:
+	if \
+		test -f makeImportCSV.debug; \
+	then \
+		make -f makeImportCSV.debug distclean; rm -f makeImportCSV.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/importCSV/importCSV.cpp b/examples/importCSV/importCSV.cpp
old mode 100755
new mode 100644
index 36f87fa..104c2ff
--- a/examples/importCSV/importCSV.cpp
+++ b/examples/importCSV/importCSV.cpp
@@ -1,202 +1,202 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows how to import a MID/MIF data file into a new layer
-	and a CSV file as a second attribute table of the layer
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeAsciiFile.h>
-#include <TeDriverMIDMIF.h>
-#include <TeMySQL.h>
-
-int main()
-{
-     // Database server parameters
-     string host = "localhost";
-     string dbname = "DB320RC1";
-     string user = "root";
-     string password = "vinhas";
-
-     // Connect to the database
-     TeDatabase* db = new TeMySQL();
-     if (!db->connect(host, user, password, dbname))
-     {
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-     }
-
-	string filename = "../data/BairrosRecife.mif";
-	// Check whether there is a layer with the name BairrosRecife in the database
-	TeLayer *layer = 0;
-	if (db->layerExist("BairrosRecife"))
-	{
-		cout << "The MID/MIF file was not imported because it was previously\n";
-		cout << "imported into the database!\n\n";
-		if (db->loadLayerSet() == true)
-		{
-			// Get the layer named "BairrosRecife" from the cache
-			TeLayerMap& layerMap = db->layerMap();
-			map<int, TeLayer*>::iterator it;
-			for (it = layerMap.begin(); it != layerMap.end(); ++it)
-			{
-				layer = it->second;
-				if (layer->name() == "BairrosRecife")
-					break;
-			}
-		}
-	}
-	else
-	{
-		// Import the MID/MIF file
-		layer = new TeLayer("BairrosRecife", db, 0);
-
-		// Select the filed ID_ to be the identifier of each neighbourhood
-		if (TeImportMIF(layer, filename,"BairrosRecife", "ID_")) 
-			cout << "MID/MIF file imported to the TerraLib database successfully!\n" << endl;
-		else
-		{
-			cout << "Fail to import the MID/MIF file!\n";
-			db->close();
-			delete db;
-			cout << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-	}
-
-
-	// Import the csv file as a second attribute table of the layer
-	filename = "../data/BairrosRecife2.csv";
-	if (db->tableExist("BairrosRecife2"))
-	{
-		cout << "The csv file was not imported because it was previously\n";
-		cout << "imported as an attribute table into the database!\n\n";
-	}
-	else
-	{
-		cout << "Importing a second attribute table from a CSV file...\n";
-	
-		// Creates a definition of the columns contained in the CSV file
-		TeAttributeList attList;
-		TeAttribute column1;
-		column1.rep_.name_  = "BAIRRO_ID";
-		column1.rep_.type_ = TeSTRING;
-		column1.rep_.isPrimaryKey_ = true;
-		column1.rep_.numChar_ = 32;
-		attList.push_back(column1);
-	
-		TeAttribute column2;
-		column2.rep_.name_  = "ORDEM";
-		column2.rep_.type_ = TeINT;
-		attList.push_back(column2);
-	
-	
-		TeAttribute column3;
-		column3.rep_.name_  = "NOME";
-		column3.rep_.type_ = TeSTRING;
-		column3.rep_.numChar_ = 32;
-		attList.push_back(column3);
-	
-		TeAttribute column4;
-		column4.rep_.name_  = "NOME_PADRAO";
-		column4.rep_.type_ = TeSTRING;
-		column4.rep_.numChar_ = 32;
-		attList.push_back(column4);
-	
-		TeTable attTable2("BairrosRecife2",attList, "BAIRRO_ID","BAIRRO_ID", TeAttrStatic);
-		if (!layer->createAttributeTable(attTable2))
-		{
-			cout << "Fail to create the attribute table from the csv file in the TerraLib database!\n\n";
-			db->close();
-			delete db;
-			cout << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-	
-		TeAsciiFile csvFile(filename);
-		while (csvFile.isNotAtEOF())
-		{
-			TeTableRow trow;
-			csvFile.readNStringCSV (trow, 4, ';');
-			if (trow.empty())
-				break;
-	
-			csvFile.findNewLine();
-			attTable2.add(trow);
-		}
-
-		if (attTable2.size() > 0)
-		{
-			if (layer->saveAttributeTable(attTable2) == false)
-			{
-				cout << "Fail to save the attribute table generated\n";
-				cout << "through the csv file in the database!\n\n";
-				cout << "Press Enter\n";
-				db->close();
-				delete db;
-				getchar();
-				return 1;
-			}
-			attTable2.clear();
-		}
-		cout << "Table successfully imported!\n";
-	}
-
-	// Show some information about the layer associated to the MID/MIF file
-	cout << "Layer: " << layer->name() << ", id: " << layer->id() << endl;
-
-	// Geometries information
-	cout << "Projection: " << layer->projection()->name();              
-	cout << "/" << layer->projection()->datum().name();          
-	TeBox bb = layer->box();
-	char message[255];
-	sprintf(message,"[%.15f,%.15f,%.15f,%.15f]\n",bb.x1_, bb.y1_, bb.x2_, bb.y2_);
-	cout << "\nBounding box: " << message;
-	cout << "Number of polygons: " << layer->nGeometries(TePOLYGONS) << endl;
-	cout << "Number of lines: "    << layer->nGeometries(TeLINES) << endl;
-	cout << "Number of points: "   << layer->nGeometries(TePOINTS) << endl;
-
-	// Information of the Tables of Attributes of the Layer
-	TeAttrTableVector tableVec;
-	layer->getAttrTables(tableVec);
-	cout << "Number of Attribute Tables: " << tableVec.size() << endl;
-	
-	for (unsigned int i = 0; i < tableVec.size(); ++i)
-	{
-		cout << "Attribute Table " << "\"" << tableVec[i].name() << "\": ";
-		cout << layer->nObjects(tableVec[i].name()) << " objects" << endl << endl;
-	}
-	
-	db->close();
-	delete db;
-	cout << "Press Enter\n";
-	getchar();
-	return 0;
-}
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows how to import a MID/MIF data file into a new layer
+	and a CSV file as a second attribute table of the layer
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeAsciiFile.h>
+#include <TeDriverMIDMIF.h>
+#include <TeMySQL.h>
+
+int main()
+{
+     // Database server parameters
+     string host = "localhost";
+     string dbname = "DB320RC1";
+     string user = "root";
+     string password = "vinhas";
+
+     // Connect to the database
+     TeDatabase* db = new TeMySQL();
+     if (!db->connect(host, user, password, dbname))
+     {
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+     }
+
+	string filename = "../data/BairrosRecife.mif";
+	// Check whether there is a layer with the name BairrosRecife in the database
+	TeLayer *layer = 0;
+	if (db->layerExist("BairrosRecife"))
+	{
+		cout << "The MID/MIF file was not imported because it was previously\n";
+		cout << "imported into the database!\n\n";
+		if (db->loadLayerSet() == true)
+		{
+			// Get the layer named "BairrosRecife" from the cache
+			TeLayerMap& layerMap = db->layerMap();
+			map<int, TeLayer*>::iterator it;
+			for (it = layerMap.begin(); it != layerMap.end(); ++it)
+			{
+				layer = it->second;
+				if (layer->name() == "BairrosRecife")
+					break;
+			}
+		}
+	}
+	else
+	{
+		// Import the MID/MIF file
+		layer = new TeLayer("BairrosRecife", db, 0);
+
+		// Select the filed ID_ to be the identifier of each neighbourhood
+		if (TeImportMIF(layer, filename,"BairrosRecife", "ID_")) 
+			cout << "MID/MIF file imported to the TerraLib database successfully!\n" << endl;
+		else
+		{
+			cout << "Fail to import the MID/MIF file!\n";
+			db->close();
+			delete db;
+			cout << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+	}
+
+
+	// Import the csv file as a second attribute table of the layer
+	filename = "../data/BairrosRecife2.csv";
+	if (db->tableExist("BairrosRecife2"))
+	{
+		cout << "The csv file was not imported because it was previously\n";
+		cout << "imported as an attribute table into the database!\n\n";
+	}
+	else
+	{
+		cout << "Importing a second attribute table from a CSV file...\n";
+	
+		// Creates a definition of the columns contained in the CSV file
+		TeAttributeList attList;
+		TeAttribute column1;
+		column1.rep_.name_  = "BAIRRO_ID";
+		column1.rep_.type_ = TeSTRING;
+		column1.rep_.isPrimaryKey_ = true;
+		column1.rep_.numChar_ = 32;
+		attList.push_back(column1);
+	
+		TeAttribute column2;
+		column2.rep_.name_  = "ORDEM";
+		column2.rep_.type_ = TeINT;
+		attList.push_back(column2);
+	
+	
+		TeAttribute column3;
+		column3.rep_.name_  = "NOME";
+		column3.rep_.type_ = TeSTRING;
+		column3.rep_.numChar_ = 32;
+		attList.push_back(column3);
+	
+		TeAttribute column4;
+		column4.rep_.name_  = "NOME_PADRAO";
+		column4.rep_.type_ = TeSTRING;
+		column4.rep_.numChar_ = 32;
+		attList.push_back(column4);
+	
+		TeTable attTable2("BairrosRecife2",attList, "BAIRRO_ID","BAIRRO_ID", TeAttrStatic);
+		if (!layer->createAttributeTable(attTable2))
+		{
+			cout << "Fail to create the attribute table from the csv file in the TerraLib database!\n\n";
+			db->close();
+			delete db;
+			cout << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+	
+		TeAsciiFile csvFile(filename);
+		while (csvFile.isNotAtEOF())
+		{
+			TeTableRow trow;
+			csvFile.readNStringCSV (trow, 4, ';');
+			if (trow.empty())
+				break;
+	
+			csvFile.findNewLine();
+			attTable2.add(trow);
+		}
+
+		if (attTable2.size() > 0)
+		{
+			if (layer->saveAttributeTable(attTable2) == false)
+			{
+				cout << "Fail to save the attribute table generated\n";
+				cout << "through the csv file in the database!\n\n";
+				cout << "Press Enter\n";
+				db->close();
+				delete db;
+				getchar();
+				return 1;
+			}
+			attTable2.clear();
+		}
+		cout << "Table successfully imported!\n";
+	}
+
+	// Show some information about the layer associated to the MID/MIF file
+	cout << "Layer: " << layer->name() << ", id: " << layer->id() << endl;
+
+	// Geometries information
+	cout << "Projection: " << layer->projection()->name();              
+	cout << "/" << layer->projection()->datum().name();          
+	TeBox bb = layer->box();
+	char message[255];
+	sprintf(message,"[%.15f,%.15f,%.15f,%.15f]\n",bb.x1_, bb.y1_, bb.x2_, bb.y2_);
+	cout << "\nBounding box: " << message;
+	cout << "Number of polygons: " << layer->nGeometries(TePOLYGONS) << endl;
+	cout << "Number of lines: "    << layer->nGeometries(TeLINES) << endl;
+	cout << "Number of points: "   << layer->nGeometries(TePOINTS) << endl;
+
+	// Information of the Tables of Attributes of the Layer
+	TeAttrTableVector tableVec;
+	layer->getAttrTables(tableVec);
+	cout << "Number of Attribute Tables: " << tableVec.size() << endl;
+	
+	for (unsigned int i = 0; i < tableVec.size(); ++i)
+	{
+		cout << "Attribute Table " << "\"" << tableVec[i].name() << "\": ";
+		cout << layer->nObjects(tableVec[i].name()) << " objects" << endl << endl;
+	}
+	
+	db->close();
+	delete db;
+	cout << "Press Enter\n";
+	getchar();
+	return 0;
+}
+ 
diff --git a/examples/importCSV/importCSV.dsp b/examples/importCSV/importCSV.dsp
old mode 100755
new mode 100644
index 65302f5..5a646f1
--- a/examples/importCSV/importCSV.dsp
+++ b/examples/importCSV/importCSV.dsp
@@ -1,126 +1,126 @@
-# Microsoft Developer Studio Project File - Name="importCSV" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=importCSV - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "importCSV.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "importCSV.mak" CFG="importCSV - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "importCSV - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "importCSV - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "importCSV - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importCSV.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "importCSV - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importCSV.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "importCSV - Win32 Release"
-# Name "importCSV - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\importCSV.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportMIF.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeMIFProjection.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportExport.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="importCSV" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=importCSV - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "importCSV.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "importCSV.mak" CFG="importCSV - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "importCSV - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "importCSV - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "importCSV - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importCSV.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "importCSV - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importCSV.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "importCSV - Win32 Release"
+# Name "importCSV - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\importCSV.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportMIF.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeMIFProjection.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportExport.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/importCSV/importCSV.dsw b/examples/importCSV/importCSV.dsw
old mode 100755
new mode 100644
index 3b6bd0c..ab9ff2b
--- a/examples/importCSV/importCSV.dsw
+++ b/examples/importCSV/importCSV.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "importCSV"=.\importCSV.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "importCSV"=.\importCSV.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/importCSV/importCSV.pro b/examples/importCSV/importCSV.pro
old mode 100755
new mode 100644
index 499ea76..91d50e7
--- a/examples/importCSV/importCSV.pro
+++ b/examples/importCSV/importCSV.pro
@@ -1,12 +1,9 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	importCSV.cpp \
-	../../src/terralib/functions/TeImportMIF.cpp \
-	../../src/terralib/functions/TeMIFProjection.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/functions/TeImportExport.h \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-
+TARGET = importCSV
+
+include( ../base/base.pro )
+
+LIBS += -lte_functions
+
+SOURCES	+= \
+	importCSV.cpp 
+
diff --git a/examples/importCSV/importCSV.sln b/examples/importCSV/importCSV.sln
old mode 100755
new mode 100644
diff --git a/examples/importCSV/importCSV.vcproj b/examples/importCSV/importCSV.vcproj
old mode 100755
new mode 100644
index 3b2bf6d..fe2563d
--- a/examples/importCSV/importCSV.vcproj
+++ b/examples/importCSV/importCSV.vcproj
@@ -1,173 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="importCSV"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\importCSV.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\importCSV.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="importCSV.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\functions\TeImportMIF.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\functions\TeMIFProjection.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\functions\TeMIDMIFDriver.h">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="importCSV"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../Debug/te_functions/te_functions.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\importCSV.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../Release/te_functions/te_functions.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\importCSV.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="importCSV.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/importDBF/.cdtproject b/examples/importDBF/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/importDBF/.cdtproject
+++ b/examples/importDBF/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/importDBF/.project b/examples/importDBF/.project
old mode 100755
new mode 100644
index ba4835c..e35febc
--- a/examples/importDBF/.project
+++ b/examples/importDBF/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>importDBF</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>importDBF</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/importDBF/Makefile b/examples/importDBF/Makefile
old mode 100755
new mode 100644
index ff80af4..c94311b
--- a/examples/importDBF/Makefile
+++ b/examples/importDBF/Makefile
@@ -1,37 +1,37 @@
-all: importDBF
-
-debug: importDBF_dbg
-
-shapelib:
-	cd ../../terralibx/shapelib; make
-	
-shapelib_dbg:
-	cd ../../terralibx/shapelib; make debug
-
-terralib:
-	cd ../../terralibx/terralib; make
-	
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-importDBF: shapelib terralib 
-	qmake -o makeImportDBF importDBF.pro; make -f makeImportDBF
-
-importDBF_dbg: shapelib_dbg terralib_dbg 
-	qmake -o makeImportDBF.debug importDBF.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeImportDBF.debug
-
-
-clean:
-	if \
-		test -f makeImportDBF; \
-	then \
-		make -f makeImportDBF distclean; rm -f makeImportDBF; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeImportDBF.debug; \
-	then \
-		make -f makeImportDBF.debug distclean; rm -f makeImportDBF.debug; \
+all: importDBF
+
+debug: importDBF_dbg
+
+shapelib:
+	cd ../../terralibx/shapelib; make
+	
+shapelib_dbg:
+	cd ../../terralibx/shapelib; make debug
+
+terralib:
+	cd ../../terralibx/terralib; make
+	
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+importDBF: shapelib terralib 
+	qmake -o makeImportDBF importDBF.pro; make -f makeImportDBF
+
+importDBF_dbg: shapelib_dbg terralib_dbg 
+	qmake -o makeImportDBF.debug importDBF.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeImportDBF.debug
+
+
+clean:
+	if \
+		test -f makeImportDBF; \
+	then \
+		make -f makeImportDBF distclean; rm -f makeImportDBF; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeImportDBF.debug; \
+	then \
+		make -f makeImportDBF.debug distclean; rm -f makeImportDBF.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/importDBF/importDBF.cpp b/examples/importDBF/importDBF.cpp
old mode 100755
new mode 100644
index bd035a8..dbe33e7
--- a/examples/importDBF/importDBF.cpp
+++ b/examples/importDBF/importDBF.cpp
@@ -1,90 +1,90 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows an example of how to import a DBF table as
-	an attribute table in a TerraLib database. This attribute 
-	table will be registered in the database as an external table.
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeDriverSHPDBF.h>
-#include <TeMySQL.h>
-
-int main()
-{
-     // Database server parameters
-     string host = "localhost";
-     string dbname = "DB320RC1";
-     string user = "root";
-     string password = "vinhas";
-
-     // Connect to the database
-     TeDatabase* db = new TeMySQL();
-     if (!db->connect(host, user, password, dbname))
-     {
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-     }
-
-	// Import the dbf file
-	string filename = "../data/SOCEC.dbf";
-	if (db->tableExist("SOCEC"))
-		cout << "There is already a table named \"SOCEC\" in the TerraLib database!\n\n";
-	else
-	{
-		if (TeImportDBFTable(filename,db)) 
-			cout << "The dbf file \"SOCEC.dbf\" was imported successfully as an external table in the TerraLib database!\n\n";
-		else
-		{
-			db->close();
-			delete db;
-			cout << "Fail to import the dbf file!\n";
-			cout << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-	}
-
-	TeAttrTableVector tableVec;
-	if (db->getAttrTables(tableVec, TeAttrExternal))
-	{
-		cout << "External tables in the database: " << tableVec.size() << endl;
-		TeAttrTableVector::iterator it = tableVec.begin();
-		while (it != tableVec.end())
-		{
-			cout << (*it).name() << " primary key column: " << (*it).uniqueName() << endl << endl;
-			++it;
-		}
-	}
-
-	db->close();
-	delete db;
-	cout << "Press Enter\n";
-	getchar();
-	return 0;
-}
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows an example of how to import a DBF table as
+	an attribute table in a TerraLib database. This attribute 
+	table will be registered in the database as an external table.
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeDriverSHPDBF.h>
+#include <TeMySQL.h>
+
+int main()
+{
+     // Database server parameters
+     string host = "localhost";
+     string dbname = "DB320RC1";
+     string user = "root";
+     string password = "vinhas";
+
+     // Connect to the database
+     TeDatabase* db = new TeMySQL();
+     if (!db->connect(host, user, password, dbname))
+     {
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+     }
+
+	// Import the dbf file
+	string filename = "../data/SOCEC.dbf";
+	if (db->tableExist("SOCEC"))
+		cout << "There is already a table named \"SOCEC\" in the TerraLib database!\n\n";
+	else
+	{
+		if (TeImportDBFTable(filename,db)) 
+			cout << "The dbf file \"SOCEC.dbf\" was imported successfully as an external table in the TerraLib database!\n\n";
+		else
+		{
+			db->close();
+			delete db;
+			cout << "Fail to import the dbf file!\n";
+			cout << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+	}
+
+	TeAttrTableVector tableVec;
+	if (db->getAttrTables(tableVec, TeAttrExternal))
+	{
+		cout << "External tables in the database: " << tableVec.size() << endl;
+		TeAttrTableVector::iterator it = tableVec.begin();
+		while (it != tableVec.end())
+		{
+			cout << (*it).name() << " primary key column: " << (*it).uniqueName() << endl << endl;
+			++it;
+		}
+	}
+
+	db->close();
+	delete db;
+	cout << "Press Enter\n";
+	getchar();
+	return 0;
+}
+ 
diff --git a/examples/importDBF/importDBF.dsp b/examples/importDBF/importDBF.dsp
old mode 100755
new mode 100644
index f687913..27b4950
--- a/examples/importDBF/importDBF.dsp
+++ b/examples/importDBF/importDBF.dsp
@@ -1,122 +1,122 @@
-# Microsoft Developer Studio Project File - Name="importDBF" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=importDBF - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "importDBF.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "importDBF.mak" CFG="importDBF - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "importDBF - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "importDBF - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "importDBF - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importDBF.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "importDBF - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importDBF [...]
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "importDBF - Win32 Release"
-# Name "importDBF - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\importDBF.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportDBF.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportExport.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="importDBF" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=importDBF - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "importDBF.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "importDBF.mak" CFG="importDBF - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "importDBF - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "importDBF - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "importDBF - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importDBF.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "importDBF - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importDBF [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "importDBF - Win32 Release"
+# Name "importDBF - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\importDBF.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportDBF.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportExport.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/importDBF/importDBF.dsw b/examples/importDBF/importDBF.dsw
old mode 100755
new mode 100644
index 4d1a2b1..ddc882b
--- a/examples/importDBF/importDBF.dsw
+++ b/examples/importDBF/importDBF.dsw
@@ -1,62 +1,62 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "importDBF"=.\importDBF.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "shapelib"=..\..\terralibw\shapelib\shapelib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name shapelib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "importDBF"=.\importDBF.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "shapelib"=..\..\terralibw\shapelib\shapelib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name shapelib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/importDBF/importDBF.pro b/examples/importDBF/importDBF.pro
old mode 100755
new mode 100644
index b16bf62..541b685
--- a/examples/importDBF/importDBF.pro
+++ b/examples/importDBF/importDBF.pro
@@ -1,11 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	importDBF.cpp \
-	../../src/terralib/drivers/shapelib/TeDriverSHPDBF.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h \
-	../../src/terralib/drivers/shapelib/TeDriverSHPDBF.h 
-
+TARGET = importDBF
+
+include( ../base/base.pro )
+
+LIBS += -lte_shapelib
+
+SOURCES	+= \
+	importDBF.cpp
diff --git a/examples/importDBF/importDBF.sln b/examples/importDBF/importDBF.sln
old mode 100755
new mode 100644
diff --git a/examples/importDBF/importDBF.vcproj b/examples/importDBF/importDBF.vcproj
old mode 100755
new mode 100644
index 9054a97..7cf7911
--- a/examples/importDBF/importDBF.vcproj
+++ b/examples/importDBF/importDBF.vcproj
@@ -1,170 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="importDBF"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib;..\..\src\terralib\drivers\shapelib"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\importDBF.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\terralib\drivers\shapelib;..\..\src\shapelib"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\importDBF.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="importDBF.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\shapelib\TeDriverSHPDBF.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\shapelib\TeSHPDBFDriver.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="importDBF"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib;..\..\src\terralib\drivers\shapelib"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../Debug/te_shapelib/te_shapelib.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\importDBF.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\terralib\drivers\shapelib;..\..\src\shapelib"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../Release/te_shapelib/te_shapelib.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\importDBF.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="importDBF.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/importGeoTab/.cdtproject b/examples/importGeoTab/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/importGeoTab/.cdtproject
+++ b/examples/importGeoTab/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/importGeoTab/.project b/examples/importGeoTab/.project
old mode 100755
new mode 100644
index 2929acd..4dba9dc
--- a/examples/importGeoTab/.project
+++ b/examples/importGeoTab/.project
@@ -1,108 +1,108 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>importGeoTab</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildArguments</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>importGeoTab</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildArguments</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/importGeoTab/Makefile b/examples/importGeoTab/Makefile
old mode 100755
new mode 100644
index fe860cd..ca3fbd9
--- a/examples/importGeoTab/Makefile
+++ b/examples/importGeoTab/Makefile
@@ -1,30 +1,30 @@
-all: importGeoTab
-
-debug: importGeoTab_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-	
-importGeoTab: terralib
-	qmake -o makeImportGeoTab importGeoTab.pro; make -f makeImportGeoTab
-
-importGeoTab_dbg: terralib_dbg
-	qmake -o makeImportGeoTab.debug importGeoTab.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeImportGeoTab.debug
-
-clean:
-	if \
-		test -f makeImportGeoTab; \
-	then \
-		make -f makeImportGeoTab distclean; rm -f makeImportGeoTab; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeImportGeoTab.debug; \
-	then \
-		make -f makeImportGeoTab.debug distclean; rm -f makeImportGeoTab.debug; \
+all: importGeoTab
+
+debug: importGeoTab_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+	
+importGeoTab: terralib
+	qmake -o makeImportGeoTab importGeoTab.pro; make -f makeImportGeoTab
+
+importGeoTab_dbg: terralib_dbg
+	qmake -o makeImportGeoTab.debug importGeoTab.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeImportGeoTab.debug
+
+clean:
+	if \
+		test -f makeImportGeoTab; \
+	then \
+		make -f makeImportGeoTab distclean; rm -f makeImportGeoTab; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeImportGeoTab.debug; \
+	then \
+		make -f makeImportGeoTab.debug distclean; rm -f makeImportGeoTab.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/importGeoTab/importGeoTab.cpp b/examples/importGeoTab/importGeoTab.cpp
old mode 100755
new mode 100644
index 76431d2..0516431
--- a/examples/importGeoTab/importGeoTab.cpp
+++ b/examples/importGeoTab/importGeoTab.cpp
@@ -1,125 +1,125 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows an example of how to import some geographical data in 
-	the SPRING Geo/Tab format to a TerraLib database.
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeDriverSPRING.h>
-#include <TeMySQL.h>
-
-int main()
-{
-	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Connect to the database
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Import the SPRING geo file
-	string filename = "../data/Cadastro_Escolas.geo";
-	string layerName = "Cadastro_Escolas";
-	TeLayer* layer = 0;
-	if (db->layerExist(layerName))
-	{
-		cout << "There is already a layer named \"Cadastro_Escolas\" in the TerraLib database!\n\n";
-		if (db->loadLayerSet() == true)
-		{
-			// Get the layer named "Cadastro_Escolas" from the cache
-			TeLayerMap& layerMap = db->layerMap();
-			map<int, TeLayer*>::iterator it;
-			for (it = layerMap.begin(); it != layerMap.end(); ++it)
-			{
-				layer = it->second;
-				if (layer->name() == layerName)
-					break;
-			}
-		}
-	}
-	else
-	{
-		layer = new TeLayer(layerName, db);
-		if (TeImportGEO(layer, filename, layerName)) 
-			cout << "The SPRING GEO/TAB file was imported successfully to the TerraLib database!\n\n";
-		else
-		{
-			cout << "Fail to import the SPRING GEO/TAB file!\n\n";
-			db->close();
-			delete db;
-			cout << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-	}
-
-	// Show some information about the new layer created
-	cout << "Layer created: " << layer->name() << ", id: " << layer->id() << endl;
-
-	// Geometries information
-	cout << "Projection: " << layer->projection()->name();              
-	cout << "/" << layer->projection()->datum().name();          
-
-	TeBox bb = layer->box();
-	char message[255];
-	sprintf(message, "[%.15f,%.15f,%.15f,%.15f]\n",bb.x1_, bb.y1_, bb.x2_, bb.y2_);
-	cout << "\nBounding box: " << message;
-	cout << "Number of polygons: " << layer->nGeometries(TePOLYGONS) << endl;
-	cout << "Number of lines: "    << layer->nGeometries(TeLINES) << endl;
-	cout << "Number of points: "   << layer->nGeometries(TePOINTS) << endl;
-
-	// Attributes information
-	TeAttrTableVector tableVec;
-	layer->getAttrTables(tableVec);
-	cout << "Attribute tables: " << tableVec.size() << endl;
-	if (tableVec.size() > 0)
-	{
-		TeAttrTableVector::iterator it = tableVec.begin();
-		while (it != tableVec.end())
-		{
-			cout << (*it).name() << ": ";
-			cout << layer->nObjects((*it).name()) << " objects\n" << endl;
-			++it;
-		}
-	}
-
-	db->close();
-	delete db;
-	cout << "\nPress Enter";
-	getchar();
-	return 0;
-}
-
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows an example of how to import some geographical data in 
+	the SPRING Geo/Tab format to a TerraLib database.
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeDriverSPRING.h>
+#include <TeMySQL.h>
+
+int main()
+{
+	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Connect to the database
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Import the SPRING geo file
+	string filename = "../data/Cadastro_Escolas.geo";
+	string layerName = "Cadastro_Escolas";
+	TeLayer* layer = 0;
+	if (db->layerExist(layerName))
+	{
+		cout << "There is already a layer named \"Cadastro_Escolas\" in the TerraLib database!\n\n";
+		if (db->loadLayerSet() == true)
+		{
+			// Get the layer named "Cadastro_Escolas" from the cache
+			TeLayerMap& layerMap = db->layerMap();
+			map<int, TeLayer*>::iterator it;
+			for (it = layerMap.begin(); it != layerMap.end(); ++it)
+			{
+				layer = it->second;
+				if (layer->name() == layerName)
+					break;
+			}
+		}
+	}
+	else
+	{
+		layer = new TeLayer(layerName, db);
+		if (TeImportGEO(layer, filename, layerName)) 
+			cout << "The SPRING GEO/TAB file was imported successfully to the TerraLib database!\n\n";
+		else
+		{
+			cout << "Fail to import the SPRING GEO/TAB file!\n\n";
+			db->close();
+			delete db;
+			cout << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+	}
+
+	// Show some information about the new layer created
+	cout << "Layer created: " << layer->name() << ", id: " << layer->id() << endl;
+
+	// Geometries information
+	cout << "Projection: " << layer->projection()->name();              
+	cout << "/" << layer->projection()->datum().name();          
+
+	TeBox bb = layer->box();
+	char message[255];
+	sprintf(message, "[%.15f,%.15f,%.15f,%.15f]\n",bb.x1_, bb.y1_, bb.x2_, bb.y2_);
+	cout << "\nBounding box: " << message;
+	cout << "Number of polygons: " << layer->nGeometries(TePOLYGONS) << endl;
+	cout << "Number of lines: "    << layer->nGeometries(TeLINES) << endl;
+	cout << "Number of points: "   << layer->nGeometries(TePOINTS) << endl;
+
+	// Attributes information
+	TeAttrTableVector tableVec;
+	layer->getAttrTables(tableVec);
+	cout << "Attribute tables: " << tableVec.size() << endl;
+	if (tableVec.size() > 0)
+	{
+		TeAttrTableVector::iterator it = tableVec.begin();
+		while (it != tableVec.end())
+		{
+			cout << (*it).name() << ": ";
+			cout << layer->nObjects((*it).name()) << " objects\n" << endl;
+			++it;
+		}
+	}
+
+	db->close();
+	delete db;
+	cout << "\nPress Enter";
+	getchar();
+	return 0;
+}
+
+ 
diff --git a/examples/importGeoTab/importGeoTab.dsp b/examples/importGeoTab/importGeoTab.dsp
old mode 100755
new mode 100644
index 7ef85ea..e7338b2
--- a/examples/importGeoTab/importGeoTab.dsp
+++ b/examples/importGeoTab/importGeoTab.dsp
@@ -1,122 +1,122 @@
-# Microsoft Developer Studio Project File - Name="importGeoTab" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=importGeoTab - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "importGeoTab.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "importGeoTab.mak" CFG="importGeoTab - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "importGeoTab - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "importGeoTab - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "importGeoTab - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importGeoTab.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "importGeoTab - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importGeoTab.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "importGeoTab - Win32 Release"
-# Name "importGeoTab - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\importGeoTab.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportGeo.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportExport.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="importGeoTab" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=importGeoTab - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "importGeoTab.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "importGeoTab.mak" CFG="importGeoTab - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "importGeoTab - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "importGeoTab - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "importGeoTab - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importGeoTab.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "importGeoTab - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importGeoTab.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "importGeoTab - Win32 Release"
+# Name "importGeoTab - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\importGeoTab.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportGeo.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportExport.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/importGeoTab/importGeoTab.dsw b/examples/importGeoTab/importGeoTab.dsw
old mode 100755
new mode 100644
index 06a1970..401651a
--- a/examples/importGeoTab/importGeoTab.dsw
+++ b/examples/importGeoTab/importGeoTab.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "importGeoTab"=.\importGeoTab.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "importGeoTab"=.\importGeoTab.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/importGeoTab/importGeoTab.pro b/examples/importGeoTab/importGeoTab.pro
old mode 100755
new mode 100644
index 1b35640..159a65b
--- a/examples/importGeoTab/importGeoTab.pro
+++ b/examples/importGeoTab/importGeoTab.pro
@@ -1,11 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	importGeoTab.cpp \
-	../../src/terralib/functions/TeImportGeo.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/functions/TeImportExport.h \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
+TARGET = importGeoTab
+
+include( ../base/base.pro )
+
+LIBS += -lte_functions
+
+SOURCES	+= \
+	importGeoTab.cpp	
diff --git a/examples/importGeoTab/importGeoTab.sln b/examples/importGeoTab/importGeoTab.sln
old mode 100755
new mode 100644
diff --git a/examples/importGeoTab/importGeoTab.vcproj b/examples/importGeoTab/importGeoTab.vcproj
old mode 100755
new mode 100644
index c25c884..e7f7ab0
--- a/examples/importGeoTab/importGeoTab.vcproj
+++ b/examples/importGeoTab/importGeoTab.vcproj
@@ -1,170 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="importGeoTab"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\importGeoTab.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\importGeoTab.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="importGeoTab.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\functions\TeImportGeo.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\functions\TeSPRINGDriver.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="importGeoTab"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../Debug/te_functions/te_functions.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\importGeoTab.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../Release/te_functions/te_functions.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\importGeoTab.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="importGeoTab.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/importGridData/.cdtproject b/examples/importGridData/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/importGridData/.cdtproject
+++ b/examples/importGridData/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/importGridData/.project b/examples/importGridData/.project
old mode 100755
new mode 100644
index ba03547..6195ebb
--- a/examples/importGridData/.project
+++ b/examples/importGridData/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>importGridData</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>importGridData</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/importGridData/Makefile b/examples/importGridData/Makefile
old mode 100755
new mode 100644
index 4922ebd..85b488e
--- a/examples/importGridData/Makefile
+++ b/examples/importGridData/Makefile
@@ -1,31 +1,31 @@
-all: importGridData
-
-debug: importGridData_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-importGridData: terralib
-	qmake -o makeImportGridData importGridData.pro; make -f makeImportGridData
-
-importGridData_dbg: terralib_dbg
-	qmake -o makeImportGridData.debug importGridData.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeImportGridData.debug
-
-
-clean:
-	if \
-		test -f makeImportGridData; \
-	then \
-		make -f makeImportGridData distclean; rm -f makeImportGridData; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeImportGridData.debug; \
-	then \
-		make -f makeImportGridData.debug distclean; rm -f makeImportGridData.debug; \
+all: importGridData
+
+debug: importGridData_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+importGridData: terralib
+	qmake -o makeImportGridData importGridData.pro; make -f makeImportGridData
+
+importGridData_dbg: terralib_dbg
+	qmake -o makeImportGridData.debug importGridData.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeImportGridData.debug
+
+
+clean:
+	if \
+		test -f makeImportGridData; \
+	then \
+		make -f makeImportGridData distclean; rm -f makeImportGridData; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeImportGridData.debug; \
+	then \
+		make -f makeImportGridData.debug distclean; rm -f makeImportGridData.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/importGridData/importGridData.cpp b/examples/importGridData/importGridData.cpp
old mode 100755
new mode 100644
index 24b51f2..0fb4047
--- a/examples/importGridData/importGridData.cpp
+++ b/examples/importGridData/importGridData.cpp
@@ -1,125 +1,125 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows an example of how to import, to a TerraLib database, a raster data: 
-	a binary raw grid data. Each point of the grid is a float value that represents the 
-	elevation over an area 
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeDatabase.h>
-#include <TeMySQL.h>
-#include <TeDecoderMemoryMap.h>
-#include <TeImportRaster.h>
-
-int main()
-{
-	// Initialize the raster decoder tool
-	static TeDecoderMemoryMapFactory theDecoderMemoryMapFactory("MEMMAP");
-	TeDecoderFactory::instanceName2Dec()["raw"]  = "MEMMAP";	
-	TeDecoderFactory::instanceName2Dec()["RAW"]  = "MEMMAP";	
-
-	TeRasterParams parRaw;
-	parRaw.nBands(1);
-	parRaw.setDataType(TeFLOAT);
-	parRaw.fileName_ = "../data/elevation.raw";
-	parRaw.mode_ = 'r';
-	TeProjection* proj = new TeNoProjection();
-	parRaw.projection(proj);
-	parRaw.lowerLeftResolutionSize(183557.0,8246277.0,30,30,382,422,false);
-
-	// Acess input image
-	TeRaster elev(parRaw);
-	if (!elev.init())
-	{
-		cout << "Cannot access input grid!" << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		elev.clear();
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	string layerName = "Elevation";
-
-	// Check whether there is a layer with this name in the database
-	if (db->layerExist(layerName))
-	{
-		cout << "The database already has an infolayer with the name \"";
-		cout << layerName << "\"!" << endl << endl;
-		db->close();
-		delete db;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Create a layer to receive the raster geometry (same projection as raster data)
-	TeLayer* layer = new TeLayer(layerName, db, elev.projection());
-	if (layer->id() <= 0)
-	{
-		elev.clear();
-		db->close();
-		delete db;
-		cout << "The destination layer could not be created!\n" << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Import raster to the layer
-	if (!TeImportRaster(layer, &elev, parRaw.ncols_, 2))
-	{
-		elev.clear();
-		db->close();
-		delete db;
-		cout << "Fail to import grid!\n" << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Close database
-	db->close();
-	delete db;
-	cout << "The GRID data was imported successfully into the TerraLib database!\n\n";
-	cout << "Press Enter\n";
-	getchar();
-	return 0;
-}
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows an example of how to import, to a TerraLib database, a raster data: 
+	a binary raw grid data. Each point of the grid is a float value that represents the 
+	elevation over an area 
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeDatabase.h>
+#include <TeMySQL.h>
+#include <TeDecoderMemoryMap.h>
+#include <TeImportRaster.h>
+
+int main()
+{
+	// Initialize the raster decoder tool
+	static TeDecoderMemoryMapFactory theDecoderMemoryMapFactory("MEMMAP");
+	TeDecoderFactory::instanceName2Dec()["raw"]  = "MEMMAP";	
+	TeDecoderFactory::instanceName2Dec()["RAW"]  = "MEMMAP";	
+
+	TeRasterParams parRaw;
+	parRaw.nBands(1);
+	parRaw.setDataType(TeFLOAT);
+	parRaw.fileName_ = "../data/elevation.raw";
+	parRaw.mode_ = 'r';
+	TeProjection* proj = new TeNoProjection();
+	parRaw.projection(proj);
+	parRaw.lowerLeftResolutionSize(183557.0,8246277.0,30,30,382,422,false);
+
+	// Acess input image
+	TeRaster elev(parRaw);
+	if (!elev.init())
+	{
+		cout << "Cannot access input grid!" << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		elev.clear();
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	string layerName = "Elevation";
+
+	// Check whether there is a layer with this name in the database
+	if (db->layerExist(layerName))
+	{
+		cout << "The database already has an infolayer with the name \"";
+		cout << layerName << "\"!" << endl << endl;
+		db->close();
+		delete db;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Create a layer to receive the raster geometry (same projection as raster data)
+	TeLayer* layer = new TeLayer(layerName, db, elev.projection());
+	if (layer->id() <= 0)
+	{
+		elev.clear();
+		db->close();
+		delete db;
+		cout << "The destination layer could not be created!\n" << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Import raster to the layer
+	if (!TeImportRaster(layer, &elev, parRaw.ncols_, 2))
+	{
+		elev.clear();
+		db->close();
+		delete db;
+		cout << "Fail to import grid!\n" << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Close database
+	db->close();
+	delete db;
+	cout << "The GRID data was imported successfully into the TerraLib database!\n\n";
+	cout << "Press Enter\n";
+	getchar();
+	return 0;
+}
+ 
diff --git a/examples/importGridData/importGridData.dsp b/examples/importGridData/importGridData.dsp
old mode 100755
new mode 100644
index 548b67d..e10a77f
--- a/examples/importGridData/importGridData.dsp
+++ b/examples/importGridData/importGridData.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="importGridData" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=importGridData - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "importGridData.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "importGridData.mak" CFG="importGridData - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "importGridData - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "importGridData - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "importGridData - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib ..\..\terralibw\tiff\Release\tiff.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importGridData.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "importGridData - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib ..\..\terralibw\tiff\Debug\tiff.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importGridData.ex [...]
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "importGridData - Win32 Release"
-# Name "importGridData - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\importGridData.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="importGridData" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=importGridData - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "importGridData.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "importGridData.mak" CFG="importGridData - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "importGridData - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "importGridData - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "importGridData - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib ..\..\terralibw\tiff\Release\tiff.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importGridData.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "importGridData - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib ..\..\terralibw\tiff\Debug\tiff.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importGridData.ex [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "importGridData - Win32 Release"
+# Name "importGridData - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\importGridData.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/importGridData/importGridData.dsw b/examples/importGridData/importGridData.dsw
old mode 100755
new mode 100644
index 87da046..a6f6500
--- a/examples/importGridData/importGridData.dsw
+++ b/examples/importGridData/importGridData.dsw
@@ -1,62 +1,62 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "importGridData"=.\importGridData.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name tiff
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tiff"=..\..\terralibw\tiff\tiff.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "importGridData"=.\importGridData.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name tiff
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "tiff"=..\..\terralibw\tiff\tiff.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/importGridData/importGridData.pro b/examples/importGridData/importGridData.pro
old mode 100755
new mode 100644
index 2049cfa..19c672d
--- a/examples/importGridData/importGridData.pro
+++ b/examples/importGridData/importGridData.pro
@@ -1,9 +1,6 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	importGridData.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-
+TARGET = importGridData
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	importGridData.cpp
\ No newline at end of file
diff --git a/examples/importGridData/importGridData.sln b/examples/importGridData/importGridData.sln
old mode 100755
new mode 100644
diff --git a/examples/importGridData/importGridData.vcproj b/examples/importGridData/importGridData.vcproj
old mode 100755
new mode 100644
index 90621ef..366c368
--- a/examples/importGridData/importGridData.vcproj
+++ b/examples/importGridData/importGridData.vcproj
@@ -1,164 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="importGridData"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\importGridData.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\importGridData.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="importGridData.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="importGridData"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\importGridData.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\importGridData.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="importGridData.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/importJPEG/.cdtproject b/examples/importJPEG/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/importJPEG/.cdtproject
+++ b/examples/importJPEG/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/importJPEG/.project b/examples/importJPEG/.project
old mode 100755
new mode 100644
index 8b81ec9..8c76de8
--- a/examples/importJPEG/.project
+++ b/examples/importJPEG/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>importJPEG</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>importJPEG</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/importJPEG/Makefile b/examples/importJPEG/Makefile
old mode 100755
new mode 100644
index c46d69d..3adc911
--- a/examples/importJPEG/Makefile
+++ b/examples/importJPEG/Makefile
@@ -1,30 +1,30 @@
-all: importJPEG
-
-debug: importJPEG_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-importJPEG: terralib
-	qmake -o makeImportJPEG importJPEG.pro; make -f makeImportJPEG
-
-importJPEG_dbg: terralib_dbg
-	qmake -o makeImportJPEG.debug importJPEG.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeImportJPEG.debug
-
-clean:
-	if \
-		test -f makeImportJPEG; \
-	then \
-		make -f makeImportJPEG distclean; rm -f makeImportJPEG; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeImportJPEG.debug; \
-	then \
-		make -f makeImportJPEG.debug distclean; rm -f makeImportJPEG.debug; \
+all: importJPEG
+
+debug: importJPEG_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+importJPEG: terralib
+	qmake -o makeImportJPEG importJPEG.pro; make -f makeImportJPEG
+
+importJPEG_dbg: terralib_dbg
+	qmake -o makeImportJPEG.debug importJPEG.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeImportJPEG.debug
+
+clean:
+	if \
+		test -f makeImportJPEG; \
+	then \
+		make -f makeImportJPEG distclean; rm -f makeImportJPEG; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeImportJPEG.debug; \
+	then \
+		make -f makeImportJPEG.debug distclean; rm -f makeImportJPEG.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/importJPEG/importJPEG.cpp b/examples/importJPEG/importJPEG.cpp
old mode 100755
new mode 100644
index eaf0019..8f52475
--- a/examples/importJPEG/importJPEG.cpp
+++ b/examples/importJPEG/importJPEG.cpp
@@ -1,118 +1,118 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows an example of how to import a raster data (an image in JPEG
-	format) to a TerraLib database.
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeDatabase.h>
-#include <TeMySQL.h>
-#include <TeImportRaster.h>
-#include <TeDecoderJPEG.h>
-
-int main()
-{
-
-	// Creates an instance of the JPEG raster decoder
-	static TeDecoderJPEGFactory theDecoderJPEGFactory("JPEG");
-	TeDecoderFactory::instanceName2Dec()["jpg"]  = "JPEG";	
-	TeDecoderFactory::instanceName2Dec()["jpeg"] = "JPEG";
-	TeDecoderFactory::instanceName2Dec()["JPG"]  = "JPEG";	
-	TeDecoderFactory::instanceName2Dec()["JPEG"] = "JPEG";
-
-	// Acess input image
-	TeRaster image("../data/sampa.jpg");
-	if (!image.init())
-	{
-		cout << "Cannot access input image!" << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		image.clear();
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	string layerName = "SampaJPEG";
-
-	// Check whether there is a layer with this name in the database
-	if (db->layerExist(layerName))
-	{
-		cout << "The database already has an infolayer with the name \"";
-		cout << layerName << "\"!" << endl << endl;
-		db->close();
-		delete db;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Create a layer to receive the raster geometry (same projection as raster data)
-	TeLayer* layer = new TeLayer(layerName, db, image.projection());
-	if (layer->id() <= 0)
-	{
-		image.clear();
-		db->close();
-		delete db;
-		cout << "The destination layer could not be created!\n" << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Import raster to the layer
-	if (!TeImportRaster(layer, &image, 128, 128))
-	{
-		image.clear();
-		db->close();
-		delete db;
-		cout << "Fail to import image!\n" << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Close database
-	db->close();
-	delete db;
-	cout << "The JPEG image was imported successfully into the TerraLib database!\n\n";
-	cout << "Press Enter\n";
-	getchar();
-	return 0;
-}
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows an example of how to import a raster data (an image in JPEG
+	format) to a TerraLib database.
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeDatabase.h>
+#include <TeMySQL.h>
+#include <TeImportRaster.h>
+#include <TeDecoderJPEG.h>
+
+int main()
+{
+
+	// Creates an instance of the JPEG raster decoder
+	static TeDecoderJPEGFactory theDecoderJPEGFactory("JPEG");
+	TeDecoderFactory::instanceName2Dec()["jpg"]  = "JPEG";	
+	TeDecoderFactory::instanceName2Dec()["jpeg"] = "JPEG";
+	TeDecoderFactory::instanceName2Dec()["JPG"]  = "JPEG";	
+	TeDecoderFactory::instanceName2Dec()["JPEG"] = "JPEG";
+
+	// Acess input image
+	TeRaster image("../data/sampa.jpg");
+	if (!image.init())
+	{
+		cout << "Cannot access input image!" << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		image.clear();
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	string layerName = "SampaJPEG";
+
+	// Check whether there is a layer with this name in the database
+	if (db->layerExist(layerName))
+	{
+		cout << "The database already has an infolayer with the name \"";
+		cout << layerName << "\"!" << endl << endl;
+		db->close();
+		delete db;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Create a layer to receive the raster geometry (same projection as raster data)
+	TeLayer* layer = new TeLayer(layerName, db, image.projection());
+	if (layer->id() <= 0)
+	{
+		image.clear();
+		db->close();
+		delete db;
+		cout << "The destination layer could not be created!\n" << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Import raster to the layer
+	if (!TeImportRaster(layer, &image, 128, 128))
+	{
+		image.clear();
+		db->close();
+		delete db;
+		cout << "Fail to import image!\n" << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Close database
+	db->close();
+	delete db;
+	cout << "The JPEG image was imported successfully into the TerraLib database!\n\n";
+	cout << "Press Enter\n";
+	getchar();
+	return 0;
+}
+ 
diff --git a/examples/importJPEG/importJPEG.dsp b/examples/importJPEG/importJPEG.dsp
old mode 100755
new mode 100644
index 9dcb0bf..ef54358
--- a/examples/importJPEG/importJPEG.dsp
+++ b/examples/importJPEG/importJPEG.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="importJPEG" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=importJPEG - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "importJPEG.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "importJPEG.mak" CFG="importJPEG - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "importJPEG - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "importJPEG - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "importJPEG - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\tiff\Release\tiff.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importJPEG.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "importJPEG - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\tiff\Debug\tiff.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importJPEG.exe" / [...]
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "importJPEG - Win32 Release"
-# Name "importJPEG - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\importJPEG.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="importJPEG" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=importJPEG - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "importJPEG.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "importJPEG.mak" CFG="importJPEG - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "importJPEG - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "importJPEG - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "importJPEG - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\tiff\Release\tiff.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importJPEG.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "importJPEG - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\tiff\Debug\tiff.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importJPEG.exe" / [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "importJPEG - Win32 Release"
+# Name "importJPEG - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\importJPEG.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/importJPEG/importJPEG.dsw b/examples/importJPEG/importJPEG.dsw
old mode 100755
new mode 100644
index 08b5347..d696d53
--- a/examples/importJPEG/importJPEG.dsw
+++ b/examples/importJPEG/importJPEG.dsw
@@ -1,62 +1,62 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "importJPEG"=.\importJPEG.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name tiff
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tiff"=..\..\terralibw\tiff\tiff.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "importJPEG"=.\importJPEG.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name tiff
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "tiff"=..\..\terralibw\tiff\tiff.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/importJPEG/importJPEG.pro b/examples/importJPEG/importJPEG.pro
old mode 100755
new mode 100644
index 4b14147..4043a67
--- a/examples/importJPEG/importJPEG.pro
+++ b/examples/importJPEG/importJPEG.pro
@@ -1,10 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	importJPEG.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-
-
+TARGET = importJPEG
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	importJPEG.cpp 
+
+
diff --git a/examples/importJPEG/importJPEG.sln b/examples/importJPEG/importJPEG.sln
old mode 100755
new mode 100644
diff --git a/examples/importJPEG/importJPEG.vcproj b/examples/importJPEG/importJPEG.vcproj
old mode 100755
new mode 100644
index d7bfa54..b1d1bba
--- a/examples/importJPEG/importJPEG.vcproj
+++ b/examples/importJPEG/importJPEG.vcproj
@@ -1,164 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="importJPEG"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\importJPEG.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\importJPEG.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath=".\importJPEG.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="importJPEG"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\importJPEG.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\importJPEG.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath=".\importJPEG.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/importMIDMIF/.cdtproject b/examples/importMIDMIF/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/importMIDMIF/.cdtproject
+++ b/examples/importMIDMIF/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/importMIDMIF/.project b/examples/importMIDMIF/.project
old mode 100755
new mode 100644
index 86a8443..e60e64f
--- a/examples/importMIDMIF/.project
+++ b/examples/importMIDMIF/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>importMIDMIF</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>importMIDMIF</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/importMIDMIF/Makefile b/examples/importMIDMIF/Makefile
old mode 100755
new mode 100644
index 50b8131..ee3d9e9
--- a/examples/importMIDMIF/Makefile
+++ b/examples/importMIDMIF/Makefile
@@ -1,29 +1,29 @@
-all: importMIDMIF
-
-debug: importMIDMIF_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-importMIDMIF: terralib
-	qmake -o makeImportMIDMIF importMIDMIF.pro; make -f makeImportMIDMIF
-
-importMIDMIF_dbg: terralib_dbg
-	qmake -o makeImportMIDMIF.debug importMIDMIF.pro TE_PROJECT_TYPE=DEBUG; make -f makeImportMIDMIF.debug
-
-clean:
-	if \
-		test -f makeImportMIDMIF; \
-	then \
-		make -f makeImportMIDMIF distclean; rm -f makeImportMIDMIF; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeImportMIDMIF.debug; \
-	then \
-		make -f makeImportMIDMIF.debug distclean; rm -f makeImportMIDMIF.debug; \
+all: importMIDMIF
+
+debug: importMIDMIF_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+importMIDMIF: terralib
+	qmake -o makeImportMIDMIF importMIDMIF.pro; make -f makeImportMIDMIF
+
+importMIDMIF_dbg: terralib_dbg
+	qmake -o makeImportMIDMIF.debug importMIDMIF.pro TE_PROJECT_TYPE=DEBUG; make -f makeImportMIDMIF.debug
+
+clean:
+	if \
+		test -f makeImportMIDMIF; \
+	then \
+		make -f makeImportMIDMIF distclean; rm -f makeImportMIDMIF; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeImportMIDMIF.debug; \
+	then \
+		make -f makeImportMIDMIF.debug distclean; rm -f makeImportMIDMIF.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/importMIDMIF/importMIDMIF.cpp b/examples/importMIDMIF/importMIDMIF.cpp
old mode 100755
new mode 100644
index 41569d4..e53a342
--- a/examples/importMIDMIF/importMIDMIF.cpp
+++ b/examples/importMIDMIF/importMIDMIF.cpp
@@ -1,120 +1,120 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows an example of how to import some geographical data
-	in MID/MIF format into a TerraLib database.
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeDriverMIDMIF.h>
-#include <TeMySQL.h>
-
-int main()
-{
-     // Datatabase server parameters
-     string host = "localhost";
-     string dbname = "DB320RC1";
-     string user = "root";
-     string password = "vinhas";
-
-     // Connects to database
-     TeDatabase* db = new TeMySQL();
-     if (!db->connect(host, user,password, dbname))
-     {
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << "Press Enter\n";
-		getchar();
-		delete db;
-		return 1;
-     }
-
-	TeLayer *layer = 0;
-	string filename = "../data/Distritos.mif";
-	if (db->layerExist("Distritos"))
-	{
-		cout << "Warning: Layer \"Distritos\" already exists in the database!\n" << endl;
-		if (db->loadLayerSet() == true)
-		{
-			// Get layer named "Distritos" from the cache
-			TeLayerMap& layerMap = db->layerMap();
-			map<int, TeLayer*>::iterator it;
-			for (it = layerMap.begin(); it != layerMap.end(); ++it)
-			{
-				layer = it->second;
-				if (layer->name() == "Distritos")
-					break;
-			}
-		}
-	}
-	else
-	{
-		// Import the MID/MIF file
-		layer = TeImportMIF(filename, db);                          
-		if (layer) 
-			cout << "MID/MIF file imported to the TerraLib database successfully!\n" << endl;
-		else
-		{
-			cout << "Fail to import the MID/MIF file!\n";
-			db->close();
-			delete db;
-			cout << "Press Enter\n";
-			getchar();
-			return 1;
-		}
-	}
-
-	// Show some information about the layer associated to the MID/MIF file
-	cout << "Layer: " << layer->name() << ", id: " << layer->id() << endl;
-
-	// Geometries information
-	cout << "Projection: " << layer->projection()->name();              
-	cout << "/" << layer->projection()->datum().name();          
-	TeBox bb = layer->box();
-	char message[255];
-	sprintf(message,"[%.15f,%.15f,%.15f,%.15f]\n",bb.x1_, bb.y1_, bb.x2_, bb.y2_);
-	cout << "\nBounding box: " << message;
-	cout << "Number of polygons: " << layer->nGeometries(TePOLYGONS) << endl;
-	cout << "Number of lines: "    << layer->nGeometries(TeLINES) << endl;
-	cout << "Number of points: "   << layer->nGeometries(TePOINTS) << endl;
-
-	// Information of the Tables of Attributes of the Layer
-	TeAttrTableVector tableVec;
-	layer->getAttrTables(tableVec);
-	cout << "Number of Attribute Tables: " << tableVec.size() << endl;
-	
-	for (unsigned int i = 0; i < tableVec.size(); ++i)
-	{
-		cout << "Attribute Table " << "\"" << tableVec[i].name() << "\": ";
-		cout << layer->nObjects(tableVec[i].name()) << " objects" << endl << endl;
-	}
-	
-	db->close();
-	delete db;
-	cout << "Press Enter\n";
-	getchar();
-	return 0;
-}
-
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows an example of how to import some geographical data
+	in MID/MIF format into a TerraLib database.
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeDriverMIDMIF.h>
+#include <TeMySQL.h>
+
+int main()
+{
+     // Datatabase server parameters
+     string host = "localhost";
+     string dbname = "DB320RC1";
+     string user = "root";
+     string password = "vinhas";
+
+     // Connects to database
+     TeDatabase* db = new TeMySQL();
+     if (!db->connect(host, user,password, dbname))
+     {
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << "Press Enter\n";
+		getchar();
+		delete db;
+		return 1;
+     }
+
+	TeLayer *layer = 0;
+	string filename = "../data/Distritos.mif";
+	if (db->layerExist("Distritos"))
+	{
+		cout << "Warning: Layer \"Distritos\" already exists in the database!\n" << endl;
+		if (db->loadLayerSet() == true)
+		{
+			// Get layer named "Distritos" from the cache
+			TeLayerMap& layerMap = db->layerMap();
+			map<int, TeLayer*>::iterator it;
+			for (it = layerMap.begin(); it != layerMap.end(); ++it)
+			{
+				layer = it->second;
+				if (layer->name() == "Distritos")
+					break;
+			}
+		}
+	}
+	else
+	{
+		// Import the MID/MIF file
+		layer = TeImportMIF(filename, db);                          
+		if (layer) 
+			cout << "MID/MIF file imported to the TerraLib database successfully!\n" << endl;
+		else
+		{
+			cout << "Fail to import the MID/MIF file!\n";
+			db->close();
+			delete db;
+			cout << "Press Enter\n";
+			getchar();
+			return 1;
+		}
+	}
+
+	// Show some information about the layer associated to the MID/MIF file
+	cout << "Layer: " << layer->name() << ", id: " << layer->id() << endl;
+
+	// Geometries information
+	cout << "Projection: " << layer->projection()->name();              
+	cout << "/" << layer->projection()->datum().name();          
+	TeBox bb = layer->box();
+	char message[255];
+	sprintf(message,"[%.15f,%.15f,%.15f,%.15f]\n",bb.x1_, bb.y1_, bb.x2_, bb.y2_);
+	cout << "\nBounding box: " << message;
+	cout << "Number of polygons: " << layer->nGeometries(TePOLYGONS) << endl;
+	cout << "Number of lines: "    << layer->nGeometries(TeLINES) << endl;
+	cout << "Number of points: "   << layer->nGeometries(TePOINTS) << endl;
+
+	// Information of the Tables of Attributes of the Layer
+	TeAttrTableVector tableVec;
+	layer->getAttrTables(tableVec);
+	cout << "Number of Attribute Tables: " << tableVec.size() << endl;
+	
+	for (unsigned int i = 0; i < tableVec.size(); ++i)
+	{
+		cout << "Attribute Table " << "\"" << tableVec[i].name() << "\": ";
+		cout << layer->nObjects(tableVec[i].name()) << " objects" << endl << endl;
+	}
+	
+	db->close();
+	delete db;
+	cout << "Press Enter\n";
+	getchar();
+	return 0;
+}
+
+ 
diff --git a/examples/importMIDMIF/importMIDMIF.dsp b/examples/importMIDMIF/importMIDMIF.dsp
old mode 100755
new mode 100644
index e945dee..b886cdd
--- a/examples/importMIDMIF/importMIDMIF.dsp
+++ b/examples/importMIDMIF/importMIDMIF.dsp
@@ -1,130 +1,130 @@
-# Microsoft Developer Studio Project File - Name="importMIDMIF" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=importMIDMIF - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "importMIDMIF.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "importMIDMIF.mak" CFG="importMIDMIF - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "importMIDMIF - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "importMIDMIF - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "importMIDMIF - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\teeralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importMIDMIF.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "importMIDMIF - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\dri [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importMIDMIF.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "importMIDMIF - Win32 Release"
-# Name "importMIDMIF - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\importMIDMIF.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportMIF.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeMIFProjection.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportExport.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeMIFProjection.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="importMIDMIF" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=importMIDMIF - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "importMIDMIF.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "importMIDMIF.mak" CFG="importMIDMIF - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "importMIDMIF - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "importMIDMIF - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "importMIDMIF - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\teeralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importMIDMIF.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "importMIDMIF - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\dri [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importMIDMIF.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "importMIDMIF - Win32 Release"
+# Name "importMIDMIF - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\importMIDMIF.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportMIF.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeMIFProjection.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportExport.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeMIFProjection.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/importMIDMIF/importMIDMIF.dsw b/examples/importMIDMIF/importMIDMIF.dsw
old mode 100755
new mode 100644
index 35f8b53..632eccc
--- a/examples/importMIDMIF/importMIDMIF.dsw
+++ b/examples/importMIDMIF/importMIDMIF.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "importMIDMIF"=.\importMIDMIF.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "importMIDMIF"=.\importMIDMIF.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/importMIDMIF/importMIDMIF.pro b/examples/importMIDMIF/importMIDMIF.pro
old mode 100755
new mode 100644
index a5bf805..8fcc2e1
--- a/examples/importMIDMIF/importMIDMIF.pro
+++ b/examples/importMIDMIF/importMIDMIF.pro
@@ -1,12 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	importMIDMIF.cpp \
-	../../src/terralib/functions/TeImportMIF.cpp \
-	../../src/terralib/functions/TeMIFProjection.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h \
-	../../src/terralib/functions/TeMIFProjection.h
-	
+TARGET = importMIDMIF
+
+include( ../base/base.pro )
+
+LIBS += -lte_functions
+
+SOURCES	+= \
+	importMIDMIF.cpp	
diff --git a/examples/importMIDMIF/importMIDMIF.sln b/examples/importMIDMIF/importMIDMIF.sln
old mode 100755
new mode 100644
diff --git a/examples/importMIDMIF/importMIDMIF.vcproj b/examples/importMIDMIF/importMIDMIF.vcproj
old mode 100755
new mode 100644
index 65c83f0..093ac9c
--- a/examples/importMIDMIF/importMIDMIF.vcproj
+++ b/examples/importMIDMIF/importMIDMIF.vcproj
@@ -1,176 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="importMIDMIF"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\importMIDMIF.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\importMIDMIF.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="importMIDMIF.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\functions\TeImportMIF.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\functions\TeMIFProjection.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\functions\TeMIDMIFDriver.h">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\functions\TeMIFProjection.h">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="importMIDMIF"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/te_mysql/te_mysql.lib ../../Debug/te_functions/te_functions.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\importMIDMIF.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/te_mysql/te_mysql.lib ../../Release/te_functions/te_functions.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\importMIDMIF.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="importMIDMIF.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/importShape/.cdtproject b/examples/importShape/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/importShape/.cdtproject
+++ b/examples/importShape/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/importShape/.project b/examples/importShape/.project
old mode 100755
new mode 100644
index 18e927f..d3fd67d
--- a/examples/importShape/.project
+++ b/examples/importShape/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>importShape</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>importShape</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/importShape/Makefile b/examples/importShape/Makefile
old mode 100755
new mode 100644
index 8da1de0..f15e442
--- a/examples/importShape/Makefile
+++ b/examples/importShape/Makefile
@@ -1,32 +1,32 @@
-all: importShape
-
-debug: importShape_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-	
-importShape: terralib
-	qmake -o makeImportShape importShape.pro; \
-	make -f makeImportShape;
-	
-importShape_dbg: terralib_dbg
-	qmake -o makeImportShape.debug importShape.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeImportShape.debug;	
-
-clean:
-	if \
-		test -f makeImportShape; \
-	then \
-		make -f makeImportShape distclean; rm -f makeImportShape; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeImportShape.debug; \
-	then \
-		make -f makeImportShape.debug distclean; rm -f makeImportShape.debug; \
-	fi
-	
+all: importShape
+
+debug: importShape_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+	
+importShape: terralib
+	qmake -o makeImportShape importShape.pro; \
+	make -f makeImportShape;
+	
+importShape_dbg: terralib_dbg
+	qmake -o makeImportShape.debug importShape.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeImportShape.debug;	
+
+clean:
+	if \
+		test -f makeImportShape; \
+	then \
+		make -f makeImportShape distclean; rm -f makeImportShape; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeImportShape.debug; \
+	then \
+		make -f makeImportShape.debug distclean; rm -f makeImportShape.debug; \
+	fi
+	
diff --git a/examples/importShape/importShape.cpp b/examples/importShape/importShape.cpp
old mode 100755
new mode 100644
index 460e3fd..ae2f6f8
--- a/examples/importShape/importShape.cpp
+++ b/examples/importShape/importShape.cpp
@@ -1,132 +1,132 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/* 
-	This file shows an example of importing a shapefile that will create
-	an attribute and a geometry table in a TerraLib database.
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeDriverSHPDBF.h>
-#include <TeMySQL.h>
-
-using namespace std;
-#include <string>
-
-int main()
-{
-	// Open a connection to the "DB320RC1" TerraLib database
-	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	TeMySQL* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	string layerName = "Brasil";
-
-	// Check whether there is a layer with the name Brasil in the database
-	TeLayer *layer = 0;
-	if (db->layerExist(layerName))
-	{
-		cout << "The database already has an infolayer with the name \"";
-		cout << layerName << "\" !" << endl << endl;
-		if (db->loadLayerSet() == true)
-		{
-			// Get the layer named "Brasil" from the cache
-			TeLayerMap& layerMap = db->layerMap();
-			map<int, TeLayer*>::iterator it;
-			for (it = layerMap.begin(); it != layerMap.end(); ++it)
-			{
-				layer = it->second;
-				if (layer->name() == layerName)
-					break;
-			}
-		}
-	}
-	else
-	{
-		// Import the shape file
-		// Define a projection. It cannot be decoded from a shapefile
-		TeDatum sad69 = TeDatumFactory::make("SAD69");
-		TePolyconic* proj = new TePolyconic(sad69, -54.0*TeCDR);
-		layer = new TeLayer(layerName, db, proj);
-	
-		string filename = "../data/EstadosBrasil.shp";	// Shapefile path
-		string tablename = "BrasilIBGE";	// Name of the attribute table
-		string linkcolumn = "SPRROTULO";	// Column that will link the attributes and geometry tables                 
-	
-		if (TeImportShape(layer, filename, tablename, linkcolumn))
-			cout << "The shapefile was imported successfully into the TerraLib database!\n" << endl;
-		else
-		{
-			cout << "Error: Fail to import the shapefile!\n" << endl;
-			db->close();
-			delete db;
-			cout << "Press Enter\n";
-			getchar();
-			return 1;		
-		}
-	}
-
-	// Show some information about the layer associated to the shape file
-	cout << "Layer: " << layer->name() << ", id: " << layer->id() << endl;
-
-	// Geometries information
-	cout << "Projection: " << layer->projection()->name();              
-	cout << "/" << layer->projection()->datum().name();          
-	TeBox bb = layer->box();
-	char message[255];
-	sprintf(message,"[%.15f,%.15f,%.15f,%.15f]\n",bb.x1_, bb.y1_, bb.x2_, bb.y2_);
-	cout << "\nBounding box: " << message;
-	cout << "Number of polygons: " << layer->nGeometries(TePOLYGONS) << endl;
-	cout << "Number of lines: "    << layer->nGeometries(TeLINES) << endl;
-	cout << "Number of points: "   << layer->nGeometries(TePOINTS) << endl;
-
-	// Information of the Tables of Attributes of the Layer
-	TeAttrTableVector tableVec;
-	layer->getAttrTables(tableVec);
-	cout << "Number of Attribute Tables: " << tableVec.size() << endl;
-	
-	for (unsigned int i = 0; i < tableVec.size(); ++i)
-	{
-		cout << "Attribute Table " << "\"" << tableVec[i].name() << "\": ";
-		cout << layer->nObjects(tableVec[i].name()) << " objects" << endl << endl;
-	}
-	
-	db->close();
-	delete db;
-	cout << "Press Enter\n";
-	getchar();
-	return 0;	
-}
-
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+	This file shows an example of importing a shapefile that will create
+	an attribute and a geometry table in a TerraLib database.
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeDriverSHPDBF.h>
+#include <TeMySQL.h>
+
+using namespace std;
+#include <string>
+
+int main()
+{
+	// Open a connection to the "DB320RC1" TerraLib database
+	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	TeMySQL* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	string layerName = "Brasil";
+
+	// Check whether there is a layer with the name Brasil in the database
+	TeLayer *layer = 0;
+	if (db->layerExist(layerName))
+	{
+		cout << "The database already has an infolayer with the name \"";
+		cout << layerName << "\" !" << endl << endl;
+		if (db->loadLayerSet() == true)
+		{
+			// Get the layer named "Brasil" from the cache
+			TeLayerMap& layerMap = db->layerMap();
+			map<int, TeLayer*>::iterator it;
+			for (it = layerMap.begin(); it != layerMap.end(); ++it)
+			{
+				layer = it->second;
+				if (layer->name() == layerName)
+					break;
+			}
+		}
+	}
+	else
+	{
+		// Import the shape file
+		// Define a projection. It cannot be decoded from a shapefile
+		TeDatum sad69 = TeDatumFactory::make("SAD69");
+		TePolyconic* proj = new TePolyconic(sad69, -54.0*TeCDR);
+		layer = new TeLayer(layerName, db, proj);
+	
+		string filename = "../data/EstadosBrasil.shp";	// Shapefile path
+		string tablename = "BrasilIBGE";	// Name of the attribute table
+		string linkcolumn = "SPRROTULO";	// Column that will link the attributes and geometry tables                 
+	
+		if (TeImportShape(layer, filename, tablename, linkcolumn))
+			cout << "The shapefile was imported successfully into the TerraLib database!\n" << endl;
+		else
+		{
+			cout << "Error: Fail to import the shapefile!\n" << endl;
+			db->close();
+			delete db;
+			cout << "Press Enter\n";
+			getchar();
+			return 1;		
+		}
+	}
+
+	// Show some information about the layer associated to the shape file
+	cout << "Layer: " << layer->name() << ", id: " << layer->id() << endl;
+
+	// Geometries information
+	cout << "Projection: " << layer->projection()->name();              
+	cout << "/" << layer->projection()->datum().name();          
+	TeBox bb = layer->box();
+	char message[255];
+	sprintf(message,"[%.15f,%.15f,%.15f,%.15f]\n",bb.x1_, bb.y1_, bb.x2_, bb.y2_);
+	cout << "\nBounding box: " << message;
+	cout << "Number of polygons: " << layer->nGeometries(TePOLYGONS) << endl;
+	cout << "Number of lines: "    << layer->nGeometries(TeLINES) << endl;
+	cout << "Number of points: "   << layer->nGeometries(TePOINTS) << endl;
+
+	// Information of the Tables of Attributes of the Layer
+	TeAttrTableVector tableVec;
+	layer->getAttrTables(tableVec);
+	cout << "Number of Attribute Tables: " << tableVec.size() << endl;
+	
+	for (unsigned int i = 0; i < tableVec.size(); ++i)
+	{
+		cout << "Attribute Table " << "\"" << tableVec[i].name() << "\": ";
+		cout << layer->nObjects(tableVec[i].name()) << " objects" << endl << endl;
+	}
+	
+	db->close();
+	delete db;
+	cout << "Press Enter\n";
+	getchar();
+	return 0;	
+}
+
+ 
diff --git a/examples/importShape/importShape.dsp b/examples/importShape/importShape.dsp
old mode 100755
new mode 100644
index 41b02c7..dce9949
--- a/examples/importShape/importShape.dsp
+++ b/examples/importShape/importShape.dsp
@@ -1,126 +1,126 @@
-# Microsoft Developer Studio Project File - Name="importShape" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=importShape - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "importShape.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "importShape.mak" CFG="importShape - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "importShape - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "importShape - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "importShape - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include"  /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\sr [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importShape.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "importShape - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importSha [...]
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "importShape - Win32 Release"
-# Name "importShape - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\importShape.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportDBF.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportSHP.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportExport.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="importShape" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=importShape - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "importShape.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "importShape.mak" CFG="importShape - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "importShape - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "importShape - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "importShape - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include"  /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\sr [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/importShape.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "importShape - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/importSha [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "importShape - Win32 Release"
+# Name "importShape - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\importShape.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportDBF.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportSHP.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportExport.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/importShape/importShape.dsw b/examples/importShape/importShape.dsw
old mode 100755
new mode 100644
index 257c57a..ac92aea
--- a/examples/importShape/importShape.dsw
+++ b/examples/importShape/importShape.dsw
@@ -1,62 +1,62 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "importShape"=.\importShape.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "shapelib"=..\..\terralibw\shapelib\shapelib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name shapelib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "importShape"=.\importShape.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "shapelib"=..\..\terralibw\shapelib\shapelib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name shapelib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/importShape/importShape.pro b/examples/importShape/importShape.pro
old mode 100755
new mode 100644
index 4d24dd8..47236cd
--- a/examples/importShape/importShape.pro
+++ b/examples/importShape/importShape.pro
@@ -1,12 +1,9 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	importShape.cpp \
-	../../src/terralib/drivers/shapelib/TeDriverSHPDBF.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h \
-	../../src/terralib/drivers/shapelib/TeDriverSHPDBF.h 
-
-	
+TARGET = importShape
+
+include( ../base/base.pro )
+
+LIBS += -lte_shapelib
+
+SOURCES	+= \
+	importShape.cpp
+	
diff --git a/examples/importShape/importShape.sln b/examples/importShape/importShape.sln
old mode 100755
new mode 100644
diff --git a/examples/importShape/importShape.vcproj b/examples/importShape/importShape.vcproj
old mode 100755
new mode 100644
index 8555e5b..4a2319a
--- a/examples/importShape/importShape.vcproj
+++ b/examples/importShape/importShape.vcproj
@@ -1,170 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="importShape"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib;..\..\src\terralib\drivers\shapelib"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\importShape.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\shapelib;..\..\src\shapelib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\importShape.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="importShape.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\shapelib\TeDriverSHPDBF.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\shapelib\TeDriverSHPDBF.h">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="importShape"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib;..\..\src\terralib\drivers\shapelib"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../Debug/te_shapelib/te_shapelib.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\importShape.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\shapelib;..\..\src\shapelib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../Release/te_shapelib/te_shapelib.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\importShape.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="importShape.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/mosaicTIFFImages/.cdtproject b/examples/mosaicTIFFImages/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/mosaicTIFFImages/.cdtproject
+++ b/examples/mosaicTIFFImages/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/mosaicTIFFImages/.project b/examples/mosaicTIFFImages/.project
old mode 100755
new mode 100644
index edf9336..ba21e3f
--- a/examples/mosaicTIFFImages/.project
+++ b/examples/mosaicTIFFImages/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>mosaicTIFFImages</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>mosaicTIFFImages</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/mosaicTIFFImages/Makefile b/examples/mosaicTIFFImages/Makefile
old mode 100755
new mode 100644
index a084456..7969fd8
--- a/examples/mosaicTIFFImages/Makefile
+++ b/examples/mosaicTIFFImages/Makefile
@@ -1,33 +1,33 @@
-all: mosaicTIFFImages
-
-debug: mosaicTIFFImages_dbg
-
-tiff:
-	cd ../../terralibx/tiff; make
-
-terralib:
-	cd ../../terralibx/terralib; make
-	
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-mosaicTIFFImages:  tiff terralib 
-	qmake -o makeMosaicTIFFImages mosaicTIFFImages.pro; make -f makeMosaicTIFFImages
-
-mosaicTIFFImages_dbg:  tiff terralib_dbg 
-	qmake -o makeMosaicTIFFImages.debug mosaicTIFFImages.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeMosaicTIFFImages.debug
-
-clean:
-	if \
-		test -f makeMosaicTIFFImages; \
-	then \
-		make -f makeMosaicTIFFImages distclean; rm -f makeMosaicTIFFImages; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeMosaicTIFFImages.debug; \
-	then \
-		make -f makeMosaicTIFFImagesdebug distclean; rm -f makeMosaicTIFFImages.debug; \
+all: mosaicTIFFImages
+
+debug: mosaicTIFFImages_dbg
+
+tiff:
+	cd ../../terralibx/tiff; make
+
+terralib:
+	cd ../../terralibx/terralib; make
+	
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+mosaicTIFFImages:  tiff terralib 
+	qmake -o makeMosaicTIFFImages mosaicTIFFImages.pro; make -f makeMosaicTIFFImages
+
+mosaicTIFFImages_dbg:  tiff terralib_dbg 
+	qmake -o makeMosaicTIFFImages.debug mosaicTIFFImages.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeMosaicTIFFImages.debug
+
+clean:
+	if \
+		test -f makeMosaicTIFFImages; \
+	then \
+		make -f makeMosaicTIFFImages distclean; rm -f makeMosaicTIFFImages; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeMosaicTIFFImages.debug; \
+	then \
+		make -f makeMosaicTIFFImagesdebug distclean; rm -f makeMosaicTIFFImages.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/mosaicTIFFImages/mosaicTIFFImages.cpp b/examples/mosaicTIFFImages/mosaicTIFFImages.cpp
old mode 100755
new mode 100644
index 3e97df8..ed529aa
--- a/examples/mosaicTIFFImages/mosaicTIFFImages.cpp
+++ b/examples/mosaicTIFFImages/mosaicTIFFImages.cpp
@@ -1,134 +1,134 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows an example of how to build a mosaic of two images  
-	in GeoTiff format in a layer of a TerraLib database.
-
-	Author: Lubia Vinhas  
-*/
-
-#include <TeDatabase.h>
-#include <TeMySQL.h>
-#include <TeInitRasterDecoders.h>
-#include <TeImportRaster.h>
-
-int main()
-{
-	// Initialize the raster decoder tool
-	TeInitRasterDecoders();
-
-	// Access the input images
-	TeRaster img1("../data/nat1.tif");
-	if (!img1.init())
-	{
-		cout << "Cannot access the first input image!" << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	TeRaster img2("../data/nat2.tif");
-	if (!img2.init())
-	{
-		cout << "Cannot access the second input image!" << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-    // Database server parameters
-     string host = "localhost";
-     string dbname = "DB320RC1";
-     string user = "root";
-     string password = "vinhas";
-
-     // Connect to the database
-     TeDatabase* db = new TeMySQL();
-     if (!db->connect(host, user, password, dbname))
-     {
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		return 1;
-     }
-
-	// Creates a layer to receive the raster geometry (same projection as raster data)
-	string layerName = "NatividadeMosaic";
-
-	// Check whether there is a layer with this name in the database
-	if (db->layerExist(layerName))
-	{
-		db->close();
-		cout << "The database already has an infolayer with the name \"";
-		cout << layerName << "\"!" << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	TeLayer* layer = new TeLayer(layerName, db, img1.projection());
-	if (layer->id() <= 0)
-	{
-		db->close();
-		cout << "The destination layer could not be created!\n" << db->errorMessage() << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Import the first image to the layer
-	if (!TeImportRaster(layer,&img1,256,256,TeRasterParams::TeNoCompression,"",255,true,TeRasterParams::TeExpansible))
-	{
-		db->close();
-		cout << "Fail to import the first image\n\n!";
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	else
-		cout << "The first image was imported successfully!\n\n"; 
-
-	delete layer;
-	layer = 0;
-
-	layer = new TeLayer(layerName, db);
-
-	// Mosaic the second raster to the same layer
-	if (!TeImportRaster(layer, &img2, 256, 256, TeRasterParams::TeNoCompression, "", 255, true, TeRasterParams::TeExpansible))
-	{
-		db->close();
-		cout << "Fail to import the second image\n\n!";
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	else
-		cout << "The second image was added successfully!" << endl << endl;
-
-	// Close the database
-	db->close();
-	cout << "\nPress enter...";
-	getchar();
-	return 0;
-}
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows an example of how to build a mosaic of two images  
+	in GeoTiff format in a layer of a TerraLib database.
+
+	Author: Lubia Vinhas  
+*/
+
+#include <TeDatabase.h>
+#include <TeMySQL.h>
+#include <TeInitRasterDecoders.h>
+#include <TeImportRaster.h>
+
+int main()
+{
+	// Initialize the raster decoder tool
+	TeInitRasterDecoders();
+
+	// Access the input images
+	TeRaster img1("../data/nat1.tif");
+	if (!img1.init())
+	{
+		cout << "Cannot access the first input image!" << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	TeRaster img2("../data/nat2.tif");
+	if (!img2.init())
+	{
+		cout << "Cannot access the second input image!" << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+    // Database server parameters
+     string host = "localhost";
+     string dbname = "DB320RC1";
+     string user = "root";
+     string password = "vinhas";
+
+     // Connect to the database
+     TeDatabase* db = new TeMySQL();
+     if (!db->connect(host, user, password, dbname))
+     {
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		return 1;
+     }
+
+	// Creates a layer to receive the raster geometry (same projection as raster data)
+	string layerName = "NatividadeMosaic";
+
+	// Check whether there is a layer with this name in the database
+	if (db->layerExist(layerName))
+	{
+		db->close();
+		cout << "The database already has an infolayer with the name \"";
+		cout << layerName << "\"!" << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	TeLayer* layer = new TeLayer(layerName, db, img1.projection());
+	if (layer->id() <= 0)
+	{
+		db->close();
+		cout << "The destination layer could not be created!\n" << db->errorMessage() << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Import the first image to the layer
+	if (!TeImportRaster(layer,&img1,256,256,TeRasterParams::TeNoCompression,"",255,true,TeRasterParams::TeExpansible))
+	{
+		db->close();
+		cout << "Fail to import the first image\n\n!";
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	else
+		cout << "The first image was imported successfully!\n\n"; 
+
+	delete layer;
+	layer = 0;
+
+	layer = new TeLayer(layerName, db);
+
+	// Mosaic the second raster to the same layer
+	if (!TeImportRaster(layer, &img2, 256, 256, TeRasterParams::TeNoCompression, "", 255, true, TeRasterParams::TeExpansible))
+	{
+		db->close();
+		cout << "Fail to import the second image\n\n!";
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	else
+		cout << "The second image was added successfully!" << endl << endl;
+
+	// Close the database
+	db->close();
+	cout << "\nPress enter...";
+	getchar();
+	return 0;
+}
+ 
diff --git a/examples/mosaicTIFFImages/mosaicTIFFImages.dsp b/examples/mosaicTIFFImages/mosaicTIFFImages.dsp
old mode 100755
new mode 100644
index 15cc9d3..37601fc
--- a/examples/mosaicTIFFImages/mosaicTIFFImages.dsp
+++ b/examples/mosaicTIFFImages/mosaicTIFFImages.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="mosaicTIFFImages" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=mosaicTIFFImages - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "mosaicTIFFImages.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "mosaicTIFFImages.mak" CFG="mosaicTIFFImages - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "mosaicTIFFImages - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "mosaicTIFFImages - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "mosaicTIFFImages - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drive [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\freetype\Release\freetype.lib ..\..\terralibw\tiff\Release\tiff.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\Postg [...]
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "mosaicTIFFImages - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terra [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\freetype\Debug\freetype.lib ..\..\terralibw\tiff\Debug\tiff.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\li [...]
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "mosaicTIFFImages - Win32 Release"
-# Name "mosaicTIFFImages - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\mosaicTIFFImages.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="mosaicTIFFImages" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=mosaicTIFFImages - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "mosaicTIFFImages.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "mosaicTIFFImages.mak" CFG="mosaicTIFFImages - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "mosaicTIFFImages - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "mosaicTIFFImages - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "mosaicTIFFImages - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drive [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\freetype\Release\freetype.lib ..\..\terralibw\tiff\Release\tiff.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\Postg [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "mosaicTIFFImages - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terra [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\freetype\Debug\freetype.lib ..\..\terralibw\tiff\Debug\tiff.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\li [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "mosaicTIFFImages - Win32 Release"
+# Name "mosaicTIFFImages - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\mosaicTIFFImages.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/mosaicTIFFImages/mosaicTIFFImages.dsw b/examples/mosaicTIFFImages/mosaicTIFFImages.dsw
old mode 100755
new mode 100644
index c19b27b..25f3263
--- a/examples/mosaicTIFFImages/mosaicTIFFImages.dsw
+++ b/examples/mosaicTIFFImages/mosaicTIFFImages.dsw
@@ -1,29 +1,29 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "mosaicTIFFImages"=".\mosaicTIFFImages.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "mosaicTIFFImages"=".\mosaicTIFFImages.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/mosaicTIFFImages/mosaicTIFFImages.pro b/examples/mosaicTIFFImages/mosaicTIFFImages.pro
old mode 100755
new mode 100644
index 3d0dc15..e8a7fb2
--- a/examples/mosaicTIFFImages/mosaicTIFFImages.pro
+++ b/examples/mosaicTIFFImages/mosaicTIFFImages.pro
@@ -1,10 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	mosaicTIFFImages.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
-
+TARGET = mosaicTIFFImages
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	mosaicTIFFImages.cpp 
+	
+
diff --git a/examples/mosaicTIFFImages/mosaicTIFFImages.sln b/examples/mosaicTIFFImages/mosaicTIFFImages.sln
old mode 100755
new mode 100644
diff --git a/examples/mosaicTIFFImages/mosaicTIFFImages.vcproj b/examples/mosaicTIFFImages/mosaicTIFFImages.vcproj
old mode 100755
new mode 100644
index 83b7123..d18b2a2
--- a/examples/mosaicTIFFImages/mosaicTIFFImages.vcproj
+++ b/examples/mosaicTIFFImages/mosaicTIFFImages.vcproj
@@ -1,167 +1,161 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="mosaicTIFFImages"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\mosaicTIFFImages.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE"
-				GeneratePreprocessedFile="0"
-				StringPooling="TRUE"
-				MinimalRebuild="FALSE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="TRUE"
-				EnableFunctionLevelLinking="TRUE"
-				RuntimeTypeInfo="FALSE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\mosaicTIFFImages.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="mosaicTIFFImages.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="mosaicTIFFImages"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\mosaicTIFFImages.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE"
+				GeneratePreprocessedFile="0"
+				StringPooling="TRUE"
+				MinimalRebuild="FALSE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="TRUE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="FALSE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\mosaicTIFFImages.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="mosaicTIFFImages.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/proxMatrixAndSpatialStatistics/.cdtproject b/examples/proxMatrixAndSpatialStatistics/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/proxMatrixAndSpatialStatistics/.cdtproject
+++ b/examples/proxMatrixAndSpatialStatistics/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/proxMatrixAndSpatialStatistics/.project b/examples/proxMatrixAndSpatialStatistics/.project
old mode 100755
new mode 100644
index 4183b49..a36c570
--- a/examples/proxMatrixAndSpatialStatistics/.project
+++ b/examples/proxMatrixAndSpatialStatistics/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>proxMatrixAndSpatialStatistics</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>proxMatrixAndSpatialStatistics</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/proxMatrixAndSpatialStatistics/Makefile b/examples/proxMatrixAndSpatialStatistics/Makefile
old mode 100755
new mode 100644
index 150ad4c..590cea4
--- a/examples/proxMatrixAndSpatialStatistics/Makefile
+++ b/examples/proxMatrixAndSpatialStatistics/Makefile
@@ -1,33 +1,33 @@
-all: proxMatrixAndSpatialStatistics
-
-debug: proxMatrixAndSpatialStatistics_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-	
-stat:
-	cd ../../terralibx/stat; make
-
-proxMatrixAndSpatialStatistics: terralib stat
-	qmake -o makeProxMatrixAndSpatialStatistics proxMatrixAndSpatialStatistics.pro; make -f makeProxMatrixAndSpatialStatistics
-
-proxMatrixAndSpatialStatistics_dbg: terralib_dbg stat
-	qmake -o makeProxMatrixAndSpatialStatistics.debug proxMatrixAndSpatialStatistics.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeProxMatrixAndSpatialStatistics.debug
-
-clean:
-	if \
-		test -f makeProxMatrixAndSpatialStatistics; \
-	then \
-		make -f makeProxMatrixAndSpatialStatistics distclean; rm -f makeProxMatrixAndSpatialStatistics; \
-	fi
-	
-clean:
-	if \
-		test -f makeProxMatrixAndSpatialStatistics.debug; \
-	then \
-		make -f makeProxMatrixAndSpatialStatistics.debug distclean; rm -f makeProxMatrixAndSpatialStatistics.debug; \
+all: proxMatrixAndSpatialStatistics
+
+debug: proxMatrixAndSpatialStatistics_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+	
+stat:
+	cd ../../terralibx/stat; make
+
+proxMatrixAndSpatialStatistics: terralib stat
+	qmake -o makeProxMatrixAndSpatialStatistics proxMatrixAndSpatialStatistics.pro; make -f makeProxMatrixAndSpatialStatistics
+
+proxMatrixAndSpatialStatistics_dbg: terralib_dbg stat
+	qmake -o makeProxMatrixAndSpatialStatistics.debug proxMatrixAndSpatialStatistics.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeProxMatrixAndSpatialStatistics.debug
+
+clean:
+	if \
+		test -f makeProxMatrixAndSpatialStatistics; \
+	then \
+		make -f makeProxMatrixAndSpatialStatistics distclean; rm -f makeProxMatrixAndSpatialStatistics; \
+	fi
+	
+clean:
+	if \
+		test -f makeProxMatrixAndSpatialStatistics.debug; \
+	then \
+		make -f makeProxMatrixAndSpatialStatistics.debug distclean; rm -f makeProxMatrixAndSpatialStatistics.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.cpp b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.cpp
old mode 100755
new mode 100644
index 6ee730e..472d3a2
--- a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.cpp
+++ b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.cpp
@@ -1,154 +1,154 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-   This file illustrates an example of how to create a proximity matrix from a 
-   Spatial Temporal Element Set (STElementSet) and calculate spatial statistics.  
-   In this example, the adjacency strategy is used to construct the matrix.   
-
-   Author: Karine Reis   
-*/
-
-#include <TeSTElementSet.h>
-#include <TeSTEFunctionsDB.h>
-#include <TeGeneralizedProxMatrix.h>
-#include <TeSpatialStatistics.h>
-#include <TeMySQL.h>
-
-int main()
-{	
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to the DB320RC1 MySQL database 
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
-		
-	
-	// Opens a connection to a TerraLib database 
-    	// Loads a layer named DistritosSaoPaulo 
-	TeLayer* DistritosSP =  new TeLayer("Distritos");
-	if (!db->loadLayer(DistritosSP))
-	{
-	    cout << "Fail to load the layer!" << db->errorMessage() << endl;
-		db->close();
-		cout << endl << "Press Enter\n";
-		getchar();
-        	return 1;
-	}
-
-	// Creates a STElementSet from DistritosSP layer 
-	TeSTElementSet steSet(DistritosSP);
-
-	// Fills the STElementSet only with the attribute "Populac" to calculate statistics 
-	//and without geometries
-	vector<string> attrs;
-	attrs.push_back ("Distritos.Pop91");
-
-	if(!TeSTOSetBuildDB(&steSet, false, false, attrs))
-	{
-		cout << "Error! " << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	
-	// Shows how many elements the elementSet has
-	cout << "Number of elements: " <<  steSet.numElements() << endl;
-
-	// Constructs the proximity matrix
-	TeProxMatrixLocalAdjacencyStrategy			sc_adj (&steSet, TePOLYGONS);
-	TeGeneralizedProxMatrix<TeSTElementSet>		proxMat(&sc_adj);
-	
-	cout << "Calculating the proximity matrix..." << endl;
-	if(!proxMat.constructMatrix())
-	{
-		cout << "Error building proximity matrix! " << endl;
-		return 1;
-	}
-
-	// Calculates the global mean
-	double mean = TeFirstMoment (steSet.begin(), steSet.end(), 0); 
-	cout << "Global mean " << mean << endl << endl;
-
-	// Calculates the desviations (Z) to each object and keeps them
-	// in the STElementSet
-	if(!TeDeviation (steSet.begin(), steSet.end(), mean))
-	{
-		cout << "Error calculating Z! " << endl;
-		return 1;
-	}   
-	
-	// Index of the Z (desviations) attribute in the STElementSet
-	int indexZ = 1;  
-
-	// Calculates the local mean (WZ) to each object and keeps them
-	// in the STElementSet
-	if(!TeLocalMean (&steSet, &proxMat, indexZ))
-	{
-		cout << "Error calculating Local Mean! " << endl;
-		return 1;
-	}
-
-	// Index of the WZ (local mean) attribute in the STElementSet
-	int indexWZ = 2;
-
-	// Shows the Z and WZ generated for each object
-	TeSTElementSet::iterator it = steSet.begin();
-	while ( it != steSet.end())
-	{
-		TeSTInstance obj = (*it);
-		
-      //Gets attribute value
-		string valZ, valWZ;
-		obj.getPropertyValue(valZ, indexZ);
-		obj.getPropertyValue(valWZ, indexWZ);
-		cout << " Object Identifier :  " << obj.objectId() << endl; 
-		cout << " Z		:  " << valZ   << endl; 
-		cout << " WZ	:  " << valWZ  << endl << endl; 
-		++it;
-	}
-
-	// Inserts the generated attributes (Z and WZ) in the DistritosSP 
-	// table 
-	if(!TeUpdateDBFromSet (&steSet, "Distritos"))
-	{
-		cout << "Error updating database! " << endl;
-		return 1;
-	}
-	
-	db->close();
-	cout << endl << "Press Enter\n";
-	getchar();
-	return 0;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+   This file illustrates an example of how to create a proximity matrix from a 
+   Spatial Temporal Element Set (STElementSet) and calculate spatial statistics.  
+   In this example, the adjacency strategy is used to construct the matrix.   
+
+   Author: Karine Reis   
+*/
+
+#include <TeSTElementSet.h>
+#include <TeSTEFunctionsDB.h>
+#include <TeGeneralizedProxMatrix.h>
+#include <TeSpatialStatistics.h>
+#include <TeMySQL.h>
+
+int main()
+{	
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+		
+	
+	// Opens a connection to a TerraLib database 
+    	// Loads a layer named DistritosSaoPaulo 
+	TeLayer* DistritosSP =  new TeLayer("Distritos");
+	if (!db->loadLayer(DistritosSP))
+	{
+	    cout << "Fail to load the layer!" << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+        	return 1;
+	}
+
+	// Creates a STElementSet from DistritosSP layer 
+	TeSTElementSet steSet(DistritosSP);
+
+	// Fills the STElementSet only with the attribute "Populac" to calculate statistics 
+	//and without geometries
+	vector<string> attrs;
+	attrs.push_back ("Distritos.Pop91");
+
+	if(!TeSTOSetBuildDB(&steSet, false, false, attrs))
+	{
+		cout << "Error! " << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	
+	// Shows how many elements the elementSet has
+	cout << "Number of elements: " <<  steSet.numElements() << endl;
+
+	// Constructs the proximity matrix
+	TeProxMatrixLocalAdjacencyStrategy			sc_adj (&steSet, TePOLYGONS);
+	TeGeneralizedProxMatrix<TeSTElementSet>		proxMat(&sc_adj);
+	
+	cout << "Calculating the proximity matrix..." << endl;
+	if(!proxMat.constructMatrix())
+	{
+		cout << "Error building proximity matrix! " << endl;
+		return 1;
+	}
+
+	// Calculates the global mean
+	double mean = TeFirstMoment (steSet.begin(), steSet.end(), 0); 
+	cout << "Global mean " << mean << endl << endl;
+
+	// Calculates the desviations (Z) to each object and keeps them
+	// in the STElementSet
+	if(!TeDeviation (steSet.begin(), steSet.end(), mean))
+	{
+		cout << "Error calculating Z! " << endl;
+		return 1;
+	}   
+	
+	// Index of the Z (desviations) attribute in the STElementSet
+	int indexZ = 1;  
+
+	// Calculates the local mean (WZ) to each object and keeps them
+	// in the STElementSet
+	if(!TeLocalMean (&steSet, &proxMat, indexZ))
+	{
+		cout << "Error calculating Local Mean! " << endl;
+		return 1;
+	}
+
+	// Index of the WZ (local mean) attribute in the STElementSet
+	int indexWZ = 2;
+
+	// Shows the Z and WZ generated for each object
+	TeSTElementSet::iterator it = steSet.begin();
+	while ( it != steSet.end())
+	{
+		TeSTInstance obj = (*it);
+		
+      //Gets attribute value
+		string valZ, valWZ;
+		obj.getPropertyValue(valZ, indexZ);
+		obj.getPropertyValue(valWZ, indexWZ);
+		cout << " Object Identifier :  " << obj.objectId() << endl; 
+		cout << " Z		:  " << valZ   << endl; 
+		cout << " WZ	:  " << valWZ  << endl << endl; 
+		++it;
+	}
+
+	// Inserts the generated attributes (Z and WZ) in the DistritosSP 
+	// table 
+	if(!TeUpdateDBFromSet (&steSet, "Distritos"))
+	{
+		cout << "Error updating database! " << endl;
+		return 1;
+	}
+	
+	db->close();
+	cout << endl << "Press Enter\n";
+	getchar();
+	return 0;
+}
diff --git a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.dsp b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.dsp
old mode 100755
new mode 100644
index 042244a..f725c76
--- a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.dsp
+++ b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.dsp
@@ -1,122 +1,122 @@
-# Microsoft Developer Studio Project File - Name="proxMatrixAndSpatialStatistics" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=proxMatrixAndSpatialStatistics - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "proxMatrixAndSpatialStatistics.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "proxMatrixAndSpatialStatistics.mak" CFG="proxMatrixAndSpatialStatistics - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "proxMatrixAndSpatialStatistics - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "proxMatrixAndSpatialStatistics - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "proxMatrixAndSpatialStatistics - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib  /nologo /subsystem:console /machine:I386 /out:"../Release/proxMatrixAndSpatialStatistics.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "proxMatrixAndSpatialStatistics - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/proxMatrixAndSpatialStatistics.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "proxMatrixAndSpatialStatistics - Win32 Release"
-# Name "proxMatrixAndSpatialStatistics - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\proxMatrixAndSpatialStatistics.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\stat\TeSpatialStatistics.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\stat\TeSpatialStatistics.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="proxMatrixAndSpatialStatistics" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=proxMatrixAndSpatialStatistics - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "proxMatrixAndSpatialStatistics.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "proxMatrixAndSpatialStatistics.mak" CFG="proxMatrixAndSpatialStatistics - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "proxMatrixAndSpatialStatistics - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "proxMatrixAndSpatialStatistics - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "proxMatrixAndSpatialStatistics - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib  /nologo /subsystem:console /machine:I386 /out:"../Release/proxMatrixAndSpatialStatistics.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "proxMatrixAndSpatialStatistics - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/proxMatrixAndSpatialStatistics.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "proxMatrixAndSpatialStatistics - Win32 Release"
+# Name "proxMatrixAndSpatialStatistics - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\proxMatrixAndSpatialStatistics.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\stat\TeSpatialStatistics.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\stat\TeSpatialStatistics.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.dsw b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.dsw
old mode 100755
new mode 100644
index 870c115..dff133c
--- a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.dsw
+++ b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.dsw
@@ -1,44 +1,44 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "proxMatrixAndSpatialStatistics"=.\proxMatrixAndSpatialStatistics.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "proxMatrixAndSpatialStatistics"=.\proxMatrixAndSpatialStatistics.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.pro b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.pro
old mode 100755
new mode 100644
index a9e765d..689c99e
--- a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.pro
+++ b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.pro
@@ -1,9 +1,6 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	proxMatrixAndSpatialStatistics.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
+TARGET = proxMatrixAnsSpatialStatistics
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	proxMatrixAndSpatialStatistics.cpp
\ No newline at end of file
diff --git a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.sln b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.sln
old mode 100755
new mode 100644
diff --git a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.vcproj b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.vcproj
old mode 100755
new mode 100644
index f08c218..6e71f81
--- a/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.vcproj
+++ b/examples/proxMatrixAndSpatialStatistics/proxMatrixAndSpatialStatistics.vcproj
@@ -1,203 +1,177 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="proxMatrixAndSpatialStatistics"
-	ProjectGUID="{38377F38-0982-4920-99D7-370934E022B2}"
-	SccProjectName=""
-	SccLocalPath="">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\stat;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				PrecompiledHeaderFile=".\Debug/proxMatrixAndSpatialStatistics.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Debug/proxMatrixAndSpatialStatistics.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=".\Debug/proxMatrixAndSpatialStatistics.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Debug/proxMatrixAndSpatialStatistics.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\stat;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				PrecompiledHeaderFile=".\Release/proxMatrixAndSpatialStatistics.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Release/proxMatrixAndSpatialStatistics.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				ProgramDatabaseFile=".\Release/proxMatrixAndSpatialStatistics.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Release/proxMatrixAndSpatialStatistics.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="proxMatrixAndSpatialStatistics.cpp">
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\stat\TeSpatialStatistics.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="proxMatrixAndSpatialStatistics"
+	ProjectGUID="{38377F38-0982-4920-99D7-370934E022B2}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\stat;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/proxMatrixAndSpatialStatistics.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/proxMatrixAndSpatialStatistics.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/proxMatrixAndSpatialStatistics.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/proxMatrixAndSpatialStatistics.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\stat;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/proxMatrixAndSpatialStatistics.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/proxMatrixAndSpatialStatistics.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/proxMatrixAndSpatialStatistics.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/proxMatrixAndSpatialStatistics.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="proxMatrixAndSpatialStatistics.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/querierFromLayer/.cdtproject b/examples/querierFromLayer/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/querierFromLayer/.cdtproject
+++ b/examples/querierFromLayer/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/querierFromLayer/.project b/examples/querierFromLayer/.project
old mode 100755
new mode 100644
index 627ab9e..ddedfcf
--- a/examples/querierFromLayer/.project
+++ b/examples/querierFromLayer/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>querierFromLayer</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>querierFromLayer</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/querierFromLayer/Makefile b/examples/querierFromLayer/Makefile
old mode 100755
new mode 100644
index b1056f9..b8cd69b
--- a/examples/querierFromLayer/Makefile
+++ b/examples/querierFromLayer/Makefile
@@ -1,30 +1,30 @@
-all: querierFromLayer
-
-debug: querierFromLayer_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-	
-querierFromLayer: terralib
-	qmake -o makeQuerierFromLayer querierFromLayer.pro; make -f makeQuerierFromLayer
-
-querierFromLayer_dbg: terralib_dbg
-	qmake -o makeQuerierFromLayer.debug querierFromLayer.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeQuerierFromLayer.debug
-
-clean:
-	if \
-		test -f makeQuerierFromLayer; \
-	then \
-		make -f makeQuerierFromLayer distclean; rm -f makeQuerierFromLayer; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeQuerierFromLayer.debug; \
-	then \
-		make -f makeQuerierFromLayer.debug distclean; rm -f makeQuerierFromLayer.debug; \
+all: querierFromLayer
+
+debug: querierFromLayer_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+	
+querierFromLayer: terralib
+	qmake -o makeQuerierFromLayer querierFromLayer.pro; make -f makeQuerierFromLayer
+
+querierFromLayer_dbg: terralib_dbg
+	qmake -o makeQuerierFromLayer.debug querierFromLayer.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeQuerierFromLayer.debug
+
+clean:
+	if \
+		test -f makeQuerierFromLayer; \
+	then \
+		make -f makeQuerierFromLayer distclean; rm -f makeQuerierFromLayer; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeQuerierFromLayer.debug; \
+	then \
+		make -f makeQuerierFromLayer.debug distclean; rm -f makeQuerierFromLayer.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/querierFromLayer/querierFromLayer.cpp b/examples/querierFromLayer/querierFromLayer.cpp
old mode 100755
new mode 100644
index 607ea51..e42cf52
--- a/examples/querierFromLayer/querierFromLayer.cpp
+++ b/examples/querierFromLayer/querierFromLayer.cpp
@@ -1,120 +1,120 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/* 
-   This example shows how to use a querier from layer.
-   
-   Author: Karine Reis 
-*/
-
-#include "TeMySQL.h"
-#include "TeQuerier.h"
-#include "TeQuerierParams.h"
-
-#include <time.h>
-#include <iostream>
-
-using std::cout;
-
-int 
-main()
-{	
-	
-	// Datatabase server parameters
-     string host = "localhost";
-     string dbname = "DB320RC1";
-     string user = "root";
-     string pass = "vinhas";
-
-	 // Connects to database
-     TeDatabase* db_ = new TeMySQL();
-     if (!db_->connect(host,user,pass,dbname))
-     {
-         cout << "Error: " << db_->errorMessage() << endl;
-		 getchar();
-         return 1;
-     }
-
-	// Load the layer 
-	TeLayer* ocorrencias = new TeLayer("Cadastro_Escolas");
-	if (!db_->loadLayer(ocorrencias))
-    {
-        cout << "Error: " << db_->errorMessage() << endl; 
-		db_->close(); 
-		getchar();
-        return 1;
-    }
-		
-	bool loadAllAttributes = true;
-	bool loadGeometries = false;
-
-	// Set querier parameters - load all attributes and no geometries of the layer "ocorrencias"
-	TeQuerierParams querierParams(loadGeometries, loadAllAttributes);
-	querierParams.setParams(ocorrencias);
-
-	TeQuerier  querier(querierParams);
-
-	// Load instances from layer based in the querier parameters 
-	if(!querier.loadInstances())
-	{
-		cout << "Error loading instances... " << endl; 
-		db_->close(); 
-        return 1;
-	}
-
-	// Return a list of the loaded attributes  
-	TeAttributeList attrList = querier.getAttrList(); 
-	
-	cout << " Loaded Attributes  -------------------  " << endl;
-	
-	// Plot the attribute names 
-	for(unsigned int i=0; i<attrList.size(); ++i)
-		cout << attrList[i].rep_.name_ << endl; 
-	
-	cout << endl;
-	
-	// Traverse all the instances 
-	TeSTInstance sti;
-	while(querier.fetchInstance(sti))
-	{
-		cout << " Object: " << sti.objectId() << " --------------------------- " << endl << endl;
-	
-		// Plot each attribute, its name and value
-		TePropertyVector vec = sti.getPropertyVector();
-		for(unsigned int i=0; i<vec.size(); ++i)
-		{
-			string  attrName = vec[i].attr_.rep_.name_;
-			string  attrValue = vec[i].value_;
-			cout << attrName  << " : " << attrValue << endl;
-
-		}
-	}
-
-	cout << endl << " Press enter! " << endl;
-	getchar(); 
-	db_->close ();
-	return 0;
-}
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+   This example shows how to use a querier from layer.
+   
+   Author: Karine Reis 
+*/
+
+#include "TeMySQL.h"
+#include "TeQuerier.h"
+#include "TeQuerierParams.h"
+
+#include <time.h>
+#include <iostream>
+
+using std::cout;
+
+int 
+main()
+{	
+	
+	// Datatabase server parameters
+     string host = "localhost";
+     string dbname = "DB320RC1";
+     string user = "root";
+     string pass = "vinhas";
+
+	 // Connects to database
+     TeDatabase* db_ = new TeMySQL();
+     if (!db_->connect(host,user,pass,dbname))
+     {
+         cout << "Error: " << db_->errorMessage() << endl;
+		 getchar();
+         return 1;
+     }
+
+	// Load the layer 
+	TeLayer* ocorrencias = new TeLayer("Cadastro_Escolas");
+	if (!db_->loadLayer(ocorrencias))
+    {
+        cout << "Error: " << db_->errorMessage() << endl; 
+		db_->close(); 
+		getchar();
+        return 1;
+    }
+		
+	bool loadAllAttributes = true;
+	bool loadGeometries = false;
+
+	// Set querier parameters - load all attributes and no geometries of the layer "ocorrencias"
+	TeQuerierParams querierParams(loadGeometries, loadAllAttributes);
+	querierParams.setParams(ocorrencias);
+
+	TeQuerier  querier(querierParams);
+
+	// Load instances from layer based in the querier parameters 
+	if(!querier.loadInstances())
+	{
+		cout << "Error loading instances... " << endl; 
+		db_->close(); 
+        return 1;
+	}
+
+	// Return a list of the loaded attributes  
+	TeAttributeList attrList = querier.getAttrList(); 
+	
+	cout << " Loaded Attributes  -------------------  " << endl;
+	
+	// Plot the attribute names 
+	for(unsigned int i=0; i<attrList.size(); ++i)
+		cout << attrList[i].rep_.name_ << endl; 
+	
+	cout << endl;
+	
+	// Traverse all the instances 
+	TeSTInstance sti;
+	while(querier.fetchInstance(sti))
+	{
+		cout << " Object: " << sti.objectId() << " --------------------------- " << endl << endl;
+	
+		// Plot each attribute, its name and value
+		TePropertyVector vec = sti.getPropertyVector();
+		for(unsigned int i=0; i<vec.size(); ++i)
+		{
+			string  attrName = vec[i].attr_.rep_.name_;
+			string  attrValue = vec[i].value_;
+			cout << attrName  << " : " << attrValue << endl;
+
+		}
+	}
+
+	cout << endl << " Press enter! " << endl;
+	getchar(); 
+	db_->close ();
+	return 0;
+}
+
+
+
+
diff --git a/examples/querierFromLayer/querierFromLayer.dsp b/examples/querierFromLayer/querierFromLayer.dsp
old mode 100755
new mode 100644
index 76b375f..844748b
--- a/examples/querierFromLayer/querierFromLayer.dsp
+++ b/examples/querierFromLayer/querierFromLayer.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="querierFromLayer" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=querierFromLayer - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "querierFromLayer.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "querierFromLayer.mak" CFG="querierFromLayer - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "querierFromLayer - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "querierFromLayer - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "querierFromLayer - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/querierFromLayer.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "querierFromLayer - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/querierFromLayer.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "querierFromLayer - Win32 Release"
-# Name "querierFromLayer - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\querierFromLayer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="querierFromLayer" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=querierFromLayer - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "querierFromLayer.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "querierFromLayer.mak" CFG="querierFromLayer - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "querierFromLayer - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "querierFromLayer - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "querierFromLayer - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/querierFromLayer.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "querierFromLayer - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/querierFromLayer.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "querierFromLayer - Win32 Release"
+# Name "querierFromLayer - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\querierFromLayer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/querierFromLayer/querierFromLayer.dsw b/examples/querierFromLayer/querierFromLayer.dsw
old mode 100755
new mode 100644
index 4285d67..e9fa2cc
--- a/examples/querierFromLayer/querierFromLayer.dsw
+++ b/examples/querierFromLayer/querierFromLayer.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "querierFromLayer"=.\querierFromLayer.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "querierFromLayer"=.\querierFromLayer.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/querierFromLayer/querierFromLayer.pro b/examples/querierFromLayer/querierFromLayer.pro
old mode 100755
new mode 100644
index 6dcf064..c70a520
--- a/examples/querierFromLayer/querierFromLayer.pro
+++ b/examples/querierFromLayer/querierFromLayer.pro
@@ -1,9 +1,6 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	querierFromLayer.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-
+TARGET = querierFromLayer
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	querierFromLayer.cpp
\ No newline at end of file
diff --git a/examples/querierFromLayer/querierFromLayer.sln b/examples/querierFromLayer/querierFromLayer.sln
old mode 100755
new mode 100644
diff --git a/examples/querierFromLayer/querierFromLayer.vcproj b/examples/querierFromLayer/querierFromLayer.vcproj
old mode 100755
new mode 100644
index 1e94eea..d0f77ba
--- a/examples/querierFromLayer/querierFromLayer.vcproj
+++ b/examples/querierFromLayer/querierFromLayer.vcproj
@@ -1,201 +1,178 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="querierFromLayer"
-	ProjectGUID="{80AAE397-DA79-440F-B1EF-F7A304FAA94F}"
-	SccProjectName=""
-	SccLocalPath="">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				PrecompiledHeaderFile=".\Debug/querierFromLayer.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Debug/querierFromLayer.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=".\Debug/querierFromLayer.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Debug/querierFromLayer.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				PrecompiledHeaderFile=".\Release/querierFromLayer.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Release/querierFromLayer.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="libcmt.lib"
-				ProgramDatabaseFile=".\Release/querierFromLayer.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Release/querierFromLayer.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="querierFromLayer.cpp">
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="querierFromLayer"
+	ProjectGUID="{80AAE397-DA79-440F-B1EF-F7A304FAA94F}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/querierFromLayer.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/querierFromLayer.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/querierFromLayer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/querierFromLayer.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/querierFromLayer.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/querierFromLayer.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames="libcmt.lib"
+				ProgramDatabaseFile=".\Release/querierFromLayer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/querierFromLayer.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="querierFromLayer.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/querierFromTheme/.cdtproject b/examples/querierFromTheme/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/querierFromTheme/.cdtproject
+++ b/examples/querierFromTheme/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/querierFromTheme/.project b/examples/querierFromTheme/.project
old mode 100755
new mode 100644
index a018667..98c18f6
--- a/examples/querierFromTheme/.project
+++ b/examples/querierFromTheme/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>querierFromTheme</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>querierFromTheme</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/querierFromTheme/Makefile b/examples/querierFromTheme/Makefile
old mode 100755
new mode 100644
index b257f36..4d74673
--- a/examples/querierFromTheme/Makefile
+++ b/examples/querierFromTheme/Makefile
@@ -1,30 +1,30 @@
-all: querierFromTheme
-
-debug: querierFromTheme_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-	
-querierFromTheme:  terralib 
-	qmake -o makeQuerierFromTheme querierFromTheme.pro; make -f makeQuerierFromTheme
-
-querierFromTheme_dbg:  terralib_dbg 
-	qmake -o makeQuerierFromTheme.debug querierFromTheme.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeQuerierFromTheme.debug
-
-clean:
-	if \
-		test -f makeQuerierFromTheme; \
-	then \
-		make -f makeQuerierFromTheme distclean; rm -f makeQuerierFromTheme; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeQuerierFromTheme.debug; \
-	then \
-		make -f makeQuerierFromTheme.debug distclean; rm -f makeQuerierFromTheme.debug; \
+all: querierFromTheme
+
+debug: querierFromTheme_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+	
+querierFromTheme:  terralib 
+	qmake -o makeQuerierFromTheme querierFromTheme.pro; make -f makeQuerierFromTheme
+
+querierFromTheme_dbg:  terralib_dbg 
+	qmake -o makeQuerierFromTheme.debug querierFromTheme.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeQuerierFromTheme.debug
+
+clean:
+	if \
+		test -f makeQuerierFromTheme; \
+	then \
+		make -f makeQuerierFromTheme distclean; rm -f makeQuerierFromTheme; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeQuerierFromTheme.debug; \
+	then \
+		make -f makeQuerierFromTheme.debug distclean; rm -f makeQuerierFromTheme.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/querierFromTheme/querierFromTheme.cpp b/examples/querierFromTheme/querierFromTheme.cpp
old mode 100755
new mode 100644
index 0199cf1..92928d6
--- a/examples/querierFromTheme/querierFromTheme.cpp
+++ b/examples/querierFromTheme/querierFromTheme.cpp
@@ -1,133 +1,133 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/* 
-   This example shows how to use a querier from theme.
-   
-   Author: Karine Reis 
-*/
-
-#include "TeMySQL.h"
-#include "TeQuerier.h"
-#include "TeQuerierParams.h"
-
-#include <time.h>
-#include <iostream>
-
-using std::cout;
-
-int 
-main()
-{	
-	
-	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	 // Connects to database
-     TeDatabase* db_ = new TeMySQL();
-     if (!db_->connect(host,user,password,dbname))
-     {
-         cout << "Error: " << db_->errorMessage() << endl;
-         return 1;
-     }
-
-	// Load the layer 
-	TeTheme* bairros = new TeTheme("DistritosSaoPaulo");
-	if (!db_->loadTheme(bairros))
-    {
-        cout << "Error: " << db_->errorMessage() << endl; 
-		db_->close(); 
-        return 1;
-    }
-		
-	//All attributes and geometries
-	bool loadGeometries = true;
-	bool loadAllAttributes = true;
-	
-	// Set querier parameters - load all attributes and geometries 
-	TeQuerierParams querierParams(loadGeometries, loadAllAttributes);
-	querierParams.setParams(bairros);
-
-	TeQuerier  querier(querierParams);
-
-	// Load instances from layer based in the querier parameters 
-	if(!querier.loadInstances())
-		return 1;
-
-	// Traverse all the instances 
-	TeSTInstance sti;
-	while(querier.fetchInstance(sti))
-	{
-		cout << " Object: " << sti.objectId() << " --------------------------- " << endl << endl;
-	
-		// Plot each attribute, its name and value
-		TePropertyVector vec = sti.getPropertyVector();
-		for(unsigned int i=0; i<vec.size(); ++i)
-		{
-			string  attrName = vec[i].attr_.rep_.name_;
-			string  attrValue = vec[i].value_;
-
-			cout << attrName  << " : " << attrValue << endl;
-
-		}
-
-		//Get geometries
-		if(sti.hasPolygons())
-		{
-			TePolygonSet polSet;
-			sti.getGeometry(polSet);
-
-			for(unsigned int i=0; i<polSet.size(); ++i)
-			{
-				TeCoord2D centroid = TeFindCentroid(polSet[i]);
-				string p = "( "+ Te2String(centroid.x(), 7) +", "+  Te2String(centroid.y(), 7) +")"; 
-				cout << " Centroid of the Polygon : " << p << endl; 
-			}
-		}
-
-		if(sti.hasPoints())
-		{
-			TePointSet ponSet;
-			sti.getGeometry(ponSet);
-
-			for(unsigned int i=0; i<ponSet.size(); ++i)
-			{
-				string p = "( "+ Te2String(ponSet[i].location().x(), 7) +", "+  Te2String(ponSet[i].location().y(), 7) +")"; 
-				cout << " Point : " << p << endl; 
-			}
-		}
-
-		cout << endl << endl;
-	}
-
-	cout << " Press enter! " << endl;
-	getchar(); 
-	db_->close ();
-	return 0;
-}
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+   This example shows how to use a querier from theme.
+   
+   Author: Karine Reis 
+*/
+
+#include "TeMySQL.h"
+#include "TeQuerier.h"
+#include "TeQuerierParams.h"
+
+#include <time.h>
+#include <iostream>
+
+using std::cout;
+
+int 
+main()
+{	
+	
+	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	 // Connects to database
+     TeDatabase* db_ = new TeMySQL();
+     if (!db_->connect(host,user,password,dbname))
+     {
+         cout << "Error: " << db_->errorMessage() << endl;
+         return 1;
+     }
+
+	// Load the layer 
+	TeTheme* bairros = new TeTheme("DistritosSaoPaulo");
+	if (!db_->loadTheme(bairros))
+    {
+        cout << "Error: " << db_->errorMessage() << endl; 
+		db_->close(); 
+        return 1;
+    }
+		
+	//All attributes and geometries
+	bool loadGeometries = true;
+	bool loadAllAttributes = true;
+	
+	// Set querier parameters - load all attributes and geometries 
+	TeQuerierParams querierParams(loadGeometries, loadAllAttributes);
+	querierParams.setParams(bairros);
+
+	TeQuerier  querier(querierParams);
+
+	// Load instances from layer based in the querier parameters 
+	if(!querier.loadInstances())
+		return 1;
+
+	// Traverse all the instances 
+	TeSTInstance sti;
+	while(querier.fetchInstance(sti))
+	{
+		cout << " Object: " << sti.objectId() << " --------------------------- " << endl << endl;
+	
+		// Plot each attribute, its name and value
+		TePropertyVector vec = sti.getPropertyVector();
+		for(unsigned int i=0; i<vec.size(); ++i)
+		{
+			string  attrName = vec[i].attr_.rep_.name_;
+			string  attrValue = vec[i].value_;
+
+			cout << attrName  << " : " << attrValue << endl;
+
+		}
+
+		//Get geometries
+		if(sti.hasPolygons())
+		{
+			TePolygonSet polSet;
+			sti.getGeometry(polSet);
+
+			for(unsigned int i=0; i<polSet.size(); ++i)
+			{
+				TeCoord2D centroid = TeFindCentroid(polSet[i]);
+				string p = "( "+ Te2String(centroid.x(), 7) +", "+  Te2String(centroid.y(), 7) +")"; 
+				cout << " Centroid of the Polygon : " << p << endl; 
+			}
+		}
+
+		if(sti.hasPoints())
+		{
+			TePointSet ponSet;
+			sti.getGeometry(ponSet);
+
+			for(unsigned int i=0; i<ponSet.size(); ++i)
+			{
+				string p = "( "+ Te2String(ponSet[i].location().x(), 7) +", "+  Te2String(ponSet[i].location().y(), 7) +")"; 
+				cout << " Point : " << p << endl; 
+			}
+		}
+
+		cout << endl << endl;
+	}
+
+	cout << " Press enter! " << endl;
+	getchar(); 
+	db_->close ();
+	return 0;
+}
+
+
+
+
diff --git a/examples/querierFromTheme/querierFromTheme.dsp b/examples/querierFromTheme/querierFromTheme.dsp
old mode 100755
new mode 100644
index ed2a9e2..26459a9
--- a/examples/querierFromTheme/querierFromTheme.dsp
+++ b/examples/querierFromTheme/querierFromTheme.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="querierFromTheme" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=querierFromTheme - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "querierFromTheme.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "querierFromTheme.mak" CFG="querierFromTheme - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "querierFromTheme - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "querierFromTheme - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "querierFromTheme - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/querierFromTheme.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "querierFromTheme - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/querierFromTheme.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "querierFromTheme - Win32 Release"
-# Name "querierFromTheme - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\querierFromTheme.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="querierFromTheme" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=querierFromTheme - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "querierFromTheme.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "querierFromTheme.mak" CFG="querierFromTheme - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "querierFromTheme - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "querierFromTheme - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "querierFromTheme - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/querierFromTheme.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "querierFromTheme - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/querierFromTheme.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "querierFromTheme - Win32 Release"
+# Name "querierFromTheme - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\querierFromTheme.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/querierFromTheme/querierFromTheme.dsw b/examples/querierFromTheme/querierFromTheme.dsw
old mode 100755
new mode 100644
index 9aa0b3c..a7de9bc
--- a/examples/querierFromTheme/querierFromTheme.dsw
+++ b/examples/querierFromTheme/querierFromTheme.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "querierFromTheme"=.\querierFromTheme.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "querierFromTheme"=.\querierFromTheme.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/querierFromTheme/querierFromTheme.pro b/examples/querierFromTheme/querierFromTheme.pro
old mode 100755
new mode 100644
index 3598bc0..ad6e7e7
--- a/examples/querierFromTheme/querierFromTheme.pro
+++ b/examples/querierFromTheme/querierFromTheme.pro
@@ -1,9 +1,6 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	querierFromTheme.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-
+TARGET = querierFromTheme
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	querierFromTheme.cpp
\ No newline at end of file
diff --git a/examples/querierFromTheme/querierFromTheme.sln b/examples/querierFromTheme/querierFromTheme.sln
old mode 100755
new mode 100644
diff --git a/examples/querierFromTheme/querierFromTheme.vcproj b/examples/querierFromTheme/querierFromTheme.vcproj
old mode 100755
new mode 100644
index 8a12624..ffc069e
--- a/examples/querierFromTheme/querierFromTheme.vcproj
+++ b/examples/querierFromTheme/querierFromTheme.vcproj
@@ -1,201 +1,178 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="querierFromTheme"
-	ProjectGUID="{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}"
-	SccProjectName=""
-	SccLocalPath="">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				PrecompiledHeaderFile=".\Debug/querierFromTheme.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Debug/querierFromTheme.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=".\Debug/querierFromTheme.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Debug/querierFromTheme.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				PrecompiledHeaderFile=".\Release/querierFromTheme.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Release/querierFromTheme.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="libcmt.lib"
-				ProgramDatabaseFile=".\Release/querierFromTheme.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Release/querierFromTheme.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="querierFromTheme.cpp">
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="querierFromTheme"
+	ProjectGUID="{E1FD316B-80D6-4CC0-89DE-FBDCAB9D8A65}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/querierFromTheme.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/querierFromTheme.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/querierFromTheme.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/querierFromTheme.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/querierFromTheme.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/querierFromTheme.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames="libcmt.lib"
+				ProgramDatabaseFile=".\Release/querierFromTheme.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/querierFromTheme.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="querierFromTheme.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/querierGroupChronon/.cdtproject b/examples/querierGroupChronon/.cdtproject
new file mode 100644
index 0000000..6a7b054
--- /dev/null
+++ b/examples/querierGroupChronon/.cdtproject
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/querierGroupChronon/.project b/examples/querierGroupChronon/.project
new file mode 100644
index 0000000..88d5c11
--- /dev/null
+++ b/examples/querierGroupChronon/.project
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>querierGroupChronon</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/querierGroupChronon/Makefile b/examples/querierGroupChronon/Makefile
new file mode 100644
index 0000000..17fb155
--- /dev/null
+++ b/examples/querierGroupChronon/Makefile
@@ -0,0 +1,15 @@
+all: querierGroupChronon
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+
+querierGroupChronon: terralib 
+	qmake -o makeQuerierGroupChronon querierGroupChronon.pro; make -f makeQuerierGroupChronon
+
+clean:
+	if \
+		test -f makeQuerierGroupChronon; \
+	then \
+		make -f makeQuerierGroupChronon distclean; rm -f makeQuerierGroupChronon; \
+	fi
\ No newline at end of file
diff --git a/examples/querierGroupChronon/querierGroupChronon.cpp b/examples/querierGroupChronon/querierGroupChronon.cpp
new file mode 100644
index 0000000..3a596bc
--- /dev/null
+++ b/examples/querierGroupChronon/querierGroupChronon.cpp
@@ -0,0 +1,137 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+   This example shows how to use a querier from theme, grouping  
+   spatiotemporal instances by a chronon. 
+   	  
+   Author: Karine Reis 
+*/
+
+#include "TeMySQL.h"
+#include "TeQuerier.h"
+#include "TeQuerierParams.h"
+
+#include <time.h>
+#include <iostream>
+
+using std::cout;
+
+int 
+main()
+{	
+	
+	// Datatabase server parameters
+     string host = "localhost";
+     string dbname = "saudavel";
+     string user = "root";
+     string pass = "karine";
+
+	 // Connects to database
+     TeDatabase* db_ = new TeMySQL();
+     if (!db_->connect(host,user,pass,dbname))
+     {
+         cout << "Error: " << db_->errorMessage() << endl;
+         return 1;
+     }
+
+	// Load the layer 
+	TeTheme* coletas = new TeTheme("Coletas");
+	if (!db_->loadTheme(coletas))
+    {
+        cout << "Error: " << db_->errorMessage() << endl; 
+		db_->close(); 
+        return 1;
+    }
+		
+	//Attributes to group 
+	bool loadGeometries = false;
+	TeGroupingAttr attributes;
+	
+	pair<TeAttributeRep, TeStatisticType> attr1(TeAttributeRep("Coletas.NRO_OVOS_PAL1"), TeSUM);
+	attributes.push_back(attr1);
+
+	pair<TeAttributeRep, TeStatisticType> attr2(TeAttributeRep("Coletas.NRO_OVOS_PAL2"), TeSUM);
+	attributes.push_back(attr2);
+
+	pair<TeAttributeRep, TeStatisticType> attr3(TeAttributeRep("Coletas.NRO_OVOS_PAL3"), TeSUM);
+	attributes.push_back(attr3);
+
+	pair<TeAttributeRep, TeStatisticType> attr4(TeAttributeRep("Coletas.NRO_OVOS"), TeSUM);
+	attributes.push_back(attr4);
+
+	// Set querier parameters - load only the grouped attributes 
+	TeQuerierParams querierParams(loadGeometries, attributes);
+	querierParams.setParams(coletas, TeMONTH);
+
+	TeQuerier  querier(querierParams);
+
+	// number of time frames generated by chronon TeMONTH
+	int numTimeFrames = querier.getNumTimeFrames();
+	
+	// Load instances from theme for each time frame or month 
+	for(int frame=0; frame < numTimeFrames; ++frame)
+	{
+		TeTSEntry ts;
+		querier.getTSEntry(ts, frame);
+		
+		cout << " Time frame: " << Te2String(frame) << " --------------------------- " << endl << endl;
+
+		string initialDate = ts.time_.getInitialDateTime("DDsMMsYYYY"); 
+		string finalDate = ts.time_.getFinalDateTime("DDsMMsYYYY");
+		
+		cout << " Time Interval: " << initialDate << " to " << finalDate << endl << endl;
+
+		
+		if(!querier.loadInstances(frame))
+			continue;
+
+		// Traverse all the elements 
+		TeSTInstance sti;
+		while(querier.fetchInstance(sti))
+		{
+			cout << " Object: " << sti.objectId() << endl;
+			
+			// Plot each attribute, its name and value
+			TePropertyVector vec = sti.getPropertyVector();
+			for(unsigned int i=0; i<vec.size(); ++i)
+			{
+				string  attrName = vec[i].attr_.rep_.name_;
+				string  attrValue = vec[i].value_;
+
+				cout << attrName  << " : " << attrValue << endl;
+
+			}
+		}
+
+		cout << endl << endl;
+	}
+
+	cout << " End " << endl;
+	getchar(); 
+	db_->close ();
+	return 0;
+}
+
+
+
+
diff --git a/examples/querierGroupChronon/querierGroupChronon.dsp b/examples/querierGroupChronon/querierGroupChronon.dsp
new file mode 100644
index 0000000..2653763
--- /dev/null
+++ b/examples/querierGroupChronon/querierGroupChronon.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="querierGroupChronon" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=querierGroupChronon - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "querierGroupChronon.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "querierGroupChronon.mak" CFG="querierGroupChronon - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "querierGroupChronon - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "querierGroupChronon - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "querierGroupChronon - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/querierGroupChronon.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "querierGroupChronon - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\tiff\Debug\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/querierGroupChronon.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "querierGroupChronon - Win32 Release"
+# Name "querierGroupChronon - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\querierGroupChronon.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/querierGroupChronon/querierGroupChronon.dsw b/examples/querierGroupChronon/querierGroupChronon.dsw
new file mode 100644
index 0000000..2a56c64
--- /dev/null
+++ b/examples/querierGroupChronon/querierGroupChronon.dsw
@@ -0,0 +1,47 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "querierGroupChronon"=.\querierGroupChronon.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/querierGroupChronon/querierGroupChronon.pro b/examples/querierGroupChronon/querierGroupChronon.pro
new file mode 100644
index 0000000..8fdbd52
--- /dev/null
+++ b/examples/querierGroupChronon/querierGroupChronon.pro
@@ -0,0 +1,6 @@
+TARGET = querierGroupChronon
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	querierGroupChronon.cpp
\ No newline at end of file
diff --git a/examples/querierGroupChronon/querierGroupChronon.sln b/examples/querierGroupChronon/querierGroupChronon.sln
new file mode 100644
index 0000000..66fd395
--- /dev/null
+++ b/examples/querierGroupChronon/querierGroupChronon.sln
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierGroupChronon", "querierGroupChronon.vcproj", "{EA680C84-6F7A-4B60-A290-AE4BF7EC518B}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{EA680C84-6F7A-4B60-A290-AE4BF7EC518B}.Debug.ActiveCfg = Debug|Win32
+		{EA680C84-6F7A-4B60-A290-AE4BF7EC518B}.Debug.Build.0 = Debug|Win32
+		{EA680C84-6F7A-4B60-A290-AE4BF7EC518B}.Release.ActiveCfg = Release|Win32
+		{EA680C84-6F7A-4B60-A290-AE4BF7EC518B}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/querierGroupChronon/querierGroupChronon.vcproj b/examples/querierGroupChronon/querierGroupChronon.vcproj
new file mode 100644
index 0000000..925a1e4
--- /dev/null
+++ b/examples/querierGroupChronon/querierGroupChronon.vcproj
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="querierGroupChronon"
+	ProjectGUID="{A9396A28-DC43-40CF-A747-54EE8D8D17BD}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,..\..\src\terralib\kernel,..\..\src\terralib\application,..\..\src\terralib\functions,..\..\src\terralib\stat,..\..\src\shapelib,..\..\src\zlib,..\..\src\jpeg\include,..\..\terralibw\ado,..\..\src\terralib\drivers\MySQL,..\..\src\terralib\drivers\MySQL\include,..\..\src\terralib\drivers\OracleSpatial,..\..\src\terralib\drivers\OracleSpatial\OCI\include,..\..\src\terralib\drivers\PostgreSQL,..\..\src\terralib\drivers\PostgreSQL\includepg,..\..\src\te [...]
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/querierGroupChronon.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/querierGroupChronon.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/querierGroupChronon.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/querierGroupChronon.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".,..,..\..\src\terralib\kernel,..\..\src\terralib\application,..\..\src\terralib\functions,..\..\src\terralib\stat,..\..\src\shapelib,..\..\src\zlib,..\..\src\jpeg\include,..\..\terralibw\ado,..\..\src\terralib\drivers\MySQL,..\..\src\terralib\drivers\MySQL\include,..\..\src\terralib\drivers\OracleSpatial,..\..\src\terralib\drivers\OracleSpatial\OCI\include,..\..\src\terralib\drivers\PostgreSQL,..\..\src\terralib\drivers\PostgreSQL\includepg,..\..\src\te [...]
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/querierGroupChronon.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/querierGroupChronon.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/querierGroupChronon.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/querierGroupChronon.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="querierGroupChronon.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/querierGroupElement/.cdtproject b/examples/querierGroupElement/.cdtproject
new file mode 100644
index 0000000..6a7b054
--- /dev/null
+++ b/examples/querierGroupElement/.cdtproject
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/querierGroupElement/.project b/examples/querierGroupElement/.project
new file mode 100644
index 0000000..83cc4bb
--- /dev/null
+++ b/examples/querierGroupElement/.project
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>querierGroupElement</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/querierGroupElement/Makefile b/examples/querierGroupElement/Makefile
new file mode 100644
index 0000000..56dcbe5
--- /dev/null
+++ b/examples/querierGroupElement/Makefile
@@ -0,0 +1,14 @@
+all: querierGroupElement
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+querierGroupElement: terralib
+	qmake -o makeQuerierGroupElement querierGroupElement.pro; make -f makeQuerierGroupElement
+
+clean:
+	if \
+		test -f makeQuerierGroupElement; \
+	then \
+		make -f makeQuerierGroupElement distclean; rm -f makeQuerierGroupElement; \
+	fi
\ No newline at end of file
diff --git a/examples/querierGroupElement/querierGroupElement.cpp b/examples/querierGroupElement/querierGroupElement.cpp
new file mode 100644
index 0000000..95bb3da
--- /dev/null
+++ b/examples/querierGroupElement/querierGroupElement.cpp
@@ -0,0 +1,122 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+   This example shows how to use a querier from theme, grouping  
+   spatiotemporal instances by a element. 
+   
+   Author: Karine Reis 
+*/
+
+#include "TeMySQL.h"
+#include "TeQuerier.h"
+#include "TeQuerierParams.h"
+
+#include <time.h>
+#include <iostream>
+
+using std::cout;
+
+int 
+main()
+{	
+	
+	// Datatabase server parameters
+     string host = "localhost";
+     string dbname = "saudavel";
+     string user = "root";
+     string pass = "";
+
+	 // Connects to database
+     TeDatabase* db_ = new TeMySQL();
+     if (!db_->connect(host,user,pass,dbname))
+     {
+         cout << "Error: " << db_->errorMessage() << endl;
+         return 1;
+     }
+
+	// Load the layer 
+	TeTheme* coletas = new TeTheme("Coletas");
+	if (!db_->loadTheme(coletas))
+    {
+        cout << "Error: " << db_->errorMessage() << endl; 
+		db_->close(); 
+        return 1;
+    }
+		
+	//Attributes to group 
+	bool loadGeometries = false;
+	TeGroupingAttr attributes;
+	
+	pair<TeAttributeRep, TeStatisticType> attr1(TeAttributeRep("Coletas.NRO_OVOS_PAL1"), TeSUM);
+	attributes.push_back(attr1);
+
+	pair<TeAttributeRep, TeStatisticType> attr2(TeAttributeRep("Coletas.NRO_OVOS_PAL2"), TeSUM);
+	attributes.push_back(attr2);
+
+	pair<TeAttributeRep, TeStatisticType> attr3(TeAttributeRep("Coletas.NRO_OVOS_PAL3"), TeSUM);
+	attributes.push_back(attr3);
+
+	pair<TeAttributeRep, TeStatisticType> attr4(TeAttributeRep("Coletas.NRO_OVOS"), TeSUM);
+	attributes.push_back(attr4);
+	
+	// Set querier parameters - load only the grouped attributes 
+	TeQuerierParams querierParams(loadGeometries, attributes);
+	querierParams.setParams(coletas);
+
+	TeQuerier  querier(querierParams);
+
+	// Load instances from layer based in the querier parameters 
+	if(!querier.loadInstances())
+	{
+		return 1;
+	}
+
+	// Traverse all the instances 
+	TeSTInstance sti;
+	while(querier.fetchInstance(sti))
+	{
+		cout << " Object: " << sti.objectId() << " --------------------------- " << endl << endl;
+	
+		// Plot each attribute, its name and value
+		TePropertyVector vec = sti.getPropertyVector();
+		for(unsigned int i=0; i<vec.size(); ++i)
+		{
+			string  attrName = vec[i].attr_.rep_.name_;
+			string  attrValue = vec[i].value_;
+
+			cout << attrName  << " : " << attrValue << endl;
+
+		}
+
+		cout << endl << endl;
+	}
+
+	cout << " End " << endl;
+	getchar(); 
+	db_->close ();
+	return 0;
+}
+
+
+
+
diff --git a/examples/querierGroupElement/querierGroupElement.dsp b/examples/querierGroupElement/querierGroupElement.dsp
new file mode 100644
index 0000000..82d9721
--- /dev/null
+++ b/examples/querierGroupElement/querierGroupElement.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="querierGroupElement" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=querierGroupElement - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "querierGroupElement.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "querierGroupElement.mak" CFG="querierGroupElement - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "querierGroupElement - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "querierGroupElement - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "querierGroupElement - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/querierGroupElement.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "querierGroupElement - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/querierGroupElement.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "querierGroupElement - Win32 Release"
+# Name "querierGroupElement - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\querierGroupElement.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/querierGroupElement/querierGroupElement.dsw b/examples/querierGroupElement/querierGroupElement.dsw
new file mode 100644
index 0000000..b2aae08
--- /dev/null
+++ b/examples/querierGroupElement/querierGroupElement.dsw
@@ -0,0 +1,47 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "querierGroupElement"=.\querierGroupElement.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/querierGroupElement/querierGroupElement.pro b/examples/querierGroupElement/querierGroupElement.pro
new file mode 100644
index 0000000..d891550
--- /dev/null
+++ b/examples/querierGroupElement/querierGroupElement.pro
@@ -0,0 +1,6 @@
+TARGET = querierGroupElement
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	querierGroupElement.cpp
\ No newline at end of file
diff --git a/examples/querierGroupElement/querierGroupElement.sln b/examples/querierGroupElement/querierGroupElement.sln
new file mode 100644
index 0000000..ec544c2
--- /dev/null
+++ b/examples/querierGroupElement/querierGroupElement.sln
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierGroupElement", "querierGroupElement.vcproj", "{BE3A6E9E-1E06-4F2D-9C62-002273249E25}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{BE3A6E9E-1E06-4F2D-9C62-002273249E25}.Debug.ActiveCfg = Debug|Win32
+		{BE3A6E9E-1E06-4F2D-9C62-002273249E25}.Debug.Build.0 = Debug|Win32
+		{BE3A6E9E-1E06-4F2D-9C62-002273249E25}.Release.ActiveCfg = Release|Win32
+		{BE3A6E9E-1E06-4F2D-9C62-002273249E25}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/querierGroupElement/querierGroupElement.vcproj b/examples/querierGroupElement/querierGroupElement.vcproj
new file mode 100644
index 0000000..952db14
--- /dev/null
+++ b/examples/querierGroupElement/querierGroupElement.vcproj
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="querierGroupElement"
+	ProjectGUID="{AF583813-177A-4F5C-B60B-C5AD0056474A}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".,..,..\..\src\terralib\kernel,..\..\src\terralib\application,..\..\src\terralib\functions,..\..\src\terralib\stat,..\..\src\shapelib,..\..\src\zlib,..\..\src\jpeg\include,..\..\src\terralib\drivers\ado,..\..\src\terralib\drivers\MySQL,..\..\src\terralib\drivers\MySQL\include,..\..\src\terralib\drivers\OracleSpatial,..\..\src\terralib\drivers\OracleSpatial\OCI\include,..\..\src\terralib\drivers\PostgreSQL,..\..\src\terralib\drivers\PostgreSQL\includepg,. [...]
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/querierGroupElement.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/querierGroupElement.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/querierGroupElement.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/querierGroupElement.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,..\..\src\terralib\kernel,..\..\src\terralib\application,..\..\src\terralib\functions,..\..\src\terralib\stat,..\..\src\shapelib,..\..\src\zlib,..\..\src\jpeg\include,..\..\terralibw\ado,..\..\src\terralib\drivers\MySQL,..\..\src\terralib\drivers\MySQL\include,..\..\src\terralib\drivers\OracleSpatial,..\..\src\terralib\drivers\OracleSpatial\OCI\include,..\..\src\terralib\drivers\PostgreSQL,..\..\src\terralib\drivers\PostgreSQL\includepg,..\..\src\te [...]
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/querierGroupElement.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/querierGroupElement.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/querierGroupElement.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/querierGroupElement.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="querierGroupElement.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/querierGroupSpatialRest/.cdtproject b/examples/querierGroupSpatialRest/.cdtproject
new file mode 100644
index 0000000..6a7b054
--- /dev/null
+++ b/examples/querierGroupSpatialRest/.cdtproject
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/querierGroupSpatialRest/.project b/examples/querierGroupSpatialRest/.project
new file mode 100644
index 0000000..31faea9
--- /dev/null
+++ b/examples/querierGroupSpatialRest/.project
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>querierGroupSpatialRest</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/querierGroupSpatialRest/Makefile b/examples/querierGroupSpatialRest/Makefile
new file mode 100644
index 0000000..0ce95f9
--- /dev/null
+++ b/examples/querierGroupSpatialRest/Makefile
@@ -0,0 +1,14 @@
+all: querierGroupSpatialRest
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+querierGroupSpatialRest: terralib
+	qmake -o makeQuerierGroupSpatialRest querierGroupSpatialRest.pro; make -f makeQuerierGroupSpatialRest
+
+clean:
+	if \
+		test -f makeQuerierGroupSpatialRest; \
+	then \
+		make -f makeQuerierGroupSpatialRest distclean; rm -f makeQuerierGroupSpatialRest; \
+	fi
\ No newline at end of file
diff --git a/examples/querierGroupSpatialRest/querierGroupSpatialRest.cpp b/examples/querierGroupSpatialRest/querierGroupSpatialRest.cpp
new file mode 100644
index 0000000..b29fb9d
--- /dev/null
+++ b/examples/querierGroupSpatialRest/querierGroupSpatialRest.cpp
@@ -0,0 +1,159 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+   This example shows how to use a querier from theme, grouping all  
+   spatiotemporal instances that satisfy a spatial restriction. 
+   
+   Author: Karine Reis 
+*/
+
+#include "TeMySQL.h"
+#include "TeQuerier.h"
+#include "TeQuerierParams.h"
+
+#include <time.h>
+#include <iostream>
+
+using std::cout;
+
+int 
+main()
+{	
+	
+	// Datatabase server parameters
+     string host = "localhost";
+     string dbname = "saudavel";
+     string user = "root";
+     string pass = "karine";
+
+	 // Connects to database
+     TeDatabase* db_ = new TeMySQL();
+     if (!db_->connect(host,user,pass,dbname))
+     {
+         cout << "Error: " << db_->errorMessage() << endl;
+         return 1;
+     }
+
+	// Load the themes 
+	TeTheme* coletas = new TeTheme("Coletas");
+	if (!db_->loadTheme(coletas))
+    {
+        cout << "Error: " << db_->errorMessage() << endl; 
+		db_->close(); 
+        return 1;
+    }
+
+	TeTheme* bairros = new TeTheme("ibge_bairro");  
+	if (!db_->loadTheme(bairros))
+    {
+        cout << "Error: " << db_->errorMessage() << endl; 
+		db_->close(); 
+        return 1;
+    }
+		
+	//statistics from coletas
+	TeGroupingAttr attributes;
+	
+	pair<TeAttributeRep, TeStatisticType> attr1(TeAttributeRep("Coletas.NRO_OVOS_PAL1"), TeSUM);
+	attributes.push_back(attr1);
+
+	pair<TeAttributeRep, TeStatisticType> attr2(TeAttributeRep("Coletas.NRO_OVOS_PAL2"), TeSUM);
+	attributes.push_back(attr2);
+
+	pair<TeAttributeRep, TeStatisticType> attr3(TeAttributeRep("Coletas.NRO_OVOS_PAL3"), TeSUM);
+	attributes.push_back(attr3);
+
+	pair<TeAttributeRep, TeStatisticType> attr4(TeAttributeRep("Coletas.NRO_OVOS"), TeSUM);
+	attributes.push_back(attr4);
+
+	
+	// ------------ querier to theme "bairros"
+	bool loadGeometries = true;
+	vector<string> attrs;
+	attrs.push_back ("BAIRRO2000_REC.NOME");
+
+	TeQuerierParams querParamsBair(loadGeometries, attrs);
+	querParamsBair.setParams(bairros);
+	
+	TeQuerier  querBairros(querParamsBair); 
+
+	if(!querBairros.loadInstances())
+	{
+		cout << " No data!!! " << endl; 
+		return 1;
+	}
+
+	//Load each element and pass as spatial restriction
+	TeSTInstance bairro;
+	while(querBairros.fetchInstance (bairro))
+	{
+		string name;
+		bairro.getPropertyValue(name, 0);
+
+		cout << " Bairro: " << name << endl;
+		
+		TePolygonSet setP;
+		if(!bairro.getGeometry (setP))  //get the polygon
+			continue;
+
+		// ------------ querier to theme coletas
+		loadGeometries = false;
+
+		TeQuerierParams querParamsCol(loadGeometries, attributes);
+		querParamsCol.setParams(coletas);
+		
+		//spatial restriction
+		querParamsCol.setSpatialRest(&setP);
+
+		TeQuerier  querColetas(querParamsCol);
+		
+		if(!querColetas.loadInstances())
+		{
+			cout << " No data!!! " << endl; 
+			continue;
+		}
+
+		TeSTInstance coleta;
+		while(querColetas.fetchInstance(coleta)) 
+		{
+			// Plot each attribute, its name and value
+			TePropertyVector vec = coleta.getPropertyVector();
+			for(unsigned int i=0; i<vec.size(); ++i)
+			{
+				string  attrName = vec[i].attr_.rep_.name_;
+				string  attrValue = vec[i].value_;
+
+				cout << attrName  << " : " << attrValue << endl;
+			}
+		}
+	}
+
+	cout << " End " << endl;
+	getchar(); 
+	db_->close ();
+	return 0;
+}
+
+
+
+
diff --git a/examples/querierGroupSpatialRest/querierGroupSpatialRest.dsp b/examples/querierGroupSpatialRest/querierGroupSpatialRest.dsp
new file mode 100644
index 0000000..0e0e3d6
--- /dev/null
+++ b/examples/querierGroupSpatialRest/querierGroupSpatialRest.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="querierGroupSpatialRest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=querierGroupSpatialRest - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "querierGroupSpatialRest.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "querierGroupSpatialRest.mak" CFG="querierGroupSpatialRest - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "querierGroupSpatialRest - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "querierGroupSpatialRest - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "querierGroupSpatialRest - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/querierGroupSpatialRest.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "querierGroupSpatialRest - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/querierGroupSpatialRest.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "querierGroupSpatialRest - Win32 Release"
+# Name "querierGroupSpatialRest - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\querierGroupSpatialRest.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/querierGroupSpatialRest/querierGroupSpatialRest.dsw b/examples/querierGroupSpatialRest/querierGroupSpatialRest.dsw
new file mode 100644
index 0000000..38366ef
--- /dev/null
+++ b/examples/querierGroupSpatialRest/querierGroupSpatialRest.dsw
@@ -0,0 +1,47 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "querierGroupSpatialRest"=.\querierGroupSpatialRest.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/querierGroupSpatialRest/querierGroupSpatialRest.pro b/examples/querierGroupSpatialRest/querierGroupSpatialRest.pro
new file mode 100644
index 0000000..75a9521
--- /dev/null
+++ b/examples/querierGroupSpatialRest/querierGroupSpatialRest.pro
@@ -0,0 +1,6 @@
+TARGET = querierGroupSpatial
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	querierGroupSpatialRest.cpp
\ No newline at end of file
diff --git a/examples/querierGroupSpatialRest/querierGroupSpatialRest.sln b/examples/querierGroupSpatialRest/querierGroupSpatialRest.sln
new file mode 100644
index 0000000..4091812
--- /dev/null
+++ b/examples/querierGroupSpatialRest/querierGroupSpatialRest.sln
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierGroupSpatialRest", "querierGroupSpatialRest.vcproj", "{0B992042-4F08-42BA-B0E7-02603B029E2A}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{0B992042-4F08-42BA-B0E7-02603B029E2A}.Debug.ActiveCfg = Debug|Win32
+		{0B992042-4F08-42BA-B0E7-02603B029E2A}.Debug.Build.0 = Debug|Win32
+		{0B992042-4F08-42BA-B0E7-02603B029E2A}.Release.ActiveCfg = Release|Win32
+		{0B992042-4F08-42BA-B0E7-02603B029E2A}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/querierGroupSpatialRest/querierGroupSpatialRest.vcproj b/examples/querierGroupSpatialRest/querierGroupSpatialRest.vcproj
new file mode 100644
index 0000000..4cbcbac
--- /dev/null
+++ b/examples/querierGroupSpatialRest/querierGroupSpatialRest.vcproj
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="querierGroupSpatialRest"
+	ProjectGUID="{6123FB08-BEAA-4586-8BDB-F48974A55935}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".,..,..\..\src\terralib\kernel,..\..\src\terralib\application,..\..\src\terralib\functions,..\..\src\terralib\stat,..\..\src\shapelib,..\..\src\zlib,..\..\src\jpeg\include,..\..\terralibw\ado,..\..\src\terralib\drivers\MySQL,..\..\src\terralib\drivers\MySQL\include,..\..\src\terralib\drivers\OracleSpatial,..\..\src\terralib\drivers\OracleSpatial\OCI\include,..\..\src\terralib\drivers\PostgreSQL,..\..\src\terralib\drivers\PostgreSQL\includepg,..\..\src\te [...]
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/querierGroupSpatialRest.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/querierGroupSpatialRest.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/querierGroupSpatialRest.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/querierGroupSpatialRest.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,..\..\src\terralib\kernel,..\..\src\terralib\application,..\..\src\terralib\functions,..\..\src\terralib\stat,..\..\src\shapelib,..\..\src\zlib,..\..\src\jpeg\include,..\..\terralibw\ado,..\..\src\terralib\drivers\MySQL,..\..\src\terralib\drivers\MySQL\include,..\..\src\terralib\drivers\OracleSpatial,..\..\src\terralib\drivers\OracleSpatial\OCI\include,..\..\src\terralib\drivers\PostgreSQL,..\..\src\terralib\drivers\PostgreSQL\includepg,..\..\src\te [...]
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/querierGroupSpatialRest.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/querierGroupSpatialRest.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/querierGroupSpatialRest.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/querierGroupSpatialRest.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="querierGroupSpatialRest.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/querierWithSpatialRestBox/.cdtproject b/examples/querierWithSpatialRestBox/.cdtproject
new file mode 100644
index 0000000..6a7b054
--- /dev/null
+++ b/examples/querierWithSpatialRestBox/.cdtproject
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/querierWithSpatialRestBox/.project b/examples/querierWithSpatialRestBox/.project
new file mode 100644
index 0000000..d0b495d
--- /dev/null
+++ b/examples/querierWithSpatialRestBox/.project
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>querierWithSpatialRestBox</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/querierWithSpatialRestBox/Makefile b/examples/querierWithSpatialRestBox/Makefile
new file mode 100644
index 0000000..d63a5d5
--- /dev/null
+++ b/examples/querierWithSpatialRestBox/Makefile
@@ -0,0 +1,14 @@
+all: querierWithSpatialRestBox
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+querierWithSpatialRestBox: terralib
+	qmake -o makeQuerierWithSpatialRestBox querierWithSpatialRestBox.pro; make -f makeQuerierWithSpatialRestBox
+
+clean:
+	if \
+		test -f makeQuerierWithSpatialRestBox; \
+	then \
+		make -f makeQuerierWithSpatialRestBox distclean; rm -f makeQuerierWithSpatialRestBox; \
+	fi
\ No newline at end of file
diff --git a/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.cpp b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.cpp
new file mode 100644
index 0000000..5cf9943
--- /dev/null
+++ b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.cpp
@@ -0,0 +1,112 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+    This example shows how to use a querier from theme, using a spatial restriction 
+	defined by a rectangle (TeBOX). This spatial restriction is associated to querier. 
+   
+   Author: Karine Reis 
+*/
+
+
+#include "TeMySQL.h"
+#include "TeQuerier.h"
+#include "TeQuerierParams.h"
+
+#include <time.h>
+#include <iostream>
+
+using std::cout;
+
+int 
+main()
+{	
+	
+	// Datatabase server parameters
+     string host = "localhost";
+     string dbname = "DB320RC1";
+     string user = "root";
+     string pass = "";
+
+	 // Connects to database
+     TeDatabase* db_ = new TeMySQL();
+     if (!db_->connect(host,user,pass,dbname))
+     {
+         cout << "Error: " << db_->errorMessage() << endl;
+         return 1;
+     }
+
+	// Load the theme 
+	TeTheme* ocorrencias = new TeTheme("Ocorrencias");
+	if (!db_->loadTheme(ocorrencias))
+    {
+        cout << "Error: " << db_->errorMessage() << endl; 
+		db_->close(); 
+        return 1;
+    }
+		
+	//All attributes and geometries
+	bool loadGeometries = false;
+	bool loadAllAttributes = true;
+	
+	// Set querier parameters - load all attributes and geometries 
+	TeQuerierParams querierParams(loadGeometries, loadAllAttributes);
+	querierParams.setParams(ocorrencias);
+
+	//Set spatial restriction
+	TeBox box(609033.62, 794723.35, 613455.34, 800417.99); 
+	querierParams.setSpatialRest(box, TeWITHIN); 		
+	
+	TeQuerier  querier(querierParams);
+
+	// Load instances from layer based in the querier parameters 
+	querier.loadInstances();
+
+	// Traverse all the instances 
+	TeSTInstance sti;
+	while(querier.fetchInstance(sti))
+	{
+		cout << " Object: " << sti.objectId() << " --------------------------- " << endl << endl;
+	
+		// Plot each attribute, its name and value
+		TePropertyVector vec = sti.getPropertyVector();
+		for(unsigned int i=0; i<vec.size(); ++i)
+		{
+			string  attrName = vec[i].attr_.rep_.name_;
+			string  attrValue = vec[i].value_;
+
+			cout << attrName  << " : " << attrValue << endl;
+
+		}
+		
+		cout << endl << endl;
+	}
+
+	cout << " End " << endl;
+	getchar(); 
+	db_->close ();
+	return 0;
+}
+
+
+
+
diff --git a/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.dsp b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.dsp
new file mode 100644
index 0000000..6787c0a
--- /dev/null
+++ b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="querierWithSpatialRestBox" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=querierWithSpatialRestBox - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "querierWithSpatialRestBox.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "querierWithSpatialRestBox.mak" CFG="querierWithSpatialRestBox - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "querierWithSpatialRestBox - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "querierWithSpatialRestBox - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "querierWithSpatialRestBox - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/querierWithSpatialRestBox.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "querierWithSpatialRestBox - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/querierWithSpatialRestBox.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "querierWithSpatialRestBox - Win32 Release"
+# Name "querierWithSpatialRestBox - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\querierWithSpatialRestBox.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.dsw b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.dsw
new file mode 100644
index 0000000..bdfbed3
--- /dev/null
+++ b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.dsw
@@ -0,0 +1,47 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "querierWithSpatialRestBox"=.\querierWithSpatialRestBox.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.pro b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.pro
new file mode 100644
index 0000000..7515514
--- /dev/null
+++ b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.pro
@@ -0,0 +1,6 @@
+TARGET = querierWithSpatialRestBox
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	querierWithSpatialRestBox.cpp
\ No newline at end of file
diff --git a/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.sln b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.sln
new file mode 100644
index 0000000..fae3196
--- /dev/null
+++ b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.sln
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierWithSpatialRestBox", "querierWithSpatialRestBox.vcproj", "{1A36E5F9-B7BD-4D00-9C84-ED8D9358A758}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{1A36E5F9-B7BD-4D00-9C84-ED8D9358A758}.Debug.ActiveCfg = Debug|Win32
+		{1A36E5F9-B7BD-4D00-9C84-ED8D9358A758}.Debug.Build.0 = Debug|Win32
+		{1A36E5F9-B7BD-4D00-9C84-ED8D9358A758}.Release.ActiveCfg = Release|Win32
+		{1A36E5F9-B7BD-4D00-9C84-ED8D9358A758}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.vcproj b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.vcproj
new file mode 100644
index 0000000..815da37
--- /dev/null
+++ b/examples/querierWithSpatialRestBox/querierWithSpatialRestBox.vcproj
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="querierWithSpatialRestBox"
+	ProjectGUID="{B63260EA-95CD-4B78-8EC5-8909737A341D}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".,..,..\..\src\terralib\kernel,..\..\src\terralib\application,..\..\src\terralib\functions,..\..\src\terralib\stat,..\..\src\shapelib,..\..\src\zlib,..\..\src\jpeg\include,..\..\terralibw\ado,..\..\src\terralib\drivers\MySQL,..\..\src\terralib\drivers\MySQL\include,..\..\src\terralib\drivers\OracleSpatial,..\..\src\terralib\drivers\OracleSpatial\OCI\include,..\..\src\terralib\drivers\PostgreSQL,..\..\src\terralib\drivers\PostgreSQL\includepg,..\..\src\te [...]
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/querierWithSpatialRestBox.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/querierWithSpatialRestBox.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/querierWithSpatialRestBox.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/querierWithSpatialRestBox.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,..\..\src\terralib\kernel,..\..\src\terralib\application,..\..\src\terralib\functions,..\..\src\terralib\stat,..\..\src\shapelib,..\..\src\zlib,..\..\src\jpeg\include,..\..\terralibw\ado,..\..\src\terralib\drivers\MySQL,..\..\src\terralib\drivers\MySQL\include,..\..\src\terralib\drivers\OracleSpatial,..\..\src\terralib\drivers\OracleSpatial\OCI\include,..\..\src\terralib\drivers\PostgreSQL,..\..\src\terralib\drivers\PostgreSQL\includepg,..\..\src\te [...]
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/querierWithSpatialRestBox.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/querierWithSpatialRestBox.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/querierWithSpatialRestBox.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/querierWithSpatialRestBox.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="querierWithSpatialRestBox.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/querierWithSpatialRestGeometry/.cdtproject b/examples/querierWithSpatialRestGeometry/.cdtproject
new file mode 100644
index 0000000..6a7b054
--- /dev/null
+++ b/examples/querierWithSpatialRestGeometry/.cdtproject
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/querierWithSpatialRestGeometry/.project b/examples/querierWithSpatialRestGeometry/.project
new file mode 100644
index 0000000..7a1c38d
--- /dev/null
+++ b/examples/querierWithSpatialRestGeometry/.project
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>querierWithSpatialRestGeometry</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/querierWithSpatialRestGeometry/Makefile b/examples/querierWithSpatialRestGeometry/Makefile
new file mode 100644
index 0000000..67ba47c
--- /dev/null
+++ b/examples/querierWithSpatialRestGeometry/Makefile
@@ -0,0 +1,14 @@
+all: querierWithSpatialRestGeometry
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+querierWithSpatialRestGeometry: terralib
+	qmake -o makeQuerierWithSpatialRestGeometry querierWithSpatialRestGeometry.pro; make -f makeQuerierWithSpatialRestGeometry
+
+clean:
+	if \
+		test -f makeQuerierWithSpatialRestGeometry; \
+	then \
+		make -f makeQuerierWithSpatialRestGeometry distclean; rm -f makeQuerierWithSpatialRestGeometry; \
+	fi
\ No newline at end of file
diff --git a/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.cpp b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.cpp
new file mode 100644
index 0000000..0ec4db4
--- /dev/null
+++ b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.cpp
@@ -0,0 +1,151 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/* 
+   This example shows how to use a querier from theme, using a spatial restriction 
+	defined by a geometry (polygons, lines, cells and points) from another theme. 
+	This spatial restriction is associated to querier. 
+   
+   Author: Karine Reis 
+*/
+
+#include "TeMySQL.h"
+#include "TeQuerier.h"
+#include "TeQuerierParams.h"
+
+#include <time.h>
+#include <iostream>
+
+using std::cout;
+
+int 
+main()
+{	
+	
+	// Datatabase server parameters
+     string host = "localhost";
+     string dbname = "DB320RC1";
+     string user = "root";
+     string pass = "";
+
+	 // Connects to database
+     TeDatabase* db_ = new TeMySQL();
+     if (!db_->connect(host,user,pass,dbname))
+     {
+         cout << "Error: " << db_->errorMessage() << endl;
+         return 1;
+     }
+
+	// Load the themes 
+	TeTheme* ocorrencias = new TeTheme("Ocorrencias");
+	if (!db_->loadTheme(ocorrencias))
+    {
+        cout << "Error: " << db_->errorMessage() << endl; 
+		db_->close(); 
+        return 1;
+    }
+
+	TeTheme* bairros = new TeTheme("Tema_BairroBH");  
+	if (!db_->loadTheme(bairros))
+    {
+        cout << "Error: " << db_->errorMessage() << endl; 
+		db_->close(); 
+        return 1;
+    }
+		
+		
+	// ------------ querier to theme "bairros"
+	bool loadGeometries = true;
+	vector<string> attrs;
+	attrs.push_back ("Bairrobh.nobai");
+
+	TeQuerierParams querParamsBair(loadGeometries, attrs);
+	querParamsBair.setParams(bairros);
+	
+	TeQuerier  querBairros(querParamsBair); 
+
+	if(!querBairros.loadInstances())
+	{
+		cout << " No data!!! " << endl; 
+		return 1;
+	}
+
+	//Load each element and pass to querier as spatial restriction
+	TeSTInstance bairro;
+	while(querBairros.fetchInstance (bairro))
+	{
+		string name;
+		bairro.getPropertyValue(name, 0);
+
+		cout << " Bairro: " << name << endl;
+		
+		TePolygonSet setP;
+		
+		if(!bairro.getGeometry (setP))  //get the polygon set
+			continue;
+
+		// ------------ querier to theme coletas
+		loadGeometries = false;
+		vector<string> attributes;
+		attributes.push_back ("ocorrenciasbh.Nrbo");
+
+		TeQuerierParams querParamsOcr(loadGeometries, attributes);
+		querParamsOcr.setParams(ocorrencias);
+		
+		//spatial restriction
+		querParamsOcr.setSpatialRest(&setP);
+
+		TeQuerier  querOcorrencias(querParamsOcr);
+		
+		if(!querOcorrencias.loadInstances())
+		{
+			cout << " No data!!! " << endl; 
+			continue;
+		}
+
+		TeSTInstance sto;
+		while(querOcorrencias.fetchInstance(sto)) 
+		{
+			// Plot each attribute, its name and value
+			TePropertyVector vec = sto.getPropertyVector();
+			for(unsigned int i=0; i<vec.size(); ++i)
+			{
+				string  attrName = vec[i].attr_.rep_.name_;
+				string  attrValue = vec[i].value_;
+
+				cout << attrName  << " : " << attrValue << endl;
+			}
+
+			//Plot the time
+			cout << endl << " Data : " << sto.getInitialDateTime() << endl;
+		}
+	}
+
+	cout << " End " << endl;
+	getchar(); 
+	db_->close ();
+	return 0;
+}
+
+
+
+
diff --git a/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.dsp b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.dsp
new file mode 100644
index 0000000..0fc8c4e
--- /dev/null
+++ b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="querierWithSpatialRestGeometry" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=querierWithSpatialRestGeometry - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "querierWithSpatialRestGeometry.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "querierWithSpatialRestGeometry.mak" CFG="querierWithSpatialRestGeometry - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "querierWithSpatialRestGeometry - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "querierWithSpatialRestGeometry - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "querierWithSpatialRestGeometry - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/querierWithSpatialRestGeometry.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "querierWithSpatialRestGeometry - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/querierWithSpatialRestGeometry.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "querierWithSpatialRestGeometry - Win32 Release"
+# Name "querierWithSpatialRestGeometry - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\querierWithSpatialRestGeometry.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.dsw b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.dsw
new file mode 100644
index 0000000..a954a04
--- /dev/null
+++ b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.dsw
@@ -0,0 +1,47 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "querierWithSpatialRestGeometry"=.\querierWithSpatialRestGeometry.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.pro b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.pro
new file mode 100644
index 0000000..9c8189c
--- /dev/null
+++ b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.pro
@@ -0,0 +1,6 @@
+TARGET = querierWithSpatialRestGeometry
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	querierWithSpatialRestGeometry.cpp
\ No newline at end of file
diff --git a/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.sln b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.sln
new file mode 100644
index 0000000..e327667
--- /dev/null
+++ b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.sln
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "querierWithSpatialRestGeometry", "querierWithSpatialRestGeometry.vcproj", "{59B0B0E5-130B-48EB-B7AF-B7C8140EBFA1}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{59B0B0E5-130B-48EB-B7AF-B7C8140EBFA1}.Debug.ActiveCfg = Debug|Win32
+		{59B0B0E5-130B-48EB-B7AF-B7C8140EBFA1}.Debug.Build.0 = Debug|Win32
+		{59B0B0E5-130B-48EB-B7AF-B7C8140EBFA1}.Release.ActiveCfg = Release|Win32
+		{59B0B0E5-130B-48EB-B7AF-B7C8140EBFA1}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
diff --git a/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.vcproj b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.vcproj
new file mode 100644
index 0000000..9070ab9
--- /dev/null
+++ b/examples/querierWithSpatialRestGeometry/querierWithSpatialRestGeometry.vcproj
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="querierWithSpatialRestGeometry"
+	ProjectGUID="{752259B0-62E3-49E0-9E87-DB9175684D0C}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".,..,..\..\src\terralib\kernel,..\..\src\terralib\application,..\..\src\terralib\functions,..\..\src\terralib\stat,..\..\src\shapelib,..\..\src\zlib,..\..\src\jpeg\include,..\..\terralibw\ado,..\..\src\terralib\drivers\MySQL,..\..\src\terralib\drivers\MySQL\include,..\..\src\terralib\drivers\OracleSpatial,..\..\src\terralib\drivers\OracleSpatial\OCI\include,..\..\src\terralib\drivers\PostgreSQL,..\..\src\terralib\drivers\PostgreSQL\includepg,..\..\src\te [...]
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/querierWithSpatialRestGeometry.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/querierWithSpatialRestGeometry.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/querierWithSpatialRestGeometry.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/querierWithSpatialRestGeometry.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,..\..\src\terralib\kernel,..\..\src\terralib\application,..\..\src\terralib\functions,..\..\src\terralib\stat,..\..\src\shapelib,..\..\src\zlib,..\..\src\jpeg\include,..\..\terralibw\ado,..\..\src\terralib\drivers\MySQL,..\..\src\terralib\drivers\MySQL\include,..\..\src\terralib\drivers\OracleSpatial,..\..\src\terralib\drivers\OracleSpatial\OCI\include,..\..\src\terralib\drivers\PostgreSQL,..\..\src\terralib\drivers\PostgreSQL\includepg,..\..\src\te [...]
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/querierWithSpatialRestGeometry.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/querierWithSpatialRestGeometry.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/querierWithSpatialRestGeometry.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/querierWithSpatialRestGeometry.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="querierWithSpatialRestGeometry.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/rasterSlicing/.cdtproject b/examples/rasterSlicing/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/rasterSlicing/.cdtproject
+++ b/examples/rasterSlicing/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/rasterSlicing/.project b/examples/rasterSlicing/.project
old mode 100755
new mode 100644
index 8961c75..9339eb6
--- a/examples/rasterSlicing/.project
+++ b/examples/rasterSlicing/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>rasterSlicing</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>rasterSlicing</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/rasterSlicing/Makefile b/examples/rasterSlicing/Makefile
old mode 100755
new mode 100644
index 046ef3a..e47d9f7
--- a/examples/rasterSlicing/Makefile
+++ b/examples/rasterSlicing/Makefile
@@ -1,30 +1,30 @@
-all: rasterSlicing
-
-debug: rasterSlicing_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-	
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-rasterSlicing: terralib
-	qmake -o makeRasterSlicing rasterSlicing.pro; make -f makeRasterSlicing
-
-rasterSlicing_dbg: terralib_dbg
-	qmake -o makeRasterSlicing.debug rasterSlicing.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeRasterSlicing.debug
-
-clean:
-	if \
-		test -f makeRasterSlicing; \
-	then \
-		make -f makeRasterSlicing distclean; rm -f makeRasterSlicing; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeRasterSlicing.debug; \
-	then \
-		make -f makeRasterSlicing.debug distclean; rm -f makeRasterSlicing.debug; \
+all: rasterSlicing
+
+debug: rasterSlicing_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+	
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+rasterSlicing: terralib
+	qmake -o makeRasterSlicing rasterSlicing.pro; make -f makeRasterSlicing
+
+rasterSlicing_dbg: terralib_dbg
+	qmake -o makeRasterSlicing.debug rasterSlicing.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeRasterSlicing.debug
+
+clean:
+	if \
+		test -f makeRasterSlicing; \
+	then \
+		make -f makeRasterSlicing distclean; rm -f makeRasterSlicing; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeRasterSlicing.debug; \
+	then \
+		make -f makeRasterSlicing.debug distclean; rm -f makeRasterSlicing.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/rasterSlicing/rasterSlicing.cpp b/examples/rasterSlicing/rasterSlicing.cpp
old mode 100755
new mode 100644
index 515449f..6939d23
--- a/examples/rasterSlicing/rasterSlicing.cpp
+++ b/examples/rasterSlicing/rasterSlicing.cpp
@@ -1,201 +1,201 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows an example of how to create a legend over a raster data,
-	stored in a layer TerraLib.
-
-	Author: Lubia Vinhas  
-*/
-
-#include "TeRaster.h"
-#include "TeMySQL.h"
-
-int main()
-{
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl << endl;
-		cout << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-
-	// Retrieve a layer with a raster representation
-	TeLayer* layer = new TeLayer("Elevation",db);
-	if (layer->id() < 1)
-	{
-		cout << "Cannot access layer Elevation " << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	// Create a new view with the same projection as the layer
-	TeView* view = new TeView("ViewElevation", user);
-	view->projection(layer->projection());
-	if (!db->insertView(view)) 
-	{
-		 cout << "Couldn�t insert view into the database: " << db->errorMessage() << endl;
-		 db->close();
-		 cout << endl << "Press Enter\n";
-		 getchar();
-		 return 1;
-	}
-
-	// Create a new theme and a legend over it
-	TeAbstractTheme* rstTheme = new TeTheme("Elevation", layer);
-
-	rstTheme->visibleRep(TeRASTER | 0x40000000);	// make visible: the raster representation
-													// and the legend (0x4000000)
-	view->add(rstTheme);							// add theme to the view
-	if (!rstTheme->save())							// save theme definition to the database
-	{
-		 cout << "Error saving theme: " << db->errorMessage() << endl;
-		 db->close();
-		 cout << endl << "Press Enter\n";
-		 getchar();
-		 return 1;
-	}
-
-	// Define red, green and blue components to build a 10 color pallete
-	short red[10] =   { 0, 45, 99, 160, 230, 232, 235, 237, 240, 242 };
-	short green[10] = { 166, 182, 198, 214, 230, 195, 178, 180, 201, 242 };
-	short blue[10]  = { 0, 0, 0, 0, 0, 46, 94, 142, 192, 242 };
-
-	// Define a slicing mode: 10 slices
-	TeGrouping group1;
-	group1.groupMode_ = TeRasterSlicing;
-	group1.groupNumSlices_ = 10;
-	group1.groupPrecision_ = 8;
-
-	
-	// Default way of slicing a raster representation: slices of equal size
-	if (!rstTheme->buildGrouping(group1)) 
-	{
-		 cout << "Error grouping theme: " << db->errorMessage() << endl;
-		 db->close();
-		 cout << endl << "Press Enter\n";
-		 getchar();
-		 return 1;
-	}
-
-	// Assign to each slice one color of the pallete
-	int ng;
-	for (ng=0; ng<rstTheme->grouping().groupNumSlices_; ng++)
-	{
-		TeColor color(red[ng],green[ng],blue[ng]);
-		TeVisual* visual = TeVisualFactory::make("tevisual");            
-		visual->color(color);
-		visual->transparency(rstTheme->defaultLegend().visual(TePOLYGONS)->transparency());
-		visual->contourStyle(rstTheme->defaultLegend().visual(TePOLYGONS)->contourStyle());
-		visual->contourWidth(rstTheme->defaultLegend().visual(TePOLYGONS)->contourWidth());
-		visual->contourColor(rstTheme->defaultLegend().visual(TePOLYGONS)->contourColor());	
-		rstTheme->setGroupingVisual(ng+1,visual,TePOLYGONS);
-	}
-
-	// Saves the theme legend to the database
-	if (!rstTheme->saveGrouping())
-	{
-		 cout << "Error saving theme slicing: " << db->errorMessage() << endl;
-		 db->close();
-		 cout << endl << "Press Enter\n";
-		 getchar();
-		 return 1;
-	}
-	cout << "Created first theme...\n";
-	delete rstTheme;
-	
-	// Generates a new theme with slices arbitrarily defined
-	
-	rstTheme = new TeTheme("Elevation4Slices", layer);
-	rstTheme->visibleRep(TeRASTER | 0x40000000);	// make visible: the raster representation
-													// and the legend (0x4000000)
-	view->add(rstTheme);							// add theme to the view
-	if (!rstTheme->save())							// save theme definition to the database
-	{
-		 cout << "Error saving theme: " << db->errorMessage() << endl;
-		 db->close();
-		 cout << endl << "Press Enter\n";
-		 getchar();
-		 return 1;
-	}
-
-	vector<TeSlice> mySlices;
-	TeSlice sl1("980","1000"); 
-	mySlices.push_back(sl1);
-	TeSlice sl2("1000","1020"); 
-	mySlices.push_back(sl2);
-	TeSlice sl3("1020","1100"); 
-	mySlices.push_back(sl3);
-	TeSlice sl4("1100","1200"); 
-	mySlices.push_back(sl4);
-	 
-	TeGrouping group2;
-	group2.groupMode_ = TeRasterSlicing;
-	group2.groupNumSlices_ = 4;
-	group2.groupPrecision_ = 8;
-
-	if (!rstTheme->buildGrouping(group2,mySlices)) 
-	{
-		 cout << "Error grouping theme: " << db->errorMessage() << endl;
-		 db->close();
-		 cout << endl << "Press Enter\n";
-		 getchar();
-		 return 1;
-	}
-
-	for (ng=0; ng<rstTheme->grouping().groupNumSlices_; ng++)
-	{
-		TeColor color(red[ng*2],green[ng*2],blue[ng*2]);
-		TeVisual* visual2 = TeVisualFactory::make("tevisual");            
-		visual2->color(color);
-		visual2->transparency(rstTheme->defaultLegend().visual(TePOLYGONS)->transparency());
-		visual2->contourStyle(rstTheme->defaultLegend().visual(TePOLYGONS)->contourStyle());
-		visual2->contourWidth(rstTheme->defaultLegend().visual(TePOLYGONS)->contourWidth());
-		visual2->contourColor(rstTheme->defaultLegend().visual(TePOLYGONS)->contourColor());	
-		rstTheme->setGroupingVisual(ng+1,visual2,TePOLYGONS);
-	}
-
-	if (!rstTheme->saveGrouping())
-	{
-		 cout << "Error saving theme slicing: " << db->errorMessage() << endl;
-		 db->close();
-		 cout << endl << "Press Enter\n";
-		 getchar();
-		 return 1;
-	}
-	
-	db->close();
-	cout << "Created second theme...\n";
-	cout << "Sucess. Press enter...\n";
-	getchar();
-	return 0;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows an example of how to create a legend over a raster data,
+	stored in a layer TerraLib.
+
+	Author: Lubia Vinhas  
+*/
+
+#include "TeRaster.h"
+#include "TeMySQL.h"
+
+int main()
+{
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl << endl;
+		cout << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+
+	// Retrieve a layer with a raster representation
+	TeLayer* layer = new TeLayer("Elevation",db);
+	if (layer->id() < 1)
+	{
+		cout << "Cannot access layer Elevation " << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	// Create a new view with the same projection as the layer
+	TeView* view = new TeView("ViewElevation", user);
+	view->projection(layer->projection());
+	if (!db->insertView(view)) 
+	{
+		 cout << "Couldn�t insert view into the database: " << db->errorMessage() << endl;
+		 db->close();
+		 cout << endl << "Press Enter\n";
+		 getchar();
+		 return 1;
+	}
+
+	// Create a new theme and a legend over it
+	TeAbstractTheme* rstTheme = new TeTheme("Elevation", layer);
+
+	rstTheme->visibleRep(TeRASTER | 0x40000000);	// make visible: the raster representation
+													// and the legend (0x4000000)
+	view->add(rstTheme);							// add theme to the view
+	if (!rstTheme->save())							// save theme definition to the database
+	{
+		 cout << "Error saving theme: " << db->errorMessage() << endl;
+		 db->close();
+		 cout << endl << "Press Enter\n";
+		 getchar();
+		 return 1;
+	}
+
+	// Define red, green and blue components to build a 10 color pallete
+	short red[10] =   { 0, 45, 99, 160, 230, 232, 235, 237, 240, 242 };
+	short green[10] = { 166, 182, 198, 214, 230, 195, 178, 180, 201, 242 };
+	short blue[10]  = { 0, 0, 0, 0, 0, 46, 94, 142, 192, 242 };
+
+	// Define a slicing mode: 10 slices
+	TeGrouping group1;
+	group1.groupMode_ = TeRasterSlicing;
+	group1.groupNumSlices_ = 10;
+	group1.groupPrecision_ = 8;
+
+	
+	// Default way of slicing a raster representation: slices of equal size
+	if (!rstTheme->buildGrouping(group1)) 
+	{
+		 cout << "Error grouping theme: " << db->errorMessage() << endl;
+		 db->close();
+		 cout << endl << "Press Enter\n";
+		 getchar();
+		 return 1;
+	}
+
+	// Assign to each slice one color of the pallete
+	int ng;
+	for (ng=0; ng<rstTheme->grouping().groupNumSlices_; ng++)
+	{
+		TeColor color(red[ng],green[ng],blue[ng]);
+		TeVisual* visual = TeVisualFactory::make("tevisual");            
+		visual->color(color);
+		visual->transparency(rstTheme->defaultLegend().visual(TePOLYGONS)->transparency());
+		visual->contourStyle(rstTheme->defaultLegend().visual(TePOLYGONS)->contourStyle());
+		visual->contourWidth(rstTheme->defaultLegend().visual(TePOLYGONS)->contourWidth());
+		visual->contourColor(rstTheme->defaultLegend().visual(TePOLYGONS)->contourColor());	
+		rstTheme->setGroupingVisual(ng+1,visual,TePOLYGONS);
+	}
+
+	// Saves the theme legend to the database
+	if (!rstTheme->saveGrouping())
+	{
+		 cout << "Error saving theme slicing: " << db->errorMessage() << endl;
+		 db->close();
+		 cout << endl << "Press Enter\n";
+		 getchar();
+		 return 1;
+	}
+	cout << "Created first theme...\n";
+	delete rstTheme;
+	
+	// Generates a new theme with slices arbitrarily defined
+	
+	rstTheme = new TeTheme("Elevation4Slices", layer);
+	rstTheme->visibleRep(TeRASTER | 0x40000000);	// make visible: the raster representation
+													// and the legend (0x4000000)
+	view->add(rstTheme);							// add theme to the view
+	if (!rstTheme->save())							// save theme definition to the database
+	{
+		 cout << "Error saving theme: " << db->errorMessage() << endl;
+		 db->close();
+		 cout << endl << "Press Enter\n";
+		 getchar();
+		 return 1;
+	}
+
+	vector<TeSlice> mySlices;
+	TeSlice sl1("980","1000"); 
+	mySlices.push_back(sl1);
+	TeSlice sl2("1000","1020"); 
+	mySlices.push_back(sl2);
+	TeSlice sl3("1020","1100"); 
+	mySlices.push_back(sl3);
+	TeSlice sl4("1100","1200"); 
+	mySlices.push_back(sl4);
+	 
+	TeGrouping group2;
+	group2.groupMode_ = TeRasterSlicing;
+	group2.groupNumSlices_ = 4;
+	group2.groupPrecision_ = 8;
+
+	if (!rstTheme->buildGrouping(group2,mySlices)) 
+	{
+		 cout << "Error grouping theme: " << db->errorMessage() << endl;
+		 db->close();
+		 cout << endl << "Press Enter\n";
+		 getchar();
+		 return 1;
+	}
+
+	for (ng=0; ng<rstTheme->grouping().groupNumSlices_; ng++)
+	{
+		TeColor color(red[ng*2],green[ng*2],blue[ng*2]);
+		TeVisual* visual2 = TeVisualFactory::make("tevisual");            
+		visual2->color(color);
+		visual2->transparency(rstTheme->defaultLegend().visual(TePOLYGONS)->transparency());
+		visual2->contourStyle(rstTheme->defaultLegend().visual(TePOLYGONS)->contourStyle());
+		visual2->contourWidth(rstTheme->defaultLegend().visual(TePOLYGONS)->contourWidth());
+		visual2->contourColor(rstTheme->defaultLegend().visual(TePOLYGONS)->contourColor());	
+		rstTheme->setGroupingVisual(ng+1,visual2,TePOLYGONS);
+	}
+
+	if (!rstTheme->saveGrouping())
+	{
+		 cout << "Error saving theme slicing: " << db->errorMessage() << endl;
+		 db->close();
+		 cout << endl << "Press Enter\n";
+		 getchar();
+		 return 1;
+	}
+	
+	db->close();
+	cout << "Created second theme...\n";
+	cout << "Sucess. Press enter...\n";
+	getchar();
+	return 0;
+}
diff --git a/examples/rasterSlicing/rasterSlicing.dsp b/examples/rasterSlicing/rasterSlicing.dsp
old mode 100755
new mode 100644
index fa23a7b..334b789
--- a/examples/rasterSlicing/rasterSlicing.dsp
+++ b/examples/rasterSlicing/rasterSlicing.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="rasterSlicing" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=rasterSlicing - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "rasterSlicing.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "rasterSlicing.mak" CFG="rasterSlicing - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "rasterSlicing - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "rasterSlicing - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "rasterSlicing - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drive [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\tiff\Release\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/rasterSlicing.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "rasterSlicing - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terra [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\tiff\Debug\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/rasterSlicing.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "rasterSlicing - Win32 Release"
-# Name "rasterSlicing - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\rasterSlicing.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="rasterSlicing" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=rasterSlicing - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "rasterSlicing.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "rasterSlicing.mak" CFG="rasterSlicing - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "rasterSlicing - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "rasterSlicing - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "rasterSlicing - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drive [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\tiff\Release\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/rasterSlicing.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "rasterSlicing - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terra [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\tiff\Debug\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/rasterSlicing.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "rasterSlicing - Win32 Release"
+# Name "rasterSlicing - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\rasterSlicing.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/rasterSlicing/rasterSlicing.dsw b/examples/rasterSlicing/rasterSlicing.dsw
old mode 100755
new mode 100644
index 47b4320..5c0488f
--- a/examples/rasterSlicing/rasterSlicing.dsw
+++ b/examples/rasterSlicing/rasterSlicing.dsw
@@ -1,29 +1,29 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "rasterSlicing"=.\rasterSlicing.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "rasterSlicing"=.\rasterSlicing.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/rasterSlicing/rasterSlicing.pro b/examples/rasterSlicing/rasterSlicing.pro
old mode 100755
new mode 100644
index 510992f..3bccf80
--- a/examples/rasterSlicing/rasterSlicing.pro
+++ b/examples/rasterSlicing/rasterSlicing.pro
@@ -1,10 +1,6 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	rasterSlicing.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
-
+TARGET = rasterSlicing
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	rasterSlicing.cpp
\ No newline at end of file
diff --git a/examples/rasterSlicing/rasterSlicing.sln b/examples/rasterSlicing/rasterSlicing.sln
old mode 100755
new mode 100644
diff --git a/examples/rasterSlicing/rasterSlicing.vcproj b/examples/rasterSlicing/rasterSlicing.vcproj
old mode 100755
new mode 100644
index 58dc76b..2954642
--- a/examples/rasterSlicing/rasterSlicing.vcproj
+++ b/examples/rasterSlicing/rasterSlicing.vcproj
@@ -1,164 +1,158 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="rasterSlicing"
-	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\Debug\"
-			IntermediateDirectory="..\Debug\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Debug\rasterSlicing.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="msvcrt.lib"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\Release\"
-			IntermediateDirectory="..\Release\"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
-				Optimization="4"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib"
-				PreprocessorDefinitions="UNICODE,WIN32"
-				GeneratePreprocessedFile="0"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				RuntimeTypeInfo="TRUE"
-				AssemblerListingLocation="..\Debug\"
-				ObjectFile="..\Debug\"
-				ProgramDataBaseFileName=".\"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
-				OutputFile="..\Release\rasterSlicing.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=""
-				SubSystem="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				WarningLevel="0"
-				DefaultCharType="0"
-				EnableErrorChecks="1"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="rasterSlicing.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="rasterSlicing"
+	ProjectGUID="{AC29CA10-2B75-494F-A370-6767C7AB5FC1}">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\Debug\"
+			IntermediateDirectory="..\Debug\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Debug\rasterSlicing.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\Release\"
+			IntermediateDirectory="..\Release\"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="-Zm200 -GX -w34100 -w34189"
+				Optimization="4"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\functions;..\..\src\terralib\kernel;..\..\src\zlib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include;..\..\src\shapelib"
+				PreprocessorDefinitions="UNICODE,WIN32"
+				GeneratePreprocessedFile="0"
+				MinimalRebuild="TRUE"
+				ExceptionHandling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				RuntimeTypeInfo="TRUE"
+				AssemblerListingLocation="..\Debug\"
+				ObjectFile="..\Debug\"
+				ProgramDataBaseFileName=".\"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib"
+				OutputFile="..\Release\rasterSlicing.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=""
+				SubSystem="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				WarningLevel="0"
+				DefaultCharType="0"
+				EnableErrorChecks="1"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="rasterSlicing.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/spatialQuery/.cdtproject b/examples/spatialQuery/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/spatialQuery/.cdtproject
+++ b/examples/spatialQuery/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/spatialQuery/.project b/examples/spatialQuery/.project
old mode 100755
new mode 100644
index 39aa224..fc1fde4
--- a/examples/spatialQuery/.project
+++ b/examples/spatialQuery/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>spatialQuery</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>spatialQuery</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/spatialQuery/Makefile b/examples/spatialQuery/Makefile
old mode 100755
new mode 100644
index 91fa4a7..d27837d
--- a/examples/spatialQuery/Makefile
+++ b/examples/spatialQuery/Makefile
@@ -1,31 +1,31 @@
-all: spatialQuery
-
-debug: spatialQuery_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-	
-spatialQuery: terralib 
-	qmake -o makeSpatialQuery spatialQuery.pro; make -f makeSpatialQuery
-
-spatialQuery_dbg: terralib_dbg 
-	qmake -o makeSpatialQuery.debug spatialQuery.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeSpatialQuery.debug
-
-
-clean:
-	if \
-		test -f makeSpatialQuery; \
-	then \
-		make -f makeSpatialQuery distclean; rm -f makeSpatialQuery; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeSpatialQuery.debug; \
-	then \
-		make -f makeSpatialQuery.debug distclean; rm -f makeSpatialQuery.debug; \
+all: spatialQuery
+
+debug: spatialQuery_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+	
+spatialQuery: terralib 
+	qmake -o makeSpatialQuery spatialQuery.pro; make -f makeSpatialQuery
+
+spatialQuery_dbg: terralib_dbg 
+	qmake -o makeSpatialQuery.debug spatialQuery.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeSpatialQuery.debug
+
+
+clean:
+	if \
+		test -f makeSpatialQuery; \
+	then \
+		make -f makeSpatialQuery distclean; rm -f makeSpatialQuery; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeSpatialQuery.debug; \
+	then \
+		make -f makeSpatialQuery.debug distclean; rm -f makeSpatialQuery.debug; \
 	fi	
\ No newline at end of file
diff --git a/examples/spatialQuery/spatialQuery.cpp b/examples/spatialQuery/spatialQuery.cpp
old mode 100755
new mode 100644
index 5bee991..efe2d25
--- a/examples/spatialQuery/spatialQuery.cpp
+++ b/examples/spatialQuery/spatialQuery.cpp
@@ -1,186 +1,186 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file shows an example of how to use the database interface to do some
-	spatial queries involving objects with points, lines and polygon geometries.
-
-	Authors: 
-		Karine Reis Ferreira  
-		Lubia Vinhas
-*/
-
-#include <TeMySQL.h>
-#include <TeDriverSHPDBF.h>
-
-int main()
-{
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to the DB320RC1 MySQL database 
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
-
-	// Check whether there is a layer of polygons called "Mapa_Distritos_SP".
-	// In negative case, import it from the Mapa_Distritos_SP.shp file
-	string layerName = "Mapa_Distritos_SP";
-
-	TeDatum sad69 = TeDatumFactory::make("SAD69");
-	TePolyconic* proj = new TePolyconic(sad69, -54*TeCDR);
-
-	if (db->layerExist(layerName) == false)
-	{
-		// Create a new layer in the database
-		TeLayer* layer = new TeLayer(layerName, db, proj);
-		string filename = "../data/Mapa_Distritos_SP.shp";	// Shapefile path
-		string tablename = "Mapa_Distritos_SP";	// Name of the attribute table
-
-		if (TeImportShape(layer, filename, tablename))
-			cout << "The shapefile \"Mapa_Distritos_SP.shp\" was imported successfully into the TerraLib database!\n" << endl;
-		else
-			cout << "Error: Fail to import the shapefile \"Mapa_Distritos_SP.shp\"!\n" << endl;
-	}	
-
-	// Check whether there is a layer of lines called "Mapa_Drenagem_SP".
-	// In negative case, import it from the Mapa_Drenagem_SP.shp file
-	layerName = "Mapa_Drenagem_SP";
-
-	if (db->layerExist(layerName) == false)
-	{
-		// Create a new layer in the database
-		TeLayer* layer = new TeLayer(layerName, db, proj);
-		string filename = "../data/Mapa_Drenagem_SP.shp";	// Shapefile path
-		string tablename = "Mapa_Drenagem_SP";	// Name of the attribute table
-
-		if (TeImportShape(layer, filename, tablename))
-			cout << "The shapefile \"Mapa_Drenagem_SP.shp\" was imported successfully into the TerraLib database!\n" << endl;
-		else
-			cout << "Error: Fail to import the shapefile \"Mapa_Drenagem_SP.shp\"!\n" << endl;
-	}
-
-	// Check whether there is a layer of points called "Mapa_Bairros_SP".
-	// In negative case, import it from the Mapa_Bairros_SP.shp file
-	layerName = "Mapa_Industrias_SP";
-
-	if (db->layerExist(layerName) == false)
-	{
-		// Create a new layer in the database
-		TeLayer* layer = new TeLayer(layerName, db, proj);
-		string filename = "../data/Mapa_Industrias_SP.shp";	// Shapefile path
-		string tablename = "Mapa_Industrias_SP";	// Name of the attribute table
-
-		if (TeImportShape(layer, filename, tablename))
-			cout << "The shapefile \"Mapa_Industrias_SP.shp\" was imported successfully into the TerraLib database!\n" << endl;
-		else
-			cout << "Error: Fail to import the shapefile \"Mapa_Industrias_SP.shp\"!\n" << endl;
-	}
-
-	// Retrieve from the database a layer of polygons, a layer of lines and a layer of points
-    TeLayer* regions = new TeLayer("Mapa_Distritos_SP");		// regions have polygons
-    if (!db->loadLayer(regions))                
-    {                                                                                               
-        cout << "Fail to load layer \"Mapa_Distritos_SP\": " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-    }
-
-    TeLayer* rivers = new TeLayer("Mapa_Drenagem_SP");	// rivers have lines
-    if (!db->loadLayer(rivers))                
-    {                                                                                               
-        cout << "Fail to load layer \"Mapa_Drenagem_SP\": " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-    }
-
-	TeLayer* industries = new TeLayer("Mapa_Industrias_SP");	// districts have points
-    if (!db->loadLayer(industries))                
-    {                                                                                               
-        cout << "Fail to load layer \"Mapa_Industrias_SP\": " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-    }
-
-	//get precision from projection
-	TePrecision::instance().setPrecision(TeGetPrecision(proj));	
-	
-	vector<string> objsOut;	// holds the identification of the resulting objects
-	
-	vector<string> objsIn;  // objects to be queried		
-	objsIn.push_back("48");
-
-	// Retrieve the regions that are adjacent or touch the district 48
-	bool res = db->spatialRelation(regions->tableName(TePOLYGONS), TePOLYGONS, objsIn,
-		                      objsOut, TeTOUCHES);
-	if (res)
-	{
-		cout << "Regions that touch the region \"48\": \n";
-		unsigned int i;
-		for (i=0; i<objsOut.size(); i++)
-			cout << "Regions: " << objsOut[i] << endl;
-
-	}
-
-	// Retrieve the rivers that cross the district 48
-	res = db->spatialRelation(regions->tableName(TePOLYGONS), TePOLYGONS, objsIn,
-		                            rivers->tableName(TeLINES), TeLINES, objsOut, TeCROSSES);
-	if (res)
-	{
-		cout << "\nRivers that cross the region \"48\": \n";
-		unsigned int i;
-		for (i=0; i<objsOut.size(); i++)
-			cout << "River: " << objsOut[i] << endl;
-	}
-
-	// Retrieve the industries that are within the district 48
-	res = db->spatialRelation(regions->tableName(TePOLYGONS), TePOLYGONS, objsIn,
-		                      industries->tableName(TePOINTS), TePOINTS, objsOut, TeWITHIN);
-	if (res)
-	{
-		cout << "\nIndustries that are within the region \"48\": \n";
-		unsigned int i;
-		for (i=0; i<objsOut.size(); i++)
-			cout << "Industry: " << objsOut[i] << endl;
-
-	}
-
-	db->close();
-	cout << endl << "Press Enter\n";
-	cout.flush();
-	getchar();
-	return 0;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file shows an example of how to use the database interface to do some
+	spatial queries involving objects with points, lines and polygon geometries.
+
+	Authors: 
+		Karine Reis Ferreira  
+		Lubia Vinhas
+*/
+
+#include <TeMySQL.h>
+#include <TeDriverSHPDBF.h>
+
+int main()
+{
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+
+	// Check whether there is a layer of polygons called "Mapa_Distritos_SP".
+	// In negative case, import it from the Mapa_Distritos_SP.shp file
+	string layerName = "Mapa_Distritos_SP";
+
+	TeDatum sad69 = TeDatumFactory::make("SAD69");
+	TePolyconic* proj = new TePolyconic(sad69, -54*TeCDR);
+
+	if (db->layerExist(layerName) == false)
+	{
+		// Create a new layer in the database
+		TeLayer* layer = new TeLayer(layerName, db, proj);
+		string filename = "../data/Mapa_Distritos_SP.shp";	// Shapefile path
+		string tablename = "Mapa_Distritos_SP";	// Name of the attribute table
+
+		if (TeImportShape(layer, filename, tablename))
+			cout << "The shapefile \"Mapa_Distritos_SP.shp\" was imported successfully into the TerraLib database!\n" << endl;
+		else
+			cout << "Error: Fail to import the shapefile \"Mapa_Distritos_SP.shp\"!\n" << endl;
+	}	
+
+	// Check whether there is a layer of lines called "Mapa_Drenagem_SP".
+	// In negative case, import it from the Mapa_Drenagem_SP.shp file
+	layerName = "Mapa_Drenagem_SP";
+
+	if (db->layerExist(layerName) == false)
+	{
+		// Create a new layer in the database
+		TeLayer* layer = new TeLayer(layerName, db, proj);
+		string filename = "../data/Mapa_Drenagem_SP.shp";	// Shapefile path
+		string tablename = "Mapa_Drenagem_SP";	// Name of the attribute table
+
+		if (TeImportShape(layer, filename, tablename))
+			cout << "The shapefile \"Mapa_Drenagem_SP.shp\" was imported successfully into the TerraLib database!\n" << endl;
+		else
+			cout << "Error: Fail to import the shapefile \"Mapa_Drenagem_SP.shp\"!\n" << endl;
+	}
+
+	// Check whether there is a layer of points called "Mapa_Bairros_SP".
+	// In negative case, import it from the Mapa_Bairros_SP.shp file
+	layerName = "Mapa_Industrias_SP";
+
+	if (db->layerExist(layerName) == false)
+	{
+		// Create a new layer in the database
+		TeLayer* layer = new TeLayer(layerName, db, proj);
+		string filename = "../data/Mapa_Industrias_SP.shp";	// Shapefile path
+		string tablename = "Mapa_Industrias_SP";	// Name of the attribute table
+
+		if (TeImportShape(layer, filename, tablename))
+			cout << "The shapefile \"Mapa_Industrias_SP.shp\" was imported successfully into the TerraLib database!\n" << endl;
+		else
+			cout << "Error: Fail to import the shapefile \"Mapa_Industrias_SP.shp\"!\n" << endl;
+	}
+
+	// Retrieve from the database a layer of polygons, a layer of lines and a layer of points
+    TeLayer* regions = new TeLayer("Mapa_Distritos_SP");		// regions have polygons
+    if (!db->loadLayer(regions))                
+    {                                                                                               
+        cout << "Fail to load layer \"Mapa_Distritos_SP\": " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+    }
+
+    TeLayer* rivers = new TeLayer("Mapa_Drenagem_SP");	// rivers have lines
+    if (!db->loadLayer(rivers))                
+    {                                                                                               
+        cout << "Fail to load layer \"Mapa_Drenagem_SP\": " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+    }
+
+	TeLayer* industries = new TeLayer("Mapa_Industrias_SP");	// districts have points
+    if (!db->loadLayer(industries))                
+    {                                                                                               
+        cout << "Fail to load layer \"Mapa_Industrias_SP\": " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+    }
+
+	//get precision from projection
+	TePrecision::instance().setPrecision(TeGetPrecision(proj));	
+	
+	vector<string> objsOut;	// holds the identification of the resulting objects
+	
+	vector<string> objsIn;  // objects to be queried		
+	objsIn.push_back("48");
+
+	// Retrieve the regions that are adjacent or touch the district 48
+	bool res = db->spatialRelation(regions->tableName(TePOLYGONS), TePOLYGONS, objsIn,
+		                      objsOut, TeTOUCHES);
+	if (res)
+	{
+		cout << "Regions that touch the region \"48\": \n";
+		unsigned int i;
+		for (i=0; i<objsOut.size(); i++)
+			cout << "Regions: " << objsOut[i] << endl;
+
+	}
+
+	// Retrieve the rivers that cross the district 48
+	res = db->spatialRelation(regions->tableName(TePOLYGONS), TePOLYGONS, objsIn,
+		                            rivers->tableName(TeLINES), TeLINES, objsOut, TeCROSSES);
+	if (res)
+	{
+		cout << "\nRivers that cross the region \"48\": \n";
+		unsigned int i;
+		for (i=0; i<objsOut.size(); i++)
+			cout << "River: " << objsOut[i] << endl;
+	}
+
+	// Retrieve the industries that are within the district 48
+	res = db->spatialRelation(regions->tableName(TePOLYGONS), TePOLYGONS, objsIn,
+		                      industries->tableName(TePOINTS), TePOINTS, objsOut, TeWITHIN);
+	if (res)
+	{
+		cout << "\nIndustries that are within the region \"48\": \n";
+		unsigned int i;
+		for (i=0; i<objsOut.size(); i++)
+			cout << "Industry: " << objsOut[i] << endl;
+
+	}
+
+	db->close();
+	cout << endl << "Press Enter\n";
+	cout.flush();
+	getchar();
+	return 0;
+}
+
diff --git a/examples/spatialQuery/spatialQuery.dsp b/examples/spatialQuery/spatialQuery.dsp
old mode 100755
new mode 100644
index 6f11365..b706834
--- a/examples/spatialQuery/spatialQuery.dsp
+++ b/examples/spatialQuery/spatialQuery.dsp
@@ -1,126 +1,126 @@
-# Microsoft Developer Studio Project File - Name="spatialQuery" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=spatialQuery - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "spatialQuery.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "spatialQuery.mak" CFG="spatialQuery - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "spatialQuery - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "spatialQuery - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "spatialQuery - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\shapelib\Release\shapelib.lib /nologo /subsystem:console /machine:I386 /out:"../Release/spatialQuery.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "spatialQuery - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib  ..\..\terralibw\shapelib\Debug\shapelib.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/spatialQuery.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "spatialQuery - Win32 Release"
-# Name "spatialQuery - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\spatialQuery.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportDBF.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportSHP.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportExport.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="spatialQuery" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=spatialQuery - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "spatialQuery.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "spatialQuery.mak" CFG="spatialQuery - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "spatialQuery - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "spatialQuery - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "spatialQuery - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I "..\..\src [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\shapelib\Release\shapelib.lib /nologo /subsystem:console /machine:I386 /out:"../Release/spatialQuery.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "spatialQuery - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\terralibw\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drivers\OracleSpatial\OCI\include" /I " [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib  ..\..\terralibw\shapelib\Debug\shapelib.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/spatialQuery.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "spatialQuery - Win32 Release"
+# Name "spatialQuery - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\spatialQuery.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportDBF.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportSHP.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportExport.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/spatialQuery/spatialQuery.dsw b/examples/spatialQuery/spatialQuery.dsw
old mode 100755
new mode 100644
index 7405772..3266bac
--- a/examples/spatialQuery/spatialQuery.dsw
+++ b/examples/spatialQuery/spatialQuery.dsw
@@ -1,62 +1,62 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "shapelib"=..\..\terralibw\shapelib\shapelib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "spatialQuery"=.\spatialQuery.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name shapelib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "shapelib"=..\..\terralibw\shapelib\shapelib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "spatialQuery"=.\spatialQuery.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name shapelib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/spatialQuery/spatialQuery.pro b/examples/spatialQuery/spatialQuery.pro
old mode 100755
new mode 100644
index bf8c18b..f250482
--- a/examples/spatialQuery/spatialQuery.pro
+++ b/examples/spatialQuery/spatialQuery.pro
@@ -1,12 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	spatialQuery.cpp \
-	../../src/terralib/drivers/shapelib/TeImportDBF.cpp \
-	../../src/terralib/drivers/shapelib/TeImportSHP.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/functions/TeImportExport.h \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
+TARGET = spatialQuery
+
+include( ../base/base.pro )
+
+LIBS += -lte_shapelib
+
+SOURCES	+= \
+	spatialQuery.cpp
\ No newline at end of file
diff --git a/examples/spatialQuery/spatialQuery.sln b/examples/spatialQuery/spatialQuery.sln
old mode 100755
new mode 100644
diff --git a/examples/spatialQuery/spatialQuery.vcproj b/examples/spatialQuery/spatialQuery.vcproj
old mode 100755
new mode 100644
index 5539c6a..b1115f8
--- a/examples/spatialQuery/spatialQuery.vcproj
+++ b/examples/spatialQuery/spatialQuery.vcproj
@@ -1,189 +1,160 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="spatialQuery"
-	ProjectGUID="{1175F29C-62AB-4584-99FC-34692ABCFF08}"
-	SccProjectName=""
-	SccLocalPath="">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\shapelib;..\..\src\terralib\drivers\shapelib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				PrecompiledHeaderFile=".\Release/spatialQuery.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Release/spatialQuery.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				ProgramDatabaseFile=".\Release/spatialQuery.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Release/spatialQuery.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\shapelib;..\..\src\terralib\drivers\shapelib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				PrecompiledHeaderFile=".\Debug/spatialQuery.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Debug/spatialQuery.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=".\Debug/spatialQuery.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Debug/spatialQuery.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath=".\spatialQuery.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\shapelib\TeDriverSHPDBF.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\shapelib\TeDriverSHPDBF.h">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="spatialQuery"
+	ProjectGUID="{1175F29C-62AB-4584-99FC-34692ABCFF08}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\shapelib;..\..\src\terralib\drivers\shapelib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/spatialQuery.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../Release/te_shapelib/te_shapelib.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/spatialQuery.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/spatialQuery.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/spatialQuery.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\shapelib;..\..\src\terralib\drivers\shapelib;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/spatialQuery.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../Debug/te_shapelib/te_shapelib.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/spatialQuery.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/spatialQuery.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/spatialQuery.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath=".\spatialQuery.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/spatialQueryAndBuffer/.cdtproject b/examples/spatialQueryAndBuffer/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/spatialQueryAndBuffer/.cdtproject
+++ b/examples/spatialQueryAndBuffer/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/spatialQueryAndBuffer/.project b/examples/spatialQueryAndBuffer/.project
old mode 100755
new mode 100644
index 3714cb2..0b79a64
--- a/examples/spatialQueryAndBuffer/.project
+++ b/examples/spatialQueryAndBuffer/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>spatialQueryAndBuffer</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>spatialQueryAndBuffer</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/spatialQueryAndBuffer/Makefile b/examples/spatialQueryAndBuffer/Makefile
old mode 100755
new mode 100644
index 4c60522..246bc9e
--- a/examples/spatialQueryAndBuffer/Makefile
+++ b/examples/spatialQueryAndBuffer/Makefile
@@ -1,30 +1,30 @@
-all: spatialQueryAndBuffer
-
-debug: spatialQueryAndBuffer_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-spatialQueryAndBuffer: terralib 
-	qmake -o makeSpatialQueryAndBuffer spatialQueryAndBuffer.pro; make -f makeSpatialQueryAndBuffer
-
-spatialQueryAndBuffer_dbg: terralib_dbg 
-	qmake -o makeSpatialQueryAndBuffer.debug spatialQueryAndBuffer.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeSpatialQueryAndBuffer.debug
-
-clean:
-	if \
-		test -f makeSpatialQueryAndBuffer; \
-	then \
-		make -f makeSpatialQueryAndBuffer distclean; rm -f makeSpatialQueryAndBuffer; \
-	fi
-	
-clean_dbg:
-	if \
-		test -f makeSpatialQueryAndBuffer.debug; \
-	then \
-		make -f makeSpatialQueryAndBuffer.debug distclean; rm -f makeSpatialQueryAndBuffer.debug; \
+all: spatialQueryAndBuffer
+
+debug: spatialQueryAndBuffer_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+spatialQueryAndBuffer: terralib 
+	qmake -o makeSpatialQueryAndBuffer spatialQueryAndBuffer.pro; make -f makeSpatialQueryAndBuffer
+
+spatialQueryAndBuffer_dbg: terralib_dbg 
+	qmake -o makeSpatialQueryAndBuffer.debug spatialQueryAndBuffer.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeSpatialQueryAndBuffer.debug
+
+clean:
+	if \
+		test -f makeSpatialQueryAndBuffer; \
+	then \
+		make -f makeSpatialQueryAndBuffer distclean; rm -f makeSpatialQueryAndBuffer; \
+	fi
+	
+clean_dbg:
+	if \
+		test -f makeSpatialQueryAndBuffer.debug; \
+	then \
+		make -f makeSpatialQueryAndBuffer.debug distclean; rm -f makeSpatialQueryAndBuffer.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.cpp b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.cpp
old mode 100755
new mode 100644
index 0082bd7..e6a2275
--- a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.cpp
+++ b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.cpp
@@ -1,110 +1,110 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-   This file shows an example of how to use the database interface to do some
-   spatial queries involving objects with points, lines and polygon geometries,
-   and to generate a buffer operation.
-
-   Author: Karine Reis   
-*/
-
-#include <TeMySQL.h>
-
-int main()
-{	
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to the DB320RC1 MySQL database 
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
-		
-	// Retrieve from the database the layer "Mapa_Distritos_SP"
-    TeLayer* regions = new TeLayer("Mapa_Distritos_SP");		
-    if (!db->loadLayer(regions))                
-    {                                                                                               
-        cout << "Fail to load layer \"Mapa_Distritos_SP\": " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-    }
-
-    // Retrieve from the database the layer "Mapa_Industrias_SP"
-	TeLayer* industries = new TeLayer("Mapa_Industrias_SP");	
-    if (!db->loadLayer(industries))                
-    {                                                                                               
-        cout << "Fail to load layer \"Mapa_Industrias_SP\": " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-    }
-
-	TePrecision::instance().setPrecision(TeGetPrecision(regions->projection()));
-
-	// holds the identification of the resulting objects
-	vector<string> objsOut;	
-	vector<string> objsIn;  // objects to be queried		
-	objsIn.push_back("48");
-	
-	// Generate a buffer (polygon) around 1000 meters distance from the element "48"
-	TePolygonSet bufferPol;
-	if (!db->buffer(regions->tableName(TePOLYGONS), TePOLYGONS,
-                     objsIn, bufferPol, 1000))
-	{
-		cout << "Fail to generate buffer!" << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	
-	// Retrieve the industries that are within the buffer generated
-	if(!db->spatialRelation(industries->tableName(TePOINTS), TePOINTS, &bufferPol, objsOut, TeWITHIN)) 
-	{
-		cout << "Fail to retrieve districts!" << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-
-	//Shows the result
-	cout << " Retrieved industries:" << endl << endl;
-	for(unsigned int i=0; i<objsOut.size(); i++)
-		cout << "      " << objsOut[i] << endl;
-
-	
-	db->close();
-	cout << endl << "Press Enter\n";
-	getchar();
-	return 0;
-};
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+   This file shows an example of how to use the database interface to do some
+   spatial queries involving objects with points, lines and polygon geometries,
+   and to generate a buffer operation.
+
+   Author: Karine Reis   
+*/
+
+#include <TeMySQL.h>
+
+int main()
+{	
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+		
+	// Retrieve from the database the layer "Mapa_Distritos_SP"
+    TeLayer* regions = new TeLayer("Mapa_Distritos_SP");		
+    if (!db->loadLayer(regions))                
+    {                                                                                               
+        cout << "Fail to load layer \"Mapa_Distritos_SP\": " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+    }
+
+    // Retrieve from the database the layer "Mapa_Industrias_SP"
+	TeLayer* industries = new TeLayer("Mapa_Industrias_SP");	
+    if (!db->loadLayer(industries))                
+    {                                                                                               
+        cout << "Fail to load layer \"Mapa_Industrias_SP\": " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+    }
+
+	TePrecision::instance().setPrecision(TeGetPrecision(regions->projection()));
+
+	// holds the identification of the resulting objects
+	vector<string> objsOut;	
+	vector<string> objsIn;  // objects to be queried		
+	objsIn.push_back("48");
+	
+	// Generate a buffer (polygon) around 1000 meters distance from the element "48"
+	TePolygonSet bufferPol;
+	if (!db->buffer(regions->tableName(TePOLYGONS), TePOLYGONS,
+                     objsIn, bufferPol, 1000))
+	{
+		cout << "Fail to generate buffer!" << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	
+	// Retrieve the industries that are within the buffer generated
+	if(!db->spatialRelation(industries->tableName(TePOINTS), TePOINTS, &bufferPol, objsOut, TeWITHIN)) 
+	{
+		cout << "Fail to retrieve districts!" << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+
+	//Shows the result
+	cout << " Retrieved industries:" << endl << endl;
+	for(unsigned int i=0; i<objsOut.size(); i++)
+		cout << "      " << objsOut[i] << endl;
+
+	
+	db->close();
+	cout << endl << "Press Enter\n";
+	getchar();
+	return 0;
+};
diff --git a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.dsp b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.dsp
old mode 100755
new mode 100644
index 27416ac..d41e4b4
--- a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.dsp
+++ b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.dsp
@@ -1,126 +1,126 @@
-# Microsoft Developer Studio Project File - Name="spatialQueryAndBuffer" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=spatialQueryAndBuffer - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "spatialQueryAndBuffer.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "spatialQueryAndBuffer.mak" CFG="spatialQueryAndBuffer - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "spatialQueryAndBuffer - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "spatialQueryAndBuffer - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "spatialQueryAndBuffer - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drive [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\tiff\Release\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/spatialQu [...]
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "spatialQueryAndBuffer - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terra [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\tiff\Debug\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/spatialQue [...]
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "spatialQueryAndBuffer - Win32 Release"
-# Name "spatialQueryAndBuffer - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\spatialQueryAndBuffer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportDBF.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportSHP.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\functions\TeImportExport.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="spatialQueryAndBuffer" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=spatialQueryAndBuffer - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "spatialQueryAndBuffer.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "spatialQueryAndBuffer.mak" CFG="spatialQueryAndBuffer - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "spatialQueryAndBuffer - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "spatialQueryAndBuffer - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "spatialQueryAndBuffer - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drive [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib ..\..\terralibw\shapelib\Release\shapelib.lib ..\..\terralibw\tiff\Release\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /machine:I386 /out:"../Release/spatialQu [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "spatialQueryAndBuffer - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terra [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\shapelib\Debug\shapelib.lib ..\..\terralibw\tiff\Debug\tiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/spatialQue [...]
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "spatialQueryAndBuffer - Win32 Release"
+# Name "spatialQueryAndBuffer - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\spatialQueryAndBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportDBF.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportSHP.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\functions\TeImportExport.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.dsw b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.dsw
old mode 100755
new mode 100644
index f3d66c5..f03917b
--- a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.dsw
+++ b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.dsw
@@ -1,62 +1,62 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "shapelib"=..\..\terralibw\shapelib\shapelib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "spatialQueryAndBuffer"=.\spatialQueryAndBuffer.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name shapelib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "shapelib"=..\..\terralibw\shapelib\shapelib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "spatialQueryAndBuffer"=.\spatialQueryAndBuffer.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name shapelib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.pro b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.pro
old mode 100755
new mode 100644
index e7b4f7e..e5a9d37
--- a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.pro
+++ b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.pro
@@ -1,13 +1,8 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	spatialQueryAndBuffer.cpp \
-	../../src/terralib/drivers/shapelib/TeImportDBF.cpp \
-	../../src/terralib/drivers/shapelib/TeImportSHP.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/functions/TeImportExport.h \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
-
+TARGET = spatialQueryAndBuffer
+
+include( ../base/base.pro )
+
+LIBS += -lte_functions
+
+SOURCES	+= \
+	spatialQueryAndBuffer.cpp
\ No newline at end of file
diff --git a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.sln b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.sln
old mode 100755
new mode 100644
diff --git a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.vcproj b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.vcproj
old mode 100755
new mode 100644
index 39f2138..478ca62
--- a/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.vcproj
+++ b/examples/spatialQueryAndBuffer/spatialQueryAndBuffer.vcproj
@@ -1,183 +1,160 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="spatialQueryAndBuffer"
-	ProjectGUID="{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}"
-	SccProjectName=""
-	SccLocalPath="">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				PrecompiledHeaderFile=".\Release/spatialQueryAndBuffer.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Release/spatialQueryAndBuffer.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				ProgramDatabaseFile=".\Release/spatialQueryAndBuffer.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Release/spatialQueryAndBuffer.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				PrecompiledHeaderFile=".\Debug/spatialQueryAndBuffer.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Debug/spatialQueryAndBuffer.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=".\Debug/spatialQueryAndBuffer.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Debug/spatialQueryAndBuffer.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath=".\spatialQueryAndBuffer.cpp">
-			</File>
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="spatialQueryAndBuffer"
+	ProjectGUID="{F7A9F697-5308-42A0-A2A6-1D30BAEAC17B}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/spatialQueryAndBuffer.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/spatialQueryAndBuffer.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/spatialQueryAndBuffer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/spatialQueryAndBuffer.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;..\..\src\terralib\kernel;..\..\src\terralib\functions;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/spatialQueryAndBuffer.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/spatialQueryAndBuffer.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/spatialQueryAndBuffer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/spatialQueryAndBuffer.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath=".\spatialQueryAndBuffer.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/examples/themeGrouping/.cdtproject b/examples/themeGrouping/.cdtproject
old mode 100755
new mode 100644
index fc69c6a..6a7b054
--- a/examples/themeGrouping/.cdtproject
+++ b/examples/themeGrouping/.cdtproject
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-<item id="cdt_indexer">
-<indexEnabled indexValue="false"/>
-<indexerProblemsEnabled indexProblemsValue="0"/>
-</item>
-</data>
-</cdtproject>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="cdt_indexer">
+<indexEnabled indexValue="false"/>
+<indexerProblemsEnabled indexProblemsValue="0"/>
+</item>
+</data>
+</cdtproject>
diff --git a/examples/themeGrouping/.project b/examples/themeGrouping/.project
old mode 100755
new mode 100644
index 36ddddb..e52e40a
--- a/examples/themeGrouping/.project
+++ b/examples/themeGrouping/.project
@@ -1,104 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>themeGrouping</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.core.errorOutputParser</key>
-					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>clean all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value></value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>make</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.stopOnError</key>
-					<value>false</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
-			<arguments>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
-					<value>true</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
-					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
-				</dictionary>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.cdt.core.cnature</nature>
-		<nature>org.eclipse.cdt.make.core.makeNature</nature>
-		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>themeGrouping</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.makeBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.core.errorOutputParser</key>
+					<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+					<value>clean all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+					<value>clean</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+					<value>all</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>false</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.ScannerConfigDiscoveryEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCScannerInfoConsoleParser</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderCommandEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.siProblemGenerationEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultESIProviderCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.makeBuilderParserEnabled</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.esiProviderParserId</key>
+					<value>org.eclipse.cdt.make.core.GCCSpecsConsoleParser</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.make.core.makeNature</nature>
+		<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/examples/themeGrouping/Makefile b/examples/themeGrouping/Makefile
old mode 100755
new mode 100644
index 6a8f21d..c2cb766
--- a/examples/themeGrouping/Makefile
+++ b/examples/themeGrouping/Makefile
@@ -1,30 +1,30 @@
-all: themeGrouping
-
-debug: themeGrouping_dbg
-
-terralib:
-	cd ../../terralibx/terralib; make
-	
-terralib_dbg:
-	cd ../../terralibx/terralib; make debug
-
-themeGrouping:  terralib 
-	qmake -o makeThemeGrouping themeGrouping.pro; make -f makeThemeGrouping
-
-themeGrouping_dbg:  terralib_dbg 
-	qmake -o makeThemeGrouping.debug themeGrouping.pro TE_PROJECT_TYPE=DEBUG; \
-	make -f makeThemeGrouping.debug
-
-clean:
-	if \
-		test -f makeThemeGrouping; \
-	then \
-		make -f makeThemeGrouping distclean; rm -f makeThemeGrouping; \
-	fi
-	
-clean_debug:
-	if \
-		test -f makeThemeGrouping.debug; \
-	then \
-		make -f makeThemeGrouping.debug distclean; rm -f makeThemeGrouping.debug; \
+all: themeGrouping
+
+debug: themeGrouping_dbg
+
+terralib:
+	cd ../../terralibx/terralib; make
+	
+terralib_dbg:
+	cd ../../terralibx/terralib; make debug
+
+themeGrouping:  terralib 
+	qmake -o makeThemeGrouping themeGrouping.pro; make -f makeThemeGrouping
+
+themeGrouping_dbg:  terralib_dbg 
+	qmake -o makeThemeGrouping.debug themeGrouping.pro TE_PROJECT_TYPE=DEBUG; \
+	make -f makeThemeGrouping.debug
+
+clean:
+	if \
+		test -f makeThemeGrouping; \
+	then \
+		make -f makeThemeGrouping distclean; rm -f makeThemeGrouping; \
+	fi
+	
+clean_debug:
+	if \
+		test -f makeThemeGrouping.debug; \
+	then \
+		make -f makeThemeGrouping.debug distclean; rm -f makeThemeGrouping.debug; \
 	fi
\ No newline at end of file
diff --git a/examples/themeGrouping/themeGrouping.cpp b/examples/themeGrouping/themeGrouping.cpp
old mode 100755
new mode 100644
index 8abb486..1404584
--- a/examples/themeGrouping/themeGrouping.cpp
+++ b/examples/themeGrouping/themeGrouping.cpp
@@ -1,121 +1,121 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* 
-	This file illustrates how to group objects of a theme. Each group of objects 
-	is associated to a legend.
-
-	Authors: Karine Reis Ferreira 
-*/
-
-#include <TeLegendEntry.h>
-#include <TeMySQL.h>
-
-int main()
-{
- 	// Datatabase server parameters
-	string host = "localhost";
-	string dbname = "DB320RC1";
-	string user = "root";
-	string password = "vinhas";
-
-	// Open a connection to the DB320RC1 MySQL database 
-	TeDatabase* db = new TeMySQL();
-	if (!db->connect(host, user, password, dbname))
-	{
-		cout << "Error: " << db->errorMessage() << endl;
-		cout << endl << "Press Enter\n";
-		getchar();
-		return 1;
-	}
-	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
-	
-	// Load a previously created theme named T_dist.
-	// This theme was created on a layer of the metropolitan districts of Sao Paulo city
-	TeTheme* trmsp = new TeTheme("DistritosSaoPaulo");
-	if (!db->loadTheme(trmsp))
-	{
-	    cout << "Fail to load the theme \"T_dist\": " << db->errorMessage() << endl;
-		db->close();
-		cout << endl << "Press Enter\n";
-		getchar();
-        return 1;
-	}
-	trmsp->resetGrouping();		// clear any grouping previously created
-	
-	TeAttributeRep rep;			// grouping will be based on the attribute named "area_km2"
-	rep.name_ = " area_km2 ";	// that contains the area of each metropolitan district
-	rep.type_ = TeREAL;
-
-	TeGrouping equalstep3;					// define a particular way of grouping objects
-	equalstep3.groupAttribute_ = rep;
-	equalstep3.groupMode_ = TeEqualSteps;	// equal steps in 3 groups
-	equalstep3.groupNumSlices_ = 3;
-	if (!trmsp->buildGrouping(equalstep3))	// generate groups based on the grouping definition
-	{
-	    cout << "Fail to generate the groups: " << db->errorMessage() << endl;
-		db->close();
-		cout << endl << "Press Enter\n";
-		getchar();
-        return 1;
-	}
-    
-	// Associate a different visual to each group
-
-	TeVisual visual(TePOLYGONS);		// group 1: dark green
-	TeColor color(0,200,0);
-	visual.color(color);
-	trmsp->setGroupingVisual(1,&visual,TePOLYGONS);
-
-	color.init(0,150,0);
-	visual.color(color);		// group 2: medium green
-	trmsp->setGroupingVisual(2,&visual,TePOLYGONS);
-
-	color.init(0,100,0);	
-	visual.color(color);		// group 3: light red
-	trmsp->setGroupingVisual(3,&visual,TePOLYGONS);	
-	
-	if (!trmsp->saveGrouping())			// save grouping definition
-	{
-	    cout << "Fail to save the grouping: " << db->errorMessage() << endl;
-		db->close();
-		cout << endl << "Press Enter\n";
-		getchar();
-        return 1;
-	}
-		
-	if (!trmsp->saveLegendInCollection())			// save grouping definition
-	{
-	    cout << "Fail to save the grouping: " << db->errorMessage() << endl;
-		db->close();
-		cout << endl << "Press Enter\n";
-		getchar();
-        return 1;
-	}
-	db->close();
-	cout << "Theme was successfully grouped! " << endl;
-	cout << endl << "Press Enter\n";
-    getchar();
-	return 0;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* 
+	This file illustrates how to group objects of a theme. Each group of objects 
+	is associated to a legend.
+
+	Authors: Karine Reis Ferreira 
+*/
+
+#include <TeLegendEntry.h>
+#include <TeMySQL.h>
+
+int main()
+{
+ 	// Datatabase server parameters
+	string host = "localhost";
+	string dbname = "DB320RC1";
+	string user = "root";
+	string password = "vinhas";
+
+	// Open a connection to the DB320RC1 MySQL database 
+	TeDatabase* db = new TeMySQL();
+	if (!db->connect(host, user, password, dbname))
+	{
+		cout << "Error: " << db->errorMessage() << endl;
+		cout << endl << "Press Enter\n";
+		getchar();
+		return 1;
+	}
+	cout << "Connection successful to the database \"" << dbname << "\" on MySQL server \"" << host << "\" !\n";;
+	
+	// Load a previously created theme named T_dist.
+	// This theme was created on a layer of the metropolitan districts of Sao Paulo city
+	TeTheme* trmsp = new TeTheme("DistritosSaoPaulo");
+	if (!db->loadTheme(trmsp))
+	{
+	    cout << "Fail to load the theme \"T_dist\": " << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+        return 1;
+	}
+	trmsp->resetGrouping();		// clear any grouping previously created
+	
+	TeAttributeRep rep;			// grouping will be based on the attribute named "area_km2"
+	rep.name_ = " area_km2 ";	// that contains the area of each metropolitan district
+	rep.type_ = TeREAL;
+
+	TeGrouping equalstep3;					// define a particular way of grouping objects
+	equalstep3.groupAttribute_ = rep;
+	equalstep3.groupMode_ = TeEqualSteps;	// equal steps in 3 groups
+	equalstep3.groupNumSlices_ = 3;
+	if (!trmsp->buildGrouping(equalstep3))	// generate groups based on the grouping definition
+	{
+	    cout << "Fail to generate the groups: " << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+        return 1;
+	}
+    
+	// Associate a different visual to each group
+
+	TeVisual visual(TePOLYGONS);		// group 1: dark green
+	TeColor color(0,200,0);
+	visual.color(color);
+	trmsp->setGroupingVisual(1,&visual,TePOLYGONS);
+
+	color.init(0,150,0);
+	visual.color(color);		// group 2: medium green
+	trmsp->setGroupingVisual(2,&visual,TePOLYGONS);
+
+	color.init(0,100,0);	
+	visual.color(color);		// group 3: light red
+	trmsp->setGroupingVisual(3,&visual,TePOLYGONS);	
+	
+	if (!trmsp->saveGrouping())			// save grouping definition
+	{
+	    cout << "Fail to save the grouping: " << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+        return 1;
+	}
+		
+	if (!trmsp->saveLegendInCollection())			// save grouping definition
+	{
+	    cout << "Fail to save the grouping: " << db->errorMessage() << endl;
+		db->close();
+		cout << endl << "Press Enter\n";
+		getchar();
+        return 1;
+	}
+	db->close();
+	cout << "Theme was successfully grouped! " << endl;
+	cout << endl << "Press Enter\n";
+    getchar();
+	return 0;
+}
+
diff --git a/examples/themeGrouping/themeGrouping.dsp b/examples/themeGrouping/themeGrouping.dsp
old mode 100755
new mode 100644
index ec4f1e8..f6be904
--- a/examples/themeGrouping/themeGrouping.dsp
+++ b/examples/themeGrouping/themeGrouping.dsp
@@ -1,114 +1,114 @@
-# Microsoft Developer Studio Project File - Name="themeGrouping" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=themeGrouping - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "themeGrouping.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "themeGrouping.mak" CFG="themeGrouping - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "themeGrouping - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "themeGrouping - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "themeGrouping - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drive [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "NDEBUG"
-# ADD RSC /l 0x416 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/themeGrouping.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF  "$(CFG)" == "themeGrouping - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terra [...]
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x416 /d "_DEBUG"
-# ADD RSC /l 0x416 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\PostgreSQL\libpq.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/themeGrouping.exe" /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF 
-
-# Begin Target
-
-# Name "themeGrouping - Win32 Release"
-# Name "themeGrouping - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\themeGrouping.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="themeGrouping" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=themeGrouping - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "themeGrouping.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "themeGrouping.mak" CFG="themeGrouping - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "themeGrouping - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "themeGrouping - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "themeGrouping - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terralib\drive [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\terralibw\terralib\Release\terralib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib ..\..\terralibw\PostgreSQL\libpq.lib /nologo /subsystem:console /machine:I386 /out:"../Release/themeGrouping.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "themeGrouping - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\src\STLport" /I "." /I "..\..\src\terralib\kernel" /I "..\..\src\terralib\application" /I "..\..\src\terralib\functions" /I "..\..\src\terralib\stat" /I "..\..\src\shapelib" /I "..\..\src\zlib" /I "..\..\src\jpeg\include" /I "..\..\src\freetype\include" /I "..\..\src\terralib\drivers\ado" /I "..\..\src\terralib\drivers\MySQL" /I "..\..\src\terralib\drivers\MySQL\include" /I "..\..\src\terralib\drivers\OracleSpatial" /I "..\..\src\terra [...]
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\terralibw\terralib\Debug\terralib.lib ..\..\terralibw\PostgreSQL\libpq.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\terralibw\jpeg\ijl15.lib ..\..\terralibw\zlib\zlibdll.lib ..\..\terralibw\OracleSpatial\Oci\Oci.lib ..\..\terralibw\MySQL\libMySQL.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Debug/themeGrouping.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "themeGrouping - Win32 Release"
+# Name "themeGrouping - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\themeGrouping.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\src\terralib\drivers\MySQL\TeMySQL.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/examples/themeGrouping/themeGrouping.dsw b/examples/themeGrouping/themeGrouping.dsw
old mode 100755
new mode 100644
index 46ed566..cd34e1f
--- a/examples/themeGrouping/themeGrouping.dsw
+++ b/examples/themeGrouping/themeGrouping.dsw
@@ -1,47 +1,47 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name freetype
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "themeGrouping"=.\themeGrouping.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name terralib
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "terralib"=..\..\terralibw\terralib\terralib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name freetype
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "themeGrouping"=.\themeGrouping.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name terralib
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/examples/themeGrouping/themeGrouping.pro b/examples/themeGrouping/themeGrouping.pro
old mode 100755
new mode 100644
index 052d6e9..f7fde4b
--- a/examples/themeGrouping/themeGrouping.pro
+++ b/examples/themeGrouping/themeGrouping.pro
@@ -1,9 +1,6 @@
-include( ../base/base.pro )
-
-SOURCES	+= \
-	themeGrouping.cpp \
-	../../src/terralib/drivers/MySQL/TeMySQL.cpp
-
-HEADERS	+= \
-	../../src/terralib/drivers/MySQL/TeMySQL.h
-	
+TARGET = themeGrouping
+
+include( ../base/base.pro )
+
+SOURCES	+= \
+	themeGrouping.cpp
\ No newline at end of file
diff --git a/examples/themeGrouping/themeGrouping.sln b/examples/themeGrouping/themeGrouping.sln
old mode 100755
new mode 100644
diff --git a/examples/themeGrouping/themeGrouping.vcproj b/examples/themeGrouping/themeGrouping.vcproj
old mode 100755
new mode 100644
index c6273ac..3057ea2
--- a/examples/themeGrouping/themeGrouping.vcproj
+++ b/examples/themeGrouping/themeGrouping.vcproj
@@ -1,200 +1,177 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="themeGrouping"
-	ProjectGUID="{56B7D410-3CB8-445A-974E-ECCCF4C48232}"
-	SccProjectName=""
-	SccLocalPath="">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				PrecompiledHeaderFile=".\Release/themeGrouping.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Release/themeGrouping.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				ProgramDatabaseFile=".\Release/themeGrouping.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Release/themeGrouping.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Release\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				PrecompiledHeaderFile=".\Debug/themeGrouping.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../terralibw/zlib/zlibdll.lib ../../terralibw/MySQL/libMySQL.lib"
-				OutputFile="../Debug/themeGrouping.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=".\Debug/themeGrouping.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Debug/themeGrouping.tlb"
-				HeaderFileName=""/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
-				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1046"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.cpp">
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="themeGrouping.cpp">
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="2"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						Optimization="0"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-						BasicRuntimeChecks="3"/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl">
-			<File
-				RelativePath="..\..\src\terralib\drivers\MySQL\TeMySQL.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="themeGrouping"
+	ProjectGUID="{56B7D410-3CB8-445A-974E-ECCCF4C48232}"
+	SccProjectName=""
+	SccLocalPath="">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				PrecompiledHeaderFile=".\Release/themeGrouping.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Release/terralib/terralib.lib ../../Release/libjpeg/libjpeg.lib ../../Release/tiff/tiff.lib ../../Release/shapelib/shapelib.lib ../../Release/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Release/themeGrouping.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				ProgramDatabaseFile=".\Release/themeGrouping.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/themeGrouping.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Release\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Release\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..\..\src\terralib\kernel;..\..\src\terralib\drivers\MySQL;..\..\src\terralib\drivers\MySQL\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/themeGrouping.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="../../Debug/terralib/terralib.lib ../../Debug/libjpeg/libjpeg.lib ../../Debug/tiff/tiff.lib ../../Debug/shapelib/shapelib.lib ../../Debug/te_mysql/te_mysql.lib ../../dependencies/win32/zlib/lib/zlibdll.lib"
+				OutputFile="../Debug/themeGrouping.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/themeGrouping.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/themeGrouping.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				Description="copy /y ..\..\Debug\*.dll $(OutDir)"
+				CommandLine="copy /y ..\..\Debug\*.dll $(OutDir)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="themeGrouping.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BasicRuntimeChecks="3"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/src/DSDK/include/base/lt_cacheStatus.h b/src/DSDK/include/base/lt_cacheStatus.h
new file mode 100644
index 0000000..0b0bfa6
--- /dev/null
+++ b/src/DSDK/include/base/lt_cacheStatus.h
@@ -0,0 +1,28 @@
+/* $Id: lt_cacheStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */     
+/* PUBLIC */
+
+#ifndef LT_CACHESTATUS_H
+#define LT_CACHESTATUS_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+
+#define LT_STS_CACHE_BASE                        16000
+LT_STATUSSTRING_ADD(LT_STS_CACHE_BASE, "lt_lib_cache BASE")
+
+
+#define LT_STS_CACHE_MAX                        16999
+LT_STATUSSTRING_ADD(LT_STS_CACHE_MAX, "lt_lib_cache MAX")
+
+
+#endif // LT_CACHESTATUS_H
diff --git a/src/DSDK/include/base/lt_encryptStatus.h b/src/DSDK/include/base/lt_encryptStatus.h
new file mode 100644
index 0000000..ccc5d7b
--- /dev/null
+++ b/src/DSDK/include/base/lt_encryptStatus.h
@@ -0,0 +1,63 @@
+/* $Id: lt_encryptStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */     
+/* PUBLIC */
+
+
+#ifndef ENCRYPTSTATUS_H
+#define ENCRYPTSTATUS_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+
+#define LT_STS_EncryptBase                                     4000
+LT_STATUSSTRING_ADD(LT_STS_EncryptBase, "BASE")
+
+#define LT_STS_EncryptDISABLED                                 4001
+LT_STATUSSTRING_ADD(LT_STS_EncryptDISABLED, "security disabled")
+
+#define LT_STS_EncryptLOCK_ALREADY_LOCKED                      4002
+LT_STATUSSTRING_ADD(LT_STS_EncryptLOCK_ALREADY_LOCKED, "can't lock an already-locked image")
+#define LT_STS_EncryptUNLOCK_NOT_LOCKED                        4003
+LT_STATUSSTRING_ADD(LT_STS_EncryptUNLOCK_NOT_LOCKED, "can't unlock an unlocked imaged")
+#define LT_STS_EncryptLOCK_NEED_KEY                            4004
+LT_STATUSSTRING_ADD(LT_STS_EncryptLOCK_NEED_KEY, "can't lock an image without a key")
+
+#define LT_STS_EncryptUNLOCK_NEED_KEY                          4005
+LT_STATUSSTRING_ADD(LT_STS_EncryptUNLOCK_NEED_KEY, "can't unlock a locked image without a key")
+#define LT_STS_EncryptUNLOCK_WRONG_KEY                         4006
+LT_STATUSSTRING_ADD(LT_STS_EncryptUNLOCK_WRONG_KEY, "key is valid but doesn't match image's lock")
+#define LT_STS_EncryptINVALID_LICENSE                          4007
+LT_STATUSSTRING_ADD(LT_STS_EncryptINVALID_LICENSE, "License is invalid")
+#define LT_STS_EncryptBAD_PASSWORD                             4008
+LT_STATUSSTRING_ADD(LT_STS_EncryptBAD_PASSWORD, "Password is invalid")
+#define LT_STS_EncryptBAD_KEY                                  4009
+LT_STATUSSTRING_ADD(LT_STS_EncryptBAD_KEY, "key is invalid (violates definition of key)")
+#define LT_STS_EncryptLOCK_NO_KEY_PROVIDER                     4010
+LT_STATUSSTRING_ADD(LT_STS_EncryptLOCK_NO_KEY_PROVIDER, "can't lock without a key provider")
+#define LT_STS_EncryptUNLOCK_NO_KEY_PROVIDER                   4011
+LT_STATUSSTRING_ADD(LT_STS_EncryptUNLOCK_NO_KEY_PROVIDER, "can't unlock without a key provider")
+#define LT_STS_EncryptTYPE_KEY_PROVIDER_DEFINED                4012
+LT_STATUSSTRING_ADD(LT_STS_EncryptTYPE_KEY_PROVIDER_DEFINED, "UNLOCK_WRONG_KEY with KeyProvider specific msg")
+#define LT_STS_EncryptPromptToENCRYPT                          4013
+LT_STATUSSTRING_ADD(LT_STS_EncryptPromptToENCRYPT, "Prompt to encrypt")
+#define LT_STS_EncryptPromptToDECRYPT                          4014
+LT_STATUSSTRING_ADD(LT_STS_EncryptPromptToDECRYPT, "Prompt to decrypt")
+#define LT_STS_EncryptUnused4015                               4015
+
+#define LT_STS_EncryptInternalError                            4100
+LT_STATUSSTRING_ADD(LT_STS_EncryptInternalError, "Internal error")
+
+#define LT_STS_EncryptMax                                      4999
+LT_STATUSSTRING_ADD(LT_STS_EncryptMax, "MAX")
+
+
+#endif // ENCRYPTSTATUS_H
diff --git a/src/DSDK/include/base/lti_bbbImageReader.h b/src/DSDK/include/base/lti_bbbImageReader.h
new file mode 100644
index 0000000..9196cd6
--- /dev/null
+++ b/src/DSDK/include/base/lti_bbbImageReader.h
@@ -0,0 +1,154 @@
+/* $Id: lti_bbbImageReader.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_BBB_IMAGE_READER_H
+#define LTI_BBB_IMAGE_READER_H
+
+// lt_lib_mrsid_core
+#include "lti_rawImageReader.h"
+
+// system
+#include <stdio.h>  // for FILE*
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTIOStreamInf;
+class LTIReusableBSQBuffer;
+class LTIBBBHeaderReader;
+
+/**
+ * read an image from a BBB file
+ *
+ * This class provides support for reading BBB files, i.e. a raw file with a
+ * BIL/BIP/BSQ-style header.
+ *
+ */
+class LTIBBBImageReader : public LTIRawImageReader
+{
+public:
+   /**
+    * constructor
+    *
+    * This function creates an image from a BBB file.
+    *
+    * @param fileSpec      the image file to read from
+    * @param useWorldFile  use world file information if available
+    */
+   LTIBBBImageReader(const LTFileSpec& fileSpec, bool useWorldFile = true);
+
+   /**
+    * constructor
+    *
+    * This function creates an image from a BBB file.
+    *
+    * @param file          the image file to read from
+    * @param useWorldFile  use world file information if available
+    */
+   LTIBBBImageReader(const char* file, bool useWorldFile = true);
+
+   /**
+    * destructor
+    */
+   ~LTIBBBImageReader();
+
+   /**
+    * intializer
+    */
+   LT_STATUS initialize();
+
+private:
+   LT_STATUS checkWorldFile(LTIGeoCoord*&);
+   LT_STATUS doImagineMetadata();
+
+   LTIBBBHeaderReader* m_header;
+
+   // nope
+   LTIBBBImageReader();
+   LTIBBBImageReader(LTIBBBImageReader&);
+   LTIBBBImageReader& operator=(const LTIBBBImageReader&);
+};
+
+
+class LTIBBBHeaderReader
+{
+public:
+   LTIBBBHeaderReader(const LTFileSpec&);
+   ~LTIBBBHeaderReader();
+   LT_STATUS read();
+
+public:
+   int            m_width;
+   int            m_height;
+   LTIDataType    m_dataType;
+   LTIColorSpace  m_colorSpace;
+   int            m_numBands;
+   LTILayout      m_layout;
+   char*          m_byteOrder;
+   int            m_numBits;
+   LTIEndian      m_endian;
+
+   double         m_window;
+   double         m_level;
+   double         m_drMin;
+   double         m_drMax;
+   bool           m_hasWindow;
+   bool           m_hasLevel;
+   bool           m_hasDRMin;
+   bool           m_hasDRMax;
+
+   int            m_bandgapbytes;
+   int            m_bandrowbytes;
+   int            m_totalrowbytes;
+   int            m_skipbytes;
+
+   bool           m_hasUlxmap;
+   bool           m_hasUlymap;
+   bool           m_hasXdim;
+   bool           m_hasYdim;
+   double         m_ulxmap;
+   double         m_ulymap;
+   double         m_xdim;
+   double         m_ydim;
+
+   // Imagine header data
+   bool        m_bFromImagine; //indicates whether to display Imagine Metadata
+   char*       m_projname;
+   char*       m_sphereName;
+   char*       m_units;
+   int         m_proZone;
+   double*     m_projParams;
+   double      m_sphereMajor;
+   double      m_sphereMinor;
+   double      m_sphereEccentricitySquared;
+   double      m_sphereRadius;
+
+private:
+   LT_STATUS init();
+   LT_STATUS finish();
+   LT_STATUS readLines();
+   LT_STATUS readLine(int& offset_last, bool& done);
+   LT_STATUS nextLine();
+   LT_STATUS readInt(int&);
+   LT_STATUS readDouble(double&);
+   LT_STATUS readString(char*);
+
+   const LTFileSpec& m_fileSpec;
+   FILE* m_fp;
+   
+   LTIBBBHeaderReader(const LTIBBBHeaderReader &);
+   LTIBBBHeaderReader &operator=(const LTIBBBHeaderReader &);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#endif // LTI_BBB_IMAGE_READER_H
diff --git a/src/DSDK/include/base/lti_bbbImageWriter.h b/src/DSDK/include/base/lti_bbbImageWriter.h
new file mode 100644
index 0000000..643d0a9
--- /dev/null
+++ b/src/DSDK/include/base/lti_bbbImageWriter.h
@@ -0,0 +1,71 @@
+/* $Id: lti_bbbImageWriter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_BBBIMAGEWRITER_H
+#define LTI_BBBIMAGEWRITER_H
+
+// lt_lib_mrsid_core
+#include "lti_rawImageWriter.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+/**
+ * writes an image stage to a BBB file
+ *
+ * This class provides support for writing BBB files, i.e. a raw file with a BBB-style
+ * header.
+ */
+class LTIBBBImageWriter : public LTIRawImageWriter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates a writer for BBB images.
+    *
+    * @param  image   the image to write from
+    */
+   LTIBBBImageWriter(LTIImageStage* image);
+
+   virtual ~LTIBBBImageWriter();
+
+   LT_STATUS writeBegin(const LTIScene& scene);
+
+   static LT_STATUS writeHeader(const LTFileSpec& fileSpec,
+                                const LTIImage& image,
+                                const LTIScene* userScene,
+                                LTIEndian byteOrder,
+                                LTILayout layout);
+
+private:
+   LT_STATUS checkImpedance() const;
+
+   LT_STATUS writeHeader(const LTIScene&);
+
+   // nope
+   LTIBBBImageWriter();
+   LTIBBBImageWriter(LTIBBBImageWriter&);
+   LTIBBBImageWriter& operator=(const LTIBBBImageWriter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_BBBIMAGEWRITER_H
diff --git a/src/DSDK/include/base/lti_coreStatus.h b/src/DSDK/include/base/lti_coreStatus.h
new file mode 100644
index 0000000..2dbc27f
--- /dev/null
+++ b/src/DSDK/include/base/lti_coreStatus.h
@@ -0,0 +1,142 @@
+/* $Id: lti_coreStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_CORESTATUS_H
+#define LTI_CORESTATUS_H
+
+#include "lt_base.h"
+
+#define LTI_STS_Core_Base                          50000
+LT_STATUSSTRING_ADD(LTI_STS_Core_Base, "lt_lib_mrsid_core base")
+
+
+#define LTI_STS_Core_UnsupDataType                 50001
+LT_STATUSSTRING_ADD(LTI_STS_Core_UnsupDataType, "unsupported datatype")
+
+#define LTI_STS_Core_OperationNotSupported         50002
+LT_STATUSSTRING_ADD(LTI_STS_Core_OperationNotSupported, "requested operation not supported")
+
+#define LTI_STS_Core_InvalidArgument               50003
+LT_STATUSSTRING_ADD(LTI_STS_Core_InvalidArgument, "invalid argument to function")
+
+#define LTI_STS_Core_ErrorOpeningFile              50004    // NIT: add filename string
+LT_STATUSSTRING_ADD(LTI_STS_Core_ErrorOpeningFile, "error opening file")
+
+#define LTI_STS_Core_ErrorWritingFile              50005    // NIT: add filename string
+LT_STATUSSTRING_ADD(LTI_STS_Core_ErrorWritingFile, "error writing file")
+
+#define LTI_STS_Core_ErrorReadingFile              50006    // NIT: add filename string
+LT_STATUSSTRING_ADD(LTI_STS_Core_ErrorReadingFile, "error reading file")
+
+#define LTI_STS_Core_InternalError                 50007
+LT_STATUSSTRING_ADD(LTI_STS_Core_InternalError, "internal error")
+
+#define LTI_STS_Core_AllocFailed                   50008
+LT_STATUSSTRING_ADD(LTI_STS_Core_AllocFailed, "memory allocation failed")
+
+
+#define LTI_STS_Core_WorldFileNameError            50010    // NIT: add filename string
+LT_STATUSSTRING_ADD(LTI_STS_Core_WorldFileNameError, "error in world file name")
+
+#define LTI_STS_Core_OutputNotSpecified            50011
+LT_STATUSSTRING_ADD(LTI_STS_Core_OutputNotSpecified, "output target not specified")
+
+#define LTI_STS_Core_SceneTooLarge                 50012
+LT_STATUSSTRING_ADD(LTI_STS_Core_SceneTooLarge, "scene larger than 2GB")
+
+#define LTI_STS_Core_InvalidScene                  50013
+LT_STATUSSTRING_ADD(LTI_STS_Core_InvalidScene, "invalid or empty scene specified")
+
+#define LTI_STS_Core_SceneOutOfRange               50014
+LT_STATUSSTRING_ADD(LTI_STS_Core_SceneOutOfRange, "specified scene out of range of image")
+
+#define LTI_STS_Core_MagRangeError                 50015
+LT_STATUSSTRING_ADD(LTI_STS_Core_MagRangeError, "scene magnification out of range")
+
+#define LTI_STS_Core_ImpedanceMismatchDataType     50016
+LT_STATUSSTRING_ADD(LTI_STS_Core_ImpedanceMismatchDataType, "impedance mismatch - datatype")
+
+#define LTI_STS_Core_ImpedanceMismatchColorSpace   50017
+LT_STATUSSTRING_ADD(LTI_STS_Core_ImpedanceMismatchColorSpace, "impedance mismatch - colorspace")
+
+#define LTI_STS_Core_ImpedanceMismatchNumBands     50018
+LT_STATUSSTRING_ADD(LTI_STS_Core_ImpedanceMismatchNumBands, "impedance mismatch - number of bands")
+
+#define LTI_STS_Core_UnsupColorSpace               50019
+LT_STATUSSTRING_ADD(LTI_STS_Core_UnsupColorSpace, "unsupported colorspace")
+
+#define LTI_STS_Core_UnsupNumBands                 50020
+LT_STATUSSTRING_ADD(LTI_STS_Core_UnsupNumBands, "unsupported number of bands")
+
+#define LTI_STS_Core_DatatypeMismatch              50021
+LT_STATUSSTRING_ADD(LTI_STS_Core_DatatypeMismatch, "datatype mismatch")
+
+#define LTI_STS_Core_Unused1                       50022
+#define LTI_STS_Core_Unused2                       50023
+#define LTI_STS_Core_Unused3                       50024
+
+#define LTI_STS_Core_RawImageSizeError             50025
+LT_STATUSSTRING_ADD(LTI_STS_Core_RawImageSizeError, "actual size of raw image file not equal to expected size")
+
+#define LTI_STS_Core_MetadataReadError             50026
+LT_STATUSSTRING_ADD(LTI_STS_Core_MetadataReadError, "error reading metadata")
+
+#define LTI_STS_Core_SceneBufferMismatch           50027
+LT_STATUSSTRING_ADD(LTI_STS_Core_SceneBufferMismatch, "specified scene size differs from buffer size")
+
+#define LT_STS_Core_BBBImageDimsIncorrect            50100
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBImageDimsIncorrect, "incorrect BBB image dimensions")
+
+#define LT_STS_Core_BBBDomainBitsIncorrect           50101
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBDomainBitsIncorrect, "incorrect BBB domain bits")
+
+#define LT_STS_Core_BBBWordLength                    50102
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBWordLength, "incorrect BBB word length")
+
+#define LT_STS_Core_BBBNot1Or3Banded                 50103
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBNot1Or3Banded, "BBB image not 1 or 3 bands")
+
+#define LT_STS_Core_BBBUnknownLayout                 50104
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBUnknownLayout, "unknown BBB image layout")
+
+#define LT_STS_Core_BBBUnknownByteOrder              50105
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBUnknownByteOrder, "incorrect BBB byte order")
+
+#define LT_STS_Core_BBBMissingNBANDS                 50106
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBMissingNBANDS, "BBB missing NBANDS")
+
+#define LT_STS_Core_BBBMissingNCOLS                  50107
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBMissingNCOLS, "BBB missing NCOLS")
+
+#define LT_STS_Core_BBBMissingNROWS                  50108
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBMissingNROWS, "BBB missing NROWS")
+
+#define LT_STS_Core_BBBBadFormat                     50109
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBBadFormat, "invalid BBB header format")
+
+#define LT_STS_Core_BBBInvalidLayout                 50110
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBInvalidLayout, "BBB incorrect layout")
+
+#define LT_STS_Core_BBBBadColorSpace                 50111
+LT_STATUSSTRING_ADD(LT_STS_Core_BBBBadColorSpace, "BBB bad colorspace")
+
+#define LT_STS_Core_AOINotRectangular							50112
+LT_STATUSSTRING_ADD(LT_STS_Core_AOINotRectangular, "area of interest (AOI) not rectangular")
+
+#define LTI_STS_Core_UnsupMaskDataType              50113
+LT_STATUSSTRING_ADD(LTI_STS_Core_UnsupMaskDataType, "unsupported datatype in shape mask")
+
+#define LTI_STS_Core_Max                           50199
+LT_STATUSSTRING_ADD(LTI_STS_Core_Base, "lt_lib_mrsid_core max")
+
+
+#endif // LTI_CORESTATUS_H
diff --git a/src/DSDK/include/base/lti_delegates.h b/src/DSDK/include/base/lti_delegates.h
new file mode 100644
index 0000000..9391843
--- /dev/null
+++ b/src/DSDK/include/base/lti_delegates.h
@@ -0,0 +1,97 @@
+/* $Id: lti_delegates.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_DELEGATES_H
+#define LTI_DELEGATES_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+/**
+ * interrupt delegate (callback) base class
+ *
+ * This abstract class is used for implementing a mechanism to determine if
+ * a potentially long-running operation is to be interrupted, such as
+ * LTIImageStage::read() or LTIImageWriter::write().  During these sorts of
+ * operations, an object which has an interrupt delegate may periodically
+ * call the delegate's getInterruptStatus() method to determine if the
+ * operation should be aborted.  If this function returns a value other than
+ * LT_STS_Success, then the object will abort the operation  and return that
+ * status value.
+ *
+ * Interrupt delegates are typically used in environments such as GUI encoders.
+ *
+ * A "delegate" is simply an object-oriented version of a callback function.
+ */
+class LTIInterruptDelegate
+{
+public:
+   /**
+    * check for interrupt
+    *
+    * This function should be implemented to indicate whether some user-defined
+    * event indicates that the operation should be terminated.  If an interrupt
+    * is requested, a value other than LT_STS_Success should be returned.
+    *
+    * @return LT_STS_Success if no interrupt requested; any other (nonzero)
+    *         value if an interrupt is requested
+    */
+   virtual LT_STATUS getInterruptStatus() = 0;
+};
+
+
+/**
+ * progress delegate (callback) base class
+ *
+ * This abstract class is used for implementing a mechanism to report the
+ * progress (percent complete) of a potentially long-running operation. 
+ * During these sorts of operations, an object which has a progress delegate
+ * may periodically call the delegate's setProgressStatus() method to report
+ * the percent of the operation completed.
+ *
+ * Progress delegates are typically used in GUI environments as a means of
+ * displaying percent-complete or time-remaining.
+ *
+ * A "delegate" is simply an object-oriented version of a callback function.
+ */
+class LTIProgressDelegate
+{
+public:
+   /**
+    * set percent completed
+    *
+    * This function should be implemented to report to the client application
+    * the progress of a long-running operation.
+    *
+    * @param percentComplete the percent complete; this must be a value in the
+    *                        range 0.0 to 1.0 inclusive 
+    * @return LT_STS_Success if function succeeded, nonzero if some error occurred
+    */
+   virtual LT_STATUS setProgressStatus(float percentComplete) = 0;
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_DELEGATES_H
diff --git a/src/DSDK/include/base/lti_geoCoord.h b/src/DSDK/include/base/lti_geoCoord.h
new file mode 100644
index 0000000..59f1b9b
--- /dev/null
+++ b/src/DSDK/include/base/lti_geoCoord.h
@@ -0,0 +1,393 @@
+/* $Id: lti_geoCoord.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_GEOCOORD_H
+#define LTI_GEOCOORD_H
+
+// lt_lib_base
+#include "lt_base.h"
+#include "lti_scene.h"
+
+#include <stdlib.h>
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(push,4)
+#endif
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+
+class LTFileSpec;
+class LTIOStreamInf;
+class LTIMetadataDatabase;
+
+/**
+ * represents a geographic coordinate
+ *
+ * The LTIGeoCoord class contains geographic coordinate information: x and
+ * y resolution, upper left point, and x and y rotation.
+ *
+ * @note As per the conventions for georeferenced images, the Y resolution is
+ * typically a negative value.
+ */
+class LTIGeoCoord
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates an LTIGeoCoord object with the given coordinate information.
+    *
+    * @param xUL   upper-left x position 
+    * @param yUL   upper-left y position 
+    * @param xRes  x resolution 
+    * @param yRes  y resolution 
+    * @param xRot  x rotation 
+    * @param yRot  y rotation 
+    * @param wkt   Well Known Text string 
+    */
+   LTIGeoCoord(double xUL, double yUL, 
+               double xRes, double yRes,
+               double xRot, double yRot,
+               const char *wkt = NULL);
+
+   /**
+    * default constructor
+    */
+   LTIGeoCoord();
+
+   /**
+    * copy constructor
+    */
+   LTIGeoCoord(const LTIGeoCoord&);
+
+  /**
+    * destructor
+    */
+   ~LTIGeoCoord();
+
+   /**
+    * assignment operator
+    */
+   LTIGeoCoord& operator=(const LTIGeoCoord&);
+
+   /**
+    * equality operator
+    */
+   bool operator==(const LTIGeoCoord&) const;
+
+   /**
+    * inequality operator
+    */
+   bool operator!=(const LTIGeoCoord&) const;
+
+   /**
+    * get the upper-left X position
+    *
+    * Returns the upper-left X position.
+    *
+    * @return the upper-left X position
+    */
+   double getX() const;
+
+   /**
+    * get the upper-left Y position
+    *
+    * Returns the upper-left Y position.
+    *
+    * @return the upper-left Y position
+    */
+   double getY() const;
+
+   /**
+    * get the X resolution
+    *
+    * Returns the X resolution
+    *
+    * @return the X resolution
+    */
+   double getXRes() const;
+
+   /**
+    * get the Y resolution
+    *
+    * Returns the Y resolution
+    *
+    * @return the Y resolution
+    */
+   double getYRes() const;
+
+   /**
+    * get the X rotation
+    *
+    * Returns the X rotation
+    *
+    * @return the X rotation
+    */
+   double getXRot() const;
+
+   /**
+    * get the Y rotation
+    *
+    * Returns the Y rotation
+    *
+    * @return the Y rotation
+    */
+   double getYRot() const;
+
+   /**
+    * get the Well Known Text (WKT)
+    *
+    * Returns the WKT
+    *
+    * @return the WKT
+    */
+   const char *getWKT() const;
+
+
+
+   /**
+    * get the coordinate information
+    *
+    * Returns all the coordinate information.  This is equivalent to calling
+    * getXUL(), getXRes(), etc.
+    *
+    * @param xUL   upper-left x position 
+    * @param yUL   upper-left y position 
+    * @param xRes  x resolution 
+    * @param yRes  y resolution 
+    * @param xRot  x rotation 
+    * @param yRot  y rotation 
+    */
+   void get(double& xUL, double& yUL,
+            double& xRes, double& yRes,
+            double& xRot, double& yRot) const;
+
+   /**
+    * convert a pixel coordinate to geo coordinate
+    *
+    * @param pixelX  x pixel position 
+    * @param pixelY  y pixel position 
+    * @param mag     magnification level (pixelX, pixelY) are in 
+    * @param geoX    x geo position 
+    * @param geoY    y geo position 
+    * @return        status code indicating success or failure
+    */
+   LT_STATUS pixelToGeo(double pixelX, double pixelY, double mag,
+                        double &geoX, double &geoY) const;
+
+   /**
+    * convert a geo coordinate to pixel coordinate
+    *
+    * @param geoX    x geo position 
+    * @param geoY    y geo position 
+    * @param mag     magnification level (pixelX, pixelY) will be in 
+    * @param pixelX  x pixel position 
+    * @param pixelY  y pixel position 
+    * @return        status code indicating success or failure
+    */
+   LT_STATUS geoToPixel(double geoX, double geoY, double mag,
+                        double &pixelX, double &pixelY) const;
+
+   /**
+    * get the coordinate information for a given scene
+    *
+    * Return a LTIGeoCoord object for the center of the upper-left
+    *  pixel of the given scene. 
+    *
+    * @param scene scene
+    * @return a LTIGeoCoord object for scene
+    */
+   LTIGeoCoord getGeoCoordForScene(const LTIScene &scene) const;
+
+   /**
+    * set the upper-left X position
+    *
+    * Sets the upper-left X position.
+    *
+    * @param x the upper-left X position 
+    */
+   void setX(double x);
+
+   /**
+    * set the upper-left Y position
+    *
+    * Sets the upper-left Y position.
+    *
+    * @param y the upper-left Y position 
+    */
+   void setY(double y);
+
+   /**
+    * set the X resolution
+    *
+    * Sets the X resolution
+    *
+    * @param xRes the X resolution 
+    */
+   void setXRes(double xRes);
+
+   /**
+    * set the Y resolution
+    *
+    * Sets the Y resolution
+    *
+    * @param yRes the Y resolution 
+    */
+   void setYRes(double yRes);
+
+   /**
+    * set the X rotation
+    *
+    * Sets the X rotation
+    *
+    * @param xRot the X rotation 
+    */
+   void setXRot(double xRot);
+
+   /**
+    * set the Y rotation
+    *
+    * Sets the Y rotation
+    *
+    * @param yRot the Y rotation 
+    */
+   void setYRot(double yRot);
+
+   /**
+    * set the coordinate information
+    *
+    * Sets the coordinate information.  This is equivalent to calling
+    * setX(), setXRes(), etc.
+    *
+    * @param xUL   upper-left x position 
+    * @param yUL   upper-left y position 
+    * @param xRes  x resolution 
+    * @param yRes  y resolution 
+    * @param xRot  x rotation 
+    * @param yRot  y rotation 
+    */
+   void set(double xUL, double yUL,
+            double xRes, double yRes,
+            double xRot, double yRot);
+
+   /**
+    * set the WKT
+    *
+    * Sets the WKT
+    *
+    * @param wkt the WKT 
+    */
+   void setWKT(const char *wkt);
+
+   /**
+    * write data to world file
+    *
+    * This function writes the geographic data out in "world file" format
+    * to the specified file.  If \a extension is not NULL, the extension
+    * will be used to replace the extension in the filename.
+    *
+    * @param fileSpec the name of the world file to write to 
+    * @param   determineExtension  if true, replace extension in \a fileSpec; otherwise, just use \a fileSpec 
+    * @return status code indicating success or failure
+    */
+   LT_STATUS writeWorldFile(const LTFileSpec& fileSpec,
+                            bool determineExtension) const;
+
+   /**
+    * read data from world file
+    *
+    * This function reads the geographic data in from the given "world file", if file present.  If no world
+    * file found, \a fileFound set to false and returns LT_STS_Success.
+    *
+    * @param   fileSpec   the name of the world file to read from  
+    * @param   determineExtension  if true, replace extension in \a fileSpec; otherwise, just use \a fileSpec  
+    * @param   fileFound  will be if true, if world file was found and read  
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS readWorldFile(const LTFileSpec& fileSpec,
+                           bool determineExtension,
+                           bool& fileFound);
+
+   /**
+    * read data from world file, via a stream
+    *
+    * This function reads the geographic data in from the given "world file",
+    * using an LTIOStreamInf interface.
+    *
+    * @param   stream   the world file data read from  
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS readWorldFile(LTIOStreamInf& stream);
+
+   /**
+    * get file extension text
+    *
+    * This function computes the "official" world file extension for the
+    * given image file name.  Typically this is formed by concatenating the
+    * first and last letters of the image file extension and a 'w', e.g.
+    * "foo.jpg" returns "jgw".
+    *
+    * If the first and last characters of the extension are both uppercase,
+    * then the 'W' is uppercase, e.g. "foo.JPG" return "JPW".
+    *
+    * The \c ext parameter must be allocated to be at least 4 bytes prior to
+    * the call.
+    *
+    * @param   fileSpec the name of the image file  
+    * @param   ext       an array of (at least) 4 bytes 
+    * @return  status code indicating success or failure
+    */
+   static LT_STATUS getWorldFileExtension(const LTFileSpec& fileSpec,
+                                          char* ext);
+
+
+   /**
+    * write data to metadata
+    *
+    * This function writes the geographic data out to the metadata.
+    *
+    * @param metadata the metadata database to write to 
+    * @return status code indicating success or failure
+    */
+   LT_STATUS writeMetadata(LTIMetadataDatabase &metadata) const;
+
+   /**
+    * read data from metadata
+    *
+    * This function reads the geographic data in from the given metadata database.
+    *
+    * @param   metadata   the metadata database to read from  
+    * @param   found  will be if true, if metadata has geographic data  
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS readMetadata(const LTIMetadataDatabase &metadata, bool &found);
+
+private:
+   double m_xUL;
+   double m_yUL;
+   double m_xRes;
+   double m_yRes;
+   double m_xRot;
+   double m_yRot;
+
+   char *m_wkt;
+};
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_GEOCOORD_H
diff --git a/src/DSDK/include/base/lti_geoFileImageWriter.h b/src/DSDK/include/base/lti_geoFileImageWriter.h
new file mode 100644
index 0000000..7219ff1
--- /dev/null
+++ b/src/DSDK/include/base/lti_geoFileImageWriter.h
@@ -0,0 +1,173 @@
+/* $Id: lti_geoFileImageWriter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_GEOFILEIMAGEWRITER_H
+#define LTI_GEOFILEIMAGEWRITER_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// lt_lib_mrsid_core
+#include "lti_imageWriter.h"
+#include "lti_scene.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTFileSpec;
+class LTIOStreamInf;
+
+/**
+ * class for writing geographic images to files or streams
+ *
+ * This abstract class extends LTIImageWriter by adding functions for
+ * controlling the output form (either a file or a stream) and world file
+ * generation.
+ */
+class LTIGeoFileImageWriter : public LTIImageWriter
+{
+public:
+   /**
+    * constructor
+    *
+    * Constructs a writer which will write to files or streams.  The 
+    * \c supportsStreams parameter is used to indicate whether the
+    * derived class can write directly to a stream or only to files.
+    *
+    * @param  image            the source of image data to be written  
+    * @param  supportsStreams  set to true if output to streams is allowed 
+    */
+   LTIGeoFileImageWriter(LTIImageStage* image,
+                         bool supportsStreams);
+
+   virtual ~LTIGeoFileImageWriter();
+
+   virtual LT_STATUS writeBegin(const LTIScene& scene);
+   virtual LT_STATUS writeStrip(LTISceneBuffer& stripBuffer,
+                                const LTIScene& stripScene) = 0;
+   virtual LT_STATUS writeEnd();
+
+
+   /**
+    * set output file name
+    *
+    * Sets the output target to the given filename.  Must be called prior to
+    * calling write().
+    *
+    * @param fileSpec the name of the file to write to 
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS setOutputFileSpec(const LTFileSpec& fileSpec);
+
+   /**
+    * set output file name
+    *
+    * Sets the output target to the given filename.  Must be called prior to
+    * calling write().
+    *
+    * @param fileSpec the name of the file to write to 
+    * @return success or failure
+    */
+   virtual LT_STATUS setOutputFileSpec(const char* fileSpec);
+
+   /**
+    * set output file stream
+    *
+    * Sets the output target to the given stream.  Must be called prior to
+    * calling write().
+    *
+    * This operation will only succeed if the derived class has set the
+    * \c supportsStream parameter to the LTIGeoFileImageWriter ctor to true.
+    *
+    * @param stream the stream to write to (may not be NULL) 
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS setOutputStream(LTIOStreamInf* stream);
+
+   /**
+    * enable writing of world file
+    *
+    * Enables or disables automatic generation of a world file.  Only
+    * applicable when the output target is a filename.
+    *
+    * The default is to not generate a world file.
+    *
+    * @param enabled set to true for world file generation
+    */
+   virtual void setWorldFileSupport(bool enabled);
+
+   /**
+    * enable writing of large files
+    *
+    * Enables or disables use of 64-bit safe file output.  Only
+    * applicable when the output target is a filename.
+    *
+    * The default is to not use 64-bit file modes (as this may incur a
+    * performance penalty under certain circumstances).
+    *
+    * @param enabled set to true for large file support
+    */
+   void setFileStream64(bool enabled); // default false
+
+protected:
+   /**
+    * get underlying stream
+    *
+    * Returns the stream being written to.
+    *
+    * If the output target is a filename, the returned stream will  be NULL
+    * until the write() sequence has begun.
+    *
+    * @return the stream (may be NULL)
+    */
+   LTIOStreamInf* getStream() const;
+
+   /**
+    * get target filename
+    *
+    * Returns the name of the file being written to.
+    *
+    * If the output target is set by the user to be a stream, the returned filename
+    * will  be NULL.
+    *
+    * @return the filename (may be NULL)
+    */
+   LTFileSpec* getFileSpec() const;
+
+private:
+   bool m_supportsStreams;
+   LTFileSpec* m_fileSpec;
+   LTIOStreamInf* m_stream;
+   bool m_ownStream;
+
+   bool m_worldFileEnabled;
+
+   bool m_useFileStream64;
+   LTIScene m_fullScene;
+
+   // nope
+   LTIGeoFileImageWriter();
+   LTIGeoFileImageWriter(LTIGeoFileImageWriter&);
+   LTIGeoFileImageWriter& operator=(const LTIGeoFileImageWriter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_GEOFILEIMAGEWRITER_H
diff --git a/src/DSDK/include/base/lti_geoImageReader.h b/src/DSDK/include/base/lti_geoImageReader.h
new file mode 100644
index 0000000..6c28585
--- /dev/null
+++ b/src/DSDK/include/base/lti_geoImageReader.h
@@ -0,0 +1,71 @@
+/* $Id: lti_geoImageReader.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_GEOIMAGEREADER_H
+#define LTI_GEOIMAGEREADER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageReader.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTFileSpec;
+class LTIOStreamInf;
+
+/**
+ * abstract class for implementing a geo image reader
+ *
+ * The LTIGeoImageReader abstract class extends the LTIImageReader so that it
+ * allows whether world files are used or ignored for setting up geo 
+ * information.
+ */
+class LTIGeoImageReader : public LTIImageReader
+{
+public:
+   /**
+    * constructor
+    */
+   LTIGeoImageReader(bool useWorldFile);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIGeoImageReader();
+
+protected:
+   bool getUseWorldFile() const;
+
+   LT_STATUS readWorldFile(const LTFileSpec& file, bool& bFound);
+   LT_STATUS readWorldFile(const LTFileSpec *file,
+                           LTIOStreamInf *stream,
+                           bool &foundWorldFile);
+private:
+   bool m_useWorldFile;
+
+   // nope
+   LTIGeoImageReader(LTIGeoImageReader&);
+   LTIGeoImageReader& operator=(const LTIGeoImageReader&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_GEOIMAGEREADER_H
diff --git a/src/DSDK/include/base/lti_image.h b/src/DSDK/include/base/lti_image.h
new file mode 100644
index 0000000..3b8de11
--- /dev/null
+++ b/src/DSDK/include/base/lti_image.h
@@ -0,0 +1,672 @@
+/* $Id: lti_image.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_IMAGE_H
+#define LTI_IMAGE_H
+
+// lt_lib_mrsid_core
+#include "lti_types.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+class LTIPixel;
+class LTIMetadataDatabase;
+class LTIGeoCoord;
+class LTIPixelLookupTable;
+
+
+/**
+ * abstract class representing an image
+ *
+ * The LTIImage abstract class represents the basic properties of an image,
+ * including dimensions, data type, background color, etc.   
+ *
+ * LTIImage does not support extraction of pixels (decoding); that
+ * functionality is provided by the derived class LTIImageStage.
+ */
+class LTIImage
+{
+public:
+   /**
+    * constructor
+    *
+    * Constructs an LTIImage object with no data members (image properties)
+    * set.
+    *
+    * The initialize() method should be called immediately after the object
+    * is constructed.
+    */
+   LTIImage();
+
+   /**
+    * destructor
+    */
+   virtual ~LTIImage();
+
+   /**
+    * initialize the image object
+    *
+    * Derived classes should override this function.  This function must 
+    * do the following (in order):
+    *
+    * \li call the initialize() function of the parent class
+    * \li call the LTIImage::setPixelProps() function
+    *     to set the required datatype, colorspace, and number of bands
+    * \li call the LTIImage::setDimensions() function
+    *     to set the required image width and height
+    * \li call any optional "set" functions in LTIImage
+    *     to set the additional image properties for the derived image type
+    *
+    * Status codes must be checked and handled appropriately after each of
+    * these operations.
+    *
+    * This function is to be called by users immediately after the object is
+    * constructed.
+    *
+   * @return status code indicating success or failure
+    */
+   virtual LT_STATUS initialize();
+
+   /**
+    * get image width
+    *
+    * This function returns the width of the image, in pixels.
+    *
+    * @return the image width
+    */
+   lt_uint32 getWidth() const;
+
+   /**
+    * get image height
+    *
+    * This function returns the height of the image, in pixels.
+    *
+    * @return the image height
+    */
+   lt_uint32 getHeight() const;
+   
+   /**
+    * get image width and height at given magnification
+    *
+    * This function returns the width and height of the image, in pixels,
+    * relative to the given magnification.
+    *
+    * @param  mag    magnification to determine width at 
+    * @param  width  the image width at the magnification 
+    * @param  height the image height at the magnification 
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS getDimsAtMag(double mag,
+                                  lt_uint32& width,
+                                  lt_uint32& height) const;
+
+   /**
+    * get number of bands
+    *
+    * This function returns the number of bands (colors) in the image.  This
+    * value is closely related to the colorspace of the image.
+    *
+    * This function is equivalent to getPixelProps().getNumBands().
+    *
+    * @return the number of bands in the image
+    */
+   lt_uint16 getNumBands() const;
+
+   /**
+    * get colorspace
+    *
+    * This function returns the colorspace of the image, e.g. RGB or greyscale.
+    *
+    * This function is equivalent to getPixelProps().getColorSpace().
+    *
+    * @return the colorspace of the image
+    */
+   LTIColorSpace getColorSpace() const;
+
+   /**
+    * get data type
+    *
+    * This function returns the data type of the samples in the image, e.g.
+    * unsigned byte or 32-bit float.
+    *
+    * This function is equivalent to getPixelProps().getDataType().
+    *
+    * @return the datatype of the image
+    */
+   LTIDataType getDataType() const;
+
+   /**
+    * get the pixel properties of the image
+    *
+    * This function returns an object which describes the basic properties
+    * of a pixel in the image.
+    *
+    * @return the pixel properties of the image
+    */
+   const LTIPixel& getPixelProps() const;
+
+   /**
+    * get the values of the background pixel
+    *
+    * This function returns a pointer to an object containing the
+    * values of the background pixel of the image.  If the pointer
+    * is NULL, no background color has been set for the image.
+    *
+    * @return pointer to the background pixel 
+    */
+   const LTIPixel* getBackgroundPixel() const;
+
+   /**
+    * get the values of the "no data" (transparency) pixel
+    *
+    * This function returns a pointer to an object containing the
+    * values of the no data pixel of the image.  If the pointer
+    * is NULL, no transparency color has been set for the image.
+    *
+    * @return pointer to the no data pixel 
+    */
+   const LTIPixel* getNoDataPixel() const;
+
+   /**
+    * get the color lookup table, if any
+    *
+    * This function returns a pointer the color lookup table, used for
+    * indexed or palletized images.  Will return NULL if no table
+    * is used.
+    *
+    * @return pointer to the pixel lookup table
+    */
+   const LTIPixelLookupTable* getPixelLookupTable() const;
+
+   /**
+    * get the minimum dynamic range value of image
+    *
+    * This function returns the pixels of minimum value of the 
+    * dynamic range of the image.
+    *
+    * @return  pixel object with the minimum dynamic range values
+    */
+   const LTIPixel& getMinDynamicRange() const;
+
+   /**
+    * get the maximum dynamic range value of image
+    *
+    * This function returns the pixels of maximum value of the 
+    * dynamic range of the image.
+    *
+    * @return  pixel object with the maximum dynamic range values
+    */
+   const LTIPixel& getMaxDynamicRange() const;
+
+   /**
+    * check if the range is "complete" or not
+    *
+    * This function returns true if the dynamic range min/max values for the
+    * image correspond to the full range of the underlying datatype.
+    *
+    * @return  true if range spans the datatype's range
+    */
+   bool isNaturalDynamicRange() const;
+   
+   /**
+    * get the geographic coordinates of the image
+    *
+    * This function returns the geographic coordinates of the image.
+    *
+    * Note that if the image has no explicit geographic coordinate information,
+    * e.g. stored within the metadata of a file, the geographic coordinates
+    * are implicitly set (upperleft is (0,-height), resolution is (1,-1))
+    *
+    * @return a pointer to an object containing the geographic coordinates
+    */
+   const LTIGeoCoord& getGeoCoord() const;
+
+   /**
+    * is geo information "real" or not
+    *
+    * This function returns true if the geo information is implicit, i.e.
+    * the source image did not have native geo coord info.
+    *
+    * @return true if and only if the geo information is not "real"
+    */
+   bool isGeoCoordImplicit() const;
+
+   /**
+    * get the metadata associated with the image
+    *
+    * This function returns a reference to the object containing the
+    * metadata associated with the image.
+    *
+    * @return a reference to the metadata database
+    */
+   const LTIMetadataDatabase& getMetadata() const;
+
+   /**
+    * get a modifiable reference to the metadata associated with the image
+    *
+    * This function returns a reference to the object containing the
+    * metadata associated with the image.  This function returns
+    * a non-const reference, so it may be used by derived classes to
+    * set metadata on the image.
+    *
+    * @return a reference to the metadata database
+    */
+   LTIMetadataDatabase& getMetadataRef() const;
+
+   /**
+    * get the minimum magnification
+    *
+    * This function returns the minimum magnification
+    * of the image.  Images that do not support "zooming out" will return
+    * 1.0; images that contain "overviews", e.g. MrSID, will return a
+    * value greater than 1.0.
+    *
+    * @return the minimum magnification
+    */
+   double getMinMagnification() const;
+
+   /**
+    * get the maximum magnification
+    *
+    * This function returns the maximum magnification
+    * of the image.  Images that do not support "zooming in" will return
+    * 1.0; images that support "res-up", e.g. MrSID, will return a
+    * value less than 1.0.
+    *
+    * @return the maximum magnification
+    */
+   double getMaxMagnification() const;
+
+   /**
+    * get the physical (disk) size of the image
+    *
+    * Returns the number of bytes in the actual file (or stream) to the extent
+    * possible and practical.  Note this value may be substantially different
+    * than the "nominal" image size returned by getNominalImageSize(), e.g.
+    * due to compression or sparse mosaics.
+    *
+    * This number should not be considered an exact representation:
+    * \li if the actual value cannot be known, e.g. for streamed data, a value of 0
+    *     will be returned
+    * \li the returned value may or may not include bytes due to subsidiary files, e.g.
+    *     BBB headers or World files
+    * \li for "filter" image classes that perform some operation on an underlying image,
+    *     the value returned is typically just the value of the underlying image
+    * \li for "mosaic" image classes that wrap one or more underlying image
+    *     classes, the value returned is typically the sum of the child images
+    *
+    * @return the physical size of the image, in bytes
+    */
+   virtual lt_int64 getPhysicalFileSize() const = 0;
+
+   /**
+    * get the nominal size of the image
+    *
+    * Returns number of bytes of actual data in the image, e.g. as if the image were
+    * a raw file.  This value is simply the product of:
+    * \li image width,
+    * \li image height,
+    * \li samples per pixel, and
+    * \li bytes per sample.
+    *
+    * Note this value may be substantially different
+    * than the "physical" image size returned by getPhysicalFileSize(), e.g.
+    * due to compression or sparse mosaics.
+    *
+    * @return the nominal size of the image, in bytes
+    */
+   lt_int64 getNominalImageSize() const;
+
+   /**
+    * get the "name" of the image
+    *
+    * Returns a string representing the "name" of the image.  The name
+    * corresponds roughly to the underlying file used, and should only
+    * be used for debugging purposes.
+    *
+    * @return the name of the image
+    */
+   const lt_utf8* getName() const;
+
+   /**
+    * get position of a named point
+    *
+    * Returns the (x,y) position of the given named point.
+    *
+    * @param  position  the position to be returned 
+    * @param  x         the x-position of the point 
+    * @param  y         the y-position of the point 
+    */
+   void getGeoPoint(LTIPosition position, double& x, double& y) const;
+
+   /**
+    * return new background pixel
+    *
+    * Creates and returns a new pixel of the correct background color for the
+    * image.  If no background color has been set, a new black pixel will be
+    * returned (unless the image is CMYK, in which case a white pixel will be
+    * returned).
+    *
+    * The caller takes ownership of the returned pixel.
+    *
+    * @return a new background pixel
+    */
+   LTIPixel* createBackgroundPixel() const;
+
+   /**
+    * @name Projection functions
+    */
+   /*@{*/
+
+  /**
+    * project a value to a given magnification
+    *
+    * Given a value, such as a point, compute and return the value when
+    * projected to the given magnification.
+    *
+    * @param  upperLeft     the value to be scaled  
+    * @param  mag           the amount to scale by  
+    * @param  newUpperLeft  the scaled value 
+    * @return status indicating success or failure
+    */
+   virtual LT_STATUS projectPointAtMag(double upperLeft,
+                                       double mag,
+                                       double& newUpperLeft) const;
+
+   /**
+    * project a dimension to a given magnification
+    *
+    * Given a value, such as a width, compute and return the value when
+    * projected to the given magnification.
+    *
+    * @param  dim     the value to be scaled  
+    * @param  mag     the amount to scale by  
+    * @param  newDim  the scaled value 
+    * @return status indicating success or failure
+    */
+   virtual LT_STATUS projectDimAtMag(double dim,
+                                     double mag,
+                                     double& newDim) const;
+
+   /*@}*/
+
+   /**
+    * check if image supports "random access" decoding
+    *
+    * Some formats, notably JPEG, do not support "selective" decoding.
+    * That is, they require that scenes being decoding must march
+    * in order down the scanlines of the image.  Formats like TIFF
+    * and MrSID, however, are "selective": any scene can be requested
+    * at any time.
+    *
+    * @return true if and only if the image supports arbitrary scene requests
+    */
+   bool isSelective() const;
+   
+   /**
+    * set standard metadata fields
+    *
+    * This function is used to populate the standard metadata fields for the
+    * image, e.g. WIDTH, HEIGHT, COLORSPACE, etc.
+    *
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setClassicalMetadata();
+
+protected:
+   /**
+    * set pixel properties of the image
+    *
+    * This function is used to set the pixel properties of the image, namely
+    * the datatype, colorspace, and number of bands.
+    *
+    * Derived classes are \em required to call this function from within their
+    * initialize() method.
+    *
+    * @param pixelProps  the basic pixel properties of the image (number of
+    *                    bands, colorspace, datatype)
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setPixelProps(const LTIPixel& pixelProps);
+
+   /**
+    * set width and height of the image
+    *
+    * This function is used to set the dimensions (width and height) of the image.
+    *
+    * Derived classes are \em required to call this function from within their
+    * initialize() method.
+    *
+    * @param  width       the image width, in pixels
+    * @param  height      the image height, in pixels
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setDimensions(lt_uint32 width,
+                           lt_uint32 height);
+
+   /**
+    * set the background color of the image
+    *
+    * This function is used to set the background color of the image.
+    *
+    * Derived classes may choose to call this function from within their
+    * initialize() method.  If the background color is not set, or if NULL
+    * is passed in, a background color of black (sample values of 0) will
+    * be used.  (Exception: for CMYK images, the background is set to white.)
+    *
+    * @param backgroundPixel  the data for the background color
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setBackgroundPixel(const LTIPixel* backgroundPixel);
+
+   /**
+    * set the "no data" (transparency) color of the image
+    *
+    * This function is used to set the "no data" or transparency color of the
+    * image.
+    *
+    * Derived classes may choose to call this function from within their
+    * initialize() method.  If the transparency color is not set, or if NULL
+    * is passed in, the image will be assumed to have no transparent pixels.
+    *
+    * @param nodataPixel  the data for the transparency color
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setNoDataPixel(const LTIPixel* nodataPixel);
+
+   /**
+    * set the color lookup table
+    *
+    * This function is used to set the color used lookup table, used
+    * for indexed color (palletized) images.
+    *
+    * Derived classes may choose to call this function from within their
+    * initialize() method.  If the lookup table is not set, or if NULL
+    * is passed in, the image will be assumed to have no lookup table.
+    *
+    * The LTIImageReader makes a local copy of the lookup table.
+    *
+    * @param  pixelLookupTable  pointer to the lookup table (or NULL)
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setPixelLookupTable(const LTIPixelLookupTable* pixelLookupTable);
+
+   /**
+    * set the dynamic range of the image
+    *
+    * This function is used to set the dynamic range of the image.  The
+    * dynamic range consists of the minimum and maximum value for a given
+    * sample.
+    *
+    * If both the minimum and maximum are NULL, the natural
+    * range of the sample datatype will be used.
+    *
+    * Derived classes may choose to call this function from within their
+    * initialize() method.  If the dynamic range is not set, the natural
+    * minimum and maximum of the datatype of the sample is used.
+    *
+    * @param drmin       the minimum dynamic range value
+    * @param drmax       the maximum dynamic range value
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setDynamicRange(const LTIPixel& drmin,
+                             const LTIPixel& drmax);
+
+   /**
+    * set the dynamic range of the image
+    *
+    * This function is used to set the dynamic range of the image.  The
+    * dynamic range consists of the minimum and maximum value for a given
+    * sample.  This function sets these values to the natural
+    * range of the sample datatype.
+    *
+    * Derived classes may choose to call this function from within their
+    * initialize() method.  If the dynamic range is not set, the natural
+    * minimum and maximum of the datatype of the sample is used.
+    *
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setDefaultDynamicRange();
+
+   /**
+    * set the minimum and maximum magnifications of the image properties
+    *
+    * This function is used to set the minimum and maximum magnifications
+    * of the image.
+    *
+    * Derived classes may choose to call this function from within their
+    * initialize() method.  If the minimum and maximum magnifications are not
+    * set, values of 1.0 are used (indicating the image may not be scaled
+    * larger or smaller).
+    *
+    * @param minMag  the minimum magnification of the image
+    * @param maxMag  the maximum magnification of the image
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setMagnification(double minMag,
+                              double maxMag);
+
+   /**
+    * set the geographic coordinates of the image
+    *
+    * This function is used to set the geographic coordinates of the image.
+    *
+    * Derived classes may choose to call this function from within their
+    * initialize() method.  If the geographic coordinates are not set, the
+    * default position is assumed.
+    *
+    * @param geoCoord    the geographic coordinate information
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setGeoCoord(const LTIGeoCoord& geoCoord);
+
+   /**
+    * set the geographic coordinates of the image
+    *
+    * This function is used to set the geographic coordinates of the image to
+    * a reasonable default, when there are no other geographic coordinates to
+    * use.
+    *
+    * The default coordinates used are:
+    * \li upperleft: (0.0, height-1.0)
+    * \li resolution: (1.0, -1.0)
+    * \li rotation: (0.0, 0.0)
+    *
+    * Calling this function will cause isGeoCoordImplicit() to return true.
+    *
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setDefaultGeoCoord();
+
+   /**
+    * set the properties of an image based on another image
+    *
+    * This function is used to set all the properties of an image
+    * to be the same as those of another image.
+    *
+    * This function can be used by image filter classes, as a convenience
+    * function instead of explicitly calling all the various "set" functions.
+    *
+    * @param  image  the source image properties to use for this image
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setAllProperties(const LTIImage& image);
+
+   /**
+    * set the "name" of the image
+    *
+    * Sets a string representing the "name" of the image.  The name
+    * should correspond roughly to the underlying file used, and should only
+    * be used for debugging purposes.
+    *
+    * @param  name  the name of this image
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setName(const lt_utf8* name);
+
+   /**
+    * set image to support "random access"
+    *
+    * This function is used to indicate the image supports "selective"
+    * decoding.  See isSelective() for details.
+    *
+    * By default, all images support selective decoding.
+    *
+    * Derived classes may choose to call this function from within their
+    * initialize() method.
+    *
+    * @param  enable  set to true if and only if the image supports selective decoding
+    */
+   void setIsSelective(bool enable);
+
+   LT_STATUS inferPrecisionFromMetadata(LTIDataType,lt_uint8&);
+   lt_uint8 inferPrecisionFromMetadata2(LTIDataType);
+   LT_STATUS updateDynamicRangeMetadata(void);
+
+
+private:
+   lt_uint32 m_width;
+   lt_uint32 m_height;
+   LTIPixel* m_pixelProps;
+   LTIPixel* m_backgroundPixel;
+   LTIPixel* m_nodataPixel;
+   LTIPixel* m_drminPixel;
+   LTIPixel* m_drmaxPixel;
+   double m_minMag;
+   double m_maxMag;
+   LTIGeoCoord* m_geoCoord;
+   LTIMetadataDatabase* m_metadata;
+   LTIPixelLookupTable* m_pixelLookupTable;
+   lt_utf8* m_name;
+   bool m_isSelective;
+   bool m_geoCoordImplicit;
+
+   // nope
+   LTIImage(LTIImage&);
+   LTIImage& operator=(const LTIImage&);
+};
+
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_IMAGE_H
diff --git a/src/DSDK/include/base/lti_imageFilter.h b/src/DSDK/include/base/lti_imageFilter.h
new file mode 100644
index 0000000..9fe6a4d
--- /dev/null
+++ b/src/DSDK/include/base/lti_imageFilter.h
@@ -0,0 +1,114 @@
+/* $Id: lti_imageFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_IMAGEFILTER_H
+#define LTI_IMAGEFILTER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageStage.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+/**
+ * abstract class for implementing an image transform
+ *
+ * The LTIImageFilter abstract class extends the LTIImageStage so that it can
+ * be used as an intermediate stage in an image pipeline.  This is the base
+ * class for such classes as the colorspace transformer, image cropper, etc.
+ */
+class LTIImageFilter : public LTIImageStage
+{
+public:
+   /**
+    * constructor
+    *
+    * This is the constructor for a pipeline stage.  The previous image stage
+    * in the pipeline is passed in to this stage.
+    *
+    * @param  previousStage  the previous image stage in the pipeline 
+    * @param  takeOwnership  if true, this object will delete the parent stage
+    *                        when required 
+    */
+   LTIImageFilter(LTIImageStage* previousStage, bool takeOwnership);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIImageFilter();
+
+   /**
+    * initializer
+    */
+   virtual LT_STATUS initialize();
+
+   virtual lt_uint32 getStripHeight() const;
+   virtual LT_STATUS setStripHeight(lt_uint32 stripHeight);
+
+   virtual lt_int64 getPhysicalFileSize() const;
+
+   virtual lt_int64 getEncodingCost(const LTIScene& scene) const;
+
+   virtual LT_STATUS projectPointAtMag(double upperLeft,
+                                       double mag,
+                                       double& newUpperLeft) const;
+
+   virtual LT_STATUS projectDimAtMag(double dim,
+                                     double mag,
+                                     double& newDim) const;
+
+   virtual LT_STATUS getDimsAtMag(double mag,
+                                  lt_uint32& width,
+                                  lt_uint32& height) const;
+
+   virtual bool getReaderScene(const LTIScene &decodeScene,
+                               LTIScene &readerScene) const;
+   
+   virtual LT_STATUS removeAllMetadata();
+
+protected:
+   /** true iff this stage should delete the previous stage */
+   bool m_takeOwnership;
+
+   /**
+    * get previous image in pipeline
+    *
+    * Returns the previous image in the pipeline.
+    *
+    * This function is virtual so that derived classes may override it if
+    * needed.  This is useful for classes like BMPImageWriter which need to
+    * silently insert their own transform stages into the pipeline.
+    *
+    * @return pointer to the previous stage (will not be NULL)
+    */
+   virtual LTIImageStage* getPreviousStage() const;
+
+private:
+   LTIImageStage* m_previousStage;
+
+   // nope
+   LTIImageFilter(LTIImageFilter&);
+   LTIImageFilter& operator=(const LTIImageFilter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_IMAGEFILTER_H
diff --git a/src/DSDK/include/base/lti_imageReader.h b/src/DSDK/include/base/lti_imageReader.h
new file mode 100644
index 0000000..ef21b3e
--- /dev/null
+++ b/src/DSDK/include/base/lti_imageReader.h
@@ -0,0 +1,87 @@
+/* $Id: lti_imageReader.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_IMAGEREADER_H
+#define LTI_IMAGEREADER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageStage.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+/**
+ * abstract class for implementing an image reader
+ *
+ * The LTIImageReader abstract class extends the LTIImageStage so that it can
+ * be used as a decoder for an image format, i.e. the "end" of an image
+ * pipeline.  This is the base class for such classes as the MrSIDImageReader.
+ */
+class LTIImageReader : public LTIImageStage
+{
+public:
+   /**
+    * constructor
+    */
+   LTIImageReader();
+
+   /**
+    * destructor
+    */
+   virtual ~LTIImageReader();
+   
+	/**
+    * clone the image reader
+    *
+    * This function creates a new image reader of the same type with the same
+    * initialization parameters.  The caller must call initialize() on the new
+    * reader prior to using it.
+    *
+    * The default implementation returns NULL, indicating cloning is not
+    * supported.  Derived classes may choose to override this.
+	 *	
+	 *	@return  a pointer to the new reader, or NULL if not image can not be cloned
+	*/
+	virtual LTIImageReader* duplicate();
+   
+   virtual lt_uint32 getStripHeight() const;
+   virtual LT_STATUS setStripHeight(lt_uint32 stripHeight);
+
+   virtual lt_int64 getPhysicalFileSize() const = 0;
+
+   virtual lt_int64 getEncodingCost(const LTIScene& scene) const;
+
+   virtual bool getReaderScene(const LTIScene &decodeScene,
+                               LTIScene &readerScene) const;
+
+private:
+   lt_uint32 m_stripHeight;
+
+
+   // nope
+   LTIImageReader(LTIImageReader&);
+   LTIImageReader& operator=(const LTIImageReader&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_IMAGEREADER_H
diff --git a/src/DSDK/include/base/lti_imageStage.h b/src/DSDK/include/base/lti_imageStage.h
new file mode 100644
index 0000000..5f2f1c0
--- /dev/null
+++ b/src/DSDK/include/base/lti_imageStage.h
@@ -0,0 +1,414 @@
+/* $Id: lti_imageStage.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_IMAGESTAGE_H
+#define LTI_IMAGESTAGE_H
+
+// lt_lib_mrsid_core
+#include "lti_image.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+class LTIProgressDelegate;
+class LTIInterruptDelegate;
+class LTIScene;
+class LTISceneBuffer;
+
+
+
+/**
+ * abstract class for decoding from an image
+ *
+ * The LTIImageStage abstract class extends the LTIImage class by adding
+ * decode functionality, including read methods and progress and interrupt
+ * functions.
+ */
+class LTIImageStage : public LTIImage
+{
+public:
+   /**
+    * default constructor
+    */
+   LTIImageStage();
+
+   /**
+    * destructor
+    */
+   virtual ~LTIImageStage();
+
+   /**
+    * initializer
+    */
+   virtual LT_STATUS initialize();
+
+   /**
+    * set progress delegate
+    *
+    * This function sets the progress delegate, which is used in a callback-like
+    * fashion to report percent-complete of a read() operation back to the
+    * calling application.
+    *
+    * Passing NULL to this function should remove the LTIImageReader's current delegate,
+    * if any.
+    *
+    * Note this function does not take ownership of the delegate object.
+    *
+    * @param  delegate  a pointer to the delegate object to be used by the image reader
+    */
+   virtual void setProgressDelegate(LTIProgressDelegate* delegate);
+
+   /**
+    * set interrupt delegate
+    *
+    * This function sets the interrupt delegate, which is used in a callback-like
+    * fashion by the calling application to asynchronously indicate that a read()
+    * operation should be halted without completing.
+    *
+    * Passing NULL to this function should remove the LTIImageReader's current delegate,
+    * if any.
+    *
+    * Note this function does not take ownership of the delegate object.
+    *
+    * @param  delegate  a pointer to the delegate object to be used by the image reader
+    */
+   virtual void setInterruptDelegate(LTIInterruptDelegate* delegate);
+
+   /**
+    * read (decode) a scene from the image
+    *
+    * This function decodes a scene from the image and puts the pixels into the
+    * given buffer.
+    *
+    * The scene may NOT extend beyond the boundaries of the image.
+    *
+    * This function calls readBegin(), then calls readStrip() repeatedly
+    * until all the rows of the scene are done, then calls readEnd().
+    *
+    * Derived classes should not override this method.
+    *
+    * @param  scene  the region (and scale) of the image to be read 
+    * @param  buffer  the buffer to read the pixels into 
+    * @return status code indicating success or failure
+    */
+   LT_STATUS read(const LTIScene& scene,
+                  LTISceneBuffer& buffer);
+
+   /**
+    * start strip-based read
+    *
+    * This function is called by read() before readStrip() is called.  It
+    * should not be called directly except in certain rare circumstances.
+    *
+    * Derived classes should not override.
+    *
+    * @param scene  the full scene to be read 
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS readBegin(const LTIScene& scene);
+
+   /**
+    * finish strip-based read
+    *
+    * This function is called by read() after readStrip() is called.  It
+    * should not be called directly except in certain rare circumstances.
+    *
+    * Derived classes should not override.
+    *
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS readEnd();
+
+   /**
+    * read a strip from the image
+    *
+    * This function decodes a scene from the image and puts the pixels into the
+    * given buffer.  It is called by read(), and should not be called directly
+    * except in certain rare circumstances.
+    *
+    * The scene must lie within the boundaries of the image.
+    *
+    * Derived classes should not override this method.
+    *
+    * Derived classes should use the progress and interrupt delegates when
+    * the read operation can be expected to take a significant amount of time
+    * to complete.
+    *
+    * @param   buffer      the buffer to read the pixels into  
+    * @param   stripScene  the scene for this strip being decoded  
+    * @return  status code indicating success or failure  
+    */
+   virtual LT_STATUS readStrip(LTISceneBuffer& buffer, const LTIScene& stripScene);
+
+
+   /**
+    * get strip height
+    *
+    * Returns the strip height used in read() calls.
+    *
+    * Reader classes should set this.  Filter classes should inherit the
+    * stripheight of their pipeline predecessor.  A writer class will
+    * force the stripheight of the pipeline to match its stripheight.
+    *
+    * @return the strip height
+    */
+   virtual lt_uint32 getStripHeight() const = 0;
+
+   /**
+    * set the strip height
+    *
+    * Sets the strip height to be used in decoding.  This is the number
+    * of rows to be decoded in each strip of the read() sequence.
+    *
+    * Reader classes should implement this directly.  (LTIImageFilter
+    * implements this as a call to setStripHeight() on the previous stage.)
+    *
+    * @param stripHeight the number of rows to decode at one time 
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS setStripHeight(lt_uint32 stripHeight) = 0;
+
+   virtual lt_int64 getPhysicalFileSize() const = 0;
+
+
+   /**
+    * get the cost to encode this scene
+    *
+    * Returns the "cost" to encode this scene, for use by those image writers
+    * which have usage metering enabled.  The typical cost is equal to the
+    * nominal image size (width * height * numBands * bytesPerSample), but
+    * this is overridden for special situations, e.g. the mosaic filter.
+    *
+    * @param  scene  the scene to be charged for 
+    * @return the cost to encode the given scene
+    */
+   virtual lt_int64 getEncodingCost(const LTIScene& scene) const=0;
+
+   /**
+    * get the underlying scene to be used
+    *
+    * Get the scene that will be sent to the underlying LTIImageReader.  This
+    * is useful in some complex pipelines.
+    *
+    * @param  decodeScene  the scene that would be given to read() 
+    * @param  readerScene  the scene that is the actual scene passed
+    *                      the underlying image reader 
+    * @return true if readerScene is not empty
+    */
+   virtual bool getReaderScene(const LTIScene &decodeScene,
+                               LTIScene &readerScene) const = 0;
+
+   /**
+    * get number of strips in scene
+    *
+    * After readBegin() has been called, this will return the number of
+    * strips in the given scene.
+    *
+    * @return number of strips in the current scene
+    */
+   virtual lt_uint32 getNumStrips() const;
+
+   /**
+    * get a strip for current scene
+    *
+    * After readBegin() has been called, this function can be used to return
+    * the scene corresponding to the given strip number for the current scene
+    * being decoded.
+    *
+    * @param   stripNumber  the strip to compute the scene for 
+    * @return  the scene representing the strip
+    */
+   virtual LTIScene getStripScene(lt_uint32 stripNumber) const;
+
+   /**
+    * override the background color of the image
+    *
+    * This function is used to set the background color of the image.
+    *
+    * @param backgroundPixel  the data for the background color
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS overrideBackgroundPixel(const LTIPixel *backgroundPixel);
+
+   /**
+    * override the "no data" (transparency) color of the image
+    *
+    * This function is used to set the "no data" or transparency color of the
+    * image.
+    *
+    * @param nodataPixel  the data for the transparency color
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS overrideNoDataPixel(const LTIPixel *nodataPixel);
+
+   /**
+    * override the geographic coordinates of the image
+    *
+    * This function is used to set the geographic coordinates of the image.
+    *
+    * @param geoCoord    the geographic coordinate information
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS overrideGeoCoord(const LTIGeoCoord &geoCoord);
+
+   virtual LT_STATUS removeAllMetadata();
+
+protected:
+   /**
+    * fill the background of the scene
+    *
+    * This function sets the buffer to the background pixel, if any.
+    *
+    * Derived classes may choose to override this.
+    *
+    * @param   scene   the region (and scale) of the image to be read 
+    * @param   buffer  the buffer to read the pixels into 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS fillBackground(const LTIScene& scene,
+                            LTISceneBuffer& buffer);
+
+   /**
+    * fill the scene to given pixel
+    *
+    * This function sets the buffer to the given pixel.
+    *
+    * Derived classes may choose to override this.
+    *
+    * @param   scene   the region (and scale) of the image to be read 
+    * @param   buffer  the buffer to read the pixels into 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS fillBackground(const LTIScene& scene,
+                            LTISceneBuffer& buffer,
+                            const LTIPixel&);
+
+   /**
+    * read a strip from the image
+    *
+    * This function is called by readStrip() to implement the actual
+    * class-specific work for decoding a strip of the scene.
+    *
+    * Derived classes must implement this function.
+    *
+    * This function should never be called directly.
+    *
+    * @param   stripBuffer  the buffer to read the pixels into  
+    * @param   stripScene   the scene for this strip being decoded  
+    * @return  status code indicating success or failure
+    */
+   virtual LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene) =0;
+
+   /**
+    * start strip-based read
+    *
+    * This function is called by readBegin() to start the actual
+    * class-specific work for decoding a scene.
+    *
+    * Derived classes must implement this function.
+    *
+    * This function should never be called directly.
+    *
+    * @param scene  the full scene to be read 
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS decodeBegin(const LTIScene& scene) =0;
+
+   /**
+    * finish strip-based read
+    *
+    * This function is called by readEnd() to complete the actual
+    * class-specific work for decoding a scene.
+    *
+    * Derived classes must implement this function.
+    *
+    * This function should never be called directly.
+    *
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS decodeEnd() =0;
+
+   /**
+    * get progress delegate
+    *
+    * This function returns the object's progress delegate.
+    *
+    * The function will return NULL if no delegate has been set.
+    *
+    * Derived classes should call this method from within their read()
+    * methods so that they can inform the user of the progress of the read
+    * operation.
+    *
+    * @return  a pointer to the delegate object (or NULL if no delegate has been set)
+    */
+   virtual LTIProgressDelegate* getProgressDelegate() const;
+
+   /**
+    * get interrupt delegate
+    *
+    * This function returns the object's interrupt delegate.
+    *
+    * The function will return NULL if no delegate has been set.
+    *
+    * Derived classes should call this method from within their read()
+    * methods so that they can determine if the user has requested that the read
+    * operation should be aborted.
+    *
+    * @return  a pointer to the delegate object (or NULL if no delegate has been set)
+    */
+   virtual LTIInterruptDelegate* getInterruptDelegate() const;
+
+   /**
+    * get full scene
+    *
+    * This function returns the object's scene that was passed to readBegin().
+    * Only use this function in decode{Begin, Strip, End}().
+    *
+    * @return  the scene
+    */
+   const LTIScene &getFullScene() const;
+
+private:
+   LT_STATUS validateReadRequestScene(const LTIScene& fullScene) const;
+   LT_STATUS validateReadRequestBuffer(const LTIScene& fullScene,
+                                       LTISceneBuffer& fullData) const;
+
+   LT_STATUS checkDelegates(const LTIScene*, bool);
+
+   //
+   // helper functions
+   //
+   class StripMarcher;
+   StripMarcher* m_stripMarcher;
+   LTIScene *m_fullScene;
+   
+   LTIProgressDelegate* m_progressDelegate;
+   LTIInterruptDelegate* m_interruptDelegate;
+
+   // nope
+   LTIImageStage(const LTIImageStage&);
+   LTIImageStage& operator=(const LTIImageStage&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_IMAGESTAGE_H
diff --git a/src/DSDK/include/base/lti_imageStageManager.h b/src/DSDK/include/base/lti_imageStageManager.h
new file mode 100644
index 0000000..1946e45
--- /dev/null
+++ b/src/DSDK/include/base/lti_imageStageManager.h
@@ -0,0 +1,84 @@
+/* $Id: lti_imageStageManager.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_IMAGESTAGEMANAGER_H
+#define LTI_IMAGESTAGEMANAGER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageStage.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+/**
+ * abstract class for managing file formats with multiply images/tiles
+ */
+class LTIImageStageManager
+{
+public:
+
+   /**
+    * destructor
+    */
+   virtual ~LTIImageStageManager();
+
+   /**
+    * create an image stage
+    *
+    * Note when done with the image stage call deleteImageStage() because the
+    * may cache the image stage.
+    *
+    * @param  imageNumber  id/number of the image
+    * @param  imageStage   a pointer to the created image stage
+    */
+   virtual LT_STATUS createImageStage(lt_uint32 imageNumber,
+                                      LTIImageStage *&imageStage) = 0;
+
+   /**
+    * give the image stage back to the manager
+    *
+    * @param  imageNumber  id/number of the image
+    * @param  imageStage   a pointer to the image stage to delete
+    */
+   virtual LT_STATUS deleteImageStage(lt_uint32 imageNumber,
+                                      LTIImageStage *imageStage) = 0;
+
+   /**
+    * get the number of images/tiles the object is managing
+    */
+   lt_uint32 getNumImages(void) const;
+
+protected:
+   LTIImageStageManager(void);
+   void setNumImages(lt_uint32 numImages);
+
+private:
+   lt_uint32 m_numImages;
+
+   // nope
+   LTIImageStageManager(const LTIImageStageManager &);
+   LTIImageStageManager& operator=(const LTIImageStageManager &);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_IMAGESTAGEMANAGER_H
diff --git a/src/DSDK/include/base/lti_imageWriter.h b/src/DSDK/include/base/lti_imageWriter.h
new file mode 100644
index 0000000..ad2334b
--- /dev/null
+++ b/src/DSDK/include/base/lti_imageWriter.h
@@ -0,0 +1,276 @@
+/* $Id: lti_imageWriter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_IMAGEWRITER_H
+#define LTI_IMAGEWRITER_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIProgressDelegate;
+class LTIInterruptDelegate;
+
+
+/**
+ * abstract class for implementing an image writer
+ *
+ * The LTIImageWriter abstract class is used to output pixels from an image
+ * pipeline to an actual image format.  The classes MG3ImageWriter,
+ * TIFFImageWriter, etc, derive from this class.
+ */
+class LTIImageWriter
+{
+public:
+   /**
+    * constructor
+    *
+    * This constructor creates an abstract image writer for the given
+    * image stage.
+    *
+    * Note that the pointer to the input image stage may not be NULL.
+    * The writer does not take ownership of the image stage.
+    *
+    * @param  image  the source of image data to be written
+    */
+   LTIImageWriter(LTIImageStage* image);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIImageWriter();
+
+   /**
+    * initialization function
+    */
+   virtual LT_STATUS initialize();
+
+   /**
+    * write (encode) a scene to the output format
+    *
+    * This function writes the given scene to the implemented image format.
+    *
+    * The write() function just calls writeBegin() for the given scene(),
+    * then calls writeStrip() repeatedly for each strip in the scene(), then
+    * calls writeEnd().
+    *
+    * A derived classes should not override this function, unless it has
+    * special requirements for interacting with the rest of the image
+    * pipeline.
+    *
+    * @param   scene  the scene to decode and output
+    * @return  status code indicating success or failure
+    */
+   virtual LT_STATUS write(const LTIScene& scene);
+
+   /**
+    * begin an encode (write) operation
+    *
+    * This function implements the logic for beginning the encoding of the
+    * given scene.
+    *
+    * The scene must be a valid scene for the underlying image pipeline.
+    *
+    * This function is called by write().  Derived classes must implement
+    * this function.
+    *
+    * @param   scene  the scene to decode and output
+    * @return  status code indicating success or failure
+    */
+   virtual LT_STATUS writeBegin(const LTIScene& scene) =0;
+
+   /**
+    * encode one strip of the scene
+    *
+    * This function implements the logic for actually encoding a given strip
+    * of the given scene.
+    *
+    * This function is called by write().  Derived classes must implement
+    * this function.
+    *
+    * @param   stripBuffer  the pixels for the current strip
+    * @param   stripScene   the scene representing the strip being written
+    * @return  status code indicating success or failure
+    */
+   virtual LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, 
+                                const LTIScene& stripScene) =0;
+
+   /**
+    * complete an encode (write) operation
+    *
+    * This function implements the logic for completing the encoding of the
+    * given scene.
+    *
+    * This function is called by write().  Derived classes must implement
+    * this function.
+    *
+    * @return  status code indicating success or failure
+    */
+   virtual LT_STATUS writeEnd() =0;
+
+   /**
+    * set the stripheight for the encode
+    *
+    * This function sets the stripheight to be used when encoding a scene,
+    * i.e. the number of rows to process at one time.  This value is used
+    * to control the decode requests from the image pipeline.
+    *
+    * @param  stripHeight  the number of rows to encode at one time
+    * @return  status code indicating success or failure
+    */
+   virtual LT_STATUS setStripHeight(lt_uint32 stripHeight);
+
+   /**
+    * get the stripheight for the encode
+    *
+    * Returns the number of rows which will be encoded at a time.
+    *
+    * @return  the stripheight setting of the encoder
+    */
+   virtual lt_uint32 getStripHeight() const;
+
+   /**
+    * get the preferred stripheight for the encode
+    *
+    * Returns the preferred stripheight for the encoder.  By default, this is
+    * just the stripheight of the underlying image pipeline.  A derived class
+    * may override this to reflect specific needs of an encoder
+    * implementation, however.
+    *
+    * @return  the preferred stripheight setting of the encoder
+    */
+   virtual lt_uint32 getDefaultStripHeight() const;
+
+   /**
+    * get the cost to encode the scene
+    *
+    * Returns the cost to encode this scene, for application using the usage
+    * metering system.  See LTIImageStage::getEncodingCost() for details.
+    *
+    * @param   scene  the scene to determine the cost for
+    * @return  the cost for the scene
+    */
+   virtual lt_int64 getEncodingCost(const LTIScene& scene) const;
+
+   /**
+    * get the approximate output filesize
+    *
+    * Returns an estimate of the number of bytes that will be output to
+    * the output file/stream.
+    *
+    * The default position is to assume the nominal size, that is
+    * width * height * bands * sample-size.  Compressed file formats
+    * should take the compression ratio into account when estimating
+    * this number.  This number may be inaccurate due to file format
+    * overhead, metatata overhead, and/or compression estimations.
+    *
+    * @param   scene  the scene to determine the output filesize for
+    * @return  the number of bytes in the output file
+    */
+   virtual lt_int64 getEstimatedOutputSize(const LTIScene& scene) const;
+
+   /**
+    * set progress delegate
+    *
+    * This function sets the progress delegate, which is used in a callback-like
+    * fashion to report percent-complete of a write() operation back to the
+    * calling application.
+    *
+    * Passing NULL to this function should remove the LTIImageWriter's current delegate,
+    * if any.
+    *
+    * Note this function does not take ownership of the delegate object.
+    *
+    * @param  delegate  a pointer to the delegate object to be used by the image writer
+    */
+   virtual void setProgressDelegate(LTIProgressDelegate* delegate);
+
+   /**
+    * set interrupt delegate
+    *
+    * This function sets the interrupt delegate, which is used in a callback-like
+    * fashion by the calling application to asynchronously indicate that a write()
+    * operation should be halted without completing.
+    *
+    * Passing NULL to this function should remove the LTIImageWriter's current delegate,
+    * if any.
+    *
+    * Note this function does not take ownership of the delegate object.
+    *
+    * @param  delegate  a pointer to the delegate object to be used by the image writer
+    */
+   virtual void setInterruptDelegate(LTIInterruptDelegate* delegate);
+
+protected:
+   /**
+    * get progress delegate
+    *
+    * This function returns the object's progress delegate.
+    *
+    * The function will return NULL if no delegate has been set.
+    *
+    * Derived classes should call this method from within their write()
+    * methods so that they can inform the user of the progress of the write
+    * operation.
+    *
+    * @return  a pointer to the delegate object (or NULL if no delegate has been set)
+    */
+   virtual LTIProgressDelegate* getProgressDelegate() const;
+
+   /**
+    * get interrupt delegate
+    *
+    * This function returns the object's interrupt delegate.
+    *
+    * The function will return NULL if no delegate has been set.
+    *
+    * Derived classes should call this method from within their write()
+    * methods so that they can determine if the user has requested that the write
+    * operation should be aborted.
+    *
+    * @return  a pointer to the delegate object (or NULL if no delegate has been set)
+    */
+   virtual LTIInterruptDelegate* getInterruptDelegate() const;
+
+   LTIImageStage* m_image;
+
+private:
+   LT_STATUS checkDelegates(const LTIScene& fullScene,
+                            const LTIScene* currScene,
+                            bool atEnd);
+
+   lt_uint32 m_stripHeight;
+
+   LTIProgressDelegate* m_progressDelegate;
+   LTIInterruptDelegate* m_interruptDelegate;
+
+   // nope
+   LTIImageWriter(LTIImageWriter&);
+   LTIImageWriter& operator=(const LTIImageWriter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_IMAGEWRITER_H
diff --git a/src/DSDK/include/base/lti_navigator.h b/src/DSDK/include/base/lti_navigator.h
new file mode 100644
index 0000000..55d8ad4
--- /dev/null
+++ b/src/DSDK/include/base/lti_navigator.h
@@ -0,0 +1,393 @@
+/* $Id: lti_navigator.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_NAVIGATOR_H
+#define LTI_NAVIGATOR_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// lt_lib_mrsid_core
+#include "lti_scene.h"
+#include "lti_geoCoord.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIImage;
+
+
+/**
+ * provides LTIScene movement control
+ *
+ * Class for navigating around an image.  This class extends LTIScene by
+ * adding functions for moving the scene, resizing, zooming, etc.
+ */
+class LTINavigator : public LTIScene
+{
+public:
+   /**
+    * Styles for scene-setting operations.  These constants are used to
+    * define how to treat out-of-bounds conditions for scene-setting operations,
+    * i.e. when a calculated scene or magnification is not valid for our image.
+    */
+   typedef enum
+   {
+      STYLE_LAX    = 1,    /**< if invalid scene, return success anyway */
+      STYLE_STRICT = 2,    /**< if invalid scene, return an error code */
+      STYLE_CLIP   = 3     /**< if invalid scene, clip scene to image and return success */
+   } Style;
+
+public:
+   /**
+    * default constructor
+    *
+    * This constructor creates an LTINavigator whose scene corresponds
+    * to the entire given image at magnification 1.0.
+    *
+    * @param image the image to be navigated within 
+    */
+   LTINavigator(const LTIImage& image);
+
+   /**
+    * constructor
+    *
+    * This constructor creates an LTINavigator with the given scene.
+    *
+    * @param  image  the image to be navigated within 
+    * @param  scene  the initial scene 
+    */
+   LTINavigator(const LTIImage& image,
+                const LTIScene& scene);
+
+   /**
+    * destructor
+    */
+   ~LTINavigator();
+   
+   /**
+    * Returns the image the navigator is attached to.
+    *
+    * @return the navigator's image
+    */
+   const LTIImage& getImage() const;
+
+   /**
+    * is current scene is legal for the image
+    *
+    * Returns true if the current scene is legal for the image.  If any part
+    * of the scene is outside the boundaries of the image or if the
+    * magnification is not supported by the image, false will be returned.
+    *
+    * @return the navigator's image
+    */
+   bool isSceneValid() const;
+
+   /**
+    * move by specified amount
+    *
+    * Modifies the current scene by moving by the specified amount.
+    * (See also moveTo().)
+    *
+    * @param   xDelta  the number of pixels to move horizontally 
+    * @param   yDelta  the number of pixels to move vertically 
+    * @param   style   how to handle boundary conditions 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS moveBy(double xDelta, double yDelta, Style style);
+
+   /**
+    * move to specified amount
+    *
+    * Modifies the current scene by moving to the specified (x,y) position.
+    * (See also moveBy().)
+    *
+    * @param   x      the x-position to move to 
+    * @param   y      the y-position to move to 
+    * @param   style  how to handle boundary conditions 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS moveTo(double x, double y, Style style);
+
+   /**
+    * zoom by specified amount
+    *
+    * Modifies the current scene by zooming by the specified scale
+    * factor.  (See also zoomTo().)
+    * The other scene parameters (x, y, width,
+    * height) are unaffected, unless the \a style parameter is used.
+    *
+    * For example, a call zoomBy(2.0) will double the magnification.
+    *
+    * @param   delta  the zoom factor 
+    * @param   style  how to handle boundary conditions 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS zoomBy(double delta, Style style);
+
+   /**
+    * zoom to specified scale
+    *
+    * Modifies the current scene by zooming to the specified scale.
+    * (See also zoomBy().)  The other scene parameters (x, y, width,
+    * height) are unaffected, unless the \a style parameter is used.
+    *
+    * For example, a call zoomBy(2.0) will double the magnification.
+    *
+    * @param   mag    the magnification to change to 
+    * @param   style  how to handle boundary conditions 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS zoomTo(double mag, Style style);
+
+   /**
+    * return scene large enough to fit window
+    *
+    * Returns a scene which fits the image to the given size.  The scene will
+    * be the largest such that the entire image fits completely within the
+    * specified dimensions.  A failure code will be returned if the request
+    * cannot be honored.
+    *
+    * @note This function does NOT stretch, upsample, or downsample the image;
+    * it will only determine the best fit within the bounds of the resolutions
+    * that the image supports, e.g. power-of-two.
+    *
+    * @param   maxWidth   the maximum width of the scene to return 
+    * @param   maxHeight  the maximum height of the scene to return 
+    * @param   newScene   the scene which fits the request 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS bestFit(double maxWidth, double maxHeight, LTIScene& newScene);
+
+   /**
+    * round scene to integral values
+    *
+    * Modifies the current scene by performing proper integral rounding on
+    * the (x,y) position and the dimensions.
+    */
+   void roundScene();
+
+   /**
+    * clip scene to fit image
+    *
+    * This function clips the current scene to the boundaries of the image at
+    * the current magnification.
+    *
+    * @return true if the resulting scene contains any part of the image
+    */
+   bool clipToImage();
+   
+   /**
+    * clip scene to fit given scene
+    *
+    * This function clips the current scene to the boundaries of the given
+    * scene.
+    *
+    * @return true if the resulting scene contains any part of the image
+    */
+   bool clipToScene(const LTIScene& scene);
+
+   /**
+    * reset scene
+    *
+    * This function manually resets the navigator scene to the given scene.
+    *
+    * @param scene the new scene 
+    * @param style boundary condition mode 
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setScene(const LTIScene& scene, Style style);
+
+
+   /**
+    * set scene to "icon"
+    *
+    * This function sets the navigator scene to the icon (the smallest
+    * magnification this image can be represented at).
+    *
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setSceneToIcon();
+
+
+   /**
+    * set scene to full image
+    *
+    * This function sets the navigator scene to the entire image at full
+    * resolution.
+    *
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setSceneToFull();
+
+
+   /**
+    * get current scene
+    *
+    * This function returns the current navigator scene, e.g. to be used in
+    * a call to LTIImageReader::read().
+    *
+    * Note the returned object is volatile; caller should use copy ctor as needed.
+    *
+    * @return the navigator scene
+    */
+   const LTIScene& getScene() const;
+
+   /**
+    * returns the geographic coordinates of scene
+    *
+    * Returns the geographic coordinates of the current scene.
+    *
+    * @return the geo coordinates
+    */
+   LTIGeoCoord getGeoCoord() const;
+
+   /**
+    * @name Functions to set scene explicitly
+    */
+   /*@{*/
+
+   /**
+    * set scene to given position
+    *
+    * Sets the scene to the given position.  The position is specified using
+    * upper-left/width-height values.
+    *
+    * @param   upperLeftX     the upper-left x-position of the new scene
+    * @param   upperLeftY     the upper-left y-position of the new scene
+    * @param   width          the width of the new scene
+    * @param   height         the height of the new scene
+    * @param   magnification  the magnification of the new scene
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setSceneAsULWH(double upperLeftX, double upperLeftY,
+                            double width, double height,
+                            double magnification);
+
+   /**
+    * set scene to given position
+    *
+    * Sets the scene to the given position.  The position is specified using
+    * upper-left/lower-right values.
+    *
+    * @param   upperLeftX     the upper-left x-position of the new scene
+    * @param   upperLeftY     the upper-left y-position of the new scene
+    * @param   lowerRightX    the lower-right x-position of the new scene
+    * @param   lowerRightY    the lower-right y-position of the new scene
+    * @param   magnification  the magnification of the new scene
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setSceneAsULLR(double upperLeftX, double upperLeftY,
+                            double lowerRightX, double lowerRightY,
+                            double magnification);
+
+   /**
+    * sets scene to the given position
+    *
+    * Sets the scene to the given position.  The position is specified using
+    * center/width-height values.
+    *
+    * @param   centerX        the center x-position of the new scene
+    * @param   centerY        the center y-position of the new scene
+    * @param   width          the width of the new scene
+    * @param   height         the height of the new scene
+    * @param   magnification  the magnification of the new scene
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setSceneAsCWH(double centerX, double centerY,
+                           double width, double height,
+                           double magnification);
+   /*@}*/
+
+
+   /**
+    * @name Functions to set scene explicitly, using geographic coordinates
+    */
+   /*@{*/
+
+   /**
+    * set scene to given position
+    *
+    * Sets the scene to the given position.  The position is specified using
+    * upper-left/width-height values.  The values are in "geo" space, i.e.
+    * that of the LTIGeoCoord space.
+    *
+    * @param   upperLeftX     the upper-left x-position of the new scene
+    * @param   upperLeftY     the upper-left y-position of the new scene
+    * @param   width          the width of the new scene
+    * @param   height         the height of the new scene
+    * @param   magnification  the magnification of the new scene
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setSceneAsGeoULWH(double upperLeftX, double upperLeftY,
+                               double width, double height,
+                               double magnification);
+
+   /**
+    * set scene to given position
+    *
+    * Sets the scene to the given position.  The position is specified using
+    * upper-left/lower-right values.  The values are in "geo" space, i.e.
+    * that of the LTIGeoCoord space.
+    *
+    * @param   upperLeftX     the upper-left x-position of the new scene
+    * @param   upperLeftY     the upper-left y-position of the new scene
+    * @param   lowerRightX    the lower-right x-position of the new scene
+    * @param   lowerRightY    the lower-right y-position of the new scene
+    * @param   magnification  the magnification of the new scene
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setSceneAsGeoULLR(double upperLeftX, double upperLeftY,
+                               double lowerRightX, double lowerRightY,
+                               double magnification);
+
+   /**
+    * set scene to given position
+    *
+    * Sets the scene to the given position.  The position is specified using
+    * center/width-height values.  The values are in "geo" space, i.e.
+    * that of the LTIGeoCoord space.
+    *
+    * @param   centerX        the center x-position of the new scene
+    * @param   centerY        the center y-position of the new scene
+    * @param   width          the width of the new scene
+    * @param   height         the height of the new scene
+    * @param   magnification  the magnification of the new scene
+    * @return status code indicating success or failure
+    */
+   LT_STATUS setSceneAsGeoCWH(double centerX, double centerY,
+                              double width, double height,
+                              double magnification);
+   /*@}*/
+
+protected:
+   const LTIImage& m_image;
+
+private:
+   // nope
+   LTINavigator();
+   LTINavigator(LTINavigator&);
+   LTINavigator& operator=(const LTINavigator&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_NAVIGATOR_H
diff --git a/src/DSDK/include/base/lti_pixel.h b/src/DSDK/include/base/lti_pixel.h
new file mode 100644
index 0000000..54f39c0
--- /dev/null
+++ b/src/DSDK/include/base/lti_pixel.h
@@ -0,0 +1,444 @@
+/* $Id: lti_pixel.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_PIXEL_H
+#define LTI_PIXEL_H
+
+// lt_lib_mrsid_core
+#include "lti_types.h"
+
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(push,4)
+#endif
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTISample;
+
+
+/**
+ * basic properties of a pixel
+ *
+ * This class stores the basic properties of a pixel:
+ * \li the number of bands
+ * \li the colorspace
+ * \li the datatype
+ *
+ * This is done by representing the pixel as a set of samples.
+ * Since the colorspace cannot in general be inferred from the
+ * colors in the samples, the user must declare the colorspace
+ * for the pixel.
+ */
+class LTIPixel
+{
+public:
+   /**
+    * constructor
+    *
+    * This constructor creates an LTIPixel object with the given
+    * properties: all the samples will be of the same type.
+    *
+    * @param  colorSpace  the pixel colorspace
+    * @param  numBands    the number of bands (samples per pixel)
+    * @param  dataType    the datatype of the samples
+    * @param  samples     optional sample objects (default is uint8 set to 0)
+    */
+   LTIPixel(LTIColorSpace colorSpace,
+            lt_uint16 numBands,
+            LTIDataType dataType,
+            const LTISample* samples=0);
+
+   /**
+    * constructor
+    *
+    * This constructor creates an LTIPixel object made up of the
+    * given sample types.  If the colorspace given is LTI_COLORSPACE_INVALID,
+    * then the function will attempt to infer the colorspace from the
+    * underlying samples; if there is no obvious colorspace, e.g. RGB,
+    * the LTI_COLORSPACE_MULTISPECTRAL will be used.
+    *
+    * @param  samples     the samples of the pixel
+    * @param  numBands    the number of bands (samples per pixel)
+    * @param  colorSpace  the overall colorspace
+    */
+   LTIPixel(const LTISample* samples,
+            lt_uint16 numBands,
+            LTIColorSpace colorSpace=LTI_COLORSPACE_INVALID);
+
+   /**
+    * copy constructor
+    */
+   LTIPixel(const LTIPixel&);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIPixel();
+
+   /**
+    * assignment operator
+    */
+   virtual LTIPixel& operator=(const LTIPixel&);
+
+   /**
+    * equality operator
+    */
+   bool operator==(const LTIPixel&) const;
+
+   /**
+    * equality operator
+    */
+   bool operator!=(const LTIPixel&) const;
+
+   /**
+    * get the sample datatype
+    *
+    * This function returns the datatype of the samples.  Returns
+    * LTI_DATATYPE_INVALID if the samples are not all the same
+    * datatype.
+    *
+    * @return the datatype of the samples
+    */
+   LTIDataType getDataType() const;
+
+   /**
+    * get the colorspace
+    *
+    * This function returns the colorspace of the pixel.
+    *
+    * @return the colorspace of the pixel
+    */
+   LTIColorSpace getColorSpace() const;
+
+   /**
+    * get the number of bands
+    *
+    * This function returns the number of bands in the pixel (samples
+    * per pixel).
+    *
+    * @return the number of bands
+    */
+   lt_uint16 getNumBands() const;
+
+   /**
+    * get the size of a pixel
+    *
+    * This function returns the size of a single pixel, in bytes.
+    *
+    * This is equivalent to the sum of getBytesPerSample() for each
+    * of the samples.
+    *
+    * @return the number of bytes per pixel
+    */
+   lt_uint32 getNumBytes() const;
+
+   /**
+    * returns the largest size of any sample
+    *
+    * Returns the largest size of any sample.  This is equivalent to the
+    * computing the maximum of getBytesPerSample() for each of the samples.
+    *
+    * @return  the number of bytes per sample
+    */
+   lt_uint32 getMaxBytesPerSample() const;
+
+   /**
+    * returns status code comparing two pixels
+    *
+    * Returns status code comparing two pixels.  This is just a different
+    * version of operator==, which returns a status code instead of a bool.
+    *
+    * @param   pixel  the sample to compare this sample to
+    * @return  a specific code indicating if impedance matches
+    */
+   LT_STATUS checkImpedance(const LTIPixel& pixel) const;
+
+   LTISample* getSamples() const;
+   LTISample& getSample(lt_uint16) const;
+
+   /**
+    * @name Helper functions to get sample values
+    */
+   /*@{*/
+
+   /**
+    * returns the address of the specified sample's value
+    *
+    * Returns the address of the specified sample's value.  The caller must
+    * cast the pointer to the appropriate type before using.
+    *
+    * @param  band  the band number of the sample to use
+    * @return  the address of the sample's value
+    */
+   const void* getSampleValueAddr(lt_uint16 band) const;
+
+   /**
+    * returns the specified sample's value
+    *
+    * Returns the specified sample's value.  The sample is assumed to be
+    * known to have the UINT8 datatype.
+    *
+    * @param  band  the band number of the sample to use
+    * @return  the sample's value
+    */
+   lt_uint8 getSampleValueUint8(lt_uint16 band) const;
+
+   /**
+    * returns the specified sample's value
+    *
+    * Returns the specified sample's value.  The sample is assumed to be
+    * known to have the SINT8 datatype.
+    *
+    * @param  band  the band number of the sample to use
+    * @return  the sample's value
+    */
+   lt_int8 getSampleValueSint8(lt_uint16 band) const;
+
+   /**
+    * returns the specified sample's value
+    *
+    * Returns the specified sample's value.  The sample is assumed to be
+    * known to have the UINT16 datatype.
+    *
+    * @param  band  the band number of the sample to use
+    * @return  the sample's value
+    */
+   lt_uint16 getSampleValueUint16(lt_uint16 band) const;
+
+   /**
+    * returns the specified sample's value
+    *
+    * Returns the specified sample's value.  The sample is assumed to be
+    * known to have the SINT16 datatype.
+    *
+    * @param  band  the band number of the sample to use
+    * @return  the sample's value
+    */
+   lt_int16 getSampleValueSint16(lt_int16 band) const;
+
+   /**
+    * returns the specified sample's value
+    *
+    * Returns the specified sample's value.  The sample is assumed to be
+    * known to have the FLOAT32 datatype.
+    *
+    * @param  band  the band number of the sample to use
+    * @return  the sample's value
+    */
+   float getSampleValueFloat32(lt_uint16 band) const;
+   
+   /*@}*/
+
+   /**
+    * @name Helper functions to set sample values
+    */
+   /*@{*/
+
+   /**
+    * sets all samples to minimum
+    *
+    * Sets all samples to the minimum value of the datatype.
+    */
+   void setSampleValuesToMin();
+
+   /**
+    * sets all samples to maximum
+    *
+    * Sets all samples to the maximum value of the datatype.
+    */
+   void setSampleValuesToMax();
+   
+   /**
+    * sets sample value by address
+    *
+    * Sets sample value to value pointed to.
+    *
+    * @param  band  which sample to set
+    * @param  data  value to use
+    */
+   void setSampleValueAddr(lt_uint16 band, const void* data) const;
+
+   /**
+    * sets all samples to the given value
+    *
+    * Sets all samples to the given value of the datatype.  The samples are
+    * assumed to be known to have the UINT8 datatype.
+    *
+    * @param  value  the value to set the samples to
+    */
+   void setSampleValuesUint8(lt_uint8 value);
+
+   /**
+    * sets all samples to the given value
+    *
+    * Sets all samples to the given value of the datatype.  The samples are
+    * assumed to be known to have the SINT8 datatype.
+    *
+    * @param  value  the value to set the samples to
+    */
+   void setSampleValuesSint8(lt_int8 value);
+
+   /**
+    * sets all samples to the given value
+    *
+    * Sets all samples to the given value of the datatype.  The samples are
+    * assumed to be known to have the UINT16 datatype.
+    *
+    * @param  value  the value to set the samples to
+    */
+   void setSampleValuesUint16(lt_uint16 value);
+
+   /**
+    * sets all samples to the given value
+    *
+    * Sets all samples to the given value of the datatype.  The samples are
+    * assumed to be known to have the SINT16 datatype.
+    *
+    * @param  value  the value to set the samples to
+    */
+   void setSampleValuesSint16(lt_int16 value);
+
+   /**
+    * sets all samples to the given value
+    *
+    * Sets all samples to the given value of the datatype.  The samples are
+    * assumed to be known to have the FLOAT32 datatype.
+    *
+    * @param  value  the value to set the samples to
+    */
+   void setSampleValuesFloat32(float value);
+
+   /**
+    * sets the given sample to the given value
+    *
+    * Sets the given sample to the given value of the datatype.  The sample is
+    * assumed to be known to have the UINT8 datatype.
+    *
+    * @param  band   the band number of the sample to use
+    * @param  value  the value to set the samples to
+    */
+   void setSampleValueUint8(lt_uint16 band, lt_uint8 value);
+
+   /**
+    * sets the given sample to the given value
+    *
+    * Sets the given sample to the given value of the datatype.  The sample is
+    * assumed to be known to have the SINT8 datatype.
+    *
+    * @param  band   the band number of the sample to use
+    * @param  value  the value to set the samples to
+    */
+   void setSampleValueSint8(lt_uint16 band, lt_int8 value);
+
+   /**
+    * sets the given sample to the given value
+    *
+    * Sets the given sample to the given value of the datatype.  The sample is
+    * assumed to be known to have the UINT16 datatype.
+    *
+    * @param  band   the band number of the sample to use
+    * @param  value  the value to set the samples to
+    */
+   void setSampleValueUint16(lt_uint16 band, lt_uint16 value);
+
+   /**
+    * sets the given sample to the given value
+    *
+    * Sets the given sample to the given value of the datatype.  The sample is
+    * assumed to be known to have the SINT16 datatype.
+    *
+    * @param  band   the band number of the sample to use
+    * @param  value  the value to set the samples to
+    */
+   void setSampleValueSint16(lt_uint16 band, lt_int16 value);
+
+   /**
+    * sets the given sample to the given value
+    *
+    * Sets the given sample to the given value of the datatype.  The sample is
+    * assumed to be known to have the FLOAT32 datatype.
+    *
+    * @param  band   the band number of the sample to use
+    * @param  value  the value to set the samples to
+    */
+   void setSampleValueFloat32(lt_uint16 band, float value);
+
+   /**
+    * sets all samples to the given values
+    *
+    * Sets all samples to the given values of the datatype.  The sample is
+    * assumed to be known to have the UINT8 datatype.
+    *
+    * @param  values  the values to set the samples to
+    */
+   void setSampleValuesUint8(const lt_uint8* values);
+
+   /**
+    * sets all samples to the given values
+    *
+    * Sets all samples to the given values of the datatype.  The sample is
+    * assumed to be known to have the SINT8 datatype.
+    *
+    * @param  values  the values to set the samples to
+    */
+   void setSampleValuesSint8(const lt_int8* values);
+
+   /**
+    * sets all samples to the given values
+    *
+    * Sets all samples to the given values of the datatype.  The sample is
+    * assumed to be known to have the UINT16 datatype.
+    *
+    * @param  values  the values to set the samples to
+    */
+   void setSampleValuesUint16(const lt_uint16* values);
+
+   /**
+    * sets all samples to the given values
+    *
+    * Sets all samples to the given values of the datatype.  The sample is
+    * assumed to be known to have the SINT16 datatype.
+    *
+    * @param  values  the values to set the samples to
+    */
+   void setSampleValuesSint16(const lt_int16* values);
+
+   /**
+    * sets all samples to the given values
+    *
+    * Sets all samples to the given values of the datatype.  The sample is
+    * assumed to be known to have the FLOAT32 datatype.
+    *
+    * @param  values  the values to set the samples to
+    */
+   void setSampleValuesFloat32(const float* values);
+   /*@}*/
+
+private:
+   void createSamples(LTIDataType dt);
+   void createSamples(const LTISample*);
+   void deleteSamples();
+
+   LTISample* m_samples;
+   lt_uint16 m_numBands;
+   LTIColorSpace m_colorSpace;
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_PIXEL_H
diff --git a/src/DSDK/include/base/lti_pixelLookupTable.h b/src/DSDK/include/base/lti_pixelLookupTable.h
new file mode 100644
index 0000000..9f00cc4
--- /dev/null
+++ b/src/DSDK/include/base/lti_pixelLookupTable.h
@@ -0,0 +1,142 @@
+/* $Id: lti_pixelLookupTable.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_PIXELLOOKUPTABLE_H
+#define LTI_PIXELLOOKUPTABLE_H
+
+// lt_lib_mrsid_core
+#include "lti_pixel.h"
+
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(push,4)
+#endif
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTIPixel;
+
+
+/**
+ * color lookup table
+ *
+ * This class implements a color lookup table, for use with "indexed"
+ * or "palletized" images.
+ */
+class LTIPixelLookupTable : public LTIPixel
+{
+public:
+   /**
+    * default constructor
+    *
+    * This constructor creates an LTIPixelLookupTable object consisting of
+    * the given number of entries.
+    *
+    * @param  pixelProps  the basic properties of the pixel in this LUT
+    * @param  tableSize   the number of elements in the table
+    */
+   LTIPixelLookupTable(const LTIPixel& pixelProps,
+                       lt_uint32 tableSize);
+
+   /**
+    * copy constructor
+    */
+   LTIPixelLookupTable(const LTIPixelLookupTable&);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIPixelLookupTable();
+
+   /**
+    * get table size
+    *
+    * Returns the number of entries in the table.
+    *
+    * @return the number of entries in the table
+    */
+   lt_uint32 getTableSize() const;
+
+   /**
+    * set table entry
+    *
+    * This function adds an entry to the table.  The index must be less than
+    * the number of entries.  The pixel data is copied into the table.
+    *
+    * If the table already contains an entry with the given index number, the
+    * old entry is removed in favor of the new one.
+    *
+    * @param  index      the index number of the entry
+    * @param  pixelData  the pixel data to be recorded for the index
+    */
+   void setTableEntry(lt_uint32 index,
+                      const LTIPixel& pixelData);
+
+   /** set all table entries
+    *
+    * This function sets all entries to the table.  The \a mapData parameter
+    * is expected to be a one-dimensional array of length tablesize * numbands,
+    * e.g. if the pixel datatype is UINT8 then the array should be of the form
+    * "lt_uint8 data[3 * 256]" for a 3-banded, 256-entry table.  Entry i will be
+    * referenced as data[i], data[i+256], data[i+512].
+    *
+    * @param mapData the colormap data
+    */
+   void setTableEntries(const void* mapData);
+
+   /**
+    * get table entry
+    *
+    * This function returns the entry with the given index number.
+    * The caller takes ownership of the returned object.
+    *
+    * @param   index      the index number of the entry to look up
+    * @return  pointer to the pixel data of the index (or NULL)
+    */
+   LTIPixel* getTableEntry(lt_uint32 index) const;
+
+   /**
+    * get all table entries
+    *
+    * This function returns the color map data as a one-dimensional
+    * array, according to the format described in setAllEntries().
+    */
+   const void* getTableEntries() const;
+
+private:
+   void init(const void* data);
+
+   lt_uint32 m_tableSize;
+
+   // for an RGB map, entry I is formed by: R=data[I], G=data[I+256], B=data[I+512]
+   void* m_data;
+   lt_uint8* m_data_u8;
+   lt_int8* m_data_s8;
+   lt_uint16* m_data_u16;
+   lt_int16* m_data_s16;
+   float* m_data_f32;
+
+   // nope
+   LTIPixelLookupTable();
+   LTIPixelLookupTable& operator=(const LTIPixelLookupTable&);
+   bool operator==(const LTIPixelLookupTable&) const;
+   bool operator!=(const LTIPixelLookupTable&) const;
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_PIXELLOOKUPTABLE_H
diff --git a/src/DSDK/include/base/lti_rawImageReader.h b/src/DSDK/include/base/lti_rawImageReader.h
new file mode 100644
index 0000000..b6a95b7
--- /dev/null
+++ b/src/DSDK/include/base/lti_rawImageReader.h
@@ -0,0 +1,308 @@
+/* $Id: lti_rawImageReader.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTIRAWIMAGEREADER_H
+#define LTIRAWIMAGEREADER_H
+
+// lt_lib_mrsid_core
+#include "lti_geoImageReader.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIPixel;
+class LTIOStreamInf;
+class LTFileSpec;
+class LTIGeoCoord;
+class LTIPixel;
+
+
+/**
+ * class for reading RAW files
+ *
+ * This class reads a RAW image.
+ *
+ * The RAW format used is simple packed BIP form.
+ */
+class LTIRawImageReader : public LTIGeoImageReader 
+{
+public:
+   /**
+    * constructor (stream)
+    *
+    * This function constructs an LTIImageReader using the data in the
+    * stream with the image properties specified.  The input taken from a
+    * stream.
+    *
+    * @param stream        stream containing the RAW image data (may not be NULL) 
+    * @param pixelProps    the pixel properties of the image (colorspace, datatype, etc) 
+    * @param width         the width of the image 
+    * @param height        the height of the image
+    * @param useWorldFile  use world file information if available
+    */
+   LTIRawImageReader(LTIOStreamInf* stream,
+                     const LTIPixel& pixelProps,
+                     lt_uint32 width,
+                     lt_uint32 height,
+                     bool useWorldFile = true);
+
+   /**
+    * constructor (FileSpec)
+    *
+    * This function constructs an LTIImageReader using the data in the
+    * stream with the image properties specified. The input taken from a
+    * stream, and the background and nodata pixels may be specified.
+    *
+    * @param fileSpec      file containing the RAW image data 
+    * @param pixelProps    the pixel properties of the image (colorspace, datatype, etc) 
+    * @param width         the width of the image 
+    * @param height        the height of the image 
+    * @param useWorldFile  use world file information if available
+    */
+   LTIRawImageReader(const LTFileSpec& fileSpec,
+                     const LTIPixel& pixelProps,
+                     lt_uint32 width,
+                     lt_uint32 height,
+                     bool useWorldFile = true);
+
+   /**
+    * constructor (char*)
+    *
+    * This function constructs an LTIImageReader using the data in the
+    * stream with the image properties specified.  The input taken from a
+    * stream, and the background and nodata pixels may be specified.
+    *
+    * @param file          file containing the RAW image data (may not be NULL) 
+    * @param pixelProps    the pixel properties of the image (colorspace, datatype, etc) 
+    * @param width         the width of the image 
+    * @param height        the height of the image 
+    * @param useWorldFile  use world file information if available
+    */
+   LTIRawImageReader(const char* file,
+                     const LTIPixel& pixelProps,
+                     lt_uint32 width,
+                     lt_uint32 height,
+                     bool useWorldFile = true);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIRawImageReader();
+
+   /**
+    * initializer
+    */
+   virtual LT_STATUS initialize();
+
+
+   /**
+    * @name Properties of the RAW image
+    *
+    * These must be called prior to calling initialize(), unlike most other SDK
+    * objects.
+    */
+   /*@{*/
+
+   /**
+    * set geo coordinates
+    *
+    * Sets the geographic coordinates for the image.  If not set, the default
+    * is the normal default of (0,h-1) with resolutions (1.0,-1.0).
+    *
+    * @note This must be called prior to calling initialize().
+    *
+    * @param  geo  the geo coordinates for the image 
+    */
+   void setGeoCoordinate(const LTIGeoCoord& geo);
+
+   /**
+    * set stream ownership
+    *
+    * Sets the ownership of the stream, to indicate responsibility for
+    * deleting the stream when done. This only pertains to objects which were
+    * passed a stream in the ctor.
+    *
+    * If not set, the default is for the object to not take ownership of the
+    * stream.
+    *
+    * @note This must be called prior to calling initialize().
+    *
+    * @param  takeOwnership  set to true to have the reader delete the stream 
+    */
+   void setStreamOwnership(bool takeOwnership);
+
+    /**
+    * add classical metadata
+    *
+    * Directs the reader to populate the standard "classical" metadata tags.
+    *
+    * If not set, the default is to not add the metadata tags.
+    *
+    * @note This must be called prior to calling initialize().
+    *
+    * @param  withMetadata  set to true to have the reader add metadata 
+    */
+   void setMetadata(bool withMetadata);
+
+    /**
+    * set background color
+    *
+    * Sets the background pixel of the image.
+    *
+    * If not set, the default is to leave the background pixel unset.
+    *
+    * @note This must be called prior to calling initialize().
+    *
+    * @param  background  the new background color of the image 
+    */
+   void setBackground(const LTIPixel* background);
+
+    /**
+    * set nodata color
+    *
+    * Sets the NoData pixel of the image.
+    *
+    * If not set, the default is to leave the NoData pixel unset.
+    *
+    * @note This must be called prior to calling initialize().
+    *
+    * @param  nodata  the new nodata color of the image 
+    */
+   void setNoData(const LTIPixel* nodata);
+
+   /**
+    * sets the number of bytes in each row
+    *
+    * Sets the number of bytes in each row.  This allows for alignment
+    * padding, required by certain RAW formats.
+    *
+    * If not set, the bytes per row is simply the number of data items per
+    * row times the size of a data item.  (Note that a "data item" in this
+    * case may be either a pixel or a sample, depending on the layout being
+    * used.)
+    *
+    * @note This must be called prior to calling initialize().
+    *
+    * @param  rowBytes  the number of bytes per row 
+    */
+   void setRowBytes(lt_uint32 rowBytes);
+
+    /**
+    * sets the layout or organization of the raw data
+    *
+    * Sets the layout or organization of the raw data.
+    *
+    * If not set, the default is BIP format.
+    *
+    * @note This must be called prior to calling initialize().
+    *
+    * @param  layout  the layout of the raw data 
+    */
+   void setLayout(LTILayout layout);
+
+    /**
+    * sets the number of bytes to skip at the beginning of the file
+    *
+    * Sets the number of bytes to skip at the beginning of the file.  If not
+    * set, the default is zero (no leading bytes are skipped).
+    *
+    * No skip bytes are assumed to be at the end of the file, and this
+    * function only takes a 32-bit skip length; see the second version
+    * of setSkipBytes() for an alternative.
+    *
+    * @note This must be called prior to calling initialize().
+    *
+    * @param  skipBytes  the number of bytes to skip 
+    */
+   void setSkipBytes(lt_uint32 skipBytes);
+
+    /**
+    * sets the number of bytes to skip at the beginning and end of the file
+    *
+    * Sets the number of bytes to skip at the beginning of the file and
+    * the end of the file.  (The "ending skip bytes" property is sometimes
+    * required because LTIRawImageReader::initialize() does a sanity check
+    * to make sure the number of data bytes in the file is equal to the
+    * number of bytes needed for the given width, height, etc.
+    *
+    * @note This must be called prior to calling initialize().
+    *
+    * @param  leadingBytes  the number of bytes to skip at the top
+    * @param  trailingBytes  the number of bytes to skip at the bottom
+    */
+   void setSkipBytes(lt_int64 leadingBytes, lt_int64 trailingBytes);
+
+   /**
+    * sets endianness of output file
+    *
+    * Sets the byte order or endianness of the output file.
+    *
+    * @note This must be called prior to calling initialize().
+    *
+    * @param  byteOrder  the endian setting to use 
+    */
+   void setByteOrder(LTIEndian byteOrder);
+
+   /*@}*/
+
+   virtual LTIImageReader* duplicate();
+
+   virtual lt_int64 getPhysicalFileSize() const;
+
+protected:
+   LTIRawImageReader(const LTFileSpec& fileSpec, bool useWorldFile = true);
+   void setCtorPixelProps(const LTIPixel& pixelProps);
+   void setCtorDimensions(lt_uint32 width, lt_uint32 height);
+
+   virtual LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+   virtual LT_STATUS decodeBegin(const LTIScene& scene);
+   virtual LT_STATUS decodeEnd();
+
+   LTFileSpec* m_fileSpec;
+
+private:
+   LTIOStreamInf* m_stream;
+   bool m_ownsStream;
+   LTIPixel* m_pixel;
+   lt_uint32 m_width;
+   lt_uint32 m_height;
+   LTIGeoCoord* m_geoCoordArg;
+   lt_int64 m_fileSize;
+   bool m_withMetadata;
+   lt_uint32 m_rowBytes;
+   LTILayout m_layout;
+   lt_int64 m_leadingSkipBytes;
+   lt_int64 m_trailingSkipBytes;
+   LTIEndian m_byteOrder;
+
+   lt_uint8* m_rowBuffer;
+
+   const LTIPixel* m_backgroundPixel;
+   const LTIPixel* m_nodataPixel;
+   
+   // nope
+   LTIRawImageReader(LTIRawImageReader&);
+   LTIRawImageReader& operator=(const LTIRawImageReader&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTIRAWIMAGEREADER_H
diff --git a/src/DSDK/include/base/lti_rawImageWriter.h b/src/DSDK/include/base/lti_rawImageWriter.h
new file mode 100644
index 0000000..3d9dd90
--- /dev/null
+++ b/src/DSDK/include/base/lti_rawImageWriter.h
@@ -0,0 +1,104 @@
+/* $Id: lti_rawImageWriter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTIRAWIMAGEWRITER_H
+#define LTIRAWIMAGEWRITER_H
+
+// lt_lib_mrsid_core
+#include "lti_geoFileImageWriter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIReusableBSQBuffer;
+
+/**
+ * class for writing RAW files
+ *
+ * This class writes an image to a stream in RAW format.
+ *
+ * The RAW format used is simple packed BIP form.
+ */
+class LTIRawImageWriter : public LTIGeoFileImageWriter
+{
+public:
+   /**
+    * default constructor
+    *
+    * This constructor creates an LTIRawImageWriter which will write the
+    * pixels of the given image to the given stream.
+    *
+    * @param  image   the image to be read from  
+    */
+   LTIRawImageWriter(LTIImageStage* image);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIRawImageWriter();
+
+   /**
+    * initializer
+    */
+   virtual LT_STATUS initialize();
+
+   LTILayout getLayout() const { return m_layout; };
+
+   virtual LT_STATUS writeBegin(const LTIScene& scene);
+   virtual LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+
+   /**
+    * set layout
+    *
+    * This function is used to determine the layout of the output
+    * image, i.e. BIP or BIL or BSQ.
+    *
+    * @param layout the layout to use
+    */
+   void setLayout(LTILayout layout);
+
+   /**
+    * set byte order
+    *
+    * This function is used to determine byte ordering of the output file.
+    *
+    * @param byteOrder the byte ordering to use
+    */
+   void setByteOrder(LTIEndian byteOrder);
+
+protected:
+   LTILayout m_layout;
+   LTIEndian m_byteOrder;
+
+private:
+   lt_uint32 m_fullWidth;
+   lt_uint32 m_fullHeight;
+   lt_uint32 m_curRow;
+   LTIReusableBSQBuffer* m_stripBuffer;
+
+   // nope
+   LTIRawImageWriter(LTIRawImageWriter&);
+   LTIRawImageWriter& operator=(const LTIRawImageWriter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTIRAWIMAGEWRITER_H
diff --git a/src/DSDK/include/base/lti_sample.h b/src/DSDK/include/base/lti_sample.h
new file mode 100644
index 0000000..5690a20
--- /dev/null
+++ b/src/DSDK/include/base/lti_sample.h
@@ -0,0 +1,220 @@
+/* $Id: lti_sample.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_SAMPLE_H
+#define LTI_SAMPLE_H
+
+// lt_lib_mrsid_core
+#include "lti_types.h"
+
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(push,4)
+#endif
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+/**
+ * basic properties of a sample
+ *
+ * This class stores the basic properties of a sample: the color and the
+ * datatype.  A set of one or more (possibly dissimilar) LTISample objects is
+ * used in the representation of a pixel (LTIPixel).
+ */
+class LTISample
+{
+public:
+   /**
+    * default constructor
+    *
+    * This constructor creates an LTISample object with the given
+    * properties.
+    *
+    * @param  color       the sample's color
+    * @param  dataType    the datatype of the sample
+    * @param  data        initial data for sample value (defaults to 0)
+    */
+   LTISample(LTIColor color,
+             LTIDataType dataType,
+             const void* data=0);
+
+   LTISample();
+
+   /**
+    * copy constructor
+    */
+   LTISample(const LTISample&);
+
+   /**
+    * destructor
+    */
+   virtual ~LTISample();
+
+   /**
+    * assignment operator
+    */
+   virtual LTISample& operator=(const LTISample&);
+
+   /**
+    * equality operator
+    */
+   bool operator==(const LTISample&) const;
+
+   /**
+    * equality operator
+    */
+   bool operator!=(const LTISample&) const;
+
+   /**
+    * sets the precision of the sample
+    *
+    * Sets the precision of the sample.  By default, the number of bits of
+    * precision is equal to the number of bits in the underlying datatype.
+    *
+    * @note The data is assumed to be justified to the least significant bit
+    * of the word.
+    *
+    * @param  precision  the number of bits
+    */
+   void setPrecision(lt_uint32 precision);
+
+   /**
+    * returns the precision of the sample
+    *
+    * Returns the precision of the sample.
+    *
+    * @return  the number of bits used in the datatype
+    */
+   lt_uint32 getPrecision() const;
+
+   /**
+    * get the sample datatype
+    *
+    * This function returns the datatype of the sample.
+    *
+    * @return the datatype of the sample
+    */
+   LTIDataType getDataType() const;
+
+   /**
+    * get the color
+    *
+    * This function returns the color of the sample.
+    *
+    * @return the color of the sample
+    */
+   LTIColor getColor() const;
+
+   /**
+    * get the size of a sample
+    *
+    * This function returns the size of the sample, in bytes.
+    *
+    * This is equivalent to calling LTITypes::getNumBytes( getDataType() ).
+    *
+    * @return the number of bytes in the sample
+    */
+   lt_uint32 getNumBytes() const;
+
+   /**
+    * returns status code comparing two samples
+    *
+    * Returns status code comparing two samples.  This is just a different
+    * version of operator==, which returns a status code instead of a bool.
+    *
+    * @param   sample  the sample to compare this sample to
+    * @return  a specific code indicating if impedance matches
+    */
+   LT_STATUS checkImpedance(const LTISample& sample) const;
+
+
+   /**
+    * sets the sample value maximum
+    *
+    * Sets the sample's value to the datatype's maximum.
+    */
+   void setValueToMin();
+
+   /**
+    * sets the sample value minimum
+    *
+    * Sets the sample's value to the datatype's minimum.
+    */
+   void setValueToMax();
+
+   /**
+    * sets the sample value maximum
+    *
+    * Sets the sample's value to max of itself and the argument.
+    * (The argument sample assumed to have the same datatype.)
+    */
+   void setValueToMin(const LTISample&);
+
+   /**
+    * sets the sample value minimum
+    *
+    * Sets the sample's value to the min of itself and the argument
+    * (The argument sample assumed to have the same datatype.)
+    */
+   void setValueToMax(const LTISample&);
+
+   /**
+    * @name Sample value functions
+    *
+    * Sets the sample's value to the value given.  The sample is assumed to
+    * be known to have the given datatype.  (For the void* "addr" functions,
+    * the caller must assure datatype correctness underneath the void* pointer.)
+    */
+   /*@{*/
+   void setValueAddr(const void*);
+   const void* getValueAddr() const;
+   
+   void setValueUint8(lt_uint8);
+   void setValueUint16(lt_uint16);
+   void setValueUint32(lt_uint32);
+   void setValueUint64(lt_uint64);
+   void setValueSint8(lt_int8);
+   void setValueSint16(lt_int16);
+   void setValueSint32(lt_int32);
+   void setValueSint64(lt_int64);
+   void setValueFloat32(float);
+   void setValueFloat64(double);
+
+   lt_uint8 getValueUint8() const;
+   lt_uint16 getValueUint16() const;
+   lt_uint32 getValueUint32() const;
+   lt_uint64 getValueUint64() const;
+   lt_int8 getValueSint8() const;
+   lt_int16 getValueSint16() const;
+   lt_int32 getValueSint32() const;
+   lt_int64 getValueSint64() const;
+   float getValueFloat32() const;
+   double getValueFloat64() const;
+
+   /*@}*/
+
+private:
+   lt_uint8 *m_value;
+   lt_uint32 m_numBytes;
+   lt_uint32 m_precision;
+   LTIDataType m_dataType;
+   LTIColor m_color;
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_SAMPLE_H
diff --git a/src/DSDK/include/base/lti_scene.h b/src/DSDK/include/base/lti_scene.h
new file mode 100644
index 0000000..30283dc
--- /dev/null
+++ b/src/DSDK/include/base/lti_scene.h
@@ -0,0 +1,488 @@
+/* $Id: lti_scene.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_SCENE_H
+#define LTI_SCENE_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(push,4)
+#endif
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+
+/**
+ * representation of a scene
+ *
+ * This class represents a scene within an image.  A scene contains these
+ * values:
+ * \li an upper-left (x,y) position
+ * \li a width and a height
+ * \li a magnification
+ *
+ * The (X,Y) point is expressed in pixel-space (mag=1.0) coordinates, relative
+ * to the given magnification.  The width and height are absolutes, i.e. they
+ * correspond to the buffer size the user expects.
+ *
+ * The scene position and dimensions are maintained as high-precision values.
+ * Accessors are supplied to get the high-precision values as well as the
+ * properly rounded integral values (expressed in row/col form).
+ *
+ * A mag value of 1.0 indicates full-size resolution.  A mag greater than 1.0
+ * indicates res-up (zoom in) by a factor of two: 2.0 gives an image 2x bigger,
+ * 4.0 gives an image 4x bigger, etc.  A mag value less than 1.0 indicates
+ * a lower resolution: 0.5 gives a half-sized image, 0.25 gives a quarter-sized
+ * image, etc.
+ *
+ * An LTIImageReader may not support the requested magnification: most readers
+ * only support mag=1.0, and MrSID readers only support power-of-two magnifications (0.25,
+ * 0.5, 1.0, 2.0, 4.0, etc).  If the mag request cannot be returned the extraction
+ * will return an error.
+ *
+ * An LTIScene is used to express the region of an image to be decoded via a
+ * call to LTIImageReader::decodeBegin(), etc.
+ *
+ * As an example, consider an image which is 512x512 pixels.  Then, the
+ * following scenes from the image will all contain the same upper-left point
+ * and all will be 100x100 pixels.  The "granularity" (resolution) of each
+ * pixel, however, will differ.
+ * \li <tt>const LTIScene scene(256, 256, 100, 100, 1.0);     // center point</tt>
+ * \li <tt>const LTIScene scene(512, 512, 100, 100, 2.0);</tt>
+ * \li <tt>const LTIScene scene(128, 128, 100, 100, 0.5);</tt>
+ *
+ * @note Scenes may not require a buffer larger than 2GB.
+ */
+class LTIScene
+{
+public:
+   /**
+    * constructor
+    *
+    * This constructor produces a scene set to the given parameters, using double-precision.
+    *
+    * @param ulX            upper left X position of scene 
+    * @param ulY            upper left Y position of scene 
+    * @param width          width of scene 
+    * @param height         height of scene 
+    * @param magnification  resolution of scene 
+    */
+   LTIScene(double ulX, double ulY,
+            double width, double height,
+            double magnification);
+
+   /**
+    * copy constructor
+    */
+   LTIScene(const LTIScene& copy);
+
+   /**
+    * default constructor
+    *
+    * This constructor will produce a scene with "invalid" default
+    * coordinates.
+    */
+   LTIScene(void);
+
+   /**
+    * assignment operator
+    */
+   LTIScene& operator=(const LTIScene&);
+
+   /**
+    * equality operator
+    */
+   bool operator==(const LTIScene&) const;
+
+   /**
+    * equality operator
+    */
+   bool operator!=(const LTIScene&) const;
+
+
+   /**
+    * returns the magnification of the scene
+    *
+    * Returns the magnification of the scene.
+    *
+    * @return the magnification
+    */
+   double getMag() const;
+
+
+   /**
+    * @name High-precision point functions
+    */
+   /*@{*/
+
+   /**
+    * returns the x-position of the upper-left point
+    *
+    * Returns the x-position of the upper-left point.  This is a high-precision value.
+    *
+    * @return the x-position of the point
+    */
+   double getUpperLeftX() const;
+
+   /**
+    * returns the y-position of the upper-left point
+    *
+    * Returns the y-position of the upper-left point.  This is a high-precision value.
+    *
+    * @return the y-position of the point
+    */
+   double getUpperLeftY() const;
+
+   /**
+    * returns the x-position of the lower-right point
+    *
+    * Returns the x-position of the lower-right point.  This is a high-precision value.
+    *
+    * @return the x-position of the point
+    */
+   double getLowerRightX() const;
+
+   /**
+    * returns the y-position of the lower-right point
+    *
+    * Returns the y-position of the lower-right point.  This is a high-precision value.
+    *
+    * @return the y-position of the point
+    */
+   double getLowerRightY() const;
+
+   /**
+    * returns the x-position of the upper-right point
+    *
+    * Returns the x-position of the upper-right point.  This is a high-precision value.
+    *
+    * @return the x-position of the point
+    */
+   double getUpperRightX() const;
+
+   /**
+    * returns the y-position of the upper-left point
+    *
+    * Returns the y-position of the upper-left point.  This is a high-precision value.
+    *
+    * @return the y-position of the point
+    */
+   double getUpperRightY() const;
+
+   /**
+    * returns the x-position of the lower-left point
+    *
+    * Returns the x-position of the lower-left point.  This is a high-precision value.
+    *
+    * @return the x-position of the point
+    */
+   double getLowerLeftX() const;
+
+   /**
+    * returns the y-position of the lower-left point
+    *
+    * Returns the y-position of the lower-left point.  This is a high-precision value.
+    *
+    * @return the y-position of the point
+    */
+   double getLowerLeftY() const;
+
+   /**
+    * returns the x-position of the center point
+    *
+    * Returns the x-position of the center point.  This is a high-precision value.
+    *
+    * @return the x-position of the point
+    */
+   double getCenterX() const;
+
+   /**
+    * returns the x-position of the center point
+    *
+    * Returns the x-position of the center point.  This is a high-precision value.
+    *
+    * @return the x-position of the point
+    */
+   double getCenterY() const;
+
+   /*@}*/
+
+
+   /**
+    * @name Low-precision point functions
+    *
+    * These functions return properly rounded integral values, to be used
+    * only when discretizing the pixels (for example to map to a buffer in
+    * memory).
+    */
+   /*@{*/
+
+   /**
+    * returns the x-position of the upper-left point
+    *
+    * Returns the x-position of the upper-left point.  This is a low-precision value.
+    *
+    * @return the x-position of the point
+    */
+   lt_int32 getUpperLeftCol() const;
+
+   /**
+    * returns the y-position of the upper-left point
+    *
+    * Returns the y-position of the upper-left point.  This is a low-precision value.
+    *
+    * @return the y-position of the point
+    */
+   lt_int32 getUpperLeftRow() const;
+
+   /**
+    * returns the x-position of the lower-right point
+    *
+    * Returns the x-position of the lower-right point.  This is a low-precision value.
+    *
+    * @return the x-position of the point
+    */
+   lt_int32 getLowerRightCol() const;
+
+   /**
+    * returns the y-position of the lower-right point
+    *
+    * Returns the y-position of the lower-right point.  This is a low-precision value.
+    *
+    * @return the y-position of the point
+    */
+   lt_int32 getLowerRightRow() const;
+
+   /**
+    * returns the x-position of the upper-right point
+    *
+    * Returns the x-position of the upper-right point.  This is a low-precision value.
+    *
+    * @return the x-position of the point
+    */
+   lt_int32 getUpperRightCol() const;
+
+   /**
+    * returns the y-position of the upper-right point
+    *
+    * Returns the y-position of the upper-right point.  This is a low-precision value.
+    *
+    * @return the y-position of the point
+    */
+   lt_int32 getUpperRightRow() const;
+
+   /**
+    * returns the x-position of the lower-left point
+    *
+    * Returns the x-position of the lower-left point.  This is a low-precision value.
+    *
+    * @return the x-position of the point
+    */
+   lt_int32 getLowerLeftCol() const;
+
+   /**
+    * returns the y-position of the lower-left point
+    *
+    * Returns the y-position of the lower-left point.  This is a low-precision value.
+    *
+    * @return the y-position of the point
+    */
+   lt_int32 getLowerLeftRow() const;
+
+   /**
+    * returns the x-position of the center point
+    *
+    * Returns the x-position of the center point.  This is a low-precision value.
+    *
+    * @return the x-position of the point
+    */
+   lt_int32 getCenterCol() const;
+
+   /**
+    * returns the y-position of the center point
+    *
+    * Returns the y-position of the center point.  This is a low-precision value.
+    *
+    * @return the y-position of the point
+    */
+   lt_int32 getCenterRow() const;
+
+   /*@}*/
+
+
+   /**
+    * @name Dimension functions
+    *
+    */
+   /*@{*/
+
+   /**
+    * returns the width of the scene
+    *
+    * Returns the width of the scene.  This is a high-precision value.
+    *
+    * @return the width
+    */
+   double getWidth() const;
+
+   /**
+    * returns the height of the scene
+    *
+    * Returns the height of the scene.  This is a high-precision value.
+    *
+    * @return the height
+    */
+   double getHeight() const;
+
+   /**
+    * returns the width of the scene
+    *
+    * Returns the width of the scene.  This is a low-precision value.
+    *
+    * @return the width
+    */
+   lt_int32 getNumCols() const;
+
+   /**
+    * returns the height of the scene
+    *
+    * Returns the height of the scene.  This is a low-precision value.
+    *
+    * @return the height
+    */
+   lt_int32 getNumRows() const;
+
+   /*@}*/
+
+
+   /**
+    * @name Helper functions
+    *
+    */
+   /*@{*/
+
+   /**
+    * returns the x-position of the upper-left point
+    *
+    * Returns the x-position of the upper-left point, as a high-precision
+    * value.  This returns the same value as calling getUpperLeftX().
+    *
+    * @return the x-position of the point
+    */
+   double getX() const;
+
+   /**
+    * returns the y-position of the upper-left point
+    *
+    * Returns the y-position of the upper-left point, as a high-precision
+    * value.  This returns the same value as calling getUpperLeftY().
+    *
+    * @return the y-position of the point
+    */
+   double getY() const;
+
+   /**
+    * returns the (x,y) positions of the upper-left and lower-right points
+    *
+    * Returns the (x,y) positions of the upper-left and lower-right points,
+    * as high-precision values.
+    *
+    * @param  ulX  the upper-left x-position 
+    * @param  ulY  the upper-left y-position 
+    * @param  lrX  the lower-right x-position 
+    * @param  lrY  the lower-right y-position 
+    */
+   void getPoints(double& ulX, double& ulY, 
+                  double& lrX, double& lrY) const;
+
+   /**
+    * returns the (x,y) positions of the center and corner points
+    *
+    * Returns the (x,y) positions of the center and corner points,
+    * as high-precision values.
+    *
+    * @param  ulX  the upper-left x-position 
+    * @param  ulY  the upper-left y-position 
+    * @param  urX  the upper-right x-position 
+    * @param  urY  the upper-right y-position 
+    * @param  llX  the lower-left x-position 
+    * @param  llY  the lower-left y-position 
+    * @param  lrX  the lower-right x-position 
+    * @param  lrY  the lower-right y-position 
+    * @param  cX   the center x-position 
+    * @param  cY   the center y-position 
+    */
+   void getPoints(double& ulX, double& ulY,
+                  double& urX, double& urY,
+                  double& llX, double& llY,
+                  double& lrX, double& lrY,
+                  double& cX, double& cY) const;
+
+   /**
+    * returns the (x,y) positions of the upper-left and lower-right points
+    *
+    * Returns the (x,y) positions of the upper-left and lower-right points,
+    * as low-precision values.
+    *
+    * @param  ulX  the upper-left x-position 
+    * @param  ulY  the upper-left y-position 
+    * @param  lrX  the lower-right x-position 
+    * @param  lrY  the lower-right y-position 
+    */
+   void getPoints(lt_int32& ulX, lt_int32& ulY, 
+                  lt_int32& lrX, lt_int32& lrY) const;
+
+   /**
+    * returns the (x,y) positions of the center and corner points
+    *
+    * Returns the (x,y) positions of the center and corner points,
+    * as low-precision values.
+    *
+    * @param  ulX  the upper-left x-position 
+    * @param  ulY  the upper-left y-position 
+    * @param  urX  the upper-right x-position 
+    * @param  urY  the upper-right y-position 
+    * @param  llX  the lower-left x-position 
+    * @param  llY  the lower-left y-position 
+    * @param  lrX  the lower-right x-position 
+    * @param  lrY  the lower-right y-position 
+    * @param  cX   the center x-position 
+    * @param  cY   the center y-position 
+    */
+   void getPoints(lt_int32& ulX, lt_int32& ulY,
+                  lt_int32& urX, lt_int32& urY,
+                  lt_int32& llX, lt_int32& llY,
+                  lt_int32& lrX, lt_int32& lrY,
+                  lt_int32& cX, lt_int32& cY) const;
+   /*@}*/
+
+protected:
+   double m_ulX, m_ulY;
+   double m_width, m_height;
+   double m_magnification;
+
+private:
+   lt_int32 getHalfWidth_i() const;
+   lt_int32 getHalfHeight_i() const;
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_SCENE_H
diff --git a/src/DSDK/include/base/lti_sceneBuffer.h b/src/DSDK/include/base/lti_sceneBuffer.h
new file mode 100644
index 0000000..beb63fe
--- /dev/null
+++ b/src/DSDK/include/base/lti_sceneBuffer.h
@@ -0,0 +1,642 @@
+/* $Id: lti_sceneBuffer.h 5152 2006-10-31 17:24:29Z juan $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_SCENEBUFFER_H
+#define LTI_SCENEBUFFER_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(push,4)
+#endif
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTIPixel;
+class LTIOStreamInf;
+
+/**
+ * class to hold data passed between image stages
+ *
+ * This class holds a buffer of data which is used as the target of decode
+ * operations in LTIImageStage.
+ *
+ * The data within the buffer is always represented as an array of bytes in
+ * BSQ (band-sequential) format.  Each band is stored separately, so that the
+ * underlying data is an array of N pointers, each array element being a
+ * buffer for one band of the image.
+ *
+ * The dimensions of the buffer are set in the constructor.  The \b total
+ * number of rows and columns represents the actual extent of the data array
+ * in memory.  However, it is often desirable to only expose a subset of the
+ * full rectangle, e.g. to access a large buffer in a stripwise fashion or to
+ * overlay a small image into a large buffer.  This \b window may also be set
+ * via the constructor, by providing a second set of row/column dimensions
+ * and giving an offset for the upper-left position of the window.
+ *
+ * If the data pointer passed to the constructor is NULL, the class will
+ * internally allocate the required memory (and retain ownership of it).
+ *
+ * Functions are provided to access that data within the buffer in a variety
+ * of ways, relative to both the total buffer and the exposed window within
+ * it.  You may also construct a buffer which is relative to another buffer.
+ *
+ * For convenience, a number of functions are also provided which allow the
+ * user to copy data to and from an LTISceneBuffer object, using a variety of
+ * formats.  For example, there are functions to import and export the data
+ * in the buffer to BIP (band-interleaved) format.
+ *
+ * @note The pixel properties of the LTISceneBuffer must exactly match the
+ * pixel properties of the image being decoded.
+ */
+class LTISceneBuffer
+{
+public:
+   /**
+    * @name Constructors and destructor
+    */
+   /*@{*/
+
+   /**
+    * constructor with default window
+    *
+    * Constructs an LTISceneBuffer with the window set to the total region of
+    * the buffer.
+    *
+    * The \c data parameter may be NULL, in which case the memory will be
+    * allocated internally.
+    *
+    * @param  pixelProps    pixel type to be used in the buffer
+    * @param  totalNumCols  width of the buffer 
+    * @param  totalNumRows  height of the buffer 
+    * @param  data          pointer to the data array (may be NULL) 
+    */
+   LTISceneBuffer(const LTIPixel& pixelProps,
+                  lt_uint32 totalNumCols,
+                  lt_uint32 totalNumRows,
+                  void** data);
+
+   /**
+    * constructor with explicit window
+    *
+    * Constructs an LTISceneBuffer with the window set to the given size and
+    * positioned at the given offset.  The offset is given relative to the
+    * total region, and the window must lie entirely within the region.
+    *
+    * The \c data parameter may be NULL, in which case the memory will be
+    * allocated internally.
+    *
+    * @param  pixelProps     pixel type to be used in the buffer 
+    * @param  totalNumCols   width of the buffer 
+    * @param  totalNumRows   height of the buffer 
+    * @param  colOffset      x-position of the window 
+    * @param  rowOffset      y-position of the window 
+    * @param  windowNumCols  width of the window 
+    * @param  windowNumRows  height of the window 
+    * @param  data           pointer to the data array (may be NULL) 
+    */
+   LTISceneBuffer(const LTIPixel& pixelProps,
+                  lt_uint32 totalNumCols,
+                  lt_uint32 totalNumRows,
+                  lt_uint32 colOffset,
+                  lt_uint32 rowOffset,
+                  lt_uint32 windowNumCols,
+                  lt_uint32 windowNumRows,
+                  void** data);
+
+   /**
+    * constructor to overlay existing LTISceneBuffer
+    *
+    * Constructs an LTISceneBuffer which is a window into the given existing
+    * LTISceneBuffer object.  The window of the new buffer is set to cover the
+    * full window of the original buffer, starting at the given offset
+    * (which is relative to the window of the original buffer).
+    *
+    * @param  original   the existing buffer, to be overlaid 
+    * @param  colOffset  x-position of the new window 
+    * @param  rowOffset  y-position of the new window 
+    */
+   LTISceneBuffer(const LTISceneBuffer& original,
+                  lt_uint32 colOffset,
+                  lt_uint32 rowOffset);
+
+   /**
+    * constructor to overlay existing LTISceneBuffer
+    *
+    * Constructs an LTISceneBuffer which is a window into the given existing
+    * LTISceneBuffer object.  The window of the new buffer is set to start at
+    * the given offset (which is relative to the window of the original
+    * buffer).  The dimensions of the new window are passed in, and the new
+    * window must not extend beyond the dimensions of the original buffer.
+    *
+    * @param  original   the existing buffer, to be overlaid 
+    * @param  colOffset  x-position of the new window 
+    * @param  rowOffset  y-position of the new window 
+    * @param  windowNumCols  width of the window 
+    * @param  windowNumRows  height of the window 
+    */
+   // exposes only a window of a different bsq buffer; window may not
+   // extend outside of parent window; offset is relative to parent
+   // window
+   LTISceneBuffer(const LTISceneBuffer& original,
+                  lt_uint32 colOffset,
+                  lt_uint32 rowOffset,
+                  lt_uint32 windowNumCols,
+                  lt_uint32 windowNumRows);
+
+   /** destructor */
+   ~LTISceneBuffer();
+
+   /*@}*/
+
+
+   /**
+    * @name Buffer property accessors
+    */
+   /*@{*/
+   
+   /**
+   * get width of (entire) buffer
+   *
+   * Returns the total width of the buffer.
+   *
+   * @return the total width, in pixels
+   */
+   lt_int32 getTotalNumCols() const;
+
+   /**
+   * get height of (entire) buffer
+   *
+   * Returns the total height of the buffer.
+   *
+   * @return the total height, in pixels
+   */
+   lt_int32 getTotalNumRows() const;
+
+   /**
+   * get x-position of window
+   *
+   * Returns the x-position of the exposed window of the buffer.
+   *
+   * @return the x-position, relative to the whole buffer
+   */
+   lt_int32 getWindowColOffset() const;
+
+   /**
+   * get y-position of window
+   *
+   * Returns the y-position of the exposed window of the buffer.
+   *
+   * @return the y-position, relative to the whole buffer
+   */
+   lt_int32 getWindowRowOffset() const;
+
+   /**
+   * get width of exposed window
+   *
+   * Returns the width of the exposed window of the buffer.
+   *
+   * @return the window width, in pixels
+   */
+   lt_int32 getWindowNumCols() const;
+
+   /**
+   * get height of exposed window
+   *
+   * Returns the height of the exposed window of the buffer.
+   *
+   * @return the window height, in pixels
+   */
+   lt_int32 getWindowNumRows() const;
+
+   /**
+   * get size of (total) buffer
+   *
+   * Returns the total size of the buffer, in pixels.
+   *
+   * This is equal to getTotalNumCols() * getTotalNumRows().
+   *
+   * @return size of buffer
+   */
+   lt_int32 getTotalNumPixels() const;
+
+   /**
+   * get size of exposed window
+   *
+   * Returns the total size of the window of the buffer, in pixels.
+   *
+   * This is equal to getWindowNumCols() * getWindowNumRows().
+   *
+   * @return size of window in buffer
+   */
+   lt_int32 getWindowNumPixels() const;
+
+   /**
+   * get pixel type of buffer
+   *
+   * Returns the pixel type of the buffer.
+   *
+   * @return the pixel type
+   */
+   const LTIPixel& getPixelProps() const;
+
+   /**
+   * get number of bands
+   *
+   * Returns the number of bands of the pixel of the imager.
+   *
+   * This is the same as calling getPixelProps().getNumBands().
+   *
+   * @return the number of bands
+   */
+   lt_uint16 getNumBands() const;
+
+   /*@}*/
+
+   
+   /**
+    * @name Data buffer accessors
+    */
+   /*@{*/
+
+   /**
+    * get pointer to total buffer (for all bands)
+    *
+    * This function returns a pointer to the array of data buffers, one per
+    * band.  This returns the "base" pointer for the total region, regardless
+    * of the window setting.
+    *
+    * @return  a pointer to the array of data buffers
+    */
+   void** getTotalBSQData() const;
+
+   /**
+    * get pointer to total buffer (for 1 band)
+    *
+    * This function returns a pointer to the data buffer for the given band.
+    * This returns the "base" pointer for the total region, regardless of the
+    * window setting.
+    *
+    * @param   band  the band to access 
+    * @return  a pointer to the data buffer
+    */
+   void* getTotalBandData(lt_uint16 band) const;
+
+   /**
+    * get pointer to window data (for all bands)
+    *
+    * This function returns a pointer to the array of data buffers, one per
+    * band.  The buffer pointers are set to the start of the window within
+    * the total buffer.
+    *
+    * @return  a pointer to the array of data buffers
+    */
+   void** getWindowBSQData() const;
+
+   /**
+    * get pointer to window data (for 1 band)
+    *
+    * This function returns a pointer to the data buffer for the given band.
+    * The buffer pointer is set to the start of the window within
+    * the total buffer.
+    *
+    * @param   band  the band to access 
+    * @return  a pointer to the array of data buffers
+    */
+   void* getWindowBandData(lt_uint16 band) const;
+
+   /**
+    * get pointer to sample (total buffer)
+    *
+    * This function returns a pointer to the data for the given band of the
+    * specified pixel.  The offset is relative to the total buffer.
+    *
+    * @param   x     the x-position of the pixel 
+    * @param   y     the y-position of the pixel 
+    * @param   band  the band to access 
+    * @return  a pointer to the sample
+    */
+   void* getTotalSample(lt_uint32 x, lt_uint32 y, lt_uint16 band) const;
+
+   /**
+    * get pointer to sample (windowed)
+    *
+    * This function returns a pointer to the data for the given band of the
+    * specified pixel.  The offset is relative to the window into the buffer.
+    *
+    * @param   x     the x-position of the pixel 
+    * @param   y     the y-position of the pixel 
+    * @param   band  the band to access 
+    * @return  a pointer to the sample
+    */
+   void* getWindowSample(lt_uint32 x, lt_uint32 y, lt_uint16 band) const;
+   /*@}*/
+
+
+   /**
+    * query pixel position
+    *
+    * This function returns true if and only if the given position lies
+    * within the exposed window of the buffer.  (The position is relative
+    * to the total buffer.)
+    *
+    * @param   x     the x-position of the pixel 
+    * @param   y     the y-position of the pixel 
+    */
+   //bool LTISceneBuffer::inWindow(lt_uint32 x, lt_uint32 y) const;
+   bool inWindow(lt_uint32 x, lt_uint32 y) const;
+
+   /**
+    * @name Import functions
+    *
+    * These functions provide an easy way to copy data from a variety of
+    * layouts into an LTISceneBuffer object, in an efficient manner.
+    *
+    * The copying is performed relative to the exposed window of the buffer.
+    */
+   /*@{*/
+
+   /**
+    * import from another LTISceneBuffer, respecting NoData
+    *
+    * This function copies data from one source LTISceneBuffer object into
+    * another destination LTISceneBuffer object.  If the \c nodata parameter
+    * is set, any pixel in the source that matches the nodata pixel will not
+    * be copied to the corresponding destination pixel position.
+    *
+    * @param   sourceData   the data to be imported 
+    * @param   nodataPixel  source pixel will not be copied if matches; may be NULL 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS importData(const LTISceneBuffer& sourceData,
+                        const LTIPixel* nodataPixel);
+
+   /**
+    * import one band from another LTISceneBuffer
+    *
+    * This function copies just one band of data from one source LTISceneBuffer object into
+    * another destination LTISceneBuffer object.
+    *
+    * @param   dstBandNum   the band number of this buffer to be written to
+    * @param   sourceData   the data to be imported 
+    * @param   srcBandNum   the band number of \a sourceData to be read from
+    * @return  status code indicating success or failure
+    */
+   // just import one band -- doesn't respect nodata, doesn't do fuzzy mode
+   LT_STATUS importDataBand(lt_uint16 dstBandNum,
+                            const LTISceneBuffer& sourceData,
+                            lt_uint16 srcBandNum);
+
+   /**
+    * import from another LTISceneBuffer, respecting approximate NoData
+    *
+    * This function copies data from one source LTISceneBuffer object into
+    * another destination LTISceneBuffer object.  If the \c nodata parameter
+    * is set, any pixel in the source that matches the nodata pixel will not
+    * be copied to the corresponding destination pixel position.
+    *
+    * @param   sourceData   the data to be imported 
+    * @param   nodataPixel  source pixel will not be copied if matches; may be NULL 
+    * @param   mag          scene magnification 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS importDataFuzzyNoData(const LTISceneBuffer& sourceData,
+                                   const LTIPixel *nodataPixel,
+                                   double mag);
+
+
+   /**
+    * import from memory (BSQ)
+    *
+    * This function copies data from a buffer in memory.  The source pointer
+    * is assumed to be organized as an array of pointers to BSQ buffers, one
+    * per band.
+    *
+    * @param   data  the source data
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS importDataBSQ(void** data);
+
+   /**
+    * import from memory (BSQ)
+    *
+    * This function copies data from a buffer in memory.  The source pointer
+    * is assumed to be organized as one large buffer in BSQ format.
+    *
+    * @param   data  the source data
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS importDataBSQ(void* data);
+
+   /**
+    * import from memory (BIP)
+    *
+    * This function copies data from a buffer in memory.  The source pointer
+    * is assumed to be organized as one large buffer in BIP format.
+    *
+    * @param   data  the source data
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS importDataBIP(void* data);
+
+   /**
+    * import from stream (BSQ)
+    *
+    * This function copies data from a buffer contained in the given stream.
+    * The data is assumed to be organized as one large buffer in BSQ format.
+    *
+    * @param   stream  the source data
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS importDataBSQ(LTIOStreamInf& stream);
+
+   /**
+    * import from stream (BIP)
+    *
+    * This function copies data from a buffer contained in the given stream.
+    * The data is assumed to be organized as one large buffer in BIP format.
+    *
+    * @param   stream  the source data
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS importDataBIP(LTIOStreamInf& stream);
+   /*@}*/
+
+
+   /**
+    * @name Export functions
+    *
+    * These functions provide an easy way to copy data from an LTISceneBuffer
+    * object to a variety of layouts, in an efficient manner.
+    *
+    * The copying is performed relative to the exposed window of the buffer.
+    */
+   /*@{*/
+
+   /**
+    * export to memory (BSQ)
+    *
+    * This function copies data to a buffer in memory.  The destination
+    * pointer is assumed to be organized as an array of pointers to BSQ
+    * buffers, one per band.
+    *
+    * If the \c data parameter is NULL, the function will allocate it (but not
+    * retain ownership).  In this case it is the caller's responsibility to
+    * deallocate each band using the delete[] operator.
+    *
+    * @param   data  the destination data (may be NULL) [in/out]
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS exportDataBSQ(void**& data) const;
+
+   /**
+    * export to memory (BSQ)
+    *
+    * This function copies data to a buffer in memory.  The destination
+    * pointer is assumed to be organized as one large buffer in BSQ
+    * format.
+    *
+    * If the \c data parameter is NULL, the function will allocate it (but not
+    * retain ownership).  In this case it is the caller's responsibility to
+    * deallocate the buffer using the delete[] operator.
+    *
+    * @param   data  the destination data (may be NULL) [in/out]
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS exportDataBSQ(void*& data) const;
+
+   /**
+    * export to memory (BIP)
+    *
+    * This function copies data to a buffer in memory.  The destination
+    * pointer is assumed to be organized as one large buffer in BIP
+    * format.
+    *
+    * If the \c data parameter is NULL, the function will allocate it (but not
+    * retain ownership).  In this case it is the caller's responsibility to
+    * deallocate the buffer using the delete[] operator.
+    *
+    * @param   data  the destination data (may be NULL) [in/out]
+    * @return  status code indicating success or failure
+    */
+
+   LT_STATUS exportDataBIP(void*& data) const;
+
+   /**
+    * export to stream (BSQ)
+    *
+    * This function copies data to a stream.  The destination is organized as
+    * one large buffer in BSQ format.
+    *
+    * @param   stream  the destination stream 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS exportDataBSQ(LTIOStreamInf& stream) const;
+
+   /**
+    * export to stream (BIP)
+    *
+    * This function copies data to a stream.  The destination is organized as
+    * one large buffer in BIP format.
+    *
+    * @param   stream  the destination stream 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS exportDataBIP(LTIOStreamInf& stream) const;
+
+   /**
+    * export to (arbitrary) memory
+    *
+    * This function copies data to a buffer.  The layout of the destination
+    * is determined by the input parameters.
+    *
+    * For example, assuming RGB/uint8 data and WxH pixels:
+    *
+    * \li BIP format: pixelBytes=3, rowBytes=W*3, bandBytes=1
+    * \li BIL: pixelBytes=1, rowBytes=W*3, bandBytes=W*1
+    * \li BSQ: pixelBytes=1, rowBytes=W*1, bandBytes=W*H*1
+    *
+    * @param   data        the destination buffer (may not be NULL) 
+    * @param   pixelBytes  width of pixel, in bytes (e.g. distance from "red" to "red")
+    * @param   rowBytes    width of buffer, in bytes
+    * @param   bandBytes   distance from sample to the next, in bytes (e.g. distance from "red" to "blue")
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS exportData(void* data,
+                        lt_uint32 pixelBytes,
+                        lt_uint32 rowBytes,
+                        lt_uint32 bandBytes) const;
+   /*@}*/
+
+   void byteSwap();
+
+   /**
+    * compute alignment constraint
+    *
+    * This utility function returns a value which is equal to or greater than
+    * the given value, when aligned to the given constraint.  This is useful
+    * for determining proper row widths for certain applications.
+    *
+    * For example, given the value 99 and an alignment of 4, the function
+    * will return 100.  Given a value of 128 and an alignment of 8, the
+    * function will return 128.
+    *
+    * @param   value          the nominal buffer width
+    * @param   byteAlignment  the alignment required
+    * @return  the aligned width
+    */
+   static lt_uint32 addAlignment(lt_uint32 value, lt_uint32 byteAlignment);
+
+private:
+   void init(const LTIPixel& pixelProps,
+             lt_uint32 totalWidth,
+             lt_uint32 totalHeight,
+             lt_uint32 xOffset,
+             lt_uint32 yOffset,
+             lt_uint32 windowWidth,
+             lt_uint32 windowHeight,
+             void** data);
+
+   void** m_data;
+   void** m_windowData;
+   bool m_ownsData;
+
+   mutable void** m_tmpBands; // only used by import/export functions
+   
+   lt_int32* m_sampleSizes; // size of each sample, in bytes
+
+   LTIPixel* m_pixelProps;
+   lt_uint16 m_numBands;
+
+   lt_uint32 m_totalNumCols;
+   lt_uint32 m_totalNumRows;
+   lt_uint32 m_windowColOffset;
+   lt_uint32 m_windowRowOffset;
+   lt_uint32 m_windowNumCols;
+   lt_uint32 m_windowNumRows;
+
+   // nope
+   LTISceneBuffer(const LTISceneBuffer&);
+   LTISceneBuffer& operator=(const LTISceneBuffer&);
+   bool operator==(const LTISceneBuffer&) const;
+   bool operator!=(const LTISceneBuffer&) const;
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_SCENEBUFFER_H
diff --git a/src/DSDK/include/base/lti_types.h b/src/DSDK/include/base/lti_types.h
new file mode 100644
index 0000000..9176c6a
--- /dev/null
+++ b/src/DSDK/include/base/lti_types.h
@@ -0,0 +1,194 @@
+/* $Id: lti_types.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC - C*/
+
+#ifndef LTI_TYPES_H
+#define LTI_TYPES_H
+
+#include "lt_base.h"
+
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+#ifdef LT_CPLUSPLUS
+extern "C" {
+#endif
+
+/**
+ * @file
+ *
+ * This file contains a number of enums, typedefs, etc, that are used
+ * throughout the MrSID SDK.
+ */
+
+
+/**
+ * colorspaces
+ *
+ * This enum is used to represent colorspaces.
+ */
+typedef enum LTIColorSpace
+{
+  LTI_COLORSPACE_INVALID        = 0,
+  LTI_COLORSPACE_RGB            = 1,
+  LTI_COLORSPACE_RGBK           = 2,
+  LTI_COLORSPACE_CMYK           = 3,
+  LTI_COLORSPACE_GRAYSCALE      = 4,
+  LTI_COLORSPACE_PALETTE        = 5,
+  LTI_COLORSPACE_YIQ            = 6,
+  LTI_COLORSPACE_YIQK           = 7,
+  LTI_COLORSPACE_MULTISPECTRAL  = 8
+} LTIColorSpace;
+
+
+/**
+ * colors
+ *
+ * This enum is used to represent colors.
+ */
+typedef enum LTIColor
+{
+  LTI_COLOR_INVALID   = 0,
+  LTI_COLOR_RED       = 1,
+  LTI_COLOR_GREEN     = 2,
+  LTI_COLOR_BLUE      = 3,
+  LTI_COLOR_CYAN      = 4,
+  LTI_COLOR_MAGENTA   = 5,
+  LTI_COLOR_YELLOW    = 6,
+  LTI_COLOR_BLACK     = 7,
+  LTI_COLOR_GRAY      = 8,
+  LTI_COLOR_UNKNOWN   = 9
+} LTIColor;
+
+
+/**
+ * datatypes
+ *
+ * This enum is used to represent datatypes.
+ */
+typedef enum LTIDataType
+{
+  LTI_DATATYPE_INVALID  = 0,
+  LTI_DATATYPE_UINT8    = 1,
+  LTI_DATATYPE_SINT8    = 2,
+  LTI_DATATYPE_UINT16   = 3,
+  LTI_DATATYPE_SINT16   = 4,
+  LTI_DATATYPE_UINT32   = 5,
+  LTI_DATATYPE_SINT32   = 6,
+  LTI_DATATYPE_FLOAT32  = 7,
+  LTI_DATATYPE_FLOAT64  = 8,
+  LTI_DATATYPE_UINT64   = 9,
+  LTI_DATATYPE_SINT64   = 10,
+  LTI_DATATYPE_COMPLEX32 = 11,   // (float32 Real, float32 Imaginary)
+  LTI_DATATYPE_COMPLEX64 = 12    // (float64 Real, float64 Imaginary)
+} LTIDataType;
+
+
+
+/**
+ * well-known points
+ *
+ * This enum is used to represent the well-known points on a rectangle.
+ *
+ * @note The constant name can be mentally read as "LTI_POSITION_y_x".
+ */
+typedef enum LTIPosition
+{
+   LTI_POSITION_UPPER_LEFT     = 1,
+   LTI_POSITION_UPPER_CENTER   = 2,
+   LTI_POSITION_UPPER_RIGHT    = 3,
+   LTI_POSITION_LOWER_LEFT     = 4,
+   LTI_POSITION_LOWER_CENTER   = 5,
+   LTI_POSITION_LOWER_RIGHT    = 6,
+   LTI_POSITION_CENTER_LEFT    = 7,
+   LTI_POSITION_CENTER         = 8,
+   LTI_POSITION_CENTER_RIGHT   = 9
+} LTIPosition;
+
+
+/**
+ * constants representing data layout
+ *
+ * These are used by classes like
+ * LTIRawImageReader and LTIRawImageWriter.
+ */
+typedef enum LTILayout
+{
+   LTI_LAYOUT_INVALID  = 0,
+   LTI_LAYOUT_BIP      = 1,   /**< band interleaved by pixel */
+   LTI_LAYOUT_BSQ      = 2,   /**< band sequential */
+   LTI_LAYOUT_BIL      = 3    /**< band interleaved by line */
+} LTILayout;
+
+
+/**
+ * constants representing endianness (byte order)
+ */
+typedef enum LTIEndian
+{
+   LTI_ENDIAN_INVALID = 0,
+   LTI_ENDIAN_HOST    = 1,
+   LTI_ENDIAN_LITTLE  = 2,
+   LTI_ENDIAN_BIG     = 3
+} LTIEndian;
+
+/**
+ * constants representing resampling methods
+ */
+
+typedef enum LTIResampleMethod
+{
+   LTI_RESAMPLE_INVALID   = 0,
+   LTI_RESAMPLE_NEAREST   = 1,
+   LTI_RESAMPLE_BILINEAR  = 2,
+   LTI_RESAMPLE_BICUBIC   = 3
+} LTIResampleMethod;
+
+
+
+#ifdef LT_CPLUSPLUS
+}
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+// fwd decls (utils)
+class LTFileSpec;
+class LTIOStreamInf;
+
+// fwd decls (SDK core)
+class LTIGeoCoord;
+class LTIImage;
+class LTIImageFilter;
+class LTIImageReader;
+class LTIImageStage;
+class LTIImageWriter;
+class LTIInterruptDelegate;
+class LTIMetadataDatabase;
+class LTINavigator;
+class LTIPixel;
+class LTIPixelLookupTable;
+class LTIProgressDelegate;
+class LTIReusableBSQBuffer;
+class LTISample;
+class LTIScene;
+class LTISceneBuffer;
+
+LT_END_NAMESPACE(LizardTech)
+
+#endif
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif
diff --git a/src/DSDK/include/base/lti_utils.h b/src/DSDK/include/base/lti_utils.h
new file mode 100644
index 0000000..e137b65
--- /dev/null
+++ b/src/DSDK/include/base/lti_utils.h
@@ -0,0 +1,202 @@
+/* $Id: lti_utils.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_UTILS_H
+#define LTI_UTILS_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// lt_lib_mrsid_core
+#include "lti_types.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+/**
+ * utility functions
+ *
+ * The LTIUtils class contains a number of generally useful static functions, e.g.
+ * functions which operate on the enums declared in lti_types.h
+ *
+ * @note This is a "static" class; do not instantiate.
+ */
+class LTIUtils
+{
+public:
+   /**
+    * returns number of samples per pixel
+    *
+    * This function returns the number of samples (bands) per pixel
+    * for the given colorspace, e.g. 3 for RGB.  If the number of
+    * bands is not known for a given colorspace, 0 will be returned.
+    *
+    * @param  colorspace  the colorspace to query 
+    * @return the number of bands
+    */
+	static lt_uint8 getSamplesPerPixel(LTIColorSpace colorspace);
+
+   /**
+    * returns number of bytes for a given a datatype
+    *
+    * This function returns the number of bytes for a given datatype,
+    * e.g. 1 for LTI_DATATYPE_UINT8 or 4 for LTI_DATATYPE_FLOAT32.
+    *
+    * @param  datatype  the datatype to query 
+    * @return the number of bytes
+    */
+	static lt_uint8 getNumBytes(LTIDataType datatype);
+
+   /**
+    * returns true if datatype is signed
+    *
+    * This function returns true if and only if the datatype
+    * can represent signed values.
+    *
+    * @param  datatype  the datatype to query 
+    * @return true, if signed
+    */
+   static bool isSigned(LTIDataType datatype);
+
+   /**
+    * returns true if datatype is integral
+    *
+    * This function returns true if and only if the datatype
+    * is integral, i.e. not floating point.
+    *
+    * @param  datatype  the datatype to query 
+    * @return true, if an integer datatype
+    */
+   static bool isIntegral(LTIDataType datatype);
+
+   /**
+    * @name Dynamic range conversion functions
+    */
+   /*@{*/
+
+   /**
+    * convert from window/level to min/max
+    *
+    * This function converts a "window and level" style of dynamic range
+    * to a "minimum and maximum" style.
+    *
+    * @param window  the window value 
+    * @param level   the level value 
+    * @param drmin   the dynamic range minimum value 
+    * @param drmax   the dynamic range maximum value 
+    */
+   static void convertWindowLevelToMinMax(double window, double level,
+                                          double& drmin, double& drmax);
+
+  /**
+    * convert from min/max to window/level
+    *
+    * This function converts a "minimum and maximum" style of dynamic range
+    * to a "window and level" style.
+    *
+    * The "window" is defined as the width of the range, i.e. maximum - minimum + 1.
+    * The "level" is defined as the center of the window, i.e. minimum + 1/2 * window.
+    *
+    * @param drmin   the dynamic range minimum value 
+    * @param drmax   the dynamic range maximum value 
+    * @param window  the window value  
+    * @param level   the level value 
+    */
+   static void convertMinMaxToWindowLevel(double drmin, double drmax,
+                                          double& window, double& level);
+   /*@}*/
+
+   /**
+    * @name Mag/level conversion functions
+    */
+   /*@{*/
+
+  /**
+    * convert mag to level
+    *
+    * This function converts a "magnification" value to a "level" value.
+    *
+    * Examples:
+    * \li full resolution: mag of 1.0 equals level of 0
+    * \li down-sampled: mag of 0.5 equals level of 1
+    * \li up-sampled: mag of 2.0 equals level of -1
+    *
+    * @param   mag  the magnification value to convert 
+    * @return  the magnification expressed as a level
+    */
+   static lt_int32 magToLevel(double mag);
+
+  /**
+    * convert level to mag
+    *
+    * This function converts a "level" value to a "magnification" value.
+    *
+    * See magToLevel() for examples.
+    *
+    * @param   level  the level value to convert 
+    * @return  the level expressed as a magnification
+    */
+   static double levelToMag(lt_int32 level);
+   /*@}*/
+
+   /**
+    * get SDK version information
+    *
+    * This function returns SDK version and build information.  The major,
+    * minor, and revision numbers correspond to the public SDK version
+    * number.  For this SDK series, \a major will be 4.  The revision number
+    * is used to indicate the intermediate release point, e.g. "Technology
+    * Preview 8".  The build number and branch name are for internal use by
+    * LizardTech.
+    *
+    * @param  major  the major version number
+    * @param  minor  the minor version number
+    * @param  revision  the revision number
+    * @param  build  the build number
+    * @param  branch  the branch name
+    */
+   static void getVersionInfo(lt_uint32& major,
+                              lt_uint32& minor,
+                              lt_uint32& revision,
+                              lt_uint32& build,
+                              const char*& branch);
+
+   /**
+    * get SDK version information as a string
+    *
+    * This function returns SDK version and build information as a formatted
+    * string.  The string will be of the form "SDK Version MAJOR.MINOR.REVISION.BUILD.BRANCH",
+    * using the values returned from LTIUtils::getVersionInfo().
+    *
+    * @return  the version string
+    */
+   static const char* getVersionString();
+
+private:
+   // nope
+   LTIUtils();
+   LTIUtils(const LTIUtils&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_UTILS_H
diff --git a/src/DSDK/include/base/lti_version.h b/src/DSDK/include/base/lti_version.h
new file mode 100644
index 0000000..7d4dba5
--- /dev/null
+++ b/src/DSDK/include/base/lti_version.h
@@ -0,0 +1,22 @@
+/* $Id: lti_version.h 5124 2006-10-27 11:40:40Z lubia $ */
+/****************************************************************************
+ *                                                                          *
+ *  This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   *
+ *  Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         *
+ *  prohibited.  Access to and use of this code is permitted only under     *
+ *  license from LizardTech, Inc.  Portions of the code are protected by    *
+ *  US and foreign patents and other filings. All Rights Reserved.          *
+ *                                                                          *
+ ***************************************************************************/
+/* PUBLIC */
+
+#ifndef LTI_VERSION_H
+#define LTI_VERSION_H
+
+#define LTI_SDK_VERSION 0x0607
+#define LTI_SDK_MAJOR  6
+#define LTI_SDK_MINOR  0
+#define LTI_SDK_REV    7
+
+#endif // LTI_VERSION_H
+
diff --git a/src/DSDK/include/base/mg2_status.h b/src/DSDK/include/base/mg2_status.h
new file mode 100644
index 0000000..605476d
--- /dev/null
+++ b/src/DSDK/include/base/mg2_status.h
@@ -0,0 +1,332 @@
+/* $Id: mg2_status.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */     
+/* PUBLIC */
+
+#ifndef MG2_STATUS_H
+#define MG2_STATUS_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+
+#define MG2D_STATUS_BASE                              8000
+LT_STATUSSTRING_ADD(MG2D_STATUS_BASE, "mg2d BASE")
+
+#define MG2D_STATUS_Error1Array2DCtor3                8001
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error1Array2DCtor3, "mg2d internal error")
+
+#define MG2D_STATUS_NewerSID                          8002
+LT_STATUSSTRING_ADD(MG2D_STATUS_NewerSID, "MrSID version error")
+
+#define MG2D_STATUS_InvalidImageSupport               8008
+LT_STATUSSTRING_ADD(MG2D_STATUS_InvalidImageSupport, "mg2d internal error")
+
+#define MG2D_STATUS_IncompatibleScaleGreater          8009
+LT_STATUSSTRING_ADD(MG2D_STATUS_IncompatibleScaleGreater, "mg2d internal error")
+
+#define MG2D_STATUS_IncompatibleScaleLess             8010
+LT_STATUSSTRING_ADD(MG2D_STATUS_IncompatibleScaleLess, "mg2d internal error")
+
+#define MG2D_STATUS_Error1SubbandCopy                 8011
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error1SubbandCopy, "mg2d internal error")
+
+#define MG2D_STATUS_Error1SubbandIntersect            8012
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error1SubbandIntersect, "mg2d internal error")
+
+#define MG2D_STATUS_Error2SubbandIntersect            8013
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error2SubbandIntersect, "mg2d internal error")
+
+#define MG2D_STATUS_Error3SubbandIntersect            8014
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error3SubbandIntersect, "mg2d internal error")
+
+#define MG2D_STATUS_Error4SubbandIntersect            8015
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error4SubbandIntersect, "mg2d internal error")
+
+#define MG2D_STATUS_Error5SubbandIntersect            8016
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error5SubbandIntersect, "mg2d internal error")
+
+#define MG2D_STATUS_Error1Array2DSetBand              8017
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error1Array2DSetBand, "mg2d internal error")
+
+#define MG2D_STATUS_Error1Array2DInsert               8018
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error1Array2DInsert, "mg2d internal error")
+
+#define MG2D_STATUS_Error2Array2DInsert               8019
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error2Array2DInsert, "mg2d internal error")
+
+#define MG2D_STATUS_Error1Array2DBSQIteratorPlus      8020
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error1Array2DBSQIteratorPlus, "mg2d internal error")
+
+#define MG2D_STATUS_UnexpectedMarker                  8021
+LT_STATUSSTRING_ADD(MG2D_STATUS_UnexpectedMarker, "mg2d internal error")
+
+#define MG2D_STATUS_ErrorDecompressing                8022
+LT_STATUSSTRING_ADD(MG2D_STATUS_ErrorDecompressing, "Error decoding image")
+
+#define MG2D_STATUS_Error2SubbandCopy                 8023
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error2SubbandCopy, "mg2d internal error")
+
+#define MG2D_STATUS_Error1Merge2sub                   8024
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error1Merge2sub, "mg2d internal error")
+
+#define MG2D_STATUS_Error2Merge2sub                   8025
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error2Merge2sub, "mg2d internal error")
+
+#define MG2D_STATUS_Error3Merge2sub                   8026
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error3Merge2sub, "mg2d internal error")
+
+#define MG2D_STATUS_Error4Merge2sub                   8027
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error4Merge2sub, "mg2d internal error")
+
+#define MG2D_STATUS_Error5Merge2sub                   8028
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error5Merge2sub, "mg2d internal error")
+
+#define MG2D_STATUS_Error1Dth                         8029
+LT_STATUSSTRING_ADD(MG2D_STATUS_Error1Dth, "mg2d internal error")
+
+#define MG2D_STATUS_Interrupt                         8040
+LT_STATUSSTRING_ADD(MG2D_STATUS_Interrupt, "Interrupt")
+
+
+#define LT_STS_MG2_readError                          8101
+LT_STATUSSTRING_ADD(LT_STS_MG2_readError, "mg2 read error")
+
+#define LT_STS_MG2_writeError                         8102
+LT_STATUSSTRING_ADD(LT_STS_MG2_writeError, "mg2 write error")
+
+#define LT_STS_MG2_ioError                            8103
+LT_STATUSSTRING_ADD(LT_STS_MG2_ioError, "mg2 i/o error")
+
+#define LT_STS_MG2_notMrSIDFile                       8104
+LT_STATUSSTRING_ADD(LT_STS_MG2_notMrSIDFile, "not a MG2 file")
+
+#define LT_STS_MG2_unsupportedVersion                 8105
+LT_STATUSSTRING_ADD(LT_STS_MG2_unsupportedVersion, "unsupported version of mg2")
+
+#define LT_STS_MG2_badMarker                          8106
+LT_STATUSSTRING_ADD(LT_STS_MG2_badMarker, "bad mg2 file marker")
+
+#define LT_STS_MG2_blockSizeTooLarge                  8107
+LT_STATUSSTRING_ADD(LT_STS_MG2_blockSizeTooLarge, "blocksize too large")
+
+#define LT_STS_MG2_blockSizeTooSmall                  8108
+LT_STATUSSTRING_ADD(LT_STS_MG2_blockSizeTooSmall, "blocksize too small")
+
+#define LT_STS_MG2_binCountTooLarge                   8109
+LT_STATUSSTRING_ADD(LT_STS_MG2_binCountTooLarge, "binCount too large")
+
+#define LT_STS_MG2_binCountTooSmall                   8110
+LT_STATUSSTRING_ADD(LT_STS_MG2_binCountTooSmall, "binCount too small")
+
+#define LT_STS_MG2_huffmanDecodeError                 8111
+LT_STATUSSTRING_ADD(LT_STS_MG2_huffmanDecodeError, "huffman decode error")
+
+#define LT_STS_MG2_huffmanEncodeError                 8112
+LT_STATUSSTRING_ADD(LT_STS_MG2_huffmanEncodeError, "huffman encode error")
+
+#define LT_STS_MG2_outOfMemory                        8113
+LT_STATUSSTRING_ADD(LT_STS_MG2_outOfMemory, "mg2 out of memory")
+
+#define LT_STS_MG2_error                              8114
+LT_STATUSSTRING_ADD(LT_STS_MG2_error, "mg2 something went very wrong")
+
+#define LT_STS_MG2_rasterBlockNotCompatible           8115
+LT_STATUSSTRING_ADD(LT_STS_MG2_rasterBlockNotCompatible, "mg2 raster block not compatible")
+
+#define LT_STS_MG2_badLevel                           8116
+LT_STATUSSTRING_ADD(LT_STS_MG2_badLevel, "level is larger than the number of levels in image")
+
+#define LT_STS_MG2_badSupport                         8117
+LT_STATUSSTRING_ADD(LT_STS_MG2_badSupport, "support is larger than the image")
+
+#define LT_STS_MG2_badColorSpaceConvertion            8118
+LT_STATUSSTRING_ADD(LT_STS_MG2_badColorSpaceConvertion, "bad color space conversion")
+
+
+#define MG2D_STATUS_MAX                               8999
+LT_STATUSSTRING_ADD(MG2D_STATUS_MAX, "mg2d MAX")
+
+
+#define LT_STS_Image_MG2E_BASE                  9000
+LT_STATUSSTRING_ADD(LT_STS_Image_MG2E_BASE, "mg2e BASE")
+
+#define LT_STS_MG2EError1SInitSub               9001
+LT_STATUSSTRING_ADD(LT_STS_MG2EError1SInitSub, "mg2 Error1SInitSub")
+
+#define LT_STS_MG2EErrorBlockSmallGivenNlev     9002
+LT_STATUSSTRING_ADD(LT_STS_MG2EErrorBlockSmallGivenNlev, "block size too small for given scale")
+
+#define LT_STS_MG2EError1ZeroOverlapSub         9003
+LT_STATUSSTRING_ADD(LT_STS_MG2EError1ZeroOverlapSub, "mg2 Error1ZeroOverlapSub")
+
+#define LT_STS_MG2EError1PurgeBorderSub         9004
+LT_STATUSSTRING_ADD(LT_STS_MG2EError1PurgeBorderSub, "mg2 Error1PurgeBorderSub")
+
+#define LT_STS_MG2EError1CopyDataToBordersSub   9005
+LT_STATUSSTRING_ADD(LT_STS_MG2EError1CopyDataToBordersSub, "mg2 Error1CopyDataToBordersSub")
+
+#define LT_STS_MG2EError2PurgeBorderSub         9006
+LT_STATUSSTRING_ADD(LT_STS_MG2EError2PurgeBorderSub, "mg2 Error2PurgeBorderSub")
+
+#define LT_STS_MG2EErrorSetOverlap              9007
+LT_STATUSSTRING_ADD(LT_STS_MG2EErrorSetOverlap, "mg2 ErrorSetOverlap")
+
+#define LT_STS_MG2EErrorSubbandSplit            9008
+LT_STATUSSTRING_ADD(LT_STS_MG2EErrorSubbandSplit, "mg2 ErrorSubbandSplit")
+
+// 9009 unused
+
+#define LT_STS_MG2EUnknownException             9010
+LT_STATUSSTRING_ADD(LT_STS_MG2EUnknownException, "mg2 UnknownException")
+
+#define LT_STS_MG2ENlevLessEqual9               9011
+LT_STATUSSTRING_ADD(LT_STS_MG2ENlevLessEqual9, "scale too large")
+
+#define LT_STS_MG2EImageSmallGivenNLev          9012
+LT_STATUSSTRING_ADD(LT_STS_MG2EImageSmallGivenNLev, "scale too small")
+
+#define LT_STS_MG2EErrorMaxIconSize             9013
+LT_STATUSSTRING_ADD(LT_STS_MG2EErrorMaxIconSize, "mg2 icon size error")
+
+#define LT_STS_MG2EMemAlloc                     9014
+LT_STATUSSTRING_ADD(LT_STS_MG2EMemAlloc, "mg2 mem alloc error")
+
+#define LT_STS_MG2EErrorOpenOutputFile          9015
+LT_STATUSSTRING_ADD(LT_STS_MG2EErrorOpenOutputFile, "error opening output file")
+
+#define LT_STS_MG2EErrorWriteOutputFile         9016
+LT_STATUSSTRING_ADD(LT_STS_MG2EErrorWriteOutputFile, "error writing output file")
+
+#define LT_STS_MG2ETempFileError                9017
+LT_STATUSSTRING_ADD(LT_STS_MG2ETempFileError, "temp file error (%F)")
+
+#define LT_STS_MG2ETempDirError                 9018
+LT_STATUSSTRING_ADD(LT_STS_MG2ETempDirError, "temp dir error")
+
+#define LT_STS_MG2EBlockSmallGivenNlev          9019
+LT_STATUSSTRING_ADD(LT_STS_MG2EBlockSmallGivenNlev, "block size too small for scale")
+
+#define LT_STS_MG2EIllegalSampleType            9020
+LT_STATUSSTRING_ADD(LT_STS_MG2EIllegalSampleType, "illegal sample type")
+
+#define LT_STS_MG2EInterrupt                    9021
+LT_STATUSSTRING_ADD(LT_STS_MG2EInterrupt, "mg2 interrupt")
+
+#define LT_STS_MG2EWriteErrorCheckTempDir       9022
+LT_STATUSSTRING_ADD(LT_STS_MG2EWriteErrorCheckTempDir, "temp dir write error")
+
+#define LT_STS_MG2EFileOffsetErrorDecodeIndices 9023
+LT_STATUSSTRING_ADD(LT_STS_MG2EFileOffsetErrorDecodeIndices, "mg2 FileOffsetErrorDecodeIndices")
+
+#define LT_STS_MG2EInvalidLockingKey            9024
+LT_STATUSSTRING_ADD(LT_STS_MG2EInvalidLockingKey, "Invalid key")
+
+#define LT_STS_MG2EInvalidLockingPassword       9025
+LT_STATUSSTRING_ADD(LT_STS_MG2EInvalidLockingPassword, "Invalid password")
+
+#define LT_STS_RFIInvalid                       9100
+LT_STATUSSTRING_ADD(LT_STS_RFIInvalid, "RFI invalid error")
+
+
+#define LT_STS_MG2E_TableGen_MemAlloc           9200
+LT_STATUSSTRING_ADD(LT_STS_MG2E_TableGen_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_Subband_MemAlloc            9201
+LT_STATUSSTRING_ADD(LT_STS_MG2E_Subband_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_SetOverlap_MemAlloc         9202
+LT_STATUSSTRING_ADD(LT_STS_MG2E_SetOverlap_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_IconBitRate_MemAlloc        9203
+LT_STATUSSTRING_ADD(LT_STS_MG2E_IconBitRate_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_CreateTempFile              9204
+LT_STATUSSTRING_ADD(LT_STS_MG2E_CreateTempFile, "cannot create temp file")
+
+#define LT_STS_MG2E_TempName_MemAlloc           9205
+LT_STATUSSTRING_ADD(LT_STS_MG2E_TempName_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_ArchUtils_MemAlloc          9206
+LT_STATUSSTRING_ADD(LT_STS_MG2E_ArchUtils_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_Dump_MemAlloc               9207
+LT_STATUSSTRING_ADD(LT_STS_MG2E_Dump_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_BlkNode_MemAlloc            9208
+LT_STATUSSTRING_ADD(LT_STS_MG2E_BlkNode_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_Convert_MemAlloc            9209
+LT_STATUSSTRING_ADD(LT_STS_MG2E_Convert_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_HuffD_MemAlloc              9210
+LT_STATUSSTRING_ADD(LT_STS_MG2E_HuffD_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_HuffE_MemAlloc              9211
+LT_STATUSSTRING_ADD(LT_STS_MG2E_HuffE_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_HuffE2_MemAlloc             9212
+LT_STATUSSTRING_ADD(LT_STS_MG2E_HuffE2_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_OutIcon_MemAlloc            9213
+LT_STATUSSTRING_ADD(LT_STS_MG2E_OutIcon_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_Purge_MemAlloc              9214
+LT_STATUSSTRING_ADD(LT_STS_MG2E_Purge_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_QGen_MemAlloc               9215
+LT_STATUSSTRING_ADD(LT_STS_MG2E_QGen_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_SQ_MemAlloc                 9216
+LT_STATUSSTRING_ADD(LT_STS_MG2E_SQ_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_SbInit_MemAlloc             9217
+LT_STATUSSTRING_ADD(LT_STS_MG2E_SbInit_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_TDWTQ_MemAlloc              9218
+LT_STATUSSTRING_ADD(LT_STS_MG2E_TDWTQ_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2E_TDWTQ_ColorSpace            9219
+LT_STATUSSTRING_ADD(LT_STS_MG2E_TDWTQ_ColorSpace, "invalid colorspace")
+
+#define LT_STS_MG2E_Convert_ReadError           9220
+LT_STATUSSTRING_ADD(LT_STS_MG2E_Convert_ReadError, "internal mg2 read error")
+
+#define LT_STS_MG2E_HuffD_ReadError             9221
+LT_STATUSSTRING_ADD(LT_STS_MG2E_HuffD_ReadError, "internal mg2 read error")
+
+#define LT_STS_MG2E_Split_MemAlloc              9222
+LT_STATUSSTRING_ADD(LT_STS_MG2E_Split_MemAlloc, "memory allocation error")
+
+#define LT_STS_MG2EAllocFailed                  9223
+LT_STATUSSTRING_ADD(LT_STS_MG2EAllocFailed, "MG2 encode memory allocation failed")
+
+#define LT_STS_Image_MG2E_MAX                   9999
+LT_STATUSSTRING_ADD(LT_STS_Image_MG2E_MAX, "mg2 MAX")
+
+
+#define LT_STS_MG2LET_BEGIN                  32000 
+
+#define LT_STS_SLT_Error                     32001
+#define LT_STS_SLT_ExtractError              32002 
+#define LT_STS_SLT_SidletClientZeroSupport   32005
+#define LT_STS_SLT_SidletClientAllDataCached 32006
+#define LT_STS_SLT_SidletClientExceptionCaught 32007
+#define LT_STS_SLT_IOError                   32008
+#define LT_STS_SLT_ErrGenRequest             32009
+#define LT_STS_SLT_ErrorParsingSidletRequest 32013
+#define LT_STS_SLT_MessageHeaderSectionCorrupt              32014
+#define LT_STS_SLT_MarkerMismatchWhileParsingSidletMessage  32016
+#define LT_STS_SLT_UnrecognizedSidletMessageSection         32017
+
+#define LT_STS_MG2LET_END 32999;
+
+
+#endif /* MG2_STATUS_H */
diff --git a/src/DSDK/include/base/mg3_status.h b/src/DSDK/include/base/mg3_status.h
new file mode 100644
index 0000000..fee9832
--- /dev/null
+++ b/src/DSDK/include/base/mg3_status.h
@@ -0,0 +1,215 @@
+/* $Id: mg3_status.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */     
+/* PUBLIC */
+
+#ifndef MG3_STATUS_H
+#define MG3_STATUS_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+//
+// On the Usage of Status Codes
+// ----------------------------
+//
+// Status codes are used to report failure modes of an "unnatural" or
+// "unexpected" nature.  They are to be used when something happens that is
+// not part of the normal course of events.  They often are used in places
+// where other, more mature programmers would throw exceptions.
+//
+// Applications that don't otherwise handle failure conditions should feel
+// free to return these status values as exit codes back out to the shell.
+// The kernel sample apps follow this convention.
+//
+// These status values are to be generally applicable across the whole
+// kernel.  They are not to be specific to a small set of cases ("the third
+// parameter to this function was greater than 10"), nor are they to be
+// overly generic ("an error occurred").
+//
+// The intent of status codes is to both signal to the user that something
+// bad happened and to provide a mechanism for aborting execution gracefully.
+// It is *not* the intent that these status codes would allow a caller to
+// programmatically diagnose the error and retry the operation -- that would
+// require a much richer semantics.  To paraphrase Nathan, the kernel is
+// designed for non-dummies.
+//
+// Status codes are *not* to be used for indicating negative success, such as
+// in a function that attempts to find within a file a packet of some
+// specified type and return a pointer to that packet.  That function should
+// return the "ok" status and use an "out" parameter to return the pointer,
+// either set properly (packet was found) or as NULL (packet was not found).
+// Finding packets in a file involves underlying I/O operations, and
+// therefore is potentially a status-code-inducing operation.  (Contrast this
+// with a function which is just looking for some element in a list -- a
+// standard list search probably won't entail any operations that might fail
+// in bad ways, so returning the pointer directly is okay.)
+//
+// By convention, status codes are only to be used as function return values,
+// never as parameters.
+//
+// If a function returns a status code, it's value MUST be checked for
+// success and handled appropriately.  If you are unsure how to handle the
+// returned result, the least you should do is pass the status code back up
+// the stack.
+//
+// Someday, we might unify these status codes with those used by Sparkle, the
+// Core, the Stream library, etc.
+//
+// If you feel the urge to add a New status code, stop and consider your
+// situation carefully.  Can you use one of the ones already there?  Could
+// your New one replace an existing one?  Will your New one be useful in some
+// case other than the current one you have in mind?  Have you talked it over
+// with the other kernel folks yet?
+//
+// There is no "unknown" status code represented.  Such a value would defeat
+// the whole purpose.  Lame-o.
+//
+// Recall that the kernel does not use explicit exception handling anywhere.
+// Ever.  At all.  Period.  We use status codes instead.
+//
+// Only the "OK" status code is given a numeric value (zero).  Programmers
+// should not rely on the numeric values or orderings of the enum values.
+//
+// The "OK()" function should always be used to test success.  The idiom of
+// choice is:
+//   stat = foo();
+//   if (!OK(stat)) return foo;
+//
+// The "invalid" status is to be used only for initializing variables of type
+// MG3Status.  No well-behaved function should ever return the "invalid"
+// status.
+//
+// Note well that the meaning of each status code is documented.  We'd like
+// to keep it that way.
+//
+
+
+// note "name()" function is declared in MG3Types class
+
+#define MG3_STATUS_BASE  2000
+LT_STATUSSTRING_ADD(MG3_STATUS_BASE, "mg3 BASE")
+
+#define MG3_STATUS_MAX   2999
+LT_STATUSSTRING_ADD(MG3_STATUS_MAX, "mg3 MAX")
+
+   // A "read" I/O operation failed: you hit EOF unexpectedly because the
+   // file was corrupt, someone unplugged your network cable on you, etc.
+#define MG3_STATUS_READ_ERROR                      2001
+LT_STATUSSTRING_ADD(MG3_STATUS_READ_ERROR, "mg3 read error")
+
+   // A "write" I/O operation failed: someone unplugged your network cable on
+   // you, you don't have write permission, the stream just ain't writable,
+   // etc.
+#define MG3_STATUS_WRITE_ERROR                     2002
+LT_STATUSSTRING_ADD(MG3_STATUS_WRITE_ERROR, "mg3 write error")
+
+   // An "open" I/O operation failed: someone unplugged your network cable
+   // (again...), you don't have permission to create the file, you don't
+   // have write access to the file, etc.
+#define MG3_STATUS_OPEN_ERROR                      2003
+LT_STATUSSTRING_ADD(MG3_STATUS_OPEN_ERROR, "mg3 open error")
+
+   // An I/O operation failed, for some reason other than read, write, or
+   // open: for example, seek() or close().
+#define MG3_STATUS_IO_ERROR                        2004
+LT_STATUSSTRING_ADD(MG3_STATUS_IO_ERROR, "mg3 IO error")
+
+   // The format the file being read was somehow broken: a field containing
+   // an enum had an illegal value, etc.  This is largely for use by those
+   // functions which need to decode specific file formats, e.g. MG3.
+#define MG3_STATUS_FORMAT_ERROR                    2005
+LT_STATUSSTRING_ADD(MG3_STATUS_FORMAT_ERROR, "mg3 format error")
+
+   // A versioning problem has occurred: you're trying to read a version that
+   // you don't have support for.  [I don't like this one much -- probably
+   // should be diagnosed more explicitly and handled more formally. BUG.]
+#define MG3_STATUS_BAD_VERSION                     2006
+LT_STATUSSTRING_ADD(MG3_STATUS_BAD_VERSION, "mg3 bad version")
+
+   // The user has requested an interrupt, e.g. via a signal from our friends
+   // as LTProcessCallback::hasBeenTerminated().
+#define MG3_STATUS_INTERRUPT                       2007
+LT_STATUSSTRING_ADD(MG3_STATUS_INTERRUPT, "mg3 interrupt")
+
+#define MG3_STATUS_RESERVED_2008                   2008
+
+   // One of the arguments to the function was incorrect: a value was out of
+   // range, a pointer was NULL, etc.  (Compare this to the "bad context"
+   // error, which is more of an implicit problem.)
+#define MG3_STATUS_BAD_ARGUMENT                    2009
+LT_STATUSSTRING_ADD(MG3_STATUS_BAD_ARGUMENT, "mg3 bad argument")
+
+   // The context in which the function was called is incorrect: for example,
+   // trying to add a certain unique packet type to the database when there
+   // is already one of that type in there -- the caller of function is not
+   // supposed to do that.  Similarly, calling initialize() twice is not
+   // allowed, nor is calling execute() with calling initialize() first.
+   // (Compare this to the "bad argument" error, which is more of an explicit
+   // problem.)
+#define MG3_STATUS_BAD_CONTEXT                     2010
+LT_STATUSSTRING_ADD(MG3_STATUS_BAD_CONTEXT, "mg3 bad context")
+
+   // We tried to do something that required a password or some such, and
+   // the operation didn't succeed.  This should only happen around calls
+   // into secuirty packets and the encryption library and those sorts of
+   // places.
+#define MG3_STATUS_SECURITY_ERROR                  2011
+LT_STATUSSTRING_ADD(MG3_STATUS_SECURITY_ERROR, "mg3 security error")
+
+   // Unlikely, but could happen.  Typically would be used by wrapping a call
+   // to a potentially large malloc() call in a try region and using this
+   // value if the catch region finds an out of memory exception.
+#define MG3_STATUS_OUT_OF_MEMORY                   2012
+LT_STATUSSTRING_ADD(MG3_STATUS_OUT_OF_MEMORY, "mg3 out of memory")
+
+   // A C++ exception occurred that we did not expect.  In some cases, the
+   // kernel will wrap a call to a foreign library in a try region so as to
+   // manually catch any errors it may throw.  This status value is used when
+   // the resulting exception is not something we can readily deal with.
+#define MG3_STATUS_UNHANDLED_EXCEPTION             2013
+LT_STATUSSTRING_ADD(MG3_STATUS_UNHANDLED_EXCEPTION, "mg3 unhandled exception")
+
+   // A theoretically unreachable piece of code was reached.  This should
+   // be used for things like the default case of a switch statement in which
+   // all possible legal values have already been handled explicitly.  This
+   // value may be used in conjunction with LT_ASSERT(0).
+#define MG3_STATUS_NOTREACHED                      2014
+LT_STATUSSTRING_ADD(MG3_STATUS_NOTREACHED, "mg3 NOTREACHED")
+
+   // Use only for initializing a variable.  Should never be returned as an
+   // actual status value.
+#define MG3_STATUS_INVALID                         2015
+LT_STATUSSTRING_ADD(MG3_STATUS_INVALID, "mg3 status invalid")
+
+   // No MSEs in the image: the image cannot be optimized or streamed.
+#define MG3_STATUS_NO_MSES                         2016
+LT_STATUSSTRING_ADD(MG3_STATUS_NO_MSES, "mg3 no MSEs")
+
+   // The streaming client made a bad request
+   // on the server side still send the reply
+#define MG3_STATUS_BAD_CLIENT_REQUEST              2017
+LT_STATUSSTRING_ADD(MG3_STATUS_BAD_CLIENT_REQUEST, "mg3 bad client request")
+
+   // The streaming server had any error: call getServerError()
+   // on the server side still send the reply
+#define MG3_STATUS_SERVER_ERROR                    2018
+LT_STATUSSTRING_ADD(MG3_STATUS_SERVER_ERROR, "mg3 server error")
+
+   // The MG3 image could not be added the client plane cache
+   // because the imageInfo does not match.
+#define MG3_STATUS_IMAGE_NOT_COMPATIBLE            2019
+LT_STATUSSTRING_ADD(MG3_STATUS_IMAGE_NOT_COMPATIBLE, "mg3 image not compatible")
+
+   // Singed integer overflowed
+#define MG3_STATUS_OVERFLOW                        2020
+LT_STATUSSTRING_ADD(MG3_STATUS_OVERFLOW, "mg3 integer overflow")
+
+#endif // MG3_STATUS_H
diff --git a/src/DSDK/include/c_api/lt_ioCStream.h b/src/DSDK/include/c_api/lt_ioCStream.h
new file mode 100644
index 0000000..fa5e43a
--- /dev/null
+++ b/src/DSDK/include/c_api/lt_ioCStream.h
@@ -0,0 +1,212 @@
+/* $Id: lt_ioCStream.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC - C */
+
+#ifndef LT_IO_C_STREAM_H
+#define LT_IO_C_STREAM_H
+
+#include "lt_base.h"
+#include "lt_lib_io.h"
+#include "lt_ioCallbackStreamTypes.h"
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(push,4)
+#endif
+
+#ifdef LT_CPLUSPLUS
+extern "C" {
+#endif
+
+/**
+ * @name C functions for operating on streams
+ *
+ * These functions are C-callable analogues to the member
+ * functions in the LTIOStreamInf class.
+ */
+/*@{*/
+
+/**
+ * destructor for C stream
+ *
+ * This function must be called once the stream is no longer needed
+ * to free up the stream's allocated resources, i.e. it calls the
+ * destructor of the underlying LTIOCallbackStream.
+ *
+ * @param  stream  stream to be freed
+ * @return success/failure code
+ */
+LT_STATUS lt_ioCStreamDestroy(LTIOStreamH stream);
+
+
+/**
+ * open C stream
+ *
+ * Opens a previously-created C stream.
+ *
+ * This function is equivalent to LTIOStreamInf::open().
+ *
+ * @param  stream  stream to be opened
+ * @return success/failure code
+ */
+LT_STATUS lt_ioCStreamOpen(LTIOStreamH stream);
+
+
+/**
+ * close C stream
+ *
+ * Closes a C stream.  Note that lt_ioCStreamDestroy() must be
+ * called once the stream is no longer needed.
+ *
+ * This function is equivalent to LTIOStreamInf::close().
+ *
+ * @param  stream  stream to be closed
+ * @return success/failure code
+ */
+LT_STATUS lt_ioCStreamClose(LTIOStreamH stream);
+
+
+/**
+ * read C stream
+ *
+ * Read from a C stream.
+ *
+ * This function is equivalent to LTIOStreamInf::read().
+ *
+ * @param  stream  stream to read from
+ * @param  buf     buffer to read into
+ * @param  len     number of bytes to read
+ * @return number of bytes read
+ */
+lt_uint32 lt_ioCStreamRead(LTIOStreamH stream, lt_uint8* buf, lt_uint32 len);
+
+
+/**
+ * write C stream
+ *
+ * Write to a C stream.
+ *
+ * This function is equivalent to LTIOStreamInf::write().
+ *
+ * @param  stream  stream to be written to
+ * @param  buf     buffer to write from
+ * @param  len     number of bytes to write
+ * @return number of bytes written
+ */
+lt_uint32 lt_ioCStreamWrite(LTIOStreamH stream, const lt_uint8* buf, lt_uint32 len);
+
+
+/**
+ * seek for C stream
+ *
+ * Seek on a C stream.
+ *
+ * This function is equivalent to LTIOStreamInf::seek().
+ *
+ * @param  stream  stream to be seek on
+ * @param  offset  distance to seek
+ * @param  dir     seek direction
+ * @return success/failure code
+ */
+LT_STATUS lt_ioCStreamSeek(LTIOStreamH stream, lt_int64 offset, LTIOSeekDir dir);
+
+
+/**
+ * tell for C stream
+ *
+ * Tell on a C stream.
+ *
+ * This function is equivalent to LTIOStreamInf::tell().
+ *
+ * @param  stream  stream to get offset of
+ * @return stream's current offset
+ */
+lt_int64 lt_ioCStreamTell(LTIOStreamH stream);
+
+
+/**
+ * is end-of-file? for C stream
+ *
+ * Check for EOF on a C stream.
+ *
+ * This function is equivalent to LTIOStreamInf::isEOF().
+ *
+ * @param  stream  stream to query
+ * @return true (1), iff the stream is at EOF
+ */
+lt_uint8 lt_ioCStreamIsEOF(LTIOStreamH stream);
+
+
+/**
+ * is open? for C stream
+ *
+ * Check for open on a C stream.
+ *
+ * This function is equivalent to LTIOStreamInf::isOpen().
+ *
+ * @param  stream  stream to query
+ * @return true (1) iff the stream is open
+ */
+lt_uint8 lt_ioCStreamIsOpen(LTIOStreamH stream);
+
+
+/**
+ * duplicate C stream
+ *
+ * Duplicate a C stream.
+ *
+ * This function is equivalent to LTIOStreamInf::duplicate().
+ *
+ * @param  stream  stream to duplicate
+ * @return the new stream (or NULL if cannot duplicate)
+ */
+LTIOStreamH lt_ioCStreamDuplicate(LTIOStreamH stream);
+
+
+/**
+ * create callback stream
+ *
+ * Create an LTIOCallbackStream, via C API.  The parameters correspond
+ * to those used in LTIOCallbackStream::initialize().
+ *
+ * @param  open       user's open function
+ * @param  close      user's close function
+ * @param  read       user's read function
+ * @param  write      user's write function
+ * @param  seek       user's seek function
+ * @param  tell       user's tell function
+ * @param  isEOF      user's isEOF function
+ * @param  isOpen     user's isOpen function
+ * @param  duplicate  user's duplicate function
+ * @param  userData   user's stream data
+ * @return the created stream
+ */
+LTIOStreamH lt_ioCallbackStreamCreate(LTIOCallbackStream_Open open,
+                                      LTIOCallbackStream_Close close,
+                                      LTIOCallbackStream_Read read,
+                                      LTIOCallbackStream_Write write,
+                                      LTIOCallbackStream_Seek seek,
+                                      LTIOCallbackStream_Tell tell,
+                                      LTIOCallbackStream_IsEOF isEOF,
+                                      LTIOCallbackStream_IsOpen isOpen,
+                                      LTIOCallbackStream_Duplicate duplicate,
+                                      void* userData);
+
+/*@}*/
+
+#ifdef LT_CPLUSPLUS
+}
+#endif
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif
diff --git a/src/DSDK/include/c_api/ltic_api.h b/src/DSDK/include/c_api/ltic_api.h
new file mode 100644
index 0000000..5cf54c6
--- /dev/null
+++ b/src/DSDK/include/c_api/ltic_api.h
@@ -0,0 +1,462 @@
+/* $Id: ltic_api.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC - C */
+
+#ifndef LTI_CAPI_H
+#define LTI_CAPI_H
+
+#include "lti_types.h"
+#include "lti_metadataTypes.h"
+#include "lt_ioCStream.h"
+
+#ifdef LT_CPLUSPLUS
+extern "C" {
+#endif
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(push,4)
+#endif
+
+
+/**      
+ * @file  ltic_api.h
+ *
+ * This file contains a simple C API to the Decode SDK.  It is essentially
+ * just a wrapper around the LTIImage class and its member functions.
+ */
+
+   
+/**
+ * C API status codes
+ */
+/*@{*/
+#define LT_STS_CAPI_BASE            ((LT_STATUS)52000)
+#define LT_STS_CAPI_BadParam        ((LT_STATUS)52001)
+#define LT_STS_CAPI_MAX             ((LT_STATUS)52099)
+/*@}*/
+
+
+/**
+ * opaque pointer (handle) to an LTIImage
+ */
+typedef void* LTICImageH;
+
+
+/**
+ * get SDK version (C API)
+ *
+ * Returns the full version number of the SDK, e.g. "4.0.8.673".
+ *
+ * This method is part of the C API.  It is equivalent to the
+ * LTIUtils::getVersionInfo() function.
+ *
+ * @param major     address to hold major version number
+ * @param minor     address to hold minor version number
+ * @param revision  address to hold revision number
+ * @param build     address to hold build number
+ * @param branch    address to hold string giving the branch name
+ * @return status code indicating success or failure
+ */
+LT_STATUS ltic_getVersion(lt_uint32* major,
+                          lt_uint32* minor,
+                          lt_uint32* revision,
+                          lt_uint32* build,
+                          const char** branch);
+
+/**
+ * open MrSID image via filename (C API)
+ *
+ * Given the filename of a MrSID image, this function will open the image
+ * and return a handle which can be used to access image information and
+ * perform decodes.
+ *
+ * This method is part of the C API.  It is equivalent to constructing
+ * a MrSIDImageReader object.
+ *
+ * @param image     address to hold image handle 
+ * @param fileName  name of file to open
+ * @return status code indicating success or failure
+ */
+LT_STATUS ltic_openMrSIDImageFile(LTICImageH* image,
+                                  const char* fileName);
+
+/**
+ * open MrSID image via stream (C API)
+ *
+ * Given a C stream containing a MrSID image, this function will open the image
+ * and return a handle which can be used to access image information and
+ * perform decodes.
+ *
+ * This method is part of the C API.  It is equivalent to constructing
+ * a MrSIDImageReader object.
+ *
+ * @param image     address to hold image handle 
+ * @param stream    C stream handle
+ * @return status code indicating success or failure
+ */
+LT_STATUS ltic_openMrSIDImageStream(LTICImageH* image,
+                                    LTIOStreamH stream);
+
+/**
+ * open JPEG 2000 image via filename (C API)
+ *
+ * Given the filename of a JPEG 2000 image, this function will open the image
+ * and return a handle which can be used to access image information and
+ * perform decodes.
+ *
+ * This method is part of the C API.  It is equivalent to constructing
+ * a J2KImageReader object.
+ *
+ * @param image     address to hold image handle 
+ * @param fileName  name of file to open
+ * @return status code indicating success or failure
+ */
+LT_STATUS ltic_openJP2ImageFile(LTICImageH* image,
+                                const char* fileName);
+
+/**
+ * open JPEG 2000 image via stream (C API)
+ *
+ * Given a C stream containing a JPEG 2000 image, this function will open the image
+ * and return a handle which can be used to access image information and
+ * perform decodes.
+ *
+ * This method is part of the C API.  It is equivalent to constructing
+ * a J2KImageReader object.
+ *
+ * @param image     address to hold image handle 
+ * @param stream    C stream handle
+ * @return status code indicating success or failure
+ */
+LT_STATUS ltic_openJP2ImageStream(LTICImageH* image,
+                                  LTIOStreamH stream);
+
+/**
+ * open NITF image via filename (C API)
+ *
+ * Given the filename of a NITF image, this function will open the image
+ * and return a handle which can be used to access image information and
+ * perform decodes.
+ *
+ * This method is part of the C API.  It is equivalent to constructing
+ * a NITFImageReader (and NITFImageManager) object.
+ *
+ * @param image     address to hold image handle 
+ * @param fileName  name of file to open
+ * @return status code indicating success or failure
+ */
+LT_STATUS ltic_openNITFImageFile(LTICImageH* image,
+                                 const char* fileName);
+
+/**
+ * close an image (C API)
+ *
+ * This function will close the given image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * the LTIImage destructor.
+ *
+ * @param image     image to be closed
+ * @return status code indicating success or failure
+ */
+LT_STATUS ltic_closeImage(LTICImageH image);
+
+/**
+ * get image width (C API)
+ *
+ * This function will return the width of the given image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getWidth().
+ *
+ * @param   image     image to query
+ * @return  width in pixels
+ */
+lt_uint32 ltic_getWidth(const LTICImageH image);
+
+/**
+ * get image height (C API)
+ *
+ * This function will return the height of the given image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getHeight().
+ *
+ * @param   image     image to query
+ * @return  height of image
+ */
+lt_uint32 ltic_getHeight(const LTICImageH image);
+
+/**
+ * get dimensions of an image at a given magnification (C API)
+ *
+ * This function returns the projected dimensions of an image at a given
+ * magnification level.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getDimsAtMag()
+ */
+LT_STATUS ltic_getDimsAtMag(LTICImageH image,
+                            double magnification,
+                            lt_uint32 *width,
+                            lt_uint32 *height);
+
+/**
+ * get image colorspace (C API)
+ *
+ * This function will return the colorspace of the given image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getColorSpace().
+ *
+ * @param   image     image to query
+ * @return  colorspace of image
+ */
+LTIColorSpace ltic_getColorSpace(const LTICImageH image);
+
+/**
+ * get number of bands in trhe image (C API)
+ *
+ * This function will return the numbe rof bands in the given image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getNumBands().
+ *
+ * @param   image     image to query
+ * @return  number of bands in the image
+ */
+lt_uint16 ltic_getNumBands(const LTICImageH image);
+
+/**
+ * get image datatype (C API)
+ *
+ * This function will return the datatype of the pixels of the image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getDataType().
+ *
+ * @param   image     image to query
+ * @return  datatype of the image
+ */
+LTIDataType ltic_getDataType(const LTICImageH image);
+
+/**
+ * get image minimum magnifaction (C API)
+ *
+ * This function will return the minimum magnification of the image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getMinMagnification().
+ *
+ * @param   image     image to query
+ * @return  minimum magnification of image
+ */
+double ltic_getMinMagnification(const LTICImageH image);
+
+/**
+ * get image maximum magnifacation (C API)
+ *
+ * This function will return the maximum magnification of the image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getMaxMagnification().
+ *
+ * @param   image     image to query
+ * @return  maximum magnification of image
+ */
+double ltic_getMaxMagnification(const LTICImageH image);
+
+/**
+ * query if MrSID image is locked (C API)
+ *
+ * This function will return whether or not the given image is
+ * locked, i.e. password protected.  The \a image handle must
+ * be a MrSID image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * MrSIDImageReader::isLocked().
+ *
+ * @param   image     MrSID image to query
+ * @return  1 if locked, otherwise 0
+ */
+lt_uint8 ltic_isMrSIDLocked(const LTICImageH image);
+
+/**
+ * set password for decoding MrSID image (C API)
+ *
+ * This function will set the passward used to decode a locked MrSID
+ * image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * MrSIDImageReader::setPassword().
+ *
+ * @param   image     MrSID image to unlock
+ * @param   passwd    password string for image
+ * @return  success or failure status code
+ */
+LT_STATUS ltic_setMrSIDPassword(LTICImageH image, const lt_utf8* passwd);
+
+/**
+ * get geo X position of image (C API)
+ *
+ * This function will return the upper-left X position of the image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getGeoCoord().getX().
+ *
+ * @param   image     image to query
+ * @return  upperleft X geo position
+ */
+double ltic_getGeoXOrigin(const LTICImageH image);
+
+/**
+ * get geo Y position of image (C API)
+ *
+ * This function will return the upper-left Y position of the image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getGeoCoord().getY().
+ *
+ * @param   image     image to query
+ * @return  upperleft Y geo position
+ */
+double ltic_getGeoYOrigin(const LTICImageH image);
+
+/**
+ * get geo X resolution of image (C API)
+ *
+ * This function will return the X resolution of the image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getGeoCoord().getXRes().
+ *
+ * @param   image     image to query
+ * @return  X resolution
+ */
+double ltic_getGeoXResolution(const LTICImageH image);
+
+/**
+ * get geo Y resolution of image (C API)
+ *
+ * This function will return the Y resolution of the image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getGeoCoord().getYRes().
+ *
+ * @param   image     image to query
+ * @return  Y resolution
+ */
+double ltic_getGeoYResolution(const LTICImageH image);
+
+/**
+ * get geo X rotation term of image (C API)
+ *
+ * This function will return the X rotation term of the image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getGeoCoord().getXRot().
+ *
+ * @param   image     image to query
+ * @return  X rotation
+ */
+double ltic_getGeoXRotation(const LTICImageH image);
+
+/**
+ * get geo Y rotation term of image (C API)
+ *
+ * This function will return the Y rotation term of the image.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getGeoCoord().getYRot().
+ *
+ * @param   image     image to query
+ * @return  Y rotation
+ */
+double ltic_getGeoYRotation(const LTICImageH image);
+
+/**
+ * decode a scene from the image (C API)
+ *
+ * This function decodes a scene from the image.  The output
+ * is written to the given band buffers in packed form.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImageStage::read().  The \a xUpperLeft, \a yUpperLeft,
+ * \a width, \a height, and \a magnification parameters correspond
+ * to the LTIScene used in the read() call.
+ *
+ * @param   image     image to decode
+ * @param   xUpperLeft upperleft x position of scene
+ * @param   yUpperLeft upperleft y position of scene
+ * @param   width      width of scene
+ * @param   height     height of scene
+ * @param   magnification manification of scene
+ * @param   buffers   array of buffers to write to, one per band
+ * @return status code indicating success or failure
+ */
+LT_STATUS ltic_decode(LTICImageH image,
+                      double xUpperLeft,
+                      double yUpperLeft,
+                      double width,
+                      double height,
+                      double magnification,
+                      void** buffers);
+   
+/**
+ * get number of metadata records (C API)
+ *
+ * This function returns the number of metadata records in the
+ * image.  This number defines the range of values used with
+ * ltic_metadataRecord().
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getMetadata().getIndexCount().
+ *
+ * @param   image     image to query
+ * @return  number of records in image
+ */
+lt_uint32 ltic_getNumMetadataRecords(LTICImageH image);
+
+/**
+ * get a metadata record from an image (C API)
+ *
+ * This function returns the data contained in a given metadata
+ * record.
+ *
+ * This method is part of the C API.  It is equivalent to calling
+ * LTIImage::getMetadata().getDataByIndex().
+ *
+ * @param   image     image to query
+ * @param   recordNum  index of record to retrieve
+ * @param   tag       address to hold name of metadata tag
+ * @param   datatype  address to hold datatype of record
+ * @param   numDims   address to hold number of dimension in record data
+ * @param   dims      address to record's dimesnion arrays
+ * @param   data      address to record's data
+ * @return status code indicating success or failure
+ */
+LT_STATUS ltic_getMetadataRecord(LTICImageH image,
+                                 lt_uint32 recordNum,
+                                 const char** tag,
+                                 LTIMetadataDataType* datatype,
+                                 lt_uint32* numDims,
+                                 const lt_uint32** dims,
+                                 const void** data);
+
+#ifdef LT_CPLUSPLUS
+}
+#endif
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif
diff --git a/src/DSDK/include/filters/lti_bandSelectFilter.h b/src/DSDK/include/filters/lti_bandSelectFilter.h
new file mode 100644
index 0000000..45f8302
--- /dev/null
+++ b/src/DSDK/include/filters/lti_bandSelectFilter.h
@@ -0,0 +1,208 @@
+/* $Id: lti_bandSelectFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_BANDSELECTFILTER_H
+#define LTI_BANDSELECTFILTER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+/**
+ * combine N different bands from M images into one N-banded image
+ *
+ * This class creates a single N-banded image which is a composition of N
+ * different bands from a set of images.
+ *
+ * For example, an RGB image can be created from three (nominally grayscale)
+ * images which represent the red, green, and blue bands of a dataset.
+ * More generally, one can do things like construct a multispectral image 
+ * from 1st and 2nd bands of one image and the 3rd and 4th bands of a second
+ * image.
+ */
+class LTIBandSelectFilter : public LTIImageFilter
+{
+public:
+   /**
+    * general constructor
+    *
+    * Creates an image stage which composes the specified bands of the input images.
+    *
+    * The \a srcImages and \a srcImageBands arrays each contain \a numOutputBands
+    * elements and serve to describe the bands of the desired output image.  That is,
+    * band \a i of the output image will contain band \a srcImageBands[i] from
+    * image \a srcImages[i].
+    *
+    * An element of \a srcImages may be NULL.  In this case, however, the corresponding
+    * \a srcImageBands element must be set to (int)-'Z', indicating a band of
+    * all zeros is to be used.
+    * 
+    * At least one of the \a srcImages elements must be non-NULL.
+    *
+    * Note: Data from \a srcImages and \a srcImageBands arrays are copied locally
+    * after initialize() is called.
+    *
+    * @param  srcImages       input images, for each output band
+    * @param  srcImageBands   band numbers, for each output band
+    * @param  numOutputBands  number of output bands
+    * @param  colorSpace      the colorspace of the output image
+    * @param  takeOwnership   set to true to have the filter delete the \a sourceImages
+    */
+   LTIBandSelectFilter(LTIImageStage** srcImages,
+                       const int* srcImageBands,
+                       int numOutputBands,
+                       LTIColorSpace colorSpace,
+                       bool takeOwnership);
+
+   /**
+    * single image constructor
+    *
+    * Same as the above general constructor, except that (1) a single source
+    * image is used, instead of an array of possibly different images, and (2)
+    * the output image has the same number of bands and colorspace as the input
+    * image.
+    *
+    * (This provides compatability with the old LTISampleMapTransformer class.)
+    *
+    * @param  srcImage        input image
+    * @param  srcImageBands   band numbers, for each output band
+    * @param  numOutputBands       band numbers, for each output band
+    * @param  colorSpace      the colorspace of the output image
+    * @param  takeOwnership   set to true to have the filter delete the \a sourceImages
+    */
+   LTIBandSelectFilter(LTIImageStage* srcImage,
+                       const lt_uint16* srcImageBands,
+                       lt_uint16 numOutputBands,
+                       LTIColorSpace colorSpace,
+                       bool takeOwnership);
+
+   /**
+    * LTIColorCompositeFilter constructor
+    *
+    * Same as the above general constructor, except that (1) each source image is 
+    * either a one-banded image or NULL, and (2) the \a srcImageBands array is
+    * constructed as the form [0,1,2...].
+    *
+    * (This provides compatability with the old LTIColorCompositeFilter class.)
+    *
+    * @param  srcImages    input images
+    * @param  numOutputBands       band numbers, for each output band
+    * @param  colorSpace      the colorspace of the output image
+    * @param  takeOwnership   set to true to have the filter delete the \a sourceImages
+    */
+   LTIBandSelectFilter(LTIImageStage** srcImages,
+                       lt_uint16 numOutputBands,
+                       LTIColorSpace colorSpace,
+                       bool takeOwnership);
+
+   virtual ~LTIBandSelectFilter();
+
+   virtual LT_STATUS initialize();
+
+   virtual lt_uint32 getStripHeight() const;
+   virtual lt_int64 getPhysicalFileSize() const;
+   virtual LT_STATUS setStripHeight(lt_uint32 stripHeight);
+
+   /**
+    * parse band string
+    *
+    * Given a string such as "1,3-4,2", this function will return an array
+    * like [1,3,4,2].
+    *
+    * The formal grammar of the input string is (ignoring whitespace):
+    *   string := token? (comma token)*
+    *   token  := letter | number | number hyphen number
+    *   letter := 'Z'
+    *   number := digit+
+    *   digit  := '0' | '1' | ... '9'
+    *   comma  := ','
+    *   hyphen := '-'
+    * Note that the range may be negative, i.e. "3-1" will be returned
+    * as [3,2,1].  A band value of Z indicates a band of all zeros should
+    * be used.
+    *
+    * The caller takes ownership of the returned array.
+    *
+    * Note that the caller may need to adjust the data in the returned array
+    * to be zero-based.
+    *
+    * @param inputString  the string to parse
+    * @param bandList     returned array of band numbers
+    * @param numBands     length of bandList arrat
+    * @return status code
+    */
+   static LT_STATUS parseString(const char* inputString,
+                                lt_int32*& bandList,
+                                lt_uint16& numBands);
+
+protected:
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeEnd();
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+
+protected:
+   LT_STATUS initArrays();
+   LT_STATUS initSourceArray();
+   LT_STATUS initOutputArray();
+   int getImageNum(const LTIImageStage* ptr) const;
+   
+   enum SourcePixel
+   {
+      NodataPixel,
+      BackgroundPixel,
+      DRMinPixel,
+      DRMaxPixel
+   };
+   void remapPixel(LTIPixel& pixel, SourcePixel name) const;
+
+   LTIColorSpace m_colorSpace;         // from ctor
+   int m_numOutputBands;               // from ctor
+   LTIImageStage** m_srcImages;        // from ctor, [0..m_numOutputBands-1]
+   const int* m_srcImageBands;         // from ctor, [0..m_numOutputBands-1]
+   const lt_uint16* m_srcImageBands16;
+
+   class OutputBandDesc;
+   OutputBandDesc* m_outputBandDescs;  // [0..m_numOutputBands-1]
+
+   class InputImageDesc;
+   InputImageDesc* m_inputImageDesc;   // [0..m_numInputImages-1]
+   int m_numInputImages;
+   
+   LTIReusableBSQBuffer* m_zeroBuffer; // strip buffer holding just 0's
+   LTIReusableBSQBuffer* m_nullBuffer; // just strip buffer, for unused buffers
+
+   LTIImageStage** m_localSrcImages;
+   int* m_localSrcImageBands;
+
+private:
+   const int m_ctor;
+
+   // nope
+   LTIBandSelectFilter(const LTIBandSelectFilter&);
+   LTIBandSelectFilter& operator=(const LTIBandSelectFilter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_BANDSELECTFILTER_H
diff --git a/src/DSDK/include/filters/lti_colorTransformer.h b/src/DSDK/include/filters/lti_colorTransformer.h
new file mode 100644
index 0000000..f881014
--- /dev/null
+++ b/src/DSDK/include/filters/lti_colorTransformer.h
@@ -0,0 +1,101 @@
+/* $Id: lti_colorTransformer.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_COLORTRANSFORMER_H
+#define LTI_COLORTRANSFORMER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIReusableBSQBuffer;
+
+/**
+ * change the colorspace of the image
+ *
+ * This class changes the colorspace of the image.
+ *
+ * The supported color transforms are:
+ * \li from RGB to CMYK, GRAYSCALE, or YIQ
+ * \li from GRAYSCALE to RGB
+ * \li from CMYK to RGB, RGBK, or YIQK
+ * \li from YIQ to RGB
+ * \li from YIQK to CMYK
+ */
+class LTIColorTransformer : public LTIImageFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates an image stage with the given colorspace.  The sample values
+    * will undergo the requisite color transform function to map from the
+    * input colorspace to the output colorspace.
+    *
+    * @note The value of \a dstNumBands image is set according to the
+    * \a dstColorSpace, as is in the constructor for the LTIPixel class.
+    *
+    * @param  sourceImage    the base image
+    * @param  dstColorSpace  the colorspace of the new image
+    * @param  dstNumBands    the number of bands in the new image
+    * @param  takeOwnership  set to true to have the filter delete the \a sourceImage
+    */
+   LTIColorTransformer(LTIImageStage* sourceImage,
+                       LTIColorSpace dstColorSpace,
+                       lt_uint16 dstNumBands,
+                       bool takeOwnership);
+   virtual ~LTIColorTransformer();
+   virtual LT_STATUS initialize();
+
+protected:
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeEnd();
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+
+private:
+   bool isSupportedTransform(void) const;
+   LT_STATUS transformBuffer(LTISceneBuffer &dstData,
+                             LTISceneBuffer &srcData,
+                             lt_uint32 width,
+                             lt_uint32 height) const;
+
+   LT_STATUS transformPixel(LTIPixel &newPixel,
+                            const LTIPixel &oldPixel) const;
+
+
+   const LTIColorSpace m_dstColorSpace;
+   const lt_uint16 m_dstNumBands;
+   LTIColorSpace m_srcColorSpace;
+   lt_uint16 m_srcNumBands;
+   bool m_isIdentity;
+
+   LTIReusableBSQBuffer* m_buffer;
+
+   // nope
+   LTIColorTransformer(const LTIColorTransformer&);
+   LTIColorTransformer& operator=(const LTIColorTransformer&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_COLORTRANSFORMER_H
diff --git a/src/DSDK/include/filters/lti_cropFilter.h b/src/DSDK/include/filters/lti_cropFilter.h
new file mode 100644
index 0000000..cca1a97
--- /dev/null
+++ b/src/DSDK/include/filters/lti_cropFilter.h
@@ -0,0 +1,100 @@
+/* $Id: lti_cropFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_CROPFILTER_H
+#define LTI_CROPFILTER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+/**
+ * crops the image stage to a smaller width and height
+ *
+ * This class crops the image stage to a smaller width and height.
+ */
+class LTICropFilter : public LTIImageFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates an image stage which corresponds to a cropped subsection of the
+    * input image, according to the given offset, width, and height.
+    *
+    * @param  sourceImage    the base image
+    * @param  xOffset        x-position of the origin of the new image
+    *                        (specified relative to the input image)
+    * @param  yOffset        y-position of the origin of the new image
+    *                        (specified relative to the input image)
+    * @param  newWidth       width of the new image
+    * @param  newHeight      height of the new image
+    * @param  takeOwnership  set to true to have the filter delete the \a sourceImage
+    */
+   LTICropFilter(LTIImageStage* sourceImage,
+                 lt_int32 xOffset,
+                 lt_int32 yOffset,
+                 lt_int32 newWidth,
+                 lt_int32 newHeight,
+                 bool takeOwnership);
+   virtual ~LTICropFilter();
+   virtual LT_STATUS initialize();
+
+   LT_STATUS projectPointAtMag(double upperLeft,
+                               double mag,
+                               double& newUpperLeft) const;
+   
+   LT_STATUS projectDimAtMag(double dim,
+                             double mag,
+                             double& newDim) const;
+
+   LT_STATUS getDimsAtMag(double mag,
+                          lt_uint32& width,
+                          lt_uint32& height) const;
+
+   bool getReaderScene(const LTIScene &decodeScene, LTIScene &readerScene) const;
+   
+protected:
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeEnd();
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+
+   LT_STATUS getChildScene(const LTIScene &decodeScene, LTIScene &childScene) const;
+
+private:
+   typedef LTIImageFilter Super;
+
+   const lt_int32 m_xOffset;
+   const lt_int32 m_yOffset;
+   const lt_int32 m_newWidth;
+   const lt_int32 m_newHeight;
+
+   // nope
+   LTICropFilter(const LTICropFilter&);
+   LTICropFilter& operator=(const LTICropFilter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_CROPFILTER_H
diff --git a/src/DSDK/include/filters/lti_datatypeTransformer.h b/src/DSDK/include/filters/lti_datatypeTransformer.h
new file mode 100644
index 0000000..a2dfdcb
--- /dev/null
+++ b/src/DSDK/include/filters/lti_datatypeTransformer.h
@@ -0,0 +1,84 @@
+/* $Id: lti_datatypeTransformer.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_DATATYPETRANSFORMER_H
+#define LTI_DATATYPETRANSFORMER_H
+
+// lt_lib_mrsid_imageFilters
+#include "lti_dynamicRangeFilter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+// we support only float, uint8, uint16
+
+class LTIReusableBSQBuffer;
+
+#if defined LT_COMPILER_GCC
+#warning "** LTIDataTypeTransformer is deprecated -- use LTIDynamicRangeFilter"
+#elif defined LT_COMPILER_MS
+#pragma message( "*******************************************" )
+#pragma message( "*  LTIDataTypeTransformer is deprecated   *" )
+#pragma message( "*       use LTIDynamicRangeFilter         *" )
+#pragma message( "*******************************************" )
+#endif
+/**
+ * changes the datatype of the samples of the image
+ *
+ * This class changes the datatype of the samples of the image.
+ *
+ * The values of the samples are scaled as required to meet the range of the
+ * new datatype.
+ */
+class LTIDataTypeTransformer : public LTIDynamicRangeFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates an image stage with the given datatype.  The sample values are
+    * scaled as required to meet the range of the new datatype; that is, a
+    * value of 65535 for a 16-bit datatype will map to a value of 255 for an
+    * 8-bit datatype, and a value of 127 for an 8-bit datatype will map to
+    * a value of 32767 for a 16-bit datatype.
+    *
+    * @note Only uint8, uint16, and float32 datatypes are supported.
+    *
+    * @param  sourceImage    the base image
+    * @param  dstDataType    the datatype of the new image stage
+    * @param  takeOwnership  set to true to have the filter delete the \a sourceImage
+    */
+   LTIDataTypeTransformer(LTIImageStage* sourceImage,
+                          LTIDataType dstDataType,
+                          bool takeOwnership) :
+      LTIDynamicRangeFilter(sourceImage, dstDataType, takeOwnership)
+   {
+   }
+
+private:
+   // nope
+   LTIDataTypeTransformer(const LTIDataTypeTransformer&);
+   LTIDataTypeTransformer& operator=(const LTIDataTypeTransformer&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_DATATYPETRANSFORMER_H
diff --git a/src/DSDK/include/filters/lti_dynamicRangeFilter.h b/src/DSDK/include/filters/lti_dynamicRangeFilter.h
new file mode 100644
index 0000000..49bdcbb
--- /dev/null
+++ b/src/DSDK/include/filters/lti_dynamicRangeFilter.h
@@ -0,0 +1,148 @@
+/* $Id: lti_dynamicRangeFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_DYNAMIC_RANGE_FILTER_H
+#define LTI_DYNAMIC_RANGE_FILTER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIReusableBSQBuffer;
+
+/**
+ * change dynamic range or datatype of the samples of the image
+ *
+ * Adjusts the sample values to fit the given dynamic range and datatype.
+ */
+
+class LTIDynamicRangeFilter : public LTIImageFilter
+{
+public:
+
+   /**
+    * constructor
+    *
+    * Creates an image stage with the sample data adjusted according to the
+    * given dynamic range values.
+    *
+    * @param  sourceImage    the base image
+    * @param  srcDRMin       the min value of the sourceImage (will be mapped to the min value of dstDataType)
+    * @param  srcDRMax       the max value of the sourceImage (will be mapped to the max value of dstDataType)
+    * @param  dstDataType    the datatype of the new image stage
+    * @param  takeOwnership  set to true to have the filter delete the \a sourceImage
+    */
+   LTIDynamicRangeFilter(LTIImageStage* sourceImage,
+                         double srcDRMin,
+                         double srcDRMax,
+                         LTIDataType dstDataType,
+                         bool takeOwnership);
+
+   /**
+    * constructor (for compatibly with old LTIDynamicRangeFilter)
+    *
+    * Creates an image stage with the sample data adjusted according to the
+    * given dynamic range values.
+    *
+    * @param  sourceImage    the base image
+    * @param  window         the number of units or "width" of the desired range
+    * @param  level          the midpoint of the window; this effectively defines
+    *                        the min and max sample values
+    * @param  takeOwnership  set to true to have the filter delete the \a sourceImage
+    */
+   LTIDynamicRangeFilter(LTIImageStage* sourceImage,
+                         double window,
+                         double level,
+                         bool takeOwnership);
+
+   /**
+   * constructor  (for compatibly with old LTIDynamicRangeFilter)
+   *
+   * Creates an image stage with the sample data adjusted according to the
+   * dynamic range values inherit in the image, e.g. in the metadata.
+   *
+   * @param  sourceImage    the base image
+   * @param  takeOwnership  set to true to have the filter delete the \a sourceImage
+   */
+   LTIDynamicRangeFilter(LTIImageStage* sourceImage,
+                         bool takeOwnership);
+
+   /**
+    * constructor  (for compatibly with LTIDataTypeTransformer)
+    *
+    * Creates an image stage with the given datatype.  The sample values are
+    * scaled as required to meet the range of the new datatype; that is, a
+    * value of 65535 for a 16-bit datatype will map to a value of 255 for an
+    * 8-bit datatype, and a value of 127 for an 8-bit datatype will map to
+    * a value of 32767 for a 16-bit datatype.
+    *
+    * @note Only uint8, uint16, and float32 datatypes are supported.
+    *
+    * @param  sourceImage    the base image
+    * @param  dstDataType    the datatype of the new image stage
+    * @param  takeOwnership  set to true to have the filter delete the \a sourceImage
+    */
+   LTIDynamicRangeFilter(LTIImageStage* sourceImage,
+                         LTIDataType dstDataType,
+                         bool takeOwnership);
+
+   virtual ~LTIDynamicRangeFilter(void);
+   virtual LT_STATUS initialize(void);
+
+   LT_STATUS setSrcMinMax(double srcMin, double srcMax);
+   LT_STATUS setDstMinMax(double dstMin, double dstMax);
+
+   static double getValue(const LTIPixel &pixel);
+   
+protected:
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeEnd();
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer,
+                         const LTIScene& stripScene);
+
+private:
+   LT_STATUS transformBuffer(LTISceneBuffer &dstData,
+                             LTISceneBuffer &srcData,
+                             lt_uint32 numCols,
+                             lt_uint32 numRows) const;
+   LT_STATUS transformPixel(LTIPixel &newPixel,
+                            const LTIPixel &oldPixel) const;
+
+   const LTIDataType m_dstDataType;
+   const LTIDataType m_srcDataType;
+   
+   double m_srcMin;
+   double m_srcMax;
+   double m_dstMin;
+   double m_dstMax;
+
+   LTIReusableBSQBuffer* m_buffer;
+
+   // nope
+   LTIDynamicRangeFilter(const LTIDynamicRangeFilter &);
+   LTIDynamicRangeFilter &operator=(const LTIDynamicRangeFilter &);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_DYNAMIC_RANGE_FILTER_H
diff --git a/src/DSDK/include/filters/lti_embeddedImage.h b/src/DSDK/include/filters/lti_embeddedImage.h
new file mode 100644
index 0000000..74e96e8
--- /dev/null
+++ b/src/DSDK/include/filters/lti_embeddedImage.h
@@ -0,0 +1,148 @@
+/* $Id: lti_embeddedImage.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_EMBEDDEDIMAGE_H
+#define LTI_EMBEDDEDIMAGE_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+#include "lti_scene.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIReusableBSQBuffer;
+
+/**
+ * create a larger frame for the image
+ *
+ * Creates a new image stage of the given size, containing the input image
+ * stage within it.
+ *
+ * This class is used to make an image stage "larger", e.g. to place an image
+ * on a larger "canvas" for more flexible decoding.  This class is used
+ * by the LTIMosaicFilter class to simplify certain computations by making
+ * all the input images map to the same underlying grid shape and size.
+ *
+ * The embedding process honors the background and nodata pixel settings.
+ *
+ * The LTIGeoCoord information for the image stage is updated appropriately.
+ */
+class LTIEmbeddedImage : public LTIImageFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates an image stage whose input image is placed within a much larger
+    * empty canvas.
+    *
+    * @param  sourceImage      the base image
+    * @param  newWidth         the width of the new image stage
+    * @param  newHeight        the height of the new image stage
+    * @param  xOffset          pixel x-position of the input image in the new image
+    * @param  yOffset          pixel y-position of the input image in the new image
+    * @param  backgroundPixel  background pixel color to use for the new image
+    *                          (may be NULL, in which case the input image's
+    *                          background is used)
+    * @param  nodataPixel      nodata pixel color to use for the new image
+    *                          (may be NULL, in which case the input image's
+    *                          nodata is used)
+    * @param takeOwnership    set to true to have the filter delete the \a sourceImage
+    */
+   LTIEmbeddedImage(LTIImageStage* sourceImage,
+                    lt_int32 newWidth,
+                    lt_int32 newHeight,
+                    double xOffset,
+                    double yOffset,
+                    const LTIPixel* backgroundPixel,
+                    const LTIPixel* nodataPixel,
+                    bool takeOwnership);
+
+   virtual ~LTIEmbeddedImage();
+   virtual LT_STATUS initialize();
+
+   virtual lt_int64 getEncodingCost(const LTIScene& scene) const;
+
+   LT_STATUS setFillingBackground(bool fill);
+   bool getFillingBackground(void) const;
+   
+   LT_STATUS setUsingFuzzyNoData(bool fuzzy);
+   bool getUsingFuzzyNoData(void) const;
+
+   LT_STATUS projectPointAtMag(double upperLeft,
+                               double mag,
+                               double& newUpperLeft) const;
+   
+   LT_STATUS projectDimAtMag(double dim,
+                             double mag,
+                             double& newDim) const;
+
+   LT_STATUS getDimsAtMag(double mag,
+                          lt_uint32& width,
+                          lt_uint32& height) const;
+
+
+   bool getReaderScene(const LTIScene &decodeScene, LTIScene &readerScene) const;
+
+   double getChildXPosAtMag(double mag) const;
+   double getChildYPosAtMag(double mag) const;
+   bool getChildScene(const LTIScene &parentScene, LTIScene &childScene) const;
+
+   LT_STATUS setWorkBuffer(LTIReusableBSQBuffer *buffer);
+protected:
+   virtual LT_STATUS decodeBegin(const LTIScene& scene);
+   virtual LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer,
+                                 const LTIScene& stripScene);
+   virtual LT_STATUS decodeEnd();
+
+
+private:
+   typedef LTIImageFilter Super;
+
+   LTIGeoCoord* m_fullGeoCoord;
+   lt_int32 m_fullWidth;
+   lt_int32 m_fullHeight;
+   double m_childXPos_P;
+   double m_childYPos_P;
+   
+   LTIScene m_parentScene;
+   LTIScene m_childScene;
+   bool m_haveAnything;
+   lt_int32 m_firstStrip;
+   lt_int32 m_lastStrip;
+
+   LTIPixel* m_userBackgroundPixel;
+   LTIPixel* m_userNodataPixel;
+
+   LTIReusableBSQBuffer* m_workBuffer;
+   bool m_ownWorkBuffer;
+   bool m_fillingBackground;
+   bool m_usingFuzzyNoData;
+
+   // nope
+   LTIEmbeddedImage(const LTIEmbeddedImage&);
+   LTIEmbeddedImage& operator=(const LTIEmbeddedImage&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_EMBEDDEDIMAGE_H
diff --git a/src/DSDK/include/filters/lti_filtersStatus.h b/src/DSDK/include/filters/lti_filtersStatus.h
new file mode 100644
index 0000000..9669ccd
--- /dev/null
+++ b/src/DSDK/include/filters/lti_filtersStatus.h
@@ -0,0 +1,99 @@
+/* $Id: lti_filtersStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_FILTERSSTATUS_H
+#define LTI_FILTERSSTATUS_H
+
+#include "lt_base.h"
+
+#define LTI_STS_Filters_Base                          50200
+LT_STATUSSTRING_ADD(LTI_STS_Filters_Base, "lt_lib_mrsid_imageFilters base")
+
+#define LTI_STS_Filters_UnsupDataType                 50201
+LT_STATUSSTRING_ADD(LTI_STS_Filters_UnsupDataType, "unsupported datatype")
+
+#define LTI_STS_Filters_UnsupColorTransform           50202
+LT_STATUSSTRING_ADD(LTI_STS_Filters_UnsupColorTransform, "unsupported colorspace transform")
+
+#define LTI_STS_Filters_InvalidArgument               50203
+LT_STATUSSTRING_ADD(LTI_STS_Filters_InvalidArgument, "invalid argument")
+
+#define LTI_STS_Filters_UnsupDataTypeTransform        50204
+LT_STATUSSTRING_ADD(LTI_STS_Filters_UnsupDataTypeTransform, "unsupported datatype transform")
+
+#define LTI_STS_Filters_MosaicIncompatPixelProps      50205
+LT_STATUSSTRING_ADD(LTI_STS_Filters_MosaicIncompatPixelProps, "incompatible pixel properties - bit-depth, colorspace, etc")
+
+#define LTI_STS_Filters_MosaicIncompatXRes            50206
+LT_STATUSSTRING_ADD(LTI_STS_Filters_MosaicIncompatXRes, "incompatible X resolutions")
+
+#define LTI_STS_Filters_MosaicIncompatYRes            50207
+LT_STATUSSTRING_ADD(LTI_STS_Filters_MosaicIncompatYRes, "incompatible Y resolutions")
+
+#define LTI_STS_Filters_WatermarkTooBig               50208
+LT_STATUSSTRING_ADD(LTI_STS_Filters_WatermarkTooBig, "watermark too big")
+
+#define LTI_STS_Filters_InvalidSampleMap              50209
+LT_STATUSSTRING_ADD(LTI_STS_Filters_InvalidSampleMap, "invalid sample map")
+
+#define LTI_STS_Filters_InvalidEmbedding              50210
+LT_STATUSSTRING_ADD(LTI_STS_Filters_InvalidEmbedding, "invalid embedding")
+
+#define LTI_STS_Filters_InvalidComposition            50211
+LT_STATUSSTRING_ADD(LTI_STS_Filters_InvalidComposition, "invalid composition inputs")
+
+#define LTI_STS_Filters_MosaicIncompatXResMulti       50212
+LT_STATUSSTRING_ADD(LTI_STS_Filters_MosaicIncompatXResMulti, "incompatible X resolutions - not scalable")
+
+#define LTI_STS_Filters_MosaicIncompatYResMulti       50213
+LT_STATUSSTRING_ADD(LTI_STS_Filters_MosaicIncompatYResMulti, "incompatible Y resolutions - not scalable")
+
+#define LTI_STS_Filters_MosaicIncompatXYResMulti      50214
+LT_STATUSSTRING_ADD(LTI_STS_Filters_MosaicIncompatXYResMulti, "incompatible X/Y resolutions - not scalable")
+
+#define LTI_STS_Filters_UnsupColorSpace               50215
+LT_STATUSSTRING_ADD(LTI_STS_Filters_UnsupColorSpace, "unsupported colorspace")
+
+#define LTI_STS_Filters_AllocFailed                   50216
+LT_STATUSSTRING_ADD(LTI_STS_Filters_AllocFailed, "memory allocation failed")
+
+#define LTI_STS_Filters_BandAidStringFormat           50230
+LT_STATUSSTRING_ADD(LTI_STS_Filters_BandAidStringFormat, "bad format or syntax error of band string")
+
+#define LTI_STS_Filters_BandAidBandNum                50231
+LT_STATUSSTRING_ADD(LTI_STS_Filters_BandAidBandNum, "illegal band number")
+
+#define LTI_STS_Filters_InvalidScene                  50232
+LT_STATUSSTRING_ADD(LTI_STS_Filters_InvalidScene, "invalid or empty scene specified")
+
+#define LTI_STS_Filters_FileCacheZeroFill             50233
+LT_STATUSSTRING_ADD(LTI_STS_Filters_FileCacheZeroFill, "could not zero fill cache file (disc space)")
+
+#define LTI_STS_Filters_FileCacheWriteError           50234
+LT_STATUSSTRING_ADD(LTI_STS_Filters_FileCacheWriteError, "cache file write error")
+
+#define LTI_STS_Filters_FileCacheReadError            50235
+LT_STATUSSTRING_ADD(LTI_STS_Filters_FileCacheReadError, "cache file read error")
+
+#define LTI_STS_Filters_MaskPixelMismatch             50236
+LT_STATUSSTRING_ADD(LTI_STS_Filters_MaskPixelMismatch, "mask pixel mismatch")
+
+#define LTI_STS_Filters_UnsupHistogramVersion         50237
+LT_STATUSSTRING_ADD(LTI_STS_Filters_UnsupHistogramVersion, "unsupported histogram version")
+
+#define LTI_STS_Filters_PixelCacheInterrupt				50238
+LT_STATUSSTRING_ADD(LTI_STS_Filters_PixelCacheInterrupt, "decode operation interrupted")
+
+#define LTI_STS_Filters_Max                           50299
+LT_STATUSSTRING_ADD(LTI_STS_Filters_Max, "lt_lib_mrsid_imageFilters max")
+
+#endif // LTI_FILTERSSTATUS_H
diff --git a/src/DSDK/include/filters/lti_mosaicFilter.h b/src/DSDK/include/filters/lti_mosaicFilter.h
new file mode 100644
index 0000000..a683d27
--- /dev/null
+++ b/src/DSDK/include/filters/lti_mosaicFilter.h
@@ -0,0 +1,184 @@
+/* $Id: lti_mosaicFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_MOSAICFILTER_H
+#define LTI_MOSAICFILTER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+#include "lti_imageStageManager.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIRTree;
+class LTIEmbeddedImage;
+class LTIReusableBSQBuffer;
+
+/**
+ * create a single mosaicked image from a set of images
+ *
+ * This class create a single mosaicked image from a set of images.
+ *
+ * The set of input images are all assumed to be in the same coordinate
+ * space.  In general, all the images must have the same resolution;
+ * differences that are within a small epsilon or exactly a power of two
+ * are optionally allowed.
+ */
+class LTIMosaicFilter : public LTIImageFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates an image stage which is a mosaic of the set of input images.
+    *
+    * The "res correct" feature allows images with slightly different
+    * resolutions to be mosaicked.  This allows for proper handling of
+    * situations where one image has a resolution of 0.5000 and another has a
+    * resolution of 0.4999.
+    *
+    * The "multires" feature allows images whose resolutions which differ by
+    * a power of two to be mosaicked together.  (The LTIStaticZoomFilter class
+    * is used to implement this feature.)
+    *
+    * NoData and background pixel settings are honored by the mosaic process.
+    *
+    * @param  imageStageManager ?????
+    * @param  backgroundPixel   color of the background pixel for the new image stage
+    * @param  useResCorrect     allow images to have slightly different resolutions
+    * @param  useMultires       allow images whose resolutions differ by a power of two
+    * @param  takeOwnership     set to true to have the filter delete the \a sourceImage
+    */
+   LTIMosaicFilter(LTIImageStageManager *imageStageManager,
+                   const LTIPixel* backgroundPixel,
+                   bool useResCorrect,
+                   bool useMultires,
+                   bool takeOwnership);
+   virtual ~LTIMosaicFilter();
+   virtual LT_STATUS initialize();
+
+   void setUsingFuzzyNoData(bool fuzzy);
+   bool getUsingFuzzyNoData(void) const;
+
+   void setDeleteImages(bool deleteImages);
+   bool getDeleteImages(void) const;
+
+   lt_int64 getPhysicalFileSize() const;
+
+   lt_uint32 getStripHeight() const;
+   LT_STATUS setStripHeight(lt_uint32 stripHeight);
+
+   lt_int64 getEncodingCost(const LTIScene& scene) const;
+
+   LT_STATUS projectPointAtMag(double upperLeft,
+                               double mag,
+                               double& newUpperLeft) const;
+   
+   LT_STATUS projectDimAtMag(double dim,
+                             double mag,
+                             double& newDim) const;
+
+   LT_STATUS getDimsAtMag(double mag,
+                          lt_uint32& width,
+                          lt_uint32& height) const;
+
+   bool getReaderScene(const LTIScene &decodeScene, LTIScene &readerScene) const;
+
+   bool getReaderScene(lt_uint32 child,
+                       const LTIScene &decodeScene,
+                       LTIScene &mosaicScene,
+                       LTIScene &readerScene) const;
+#if 1
+   class InSceneCallback
+   {
+   public:
+      virtual LT_STATUS found(const LTIScene &scene,
+                              lt_uint32 imageNum,
+                              LTIEmbeddedImage &embedded,
+                              LTIImageStage &image) = 0;   
+   };
+
+   LT_STATUS forEachImageStageInScene(const LTIScene &scene,
+                                      InSceneCallback &callback);
+#endif
+   /**
+    * Check if a set of images can be mosaicked together.  The parameters to
+    * this function mirror those of the constructor: this function will
+    * return LT_STS_Success if and only if the images' resolutions are such
+    * that a mosaic can be produced.
+    *
+    * @param  imageStageManager ?????
+    * @param  useResCorrect    allow images to have slightly different resolutions
+    * @param  useMultires      allow images whose resolutions differ by a power of two
+    * @return status code indicating success or failure
+    */
+   static LT_STATUS checkResolutionConformance(LTIImageStageManager *imageStageManager,
+                                               bool useResCorrect,
+                                               bool useMultires);
+
+   // these functions are used the Callbacks
+   LT_STATUS loadImage(lt_uint32 i,
+                       LTIEmbeddedImage *&embedded,
+                       LTIImageStage *&raw);
+
+   LT_STATUS closeImage(lt_uint32 i);
+
+protected:
+   virtual LT_STATUS decodeBegin(const LTIScene& scene);
+   virtual LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+   virtual LT_STATUS decodeEnd();
+
+   LT_STATUS buildRTree(LTIImageStageManager &imageStageManager,
+                        LTIMetadataDatabase &metadata);
+
+private:
+   class ListImageStagesInSceneCallback;
+
+   LTIImageStageManager *m_imageStageManager;
+   LTIPixel* m_userBackgroundPixel;
+   bool m_useResCorrect;
+   bool m_useMultires;
+
+   lt_int64 m_physicalFileSize;
+
+   LTIRTree *m_rtree;
+
+   // open image book keeping
+   LTIImageStage **m_rImage;
+   LTIImageStage **m_fImage;
+   int *m_sImage;
+   bool m_fuzzyNoData;
+   bool m_deleteImages;
+   lt_uint32 m_stripHeight;
+   LTIPixel *m_zeroPixel;
+   LTIReusableBSQBuffer *m_workBuffer;
+
+   // imageInScene
+   lt_uint32 *m_inSceneList;
+
+   // nope
+   LTIMosaicFilter(const LTIMosaicFilter&);
+   LTIMosaicFilter& operator=(const LTIMosaicFilter&);
+};
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_MOSAICFILTER_H
diff --git a/src/DSDK/include/filters/lti_multiresFilter.h b/src/DSDK/include/filters/lti_multiresFilter.h
new file mode 100644
index 0000000..394ef5b
--- /dev/null
+++ b/src/DSDK/include/filters/lti_multiresFilter.h
@@ -0,0 +1,161 @@
+/* $Id: lti_multiresFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_MULTIRESFILTER_H
+#define LTI_MULTIRESFILTER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+#include "lti_scene.h"
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTIResampler;
+
+/**
+ * add resolutions to the image
+ *
+ * Extends the magnification range of an image, to allow decodes at different
+ * resolutions than the image stage would normally allow.
+ *
+ * Note that this class is not the same as at the LTIStaticZoomFilter class,
+ * which scales the magnification statically for the pipeline when initially
+ * constructed.  This class allows for the zoom level to be extended for an
+ * individual decode operation.
+ */
+class LTIMultiResFilter : public LTIImageFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates an image stage which can be decoded at arbitrary magnifications.
+    *
+    * Normally image stages will only support a limited set of magnification
+    * values for the LTIScene passed to LTIImageStage::read() -- often, only
+    * 1.0.  This class will perform any needed resampling on the fly so that
+    * arbitrary (power-of-two) magnifications are supported.
+    *
+    * @param  sourceImage     the base image
+    * @param takeOwnership    set to true to have the filter delete the \a sourceImage
+    */
+   LTIMultiResFilter(LTIImageStage* sourceImage, bool takeOwnership);
+   LTIMultiResFilter(LTIImageStage* sourceImage,
+                     double deltaMag,
+                     double minMag,
+                     double maxMag,
+                     bool takeOwnership);
+   
+   virtual ~LTIMultiResFilter();
+   virtual LT_STATUS initialize();
+   
+   LT_STATUS setResampleMethod(LTIResampleMethod resampleMethod);
+
+   virtual lt_int64 getEncodingCost(const LTIScene& scene) const;
+
+   LT_STATUS projectPointAtMag(double upperLeft,
+                               double mag,
+                               double& newUpperLeft) const;
+   
+   LT_STATUS projectDimAtMag(double dim,
+                             double mag,
+                             double& newDim) const;
+
+   LT_STATUS getDimsAtMag(double mag,
+                          lt_uint32& width,
+                          lt_uint32& height) const;
+
+
+   bool getReaderScene(const LTIScene &decodeScene,
+                       LTIScene &readerScene) const;
+
+
+   // call this before initialize() if you want non-sq. pixels
+   // (the deltaMag in the constructor is ignored)
+   void setDeltaMagXY(double deltaMagX, double deltaMagY);
+
+   static double magForIcon(const LTIImageStage &image,
+                            lt_uint32 iconSize);
+
+protected:
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer,
+                         const LTIScene& stripScene);
+   LT_STATUS decodeEnd();
+
+
+   enum Mode
+   {
+      MODE_INVALID,
+      MODE_RESAMPLE,
+      MODE_PASSTHROUGH,
+      MODE_DOWNSAMPLE_FULLREAD,
+      MODE_ALL_AT_ONCE
+   };
+
+   bool getChildScene(const LTIScene &scene,
+                      Mode &mode,
+                      double &scaleX,
+                      double &scaleY,
+                      LTIScene &childScene) const;
+   
+   enum
+   {
+      // The largest possible mag is based on the 2gb
+      // scene limitation. Thus the largest scene we
+      // should ever expect is approximately the square
+      // root of (2gb / 3) pixels on a  side. If we
+      // assume the smallest image we'll ever encounter
+      // is 32x32 then the largest magnification can
+      // be calculated. It's big, but we need a real number!
+      kMaxMagnification = 512   // 51200% zoom!
+   };
+
+private:
+   struct StripCache;
+
+   double m_mrMinMag;
+   double m_mrMaxMag;
+   double m_deltaMagX;
+   double m_deltaMagY;
+
+   Mode m_mode;
+   double m_scaleX;
+   double m_scaleY;
+   LTIScene m_childScene;
+   double m_curY;
+   
+   lt_int32 m_childStrip;
+   lt_int32 m_myStrip;
+
+   StripCache *m_stripCache0;
+   StripCache *m_stripCache1;
+   
+   LTIResampler *m_resampler;
+
+   // nope
+   LTIMultiResFilter(const LTIMultiResFilter&);
+   LTIMultiResFilter& operator=(const LTIMultiResFilter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_MULTIRESFILTER_H
diff --git a/src/DSDK/include/filters/lti_staticZoomFilter.h b/src/DSDK/include/filters/lti_staticZoomFilter.h
new file mode 100644
index 0000000..a57c2f4
--- /dev/null
+++ b/src/DSDK/include/filters/lti_staticZoomFilter.h
@@ -0,0 +1,79 @@
+/* $Id: lti_staticZoomFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_STATICZOOMFILTER_H
+#define LTI_STATICZOOMFILTER_H
+
+// lt_lib_mrsid_imageFilter
+#include "lti_multiresFilter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+/**
+ * magnifies the image by a fixed amount
+ *
+ * This class magnifies the image by a fixed amount.  In effect this simply changes the
+ * width and height of the image statically, i.e. for the life of the
+ * pipeline.  The resampling is performed internally by the LTIMultiresFilter
+ * class.
+ */
+class LTIStaticZoomFilter : public LTIMultiResFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * Magnifies the image by the scale factor given.  The image width, height,
+    * geographic resolution, etc, are all updated accordingly.
+    *
+    * A positive scale factor performs a "res-up" operation, while a negative
+    * scale factor will reduce the image.  That is, a scale factor of 2 will
+    * double the image size, e.g. from a magnification of 1.0 to 2.0, while a
+    * scale factor of -2 will halve the image size, e.g. from a magnification
+    * of 1.0 to 0.5.
+    * 
+    * @param  sourceImage   the base image
+    * @param  scaleFactor    the integer scale factor
+    * @param takeOwnership  set to true to have the filter delete the \a sourceImage
+    */
+   LTIStaticZoomFilter(LTIImageStage* sourceImage,
+                       lt_int8 scaleFactor,
+                       bool takeOwnership);
+
+   LTIStaticZoomFilter(LTIImageStage* sourceImage,
+                       double deltaMag,
+                       double minMag,
+                       double maxMag,
+                       bool takeOwnership);
+   
+protected:
+
+private:
+
+   // nope
+   LTIStaticZoomFilter(const LTIStaticZoomFilter&);
+   LTIStaticZoomFilter& operator=(const LTIStaticZoomFilter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_STATICZOOMFILTER_H
diff --git a/src/DSDK/include/filters/lti_statisticsFilter.h b/src/DSDK/include/filters/lti_statisticsFilter.h
new file mode 100644
index 0000000..d71db80
--- /dev/null
+++ b/src/DSDK/include/filters/lti_statisticsFilter.h
@@ -0,0 +1,95 @@
+/* $Id: lti_statisticsFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_STATISTICSFILTER_H
+#define LTI_STATISTICSFILTER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+/**
+ * collects basic numeric statistics about the image's samples
+ *
+ * This class collects basic numeric statistics about the image's samples.  The data
+ * collected includes the minimum, maximum, mean, and standard deviation of
+ * the samples for each band.
+ *
+ * This filter does not change the image or its properties in any way.
+ */
+class LTIStatisticsFilter : public LTIImageFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates a pass-through image stage 
+    *
+    * The \a edgePadding argument is used to specify the distance (in pixels)
+    * between the watermark and the edge of the base image specified by the \a
+    * position argument.  (This argument is ignored if LTI_POSITION_CENTER is
+    * used.)
+    *
+    * @param  sourceImage     the base image
+    * @param takeOwnership    set to true to have the filter delete the \a sourceImage
+    */
+   LTIStatisticsFilter(LTIImageStage* sourceImage,
+                       bool takeOwnership);
+   virtual ~LTIStatisticsFilter();
+   virtual LT_STATUS initialize();
+
+   void getStats(const double*& minPixel,
+                 const double*& maxPixel,
+                 const double*& meanPixel,
+                 const double*& stdDeviation,
+                 lt_uint32& numPixels) const;
+
+   void clearStats();
+
+protected:
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeEnd();
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+
+private:
+   typedef LTIImageFilter Super;
+
+   void updateStats();
+
+   lt_uint32 m_numPixels;
+   double* m_minPixel;
+   double* m_maxPixel;
+   double* m_sumPixel;
+   double* m_sumSquaredPixel;
+   double* m_meanPixel;
+   double* m_variancePixel;
+   double* m_stdDeviationPixel;
+
+   // nope
+   LTIStatisticsFilter(const LTIStatisticsFilter&);
+   LTIStatisticsFilter& operator=(const LTIStatisticsFilter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_STATISTICSFILTER_H
diff --git a/src/DSDK/include/filters/lti_translationFilter.h b/src/DSDK/include/filters/lti_translationFilter.h
new file mode 100644
index 0000000..ea41ea6
--- /dev/null
+++ b/src/DSDK/include/filters/lti_translationFilter.h
@@ -0,0 +1,80 @@
+/* $Id: lti_translationFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_TRANSLATIONFILTER_H
+#define LTI_TRANSLATIONFILTER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+#include "lti_geoCoord.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+/**
+ * translates (moves) the geo coordinates of the image
+ *
+ * This class translates (moves) the geo coordinates of the image.
+ */
+class LTITranslationFilter : public LTIImageFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * This class shifts the geographic coordinates of the image by the given
+    * amount.
+    *
+    * @param  sourceImage   the base image
+    * @param  xOffset       amount to shift in the X direction
+    * @param  yOffset       amount to shift in the Y direction
+    * @param takeOwnership  set to true to have the filter delete the \a sourceImage
+    */
+   LTITranslationFilter(LTIImageStage* sourceImage,
+                        double xOffset,
+                        double yOffset,
+                        bool takeOwnership);
+
+   LTITranslationFilter(LTIImageStage* sourceImage,
+                        const LTIGeoCoord &geoCoord,
+                        bool takeOwnership);
+
+   virtual ~LTITranslationFilter();
+   virtual LT_STATUS initialize();
+
+protected:
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeEnd();
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+
+private:
+   typedef LTIImageFilter Super;
+
+   LTIGeoCoord m_newGeoCoord;
+
+   // nope
+   LTITranslationFilter(const LTITranslationFilter&);
+   LTITranslationFilter& operator=(const LTITranslationFilter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_TRANSLATIONFILTER_H
diff --git a/src/DSDK/include/filters/lti_viewerImageFilter.h b/src/DSDK/include/filters/lti_viewerImageFilter.h
new file mode 100644
index 0000000..9940e02
--- /dev/null
+++ b/src/DSDK/include/filters/lti_viewerImageFilter.h
@@ -0,0 +1,94 @@
+/* $Id: lti_viewerImageFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTIVIEWERIMAGEFILTER_H
+#define LTIVIEWERIMAGEFILTER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+/**
+ * performs datatype and colorspace transforms on an image to make it displayable
+ *
+ * This class wraps the LTIDataType, LTIColorTransformer, and
+ * LTIDynamicRangeFilter classes in order to transform the input image into
+ * an unsigned 8-bit datatype with colorspace greyscale or RGB, as is required
+ * by most display engines.
+ */
+class LTIViewerImageFilter : public LTIImageFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * Transforms the input image to unsigned 8-bit samples and a colorspace
+    * of either greyscale or RGB.  This allows the image's pixels to be more
+    * easily passed to command rendering engines.
+    *
+    * The class also allows for the dynamic range of the image to be adjusted
+    * to make the image's histogram fit the datatype width.  RGB pixels can
+    * also be remapped to be in BGR format (as is required for Windows
+    * bitmaps).
+    *
+    * @param  sourceImage      the input image
+    * @param  useDynamicRange  if set, the image data will be scaled
+    *                          according to the dynamic range metadata in the
+    *                          image (if any)
+    * @param  useBGR           if set, RGB samples will be remapped to BGR
+    *                          format
+    * @param takeOwnership     set to true to have the filter delete the \a
+    *                          sourceImage
+    */
+   LTIViewerImageFilter(LTIImageStage* sourceImage,
+                        bool useDynamicRange,
+                        bool useBGR,
+                        bool takeOwnership);
+   virtual ~LTIViewerImageFilter();
+   virtual LT_STATUS initialize();
+
+protected:
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeEnd();
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+
+private:
+   typedef LTIImageFilter Super;
+
+   LTIImageFilter* m_drTransform;
+   LTIImageFilter* m_csTransform;
+   LTIImageFilter* m_mapTransform;
+   LTIImageStage* m_lastStage;
+
+   bool m_useBGR;
+   bool m_useDynamicRange;
+
+   // nope
+   LTIViewerImageFilter(const LTIViewerImageFilter&);
+   LTIViewerImageFilter& operator=(const LTIViewerImageFilter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTIVIEWERIMAGEFILTER_H
diff --git a/src/DSDK/include/filters/lti_watermarkFilter.h b/src/DSDK/include/filters/lti_watermarkFilter.h
new file mode 100644
index 0000000..b7c1f3f
--- /dev/null
+++ b/src/DSDK/include/filters/lti_watermarkFilter.h
@@ -0,0 +1,97 @@
+/* $Id: lti_watermarkFilter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_WATERMARKFILTER_H
+#define LTI_WATERMARKFILTER_H
+
+// lt_lib_mrsid_core
+#include "lti_imageFilter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIEmbeddedImage;
+
+/**
+ * insert a watermark image onto an image
+ *
+ * Inserts a watermark image onto the current image stage.
+ */
+class LTIWatermarkFilter : public LTIImageFilter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates an image stage with the \a watermarkImage overlaid over the \a
+    * sourceImage at the position specified.
+    *
+    * The \a edgePadding argument is used to specify the distance (in pixels)
+    * between the watermark and the edge of the base image specified by the \a
+    * position argument.  (This argument is ignored if LTI_POSITION_CENTER is
+    * used.)
+    *
+    * @param  sourceImage     the base image
+    * @param  watermarkImage  the watermark to be overlaid
+    * @param  position        where to insert the watermark
+    * @param  edgePadding     distance (in pixels) between the watermark and
+    *                         the base image
+    * @param  takeOwnershipWM  set to true to have the filter delete the \a watermarkImage
+    * @param  takeOwnership   set to true to have the filter delete the \a sourceImage
+    */
+   LTIWatermarkFilter(LTIImageStage* sourceImage,
+                      LTIImageStage* watermarkImage,
+                      LTIPosition position,
+                      lt_uint32 edgePadding,
+                      bool takeOwnershipWM,
+                      bool takeOwnership);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIWatermarkFilter();
+
+   virtual LT_STATUS initialize();
+
+protected:
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeEnd();
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+
+private:
+   typedef LTIImageFilter Super;
+
+   LT_STATUS checkImpedance() const;
+
+   LTIImageStage* m_rawWatermark;
+   LTIEmbeddedImage* m_embeddedWatermark;
+   lt_uint32 m_edgePadding;
+   LTIPosition m_position;
+   bool m_takeOwnershipWM;
+
+   // nope
+   LTIWatermarkFilter(const LTIWatermarkFilter&);
+   LTIWatermarkFilter& operator=(const LTIWatermarkFilter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_WATERMARKFILTER_H
diff --git a/src/DSDK/include/j2k_readers/J2KImageReader.h b/src/DSDK/include/j2k_readers/J2KImageReader.h
new file mode 100644
index 0000000..0582ec3
--- /dev/null
+++ b/src/DSDK/include/j2k_readers/J2KImageReader.h
@@ -0,0 +1,304 @@
+/* $Id: J2KImageReader.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef J2KIMAGEREADER_H
+#define J2KIMAGEREADER_H
+
+// lt_lib_mrsid_core
+#include "lti_geoImageReader.h"
+
+// lt_lib_mrsid_j2k
+#include "j2k_types.h"
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTFileSpec;
+class LTIOStreamInf;
+class Jpeg2000ReaderManager;
+class Jpeg2000Reader;
+
+
+/***!!! ONLY FOR BACKWARDS COMPAT !!!***/
+
+
+/**
+ * image reader for JPEG 2000 images
+ *
+ * This class provides support for reading JPEG 2000 images.
+ *
+ * @note Not all JP2/Part 1 images are supported yet.  See the release
+ * notes for details.
+ */
+class J2KImageReader : public LTIGeoImageReader
+{
+public:
+   /**
+    * constructor
+    *
+    * Create a JPEG 2000 image reader from a file.
+    *
+    * The \a isPersistent parameter is used as a performance hint
+    * to the underlying codec.  If you intend to do only one decode
+    * request from the image, you may set this value to false; this
+    * may result in improved memory usage and performance.  If multiple
+    * decode requests are to be made, the value must be set to true.
+    *
+    * The \a maxBpp parameter controls the number of bits per sample
+    * to decode from.  Values smaller than the number of bits per
+    * sample will produce lossy images, but generally the decode
+    * operations will be faster.  A value of -1.0 indicates all
+    * available bits are to be used.
+    * 
+    * The \a singleBand parameter, if set to a value other than -1, will
+    * attempt to open the image as if it contained only one band (component).
+    * Note if the YCbCr transform was used to encode the image, the band
+    * data will be returned still in the YCC colorspace; this is typically
+    * not what you want.
+    *
+    * @param  fileSpec      file to read from
+    * @param  isPersistent  set to true, unless only doing one decode request
+    * @param  maxBpp        set to number of bits per sample desired (or -1.0f for all bits)
+    * @param  useWorldFile  use world file information if available
+    * @param  singleBand    open as 1-banded image using given band number, unless -1
+    */
+   J2KImageReader(const LTFileSpec& fileSpec,
+                  bool isPersistent = true,
+                  float maxBpp = -1.0f,
+                  bool useWorldFile = true,
+                  lt_int32 singleBand = -1);
+
+   /**
+    * constructor
+    *
+    * Create a JPEG 2000 image reader from a stream.
+    *
+    * See file constructor for parameter descriptions.
+    *
+    * @param  stream        stream to read from
+    * @param  isPersistent  set to true, unless only doing one decode request
+    * @param  maxBpp        set to number of bits per sample desired (or -1.0f for all bits)
+    * @param  useWorldFile  use world file information if available
+    * @param  singleBand    open as 1-banded image using given band number, unless -1
+    */
+   J2KImageReader(LTIOStreamInf &stream,
+                  bool isPersistent = true,
+                  float maxBpp = -1.0f,
+                  bool useWorldFile = true,
+                  lt_int32 singleBand = -1);
+
+   /**
+    * destructor
+    */
+   virtual ~J2KImageReader();
+   
+   LT_STATUS initialize();
+
+   /**
+    * @name precision control
+    */
+   /*@{*/
+
+   /**
+    * control decoder use of bits of precision
+    *
+    * These functions allow the caller to control the number of bits of
+    * precision (or bits per sample) used in satisfying the decode request.
+    * 
+    * The default is to use all available bits.
+    *
+    * Note this allows for precision control on a per-decode basis.  The
+    * \a maxBpp constructor parameter performs a similar function, but
+    * sets the value for all decode operations on the image.
+    */
+   LT_STATUS setParameter_Precision(lt_uint32 precision);
+   lt_uint32 getParameter_Precision() const;
+   lt_uint32 getParameter_MinPrecision() const;
+   lt_uint32 getParameter_MaxPrecision() const;
+   lt_uint32 getParameter_DefaultPrecision() const;
+   /*@}*/
+
+   /**
+    * @name quality layer control
+    */
+   /*@{*/
+
+   /**
+    * control decoder use of quality layers 
+    *
+    * These functions allow the caller to control the number of quality
+    * layers used in satisfying the decode request.  Use of quality
+    * layers allow for "preset" compression ratios to be encoded into
+    * the image.
+    * 
+    * The default is to use all available layers).
+    */
+   LT_STATUS setParameter_Layers(lt_uint32 numLayers);
+   lt_uint32 getParameter_Layers() const;
+   lt_uint32 getParameter_MinLayers() const;
+   lt_uint32 getParameter_MaxLayers() const;
+   lt_uint32 getParameter_DefaultLayers() const;
+   /*@}*/
+
+   /**
+    * get image tile size
+    *
+    * Returns the size of the tile(s) used to encode the image, in pixels.
+    * An image that is "not tiled" is considered to be encoded as one
+    * large tile, the size of the entire image.
+    *
+    * @param width  tile width, in pixels
+    * @param height  tile height, in pixels
+    */
+   void getParameter_TileSize(int& width, int& height) const;
+   
+   /**
+    * get image precinct sizes
+    *
+    * Returns the size of the precinct(s) used to encode the image, in pixels.
+    * The data is returned as pointers to arrays, one width/height value for
+    * each of the \a numPrecincts precincts.
+    *
+    * @param widths   returned array of precincts widths, in pixels
+    * @param heights  returned array of precincts heights, in pixels
+    * @param numPrecincts  number of precincts in image (and length of \a widths / \a heights arrays)
+    */
+   void getParameter_Precincts(const int*& widths, const int*& heights, int& numPrecincts) const;
+
+   /**
+    * get image progression order
+    *
+    * Returns the progression order of the image.
+    *
+    * @return the progression order
+    */
+   J2KProgressionOrder getParameter_ProgressionOrder() const;
+   
+   /**
+    * get image codeblock size
+    *
+    * Returns the size of the codeblock used to encode the image, in pixels.
+    *
+    * @param width    codeblock width, in pixels
+    * @param height   codeblock width, in pixels
+    */
+   void getParameter_CodeblockSize(int& width, int& height) const;
+
+   /**
+    * query if 9-7 wavelet used
+    *
+    * Returns true if the image was encoded with the 9-7 wavelet.  The 9-7
+    * wavelet may give better image quality as compared to the 5-3 wavelet
+    * for a given compression ratio, however the 9-7 wavelet does not support
+    * lossless encoding.
+    *
+    * @return  true, if the 9-7 wavelet was used
+    */
+   bool getParameter_Wavelet97() const;
+
+   /**
+    * query if YCC transform is used
+    *
+    * Returns true if the RGB-YCbCr multiple component transform is
+    * used for this image.
+    *
+    * @return  true, if image encoded with YCC transform
+    */
+   bool getParameter_UsingYCbCr() const;
+
+   /**
+    * get number of resolution levels
+    *
+    * Returns the number of wavelet resolution levels encoded in the image.
+    * This is equivalent to the minimum magnification value, expressed
+    * as a power of two.
+    *
+    * @return  the number of resolution levels
+    */
+   lt_uint8 getNumLevels() const;
+
+   /**
+    * get metadata chunk
+    *
+    * This function is used to access the contents of a metadata box
+    * in the JPEG 2000 image, given a UUID.  The box contents are
+    * copied into a user-supplied stream.
+    *
+    * @param   uuid    the UUID of the box to read
+    * @param   stream  stream to receive the metadata
+    * @return  success or failure status code
+    */
+   LT_STATUS readMetadataBox(const lt_uint8* uuid, LTIOStreamInf& stream);
+
+   /**
+    * control ownership of underlying stream
+    *
+    * This function is used to change the ownership of the image stream.
+    *
+    * @param  takeOwnership    set to true to have object own the stream
+    */
+   void setStreamOwnership(bool takeOwnership);
+
+
+   // overrides
+   lt_int64 getPhysicalFileSize() const;
+   const LTFileSpec& getFileSpec() const;
+
+   LT_STATUS writeProfile(const LTFileSpec& file) const;
+
+   LT_STATUS projectPointAtMag(double upperLeft,
+                               double mag,
+                               double& newUpperLeft) const;
+   LT_STATUS projectDimAtMag(double dimension,
+                             double mag,
+                             double& newDim) const;
+   LT_STATUS getDimsAtMag(double mag,
+                          lt_uint32& width,
+                          lt_uint32& height) const;
+
+protected:
+   friend class J2KImageReaderImp;
+
+   // decode functions
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer,
+                         const LTIScene& stripScene);
+   LT_STATUS decodeEnd();
+
+private:
+   LTFileSpec* m_fileSpec;
+   LTIOStreamInf* m_stream;
+   bool m_ownsStream;
+   const bool m_ctor_isPersistent;
+   const float m_ctor_maxBpp;
+   const lt_int32 m_ctor_singleBand;
+
+   Jpeg2000ReaderManager* m_manager;
+   Jpeg2000Reader* m_reader;
+
+   // nope
+   J2KImageReader(J2KImageReader&);
+   J2KImageReader& operator=(const J2KImageReader&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // J2KIMAGEREADER_H
diff --git a/src/DSDK/include/j2k_readers/NITFImageManager.h b/src/DSDK/include/j2k_readers/NITFImageManager.h
new file mode 100644
index 0000000..3f84ee1
--- /dev/null
+++ b/src/DSDK/include/j2k_readers/NITFImageManager.h
@@ -0,0 +1,246 @@
+/* $Id: NITFImageManager.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef NITFIMAGEMANAGER_H
+#define NITFIMAGEMANAGER_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// lt_lib_mrsid_core
+#include "lti_geoImageReader.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTFileSpec;
+class LTIOStreamInf;
+
+class NITFImageReader;
+
+class NITFFileHeader;
+class NITFImageSegment;
+class NITFGraphicSegment;
+class NITFLabelSegment;
+class NITFTextSegment;
+class NITFDataSegment;
+class NITFResSegment;
+class NITFFileMetadata;
+class NITFSecurityMetadata;
+
+/**
+ * class for reading an NITF file
+ *
+ * This class provides support for reading an NITF file, containing
+ * one or more image segments.
+ *
+ * This class is used in conjunction with the NITFReader class.
+ *
+ * THIS CLASS SUBJECT TO SIGNIFICANT CHANGE IN SUBSEQUENT RELEASES.
+ */
+class NITFImageManager
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates an NITFImageManager object from the given file.
+    *
+    * @param fileSpec  the NITF file to be opened
+    * @param obsolete  (not used)
+    */
+   NITFImageManager(const LTFileSpec& fileSpec, bool obsolete=true);
+
+   /**
+    * destructor
+    */
+   ~NITFImageManager();
+
+   /**
+    * initialization
+    */
+   LT_STATUS initialize();
+
+   /**
+    * creates a reader for a single segment
+    *
+    * This function is used to create an NITFImageReader for a 
+    * single given image segment, specified by number.
+    *
+    * The \a reader is allocated and initialized by this function,
+    * but the caller has ownership of the object.
+    * 
+    * @param reader  the created segment reader
+    * @param idx     index of the image segment
+    * @param useWorldFile set to true to allow world file to correct geo position
+    * @return status code
+    */
+   LT_STATUS createReader(NITFImageReader*& reader, lt_uint32 idx, bool useWorldFile=true);
+
+   /**
+    * creates a reader for all image segments
+    *
+    * This function is used to create an NITFImageReader for all
+    * the image segments; they are presented in the form of a
+    * standard SDK image mosaic.
+    *
+    * The \a stage is allocated and initialized by this function,
+    * but the caller has ownership of the object.  Note that the 
+    * \a stage is an LTIImageStage and not an NITFImageReader, as in
+    * the first form of the createReader() function.
+    * 
+    * @param stage   the created segment stage
+    * @return status code
+    */
+   LT_STATUS createReader(LTIImageStage*& stage);   // makes mosaic
+
+   // not for general use
+   void giveReaderOwnership(NITFImageReader* dummy=0);
+
+   /**
+    * COMRAT compliance control
+    *
+    * This function is used to control whether or not the COMRAT
+    * field is to be read.  The 2500C specification requires
+    * this field be present; the 2500B Note 2 specification does
+    * not.  This function is used to indicate which version
+    * of the specification this file adheres to.
+    *
+    * The default is false, i.e. 2500C formatting.
+    *
+    * This function must be called prior to initialize().
+    *
+    * @param use2500B set to true for 2500B/Note2 formatting
+    */
+   void setCompat_2500B_N2(bool use2500B);
+
+   /**
+    * COMRAT compliance setting
+    *
+    * Returns the 2500B compatability setting; see the
+    * setCompat_2500B_N2() function for details.
+    *
+    * @return true iff 200B / Note 2 formatting is being used
+    */
+   bool getCompat_2500B_N2() const;
+
+   lt_int64 getFileSize() const;
+
+   /**
+    * returns FileHeader metadata
+    */
+   const NITFFileHeader* getFileHeader() const;
+
+   /**
+    * returns number of image segments
+    */
+   lt_uint32 getNumImageSegments() const;
+
+   // not for general use
+   const NITFImageSegment* getImageSegment(lt_uint32 num) const;
+
+   /**
+    * returns the IID1 field of the given image segment
+    */
+   const char* getImageSegmentIID1(lt_uint32 num) const;
+
+   /**
+    * returns the number of graphic segments
+    */
+   lt_uint32 getNumGraphicSegments() const;
+
+   // not for general use
+   const NITFGraphicSegment* getGraphicSegment(lt_uint32 num) const;
+
+   /**
+    * returns the number of graphic segments
+    */
+   lt_uint32 getNumLabelSegments() const;
+
+   // not for general use
+   const NITFLabelSegment* getLabelSegment(lt_uint32 num) const;
+
+   /**
+    * returns the number of graphic segments
+    */
+   lt_uint32 getNumTextSegments() const;
+
+   // not for general use
+   const NITFTextSegment* getTextSegment(lt_uint32 num) const;
+
+   /**
+    * returns the number of graphic segments
+    */
+   lt_uint32 getNumDataSegments() const;
+
+   // not for general use
+   const NITFDataSegment* getDataSegment(lt_uint32 num) const;
+
+   /**
+    * returns the number of graphic segments
+    */
+   lt_uint32 getNumResSegments() const;
+
+   // not for general use
+   const NITFResSegment* getResSegment(lt_uint32 num) const;
+
+   /**
+    * returns NITF version information
+    */
+   const char* getVersionString() const;
+
+   LTFileSpec* getFileSpec() const;
+
+   /**
+    * returns the file-level metadata
+    */
+   const NITFFileMetadata* getFileMetadata() const;
+
+   /**
+    * returns file-level security metadata
+    */
+   const NITFSecurityMetadata* getSecurityMetadata() const;
+
+private:
+   LTFileSpec* m_fileSpec;
+   LTIOStreamInf* m_stream;
+   lt_int64 m_fileSize;
+   NITFImageReader* m_readerWithOwnership;
+
+   NITFFileHeader* m_fileHeader;
+   NITFImageSegment** m_imageSegments;
+   NITFGraphicSegment** m_graphicSegments;
+   NITFLabelSegment** m_labelSegments;
+   NITFTextSegment** m_textSegments;
+   NITFDataSegment** m_dataSegments;
+   NITFResSegment** m_resSegments;
+   lt_uint32 m_numImageSegments;
+   lt_uint32 m_numGraphicSegments;
+   lt_uint32 m_numLabelSegments;
+   lt_uint32 m_numTextSegments;
+   lt_uint32 m_numDataSegments;
+   lt_uint32 m_numResSegments;
+
+   NITFImageReader** m_readers;
+   lt_uint32 m_numReaders;
+
+   char* m_versionString;
+
+   bool m_compat_2500B_N2;
+
+   // nope
+   NITFImageManager(NITFImageManager&);
+   NITFImageManager& operator=(const NITFImageManager&);
+};
+
+LT_END_NAMESPACE(LizardTech)
+
+#endif // NITFIMAGEMANAGER_H
diff --git a/src/DSDK/include/j2k_readers/NITFImageReader.h b/src/DSDK/include/j2k_readers/NITFImageReader.h
new file mode 100644
index 0000000..260f9dd
--- /dev/null
+++ b/src/DSDK/include/j2k_readers/NITFImageReader.h
@@ -0,0 +1,170 @@
+/* $Id: NITFImageReader.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef NITFIMAGEREADER_H
+#define NITFIMAGEREADER_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// lt_lib_mrsid_core
+#include "lti_geoImageReader.h"
+
+// local
+#include "nitf_types.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTFileSpec;
+class LTIOStreamInf;
+class NITFFileHeader;
+class NITFImageManager;
+class NITFImageSegment;
+class LTReusableBuffer;
+class LTIReusableBSQBuffer;
+class NITFImageSegmentMetadata;
+class NITFSecurityMetadata;
+
+/**
+ * class for reading an NITF JPEG 2000 image segment
+ *
+ * This class provides support for reading an NITF
+ * image segment.  NITFImageManager objects are not
+ * to be created directly; the NITFImageManager class
+ * contains a createReader() function for this purpose.
+ *
+ * THIS CLASS SUBJECT TO SIGNIFICANT CHANGE IN SUBSEQUENT RELEASES.
+ */
+class NITFImageReader : public LTIGeoImageReader
+{
+public:
+   // do not call - access only via the Manager
+   NITFImageReader(LTIOStreamInf* stream,
+                   NITFImageManager& manager,
+                   const NITFImageSegment& imageSegment,
+                   bool useWorldFile);
+
+   virtual ~NITFImageReader();
+   virtual LT_STATUS initialize() = 0;
+
+   /**
+    * returns the IID1 field for the segment
+    */
+   const char* getIID1() const;
+
+   virtual lt_int64 getPhysicalFileSize() const;
+
+   // not for general use
+   NITFImageManager& getManager() const;
+   // not for general use
+   void takeOwnershipOfManager();
+
+   /**
+    * returns the compression format of the segment
+    */
+   NITFFormat getFormat() const;
+
+   /**
+    * returns the pixel layout of the segment
+    */
+   NITFLayout getLayout() const;
+
+   /**
+    * returns true iff the image segment is in blocked form
+    */
+   bool isBlocked() const;
+
+   /**
+    * returns true iff block masking is used in the image segment
+    */
+   bool isMasked() const;
+
+   /**
+    * returns the index of this image segment 
+    */
+  int getSegmentNumber() const;
+
+   /**
+    * returns the image segment metadata object for this segment
+    */
+  const NITFImageSegmentMetadata* getImageMetadata() const;
+
+   /**
+    * returns the secuirty metadata object for this segment
+    */
+  const NITFSecurityMetadata* getSecurityMetadata() const;
+
+  virtual LT_STATUS getDimsAtMag(double mag,
+                                 lt_uint32& width,
+                                 lt_uint32& height) const =0;
+  virtual LT_STATUS projectPointAtMag(double upperLeft,
+                                      double mag,
+                                      double& newUpperLeft) const =0;
+  virtual LT_STATUS projectDimAtMag(double dim,
+                                    double mag,
+                                    double& newDim) const =0;
+
+protected:
+   LT_STATUS initializeBase();
+
+   LT_STATUS addUnderlyingMetadata(const LTIImageReader&);
+
+   virtual LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene) =0;
+   virtual LT_STATUS decodeBegin(const LTIScene& scene) =0;
+   virtual LT_STATUS decodeEnd() =0;
+   
+   NITFImageManager& m_manager;
+   LTIOStreamInf* m_dataStream;
+   bool m_ownsTheManager;
+
+   const NITFFileHeader* m_fileHeader;
+   const NITFImageSegment& m_imageSegment;
+
+   bool m_useTheWorldFile;
+
+   // blocked image support
+   LTIScene computeBlockedScene(const LTIScene& scene) const;
+   LT_STATUS copyIntoUserBuffer(const LTIScene& dstScene,
+                                LTISceneBuffer& dstBuffer) const;
+   bool activeSceneContains(const LTIScene& scene) const;
+   void putBlockIntoBuffer_SEQ(LTISceneBuffer& cBuffer,
+                               lt_uint8* buf,
+                               lt_uint32 blockRow,
+                               lt_uint32 blockCol,
+                               lt_uint32 blockBand) const;
+   void putBlockIntoBuffer_BLOCK(LTISceneBuffer& cBuffer,
+                                 lt_uint8* buf,
+                                 lt_uint32 blockRow,
+                                 lt_uint32 blockCol) const;
+   void putBlockIntoBuffer_PIXEL(LTISceneBuffer& cBuffer,
+                               lt_uint8* buf,
+                               lt_uint32 blockRow,
+                               lt_uint32 blockCol) const;
+   void putBlockIntoBuffer_ROW(LTISceneBuffer& cBuffer,
+                               lt_uint8* buf,
+                               lt_uint32 blockRow,
+                               lt_uint32 blockCol) const;
+
+   LTReusableBuffer* m_reusableBuffer;
+   LTIScene* m_activeScene;
+   LTISceneBuffer* m_activeSceneBuffer;
+   LTIReusableBSQBuffer* m_activeReusableBuffer;
+
+private:
+   // nope
+   NITFImageReader(NITFImageReader&);
+   NITFImageReader& operator=(const NITFImageReader&);
+};
+
+LT_END_NAMESPACE(LizardTech)
+
+#endif // NITFIMAGEREADER_H
diff --git a/src/DSDK/include/j2k_readers/j2k_types.h b/src/DSDK/include/j2k_readers/j2k_types.h
new file mode 100644
index 0000000..e02df2c
--- /dev/null
+++ b/src/DSDK/include/j2k_readers/j2k_types.h
@@ -0,0 +1,73 @@
+/* $Id: j2k_types.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef J2K_TYPES_H
+#define J2K_TYPES_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+
+/**
+ * constants used to define progression orders
+ */
+enum J2KProgressionOrder
+{
+   J2K_ORDER_INVALID = 0,
+   J2K_ORDER_LRCP    = 1,
+   J2K_ORDER_RLCP    = 2,
+   J2K_ORDER_RPCL    = 3,
+   J2K_ORDER_PCRL    = 4,
+   J2K_ORDER_CPRL    = 5
+};
+
+
+/**
+ * constants used to define tile part styles
+ */
+enum J2KTilePartFlags
+{
+   J2K_TILEPART_FLAG_NONE  = 0,
+   J2K_TILEPART_FLAG_R     = 1,
+   J2K_TILEPART_FLAG_L     = 2,
+   J2K_TILEPART_FLAG_C     = 4,
+   J2K_TILEPART_FLAG_MAX   = (J2K_TILEPART_FLAG_R | 
+                              J2K_TILEPART_FLAG_L |
+                              J2K_TILEPART_FLAG_C)
+};
+
+
+/**
+ * file format (roughly)
+ */
+enum J2KFileFormat
+{
+   J2K_FILEFORMAT_INVALID  = 0,
+   J2K_FILEFORMAT_JPC      = 1,
+   J2K_FILEFORMAT_JP2      = 2,
+   J2K_FILEFORMAT_JPX      = 3
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // J2K_TYPES_H
diff --git a/src/DSDK/include/j2k_readers/lti_j2kStatus.h b/src/DSDK/include/j2k_readers/lti_j2kStatus.h
new file mode 100644
index 0000000..47435d5
--- /dev/null
+++ b/src/DSDK/include/j2k_readers/lti_j2kStatus.h
@@ -0,0 +1,160 @@
+/* $Id: lti_j2kStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_J2KSTATUS_H
+#define LTI_J2KSTATUS_H
+
+#include "lt_base.h"
+
+#define LTI_STS_J2K_Base                                          50900
+LT_STATUSSTRING_ADD(LTI_STS_J2K_Base, "lt_lib_mrsid_j2k base")
+
+#define LTI_STS_J2K_CannotWriteFile                               50901
+LT_STATUSSTRING_ADD(LTI_STS_J2K_CannotWriteFile, "JP2: cannot write to file %F")
+
+#define LTI_STS_J2K_UnsupColorSpace                               50902
+LT_STATUSSTRING_ADD(LTI_STS_J2K_UnsupColorSpace, "JP2: unsupported colorspace")
+
+#define LTI_STS_J2K_UnsupDataType                                 50903
+LT_STATUSSTRING_ADD(LTI_STS_J2K_UnsupDataType, "JP2: unsupported datatype")
+
+#define LTI_STS_J2K_LibraryError                                  50904
+LT_STATUSSTRING_ADD(LTI_STS_J2K_LibraryError, "JP2: internal error")
+
+#define LTI_STS_J2K_HandledError                                  50905
+LT_STATUSSTRING_ADD(LTI_STS_J2K_HandledError, "JP2: internal error (%s)")
+
+#define LTI_STS_J2K_InvalidRegion                                 50906
+LT_STATUSSTRING_ADD(LTI_STS_J2K_InvalidRegion, "JP2: invalid region")
+
+#define LTI_STS_J2K_InvalidDims                                   50907
+LT_STATUSSTRING_ADD(LTI_STS_J2K_InvalidDims, "JP2: invalid/unsupported dimensions")
+
+#define LTI_STS_J2K_InvalidDecodeScene                            50908
+LT_STATUSSTRING_ADD(LTI_STS_J2K_InvalidDecodeScene, "JP2: invalid scene for decode")
+
+#define LTI_STS_J2K_BadDecodeParam                                50909
+LT_STATUSSTRING_ADD(LTI_STS_J2K_BadDecodeParam, "JP2: invalid decoder parameter setting")
+
+#define LTI_STS_J2K_MetadataReadError                             50910
+LT_STATUSSTRING_ADD(LTI_STS_J2K_MetadataReadError, "JP2: error reading metadata")
+
+#define LTI_STS_J2K_MetadataUuidNotFound                          50911
+LT_STATUSSTRING_ADD(LTI_STS_J2K_MetadataUuidNotFound, "JP2: uuid not found")
+
+#define LTI_STS_J2K_BadPrecisionParam                             50912
+LT_STATUSSTRING_ADD(LTI_STS_J2K_BadPrecisionParam, "JP2: bad precision value")
+
+#define LTI_STS_J2K_BadLayersParam                                50915
+LT_STATUSSTRING_ADD(LTI_STS_J2K_BadLayersParam, "JP2: bad quality layers value")
+
+#define LTI_STS_J2K_CannotReadFile                                50916
+LT_STATUSSTRING_ADD(LTI_STS_J2K_CannotReadFile, "JP2: cannot read file")
+
+#define LTI_STS_J2K_BadTileParam                                  50917
+LT_STATUSSTRING_ADD(LTI_STS_J2K_BadTileParam, "JP2: bad tile size value (limit of 65535 tiles)")
+
+#define LTI_STS_J2K_BadFlushParam                                 50918
+LT_STATUSSTRING_ADD(LTI_STS_J2K_BadFlushParam, "JP2: bad flush period value")
+
+#define LTI_STS_J2K_BadPrecinctsParam                             50919
+LT_STATUSSTRING_ADD(LTI_STS_J2K_BadPrecinctsParam, "JP2: bad precincts values")
+
+#define LTI_STS_J2K_BadProgressionParam                           50920
+LT_STATUSSTRING_ADD(LTI_STS_J2K_BadProgressionParam, "JP2: bad progression order")
+
+#define LTI_STS_J2K_BadCodeblockParam                             50921
+LT_STATUSSTRING_ADD(LTI_STS_J2K_BadCodeblockParam, "JP2: bad codeblock value")
+
+#define LTI_STS_J2K_BadTilePartParam                             50922
+LT_STATUSSTRING_ADD(LTI_STS_J2K_BadTilePartParam, "JP2: bad tile part value")
+
+// usused 50923
+
+#define LTI_STS_J2K_UnsupSigned                                   50924
+LT_STATUSSTRING_ADD(LTI_STS_J2K_UnsupSigned, "JP2: unsupported datatype - signed")
+
+#define LTI_STS_J2K_InvalidBandNumber                             50925
+LT_STATUSSTRING_ADD(LTI_STS_J2K_InvalidBandNumber, "JP2: invalid band number")
+
+#define LTI_STS_J2K_IrregularImage                                50926
+LT_STATUSSTRING_ADD(LTI_STS_J2K_IrregularImage, "JP2: band sizes/shapes are irregular")
+
+#define LTI_STS_J2K_UnsupProfileVersion                           50927
+LT_STATUSSTRING_ADD(LTI_STS_J2K_UnsupProfileVersion, "JP2: unsupported profile version")
+
+#define LTI_STS_J2K_ProfileReadError                              50928
+LT_STATUSSTRING_ADD(LTI_STS_J2K_ProfileReadError, "JP2: error reading profile")
+
+#define LTI_STS_J2K_ProfileUnkElem                                50929
+LT_STATUSSTRING_ADD(LTI_STS_J2K_ProfileUnkElem, "JP2: unknown element in profile")
+
+#define LTI_STS_J2K_ProfileBadData                                50930
+LT_STATUSSTRING_ADD(LTI_STS_J2K_ProfileBadData, "JP2: bad data/argument in profile")
+
+#define LTI_STS_J2K_ProfileOpenError                              50931
+LT_STATUSSTRING_ADD(LTI_STS_J2K_ProfileOpenError, "JP2: error opening profile")
+
+
+#define LTI_STS_J2K_LibraryErrorB                                 50940
+LT_STATUSSTRING_ADD(LTI_STS_J2K_LibraryErrorB, "JP2: internal error")
+
+#define LTI_STS_J2K_LibraryErrorL                                 50941
+LT_STATUSSTRING_ADD(LTI_STS_J2K_LibraryErrorL, "JP2: internal error")
+
+#define LTI_STS_J2K_LibraryErrorE                                 50942
+LT_STATUSSTRING_ADD(LTI_STS_J2K_LibraryErrorE, "JP2: internal error")
+
+#define LTI_STS_J2K_ROIScene                                      50943
+LT_STATUSSTRING_ADD(LTI_STS_J2K_ROIScene, "JP2: invalid scene for ROI encoding")
+
+#define LTI_STS_J2K_AllocFailed                                   50944
+LT_STATUSSTRING_ADD(LTI_STS_J2K_AllocFailed, "JP2: memory allocation failed")
+
+#define LTI_STS_J2K_InternalROI1                                  50945
+LT_STATUSSTRING_ADD(LTI_STS_J2K_InternalROI1, "JP2: internal error processing ROI")
+
+#define LTI_STS_J2K_InternalROI2                                  50946
+LT_STATUSSTRING_ADD(LTI_STS_J2K_InternalROI2, "JP2: internal error processing ROI")
+
+#define LTI_STS_J2K_InternalSamp16                                50947
+LT_STATUSSTRING_ADD(LTI_STS_J2K_InternalSamp16, "JP2: internal error processing sample")
+
+#define LTI_STS_J2K_FileNotFound                                  50950
+LT_STATUSSTRING_ADD(LTI_STS_J2K_FileNotFound, "JP2: file not found")
+
+#define LTI_STS_J2K_ReadError                                     50951
+LT_STATUSSTRING_ADD(LTI_STS_J2K_ReadError, "JP2: error reading file")
+
+#define LTI_STS_J2K_FileNotJ2K                                    50952
+LT_STATUSSTRING_ADD(LTI_STS_J2K_FileNotJ2K, "JP2: not valid JPEG 2000 file")
+
+#define LTI_STS_J2K_NotPersistent                                 50953
+LT_STATUSSTRING_ADD(LTI_STS_J2K_NotPersistent, "JP2: attempted second decode with isPersistent==false")
+
+
+#define LTI_STS_J2K_MSIChunkError1                                50980
+LT_STATUSSTRING_ADD(LTI_STS_J2K_MSIChunkError1, "JP2: internal error 1")
+
+#define LTI_STS_J2K_MSIChunkError2                                50981
+LT_STATUSSTRING_ADD(LTI_STS_J2K_MSIChunkError2, "JP2: internal error 2")
+
+#define LTI_STS_J2K_MSIChunkError3                                50982
+LT_STATUSSTRING_ADD(LTI_STS_J2K_MSIChunkError3, "JP2: internal error 3")
+
+#define LTI_STS_J2K_MSIChunkError4                                50983
+LT_STATUSSTRING_ADD(LTI_STS_J2K_MSIChunkError4, "JP2: internal error 4")
+
+#define LTI_STS_J2K_Max                                           50999
+LT_STATUSSTRING_ADD(LTI_STS_J2K_Max, "lt_lib_mrsid_j2k max")
+
+#endif // LTI_J2KSTATUS_H
diff --git a/src/DSDK/include/j2k_readers/lti_nitfStatus.h b/src/DSDK/include/j2k_readers/lti_nitfStatus.h
new file mode 100644
index 0000000..076c377
--- /dev/null
+++ b/src/DSDK/include/j2k_readers/lti_nitfStatus.h
@@ -0,0 +1,111 @@
+/* $Id: lti_nitfStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_NITFSTATUS_H
+#define LTI_NITFSTATUS_H
+
+#include "lt_base.h"
+
+
+#define LTI_STS_NITF_Base                                      51200
+LT_STATUSSTRING_ADD(LTI_STS_NITF_Base, "lt_lib_mrsid_nitf base")
+
+
+#define LTI_STS_NITF_UnsupDataType                             51201
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupDataType, "unsupported datatype")
+
+#define LTI_STS_NITF_UnsupColorSpace                           51202
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupColorSpace, "unsupported colorspace")
+
+#define LTI_STS_NITF_ErrorOpeningFile                          51203
+LT_STATUSSTRING_ADD(LTI_STS_NITF_ErrorOpeningFile, "error opening file")
+
+#define LTI_STS_NITF_ErrorReadingFile                          51204
+LT_STATUSSTRING_ADD(LTI_STS_NITF_ErrorReadingFile, "error reading file")
+
+#define LTI_STS_NITF_UnsupLUT                                  51205
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupLUT, "LUTs unsupported")
+
+#define LTI_STS_NITF_InvalidImageSegment                       51206
+LT_STATUSSTRING_ADD(LTI_STS_NITF_InvalidImageSegment, "invalid image segment number")
+
+#define LTI_STS_NITF_AllocFailed                               51207
+LT_STATUSSTRING_ADD(LTI_STS_NITF_AllocFailed, "memory allocation failed")
+
+#define LTI_STS_NITF_InvalidNITF                               51210
+LT_STATUSSTRING_ADD(LTI_STS_NITF_InvalidNITF, "file is not valid NITF 2.1 (2500C) file")
+
+#define LTI_STS_NITF_UnsupEncrypt                              51211
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupEncrypt, "encrypted NITF not supported")
+
+#define LTI_STS_NITF_UnsupStreaming                            51212
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupStreaming, "NITF STREAMING extension not supported")
+
+#define LTI_STS_NITF_UnsupV11                                  51213
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupV11, "NITF v1.1 not supported")
+
+#define LTI_STS_NITF_UnsupImageFormat                          51214
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupImageFormat, "NITF image format (IC) not supported")
+
+#define LTI_STS_NITF_UnsupImageFormatBilevel                   51215
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupImageFormatBilevel, "NITF bilevel image format not supported")
+
+#define LTI_STS_NITF_UnsupImageFormatJpeg                      51216
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupImageFormatJpeg, "NITF JPEG image format not supported")
+
+#define LTI_STS_NITF_UnsupImageFormatVQ                        51217
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupImageFormatVQ, "NITF VQ image format not supported")
+
+#define LTI_STS_NITF_UnsupImageFormatJpegLS                    51218
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupImageFormatJpegLS, "NITF lossless JPEG image format not supported")
+
+#define LTI_STS_NITF_UnsupImageFormatJpegDS                    51219
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupImageFormatJpegDS, "NITF downsampled JPEG image format not supported")
+
+#define LTI_STS_NITF_GraphicUnsup                              51220
+LT_STATUSSTRING_ADD(LTI_STS_NITF_GraphicUnsup, "Graphic segment version unsupported")
+
+#define LTI_STS_NITF_UnsupUnalignedData                        51221
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupUnalignedData, "non-byte-aligned data is unsupported")
+
+#define LTI_STS_NITF_ErrorParsingJPG                           51222
+LT_STATUSSTRING_ADD(LTI_STS_NITF_ErrorParsingJPG, "error parsing JPEG segment")
+
+#define LTI_STS_NITF_BadlyFormedString                         51223
+LT_STATUSSTRING_ADD(LTI_STS_NITF_BadlyFormedString, "badly formed string")
+
+#define LTI_STS_NITF_UnsupImageFormatJp2Block                  51224
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupImageFormatJp2Block, "NITF blocked JP2 image format not supported")
+
+#define LTI_STS_NITF_UnsupImagePJust                           51225
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupImagePJust, "PJUST=L not supported")
+
+#define LTI_STS_NITF_UnsupScene                                51226
+LT_STATUSSTRING_ADD(LTI_STS_NITF_UnsupScene, "specified scene must be entire image")
+
+#define LTI_STS_NITF_TooManySegments                           51227
+LT_STATUSSTRING_ADD(LTI_STS_NITF_TooManySegments, "maximum number of image segments exceeded")
+
+#define LTI_STS_NITF_ILOCExceeded                              51228
+LT_STATUSSTRING_ADD(LTI_STS_NITF_ILOCExceeded, "image segments out of file format range (ILOC)")
+
+#define LTI_STS_NITF_SegmentTooLarge                           51229
+LT_STATUSSTRING_ADD(LTI_STS_NITF_SegmentTooLarge, "image segment is larger than 10GB")
+
+#define LTI_STS_NITF_StreamDupError                            51230
+LT_STATUSSTRING_ADD(LTI_STS_NITF_StreamDupError, "error duplicating stream")
+
+#define LTI_STS_NITF_Max                                       51299
+LT_STATUSSTRING_ADD(LTI_STS_NITF_Max, "lt_lib_mrsid_nitf max")
+
+
+#endif // LTI_NITFSTATUS_H
diff --git a/src/DSDK/include/j2k_readers/nitf_types.h b/src/DSDK/include/j2k_readers/nitf_types.h
new file mode 100644
index 0000000..2192c56
--- /dev/null
+++ b/src/DSDK/include/j2k_readers/nitf_types.h
@@ -0,0 +1,73 @@
+/* $Id: nitf_types.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef NITF_TYPES_H
+#define NITF_TYPES_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// lt_lib_mrsid_core
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+
+
+/**
+ * version
+ *
+ * This enum is used to represent the version of the NITF file.
+ */
+enum NITFVersion
+{
+   NITF_VERSION_INVALID,
+   NITF_VERSION_11, 
+   NITF_VERSION_20,
+   NITF_VERSION_21
+};
+
+
+/**
+ * image/compression format
+ *
+ * This enum is used to represent the compression format of an image segment.
+ */
+enum NITFFormat    // IC field
+{
+   NITF_FORMAT_INVALID,
+   NITF_FORMAT_RAW,
+   NITF_FORMAT_BILEVEL,
+   NITF_FORMAT_JPEG,
+   NITF_FORMAT_VQ,
+   NITF_FORMAT_JPEGLS,
+   NITF_FORMAT_JPEGDS,
+   NITF_FORMAT_JP2
+};
+
+
+/**
+ * layout
+ *
+ * This enum is used to represent the data layout of an image segment.
+ */
+enum NITFLayout    // IMODE field
+{
+   NITF_LAYOUT_INVALID,
+   NITF_LAYOUT_BLOCK,      // B: interleaved by block
+   NITF_LAYOUT_PIXEL,      // P: interleaved by pixel
+   NITF_LAYOUT_ROW,        // R: interleaved by row (line)
+   NITF_LAYOUT_SEQ         // S: sequential (not interleaved)
+};
+
+LT_END_NAMESPACE(LizardTech)
+
+#endif // NITF_TYPES_H
diff --git a/src/DSDK/include/metadata/lti_geoMetadataStatus.h b/src/DSDK/include/metadata/lti_geoMetadataStatus.h
new file mode 100644
index 0000000..51bc099
--- /dev/null
+++ b/src/DSDK/include/metadata/lti_geoMetadataStatus.h
@@ -0,0 +1,62 @@
+/* $Id: lti_geoMetadataStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */     
+/* PUBLIC */
+
+#ifndef LTI_GEOMETADATASTATUS_H
+#define LTI_GEOMETADATASTATUS_H
+
+#include "lt_base.h"
+
+#define LTI_STS_GeoMetadata_Base                        51300
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_Base, "lt_lib_mrsid_geoMetadata base")
+
+#define LTI_STS_GeoMetadata_BadTIFFIFDRead              51301
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_BadTIFFIFDRead, "bad TIFF IFD read")
+
+#define LTI_STS_GeoMetadata_BadTIFFIFDWrite             51302
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_BadTIFFIFDWrite, "bad TIFF IFD write")
+
+#define LTI_STS_GeoMetadata_BadGeoTIFFDir               51303
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_BadGeoTIFFDir, "bad GeoTIFF Directory")
+
+#define LTI_STS_GeoMetadata_InvalidSRS                  51304
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_InvalidSRS, "invalid SRS")
+
+#define LTI_STS_GeoMetadata_InvalidDOQMetadata          51305
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_InvalidDOQMetadata, "invalid DOQ metadata")
+
+#define LTI_STS_GeoMetadata_GDALDATANotSet              51306
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_GDALDATANotSet, "GDAL_DATA not set")
+
+#define LTI_STS_GeoMetadata_PROJSONotSet                51307
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_PROJSONotSet, "PROJSO not set")
+
+#define LTI_STS_GeoMetadata_NITFMGRSError               51308
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_NITFMGRSError, "MGRS conversion error")
+
+#define LTI_STS_GeoMetadata_NITFUnsupIGEOLO             51309
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_NITFUnsupIGEOLO, "unsupported IGEOLO setting")
+
+#define LTI_STS_GeoMetadata_CouldNotCreateTransformer   51310
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_CouldNotCreateTransformer, "could not create coordinate transformer")
+
+#define LT_STS_GeoMetadata_ReprojectionErr              51311
+LT_STATUSSTRING_ADD(LT_STS_GeoMetadata_ReprojectionErr, "coordinate reprojection error")
+
+#define LTI_STS_GeoMetadata_InvalidWKT                  51312
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_InvalidWKT, "invalid WKT")
+
+#define LTI_STS_GeoMetadata_Max                         51399
+LT_STATUSSTRING_ADD(LTI_STS_GeoMetadata_Max, "lt_lib_mrsid_geoMetadata max")
+
+
+
+#endif // LTI_GEOMETADATASTATUS_H
diff --git a/src/DSDK/include/metadata/lti_metadataDatabase.h b/src/DSDK/include/metadata/lti_metadataDatabase.h
new file mode 100644
index 0000000..8cd819c
--- /dev/null
+++ b/src/DSDK/include/metadata/lti_metadataDatabase.h
@@ -0,0 +1,269 @@
+/* $Id: lti_metadataDatabase.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTIMETADATADATABASE_H
+#define LTIMETADATADATABASE_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// lt_lib_mrsid_metadata
+#include "lti_metadataTypes.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIMetadataRecord;
+
+
+/**
+ * class for storing metadata associated with an image
+ *
+ * This class implements a simple database which holds a set of
+ * LTIMetadataRecords.  Each record has a unique tag associated with it.
+ *
+ * Each LTIImage object contains an LTIMetadataDatabase
+ * for the metadata associated with that image.
+ *
+ * The database (and records) are stored in memory in a format-neutral
+ * manner.  For importing or exporting metadata records to permanent
+ * storage, see the LTIMetadataReader and LTIMetadataWriter classes.
+ */
+class LTIMetadataDatabase
+{
+public:
+   /**
+    * default constructor
+    *
+    * This constructor creates an empty metadata database.
+    */
+   LTIMetadataDatabase();
+
+   /**
+    * copy constructor
+    */
+   LTIMetadataDatabase(const LTIMetadataDatabase&);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIMetadataDatabase();
+
+
+   /**
+    * @name Add functions
+    */
+   /*@{*/
+
+   /**
+    * add a record
+    *
+    * This function adds the given record to the metadata database.
+    *
+    * If the database already contains a record with the given tag,
+    * a status code of LT_STS_LTIMetadata_DuplicateTag is returned.
+    *
+    * @param record the record to add 
+    * @return status code indicating success or failure
+    */
+   LT_STATUS add(const LTIMetadataRecord& record);
+
+   /**
+    * add all the records from a database
+    *
+    * This function adds all the records from the given database to this
+    * database.
+    *
+    * If the database already contains a record with the same tag as one
+    * of the records in the database being added, no records are added and
+    * a status code of LT_STS_LTIMetadata_DuplicateTag is returned.
+    *
+    * @param database the database containing the records to add 
+    * @return status code indicating success or failure
+    */
+   LT_STATUS add(const LTIMetadataDatabase& database);
+
+   /*@}*/
+
+
+   /**
+    * @name Retrieval functions
+    */
+   /*@{*/
+
+   /**
+    * retrieve a record, given a tag name
+    *
+    * This function returns a pointer to the (first) record in the database
+    * that matches the given tag name.
+    *
+    * If the tag is not found, the pointer will be set to NULL and
+    * a status of LT_STS_LTIMetadata_TagNotFound will be returned.
+    *
+    * @param   tagName  the name of the tag of the record to retrieve 
+    * @param   record   pointer to the retrieved record 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS get(const char* tagName,
+                 const LTIMetadataRecord*& record) const;
+
+   /**
+    * retrieve a record, given a tag number
+    *
+    * This function returns a pointer to the (first) record in the database
+    * that matches the given tag number.
+    *
+    * If the tag is not found, the pointer will be set to NULL and
+    * a status of LT_STS_LTIMetadata_TagNotFound will be returned.
+    *
+    * @param   tag     the number of the tag of the record to retrieve 
+    * @param   record  pointer to the retrieved record 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS get(LTIMetadataTag tag,
+                 const LTIMetadataRecord*& record) const;
+
+   /**
+    * lookup a record, given a tag name
+    *
+    * This function returns a boolean indicating whether the database
+    * contains a record with the given tag.
+    *
+    * @param   tagName  the name of the tag of the record to look up 
+    * @return  true if the tag is found, otherwise false
+    */
+   bool has(const char* tagName) const;
+
+   /**
+    * lookup a record, given a tag number
+    *
+    * This function returns a boolean indicating whether the database
+    * contains a record with the given tag.
+    *
+    * @param   tag  the number of the tag of the record to look up 
+    * @return  true if the tag is found, otherwise false
+    */
+   bool has(LTIMetadataTag tag) const;
+
+   /**
+    * retrieve a record, given an index number
+    *
+    * This function returns a pointer to the (first) record in the database
+    * that matches the given index number.
+    *
+    * In combination with getIndexCount(), this function can be used
+    * to iterate through all the records in the database.  (However, removing
+    * a record will change the index numbers, so be careful if iterating
+    * and removing in the same loop.)
+    *
+    * If the index number is not found, the pointer will be set to NULL and
+    * a status of LT_STS_LTIMetadata_TagNotFound will be returned.
+    *
+    * @param   index  the index number of the record to retrieve 
+    * @param   record  pointer to the retrieved record 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS getDataByIndex(lt_uint32 index,
+                            const LTIMetadataRecord*& record) const;
+
+   /**
+    * get number of records
+    *
+    * This function will return the number of records in the database.
+    *
+    * @return  the number of records
+    */
+   lt_uint32 getIndexCount() const;
+
+   /*@}*/
+
+
+   /**
+    * @name Removal functions
+    */
+   /*@{*/
+
+   /**
+    * remove a record, given a tag name
+    *
+    * This function will remove the record with the given tag from the
+    * database.
+    *
+    * If the tag is not found, a status of LT_STS_LTIMetadata_TagNotFound
+    * will be returned.
+    *
+    * @param   tagName  the name of the tag of the record to remove 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS remove(const char* tagName);
+
+   /**
+    * remove a record, given a tag number
+    *
+    * This function will remove the record with the given tag from the
+    * database.
+    *
+    * If the tag is not found, a status of LT_STS_LTIMetadata_TagNotFound
+    * will be returned.
+    *
+    * @param   tag  the number of the tag of the record to remove 
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS remove(LTIMetadataTag tag);
+
+   /**
+    * remove all records
+    *
+    * This function will remove all the records from the database.
+    *
+    * @return  status code indicating success or failure
+    */
+   LT_STATUS removeAll();
+
+   /*@}*/
+
+   /**
+    * get size of metadata database
+    *
+    * This function will return a close-enough estimate of the size of the
+    * metadata database, as if it were to be written directly to disk.
+    *
+    * @return  size in bytes of the metadata database
+    */
+   lt_int32 getApproximateSize() const;
+
+   /**
+    * Sorts the database records by tag name.  This can be useful in certain
+    * debugging and validation scenarios.
+    */
+   void sort(void);
+
+private:
+   class RecordListX;
+   RecordListX* m_recordList;
+
+   // nope
+   LTIMetadataDatabase& operator=(const LTIMetadataDatabase&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTIMETADATADATABASE_H
diff --git a/src/DSDK/include/metadata/lti_metadataDumper.h b/src/DSDK/include/metadata/lti_metadataDumper.h
new file mode 100644
index 0000000..b3baf6b
--- /dev/null
+++ b/src/DSDK/include/metadata/lti_metadataDumper.h
@@ -0,0 +1,109 @@
+/* $Id: lti_metadataDumper.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTIMETADATADUMPER_H
+#define LTIMETADATADUMPER_H
+
+// lt_lib_mrsid_metadata
+#include "lti_metadataWriter.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIOStreamInf;
+class LTIMetadataRecord;
+
+
+/**
+ * dumps contents of database in text form
+ *
+ * This class writes the given database in ASCII text, readable format
+ * to a stream or stdout.
+ */
+class LTIMetadataDumper: public LTIMetadataWriter
+{
+public:
+   /**
+    * constructor
+    *
+    * This constructor creates an LTIMetadataWriter which will pretty-print
+    * the records in the database to a stream or to stdout.
+    *
+    * @param database the database to write from
+    * @param stream the stream to write to; if NULL, will write to stdout
+    * @param abbreviated dump only the first several elements of each record
+    */
+   LTIMetadataDumper(const LTIMetadataDatabase& database,
+                     LTIOStreamInf* stream,
+                     bool abbreviated=false);
+
+   /**
+    * destructor
+    */
+   ~LTIMetadataDumper();
+
+   /**
+    * write records to stream
+    */
+   LT_STATUS write() const;
+
+   /**
+    * write a single record to stream
+    *
+    * This function writes (pretty-prints) the given record to the stream.
+    *
+    * It is public and static because it is useful on its own for debugging.
+    *
+    * @param record the record to write
+    * @param stream the stream to write to
+    * @param abbreviated dump only the first several elements of the record
+    * @return status code indicating success or failure
+    */
+   static LT_STATUS writeRecord(const LTIMetadataRecord& record,
+                                LTIOStreamInf& stream,
+                                bool abbreviated=false);
+
+
+   /**
+    * INPUT_NAME metadata control
+    *
+    * Control if the IMAGE::INPUT_NAME tag is written out.
+    * This can useful for certain debugging and validation situations.
+    *
+    * The default is to always write the INPUT_NAME tag.
+    *
+    * @param  enable  set to true to not skip the INPUT_NAME tag
+    */
+   void setWriteInputFilename(bool enable); 
+
+private:
+   LTIOStreamInf* m_stream;
+   bool m_ownsStream;
+   bool m_writeInputFilename;
+   const bool m_abbreviated;
+
+   // nope
+   LTIMetadataDumper(const LTIMetadataDumper&);
+   LTIMetadataDumper& operator=(const LTIMetadataDumper&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTIMETADATADUMPER_H
diff --git a/src/DSDK/include/metadata/lti_metadataReader.h b/src/DSDK/include/metadata/lti_metadataReader.h
new file mode 100644
index 0000000..8c7ef25
--- /dev/null
+++ b/src/DSDK/include/metadata/lti_metadataReader.h
@@ -0,0 +1,89 @@
+/* $Id: lti_metadataReader.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTIMETADATAREADER_H
+#define LTIMETADATAREADER_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+class LTIMetadataDatabase;
+
+/**
+ * abstract class for populating a metadata database
+ *
+ * This abstract class provides an interface for importing metadata records
+ * from a foreign source into an LTIMetadataDatabase.
+ *
+ * This is used, for example, to provide a mechanism for reading the TIFF
+ * tag style metadata from a MrSID file into the format-neutral, in-memory
+ * database.
+ */
+class LTIMetadataReader
+{
+public:
+   /**
+    * default constructor
+    *
+    * This base constructor creates a reader object which can insert
+    * records into a database from some foreign source.
+    *
+    * @param database the database to be read into
+    */
+   LTIMetadataReader(LTIMetadataDatabase& database);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIMetadataReader();
+
+   /**
+    * read records into database
+    *
+    * This function must be implemented in the derived class.  It should
+    * read the metadata content from the foreign metadata source, express
+    * it as LTIMetadataRecord objects, and add them to the database.
+    *
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS read() = 0;
+
+protected:
+   /**
+    * the database to be read into
+    *
+    * This is the database to be read into.  Derived classes may access it
+    * directly.
+    */
+   LTIMetadataDatabase& m_database;
+
+private:
+   // nope
+   LTIMetadataReader(const LTIMetadataReader&);
+   LTIMetadataReader& operator=(const LTIMetadataReader&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTIMETADATAREADER_H
diff --git a/src/DSDK/include/metadata/lti_metadataRecord.h b/src/DSDK/include/metadata/lti_metadataRecord.h
new file mode 100644
index 0000000..996353a
--- /dev/null
+++ b/src/DSDK/include/metadata/lti_metadataRecord.h
@@ -0,0 +1,331 @@
+/* $Id: lti_metadataRecord.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTIMETADATARECORD_H
+#define LTIMETADATARECORD_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// lt_lib_mrsid_metadata
+#include "lti_metadataTypes.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+/**
+ * representation of a metadata record
+ *
+ * This class stores the data associated with a single record in the database.
+ * The data consists of:
+ *   - the tag (a string), used to uniquely identify the record
+ *   - the type of the data, e.g. string, byte, etc
+ *   - the dimensionality of the data, e.g. scalar, 2x3 array, etc
+ *   - the actual data
+ *
+ * It is assumed each record has only a single set of data of a single datatype.
+ * (That is, a record can't contain both a float and two ints.)
+ *
+ * Some of the functions for operating on records are cast in the guise
+ * of scalar, vector, or array data.  This is for notational convenience only;
+ * the internal representation does not distinguish and treats everything as
+ * a (possibly degenerate) array.
+ */
+class LTIMetadataRecord
+{
+public:
+   /**
+    * default constructor for scalar data
+    *
+    * The constructor creates a record containing a scalar data value.
+    *
+    * Note that the object makes a local copy of the data passed into the
+    * record.
+    *
+    * @param tag the tag number of the record 
+    * @param type datatype of the data in the record 
+    * @param data pointer to the data to insert into the record 
+    */
+   LTIMetadataRecord(LTIMetadataTag tag,
+                     LTIMetadataDataType type,
+                     const void* data);
+
+   /**
+    * default constructor for scalar data
+    *
+    * The constructor creates a record containing a scalar data value.
+    *
+    * Note that the object makes a local copy of the data passed into the
+    * record.
+    *
+    * @param tagName the tag number of the record 
+    * @param type datatype of the data in the record 
+    * @param data pointer to the data to insert into the record 
+    */
+   LTIMetadataRecord(const char* tagName,
+                     LTIMetadataDataType type,
+                     const void* data);
+   
+   /**
+    * default constructor for vector data
+    *
+    * The constructor creates a record containing a vector of data values.
+    *
+    * Note that the object makes a local copy of the data passed into the
+    * record.
+    *
+    * @param tag the tag number of the record 
+    * @param type datatype of the data in the record 
+    * @param data pointer to the data to insert into the record 
+    * @param vecLen the length of the data vector 
+    */
+   LTIMetadataRecord(LTIMetadataTag tag,
+                     LTIMetadataDataType type,
+                     const void* data,
+                     lt_uint32 vecLen);
+   /**
+    * default constructor for vector data
+    *
+    * The constructor creates a record containing a vector of data values.
+    *
+    * Note that the object makes a local copy of the data passed into the
+    * record.
+    *
+    * @param tagName the tag number of the record 
+    * @param type datatype of the data in the record 
+    * @param data pointer to the data to insert into the record 
+    * @param vecLen the length of the data vector 
+    */
+   LTIMetadataRecord(const char* tagName,
+                     LTIMetadataDataType type,
+                     const void* data,
+                     lt_uint32 vecLen);
+
+   /**
+    * default constructor for array data
+    *
+    * The constructor creates a record containing an array of data values.
+    *
+    * Note that the object makes a local copy of the data passed into the
+    * record.
+    *
+    * @param tag the tag number of the record 
+    * @param type datatype of the data in the record 
+    * @param data pointer to the data to insert into the record 
+    * @param numDims the length of the \a dims array 
+    * @param dims the dimensionality of the data 
+    */
+   LTIMetadataRecord(LTIMetadataTag tag,
+                     LTIMetadataDataType type,
+                     const void* data,
+                     lt_uint32 numDims,
+                     const lt_uint32* dims);
+
+   /**
+    * default constructor for array data
+    *
+    * The constructor creates a record containing an array of data values.
+    *
+    * Note that the object makes a local copy of the data passed into the
+    * record.
+    *
+    * @param tagName the tag number of the record 
+    * @param type datatype of the data in the record 
+    * @param data pointer to the data to insert into the record 
+    * @param numDims the length of the \a dims array 
+    * @param dims the dimensionality of the data 
+    */
+   LTIMetadataRecord(const char* tagName,
+                     LTIMetadataDataType type,
+                     const void* data,
+                     lt_uint32 numDims,
+                     const lt_uint32* dims);
+
+   /**
+    * copy constructor
+    */
+   LTIMetadataRecord(const LTIMetadataRecord&);
+
+   /**
+    * destructor
+    */
+   ~LTIMetadataRecord();
+
+   /**
+    * get tag
+    *
+    * This function returns the tag number (enum) associated with the record.
+    *
+    * @return the tag
+    */
+   LTIMetadataTag getTag() const;
+
+   /**
+    * get tag name
+    *
+    * This function returns the tag name (string) associated with the record.
+    *
+    * @return the tag name
+    */
+   const char* getTagName() const;
+
+   /**
+    * get datatype
+    *
+    * This function returns the datatype of the data in the record.
+    *
+    * @return the datatype
+    */
+   LTIMetadataDataType getDataType() const;
+
+   /**
+    * get number of dimensions of the data set
+    *
+    * This function returns the number of dimensions in the dimensionality
+    * of the dataset.
+    *
+    * This is the length of the array returned by the getDims() function.
+    *
+    * @return the number of dimensions
+    */
+   lt_uint32 getNumDims() const;
+
+   /**
+    * get dimensionality of the data set
+    *
+    * This function returns an array with the length of each dimension of the
+    * dataset.
+    *
+    * For example, a 2x3 dataset would return an array of length two with the
+    * values {2,3}.
+    *
+    * This is the length of the returned array is equal to getNumDims().
+    *
+    * @return the number of dimensions
+    */
+   const lt_uint32* getDims() const;
+
+   /**
+    * is dataset a scalar?
+    *
+    * This function returns true iff the record's dataset consists only of a
+    * single element.
+    *
+    * @return true if record data is a scalar value
+    */
+   bool isScalar() const;
+
+   /**
+    * is dataset a vector?
+    *
+    * This function returns true iff the record's dataset is a 1-D array.
+    *
+    * @return true if record data is a vector of values
+    */
+   bool isVector() const;
+
+   /**
+    * is dataset an array?
+    *
+    * This function returns true iff the record's dataset is neither
+    * a scalar nor a vector.
+    *
+    * @return true if record data is not scalar or vector
+    */
+   bool isArray() const;
+
+   /**
+    * get scalar data value
+    *
+    * This function returns the record's data as a scalar value.  It is
+    * the caller's responsibility to assure that the record does indeed
+    * contain a scalar dataset.
+    *
+    * The user is responsible for casting the returned value to the correct
+    * datatype.
+    *
+    * @return a pointer to the scalar data value
+    */
+   const void* getScalarData() const;
+
+   /**
+    * get vector data values
+    *
+    * This function returns the record's data as a vector of values.  It is
+    * the caller's responsibility to assure that the record does indeed
+    * contain a vector dataset.
+    *
+    * The user is responsible for casting the returned value to an array
+    * of the correct datatype.
+    *
+    * @param vecLen the length of the returned vector 
+    * @return a pointer to the vector of data values
+    */
+   const void* getVectorData(lt_uint32& vecLen) const;
+
+   /**
+    * get array data values
+    *
+    * This function returns the record's data as an array of values.
+    *
+    * Note the function returns via its parameters the same information as
+    * getNumDims() and getDims().
+    *
+    * The user is responsible for casting the returned value to an array
+    * of the correct datatype.
+    *
+    * @param numDims the number of dimensions in the \a dims parameter 
+    * @param dims the dimensionality array 
+    * @return a pointer to the array of data values
+    */
+   const void* getArrayData(lt_uint32& numDims, const lt_uint32*& dims) const;
+
+   /**
+    * get size of metadata record
+    *
+    * This function will return a close-enough estimate of the size of the
+    * record, as if it were to be written directly to disk.
+    *
+    * @return  size in bytes of the record
+    */
+   lt_int32 getApproximateSize() const;
+
+private:
+   void initialize(LTIMetadataTag tag,
+                   const void* data, const lt_uint32* dims);
+   void initialize(const char* tagName,
+                   const void* data, const lt_uint32* dims);
+
+   lt_uint32 computeLen() const;
+
+   char* m_tagName;
+   LTIMetadataDataType m_type;
+   lt_uint32 m_numDims;
+   lt_uint32* m_dims;
+   lt_uint8* m_data;
+   
+   // nope
+   LTIMetadataRecord& operator=(const LTIMetadataRecord&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTIMETADATARECORD_H
diff --git a/src/DSDK/include/metadata/lti_metadataStatus.h b/src/DSDK/include/metadata/lti_metadataStatus.h
new file mode 100644
index 0000000..f37922b
--- /dev/null
+++ b/src/DSDK/include/metadata/lti_metadataStatus.h
@@ -0,0 +1,47 @@
+/* $Id: lti_metadataStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_METADATASTATUS_H
+#define LTI_METADATASTATUS_H
+
+#include "lt_base.h"
+
+#define LTI_STS_Metadata_Base                               50500
+LT_STATUSSTRING_ADD(LTI_STS_Metadata_Base, "lt_lib_mrsid_metadata base")
+
+
+#define LTI_STS_Metadata_InternalError                      50501
+LT_STATUSSTRING_ADD(LTI_STS_Metadata_InternalError, "internal error")
+
+#define LTI_STS_Metadata_UnsupDataType                      50502
+LT_STATUSSTRING_ADD(LTI_STS_Metadata_UnsupDataType, "unsupported datatype")
+
+#define LTI_STS_Metadata_TagNotFound                        50503
+LT_STATUSSTRING_ADD(LTI_STS_Metadata_TagNotFound, "tag not found")
+
+#define LTI_STS_Metadata_DuplicateTag                       50504
+LT_STATUSSTRING_ADD(LTI_STS_Metadata_DuplicateTag, "duplicate tag")
+
+#define LTI_STS_Metadata_OldMetadataError                   50505
+LT_STATUSSTRING_ADD(LTI_STS_Metadata_OldMetadataError, "internal error - from old Metadata")
+
+#define LTI_STS_Metadata_ScalarAsciiOnly                    50506
+LT_STATUSSTRING_ADD(LTI_STS_Metadata_ScalarAsciiOnly, "only scalar ASCII records supported")
+
+#define LTI_STS_Metadata_BadFormatForTag                    50507
+LT_STATUSSTRING_ADD(LTI_STS_Metadata_BadFormatForTag, "bad format for given tag")
+
+#define LTI_STS_Metadata_Max                                50599
+LT_STATUSSTRING_ADD(LTI_STS_Metadata_Max, "lt_lib_mrsid_metadata max")
+
+
+#endif // LTI_METADATASTATUS_H
diff --git a/src/DSDK/include/metadata/lti_metadataTypes.h b/src/DSDK/include/metadata/lti_metadataTypes.h
new file mode 100644
index 0000000..b8285c0
--- /dev/null
+++ b/src/DSDK/include/metadata/lti_metadataTypes.h
@@ -0,0 +1,187 @@
+/* $Id: lti_metadataTypes.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC - C */
+
+#ifndef LTI_METADATATYPES_H
+#define LTI_METADATATYPES_H
+
+#include "lt_base.h"
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+#ifdef LT_CPLUSPLUS
+extern "C" {
+#endif
+
+/**
+ * enums corresponding to tag strings
+ *
+ * These constants are enums that may be used in place of the text strings
+ * used as tag names.
+ */
+typedef enum LTIMetadataTag
+{
+#ifndef DOXYGEN_EXCLUDE
+   LTI_METADATA_TAG_INVALID                              = 0,
+   LTI_METADATA_TAG_Unknown                              = 1,
+   LTI_METADATA_TAG_TestScalar                           = 2,
+   LTI_METADATA_TAG_TestVector                           = 3,
+   LTI_METADATA_TAG_TestArray                            = 4,
+
+   LTI_METADATA_TAG_IMAGE__SOM                           = 10,    /* short */
+   LTI_METADATA_TAG_IMAGE__EOM                           = 11,    /* short */
+
+   LTI_METADATA_TAG_IMAGE__INPUT_FORMAT                  = 100,   /* ascii */
+   LTI_METADATA_TAG_IMAGE__CREATION_DATE                 = 101,   /* ascii */
+   LTI_METADATA_TAG_IMAGE__INPUT_NAME                    = 102,   /* ascii */
+   LTI_METADATA_TAG_IMAGE__NO_DATA_VALUE                 = 103,   /* byte */
+   LTI_METADATA_TAG_IMAGE__INPUT_LUT                     = 104,   /* byte */
+   LTI_METADATA_TAG_IMAGE__NO_DITHER                     = 105,   /* byte */
+   LTI_METADATA_TAG_IMAGE__INPUT_FILE_SIZE               = 106,   /* double */
+   LTI_METADATA_TAG_IMAGE__DYNAMIC_RANGE_WINDOW          = 107,   /* double */
+   LTI_METADATA_TAG_IMAGE__DYNAMIC_RANGE_LEVEL           = 108,   /* double */
+   LTI_METADATA_TAG_IMAGE__TARGET_COMPRESSION_RATIO      = 109,   /* float */
+   LTI_METADATA_TAG_IMAGE__COMPRESSION_WEIGHT            = 110,   /* float */
+   LTI_METADATA_TAG_IMAGE__COMPRESSION_KWEIGHT           = 111,   /* float */
+   LTI_METADATA_TAG_IMAGE__COMPRESSION_GAMMA             = 112,   /* float */
+   LTI_METADATA_TAG_IMAGE__WIDTH                         = 113,   /* long */
+   LTI_METADATA_TAG_IMAGE__HEIGHT                        = 114,   /* long */
+   LTI_METADATA_TAG_IMAGE__COMPRESSION_BLOCK_SIZE        = 115,   /* long */
+   LTI_METADATA_TAG_IMAGE__COLOR_SCHEME                  = 116,   /* long */
+   LTI_METADATA_TAG_IMAGE__COMPRESSION_NLEV              = 117,   /* long */
+   LTI_METADATA_TAG_IMAGE__COMPRESSION_VERSION           = 118,   /* slong */
+   LTI_METADATA_TAG_IMAGE__DEFAULT_DATA_VALUE            = 119,   /* float or short or byte */
+   LTI_METADATA_TAG_IMAGE__TRANSPARENT_DATA_VALUE        = 120,   /* float or short or byte */
+   LTI_METADATA_TAG_IMAGE__FILE_IS_LOCKED                = 121,   /* byte */
+   LTI_METADATA_TAG_IMAGE__KEY                           = 122,   /* byte */
+   LTI_METADATA_TAG_IMAGE__SIGNATURE                     = 123,   /* byte */
+   LTI_METADATA_TAG_IMAGE__XY_ORIGIN                     = 124,   /* double */
+   LTI_METADATA_TAG_IMAGE__Z_ORIGIN                      = 125,   /* double */
+   LTI_METADATA_TAG_IMAGE__X_RESOLUTION                  = 126,   /* double */
+   LTI_METADATA_TAG_IMAGE__Y_RESOLUTION                  = 127,   /* double */
+   LTI_METADATA_TAG_IMAGE__Z_RESOLUTION                  = 128,   /* double */
+   LTI_METADATA_TAG_IMAGE__X_ROTATION                    = 129,	/* double */
+   LTI_METADATA_TAG_IMAGE__BITS_PER_SAMPLE               = 130,   /* short */
+   LTI_METADATA_TAG_IMAGE__HORIZONTAL_UNITS              = 131,   /* short */
+   LTI_METADATA_TAG_IMAGE__VERTICAL_UNITS                = 132,   /* short */
+   LTI_METADATA_TAG_IMAGE__DATA_TYPE                     = 133,   /* long */
+   LTI_METADATA_TAG_IMAGE__Z_UNITS                       = 134,   /* (unknown type) */
+   LTI_METADATA_TAG_IMAGE__Y_ROTATION                    = 135,	/* double */
+   LTI_METADATA_TAG_IMAGE__WKT                           = 137,	/* ascii */
+   LTI_METADATA_TAG_IMAGE__ENCODING_APPLICATION          = 138,	/* ascii */
+   LTI_METADATA_TAG_IMAGE__LTI_ESDK_VERSION              = 139,	/* ascii */
+
+   LTI_METADATA_TAG_GEO__PCSCitationGeoKey               = 200,   /* ascii */
+   LTI_METADATA_TAG_GEO__HORIZONTAL_DATUM                = 201,   /* short */
+   LTI_METADATA_TAG_GEO__ModelTypeGeoKey                 = 202,   /* short */
+   LTI_METADATA_TAG_GEO__ProjectedCSTypeGeoKey           = 203,   /* short */
+   LTI_METADATA_TAG_GEO__HORIZONTAL_COORDSYSTEMZONE      = 204,   /* (unknown type) */
+
+   LTI_METADATA_TAG_USGS__QUADCOMMENT                    = 300,   /* ascii */
+   LTI_METADATA_TAG_USGS__QUADRECT                       = 301,   /* double */
+
+   LTI_METADATA_TAG_IMG__CLASS_NAME                      = 400,   /* ascii */
+   LTI_METADATA_TAG_IMG__HORIZONTAL_UNITS                = 401,   /* ascii */
+   LTI_METADATA_TAG_IMG__TIME_STAMP                      = 402,   /* ascii */
+   LTI_METADATA_TAG_IMG__PROJECTION_NAME                 = 403,   /* ascii */
+   LTI_METADATA_TAG_IMG__PROJECTION_TYPE                 = 404,   /* ascii */
+   LTI_METADATA_TAG_IMG__PROJECTION_PARAMETERS           = 405,   /* ascii */
+   LTI_METADATA_TAG_IMG__SPHEROID_NAME                   = 406,   /* ascii */
+   LTI_METADATA_TAG_IMG__BYTEORDER                       = 407,	/* ascii */
+
+   LTI_METADATA_TAG_IMG__SPHEROID_SEMI_MAJOR_AXIS        = 408,   /* double */
+   LTI_METADATA_TAG_IMG__SPHEROID_SEMI_MINOR_AXIS        = 409,   /* double */
+   LTI_METADATA_TAG_IMG__SPHEROID_ECCENTRICITY_SQUARED   = 410,   /* double */
+   LTI_METADATA_TAG_IMG__SPHEROID_RADIUS                 = 411,   /* double */
+   LTI_METADATA_TAG_IMG__STATISTICS_MEAN                 = 412,   /* double */
+   LTI_METADATA_TAG_IMG__STATISTICS_MEDIAN               = 413,   /* double */
+   LTI_METADATA_TAG_IMG__STATISTICS_MODE                 = 414,   /* double */
+   LTI_METADATA_TAG_IMG__STATISTICS_STDDEV               = 415,   /* double */
+
+   LTI_METADATA_TAG_IMG__PROJECTION_NUMBER               = 416,   /* short */
+   LTI_METADATA_TAG_IMG__PROJECTION_ZONE                 = 417,   /* short */
+
+   LTI_METADATA_TAG_ICC__Profile                         = 500,   /* (unknown type) */
+   LTI_METADATA_TAG_PShop__ImageResources                = 501,   /* (unknown type) */
+
+   LTI_METADATA_TAG_USER__COMPANYNAME                    = 600,   /* ascii */
+   LTI_METADATA_TAG_USER__COPYRIGHT                      = 601,   /* ascii */
+   LTI_METADATA_TAG_USER__CREDIT                         = 602,   /* ascii */
+   LTI_METADATA_TAG_USER__SUMMARY                        = 603,   /* ascii */
+   LTI_METADATA_TAG_USER__KEYWORDS                       = 604,   /* ascii */
+   LTI_METADATA_TAG_USER__COMMENTS                       = 605,   /* ascii */
+   LTI_METADATA_TAG_USER__IMAGEID                        = 606,   /* ascii */
+   LTI_METADATA_TAG_USER__IMAGINGDATE                    = 607,   /* ascii */
+   LTI_METADATA_TAG_USER__IMAGINGTIME                    = 608,   /* ascii */
+   LTI_METADATA_TAG_USER__SOURCEDEVICE                   = 609,   /* ascii */
+   LTI_METADATA_TAG_USER__SCANINFO                       = 610,   /* ascii */
+   LTI_METADATA_TAG_USER__GEOGRAPHICLOCATION             = 611,   /* ascii */
+
+   LTI_METADATA_TAG_ASCII__COMMENT                       = 700,   /* ascii */
+
+   LTI_METADATA_TAG_GDAL__COORDINATE_SYSTEM              = 800,   /* 6 doubles */
+
+   LTI_METADATA_TAG_IMAGE__STATISTICS_MIN                = 900,   /* vector (pixel type) */
+   LTI_METADATA_TAG_IMAGE__STATISTICS_MAX                = 901,   /* vector (pixel type) */
+   LTI_METADATA_TAG_IMAGE__STATISTICS_MEAN               = 902,   /* double vector */
+   LTI_METADATA_TAG_IMAGE__STATISTICS_STANDARD_DEVIATION = 903,   /* double vector */
+
+   LTI_METADATA_TAG_LAST                                 = 10000
+#endif
+} LTIMetadataTag;
+
+
+/**
+ * datatypes used in database records
+ *
+ * These enums are used to represent the datatypes of values stored
+ * in LTIMetadataRecords.
+ */
+typedef enum LTIMetadataDataType
+{
+  LTI_METADATA_DATATYPE_INVALID           =   0,
+
+  LTI_METADATA_DATATYPE_UINT8             =   1,
+  LTI_METADATA_DATATYPE_SINT8             =   2,
+  LTI_METADATA_DATATYPE_UINT16            =   3,
+  LTI_METADATA_DATATYPE_SINT16            =   4,
+  LTI_METADATA_DATATYPE_UINT32            =   5,
+  LTI_METADATA_DATATYPE_SINT32            =   6,
+  LTI_METADATA_DATATYPE_UINT64            =   7,
+  LTI_METADATA_DATATYPE_SINT64            =   8,
+  LTI_METADATA_DATATYPE_FLOAT32           =   9,
+  LTI_METADATA_DATATYPE_FLOAT64           =  10,
+  LTI_METADATA_DATATYPE_ASCII             =  11,
+  
+  LTI_METADATA_TYPE_LAST                  = 0xffffffff
+} LTIMetadataDataType;
+
+
+typedef enum LTIClassicalMetadataConst
+{
+   LTI_CLASSICAL_METADATA_VERSION_MAJOR = 1,
+   LTI_CLASSICAL_METADATA_VERSION_MINOR = 0,
+   LTI_CLASSICAL_METADATA_MAX_KEY_NAME_SIZE = 100,
+   LTI_CLASSICAL_METADATA_MAX_DIMENSIONS = 10
+} LTIClassicalMetadataConst;
+
+
+#ifdef LT_CPLUSPLUS
+}
+#endif
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif
diff --git a/src/DSDK/include/metadata/lti_metadataUtils.h b/src/DSDK/include/metadata/lti_metadataUtils.h
new file mode 100644
index 0000000..021efca
--- /dev/null
+++ b/src/DSDK/include/metadata/lti_metadataUtils.h
@@ -0,0 +1,82 @@
+/* $Id: lti_metadataUtils.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_METADATAUTILS_H
+#define LTI_METADATAUTILS_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// lt_lib_mrsid_metadata
+#include "lti_metadataTypes.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+
+/**
+ * useful metadata type and tag functions
+ *
+ * This class contains several static utility functions useful for
+ * operating with tag names, tag numbers, and datatypes.
+ */
+class LTIMetadataUtils
+{
+public:
+   /**
+    * get numeric value of tag name
+    *
+    * This function returns the enum associated with a given tag name.
+    * It will return LTI_METADATA_TAG_Unknown if the string is not known.
+    *
+    * @param tagName the tagName
+    * @return the enum corresponding to \a tagName
+    */
+   static LTIMetadataTag lookupTag(const char* tagName);
+
+   /**
+    * get string value of numeric tag name
+    *
+    * This function returns the string associated with a given tag enum.
+    * It will return NULL if the tag enum is not known.
+    *
+    * @param tag the tag number
+    * @return the string corresponding to \a tag
+    */
+   static const char* lookupName(LTIMetadataTag tag);
+
+   /**
+    * get string representation of datatype
+    *
+    * This function returns a string representation of the given datatype,
+    * useful for debugging.
+    *
+    * @param dataType the datatype to use
+    * @return the string version of the given datatype
+    */
+   static const char* name(LTIMetadataDataType dataType);
+};
+
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_METADATAUTILS_H
diff --git a/src/DSDK/include/metadata/lti_metadataWriter.h b/src/DSDK/include/metadata/lti_metadataWriter.h
new file mode 100644
index 0000000..115de0d
--- /dev/null
+++ b/src/DSDK/include/metadata/lti_metadataWriter.h
@@ -0,0 +1,90 @@
+/* $Id: lti_metadataWriter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_METADATA_WRITER_H
+#define LTI_METADATA_WRITER_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+class LTIMetadataDatabase;
+
+
+/**
+ * abstract class for exporting a metadata database
+ *
+ * This abstract class provides an interface for exporting metadata records
+ * from an LTIMetadataDatabase to a foreign source.
+ *
+ * This is used, for example, to provide a mechanism for writing the
+ * format-neutral, in-memory database into binary TIFF tag format.  it
+ * is also used to dump the database to plain-text format (for debugging).
+ */
+class LTIMetadataWriter
+{
+public:
+   /**
+    * default constructor
+    *
+    * This base constructor creates a writer object which can export
+    * records from a database to some foreign format.
+    *
+    * @param database the database to be read into
+    */
+   LTIMetadataWriter(const LTIMetadataDatabase& database);
+
+   /**
+    * destructor
+    */
+   virtual ~LTIMetadataWriter();
+
+   /**
+    * write records out from database
+    *
+    * This function must be implemented in the derived class.  It should
+    * write each of the LTIMetadataRecord objects in the database out to
+    * the foreign format.
+    *
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS write() const = 0;
+
+protected:
+   /**
+    * the database to be written from
+    *
+    * This is the database to be written out from.  Derived classes may access
+    * it directly.
+    */
+   const LTIMetadataDatabase& m_database;
+
+private:
+   // nope
+   LTIMetadataWriter(const LTIMetadataWriter&);
+   LTIMetadataWriter& operator=(const LTIMetadataWriter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LTI_METADATA_WRITER_H
diff --git a/src/DSDK/include/mrsid_readers/MG3CompositeImageReader.h b/src/DSDK/include/mrsid_readers/MG3CompositeImageReader.h
new file mode 100644
index 0000000..8dc1c7d
--- /dev/null
+++ b/src/DSDK/include/mrsid_readers/MG3CompositeImageReader.h
@@ -0,0 +1,272 @@
+/* $Id: MG3CompositeImageReader.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef MG3COMPOSITEIMAGEREADER_H
+#define MG3COMPOSITEIMAGEREADER_H
+
+// lt_lib_mrsid_mrsidReaders
+#include "MrSIDImageReaderBase.h"
+
+// lt_lib_mrsid_core
+#include "lti_imageStageManager.h"
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class MG3Container;
+class MG3SingleImageReader;
+class MG2ImageReader;
+
+/**
+ * reader for MrSID/MG3 images
+ *
+ * This class supports reading MrSID/MG3 images.
+ *
+ * @note MrSID/MG2 images are not supported with this class.
+ */
+class MG3CompositeImageReader : public MrSIDImageReaderBase,
+                                public LTIImageStageManager
+{
+public:
+   /**
+    * constructor
+    *
+    * Create an MG3 reader from the given file.
+    *
+    * The \a imageNumber array allows for control over
+    * which tiles in the image should be opened to form
+    * the composite (mosaic) image.  If NULL is passed,
+    * all tiles will be used.
+    *
+    * To determine the tiles available in the image,
+    * you can use the static getCompositeImageInfo()
+    * member function.
+    *
+    * @param fileSpec      file containing MrSID image
+    * @param imageNumber   array of image tile numbers
+    * @param numImages     size of \a imageNumber array
+    * @param useWorldFile  incorporate world file data when reading image
+    * @param memoryUsage   control memory resource usage
+    * @param streamUsage   control stream resource usage
+    */
+   MG3CompositeImageReader(const LTFileSpec& fileSpec,
+                           const lt_uint32* imageNumber,
+                           lt_uint32 numImages,
+                           bool useWorldFile,
+                           MrSIDMemoryUsage memoryUsage,
+                           MrSIDStreamUsage streamUsage);
+
+   /**
+    * constructor
+    *
+    * Construct an MG3 image from a stream.  (See file-based
+    * constructor for details.)
+    *
+    * @param stream           stream containing MrSID image (may not be NULL)
+    * @param imageNumber      array of image tile numbers
+    * @param numImages        size of \a imageNumber array
+    * @param worldFileStream  stream containing world file data (may be NULL)
+    * @param memoryUsage      control memory resource usage
+    * @param streamUsage      control stream resource usage
+    */
+   MG3CompositeImageReader(LTIOStreamInf* stream,
+                           const lt_uint32* imageNumber,
+                           lt_uint32 numImages,
+                           LTIOStreamInf* worldFileStream,
+                           MrSIDMemoryUsage memoryUsage,
+                           MrSIDStreamUsage streamUsage);
+
+   MG3CompositeImageReader(MG3Container* container,
+                           const lt_uint32* imageNumber,
+                           lt_uint32 numImages,
+                           LTIOStreamInf* worldFileStream,
+                           MrSIDMemoryUsage memoryUsage,
+                           MrSIDStreamUsage streamUsage);
+
+   virtual ~MG3CompositeImageReader();
+   LT_STATUS initialize();
+
+   LT_STATUS setStripHeight(lt_uint32 stripHeight);
+   lt_uint32 getStripHeight() const;
+
+   lt_uint8 getNumLevels() const;
+   bool isLocked() const;
+
+   void getVersion(lt_uint8& major, lt_uint8& minor, lt_uint8& tweak, char& letter) const;
+
+   /**
+    * query if is optimizable
+    *
+    * Returns true if and only if the image can be further compressed.
+    *
+    * @return true, if and only if the image may be compressed
+    */
+   bool isOptimizable() const;
+
+   /**
+    * tile type queries
+    *
+    * This function are used to determine whether any of the tiles
+    * in the image are MG2.
+    */
+   /*@{*/
+   bool hasMG2Data() const;
+   /*@}*/
+
+   lt_uint32 getMinBlockSize() const;
+   lt_uint32 getMaxBlockSize() const;
+
+   void setInterruptDelegate(LTIInterruptDelegate* delegate);
+
+   lt_int64 getPhysicalFileSize() const;
+
+   /**
+    * file format type of image tile
+    */
+   enum CompositeImageType
+   {
+      COMPOSITETYPE_MG2 = 1,
+      COMPOSITETYPE_MG3 = 2
+   };
+
+   /**
+    * structure representing tiled image
+    */
+   struct CompositeImageInfo
+   {
+      /** image tile number */
+      lt_uint32 imageId;
+
+      /** x-position of tile in the mosaic */
+      double xPos;
+
+      /** y-position of tile in the mosaic */
+      double yPos;
+
+      /** type of image tile */
+      CompositeImageType imageType;
+   };
+
+   /**
+    * query tile information
+    *
+    * This function is used to collect information about the tiles in the
+    * image.
+    *
+    * The caller takes ownership of the returned \a tileInfo array.
+    *
+    * @param  tileInfo  array of tile information structures to be set
+    * @param  numTiles  number of tiles
+    * @return status code indicating success or failure
+    */
+   LT_STATUS getTileInfo(CompositeImageInfo *&tileInfo, lt_uint32 &numTiles) const;
+
+   /**
+    * query tile information
+    *
+    * This function is used to collect information about the tiles in
+    * the image contained in the given file.
+    *
+    * The caller takes ownership of the returned \a info array.
+    *
+    * @param  fileSpec  name of image to query
+    * @param  tileInfo  array of tile information structures to be set
+    * @param  numTiles  number of tiles
+    * @return status code indicating success or failure
+    */
+   static LT_STATUS getCompositeImageInfo(const LTFileSpec &fileSpec,
+                                          CompositeImageInfo *&tileInfo,
+                                          lt_uint32 &numTiles);
+
+   /**
+    * query tile information
+    *
+    * This function is used to collect information about the tiles in
+    * the image contained in the given stream.
+    *
+    * The caller takes ownership of the returned \a info array.
+    *
+    * @param  stream    stream containing image to query
+    * @param  tileInfo  array of tile information structures to be set
+    * @param  numTiles  number of tiles
+    * @return status code indicating success or failure
+    */
+   static LT_STATUS getCompositeImageInfo(LTIOStreamInf &stream,
+                                          CompositeImageInfo *&tileInfo,
+                                          lt_uint32 &numTiles);
+
+   static LT_STATUS getCompositeImageInfo(const MG3Container &container,
+                                          CompositeImageInfo *&tileInfo,
+                                          lt_uint32 &numTiles);
+
+
+   bool getReaderScene(lt_uint32 imageIndex,
+                       const LTIScene &scene,
+                       LTIScene &mosaicScene,
+                       LTIScene &readerScene) const;
+
+   LT_STATUS projectPointAtMag(double upperLeft,
+                               double mag,
+                               double& newUpperLeft) const;
+   
+   LT_STATUS projectDimAtMag(double dim,
+                             double mag,
+                             double& newDim) const;
+
+   LT_STATUS getDimsAtMag(double mag,
+                          lt_uint32& width,
+                          lt_uint32& height) const;
+
+
+protected:
+   LT_STATUS decodeBegin(const LTIScene& scene);
+   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer,
+                         const LTIScene& stripScene);
+   LT_STATUS decodeEnd();
+
+   LT_STATUS init(void);
+
+   virtual LT_STATUS createMG2Reader(lt_uint32 imageNumber,
+                                       MG2ImageReader *&mg2Reader);
+   virtual LT_STATUS createMG3Reader(lt_uint32 imageNumber,
+                                       MG3SingleImageReader *&mg3Reader);
+                              
+   virtual LT_STATUS updateMemoryModel();
+
+   LT_STATUS createImageStage(lt_uint32 imageNumber,
+                              LTIImageStage *&imageStage);
+
+   LT_STATUS deleteImageStage(lt_uint32 imageNumber,
+                              LTIImageStage *imageStage);
+
+   struct Data;
+   Data *m_dat;
+
+private:
+   typedef MrSIDImageReaderBase Super;
+
+   // nope
+   MG3CompositeImageReader(const MG3CompositeImageReader&);
+   MG3CompositeImageReader& operator=(const MG3CompositeImageReader&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // MG3COMPOSITEIMAGEREADER_H
diff --git a/src/DSDK/include/mrsid_readers/MrSIDImageReader.h b/src/DSDK/include/mrsid_readers/MrSIDImageReader.h
new file mode 100644
index 0000000..6f07fc3
--- /dev/null
+++ b/src/DSDK/include/mrsid_readers/MrSIDImageReader.h
@@ -0,0 +1,184 @@
+/* $Id: MrSIDImageReader.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef MRSIDIMAGEREADER_H
+#define MRSIDIMAGEREADER_H
+
+// lt_lib_mrsid_mrsidReader
+#include "MrSIDImageReaderBase.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTFileSpec;
+class LTIOStreamInf;
+class MG2ImageReader;
+class MG3SingleImageReader;
+class MG3CompositeImageReader;
+class MG3Container;
+
+
+/**
+ * reader for MrSID images (MG2 and MG3)
+ *
+ * This class supports reading MrSID/MG2 and MrSID/MG3 images, including
+ * composite MG3 images.
+ */
+class MrSIDImageReader : public MrSIDImageReaderBase
+{
+public:
+   /**
+    * constructor
+    *
+    * Construct a MrSID reader from the given file.
+    *
+    * @param  fileSpec      file containing MrSID image
+    * @param  useWorldFile  incorporate world file data when reading image
+    * @param  memoryUsage   control memory resource usage
+    * @param  streamUsage   control stream resource usage
+    */
+   MrSIDImageReader(const LTFileSpec& fileSpec,
+                    bool useWorldFile = false,
+                    MrSIDMemoryUsage memoryUsage=MRSID_MEMORY_USAGE_DEFAULT,
+                    MrSIDStreamUsage streamUsage=MRSID_STREAM_USAGE_DEFAULT);
+
+   /**
+    * constructor
+    *
+    * Construct a MrSID reader from the given stream.
+    *
+    * @param  stream        stream containing MrSID image (may not be NULL)
+    * @param  worldFileStream  stream containing world file data (may be NULL)
+    * @param  memoryUsage   control memory resource usage
+    * @param  streamUsage   control stream resource usage
+    */
+   MrSIDImageReader(LTIOStreamInf* stream,
+                    LTIOStreamInf* worldFileStream = 0,
+                    MrSIDMemoryUsage memoryUsage=MRSID_MEMORY_USAGE_DEFAULT,
+                    MrSIDStreamUsage streamUsage=MRSID_STREAM_USAGE_DEFAULT);
+
+   virtual ~MrSIDImageReader();
+
+   virtual LT_STATUS initialize();
+
+   /**
+    * number of levels
+    * 
+    * Return the number of resolution levels in the image.  (This is similar to querying
+    * getMinMagnificaton(), but expressed as an integer.)
+    *
+    * @return the number of levels in the image
+    */
+   virtual lt_uint8 getNumLevels() const;
+
+   /**
+    * query for image encryption
+    * 
+    * Return true if the image is password-protected.
+    *
+    * @return true, if and only if the image is encrypted
+    */
+   virtual bool isLocked() const;
+
+   /**
+    * query for file format version
+    * 
+    * This functions returns detailed version information for the
+    * MG2 or MG3 file.
+    *
+    * @param major the major version number
+    * @param minor the minor version number
+    * @param tweak the reversion number
+    * @param letter the format letter (MG3 only)
+    */
+   virtual void getVersion(lt_uint8& major, lt_uint8& minor, lt_uint8& tweak, char& letter) const;
+
+   virtual lt_int64 getPhysicalFileSize() const;
+
+   virtual LT_STATUS setStripHeight(lt_uint32 stripHeight);
+   virtual lt_uint32 getStripHeight() const;
+
+   // not for the faint of heart
+   MG2ImageReader* getMG2Reader() const;
+   MG3SingleImageReader* getMG3SingleReader() const;
+   MG3CompositeImageReader* getMG3CompositeReader() const;
+
+   virtual LT_STATUS projectPointAtMag(double upperLeft,
+                                       double mag,
+                                       double& newUpperLeft) const;
+   virtual LT_STATUS projectDimAtMag(double dim,
+                                     double mag,
+                                     double& newDim) const;
+
+   virtual LT_STATUS getDimsAtMag(double mag,
+                                  lt_uint32& width,
+                                  lt_uint32& height) const;
+
+   void setProgressDelegate(LTIProgressDelegate* delegate);
+   void setInterruptDelegate(LTIInterruptDelegate* delegate);
+
+protected:
+   virtual LT_STATUS decodeBegin(const LTIScene& scene);
+   virtual LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer,
+                                 const LTIScene& stripScene);
+   virtual LT_STATUS decodeEnd();
+
+   virtual LT_STATUS createMG2Reader(void);
+   virtual LT_STATUS createMG3Reader(void);
+
+#ifndef DOXYGEN_EXCLUDE
+   struct Data
+   {
+      ~Data(void);
+      Data(const LTFileSpec *fileSpec,
+           LTIOStreamInf *stream,
+           MG3Container* container,
+           LTIOStreamInf* worldFileStream);
+   
+      LTIOStreamInf* m_stream;
+      LTFileSpec* m_fileSpec;
+      bool m_ownStream;
+      LTIOStreamInf* m_worldFileStream;
+      MG3Container* m_container;
+      MrSIDImageReaderBase *m_mrsidReader;
+      enum MrSIDType
+      {
+         MRSID_TYPE_MG2 = 2,
+         MRSID_TYPE_MG3S = 3,
+         MRSID_TYPE_MG3C = 4
+      };
+      MrSIDType m_mrsidType;
+   };
+      
+#endif
+   Data *m_dat;
+
+private:
+   typedef MrSIDImageReaderBase Super;
+
+   // nope
+   MrSIDImageReader(const MrSIDImageReader&);
+   MrSIDImageReader& operator=(const MrSIDImageReader&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // MRSIDIMAGEREADER_H
diff --git a/src/DSDK/include/mrsid_readers/MrSIDImageReaderBase.h b/src/DSDK/include/mrsid_readers/MrSIDImageReaderBase.h
new file mode 100644
index 0000000..49f6bff
--- /dev/null
+++ b/src/DSDK/include/mrsid_readers/MrSIDImageReaderBase.h
@@ -0,0 +1,235 @@
+/* $Id: MrSIDImageReaderBase.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef MRSIDIMAGEREADERBASE_H
+#define MRSIDIMAGEREADERBASE_H
+
+// lt_lib_mrsid_core
+#include "lti_geoImageReader.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTFileSpec;
+class LTIOStreamInf;
+class MrSIDPasswordDelegate;
+class MrSIDSimplePasswordDelegate;
+
+/*
+ * memory settings for creating MrSID decoders
+ *
+ * "Small", "medium", and "large" refer to how much memory the
+ * decoder will use when opening the image and constructing certain
+ * internal data structures and tables.  In general, decode
+ * performance will increase if more memory can be used.
+ */
+enum MrSIDMemoryUsage
+{
+   MRSID_MEMORY_USAGE_INVALID    = 0,
+   MRSID_MEMORY_USAGE_DEFAULT    = 1,
+   MRSID_MEMORY_USAGE_SMALL      = 2,
+   MRSID_MEMORY_USAGE_MEDIUM     = 3,
+   MRSID_MEMORY_USAGE_LARGE      = 4
+};
+
+/*
+ * stream settings for creating MrSID decoders
+ *
+ * Normally, the stream used by the decoder is
+ * only opened when doing actual decode work, as resources like
+ * file handles can be a scarce resource in some environments.  This
+ * obviously incurs a performance penalty; the "KeepStreamOpen" modes
+ * can be used to change the behaviour.
+ */
+enum MrSIDStreamUsage
+{
+   MRSID_STREAM_USAGE_INVALID    = 0,
+   MRSID_STREAM_USAGE_KEEPOPEN   = 2,
+   MRSID_STREAM_USAGE_KEEPCLOSED = 3,
+   MRSID_STREAM_USAGE_DEFAULT    = MRSID_STREAM_USAGE_KEEPCLOSED
+};
+
+
+/**
+ * base class for MrSID image readers
+ *
+ * All the MrSID image readers (MrSIDImageReader, MG3CompositeImageReader, etc)
+ * inherit from this class.
+ */
+class MrSIDImageReaderBase : public LTIGeoImageReader
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates a MrSIDImageReaderBase object.
+    *
+    * @param  memoryUsage   the memory model to use
+    * @param  streamUsage   the stream model to use
+    * @param  useWorldFile  whether or not a world file is being used
+    */
+   MrSIDImageReaderBase(MrSIDMemoryUsage memoryUsage,
+                        MrSIDStreamUsage streamUsage,
+                        bool useWorldFile);
+   virtual ~MrSIDImageReaderBase();
+   virtual LT_STATUS initialize();
+
+   /**
+    * get number of resolution levels
+    *
+    * Returns the number of resolution levels supported by the image.
+    * This value returned corresponds to the LTIImage::getMinMagnification()
+    * function.
+    *
+    * @return the number of resolution levels in the MrSID image
+    */
+   virtual lt_uint8 getNumLevels() const =0;
+
+   /**
+    * image encryption query
+    *
+    * Returns true iff the image is password-protected.  If the image is
+    * locked, the setPasswordDelegate() or setPassword() function must be
+    * used to provide the decoder with information to decrypt the image
+    * as decode requests are processed.
+    *
+    * @return true, if image is password-protected
+    */
+   virtual bool isLocked() const =0;
+
+   /**
+    * get MrSID image version
+    *
+    * Returns detailed version information for the MrSID image.  Typical
+    * version numbers will be 1.0.1 for MG2 (the \a letter value is not
+    * used) and 3.0.26.q for MG3.  Most developers need only consider the
+    * \a major number, which will be either 2 or 3..
+    *
+    * See also getSidVersion().
+    *
+    * @param major  the major version number
+    * @param minor  the minor version number
+    * @param tweak  the revision number
+    * @param letter  the revision build number (MG3 only)
+    */
+   virtual void getVersion(lt_uint8& major, lt_uint8& minor, lt_uint8& tweak, char& letter) const=0;
+
+   /**
+    * set password handler
+    *
+    * This function is used to set up a password delegate, which will be
+    * automatically called form within the internal decoder logic to obtain
+    * a text password, if one is needed for decoded the image.
+    *
+    * Alternatively, the more direct setPassword() function may be used.
+    *
+    * See the isLocked() function for more details.
+    * 
+    * @param  passwordDelegate  the delegate to be called
+    */
+   void setPasswordDelegate(MrSIDPasswordDelegate* passwordDelegate);
+
+   /**
+    * set password handler
+    *
+    * This function is set the password used by the decoder logic
+    * to decode the image, if one is needed.
+    *
+    * The password must be set prior to performing any decode (read)
+    * requests; for more flexibility, the setPasswordDelegate() function
+    * may be used.
+    *
+    * See the isLocked() function for more details.
+    * 
+    * @param  password  the password for the image
+    */
+   void setPassword(const lt_utf8* password);
+
+public:
+   /**
+    * get MrSID version information
+    *
+    * Returns version information for a specific MrSID image.  This is
+    * a static function, which is passed a filename; the getVersion()
+    * function operates on the image represented by this MrSIDImageReaderBase
+    * image and returns more detailed information.
+    *
+    * The \a ver value returned will be 2 (for MrSID/MG2), 3 (for MrSID/MG3),
+    * or 0 (if error).
+    *
+    * @param fileSpec  the file to get the version of
+    * @param ver       the major version number
+    * @return status code indicating success or failure
+    */
+   static LT_STATUS getSidVersion(const LTFileSpec& fileSpec, lt_uint8& ver);
+
+   /**
+    * MrSID version information
+    *
+    * Returns version information for a specific MrSID image.  This is
+    * a static function, which is passed a stream; the getVersion()
+    * function operates on the image represented by this MrSIDImageReaderBase
+    * image and returns more detailed information.
+    *
+    * The \a ver value returned will be 2 (for MrSID/MG2), 3 (for MrSID/MG3),
+    * or 0 (if error).
+    *
+    * @param stream  the file to get the version of
+    * @param ver       the major version number
+    * @return status code indicating success or failure
+    */
+   static LT_STATUS getSidVersion(LTIOStreamInf& stream, lt_uint8& ver);
+
+protected:
+
+   LT_STATUS setupDynamicRangeFromMetadata(bool& gotThem,
+                                           double& min,
+                                           double& max);
+
+   static LT_STATUS setupClutFromMetadata(const LTIMetadataDatabase& metadata,
+                                          LTIPixelLookupTable*& clut);
+
+   static LT_STATUS setupDefaultPixelFromMetadata(LTIMetadataDatabase& metadata,
+                                                  const LTIPixel& pixelProps,
+                                                  LTIPixel*& backgroundPixel,
+                                                  LTIPixel*& nodataPixel);
+
+   LT_STATUS updateGeoCoordFromMetadata(void);
+
+   LT_STATUS updateGeoMetadata();
+
+   MrSIDMemoryUsage m_memoryUsage;
+   MrSIDStreamUsage m_streamUsage;
+
+private:
+   typedef LTIImageReader Super;
+
+   MrSIDPasswordDelegate* m_pwdDelegate;
+   MrSIDSimplePasswordDelegate* m_localPwdDelegate;
+
+   // nope
+   MrSIDImageReaderBase(const MrSIDImageReaderBase&);
+   MrSIDImageReaderBase& operator=(const MrSIDImageReaderBase&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // MRSIDIMAGEREADERBASE_H
diff --git a/src/DSDK/include/mrsid_readers/MrSIDPasswordDelegate.h b/src/DSDK/include/mrsid_readers/MrSIDPasswordDelegate.h
new file mode 100644
index 0000000..fe339ba
--- /dev/null
+++ b/src/DSDK/include/mrsid_readers/MrSIDPasswordDelegate.h
@@ -0,0 +1,171 @@
+/* $Id: MrSIDPasswordDelegate.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef MRSIDPASSWORDDELEGATE_H
+#define MRSIDPASSWORDDELEGATE_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+
+class EncryptImp;
+class MrSIDImageReaderBase;
+class MG2ImageWriter;
+class MG3ImageWriter;
+
+
+/**
+ * delegate for locked MrSID images
+ *
+ * This abstract class is used with MrSIDImageReaderBase::setPasswordDelegate()
+ * to supply a user-callback mechanism for supplying text passwords to
+ * the internal MrSID decoder logic.
+ *
+ * Users should derive their own class from this, supplying their own
+ * reportIncorrectPassword() and getPassword() methods.
+ */
+class MrSIDPasswordDelegate
+{
+public:
+   /**
+    * constructor
+    */
+   MrSIDPasswordDelegate();
+
+   /**
+    * destructor
+    */
+   virtual ~MrSIDPasswordDelegate();
+
+   /**
+    * user function for user notification
+    *
+    * This function is called by the decoder if the password
+    * entered was incorrect.  Derived classes must implement
+    * this function, e.g. to pop up a message box, abort the
+    * operation, etc.
+    *
+    * @return success or failure in reporting to user
+    */
+   virtual LT_STATUS reportIncorrectPassword() = 0;
+
+   /**
+    * user function for getting the password
+    *
+    * This function is called by the decoder to request a password
+    * from the user.  Derived classes must implement
+    * this function, e.g. to pop up a text-entry dialog box.
+    *
+    * The implementation of this function must copy the password
+    * into the buffer pointed by getPasswordBuffer().
+    *
+    * @return success or failure in getting password from user
+    */
+   virtual LT_STATUS getPassword() = 0;
+
+protected:
+   /**
+    * get password buffer
+    *
+    * This function returns a pointer to the allocated area for the
+    * password obtained from the user.
+    *
+    * @return  pointer to the password buffer
+    */
+   char* getPasswordBuffer();
+
+   /**
+    * get password buffer length
+    *
+    * This function returns the length of the buffer returned from
+    * getPasswordBuffer().
+    *
+    * @return  length of the password buffer
+    */
+   lt_uint32 getPasswordBufferLength();
+
+private:
+   friend class EncryptImp;
+   EncryptImp* m_encryptImp;
+   char* m_passwordBuffer;
+   
+   static const lt_uint32 s_passwordBufferLength;
+
+   friend class MrSIDImageReaderBase;
+   friend class MG2ImageWriter;
+   friend class MG3ImageWriter;
+   void registerProvider();
+
+   // nope
+   MrSIDPasswordDelegate(const MrSIDPasswordDelegate&);
+   MrSIDPasswordDelegate& operator=(const MrSIDPasswordDelegate&);
+};
+
+
+/**
+ * simple concrete delegate for locked MrSID images
+ *
+ * This class is a concrete password delegate class which just
+ * takes a fixed string in its ctor.
+ */
+class MrSIDSimplePasswordDelegate : public MrSIDPasswordDelegate
+{
+public:
+   /**
+    * constructor
+    * 
+    * Create a password delegate, using the given string.
+    *
+    * @param password the password to use to unlock the image
+    */
+   MrSIDSimplePasswordDelegate(const char* password);
+
+   /**
+    * failure user notification
+    *
+    * This function just returns LT_STS_Failure.
+    *
+    * @return always LT_STS_Failure
+    */
+   LT_STATUS reportIncorrectPassword();
+
+   /**
+    * get the password
+    *
+    * This function does nothing, as the password is fixed (determined
+    * by parameter to constructor).
+    *
+    * @return always LT_STS_Success
+    */
+   LT_STATUS getPassword();
+
+private:
+   // nope
+   MrSIDSimplePasswordDelegate(const MrSIDSimplePasswordDelegate&);
+   MrSIDSimplePasswordDelegate& operator=(const MrSIDSimplePasswordDelegate&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // MRSIDPASSWORDDELEGATE_H
diff --git a/src/DSDK/include/mrsid_readers/lti_mrsidReadersStatus.h b/src/DSDK/include/mrsid_readers/lti_mrsidReadersStatus.h
new file mode 100644
index 0000000..0887a6f
--- /dev/null
+++ b/src/DSDK/include/mrsid_readers/lti_mrsidReadersStatus.h
@@ -0,0 +1,67 @@
+/* $Id: lti_mrsidReadersStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_MRSIDREADERSSTATUS_H
+#define LTI_MRSIDREADERSSTATUS_H
+
+#include "lt_base.h"
+
+
+#define LTI_STS_MrSIDReaders_Base                           50600
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_Base, "lt_lib_mrsid_mrsidReaders base")
+
+#define LTI_STS_MrSIDReaders_UnsupColorSpace                50601
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_UnsupColorSpace, "unsupported colorspace")
+
+#define LTI_STS_MrSIDReaders_UnsupDataType                  50602
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_UnsupDataType, "unsupported datatype")
+
+#define LTI_STS_MrSIDReaders_InvalidMemoryModel             50603
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_InvalidMemoryModel, "invalid memory model")
+
+#define LTI_STS_MrSIDReaders_InvalidMetadata                50604
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_InvalidMetadata, "invalid metadata")
+
+#define LTI_STS_MrSIDReaders_MetadataReadError              50605
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_MetadataReadError, "error reading metadata")
+
+#define LTI_STS_MrSIDReaders_InvalidStripHeight             50606
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_InvalidStripHeight, "invalid stripheight")
+
+#define LTI_STS_MrSIDReaders_BadFileFormat                  50607
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_BadFileFormat, "invalid mrsid file format")
+
+
+#define LTI_STS_MrSIDReaders_BadMG2letInit                  50608
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_BadMG2letInit, "mg2let init error")
+
+#define LTI_STS_MrSIDReaders_BadMG3letInit                  50609
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_BadMG3letInit, "mg3let init error")
+
+#define LTI_STS_MrSIDReaders_MG2Error                       50610
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_MG2Error, "error decoding MG2 file")
+
+#define LTI_STS_MrSIDReaders_BadSidletFormat                50611
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_BadSidletFormat, "invalid sidlet message")
+
+#define LTI_STS_MrSIDReaders_UnknownTileImageFormat         50612
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_UnknownTileImageFormat, "unknown tile image format")
+
+#define LTI_STS_MrSIDReaders_CannotOpenFile                 50613
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_CannotOpenFile, "can't open file: %F")
+
+
+#define LTI_STS_MrSIDReaders_Max                            50699
+LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_Max, "lt_lib_mrsid_mrsidReaders max")
+
+
+#endif // LTI_MRSIDREADERSSTATUS_H
diff --git a/src/DSDK/include/support/lt_base.h b/src/DSDK/include/support/lt_base.h
new file mode 100644
index 0000000..36ef027
--- /dev/null
+++ b/src/DSDK/include/support/lt_base.h
@@ -0,0 +1,30 @@
+/* $Id: lt_base.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+/**
+ * @file
+ *
+ * Include file for all LizardTech sources.  This file should be included
+ * before any other LizardTech headers.
+ *
+ * @note This file is C-callable.
+ */
+
+#ifndef LT_BASE_H
+#define LT_BASE_H
+
+#include "lt_platform.h"
+#include "lt_define.h"
+#include "lt_types.h"
+#include "lt_status.h"
+
+#endif /* LT_BASE_H */
diff --git a/src/DSDK/include/support/lt_define.h b/src/DSDK/include/support/lt_define.h
new file mode 100644
index 0000000..d8b7e20
--- /dev/null
+++ b/src/DSDK/include/support/lt_define.h
@@ -0,0 +1,154 @@
+/* $Id: lt_define.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+/**
+ * @file
+ *
+ * Preprocessor definitions used throughout LizardTech sources.  This file
+ * should not be included directly; use lt_base.h instead.
+ *
+ * @note This file is C-callable.
+ */
+
+#ifndef LT_DEFINE_H
+#define LT_DEFINE_H
+
+#include "lt_platform.h"
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4) 
+#endif
+
+
+/**
+ * @name Language settings
+ */
+/*@{*/
+
+#if defined(__cplusplus)
+   /** compiler supports C++ (as opposed to straight C) */
+   #define LT_CPLUSPLUS
+#endif
+
+/*}@*/
+
+
+/**
+ * @name C++ namespace settings
+ */
+/*@{*/
+
+#if defined(__cplusplus) && \
+    ( defined(LT_COMPILER_MS) || \
+      defined(LT_COMPILER_GNU) || \
+      defined(LT_COMPILER_SUN) || \
+      defined(_USE_NAMESPACE_) )
+   /** compiler supports namespaces */
+   #define LT_NAMESPACE_SUPPORT
+#else
+   /** compiler does not support namespaces */
+   #undef LT_NAMESPACE_SUPPORT
+#endif
+
+#ifdef LT_NAMESPACE_SUPPORT
+   /** declare start of namespace, for declarations */
+   #define LT_BEGIN_NAMESPACE( theNameSpace ) namespace theNameSpace {
+   /** declare end of namespace, for declarations */
+   #define LT_END_NAMESPACE( theNameSpace )   }
+
+   /** declare start of nameless namespace, for declarations */
+   #define LT_BEGIN_NAMELESS_NAMESPACE namespace {
+   /** declare end of nameless namespace, for declarations */
+   #define LT_END_NAMELESS_NAMESPACE   }
+
+   /** declare use of namespace */
+   #define LT_USE_NAMESPACE( theNameSpace ) using namespace theNameSpace;
+   /** declare use of name */
+   #define LT_USE_NAME( theName ) using theName;
+#else
+   #define LT_BEGIN_NAMESPACE( theNameSpace )
+   #define LT_END_NAMESPACE( theNameSpace )
+
+   #define LT_BEGIN_NAMELESS_NAMESPACE 
+   #define LT_END_NAMELESS_NAMESPACE  
+
+   #define LT_USE_NAMESPACE( theNameSpace ) 
+   #define LT_USE_NAME( theName ) 
+#endif
+
+/*@}*/
+
+
+/**
+ * @name Debug settings
+ */
+/*@{*/
+
+#if (defined(LT_OS_WIN) && defined(_DEBUG))
+   /** symbol for enabling debug code */
+   #define LT_DEBUG
+#endif
+
+/*@}*/
+
+
+/**
+ * @name Miscellaneous macros
+ */
+/*@{*/
+
+/** macro turns its argument into a quoted string */
+#define LT_STRINGIFY(x) #x
+/** macro expands its argument, and it into a quoted string */
+#define LT_XSTRINGIFY(x) LT_STRINGIFY(x)
+
+/** return lesser of two parameters */
+#define LT_MIN(A,B) ((A) < (B) ? (A) : (B))
+/** return greater of two parameters */
+#define LT_MAX(A,B) ((A) > (B) ? (A) : (B))
+
+/*@}*/
+
+
+
+
+
+/**
+ * @name Support for status string generation
+ */
+/*@{*/
+
+#if defined(LT_STATUSSTRING_GENERATE)
+   #define LT_STATUSSTRING_ADD(NUM,STR)    { NUM, STR },
+#else
+   #define LT_STATUSSTRING_ADD(NUM,STR)
+#endif
+
+typedef struct { int code; const char* str; } LTStatusStringTable;
+/*@}*/
+
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(pop) 
+#endif
+
+
+/* globally disable spurious VC++ warning resulting from use of templates  */
+#ifdef LT_COMPILER_MS
+   #pragma warning(disable:4786)
+#endif
+
+
+/* other includes to provide users of lt_define.h */
+#include "lt_types.h"
+
+#endif /* LT_DEFINE_H */
diff --git a/src/DSDK/include/support/lt_fileSpec.h b/src/DSDK/include/support/lt_fileSpec.h
new file mode 100644
index 0000000..d4c20a7
--- /dev/null
+++ b/src/DSDK/include/support/lt_fileSpec.h
@@ -0,0 +1,251 @@
+/* $Id: lt_fileSpec.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LT_FILESPEC_H
+#define LT_FILESPEC_H
+
+// lt_lib_base
+#include "lt_base.h"
+#include "lt_system.h"
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+/**
+ * Max length of a path
+ */
+#ifdef LT_OS_WIN
+#define LT_UTIL_MAX_PATH _MAX_PATH
+#else
+#define LT_UTIL_MAX_PATH 2048
+#endif
+
+/**
+ * Represents a file or directory path
+ */
+class LTFileSpec
+{
+public:
+   enum
+   {
+      fSlash = '/',
+      bSlash = '\\',
+#ifdef LT_OS_WIN
+      platformSlash = '\\'
+#else
+      platformSlash = '/'
+#endif
+   };
+
+
+public:
+   /**
+    * default constructor
+    */
+   LTFileSpec(void);
+
+   /**
+    * destructor
+    */
+   ~LTFileSpec(void);
+
+   /**
+    * native constructor
+    *
+    * @param   p1    first part of the path could be directory or filename
+    * @param   p2    second part of the path could be directory or filename or NULL
+    * @param   p3    last part of the path could be a filename or NULL
+    *
+    * @note On Win32 the file system treats a (char *) as a multibyte string
+    *       On Unix/Linux the file system treats a (char *) as a utf8 string
+    */
+   explicit LTFileSpec(const char *p1, const char *p2 = NULL, const char *p3 = NULL);
+
+   /**
+    * wchar constructor
+    * @note See native constructor for arguments
+    * @note On Win32 wchar_t is a UTF16 string. On unix it is UTF32
+    */
+   explicit LTFileSpec(const wchar_t *p1, const wchar_t *p2 = NULL, const wchar_t *p3 = NULL);
+
+   /*@{*/
+   /**
+    * LTFileSpec constructor
+    * @note See native constructor for arguments
+    * @note See above for notes on (char *) and (wchar_t *) types
+    */
+   LTFileSpec(const LTFileSpec &copy);
+   LTFileSpec(const LTFileSpec &p1, const char *p2, const char *p3 = NULL);
+   LTFileSpec(const LTFileSpec &p1, const wchar_t *p2, const wchar_t *p3 = NULL);
+
+   LTFileSpec(const LTFileSpec &p1, const LTFileSpec &p2, const char *p3 = NULL);
+   LTFileSpec(const LTFileSpec &p1, const LTFileSpec &p2, const wchar_t *p3);
+
+   LTFileSpec(const LTFileSpec &p1, const LTFileSpec &p2, const LTFileSpec &p3);
+   /*@}*/
+
+   /**
+    * assignment operator
+    */
+   LTFileSpec& operator=(const LTFileSpec& copy);
+
+   /**
+    * inequality operator
+    */
+   bool operator!=(const LTFileSpec& fs) const;
+
+   /**
+    * equality operator
+    */
+   bool operator==(const LTFileSpec& fs) const;
+
+   /**
+    * Initialization from Native strings
+    * 
+    * See Native contructor for arguments
+    */
+   void set(const char *p1, const char *p2 = NULL, const char *p3 = NULL);
+
+   /**
+    * Initialization from UTF8 strings
+    * 
+    * See Native contructor for arguments
+    */
+   void setUTF8(const lt_utf8 *p1, const lt_utf8 *p2 = NULL, const lt_utf8 *p3 = NULL);
+
+   /**
+    * Initialization from Wide strings
+    * 
+    * See Native contructor for arguments
+    */
+   void setWide(const wchar_t *p1, const wchar_t *p2 = NULL, const wchar_t *p3 = NULL);
+
+   /**
+    * Return the parent directory
+    *
+    * The semantics are similar to the standard Unix dirname.
+    *
+    * Examples:
+    * - "/usr/lib" -> "/usr"
+    * - "/usr/"    -> "/"
+    * - "usr"      -> "."
+    * - "/"        -> "/"
+    * - "C:/"      -> "C:/"
+    * - "."        -> "."
+    * - ".."       -> "."
+    */
+   LTFileSpec dirname(void) const;
+
+   /**
+    * Return the base filename
+    *
+    * The semantics are similar to the standard Unix basename.
+    *
+    * Examples:
+    * - "/usr/lib" -> "lib"
+    * - "/usr/"    -> "usr/"  (not the same as the unix basename)
+    * - "usr"      -> "usr"
+    * - "/"        -> "/"
+    * - "C:/"      -> "C:/"
+    * - "."        -> "."
+    * - ".."       -> ".."
+    */
+   const lt_utf8 *basename(void) const;
+
+   /**
+    * Function to convert the path to native format.
+    *
+    * @note On Win32 this returns a multi-byte string.
+    * @note On Unix this returns a UTF8 string.
+    */
+   const char *n_str(void) const;
+   
+   /**
+    * Function to convert the path to Wide format.
+    *
+    * @note On Win32 this returns a 16bit UTF16 string. 
+    * @note On Unix this returns a 32bit UTF32 string.
+    */
+   const wchar_t *w_str(void) const;
+
+   /**
+    * Function to convert the path to a UTF8 format.
+    *
+    * @note On Win32 this returns a 16bit UTF16 string. 
+    * @note On Unix this returns a 32bit UTF32 string.
+    */
+   const lt_utf8* utf8(void) const { return m_path8; }
+
+   /**
+    * returns suffix (in utf8)
+    *
+    * Examples:
+    * - "foo.bar" -> "bar"
+    * - "foo." -> ""
+    * - "foo" -> ""
+    */
+   const lt_utf8* getSuffix() const;
+
+   /**
+    * replaces suffix (extension)
+    *
+    * Note that \a ext should not include the ".".
+    * If \a ext is null, the suffix is removed.
+    *
+    * Examples:
+    * - "foo.bar" with "baz" -> "foo.baz"
+    * - "foo.bar" with ".baz" -> "foo..baz"
+    * - "foo.bar" with "" -> "foo."
+    * - "foo" with "baz" -> "foo.baz"
+    */
+   void replaceSuffix(const lt_utf8* ext);
+
+   /**
+    * remove the suffix (extension)
+    *
+    * Note this also removes the ".".
+    *
+    * Examples:
+    * - "foo.bar" -> "foo"
+    * - "foo." -> "foo"
+    * - "foo" -> "foo"
+    */
+   void removeSuffix();
+
+   /**
+    * returns true if path is absolute, false if relative
+    */
+   bool absolute() const;
+
+protected:
+
+private:
+   // using a utf8 string to hold the path because it is the easiest
+   // to play with (we can look for bSlashs and not have to worry 
+   // about lead btyes.
+   lt_utf8 *m_path8;
+
+   mutable char *m_pathA;     // this will be updated in n_str()
+   mutable wchar_t *m_pathW;  // this will be updated in w_str()
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LT_FILESPEC_H
diff --git a/src/DSDK/include/support/lt_ioBufferedStream.h b/src/DSDK/include/support/lt_ioBufferedStream.h
new file mode 100644
index 0000000..e349b49
--- /dev/null
+++ b/src/DSDK/include/support/lt_ioBufferedStream.h
@@ -0,0 +1,79 @@
+/* $Id: lt_ioBufferedStream.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LT_IO_BUFFERED_STREAM_H
+#define LT_IO_BUFFERED_STREAM_H
+
+#include "lt_ioStreamInf.h"
+
+LT_BEGIN_NAMESPACE( LizardTech )
+
+class LTIOBufPage;
+class LTIOBufPageCache;
+
+/**
+ * Stream which wraps an array of bytes in memory.
+ *
+ * The buffer is of a fixed size and does not grow or shrink.
+ */
+class LTIOBufferedStream : public LTIOStreamInf
+{
+public:
+   LTIOBufferedStream();
+   virtual ~LTIOBufferedStream();
+
+   /**
+    * Initializes the stream
+    *
+    * @param   src 		source stream; this instance takes ownership of it
+    * @param   pageSize size of each page in bytes
+    * @param   numPages number of pages to keep cached in memory
+	 *	@param	tempDir	temp directory to store unused pages; this instance
+	 *							does not clean them up
+    */
+   virtual LT_STATUS initialize(	LTIOStreamInf* src,
+											lt_uint32 pageSize=1024,
+											lt_uint32 numPages = 10,
+											const char* tempDir = 0L);
+
+
+	virtual bool isEOF();
+	virtual bool isOpen();
+	virtual LT_STATUS open();
+	virtual LT_STATUS close();
+   virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
+   virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
+   virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
+   virtual lt_int64 tell();
+	virtual LTIOStreamInf* duplicate();
+	virtual LT_STATUS getLastError() const;
+	virtual const char* getID() const;
+
+private:
+	const LTIOBufPage* getPage( lt_uint64 pageIndex );
+
+protected:
+   lt_uint32		m_pageSize;
+	lt_uint32		m_numPages;
+	LTIOBufPageCache*		m_buffer;
+	LTIOStreamInf*	m_src;
+	lt_uint64		m_cur;
+	bool 				m_eof;
+	char*				m_tempDir;
+};
+
+
+
+LT_END_NAMESPACE( LizardTech )
+
+
+#endif	// LT_IO_BUFFERED_STREAM_H
diff --git a/src/DSDK/include/support/lt_ioCallbackStream.h b/src/DSDK/include/support/lt_ioCallbackStream.h
new file mode 100644
index 0000000..0b9d896
--- /dev/null
+++ b/src/DSDK/include/support/lt_ioCallbackStream.h
@@ -0,0 +1,121 @@
+/* $Id: lt_ioCallbackStream.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LT_IO_CALLBACK_STREAM_H
+#define LT_IO_CALLBACK_STREAM_H
+
+#include "lt_ioCallbackStreamTypes.h"
+#include "lt_ioStreamInf.h"
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(push,4)
+#endif
+
+LT_BEGIN_NAMESPACE( LizardTech )
+
+
+/**
+ * Stream driven entirely by user-defined callbacks
+ *
+ * This class implements a stream whose operations -- read(), write(), open(),
+ * close(), etc -- are all defined by functions passed in from the user.
+ *
+ * This class can be used as an alternative to deriving custom stream classes
+ * from LTIOStreamInf.  This class also forms the basis for the C-callable
+ * stream defined in lt_ioCStream.h.
+ */
+class LTIOCallbackStream : public LTIOStreamInf
+{
+public:
+   LTIOCallbackStream();
+
+   virtual ~LTIOCallbackStream();
+
+   /**
+    * initialize
+    *
+    * The parameters to this function are a set of function pointers
+    * which implement all the required operations needed to support
+    * a stream.  Their semantics exactly mirror the semantics of the
+    * corresponding member functions in LTIOStreamInf.
+    *
+    * The \a user parameter is a pointer to a user-defined area
+    * containing information about the stream itself, e.g. the
+    * filename and a FILE*.  This pointer is passed as the first
+    * argument to each of the user's stream functions.  This class
+    * never attempts to interpret this data directly.
+    *
+    * Note that the implementation of the \a duplicate function
+    * is required to create a new copy of this user-defined data by
+    * whatever means appropriate.  The user retains ownership of the
+    * copied user data.
+    *
+    * @param  open       pointer to user's open function
+    * @param  close      pointer to user's close function
+    * @param  read       pointer to user's read function
+    * @param  write      pointer to user's write function
+    * @param  seek       pointer to user's seek function
+    * @param  tell       pointer to user's tell function
+    * @param  isEOF      pointer to user's isEOF function
+    * @param  isOpen     pointer to user's isOpen function
+    * @param  duplicate  pointer to user's duplicate function
+    * @param  user       pointer to user-defined stream data
+    * @return status code indicating success or failure
+    */
+   virtual LT_STATUS initialize(LTIOCallbackStream_Open open,
+                                LTIOCallbackStream_Close close,
+                                LTIOCallbackStream_Read read,
+                                LTIOCallbackStream_Write write,
+                                LTIOCallbackStream_Seek seek,
+                                LTIOCallbackStream_Tell tell,
+                                LTIOCallbackStream_IsEOF isEOF,
+                                LTIOCallbackStream_IsOpen isOpen,
+                                LTIOCallbackStream_Duplicate duplicate,
+                                void* user);
+
+	virtual bool isEOF();
+	virtual bool isOpen();
+
+   virtual LT_STATUS open();
+	virtual LT_STATUS close();
+
+   virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
+   virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
+
+   virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
+   virtual lt_int64 tell();
+
+   virtual LTIOStreamInf* duplicate();
+	virtual LT_STATUS getLastError() const;
+	virtual const char* getID() const;
+
+private:
+   LTIOCallbackStream_Open m_open;
+   LTIOCallbackStream_Close m_close;
+   LTIOCallbackStream_Read m_read;
+   LTIOCallbackStream_Write m_write;
+   LTIOCallbackStream_Seek m_seek;
+   LTIOCallbackStream_Tell m_tell;
+   LTIOCallbackStream_IsEOF m_isEOF;
+   LTIOCallbackStream_IsOpen m_isOpen;
+   LTIOCallbackStream_Duplicate m_duplicate;
+
+   void* m_user;
+};
+
+LT_END_NAMESPACE( LizardTech )
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // LT_IO_CALLBACK_STREAM_H
diff --git a/src/DSDK/include/support/lt_ioCallbackStreamTypes.h b/src/DSDK/include/support/lt_ioCallbackStreamTypes.h
new file mode 100644
index 0000000..2e1737f
--- /dev/null
+++ b/src/DSDK/include/support/lt_ioCallbackStreamTypes.h
@@ -0,0 +1,133 @@
+/* $Id: lt_ioCallbackStreamTypes.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC - C */
+
+#ifndef LT_IO_CALLBACK_STREAM_TYPES_H
+#define LT_IO_CALLBACK_STREAM_TYPES_H
+
+#include "lt_base.h"
+#include "lt_lib_io.h"
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(push,4)
+#endif
+
+#ifdef LT_CPLUSPLUS
+extern "C" {
+#endif
+
+
+/**
+ * opaque pointer to an LTIOStreamInf
+ */
+typedef void* LTIOStreamH;
+
+/**
+ * @name types specifically for use with LTIOCallbackStream
+ */
+/*@{*/
+
+/**
+ * typedef for callback stream open function
+ *
+ * The parameter is a void* (user data).
+ *
+ * A status code is returned.
+ */
+typedef LT_STATUS (*LTIOCallbackStream_Open)(void*);
+
+/**
+ * typedef for callback stream close function
+ *
+ * The parameter is a void* (user data).
+ *
+ * A status code is returned.
+ */
+typedef LT_STATUS (*LTIOCallbackStream_Close)(void*);
+
+/**
+ * typedef for callback stream read function
+ *
+ * The parameters are a void* (user data), a pointer to the buffer to
+ * read from, and the number of bytes to read.
+ *
+ * The number of bytes actually read is returned.
+ */
+typedef lt_uint32 (*LTIOCallbackStream_Read)(void*, lt_uint8*, lt_uint32);
+
+/**
+ * typedef for callback stream write function
+ *
+ * The parameters are a void* (user data), a pointer to the buffer to
+ * write to, and the number of bytes to write.
+ *
+ * The number of bytes actually written is returned.
+ */
+typedef lt_uint32 (*LTIOCallbackStream_Write)(void*, const lt_uint8*, lt_uint32);
+
+/**
+ * typedef for callback stream seek function
+ *
+ * The parameters are a void* (user data), the number of bytes to
+ * seek, and the seek direction.
+ *
+ * A status code is returned.
+ */
+typedef LT_STATUS (*LTIOCallbackStream_Seek)(void*, lt_int64, LTIOSeekDir);
+
+/**
+ * typedef for callback stream tell function
+ *
+ * The parameter is a void* (user data).
+ *
+ * The current offset is returned.
+ */
+typedef lt_int64 (*LTIOCallbackStream_Tell)(void*);
+
+/**
+ * typedef for callback stream isEOF function
+ *
+ * The parameter is a void* (user data).
+ *
+ * A boolean value (0 or 1) is returned.
+ */
+typedef lt_uint8 (*LTIOCallbackStream_IsEOF)(void*);
+
+/**
+ * typedef for callback stream isOpen function
+ *
+ * The parameter is a void* (user data).
+ *
+ * A boolean value (0 or 1) is returned.
+ */
+typedef lt_uint8 (*LTIOCallbackStream_IsOpen)(void*);
+
+/**
+ * typedef for callback stream duplicate function
+ *
+ * The parameter is a void* (user data).
+ *
+ * A pointer to the new stream is returned.
+ */
+typedef LTIOStreamH (*LTIOCallbackStream_Duplicate)(void*);
+
+/*@}*/
+
+
+#ifdef LT_CPLUSPLUS
+}
+#endif
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif
diff --git a/src/DSDK/include/support/lt_ioDynamicMemStream.h b/src/DSDK/include/support/lt_ioDynamicMemStream.h
new file mode 100644
index 0000000..3a05312
--- /dev/null
+++ b/src/DSDK/include/support/lt_ioDynamicMemStream.h
@@ -0,0 +1,196 @@
+/* $Id: lt_ioDynamicMemStream.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+
+#ifndef LT_IO_DYNAMIC_MEM_STREAM_H
+#define LT_IO_DYNAMIC_MEM_STREAM_H
+
+#include "lt_ioStreamInf.h"
+#include <stdlib.h>
+
+LT_BEGIN_NAMESPACE( LizardTech )
+
+
+/**
+ *
+ * holds a memory buffer of variable size
+ *
+ * Unlike LTIOMemStream, which uses a fixed-size buffer, this class will
+ * grow its buffer as you write past the end of it.  It is most suitable
+ * for use as an internal "temp stream".  The stream is initially empty.
+ *
+ * The stream cannot hold more than 2^32 bytes of data.
+ */
+class LTIODynamicMemStream : public LTIOStreamInf
+{
+public:
+   /** @name Memory Allocation and Deallocation Functions */
+   //@{
+#if defined(LT_OS_WINCE)
+	typedef void* (__cdecl * Allocator)(size_t);
+	typedef void(__cdecl *Deallocator)(void*);
+	typedef void*(__cdecl *Reallocator)(void*,size_t);
+#else
+	typedef void*(*Allocator)(size_t);
+	typedef void(*Deallocator)(void*);
+	typedef void*(*Reallocator)(void*,size_t);
+#endif
+   //@}
+
+public:
+   LTIODynamicMemStream();
+   virtual ~LTIODynamicMemStream();
+
+   /** 
+    * @name Initialization functions
+    */
+   /*@{*/
+   /**
+    * Initializes the stream
+    * 
+    * @param   size  initial size of buffer in bytes
+    * @param   growthRate factor of growth Valid Values: [1-2)
+    */
+   virtual LT_STATUS initialize( lt_uint32 size = 4096, float growthRate=2 );
+
+   /**
+    * Initializes the stream, with custom memory management
+    * 
+    * The allocator function should return NULL in the event of failure,
+    * as opposed to throwing an exception -- that is, be like malloc()
+    * and not like new.
+    *
+    * @param   size    initial size of buffer in bytes
+    * @param   allo    user-defined memory allocator
+    * @param   deallo  user-defined memory deallocator
+    * @param   reallo  user-defined memory reallocator
+    * @param   growthRate factor of growth Valid Values: [1-2)
+    */
+   virtual LT_STATUS initialize( lt_uint32 size,
+                                 Allocator allo, Deallocator deallo,
+                                 Reallocator reallo=NULL, float growthRate=2 );
+
+   /*@}*/
+
+	virtual bool isEOF();
+	virtual bool isOpen();
+	virtual LT_STATUS open();
+	virtual LT_STATUS close();
+   virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
+   virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
+   virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
+   virtual lt_int64 tell();
+
+
+   /** 
+    * @name Memory Management
+    */
+   /*@{*/
+   /**
+    * Returns the allocator function pointer
+    */
+   Allocator getAllocator() const         {  return m_alloc; }
+   
+   /**
+    * Returns the deallocator function pointer
+    */
+   Deallocator getDeallocator() const    {  return m_dealloc; } 
+
+   /**
+    * Returns the reallocator function pointer
+    */
+   Reallocator getReallocator() const    {  return m_realloc; } 
+
+   /**
+    * Get the underlying buffer
+    *
+    * The pointer is guaranteed to be good until
+    * the next call to write(), or close()
+    *
+    * @return  pointer to underlying buffer
+    */
+   const lt_uint8* getData() const  {  return m_data; }
+
+   
+   /**
+    * Detach the underlying buffer from the stream,
+    * and closes the stream. The caller is responsible 
+    * for deallocating the buffer.  (Note that you must
+    * use the Deallocator method, not delete[].) 
+    *
+    * @param data receives pointer to underlying buffer
+    *
+    * @return  LT_STS_Success upon success
+    */
+   LT_STATUS detachAndClose(lt_uint8*& data);
+
+   /**
+    * Returns the number of bytes which are in the
+    * stream. This may be smaller than the amount
+    * actually allocated.
+    *
+    * @return  size (in bytes) of stream
+    */
+   lt_uint64 size() const           {  return m_userSize; }
+
+   /*@}*/
+
+	virtual LTIOStreamInf* duplicate();
+	virtual LT_STATUS getLastError() const;
+	virtual const char* getID() const;
+ 
+protected:
+   /**   extend size of data buffer if required */
+   bool grow(lt_uint32 numBytes);
+
+   /**   pointer to buffer */
+   lt_uint8*   m_data;
+
+   /**   initial size of buffer */
+   lt_uint32   m_initialSize;
+
+   /**   size of buffer as allocated */
+   lt_uint32   m_bufferSize;
+
+   /**   size of buffer as accessible by user */
+   lt_uint32   m_userSize;
+
+   /**   current position  */
+   lt_uint32   m_cur;
+
+   /**   openness */
+   bool        m_isOpen; 
+
+   /**   allocator function */
+   Allocator m_alloc;
+
+   /**   deallocator */
+   Deallocator m_dealloc;
+
+   /**   reallocator */
+   Reallocator m_realloc;
+
+	void* defaultRealloc(void*,size_t);
+
+   LT_STATUS m_lastError;
+
+   bool m_isEOF;
+   
+   /** the factor of growth of the memory [1-2): */
+   float m_growthRate;
+};
+
+
+LT_END_NAMESPACE( LizardTech )
+
+
+#endif	// LT_IO_DYNAMIC_MEM_STREAM_H
diff --git a/src/DSDK/include/support/lt_ioFile64Stream.h b/src/DSDK/include/support/lt_ioFile64Stream.h
new file mode 100644
index 0000000..6c2a491
--- /dev/null
+++ b/src/DSDK/include/support/lt_ioFile64Stream.h
@@ -0,0 +1,242 @@
+/* $Id: lt_ioFile64Stream.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LT_IOFILE64STREAM_H
+#define LT_IOFILE64STREAM_H
+
+#include "lt_ioStreamInf.h"
+#include "lt_fileSpec.h"
+
+#if defined(LT_OS_WIN)
+   #include <Windows.h>
+#elif defined(LT_OS_SUNOS) || defined(LT_OS_LINUX) || defined(LT_OS_DARWIN)
+   #include <stdio.h>
+#else
+   #error Platform not yet supported.
+#endif
+
+
+LT_BEGIN_NAMESPACE( LizardTech )
+
+/**
+ * File stream for large files
+ *
+ * This class implements a file-based stream.  It works correctly for large
+ * files (greater than 2GB), although on some systems performance may be less
+ * than the normal file stream (LTFileStream).
+ */
+class LTIOFile64Stream : public LTIOStreamInf
+{
+public:
+   /** 
+    * @name Construction, destruction, initialization
+    */
+   //@{
+
+   /**   
+    * Default Constructor
+    */
+   LTIOFile64Stream();
+
+   /**   
+    * Destructor
+    */
+   virtual ~LTIOFile64Stream();
+
+   /**
+    * Initializes the stream
+    *
+    * @param   path  A LTFileSpec to the file
+    * @param   mode  mode (see stdio.h)
+    */
+   virtual LT_STATUS initialize( const LTFileSpec &path, const char* mode );
+   virtual LT_STATUS initialize( const char *path, const char* mode );
+
+   //@}
+
+   /** 
+    * @name Status accessors
+    */
+   //@{
+
+	/**
+    * Indicates whether the stream is at the end of its data or not.
+    *
+	 *	@return  true     the stream is valid and at the end of its data.  
+    * @retval false     otherwise
+	 */
+	virtual bool isEOF();
+
+
+   /** 
+    * @name Opening and closing
+    */
+   //@{
+
+	/**
+    * Is the stream open?
+    *
+	 *	@retval  true  the stream is valid and in a state that allows data access.
+    * @retval  false otherwise
+	 */
+	virtual bool isOpen();
+
+	/**
+	 *	Opens the stream.
+    *
+    * Opening a stream puts it in a state that allows data access based on cached
+	 *	initialization parameters.
+    *
+	 * @retval  LT_STS_IOStreamUninitialized  The stream has not been initialized with enough
+	 *		                                    information to open the stream
+	 *	@retval  LT_STS_IOStreamInvalidState   The the stream is already open
+	 *	@retval  LT_STS_Success                On success.
+	 *	@retval  LT_STS_Failure                Otherwise.
+	 */
+	virtual LT_STATUS open();
+	
+	/**
+	 *	Closes the stream.
+    *
+	 *	Puts the stream in a state that does not allow data access.  May
+	 *	free up resources, but only in such a way that doesn't inhibit
+	 *	successful future calls to open()
+    *
+	 *	@retval  LT_STS_Success                On success, or if the stream is already closed.
+	 *	@retval  LT_STS_Failure                Otherwise.
+	 */
+	virtual LT_STATUS close();
+
+   //@}
+
+
+   /** 
+    * @name Data access
+    */
+   //@{
+
+	/**
+	 * Retrieve the specified number of bytes from the data source and
+	 *	place them in pDest.
+	 *	
+	 *	@param   pDest         buffer in which to store read data
+	 *	@param   numBytes      number of bytes to read from stream
+    *
+	 *	@retval numBytes        The number of bytes actually read
+	 */
+   virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
+	
+	/**
+	 * Store the specified number of bytes in the data source.  
+    *
+	 *	@param   pSrc        buffer from which to store data
+	 *	@param   numBytes    number of bytes to write to stream
+    *
+	 *	@retval  numBytes    number of bytes actually written
+	 */
+   virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
+
+   //@}
+
+   /** 
+    * @name Positioning
+    */
+   //@{
+
+	/**
+	 *	Moves the the data access position to origin + offset
+    * 
+	 *	@param   offset   number of bytes from origin at which to the next read or write will take place
+	 *	@param   origin   place in stream from which to seek
+    *
+	 *	@retval  LT_STS_IOStreamUnsupported    The stream is not seekable
+	 *	@retval  LT_STS_IOStreamInvalidArgs    The offset and origin do not specify a valid location in the stream
+	 *	@retval  LT_STS_Success                On success
+	 *	@retval  LT_STS_Failure                Otherwise
+	*/
+   virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
+
+	/**
+	 *	Returns the current data access position as an offset from the start of the data
+    *
+	 *	@retval  postion     Number of bytes from the start of the data  
+	 *	@retval  -1          On error.  
+	 */
+   virtual lt_int64 tell();
+
+   //@}
+
+   /** 
+    * @name Other operations
+    */
+   //@{
+
+	/**
+    * @brief   Clone the stream
+    *
+    * Create new stream of the same type with the same initialization parameters.  
+	 *	The transmission of these parameters is the responsibility of the derived type.
+	 *	The new stream should initially return false for isOpen().
+	 *	
+	 *	@retval  NULL  the stream could not be duplicated; valid LTIOStreamInf* otherwise.
+	*/
+	virtual LTIOStreamInf* duplicate();
+
+	virtual LT_STATUS getLastError() const;
+
+	virtual const char* getID() const;
+
+   //@}
+private:
+
+   /**   cleanup method */
+   void cleanup();
+   /**   sets url id */
+   void setID();
+
+protected:
+
+   /**   pointer to open file */
+#if defined(LT_OS_WIN)
+   HANDLE m_file;
+   // The win32 I/O primitives have different semantics than the Unix file
+   // primitives, which are our reference model -- so we need to track the
+   // EOF condition ourselves.
+   bool m_isEOF;
+#elif defined(LT_OS_SUNOS) || defined(LT_OS_LINUX) || defined(LT_OS_DARWIN)
+   FILE * m_file;
+#else
+   #error Platform not yet supported.
+#endif
+
+   /**   path  */
+   LTFileSpec m_path;
+
+   /**   mode  */
+   char *m_mode;
+   char *m_uri;
+
+   // (state code taken copied from LTIOFileStream)
+   enum
+   {
+      unknown_state = 1,
+      reading_state = 2,
+      writing_state = 3
+   } m_state;
+};
+
+
+
+LT_END_NAMESPACE( LizardTech )
+
+
+#endif	// LT_IOFILE64STREAM_H
diff --git a/src/DSDK/include/support/lt_ioFileStream.h b/src/DSDK/include/support/lt_ioFileStream.h
new file mode 100644
index 0000000..4593ca5
--- /dev/null
+++ b/src/DSDK/include/support/lt_ioFileStream.h
@@ -0,0 +1,249 @@
+/* $Id: lt_ioFileStream.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LT_IO_FILE_STREAM_H
+#define LT_IO_FILE_STREAM_H
+
+#include "lt_ioStreamInf.h"
+#include "lt_fileSpec.h"
+#include <stdio.h>
+
+LT_BEGIN_NAMESPACE( LizardTech )
+
+
+/**
+ * File stream
+ *
+ * This class implements a file-based stream.
+ *
+ * @note This class only works with 32-bit streams (see LTFile64Stream for
+ * large-file support).
+ */
+class LTIOFileStream : public LTIOStreamInf
+{
+public:
+
+   /** 
+    * @name Construction, destruction, initialization
+    */
+   //@{
+
+   /**   
+    * Default Constructor
+    */
+   LTIOFileStream();
+
+   /**   
+    * Destructor
+    */
+   virtual ~LTIOFileStream();
+
+   /**
+    * Initializes the stream from a file spec
+    *
+    * @param   fs		file spec
+    * @param   mode  mode (see stdio.h)
+    */
+	virtual LT_STATUS initialize( const LTFileSpec& fs, const char* mode );
+	
+	virtual LT_STATUS initialize( const char* path, const char* mode );
+	virtual LT_STATUS initializeUTF8( const char* path, const char* mode );
+   virtual LT_STATUS initializeUTF16( const wchar_t* path, const wchar_t* mode);
+   //@}
+
+   /** 
+    * @name Status accessors
+    */
+   //@{
+
+	/**
+    * Indicates whether the stream is at the end of its data or not.
+    *
+	 *	@return  true     the stream is valid and at the end of its data.  
+    * @retval false     otherwise
+	 */
+	virtual bool isEOF();
+
+   /**
+    * Returns underlying stdio error code
+    */
+   int stdio_ferror();
+
+   /**
+    * Clears underlying stdio error code
+    */
+   void stdio_clearerr();
+   //@}
+
+	/**
+	 *	Set buffering - may be called only after open() but before
+	 *	the first read/write operation.
+	 *	@param	buf	buffer to use; if NULL then one is allocated
+	 *	@param	mode	one of the following:
+	 *						_IONBF (unbuffered)
+	 *						_IOLBF (line buffered)
+	 *						_IOFBF (fully buffered)
+	 *	@param	size	size of buffer
+	 */
+	int stdio_setvbuf( lt_uint8* buf, lt_uint32 mode, lt_uint32 size  );
+
+   /** 
+    * @name Opening and closing
+    */
+   //@{
+
+	/**
+    * Is the stream open?
+    *
+	 *	@retval  true  the stream is valid and in a state that allows data access.
+    * @retval  false otherwise
+	 */
+	virtual bool isOpen();
+
+	/**
+	 *	Opens the stream.
+    *
+    * Opening a stream puts it in a state that allows data access based on cached
+	 *	initialization parameters.
+    *
+	 * @retval  LT_STS_IOStreamUninitialized  The stream has not been initialized with enough
+	 *		                                    information to open the stream
+	 *	@retval  LT_STS_IOStreamInvalidState   The the stream is already open
+	 *	@retval  LT_STS_Success                On success.
+	 *	@retval  LT_STS_Failure                Otherwise.
+	 */
+	virtual LT_STATUS open();
+	
+
+	/**
+	 *	Closes the stream.
+    *
+	 *	Puts the stream in a state that does not allow data access.  May
+	 *	free up resources, but only in such a way that doesn't inhibit
+	 *	successful future calls to open()
+    *
+	 *	@retval  LT_STS_Success                On success, or if the stream is already closed.
+	 *	@retval  LT_STS_Failure                Otherwise.
+	 */
+	virtual LT_STATUS close();
+
+   //@}
+
+
+   /** 
+    * @name Data access
+    */
+   //@{
+
+	/**
+	 * Retrieve the specified number of bytes from the data source and
+	 *	place them in pDest.
+	 *	
+	 *	@param   pDest         buffer in which to store read data
+	 *	@param   numBytes      number of bytes to read from stream
+    *
+	 *	@retval numBytes        The number of bytes actually read
+	 */
+   virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
+	
+	/**
+	 * Store the specified number of bytes in the data source.  
+    *
+	 *	@param   pSrc        buffer from which to store data
+	 *	@param   numBytes    number of bytes to write to stream
+    *
+	 *	@retval  numBytes    number of bytes actually written
+	 */
+   virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
+
+   //@}
+
+   /** 
+    * @name Positioning
+    */
+   //@{
+
+	/**
+	 *	Moves the the data access position to origin + offset
+    * 
+	 *	@param   offset   number of bytes from origin at which to the next read or write will take place
+	 *	@param   origin   place in stream from which to seek
+    *
+	 *	@retval  LT_STS_IOStreamUnsupported    The stream is not seekable
+	 *	@retval  LT_STS_IOStreamInvalidArgs    The offset and origin do not specify a valid location in the stream
+	 *	@retval  LT_STS_Success                On success
+	 *	@retval  LT_STS_Failure                Otherwise
+	*/
+   virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
+
+	/**
+	 *	Returns the current data access position as an offset from the start of the data
+    *
+	 *	@retval  postion     Number of bytes from the start of the data  
+	 *	@retval  -1          On error.  
+	 */
+   virtual lt_int64 tell();
+
+   //@}
+
+   /** 
+    * @name Other operations
+    */
+   //@{
+
+	/**
+    * @brief   Clone the stream
+    *
+    * Create new stream of the same type with the same initialization parameters.  
+	 *	The transmission of these parameters is the responsibility of the derived type.
+	 *	The new stream should initially return false for isOpen().
+	 *	
+	 *	@retval  NULL  the stream could not be duplicated; valid LTIOStreamInf* otherwise.
+	*/
+	virtual LTIOStreamInf* duplicate();
+
+	virtual LT_STATUS getLastError() const;
+
+	virtual const char* getID() const;
+
+   //@}
+private:
+
+   /**   cleanup method */
+   void cleanup();
+
+   /**   sets url id */
+   void setID();
+
+protected:
+
+   /**   pointer to open file */
+   FILE* m_file;
+   
+   enum
+   {
+      unknown_state = 1,
+      reading_state = 2,
+      writing_state = 3
+   } m_state;
+
+   LTFileSpec	m_path;
+   char *m_mode;
+   char *m_uri;
+};
+
+
+
+LT_END_NAMESPACE( LizardTech )
+
+
+#endif	// LT_STREAMINF_H
diff --git a/src/DSDK/include/support/lt_ioMemStream.h b/src/DSDK/include/support/lt_ioMemStream.h
new file mode 100644
index 0000000..7f3381c
--- /dev/null
+++ b/src/DSDK/include/support/lt_ioMemStream.h
@@ -0,0 +1,91 @@
+/* $Id: lt_ioMemStream.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+
+#ifndef LT_IO_MEM_STREAM_H
+#define LT_IO_MEM_STREAM_H
+
+#include "lt_ioStreamInf.h"
+
+LT_BEGIN_NAMESPACE( LizardTech )
+
+
+/**
+ * Stream which wraps an array of bytes in memory.
+ *
+ * The buffer is of a fixed size and does not grow or shrink.
+ */
+class LTIOMemStream : public LTIOStreamInf
+{
+public:
+   LTIOMemStream();
+   virtual ~LTIOMemStream();
+
+   /** 
+    * @name Initialization functions
+    */
+   /*@{*/
+   /**
+    * Initializes the stream
+    *
+    * @param   data  pointer to start of buffer
+    * @param   size  size of buffer in bytes
+    */
+   virtual LT_STATUS initialize( void* data, lt_uint32 size );
+
+   /**
+    * Initializes the stream
+    *
+    * This version internally allocates a buffer of the specified size.
+    * 
+    * @param   size  size of buffer in bytes
+    */
+   virtual LT_STATUS initialize( lt_uint32 size );
+   /*@}*/
+
+	virtual bool isEOF();
+	virtual bool isOpen();
+	virtual LT_STATUS open();
+	virtual LT_STATUS close();
+   virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
+   virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
+   virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
+   virtual lt_int64 tell();
+	virtual LTIOStreamInf* duplicate();
+	virtual LT_STATUS getLastError() const;
+	virtual const char* getID() const;
+
+protected:
+
+   /**   pointer to buffer */
+   lt_uint8*   m_data;
+
+   /**   size of buffer */
+   lt_uint32   m_size;
+
+   /**   current position  */
+   lt_uint32   m_cur;
+
+   /**   data ownership */
+   bool        m_ownsData;
+
+   /**   openness */
+   bool        m_isOpen;
+
+   bool m_isEOF;
+};
+
+
+LT_END_NAMESPACE( LizardTech )
+
+
+#endif	// LT_IO_MEM_STREAM_H
diff --git a/src/DSDK/include/support/lt_ioStatus.h b/src/DSDK/include/support/lt_ioStatus.h
new file mode 100644
index 0000000..772cbcb
--- /dev/null
+++ b/src/DSDK/include/support/lt_ioStatus.h
@@ -0,0 +1,55 @@
+/* $Id: lt_ioStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LT_IOSTATUS_H
+#define LT_IOSTATUS_H
+
+#include "lt_base.h"
+
+/** Base value for stream error codes  */
+#define LT_STS_IOBas                            145000
+LT_STATUSSTRING_ADD(LT_STS_IOBas, "lt_lib_mrsid_core base")
+
+/**  Indicates that a stream has not been initialized with a data source */
+#define LT_STS_IOStreamUninitialized            145003
+LT_STATUSSTRING_ADD(LT_STS_IOStreamUninitialized, "stream not initialized")
+
+/**  Indicates that a requested operation is not supported by a stream */
+#define LT_STS_IOStreamUnsupported              145010
+LT_STATUSSTRING_ADD(LT_STS_IOStreamUnsupported, "operation unsupported")
+
+/**  Indicates that the supplied arguments are invalid or unintelligible */
+#define LT_STS_IOInvalidArgs		               145011
+LT_STATUSSTRING_ADD(LT_STS_IOInvalidArgs, "invalid arguments")
+
+/**  Indicates that a stream is in a state that disallows the requested action */
+#define LT_STS_IOStreamInvalidState	            145012
+LT_STATUSSTRING_ADD(LT_STS_IOStreamInvalidState, "stream in invalid state")
+
+/**  Out of memory */
+#define LT_STS_IOOutOfMemory	                  145013
+LT_STATUSSTRING_ADD(LT_STS_IOOutOfMemory, "out of memory")
+
+/** Unable to get file lock */
+#define LT_STS_IOFileLock                       145014
+LT_STATUSSTRING_ADD(LT_STS_IOFileLock, "unable to get file lock")
+
+/** Could not unlock file */
+#define LT_STS_IOFileUnlock                     145015
+LT_STATUSSTRING_ADD(LT_STS_IOFileUnlock, "could not unlock file")
+
+/** Upper limit for stream error codes  */
+#define LT_STS_IOMax           	               145999
+LT_STATUSSTRING_ADD(LT_STS_IOMax, "lt_lib_io max")
+
+
+#endif // LT_IOSTATUS_H
diff --git a/src/DSDK/include/support/lt_ioStreamInf.h b/src/DSDK/include/support/lt_ioStreamInf.h
new file mode 100644
index 0000000..1005bfa
--- /dev/null
+++ b/src/DSDK/include/support/lt_ioStreamInf.h
@@ -0,0 +1,218 @@
+/* $Id: lt_ioStreamInf.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LT_STREAMINF_H
+#define LT_STREAMINF_H
+
+#include "lt_lib_io.h"
+
+
+LT_BEGIN_NAMESPACE( LizardTech )
+
+
+
+/**
+ * Abstract definition of a stream.
+ *
+ * This class is intentionally very sparse, and completely abstract to 
+ * facilitate COM usage.  The semantics of the LTIOStreamInf class are
+ * very similar to the unix stdio model.
+ */
+class LTIOStreamInf
+{
+public:
+   // The following is a pure virtual destructor with an empty definition.
+   // It might look broken to you, but this is a well-known practice and
+   // is explicitly allowed by the standard for very good, technical reasons.
+   // (Do a google search for "pure virtual destructor" for details.)
+#if defined(LT_COMPILER_GNU) || defined(LT_COMPILER_SUN)
+   // gcc doesn't allow the declaration to be in the class body,
+   // so we put the member function "definition" in lt_ioStreamInf.cpp
+   virtual ~LTIOStreamInf() =0;
+#else
+   virtual ~LTIOStreamInf() =0 {}
+#endif
+  
+   /** 
+    * @name Status accessors
+    */
+   //@{
+
+	/**
+    * Test for end-of-stream
+    *
+    * Returns true after the first read operation that attempts to 
+    * read past the end of the stream. It returns false if the current 
+    * position is not end of stream.
+    *
+	 *	@retval  true     end of stream  
+    * @retval  false    otherwise
+	 */
+	virtual bool isEOF() =0;
+
+	/**
+    * Test for stream openness.
+    *
+	 *	@retval  true     The stream is open
+    * @retval  false    otherwise
+	 */
+	virtual bool isOpen() =0;
+
+   //@}
+
+
+   /** 
+    * @name Opening and closing
+    */
+   //@{
+
+	/**
+	 *	Opens the stream.
+    *
+    * Opening a stream puts it in a state that allows data access based on cached
+	 *	initialization parameters. 
+    *
+	 * @retval  LT_STS_IOStreamUninitialized  The stream has not been initialized with enough
+	 *		                                    information to open the stream
+	 *	@retval  LT_STS_IOStreamInvalidState   The stream is already open
+	 *	@retval  LT_STS_Success                On success.
+	 *	@retval  LT_STS_Failure                Failure.
+    * @retval  other                         Implementations may return other codes
+	 */
+	virtual LT_STATUS open() =0;
+	
+	/**
+	 *	Closes the stream.
+    *
+	 *	Puts the stream in a state that does not allow data access.  May
+	 *	free up resources, but only in such a way that doesn't inhibit
+	 *	successful future calls to open()
+    *
+	 *	@retval  LT_STS_Success                On success, or if the stream is already closed.
+	 *	@retval  LT_STS_Failure                Otherwise.
+	 */
+	virtual LT_STATUS close() =0;
+
+   //@}
+
+
+   /** 
+    * @name Data access
+    */
+   //@{
+
+	/**
+	 * Retrieve the specified number of bytes from the data source and
+	 *	place them in pDest.
+	 *	
+	 *	@param   pDest         buffer in which to store read data
+	 *	@param   numBytes      number of bytes to read from stream
+    *
+	 *	@retval numBytes        The number of bytes actually read
+	 */
+   virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes ) = 0;
+	
+	/**
+	 * Store the specified number of bytes in the data source.  
+    *
+	 *	@param   pSrc        buffer from which to store data
+	 *	@param   numBytes    number of bytes to write to stream
+    *
+	 *	@retval  numBytes    number of bytes actually written
+	 */
+   virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes ) = 0;
+
+   //@}
+
+   /** 
+    * @name Positioning
+    */
+   //@{
+
+	/**
+	 *	Moves the data access position to origin + offset
+    * 
+	 *	@param   offset   number of bytes from origin at which to the next read or write will take place
+	 *	@param   origin   place in stream from which to seek
+    *
+	 *	@retval  LT_STS_IOStreamUnsupported    The stream is not seekable
+	 *	@retval  LT_STS_IOStreamInvalidArgs    The offset and origin do not specify a valid location in the stream
+	 *	@retval  LT_STS_Success                On success
+	 *	@retval  LT_STS_Failure                Otherwise
+    * @retval  other                         Implementations may return other codes
+	 */
+   virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin ) =0;
+
+	/**
+	 *	Returns the current data access position as an offset from the start of the data
+    *
+	 *	@retval  postion     Number of bytes from the start of the data  
+	 *	@retval  -1          On error.  
+    * @retval  other       Implementations may return other codes
+	 */
+   virtual lt_int64 tell() =0;
+
+   //@}
+
+   /** 
+    * @name Other operations
+    */
+   //@{
+
+	/**
+    * @brief   Clone the stream
+    *
+    * Create new stream of the same type with the same initialization parameters.  
+	 *	The transmission of these parameters is the responsibility of the derived type.
+	 *	The new stream should initially return false for isOpen().
+	 *	
+	 *	@retval  NULL  the stream could not be duplicated; valid LTIOStreamInf* otherwise.
+	*/
+	virtual LTIOStreamInf* duplicate() =0;
+
+
+	/**
+    * @brief   Get status code of last error event.
+    *
+    * read(), write(), tell(), and duplicate() do not explicitly return status codes
+    * in the event of an error.  When an error has occurred, this function returns
+    * the appropriate status code.  Note calling this function after a successful
+    * I/O operation will return an undefined value. 
+	 *	
+	 *	@retval  status  the error code
+	*/
+	virtual LT_STATUS getLastError() const =0;
+
+
+	/**
+    * @brief   Get a URI describing the stream object.
+    *
+    * This function returns a UTF-8, null-terminated string which is a
+    * URI describing the origin of the stream object -- for example,
+    * "file://foo.txt" or "lt_memstream:".  This string is only intended
+    * for diagnostic purposes, i.e. it may not be valid to pass it
+    * to the ctor in an attempt to reopen the stream. 
+	 *	
+	 *	@retval  uri  the uri string
+	*/
+	virtual const char* getID() const =0;
+
+   //@}
+
+};
+
+
+
+LT_END_NAMESPACE( LizardTech )
+
+
+#endif	// LT_STREAMINF_H
diff --git a/src/DSDK/include/support/lt_ioSubStream.h b/src/DSDK/include/support/lt_ioSubStream.h
new file mode 100644
index 0000000..0240ffa
--- /dev/null
+++ b/src/DSDK/include/support/lt_ioSubStream.h
@@ -0,0 +1,233 @@
+/* $Id: lt_ioSubStream.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+
+#ifndef LT_IOSUBSTREAM_H
+#define LT_IOSUBSTREAM_H
+
+#include "lt_ioStreamInf.h"
+#include <stdio.h>
+
+LT_BEGIN_NAMESPACE( LizardTech )
+
+
+
+/**
+ * LTIOSubStream
+ *
+ * A SubStream is a stream which wraps another stream, but provides access
+ * to only a (contiguous) subset of the bytes of the parent stream -- without
+ * revealing any of the surrounding bytes.
+ *
+ * Consider the following situation: the MG2 decoder always assumes byte 0 of
+ * the image stream given to it is the start of the image, but you have an
+ * image embedded in some larger stream -- say from byte offset 100 to 2100.
+ * By creating a substream from the larger stream and giving that to the
+ * decoder, the decoder will be doing the right thing when it naively issues
+ * a "seek-to-beginning" request.
+ *
+ * Note that the SubStream does NOT take ownership of the stream given to it.
+ * The caller should duplicate() the main stream first, if needed.  Closing
+ * the substream will close the parent stream, but deleting the substream will
+ * not delete the parent stream.
+ *
+ * Note that the results might be undefined if the parent or child stream is
+ * modified at any point -- try to avoid such situations.
+ */
+class LTIOSubStream : public LTIOStreamInf
+{
+public:
+
+   /** 
+    * @name Construction, destruction, initialization
+    */
+   //@{
+
+   /**   
+    * Default Constructor
+    */
+   LTIOSubStream();
+
+   /**   
+    * Destructor
+    */
+   virtual ~LTIOSubStream();
+
+   /**
+    * Initializes the stream
+    *
+    * @param   stream  the parent stream to be subsetted
+    * @param   start   the byte offset to be byte 0 of the subset stream 
+    * @param   end     the byte offset to be the last byte of the subset
+    *                  stream: reading or writing past this byte will be
+    *                  handled as an EOF condition
+    * @param   takeOwnership   if true, this object will take ownership
+    *                  of \a stream and delete it
+    */
+   virtual LT_STATUS initialize(LTIOStreamInf* stream,
+                                lt_int64 start,
+                                lt_int64 end,
+                                bool takeOwnership=false);
+
+   /** 
+    * @name Status accessors
+    */
+   //@{
+
+	/**
+    * Indicates whether the stream is at the end of its data or not.
+    *
+	 *	@return  true     the stream is valid and at the end of its data.  
+    * @retval false     otherwise
+	 */
+	virtual bool isEOF();
+
+
+   /** 
+    * @name Opening and closing
+    */
+   //@{
+
+	/**
+    * Is the stream open?
+    *
+	 *	@retval  true  the stream is valid and in a state that allows data access.
+    * @retval  false otherwise
+	 */
+	virtual bool isOpen();
+
+	/**
+	 *	Opens the stream.
+    *
+    * Opening a stream puts it in a state that allows data access based on cached
+	 *	initialization parameters.
+    *
+	 * @retval  LT_STS_IOStreamUninitialized  The stream has not been initialized with enough
+	 *		                                    information to open the stream
+	 *	@retval  LT_STS_IOStreamInvalidState   The the stream is already open
+	 *	@retval  LT_STS_Success                On success.
+	 *	@retval  LT_STS_Failure                Otherwise.
+	 */
+	virtual LT_STATUS open();
+	
+	/**
+	 *	Closes the stream.
+    *
+	 *	Puts the stream in a state that does not allow data access.  May
+	 *	free up resources, but only in such a way that doesn't inhibit
+	 *	successful future calls to open()
+    *
+	 *	@retval  LT_STS_Success                On success, or if the stream is already closed.
+	 *	@retval  LT_STS_Failure                Otherwise.
+	 */
+	virtual LT_STATUS close();
+
+   //@}
+
+
+   /** 
+    * @name Data access
+    */
+   //@{
+
+	/**
+	 * Retrieve the specified number of bytes from the data source and
+	 *	place them in pDest.
+	 *	
+	 *	@param   pDest         buffer in which to store read data
+	 *	@param   numBytes      number of bytes to read from stream
+    *
+	 *	@retval numBytes        The number of bytes actually read
+	 */
+   virtual lt_uint32 read( lt_uint8 *pDest, lt_uint32 numBytes );
+	
+	/**
+	 * Store the specified number of bytes in the data source.  
+    *
+	 *	@param   pSrc        buffer from which to store data
+	 *	@param   numBytes    number of bytes to write to stream
+    *
+	 *	@retval  numBytes    number of bytes actually written
+	 */
+   virtual lt_uint32 write( const lt_uint8 *pSrc, lt_uint32 numBytes );
+
+   //@}
+
+   /** 
+    * @name Positioning
+    */
+   //@{
+
+	/**
+	 *	Moves the the data access position to origin + offset
+    * 
+	 *	@param   offset   number of bytes from origin at which to the next read or write will take place
+	 *	@param   origin   place in stream from which to seek
+    *
+	 *	@retval  LT_STS_IOStreamUnsupported    The stream is not seekable
+	 *	@retval  LT_STS_IOStreamInvalidArgs    The offset and origin do not specify a valid location in the stream
+	 *	@retval  LT_STS_Success                On success
+	 *	@retval  LT_STS_Failure                Otherwise
+	*/
+   virtual LT_STATUS seek( lt_int64 offset, LTIOSeekDir origin );
+
+	/**
+	 *	Returns the current data access position as an offset from the start of the data
+    *
+	 *	@retval  postion     Number of bytes from the start of the data  
+	 *	@retval  -1          On error.  
+	 */
+   virtual lt_int64 tell();
+
+   //@}
+
+   /** 
+    * @name Other operations
+    */
+   //@{
+
+	/**
+    * @brief   Clone the stream
+    *
+    * Create new stream of the same type with the same initialization parameters.  
+	 *	The transmission of these parameters is the responsibility of the derived type.
+	 *	The new stream should initially return false for isOpen().
+	 *	
+	 *	@retval  NULL  the stream could not be duplicated; valid LTIOStreamInf* otherwise.
+	*/
+	virtual LTIOStreamInf* duplicate();
+
+	virtual LT_STATUS getLastError() const;
+
+	virtual const char* getID() const;
+
+   //@}
+
+
+protected:
+   /**   cleanup method */
+   void cleanup();
+
+   LTIOStreamInf* m_stream;
+   bool m_ownsStream;
+   lt_int64 m_startOffset;
+   lt_int64 m_endOffset;
+
+   bool m_isEOF;
+};
+
+
+
+LT_END_NAMESPACE( LizardTech )
+
+
+#endif	// LT_IOSUBSTREAM_H
diff --git a/src/DSDK/include/support/lt_lib_io.h b/src/DSDK/include/support/lt_lib_io.h
new file mode 100644
index 0000000..e7dd39c
--- /dev/null
+++ b/src/DSDK/include/support/lt_lib_io.h
@@ -0,0 +1,63 @@
+/* $Id: lt_lib_io.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC - C */
+ 
+/**       
+ * @file
+ * 
+ * Support for the IO classes.
+ */
+#ifndef LT_LIB_IO_H
+#define LT_LIB_IO_H
+
+#include "lt_base.h"
+
+#ifdef LT_CPLUSPLUS
+extern "C" {
+#endif
+
+/**
+ *	Stream seek directions.
+ */
+typedef enum LTIOSeekDir
+{
+   /**   error */
+	LTIO_SEEK_DIR_ERROR = 1,
+	
+	/** Offset from the beginning of the file */
+	LTIO_SEEK_DIR_BEG = 2,
+
+	/** Offset from the current read/write position */
+	LTIO_SEEK_DIR_CUR = 3,
+
+	/** Offset from the end of the file (offsets need to be negative to be valid) */
+	LTIO_SEEK_DIR_END = 4,
+
+   /** Marker */
+	LTIO_SEEK_DIR_MAX = 5
+} LTIOSeekDir;
+
+//	status codes
+#include "lt_ioStatus.h"
+
+//	macros
+#define LTIO_HR_FAILED(hr)  ((long)(hr)<0)
+
+#ifdef LT_OS_MAC
+#error Unsupported platform
+#endif
+
+
+#ifdef LT_CPLUSPLUS
+}
+#endif
+
+#endif
diff --git a/src/DSDK/include/support/lt_platform.h b/src/DSDK/include/support/lt_platform.h
new file mode 100644
index 0000000..13e2310
--- /dev/null
+++ b/src/DSDK/include/support/lt_platform.h
@@ -0,0 +1,223 @@
+/* $Id: lt_platform.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+
+/**      
+ * @file
+ *
+ * Preprocessor symbols for canonical identification of OS, architecture,
+ * and compiler.  Scrupulous use of these and only these symbols avoids
+ * portability problems due to inconsistent platform tests.
+ * 
+ * For a given target platform XYZ, we define three symbols with the value 1:
+ *
+ * \li \c LT_OS_XYZ defines the operating system
+ * \li \c LT_COMPILER_XYZ defines the compiler
+ * \li \c LT_ARCH_XYZ defines the HW architecture
+ *
+ * Note for Windows, we treat WIN32, WIN64, and WinCE as distinct OS's, but
+ * both will define LT_OS_WIN for the typical cases.
+ *
+ * See the file lt_platform.h for full details.
+ *
+ * @note This file is C-callable.
+ */
+
+
+#ifndef LT_PLATFORM_H
+#define LT_PLATFORM_H
+
+/*
+ */
+
+
+/*
+ * Check for Cross Platform Macros
+ */
+
+/*  Check for GCC, Intel, of MSVC */
+#if defined(__GNUC__) || defined(__GNUG__)   /* GNU's GCC */
+   #define LT_COMPILER_GNU 1
+   #if defined(__GNUC__)
+      #define LT_COMPILER_GCC 1
+   #endif
+   #if defined(__GNUG__)
+      #define LT_COMPILER_GXX 1
+   #endif
+   #if(__GNUC__ == 2)
+      #define LT_COMPILER_GCC2 1
+   #elif(__GNUC__ == 3)
+      #define LT_COMPILER_GCC3 1
+   #elif(__GNUC__ == 4)
+      #define LT_COMPILER_GCC4 1
+   #else
+      #error PLATFORM ERROR: Unsupported version of GCC 
+   #endif
+#elif defined(__ECL) || defined(__LCL)  /* Intel's VTune */
+   #define LT_COMPILER_INTEL 1
+#elif defined(_MSC_VER)    /* MS Visual C/C++ */
+   #define LT_COMPILER_MS 1
+   #if _MSC_VER == 1300 || _MSC_VER == 1310
+      #define LT_COMPILER_MS7 1
+   #endif
+   #if _MSC_VER == 1400 || _MSC_VER == 1410
+      #define LT_COMPILER_MS8 1
+      #define _CRT_SECURE_NO_DEPRECATE
+      /* disable deprecation warnings (4996) */
+      #pragma warning(disable:4996)
+   #endif
+#endif
+
+#if defined(_WIN64) || defined(WIN64)
+
+   #define LT_OS_WIN 1
+   #define LT_OS_WIN64 1
+
+   #if !defined(_M_IX86)
+      #define LT_ARCH_IA64 1
+   #else
+      #error PLATFORM ERROR: WIN64, but unknown architecture
+   #endif
+
+   #if !defined(LT_COMPILER_INTEL) && !defined(LT_COMPILER_MS)
+      #error PLATFORM ERROR: WIN64, but unknown compiler
+   #endif
+
+#elif defined(_WIN32_WCE)
+
+   #define LT_OS_WIN 1
+   #define LT_OS_WINCE 1
+  
+   #if defined(ARM) || defined(_ARM_)  
+      #define LT_ARCH_ARM 1
+   #elif defined(MIPS) || defined(_MIPS_)
+      #define LT_ARCH_MIPS 1
+   #elif defined(SH3) || defined(_SH3_)
+      #define LT_ARCH_SH3 1
+   #elif defined(SH4) || defined(_SH4_)
+      #define LT_ARCH_SH4 1
+   #elif defined(_X86_) || defined(x86)
+      #define LT_ARCH_IA32 1
+   #else
+      #error PLATFORM ERROR: WINCE, but unknown architecture
+   #endif
+
+   #if !defined(LT_COMPILER_MS)
+      #error PLATFORM ERROR: WINCE, but unknown compiler
+   #endif
+
+#elif defined(_WIN32) || defined(WIN32)
+
+   #define LT_OS_WIN 1
+   #define LT_OS_WIN32 1
+
+   #if defined(_M_IX86)
+      #define LT_ARCH_IA32 1
+   #else
+      #error PLATFORM ERROR: WIN32, but unknown architecture
+   #endif
+
+   #if !defined(LT_COMPILER_INTEL) && !defined(LT_COMPILER_MS)
+      #error PLATFORM ERROR: WIN32, but unknown compiler
+   #endif
+
+#elif defined(__APPLE__) && defined(__MACH__)
+
+   #define LT_OS_UNIX 1
+   #define LT_OS_DARWIN 1
+
+   #if defined(__ppc__)
+      #define LT_ARCH_PPC 1
+   #elif defined(i386)
+      #define LT_ARCH_IA32 1
+   #else
+      #error PLATFORM ERROR: DARWIN, but unknown architecture
+   #endif
+
+   #if !defined(LT_COMPILER_GNU)
+      #error PLATFORM ERROR: DARWIN, but unknown compiler
+   #endif
+
+#elif defined (__sun)
+
+   #define LT_OS_UNIX 1
+   #define LT_OS_SUNOS 1
+
+   #if defined(__sparc)
+      #define LT_ARCH_SPARC 1
+   #elif defined(i386)
+      #define LT_ARCH_IA32 1
+   #else
+      #error PLATFORM ERROR: SUNOS, but unknown architecture
+   #endif
+
+   #if defined (__SUNPRO_CC)
+      #define LT_COMPILER_SUN 1
+      #define LT_COMPILER_SUNPRO_CC 1
+   #elif defined(__SUNPRO_C)
+      #define LT_COMPILER_SUN 1
+      #define LT_COMPILER_SUNPRO_C 1
+   #elif !defined(LT_COMPILER_GNU)
+      #error PLATFORM ERROR: SUNOS, but unknown compiler
+   #endif
+
+#elif defined (linux) || defined (__linux__) || defined (__linux)
+
+   #define LT_OS_UNIX 1
+   #define LT_OS_LINUX 1
+
+   #if defined(i386)
+      #define LT_ARCH_IA32 1
+   #else
+      #error PLATFORM ERROR: LINUX, but unknown architecture
+   #endif
+
+   #if !defined(LT_COMPILER_GNU)
+      #error PLATFORM ERROR: DARWIN, but unknown compiler
+   #endif
+
+#else
+   #error PLATFORM ERROR: unsupported target platform
+#endif
+
+#if !defined(LT_OS_WIN) && !defined(LT_OS_UNIX)
+   #error PLATFORM ERROR: set LT_OS_WIN or LT_OS_UNIX
+#endif
+
+/*
+ * Endian-ness
+ */
+
+#if defined(LT_ARCH_IA32) || defined(LT_ARCH_IA64) || defined(LT_ARCH_ARM)
+   #define LT_LITTLE_ENDIAN
+#elif defined(LT_ARCH_PPC) || defined(LT_ARCH_SPARC)
+   /* We do not define LT_BIG_ENDIAN, as that would just confuse things;
+      either you're little endian, or you're not. */
+#else
+   #error PLATFORM ERROR: unknown architecture
+#endif
+
+/*
+ * backwards compatability, deprecated stuff
+ */
+
+#if defined(LT_LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
+   /* this is deprecated! */
+   #define _LITTLE_ENDIAN
+#endif
+
+#ifdef LT_OS_UNIX
+   #define LT_UNIX 1
+#endif
+
+#endif /* LT_PLATFORM_H */
+
diff --git a/src/DSDK/include/support/lt_status.h b/src/DSDK/include/support/lt_status.h
new file mode 100644
index 0000000..e80213d
--- /dev/null
+++ b/src/DSDK/include/support/lt_status.h
@@ -0,0 +1,151 @@
+/* $Id: lt_status.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+/**      
+ * @file
+ *
+ * Declaration of the LT_STATUS type and some commonly used status codes.
+ *
+ * @note This file is C-callable.
+ */
+
+#ifndef LT_STATUS_H
+#define LT_STATUS_H
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4) 
+#endif
+
+/**
+ * @typedef LT_STATUS
+ *
+ * An integral status code.
+ *
+ * This value is explicitly sized, i.e. lt_uint32 and not an "unsigned
+ * long", so it can be passed safely between pre-compiled libraries.  Each
+ * LizardTech project/library is assigned ranges of values, e.g. 1000-1999,
+ * for project-specific, local usage.  Values 0-100 are general,
+ * LizardTech-wide codes.  Values 65000-65535 are reserved for customer use.
+ */
+typedef lt_uint32 LT_STATUS;
+
+
+/**
+ * @name Common status codes
+ */
+/*@{*/
+
+/**
+ * status code indicating success
+ *
+ * This status code indicates the function completed sucessfully.
+ */
+#define LT_STS_Success ((LT_STATUS)0)
+
+/**
+ * status code indicating failure
+ *
+ * This status code indicates general, nonspecific failure.  Use sparingly;
+ * project-specific codes are preferred where possible.
+ */
+#define LT_STS_Failure ((LT_STATUS)1)
+
+/**
+ * status code indicating unintialized variable
+ *
+ * This status code is only used as a sentinal value for initializing
+ * LT_STATUS variables: it is the "-1" for status codes.  A conformant
+ * function should _never_ return this value.
+ */
+#define LT_STS_Uninit ((LT_STATUS)2)
+      
+/**
+ * status code indicating bad function parameter
+ *
+ * This status code indicates that one of the parameters passed to the
+ * function was invalid, according to the documented interface rules.
+ * Examples: an integer value is out of the allowed range, or a pointer
+ * 
+ */
+#define LT_STS_BadParam ((LT_STATUS)3)
+      
+/**
+ * status code indicating bad calling context for function
+ *
+ * This status code indicates that the function was called in some
+ * unexpected fashion: not that there was anything wrong with the
+ * parameters per se, it's just that the world was not set up for
+ * you to make this particular call in this particular way right now --
+ * you've violated a documented  execution constraint of some sort.
+ * Examples: calling a class's member function before calling initialize(),
+ * calling decode before setting a scene or an output buffer, etc.
+ * (Contrast this with LT_STS_BadParam, which is a more specific
+ * kind of problem.)
+ */
+#define LT_STS_BadContext ((LT_STATUS)4)
+
+/**
+ * status code indicating 3rd-party library error
+ *
+ * This status code indicates an unknown or otherwise undiagnosable
+ * exception or error was generated by a call into a 3rd party library.
+ */
+#define LT_STS_ForeignError ((LT_STATUS)5)
+      
+/**
+ * status code indicating unreachable code
+ *
+ * This status code is used for code that by definition should not or
+ * cannot be reached, e.g. the default case in a switch statement for
+ * which you think you've covered the full range of legal case values,
+ * where you're left with a dangling return statement.  A return of
+ * LT_STS_NotReached is often preceeded by "LT_ASSERT(false)".
+ */
+#define LT_STS_NotReached ((LT_STATUS)6)
+      
+/**
+ * status code indicating bad NULL pointer dereference
+ *
+ * This status code is used when checking a pointer to make sure that
+ * it is not NULL, prior to dereferencing it.
+ */
+#define LT_STS_NullPointer ((LT_STATUS)7)
+
+/**
+ * status code indicating new/malloc/calloc failed
+ *
+ * This status code is used when allocating memory returns a NULL 
+ * pointer.
+ */
+#define LT_STS_OutOfMemory ((LT_STATUS)8)
+
+/*@}*/
+      
+
+/**
+ * @name Macros for checking status codes
+ */
+/*@{*/
+
+/** checks return value for success status */
+#define LT_SUCCESS( err ) ((err)==LT_STS_Success)
+/** checks return value for failure status */
+#define LT_FAILURE( err ) ((err)!=LT_STS_Success)
+
+/*@}*/
+
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(pop) 
+#endif
+
+#endif /* LT_STATUS_H */
diff --git a/src/DSDK/include/support/lt_system.h b/src/DSDK/include/support/lt_system.h
new file mode 100644
index 0000000..e6037cc
--- /dev/null
+++ b/src/DSDK/include/support/lt_system.h
@@ -0,0 +1,94 @@
+/* $Id: lt_system.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+/**      
+ *  @file  lt_system.h
+ *
+ *  @brief Declaration of standard system headers in a C-interface.
+ * 
+ *  $Date: 2006-10-27 08:40:40 -0300 (sex, 27 out 2006) $
+ *  $Revision: 5124 $
+ */
+
+
+#ifndef LT_SYSTEM_H
+#define LT_SYSTEM_H
+
+#include "lt_platform.h"
+
+/*
+ * justifications for inclusions are that we want:
+ *
+ *   NULL
+ *   memcpy() ...
+ *   malloc() ...
+ *   strlen() ...
+ *   isdigit() ...
+ *   printf() ...
+ *   posix
+ */
+
+
+/* common to all platforms */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <math.h>
+#include <stddef.h>
+#include <ctype.h>
+#include <limits.h>
+#include <float.h>
+
+
+#if defined(LT_OS_LINUX)
+
+   #include <unistd.h>
+   #include <strings.h>
+   #include <time.h>
+   #include <wchar.h>
+
+#elif defined(LT_OS_SUNOS)
+
+   #include <unistd.h>
+   #include <strings.h>
+   #include <time.h>
+   #include <wchar.h>
+
+#elif defined(LT_OS_DARWIN)
+
+   #include <unistd.h>
+   #include <strings.h>
+   #include <time.h>
+   
+   #if defined(LT_OS_DARWIN6)
+   	#include <wcstring.h>
+   #else
+   	#include <wchar.h>
+   #endif
+
+#elif defined(LT_OS_WINCE)
+
+   /* (nothing special for now) */
+
+#elif defined(LT_OS_WIN32)
+
+   #include <time.h>
+   #include <wchar.h>
+
+#else
+
+   #error Port me!
+
+#endif
+
+
+#endif /* LT_SYSTEM_H */
diff --git a/src/DSDK/include/support/lt_types.h b/src/DSDK/include/support/lt_types.h
new file mode 100644
index 0000000..e7612df
--- /dev/null
+++ b/src/DSDK/include/support/lt_types.h
@@ -0,0 +1,146 @@
+/* $Id: lt_types.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+/**      
+ * @file
+ *
+ * Declaration of standard types and limits in a C-interface.
+ * 
+ * @note This file is C-callable.
+ */
+
+
+#ifndef LT_TYPES_H
+#define LT_TYPES_H
+
+#include <limits.h>
+#include <float.h>
+
+#include "lt_platform.h"
+
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4) 
+#endif
+
+/**
+ * @name Fundamental types
+ *
+ * We provide typdefs for all the basic C datatypes.
+ *
+ * @note 80 and 128-bit floats are inherently unportable, so we do not use them.
+ */
+/*@{*/
+/** signed 8-bit integer */
+typedef signed char     lt_int8;
+/** unsigned 8-bit integer */
+typedef unsigned char   lt_uint8;
+/** signed 16-bit integer */
+typedef signed short    lt_int16;
+/** unsigned 16-bit integer */
+typedef unsigned short  lt_uint16;
+/** signed 32-bit integer */
+typedef signed int      lt_int32;
+/** unsigned 32-bit integer */
+typedef unsigned int    lt_uint32;
+/** 32-bit floating point (\b DEPRECATED) */
+typedef float           lt_float32;
+/** 64-bit floating point (\b DEPRECATED) */
+typedef double          lt_float64;
+
+#if defined(LT_COMPILER_MS)
+   /** signed 64-bit integer */
+   typedef signed __int64     lt_int64;
+   /** unsigned 64-bit integer */
+   typedef unsigned __int64   lt_uint64;
+#elif defined ( LT_COMPILER_GNU ) || \
+      defined ( LT_COMPILER_SUN )
+   /** signed 64-bit integer */
+   typedef long long int              lt_int64;
+   /** unsigned 64-bit integer */
+   typedef unsigned long long int     lt_uint64;
+#else
+   #error NOT YET PORTED TO TARGET COMPILER
+#endif
+/*@}*/
+
+
+#ifndef DOXYGEN_EXCLUDE
+
+#define LT_CHAR_MAX ((char)CHAR_MAX) 
+#define LT_CHAR_MIN ((char)CHAR_MIN) 
+#define LT_SCHAR_MAX ((signed char)SCHAR_MAX) 
+#define LT_SCHAR_MIN ((signed char)SCHAR_MIN) 
+#define LT_UCHAR_MAX ((unsigned char)UCHAR_MAX) 
+
+#define LT_SHRT_MAX ((short int)SHRT_MAX) 
+#define LT_SHRT_MIN ((short int)SHRT_MIN) 
+#define LT_USHRT_MAX ((unsigned short int)USHRT_MAX) 
+
+#define LT_INT_MAX ((int)INT_MAX) 
+#define LT_INT_MIN ((int)INT_MIN) 
+#define LT_UINT_MAX ((unsigned int)UINT_MAX) 
+
+#define LT_LONG_MAX ((long int)LONG_MAX) 
+#define LT_LONG_MIN ((long int)LONG_MIN) 
+#define LT_ULONG_MAX ((unsigned long int)ULONG_MAX) 
+
+#define LT_FLT_MIN ((float)FLT_MIN)
+#define LT_FLT_MAX ((float)FLT_MAX)
+#define LT_FLOAT_MIN (LT_FLT_MIN)
+#define LT_FLOAT_MAX (LT_FLT_MAX)
+
+#define LT_DBL_MIN ((double)DBL_MIN)
+#define LT_DBL_MAX ((double)DBL_MAX)
+#define LT_DOUBLE_MIN (LT_DBL_MIN)
+#define LT_DOUBLE_MAX (LT_DBL_MAX)
+
+#define LT_INT8_MAX      ((lt_int8)127)                     /*  2^7 - 1  */
+#define LT_INT8_MIN      ((lt_int8)(-LT_INT8_MAX - 1))      /*  -2^7     */
+#define LT_UINT8_MAX     ((lt_uint8)255U)                   /*  2^8 - 1  */
+#define LT_UINT8_MIN     (0)
+#define LT_INT16_MAX     ((lt_int16)32767)                  /*  2^15 - 1 */
+#define LT_INT16_MIN     ((lt_int16)-LT_INT16_MAX - 1)      /*  -2^15    */
+#define LT_UINT16_MAX    ((lt_uint16)65535U)                /*  2^16 - 1 */
+#define LT_UINT16_MIN    (0)
+#define LT_INT32_MAX     ((lt_int32)2147483647)             /* 2^31 - 1 */
+#define LT_INT32_MIN     ((lt_int32)(-LT_INT32_MAX - 1))    /* -2^31    */
+#define LT_UINT32_MAX    ((lt_uint32)4294967295U)           /* 2^32 - 1 */
+#define LT_UINT32_MIN    (0)
+#define LT_INT64_MIN     ((lt_int64)-LT_INT64_MAX - 1)      /* -2^63    */
+#define LT_UINT64_MIN    (0)
+
+// GNU wants these constants suffixed, windows does not
+#if defined(LT_COMPILER_GNU) || \
+    defined(LT_COMPILER_SUN)
+	#define LT_INT64_MAX     ((lt_int64)9223372036854775807LL)    /* 2^63 - 1 */
+	#define LT_UINT64_MAX    ((lt_uint64)18446744073709551615ULL)  /* 2^64 - 1 */
+#elif defined(LT_COMPILER_MS)
+	#define LT_INT64_MAX     ((lt_int64)9223372036854775807)    /* 2^63 - 1 */
+	#define LT_UINT64_MAX    ((lt_uint64)18446744073709551615)  /* 2^64 - 1 */
+#else
+   #error NOT YET PORTED TO TARGET COMPILER
+#endif
+
+#endif /* DOXYGEN_EXCLUDE */
+
+
+/** (\b DEPRECATED) */
+typedef char lt_utf8;
+#define LT_UTF8STR(str) ((lt_utf8 *)(str))
+
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(pop) 
+#endif
+
+#endif /* LT_TYPES_H */
diff --git a/src/DSDK/include/support/lt_utilStatus.h b/src/DSDK/include/support/lt_utilStatus.h
new file mode 100644
index 0000000..1f715ce
--- /dev/null
+++ b/src/DSDK/include/support/lt_utilStatus.h
@@ -0,0 +1,125 @@
+/* $Id: lt_utilStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LT_UTILSTATUS_H
+#define LT_UTILSTATUS_H
+
+#include "lt_base.h"
+
+// these should be in lt_define.h
+LT_STATUSSTRING_ADD(LT_STS_Success, "Success")
+LT_STATUSSTRING_ADD(LT_STS_Failure, "Failure")
+
+// these are only used for testing
+LT_STATUSSTRING_ADD(910, "status test uint32=%u")
+LT_STATUSSTRING_ADD(911, "status test int32=%d")
+LT_STATUSSTRING_ADD(912, "status test double=%f")
+LT_STATUSSTRING_ADD(913, "status test string=%s")
+LT_STATUSSTRING_ADD(914, "status test uint=%u uint=%u double=%f string=%s string=%s string=%s foo")
+LT_STATUSSTRING_ADD(915, "status test filespec=%F")
+
+/** Base value for util library error codes  */
+#define LTUTIL_STATUS_BASE                         3000
+LT_STATUSSTRING_ADD(LTUTIL_STATUS_BASE, "lt_lib_utils BASE")
+
+/** Max value for util library error codes  */
+#define LTUTIL_STATUS_MAX                          3999
+LT_STATUSSTRING_ADD(LTUTIL_STATUS_MAX, "lt_lib_utils MAX")
+
+#define LTUTIL_STS_NULL_POINTER                    3001
+LT_STATUSSTRING_ADD(LTUTIL_STS_NULL_POINTER, "NULL pointer dereferenced")
+#define LTUTIL_STS_NOT_FOUND                       3002
+LT_STATUSSTRING_ADD(LTUTIL_STS_NOT_FOUND, "The specified resource was not found")
+
+// caller failed to call initialize() (or called it twice)
+#define LTUTIL_STS_CRITICAL_SECTION_INIT           3010
+LT_STATUSSTRING_ADD(LTUTIL_STS_CRITICAL_SECTION_INIT, "critical section initialization failure")
+
+// problem closing mutex
+#define LTUTIL_STS_MUTEX_CLOSE_ERROR               3020
+LT_STATUSSTRING_ADD(LTUTIL_STS_MUTEX_CLOSE_ERROR, "mutex close error")
+#define LTUTIL_STS_MUTEX_LOCK_ERROR                3021
+LT_STATUSSTRING_ADD(LTUTIL_STS_MUTEX_LOCK_ERROR, "mutex lock error")
+#define LTUTIL_STS_MUTEX_UNLOCK_ERROR              3022
+LT_STATUSSTRING_ADD(LTUTIL_STS_MUTEX_UNLOCK_ERROR, "mutex unlock error")
+
+// LTFileUtils
+#define LTUTIL_STS_DELETE_ERROR                    3030
+LT_STATUSSTRING_ADD(LTUTIL_STS_DELETE_ERROR, "delete error")
+#define LTUTIL_STS_MOVE_ERROR                      3031
+LT_STATUSSTRING_ADD(LTUTIL_STS_MOVE_ERROR, "move error")
+#define LTUTIL_STS_CREATEDIR_ERROR                 3032
+LT_STATUSSTRING_ADD(LTUTIL_STS_CREATEDIR_ERROR, "createdir error")
+#define LTUTIL_STS_INVALIDFILESPEC_ERROR           3033
+LT_STATUSSTRING_ADD(LTUTIL_STS_INVALIDFILESPEC_ERROR, "invalid filespec error")
+#define LTUTIL_STS_ERR_TEMPNAM_FAIL                3034
+LT_STATUSSTRING_ADD(LTUTIL_STS_ERR_TEMPNAM_FAIL, "tempnam error")
+#define LTUTIL_STS_FILE_NOT_FOUND                  3035
+LT_STATUSSTRING_ADD(LTUTIL_STS_FILE_NOT_FOUND, "The file was not found")
+#define LTUTIL_STS_DIR_NOT_FOUND                   3036
+LT_STATUSSTRING_ADD(LTUTIL_STS_DIR_NOT_FOUND, "The directory was not found")
+#define LTUTIL_STS_ERR_MKTEMP_FAIL                 3037
+LT_STATUSSTRING_ADD(LTUTIL_STS_ERR_MKTEMP_FAIL, "mktemp error")
+
+// lt_winUtils.cpp
+#define LT_STS_UTIL_ExtractRegistryText                     3040
+LT_STATUSSTRING_ADD(LT_STS_UTIL_ExtractRegistryText, "error extracting registry text - %s")
+
+
+#define LTUTIL_STS_InvalidProtocol                          3050
+LT_STATUSSTRING_ADD(LTUTIL_STS_InvalidProtocol, "Invalid protocol")
+
+// lt_utilShell.cpp
+#define LT_STS_UTIL_ShellRedirectCannotOpenFile             3060
+LT_STATUSSTRING_ADD(LT_STS_UTIL_ShellRedirectCannotOpenFile, "ShellRedirectCannotOpenFile")
+#define LT_STS_UTIL_ShellRedirectDUPError1                  3061
+LT_STATUSSTRING_ADD(LT_STS_UTIL_ShellRedirectDUPError1, "ShellRedirectDUPError1")
+#define LT_STS_UTIL_ShellRedirectDUPError2                  3062
+LT_STATUSSTRING_ADD(LT_STS_UTIL_ShellRedirectDUPError2, "ShellRedirectDUPError2")
+#define LT_STS_UTIL_ShellRedirectDUPError3                  3063
+LT_STATUSSTRING_ADD(LT_STS_UTIL_ShellRedirectDUPError3, "ShellRedirectDUPError3")
+#define LT_STS_UTIL_ShellRedirectCannotCloseFile            3064
+LT_STATUSSTRING_ADD(LT_STS_UTIL_ShellRedirectCannotCloseFile, "ShellRedirectCannotCloseFile")
+
+// lt_utilStatusData.cpp
+/** indicates StatusData initialization error */
+#define LT_STS_UTIL_StatusDataInitialized                   3070
+LT_STATUSSTRING_ADD(LT_STS_UTIL_StatusDataInitialized, "StatusData initialization error")
+/** indicates StatusData data type error */
+#define LT_STS_UTIL_StatusDataTypeError                     3071
+LT_STATUSSTRING_ADD(LT_STS_UTIL_StatusDataTypeError, "StatusData data type error")
+
+// lt_packageInfo.cpp
+#define LT_STS_UTIL_PackageHomeNotFound                     3080
+LT_STATUSSTRING_ADD(LT_STS_UTIL_PackageHomeNotFound, "package home not found")
+#define LT_STS_UTIL_PackageDirNotFound                      3081
+LT_STATUSSTRING_ADD(LT_STS_UTIL_PackageDirNotFound, "package directory not found")
+#define LT_STS_UTIL_PackageFileNotFound                     3082
+LT_STATUSSTRING_ADD(LT_STS_UTIL_PackageFileNotFound, "package file not found")
+#define LT_STS_UTIL_PackageHomeRegKeyNotFound               3083
+LT_STATUSSTRING_ADD(LT_STS_UTIL_PackageHomeRegKeyNotFound, "package home registry key not found")
+#define LT_STS_UTIL_PackageHomeEnvVarUndefined              3084
+LT_STATUSSTRING_ADD(LT_STS_UTIL_PackageHomeEnvVarUndefined, "package home environment variable not defined")
+
+// lt_utilTimer.cpp
+#define LT_STS_UTIL_TimeUnknown                             3090
+LT_STATUSSTRING_ADD(LT_STS_UTIL_TimeUnknown, "time could not be determined")
+
+// lt_utilLocale.h
+#define LT_STS_UTIL_LocaleNotSet                            3100
+LT_STATUSSTRING_ADD(LT_STS_UTIL_LocaleNotSet, "locale could not be set")
+
+//	lt_utilThread.h
+#define LT_STS_UTIL_ThreadAlreadyRunning                    3110
+LT_STATUSSTRING_ADD(LT_STS_UTIL_ThreadAlreadyRunning,		"thread is already running")
+
+#endif // LT_UTILSTATUS_H
diff --git a/src/DSDK/include/support/lt_utilStatusData.h b/src/DSDK/include/support/lt_utilStatusData.h
new file mode 100644
index 0000000..5b23633
--- /dev/null
+++ b/src/DSDK/include/support/lt_utilStatusData.h
@@ -0,0 +1,169 @@
+/* $Id: lt_utilStatusData.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LT_UTILSTATUSDATA_H
+#define LT_UTILSTATUSDATA_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+// system
+#include <stdlib.h>
+
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4) 
+#endif
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTFileSpec;
+
+
+/**
+ * Interface to the error data stack.
+ *
+ * This class provides functions for pushing and popping data to and from the
+ * "error stack", used to pass information to accompany a simple status code.
+ *
+ * @note For most users, the functions provided in the file
+ * lt_utilStatusStrings.h are sufficient for error reporting.  Only
+ * applications which need to add their own error strings or perform
+ * internationalization need to use this class.
+ *
+ * @note This error management system is expected to be substantially changed
+ * in a future release.
+ *
+ * Example usage:
+ *
+ * @verbatim
+// IN APPLICATION
+LTUtilStatus::initialize();
+...
+
+// IN SOME LIBRARY
+LT_STATUS sts = someFunction("foo.txt",99);
+if (!LT_SUCCESS(sts))
+{
+  LTUtilStatusData::pushBegin(sts);
+  LTUtilStatusData::pushString("foo.txt");
+  LTUtilStatusData::pushEnd();
+  return sts;
+}
+...
+
+// IN LT_LIB_UTILS
+LT_STATUS sts;
+char* str;
+int i;
+LTUtilStatusData::popBegin(sts);
+// parse string for code sts to determine needed data items...
+LTUtilStatusData::popString(str);
+LTUtilStatusData::popInt32(i);
+LTUtilStatusData::popEnd();
+...
+
+// IN APPLICATION
+LTUtilStatusData::terminate();
+ * @endverbatim
+ *
+ * To set error data, you must first do pushBegin(), then push zero or
+ * more other data items (called Records), then do a pushEnd().
+ *
+ * To retrieve error data, you must first do a popBegin(), followed by
+ * pops of whatever you pushed, then do a popEnd().
+ *
+ * Note it is assumed the popper knows the order and type of things to be
+ * popped off.  (This is not really a problem, since the status code is
+ * associated with a string which will contain %d, %s, etc telling him what
+ * to do.  Furthermore, the only person who should ever need to use the pop
+ * calls will be lt_lib_statusStrings.)
+ *
+ * If you do not call initialize(), the push and pop operations will do
+ * nothing.  This way, apps need not use the StatusData system if they do
+ * not wish to.
+ */
+class LTUtilStatusData
+{
+public:
+   /**
+    * initialize the error stack
+    *
+    * Applications should call this once prior to any other LizardTech
+    * functions, to enable the error reporting system.  If not called, then
+    * any calls to pushData() will be no-ops, and the integral status code
+    * will map to an unintepretted string.
+    *
+    * @return success or failure status code
+    */
+   static LT_STATUS initialize();
+
+   /**
+    * cleanup
+    *
+    * Applications should call this once after all other LizardTech functions
+    * have been called, to clean up memory.
+    *
+    * @return success or failure success code
+    */
+   static LT_STATUS terminate();
+
+   // returns true iff initialize() was called, e.g. system is being used
+   static bool isActive();
+
+   // push data associated with an error onto the error frame stack
+   // do begin(), data..., end()
+   static void pushBegin(LT_STATUS);
+   static void pushUint32(lt_uint32);
+   static void pushInt32(lt_int32);
+   static void pushString(const char*);
+   static void pushDouble(double);
+   static void pushFileSpec(const LTFileSpec&);
+   static void pushEnd();
+
+   // get the top data item off the error frame stack
+   // returns failure if the data itemis not of the specified type
+   static LT_STATUS popBegin(LT_STATUS&);
+   static LT_STATUS popUint32(lt_uint32&);
+   static LT_STATUS popInt32(lt_int32&);
+   static LT_STATUS popString(char*&);         // caller takes ownership of string
+   static LT_STATUS popDouble(double&);
+   static LT_STATUS popFileSpec(LTFileSpec&);
+   static LT_STATUS popEnd();
+
+   // pop off all data items from current frame
+   // used in an emergency, when the top frame is not the one you want
+   //   (and you have no way of knowing how many data items need to be
+   //   popped off)
+   static LT_STATUS popRemainder();
+
+   // remove the current error frame, if any (this is like doing the pop
+   // begin/end sequence, if there is an active frame)
+   static void clear();
+
+private:
+   // nope
+   LTUtilStatusData();
+   ~LTUtilStatusData();
+   LTUtilStatusData(const LTUtilStatusData&);
+   LTUtilStatusData& operator=(const LTUtilStatusData&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(pop) 
+#endif
+
+#endif // LT_UTILSTATUSDATA_H
diff --git a/src/DSDK/include/support/lt_utilStatusStrings.h b/src/DSDK/include/support/lt_utilStatusStrings.h
new file mode 100644
index 0000000..d8e3b4c
--- /dev/null
+++ b/src/DSDK/include/support/lt_utilStatusStrings.h
@@ -0,0 +1,86 @@
+/* $Id: lt_utilStatusStrings.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LT_UTILSTATUSSTRINGS_H
+#define LT_UTILSTATUSSTRINGS_H
+
+// lt_lib_base
+#include "lt_base.h"
+
+/**
+ * @file
+ *
+ * Status code / error string support.
+ *
+ * These functions allow the user to access strings which correspond to
+ * status codes returned by LizardTech functions.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * return a "raw" status string
+ *
+ * This function returns the string for the given status code.  Any format
+ * specifiers in the string will not be interpolated using the error stack
+ * (see LTUtilStatusData).
+ *
+ * @param   code  the status code
+ * @return  the string for the status code
+ */
+extern const char* getRawStatusString(LT_STATUS code);
+
+
+/**
+ * return a formatted status string
+ *
+ * This function returns the string for the given status code.  Any format
+ * specifiers in the string will be expanded (interpolated) using the data
+ * on the error stack (see LTUtilStatusData).
+ *
+ * @param   code  the status code
+ * @return  the string for the status code
+ */
+extern const char* getLastStatusString(LT_STATUS code);
+
+
+/**
+  * initialize the status strings reporting system
+  *
+  * Applications should call this once prior to any other LizardTech
+  * functions, to enable the error reporting system.  If not called, then
+  * any calls to pushData() will be no-ops, and the integral status code
+  * will map to an unintepreted string.
+  *
+  * @return success or failure status code
+  */
+extern LT_STATUS initializeStatusStrings();
+
+
+/**
+  * close out the status strings reporting system
+  *
+  * Applications should call this once after all other LizardTech functions
+  * have been called, to clean up memory.
+  *
+  * @return success or failure success code
+  */
+extern LT_STATUS terminateStatusStrings();
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // LT_UTILSTATUSSTRINGS_H
diff --git a/src/DSDK/include/writers/BMPImageWriter.h b/src/DSDK/include/writers/BMPImageWriter.h
new file mode 100644
index 0000000..a93d69c
--- /dev/null
+++ b/src/DSDK/include/writers/BMPImageWriter.h
@@ -0,0 +1,102 @@
+/* $Id: BMPImageWriter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef BMPIMAGEWRITER_H
+#define BMPIMAGEWRITER_H
+
+// lt_lib_mrsid_core
+#include "lti_geoFileImageWriter.h"
+
+// lt_lib_utils
+#include "lti_imageWriter.h"
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTReusableBuffer;
+
+/**
+ * writes an image stage to a Windows BMP file
+ *
+ * This class writes an image stage to a Windows BMP file.
+ */
+class BMPImageWriter : public LTIGeoFileImageWriter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates a writer for Windows BMP images.
+    *
+    * @param  image  the image to write from
+    */
+   BMPImageWriter(LTIImageStage* image);
+   virtual ~BMPImageWriter();
+   LT_STATUS initialize();
+
+   LT_STATUS writeBegin(const LTIScene& scene);
+   LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+   LT_STATUS writeEnd();
+
+private:
+   typedef LTIGeoFileImageWriter Super;
+
+   LT_STATUS checkImpedance() const;
+
+   // override from LTIImageFilter
+   LTIImageStage* getPreviousStage() const;
+
+   LT_STATUS normalizeProperties(lt_uint32 width, lt_uint32 height);
+   LT_STATUS initFile(lt_uint32 width, lt_uint32 height);
+   LT_STATUS writeHeaders(lt_uint32 width, lt_uint32 height);
+   LT_STATUS initBitmapHeader(lt_uint32 width, lt_uint32 height);
+   LT_STATUS initEndian();
+   LT_STATUS writeStrip(lt_uint32 stripHeight,
+                        const lt_uint8* buf);
+
+   LTIImageStage* m_mapTransform;
+
+   lt_uint32 m_alignedRowBytes;
+   lt_uint32 m_unalignedRowBytes;
+   lt_uint8* m_padding;
+   lt_uint32 m_padsize;
+
+   struct bitmapFileHeaderType;
+   struct bitmapHeaderType;
+
+   bitmapFileHeaderType* m_bmpFileHeader;
+   bitmapHeaderType* m_bmpHeader;
+
+   //  This will provide a marker so the image doesn't write over itself
+   // I need to know how far back to seek.
+   lt_int32 m_seekBackTo;
+
+   LTReusableBuffer* m_stripBuffer;
+
+   // nope
+   BMPImageWriter();
+   BMPImageWriter(BMPImageWriter&);
+   BMPImageWriter& operator=(const BMPImageWriter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // BMPIMAGEWRITER_H
diff --git a/src/DSDK/include/writers/GeoTIFFImageWriter.h b/src/DSDK/include/writers/GeoTIFFImageWriter.h
new file mode 100644
index 0000000..5ee79c0
--- /dev/null
+++ b/src/DSDK/include/writers/GeoTIFFImageWriter.h
@@ -0,0 +1,57 @@
+/* $Id: GeoTIFFImageWriter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef GEOTIFFIMAGEWRITER_H
+#define GEOTIFFIMAGEWRITER_H
+
+// lt_lib_mrsid_imageWriters
+#include "TIFFImageWriter.h"
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+/**
+ * writes an image stage to a GeoTIFF file
+ *
+ * This class writes an image stage to a GeoTIFF file.
+ */
+class GeoTIFFImageWriter : public TIFFImageWriter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates a writer for GeoTIFF images.
+    *
+    * @param  image  the image to write from
+    */
+   GeoTIFFImageWriter(LTIImageStage* image);
+
+private:
+   typedef TIFFImageWriter Super;
+
+   // nope
+   GeoTIFFImageWriter(GeoTIFFImageWriter&);
+   GeoTIFFImageWriter& operator=(const GeoTIFFImageWriter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // GEOTIFFIMAGEWRITER_H
diff --git a/src/DSDK/include/writers/JpegImageWriter.h b/src/DSDK/include/writers/JpegImageWriter.h
new file mode 100644
index 0000000..0da24fe
--- /dev/null
+++ b/src/DSDK/include/writers/JpegImageWriter.h
@@ -0,0 +1,94 @@
+/* $Id: JpegImageWriter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef JPEGIMAGEWRITER_H
+#define JPEGIMAGEWRITER_H
+
+// lt_lib_mrsid_core
+#include "lti_geoFileImageWriter.h"
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+struct jpeg_compress_struct;
+struct jpeg_error_mgr;
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTFileSpec;
+class LTReusableBuffer;
+
+/**
+ * writes an image stage to a JPEG file
+ *
+ * This class writes an image stage to a JPEG file.
+ *
+ * NOTE: getEstimatedOutputSize() will return the nominal
+ * size for the output, not the compression size (which
+ * cannot easily be estimated).
+ */
+class JpegImageWriter : public LTIGeoFileImageWriter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates a writer for JPEG images.
+    *
+    * @param  image      the image to write from
+    * @param  quality    sets the JPEG "quality" encoding parameter;
+    *                    this is a value between 0 and 100
+    * @param  smoothing  sets the JPEG "smoothing" encoding parameter;
+    *                    this is a value between 0 and 100
+    */
+   JpegImageWriter(LTIImageStage* image,
+                   lt_int32 quality = 0,          // 0-100
+                   lt_int32 smoothing = 0);       // 0-100
+   virtual ~JpegImageWriter();
+   LT_STATUS initialize();
+
+   LT_STATUS writeBegin(const LTIScene& scene);
+   LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+   LT_STATUS writeEnd();
+
+private:
+   typedef LTIGeoFileImageWriter Super;
+
+   LT_STATUS checkImpedance() const;
+
+   //struct that contains the JPEG compression parameters
+   struct jpeg_compress_struct* m_jpegObject;
+
+   //struct to handle error messages 
+   struct jpeg_error_mgr* m_jpegErr;
+
+   //two parameters for setting compression quality
+   lt_int32 m_quality;
+   lt_int32 m_smoothingFactor;
+
+   LTReusableBuffer* m_stripBuffer;
+
+   // nope
+   JpegImageWriter();
+   JpegImageWriter(JpegImageWriter&);
+   JpegImageWriter& operator=(const JpegImageWriter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // JPEGIMAGEWRITER_H
diff --git a/src/DSDK/include/writers/PNGImageWriter.h b/src/DSDK/include/writers/PNGImageWriter.h
new file mode 100644
index 0000000..b5cb913
--- /dev/null
+++ b/src/DSDK/include/writers/PNGImageWriter.h
@@ -0,0 +1,75 @@
+/* $Id: PNGImageWriter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2005 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef PNGIMAGEWRITER_H
+#define PNGIMAGEWRITER_H
+
+// lt_lib_mrsid_core
+#include "lti_geoFileImageWriter.h"
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+struct png_struct_def;
+struct png_info_struct;
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+class LTFileSpec;
+class LTReusableBuffer;
+
+/**
+ * writes an image stage to a PNG file
+ *
+ * This class writes an image stage to a PNG file.
+ */
+class PNGImageWriter : public LTIGeoFileImageWriter
+{
+public:
+   PNGImageWriter(LTIImageStage* image);
+   virtual ~PNGImageWriter();
+   
+   LT_STATUS initialize();
+
+   LT_STATUS setWriteTransparencyColor(bool write);
+
+
+   LT_STATUS writeBegin(const LTIScene& scene);
+   LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+   LT_STATUS writeEnd();
+
+private:
+   typedef LTIGeoFileImageWriter Super;
+
+   LT_STATUS checkImpedance() const;
+
+   struct png_struct_def *m_png;
+   struct png_info_struct *m_info;
+   bool m_writeTransparencyColor;
+   char *m_errorMessage;
+
+   LTReusableBuffer *m_stripBuffer;
+
+   // nope
+   PNGImageWriter(PNGImageWriter&);
+   PNGImageWriter& operator=(const PNGImageWriter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // PNGIMAGEWRITER_H
diff --git a/src/DSDK/include/writers/TIFFImageWriter.h b/src/DSDK/include/writers/TIFFImageWriter.h
new file mode 100644
index 0000000..2f1cbff
--- /dev/null
+++ b/src/DSDK/include/writers/TIFFImageWriter.h
@@ -0,0 +1,91 @@
+/* $Id: TIFFImageWriter.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef TIFFIMAGEWRITER_H
+#define TIFFIMAGEWRITER_H
+
+// lt_lib_mrsid_core
+#include "lti_geoFileImageWriter.h"
+
+struct tiff;
+
+
+LT_BEGIN_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+   #pragma warning(push,4)
+#endif
+
+class LTIPixelLookupTable;
+class LTReusableBuffer;
+
+
+/**
+ * writes an image stage to a TIFF file
+ *
+ * This class writes an image stage to a TIFF file.
+ */
+class TIFFImageWriter : public LTIGeoFileImageWriter
+{
+public:
+   /**
+    * constructor
+    *
+    * Creates a writer for TIFF images.
+    *
+    * @param  image  the image to write from
+    * @param  writeGeoTIFF  if true the writer will include GeoTIFF tags
+    */
+   TIFFImageWriter(LTIImageStage *image, bool writeGeoTIFF = false);
+
+   virtual ~TIFFImageWriter();
+   virtual LT_STATUS initialize();
+
+   /**
+    * Output resolution information.  Set this to false to prevent writing
+    * normal TIFF resolution information.
+    *
+    * The default is to write this information.
+    *
+    * @param enable set to true to write resolution information
+    */
+   void setWriteResolution(bool enable);
+
+   LT_STATUS writeBegin(const LTIScene& scene);
+   LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
+   LT_STATUS writeEnd();
+
+private:
+   typedef LTIGeoFileImageWriter Super;
+   static LT_STATUS getLibtiffError(void);
+
+   struct tiff *m_tiff;
+   bool m_writeResolution;
+   bool m_writeGeoTIFF;
+
+   long m_currentRow;
+   lt_int32 m_compression;
+   LTReusableBuffer* m_stripBuffer;
+
+   // nope
+   TIFFImageWriter(TIFFImageWriter&);
+   TIFFImageWriter& operator=(const TIFFImageWriter&);
+};
+
+
+LT_END_NAMESPACE(LizardTech)
+
+#if defined(LT_COMPILER_MS)
+	#pragma warning(pop)
+#endif
+
+#endif // TIFFIMAGEWRITER_H
diff --git a/src/DSDK/include/writers/lti_writersStatus.h b/src/DSDK/include/writers/lti_writersStatus.h
new file mode 100644
index 0000000..d6dc0a1
--- /dev/null
+++ b/src/DSDK/include/writers/lti_writersStatus.h
@@ -0,0 +1,104 @@
+/* $Id: lti_writersStatus.h 5124 2006-10-27 11:40:40Z lubia $ */
+/* //////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
+// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
+// prohibited.  Access to and use of this code is permitted only under     //
+// license from LizardTech, Inc.  Portions of the code are protected by    //
+// US and foreign patents and other filings. All Rights Reserved.          //
+//                                                                         //
+////////////////////////////////////////////////////////////////////////// */
+/* PUBLIC */
+
+#ifndef LTI_WRITERSSTATUS_H
+#define LTI_WRITERSSTATUS_H
+
+#include "lt_base.h"
+
+#define LTI_STS_Writers_Base                                      50400
+LT_STATUSSTRING_ADD(LTI_STS_Writers_Base, "lt_lib_mrsid_imageWriters base")
+
+#define LTI_STS_Writers_CannotWriteFile                           50401
+LT_STATUSSTRING_ADD(LTI_STS_Writers_CannotWriteFile, "Cannot write to file %F")
+
+#define LTI_STS_Writers_UnsupColorSpace                           50402
+LT_STATUSSTRING_ADD(LTI_STS_Writers_UnsupColorSpace, "unsupported colorspace")
+
+#define LTI_STS_Writers_UnsupDataType                             50403
+LT_STATUSSTRING_ADD(LTI_STS_Writers_UnsupDataType, "unsupported datatype")
+
+#define LTI_STS_Writers_AllocFailed                               50404
+LT_STATUSSTRING_ADD(LTI_STS_Writers_AllocFailed, "memory allocation failed")
+
+
+#define LTI_STS_Writers_TIFFFieldInfoNotSet                       50410
+LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFFieldInfoNotSet, "TIFF: field info not set")
+
+#define LTI_STS_Writers_TIFFLibraryError                          50411
+LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFLibraryError, "TIFF: library error - %s")
+
+#define LTI_STS_Writers_TIFFLibraryWarning                        50412
+LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFLibraryWarning, "TIFF: library warning - %s")
+
+#define LTI_STS_Writers_TIFFUnsupOutputFormat                     50413
+LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFUnsupOutputFormat, "TIFF: unsupported output format")
+
+#define LTI_STS_Writers_TIFFWriteDataFailed                       50414
+LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFWriteDataFailed, "TIFF: write data failed")
+
+#define LTI_STS_Writers_TIFFUnsupClutType                         50415
+LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFUnsupClutType, "TIFF: unsupported CLUT type")
+
+#define LTI_STS_Writers_TIFFMetadataError                         50416
+LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFMetadataError, "TIFF: metadata error")
+
+#define LTI_STS_Writers_TIFFToLarge                         50417
+LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFToLarge, "TIFF: Resulting tiff file is too large: > 4GB")
+
+
+#define LTI_STS_Writers_GDALErrorMessage                          50420
+LT_STATUSSTRING_ADD(LTI_STS_Writers_GDALErrorMessage, "GDAL error: %s - %d")
+
+
+#define LTI_STS_Writers_GeoTIFFBadKeyDims                         50430
+LT_STATUSSTRING_ADD(LTI_STS_Writers_GeoTIFFBadKeyDims, "GeoTIFF: bad metadata key format")
+
+#define LTI_STS_Writers_GeoTIFFUnableToSetKey                     504131
+LT_STATUSSTRING_ADD(LTI_STS_Writers_GeoTIFFUnableToSetKey, "GeoTIFF: unable to set key")
+
+#define LTI_STS_Writers_GeoTIFFOpenFileError                      50432
+LT_STATUSSTRING_ADD(LTI_STS_Writers_GeoTIFFUnableToSetKey, "GeoTIFF: error opening file")
+
+
+#define LTI_STS_Writers_BBBCannotWriteFile                        50440
+LT_STATUSSTRING_ADD(LTI_STS_Writers_BBBCannotWriteFile, "BBB: cannot write to file")
+
+
+#define LTI_STS_Writers_BMPCannotWriteFile                        50450
+LT_STATUSSTRING_ADD(LTI_STS_Writers_BMPCannotWriteFile, "BMP: cannot write to file")
+
+
+#define LTI_STS_Writers_JPEGErrorMessage                          50460
+LT_STATUSSTRING_ADD(LTI_STS_Writers_JPEGErrorMessage, "JPEG error: %s")
+
+#define LTI_STS_Writers_JPEGOpenFileError                         50461
+LT_STATUSSTRING_ADD(LTI_STS_Writers_JPEGOpenFileError, "JPEG: error opening file")
+
+
+#define LTI_STS_Writers_GIFCannotWriteFile                        50462
+LT_STATUSSTRING_ADD(LTI_STS_Writers_GIFCannotWriteFile, "GIF: cannot write to file")
+
+#define LTI_STS_Writers_GIFImageFormattingError                   50463
+LT_STATUSSTRING_ADD(LTI_STS_Writers_GIFImageFormattingError, "GIF: error while composing file")
+
+#define LTI_STS_Writers_PNGOutOfMemory                            50464
+LT_STATUSSTRING_ADD(LTI_STS_Writers_PNGOutOfMemory, "PNG: out of memory")
+
+#define LTI_STS_Writers_PNGLibraryError                           50465
+LT_STATUSSTRING_ADD(LTI_STS_Writers_PNGLibraryError, "PNG: libpng error '%s'")
+
+#define LTI_STS_Writers_Max                                       50499
+LT_STATUSSTRING_ADD(LTI_STS_Writers_Max, "lt_lib_mrsid_imageWriters max")
+
+
+#endif // LTI_WRITERSSTATUS_H
diff --git a/src/appUtils/TeAppTheme.cpp b/src/appUtils/TeAppTheme.cpp
new file mode 100644
index 0000000..2a9f03f
--- /dev/null
+++ b/src/appUtils/TeAppTheme.cpp
@@ -0,0 +1,519 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeAppTheme.h"
+#include "TeExternalTheme.h"
+#include "TeUtils.h"
+#include "TeDatabase.h"
+#include "TeApplicationUtils.h"
+#include "TeDatabaseUtils.h"
+
+
+TeAppTheme::TeAppTheme(TeAbstractTheme* theme) :
+		theme_(theme),
+		outOfCollectionVisibility_(false),
+		withoutDataConnectionVisibility_(false),
+		refineAttributeWhere_(""),
+		refineSpatialWhere_(""), 
+		refineTemporalWhere_(""),
+		groupColorDir_(TeColorAscSatEnd),
+		groupObjects_(TeAll),
+		pieDiameter_ (0.0),
+		pieMinDiameter_(0.0),
+		pieMaxDiameter_(0.0),
+		barMinHeight_(0.0),
+		barMaxHeight_(0.0),
+		barWidth_(0.0),
+		chartMaxVal_(-1),
+		chartMinVal_(-1),
+		chartType_(TeBarChart),
+		chartObjects_(TeAll),
+		chartFunction_("AVG"),
+		keepDimension_(0),
+		showCanvasLegend_(false),
+		canvasLegWidth_(0.0),
+		canvasLegHeight_(0.0), 
+		editRep_ (TeGeomRep(0)),
+		mix_color_(false),
+		count_obj_(false), 
+		textTable_("")
+{
+}
+
+TeAppTheme::~TeAppTheme()
+{	
+}
+
+
+TeAppTheme::TeAppTheme(const TeAppTheme& other)
+{
+	theme_ = (TeAbstractTheme*)TeViewNodeFactory::make(other.theme_->getProductId());
+	if(theme_->getProductId()==TeTHEME)
+        *(TeTheme*)theme_ = *(TeTheme*)other.theme_;
+	else if(theme_->getProductId()==TeEXTERNALTHEME)
+		*(TeExternalTheme*)theme_ = *(TeExternalTheme*)other.theme_;
+	else
+		*theme_ =  *other.theme_;
+
+	chartSelected_ = other.chartSelected_;
+	chartPoint_ = other.chartPoint_;
+	tePoint_ = other.tePoint_;
+	outOfCollectionVisibility_ = other.outOfCollectionVisibility_;
+	withoutDataConnectionVisibility_ = other.withoutDataConnectionVisibility_;
+	refineAttributeWhere_ = other.refineAttributeWhere_;
+	refineSpatialWhere_ = other.refineSpatialWhere_; 
+	refineTemporalWhere_ = other.refineTemporalWhere_;
+	groupColor_ = other.groupColor_;
+	groupColorDir_ = other.groupColorDir_;
+	groupObjects_ = other.groupObjects_;
+	pieDiameter_ = other.pieDiameter_;
+	pieAttr_ = other.pieAttr_;
+	pieMinDiameter_ = other.pieMinDiameter_;
+	pieMaxDiameter_ = other.pieMaxDiameter_;
+	barMinHeight_ = other.barMinHeight_;
+	barMaxHeight_ = other.barMaxHeight_;
+	barWidth_ = other.barWidth_;
+	chartMaxVal_ = other.chartMaxVal_;
+	chartMinVal_ = other.chartMinVal_;
+	chartType_ = other.chartType_;
+	chartObjects_ = other.chartObjects_;
+	chartFunction_ = other.chartFunction_;
+	keepDimension_ = other.keepDimension_;
+	showCanvasLegend_ = other.showCanvasLegend_;
+	canvasLegWidth_ = other.canvasLegWidth_;
+	canvasLegHeight_ = other.canvasLegHeight_; 
+	editRep_ = other.editRep_;
+	mix_color_ = other.mix_color_;
+	count_obj_ = other.count_obj_; 
+	textTable_ = other.textTable_;
+}
+
+ TeAppTheme& TeAppTheme::operator =(const TeAppTheme& other)
+{
+	if (this != &other)
+	{
+		theme_ = (TeAbstractTheme*)TeViewNodeFactory::make(other.theme_->getProductId());
+		if(theme_->getProductId()==TeTHEME)
+            *(TeTheme*)theme_ = *(TeTheme*)other.theme_;
+		else if(theme_->getProductId()==TeEXTERNALTHEME)
+			*(TeExternalTheme*)theme_ = *(TeExternalTheme*)other.theme_;
+		else
+			*theme_ =  *other.theme_;
+		
+		chartSelected_ = other.chartSelected_;
+		chartPoint_ = other.chartPoint_;
+		tePoint_ = other.tePoint_;
+		outOfCollectionVisibility_ = other.outOfCollectionVisibility_;
+		withoutDataConnectionVisibility_ = other.withoutDataConnectionVisibility_;
+		refineAttributeWhere_ = other.refineAttributeWhere_;
+		refineSpatialWhere_ = other.refineSpatialWhere_; 
+		refineTemporalWhere_ = other.refineTemporalWhere_;
+		groupColor_ = other.groupColor_;
+		groupColorDir_ = other.groupColorDir_;
+		groupObjects_ = other.groupObjects_;
+		pieDiameter_ = other.pieDiameter_;
+		pieAttr_ = other.pieAttr_;
+		pieMinDiameter_ = other.pieMinDiameter_;
+		pieMaxDiameter_ = other.pieMaxDiameter_;
+		barMinHeight_ = other.barMinHeight_;
+		barMaxHeight_ = other.barMaxHeight_;
+		barWidth_ = other.barWidth_;
+		chartMaxVal_ = other.chartMaxVal_;
+		chartMinVal_ = other.chartMinVal_;
+		chartType_ = other.chartType_;
+		chartObjects_ = other.chartObjects_;
+		chartFunction_ = other.chartFunction_;
+		keepDimension_ = other.keepDimension_;
+		showCanvasLegend_ = other.showCanvasLegend_;
+		canvasLegWidth_ = other.canvasLegWidth_;
+		canvasLegHeight_ = other.canvasLegHeight_; 
+		editRep_ = other.editRep_;
+		mix_color_ = other.mix_color_;
+		count_obj_ = other.count_obj_; 
+		textTable_ = other.textTable_;
+	}
+
+	return *this;
+}
+
+
+unsigned int TeAppTheme::getTableIndexFromField(string fieldName)
+{
+	unsigned int i, n, index;
+	index = 0;
+
+	TeTheme* theme = (TeTheme*)theme_;
+	vector<TeTable>& tableVec = theme->attrTables();
+	TeAttributeList attrList = theme->sqlAttList();
+
+	n = tableVec[0].attributeList().size();
+	for (i = 0; i < attrList.size(); ++i)
+	{
+		if (i > n - 1)
+		{
+			++index;
+			n += tableVec[index].attributeList().size();
+		}
+
+		if (attrList[i].rep_.name_ == fieldName)
+			break;
+	}
+	return index;
+}
+
+
+
+bool TeAppTheme::locateText (TeCoord2D &pt, TeText &text, const double& tol)
+{
+	TeTheme* theme = (TeTheme*)theme_;
+	TeDatabasePortal* portal = theme->layer()->database()->getPortal();
+	string table = textTable();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	string q = "SELECT " + table + ".* FROM " + table + ", " + theme->collectionTable();
+	char buf [1024];
+	sprintf (buf," WHERE c_object_id = object_id AND (x < %f AND x > %f AND y < %f AND y > %f)",
+		box.x2(),box.x1(),box.y2(),box.y1());
+	q += buf;
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	// Look for all texts
+	bool flag = true;
+	TeTextSet ts;
+	do
+	{
+		TeText p;
+		flag = portal->fetchGeometry(p);
+		ts.add ( p );
+	} while (flag);
+
+	delete portal;
+
+	int k;
+	if (TeNearest (pt, ts, k, tol))
+	{
+		text = ts[k];
+		return true;
+	}
+	return false;
+}
+
+TeVisual TeAppTheme::getTextVisual(const TeText &text)
+{
+	int	dot_height, rgb;
+	string family;
+	string table = textTable() + "_txvisual";
+	bool fix_size = false, bold = false, italic = false;
+
+	TeTheme* theme = (TeTheme*)theme_;
+	TeDatabase* db = theme->layer()->database();
+
+	string sel = "SELECT dot_height, fix_size, color, family, bold, italic FROM ";
+	sel += table + " WHERE geom_id = " + Te2String(text.geomId());
+
+	TeDatabasePortal* portal = db->getPortal();
+	if(portal->query(sel))
+	{
+		if(portal->fetchRow())
+		{
+			dot_height = atoi(portal->getData(0));
+			if(atoi(portal->getData(1)))
+				fix_size = true;
+			rgb = atoi(portal->getData(2));
+			family = portal->getData(3);
+			if(atoi(portal->getData(4)))
+				bold = true;
+			if(atoi(portal->getData(5)))
+				italic = true;
+		}
+	}
+	delete portal;
+	TeColor	cor((rgb >> 16) & 0xff, (rgb >> 8) & 0xff, rgb & 0xff);
+	TeVisual visual;
+	visual.size(dot_height);
+	visual.fixedSize(fix_size);
+	visual.color(cor);
+	visual.family(family);
+	visual.bold(bold);
+	visual.italic(italic);
+
+	return visual;
+}
+
+
+string TeAppTheme::getLegendTitleAlias()
+{
+	string text;
+
+	TeTheme* theme = (TeTheme*)theme_;
+
+	TeLegendEntryVector& legendVector = theme->legend();
+	if (legendVector.size() > 0)
+	{
+		TeDatabase* database = theme->layer()->database();
+		TeAttributeRep rep; 
+		string nattr;
+		if(theme->grouping().groupMode_ != TeNoGrouping)
+		{
+			rep = theme->grouping().groupAttribute_; 
+			nattr = theme->grouping().groupNormAttribute_;
+		}
+		text = rep.name_;
+		map<int, map<string, string> >::iterator it = database->mapThemeAlias().find(theme->id());
+		if(it != database->mapThemeAlias().end())
+		{
+			map<string, string>& m = it->second;
+			map<string, string>::iterator tit = m.find(text);
+			if(tit != m.end())
+				text = tit->second;
+			if(!(nattr.empty() || nattr == "NONE"))
+			{
+				tit = m.find(nattr);
+        		if(tit != m.end()) {
+        		  if (!tit->second.empty()) {
+					text += "/" + tit->second;
+          		  }
+        		}
+        		else  //Deixando ficar sem barra 
+					text += "/" + nattr;
+			}
+		}
+	}
+	return text;
+}
+
+string TeAppTheme::	getPieBarAlias(string atr)
+{
+	string text;
+
+	TeTheme* theme = (TeTheme*)theme_;
+
+	if (chartAttributes_.size() > 0)
+	{
+		TeDatabase* database = theme->layer()->database();
+		map<int, map<string, string> >::iterator it = database->mapThemeAlias().find(theme->id());
+		if(it != database->mapThemeAlias().end())
+		{
+			map<string, string>& m = it->second;
+			map<string, string>::iterator tit = m.find(atr);
+			if(tit != m.end())
+				text = tit->second;
+		}
+	}
+	return text;
+}
+
+bool TeAppTheme::setAlias(string attr, string attAlias)
+{
+	TeTheme* theme = (TeTheme*)theme_;
+	TeDatabase* db = theme->layer()->database();
+	map<int, map<string, string> >& mapThemeAlias = db->mapThemeAlias();
+	map<string, string>& mapAA = mapThemeAlias[theme->id()];
+	map<string, string>::iterator it = mapAA.begin();
+
+	while(it != mapAA.end())
+	{
+		if(it->first != attr && it->second == attAlias)
+			return false;
+		it++;
+	}
+
+	int f = attr.find("/");
+	int af = attAlias.find("/");
+	if(f >= 0 && af >= 0)
+	{
+		string nattr = attr;
+		attr = attr.substr(0, f);
+		nattr = nattr.substr(f+1);
+
+		string alias = attAlias;
+		string nalias = alias;
+		alias = alias.substr(0, af);
+		nalias = nalias.substr(af+1);
+
+		mapAA[attr] = alias;
+		mapAA[nattr] = nalias;
+		updateAppTheme (db, this);
+		return true;
+	}
+	else
+	{
+    	//Alterando para deixar ficar sem /
+    	if(f >= 0) {
+      		string nattr = attr;
+      		nattr = nattr.substr(f+1);
+      		mapAA[nattr] = "";
+			attr = attr.substr(0, f);
+    	}
+		mapAA[attr] = attAlias;
+		updateAppTheme (db, this);
+		return true;
+	}
+}
+
+void TeAppTheme::removeAlias(string attribute)
+{
+	string attr = attribute;
+	string nattr = attr;
+	TeTheme* theme = (TeTheme*)theme_;
+	TeDatabase* db = theme->layer()->database();
+	map<int, map<string, string> >& mapThemeAlias = db->mapThemeAlias();
+	map<string, string>& mapAA = mapThemeAlias[theme->id()];
+
+	int f = attr.find("/");
+	if(f >= 0)
+	{
+		attr = attr.substr(0, f);
+		nattr = nattr.substr(f+1);
+	}
+	map<string, string>::iterator it = mapAA.find(attr);
+	if(it != mapAA.end())
+	{
+		mapAA.erase(it);
+		if(mapAA.size() == 0)
+		{
+			map<int, map<string, string> >::iterator tit = mapThemeAlias.find(theme->id());
+			if(tit != mapThemeAlias.end())
+				mapThemeAlias.erase(tit);
+		}
+	}
+	if(nattr != attr)
+	{
+		map<string, string>::iterator it = mapAA.find(nattr);
+		if(it != mapAA.end())
+		{
+			mapAA.erase(it);
+			if(mapAA.size() == 0)
+			{
+				map<int, map<string, string> >::iterator tit = mapThemeAlias.find(theme->id());
+				if(tit != mapThemeAlias.end())
+					mapThemeAlias.erase(tit);
+			}
+		}
+	}
+
+	updateAppTheme (db, this);
+}
+
+void TeAppTheme::removeAllAlias()
+{
+	TeTheme* theme = (TeTheme*)theme_;
+	TeDatabase* db = theme->layer()->database();
+	map<int, map<string, string> >& mapThemeAlias = db->mapThemeAlias();
+	map<int, map<string, string> >::iterator it = mapThemeAlias.find(theme->id());
+	if(it != mapThemeAlias.end())
+		mapThemeAlias.erase(it);
+	updateAppTheme (db, this);
+}
+
+void TeAppTheme::concatTableName(string& attr)
+{
+	string tableName;
+
+	if(attr.find(".") == attr.npos)
+	{
+		TeTheme* theme = (TeTheme*)theme_;
+		vector<TeTable>& tableVec = theme->attrTables();
+		TeAttrTableVector::iterator it = tableVec.begin();
+
+		while(it != tableVec.end())
+		{
+			TeTable	t = *it;
+			TeAttributeList AL = t.attributeList();
+			TeAttributeList::iterator iit = AL.begin();
+
+			while(iit != AL.end())
+			{
+				if((*iit).rep_.name_ == attr)
+				{
+					tableName = (*it).name();
+					break;
+				}
+				iit++;
+			}
+
+			if(tableName.empty() == false)
+			{
+				tableName += ".";
+				attr.insert(0, tableName);
+				break;
+			}
+			it++;
+		}
+	}
+}
+
+int TeAppTheme::numObjects() 
+{
+  return theme_->getNumberOfObjects();
+}
+
+TeBox& TeAppTheme::boundingBox()
+{
+   return theme_->getThemeBox();
+}
+
+TeTheme*  
+TeAppTheme::getSourceTheme()
+{
+	TeTheme* t = 0;
+	if(!theme_)
+		return t;
+	if(theme_->getProductId() == TeEXTERNALTHEME)
+		t = static_cast<TeExternalTheme*>(theme_)->getRemoteTheme();
+	else if(theme_->getProductId() == TeTHEME)
+		t = (TeTheme*) theme_;
+	return t;
+}
+
+TeDatabase*		
+TeAppTheme::getLocalDatabase()
+{
+	TeDatabase* db = 0;
+	if(!theme_)
+		return db;
+	if(theme_->getProductId() == TeEXTERNALTHEME)
+		db = static_cast<TeExternalTheme*>(theme_)->getSourceDatabase();
+	else if(theme_->getProductId() == TeTHEME)
+		db = static_cast<TeTheme*>(theme_)->layer()->database();
+	return db;
+}
+	
+
+string			
+TeAppTheme::getLocalCollectionTable()
+{
+	string colTable = "";
+	if(!theme_)
+		return colTable;
+	if(theme_->getProductId() == TeEXTERNALTHEME || theme_->getProductId() == TeTHEME)
+		colTable = static_cast<TeTheme*>(theme_)->collectionTable();
+	return colTable;
+}
+
+
+
+
diff --git a/src/appUtils/TeAppTheme.h b/src/appUtils/TeAppTheme.h
new file mode 100644
index 0000000..d45e1d6
--- /dev/null
+++ b/src/appUtils/TeAppTheme.h
@@ -0,0 +1,325 @@
+/************************************************************************************
+ TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAppTheme.h
+    \brief This file contains an extension to the definition of a Theme in TerraLib
+*/
+#ifndef  __TERRALIB_INTERNAL_THEMEAPLICATION_H
+#define  __TERRALIB_INTERNAL_THEMEAPLICATION_H
+
+#include "TeAbstractTheme.h"
+#include <set>
+
+#include "TeAppUtilsDefines.h"
+
+class TeLayer;
+
+
+//! A map from representation to geometries
+/*
+\internal
+*/
+struct TLAPPUTILS_DLL RepMap {
+	map<int, TePolygon> polygonMap_;
+	map<int, TeLine2D> lineMap_;
+};
+
+//! An extension to the definition of a Theme in TerraLib
+/*
+This class extends the definition of a Theme in TerraLib adding some application
+funcionalities such as the insertion of graph charts (pie and bar). This extension
+materalizes the needs of TerraView like applications.
+*/
+class TLAPPUTILS_DLL TeAppTheme
+{
+public:
+
+	//! Constructors
+	TeAppTheme(TeAbstractTheme* theme = 0);
+
+	//! Destructor
+	~TeAppTheme();
+
+	// Copy constructor
+	TeAppTheme(const TeAppTheme& other);
+
+	// Assignment operator
+	TeAppTheme& operator =(const TeAppTheme& other);
+
+	//! Returns the theme which this theme application is related
+	TeAbstractTheme* getTheme() 
+	{ return theme_;}
+	
+	//! Returns TRUE if objects of the layer that don�t belong to the theme are visible
+	bool outOfCollectionVisibility() 
+	{ return outOfCollectionVisibility_;}
+	//! Set whether objects of the layer that don�t belong to the theme are visible
+	void outOfCollectionVisibility(bool v) 
+	{ outOfCollectionVisibility_ = v;}
+
+	//! Returns TRUE if objects whithout descriptive attributes are visible
+	bool withoutDataConnectionVisibility() 
+	{ return withoutDataConnectionVisibility_;}
+	//! Set whether objects whithout descriptive attributes are visible
+	void withoutDataConnectionVisibility(bool v) 
+	{ withoutDataConnectionVisibility_ = v;}
+
+	//! Returns a attribute restriction (where clause) used to refine the selection defined by the theme
+	string refineAttributeWhere() { return refineAttributeWhere_; }
+	//! Set a attribute restriction (where clause) to refine the selection defined by the theme
+	void refineAttributeWhere(const string& s) { refineAttributeWhere_ = s; }
+
+	//! Returns a spatial restriction (where clause) used to refine the selection defined by the theme
+	string refineSpatialWhere() { return refineSpatialWhere_; }
+	//! Set a spatial restriction (where clause) used to refine the selection defined by the theme
+	void refineSpatialWhere(const string& s) { refineSpatialWhere_ = s; }
+
+	//! Returns a temporal restriction (where clause) used to refine the selection defined by the theme
+	string refineTemporalWhere() { return refineTemporalWhere_; }
+	//! Set a temporal restriction (where clause) used to refine the selection defined by the theme
+	void refineTemporalWhere(const string& t) { refineTemporalWhere_ = t; }
+
+	//! Returns the grouping colors
+	string groupColor () { return groupColor_ ; }
+	//! Set the grouping colors
+	void groupColor (const string& c) { groupColor_ = c; }
+	
+	//! Returns the grouping colors direction
+	TeColorDirection groupColorDir() { return groupColorDir_; }
+	//! Set the grouping colors direction
+	void groupColorDir(TeColorDirection n){ groupColorDir_ = n; }
+
+	//! Returns a code identifying which objects should be grouped
+	TeSelectedObjects groupObjects() { return groupObjects_; }
+	//! Set a code identifying which objects should be  grouped
+	void groupObjects(TeSelectedObjects n) { groupObjects_ = n; }
+
+	//! Returns the diameter in pixels of the pie charts
+	double pieDiameter() { return pieDiameter_; };
+	//! Set the diameter in pixels of the pie charts
+	void pieDiameter(double n) { pieDiameter_ = n; };
+
+	//! Returns the name of the attribute which gives the dimension of the diameter in pixels of the pie charts
+	string pieDimAttribute() { return pieAttr_; }
+	//! Set the name of the attribute which gives the dimension of the diameter in pixels of the pie charts
+	void pieDimAttribute(const string& s) { pieAttr_ = s; }
+
+	//! Returns the minimum diameter in pixels of the pie charts
+	double pieMinDiameter() { return pieMinDiameter_; };
+	//! Set the minimum diameter in pixels of pie charts
+	void pieMinDiameter(double n) { pieMinDiameter_ = n; };
+
+	//! Returns the maximum diameter in pixels of the pie charts
+	double pieMaxDiameter() { return pieMaxDiameter_; };
+	//! Set the maximum diameter in pixels of pie charts
+	void pieMaxDiameter(double n) { pieMaxDiameter_ = n; };
+
+	//! Returns the minimum height in pixels of the bar charts
+	double barMinHeight() { return barMinHeight_; };
+	//! Set the minimum height in pixels of the bar charts
+	void barMinHeight(double n) { barMinHeight_ = n; };
+
+	//! Returns the maximum height in pixels of the bar charts
+	double barMaxHeight() { return barMaxHeight_; };
+	//! Set the maximum height in pixels of the bar charts
+	void barMaxHeight(double n) { barMaxHeight_ = n; };
+
+	//! Returns the bar width in pixels of the bar charts
+	double barWidth() { return barWidth_; };
+	//! Set the bar width in pixels of the bar charts
+	void barWidth(double n) { barWidth_ = n; };
+
+	//! Returns the type of the chart 
+	TeChartType	chartType() {return chartType_;}
+	//! Set the type of the chart 
+	void chartType(TeChartType n) { chartType_ = n; }
+
+	//! Get the chart aggregate function
+	string chartFunction() { return chartFunction_; }
+
+	//! Set the chart aggregate function
+	void chartFunction(string s) { chartFunction_ = s; }
+
+	//! Returns the objects where the charts should be plotted 
+	TeSelectedObjects chartObjects() { return chartObjects_; };
+	//! Set the objects where the charts should be plotted 
+	void chartObjects(TeSelectedObjects n) { chartObjects_ = n; };
+
+	//! Returns the maximum value used to plot charts
+	double chartMaxVal() { return chartMaxVal_; }
+	//! Set the maximum value used to plot charts
+	void chartMaxVal(double n) { chartMaxVal_ = n; }
+
+	//! Returns the minimum value used to plot charts
+	double chartMinVal() { return chartMinVal_; }
+	//! Set the minimum value used to plot charts
+	void chartMinVal(double n) { chartMinVal_ = n; }
+
+	//! Returns TRUE if charts keep its dimension in zooming operations 
+	int	keepDimension() { return keepDimension_; };
+	//! Set if charts keep its dimension in zooming operations 
+	void keepDimension(int n) { keepDimension_ = n; };
+
+	//! Returns TRUE if the legends of the grouping should be plot in the canvas
+	bool showCanvasLegend()
+	{	return showCanvasLegend_; }
+	//! Set whether the legends of the grouping should be plot in the canvas
+	void showCanvasLegend(bool cl)
+	{	showCanvasLegend_ = cl; }
+
+	//! Returns the upper left position of the canvas legend
+	TeCoord2D canvasLegUpperLeft()
+	{	return canvasLegUpperLeft_; }
+	//! Set the upper left position of the canvas legend
+	void canvasLegUpperLeft(TeCoord2D c)
+	{	canvasLegUpperLeft_ = c; }
+	//! Returns the canvas legend width
+	double canvasLegWidth()
+	{	return canvasLegWidth_; }
+	//! Set the canvas legend width
+	void canvasLegWidth(double w)
+	{	canvasLegWidth_ = w; }
+	//! Returns the canvas legend height
+	double canvasLegHeight()
+	{	return canvasLegHeight_; }
+	//! Set the canvas legend height
+	void canvasLegHeight(double h)
+	{	canvasLegHeight_ = h; }
+	
+	//! Returns the geometrical representation being edited
+	TeGeomRep editRep() {return editRep_;}
+	//! Set the geometrical representation being edited
+	void editRep(TeGeomRep r) {editRep_ = r;}
+
+	//! Get the table index from the list of the theme tables, through a given field
+	unsigned int getTableIndexFromField(string fieldName);
+
+	bool mixColor()
+	{	return mix_color_; }
+
+	void mixColor(bool mixcolor)
+	{	mix_color_ = mixcolor;	}
+
+	bool countObj()
+	{	return count_obj_; }
+
+	void countObj(bool countobj)
+	{	count_obj_ = countobj;	}
+
+	//! Returns the name of a text table that is visible by this theme (used to label objects)
+	string textTable() { return textTable_; }
+
+	//! Set the name of a text table that is visible by this theme (used to label objects)
+	void textTable(const string& t) { textTable_ = t; }
+
+	bool locateText	(TeCoord2D &pt, TeText &text, const double& tol = 0.0);
+
+	TeVisual getTextVisual(const TeText &text);
+
+	bool setAlias(string att, string attAlias);
+
+	string getLegendTitleAlias();
+
+	string getPieBarAlias(string atr);
+
+	void removeAlias(string att);
+
+	void removeAllAlias();
+
+	void concatTableName(string &attr);
+
+	//! Returns the number of objects in a theme
+	int  numObjects();
+  
+	//! Returns the bounding box of the theme
+	TeBox& boundingBox();  
+
+//	TeBox getPieBarBox(TeQtCanvas* canvas);
+
+	//! Vector of colors used to plot the charts
+	vector<TeColor> chartColors_;	
+	//! Vector of attributes used to plot the charts
+	vector<string>	chartAttributes_;
+
+	string		chartSelected_;
+	TeCoord2D	chartPoint_;
+	TePoint		tePoint_;
+
+	//! Get the source theme
+	TeTheme*		getSourceTheme();
+
+	//! Get local database where metadata is stored
+	TeDatabase*		getLocalDatabase();
+
+	//! Get the collection table atored in the local database
+	string			getLocalCollectionTable();
+	
+
+private:
+
+	TeAbstractTheme* theme_;
+	
+	bool			outOfCollectionVisibility_; 
+	bool			withoutDataConnectionVisibility_; 
+
+	// Refining 
+	string			refineAttributeWhere_;
+	string			refineSpatialWhere_;
+	string			refineTemporalWhere_;
+
+	string				groupColor_;
+	TeColorDirection	groupColorDir_;
+	TeSelectedObjects	groupObjects_;
+		
+	double			pieDiameter_;
+	string			pieAttr_;
+	double			pieMinDiameter_;
+	double			pieMaxDiameter_;
+
+	double			barMinHeight_;
+	double			barMaxHeight_;
+	double			barWidth_;
+
+	double			  chartMaxVal_;
+	double			  chartMinVal_;
+	TeChartType		  chartType_;
+	TeSelectedObjects chartObjects_;
+	string			  chartFunction_;
+	
+	int				keepDimension_;
+	
+	bool			showCanvasLegend_;		//to show or not the legend in the canvas
+	TeCoord2D		canvasLegUpperLeft_;	//legend�s upper left point  
+	double			canvasLegWidth_;		//legend width
+	double			canvasLegHeight_;		//legend height
+
+	TeGeomRep		editRep_;
+
+	bool			mix_color_;
+	bool			count_obj_;
+
+	string			textTable_;
+};
+
+
+#endif
+
diff --git a/src/appUtils/TeAppUtilsDefines.h b/src/appUtils/TeAppUtilsDefines.h
new file mode 100644
index 0000000..9ef57e9
--- /dev/null
+++ b/src/appUtils/TeAppUtilsDefines.h
@@ -0,0 +1,49 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAppUtilsDefines.h
+    \brief Provides a set of general definitions used by te_apputils project.
+*/
+#ifndef  __TERRALIB_INTERNAL_APPUTILSDEFINES_H
+#define  __TERRALIB_INTERNAL_APPUTILSDEFINES_H
+
+/** @defgroup TLAPPUTILS_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLAPPUTILS_AS_DLL
+#define TLAPPUTILS_DLL __declspec(dllexport)
+#else
+#define TLAPPUTILS_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TLAPPUTILS_DLL
+#endif
+/** @} */
+
+#endif //__TERRALIB_INTERNAL_APPUTILSDEFINES_H
diff --git a/src/appUtils/TeApplicationUtils.cpp b/src/appUtils/TeApplicationUtils.cpp
new file mode 100644
index 0000000..2d36eac
--- /dev/null
+++ b/src/appUtils/TeApplicationUtils.cpp
@@ -0,0 +1,3383 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include "TeApplicationUtils.h"
+#include "TeSlice.h"
+#include "TeDatabase.h"
+#include "TeDatabaseUtils.h"
+#include "TeColorUtils.h"
+#include "TeKernelParams.h"
+#include "TeExternalTheme.h"
+
+#ifdef WIN32
+#include <windows.h>
+#include <direct.h>
+#include <io.h>
+#endif
+
+#include <errno.h>
+
+extern void TeGroupByUniqueValue(vector<string>& vec, TeAttrDataType tipo, vector<TeSlice>& result, int precision);
+
+
+bool createAppThemeTable(TeDatabase* db, bool integrity, const string& tableName)
+{
+	if (!db)
+		return false;
+		
+	TeAttributeList attList;
+
+	TeAttribute at1;
+	at1.rep_.type_ = TeINT;
+	at1.rep_.name_ = "theme_id";
+	at1.rep_.isPrimaryKey_ = true;
+	attList.push_back(at1);
+	
+	TeAttribute at2;
+	at2.rep_.type_ = TeINT;
+	at2.rep_.name_ = "visible_out_coll";
+	attList.push_back(at2);	
+	
+	TeAttribute at3;
+	at3.rep_.type_ = TeINT;
+	at3.rep_.name_ = "visible_without_conn";
+	attList.push_back(at3);	
+
+	TeAttribute at31;
+	at31.rep_.type_ = TeSTRING;
+	at31.rep_.numChar_ = 255;
+	at31.rep_.name_ = "refine_attribute_where";
+	attList.push_back(at31);	
+
+	TeAttribute at32;
+	at32.rep_.type_ = TeSTRING;
+	at32.rep_.numChar_ = 255;
+	at32.rep_.name_ = "refine_spatial_where";
+	attList.push_back(at32);	
+
+	TeAttribute at33;
+	at33.rep_.type_ = TeSTRING;
+	at33.rep_.numChar_ = 255;
+	at33.rep_.name_ = "refine_temporal_where";
+	attList.push_back(at33);	
+
+	TeAttribute at4;
+	at4.rep_.type_ = TeSTRING;
+	at4.rep_.numChar_ = 255;
+	at4.rep_.name_ = "grouping_color";
+	attList.push_back(at4);	
+
+	TeAttribute at5;
+	at5.rep_.type_ = TeINT;
+	at5.rep_.name_ = "grouping_color_direction";
+	attList.push_back(at5);	
+
+	TeAttribute at6;
+	at6.rep_.type_ = TeINT;
+	at6.rep_.name_ = "grouping_objects";
+	attList.push_back(at6);	
+
+	TeAttribute at7;
+	at7.rep_.type_ = TeREAL;
+	at7.rep_.numChar_ = 20;
+	at7.rep_.decimals_ = 9;
+	at7.rep_.name_ = "pie_diameter";
+	attList.push_back(at7);	
+
+	TeAttribute at8;
+	at8.rep_.type_ = TeREAL;
+	at8.rep_.numChar_ = 20;
+	at8.rep_.decimals_ = 9;
+	at8.rep_.name_ = "pie_max_diameter";
+	attList.push_back(at8);	
+
+	TeAttribute at9;
+	at9.rep_.type_ = TeREAL;
+	at9.rep_.numChar_ = 20;
+	at9.rep_.decimals_ = 9;
+	at9.rep_.name_ = "pie_min_diameter";
+	attList.push_back(at9);	
+
+	TeAttribute at10;
+	at10.rep_.type_ = TeSTRING;
+	at10.rep_.numChar_ = 255;
+	at10.rep_.name_ = "pie_dimension_attr";
+	attList.push_back(at10);	
+
+	TeAttribute at11;
+	at11.rep_.type_ = TeREAL;
+	at11.rep_.numChar_ = 20;
+	at11.rep_.decimals_ = 9;
+	at11.rep_.name_ = "bar_max_height";
+	attList.push_back(at11);	
+
+	TeAttribute at12;
+	at12.rep_.type_ = TeREAL;
+	at12.rep_.numChar_ = 20;
+	at12.rep_.decimals_ = 9;
+	at12.rep_.name_ = "bar_min_height";
+	attList.push_back(at12);	
+
+	TeAttribute at13;
+	at13.rep_.type_ = TeREAL;
+	at13.rep_.numChar_ = 20;
+	at13.rep_.decimals_ = 9;
+	at13.rep_.name_ = "bar_width";
+	attList.push_back(at13);	
+
+	TeAttribute at14;
+	at14.rep_.type_ = TeREAL;
+	at14.rep_.numChar_ = 20;
+	at14.rep_.decimals_ = 9;
+	at14.rep_.name_ = "chart_max_value";
+	attList.push_back(at14);	
+
+	TeAttribute at15;
+	at15.rep_.type_ = TeREAL;
+	at15.rep_.numChar_ = 20;
+	at15.rep_.decimals_ = 9;
+	at15.rep_.name_ = "chart_min_value";
+	attList.push_back(at15);	
+
+	TeAttribute at16;
+	at16.rep_.type_ = TeINT;
+	at16.rep_.name_ = "chart_type";
+	attList.push_back(at16);	
+
+	TeAttribute at17;
+	at17.rep_.type_ = TeINT;
+	at17.rep_.name_ = "chart_objects";
+	attList.push_back(at17);
+	 
+	TeAttribute at18;
+	at18.rep_.type_ = TeINT;
+	at18.rep_.name_ = "keep_dimension";
+	attList.push_back(at18);
+
+	TeAttribute at19;
+	at19.rep_.type_ = TeINT;
+	at19.rep_.name_ = "show_canvas_leg";
+	attList.push_back(at19);
+
+	TeAttribute at20;
+	at20.rep_.type_ = TeREAL;
+	at20.rep_.numChar_ = 20;
+	at20.rep_.decimals_ = 9;
+	at20.rep_.name_ = "canvas_leg_x";
+	attList.push_back(at20);
+
+	TeAttribute at21;
+	at21.rep_.type_ = TeREAL;
+	at21.rep_.numChar_ = 20;
+	at21.rep_.decimals_ = 9;
+	at21.rep_.name_ = "canvas_leg_y";
+	attList.push_back(at21);
+
+	TeAttribute at22;
+	at22.rep_.type_ = TeINT;
+	at22.rep_.name_ = "mix_color";
+	attList.push_back(at22);
+
+	TeAttribute at23;
+	at23.rep_.type_ = TeINT;
+	at23.rep_.name_ = "count_obj";
+	attList.push_back(at23);
+
+	TeAttribute at24;
+	at24.rep_.type_ = TeSTRING;
+	at24.rep_.name_ = "text_table";
+	at24.rep_.numChar_ = 50;
+	attList.push_back(at24);
+	
+	TeAttribute at26;
+	at26.rep_.type_ = TeSTRING;
+	at26.rep_.name_ = "chart_function";
+	at26.rep_.numChar_ = 10;
+	attList.push_back(at26);
+	
+	bool status = db->createTable(tableName,attList);
+	attList.clear();
+	
+	if(status && integrity)
+	{
+		if (!db->createRelation("fk_themeAppl_theme_id", tableName, "theme_id", "te_theme", "theme_id", true))
+			return false;
+	}
+	return status;
+}
+
+
+bool populateAppThemeTable(TeDatabase* db, const string& tableName)
+{
+	string sel, ins; 
+	TeDatabasePortal* portal = db->getPortal();
+	if (!portal)
+		return false;
+	
+	if(db->dbmsName()!="MySQL") //MySQL doesn�t support NOT EXISTS  
+	{
+		ins  = " INSERT INTO " + tableName + " (theme_id) ";
+		ins += " SELECT t.theme_id FROM te_theme t ";
+		ins += " WHERE NOT EXISTS ";
+		ins += " ( SELECT ta.theme_id FROM ";
+		ins += " " + tableName + " ta ";
+		ins += " WHERE ta.theme_id = t.theme_id ) ";
+		if(!db->execute(ins))
+		{
+			delete portal;
+			return false;
+		}
+	}
+	else // this is for MySQL only
+	{
+		sel = " SELECT theme_id  FROM te_theme  ";
+		if(!portal->query(sel)) 
+		{
+			delete portal;
+			return false;
+		}
+		
+		while (portal->fetchRow())
+		{
+			ins  = " INSERT INTO te_theme_application (theme_id) VALUES (";
+			ins += string(portal->getData(0));
+			ins += " )";
+			
+			db->execute(ins);
+		} 
+	}
+
+	////-------- Insert text table
+	//portal->freeResult();
+
+	//sel = " SELECT theme_id, geom_table ";
+	//sel += " FROM te_theme INNER JOIN te_representation ON ";
+	//sel += " te_theme.layer_id = te_representation.layer_id ";
+	//sel += " WHERE te_representation.geom_type = 128 ";
+	//
+	//if(!portal->query(sel)) 
+	//{
+	//	delete portal;
+	//	return false;
+	//}
+	//
+	//while (portal->fetchRow())
+	//{
+	//	ins  = " UPDATE te_theme_application ";
+	//	ins += " SET  text_table = '"+ string(portal->getData(1)) +"'";
+	//	ins += " WHERE theme_id = "+ string(portal->getData(0));
+	//			
+	//	db->execute(ins);
+	//} 
+
+	delete portal;
+	return true;
+}
+
+
+bool deleteAppTheme (TeDatabase* db, TeAbstractTheme* theme, const string& tableName)
+{
+	if (!db || !theme || theme->id() < 1) 
+		return false;
+
+	int themeId = theme->id();
+
+	//delete proximity matrix
+	deleteGPMTable(db, themeId); 
+
+	if (!db->deleteTheme(themeId))
+		return false;
+
+	if(db->tableExist("te_kernel_metadata"))
+	{
+		string sql = "DELETE FROM te_kernel_metadata WHERE event_theme_id_1 = " + Te2String(themeId);
+		sql += " OR event_theme_id_2 = "+ Te2String(themeId);
+		db->execute(sql);
+	}
+
+	if (db->existRelation(tableName, "fk_themeAppl_theme_id") != TeRICascadeDeletion)
+	{
+		// Delete all chart parameters associated to the theme
+		string sql = "DELETE FROM " + tableName + " WHERE theme_id =" + Te2String(themeId);
+		if (!db->execute (sql))
+			return false;
+	}
+
+	if (db->existRelation("te_chart_params", "fk_chartpar_theme_id") != TeRICascadeDeletion)
+	{
+		// Delete all chart parameters associated to the theme
+		string sql = "DELETE FROM te_chart_params WHERE theme_id =" + Te2String(themeId);
+		if (!db->execute (sql))
+			return false;
+	}
+	return true;
+}
+
+
+bool createMediaTable(TeDatabase* db, const string& tname)
+{
+	if (!db)
+		return false;
+	
+	TeAttributeList attList;
+
+	TeAttribute at1;
+	at1.rep_.type_ = TeSTRING;
+	at1.rep_.numChar_ = 255;
+	at1.rep_.name_ = "media_name";
+	at1.rep_.isPrimaryKey_ = true;
+	attList.push_back(at1);	
+
+	TeAttribute at2;
+	at2.rep_.type_ = TeSTRING;
+	at2.rep_.numChar_ = 50;
+	at2.rep_.name_ = "media_type";
+	attList.push_back(at2);	
+
+	TeAttribute at3;
+	at3.rep_.type_ = TeSTRING;
+	at3.rep_.numChar_ = 255;
+	at3.rep_.name_ = "description";
+	attList.push_back(at3);
+	
+	TeAttribute at4;
+	at4.rep_.type_ = TeBLOB;
+	at4.rep_.name_ = "media_blob";
+	attList.push_back(at4);	
+	
+	TeAttribute at5;
+	at5.rep_.type_ = TeSTRING;
+	at5.rep_.numChar_ = 255;
+	at5.rep_.name_ = "media_path";
+	attList.push_back(at5);
+	
+	vector<string> pkeys;
+	pkeys.push_back("media_name");
+	
+	bool status = db->createTable(tname,attList);
+	attList.clear();
+	return status;
+}
+
+
+bool createLayerMediaTable(TeDatabase* db, int layerId, const string& tname)
+{
+	if (!db)
+		return false;
+	
+	TeAttributeList attList;
+
+	TeAttribute at1;
+	at1.rep_.type_ = TeSTRING;
+	at1.rep_.numChar_ = 50;
+	at1.rep_.name_ = "object_id";
+	at1.rep_.isPrimaryKey_ = true;
+	attList.push_back(at1);	
+
+	TeAttribute at3;
+	at3.rep_.type_ = TeSTRING;
+	at3.rep_.numChar_ = 255;
+	at3.rep_.name_ = "media_name";
+	at3.rep_.isPrimaryKey_ = true;
+	attList.push_back(at3);
+	
+	TeAttribute at2;
+	at2.rep_.type_ = TeSTRING;
+	at2.rep_.numChar_ = 50;
+	at2.rep_.name_ = "media_table";
+	at2.rep_.isPrimaryKey_ = true;
+	attList.push_back(at2);	
+
+	TeAttribute at4;
+	at4.rep_.type_ = TeINT;
+	at4.rep_.name_ = "show_default";
+	attList.push_back(at4);	
+	
+	if(!db->createTable(tname,attList))
+	{
+		attList.clear();
+		return false;
+	}
+
+	//insert in te_layer_table
+	TeTable table(tname, attList,"object_id", "object_id", TeAttrMedia);
+	
+	bool status = db->insertTableInfo(layerId, table); 
+	db->layerMap()[layerId]->addAttributeTable (table);
+		
+	attList.clear();
+	return status;
+}
+
+
+bool insertMedia(TeDatabase* db, const string& tableName, string& fileName, const string& description, const string& type, bool blob)
+{
+	string ins;
+	if(blob)
+	{
+		 if(db->dbmsName()!="OracleSpatial")
+		 {
+			ins = "  INSERT INTO "+ tableName +" (media_name, media_type, description) ";
+			ins += " VALUES (";
+			ins += "'"+ fileName + "'";
+			ins += ", '"+ type +"'";
+			ins += ", '"+ description +"'";
+			ins += ")";
+		 }
+		 else
+		 {
+			ins = "  INSERT INTO "+ tableName +" (media_name, media_type, description, media_blob) ";
+			ins += " VALUES (";
+			ins += "'"+ fileName + "'";
+			ins += ", '"+ type +"'";
+			ins += ", '"+ description +"'";
+			ins += ", EMPTY_BLOB()";
+			ins += " )";
+		 }
+	}
+	else
+	{
+		 ins = "  INSERT INTO "+ tableName +" (media_name, media_type, description, media_path) ";
+		 ins += " VALUES (";
+		 ins += "'"+ fileName + "'";
+		 ins += ", '"+ type +"'";
+		 ins += ", '"+ description +"'";
+		 ins += ", '"+ fileName +"'";
+		 ins += ")";
+	}
+
+	if(!db->execute (ins))
+		return false;
+
+	//insert blob
+	TeAttributeRep rep;
+	rep.name_ = "media_name";
+	rep.type_ = TeSTRING;
+
+	if(blob)
+	{
+		if(!db->insertBlob (tableName, "media_blob", rep, fileName, fileName))
+			return false;
+	}
+
+	return true;
+}
+
+bool insertMediaObjLayer (TeDatabase* db, TeLayer* layer, const string& objectId, const string& mediaName, const string& mediaTable)
+{
+	string table = layer->mediaTable();
+	int show = 0;
+
+	string ins = "  INSERT INTO "+ table +" (object_id, media_name, media_table, show_default) ";
+	ins += " VALUES (";
+	ins += "'"+  objectId + "'";
+	ins += ", '"+ mediaName +"'";
+	ins += ", '"+ mediaTable +"'";
+	ins += ", "+ Te2String(show);
+	ins += ")";
+
+	if(!db->execute (ins))
+		return false;
+
+	return true;
+}
+
+
+bool setDefaultMedia(TeDatabase* db, TeLayer* layer, const string& objectId, const string& mediaName, const string& mediaTable)
+{
+	string table = layer->mediaTable();
+	
+	string up = "UPDATE " + table + " SET show_default = 0 WHERE ";
+	up += "object_id = '" + objectId + "'";
+	if(!db->execute(up))
+		return false;
+	
+	up = "UPDATE "+ table +" SET ";
+	up += " show_default = 1 ";
+	up += "	WHERE 	object_id = '"+ objectId +"'";
+	up += " AND		media_name = '"+ mediaName +"'";
+	up += " AND		media_table = '"+ mediaTable +"'";
+
+	if(!db->execute (up))
+		return false;
+
+	return true;
+}
+
+
+bool updateMediaDescription(TeDatabase* db, const string& mediaName, const string& mediaTable, const string& desc)
+{
+	string up = "UPDATE " + mediaTable + " SET description = '" + desc.c_str() + "'";
+	up += " WHERE media_name = '" + mediaName + "'";
+	if(!db->execute(up))
+		return false;
+	return true;
+}
+
+
+bool insertInfo2Blob(TeDatabase* db, int layerId, const string& tableName, const  string& fileName, const  string& type)
+{
+	string ins;
+	string ntype = TeConvertToUpperCase(type);
+	string id = Te2String(layerId);
+	if(db->dbmsName()!="OracleSpatial")
+	{
+		ins = "  INSERT INTO "+ tableName +" (layer_id, name_, type_)";
+		ins += " VALUES (" + id + ", '" + fileName + "', '" + ntype + "')";
+	}
+	else
+	{
+		ins = "  INSERT INTO "+ tableName +" (layer_id, name_, type_, media_blob)";
+		ins += " VALUES (" + id + ", '" + fileName + "', '" + ntype + "', EMPTY_BLOB())";
+	}
+
+	if(!db->execute (ins))
+		return false;
+
+
+	if(ntype == "HTM" || ntype == "HTML" || ntype == "URL")
+		return true;
+
+	//insert blob
+	TeAttributeRep rep;
+	rep.name_ = "layer_id";
+	rep.type_ = TeINT;
+
+	if(!db->insertBlob (tableName, "media_blob", rep, id, fileName))
+		return false;
+
+	return true;
+}
+
+string getInfoBlob2TemporaryFile(TeDatabase* db, int layerId, const string& tableName, string& type)
+{
+// load media data to archive from database
+	size_t	f;
+	string file, swdir;
+	TeDatabasePortal *portal = db->getPortal();
+	string query = "SELECT * FROM " + tableName + " WHERE layer_id = " + Te2String(layerId);
+	if(portal->query(query) && portal->fetchRow())
+	{
+		file = portal->getData(1);
+		type = portal->getData(2);
+		type = TeConvertToUpperCase(type);
+	}
+
+	if(file.empty())
+	{
+//		QMessageBox::warning(this, tr("Warning"),
+//			tr("There is no information to show!\nInsert one first."));
+		delete portal;
+		return "";
+	}
+
+	if(type == "HTM" || type == "HTML" || type == "URL")
+	{
+		delete portal;
+		return file;
+	}
+
+	string tempName = file;
+#ifdef WIN32
+	char wdir[100];
+	GetWindowsDirectory((LPTSTR)wdir, 100);
+	swdir = wdir;
+	f = swdir.find(":\\");
+	if(f != string::npos)
+		swdir = swdir.substr(0, f);
+	swdir.append(":\\TERRAVIEW_TEMP");
+	if( access (swdir.c_str(), 06) == -1 ) // test if directory exists
+	{
+		if( errno == ENOENT )  // directory does not exist so create it
+		{
+			if ( _mkdir(swdir.c_str()) == -1)
+			{
+//				QString msg = tr("The directory ");
+//                msg += swdir.c_str();
+//                msg += tr(" could not be created");
+//				QMessageBox::critical(this, tr("Error"),
+//            		tr("The directory /tmp/TERRAVIEW_TEMP could not be created!"));
+				delete portal;
+				return "";
+			}
+		}
+	}
+	swdir.append("\\");
+#else
+    swdir = "/tmp/TERRAVIEW_TEMP";
+	if( access (swdir.c_str(), F_OK) == -1 ) // test if directory exists
+	{
+		if( errno == ENOENT )  // directory does not exist so create it
+		{
+            char buf[20];
+            sprintf(buf, "mkdir %s", swdir.c_str());
+			if (system(buf) != 0)
+			{
+//            	QMessageBox::critical(this, tr("Error"),
+//            		tr("The directory /tmp/TERRAVIEW_TEMP could not be created!"));
+            	delete portal;
+            	return "";
+			}
+		}
+	}        
+	swdir.append("/");
+#endif
+	f = tempName.rfind("/");
+	if(f == string::npos)
+		f = tempName.rfind("\\");
+
+	if (f != string::npos)
+		tempName = tempName.substr(f+1);
+	tempName.insert(0, swdir);
+
+	unsigned char *data = 0;
+	long size;
+	if((portal->getBlob("media_blob", data, size)) == false)
+	{
+		delete portal;
+		return "";
+	}
+	delete portal;
+
+	FILE *fp = fopen(tempName.c_str(), "wb");
+	if(fp == 0)
+		return "";
+	if(fwrite(data, sizeof(unsigned char), size, fp) < (unsigned long)size)
+		return "";
+	if(data)
+		delete []data;
+	fclose(fp);
+	
+	return tempName;
+}
+
+
+bool createChartParamsTable(TeDatabase* db, bool integrity)
+{
+	if (!db)
+		return false;
+	
+	string table = "te_chart_params";
+	
+	TeAttributeList attList;
+
+	TeAttribute at5;
+	at5.rep_.type_ = TeINT;
+	at5.rep_.name_ = "theme_id";
+	at5.rep_.isPrimaryKey_ = true;
+	attList.push_back(at5);	
+	
+	TeAttribute at1;
+	at1.rep_.type_ = TeSTRING;
+	at1.rep_.numChar_ = 50;
+	at1.rep_.name_ = "attr_name";
+	at1.rep_.isPrimaryKey_ = true;
+	attList.push_back(at1);	
+	
+	TeAttribute at2;
+	at2.rep_.type_ = TeINT;
+	at2.rep_.name_ = "red";
+	attList.push_back(at2);	
+	
+	TeAttribute at3;
+	at3.rep_.type_ = TeINT;
+	at3.rep_.name_ = "blue";
+	attList.push_back(at3);	
+	
+	TeAttribute at4;
+	at4.rep_.type_ = TeINT;
+	at4.rep_.name_ = "green";
+	attList.push_back(at4);	
+	
+	bool status = db->createTable(table,attList);
+	attList.clear();
+
+	if(status && integrity)
+	{
+		if(db->tableExist ("te_theme_application"))
+		{
+			if (!db->createRelation("fk_chartpar_theme_id", "te_chart_params", "theme_id", "te_theme_application", "theme_id", true))
+				return false;
+		}
+		else
+			return false;
+	}
+	return status;
+}
+
+
+bool updateGridColor(TeDatabase* db, int themeId, TeObjectSelectionMode sel, TeColor& color)
+{
+	if (!db || themeId <= 0) 
+		return false;
+
+	string ins = "UPDATE te_legend SET red = " + Te2String(color.red_);
+	ins += ", green = " +  Te2String(color.green_);
+	ins += ", blue = "  + Te2String (color.blue_);
+	ins += " WHERE theme_id = " + Te2String(themeId) + " AND ";
+	if(sel == TeDefaultSelection)
+		ins += "group_id = -3";
+	else if(sel == TePointingSelection)
+		ins += "group_id = -4";
+	else if(sel == TeQuerySelection)
+		ins += "group_id = -5";
+	else
+		ins += "group_id = -6";
+	return db->execute(ins);
+}
+
+bool createKernelMetadataTable(TeDatabase* db)
+{
+	if (!db)
+		return false;
+	
+	TeAttributeList attList;
+
+	TeAttribute at1;
+	at1.rep_.type_ = TeINT;
+	at1.rep_.name_ = "kernel_id";
+	at1.rep_.isPrimaryKey_ = true;
+	at1.rep_.isAutoNumber_ = true;
+	attList.push_back(at1);	
+
+	TeAttribute at2;
+	at2.rep_.type_ = TeINT;
+	at2.rep_.name_ = "event_theme_id_1";
+	attList.push_back(at2);	
+	
+	TeAttribute at3;
+	at3.rep_.type_ = TeSTRING;
+	at3.rep_.numChar_ = 255;
+	at3.rep_.name_ = "intensity_attr_name_1";
+	attList.push_back(at3);
+	
+	TeAttribute at4;
+	at4.rep_.type_ = TeSTRING;
+	at4.rep_.numChar_ = 255;
+	at4.rep_.name_ = "intensity_attr_table_1";
+	attList.push_back(at4);
+
+	TeAttribute at5;
+	at5.rep_.type_ = TeINT;
+	at5.rep_.name_ = "kernel_function_1";
+	attList.push_back(at5);	
+
+	TeAttribute at6;
+	at6.rep_.type_ = TeINT;
+	at6.rep_.name_ = "compute_type_1";
+	attList.push_back(at6);	
+
+	TeAttribute at7;
+	at7.rep_.type_ = TeREAL;
+	at7.rep_.name_ = "radius_value_1";
+	attList.push_back(at7);	
+
+	TeAttribute at8;
+	at8.rep_.type_ = TeINT;
+	at8.rep_.name_ = "combination_type";
+	attList.push_back(at8);	
+
+	TeAttribute at9;
+	at9.rep_.type_ = TeINT;
+	at9.rep_.name_ = "event_theme_id_2";
+	attList.push_back(at9);	
+	
+	TeAttribute at10;
+	at10.rep_.type_ = TeSTRING;
+	at10.rep_.numChar_ = 255;
+	at10.rep_.name_ = "intensity_attr_name_2";
+	attList.push_back(at10);
+	
+	TeAttribute at11;
+	at11.rep_.type_ = TeSTRING;
+	at11.rep_.numChar_ = 255;
+	at11.rep_.name_ = "intensity_attr_table_2";
+	attList.push_back(at11);
+
+	TeAttribute at12;
+	at12.rep_.type_ = TeINT;
+	at12.rep_.name_ = "kernel_function_2";
+	attList.push_back(at12);	
+
+	TeAttribute at13;
+	at13.rep_.type_ = TeINT;
+	at13.rep_.name_ = "compute_type_2";
+	attList.push_back(at13);	
+
+	TeAttribute at14;
+	at14.rep_.type_ = TeREAL;
+	at14.rep_.name_ = "radius_value_2";
+	attList.push_back(at14);
+	
+	TeAttribute at15;
+	at15.rep_.type_ = TeINT;
+	at15.rep_.name_ = "support_theme_id";
+	attList.push_back(at15);
+
+	TeAttribute at17;
+	at17.rep_.type_ = TeSTRING;
+	at17.rep_.numChar_ = 255;
+	at17.rep_.name_ = "support_theme_table";
+	attList.push_back(at17);
+
+	TeAttribute at18;
+	at18.rep_.type_ = TeSTRING;
+	at18.rep_.numChar_ = 255;
+	at18.rep_.name_ = "support_theme_attr";
+	attList.push_back(at18);
+
+	TeAttribute at19;
+	at19.rep_.type_ = TeINT;
+	at19.rep_.name_ = "generated_layer_id";
+	attList.push_back(at19);
+
+	if(!db->createTable("te_kernel_metadata",attList))
+	{
+		attList.clear();
+		return false;
+	}
+
+	db->createIndex("te_kernel_metadata", "kernel_meta_ind1", "support_theme_id, support_theme_table, support_theme_attr");
+	db->createIndex("te_kernel_metadata", "kernel_meta_ind2", "generated_layer_id");
+
+	return true;
+}
+
+
+bool insertKernelMetadata(TeDatabase* db, TeKernelParams& kernelPar)
+{
+	string ins = " INSERT INTO te_kernel_metadata (event_theme_id_1, intensity_attr_name_1, ";
+	ins += " intensity_attr_table_1, kernel_function_1, compute_type_1, radius_value_1, ";
+	ins += " combination_type, event_theme_id_2, intensity_attr_name_2, intensity_attr_table_2, ";
+	ins += " kernel_function_2, compute_type_2, radius_value_2, support_theme_id,  ";
+	ins += " support_theme_table, support_theme_attr, generated_layer_id)";
+	ins += " VALUES ( ";
+	ins += Te2String(kernelPar.eventThemeId1_) + ",";
+	ins += "'"+ kernelPar.intensityAttrName1_ + "',";
+	ins += "'"+ kernelPar.intensityAttrTable1_ + "',";
+	ins += Te2String((int)kernelPar.kernelFunction1_) + ",";
+	ins += Te2String((int)kernelPar.computeType1_) + ",";
+	ins += Te2String(kernelPar.radiusValue1_) + ",";
+	ins += Te2String((int)kernelPar.combinationType_) + ",";
+	ins += Te2String(kernelPar.eventThemeId2_) + ",";
+	ins += "'"+ kernelPar.intensityAttrName2_ + "',";
+	ins += "'"+ kernelPar.intensityAttrTable2_ + "',";
+	ins += Te2String((int)kernelPar.kernelFunction2_) + ",";
+	ins += Te2String((int)kernelPar.computeType2_) + ",";
+	ins += Te2String(kernelPar.radiusValue2_) + ",";
+	ins += Te2String(kernelPar.supportThemeId_)+ ",";
+	ins += "'"+ kernelPar.supportThemeTable_+ "',";
+	ins += "'"+ kernelPar.supportThemeAttr_+ "',";
+	ins += Te2String(kernelPar.generatedLayerId_);
+	ins += ")";
+
+	if(!db->execute (ins))
+		return false;
+
+	return true;
+}
+
+
+bool updateKernelMetadata(TeDatabase* db, TeKernelParams& kernelPar)
+{
+  string del = "DELETE FROM te_kernel_metadata WHERE support_theme_id = ";
+  del += Te2String(kernelPar.supportThemeId_);
+
+  if (!db->execute(del)) 
+  {
+    return false;
+  }
+
+  return insertKernelMetadata(db,kernelPar);  
+}
+
+
+bool loadKernelParams (TeDatabase* db, int supThemeId, const string& supTableName, const string& supAttrName, TeKernelParams& KernelPar)
+{
+	if (!db) 
+		return false;
+
+	TeDatabasePortal* portal = db->getPortal();
+
+	string q ="SELECT event_theme_id_1, intensity_attr_name_1, ";
+	q += " intensity_attr_table_1, kernel_function_1, compute_type_1, radius_value_1, ";
+	q += " combination_type, event_theme_id_2, intensity_attr_name_2, intensity_attr_table_2, ";
+	q += " kernel_function_2, compute_type_2, radius_value_2, support_theme_id,  ";
+	q += " support_theme_table, support_theme_attr, generated_layer_id ";
+	q += " FROM te_kernel_metadata WHERE ";
+	q += " support_theme_id = "+ Te2String (supThemeId);
+	q += " AND support_theme_table = '"+ supTableName +"'";
+	q += " AND support_theme_attr = '"+ supAttrName +"'";
+
+	if (!portal->query(q))
+	{	
+		delete portal;
+		return false;
+	}
+	
+	if (portal->fetchRow())
+	{
+		KernelPar.eventThemeId1_ = atoi(portal->getData(0));
+		KernelPar.intensityAttrName1_ = string(portal->getData(1));
+		KernelPar.intensityAttrTable1_ = string(portal->getData(2));
+		KernelPar.kernelFunction1_ = TeKernelFunctionType(atoi(portal->getData(3)));
+		KernelPar.computeType1_ = TeKernelComputeType(atoi(portal->getData(4)));
+		KernelPar.radiusValue1_ = portal->getDouble(5);
+		KernelPar.combinationType_ = TeKernelCombinationType(atoi(portal->getData(6)));
+		KernelPar.eventThemeId2_ = atoi(portal->getData(7));
+		KernelPar.intensityAttrName2_ = string(portal->getData(8));
+		KernelPar.intensityAttrTable2_ = string(portal->getData(9));
+		KernelPar.kernelFunction2_ = TeKernelFunctionType(atoi(portal->getData(10)));
+		KernelPar.computeType2_ = TeKernelComputeType(atoi(portal->getData(11)));
+		KernelPar.radiusValue2_ = portal->getDouble(12);
+		KernelPar.supportThemeId_ = atoi(portal->getData(13));
+		KernelPar.supportThemeTable_ = string(portal->getData(14));
+		KernelPar.supportThemeAttr_ = string(portal->getData(15));
+		KernelPar.generatedLayerId_ =  atoi(portal->getData(16));
+
+		vector<int> ids;
+		if(KernelPar.eventThemeId1_>0)
+			ids.push_back (KernelPar.eventThemeId1_);
+		if(KernelPar.eventThemeId2_>0)
+			ids.push_back (KernelPar.eventThemeId2_);
+		if(KernelPar.supportThemeId_>0)
+			ids.push_back (KernelPar.supportThemeId_);
+
+		string sqlIds; 
+		vector<int>::iterator it = ids.begin();
+		
+		while (it != ids.end ())
+		{
+			sqlIds += Te2String((*it)) +",";
+			++it;
+		}
+
+		sqlIds.replace (sqlIds.size()-1, 1, " ");
+		string sql = "SELECT theme_id, name FROM te_theme WHERE theme_id IN ("+ sqlIds +")";
+
+		portal->freeResult();
+		if(!portal->query(sql))
+		{
+			delete portal;
+			return false;
+		}
+
+		while(portal->fetchRow())
+		{
+			int themeId = atoi(portal->getData(0));
+			string themeName = string(portal->getData(1));
+
+			if(themeId==KernelPar.eventThemeId1_)
+				KernelPar.eventThemeName1_ = themeName;
+			else if (themeId==KernelPar.eventThemeId2_)
+				KernelPar.eventThemeName2_ = themeName;
+			else if (themeId==KernelPar.supportThemeId_)
+				KernelPar.supportThemeName_ = themeName;
+		}
+
+		if(KernelPar.generatedLayerId_>0)
+		{
+			sql = "SELECT name FROM te_layer WHERE layer_id = "+ KernelPar.generatedLayerId_;
+			
+			portal->freeResult();
+			if(!portal->query(sql) || !portal->fetchRow())
+			{
+				delete portal;
+				return false;
+			}
+			
+			KernelPar.generatedLayerName_= string(portal->getData(0));
+		}
+
+		delete portal;
+		return true;
+	}
+	
+	delete portal;
+	return false;
+}
+
+
+bool loadKernelParams (TeDatabase* db, int layerId, TeKernelParams& KernelPar)
+{
+	if (!db) 
+		return false;
+
+	TeDatabasePortal* portal = db->getPortal();
+
+	string q ="SELECT event_theme_id_1, intensity_attr_name_1, ";
+	q += " intensity_attr_table_1, kernel_function_1, compute_type_1, radius_value_1, ";
+	q += " combination_type, event_theme_id_2, intensity_attr_name_2, intensity_attr_table_2, ";
+	q += " kernel_function_2, compute_type_2, radius_value_2, support_theme_id,  ";
+	q += " support_theme_table, support_theme_attr, generated_layer_id ";
+	q += " FROM te_kernel_metadata WHERE ";
+	q += " generated_layer_id = "+ Te2String (layerId);
+
+	if (!portal->query(q))
+	{	
+		delete portal;
+		return false;
+	}
+	
+	if (portal->fetchRow())
+	{
+		KernelPar.eventThemeId1_ = atoi(portal->getData(0));
+		KernelPar.intensityAttrName1_ = string(portal->getData(1));
+		KernelPar.intensityAttrTable1_ = string(portal->getData(2));
+		KernelPar.kernelFunction1_ = TeKernelFunctionType(atoi(portal->getData(3)));
+		KernelPar.computeType1_ = TeKernelComputeType(atoi(portal->getData(4)));
+		KernelPar.radiusValue1_ = portal->getDouble(5);
+		KernelPar.combinationType_ = TeKernelCombinationType(atoi(portal->getData(6)));
+		KernelPar.eventThemeId2_ = atoi(portal->getData(7));
+		KernelPar.intensityAttrName2_ = string(portal->getData(8));
+		KernelPar.intensityAttrTable2_ = string(portal->getData(9));
+		KernelPar.kernelFunction2_ = TeKernelFunctionType(atoi(portal->getData(10)));
+		KernelPar.computeType2_ = TeKernelComputeType(atoi(portal->getData(11)));
+		KernelPar.radiusValue2_ = portal->getDouble(12);
+		KernelPar.supportThemeId_ = atoi(portal->getData(13));
+		KernelPar.supportThemeTable_ = string(portal->getData(14));
+		KernelPar.supportThemeAttr_ = string(portal->getData(15));
+		KernelPar.generatedLayerId_ =  atoi(portal->getData(16));
+
+		vector<int> ids;
+		if(KernelPar.eventThemeId1_>0)
+			ids.push_back (KernelPar.eventThemeId1_);
+		if(KernelPar.eventThemeId2_>0)
+			ids.push_back (KernelPar.eventThemeId2_);
+		if(KernelPar.supportThemeId_>0)
+			ids.push_back (KernelPar.supportThemeId_);
+
+		string sqlIds; 
+		vector<int>::iterator it = ids.begin();
+		
+		while (it != ids.end ())
+		{
+			sqlIds += Te2String((*it)) +",";
+			++it;
+		}
+
+		sqlIds.replace (sqlIds.size()-1, 1, " ");
+		string sql = "SELECT theme_id, name FROM te_theme WHERE theme_id IN ("+ sqlIds +")";
+
+		portal->freeResult();
+		if(!portal->query(sql))
+		{
+			delete portal;
+			return false;
+		}
+
+		while(portal->fetchRow())
+		{
+			int themeId = atoi(portal->getData(0));
+			string themeName = string(portal->getData(1));
+
+			if(themeId==KernelPar.eventThemeId1_)
+				KernelPar.eventThemeName1_ = themeName;
+			else if (themeId==KernelPar.eventThemeId2_)
+				KernelPar.eventThemeName2_ = themeName;
+			else if (themeId==KernelPar.supportThemeId_)
+				KernelPar.supportThemeName_ = themeName;
+		}
+
+		if(KernelPar.generatedLayerId_>0)
+		{
+			sql = "SELECT name FROM te_layer WHERE layer_id = " + Te2String(KernelPar.generatedLayerId_);		
+			portal->freeResult();
+			if(!portal->query(sql) || !portal->fetchRow())
+			{
+				delete portal;
+				return false;
+			}			
+			KernelPar.generatedLayerName_= string(portal->getData(0));
+		}
+		delete portal;
+		return true;
+	}
+	delete portal;
+	return false;
+}
+
+
+int createTeLayerMetadata(TeDatabase* db)
+{
+	TeAttributeList attr;
+	TeAttribute		at;
+
+	at.rep_.type_ = TeINT;
+	at.rep_.name_ = "layer_id";
+	at.rep_.isPrimaryKey_ = true;
+	attr.push_back(at);
+
+	at.rep_.isPrimaryKey_ = false;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "name";
+	at.rep_.numChar_ = 128;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "author";
+	at.rep_.numChar_ = 128;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "source";
+	at.rep_.numChar_ = 255;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "quality";
+	at.rep_.numChar_ = 128;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "description";
+	at.rep_.numChar_ = 255;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "date_";
+	at.rep_.numChar_ = 64;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "hour_";
+	at.rep_.numChar_ = 64;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeINT;
+	at.rep_.name_ = "transf";
+	attr.push_back(at);
+
+	if(db->createTable ("te_layer_metadata", attr) == false)
+		return 1;
+
+	bool b = db->tableExist("te_layer_metadata");
+	while(b == false)
+		b = db->tableExist("te_layer_metadata");
+
+	if (db->createRelation("fk_te_layer_met_id", "te_layer_metadata", "layer_id", "te_layer", "layer_id", true) == false)
+		return 2;
+	return 3;
+}
+
+int createTeTableMetadata(TeDatabase* db)
+{
+	TeAttributeList attr;
+	TeAttribute		at;
+
+	at.rep_.type_ = TeINT;
+	at.rep_.name_ = "table_id";
+	at.rep_.isPrimaryKey_ = true;
+	attr.push_back(at);
+
+	at.rep_.isPrimaryKey_ = false;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "name";
+	at.rep_.numChar_ = 128;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "author";
+	at.rep_.numChar_ = 128;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "source";
+	at.rep_.numChar_ = 255;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "quality";
+	at.rep_.numChar_ = 128;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "description";
+	at.rep_.numChar_ = 255;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "date_";
+	at.rep_.numChar_ = 64;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "hour_";
+	at.rep_.numChar_ = 64;
+	attr.push_back(at);
+
+	at.rep_.type_ = TeINT;
+	at.rep_.name_ = "transf";
+	attr.push_back(at);
+
+	if(db->createTable ("te_table_metadata", attr) == false)
+		return 1;
+
+	bool b = db->tableExist("te_table_metadata");
+	while(b == false)
+		b = db->tableExist("te_table_metadata");
+
+	if (db->createRelation("fk_te_table_met_id", "te_table_metadata", "table_id", "te_layer_table", "table_id", true) == false)
+		return 2;
+	return 3;
+}
+
+
+bool deleteTextVisual(TeLayer* layer)
+{
+	TeDatabase*	db = layer->database();
+	TeDatabasePortal*	portal = db->getPortal();
+
+	string sel = "SELECT geom_table FROM te_representation";
+	sel += " WHERE layer_id = " + Te2String(layer->id());
+	sel += " AND geom_type = " + Te2String(TeTEXT);
+
+	if(portal->query(sel))
+	{
+		while(portal->fetchRow())
+		{
+			string s = portal->getData(0);
+			string drop = "DROP TABLE " + s + "_txvisual";
+			if(db->tableExist(s + "_txvisual"))
+			{
+				if(db->execute(drop) == false)
+				{
+					delete portal;
+					return false;	
+				}
+			}
+		}
+	}
+	delete portal;
+	return true;
+}
+
+
+string deletePointedObjects(TeTheme* theme, TeBox& box)
+{
+	unsigned int i, j;
+	TeLayer* layer = theme->layer();		
+	TeDatabase* db = layer->database();
+	TeThemeMap&	themeMap = db->themeMap();
+	string CT = theme->collectionTable();
+	string CAT = theme->collectionAuxTable();
+	string tsel, sel, del;
+	vector<TeTable> table;
+	vector<TeTable> ttable;
+	vector<string> selVec;
+	vector<string> selAuxVec;
+
+	TeAttrTableVector layerTablesVector;
+	layer->getAttrTables(layerTablesVector);
+
+// delete temporal instances of TeFixedGeomDynAttr tables
+	for(i=0; i<layerTablesVector.size(); i++)
+	{
+		TeTable t = layerTablesVector[i];
+		TeAttrTableType type = t.tableType();
+
+		if(type == TeFixedGeomDynAttr)
+			ttable.push_back(t);
+	}
+
+	if(ttable.size())
+	{
+		tsel = "(SELECT aux0 FROM " + CAT;
+		tsel += " WHERE grid_status = 1 OR grid_status = 3)";
+
+		for(i=0; i<ttable.size(); i++)
+		{
+			del = "DELETE FROM " + ttable[i].name() + " WHERE " + ttable[i].uniqueName() + " IN " + tsel;
+			if(db->execute(del) == false)
+				return db->errorMessage();
+		}
+	}
+
+// get selected object ids
+	TeDatabasePortal* portal = db->getPortal();
+	vector<string> oidVec;
+	sel = "SELECT DISTINCT object_id FROM " + CAT;
+	sel += " WHERE (grid_status = 1 OR grid_status = 3) AND object_id NOT IN";
+	sel += "(SELECT DISTINCT object_id FROM " + CAT;
+	sel += " WHERE grid_status = 0 OR grid_status = 2)";
+	portal->freeResult();
+	if(portal->query(sel))
+	{
+		while(portal->fetchRow())
+		{
+			string oid = portal->getData(0);
+			oidVec.push_back(oid);
+		}
+	}
+
+	sel = "SELECT * FROM " + CT + " as T LEFT JOIN " + CAT + " as TT";
+	sel += " ON T.c_object_id = TT.object_id WHERE TT.grid_status is null";
+	sel += " AND (T.c_object_status = 1 OR T.c_object_status = 3)";
+	portal->freeResult();
+	if(portal->query(sel))
+	{
+		while(portal->fetchRow())
+		{
+			string oid = portal->getData(0);
+			oidVec.push_back(oid);
+		}
+	}
+	vector<string>::iterator itB = oidVec.begin();
+	vector<string>::iterator itE = oidVec.end();
+	selVec = generateInClauses(itB,itE, db, true);
+
+// delete attributes of TeAttrStatic tables and TeAttrEvent tables
+	for(i=0; i<layerTablesVector.size(); i++)
+	{
+		TeTable t = layerTablesVector[i];
+		TeAttrTableType type = t.tableType();
+
+		if(type == TeAttrStatic || type == TeAttrEvent)
+			table.push_back(t);
+	}
+
+	for(i=0; i<table.size(); i++)
+	{
+		for(j=0; j<selVec.size(); j++)
+		{
+			del = "DELETE FROM " + table[i].name() + " WHERE ";
+			del += table[i].linkName() + " IN " + selVec[j];
+			if(db->execute(del) == false)
+			{
+				delete portal;
+				return db->errorMessage();
+			}
+		}
+	}
+
+	double minX = TeMAXFLOAT, minY = TeMAXFLOAT, maxX = -TeMAXFLOAT, maxY = -TeMAXFLOAT;
+// delete selected geometries
+	if(layer->geomRep() & TePOLYGONS)
+	{
+		string geo = layer->tableName(TePOLYGONS);
+		for(i=0; i<selVec.size(); i++)
+		{
+			string boxsel = "SELECT * FROM " + geo;
+			boxsel += " WHERE object_id IN " + selVec[i];
+
+			portal->freeResult();
+			if(portal->query(boxsel))
+			{
+				while(portal->fetchRow())
+				{
+					double x1 = portal->getDouble("lower_x");
+					double y1 = portal->getDouble("lower_y");
+					double x2 = portal->getDouble("upper_x");
+					double y2 = portal->getDouble("upper_y");
+					TeBox b(x1, y1, x2, y2);
+					box = TeUnion(box, b);
+				}
+			}
+			del = "DELETE FROM " + geo + " WHERE object_id IN " + selVec[i];
+			if(db->execute(del) == false)
+			{
+				delete portal;
+				return db->errorMessage();
+			}
+		}
+		string bb = "SELECT MIN(lower_x), MIN(lower_y), MAX(upper_x), MAX(upper_y) FROM " + geo;
+		portal->freeResult();
+		if(portal->query(bb) && portal->fetchRow())
+		{
+			minX = MIN(minX, portal->getDouble(0));
+			minY = MIN(minY, portal->getDouble(1));
+			maxX = MAX(maxX, portal->getDouble(2));
+			maxY = MAX(maxY, portal->getDouble(3));
+		}
+	}
+	if(layer->geomRep() & TePOINTS)
+	{
+		string geo = layer->tableName(TePOINTS);
+		for(i=0; i<selVec.size(); i++)
+		{
+			string boxsel = "SELECT * FROM " + geo;
+			boxsel += " WHERE object_id IN " + selVec[i];
+
+			portal->freeResult();
+			if(portal->query(boxsel))
+			{
+				while(portal->fetchRow())
+				{
+					double x = portal->getDouble("x");
+					double y = portal->getDouble("y");
+					TeBox b(x, y, x, y);
+					box = TeUnion(box, b);
+				}
+			}
+			del = "DELETE FROM " + geo + " WHERE object_id IN " + selVec[i];
+			if(db->execute(del) == false)
+			{
+				delete portal;
+				return db->errorMessage();
+			}
+		}
+		string bb = "SELECT MIN(x), MIN(y), MAX(x), MAX(y) FROM " + geo;
+		portal->freeResult();
+		if(portal->query(bb) && portal->fetchRow())
+		{
+			minX = MIN(minX, portal->getDouble(0));
+			minY = MIN(minY, portal->getDouble(1));
+			maxX = MAX(maxX, portal->getDouble(2));
+			maxY = MAX(maxY, portal->getDouble(3));
+		}
+	}
+	if(layer->geomRep() & TeCELLS)
+	{
+		string geo = layer->tableName(TeCELLS);
+		for(i=0; i<selVec.size(); i++)
+		{
+			string boxsel = "SELECT * FROM " + geo;
+			boxsel += " WHERE object_id IN " + selVec[i];
+
+			portal->freeResult();
+			if(portal->query(boxsel))
+			{
+				while(portal->fetchRow())
+				{
+					double x1 = portal->getDouble("lower_x");
+					double y1 = portal->getDouble("lower_y");
+					double x2 = portal->getDouble("upper_x");
+					double y2 = portal->getDouble("upper_y");
+					TeBox b(x1, y1, x2, y2);
+					box = TeUnion(box, b);
+				}
+			}
+			del = "DELETE FROM " + geo + " WHERE object_id IN " + selVec[i];
+			if(db->execute(del) == false)
+			{
+				delete portal;
+				return db->errorMessage();
+			}
+		}
+		string bb = "SELECT MIN(lower_x), MIN(lower_y), MAX(upper_x), MAX(upper_y) FROM " + geo;
+		portal->freeResult();
+		if(portal->query(bb) && portal->fetchRow())
+		{
+			minX = MIN(minX, portal->getDouble(0));
+			minY = MIN(minY, portal->getDouble(1));
+			maxX = MAX(maxX, portal->getDouble(2));
+			maxY = MAX(maxY, portal->getDouble(3));
+		}
+	}
+	if(layer->geomRep() & TeLINES)
+	{
+		string geo = layer->tableName(TeLINES);
+		for(i=0; i<selVec.size(); i++)
+		{
+			string boxsel = "SELECT * FROM " + geo;
+			boxsel += " WHERE object_id IN " + selVec[i];
+
+			portal->freeResult();
+			if(portal->query(boxsel))
+			{
+				while(portal->fetchRow())
+				{
+					double x1 = portal->getDouble("lower_x");
+					double y1 = portal->getDouble("lower_y");
+					double x2 = portal->getDouble("upper_x");
+					double y2 = portal->getDouble("upper_y");
+					TeBox b(x1, y1, x2, y2);
+					box = TeUnion(box, b);
+				}
+			}
+			del = "DELETE FROM " + geo + " WHERE object_id IN " + selVec[i];
+			if(db->execute(del) == false)
+			{
+				delete portal;
+				return db->errorMessage();
+			}
+		}
+		string bb = "SELECT MIN(lower_x), MIN(lower_y), MAX(upper_x), MAX(upper_y) FROM " + geo;
+		portal->freeResult();
+		if(portal->query(bb) && portal->fetchRow())
+		{
+			minX = MIN(minX, portal->getDouble(0));
+			minY = MIN(minY, portal->getDouble(1));
+			maxX = MAX(maxX, portal->getDouble(2));
+			maxY = MAX(maxY, portal->getDouble(3));
+		}
+	}
+
+	double dx = maxX - minX;
+	double dy = maxY - minY;
+	minX -= dx/20.;
+	maxX += dx/20.;
+	minY -= dy/20.;
+	maxY += dy/20.;
+
+	string up = "UPDATE te_layer SET lower_x = " + Te2String(minX);
+	up += ", lower_y = " + Te2String(minY);
+	up += ", upper_x = " + Te2String(maxX);
+	up += ", upper_y = " + Te2String(maxY);
+	up += " WHERE layer_id = " + Te2String(layer->id());
+	if(db->execute(up) == false)
+	{
+		delete portal;
+		return db->errorMessage();
+	}
+	TeBox nbox(minX, minY, maxX, maxY);
+	layer->setLayerBox(nbox);
+
+	if(!selVec.empty())
+	{
+		if(!layer->updateLayerEditionTime())
+		{
+		}
+	}
+
+// get collection names of all themes that use this layer
+	vector<string> CATFVec;
+	vector<string> CATVec;
+	vector<string> CTVec;
+	//string ss = "SELECT theme_id FROM te_theme WHERE layer_id = " + Te2String(layer->id());
+	string ss = "SELECT te_theme.theme_id, te_theme.name, te_view.user_name ";
+	ss += " FROM te_theme INNER JOIN te_view ON te_theme.view_id = te_view.view_id";
+	ss += " WHERE layer_id = " + Te2String(layer->id());
+
+	string originalUser = db->user();
+
+	portal->freeResult();
+	if(portal->query(ss))
+	{
+		while(portal->fetchRow())
+		{
+			int id = atoi(portal->getData(0));
+			std::string themeName = string(portal->getData(1));
+			std::string userName = string(portal->getData(2));
+
+			if(id != theme->id())
+			{
+				bool diffUser = false;
+				TeTheme* t = NULL;
+
+				TeThemeMap::iterator itTheme = themeMap.find(id);
+				if(itTheme != themeMap.end())
+				{
+					t = (TeTheme*)itTheme->second;
+				}
+				else
+				{
+					db->user(userName);
+					t = new TeTheme(themeName);
+					if(!db->loadTheme(t))
+					{
+						delete portal;
+						return db->errorMessage();
+					}
+
+					diffUser = true;
+				}
+
+				TeAttrTableVector& tableVec = t->attrTables();
+				for(i=0; i<tableVec.size(); i++)
+				{
+					string s = t->collectionAuxTable();
+					if(tableVec[i].tableType() == TeFixedGeomDynAttr)
+						CATFVec.push_back(s);
+					else
+						CATVec.push_back(s);
+				}
+				string s = t->collectionTable();
+				CTVec.push_back(s);
+
+				if(diffUser)
+				{
+					TeThemeMap::iterator itTheme = themeMap.find(id);
+					if(itTheme != themeMap.end())
+					{
+						themeMap.erase(itTheme);
+					}
+					delete t;
+				}
+			}
+		}
+	}
+	delete portal;
+
+	db->user(originalUser);
+
+// delete selected objects of the collections of other themes
+	for(i=0; i<CTVec.size(); i++)
+	{
+		for(j=0; j<selVec.size(); j++)
+		{
+			del = "DELETE FROM " + CTVec[i] + " WHERE c_object_id IN " + selVec[j];
+			if(db->execute(del) == false)
+				return db->errorMessage();
+		}
+	}
+
+// delete selected objects of the collection this theme
+	for(i=0; i<selVec.size(); i++)
+	{
+		del = "DELETE FROM " + CT + " WHERE c_object_id IN " + selVec[i];
+		if(db->execute(del) == false)
+			return db->errorMessage();
+	}
+
+	up = "UPDATE " + CT + " SET c_object_status = c_object_status - 1 WHERE (c_object_status = 1 OR c_object_status = 3)";
+	if(db->execute(up) == false)
+		return db->errorMessage();
+
+// delete selected instances of the auxiliar collection of other themes (only TeFixedGeomDynAttr)
+	if(ttable.size())
+	{
+		for(i=0; i<CATFVec.size(); i++)
+		{
+			del = "DELETE FROM " + CATFVec[i] + " WHERE aux0 IN " + tsel;
+			if(db->execute(del) == false)
+				return db->errorMessage();
+		}
+	}
+
+// delete selected instances of the auxiliar collection of other themes (TeAttrStatic and TeAttrEvent)
+	for(i=0; i<CATVec.size(); i++)
+	{
+		for(j=0; j<selVec.size(); j++)
+		{
+			del = "DELETE FROM " + CATVec[i] + " WHERE object_id IN " + selVec[j];
+			if(db->execute(del) == false)
+				return db->errorMessage();
+		}
+	}
+
+// delete selected instances of the auxiliar collection this theme
+	del = "DELETE FROM " + CAT + " WHERE grid_status = 1 OR grid_status = 3";
+	if(db->execute(del) == false)
+		return db->errorMessage();
+
+	return "";
+}
+
+
+string insertObjectIntoCollection(TeTheme* theme, TeCoord2D p, string newId, string newTId)
+{
+	string erro;
+	string sel;
+	TeLayer* layer = theme->layer();
+	TeDatabase* db = layer->database();
+	string CT = theme->collectionTable();
+	string CAT = theme->collectionAuxTable();
+
+	TeDatabasePortal* portal = db->getPortal();
+	if(newId.empty() == false)
+	{
+		sel = "SELECT * FROM " + CT + " WHERE c_object_id = '" + newId + "'";
+		if(portal->query(sel) && portal->fetchRow())
+		{
+//			erro = "There is already the object identifier:" + newId;
+//			erro += " in the collection table:" + CT;
+			delete portal;
+			return "There is already";
+		}
+	}
+
+//	if(newTId.empty() == false)
+//	{
+//		sel = "SELECT * FROM " + CAT + " WHERE aux0 = '" + newTId + "'";
+//		portal->freeResult();
+//		if(portal->query(sel) && portal->fetchRow())
+//		{
+//			erro = "There is already the object identifier:" + newTId;
+//			erro += " in the collection auxliar table:" + CAT;
+//			delete portal;
+//			return erro;
+//		}
+//	}
+	delete portal;
+
+	unsigned int i;
+	vector<TeTable> staticTableVec, eventTableVec, temporalTableVec;
+	TeAttrTableVector layerTablesVector;
+	if(layer->getAttrTables(layerTablesVector))
+	{
+		for(i=0; i<layerTablesVector.size(); i++)
+		{
+			TeTable t = layerTablesVector[i];
+			if(t.tableType() == TeAttrStatic)
+				staticTableVec.push_back(t);
+			else if(t.tableType() == TeAttrEvent)
+				eventTableVec.push_back(t);
+			else if(t.tableType() == TeFixedGeomDynAttr)
+				temporalTableVec.push_back(t);
+		}
+	}
+	else
+	{
+		erro = "Fail in the layer method to gets attribute table associated";
+		return erro;
+	}
+
+	bool ret;
+	if(newId.empty() == false)
+	{
+		string ins = "INSERT INTO " + CT + " (c_object_id, c_legend_id,";
+		ins += " label_x, label_y, c_legend_own, c_object_status) VALUES (";
+		ins += "'" + newId + "', 0, " + Te2String(p.x()) + ", " + Te2String(p.y());
+		ins += ", 0, 1)";
+		ret = db->execute(ins);
+		if(ret == false)
+			return db->errorMessage();
+
+		for(i=0; i<staticTableVec.size(); i++)
+		{
+			TeTable t = staticTableVec[i];
+			ins = "INSERT INTO " + t.name() + " (" + t.linkName() + ")";
+			ins += " VALUES ('" + newId + "')";
+			ret = db->execute(ins);
+			if(ret == false)
+				return db->errorMessage();
+		}
+		for(i=0; i<eventTableVec.size(); i++)
+		{
+			TeTable t = eventTableVec[i];
+			ins = "INSERT INTO " + t.name() + " (" + t.linkName() + ")";
+			ins += " VALUES ('" + newId + "')";
+			ret = db->execute(ins);
+			if(ret == false)
+				return db->errorMessage();
+		}
+	}
+
+	string uniqueId = newId;
+	if(newTId.empty() == false)
+	{
+		uniqueId = newId + newTId;
+		string ins = "INSERT INTO " + CAT + " (object_id, aux0, unique_id, grid_status) VALUES (";
+		ins += "'" + newId + "', '" + newTId + "', " + uniqueId + ", 1)";
+		ret = db->execute(ins);
+		if(ret == false)
+			return db->errorMessage();
+
+		for(i=0; i<temporalTableVec.size(); i++)
+		{
+			TeTable t = temporalTableVec[i];
+			ins = "INSERT INTO " + t.name() + " (" + t.linkName() + ", " + t.uniqueName() + ")";
+			ins += " VALUES ('" + newId + "', '" + newTId + "')";
+			ret = db->execute(ins);
+			if(ret == false)
+				return db->errorMessage();
+		}
+	}
+	else
+	{
+		string ins = "INSERT INTO " + CAT + " (object_id, grid_status) VALUES (";
+		ins += "'" + newId + "', 1)";
+		ret = db->execute(ins);
+		if(ret == false)
+			return db->errorMessage();
+	}
+
+	return "";
+}
+
+
+bool createGPMMetadataTable(TeDatabase* db, const bool& integrity)
+{
+	if (!db)
+		return false;
+	
+	string table = "te_gpm";
+	
+	TeAttributeList attList;
+
+	TeAttribute at1;
+	at1.rep_.type_ = TeINT;
+	at1.rep_.name_ = "gpm_id";
+	at1.rep_.isPrimaryKey_ = true;
+	at1.rep_.isAutoNumber_ = true;
+	attList.push_back(at1);
+	
+	TeAttribute at2;
+	at2.rep_.type_ = TeINT;
+	at2.rep_.name_ = "gpm_default";
+	attList.push_back(at2);	
+	
+	TeAttribute at3;
+	at3.rep_.type_ = TeINT;
+	at3.rep_.name_ = "theme_id1";
+	attList.push_back(at3);	
+
+	TeAttribute at31;
+	at31.rep_.type_ = TeINT;
+	at31.rep_.name_ = "geom_rep1";
+	attList.push_back(at31);	
+
+	TeAttribute at32;
+	at32.rep_.type_ = TeINT;
+	at32.rep_.name_ = "theme_id2";
+	attList.push_back(at32);	
+
+	TeAttribute at33;
+	at33.rep_.type_ = TeINT;
+	at33.rep_.name_ = "geom_rep2";
+	attList.push_back(at33);	
+
+	TeAttribute at4;
+	at4.rep_.type_ = TeSTRING;
+	at4.rep_.numChar_ = 50;
+	at4.rep_.name_ = "neighbours_table";
+	attList.push_back(at4);	
+
+	TeAttribute at5;
+	at5.rep_.type_ = TeDATETIME;
+	at5.rep_.name_ = "construction_date";
+	attList.push_back(at5);	
+
+	TeAttribute at6;
+	at6.rep_.type_ = TeINT;
+	at6.rep_.name_ = "construction_strategy";
+	attList.push_back(at6);	
+
+	TeAttribute at7;
+	at7.rep_.type_ = TeREAL;
+	at7.rep_.name_ = "const_max_distance";
+	attList.push_back(at7);	
+
+	TeAttribute at61;
+	at61.rep_.type_ = TeINT;
+	at61.rep_.name_ = "const_num_neighbours";
+	attList.push_back(at61);	
+
+	TeAttribute at8;
+	at8.rep_.type_ = TeREAL;
+	at8.rep_.name_ = "const_max_net_distance";
+	attList.push_back(at8);	
+
+	TeAttribute at81;
+	at81.rep_.type_ = TeREAL;
+	at81.rep_.name_ = "const_max_con_distance";
+	attList.push_back(at81);	
+
+	TeAttribute at9;
+	at9.rep_.type_ = TeINT;
+	at9.rep_.name_ = "slicing_strategy";
+	attList.push_back(at9);	
+
+	TeAttribute at91;
+	at91.rep_.type_ = TeREAL;
+	at91.rep_.name_ = "slicing_zone_dist";
+	attList.push_back(at91);	
+
+	TeAttribute at92;
+	at92.rep_.type_ = TeINT;
+	at92.rep_.name_ = "slicing_zone_local";
+	attList.push_back(at92);	
+
+	TeAttribute at10;
+	at10.rep_.type_ = TeINT;
+	at10.rep_.name_ = "weight_strategy";
+	attList.push_back(at10);	
+
+	TeAttribute at11;
+	at11.rep_.type_ = TeINT;
+	at11.rep_.name_ = "weight_norm";
+	attList.push_back(at11);	
+
+	TeAttribute at12;
+	at12.rep_.type_ = TeREAL;
+	at12.rep_.name_ = "weight_a";
+	attList.push_back(at12);	
+
+	TeAttribute at13;
+	at13.rep_.type_ = TeREAL;
+	at13.rep_.name_ = "weight_b";
+	attList.push_back(at13);	
+
+	TeAttribute at14;
+	at14.rep_.type_ = TeREAL;
+	at14.rep_.name_ = "weight_c";
+	attList.push_back(at14);	
+
+	TeAttribute at15;
+	at15.rep_.type_ = TeREAL;
+	at15.rep_.name_ = "weight_factor";
+	attList.push_back(at15);	
+
+	TeAttribute at16;
+	at16.rep_.type_ = TeREAL;
+	at16.rep_.name_ = "weight_dist_raio";
+	attList.push_back(at16);	
+
+	TeAttribute at17;
+	at17.rep_.type_ = TeREAL;
+	at17.rep_.name_ = "weigth_max_local_dist";
+	attList.push_back(at17);
+	 
+	bool status = db->createTable(table,attList);
+	attList.clear();
+	
+	//create integrity
+	if(status && integrity)
+	{
+		if (!db->createRelation("fk_gpm_theme1_id", "te_gpm", "theme_id1", "te_theme", "theme_id", true))
+			return false;
+
+		if (!db->createRelation("fk_gpm_theme2_id", "te_gpm", "theme_id2", "te_theme", "theme_id", true))
+			return false;
+	}
+
+	//create index
+	if(status)
+	{
+		db->createIndex("te_gpm", "idx_gpm_theme_id1", "theme_id1");
+	}
+
+	return status;
+}
+
+bool createNeighbourhoodTable(TeDatabase* db, const string& tableName)
+{
+	if (!db)
+		return false;
+	
+	TeAttributeList attList;
+
+	TeAttribute at1;
+	at1.rep_.type_ = TeINT;
+	at1.rep_.name_ = "neighbourhood_id";
+	at1.rep_.isPrimaryKey_ = true;
+	at1.rep_.isAutoNumber_ = true;
+	attList.push_back(at1);
+	
+	TeAttribute at2;
+	at2.rep_.type_ = TeSTRING;
+	at2.rep_.numChar_=50;
+	at2.rep_.name_ = "object_id1";
+	attList.push_back(at2);	
+	
+	TeAttribute at3;
+	at3.rep_.type_ = TeSTRING;
+	at3.rep_.numChar_=50;
+	at3.rep_.name_ = "object_id2";
+	attList.push_back(at3);	
+
+	TeAttribute at31;
+	at31.rep_.type_ = TeREAL;
+	at31.rep_.name_ = "centroid_distance";
+	attList.push_back(at31);	
+
+	TeAttribute at32;
+	at32.rep_.type_ = TeREAL;
+	at32.rep_.name_ = "weight";
+	attList.push_back(at32);	
+
+	TeAttribute at33;
+	at33.rep_.type_ = TeINT;
+	at33.rep_.name_ = "slice";
+	attList.push_back(at33);	
+
+	TeAttribute at4;
+	at4.rep_.type_ = TeINT;
+	at4.rep_.name_ = "order_neig";
+	attList.push_back(at4);	
+
+	TeAttribute at6;
+	at6.rep_.type_ = TeREAL;
+	at6.rep_.name_ = "borders_length";
+	attList.push_back(at6);	
+
+	TeAttribute at7;
+	at7.rep_.type_ = TeREAL;
+	at7.rep_.name_ = "net_objects_distance";
+	attList.push_back(at7);	
+
+	TeAttribute at61;
+	at61.rep_.type_ = TeREAL;
+	at61.rep_.name_ = "net_minimum_path";
+	attList.push_back(at61);	
+
+	bool status = db->createTable(tableName,attList);
+	attList.clear();
+	
+	//create index
+	if(status)
+		db->createIndex(tableName, "idx_"+tableName+"_objectId1", "object_id1");
+	
+	return status;
+}
+
+//! Delete the generalized proximity matrix of a theme - neighbourhoodTable and metadata
+bool deleteGPMTable(TeDatabase* db, const int& themeId, const int& gpmId)
+{
+	if(!db)
+	{
+		return false;
+	}
+
+	if(!db->tableExist("te_gpm"))
+	{
+		return false;
+	}
+
+	string del = "SELECT neighbours_table, gpm_default FROM te_gpm ";
+	del += " WHERE theme_id1 = "+ Te2String(themeId);
+	if(gpmId>-1)
+		del += " AND gpm_id = "+ Te2String(gpmId);
+
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+	
+	if(!portal->query(del))
+	{
+		delete portal;
+		return false;
+	}
+
+	int isDefault = false;
+	while(portal->fetchRow())
+	{
+		string tableName = portal->getData(0);
+		isDefault = portal->getInt(1);
+		string del2 = " DROP TABLE "+ tableName;
+		db->execute(del2);
+	}
+
+	del = "DELETE FROM te_gpm ";
+	del += " WHERE theme_id1 = "+ Te2String(themeId);
+	if(gpmId>-1)
+		del += " AND gpm_id = "+ Te2String(gpmId);
+	
+	db->execute(del);
+
+	portal->freeResult();
+
+	//if deleted matrix was default, select other matrix as default
+	if(gpmId>-1 && (isDefault != 0))
+	{
+		del = " SELECT gpm_id FROM te_gpm ";
+		del += " WHERE theme_id1 = "+ Te2String(themeId);
+		if((!portal->query(del)) || (!portal->fetchRow()))
+		{
+			delete portal;
+			return true;
+		}
+
+		int aux = portal->getInt(0);
+
+		string up =  " UPDATE te_gpm SET gpm_default = 1 WHERE gpm_id = "+ Te2String(aux);
+		db->execute(up); 
+	}
+	delete portal;
+	return true;
+}
+
+
+
+bool loadAppTheme (TeDatabase* db, TeAppTheme *theme, const string& tableName)
+{
+	if (!db || !theme) 
+		return false;
+
+//	if (!db->loadTheme((TeTheme*)theme->getTheme()))
+//		return false;
+
+	TeDatabasePortal* portal = db->getPortal();
+	if (!portal)
+		return false;
+
+	string q = "SELECT * FROM " + tableName + " WHERE theme_id= ";
+	q += Te2String (((TeTheme*)theme->getTheme())->id());
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	theme->outOfCollectionVisibility(portal->getBool(1));
+	theme->withoutDataConnectionVisibility(portal->getBool(2));
+	theme->refineAttributeWhere(string(portal->getData (3)));
+	theme->refineSpatialWhere(string(portal->getData (4)));
+	theme->refineTemporalWhere(string(portal->getData (5)));
+
+	string name = portal->getData(6);
+	if (!name.empty())
+		theme->groupColor(name);
+	theme->groupColorDir(TeColorDirection(atoi(portal->getData(7))));
+	theme->groupObjects(TeSelectedObjects(atoi(portal->getData(8))));
+	theme->pieDiameter(portal->getDouble(9));
+	theme->pieMaxDiameter(portal->getDouble(10));
+	theme->pieMinDiameter(portal->getDouble(11));
+	name = portal->getData(12);
+	if (!name.empty())
+		theme->pieDimAttribute(name);
+	theme->barMaxHeight(portal->getDouble(13));
+	theme->barMinHeight(portal->getDouble(14));
+	theme->barWidth(portal->getDouble(15));
+	theme->chartMaxVal(portal->getDouble(16));
+	theme->chartMinVal(portal->getDouble(17));
+	theme->chartType(TeChartType(atoi(portal->getData(18))));
+	theme->chartObjects(TeSelectedObjects(atoi(portal->getData(19))));
+	theme->keepDimension(atoi(portal->getData(20)));
+	theme->showCanvasLegend(portal->getBool(21));
+	TeCoord2D p;
+	p.x(portal->getDouble(22));
+	p.y(portal->getDouble(23));
+	theme->canvasLegUpperLeft(p);
+	bool n = portal->getBool(24);
+	theme->mixColor(n);
+	n = portal->getBool(25);
+	theme->countObj(n);
+	name = portal->getData(26);
+	if (!name.empty())
+		theme->textTable(name);
+	theme->chartFunction(portal->getData(27));
+	portal->freeResult();
+	delete portal;
+	return loadChartParams(db,theme);
+}
+
+bool insertAppTheme(TeDatabase* db, TeAppTheme *appTheme, const string& tableName)
+{
+	if (db == 0 || appTheme == 0) 
+		return false;
+
+	TeTheme* theme = (TeTheme*)appTheme->getTheme();
+
+	if (db->insertTheme(theme) == false)
+		return false;
+
+	string q = "INSERT INTO " + tableName + " (theme_id, visible_out_coll, visible_without_conn, ";
+	q += "refine_attribute_where, refine_spatial_where, refine_temporal_where, ";
+	q += "grouping_color, grouping_color_direction, grouping_objects, ";
+	q += "pie_diameter, pie_max_diameter, pie_min_diameter, pie_dimension_attr, ";
+	q += "bar_max_height, bar_min_height, bar_width, ";
+	q += "chart_max_value, chart_min_value, chart_type, chart_objects, ";
+	q += "keep_dimension, show_canvas_leg, canvas_leg_x, canvas_leg_y, ";
+	q += "mix_color, count_obj, text_table, chart_function) VALUES (";
+
+	q += Te2String(theme->id()) + ", ";
+	if (appTheme->outOfCollectionVisibility())
+		q += "1, ";
+	else
+		q += "0, ";
+	if (appTheme->withoutDataConnectionVisibility())
+		q += "1, '";
+	else
+		q += "0, '";
+	q += appTheme->refineAttributeWhere () + "', '" + appTheme->refineSpatialWhere() + "', '";
+	q += appTheme->refineTemporalWhere () + "', '" + appTheme->groupColor() + "', ";
+	q += Te2String(appTheme->groupColorDir()) + ", " + Te2String(appTheme->groupObjects()) + ", ";
+	q += Te2String(appTheme->pieDiameter(),8) + ", " + Te2String(appTheme->pieMaxDiameter(),8) + ", ";
+	q += Te2String(appTheme->pieMinDiameter(),8) + ", '" + appTheme->pieDimAttribute() + "', ";
+	q += Te2String(appTheme->barMaxHeight(),8) + ", " + Te2String(appTheme->barMinHeight(),8) + ", ";
+	q += Te2String(appTheme->barWidth(),8) + ", " + Te2String(appTheme->chartMaxVal(),8) + ", ";
+	q += Te2String(appTheme->chartMinVal(),8)+ ", " + Te2String(appTheme->chartType()) + ", ";
+	q += Te2String(appTheme->chartObjects()) + ", "; 
+	q += Te2String(appTheme->keepDimension()) + ", ";
+
+	if (appTheme->showCanvasLegend())
+		q += "1, ";
+	else
+		q += "0, ";
+
+	q += Te2String(appTheme->canvasLegWidth(),8) + ", ";
+	q += Te2String(appTheme->canvasLegHeight(),8) + ", ";
+
+	if (appTheme->mixColor())
+		q += "1, ";
+	else
+		q += "0, ";
+
+	if (appTheme->countObj())
+		q += "1, '";
+	else
+		q += "0, '";
+	q += appTheme->textTable() + "', '";
+	q += appTheme->chartFunction() + "')";
+
+	if(!db->execute(q))
+		return false;
+
+	for (unsigned int i=0; i<appTheme->chartAttributes_.size(); i++)
+	{
+		q = "INSERT INTO te_chart_params VALUES (attr_name, red, blue, green, theme_id) VALUES (";
+		string attname = appTheme->chartAttributes_[i];
+		map<int, map<string, string> > mapTAA = db->mapThemeAlias();
+		map<int, map<string, string> >::iterator tit = mapTAA.find(theme->id());
+		if(tit != mapTAA.end())
+		{
+			map<string, string> mapAA = tit->second;
+			appTheme->concatTableName(attname);
+			map<string, string>::iterator it = mapAA.find(attname);
+			if(it != mapAA.end())
+			{
+				string alias = it->second;
+				attname += "(" + alias + ")";
+			}
+		}
+		q += "'" + attname + "', " + Te2String(appTheme->chartColors_[i].red_)+ ", ";
+		q += Te2String(appTheme->chartColors_[i].green_)+ ", " + Te2String(appTheme->chartColors_[i].blue_) +", ";
+		q += Te2String(theme->id()) + ")";
+		if (!db->execute(q))
+			return false;
+	}
+
+    return true; 
+}
+
+bool updateAppTheme (TeDatabase* db, TeAppTheme* appTheme, const string& tableName)
+{
+	if (db == 0 || appTheme == 0)
+		return false;
+
+	TeTheme* theme = (TeTheme*)appTheme->getTheme();
+	if (db->updateTheme(theme) == false) 
+		return false;
+
+	if (theme->id() <= 0 )  // theme doesn�t exist in the database yet
+		return insertAppTheme (db, appTheme, tableName);
+
+	// update theme metadata
+	string sql = "UPDATE " + tableName + " SET ";
+	sql += "  visible_out_coll=";
+	if (appTheme->outOfCollectionVisibility())
+		sql += "1";
+	else 
+		sql += "0";
+	sql += ", visible_without_conn=";
+	if (appTheme->withoutDataConnectionVisibility())
+		sql += "1";
+	else 
+		sql += "0";
+
+	sql += ", refine_attribute_where='" + appTheme->refineAttributeWhere()+"'";
+	sql += ", refine_spatial_where='" + appTheme->refineSpatialWhere()+"'";
+	sql += ", refine_temporal_where='" + appTheme->refineTemporalWhere()+"'";
+	sql += ", grouping_color='" + appTheme->groupColor() + "'";
+	sql += ", grouping_color_direction=" + Te2String(appTheme->groupColorDir());
+	sql += ", grouping_objects=" + Te2String (appTheme->groupObjects());
+	sql += ", pie_diameter=" + Te2String(appTheme->pieDiameter());
+	sql += ", pie_max_diameter=" + Te2String(appTheme->pieMaxDiameter());
+	sql += ", pie_min_diameter=" + Te2String(appTheme->pieMinDiameter());
+	sql += ", pie_dimension_attr='" + appTheme->pieDimAttribute()+"'";
+	sql += ", bar_max_height=" + Te2String(appTheme->barMaxHeight());
+	sql += ", bar_min_height=" + Te2String(appTheme->barMinHeight());
+	sql += ", bar_width=" + Te2String(appTheme->barWidth());
+	sql += ", chart_max_value=" + Te2String(appTheme->chartMaxVal());
+	sql += ", chart_min_value=" + Te2String(appTheme->chartMinVal());
+	sql += ", chart_type=" + Te2String (appTheme->chartType());
+	sql += ", chart_objects=" + Te2String (appTheme->chartObjects());
+	sql += ", keep_dimension=" + Te2String(appTheme->keepDimension());
+	sql += ", show_canvas_leg=";
+	if (appTheme->showCanvasLegend())
+		sql += "1";
+	else 
+		sql += "0";
+	sql += ", canvas_leg_x=" + Te2String(appTheme->canvasLegUpperLeft().x());
+	sql += ", canvas_leg_y=" + Te2String(appTheme->canvasLegUpperLeft().y());
+	sql += ", mix_color=";
+	if (appTheme->mixColor())
+		sql += "1";
+	else 
+		sql += "0";
+	sql += ", count_obj=";
+	if (appTheme->countObj())
+		sql += "1";
+	else 
+		sql += "0";
+	sql += ", text_table='" + appTheme->textTable () + "'";
+	sql += ", chart_function='" + appTheme->chartFunction () + "'";
+	sql += " WHERE theme_id=" + Te2String (theme->id());
+
+	if (!db->execute (sql))
+		return false;
+         
+	// remove it�s chart parameters and reinsert them
+	deleteChartParams(db, appTheme);
+	if(!insertChartParams (db, appTheme))
+		return false;
+
+	return true;
+}
+
+
+bool insertChartParams(TeDatabase* db, TeAppTheme *theme)
+{
+	if (!db || !theme) 
+		return false;
+
+	unsigned int n = theme->chartColors_.size();
+	int themeId = ((TeTheme*)theme->getTheme())->id();
+	TeColor cor;
+	string ins, insert;
+	for (unsigned int i=0; i<n; i++)
+	{
+		cor = theme->chartColors_[i];
+		ins = "INSERT INTO te_chart_params (theme_id, attr_name, red, green, blue)";
+		insert = ins + " VALUES (" + Te2String(themeId) +",'";
+		string attname = theme->chartAttributes_[i];
+		map<int, map<string, string> > mapTAA = db->mapThemeAlias();
+		map<int, map<string, string> >::iterator tit = mapTAA.find(((TeTheme*)theme->getTheme())->id());
+		if(tit != mapTAA.end())
+		{
+			map<string, string> mapAA = tit->second;
+			theme->concatTableName(attname);
+			map<string, string>::iterator it = mapAA.find(attname);
+			if(it != mapAA.end())
+			{
+				string alias = it->second;
+				attname += "(" + alias + ")";
+			}
+		}
+		insert += attname +"',";
+		insert += Te2String(cor.red_) + ",";
+		insert += Te2String(cor.green_) + ",";
+		insert += Te2String(cor.blue_) + ")";
+		if (!db->execute(insert))
+			return false;
+	}
+	return true;
+}
+
+
+bool deleteChartParams (TeDatabase* db, TeAppTheme* theme)
+{
+	if (!db || !theme) 
+		return false;
+
+	string id = Te2String(((TeTheme*)theme->getTheme())->id());
+	string del = "DELETE FROM te_chart_params WHERE theme_id = " + id;
+	return db->execute(del);
+}
+
+
+bool locatePieBar (TeDatabase* db, TeAppTheme* theme, TeCoord2D pt, double delta) 
+{
+	if (!db || !theme) 
+		return false;
+
+	theme->chartSelected_.clear();
+	string	TC = ((TeTheme*)theme->getTheme())->collectionTable();
+	string xmin = Te2String(pt.x()-delta);
+	string xmax = Te2String(pt.x()+delta);
+	string ymin = Te2String(pt.y()-delta);
+	string ymax = Te2String(pt.y()+delta);
+
+	TeDatabasePortal* portal = db->getPortal();
+	if (!portal)
+		return false;
+
+	string sel = "SELECT c_object_id FROM " + TC + " WHERE ";
+	sel += "label_x > " + xmin + " AND ";
+	sel += "label_x < " + xmax + " AND ";
+	sel += "label_y > " + ymin + " AND ";
+	sel += "label_y < " + ymax;
+
+	if(!portal->query(sel))
+	{
+		delete portal;
+		return false;
+	}
+
+	if(portal->fetchRow() == false)
+	{
+		delete portal;
+		return false;
+	}
+
+	theme->chartSelected_ = portal->getData("c_object_id");
+
+	delete portal;
+
+	return true;
+}
+
+
+bool loadChartParams (TeDatabase* db, TeAppTheme *theme)
+{
+	if (!db || !theme) 
+		return false;
+
+	TeDatabasePortal* portal = db->getPortal();
+
+	string q ="SELECT * FROM te_chart_params WHERE theme_id= ";
+	q += Te2String (((TeTheme*)theme->getTheme())->id());
+
+	if (!portal->query(q))
+	{	
+		delete portal;
+		return false;
+	}
+	while (portal->fetchRow())
+	{
+		TeColor cor = portal->getColor ();
+		string attname = portal->getData("attr_name");
+		int f = attname.find("(");
+		if(f >= 0)
+		{
+			string alias = attname;
+			attname = attname.substr(0, f);
+			alias = alias.substr(f+1);
+			alias = alias.substr(0, alias.size()-1);
+			map<string, string>& mapAA = db->mapThemeAlias()[((TeTheme*)theme->getTheme())->id()];
+			theme->concatTableName(attname);
+			mapAA[attname] = alias;
+		}
+		theme->chartAttributes_.push_back(attname);
+		theme->chartColors_.push_back(cor);
+	}
+	delete portal;
+	return true;
+}
+
+bool updatePieBarLocation (TeDatabase* db, TeAppTheme* theme, TeCoord2D pt) 
+{
+	if (!db || !theme) 
+		return false;
+
+	if (theme->chartSelected_.empty() == true)
+		return false;
+
+	string	x = Te2String(pt.x());
+	string	y = Te2String(pt.y());
+	string	TC = ((TeTheme*)theme->getTheme())->collectionTable();
+	string mover = "UPDATE " + TC + " SET label_x = " + x + ", label_y = " + y;
+	mover += " WHERE c_object_id = '" + theme->chartSelected_ + "'";
+	return db->execute(mover);
+}
+
+bool updatePointLocation (TeDatabase* db, TeAppTheme* theme, TeCoord2D pt) 
+{
+	if (!db || !theme) 
+		return false;
+
+	string	x = Te2String(pt.x());
+	string	y = Te2String(pt.y());
+	string	table = ((TeTheme*)theme->getTheme())->layer()->tableName(TePOINTS);
+	string mover = "UPDATE " + table + " SET x = " + x + ", y = " + y;
+	mover += " WHERE geom_id = " + Te2String(theme->tePoint_.geomId());
+	return db->execute(mover);
+}
+
+bool generateCountLegends(TeAppTheme* appTheme, string table, string field)
+{
+	if(appTheme == 0)
+		return false;
+
+	TeTheme* theme = (TeTheme*)appTheme->getTheme();
+
+	appTheme->groupObjects(TeAll);
+	TeAttributeRep rep;
+	rep.name_ = table + "." + field;
+	rep.type_ = TeINT;
+	
+	TeGrouping group;
+	group.groupAttribute_ = rep;
+	group.groupNormAttribute_ = "";
+	group.groupMode_ = TeUniqueValue;
+	group.groupPrecision_ = 0;
+	theme->grouping(group);
+	
+	string	scor = "Cy-G-Y-Or-R";
+	appTheme->groupColor(scor);
+	appTheme->countObj(true);
+	appTheme->mixColor(true);
+	appTheme->groupColorDir(TeColorAscSatEnd);
+	
+	string	fieldId = theme->collectionTable() + ".c_object_id";
+	TeLayer* layer = theme->layer();
+	TeDatabase* db = layer->database();
+    vector<TeSlice> result;
+	vector<string> valVec;
+	vector<string> idVec;
+
+	string sel = "SELECT " + fieldId + ", " + field + theme->sqlFrom() + " ORDER BY " + field;
+
+	TeDatabasePortal* portal = db->getPortal();
+	if(portal->query(sel) == false)
+	{
+		delete portal;
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		string objectId = portal->getData(0);
+		string val = portal->getData(1);
+		if (val.empty() == false)
+		{
+			valVec.push_back(val);
+			idVec.push_back(objectId);
+		}
+	}
+	delete portal;
+
+	if(valVec.size()==0)
+		return false;
+
+	TeGroupByUniqueValue(valVec, TeINT, result, 0);
+	theme->grouping().groupNumSlices_ = result.size();
+
+	vector<string> colorRamps;
+	colorRamps.push_back("CYAN");
+	colorRamps.push_back("GREEN");
+	colorRamps.push_back("YELLOW");
+	colorRamps.push_back("ORANGE");
+	colorRamps.push_back("RED");
+	vector<TeColor> colorVec;
+	getColors(colorRamps,10, colorVec);
+
+	TeVisual visual;
+	if((layer->geomRep() & TePOLYGONS) || (layer->geomRep() & TeCELLS))
+		visual = *(theme->defaultLegend().visual(TePOLYGONS));
+	else if((layer->geomRep() & TeLINES))
+		visual = *(theme->defaultLegend().visual(TeLINES));
+	else if((layer->geomRep() & TePOINTS))
+		visual = *(theme->defaultLegend().visual(TePOINTS));
+
+	TeLegendEntryVector legVec;
+	unsigned int i, j = 0;
+	for(i = 0; i < result.size(); i++)
+	{
+		TeColor cor = colorVec[i];
+		visual.color(cor);
+
+		TeLegendEntry leg;
+		leg.from(result[i].from_);
+		leg.to(result[i].to_);
+		if((layer->geomRep() & TePOLYGONS) || (layer->geomRep() & TeCELLS))
+			leg.setVisual(visual.copy(), TePOLYGONS);
+		else if((layer->geomRep() & TeLINES))
+			leg.setVisual(visual.copy(), TeLINES);
+		else if((layer->geomRep() & TePOINTS))
+			leg.setVisual(visual.copy(), TePOINTS);
+
+		int count = 0;
+		while(j < valVec.size())
+		{
+			if(valVec[j] == leg.from())
+			{
+				count++;
+				j++;
+			}
+			else
+				break;
+		}
+		leg.count(count);
+		leg.group(i);
+		leg.theme(theme->id());
+		string label = leg.from();
+		leg.label(label);
+		legVec.push_back(leg);
+	}
+
+	colorRamps.clear();
+	colorVec.clear();
+
+	db->deleteLegend(theme->id());
+	map<int, vector<string> > legMap;
+	for(i=j=0; i<legVec.size(); i++)
+	{
+		theme->legend().push_back(legVec[i]);
+		if (db->insertLegend(&(theme->legend()[i])) == false)
+			return false;
+
+		vector<string> ids;
+		TeLegendEntry& leg = theme->legend()[i];
+		while(j < valVec.size())
+		{
+			if(valVec[j] == leg.from())
+			{
+				ids.push_back(idVec[j]);
+				j++;
+			}
+			else
+				break;
+		}
+		legMap[leg.id()] = ids;
+	}
+
+	map<int, vector<string> > :: iterator it = legMap.begin();
+	while(it != legMap.end())
+	{
+		vector<string>::iterator itB = it->second.begin();
+		vector<string>::iterator itE = it->second.end();
+		vector<string> svec = generateInClauses(itB,itE,db);				
+
+		for(i=0; i<svec.size(); i++)
+		{
+			string up = "UPDATE " + theme->collectionTable() + " SET c_legend_id = " + Te2String(it->first);
+			up += " WHERE c_object_id IN " + svec[i];
+
+			if(db->execute(up) == false)
+				return false;
+		}
+		it++;
+	}
+
+	if(theme->legend().size())
+		theme->visibleRep(theme->visibleRep() | 0x40000000);
+	else
+		theme->visibleRep(theme->visibleRep() & 0xbfffffff);
+
+	if((db->updateGrouping (theme->id(), theme->grouping())) == false)
+		return false;
+
+	return(updateAppTheme(db, appTheme));
+}
+
+void changeObjectStatus(ObjectInfo& info, string& uniqueId, string mode, int pointed)
+{
+	if(uniqueId.empty())
+	{
+		if(mode == "pointing")
+			info.status_ ^= 0x1; // toggle least significant bit
+		else if(mode == "shiftAndPointing")
+		{
+			if(pointed == 1)
+				info.status_ |= 0x1; // set least significant bit
+			else
+				info.status_ &= 0x2; // reset least significant bit
+		}
+		return;
+	}
+
+	int& gs = info.uniqueMap_[uniqueId];
+	int	os;
+
+	if(mode == "pointing")
+	{
+		gs ^= 0x1; // toggle least significant bit
+
+		set<int> statusSet;
+		map<string, int>::iterator it = info.uniqueMap_.begin();
+		while(it != info.uniqueMap_.end())
+		{
+			statusSet.insert(it->second);
+			it++;
+		}
+		if(statusSet.find(3) != statusSet.end())
+			os = 3;
+		else if(statusSet.find(2) != statusSet.end() && statusSet.find(1) != statusSet.end())
+			os = 3;
+		else if(statusSet.find(2) != statusSet.end() && statusSet.find(1) == statusSet.end())
+			os = 2;
+		else if(statusSet.find(2) == statusSet.end() && statusSet.find(1) != statusSet.end())
+			os = 1;
+		else
+			os = 0;
+	}
+	else if(mode == "shiftAndPointing")
+	{
+		if(pointed == 1)
+			gs |= 0x1; // set least significant bit
+		else
+			gs &= 0x2; // reset least significant bit
+
+		set<int> statusSet;
+		map<string, int>::iterator it = info.uniqueMap_.begin();
+		while(it != info.uniqueMap_.end())
+		{
+			statusSet.insert(it->second);
+			it++;
+		}
+		if(statusSet.find(3) != statusSet.end())
+			os = 3;
+		else if(statusSet.find(2) != statusSet.end() && statusSet.find(1) != statusSet.end())
+			os = 3;
+		else if(statusSet.find(2) != statusSet.end() && statusSet.find(1) == statusSet.end())
+			os = 2;
+		else if(statusSet.find(2) == statusSet.end() && statusSet.find(1) != statusSet.end())
+			os = 1;
+		else
+			os = 0;
+	}
+
+	info.status_ = os;
+}
+
+bool saveObjectStatus(TeAppTheme *appTheme, set<string>& objectSet, map<string, ObjectInfo>& objectMap)
+{
+	unsigned int i;
+    int os, gs;
+	string	q, oid, uid;
+
+	TeAbstractTheme* theme = appTheme->getTheme();
+	TeDatabase *db = appTheme->getLocalDatabase();
+	string colTable = appTheme->getLocalCollectionTable();
+	
+	map<int, vector<string> > sameObjectStMap;
+	map<int, vector<string> > sameGridStMap;
+
+	set<string>::iterator setIt = objectSet.begin();
+	while(setIt != objectSet.end())
+	{
+		oid = *setIt;
+		ObjectInfo& info = objectMap[oid];
+		os = info.status_;
+		sameObjectStMap[os].push_back(oid);
+
+		map<string, int>& gridMap = info.uniqueMap_;
+		map<string, int>::iterator gridIt = gridMap.begin();
+		while(gridIt != gridMap.end())
+		{
+			uid = gridIt->first;
+			gs = gridIt->second;
+			sameGridStMap[gs].push_back(uid);
+			gridIt++;
+		}
+		setIt++;
+	}
+
+	string qUpdate = "UPDATE " + colTable;
+	map<int, vector<string> >::iterator it;
+	for (it = sameObjectStMap.begin(); it != sameObjectStMap.end(); ++it)
+	{
+		vector<string>::iterator itB = it->second.begin();
+		vector<string>::iterator itE = it->second.end();
+		vector<string> inClauseVector = generateInClauses(itB,itE,db);				
+		for (i = 0; i < inClauseVector.size(); ++i)
+		{
+			q = qUpdate + " SET c_object_status = " + Te2String(it->first);
+			q += " WHERE c_object_id IN " + inClauseVector[i];
+
+			if (db->execute(q) == false)
+				return false;
+		}
+		vector<string> itemVec;
+		theme->setStatus(it->second, itemVec, it->first);
+	}
+
+	qUpdate = "UPDATE " + colTable + "_aux";
+	for (it = sameGridStMap.begin(); it != sameGridStMap.end(); ++it)
+	{
+		vector<string>::iterator itB = it->second.begin();
+		vector<string>::iterator itE = it->second.end();
+		vector<string> inClauseVector = generateInClauses(itB,itE,db, false);				
+		for (i = 0; i < inClauseVector.size(); ++i)
+		{
+			q = qUpdate + " SET grid_status = " + Te2String(it->first);
+			q += " WHERE unique_id IN " + inClauseVector[i];
+
+			if (db->execute(q) == false)
+				return false;
+		}
+		vector<string> objVec;
+		theme->setStatus(objVec, it->second, it->first);
+	}
+
+	return true;
+}
+
+TeStatisticType getStatisticFromString(const string& s)
+{
+	TeStatisticType sType;
+
+	if(s == "TeSUM")
+		sType = TeSUM;
+	else if(s == "TeMAXVALUE")
+		sType = TeMAXVALUE;
+	else if(s == "TeMINVALUE")
+		sType = TeMINVALUE;
+	else if(s == "TeCOUNT")
+		sType = TeCOUNT;
+	else if(s == "TeVALIDCOUNT")
+		sType = TeVALIDCOUNT;
+	else if(s == "TeSTANDARDDEVIATION")
+		sType = TeSTANDARDDEVIATION;
+	else if(s == "TeKERNEL")
+		sType = TeKERNEL;
+	else if(s == "TeMEAN")
+		sType = TeMEAN;
+	else if(s == "TeVARIANCE")
+		sType = TeVARIANCE;
+	else if(s == "TeSKEWNESS")
+		sType = TeSKEWNESS;
+	else if(s == "TeKURTOSIS")
+		sType = TeKURTOSIS;
+	else if(s == "TeAMPLITUDE")
+		sType = TeAMPLITUDE;
+	else if(s == "TeMEDIAN")
+		sType = TeMEDIAN;
+	else if(s == "TeVARCOEFF")
+		sType = TeVARCOEFF;
+	else if(s == "TeMODE")
+		sType = TeMODE;
+	else if(s == "TeVALUE")
+		sType = TeNOSTATISTIC;
+
+	return sType;
+}
+
+void getVisual(TeAppTheme* appTheme, TeGeomRep geomRep,
+			   map<string, TeVisual>& objVisualMap, set<string>& oidSet, bool allObjects)
+{
+	string oid;
+	int status;
+
+	TeLegendEntry* legEntry;
+	TeVisual visual;
+
+	map<string, int>::iterator mapIt;
+	set<string>::iterator setIt;
+
+	TeTheme* theme = (TeTheme*)appTheme->getTheme();
+	TeDatabase* db = theme->layer()->database();
+	map<int, TeLegendEntry*>& legMap = db->legendMap();
+
+	map<string, int>& oidStatusMap = theme->getObjStatusMap();
+	map<string, int>& objLegendMap = theme->getObjLegendMap();
+
+	bool setGroupingVisual = false;
+	if ((theme->grouping().groupMode_ != TeNoGrouping) && (theme->visibleRep() & 0x40000000))
+		setGroupingVisual = true;
+
+	// Get the objects that are not grouped
+	// and set a visual for them
+	set<string> oidNotGroupedSet;
+	if (setGroupingVisual == true && (objLegendMap.size() != theme->getObjects().size()))
+	{
+		oidNotGroupedSet = theme->getObjects();
+		map<string, int>::iterator mapIt;
+		for (mapIt = objLegendMap.begin(); mapIt != objLegendMap.end(); ++mapIt)
+			oidNotGroupedSet.erase(mapIt->first);
+	}
+
+	set<string> oidNullSet;
+	if (allObjects == true)
+	{
+		if (setGroupingVisual == true)
+		{
+			for (mapIt = objLegendMap.begin(); mapIt != objLegendMap.end(); ++mapIt)
+			{
+				oid = mapIt->first;
+				legEntry = legMap[mapIt->second];
+
+				TeGeomRepVisualMap& vm = legEntry->getVisualMap();
+				if(legEntry && vm.find(geomRep) != vm.end())
+					visual = *(legEntry->visual(geomRep));
+
+				objVisualMap[oid] = visual;
+			}
+		}
+		else
+		{
+			for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+			{
+				oid = *setIt;
+				legEntry = &(theme->defaultLegend());
+
+				TeGeomRepVisualMap& vm = legEntry->getVisualMap();
+				if(legEntry && vm.find(geomRep) != vm.end())
+					visual = *(legEntry->visual(geomRep));
+
+				objVisualMap[oid] = visual;
+			}
+
+			map<string, int>& objOwnLegMap = theme->getObjOwnLegendMap();
+			for (mapIt = objOwnLegMap.begin(); mapIt != objOwnLegMap.end(); ++mapIt)
+			{
+				oid = mapIt->first;
+				legEntry = legMap[mapIt->second];
+
+				TeGeomRepVisualMap& vm = legEntry->getVisualMap();
+				if(legEntry && vm.find(geomRep) != vm.end())
+					visual = *(legEntry->visual(geomRep));
+
+				objVisualMap[oid] = visual;
+			}
+		}
+	}
+	else if (allObjects == false)
+	{
+		if (setGroupingVisual == true)
+		{
+			for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+			{
+				oid = *setIt;
+				if (objLegendMap.find(oid) != objLegendMap.end())
+					legEntry = legMap[objLegendMap[oid]];
+				else
+					legEntry = &(theme->defaultLegend());
+
+				TeGeomRepVisualMap& vm = legEntry->getVisualMap();
+				if(legEntry && vm.find(geomRep) != vm.end())
+					visual = *(legEntry->visual(geomRep));
+
+				objVisualMap[oid] = visual;
+
+				if (legEntry->from() == "Missing Data")
+					oidNullSet.insert(oid);
+			}
+		}
+		else
+		{
+			for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+			{
+				oid = *setIt;
+				legEntry = &(theme->defaultLegend());
+
+				TeGeomRepVisualMap& vm = legEntry->getVisualMap();
+				if(legEntry && vm.find(geomRep) != vm.end())
+					visual = *(legEntry->visual(geomRep));
+
+				objVisualMap[oid] = visual;
+			}
+		}
+
+		if (setGroupingVisual == false)
+		{
+			map<string, int>& objOwnLegMap = theme->getObjOwnLegendMap();
+			for (mapIt = objOwnLegMap.begin(); mapIt != objOwnLegMap.end(); ++mapIt)
+			{
+				oid = mapIt->first;
+				legEntry = legMap[mapIt->second];
+
+				TeGeomRepVisualMap& vm = legEntry->getVisualMap();
+				if(legEntry && vm.find(geomRep) != vm.end())
+					visual = *(legEntry->visual(geomRep));
+
+				objVisualMap[oid] = visual;
+			}
+		}
+	}
+
+	// Set the color of the objects according their status
+	map<string, TeVisual>::iterator it;
+	for (it = objVisualMap.begin(); it != objVisualMap.end(); ++it)
+	{
+		oid = it->first;
+		TeVisual& visual = it->second;
+		status = oidStatusMap[oid];
+
+		if (status == 0)
+		{
+//			TeColor cor;
+//			cor = theme->defaultLegend().visual(TePOLYGONS)->color();
+//			visual->color(theme->defaultLegend().visual(TePOLYGONS)->color());
+			oidStatusMap.erase(oid);
+		}
+
+		if(status == 1)
+			visual.color(theme->pointingLegend().visual(TePOLYGONS)->color());
+		else if(status == 2)
+			visual.color(theme->queryLegend().visual(TePOLYGONS)->color());
+		else if(status == 3)
+			visual.color(theme->queryAndPointingLegend().visual(TePOLYGONS)->color());
+
+//		objVisualMap[oid] = visual;
+	}
+
+	if (oidNullSet.empty() == false)
+	{
+		for (setIt = oidNullSet.begin(); setIt != oidNullSet.end(); ++setIt)
+		{
+			oid = *setIt;		
+			status = oidStatusMap[oid];
+			legEntry = &(theme->defaultLegend());
+			TeGeomRepVisualMap& geomRepVisualMap = legEntry->getVisualMap();
+			if(geomRepVisualMap.find(geomRep) != geomRepVisualMap.end())
+				visual = *(legEntry->visual(geomRep));
+
+			objVisualMap[oid] = visual;
+
+			TeVisual& objVisual = objVisualMap[oid];
+			if (status == 0)
+			{
+				oidStatusMap.erase(oid);
+				TeColor color(255, 255, 255);
+				objVisual.color(color);
+			}
+			else if (status == 1)
+				objVisual.color(theme->pointingLegend().visual(TePOLYGONS)->color());
+			else if (status == 2)
+				objVisual.color(theme->queryLegend().visual(TePOLYGONS)->color());
+			else if (status == 3)
+				objVisual.color(theme->queryAndPointingLegend().visual(TePOLYGONS)->color());
+
+//			objVisualMap[oid] = objVisual;
+		}
+	}
+
+	if (oidNotGroupedSet.empty() == false)
+	{
+		for (setIt = oidNotGroupedSet.begin(); setIt != oidNotGroupedSet.end(); ++setIt)
+		{
+			oid = *setIt;		
+			status = oidStatusMap[oid];
+			legEntry = &(theme->defaultLegend());
+			TeGeomRepVisualMap& geomRepVisualMap = legEntry->getVisualMap();
+			if(geomRepVisualMap.find(geomRep) != geomRepVisualMap.end())
+				visual = *(legEntry->visual(geomRep));
+
+			objVisualMap[oid] = visual;
+
+			TeVisual& objVisual = objVisualMap[oid];
+			if (status == 0)
+			{
+				oidStatusMap.erase(oid);
+				TeColor color(0, 0, 0);
+				objVisual.color(color);
+			}
+			else if (status == 1)
+				objVisual.color(theme->pointingLegend().visual(TePOLYGONS)->color());
+			else if (status == 2)
+				objVisual.color(theme->queryLegend().visual(TePOLYGONS)->color());
+			else if (status == 3)
+				objVisual.color(theme->queryAndPointingLegend().visual(TePOLYGONS)->color());
+
+//			objVisualMap[oid] = objVisual;
+		}
+	}
+}
+
+template<> TeCoord2D calculateLabelPosition(const TePolygonSet& geomSet)
+{
+	TePolygon maxPoly = geomSet[0];
+	double maxPolyBxArea = TeGeometryArea(maxPoly.box());
+
+	for(unsigned  int i = 1; i < geomSet.size(); i++) //Finds the polygon with greater area
+	{
+		double polyBxArea = TeGeometryArea(geomSet[i].box());
+		
+		if(polyBxArea > maxPolyBxArea)
+		{
+			maxPoly.clear();
+			maxPoly.copyElements(geomSet[i]);
+			maxPolyBxArea = polyBxArea;
+		}
+	}
+
+	TeCoord2D labelPosition(0, 0); 
+
+	if(maxPoly.empty())
+	{
+		return labelPosition;
+	}
+
+	labelPosition = maxPoly.box().center();
+	
+	if(!TeWithin(labelPosition, maxPoly))
+	{
+		labelPosition = TeFindCentroid(maxPoly);
+	}
+
+	return labelPosition;
+}
+
+bool TeAdjustSegment(TeCoord2D P0, TeCoord2D P1, double d0, TeCoord2D &P0out, TeCoord2D &P1out)
+{
+	
+	double		vL_norm1;
+	double		vL_norm2;
+
+	try
+	{
+		if( P0 == P1 )
+			return false;
+		
+		TeCoord2D vL1( (P1.x() - P0.x()), (P1.y() - P0.y()) );
+		TeCoord2D vL2( -1 * (P1.x() - P0.x()), -1 * (P1.y() - P0.y()) );
+		vL_norm1 = sqrt( vL1.x() * vL1.x() + vL1.y() * vL1.y() );
+		vL_norm2 = sqrt( vL2.x() * vL2.x() + vL2.y() * vL2.y() );
+
+
+		TeCoord2D uL1( ( vL1.x() / vL_norm1 ), ( vL1.y() / vL_norm1 ) );
+		TeCoord2D uL2( ( vL2.x() / vL_norm2 ), ( vL2.y() / vL_norm2 ) );
+		TeCoord2D pFim1 (P0.x() + uL1.x() * d0, P0.y() + uL1.y() * d0);
+		TeCoord2D pFim2 (P0.x() + uL2.x() * d0, P0.y() + uL2.y() * d0);
+
+		if ( TeDistance(pFim1, P1) <= TeDistance(pFim2, P1) )
+			{
+				P0out = P0;
+				P1out = pFim1; 
+			}
+		else
+			{
+				P0out = P0;
+				P1out = pFim2;
+			}
+	}
+	catch(...)
+	{ return (false); }
+
+	return (true);
+}
+
+bool getMiddleLine(TeLine2D line, TeCoord2D &p)
+{
+
+	double		iDistancia;
+	float		fMiddle=0.;
+	float		fSize=0.;
+	int			iCont=0;
+	TeLine2D	lneResult;
+
+
+	iDistancia=TeLength(line);
+	if(iDistancia<=0)
+	{
+		p=line[0];
+		return false;
+	}
+
+	fMiddle=(float)(((float) iDistancia)/2.);
+
+	while(fSize<fMiddle)
+	{
+		lneResult.add(line[iCont]);
+		iCont++;
+		if(lneResult.size()>1)
+			fSize=(float)TeLength(lneResult);
+	}
+
+	if(fSize>fMiddle)
+	{
+		double			dDistance=0;
+		TeCoord2D		coorP1,coorP2;
+
+		dDistance=TeDistance(lneResult[lneResult.size()-2],lneResult[lneResult.size()-1]);
+
+		dDistance-=(fSize-fMiddle);
+
+		TeAdjustSegment(lneResult[lneResult.size()-2],lneResult[lneResult.size()-1],dDistance,coorP1,coorP2);
+		p=coorP2;
+		
+	}
+	else
+		p=lneResult[lneResult.size()-1];
+		
+	return true;
+}
+
+
+template<> TeCoord2D calculateLabelPosition(const TeLine2D& geomSet)
+{
+	TeCoord2D labelPosition = geomSet.box().center();
+
+	getMiddleLine(geomSet, labelPosition);
+
+	return labelPosition;
+}
+
+bool saveCentroidLabel(TeDatabase* db, const TePolygonSet& polys, const std::string& collTable)
+{
+	TeCoord2D labelPosition = calculateLabelPosition(polys);
+
+	std::string sql = "UPDATE " + collTable + " SET label_x=" + Te2String(labelPosition.x()) + ",label_y=" +
+		Te2String(labelPosition.y()) + " WHERE c_object_id=" + "'" +polys[0].objectId() + "'";
+
+	if(!db->execute(sql))
+	{
+		return false;
+	}
+
+	return true;
+}
+
+bool getNextObject(TeDatabasePortal* portal, TePolygonSet& polys, TePolygon& nextPoly)
+{
+	bool hasObjects = true; 
+	TePolygon p;
+
+	if(nextPoly.empty())
+	{
+		hasObjects = portal->fetchGeometry(p);
+		std::string oId = p.objectId();
+	}
+	else
+	{
+		p.copyElements(nextPoly);
+		nextPoly.clear();
+	}
+
+	polys.add(p);
+
+	while(hasObjects) 
+	{
+		TePolygon p2;
+		hasObjects = portal->fetchGeometry(p2);
+
+		if(p2.objectId() != p.objectId())
+		{
+			nextPoly.copyElements(p2);
+			break;
+		}
+
+		polys.add(p2);
+	}
+
+	return hasObjects;
+}
+
+bool generateTextUsingCentroid(TeTheme* theme, const std::string& objectId)
+{
+	string	geomTable;
+	string	collTable = theme->collectionTable();
+	TeLayer* layer = theme->layer();
+	TeDatabase* db = layer->database();
+	
+	if((collTable.empty()) || (!db->tableExist(collTable)))
+		return false;
+
+	if(layer->hasGeometry(TeCELLS)    || 
+	   layer->hasGeometry(TePOLYGONS) ||
+	   layer->hasGeometry(TeLINES))
+	{
+		geomTable = layer->tableName(TeCELLS);
+		
+		if(geomTable.empty())
+		{
+			geomTable = layer->tableName(TePOLYGONS);
+			if(geomTable.empty())
+			{
+				geomTable = layer->tableName(TeLINES);
+
+				if(geomTable.empty())
+				{
+					return false;
+				}
+				else
+				{
+					std::string sql = "SELECT * FROM " + geomTable + "," + collTable + 
+						" WHERE object_id = c_object_id";
+
+					if(!objectId.empty())
+					{
+						sql += " AND objectId='" + objectId + "'";
+					}
+
+					TeDatabasePortal* portal = db->getPortal();
+
+					if((!portal->query(sql)) || (!portal->fetchRow()))
+					{
+						return false;
+					}
+
+					bool hasObjects;
+
+					do
+					{
+						TeLine2D l;
+						hasObjects = portal->fetchGeometry(l);
+						TeCoord2D labelPosition = calculateLabelPosition(l);
+
+						std::string sql = "UPDATE " + collTable + " SET label_x=" + 
+							Te2String(labelPosition.x()) + ",label_y=" + Te2String(labelPosition.y()) + 
+							" WHERE c_object_id=" + "'" +l.objectId() + "'";
+
+						if(!db->execute(sql))
+						{
+							return false;
+						}
+
+					} while(hasObjects);
+
+					portal->freeResult();
+					delete portal;		
+				}
+			}
+			else
+			{
+				std::string sql = "SELECT * FROM " + geomTable + "," + collTable + 
+					" WHERE object_id = c_object_id";
+
+				if(!objectId.empty())
+				{
+					sql += " AND objectId='" + objectId + "'";
+				}
+
+				/*if(!(db->dbmsName() == "OracleSpatial" || db->dbmsName() == "PostGIS"))
+					sql += " ORDER BY object_id ASC, parent_id ASC, num_holes DESC";*/
+				sql += " ORDER BY " + db->getSQLOrderBy(TePOLYGONS);
+
+				TeDatabasePortal* portal = db->getPortal();
+
+				if((!portal->query(sql)) || (!portal->fetchRow()))
+				{
+					return false;
+				}
+
+				bool hasObjects = true; 
+				TePolygon auxP;
+
+				while(hasObjects) 
+				{
+					TePolygonSet polys;
+					hasObjects = getNextObject(portal, polys, auxP);
+					saveCentroidLabel(db, polys, collTable);
+				}
+				
+				if(!auxP.empty())
+				{
+					TePolygonSet polys;
+					polys.add(auxP);
+					saveCentroidLabel(db, polys, collTable);
+				}
+
+				portal->freeResult();
+				delete portal;
+			}
+		}
+		else
+		{
+			string lower_x =  "(((" + geomTable + ".spatial_box[1])[0]))";
+			string lower_y =  "(((" + geomTable + ".spatial_box[1])[1]))";
+			string upper_x =  "(((" + geomTable + ".spatial_box[0])[0]))";
+			string upper_y =  "(((" + geomTable + ".spatial_box[0])[1]))";
+			
+			std::string upd  = " UPDATE " + collTable + " SET ";
+			upd += " label_x = (SELECT MAX(" + lower_x + " + (" + upper_x;
+			upd += " - " + lower_x + ") / 2.0) ";
+			upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+			
+			upd += " label_y = (SELECT MAX(" + lower_y + " + (" + upper_y;
+			upd += " - " + lower_y + ") / 2.0) ";
+			upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+
+			upd += " WHERE (label_x IS NULL) OR (label_y IS NULL)";
+
+			if(!db->execute(upd))
+			{
+				return false;
+			}
+		}
+	}	
+	else if(layer->hasGeometry(TePOINTS))
+	{
+		geomTable = theme->layer()->tableName(TePOINTS);
+	
+		std::string upd  = " UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(x)";
+		upd += " FROM " + geomTable + " WHERE object_id = c_object_id), ";
+
+
+		upd += " label_y = (SELECT MAX(y)";
+		upd += " FROM " + geomTable + " WHERE object_id = c_object_id) ";
+
+		upd += " WHERE (label_x IS NULL) OR (label_y IS NULL)";
+
+		if(!db->execute(upd))
+		{
+			return false;
+		}
+	}
+
+	return true;
+}
+
diff --git a/src/appUtils/TeApplicationUtils.h b/src/appUtils/TeApplicationUtils.h
new file mode 100644
index 0000000..f8d77e6
--- /dev/null
+++ b/src/appUtils/TeApplicationUtils.h
@@ -0,0 +1,644 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeApplicationUtils.h
+    \brief This contains some utilitary functions to deal with TerraLib databases
+*/
+#ifndef  __TERRALIB_INTERNAL_APPLICATIONUTILS_H
+#define  __TERRALIB_INTERNAL_APPLICATIONUTILS_H
+
+#include "TeAppTheme.h"
+#include "TeVisual.h"
+#include "TeDatabase.h"
+#include "TeGeneralizedProxMatrix.h"
+
+#include "TeAppUtilsDefines.h"
+
+#include <string>
+#include <vector>
+#include <set>
+using namespace std;
+
+struct TeKernelParams;
+
+
+struct TLAPPUTILS_DLL ObjectInfo
+{
+	int	status_;						// collection: c_object_status
+	map<string, int> uniqueMap_;	// uniqueId to grid status (collection: grid_status)
+};
+
+/** @defgroup ExtTheme Extended Theme Functions
+    @ingroup  DatabaseUtils
+	A set of functions to manipulate the extension of a Theme as proposed by TerraView application. 
+	It can be used as a model for other TerraLib based applications.
+	\sa TeAppTheme.h
+@{
+*/
+/**	Creates a table to store extra information about the extended Theme
+	\param db			a pointer to a TerraLib database
+	\param integrity	a flag to indicate that the a integrity relation should be created (with Theme)
+	\param tableName	name of the table that persists the extended theme
+*/
+TLAPPUTILS_DLL bool createAppThemeTable(TeDatabase* db, bool integrity=false, const string& tableName="te_theme_application");
+
+/** Populates the extended theme table with default parameters
+	\param db			a pointer to a TerraLib database
+	\param tableName	name of the table that persists the extended theme
+*/
+TLAPPUTILS_DLL bool populateAppThemeTable(TeDatabase* db, const string& tableName="te_theme_application");
+
+
+/** Delete an extended theme
+
+	\param db			a pointer to a TerraLib database
+	\param theme		pointer to a theme to be deleted 
+	\param tableName	name of the table that persists the extended theme
+*/
+TLAPPUTILS_DLL bool deleteAppTheme (TeDatabase* db, TeAbstractTheme* theme, const string& tableName="te_theme_application");
+
+/** @} */ 
+
+/** @defgroup Media Media Persistence
+   @ingroup  DatabaseUtils
+   A set of functions to manipulate the media data persistence model proposed by TerraLib  
+@{
+*/
+/** Creates a table to store multimedia documents 
+	\param db		pointer do a TerraLib database
+	\param tname	name of the table to be created 
+*/
+TLAPPUTILS_DLL bool createMediaTable(TeDatabase* db, const string& tname);
+
+/** Creates a table to store the association between objects of a layer and its multimedia attributes
+	\param db		pointer do a TerraLib database
+	\param layerId	identifier of the layer that will contain the media
+	\param tname	name of the table to be created 
+*/
+TLAPPUTILS_DLL bool createLayerMediaTable(TeDatabase* db, int layerId, const string& tname);
+
+/** Inserts a new media file in a database
+	\param db			pointer do a TerraLib database
+	\param tableName	identifier of the layer that will contain the media
+	\param fileName		name of the file that contains the media 
+	\param description	description of the media
+	\param type			type of the media
+	\param blob			flag to indicate that the media should be turned to a blob in the databse
+*/
+TLAPPUTILS_DLL bool insertMedia(TeDatabase* db, const string& tableName, string& fileName, const string& description, const string& type, bool blob=true);
+
+/** Associates a media data to an object of a layer
+	\param db			pointer do a TerraLib database
+	\param layer		layer that contains the object
+	\param objectId		identifier of the object 
+	\param mediaName	name of the media
+	\param mediaTable	name of the table tha contains the media
+*/
+TLAPPUTILS_DLL bool insertMediaObjLayer (TeDatabase* db, TeLayer* layer, const string& objectId, const string& mediaName, const string& mediaTable);
+
+/** Sets a media as a default media of an object of a layer
+	\param db			pointer do a TerraLib database
+	\param layer		layer that contains the object
+	\param objectId		identifier of the object 
+	\param mediaName	name of the media
+	\param mediaTable	name of the table tha contains the media
+*/
+TLAPPUTILS_DLL bool setDefaultMedia(TeDatabase* db, TeLayer* layer, const string& objectId, const string& mediaName, const string& mediaTable);
+
+/** Updates a media description in a database
+	\param db			pointer do a TerraLib database
+	\param mediaName	name of the media
+	\param mediaTable	name of the table tha contains the media
+	\param desc			description of the media
+*/
+TLAPPUTILS_DLL bool updateMediaDescription(TeDatabase* db, const string& mediaName, const string& mediaTable, const string& desc);
+
+//! Inserts a new general information of a layer or database
+/*
+	\param db			pointer do a TerraLib database
+	\param layerId		if < 0 it is database information, else it is layer information
+	\param tableName	table name
+	\param fileName		name of the file that contains the media information
+	\param type			file type. It can be ".TXT", ".DOC", ".MP3", etc. If URL it should be ".URL"
+*/
+TLAPPUTILS_DLL bool insertInfo2Blob(TeDatabase* db, int layerId, const string& tableName,  const string& fileName,  const string& type);
+
+//! read blob and copy to temporary file
+/*
+	\param db			pointer do a TerraLib database
+	\param layerId		if < 0 it is database information, else it is layer information
+	\param tableName	table name
+	\param type			file type. It can be ".TXT", ".DOC", ".MP3", etc. If URL it should be ".URL"
+	\return the temporary file that contains the blob
+*/
+TLAPPUTILS_DLL string getInfoBlob2TemporaryFile(TeDatabase* db, int layerId, const string& tableName, string& type);
+/** @} */ 
+
+/** @defgroup PBCharts Pie/Bar Charts
+  @ingroup  DatabaseUtils
+  A set of functions to manipulate the charts (pie and/or bar) persistence model used by TerraView application.
+  It can be used as a model for other TerraLib based applications.
+  @{
+ */
+/** Creates a table to store the parameters of bar/pie charts 
+	\param db			pointer do a TerraLib database
+	\param integrity	flag to indicate a integrity relation (with the theme) should be created 
+*/
+TLAPPUTILS_DLL bool createChartParamsTable(TeDatabase* db, bool integrity=false);
+
+/** Updates the color associated to a selection mode for a theme
+	\param db		pointer do a TerraLib database
+	\param themeId	theme extended identifier
+	\param sel		selection mode
+	\param color	color definition
+*/
+TLAPPUTILS_DLL bool updateGridColor(TeDatabase* db, int themeId, TeObjectSelectionMode sel, TeColor& color);
+/** @} */ 
+
+/** @defgroup Kernel Map Kernel Metadata Functions
+    @ingroup  DatabaseUtils
+ *  A set of functions to persist in a TerraLib database the metadata associated to Kernel Map algorithm.
+ *	\sa TeKernelParams.h
+ *  @{
+ */
+/** Creates a table to store information about the results of the Kernel map algorithm
+	\param db pointer do a TerraLib database
+*/
+TLAPPUTILS_DLL bool createKernelMetadataTable(TeDatabase* db);
+
+/** Saves the parameters associated to the execution of a Kernel Map algorithm in a TerraLib database
+	\param db			pointer do a TerraLib database
+	\param kernelPar	reference to a structure of parameters associated to a Kernel Map 
+*/
+TLAPPUTILS_DLL bool insertKernelMetadata(TeDatabase* db, TeKernelParams& kernelPar);
+
+/** Updates in the database the parameters associated to the execution of a Kernel Map  -- inserts if it does not exist
+	\param db			pointer do a TerraLib database
+	\param kernelPar	reference to a structure of parameters associated to a Kernel Map 
+*/
+TLAPPUTILS_DLL bool updateKernelMetadata(TeDatabase* db, TeKernelParams& kernelPar);
+
+/** Loads some stored Kernel parameters associated to a theme used as the support to the Kernel Map
+	\param db			pointer do a TerraLib database
+	\param supThemeId	identifier of the theme that has the support to the Kernel Map
+	\param supTableName	name of the attribute table has stores the Kernel result
+	\param supAttrName	name of the column table has stores the Kernel result
+	\param KernelPar	reference to a structure of parameters associated to a Kernel Map	
+*/
+TLAPPUTILS_DLL bool loadKernelParams (TeDatabase* db, int supThemeId, const string& supTableName, const string& supAttrName, TeKernelParams& KernelPar);
+
+/** Loads some stored Kernel parameters associated to a layer 
+	\param db			pointer do a TerraLib database
+	\param LayerId		identifier layer
+	\param KernelPar	reference to a structure of parameters associated to a Kernel Map	
+*/
+TLAPPUTILS_DLL bool loadKernelParams (TeDatabase* db, int LayerId, TeKernelParams& KernelPar);
+/** @} */ 
+
+/** @defgroup Metadata Layer and Attribute table metadata
+    @ingroup  DatabaseUtils
+    A set of functions to persist application dependent metadata about layers and attribute tables
+  @{
+ */
+/** Creates a table to store some information about a layer layers 
+	The table is called te_layer_metadata and has the attributes: [layer_id, name, author, source, description, date_, hour_, transf]
+	\param db	pointer do a TerraLib database
+*/
+TLAPPUTILS_DLL int createTeLayerMetadata(TeDatabase* db);
+
+/** Creates a table to store metadata about attribute tables 
+	The table is called te_table_metadata and has the attributes: [table_id, name, author, source, quality, description, date_, hour_, transf]
+	\param db	pointer do a TerraLib database
+*/
+TLAPPUTILS_DLL int createTeTableMetadata(TeDatabase* db);
+/** @} */ 
+
+
+/** Removes tables that contains the visual of texts associated to a layer
+	\param layer	pointer do a TerraLib layer
+*/
+TLAPPUTILS_DLL bool deleteTextVisual(TeLayer* layer);
+
+
+/** Delete the objects of a layer that are pointed in a theme
+	\param theme	pointer to the extended theme were the objects are pointed
+	\param box		to return the bounding box that contains the objects that were deleted
+	\return the error message of the database when the function fails
+*/
+TLAPPUTILS_DLL string deletePointedObjects(TeTheme* theme, TeBox& box);
+
+/** Inserts a new object into a theme
+	\param theme	pointer to a theme (the object is already in the layer)
+	\param p		labels position location
+	\param newId	the identifier of the object
+	\param newTId	the identifier of the instance of the object (for temporal objects)
+*/
+TLAPPUTILS_DLL string insertObjectIntoCollection(TeTheme* theme, TeCoord2D p, string newId, string newTId = "");
+/** @} */ 
+
+/** @defgroup GPM Generalized Proximity Matrix
+    @ingroup  DatabaseUtils
+    Functions to persist a generalized proximity matrix
+	\sa TeGeneralizedProxMatrix
+ *  @{
+*/
+/** Creates a table to store information about the generalized proximity matrix
+	\param db			pointer do a TerraLib database
+	\param integrity	flag to indicate a integrity relation (with the theme) should be created 
+*/
+TLAPPUTILS_DLL bool createGPMMetadataTable(TeDatabase* db, const bool& integrity=true);
+
+/** Creates a table to store information about the neighbourhood of a the objects selected in a theme
+	\param db			pointer do a TerraLib database
+	\param tableName	name of the table 
+*/
+TLAPPUTILS_DLL bool createNeighbourhoodTable(TeDatabase* db, const string& tableName);
+
+/** Persists a generalized proximity matrix in a TerraLib database
+	\param db	pointer do a TerraLib database
+	\param gpm	a proximity matrix
+	\param objs	vector with the identifier of the objects in the matrix
+*/
+template<typename set> 
+bool insertGPM(TeDatabase* db, TeGeneralizedProxMatrix<set>* gpm, vector<string>& objs);
+
+/** Loads from the database the dafault GPM associated to a theme
+	\param db		pointer do a TerraLib database
+	\param themeId	identification of the theme
+	\param gpm		a structure of a GPM in memory
+*/
+template<typename set> 
+bool loadDefaultGPM(TeDatabase* db, const int& themeId, TeGeneralizedProxMatrix<set>* &gpm);
+
+/** Delete all generalized proximity matrix of a theme (neighbourhoodTable and metadata) or only the gpm with a specific id (gpmId)
+	\param db		pointer do a TerraLib database
+	\param themeId	identification of the theme
+	\param gpmId	GPM identifier
+*/
+TLAPPUTILS_DLL bool deleteGPMTable(TeDatabase* db, const int& themeId, const int& gpmId=-1);
+/** @} */ 
+
+/** @} */ // end of group  DatabaseUtils
+
+
+/** Loads the parameters of an extended theme
+	\param db			a pointer to a TerraLib database
+	\param theme		pointer to an instance of an extended theme
+	\param tableName	name of the table that persists the extended theme
+*/
+TLAPPUTILS_DLL bool loadAppTheme (TeDatabase* db, TeAppTheme *theme, const string& tableName="te_theme_application");
+
+/** Saves the parameters of an extended theme 
+	\param db			a pointer to a TerraLib database
+	\param theme		pointer to an instance of an extended theme
+	\param tableName	name of the table that persists the extended theme 
+*/
+TLAPPUTILS_DLL bool insertAppTheme (TeDatabase* db, TeAppTheme *theme, const string& tableName="te_theme_application");
+
+/** Updates the parameters of an extended theme
+	\param db			a pointer to a TerraLib database
+	\param theme		pointer to an instance of an extended theme
+	\param tableName	name of the table that persists the extended theme 
+*/
+TLAPPUTILS_DLL bool updateAppTheme (TeDatabase* db, TeAppTheme *theme, const string& tableName="te_theme_application");
+
+/** Saves in the database the color parameters associated to a theme
+	\param db			pointer do a TerraLib database
+	\param theme	pointer to a theme as defined by TerraView
+*/
+TLAPPUTILS_DLL bool insertChartParams(TeDatabase* db, TeAppTheme *theme);
+
+/** Deletes the chart parameters of a theme in the database
+	\param db			pointer do a TerraLib database
+	\param theme	pointer to a theme as defined by TerraView
+*/
+TLAPPUTILS_DLL bool deleteChartParams (TeDatabase* db, TeAppTheme *theme);
+
+/** Verifies if there is a pie/bar char around a given location, for a given theme and select it
+	\param db		pointer do a TerraLib database
+	\param theme	pointer to a theme as defined by TerraView
+	\param pt		a location 
+	\param delta	a tolerance around the location
+*/
+TLAPPUTILS_DLL bool locatePieBar (TeDatabase* db, TeAppTheme* theme, TeCoord2D pt, double delta);
+
+/** Loads the charts parameters associated to a theme
+	\param db		pointer do a TerraLib database
+	\param theme	pointer to a theme as defined by TerraView
+*/
+TLAPPUTILS_DLL bool loadChartParams (TeDatabase* db, TeAppTheme *theme);
+
+/** Updates the location of the selected pie/bar chart of a theme
+	\param db		pointer do a TerraLib database
+	\param theme	pointer to a theme as defined by TerraView
+	\param pt		the new location for the chart
+*/
+TLAPPUTILS_DLL bool updatePieBarLocation (TeDatabase* db, TeAppTheme* theme, TeCoord2D pt);
+
+/** Updates the location of selected object of an extended theme with TePoint geometry
+	\param db		pointer do a TerraLib database
+	\param theme	pointer to an extended theme
+	\param pt		new location of the point
+*/
+TLAPPUTILS_DLL bool updatePointLocation (TeDatabase* db, TeAppTheme* theme, TeCoord2D pt);
+
+
+//! generate Count legends 
+TLAPPUTILS_DLL bool generateCountLegends(TeAppTheme* theme, string table, string field);
+
+TLAPPUTILS_DLL void changeObjectStatus(ObjectInfo& info, string& uniqueId, string mode, int pointed = 1);
+
+TLAPPUTILS_DLL bool saveObjectStatus(TeAppTheme *theme, set<string>& objectSet, map<string, ObjectInfo>& objectMap);
+
+TLAPPUTILS_DLL TeStatisticType getStatisticFromString(const string& s);
+
+
+TLAPPUTILS_DLL void getVisual(TeAppTheme* theme, TeGeomRep geomRep,
+			   map<string, TeVisual>& objVisualMap, set<string>& oidSet, bool allObjects);
+
+
+// Implementation of the template functions
+template<typename set>
+bool insertGPM(TeDatabase* db, TeGeneralizedProxMatrix<set>* gpm, vector<string>& objs)
+{
+	if(!db)
+		return false; 
+
+	TeProxMatrixConstructionParams* cParams = gpm->getConstructionParams();
+	TeProxMatrixSlicingParams*	sParams = gpm->getSlicingParams();
+	TeProxMatrixWeightsParams*   wParams = gpm->getWeightsParams();
+
+	if((!cParams) || (!sParams) || (!wParams))
+		return false;
+		
+	//update todas as gpms desse tema para default igual a zero
+	string up =  " UPDATE te_gpm SET gpm_default = 0 WHERE theme_id1 = "+ Te2String(cParams->theme_id1_);
+	db->execute (up);
+
+	// ----- progress bar
+	int step = 0;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(objs.size());
+	// -----
+	
+	//insere na tabela de metadados 
+	string ins = " INSERT INTO te_gpm (gpm_default, theme_id1, geom_rep1, theme_id2, ";
+	ins += " geom_rep2, neighbours_table, construction_date, construction_strategy, ";
+	ins += " const_max_distance, const_num_neighbours, const_max_net_distance, ";
+	ins += " const_max_con_distance, slicing_strategy, slicing_zone_dist, ";
+	ins += " slicing_zone_local, weight_strategy, weight_norm, weight_a, ";
+	ins += " weight_b, weight_c, weight_factor, weight_dist_raio, weigth_max_local_dist ) ";
+	ins += " VALUES ( ";
+	ins += " 1 ";
+	ins += ", "+ Te2String(cParams->theme_id1_);
+	ins += ", "+ Te2String((int)cParams->geom_rep1_);
+	
+	if(cParams->theme_id2_<0)
+		ins += ", NULL ";
+	else
+        ins += ", "+ Te2String(cParams->theme_id2_);
+	
+	ins += ", "+ Te2String((int)cParams->geom_rep2_);
+	ins += ", '"+ gpm->neighbourhood_table_ +"'";
+	ins += ", NULL ";
+	ins += ", "+ Te2String((int)cParams->strategy_); 
+	ins += ", "+ Te2String(cParams->max_distance_, 8);
+	ins += ", "+ Te2String(cParams->num_neighbours_);
+	ins += ", "+ Te2String(cParams->max_net_distance_, 8);
+	ins += ", "+ Te2String(cParams->max_connection_distance_, 8);
+	ins += ", "+ Te2String((int)sParams->strategy_); 
+	ins += ", "+ Te2String(sParams->zone_dist_, 8);
+	ins += ", "+ Te2String((int)sParams->zone_local_);
+	ins += ", "+ Te2String((int)wParams->strategy_);
+	ins += ", "+ Te2String((int)wParams->norm_);
+	ins += ", "+ Te2String(wParams->a_, 8);
+	ins += ", "+ Te2String(wParams->b_, 8);
+	ins += ", "+ Te2String(wParams->c_, 8);
+	ins += ", "+ Te2String(wParams->factor_, 8);
+	ins += ", "+ Te2String(wParams->dist_ratio_, 8);
+	ins += ", "+ Te2String(wParams->max_local_dist_, 8);
+	ins += " )";
+
+	if(!db->execute (ins))
+	{
+		if (TeProgress::instance())
+			TeProgress::instance()->reset();
+		return false;
+	}
+
+	//insere na tabela de vizinhos
+	ins = " INSERT INTO "+ gpm->neighbourhood_table_;
+	ins += " (object_id1, object_id2, centroid_distance, weight, ";
+	ins += " slice, order_neig, borders_length, net_objects_distance, ";
+	ins += " net_minimum_path ) VALUES ( ";
+
+	vector<string>::iterator it = objs.begin(); 
+	while(it != objs.end())
+	{
+		string objId1 = (*it);
+
+		//get the neighbours
+		TeNeighboursMap neigs = gpm->getMapNeighbours(objId1);
+		TeNeighboursMap::iterator itNeig = neigs.begin();
+		while(itNeig != neigs.end())
+		{
+			string objId2 = itNeig->first;
+			TeProxMatrixAttributes attributes = itNeig->second;
+			//sql
+			string sql = "'"+ objId1 +"'";
+			sql += ", '"+ objId2 +"'";
+			sql += ", "+ Te2String(attributes.CentroidDistance(), 8);
+			sql += ", "+ Te2String(attributes.Weight(), 8);
+			sql += ", "+ Te2String(attributes.Slice());
+			sql += ", "+ Te2String(attributes.Order());
+			sql += ", "+ Te2String(attributes.BorderLength(), 8);
+			sql += ", "+ Te2String(attributes.NetworkObjectsDistance(), 8);
+			sql += ", "+ Te2String(attributes.NetworkMinimumPath(), 8);
+			sql += " )";
+
+			if(!db->execute(ins + sql))
+			{
+				if (TeProgress::instance())
+					TeProgress::instance()->reset();
+				return false;
+			}
+			++itNeig;
+		}
+
+		//progress bar
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}	
+		++step;
+		++it;
+	}
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+template<typename set>
+bool loadDefaultGPM(TeDatabase* db, const int& themeId, TeGeneralizedProxMatrix<set>* &gpm)
+{
+	if(!db)
+		return false;
+
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+
+	//load the table name
+	string sql = " SELECT gpm_id, neighbours_table, weight_strategy, weight_norm, ";
+	sql += " weight_a, weight_b, weight_c, weight_factor, weight_dist_raio, ";
+	sql += " weigth_max_local_dist FROM te_gpm ";
+	sql += " WHERE theme_id1 = "+ Te2String(themeId) +" AND gpm_default = 1";
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	string table = portal->getData(1);
+	int gpmId = portal->getInt(0);
+	int weightStrategy = portal->getInt(2); 
+
+	//load weight strategy
+	TeProxMatrixWeightsStrategy* ws = 0;
+	if((TeGPMWeightsStrategy)weightStrategy==TeNoWeightsStrategy)
+		ws = new TeProxMatrixNoWeightsStrategy((bool)portal->getInt(3));
+
+	else if((TeGPMWeightsStrategy)weightStrategy==TeInverseDistanceStrategy)
+		ws = new TeProxMatrixInverseDistanceStrategy (portal->getDouble(4), portal->getDouble(5), 
+				portal->getDouble(6), portal->getDouble(7), (bool)portal->getInt(3));
+
+	else if((TeGPMWeightsStrategy)weightStrategy==TeSquaredInverseDistStrategy)
+		ws = new TeProxMatrixSquaredInverseDistanceStrategy (portal->getDouble(4), portal->getDouble(5), 
+				portal->getDouble(6), portal->getDouble(7), (bool)portal->getInt(3));
+
+	else if((TeGPMWeightsStrategy)weightStrategy==TeConnectionStrenghtStrategy)
+		ws = new TeProxMatrixConnectionStrenghtStrategy(portal->getDouble(8), portal->getDouble(9), 
+				portal->getDouble(7),(bool)portal->getInt(3));
+
+	portal->freeResult();
+
+	sql= " SELECT count(*) FROM "+ table;
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	int numSteps = atoi(portal->getData(0));
+	int step = 0;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(numSteps);
+	
+	portal->freeResult();
+
+	sql= " SELECT object_id1, object_id2, centroid_distance, weight, ";
+	sql += " slice, order_neig, borders_length, net_objects_distance, ";
+	sql += " net_minimum_path FROM "+ table;
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	TeProxMatrixImplementation* impl = TeProxMatrixAbstractFactory::MakeConcreteImplementation();
+	while(portal->fetchRow())
+	{
+		TeProxMatrixAttributes attr(portal->getDouble(3), portal->getInt(4), 
+			portal->getInt(5),  portal->getDouble(2), portal->getDouble(6), 
+			portal->getDouble(7), portal->getDouble(8));
+		
+		impl->connectObjects (string(portal->getData(0)), string(portal->getData(1)), attr);
+
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				delete portal;
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}	
+		++step;
+	}
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	gpm = new TeGeneralizedProxMatrix<set>(gpmId, table, impl, ws);
+
+	delete portal;
+	return true;
+}
+
+template<typename T1>
+TeCoord2D calculateLabelPosition(const T1& geomSet)
+{
+	return TeCoord2D(0., 0.);
+};
+
+template<> TeCoord2D calculateLabelPosition(const TePolygonSet& geomSet);
+
+template<> TeCoord2D calculateLabelPosition(const TeLine2D& geomSet);
+
+/** @brief
+ */
+TLAPPUTILS_DLL bool getNextObject(TeDatabasePortal* portal, TePolygonSet& polys, TePolygon& nextPoly);
+
+/** @brief This function generates the position of text labels.
+ * 
+ * It calculates the label position using the center of geometry box. This coordinate is calculated
+ * as follows:
+ * <ul>
+ *   <li> If the geometry is a polygon, the label is located at the polygon box center. If this coordinate
+ *	isn't within the polygon, recalcultates coordinate. The new label position will be the polygon centroid.
+ *   </li>
+ *   <li> If the polygon has islands, the label position will be located within the polygon with greater
+ *  area.
+ *   </li>
+ *   <li> If the geometry is a line, the label is located ate the line box center. If this coordinate isn't
+ * located at the line, recalculates the coordinate. The new label position will be the center point of the line.
+ *   </li>
+ *   <li> If the geometry is a point, the label will be the point. </li>
+ * </ul>
+ *
+ * @param theme The theme to generate labels positions.
+ * @param objectId Object identifier. This parameter is used, if the label position must be generated for
+ * a particular object.
+ * @return True if everything is ok, false if something fails.
+ */
+TLAPPUTILS_DLL bool generateTextUsingCentroid(TeTheme* theme, const std::string& objectId = "");
+
+#endif
+
+
+
diff --git a/src/appUtils/TePlotTheme.h b/src/appUtils/TePlotTheme.h
new file mode 100644
index 0000000..39af133
--- /dev/null
+++ b/src/appUtils/TePlotTheme.h
@@ -0,0 +1,2680 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TePlotTheme.h
+    \brief This file contains support to plot a theme on a canvas
+*/
+#ifndef  __TERRALIB_INTERNAL_PLOTTHEME_H
+#define  __TERRALIB_INTERNAL_PLOTTHEME_H
+
+#include "TeAppTheme.h"
+#include "TeExternalTheme.h"
+#include "TeDatabase.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeVectorRemap.h"
+#include "TeDecoderMemory.h"
+#include <time.h>
+#include <set>
+#include "TeApplicationUtils.h"
+#include <TeDatabaseUtils.h>
+
+#include <TeThemeFunctions.h>
+#include <PluginsSignal.h>
+
+template<class Canvas, class Progress>
+void TePlotTextWV(TeAppTheme* appTheme, Canvas* canvas, Progress * progress, TeBox box = TeBox())
+{
+	TeAbstractTheme* theme = appTheme->getTheme();
+
+	if(theme->minScale() != 0 && theme->maxScale() != 0 && theme->minScale() > theme->maxScale())
+	{
+		if(theme->minScale() < canvas->scaleApx() || theme->maxScale() > canvas->scaleApx())
+			return;
+	}
+	if ((theme->visibleRep() & TeTEXT) == 0)
+		return;
+
+	if(appTheme->textTable().empty())
+		return;
+
+	TeDatabase* db = appTheme->getLocalDatabase();
+
+	if(!db || !db->tableExist(appTheme->textTable()))
+		return;
+	canvas->setDataProjection(theme->getThemeProjection());
+	TeDatabasePortal* plot = db->getPortal();
+
+	string	tabtx = appTheme->textTable();
+	string	tabs = appTheme->getLocalCollectionTable();
+
+	string wherebox;
+	if(box.isValid())
+	{
+		wherebox = "NOT (x >= " + Te2String(box.x2()+4*box.width());
+		wherebox += " OR y >= " + Te2String(box.y2()+2*box.height());
+		wherebox += " OR x <= " + Te2String(box.x1()-4*box.width());
+		wherebox += " OR y <= " + Te2String(box.y1()-2*box.height()) + ")";
+	}
+	else
+	{
+		wherebox = getWhereBox(plot, appTheme, canvas, TeTEXT, box);
+		if(wherebox.empty())
+		{
+			TeBox box = canvas->getDataWorld();
+			wherebox = " x >= " + Te2String(box.x1());
+			wherebox += " AND x <= " + Te2String(box.x2());
+			wherebox += " AND y >= " + Te2String(box.y1());
+			wherebox += " AND y <= " + Te2String(box.y2());
+		}
+	}
+
+	// calculate initial filed number for collection and legenda (sind and vind)
+	int sind=0, vind=0;
+	string ind = "SELECT * FROM " + tabtx + " WHERE object_id < ' '";
+	plot->freeResult();
+	if (plot->query (ind))
+		sind = plot->getAttributeList().size();
+
+	ind = "SELECT * FROM " + tabs + " WHERE c_object_id < ' '";
+	plot->freeResult();
+	if (plot->query (ind))
+		vind = plot->getAttributeList().size() + sind;
+
+	int numrows = 0;
+	string conta = "SELECT COUNT(*) FROM " + tabs;
+	plot->freeResult();
+	if (plot->query (conta))
+	{
+		if(plot->fetchRow())
+			numrows = atoi(plot->getData(0));
+	}
+	delete plot;
+
+	string tabv = tabtx + "_txvisual";
+	string sa = "SELECT " + tabtx + ".*, " + tabv + ".*, " + tabs + ".* ";
+	sa += "FROM " + tabtx + ", " + tabv + ", " + tabs;
+	sa += " WHERE (" + tabs + ".c_object_id = " + tabtx + ".object_id";
+	sa += " AND " + tabtx + ".geom_id = " + tabv + ".geom_id)";
+	string squery;
+	squery = sa + " AND (" + wherebox + ")";
+	plotTextWV(appTheme, canvas, squery, progress);
+
+	string othersQuery = "SELECT " + tabtx + ".*, " + tabv + ".* ";
+	othersQuery += "FROM " + tabtx + ", " + tabv;
+	othersQuery += " WHERE " + tabtx + ".geom_id = " + tabv + ".geom_id";
+	othersQuery += " AND " + tabtx + ".object_id = 'TE_NONE_ID'";
+	plotTextWV(appTheme, canvas, othersQuery, progress);
+}
+
+template<class Canvas, class Progress>
+void plotTextWV(TeAppTheme *appTheme, Canvas *canvas, string query, Progress *progress)
+{
+	TeText	text;
+	int	np = 0;
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+
+	TeAbstractTheme* theme = appTheme->getTheme();
+	TeDatabase* db = appTheme->getLocalDatabase();
+	if(!db)
+		return;
+
+	TeDatabasePortal* plot = db->getPortal();
+	
+	if(progress == 0)
+	{
+		if(plot->query(query) && plot->fetchRow())
+		{
+			t1 = clock();
+			t2 = t1;
+			bool flag = true;
+			do
+			{
+				bool bold = false, italic = false;
+				int	size;
+				int dot_height = atoi(plot->getData(10));
+				bool fixedSize = atoi(plot->getData(11));
+				int rgb = atoi(plot->getData(12));
+				TeColor	cor((rgb >> 16) & 0xff, (rgb >> 8) & 0xff, rgb & 0xff);
+				string	family = plot->getData(13);
+				if(atoi(plot->getData(14)))
+					bold = true;
+				if(atoi(plot->getData(15)))
+					italic = true;
+
+				flag = plot->fetchGeometry(text);
+				if(fixedSize == false && text.height() > 0.)
+				{
+					TeBox wbox = canvas->getDataWorld();
+					TeCoord2D p1(wbox.x1_, wbox.y1_);
+					TeCoord2D p2(p1.x() + text.height(), p1.y() + text.height());
+					TeBox box(p1, p2);
+					canvas->mapDWtoV(box);
+					size = int(box.height());
+				}
+				else
+					size = dot_height;
+
+				canvas->setTextColor(cor.red_, cor.green_, cor.blue_);
+				canvas->setTextStyle (family, size, bold, italic );
+				TeVisual visual;
+				visual.size(size);
+				visual.family(family);
+				visual.bold(bold);
+				visual.italic(italic);
+				visual.fixedSize(fixedSize);
+				visual.ptAngle((int)text.angle());
+
+				canvas->plotText (text, visual);
+				np++;
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					canvas->copyPixmapToWindow();
+				}
+			} while (flag);
+			canvas->copyPixmapToWindow();
+		}
+	}
+	else
+	{
+		int steps = 0;
+		string conta = query;
+		int ff;
+		if((ff=conta.find(" FROM ")) >= 0)
+			conta.replace(0, ff, "SELECT COUNT(*)");
+		if((ff=conta.find("ORDER BY")) >= 0)
+			conta = conta.substr(0, ff);
+		plot->freeResult();
+		if(plot->query(conta) && plot->fetchRow())
+			steps = atoi(plot->getData(0));
+
+		plot->freeResult();
+		if(plot->query(query) && plot->fetchRow())
+		{
+			string caption = "Plotando tema: " + theme->name();
+			progress->setCaption(caption.c_str());
+			progress->setLabelText("      Plotagem de textos em andamento, aguarde...      ");
+			progress->setTotalSteps(steps);
+			t2 = clock();
+			t0 = t1 = t2;
+			bool flag = true;
+			do
+			{
+				bool bold = false, italic = false;
+				int	size;
+				int dot_height = atoi(plot->getData(10));
+				bool fixedSize = atoi(plot->getData(11));
+				int rgb = atoi(plot->getData(12));
+				TeColor	cor((rgb >> 16) & 0xff, (rgb >> 8) & 0xff, rgb & 0xff);
+				string	family = plot->getData(13);
+				if(atoi(plot->getData(14)))
+					bold = true;
+				if(atoi(plot->getData(15)))
+					italic = true;
+
+				flag = plot->fetchGeometry(text);
+				if(fixedSize == false && text.height() > 0.)
+				{
+					TeBox wbox = canvas->getDataWorld();
+					TeCoord2D p1(wbox.x1_, wbox.y1_);
+					TeCoord2D p2(p1.x() + text.height(), p1.y() + text.height());
+					TeBox box(p1, p2);
+					canvas->mapDWtoV(box);
+					size = int(box.height());
+					size = (int)((double)size / canvas->printerFactor() +.5);
+				}
+				else
+					size = dot_height;
+
+				canvas->setTextColor(cor.red_, cor.green_, cor.blue_);
+				canvas->setTextStyle (family, size, bold, italic );
+				TeVisual visual;
+				visual.size(size);
+				visual.family(family);
+				visual.bold(bold);
+				visual.italic(italic);
+				visual.fixedSize(fixedSize);
+				visual.ptAngle((int)text.angle());
+
+				canvas->plotText (text, visual);
+				np++;
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					canvas->copyPixmapToWindow();
+					if(progress->wasCancelled())
+					{
+						progress->reset();
+						break;
+					}
+					if((int)(t2-t0) > dt2)
+						progress->setProgress(np);
+				}
+			} while (flag);
+			canvas->copyPixmapToWindow();
+		}
+		progress->reset();
+	}
+	delete plot;
+}
+
+template<class Canvas, class Progress>
+void TePlotTexts(TeAppTheme* appTheme, Canvas* canvas, Progress * progress)
+{
+	TeTheme* theme = appTheme->getTheme();
+	TeDatabase* db = appTheme->getLocalDatabase(); 
+	if(!db)
+		return;
+	
+	if(theme->minScale() != 0 && theme->maxScale() != 0 && theme->minScale() > theme->maxScale())
+	{
+		if(theme->minScale() < canvas->scaleApx() || theme->maxScale() > canvas->scaleApx())
+			return;
+	}
+	if ((theme->visibleRep() & TeTEXT) == 0)
+		return;
+
+	if(appTheme->textTable().empty())
+		return;
+	
+	if(db->tableExist(appTheme->textTable()) == false)
+		return;
+	canvas->setDataProjection (theme->layer()->projection());
+	TeDatabasePortal* plot = db->getPortal();
+
+	string	tabtx = appTheme->textTable();
+	string	tabs = appTheme->getLocalCollectionTable(); 
+	if(tabs.empty())
+		return false;
+
+	string wherebox = getWhereBox(plot, theme, canvas, TeTEXT);
+	if(wherebox.empty())
+	{
+		TeBox box = canvas->getDataWorld();
+		wherebox = " x >= " + Te2String(box.x1());
+		wherebox += " AND x <= " + Te2String(box.x2());
+		wherebox += " AND y >= " + Te2String(box.y1());
+		wherebox += " AND y <= " + Te2String(box.y2());
+	}
+
+	// calculate initial filed number for collection and legenda (sind and vind)
+	int sind=0, vind=0;
+	string ind = "SELECT * FROM " + tabtx + " WHERE object_id < ' '";
+	plot->freeResult();
+	if (plot->query (ind))
+		sind = plot->getAttributeList().size();
+
+	ind = "SELECT * FROM " + tabs + " WHERE c_object_id < ' '";
+	plot->freeResult();
+	if (plot->query (ind))
+		vind = plot->getAttributeList().size() + sind;
+
+	int numrows = 0;
+	string conta = "SELECT COUNT(*) FROM " + tabs;
+	plot->freeResult();
+	if (plot->query (conta))
+	{
+		if(plot->fetchRow())
+			numrows = atoi(plot->getData(0));
+	}
+	string sa;
+	string sel;
+	if(plot->getDatabase()->dbmsName() == "OracleSpatial")	
+		sel = " SELECT /*+ ordered */ * "; 
+	else
+		sel = " SELECT * ";
+
+	delete plot;
+	if(numrows > 0)
+		sa = sel + " FROM (" + tabtx + " INNER JOIN " + tabs;
+	else
+		sa = sel + " FROM (" + tabtx + " LEFT JOIN " + tabs;
+
+	sa += " ON " + tabtx + ".object_id = " + tabs + ".c_object_id) WHERE ";
+
+	string squery;
+	squery = sa + wherebox;
+	plotTexts(appTheme, canvas, squery, progress);
+
+	string othersQuery = "SELECT * FROM " + tabtx + " WHERE object_id = 'TE_NONE_ID'";
+	plotTexts(appTheme, canvas, othersQuery, progress);
+}
+
+template<class Canvas, class Progress>
+void plotTexts(TeAppTheme *appTheme, Canvas *canvas, string query, Progress *progress)
+{
+	TeText	text;
+	int	np = 0;
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	
+	TeAbstractTheme* theme = appTheme->getTheme();
+	TeDatabase* db = appTheme->getLocalDatabase();
+	if(!db)
+		return;
+	
+	TeDatabasePortal* plot = db->getPortal();
+
+	if(progress == 0)
+	{
+		if(plot->query(query) && plot->fetchRow())
+		{
+			t1 = clock();
+			t2 = t1;
+			bool flag = true;
+			do
+			{
+				flag = plot->fetchGeometry(text);
+				setTextAttributes(theme, canvas, text);
+				canvas->plotText (text, theme->defaultLegend().visual(TeTEXT));
+				np++;
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					canvas->copyPixmapToWindow();
+				}
+			} while (flag);
+			canvas->copyPixmapToWindow();
+		}
+	}
+	else
+	{
+		int steps = 0;
+		string conta = query;
+		conta.replace(0, strlen("SELECT *")+1, "SELECT COUNT(*)");
+		int ff;
+		if((ff=conta.find("ORDER BY")) >= 0)
+			conta = conta.substr(0, ff);
+		plot->freeResult();
+		if(plot->query(conta) && plot->fetchRow())
+			steps = atoi(plot->getData(0));
+
+		plot->freeResult();
+		if(plot->query(query) && plot->fetchRow())
+		{
+			string caption = "Plotando tema: " + theme->name();
+			progress->setCaption(caption.c_str());
+			progress->setLabelText("      Plotagem de textos em andamento, aguarde...      ");
+			progress->setTotalSteps(steps);
+			t2 = clock();
+			t0 = t1 = t2;
+			bool flag = true;
+			do
+			{
+				flag = plot->fetchGeometry(text);
+				setTextAttributes(theme, canvas, text);
+				canvas->plotText (text, theme->defaultLegend().visual(TeTEXT));
+				np++;
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					canvas->copyPixmapToWindow();
+					if(progress->wasCancelled())
+					{
+						progress->reset();
+						break;
+					}
+					if((int)(t2-t0) > dt2)
+						progress->setProgress(np);
+				}
+			} while (flag);
+			canvas->copyPixmapToWindow();
+		}
+		progress->reset();
+	}
+	delete plot;
+}
+
+template<class Canvas>
+void setTextAttributes(TeAppTheme* appTheme, Canvas* canvas, TeText tx)
+{
+	TeColor	cor;
+	static	TeVisual* snc;
+	string	family;
+	static int		ssize;
+	int		size = 0;
+	bool	bold, italic, fixedSize;
+
+	if(appTheme == 0)
+	{
+		ssize = 0;
+		snc->family("notFamily");
+		return;
+	}
+
+	TeAbstractTheme* theme = appTheme->getTheme();
+
+	fixedSize = theme->defaultLegend().visual(TeTEXT)->fixedSize(); // font size is fixed
+	if(snc == theme->defaultLegend().visual(TeTEXT))
+	{
+		if(fixedSize == false && tx.height() > 0.)
+		{
+			TeBox wbox = canvas->getDataWorld();
+			TeCoord2D p1(wbox.x1_, wbox.y1_);
+			TeCoord2D p2(p1.x() + tx.height(), p1.y() + tx.height());
+			TeBox box(p1, p2);
+			canvas->mapDWtoV(box);
+			size = int(box.height());
+		}
+		else
+			size = theme->defaultLegend().visual(TeTEXT)->size(); // font size
+	}
+
+	if(size == 0)
+	{
+		if(fixedSize == false && tx.height() > 0.)
+		{
+			TeBox wbox = canvas->getDataWorld();
+			TeCoord2D p1(wbox.x1_, wbox.y1_);
+			TeCoord2D p2(p1.x() + tx.height(), p1.y() + tx.height());
+			TeBox box(p1, p2);
+			canvas->mapDWtoV(box);
+			size = int(box.height());
+		}
+		else
+			size = theme->defaultLegend().visual(TeTEXT)->size(); // font size
+	}
+
+	cor = theme->defaultLegend().visual(TeTEXT)->color();
+	family = theme->defaultLegend().visual(TeTEXT)->family();
+	bold = theme->defaultLegend().visual(TeTEXT)->bold();
+	italic = theme->defaultLegend().visual(TeTEXT)->italic();
+	fixedSize = theme->defaultLegend().visual(TeTEXT)->fixedSize(); // font size is fixed
+
+	canvas->setTextColor(cor.red_, cor.green_, cor.blue_);
+	canvas->setTextStyle (family, size, bold, italic );
+	snc = theme->defaultLegend().visual(TeTEXT);
+	ssize = size;
+}
+
+template<class Canvas, class Progress>
+void plotPieBars(TeAppTheme *appTheme, Canvas *canvas, Progress *progress, TeBox ebox = TeBox())
+{
+	if(	appTheme->getTheme()->getProductId() != TeTHEME && 
+		appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+		return;
+
+	TeTheme* theme = (TeTheme*)appTheme->getTheme();
+	if(theme->minScale() != 0 && theme->maxScale() != 0 && theme->minScale() > theme->maxScale())
+	{
+		if(theme->minScale() < canvas->scaleApx() || theme->maxScale() > canvas->scaleApx())
+			return;
+	}
+	if((theme->visibleRep() & 0x80000000) == 0)
+		return;
+
+	int steps = 0;
+	int	np = 0;
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 2;
+	clock_t	t0, t1, t2;
+	
+	TeDatabase* db = 0;
+	TeLayer* layer = 0;
+	if(theme->getProductId() == TeTHEME)
+		layer = theme->layer();
+	else if(theme->getProductId() == TeEXTERNALTHEME)
+		layer = ((TeExternalTheme*)theme)->getRemoteTheme()->layer();
+
+		db = layer->database();
+
+	if(!db)
+		return; 
+
+	TeDatabasePortal* plot = db->getPortal();
+
+	canvas->setDataProjection (layer->projection());
+
+	if(appTheme->chartAttributes_.size() == 0)
+	{
+		delete plot;
+		return;
+	}
+	double	width = appTheme->barWidth();
+	double	maxh = appTheme->barMaxHeight();
+	double	minh = appTheme->barMinHeight();
+	double	maxd = appTheme->pieMaxDiameter();
+	double	mind = appTheme->pieMinDiameter();
+	double	diameter = appTheme->pieDiameter();
+	string FUNC = appTheme->chartFunction();
+
+	if(appTheme->keepDimension() != 0)
+	{
+		width = canvas->mapVtoDW((int)width);
+		maxh = canvas->mapVtoDW((int)maxh);
+		minh = canvas->mapVtoDW((int)minh);
+		maxd = canvas->mapVtoDW((int)maxd);
+		mind = canvas->mapVtoDW((int)mind);
+		diameter = canvas->mapVtoDW((int)diameter);
+	}
+
+	vector<string> itenVec, objVec;
+	unsigned int i;
+	string	input, cinput, sqlGridFrom, CT, CE;
+	TeSelectedObjects  selectedObjects = appTheme->chartObjects();
+	if(theme->getProductId() == TeTHEME)
+	{
+		sqlGridFrom = theme->sqlGridFrom();
+		CT = theme->collectionTable();
+		CE = theme->collectionAuxTable();
+		if(selectedObjects == TeSelectedByPointing)
+		{
+			input = "(grid_status = 1 OR grid_status = 3";
+			input += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3)))";
+			cinput = "(c_object_status = 1 OR c_object_status = 3)";
+		}
+		else if(selectedObjects == TeNotSelectedByPointing)
+		{
+			input = "(grid_status = 0 OR grid_status = 2";
+			input += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
+			cinput = "(c_object_status = 0 OR c_object_status = 2)";
+		}
+		else if(selectedObjects == TeSelectedByQuery)
+		{
+			input = "(grid_status = 2 OR grid_status = 3";
+			input += " OR (grid_status is null AND (c_object_status = 2 OR c_object_status = 3)))";
+			cinput = "(c_object_status = 2 OR c_object_status = 3)";
+		}
+		else if(selectedObjects == TeNotSelectedByQuery)
+		{
+			input = "(grid_status = 0 OR grid_status = 1";
+			input += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 1)))";
+			cinput = "(c_object_status = 0 OR c_object_status = 1)";
+		}
+		else if(selectedObjects == TeGrouped)
+		{
+			input = "c_legend_id <> 0";
+			cinput = "c_legend_id <> 0";
+		}
+		else if(selectedObjects == TeNotGrouped)
+		{
+			input = "c_legend_id = 0";
+			cinput = "c_legend_id = 0";
+		}
+	}
+	else if(theme->getProductId() == TeEXTERNALTHEME)
+	{
+		itenVec = getItems(theme, selectedObjects);
+		objVec = getObjects(theme, selectedObjects);
+		sqlGridFrom = ((TeExternalTheme*)theme)->getRemoteTheme()->sqlGridFrom();
+		CT = ((TeExternalTheme*)theme)->getRemoteTheme()->collectionTable();
+		CE = ((TeExternalTheme*)theme)->getRemoteTheme()->collectionAuxTable();
+	}
+
+	canvas->setLineStyle(TeLnTypeContinuous, 0);
+	canvas->setLineColor(0, 0, 0);
+	TeChartType chartType = (TeChartType)appTheme->chartType();
+	if(chartType == TePieChart)
+	{
+		string wherebox;
+		double delta = diameter / 2.;
+		if(!(appTheme->pieDimAttribute() == "NONE"))
+			delta = maxd / 2.;
+
+		TeBox box;
+		if(ebox.isValid())
+			box = ebox;
+		else
+			box = canvas->getDataWorld();
+
+		box.x1_ = box.x1_ - delta;
+		box.x2_ = box.x2_ + delta;
+		box.y1_ = box.y1_ - delta;
+		box.y2_ = box.y2_ + delta;
+
+		wherebox = "NOT(label_x > " + Te2String(box.x2_, 10) + " OR ";
+		wherebox = wherebox + "label_x < " + Te2String(box.x1_, 10) + " OR ";
+		wherebox = wherebox + "label_y > " + Te2String(box.y2_, 10) + " OR ";
+		wherebox = wherebox + "label_y < " + Te2String(box.y1_, 10) + ")";
+
+		string attrs, q;
+		for(i=0; i<appTheme->chartAttributes_.size(); i++)
+			attrs += FUNC + "(" + appTheme->chartAttributes_[i] + "),";
+		attrs += "AVG(label_x),AVG(label_y)";
+		if(!(appTheme->pieDimAttribute() == "NONE"))
+			attrs += "," + FUNC + "(" + appTheme->pieDimAttribute() + ")";
+
+		if(theme->getProductId() == TeTHEME)
+		{
+			if(wherebox.empty() && itenVec.empty())
+				q = "SELECT " + attrs + sqlGridFrom;
+			else if(wherebox.empty() && input.empty()==false)
+				q = "SELECT " + attrs + sqlGridFrom + " WHERE " + input;
+			else if(wherebox.empty()==false && input.empty())
+				q = "SELECT " + attrs + sqlGridFrom + " WHERE " + wherebox;
+			else if(wherebox.empty()==false && input.empty()==false)
+				q = "SELECT " + attrs + sqlGridFrom + " WHERE " + input + " AND " + wherebox;
+			q += " GROUP BY " + CT + ".c_object_id";
+
+			string conta = "SELECT COUNT(*) FROM " + CT;
+			if(wherebox.empty() && cinput.empty()==false)
+				conta += " WHERE " + cinput;
+			else if(wherebox.empty()==false && cinput.empty())
+				conta += " WHERE " + wherebox;
+			else if(wherebox.empty()==false && cinput.empty()==false)
+				conta += " WHERE " + cinput + " AND " + wherebox;
+			
+			plot->freeResult();
+			if(plot->query(conta) && plot->fetchRow())
+				steps = atoi(plot->getData(0));
+
+			plot->freeResult();
+			if(plot->query(q))
+			{
+				if(progress)
+				{
+					string caption = "Plotando tema: " + theme->name();
+					progress->setCaption(caption.c_str());
+					progress->setLabelText("      Plotagem de tortas em andamento, aguarde...      ");
+					progress->setTotalSteps(steps);
+				}
+				t2 = clock();
+				t0 = t1 = t2;
+				bool b = plot->fetchRow(0);
+				while(b)
+				{
+					double tot = 0.;
+					for(i=0; i<appTheme->chartAttributes_.size(); i++)
+					{
+						string v = plot->getData(i);
+						if(v.empty())
+						{
+							tot = 0.;
+							break;
+						}
+						tot += atof(v.c_str());
+					}
+					if(tot == 0.)
+					{
+						b = plot->fetchRow();
+						np++;
+						continue;
+					}
+
+					if(!(appTheme->pieDimAttribute() == "NONE"))
+					{
+						if(appTheme->chartMaxVal() - appTheme->chartMinVal() == 0)
+							diameter = 0.;
+						else
+						{
+							double	adim = atof(plot->getData(appTheme->chartAttributes_.size()+2));
+							double a = (adim - appTheme->chartMinVal()) / (appTheme->chartMaxVal() - appTheme->chartMinVal());
+							diameter = a * (maxd - mind) + mind;
+						}
+					}
+					double	x = atof(plot->getData(appTheme->chartAttributes_.size())) - diameter / 2.;
+					double	y = atof(plot->getData(appTheme->chartAttributes_.size()+1)) - diameter / 2.;
+
+					double	a = 0.;
+					for(i=0; i<appTheme->chartAttributes_.size(); i++)
+					{
+						double b = atof(plot->getData(i)) / tot * 360.;
+						TeColor	cor = appTheme->chartColors_[i];
+						canvas->setPieColor(cor.red_, cor.green_, cor.blue_);
+						canvas->plotPie(x, y, diameter, diameter, a, b);
+						a += b;
+					}
+					np++;
+					t2 = clock();
+					if (int(t2-t1) > dt)
+					{
+						t1 = t2;
+						canvas->copyPixmapToWindow();
+						if(progress)
+						{
+							if(progress->wasCancelled())
+							{
+								progress->reset();
+								break;
+							}
+							if((int)(t2-t0) > dt2)
+								progress->setProgress(np);
+						}
+					}
+					b = plot->fetchRow();
+				}
+				canvas->copyPixmapToWindow();
+			}
+		}
+		else if(theme->getProductId() == TeEXTERNALTHEME)
+		{
+			string conta = "SELECT COUNT(*) FROM " + CT;			
+			plot->freeResult();
+			if(plot->query(conta) && plot->fetchRow())
+				steps = atoi(plot->getData(0));
+        
+      std::vector< std::string >::iterator it_begin = itenVec.begin();
+      std::vector< std::string >::iterator it_end = itenVec.end();
+
+			vector<string> sv = generateItemsInClauses(it_begin, it_end, theme);
+			vector<string>::iterator it;
+			for(it=sv.begin(); it!=sv.end(); ++it)
+			{
+				string s = *it;
+				string q = "SELECT " + attrs + sqlGridFrom;
+				if((*it).empty() == false && wherebox.empty())
+					q += " WHERE " + CE + ".unique_id IN " + *it;
+				else if((*it).empty() && wherebox.empty()==false)
+					q += " WHERE " + wherebox;
+				else if((*it).empty()==false && wherebox.empty()==false)
+					q += " WHERE " + CE + ".unique_id IN " + *it + " AND " + wherebox;
+				q += " GROUP BY " + CT + ".c_object_id";
+
+				plot->freeResult();
+				if(plot->query(q))
+				{
+					if(progress)
+					{
+						string caption = "Plotando tema: " + theme->name();
+						progress->setCaption(caption.c_str());
+						progress->setLabelText("      Plotagem de tortas em andamento, aguarde...      ");
+						progress->setTotalSteps(steps);
+					}
+					t2 = clock();
+					t0 = t1 = t2;
+					bool b = plot->fetchRow(0);
+					while(b)
+					{
+						double tot = 0.;
+						for(i=0; i<appTheme->chartAttributes_.size(); i++)
+						{
+							string v = plot->getData(i);
+							if(v.empty())
+							{
+								tot = 0.;
+								break;
+							}
+							tot += atof(v.c_str());
+						}
+						if(tot == 0.)
+						{
+							b = plot->fetchRow();
+							np++;
+							continue;
+						}
+
+						if(!(appTheme->pieDimAttribute() == "NONE"))
+						{
+							if(appTheme->chartMaxVal() - appTheme->chartMinVal() == 0)
+								diameter = 0.;
+							else
+							{
+								double	adim = atof(plot->getData(appTheme->chartAttributes_.size()+2));
+								double a = (adim - appTheme->chartMinVal()) / (appTheme->chartMaxVal() - appTheme->chartMinVal());
+								diameter = a * (maxd - mind) + mind;
+							}
+						}
+						double	x = atof(plot->getData(appTheme->chartAttributes_.size())) - diameter / 2.;
+						double	y = atof(plot->getData(appTheme->chartAttributes_.size()+1)) - diameter / 2.;
+
+						double	a = 0.;
+						for(i=0; i<appTheme->chartAttributes_.size(); i++)
+						{
+							double b = atof(plot->getData(i)) / tot * 360.;
+							TeColor	cor = appTheme->chartColors_[i];
+							canvas->setPieColor(cor.red_, cor.green_, cor.blue_);
+							canvas->plotPie(x, y, diameter, diameter, a, b);
+							a += b;
+						}
+						np++;
+						t2 = clock();
+						if (int(t2-t1) > dt)
+						{
+							t1 = t2;
+							canvas->copyPixmapToWindow();
+							if(progress)
+							{
+								if(progress->wasCancelled())
+								{
+									progress->reset();
+									break;
+								}
+								if((int)(t2-t0) > dt2)
+									progress->setProgress(np);
+							}
+						}
+						b = plot->fetchRow();
+					}
+					canvas->copyPixmapToWindow();
+				}
+			}
+		}
+	}
+	else
+	{
+		double	n = appTheme->chartAttributes_.size();
+		double	maxv = appTheme->chartMaxVal();
+		double	minv = appTheme->chartMinVal();
+		double delta = maxh / 2.;
+
+		string wherebox;
+
+		TeBox box;
+		if(ebox.isValid())
+			box = ebox;
+		else
+			box = canvas->getDataWorld();
+
+		box.x1_ = box.x1_ - delta;
+		box.x2_ = box.x2_ + delta;
+		box.y1_ = box.y1_ - delta;
+		box.y2_ = box.y2_ + delta;
+
+		wherebox = "NOT(label_x > " + Te2String(box.x2_, 10) + " OR ";
+		wherebox = wherebox + "label_x < " + Te2String(box.x1_, 10) + " OR ";
+		wherebox = wherebox + "label_y > " + Te2String(box.y2_, 10) + " OR ";
+		wherebox = wherebox + "label_y < " + Te2String(box.y1_, 10) + ")";
+
+		string attrs, q;
+		for(i=0; i<appTheme->chartAttributes_.size(); i++)
+			attrs += FUNC + "(" + appTheme->chartAttributes_[i] + "),";
+		attrs += "AVG(label_x),AVG(label_y)";
+
+		if(theme->getProductId() == TeTHEME)
+		{
+			if(wherebox.empty() && input.empty())
+				q = "SELECT " + attrs + sqlGridFrom;
+			else if (wherebox.empty() == false && input.empty() == false)
+				q = "SELECT " + attrs + sqlGridFrom + " WHERE " + input + " AND " + wherebox;
+			else if (wherebox.empty() == false && input.empty())
+				q = "SELECT " + attrs + sqlGridFrom + " WHERE " + wherebox;
+			else if (wherebox.empty() && input.empty() == false)
+				q = "SELECT " + attrs + sqlGridFrom + " WHERE " + input;
+			q += " GROUP BY " + CT + ".c_object_id";
+
+			string conta = "SELECT COUNT(*) FROM " + CT;
+			if(wherebox.empty() && cinput.empty()==false)
+				conta += " WHERE " + cinput;
+			else if(wherebox.empty()==false && cinput.empty())
+				conta += " WHERE " + wherebox;
+			else if(wherebox.empty()==false && cinput.empty()==false)
+				conta += " WHERE " + cinput + " AND " + wherebox;
+
+			plot->freeResult();
+			if(plot->query(conta) && plot->fetchRow())
+				steps = atoi(plot->getData(0));
+
+			vector<double> dvec;
+			plot->freeResult();
+			if(plot->query(q))
+			{
+				if(progress)
+				{
+					string caption = "Plotando tema: " + theme->name();
+					progress->setCaption(caption.c_str());
+					progress->setLabelText("      Plotagem de barras em andamento, aguarde...      ");
+					progress->setTotalSteps(steps);
+				}
+				t2 = clock();
+				t0 = t1 = t2;
+				bool b = plot->fetchRow(0);
+				while(b)
+				{
+					double	x = atof(plot->getData(appTheme->chartAttributes_.size())) - n * width / 2.;
+					double	y = atof(plot->getData(appTheme->chartAttributes_.size()+1));
+
+					dvec.clear();
+					for(i=0; i<appTheme->chartAttributes_.size(); i++)
+					{
+						string val = plot->getData(i);
+						if(val.empty())
+						{
+							dvec.clear();
+							break;
+						}
+						dvec.push_back(atof(val.c_str()));
+					}
+
+					for(i=0; i<dvec.size(); i++)
+					{
+						double height;
+						double v = dvec[i];
+						if(maxv - minv == 0)
+							height = 0.;
+						else
+							height = (v - minv) * (maxh - minh) / (maxv - minv) + minh;
+						TeColor	cor = appTheme->chartColors_[i];
+						canvas->setRectColor(cor.red_, cor.green_, cor.blue_);
+						canvas->plotRect(x, y, width, height);
+						x += width;
+					}
+					np++;
+					t2 = clock();
+					if (int(t2-t1) > dt)
+					{
+						t1 = t2;
+						canvas->copyPixmapToWindow();
+						if(progress)
+						{
+							if(progress->wasCancelled())
+							{
+								progress->reset();
+								break;
+							}
+							if((int)(t2-t0) > dt2)
+								progress->setProgress(np);
+						}
+					}
+					b = plot->fetchRow();
+				}
+				canvas->copyPixmapToWindow();
+			}
+		}
+		if(theme->getProductId() == TeEXTERNALTHEME)
+		{
+			string conta = "SELECT COUNT(*) FROM " + CT;			
+			plot->freeResult();
+			if(plot->query(conta) && plot->fetchRow())
+				steps = atoi(plot->getData(0));
+
+      std::vector< std::string >::iterator it_begin = itenVec.begin();
+      std::vector< std::string >::iterator it_end = itenVec.end();
+
+      vector<string> sv = generateItemsInClauses(it_begin, it_end, theme);
+
+			vector<string>::iterator it;
+			for(it=sv.begin(); it!=sv.end(); ++it)
+			{
+				string s = *it;
+				string q = "SELECT " + attrs + sqlGridFrom;
+				if((*it).empty() == false && wherebox.empty())
+					q += " WHERE " + CE + ".unique_id IN " + *it;
+				else if((*it).empty() && wherebox.empty()==false)
+					q += " WHERE " + wherebox;
+				else if((*it).empty()==false && wherebox.empty()==false)
+					q += " WHERE " + CE + ".unique_id IN " + *it + " AND " + wherebox;
+				q += " GROUP BY " + CT + ".c_object_id";
+
+				vector<double> dvec;
+				plot->freeResult();
+				if(plot->query(q))
+				{
+					if(progress)
+					{
+						string caption = "Plotando tema: " + theme->name();
+						progress->setCaption(caption.c_str());
+						progress->setLabelText("      Plotagem de barras em andamento, aguarde...      ");
+						progress->setTotalSteps(steps);
+					}
+					t2 = clock();
+					t0 = t1 = t2;
+					bool b = plot->fetchRow(0);
+					while(b)
+					{
+						double	x = atof(plot->getData(appTheme->chartAttributes_.size())) - n * width / 2.;
+						double	y = atof(plot->getData(appTheme->chartAttributes_.size()+1));
+
+						dvec.clear();
+						for(i=0; i<appTheme->chartAttributes_.size(); i++)
+						{
+							string val = plot->getData(i);
+							if(val.empty())
+							{
+								dvec.clear();
+								break;
+							}
+							dvec.push_back(atof(val.c_str()));
+						}
+
+						for(i=0; i<dvec.size(); i++)
+						{
+							double height;
+							double v = dvec[i];
+							if(maxv - minv == 0)
+								height = 0.;
+							else
+								height = (v - minv) * (maxh - minh) / (maxv - minv) + minh;
+							TeColor	cor = appTheme->chartColors_[i];
+							canvas->setRectColor(cor.red_, cor.green_, cor.blue_);
+							canvas->plotRect(x, y, width, height);
+							x += width;
+						}
+						np++;
+						t2 = clock();
+						if (int(t2-t1) > dt)
+						{
+							t1 = t2;
+							canvas->copyPixmapToWindow();
+							if(progress)
+							{
+								if(progress->wasCancelled())
+								{
+									progress->reset();
+									break;
+								}
+								if((int)(t2-t0) > dt2)
+									progress->setProgress(np);
+							}
+						}
+						b = plot->fetchRow();
+					}
+					canvas->copyPixmapToWindow();
+				}
+			}
+		}
+	}
+	if(progress)
+		progress->reset();
+	delete plot;
+}
+
+
+template<class Portal, class Canvas>
+string getWhereBox(Portal *plot, TeAppTheme *appTheme, Canvas *canvas, TeGeomRep rep, TeBox bbox = TeBox())
+{
+	string wherebox;
+	if(	appTheme->getTheme()->getProductId() != TeTHEME && 
+		appTheme->getTheme()->getProductId() != TeEXTERNALTHEME )
+		return wherebox;
+
+	TeTheme* theme = (TeTheme*)appTheme->getTheme();
+	TeLayer* layer = theme->layer();
+	std::string tableName = layer->tableName(rep);
+
+	if(appTheme->chartSelected_.empty() == true)
+	{
+		TeBox box;
+		if(bbox.isValid())
+			box = bbox;
+		else
+		{
+			if(canvas->canvasAndDataProjectionEqual())
+			{
+				box = canvas->getDataWorld();
+			}
+			else
+			{
+				TeBox canvasBox = TeRemapBoxPC2Geodetic(canvas->getWorld(), canvas->projection());
+				TeBox layerBox = TeRemapBoxPC2Geodetic(layer->box(), layer->projection());
+
+				TeBox ibox;
+				if (TeIntersection(canvasBox, layerBox, ibox))
+					box = TeRemapBoxGeodetic2PC(ibox, layer->projection());
+			}
+		}
+		wherebox = plot->getDatabase()->getSQLBoxWhere(box, rep, tableName);
+	}
+	else
+	{
+		if (rep == TePOINTS)
+		{
+			double	width = appTheme->barWidth();
+			double	maxh = appTheme->barMaxHeight();
+			double	minh = appTheme->barMinHeight();
+			double	maxd = appTheme->pieMaxDiameter();
+			double	mind = appTheme->pieMinDiameter();
+			double	diameter = appTheme->pieDiameter();
+			double	delta;
+
+			if(appTheme->keepDimension() != 0)
+			{
+				width = canvas->mapVtoCW((int)width);
+				maxh = canvas->mapVtoCW((int)maxh);
+				minh = canvas->mapVtoCW((int)minh);
+				maxd = canvas->mapVtoCW((int)maxd);
+				mind = canvas->mapVtoCW((int)mind);
+				diameter = canvas->mapVtoCW((int)diameter);
+			}
+
+			TeChartType chartType = (TeChartType)appTheme->chartType();
+			if(chartType == TePieChart)
+			{
+				delta = diameter / 2.;
+				if(!(appTheme->pieDimAttribute() == "NONE"))
+					delta = maxd / 2.;
+			}
+			else
+				delta = maxh / 2.;
+
+			string sel = "SELECT label_x, label_y FROM " + theme->collectionTable();
+			sel += " WHERE c_object_id = '" + appTheme->chartSelected_ + "'";
+			plot->freeResult();
+			if(plot->query(sel))
+			{
+				bool b = plot->fetchRow(0);
+				if(b == false)
+					return wherebox;
+				if(b)
+				{
+					double x = atof(plot->getData(0));
+					double y = atof(plot->getData(1));
+					string xmin = Te2String(x - delta);
+					string xmax = Te2String(x + delta);
+					string ymin = Te2String(y - delta);
+					string ymax = Te2String(y + delta);
+					wherebox = "label_x > " + xmin + " AND ";
+					wherebox += "label_x < " + xmax + " AND ";
+					wherebox += "label_y > " + ymin + " AND ";
+					wherebox += "label_y < " + ymax;
+				}
+			}
+		}
+		else if(rep == TePOLYGONS || rep == TeLINES || rep == TeCELLS)
+		{
+			string tab;
+			if(rep == TePOLYGONS)
+				tab = theme->layer()->tableName(TePOLYGONS);
+			else if (rep == TeLINES)
+				tab = theme->layer()->tableName(TeLINES);
+			else if (rep == TeCELLS)
+				tab = theme->layer()->tableName(TeCELLS);
+			
+			plot->freeResult();
+
+			TeBox b;
+			bool result = plot->getDatabase()->getMBRGeom(tab, appTheme->chartSelected_, b, "spatial_data");
+			if(!result)
+				return wherebox;
+			else
+				wherebox = plot->getDatabase()->getSQLBoxWhere(b, rep, tableName);
+		}
+	}
+	return wherebox;
+}
+
+template<class Portal>
+TeVisual getVisual(Portal* portal, TeAppTheme* appTheme, TeGeomRep GEOMREP, int resPos, int groPos, int ownPos)
+{
+	TeVisual visual;
+	TeAbstractTheme* theme = appTheme->getTheme();
+	TeDatabase* db = appTheme->getLocalDatabase();
+	if(!db)
+		return visual;
+
+	TeLegendEntry* legendEntry;
+
+	int status = atoi(portal->getData(resPos));
+	int groId = atoi(portal->getData(groPos));
+	int ownId = atoi(portal->getData(ownPos));
+
+	if(groId && (theme->visibleRep()&0x40000000))
+		legendEntry = db->legendMap()[groId];
+	else if(ownId != 0)
+		legendEntry = db->legendMap()[ownId];
+	else
+		legendEntry = &(theme->defaultLegend());
+	
+//	if(legendEntry)
+//		visual = legendEntry->visual(GEOMREP);
+//	else
+//		visual = TeVisual(GEOMREP);
+/////////////////////////////////////////////////////////
+	TeGeomRepVisualMap& vm = legendEntry->getVisualMap();
+	if(legendEntry && vm.find(GEOMREP) != vm.end())
+		visual = *(legendEntry->visual(GEOMREP));
+	else
+	{
+		if(ownId != 0)
+			legendEntry = db->legendMap()[ownId];
+		else
+			legendEntry = &(theme->defaultLegend());
+
+		visual = *(legendEntry->visual(GEOMREP));
+	}
+/////////////////////////////////////////////////////////
+
+	if(status == 1)
+		visual.color((theme->pointingLegend().visual(TePOLYGONS))->color());
+	else if(status == 2)
+		visual.color((theme->queryLegend().visual(TePOLYGONS))->color());
+	else if(status == 3)
+		visual.color((theme->queryAndPointingLegend().visual(TePOLYGONS))->color());
+
+	if(status == 0)
+	{
+		if(GEOMREP == TePOLYGONS || GEOMREP == TeCELLS)
+		{
+			if(visual.transparency() == 100 && visual.style() != TePolyTypeTransparent)
+				visual.style(TePolyTypeTransparent);
+		}
+	}
+
+	return visual;
+}
+
+template<class Portal>
+TeVisual getVisualRemote(Portal* /* portal */, TeAppTheme* appTheme, TeGeomRep GEOMREP, string objId)
+{
+	TeVisual visual;
+	if(appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+		return visual; 
+	
+	TeExternalTheme* theme = static_cast<TeExternalTheme*>(appTheme->getTheme());
+	TeDatabase* db = theme->getSourceDatabase();
+	TeLegendEntry* legendEntry;
+	
+	int status;
+	std::map<std::string, int>::iterator itLS = theme->getObjStatusMap().find(objId);
+	if( itLS != theme->getObjStatusMap().end())
+		status = itLS->second;
+	else
+		status = 0;
+	
+	int groId;
+	std::map<std::string, int>::iterator itOL = theme->getObjLegendMap().find(objId);
+	if( itOL != theme->getObjLegendMap().end())
+		groId = itOL->second;
+	else
+		groId = 0;
+		
+	
+	int ownId;
+	std::map<std::string, int>::iterator itOLO = theme->getObjOwnLegendMap().find(objId);
+	if( itOLO != theme->getObjOwnLegendMap().end())
+		ownId= itOLO->second;
+	else
+		ownId = 0;
+		
+
+	if(groId && (theme->visibleRep()&0x40000000))
+		legendEntry = db->legendMap()[groId];
+	else if(ownId != 0)
+		legendEntry = db->legendMap()[ownId];
+	else
+		legendEntry = &(theme->defaultLegend());
+	
+//	if(legendEntry)
+//		visual = legendEntry->visual(GEOMREP);
+//	else
+//		visual = TeVisual(GEOMREP);
+/////////////////////////////////////////////////////////
+	TeGeomRepVisualMap& vm = legendEntry->getVisualMap();
+	if(legendEntry && vm.find(GEOMREP) != vm.end())
+		visual = *(legendEntry->visual(GEOMREP));
+	else
+	{
+		if(ownId != 0)
+			legendEntry = db->legendMap()[ownId];
+		else
+			legendEntry = &(theme->defaultLegend());
+
+		visual = *(legendEntry->visual(GEOMREP));
+	}
+/////////////////////////////////////////////////////////
+
+	if(status == 1)
+		visual.color((theme->pointingLegend().visual(TePOLYGONS))->color());
+	else if(status == 2)
+		visual.color((theme->queryLegend().visual(TePOLYGONS))->color());
+	else if(status == 3)
+		visual.color((theme->queryAndPointingLegend().visual(TePOLYGONS))->color());
+
+	return visual;
+}
+
+
+template<class Canvas , class Progress>
+void TePlotObjects (TeAppTheme* appTheme, Canvas *canvas, map<int, RepMap>& layerRepMap, Progress *progress = 0, TeBox box = TeBox())
+{
+	string tableName, objectId;
+	TeColor color;
+	TeVisual visual;
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	int nSteps, nLoops;
+
+/*	if(appTheme->getTheme()->getProductId()==TeFILETHEME)
+	{
+		TePlotFileTheme<Canvas, Progress> (appTheme, canvas, progress, box);
+		return;
+	}
+*/
+
+	if(	appTheme->getTheme()->getProductId() != TeTHEME && 
+		appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+	{
+		PluginsSignal sigdraw(PluginsSignal::S_DRAW_THEME);
+	
+		sigdraw.signalData_.store(PluginsSignal::D_QT_CANVAS, canvas);
+		sigdraw.signalData_.store(PluginsSignal::D_ABSTRACT_THEME, appTheme->getTheme());
+
+		PluginsEmitter::instance().send(sigdraw);
+
+		return;
+	}
+
+	TeTheme* theme = appTheme->getSourceTheme();
+	if (theme == 0)
+		return;
+	TeLayer* layer = theme->layer();
+	if(appTheme->getTheme()->minScale() != 0 && appTheme->getTheme()->maxScale() != 0 && appTheme->getTheme()->minScale() > appTheme->getTheme()->maxScale())
+	{
+		if(appTheme->getTheme()->minScale() < canvas->scaleApx() || appTheme->getTheme()->maxScale() > canvas->scaleApx())
+			return;
+	}
+
+	TeDatabase *db = layer->database();
+	TeDatabasePortal *portal = db->getPortal();
+	canvas->setDataProjection (layer->projection());
+	map<int, RepMap>::iterator it = layerRepMap.find(layer->id());
+
+	TeBox vb = box;
+	if(box.isValid())
+	{
+		canvas->mapDWtoCW(vb);
+		canvas->mapCWtoV(vb);
+	}
+
+	if (((appTheme->getTheme()->visibleRep() & TeRASTER) && layer->hasGeometry(TeRASTER)) || 
+		((appTheme->getTheme()->visibleRep() & TeRASTERFILE) && layer->hasGeometry(TeRASTERFILE)))
+	{
+		TeBox bIn;
+		if (box.isValid())
+		{
+			canvas->setClipRegion((int)vb.x1(), (int)vb.y1(), (int)vb.width(), (int)vb.height());
+			bIn = vb;	
+		}
+	
+		TeRaster* raster = theme->layer()->raster();
+		if (raster && (raster->params().status_ == TeRasterParams::TeReadyToRead || raster->params().status_ == TeRasterParams::TeReadyToWrite))
+		{
+			if (!theme->rasterVisual())
+				theme->createRasterVisual(raster);
+			canvas->plotRaster(raster,theme->rasterVisual(),progress);
+		}
+	}
+	if(layer->hasGeometry(TePOLYGONS) && (appTheme->getTheme()->visibleRep() & TePOLYGONS))
+	{
+		nLoops = 0;
+		// query the database table containing the polygons� geometry
+		string wherebox = getWhereBox(portal, appTheme, canvas, TePOLYGONS, box);
+		tableName = layer->tableName(TePOLYGONS);
+
+		string queryPolygons;
+		if ( db->dbmsName() == "SqlServerAdoSpatial" )	queryPolygons  = "SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data, c_legend_id, c_legend_own, c_object_status";
+		else											queryPolygons  = "SELECT " + tableName + ".*, c_legend_id, c_legend_own, c_object_status";
+		queryPolygons += " FROM " + tableName + ", " + theme->collectionTable();
+		queryPolygons += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			queryPolygons += " AND " + wherebox;
+
+		queryPolygons += " ORDER BY " + db->getSQLOrderBy(TePOLYGONS);
+
+		//Calculate the number of polygons to be drawn
+		string selectPolyCount; 
+		if(db->dbmsName()=="SqlServerAdo")
+			selectPolyCount="SELECT COUNT(DISTINCT(parent_id)) FROM ";
+		else if(db->dbmsName() != "OracleSpatial" && db->dbmsName() != "PostGIS" && db->dbmsName() !="SqlServerAdoSpatial")
+			selectPolyCount = "SELECT DISTINCT parent_id FROM ";
+		else
+			selectPolyCount = "SELECT DISTINCT object_id FROM ";
+
+		selectPolyCount += tableName + ", " + theme->collectionTable() + " WHERE c_object_id = object_id";
+		if(wherebox.empty() == false)
+			selectPolyCount += " AND " + wherebox;
+
+		string polyCount;
+		if(db->dbmsName() =="SqlServerAdo" || db->dbmsName() == "SqlServerAdoSpatial")
+			polyCount=selectPolyCount;
+		else if(db->dbmsName() == "PostgreSQL" || db->dbmsName() == "PostGIS")
+			polyCount = "SELECT COUNT(*) FROM (" + selectPolyCount + ") AS r";		
+		else if(db->dbmsName() == "MySQL")
+		{
+			string createTempTable = "CREATE TEMPORARY TABLE count_table " + selectPolyCount;
+			db->execute(createTempTable);
+			polyCount = "SELECT COUNT(*) FROM count_table";
+		}
+		else 
+			polyCount = "SELECT COUNT(*) FROM (" + selectPolyCount + ")";
+		
+		if (portal->query(polyCount))
+		{
+			if (portal->fetchRow())
+				nSteps = atoi(portal->getData(0));
+		}
+		else
+		{
+			delete portal;
+			return;
+		}
+
+		if (db->dbmsName() == "MySQL")
+			db->execute("DROP TABLE count_table");
+
+		portal->freeResult();
+
+		//Plot the polygons whose number was placed in nSteps
+		if(db->dbmsName() == "PostgreSQL" || db->dbmsName() == "PostGIS")
+		{
+			 if(portal->query(queryPolygons, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+			 {
+				delete portal;
+				return;
+			 } 
+		}
+		else
+		{
+			if (portal->query(queryPolygons) == false)
+			{
+				delete portal;
+				return;
+			}
+		}
+
+		int	groPos = portal->getAttributeList().size() - 3;
+		int	ownPos = portal->getAttributeList().size() - 2;
+		int	resPos = portal->getAttributeList().size() - 1;
+		
+		if(progress != NULL)
+		{
+			progress->setTotalSteps(nSteps);
+		}
+		t2 = clock();
+		t0 = t1 = t2;
+		if(portal->fetchRow())
+		{
+			bool flag;
+			flag = true;
+			do
+			{
+				int geomId = atoi(portal->getData(0));					
+				TePolygon poly;
+				if(appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+					visual = getVisual(portal, appTheme, TePOLYGONS, resPos, groPos, ownPos);					
+				else
+				{
+					string objId = portal->getData(1);
+					visual = getVisualRemote(portal, appTheme, TePOLYGONS, objId);					
+				}
+	
+				color = visual.color();
+				canvas->setPolygonColor(color.red_, color.green_, color.blue_);
+				canvas->setPolygonStyle((int)visual.style(),visual.transparency());
+				color = visual.contourColor();
+				canvas->setPolygonLineColor (color.red_, color.green_, color.blue_);
+				canvas->setPolygonLineStyle((int)visual.contourStyle(),visual.contourWidth());
+				if(box.isValid())
+					canvas->setClipRegion((int)vb.x1(), (int)vb.y1(), (int)vb.width(), (int)vb.height());
+				if(it == layerRepMap.end())
+				{
+					flag = portal->fetchGeometry(poly);
+					canvas->plotPolygon(poly);
+				}
+				else
+				{
+					canvas->plotPolygon(layerRepMap[layer->id()].polygonMap_[geomId]);
+					int parent_id = atoi(portal->getData(4));
+					int parent = parent_id;
+					while(parent == parent_id)
+					{
+						flag = portal->fetchRow();
+						if(flag)
+							parent = atoi(portal->getData(4));
+						else
+							parent = -1;
+					}
+				}
+				t2 = clock();
+				nLoops++;
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					canvas->copyPixmapToWindow();
+					if(progress != NULL)
+					{
+						if(progress->wasCancelled())
+						{
+							progress->reset();
+							break;
+						}
+						if((int)(t2-t0) > dt2)
+							progress->setProgress(nLoops);
+					}
+				}
+			}
+			while (flag);
+		}
+		if(progress != NULL)
+		{
+			progress->reset();
+		}
+	}
+
+	if(box.isValid())
+		canvas->setClipRegion((int)vb.x1(), (int)vb.y1(), (int)vb.width(), (int)vb.height());
+	if(layer->hasGeometry(TeCELLS) && (appTheme->getTheme()->visibleRep() & TeCELLS))
+	{
+		nLoops = 0;
+		// query the database table containing the polygons� geometry
+		string wherebox = getWhereBox(portal, appTheme, canvas, TeCELLS, box);
+		tableName = layer->tableName(TeCELLS);
+
+		string queryCells;
+		if ( db->dbmsName() == "SqlServerAdoSpatial" )	queryCells  = "SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data, c_legend_id, c_legend_own, c_object_status";
+		else											queryCells  = "SELECT " + tableName + ".*, c_legend_id, c_legend_own, c_object_status";
+		queryCells += " FROM " + tableName + ", " + theme->collectionTable();
+		queryCells += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			queryCells += " AND " + wherebox;
+
+		string cellsCount = "SELECT COUNT(*) FROM " + tableName + ", " + theme->collectionTable();
+		cellsCount += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			cellsCount += " AND " + wherebox;
+		
+		portal->freeResult();
+		if (portal->query(cellsCount))
+		{
+			if (portal->fetchRow())
+				nSteps = atoi(portal->getData(0));
+		}
+		else
+		{
+			delete portal;
+			return;
+		}
+
+		portal->freeResult();
+		if (portal->query(queryCells, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+		{
+			delete portal;
+			return;
+		}
+		int	groPos = portal->getAttributeList().size() - 3;
+		int	ownPos = portal->getAttributeList().size() - 2;
+		int	resPos = portal->getAttributeList().size() - 1;
+
+		if(progress != NULL)
+		{
+			progress->setTotalSteps(nSteps);
+		}
+		t2 = clock();
+		t0 = t1 = t2;
+		if(portal->fetchRow())
+		{
+			bool flag;
+			flag = true;
+			do
+			{
+				TeCell cell;
+				
+				if(appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+					visual = getVisual(portal, appTheme, TePOLYGONS, resPos, groPos, ownPos);					
+				else
+				{
+					string objId = portal->getData(1);
+					visual = getVisualRemote(portal, appTheme, TePOLYGONS, objId);					
+				}
+				
+				color = visual.color();
+				canvas->setPolygonColor(color.red_, color.green_, color.blue_);
+				canvas->setPolygonStyle((int)visual.style(),visual.transparency());
+				color = visual.contourColor();
+				canvas->setPolygonLineColor (color.red_, color.green_, color.blue_);
+				canvas->setPolygonLineStyle((int)visual.contourStyle(),visual.contourWidth());
+				flag = portal->fetchGeometry(cell);
+				canvas->plotCell(cell);
+				t2 = clock();
+				nLoops++;
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					canvas->copyPixmapToWindow();
+					
+					if(progress != NULL)
+					{
+						if(progress->wasCancelled())
+						{
+							progress->reset();
+							break;
+						}
+						if((int)(t2-t0) > dt2)
+							progress->setProgress(nLoops);
+					}
+				}
+			}
+			while (flag);
+		}
+		if(progress != NULL)
+		{
+			progress->reset();
+		}
+	}
+
+	if (layer->hasGeometry(TeLINES) && (appTheme->getTheme()->visibleRep() & TeLINES))
+	{
+		nLoops = 0;
+		string wherebox = getWhereBox(portal, appTheme, canvas, TeLINES, box);
+		// query the database table containing the lines� geometry
+		tableName = layer->tableName(TeLINES);
+
+		string queryLines;
+		if ( db->dbmsName() == "SqlServerAdoSpatial" )	queryLines  = "SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data, c_legend_id, c_legend_own, c_object_status";
+		else											queryLines  = "SELECT " + tableName + ".*, c_legend_id, c_legend_own, c_object_status";
+		queryLines += " FROM " + tableName + ", " + theme->collectionTable();
+		queryLines += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			queryLines += " AND " + wherebox;
+
+		string linesCount = "SELECT COUNT(*) FROM " + tableName + ", " + theme->collectionTable();
+		linesCount += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			linesCount += " AND " + wherebox;
+
+		portal->freeResult();
+		if (portal->query(linesCount))
+		{
+			if (portal->fetchRow())
+				nSteps = atoi(portal->getData(0));
+		}
+		else
+		{
+			delete portal;
+			return;
+		}
+
+		portal->freeResult();
+		if (portal->query(queryLines, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+		{
+			delete portal;
+			return;
+		}
+		int	groPos = portal->getAttributeList().size() - 3;
+		int	ownPos = portal->getAttributeList().size() - 2;
+		int	resPos = portal->getAttributeList().size() - 1;
+
+		if(progress != NULL)
+		{
+			progress->setTotalSteps(nSteps);
+		}
+
+		t2 = clock();
+		t0 = t1 = t2;
+		if(portal->fetchRow())
+		{
+			bool flag = true;
+			do
+			{
+				int geomId = atoi(portal->getData(0));					
+				TeLine2D line;
+				if(appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+					visual = getVisual(portal, appTheme, TeLINES, resPos, groPos, ownPos);					
+				else
+				{
+					string objId = portal->getData(1);
+					visual = getVisualRemote(portal, appTheme, TeLINES, objId);					
+				}				
+				color = visual.color();
+				canvas->setLineColor(color.red_, color.green_, color.blue_);
+				canvas->setLineStyle((int)visual.style(),visual.width());
+				if(it == layerRepMap.end())
+				{
+					flag = portal->fetchGeometry(line);
+					canvas->plotLine(line);
+				}
+				else
+				{
+					canvas->plotLine(layerRepMap[layer->id()].lineMap_[geomId]);
+					flag = portal->fetchRow();
+				}
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					canvas->copyPixmapToWindow();
+
+					if(progress != NULL)
+					{
+						if(progress->wasCancelled())
+						{
+							progress->reset();
+							break;
+						}
+						if((int)(t2-t0) > dt2)
+							progress->setProgress(int(t2));
+					}
+				}
+			}
+			while (flag);
+		}
+		if(progress != NULL)
+		{
+			progress->reset();
+		}
+	}
+
+	if (layer->hasGeometry(TePOINTS) && (appTheme->getTheme()->visibleRep() & TePOINTS))
+	{
+		nLoops = 0;
+		string wherebox = getWhereBox(portal, appTheme, canvas, TePOINTS, box);
+		// query the database table containing the points� geometry
+		tableName = layer->tableName(TePOINTS);
+
+		string queryPoints;
+		if ( db->dbmsName() == "SqlServerAdoSpatial" )	queryPoints  = "SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data, c_legend_id, c_legend_own, c_object_status";
+		else											queryPoints  = "SELECT " + tableName + ".*, c_legend_id, c_legend_own, c_object_status";
+		queryPoints += " FROM " + tableName + ", " + theme->collectionTable();
+		queryPoints += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			queryPoints += " AND " + wherebox;
+
+		string pointsCount = "SELECT COUNT(*) FROM " + tableName + ", " + theme->collectionTable();
+		pointsCount += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			pointsCount += " AND " + wherebox;
+
+		portal->freeResult();
+		if (portal->query(pointsCount))
+		{
+			if (portal->fetchRow())
+				nSteps = atoi(portal->getData(0));
+		}
+		else
+		{
+			delete portal;
+			return;
+		}
+
+		portal->freeResult();
+		if (portal->query(queryPoints, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+		{
+			delete portal;
+			return;
+		}
+		int	groPos = portal->getAttributeList().size() - 3;
+		int	ownPos = portal->getAttributeList().size() - 2;
+		int	resPos = portal->getAttributeList().size() - 1;
+
+		if(progress != NULL)
+		{
+			progress->setTotalSteps(nSteps);
+		}
+		t2 = clock();
+		t0 = t1 = t2;
+		if(portal->fetchRow())
+		{
+			bool flag = true;
+			do
+			{
+				TePoint point;
+				if(appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+					visual = getVisual(portal, appTheme, TePOINTS, resPos, groPos, ownPos);					
+				else
+				{
+					string objId = portal->getData(1);
+					visual = getVisualRemote(portal, appTheme, TePOINTS, objId);					
+				}					
+				color = visual.color();
+				canvas->setPointColor(color.red_, color.green_, color.blue_);
+				canvas->setPointStyle((int)visual.style(),visual.size());
+				flag = portal->fetchGeometry(point);
+				canvas->plotPoint(point);
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					canvas->copyPixmapToWindow();
+					if(progress != NULL)
+					{
+						if(progress->wasCancelled())
+						{
+							progress->reset();
+							break;
+						}
+						if((int)(t2-t0) > dt2)
+							progress->setProgress(int(t2));
+					}
+				}
+			}
+			while (flag);
+		}
+		if(progress != NULL)
+		{
+			progress->reset();
+		}
+	}
+	delete portal;
+
+	if(box.isValid())
+		canvas->setClipping(false);
+}
+
+
+
+template<class Canvas , class Progress>
+TeBox TePlotSelectedObjects(TeAppTheme* appTheme, Canvas *canvas, set<string>& drawSet, map<int, RepMap>& layerRepMap, Progress * /* progress */ = 0, TeGeomRepVisualMap* visualMap = 0)
+{
+	TeBox	boxRet;
+	int i, nLoops;
+	int dt = CLOCKS_PER_SEC/4;
+	clock_t	t0, t1, t2;
+	vector<string> inClauseVector;
+
+	if(	appTheme->getTheme()->getProductId() != TeTHEME && 
+		appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+		return boxRet;
+
+	TeTheme* theme = appTheme->getSourceTheme();
+	if (theme == 0)
+		return boxRet;
+	TeLayer* layer = theme->layer();
+
+	if(theme->minScale() != 0 && theme->maxScale() != 0 && theme->minScale() > theme->maxScale())
+	{
+		if(theme->minScale() < canvas->scaleApx() || theme->maxScale() > canvas->scaleApx())
+			return boxRet;
+	}
+
+	TeDatabase *db = layer->database();
+	TeDatabasePortal *portal = db->getPortal();
+	canvas->setDataProjection (layer->projection());
+	string TC = theme->collectionTable();
+
+	string tableName, objectId;
+	TeColor color;
+	TeVisual	visual;
+
+	set<string>::iterator itB = drawSet.begin();
+	set<string>::iterator itE = drawSet.end();
+	inClauseVector = generateInClauses(itB,itE, db);
+
+	if (layer->hasGeometry(TePOLYGONS) && (appTheme->getTheme()->visibleRep() & TePOLYGONS))
+	{
+		map<int, RepMap>::iterator it = layerRepMap.find(layer->id());
+//		nLoops = 0;
+//		progress->setTotalSteps(drawSet.size());
+		t2 = clock();
+		t0 = t1 = t2;
+
+		bool hasVisual = false;
+
+		if(visualMap)
+			hasVisual = (visualMap->find(TePOLYGONS) != visualMap->end());
+
+		TeVisual* visualPol;
+
+		if(hasVisual)
+			visualPol = (*visualMap)[TePOLYGONS];
+
+
+		for (i = 0; i < (int)inClauseVector.size(); ++i)
+		{
+			// query the database table containing the polygons� geometry
+			tableName = layer->tableName(TePOLYGONS);
+			string queryPolygons;
+			if ( db->dbmsName() == "SqlServerAdoSpatial" )	queryPolygons  = "SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data, c_legend_id, c_legend_own, c_object_status";
+			else											queryPolygons  = "SELECT " + tableName + ".*, c_legend_id, c_legend_own, c_object_status";
+			queryPolygons += " FROM " + tableName + ", " + theme->collectionTable();
+			queryPolygons += " WHERE object_id = c_object_id AND object_id IN " + inClauseVector[i];
+			
+			queryPolygons += " ORDER BY " + db->getSQLOrderBy(TePOLYGONS);
+
+			portal->freeResult();
+			if (portal->query(queryPolygons, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+			{
+				delete portal;
+				return boxRet;
+			}
+			int	groPos = portal->getAttributeList().size() - 3;
+			int	ownPos = portal->getAttributeList().size() - 2;
+			int	resPos = portal->getAttributeList().size() - 1;
+
+			if(portal->fetchRow())
+			{
+				bool flag = true;
+				do
+				{
+					TePolygon poly;
+
+					if(hasVisual)
+					{
+						color = visualPol->color();
+						canvas->setPolygonColor(color.red_, color.green_, color.blue_);
+						canvas->setPolygonStyle((int)visualPol->style(),visualPol->transparency());
+						color = visualPol->contourColor();
+						canvas->setPolygonLineColor (color.red_, color.green_, color.blue_);
+						canvas->setPolygonLineStyle((int)visualPol->contourStyle(),visualPol->contourWidth());
+					}
+					else
+					{
+						if(appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+							visual = getVisual(portal, appTheme, TePOLYGONS, resPos, groPos, ownPos);					
+						else
+						{
+							string objId = portal->getData(1);
+							visual = getVisualRemote(portal, appTheme, TePOLYGONS, objId);					
+						}		
+
+						color = visual.color();
+						canvas->setPolygonColor(color.red_, color.green_, color.blue_);
+						canvas->setPolygonStyle((int)visual.style(),visual.transparency());
+						color = visual.contourColor();
+						canvas->setPolygonLineColor (color.red_, color.green_, color.blue_);
+						canvas->setPolygonLineStyle((int)visual.contourStyle(),visual.contourWidth());
+					}
+
+					if(it == layerRepMap.end())
+					{
+						flag = portal->fetchGeometry(poly);
+						boxRet = TeUnion(boxRet, poly.box());
+						canvas->plotPolygon(poly, true);
+					}
+					else
+					{
+						int geomId = atoi(portal->getData(0));					
+						int parent_id = atoi(portal->getData(4));
+						int parent = parent_id;
+						while(parent == parent_id)
+						{
+							flag = portal->fetchRow();
+							if(flag)
+								parent = atoi(portal->getData(4));
+							else
+								parent = -1;
+						}
+						boxRet = TeUnion(boxRet, layerRepMap[layer->id()].polygonMap_[geomId].box());
+						canvas->plotPolygon(layerRepMap[layer->id()].polygonMap_[geomId], true);
+					}
+					t2 = clock();
+//					nLoops++;
+					if (int(t2-t1) > dt)
+					{
+						t1 = t2;
+						canvas->copyPixmap1ToWindow();
+//						if(progress->wasCancelled())
+//							break;
+//						progress->setProgress(nLoops);
+					}
+				}
+				while (flag);
+			}
+		}
+//		progress->reset();
+	}
+
+	if (layer->hasGeometry(TeCELLS) && (appTheme->getTheme()->visibleRep() & TeCELLS))
+	{
+//		nLoops = 0;
+//		progress->setTotalSteps(drawSet.size());
+		t2 = clock();
+		t0 = t1 = t2;
+
+		bool hasVisual = false;
+
+		if(visualMap)
+			hasVisual = (visualMap->find(TeCELLS) != visualMap->end());
+
+		TeVisual* visualCell;
+
+		if(hasVisual)
+			visualCell = (*visualMap)[TeCELLS];
+
+
+		for (i = 0; i < (int)inClauseVector.size(); ++i)
+		{
+			// query the database table containing the lines� geometry
+			tableName = layer->tableName(TeCELLS);
+			string queryCells;
+			if ( db->dbmsName() == "SqlServerAdoSpatial" )	queryCells  = "SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data, c_legend_id, c_legend_own, c_object_status";
+			else											queryCells  = "SELECT " + tableName + ".*, c_legend_id, c_legend_own, c_object_status";
+			queryCells += " FROM " + tableName + ", " + theme->collectionTable();
+			queryCells += " WHERE object_id = c_object_id AND object_id IN " + inClauseVector[i];
+
+			portal->freeResult();
+			if (portal->query(queryCells, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+			{
+				delete portal;
+				return boxRet;
+			}
+
+			int	groPos = portal->getAttributeList().size() - 3;
+			int	ownPos = portal->getAttributeList().size() - 2;
+			int	resPos = portal->getAttributeList().size() - 1;
+			
+			if(portal->fetchRow())
+			{
+				bool flag = true;
+				do
+				{
+					TeCell cell;
+
+					if(hasVisual)
+					{
+						color = visualCell->color();
+						canvas->setPolygonColor(color.red_, color.green_, color.blue_);
+						canvas->setPolygonStyle((int)visualCell->style(),visualCell->transparency());
+						color = visualCell->contourColor();
+						canvas->setPolygonLineColor (color.red_, color.green_, color.blue_);
+						canvas->setPolygonLineStyle((int)visualCell->contourStyle(),visualCell->contourWidth());
+					}
+					else
+					{
+
+						if(appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+							visual = getVisual(portal, appTheme, TePOLYGONS, resPos, groPos, ownPos);					
+						else
+						{
+							string objId = portal->getData(1);
+							visual = getVisualRemote(portal, appTheme, TePOLYGONS, objId);					
+						}		
+						color = visual.color();
+						canvas->setPolygonColor(color.red_, color.green_, color.blue_);
+						canvas->setPolygonStyle((int)visual.style(),visual.transparency());
+						color = visual.contourColor();
+						canvas->setPolygonLineColor (color.red_, color.green_, color.blue_);
+						canvas->setPolygonLineStyle((int)visual.contourStyle(),visual.contourWidth());
+					}
+
+					flag = portal->fetchGeometry(cell);
+					boxRet = TeUnion(boxRet, cell.box());
+					canvas->plotCell(cell, true);
+					t2 = clock();
+//					nLoops++;
+					if (int(t2-t1) > dt)
+					{
+						t1 = t2;
+						canvas->copyPixmap1ToWindow();
+//						if(progress->wasCancelled())
+//							break;
+//						progress->setProgress(nLoops);
+					}
+				}
+				while (flag);
+			}
+		}
+//		progress->reset();
+	}
+
+	if (layer->hasGeometry(TeLINES) && (appTheme->getTheme()->visibleRep() & TeLINES))
+	{
+//		nLoops = 0;
+//		progress->setTotalSteps(drawSet.size());
+		t2 = clock();
+		t0 = t1 = t2;
+
+		bool hasVisual = false;
+
+		if(visualMap)
+			hasVisual = (visualMap->find(TeLINES) != visualMap->end());
+
+		TeVisual* visualLin;
+
+		if(hasVisual)
+			visualLin = (*visualMap)[TeLINES];
+
+
+		for (i = 0; i < (int)inClauseVector.size(); ++i)
+		{
+			// query the database table containing the lines� geometry
+			tableName = layer->tableName(TeLINES);
+			string queryLines;
+			if ( db->dbmsName() == "SqlServerAdoSpatial" )	queryLines  = "SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data, c_legend_id, c_legend_own, c_object_status";
+			else											queryLines  = "SELECT " + tableName + ".*, c_legend_id, c_legend_own, c_object_status";
+			queryLines += " FROM " + tableName + ", " + theme->collectionTable();
+			queryLines += " WHERE object_id = c_object_id AND object_id IN " + inClauseVector[i];
+
+			portal->freeResult();
+			if (portal->query(queryLines, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+			{
+				delete portal;
+				return boxRet;
+			}
+			int	groPos = portal->getAttributeList().size() - 3;
+			int	ownPos = portal->getAttributeList().size() - 2;
+			int	resPos = portal->getAttributeList().size() - 1;
+
+			if(portal->fetchRow())
+			{
+				bool flag = true;
+				do
+				{
+					TeLine2D line;
+
+					if(hasVisual)
+					{
+						color = visualLin->color();
+						canvas->setLineColor(color.red_, color.green_, color.blue_);
+						canvas->setLineStyle((int)visualLin->style(),visualLin->width());
+					}
+					else
+					{
+						if(appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+							visual = getVisual(portal, appTheme, TeLINES, resPos, groPos, ownPos);					
+						else
+						{
+							string objId = portal->getData(1);
+							visual = getVisualRemote(portal, appTheme, TeLINES, objId);					
+						}						
+						color = visual.color();
+						canvas->setLineColor(color.red_, color.green_, color.blue_);
+						canvas->setLineStyle((int)visual.style(),visual.width());
+					}
+
+					flag = portal->fetchGeometry(line);
+					boxRet = TeUnion(boxRet, line.box());
+					canvas->plotLine(line);
+					t2 = clock();
+//					nLoops++;
+					if (int(t2-t1) > dt)
+					{
+						t1 = t2;
+						canvas->copyPixmap1ToWindow();
+//						if(progress->wasCancelled())
+//							break;
+//						progress->setProgress(nLoops);
+					}
+				}
+				while (flag);
+			}
+		}
+//		progress->reset();
+	}
+
+	if (layer->hasGeometry(TePOINTS) && (appTheme->getTheme()->visibleRep() & TePOINTS))
+	{
+		nLoops = 0;
+//		progress->setTotalSteps(drawSet.size());
+		t2 = clock();
+		t0 = t1 = t2;
+
+		bool hasVisual = false;
+
+		if(visualMap)
+			hasVisual = (visualMap->find(TePOINTS) != visualMap->end());
+
+		TeVisual* visualPt;
+
+		if(hasVisual)
+			visualPt = (*visualMap)[TePOINTS];
+
+
+
+		for (i = 0; i < (int)inClauseVector.size(); ++i)
+		{
+			// query the database table containing the points� geometry
+			tableName = layer->tableName(TePOINTS);
+			string queryLines;
+			if ( db->dbmsName() == "SqlServerAdoSpatial" )	queryLines  = "SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data, c_legend_id, c_legend_own, c_object_status";
+			else											queryLines  = "SELECT " + tableName + ".*, c_legend_id, c_legend_own, c_object_status";
+			queryLines += " FROM " + tableName + ", " + theme->collectionTable();
+			queryLines += " WHERE object_id = c_object_id AND object_id IN " + inClauseVector[i];
+
+			portal->freeResult();
+			if (portal->query(queryLines, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+			{
+				delete portal;
+				return boxRet;
+			}
+			int	groPos = portal->getAttributeList().size() - 3;
+			int	ownPos = portal->getAttributeList().size() - 2;
+			int	resPos = portal->getAttributeList().size() - 1;
+
+			if(portal->fetchRow())
+			{
+				bool flag = true;
+				do
+				{
+					TePoint point;
+
+					if(hasVisual)
+					{
+						color = visualPt->color();
+						canvas->setPointColor(color.red_, color.green_, color.blue_);
+						canvas->setPointStyle((int)visualPt->style(),visualPt->size());
+					}
+					else
+					{
+						if(appTheme->getTheme()->getProductId() != TeEXTERNALTHEME)
+							visual = getVisual(portal, appTheme, TePOINTS, resPos, groPos, ownPos);					
+						else
+						{
+							string objId = portal->getData(1);
+							visual = getVisualRemote(portal, appTheme, TePOINTS, objId);					
+						}					
+						color = visual.color();
+						canvas->setPointColor(color.red_, color.green_, color.blue_);
+						canvas->setPointStyle((int)visual.style(),visual.size());
+					}
+
+					flag = portal->fetchGeometry(point);
+					double dw = canvas->mapVtoCW(visual.size());
+					TeCoord2D p = point.location();
+					TeBox b(p.x()-dw, p.y()-dw, p.x()+dw, p.y()+dw);
+					boxRet = TeUnion(boxRet, b);
+					canvas->plotPoint(point);
+					t2 = clock();
+					nLoops++;
+					if (int(t2-t1) > dt)
+					{
+						t1 = t2;
+						canvas->copyPixmap1ToWindow();
+//						if(progress->wasCancelled())
+//							break;
+//						progress->setProgress(nLoops);
+					}
+				}
+				while (flag);
+			}
+		}
+//		progress->reset();
+	}
+	delete portal;
+	return boxRet;
+}
+
+template<class Canvas>
+bool objBoxInCanvas(TeAppTheme* appTheme, Canvas *canvas, set<string>& drawSet, TeGeomRep repType, TeBox& bout, double tol)
+{
+	//calculate the box that contains all the objects in objectIdSet.
+	//If this box is inside the canvas box, return true to indicate that
+	//is enough to paint the objects selected. If this box is not inside
+	//the canvas box, center this box in the canvas, and return false
+	//to indicate that a plot in the whole canvas area is necessary.
+
+	TeTheme* theme = (TeTheme*)appTheme->getTheme();
+	TeLayer *layer = theme->layer();
+	TeDatabase *db = layer->database();
+	TeDatabasePortal *portal = db->getPortal();
+
+	string tableName;
+	TeGeomRep rep;
+	if (repType & TePOLYGONS)
+	{
+		tableName = theme->layer()->tableName(TePOLYGONS);
+		rep = TePOLYGONS;
+	}
+	else if (repType & TeLINES)
+	{
+		tableName = theme->layer()->tableName(TeLINES);
+		rep = TeLINES;
+	}
+	else if (repType & TePOINTS)
+	{
+		tableName = theme->layer()->tableName(TePOINTS);
+		rep = TePOINTS;
+	}
+	else if (repType & TeCELLS)
+	{
+        tableName = theme->layer()->tableName(TeCELLS);
+		rep = TeCELLS;
+	}
+
+	set<string>::iterator it, beginIt;
+	int i, chunk = 200, size = drawSet.size();
+	string inClause, plic, fields, queryString;
+
+	beginIt = drawSet.begin();
+	while (size > 0)
+	{
+		portal->freeResult();
+		inClause = "(";
+		plic = "'";
+		i = 0;
+		for (it = beginIt; it != drawSet.end(); ++it)
+		{
+			if (i >= chunk)
+				break;
+			inClause += plic + *it + "',";
+			++i;
+		}
+		inClause[inClause.size() - 1] = ')';
+		beginIt = it;
+		size -= chunk;
+
+		if((repType & TePOLYGONS) || (repType & TeLINES) || (repType & TeCELLS))
+		{
+			string where = " object_id IN " + inClause;
+			string from = " " + tableName; 
+
+			TeBox ibox;
+
+			db->getMBRSelectedObjects(tableName, "spatial_data", from, where, "", rep, ibox, tol);
+
+			updateBox(bout, ibox);
+		}
+		else if(repType & TePOINTS)
+		{
+			string where = " object_id IN " + inClause;
+			string from = " " + tableName; 
+
+			TeBox ibox;
+
+			db->getMBRSelectedObjects(tableName, "spatial_data", from, where, "", rep, ibox, tol);
+
+			double x = ibox.x1();
+			double y = ibox.y1(); 
+
+			ibox.x1_ = x - tol;
+			ibox.y1_ = y - tol;
+			ibox.x2_ = x + tol;
+			ibox.y2_ = y + tol;
+
+			updateBox(bout, ibox);
+		}
+	}
+
+	TeBox cbox = canvas->getDataWorld();
+	if(TeWithin(bout, cbox) == true)
+	{
+		delete portal;
+		return true;
+	}
+
+	//box of the objects selected is not inside the canvas box
+	if(bout.width() < cbox.width())
+	{
+		double w = cbox.width();
+		double tw = bout.width();
+		double dw = (w - tw) / 2.;
+		bout.x1_ = bout.x1_ - dw;
+		bout.x2_ = bout.x2_ + dw;
+	}
+
+	if(bout.height() < cbox.height())
+	{
+		double h = cbox.height();
+		double th = bout.height();
+		double dh = (h - th) / 2.;
+		bout.y1_ = bout.y1_ - dh;
+		bout.y2_ = bout.y2_ + dh;
+	}
+
+	delete portal;
+
+	// layer to canvas projection
+	bout = TeRemapBox(bout, theme->layer()->projection(), canvas->projection());
+	return false;
+}
+
+
+template<class Canvas>
+void TePlotFrame(TeAppTheme* appTheme, Canvas* canvas, map<int, RepMap>& layerRepMap, map<string, TeGeomRepVisualMap*>& objVisualMap)
+{
+	string tableName, objectId;
+	TeColor color;
+	TeVisual visual;
+
+	TeTheme* theme = (TeTheme*)appTheme->getTheme();
+
+	if(theme->minScale() != 0 && theme->maxScale() != 0 && theme->minScale() > theme->maxScale())
+	{
+		if(theme->minScale() < canvas->scaleApx() || theme->maxScale() > canvas->scaleApx())
+			return;
+	}
+
+	TeLayer *layer = theme->layer();
+	TeDatabase *db = layer->database();
+	TeDatabasePortal *portal = db->getPortal();
+	canvas->setDataProjection (layer->projection());
+	map<int, RepMap>::iterator it = layerRepMap.find(layer->id());
+	TeGeomRepVisualMap* vmap;
+
+	TeBox box;
+	TeBox vb = box;
+	if(box.isValid())
+	{
+		canvas->mapDWtoCW(vb);
+		canvas->mapCWtoV(vb);
+	}
+
+	if (layer->hasGeometry(TeRASTER) || layer->hasGeometry(TeRASTERFILE) && (theme->visibleRep() & TeRASTER))
+	{
+		TeBox bIn;
+		if (box.isValid())
+		{
+			canvas->setClipRegion((int)vb.x1(), (int)vb.y1(), (int)vb.width(), (int)vb.height());
+			bIn = vb;	
+		}
+	
+		TeRaster* raster = theme->layer()->raster();
+		if (!theme->rasterVisual())
+			theme->createRasterVisual(raster);
+	
+		canvas->plotRaster(raster,theme->rasterVisual(), 0);
+	}	
+	if(layer->hasGeometry(TePOLYGONS) && (theme->visibleRep() & TePOLYGONS))
+	{
+		// query the database table containing the polygons� geometry
+		string wherebox = getWhereBox(portal, appTheme, canvas, TePOLYGONS, box);
+		tableName = layer->tableName(TePOLYGONS);
+
+		string queryPolygons  = "SELECT " + tableName + ".*";
+		queryPolygons += " FROM " + tableName + ", " + theme->collectionTable();
+		queryPolygons += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			queryPolygons += " AND " + wherebox;
+
+		queryPolygons += " ORDER BY " + db->getSQLOrderBy(TePOLYGONS);
+
+		portal->freeResult();
+
+		//Plot the polygons whose number was placed in nSteps
+		if (portal->query(queryPolygons, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+		{
+			delete portal;
+			return;
+		}
+		
+		if(portal->fetchRow())
+		{
+			bool flag;
+			flag = true;
+			do
+			{
+				TePolygon poly;
+				int geomId = atoi(portal->getData(0));
+				string oid = portal->getData(1);
+				if (objVisualMap.find(oid) != objVisualMap.end())
+					vmap = objVisualMap[oid];
+				else
+				{
+					flag = portal->fetchGeometry(poly);
+					continue;
+				}
+
+				visual = *(vmap->operator[](TePOLYGONS));					
+				color = visual.color();
+				canvas->setPolygonColor(color.red_, color.green_, color.blue_);
+				canvas->setPolygonStyle((int)visual.style(),visual.transparency());
+				color = visual.contourColor();
+				canvas->setPolygonLineColor (color.red_, color.green_, color.blue_);
+				canvas->setPolygonLineStyle((int)visual.contourStyle(),visual.contourWidth());
+				if(box.isValid())
+					canvas->setClipRegion((int)vb.x1(), (int)vb.y1(), (int)vb.width(), (int)vb.height());
+				if(it == layerRepMap.end())
+				{
+					flag = portal->fetchGeometry(poly);
+					canvas->plotPolygon(poly);
+				}
+				else
+				{
+					canvas->plotPolygon(layerRepMap[layer->id()].polygonMap_[geomId]);
+					int parent_id = atoi(portal->getData(4));
+					int parent = parent_id;
+					while(parent == parent_id)
+					{
+						flag = portal->fetchRow();
+						if(flag)
+							parent = atoi(portal->getData(4));
+						else
+							parent = -1;
+					}
+				}
+			}
+			while (flag);
+		}
+	}
+
+	if(box.isValid())
+		canvas->setClipRegion((int)vb.x1(), (int)vb.y1(), (int)vb.width(), (int)vb.height());
+	if(layer->hasGeometry(TeCELLS) && (theme->visibleRep() & TeCELLS))
+	{
+		// query the database table containing the polygons� geometry
+		string wherebox = getWhereBox(portal, appTheme, canvas, TeCELLS, box);
+		tableName = layer->tableName(TeCELLS);
+
+		string queryCells  = "SELECT " + tableName + ".*";
+		queryCells += " FROM " + tableName + ", " + theme->collectionTable();
+		queryCells += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			queryCells += " AND " + wherebox;
+
+		portal->freeResult();
+		if (portal->query(queryCells, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+		{
+			delete portal;
+			return;
+		}
+
+		if(portal->fetchRow())
+		{
+			bool flag;
+			flag = true;
+			do
+			{
+				TeCell cell;
+				string oid = portal->getData(1);
+				if (objVisualMap.find(oid) != objVisualMap.end())
+					vmap = objVisualMap[oid];
+				else
+				{
+					flag = portal->fetchGeometry(cell);
+					continue;
+				}
+				visual = *(vmap->operator[](TePOLYGONS));					
+				color = visual.color();
+				canvas->setPolygonColor(color.red_, color.green_, color.blue_);
+				canvas->setPolygonStyle((int)visual.style(),visual.transparency());
+				color = visual.contourColor();
+				canvas->setPolygonLineColor (color.red_, color.green_, color.blue_);
+				canvas->setPolygonLineStyle((int)visual.contourStyle(),visual.contourWidth());
+				flag = portal->fetchGeometry(cell);
+				canvas->plotCell(cell);
+			}
+			while (flag);
+		}
+	}
+
+	if (layer->hasGeometry(TeLINES) && (theme->visibleRep() & TeLINES))
+	{
+		string wherebox = getWhereBox(portal, appTheme, canvas, TeLINES, box);
+		// query the database table containing the lines� geometry
+		tableName = layer->tableName(TeLINES);
+
+		string queryLines  = "SELECT " + tableName + ".*";
+		queryLines += " FROM " + tableName + ", " + theme->collectionTable();
+		queryLines += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			queryLines += " AND " + wherebox;
+
+		portal->freeResult();
+		if (portal->query(queryLines, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+		{
+			delete portal;
+			return;
+		}
+
+		if(portal->fetchRow())
+		{
+			bool flag = true;
+			do
+			{
+				TeLine2D line;
+				int geomId = atoi(portal->getData(0));					
+				string oid = portal->getData(1);
+				if (objVisualMap.find(oid) != objVisualMap.end())
+					vmap = objVisualMap[oid];
+				else
+				{
+					flag = portal->fetchGeometry(line);
+					continue;
+				}
+
+				visual = *(vmap->operator[](TeLINES));					
+				color = visual.color();
+				canvas->setLineColor(color.red_, color.green_, color.blue_);
+				canvas->setLineStyle((int)visual.style(),visual.width());
+				if(it == layerRepMap.end())
+				{
+					flag = portal->fetchGeometry(line);
+					canvas->plotLine(line);
+				}
+				else
+				{
+					canvas->plotLine(layerRepMap[layer->id()].lineMap_[geomId]);
+					flag = portal->fetchRow();
+				}
+			}
+			while (flag);
+		}
+	}
+
+	if (layer->hasGeometry(TePOINTS) && (theme->visibleRep() & TePOINTS))
+	{
+		string wherebox = getWhereBox(portal, appTheme, canvas, TePOINTS, box);
+		// query the database table containing the points� geometry
+		tableName = layer->tableName(TePOINTS);
+
+		string queryPoints  = "SELECT " + tableName + ".*";
+		queryPoints += " FROM " + tableName + ", " + theme->collectionTable();
+		queryPoints += " WHERE object_id = c_object_id";
+		if(wherebox.empty() == false)
+			queryPoints += " AND " + wherebox;
+
+		portal->freeResult();
+		if(portal->query(queryPoints, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) == false)
+		{
+			delete portal;
+			return;
+		}
+
+		if(portal->fetchRow())
+		{
+			bool flag = true;
+			do
+			{
+				TePoint point;
+				string oid = portal->getData(1);
+				if (objVisualMap.find(oid) != objVisualMap.end())
+					vmap = objVisualMap[oid];
+				else
+				{
+					flag = portal->fetchGeometry(point);
+					continue;
+				}
+
+				visual = *(vmap->operator[](TePOINTS));					
+				color = visual.color();
+				canvas->setPointColor(color.red_, color.green_, color.blue_);
+				canvas->setPointStyle((int)visual.style(),visual.size());
+				flag = portal->fetchGeometry(point);
+				canvas->plotPoint(point);
+			}
+			while (flag);
+		}
+	}
+	delete portal;
+
+	if(box.isValid())
+		canvas->setClipping(false);
+}
+
+#endif
+
diff --git a/src/appUtils/TePlotView.h b/src/appUtils/TePlotView.h
new file mode 100644
index 0000000..eba7a18
--- /dev/null
+++ b/src/appUtils/TePlotView.h
@@ -0,0 +1,45 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation. 
+*************************************************************************************/
+/*! \file TePlotView.h
+    This file contains support to plot a view on a canvas
+*/
+#ifndef TEPLOTVIEW_H
+#define TEPLOTVIEW_H
+#include <TeView.h>
+#include <TePlotTheme.h>
+#include <TeDatabase.h>
+
+template<class Portal, class Canvas>
+void TePlotView (Portal *portal, TeView *view, Canvas *canvas)
+{
+	if (view->themes().size() == 0)
+		portal->loadView (*view);
+
+	for (int i=0 ; i < view->themes().size() ; i++)
+	{
+		TeAppTheme *theme = (TeTheme*)view->get(i);
+		if (theme->visible ())
+			TePlotTheme (portal, theme, canvas);
+	}
+}
+
+#endif
+
diff --git a/src/appUtils/ui/animation.ui b/src/appUtils/ui/animation.ui
new file mode 100644
index 0000000..454b026
--- /dev/null
+++ b/src/appUtils/ui/animation.ui
@@ -0,0 +1,366 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>Animation</class>
+<widget class="QDialog">
+    <property name="name">
+        <cstring>Animation</cstring>
+    </property>
+    <property name="geometry">
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>468</width>
+            <height>89</height>
+        </rect>
+    </property>
+    <property name="caption">
+        <string>Animation</string>
+    </property>
+    <property name="icon">
+        <pixmap>terralib.bmp</pixmap>
+    </property>
+    <grid>
+        <property name="name">
+            <cstring>unnamed</cstring>
+        </property>
+        <widget class="QLayoutWidget" row="0" column="0">
+            <property name="name">
+                <cstring>layout3</cstring>
+            </property>
+            <hbox>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QLayoutWidget">
+                    <property name="name">
+                        <cstring>layout2</cstring>
+                    </property>
+                    <hbox>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
+                        <widget class="QLabel">
+                            <property name="name">
+                                <cstring>velocityTextLabel</cstring>
+                            </property>
+                            <property name="text">
+                                <string>Velocity:</string>
+                            </property>
+                            <property name="alignment">
+                                <set>AlignVCenter|AlignRight</set>
+                            </property>
+                        </widget>
+                        <widget class="QLineEdit">
+                            <property name="name">
+                                <cstring>velocitylineEdit</cstring>
+                            </property>
+                            <property name="minimumSize">
+                                <size>
+                                    <width>30</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                            <property name="frameShape">
+                                <enum>LineEditPanel</enum>
+                            </property>
+                            <property name="frameShadow">
+                                <enum>Sunken</enum>
+                            </property>
+                        </widget>
+                    </hbox>
+                </widget>
+                <spacer>
+                    <property name="name">
+                        <cstring>spacer1</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
+                        <enum>Expanding</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>16</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget class="QSlider">
+                    <property name="name">
+                        <cstring>velocitySlider</cstring>
+                    </property>
+                    <property name="minimumSize">
+                        <size>
+                            <width>80</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                </widget>
+                <spacer>
+                    <property name="name">
+                        <cstring>spacer2</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
+                        <enum>Expanding</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>16</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget class="QScrollBar">
+                    <property name="name">
+                        <cstring>playingScrollBar</cstring>
+                    </property>
+                    <property name="minimumSize">
+                        <size>
+                            <width>260</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <widget class="QLayoutWidget" row="1" column="0">
+            <property name="name">
+                <cstring>layout47</cstring>
+            </property>
+            <hbox>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QPushButton">
+                    <property name="name">
+                        <cstring>directoryPushButton</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Directory...</string>
+                    </property>
+                    <property name="accel">
+                        <string></string>
+                    </property>
+                </widget>
+                <widget class="QCheckBox">
+                    <property name="name">
+                        <cstring>loopCheckBox</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Loop</string>
+                    </property>
+                    <property name="accel">
+                        <string></string>
+                    </property>
+                </widget>
+                <widget class="QPushButton">
+                    <property name="name">
+                        <cstring>playButton</cstring>
+                    </property>
+                    <property name="maximumSize">
+                        <size>
+                            <width>50</width>
+                            <height>32767</height>
+                        </size>
+                    </property>
+                    <property name="text">
+                        <string>PLAY</string>
+                    </property>
+                    <property name="accel">
+                        <string></string>
+                    </property>
+                </widget>
+                <widget class="QPushButton">
+                    <property name="name">
+                        <cstring>pauseButton</cstring>
+                    </property>
+                    <property name="maximumSize">
+                        <size>
+                            <width>50</width>
+                            <height>32767</height>
+                        </size>
+                    </property>
+                    <property name="text">
+                        <string>PAUSE</string>
+                    </property>
+                    <property name="accel">
+                        <string></string>
+                    </property>
+                </widget>
+                <widget class="QPushButton">
+                    <property name="name">
+                        <cstring>stopButton</cstring>
+                    </property>
+                    <property name="maximumSize">
+                        <size>
+                            <width>50</width>
+                            <height>32767</height>
+                        </size>
+                    </property>
+                    <property name="text">
+                        <string>STOP</string>
+                    </property>
+                    <property name="accel">
+                        <string></string>
+                    </property>
+                </widget>
+                <widget class="QLayoutWidget">
+                    <property name="name">
+                        <cstring>layout5</cstring>
+                    </property>
+                    <hbox>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
+                        <widget class="QLabel">
+                            <property name="name">
+                                <cstring>frameNumbertextLabel</cstring>
+                            </property>
+                            <property name="text">
+                                <string>Frame:</string>
+                            </property>
+                            <property name="alignment">
+                                <set>AlignVCenter|AlignRight</set>
+                            </property>
+                        </widget>
+                        <widget class="QLineEdit">
+                            <property name="name">
+                                <cstring>frameNumberLineEdit</cstring>
+                            </property>
+                            <property name="minimumSize">
+                                <size>
+                                    <width>30</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                            <property name="maximumSize">
+                                <size>
+                                    <width>40</width>
+                                    <height>32767</height>
+                                </size>
+                            </property>
+                            <property name="frameShape">
+                                <enum>LineEditPanel</enum>
+                            </property>
+                            <property name="frameShadow">
+                                <enum>Sunken</enum>
+                            </property>
+                        </widget>
+                    </hbox>
+                </widget>
+                <widget class="QPushButton">
+                    <property name="name">
+                        <cstring>helpPushButton</cstring>
+                    </property>
+                    <property name="maximumSize">
+                        <size>
+                            <width>50</width>
+                            <height>32767</height>
+                        </size>
+                    </property>
+                    <property name="text">
+                        <string>&Help</string>
+                    </property>
+                    <property name="accel">
+                        <string>Alt+H</string>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+    </grid>
+</widget>
+<connections>
+    <connection>
+        <sender>playButton</sender>
+        <signal>clicked()</signal>
+        <receiver>Animation</receiver>
+        <slot>playButton_clicked()</slot>
+    </connection>
+    <connection>
+        <sender>pauseButton</sender>
+        <signal>clicked()</signal>
+        <receiver>Animation</receiver>
+        <slot>pauseButton_clicked()</slot>
+    </connection>
+    <connection>
+        <sender>stopButton</sender>
+        <signal>clicked()</signal>
+        <receiver>Animation</receiver>
+        <slot>stopButton_clicked()</slot>
+    </connection>
+    <connection>
+        <sender>velocitySlider</sender>
+        <signal>valueChanged(int)</signal>
+        <receiver>Animation</receiver>
+        <slot>velocitySlider_valueChanged(int)</slot>
+    </connection>
+    <connection>
+        <sender>playingScrollBar</sender>
+        <signal>valueChanged(int)</signal>
+        <receiver>Animation</receiver>
+        <slot>playingScrollBar_valueChanged(int)</slot>
+    </connection>
+    <connection>
+        <sender>directoryPushButton</sender>
+        <signal>clicked()</signal>
+        <receiver>Animation</receiver>
+        <slot>directoryPushButton_clicked()</slot>
+    </connection>
+    <connection>
+        <sender>velocitylineEdit</sender>
+        <signal>returnPressed()</signal>
+        <receiver>Animation</receiver>
+        <slot>velocitylineEdit_returnPressed()</slot>
+    </connection>
+    <connection>
+        <sender>helpPushButton</sender>
+        <signal>clicked()</signal>
+        <receiver>Animation</receiver>
+        <slot>helpPushButton_clicked()</slot>
+    </connection>
+</connections>
+<includes>
+    <include location="global" impldecl="in declaration">TeQtAnimaThread.h</include>
+    <include location="global" impldecl="in implementation">help.h</include>
+    <include location="local" impldecl="in implementation">animation.ui.h</include>
+    <include location="global" impldecl="in declaration">TeAppUtilsDefines.h</include>
+</includes>
+<forwards>
+    <forward>class Help;</forward>
+    <forward>class TeQtCanvas;</forward>
+</forwards>
+<variables>
+    <variable>Help* help_;</variable>
+    <variable>TeQtAnimaThread animaThread_;</variable>
+    <variable>TeQtCanvas* canvas_;</variable>
+</variables>
+<slots>
+    <slot>init()</slot>
+    <slot>playButton_clicked()</slot>
+    <slot>pauseButton_clicked()</slot>
+    <slot>stopButton_clicked()</slot>
+    <slot>velocitySlider_valueChanged( int v )</slot>
+    <slot>playingScrollBar_valueChanged( int f )</slot>
+    <slot>closeEvent( QCloseEvent * )</slot>
+    <slot>directoryPushButton_clicked()</slot>
+    <slot>velocitylineEdit_returnPressed()</slot>
+    <slot>helpPushButton_clicked()</slot>
+</slots>
+<functions>
+    <function>setAnimaParams( QString & animaDir, TeQtCanvas* canvas )</function>
+    <function>playDir( QString dir )</function>
+    <function>setCanvas( TeQtCanvas* canvas )</function>
+</functions>
+<pixmapinproject/>
+<exportmacro>TLAPPUTILS_DLL</exportmacro>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/appUtils/ui/animation.ui.h b/src/appUtils/ui/animation.ui.h
new file mode 100644
index 0000000..778fca7
--- /dev/null
+++ b/src/appUtils/ui/animation.ui.h
@@ -0,0 +1,241 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+#include <qdir.h>
+#include <qvaluelist.h>
+#include <qapplication.h>
+//#include <terraViewBase.h>
+#include <TeQtCanvas.h>
+#include <TeQtAnimaThread.h>
+#include <TeWaitCursor.h>
+#include <qfiledialog.h>
+#include <qmessagebox.h>
+#include <qstringlist.h>
+#include <qdatetime.h>
+
+void Animation::init()
+{
+	help_ = 0;
+	canvas_ = 0;
+
+	pauseButton->setEnabled(false);
+	stopButton->setEnabled(false);
+	playButton->setEnabled(false);
+	playingScrollBar->setEnabled(false);
+	velocitySlider->setEnabled(false);
+	velocityTextLabel->setEnabled(false);
+	frameNumbertextLabel->setEnabled(false);
+	frameNumberLineEdit->setEnabled(false);
+	loopCheckBox->setEnabled(false);
+	velocitySlider->setMinValue(1);
+	velocitySlider->setMaxValue(1000);
+	velocitySlider->setValue(500);
+}
+
+void Animation::playButton_clicked()
+{
+	animaThread_.pause(false);
+	animaThread_.pauseFrame(0);
+	animaThread_.start();
+	playButton->setEnabled(false);
+	pauseButton->setEnabled(true);
+	stopButton->setEnabled(true);
+	playingScrollBar->setEnabled(true);
+	directoryPushButton->setEnabled(false);
+}
+
+
+void Animation::pauseButton_clicked()
+{
+	directoryPushButton->setEnabled(false);
+	bool p = !animaThread_.pause();
+	animaThread_.pause(p);
+	if(p == false)
+		animaThread_.start();
+}
+
+
+void Animation::stopButton_clicked()
+{
+	animaThread_.stop();
+	stopButton->setEnabled(false);
+	pauseButton->setEnabled(false);
+	playButton->setEnabled(true);
+	playingScrollBar->setEnabled(false);
+	directoryPushButton->setEnabled(true);
+}
+
+
+void Animation::velocitySlider_valueChanged( int v)
+{
+	string t = Te2String((double)v/10., 1);
+	velocitylineEdit->setText(t.c_str());
+}
+
+
+void Animation::playingScrollBar_valueChanged( int f)
+{
+	if(animaThread_.pause())
+		animaThread_.showFrame(f);
+	else
+		animaThread_.frame(f);
+}
+
+
+void Animation::closeEvent( QCloseEvent * )
+{
+	if(animaThread_.running())
+		animaThread_.stop();
+	hide();
+}
+
+
+void Animation::directoryPushButton_clicked()
+{
+	QString animaDir = QFileDialog::getExistingDirectory(
+			QString::null,
+			this,
+			tr("Get Existing Directory"),
+			tr("Select a directory"),
+			true);
+	setAnimaParams(animaDir, canvas_);
+}
+
+
+void Animation::setAnimaParams(QString& animaDir, TeQtCanvas* canvas)
+{
+	if (!animaDir.isEmpty())
+	{
+		TeWaitCursor wait;
+		if(animaThread_.running())
+			animaThread_.stop();
+
+		QDir dir(animaDir);
+
+		animaThread_.setAnimation(this, dir);	
+		velocityTextLabel->setEnabled(true);
+		velocitySlider->setEnabled(true);
+		frameNumbertextLabel->setEnabled(true);
+		loopCheckBox->setEnabled(true);
+
+		animaThread_.canvas(canvas);	
+		stopButton->setEnabled(false);
+		pauseButton->setEnabled(false);
+		playButton->setEnabled(true);
+		playingScrollBar->setEnabled(false);
+		directoryPushButton->setEnabled(false);
+
+		QStringList fileList;
+		fileList = dir.entryList(QDir::Files);
+		if(fileList.count() == 0)
+		{
+			velocitySlider->setMaxValue(1000);
+			velocitySlider->setValue(500);
+			wait.resetWaitCursor();
+			return;
+		}
+		QString s = *(fileList.at(0));
+		QString ss = dir.absPath() + "/" + s;
+		QPixmap pixmap(ss);
+		QPixmap pix(pixmap.width(), pixmap.height());
+		QTime time;
+		time.start();
+		pixmap.load(ss);
+		bitBlt(&pix, 0, 0, &pixmap, 0, 0, pixmap.width(), pixmap.height(), Qt::CopyROP);
+		int ms = time.elapsed();
+		time.restart();
+		pixmap.load(ss);
+		bitBlt(&pix, 0, 0, &pixmap, 0, 0, pixmap.width(), pixmap.height(), Qt::CopyROP);
+		ms += time.elapsed();
+		ms /= 2;
+		time.restart();
+		pixmap.load(ss);
+		bitBlt(&pix, 0, 0, &pixmap, 0, 0, pixmap.width(), pixmap.height(), Qt::CopyROP);
+		ms += time.elapsed();
+		ms /= 2;
+
+		int vmax = 20;
+		if(ms)
+			vmax = 10000/ms;
+		velocitySlider->setMaxValue(vmax);
+		velocitySlider->setValue(vmax/2);
+	}
+	else
+	{
+		QMessageBox::warning(this, tr("Warning"), tr("Select a directory!"));
+		pauseButton->setEnabled(false);
+		stopButton->setEnabled(false);
+		playButton->setEnabled(false);
+		playingScrollBar->setEnabled(false);
+		velocitySlider->setEnabled(false);
+		velocityTextLabel->setEnabled(false);
+		frameNumbertextLabel->setEnabled(false);
+		loopCheckBox->setEnabled(false);
+	}
+}
+
+void Animation::velocitylineEdit_returnPressed()
+{
+	QString t = velocitylineEdit->text();
+	double d = atof(t.latin1()) * 10.;
+	int v = (int)d;
+	velocitySlider->setValue(v);
+}
+
+
+void Animation::playDir( QString /* dir */)
+{
+	pauseButton->setEnabled(true);
+	stopButton->setEnabled(true);
+	playButton->setEnabled(true);
+	playingScrollBar->setEnabled(true);
+	velocitySlider->setEnabled(true);
+	velocityTextLabel->setEnabled(true);
+	frameNumbertextLabel->setEnabled(true);
+	loopCheckBox->setEnabled(true);
+	directoryPushButton->setEnabled(false);
+	directoryPushButton_clicked();
+	loopCheckBox->setChecked(true);
+	playButton_clicked();
+}
+
+void Animation::setCanvas( TeQtCanvas* canvas )
+{
+	canvas_ = canvas;
+}
+
+void Animation::helpPushButton_clicked()
+{
+	if(help_)
+		delete help_;
+
+	help_ = new Help(this, "help", false);
+	help_->init("animation.htm");
+	if(help_->erro_ == false)
+	{
+		help_->show();
+		help_->raise();
+	}
+	else
+	{
+		delete help_;
+		help_ = 0;
+	}
+}
diff --git a/src/appUtils/ui/help.ui b/src/appUtils/ui/help.ui
new file mode 100644
index 0000000..3e0f9ea
--- /dev/null
+++ b/src/appUtils/ui/help.ui
@@ -0,0 +1,368 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>Help</class>
+<widget class="QDialog">
+    <property name="name">
+        <cstring>Help</cstring>
+    </property>
+    <property name="geometry">
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>589</width>
+            <height>463</height>
+        </rect>
+    </property>
+    <property name="caption">
+        <string>Help</string>
+    </property>
+    <grid>
+        <property name="name">
+            <cstring>unnamed</cstring>
+        </property>
+        <widget class="QLayoutWidget" row="0" column="0">
+            <property name="name">
+                <cstring>layout4</cstring>
+            </property>
+            <grid>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QTextBrowser" row="1" column="0">
+                    <property name="name">
+                        <cstring>textBrowser</cstring>
+                    </property>
+                </widget>
+                <widget class="QLayoutWidget" row="0" column="0">
+                    <property name="name">
+                        <cstring>layout3</cstring>
+                    </property>
+                    <hbox>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer6</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>16</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer12</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>16</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer9_2</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>16</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="QPushButton">
+                            <property name="name">
+                                <cstring>homePushButton</cstring>
+                            </property>
+                            <property name="text">
+                                <string></string>
+                            </property>
+                            <property name="pixmap">
+                                <pixmap>reset.bmp</pixmap>
+                            </property>
+                            <property name="accel">
+                                <string></string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer11_2</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>18</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="QPushButton">
+                            <property name="name">
+                                <cstring>backwardPushButton</cstring>
+                            </property>
+                            <property name="text">
+                                <string></string>
+                            </property>
+                            <property name="pixmap">
+                                <pixmap>previousDisplay.bmp</pixmap>
+                            </property>
+                            <property name="accel">
+                                <string></string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer10</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>18</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="QPushButton">
+                            <property name="name">
+                                <cstring>forwardPushButton</cstring>
+                            </property>
+                            <property name="text">
+                                <string></string>
+                            </property>
+                            <property name="pixmap">
+                                <pixmap>nextDisplay.bmp</pixmap>
+                            </property>
+                            <property name="accel">
+                                <string></string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer11_3</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>21</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer9</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer13</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer12_2</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer8</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="QPushButton">
+                            <property name="name">
+                                <cstring>printPushButton</cstring>
+                            </property>
+                            <property name="text">
+                                <string>&Print</string>
+                            </property>
+                            <property name="accel">
+                                <string>Alt+P</string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer10_2</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>22</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer11</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>23</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer7</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>22</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                    </hbox>
+                </widget>
+            </grid>
+        </widget>
+    </grid>
+</widget>
+<connections>
+    <connection>
+        <sender>printPushButton</sender>
+        <signal>clicked()</signal>
+        <receiver>Help</receiver>
+        <slot>printPushButton_clicked()</slot>
+    </connection>
+</connections>
+<tabstops>
+    <tabstop>homePushButton</tabstop>
+    <tabstop>backwardPushButton</tabstop>
+    <tabstop>forwardPushButton</tabstop>
+    <tabstop>printPushButton</tabstop>
+    <tabstop>textBrowser</tabstop>
+</tabstops>
+<includes>
+    <include location="global" impldecl="in declaration">vector</include>
+    <include location="local" impldecl="in implementation">help.ui.h</include>
+    <include location="global" impldecl="in declaration">TeAppUtilsDefines.h</include>
+</includes>
+<forwards>
+    <forward>using namespace std;</forward>
+</forwards>
+<variables>
+    <variable access="public">bool erro_;</variable>
+    <variable access="private">vector<int> paragVec_;</variable>
+    <variable access="private">vector<int> indexVec_;</variable>
+</variables>
+<slots>
+    <slot>init( QString helpFile )</slot>
+    <slot access="protected">reject()</slot>
+    <slot>printPushButton_clicked()</slot>
+    <slot>fontSizeComboBox_activated( const QString & )</slot>
+    <slot>boldCheckBox_clicked()</slot>
+    <slot access="protected">backward()</slot>
+    <slot access="protected">forward()</slot>
+    <slot>linkClicked( const QString & )</slot>
+    <slot>anchorClicked( const QString &, const QString & )</slot>
+</slots>
+<functions>
+    <function>scrollToAnchor( const QString & )</function>
+</functions>
+<pixmapinproject/>
+<exportmacro>TLAPPUTILS_DLL</exportmacro>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/appUtils/ui/help.ui.h b/src/appUtils/ui/help.ui.h
new file mode 100644
index 0000000..2731e47
--- /dev/null
+++ b/src/appUtils/ui/help.ui.h
@@ -0,0 +1,204 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <qdir.h>
+#include <TeWaitCursor.h>
+#include <qprinter.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+#include <qsimplerichtext.h>
+#include <qmessagebox.h>
+#include <qapplication.h>
+#include <qtextcodec.h>
+
+void Help::init( QString helpFile )
+{
+	erro_ = false;
+	QDir dir;
+	QString absFile = qApp->applicationDirPath() + "/doc/" + QTextCodec::locale() + "/";
+	absFile += helpFile;
+	std::string path = absFile.latin1();
+	QFileInfo info(absFile);
+	bool exist = info.exists();
+	bool isReadable = info.isReadable();
+	if(exist==false || isReadable==false)
+	{
+		if(dir.cdUp())
+		{
+			if(dir.cdUp())
+			{
+				absFile = dir.absPath() + "/doc/" + QTextCodec::locale() + "/";
+				absFile += helpFile;
+				std::string path = absFile.latin1();
+				QFileInfo info(absFile);
+				exist = info.exists();
+				isReadable = info.isReadable();
+				if(exist==false || isReadable==false)
+					erro_ = true;;
+			}
+			else
+				erro_ = true;;
+		}
+		else
+			erro_ = true;;
+	}
+
+	if(erro_)
+	{
+		QMessageBox::information(this, this->caption(), tr("The help of this interface is not available yet!")); 
+		return;
+	}
+
+//	int size = textBrowser->font().pointSize();
+
+//	for(i=6; i<=24; ++i)
+//		fontSizeComboBox->insertItem(QString::number(i));
+
+//	fontSizeComboBox->setCurrentItem(size - 6);
+
+    connect(homePushButton, SIGNAL(clicked()), textBrowser, SLOT(home()));
+    connect(backwardPushButton, SIGNAL(clicked()), this, SLOT(backward()));
+    connect(forwardPushButton, SIGNAL(clicked()), this, SLOT(forward()));
+    connect(textBrowser, SIGNAL(linkClicked(const QString&)), this, SLOT(linkClicked(const QString&)));
+    connect(textBrowser, SIGNAL(anchorClicked(const QString&, const QString&)), this, SLOT(anchorClicked(const QString&, const QString&)));
+
+	textBrowser->setSource(absFile);
+	erro_ = false;
+}
+
+
+void Help::reject()
+{
+	hide();
+}
+
+
+void Help::printPushButton_clicked()
+{
+    QPrinter printer( QPrinter::HighResolution );
+    printer.setFullPage(true);
+    printer.setOptionEnabled(QPrinter::PrintSelection, false);
+    printer.setOptionEnabled(QPrinter::PrintPageRange, false);
+
+    if ( printer.setup( this ) )
+	{
+        QPainter p( &printer );
+        if( !p.isActive() ) // starting printing failed
+            return;
+        QPaintDeviceMetrics metrics(p.device());
+        int dpiy = metrics.logicalDpiY();
+        int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
+        QRect body( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
+        QSimpleRichText richText( textBrowser->text(),
+                                  textBrowser->font(),
+                                  textBrowser->context(),
+                                  textBrowser->styleSheet(),
+                                  textBrowser->mimeSourceFactory(),
+                                  body.height() );
+        richText.setWidth( &p, body.width() );
+        QRect view( body );
+
+		int page = 1;
+		do
+		{
+			richText.draw( &p, body.left(), body.top(), view, colorGroup() );
+			view.moveBy( 0, body.height() );
+			p.translate( 0 , -body.height() );
+			p.drawText( view.right() - p.fontMetrics().width( QString::number(page) ),
+						view.bottom() + p.fontMetrics().ascent() + 5, QString::number(page) );
+			if ( view.top()  >= richText.height() )
+				break;
+			printer.newPage();
+			page++;
+		} while (TRUE);
+	}
+}
+
+
+void Help::fontSizeComboBox_activated( const QString& /* size */ )
+{
+//	QFont font = textBrowser->font();
+//	font.setPointSize(size.toInt());
+//	font.setBold(boldCheckBox->isChecked());
+//	textBrowser->setFont(font);
+//	textBrowser->update();
+}
+
+
+void Help::boldCheckBox_clicked()
+{
+//	fontSizeComboBox_activated(fontSizeComboBox->currentText());
+}
+
+
+void Help::backward()
+{
+	if(paragVec_.size() == 0)
+	{
+		textBrowser->home();
+		return;
+	}
+
+	textBrowser->backward();
+
+	int para = paragVec_[paragVec_.size()-1];
+	paragVec_.pop_back();
+	int index = indexVec_[indexVec_.size()-1];
+	indexVec_.pop_back();
+
+	textBrowser->setCursorPosition(para, index);
+	textBrowser->ensureCursorVisible();
+}
+
+
+void Help::forward()
+{
+	int para, index;
+
+	textBrowser->getCursorPosition(&para, &index);
+
+	paragVec_.push_back(para);
+	indexVec_.push_back(index);
+
+	textBrowser->forward();
+}
+
+
+void Help::linkClicked(const QString & /* link */ )
+{
+	int para, index;
+
+	textBrowser->getCursorPosition(&para, &index);
+
+	paragVec_.push_back(para);
+	indexVec_.push_back(index);
+}
+
+
+void Help::anchorClicked(const QString & /* link */, const QString & /* anchor */ )
+{
+}
+
+
+void Help::scrollToAnchor( const QString &name)
+{
+	textBrowser->scrollToAnchor(name);
+}
diff --git a/src/appUtils/ui/mediaDescription.ui b/src/appUtils/ui/mediaDescription.ui
new file mode 100644
index 0000000..5528db4
--- /dev/null
+++ b/src/appUtils/ui/mediaDescription.ui
@@ -0,0 +1,226 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>MediaDescription</class>
+<widget class="QDialog">
+    <property name="name">
+        <cstring>MediaDescription</cstring>
+    </property>
+    <property name="geometry">
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>394</width>
+            <height>347</height>
+        </rect>
+    </property>
+    <property name="caption">
+        <string>Media Description</string>
+    </property>
+    <property name="icon">
+        <pixmap>terralib.bmp</pixmap>
+    </property>
+    <grid>
+        <property name="name">
+            <cstring>unnamed</cstring>
+        </property>
+        <property name="margin">
+            <number>11</number>
+        </property>
+        <property name="spacing">
+            <number>6</number>
+        </property>
+        <widget class="QLayoutWidget" row="0" column="0">
+            <property name="name">
+                <cstring>layout7</cstring>
+            </property>
+            <grid>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QTextEdit" row="0" column="0">
+                    <property name="name">
+                        <cstring>descriptionTextEdit</cstring>
+                    </property>
+                    <property name="minimumSize">
+                        <size>
+                            <width>370</width>
+                            <height>270</height>
+                        </size>
+                    </property>
+                </widget>
+                <spacer row="1" column="0">
+                    <property name="name">
+                        <cstring>Spacer15</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Vertical</enum>
+                    </property>
+                    <property name="sizeType">
+                        <enum>Expanding</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>16</width>
+                            <height>16</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget class="QLayoutWidget" row="2" column="0">
+                    <property name="name">
+                        <cstring>layout6</cstring>
+                    </property>
+                    <hbox>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer8</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>30</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="QPushButton">
+                            <property name="name">
+                                <cstring>savePushButton</cstring>
+                            </property>
+                            <property name="text">
+                                <string>&Save</string>
+                            </property>
+                            <property name="accel">
+                                <string>Alt+S</string>
+                            </property>
+                            <property name="default">
+                                <bool>true</bool>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property name="name">
+                                <cstring>Spacer13</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>30</width>
+                                    <height>16</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="QPushButton">
+                            <property name="name">
+                                <cstring>cancelPushButton</cstring>
+                            </property>
+                            <property name="text">
+                                <string>&Cancel</string>
+                            </property>
+                            <property name="accel">
+                                <string>Alt+C</string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property name="name">
+                                <cstring>Spacer14</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>20</width>
+                                    <height>16</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="QPushButton">
+                            <property name="name">
+                                <cstring>helpPushButton</cstring>
+                            </property>
+                            <property name="text">
+                                <string>&Help</string>
+                            </property>
+                            <property name="accel">
+                                <string>Alt+H</string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property name="name">
+                                <cstring>spacer7</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                    </hbox>
+                </widget>
+            </grid>
+        </widget>
+    </grid>
+</widget>
+<connections>
+    <connection>
+        <sender>savePushButton</sender>
+        <signal>clicked()</signal>
+        <receiver>MediaDescription</receiver>
+        <slot>savePushButton_clicked()</slot>
+    </connection>
+    <connection>
+        <sender>cancelPushButton</sender>
+        <signal>clicked()</signal>
+        <receiver>MediaDescription</receiver>
+        <slot>reject()</slot>
+    </connection>
+    <connection>
+        <sender>helpPushButton</sender>
+        <signal>clicked()</signal>
+        <receiver>MediaDescription</receiver>
+        <slot>helpPushButton_clicked()</slot>
+    </connection>
+</connections>
+<includes>
+    <include location="global" impldecl="in implementation">help.h</include>
+    <include location="local" impldecl="in implementation">mediaDescription.ui.h</include>
+    <include location="global" impldecl="in declaration">TeAppUtilsDefines.h</include>
+</includes>
+<forwards>
+    <forward>class Help;</forward>
+</forwards>
+<variables>
+    <variable>Help* help_;</variable>
+</variables>
+<slots>
+    <slot>savePushButton_clicked()</slot>
+    <slot>helpPushButton_clicked()</slot>
+</slots>
+<functions>
+    <function>init()</function>
+</functions>
+<pixmapinproject/>
+<exportmacro>TLAPPUTILS_DLL</exportmacro>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/appUtils/ui/mediaDescription.ui.h b/src/appUtils/ui/mediaDescription.ui.h
new file mode 100644
index 0000000..824247a
--- /dev/null
+++ b/src/appUtils/ui/mediaDescription.ui.h
@@ -0,0 +1,54 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+
+
+void MediaDescription::init()
+{
+	help_ = 0;
+}
+
+void MediaDescription::savePushButton_clicked()
+{
+	hide();
+}
+
+
+
+
+void MediaDescription::helpPushButton_clicked()
+{
+	if(help_)
+		delete help_;
+
+	help_ = new Help(this, "help", false);
+	help_->init("mediaDescription.htm");
+	if(help_->erro_ == false)
+	{
+		help_->show();
+		help_->raise();
+	}
+	else
+	{
+		delete help_;
+		help_ = 0;
+	}
+}
diff --git a/src/appUtils/ui/urlWindow.ui b/src/appUtils/ui/urlWindow.ui
new file mode 100644
index 0000000..00a66b4
--- /dev/null
+++ b/src/appUtils/ui/urlWindow.ui
@@ -0,0 +1,246 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>URLWindow</class>
+<widget class="QDialog">
+    <property name="name">
+        <cstring>URLWindow</cstring>
+    </property>
+    <property name="geometry">
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>308</width>
+            <height>99</height>
+        </rect>
+    </property>
+    <property name="caption">
+        <string>Insert URL</string>
+    </property>
+    <property name="icon">
+        <pixmap>terralib.bmp</pixmap>
+    </property>
+    <property name="sizeGripEnabled">
+        <bool>true</bool>
+    </property>
+    <grid>
+        <property name="name">
+            <cstring>unnamed</cstring>
+        </property>
+        <property name="margin">
+            <number>11</number>
+        </property>
+        <property name="spacing">
+            <number>6</number>
+        </property>
+        <widget class="QLayoutWidget" row="0" column="0">
+            <property name="name">
+                <cstring>Layout6</cstring>
+            </property>
+            <grid>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <property name="margin">
+                    <number>0</number>
+                </property>
+                <property name="spacing">
+                    <number>6</number>
+                </property>
+                <widget class="QLayoutWidget" row="0" column="0">
+                    <property name="name">
+                        <cstring>Layout5</cstring>
+                    </property>
+                    <hbox>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
+                        <property name="margin">
+                            <number>0</number>
+                        </property>
+                        <property name="spacing">
+                            <number>6</number>
+                        </property>
+                        <widget class="QLabel">
+                            <property name="name">
+                                <cstring>URLTextLabel</cstring>
+                            </property>
+                            <property name="text">
+                                <string>URL:</string>
+                            </property>
+                            <property name="alignment">
+                                <set>AlignVCenter|AlignRight</set>
+                            </property>
+                        </widget>
+                        <widget class="QLineEdit">
+                            <property name="name">
+                                <cstring>URLLineEdit</cstring>
+                            </property>
+                            <property name="minimumSize">
+                                <size>
+                                    <width>250</width>
+                                    <height>0</height>
+                                </size>
+                            </property>
+                            <property name="frameShape">
+                                <enum>LineEditPanel</enum>
+                            </property>
+                            <property name="frameShadow">
+                                <enum>Sunken</enum>
+                            </property>
+                        </widget>
+                    </hbox>
+                </widget>
+                <widget class="QLayoutWidget" row="2" column="0">
+                    <property name="name">
+                        <cstring>Layout2</cstring>
+                    </property>
+                    <hbox>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
+                        <property name="margin">
+                            <number>0</number>
+                        </property>
+                        <property name="spacing">
+                            <number>6</number>
+                        </property>
+                        <widget class="QPushButton">
+                            <property name="name">
+                                <cstring>okPushButton</cstring>
+                            </property>
+                            <property name="text">
+                                <string>&OK</string>
+                            </property>
+                            <property name="accel">
+                                <string>Alt+O</string>
+                            </property>
+                            <property name="default">
+                                <bool>true</bool>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property name="name">
+                                <cstring>Spacer1</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>31</width>
+                                    <height>0</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="QPushButton">
+                            <property name="name">
+                                <cstring>cancelPushButton</cstring>
+                            </property>
+                            <property name="text">
+                                <string>&Cancel</string>
+                            </property>
+                            <property name="accel">
+                                <string>Alt+C</string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property name="name">
+                                <cstring>Spacer2</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>31</width>
+                                    <height>0</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="QPushButton">
+                            <property name="name">
+                                <cstring>helpPushButton</cstring>
+                            </property>
+                            <property name="text">
+                                <string>&Help</string>
+                            </property>
+                            <property name="accel">
+                                <string>Alt+H</string>
+                            </property>
+                        </widget>
+                    </hbox>
+                </widget>
+                <spacer row="1" column="0">
+                    <property name="name">
+                        <cstring>Spacer3</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Vertical</enum>
+                    </property>
+                    <property name="sizeType">
+                        <enum>Expanding</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>0</width>
+                            <height>31</height>
+                        </size>
+                    </property>
+                </spacer>
+            </grid>
+        </widget>
+    </grid>
+</widget>
+<connections>
+    <connection>
+        <sender>okPushButton</sender>
+        <signal>clicked()</signal>
+        <receiver>URLWindow</receiver>
+        <slot>okPushButton_clicked()</slot>
+    </connection>
+    <connection>
+        <sender>cancelPushButton</sender>
+        <signal>clicked()</signal>
+        <receiver>URLWindow</receiver>
+        <slot>reject()</slot>
+    </connection>
+    <connection>
+        <sender>helpPushButton</sender>
+        <signal>clicked()</signal>
+        <receiver>URLWindow</receiver>
+        <slot>helpPushButton_clicked()</slot>
+    </connection>
+</connections>
+<tabstops>
+    <tabstop>URLLineEdit</tabstop>
+    <tabstop>okPushButton</tabstop>
+    <tabstop>cancelPushButton</tabstop>
+    <tabstop>helpPushButton</tabstop>
+</tabstops>
+<includes>
+    <include location="global" impldecl="in implementation">help.h</include>
+    <include location="local" impldecl="in implementation">urlWindow.ui.h</include>
+    <include location="global" impldecl="in declaration">TeAppUtilsDefines.h</include>
+</includes>
+<forwards>
+    <forward>class Help;</forward>
+</forwards>
+<variables>
+    <variable>Help* help_;</variable>
+</variables>
+<slots>
+    <slot>okPushButton_clicked()</slot>
+    <slot>helpPushButton_clicked()</slot>
+</slots>
+<functions>
+    <function access="private" specifier="non virtual">init()</function>
+</functions>
+<pixmapinproject/>
+<exportmacro>TLAPPUTILS_DLL</exportmacro>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/appUtils/ui/urlWindow.ui.h b/src/appUtils/ui/urlWindow.ui.h
new file mode 100644
index 0000000..85d475b
--- /dev/null
+++ b/src/appUtils/ui/urlWindow.ui.h
@@ -0,0 +1,51 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+
+
+void URLWindow::init()
+{
+	help_ = 0;
+}
+
+void URLWindow::okPushButton_clicked()
+{
+    accept();
+}
+
+void URLWindow::helpPushButton_clicked()
+{
+	if(help_)
+		delete help_;
+
+	help_ = new Help(this, "help", false);
+	help_->init("urlWindow.htm");
+	if(help_->erro_ == false)
+	{
+		help_->show();
+		help_->raise();
+	}
+	else
+	{
+		delete help_;
+		help_ = 0;
+	}
+}
diff --git a/src/dxflib/dl_attributes.h b/src/dxflib/dl_attributes.h
new file mode 100644
index 0000000..6d8aebb
--- /dev/null
+++ b/src/dxflib/dl_attributes.h
@@ -0,0 +1,182 @@
+/****************************************************************************
+** $Id: dl_attributes.h 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DL_ATTRIBUTES_H
+#define DL_ATTRIBUTES_H
+
+#include <string>
+using std::string;
+
+#include "dl_codes.h"
+
+/**
+ * Storing and passing around attributes. Attributes
+ * are the layer name, color, width and line type.
+ *
+ * @author Andrew Mustun
+ */
+class DL_Attributes {
+
+public:
+
+    /**
+     * Default constructor.
+     */
+    DL_Attributes() {
+        setLayer("");
+        setColor(0);
+        setWidth(0);
+        setLineType("BYLAYER");
+    }
+
+
+
+    /**
+     * Constructor for DXF attributes.
+     *
+     * @param layer Layer name for this entity or NULL for no layer
+     *              (every entity should be on a named layer!).
+     * @param color Color number (0..256). 0 = BYBLOCK, 256 = BYLAYER.
+     * @param width Line thickness. Defaults to zero. -1 = BYLAYER, 
+     *               -2 = BYBLOCK, -3 = default width
+     * @param lineType Line type name or "BYLAYER" or "BYBLOCK". Defaults
+     *              to "BYLAYER"
+     */
+    DL_Attributes(const string& layer,
+                  int color, int width,
+                  const string& lineType) {
+        setLayer(layer);
+        setColor(color);
+        setWidth(width);
+        setLineType(lineType);
+    }
+
+
+
+    /**
+     * Sets the layer. If the given pointer points to NULL, the
+     *  new layer name will be an empty but valid string.
+     */
+    void setLayer(const string& layer) {
+        this->layer = layer;
+    }
+
+
+
+    /**
+     * @return Layer name.
+     */
+    string getLayer() const {
+        return layer;
+    }
+
+
+
+    /**
+     * Sets the color.
+     *
+     * @see DL_Codes, dxfColors
+     */
+    void setColor(int color) {
+        this->color = color;
+    }
+
+
+
+    /**
+     * @return Color.
+     *
+     * @see DL_Codes, dxfColors
+     */
+    int getColor() const {
+        return color;
+    }
+
+
+
+    /**
+     * Sets the width.
+     */
+    void setWidth(int width) {
+        this->width = width;
+    }
+
+
+
+    /**
+     * @return Width.
+     */
+    int getWidth() const {
+        return width;
+    }
+
+
+
+    /**
+     * Sets the line type. This can be any string and is not
+     *  checked to be a valid line type. 
+     */
+    void setLineType(const string& lineType) {
+        this->lineType = lineType;
+    }
+
+
+
+    /**
+     * @return Line type.
+     */
+    string getLineType() const {
+        if (lineType.length()==0) {
+            return "BYLAYER";
+        } else {
+            return lineType;
+        }
+    }
+
+
+
+    /**
+     * Copies attributes (deep copies) from another attribute object.
+     */
+    DL_Attributes operator = (const DL_Attributes& attrib) {
+        setLayer(attrib.layer);
+        setColor(attrib.color);
+        setWidth(attrib.width);
+        setLineType(attrib.lineType);
+
+        return *this;
+    }
+
+private:
+    string layer;
+    int color;
+    int width;
+    string lineType;
+};
+
+#endif
+
+// EOF
diff --git a/src/dxflib/dl_codes.h b/src/dxflib/dl_codes.h
new file mode 100644
index 0000000..8021879
--- /dev/null
+++ b/src/dxflib/dl_codes.h
@@ -0,0 +1,542 @@
+/****************************************************************************
+** $Id: dl_codes.h 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+** Copyright (C) 2001 Robert J. Campbell Jr.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+/**
+ * Defines common DXF codes and constants.
+ */
+
+#ifndef DXF_CODES_H
+#define DXF_CODES_H
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#if defined(__OS2__)||defined(__EMX__)
+#define strcasecmp(s,t) stricmp(s,t)
+#endif
+
+#if defined(_WIN32)
+#define strcasecmp(s,t) _stricmp(s,t)
+#endif
+
+
+#ifdef _WIN32
+#undef M_PI
+#define M_PI   3.14159265358979323846
+#pragma warning(disable : 4800)
+#endif
+
+#ifndef M_PI
+#define M_PI 3.1415926535897932384626433832795
+#endif
+
+#define DL_DXF_MAXLINE 1024
+#define DL_DXF_MAXGROUPCODE 1100
+
+// used to mark invalid vectors:
+//#define DL_DXF_MAXDOUBLE 1.0E+10
+
+/**
+ * Codes for colors and DXF versions.
+ */
+class DL_Codes {
+public:
+    /**
+     * Standard DXF colors.
+     */
+    enum color {
+        black = 250,
+        green = 3,
+        red = 1,
+        brown = 15,
+        yellow = 2,
+        cyan = 4,
+        magenta = 6,
+        gray = 8,
+        blue = 5,
+        l_blue = 163,
+        l_green = 121,
+        l_cyan = 131,
+        l_red = 23,
+        l_magenta = 221,
+        l_gray = 252,
+        white = 7,
+        bylayer = 256,
+        byblock = 0
+    };
+
+    /**
+     * Version numbers for the DXF Format.
+     */
+    enum version {
+        AC1009, AC1012, AC1014, AC1015
+    };
+};
+
+
+// Extended color palette:
+// The first entry is only for direct indexing starting with [1]
+// Color 1 is red (1,0,0)
+const double dxfColors[][3] = {
+                                  {0,0,0},                // unused
+                                  {1,0,0},                // 1
+                                  {1,1,0},
+                                  {0,1,0},
+                                  {0,1,1},
+                                  {0,0,1},
+                                  {1,0,1},
+                                  {1,1,1},                // black or white
+                                  {0.5,0.5,0.5},
+                                  {0.75,0.75,0.75},
+                                  {1,0,0},                // 10
+                                  {1,0.5,0.5},
+                                  {0.65,0,0},
+                                  {0.65,0.325,0.325},
+                                  {0.5,0,0},
+                                  {0.5,0.25,0.25},
+                                  {0.3,0,0},
+                                  {0.3,0.15,0.15},
+                                  {0.15,0,0},
+                                  {0.15,0.075,0.075},
+                                  {1,0.25,0},             // 20
+                                  {1,0.625,0.5},
+                                  {0.65,0.1625,0},
+                                  {0.65,0.4063,0.325},
+                                  {0.5,0.125,0},
+                                  {0.5,0.3125,0.25},
+                                  {0.3,0.075,0},
+                                  {0.3,0.1875,0.15},
+                                  {0.15,0.0375,0},
+                                  {0.15,0.0938,0.075},
+                                  {1,0.5,0},              // 30
+                                  {1,0.75,0.5},
+                                  {0.65,0.325,0},
+                                  {0.65,0.4875,0.325},
+                                  {0.5,0.25,0},
+                                  {0.5,0.375,0.25},
+                                  {0.3,0.15,0},
+                                  {0.3,0.225,0.15},
+                                  {0.15,0.075,0},
+                                  {0.15,0.1125,0.075},
+                                  {1,0.75,0},             // 40
+                                  {1,0.875,0.5},
+                                  {0.65,0.4875,0},
+                                  {0.65,0.5688,0.325},
+                                  {0.5,0.375,0},
+                                  {0.5,0.4375,0.25},
+                                  {0.3,0.225,0},
+                                  {0.3,0.2625,0.15},
+                                  {0.15,0.1125,0},
+                                  {0.15,0.1313,0.075},
+                                  {1,1,0},                // 50
+                                  {1,1,0.5},
+                                  {0.65,0.65,0},
+                                  {0.65,0.65,0.325},
+                                  {0.5,0.5,0},
+                                  {0.5,0.5,0.25},
+                                  {0.3,0.3,0},
+                                  {0.3,0.3,0.15},
+                                  {0.15,0.15,0},
+                                  {0.15,0.15,0.075},
+                                  {0.75,1,0},             // 60
+                                  {0.875,1,0.5},
+                                  {0.4875,0.65,0},
+                                  {0.5688,0.65,0.325},
+                                  {0.375,0.5,0},
+                                  {0.4375,0.5,0.25},
+                                  {0.225,0.3,0},
+                                  {0.2625,0.3,0.15},
+                                  {0.1125,0.15,0},
+                                  {0.1313,0.15,0.075},
+                                  {0.5,1,0},              // 70
+                                  {0.75,1,0.5},
+                                  {0.325,0.65,0},
+                                  {0.4875,0.65,0.325},
+                                  {0.25,0.5,0},
+                                  {0.375,0.5,0.25},
+                                  {0.15,0.3,0},
+                                  {0.225,0.3,0.15},
+                                  {0.075,0.15,0},
+                                  {0.1125,0.15,0.075},
+                                  {0.25,1,0},             // 80
+                                  {0.625,1,0.5},
+                                  {0.1625,0.65,0},
+                                  {0.4063,0.65,0.325},
+                                  {0.125,0.5,0},
+                                  {0.3125,0.5,0.25},
+                                  {0.075,0.3,0},
+                                  {0.1875,0.3,0.15},
+                                  {0.0375,0.15,0},
+                                  {0.0938,0.15,0.075},
+                                  {0,1,0},                // 90
+                                  {0.5,1,0.5},
+                                  {0,0.65,0},
+                                  {0.325,0.65,0.325},
+                                  {0,0.5,0},
+                                  {0.25,0.5,0.25},
+                                  {0,0.3,0},
+                                  {0.15,0.3,0.15},
+                                  {0,0.15,0},
+                                  {0.075,0.15,0.075},
+                                  {0,1,0.25},             // 100
+                                  {0.5,1,0.625},
+                                  {0,0.65,0.1625},
+                                  {0.325,0.65,0.4063},
+                                  {0,0.5,0.125},
+                                  {0.25,0.5,0.3125},
+                                  {0,0.3,0.075},
+                                  {0.15,0.3,0.1875},
+                                  {0,0.15,0.0375},
+                                  {0.075,0.15,0.0938},
+                                  {0,1,0.5},              // 110
+                                  {0.5,1,0.75},
+                                  {0,0.65,0.325},
+                                  {0.325,0.65,0.4875},
+                                  {0,0.5,0.25},
+                                  {0.25,0.5,0.375},
+                                  {0,0.3,0.15},
+                                  {0.15,0.3,0.225},
+                                  {0,0.15,0.075},
+                                  {0.075,0.15,0.1125},
+                                  {0,1,0.75},             // 120
+                                  {0.5,1,0.875},
+                                  {0,0.65,0.4875},
+                                  {0.325,0.65,0.5688},
+                                  {0,0.5,0.375},
+                                  {0.25,0.5,0.4375},
+                                  {0,0.3,0.225},
+                                  {0.15,0.3,0.2625},
+                                  {0,0.15,0.1125},
+                                  {0.075,0.15,0.1313},
+                                  {0,1,1},                // 130
+                                  {0.5,1,1},
+                                  {0,0.65,0.65},
+                                  {0.325,0.65,0.65},
+                                  {0,0.5,0.5},
+                                  {0.25,0.5,0.5},
+                                  {0,0.3,0.3},
+                                  {0.15,0.3,0.3},
+                                  {0,0.15,0.15},
+                                  {0.075,0.15,0.15},
+                                  {0,0.75,1},             // 140
+                                  {0.5,0.875,1},
+                                  {0,0.4875,0.65},
+                                  {0.325,0.5688,0.65},
+                                  {0,0.375,0.5},
+                                  {0.25,0.4375,0.5},
+                                  {0,0.225,0.3},
+                                  {0.15,0.2625,0.3},
+                                  {0,0.1125,0.15},
+                                  {0.075,0.1313,0.15},
+                                  {0,0.5,1},              // 150
+                                  {0.5,0.75,1},
+                                  {0,0.325,0.65},
+                                  {0.325,0.4875,0.65},
+                                  {0,0.25,0.5},
+                                  {0.25,0.375,0.5},
+                                  {0,0.15,0.3},
+                                  {0.15,0.225,0.3},
+                                  {0,0.075,0.15},
+                                  {0.075,0.1125,0.15},
+                                  {0,0.25,1},             // 160
+                                  {0.5,0.625,1},
+                                  {0,0.1625,0.65},
+                                  {0.325,0.4063,0.65},
+                                  {0,0.125,0.5},
+                                  {0.25,0.3125,0.5},
+                                  {0,0.075,0.3},
+                                  {0.15,0.1875,0.3},
+                                  {0,0.0375,0.15},
+                                  {0.075,0.0938,0.15},
+                                  {0,0,1},                // 170
+                                  {0.5,0.5,1},
+                                  {0,0,0.65},
+                                  {0.325,0.325,0.65},
+                                  {0,0,0.5},
+                                  {0.25,0.25,0.5},
+                                  {0,0,0.3},
+                                  {0.15,0.15,0.3},
+                                  {0,0,0.15},
+                                  {0.075,0.075,0.15},
+                                  {0.25,0,1},             // 180
+                                  {0.625,0.5,1},
+                                  {0.1625,0,0.65},
+                                  {0.4063,0.325,0.65},
+                                  {0.125,0,0.5},
+                                  {0.3125,0.25,0.5},
+                                  {0.075,0,0.3},
+                                  {0.1875,0.15,0.3},
+                                  {0.0375,0,0.15},
+                                  {0.0938,0.075,0.15},
+                                  {0.5,0,1},              // 190
+                                  {0.75,0.5,1},
+                                  {0.325,0,0.65},
+                                  {0.4875,0.325,0.65},
+                                  {0.25,0,0.5},
+                                  {0.375,0.25,0.5},
+                                  {0.15,0,0.3},
+                                  {0.225,0.15,0.3},
+                                  {0.075,0,0.15},
+                                  {0.1125,0.075,0.15},
+                                  {0.75,0,1},             // 200
+                                  {0.875,0.5,1},
+                                  {0.4875,0,0.65},
+                                  {0.5688,0.325,0.65},
+                                  {0.375,0,0.5},
+                                  {0.4375,0.25,0.5},
+                                  {0.225,0,0.3},
+                                  {0.2625,0.15,0.3},
+                                  {0.1125,0,0.15},
+                                  {0.1313,0.075,0.15},
+                                  {1,0,1},                // 210
+                                  {1,0.5,1},
+                                  {0.65,0,0.65},
+                                  {0.65,0.325,0.65},
+                                  {0.5,0,0.5},
+                                  {0.5,0.25,0.5},
+                                  {0.3,0,0.3},
+                                  {0.3,0.15,0.3},
+                                  {0.15,0,0.15},
+                                  {0.15,0.075,0.15},
+                                  {1,0,0.75},             // 220
+                                  {1,0.5,0.875},
+                                  {0.65,0,0.4875},
+                                  {0.65,0.325,0.5688},
+                                  {0.5,0,0.375},
+                                  {0.5,0.25,0.4375},
+                                  {0.3,0,0.225},
+                                  {0.3,0.15,0.2625},
+                                  {0.15,0,0.1125},
+                                  {0.15,0.075,0.1313},
+                                  {1,0,0.5},              // 230
+                                  {1,0.5,0.75},
+                                  {0.65,0,0.325},
+                                  {0.65,0.325,0.4875},
+                                  {0.5,0,0.25},
+                                  {0.5,0.25,0.375},
+                                  {0.3,0,0.15},
+                                  {0.3,0.15,0.225},
+                                  {0.15,0,0.075},
+                                  {0.15,0.075,0.1125},
+                                  {1,0,0.25},             // 240
+                                  {1,0.5,0.625},
+                                  {0.65,0,0.1625},
+                                  {0.65,0.325,0.4063},
+                                  {0.5,0,0.125},
+                                  {0.5,0.25,0.3125},
+                                  {0.3,0,0.075},
+                                  {0.3,0.15,0.1875},
+                                  {0.15,0,0.0375},
+                                  {0.15,0.075,0.0938},
+                                  {0.33,0.33,0.33},       // 250
+                                  {0.464,0.464,0.464},
+                                  {0.598,0.598,0.598},
+                                  {0.732,0.732,0.732},
+                                  {0.866,0.866,0.866},
+                                  {1,1,1}                 // 255
+                              }
+                              ;
+
+
+// AutoCAD VERSION aliases
+#define VER_R12    DL_Codes::AC1009
+#define VER_LT2    DL_Codes::AC1009
+#define VER_R13    DL_Codes::AC1012   // not supported yet
+#define VER_LT95   DL_Codes::AC1012   // not supported yet
+#define VER_R14    DL_Codes::AC1014   // not supported yet
+#define VER_LT97   DL_Codes::AC1014   // not supported yet
+#define VER_LT98   DL_Codes::AC1014   // not supported yet
+#define VER_2000   DL_Codes::AC1015
+#define VER_2002   DL_Codes::AC1015
+
+
+// DXF Group Codes:
+
+// Strings
+#define STRGRP_START      0
+#define STRGRP_END        9
+
+// Coordinates
+#define CRDGRP_START     10
+#define CRDGRP_END       19
+
+// Real values
+#define RLGRP_START      38
+#define RLGRP_END        59
+
+// Short integer values
+#define SHOGRP_START     60
+#define SHOGRP_END       79
+
+// New in Release 13,
+#define SUBCLASS        100
+
+// More coordinates
+#define CRD2GRP_START   210
+#define CRD2GRP_END     239
+
+// Extended data strings
+#define ESTRGRP_START  1000
+#define ESTRGRP_END    1009
+
+// Extended data reals
+#define ERLGRP_START   1010
+#define ERLGRP_END     1059
+
+
+#define Y8_COORD_CODE       28
+#define Z0_COORD_CODE       30
+#define Z8_COORD_CODE       38
+
+#define POINT_COORD_CODE    10
+#define INSERT_COORD_CODE   10
+
+#define CRD2GRP_START      210
+#define CRD2GRP_END        239
+
+#define THICKNESS            39
+#define FIRST_REAL_CODE      THICKNESS
+#define LAST_REAL_CODE       59
+#define FIRST_INT_CODE       60
+#define ATTFLAGS_CODE        70
+#define PLINE_FLAGS_CODE     70
+#define LAYER_FLAGS_CODE     70
+#define FLD_LEN_CODE         73 // Inside ATTRIB resbuf
+#define LAST_INT_CODE        79
+#define X_EXTRU_CODE        210
+#define Y_EXTRU_CODE        220
+#define Z_EXTRU_CODE        230
+#define COMMENT_CODE        999
+
+// Start and endpoints of a line
+#define LINE_START_CODE      10  // Followed by x coord
+#define LINE_END_CODE        11  // Followed by x coord
+
+// Some codes used by blocks
+#define BLOCK_FLAGS_CODE     70  // An int containing flags
+#define BLOCK_BASE_CODE      10  // Origin of block definition
+#define XREF_DEPENDENT       16  // If a block contains an XREF
+#define XREF_RESOLVED        32  // If a XREF resolved ok
+#define REFERENCED           64  // If a block is ref'd in DWG
+
+#define XSCALE_CODE          41
+#define YSCALE_CODE          42
+#define ANGLE_CODE           50
+#define INS_POINT_CODE       10  // Followed by x of ins pnt
+#define NAME2_CODE            3  // Second appearance of name
+
+// Some codes used by circle entities
+#define CENTER_CODE          10  // Followed by x of center
+#define RADIUS_CODE          40  // Followd by radius of circle
+
+#define COND_OP_CODE         -4  // Conditional op,ads_ssget
+
+// When using ads_buildlist you MUST use RTDXF0 instead of these
+#define ENTITY_TYPE_CODE      0  // Then there is LINE, 3DFACE..
+#define SES_CODE              0  // Start End String Code
+#define FILE_SEP_CODE         0  // File separator
+#define SOT_CODE              0  // Start Of Table
+#define TEXTVAL_CODE          1
+#define NAME_CODE             2
+#define BLOCK_NAME_CODE       2
+#define SECTION_NAME_CODE     2
+#define ENT_HAND_CODE         5  // What follows is hexa string
+#define TXT_STYLE_CODE        7  // Inside attributes
+#define LAYER_NAME_CODE       8  // What follows is layer name
+#define FIRST_XCOORD_CODE    10  // Group code x of 1st coord
+#define FIRST_YCOORD_CODE    20  // Group code y of 1st coord
+#define FIRST_ZCOORD_CODE    30  // Group code z of 1st coord
+#define L_START_CODE         10
+#define L_END_CODE           11
+#define TXTHI_CODE           40
+#define SCALE_X_CODE         41
+#define SCALE_Y_CODE         42
+#define SCALE_Z_CODE         43
+#define BULGE_CODE           42  // Used in PLINE verts for arcs
+#define ROTATION_CODE        50
+#define COLOUR_CODE          62  // What follows is a color int
+#define LTYPE_CODE            6  // What follows is a linetype
+
+
+// Attribute flags
+#define ATTS_FOLLOW_CODE     66
+#define ATT_TAG_CODE          2
+#define ATT_VAL_CODE          1
+#define ATT_FLAGS_CODE       70  // 4 1 bit flags as follows...
+#define ATT_INVIS_FLAG        1
+#define ATT_CONST_FLAG        2
+#define ATT_VERIFY_FLAG       4 // Prompt and verify
+#define ATT_PRESET_FLAG       8 // No prompt and no verify
+
+// PLINE defines
+// Flags
+#define OPEN_PLINE       0x00
+#define CLOSED_PLINE     0x01
+#define POLYLINE3D       0x80
+#define PFACE_MESH       0x40
+#define PGON_MESH        0x10
+// Vertices follow entity, required in POLYLINES
+#define VERTS_FOLLOW_CODE   66 // Value should always be 1
+#define VERTEX_COORD_CODE   10
+
+
+// LAYER flags
+#define FROZEN           1
+#define FROZEN_BY_DEF    2
+#define LOCKED           4
+#define OBJECT_USED     64   // Object is ref'd in the dwg
+
+#define BLOCK_EN_CODE   -2   // Block entity definition
+#define E_NAME          -1   // Entity name
+
+// Extended data codes
+#define EXTD_SENTINEL    (-3)
+#define EXTD_STR         1000
+#define EXTD_APP_NAME    1001
+#define EXTD_CTL_STR     1002
+#define EXTD_LYR_STR     1003
+#define EXTD_CHUNK       1004
+#define EXTD_HANDLE      1005
+#define EXTD_POINT       1010
+#define EXTD_POS         1011
+#define EXTD_DISP        1012
+#define EXTD_DIR         1013
+#define EXTD_FLOAT       1040
+#define EXTD_DIST        1041
+#define EXTD_SCALE       1042
+#define EXTD_INT16       1070
+#define EXTD_INT32       1071
+
+// UCS codes for use in ads_trans
+#define WCS_TRANS_CODE      0
+#define UCS_TRANS_CODE      1
+#define DCS_TRANS_CODE      2
+#define PCS_TRANS_CODE      3
+
+#endif
+
diff --git a/src/dxflib/dl_creationadapter.h b/src/dxflib/dl_creationadapter.h
new file mode 100644
index 0000000..f2877e8
--- /dev/null
+++ b/src/dxflib/dl_creationadapter.h
@@ -0,0 +1,102 @@
+/****************************************************************************
+** $Id: dl_creationadapter.h 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DL_CREATIONADAPTER_H
+#define DL_CREATIONADAPTER_H
+
+#include "dl_creationinterface.h"
+
+/**
+ * An abstract adapter class for receiving DXF events when a DXF file is being read. 
+ * The methods in this class are empty. This class exists as convenience for creating 
+ * listener objects.
+ *
+ * @author Andrew Mustun
+ */
+class DL_CreationAdapter : public DL_CreationInterface {
+public:
+    DL_CreationAdapter() {}
+    virtual ~DL_CreationAdapter() {}
+    virtual void addLayer(const DL_LayerData&) {}
+    virtual void addBlock(const DL_BlockData&) {}
+    virtual void endBlock() {}
+    virtual void addPoint(const DL_PointData&) {}
+    virtual void addLine(const DL_LineData&) {}
+    virtual void addArc(const DL_ArcData&) {}
+    virtual void addCircle(const DL_CircleData&) {}
+    virtual void addEllipse(const DL_EllipseData&) {}
+	
+    virtual void addPolyline(const DL_PolylineData&) {}
+    virtual void addVertex(const DL_VertexData&) {}
+	
+    virtual void addSpline(const DL_SplineData&) {}
+    virtual void addControlPoint(const DL_ControlPointData&) {}
+    virtual void addKnot(const DL_KnotData&) {}
+	
+    virtual void addInsert(const DL_InsertData&) {}
+	
+    virtual void addMText(const DL_MTextData&) {}
+    virtual void addMTextChunk(const char*) {}
+    virtual void addText(const DL_TextData&) {}
+	
+    virtual void addDimAlign(const DL_DimensionData&,
+                             const DL_DimAlignedData&) {}
+    virtual void addDimLinear(const DL_DimensionData&,
+                              const DL_DimLinearData&) {}
+    virtual void addDimRadial(const DL_DimensionData&,
+                              const DL_DimRadialData&) {}
+    virtual void addDimDiametric(const DL_DimensionData&,
+                              const DL_DimDiametricData&) {}
+    virtual void addDimAngular(const DL_DimensionData&,
+                              const DL_DimAngularData&) {}
+    virtual void addDimAngular3P(const DL_DimensionData&,
+                              const DL_DimAngular3PData&) {}
+    virtual void addDimOrdinate(const DL_DimensionData&,
+                             const DL_DimOrdinateData&) {}
+    virtual void addLeader(const DL_LeaderData&) {}
+    virtual void addLeaderVertex(const DL_LeaderVertexData&) {}
+	
+    virtual void addHatch(const DL_HatchData&) {}
+
+    virtual void addTrace(const DL_TraceData&) {}
+    virtual void add3dFace(const DL_3dFaceData&) {}
+    virtual void addSolid(const DL_SolidData&) {}
+	
+    virtual void addImage(const DL_ImageData&) {}
+	virtual void linkImage(const DL_ImageDefData&) {}
+    virtual void addHatchLoop(const DL_HatchLoopData&) {}
+    virtual void addHatchEdge(const DL_HatchEdgeData&) {}
+    virtual void endEntity() {}
+    virtual void addComment(const char* comment) {}
+    virtual void setVariableVector(const char*, 
+	               double, double, double, int) {}
+    virtual void setVariableString(const char*, const char*, int) {}
+    virtual void setVariableInt(const char*, int, int) {}
+    virtual void setVariableDouble(const char*, double, int) {}
+    virtual void endSequence() {}
+};
+
+#endif
diff --git a/src/dxflib/dl_creationinterface.h b/src/dxflib/dl_creationinterface.h
new file mode 100644
index 0000000..6ae5dc4
--- /dev/null
+++ b/src/dxflib/dl_creationinterface.h
@@ -0,0 +1,266 @@
+/****************************************************************************
+** $Id: dl_creationinterface.h 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DL_CREATIONINTERFACE_H
+#define DL_CREATIONINTERFACE_H
+
+#include <string.h>
+
+#include "dl_attributes.h"
+#include "dl_codes.h"
+#include "dl_entities.h"
+#include "dl_extrusion.h"
+
+/**
+ * Abstract class (interface) for the creation of new entities.
+ * Inherit your class which takes care of the entities in the 
+ * processed DXF file from this interface. 
+ *
+ * Double arrays passed to your implementation contain 3 double 
+ * values for x, y, z coordinates unless stated differently.
+ *
+ * @author Andrew Mustun
+ */
+class DL_CreationInterface {
+public:
+    DL_CreationInterface() {
+        extrusion = new DL_Extrusion;
+    }
+    virtual ~DL_CreationInterface() {
+        delete extrusion;
+    }
+
+    /**
+     * Called for every layer.
+     */
+    virtual void addLayer(const DL_LayerData& data) = 0;
+
+    /**
+     * Called for every block. Note: all entities added after this
+     * command go into this block until endBlock() is called.
+    *
+     * @see endBlock()
+     */
+    virtual void addBlock(const DL_BlockData& data) = 0;
+
+    /** Called to end the current block */
+    virtual void endBlock() = 0;
+
+    /** Called for every point */
+    virtual void addPoint(const DL_PointData& data) = 0;
+
+    /** Called for every line */
+    virtual void addLine(const DL_LineData& data) = 0;
+
+    /** Called for every arc */
+    virtual void addArc(const DL_ArcData& data) = 0;
+
+    /** Called for every circle */
+    virtual void addCircle(const DL_CircleData& data) = 0;
+
+    /** Called for every ellipse */
+    virtual void addEllipse(const DL_EllipseData& data) = 0;
+
+    /** Called for every polyline start */
+    virtual void addPolyline(const DL_PolylineData& data) = 0;
+
+    /** Called for every polyline vertex */
+    virtual void addVertex(const DL_VertexData& data) = 0;
+	
+	/** Called for every spline */
+    virtual void addSpline(const DL_SplineData& data) = 0;
+	
+	/** Called for every spline control point */
+    virtual void addControlPoint(const DL_ControlPointData& data) = 0;
+	
+	/** Called for every spline knot value */
+    virtual void addKnot(const DL_KnotData& data) = 0;
+
+    /** Called for every insert. */
+    virtual void addInsert(const DL_InsertData& data) = 0;
+    
+    /** Called for every trace start */
+    virtual void addTrace(const DL_TraceData& data) = 0;
+    
+    /** Called for every 3dface start */
+    virtual void add3dFace(const DL_3dFaceData& data) = 0;
+
+    /** Called for every solid start */
+    virtual void addSolid(const DL_SolidData& data) = 0;
+
+
+    /** Called for every Multi Text entity. */
+    virtual void addMText(const DL_MTextData& data) = 0;
+
+    /**
+     * Called for additional text chunks for MTEXT entities.
+     * The chunks come at 250 character in size each. Note that 
+     * those chunks come <b>before</b> the actual MTEXT entity.
+     */
+    virtual void addMTextChunk(const char* text) = 0;
+
+    /** Called for every Text entity. */
+    virtual void addText(const DL_TextData& data) = 0;
+
+    /**
+     * Called for every aligned dimension entity. 
+     */
+    virtual void addDimAlign(const DL_DimensionData& data,
+                             const DL_DimAlignedData& edata) = 0;
+    /**
+     * Called for every linear or rotated dimension entity. 
+     */
+    virtual void addDimLinear(const DL_DimensionData& data,
+                              const DL_DimLinearData& edata) = 0;
+
+	/**
+     * Called for every radial dimension entity. 
+     */
+    virtual void addDimRadial(const DL_DimensionData& data,
+                              const DL_DimRadialData& edata) = 0;
+
+	/**
+     * Called for every diametric dimension entity. 
+     */
+    virtual void addDimDiametric(const DL_DimensionData& data,
+                              const DL_DimDiametricData& edata) = 0;
+
+	/**
+     * Called for every angular dimension (2 lines version) entity. 
+     */
+    virtual void addDimAngular(const DL_DimensionData& data,
+                              const DL_DimAngularData& edata) = 0;
+
+	/**
+     * Called for every angular dimension (3 points version) entity. 
+     */
+    virtual void addDimAngular3P(const DL_DimensionData& data,
+                              const DL_DimAngular3PData& edata) = 0;
+	
+    /**
+     * Called for every ordinate dimension entity. 
+     */
+    virtual void addDimOrdinate(const DL_DimensionData& data,
+                             const DL_DimOrdinateData& edata) = 0;
+    
+    /** 
+	 * Called for every leader start. 
+	 */
+    virtual void addLeader(const DL_LeaderData& data) = 0;
+	
+	/** 
+	 * Called for every leader vertex 
+	 */
+    virtual void addLeaderVertex(const DL_LeaderVertexData& data) = 0;
+	
+	/** 
+	 * Called for every hatch entity. 
+	 */
+    virtual void addHatch(const DL_HatchData& data) = 0;
+	
+	/** 
+	 * Called for every image entity. 
+	 */
+    virtual void addImage(const DL_ImageData& data) = 0;
+
+	/**
+	 * Called for every image definition.
+	 */
+	virtual void linkImage(const DL_ImageDefData& data) = 0;
+
+	/** 
+	 * Called for every hatch loop. 
+	 */
+    virtual void addHatchLoop(const DL_HatchLoopData& data) = 0;
+
+	/** 
+	 * Called for every hatch edge entity. 
+	 */
+    virtual void addHatchEdge(const DL_HatchEdgeData& data) = 0;
+	
+	/** 
+	 * Called after an entity has been completed.  
+	 */
+    virtual void endEntity() = 0;
+    
+    /**
+     * Called for every comment in the DXF file (code 999).
+     */
+    virtual void addComment(const char* comment) = 0;
+
+    /**
+     * Called for every vector variable in the DXF file (e.g. "$EXTMIN").
+     */
+    virtual void setVariableVector(const char* key, 
+	               double v1, double v2, double v3, int code) = 0;
+	
+    /**
+     * Called for every string variable in the DXF file (e.g. "$ACADVER").
+     */
+    virtual void setVariableString(const char* key, const char* value, int code) = 0;
+	
+    /**
+     * Called for every int variable in the DXF file (e.g. "$ACADMAINTVER").
+     */
+    virtual void setVariableInt(const char* key, int value, int code) = 0;
+	
+    /**
+     * Called for every double variable in the DXF file (e.g. "$DIMEXO").
+     */
+    virtual void setVariableDouble(const char* key, double value, int code) = 0;
+	
+     /**
+      * Called when a SEQEND occurs (when a POLYLINE or ATTRIB is done)
+      */
+     virtual void endSequence() = 0;
+
+    /** Sets the current attributes for entities. */
+    void setAttributes(const DL_Attributes& attrib) {
+        attributes = attrib;
+    }
+
+    /** @return the current attributes used for new entities. */
+    DL_Attributes getAttributes() {
+        return attributes;
+    }
+
+    /** Sets the current attributes for entities. */
+    void setExtrusion(double dx, double dy, double dz, double elevation) {
+        extrusion->setDirection(dx, dy, dz);
+		extrusion->setElevation(elevation);
+    }
+
+    /** @return the current attributes used for new entities. */
+    DL_Extrusion* getExtrusion() {
+        return extrusion;
+    }
+
+protected:
+    DL_Attributes attributes;
+    DL_Extrusion *extrusion;
+};
+
+#endif
diff --git a/src/dxflib/dl_dxf.cpp b/src/dxflib/dl_dxf.cpp
new file mode 100644
index 0000000..208313c
--- /dev/null
+++ b/src/dxflib/dl_dxf.cpp
@@ -0,0 +1,5070 @@
+/****************************************************************************
+** $Id: dl_dxf.cpp 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "dl_dxf.h"
+
+#include <algorithm>
+#include <string>
+#include <cstdio>
+#include <cassert>
+#include <cmath>
+
+#include "dl_attributes.h"
+#include "dl_codes.h"
+#include "dl_creationinterface.h"
+#include "dl_writer_ascii.h"
+
+
+/**
+ * Default constructor.
+ */
+DL_Dxf::DL_Dxf() {
+    styleHandleStd = 0;
+    version = VER_2000;
+
+    vertices = NULL;
+    maxVertices = 0;
+    vertexIndex = 0;
+
+    knots = NULL;
+    maxKnots = 0;
+    knotIndex = 0;
+
+    controlPoints = NULL;
+    maxControlPoints = 0;
+    controlPointIndex = 0;
+
+    leaderVertices = NULL;
+    maxLeaderVertices = 0;
+    leaderVertexIndex = 0;
+
+    hatchLoops = NULL;
+    maxHatchLoops = 0;
+    hatchLoopIndex = -1;
+    hatchEdges = NULL;
+    maxHatchEdges = NULL;
+    hatchEdgeIndex = NULL;
+    dropEdges = false;
+}
+
+
+
+/**
+ * Destructor.
+ */
+DL_Dxf::~DL_Dxf() {
+    if (vertices!=NULL) {
+        delete[] vertices;
+    }
+    if (knots!=NULL) {
+        delete[] knots;
+    }
+    if (controlPoints!=NULL) {
+        delete[] controlPoints;
+    }
+    if (leaderVertices!=NULL) {
+        delete[] leaderVertices;
+    }
+    if (hatchLoops!=NULL) {
+        delete[] hatchLoops;
+    }
+    if (hatchEdges!=NULL) {
+        for (int i=0; i<maxHatchLoops; ++i) {
+            if (hatchEdges[i]!=NULL) {
+                delete[] hatchEdges[i];
+            }
+        }
+        delete[] hatchEdges;
+    }
+    if (maxHatchEdges!=NULL) {
+        delete[] maxHatchEdges;
+    }
+    if (hatchEdgeIndex!=NULL) {
+        delete[] hatchEdgeIndex;
+    }
+}
+
+
+
+/**
+ * @brief Reads the given file and calls the appropriate functions in
+ * the given creation interface for every entity found in the file.
+ *
+ * @param file Input
+ *		Path and name of file to read
+ * @param creationInterface
+ *		Pointer to the class which takes care of the entities in the file.
+ *
+ * @retval true If \p file could be opened.
+ * @retval false If \p file could not be opened.
+ */
+bool DL_Dxf::in(const string& file, DL_CreationInterface* creationInterface) {
+    FILE *fp;
+    firstCall = true;
+    currentEntity = DL_UNKNOWN;
+    int errorCounter = 0;
+
+    fp = fopen(file.c_str(), "rt");
+    if (fp) {
+        while (readDxfGroups(fp, creationInterface, &errorCounter)) {}
+        fclose(fp);
+        if (errorCounter>0) {
+            std::cerr << "DXF Filter: There have been " << errorCounter <<
+            " errors. The drawing might be incomplete / incorrect.\n";
+        }
+        return true;
+    }
+
+    return false;
+}
+
+
+
+/**
+ * Reads a DXF file from an existing stream.
+ *
+ * @param stream The string stream.
+ * @param creationInterface
+ *		Pointer to the class which takes care of the entities in the file.
+ *
+ * @retval true If \p file could be opened.
+ * @retval false If \p file could not be opened.
+ */
+#ifndef __GCC2x__
+bool DL_Dxf::in(std::stringstream& stream,
+                DL_CreationInterface* creationInterface) {
+    
+    int errorCounter = 0;
+
+    if (stream.good()) {
+        firstCall=true;
+        currentEntity = DL_UNKNOWN;
+        while (readDxfGroups(stream, creationInterface, &errorCounter)) {}
+        if (errorCounter>0) {
+            std::cerr << "DXF Filter: There have been " << errorCounter <<
+            " errors. The drawing might be incomplete / incorrect.\n";
+        }
+        return true;
+    }
+    return false;
+}
+#endif
+
+
+
+/**
+ * @brief Reads a group couplet from a DXF file.  Calls another function
+ * to process it.
+ *
+ * A group couplet consists of two lines that represent a single
+ * piece of data.  An integer constant on the first line indicates
+ * the type of data.  The value is on the next line.\n
+ *
+ * This function reads a couplet, determines the type of data, and
+ * passes the value to the the appropriate handler function of
+ * \p creationInterface.\n
+ * 
+ * \p fp is advanced so that the next call to \p readDXFGroups() reads
+ * the next couplet in the file.
+ *
+ * @param fp Handle of input file
+ * @param creationInterface Handle of class which processes entities
+ *		in the file
+ *
+ * @retval true If EOF not reached.
+ * @retval false If EOF reached.
+ */
+bool DL_Dxf::readDxfGroups(FILE *fp, DL_CreationInterface* creationInterface,
+                           int* errorCounter) {
+
+    bool ok = true;
+    static int line = 1;
+
+    // Read one group of the DXF file and chop the lines:
+    if (DL_Dxf::getChoppedLine(groupCodeTmp, DL_DXF_MAXLINE, fp) &&
+            DL_Dxf::getChoppedLine(groupValue, DL_DXF_MAXLINE, fp) ) {
+
+        groupCode = (unsigned int)stringToInt(groupCodeTmp, &ok);
+
+        if (ok) {
+            //std::cerr << groupCode << "\n";
+            //std::cerr << groupValue << "\n";
+            line+=2;
+            processDXFGroup(creationInterface, groupCode, groupValue);
+        } else {
+            std::cerr << "DXF read error: Line: " << line << "\n";
+            if (errorCounter!=NULL) {
+                (*errorCounter)++;
+            }
+            // try to fix:
+            std::cerr << "DXF read error: trying to fix..\n";
+            // drop a line to sync:
+            DL_Dxf::getChoppedLine(groupCodeTmp, DL_DXF_MAXLINE, fp);
+        }
+    }
+
+    return !feof(fp);
+}
+
+
+
+/**
+ * Same as above but for stringstreams.
+ */
+#ifndef __GCC2x__
+bool DL_Dxf::readDxfGroups(std::stringstream& stream,
+                           DL_CreationInterface* creationInterface,
+                           int* errorCounter) {
+
+    bool ok = true;
+    static int line = 1;
+
+    // Read one group of the DXF file and chop the lines:
+    if (DL_Dxf::getChoppedLine(groupCodeTmp, DL_DXF_MAXLINE, stream) &&
+            DL_Dxf::getChoppedLine(groupValue, DL_DXF_MAXLINE, stream) ) {
+
+        groupCode = (unsigned int)stringToInt(groupCodeTmp, &ok);
+
+        if (ok) {
+            //std::cout << "group code: " << groupCode << "\n";
+            //std::cout << "group value: " << groupValue << "\n";
+            line+=2;
+            processDXFGroup(creationInterface, groupCode, groupValue);
+        } else {
+            std::cerr << "DXF read error: Line: " << line << "\n";
+            if (errorCounter!=NULL) {
+                (*errorCounter)++;
+            }
+            // try to fix:
+            //std::cerr << "DXF read error: trying to fix..\n";
+            // drop a line to sync:
+            //DL_Dxf::getChoppedLine(groupCodeTmp, DL_DXF_MAXLINE, stream);
+        }
+    }
+    return !stream.eof();
+}
+#endif
+
+
+
+/**
+ * @brief Reads line from file & strips whitespace at start and newline 
+ * at end.
+ *
+ * @param s Output\n
+ *		Pointer to character array that chopped line will be returned in.
+ * @param size Size of \p s.  (Including space for NULL.)
+ * @param fp Input\n
+ *		Handle of input file.
+ *
+ * @retval true if line could be read
+ * @retval false if \p fp is already at end of file
+ *
+ * @todo Change function to use safer FreeBSD strl* functions
+ * @todo Is it a problem if line is blank (i.e., newline only)?
+ *		Then, when function returns, (s==NULL).
+ */
+bool DL_Dxf::getChoppedLine(char *s, unsigned int size, FILE *fp) {
+    if (!feof(fp)) {
+        // The whole line in the file.  Includes space for NULL.
+        char* wholeLine = new char[size];
+        // Only the useful part of the line
+        char* line;
+
+        line = fgets(wholeLine, size, fp);
+
+        if (line!=NULL && line[0] != '\0') { // Evaluates to fgets() retval
+            // line == wholeLine at this point.
+            // Both guaranteed to be NULL terminated.
+
+            // Strip leading whitespace and trailing CR/LF.
+            stripWhiteSpace(&line);
+
+            strncpy(s, line, size);
+            s[size] = '\0';
+            // s should always be NULL terminated, because:
+            assert(size > strlen(line));
+        }
+
+        delete[] wholeLine; // Done with wholeLine
+
+        return true;
+    } else {
+        s[0] = '\0';
+        return false;
+    }
+}
+
+
+
+/**
+ * Same as above but for stringstreams.
+ */
+#ifndef __GCC2x__
+bool DL_Dxf::getChoppedLine(char *s, unsigned int size,
+                            std::stringstream& stream) {
+
+    if (!stream.eof()) {
+        // Only the useful part of the line
+        char* line = new char[size+1];
+        char* oriLine = line;
+        stream.getline(line, size);
+        stripWhiteSpace(&line);
+        strncpy(s, line, size);
+        s[size] = '\0';
+        assert(size > strlen(s));
+        delete[] oriLine;
+        return true;
+    } else {
+        s[0] = '\0';
+        return false;
+    }
+}
+#endif
+
+
+
+/**
+ * @brief Strips leading whitespace and trailing Carriage Return (CR)
+ * and Line Feed (LF) from NULL terminated string.
+ *
+ * @param s Input and output.
+ *		NULL terminates string.
+ *
+ * @retval true if \p s is non-NULL
+ * @retval false if \p s is NULL
+ */
+bool DL_Dxf::stripWhiteSpace(char** s) {
+    // last non-NULL char:
+    int lastChar = strlen(*s) - 1;
+
+    // Is last character CR or LF?
+    while ( (lastChar >= 0) &&
+            (((*s)[lastChar] == 10) || ((*s)[lastChar] == 13) ||
+             ((*s)[lastChar] == ' ' || ((*s)[lastChar] == '\t'))) ) {
+        (*s)[lastChar] = '\0';
+        lastChar--;
+    }
+
+    // Skip whitespace, excluding \n, at beginning of line
+    while ((*s)[0]==' ' || (*s)[0]=='\t') {
+        ++(*s);
+    }
+    
+    return ((*s) ? true : false);
+}
+
+
+
+/**
+ * Processes a group (pair of group code and value).
+ *
+ * @param creationInterface Handle to class that creates entities and
+ * other CAD data from DXF group codes
+ *
+ * @param groupCode Constant indicating the data type of the group.
+ * @param groupValue The data value.
+ *
+ * @retval true if done processing current entity and new entity begun
+ * @retval false if not done processing current entity
+*/
+bool DL_Dxf::processDXFGroup(DL_CreationInterface* creationInterface,
+                             int groupCode, const char *groupValue) {
+
+    // Init on first call
+    if (firstCall) {
+        for (int i=0; i<DL_DXF_MAXGROUPCODE; ++i) {
+            values[i][0] = '\0';
+        }
+        settingValue[0] = '\0';
+        firstCall=false;
+    }
+
+    // Indicates comment or dxflib version:
+    if (groupCode==999) {
+        if (groupValue!=NULL) {
+            if (!strncmp(groupValue, "dxflib", 6)) {
+                libVersion = getLibVersion(&groupValue[7]);
+            }
+            
+            addComment(creationInterface, groupValue);
+        }
+    }
+
+    // Indicates start of new entity or var
+    else if (groupCode==0 || groupCode==9) {
+
+        // If new entity is encountered, the last one must be complete
+        // prepare attributes which can be used for most entities:
+        char name[DL_DXF_MAXLINE+1];
+        if ((values[8])[0]!='\0') {
+            strcpy(name, values[8]);
+        }
+        // defaults to layer '0':
+        else {
+            strcpy(name, "0");
+        }
+
+        int width;
+        // Compatibillity with qcad1:
+        if ((values[39])[0]!='\0' &&
+                (values[370])[0]=='\0') {
+            width = toInt(values[39], -1);
+        }
+        // since autocad 2002:
+        else if ((values[370])[0]!='\0') {
+            width = toInt(values[370], -1);
+        }
+        // default to BYLAYER:
+        else {
+            width = -1;
+        }
+
+        int color;
+        color = toInt(values[62], 256);
+
+        char linetype[DL_DXF_MAXLINE+1];
+        strcpy(linetype, toString(values[6], "BYLAYER"));
+
+        attrib = DL_Attributes(values[8],          // layer
+                               color,              // color
+                               width,              // width
+                               linetype);          // linetype
+        creationInterface->setAttributes(attrib);
+
+        creationInterface->setExtrusion(toReal(values[210], 0.0),
+                                        toReal(values[220], 0.0),
+                                        toReal(values[230], 1.0),
+                                        toReal(values[30], 0.0));
+
+        // Add the last entity via creationInterface
+        switch (currentEntity) {
+        case DL_SETTING:
+            addSetting(creationInterface);
+            break;
+
+        case DL_LAYER:
+            addLayer(creationInterface);
+            break;
+
+        case DL_BLOCK:
+            addBlock(creationInterface);
+            break;
+
+        case DL_ENDBLK:
+            endBlock(creationInterface);
+            break;
+
+        case DL_ENTITY_POINT:
+            addPoint(creationInterface);
+            break;
+
+        case DL_ENTITY_LINE:
+            addLine(creationInterface);
+            break;
+
+        case DL_ENTITY_POLYLINE:
+            //bulge = toReal(values[42]);
+            // fall through
+        case DL_ENTITY_LWPOLYLINE:
+            addPolyline(creationInterface);
+            break;
+
+        case DL_ENTITY_VERTEX:
+            addVertex(creationInterface);
+            break;
+
+        case DL_ENTITY_SPLINE:
+            addSpline(creationInterface);
+            break;
+
+        case DL_ENTITY_ARC:
+            addArc(creationInterface);
+            break;
+
+        case DL_ENTITY_CIRCLE:
+            addCircle(creationInterface);
+            break;
+
+        case DL_ENTITY_ELLIPSE:
+            addEllipse(creationInterface);
+            break;
+
+        case DL_ENTITY_INSERT:
+            addInsert(creationInterface);
+            break;
+
+        case DL_ENTITY_MTEXT:
+            addMText(creationInterface);
+            break;
+
+        case DL_ENTITY_TEXT:
+            addText(creationInterface);
+            break;
+
+        case DL_ENTITY_ATTRIB:
+            addAttrib(creationInterface);
+            break;
+
+        case DL_ENTITY_DIMENSION: {
+                int type = (toInt(values[70], 0)&0x07);
+
+                switch (type) {
+                case 0:
+                    addDimLinear(creationInterface);
+                    break;
+
+                case 1:
+                    addDimAligned(creationInterface);
+                    break;
+
+                case 2:
+                    addDimAngular(creationInterface);
+                    break;
+
+                case 3:
+                    addDimDiametric(creationInterface);
+                    break;
+
+                case 4:
+                    addDimRadial(creationInterface);
+                    break;
+
+                case 5:
+                    addDimAngular3P(creationInterface);
+                    break;
+                
+                case 6:
+                    addDimOrdinate(creationInterface);
+                    break;
+
+                default:
+                    break;
+                }
+            }
+            break;
+
+        case DL_ENTITY_LEADER:
+            addLeader(creationInterface);
+            break;
+
+        case DL_ENTITY_HATCH:
+            addHatch(creationInterface);
+            break;
+
+        case DL_ENTITY_IMAGE:
+            addImage(creationInterface);
+            break;
+
+        case DL_ENTITY_IMAGEDEF:
+            addImageDef(creationInterface);
+            break;
+
+        case DL_ENTITY_TRACE:
+            addTrace(creationInterface);
+            break;
+        
+        case DL_ENTITY_3DFACE:
+            add3dFace(creationInterface);
+            break;
+
+        case DL_ENTITY_SOLID:
+            addSolid(creationInterface);
+            break;
+
+        case DL_ENTITY_SEQEND:
+            endSequence(creationInterface);
+            break;
+        
+        default:
+            break;
+        }
+
+
+        // reset all values (they are not persistent and only this
+        //  way we can detect default values for unstored settings)
+        for (int i=0; i<DL_DXF_MAXGROUPCODE; ++i) {
+            values[i][0] = '\0';
+        }
+        settingValue[0] = '\0';
+        settingKey[0] = '\0';
+
+
+        // Last DXF entity or setting has been handled
+        // Now determine what the next entity or setting type is
+
+		int prevEntity = currentEntity;
+
+        // Read DXF settings:
+        if (groupValue[0]=='$') {
+            currentEntity = DL_SETTING;
+            strncpy(settingKey, groupValue, DL_DXF_MAXLINE);
+            settingKey[DL_DXF_MAXLINE] = '\0';
+        }
+        // Read Layers:
+        else if (!strcmp(groupValue, "LAYER")) {
+            currentEntity = DL_LAYER;
+
+        }
+        // Read Blocks:
+        else if (!strcmp(groupValue, "BLOCK")) {
+            currentEntity = DL_BLOCK;
+        } else if (!strcmp(groupValue, "ENDBLK")) {
+            currentEntity = DL_ENDBLK;
+
+        }
+        // Read entities:
+        else if (!strcmp(groupValue, "POINT")) {
+            currentEntity = DL_ENTITY_POINT;
+        } else if (!strcmp(groupValue, "LINE")) {
+            currentEntity = DL_ENTITY_LINE;
+        } else if (!strcmp(groupValue, "POLYLINE")) {
+            currentEntity = DL_ENTITY_POLYLINE;
+        } else if (!strcmp(groupValue, "LWPOLYLINE")) {
+            currentEntity = DL_ENTITY_LWPOLYLINE;
+        } else if (!strcmp(groupValue, "VERTEX")) {
+            currentEntity = DL_ENTITY_VERTEX;
+        } else if (!strcmp(groupValue, "SPLINE")) {
+            currentEntity = DL_ENTITY_SPLINE;
+        } else if (!strcmp(groupValue, "ARC")) {
+            currentEntity = DL_ENTITY_ARC;
+        } else if (!strcmp(groupValue, "ELLIPSE")) {
+            currentEntity = DL_ENTITY_ELLIPSE;
+        } else if (!strcmp(groupValue, "CIRCLE")) {
+            currentEntity = DL_ENTITY_CIRCLE;
+        } else if (!strcmp(groupValue, "INSERT")) {
+            currentEntity = DL_ENTITY_INSERT;
+        } else if (!strcmp(groupValue, "TEXT")) {
+            currentEntity = DL_ENTITY_TEXT;
+        } else if (!strcmp(groupValue, "MTEXT")) {
+            currentEntity = DL_ENTITY_MTEXT;
+        } else if (!strcmp(groupValue, "ATTRIB")) {
+            currentEntity = DL_ENTITY_ATTRIB;
+        } else if (!strcmp(groupValue, "DIMENSION")) {
+            currentEntity = DL_ENTITY_DIMENSION;
+        } else if (!strcmp(groupValue, "LEADER")) {
+            currentEntity = DL_ENTITY_LEADER;
+        } else if (!strcmp(groupValue, "HATCH")) {
+            currentEntity = DL_ENTITY_HATCH;
+        } else if (!strcmp(groupValue, "IMAGE")) {
+            currentEntity = DL_ENTITY_IMAGE;
+        } else if (!strcmp(groupValue, "IMAGEDEF")) {
+            currentEntity = DL_ENTITY_IMAGEDEF;
+        } else if (!strcmp(groupValue, "TRACE")) {
+           currentEntity = DL_ENTITY_TRACE;
+        } else if (!strcmp(groupValue, "SOLID")) {
+           currentEntity = DL_ENTITY_SOLID;
+        } else if (!strcmp(groupValue, "3DFACE")) {
+           currentEntity = DL_ENTITY_3DFACE;
+        } else if (!strcmp(groupValue, "SEQEND")) {
+            currentEntity = DL_ENTITY_SEQEND;
+        } else {
+            currentEntity = DL_UNKNOWN;
+        }
+
+		// end of old style POLYLINE entity
+		if (prevEntity==DL_ENTITY_VERTEX && currentEntity!=DL_ENTITY_VERTEX) {
+			endEntity(creationInterface);
+		}
+
+        return true;
+
+    } else {
+        // Group code does not indicate start of new entity or setting,
+        // so this group must be continuation of data for the current
+        // one.
+        if (groupCode<DL_DXF_MAXGROUPCODE) {
+
+            bool handled = false;
+
+            switch (currentEntity) {
+            case DL_ENTITY_MTEXT:
+                handled = handleMTextData(creationInterface);
+                break;
+
+            case DL_ENTITY_LWPOLYLINE:
+                handled = handleLWPolylineData(creationInterface);
+                break;
+
+            case DL_ENTITY_SPLINE:
+                handled = handleSplineData(creationInterface);
+                break;
+
+            case DL_ENTITY_LEADER:
+                handled = handleLeaderData(creationInterface);
+                break;
+
+            case DL_ENTITY_HATCH:
+                handled = handleHatchData(creationInterface);
+                break;
+
+            default:
+                break;
+            }
+
+            if (!handled) {
+                // Normal group / value pair:
+                strncpy(values[groupCode], groupValue, DL_DXF_MAXLINE);
+                values[groupCode][DL_DXF_MAXLINE] = '\0';
+            }
+        }
+
+        return false;
+    }
+    return false;
+}
+
+
+
+/**
+ * Adds a comment from the DXF file.
+ */
+void DL_Dxf::addComment(DL_CreationInterface* creationInterface, const char* comment) {
+    creationInterface->addComment(comment);
+}
+
+
+
+/**
+ * Adds a variable from the DXF file.
+ */
+void DL_Dxf::addSetting(DL_CreationInterface* creationInterface) {
+    int c = -1;
+    for (int i=0; i<=380; ++i) {
+        if (values[i][0]!='\0') {
+            c = i;
+            break;
+        }
+    }
+
+    // string
+    if (c>=0 && c<=9) {
+        creationInterface->setVariableString(settingKey,
+                                             values[c], c);
+    }
+    // vector
+    else if (c>=10 && c<=39) {
+        if (c==10) {
+            creationInterface->setVariableVector(
+                settingKey,
+                toReal(values[c]),
+                toReal(values[c+10]),
+                toReal(values[c+20]),
+                c);
+        }
+    }
+    // double
+    else if (c>=40 && c<=59) {
+        creationInterface->setVariableDouble(settingKey,
+                                             toReal(values[c]),
+                                             c);
+    }
+    // int
+    else if (c>=60 && c<=99) {
+        creationInterface->setVariableInt(settingKey,
+                                          toInt(values[c]),
+                                          c);
+    }
+    // misc
+    else if (c>=0) {
+        creationInterface->setVariableString(settingKey,
+                                             values[c],
+                                             c);
+    }
+}
+
+
+
+/**
+ * Adds a layer that was read from the file via the creation interface.
+ */
+void DL_Dxf::addLayer(DL_CreationInterface* creationInterface) {
+    // correct some impossible attributes for layers:
+    attrib = creationInterface->getAttributes();
+    if (attrib.getColor()==256 || attrib.getColor()==0) {
+        attrib.setColor(7);
+    }
+    if (attrib.getWidth()<0) {
+        attrib.setWidth(1);
+    }
+    if (!strcasecmp(attrib.getLineType().c_str(), "BYLAYER") ||
+            !strcasecmp(attrib.getLineType().c_str(), "BYBLOCK")) {
+        attrib.setLineType("CONTINUOUS");
+    }
+
+    // add layer
+    creationInterface->addLayer(DL_LayerData(values[2],
+                                toInt(values[70])));
+}
+
+
+
+/**
+ * Adds a block that was read from the file via the creation interface.
+ */
+void DL_Dxf::addBlock(DL_CreationInterface* creationInterface) {
+    DL_BlockData d(
+        // Name:
+        values[2],
+        // flags:
+        toInt(values[70]),
+        // base point:
+        toReal(values[10]),
+        toReal(values[20]),
+        toReal(values[30]));
+
+    creationInterface->addBlock(d);
+}
+
+
+
+/**
+ * Ends a block that was read from the file via the creation interface.
+ */
+void DL_Dxf::endBlock(DL_CreationInterface* creationInterface) {
+    creationInterface->endBlock();
+}
+
+
+
+/**
+ * Adds a point entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addPoint(DL_CreationInterface* creationInterface) {
+    DL_PointData d(toReal(values[10]),
+                   toReal(values[20]),
+                   toReal(values[30]));
+    creationInterface->addPoint(d);
+}
+
+
+
+/**
+ * Adds a line entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addLine(DL_CreationInterface* creationInterface) {
+    DL_LineData d(toReal(values[10]),
+                  toReal(values[20]),
+                  toReal(values[30]),
+                  toReal(values[11]),
+                  toReal(values[21]),
+                  toReal(values[31]));
+
+    creationInterface->addLine(d);
+}
+
+
+
+/**
+ * Adds a polyline entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addPolyline(DL_CreationInterface* creationInterface) {
+    DL_PolylineData pd(maxVertices, toInt(values[71], 0), toInt(values[72], 0), toInt(values[70], 0));
+    creationInterface->addPolyline(pd);
+
+    if (currentEntity==DL_ENTITY_LWPOLYLINE) {
+        for (int i=0; i<maxVertices; i++) {
+            DL_VertexData d(vertices[i*4],
+                            vertices[i*4+1],
+                            vertices[i*4+2],
+                            vertices[i*4+3]);
+
+            creationInterface->addVertex(d);
+        }
+		creationInterface->endEntity();
+    }
+}
+
+
+
+/**
+ * Adds a polyline vertex entity that was read from the file 
+ * via the creation interface.
+ */
+void DL_Dxf::addVertex(DL_CreationInterface* creationInterface) {
+    DL_VertexData d(toReal(values[10]),
+                    toReal(values[20]),
+                    toReal(values[30]),
+                    //bulge);
+                    toReal(values[42]));
+
+    //bulge = toReal(values[42]);
+
+    creationInterface->addVertex(d);
+}
+
+
+
+/**
+ * Adds a spline entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addSpline(DL_CreationInterface* creationInterface) {
+    DL_SplineData sd(toInt(values[71], 3), 
+                     maxKnots, 
+                     maxControlPoints, 
+                     toInt(values[70], 4));
+    /*DL_SplineData sd(toInt(values[71], 3), toInt(values[72], 0),
+                     toInt(values[73], 0), toInt(values[70], 4));*/
+    creationInterface->addSpline(sd);
+
+    int i;
+    for (i=0; i<maxControlPoints; i++) {
+        DL_ControlPointData d(controlPoints[i*3],
+                              controlPoints[i*3+1],
+                              controlPoints[i*3+2]);
+
+        creationInterface->addControlPoint(d);
+    }
+    for (i=0; i<maxKnots; i++) {
+      DL_KnotData k(knots[i]);
+
+      creationInterface->addKnot(k);
+    }
+}
+
+
+
+/**
+ * Adds an arc entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addArc(DL_CreationInterface* creationInterface) {
+    DL_ArcData d(toReal(values[10]),
+                 toReal(values[20]),
+                 toReal(values[30]),
+                 toReal(values[40]),
+                 toReal(values[50]),
+                 toReal(values[51]));
+
+    creationInterface->addArc(d);
+}
+
+
+
+/**
+ * Adds a circle entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addCircle(DL_CreationInterface* creationInterface) {
+    DL_CircleData d(toReal(values[10]),
+                    toReal(values[20]),
+                    toReal(values[30]),
+                    toReal(values[40]));
+
+    creationInterface->addCircle(d);
+}
+
+
+
+/**
+ * Adds an ellipse entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addEllipse(DL_CreationInterface* creationInterface) {
+    DL_EllipseData d(toReal(values[10]),
+                     toReal(values[20]),
+                     toReal(values[30]),
+                     toReal(values[11]),
+                     toReal(values[21]),
+                     toReal(values[31]),
+                     toReal(values[40], 1.0),
+                     toReal(values[41], 0.0),
+                     toReal(values[42], 2*M_PI));
+
+    creationInterface->addEllipse(d);
+}
+
+
+
+/**
+ * Adds an insert entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addInsert(DL_CreationInterface* creationInterface) {
+    DL_InsertData d(values[2],
+                    // insertion point
+                    toReal(values[10], 0.0),
+                    toReal(values[20], 0.0),
+                    toReal(values[30], 0.0),
+                    // scale:
+                    toReal(values[41], 1.0),
+                    toReal(values[42], 1.0),
+                    toReal(values[43], 1.0),
+                    // angle:
+                    toReal(values[50], 0.0),
+                    // cols / rows:
+                    toInt(values[70], 1),
+                    toInt(values[71], 1),
+                    // spacing:
+                    toReal(values[44], 0.0),
+                    toReal(values[45], 0.0));
+
+    creationInterface->addInsert(d);
+}
+
+
+
+/**
+ * Adds a trace entity (4 edge closed polyline) that was read from the file via the creation interface.
+ *
+ * @author AHM
+ */
+void DL_Dxf::addTrace(DL_CreationInterface* creationInterface) {
+    DL_TraceData td;
+    
+    for (int k = 0; k < 4; k++) {
+       td.x[k] = toReal(values[10 + k]);
+       td.y[k] = toReal(values[20 + k]);
+       td.z[k] = toReal(values[30 + k]);
+    }
+    creationInterface->addTrace(td);
+}
+
+
+
+/**
+ * Adds a 3dface entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::add3dFace(DL_CreationInterface* creationInterface) {
+    DL_3dFaceData td;
+    
+    for (int k = 0; k < 4; k++) {
+       td.x[k] = toReal(values[10 + k]);
+       td.y[k] = toReal(values[20 + k]);
+       td.z[k] = toReal(values[30 + k]);
+    }
+    creationInterface->add3dFace(td);
+}
+
+
+
+/**
+ * Adds a solid entity (filled trace) that was read from the file via the creation interface.
+ * 
+ * @author AHM
+ */
+void DL_Dxf::addSolid(DL_CreationInterface* creationInterface) {
+    DL_SolidData sd;
+    
+    for (int k = 0; k < 4; k++) {
+       sd.x[k] = toReal(values[10 + k]);
+       sd.y[k] = toReal(values[20 + k]);
+       sd.z[k] = toReal(values[30 + k]);
+    }
+    creationInterface->addSolid(sd);
+}
+
+
+/**
+ * Adds an MText entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addMText(DL_CreationInterface* creationInterface) {
+    double angle = 0.0;
+
+    if (values[50][0]!='\0') {
+        if (libVersion<=0x02000200) {
+            // wrong but compatible with dxflib <=2.0.2.0:
+            angle = toReal(values[50], 0.0);
+        } else {
+            angle = (toReal(values[50], 0.0)*2*M_PI)/360.0;
+        }
+    } else if (values[11][0]!='\0' && values[21][0]!='\0') {
+        double x = toReal(values[11], 0.0);
+        double y = toReal(values[21], 0.0);
+
+        if (fabs(x)<1.0e-6) {
+            if (y>0.0) {
+                angle = M_PI/2.0;
+            } else {
+                angle = M_PI/2.0*3.0;
+            }
+        } else {
+            angle = atan(y/x);
+        }
+    }
+
+    DL_MTextData d(
+        // insertion point
+        toReal(values[10], 0.0),
+        toReal(values[20], 0.0),
+        toReal(values[30], 0.0),
+        // height
+        toReal(values[40], 2.5),
+        // width
+        toReal(values[41], 100.0),
+        // attachment point
+        toInt(values[71], 1),
+        // drawing direction
+        toInt(values[72], 1),
+        // line spacing style
+        toInt(values[73], 1),
+        // line spacing factor
+        toReal(values[44], 1.0),
+        // text
+        values[1],
+        // style
+        values[7],
+        // angle
+        angle);
+    creationInterface->addMText(d);
+}
+
+
+
+/**
+ * Handles additional MText data.
+ */
+bool DL_Dxf::handleMTextData(DL_CreationInterface* creationInterface) {
+    // Special handling of text chunks for MTEXT entities:
+    if (groupCode==3) {
+        creationInterface->addMTextChunk(groupValue);
+        return true;
+    }
+
+    return false;
+}
+
+
+
+/**
+ * Handles additional polyline data.
+ */
+bool DL_Dxf::handleLWPolylineData(DL_CreationInterface* /*creationInterface*/) {
+    // Allocate LWPolyline vertices (group code 90):
+    if (groupCode==90) {
+        maxVertices = toInt(groupValue);
+        if (maxVertices>0) {
+            if (vertices!=NULL) {
+                delete[] vertices;
+            }
+            vertices = new double[4*maxVertices];
+            for (int i=0; i<maxVertices; ++i) {
+                vertices[i*4] = 0.0;
+                vertices[i*4+1] = 0.0;
+                vertices[i*4+2] = 0.0;
+                vertices[i*4+3] = 0.0;
+            }
+        }
+        vertexIndex=-1;
+        return true;
+    }
+
+    // Compute LWPolylines vertices (group codes 10/20/30/42):
+    else if (groupCode==10 || groupCode==20 ||
+             groupCode==30 || groupCode==42) {
+
+        if (vertexIndex<maxVertices-1 && groupCode==10) {
+            vertexIndex++;
+        }
+
+        if (groupCode<=30) {
+            if (vertexIndex>=0 && vertexIndex<maxVertices) {
+                vertices[4*vertexIndex + (groupCode/10-1)]
+                = toReal(groupValue);
+            }
+        } else if (groupCode==42 && vertexIndex<maxVertices) {
+            vertices[4*vertexIndex + 3] = toReal(groupValue);
+        }
+        return true;
+    }
+    return false;
+}
+
+
+
+/**
+ * Handles additional spline data.
+ */
+bool DL_Dxf::handleSplineData(DL_CreationInterface* /*creationInterface*/) {
+    // Allocate Spline knots (group code 72):
+    if (groupCode==72) {
+        maxKnots = toInt(groupValue);
+        if (maxKnots>0) {
+            if (knots!=NULL) {
+                delete[] knots;
+            }
+            knots = new double[maxKnots];
+            for (int i=0; i<maxKnots; ++i) {
+                knots[i] = 0.0;
+            }
+        }
+        knotIndex=-1;
+        return true;
+    }
+
+    // Allocate Spline control points (group code 73):
+    else if (groupCode==73) {
+        maxControlPoints = toInt(groupValue);
+        if (maxControlPoints>0) {
+            if (controlPoints!=NULL) {
+                delete[] controlPoints;
+            }
+            controlPoints = new double[3*maxControlPoints];
+            for (int i=0; i<maxControlPoints; ++i) {
+                controlPoints[i*3] = 0.0;
+                controlPoints[i*3+1] = 0.0;
+                controlPoints[i*3+2] = 0.0;
+            }
+        }
+        controlPointIndex=-1;
+        return true;
+    }
+
+    // Compute spline knot vertices (group code 40):
+    else if (groupCode==40) {
+        if (knotIndex<maxKnots-1) {
+            knotIndex++;
+            knots[knotIndex] = toReal(groupValue);
+        }
+        return true;
+    }
+
+    // Compute spline control points (group codes 10/20/30):
+    else if (groupCode==10 || groupCode==20 ||
+             groupCode==30) {
+
+        if (controlPointIndex<maxControlPoints-1 && groupCode==10) {
+            controlPointIndex++;
+        }
+
+        if (controlPointIndex>=0 && controlPointIndex<maxControlPoints) {
+            controlPoints[3*controlPointIndex + (groupCode/10-1)]
+            = toReal(groupValue);
+        }
+        return true;
+    }
+    return false;
+}
+
+
+
+/**
+ * Handles additional leader data.
+ */
+bool DL_Dxf::handleLeaderData(DL_CreationInterface* /*creationInterface*/) {
+    // Allocate Leader vertices (group code 76):
+    if (groupCode==76) {
+        maxLeaderVertices = toInt(groupValue);
+        if (maxLeaderVertices>0) {
+            if (leaderVertices!=NULL) {
+                delete[] leaderVertices;
+            }
+            leaderVertices = new double[3*maxLeaderVertices];
+            for (int i=0; i<maxLeaderVertices; ++i) {
+                leaderVertices[i*3] = 0.0;
+                leaderVertices[i*3+1] = 0.0;
+                leaderVertices[i*3+2] = 0.0;
+            }
+        }
+        leaderVertexIndex=-1;
+        return true;
+    }
+
+    // Compute Leader vertices (group codes 10/20/30):
+    else if (groupCode==10 || groupCode==20 || groupCode==30) {
+
+        if (leaderVertexIndex<maxLeaderVertices-1 && groupCode==10) {
+            leaderVertexIndex++;
+        }
+
+        if (groupCode<=30) {
+            if (leaderVertexIndex>=0 &&
+                    leaderVertexIndex<maxLeaderVertices) {
+                leaderVertices[3*leaderVertexIndex + (groupCode/10-1)]
+                = toReal(groupValue);
+            }
+        }
+        return true;
+    }
+
+    return false;
+}
+
+
+
+/**
+ * Handles additional hatch data.
+ */
+bool DL_Dxf::handleHatchData(DL_CreationInterface* /*creationInterface*/) {
+
+    static int firstPolylineStatus = 0;
+
+    // Allocate hatch loops (group code 91):
+    if (groupCode==91 && toInt(groupValue)>0) {
+
+        if (hatchLoops!=NULL) {
+            delete[] hatchLoops;
+            hatchLoops = NULL;
+        }
+        if (maxHatchEdges!=NULL) {
+            delete[] maxHatchEdges;
+            maxHatchEdges = NULL;
+        }
+        if (hatchEdgeIndex!=NULL) {
+            delete[] hatchEdgeIndex;
+            hatchEdgeIndex = NULL;
+        }
+        if (hatchEdges!=NULL) {
+            for (int i=0; i<maxHatchLoops; ++i) {
+                delete[] hatchEdges[i];
+            }
+            delete[] hatchEdges;
+            hatchEdges = NULL;
+        }
+        maxHatchLoops = toInt(groupValue);
+
+        if (maxHatchLoops>0) {
+            hatchLoops = new DL_HatchLoopData[maxHatchLoops];
+            maxHatchEdges = new int[maxHatchLoops];
+            hatchEdgeIndex = new int[maxHatchLoops];
+            hatchEdges = new DL_HatchEdgeData*[maxHatchLoops];
+            for (int i=0; i<maxHatchLoops; ++i) {
+                hatchEdges[i] = NULL;
+                maxHatchEdges[i] = 0;
+            }
+            hatchLoopIndex = -1;
+            dropEdges = false;
+        }
+        return true;
+    }
+
+    // Allocate hatch edges, group code 93
+    if (groupCode==93 && toInt(groupValue)>0) {
+        if (hatchLoopIndex<maxHatchLoops-1 && hatchLoops!=NULL &&
+                maxHatchEdges!=NULL && hatchEdgeIndex!=NULL &&
+                hatchEdges!=NULL) {
+
+            dropEdges = false;
+
+            hatchLoopIndex++;
+            hatchLoops[hatchLoopIndex]
+            = DL_HatchLoopData(toInt(groupValue));
+
+            maxHatchEdges[hatchLoopIndex] = toInt(groupValue);
+            hatchEdgeIndex[hatchLoopIndex] = -1;
+            hatchEdges[hatchLoopIndex]
+                = new DL_HatchEdgeData[toInt(groupValue)];
+            firstPolylineStatus = 0;
+        } else {
+            dropEdges = true;
+        }
+        return true;
+    }
+
+    // Init hatch edge for non-polyline boundary (group code 72)
+    if (hatchEdges!=NULL &&
+            hatchEdgeIndex!=NULL &&
+            maxHatchEdges!=NULL &&
+            hatchLoopIndex>=0 &&
+            hatchLoopIndex<maxHatchLoops &&
+            hatchEdgeIndex[hatchLoopIndex] <
+            maxHatchEdges[hatchLoopIndex] &&
+            (atoi(values[92])&2)==0 &&   // not a polyline
+            groupCode==72 &&
+            !dropEdges) {
+
+        hatchEdgeIndex[hatchLoopIndex]++;
+
+        hatchEdges[hatchLoopIndex][hatchEdgeIndex[hatchLoopIndex]]
+        .type = toInt(groupValue);
+        hatchEdges[hatchLoopIndex][hatchEdgeIndex[hatchLoopIndex]]
+        .defined = false;
+
+        return true;
+    }
+
+    // Handle hatch edges for non-polyline boundaries
+    //   (group codes 10, 20, 11, 21, 40, 50, 51, 73)
+    if (!dropEdges &&
+            hatchEdges!=NULL &&
+            hatchEdgeIndex!=NULL &&
+            hatchLoopIndex>=0 &&
+            hatchLoopIndex<maxHatchLoops &&
+            hatchEdges[hatchLoopIndex]!=NULL &&
+            hatchEdgeIndex[hatchLoopIndex]>=0 &&
+            hatchEdgeIndex[hatchLoopIndex] <
+            maxHatchEdges[hatchLoopIndex] &&
+            ((atoi(values[92])&2)==0) &&        // not a polyline
+            (groupCode==10 || groupCode==20 ||
+             groupCode==11 || groupCode==21 ||
+             groupCode==40 || groupCode==50 ||
+             groupCode==51 || groupCode==73)) {
+
+        if (hatchEdges[hatchLoopIndex]
+                [hatchEdgeIndex[hatchLoopIndex]].defined==false) {
+            if (hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].type==1) {
+                switch (groupCode) {
+                case 10:
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].x1
+                    = toReal(groupValue);
+                    break;
+                case 20:
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].y1
+                    = toReal(groupValue);
+                    break;
+                case 11:
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].x2
+                    = toReal(groupValue);
+                    break;
+                case 21:
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].y2
+                    = toReal(groupValue);
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].defined = true;
+                    break;
+                default:
+                    break;
+                }
+            }
+
+            if (hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].type==2) {
+                switch (groupCode) {
+                case 10:
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].cx
+                    = toReal(groupValue);
+                    break;
+                case 20:
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].cy
+                    = toReal(groupValue);
+                    break;
+                case 40:
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].radius
+                    = toReal(groupValue);
+                    break;
+                case 50:
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].angle1
+                    = toReal(groupValue)/360.0*2*M_PI;
+                    break;
+                case 51:
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].angle2
+                    = toReal(groupValue)/360.0*2*M_PI;
+                    break;
+                case 73:
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].ccw
+                    = (bool)toInt(groupValue);
+                    hatchEdges[hatchLoopIndex]
+                    [hatchEdgeIndex[hatchLoopIndex]].defined = true;
+                    break;
+                default:
+                    break;
+                }
+            }
+        }
+        return true;
+    }
+
+    /*
+    // 2003/12/31: polyline hatches can be extremely slow and are rarely used
+    //
+       // Handle hatch edges for polyline boundaries
+       //  (group codes 10, 20, 42)
+       if (!dropEdges &&
+               hatchEdges!=NULL &&
+               hatchEdgeIndex!=NULL &&
+               hatchLoopIndex>=0 &&
+               hatchLoopIndex<maxHatchLoops &&
+               hatchEdges[hatchLoopIndex]!=NULL &&
+               //hatchEdgeIndex[hatchLoopIndex]>=0 &&
+               hatchEdgeIndex[hatchLoopIndex] <
+               maxHatchEdges[hatchLoopIndex] &&
+               ((atoi(values[92])&2)==2)) {        // a polyline
+
+           if (groupCode==10 || groupCode==20 ||
+                   groupCode==42) {
+
+               std::cout << "  found polyline edge data: " << groupCode << "\n";
+               std::cout << "     value: " << toReal(groupValue) << "\n";
+
+               static double lastX = 0.0;
+               static double lastY = 0.0;
+               static double lastB = 0.0;
+
+               if (firstPolylineStatus<2) {
+                   switch (groupCode) {
+                   case 10:
+                       firstPolylineStatus++;
+                       if (firstPolylineStatus==1) {
+                           lastX = toReal(groupValue);
+                           std::cout << "     firstX: " << lastX << "\n";
+                       }
+                       break;
+
+                   case 20:
+                       lastY = toReal(groupValue);
+                       std::cout << "     firstY: " << lastY << "\n";
+                       break;
+
+                   case 42:
+                       lastB = toReal(groupValue);
+                       break;
+
+                   default:
+                       break;
+                   }
+
+                   if (firstPolylineStatus!=2) {
+                       return true;
+                   }
+               }
+
+
+               switch (groupCode) {
+               case 10:
+                   hatchEdgeIndex[hatchLoopIndex]++;
+                   hatchEdges[hatchLoopIndex]
+                   [hatchEdgeIndex[hatchLoopIndex]].type = 1;
+                   hatchEdges[hatchLoopIndex]
+                   [hatchEdgeIndex[hatchLoopIndex]].x1
+                   = lastX;
+                   hatchEdges[hatchLoopIndex]
+                   [hatchEdgeIndex[hatchLoopIndex]].x2
+                   = lastX = toReal(groupValue);
+                   std::cout << "     X: " << lastX << "\n";
+                   break;
+               case 20:
+                   hatchEdges[hatchLoopIndex]
+                   [hatchEdgeIndex[hatchLoopIndex]].y1
+                   = lastY;
+                   hatchEdges[hatchLoopIndex]
+                   [hatchEdgeIndex[hatchLoopIndex]].y2
+                   = lastY = toReal(groupValue);
+                   std::cout << "     Y: " << lastY << "\n";
+                   break;
+                   / *
+                               case 42: {
+                   	// convert to arc:
+                   	double x1 = hatchEdges[hatchLoopIndex]
+                   		[hatchEdgeIndex[hatchLoopIndex]].x1;
+                   	double y1 = hatchEdges[hatchLoopIndex]
+                   		[hatchEdgeIndex[hatchLoopIndex]].y1;
+                   	double x2 = hatchEdges[hatchLoopIndex]
+                   		[hatchEdgeIndex[hatchLoopIndex]].x2;
+                   	double y2 = hatchEdges[hatchLoopIndex]
+                   		[hatchEdgeIndex[hatchLoopIndex]].y2;
+
+                   	double bulge = toReal(groupValue);
+
+                   	bool reversed = (bulge<0.0);
+                   	double alpha = atan(bulge)*4.0;
+                   	double radius;
+                             double cx;
+                             double cy;
+                   	double a1;
+                   	double a2;
+                             double mx = (x2+x1)/2.0;
+                             double my = (y2+y1)/2.0;
+                   	double dist = sqrt(pow(x2-x1,2) + pow(y2-y1,2)) / 2.0;
+
+                   	// alpha can't be 0.0 at this point
+                             radius = fabs(dist / sin(alpha/2.0));
+
+                             double wu = fabs(pow(radius, 2.0) - pow(dist, 2.0));
+                             double h = sqrt(wu);
+                   	double angle = acos((x2-x1) / dist);
+
+                             if (bulge>0.0) {
+                       		        angle+=M_PI/2.0;
+                             } else {
+                                 angle-=M_PI/2.0;
+                             }
+
+                             if (fabs(alpha)>M_PI) {
+                                 h*=-1.0;
+                             }
+
+                   	cx = mx + cos(angle) * h;
+                   	cy = my + sin(angle) * h;
+
+                   	a1 = hatchEdges[hatchLoopIndex]
+                                   	[hatchEdgeIndex[hatchLoopIndex]].type = 2;
+                                   hatchEdges[hatchLoopIndex]
+                                   	[hatchEdgeIndex[hatchLoopIndex]].ccw = (toReal(groupValue)>0.0);
+                                   hatchEdges[hatchLoopIndex]
+                                   	[hatchEdgeIndex[hatchLoopIndex]].cx = cx;
+                                   hatchEdges[hatchLoopIndex]
+                                   	[hatchEdgeIndex[hatchLoopIndex]].cy = cy;
+                                   hatchEdges[hatchLoopIndex]
+                                   	[hatchEdgeIndex[hatchLoopIndex]].radius = radius;
+                                   } break;
+                   	* /
+
+               default:
+                   break;
+               }
+           } else {
+               // end polyline boundary
+               dropEdges = true;
+           }
+
+           return true;
+       }
+    */
+
+    return false;
+}
+
+
+
+
+/**
+ * Adds an text entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addText(DL_CreationInterface* creationInterface) {
+    DL_TextData d(
+        // insertion point
+        toReal(values[10], 0.0),
+        toReal(values[20], 0.0),
+        toReal(values[30], 0.0),
+        // alignment point
+        toReal(values[11], 0.0),
+        toReal(values[21], 0.0),
+        toReal(values[31], 0.0),
+        // height
+        toReal(values[40], 2.5),
+        // x scale
+        toReal(values[41], 1.0),
+        // generation flags
+        toInt(values[71], 0),
+        // h just
+        toInt(values[72], 0),
+        // v just
+        toInt(values[73], 0),
+        // text
+        values[1],
+        // style
+        values[7],
+        // angle
+        (toReal(values[50], 0.0)*2*M_PI)/360.0);
+
+    creationInterface->addText(d);
+}
+
+
+
+/**
+ * Adds an attrib entity that was read from the file via the creation interface.
+ * @todo add attrib instead of normal text
+ */
+void DL_Dxf::addAttrib(DL_CreationInterface* creationInterface) {
+    DL_TextData d(
+        // insertion point
+        toReal(values[10], 0.0),
+        toReal(values[20], 0.0),
+        toReal(values[30], 0.0),
+        // alignment point
+        toReal(values[11], 0.0),
+        toReal(values[21], 0.0),
+        toReal(values[31], 0.0),
+        // height
+        toReal(values[40], 2.5),
+        // x scale
+        toReal(values[41], 1.0),
+        // generation flags
+        toInt(values[71], 0),
+        // h just
+        toInt(values[72], 0),
+        // v just
+        toInt(values[74], 0),
+        // text
+        values[1],
+        // style
+        values[7],
+        // angle
+        (toReal(values[50], 0.0)*2*M_PI)/360.0);
+
+    creationInterface->addText(d);
+}
+
+
+
+/**
+ * @return dimension data from current values.
+ */
+DL_DimensionData DL_Dxf::getDimData() {
+    // generic dimension data:
+    return DL_DimensionData(
+               // def point
+               toReal(values[10], 0.0),
+               toReal(values[20], 0.0),
+               toReal(values[30], 0.0),
+               // text middle point
+               toReal(values[11], 0.0),
+               toReal(values[21], 0.0),
+               toReal(values[31], 0.0),
+               // type
+               toInt(values[70], 0),
+               // attachment point
+               toInt(values[71], 5),
+               // line sp. style
+               toInt(values[72], 1),
+               // line sp. factor
+               toReal(values[41], 1.0),
+               // text
+               values[1],
+               // style
+               values[3],
+               // angle
+               toReal(values[53], 0.0));
+}
+
+
+
+/**
+ * Adds a linear dimension entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addDimLinear(DL_CreationInterface* creationInterface) {
+    DL_DimensionData d = getDimData();
+
+    // horizontal / vertical / rotated dimension:
+    DL_DimLinearData dl(
+        // definition point 1
+        toReal(values[13], 0.0),
+        toReal(values[23], 0.0),
+        toReal(values[33], 0.0),
+        // definition point 2
+        toReal(values[14], 0.0),
+        toReal(values[24], 0.0),
+        toReal(values[34], 0.0),
+        // angle
+        toReal(values[50], 0.0),
+        // oblique
+        toReal(values[52], 0.0));
+    creationInterface->addDimLinear(d, dl);
+}
+
+
+
+/**
+ * Adds an aligned dimension entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addDimAligned(DL_CreationInterface* creationInterface) {
+    DL_DimensionData d = getDimData();
+
+    // aligned dimension:
+    DL_DimAlignedData da(
+        // extension point 1
+        toReal(values[13], 0.0),
+        toReal(values[23], 0.0),
+        toReal(values[33], 0.0),
+        // extension point 2
+        toReal(values[14], 0.0),
+        toReal(values[24], 0.0),
+        toReal(values[34], 0.0));
+    creationInterface->addDimAlign(d, da);
+}
+
+
+
+/**
+ * Adds a radial dimension entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addDimRadial(DL_CreationInterface* creationInterface) {
+    DL_DimensionData d = getDimData();
+
+    DL_DimRadialData dr(
+        // definition point
+        toReal(values[15], 0.0),
+        toReal(values[25], 0.0),
+        toReal(values[35], 0.0),
+        // leader length:
+        toReal(values[40], 0.0));
+    creationInterface->addDimRadial(d, dr);
+}
+
+
+
+/**
+ * Adds a diametric dimension entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addDimDiametric(DL_CreationInterface* creationInterface) {
+    DL_DimensionData d = getDimData();
+
+    // diametric dimension:
+    DL_DimDiametricData dr(
+        // definition point
+        toReal(values[15], 0.0),
+        toReal(values[25], 0.0),
+        toReal(values[35], 0.0),
+        // leader length:
+        toReal(values[40], 0.0));
+    creationInterface->addDimDiametric(d, dr);
+}
+
+
+
+/**
+ * Adds an angular dimension entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addDimAngular(DL_CreationInterface* creationInterface) {
+    DL_DimensionData d = getDimData();
+
+    // angular dimension:
+    DL_DimAngularData da(
+        // definition point 1
+        toReal(values[13], 0.0),
+        toReal(values[23], 0.0),
+        toReal(values[33], 0.0),
+        // definition point 2
+        toReal(values[14], 0.0),
+        toReal(values[24], 0.0),
+        toReal(values[34], 0.0),
+        // definition point 3
+        toReal(values[15], 0.0),
+        toReal(values[25], 0.0),
+        toReal(values[35], 0.0),
+        // definition point 4
+        toReal(values[16], 0.0),
+        toReal(values[26], 0.0),
+        toReal(values[36], 0.0));
+    creationInterface->addDimAngular(d, da);
+}
+
+
+/**
+ * Adds an angular dimension entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addDimAngular3P(DL_CreationInterface* creationInterface) {
+    DL_DimensionData d = getDimData();
+
+    // angular dimension (3P):
+    DL_DimAngular3PData da(
+        // definition point 1
+        toReal(values[13], 0.0),
+        toReal(values[23], 0.0),
+        toReal(values[33], 0.0),
+        // definition point 2
+        toReal(values[14], 0.0),
+        toReal(values[24], 0.0),
+        toReal(values[34], 0.0),
+        // definition point 3
+        toReal(values[15], 0.0),
+        toReal(values[25], 0.0),
+        toReal(values[35], 0.0));
+    creationInterface->addDimAngular3P(d, da);
+}
+
+
+
+/**
+ * Adds an ordinate dimension entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addDimOrdinate(DL_CreationInterface* creationInterface) {
+    DL_DimensionData d = getDimData();
+
+    // ordinate dimension:
+    DL_DimOrdinateData dl(
+        // definition point 1
+        toReal(values[13], 0.0),
+        toReal(values[23], 0.0),
+        toReal(values[33], 0.0),
+        // definition point 2
+        toReal(values[14], 0.0),
+        toReal(values[24], 0.0),
+        toReal(values[34], 0.0),
+        (toInt(values[70])&64)==64         // true: X-type, false: Y-type
+    );
+    creationInterface->addDimOrdinate(d, dl);
+}
+
+
+
+/**
+ * Adds a leader entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addLeader(DL_CreationInterface* creationInterface) {
+    // leader (arrow)
+    DL_LeaderData le(
+        // arrow head flag
+        toInt(values[71], 1),
+        // leader path type
+        toInt(values[72], 0),
+        // Leader creation flag
+        toInt(values[73], 3),
+        // Hookline direction flag
+        toInt(values[74], 1),
+        // Hookline flag
+        toInt(values[75], 0),
+        // Text annotation height
+        toReal(values[40], 1.0),
+        // Text annotation width
+        toReal(values[41], 1.0),
+        // Number of vertices in leader
+        toInt(values[76], 0)
+    );
+    creationInterface->addLeader(le);
+
+    for (int i=0; i<maxLeaderVertices; i++) {
+        DL_LeaderVertexData d(leaderVertices[i*3],
+                              leaderVertices[i*3+1],
+                              leaderVertices[i*3+2]);
+
+        creationInterface->addLeaderVertex(d);
+    }
+}
+
+
+
+/**
+ * Adds a hatch entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addHatch(DL_CreationInterface* creationInterface) {
+    DL_HatchData hd(toInt(values[91], 1),
+                    toInt(values[70], 0),
+                    toReal(values[41], 1.0),
+                    toReal(values[52], 0.0),
+                    values[2]);
+    creationInterface->addHatch(hd);
+
+    for (int l=0; l<maxHatchLoops; l++) {
+        DL_HatchLoopData ld(maxHatchEdges[l]);
+        creationInterface->addHatchLoop(ld);
+        for (int b=0; b<maxHatchEdges[l]; b++) {
+            creationInterface->addHatchEdge(hatchEdges[l][b]);
+        }
+    }
+    creationInterface->endEntity();
+    currentEntity = DL_UNKNOWN;
+}
+
+
+
+/**
+ * Adds an image entity that was read from the file via the creation interface.
+ */
+void DL_Dxf::addImage(DL_CreationInterface* creationInterface) {
+    DL_ImageData id(// pass ref insead of name we don't have yet
+        values[340],
+        // ins point:
+        toReal(values[10], 0.0),
+        toReal(values[20], 0.0),
+        toReal(values[30], 0.0),
+        // u vector:
+        toReal(values[11], 1.0),
+        toReal(values[21], 0.0),
+        toReal(values[31], 0.0),
+        // v vector:
+        toReal(values[12], 0.0),
+        toReal(values[22], 1.0),
+        toReal(values[32], 0.0),
+        // image size (pixel):
+        toInt(values[13], 1),
+        toInt(values[23], 1),
+        // brightness, contrast, fade
+        toInt(values[281], 50),
+        toInt(values[282], 50),
+        toInt(values[283], 0));
+
+    creationInterface->addImage(id);
+    creationInterface->endEntity();
+    currentEntity = DL_UNKNOWN;
+}
+
+
+
+/**
+ * Adds an image definition that was read from the file via the creation interface.
+ */
+void DL_Dxf::addImageDef(DL_CreationInterface* creationInterface) {
+    DL_ImageDefData id(// handle
+        values[5],
+        values[1]);
+
+    creationInterface->linkImage(id);
+    creationInterface->endEntity();
+    currentEntity = DL_UNKNOWN;
+}
+
+
+
+/**
+ * Ends some special entities like hatches or old style polylines.
+ */
+void DL_Dxf::endEntity(DL_CreationInterface* creationInterface) {
+	creationInterface->endEntity();
+}
+
+
+/**
+ * Ends a sequence and notifies the creation interface.
+ */
+void DL_Dxf::endSequence(DL_CreationInterface* creationInterface) {
+    creationInterface->endSequence();
+}
+
+
+/**
+ * Converts the given string into an int.
+ * ok is set to false if there was an error.
+ */
+int DL_Dxf::stringToInt(const char* s, bool* ok) {
+    if (ok!=NULL) {
+        // check string:
+        *ok = true;
+        int i=0;
+        bool dot = false;
+        do {
+            if (s[i]=='\0') {
+                break;
+            } else if (s[i]=='.') {
+                if (dot==true) {
+                    //std::cerr << "two dots\n";
+                    *ok = false;
+                } else {
+                    dot = true;
+                }
+            } else if (s[i]<'0' || s[i]>'9') {
+                //std::cerr << "NaN: '" << s[i] << "'\n";
+                *ok = false;
+            }
+            i++;
+        } while(s[i]!='\0' && *ok==true);
+    }
+
+    return atoi(s);
+}
+
+
+/**
+ * @brief Opens the given file for writing and returns a pointer
+ * to the dxf writer. This pointer needs to be passed on to other
+ * writing functions.
+ *
+ * @param file Full path of the file to open.
+ *
+ * @return Pointer to an ascii dxf writer object.
+ */
+DL_WriterA* DL_Dxf::out(const char* file, DL_Codes::version version) {
+    char* f = new char[strlen(file)+1];
+    strcpy(f, file);
+    this->version = version;
+
+    DL_WriterA* dw = new DL_WriterA(f, version);
+    if (dw->openFailed()) {
+        delete dw;
+        delete[] f;
+        return NULL;
+    } else {
+        delete[] f;
+        return dw;
+    }
+}
+
+
+
+/**
+ * @brief Writes a DXF header to the file currently opened 
+ * by the given DXF writer object.
+ */
+void DL_Dxf::writeHeader(DL_WriterA& dw) {
+    dw.comment("dxflib " DL_VERSION);
+    dw.sectionHeader();
+
+    dw.dxfString(9, "$ACADVER");
+    switch (version) {
+    case DL_Codes::AC1009:
+        dw.dxfString(1, "AC1009");
+        break;
+    case DL_Codes::AC1012:
+        dw.dxfString(1, "AC1012");
+        break;
+    case DL_Codes::AC1014:
+        dw.dxfString(1, "AC1014");
+        break;
+    case DL_Codes::AC1015:
+        dw.dxfString(1, "AC1015");
+        break;
+    }
+
+    // Newer version require that (otherwise a*cad crashes..)
+    if (version==VER_2000) {
+        dw.dxfString(9, "$HANDSEED");
+        dw.dxfHex(5, 0xFFFF);
+    }
+
+    //dw.sectionEnd();
+}
+
+
+
+
+/**
+ * Writes a point entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writePoint(DL_WriterA& dw,
+                        const DL_PointData& data,
+                        const DL_Attributes& attrib) {
+    dw.entity("POINT");
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbPoint");
+    }
+    dw.entityAttributes(attrib);
+    dw.coord(POINT_COORD_CODE, data.x, data.y);
+}
+
+
+
+/**
+ * Writes a line entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeLine(DL_WriterA& dw,
+                       const DL_LineData& data,
+                       const DL_Attributes& attrib) {
+    dw.entity("LINE");
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbLine");
+    }
+    dw.entityAttributes(attrib);
+    dw.coord(LINE_START_CODE, data.x1, data.y1);
+    dw.coord(LINE_END_CODE, data.x2, data.y2);
+}
+
+
+
+/**
+ * Writes a polyline entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ * @see writeVertex
+ */
+void DL_Dxf::writePolyline(DL_WriterA& dw,
+                           const DL_PolylineData& data,
+                           const DL_Attributes& attrib) {
+    if (version==VER_2000) {
+        dw.entity("LWPOLYLINE");
+        dw.entityAttributes(attrib);
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbPolyline");
+        dw.dxfInt(90, (int)data.number);
+        dw.dxfInt(70, data.flags);
+    } else {
+        dw.entity("POLYLINE");
+        dw.entityAttributes(attrib);
+		polylineLayer = attrib.getLayer();
+        dw.dxfInt(66, 1);
+        dw.dxfInt(70, data.flags);
+        dw.coord(VERTEX_COORD_CODE, 0.0, 0.0);
+    }
+}
+
+
+
+/**
+ * Writes a single vertex of a polyline to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeVertex(DL_WriterA& dw,
+                         const DL_VertexData& data) {
+
+
+    if (version==VER_2000) {
+        dw.dxfReal(10, data.x);
+        dw.dxfReal(20, data.y);
+        if (fabs(data.bulge)>1.0e-10) {
+            dw.dxfReal(42, data.bulge);
+        }
+    } else {
+        dw.entity("VERTEX");
+        //dw.entityAttributes(attrib);
+    	dw.dxfString(8, polylineLayer);
+        dw.coord(VERTEX_COORD_CODE, data.x, data.y);
+        if (fabs(data.bulge)>1.0e-10) {
+            dw.dxfReal(42, data.bulge);
+        }
+    }
+}
+
+    
+	
+/**
+ * Writes the polyline end. Only needed for DXF R12.
+ */
+void DL_Dxf::writePolylineEnd(DL_WriterA& dw) {
+    if (version==VER_2000) {
+    } else {
+        dw.entity("SEQEND");
+    }
+}
+
+
+/**
+ * Writes a spline entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ * @see writeControlPoint
+ */
+void DL_Dxf::writeSpline(DL_WriterA& dw,
+                         const DL_SplineData& data,
+                         const DL_Attributes& attrib) {
+
+    dw.entity("SPLINE");
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbSpline");
+    }
+    dw.dxfInt(70, data.flags);
+    dw.dxfInt(71, data.degree);
+    dw.dxfInt(72, data.nKnots);            // number of knots
+    dw.dxfInt(73, data.nControl);          // number of control points
+    dw.dxfInt(74, 0);                      // number of fit points
+}
+
+
+
+/**
+ * Writes a single control point of a spline to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeControlPoint(DL_WriterA& dw,
+                               const DL_ControlPointData& data) {
+
+    dw.dxfReal(10, data.x);
+    dw.dxfReal(20, data.y);
+    dw.dxfReal(30, data.z);
+}
+
+
+
+/**
+ * Writes a single knot of a spline to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeKnot(DL_WriterA& dw,
+                       const DL_KnotData& data) {
+
+    dw.dxfReal(40, data.k);
+}
+
+
+
+/**
+ * Writes a circle entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeCircle(DL_WriterA& dw,
+                         const DL_CircleData& data,
+                         const DL_Attributes& attrib) {
+    dw.entity("CIRCLE");
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbCircle");
+    }
+    dw.entityAttributes(attrib);
+    dw.coord(10, data.cx, data.cy);
+    dw.dxfReal(40, data.radius);
+}
+
+
+
+/**
+ * Writes an arc entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeArc(DL_WriterA& dw,
+                      const DL_ArcData& data,
+                      const DL_Attributes& attrib) {
+    dw.entity("ARC");
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+    }
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbCircle");
+    }
+    dw.coord(10, data.cx, data.cy);
+    dw.dxfReal(40, data.radius);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbArc");
+    }
+    dw.dxfReal(50, data.angle1);
+    dw.dxfReal(51, data.angle2);
+}
+
+
+
+/**
+ * Writes an ellipse entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeEllipse(DL_WriterA& dw,
+                          const DL_EllipseData& data,
+                          const DL_Attributes& attrib) {
+
+    if (version>VER_R12) {
+        dw.entity("ELLIPSE");
+        if (version==VER_2000) {
+            dw.dxfString(100, "AcDbEntity");
+            dw.dxfString(100, "AcDbEllipse");
+        }
+        dw.entityAttributes(attrib);
+        dw.coord(10, data.cx, data.cy);
+        dw.coord(11, data.mx, data.my);
+        dw.dxfReal(40, data.ratio);
+        dw.dxfReal(41, data.angle1);
+        dw.dxfReal(42, data.angle2);
+    }
+}
+    
+    
+
+/**
+ * Writes a solid entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeSolid(DL_WriterA& dw,
+                   const DL_SolidData& data,
+                   const DL_Attributes& attrib) {
+    dw.entity("SOLID");
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbTrace");
+    }
+    dw.entityAttributes(attrib);
+    dw.coord(10, data.x[0], data.y[0], data.z[0]);
+    dw.coord(11, data.x[1], data.y[1], data.z[1]);
+    dw.coord(12, data.x[2], data.y[2], data.z[2]);
+    dw.coord(13, data.x[3], data.y[3], data.z[3]);
+    dw.dxfReal(39, data.thickness);
+}
+
+
+
+/**
+ * Writes a 3d face entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::write3dFace(DL_WriterA& dw,
+                   const DL_3dFaceData& data,
+                   const DL_Attributes& attrib) {
+    dw.entity("3DFACE");
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbFace");
+    }
+    dw.entityAttributes(attrib);
+    dw.coord(10, data.x[0], data.y[0], data.z[0]);
+    dw.coord(11, data.x[1], data.y[1], data.z[1]);
+    dw.coord(12, data.x[2], data.y[2], data.z[2]);
+    dw.coord(13, data.x[3], data.y[3], data.z[3]);
+}
+
+
+
+/**
+ * Writes an insert to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeInsert(DL_WriterA& dw,
+                         const DL_InsertData& data,
+                         const DL_Attributes& attrib) {
+
+    if (data.name.empty()) {
+        std::cerr << "DL_Dxf::writeInsert: "
+        << "Block name must not be empty\n";
+        return;
+    }
+
+    dw.entity("INSERT");
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbBlockReference");
+    }
+    dw.entityAttributes(attrib);
+    dw.dxfString(2, data.name);
+    dw.dxfReal(10, data.ipx);
+    dw.dxfReal(20, data.ipy);
+    dw.dxfReal(30, 0.0);
+    if (data.sx!=1.0 || data.sy!=1.0) {
+        dw.dxfReal(41, data.sx);
+        dw.dxfReal(42, data.sy);
+        dw.dxfReal(43, 1.0);
+    }
+    if (data.angle!=0.0) {
+        dw.dxfReal(50, data.angle);
+    }
+    if (data.cols!=1 || data.rows!=1) {
+        dw.dxfInt(70, data.cols);
+        dw.dxfInt(71, data.rows);
+    }
+    if (data.colSp!=0.0 || data.rowSp!=0.0) {
+        dw.dxfReal(44, data.colSp);
+        dw.dxfReal(45, data.rowSp);
+    }
+
+}
+
+
+
+/**
+ * Writes a multi text entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeMText(DL_WriterA& dw,
+                        const DL_MTextData& data,
+                        const DL_Attributes& attrib) {
+
+    dw.entity("MTEXT");
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbMText");
+    }
+    dw.entityAttributes(attrib);
+    dw.dxfReal(10, data.ipx);
+    dw.dxfReal(20, data.ipy);
+    dw.dxfReal(30, 0.0);
+    dw.dxfReal(40, data.height);
+    dw.dxfReal(41, data.width);
+
+    dw.dxfInt(71, data.attachmentPoint);
+    dw.dxfInt(72, data.drawingDirection);
+
+    // Creare text chunks of 250 characters each:
+    int length = data.text.length();
+    char chunk[251];
+    int i;
+    for (i=250; i<length; i+=250) {
+        strncpy(chunk, &data.text.c_str()[i-250], 250);
+        chunk[250]='\0';
+        dw.dxfString(3, chunk);
+    }
+    strncpy(chunk, &data.text.c_str()[i-250], 250);
+    chunk[250]='\0';
+    dw.dxfString(1, chunk);
+
+    dw.dxfString(7, data.style);
+
+    // since dxflib 2.0.2.1: degrees not rad (error in autodesk dxf doc)
+    dw.dxfReal(50, data.angle/(2.0*M_PI)*360.0);
+
+    dw.dxfInt(73, data.lineSpacingStyle);
+    dw.dxfReal(44, data.lineSpacingFactor);
+}
+
+
+
+/**
+ * Writes a text entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeText(DL_WriterA& dw,
+                       const DL_TextData& data,
+                       const DL_Attributes& attrib) {
+
+    dw.entity("TEXT");
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbText");
+    }
+    dw.entityAttributes(attrib);
+    dw.dxfReal(10, data.ipx);
+    dw.dxfReal(20, data.ipy);
+    dw.dxfReal(30, 0.0);
+    dw.dxfReal(40, data.height);
+    dw.dxfString(1, data.text);
+    dw.dxfReal(50, data.angle/(2*M_PI)*360.0);
+    dw.dxfReal(41, data.xScaleFactor);
+    dw.dxfString(7, data.style);
+
+    dw.dxfInt(71, data.textGenerationFlags);
+    dw.dxfInt(72, data.hJustification);
+
+    dw.dxfReal(11, data.apx);
+    dw.dxfReal(21, data.apy);
+    dw.dxfReal(31, 0.0);
+
+    dw.dxfInt(73, data.vJustification);
+}
+
+
+/**
+ * Writes an aligned dimension entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Generic dimension data for from the file
+ * @param data Specific aligned dimension data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeDimAligned(DL_WriterA& dw,
+                             const DL_DimensionData& data,
+                             const DL_DimAlignedData& edata,
+                             const DL_Attributes& attrib) {
+
+    dw.entity("DIMENSION");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+    }
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbDimension");
+    }
+
+    dw.dxfReal(10, data.dpx);
+    dw.dxfReal(20, data.dpy);
+    dw.dxfReal(30, 0.0);
+
+    dw.dxfReal(11, data.mpx);
+    dw.dxfReal(21, data.mpy);
+    dw.dxfReal(31, 0.0);
+
+    dw.dxfInt(70, 1);
+    if (version>VER_R12) {
+        dw.dxfInt(71, data.attachmentPoint);
+        dw.dxfInt(72, data.lineSpacingStyle); // opt
+        dw.dxfReal(41, data.lineSpacingFactor); // opt
+    }
+
+    dw.dxfReal(42, data.angle);
+
+    dw.dxfString(1, data.text);   // opt
+    //dw.dxfString(3, data.style);
+    dw.dxfString(3, "Standard");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbAlignedDimension");
+    }
+
+    dw.dxfReal(13, edata.epx1);
+    dw.dxfReal(23, edata.epy1);
+    dw.dxfReal(33, 0.0);
+
+    dw.dxfReal(14, edata.epx2);
+    dw.dxfReal(24, edata.epy2);
+    dw.dxfReal(34, 0.0);
+}
+
+
+
+/**
+ * Writes a linear dimension entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Generic dimension data for from the file
+ * @param data Specific linear dimension data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeDimLinear(DL_WriterA& dw,
+                            const DL_DimensionData& data,
+                            const DL_DimLinearData& edata,
+                            const DL_Attributes& attrib) {
+
+    dw.entity("DIMENSION");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+    }
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbDimension");
+    }
+
+    dw.dxfReal(10, data.dpx);
+    dw.dxfReal(20, data.dpy);
+    dw.dxfReal(30, 0.0);
+
+    dw.dxfReal(11, data.mpx);
+    dw.dxfReal(21, data.mpy);
+    dw.dxfReal(31, 0.0);
+
+    dw.dxfInt(70, 0);
+    if (version>VER_R12) {
+        dw.dxfInt(71, data.attachmentPoint);
+        dw.dxfInt(72, data.lineSpacingStyle); // opt
+        dw.dxfReal(41, data.lineSpacingFactor); // opt
+    }
+
+    dw.dxfReal(42, data.angle);
+
+    dw.dxfString(1, data.text);   // opt
+    //dw.dxfString(3, data.style);
+    dw.dxfString(3, "Standard");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbAlignedDimension");
+    }
+
+    dw.dxfReal(13, edata.dpx1);
+    dw.dxfReal(23, edata.dpy1);
+    dw.dxfReal(33, 0.0);
+
+    dw.dxfReal(14, edata.dpx2);
+    dw.dxfReal(24, edata.dpy2);
+    dw.dxfReal(34, 0.0);
+
+    dw.dxfReal(50, edata.angle/(2.0*M_PI)*360.0);
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbRotatedDimension");
+        /*
+        dw.dxfString(1001, "ACAD");
+        dw.dxfString(1000, "DSTYLE");
+        dw.dxfString(1002, "{");
+        dw.dxfInt(1070, 340);
+        dw.dxfInt(1005, 11);
+        dw.dxfString(1002, "}");
+        */
+    }
+}
+
+
+
+/**
+ * Writes a radial dimension entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Generic dimension data for from the file
+ * @param data Specific radial dimension data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeDimRadial(DL_WriterA& dw,
+                            const DL_DimensionData& data,
+                            const DL_DimRadialData& edata,
+                            const DL_Attributes& attrib) {
+
+    dw.entity("DIMENSION");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+    }
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbDimension");
+    }
+
+    dw.dxfReal(10, data.dpx);
+    dw.dxfReal(20, data.dpy);
+    dw.dxfReal(30, 0.0);
+
+    dw.dxfReal(11, data.mpx);
+    dw.dxfReal(21, data.mpy);
+    dw.dxfReal(31, 0.0);
+
+    dw.dxfInt(70, 4);
+    if (version>VER_R12) {
+        dw.dxfInt(71, data.attachmentPoint);
+        dw.dxfInt(72, data.lineSpacingStyle); // opt
+        dw.dxfReal(41, data.lineSpacingFactor); // opt
+    }
+
+    dw.dxfReal(42, data.angle);
+
+    dw.dxfString(1, data.text);   // opt
+    //dw.dxfString(3, data.style);
+    dw.dxfString(3, "Standard");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbRadialDimension");
+    }
+
+    dw.dxfReal(15, edata.dpx);
+    dw.dxfReal(25, edata.dpy);
+    dw.dxfReal(35, 0.0);
+
+    dw.dxfReal(40, edata.leader);
+}
+
+
+
+/**
+ * Writes a diametric dimension entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Generic dimension data for from the file
+ * @param data Specific diametric dimension data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeDimDiametric(DL_WriterA& dw,
+                               const DL_DimensionData& data,
+                               const DL_DimDiametricData& edata,
+                               const DL_Attributes& attrib) {
+
+    dw.entity("DIMENSION");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+    }
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbDimension");
+    }
+
+    dw.dxfReal(10, data.dpx);
+    dw.dxfReal(20, data.dpy);
+    dw.dxfReal(30, 0.0);
+
+    dw.dxfReal(11, data.mpx);
+    dw.dxfReal(21, data.mpy);
+    dw.dxfReal(31, 0.0);
+
+    dw.dxfInt(70, 3);
+    if (version>VER_R12) {
+        dw.dxfInt(71, data.attachmentPoint);
+        dw.dxfInt(72, data.lineSpacingStyle); // opt
+        dw.dxfReal(41, data.lineSpacingFactor); // opt
+    }
+
+    dw.dxfReal(42, data.angle);
+
+    dw.dxfString(1, data.text);   // opt
+    //dw.dxfString(3, data.style);
+    dw.dxfString(3, "Standard");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbDiametricDimension");
+    }
+
+    dw.dxfReal(15, edata.dpx);
+    dw.dxfReal(25, edata.dpy);
+    dw.dxfReal(35, 0.0);
+
+    dw.dxfReal(40, edata.leader);
+}
+
+
+
+/**
+ * Writes an angular dimension entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Generic dimension data for from the file
+ * @param data Specific angular dimension data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeDimAngular(DL_WriterA& dw,
+                             const DL_DimensionData& data,
+                             const DL_DimAngularData& edata,
+                             const DL_Attributes& attrib) {
+
+    dw.entity("DIMENSION");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+    }
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbDimension");
+    }
+
+    dw.dxfReal(10, data.dpx);
+    dw.dxfReal(20, data.dpy);
+    dw.dxfReal(30, 0.0);
+
+    dw.dxfReal(11, data.mpx);
+    dw.dxfReal(21, data.mpy);
+    dw.dxfReal(31, 0.0);
+
+    dw.dxfInt(70, 2);
+    if (version>VER_R12) {
+        dw.dxfInt(71, data.attachmentPoint);
+        dw.dxfInt(72, data.lineSpacingStyle); // opt
+        dw.dxfReal(41, data.lineSpacingFactor); // opt
+    }
+
+    dw.dxfReal(42, data.angle);
+
+    dw.dxfString(1, data.text);   // opt
+    //dw.dxfString(3, data.style);
+    dw.dxfString(3, "Standard");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDb2LineAngularDimension");
+    }
+
+    dw.dxfReal(13, edata.dpx1);
+    dw.dxfReal(23, edata.dpy1);
+    dw.dxfReal(33, 0.0);
+
+    dw.dxfReal(14, edata.dpx2);
+    dw.dxfReal(24, edata.dpy2);
+    dw.dxfReal(34, 0.0);
+
+    dw.dxfReal(15, edata.dpx3);
+    dw.dxfReal(25, edata.dpy3);
+    dw.dxfReal(35, 0.0);
+
+    dw.dxfReal(16, edata.dpx4);
+    dw.dxfReal(26, edata.dpy4);
+    dw.dxfReal(36, 0.0);
+}
+
+
+
+/**
+ * Writes an angular dimension entity (3 points version) to the file.
+ *
+ * @param dw DXF writer
+ * @param data Generic dimension data for from the file
+ * @param data Specific angular dimension data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeDimAngular3P(DL_WriterA& dw,
+                               const DL_DimensionData& data,
+                               const DL_DimAngular3PData& edata,
+                               const DL_Attributes& attrib) {
+
+    dw.entity("DIMENSION");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+    }
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbDimension");
+    }
+
+    dw.dxfReal(10, data.dpx);
+    dw.dxfReal(20, data.dpy);
+    dw.dxfReal(30, 0.0);
+
+    dw.dxfReal(11, data.mpx);
+    dw.dxfReal(21, data.mpy);
+    dw.dxfReal(31, 0.0);
+
+    dw.dxfInt(70, 5);
+    if (version>VER_R12) {
+        dw.dxfInt(71, data.attachmentPoint);
+        dw.dxfInt(72, data.lineSpacingStyle); // opt
+        dw.dxfReal(41, data.lineSpacingFactor); // opt
+    }
+
+    dw.dxfReal(42, data.angle);
+
+    dw.dxfString(1, data.text);   // opt
+    //dw.dxfString(3, data.style);
+    dw.dxfString(3, "Standard");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDb3PointAngularDimension");
+    }
+
+    dw.dxfReal(13, edata.dpx1);
+    dw.dxfReal(23, edata.dpy1);
+    dw.dxfReal(33, 0.0);
+
+    dw.dxfReal(14, edata.dpx2);
+    dw.dxfReal(24, edata.dpy2);
+    dw.dxfReal(34, 0.0);
+
+    dw.dxfReal(15, edata.dpx3);
+    dw.dxfReal(25, edata.dpy3);
+    dw.dxfReal(35, 0.0);
+}
+
+
+
+
+/**
+ * Writes an ordinate dimension entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Generic dimension data for from the file
+ * @param data Specific ordinate dimension data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeDimOrdinate(DL_WriterA& dw,
+                             const DL_DimensionData& data,
+                             const DL_DimOrdinateData& edata,
+                             const DL_Attributes& attrib) {
+
+    dw.entity("DIMENSION");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+    }
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbDimension");
+    }
+
+    dw.dxfReal(10, data.dpx);
+    dw.dxfReal(20, data.dpy);
+    dw.dxfReal(30, 0.0);
+
+    dw.dxfReal(11, data.mpx);
+    dw.dxfReal(21, data.mpy);
+    dw.dxfReal(31, 0.0);
+
+    int type = 6;
+    if (edata.xtype) {
+        type+=64;
+    }
+
+    dw.dxfInt(70, type);
+    if (version>VER_R12) {
+        dw.dxfInt(71, data.attachmentPoint);
+        dw.dxfInt(72, data.lineSpacingStyle); // opt
+        dw.dxfReal(41, data.lineSpacingFactor); // opt
+    }
+
+    dw.dxfString(1, data.text);   // opt
+    //dw.dxfString(3, data.style);
+    dw.dxfString(3, "Standard");
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbOrdinateDimension");
+    }
+
+    dw.dxfReal(13, edata.dpx1);
+    dw.dxfReal(23, edata.dpy1);
+    dw.dxfReal(33, 0.0);
+
+    dw.dxfReal(14, edata.dpx2);
+    dw.dxfReal(24, edata.dpy2);
+    dw.dxfReal(34, 0.0);
+}
+
+
+
+/**
+ * Writes a leader entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ * @see writeVertex
+ */
+void DL_Dxf::writeLeader(DL_WriterA& dw,
+                         const DL_LeaderData& data,
+                         const DL_Attributes& attrib) {
+    if (version>VER_R12) {
+        dw.entity("LEADER");
+        dw.entityAttributes(attrib);
+        if (version==VER_2000) {
+            dw.dxfString(100, "AcDbEntity");
+            dw.dxfString(100, "AcDbLeader");
+        }
+        dw.dxfString(3, "Standard");
+        dw.dxfInt(71, data.arrowHeadFlag);
+        dw.dxfInt(72, data.leaderPathType);
+        dw.dxfInt(73, data.leaderCreationFlag);
+        dw.dxfInt(74, data.hooklineDirectionFlag);
+        dw.dxfInt(75, data.hooklineFlag);
+        dw.dxfReal(40, data.textAnnotationHeight);
+        dw.dxfReal(41, data.textAnnotationWidth);
+        dw.dxfInt(76, data.number);
+    }
+}
+
+
+
+/**
+ * Writes a single vertex of a leader to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data
+ */
+void DL_Dxf::writeLeaderVertex(DL_WriterA& dw,
+                               const DL_LeaderVertexData& data) {
+    if (version>VER_R12) {
+        dw.dxfReal(10, data.x);
+        dw.dxfReal(20, data.y);
+    }
+}
+
+
+
+/**
+ * Writes the beginning of a hatch entity to the file.
+ * This must be followed by one or more writeHatchLoop()
+ * calls and a writeHatch2() call.
+ *
+ * @param dw DXF writer
+ * @param data Entity data.
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeHatch1(DL_WriterA& dw,
+                         const DL_HatchData& data,
+                         const DL_Attributes& attrib) {
+
+    dw.entity("HATCH");
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbHatch");
+    }
+    dw.dxfReal(10, 0.0);             // elevation
+    dw.dxfReal(20, 0.0);
+    dw.dxfReal(30, 0.0);
+    dw.dxfReal(210, 0.0);             // extrusion dir.
+    dw.dxfReal(220, 0.0);
+    dw.dxfReal(230, 1.0);
+    if (data.solid==false) {
+        dw.dxfString(2, data.pattern);
+    } else {
+        dw.dxfString(2, "SOLID");
+    }
+    dw.dxfInt(70, (int)data.solid);
+    dw.dxfInt(71, 0);                // associative
+    dw.dxfInt(91, data.numLoops);
+}
+
+
+
+/**
+ * Writes the end of a hatch entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data.
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeHatch2(DL_WriterA& dw,
+                         const DL_HatchData& data,
+                         const DL_Attributes& /*attrib*/) {
+
+    dw.dxfInt(75, 0);                // odd parity
+    dw.dxfInt(76, 1);                // pattern type
+    if (data.solid==false) {
+        dw.dxfReal(52, data.angle);
+        dw.dxfReal(41, data.scale);
+        dw.dxfInt(77, 0);            // not double
+        //dw.dxfInt(78, 0);
+        dw.dxfInt(78, 1);
+        dw.dxfReal(53, 45.0);
+        dw.dxfReal(43, 0.0);
+        dw.dxfReal(44, 0.0);
+        dw.dxfReal(45, -0.0883883476483184);
+        dw.dxfReal(46, 0.0883883476483185);
+        dw.dxfInt(79, 0);
+    }
+    dw.dxfInt(98, 0);
+}
+
+
+
+/**
+ * Writes the beginning of a hatch loop to the file. This
+ * must happen after writing the beginning of a hatch entity.
+ *
+ * @param dw DXF writer
+ * @param data Entity data.
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeHatchLoop1(DL_WriterA& dw,
+                             const DL_HatchLoopData& data) {
+
+    dw.dxfInt(92, 1);
+    dw.dxfInt(93, data.numEdges);
+    //dw.dxfInt(97, 0);
+}
+
+
+
+/**
+ * Writes the end of a hatch loop to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data.
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeHatchLoop2(DL_WriterA& dw,
+                             const DL_HatchLoopData& /*data*/) {
+
+    dw.dxfInt(97, 0);
+}
+
+
+/**
+ * Writes the beginning of a hatch entity to the file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data.
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeHatchEdge(DL_WriterA& dw,
+                            const DL_HatchEdgeData& data) {
+
+    dw.dxfInt(72, data.type);
+
+    switch (data.type) {
+    case 1:
+        dw.dxfReal(10, data.x1);
+        dw.dxfReal(20, data.y1);
+        dw.dxfReal(11, data.x2);
+        dw.dxfReal(21, data.y2);
+        break;
+    case 2:
+        dw.dxfReal(10, data.cx);
+        dw.dxfReal(20, data.cy);
+        dw.dxfReal(40, data.radius);
+        dw.dxfReal(50, data.angle1/(2*M_PI)*360.0);
+        dw.dxfReal(51, data.angle2/(2*M_PI)*360.0);
+        dw.dxfInt(73, (int)(data.ccw));
+        break;
+    default:
+        break;
+    }
+}
+
+
+
+/**
+ * Writes an image entity.
+ *
+ * @return IMAGEDEF handle. Needed for the IMAGEDEF counterpart.
+ */
+int DL_Dxf::writeImage(DL_WriterA& dw,
+                       const DL_ImageData& data,
+                       const DL_Attributes& attrib) {
+
+    /*if (data.file.empty()) {
+        std::cerr << "DL_Dxf::writeImage: "
+        << "Image file must not be empty\n";
+        return;
+}*/
+
+    dw.entity("IMAGE");
+
+    dw.entityAttributes(attrib);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbEntity");
+        dw.dxfString(100, "AcDbRasterImage");
+        dw.dxfInt(90, 0);
+    }
+    // insertion point
+    dw.dxfReal(10, data.ipx);
+    dw.dxfReal(20, data.ipy);
+    dw.dxfReal(30, 0.0);
+
+    // vector along bottom side (1 pixel long)
+    dw.dxfReal(11, data.ux);
+    dw.dxfReal(21, data.uy);
+    dw.dxfReal(31, 0.0);
+
+    // vector along left side (1 pixel long)
+    dw.dxfReal(12, data.vx);
+    dw.dxfReal(22, data.vy);
+    dw.dxfReal(32, 0.0);
+
+    // image size in pixel
+    dw.dxfReal(13, data.width);
+    dw.dxfReal(23, data.height);
+
+    // handle of IMAGEDEF object
+    int handle = dw.incHandle();
+    dw.dxfHex(340, handle);
+
+    // flags
+    dw.dxfInt(70, 15);
+
+    // clipping:
+    dw.dxfInt(280, 0);
+
+    // brightness, contrast, fade
+    dw.dxfInt(281, data.brightness);
+    dw.dxfInt(282, data.contrast);
+    dw.dxfInt(283, data.fade);
+
+    return handle;
+}
+
+
+
+/**
+ * Writes an image definiition entity.
+ */
+void DL_Dxf::writeImageDef(DL_WriterA& dw,
+                           int handle,
+                           const DL_ImageData& data) {
+
+    /*if (data.file.empty()) {
+        std::cerr << "DL_Dxf::writeImage: "
+        << "Image file must not be empty\n";
+        return;
+}*/
+
+    dw.dxfString(0, "IMAGEDEF");
+    if (version==VER_2000) {
+    	dw.dxfHex(5, handle);
+	}
+
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbRasterImageDef");
+        dw.dxfInt(90, 0);
+    }
+    // file name:
+    dw.dxfString(1, data.ref);
+
+    // image size in pixel
+    dw.dxfReal(10, data.width);
+    dw.dxfReal(20, data.height);
+
+    dw.dxfReal(11, 1.0);
+    dw.dxfReal(21, 1.0);
+
+    // loaded:
+    dw.dxfInt(280, 1);
+    // units:
+    dw.dxfInt(281, 0);
+}
+
+
+/**
+ * Writes a layer to the file. Layers are stored in the 
+ * tables section of a DXF file.
+ *
+ * @param dw DXF writer
+ * @param data Entity data from the file
+ * @param attrib Attributes
+ */
+void DL_Dxf::writeLayer(DL_WriterA& dw,
+                        const DL_LayerData& data,
+                        const DL_Attributes& attrib) {
+
+    if (data.name.empty()) {
+        std::cerr << "DL_Dxf::writeLayer: "
+        << "Layer name must not be empty\n";
+        return;
+    }
+
+    int color = attrib.getColor();
+    if (color>=256) {
+        std::cerr << "Layer color cannot be " << color << ". Changed to 7.\n";
+        color = 7;
+    }
+
+    if (data.name == "0") {
+        dw.tableLayerEntry(0x10);
+    } else {
+        dw.tableLayerEntry();
+    }
+
+    dw.dxfString(2, data.name);
+    dw.dxfInt(70, data.flags);
+    dw.dxfInt(62, color);
+
+    dw.dxfString(6, (attrib.getLineType().length()==0 ?
+                     string("CONTINUOUS") : attrib.getLineType()));
+
+    if (version>=VER_2000) {
+        // layer defpoints cannot be plotted
+        std::string lstr = data.name;
+        std::transform(lstr.begin(), lstr.end(), lstr.begin(), tolower);
+        if (lstr=="defpoints") {
+            dw.dxfInt(290, 0);
+        }
+    }
+    if (version>=VER_2000 && attrib.getWidth()!=-1) {
+        dw.dxfInt(370, attrib.getWidth());
+    }
+    if (version>=VER_2000) {
+        dw.dxfHex(390, 0xF);
+    }
+}
+
+
+
+/**
+ * Writes a line type to the file. Line types are stored in the 
+ * tables section of a DXF file.
+ */
+void DL_Dxf::writeLineType(DL_WriterA& dw,
+                           const DL_LineTypeData& data) {
+    //const char* description,
+    //int elements,
+    //double patternLength) {
+
+    if (data.name.empty()) {
+        std::cerr << "DL_Dxf::writeLineType: "
+        << "Line type name must not be empty\n";
+        return;
+    }
+
+	// ignore BYLAYER, BYBLOCK for R12
+	if (version<VER_2000) {
+		if (!strcasecmp(data.name.c_str(), "BYBLOCK") ||
+		    !strcasecmp(data.name.c_str(), "BYLAYER")) {
+			return;
+		}
+	}
+
+	// write id (not for R12)
+    if (!strcasecmp(data.name.c_str(), "BYBLOCK")) {
+        dw.tableLineTypeEntry(0x14);
+    } else if (!strcasecmp(data.name.c_str(), "BYLAYER")) {
+        dw.tableLineTypeEntry(0x15);
+    } else if (!strcasecmp(data.name.c_str(), "CONTINUOUS")) {
+        dw.tableLineTypeEntry(0x16);
+    } else {
+        dw.tableLineTypeEntry();
+    }
+
+    dw.dxfString(2, data.name);
+	//if (version>=VER_2000) {
+    	dw.dxfInt(70, data.flags);
+	//}
+
+    if (!strcasecmp(data.name.c_str(), "BYBLOCK")) {
+        dw.dxfString(3, "");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 0);
+        dw.dxfReal(40, 0.0);
+    } else if (!strcasecmp(data.name.c_str(), "BYLAYER")) {
+        dw.dxfString(3, "");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 0);
+        dw.dxfReal(40, 0.0);
+    } else if (!strcasecmp(data.name.c_str(), "CONTINUOUS")) {
+        dw.dxfString(3, "Solid line");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 0);
+        dw.dxfReal(40, 0.0);
+    } else if (!strcasecmp(data.name.c_str(), "ACAD_ISO02W100")) {
+        dw.dxfString(3, "ISO Dashed __ __ __ __ __ __ __ __ __ __ _");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 2);
+        dw.dxfReal(40, 15.0);
+        dw.dxfReal(49, 12.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "ACAD_ISO03W100")) {
+        dw.dxfString(3, "ISO Dashed with Distance __    __    __    _");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 2);
+        dw.dxfReal(40, 30.0);
+        dw.dxfReal(49, 12.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -18.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "ACAD_ISO04W100")) {
+        dw.dxfString(3, "ISO Long Dashed Dotted ____ . ____ . __");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 4);
+        dw.dxfReal(40, 30.0);
+        dw.dxfReal(49, 24.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "ACAD_ISO05W100")) {
+        dw.dxfString(3, "ISO Long Dashed Double Dotted ____ .. __");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 6);
+        dw.dxfReal(40, 33.0);
+        dw.dxfReal(49, 24.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "BORDER")) {
+        dw.dxfString(3, "Border __ __ . __ __ . __ __ . __ __ . __ __ .");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 6);
+        dw.dxfReal(40, 44.45);
+        dw.dxfReal(49, 12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "BORDER2")) {
+        dw.dxfString(3, "Border (.5x) __.__.__.__.__.__.__.__.__.__.__.");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 6);
+        dw.dxfReal(40, 22.225);
+        dw.dxfReal(49, 6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "BORDERX2")) {
+        dw.dxfString(3, "Border (2x) ____  ____  .  ____  ____  .  ___");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 6);
+        dw.dxfReal(40, 88.9);
+        dw.dxfReal(49, 25.4);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 25.4);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "CENTER")) {
+        dw.dxfString(3, "Center ____ _ ____ _ ____ _ ____ _ ____ _ ____");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 4);
+        dw.dxfReal(40, 50.8);
+        dw.dxfReal(49, 31.75);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "CENTER2")) {
+        dw.dxfString(3, "Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 4);
+        dw.dxfReal(40, 28.575);
+        dw.dxfReal(49, 19.05);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "CENTERX2")) {
+        dw.dxfString(3, "Center (2x) ________  __  ________  __  _____");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 4);
+        dw.dxfReal(40, 101.6);
+        dw.dxfReal(49, 63.5);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DASHDOT")) {
+        dw.dxfString(3, "Dash dot __ . __ . __ . __ . __ . __ . __ . __");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 4);
+        dw.dxfReal(40, 25.4);
+        dw.dxfReal(49, 12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DASHDOT2")) {
+        dw.dxfString(3, "Dash dot (.5x) _._._._._._._._._._._._._._._.");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 4);
+        dw.dxfReal(40, 12.7);
+        dw.dxfReal(49, 6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DASHDOTX2")) {
+        dw.dxfString(3, "Dash dot (2x) ____  .  ____  .  ____  .  ___");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 4);
+        dw.dxfReal(40, 50.8);
+        dw.dxfReal(49, 25.4);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DASHED")) {
+        dw.dxfString(3, "Dashed __ __ __ __ __ __ __ __ __ __ __ __ __ _");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 2);
+        dw.dxfReal(40, 19.05);
+        dw.dxfReal(49, 12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DASHED2")) {
+        dw.dxfString(3, "Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 2);
+        dw.dxfReal(40, 9.525);
+        dw.dxfReal(49, 6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DASHEDX2")) {
+        dw.dxfString(3, "Dashed (2x) ____  ____  ____  ____  ____  ___");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 2);
+        dw.dxfReal(40, 38.1);
+        dw.dxfReal(49, 25.4);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DIVIDE")) {
+        dw.dxfString(3, "Divide ____ . . ____ . . ____ . . ____ . . ____");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 6);
+        dw.dxfReal(40, 31.75);
+        dw.dxfReal(49, 12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DIVIDE2")) {
+        dw.dxfString(3, "Divide (.5x) __..__..__..__..__..__..__..__.._");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 6);
+        dw.dxfReal(40, 15.875);
+        dw.dxfReal(49, 6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DIVIDEX2")) {
+        dw.dxfString(3, "Divide (2x) ________  .  .  ________  .  .  _");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 6);
+        dw.dxfReal(40, 63.5);
+        dw.dxfReal(49, 25.4);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DOT")) {
+        dw.dxfString(3, "Dot . . . . . . . . . . . . . . . . . . . . . .");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 2);
+        dw.dxfReal(40, 6.35);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -6.35);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DOT2")) {
+        dw.dxfString(3, "Dot (.5x) .....................................");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 2);
+        dw.dxfReal(40, 3.175);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -3.175);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else if (!strcasecmp(data.name.c_str(), "DOTX2")) {
+        dw.dxfString(3, "Dot (2x) .  .  .  .  .  .  .  .  .  .  .  .  .");
+        dw.dxfInt(72, 65);
+        dw.dxfInt(73, 2);
+        dw.dxfReal(40, 12.7);
+        dw.dxfReal(49, 0.0);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+        dw.dxfReal(49, -12.7);
+        if (version>=VER_R13)
+            dw.dxfInt(74, 0);
+    } else {
+        std::cerr << "dxflib warning: DL_Dxf::writeLineType: Unknown Line Type\n";
+    }
+}
+
+
+
+/**
+ * Writes the APPID section to the DXF file.
+ *
+ * @param name Application name
+ */
+void DL_Dxf::writeAppid(DL_WriterA& dw, const string& name) {
+    if (name.empty()) {
+        std::cerr << "DL_Dxf::writeAppid: "
+        << "Application  name must not be empty\n";
+        return;
+    }
+
+    if (!strcasecmp(name.c_str(), "ACAD")) {
+        dw.tableAppidEntry(0x12);
+    } else {
+        dw.tableAppidEntry();
+    }
+    dw.dxfString(2, name);
+    dw.dxfInt(70, 0);
+}
+
+
+
+/**
+ * Writes a block's definition (no entities) to the DXF file.
+ */
+void DL_Dxf::writeBlock(DL_WriterA& dw, const DL_BlockData& data) {
+    if (data.name.empty()) {
+        std::cerr << "DL_Dxf::writeBlock: "
+        << "Block name must not be empty\n";
+        return;
+    }
+
+    //bool paperSpace = !strcasecmp(name, "*paper_space");
+    //!strcasecmp(name, "*paper_space0");
+
+    if (!strcasecmp(data.name.c_str(), "*paper_space")) {
+        dw.sectionBlockEntry(0x1C);
+    } else if (!strcasecmp(data.name.c_str(), "*model_space")) {
+        dw.sectionBlockEntry(0x20);
+    } else if (!strcasecmp(data.name.c_str(), "*paper_space0")) {
+        dw.sectionBlockEntry(0x24);
+    } else {
+        dw.sectionBlockEntry();
+    }
+    dw.dxfString(2, data.name);
+    dw.dxfInt(70, 0);
+    dw.coord(10, data.bpx, data.bpy);
+    dw.dxfString(3, data.name);
+    dw.dxfString(1, "");
+}
+
+
+
+/**
+ * Writes a block end.
+ *
+ * @param name Block name
+ */
+void DL_Dxf::writeEndBlock(DL_WriterA& dw, const string& name) {
+    if (!strcasecmp(name.c_str(), "*paper_space")) {
+        dw.sectionBlockEntryEnd(0x1D);
+    } else if (!strcasecmp(name.c_str(), "*model_space")) {
+        dw.sectionBlockEntryEnd(0x21);
+    } else if (!strcasecmp(name.c_str(), "*paper_space0")) {
+        dw.sectionBlockEntryEnd(0x25);
+    } else {
+        dw.sectionBlockEntryEnd();
+    }
+}
+
+
+
+/**
+ * Writes a viewport section. This section is needed in VER_R13.
+ * Note that this method currently only writes a faked VPORT section
+ * to make the file readable by Aut*cad.
+ */
+void DL_Dxf::writeVPort(DL_WriterA& dw) {
+    dw.dxfString(0, "TABLE");
+    dw.dxfString(2, "VPORT");
+    if (version==VER_2000) {
+        dw.dxfHex(5, 0x8);
+    }
+    //dw.dxfHex(330, 0);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTable");
+    }
+    dw.dxfInt(70, 1);
+    dw.dxfString(0, "VPORT");
+    //dw.dxfHex(5, 0x2F);
+    if (version==VER_2000) {
+        dw.handle();
+    }
+    //dw.dxfHex(330, 8);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTableRecord");
+        dw.dxfString(100, "AcDbViewportTableRecord");
+    }
+    dw.dxfString(  2, "*Active");
+    dw.dxfInt( 70, 0);
+    dw.dxfReal( 10, 0.0);
+    dw.dxfReal( 20, 0.0);
+    dw.dxfReal( 11, 1.0);
+    dw.dxfReal( 21, 1.0);
+    dw.dxfReal( 12, 286.3055555555555);
+    dw.dxfReal( 22, 148.5);
+    dw.dxfReal( 13, 0.0);
+    dw.dxfReal( 23, 0.0);
+    dw.dxfReal( 14, 10.0);
+    dw.dxfReal( 24, 10.0);
+    dw.dxfReal( 15, 10.0);
+    dw.dxfReal( 25, 10.0);
+    dw.dxfReal( 16, 0.0);
+    dw.dxfReal( 26, 0.0);
+    dw.dxfReal( 36, 1.0);
+    dw.dxfReal( 17, 0.0);
+    dw.dxfReal( 27, 0.0);
+    dw.dxfReal( 37, 0.0);
+    dw.dxfReal( 40, 297.0);
+    dw.dxfReal( 41, 1.92798353909465);
+    dw.dxfReal( 42, 50.0);
+    dw.dxfReal( 43, 0.0);
+    dw.dxfReal( 44, 0.0);
+    dw.dxfReal( 50, 0.0);
+    dw.dxfReal( 51, 0.0);
+    dw.dxfInt( 71, 0);
+    dw.dxfInt( 72, 100);
+    dw.dxfInt( 73, 1);
+    dw.dxfInt( 74, 3);
+    dw.dxfInt( 75, 1);
+    dw.dxfInt( 76, 1);
+    dw.dxfInt( 77, 0);
+    dw.dxfInt( 78, 0);
+
+    if (version==VER_2000) {
+        dw.dxfInt(281, 0);
+        dw.dxfInt( 65, 1);
+        dw.dxfReal(110, 0.0);
+        dw.dxfReal(120, 0.0);
+        dw.dxfReal(130, 0.0);
+        dw.dxfReal(111, 1.0);
+        dw.dxfReal(121, 0.0);
+        dw.dxfReal(131, 0.0);
+        dw.dxfReal(112, 0.0);
+        dw.dxfReal(122, 1.0);
+        dw.dxfReal(132, 0.0);
+        dw.dxfInt( 79, 0);
+        dw.dxfReal(146, 0.0);
+    }
+    dw.dxfString(  0, "ENDTAB");
+}
+
+
+
+/**
+ * Writes a style section. This section is needed in VER_R13.
+ * Note that this method currently only writes a faked STYLE section
+ * to make the file readable by Aut*cad.
+ */
+void DL_Dxf::writeStyle(DL_WriterA& dw) {
+    dw.dxfString(  0, "TABLE");
+    dw.dxfString(  2, "STYLE");
+    if (version==VER_2000) {
+    	dw.dxfHex(5, 3);
+	}
+    //dw.dxfHex(330, 0);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTable");
+    }
+    dw.dxfInt( 70, 1);
+    dw.dxfString(  0, "STYLE");
+    if (version==VER_2000) {
+    	dw.dxfHex(5, 0x11);
+	}
+    //styleHandleStd = dw.handle();
+    //dw.dxfHex(330, 3);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTableRecord");
+        dw.dxfString(100, "AcDbTextStyleTableRecord");
+    }
+    dw.dxfString(  2, "Standard");
+    dw.dxfInt( 70, 0);
+    dw.dxfReal( 40, 0.0);
+    dw.dxfReal( 41, 0.75);
+    dw.dxfReal( 50, 0.0);
+    dw.dxfInt( 71, 0);
+    dw.dxfReal( 42, 2.5);
+    dw.dxfString(  3, "txt");
+    dw.dxfString(  4, "");
+    dw.dxfString(  0, "ENDTAB");
+}
+
+
+
+/**
+ * Writes a view section. This section is needed in VER_R13.
+ * Note that this method currently only writes a faked VIEW section
+ * to make the file readable by Aut*cad.
+ */
+void DL_Dxf::writeView(DL_WriterA& dw) {
+    dw.dxfString(  0, "TABLE");
+    dw.dxfString(  2, "VIEW");
+    if (version==VER_2000) {
+    	dw.dxfHex(5, 6);
+	}
+    //dw.dxfHex(330, 0);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTable");
+    }
+    dw.dxfInt( 70, 0);
+    dw.dxfString(  0, "ENDTAB");
+}
+
+
+
+/**
+ * Writes a ucs section. This section is needed in VER_R13.
+ * Note that this method currently only writes a faked UCS section
+ * to make the file readable by Aut*cad.
+ */
+void DL_Dxf::writeUcs(DL_WriterA& dw) {
+    dw.dxfString(  0, "TABLE");
+    dw.dxfString(  2, "UCS");
+    if (version==VER_2000) {
+    	dw.dxfHex(5, 7);
+	}
+    //dw.dxfHex(330, 0);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTable");
+    }
+    dw.dxfInt( 70, 0);
+    dw.dxfString(  0, "ENDTAB");
+}
+
+
+
+/**
+ * Writes a dimstyle section. This section is needed in VER_R13.
+ * Note that this method currently only writes a faked DIMSTYLE section
+ * to make the file readable by Aut*cad.
+ */
+void DL_Dxf::writeDimStyle(DL_WriterA& dw, 
+					double dimasz, double dimexe, double dimexo,
+                       double dimgap, double dimtxt) {
+
+    dw.dxfString(  0, "TABLE");
+    dw.dxfString(  2, "DIMSTYLE");
+    if (version==VER_2000) {
+        dw.dxfHex(5, 0xA);
+        dw.dxfString(100, "AcDbSymbolTable");
+    }
+    dw.dxfInt( 70, 1);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbDimStyleTable");
+        dw.dxfInt( 71, 0);
+    }
+
+
+    dw.dxfString(  0, "DIMSTYLE");
+    if (version==VER_2000) {
+        dw.dxfHex(105, 0x27);
+    }
+    //dw.handle(105);
+    //dw.dxfHex(330, 0xA);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTableRecord");
+        dw.dxfString(100, "AcDbDimStyleTableRecord");
+    }
+    dw.dxfString(  2, "Standard");
+    if (version==VER_R12) {
+        dw.dxfString(  3, "");
+        dw.dxfString(  4, "");
+        dw.dxfString(  5, "");
+        dw.dxfString(  6, "");
+        dw.dxfString(  7, "");
+        dw.dxfReal( 40, 1.0);
+    }
+
+    dw.dxfReal( 41, dimasz);
+    dw.dxfReal( 42, dimexo);
+    dw.dxfReal( 43, 3.75);
+    dw.dxfReal( 44, dimexe);
+    if (version==VER_R12) {
+        dw.dxfReal( 45, 0.0);
+        dw.dxfReal( 46, 0.0);
+        dw.dxfReal( 47, 0.0);
+        dw.dxfReal( 48, 0.0);
+    }
+    dw.dxfInt( 70, 0);
+    if (version==VER_R12) {
+        dw.dxfInt( 71, 0);
+        dw.dxfInt( 72, 0);
+    }
+    dw.dxfInt( 73, 0);
+    dw.dxfInt( 74, 0);
+    if (version==VER_R12) {
+        dw.dxfInt( 75, 0);
+        dw.dxfInt( 76, 0);
+    }
+    dw.dxfInt( 77, 1);
+    dw.dxfInt( 78, 8);
+    dw.dxfReal(140, dimtxt);
+    dw.dxfReal(141, 2.5);
+    if (version==VER_R12) {
+        dw.dxfReal(142, 0.0);
+    }
+    dw.dxfReal(143, 0.03937007874016);
+    if (version==VER_R12) {
+        dw.dxfReal(144, 1.0);
+        dw.dxfReal(145, 0.0);
+        dw.dxfReal(146, 1.0);
+    }
+    dw.dxfReal(147, dimgap);
+    if (version==VER_R12) {
+        dw.dxfInt(170, 0);
+    }
+    dw.dxfInt(171, 3);
+    dw.dxfInt(172, 1);
+    if (version==VER_R12) {
+        dw.dxfInt(173, 0);
+        dw.dxfInt(174, 0);
+        dw.dxfInt(175, 0);
+        dw.dxfInt(176, 0);
+        dw.dxfInt(177, 0);
+        dw.dxfInt(178, 0);
+    }
+    if (version==VER_2000) {
+        dw.dxfInt(271, 2);
+        dw.dxfInt(272, 2);
+        dw.dxfInt(274, 3);
+        dw.dxfInt(278, 44);
+        dw.dxfInt(283, 0);
+        dw.dxfInt(284, 8);
+        //dw.dxfHex(340, styleHandleStd);
+        dw.dxfHex(340, 0x11);
+    }
+    // * /
+    dw.dxfString(  0, "ENDTAB");
+}
+
+
+
+/**
+ * Writes a blockrecord section. This section is needed in VER_R13.
+ * Note that this method currently only writes a faked BLOCKRECORD section
+ * to make the file readable by Aut*cad.
+ */
+void DL_Dxf::writeBlockRecord(DL_WriterA& dw) {
+    dw.dxfString(  0, "TABLE");
+    dw.dxfString(  2, "BLOCK_RECORD");
+    if (version==VER_2000) {
+    	dw.dxfHex(5, 1);
+	}
+    //dw.dxfHex(330, 0);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTable");
+    }
+    dw.dxfInt( 70, 1);
+
+    dw.dxfString(  0, "BLOCK_RECORD");
+    if (version==VER_2000) {
+    	dw.dxfHex(5, 0x1F);
+	}
+    //int msh = dw.handle();
+    //dw.setModelSpaceHandle(msh);
+    //dw.dxfHex(330, 1);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTableRecord");
+        dw.dxfString(100, "AcDbBlockTableRecord");
+    }
+    dw.dxfString(  2, "*Model_Space");
+    dw.dxfHex(340, 0x22);
+
+    dw.dxfString(  0, "BLOCK_RECORD");
+    if (version==VER_2000) {
+    	dw.dxfHex(5, 0x1B);
+	}
+    //int psh = dw.handle();
+    //dw.setPaperSpaceHandle(psh);
+    //dw.dxfHex(330, 1);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTableRecord");
+        dw.dxfString(100, "AcDbBlockTableRecord");
+    }
+    dw.dxfString(  2, "*Paper_Space");
+    dw.dxfHex(340, 0x1E);
+
+    dw.dxfString(  0, "BLOCK_RECORD");
+    if (version==VER_2000) {
+    	dw.dxfHex(5, 0x23);
+	}
+    //int ps0h = dw.handle();
+    //dw.setPaperSpace0Handle(ps0h);
+    //dw.dxfHex(330, 1);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTableRecord");
+        dw.dxfString(100, "AcDbBlockTableRecord");
+    }
+    dw.dxfString(  2, "*Paper_Space0");
+    dw.dxfHex(340, 0x26);
+
+    //dw.dxfString(  0, "ENDTAB");
+}
+
+
+
+/**
+ * Writes a single block record with the given name.
+ */
+void DL_Dxf::writeBlockRecord(DL_WriterA& dw, const string& name) {
+    dw.dxfString(  0, "BLOCK_RECORD");
+    if (version==VER_2000) {
+    	dw.handle();
+	}
+    //dw->dxfHex(330, 1);
+    if (version==VER_2000) {
+        dw.dxfString(100, "AcDbSymbolTableRecord");
+        dw.dxfString(100, "AcDbBlockTableRecord");
+    }
+    dw.dxfString(  2, name);
+    dw.dxfHex(340, 0);
+}
+
+
+
+/**
+ * Writes a objects section. This section is needed in VER_R13.
+ * Note that this method currently only writes a faked OBJECTS section
+ * to make the file readable by Aut*cad.
+ */
+void DL_Dxf::writeObjects(DL_WriterA& dw) {
+    //int dicId, dicId2, dicId3, dicId4, dicId5;
+    //int dicId5;
+
+    dw.dxfString(  0, "SECTION");
+    dw.dxfString(  2, "OBJECTS");
+    dw.dxfString(  0, "DICTIONARY");
+    dw.dxfHex(5, 0xC);                            // C
+    //dw.dxfHex(330, 0);
+    dw.dxfString(100, "AcDbDictionary");
+    dw.dxfInt(280, 0);
+    dw.dxfInt(281, 1);
+    dw.dxfString(  3, "ACAD_GROUP");
+    //dw.dxfHex(350, dw.getNextHandle());          // D
+    dw.dxfHex(350, 0xD);          // D
+    dw.dxfString(  3, "ACAD_LAYOUT");
+    dw.dxfHex(350, 0x1A);
+    //dw.dxfHex(350, dw.getNextHandle()+0);        // 1A
+    dw.dxfString(  3, "ACAD_MLINESTYLE");
+    dw.dxfHex(350, 0x17);
+    //dw.dxfHex(350, dw.getNextHandle()+1);        // 17
+    dw.dxfString(  3, "ACAD_PLOTSETTINGS");
+    dw.dxfHex(350, 0x19);
+    //dw.dxfHex(350, dw.getNextHandle()+2);        // 19
+    dw.dxfString(  3, "ACAD_PLOTSTYLENAME");
+    dw.dxfHex(350, 0xE);
+    //dw.dxfHex(350, dw.getNextHandle()+3);        // E
+    dw.dxfString(  3, "AcDbVariableDictionary");
+    dw.dxfHex(350, dw.getNextHandle());        // 2C
+    dw.dxfString(  0, "DICTIONARY");
+    dw.dxfHex(5, 0xD);
+    //dw.handle();                                    // D
+    //dw.dxfHex(330, 0xC);
+    dw.dxfString(100, "AcDbDictionary");
+    dw.dxfInt(280, 0);
+    dw.dxfInt(281, 1);
+    dw.dxfString(  0, "ACDBDICTIONARYWDFLT");
+    dw.dxfHex(5, 0xE);
+    //dicId4 = dw.handle();                           // E
+    //dw.dxfHex(330, 0xC);                       // C
+    dw.dxfString(100, "AcDbDictionary");
+    dw.dxfInt(281, 1);
+    dw.dxfString(  3, "Normal");
+    dw.dxfHex(350, 0xF);
+    //dw.dxfHex(350, dw.getNextHandle()+5);        // F
+    dw.dxfString(100, "AcDbDictionaryWithDefault");
+    dw.dxfHex(340, 0xF);
+    //dw.dxfHex(340, dw.getNextHandle()+5);        // F
+    dw.dxfString(  0, "ACDBPLACEHOLDER");
+    dw.dxfHex(5, 0xF);
+    //dw.handle();                                    // F
+    //dw.dxfHex(330, dicId4);                      // E
+    dw.dxfString(  0, "DICTIONARY");
+    //dicId3 = dw.handle();                           // 17
+    dw.dxfHex(5, 0x17);
+    //dw.dxfHex(330, 0xC);                       // C
+    dw.dxfString(100, "AcDbDictionary");
+    dw.dxfInt(280, 0);
+    dw.dxfInt(281, 1);
+    dw.dxfString(  3, "Standard");
+    dw.dxfHex(350, 0x18);
+    //dw.dxfHex(350, dw.getNextHandle()+5);        // 18
+    dw.dxfString(  0, "MLINESTYLE");
+    dw.dxfHex(5, 0x18);
+    //dw.handle();                                    // 18
+    //dw.dxfHex(330, dicId3);                      // 17
+    dw.dxfString(100, "AcDbMlineStyle");
+    dw.dxfString(  2, "STANDARD");
+    dw.dxfInt( 70, 0);
+    dw.dxfString(  3, "");
+    dw.dxfInt( 62, 256);
+    dw.dxfReal( 51, 90.0);
+    dw.dxfReal( 52, 90.0);
+    dw.dxfInt( 71, 2);
+    dw.dxfReal( 49, 0.5);
+    dw.dxfInt( 62, 256);
+    dw.dxfString(  6, "BYLAYER");
+    dw.dxfReal( 49, -0.5);
+    dw.dxfInt( 62, 256);
+    dw.dxfString(  6, "BYLAYER");
+    dw.dxfString(  0, "DICTIONARY");
+    dw.dxfHex(5, 0x19);
+    //dw.handle();                           // 17
+    //dw.dxfHex(330, 0xC);                       // C
+    dw.dxfString(100, "AcDbDictionary");
+    dw.dxfInt(280, 0);
+    dw.dxfInt(281, 1);
+    dw.dxfString(  0, "DICTIONARY");
+    //dicId2 = dw.handle();                           // 1A
+    dw.dxfHex(5, 0x1A);
+    //dw.dxfHex(330, 0xC);
+    dw.dxfString(100, "AcDbDictionary");
+    dw.dxfInt(281, 1);
+    dw.dxfString(  3, "Layout1");
+    dw.dxfHex(350, 0x1E);
+    //dw.dxfHex(350, dw.getNextHandle()+2);        // 1E
+    dw.dxfString(  3, "Layout2");
+    dw.dxfHex(350, 0x26);
+    //dw.dxfHex(350, dw.getNextHandle()+4);        // 26
+    dw.dxfString(  3, "Model");
+    dw.dxfHex(350, 0x22);
+    //dw.dxfHex(350, dw.getNextHandle()+5);        // 22
+
+    dw.dxfString(  0, "LAYOUT");
+    dw.dxfHex(5, 0x1E);
+    //dw.handle();                                    // 1E
+    //dw.dxfHex(330, dicId2);                      // 1A
+    dw.dxfString(100, "AcDbPlotSettings");
+    dw.dxfString(  1, "");
+    dw.dxfString(  2, "C:\\Program Files\\AutoCAD 2002\\plotters\\DWF ePlot (optimized for plotting).pc3");
+    dw.dxfString(  4, "");
+    dw.dxfString(  6, "");
+    dw.dxfReal( 40, 0.0);
+    dw.dxfReal( 41, 0.0);
+    dw.dxfReal( 42, 0.0);
+    dw.dxfReal( 43, 0.0);
+    dw.dxfReal( 44, 0.0);
+    dw.dxfReal( 45, 0.0);
+    dw.dxfReal( 46, 0.0);
+    dw.dxfReal( 47, 0.0);
+    dw.dxfReal( 48, 0.0);
+    dw.dxfReal( 49, 0.0);
+    dw.dxfReal(140, 0.0);
+    dw.dxfReal(141, 0.0);
+    dw.dxfReal(142, 1.0);
+    dw.dxfReal(143, 1.0);
+    dw.dxfInt( 70, 688);
+    dw.dxfInt( 72, 0);
+    dw.dxfInt( 73, 0);
+    dw.dxfInt( 74, 5);
+    dw.dxfString(  7, "");
+    dw.dxfInt( 75, 16);
+    dw.dxfReal(147, 1.0);
+    dw.dxfReal(148, 0.0);
+    dw.dxfReal(149, 0.0);
+    dw.dxfString(100, "AcDbLayout");
+    dw.dxfString(  1, "Layout1");
+    dw.dxfInt( 70, 1);
+    dw.dxfInt( 71, 1);
+    dw.dxfReal( 10, 0.0);
+    dw.dxfReal( 20, 0.0);
+    dw.dxfReal( 11, 420.0);
+    dw.dxfReal( 21, 297.0);
+    dw.dxfReal( 12, 0.0);
+    dw.dxfReal( 22, 0.0);
+    dw.dxfReal( 32, 0.0);
+    dw.dxfReal( 14, 1.000000000000000E+20);
+    dw.dxfReal( 24, 1.000000000000000E+20);
+    dw.dxfReal( 34, 1.000000000000000E+20);
+    dw.dxfReal( 15, -1.000000000000000E+20);
+    dw.dxfReal( 25, -1.000000000000000E+20);
+    dw.dxfReal( 35, -1.000000000000000E+20);
+    dw.dxfReal(146, 0.0);
+    dw.dxfReal( 13, 0.0);
+    dw.dxfReal( 23, 0.0);
+    dw.dxfReal( 33, 0.0);
+    dw.dxfReal( 16, 1.0);
+    dw.dxfReal( 26, 0.0);
+    dw.dxfReal( 36, 0.0);
+    dw.dxfReal( 17, 0.0);
+    dw.dxfReal( 27, 1.0);
+    dw.dxfReal( 37, 0.0);
+    dw.dxfInt( 76, 0);
+    //dw.dxfHex(330, dw.getPaperSpaceHandle());    // 1B
+    dw.dxfHex(330, 0x1B);
+    dw.dxfString(  0, "LAYOUT");
+    dw.dxfHex(5, 0x22);
+    //dw.handle();                                    // 22
+    //dw.dxfHex(330, dicId2);                      // 1A
+    dw.dxfString(100, "AcDbPlotSettings");
+    dw.dxfString(  1, "");
+    dw.dxfString(  2, "C:\\Program Files\\AutoCAD 2002\\plotters\\DWF ePlot (optimized for plotting).pc3");
+    dw.dxfString(  4, "");
+    dw.dxfString(  6, "");
+    dw.dxfReal( 40, 0.0);
+    dw.dxfReal( 41, 0.0);
+    dw.dxfReal( 42, 0.0);
+    dw.dxfReal( 43, 0.0);
+    dw.dxfReal( 44, 0.0);
+    dw.dxfReal( 45, 0.0);
+    dw.dxfReal( 46, 0.0);
+    dw.dxfReal( 47, 0.0);
+    dw.dxfReal( 48, 0.0);
+    dw.dxfReal( 49, 0.0);
+    dw.dxfReal(140, 0.0);
+    dw.dxfReal(141, 0.0);
+    dw.dxfReal(142, 1.0);
+    dw.dxfReal(143, 1.0);
+    dw.dxfInt( 70, 1712);
+    dw.dxfInt( 72, 0);
+    dw.dxfInt( 73, 0);
+    dw.dxfInt( 74, 0);
+    dw.dxfString(  7, "");
+    dw.dxfInt( 75, 0);
+    dw.dxfReal(147, 1.0);
+    dw.dxfReal(148, 0.0);
+    dw.dxfReal(149, 0.0);
+    dw.dxfString(100, "AcDbLayout");
+    dw.dxfString(  1, "Model");
+    dw.dxfInt( 70, 1);
+    dw.dxfInt( 71, 0);
+    dw.dxfReal( 10, 0.0);
+    dw.dxfReal( 20, 0.0);
+    dw.dxfReal( 11, 12.0);
+    dw.dxfReal( 21, 9.0);
+    dw.dxfReal( 12, 0.0);
+    dw.dxfReal( 22, 0.0);
+    dw.dxfReal( 32, 0.0);
+    dw.dxfReal( 14, 0.0);
+    dw.dxfReal( 24, 0.0);
+    dw.dxfReal( 34, 0.0);
+    dw.dxfReal( 15, 0.0);
+    dw.dxfReal( 25, 0.0);
+    dw.dxfReal( 35, 0.0);
+    dw.dxfReal(146, 0.0);
+    dw.dxfReal( 13, 0.0);
+    dw.dxfReal( 23, 0.0);
+    dw.dxfReal( 33, 0.0);
+    dw.dxfReal( 16, 1.0);
+    dw.dxfReal( 26, 0.0);
+    dw.dxfReal( 36, 0.0);
+    dw.dxfReal( 17, 0.0);
+    dw.dxfReal( 27, 1.0);
+    dw.dxfReal( 37, 0.0);
+    dw.dxfInt( 76, 0);
+    //dw.dxfHex(330, dw.getModelSpaceHandle());    // 1F
+    dw.dxfHex(330, 0x1F);
+    dw.dxfString(  0, "LAYOUT");
+    //dw.handle();                                    // 26
+    dw.dxfHex(5, 0x26);
+    //dw.dxfHex(330, dicId2);                      // 1A
+    dw.dxfString(100, "AcDbPlotSettings");
+    dw.dxfString(  1, "");
+    dw.dxfString(  2, "C:\\Program Files\\AutoCAD 2002\\plotters\\DWF ePlot (optimized for plotting).pc3");
+    dw.dxfString(  4, "");
+    dw.dxfString(  6, "");
+    dw.dxfReal( 40, 0.0);
+    dw.dxfReal( 41, 0.0);
+    dw.dxfReal( 42, 0.0);
+    dw.dxfReal( 43, 0.0);
+    dw.dxfReal( 44, 0.0);
+    dw.dxfReal( 45, 0.0);
+    dw.dxfReal( 46, 0.0);
+    dw.dxfReal( 47, 0.0);
+    dw.dxfReal( 48, 0.0);
+    dw.dxfReal( 49, 0.0);
+    dw.dxfReal(140, 0.0);
+    dw.dxfReal(141, 0.0);
+    dw.dxfReal(142, 1.0);
+    dw.dxfReal(143, 1.0);
+    dw.dxfInt( 70, 688);
+    dw.dxfInt( 72, 0);
+    dw.dxfInt( 73, 0);
+    dw.dxfInt( 74, 5);
+    dw.dxfString(  7, "");
+    dw.dxfInt( 75, 16);
+    dw.dxfReal(147, 1.0);
+    dw.dxfReal(148, 0.0);
+    dw.dxfReal(149, 0.0);
+    dw.dxfString(100, "AcDbLayout");
+    dw.dxfString(  1, "Layout2");
+    dw.dxfInt( 70, 1);
+    dw.dxfInt( 71, 2);
+    dw.dxfReal( 10, 0.0);
+    dw.dxfReal( 20, 0.0);
+    dw.dxfReal( 11, 12.0);
+    dw.dxfReal( 21, 9.0);
+    dw.dxfReal( 12, 0.0);
+    dw.dxfReal( 22, 0.0);
+    dw.dxfReal( 32, 0.0);
+    dw.dxfReal( 14, 0.0);
+    dw.dxfReal( 24, 0.0);
+    dw.dxfReal( 34, 0.0);
+    dw.dxfReal( 15, 0.0);
+    dw.dxfReal( 25, 0.0);
+    dw.dxfReal( 35, 0.0);
+    dw.dxfReal(146, 0.0);
+    dw.dxfReal( 13, 0.0);
+    dw.dxfReal( 23, 0.0);
+    dw.dxfReal( 33, 0.0);
+    dw.dxfReal( 16, 1.0);
+    dw.dxfReal( 26, 0.0);
+    dw.dxfReal( 36, 0.0);
+    dw.dxfReal( 17, 0.0);
+    dw.dxfReal( 27, 1.0);
+    dw.dxfReal( 37, 0.0);
+    dw.dxfInt( 76, 0);
+    //dw.dxfHex(330, dw.getPaperSpace0Handle());   // 23
+    dw.dxfHex(330, 0x23);
+    dw.dxfString(  0, "DICTIONARY");
+    //dw.dxfHex(5, 0x2C);
+    //dicId5 =
+    dw.handle();                           // 2C
+    //dw.dxfHex(330, 0xC);                       // C
+    dw.dxfString(100, "AcDbDictionary");
+    dw.dxfInt(281, 1);
+    dw.dxfString(  3, "DIMASSOC");
+    //dw.dxfHex(350, 0x2F);
+    dw.dxfHex(350, dw.getNextHandle()+1);        // 2E
+    dw.dxfString(  3, "HIDETEXT");
+    //dw.dxfHex(350, 0x2E);
+    dw.dxfHex(350, dw.getNextHandle());        // 2D
+    dw.dxfString(  0, "DICTIONARYVAR");
+    //dw.dxfHex(5, 0x2E);
+    dw.handle();                                    // 2E
+    //dw.dxfHex(330, dicId5);                      // 2C
+    dw.dxfString(100, "DictionaryVariables");
+    dw.dxfInt(280, 0);
+    dw.dxfInt(  1, 2);
+    dw.dxfString(  0, "DICTIONARYVAR");
+    //dw.dxfHex(5, 0x2D);
+    dw.handle();                                    // 2D
+    //dw.dxfHex(330, dicId5);                      // 2C
+    dw.dxfString(100, "DictionaryVariables");
+    dw.dxfInt(280, 0);
+    dw.dxfInt(  1, 1);
+}
+
+
+/**
+ * Writes the end of the objects section. This section is needed in VER_R13.
+ * Note that this method currently only writes a faked OBJECTS section
+ * to make the file readable by Aut*cad.
+ */
+void DL_Dxf::writeObjectsEnd(DL_WriterA& dw) {
+    dw.dxfString(  0, "ENDSEC");
+}
+
+    
+
+/**
+ * Writes a comment to the DXF file.
+ */
+void DL_Dxf::writeComment(DL_WriterA& dw, const string& comment) {
+    dw.dxfString(999, comment);
+}
+
+
+/**
+ * Checks if the given variable is known by the given DXF version.
+ */
+bool DL_Dxf::checkVariable(const char* var, DL_Codes::version version) {
+    if (version>=VER_2000) {
+        return true;
+    } else if (version==VER_R12) {
+        // these are all the variables recognized by dxf r12:
+        if (!strcmp(var, "$ACADVER")) {
+            return true;
+        }
+        if (!strcmp(var, "$ACADVER")) {
+            return true;
+        }
+        if (!strcmp(var, "$ANGBASE")) {
+            return true;
+        }
+        if (!strcmp(var, "$ANGDIR")) {
+            return true;
+        }
+        if (!strcmp(var, "$ATTDIA")) {
+            return true;
+        }
+        if (!strcmp(var, "$ATTMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$ATTREQ")) {
+            return true;
+        }
+        if (!strcmp(var, "$AUNITS")) {
+            return true;
+        }
+        if (!strcmp(var, "$AUPREC")) {
+            return true;
+        }
+        if (!strcmp(var, "$AXISMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$AXISUNIT")) {
+            return true;
+        }
+        if (!strcmp(var, "$BLIPMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$CECOLOR")) {
+            return true;
+        }
+        if (!strcmp(var, "$CELTYPE")) {
+            return true;
+        }
+        if (!strcmp(var, "$CHAMFERA")) {
+            return true;
+        }
+        if (!strcmp(var, "$CHAMFERB")) {
+            return true;
+        }
+        if (!strcmp(var, "$CLAYER")) {
+            return true;
+        }
+        if (!strcmp(var, "$COORDS")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMALT")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMALTD")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMALTF")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMAPOST")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMASO")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMASZ")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMBLK")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMBLK1")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMBLK2")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMCEN")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMCLRD")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMCLRE")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMCLRT")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMDLE")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMDLI")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMEXE")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMEXO")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMGAP")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMLFAC")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMLIM")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMPOST")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMRND")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMSAH")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMSCALE")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMSE1")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMSE2")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMSHO")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMSOXD")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMSTYLE")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTAD")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTFAC")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTIH")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTIX")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTM")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTOFL")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTOH")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTOL")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTP")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTSZ")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTVP")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMTXT")) {
+            return true;
+        }
+        if (!strcmp(var, "$DIMZIN")) {
+            return true;
+        }
+        if (!strcmp(var, "$DWGCODEPAGE")) {
+            return true;
+        }
+        if (!strcmp(var, "$DRAGMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$ELEVATION")) {
+            return true;
+        }
+        if (!strcmp(var, "$EXTMAX")) {
+            return true;
+        }
+        if (!strcmp(var, "$EXTMIN")) {
+            return true;
+        }
+        if (!strcmp(var, "$FILLETRAD")) {
+            return true;
+        }
+        if (!strcmp(var, "$FILLMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$HANDLING")) {
+            return true;
+        }
+        if (!strcmp(var, "$HANDSEED")) {
+            return true;
+        }
+        if (!strcmp(var, "$INSBASE")) {
+            return true;
+        }
+        if (!strcmp(var, "$LIMCHECK")) {
+            return true;
+        }
+        if (!strcmp(var, "$LIMMAX")) {
+            return true;
+        }
+        if (!strcmp(var, "$LIMMIN")) {
+            return true;
+        }
+        if (!strcmp(var, "$LTSCALE")) {
+            return true;
+        }
+        if (!strcmp(var, "$LUNITS")) {
+            return true;
+        }
+        if (!strcmp(var, "$LUPREC")) {
+            return true;
+        }
+        if (!strcmp(var, "$MAXACTVP")) {
+            return true;
+        }
+        if (!strcmp(var, "$MENU")) {
+            return true;
+        }
+        if (!strcmp(var, "$MIRRTEXT")) {
+            return true;
+        }
+        if (!strcmp(var, "$ORTHOMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$OSMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$PDMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$PDSIZE")) {
+            return true;
+        }
+        if (!strcmp(var, "$PELEVATION")) {
+            return true;
+        }
+        if (!strcmp(var, "$PEXTMAX")) {
+            return true;
+        }
+        if (!strcmp(var, "$PEXTMIN")) {
+            return true;
+        }
+        if (!strcmp(var, "$PLIMCHECK")) {
+            return true;
+        }
+        if (!strcmp(var, "$PLIMMAX")) {
+            return true;
+        }
+        if (!strcmp(var, "$PLIMMIN")) {
+            return true;
+        }
+        if (!strcmp(var, "$PLINEGEN")) {
+            return true;
+        }
+        if (!strcmp(var, "$PLINEWID")) {
+            return true;
+        }
+        if (!strcmp(var, "$PSLTSCALE")) {
+            return true;
+        }
+        if (!strcmp(var, "$PUCSNAME")) {
+            return true;
+        }
+        if (!strcmp(var, "$PUCSORG")) {
+            return true;
+        }
+        if (!strcmp(var, "$PUCSXDIR")) {
+            return true;
+        }
+        if (!strcmp(var, "$PUCSYDIR")) {
+            return true;
+        }
+        if (!strcmp(var, "$QTEXTMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$REGENMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$SHADEDGE")) {
+            return true;
+        }
+        if (!strcmp(var, "$SHADEDIF")) {
+            return true;
+        }
+        if (!strcmp(var, "$SKETCHINC")) {
+            return true;
+        }
+        if (!strcmp(var, "$SKPOLY")) {
+            return true;
+        }
+        if (!strcmp(var, "$SPLFRAME")) {
+            return true;
+        }
+        if (!strcmp(var, "$SPLINESEGS")) {
+            return true;
+        }
+        if (!strcmp(var, "$SPLINETYPE")) {
+            return true;
+        }
+        if (!strcmp(var, "$SURFTAB1")) {
+            return true;
+        }
+        if (!strcmp(var, "$SURFTAB2")) {
+            return true;
+        }
+        if (!strcmp(var, "$SURFTYPE")) {
+            return true;
+        }
+        if (!strcmp(var, "$SURFU")) {
+            return true;
+        }
+        if (!strcmp(var, "$SURFV")) {
+            return true;
+        }
+        if (!strcmp(var, "$TDCREATE")) {
+            return true;
+        }
+        if (!strcmp(var, "$TDINDWG")) {
+            return true;
+        }
+        if (!strcmp(var, "$TDUPDATE")) {
+            return true;
+        }
+        if (!strcmp(var, "$TDUSRTIMER")) {
+            return true;
+        }
+        if (!strcmp(var, "$TEXTSIZE")) {
+            return true;
+        }
+        if (!strcmp(var, "$TEXTSTYLE")) {
+            return true;
+        }
+        if (!strcmp(var, "$THICKNESS")) {
+            return true;
+        }
+        if (!strcmp(var, "$TILEMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$TRACEWID")) {
+            return true;
+        }
+        if (!strcmp(var, "$UCSNAME")) {
+            return true;
+        }
+        if (!strcmp(var, "$UCSORG")) {
+            return true;
+        }
+        if (!strcmp(var, "$UCSXDIR")) {
+            return true;
+        }
+        if (!strcmp(var, "$UCSYDIR")) {
+            return true;
+        }
+        if (!strcmp(var, "$UNITMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$USERI1")) {
+            return true;
+        }
+        if (!strcmp(var, "$USERR1")) {
+            return true;
+        }
+        if (!strcmp(var, "$USRTIMER")) {
+            return true;
+        }
+        if (!strcmp(var, "$VISRETAIN")) {
+            return true;
+        }
+        if (!strcmp(var, "$WORLDVIEW")) {
+            return true;
+        }
+        if (!strcmp(var, "$FASTZOOM")) {
+            return true;
+        }
+        if (!strcmp(var, "$GRIDMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$GRIDUNIT")) {
+            return true;
+        }
+        if (!strcmp(var, "$SNAPANG")) {
+            return true;
+        }
+        if (!strcmp(var, "$SNAPBASE")) {
+            return true;
+        }
+        if (!strcmp(var, "$SNAPISOPAIR")) {
+            return true;
+        }
+        if (!strcmp(var, "$SNAPMODE")) {
+            return true;
+        }
+        if (!strcmp(var, "$SNAPSTYLE")) {
+            return true;
+        }
+        if (!strcmp(var, "$SNAPUNIT")) {
+            return true;
+        }
+        if (!strcmp(var, "$VIEWCTR")) {
+            return true;
+        }
+        if (!strcmp(var, "$VIEWDIR")) {
+            return true;
+        }
+        if (!strcmp(var, "$VIEWSIZE")) {
+            return true;
+        }
+        return false;
+    }
+
+    return false;
+}
+
+
+
+/**
+ * @returns the library version as int (4 bytes, each byte one version number).
+ * e.g. if str = "2.0.2.0" getLibVersion returns 0x02000200
+ */
+int DL_Dxf::getLibVersion(const char* str) {
+    int d[4];
+    int idx = 0;
+    char v[4][5];
+    int ret = 0;
+
+    for (unsigned int i=0; i<strlen(str) && idx<3; ++i) {
+        if (str[i]=='.') {
+            d[idx] = i;
+            idx++;
+        }
+    }
+
+    if (idx==3) {
+        d[3] = strlen(str);
+
+        strncpy(v[0], str, d[0]);
+        v[0][d[0]] = '\0';
+
+        strncpy(v[1], &str[d[0]+1], d[1]-d[0]-1);
+        v[1][d[1]-d[0]-1] = '\0';
+
+        strncpy(v[2], &str[d[1]+1], d[2]-d[1]-1);
+        v[2][d[2]-d[1]-1] = '\0';
+
+        strncpy(v[3], &str[d[2]+1], d[3]-d[2]-1);
+        v[3][d[3]-d[2]-1] = '\0';
+
+        ret = (atoi(v[0])<<(3*8)) +
+              (atoi(v[1])<<(2*8)) +
+              (atoi(v[2])<<(1*8)) +
+              (atoi(v[3])<<(0*8));
+
+        return ret;
+    } else {
+        std::cerr << "DL_Dxf::getLibVersion: invalid version number: " << str << "\n";
+        return 0;
+    }
+}
+
+
+
+/**
+ * Some test routines.
+ */
+void DL_Dxf::test() {
+    char* buf1;
+    char* buf2;
+    char* buf3;
+    char* buf4;
+    char* buf5;
+    char* buf6;
+
+    buf1 = new char[10];
+    buf2 = new char[10];
+    buf3 = new char[10];
+    buf4 = new char[10];
+    buf5 = new char[10];
+    buf6 = new char[10];
+
+    strcpy(buf1, "  10\n");
+    strcpy(buf2, "10");
+    strcpy(buf3, "10\n");
+    strcpy(buf4, "  10 \n");
+    strcpy(buf5, "  10 \r");
+    strcpy(buf6, "\t10 \n");
+
+    std::cout << "1 buf1: '" << buf1 << "'\n";
+    stripWhiteSpace(&buf1);
+    std::cout << "2 buf1: '" << buf1 << "'\n";
+    //assert(!strcmp(buf1, "10"));
+
+    std::cout << "1 buf2: '" << buf2 << "'\n";
+    stripWhiteSpace(&buf2);
+    std::cout << "2 buf2: '" << buf2 << "'\n";
+
+    std::cout << "1 buf3: '" << buf3 << "'\n";
+    stripWhiteSpace(&buf3);
+    std::cout << "2 buf3: '" << buf3 << "'\n";
+
+    std::cout << "1 buf4: '" << buf4 << "'\n";
+    stripWhiteSpace(&buf4);
+    std::cout << "2 buf4: '" << buf4 << "'\n";
+
+    std::cout << "1 buf5: '" << buf5 << "'\n";
+    stripWhiteSpace(&buf5);
+    std::cout << "2 buf5: '" << buf5 << "'\n";
+
+    std::cout << "1 buf6: '" << buf6 << "'\n";
+    stripWhiteSpace(&buf6);
+    std::cout << "2 buf6: '" << buf6 << "'\n";
+
+}
+
+
diff --git a/src/dxflib/dl_dxf.h b/src/dxflib/dl_dxf.h
new file mode 100644
index 0000000..4b952ad
--- /dev/null
+++ b/src/dxflib/dl_dxf.h
@@ -0,0 +1,430 @@
+/****************************************************************************
+** $Id: dl_dxf.h 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DL_DXF_H
+#define DL_DXF_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifndef __GCC2x__
+#include <sstream>
+#endif
+
+#include "dl_attributes.h"
+#include "dl_codes.h"
+#include "dl_entities.h"
+#include "dl_writer_ascii.h"
+
+#ifdef _WIN32
+#undef M_PI
+#define M_PI   3.14159265358979323846
+#pragma warning(disable : 4800)
+#endif
+
+#ifndef M_PI
+#define M_PI 3.1415926535897932384626433832795
+#endif
+
+class DL_CreationInterface;
+class DL_WriterA;
+
+
+#define DL_VERSION     "2.2.0.0"
+
+#define DL_UNKNOWN               0
+#define DL_LAYER                10
+#define DL_BLOCK                11
+#define DL_ENDBLK               12
+#define DL_LINETYPE             13
+#define DL_SETTING              50
+#define DL_ENTITY_POINT        100
+#define DL_ENTITY_LINE         101
+#define DL_ENTITY_POLYLINE     102
+#define DL_ENTITY_LWPOLYLINE   103
+#define DL_ENTITY_VERTEX       104
+#define DL_ENTITY_SPLINE       105
+#define DL_ENTITY_KNOT         106
+#define DL_ENTITY_CONTROLPOINT 107
+#define DL_ENTITY_ARC          108
+#define DL_ENTITY_CIRCLE       109
+#define DL_ENTITY_ELLIPSE      110
+#define DL_ENTITY_INSERT       111
+#define DL_ENTITY_TEXT         112
+#define DL_ENTITY_MTEXT        113
+#define DL_ENTITY_DIMENSION    114
+#define DL_ENTITY_LEADER       115
+#define DL_ENTITY_HATCH        116
+#define DL_ENTITY_ATTRIB       117
+#define DL_ENTITY_IMAGE        118
+#define DL_ENTITY_IMAGEDEF     119
+#define DL_ENTITY_TRACE        120
+#define DL_ENTITY_SOLID        121
+#define DL_ENTITY_3DFACE       122
+#define DL_ENTITY_SEQEND       123
+
+
+/**
+ * Reading and writing of DXF files.
+ *
+ * This class can read in a DXF file and calls methods from the 
+ * interface DL_EntityContainer to add the entities to the
+ * contianer provided by the user of the library.
+ *
+ * It can also be used to write DXF files to a certain extent.
+ *
+ * When saving entities, special values for colors and linetypes 
+ * can be used:
+ *
+ * Special colors are 0 (=BYBLOCK) and 256 (=BYLAYER).
+ * Special linetypes are "BYLAYER" and "BYBLOCK".
+ *
+ * @author Andrew Mustun
+ */
+class DL_Dxf {
+public:
+    DL_Dxf();
+    ~DL_Dxf();
+
+    bool in(const string& file,
+            DL_CreationInterface* creationInterface);
+    bool readDxfGroups(FILE* fp,
+                       DL_CreationInterface* creationInterface,
+					   int* errorCounter = NULL);
+    static bool getChoppedLine(char* s, unsigned int size,
+                               FILE *stream);
+    
+#ifndef __GCC2x__
+    bool readDxfGroups(std::stringstream &stream,
+                       DL_CreationInterface* creationInterface,
+					   int* errorCounter = NULL);
+    bool in(std::stringstream &stream,
+            DL_CreationInterface* creationInterface);
+    static bool getChoppedLine(char *s, unsigned int size,
+                               std::stringstream &stream);
+#endif
+
+    static bool stripWhiteSpace(char** s);
+
+    bool processDXFGroup(DL_CreationInterface* creationInterface,
+                         int groupCode, const char* groupValue);
+    void addSetting(DL_CreationInterface* creationInterface);
+    void addLayer(DL_CreationInterface* creationInterface);
+    void addBlock(DL_CreationInterface* creationInterface);
+    void endBlock(DL_CreationInterface* creationInterface);
+
+    void addPoint(DL_CreationInterface* creationInterface);
+    void addLine(DL_CreationInterface* creationInterface);
+	
+    void addPolyline(DL_CreationInterface* creationInterface);
+    void addVertex(DL_CreationInterface* creationInterface);
+	
+    void addSpline(DL_CreationInterface* creationInterface);
+    //void addKnot(DL_CreationInterface* creationInterface);
+    //void addControlPoint(DL_CreationInterface* creationInterface);
+	
+    void addArc(DL_CreationInterface* creationInterface);
+    void addCircle(DL_CreationInterface* creationInterface);
+    void addEllipse(DL_CreationInterface* creationInterface);
+    void addInsert(DL_CreationInterface* creationInterface);
+    
+    void addTrace(DL_CreationInterface* creationInterface);
+    void add3dFace(DL_CreationInterface* creationInterface);
+    void addSolid(DL_CreationInterface* creationInterface);
+
+    void addMText(DL_CreationInterface* creationInterface);
+	bool handleMTextData(DL_CreationInterface* creationInterface);
+	bool handleLWPolylineData(DL_CreationInterface* creationInterface);
+	bool handleSplineData(DL_CreationInterface* creationInterface);
+	bool handleLeaderData(DL_CreationInterface* creationInterface);
+	bool handleHatchData(DL_CreationInterface* creationInterface);
+	
+    void addText(DL_CreationInterface* creationInterface);
+    void addAttrib(DL_CreationInterface* creationInterface);
+    DL_DimensionData getDimData();
+    void addDimLinear(DL_CreationInterface* creationInterface);
+    void addDimAligned(DL_CreationInterface* creationInterface);
+    void addDimRadial(DL_CreationInterface* creationInterface);
+    void addDimDiametric(DL_CreationInterface* creationInterface);
+    void addDimAngular(DL_CreationInterface* creationInterface);
+    void addDimAngular3P(DL_CreationInterface* creationInterface);
+    void addDimOrdinate(DL_CreationInterface* creationInterface);
+    void addLeader(DL_CreationInterface* creationInterface);
+    void addHatch(DL_CreationInterface* creationInterface);
+    void addImage(DL_CreationInterface* creationInterface);
+    void addImageDef(DL_CreationInterface* creationInterface);
+    
+    void addComment(DL_CreationInterface* creationInterface, const char* comment);
+
+	void endEntity(DL_CreationInterface* creationInterface);
+	
+    void endSequence(DL_CreationInterface* creationInterface);
+	
+	int  stringToInt(const char* s, bool* ok=NULL);	
+
+    DL_WriterA* out(const char* file,
+                    DL_Codes::version version=VER_2000);
+
+    void writeHeader(DL_WriterA& dw);
+
+    void writePoint(DL_WriterA& dw,
+                    const DL_PointData& data,
+                    const DL_Attributes& attrib);
+    void writeLine(DL_WriterA& dw,
+                   const DL_LineData& data,
+                   const DL_Attributes& attrib);
+    void writePolyline(DL_WriterA& dw,
+                       const DL_PolylineData& data,
+                       const DL_Attributes& attrib);
+    void writeVertex(DL_WriterA& dw,
+                     const DL_VertexData& data);
+    void writePolylineEnd(DL_WriterA& dw);
+    void writeSpline(DL_WriterA& dw,
+                       const DL_SplineData& data,
+                       const DL_Attributes& attrib);
+    void writeControlPoint(DL_WriterA& dw,
+                     const DL_ControlPointData& data);
+    void writeKnot(DL_WriterA& dw,
+                     const DL_KnotData& data);
+    void writeCircle(DL_WriterA& dw,
+                     const DL_CircleData& data,
+                     const DL_Attributes& attrib);
+    void writeArc(DL_WriterA& dw,
+                  const DL_ArcData& data,
+                  const DL_Attributes& attrib);
+    void writeEllipse(DL_WriterA& dw,
+                      const DL_EllipseData& data,
+                      const DL_Attributes& attrib);
+    void writeSolid(DL_WriterA& dw,
+                   const DL_SolidData& data,
+                   const DL_Attributes& attrib);
+    void write3dFace(DL_WriterA& dw,
+                   const DL_3dFaceData& data,
+                   const DL_Attributes& attrib);
+    void writeInsert(DL_WriterA& dw,
+                     const DL_InsertData& data,
+                     const DL_Attributes& attrib);
+    void writeMText(DL_WriterA& dw,
+                    const DL_MTextData& data,
+                    const DL_Attributes& attrib);
+    void writeText(DL_WriterA& dw,
+                    const DL_TextData& data,
+                    const DL_Attributes& attrib);
+    void writeDimAligned(DL_WriterA& dw,
+                         const DL_DimensionData& data,
+                         const DL_DimAlignedData& edata,
+                         const DL_Attributes& attrib);
+    void writeDimLinear(DL_WriterA& dw,
+                        const DL_DimensionData& data,
+                        const DL_DimLinearData& edata,
+                        const DL_Attributes& attrib);
+    void writeDimRadial(DL_WriterA& dw,
+                        const DL_DimensionData& data,
+                        const DL_DimRadialData& edata,
+                        const DL_Attributes& attrib);
+    void writeDimDiametric(DL_WriterA& dw,
+                           const DL_DimensionData& data,
+                           const DL_DimDiametricData& edata,
+                           const DL_Attributes& attrib);
+    void writeDimAngular(DL_WriterA& dw,
+                         const DL_DimensionData& data,
+                         const DL_DimAngularData& edata,
+                         const DL_Attributes& attrib);
+    void writeDimAngular3P(DL_WriterA& dw,
+                           const DL_DimensionData& data,
+                           const DL_DimAngular3PData& edata,
+                           const DL_Attributes& attrib);
+    void writeDimOrdinate(DL_WriterA& dw,
+                         const DL_DimensionData& data,
+                         const DL_DimOrdinateData& edata,
+                         const DL_Attributes& attrib);
+    void writeLeader(DL_WriterA& dw,
+                     const DL_LeaderData& data,
+                     const DL_Attributes& attrib);
+    void writeLeaderVertex(DL_WriterA& dw,
+                           const DL_LeaderVertexData& data);
+    void writeHatch1(DL_WriterA& dw,
+                     const DL_HatchData& data,
+                     const DL_Attributes& attrib);
+    void writeHatch2(DL_WriterA& dw,
+                     const DL_HatchData& data,
+                     const DL_Attributes& attrib);
+    void writeHatchLoop1(DL_WriterA& dw,
+                         const DL_HatchLoopData& data);
+    void writeHatchLoop2(DL_WriterA& dw,
+                         const DL_HatchLoopData& data);
+    void writeHatchEdge(DL_WriterA& dw,
+                        const DL_HatchEdgeData& data);
+
+    int writeImage(DL_WriterA& dw,
+                   const DL_ImageData& data,
+                   const DL_Attributes& attrib);
+
+    void writeImageDef(DL_WriterA& dw, int handle,
+                       const DL_ImageData& data);
+
+    void writeLayer(DL_WriterA& dw,
+                    const DL_LayerData& data,
+                    const DL_Attributes& attrib);
+
+    void writeLineType(DL_WriterA& dw,
+                       const DL_LineTypeData& data);
+
+    void writeAppid(DL_WriterA& dw, const string& name);
+
+    void writeBlock(DL_WriterA& dw,
+                    const DL_BlockData& data);
+    void writeEndBlock(DL_WriterA& dw, const string& name);
+
+    void writeVPort(DL_WriterA& dw);
+    void writeStyle(DL_WriterA& dw);
+    void writeView(DL_WriterA& dw);
+    void writeUcs(DL_WriterA& dw);
+    void writeDimStyle(DL_WriterA& dw, 
+	                   double dimasz, double dimexe, double dimexo,
+					   double dimgap, double dimtxt);
+    void writeBlockRecord(DL_WriterA& dw);
+    void writeBlockRecord(DL_WriterA& dw, const string& name);
+    void writeObjects(DL_WriterA& dw);
+    void writeObjectsEnd(DL_WriterA& dw);
+    
+    void writeComment(DL_WriterA& dw, const string& comment);
+
+    /**
+     * Converts the given string into a double or returns the given 
+     * default valud (def) if value is NULL or empty.
+     */
+    static double toReal(const char* value, double def=0.0) {
+       if (value!=NULL && value[0] != '\0') {
+            double ret;
+            if (strchr(value, ',') != NULL) {
+               char* tmp = new char[strlen(value)+1];
+               strcpy(tmp, value);
+               DL_WriterA::strReplace(tmp, ',', '.');
+               ret = atof(tmp);
+      		   delete[] tmp;
+            }
+            else {
+               ret = atof(value);
+            }
+			return ret;
+        } else {
+            return def;
+        }
+    }
+    /**
+     * Converts the given string into an int or returns the given 
+     * default valud (def) if value is NULL or empty.
+     */
+    static int toInt(const char* value, int def=0) {
+        if (value!=NULL && value[0] != '\0') {
+            return atoi(value);
+        } else {
+            return def;
+        }
+    }
+    /**
+     * Converts the given string into a string or returns the given 
+     * default valud (def) if value is NULL or empty.
+     */
+    static const char* toString(const char* value, const char* def="") {
+        if (value!=NULL && value[0] != '\0') {
+            return value;
+        } else {
+            return def;
+        }
+    }
+
+	static bool checkVariable(const char* var, DL_Codes::version version);
+
+	DL_Codes::version getVersion() {
+		return version;
+	}
+
+	int getLibVersion(const char* str);
+
+	static void test();
+
+private:
+    DL_Codes::version version;
+    unsigned long styleHandleStd;
+
+	string polylineLayer;
+    double* vertices;
+    int maxVertices;
+    int vertexIndex;
+	
+    double* knots;
+    int maxKnots;
+    int knotIndex;
+	
+    double* controlPoints;
+    int maxControlPoints;
+    int controlPointIndex;
+
+    double* leaderVertices;
+    int maxLeaderVertices;
+    int leaderVertexIndex;
+
+    // array of hatch loops
+    DL_HatchLoopData* hatchLoops;
+    int maxHatchLoops;
+    int hatchLoopIndex;
+    // array in format [loop#][edge#]
+    DL_HatchEdgeData** hatchEdges;
+    int* maxHatchEdges;
+    int* hatchEdgeIndex;
+    bool dropEdges;
+
+    // Bulge for the next vertex.
+    double bulge;
+
+    // Only the useful part of the group code
+    char groupCodeTmp[DL_DXF_MAXLINE+1];
+    // ...same as integer
+    unsigned int groupCode;
+    // Only the useful part of the group value
+    char groupValue[DL_DXF_MAXLINE+1];
+    // Current entity type
+    int currentEntity;
+    // Value of the current setting
+    char settingValue[DL_DXF_MAXLINE+1];
+    // Key of the current setting (e.g. "$ACADVER")
+    char settingKey[DL_DXF_MAXLINE+1];
+    // Stores the group codes
+    char values[DL_DXF_MAXGROUPCODE][DL_DXF_MAXLINE+1];
+    // First call of this method. We initialize all group values in
+    //  the first call.
+    bool firstCall;
+    // Attributes of the current entity (layer, color, width, line type)
+    DL_Attributes attrib;
+	// library version. hex: 0x20003001 = 2.0.3.1
+	int libVersion;
+};
+
+#endif
+
+// EOF
diff --git a/src/dxflib/dl_entities.h b/src/dxflib/dl_entities.h
new file mode 100644
index 0000000..42b68cd
--- /dev/null
+++ b/src/dxflib/dl_entities.h
@@ -0,0 +1,1451 @@
+/****************************************************************************
+** $Id: dl_entities.h 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DL_ENTITIES_H
+#define DL_ENTITIES_H
+
+
+#include <string>
+using std::string;
+
+/**
+ * Layer Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_LayerData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_LayerData(const string& lName,
+                 int lFlags) {
+        name = lName;
+        flags = lFlags;
+    }
+
+    /** Layer name. */
+    string name;
+    /** Layer flags. (1 = frozen, 2 = frozen by default, 4 = locked) */
+    int flags;
+};
+
+
+
+/**
+ * Block Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_BlockData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_BlockData(const string& bName,
+                 int bFlags,
+                 double bbpx, double bbpy, double bbpz) {
+        name = bName;
+        flags = bFlags;
+        bpx = bbpx;
+        bpy = bbpy;
+        bpz = bbpz;
+    }
+
+    /** Block name. */
+    string name;
+    /** Block flags. (not used currently) */
+    int flags;
+    /** X Coordinate of base point. */
+    double bpx;
+    /** Y Coordinate of base point. */
+    double bpy;
+    /** Z Coordinate of base point. */
+    double bpz;
+};
+
+
+
+/**
+ * Line Type Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_LineTypeData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_LineTypeData(const string& lName,
+                    int lFlags) {
+        name = lName;
+        flags = lFlags;
+    }
+
+    /** Line type name. */
+    string name;
+    /** Line type flags. */
+    int flags;
+};
+
+
+
+/**
+ * Point Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_PointData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_PointData(double px=0.0, double py=0.0, double pz=0.0) {
+        x = px;
+        y = py;
+        z = pz;
+    }
+
+    /*! X Coordinate of the point. */
+    double x;
+    /*! Y Coordinate of the point. */
+    double y;
+    /*! Z Coordinate of the point. */
+    double z;
+};
+
+
+
+/**
+ * Line Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_LineData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_LineData(double lx1, double ly1, double lz1,
+                double lx2, double ly2, double lz2) {
+        x1 = lx1;
+        y1 = ly1;
+        z1 = lz1;
+
+        x2 = lx2;
+        y2 = ly2;
+        z2 = lz2;
+    }
+
+    /*! X Start coordinate of the point. */
+    double x1;
+    /*! Y Start coordinate of the point. */
+    double y1;
+    /*! Z Start coordinate of the point. */
+    double z1;
+
+    /*! X End coordinate of the point. */
+    double x2;
+    /*! Y End coordinate of the point. */
+    double y2;
+    /*! Z End coordinate of the point. */
+    double z2;
+};
+
+
+
+/**
+ * Arc Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_ArcData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_ArcData(double acx, double acy, double acz,
+               double aRadius,
+               double aAngle1, double aAngle2) {
+
+        cx = acx;
+        cy = acy;
+        cz = acz;
+        radius = aRadius;
+        angle1 = aAngle1;
+        angle2 = aAngle2;
+    }
+
+    /*! X Coordinate of center point. */
+    double cx;
+    /*! Y Coordinate of center point. */
+    double cy;
+    /*! Z Coordinate of center point. */
+    double cz;
+
+    /*! Radius of arc. */
+    double radius;
+    /*! Startangle of arc in degrees. */
+    double angle1;
+    /*! Endangle of arc in degrees. */
+    double angle2;
+};
+
+
+
+/**
+ * Circle Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_CircleData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_CircleData(double acx, double acy, double acz,
+                  double aRadius) {
+
+        cx = acx;
+        cy = acy;
+        cz = acz;
+        radius = aRadius;
+    }
+
+    /*! X Coordinate of center point. */
+    double cx;
+    /*! Y Coordinate of center point. */
+    double cy;
+    /*! Z Coordinate of center point. */
+    double cz;
+
+    /*! Radius of arc. */
+    double radius;
+};
+
+
+
+/**
+ * Polyline Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_PolylineData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_PolylineData(int pNumber, int pMVerteces, int pNVerteces, int pFlags) {
+        number = pNumber;
+        m = pMVerteces;
+        n = pNVerteces;
+        flags = pFlags;
+    }
+
+    /*! Number of vertices in this polyline. */
+    unsigned int number;
+
+    /*! Number of vertices in m direction if polyline is a polygon mesh. */
+    unsigned int m;
+
+    /*! Number of vertices in n direction if polyline is a polygon mesh. */
+    unsigned int n;
+
+    /*! Flags */
+    int flags;
+};
+
+
+
+/**
+ * Vertex Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_VertexData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_VertexData(double px=0.0, double py=0.0, double pz=0.0,
+                  double pBulge=0.0) {
+        x = px;
+        y = py;
+        z = pz;
+        bulge = pBulge;
+    }
+
+    /*! X Coordinate of the vertex. */
+    double x;
+    /*! Y Coordinate of the vertex. */
+    double y;
+    /*! Z Coordinate of the vertex. */
+    double z;
+    /*! Bulge of vertex.
+     * (The tangent of 1/4 of the arc angle or 0 for lines) */
+    double bulge;
+};
+
+
+/**
+ * Trace Data / solid data / 3d face data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_TraceData {
+    DL_TraceData() {
+        thickness = 0.0;
+        for (int i=0; i<4; i++) {
+            x[i] = 0.0;
+            y[i] = 0.0;
+            z[i] = 0.0;
+        }
+    }
+    
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_TraceData(double sx1, double sy1, double sz1,
+                double sx2, double sy2, double sz2,
+                double sx3, double sy3, double sz3,
+                double sx4, double sy4, double sz4,
+                double sthickness=0.0) {
+
+        thickness = sthickness;
+
+        x[0] = sx1;
+        y[0] = sy1;
+        z[0] = sz1;
+
+        x[1] = sx2;
+        y[1] = sy2;
+        z[1] = sz2;
+        
+        x[2] = sx3;
+        y[2] = sy3;
+        z[2] = sz3;
+        
+        x[3] = sx4;
+        y[3] = sy4;
+        z[3] = sz4;
+    }
+
+    /*! Thickness */
+    double thickness;
+    
+    /*! Points */
+    double x[4];
+    double y[4];
+    double z[4];
+};
+
+
+
+
+
+/**
+ * Solid Data.
+ *
+ * @author AHM
+ */
+typedef DL_TraceData DL_SolidData;
+
+
+/**
+ * 3dface Data.
+ */
+typedef DL_TraceData DL_3dFaceData;
+
+
+/**
+ * Spline Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_SplineData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_SplineData(int pDegree, int pNKnots, int pNControl, int pFlags) {
+		degree = pDegree;
+		nKnots = pNKnots;
+		nControl = pNControl;
+        flags = pFlags;
+    }
+
+    /*! Degree of the spline curve. */
+    unsigned int degree;
+
+    /*! Number of knots. */
+    unsigned int nKnots;
+
+    /*! Number of control points. */
+    unsigned int nControl;
+
+    /*! Flags */
+    int flags;
+};
+
+
+
+/**
+ * Spline knot data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_KnotData {
+    DL_KnotData() {}
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_KnotData(double pk) {
+        k = pk;
+    }
+
+    /*! Knot value. */
+    double k;
+};
+
+
+
+/**
+ * Spline control point data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_ControlPointData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_ControlPointData(double px, double py, double pz) {
+        x = px;
+        y = py;
+        z = pz;
+    }
+
+    /*! X coordinate of the control point. */
+    double x;
+    /*! Y coordinate of the control point. */
+    double y;
+    /*! Z coordinate of the control point. */
+    double z;
+};
+
+
+/**
+ * Ellipse Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_EllipseData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_EllipseData(double ecx, double ecy, double ecz,
+                   double emx, double emy, double emz,
+                   double eRatio,
+                   double eAngle1, double eAngle2) {
+
+        cx = ecx;
+        cy = ecy;
+        cz = ecz;
+        mx = emx;
+        my = emy;
+        mz = emz;
+        ratio = eRatio;
+        angle1 = eAngle1;
+        angle2 = eAngle2;
+    }
+
+    /*! X Coordinate of center point. */
+    double cx;
+    /*! Y Coordinate of center point. */
+    double cy;
+    /*! Z Coordinate of center point. */
+    double cz;
+
+    /*! X coordinate of the endpoint of the major axis. */
+    double mx;
+    /*! Y coordinate of the endpoint of the major axis. */
+    double my;
+    /*! Z coordinate of the endpoint of the major axis. */
+    double mz;
+
+    /*! Ratio of minor axis to major axis.. */
+    double ratio;
+    /*! Startangle of ellipse in rad. */
+    double angle1;
+    /*! Endangle of ellipse in rad. */
+    double angle2;
+};
+
+
+
+/**
+ * Insert Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_InsertData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_InsertData(const string& iName,
+                  double iipx, double iipy, double iipz,
+                  double isx, double isy, double isz,
+                  double iAngle,
+                  int iCols, int iRows,
+                  double iColSp, double iRowSp) {
+        name = iName;
+        ipx = iipx;
+        ipy = iipy;
+        ipz = iipz;
+        sx = isx;
+        sy = isy;
+        sz = isz;
+        angle = iAngle;
+        cols = iCols;
+        rows = iRows;
+        colSp = iColSp;
+        rowSp = iRowSp;
+    }
+
+    /*! Name of the referred block. */
+    string name;
+    /*! X Coordinate of insertion point. */
+    double ipx;
+    /*! Y Coordinate of insertion point. */
+    double ipy;
+    /*! Z Coordinate of insertion point. */
+    double ipz;
+    /*! X Scale factor. */
+    double sx;
+    /*! Y Scale factor. */
+    double sy;
+    /*! Z Scale factor. */
+    double sz;
+    /*! Rotation angle in rad. */
+    double angle;
+    /*! Number of colums if we insert an array of the block or 1. */
+    int cols;
+    /*! Number of rows if we insert an array of the block or 1. */
+    int rows;
+    /*! Values for the spacing between cols. */
+    double colSp;
+    /*! Values for the spacing between rows. */
+    double rowSp;
+};
+
+
+
+/**
+ * MText Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_MTextData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_MTextData(double tipx, double tipy, double tipz,
+                 double tHeight, double tWidth,
+                 int tAttachmentPoint,
+                 int tDrawingDirection,
+                 int tLineSpacingStyle,
+                 double tLineSpacingFactor,
+                 const string& tText,
+                 const string& tStyle,
+                 double tAngle) {
+        ipx = tipx;
+        ipy = tipy;
+        ipz = tipz;
+
+        height = tHeight;
+        width = tWidth;
+        attachmentPoint = tAttachmentPoint;
+        drawingDirection = tDrawingDirection;
+        lineSpacingStyle = tLineSpacingStyle;
+        lineSpacingFactor = tLineSpacingFactor;
+        text = tText;
+        style = tStyle;
+        angle = tAngle;
+    }
+
+    /*! X Coordinate of insertion point. */
+    double ipx;
+    /*! Y Coordinate of insertion point. */
+    double ipy;
+    /*! Z Coordinate of insertion point. */
+    double ipz;
+    /*! Text height */
+    double height;
+    /*! Width of the text box. */
+    double width;
+    /**
+     * Attachment point.
+     *
+     * 1 = Top left, 2 = Top center, 3 = Top right,
+     * 4 = Middle left, 5 = Middle center, 6 = Middle right,
+     * 7 = Bottom left, 8 = Bottom center, 9 = Bottom right
+     */
+    int attachmentPoint;
+    /**
+     * Drawing direction.
+     *
+     * 1 = left to right, 3 = top to bottom, 5 = by style
+     */
+    int drawingDirection;
+    /**
+     * Line spacing style.
+     *
+     * 1 = at least, 2 = exact
+     */
+    int lineSpacingStyle;
+    /**
+     * Line spacing factor. 0.25 .. 4.0  
+     */
+    double lineSpacingFactor;
+    /*! Text string. */
+    string text;
+    /*! Style string. */
+    string style;
+    /*! Rotation angle. */
+    double angle;
+};
+
+
+
+/**
+ * Text Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_TextData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_TextData(double tipx, double tipy, double tipz,
+                double tapx, double tapy, double tapz,
+                double tHeight, double tXScaleFactor,
+                int tTextGenerationFlags,
+                int tHJustification,
+                int tVJustification,
+                const string& tText,
+                const string& tStyle,
+                double tAngle) {
+        ipx = tipx;
+        ipy = tipy;
+        ipz = tipz;
+
+        apx = tapx;
+        apy = tapy;
+        apz = tapz;
+
+        height = tHeight;
+        xScaleFactor = tXScaleFactor;
+        textGenerationFlags = tTextGenerationFlags;
+        hJustification = tHJustification;
+        vJustification = tVJustification;
+        text = tText;
+        style = tStyle;
+        angle = tAngle;
+    }
+
+    /*! X Coordinate of insertion point. */
+    double ipx;
+    /*! Y Coordinate of insertion point. */
+    double ipy;
+    /*! Z Coordinate of insertion point. */
+    double ipz;
+
+    /*! X Coordinate of alignment point. */
+    double apx;
+    /*! Y Coordinate of alignment point. */
+    double apy;
+    /*! Z Coordinate of alignment point. */
+    double apz;
+
+    /*! Text height */
+    double height;
+    /*! Relative X scale factor. */
+    double xScaleFactor;
+    /*! 0 = default, 2 = Backwards, 4 = Upside down */
+    int textGenerationFlags;
+    /**
+     * Horizontal justification.
+     * 
+     * 0 = Left (default), 1 = Center, 2 = Right,
+     * 3 = Aligned, 4 = Middle, 5 = Fit
+     * For 3, 4, 5 the vertical alignment has to be 0.
+     */
+    int hJustification;
+    /**
+     * Vertical justification. 
+     *
+     * 0 = Baseline (default), 1 = Bottom, 2 = Middle, 3= Top
+     */
+    int vJustification;
+    /*! Text string. */
+    string text;
+    /*! Style (font). */
+    string style;
+    /*! Rotation angle of dimension text away from default orientation. */
+    double angle;
+};
+
+
+
+/**
+ * Generic Dimension Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_DimensionData {
+    /**
+    * Constructor.
+    * Parameters: see member variables.
+    */
+    DL_DimensionData(double ddpx, double ddpy, double ddpz,
+                     double dmpx, double dmpy, double dmpz,
+                     int dType,
+                     int dAttachmentPoint,
+                     int dLineSpacingStyle,
+                     double dLineSpacingFactor,
+                     const string& dText,
+                     const string& dStyle,
+                     double dAngle) {
+
+        dpx = ddpx;
+        dpy = ddpy;
+        dpz = ddpz;
+
+        mpx = dmpx;
+        mpy = dmpy;
+        mpz = dmpz;
+
+        type = dType;
+
+        attachmentPoint = dAttachmentPoint;
+        lineSpacingStyle = dLineSpacingStyle;
+        lineSpacingFactor = dLineSpacingFactor;
+        text = dText;
+        style = dStyle;
+        angle = dAngle;
+    }
+
+    /*! X Coordinate of definition point. */
+    double dpx;
+    /*! Y Coordinate of definition point. */
+    double dpy;
+    /*! Z Coordinate of definition point. */
+    double dpz;
+    /*! X Coordinate of middle point of the text. */
+    double mpx;
+    /*! Y Coordinate of middle point of the text. */
+    double mpy;
+    /*! Z Coordinate of middle point of the text. */
+    double mpz;
+    /**
+     * Dimension type.
+     *
+     * 0   Rotated, horizontal, or vertical            
+     * 1   Aligned                                     
+     * 2   Angular                                     
+     * 3   Diametric                                    
+     * 4   Radius                                      
+     * 5   Angular 3-point                             
+     * 6   Ordinate                                    
+     * 64  Ordinate type. This is a bit value (bit 7)  
+     *     used only with integer value 6. If set,     
+     *     ordinate is X-type; if not set, ordinate is 
+     *     Y-type                                      
+     * 128 This is a bit value (bit 8) added to the    
+     *     other group 70 values if the dimension text 
+     *     has been positioned at a user-defined       
+     *    location rather than at the default location
+     */
+    int type;
+    /**
+     * Attachment point.
+     *
+     * 1 = Top left, 2 = Top center, 3 = Top right,
+     * 4 = Middle left, 5 = Middle center, 6 = Middle right,
+     * 7 = Bottom left, 8 = Bottom center, 9 = Bottom right,
+     */
+    int attachmentPoint;
+    /**
+     * Line spacing style.
+     *
+     * 1 = at least, 2 = exact
+     */
+    int lineSpacingStyle;
+    /**
+     * Line spacing factor. 0.25 .. 4.0  
+     */
+    double lineSpacingFactor;
+    /**
+     * Text string. 
+     *
+     * Text string entered explicitly by user or null
+     * or "<>" for the actual measurement or " " (one blank space).
+     * for supressing the text.
+     */
+    string text;
+    /*! Dimension style (font name). */
+    string style;
+    /**
+    * Rotation angle of dimension text away from
+     * default orientation.
+    */
+    double angle;
+};
+
+
+
+/**
+ * Aligned Dimension Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_DimAlignedData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_DimAlignedData(double depx1, double depy1, double depz1,
+                      double depx2, double depy2, double depz2) {
+
+        epx1 = depx1;
+        epy1 = depy1;
+        epz1 = depz1;
+
+        epx2 = depx2;
+        epy2 = depy2;
+        epz2 = depz2;
+    }
+
+    /*! X Coordinate of Extension point 1. */
+    double epx1;
+    /*! Y Coordinate of Extension point 1. */
+    double epy1;
+    /*! Z Coordinate of Extension point 1. */
+    double epz1;
+
+    /*! X Coordinate of Extension point 2. */
+    double epx2;
+    /*! Y Coordinate of Extension point 2. */
+    double epy2;
+    /*! Z Coordinate of Extension point 2. */
+    double epz2;
+};
+
+
+
+/**
+ * Linear Dimension Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_DimLinearData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_DimLinearData(double ddpx1, double ddpy1, double ddpz1,
+                     double ddpx2, double ddpy2, double ddpz2,
+                     double dAngle, double dOblique) {
+
+        dpx1 = ddpx1;
+        dpy1 = ddpy1;
+        dpz1 = ddpz1;
+
+        dpx2 = ddpx2;
+        dpy2 = ddpy2;
+        dpz2 = ddpz2;
+
+        angle = dAngle;
+        oblique = dOblique;
+    }
+
+    /*! X Coordinate of Extension point 1. */
+    double dpx1;
+    /*! Y Coordinate of Extension point 1. */
+    double dpy1;
+    /*! Z Coordinate of Extension point 1. */
+    double dpz1;
+
+    /*! X Coordinate of Extension point 2. */
+    double dpx2;
+    /*! Y Coordinate of Extension point 2. */
+    double dpy2;
+    /*! Z Coordinate of Extension point 2. */
+    double dpz2;
+
+    /*! Rotation angle (angle of dimension line) in degrees. */
+    double angle;
+    /*! Oblique angle in degrees. */
+    double oblique;
+};
+
+
+
+/**
+ * Radial Dimension Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_DimRadialData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_DimRadialData(double ddpx, double ddpy, double ddpz, double dleader) {
+        dpx = ddpx;
+        dpy = ddpy;
+        dpz = ddpz;
+
+        leader = dleader;
+    }
+
+    /*! X Coordinate of definition point. */
+    double dpx;
+    /*! Y Coordinate of definition point. */
+    double dpy;
+    /*! Z Coordinate of definition point. */
+    double dpz;
+
+    /*! Leader length */
+    double leader;
+};
+
+
+
+/**
+ * Diametric Dimension Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_DimDiametricData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_DimDiametricData(double ddpx, double ddpy, double ddpz, double dleader) {
+        dpx = ddpx;
+        dpy = ddpy;
+        dpz = ddpz;
+
+        leader = dleader;
+    }
+
+    /*! X Coordinate of definition point. */
+    double dpx;
+    /*! Y Coordinate of definition point. */
+    double dpy;
+    /*! Z Coordinate of definition point. */
+    double dpz;
+
+    /*! Leader length */
+    double leader;
+};
+
+
+
+/**
+ * Angular Dimension Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_DimAngularData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_DimAngularData(double ddpx1, double ddpy1, double ddpz1,
+                      double ddpx2, double ddpy2, double ddpz2,
+                      double ddpx3, double ddpy3, double ddpz3,
+                      double ddpx4, double ddpy4, double ddpz4) {
+
+        dpx1 = ddpx1;
+        dpy1 = ddpy1;
+        dpz1 = ddpz1;
+
+        dpx2 = ddpx2;
+        dpy2 = ddpy2;
+        dpz2 = ddpz2;
+
+        dpx3 = ddpx3;
+        dpy3 = ddpy3;
+        dpz3 = ddpz3;
+
+        dpx4 = ddpx4;
+        dpy4 = ddpy4;
+        dpz4 = ddpz4;
+    }
+
+    /*! X Coordinate of definition point 1. */
+    double dpx1;
+    /*! Y Coordinate of definition point 1. */
+    double dpy1;
+    /*! Z Coordinate of definition point 1. */
+    double dpz1;
+
+    /*! X Coordinate of definition point 2. */
+    double dpx2;
+    /*! Y Coordinate of definition point 2. */
+    double dpy2;
+    /*! Z Coordinate of definition point 2. */
+    double dpz2;
+
+    /*! X Coordinate of definition point 3. */
+    double dpx3;
+    /*! Y Coordinate of definition point 3. */
+    double dpy3;
+    /*! Z Coordinate of definition point 3. */
+    double dpz3;
+
+    /*! X Coordinate of definition point 4. */
+    double dpx4;
+    /*! Y Coordinate of definition point 4. */
+    double dpy4;
+    /*! Z Coordinate of definition point 4. */
+    double dpz4;
+};
+
+
+/**
+ * Angular Dimension Data (3 points version).
+ *
+ * @author Andrew Mustun
+ */
+struct DL_DimAngular3PData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_DimAngular3PData(double ddpx1, double ddpy1, double ddpz1,
+                        double ddpx2, double ddpy2, double ddpz2,
+                        double ddpx3, double ddpy3, double ddpz3) {
+
+        dpx1 = ddpx1;
+        dpy1 = ddpy1;
+        dpz1 = ddpz1;
+
+        dpx2 = ddpx2;
+        dpy2 = ddpy2;
+        dpz2 = ddpz2;
+
+        dpx3 = ddpx3;
+        dpy3 = ddpy3;
+        dpz3 = ddpz3;
+    }
+
+    /*! X Coordinate of definition point 1. */
+    double dpx1;
+    /*! Y Coordinate of definition point 1. */
+    double dpy1;
+    /*! Z Coordinate of definition point 1. */
+    double dpz1;
+
+    /*! X Coordinate of definition point 2. */
+    double dpx2;
+    /*! Y Coordinate of definition point 2. */
+    double dpy2;
+    /*! Z Coordinate of definition point 2. */
+    double dpz2;
+
+    /*! X Coordinate of definition point 3. */
+    double dpx3;
+    /*! Y Coordinate of definition point 3. */
+    double dpy3;
+    /*! Z Coordinate of definition point 3. */
+    double dpz3;
+};
+
+
+
+/**
+ * Ordinate Dimension Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_DimOrdinateData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_DimOrdinateData(double ddpx1, double ddpy1, double ddpz1,
+                      double ddpx2, double ddpy2, double ddpz2,
+                      bool dxtype) {
+
+        dpx1 = ddpx1;
+        dpy1 = ddpy1;
+        dpz1 = ddpz1;
+
+        dpx2 = ddpx2;
+        dpy2 = ddpy2;
+        dpz2 = ddpz2;
+
+        xtype = dxtype;
+    }
+
+    /*! X Coordinate of definition point 1. */
+    double dpx1;
+    /*! Y Coordinate of definition point 1. */
+    double dpy1;
+    /*! Z Coordinate of definition point 1. */
+    double dpz1;
+
+    /*! X Coordinate of definition point 2. */
+    double dpx2;
+    /*! Y Coordinate of definition point 2. */
+    double dpy2;
+    /*! Z Coordinate of definition point 2. */
+    double dpz2;
+
+    /*! True if the dimension indicates the X-value, false for Y-value */
+    bool xtype;
+};
+
+
+
+/**
+ * Leader (arrow).
+ *
+ * @author Andrew Mustun
+ */
+struct DL_LeaderData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_LeaderData(int lArrowHeadFlag,
+                  int lLeaderPathType,
+                  int lLeaderCreationFlag,
+                  int lHooklineDirectionFlag,
+                  int lHooklineFlag,
+                  double lTextAnnotationHeight,
+                  double lTextAnnotationWidth,
+                  int lNumber) {
+
+        arrowHeadFlag = lArrowHeadFlag;
+        leaderPathType = lLeaderPathType;
+        leaderCreationFlag = lLeaderCreationFlag;
+        hooklineDirectionFlag = lHooklineDirectionFlag;
+        hooklineFlag = lHooklineFlag;
+        textAnnotationHeight = lTextAnnotationHeight;
+        textAnnotationWidth = lTextAnnotationWidth;
+        number = lNumber;
+    }
+
+    /*! Arrow head flag (71). */
+    int arrowHeadFlag;
+    /*! Leader path type (72). */
+    int leaderPathType;
+    /*! Leader creation flag (73). */
+    int leaderCreationFlag;
+    /*! Hookline direction flag (74). */
+    int hooklineDirectionFlag;
+    /*! Hookline flag (75) */
+    int hooklineFlag;
+    /*! Text annotation height (40). */
+    double textAnnotationHeight;
+    /*! Text annotation width (41) */
+    double textAnnotationWidth;
+    /*! Number of vertices in leader (76). */
+    int number;
+};
+
+
+
+/**
+ * Leader Vertex Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_LeaderVertexData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_LeaderVertexData(double px=0.0, double py=0.0, double pz=0.0) {
+        x = px;
+        y = py;
+        z = pz;
+    }
+
+    /*! X Coordinate of the vertex. */
+    double x;
+    /*! Y Coordinate of the vertex. */
+    double y;
+    /*! Z Coordinate of the vertex. */
+    double z;
+};
+
+
+
+/**
+ * Hatch data.
+ */
+struct DL_HatchData {
+    /**
+     * Default constructor.
+     */
+    DL_HatchData() {}
+
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_HatchData(int hNumLoops,
+                 bool hSolid,
+                 double hScale,
+                 double hAngle,
+                 const string& hPattern) {
+        numLoops = hNumLoops;
+        solid = hSolid;
+        scale = hScale;
+        angle = hAngle;
+        pattern = hPattern;
+    }
+
+    /*! Number of boundary paths (loops). */
+    int numLoops;
+    /*! Solid fill flag (true=solid, false=pattern). */
+    bool solid;
+    /*! Pattern scale or spacing */
+    double scale;
+    /*! Pattern angle */
+    double angle;
+    /*! Pattern name. */
+    string pattern;
+};
+
+
+
+/**
+ * Hatch boundary path (loop) data.
+ */
+struct DL_HatchLoopData {
+    /**
+     * Default constructor.
+     */
+    DL_HatchLoopData() {}
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_HatchLoopData(int hNumEdges) {
+        numEdges = hNumEdges;
+    }
+
+    /*! Number of edges in this loop. */
+    int numEdges;
+};
+
+
+
+/**
+ * Hatch edge data.
+ */
+struct DL_HatchEdgeData {
+    /**
+     * Default constructor.
+     */
+    DL_HatchEdgeData() {
+        defined = false;
+    }
+
+    /**
+     * Constructor for a line edge.
+     * Parameters: see member variables.
+     */
+    DL_HatchEdgeData(double lx1, double ly1,
+                     double lx2, double ly2) {
+        x1 = lx1;
+        y1 = ly1;
+        x2 = lx2;
+        y2 = ly2;
+        type = 1;
+        defined = true;
+    }
+
+    /**
+     * Constructor for an arc edge.
+     * Parameters: see member variables.
+     */
+    DL_HatchEdgeData(double acx, double acy,
+                     double aRadius,
+                     double aAngle1, double aAngle2,
+                     bool aCcw) {
+        cx = acx;
+        cy = acy;
+        radius = aRadius;
+        angle1 = aAngle1;
+        angle2 = aAngle2;
+        ccw = aCcw;
+        type = 2;
+        defined = true;
+    }
+
+    /**
+     * Edge type. 1=line, 2=arc.
+     */
+    int type;
+
+    /**
+     * Set to true if this edge is fully defined.
+     */
+    bool defined;
+
+    /*! Start point (X). */
+    double x1;
+    /*! Start point (Y). */
+    double y1;
+    /*! End point (X). */
+    double x2;
+    /*! End point (Y). */
+    double y2;
+    /*! Center point of arc (X). */
+    double cx;
+    /*! Center point of arc (Y). */
+    double cy;
+    /*! Arc radius. */
+    double radius;
+    /*! Start angle. */
+    double angle1;
+    /*! End angle. */
+    double angle2;
+    /*! Counterclockwise flag. */
+    bool ccw;
+};
+
+
+
+/**
+ * Image Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_ImageData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_ImageData(const string& iref,
+                  double iipx, double iipy, double iipz,
+				  double iux, double iuy, double iuz,
+				  double ivx, double ivy, double ivz,
+				  int iwidth, int iheight,
+				  int ibrightness, int icontrast, int ifade) {
+        ref = iref;
+        ipx = iipx;
+        ipy = iipy;
+        ipz = iipz;
+		ux = iux;
+		uy = iuy;
+		uz = iuz;
+		vx = ivx;
+		vy = ivy;
+		vz = ivz;
+		width = iwidth;
+		height = iheight;
+		brightness = ibrightness;
+		contrast = icontrast;
+		fade = ifade;
+    }
+
+    /*! Reference to the image file 
+	    (unique, used to refer to the image def object). */
+    string ref;
+    /*! X Coordinate of insertion point. */
+    double ipx;
+    /*! Y Coordinate of insertion point. */
+    double ipy;
+    /*! Z Coordinate of insertion point. */
+    double ipz;
+	/*! X Coordinate of u vector along bottom of image. */
+	double ux;
+	/*! Y Coordinate of u vector along bottom of image. */
+	double uy;
+	/*! Z Coordinate of u vector along bottom of image. */
+	double uz;
+	/*! X Coordinate of v vector along left side of image. */
+	double vx;
+	/*! Y Coordinate of v vector along left side of image. */
+	double vy;
+	/*! Z Coordinate of v vector along left side of image. */
+	double vz;
+	/*! Width of image in pixel. */
+	int width;
+	/*! Height of image in pixel. */
+	int height;
+	/*! Brightness (0..100, default = 50). */
+	int brightness;
+	/*! Contrast (0..100, default = 50). */
+	int contrast;
+	/*! Fade (0..100, default = 0). */
+	int fade;
+};
+
+
+
+/**
+ * Image Definition Data.
+ *
+ * @author Andrew Mustun
+ */
+struct DL_ImageDefData {
+    /**
+     * Constructor.
+     * Parameters: see member variables.
+     */
+    DL_ImageDefData(const string& iref,
+				 const string& ifile) {
+        ref = iref;
+		file = ifile;
+    }
+
+    /*! Reference to the image file 
+	    (unique, used to refer to the image def object). */
+    string ref;
+
+	/*! Image file */
+	string file;
+};
+
+#endif
+
+// EOF
+
diff --git a/src/dxflib/dl_exception.h b/src/dxflib/dl_exception.h
new file mode 100644
index 0000000..553a447
--- /dev/null
+++ b/src/dxflib/dl_exception.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+** $Id: dl_exception.h 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+** Copyright (C) 2001 Robert J. Campbell Jr.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DL_EXCEPTION_H
+#define DL_EXCEPTION_H
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+/**
+ * Used for exception handling.
+ */
+class DL_Exception {}
+;
+
+/**
+ * Used for exception handling.
+ */
+class DL_NullStrExc : public DL_Exception {}
+;
+
+/**
+ * Used for exception handling.
+ */
+class DL_GroupCodeExc : public DL_Exception {
+    DL_GroupCodeExc(int gc=0) : groupCode(gc) {}
+    int groupCode;
+};
+#endif
+
diff --git a/src/dxflib/dl_extrusion.h b/src/dxflib/dl_extrusion.h
new file mode 100644
index 0000000..750123d
--- /dev/null
+++ b/src/dxflib/dl_extrusion.h
@@ -0,0 +1,144 @@
+/****************************************************************************
+** $Id: dl_extrusion.h 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DL_EXTRUSION_H
+#define DL_EXTRUSION_H
+
+#include <math.h>
+
+
+/**
+ * Storing and passing around attributes. Attributes
+ * are the layer name, color, width and line type.
+ *
+ * @author Andrew Mustun
+ */
+class DL_Extrusion {
+
+public:
+
+    /**
+     * Default constructor.
+     */
+    DL_Extrusion() {
+		direction = new double[3];
+        setDirection(0.0, 0.0, 1.0);
+        setElevation(0.0);
+    }
+
+
+    /**
+     * Destructor.
+     */
+	~DL_Extrusion() {
+		delete direction ;
+    }
+
+
+    /**
+     * Constructor for DXF extrusion.
+     *
+     * @param direction Vector of axis along which the entity shall be extruded
+	 *                  this is also the Z axis of the Entity coordinate system
+     * @param elevation Distance of the entities XY plane from the origin of the
+	 *                  world coordinate system
+     */
+    DL_Extrusion(double dx, double dy, double dz, double elevation) {
+		direction = new double[3];
+		setDirection(dx, dy, dz);
+        setElevation(elevation);
+    }
+
+
+
+    /**
+     * Sets the direction vector. 
+     */
+    void setDirection(double dx, double dy, double dz) {
+		direction[0]=dx;
+        direction[1]=dy;
+        direction[2]=dz;
+    }
+
+
+
+    /**
+     * @return direction vector.
+     */
+    double* getDirection() const {
+        return direction;
+    }
+
+
+
+    /**
+     * @return direction vector.
+     */
+    void getDirection(double dir[]) const {
+        dir[0]=direction[0];
+        dir[1]=direction[1];
+        dir[2]=direction[2];
+    }
+
+
+
+    /**
+     * Sets the elevation.
+     */
+    void setElevation(double elevation) {
+        this->elevation = elevation;
+    }
+
+
+
+    /**
+     * @return Elevation.
+     */
+    double getElevation() const {
+        return elevation;
+    }
+
+
+
+    /**
+     * Copies extrusion (deep copies) from another extrusion object.
+     */
+    DL_Extrusion operator = (const DL_Extrusion& extru) {
+        setDirection(extru.direction[0], extru.direction[1], extru.direction[2]);
+        setElevation(extru.elevation);
+
+        return *this;
+    }
+
+
+
+private:
+	double *direction;
+	double elevation;
+};
+
+#endif
+
diff --git a/src/dxflib/dl_writer.h b/src/dxflib/dl_writer.h
new file mode 100644
index 0000000..429ac5c
--- /dev/null
+++ b/src/dxflib/dl_writer.h
@@ -0,0 +1,618 @@
+/****************************************************************************
+** $Id: dl_writer.h 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+** Copyright (C) 2001 Robert J. Campbell Jr.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DL_WRITER_H
+#define DL_WRITER_H
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#if defined(__OS2__)||defined(__EMX__)
+#define strcasecmp(s,t) stricmp(s,t)
+#endif
+
+#if defined(WIN32)
+#define strcasecmp(s,t) _stricmp(s,t)
+#endif
+
+#include <iostream>
+
+#include "dl_attributes.h"
+#include "dl_codes.h"
+
+#include <cstring>
+
+/**
+ * Defines interface for writing low level DXF constructs to
+ * a file. Implementation is defined in derived classes that write
+ * to binary or ASCII files.
+ * 
+ * Implements functions that write higher level constructs in terms of
+ * the low level ones.
+ *
+ * @todo Add error checking for string/entry length.
+ */
+class DL_Writer {
+public:
+    /**
+     * @para version DXF version. Defaults to VER_2002.
+     */
+    DL_Writer(DL_Codes::version version) : m_handle(0x30) {
+        this->version = version;
+        modelSpaceHandle = 0;
+        paperSpaceHandle = 0;
+        paperSpace0Handle = 0;
+    }
+
+    virtual ~DL_Writer() {}
+    ;
+
+    /** Generic section for section 'name'.
+     *
+     * <pre>
+     *   0
+     *  SECTION
+     *   2
+     *  name
+     * </pre>
+     */
+    void section(const char* name) const {
+        dxfString(0, "SECTION");
+        dxfString(2, name);
+    }
+
+    /**
+     * Section HEADER
+     *
+     * <pre>
+     *   0
+     *  SECTION
+     *   2
+     *  HEADER
+     * </pre>
+     */
+    void sectionHeader() const {
+        section("HEADER");
+    }
+
+    /**
+     * Section TABLES
+     *
+     * <pre>
+     *   0
+     *  SECTION
+     *   2
+     *  TABLES
+     * </pre>
+     */
+    void sectionTables() const {
+        section("TABLES");
+    }
+
+    /**
+     * Section BLOCKS
+     *
+     * <pre>
+     *   0
+     *  SECTION
+     *   2
+     *  BLOCKS
+     * </pre>
+     */
+    void sectionBlocks() const {
+        section("BLOCKS");
+    }
+
+    /**
+     * Section ENTITIES
+     *
+     * <pre>
+     *   0
+     *  SECTION
+     *   2
+     *  ENTITIES
+     * </pre>
+     */
+    void sectionEntities() const {
+        section("ENTITIES");
+    }
+
+    /**
+     * Section CLASSES
+     *
+     * <pre>
+     *   0
+     *  SECTION
+     *   2
+     *  CLASSES
+     * </pre>
+     */
+    void sectionClasses() const {
+        section("CLASSES");
+    }
+
+    /**
+     * Section OBJECTS
+     *
+     * <pre>
+     *   0
+     *  SECTION
+     *   2
+     *  OBJECTS
+     * </pre>
+     */
+    void sectionObjects() const {
+        section("OBJECTS");
+    }
+
+    /**
+     * End of a section.
+     *
+     * <pre>
+     *   0
+     *  ENDSEC
+     * </pre>
+     */
+    void sectionEnd() const {
+        dxfString(0, "ENDSEC");
+    }
+
+    /**
+     * Generic table for table 'name' with 'num' entries:
+     *
+     * <pre>
+     *   0
+     *  TABLE
+     *   2
+     *  name
+     *  70
+     *   num
+     * </pre>
+     */
+    void table(const char* name, int num, int handle) const {
+        dxfString(0, "TABLE");
+        dxfString(2, name);
+        if (version>=VER_2000) {
+            dxfHex(5, handle);
+            dxfString(100, "AcDbSymbolTable");
+        }
+        dxfInt(70, num);
+    }
+
+    /** Table for layers.
+     *
+     * @param num Number of layers in total.
+     *
+     * <pre>
+     *   0
+     *  TABLE
+     *   2
+     *  LAYER
+     *   70
+     *      num
+     * </pre>
+     */
+    void tableLayers(int num) const {
+        table("LAYER", num, 2);
+    }
+
+    /** Table for line types.
+     *
+     * @param num Number of line types in total.
+     *
+     * <pre>
+     *   0
+     *  TABLE
+     *   2
+     *  LTYPE
+     *   70
+     *      num
+     * </pre>
+     */
+    void tableLineTypes(int num) const {
+        //lineTypeHandle = 5;
+        table("LTYPE", num, 5);
+    }
+
+    /** Table for application id.
+     *
+     * @param num Number of registered applications in total.
+     *
+     * <pre>
+     *   0
+     *  TABLE
+     *   2
+     *  APPID
+     *   70
+     *      num
+     * </pre>
+     */
+    void tableAppid(int num) const {
+        table("APPID", num, 9);
+    }
+
+    /**
+     * End of a table.
+     *
+     * <pre>
+     *   0
+     *  ENDTAB
+     * </pre>
+     */
+    void tableEnd() const {
+        dxfString(0, "ENDTAB");
+    }
+
+    /**
+     * End of the DXF file.
+     *
+     * <pre>
+     *   0
+     *  EOF
+     * </pre>
+     */
+    void dxfEOF() const {
+        dxfString(0, "EOF");
+    }
+
+    /**
+     * Comment.
+     *
+     * <pre>
+     *  999
+     *  text
+     * </pre>
+     */
+    void comment(const char* text) const {
+        dxfString(999, text);
+    }
+
+    /**
+     * Entity.
+     *
+     * <pre>
+     *   0
+     *  entTypeName
+     * </pre>
+	 *
+	 * @return Unique handle or 0.
+     */
+    void entity(const char* entTypeName) const {
+        dxfString(0, entTypeName);
+        if (version>=VER_2000) {
+            handle();
+        }
+    }
+
+    /**
+     * Attributes of an entity.
+     *
+     * <pre>
+     *   8
+     *  layer
+     *  62
+     *  color
+     *  39
+     *  width
+     *   6
+     *  linetype
+     * </pre>
+     */
+    void entityAttributes(const DL_Attributes& attrib) const {
+	
+		// layer name:
+        dxfString(8, attrib.getLayer());
+		
+		// R12 doesn't accept BYLAYER values. The value has to be missing
+		//   in that case.
+        if (version>=VER_2000 || 
+			attrib.getColor()!=256) {
+        	dxfInt(62, attrib.getColor());
+		}
+        if (version>=VER_2000) {
+            dxfInt(370, attrib.getWidth());
+        }
+        if (version>=VER_2000 || 
+			strcasecmp(attrib.getLineType().c_str(), "BYLAYER")) {
+	        dxfString(6, attrib.getLineType());
+		}
+    }
+
+    /**
+     * Subclass.
+     */
+    void subClass(const char* sub) const {
+        dxfString(100, sub);
+    }
+
+    /**
+     * Layer (must be in the TABLES section LAYER).
+     *
+     * <pre>
+     *   0
+     *  LAYER
+     * </pre>
+     */
+    void tableLayerEntry(unsigned long int h=0)  const {
+        dxfString(0, "LAYER");
+        if (version>=VER_2000) {
+            if (h==0) {
+                handle();
+            } else {
+                dxfHex(5, h);
+            }
+            dxfString(100, "AcDbSymbolTableRecord");
+            dxfString(100, "AcDbLayerTableRecord");
+        }
+    }
+
+    /**
+     * Line type (must be in the TABLES section LTYPE).
+     *
+     * <pre>
+     *   0
+     *  LTYPE
+     * </pre>
+     */
+    void tableLineTypeEntry(unsigned long int h=0)  const {
+        dxfString(0, "LTYPE");
+        if (version>=VER_2000) {
+            if (h==0) {
+                handle();
+            } else {
+                dxfHex(5, h);
+            }
+            //dxfHex(330, 0x5);
+            dxfString(100, "AcDbSymbolTableRecord");
+            dxfString(100, "AcDbLinetypeTableRecord");
+        }
+    }
+
+    /**
+     * Appid (must be in the TABLES section APPID).
+     *
+     * <pre>
+     *   0
+     *  APPID
+     * </pre>
+     */
+    void tableAppidEntry(unsigned long int h=0)  const {
+        dxfString(0, "APPID");
+        if (version>=VER_2000) {
+            if (h==0) {
+                handle();
+            } else {
+                dxfHex(5, h);
+            }
+            //dxfHex(330, 0x9);
+            dxfString(100, "AcDbSymbolTableRecord");
+            dxfString(100, "AcDbRegAppTableRecord");
+        }
+    }
+
+    /**
+     * Block (must be in the section BLOCKS).
+     *
+     * <pre>
+     *   0
+     *  BLOCK
+     * </pre>
+     */
+    void sectionBlockEntry(unsigned long int h=0)  const {
+        dxfString(0, "BLOCK");
+        if (version>=VER_2000) {
+            if (h==0) {
+                handle();
+            } else {
+                dxfHex(5, h);
+            }
+            //dxfHex(330, blockHandle);
+            dxfString(100, "AcDbEntity");
+            if (h==0x1C) {
+                dxfInt(67, 1);
+            }
+            dxfString(8, "0");                 // TODO: Layer for block
+            dxfString(100, "AcDbBlockBegin");
+        }
+    }
+
+    /**
+     * End of Block (must be in the section BLOCKS).
+     *
+     * <pre>
+     *   0
+     *  ENDBLK
+     * </pre>
+     */
+    void sectionBlockEntryEnd(unsigned long int h=0)  const {
+        dxfString(0, "ENDBLK");
+        if (version>=VER_2000) {
+            if (h==0) {
+                handle();
+            } else {
+                dxfHex(5, h);
+            }
+            //dxfHex(330, blockHandle);
+            dxfString(100, "AcDbEntity");
+            if (h==0x1D) {
+                dxfInt(67, 1);
+            }
+            dxfString(8, "0");                 // TODO: Layer for block
+            dxfString(100, "AcDbBlockEnd");
+        }
+    }
+
+    void color(int col=256) const {
+        dxfInt(62, col);
+    }
+    void lineType(const char *lt) const {
+        dxfString(6, lt);
+    }
+    void lineTypeScale(double scale) const {
+        dxfReal(48, scale);
+    }
+    void lineWeight(int lw) const {
+        dxfInt(370, lw);
+    }
+
+    void coord(int gc, double x, double y, double z=0) const {
+        dxfReal(gc, x);
+        dxfReal(gc+10, y);
+        dxfReal(gc+20, z);
+    }
+
+    void coordTriplet(int gc, const double* value) const {
+        if (value) {
+            dxfReal(gc, *value++);
+            dxfReal(gc+10, *value++);
+            dxfReal(gc+20, *value++);
+        }
+    }
+
+    void resetHandle() const {
+        m_handle = 1;
+    }
+
+    /**
+     * Writes a unique handle and returns it.
+     */
+    unsigned long handle(int gc=5) const {
+        // handle has to be hex
+        dxfHex(gc, m_handle);
+        return m_handle++;
+    }
+
+    /**
+     * @return Next handle that will be written.
+     */
+    unsigned long getNextHandle() const {
+        return m_handle;
+    }
+	
+    /**
+     * Increases handle, so that the handle returned remains available.
+     */
+    unsigned long incHandle() const {
+        return m_handle++;
+    }
+
+    /**
+     * Sets the handle of the model space. Entities refer to 
+     * this handle.
+     */
+    void setModelSpaceHandle(unsigned long h) {
+        modelSpaceHandle = h;
+    }
+
+    unsigned long getModelSpaceHandle() {
+        return modelSpaceHandle;
+    }
+
+    /**
+     * Sets the handle of the paper space. Some special blocks refer to 
+     * this handle.
+     */
+    void setPaperSpaceHandle(unsigned long h) {
+        paperSpaceHandle = h;
+    }
+
+    unsigned long getPaperSpaceHandle() {
+        return paperSpaceHandle;
+    }
+
+    /**
+     * Sets the handle of the paper space 0. Some special blocks refer to 
+     * this handle.
+     */
+    void setPaperSpace0Handle(unsigned long h) {
+        paperSpace0Handle = h;
+    }
+
+    unsigned long getPaperSpace0Handle() {
+        return paperSpace0Handle;
+    }
+
+    /**
+     * Must be overwritten by the implementing class to write a
+     * real value to the file.
+     *
+     * @param gc Group code.
+     * @param value The real value.
+     */
+    virtual void dxfReal(int gc, double value) const = 0;
+
+    /**
+     * Must be overwritten by the implementing class to write an
+     * int value to the file.
+     *
+     * @param gc Group code.
+     * @param value The int value.
+     */
+    virtual void dxfInt(int gc, int value) const = 0;
+
+    /**
+     * Must be overwritten by the implementing class to write an
+     * int value (hex) to the file.
+     *
+     * @param gc Group code.
+     * @param value The int value.
+     */
+    virtual void dxfHex(int gc, int value) const = 0;
+
+    /**
+     * Must be overwritten by the implementing class to write a
+     * string to the file.
+     *
+     * @param gc Group code.
+     * @param value The string.
+     */
+    virtual void dxfString(int gc, const char* value) const = 0;
+
+    /**
+     * Must be overwritten by the implementing class to write a
+     * string to the file.
+     *
+     * @param gc Group code.
+     * @param value The string.
+     */
+    virtual void dxfString(int gc, const string& value) const = 0;
+
+protected:
+    mutable unsigned long m_handle;
+    mutable unsigned long modelSpaceHandle;
+    mutable unsigned long paperSpaceHandle;
+    mutable unsigned long paperSpace0Handle;
+
+    /**
+     * DXF version to be created.
+     */
+    DL_Codes::version version;
+private:
+};
+
+#endif
diff --git a/src/dxflib/dl_writer_ascii.cpp b/src/dxflib/dl_writer_ascii.cpp
new file mode 100644
index 0000000..aa115b3
--- /dev/null
+++ b/src/dxflib/dl_writer_ascii.cpp
@@ -0,0 +1,153 @@
+/****************************************************************************
+** $Id: dl_writer_ascii.cpp 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+** Copyright (C) 2001 Robert J. Campbell Jr.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include <stdio.h>
+
+#include "dl_writer_ascii.h"
+#include "dl_exception.h"
+
+
+/**
+ * Closes the output file.
+ */
+void DL_WriterA::close() const {
+    m_ofile.close();
+}
+
+
+/**
+ * @retval true Opening file has failed.
+ * @retval false Otherwise.
+ */
+bool DL_WriterA::openFailed() const {
+	return m_ofile.fail();
+}
+
+
+
+/**
+ * Writes a real (double) variable to the DXF file.
+ *
+ * @param gc Group code.
+ * @param value Double value
+ */
+void DL_WriterA::dxfReal(int gc, double value) const {
+    char str[256];
+    sprintf(str, "%.16lf", value);
+	
+	// fix for german locale:
+	strReplace(str, ',', '.');
+
+    // Cut away those zeros at the end:
+    bool dot = false;
+    int end = -1;
+    for (unsigned int i=0; i<strlen(str); ++i) {
+        if (str[i]=='.') {
+            dot = true;
+            end = i+2;
+            continue;
+        } else if (dot && str[i]!='0') {
+            end = i+1;
+        }
+    }
+    if (end>0 && end<(int)strlen(str)) {
+        str[end] = '\0';
+    }
+
+    dxfString(gc, str);
+    m_ofile.flush();
+}
+
+
+
+/**
+ * Writes an int variable to the DXF file.
+ *
+ * @param gc Group code.
+ * @param value Int value
+ */
+void DL_WriterA::dxfInt(int gc, int value) const {
+    m_ofile << (gc<10 ? "  " : (gc<100 ? " " : "")) << gc << "\n"
+    << value << "\n";
+}
+
+
+
+/**
+ * Writes a hex int variable to the DXF file.
+ *
+ * @param gc Group code.
+ * @param value Int value
+ */
+void DL_WriterA::dxfHex(int gc, int value) const {
+    char str[12];
+    sprintf(str, "%0X", value);
+    dxfString(gc, str);
+}
+
+
+
+/**
+ * Writes a string variable to the DXF file.
+ *
+ * @param gc Group code.
+ * @param value String
+ */
+void DL_WriterA::dxfString(int gc, const char* value) const {
+    if (value==NULL) {
+#ifndef __GCC2x__
+        //throw DL_NullStrExc();
+#endif
+    }
+    m_ofile << (gc<10 ? "  " : (gc<100 ? " " : "")) << gc << "\n"
+    << value << "\n";
+}
+
+
+
+void DL_WriterA::dxfString(int gc, const string& value) const {
+    m_ofile << (gc<10 ? "  " : (gc<100 ? " " : "")) << gc << "\n"
+    << value << "\n";
+}
+
+
+/**
+ * Replaces every occurence of src with dest in the null terminated str.
+ */
+void DL_WriterA::strReplace(char* str, char src, char dest) {
+	size_t i;
+	for	(i=0; i<strlen(str); i++) {
+		if (str[i]==src) {
+			str[i] = dest;
+		}
+	}
+}
+
diff --git a/src/dxflib/dl_writer_ascii.h b/src/dxflib/dl_writer_ascii.h
new file mode 100644
index 0000000..387127f
--- /dev/null
+++ b/src/dxflib/dl_writer_ascii.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+** $Id: dl_writer_ascii.h 8171 2009-12-11 12:31:36Z fredbed $
+**
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+** Copyright (C) 2001 Robert J. Campbell Jr.
+**
+** This file is part of the dxflib project.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid dxflib Professional Edition licenses may use 
+** this file in accordance with the dxflib Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.ribbonsoft.com for further details.
+**
+** Contact info at ribbonsoft.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DL_WRITER_ASCII_H
+#define DL_WRITER_ASCII_H
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "dl_writer.h"
+#include <fstream>
+#include <string>
+using std::string;
+
+/**
+ * Implements functions defined in DL_Writer for writing low
+ *   level DXF constructs to an ASCII format DXF file.
+ * 
+ * @para fname File name of the file to be created.
+ * @para version DXF version. Defaults to VER_2002.
+ *
+ * @todo What if \c fname is NULL?  Or \c fname can't be opened for
+ * another reason?
+ */
+class DL_WriterA : public DL_Writer {
+public:
+    DL_WriterA(const char* fname, DL_Codes::version version=VER_2000)
+            : DL_Writer(version), m_ofile(fname) {}
+    virtual ~DL_WriterA() {}
+
+	bool openFailed() const;
+    void close() const;
+    void dxfReal(int gc, double value) const;
+    void dxfInt(int gc, int value) const;
+    void dxfHex(int gc, int value) const;
+    void dxfString(int gc, const char* value) const;
+    void dxfString(int gc, const string& value) const;
+
+	static void strReplace(char* str, char src, char dest);
+
+private:
+    /**
+     * DXF file to be created.
+     */
+    mutable std::ofstream m_ofile;
+
+};
+
+#endif
+
diff --git a/src/libjpeg/ansi2knr.c b/src/libjpeg/ansi2knr.c
new file mode 100644
index 0000000..0e3ab13
--- /dev/null
+++ b/src/libjpeg/ansi2knr.c
@@ -0,0 +1,693 @@
+/* ansi2knr.c */
+/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
+
+/*
+ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY.  No author or distributor accepts responsibility to anyone for the
+consequences of using it or for whether it serves any particular purpose or
+works at all, unless he says so in writing.  Refer to the GNU General Public
+License (the "GPL") for full details.
+
+Everyone is granted permission to copy, modify and redistribute ansi2knr,
+but only under the conditions described in the GPL.  A copy of this license
+is supposed to have been given to you along with ansi2knr so you can know
+your rights and responsibilities.  It should be in a file named COPYLEFT.
+[In the IJG distribution, the GPL appears below, not in a separate file.]
+Among other things, the copyright notice and this notice must be preserved
+on all copies.
+
+We explicitly state here what we believe is already implied by the GPL: if
+the ansi2knr program is distributed as a separate set of sources and a
+separate executable file which are aggregated on a storage medium together
+with another program, this in itself does not bring the other program under
+the GPL, nor does the mere fact that such a program or the procedures for
+constructing it invoke the ansi2knr executable bring any other part of the
+program under the GPL.
+*/
+
+/*
+---------- Here is the GNU GPL file COPYLEFT, referred to above ----------
+----- These terms do NOT apply to the JPEG software itself; see README ------
+
+		    GHOSTSCRIPT GENERAL PUBLIC LICENSE
+		    (Clarified 11 Feb 1988)
+
+ Copyright (C) 1988 Richard M. Stallman
+ Everyone is permitted to copy and distribute verbatim copies of this
+ license, but changing it is not allowed.  You can also use this wording
+ to make the terms for other programs.
+
+  The license agreements of most software companies keep you at the
+mercy of those companies.  By contrast, our general public license is
+intended to give everyone the right to share Ghostscript.  To make sure
+that you get the rights we want you to have, we need to make
+restrictions that forbid anyone to deny you these rights or to ask you
+to surrender the rights.  Hence this license agreement.
+
+  Specifically, we want to make sure that you have the right to give
+away copies of Ghostscript, that you receive source code or else can get
+it if you want it, that you can change Ghostscript or use pieces of it
+in new free programs, and that you know you can do these things.
+
+  To make sure that everyone has such rights, we have to forbid you to
+deprive anyone else of these rights.  For example, if you distribute
+copies of Ghostscript, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must tell them their rights.
+
+  Also, for our own protection, we must make certain that everyone finds
+out that there is no warranty for Ghostscript.  If Ghostscript is
+modified by someone else and passed on, we want its recipients to know
+that what they have is not what we distributed, so that any problems
+introduced by others will not reflect on our reputation.
+
+  Therefore we (Richard M. Stallman and the Free Software Foundation,
+Inc.) make the following terms which say what you must do to be allowed
+to distribute or change Ghostscript.
+
+
+			COPYING POLICIES
+
+  1. You may copy and distribute verbatim copies of Ghostscript source
+code as you receive it, in any medium, provided that you conspicuously
+and appropriately publish on each copy a valid copyright and license
+notice "Copyright (C) 1989 Aladdin Enterprises.  All rights reserved.
+Distributed by Free Software Foundation, Inc." (or with whatever year is
+appropriate); keep intact the notices on all files that refer to this
+License Agreement and to the absence of any warranty; and give any other
+recipients of the Ghostscript program a copy of this License Agreement
+along with the program.  You may charge a distribution fee for the
+physical act of transferring a copy.
+
+  2. You may modify your copy or copies of Ghostscript or any portion of
+it, and copy and distribute such modifications under the terms of
+Paragraph 1 above, provided that you also do the following:
+
+    a) cause the modified files to carry prominent notices stating
+    that you changed the files and the date of any change; and
+
+    b) cause the whole of any work that you distribute or publish,
+    that in whole or in part contains or is a derivative of Ghostscript
+    or any part thereof, to be licensed at no charge to all third
+    parties on terms identical to those contained in this License
+    Agreement (except that you may choose to grant more extensive
+    warranty protection to some or all third parties, at your option).
+
+    c) You may charge a distribution fee for the physical act of
+    transferring a copy, and you may at your option offer warranty
+    protection in exchange for a fee.
+
+Mere aggregation of another unrelated program with this program (or its
+derivative) on a volume of a storage or distribution medium does not bring
+the other program under the scope of these terms.
+
+  3. You may copy and distribute Ghostscript (or a portion or derivative
+of it, under Paragraph 2) in object code or executable form under the
+terms of Paragraphs 1 and 2 above provided that you also do one of the
+following:
+
+    a) accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of
+    Paragraphs 1 and 2 above; or,
+
+    b) accompany it with a written offer, valid for at least three
+    years, to give any third party free (except for a nominal
+    shipping charge) a complete machine-readable copy of the
+    corresponding source code, to be distributed under the terms of
+    Paragraphs 1 and 2 above; or,
+
+    c) accompany it with the information you received as to where the
+    corresponding source code may be obtained.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form alone.)
+
+For an executable file, complete source code means all the source code for
+all modules it contains; but, as a special exception, it need not include
+source code for modules which are standard libraries that accompany the
+operating system on which the executable file runs.
+
+  4. You may not copy, sublicense, distribute or transfer Ghostscript
+except as expressly provided under this License Agreement.  Any attempt
+otherwise to copy, sublicense, distribute or transfer Ghostscript is
+void and your rights to use the program under this License agreement
+shall be automatically terminated.  However, parties who have received
+computer software programs from you with this License Agreement will not
+have their licenses terminated so long as such parties remain in full
+compliance.
+
+  5. If you wish to incorporate parts of Ghostscript into other free
+programs whose distribution conditions are different, write to the Free
+Software Foundation at 675 Mass Ave, Cambridge, MA 02139.  We have not
+yet worked out a simple rule that can be stated here, but we will often
+permit this.  We will be guided by the two goals of preserving the free
+status of all derivatives of our free software and of promoting the
+sharing and reuse of software.
+
+Your comments and suggestions about our licensing policies and our
+software are welcome!  Please contact the Free Software Foundation,
+Inc., 675 Mass Ave, Cambridge, MA 02139, or call (617) 876-3296.
+
+		       NO WARRANTY
+
+  BECAUSE GHOSTSCRIPT IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
+NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT
+WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC, RICHARD
+M. STALLMAN, ALADDIN ENTERPRISES, L. PETER DEUTSCH, AND/OR OTHER PARTIES
+PROVIDE GHOSTSCRIPT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF GHOSTSCRIPT IS WITH
+YOU.  SHOULD GHOSTSCRIPT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
+STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., L. PETER DEUTSCH, ALADDIN
+ENTERPRISES, AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE
+GHOSTSCRIPT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
+ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
+INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE
+PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) GHOSTSCRIPT, EVEN IF YOU
+HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM
+BY ANY OTHER PARTY.
+
+-------------------- End of file COPYLEFT ------------------------------
+*/
+
+/*
+ * Usage:
+	ansi2knr input_file [output_file]
+ * If no output_file is supplied, output goes to stdout.
+ * There are no error messages.
+ *
+ * ansi2knr recognizes function definitions by seeing a non-keyword
+ * identifier at the left margin, followed by a left parenthesis,
+ * with a right parenthesis as the last character on the line,
+ * and with a left brace as the first token on the following line
+ * (ignoring possible intervening comments).
+ * It will recognize a multi-line header provided that no intervening
+ * line ends with a left or right brace or a semicolon.
+ * These algorithms ignore whitespace and comments, except that
+ * the function name must be the first thing on the line.
+ * The following constructs will confuse it:
+ *	- Any other construct that starts at the left margin and
+ *	    follows the above syntax (such as a macro or function call).
+ *	- Some macros that tinker with the syntax of the function header.
+ */
+
+/*
+ * The original and principal author of ansi2knr is L. Peter Deutsch
+ * <ghost at aladdin.com>.  Other authors are noted in the change history
+ * that follows (in reverse chronological order):
+	lpd 96-01-21 added code to cope with not HAVE_CONFIG_H and with
+		compilers that don't understand void, as suggested by
+		Tom Lane
+	lpd 96-01-15 changed to require that the first non-comment token
+		on the line following a function header be a left brace,
+		to reduce sensitivity to macros, as suggested by Tom Lane
+		<tgl at sss.pgh.pa.us>
+	lpd 95-06-22 removed #ifndefs whose sole purpose was to define
+		undefined preprocessor symbols as 0; changed all #ifdefs
+		for configuration symbols to #ifs
+	lpd 95-04-05 changed copyright notice to make it clear that
+		including ansi2knr in a program does not bring the entire
+		program under the GPL
+	lpd 94-12-18 added conditionals for systems where ctype macros
+		don't handle 8-bit characters properly, suggested by
+		Francois Pinard <pinard at iro.umontreal.ca>;
+		removed --varargs switch (this is now the default)
+	lpd 94-10-10 removed CONFIG_BROKETS conditional
+	lpd 94-07-16 added some conditionals to help GNU `configure',
+		suggested by Francois Pinard <pinard at iro.umontreal.ca>;
+		properly erase prototype args in function parameters,
+		contributed by Jim Avera <jima at netcom.com>;
+		correct error in writeblanks (it shouldn't erase EOLs)
+	lpd 89-xx-xx original version
+ */
+
+/* Most of the conditionals here are to make ansi2knr work with */
+/* or without the GNU configure machinery. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+
+#if HAVE_CONFIG_H
+
+/*
+   For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h).
+   This will define HAVE_CONFIG_H and so, activate the following lines.
+ */
+
+# if STDC_HEADERS || HAVE_STRING_H
+#  include <string.h>
+# else
+#  include <strings.h>
+# endif
+
+#else /* not HAVE_CONFIG_H */
+
+/* Otherwise do it the hard way */
+
+# ifdef BSD
+#  include <strings.h>
+# else
+#  ifdef VMS
+    extern int strlen(), strncmp();
+#  else
+#   include <string.h>
+#  endif
+# endif
+
+#endif /* not HAVE_CONFIG_H */
+
+#if STDC_HEADERS
+# include <stdlib.h>
+#else
+/*
+   malloc and free should be declared in stdlib.h,
+   but if you've got a K&R compiler, they probably aren't.
+ */
+# ifdef MSDOS
+#  include <malloc.h>
+# else
+#  ifdef VMS
+     extern char *malloc();
+     extern void free();
+#  else
+     extern char *malloc();
+     extern int free();
+#  endif
+# endif
+
+#endif
+
+/*
+ * The ctype macros don't always handle 8-bit characters correctly.
+ * Compensate for this here.
+ */
+#ifdef isascii
+#  undef HAVE_ISASCII		/* just in case */
+#  define HAVE_ISASCII 1
+#else
+#endif
+#if STDC_HEADERS || !HAVE_ISASCII
+#  define is_ascii(c) 1
+#else
+#  define is_ascii(c) isascii(c)
+#endif
+
+#define is_space(c) (is_ascii(c) && isspace(c))
+#define is_alpha(c) (is_ascii(c) && isalpha(c))
+#define is_alnum(c) (is_ascii(c) && isalnum(c))
+
+/* Scanning macros */
+#define isidchar(ch) (is_alnum(ch) || (ch) == '_')
+#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
+
+/* Forward references */
+char *skipspace();
+int writeblanks();
+int test1();
+int convert1();
+
+/* The main program */
+int
+main(argc, argv)
+    int argc;
+    char *argv[];
+{	FILE *in, *out;
+#define bufsize 5000			/* arbitrary size */
+	char *buf;
+	char *line;
+	char *more;
+	/*
+	 * In previous versions, ansi2knr recognized a --varargs switch.
+	 * If this switch was supplied, ansi2knr would attempt to convert
+	 * a ... argument to va_alist and va_dcl; if this switch was not
+	 * supplied, ansi2knr would simply drop any such arguments.
+	 * Now, ansi2knr always does this conversion, and we only
+	 * check for this switch for backward compatibility.
+	 */
+	int convert_varargs = 1;
+
+	if ( argc > 1 && argv[1][0] == '-' )
+	  {	if ( !strcmp(argv[1], "--varargs") )
+		  {	convert_varargs = 1;
+			argc--;
+			argv++;
+		  }
+		else
+		  {	fprintf(stderr, "Unrecognized switch: %s\n", argv[1]);
+			exit(1);
+		  }
+	  }
+	switch ( argc )
+	   {
+	default:
+		printf("Usage: ansi2knr input_file [output_file]\n");
+		exit(0);
+	case 2:
+		out = stdout;
+		break;
+	case 3:
+		out = fopen(argv[2], "w");
+		if ( out == NULL )
+		   {	fprintf(stderr, "Cannot open output file %s\n", argv[2]);
+			exit(1);
+		   }
+	   }
+	in = fopen(argv[1], "r");
+	if ( in == NULL )
+	   {	fprintf(stderr, "Cannot open input file %s\n", argv[1]);
+		exit(1);
+	   }
+	fprintf(out, "#line 1 \"%s\"\n", argv[1]);
+	buf = malloc(bufsize);
+	line = buf;
+	while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
+	   {
+test:		line += strlen(line);
+		switch ( test1(buf) )
+		   {
+		case 2:			/* a function header */
+			convert1(buf, out, 1, convert_varargs);
+			break;
+		case 1:			/* a function */
+			/* Check for a { at the start of the next line. */
+			more = ++line;
+f:			if ( line >= buf + (bufsize - 1) ) /* overflow check */
+			  goto wl;
+			if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
+			  goto wl;
+			switch ( *skipspace(more, 1) )
+			  {
+			  case '{':
+			    /* Definitely a function header. */
+			    convert1(buf, out, 0, convert_varargs);
+			    fputs(more, out);
+			    break;
+			  case 0:
+			    /* The next line was blank or a comment: */
+			    /* keep scanning for a non-comment. */
+			    line += strlen(line);
+			    goto f;
+			  default:
+			    /* buf isn't a function header, but */
+			    /* more might be. */
+			    fputs(buf, out);
+			    strcpy(buf, more);
+			    line = buf;
+			    goto test;
+			  }
+			break;
+		case -1:		/* maybe the start of a function */
+			if ( line != buf + (bufsize - 1) ) /* overflow check */
+			  continue;
+			/* falls through */
+		default:		/* not a function */
+wl:			fputs(buf, out);
+			break;
+		   }
+		line = buf;
+	   }
+	if ( line != buf )
+	  fputs(buf, out);
+	free(buf);
+	fclose(out);
+	fclose(in);
+	return 0;
+}
+
+/* Skip over space and comments, in either direction. */
+char *
+skipspace(p, dir)
+    register char *p;
+    register int dir;			/* 1 for forward, -1 for backward */
+{	for ( ; ; )
+	   {	while ( is_space(*p) )
+		  p += dir;
+		if ( !(*p == '/' && p[dir] == '*') )
+		  break;
+		p += dir;  p += dir;
+		while ( !(*p == '*' && p[dir] == '/') )
+		   {	if ( *p == 0 )
+			  return p;	/* multi-line comment?? */
+			p += dir;
+		   }
+		p += dir;  p += dir;
+	   }
+	return p;
+}
+
+/*
+ * Write blanks over part of a string.
+ * Don't overwrite end-of-line characters.
+ */
+int
+writeblanks(start, end)
+    char *start;
+    char *end;
+{	char *p;
+	for ( p = start; p < end; p++ )
+	  if ( *p != '\r' && *p != '\n' )
+	    *p = ' ';
+	return 0;
+}
+
+/*
+ * Test whether the string in buf is a function definition.
+ * The string may contain and/or end with a newline.
+ * Return as follows:
+ *	0 - definitely not a function definition;
+ *	1 - definitely a function definition;
+ *	2 - definitely a function prototype (NOT USED);
+ *	-1 - may be the beginning of a function definition,
+ *		append another line and look again.
+ * The reason we don't attempt to convert function prototypes is that
+ * Ghostscript's declaration-generating macros look too much like
+ * prototypes, and confuse the algorithms.
+ */
+int
+test1(buf)
+    char *buf;
+{	register char *p = buf;
+	char *bend;
+	char *endfn;
+	int contin;
+
+	if ( !isidfirstchar(*p) )
+	  return 0;		/* no name at left margin */
+	bend = skipspace(buf + strlen(buf) - 1, -1);
+	switch ( *bend )
+	   {
+	   case ';': contin = 0 /*2*/; break;
+	   case ')': contin = 1; break;
+	   case '{': return 0;		/* not a function */
+	   case '}': return 0;		/* not a function */
+	   default: contin = -1;
+	   }
+	while ( isidchar(*p) )
+	  p++;
+	endfn = p;
+	p = skipspace(p, 1);
+	if ( *p++ != '(' )
+	  return 0;		/* not a function */
+	p = skipspace(p, 1);
+	if ( *p == ')' )
+	  return 0;		/* no parameters */
+	/* Check that the apparent function name isn't a keyword. */
+	/* We only need to check for keywords that could be followed */
+	/* by a left parenthesis (which, unfortunately, is most of them). */
+	   {	static char *words[] =
+		   {	"asm", "auto", "case", "char", "const", "double",
+			"extern", "float", "for", "if", "int", "long",
+			"register", "return", "short", "signed", "sizeof",
+			"static", "switch", "typedef", "unsigned",
+			"void", "volatile", "while", 0
+		   };
+		char **key = words;
+		char *kp;
+		int len = endfn - buf;
+
+		while ( (kp = *key) != 0 )
+		   {	if ( strlen(kp) == len && !strncmp(kp, buf, len) )
+			  return 0;	/* name is a keyword */
+			key++;
+		   }
+	   }
+	return contin;
+}
+
+/* Convert a recognized function definition or header to K&R syntax. */
+int
+convert1(buf, out, header, convert_varargs)
+    char *buf;
+    FILE *out;
+    int header;			/* Boolean */
+    int convert_varargs;	/* Boolean */
+{	char *endfn;
+	register char *p;
+	char **breaks;
+	unsigned num_breaks = 2;	/* for testing */
+	char **btop;
+	char **bp;
+	char **ap;
+	char *vararg = 0;
+
+	/* Pre-ANSI implementations don't agree on whether strchr */
+	/* is called strchr or index, so we open-code it here. */
+	for ( endfn = buf; *(endfn++) != '('; )
+	  ;
+top:	p = endfn;
+	breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
+	if ( breaks == 0 )
+	   {	/* Couldn't allocate break table, give up */
+		fprintf(stderr, "Unable to allocate break table!\n");
+		fputs(buf, out);
+		return -1;
+	   }
+	btop = breaks + num_breaks * 2 - 2;
+	bp = breaks;
+	/* Parse the argument list */
+	do
+	   {	int level = 0;
+		char *lp = NULL;
+		char *rp;
+		char *end = NULL;
+
+		if ( bp >= btop )
+		   {	/* Filled up break table. */
+			/* Allocate a bigger one and start over. */
+			free((char *)breaks);
+			num_breaks <<= 1;
+			goto top;
+		   }
+		*bp++ = p;
+		/* Find the end of the argument */
+		for ( ; end == NULL; p++ )
+		   {	switch(*p)
+			   {
+			   case ',':
+				if ( !level ) end = p;
+				break;
+			   case '(':
+				if ( !level ) lp = p;
+				level++;
+				break;
+			   case ')':
+				if ( --level < 0 ) end = p;
+				else rp = p;
+				break;
+			   case '/':
+				p = skipspace(p, 1) - 1;
+				break;
+			   default:
+				;
+			   }
+		   }
+		/* Erase any embedded prototype parameters. */
+		if ( lp )
+		  writeblanks(lp + 1, rp);
+		p--;			/* back up over terminator */
+		/* Find the name being declared. */
+		/* This is complicated because of procedure and */
+		/* array modifiers. */
+		for ( ; ; )
+		   {	p = skipspace(p - 1, -1);
+			switch ( *p )
+			   {
+			   case ']':	/* skip array dimension(s) */
+			   case ')':	/* skip procedure args OR name */
+			   {	int level = 1;
+				while ( level )
+				 switch ( *--p )
+				   {
+				   case ']': case ')': level++; break;
+				   case '[': case '(': level--; break;
+				   case '/': p = skipspace(p, -1) + 1; break;
+				   default: ;
+				   }
+			   }
+				if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
+				   {	/* We found the name being declared */
+					while ( !isidfirstchar(*p) )
+					  p = skipspace(p, 1) + 1;
+					goto found;
+				   }
+				break;
+			   default:
+				goto found;
+			   }
+		   }
+found:		if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
+		  {	if ( convert_varargs )
+			  {	*bp++ = "va_alist";
+				vararg = p-2;
+			  }
+			else
+			  {	p++;
+				if ( bp == breaks + 1 )	/* sole argument */
+				  writeblanks(breaks[0], p);
+				else
+				  writeblanks(bp[-1] - 1, p);
+				bp--;
+			  }
+		   }
+		else
+		   {	while ( isidchar(*p) ) p--;
+			*bp++ = p+1;
+		   }
+		p = end;
+	   }
+	while ( *p++ == ',' );
+	*bp = p;
+	/* Make a special check for 'void' arglist */
+	if ( bp == breaks+2 )
+	   {	p = skipspace(breaks[0], 1);
+		if ( !strncmp(p, "void", 4) )
+		   {	p = skipspace(p+4, 1);
+			if ( p == breaks[2] - 1 )
+			   {	bp = breaks;	/* yup, pretend arglist is empty */
+				writeblanks(breaks[0], p + 1);
+			   }
+		   }
+	   }
+	/* Put out the function name and left parenthesis. */
+	p = buf;
+	while ( p != endfn ) putc(*p, out), p++;
+	/* Put out the declaration. */
+	if ( header )
+	  {	fputs(");", out);
+		for ( p = breaks[0]; *p; p++ )
+		  if ( *p == '\r' || *p == '\n' )
+		    putc(*p, out);
+	  }
+	else
+	  {	for ( ap = breaks+1; ap < bp; ap += 2 )
+		  {	p = *ap;
+			while ( isidchar(*p) )
+			  putc(*p, out), p++;
+			if ( ap < bp - 1 )
+			  fputs(", ", out);
+		  }
+		fputs(")  ", out);
+		/* Put out the argument declarations */
+		for ( ap = breaks+2; ap <= bp; ap += 2 )
+		  (*ap)[-1] = ';';
+		if ( vararg != 0 )
+		  {	*vararg = 0;
+			fputs(breaks[0], out);		/* any prior args */
+			fputs("va_dcl", out);		/* the final arg */
+			fputs(bp[0], out);
+		  }
+		else
+		  fputs(breaks[0], out);
+	  }
+	free((char *)breaks);
+	return 0;
+}
diff --git a/src/libjpeg/cderror.h b/src/libjpeg/cderror.h
new file mode 100644
index 0000000..c19d38f
--- /dev/null
+++ b/src/libjpeg/cderror.h
@@ -0,0 +1,132 @@
+/*
+ * cderror.h
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the error and message codes for the cjpeg/djpeg
+ * applications.  These strings are not needed as part of the JPEG library
+ * proper.
+ * Edit this file to add new codes, or to translate the message strings to
+ * some other language.
+ */
+
+/*
+ * To define the enum list of message codes, include this file without
+ * defining macro JMESSAGE.  To create a message string table, include it
+ * again with a suitable JMESSAGE definition (see jerror.c for an example).
+ */
+#ifndef JMESSAGE
+#ifndef CDERROR_H
+#define CDERROR_H
+/* First time through, define the enum list */
+#define JMAKE_ENUM_LIST
+#else
+/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
+#define JMESSAGE(code,string)
+#endif /* CDERROR_H */
+#endif /* JMESSAGE */
+
+#ifdef JMAKE_ENUM_LIST
+
+typedef enum {
+
+#define JMESSAGE(code,string)	code ,
+
+#endif /* JMAKE_ENUM_LIST */
+
+JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */
+
+#ifdef BMP_SUPPORTED
+JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
+JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
+JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
+JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
+JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
+JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
+JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
+JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
+JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
+JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
+JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
+#endif /* BMP_SUPPORTED */
+
+#ifdef GIF_SUPPORTED
+JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
+JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
+JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
+JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
+JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
+JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
+JMESSAGE(JTRC_GIF_BADVERSION,
+	 "Warning: unexpected GIF version number '%c%c%c'")
+JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
+JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
+JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
+JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
+JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
+JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
+#endif /* GIF_SUPPORTED */
+
+#ifdef PPM_SUPPORTED
+JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
+JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
+JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
+JMESSAGE(JTRC_PGM, "%ux%u PGM image")
+JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
+JMESSAGE(JTRC_PPM, "%ux%u PPM image")
+JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image")
+#endif /* PPM_SUPPORTED */
+
+#ifdef RLE_SUPPORTED
+JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library")
+JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB")
+JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE")
+JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file")
+JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header")
+JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header")
+JMESSAGE(JERR_RLE_NOT, "Not an RLE file")
+JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE")
+JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup")
+JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file")
+JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d")
+JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file")
+JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d")
+JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d")
+#endif /* RLE_SUPPORTED */
+
+#ifdef TARGA_SUPPORTED
+JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
+JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
+JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
+JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
+JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
+JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
+#else
+JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
+#endif /* TARGA_SUPPORTED */
+
+JMESSAGE(JERR_BAD_CMAP_FILE,
+	 "Color map file is invalid or of unsupported format")
+JMESSAGE(JERR_TOO_MANY_COLORS,
+	 "Output file format cannot handle %d colormap entries")
+JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
+#ifdef TARGA_SUPPORTED
+JMESSAGE(JERR_UNKNOWN_FORMAT,
+	 "Unrecognized input file format --- perhaps you need -targa")
+#else
+JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
+#endif
+JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
+
+#ifdef JMAKE_ENUM_LIST
+
+  JMSG_LASTADDONCODE
+} ADDON_MESSAGE_CODE;
+
+#undef JMAKE_ENUM_LIST
+#endif /* JMAKE_ENUM_LIST */
+
+/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
+#undef JMESSAGE
diff --git a/src/libjpeg/cdjpeg.h b/src/libjpeg/cdjpeg.h
new file mode 100644
index 0000000..1574e0b
--- /dev/null
+++ b/src/libjpeg/cdjpeg.h
@@ -0,0 +1,184 @@
+/*
+ * cdjpeg.h
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains common declarations for the sample applications
+ * cjpeg and djpeg.  It is NOT used by the core JPEG library.
+ */
+
+#define JPEG_CJPEG_DJPEG	/* define proper options in jconfig.h */
+#define JPEG_INTERNAL_OPTIONS	/* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jerror.h"		/* get library error codes too */
+#include "cderror.h"		/* get application-specific error codes */
+
+
+/*
+ * Object interface for cjpeg's source file decoding modules
+ */
+
+typedef struct cjpeg_source_struct * cjpeg_source_ptr;
+
+struct cjpeg_source_struct {
+  JMETHOD(void, start_input, (j_compress_ptr cinfo,
+			      cjpeg_source_ptr sinfo));
+  JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
+				       cjpeg_source_ptr sinfo));
+  JMETHOD(void, finish_input, (j_compress_ptr cinfo,
+			       cjpeg_source_ptr sinfo));
+
+  FILE *input_file;
+
+  JSAMPARRAY buffer;
+  JDIMENSION buffer_height;
+};
+
+
+/*
+ * Object interface for djpeg's output file encoding modules
+ */
+
+typedef struct djpeg_dest_struct * djpeg_dest_ptr;
+
+struct djpeg_dest_struct {
+  /* start_output is called after jpeg_start_decompress finishes.
+   * The color map will be ready at this time, if one is needed.
+   */
+  JMETHOD(void, start_output, (j_decompress_ptr cinfo,
+			       djpeg_dest_ptr dinfo));
+  /* Emit the specified number of pixel rows from the buffer. */
+  JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
+				 djpeg_dest_ptr dinfo,
+				 JDIMENSION rows_supplied));
+  /* Finish up at the end of the image. */
+  JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
+				djpeg_dest_ptr dinfo));
+
+  /* Target file spec; filled in by djpeg.c after object is created. */
+  FILE * output_file;
+
+  /* Output pixel-row buffer.  Created by module init or start_output.
+   * Width is cinfo->output_width * cinfo->output_components;
+   * height is buffer_height.
+   */
+  JSAMPARRAY buffer;
+  JDIMENSION buffer_height;
+};
+
+
+/*
+ * cjpeg/djpeg may need to perform extra passes to convert to or from
+ * the source/destination file format.  The JPEG library does not know
+ * about these passes, but we'd like them to be counted by the progress
+ * monitor.  We use an expanded progress monitor object to hold the
+ * additional pass count.
+ */
+
+struct cdjpeg_progress_mgr {
+  struct jpeg_progress_mgr pub;	/* fields known to JPEG library */
+  int completed_extra_passes;	/* extra passes completed */
+  int total_extra_passes;	/* total extra */
+  /* last printed percentage stored here to avoid multiple printouts */
+  int percent_done;
+};
+
+typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
+
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jinit_read_bmp		jIRdBMP
+#define jinit_write_bmp		jIWrBMP
+#define jinit_read_gif		jIRdGIF
+#define jinit_write_gif		jIWrGIF
+#define jinit_read_ppm		jIRdPPM
+#define jinit_write_ppm		jIWrPPM
+#define jinit_read_rle		jIRdRLE
+#define jinit_write_rle		jIWrRLE
+#define jinit_read_targa	jIRdTarga
+#define jinit_write_targa	jIWrTarga
+#define read_quant_tables	RdQTables
+#define read_scan_script	RdScnScript
+#define set_quant_slots		SetQSlots
+#define set_sample_factors	SetSFacts
+#define read_color_map		RdCMap
+#define enable_signal_catcher	EnSigCatcher
+#define start_progress_monitor	StProgMon
+#define end_progress_monitor	EnProgMon
+#define read_stdin		RdStdin
+#define write_stdout		WrStdout
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+/* Module selection routines for I/O modules. */
+
+EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
+EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
+					    boolean is_os2));
+EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
+EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));
+EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
+EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
+EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));
+EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));
+EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));
+EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));
+
+/* cjpeg support routines (in rdswitch.c) */
+
+EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
+				    int scale_factor, boolean force_baseline));
+EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
+EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
+EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
+
+/* djpeg support routines (in rdcolmap.c) */
+
+EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile));
+
+/* common support routines (in cdjpeg.c) */
+
+EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));
+EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,
+					 cd_progress_ptr progress));
+EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));
+EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));
+EXTERN(FILE *) read_stdin JPP((void));
+EXTERN(FILE *) write_stdout JPP((void));
+
+/* miscellaneous useful macros */
+
+#ifdef DONT_USE_B_MODE		/* define mode parameters for fopen() */
+#define READ_BINARY	"r"
+#define WRITE_BINARY	"w"
+#else
+#ifdef VMS			/* VMS is very nonstandard */
+#define READ_BINARY	"rb", "ctx=stm"
+#define WRITE_BINARY	"wb", "ctx=stm"
+#else				/* standard ANSI-compliant case */
+#define READ_BINARY	"rb"
+#define WRITE_BINARY	"wb"
+#endif
+#endif
+
+#ifndef EXIT_FAILURE		/* define exit() codes if not provided */
+#define EXIT_FAILURE  1
+#endif
+#ifndef EXIT_SUCCESS
+#ifdef VMS
+#define EXIT_SUCCESS  1		/* VMS is very nonstandard */
+#else
+#define EXIT_SUCCESS  0
+#endif
+#endif
+#ifndef EXIT_WARNING
+#ifdef VMS
+#define EXIT_WARNING  1		/* VMS is very nonstandard */
+#else
+#define EXIT_WARNING  2
+#endif
+#endif
diff --git a/src/libjpeg/ckconfig.c b/src/libjpeg/ckconfig.c
new file mode 100644
index 0000000..58e9c17
--- /dev/null
+++ b/src/libjpeg/ckconfig.c
@@ -0,0 +1,402 @@
+/*
+ * ckconfig.c
+ *
+ * Copyright (C) 1991-1994, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ */
+
+/*
+ * This program is intended to help you determine how to configure the JPEG
+ * software for installation on a particular system.  The idea is to try to
+ * compile and execute this program.  If your compiler fails to compile the
+ * program, make changes as indicated in the comments below.  Once you can
+ * compile the program, run it, and it will produce a "jconfig.h" file for
+ * your system.
+ *
+ * As a general rule, each time you try to compile this program,
+ * pay attention only to the *first* error message you get from the compiler.
+ * Many C compilers will issue lots of spurious error messages once they
+ * have gotten confused.  Go to the line indicated in the first error message,
+ * and read the comments preceding that line to see what to change.
+ *
+ * Almost all of the edits you may need to make to this program consist of
+ * changing a line that reads "#define SOME_SYMBOL" to "#undef SOME_SYMBOL",
+ * or vice versa.  This is called defining or undefining that symbol.
+ */
+
+
+/* First we must see if your system has the include files we need.
+ * We start out with the assumption that your system has all the ANSI-standard
+ * include files.  If you get any error trying to include one of these files,
+ * undefine the corresponding HAVE_xxx symbol.
+ */
+
+#define HAVE_STDDEF_H		/* replace 'define' by 'undef' if error here */
+#ifdef HAVE_STDDEF_H		/* next line will be skipped if you undef... */
+#include <stddef.h>
+#endif
+
+#define HAVE_STDLIB_H		/* same thing for stdlib.h */
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <stdio.h>		/* If you ain't got this, you ain't got C. */
+
+/* We have to see if your string functions are defined by
+ * strings.h (old BSD convention) or string.h (everybody else).
+ * We try the non-BSD convention first; define NEED_BSD_STRINGS
+ * if the compiler says it can't find string.h.
+ */
+
+#undef NEED_BSD_STRINGS
+
+#ifdef NEED_BSD_STRINGS
+#include <strings.h>
+#else
+#include <string.h>
+#endif
+
+/* On some systems (especially older Unix machines), type size_t is
+ * defined only in the include file <sys/types.h>.  If you get a failure
+ * on the size_t test below, try defining NEED_SYS_TYPES_H.
+ */
+
+#undef NEED_SYS_TYPES_H		/* start by assuming we don't need it */
+#ifdef NEED_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+
+/* Usually type size_t is defined in one of the include files we've included
+ * above.  If not, you'll get an error on the "typedef size_t my_size_t;" line.
+ * In that case, first try defining NEED_SYS_TYPES_H just above.
+ * If that doesn't work, you'll have to search through your system library
+ * to figure out which include file defines "size_t".  Look for a line that
+ * says "typedef something-or-other size_t;".  Then, change the line below
+ * that says "#include <someincludefile.h>" to instead include the file
+ * you found size_t in, and define NEED_SPECIAL_INCLUDE.  If you can't find
+ * type size_t anywhere, try replacing "#include <someincludefile.h>" with
+ * "typedef unsigned int size_t;".
+ */
+
+#undef NEED_SPECIAL_INCLUDE	/* assume we DON'T need it, for starters */
+
+#ifdef NEED_SPECIAL_INCLUDE
+#include <someincludefile.h>
+#endif
+
+typedef size_t my_size_t;	/* The payoff: do we have size_t now? */
+
+
+/* The next question is whether your compiler supports ANSI-style function
+ * prototypes.  You need to know this in order to choose between using
+ * makefile.ansi and using makefile.unix.
+ * The #define line below is set to assume you have ANSI function prototypes.
+ * If you get an error in this group of lines, undefine HAVE_PROTOTYPES.
+ */
+
+#define HAVE_PROTOTYPES
+
+#ifdef HAVE_PROTOTYPES
+int testfunction (int arg1, int * arg2); /* check prototypes */
+
+struct methods_struct {		/* check method-pointer declarations */
+  int (*error_exit) (char *msgtext);
+  int (*trace_message) (char *msgtext);
+  int (*another_method) (void);
+};
+
+int testfunction (int arg1, int * arg2) /* check definitions */
+{
+  return arg2[arg1];
+}
+
+int test2function (void)	/* check void arg list */
+{
+  return 0;
+}
+#endif
+
+
+/* Now we want to find out if your compiler knows what "unsigned char" means.
+ * If you get an error on the "unsigned char un_char;" line,
+ * then undefine HAVE_UNSIGNED_CHAR.
+ */
+
+#define HAVE_UNSIGNED_CHAR
+
+#ifdef HAVE_UNSIGNED_CHAR
+unsigned char un_char;
+#endif
+
+
+/* Now we want to find out if your compiler knows what "unsigned short" means.
+ * If you get an error on the "unsigned short un_short;" line,
+ * then undefine HAVE_UNSIGNED_SHORT.
+ */
+
+#define HAVE_UNSIGNED_SHORT
+
+#ifdef HAVE_UNSIGNED_SHORT
+unsigned short un_short;
+#endif
+
+
+/* Now we want to find out if your compiler understands type "void".
+ * If you get an error anywhere in here, undefine HAVE_VOID.
+ */
+
+#define HAVE_VOID
+
+#ifdef HAVE_VOID
+/* Caution: a C++ compiler will insist on complete prototypes */
+typedef void * void_ptr;	/* check void * */
+#ifdef HAVE_PROTOTYPES		/* check ptr to function returning void */
+typedef void (*void_func) (int a, int b);
+#else
+typedef void (*void_func) ();
+#endif
+
+#ifdef HAVE_PROTOTYPES		/* check void function result */
+void test3function (void_ptr arg1, void_func arg2)
+#else
+void test3function (arg1, arg2)
+     void_ptr arg1;
+     void_func arg2;
+#endif
+{
+  char * locptr = (char *) arg1; /* check casting to and from void * */
+  arg1 = (void *) locptr;
+  (*arg2) (1, 2);		/* check call of fcn returning void */
+}
+#endif
+
+
+/* Now we want to find out if your compiler knows what "const" means.
+ * If you get an error here, undefine HAVE_CONST.
+ */
+
+#define HAVE_CONST
+
+#ifdef HAVE_CONST
+static const int carray[3] = {1, 2, 3};
+
+#ifdef HAVE_PROTOTYPES
+int test4function (const int arg1)
+#else
+int test4function (arg1)
+     const int arg1;
+#endif
+{
+  return carray[arg1];
+}
+#endif
+
+
+/* If you get an error or warning about this structure definition,
+ * define INCOMPLETE_TYPES_BROKEN.
+ */
+
+#undef INCOMPLETE_TYPES_BROKEN
+
+#ifndef INCOMPLETE_TYPES_BROKEN
+typedef struct undefined_structure * undef_struct_ptr;
+#endif
+
+
+/* If you get an error about duplicate names,
+ * define NEED_SHORT_EXTERNAL_NAMES.
+ */
+
+#undef NEED_SHORT_EXTERNAL_NAMES
+
+#ifndef NEED_SHORT_EXTERNAL_NAMES
+
+int possibly_duplicate_function ()
+{
+  return 0;
+}
+
+int possibly_dupli_function ()
+{
+  return 1;
+}
+
+#endif
+
+
+
+/************************************************************************
+ *  OK, that's it.  You should not have to change anything beyond this
+ *  point in order to compile and execute this program.  (You might get
+ *  some warnings, but you can ignore them.)
+ *  When you run the program, it will make a couple more tests that it
+ *  can do automatically, and then it will create jconfig.h and print out
+ *  any additional suggestions it has.
+ ************************************************************************
+ */
+
+
+#ifdef HAVE_PROTOTYPES
+int is_char_signed (int arg)
+#else
+int is_char_signed (arg)
+     int arg;
+#endif
+{
+  if (arg == 189) {		/* expected result for unsigned char */
+    return 0;			/* type char is unsigned */
+  }
+  else if (arg != -67) {	/* expected result for signed char */
+    printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n");
+    printf("I fear the JPEG software will not work at all.\n\n");
+  }
+  return 1;			/* assume char is signed otherwise */
+}
+
+
+#ifdef HAVE_PROTOTYPES
+int is_shifting_signed (long arg)
+#else
+int is_shifting_signed (arg)
+     long arg;
+#endif
+/* See whether right-shift on a long is signed or not. */
+{
+  long res = arg >> 4;
+
+  if (res == -0x7F7E80CL) {	/* expected result for signed shift */
+    return 1;			/* right shift is signed */
+  }
+  /* see if unsigned-shift hack will fix it. */
+  /* we can't just test exact value since it depends on width of long... */
+  res |= (~0L) << (32-4);
+  if (res == -0x7F7E80CL) {	/* expected result now? */
+    return 0;			/* right shift is unsigned */
+  }
+  printf("Right shift isn't acting as I expect it to.\n");
+  printf("I fear the JPEG software will not work at all.\n\n");
+  return 0;			/* try it with unsigned anyway */
+}
+
+
+#ifdef HAVE_PROTOTYPES
+int main (int argc, char ** argv)
+#else
+int main (argc, argv)
+     int argc;
+     char ** argv;
+#endif
+{
+  char signed_char_check = (char) (-67);
+  FILE *outfile;
+
+  /* Attempt to write jconfig.h */
+  if ((outfile = fopen("jconfig.h", "w")) == NULL) {
+    printf("Failed to write jconfig.h\n");
+    return 1;
+  }
+
+  /* Write out all the info */
+  fprintf(outfile, "/* jconfig.h --- generated by ckconfig.c */\n");
+  fprintf(outfile, "/* see jconfig.doc for explanations */\n\n");
+#ifdef HAVE_PROTOTYPES
+  fprintf(outfile, "#define HAVE_PROTOTYPES\n");
+#else
+  fprintf(outfile, "#undef HAVE_PROTOTYPES\n");
+#endif
+#ifdef HAVE_UNSIGNED_CHAR
+  fprintf(outfile, "#define HAVE_UNSIGNED_CHAR\n");
+#else
+  fprintf(outfile, "#undef HAVE_UNSIGNED_CHAR\n");
+#endif
+#ifdef HAVE_UNSIGNED_SHORT
+  fprintf(outfile, "#define HAVE_UNSIGNED_SHORT\n");
+#else
+  fprintf(outfile, "#undef HAVE_UNSIGNED_SHORT\n");
+#endif
+#ifdef HAVE_VOID
+  fprintf(outfile, "/* #define void char */\n");
+#else
+  fprintf(outfile, "#define void char\n");
+#endif
+#ifdef HAVE_CONST
+  fprintf(outfile, "/* #define const */\n");
+#else
+  fprintf(outfile, "#define const\n");
+#endif
+  if (is_char_signed((int) signed_char_check))
+    fprintf(outfile, "#undef CHAR_IS_UNSIGNED\n");
+  else
+    fprintf(outfile, "#define CHAR_IS_UNSIGNED\n");
+#ifdef HAVE_STDDEF_H
+  fprintf(outfile, "#define HAVE_STDDEF_H\n");
+#else
+  fprintf(outfile, "#undef HAVE_STDDEF_H\n");
+#endif
+#ifdef HAVE_STDLIB_H
+  fprintf(outfile, "#define HAVE_STDLIB_H\n");
+#else
+  fprintf(outfile, "#undef HAVE_STDLIB_H\n");
+#endif
+#ifdef NEED_BSD_STRINGS
+  fprintf(outfile, "#define NEED_BSD_STRINGS\n");
+#else
+  fprintf(outfile, "#undef NEED_BSD_STRINGS\n");
+#endif
+#ifdef NEED_SYS_TYPES_H
+  fprintf(outfile, "#define NEED_SYS_TYPES_H\n");
+#else
+  fprintf(outfile, "#undef NEED_SYS_TYPES_H\n");
+#endif
+  fprintf(outfile, "#undef NEED_FAR_POINTERS\n");
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+  fprintf(outfile, "#define NEED_SHORT_EXTERNAL_NAMES\n");
+#else
+  fprintf(outfile, "#undef NEED_SHORT_EXTERNAL_NAMES\n");
+#endif
+#ifdef INCOMPLETE_TYPES_BROKEN
+  fprintf(outfile, "#define INCOMPLETE_TYPES_BROKEN\n");
+#else
+  fprintf(outfile, "#undef INCOMPLETE_TYPES_BROKEN\n");
+#endif
+  fprintf(outfile, "\n#ifdef JPEG_INTERNALS\n\n");
+  if (is_shifting_signed(-0x7F7E80B1L))
+    fprintf(outfile, "#undef RIGHT_SHIFT_IS_UNSIGNED\n");
+  else
+    fprintf(outfile, "#define RIGHT_SHIFT_IS_UNSIGNED\n");
+  fprintf(outfile, "\n#endif /* JPEG_INTERNALS */\n");
+  fprintf(outfile, "\n#ifdef JPEG_CJPEG_DJPEG\n\n");
+  fprintf(outfile, "#define BMP_SUPPORTED		/* BMP image file format */\n");
+  fprintf(outfile, "#define GIF_SUPPORTED		/* GIF image file format */\n");
+  fprintf(outfile, "#define PPM_SUPPORTED		/* PBMPLUS PPM/PGM image file format */\n");
+  fprintf(outfile, "#undef RLE_SUPPORTED		/* Utah RLE image file format */\n");
+  fprintf(outfile, "#define TARGA_SUPPORTED		/* Targa image file format */\n\n");
+  fprintf(outfile, "#undef TWO_FILE_COMMANDLINE	/* You may need this on non-Unix systems */\n");
+  fprintf(outfile, "#undef NEED_SIGNAL_CATCHER	/* Define this if you use jmemname.c */\n");
+  fprintf(outfile, "#undef DONT_USE_B_MODE\n");
+  fprintf(outfile, "/* #define PROGRESS_REPORT */	/* optional */\n");
+  fprintf(outfile, "\n#endif /* JPEG_CJPEG_DJPEG */\n");
+
+  /* Close the jconfig.h file */
+  fclose(outfile);
+
+  /* User report */
+  printf("Configuration check for Independent JPEG Group's software done.\n");
+  printf("\nI have written the jconfig.h file for you.\n\n");
+#ifdef HAVE_PROTOTYPES
+  printf("You should use makefile.ansi as the starting point for your Makefile.\n");
+#else
+  printf("You should use makefile.unix as the starting point for your Makefile.\n");
+#endif
+
+#ifdef NEED_SPECIAL_INCLUDE
+  printf("\nYou'll need to change jconfig.h to include the system include file\n");
+  printf("that you found type size_t in, or add a direct definition of type\n");
+  printf("size_t if that's what you used.  Just add it to the end.\n");
+#endif
+
+  return 0;
+}
diff --git a/src/libjpeg/jcapimin.c b/src/libjpeg/jcapimin.c
new file mode 100644
index 0000000..493af5c
--- /dev/null
+++ b/src/libjpeg/jcapimin.c
@@ -0,0 +1,280 @@
+/*
+ * jcapimin.c
+ *
+ * Copyright (C) 1994-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains application interface code for the compression half
+ * of the JPEG library.  These are the "minimum" API routines that may be
+ * needed in either the normal full-compression case or the transcoding-only
+ * case.
+ *
+ * Most of the routines intended to be called directly by an application
+ * are in this file or in jcapistd.c.  But also see jcparam.c for
+ * parameter-setup helper routines, jcomapi.c for routines shared by
+ * compression and decompression, and jctrans.c for the transcoding case.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Initialization of a JPEG compression object.
+ * The error manager must already be set up (in case memory manager fails).
+ */
+
+GLOBAL(void)
+jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
+{
+  int i;
+
+  /* Guard against version mismatches between library and caller. */
+  cinfo->mem = NULL;		/* so jpeg_destroy knows mem mgr not called */
+  if (version != JPEG_LIB_VERSION)
+    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
+  if (structsize != SIZEOF(struct jpeg_compress_struct))
+    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, 
+	     (int) SIZEOF(struct jpeg_compress_struct), (int) structsize);
+
+  /* For debugging purposes, we zero the whole master structure.
+   * But the application has already set the err pointer, and may have set
+   * client_data, so we have to save and restore those fields.
+   * Note: if application hasn't set client_data, tools like Purify may
+   * complain here.
+   */
+  {
+    struct jpeg_error_mgr * err = cinfo->err;
+    void * client_data = cinfo->client_data; /* ignore Purify complaint here */
+    MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct));
+    cinfo->err = err;
+    cinfo->client_data = client_data;
+  }
+  cinfo->is_decompressor = FALSE;
+
+  /* Initialize a memory manager instance for this object */
+  jinit_memory_mgr((j_common_ptr) cinfo);
+
+  /* Zero out pointers to permanent structures. */
+  cinfo->progress = NULL;
+  cinfo->dest = NULL;
+
+  cinfo->comp_info = NULL;
+
+  for (i = 0; i < NUM_QUANT_TBLS; i++)
+    cinfo->quant_tbl_ptrs[i] = NULL;
+
+  for (i = 0; i < NUM_HUFF_TBLS; i++) {
+    cinfo->dc_huff_tbl_ptrs[i] = NULL;
+    cinfo->ac_huff_tbl_ptrs[i] = NULL;
+  }
+
+  cinfo->script_space = NULL;
+
+  cinfo->input_gamma = 1.0;	/* in case application forgets */
+
+  /* OK, I'm ready */
+  cinfo->global_state = CSTATE_START;
+}
+
+
+/*
+ * Destruction of a JPEG compression object
+ */
+
+GLOBAL(void)
+jpeg_destroy_compress (j_compress_ptr cinfo)
+{
+  jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
+}
+
+
+/*
+ * Abort processing of a JPEG compression operation,
+ * but don't destroy the object itself.
+ */
+
+GLOBAL(void)
+jpeg_abort_compress (j_compress_ptr cinfo)
+{
+  jpeg_abort((j_common_ptr) cinfo); /* use common routine */
+}
+
+
+/*
+ * Forcibly suppress or un-suppress all quantization and Huffman tables.
+ * Marks all currently defined tables as already written (if suppress)
+ * or not written (if !suppress).  This will control whether they get emitted
+ * by a subsequent jpeg_start_compress call.
+ *
+ * This routine is exported for use by applications that want to produce
+ * abbreviated JPEG datastreams.  It logically belongs in jcparam.c, but
+ * since it is called by jpeg_start_compress, we put it here --- otherwise
+ * jcparam.o would be linked whether the application used it or not.
+ */
+
+GLOBAL(void)
+jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)
+{
+  int i;
+  JQUANT_TBL * qtbl;
+  JHUFF_TBL * htbl;
+
+  for (i = 0; i < NUM_QUANT_TBLS; i++) {
+    if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)
+      qtbl->sent_table = suppress;
+  }
+
+  for (i = 0; i < NUM_HUFF_TBLS; i++) {
+    if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)
+      htbl->sent_table = suppress;
+    if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)
+      htbl->sent_table = suppress;
+  }
+}
+
+
+/*
+ * Finish JPEG compression.
+ *
+ * If a multipass operating mode was selected, this may do a great deal of
+ * work including most of the actual output.
+ */
+
+GLOBAL(void)
+jpeg_finish_compress (j_compress_ptr cinfo)
+{
+  JDIMENSION iMCU_row;
+
+  if (cinfo->global_state == CSTATE_SCANNING ||
+      cinfo->global_state == CSTATE_RAW_OK) {
+    /* Terminate first pass */
+    if (cinfo->next_scanline < cinfo->image_height)
+      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
+    (*cinfo->master->finish_pass) (cinfo);
+  } else if (cinfo->global_state != CSTATE_WRCOEFS)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  /* Perform any remaining passes */
+  while (! cinfo->master->is_last_pass) {
+    (*cinfo->master->prepare_for_pass) (cinfo);
+    for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
+      if (cinfo->progress != NULL) {
+	cinfo->progress->pass_counter = (long) iMCU_row;
+	cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
+	(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+      }
+      /* We bypass the main controller and invoke coef controller directly;
+       * all work is being done from the coefficient buffer.
+       */
+      if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))
+	ERREXIT(cinfo, JERR_CANT_SUSPEND);
+    }
+    (*cinfo->master->finish_pass) (cinfo);
+  }
+  /* Write EOI, do final cleanup */
+  (*cinfo->marker->write_file_trailer) (cinfo);
+  (*cinfo->dest->term_destination) (cinfo);
+  /* We can use jpeg_abort to release memory and reset global_state */
+  jpeg_abort((j_common_ptr) cinfo);
+}
+
+
+/*
+ * Write a special marker.
+ * This is only recommended for writing COM or APPn markers.
+ * Must be called after jpeg_start_compress() and before
+ * first call to jpeg_write_scanlines() or jpeg_write_raw_data().
+ */
+
+GLOBAL(void)
+jpeg_write_marker (j_compress_ptr cinfo, int marker,
+		   const JOCTET *dataptr, unsigned int datalen)
+{
+  JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));
+
+  if (cinfo->next_scanline != 0 ||
+      (cinfo->global_state != CSTATE_SCANNING &&
+       cinfo->global_state != CSTATE_RAW_OK &&
+       cinfo->global_state != CSTATE_WRCOEFS))
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
+  write_marker_byte = cinfo->marker->write_marker_byte;	/* copy for speed */
+  while (datalen--) {
+    (*write_marker_byte) (cinfo, *dataptr);
+    dataptr++;
+  }
+}
+
+/* Same, but piecemeal. */
+
+GLOBAL(void)
+jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
+{
+  if (cinfo->next_scanline != 0 ||
+      (cinfo->global_state != CSTATE_SCANNING &&
+       cinfo->global_state != CSTATE_RAW_OK &&
+       cinfo->global_state != CSTATE_WRCOEFS))
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
+}
+
+GLOBAL(void)
+jpeg_write_m_byte (j_compress_ptr cinfo, int val)
+{
+  (*cinfo->marker->write_marker_byte) (cinfo, val);
+}
+
+
+/*
+ * Alternate compression function: just write an abbreviated table file.
+ * Before calling this, all parameters and a data destination must be set up.
+ *
+ * To produce a pair of files containing abbreviated tables and abbreviated
+ * image data, one would proceed as follows:
+ *
+ *		initialize JPEG object
+ *		set JPEG parameters
+ *		set destination to table file
+ *		jpeg_write_tables(cinfo);
+ *		set destination to image file
+ *		jpeg_start_compress(cinfo, FALSE);
+ *		write data...
+ *		jpeg_finish_compress(cinfo);
+ *
+ * jpeg_write_tables has the side effect of marking all tables written
+ * (same as jpeg_suppress_tables(..., TRUE)).  Thus a subsequent start_compress
+ * will not re-emit the tables unless it is passed write_all_tables=TRUE.
+ */
+
+GLOBAL(void)
+jpeg_write_tables (j_compress_ptr cinfo)
+{
+  if (cinfo->global_state != CSTATE_START)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+  /* (Re)initialize error mgr and destination modules */
+  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
+  (*cinfo->dest->init_destination) (cinfo);
+  /* Initialize the marker writer ... bit of a crock to do it here. */
+  jinit_marker_writer(cinfo);
+  /* Write them tables! */
+  (*cinfo->marker->write_tables_only) (cinfo);
+  /* And clean up. */
+  (*cinfo->dest->term_destination) (cinfo);
+  /*
+   * In library releases up through v6a, we called jpeg_abort() here to free
+   * any working memory allocated by the destination manager and marker
+   * writer.  Some applications had a problem with that: they allocated space
+   * of their own from the library memory manager, and didn't want it to go
+   * away during write_tables.  So now we do nothing.  This will cause a
+   * memory leak if an app calls write_tables repeatedly without doing a full
+   * compression cycle or otherwise resetting the JPEG object.  However, that
+   * seems less bad than unexpectedly freeing memory in the normal case.
+   * An app that prefers the old behavior can call jpeg_abort for itself after
+   * each call to jpeg_write_tables().
+   */
+}
diff --git a/src/libjpeg/jcapistd.c b/src/libjpeg/jcapistd.c
new file mode 100644
index 0000000..fed66ca
--- /dev/null
+++ b/src/libjpeg/jcapistd.c
@@ -0,0 +1,161 @@
+/*
+ * jcapistd.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains application interface code for the compression half
+ * of the JPEG library.  These are the "standard" API routines that are
+ * used in the normal full-compression case.  They are not used by a
+ * transcoding-only application.  Note that if an application links in
+ * jpeg_start_compress, it will end up linking in the entire compressor.
+ * We thus must separate this file from jcapimin.c to avoid linking the
+ * whole compression library into a transcoder.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Compression initialization.
+ * Before calling this, all parameters and a data destination must be set up.
+ *
+ * We require a write_all_tables parameter as a failsafe check when writing
+ * multiple datastreams from the same compression object.  Since prior runs
+ * will have left all the tables marked sent_table=TRUE, a subsequent run
+ * would emit an abbreviated stream (no tables) by default.  This may be what
+ * is wanted, but for safety's sake it should not be the default behavior:
+ * programmers should have to make a deliberate choice to emit abbreviated
+ * images.  Therefore the documentation and examples should encourage people
+ * to pass write_all_tables=TRUE; then it will take active thought to do the
+ * wrong thing.
+ */
+
+GLOBAL(void)
+jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)
+{
+  if (cinfo->global_state != CSTATE_START)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+  if (write_all_tables)
+    jpeg_suppress_tables(cinfo, FALSE);	/* mark all tables to be written */
+
+  /* (Re)initialize error mgr and destination modules */
+  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
+  (*cinfo->dest->init_destination) (cinfo);
+  /* Perform master selection of active modules */
+  jinit_compress_master(cinfo);
+  /* Set up for the first pass */
+  (*cinfo->master->prepare_for_pass) (cinfo);
+  /* Ready for application to drive first pass through jpeg_write_scanlines
+   * or jpeg_write_raw_data.
+   */
+  cinfo->next_scanline = 0;
+  cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);
+}
+
+
+/*
+ * Write some scanlines of data to the JPEG compressor.
+ *
+ * The return value will be the number of lines actually written.
+ * This should be less than the supplied num_lines only in case that
+ * the data destination module has requested suspension of the compressor,
+ * or if more than image_height scanlines are passed in.
+ *
+ * Note: we warn about excess calls to jpeg_write_scanlines() since
+ * this likely signals an application programmer error.  However,
+ * excess scanlines passed in the last valid call are *silently* ignored,
+ * so that the application need not adjust num_lines for end-of-image
+ * when using a multiple-scanline buffer.
+ */
+
+GLOBAL(JDIMENSION)
+jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
+		      JDIMENSION num_lines)
+{
+  JDIMENSION row_ctr, rows_left;
+
+  if (cinfo->global_state != CSTATE_SCANNING)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  if (cinfo->next_scanline >= cinfo->image_height)
+    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
+
+  /* Call progress monitor hook if present */
+  if (cinfo->progress != NULL) {
+    cinfo->progress->pass_counter = (long) cinfo->next_scanline;
+    cinfo->progress->pass_limit = (long) cinfo->image_height;
+    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+  }
+
+  /* Give master control module another chance if this is first call to
+   * jpeg_write_scanlines.  This lets output of the frame/scan headers be
+   * delayed so that application can write COM, etc, markers between
+   * jpeg_start_compress and jpeg_write_scanlines.
+   */
+  if (cinfo->master->call_pass_startup)
+    (*cinfo->master->pass_startup) (cinfo);
+
+  /* Ignore any extra scanlines at bottom of image. */
+  rows_left = cinfo->image_height - cinfo->next_scanline;
+  if (num_lines > rows_left)
+    num_lines = rows_left;
+
+  row_ctr = 0;
+  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
+  cinfo->next_scanline += row_ctr;
+  return row_ctr;
+}
+
+
+/*
+ * Alternate entry point to write raw data.
+ * Processes exactly one iMCU row per call, unless suspended.
+ */
+
+GLOBAL(JDIMENSION)
+jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
+		     JDIMENSION num_lines)
+{
+  JDIMENSION lines_per_iMCU_row;
+
+  if (cinfo->global_state != CSTATE_RAW_OK)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  if (cinfo->next_scanline >= cinfo->image_height) {
+    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
+    return 0;
+  }
+
+  /* Call progress monitor hook if present */
+  if (cinfo->progress != NULL) {
+    cinfo->progress->pass_counter = (long) cinfo->next_scanline;
+    cinfo->progress->pass_limit = (long) cinfo->image_height;
+    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+  }
+
+  /* Give master control module another chance if this is first call to
+   * jpeg_write_raw_data.  This lets output of the frame/scan headers be
+   * delayed so that application can write COM, etc, markers between
+   * jpeg_start_compress and jpeg_write_raw_data.
+   */
+  if (cinfo->master->call_pass_startup)
+    (*cinfo->master->pass_startup) (cinfo);
+
+  /* Verify that at least one iMCU row has been passed. */
+  lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
+  if (num_lines < lines_per_iMCU_row)
+    ERREXIT(cinfo, JERR_BUFFER_SIZE);
+
+  /* Directly compress the row. */
+  if (! (*cinfo->coef->compress_data) (cinfo, data)) {
+    /* If compressor did not consume the whole row, suspend processing. */
+    return 0;
+  }
+
+  /* OK, we processed one iMCU row. */
+  cinfo->next_scanline += lines_per_iMCU_row;
+  return lines_per_iMCU_row;
+}
diff --git a/src/libjpeg/jccoefct.c b/src/libjpeg/jccoefct.c
new file mode 100644
index 0000000..c713b85
--- /dev/null
+++ b/src/libjpeg/jccoefct.c
@@ -0,0 +1,449 @@
+/*
+ * jccoefct.c
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the coefficient buffer controller for compression.
+ * This controller is the top level of the JPEG compressor proper.
+ * The coefficient buffer lies between forward-DCT and entropy encoding steps.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* We use a full-image coefficient buffer when doing Huffman optimization,
+ * and also for writing multiple-scan JPEG files.  In all cases, the DCT
+ * step is run during the first pass, and subsequent passes need only read
+ * the buffered coefficients.
+ */
+#ifdef ENTROPY_OPT_SUPPORTED
+#define FULL_COEF_BUFFER_SUPPORTED
+#else
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+#define FULL_COEF_BUFFER_SUPPORTED
+#endif
+#endif
+
+
+/* Private buffer controller object */
+
+typedef struct {
+  struct jpeg_c_coef_controller pub; /* public fields */
+
+  JDIMENSION iMCU_row_num;	/* iMCU row # within image */
+  JDIMENSION mcu_ctr;		/* counts MCUs processed in current row */
+  int MCU_vert_offset;		/* counts MCU rows within iMCU row */
+  int MCU_rows_per_iMCU_row;	/* number of such rows needed */
+
+  /* For single-pass compression, it's sufficient to buffer just one MCU
+   * (although this may prove a bit slow in practice).  We allocate a
+   * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each
+   * MCU constructed and sent.  (On 80x86, the workspace is FAR even though
+   * it's not really very big; this is to keep the module interfaces unchanged
+   * when a large coefficient buffer is necessary.)
+   * In multi-pass modes, this array points to the current MCU's blocks
+   * within the virtual arrays.
+   */
+  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
+
+  /* In multi-pass modes, we need a virtual block array for each component. */
+  jvirt_barray_ptr whole_image[MAX_COMPONENTS];
+} my_coef_controller;
+
+typedef my_coef_controller * my_coef_ptr;
+
+
+/* Forward declarations */
+METHODDEF(boolean) compress_data
+    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
+#ifdef FULL_COEF_BUFFER_SUPPORTED
+METHODDEF(boolean) compress_first_pass
+    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
+METHODDEF(boolean) compress_output
+    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
+#endif
+
+
+LOCAL(void)
+start_iMCU_row (j_compress_ptr cinfo)
+/* Reset within-iMCU-row counters for a new row */
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+  /* In an interleaved scan, an MCU row is the same as an iMCU row.
+   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
+   * But at the bottom of the image, process only what's left.
+   */
+  if (cinfo->comps_in_scan > 1) {
+    coef->MCU_rows_per_iMCU_row = 1;
+  } else {
+    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
+      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
+    else
+      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
+  }
+
+  coef->mcu_ctr = 0;
+  coef->MCU_vert_offset = 0;
+}
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+  coef->iMCU_row_num = 0;
+  start_iMCU_row(cinfo);
+
+  switch (pass_mode) {
+  case JBUF_PASS_THRU:
+    if (coef->whole_image[0] != NULL)
+      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+    coef->pub.compress_data = compress_data;
+    break;
+#ifdef FULL_COEF_BUFFER_SUPPORTED
+  case JBUF_SAVE_AND_PASS:
+    if (coef->whole_image[0] == NULL)
+      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+    coef->pub.compress_data = compress_first_pass;
+    break;
+  case JBUF_CRANK_DEST:
+    if (coef->whole_image[0] == NULL)
+      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+    coef->pub.compress_data = compress_output;
+    break;
+#endif
+  default:
+    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+    break;
+  }
+}
+
+
+/*
+ * Process some data in the single-pass case.
+ * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
+ * per call, ie, v_samp_factor block rows for each component in the image.
+ * Returns TRUE if the iMCU row is completed, FALSE if suspended.
+ *
+ * NB: input_buf contains a plane for each component in image,
+ * which we index according to the component's SOF position.
+ */
+
+METHODDEF(boolean)
+compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+  JDIMENSION MCU_col_num;	/* index of current MCU within row */
+  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
+  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+  int blkn, bi, ci, yindex, yoffset, blockcnt;
+  JDIMENSION ypos, xpos;
+  jpeg_component_info *compptr;
+
+  /* Loop to write as much as one whole iMCU row */
+  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
+       yoffset++) {
+    for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
+	 MCU_col_num++) {
+      /* Determine where data comes from in input_buf and do the DCT thing.
+       * Each call on forward_DCT processes a horizontal row of DCT blocks
+       * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
+       * sequentially.  Dummy blocks at the right or bottom edge are filled in
+       * specially.  The data in them does not matter for image reconstruction,
+       * so we fill them with values that will encode to the smallest amount of
+       * data, viz: all zeroes in the AC entries, DC entries equal to previous
+       * block's DC value.  (Thanks to Thomas Kinsman for this idea.)
+       */
+      blkn = 0;
+      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+	compptr = cinfo->cur_comp_info[ci];
+	blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
+						: compptr->last_col_width;
+	xpos = MCU_col_num * compptr->MCU_sample_width;
+	ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
+	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
+	  if (coef->iMCU_row_num < last_iMCU_row ||
+	      yoffset+yindex < compptr->last_row_height) {
+	    (*cinfo->fdct->forward_DCT) (cinfo, compptr,
+					 input_buf[compptr->component_index],
+					 coef->MCU_buffer[blkn],
+					 ypos, xpos, (JDIMENSION) blockcnt);
+	    if (blockcnt < compptr->MCU_width) {
+	      /* Create some dummy blocks at the right edge of the image. */
+	      jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt],
+			(compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));
+	      for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
+		coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
+	      }
+	    }
+	  } else {
+	    /* Create a row of dummy blocks at the bottom of the image. */
+	    jzero_far((void FAR *) coef->MCU_buffer[blkn],
+		      compptr->MCU_width * SIZEOF(JBLOCK));
+	    for (bi = 0; bi < compptr->MCU_width; bi++) {
+	      coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
+	    }
+	  }
+	  blkn += compptr->MCU_width;
+	  ypos += DCTSIZE;
+	}
+      }
+      /* Try to write the MCU.  In event of a suspension failure, we will
+       * re-DCT the MCU on restart (a bit inefficient, could be fixed...)
+       */
+      if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
+	/* Suspension forced; update state counters and exit */
+	coef->MCU_vert_offset = yoffset;
+	coef->mcu_ctr = MCU_col_num;
+	return FALSE;
+      }
+    }
+    /* Completed an MCU row, but perhaps not an iMCU row */
+    coef->mcu_ctr = 0;
+  }
+  /* Completed the iMCU row, advance counters for next one */
+  coef->iMCU_row_num++;
+  start_iMCU_row(cinfo);
+  return TRUE;
+}
+
+
+#ifdef FULL_COEF_BUFFER_SUPPORTED
+
+/*
+ * Process some data in the first pass of a multi-pass case.
+ * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
+ * per call, ie, v_samp_factor block rows for each component in the image.
+ * This amount of data is read from the source buffer, DCT'd and quantized,
+ * and saved into the virtual arrays.  We also generate suitable dummy blocks
+ * as needed at the right and lower edges.  (The dummy blocks are constructed
+ * in the virtual arrays, which have been padded appropriately.)  This makes
+ * it possible for subsequent passes not to worry about real vs. dummy blocks.
+ *
+ * We must also emit the data to the entropy encoder.  This is conveniently
+ * done by calling compress_output() after we've loaded the current strip
+ * of the virtual arrays.
+ *
+ * NB: input_buf contains a plane for each component in image.  All
+ * components are DCT'd and loaded into the virtual arrays in this pass.
+ * However, it may be that only a subset of the components are emitted to
+ * the entropy encoder during this first pass; be careful about looking
+ * at the scan-dependent variables (MCU dimensions, etc).
+ */
+
+METHODDEF(boolean)
+compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+  JDIMENSION blocks_across, MCUs_across, MCUindex;
+  int bi, ci, h_samp_factor, block_row, block_rows, ndummy;
+  JCOEF lastDC;
+  jpeg_component_info *compptr;
+  JBLOCKARRAY buffer;
+  JBLOCKROW thisblockrow, lastblockrow;
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* Align the virtual buffer for this component. */
+    buffer = (*cinfo->mem->access_virt_barray)
+      ((j_common_ptr) cinfo, coef->whole_image[ci],
+       coef->iMCU_row_num * compptr->v_samp_factor,
+       (JDIMENSION) compptr->v_samp_factor, TRUE);
+    /* Count non-dummy DCT block rows in this iMCU row. */
+    if (coef->iMCU_row_num < last_iMCU_row)
+      block_rows = compptr->v_samp_factor;
+    else {
+      /* NB: can't use last_row_height here, since may not be set! */
+      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
+      if (block_rows == 0) block_rows = compptr->v_samp_factor;
+    }
+    blocks_across = compptr->width_in_blocks;
+    h_samp_factor = compptr->h_samp_factor;
+    /* Count number of dummy blocks to be added at the right margin. */
+    ndummy = (int) (blocks_across % h_samp_factor);
+    if (ndummy > 0)
+      ndummy = h_samp_factor - ndummy;
+    /* Perform DCT for all non-dummy blocks in this iMCU row.  Each call
+     * on forward_DCT processes a complete horizontal row of DCT blocks.
+     */
+    for (block_row = 0; block_row < block_rows; block_row++) {
+      thisblockrow = buffer[block_row];
+      (*cinfo->fdct->forward_DCT) (cinfo, compptr,
+				   input_buf[ci], thisblockrow,
+				   (JDIMENSION) (block_row * DCTSIZE),
+				   (JDIMENSION) 0, blocks_across);
+      if (ndummy > 0) {
+	/* Create dummy blocks at the right edge of the image. */
+	thisblockrow += blocks_across; /* => first dummy block */
+	jzero_far((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));
+	lastDC = thisblockrow[-1][0];
+	for (bi = 0; bi < ndummy; bi++) {
+	  thisblockrow[bi][0] = lastDC;
+	}
+      }
+    }
+    /* If at end of image, create dummy block rows as needed.
+     * The tricky part here is that within each MCU, we want the DC values
+     * of the dummy blocks to match the last real block's DC value.
+     * This squeezes a few more bytes out of the resulting file...
+     */
+    if (coef->iMCU_row_num == last_iMCU_row) {
+      blocks_across += ndummy;	/* include lower right corner */
+      MCUs_across = blocks_across / h_samp_factor;
+      for (block_row = block_rows; block_row < compptr->v_samp_factor;
+	   block_row++) {
+	thisblockrow = buffer[block_row];
+	lastblockrow = buffer[block_row-1];
+	jzero_far((void FAR *) thisblockrow,
+		  (size_t) (blocks_across * SIZEOF(JBLOCK)));
+	for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
+	  lastDC = lastblockrow[h_samp_factor-1][0];
+	  for (bi = 0; bi < h_samp_factor; bi++) {
+	    thisblockrow[bi][0] = lastDC;
+	  }
+	  thisblockrow += h_samp_factor; /* advance to next MCU in row */
+	  lastblockrow += h_samp_factor;
+	}
+      }
+    }
+  }
+  /* NB: compress_output will increment iMCU_row_num if successful.
+   * A suspension return will result in redoing all the work above next time.
+   */
+
+  /* Emit data to the entropy encoder, sharing code with subsequent passes */
+  return compress_output(cinfo, input_buf);
+}
+
+
+/*
+ * Process some data in subsequent passes of a multi-pass case.
+ * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
+ * per call, ie, v_samp_factor block rows for each component in the scan.
+ * The data is obtained from the virtual arrays and fed to the entropy coder.
+ * Returns TRUE if the iMCU row is completed, FALSE if suspended.
+ *
+ * NB: input_buf is ignored; it is likely to be a NULL pointer.
+ */
+
+METHODDEF(boolean)
+compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+  JDIMENSION MCU_col_num;	/* index of current MCU within row */
+  int blkn, ci, xindex, yindex, yoffset;
+  JDIMENSION start_col;
+  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
+  JBLOCKROW buffer_ptr;
+  jpeg_component_info *compptr;
+
+  /* Align the virtual buffers for the components used in this scan.
+   * NB: during first pass, this is safe only because the buffers will
+   * already be aligned properly, so jmemmgr.c won't need to do any I/O.
+   */
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    compptr = cinfo->cur_comp_info[ci];
+    buffer[ci] = (*cinfo->mem->access_virt_barray)
+      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
+       coef->iMCU_row_num * compptr->v_samp_factor,
+       (JDIMENSION) compptr->v_samp_factor, FALSE);
+  }
+
+  /* Loop to process one whole iMCU row */
+  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
+       yoffset++) {
+    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
+	 MCU_col_num++) {
+      /* Construct list of pointers to DCT blocks belonging to this MCU */
+      blkn = 0;			/* index of current DCT block within MCU */
+      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+	compptr = cinfo->cur_comp_info[ci];
+	start_col = MCU_col_num * compptr->MCU_width;
+	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
+	  buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
+	  for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
+	    coef->MCU_buffer[blkn++] = buffer_ptr++;
+	  }
+	}
+      }
+      /* Try to write the MCU. */
+      if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
+	/* Suspension forced; update state counters and exit */
+	coef->MCU_vert_offset = yoffset;
+	coef->mcu_ctr = MCU_col_num;
+	return FALSE;
+      }
+    }
+    /* Completed an MCU row, but perhaps not an iMCU row */
+    coef->mcu_ctr = 0;
+  }
+  /* Completed the iMCU row, advance counters for next one */
+  coef->iMCU_row_num++;
+  start_iMCU_row(cinfo);
+  return TRUE;
+}
+
+#endif /* FULL_COEF_BUFFER_SUPPORTED */
+
+
+/*
+ * Initialize coefficient buffer controller.
+ */
+
+GLOBAL(void)
+jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
+{
+  my_coef_ptr coef;
+
+  coef = (my_coef_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_coef_controller));
+  cinfo->coef = (struct jpeg_c_coef_controller *) coef;
+  coef->pub.start_pass = start_pass_coef;
+
+  /* Create the coefficient buffer. */
+  if (need_full_buffer) {
+#ifdef FULL_COEF_BUFFER_SUPPORTED
+    /* Allocate a full-image virtual array for each component, */
+    /* padded to a multiple of samp_factor DCT blocks in each direction. */
+    int ci;
+    jpeg_component_info *compptr;
+
+    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+	 ci++, compptr++) {
+      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
+	((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
+				(long) compptr->h_samp_factor),
+	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+				(long) compptr->v_samp_factor),
+	 (JDIMENSION) compptr->v_samp_factor);
+    }
+#else
+    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+#endif
+  } else {
+    /* We only need a single-MCU buffer. */
+    JBLOCKROW buffer;
+    int i;
+
+    buffer = (JBLOCKROW)
+      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
+    for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
+      coef->MCU_buffer[i] = buffer + i;
+    }
+    coef->whole_image[0] = NULL; /* flag for no virtual arrays */
+  }
+}
diff --git a/src/libjpeg/jccolor.c b/src/libjpeg/jccolor.c
new file mode 100644
index 0000000..2663724
--- /dev/null
+++ b/src/libjpeg/jccolor.c
@@ -0,0 +1,459 @@
+/*
+ * jccolor.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains input colorspace conversion routines.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private subobject */
+
+typedef struct {
+  struct jpeg_color_converter pub; /* public fields */
+
+  /* Private state for RGB->YCC conversion */
+  INT32 * rgb_ycc_tab;		/* => table for RGB to YCbCr conversion */
+} my_color_converter;
+
+typedef my_color_converter * my_cconvert_ptr;
+
+
+/**************** RGB -> YCbCr conversion: most common case **************/
+
+/*
+ * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
+ * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
+ * The conversion equations to be implemented are therefore
+ *	Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B
+ *	Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B  + CENTERJSAMPLE
+ *	Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B  + CENTERJSAMPLE
+ * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
+ * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
+ * rather than CENTERJSAMPLE, for Cb and Cr.  This gave equal positive and
+ * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
+ * were not represented exactly.  Now we sacrifice exact representation of
+ * maximum red and maximum blue in order to get exact grayscales.
+ *
+ * To avoid floating-point arithmetic, we represent the fractional constants
+ * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
+ * the products by 2^16, with appropriate rounding, to get the correct answer.
+ *
+ * For even more speed, we avoid doing any multiplications in the inner loop
+ * by precalculating the constants times R,G,B for all possible values.
+ * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
+ * for 12-bit samples it is still acceptable.  It's not very reasonable for
+ * 16-bit samples, but if you want lossless storage you shouldn't be changing
+ * colorspace anyway.
+ * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
+ * in the tables to save adding them separately in the inner loop.
+ */
+
+#define SCALEBITS	16	/* speediest right-shift on some machines */
+#define CBCR_OFFSET	((INT32) CENTERJSAMPLE << SCALEBITS)
+#define ONE_HALF	((INT32) 1 << (SCALEBITS-1))
+#define FIX(x)		((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
+
+/* We allocate one big table and divide it up into eight parts, instead of
+ * doing eight alloc_small requests.  This lets us use a single table base
+ * address, which can be held in a register in the inner loops on many
+ * machines (more than can hold all eight addresses, anyway).
+ */
+
+#define R_Y_OFF		0			/* offset to R => Y section */
+#define G_Y_OFF		(1*(MAXJSAMPLE+1))	/* offset to G => Y section */
+#define B_Y_OFF		(2*(MAXJSAMPLE+1))	/* etc. */
+#define R_CB_OFF	(3*(MAXJSAMPLE+1))
+#define G_CB_OFF	(4*(MAXJSAMPLE+1))
+#define B_CB_OFF	(5*(MAXJSAMPLE+1))
+#define R_CR_OFF	B_CB_OFF		/* B=>Cb, R=>Cr are the same */
+#define G_CR_OFF	(6*(MAXJSAMPLE+1))
+#define B_CR_OFF	(7*(MAXJSAMPLE+1))
+#define TABLE_SIZE	(8*(MAXJSAMPLE+1))
+
+
+/*
+ * Initialize for RGB->YCC colorspace conversion.
+ */
+
+METHODDEF(void)
+rgb_ycc_start (j_compress_ptr cinfo)
+{
+  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+  INT32 * rgb_ycc_tab;
+  INT32 i;
+
+  /* Allocate and fill in the conversion tables. */
+  cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(TABLE_SIZE * SIZEOF(INT32)));
+
+  for (i = 0; i <= MAXJSAMPLE; i++) {
+    rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
+    rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
+    rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i     + ONE_HALF;
+    rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;
+    rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;
+    /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
+     * This ensures that the maximum output will round to MAXJSAMPLE
+     * not MAXJSAMPLE+1, and thus that we don't have to range-limit.
+     */
+    rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
+/*  B=>Cb and R=>Cr tables are the same
+    rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
+*/
+    rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;
+    rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;
+  }
+}
+
+
+/*
+ * Convert some rows of samples to the JPEG colorspace.
+ *
+ * Note that we change from the application's interleaved-pixel format
+ * to our internal noninterleaved, one-plane-per-component format.
+ * The input buffer is therefore three times as wide as the output buffer.
+ *
+ * A starting row offset is provided only for the output buffer.  The caller
+ * can easily adjust the passed input_buf value to accommodate any row
+ * offset required on that side.
+ */
+
+METHODDEF(void)
+rgb_ycc_convert (j_compress_ptr cinfo,
+		 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+		 JDIMENSION output_row, int num_rows)
+{
+  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+  register int r, g, b;
+  register INT32 * ctab = cconvert->rgb_ycc_tab;
+  register JSAMPROW inptr;
+  register JSAMPROW outptr0, outptr1, outptr2;
+  register JDIMENSION col;
+  JDIMENSION num_cols = cinfo->image_width;
+
+  while (--num_rows >= 0) {
+    inptr = *input_buf++;
+    outptr0 = output_buf[0][output_row];
+    outptr1 = output_buf[1][output_row];
+    outptr2 = output_buf[2][output_row];
+    output_row++;
+    for (col = 0; col < num_cols; col++) {
+      r = GETJSAMPLE(inptr[RGB_RED]);
+      g = GETJSAMPLE(inptr[RGB_GREEN]);
+      b = GETJSAMPLE(inptr[RGB_BLUE]);
+      inptr += RGB_PIXELSIZE;
+      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
+       * must be too; we do not need an explicit range-limiting operation.
+       * Hence the value being shifted is never negative, and we don't
+       * need the general RIGHT_SHIFT macro.
+       */
+      /* Y */
+      outptr0[col] = (JSAMPLE)
+		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
+		 >> SCALEBITS);
+      /* Cb */
+      outptr1[col] = (JSAMPLE)
+		((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
+		 >> SCALEBITS);
+      /* Cr */
+      outptr2[col] = (JSAMPLE)
+		((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
+		 >> SCALEBITS);
+    }
+  }
+}
+
+
+/**************** Cases other than RGB -> YCbCr **************/
+
+
+/*
+ * Convert some rows of samples to the JPEG colorspace.
+ * This version handles RGB->grayscale conversion, which is the same
+ * as the RGB->Y portion of RGB->YCbCr.
+ * We assume rgb_ycc_start has been called (we only use the Y tables).
+ */
+
+METHODDEF(void)
+rgb_gray_convert (j_compress_ptr cinfo,
+		  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+		  JDIMENSION output_row, int num_rows)
+{
+  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+  register int r, g, b;
+  register INT32 * ctab = cconvert->rgb_ycc_tab;
+  register JSAMPROW inptr;
+  register JSAMPROW outptr;
+  register JDIMENSION col;
+  JDIMENSION num_cols = cinfo->image_width;
+
+  while (--num_rows >= 0) {
+    inptr = *input_buf++;
+    outptr = output_buf[0][output_row];
+    output_row++;
+    for (col = 0; col < num_cols; col++) {
+      r = GETJSAMPLE(inptr[RGB_RED]);
+      g = GETJSAMPLE(inptr[RGB_GREEN]);
+      b = GETJSAMPLE(inptr[RGB_BLUE]);
+      inptr += RGB_PIXELSIZE;
+      /* Y */
+      outptr[col] = (JSAMPLE)
+		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
+		 >> SCALEBITS);
+    }
+  }
+}
+
+
+/*
+ * Convert some rows of samples to the JPEG colorspace.
+ * This version handles Adobe-style CMYK->YCCK conversion,
+ * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same
+ * conversion as above, while passing K (black) unchanged.
+ * We assume rgb_ycc_start has been called.
+ */
+
+METHODDEF(void)
+cmyk_ycck_convert (j_compress_ptr cinfo,
+		   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+		   JDIMENSION output_row, int num_rows)
+{
+  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+  register int r, g, b;
+  register INT32 * ctab = cconvert->rgb_ycc_tab;
+  register JSAMPROW inptr;
+  register JSAMPROW outptr0, outptr1, outptr2, outptr3;
+  register JDIMENSION col;
+  JDIMENSION num_cols = cinfo->image_width;
+
+  while (--num_rows >= 0) {
+    inptr = *input_buf++;
+    outptr0 = output_buf[0][output_row];
+    outptr1 = output_buf[1][output_row];
+    outptr2 = output_buf[2][output_row];
+    outptr3 = output_buf[3][output_row];
+    output_row++;
+    for (col = 0; col < num_cols; col++) {
+      r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);
+      g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
+      b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
+      /* K passes through as-is */
+      outptr3[col] = inptr[3];	/* don't need GETJSAMPLE here */
+      inptr += 4;
+      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
+       * must be too; we do not need an explicit range-limiting operation.
+       * Hence the value being shifted is never negative, and we don't
+       * need the general RIGHT_SHIFT macro.
+       */
+      /* Y */
+      outptr0[col] = (JSAMPLE)
+		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
+		 >> SCALEBITS);
+      /* Cb */
+      outptr1[col] = (JSAMPLE)
+		((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
+		 >> SCALEBITS);
+      /* Cr */
+      outptr2[col] = (JSAMPLE)
+		((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
+		 >> SCALEBITS);
+    }
+  }
+}
+
+
+/*
+ * Convert some rows of samples to the JPEG colorspace.
+ * This version handles grayscale output with no conversion.
+ * The source can be either plain grayscale or YCbCr (since Y == gray).
+ */
+
+METHODDEF(void)
+grayscale_convert (j_compress_ptr cinfo,
+		   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+		   JDIMENSION output_row, int num_rows)
+{
+  register JSAMPROW inptr;
+  register JSAMPROW outptr;
+  register JDIMENSION col;
+  JDIMENSION num_cols = cinfo->image_width;
+  int instride = cinfo->input_components;
+
+  while (--num_rows >= 0) {
+    inptr = *input_buf++;
+    outptr = output_buf[0][output_row];
+    output_row++;
+    for (col = 0; col < num_cols; col++) {
+      outptr[col] = inptr[0];	/* don't need GETJSAMPLE() here */
+      inptr += instride;
+    }
+  }
+}
+
+
+/*
+ * Convert some rows of samples to the JPEG colorspace.
+ * This version handles multi-component colorspaces without conversion.
+ * We assume input_components == num_components.
+ */
+
+METHODDEF(void)
+null_convert (j_compress_ptr cinfo,
+	      JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+	      JDIMENSION output_row, int num_rows)
+{
+  register JSAMPROW inptr;
+  register JSAMPROW outptr;
+  register JDIMENSION col;
+  register int ci;
+  int nc = cinfo->num_components;
+  JDIMENSION num_cols = cinfo->image_width;
+
+  while (--num_rows >= 0) {
+    /* It seems fastest to make a separate pass for each component. */
+    for (ci = 0; ci < nc; ci++) {
+      inptr = *input_buf;
+      outptr = output_buf[ci][output_row];
+      for (col = 0; col < num_cols; col++) {
+	outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
+	inptr += nc;
+      }
+    }
+    input_buf++;
+    output_row++;
+  }
+}
+
+
+/*
+ * Empty method for start_pass.
+ */
+
+METHODDEF(void)
+null_method (j_compress_ptr cinfo)
+{
+  /* no work needed */
+}
+
+
+/*
+ * Module initialization routine for input colorspace conversion.
+ */
+
+GLOBAL(void)
+jinit_color_converter (j_compress_ptr cinfo)
+{
+  my_cconvert_ptr cconvert;
+
+  cconvert = (my_cconvert_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_color_converter));
+  cinfo->cconvert = (struct jpeg_color_converter *) cconvert;
+  /* set start_pass to null method until we find out differently */
+  cconvert->pub.start_pass = null_method;
+
+  /* Make sure input_components agrees with in_color_space */
+  switch (cinfo->in_color_space) {
+  case JCS_GRAYSCALE:
+    if (cinfo->input_components != 1)
+      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+    break;
+
+  case JCS_RGB:
+#if RGB_PIXELSIZE != 3
+    if (cinfo->input_components != RGB_PIXELSIZE)
+      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+    break;
+#endif /* else share code with YCbCr */
+
+  case JCS_YCbCr:
+    if (cinfo->input_components != 3)
+      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+    break;
+
+  case JCS_CMYK:
+  case JCS_YCCK:
+    if (cinfo->input_components != 4)
+      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+    break;
+
+  default:			/* JCS_UNKNOWN can be anything */
+    if (cinfo->input_components < 1)
+      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+    break;
+  }
+
+  /* Check num_components, set conversion method based on requested space */
+  switch (cinfo->jpeg_color_space) {
+  case JCS_GRAYSCALE:
+    if (cinfo->num_components != 1)
+      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+    if (cinfo->in_color_space == JCS_GRAYSCALE)
+      cconvert->pub.color_convert = grayscale_convert;
+    else if (cinfo->in_color_space == JCS_RGB) {
+      cconvert->pub.start_pass = rgb_ycc_start;
+      cconvert->pub.color_convert = rgb_gray_convert;
+    } else if (cinfo->in_color_space == JCS_YCbCr)
+      cconvert->pub.color_convert = grayscale_convert;
+    else
+      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+    break;
+
+  case JCS_RGB:
+    if (cinfo->num_components != 3)
+      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+    if (cinfo->in_color_space == JCS_RGB && RGB_PIXELSIZE == 3)
+      cconvert->pub.color_convert = null_convert;
+    else
+      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+    break;
+
+  case JCS_YCbCr:
+    if (cinfo->num_components != 3)
+      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+    if (cinfo->in_color_space == JCS_RGB) {
+      cconvert->pub.start_pass = rgb_ycc_start;
+      cconvert->pub.color_convert = rgb_ycc_convert;
+    } else if (cinfo->in_color_space == JCS_YCbCr)
+      cconvert->pub.color_convert = null_convert;
+    else
+      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+    break;
+
+  case JCS_CMYK:
+    if (cinfo->num_components != 4)
+      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+    if (cinfo->in_color_space == JCS_CMYK)
+      cconvert->pub.color_convert = null_convert;
+    else
+      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+    break;
+
+  case JCS_YCCK:
+    if (cinfo->num_components != 4)
+      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+    if (cinfo->in_color_space == JCS_CMYK) {
+      cconvert->pub.start_pass = rgb_ycc_start;
+      cconvert->pub.color_convert = cmyk_ycck_convert;
+    } else if (cinfo->in_color_space == JCS_YCCK)
+      cconvert->pub.color_convert = null_convert;
+    else
+      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+    break;
+
+  default:			/* allow null conversion of JCS_UNKNOWN */
+    if (cinfo->jpeg_color_space != cinfo->in_color_space ||
+	cinfo->num_components != cinfo->input_components)
+      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+    cconvert->pub.color_convert = null_convert;
+    break;
+  }
+}
diff --git a/src/libjpeg/jcdctmgr.c b/src/libjpeg/jcdctmgr.c
new file mode 100644
index 0000000..e3f90dc
--- /dev/null
+++ b/src/libjpeg/jcdctmgr.c
@@ -0,0 +1,387 @@
+/*
+ * jcdctmgr.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the forward-DCT management logic.
+ * This code selects a particular DCT implementation to be used,
+ * and it performs related housekeeping chores including coefficient
+ * quantization.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h"		/* Private declarations for DCT subsystem */
+
+
+/* Private subobject for this module */
+
+typedef struct {
+  struct jpeg_forward_dct pub;	/* public fields */
+
+  /* Pointer to the DCT routine actually in use */
+  forward_DCT_method_ptr do_dct;
+
+  /* The actual post-DCT divisors --- not identical to the quant table
+   * entries, because of scaling (especially for an unnormalized DCT).
+   * Each table is given in normal array order.
+   */
+  DCTELEM * divisors[NUM_QUANT_TBLS];
+
+#ifdef DCT_FLOAT_SUPPORTED
+  /* Same as above for the floating-point case. */
+  float_DCT_method_ptr do_float_dct;
+  FAST_FLOAT * float_divisors[NUM_QUANT_TBLS];
+#endif
+} my_fdct_controller;
+
+typedef my_fdct_controller * my_fdct_ptr;
+
+
+/*
+ * Initialize for a processing pass.
+ * Verify that all referenced Q-tables are present, and set up
+ * the divisor table for each one.
+ * In the current implementation, DCT of all components is done during
+ * the first pass, even if only some components will be output in the
+ * first scan.  Hence all components should be examined here.
+ */
+
+METHODDEF(void)
+start_pass_fdctmgr (j_compress_ptr cinfo)
+{
+  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
+  int ci, qtblno, i;
+  jpeg_component_info *compptr;
+  JQUANT_TBL * qtbl;
+  DCTELEM * dtbl;
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    qtblno = compptr->quant_tbl_no;
+    /* Make sure specified quantization table is present */
+    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
+	cinfo->quant_tbl_ptrs[qtblno] == NULL)
+      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
+    qtbl = cinfo->quant_tbl_ptrs[qtblno];
+    /* Compute divisors for this quant table */
+    /* We may do this more than once for same table, but it's not a big deal */
+    switch (cinfo->dct_method) {
+#ifdef DCT_ISLOW_SUPPORTED
+    case JDCT_ISLOW:
+      /* For LL&M IDCT method, divisors are equal to raw quantization
+       * coefficients multiplied by 8 (to counteract scaling).
+       */
+      if (fdct->divisors[qtblno] == NULL) {
+	fdct->divisors[qtblno] = (DCTELEM *)
+	  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				      DCTSIZE2 * SIZEOF(DCTELEM));
+      }
+      dtbl = fdct->divisors[qtblno];
+      for (i = 0; i < DCTSIZE2; i++) {
+	dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
+      }
+      break;
+#endif
+#ifdef DCT_IFAST_SUPPORTED
+    case JDCT_IFAST:
+      {
+	/* For AA&N IDCT method, divisors are equal to quantization
+	 * coefficients scaled by scalefactor[row]*scalefactor[col], where
+	 *   scalefactor[0] = 1
+	 *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7
+	 * We apply a further scale factor of 8.
+	 */
+#define CONST_BITS 14
+	static const INT16 aanscales[DCTSIZE2] = {
+	  /* precomputed values scaled up by 14 bits */
+	  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
+	  22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,
+	  21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,
+	  19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,
+	  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
+	  12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,
+	   8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,
+	   4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247
+	};
+	SHIFT_TEMPS
+
+	if (fdct->divisors[qtblno] == NULL) {
+	  fdct->divisors[qtblno] = (DCTELEM *)
+	    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+					DCTSIZE2 * SIZEOF(DCTELEM));
+	}
+	dtbl = fdct->divisors[qtblno];
+	for (i = 0; i < DCTSIZE2; i++) {
+	  dtbl[i] = (DCTELEM)
+	    DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
+				  (INT32) aanscales[i]),
+		    CONST_BITS-3);
+	}
+      }
+      break;
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+    case JDCT_FLOAT:
+      {
+	/* For float AA&N IDCT method, divisors are equal to quantization
+	 * coefficients scaled by scalefactor[row]*scalefactor[col], where
+	 *   scalefactor[0] = 1
+	 *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7
+	 * We apply a further scale factor of 8.
+	 * What's actually stored is 1/divisor so that the inner loop can
+	 * use a multiplication rather than a division.
+	 */
+	FAST_FLOAT * fdtbl;
+	int row, col;
+	static const double aanscalefactor[DCTSIZE] = {
+	  1.0, 1.387039845, 1.306562965, 1.175875602,
+	  1.0, 0.785694958, 0.541196100, 0.275899379
+	};
+
+	if (fdct->float_divisors[qtblno] == NULL) {
+	  fdct->float_divisors[qtblno] = (FAST_FLOAT *)
+	    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+					DCTSIZE2 * SIZEOF(FAST_FLOAT));
+	}
+	fdtbl = fdct->float_divisors[qtblno];
+	i = 0;
+	for (row = 0; row < DCTSIZE; row++) {
+	  for (col = 0; col < DCTSIZE; col++) {
+	    fdtbl[i] = (FAST_FLOAT)
+	      (1.0 / (((double) qtbl->quantval[i] *
+		       aanscalefactor[row] * aanscalefactor[col] * 8.0)));
+	    i++;
+	  }
+	}
+      }
+      break;
+#endif
+    default:
+      ERREXIT(cinfo, JERR_NOT_COMPILED);
+      break;
+    }
+  }
+}
+
+
+/*
+ * Perform forward DCT on one or more blocks of a component.
+ *
+ * The input samples are taken from the sample_data[] array starting at
+ * position start_row/start_col, and moving to the right for any additional
+ * blocks. The quantized coefficients are returned in coef_blocks[].
+ */
+
+METHODDEF(void)
+forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
+	     JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
+	     JDIMENSION start_row, JDIMENSION start_col,
+	     JDIMENSION num_blocks)
+/* This version is used for integer DCT implementations. */
+{
+  /* This routine is heavily used, so it's worth coding it tightly. */
+  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
+  forward_DCT_method_ptr do_dct = fdct->do_dct;
+  DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
+  DCTELEM workspace[DCTSIZE2];	/* work area for FDCT subroutine */
+  JDIMENSION bi;
+
+  sample_data += start_row;	/* fold in the vertical offset once */
+
+  for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
+    /* Load data into workspace, applying unsigned->signed conversion */
+    { register DCTELEM *workspaceptr;
+      register JSAMPROW elemptr;
+      register int elemr;
+
+      workspaceptr = workspace;
+      for (elemr = 0; elemr < DCTSIZE; elemr++) {
+	elemptr = sample_data[elemr] + start_col;
+#if DCTSIZE == 8		/* unroll the inner loop */
+	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+#else
+	{ register int elemc;
+	  for (elemc = DCTSIZE; elemc > 0; elemc--) {
+	    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+	  }
+	}
+#endif
+      }
+    }
+
+    /* Perform the DCT */
+    (*do_dct) (workspace);
+
+    /* Quantize/descale the coefficients, and store into coef_blocks[] */
+    { register DCTELEM temp, qval;
+      register int i;
+      register JCOEFPTR output_ptr = coef_blocks[bi];
+
+      for (i = 0; i < DCTSIZE2; i++) {
+	qval = divisors[i];
+	temp = workspace[i];
+	/* Divide the coefficient value by qval, ensuring proper rounding.
+	 * Since C does not specify the direction of rounding for negative
+	 * quotients, we have to force the dividend positive for portability.
+	 *
+	 * In most files, at least half of the output values will be zero
+	 * (at default quantization settings, more like three-quarters...)
+	 * so we should ensure that this case is fast.  On many machines,
+	 * a comparison is enough cheaper than a divide to make a special test
+	 * a win.  Since both inputs will be nonnegative, we need only test
+	 * for a < b to discover whether a/b is 0.
+	 * If your machine's division is fast enough, define FAST_DIVIDE.
+	 */
+#ifdef FAST_DIVIDE
+#define DIVIDE_BY(a,b)	a /= b
+#else
+#define DIVIDE_BY(a,b)	if (a >= b) a /= b; else a = 0
+#endif
+	if (temp < 0) {
+	  temp = -temp;
+	  temp += qval>>1;	/* for rounding */
+	  DIVIDE_BY(temp, qval);
+	  temp = -temp;
+	} else {
+	  temp += qval>>1;	/* for rounding */
+	  DIVIDE_BY(temp, qval);
+	}
+	output_ptr[i] = (JCOEF) temp;
+      }
+    }
+  }
+}
+
+
+#ifdef DCT_FLOAT_SUPPORTED
+
+METHODDEF(void)
+forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
+		   JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
+		   JDIMENSION start_row, JDIMENSION start_col,
+		   JDIMENSION num_blocks)
+/* This version is used for floating-point DCT implementations. */
+{
+  /* This routine is heavily used, so it's worth coding it tightly. */
+  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
+  float_DCT_method_ptr do_dct = fdct->do_float_dct;
+  FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];
+  FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
+  JDIMENSION bi;
+
+  sample_data += start_row;	/* fold in the vertical offset once */
+
+  for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
+    /* Load data into workspace, applying unsigned->signed conversion */
+    { register FAST_FLOAT *workspaceptr;
+      register JSAMPROW elemptr;
+      register int elemr;
+
+      workspaceptr = workspace;
+      for (elemr = 0; elemr < DCTSIZE; elemr++) {
+	elemptr = sample_data[elemr] + start_col;
+#if DCTSIZE == 8		/* unroll the inner loop */
+	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+#else
+	{ register int elemc;
+	  for (elemc = DCTSIZE; elemc > 0; elemc--) {
+	    *workspaceptr++ = (FAST_FLOAT)
+	      (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+	  }
+	}
+#endif
+      }
+    }
+
+    /* Perform the DCT */
+    (*do_dct) (workspace);
+
+    /* Quantize/descale the coefficients, and store into coef_blocks[] */
+    { register FAST_FLOAT temp;
+      register int i;
+      register JCOEFPTR output_ptr = coef_blocks[bi];
+
+      for (i = 0; i < DCTSIZE2; i++) {
+	/* Apply the quantization and scaling factor */
+	temp = workspace[i] * divisors[i];
+	/* Round to nearest integer.
+	 * Since C does not specify the direction of rounding for negative
+	 * quotients, we have to force the dividend positive for portability.
+	 * The maximum coefficient size is +-16K (for 12-bit data), so this
+	 * code should work for either 16-bit or 32-bit ints.
+	 */
+	output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
+      }
+    }
+  }
+}
+
+#endif /* DCT_FLOAT_SUPPORTED */
+
+
+/*
+ * Initialize FDCT manager.
+ */
+
+GLOBAL(void)
+jinit_forward_dct (j_compress_ptr cinfo)
+{
+  my_fdct_ptr fdct;
+  int i;
+
+  fdct = (my_fdct_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_fdct_controller));
+  cinfo->fdct = (struct jpeg_forward_dct *) fdct;
+  fdct->pub.start_pass = start_pass_fdctmgr;
+
+  switch (cinfo->dct_method) {
+#ifdef DCT_ISLOW_SUPPORTED
+  case JDCT_ISLOW:
+    fdct->pub.forward_DCT = forward_DCT;
+    fdct->do_dct = jpeg_fdct_islow;
+    break;
+#endif
+#ifdef DCT_IFAST_SUPPORTED
+  case JDCT_IFAST:
+    fdct->pub.forward_DCT = forward_DCT;
+    fdct->do_dct = jpeg_fdct_ifast;
+    break;
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+  case JDCT_FLOAT:
+    fdct->pub.forward_DCT = forward_DCT_float;
+    fdct->do_float_dct = jpeg_fdct_float;
+    break;
+#endif
+  default:
+    ERREXIT(cinfo, JERR_NOT_COMPILED);
+    break;
+  }
+
+  /* Mark divisor tables unallocated */
+  for (i = 0; i < NUM_QUANT_TBLS; i++) {
+    fdct->divisors[i] = NULL;
+#ifdef DCT_FLOAT_SUPPORTED
+    fdct->float_divisors[i] = NULL;
+#endif
+  }
+}
diff --git a/src/libjpeg/jchuff.c b/src/libjpeg/jchuff.c
new file mode 100644
index 0000000..16d9366
--- /dev/null
+++ b/src/libjpeg/jchuff.c
@@ -0,0 +1,909 @@
+/*
+ * jchuff.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains Huffman entropy encoding routines.
+ *
+ * Much of the complexity here has to do with supporting output suspension.
+ * If the data destination module demands suspension, we want to be able to
+ * back up to the start of the current MCU.  To do this, we copy state
+ * variables into local working storage, and update them back to the
+ * permanent JPEG objects only upon successful completion of an MCU.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jchuff.h"		/* Declarations shared with jcphuff.c */
+
+
+/* Expanded entropy encoder object for Huffman encoding.
+ *
+ * The savable_state subrecord contains fields that change within an MCU,
+ * but must not be updated permanently until we complete the MCU.
+ */
+
+typedef struct {
+  INT32 put_buffer;		/* current bit-accumulation buffer */
+  int put_bits;			/* # of bits now in it */
+  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
+} savable_state;
+
+/* This macro is to work around compilers with missing or broken
+ * structure assignment.  You'll need to fix this code if you have
+ * such a compiler and you change MAX_COMPS_IN_SCAN.
+ */
+
+#ifndef NO_STRUCT_ASSIGN
+#define ASSIGN_STATE(dest,src)  ((dest) = (src))
+#else
+#if MAX_COMPS_IN_SCAN == 4
+#define ASSIGN_STATE(dest,src)  \
+	((dest).put_buffer = (src).put_buffer, \
+	 (dest).put_bits = (src).put_bits, \
+	 (dest).last_dc_val[0] = (src).last_dc_val[0], \
+	 (dest).last_dc_val[1] = (src).last_dc_val[1], \
+	 (dest).last_dc_val[2] = (src).last_dc_val[2], \
+	 (dest).last_dc_val[3] = (src).last_dc_val[3])
+#endif
+#endif
+
+
+typedef struct {
+  struct jpeg_entropy_encoder pub; /* public fields */
+
+  savable_state saved;		/* Bit buffer & DC state at start of MCU */
+
+  /* These fields are NOT loaded into local working state. */
+  unsigned int restarts_to_go;	/* MCUs left in this restart interval */
+  int next_restart_num;		/* next restart number to write (0-7) */
+
+  /* Pointers to derived tables (these workspaces have image lifespan) */
+  c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
+  c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
+
+#ifdef ENTROPY_OPT_SUPPORTED	/* Statistics tables for optimization */
+  long * dc_count_ptrs[NUM_HUFF_TBLS];
+  long * ac_count_ptrs[NUM_HUFF_TBLS];
+#endif
+} huff_entropy_encoder;
+
+typedef huff_entropy_encoder * huff_entropy_ptr;
+
+/* Working state while writing an MCU.
+ * This struct contains all the fields that are needed by subroutines.
+ */
+
+typedef struct {
+  JOCTET * next_output_byte;	/* => next byte to write in buffer */
+  size_t free_in_buffer;	/* # of byte spaces remaining in buffer */
+  savable_state cur;		/* Current bit buffer & DC state */
+  j_compress_ptr cinfo;		/* dump_buffer needs access to this */
+} working_state;
+
+
+/* Forward declarations */
+METHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo,
+					JBLOCKROW *MCU_data));
+METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo));
+#ifdef ENTROPY_OPT_SUPPORTED
+METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo,
+					  JBLOCKROW *MCU_data));
+METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo));
+#endif
+
+
+/*
+ * Initialize for a Huffman-compressed scan.
+ * If gather_statistics is TRUE, we do not output anything during the scan,
+ * just count the Huffman symbols used and generate Huffman code tables.
+ */
+
+METHODDEF(void)
+start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
+{
+  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+  int ci, dctbl, actbl;
+  jpeg_component_info * compptr;
+
+  if (gather_statistics) {
+#ifdef ENTROPY_OPT_SUPPORTED
+    entropy->pub.encode_mcu = encode_mcu_gather;
+    entropy->pub.finish_pass = finish_pass_gather;
+#else
+    ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+  } else {
+    entropy->pub.encode_mcu = encode_mcu_huff;
+    entropy->pub.finish_pass = finish_pass_huff;
+  }
+
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    compptr = cinfo->cur_comp_info[ci];
+    dctbl = compptr->dc_tbl_no;
+    actbl = compptr->ac_tbl_no;
+    if (gather_statistics) {
+#ifdef ENTROPY_OPT_SUPPORTED
+      /* Check for invalid table indexes */
+      /* (make_c_derived_tbl does this in the other path) */
+      if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS)
+	ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl);
+      if (actbl < 0 || actbl >= NUM_HUFF_TBLS)
+	ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl);
+      /* Allocate and zero the statistics tables */
+      /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
+      if (entropy->dc_count_ptrs[dctbl] == NULL)
+	entropy->dc_count_ptrs[dctbl] = (long *)
+	  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				      257 * SIZEOF(long));
+      MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long));
+      if (entropy->ac_count_ptrs[actbl] == NULL)
+	entropy->ac_count_ptrs[actbl] = (long *)
+	  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				      257 * SIZEOF(long));
+      MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long));
+#endif
+    } else {
+      /* Compute derived values for Huffman tables */
+      /* We may do this more than once for a table, but it's not expensive */
+      jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl,
+			      & entropy->dc_derived_tbls[dctbl]);
+      jpeg_make_c_derived_tbl(cinfo, FALSE, actbl,
+			      & entropy->ac_derived_tbls[actbl]);
+    }
+    /* Initialize DC predictions to 0 */
+    entropy->saved.last_dc_val[ci] = 0;
+  }
+
+  /* Initialize bit buffer to empty */
+  entropy->saved.put_buffer = 0;
+  entropy->saved.put_bits = 0;
+
+  /* Initialize restart stuff */
+  entropy->restarts_to_go = cinfo->restart_interval;
+  entropy->next_restart_num = 0;
+}
+
+
+/*
+ * Compute the derived values for a Huffman table.
+ * This routine also performs some validation checks on the table.
+ *
+ * Note this is also used by jcphuff.c.
+ */
+
+GLOBAL(void)
+jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
+			 c_derived_tbl ** pdtbl)
+{
+  JHUFF_TBL *htbl;
+  c_derived_tbl *dtbl;
+  int p, i, l, lastp, si, maxsymbol;
+  char huffsize[257];
+  unsigned int huffcode[257];
+  unsigned int code;
+
+  /* Note that huffsize[] and huffcode[] are filled in code-length order,
+   * paralleling the order of the symbols themselves in htbl->huffval[].
+   */
+
+  /* Find the input Huffman table */
+  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
+    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
+  htbl =
+    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
+  if (htbl == NULL)
+    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
+
+  /* Allocate a workspace if we haven't already done so. */
+  if (*pdtbl == NULL)
+    *pdtbl = (c_derived_tbl *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(c_derived_tbl));
+  dtbl = *pdtbl;
+  
+  /* Figure C.1: make table of Huffman code length for each symbol */
+
+  p = 0;
+  for (l = 1; l <= 16; l++) {
+    i = (int) htbl->bits[l];
+    if (i < 0 || p + i > 256)	/* protect against table overrun */
+      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+    while (i--)
+      huffsize[p++] = (char) l;
+  }
+  huffsize[p] = 0;
+  lastp = p;
+  
+  /* Figure C.2: generate the codes themselves */
+  /* We also validate that the counts represent a legal Huffman code tree. */
+
+  code = 0;
+  si = huffsize[0];
+  p = 0;
+  while (huffsize[p]) {
+    while (((int) huffsize[p]) == si) {
+      huffcode[p++] = code;
+      code++;
+    }
+    /* code is now 1 more than the last code used for codelength si; but
+     * it must still fit in si bits, since no code is allowed to be all ones.
+     */
+    if (((INT32) code) >= (((INT32) 1) << si))
+      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+    code <<= 1;
+    si++;
+  }
+  
+  /* Figure C.3: generate encoding tables */
+  /* These are code and size indexed by symbol value */
+
+  /* Set all codeless symbols to have code length 0;
+   * this lets us detect duplicate VAL entries here, and later
+   * allows emit_bits to detect any attempt to emit such symbols.
+   */
+  MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi));
+
+  /* This is also a convenient place to check for out-of-range
+   * and duplicated VAL entries.  We allow 0..255 for AC symbols
+   * but only 0..15 for DC.  (We could constrain them further
+   * based on data depth and mode, but this seems enough.)
+   */
+  maxsymbol = isDC ? 15 : 255;
+
+  for (p = 0; p < lastp; p++) {
+    i = htbl->huffval[p];
+    if (i < 0 || i > maxsymbol || dtbl->ehufsi[i])
+      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+    dtbl->ehufco[i] = huffcode[p];
+    dtbl->ehufsi[i] = huffsize[p];
+  }
+}
+
+
+/* Outputting bytes to the file */
+
+/* Emit a byte, taking 'action' if must suspend. */
+#define emit_byte(state,val,action)  \
+	{ *(state)->next_output_byte++ = (JOCTET) (val);  \
+	  if (--(state)->free_in_buffer == 0)  \
+	    if (! dump_buffer(state))  \
+	      { action; } }
+
+
+LOCAL(boolean)
+dump_buffer (working_state * state)
+/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */
+{
+  struct jpeg_destination_mgr * dest = state->cinfo->dest;
+
+  if (! (*dest->empty_output_buffer) (state->cinfo))
+    return FALSE;
+  /* After a successful buffer dump, must reset buffer pointers */
+  state->next_output_byte = dest->next_output_byte;
+  state->free_in_buffer = dest->free_in_buffer;
+  return TRUE;
+}
+
+
+/* Outputting bits to the file */
+
+/* Only the right 24 bits of put_buffer are used; the valid bits are
+ * left-justified in this part.  At most 16 bits can be passed to emit_bits
+ * in one call, and we never retain more than 7 bits in put_buffer
+ * between calls, so 24 bits are sufficient.
+ */
+
+INLINE
+LOCAL(boolean)
+emit_bits (working_state * state, unsigned int code, int size)
+/* Emit some bits; return TRUE if successful, FALSE if must suspend */
+{
+  /* This routine is heavily used, so it's worth coding tightly. */
+  register INT32 put_buffer = (INT32) code;
+  register int put_bits = state->cur.put_bits;
+
+  /* if size is 0, caller used an invalid Huffman table entry */
+  if (size == 0)
+    ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
+
+  put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
+  
+  put_bits += size;		/* new number of bits in buffer */
+  
+  put_buffer <<= 24 - put_bits; /* align incoming bits */
+
+  put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */
+  
+  while (put_bits >= 8) {
+    int c = (int) ((put_buffer >> 16) & 0xFF);
+    
+    emit_byte(state, c, return FALSE);
+    if (c == 0xFF) {		/* need to stuff a zero byte? */
+      emit_byte(state, 0, return FALSE);
+    }
+    put_buffer <<= 8;
+    put_bits -= 8;
+  }
+
+  state->cur.put_buffer = put_buffer; /* update state variables */
+  state->cur.put_bits = put_bits;
+
+  return TRUE;
+}
+
+
+LOCAL(boolean)
+flush_bits (working_state * state)
+{
+  if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */
+    return FALSE;
+  state->cur.put_buffer = 0;	/* and reset bit-buffer to empty */
+  state->cur.put_bits = 0;
+  return TRUE;
+}
+
+
+/* Encode a single block's worth of coefficients */
+
+LOCAL(boolean)
+encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
+		  c_derived_tbl *dctbl, c_derived_tbl *actbl)
+{
+  register int temp, temp2;
+  register int nbits;
+  register int k, r, i;
+  
+  /* Encode the DC coefficient difference per section F.1.2.1 */
+  
+  temp = temp2 = block[0] - last_dc_val;
+
+  if (temp < 0) {
+    temp = -temp;		/* temp is abs value of input */
+    /* For a negative input, want temp2 = bitwise complement of abs(input) */
+    /* This code assumes we are on a two's complement machine */
+    temp2--;
+  }
+  
+  /* Find the number of bits needed for the magnitude of the coefficient */
+  nbits = 0;
+  while (temp) {
+    nbits++;
+    temp >>= 1;
+  }
+  /* Check for out-of-range coefficient values.
+   * Since we're encoding a difference, the range limit is twice as much.
+   */
+  if (nbits > MAX_COEF_BITS+1)
+    ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
+  
+  /* Emit the Huffman-coded symbol for the number of bits */
+  if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits]))
+    return FALSE;
+
+  /* Emit that number of bits of the value, if positive, */
+  /* or the complement of its magnitude, if negative. */
+  if (nbits)			/* emit_bits rejects calls with size 0 */
+    if (! emit_bits(state, (unsigned int) temp2, nbits))
+      return FALSE;
+
+  /* Encode the AC coefficients per section F.1.2.2 */
+  
+  r = 0;			/* r = run length of zeros */
+  
+  for (k = 1; k < DCTSIZE2; k++) {
+    if ((temp = block[jpeg_natural_order[k]]) == 0) {
+      r++;
+    } else {
+      /* if run length > 15, must emit special run-length-16 codes (0xF0) */
+      while (r > 15) {
+	if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0]))
+	  return FALSE;
+	r -= 16;
+      }
+
+      temp2 = temp;
+      if (temp < 0) {
+	temp = -temp;		/* temp is abs value of input */
+	/* This code assumes we are on a two's complement machine */
+	temp2--;
+      }
+      
+      /* Find the number of bits needed for the magnitude of the coefficient */
+      nbits = 1;		/* there must be at least one 1 bit */
+      while ((temp >>= 1))
+	nbits++;
+      /* Check for out-of-range coefficient values */
+      if (nbits > MAX_COEF_BITS)
+	ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
+      
+      /* Emit Huffman symbol for run length / number of bits */
+      i = (r << 4) + nbits;
+      if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i]))
+	return FALSE;
+
+      /* Emit that number of bits of the value, if positive, */
+      /* or the complement of its magnitude, if negative. */
+      if (! emit_bits(state, (unsigned int) temp2, nbits))
+	return FALSE;
+      
+      r = 0;
+    }
+  }
+
+  /* If the last coef(s) were zero, emit an end-of-block code */
+  if (r > 0)
+    if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0]))
+      return FALSE;
+
+  return TRUE;
+}
+
+
+/*
+ * Emit a restart marker & resynchronize predictions.
+ */
+
+LOCAL(boolean)
+emit_restart (working_state * state, int restart_num)
+{
+  int ci;
+
+  if (! flush_bits(state))
+    return FALSE;
+
+  emit_byte(state, 0xFF, return FALSE);
+  emit_byte(state, JPEG_RST0 + restart_num, return FALSE);
+
+  /* Re-initialize DC predictions to 0 */
+  for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)
+    state->cur.last_dc_val[ci] = 0;
+
+  /* The restart counter is not updated until we successfully write the MCU. */
+
+  return TRUE;
+}
+
+
+/*
+ * Encode and output one MCU's worth of Huffman-compressed coefficients.
+ */
+
+METHODDEF(boolean)
+encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+  working_state state;
+  int blkn, ci;
+  jpeg_component_info * compptr;
+
+  /* Load up working state */
+  state.next_output_byte = cinfo->dest->next_output_byte;
+  state.free_in_buffer = cinfo->dest->free_in_buffer;
+  ASSIGN_STATE(state.cur, entropy->saved);
+  state.cinfo = cinfo;
+
+  /* Emit restart marker if needed */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0)
+      if (! emit_restart(&state, entropy->next_restart_num))
+	return FALSE;
+  }
+
+  /* Encode the MCU data blocks */
+  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+    ci = cinfo->MCU_membership[blkn];
+    compptr = cinfo->cur_comp_info[ci];
+    if (! encode_one_block(&state,
+			   MCU_data[blkn][0], state.cur.last_dc_val[ci],
+			   entropy->dc_derived_tbls[compptr->dc_tbl_no],
+			   entropy->ac_derived_tbls[compptr->ac_tbl_no]))
+      return FALSE;
+    /* Update last_dc_val */
+    state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];
+  }
+
+  /* Completed MCU, so update state */
+  cinfo->dest->next_output_byte = state.next_output_byte;
+  cinfo->dest->free_in_buffer = state.free_in_buffer;
+  ASSIGN_STATE(entropy->saved, state.cur);
+
+  /* Update restart-interval state too */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0) {
+      entropy->restarts_to_go = cinfo->restart_interval;
+      entropy->next_restart_num++;
+      entropy->next_restart_num &= 7;
+    }
+    entropy->restarts_to_go--;
+  }
+
+  return TRUE;
+}
+
+
+/*
+ * Finish up at the end of a Huffman-compressed scan.
+ */
+
+METHODDEF(void)
+finish_pass_huff (j_compress_ptr cinfo)
+{
+  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+  working_state state;
+
+  /* Load up working state ... flush_bits needs it */
+  state.next_output_byte = cinfo->dest->next_output_byte;
+  state.free_in_buffer = cinfo->dest->free_in_buffer;
+  ASSIGN_STATE(state.cur, entropy->saved);
+  state.cinfo = cinfo;
+
+  /* Flush out the last data */
+  if (! flush_bits(&state))
+    ERREXIT(cinfo, JERR_CANT_SUSPEND);
+
+  /* Update state */
+  cinfo->dest->next_output_byte = state.next_output_byte;
+  cinfo->dest->free_in_buffer = state.free_in_buffer;
+  ASSIGN_STATE(entropy->saved, state.cur);
+}
+
+
+/*
+ * Huffman coding optimization.
+ *
+ * We first scan the supplied data and count the number of uses of each symbol
+ * that is to be Huffman-coded. (This process MUST agree with the code above.)
+ * Then we build a Huffman coding tree for the observed counts.
+ * Symbols which are not needed at all for the particular image are not
+ * assigned any code, which saves space in the DHT marker as well as in
+ * the compressed data.
+ */
+
+#ifdef ENTROPY_OPT_SUPPORTED
+
+
+/* Process a single block's worth of coefficients */
+
+LOCAL(void)
+htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
+		 long dc_counts[], long ac_counts[])
+{
+  register int temp;
+  register int nbits;
+  register int k, r;
+  
+  /* Encode the DC coefficient difference per section F.1.2.1 */
+  
+  temp = block[0] - last_dc_val;
+  if (temp < 0)
+    temp = -temp;
+  
+  /* Find the number of bits needed for the magnitude of the coefficient */
+  nbits = 0;
+  while (temp) {
+    nbits++;
+    temp >>= 1;
+  }
+  /* Check for out-of-range coefficient values.
+   * Since we're encoding a difference, the range limit is twice as much.
+   */
+  if (nbits > MAX_COEF_BITS+1)
+    ERREXIT(cinfo, JERR_BAD_DCT_COEF);
+
+  /* Count the Huffman symbol for the number of bits */
+  dc_counts[nbits]++;
+  
+  /* Encode the AC coefficients per section F.1.2.2 */
+  
+  r = 0;			/* r = run length of zeros */
+  
+  for (k = 1; k < DCTSIZE2; k++) {
+    if ((temp = block[jpeg_natural_order[k]]) == 0) {
+      r++;
+    } else {
+      /* if run length > 15, must emit special run-length-16 codes (0xF0) */
+      while (r > 15) {
+	ac_counts[0xF0]++;
+	r -= 16;
+      }
+      
+      /* Find the number of bits needed for the magnitude of the coefficient */
+      if (temp < 0)
+	temp = -temp;
+      
+      /* Find the number of bits needed for the magnitude of the coefficient */
+      nbits = 1;		/* there must be at least one 1 bit */
+      while ((temp >>= 1))
+	nbits++;
+      /* Check for out-of-range coefficient values */
+      if (nbits > MAX_COEF_BITS)
+	ERREXIT(cinfo, JERR_BAD_DCT_COEF);
+      
+      /* Count Huffman symbol for run length / number of bits */
+      ac_counts[(r << 4) + nbits]++;
+      
+      r = 0;
+    }
+  }
+
+  /* If the last coef(s) were zero, emit an end-of-block code */
+  if (r > 0)
+    ac_counts[0]++;
+}
+
+
+/*
+ * Trial-encode one MCU's worth of Huffman-compressed coefficients.
+ * No data is actually output, so no suspension return is possible.
+ */
+
+METHODDEF(boolean)
+encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+  int blkn, ci;
+  jpeg_component_info * compptr;
+
+  /* Take care of restart intervals if needed */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0) {
+      /* Re-initialize DC predictions to 0 */
+      for (ci = 0; ci < cinfo->comps_in_scan; ci++)
+	entropy->saved.last_dc_val[ci] = 0;
+      /* Update restart state */
+      entropy->restarts_to_go = cinfo->restart_interval;
+    }
+    entropy->restarts_to_go--;
+  }
+
+  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+    ci = cinfo->MCU_membership[blkn];
+    compptr = cinfo->cur_comp_info[ci];
+    htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],
+		    entropy->dc_count_ptrs[compptr->dc_tbl_no],
+		    entropy->ac_count_ptrs[compptr->ac_tbl_no]);
+    entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];
+  }
+
+  return TRUE;
+}
+
+
+/*
+ * Generate the best Huffman code table for the given counts, fill htbl.
+ * Note this is also used by jcphuff.c.
+ *
+ * The JPEG standard requires that no symbol be assigned a codeword of all
+ * one bits (so that padding bits added at the end of a compressed segment
+ * can't look like a valid code).  Because of the canonical ordering of
+ * codewords, this just means that there must be an unused slot in the
+ * longest codeword length category.  Section K.2 of the JPEG spec suggests
+ * reserving such a slot by pretending that symbol 256 is a valid symbol
+ * with count 1.  In theory that's not optimal; giving it count zero but
+ * including it in the symbol set anyway should give a better Huffman code.
+ * But the theoretically better code actually seems to come out worse in
+ * practice, because it produces more all-ones bytes (which incur stuffed
+ * zero bytes in the final file).  In any case the difference is tiny.
+ *
+ * The JPEG standard requires Huffman codes to be no more than 16 bits long.
+ * If some symbols have a very small but nonzero probability, the Huffman tree
+ * must be adjusted to meet the code length restriction.  We currently use
+ * the adjustment method suggested in JPEG section K.2.  This method is *not*
+ * optimal; it may not choose the best possible limited-length code.  But
+ * typically only very-low-frequency symbols will be given less-than-optimal
+ * lengths, so the code is almost optimal.  Experimental comparisons against
+ * an optimal limited-length-code algorithm indicate that the difference is
+ * microscopic --- usually less than a hundredth of a percent of total size.
+ * So the extra complexity of an optimal algorithm doesn't seem worthwhile.
+ */
+
+GLOBAL(void)
+jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
+{
+#define MAX_CLEN 32		/* assumed maximum initial code length */
+  UINT8 bits[MAX_CLEN+1];	/* bits[k] = # of symbols with code length k */
+  int codesize[257];		/* codesize[k] = code length of symbol k */
+  int others[257];		/* next symbol in current branch of tree */
+  int c1, c2;
+  int p, i, j;
+  long v;
+
+  /* This algorithm is explained in section K.2 of the JPEG standard */
+
+  MEMZERO(bits, SIZEOF(bits));
+  MEMZERO(codesize, SIZEOF(codesize));
+  for (i = 0; i < 257; i++)
+    others[i] = -1;		/* init links to empty */
+  
+  freq[256] = 1;		/* make sure 256 has a nonzero count */
+  /* Including the pseudo-symbol 256 in the Huffman procedure guarantees
+   * that no real symbol is given code-value of all ones, because 256
+   * will be placed last in the largest codeword category.
+   */
+
+  /* Huffman's basic algorithm to assign optimal code lengths to symbols */
+
+  for (;;) {
+    /* Find the smallest nonzero frequency, set c1 = its symbol */
+    /* In case of ties, take the larger symbol number */
+    c1 = -1;
+    v = 1000000000L;
+    for (i = 0; i <= 256; i++) {
+      if (freq[i] && freq[i] <= v) {
+	v = freq[i];
+	c1 = i;
+      }
+    }
+
+    /* Find the next smallest nonzero frequency, set c2 = its symbol */
+    /* In case of ties, take the larger symbol number */
+    c2 = -1;
+    v = 1000000000L;
+    for (i = 0; i <= 256; i++) {
+      if (freq[i] && freq[i] <= v && i != c1) {
+	v = freq[i];
+	c2 = i;
+      }
+    }
+
+    /* Done if we've merged everything into one frequency */
+    if (c2 < 0)
+      break;
+    
+    /* Else merge the two counts/trees */
+    freq[c1] += freq[c2];
+    freq[c2] = 0;
+
+    /* Increment the codesize of everything in c1's tree branch */
+    codesize[c1]++;
+    while (others[c1] >= 0) {
+      c1 = others[c1];
+      codesize[c1]++;
+    }
+    
+    others[c1] = c2;		/* chain c2 onto c1's tree branch */
+    
+    /* Increment the codesize of everything in c2's tree branch */
+    codesize[c2]++;
+    while (others[c2] >= 0) {
+      c2 = others[c2];
+      codesize[c2]++;
+    }
+  }
+
+  /* Now count the number of symbols of each code length */
+  for (i = 0; i <= 256; i++) {
+    if (codesize[i]) {
+      /* The JPEG standard seems to think that this can't happen, */
+      /* but I'm paranoid... */
+      if (codesize[i] > MAX_CLEN)
+	ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);
+
+      bits[codesize[i]]++;
+    }
+  }
+
+  /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure
+   * Huffman procedure assigned any such lengths, we must adjust the coding.
+   * Here is what the JPEG spec says about how this next bit works:
+   * Since symbols are paired for the longest Huffman code, the symbols are
+   * removed from this length category two at a time.  The prefix for the pair
+   * (which is one bit shorter) is allocated to one of the pair; then,
+   * skipping the BITS entry for that prefix length, a code word from the next
+   * shortest nonzero BITS entry is converted into a prefix for two code words
+   * one bit longer.
+   */
+  
+  for (i = MAX_CLEN; i > 16; i--) {
+    while (bits[i] > 0) {
+      j = i - 2;		/* find length of new prefix to be used */
+      while (bits[j] == 0)
+	j--;
+      
+      bits[i] -= 2;		/* remove two symbols */
+      bits[i-1]++;		/* one goes in this length */
+      bits[j+1] += 2;		/* two new symbols in this length */
+      bits[j]--;		/* symbol of this length is now a prefix */
+    }
+  }
+
+  /* Remove the count for the pseudo-symbol 256 from the largest codelength */
+  while (bits[i] == 0)		/* find largest codelength still in use */
+    i--;
+  bits[i]--;
+  
+  /* Return final symbol counts (only for lengths 0..16) */
+  MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
+  
+  /* Return a list of the symbols sorted by code length */
+  /* It's not real clear to me why we don't need to consider the codelength
+   * changes made above, but the JPEG spec seems to think this works.
+   */
+  p = 0;
+  for (i = 1; i <= MAX_CLEN; i++) {
+    for (j = 0; j <= 255; j++) {
+      if (codesize[j] == i) {
+	htbl->huffval[p] = (UINT8) j;
+	p++;
+      }
+    }
+  }
+
+  /* Set sent_table FALSE so updated table will be written to JPEG file. */
+  htbl->sent_table = FALSE;
+}
+
+
+/*
+ * Finish up a statistics-gathering pass and create the new Huffman tables.
+ */
+
+METHODDEF(void)
+finish_pass_gather (j_compress_ptr cinfo)
+{
+  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+  int ci, dctbl, actbl;
+  jpeg_component_info * compptr;
+  JHUFF_TBL **htblptr;
+  boolean did_dc[NUM_HUFF_TBLS];
+  boolean did_ac[NUM_HUFF_TBLS];
+
+  /* It's important not to apply jpeg_gen_optimal_table more than once
+   * per table, because it clobbers the input frequency counts!
+   */
+  MEMZERO(did_dc, SIZEOF(did_dc));
+  MEMZERO(did_ac, SIZEOF(did_ac));
+
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    compptr = cinfo->cur_comp_info[ci];
+    dctbl = compptr->dc_tbl_no;
+    actbl = compptr->ac_tbl_no;
+    if (! did_dc[dctbl]) {
+      htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl];
+      if (*htblptr == NULL)
+	*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
+      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]);
+      did_dc[dctbl] = TRUE;
+    }
+    if (! did_ac[actbl]) {
+      htblptr = & cinfo->ac_huff_tbl_ptrs[actbl];
+      if (*htblptr == NULL)
+	*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
+      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]);
+      did_ac[actbl] = TRUE;
+    }
+  }
+}
+
+
+#endif /* ENTROPY_OPT_SUPPORTED */
+
+
+/*
+ * Module initialization routine for Huffman entropy encoding.
+ */
+
+GLOBAL(void)
+jinit_huff_encoder (j_compress_ptr cinfo)
+{
+  huff_entropy_ptr entropy;
+  int i;
+
+  entropy = (huff_entropy_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(huff_entropy_encoder));
+  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
+  entropy->pub.start_pass = start_pass_huff;
+
+  /* Mark tables unallocated */
+  for (i = 0; i < NUM_HUFF_TBLS; i++) {
+    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
+#ifdef ENTROPY_OPT_SUPPORTED
+    entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL;
+#endif
+  }
+}
diff --git a/src/libjpeg/jchuff.h b/src/libjpeg/jchuff.h
new file mode 100644
index 0000000..8c02c09
--- /dev/null
+++ b/src/libjpeg/jchuff.h
@@ -0,0 +1,47 @@
+/*
+ * jchuff.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains declarations for Huffman entropy encoding routines
+ * that are shared between the sequential encoder (jchuff.c) and the
+ * progressive encoder (jcphuff.c).  No other modules need to see these.
+ */
+
+/* The legal range of a DCT coefficient is
+ *  -1024 .. +1023  for 8-bit data;
+ * -16384 .. +16383 for 12-bit data.
+ * Hence the magnitude should always fit in 10 or 14 bits respectively.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define MAX_COEF_BITS 10
+#else
+#define MAX_COEF_BITS 14
+#endif
+
+/* Derived data constructed for each Huffman table */
+
+typedef struct {
+  unsigned int ehufco[256];	/* code for each symbol */
+  char ehufsi[256];		/* length of code for each symbol */
+  /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
+} c_derived_tbl;
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_make_c_derived_tbl	jMkCDerived
+#define jpeg_gen_optimal_table	jGenOptTbl
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+/* Expand a Huffman table definition into the derived format */
+EXTERN(void) jpeg_make_c_derived_tbl
+	JPP((j_compress_ptr cinfo, boolean isDC, int tblno,
+	     c_derived_tbl ** pdtbl));
+
+/* Generate an optimal table definition given the specified counts */
+EXTERN(void) jpeg_gen_optimal_table
+	JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));
diff --git a/src/libjpeg/jcinit.c b/src/libjpeg/jcinit.c
new file mode 100644
index 0000000..19de8d0
--- /dev/null
+++ b/src/libjpeg/jcinit.c
@@ -0,0 +1,72 @@
+/*
+ * jcinit.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains initialization logic for the JPEG compressor.
+ * This routine is in charge of selecting the modules to be executed and
+ * making an initialization call to each one.
+ *
+ * Logically, this code belongs in jcmaster.c.  It's split out because
+ * linking this routine implies linking the entire compression library.
+ * For a transcoding-only application, we want to be able to use jcmaster.c
+ * without linking in the whole library.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Master selection of compression modules.
+ * This is done once at the start of processing an image.  We determine
+ * which modules will be used and give them appropriate initialization calls.
+ */
+
+GLOBAL(void)
+jinit_compress_master (j_compress_ptr cinfo)
+{
+  /* Initialize master control (includes parameter checking/processing) */
+  jinit_c_master_control(cinfo, FALSE /* full compression */);
+
+  /* Preprocessing */
+  if (! cinfo->raw_data_in) {
+    jinit_color_converter(cinfo);
+    jinit_downsampler(cinfo);
+    jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);
+  }
+  /* Forward DCT */
+  jinit_forward_dct(cinfo);
+  /* Entropy encoding: either Huffman or arithmetic coding. */
+  if (cinfo->arith_code) {
+    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
+  } else {
+    if (cinfo->progressive_mode) {
+#ifdef C_PROGRESSIVE_SUPPORTED
+      jinit_phuff_encoder(cinfo);
+#else
+      ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+    } else
+      jinit_huff_encoder(cinfo);
+  }
+
+  /* Need a full-image coefficient buffer in any multi-pass mode. */
+  jinit_c_coef_controller(cinfo,
+		(boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
+  jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
+
+  jinit_marker_writer(cinfo);
+
+  /* We can now tell the memory manager to allocate virtual arrays. */
+  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
+
+  /* Write the datastream header (SOI) immediately.
+   * Frame and scan headers are postponed till later.
+   * This lets application insert special markers after the SOI.
+   */
+  (*cinfo->marker->write_file_header) (cinfo);
+}
diff --git a/src/libjpeg/jcmainct.c b/src/libjpeg/jcmainct.c
new file mode 100644
index 0000000..14aa4c7
--- /dev/null
+++ b/src/libjpeg/jcmainct.c
@@ -0,0 +1,293 @@
+/*
+ * jcmainct.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the main buffer controller for compression.
+ * The main buffer lies between the pre-processor and the JPEG
+ * compressor proper; it holds downsampled data in the JPEG colorspace.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Note: currently, there is no operating mode in which a full-image buffer
+ * is needed at this step.  If there were, that mode could not be used with
+ * "raw data" input, since this module is bypassed in that case.  However,
+ * we've left the code here for possible use in special applications.
+ */
+#undef FULL_MAIN_BUFFER_SUPPORTED
+
+
+/* Private buffer controller object */
+
+typedef struct {
+  struct jpeg_c_main_controller pub; /* public fields */
+
+  JDIMENSION cur_iMCU_row;	/* number of current iMCU row */
+  JDIMENSION rowgroup_ctr;	/* counts row groups received in iMCU row */
+  boolean suspended;		/* remember if we suspended output */
+  J_BUF_MODE pass_mode;		/* current operating mode */
+
+  /* If using just a strip buffer, this points to the entire set of buffers
+   * (we allocate one for each component).  In the full-image case, this
+   * points to the currently accessible strips of the virtual arrays.
+   */
+  JSAMPARRAY buffer[MAX_COMPONENTS];
+
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+  /* If using full-image storage, this array holds pointers to virtual-array
+   * control blocks for each component.  Unused if not full-image storage.
+   */
+  jvirt_sarray_ptr whole_image[MAX_COMPONENTS];
+#endif
+} my_main_controller;
+
+typedef my_main_controller * my_main_ptr;
+
+
+/* Forward declarations */
+METHODDEF(void) process_data_simple_main
+	JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
+	     JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+METHODDEF(void) process_data_buffer_main
+	JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
+	     JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
+#endif
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+  my_main_ptr main = (my_main_ptr) cinfo->main;
+
+  /* Do nothing in raw-data mode. */
+  if (cinfo->raw_data_in)
+    return;
+
+  main->cur_iMCU_row = 0;	/* initialize counters */
+  main->rowgroup_ctr = 0;
+  main->suspended = FALSE;
+  main->pass_mode = pass_mode;	/* save mode for use by process_data */
+
+  switch (pass_mode) {
+  case JBUF_PASS_THRU:
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+    if (main->whole_image[0] != NULL)
+      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+#endif
+    main->pub.process_data = process_data_simple_main;
+    break;
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+  case JBUF_SAVE_SOURCE:
+  case JBUF_CRANK_DEST:
+  case JBUF_SAVE_AND_PASS:
+    if (main->whole_image[0] == NULL)
+      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+    main->pub.process_data = process_data_buffer_main;
+    break;
+#endif
+  default:
+    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+    break;
+  }
+}
+
+
+/*
+ * Process some data.
+ * This routine handles the simple pass-through mode,
+ * where we have only a strip buffer.
+ */
+
+METHODDEF(void)
+process_data_simple_main (j_compress_ptr cinfo,
+			  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+			  JDIMENSION in_rows_avail)
+{
+  my_main_ptr main = (my_main_ptr) cinfo->main;
+
+  while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
+    /* Read input data if we haven't filled the main buffer yet */
+    if (main->rowgroup_ctr < DCTSIZE)
+      (*cinfo->prep->pre_process_data) (cinfo,
+					input_buf, in_row_ctr, in_rows_avail,
+					main->buffer, &main->rowgroup_ctr,
+					(JDIMENSION) DCTSIZE);
+
+    /* If we don't have a full iMCU row buffered, return to application for
+     * more data.  Note that preprocessor will always pad to fill the iMCU row
+     * at the bottom of the image.
+     */
+    if (main->rowgroup_ctr != DCTSIZE)
+      return;
+
+    /* Send the completed row to the compressor */
+    if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
+      /* If compressor did not consume the whole row, then we must need to
+       * suspend processing and return to the application.  In this situation
+       * we pretend we didn't yet consume the last input row; otherwise, if
+       * it happened to be the last row of the image, the application would
+       * think we were done.
+       */
+      if (! main->suspended) {
+	(*in_row_ctr)--;
+	main->suspended = TRUE;
+      }
+      return;
+    }
+    /* We did finish the row.  Undo our little suspension hack if a previous
+     * call suspended; then mark the main buffer empty.
+     */
+    if (main->suspended) {
+      (*in_row_ctr)++;
+      main->suspended = FALSE;
+    }
+    main->rowgroup_ctr = 0;
+    main->cur_iMCU_row++;
+  }
+}
+
+
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+
+/*
+ * Process some data.
+ * This routine handles all of the modes that use a full-size buffer.
+ */
+
+METHODDEF(void)
+process_data_buffer_main (j_compress_ptr cinfo,
+			  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+			  JDIMENSION in_rows_avail)
+{
+  my_main_ptr main = (my_main_ptr) cinfo->main;
+  int ci;
+  jpeg_component_info *compptr;
+  boolean writing = (main->pass_mode != JBUF_CRANK_DEST);
+
+  while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
+    /* Realign the virtual buffers if at the start of an iMCU row. */
+    if (main->rowgroup_ctr == 0) {
+      for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+	   ci++, compptr++) {
+	main->buffer[ci] = (*cinfo->mem->access_virt_sarray)
+	  ((j_common_ptr) cinfo, main->whole_image[ci],
+	   main->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE),
+	   (JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing);
+      }
+      /* In a read pass, pretend we just read some source data. */
+      if (! writing) {
+	*in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE;
+	main->rowgroup_ctr = DCTSIZE;
+      }
+    }
+
+    /* If a write pass, read input data until the current iMCU row is full. */
+    /* Note: preprocessor will pad if necessary to fill the last iMCU row. */
+    if (writing) {
+      (*cinfo->prep->pre_process_data) (cinfo,
+					input_buf, in_row_ctr, in_rows_avail,
+					main->buffer, &main->rowgroup_ctr,
+					(JDIMENSION) DCTSIZE);
+      /* Return to application if we need more data to fill the iMCU row. */
+      if (main->rowgroup_ctr < DCTSIZE)
+	return;
+    }
+
+    /* Emit data, unless this is a sink-only pass. */
+    if (main->pass_mode != JBUF_SAVE_SOURCE) {
+      if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
+	/* If compressor did not consume the whole row, then we must need to
+	 * suspend processing and return to the application.  In this situation
+	 * we pretend we didn't yet consume the last input row; otherwise, if
+	 * it happened to be the last row of the image, the application would
+	 * think we were done.
+	 */
+	if (! main->suspended) {
+	  (*in_row_ctr)--;
+	  main->suspended = TRUE;
+	}
+	return;
+      }
+      /* We did finish the row.  Undo our little suspension hack if a previous
+       * call suspended; then mark the main buffer empty.
+       */
+      if (main->suspended) {
+	(*in_row_ctr)++;
+	main->suspended = FALSE;
+      }
+    }
+
+    /* If get here, we are done with this iMCU row.  Mark buffer empty. */
+    main->rowgroup_ctr = 0;
+    main->cur_iMCU_row++;
+  }
+}
+
+#endif /* FULL_MAIN_BUFFER_SUPPORTED */
+
+
+/*
+ * Initialize main buffer controller.
+ */
+
+GLOBAL(void)
+jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
+{
+  my_main_ptr main;
+  int ci;
+  jpeg_component_info *compptr;
+
+  main = (my_main_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_main_controller));
+  cinfo->main = (struct jpeg_c_main_controller *) main;
+  main->pub.start_pass = start_pass_main;
+
+  /* We don't need to create a buffer in raw-data mode. */
+  if (cinfo->raw_data_in)
+    return;
+
+  /* Create the buffer.  It holds downsampled data, so each component
+   * may be of a different size.
+   */
+  if (need_full_buffer) {
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+    /* Allocate a full-image virtual array for each component */
+    /* Note we pad the bottom to a multiple of the iMCU height */
+    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+	 ci++, compptr++) {
+      main->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
+	((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+	 compptr->width_in_blocks * DCTSIZE,
+	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+				(long) compptr->v_samp_factor) * DCTSIZE,
+	 (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
+    }
+#else
+    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+#endif
+  } else {
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+    main->whole_image[0] = NULL; /* flag for no virtual arrays */
+#endif
+    /* Allocate a strip buffer for each component */
+    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+	 ci++, compptr++) {
+      main->buffer[ci] = (*cinfo->mem->alloc_sarray)
+	((j_common_ptr) cinfo, JPOOL_IMAGE,
+	 compptr->width_in_blocks * DCTSIZE,
+	 (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
+    }
+  }
+}
diff --git a/src/libjpeg/jcmarker.c b/src/libjpeg/jcmarker.c
new file mode 100644
index 0000000..0d3ca5e
--- /dev/null
+++ b/src/libjpeg/jcmarker.c
@@ -0,0 +1,664 @@
+/*
+ * jcmarker.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to write JPEG datastream markers.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+typedef enum {			/* JPEG marker codes */
+  M_SOF0  = 0xc0,
+  M_SOF1  = 0xc1,
+  M_SOF2  = 0xc2,
+  M_SOF3  = 0xc3,
+  
+  M_SOF5  = 0xc5,
+  M_SOF6  = 0xc6,
+  M_SOF7  = 0xc7,
+  
+  M_JPG   = 0xc8,
+  M_SOF9  = 0xc9,
+  M_SOF10 = 0xca,
+  M_SOF11 = 0xcb,
+  
+  M_SOF13 = 0xcd,
+  M_SOF14 = 0xce,
+  M_SOF15 = 0xcf,
+  
+  M_DHT   = 0xc4,
+  
+  M_DAC   = 0xcc,
+  
+  M_RST0  = 0xd0,
+  M_RST1  = 0xd1,
+  M_RST2  = 0xd2,
+  M_RST3  = 0xd3,
+  M_RST4  = 0xd4,
+  M_RST5  = 0xd5,
+  M_RST6  = 0xd6,
+  M_RST7  = 0xd7,
+  
+  M_SOI   = 0xd8,
+  M_EOI   = 0xd9,
+  M_SOS   = 0xda,
+  M_DQT   = 0xdb,
+  M_DNL   = 0xdc,
+  M_DRI   = 0xdd,
+  M_DHP   = 0xde,
+  M_EXP   = 0xdf,
+  
+  M_APP0  = 0xe0,
+  M_APP1  = 0xe1,
+  M_APP2  = 0xe2,
+  M_APP3  = 0xe3,
+  M_APP4  = 0xe4,
+  M_APP5  = 0xe5,
+  M_APP6  = 0xe6,
+  M_APP7  = 0xe7,
+  M_APP8  = 0xe8,
+  M_APP9  = 0xe9,
+  M_APP10 = 0xea,
+  M_APP11 = 0xeb,
+  M_APP12 = 0xec,
+  M_APP13 = 0xed,
+  M_APP14 = 0xee,
+  M_APP15 = 0xef,
+  
+  M_JPG0  = 0xf0,
+  M_JPG13 = 0xfd,
+  M_COM   = 0xfe,
+  
+  M_TEM   = 0x01,
+  
+  M_ERROR = 0x100
+} JPEG_MARKER;
+
+
+/* Private state */
+
+typedef struct {
+  struct jpeg_marker_writer pub; /* public fields */
+
+  unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */
+} my_marker_writer;
+
+typedef my_marker_writer * my_marker_ptr;
+
+
+/*
+ * Basic output routines.
+ *
+ * Note that we do not support suspension while writing a marker.
+ * Therefore, an application using suspension must ensure that there is
+ * enough buffer space for the initial markers (typ. 600-700 bytes) before
+ * calling jpeg_start_compress, and enough space to write the trailing EOI
+ * (a few bytes) before calling jpeg_finish_compress.  Multipass compression
+ * modes are not supported at all with suspension, so those two are the only
+ * points where markers will be written.
+ */
+
+LOCAL(void)
+emit_byte (j_compress_ptr cinfo, int val)
+/* Emit a byte */
+{
+  struct jpeg_destination_mgr * dest = cinfo->dest;
+
+  *(dest->next_output_byte)++ = (JOCTET) val;
+  if (--dest->free_in_buffer == 0) {
+    if (! (*dest->empty_output_buffer) (cinfo))
+      ERREXIT(cinfo, JERR_CANT_SUSPEND);
+  }
+}
+
+
+LOCAL(void)
+emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark)
+/* Emit a marker code */
+{
+  emit_byte(cinfo, 0xFF);
+  emit_byte(cinfo, (int) mark);
+}
+
+
+LOCAL(void)
+emit_2bytes (j_compress_ptr cinfo, int value)
+/* Emit a 2-byte integer; these are always MSB first in JPEG files */
+{
+  emit_byte(cinfo, (value >> 8) & 0xFF);
+  emit_byte(cinfo, value & 0xFF);
+}
+
+
+/*
+ * Routines to write specific marker types.
+ */
+
+LOCAL(int)
+emit_dqt (j_compress_ptr cinfo, int index)
+/* Emit a DQT marker */
+/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
+{
+  JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];
+  int prec;
+  int i;
+
+  if (qtbl == NULL)
+    ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);
+
+  prec = 0;
+  for (i = 0; i < DCTSIZE2; i++) {
+    if (qtbl->quantval[i] > 255)
+      prec = 1;
+  }
+
+  if (! qtbl->sent_table) {
+    emit_marker(cinfo, M_DQT);
+
+    emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2);
+
+    emit_byte(cinfo, index + (prec<<4));
+
+    for (i = 0; i < DCTSIZE2; i++) {
+      /* The table entries must be emitted in zigzag order. */
+      unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
+      if (prec)
+	emit_byte(cinfo, (int) (qval >> 8));
+      emit_byte(cinfo, (int) (qval & 0xFF));
+    }
+
+    qtbl->sent_table = TRUE;
+  }
+
+  return prec;
+}
+
+
+LOCAL(void)
+emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
+/* Emit a DHT marker */
+{
+  JHUFF_TBL * htbl;
+  int length, i;
+  
+  if (is_ac) {
+    htbl = cinfo->ac_huff_tbl_ptrs[index];
+    index += 0x10;		/* output index has AC bit set */
+  } else {
+    htbl = cinfo->dc_huff_tbl_ptrs[index];
+  }
+
+  if (htbl == NULL)
+    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);
+  
+  if (! htbl->sent_table) {
+    emit_marker(cinfo, M_DHT);
+    
+    length = 0;
+    for (i = 1; i <= 16; i++)
+      length += htbl->bits[i];
+    
+    emit_2bytes(cinfo, length + 2 + 1 + 16);
+    emit_byte(cinfo, index);
+    
+    for (i = 1; i <= 16; i++)
+      emit_byte(cinfo, htbl->bits[i]);
+    
+    for (i = 0; i < length; i++)
+      emit_byte(cinfo, htbl->huffval[i]);
+    
+    htbl->sent_table = TRUE;
+  }
+}
+
+
+LOCAL(void)
+emit_dac (j_compress_ptr cinfo)
+/* Emit a DAC marker */
+/* Since the useful info is so small, we want to emit all the tables in */
+/* one DAC marker.  Therefore this routine does its own scan of the table. */
+{
+#ifdef C_ARITH_CODING_SUPPORTED
+  char dc_in_use[NUM_ARITH_TBLS];
+  char ac_in_use[NUM_ARITH_TBLS];
+  int length, i;
+  jpeg_component_info *compptr;
+  
+  for (i = 0; i < NUM_ARITH_TBLS; i++)
+    dc_in_use[i] = ac_in_use[i] = 0;
+  
+  for (i = 0; i < cinfo->comps_in_scan; i++) {
+    compptr = cinfo->cur_comp_info[i];
+    dc_in_use[compptr->dc_tbl_no] = 1;
+    ac_in_use[compptr->ac_tbl_no] = 1;
+  }
+  
+  length = 0;
+  for (i = 0; i < NUM_ARITH_TBLS; i++)
+    length += dc_in_use[i] + ac_in_use[i];
+  
+  emit_marker(cinfo, M_DAC);
+  
+  emit_2bytes(cinfo, length*2 + 2);
+  
+  for (i = 0; i < NUM_ARITH_TBLS; i++) {
+    if (dc_in_use[i]) {
+      emit_byte(cinfo, i);
+      emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
+    }
+    if (ac_in_use[i]) {
+      emit_byte(cinfo, i + 0x10);
+      emit_byte(cinfo, cinfo->arith_ac_K[i]);
+    }
+  }
+#endif /* C_ARITH_CODING_SUPPORTED */
+}
+
+
+LOCAL(void)
+emit_dri (j_compress_ptr cinfo)
+/* Emit a DRI marker */
+{
+  emit_marker(cinfo, M_DRI);
+  
+  emit_2bytes(cinfo, 4);	/* fixed length */
+
+  emit_2bytes(cinfo, (int) cinfo->restart_interval);
+}
+
+
+LOCAL(void)
+emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
+/* Emit a SOF marker */
+{
+  int ci;
+  jpeg_component_info *compptr;
+  
+  emit_marker(cinfo, code);
+  
+  emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
+
+  /* Make sure image isn't bigger than SOF field can handle */
+  if ((long) cinfo->image_height > 65535L ||
+      (long) cinfo->image_width > 65535L)
+    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);
+
+  emit_byte(cinfo, cinfo->data_precision);
+  emit_2bytes(cinfo, (int) cinfo->image_height);
+  emit_2bytes(cinfo, (int) cinfo->image_width);
+
+  emit_byte(cinfo, cinfo->num_components);
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    emit_byte(cinfo, compptr->component_id);
+    emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);
+    emit_byte(cinfo, compptr->quant_tbl_no);
+  }
+}
+
+
+LOCAL(void)
+emit_sos (j_compress_ptr cinfo)
+/* Emit a SOS marker */
+{
+  int i, td, ta;
+  jpeg_component_info *compptr;
+  
+  emit_marker(cinfo, M_SOS);
+  
+  emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */
+  
+  emit_byte(cinfo, cinfo->comps_in_scan);
+  
+  for (i = 0; i < cinfo->comps_in_scan; i++) {
+    compptr = cinfo->cur_comp_info[i];
+    emit_byte(cinfo, compptr->component_id);
+    td = compptr->dc_tbl_no;
+    ta = compptr->ac_tbl_no;
+    if (cinfo->progressive_mode) {
+      /* Progressive mode: only DC or only AC tables are used in one scan;
+       * furthermore, Huffman coding of DC refinement uses no table at all.
+       * We emit 0 for unused field(s); this is recommended by the P&M text
+       * but does not seem to be specified in the standard.
+       */
+      if (cinfo->Ss == 0) {
+	ta = 0;			/* DC scan */
+	if (cinfo->Ah != 0 && !cinfo->arith_code)
+	  td = 0;		/* no DC table either */
+      } else {
+	td = 0;			/* AC scan */
+      }
+    }
+    emit_byte(cinfo, (td << 4) + ta);
+  }
+
+  emit_byte(cinfo, cinfo->Ss);
+  emit_byte(cinfo, cinfo->Se);
+  emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);
+}
+
+
+LOCAL(void)
+emit_jfif_app0 (j_compress_ptr cinfo)
+/* Emit a JFIF-compliant APP0 marker */
+{
+  /*
+   * Length of APP0 block	(2 bytes)
+   * Block ID			(4 bytes - ASCII "JFIF")
+   * Zero byte			(1 byte to terminate the ID string)
+   * Version Major, Minor	(2 bytes - major first)
+   * Units			(1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
+   * Xdpu			(2 bytes - dots per unit horizontal)
+   * Ydpu			(2 bytes - dots per unit vertical)
+   * Thumbnail X size		(1 byte)
+   * Thumbnail Y size		(1 byte)
+   */
+  
+  emit_marker(cinfo, M_APP0);
+  
+  emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */
+
+  emit_byte(cinfo, 0x4A);	/* Identifier: ASCII "JFIF" */
+  emit_byte(cinfo, 0x46);
+  emit_byte(cinfo, 0x49);
+  emit_byte(cinfo, 0x46);
+  emit_byte(cinfo, 0);
+  emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */
+  emit_byte(cinfo, cinfo->JFIF_minor_version);
+  emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */
+  emit_2bytes(cinfo, (int) cinfo->X_density);
+  emit_2bytes(cinfo, (int) cinfo->Y_density);
+  emit_byte(cinfo, 0);		/* No thumbnail image */
+  emit_byte(cinfo, 0);
+}
+
+
+LOCAL(void)
+emit_adobe_app14 (j_compress_ptr cinfo)
+/* Emit an Adobe APP14 marker */
+{
+  /*
+   * Length of APP14 block	(2 bytes)
+   * Block ID			(5 bytes - ASCII "Adobe")
+   * Version Number		(2 bytes - currently 100)
+   * Flags0			(2 bytes - currently 0)
+   * Flags1			(2 bytes - currently 0)
+   * Color transform		(1 byte)
+   *
+   * Although Adobe TN 5116 mentions Version = 101, all the Adobe files
+   * now in circulation seem to use Version = 100, so that's what we write.
+   *
+   * We write the color transform byte as 1 if the JPEG color space is
+   * YCbCr, 2 if it's YCCK, 0 otherwise.  Adobe's definition has to do with
+   * whether the encoder performed a transformation, which is pretty useless.
+   */
+  
+  emit_marker(cinfo, M_APP14);
+  
+  emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */
+
+  emit_byte(cinfo, 0x41);	/* Identifier: ASCII "Adobe" */
+  emit_byte(cinfo, 0x64);
+  emit_byte(cinfo, 0x6F);
+  emit_byte(cinfo, 0x62);
+  emit_byte(cinfo, 0x65);
+  emit_2bytes(cinfo, 100);	/* Version */
+  emit_2bytes(cinfo, 0);	/* Flags0 */
+  emit_2bytes(cinfo, 0);	/* Flags1 */
+  switch (cinfo->jpeg_color_space) {
+  case JCS_YCbCr:
+    emit_byte(cinfo, 1);	/* Color transform = 1 */
+    break;
+  case JCS_YCCK:
+    emit_byte(cinfo, 2);	/* Color transform = 2 */
+    break;
+  default:
+    emit_byte(cinfo, 0);	/* Color transform = 0 */
+    break;
+  }
+}
+
+
+/*
+ * These routines allow writing an arbitrary marker with parameters.
+ * The only intended use is to emit COM or APPn markers after calling
+ * write_file_header and before calling write_frame_header.
+ * Other uses are not guaranteed to produce desirable results.
+ * Counting the parameter bytes properly is the caller's responsibility.
+ */
+
+METHODDEF(void)
+write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
+/* Emit an arbitrary marker header */
+{
+  if (datalen > (unsigned int) 65533)		/* safety check */
+    ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+  emit_marker(cinfo, (JPEG_MARKER) marker);
+
+  emit_2bytes(cinfo, (int) (datalen + 2));	/* total length */
+}
+
+METHODDEF(void)
+write_marker_byte (j_compress_ptr cinfo, int val)
+/* Emit one byte of marker parameters following write_marker_header */
+{
+  emit_byte(cinfo, val);
+}
+
+
+/*
+ * Write datastream header.
+ * This consists of an SOI and optional APPn markers.
+ * We recommend use of the JFIF marker, but not the Adobe marker,
+ * when using YCbCr or grayscale data.  The JFIF marker should NOT
+ * be used for any other JPEG colorspace.  The Adobe marker is helpful
+ * to distinguish RGB, CMYK, and YCCK colorspaces.
+ * Note that an application can write additional header markers after
+ * jpeg_start_compress returns.
+ */
+
+METHODDEF(void)
+write_file_header (j_compress_ptr cinfo)
+{
+  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+
+  emit_marker(cinfo, M_SOI);	/* first the SOI */
+
+  /* SOI is defined to reset restart interval to 0 */
+  marker->last_restart_interval = 0;
+
+  if (cinfo->write_JFIF_header)	/* next an optional JFIF APP0 */
+    emit_jfif_app0(cinfo);
+  if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */
+    emit_adobe_app14(cinfo);
+}
+
+
+/*
+ * Write frame header.
+ * This consists of DQT and SOFn markers.
+ * Note that we do not emit the SOF until we have emitted the DQT(s).
+ * This avoids compatibility problems with incorrect implementations that
+ * try to error-check the quant table numbers as soon as they see the SOF.
+ */
+
+METHODDEF(void)
+write_frame_header (j_compress_ptr cinfo)
+{
+  int ci, prec;
+  boolean is_baseline;
+  jpeg_component_info *compptr;
+  
+  /* Emit DQT for each quantization table.
+   * Note that emit_dqt() suppresses any duplicate tables.
+   */
+  prec = 0;
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    prec += emit_dqt(cinfo, compptr->quant_tbl_no);
+  }
+  /* now prec is nonzero iff there are any 16-bit quant tables. */
+
+  /* Check for a non-baseline specification.
+   * Note we assume that Huffman table numbers won't be changed later.
+   */
+  if (cinfo->arith_code || cinfo->progressive_mode ||
+      cinfo->data_precision != 8) {
+    is_baseline = FALSE;
+  } else {
+    is_baseline = TRUE;
+    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+	 ci++, compptr++) {
+      if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)
+	is_baseline = FALSE;
+    }
+    if (prec && is_baseline) {
+      is_baseline = FALSE;
+      /* If it's baseline except for quantizer size, warn the user */
+      TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);
+    }
+  }
+
+  /* Emit the proper SOF marker */
+  if (cinfo->arith_code) {
+    emit_sof(cinfo, M_SOF9);	/* SOF code for arithmetic coding */
+  } else {
+    if (cinfo->progressive_mode)
+      emit_sof(cinfo, M_SOF2);	/* SOF code for progressive Huffman */
+    else if (is_baseline)
+      emit_sof(cinfo, M_SOF0);	/* SOF code for baseline implementation */
+    else
+      emit_sof(cinfo, M_SOF1);	/* SOF code for non-baseline Huffman file */
+  }
+}
+
+
+/*
+ * Write scan header.
+ * This consists of DHT or DAC markers, optional DRI, and SOS.
+ * Compressed data will be written following the SOS.
+ */
+
+METHODDEF(void)
+write_scan_header (j_compress_ptr cinfo)
+{
+  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+  int i;
+  jpeg_component_info *compptr;
+
+  if (cinfo->arith_code) {
+    /* Emit arith conditioning info.  We may have some duplication
+     * if the file has multiple scans, but it's so small it's hardly
+     * worth worrying about.
+     */
+    emit_dac(cinfo);
+  } else {
+    /* Emit Huffman tables.
+     * Note that emit_dht() suppresses any duplicate tables.
+     */
+    for (i = 0; i < cinfo->comps_in_scan; i++) {
+      compptr = cinfo->cur_comp_info[i];
+      if (cinfo->progressive_mode) {
+	/* Progressive mode: only DC or only AC tables are used in one scan */
+	if (cinfo->Ss == 0) {
+	  if (cinfo->Ah == 0)	/* DC needs no table for refinement scan */
+	    emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
+	} else {
+	  emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
+	}
+      } else {
+	/* Sequential mode: need both DC and AC tables */
+	emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
+	emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
+      }
+    }
+  }
+
+  /* Emit DRI if required --- note that DRI value could change for each scan.
+   * We avoid wasting space with unnecessary DRIs, however.
+   */
+  if (cinfo->restart_interval != marker->last_restart_interval) {
+    emit_dri(cinfo);
+    marker->last_restart_interval = cinfo->restart_interval;
+  }
+
+  emit_sos(cinfo);
+}
+
+
+/*
+ * Write datastream trailer.
+ */
+
+METHODDEF(void)
+write_file_trailer (j_compress_ptr cinfo)
+{
+  emit_marker(cinfo, M_EOI);
+}
+
+
+/*
+ * Write an abbreviated table-specification datastream.
+ * This consists of SOI, DQT and DHT tables, and EOI.
+ * Any table that is defined and not marked sent_table = TRUE will be
+ * emitted.  Note that all tables will be marked sent_table = TRUE at exit.
+ */
+
+METHODDEF(void)
+write_tables_only (j_compress_ptr cinfo)
+{
+  int i;
+
+  emit_marker(cinfo, M_SOI);
+
+  for (i = 0; i < NUM_QUANT_TBLS; i++) {
+    if (cinfo->quant_tbl_ptrs[i] != NULL)
+      (void) emit_dqt(cinfo, i);
+  }
+
+  if (! cinfo->arith_code) {
+    for (i = 0; i < NUM_HUFF_TBLS; i++) {
+      if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
+	emit_dht(cinfo, i, FALSE);
+      if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
+	emit_dht(cinfo, i, TRUE);
+    }
+  }
+
+  emit_marker(cinfo, M_EOI);
+}
+
+
+/*
+ * Initialize the marker writer module.
+ */
+
+GLOBAL(void)
+jinit_marker_writer (j_compress_ptr cinfo)
+{
+  my_marker_ptr marker;
+
+  /* Create the subobject */
+  marker = (my_marker_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_marker_writer));
+  cinfo->marker = (struct jpeg_marker_writer *) marker;
+  /* Initialize method pointers */
+  marker->pub.write_file_header = write_file_header;
+  marker->pub.write_frame_header = write_frame_header;
+  marker->pub.write_scan_header = write_scan_header;
+  marker->pub.write_file_trailer = write_file_trailer;
+  marker->pub.write_tables_only = write_tables_only;
+  marker->pub.write_marker_header = write_marker_header;
+  marker->pub.write_marker_byte = write_marker_byte;
+  /* Initialize private state */
+  marker->last_restart_interval = 0;
+}
diff --git a/src/libjpeg/jcmaster.c b/src/libjpeg/jcmaster.c
new file mode 100644
index 0000000..e61138b
--- /dev/null
+++ b/src/libjpeg/jcmaster.c
@@ -0,0 +1,590 @@
+/*
+ * jcmaster.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains master control logic for the JPEG compressor.
+ * These routines are concerned with parameter validation, initial setup,
+ * and inter-pass control (determining the number of passes and the work 
+ * to be done in each pass).
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private state */
+
+typedef enum {
+	main_pass,		/* input data, also do first output step */
+	huff_opt_pass,		/* Huffman code optimization pass */
+	output_pass		/* data output pass */
+} c_pass_type;
+
+typedef struct {
+  struct jpeg_comp_master pub;	/* public fields */
+
+  c_pass_type pass_type;	/* the type of the current pass */
+
+  int pass_number;		/* # of passes completed */
+  int total_passes;		/* total # of passes needed */
+
+  int scan_number;		/* current index in scan_info[] */
+} my_comp_master;
+
+typedef my_comp_master * my_master_ptr;
+
+
+/*
+ * Support routines that do various essential calculations.
+ */
+
+LOCAL(void)
+initial_setup (j_compress_ptr cinfo)
+/* Do computations that are needed before master selection phase */
+{
+  int ci;
+  jpeg_component_info *compptr;
+  long samplesperrow;
+  JDIMENSION jd_samplesperrow;
+
+  /* Sanity check on image dimensions */
+  if (cinfo->image_height <= 0 || cinfo->image_width <= 0
+      || cinfo->num_components <= 0 || cinfo->input_components <= 0)
+    ERREXIT(cinfo, JERR_EMPTY_IMAGE);
+
+  /* Make sure image isn't bigger than I can handle */
+  if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
+      (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
+    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
+
+  /* Width of an input scanline must be representable as JDIMENSION. */
+  samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;
+  jd_samplesperrow = (JDIMENSION) samplesperrow;
+  if ((long) jd_samplesperrow != samplesperrow)
+    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
+
+  /* For now, precision must match compiled-in value... */
+  if (cinfo->data_precision != BITS_IN_JSAMPLE)
+    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
+
+  /* Check that number of components won't exceed internal array sizes */
+  if (cinfo->num_components > MAX_COMPONENTS)
+    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
+	     MAX_COMPONENTS);
+
+  /* Compute maximum sampling factors; check factor validity */
+  cinfo->max_h_samp_factor = 1;
+  cinfo->max_v_samp_factor = 1;
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
+	compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
+      ERREXIT(cinfo, JERR_BAD_SAMPLING);
+    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
+				   compptr->h_samp_factor);
+    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
+				   compptr->v_samp_factor);
+  }
+
+  /* Compute dimensions of components */
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* Fill in the correct component_index value; don't rely on application */
+    compptr->component_index = ci;
+    /* For compression, we never do DCT scaling. */
+    compptr->DCT_scaled_size = DCTSIZE;
+    /* Size in DCT blocks */
+    compptr->width_in_blocks = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
+		    (long) (cinfo->max_h_samp_factor * DCTSIZE));
+    compptr->height_in_blocks = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
+		    (long) (cinfo->max_v_samp_factor * DCTSIZE));
+    /* Size in samples */
+    compptr->downsampled_width = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
+		    (long) cinfo->max_h_samp_factor);
+    compptr->downsampled_height = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
+		    (long) cinfo->max_v_samp_factor);
+    /* Mark component needed (this flag isn't actually used for compression) */
+    compptr->component_needed = TRUE;
+  }
+
+  /* Compute number of fully interleaved MCU rows (number of times that
+   * main controller will call coefficient controller).
+   */
+  cinfo->total_iMCU_rows = (JDIMENSION)
+    jdiv_round_up((long) cinfo->image_height,
+		  (long) (cinfo->max_v_samp_factor*DCTSIZE));
+}
+
+
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+
+LOCAL(void)
+validate_script (j_compress_ptr cinfo)
+/* Verify that the scan script in cinfo->scan_info[] is valid; also
+ * determine whether it uses progressive JPEG, and set cinfo->progressive_mode.
+ */
+{
+  const jpeg_scan_info * scanptr;
+  int scanno, ncomps, ci, coefi, thisi;
+  int Ss, Se, Ah, Al;
+  boolean component_sent[MAX_COMPONENTS];
+#ifdef C_PROGRESSIVE_SUPPORTED
+  int * last_bitpos_ptr;
+  int last_bitpos[MAX_COMPONENTS][DCTSIZE2];
+  /* -1 until that coefficient has been seen; then last Al for it */
+#endif
+
+  if (cinfo->num_scans <= 0)
+    ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);
+
+  /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;
+   * for progressive JPEG, no scan can have this.
+   */
+  scanptr = cinfo->scan_info;
+  if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) {
+#ifdef C_PROGRESSIVE_SUPPORTED
+    cinfo->progressive_mode = TRUE;
+    last_bitpos_ptr = & last_bitpos[0][0];
+    for (ci = 0; ci < cinfo->num_components; ci++) 
+      for (coefi = 0; coefi < DCTSIZE2; coefi++)
+	*last_bitpos_ptr++ = -1;
+#else
+    ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+  } else {
+    cinfo->progressive_mode = FALSE;
+    for (ci = 0; ci < cinfo->num_components; ci++) 
+      component_sent[ci] = FALSE;
+  }
+
+  for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {
+    /* Validate component indexes */
+    ncomps = scanptr->comps_in_scan;
+    if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)
+      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);
+    for (ci = 0; ci < ncomps; ci++) {
+      thisi = scanptr->component_index[ci];
+      if (thisi < 0 || thisi >= cinfo->num_components)
+	ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
+      /* Components must appear in SOF order within each scan */
+      if (ci > 0 && thisi <= scanptr->component_index[ci-1])
+	ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
+    }
+    /* Validate progression parameters */
+    Ss = scanptr->Ss;
+    Se = scanptr->Se;
+    Ah = scanptr->Ah;
+    Al = scanptr->Al;
+    if (cinfo->progressive_mode) {
+#ifdef C_PROGRESSIVE_SUPPORTED
+      /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that
+       * seems wrong: the upper bound ought to depend on data precision.
+       * Perhaps they really meant 0..N+1 for N-bit precision.
+       * Here we allow 0..10 for 8-bit data; Al larger than 10 results in
+       * out-of-range reconstructed DC values during the first DC scan,
+       * which might cause problems for some decoders.
+       */
+#if BITS_IN_JSAMPLE == 8
+#define MAX_AH_AL 10
+#else
+#define MAX_AH_AL 13
+#endif
+      if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
+	  Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
+	ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+      if (Ss == 0) {
+	if (Se != 0)		/* DC and AC together not OK */
+	  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+      } else {
+	if (ncomps != 1)	/* AC scans must be for only one component */
+	  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+      }
+      for (ci = 0; ci < ncomps; ci++) {
+	last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];
+	if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
+	  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+	for (coefi = Ss; coefi <= Se; coefi++) {
+	  if (last_bitpos_ptr[coefi] < 0) {
+	    /* first scan of this coefficient */
+	    if (Ah != 0)
+	      ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+	  } else {
+	    /* not first scan */
+	    if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)
+	      ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+	  }
+	  last_bitpos_ptr[coefi] = Al;
+	}
+      }
+#endif
+    } else {
+      /* For sequential JPEG, all progression parameters must be these: */
+      if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
+	ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+      /* Make sure components are not sent twice */
+      for (ci = 0; ci < ncomps; ci++) {
+	thisi = scanptr->component_index[ci];
+	if (component_sent[thisi])
+	  ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
+	component_sent[thisi] = TRUE;
+      }
+    }
+  }
+
+  /* Now verify that everything got sent. */
+  if (cinfo->progressive_mode) {
+#ifdef C_PROGRESSIVE_SUPPORTED
+    /* For progressive mode, we only check that at least some DC data
+     * got sent for each component; the spec does not require that all bits
+     * of all coefficients be transmitted.  Would it be wiser to enforce
+     * transmission of all coefficient bits??
+     */
+    for (ci = 0; ci < cinfo->num_components; ci++) {
+      if (last_bitpos[ci][0] < 0)
+	ERREXIT(cinfo, JERR_MISSING_DATA);
+    }
+#endif
+  } else {
+    for (ci = 0; ci < cinfo->num_components; ci++) {
+      if (! component_sent[ci])
+	ERREXIT(cinfo, JERR_MISSING_DATA);
+    }
+  }
+}
+
+#endif /* C_MULTISCAN_FILES_SUPPORTED */
+
+
+LOCAL(void)
+select_scan_parameters (j_compress_ptr cinfo)
+/* Set up the scan parameters for the current scan */
+{
+  int ci;
+
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+  if (cinfo->scan_info != NULL) {
+    /* Prepare for current scan --- the script is already validated */
+    my_master_ptr master = (my_master_ptr) cinfo->master;
+    const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number;
+
+    cinfo->comps_in_scan = scanptr->comps_in_scan;
+    for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
+      cinfo->cur_comp_info[ci] =
+	&cinfo->comp_info[scanptr->component_index[ci]];
+    }
+    cinfo->Ss = scanptr->Ss;
+    cinfo->Se = scanptr->Se;
+    cinfo->Ah = scanptr->Ah;
+    cinfo->Al = scanptr->Al;
+  }
+  else
+#endif
+  {
+    /* Prepare for single sequential-JPEG scan containing all components */
+    if (cinfo->num_components > MAX_COMPS_IN_SCAN)
+      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
+	       MAX_COMPS_IN_SCAN);
+    cinfo->comps_in_scan = cinfo->num_components;
+    for (ci = 0; ci < cinfo->num_components; ci++) {
+      cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
+    }
+    cinfo->Ss = 0;
+    cinfo->Se = DCTSIZE2-1;
+    cinfo->Ah = 0;
+    cinfo->Al = 0;
+  }
+}
+
+
+LOCAL(void)
+per_scan_setup (j_compress_ptr cinfo)
+/* Do computations that are needed before processing a JPEG scan */
+/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */
+{
+  int ci, mcublks, tmp;
+  jpeg_component_info *compptr;
+  
+  if (cinfo->comps_in_scan == 1) {
+    
+    /* Noninterleaved (single-component) scan */
+    compptr = cinfo->cur_comp_info[0];
+    
+    /* Overall image size in MCUs */
+    cinfo->MCUs_per_row = compptr->width_in_blocks;
+    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
+    
+    /* For noninterleaved scan, always one block per MCU */
+    compptr->MCU_width = 1;
+    compptr->MCU_height = 1;
+    compptr->MCU_blocks = 1;
+    compptr->MCU_sample_width = DCTSIZE;
+    compptr->last_col_width = 1;
+    /* For noninterleaved scans, it is convenient to define last_row_height
+     * as the number of block rows present in the last iMCU row.
+     */
+    tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
+    if (tmp == 0) tmp = compptr->v_samp_factor;
+    compptr->last_row_height = tmp;
+    
+    /* Prepare array describing MCU composition */
+    cinfo->blocks_in_MCU = 1;
+    cinfo->MCU_membership[0] = 0;
+    
+  } else {
+    
+    /* Interleaved (multi-component) scan */
+    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
+      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
+	       MAX_COMPS_IN_SCAN);
+    
+    /* Overall image size in MCUs */
+    cinfo->MCUs_per_row = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_width,
+		    (long) (cinfo->max_h_samp_factor*DCTSIZE));
+    cinfo->MCU_rows_in_scan = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_height,
+		    (long) (cinfo->max_v_samp_factor*DCTSIZE));
+    
+    cinfo->blocks_in_MCU = 0;
+    
+    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+      compptr = cinfo->cur_comp_info[ci];
+      /* Sampling factors give # of blocks of component in each MCU */
+      compptr->MCU_width = compptr->h_samp_factor;
+      compptr->MCU_height = compptr->v_samp_factor;
+      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
+      compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE;
+      /* Figure number of non-dummy blocks in last MCU column & row */
+      tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
+      if (tmp == 0) tmp = compptr->MCU_width;
+      compptr->last_col_width = tmp;
+      tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);
+      if (tmp == 0) tmp = compptr->MCU_height;
+      compptr->last_row_height = tmp;
+      /* Prepare array describing MCU composition */
+      mcublks = compptr->MCU_blocks;
+      if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)
+	ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
+      while (mcublks-- > 0) {
+	cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
+      }
+    }
+    
+  }
+
+  /* Convert restart specified in rows to actual MCU count. */
+  /* Note that count must fit in 16 bits, so we provide limiting. */
+  if (cinfo->restart_in_rows > 0) {
+    long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row;
+    cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L);
+  }
+}
+
+
+/*
+ * Per-pass setup.
+ * This is called at the beginning of each pass.  We determine which modules
+ * will be active during this pass and give them appropriate start_pass calls.
+ * We also set is_last_pass to indicate whether any more passes will be
+ * required.
+ */
+
+METHODDEF(void)
+prepare_for_pass (j_compress_ptr cinfo)
+{
+  my_master_ptr master = (my_master_ptr) cinfo->master;
+
+  switch (master->pass_type) {
+  case main_pass:
+    /* Initial pass: will collect input data, and do either Huffman
+     * optimization or data output for the first scan.
+     */
+    select_scan_parameters(cinfo);
+    per_scan_setup(cinfo);
+    if (! cinfo->raw_data_in) {
+      (*cinfo->cconvert->start_pass) (cinfo);
+      (*cinfo->downsample->start_pass) (cinfo);
+      (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);
+    }
+    (*cinfo->fdct->start_pass) (cinfo);
+    (*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);
+    (*cinfo->coef->start_pass) (cinfo,
+				(master->total_passes > 1 ?
+				 JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
+    (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
+    if (cinfo->optimize_coding) {
+      /* No immediate data output; postpone writing frame/scan headers */
+      master->pub.call_pass_startup = FALSE;
+    } else {
+      /* Will write frame/scan headers at first jpeg_write_scanlines call */
+      master->pub.call_pass_startup = TRUE;
+    }
+    break;
+#ifdef ENTROPY_OPT_SUPPORTED
+  case huff_opt_pass:
+    /* Do Huffman optimization for a scan after the first one. */
+    select_scan_parameters(cinfo);
+    per_scan_setup(cinfo);
+    if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) {
+      (*cinfo->entropy->start_pass) (cinfo, TRUE);
+      (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
+      master->pub.call_pass_startup = FALSE;
+      break;
+    }
+    /* Special case: Huffman DC refinement scans need no Huffman table
+     * and therefore we can skip the optimization pass for them.
+     */
+    master->pass_type = output_pass;
+    master->pass_number++;
+    /*FALLTHROUGH*/
+#endif
+  case output_pass:
+    /* Do a data-output pass. */
+    /* We need not repeat per-scan setup if prior optimization pass did it. */
+    if (! cinfo->optimize_coding) {
+      select_scan_parameters(cinfo);
+      per_scan_setup(cinfo);
+    }
+    (*cinfo->entropy->start_pass) (cinfo, FALSE);
+    (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
+    /* We emit frame/scan headers now */
+    if (master->scan_number == 0)
+      (*cinfo->marker->write_frame_header) (cinfo);
+    (*cinfo->marker->write_scan_header) (cinfo);
+    master->pub.call_pass_startup = FALSE;
+    break;
+  default:
+    ERREXIT(cinfo, JERR_NOT_COMPILED);
+  }
+
+  master->pub.is_last_pass = (master->pass_number == master->total_passes-1);
+
+  /* Set up progress monitor's pass info if present */
+  if (cinfo->progress != NULL) {
+    cinfo->progress->completed_passes = master->pass_number;
+    cinfo->progress->total_passes = master->total_passes;
+  }
+}
+
+
+/*
+ * Special start-of-pass hook.
+ * This is called by jpeg_write_scanlines if call_pass_startup is TRUE.
+ * In single-pass processing, we need this hook because we don't want to
+ * write frame/scan headers during jpeg_start_compress; we want to let the
+ * application write COM markers etc. between jpeg_start_compress and the
+ * jpeg_write_scanlines loop.
+ * In multi-pass processing, this routine is not used.
+ */
+
+METHODDEF(void)
+pass_startup (j_compress_ptr cinfo)
+{
+  cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */
+
+  (*cinfo->marker->write_frame_header) (cinfo);
+  (*cinfo->marker->write_scan_header) (cinfo);
+}
+
+
+/*
+ * Finish up at end of pass.
+ */
+
+METHODDEF(void)
+finish_pass_master (j_compress_ptr cinfo)
+{
+  my_master_ptr master = (my_master_ptr) cinfo->master;
+
+  /* The entropy coder always needs an end-of-pass call,
+   * either to analyze statistics or to flush its output buffer.
+   */
+  (*cinfo->entropy->finish_pass) (cinfo);
+
+  /* Update state for next pass */
+  switch (master->pass_type) {
+  case main_pass:
+    /* next pass is either output of scan 0 (after optimization)
+     * or output of scan 1 (if no optimization).
+     */
+    master->pass_type = output_pass;
+    if (! cinfo->optimize_coding)
+      master->scan_number++;
+    break;
+  case huff_opt_pass:
+    /* next pass is always output of current scan */
+    master->pass_type = output_pass;
+    break;
+  case output_pass:
+    /* next pass is either optimization or output of next scan */
+    if (cinfo->optimize_coding)
+      master->pass_type = huff_opt_pass;
+    master->scan_number++;
+    break;
+  }
+
+  master->pass_number++;
+}
+
+
+/*
+ * Initialize master compression control.
+ */
+
+GLOBAL(void)
+jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
+{
+  my_master_ptr master;
+
+  master = (my_master_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(my_comp_master));
+  cinfo->master = (struct jpeg_comp_master *) master;
+  master->pub.prepare_for_pass = prepare_for_pass;
+  master->pub.pass_startup = pass_startup;
+  master->pub.finish_pass = finish_pass_master;
+  master->pub.is_last_pass = FALSE;
+
+  /* Validate parameters, determine derived values */
+  initial_setup(cinfo);
+
+  if (cinfo->scan_info != NULL) {
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+    validate_script(cinfo);
+#else
+    ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+  } else {
+    cinfo->progressive_mode = FALSE;
+    cinfo->num_scans = 1;
+  }
+
+  if (cinfo->progressive_mode)	/*  TEMPORARY HACK ??? */
+    cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */
+
+  /* Initialize my private state */
+  if (transcode_only) {
+    /* no main pass in transcoding */
+    if (cinfo->optimize_coding)
+      master->pass_type = huff_opt_pass;
+    else
+      master->pass_type = output_pass;
+  } else {
+    /* for normal compression, first pass is always this type: */
+    master->pass_type = main_pass;
+  }
+  master->scan_number = 0;
+  master->pass_number = 0;
+  if (cinfo->optimize_coding)
+    master->total_passes = cinfo->num_scans * 2;
+  else
+    master->total_passes = cinfo->num_scans;
+}
diff --git a/src/libjpeg/jcomapi.c b/src/libjpeg/jcomapi.c
new file mode 100644
index 0000000..1b1a340
--- /dev/null
+++ b/src/libjpeg/jcomapi.c
@@ -0,0 +1,106 @@
+/*
+ * jcomapi.c
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains application interface routines that are used for both
+ * compression and decompression.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Abort processing of a JPEG compression or decompression operation,
+ * but don't destroy the object itself.
+ *
+ * For this, we merely clean up all the nonpermanent memory pools.
+ * Note that temp files (virtual arrays) are not allowed to belong to
+ * the permanent pool, so we will be able to close all temp files here.
+ * Closing a data source or destination, if necessary, is the application's
+ * responsibility.
+ */
+
+GLOBAL(void)
+jpeg_abort (j_common_ptr cinfo)
+{
+  int pool;
+
+  /* Do nothing if called on a not-initialized or destroyed JPEG object. */
+  if (cinfo->mem == NULL)
+    return;
+
+  /* Releasing pools in reverse order might help avoid fragmentation
+   * with some (brain-damaged) malloc libraries.
+   */
+  for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {
+    (*cinfo->mem->free_pool) (cinfo, pool);
+  }
+
+  /* Reset overall state for possible reuse of object */
+  if (cinfo->is_decompressor) {
+    cinfo->global_state = DSTATE_START;
+    /* Try to keep application from accessing now-deleted marker list.
+     * A bit kludgy to do it here, but this is the most central place.
+     */
+    ((j_decompress_ptr) cinfo)->marker_list = NULL;
+  } else {
+    cinfo->global_state = CSTATE_START;
+  }
+}
+
+
+/*
+ * Destruction of a JPEG object.
+ *
+ * Everything gets deallocated except the master jpeg_compress_struct itself
+ * and the error manager struct.  Both of these are supplied by the application
+ * and must be freed, if necessary, by the application.  (Often they are on
+ * the stack and so don't need to be freed anyway.)
+ * Closing a data source or destination, if necessary, is the application's
+ * responsibility.
+ */
+
+GLOBAL(void)
+jpeg_destroy (j_common_ptr cinfo)
+{
+  /* We need only tell the memory manager to release everything. */
+  /* NB: mem pointer is NULL if memory mgr failed to initialize. */
+  if (cinfo->mem != NULL)
+    (*cinfo->mem->self_destruct) (cinfo);
+  cinfo->mem = NULL;		/* be safe if jpeg_destroy is called twice */
+  cinfo->global_state = 0;	/* mark it destroyed */
+}
+
+
+/*
+ * Convenience routines for allocating quantization and Huffman tables.
+ * (Would jutils.c be a more reasonable place to put these?)
+ */
+
+GLOBAL(JQUANT_TBL *)
+jpeg_alloc_quant_table (j_common_ptr cinfo)
+{
+  JQUANT_TBL *tbl;
+
+  tbl = (JQUANT_TBL *)
+    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));
+  tbl->sent_table = FALSE;	/* make sure this is false in any new table */
+  return tbl;
+}
+
+
+GLOBAL(JHUFF_TBL *)
+jpeg_alloc_huff_table (j_common_ptr cinfo)
+{
+  JHUFF_TBL *tbl;
+
+  tbl = (JHUFF_TBL *)
+    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));
+  tbl->sent_table = FALSE;	/* make sure this is false in any new table */
+  return tbl;
+}
diff --git a/src/libjpeg/jconfig.h b/src/libjpeg/jconfig.h
new file mode 100644
index 0000000..2f4da14
--- /dev/null
+++ b/src/libjpeg/jconfig.h
@@ -0,0 +1,45 @@
+/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
+/* see jconfig.doc for explanations */
+
+#define HAVE_PROTOTYPES
+#define HAVE_UNSIGNED_CHAR
+#define HAVE_UNSIGNED_SHORT
+/* #define void char */
+/* #define const */
+#undef CHAR_IS_UNSIGNED
+#define HAVE_STDDEF_H
+#define HAVE_STDLIB_H
+#undef NEED_BSD_STRINGS
+#undef NEED_SYS_TYPES_H
+#undef NEED_FAR_POINTERS	/* we presume a 32-bit flat memory model */
+#undef NEED_SHORT_EXTERNAL_NAMES
+#undef INCOMPLETE_TYPES_BROKEN
+
+/* Define "boolean" as unsigned char, not int, per Windows custom */
+#ifndef __RPCNDR_H__		/* don't conflict if rpcndr.h already read */
+typedef unsigned char boolean;
+#endif
+#define HAVE_BOOLEAN		/* prevent jmorecfg.h from redefining it */
+
+
+#ifdef JPEG_INTERNALS
+
+#undef RIGHT_SHIFT_IS_UNSIGNED
+
+#endif /* JPEG_INTERNALS */
+
+#ifdef JPEG_CJPEG_DJPEG
+
+#define BMP_SUPPORTED		/* BMP image file format */
+#define GIF_SUPPORTED		/* GIF image file format */
+#define PPM_SUPPORTED		/* PBMPLUS PPM/PGM image file format */
+#undef RLE_SUPPORTED		/* Utah RLE image file format */
+#define TARGA_SUPPORTED		/* Targa image file format */
+
+#define TWO_FILE_COMMANDLINE	/* optional */
+#define USE_SETMODE		/* Microsoft has setmode() */
+#undef NEED_SIGNAL_CATCHER
+#undef DONT_USE_B_MODE
+#undef PROGRESS_REPORT		/* optional */
+
+#endif /* JPEG_CJPEG_DJPEG */
diff --git a/src/libjpeg/jcparam.c b/src/libjpeg/jcparam.c
new file mode 100644
index 0000000..bbd175c
--- /dev/null
+++ b/src/libjpeg/jcparam.c
@@ -0,0 +1,610 @@
+/*
+ * jcparam.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains optional default-setting code for the JPEG compressor.
+ * Applications do not have to use this file, but those that don't use it
+ * must know a lot more about the innards of the JPEG code.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Quantization table setup routines
+ */
+
+GLOBAL(void)
+jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
+		      const unsigned int *basic_table,
+		      int scale_factor, boolean force_baseline)
+/* Define a quantization table equal to the basic_table times
+ * a scale factor (given as a percentage).
+ * If force_baseline is TRUE, the computed quantization table entries
+ * are limited to 1..255 for JPEG baseline compatibility.
+ */
+{
+  JQUANT_TBL ** qtblptr;
+  int i;
+  long temp;
+
+  /* Safety check to ensure start_compress not called yet. */
+  if (cinfo->global_state != CSTATE_START)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+  if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)
+    ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);
+
+  qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];
+
+  if (*qtblptr == NULL)
+    *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);
+
+  for (i = 0; i < DCTSIZE2; i++) {
+    temp = ((long) basic_table[i] * scale_factor + 50L) / 100L;
+    /* limit the values to the valid range */
+    if (temp <= 0L) temp = 1L;
+    if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */
+    if (force_baseline && temp > 255L)
+      temp = 255L;		/* limit to baseline range if requested */
+    (*qtblptr)->quantval[i] = (UINT16) temp;
+  }
+
+  /* Initialize sent_table FALSE so table will be written to JPEG file. */
+  (*qtblptr)->sent_table = FALSE;
+}
+
+
+GLOBAL(void)
+jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
+			 boolean force_baseline)
+/* Set or change the 'quality' (quantization) setting, using default tables
+ * and a straight percentage-scaling quality scale.  In most cases it's better
+ * to use jpeg_set_quality (below); this entry point is provided for
+ * applications that insist on a linear percentage scaling.
+ */
+{
+  /* These are the sample quantization tables given in JPEG spec section K.1.
+   * The spec says that the values given produce "good" quality, and
+   * when divided by 2, "very good" quality.
+   */
+  static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
+    16,  11,  10,  16,  24,  40,  51,  61,
+    12,  12,  14,  19,  26,  58,  60,  55,
+    14,  13,  16,  24,  40,  57,  69,  56,
+    14,  17,  22,  29,  51,  87,  80,  62,
+    18,  22,  37,  56,  68, 109, 103,  77,
+    24,  35,  55,  64,  81, 104, 113,  92,
+    49,  64,  78,  87, 103, 121, 120, 101,
+    72,  92,  95,  98, 112, 100, 103,  99
+  };
+  static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
+    17,  18,  24,  47,  99,  99,  99,  99,
+    18,  21,  26,  66,  99,  99,  99,  99,
+    24,  26,  56,  99,  99,  99,  99,  99,
+    47,  66,  99,  99,  99,  99,  99,  99,
+    99,  99,  99,  99,  99,  99,  99,  99,
+    99,  99,  99,  99,  99,  99,  99,  99,
+    99,  99,  99,  99,  99,  99,  99,  99,
+    99,  99,  99,  99,  99,  99,  99,  99
+  };
+
+  /* Set up two quantization tables using the specified scaling */
+  jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
+		       scale_factor, force_baseline);
+  jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
+		       scale_factor, force_baseline);
+}
+
+
+GLOBAL(int)
+jpeg_quality_scaling (int quality)
+/* Convert a user-specified quality rating to a percentage scaling factor
+ * for an underlying quantization table, using our recommended scaling curve.
+ * The input 'quality' factor should be 0 (terrible) to 100 (very good).
+ */
+{
+  /* Safety limit on quality factor.  Convert 0 to 1 to avoid zero divide. */
+  if (quality <= 0) quality = 1;
+  if (quality > 100) quality = 100;
+
+  /* The basic table is used as-is (scaling 100) for a quality of 50.
+   * Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
+   * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table
+   * to make all the table entries 1 (hence, minimum quantization loss).
+   * Qualities 1..50 are converted to scaling percentage 5000/Q.
+   */
+  if (quality < 50)
+    quality = 5000 / quality;
+  else
+    quality = 200 - quality*2;
+
+  return quality;
+}
+
+
+GLOBAL(void)
+jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
+/* Set or change the 'quality' (quantization) setting, using default tables.
+ * This is the standard quality-adjusting entry point for typical user
+ * interfaces; only those who want detailed control over quantization tables
+ * would use the preceding three routines directly.
+ */
+{
+  /* Convert user 0-100 rating to percentage scaling */
+  quality = jpeg_quality_scaling(quality);
+
+  /* Set up standard quality tables */
+  jpeg_set_linear_quality(cinfo, quality, force_baseline);
+}
+
+
+/*
+ * Huffman table setup routines
+ */
+
+LOCAL(void)
+add_huff_table (j_compress_ptr cinfo,
+		JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
+/* Define a Huffman table */
+{
+  int nsymbols, len;
+
+  if (*htblptr == NULL)
+    *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
+
+  /* Copy the number-of-symbols-of-each-code-length counts */
+  MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
+
+  /* Validate the counts.  We do this here mainly so we can copy the right
+   * number of symbols from the val[] array, without risking marching off
+   * the end of memory.  jchuff.c will do a more thorough test later.
+   */
+  nsymbols = 0;
+  for (len = 1; len <= 16; len++)
+    nsymbols += bits[len];
+  if (nsymbols < 1 || nsymbols > 256)
+    ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+
+  MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
+
+  /* Initialize sent_table FALSE so table will be written to JPEG file. */
+  (*htblptr)->sent_table = FALSE;
+}
+
+
+LOCAL(void)
+std_huff_tables (j_compress_ptr cinfo)
+/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
+/* IMPORTANT: these are only valid for 8-bit data precision! */
+{
+  static const UINT8 bits_dc_luminance[17] =
+    { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
+  static const UINT8 val_dc_luminance[] =
+    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
+  
+  static const UINT8 bits_dc_chrominance[17] =
+    { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
+  static const UINT8 val_dc_chrominance[] =
+    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
+  
+  static const UINT8 bits_ac_luminance[17] =
+    { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
+  static const UINT8 val_ac_luminance[] =
+    { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
+      0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
+      0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
+      0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
+      0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
+      0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
+      0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
+      0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
+      0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
+      0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
+      0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
+      0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
+      0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
+      0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+      0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
+      0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
+      0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
+      0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
+      0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
+      0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
+      0xf9, 0xfa };
+  
+  static const UINT8 bits_ac_chrominance[17] =
+    { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
+  static const UINT8 val_ac_chrominance[] =
+    { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
+      0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
+      0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
+      0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
+      0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
+      0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
+      0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
+      0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
+      0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
+      0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+      0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
+      0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+      0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
+      0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
+      0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
+      0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
+      0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
+      0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
+      0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
+      0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
+      0xf9, 0xfa };
+  
+  add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
+		 bits_dc_luminance, val_dc_luminance);
+  add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
+		 bits_ac_luminance, val_ac_luminance);
+  add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
+		 bits_dc_chrominance, val_dc_chrominance);
+  add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
+		 bits_ac_chrominance, val_ac_chrominance);
+}
+
+
+/*
+ * Default parameter setup for compression.
+ *
+ * Applications that don't choose to use this routine must do their
+ * own setup of all these parameters.  Alternately, you can call this
+ * to establish defaults and then alter parameters selectively.  This
+ * is the recommended approach since, if we add any new parameters,
+ * your code will still work (they'll be set to reasonable defaults).
+ */
+
+GLOBAL(void)
+jpeg_set_defaults (j_compress_ptr cinfo)
+{
+  int i;
+
+  /* Safety check to ensure start_compress not called yet. */
+  if (cinfo->global_state != CSTATE_START)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+  /* Allocate comp_info array large enough for maximum component count.
+   * Array is made permanent in case application wants to compress
+   * multiple images at same param settings.
+   */
+  if (cinfo->comp_info == NULL)
+    cinfo->comp_info = (jpeg_component_info *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+				  MAX_COMPONENTS * SIZEOF(jpeg_component_info));
+
+  /* Initialize everything not dependent on the color space */
+
+  cinfo->data_precision = BITS_IN_JSAMPLE;
+  /* Set up two quantization tables using default quality of 75 */
+  jpeg_set_quality(cinfo, 75, TRUE);
+  /* Set up two Huffman tables */
+  std_huff_tables(cinfo);
+
+  /* Initialize default arithmetic coding conditioning */
+  for (i = 0; i < NUM_ARITH_TBLS; i++) {
+    cinfo->arith_dc_L[i] = 0;
+    cinfo->arith_dc_U[i] = 1;
+    cinfo->arith_ac_K[i] = 5;
+  }
+
+  /* Default is no multiple-scan output */
+  cinfo->scan_info = NULL;
+  cinfo->num_scans = 0;
+
+  /* Expect normal source image, not raw downsampled data */
+  cinfo->raw_data_in = FALSE;
+
+  /* Use Huffman coding, not arithmetic coding, by default */
+  cinfo->arith_code = FALSE;
+
+  /* By default, don't do extra passes to optimize entropy coding */
+  cinfo->optimize_coding = FALSE;
+  /* The standard Huffman tables are only valid for 8-bit data precision.
+   * If the precision is higher, force optimization on so that usable
+   * tables will be computed.  This test can be removed if default tables
+   * are supplied that are valid for the desired precision.
+   */
+  if (cinfo->data_precision > 8)
+    cinfo->optimize_coding = TRUE;
+
+  /* By default, use the simpler non-cosited sampling alignment */
+  cinfo->CCIR601_sampling = FALSE;
+
+  /* No input smoothing */
+  cinfo->smoothing_factor = 0;
+
+  /* DCT algorithm preference */
+  cinfo->dct_method = JDCT_DEFAULT;
+
+  /* No restart markers */
+  cinfo->restart_interval = 0;
+  cinfo->restart_in_rows = 0;
+
+  /* Fill in default JFIF marker parameters.  Note that whether the marker
+   * will actually be written is determined by jpeg_set_colorspace.
+   *
+   * By default, the library emits JFIF version code 1.01.
+   * An application that wants to emit JFIF 1.02 extension markers should set
+   * JFIF_minor_version to 2.  We could probably get away with just defaulting
+   * to 1.02, but there may still be some decoders in use that will complain
+   * about that; saying 1.01 should minimize compatibility problems.
+   */
+  cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
+  cinfo->JFIF_minor_version = 1;
+  cinfo->density_unit = 0;	/* Pixel size is unknown by default */
+  cinfo->X_density = 1;		/* Pixel aspect ratio is square by default */
+  cinfo->Y_density = 1;
+
+  /* Choose JPEG colorspace based on input space, set defaults accordingly */
+
+  jpeg_default_colorspace(cinfo);
+}
+
+
+/*
+ * Select an appropriate JPEG colorspace for in_color_space.
+ */
+
+GLOBAL(void)
+jpeg_default_colorspace (j_compress_ptr cinfo)
+{
+  switch (cinfo->in_color_space) {
+  case JCS_GRAYSCALE:
+    jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
+    break;
+  case JCS_RGB:
+    jpeg_set_colorspace(cinfo, JCS_YCbCr);
+    break;
+  case JCS_YCbCr:
+    jpeg_set_colorspace(cinfo, JCS_YCbCr);
+    break;
+  case JCS_CMYK:
+    jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */
+    break;
+  case JCS_YCCK:
+    jpeg_set_colorspace(cinfo, JCS_YCCK);
+    break;
+  case JCS_UNKNOWN:
+    jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
+    break;
+  default:
+    ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+  }
+}
+
+
+/*
+ * Set the JPEG colorspace, and choose colorspace-dependent default values.
+ */
+
+GLOBAL(void)
+jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
+{
+  jpeg_component_info * compptr;
+  int ci;
+
+#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl)  \
+  (compptr = &cinfo->comp_info[index], \
+   compptr->component_id = (id), \
+   compptr->h_samp_factor = (hsamp), \
+   compptr->v_samp_factor = (vsamp), \
+   compptr->quant_tbl_no = (quant), \
+   compptr->dc_tbl_no = (dctbl), \
+   compptr->ac_tbl_no = (actbl) )
+
+  /* Safety check to ensure start_compress not called yet. */
+  if (cinfo->global_state != CSTATE_START)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+  /* For all colorspaces, we use Q and Huff tables 0 for luminance components,
+   * tables 1 for chrominance components.
+   */
+
+  cinfo->jpeg_color_space = colorspace;
+
+  cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */
+  cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
+
+  switch (colorspace) {
+  case JCS_GRAYSCALE:
+    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
+    cinfo->num_components = 1;
+    /* JFIF specifies component ID 1 */
+    SET_COMP(0, 1, 1,1, 0, 0,0);
+    break;
+  case JCS_RGB:
+    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
+    cinfo->num_components = 3;
+    SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0);
+    SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);
+    SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0);
+    break;
+  case JCS_YCbCr:
+    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
+    cinfo->num_components = 3;
+    /* JFIF specifies component IDs 1,2,3 */
+    /* We default to 2x2 subsamples of chrominance */
+    SET_COMP(0, 1, 2,2, 0, 0,0);
+    SET_COMP(1, 2, 1,1, 1, 1,1);
+    SET_COMP(2, 3, 1,1, 1, 1,1);
+    break;
+  case JCS_CMYK:
+    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
+    cinfo->num_components = 4;
+    SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0);
+    SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0);
+    SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0);
+    SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0);
+    break;
+  case JCS_YCCK:
+    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
+    cinfo->num_components = 4;
+    SET_COMP(0, 1, 2,2, 0, 0,0);
+    SET_COMP(1, 2, 1,1, 1, 1,1);
+    SET_COMP(2, 3, 1,1, 1, 1,1);
+    SET_COMP(3, 4, 2,2, 0, 0,0);
+    break;
+  case JCS_UNKNOWN:
+    cinfo->num_components = cinfo->input_components;
+    if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
+      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
+	       MAX_COMPONENTS);
+    for (ci = 0; ci < cinfo->num_components; ci++) {
+      SET_COMP(ci, ci, 1,1, 0, 0,0);
+    }
+    break;
+  default:
+    ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+  }
+}
+
+
+#ifdef C_PROGRESSIVE_SUPPORTED
+
+LOCAL(jpeg_scan_info *)
+fill_a_scan (jpeg_scan_info * scanptr, int ci,
+	     int Ss, int Se, int Ah, int Al)
+/* Support routine: generate one scan for specified component */
+{
+  scanptr->comps_in_scan = 1;
+  scanptr->component_index[0] = ci;
+  scanptr->Ss = Ss;
+  scanptr->Se = Se;
+  scanptr->Ah = Ah;
+  scanptr->Al = Al;
+  scanptr++;
+  return scanptr;
+}
+
+LOCAL(jpeg_scan_info *)
+fill_scans (jpeg_scan_info * scanptr, int ncomps,
+	    int Ss, int Se, int Ah, int Al)
+/* Support routine: generate one scan for each component */
+{
+  int ci;
+
+  for (ci = 0; ci < ncomps; ci++) {
+    scanptr->comps_in_scan = 1;
+    scanptr->component_index[0] = ci;
+    scanptr->Ss = Ss;
+    scanptr->Se = Se;
+    scanptr->Ah = Ah;
+    scanptr->Al = Al;
+    scanptr++;
+  }
+  return scanptr;
+}
+
+LOCAL(jpeg_scan_info *)
+fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)
+/* Support routine: generate interleaved DC scan if possible, else N scans */
+{
+  int ci;
+
+  if (ncomps <= MAX_COMPS_IN_SCAN) {
+    /* Single interleaved DC scan */
+    scanptr->comps_in_scan = ncomps;
+    for (ci = 0; ci < ncomps; ci++)
+      scanptr->component_index[ci] = ci;
+    scanptr->Ss = scanptr->Se = 0;
+    scanptr->Ah = Ah;
+    scanptr->Al = Al;
+    scanptr++;
+  } else {
+    /* Noninterleaved DC scan for each component */
+    scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);
+  }
+  return scanptr;
+}
+
+
+/*
+ * Create a recommended progressive-JPEG script.
+ * cinfo->num_components and cinfo->jpeg_color_space must be correct.
+ */
+
+GLOBAL(void)
+jpeg_simple_progression (j_compress_ptr cinfo)
+{
+  int ncomps = cinfo->num_components;
+  int nscans;
+  jpeg_scan_info * scanptr;
+
+  /* Safety check to ensure start_compress not called yet. */
+  if (cinfo->global_state != CSTATE_START)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+  /* Figure space needed for script.  Calculation must match code below! */
+  if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
+    /* Custom script for YCbCr color images. */
+    nscans = 10;
+  } else {
+    /* All-purpose script for other color spaces. */
+    if (ncomps > MAX_COMPS_IN_SCAN)
+      nscans = 6 * ncomps;	/* 2 DC + 4 AC scans per component */
+    else
+      nscans = 2 + 4 * ncomps;	/* 2 DC scans; 4 AC scans per component */
+  }
+
+  /* Allocate space for script.
+   * We need to put it in the permanent pool in case the application performs
+   * multiple compressions without changing the settings.  To avoid a memory
+   * leak if jpeg_simple_progression is called repeatedly for the same JPEG
+   * object, we try to re-use previously allocated space, and we allocate
+   * enough space to handle YCbCr even if initially asked for grayscale.
+   */
+  if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {
+    cinfo->script_space_size = MAX(nscans, 10);
+    cinfo->script_space = (jpeg_scan_info *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+			cinfo->script_space_size * SIZEOF(jpeg_scan_info));
+  }
+  scanptr = cinfo->script_space;
+  cinfo->scan_info = scanptr;
+  cinfo->num_scans = nscans;
+
+  if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
+    /* Custom script for YCbCr color images. */
+    /* Initial DC scan */
+    scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
+    /* Initial AC scan: get some luma data out in a hurry */
+    scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2);
+    /* Chroma data is too small to be worth expending many scans on */
+    scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1);
+    scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1);
+    /* Complete spectral selection for luma AC */
+    scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2);
+    /* Refine next bit of luma AC */
+    scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1);
+    /* Finish DC successive approximation */
+    scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
+    /* Finish AC successive approximation */
+    scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0);
+    scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0);
+    /* Luma bottom bit comes last since it's usually largest scan */
+    scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0);
+  } else {
+    /* All-purpose script for other color spaces. */
+    /* Successive approximation first pass */
+    scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
+    scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2);
+    scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2);
+    /* Successive approximation second pass */
+    scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1);
+    /* Successive approximation final pass */
+    scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
+    scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);
+  }
+}
+
+#endif /* C_PROGRESSIVE_SUPPORTED */
diff --git a/src/libjpeg/jcphuff.c b/src/libjpeg/jcphuff.c
new file mode 100644
index 0000000..a4ee850
--- /dev/null
+++ b/src/libjpeg/jcphuff.c
@@ -0,0 +1,833 @@
+/*
+ * jcphuff.c
+ *
+ * Copyright (C) 1995-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains Huffman entropy encoding routines for progressive JPEG.
+ *
+ * We do not support output suspension in this module, since the library
+ * currently does not allow multiple-scan files to be written with output
+ * suspension.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jchuff.h"		/* Declarations shared with jchuff.c */
+
+#ifdef C_PROGRESSIVE_SUPPORTED
+
+/* Expanded entropy encoder object for progressive Huffman encoding. */
+
+typedef struct {
+  struct jpeg_entropy_encoder pub; /* public fields */
+
+  /* Mode flag: TRUE for optimization, FALSE for actual data output */
+  boolean gather_statistics;
+
+  /* Bit-level coding status.
+   * next_output_byte/free_in_buffer are local copies of cinfo->dest fields.
+   */
+  JOCTET * next_output_byte;	/* => next byte to write in buffer */
+  size_t free_in_buffer;	/* # of byte spaces remaining in buffer */
+  INT32 put_buffer;		/* current bit-accumulation buffer */
+  int put_bits;			/* # of bits now in it */
+  j_compress_ptr cinfo;		/* link to cinfo (needed for dump_buffer) */
+
+  /* Coding status for DC components */
+  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
+
+  /* Coding status for AC components */
+  int ac_tbl_no;		/* the table number of the single component */
+  unsigned int EOBRUN;		/* run length of EOBs */
+  unsigned int BE;		/* # of buffered correction bits before MCU */
+  char * bit_buffer;		/* buffer for correction bits (1 per char) */
+  /* packing correction bits tightly would save some space but cost time... */
+
+  unsigned int restarts_to_go;	/* MCUs left in this restart interval */
+  int next_restart_num;		/* next restart number to write (0-7) */
+
+  /* Pointers to derived tables (these workspaces have image lifespan).
+   * Since any one scan codes only DC or only AC, we only need one set
+   * of tables, not one for DC and one for AC.
+   */
+  c_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
+
+  /* Statistics tables for optimization; again, one set is enough */
+  long * count_ptrs[NUM_HUFF_TBLS];
+} phuff_entropy_encoder;
+
+typedef phuff_entropy_encoder * phuff_entropy_ptr;
+
+/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit
+ * buffer can hold.  Larger sizes may slightly improve compression, but
+ * 1000 is already well into the realm of overkill.
+ * The minimum safe size is 64 bits.
+ */
+
+#define MAX_CORR_BITS  1000	/* Max # of correction bits I can buffer */
+
+/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.
+ * We assume that int right shift is unsigned if INT32 right shift is,
+ * which should be safe.
+ */
+
+#ifdef RIGHT_SHIFT_IS_UNSIGNED
+#define ISHIFT_TEMPS	int ishift_temp;
+#define IRIGHT_SHIFT(x,shft)  \
+	((ishift_temp = (x)) < 0 ? \
+	 (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \
+	 (ishift_temp >> (shft)))
+#else
+#define ISHIFT_TEMPS
+#define IRIGHT_SHIFT(x,shft)	((x) >> (shft))
+#endif
+
+/* Forward declarations */
+METHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo,
+					    JBLOCKROW *MCU_data));
+METHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo,
+					    JBLOCKROW *MCU_data));
+METHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo,
+					     JBLOCKROW *MCU_data));
+METHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo,
+					     JBLOCKROW *MCU_data));
+METHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo));
+METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo));
+
+
+/*
+ * Initialize for a Huffman-compressed scan using progressive JPEG.
+ */
+
+METHODDEF(void)
+start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)
+{  
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  boolean is_DC_band;
+  int ci, tbl;
+  jpeg_component_info * compptr;
+
+  entropy->cinfo = cinfo;
+  entropy->gather_statistics = gather_statistics;
+
+  is_DC_band = (cinfo->Ss == 0);
+
+  /* We assume jcmaster.c already validated the scan parameters. */
+
+  /* Select execution routines */
+  if (cinfo->Ah == 0) {
+    if (is_DC_band)
+      entropy->pub.encode_mcu = encode_mcu_DC_first;
+    else
+      entropy->pub.encode_mcu = encode_mcu_AC_first;
+  } else {
+    if (is_DC_band)
+      entropy->pub.encode_mcu = encode_mcu_DC_refine;
+    else {
+      entropy->pub.encode_mcu = encode_mcu_AC_refine;
+      /* AC refinement needs a correction bit buffer */
+      if (entropy->bit_buffer == NULL)
+	entropy->bit_buffer = (char *)
+	  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				      MAX_CORR_BITS * SIZEOF(char));
+    }
+  }
+  if (gather_statistics)
+    entropy->pub.finish_pass = finish_pass_gather_phuff;
+  else
+    entropy->pub.finish_pass = finish_pass_phuff;
+
+  /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1
+   * for AC coefficients.
+   */
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    compptr = cinfo->cur_comp_info[ci];
+    /* Initialize DC predictions to 0 */
+    entropy->last_dc_val[ci] = 0;
+    /* Get table index */
+    if (is_DC_band) {
+      if (cinfo->Ah != 0)	/* DC refinement needs no table */
+	continue;
+      tbl = compptr->dc_tbl_no;
+    } else {
+      entropy->ac_tbl_no = tbl = compptr->ac_tbl_no;
+    }
+    if (gather_statistics) {
+      /* Check for invalid table index */
+      /* (make_c_derived_tbl does this in the other path) */
+      if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
+        ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
+      /* Allocate and zero the statistics tables */
+      /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
+      if (entropy->count_ptrs[tbl] == NULL)
+	entropy->count_ptrs[tbl] = (long *)
+	  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				      257 * SIZEOF(long));
+      MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long));
+    } else {
+      /* Compute derived values for Huffman table */
+      /* We may do this more than once for a table, but it's not expensive */
+      jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl,
+			      & entropy->derived_tbls[tbl]);
+    }
+  }
+
+  /* Initialize AC stuff */
+  entropy->EOBRUN = 0;
+  entropy->BE = 0;
+
+  /* Initialize bit buffer to empty */
+  entropy->put_buffer = 0;
+  entropy->put_bits = 0;
+
+  /* Initialize restart stuff */
+  entropy->restarts_to_go = cinfo->restart_interval;
+  entropy->next_restart_num = 0;
+}
+
+
+/* Outputting bytes to the file.
+ * NB: these must be called only when actually outputting,
+ * that is, entropy->gather_statistics == FALSE.
+ */
+
+/* Emit a byte */
+#define emit_byte(entropy,val)  \
+	{ *(entropy)->next_output_byte++ = (JOCTET) (val);  \
+	  if (--(entropy)->free_in_buffer == 0)  \
+	    dump_buffer(entropy); }
+
+
+LOCAL(void)
+dump_buffer (phuff_entropy_ptr entropy)
+/* Empty the output buffer; we do not support suspension in this module. */
+{
+  struct jpeg_destination_mgr * dest = entropy->cinfo->dest;
+
+  if (! (*dest->empty_output_buffer) (entropy->cinfo))
+    ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);
+  /* After a successful buffer dump, must reset buffer pointers */
+  entropy->next_output_byte = dest->next_output_byte;
+  entropy->free_in_buffer = dest->free_in_buffer;
+}
+
+
+/* Outputting bits to the file */
+
+/* Only the right 24 bits of put_buffer are used; the valid bits are
+ * left-justified in this part.  At most 16 bits can be passed to emit_bits
+ * in one call, and we never retain more than 7 bits in put_buffer
+ * between calls, so 24 bits are sufficient.
+ */
+
+INLINE
+LOCAL(void)
+emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)
+/* Emit some bits, unless we are in gather mode */
+{
+  /* This routine is heavily used, so it's worth coding tightly. */
+  register INT32 put_buffer = (INT32) code;
+  register int put_bits = entropy->put_bits;
+
+  /* if size is 0, caller used an invalid Huffman table entry */
+  if (size == 0)
+    ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
+
+  if (entropy->gather_statistics)
+    return;			/* do nothing if we're only getting stats */
+
+  put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
+  
+  put_bits += size;		/* new number of bits in buffer */
+  
+  put_buffer <<= 24 - put_bits; /* align incoming bits */
+
+  put_buffer |= entropy->put_buffer; /* and merge with old buffer contents */
+
+  while (put_bits >= 8) {
+    int c = (int) ((put_buffer >> 16) & 0xFF);
+    
+    emit_byte(entropy, c);
+    if (c == 0xFF) {		/* need to stuff a zero byte? */
+      emit_byte(entropy, 0);
+    }
+    put_buffer <<= 8;
+    put_bits -= 8;
+  }
+
+  entropy->put_buffer = put_buffer; /* update variables */
+  entropy->put_bits = put_bits;
+}
+
+
+LOCAL(void)
+flush_bits (phuff_entropy_ptr entropy)
+{
+  emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */
+  entropy->put_buffer = 0;     /* and reset bit-buffer to empty */
+  entropy->put_bits = 0;
+}
+
+
+/*
+ * Emit (or just count) a Huffman symbol.
+ */
+
+INLINE
+LOCAL(void)
+emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)
+{
+  if (entropy->gather_statistics)
+    entropy->count_ptrs[tbl_no][symbol]++;
+  else {
+    c_derived_tbl * tbl = entropy->derived_tbls[tbl_no];
+    emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);
+  }
+}
+
+
+/*
+ * Emit bits from a correction bit buffer.
+ */
+
+LOCAL(void)
+emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart,
+		    unsigned int nbits)
+{
+  if (entropy->gather_statistics)
+    return;			/* no real work */
+
+  while (nbits > 0) {
+    emit_bits(entropy, (unsigned int) (*bufstart), 1);
+    bufstart++;
+    nbits--;
+  }
+}
+
+
+/*
+ * Emit any pending EOBRUN symbol.
+ */
+
+LOCAL(void)
+emit_eobrun (phuff_entropy_ptr entropy)
+{
+  register int temp, nbits;
+
+  if (entropy->EOBRUN > 0) {	/* if there is any pending EOBRUN */
+    temp = entropy->EOBRUN;
+    nbits = 0;
+    while ((temp >>= 1))
+      nbits++;
+    /* safety check: shouldn't happen given limited correction-bit buffer */
+    if (nbits > 14)
+      ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
+
+    emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4);
+    if (nbits)
+      emit_bits(entropy, entropy->EOBRUN, nbits);
+
+    entropy->EOBRUN = 0;
+
+    /* Emit any buffered correction bits */
+    emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);
+    entropy->BE = 0;
+  }
+}
+
+
+/*
+ * Emit a restart marker & resynchronize predictions.
+ */
+
+LOCAL(void)
+emit_restart (phuff_entropy_ptr entropy, int restart_num)
+{
+  int ci;
+
+  emit_eobrun(entropy);
+
+  if (! entropy->gather_statistics) {
+    flush_bits(entropy);
+    emit_byte(entropy, 0xFF);
+    emit_byte(entropy, JPEG_RST0 + restart_num);
+  }
+
+  if (entropy->cinfo->Ss == 0) {
+    /* Re-initialize DC predictions to 0 */
+    for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)
+      entropy->last_dc_val[ci] = 0;
+  } else {
+    /* Re-initialize all AC-related fields to 0 */
+    entropy->EOBRUN = 0;
+    entropy->BE = 0;
+  }
+}
+
+
+/*
+ * MCU encoding for DC initial scan (either spectral selection,
+ * or first pass of successive approximation).
+ */
+
+METHODDEF(boolean)
+encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  register int temp, temp2;
+  register int nbits;
+  int blkn, ci;
+  int Al = cinfo->Al;
+  JBLOCKROW block;
+  jpeg_component_info * compptr;
+  ISHIFT_TEMPS
+
+  entropy->next_output_byte = cinfo->dest->next_output_byte;
+  entropy->free_in_buffer = cinfo->dest->free_in_buffer;
+
+  /* Emit restart marker if needed */
+  if (cinfo->restart_interval)
+    if (entropy->restarts_to_go == 0)
+      emit_restart(entropy, entropy->next_restart_num);
+
+  /* Encode the MCU data blocks */
+  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+    block = MCU_data[blkn];
+    ci = cinfo->MCU_membership[blkn];
+    compptr = cinfo->cur_comp_info[ci];
+
+    /* Compute the DC value after the required point transform by Al.
+     * This is simply an arithmetic right shift.
+     */
+    temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al);
+
+    /* DC differences are figured on the point-transformed values. */
+    temp = temp2 - entropy->last_dc_val[ci];
+    entropy->last_dc_val[ci] = temp2;
+
+    /* Encode the DC coefficient difference per section G.1.2.1 */
+    temp2 = temp;
+    if (temp < 0) {
+      temp = -temp;		/* temp is abs value of input */
+      /* For a negative input, want temp2 = bitwise complement of abs(input) */
+      /* This code assumes we are on a two's complement machine */
+      temp2--;
+    }
+    
+    /* Find the number of bits needed for the magnitude of the coefficient */
+    nbits = 0;
+    while (temp) {
+      nbits++;
+      temp >>= 1;
+    }
+    /* Check for out-of-range coefficient values.
+     * Since we're encoding a difference, the range limit is twice as much.
+     */
+    if (nbits > MAX_COEF_BITS+1)
+      ERREXIT(cinfo, JERR_BAD_DCT_COEF);
+    
+    /* Count/emit the Huffman-coded symbol for the number of bits */
+    emit_symbol(entropy, compptr->dc_tbl_no, nbits);
+    
+    /* Emit that number of bits of the value, if positive, */
+    /* or the complement of its magnitude, if negative. */
+    if (nbits)			/* emit_bits rejects calls with size 0 */
+      emit_bits(entropy, (unsigned int) temp2, nbits);
+  }
+
+  cinfo->dest->next_output_byte = entropy->next_output_byte;
+  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
+
+  /* Update restart-interval state too */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0) {
+      entropy->restarts_to_go = cinfo->restart_interval;
+      entropy->next_restart_num++;
+      entropy->next_restart_num &= 7;
+    }
+    entropy->restarts_to_go--;
+  }
+
+  return TRUE;
+}
+
+
+/*
+ * MCU encoding for AC initial scan (either spectral selection,
+ * or first pass of successive approximation).
+ */
+
+METHODDEF(boolean)
+encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  register int temp, temp2;
+  register int nbits;
+  register int r, k;
+  int Se = cinfo->Se;
+  int Al = cinfo->Al;
+  JBLOCKROW block;
+
+  entropy->next_output_byte = cinfo->dest->next_output_byte;
+  entropy->free_in_buffer = cinfo->dest->free_in_buffer;
+
+  /* Emit restart marker if needed */
+  if (cinfo->restart_interval)
+    if (entropy->restarts_to_go == 0)
+      emit_restart(entropy, entropy->next_restart_num);
+
+  /* Encode the MCU data block */
+  block = MCU_data[0];
+
+  /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */
+  
+  r = 0;			/* r = run length of zeros */
+   
+  for (k = cinfo->Ss; k <= Se; k++) {
+    if ((temp = (*block)[jpeg_natural_order[k]]) == 0) {
+      r++;
+      continue;
+    }
+    /* We must apply the point transform by Al.  For AC coefficients this
+     * is an integer division with rounding towards 0.  To do this portably
+     * in C, we shift after obtaining the absolute value; so the code is
+     * interwoven with finding the abs value (temp) and output bits (temp2).
+     */
+    if (temp < 0) {
+      temp = -temp;		/* temp is abs value of input */
+      temp >>= Al;		/* apply the point transform */
+      /* For a negative coef, want temp2 = bitwise complement of abs(coef) */
+      temp2 = ~temp;
+    } else {
+      temp >>= Al;		/* apply the point transform */
+      temp2 = temp;
+    }
+    /* Watch out for case that nonzero coef is zero after point transform */
+    if (temp == 0) {
+      r++;
+      continue;
+    }
+
+    /* Emit any pending EOBRUN */
+    if (entropy->EOBRUN > 0)
+      emit_eobrun(entropy);
+    /* if run length > 15, must emit special run-length-16 codes (0xF0) */
+    while (r > 15) {
+      emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
+      r -= 16;
+    }
+
+    /* Find the number of bits needed for the magnitude of the coefficient */
+    nbits = 1;			/* there must be at least one 1 bit */
+    while ((temp >>= 1))
+      nbits++;
+    /* Check for out-of-range coefficient values */
+    if (nbits > MAX_COEF_BITS)
+      ERREXIT(cinfo, JERR_BAD_DCT_COEF);
+
+    /* Count/emit Huffman symbol for run length / number of bits */
+    emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);
+
+    /* Emit that number of bits of the value, if positive, */
+    /* or the complement of its magnitude, if negative. */
+    emit_bits(entropy, (unsigned int) temp2, nbits);
+
+    r = 0;			/* reset zero run length */
+  }
+
+  if (r > 0) {			/* If there are trailing zeroes, */
+    entropy->EOBRUN++;		/* count an EOB */
+    if (entropy->EOBRUN == 0x7FFF)
+      emit_eobrun(entropy);	/* force it out to avoid overflow */
+  }
+
+  cinfo->dest->next_output_byte = entropy->next_output_byte;
+  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
+
+  /* Update restart-interval state too */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0) {
+      entropy->restarts_to_go = cinfo->restart_interval;
+      entropy->next_restart_num++;
+      entropy->next_restart_num &= 7;
+    }
+    entropy->restarts_to_go--;
+  }
+
+  return TRUE;
+}
+
+
+/*
+ * MCU encoding for DC successive approximation refinement scan.
+ * Note: we assume such scans can be multi-component, although the spec
+ * is not very clear on the point.
+ */
+
+METHODDEF(boolean)
+encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  register int temp;
+  int blkn;
+  int Al = cinfo->Al;
+  JBLOCKROW block;
+
+  entropy->next_output_byte = cinfo->dest->next_output_byte;
+  entropy->free_in_buffer = cinfo->dest->free_in_buffer;
+
+  /* Emit restart marker if needed */
+  if (cinfo->restart_interval)
+    if (entropy->restarts_to_go == 0)
+      emit_restart(entropy, entropy->next_restart_num);
+
+  /* Encode the MCU data blocks */
+  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+    block = MCU_data[blkn];
+
+    /* We simply emit the Al'th bit of the DC coefficient value. */
+    temp = (*block)[0];
+    emit_bits(entropy, (unsigned int) (temp >> Al), 1);
+  }
+
+  cinfo->dest->next_output_byte = entropy->next_output_byte;
+  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
+
+  /* Update restart-interval state too */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0) {
+      entropy->restarts_to_go = cinfo->restart_interval;
+      entropy->next_restart_num++;
+      entropy->next_restart_num &= 7;
+    }
+    entropy->restarts_to_go--;
+  }
+
+  return TRUE;
+}
+
+
+/*
+ * MCU encoding for AC successive approximation refinement scan.
+ */
+
+METHODDEF(boolean)
+encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  register int temp;
+  register int r, k;
+  int EOB;
+  char *BR_buffer;
+  unsigned int BR;
+  int Se = cinfo->Se;
+  int Al = cinfo->Al;
+  JBLOCKROW block;
+  int absvalues[DCTSIZE2];
+
+  entropy->next_output_byte = cinfo->dest->next_output_byte;
+  entropy->free_in_buffer = cinfo->dest->free_in_buffer;
+
+  /* Emit restart marker if needed */
+  if (cinfo->restart_interval)
+    if (entropy->restarts_to_go == 0)
+      emit_restart(entropy, entropy->next_restart_num);
+
+  /* Encode the MCU data block */
+  block = MCU_data[0];
+
+  /* It is convenient to make a pre-pass to determine the transformed
+   * coefficients' absolute values and the EOB position.
+   */
+  EOB = 0;
+  for (k = cinfo->Ss; k <= Se; k++) {
+    temp = (*block)[jpeg_natural_order[k]];
+    /* We must apply the point transform by Al.  For AC coefficients this
+     * is an integer division with rounding towards 0.  To do this portably
+     * in C, we shift after obtaining the absolute value.
+     */
+    if (temp < 0)
+      temp = -temp;		/* temp is abs value of input */
+    temp >>= Al;		/* apply the point transform */
+    absvalues[k] = temp;	/* save abs value for main pass */
+    if (temp == 1)
+      EOB = k;			/* EOB = index of last newly-nonzero coef */
+  }
+
+  /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */
+  
+  r = 0;			/* r = run length of zeros */
+  BR = 0;			/* BR = count of buffered bits added now */
+  BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */
+
+  for (k = cinfo->Ss; k <= Se; k++) {
+    if ((temp = absvalues[k]) == 0) {
+      r++;
+      continue;
+    }
+
+    /* Emit any required ZRLs, but not if they can be folded into EOB */
+    while (r > 15 && k <= EOB) {
+      /* emit any pending EOBRUN and the BE correction bits */
+      emit_eobrun(entropy);
+      /* Emit ZRL */
+      emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
+      r -= 16;
+      /* Emit buffered correction bits that must be associated with ZRL */
+      emit_buffered_bits(entropy, BR_buffer, BR);
+      BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
+      BR = 0;
+    }
+
+    /* If the coef was previously nonzero, it only needs a correction bit.
+     * NOTE: a straight translation of the spec's figure G.7 would suggest
+     * that we also need to test r > 15.  But if r > 15, we can only get here
+     * if k > EOB, which implies that this coefficient is not 1.
+     */
+    if (temp > 1) {
+      /* The correction bit is the next bit of the absolute value. */
+      BR_buffer[BR++] = (char) (temp & 1);
+      continue;
+    }
+
+    /* Emit any pending EOBRUN and the BE correction bits */
+    emit_eobrun(entropy);
+
+    /* Count/emit Huffman symbol for run length / number of bits */
+    emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);
+
+    /* Emit output bit for newly-nonzero coef */
+    temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1;
+    emit_bits(entropy, (unsigned int) temp, 1);
+
+    /* Emit buffered correction bits that must be associated with this code */
+    emit_buffered_bits(entropy, BR_buffer, BR);
+    BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
+    BR = 0;
+    r = 0;			/* reset zero run length */
+  }
+
+  if (r > 0 || BR > 0) {	/* If there are trailing zeroes, */
+    entropy->EOBRUN++;		/* count an EOB */
+    entropy->BE += BR;		/* concat my correction bits to older ones */
+    /* We force out the EOB if we risk either:
+     * 1. overflow of the EOB counter;
+     * 2. overflow of the correction bit buffer during the next MCU.
+     */
+    if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))
+      emit_eobrun(entropy);
+  }
+
+  cinfo->dest->next_output_byte = entropy->next_output_byte;
+  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
+
+  /* Update restart-interval state too */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0) {
+      entropy->restarts_to_go = cinfo->restart_interval;
+      entropy->next_restart_num++;
+      entropy->next_restart_num &= 7;
+    }
+    entropy->restarts_to_go--;
+  }
+
+  return TRUE;
+}
+
+
+/*
+ * Finish up at the end of a Huffman-compressed progressive scan.
+ */
+
+METHODDEF(void)
+finish_pass_phuff (j_compress_ptr cinfo)
+{   
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+
+  entropy->next_output_byte = cinfo->dest->next_output_byte;
+  entropy->free_in_buffer = cinfo->dest->free_in_buffer;
+
+  /* Flush out any buffered data */
+  emit_eobrun(entropy);
+  flush_bits(entropy);
+
+  cinfo->dest->next_output_byte = entropy->next_output_byte;
+  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
+}
+
+
+/*
+ * Finish up a statistics-gathering pass and create the new Huffman tables.
+ */
+
+METHODDEF(void)
+finish_pass_gather_phuff (j_compress_ptr cinfo)
+{
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  boolean is_DC_band;
+  int ci, tbl;
+  jpeg_component_info * compptr;
+  JHUFF_TBL **htblptr;
+  boolean did[NUM_HUFF_TBLS];
+
+  /* Flush out buffered data (all we care about is counting the EOB symbol) */
+  emit_eobrun(entropy);
+
+  is_DC_band = (cinfo->Ss == 0);
+
+  /* It's important not to apply jpeg_gen_optimal_table more than once
+   * per table, because it clobbers the input frequency counts!
+   */
+  MEMZERO(did, SIZEOF(did));
+
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    compptr = cinfo->cur_comp_info[ci];
+    if (is_DC_band) {
+      if (cinfo->Ah != 0)	/* DC refinement needs no table */
+	continue;
+      tbl = compptr->dc_tbl_no;
+    } else {
+      tbl = compptr->ac_tbl_no;
+    }
+    if (! did[tbl]) {
+      if (is_DC_band)
+        htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];
+      else
+        htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];
+      if (*htblptr == NULL)
+        *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
+      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]);
+      did[tbl] = TRUE;
+    }
+  }
+}
+
+
+/*
+ * Module initialization routine for progressive Huffman entropy encoding.
+ */
+
+GLOBAL(void)
+jinit_phuff_encoder (j_compress_ptr cinfo)
+{
+  phuff_entropy_ptr entropy;
+  int i;
+
+  entropy = (phuff_entropy_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(phuff_entropy_encoder));
+  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
+  entropy->pub.start_pass = start_pass_phuff;
+
+  /* Mark tables unallocated */
+  for (i = 0; i < NUM_HUFF_TBLS; i++) {
+    entropy->derived_tbls[i] = NULL;
+    entropy->count_ptrs[i] = NULL;
+  }
+  entropy->bit_buffer = NULL;	/* needed only in AC refinement scan */
+}
+
+#endif /* C_PROGRESSIVE_SUPPORTED */
diff --git a/src/libjpeg/jcprepct.c b/src/libjpeg/jcprepct.c
new file mode 100644
index 0000000..fdc4bc2
--- /dev/null
+++ b/src/libjpeg/jcprepct.c
@@ -0,0 +1,354 @@
+/*
+ * jcprepct.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the compression preprocessing controller.
+ * This controller manages the color conversion, downsampling,
+ * and edge expansion steps.
+ *
+ * Most of the complexity here is associated with buffering input rows
+ * as required by the downsampler.  See the comments at the head of
+ * jcsample.c for the downsampler's needs.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* At present, jcsample.c can request context rows only for smoothing.
+ * In the future, we might also need context rows for CCIR601 sampling
+ * or other more-complex downsampling procedures.  The code to support
+ * context rows should be compiled only if needed.
+ */
+#ifdef INPUT_SMOOTHING_SUPPORTED
+#define CONTEXT_ROWS_SUPPORTED
+#endif
+
+
+/*
+ * For the simple (no-context-row) case, we just need to buffer one
+ * row group's worth of pixels for the downsampling step.  At the bottom of
+ * the image, we pad to a full row group by replicating the last pixel row.
+ * The downsampler's last output row is then replicated if needed to pad
+ * out to a full iMCU row.
+ *
+ * When providing context rows, we must buffer three row groups' worth of
+ * pixels.  Three row groups are physically allocated, but the row pointer
+ * arrays are made five row groups high, with the extra pointers above and
+ * below "wrapping around" to point to the last and first real row groups.
+ * This allows the downsampler to access the proper context rows.
+ * At the top and bottom of the image, we create dummy context rows by
+ * copying the first or last real pixel row.  This copying could be avoided
+ * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the
+ * trouble on the compression side.
+ */
+
+
+/* Private buffer controller object */
+
+typedef struct {
+  struct jpeg_c_prep_controller pub; /* public fields */
+
+  /* Downsampling input buffer.  This buffer holds color-converted data
+   * until we have enough to do a downsample step.
+   */
+  JSAMPARRAY color_buf[MAX_COMPONENTS];
+
+  JDIMENSION rows_to_go;	/* counts rows remaining in source image */
+  int next_buf_row;		/* index of next row to store in color_buf */
+
+#ifdef CONTEXT_ROWS_SUPPORTED	/* only needed for context case */
+  int this_row_group;		/* starting row index of group to process */
+  int next_buf_stop;		/* downsample when we reach this index */
+#endif
+} my_prep_controller;
+
+typedef my_prep_controller * my_prep_ptr;
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
+
+  if (pass_mode != JBUF_PASS_THRU)
+    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+
+  /* Initialize total-height counter for detecting bottom of image */
+  prep->rows_to_go = cinfo->image_height;
+  /* Mark the conversion buffer empty */
+  prep->next_buf_row = 0;
+#ifdef CONTEXT_ROWS_SUPPORTED
+  /* Preset additional state variables for context mode.
+   * These aren't used in non-context mode, so we needn't test which mode.
+   */
+  prep->this_row_group = 0;
+  /* Set next_buf_stop to stop after two row groups have been read in. */
+  prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;
+#endif
+}
+
+
+/*
+ * Expand an image vertically from height input_rows to height output_rows,
+ * by duplicating the bottom row.
+ */
+
+LOCAL(void)
+expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
+		    int input_rows, int output_rows)
+{
+  register int row;
+
+  for (row = input_rows; row < output_rows; row++) {
+    jcopy_sample_rows(image_data, input_rows-1, image_data, row,
+		      1, num_cols);
+  }
+}
+
+
+/*
+ * Process some data in the simple no-context case.
+ *
+ * Preprocessor output data is counted in "row groups".  A row group
+ * is defined to be v_samp_factor sample rows of each component.
+ * Downsampling will produce this much data from each max_v_samp_factor
+ * input rows.
+ */
+
+METHODDEF(void)
+pre_process_data (j_compress_ptr cinfo,
+		  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+		  JDIMENSION in_rows_avail,
+		  JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
+		  JDIMENSION out_row_groups_avail)
+{
+  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
+  int numrows, ci;
+  JDIMENSION inrows;
+  jpeg_component_info * compptr;
+
+  while (*in_row_ctr < in_rows_avail &&
+	 *out_row_group_ctr < out_row_groups_avail) {
+    /* Do color conversion to fill the conversion buffer. */
+    inrows = in_rows_avail - *in_row_ctr;
+    numrows = cinfo->max_v_samp_factor - prep->next_buf_row;
+    numrows = (int) MIN((JDIMENSION) numrows, inrows);
+    (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
+				       prep->color_buf,
+				       (JDIMENSION) prep->next_buf_row,
+				       numrows);
+    *in_row_ctr += numrows;
+    prep->next_buf_row += numrows;
+    prep->rows_to_go -= numrows;
+    /* If at bottom of image, pad to fill the conversion buffer. */
+    if (prep->rows_to_go == 0 &&
+	prep->next_buf_row < cinfo->max_v_samp_factor) {
+      for (ci = 0; ci < cinfo->num_components; ci++) {
+	expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
+			   prep->next_buf_row, cinfo->max_v_samp_factor);
+      }
+      prep->next_buf_row = cinfo->max_v_samp_factor;
+    }
+    /* If we've filled the conversion buffer, empty it. */
+    if (prep->next_buf_row == cinfo->max_v_samp_factor) {
+      (*cinfo->downsample->downsample) (cinfo,
+					prep->color_buf, (JDIMENSION) 0,
+					output_buf, *out_row_group_ctr);
+      prep->next_buf_row = 0;
+      (*out_row_group_ctr)++;
+    }
+    /* If at bottom of image, pad the output to a full iMCU height.
+     * Note we assume the caller is providing a one-iMCU-height output buffer!
+     */
+    if (prep->rows_to_go == 0 &&
+	*out_row_group_ctr < out_row_groups_avail) {
+      for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+	   ci++, compptr++) {
+	expand_bottom_edge(output_buf[ci],
+			   compptr->width_in_blocks * DCTSIZE,
+			   (int) (*out_row_group_ctr * compptr->v_samp_factor),
+			   (int) (out_row_groups_avail * compptr->v_samp_factor));
+      }
+      *out_row_group_ctr = out_row_groups_avail;
+      break;			/* can exit outer loop without test */
+    }
+  }
+}
+
+
+#ifdef CONTEXT_ROWS_SUPPORTED
+
+/*
+ * Process some data in the context case.
+ */
+
+METHODDEF(void)
+pre_process_context (j_compress_ptr cinfo,
+		     JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+		     JDIMENSION in_rows_avail,
+		     JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
+		     JDIMENSION out_row_groups_avail)
+{
+  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
+  int numrows, ci;
+  int buf_height = cinfo->max_v_samp_factor * 3;
+  JDIMENSION inrows;
+
+  while (*out_row_group_ctr < out_row_groups_avail) {
+    if (*in_row_ctr < in_rows_avail) {
+      /* Do color conversion to fill the conversion buffer. */
+      inrows = in_rows_avail - *in_row_ctr;
+      numrows = prep->next_buf_stop - prep->next_buf_row;
+      numrows = (int) MIN((JDIMENSION) numrows, inrows);
+      (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
+					 prep->color_buf,
+					 (JDIMENSION) prep->next_buf_row,
+					 numrows);
+      /* Pad at top of image, if first time through */
+      if (prep->rows_to_go == cinfo->image_height) {
+	for (ci = 0; ci < cinfo->num_components; ci++) {
+	  int row;
+	  for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
+	    jcopy_sample_rows(prep->color_buf[ci], 0,
+			      prep->color_buf[ci], -row,
+			      1, cinfo->image_width);
+	  }
+	}
+      }
+      *in_row_ctr += numrows;
+      prep->next_buf_row += numrows;
+      prep->rows_to_go -= numrows;
+    } else {
+      /* Return for more data, unless we are at the bottom of the image. */
+      if (prep->rows_to_go != 0)
+	break;
+      /* When at bottom of image, pad to fill the conversion buffer. */
+      if (prep->next_buf_row < prep->next_buf_stop) {
+	for (ci = 0; ci < cinfo->num_components; ci++) {
+	  expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
+			     prep->next_buf_row, prep->next_buf_stop);
+	}
+	prep->next_buf_row = prep->next_buf_stop;
+      }
+    }
+    /* If we've gotten enough data, downsample a row group. */
+    if (prep->next_buf_row == prep->next_buf_stop) {
+      (*cinfo->downsample->downsample) (cinfo,
+					prep->color_buf,
+					(JDIMENSION) prep->this_row_group,
+					output_buf, *out_row_group_ctr);
+      (*out_row_group_ctr)++;
+      /* Advance pointers with wraparound as necessary. */
+      prep->this_row_group += cinfo->max_v_samp_factor;
+      if (prep->this_row_group >= buf_height)
+	prep->this_row_group = 0;
+      if (prep->next_buf_row >= buf_height)
+	prep->next_buf_row = 0;
+      prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;
+    }
+  }
+}
+
+
+/*
+ * Create the wrapped-around downsampling input buffer needed for context mode.
+ */
+
+LOCAL(void)
+create_context_buffer (j_compress_ptr cinfo)
+{
+  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
+  int rgroup_height = cinfo->max_v_samp_factor;
+  int ci, i;
+  jpeg_component_info * compptr;
+  JSAMPARRAY true_buffer, fake_buffer;
+
+  /* Grab enough space for fake row pointers for all the components;
+   * we need five row groups' worth of pointers for each component.
+   */
+  fake_buffer = (JSAMPARRAY)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(cinfo->num_components * 5 * rgroup_height) *
+				SIZEOF(JSAMPROW));
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* Allocate the actual buffer space (3 row groups) for this component.
+     * We make the buffer wide enough to allow the downsampler to edge-expand
+     * horizontally within the buffer, if it so chooses.
+     */
+    true_buffer = (*cinfo->mem->alloc_sarray)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE,
+       (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
+		      cinfo->max_h_samp_factor) / compptr->h_samp_factor),
+       (JDIMENSION) (3 * rgroup_height));
+    /* Copy true buffer row pointers into the middle of the fake row array */
+    MEMCOPY(fake_buffer + rgroup_height, true_buffer,
+	    3 * rgroup_height * SIZEOF(JSAMPROW));
+    /* Fill in the above and below wraparound pointers */
+    for (i = 0; i < rgroup_height; i++) {
+      fake_buffer[i] = true_buffer[2 * rgroup_height + i];
+      fake_buffer[4 * rgroup_height + i] = true_buffer[i];
+    }
+    prep->color_buf[ci] = fake_buffer + rgroup_height;
+    fake_buffer += 5 * rgroup_height; /* point to space for next component */
+  }
+}
+
+#endif /* CONTEXT_ROWS_SUPPORTED */
+
+
+/*
+ * Initialize preprocessing controller.
+ */
+
+GLOBAL(void)
+jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)
+{
+  my_prep_ptr prep;
+  int ci;
+  jpeg_component_info * compptr;
+
+  if (need_full_buffer)		/* safety check */
+    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+
+  prep = (my_prep_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_prep_controller));
+  cinfo->prep = (struct jpeg_c_prep_controller *) prep;
+  prep->pub.start_pass = start_pass_prep;
+
+  /* Allocate the color conversion buffer.
+   * We make the buffer wide enough to allow the downsampler to edge-expand
+   * horizontally within the buffer, if it so chooses.
+   */
+  if (cinfo->downsample->need_context_rows) {
+    /* Set up to provide context rows */
+#ifdef CONTEXT_ROWS_SUPPORTED
+    prep->pub.pre_process_data = pre_process_context;
+    create_context_buffer(cinfo);
+#else
+    ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+  } else {
+    /* No context, just make it tall enough for one row group */
+    prep->pub.pre_process_data = pre_process_data;
+    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+	 ci++, compptr++) {
+      prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
+	((j_common_ptr) cinfo, JPOOL_IMAGE,
+	 (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
+			cinfo->max_h_samp_factor) / compptr->h_samp_factor),
+	 (JDIMENSION) cinfo->max_v_samp_factor);
+    }
+  }
+}
diff --git a/src/libjpeg/jcsample.c b/src/libjpeg/jcsample.c
new file mode 100644
index 0000000..fe29fca
--- /dev/null
+++ b/src/libjpeg/jcsample.c
@@ -0,0 +1,519 @@
+/*
+ * jcsample.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains downsampling routines.
+ *
+ * Downsampling input data is counted in "row groups".  A row group
+ * is defined to be max_v_samp_factor pixel rows of each component,
+ * from which the downsampler produces v_samp_factor sample rows.
+ * A single row group is processed in each call to the downsampler module.
+ *
+ * The downsampler is responsible for edge-expansion of its output data
+ * to fill an integral number of DCT blocks horizontally.  The source buffer
+ * may be modified if it is helpful for this purpose (the source buffer is
+ * allocated wide enough to correspond to the desired output width).
+ * The caller (the prep controller) is responsible for vertical padding.
+ *
+ * The downsampler may request "context rows" by setting need_context_rows
+ * during startup.  In this case, the input arrays will contain at least
+ * one row group's worth of pixels above and below the passed-in data;
+ * the caller will create dummy rows at image top and bottom by replicating
+ * the first or last real pixel row.
+ *
+ * An excellent reference for image resampling is
+ *   Digital Image Warping, George Wolberg, 1990.
+ *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
+ *
+ * The downsampling algorithm used here is a simple average of the source
+ * pixels covered by the output pixel.  The hi-falutin sampling literature
+ * refers to this as a "box filter".  In general the characteristics of a box
+ * filter are not very good, but for the specific cases we normally use (1:1
+ * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not
+ * nearly so bad.  If you intend to use other sampling ratios, you'd be well
+ * advised to improve this code.
+ *
+ * A simple input-smoothing capability is provided.  This is mainly intended
+ * for cleaning up color-dithered GIF input files (if you find it inadequate,
+ * we suggest using an external filtering program such as pnmconvol).  When
+ * enabled, each input pixel P is replaced by a weighted sum of itself and its
+ * eight neighbors.  P's weight is 1-8*SF and each neighbor's weight is SF,
+ * where SF = (smoothing_factor / 1024).
+ * Currently, smoothing is only supported for 2h2v sampling factors.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Pointer to routine to downsample a single component */
+typedef JMETHOD(void, downsample1_ptr,
+		(j_compress_ptr cinfo, jpeg_component_info * compptr,
+		 JSAMPARRAY input_data, JSAMPARRAY output_data));
+
+/* Private subobject */
+
+typedef struct {
+  struct jpeg_downsampler pub;	/* public fields */
+
+  /* Downsampling method pointers, one per component */
+  downsample1_ptr methods[MAX_COMPONENTS];
+} my_downsampler;
+
+typedef my_downsampler * my_downsample_ptr;
+
+
+/*
+ * Initialize for a downsampling pass.
+ */
+
+METHODDEF(void)
+start_pass_downsample (j_compress_ptr cinfo)
+{
+  /* no work for now */
+}
+
+
+/*
+ * Expand a component horizontally from width input_cols to width output_cols,
+ * by duplicating the rightmost samples.
+ */
+
+LOCAL(void)
+expand_right_edge (JSAMPARRAY image_data, int num_rows,
+		   JDIMENSION input_cols, JDIMENSION output_cols)
+{
+  register JSAMPROW ptr;
+  register JSAMPLE pixval;
+  register int count;
+  int row;
+  int numcols = (int) (output_cols - input_cols);
+
+  if (numcols > 0) {
+    for (row = 0; row < num_rows; row++) {
+      ptr = image_data[row] + input_cols;
+      pixval = ptr[-1];		/* don't need GETJSAMPLE() here */
+      for (count = numcols; count > 0; count--)
+	*ptr++ = pixval;
+    }
+  }
+}
+
+
+/*
+ * Do downsampling for a whole row group (all components).
+ *
+ * In this version we simply downsample each component independently.
+ */
+
+METHODDEF(void)
+sep_downsample (j_compress_ptr cinfo,
+		JSAMPIMAGE input_buf, JDIMENSION in_row_index,
+		JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
+{
+  my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
+  int ci;
+  jpeg_component_info * compptr;
+  JSAMPARRAY in_ptr, out_ptr;
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    in_ptr = input_buf[ci] + in_row_index;
+    out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);
+    (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);
+  }
+}
+
+
+/*
+ * Downsample pixel values of a single component.
+ * One row group is processed per call.
+ * This version handles arbitrary integral sampling ratios, without smoothing.
+ * Note that this version is not actually used for customary sampling ratios.
+ */
+
+METHODDEF(void)
+int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
+		JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+  int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
+  JDIMENSION outcol, outcol_h;	/* outcol_h == outcol*h_expand */
+  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
+  JSAMPROW inptr, outptr;
+  INT32 outvalue;
+
+  h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
+  v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
+  numpix = h_expand * v_expand;
+  numpix2 = numpix/2;
+
+  /* Expand input data enough to let all the output samples be generated
+   * by the standard loop.  Special-casing padded output would be more
+   * efficient.
+   */
+  expand_right_edge(input_data, cinfo->max_v_samp_factor,
+		    cinfo->image_width, output_cols * h_expand);
+
+  inrow = 0;
+  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
+    outptr = output_data[outrow];
+    for (outcol = 0, outcol_h = 0; outcol < output_cols;
+	 outcol++, outcol_h += h_expand) {
+      outvalue = 0;
+      for (v = 0; v < v_expand; v++) {
+	inptr = input_data[inrow+v] + outcol_h;
+	for (h = 0; h < h_expand; h++) {
+	  outvalue += (INT32) GETJSAMPLE(*inptr++);
+	}
+      }
+      *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);
+    }
+    inrow += v_expand;
+  }
+}
+
+
+/*
+ * Downsample pixel values of a single component.
+ * This version handles the special case of a full-size component,
+ * without smoothing.
+ */
+
+METHODDEF(void)
+fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
+		     JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+  /* Copy the data */
+  jcopy_sample_rows(input_data, 0, output_data, 0,
+		    cinfo->max_v_samp_factor, cinfo->image_width);
+  /* Edge-expand */
+  expand_right_edge(output_data, cinfo->max_v_samp_factor,
+		    cinfo->image_width, compptr->width_in_blocks * DCTSIZE);
+}
+
+
+/*
+ * Downsample pixel values of a single component.
+ * This version handles the common case of 2:1 horizontal and 1:1 vertical,
+ * without smoothing.
+ *
+ * A note about the "bias" calculations: when rounding fractional values to
+ * integer, we do not want to always round 0.5 up to the next integer.
+ * If we did that, we'd introduce a noticeable bias towards larger values.
+ * Instead, this code is arranged so that 0.5 will be rounded up or down at
+ * alternate pixel locations (a simple ordered dither pattern).
+ */
+
+METHODDEF(void)
+h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
+		 JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+  int outrow;
+  JDIMENSION outcol;
+  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
+  register JSAMPROW inptr, outptr;
+  register int bias;
+
+  /* Expand input data enough to let all the output samples be generated
+   * by the standard loop.  Special-casing padded output would be more
+   * efficient.
+   */
+  expand_right_edge(input_data, cinfo->max_v_samp_factor,
+		    cinfo->image_width, output_cols * 2);
+
+  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
+    outptr = output_data[outrow];
+    inptr = input_data[outrow];
+    bias = 0;			/* bias = 0,1,0,1,... for successive samples */
+    for (outcol = 0; outcol < output_cols; outcol++) {
+      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])
+			      + bias) >> 1);
+      bias ^= 1;		/* 0=>1, 1=>0 */
+      inptr += 2;
+    }
+  }
+}
+
+
+/*
+ * Downsample pixel values of a single component.
+ * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
+ * without smoothing.
+ */
+
+METHODDEF(void)
+h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
+		 JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+  int inrow, outrow;
+  JDIMENSION outcol;
+  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
+  register JSAMPROW inptr0, inptr1, outptr;
+  register int bias;
+
+  /* Expand input data enough to let all the output samples be generated
+   * by the standard loop.  Special-casing padded output would be more
+   * efficient.
+   */
+  expand_right_edge(input_data, cinfo->max_v_samp_factor,
+		    cinfo->image_width, output_cols * 2);
+
+  inrow = 0;
+  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
+    outptr = output_data[outrow];
+    inptr0 = input_data[inrow];
+    inptr1 = input_data[inrow+1];
+    bias = 1;			/* bias = 1,2,1,2,... for successive samples */
+    for (outcol = 0; outcol < output_cols; outcol++) {
+      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
+			      GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])
+			      + bias) >> 2);
+      bias ^= 3;		/* 1=>2, 2=>1 */
+      inptr0 += 2; inptr1 += 2;
+    }
+    inrow += 2;
+  }
+}
+
+
+#ifdef INPUT_SMOOTHING_SUPPORTED
+
+/*
+ * Downsample pixel values of a single component.
+ * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
+ * with smoothing.  One row of context is required.
+ */
+
+METHODDEF(void)
+h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
+			JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+  int inrow, outrow;
+  JDIMENSION colctr;
+  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
+  register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;
+  INT32 membersum, neighsum, memberscale, neighscale;
+
+  /* Expand input data enough to let all the output samples be generated
+   * by the standard loop.  Special-casing padded output would be more
+   * efficient.
+   */
+  expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
+		    cinfo->image_width, output_cols * 2);
+
+  /* We don't bother to form the individual "smoothed" input pixel values;
+   * we can directly compute the output which is the average of the four
+   * smoothed values.  Each of the four member pixels contributes a fraction
+   * (1-8*SF) to its own smoothed image and a fraction SF to each of the three
+   * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final
+   * output.  The four corner-adjacent neighbor pixels contribute a fraction
+   * SF to just one smoothed pixel, or SF/4 to the final output; while the
+   * eight edge-adjacent neighbors contribute SF to each of two smoothed
+   * pixels, or SF/2 overall.  In order to use integer arithmetic, these
+   * factors are scaled by 2^16 = 65536.
+   * Also recall that SF = smoothing_factor / 1024.
+   */
+
+  memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */
+  neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */
+
+  inrow = 0;
+  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
+    outptr = output_data[outrow];
+    inptr0 = input_data[inrow];
+    inptr1 = input_data[inrow+1];
+    above_ptr = input_data[inrow-1];
+    below_ptr = input_data[inrow+2];
+
+    /* Special case for first column: pretend column -1 is same as column 0 */
+    membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
+		GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
+    neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
+	       GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
+	       GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +
+	       GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);
+    neighsum += neighsum;
+    neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +
+		GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
+    membersum = membersum * memberscale + neighsum * neighscale;
+    *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
+    inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
+
+    for (colctr = output_cols - 2; colctr > 0; colctr--) {
+      /* sum of pixels directly mapped to this output element */
+      membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
+		  GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
+      /* sum of edge-neighbor pixels */
+      neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
+		 GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
+		 GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +
+		 GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);
+      /* The edge-neighbors count twice as much as corner-neighbors */
+      neighsum += neighsum;
+      /* Add in the corner-neighbors */
+      neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +
+		  GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);
+      /* form final output scaled up by 2^16 */
+      membersum = membersum * memberscale + neighsum * neighscale;
+      /* round, descale and output it */
+      *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
+      inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
+    }
+
+    /* Special case for last column */
+    membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
+		GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
+    neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
+	       GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
+	       GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +
+	       GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);
+    neighsum += neighsum;
+    neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +
+		GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
+    membersum = membersum * memberscale + neighsum * neighscale;
+    *outptr = (JSAMPLE) ((membersum + 32768) >> 16);
+
+    inrow += 2;
+  }
+}
+
+
+/*
+ * Downsample pixel values of a single component.
+ * This version handles the special case of a full-size component,
+ * with smoothing.  One row of context is required.
+ */
+
+METHODDEF(void)
+fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
+			    JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+  int outrow;
+  JDIMENSION colctr;
+  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
+  register JSAMPROW inptr, above_ptr, below_ptr, outptr;
+  INT32 membersum, neighsum, memberscale, neighscale;
+  int colsum, lastcolsum, nextcolsum;
+
+  /* Expand input data enough to let all the output samples be generated
+   * by the standard loop.  Special-casing padded output would be more
+   * efficient.
+   */
+  expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
+		    cinfo->image_width, output_cols);
+
+  /* Each of the eight neighbor pixels contributes a fraction SF to the
+   * smoothed pixel, while the main pixel contributes (1-8*SF).  In order
+   * to use integer arithmetic, these factors are multiplied by 2^16 = 65536.
+   * Also recall that SF = smoothing_factor / 1024.
+   */
+
+  memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */
+  neighscale = cinfo->smoothing_factor * 64; /* scaled SF */
+
+  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
+    outptr = output_data[outrow];
+    inptr = input_data[outrow];
+    above_ptr = input_data[outrow-1];
+    below_ptr = input_data[outrow+1];
+
+    /* Special case for first column */
+    colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +
+	     GETJSAMPLE(*inptr);
+    membersum = GETJSAMPLE(*inptr++);
+    nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
+		 GETJSAMPLE(*inptr);
+    neighsum = colsum + (colsum - membersum) + nextcolsum;
+    membersum = membersum * memberscale + neighsum * neighscale;
+    *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
+    lastcolsum = colsum; colsum = nextcolsum;
+
+    for (colctr = output_cols - 2; colctr > 0; colctr--) {
+      membersum = GETJSAMPLE(*inptr++);
+      above_ptr++; below_ptr++;
+      nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
+		   GETJSAMPLE(*inptr);
+      neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
+      membersum = membersum * memberscale + neighsum * neighscale;
+      *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
+      lastcolsum = colsum; colsum = nextcolsum;
+    }
+
+    /* Special case for last column */
+    membersum = GETJSAMPLE(*inptr);
+    neighsum = lastcolsum + (colsum - membersum) + colsum;
+    membersum = membersum * memberscale + neighsum * neighscale;
+    *outptr = (JSAMPLE) ((membersum + 32768) >> 16);
+
+  }
+}
+
+#endif /* INPUT_SMOOTHING_SUPPORTED */
+
+
+/*
+ * Module initialization routine for downsampling.
+ * Note that we must select a routine for each component.
+ */
+
+GLOBAL(void)
+jinit_downsampler (j_compress_ptr cinfo)
+{
+  my_downsample_ptr downsample;
+  int ci;
+  jpeg_component_info * compptr;
+  boolean smoothok = TRUE;
+
+  downsample = (my_downsample_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_downsampler));
+  cinfo->downsample = (struct jpeg_downsampler *) downsample;
+  downsample->pub.start_pass = start_pass_downsample;
+  downsample->pub.downsample = sep_downsample;
+  downsample->pub.need_context_rows = FALSE;
+
+  if (cinfo->CCIR601_sampling)
+    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
+
+  /* Verify we can handle the sampling factors, and set up method pointers */
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    if (compptr->h_samp_factor == cinfo->max_h_samp_factor &&
+	compptr->v_samp_factor == cinfo->max_v_samp_factor) {
+#ifdef INPUT_SMOOTHING_SUPPORTED
+      if (cinfo->smoothing_factor) {
+	downsample->methods[ci] = fullsize_smooth_downsample;
+	downsample->pub.need_context_rows = TRUE;
+      } else
+#endif
+	downsample->methods[ci] = fullsize_downsample;
+    } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
+	       compptr->v_samp_factor == cinfo->max_v_samp_factor) {
+      smoothok = FALSE;
+      downsample->methods[ci] = h2v1_downsample;
+    } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
+	       compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) {
+#ifdef INPUT_SMOOTHING_SUPPORTED
+      if (cinfo->smoothing_factor) {
+	downsample->methods[ci] = h2v2_smooth_downsample;
+	downsample->pub.need_context_rows = TRUE;
+      } else
+#endif
+	downsample->methods[ci] = h2v2_downsample;
+    } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&
+	       (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) {
+      smoothok = FALSE;
+      downsample->methods[ci] = int_downsample;
+    } else
+      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
+  }
+
+#ifdef INPUT_SMOOTHING_SUPPORTED
+  if (cinfo->smoothing_factor && !smoothok)
+    TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);
+#endif
+}
diff --git a/src/libjpeg/jctrans.c b/src/libjpeg/jctrans.c
new file mode 100644
index 0000000..8b36e36
--- /dev/null
+++ b/src/libjpeg/jctrans.c
@@ -0,0 +1,388 @@
+/*
+ * jctrans.c
+ *
+ * Copyright (C) 1995-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains library routines for transcoding compression,
+ * that is, writing raw DCT coefficient arrays to an output JPEG file.
+ * The routines in jcapimin.c will also be needed by a transcoder.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Forward declarations */
+LOCAL(void) transencode_master_selection
+	JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
+LOCAL(void) transencode_coef_controller
+	JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
+
+
+/*
+ * Compression initialization for writing raw-coefficient data.
+ * Before calling this, all parameters and a data destination must be set up.
+ * Call jpeg_finish_compress() to actually write the data.
+ *
+ * The number of passed virtual arrays must match cinfo->num_components.
+ * Note that the virtual arrays need not be filled or even realized at
+ * the time write_coefficients is called; indeed, if the virtual arrays
+ * were requested from this compression object's memory manager, they
+ * typically will be realized during this routine and filled afterwards.
+ */
+
+GLOBAL(void)
+jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)
+{
+  if (cinfo->global_state != CSTATE_START)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  /* Mark all tables to be written */
+  jpeg_suppress_tables(cinfo, FALSE);
+  /* (Re)initialize error mgr and destination modules */
+  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
+  (*cinfo->dest->init_destination) (cinfo);
+  /* Perform master selection of active modules */
+  transencode_master_selection(cinfo, coef_arrays);
+  /* Wait for jpeg_finish_compress() call */
+  cinfo->next_scanline = 0;	/* so jpeg_write_marker works */
+  cinfo->global_state = CSTATE_WRCOEFS;
+}
+
+
+/*
+ * Initialize the compression object with default parameters,
+ * then copy from the source object all parameters needed for lossless
+ * transcoding.  Parameters that can be varied without loss (such as
+ * scan script and Huffman optimization) are left in their default states.
+ */
+
+GLOBAL(void)
+jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
+			       j_compress_ptr dstinfo)
+{
+  JQUANT_TBL ** qtblptr;
+  jpeg_component_info *incomp, *outcomp;
+  JQUANT_TBL *c_quant, *slot_quant;
+  int tblno, ci, coefi;
+
+  /* Safety check to ensure start_compress not called yet. */
+  if (dstinfo->global_state != CSTATE_START)
+    ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);
+  /* Copy fundamental image dimensions */
+  dstinfo->image_width = srcinfo->image_width;
+  dstinfo->image_height = srcinfo->image_height;
+  dstinfo->input_components = srcinfo->num_components;
+  dstinfo->in_color_space = srcinfo->jpeg_color_space;
+  /* Initialize all parameters to default values */
+  jpeg_set_defaults(dstinfo);
+  /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
+   * Fix it to get the right header markers for the image colorspace.
+   */
+  jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
+  dstinfo->data_precision = srcinfo->data_precision;
+  dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
+  /* Copy the source's quantization tables. */
+  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
+    if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {
+      qtblptr = & dstinfo->quant_tbl_ptrs[tblno];
+      if (*qtblptr == NULL)
+	*qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);
+      MEMCOPY((*qtblptr)->quantval,
+	      srcinfo->quant_tbl_ptrs[tblno]->quantval,
+	      SIZEOF((*qtblptr)->quantval));
+      (*qtblptr)->sent_table = FALSE;
+    }
+  }
+  /* Copy the source's per-component info.
+   * Note we assume jpeg_set_defaults has allocated the dest comp_info array.
+   */
+  dstinfo->num_components = srcinfo->num_components;
+  if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)
+    ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,
+	     MAX_COMPONENTS);
+  for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;
+       ci < dstinfo->num_components; ci++, incomp++, outcomp++) {
+    outcomp->component_id = incomp->component_id;
+    outcomp->h_samp_factor = incomp->h_samp_factor;
+    outcomp->v_samp_factor = incomp->v_samp_factor;
+    outcomp->quant_tbl_no = incomp->quant_tbl_no;
+    /* Make sure saved quantization table for component matches the qtable
+     * slot.  If not, the input file re-used this qtable slot.
+     * IJG encoder currently cannot duplicate this.
+     */
+    tblno = outcomp->quant_tbl_no;
+    if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||
+	srcinfo->quant_tbl_ptrs[tblno] == NULL)
+      ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);
+    slot_quant = srcinfo->quant_tbl_ptrs[tblno];
+    c_quant = incomp->quant_table;
+    if (c_quant != NULL) {
+      for (coefi = 0; coefi < DCTSIZE2; coefi++) {
+	if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])
+	  ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
+      }
+    }
+    /* Note: we do not copy the source's Huffman table assignments;
+     * instead we rely on jpeg_set_colorspace to have made a suitable choice.
+     */
+  }
+  /* Also copy JFIF version and resolution information, if available.
+   * Strictly speaking this isn't "critical" info, but it's nearly
+   * always appropriate to copy it if available.  In particular,
+   * if the application chooses to copy JFIF 1.02 extension markers from
+   * the source file, we need to copy the version to make sure we don't
+   * emit a file that has 1.02 extensions but a claimed version of 1.01.
+   * We will *not*, however, copy version info from mislabeled "2.01" files.
+   */
+  if (srcinfo->saw_JFIF_marker) {
+    if (srcinfo->JFIF_major_version == 1) {
+      dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
+      dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
+    }
+    dstinfo->density_unit = srcinfo->density_unit;
+    dstinfo->X_density = srcinfo->X_density;
+    dstinfo->Y_density = srcinfo->Y_density;
+  }
+}
+
+
+/*
+ * Master selection of compression modules for transcoding.
+ * This substitutes for jcinit.c's initialization of the full compressor.
+ */
+
+LOCAL(void)
+transencode_master_selection (j_compress_ptr cinfo,
+			      jvirt_barray_ptr * coef_arrays)
+{
+  /* Although we don't actually use input_components for transcoding,
+   * jcmaster.c's initial_setup will complain if input_components is 0.
+   */
+  cinfo->input_components = 1;
+  /* Initialize master control (includes parameter checking/processing) */
+  jinit_c_master_control(cinfo, TRUE /* transcode only */);
+
+  /* Entropy encoding: either Huffman or arithmetic coding. */
+  if (cinfo->arith_code) {
+    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
+  } else {
+    if (cinfo->progressive_mode) {
+#ifdef C_PROGRESSIVE_SUPPORTED
+      jinit_phuff_encoder(cinfo);
+#else
+      ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+    } else
+      jinit_huff_encoder(cinfo);
+  }
+
+  /* We need a special coefficient buffer controller. */
+  transencode_coef_controller(cinfo, coef_arrays);
+
+  jinit_marker_writer(cinfo);
+
+  /* We can now tell the memory manager to allocate virtual arrays. */
+  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
+
+  /* Write the datastream header (SOI, JFIF) immediately.
+   * Frame and scan headers are postponed till later.
+   * This lets application insert special markers after the SOI.
+   */
+  (*cinfo->marker->write_file_header) (cinfo);
+}
+
+
+/*
+ * The rest of this file is a special implementation of the coefficient
+ * buffer controller.  This is similar to jccoefct.c, but it handles only
+ * output from presupplied virtual arrays.  Furthermore, we generate any
+ * dummy padding blocks on-the-fly rather than expecting them to be present
+ * in the arrays.
+ */
+
+/* Private buffer controller object */
+
+typedef struct {
+  struct jpeg_c_coef_controller pub; /* public fields */
+
+  JDIMENSION iMCU_row_num;	/* iMCU row # within image */
+  JDIMENSION mcu_ctr;		/* counts MCUs processed in current row */
+  int MCU_vert_offset;		/* counts MCU rows within iMCU row */
+  int MCU_rows_per_iMCU_row;	/* number of such rows needed */
+
+  /* Virtual block array for each component. */
+  jvirt_barray_ptr * whole_image;
+
+  /* Workspace for constructing dummy blocks at right/bottom edges. */
+  JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];
+} my_coef_controller;
+
+typedef my_coef_controller * my_coef_ptr;
+
+
+LOCAL(void)
+start_iMCU_row (j_compress_ptr cinfo)
+/* Reset within-iMCU-row counters for a new row */
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+  /* In an interleaved scan, an MCU row is the same as an iMCU row.
+   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
+   * But at the bottom of the image, process only what's left.
+   */
+  if (cinfo->comps_in_scan > 1) {
+    coef->MCU_rows_per_iMCU_row = 1;
+  } else {
+    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
+      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
+    else
+      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
+  }
+
+  coef->mcu_ctr = 0;
+  coef->MCU_vert_offset = 0;
+}
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+  if (pass_mode != JBUF_CRANK_DEST)
+    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+
+  coef->iMCU_row_num = 0;
+  start_iMCU_row(cinfo);
+}
+
+
+/*
+ * Process some data.
+ * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
+ * per call, ie, v_samp_factor block rows for each component in the scan.
+ * The data is obtained from the virtual arrays and fed to the entropy coder.
+ * Returns TRUE if the iMCU row is completed, FALSE if suspended.
+ *
+ * NB: input_buf is ignored; it is likely to be a NULL pointer.
+ */
+
+METHODDEF(boolean)
+compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+  JDIMENSION MCU_col_num;	/* index of current MCU within row */
+  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
+  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+  int blkn, ci, xindex, yindex, yoffset, blockcnt;
+  JDIMENSION start_col;
+  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
+  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
+  JBLOCKROW buffer_ptr;
+  jpeg_component_info *compptr;
+
+  /* Align the virtual buffers for the components used in this scan. */
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    compptr = cinfo->cur_comp_info[ci];
+    buffer[ci] = (*cinfo->mem->access_virt_barray)
+      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
+       coef->iMCU_row_num * compptr->v_samp_factor,
+       (JDIMENSION) compptr->v_samp_factor, FALSE);
+  }
+
+  /* Loop to process one whole iMCU row */
+  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
+       yoffset++) {
+    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
+	 MCU_col_num++) {
+      /* Construct list of pointers to DCT blocks belonging to this MCU */
+      blkn = 0;			/* index of current DCT block within MCU */
+      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+	compptr = cinfo->cur_comp_info[ci];
+	start_col = MCU_col_num * compptr->MCU_width;
+	blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
+						: compptr->last_col_width;
+	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
+	  if (coef->iMCU_row_num < last_iMCU_row ||
+	      yindex+yoffset < compptr->last_row_height) {
+	    /* Fill in pointers to real blocks in this row */
+	    buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
+	    for (xindex = 0; xindex < blockcnt; xindex++)
+	      MCU_buffer[blkn++] = buffer_ptr++;
+	  } else {
+	    /* At bottom of image, need a whole row of dummy blocks */
+	    xindex = 0;
+	  }
+	  /* Fill in any dummy blocks needed in this row.
+	   * Dummy blocks are filled in the same way as in jccoefct.c:
+	   * all zeroes in the AC entries, DC entries equal to previous
+	   * block's DC value.  The init routine has already zeroed the
+	   * AC entries, so we need only set the DC entries correctly.
+	   */
+	  for (; xindex < compptr->MCU_width; xindex++) {
+	    MCU_buffer[blkn] = coef->dummy_buffer[blkn];
+	    MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
+	    blkn++;
+	  }
+	}
+      }
+      /* Try to write the MCU. */
+      if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
+	/* Suspension forced; update state counters and exit */
+	coef->MCU_vert_offset = yoffset;
+	coef->mcu_ctr = MCU_col_num;
+	return FALSE;
+      }
+    }
+    /* Completed an MCU row, but perhaps not an iMCU row */
+    coef->mcu_ctr = 0;
+  }
+  /* Completed the iMCU row, advance counters for next one */
+  coef->iMCU_row_num++;
+  start_iMCU_row(cinfo);
+  return TRUE;
+}
+
+
+/*
+ * Initialize coefficient buffer controller.
+ *
+ * Each passed coefficient array must be the right size for that
+ * coefficient: width_in_blocks wide and height_in_blocks high,
+ * with unitheight at least v_samp_factor.
+ */
+
+LOCAL(void)
+transencode_coef_controller (j_compress_ptr cinfo,
+			     jvirt_barray_ptr * coef_arrays)
+{
+  my_coef_ptr coef;
+  JBLOCKROW buffer;
+  int i;
+
+  coef = (my_coef_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_coef_controller));
+  cinfo->coef = (struct jpeg_c_coef_controller *) coef;
+  coef->pub.start_pass = start_pass_coef;
+  coef->pub.compress_data = compress_output;
+
+  /* Save pointer to virtual arrays */
+  coef->whole_image = coef_arrays;
+
+  /* Allocate and pre-zero space for dummy DCT blocks. */
+  buffer = (JBLOCKROW)
+    (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
+  jzero_far((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
+  for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
+    coef->dummy_buffer[i] = buffer + i;
+  }
+}
diff --git a/src/libjpeg/jdapimin.c b/src/libjpeg/jdapimin.c
new file mode 100644
index 0000000..bd1df92
--- /dev/null
+++ b/src/libjpeg/jdapimin.c
@@ -0,0 +1,395 @@
+/*
+ * jdapimin.c
+ *
+ * Copyright (C) 1994-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains application interface code for the decompression half
+ * of the JPEG library.  These are the "minimum" API routines that may be
+ * needed in either the normal full-decompression case or the
+ * transcoding-only case.
+ *
+ * Most of the routines intended to be called directly by an application
+ * are in this file or in jdapistd.c.  But also see jcomapi.c for routines
+ * shared by compression and decompression, and jdtrans.c for the transcoding
+ * case.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Initialization of a JPEG decompression object.
+ * The error manager must already be set up (in case memory manager fails).
+ */
+
+GLOBAL(void)
+jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
+{
+  int i;
+
+  /* Guard against version mismatches between library and caller. */
+  cinfo->mem = NULL;		/* so jpeg_destroy knows mem mgr not called */
+  if (version != JPEG_LIB_VERSION)
+    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
+  if (structsize != SIZEOF(struct jpeg_decompress_struct))
+    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, 
+	     (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);
+
+  /* For debugging purposes, we zero the whole master structure.
+   * But the application has already set the err pointer, and may have set
+   * client_data, so we have to save and restore those fields.
+   * Note: if application hasn't set client_data, tools like Purify may
+   * complain here.
+   */
+  {
+    struct jpeg_error_mgr * err = cinfo->err;
+    void * client_data = cinfo->client_data; /* ignore Purify complaint here */
+    MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct));
+    cinfo->err = err;
+    cinfo->client_data = client_data;
+  }
+  cinfo->is_decompressor = TRUE;
+
+  /* Initialize a memory manager instance for this object */
+  jinit_memory_mgr((j_common_ptr) cinfo);
+
+  /* Zero out pointers to permanent structures. */
+  cinfo->progress = NULL;
+  cinfo->src = NULL;
+
+  for (i = 0; i < NUM_QUANT_TBLS; i++)
+    cinfo->quant_tbl_ptrs[i] = NULL;
+
+  for (i = 0; i < NUM_HUFF_TBLS; i++) {
+    cinfo->dc_huff_tbl_ptrs[i] = NULL;
+    cinfo->ac_huff_tbl_ptrs[i] = NULL;
+  }
+
+  /* Initialize marker processor so application can override methods
+   * for COM, APPn markers before calling jpeg_read_header.
+   */
+  cinfo->marker_list = NULL;
+  jinit_marker_reader(cinfo);
+
+  /* And initialize the overall input controller. */
+  jinit_input_controller(cinfo);
+
+  /* OK, I'm ready */
+  cinfo->global_state = DSTATE_START;
+}
+
+
+/*
+ * Destruction of a JPEG decompression object
+ */
+
+GLOBAL(void)
+jpeg_destroy_decompress (j_decompress_ptr cinfo)
+{
+  jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
+}
+
+
+/*
+ * Abort processing of a JPEG decompression operation,
+ * but don't destroy the object itself.
+ */
+
+GLOBAL(void)
+jpeg_abort_decompress (j_decompress_ptr cinfo)
+{
+  jpeg_abort((j_common_ptr) cinfo); /* use common routine */
+}
+
+
+/*
+ * Set default decompression parameters.
+ */
+
+LOCAL(void)
+default_decompress_parms (j_decompress_ptr cinfo)
+{
+  /* Guess the input colorspace, and set output colorspace accordingly. */
+  /* (Wish JPEG committee had provided a real way to specify this...) */
+  /* Note application may override our guesses. */
+  switch (cinfo->num_components) {
+  case 1:
+    cinfo->jpeg_color_space = JCS_GRAYSCALE;
+    cinfo->out_color_space = JCS_GRAYSCALE;
+    break;
+    
+  case 3:
+    if (cinfo->saw_JFIF_marker) {
+      cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
+    } else if (cinfo->saw_Adobe_marker) {
+      switch (cinfo->Adobe_transform) {
+      case 0:
+	cinfo->jpeg_color_space = JCS_RGB;
+	break;
+      case 1:
+	cinfo->jpeg_color_space = JCS_YCbCr;
+	break;
+      default:
+	WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
+	cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
+	break;
+      }
+    } else {
+      /* Saw no special markers, try to guess from the component IDs */
+      int cid0 = cinfo->comp_info[0].component_id;
+      int cid1 = cinfo->comp_info[1].component_id;
+      int cid2 = cinfo->comp_info[2].component_id;
+
+      if (cid0 == 1 && cid1 == 2 && cid2 == 3)
+	cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
+      else if (cid0 == 82 && cid1 == 71 && cid2 == 66)
+	cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
+      else {
+	TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
+	cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
+      }
+    }
+    /* Always guess RGB is proper output colorspace. */
+    cinfo->out_color_space = JCS_RGB;
+    break;
+    
+  case 4:
+    if (cinfo->saw_Adobe_marker) {
+      switch (cinfo->Adobe_transform) {
+      case 0:
+	cinfo->jpeg_color_space = JCS_CMYK;
+	break;
+      case 2:
+	cinfo->jpeg_color_space = JCS_YCCK;
+	break;
+      default:
+	WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
+	cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
+	break;
+      }
+    } else {
+      /* No special markers, assume straight CMYK. */
+      cinfo->jpeg_color_space = JCS_CMYK;
+    }
+    cinfo->out_color_space = JCS_CMYK;
+    break;
+    
+  default:
+    cinfo->jpeg_color_space = JCS_UNKNOWN;
+    cinfo->out_color_space = JCS_UNKNOWN;
+    break;
+  }
+
+  /* Set defaults for other decompression parameters. */
+  cinfo->scale_num = 1;		/* 1:1 scaling */
+  cinfo->scale_denom = 1;
+  cinfo->output_gamma = 1.0;
+  cinfo->buffered_image = FALSE;
+  cinfo->raw_data_out = FALSE;
+  cinfo->dct_method = JDCT_DEFAULT;
+  cinfo->do_fancy_upsampling = TRUE;
+  cinfo->do_block_smoothing = TRUE;
+  cinfo->quantize_colors = FALSE;
+  /* We set these in case application only sets quantize_colors. */
+  cinfo->dither_mode = JDITHER_FS;
+#ifdef QUANT_2PASS_SUPPORTED
+  cinfo->two_pass_quantize = TRUE;
+#else
+  cinfo->two_pass_quantize = FALSE;
+#endif
+  cinfo->desired_number_of_colors = 256;
+  cinfo->colormap = NULL;
+  /* Initialize for no mode change in buffered-image mode. */
+  cinfo->enable_1pass_quant = FALSE;
+  cinfo->enable_external_quant = FALSE;
+  cinfo->enable_2pass_quant = FALSE;
+}
+
+
+/*
+ * Decompression startup: read start of JPEG datastream to see what's there.
+ * Need only initialize JPEG object and supply a data source before calling.
+ *
+ * This routine will read as far as the first SOS marker (ie, actual start of
+ * compressed data), and will save all tables and parameters in the JPEG
+ * object.  It will also initialize the decompression parameters to default
+ * values, and finally return JPEG_HEADER_OK.  On return, the application may
+ * adjust the decompression parameters and then call jpeg_start_decompress.
+ * (Or, if the application only wanted to determine the image parameters,
+ * the data need not be decompressed.  In that case, call jpeg_abort or
+ * jpeg_destroy to release any temporary space.)
+ * If an abbreviated (tables only) datastream is presented, the routine will
+ * return JPEG_HEADER_TABLES_ONLY upon reaching EOI.  The application may then
+ * re-use the JPEG object to read the abbreviated image datastream(s).
+ * It is unnecessary (but OK) to call jpeg_abort in this case.
+ * The JPEG_SUSPENDED return code only occurs if the data source module
+ * requests suspension of the decompressor.  In this case the application
+ * should load more source data and then re-call jpeg_read_header to resume
+ * processing.
+ * If a non-suspending data source is used and require_image is TRUE, then the
+ * return code need not be inspected since only JPEG_HEADER_OK is possible.
+ *
+ * This routine is now just a front end to jpeg_consume_input, with some
+ * extra error checking.
+ */
+
+GLOBAL(int)
+jpeg_read_header (j_decompress_ptr cinfo, boolean require_image)
+{
+  int retcode;
+
+  if (cinfo->global_state != DSTATE_START &&
+      cinfo->global_state != DSTATE_INHEADER)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+  retcode = jpeg_consume_input(cinfo);
+
+  switch (retcode) {
+  case JPEG_REACHED_SOS:
+    retcode = JPEG_HEADER_OK;
+    break;
+  case JPEG_REACHED_EOI:
+    if (require_image)		/* Complain if application wanted an image */
+      ERREXIT(cinfo, JERR_NO_IMAGE);
+    /* Reset to start state; it would be safer to require the application to
+     * call jpeg_abort, but we can't change it now for compatibility reasons.
+     * A side effect is to free any temporary memory (there shouldn't be any).
+     */
+    jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */
+    retcode = JPEG_HEADER_TABLES_ONLY;
+    break;
+  case JPEG_SUSPENDED:
+    /* no work */
+    break;
+  }
+
+  return retcode;
+}
+
+
+/*
+ * Consume data in advance of what the decompressor requires.
+ * This can be called at any time once the decompressor object has
+ * been created and a data source has been set up.
+ *
+ * This routine is essentially a state machine that handles a couple
+ * of critical state-transition actions, namely initial setup and
+ * transition from header scanning to ready-for-start_decompress.
+ * All the actual input is done via the input controller's consume_input
+ * method.
+ */
+
+GLOBAL(int)
+jpeg_consume_input (j_decompress_ptr cinfo)
+{
+  int retcode = JPEG_SUSPENDED;
+
+  /* NB: every possible DSTATE value should be listed in this switch */
+  switch (cinfo->global_state) {
+  case DSTATE_START:
+    /* Start-of-datastream actions: reset appropriate modules */
+    (*cinfo->inputctl->reset_input_controller) (cinfo);
+    /* Initialize application's data source module */
+    (*cinfo->src->init_source) (cinfo);
+    cinfo->global_state = DSTATE_INHEADER;
+    /*FALLTHROUGH*/
+  case DSTATE_INHEADER:
+    retcode = (*cinfo->inputctl->consume_input) (cinfo);
+    if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */
+      /* Set up default parameters based on header data */
+      default_decompress_parms(cinfo);
+      /* Set global state: ready for start_decompress */
+      cinfo->global_state = DSTATE_READY;
+    }
+    break;
+  case DSTATE_READY:
+    /* Can't advance past first SOS until start_decompress is called */
+    retcode = JPEG_REACHED_SOS;
+    break;
+  case DSTATE_PRELOAD:
+  case DSTATE_PRESCAN:
+  case DSTATE_SCANNING:
+  case DSTATE_RAW_OK:
+  case DSTATE_BUFIMAGE:
+  case DSTATE_BUFPOST:
+  case DSTATE_STOPPING:
+    retcode = (*cinfo->inputctl->consume_input) (cinfo);
+    break;
+  default:
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  }
+  return retcode;
+}
+
+
+/*
+ * Have we finished reading the input file?
+ */
+
+GLOBAL(boolean)
+jpeg_input_complete (j_decompress_ptr cinfo)
+{
+  /* Check for valid jpeg object */
+  if (cinfo->global_state < DSTATE_START ||
+      cinfo->global_state > DSTATE_STOPPING)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  return cinfo->inputctl->eoi_reached;
+}
+
+
+/*
+ * Is there more than one scan?
+ */
+
+GLOBAL(boolean)
+jpeg_has_multiple_scans (j_decompress_ptr cinfo)
+{
+  /* Only valid after jpeg_read_header completes */
+  if (cinfo->global_state < DSTATE_READY ||
+      cinfo->global_state > DSTATE_STOPPING)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  return cinfo->inputctl->has_multiple_scans;
+}
+
+
+/*
+ * Finish JPEG decompression.
+ *
+ * This will normally just verify the file trailer and release temp storage.
+ *
+ * Returns FALSE if suspended.  The return value need be inspected only if
+ * a suspending data source is used.
+ */
+
+GLOBAL(boolean)
+jpeg_finish_decompress (j_decompress_ptr cinfo)
+{
+  if ((cinfo->global_state == DSTATE_SCANNING ||
+       cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) {
+    /* Terminate final pass of non-buffered mode */
+    if (cinfo->output_scanline < cinfo->output_height)
+      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
+    (*cinfo->master->finish_output_pass) (cinfo);
+    cinfo->global_state = DSTATE_STOPPING;
+  } else if (cinfo->global_state == DSTATE_BUFIMAGE) {
+    /* Finishing after a buffered-image operation */
+    cinfo->global_state = DSTATE_STOPPING;
+  } else if (cinfo->global_state != DSTATE_STOPPING) {
+    /* STOPPING = repeat call after a suspension, anything else is error */
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  }
+  /* Read until EOI */
+  while (! cinfo->inputctl->eoi_reached) {
+    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
+      return FALSE;		/* Suspend, come back later */
+  }
+  /* Do final cleanup */
+  (*cinfo->src->term_source) (cinfo);
+  /* We can use jpeg_abort to release memory and reset global_state */
+  jpeg_abort((j_common_ptr) cinfo);
+  return TRUE;
+}
diff --git a/src/libjpeg/jdapistd.c b/src/libjpeg/jdapistd.c
new file mode 100644
index 0000000..f6c7fff
--- /dev/null
+++ b/src/libjpeg/jdapistd.c
@@ -0,0 +1,275 @@
+/*
+ * jdapistd.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains application interface code for the decompression half
+ * of the JPEG library.  These are the "standard" API routines that are
+ * used in the normal full-decompression case.  They are not used by a
+ * transcoding-only application.  Note that if an application links in
+ * jpeg_start_decompress, it will end up linking in the entire decompressor.
+ * We thus must separate this file from jdapimin.c to avoid linking the
+ * whole decompression library into a transcoder.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Forward declarations */
+LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo));
+
+
+/*
+ * Decompression initialization.
+ * jpeg_read_header must be completed before calling this.
+ *
+ * If a multipass operating mode was selected, this will do all but the
+ * last pass, and thus may take a great deal of time.
+ *
+ * Returns FALSE if suspended.  The return value need be inspected only if
+ * a suspending data source is used.
+ */
+
+GLOBAL(boolean)
+jpeg_start_decompress (j_decompress_ptr cinfo)
+{
+  if (cinfo->global_state == DSTATE_READY) {
+    /* First call: initialize master control, select active modules */
+    jinit_master_decompress(cinfo);
+    if (cinfo->buffered_image) {
+      /* No more work here; expecting jpeg_start_output next */
+      cinfo->global_state = DSTATE_BUFIMAGE;
+      return TRUE;
+    }
+    cinfo->global_state = DSTATE_PRELOAD;
+  }
+  if (cinfo->global_state == DSTATE_PRELOAD) {
+    /* If file has multiple scans, absorb them all into the coef buffer */
+    if (cinfo->inputctl->has_multiple_scans) {
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+      for (;;) {
+	int retcode;
+	/* Call progress monitor hook if present */
+	if (cinfo->progress != NULL)
+	  (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+	/* Absorb some more input */
+	retcode = (*cinfo->inputctl->consume_input) (cinfo);
+	if (retcode == JPEG_SUSPENDED)
+	  return FALSE;
+	if (retcode == JPEG_REACHED_EOI)
+	  break;
+	/* Advance progress counter if appropriate */
+	if (cinfo->progress != NULL &&
+	    (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
+	  if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
+	    /* jdmaster underestimated number of scans; ratchet up one scan */
+	    cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
+	  }
+	}
+      }
+#else
+      ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif /* D_MULTISCAN_FILES_SUPPORTED */
+    }
+    cinfo->output_scan_number = cinfo->input_scan_number;
+  } else if (cinfo->global_state != DSTATE_PRESCAN)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  /* Perform any dummy output passes, and set up for the final pass */
+  return output_pass_setup(cinfo);
+}
+
+
+/*
+ * Set up for an output pass, and perform any dummy pass(es) needed.
+ * Common subroutine for jpeg_start_decompress and jpeg_start_output.
+ * Entry: global_state = DSTATE_PRESCAN only if previously suspended.
+ * Exit: If done, returns TRUE and sets global_state for proper output mode.
+ *       If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.
+ */
+
+LOCAL(boolean)
+output_pass_setup (j_decompress_ptr cinfo)
+{
+  if (cinfo->global_state != DSTATE_PRESCAN) {
+    /* First call: do pass setup */
+    (*cinfo->master->prepare_for_output_pass) (cinfo);
+    cinfo->output_scanline = 0;
+    cinfo->global_state = DSTATE_PRESCAN;
+  }
+  /* Loop over any required dummy passes */
+  while (cinfo->master->is_dummy_pass) {
+#ifdef QUANT_2PASS_SUPPORTED
+    /* Crank through the dummy pass */
+    while (cinfo->output_scanline < cinfo->output_height) {
+      JDIMENSION last_scanline;
+      /* Call progress monitor hook if present */
+      if (cinfo->progress != NULL) {
+	cinfo->progress->pass_counter = (long) cinfo->output_scanline;
+	cinfo->progress->pass_limit = (long) cinfo->output_height;
+	(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+      }
+      /* Process some data */
+      last_scanline = cinfo->output_scanline;
+      (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,
+				    &cinfo->output_scanline, (JDIMENSION) 0);
+      if (cinfo->output_scanline == last_scanline)
+	return FALSE;		/* No progress made, must suspend */
+    }
+    /* Finish up dummy pass, and set up for another one */
+    (*cinfo->master->finish_output_pass) (cinfo);
+    (*cinfo->master->prepare_for_output_pass) (cinfo);
+    cinfo->output_scanline = 0;
+#else
+    ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif /* QUANT_2PASS_SUPPORTED */
+  }
+  /* Ready for application to drive output pass through
+   * jpeg_read_scanlines or jpeg_read_raw_data.
+   */
+  cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
+  return TRUE;
+}
+
+
+/*
+ * Read some scanlines of data from the JPEG decompressor.
+ *
+ * The return value will be the number of lines actually read.
+ * This may be less than the number requested in several cases,
+ * including bottom of image, data source suspension, and operating
+ * modes that emit multiple scanlines at a time.
+ *
+ * Note: we warn about excess calls to jpeg_read_scanlines() since
+ * this likely signals an application programmer error.  However,
+ * an oversize buffer (max_lines > scanlines remaining) is not an error.
+ */
+
+GLOBAL(JDIMENSION)
+jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,
+		     JDIMENSION max_lines)
+{
+  JDIMENSION row_ctr;
+
+  if (cinfo->global_state != DSTATE_SCANNING)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  if (cinfo->output_scanline >= cinfo->output_height) {
+    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
+    return 0;
+  }
+
+  /* Call progress monitor hook if present */
+  if (cinfo->progress != NULL) {
+    cinfo->progress->pass_counter = (long) cinfo->output_scanline;
+    cinfo->progress->pass_limit = (long) cinfo->output_height;
+    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+  }
+
+  /* Process some data */
+  row_ctr = 0;
+  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
+  cinfo->output_scanline += row_ctr;
+  return row_ctr;
+}
+
+
+/*
+ * Alternate entry point to read raw data.
+ * Processes exactly one iMCU row per call, unless suspended.
+ */
+
+GLOBAL(JDIMENSION)
+jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
+		    JDIMENSION max_lines)
+{
+  JDIMENSION lines_per_iMCU_row;
+
+  if (cinfo->global_state != DSTATE_RAW_OK)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  if (cinfo->output_scanline >= cinfo->output_height) {
+    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
+    return 0;
+  }
+
+  /* Call progress monitor hook if present */
+  if (cinfo->progress != NULL) {
+    cinfo->progress->pass_counter = (long) cinfo->output_scanline;
+    cinfo->progress->pass_limit = (long) cinfo->output_height;
+    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+  }
+
+  /* Verify that at least one iMCU row can be returned. */
+  lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size;
+  if (max_lines < lines_per_iMCU_row)
+    ERREXIT(cinfo, JERR_BUFFER_SIZE);
+
+  /* Decompress directly into user's buffer. */
+  if (! (*cinfo->coef->decompress_data) (cinfo, data))
+    return 0;			/* suspension forced, can do nothing more */
+
+  /* OK, we processed one iMCU row. */
+  cinfo->output_scanline += lines_per_iMCU_row;
+  return lines_per_iMCU_row;
+}
+
+
+/* Additional entry points for buffered-image mode. */
+
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+
+/*
+ * Initialize for an output pass in buffered-image mode.
+ */
+
+GLOBAL(boolean)
+jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
+{
+  if (cinfo->global_state != DSTATE_BUFIMAGE &&
+      cinfo->global_state != DSTATE_PRESCAN)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  /* Limit scan number to valid range */
+  if (scan_number <= 0)
+    scan_number = 1;
+  if (cinfo->inputctl->eoi_reached &&
+      scan_number > cinfo->input_scan_number)
+    scan_number = cinfo->input_scan_number;
+  cinfo->output_scan_number = scan_number;
+  /* Perform any dummy output passes, and set up for the real pass */
+  return output_pass_setup(cinfo);
+}
+
+
+/*
+ * Finish up after an output pass in buffered-image mode.
+ *
+ * Returns FALSE if suspended.  The return value need be inspected only if
+ * a suspending data source is used.
+ */
+
+GLOBAL(boolean)
+jpeg_finish_output (j_decompress_ptr cinfo)
+{
+  if ((cinfo->global_state == DSTATE_SCANNING ||
+       cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {
+    /* Terminate this pass. */
+    /* We do not require the whole pass to have been completed. */
+    (*cinfo->master->finish_output_pass) (cinfo);
+    cinfo->global_state = DSTATE_BUFPOST;
+  } else if (cinfo->global_state != DSTATE_BUFPOST) {
+    /* BUFPOST = repeat call after a suspension, anything else is error */
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  }
+  /* Read markers looking for SOS or EOI */
+  while (cinfo->input_scan_number <= cinfo->output_scan_number &&
+	 ! cinfo->inputctl->eoi_reached) {
+    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
+      return FALSE;		/* Suspend, come back later */
+  }
+  cinfo->global_state = DSTATE_BUFIMAGE;
+  return TRUE;
+}
+
+#endif /* D_MULTISCAN_FILES_SUPPORTED */
diff --git a/src/libjpeg/jdatadst.c b/src/libjpeg/jdatadst.c
new file mode 100644
index 0000000..2ece4e9
--- /dev/null
+++ b/src/libjpeg/jdatadst.c
@@ -0,0 +1,151 @@
+/*
+ * jdatadst.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains compression data destination routines for the case of
+ * emitting JPEG data to a file (or any stdio stream).  While these routines
+ * are sufficient for most applications, some will want to use a different
+ * destination manager.
+ * IMPORTANT: we assume that fwrite() will correctly transcribe an array of
+ * JOCTETs into 8-bit-wide elements on external storage.  If char is wider
+ * than 8 bits on your machine, you may need to do some tweaking.
+ */
+
+/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jerror.h"
+
+
+/* Expanded data destination object for stdio output */
+
+typedef struct {
+  struct jpeg_destination_mgr pub; /* public fields */
+
+  FILE * outfile;		/* target stream */
+  JOCTET * buffer;		/* start of buffer */
+} my_destination_mgr;
+
+typedef my_destination_mgr * my_dest_ptr;
+
+#define OUTPUT_BUF_SIZE  4096	/* choose an efficiently fwrite'able size */
+
+
+/*
+ * Initialize destination --- called by jpeg_start_compress
+ * before any data is actually written.
+ */
+
+METHODDEF(void)
+init_destination (j_compress_ptr cinfo)
+{
+  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
+
+  /* Allocate the output buffer --- it will be released when done with image */
+  dest->buffer = (JOCTET *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
+
+  dest->pub.next_output_byte = dest->buffer;
+  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
+}
+
+
+/*
+ * Empty the output buffer --- called whenever buffer fills up.
+ *
+ * In typical applications, this should write the entire output buffer
+ * (ignoring the current state of next_output_byte & free_in_buffer),
+ * reset the pointer & count to the start of the buffer, and return TRUE
+ * indicating that the buffer has been dumped.
+ *
+ * In applications that need to be able to suspend compression due to output
+ * overrun, a FALSE return indicates that the buffer cannot be emptied now.
+ * In this situation, the compressor will return to its caller (possibly with
+ * an indication that it has not accepted all the supplied scanlines).  The
+ * application should resume compression after it has made more room in the
+ * output buffer.  Note that there are substantial restrictions on the use of
+ * suspension --- see the documentation.
+ *
+ * When suspending, the compressor will back up to a convenient restart point
+ * (typically the start of the current MCU). next_output_byte & free_in_buffer
+ * indicate where the restart point will be if the current call returns FALSE.
+ * Data beyond this point will be regenerated after resumption, so do not
+ * write it out when emptying the buffer externally.
+ */
+
+METHODDEF(boolean)
+empty_output_buffer (j_compress_ptr cinfo)
+{
+  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
+
+  if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) !=
+      (size_t) OUTPUT_BUF_SIZE)
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+
+  dest->pub.next_output_byte = dest->buffer;
+  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
+
+  return TRUE;
+}
+
+
+/*
+ * Terminate destination --- called by jpeg_finish_compress
+ * after all data has been written.  Usually needs to flush buffer.
+ *
+ * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
+ * application must deal with any cleanup that should happen even
+ * for error exit.
+ */
+
+METHODDEF(void)
+term_destination (j_compress_ptr cinfo)
+{
+  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
+  size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;
+
+  /* Write any data remaining in the buffer */
+  if (datacount > 0) {
+    if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
+      ERREXIT(cinfo, JERR_FILE_WRITE);
+  }
+  fflush(dest->outfile);
+  /* Make sure we wrote the output file OK */
+  if (ferror(dest->outfile))
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+}
+
+
+/*
+ * Prepare for output to a stdio stream.
+ * The caller must have already opened the stream, and is responsible
+ * for closing it after finishing compression.
+ */
+
+GLOBAL(void)
+jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
+{
+  my_dest_ptr dest;
+
+  /* The destination object is made permanent so that multiple JPEG images
+   * can be written to the same file without re-executing jpeg_stdio_dest.
+   * This makes it dangerous to use this manager and a different destination
+   * manager serially with the same JPEG object, because their private object
+   * sizes may be different.  Caveat programmer.
+   */
+  if (cinfo->dest == NULL) {	/* first time for this JPEG object? */
+    cinfo->dest = (struct jpeg_destination_mgr *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+				  SIZEOF(my_destination_mgr));
+  }
+
+  dest = (my_dest_ptr) cinfo->dest;
+  dest->pub.init_destination = init_destination;
+  dest->pub.empty_output_buffer = empty_output_buffer;
+  dest->pub.term_destination = term_destination;
+  dest->outfile = outfile;
+}
diff --git a/src/libjpeg/jdatasrc.c b/src/libjpeg/jdatasrc.c
new file mode 100644
index 0000000..29b6983
--- /dev/null
+++ b/src/libjpeg/jdatasrc.c
@@ -0,0 +1,212 @@
+/*
+ * jdatasrc.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains decompression data source routines for the case of
+ * reading JPEG data from a file (or any stdio stream).  While these routines
+ * are sufficient for most applications, some will want to use a different
+ * source manager.
+ * IMPORTANT: we assume that fread() will correctly transcribe an array of
+ * JOCTETs from 8-bit-wide elements on external storage.  If char is wider
+ * than 8 bits on your machine, you may need to do some tweaking.
+ */
+
+/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jerror.h"
+
+
+/* Expanded data source object for stdio input */
+
+typedef struct {
+  struct jpeg_source_mgr pub;	/* public fields */
+
+  FILE * infile;		/* source stream */
+  JOCTET * buffer;		/* start of buffer */
+  boolean start_of_file;	/* have we gotten any data yet? */
+} my_source_mgr;
+
+typedef my_source_mgr * my_src_ptr;
+
+#define INPUT_BUF_SIZE  4096	/* choose an efficiently fread'able size */
+
+
+/*
+ * Initialize source --- called by jpeg_read_header
+ * before any data is actually read.
+ */
+
+METHODDEF(void)
+init_source (j_decompress_ptr cinfo)
+{
+  my_src_ptr src = (my_src_ptr) cinfo->src;
+
+  /* We reset the empty-input-file flag for each image,
+   * but we don't clear the input buffer.
+   * This is correct behavior for reading a series of images from one source.
+   */
+  src->start_of_file = TRUE;
+}
+
+
+/*
+ * Fill the input buffer --- called whenever buffer is emptied.
+ *
+ * In typical applications, this should read fresh data into the buffer
+ * (ignoring the current state of next_input_byte & bytes_in_buffer),
+ * reset the pointer & count to the start of the buffer, and return TRUE
+ * indicating that the buffer has been reloaded.  It is not necessary to
+ * fill the buffer entirely, only to obtain at least one more byte.
+ *
+ * There is no such thing as an EOF return.  If the end of the file has been
+ * reached, the routine has a choice of ERREXIT() or inserting fake data into
+ * the buffer.  In most cases, generating a warning message and inserting a
+ * fake EOI marker is the best course of action --- this will allow the
+ * decompressor to output however much of the image is there.  However,
+ * the resulting error message is misleading if the real problem is an empty
+ * input file, so we handle that case specially.
+ *
+ * In applications that need to be able to suspend compression due to input
+ * not being available yet, a FALSE return indicates that no more data can be
+ * obtained right now, but more may be forthcoming later.  In this situation,
+ * the decompressor will return to its caller (with an indication of the
+ * number of scanlines it has read, if any).  The application should resume
+ * decompression after it has loaded more data into the input buffer.  Note
+ * that there are substantial restrictions on the use of suspension --- see
+ * the documentation.
+ *
+ * When suspending, the decompressor will back up to a convenient restart point
+ * (typically the start of the current MCU). next_input_byte & bytes_in_buffer
+ * indicate where the restart point will be if the current call returns FALSE.
+ * Data beyond this point must be rescanned after resumption, so move it to
+ * the front of the buffer rather than discarding it.
+ */
+
+METHODDEF(boolean)
+fill_input_buffer (j_decompress_ptr cinfo)
+{
+  my_src_ptr src = (my_src_ptr) cinfo->src;
+  size_t nbytes;
+
+  nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);
+
+  if (nbytes <= 0) {
+    if (src->start_of_file)	/* Treat empty input file as fatal error */
+      ERREXIT(cinfo, JERR_INPUT_EMPTY);
+    WARNMS(cinfo, JWRN_JPEG_EOF);
+    /* Insert a fake EOI marker */
+    src->buffer[0] = (JOCTET) 0xFF;
+    src->buffer[1] = (JOCTET) JPEG_EOI;
+    nbytes = 2;
+  }
+
+  src->pub.next_input_byte = src->buffer;
+  src->pub.bytes_in_buffer = nbytes;
+  src->start_of_file = FALSE;
+
+  return TRUE;
+}
+
+
+/*
+ * Skip data --- used to skip over a potentially large amount of
+ * uninteresting data (such as an APPn marker).
+ *
+ * Writers of suspendable-input applications must note that skip_input_data
+ * is not granted the right to give a suspension return.  If the skip extends
+ * beyond the data currently in the buffer, the buffer can be marked empty so
+ * that the next read will cause a fill_input_buffer call that can suspend.
+ * Arranging for additional bytes to be discarded before reloading the input
+ * buffer is the application writer's problem.
+ */
+
+METHODDEF(void)
+skip_input_data (j_decompress_ptr cinfo, long num_bytes)
+{
+  my_src_ptr src = (my_src_ptr) cinfo->src;
+
+  /* Just a dumb implementation for now.  Could use fseek() except
+   * it doesn't work on pipes.  Not clear that being smart is worth
+   * any trouble anyway --- large skips are infrequent.
+   */
+  if (num_bytes > 0) {
+    while (num_bytes > (long) src->pub.bytes_in_buffer) {
+      num_bytes -= (long) src->pub.bytes_in_buffer;
+      (void) fill_input_buffer(cinfo);
+      /* note we assume that fill_input_buffer will never return FALSE,
+       * so suspension need not be handled.
+       */
+    }
+    src->pub.next_input_byte += (size_t) num_bytes;
+    src->pub.bytes_in_buffer -= (size_t) num_bytes;
+  }
+}
+
+
+/*
+ * An additional method that can be provided by data source modules is the
+ * resync_to_restart method for error recovery in the presence of RST markers.
+ * For the moment, this source module just uses the default resync method
+ * provided by the JPEG library.  That method assumes that no backtracking
+ * is possible.
+ */
+
+
+/*
+ * Terminate source --- called by jpeg_finish_decompress
+ * after all data has been read.  Often a no-op.
+ *
+ * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
+ * application must deal with any cleanup that should happen even
+ * for error exit.
+ */
+
+METHODDEF(void)
+term_source (j_decompress_ptr cinfo)
+{
+  /* no work necessary here */
+}
+
+
+/*
+ * Prepare for input from a stdio stream.
+ * The caller must have already opened the stream, and is responsible
+ * for closing it after finishing decompression.
+ */
+
+GLOBAL(void)
+jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
+{
+  my_src_ptr src;
+
+  /* The source object and input buffer are made permanent so that a series
+   * of JPEG images can be read from the same file by calling jpeg_stdio_src
+   * only before the first one.  (If we discarded the buffer at the end of
+   * one image, we'd likely lose the start of the next one.)
+   * This makes it unsafe to use this manager and a different source
+   * manager serially with the same JPEG object.  Caveat programmer.
+   */
+  if (cinfo->src == NULL) {	/* first time for this JPEG object? */
+    cinfo->src = (struct jpeg_source_mgr *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+				  SIZEOF(my_source_mgr));
+    src = (my_src_ptr) cinfo->src;
+    src->buffer = (JOCTET *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+				  INPUT_BUF_SIZE * SIZEOF(JOCTET));
+  }
+
+  src = (my_src_ptr) cinfo->src;
+  src->pub.init_source = init_source;
+  src->pub.fill_input_buffer = fill_input_buffer;
+  src->pub.skip_input_data = skip_input_data;
+  src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
+  src->pub.term_source = term_source;
+  src->infile = infile;
+  src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
+  src->pub.next_input_byte = NULL; /* until buffer loaded */
+}
diff --git a/src/libjpeg/jdcoefct.c b/src/libjpeg/jdcoefct.c
new file mode 100644
index 0000000..992bd10
--- /dev/null
+++ b/src/libjpeg/jdcoefct.c
@@ -0,0 +1,736 @@
+/*
+ * jdcoefct.c
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the coefficient buffer controller for decompression.
+ * This controller is the top level of the JPEG decompressor proper.
+ * The coefficient buffer lies between entropy decoding and inverse-DCT steps.
+ *
+ * In buffered-image mode, this controller is the interface between
+ * input-oriented processing and output-oriented processing.
+ * Also, the input side (only) is used when reading a file for transcoding.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+/* Block smoothing is only applicable for progressive JPEG, so: */
+#ifndef D_PROGRESSIVE_SUPPORTED
+#undef BLOCK_SMOOTHING_SUPPORTED
+#endif
+
+/* Private buffer controller object */
+
+typedef struct {
+  struct jpeg_d_coef_controller pub; /* public fields */
+
+  /* These variables keep track of the current location of the input side. */
+  /* cinfo->input_iMCU_row is also used for this. */
+  JDIMENSION MCU_ctr;		/* counts MCUs processed in current row */
+  int MCU_vert_offset;		/* counts MCU rows within iMCU row */
+  int MCU_rows_per_iMCU_row;	/* number of such rows needed */
+
+  /* The output side's location is represented by cinfo->output_iMCU_row. */
+
+  /* In single-pass modes, it's sufficient to buffer just one MCU.
+   * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
+   * and let the entropy decoder write into that workspace each time.
+   * (On 80x86, the workspace is FAR even though it's not really very big;
+   * this is to keep the module interfaces unchanged when a large coefficient
+   * buffer is necessary.)
+   * In multi-pass modes, this array points to the current MCU's blocks
+   * within the virtual arrays; it is used only by the input side.
+   */
+  JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];
+
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+  /* In multi-pass modes, we need a virtual block array for each component. */
+  jvirt_barray_ptr whole_image[MAX_COMPONENTS];
+#endif
+
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+  /* When doing block smoothing, we latch coefficient Al values here */
+  int * coef_bits_latch;
+#define SAVED_COEFS  6		/* we save coef_bits[0..5] */
+#endif
+} my_coef_controller;
+
+typedef my_coef_controller * my_coef_ptr;
+
+/* Forward declarations */
+METHODDEF(int) decompress_onepass
+	JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+METHODDEF(int) decompress_data
+	JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
+#endif
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo));
+METHODDEF(int) decompress_smooth_data
+	JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
+#endif
+
+
+LOCAL(void)
+start_iMCU_row (j_decompress_ptr cinfo)
+/* Reset within-iMCU-row counters for a new row (input side) */
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+  /* In an interleaved scan, an MCU row is the same as an iMCU row.
+   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
+   * But at the bottom of the image, process only what's left.
+   */
+  if (cinfo->comps_in_scan > 1) {
+    coef->MCU_rows_per_iMCU_row = 1;
+  } else {
+    if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1))
+      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
+    else
+      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
+  }
+
+  coef->MCU_ctr = 0;
+  coef->MCU_vert_offset = 0;
+}
+
+
+/*
+ * Initialize for an input processing pass.
+ */
+
+METHODDEF(void)
+start_input_pass (j_decompress_ptr cinfo)
+{
+  cinfo->input_iMCU_row = 0;
+  start_iMCU_row(cinfo);
+}
+
+
+/*
+ * Initialize for an output processing pass.
+ */
+
+METHODDEF(void)
+start_output_pass (j_decompress_ptr cinfo)
+{
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+  /* If multipass, check to see whether to use block smoothing on this pass */
+  if (coef->pub.coef_arrays != NULL) {
+    if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
+      coef->pub.decompress_data = decompress_smooth_data;
+    else
+      coef->pub.decompress_data = decompress_data;
+  }
+#endif
+  cinfo->output_iMCU_row = 0;
+}
+
+
+/*
+ * Decompress and return some data in the single-pass case.
+ * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
+ * Input and output must run in lockstep since we have only a one-MCU buffer.
+ * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
+ *
+ * NB: output_buf contains a plane for each component in image,
+ * which we index according to the component's SOF position.
+ */
+
+METHODDEF(int)
+decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+  JDIMENSION MCU_col_num;	/* index of current MCU within row */
+  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
+  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+  int blkn, ci, xindex, yindex, yoffset, useful_width;
+  JSAMPARRAY output_ptr;
+  JDIMENSION start_col, output_col;
+  jpeg_component_info *compptr;
+  inverse_DCT_method_ptr inverse_DCT;
+
+  /* Loop to process as much as one whole iMCU row */
+  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
+       yoffset++) {
+    for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
+	 MCU_col_num++) {
+      /* Try to fetch an MCU.  Entropy decoder expects buffer to be zeroed. */
+      jzero_far((void FAR *) coef->MCU_buffer[0],
+		(size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));
+      if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
+	/* Suspension forced; update state counters and exit */
+	coef->MCU_vert_offset = yoffset;
+	coef->MCU_ctr = MCU_col_num;
+	return JPEG_SUSPENDED;
+      }
+      /* Determine where data should go in output_buf and do the IDCT thing.
+       * We skip dummy blocks at the right and bottom edges (but blkn gets
+       * incremented past them!).  Note the inner loop relies on having
+       * allocated the MCU_buffer[] blocks sequentially.
+       */
+      blkn = 0;			/* index of current DCT block within MCU */
+      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+	compptr = cinfo->cur_comp_info[ci];
+	/* Don't bother to IDCT an uninteresting component. */
+	if (! compptr->component_needed) {
+	  blkn += compptr->MCU_blocks;
+	  continue;
+	}
+	inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
+	useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
+						    : compptr->last_col_width;
+	output_ptr = output_buf[compptr->component_index] +
+	  yoffset * compptr->DCT_scaled_size;
+	start_col = MCU_col_num * compptr->MCU_sample_width;
+	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
+	  if (cinfo->input_iMCU_row < last_iMCU_row ||
+	      yoffset+yindex < compptr->last_row_height) {
+	    output_col = start_col;
+	    for (xindex = 0; xindex < useful_width; xindex++) {
+	      (*inverse_DCT) (cinfo, compptr,
+			      (JCOEFPTR) coef->MCU_buffer[blkn+xindex],
+			      output_ptr, output_col);
+	      output_col += compptr->DCT_scaled_size;
+	    }
+	  }
+	  blkn += compptr->MCU_width;
+	  output_ptr += compptr->DCT_scaled_size;
+	}
+      }
+    }
+    /* Completed an MCU row, but perhaps not an iMCU row */
+    coef->MCU_ctr = 0;
+  }
+  /* Completed the iMCU row, advance counters for next one */
+  cinfo->output_iMCU_row++;
+  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
+    start_iMCU_row(cinfo);
+    return JPEG_ROW_COMPLETED;
+  }
+  /* Completed the scan */
+  (*cinfo->inputctl->finish_input_pass) (cinfo);
+  return JPEG_SCAN_COMPLETED;
+}
+
+
+/*
+ * Dummy consume-input routine for single-pass operation.
+ */
+
+METHODDEF(int)
+dummy_consume_data (j_decompress_ptr cinfo)
+{
+  return JPEG_SUSPENDED;	/* Always indicate nothing was done */
+}
+
+
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+
+/*
+ * Consume input data and store it in the full-image coefficient buffer.
+ * We read as much as one fully interleaved MCU row ("iMCU" row) per call,
+ * ie, v_samp_factor block rows for each component in the scan.
+ * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
+ */
+
+METHODDEF(int)
+consume_data (j_decompress_ptr cinfo)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+  JDIMENSION MCU_col_num;	/* index of current MCU within row */
+  int blkn, ci, xindex, yindex, yoffset;
+  JDIMENSION start_col;
+  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
+  JBLOCKROW buffer_ptr;
+  jpeg_component_info *compptr;
+
+  /* Align the virtual buffers for the components used in this scan. */
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    compptr = cinfo->cur_comp_info[ci];
+    buffer[ci] = (*cinfo->mem->access_virt_barray)
+      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
+       cinfo->input_iMCU_row * compptr->v_samp_factor,
+       (JDIMENSION) compptr->v_samp_factor, TRUE);
+    /* Note: entropy decoder expects buffer to be zeroed,
+     * but this is handled automatically by the memory manager
+     * because we requested a pre-zeroed array.
+     */
+  }
+
+  /* Loop to process one whole iMCU row */
+  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
+       yoffset++) {
+    for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
+	 MCU_col_num++) {
+      /* Construct list of pointers to DCT blocks belonging to this MCU */
+      blkn = 0;			/* index of current DCT block within MCU */
+      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+	compptr = cinfo->cur_comp_info[ci];
+	start_col = MCU_col_num * compptr->MCU_width;
+	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
+	  buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
+	  for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
+	    coef->MCU_buffer[blkn++] = buffer_ptr++;
+	  }
+	}
+      }
+      /* Try to fetch the MCU. */
+      if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
+	/* Suspension forced; update state counters and exit */
+	coef->MCU_vert_offset = yoffset;
+	coef->MCU_ctr = MCU_col_num;
+	return JPEG_SUSPENDED;
+      }
+    }
+    /* Completed an MCU row, but perhaps not an iMCU row */
+    coef->MCU_ctr = 0;
+  }
+  /* Completed the iMCU row, advance counters for next one */
+  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
+    start_iMCU_row(cinfo);
+    return JPEG_ROW_COMPLETED;
+  }
+  /* Completed the scan */
+  (*cinfo->inputctl->finish_input_pass) (cinfo);
+  return JPEG_SCAN_COMPLETED;
+}
+
+
+/*
+ * Decompress and return some data in the multi-pass case.
+ * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
+ * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
+ *
+ * NB: output_buf contains a plane for each component in image.
+ */
+
+METHODDEF(int)
+decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+  JDIMENSION block_num;
+  int ci, block_row, block_rows;
+  JBLOCKARRAY buffer;
+  JBLOCKROW buffer_ptr;
+  JSAMPARRAY output_ptr;
+  JDIMENSION output_col;
+  jpeg_component_info *compptr;
+  inverse_DCT_method_ptr inverse_DCT;
+
+  /* Force some input to be done if we are getting ahead of the input. */
+  while (cinfo->input_scan_number < cinfo->output_scan_number ||
+	 (cinfo->input_scan_number == cinfo->output_scan_number &&
+	  cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {
+    if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
+      return JPEG_SUSPENDED;
+  }
+
+  /* OK, output from the virtual arrays. */
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* Don't bother to IDCT an uninteresting component. */
+    if (! compptr->component_needed)
+      continue;
+    /* Align the virtual buffer for this component. */
+    buffer = (*cinfo->mem->access_virt_barray)
+      ((j_common_ptr) cinfo, coef->whole_image[ci],
+       cinfo->output_iMCU_row * compptr->v_samp_factor,
+       (JDIMENSION) compptr->v_samp_factor, FALSE);
+    /* Count non-dummy DCT block rows in this iMCU row. */
+    if (cinfo->output_iMCU_row < last_iMCU_row)
+      block_rows = compptr->v_samp_factor;
+    else {
+      /* NB: can't use last_row_height here; it is input-side-dependent! */
+      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
+      if (block_rows == 0) block_rows = compptr->v_samp_factor;
+    }
+    inverse_DCT = cinfo->idct->inverse_DCT[ci];
+    output_ptr = output_buf[ci];
+    /* Loop over all DCT blocks to be processed. */
+    for (block_row = 0; block_row < block_rows; block_row++) {
+      buffer_ptr = buffer[block_row];
+      output_col = 0;
+      for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) {
+	(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,
+			output_ptr, output_col);
+	buffer_ptr++;
+	output_col += compptr->DCT_scaled_size;
+      }
+      output_ptr += compptr->DCT_scaled_size;
+    }
+  }
+
+  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
+    return JPEG_ROW_COMPLETED;
+  return JPEG_SCAN_COMPLETED;
+}
+
+#endif /* D_MULTISCAN_FILES_SUPPORTED */
+
+
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+
+/*
+ * This code applies interblock smoothing as described by section K.8
+ * of the JPEG standard: the first 5 AC coefficients are estimated from
+ * the DC values of a DCT block and its 8 neighboring blocks.
+ * We apply smoothing only for progressive JPEG decoding, and only if
+ * the coefficients it can estimate are not yet known to full precision.
+ */
+
+/* Natural-order array positions of the first 5 zigzag-order coefficients */
+#define Q01_POS  1
+#define Q10_POS  8
+#define Q20_POS  16
+#define Q11_POS  9
+#define Q02_POS  2
+
+/*
+ * Determine whether block smoothing is applicable and safe.
+ * We also latch the current states of the coef_bits[] entries for the
+ * AC coefficients; otherwise, if the input side of the decompressor
+ * advances into a new scan, we might think the coefficients are known
+ * more accurately than they really are.
+ */
+
+LOCAL(boolean)
+smoothing_ok (j_decompress_ptr cinfo)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+  boolean smoothing_useful = FALSE;
+  int ci, coefi;
+  jpeg_component_info *compptr;
+  JQUANT_TBL * qtable;
+  int * coef_bits;
+  int * coef_bits_latch;
+
+  if (! cinfo->progressive_mode || cinfo->coef_bits == NULL)
+    return FALSE;
+
+  /* Allocate latch area if not already done */
+  if (coef->coef_bits_latch == NULL)
+    coef->coef_bits_latch = (int *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  cinfo->num_components *
+				  (SAVED_COEFS * SIZEOF(int)));
+  coef_bits_latch = coef->coef_bits_latch;
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* All components' quantization values must already be latched. */
+    if ((qtable = compptr->quant_table) == NULL)
+      return FALSE;
+    /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
+    if (qtable->quantval[0] == 0 ||
+	qtable->quantval[Q01_POS] == 0 ||
+	qtable->quantval[Q10_POS] == 0 ||
+	qtable->quantval[Q20_POS] == 0 ||
+	qtable->quantval[Q11_POS] == 0 ||
+	qtable->quantval[Q02_POS] == 0)
+      return FALSE;
+    /* DC values must be at least partly known for all components. */
+    coef_bits = cinfo->coef_bits[ci];
+    if (coef_bits[0] < 0)
+      return FALSE;
+    /* Block smoothing is helpful if some AC coefficients remain inaccurate. */
+    for (coefi = 1; coefi <= 5; coefi++) {
+      coef_bits_latch[coefi] = coef_bits[coefi];
+      if (coef_bits[coefi] != 0)
+	smoothing_useful = TRUE;
+    }
+    coef_bits_latch += SAVED_COEFS;
+  }
+
+  return smoothing_useful;
+}
+
+
+/*
+ * Variant of decompress_data for use when doing block smoothing.
+ */
+
+METHODDEF(int)
+decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
+{
+  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+  JDIMENSION block_num, last_block_column;
+  int ci, block_row, block_rows, access_rows;
+  JBLOCKARRAY buffer;
+  JBLOCKROW buffer_ptr, prev_block_row, next_block_row;
+  JSAMPARRAY output_ptr;
+  JDIMENSION output_col;
+  jpeg_component_info *compptr;
+  inverse_DCT_method_ptr inverse_DCT;
+  boolean first_row, last_row;
+  JBLOCK workspace;
+  int *coef_bits;
+  JQUANT_TBL *quanttbl;
+  INT32 Q00,Q01,Q02,Q10,Q11,Q20, num;
+  int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;
+  int Al, pred;
+
+  /* Force some input to be done if we are getting ahead of the input. */
+  while (cinfo->input_scan_number <= cinfo->output_scan_number &&
+	 ! cinfo->inputctl->eoi_reached) {
+    if (cinfo->input_scan_number == cinfo->output_scan_number) {
+      /* If input is working on current scan, we ordinarily want it to
+       * have completed the current row.  But if input scan is DC,
+       * we want it to keep one row ahead so that next block row's DC
+       * values are up to date.
+       */
+      JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
+      if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta)
+	break;
+    }
+    if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
+      return JPEG_SUSPENDED;
+  }
+
+  /* OK, output from the virtual arrays. */
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* Don't bother to IDCT an uninteresting component. */
+    if (! compptr->component_needed)
+      continue;
+    /* Count non-dummy DCT block rows in this iMCU row. */
+    if (cinfo->output_iMCU_row < last_iMCU_row) {
+      block_rows = compptr->v_samp_factor;
+      access_rows = block_rows * 2; /* this and next iMCU row */
+      last_row = FALSE;
+    } else {
+      /* NB: can't use last_row_height here; it is input-side-dependent! */
+      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
+      if (block_rows == 0) block_rows = compptr->v_samp_factor;
+      access_rows = block_rows; /* this iMCU row only */
+      last_row = TRUE;
+    }
+    /* Align the virtual buffer for this component. */
+    if (cinfo->output_iMCU_row > 0) {
+      access_rows += compptr->v_samp_factor; /* prior iMCU row too */
+      buffer = (*cinfo->mem->access_virt_barray)
+	((j_common_ptr) cinfo, coef->whole_image[ci],
+	 (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
+	 (JDIMENSION) access_rows, FALSE);
+      buffer += compptr->v_samp_factor;	/* point to current iMCU row */
+      first_row = FALSE;
+    } else {
+      buffer = (*cinfo->mem->access_virt_barray)
+	((j_common_ptr) cinfo, coef->whole_image[ci],
+	 (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE);
+      first_row = TRUE;
+    }
+    /* Fetch component-dependent info */
+    coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
+    quanttbl = compptr->quant_table;
+    Q00 = quanttbl->quantval[0];
+    Q01 = quanttbl->quantval[Q01_POS];
+    Q10 = quanttbl->quantval[Q10_POS];
+    Q20 = quanttbl->quantval[Q20_POS];
+    Q11 = quanttbl->quantval[Q11_POS];
+    Q02 = quanttbl->quantval[Q02_POS];
+    inverse_DCT = cinfo->idct->inverse_DCT[ci];
+    output_ptr = output_buf[ci];
+    /* Loop over all DCT blocks to be processed. */
+    for (block_row = 0; block_row < block_rows; block_row++) {
+      buffer_ptr = buffer[block_row];
+      if (first_row && block_row == 0)
+	prev_block_row = buffer_ptr;
+      else
+	prev_block_row = buffer[block_row-1];
+      if (last_row && block_row == block_rows-1)
+	next_block_row = buffer_ptr;
+      else
+	next_block_row = buffer[block_row+1];
+      /* We fetch the surrounding DC values using a sliding-register approach.
+       * Initialize all nine here so as to do the right thing on narrow pics.
+       */
+      DC1 = DC2 = DC3 = (int) prev_block_row[0][0];
+      DC4 = DC5 = DC6 = (int) buffer_ptr[0][0];
+      DC7 = DC8 = DC9 = (int) next_block_row[0][0];
+      output_col = 0;
+      last_block_column = compptr->width_in_blocks - 1;
+      for (block_num = 0; block_num <= last_block_column; block_num++) {
+	/* Fetch current DCT block into workspace so we can modify it. */
+	jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1);
+	/* Update DC values */
+	if (block_num < last_block_column) {
+	  DC3 = (int) prev_block_row[1][0];
+	  DC6 = (int) buffer_ptr[1][0];
+	  DC9 = (int) next_block_row[1][0];
+	}
+	/* Compute coefficient estimates per K.8.
+	 * An estimate is applied only if coefficient is still zero,
+	 * and is not known to be fully accurate.
+	 */
+	/* AC01 */
+	if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {
+	  num = 36 * Q00 * (DC4 - DC6);
+	  if (num >= 0) {
+	    pred = (int) (((Q01<<7) + num) / (Q01<<8));
+	    if (Al > 0 && pred >= (1<<Al))
+	      pred = (1<<Al)-1;
+	  } else {
+	    pred = (int) (((Q01<<7) - num) / (Q01<<8));
+	    if (Al > 0 && pred >= (1<<Al))
+	      pred = (1<<Al)-1;
+	    pred = -pred;
+	  }
+	  workspace[1] = (JCOEF) pred;
+	}
+	/* AC10 */
+	if ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {
+	  num = 36 * Q00 * (DC2 - DC8);
+	  if (num >= 0) {
+	    pred = (int) (((Q10<<7) + num) / (Q10<<8));
+	    if (Al > 0 && pred >= (1<<Al))
+	      pred = (1<<Al)-1;
+	  } else {
+	    pred = (int) (((Q10<<7) - num) / (Q10<<8));
+	    if (Al > 0 && pred >= (1<<Al))
+	      pred = (1<<Al)-1;
+	    pred = -pred;
+	  }
+	  workspace[8] = (JCOEF) pred;
+	}
+	/* AC20 */
+	if ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {
+	  num = 9 * Q00 * (DC2 + DC8 - 2*DC5);
+	  if (num >= 0) {
+	    pred = (int) (((Q20<<7) + num) / (Q20<<8));
+	    if (Al > 0 && pred >= (1<<Al))
+	      pred = (1<<Al)-1;
+	  } else {
+	    pred = (int) (((Q20<<7) - num) / (Q20<<8));
+	    if (Al > 0 && pred >= (1<<Al))
+	      pred = (1<<Al)-1;
+	    pred = -pred;
+	  }
+	  workspace[16] = (JCOEF) pred;
+	}
+	/* AC11 */
+	if ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {
+	  num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
+	  if (num >= 0) {
+	    pred = (int) (((Q11<<7) + num) / (Q11<<8));
+	    if (Al > 0 && pred >= (1<<Al))
+	      pred = (1<<Al)-1;
+	  } else {
+	    pred = (int) (((Q11<<7) - num) / (Q11<<8));
+	    if (Al > 0 && pred >= (1<<Al))
+	      pred = (1<<Al)-1;
+	    pred = -pred;
+	  }
+	  workspace[9] = (JCOEF) pred;
+	}
+	/* AC02 */
+	if ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {
+	  num = 9 * Q00 * (DC4 + DC6 - 2*DC5);
+	  if (num >= 0) {
+	    pred = (int) (((Q02<<7) + num) / (Q02<<8));
+	    if (Al > 0 && pred >= (1<<Al))
+	      pred = (1<<Al)-1;
+	  } else {
+	    pred = (int) (((Q02<<7) - num) / (Q02<<8));
+	    if (Al > 0 && pred >= (1<<Al))
+	      pred = (1<<Al)-1;
+	    pred = -pred;
+	  }
+	  workspace[2] = (JCOEF) pred;
+	}
+	/* OK, do the IDCT */
+	(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,
+			output_ptr, output_col);
+	/* Advance for next column */
+	DC1 = DC2; DC2 = DC3;
+	DC4 = DC5; DC5 = DC6;
+	DC7 = DC8; DC8 = DC9;
+	buffer_ptr++, prev_block_row++, next_block_row++;
+	output_col += compptr->DCT_scaled_size;
+      }
+      output_ptr += compptr->DCT_scaled_size;
+    }
+  }
+
+  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
+    return JPEG_ROW_COMPLETED;
+  return JPEG_SCAN_COMPLETED;
+}
+
+#endif /* BLOCK_SMOOTHING_SUPPORTED */
+
+
+/*
+ * Initialize coefficient buffer controller.
+ */
+
+GLOBAL(void)
+jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
+{
+  my_coef_ptr coef;
+
+  coef = (my_coef_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_coef_controller));
+  cinfo->coef = (struct jpeg_d_coef_controller *) coef;
+  coef->pub.start_input_pass = start_input_pass;
+  coef->pub.start_output_pass = start_output_pass;
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+  coef->coef_bits_latch = NULL;
+#endif
+
+  /* Create the coefficient buffer. */
+  if (need_full_buffer) {
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+    /* Allocate a full-image virtual array for each component, */
+    /* padded to a multiple of samp_factor DCT blocks in each direction. */
+    /* Note we ask for a pre-zeroed array. */
+    int ci, access_rows;
+    jpeg_component_info *compptr;
+
+    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+	 ci++, compptr++) {
+      access_rows = compptr->v_samp_factor;
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+      /* If block smoothing could be used, need a bigger window */
+      if (cinfo->progressive_mode)
+	access_rows *= 3;
+#endif
+      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
+	((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,
+	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
+				(long) compptr->h_samp_factor),
+	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+				(long) compptr->v_samp_factor),
+	 (JDIMENSION) access_rows);
+    }
+    coef->pub.consume_data = consume_data;
+    coef->pub.decompress_data = decompress_data;
+    coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */
+#else
+    ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+  } else {
+    /* We only need a single-MCU buffer. */
+    JBLOCKROW buffer;
+    int i;
+
+    buffer = (JBLOCKROW)
+      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
+    for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
+      coef->MCU_buffer[i] = buffer + i;
+    }
+    coef->pub.consume_data = dummy_consume_data;
+    coef->pub.decompress_data = decompress_onepass;
+    coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
+  }
+}
diff --git a/src/libjpeg/jdcolor.c b/src/libjpeg/jdcolor.c
new file mode 100644
index 0000000..fd7b138
--- /dev/null
+++ b/src/libjpeg/jdcolor.c
@@ -0,0 +1,396 @@
+/*
+ * jdcolor.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains output colorspace conversion routines.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private subobject */
+
+typedef struct {
+  struct jpeg_color_deconverter pub; /* public fields */
+
+  /* Private state for YCC->RGB conversion */
+  int * Cr_r_tab;		/* => table for Cr to R conversion */
+  int * Cb_b_tab;		/* => table for Cb to B conversion */
+  INT32 * Cr_g_tab;		/* => table for Cr to G conversion */
+  INT32 * Cb_g_tab;		/* => table for Cb to G conversion */
+} my_color_deconverter;
+
+typedef my_color_deconverter * my_cconvert_ptr;
+
+
+/**************** YCbCr -> RGB conversion: most common case **************/
+
+/*
+ * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
+ * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
+ * The conversion equations to be implemented are therefore
+ *	R = Y                + 1.40200 * Cr
+ *	G = Y - 0.34414 * Cb - 0.71414 * Cr
+ *	B = Y + 1.77200 * Cb
+ * where Cb and Cr represent the incoming values less CENTERJSAMPLE.
+ * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
+ *
+ * To avoid floating-point arithmetic, we represent the fractional constants
+ * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
+ * the products by 2^16, with appropriate rounding, to get the correct answer.
+ * Notice that Y, being an integral input, does not contribute any fraction
+ * so it need not participate in the rounding.
+ *
+ * For even more speed, we avoid doing any multiplications in the inner loop
+ * by precalculating the constants times Cb and Cr for all possible values.
+ * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
+ * for 12-bit samples it is still acceptable.  It's not very reasonable for
+ * 16-bit samples, but if you want lossless storage you shouldn't be changing
+ * colorspace anyway.
+ * The Cr=>R and Cb=>B values can be rounded to integers in advance; the
+ * values for the G calculation are left scaled up, since we must add them
+ * together before rounding.
+ */
+
+#define SCALEBITS	16	/* speediest right-shift on some machines */
+#define ONE_HALF	((INT32) 1 << (SCALEBITS-1))
+#define FIX(x)		((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
+
+
+/*
+ * Initialize tables for YCC->RGB colorspace conversion.
+ */
+
+LOCAL(void)
+build_ycc_rgb_table (j_decompress_ptr cinfo)
+{
+  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+  int i;
+  INT32 x;
+  SHIFT_TEMPS
+
+  cconvert->Cr_r_tab = (int *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(MAXJSAMPLE+1) * SIZEOF(int));
+  cconvert->Cb_b_tab = (int *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(MAXJSAMPLE+1) * SIZEOF(int));
+  cconvert->Cr_g_tab = (INT32 *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(MAXJSAMPLE+1) * SIZEOF(INT32));
+  cconvert->Cb_g_tab = (INT32 *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(MAXJSAMPLE+1) * SIZEOF(INT32));
+
+  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
+    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
+    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
+    /* Cr=>R value is nearest int to 1.40200 * x */
+    cconvert->Cr_r_tab[i] = (int)
+		    RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
+    /* Cb=>B value is nearest int to 1.77200 * x */
+    cconvert->Cb_b_tab[i] = (int)
+		    RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
+    /* Cr=>G value is scaled-up -0.71414 * x */
+    cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;
+    /* Cb=>G value is scaled-up -0.34414 * x */
+    /* We also add in ONE_HALF so that need not do it in inner loop */
+    cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
+  }
+}
+
+
+/*
+ * Convert some rows of samples to the output colorspace.
+ *
+ * Note that we change from noninterleaved, one-plane-per-component format
+ * to interleaved-pixel format.  The output buffer is therefore three times
+ * as wide as the input buffer.
+ * A starting row offset is provided only for the input buffer.  The caller
+ * can easily adjust the passed output_buf value to accommodate any row
+ * offset required on that side.
+ */
+
+METHODDEF(void)
+ycc_rgb_convert (j_decompress_ptr cinfo,
+		 JSAMPIMAGE input_buf, JDIMENSION input_row,
+		 JSAMPARRAY output_buf, int num_rows)
+{
+  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+  register int y, cb, cr;
+  register JSAMPROW outptr;
+  register JSAMPROW inptr0, inptr1, inptr2;
+  register JDIMENSION col;
+  JDIMENSION num_cols = cinfo->output_width;
+  /* copy these pointers into registers if possible */
+  register JSAMPLE * range_limit = cinfo->sample_range_limit;
+  register int * Crrtab = cconvert->Cr_r_tab;
+  register int * Cbbtab = cconvert->Cb_b_tab;
+  register INT32 * Crgtab = cconvert->Cr_g_tab;
+  register INT32 * Cbgtab = cconvert->Cb_g_tab;
+  SHIFT_TEMPS
+
+  while (--num_rows >= 0) {
+    inptr0 = input_buf[0][input_row];
+    inptr1 = input_buf[1][input_row];
+    inptr2 = input_buf[2][input_row];
+    input_row++;
+    outptr = *output_buf++;
+    for (col = 0; col < num_cols; col++) {
+      y  = GETJSAMPLE(inptr0[col]);
+      cb = GETJSAMPLE(inptr1[col]);
+      cr = GETJSAMPLE(inptr2[col]);
+      /* Range-limiting is essential due to noise introduced by DCT losses. */
+      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
+      outptr[RGB_GREEN] = range_limit[y +
+			      ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
+						 SCALEBITS))];
+      outptr[RGB_BLUE] =  range_limit[y + Cbbtab[cb]];
+      outptr += RGB_PIXELSIZE;
+    }
+  }
+}
+
+
+/**************** Cases other than YCbCr -> RGB **************/
+
+
+/*
+ * Color conversion for no colorspace change: just copy the data,
+ * converting from separate-planes to interleaved representation.
+ */
+
+METHODDEF(void)
+null_convert (j_decompress_ptr cinfo,
+	      JSAMPIMAGE input_buf, JDIMENSION input_row,
+	      JSAMPARRAY output_buf, int num_rows)
+{
+  register JSAMPROW inptr, outptr;
+  register JDIMENSION count;
+  register int num_components = cinfo->num_components;
+  JDIMENSION num_cols = cinfo->output_width;
+  int ci;
+
+  while (--num_rows >= 0) {
+    for (ci = 0; ci < num_components; ci++) {
+      inptr = input_buf[ci][input_row];
+      outptr = output_buf[0] + ci;
+      for (count = num_cols; count > 0; count--) {
+	*outptr = *inptr++;	/* needn't bother with GETJSAMPLE() here */
+	outptr += num_components;
+      }
+    }
+    input_row++;
+    output_buf++;
+  }
+}
+
+
+/*
+ * Color conversion for grayscale: just copy the data.
+ * This also works for YCbCr -> grayscale conversion, in which
+ * we just copy the Y (luminance) component and ignore chrominance.
+ */
+
+METHODDEF(void)
+grayscale_convert (j_decompress_ptr cinfo,
+		   JSAMPIMAGE input_buf, JDIMENSION input_row,
+		   JSAMPARRAY output_buf, int num_rows)
+{
+  jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,
+		    num_rows, cinfo->output_width);
+}
+
+
+/*
+ * Convert grayscale to RGB: just duplicate the graylevel three times.
+ * This is provided to support applications that don't want to cope
+ * with grayscale as a separate case.
+ */
+
+METHODDEF(void)
+gray_rgb_convert (j_decompress_ptr cinfo,
+		  JSAMPIMAGE input_buf, JDIMENSION input_row,
+		  JSAMPARRAY output_buf, int num_rows)
+{
+  register JSAMPROW inptr, outptr;
+  register JDIMENSION col;
+  JDIMENSION num_cols = cinfo->output_width;
+
+  while (--num_rows >= 0) {
+    inptr = input_buf[0][input_row++];
+    outptr = *output_buf++;
+    for (col = 0; col < num_cols; col++) {
+      /* We can dispense with GETJSAMPLE() here */
+      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
+      outptr += RGB_PIXELSIZE;
+    }
+  }
+}
+
+
+/*
+ * Adobe-style YCCK->CMYK conversion.
+ * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same
+ * conversion as above, while passing K (black) unchanged.
+ * We assume build_ycc_rgb_table has been called.
+ */
+
+METHODDEF(void)
+ycck_cmyk_convert (j_decompress_ptr cinfo,
+		   JSAMPIMAGE input_buf, JDIMENSION input_row,
+		   JSAMPARRAY output_buf, int num_rows)
+{
+  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+  register int y, cb, cr;
+  register JSAMPROW outptr;
+  register JSAMPROW inptr0, inptr1, inptr2, inptr3;
+  register JDIMENSION col;
+  JDIMENSION num_cols = cinfo->output_width;
+  /* copy these pointers into registers if possible */
+  register JSAMPLE * range_limit = cinfo->sample_range_limit;
+  register int * Crrtab = cconvert->Cr_r_tab;
+  register int * Cbbtab = cconvert->Cb_b_tab;
+  register INT32 * Crgtab = cconvert->Cr_g_tab;
+  register INT32 * Cbgtab = cconvert->Cb_g_tab;
+  SHIFT_TEMPS
+
+  while (--num_rows >= 0) {
+    inptr0 = input_buf[0][input_row];
+    inptr1 = input_buf[1][input_row];
+    inptr2 = input_buf[2][input_row];
+    inptr3 = input_buf[3][input_row];
+    input_row++;
+    outptr = *output_buf++;
+    for (col = 0; col < num_cols; col++) {
+      y  = GETJSAMPLE(inptr0[col]);
+      cb = GETJSAMPLE(inptr1[col]);
+      cr = GETJSAMPLE(inptr2[col]);
+      /* Range-limiting is essential due to noise introduced by DCT losses. */
+      outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])];	/* red */
+      outptr[1] = range_limit[MAXJSAMPLE - (y +			/* green */
+			      ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
+						 SCALEBITS)))];
+      outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])];	/* blue */
+      /* K passes through unchanged */
+      outptr[3] = inptr3[col];	/* don't need GETJSAMPLE here */
+      outptr += 4;
+    }
+  }
+}
+
+
+/*
+ * Empty method for start_pass.
+ */
+
+METHODDEF(void)
+start_pass_dcolor (j_decompress_ptr cinfo)
+{
+  /* no work needed */
+}
+
+
+/*
+ * Module initialization routine for output colorspace conversion.
+ */
+
+GLOBAL(void)
+jinit_color_deconverter (j_decompress_ptr cinfo)
+{
+  my_cconvert_ptr cconvert;
+  int ci;
+
+  cconvert = (my_cconvert_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_color_deconverter));
+  cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert;
+  cconvert->pub.start_pass = start_pass_dcolor;
+
+  /* Make sure num_components agrees with jpeg_color_space */
+  switch (cinfo->jpeg_color_space) {
+  case JCS_GRAYSCALE:
+    if (cinfo->num_components != 1)
+      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+    break;
+
+  case JCS_RGB:
+  case JCS_YCbCr:
+    if (cinfo->num_components != 3)
+      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+    break;
+
+  case JCS_CMYK:
+  case JCS_YCCK:
+    if (cinfo->num_components != 4)
+      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+    break;
+
+  default:			/* JCS_UNKNOWN can be anything */
+    if (cinfo->num_components < 1)
+      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+    break;
+  }
+
+  /* Set out_color_components and conversion method based on requested space.
+   * Also clear the component_needed flags for any unused components,
+   * so that earlier pipeline stages can avoid useless computation.
+   */
+
+  switch (cinfo->out_color_space) {
+  case JCS_GRAYSCALE:
+    cinfo->out_color_components = 1;
+    if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
+	cinfo->jpeg_color_space == JCS_YCbCr) {
+      cconvert->pub.color_convert = grayscale_convert;
+      /* For color->grayscale conversion, only the Y (0) component is needed */
+      for (ci = 1; ci < cinfo->num_components; ci++)
+	cinfo->comp_info[ci].component_needed = FALSE;
+    } else
+      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+    break;
+
+  case JCS_RGB:
+    cinfo->out_color_components = RGB_PIXELSIZE;
+    if (cinfo->jpeg_color_space == JCS_YCbCr) {
+      cconvert->pub.color_convert = ycc_rgb_convert;
+      build_ycc_rgb_table(cinfo);
+    } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
+      cconvert->pub.color_convert = gray_rgb_convert;
+    } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) {
+      cconvert->pub.color_convert = null_convert;
+    } else
+      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+    break;
+
+  case JCS_CMYK:
+    cinfo->out_color_components = 4;
+    if (cinfo->jpeg_color_space == JCS_YCCK) {
+      cconvert->pub.color_convert = ycck_cmyk_convert;
+      build_ycc_rgb_table(cinfo);
+    } else if (cinfo->jpeg_color_space == JCS_CMYK) {
+      cconvert->pub.color_convert = null_convert;
+    } else
+      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+    break;
+
+  default:
+    /* Permit null conversion to same output space */
+    if (cinfo->out_color_space == cinfo->jpeg_color_space) {
+      cinfo->out_color_components = cinfo->num_components;
+      cconvert->pub.color_convert = null_convert;
+    } else			/* unsupported non-null conversion */
+      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+    break;
+  }
+
+  if (cinfo->quantize_colors)
+    cinfo->output_components = 1; /* single colormapped output component */
+  else
+    cinfo->output_components = cinfo->out_color_components;
+}
diff --git a/src/libjpeg/jdct.h b/src/libjpeg/jdct.h
new file mode 100644
index 0000000..b664cab
--- /dev/null
+++ b/src/libjpeg/jdct.h
@@ -0,0 +1,176 @@
+/*
+ * jdct.h
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This include file contains common declarations for the forward and
+ * inverse DCT modules.  These declarations are private to the DCT managers
+ * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
+ * The individual DCT algorithms are kept in separate files to ease 
+ * machine-dependent tuning (e.g., assembly coding).
+ */
+
+
+/*
+ * A forward DCT routine is given a pointer to a work area of type DCTELEM[];
+ * the DCT is to be performed in-place in that buffer.  Type DCTELEM is int
+ * for 8-bit samples, INT32 for 12-bit samples.  (NOTE: Floating-point DCT
+ * implementations use an array of type FAST_FLOAT, instead.)
+ * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).
+ * The DCT outputs are returned scaled up by a factor of 8; they therefore
+ * have a range of +-8K for 8-bit data, +-128K for 12-bit data.  This
+ * convention improves accuracy in integer implementations and saves some
+ * work in floating-point ones.
+ * Quantization of the output coefficients is done by jcdctmgr.c.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+typedef int DCTELEM;		/* 16 or 32 bits is fine */
+#else
+typedef INT32 DCTELEM;		/* must have 32 bits */
+#endif
+
+typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data));
+typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data));
+
+
+/*
+ * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
+ * to an output sample array.  The routine must dequantize the input data as
+ * well as perform the IDCT; for dequantization, it uses the multiplier table
+ * pointed to by compptr->dct_table.  The output data is to be placed into the
+ * sample array starting at a specified column.  (Any row offset needed will
+ * be applied to the array pointer before it is passed to the IDCT code.)
+ * Note that the number of samples emitted by the IDCT routine is
+ * DCT_scaled_size * DCT_scaled_size.
+ */
+
+/* typedef inverse_DCT_method_ptr is declared in jpegint.h */
+
+/*
+ * Each IDCT routine has its own ideas about the best dct_table element type.
+ */
+
+typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */
+#if BITS_IN_JSAMPLE == 8
+typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */
+#define IFAST_SCALE_BITS  2	/* fractional bits in scale factors */
+#else
+typedef INT32 IFAST_MULT_TYPE;	/* need 32 bits for scaled quantizers */
+#define IFAST_SCALE_BITS  13	/* fractional bits in scale factors */
+#endif
+typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
+
+
+/*
+ * Each IDCT routine is responsible for range-limiting its results and
+ * converting them to unsigned form (0..MAXJSAMPLE).  The raw outputs could
+ * be quite far out of range if the input data is corrupt, so a bulletproof
+ * range-limiting step is required.  We use a mask-and-table-lookup method
+ * to do the combined operations quickly.  See the comments with
+ * prepare_range_limit_table (in jdmaster.c) for more info.
+ */
+
+#define IDCT_range_limit(cinfo)  ((cinfo)->sample_range_limit + CENTERJSAMPLE)
+
+#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
+
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_fdct_islow		jFDislow
+#define jpeg_fdct_ifast		jFDifast
+#define jpeg_fdct_float		jFDfloat
+#define jpeg_idct_islow		jRDislow
+#define jpeg_idct_ifast		jRDifast
+#define jpeg_idct_float		jRDfloat
+#define jpeg_idct_4x4		jRD4x4
+#define jpeg_idct_2x2		jRD2x2
+#define jpeg_idct_1x1		jRD1x1
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+/* Extern declarations for the forward and inverse DCT routines. */
+
+EXTERN(void) jpeg_fdct_islow JPP((DCTELEM * data));
+EXTERN(void) jpeg_fdct_ifast JPP((DCTELEM * data));
+EXTERN(void) jpeg_fdct_float JPP((FAST_FLOAT * data));
+
+EXTERN(void) jpeg_idct_islow
+    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+EXTERN(void) jpeg_idct_ifast
+    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+EXTERN(void) jpeg_idct_float
+    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+EXTERN(void) jpeg_idct_4x4
+    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+EXTERN(void) jpeg_idct_2x2
+    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+EXTERN(void) jpeg_idct_1x1
+    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+
+
+/*
+ * Macros for handling fixed-point arithmetic; these are used by many
+ * but not all of the DCT/IDCT modules.
+ *
+ * All values are expected to be of type INT32.
+ * Fractional constants are scaled left by CONST_BITS bits.
+ * CONST_BITS is defined within each module using these macros,
+ * and may differ from one module to the next.
+ */
+
+#define ONE	((INT32) 1)
+#define CONST_SCALE (ONE << CONST_BITS)
+
+/* Convert a positive real constant to an integer scaled by CONST_SCALE.
+ * Caution: some C compilers fail to reduce "FIX(constant)" at compile time,
+ * thus causing a lot of useless floating-point operations at run time.
+ */
+
+#define FIX(x)	((INT32) ((x) * CONST_SCALE + 0.5))
+
+/* Descale and correctly round an INT32 value that's scaled by N bits.
+ * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
+ * the fudge factor is correct for either sign of X.
+ */
+
+#define DESCALE(x,n)  RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
+
+/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
+ * This macro is used only when the two inputs will actually be no more than
+ * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
+ * full 32x32 multiply.  This provides a useful speedup on many machines.
+ * Unfortunately there is no way to specify a 16x16->32 multiply portably
+ * in C, but some C compilers will do the right thing if you provide the
+ * correct combination of casts.
+ */
+
+#ifdef SHORTxSHORT_32		/* may work if 'int' is 32 bits */
+#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT16) (const)))
+#endif
+#ifdef SHORTxLCONST_32		/* known to work with Microsoft C 6.0 */
+#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT32) (const)))
+#endif
+
+#ifndef MULTIPLY16C16		/* default definition */
+#define MULTIPLY16C16(var,const)  ((var) * (const))
+#endif
+
+/* Same except both inputs are variables. */
+
+#ifdef SHORTxSHORT_32		/* may work if 'int' is 32 bits */
+#define MULTIPLY16V16(var1,var2)  (((INT16) (var1)) * ((INT16) (var2)))
+#endif
+
+#ifndef MULTIPLY16V16		/* default definition */
+#define MULTIPLY16V16(var1,var2)  ((var1) * (var2))
+#endif
diff --git a/src/libjpeg/jddctmgr.c b/src/libjpeg/jddctmgr.c
new file mode 100644
index 0000000..0e44eb1
--- /dev/null
+++ b/src/libjpeg/jddctmgr.c
@@ -0,0 +1,269 @@
+/*
+ * jddctmgr.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the inverse-DCT management logic.
+ * This code selects a particular IDCT implementation to be used,
+ * and it performs related housekeeping chores.  No code in this file
+ * is executed per IDCT step, only during output pass setup.
+ *
+ * Note that the IDCT routines are responsible for performing coefficient
+ * dequantization as well as the IDCT proper.  This module sets up the
+ * dequantization multiplier table needed by the IDCT routine.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h"		/* Private declarations for DCT subsystem */
+
+
+/*
+ * The decompressor input side (jdinput.c) saves away the appropriate
+ * quantization table for each component at the start of the first scan
+ * involving that component.  (This is necessary in order to correctly
+ * decode files that reuse Q-table slots.)
+ * When we are ready to make an output pass, the saved Q-table is converted
+ * to a multiplier table that will actually be used by the IDCT routine.
+ * The multiplier table contents are IDCT-method-dependent.  To support
+ * application changes in IDCT method between scans, we can remake the
+ * multiplier tables if necessary.
+ * In buffered-image mode, the first output pass may occur before any data
+ * has been seen for some components, and thus before their Q-tables have
+ * been saved away.  To handle this case, multiplier tables are preset
+ * to zeroes; the result of the IDCT will be a neutral gray level.
+ */
+
+
+/* Private subobject for this module */
+
+typedef struct {
+  struct jpeg_inverse_dct pub;	/* public fields */
+
+  /* This array contains the IDCT method code that each multiplier table
+   * is currently set up for, or -1 if it's not yet set up.
+   * The actual multiplier tables are pointed to by dct_table in the
+   * per-component comp_info structures.
+   */
+  int cur_method[MAX_COMPONENTS];
+} my_idct_controller;
+
+typedef my_idct_controller * my_idct_ptr;
+
+
+/* Allocated multiplier tables: big enough for any supported variant */
+
+typedef union {
+  ISLOW_MULT_TYPE islow_array[DCTSIZE2];
+#ifdef DCT_IFAST_SUPPORTED
+  IFAST_MULT_TYPE ifast_array[DCTSIZE2];
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+  FLOAT_MULT_TYPE float_array[DCTSIZE2];
+#endif
+} multiplier_table;
+
+
+/* The current scaled-IDCT routines require ISLOW-style multiplier tables,
+ * so be sure to compile that code if either ISLOW or SCALING is requested.
+ */
+#ifdef DCT_ISLOW_SUPPORTED
+#define PROVIDE_ISLOW_TABLES
+#else
+#ifdef IDCT_SCALING_SUPPORTED
+#define PROVIDE_ISLOW_TABLES
+#endif
+#endif
+
+
+/*
+ * Prepare for an output pass.
+ * Here we select the proper IDCT routine for each component and build
+ * a matching multiplier table.
+ */
+
+METHODDEF(void)
+start_pass (j_decompress_ptr cinfo)
+{
+  my_idct_ptr idct = (my_idct_ptr) cinfo->idct;
+  int ci, i;
+  jpeg_component_info *compptr;
+  int method = 0;
+  inverse_DCT_method_ptr method_ptr = NULL;
+  JQUANT_TBL * qtbl;
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* Select the proper IDCT routine for this component's scaling */
+    switch (compptr->DCT_scaled_size) {
+#ifdef IDCT_SCALING_SUPPORTED
+    case 1:
+      method_ptr = jpeg_idct_1x1;
+      method = JDCT_ISLOW;	/* jidctred uses islow-style table */
+      break;
+    case 2:
+      method_ptr = jpeg_idct_2x2;
+      method = JDCT_ISLOW;	/* jidctred uses islow-style table */
+      break;
+    case 4:
+      method_ptr = jpeg_idct_4x4;
+      method = JDCT_ISLOW;	/* jidctred uses islow-style table */
+      break;
+#endif
+    case DCTSIZE:
+      switch (cinfo->dct_method) {
+#ifdef DCT_ISLOW_SUPPORTED
+      case JDCT_ISLOW:
+	method_ptr = jpeg_idct_islow;
+	method = JDCT_ISLOW;
+	break;
+#endif
+#ifdef DCT_IFAST_SUPPORTED
+      case JDCT_IFAST:
+	method_ptr = jpeg_idct_ifast;
+	method = JDCT_IFAST;
+	break;
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+      case JDCT_FLOAT:
+	method_ptr = jpeg_idct_float;
+	method = JDCT_FLOAT;
+	break;
+#endif
+      default:
+	ERREXIT(cinfo, JERR_NOT_COMPILED);
+	break;
+      }
+      break;
+    default:
+      ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->DCT_scaled_size);
+      break;
+    }
+    idct->pub.inverse_DCT[ci] = method_ptr;
+    /* Create multiplier table from quant table.
+     * However, we can skip this if the component is uninteresting
+     * or if we already built the table.  Also, if no quant table
+     * has yet been saved for the component, we leave the
+     * multiplier table all-zero; we'll be reading zeroes from the
+     * coefficient controller's buffer anyway.
+     */
+    if (! compptr->component_needed || idct->cur_method[ci] == method)
+      continue;
+    qtbl = compptr->quant_table;
+    if (qtbl == NULL)		/* happens if no data yet for component */
+      continue;
+    idct->cur_method[ci] = method;
+    switch (method) {
+#ifdef PROVIDE_ISLOW_TABLES
+    case JDCT_ISLOW:
+      {
+	/* For LL&M IDCT method, multipliers are equal to raw quantization
+	 * coefficients, but are stored as ints to ensure access efficiency.
+	 */
+	ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;
+	for (i = 0; i < DCTSIZE2; i++) {
+	  ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];
+	}
+      }
+      break;
+#endif
+#ifdef DCT_IFAST_SUPPORTED
+    case JDCT_IFAST:
+      {
+	/* For AA&N IDCT method, multipliers are equal to quantization
+	 * coefficients scaled by scalefactor[row]*scalefactor[col], where
+	 *   scalefactor[0] = 1
+	 *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7
+	 * For integer operation, the multiplier table is to be scaled by
+	 * IFAST_SCALE_BITS.
+	 */
+	IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;
+#define CONST_BITS 14
+	static const INT16 aanscales[DCTSIZE2] = {
+	  /* precomputed values scaled up by 14 bits */
+	  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
+	  22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,
+	  21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,
+	  19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,
+	  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
+	  12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,
+	   8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,
+	   4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247
+	};
+	SHIFT_TEMPS
+
+	for (i = 0; i < DCTSIZE2; i++) {
+	  ifmtbl[i] = (IFAST_MULT_TYPE)
+	    DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
+				  (INT32) aanscales[i]),
+		    CONST_BITS-IFAST_SCALE_BITS);
+	}
+      }
+      break;
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+    case JDCT_FLOAT:
+      {
+	/* For float AA&N IDCT method, multipliers are equal to quantization
+	 * coefficients scaled by scalefactor[row]*scalefactor[col], where
+	 *   scalefactor[0] = 1
+	 *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7
+	 */
+	FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;
+	int row, col;
+	static const double aanscalefactor[DCTSIZE] = {
+	  1.0, 1.387039845, 1.306562965, 1.175875602,
+	  1.0, 0.785694958, 0.541196100, 0.275899379
+	};
+
+	i = 0;
+	for (row = 0; row < DCTSIZE; row++) {
+	  for (col = 0; col < DCTSIZE; col++) {
+	    fmtbl[i] = (FLOAT_MULT_TYPE)
+	      ((double) qtbl->quantval[i] *
+	       aanscalefactor[row] * aanscalefactor[col]);
+	    i++;
+	  }
+	}
+      }
+      break;
+#endif
+    default:
+      ERREXIT(cinfo, JERR_NOT_COMPILED);
+      break;
+    }
+  }
+}
+
+
+/*
+ * Initialize IDCT manager.
+ */
+
+GLOBAL(void)
+jinit_inverse_dct (j_decompress_ptr cinfo)
+{
+  my_idct_ptr idct;
+  int ci;
+  jpeg_component_info *compptr;
+
+  idct = (my_idct_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_idct_controller));
+  cinfo->idct = (struct jpeg_inverse_dct *) idct;
+  idct->pub.start_pass = start_pass;
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* Allocate and pre-zero a multiplier table for each component */
+    compptr->dct_table =
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(multiplier_table));
+    MEMZERO(compptr->dct_table, SIZEOF(multiplier_table));
+    /* Mark multiplier table not yet set up for any method */
+    idct->cur_method[ci] = -1;
+  }
+}
diff --git a/src/libjpeg/jdhuff.c b/src/libjpeg/jdhuff.c
new file mode 100644
index 0000000..b2ad66d
--- /dev/null
+++ b/src/libjpeg/jdhuff.c
@@ -0,0 +1,651 @@
+/*
+ * jdhuff.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains Huffman entropy decoding routines.
+ *
+ * Much of the complexity here has to do with supporting input suspension.
+ * If the data source module demands suspension, we want to be able to back
+ * up to the start of the current MCU.  To do this, we copy state variables
+ * into local working storage, and update them back to the permanent
+ * storage only upon successful completion of an MCU.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdhuff.h"		/* Declarations shared with jdphuff.c */
+
+
+/*
+ * Expanded entropy decoder object for Huffman decoding.
+ *
+ * The savable_state subrecord contains fields that change within an MCU,
+ * but must not be updated permanently until we complete the MCU.
+ */
+
+typedef struct {
+  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
+} savable_state;
+
+/* This macro is to work around compilers with missing or broken
+ * structure assignment.  You'll need to fix this code if you have
+ * such a compiler and you change MAX_COMPS_IN_SCAN.
+ */
+
+#ifndef NO_STRUCT_ASSIGN
+#define ASSIGN_STATE(dest,src)  ((dest) = (src))
+#else
+#if MAX_COMPS_IN_SCAN == 4
+#define ASSIGN_STATE(dest,src)  \
+	((dest).last_dc_val[0] = (src).last_dc_val[0], \
+	 (dest).last_dc_val[1] = (src).last_dc_val[1], \
+	 (dest).last_dc_val[2] = (src).last_dc_val[2], \
+	 (dest).last_dc_val[3] = (src).last_dc_val[3])
+#endif
+#endif
+
+
+typedef struct {
+  struct jpeg_entropy_decoder pub; /* public fields */
+
+  /* These fields are loaded into local variables at start of each MCU.
+   * In case of suspension, we exit WITHOUT updating them.
+   */
+  bitread_perm_state bitstate;	/* Bit buffer at start of MCU */
+  savable_state saved;		/* Other state at start of MCU */
+
+  /* These fields are NOT loaded into local working state. */
+  unsigned int restarts_to_go;	/* MCUs left in this restart interval */
+
+  /* Pointers to derived tables (these workspaces have image lifespan) */
+  d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
+  d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
+
+  /* Precalculated info set up by start_pass for use in decode_mcu: */
+
+  /* Pointers to derived tables to be used for each block within an MCU */
+  d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];
+  d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];
+  /* Whether we care about the DC and AC coefficient values for each block */
+  boolean dc_needed[D_MAX_BLOCKS_IN_MCU];
+  boolean ac_needed[D_MAX_BLOCKS_IN_MCU];
+} huff_entropy_decoder;
+
+typedef huff_entropy_decoder * huff_entropy_ptr;
+
+
+/*
+ * Initialize for a Huffman-compressed scan.
+ */
+
+METHODDEF(void)
+start_pass_huff_decoder (j_decompress_ptr cinfo)
+{
+  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+  int ci, blkn, dctbl, actbl;
+  jpeg_component_info * compptr;
+
+  /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
+   * This ought to be an error condition, but we make it a warning because
+   * there are some baseline files out there with all zeroes in these bytes.
+   */
+  if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 ||
+      cinfo->Ah != 0 || cinfo->Al != 0)
+    WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
+
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    compptr = cinfo->cur_comp_info[ci];
+    dctbl = compptr->dc_tbl_no;
+    actbl = compptr->ac_tbl_no;
+    /* Compute derived values for Huffman tables */
+    /* We may do this more than once for a table, but it's not expensive */
+    jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl,
+			    & entropy->dc_derived_tbls[dctbl]);
+    jpeg_make_d_derived_tbl(cinfo, FALSE, actbl,
+			    & entropy->ac_derived_tbls[actbl]);
+    /* Initialize DC predictions to 0 */
+    entropy->saved.last_dc_val[ci] = 0;
+  }
+
+  /* Precalculate decoding info for each block in an MCU of this scan */
+  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+    ci = cinfo->MCU_membership[blkn];
+    compptr = cinfo->cur_comp_info[ci];
+    /* Precalculate which table to use for each block */
+    entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
+    entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
+    /* Decide whether we really care about the coefficient values */
+    if (compptr->component_needed) {
+      entropy->dc_needed[blkn] = TRUE;
+      /* we don't need the ACs if producing a 1/8th-size image */
+      entropy->ac_needed[blkn] = (compptr->DCT_scaled_size > 1);
+    } else {
+      entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE;
+    }
+  }
+
+  /* Initialize bitread state variables */
+  entropy->bitstate.bits_left = 0;
+  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
+  entropy->pub.insufficient_data = FALSE;
+
+  /* Initialize restart counter */
+  entropy->restarts_to_go = cinfo->restart_interval;
+}
+
+
+/*
+ * Compute the derived values for a Huffman table.
+ * This routine also performs some validation checks on the table.
+ *
+ * Note this is also used by jdphuff.c.
+ */
+
+GLOBAL(void)
+jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
+			 d_derived_tbl ** pdtbl)
+{
+  JHUFF_TBL *htbl;
+  d_derived_tbl *dtbl;
+  int p, i, l, si, numsymbols;
+  int lookbits, ctr;
+  char huffsize[257];
+  unsigned int huffcode[257];
+  unsigned int code;
+
+  /* Note that huffsize[] and huffcode[] are filled in code-length order,
+   * paralleling the order of the symbols themselves in htbl->huffval[].
+   */
+
+  /* Find the input Huffman table */
+  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
+    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
+  htbl =
+    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
+  if (htbl == NULL)
+    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
+
+  /* Allocate a workspace if we haven't already done so. */
+  if (*pdtbl == NULL)
+    *pdtbl = (d_derived_tbl *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(d_derived_tbl));
+  dtbl = *pdtbl;
+  dtbl->pub = htbl;		/* fill in back link */
+  
+  /* Figure C.1: make table of Huffman code length for each symbol */
+
+  p = 0;
+  for (l = 1; l <= 16; l++) {
+    i = (int) htbl->bits[l];
+    if (i < 0 || p + i > 256)	/* protect against table overrun */
+      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+    while (i--)
+      huffsize[p++] = (char) l;
+  }
+  huffsize[p] = 0;
+  numsymbols = p;
+  
+  /* Figure C.2: generate the codes themselves */
+  /* We also validate that the counts represent a legal Huffman code tree. */
+  
+  code = 0;
+  si = huffsize[0];
+  p = 0;
+  while (huffsize[p]) {
+    while (((int) huffsize[p]) == si) {
+      huffcode[p++] = code;
+      code++;
+    }
+    /* code is now 1 more than the last code used for codelength si; but
+     * it must still fit in si bits, since no code is allowed to be all ones.
+     */
+    if (((INT32) code) >= (((INT32) 1) << si))
+      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+    code <<= 1;
+    si++;
+  }
+
+  /* Figure F.15: generate decoding tables for bit-sequential decoding */
+
+  p = 0;
+  for (l = 1; l <= 16; l++) {
+    if (htbl->bits[l]) {
+      /* valoffset[l] = huffval[] index of 1st symbol of code length l,
+       * minus the minimum code of length l
+       */
+      dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p];
+      p += htbl->bits[l];
+      dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */
+    } else {
+      dtbl->maxcode[l] = -1;	/* -1 if no codes of this length */
+    }
+  }
+  dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */
+
+  /* Compute lookahead tables to speed up decoding.
+   * First we set all the table entries to 0, indicating "too long";
+   * then we iterate through the Huffman codes that are short enough and
+   * fill in all the entries that correspond to bit sequences starting
+   * with that code.
+   */
+
+  MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits));
+
+  p = 0;
+  for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
+    for (i = 1; i <= (int) htbl->bits[l]; i++, p++) {
+      /* l = current code's length, p = its index in huffcode[] & huffval[]. */
+      /* Generate left-justified code followed by all possible bit sequences */
+      lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);
+      for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {
+	dtbl->look_nbits[lookbits] = l;
+	dtbl->look_sym[lookbits] = htbl->huffval[p];
+	lookbits++;
+      }
+    }
+  }
+
+  /* Validate symbols as being reasonable.
+   * For AC tables, we make no check, but accept all byte values 0..255.
+   * For DC tables, we require the symbols to be in range 0..15.
+   * (Tighter bounds could be applied depending on the data depth and mode,
+   * but this is sufficient to ensure safe decoding.)
+   */
+  if (isDC) {
+    for (i = 0; i < numsymbols; i++) {
+      int sym = htbl->huffval[i];
+      if (sym < 0 || sym > 15)
+	ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+    }
+  }
+}
+
+
+/*
+ * Out-of-line code for bit fetching (shared with jdphuff.c).
+ * See jdhuff.h for info about usage.
+ * Note: current values of get_buffer and bits_left are passed as parameters,
+ * but are returned in the corresponding fields of the state struct.
+ *
+ * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width
+ * of get_buffer to be used.  (On machines with wider words, an even larger
+ * buffer could be used.)  However, on some machines 32-bit shifts are
+ * quite slow and take time proportional to the number of places shifted.
+ * (This is true with most PC compilers, for instance.)  In this case it may
+ * be a win to set MIN_GET_BITS to the minimum value of 15.  This reduces the
+ * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.
+ */
+
+#ifdef SLOW_SHIFT_32
+#define MIN_GET_BITS  15	/* minimum allowable value */
+#else
+#define MIN_GET_BITS  (BIT_BUF_SIZE-7)
+#endif
+
+
+GLOBAL(boolean)
+jpeg_fill_bit_buffer (bitread_working_state * state,
+		      register bit_buf_type get_buffer, register int bits_left,
+		      int nbits)
+/* Load up the bit buffer to a depth of at least nbits */
+{
+  /* Copy heavily used state fields into locals (hopefully registers) */
+  register const JOCTET * next_input_byte = state->next_input_byte;
+  register size_t bytes_in_buffer = state->bytes_in_buffer;
+  j_decompress_ptr cinfo = state->cinfo;
+
+  /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
+  /* (It is assumed that no request will be for more than that many bits.) */
+  /* We fail to do so only if we hit a marker or are forced to suspend. */
+
+  if (cinfo->unread_marker == 0) {	/* cannot advance past a marker */
+    while (bits_left < MIN_GET_BITS) {
+      register int c;
+
+      /* Attempt to read a byte */
+      if (bytes_in_buffer == 0) {
+	if (! (*cinfo->src->fill_input_buffer) (cinfo))
+	  return FALSE;
+	next_input_byte = cinfo->src->next_input_byte;
+	bytes_in_buffer = cinfo->src->bytes_in_buffer;
+      }
+      bytes_in_buffer--;
+      c = GETJOCTET(*next_input_byte++);
+
+      /* If it's 0xFF, check and discard stuffed zero byte */
+      if (c == 0xFF) {
+	/* Loop here to discard any padding FF's on terminating marker,
+	 * so that we can save a valid unread_marker value.  NOTE: we will
+	 * accept multiple FF's followed by a 0 as meaning a single FF data
+	 * byte.  This data pattern is not valid according to the standard.
+	 */
+	do {
+	  if (bytes_in_buffer == 0) {
+	    if (! (*cinfo->src->fill_input_buffer) (cinfo))
+	      return FALSE;
+	    next_input_byte = cinfo->src->next_input_byte;
+	    bytes_in_buffer = cinfo->src->bytes_in_buffer;
+	  }
+	  bytes_in_buffer--;
+	  c = GETJOCTET(*next_input_byte++);
+	} while (c == 0xFF);
+
+	if (c == 0) {
+	  /* Found FF/00, which represents an FF data byte */
+	  c = 0xFF;
+	} else {
+	  /* Oops, it's actually a marker indicating end of compressed data.
+	   * Save the marker code for later use.
+	   * Fine point: it might appear that we should save the marker into
+	   * bitread working state, not straight into permanent state.  But
+	   * once we have hit a marker, we cannot need to suspend within the
+	   * current MCU, because we will read no more bytes from the data
+	   * source.  So it is OK to update permanent state right away.
+	   */
+	  cinfo->unread_marker = c;
+	  /* See if we need to insert some fake zero bits. */
+	  goto no_more_bytes;
+	}
+      }
+
+      /* OK, load c into get_buffer */
+      get_buffer = (get_buffer << 8) | c;
+      bits_left += 8;
+    } /* end while */
+  } else {
+  no_more_bytes:
+    /* We get here if we've read the marker that terminates the compressed
+     * data segment.  There should be enough bits in the buffer register
+     * to satisfy the request; if so, no problem.
+     */
+    if (nbits > bits_left) {
+      /* Uh-oh.  Report corrupted data to user and stuff zeroes into
+       * the data stream, so that we can produce some kind of image.
+       * We use a nonvolatile flag to ensure that only one warning message
+       * appears per data segment.
+       */
+      if (! cinfo->entropy->insufficient_data) {
+	WARNMS(cinfo, JWRN_HIT_MARKER);
+	cinfo->entropy->insufficient_data = TRUE;
+      }
+      /* Fill the buffer with zero bits */
+      get_buffer <<= MIN_GET_BITS - bits_left;
+      bits_left = MIN_GET_BITS;
+    }
+  }
+
+  /* Unload the local registers */
+  state->next_input_byte = next_input_byte;
+  state->bytes_in_buffer = bytes_in_buffer;
+  state->get_buffer = get_buffer;
+  state->bits_left = bits_left;
+
+  return TRUE;
+}
+
+
+/*
+ * Out-of-line code for Huffman code decoding.
+ * See jdhuff.h for info about usage.
+ */
+
+GLOBAL(int)
+jpeg_huff_decode (bitread_working_state * state,
+		  register bit_buf_type get_buffer, register int bits_left,
+		  d_derived_tbl * htbl, int min_bits)
+{
+  register int l = min_bits;
+  register INT32 code;
+
+  /* HUFF_DECODE has determined that the code is at least min_bits */
+  /* bits long, so fetch that many bits in one swoop. */
+
+  CHECK_BIT_BUFFER(*state, l, return -1);
+  code = GET_BITS(l);
+
+  /* Collect the rest of the Huffman code one bit at a time. */
+  /* This is per Figure F.16 in the JPEG spec. */
+
+  while (code > htbl->maxcode[l]) {
+    code <<= 1;
+    CHECK_BIT_BUFFER(*state, 1, return -1);
+    code |= GET_BITS(1);
+    l++;
+  }
+
+  /* Unload the local registers */
+  state->get_buffer = get_buffer;
+  state->bits_left = bits_left;
+
+  /* With garbage input we may reach the sentinel value l = 17. */
+
+  if (l > 16) {
+    WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
+    return 0;			/* fake a zero as the safest result */
+  }
+
+  return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];
+}
+
+
+/*
+ * Figure F.12: extend sign bit.
+ * On some machines, a shift and add will be faster than a table lookup.
+ */
+
+#ifdef AVOID_TABLES
+
+#define HUFF_EXTEND(x,s)  ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
+
+#else
+
+#define HUFF_EXTEND(x,s)  ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
+
+static const int extend_test[16] =   /* entry n is 2**(n-1) */
+  { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
+    0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
+
+static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
+  { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
+    ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
+    ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
+    ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
+
+#endif /* AVOID_TABLES */
+
+
+/*
+ * Check for a restart marker & resynchronize decoder.
+ * Returns FALSE if must suspend.
+ */
+
+LOCAL(boolean)
+process_restart (j_decompress_ptr cinfo)
+{
+  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+  int ci;
+
+  /* Throw away any unused bits remaining in bit buffer; */
+  /* include any full bytes in next_marker's count of discarded bytes */
+  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
+  entropy->bitstate.bits_left = 0;
+
+  /* Advance past the RSTn marker */
+  if (! (*cinfo->marker->read_restart_marker) (cinfo))
+    return FALSE;
+
+  /* Re-initialize DC predictions to 0 */
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
+    entropy->saved.last_dc_val[ci] = 0;
+
+  /* Reset restart counter */
+  entropy->restarts_to_go = cinfo->restart_interval;
+
+  /* Reset out-of-data flag, unless read_restart_marker left us smack up
+   * against a marker.  In that case we will end up treating the next data
+   * segment as empty, and we can avoid producing bogus output pixels by
+   * leaving the flag set.
+   */
+  if (cinfo->unread_marker == 0)
+    entropy->pub.insufficient_data = FALSE;
+
+  return TRUE;
+}
+
+
+/*
+ * Decode and return one MCU's worth of Huffman-compressed coefficients.
+ * The coefficients are reordered from zigzag order into natural array order,
+ * but are not dequantized.
+ *
+ * The i'th block of the MCU is stored into the block pointed to by
+ * MCU_data[i].  WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER.
+ * (Wholesale zeroing is usually a little faster than retail...)
+ *
+ * Returns FALSE if data source requested suspension.  In that case no
+ * changes have been made to permanent state.  (Exception: some output
+ * coefficients may already have been assigned.  This is harmless for
+ * this module, since we'll just re-assign them on the next call.)
+ */
+
+METHODDEF(boolean)
+decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+  int blkn;
+  BITREAD_STATE_VARS;
+  savable_state state;
+
+  /* Process restart marker if needed; may have to suspend */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0)
+      if (! process_restart(cinfo))
+	return FALSE;
+  }
+
+  /* If we've run out of data, just leave the MCU set to zeroes.
+   * This way, we return uniform gray for the remainder of the segment.
+   */
+  if (! entropy->pub.insufficient_data) {
+
+    /* Load up working state */
+    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
+    ASSIGN_STATE(state, entropy->saved);
+
+    /* Outer loop handles each block in the MCU */
+
+    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+      JBLOCKROW block = MCU_data[blkn];
+      d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn];
+      d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn];
+      register int s, k, r;
+
+      /* Decode a single block's worth of coefficients */
+
+      /* Section F.2.2.1: decode the DC coefficient difference */
+      HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);
+      if (s) {
+	CHECK_BIT_BUFFER(br_state, s, return FALSE);
+	r = GET_BITS(s);
+	s = HUFF_EXTEND(r, s);
+      }
+
+      if (entropy->dc_needed[blkn]) {
+	/* Convert DC difference to actual value, update last_dc_val */
+	int ci = cinfo->MCU_membership[blkn];
+	s += state.last_dc_val[ci];
+	state.last_dc_val[ci] = s;
+	/* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
+	(*block)[0] = (JCOEF) s;
+      }
+
+      if (entropy->ac_needed[blkn]) {
+
+	/* Section F.2.2.2: decode the AC coefficients */
+	/* Since zeroes are skipped, output area must be cleared beforehand */
+	for (k = 1; k < DCTSIZE2; k++) {
+	  HUFF_DECODE(s, br_state, actbl, return FALSE, label2);
+      
+	  r = s >> 4;
+	  s &= 15;
+      
+	  if (s) {
+	    k += r;
+	    CHECK_BIT_BUFFER(br_state, s, return FALSE);
+	    r = GET_BITS(s);
+	    s = HUFF_EXTEND(r, s);
+	    /* Output coefficient in natural (dezigzagged) order.
+	     * Note: the extra entries in jpeg_natural_order[] will save us
+	     * if k >= DCTSIZE2, which could happen if the data is corrupted.
+	     */
+	    (*block)[jpeg_natural_order[k]] = (JCOEF) s;
+	  } else {
+	    if (r != 15)
+	      break;
+	    k += 15;
+	  }
+	}
+
+      } else {
+
+	/* Section F.2.2.2: decode the AC coefficients */
+	/* In this path we just discard the values */
+	for (k = 1; k < DCTSIZE2; k++) {
+	  HUFF_DECODE(s, br_state, actbl, return FALSE, label3);
+      
+	  r = s >> 4;
+	  s &= 15;
+      
+	  if (s) {
+	    k += r;
+	    CHECK_BIT_BUFFER(br_state, s, return FALSE);
+	    DROP_BITS(s);
+	  } else {
+	    if (r != 15)
+	      break;
+	    k += 15;
+	  }
+	}
+
+      }
+    }
+
+    /* Completed MCU, so update state */
+    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
+    ASSIGN_STATE(entropy->saved, state);
+  }
+
+  /* Account for restart interval (no-op if not using restarts) */
+  entropy->restarts_to_go--;
+
+  return TRUE;
+}
+
+
+/*
+ * Module initialization routine for Huffman entropy decoding.
+ */
+
+GLOBAL(void)
+jinit_huff_decoder (j_decompress_ptr cinfo)
+{
+  huff_entropy_ptr entropy;
+  int i;
+
+  entropy = (huff_entropy_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(huff_entropy_decoder));
+  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
+  entropy->pub.start_pass = start_pass_huff_decoder;
+  entropy->pub.decode_mcu = decode_mcu;
+
+  /* Mark tables unallocated */
+  for (i = 0; i < NUM_HUFF_TBLS; i++) {
+    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
+  }
+}
diff --git a/src/libjpeg/jdhuff.h b/src/libjpeg/jdhuff.h
new file mode 100644
index 0000000..12c0747
--- /dev/null
+++ b/src/libjpeg/jdhuff.h
@@ -0,0 +1,201 @@
+/*
+ * jdhuff.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains declarations for Huffman entropy decoding routines
+ * that are shared between the sequential decoder (jdhuff.c) and the
+ * progressive decoder (jdphuff.c).  No other modules need to see these.
+ */
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_make_d_derived_tbl	jMkDDerived
+#define jpeg_fill_bit_buffer	jFilBitBuf
+#define jpeg_huff_decode	jHufDecode
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/* Derived data constructed for each Huffman table */
+
+#define HUFF_LOOKAHEAD	8	/* # of bits of lookahead */
+
+typedef struct {
+  /* Basic tables: (element [0] of each array is unused) */
+  INT32 maxcode[18];		/* largest code of length k (-1 if none) */
+  /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */
+  INT32 valoffset[17];		/* huffval[] offset for codes of length k */
+  /* valoffset[k] = huffval[] index of 1st symbol of code length k, less
+   * the smallest code of length k; so given a code of length k, the
+   * corresponding symbol is huffval[code + valoffset[k]]
+   */
+
+  /* Link to public Huffman table (needed only in jpeg_huff_decode) */
+  JHUFF_TBL *pub;
+
+  /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of
+   * the input data stream.  If the next Huffman code is no more
+   * than HUFF_LOOKAHEAD bits long, we can obtain its length and
+   * the corresponding symbol directly from these tables.
+   */
+  int look_nbits[1<<HUFF_LOOKAHEAD]; /* # bits, or 0 if too long */
+  UINT8 look_sym[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */
+} d_derived_tbl;
+
+/* Expand a Huffman table definition into the derived format */
+EXTERN(void) jpeg_make_d_derived_tbl
+	JPP((j_decompress_ptr cinfo, boolean isDC, int tblno,
+	     d_derived_tbl ** pdtbl));
+
+
+/*
+ * Fetching the next N bits from the input stream is a time-critical operation
+ * for the Huffman decoders.  We implement it with a combination of inline
+ * macros and out-of-line subroutines.  Note that N (the number of bits
+ * demanded at one time) never exceeds 15 for JPEG use.
+ *
+ * We read source bytes into get_buffer and dole out bits as needed.
+ * If get_buffer already contains enough bits, they are fetched in-line
+ * by the macros CHECK_BIT_BUFFER and GET_BITS.  When there aren't enough
+ * bits, jpeg_fill_bit_buffer is called; it will attempt to fill get_buffer
+ * as full as possible (not just to the number of bits needed; this
+ * prefetching reduces the overhead cost of calling jpeg_fill_bit_buffer).
+ * Note that jpeg_fill_bit_buffer may return FALSE to indicate suspension.
+ * On TRUE return, jpeg_fill_bit_buffer guarantees that get_buffer contains
+ * at least the requested number of bits --- dummy zeroes are inserted if
+ * necessary.
+ */
+
+typedef INT32 bit_buf_type;	/* type of bit-extraction buffer */
+#define BIT_BUF_SIZE  32	/* size of buffer in bits */
+
+/* If long is > 32 bits on your machine, and shifting/masking longs is
+ * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE
+ * appropriately should be a win.  Unfortunately we can't define the size
+ * with something like  #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8)
+ * because not all machines measure sizeof in 8-bit bytes.
+ */
+
+typedef struct {		/* Bitreading state saved across MCUs */
+  bit_buf_type get_buffer;	/* current bit-extraction buffer */
+  int bits_left;		/* # of unused bits in it */
+} bitread_perm_state;
+
+typedef struct {		/* Bitreading working state within an MCU */
+  /* Current data source location */
+  /* We need a copy, rather than munging the original, in case of suspension */
+  const JOCTET * next_input_byte; /* => next byte to read from source */
+  size_t bytes_in_buffer;	/* # of bytes remaining in source buffer */
+  /* Bit input buffer --- note these values are kept in register variables,
+   * not in this struct, inside the inner loops.
+   */
+  bit_buf_type get_buffer;	/* current bit-extraction buffer */
+  int bits_left;		/* # of unused bits in it */
+  /* Pointer needed by jpeg_fill_bit_buffer. */
+  j_decompress_ptr cinfo;	/* back link to decompress master record */
+} bitread_working_state;
+
+/* Macros to declare and load/save bitread local variables. */
+#define BITREAD_STATE_VARS  \
+	register bit_buf_type get_buffer;  \
+	register int bits_left;  \
+	bitread_working_state br_state
+
+#define BITREAD_LOAD_STATE(cinfop,permstate)  \
+	br_state.cinfo = cinfop; \
+	br_state.next_input_byte = cinfop->src->next_input_byte; \
+	br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
+	get_buffer = permstate.get_buffer; \
+	bits_left = permstate.bits_left;
+
+#define BITREAD_SAVE_STATE(cinfop,permstate)  \
+	cinfop->src->next_input_byte = br_state.next_input_byte; \
+	cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
+	permstate.get_buffer = get_buffer; \
+	permstate.bits_left = bits_left
+
+/*
+ * These macros provide the in-line portion of bit fetching.
+ * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer
+ * before using GET_BITS, PEEK_BITS, or DROP_BITS.
+ * The variables get_buffer and bits_left are assumed to be locals,
+ * but the state struct might not be (jpeg_huff_decode needs this).
+ *	CHECK_BIT_BUFFER(state,n,action);
+ *		Ensure there are N bits in get_buffer; if suspend, take action.
+ *      val = GET_BITS(n);
+ *		Fetch next N bits.
+ *      val = PEEK_BITS(n);
+ *		Fetch next N bits without removing them from the buffer.
+ *	DROP_BITS(n);
+ *		Discard next N bits.
+ * The value N should be a simple variable, not an expression, because it
+ * is evaluated multiple times.
+ */
+
+#define CHECK_BIT_BUFFER(state,nbits,action) \
+	{ if (bits_left < (nbits)) {  \
+	    if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits))  \
+	      { action; }  \
+	    get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }
+
+#define GET_BITS(nbits) \
+	(((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1))
+
+#define PEEK_BITS(nbits) \
+	(((int) (get_buffer >> (bits_left -  (nbits)))) & ((1<<(nbits))-1))
+
+#define DROP_BITS(nbits) \
+	(bits_left -= (nbits))
+
+/* Load up the bit buffer to a depth of at least nbits */
+EXTERN(boolean) jpeg_fill_bit_buffer
+	JPP((bitread_working_state * state, register bit_buf_type get_buffer,
+	     register int bits_left, int nbits));
+
+
+/*
+ * Code for extracting next Huffman-coded symbol from input bit stream.
+ * Again, this is time-critical and we make the main paths be macros.
+ *
+ * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits
+ * without looping.  Usually, more than 95% of the Huffman codes will be 8
+ * or fewer bits long.  The few overlength codes are handled with a loop,
+ * which need not be inline code.
+ *
+ * Notes about the HUFF_DECODE macro:
+ * 1. Near the end of the data segment, we may fail to get enough bits
+ *    for a lookahead.  In that case, we do it the hard way.
+ * 2. If the lookahead table contains no entry, the next code must be
+ *    more than HUFF_LOOKAHEAD bits long.
+ * 3. jpeg_huff_decode returns -1 if forced to suspend.
+ */
+
+#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \
+{ register int nb, look; \
+  if (bits_left < HUFF_LOOKAHEAD) { \
+    if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \
+    get_buffer = state.get_buffer; bits_left = state.bits_left; \
+    if (bits_left < HUFF_LOOKAHEAD) { \
+      nb = 1; goto slowlabel; \
+    } \
+  } \
+  look = PEEK_BITS(HUFF_LOOKAHEAD); \
+  if ((nb = htbl->look_nbits[look]) != 0) { \
+    DROP_BITS(nb); \
+    result = htbl->look_sym[look]; \
+  } else { \
+    nb = HUFF_LOOKAHEAD+1; \
+slowlabel: \
+    if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \
+	{ failaction; } \
+    get_buffer = state.get_buffer; bits_left = state.bits_left; \
+  } \
+}
+
+/* Out-of-line case for Huffman code fetching */
+EXTERN(int) jpeg_huff_decode
+	JPP((bitread_working_state * state, register bit_buf_type get_buffer,
+	     register int bits_left, d_derived_tbl * htbl, int min_bits));
diff --git a/src/libjpeg/jdinput.c b/src/libjpeg/jdinput.c
new file mode 100644
index 0000000..2d5c747
--- /dev/null
+++ b/src/libjpeg/jdinput.c
@@ -0,0 +1,381 @@
+/*
+ * jdinput.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains input control logic for the JPEG decompressor.
+ * These routines are concerned with controlling the decompressor's input
+ * processing (marker reading and coefficient decoding).  The actual input
+ * reading is done in jdmarker.c, jdhuff.c, and jdphuff.c.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private state */
+
+typedef struct {
+  struct jpeg_input_controller pub; /* public fields */
+
+  boolean inheaders;		/* TRUE until first SOS is reached */
+} my_input_controller;
+
+typedef my_input_controller * my_inputctl_ptr;
+
+
+/* Forward declarations */
+METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo));
+
+
+/*
+ * Routines to calculate various quantities related to the size of the image.
+ */
+
+LOCAL(void)
+initial_setup (j_decompress_ptr cinfo)
+/* Called once, when first SOS marker is reached */
+{
+  int ci;
+  jpeg_component_info *compptr;
+
+  /* Make sure image isn't bigger than I can handle */
+  if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
+      (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
+    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
+
+  /* For now, precision must match compiled-in value... */
+  if (cinfo->data_precision != BITS_IN_JSAMPLE)
+    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
+
+  /* Check that number of components won't exceed internal array sizes */
+  if (cinfo->num_components > MAX_COMPONENTS)
+    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
+	     MAX_COMPONENTS);
+
+  /* Compute maximum sampling factors; check factor validity */
+  cinfo->max_h_samp_factor = 1;
+  cinfo->max_v_samp_factor = 1;
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
+	compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
+      ERREXIT(cinfo, JERR_BAD_SAMPLING);
+    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
+				   compptr->h_samp_factor);
+    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
+				   compptr->v_samp_factor);
+  }
+
+  /* We initialize DCT_scaled_size and min_DCT_scaled_size to DCTSIZE.
+   * In the full decompressor, this will be overridden by jdmaster.c;
+   * but in the transcoder, jdmaster.c is not used, so we must do it here.
+   */
+  cinfo->min_DCT_scaled_size = DCTSIZE;
+
+  /* Compute dimensions of components */
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    compptr->DCT_scaled_size = DCTSIZE;
+    /* Size in DCT blocks */
+    compptr->width_in_blocks = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
+		    (long) (cinfo->max_h_samp_factor * DCTSIZE));
+    compptr->height_in_blocks = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
+		    (long) (cinfo->max_v_samp_factor * DCTSIZE));
+    /* downsampled_width and downsampled_height will also be overridden by
+     * jdmaster.c if we are doing full decompression.  The transcoder library
+     * doesn't use these values, but the calling application might.
+     */
+    /* Size in samples */
+    compptr->downsampled_width = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
+		    (long) cinfo->max_h_samp_factor);
+    compptr->downsampled_height = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
+		    (long) cinfo->max_v_samp_factor);
+    /* Mark component needed, until color conversion says otherwise */
+    compptr->component_needed = TRUE;
+    /* Mark no quantization table yet saved for component */
+    compptr->quant_table = NULL;
+  }
+
+  /* Compute number of fully interleaved MCU rows. */
+  cinfo->total_iMCU_rows = (JDIMENSION)
+    jdiv_round_up((long) cinfo->image_height,
+		  (long) (cinfo->max_v_samp_factor*DCTSIZE));
+
+  /* Decide whether file contains multiple scans */
+  if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)
+    cinfo->inputctl->has_multiple_scans = TRUE;
+  else
+    cinfo->inputctl->has_multiple_scans = FALSE;
+}
+
+
+LOCAL(void)
+per_scan_setup (j_decompress_ptr cinfo)
+/* Do computations that are needed before processing a JPEG scan */
+/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */
+{
+  int ci, mcublks, tmp;
+  jpeg_component_info *compptr;
+  
+  if (cinfo->comps_in_scan == 1) {
+    
+    /* Noninterleaved (single-component) scan */
+    compptr = cinfo->cur_comp_info[0];
+    
+    /* Overall image size in MCUs */
+    cinfo->MCUs_per_row = compptr->width_in_blocks;
+    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
+    
+    /* For noninterleaved scan, always one block per MCU */
+    compptr->MCU_width = 1;
+    compptr->MCU_height = 1;
+    compptr->MCU_blocks = 1;
+    compptr->MCU_sample_width = compptr->DCT_scaled_size;
+    compptr->last_col_width = 1;
+    /* For noninterleaved scans, it is convenient to define last_row_height
+     * as the number of block rows present in the last iMCU row.
+     */
+    tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
+    if (tmp == 0) tmp = compptr->v_samp_factor;
+    compptr->last_row_height = tmp;
+    
+    /* Prepare array describing MCU composition */
+    cinfo->blocks_in_MCU = 1;
+    cinfo->MCU_membership[0] = 0;
+    
+  } else {
+    
+    /* Interleaved (multi-component) scan */
+    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
+      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
+	       MAX_COMPS_IN_SCAN);
+    
+    /* Overall image size in MCUs */
+    cinfo->MCUs_per_row = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_width,
+		    (long) (cinfo->max_h_samp_factor*DCTSIZE));
+    cinfo->MCU_rows_in_scan = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_height,
+		    (long) (cinfo->max_v_samp_factor*DCTSIZE));
+    
+    cinfo->blocks_in_MCU = 0;
+    
+    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+      compptr = cinfo->cur_comp_info[ci];
+      /* Sampling factors give # of blocks of component in each MCU */
+      compptr->MCU_width = compptr->h_samp_factor;
+      compptr->MCU_height = compptr->v_samp_factor;
+      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
+      compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_scaled_size;
+      /* Figure number of non-dummy blocks in last MCU column & row */
+      tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
+      if (tmp == 0) tmp = compptr->MCU_width;
+      compptr->last_col_width = tmp;
+      tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);
+      if (tmp == 0) tmp = compptr->MCU_height;
+      compptr->last_row_height = tmp;
+      /* Prepare array describing MCU composition */
+      mcublks = compptr->MCU_blocks;
+      if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)
+	ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
+      while (mcublks-- > 0) {
+	cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
+      }
+    }
+    
+  }
+}
+
+
+/*
+ * Save away a copy of the Q-table referenced by each component present
+ * in the current scan, unless already saved during a prior scan.
+ *
+ * In a multiple-scan JPEG file, the encoder could assign different components
+ * the same Q-table slot number, but change table definitions between scans
+ * so that each component uses a different Q-table.  (The IJG encoder is not
+ * currently capable of doing this, but other encoders might.)  Since we want
+ * to be able to dequantize all the components at the end of the file, this
+ * means that we have to save away the table actually used for each component.
+ * We do this by copying the table at the start of the first scan containing
+ * the component.
+ * The JPEG spec prohibits the encoder from changing the contents of a Q-table
+ * slot between scans of a component using that slot.  If the encoder does so
+ * anyway, this decoder will simply use the Q-table values that were current
+ * at the start of the first scan for the component.
+ *
+ * The decompressor output side looks only at the saved quant tables,
+ * not at the current Q-table slots.
+ */
+
+LOCAL(void)
+latch_quant_tables (j_decompress_ptr cinfo)
+{
+  int ci, qtblno;
+  jpeg_component_info *compptr;
+  JQUANT_TBL * qtbl;
+
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    compptr = cinfo->cur_comp_info[ci];
+    /* No work if we already saved Q-table for this component */
+    if (compptr->quant_table != NULL)
+      continue;
+    /* Make sure specified quantization table is present */
+    qtblno = compptr->quant_tbl_no;
+    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
+	cinfo->quant_tbl_ptrs[qtblno] == NULL)
+      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
+    /* OK, save away the quantization table */
+    qtbl = (JQUANT_TBL *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(JQUANT_TBL));
+    MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL));
+    compptr->quant_table = qtbl;
+  }
+}
+
+
+/*
+ * Initialize the input modules to read a scan of compressed data.
+ * The first call to this is done by jdmaster.c after initializing
+ * the entire decompressor (during jpeg_start_decompress).
+ * Subsequent calls come from consume_markers, below.
+ */
+
+METHODDEF(void)
+start_input_pass (j_decompress_ptr cinfo)
+{
+  per_scan_setup(cinfo);
+  latch_quant_tables(cinfo);
+  (*cinfo->entropy->start_pass) (cinfo);
+  (*cinfo->coef->start_input_pass) (cinfo);
+  cinfo->inputctl->consume_input = cinfo->coef->consume_data;
+}
+
+
+/*
+ * Finish up after inputting a compressed-data scan.
+ * This is called by the coefficient controller after it's read all
+ * the expected data of the scan.
+ */
+
+METHODDEF(void)
+finish_input_pass (j_decompress_ptr cinfo)
+{
+  cinfo->inputctl->consume_input = consume_markers;
+}
+
+
+/*
+ * Read JPEG markers before, between, or after compressed-data scans.
+ * Change state as necessary when a new scan is reached.
+ * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
+ *
+ * The consume_input method pointer points either here or to the
+ * coefficient controller's consume_data routine, depending on whether
+ * we are reading a compressed data segment or inter-segment markers.
+ */
+
+METHODDEF(int)
+consume_markers (j_decompress_ptr cinfo)
+{
+  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
+  int val;
+
+  if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */
+    return JPEG_REACHED_EOI;
+
+  val = (*cinfo->marker->read_markers) (cinfo);
+
+  switch (val) {
+  case JPEG_REACHED_SOS:	/* Found SOS */
+    if (inputctl->inheaders) {	/* 1st SOS */
+      initial_setup(cinfo);
+      inputctl->inheaders = FALSE;
+      /* Note: start_input_pass must be called by jdmaster.c
+       * before any more input can be consumed.  jdapimin.c is
+       * responsible for enforcing this sequencing.
+       */
+    } else {			/* 2nd or later SOS marker */
+      if (! inputctl->pub.has_multiple_scans)
+	ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */
+      start_input_pass(cinfo);
+    }
+    break;
+  case JPEG_REACHED_EOI:	/* Found EOI */
+    inputctl->pub.eoi_reached = TRUE;
+    if (inputctl->inheaders) {	/* Tables-only datastream, apparently */
+      if (cinfo->marker->saw_SOF)
+	ERREXIT(cinfo, JERR_SOF_NO_SOS);
+    } else {
+      /* Prevent infinite loop in coef ctlr's decompress_data routine
+       * if user set output_scan_number larger than number of scans.
+       */
+      if (cinfo->output_scan_number > cinfo->input_scan_number)
+	cinfo->output_scan_number = cinfo->input_scan_number;
+    }
+    break;
+  case JPEG_SUSPENDED:
+    break;
+  }
+
+  return val;
+}
+
+
+/*
+ * Reset state to begin a fresh datastream.
+ */
+
+METHODDEF(void)
+reset_input_controller (j_decompress_ptr cinfo)
+{
+  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
+
+  inputctl->pub.consume_input = consume_markers;
+  inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
+  inputctl->pub.eoi_reached = FALSE;
+  inputctl->inheaders = TRUE;
+  /* Reset other modules */
+  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
+  (*cinfo->marker->reset_marker_reader) (cinfo);
+  /* Reset progression state -- would be cleaner if entropy decoder did this */
+  cinfo->coef_bits = NULL;
+}
+
+
+/*
+ * Initialize the input controller module.
+ * This is called only once, when the decompression object is created.
+ */
+
+GLOBAL(void)
+jinit_input_controller (j_decompress_ptr cinfo)
+{
+  my_inputctl_ptr inputctl;
+
+  /* Create subobject in permanent pool */
+  inputctl = (my_inputctl_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+				SIZEOF(my_input_controller));
+  cinfo->inputctl = (struct jpeg_input_controller *) inputctl;
+  /* Initialize method pointers */
+  inputctl->pub.consume_input = consume_markers;
+  inputctl->pub.reset_input_controller = reset_input_controller;
+  inputctl->pub.start_input_pass = start_input_pass;
+  inputctl->pub.finish_input_pass = finish_input_pass;
+  /* Initialize state: can't use reset_input_controller since we don't
+   * want to try to reset other modules yet.
+   */
+  inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
+  inputctl->pub.eoi_reached = FALSE;
+  inputctl->inheaders = TRUE;
+}
diff --git a/src/libjpeg/jdmainct.c b/src/libjpeg/jdmainct.c
new file mode 100644
index 0000000..6b0f06f
--- /dev/null
+++ b/src/libjpeg/jdmainct.c
@@ -0,0 +1,512 @@
+/*
+ * jdmainct.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the main buffer controller for decompression.
+ * The main buffer lies between the JPEG decompressor proper and the
+ * post-processor; it holds downsampled data in the JPEG colorspace.
+ *
+ * Note that this code is bypassed in raw-data mode, since the application
+ * supplies the equivalent of the main buffer in that case.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * In the current system design, the main buffer need never be a full-image
+ * buffer; any full-height buffers will be found inside the coefficient or
+ * postprocessing controllers.  Nonetheless, the main controller is not
+ * trivial.  Its responsibility is to provide context rows for upsampling/
+ * rescaling, and doing this in an efficient fashion is a bit tricky.
+ *
+ * Postprocessor input data is counted in "row groups".  A row group
+ * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
+ * sample rows of each component.  (We require DCT_scaled_size values to be
+ * chosen such that these numbers are integers.  In practice DCT_scaled_size
+ * values will likely be powers of two, so we actually have the stronger
+ * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.)
+ * Upsampling will typically produce max_v_samp_factor pixel rows from each
+ * row group (times any additional scale factor that the upsampler is
+ * applying).
+ *
+ * The coefficient controller will deliver data to us one iMCU row at a time;
+ * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or
+ * exactly min_DCT_scaled_size row groups.  (This amount of data corresponds
+ * to one row of MCUs when the image is fully interleaved.)  Note that the
+ * number of sample rows varies across components, but the number of row
+ * groups does not.  Some garbage sample rows may be included in the last iMCU
+ * row at the bottom of the image.
+ *
+ * Depending on the vertical scaling algorithm used, the upsampler may need
+ * access to the sample row(s) above and below its current input row group.
+ * The upsampler is required to set need_context_rows TRUE at global selection
+ * time if so.  When need_context_rows is FALSE, this controller can simply
+ * obtain one iMCU row at a time from the coefficient controller and dole it
+ * out as row groups to the postprocessor.
+ *
+ * When need_context_rows is TRUE, this controller guarantees that the buffer
+ * passed to postprocessing contains at least one row group's worth of samples
+ * above and below the row group(s) being processed.  Note that the context
+ * rows "above" the first passed row group appear at negative row offsets in
+ * the passed buffer.  At the top and bottom of the image, the required
+ * context rows are manufactured by duplicating the first or last real sample
+ * row; this avoids having special cases in the upsampling inner loops.
+ *
+ * The amount of context is fixed at one row group just because that's a
+ * convenient number for this controller to work with.  The existing
+ * upsamplers really only need one sample row of context.  An upsampler
+ * supporting arbitrary output rescaling might wish for more than one row
+ * group of context when shrinking the image; tough, we don't handle that.
+ * (This is justified by the assumption that downsizing will be handled mostly
+ * by adjusting the DCT_scaled_size values, so that the actual scale factor at
+ * the upsample step needn't be much less than one.)
+ *
+ * To provide the desired context, we have to retain the last two row groups
+ * of one iMCU row while reading in the next iMCU row.  (The last row group
+ * can't be processed until we have another row group for its below-context,
+ * and so we have to save the next-to-last group too for its above-context.)
+ * We could do this most simply by copying data around in our buffer, but
+ * that'd be very slow.  We can avoid copying any data by creating a rather
+ * strange pointer structure.  Here's how it works.  We allocate a workspace
+ * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number
+ * of row groups per iMCU row).  We create two sets of redundant pointers to
+ * the workspace.  Labeling the physical row groups 0 to M+1, the synthesized
+ * pointer lists look like this:
+ *                   M+1                          M-1
+ * master pointer --> 0         master pointer --> 0
+ *                    1                            1
+ *                   ...                          ...
+ *                   M-3                          M-3
+ *                   M-2                           M
+ *                   M-1                          M+1
+ *                    M                           M-2
+ *                   M+1                          M-1
+ *                    0                            0
+ * We read alternate iMCU rows using each master pointer; thus the last two
+ * row groups of the previous iMCU row remain un-overwritten in the workspace.
+ * The pointer lists are set up so that the required context rows appear to
+ * be adjacent to the proper places when we pass the pointer lists to the
+ * upsampler.
+ *
+ * The above pictures describe the normal state of the pointer lists.
+ * At top and bottom of the image, we diddle the pointer lists to duplicate
+ * the first or last sample row as necessary (this is cheaper than copying
+ * sample rows around).
+ *
+ * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1.  In that
+ * situation each iMCU row provides only one row group so the buffering logic
+ * must be different (eg, we must read two iMCU rows before we can emit the
+ * first row group).  For now, we simply do not support providing context
+ * rows when min_DCT_scaled_size is 1.  That combination seems unlikely to
+ * be worth providing --- if someone wants a 1/8th-size preview, they probably
+ * want it quick and dirty, so a context-free upsampler is sufficient.
+ */
+
+
+/* Private buffer controller object */
+
+typedef struct {
+  struct jpeg_d_main_controller pub; /* public fields */
+
+  /* Pointer to allocated workspace (M or M+2 row groups). */
+  JSAMPARRAY buffer[MAX_COMPONENTS];
+
+  boolean buffer_full;		/* Have we gotten an iMCU row from decoder? */
+  JDIMENSION rowgroup_ctr;	/* counts row groups output to postprocessor */
+
+  /* Remaining fields are only used in the context case. */
+
+  /* These are the master pointers to the funny-order pointer lists. */
+  JSAMPIMAGE xbuffer[2];	/* pointers to weird pointer lists */
+
+  int whichptr;			/* indicates which pointer set is now in use */
+  int context_state;		/* process_data state machine status */
+  JDIMENSION rowgroups_avail;	/* row groups available to postprocessor */
+  JDIMENSION iMCU_row_ctr;	/* counts iMCU rows to detect image top/bot */
+} my_main_controller;
+
+typedef my_main_controller * my_main_ptr;
+
+/* context_state values: */
+#define CTX_PREPARE_FOR_IMCU	0	/* need to prepare for MCU row */
+#define CTX_PROCESS_IMCU	1	/* feeding iMCU to postprocessor */
+#define CTX_POSTPONED_ROW	2	/* feeding postponed row group */
+
+
+/* Forward declarations */
+METHODDEF(void) process_data_simple_main
+	JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
+	     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
+METHODDEF(void) process_data_context_main
+	JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
+	     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
+#ifdef QUANT_2PASS_SUPPORTED
+METHODDEF(void) process_data_crank_post
+	JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
+	     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
+#endif
+
+
+LOCAL(void)
+alloc_funny_pointers (j_decompress_ptr cinfo)
+/* Allocate space for the funny pointer lists.
+ * This is done only once, not once per pass.
+ */
+{
+  my_main_ptr main = (my_main_ptr) cinfo->main;
+  int ci, rgroup;
+  int M = cinfo->min_DCT_scaled_size;
+  jpeg_component_info *compptr;
+  JSAMPARRAY xbuf;
+
+  /* Get top-level space for component array pointers.
+   * We alloc both arrays with one call to save a few cycles.
+   */
+  main->xbuffer[0] = (JSAMPIMAGE)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
+  main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components;
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
+      cinfo->min_DCT_scaled_size; /* height of a row group of component */
+    /* Get space for pointer lists --- M+4 row groups in each list.
+     * We alloc both pointer lists with one call to save a few cycles.
+     */
+    xbuf = (JSAMPARRAY)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
+    xbuf += rgroup;		/* want one row group at negative offsets */
+    main->xbuffer[0][ci] = xbuf;
+    xbuf += rgroup * (M + 4);
+    main->xbuffer[1][ci] = xbuf;
+  }
+}
+
+
+LOCAL(void)
+make_funny_pointers (j_decompress_ptr cinfo)
+/* Create the funny pointer lists discussed in the comments above.
+ * The actual workspace is already allocated (in main->buffer),
+ * and the space for the pointer lists is allocated too.
+ * This routine just fills in the curiously ordered lists.
+ * This will be repeated at the beginning of each pass.
+ */
+{
+  my_main_ptr main = (my_main_ptr) cinfo->main;
+  int ci, i, rgroup;
+  int M = cinfo->min_DCT_scaled_size;
+  jpeg_component_info *compptr;
+  JSAMPARRAY buf, xbuf0, xbuf1;
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
+      cinfo->min_DCT_scaled_size; /* height of a row group of component */
+    xbuf0 = main->xbuffer[0][ci];
+    xbuf1 = main->xbuffer[1][ci];
+    /* First copy the workspace pointers as-is */
+    buf = main->buffer[ci];
+    for (i = 0; i < rgroup * (M + 2); i++) {
+      xbuf0[i] = xbuf1[i] = buf[i];
+    }
+    /* In the second list, put the last four row groups in swapped order */
+    for (i = 0; i < rgroup * 2; i++) {
+      xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i];
+      xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i];
+    }
+    /* The wraparound pointers at top and bottom will be filled later
+     * (see set_wraparound_pointers, below).  Initially we want the "above"
+     * pointers to duplicate the first actual data line.  This only needs
+     * to happen in xbuffer[0].
+     */
+    for (i = 0; i < rgroup; i++) {
+      xbuf0[i - rgroup] = xbuf0[0];
+    }
+  }
+}
+
+
+LOCAL(void)
+set_wraparound_pointers (j_decompress_ptr cinfo)
+/* Set up the "wraparound" pointers at top and bottom of the pointer lists.
+ * This changes the pointer list state from top-of-image to the normal state.
+ */
+{
+  my_main_ptr main = (my_main_ptr) cinfo->main;
+  int ci, i, rgroup;
+  int M = cinfo->min_DCT_scaled_size;
+  jpeg_component_info *compptr;
+  JSAMPARRAY xbuf0, xbuf1;
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
+      cinfo->min_DCT_scaled_size; /* height of a row group of component */
+    xbuf0 = main->xbuffer[0][ci];
+    xbuf1 = main->xbuffer[1][ci];
+    for (i = 0; i < rgroup; i++) {
+      xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
+      xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];
+      xbuf0[rgroup*(M+2) + i] = xbuf0[i];
+      xbuf1[rgroup*(M+2) + i] = xbuf1[i];
+    }
+  }
+}
+
+
+LOCAL(void)
+set_bottom_pointers (j_decompress_ptr cinfo)
+/* Change the pointer lists to duplicate the last sample row at the bottom
+ * of the image.  whichptr indicates which xbuffer holds the final iMCU row.
+ * Also sets rowgroups_avail to indicate number of nondummy row groups in row.
+ */
+{
+  my_main_ptr main = (my_main_ptr) cinfo->main;
+  int ci, i, rgroup, iMCUheight, rows_left;
+  jpeg_component_info *compptr;
+  JSAMPARRAY xbuf;
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* Count sample rows in one iMCU row and in one row group */
+    iMCUheight = compptr->v_samp_factor * compptr->DCT_scaled_size;
+    rgroup = iMCUheight / cinfo->min_DCT_scaled_size;
+    /* Count nondummy sample rows remaining for this component */
+    rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight);
+    if (rows_left == 0) rows_left = iMCUheight;
+    /* Count nondummy row groups.  Should get same answer for each component,
+     * so we need only do it once.
+     */
+    if (ci == 0) {
+      main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);
+    }
+    /* Duplicate the last real sample row rgroup*2 times; this pads out the
+     * last partial rowgroup and ensures at least one full rowgroup of context.
+     */
+    xbuf = main->xbuffer[main->whichptr][ci];
+    for (i = 0; i < rgroup * 2; i++) {
+      xbuf[rows_left + i] = xbuf[rows_left-1];
+    }
+  }
+}
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+  my_main_ptr main = (my_main_ptr) cinfo->main;
+
+  switch (pass_mode) {
+  case JBUF_PASS_THRU:
+    if (cinfo->upsample->need_context_rows) {
+      main->pub.process_data = process_data_context_main;
+      make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
+      main->whichptr = 0;	/* Read first iMCU row into xbuffer[0] */
+      main->context_state = CTX_PREPARE_FOR_IMCU;
+      main->iMCU_row_ctr = 0;
+    } else {
+      /* Simple case with no context needed */
+      main->pub.process_data = process_data_simple_main;
+    }
+    main->buffer_full = FALSE;	/* Mark buffer empty */
+    main->rowgroup_ctr = 0;
+    break;
+#ifdef QUANT_2PASS_SUPPORTED
+  case JBUF_CRANK_DEST:
+    /* For last pass of 2-pass quantization, just crank the postprocessor */
+    main->pub.process_data = process_data_crank_post;
+    break;
+#endif
+  default:
+    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+    break;
+  }
+}
+
+
+/*
+ * Process some data.
+ * This handles the simple case where no context is required.
+ */
+
+METHODDEF(void)
+process_data_simple_main (j_decompress_ptr cinfo,
+			  JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+			  JDIMENSION out_rows_avail)
+{
+  my_main_ptr main = (my_main_ptr) cinfo->main;
+  JDIMENSION rowgroups_avail;
+
+  /* Read input data if we haven't filled the main buffer yet */
+  if (! main->buffer_full) {
+    if (! (*cinfo->coef->decompress_data) (cinfo, main->buffer))
+      return;			/* suspension forced, can do nothing more */
+    main->buffer_full = TRUE;	/* OK, we have an iMCU row to work with */
+  }
+
+  /* There are always min_DCT_scaled_size row groups in an iMCU row. */
+  rowgroups_avail = (JDIMENSION) cinfo->min_DCT_scaled_size;
+  /* Note: at the bottom of the image, we may pass extra garbage row groups
+   * to the postprocessor.  The postprocessor has to check for bottom
+   * of image anyway (at row resolution), so no point in us doing it too.
+   */
+
+  /* Feed the postprocessor */
+  (*cinfo->post->post_process_data) (cinfo, main->buffer,
+				     &main->rowgroup_ctr, rowgroups_avail,
+				     output_buf, out_row_ctr, out_rows_avail);
+
+  /* Has postprocessor consumed all the data yet? If so, mark buffer empty */
+  if (main->rowgroup_ctr >= rowgroups_avail) {
+    main->buffer_full = FALSE;
+    main->rowgroup_ctr = 0;
+  }
+}
+
+
+/*
+ * Process some data.
+ * This handles the case where context rows must be provided.
+ */
+
+METHODDEF(void)
+process_data_context_main (j_decompress_ptr cinfo,
+			   JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+			   JDIMENSION out_rows_avail)
+{
+  my_main_ptr main = (my_main_ptr) cinfo->main;
+
+  /* Read input data if we haven't filled the main buffer yet */
+  if (! main->buffer_full) {
+    if (! (*cinfo->coef->decompress_data) (cinfo,
+					   main->xbuffer[main->whichptr]))
+      return;			/* suspension forced, can do nothing more */
+    main->buffer_full = TRUE;	/* OK, we have an iMCU row to work with */
+    main->iMCU_row_ctr++;	/* count rows received */
+  }
+
+  /* Postprocessor typically will not swallow all the input data it is handed
+   * in one call (due to filling the output buffer first).  Must be prepared
+   * to exit and restart.  This switch lets us keep track of how far we got.
+   * Note that each case falls through to the next on successful completion.
+   */
+  switch (main->context_state) {
+  case CTX_POSTPONED_ROW:
+    /* Call postprocessor using previously set pointers for postponed row */
+    (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
+			&main->rowgroup_ctr, main->rowgroups_avail,
+			output_buf, out_row_ctr, out_rows_avail);
+    if (main->rowgroup_ctr < main->rowgroups_avail)
+      return;			/* Need to suspend */
+    main->context_state = CTX_PREPARE_FOR_IMCU;
+    if (*out_row_ctr >= out_rows_avail)
+      return;			/* Postprocessor exactly filled output buf */
+    /*FALLTHROUGH*/
+  case CTX_PREPARE_FOR_IMCU:
+    /* Prepare to process first M-1 row groups of this iMCU row */
+    main->rowgroup_ctr = 0;
+    main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size - 1);
+    /* Check for bottom of image: if so, tweak pointers to "duplicate"
+     * the last sample row, and adjust rowgroups_avail to ignore padding rows.
+     */
+    if (main->iMCU_row_ctr == cinfo->total_iMCU_rows)
+      set_bottom_pointers(cinfo);
+    main->context_state = CTX_PROCESS_IMCU;
+    /*FALLTHROUGH*/
+  case CTX_PROCESS_IMCU:
+    /* Call postprocessor using previously set pointers */
+    (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
+			&main->rowgroup_ctr, main->rowgroups_avail,
+			output_buf, out_row_ctr, out_rows_avail);
+    if (main->rowgroup_ctr < main->rowgroups_avail)
+      return;			/* Need to suspend */
+    /* After the first iMCU, change wraparound pointers to normal state */
+    if (main->iMCU_row_ctr == 1)
+      set_wraparound_pointers(cinfo);
+    /* Prepare to load new iMCU row using other xbuffer list */
+    main->whichptr ^= 1;	/* 0=>1 or 1=>0 */
+    main->buffer_full = FALSE;
+    /* Still need to process last row group of this iMCU row, */
+    /* which is saved at index M+1 of the other xbuffer */
+    main->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_scaled_size + 1);
+    main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size + 2);
+    main->context_state = CTX_POSTPONED_ROW;
+  }
+}
+
+
+/*
+ * Process some data.
+ * Final pass of two-pass quantization: just call the postprocessor.
+ * Source data will be the postprocessor controller's internal buffer.
+ */
+
+#ifdef QUANT_2PASS_SUPPORTED
+
+METHODDEF(void)
+process_data_crank_post (j_decompress_ptr cinfo,
+			 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+			 JDIMENSION out_rows_avail)
+{
+  (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL,
+				     (JDIMENSION *) NULL, (JDIMENSION) 0,
+				     output_buf, out_row_ctr, out_rows_avail);
+}
+
+#endif /* QUANT_2PASS_SUPPORTED */
+
+
+/*
+ * Initialize main buffer controller.
+ */
+
+GLOBAL(void)
+jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
+{
+  my_main_ptr main;
+  int ci, rgroup, ngroups;
+  jpeg_component_info *compptr;
+
+  main = (my_main_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_main_controller));
+  cinfo->main = (struct jpeg_d_main_controller *) main;
+  main->pub.start_pass = start_pass_main;
+
+  if (need_full_buffer)		/* shouldn't happen */
+    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+
+  /* Allocate the workspace.
+   * ngroups is the number of row groups we need.
+   */
+  if (cinfo->upsample->need_context_rows) {
+    if (cinfo->min_DCT_scaled_size < 2) /* unsupported, see comments above */
+      ERREXIT(cinfo, JERR_NOTIMPL);
+    alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
+    ngroups = cinfo->min_DCT_scaled_size + 2;
+  } else {
+    ngroups = cinfo->min_DCT_scaled_size;
+  }
+
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
+      cinfo->min_DCT_scaled_size; /* height of a row group of component */
+    main->buffer[ci] = (*cinfo->mem->alloc_sarray)
+			((j_common_ptr) cinfo, JPOOL_IMAGE,
+			 compptr->width_in_blocks * compptr->DCT_scaled_size,
+			 (JDIMENSION) (rgroup * ngroups));
+  }
+}
diff --git a/src/libjpeg/jdmarker.c b/src/libjpeg/jdmarker.c
new file mode 100644
index 0000000..9811761
--- /dev/null
+++ b/src/libjpeg/jdmarker.c
@@ -0,0 +1,1360 @@
+/*
+ * jdmarker.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to decode JPEG datastream markers.
+ * Most of the complexity arises from our desire to support input
+ * suspension: if not all of the data for a marker is available,
+ * we must exit back to the application.  On resumption, we reprocess
+ * the marker.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+typedef enum {			/* JPEG marker codes */
+  M_SOF0  = 0xc0,
+  M_SOF1  = 0xc1,
+  M_SOF2  = 0xc2,
+  M_SOF3  = 0xc3,
+  
+  M_SOF5  = 0xc5,
+  M_SOF6  = 0xc6,
+  M_SOF7  = 0xc7,
+  
+  M_JPG   = 0xc8,
+  M_SOF9  = 0xc9,
+  M_SOF10 = 0xca,
+  M_SOF11 = 0xcb,
+  
+  M_SOF13 = 0xcd,
+  M_SOF14 = 0xce,
+  M_SOF15 = 0xcf,
+  
+  M_DHT   = 0xc4,
+  
+  M_DAC   = 0xcc,
+  
+  M_RST0  = 0xd0,
+  M_RST1  = 0xd1,
+  M_RST2  = 0xd2,
+  M_RST3  = 0xd3,
+  M_RST4  = 0xd4,
+  M_RST5  = 0xd5,
+  M_RST6  = 0xd6,
+  M_RST7  = 0xd7,
+  
+  M_SOI   = 0xd8,
+  M_EOI   = 0xd9,
+  M_SOS   = 0xda,
+  M_DQT   = 0xdb,
+  M_DNL   = 0xdc,
+  M_DRI   = 0xdd,
+  M_DHP   = 0xde,
+  M_EXP   = 0xdf,
+  
+  M_APP0  = 0xe0,
+  M_APP1  = 0xe1,
+  M_APP2  = 0xe2,
+  M_APP3  = 0xe3,
+  M_APP4  = 0xe4,
+  M_APP5  = 0xe5,
+  M_APP6  = 0xe6,
+  M_APP7  = 0xe7,
+  M_APP8  = 0xe8,
+  M_APP9  = 0xe9,
+  M_APP10 = 0xea,
+  M_APP11 = 0xeb,
+  M_APP12 = 0xec,
+  M_APP13 = 0xed,
+  M_APP14 = 0xee,
+  M_APP15 = 0xef,
+  
+  M_JPG0  = 0xf0,
+  M_JPG13 = 0xfd,
+  M_COM   = 0xfe,
+  
+  M_TEM   = 0x01,
+  
+  M_ERROR = 0x100
+} JPEG_MARKER;
+
+
+/* Private state */
+
+typedef struct {
+  struct jpeg_marker_reader pub; /* public fields */
+
+  /* Application-overridable marker processing methods */
+  jpeg_marker_parser_method process_COM;
+  jpeg_marker_parser_method process_APPn[16];
+
+  /* Limit on marker data length to save for each marker type */
+  unsigned int length_limit_COM;
+  unsigned int length_limit_APPn[16];
+
+  /* Status of COM/APPn marker saving */
+  jpeg_saved_marker_ptr cur_marker;	/* NULL if not processing a marker */
+  unsigned int bytes_read;		/* data bytes read so far in marker */
+  /* Note: cur_marker is not linked into marker_list until it's all read. */
+} my_marker_reader;
+
+typedef my_marker_reader * my_marker_ptr;
+
+
+/*
+ * Macros for fetching data from the data source module.
+ *
+ * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect
+ * the current restart point; we update them only when we have reached a
+ * suitable place to restart if a suspension occurs.
+ */
+
+/* Declare and initialize local copies of input pointer/count */
+#define INPUT_VARS(cinfo)  \
+	struct jpeg_source_mgr * datasrc = (cinfo)->src;  \
+	const JOCTET * next_input_byte = datasrc->next_input_byte;  \
+	size_t bytes_in_buffer = datasrc->bytes_in_buffer
+
+/* Unload the local copies --- do this only at a restart boundary */
+#define INPUT_SYNC(cinfo)  \
+	( datasrc->next_input_byte = next_input_byte,  \
+	  datasrc->bytes_in_buffer = bytes_in_buffer )
+
+/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */
+#define INPUT_RELOAD(cinfo)  \
+	( next_input_byte = datasrc->next_input_byte,  \
+	  bytes_in_buffer = datasrc->bytes_in_buffer )
+
+/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available.
+ * Note we do *not* do INPUT_SYNC before calling fill_input_buffer,
+ * but we must reload the local copies after a successful fill.
+ */
+#define MAKE_BYTE_AVAIL(cinfo,action)  \
+	if (bytes_in_buffer == 0) {  \
+	  if (! (*datasrc->fill_input_buffer) (cinfo))  \
+	    { action; }  \
+	  INPUT_RELOAD(cinfo);  \
+	}
+
+/* Read a byte into variable V.
+ * If must suspend, take the specified action (typically "return FALSE").
+ */
+#define INPUT_BYTE(cinfo,V,action)  \
+	MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
+		  bytes_in_buffer--; \
+		  V = GETJOCTET(*next_input_byte++); )
+
+/* As above, but read two bytes interpreted as an unsigned 16-bit integer.
+ * V should be declared unsigned int or perhaps INT32.
+ */
+#define INPUT_2BYTES(cinfo,V,action)  \
+	MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
+		  bytes_in_buffer--; \
+		  V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \
+		  MAKE_BYTE_AVAIL(cinfo,action); \
+		  bytes_in_buffer--; \
+		  V += GETJOCTET(*next_input_byte++); )
+
+
+/*
+ * Routines to process JPEG markers.
+ *
+ * Entry condition: JPEG marker itself has been read and its code saved
+ *   in cinfo->unread_marker; input restart point is just after the marker.
+ *
+ * Exit: if return TRUE, have read and processed any parameters, and have
+ *   updated the restart point to point after the parameters.
+ *   If return FALSE, was forced to suspend before reaching end of
+ *   marker parameters; restart point has not been moved.  Same routine
+ *   will be called again after application supplies more input data.
+ *
+ * This approach to suspension assumes that all of a marker's parameters
+ * can fit into a single input bufferload.  This should hold for "normal"
+ * markers.  Some COM/APPn markers might have large parameter segments
+ * that might not fit.  If we are simply dropping such a marker, we use
+ * skip_input_data to get past it, and thereby put the problem on the
+ * source manager's shoulders.  If we are saving the marker's contents
+ * into memory, we use a slightly different convention: when forced to
+ * suspend, the marker processor updates the restart point to the end of
+ * what it's consumed (ie, the end of the buffer) before returning FALSE.
+ * On resumption, cinfo->unread_marker still contains the marker code,
+ * but the data source will point to the next chunk of marker data.
+ * The marker processor must retain internal state to deal with this.
+ *
+ * Note that we don't bother to avoid duplicate trace messages if a
+ * suspension occurs within marker parameters.  Other side effects
+ * require more care.
+ */
+
+
+LOCAL(boolean)
+get_soi (j_decompress_ptr cinfo)
+/* Process an SOI marker */
+{
+  int i;
+  
+  TRACEMS(cinfo, 1, JTRC_SOI);
+
+  if (cinfo->marker->saw_SOI)
+    ERREXIT(cinfo, JERR_SOI_DUPLICATE);
+
+  /* Reset all parameters that are defined to be reset by SOI */
+
+  for (i = 0; i < NUM_ARITH_TBLS; i++) {
+    cinfo->arith_dc_L[i] = 0;
+    cinfo->arith_dc_U[i] = 1;
+    cinfo->arith_ac_K[i] = 5;
+  }
+  cinfo->restart_interval = 0;
+
+  /* Set initial assumptions for colorspace etc */
+
+  cinfo->jpeg_color_space = JCS_UNKNOWN;
+  cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */
+
+  cinfo->saw_JFIF_marker = FALSE;
+  cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */
+  cinfo->JFIF_minor_version = 1;
+  cinfo->density_unit = 0;
+  cinfo->X_density = 1;
+  cinfo->Y_density = 1;
+  cinfo->saw_Adobe_marker = FALSE;
+  cinfo->Adobe_transform = 0;
+
+  cinfo->marker->saw_SOI = TRUE;
+
+  return TRUE;
+}
+
+
+LOCAL(boolean)
+get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)
+/* Process a SOFn marker */
+{
+  INT32 length;
+  int c, ci;
+  jpeg_component_info * compptr;
+  INPUT_VARS(cinfo);
+
+  cinfo->progressive_mode = is_prog;
+  cinfo->arith_code = is_arith;
+
+  INPUT_2BYTES(cinfo, length, return FALSE);
+
+  INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);
+  INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE);
+  INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE);
+  INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);
+
+  length -= 8;
+
+  TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker,
+	   (int) cinfo->image_width, (int) cinfo->image_height,
+	   cinfo->num_components);
+
+  if (cinfo->marker->saw_SOF)
+    ERREXIT(cinfo, JERR_SOF_DUPLICATE);
+
+  /* We don't support files in which the image height is initially specified */
+  /* as 0 and is later redefined by DNL.  As long as we have to check that,  */
+  /* might as well have a general sanity check. */
+  if (cinfo->image_height <= 0 || cinfo->image_width <= 0
+      || cinfo->num_components <= 0)
+    ERREXIT(cinfo, JERR_EMPTY_IMAGE);
+
+  if (length != (cinfo->num_components * 3))
+    ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+  if (cinfo->comp_info == NULL)	/* do only once, even if suspend */
+    cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small)
+			((j_common_ptr) cinfo, JPOOL_IMAGE,
+			 cinfo->num_components * SIZEOF(jpeg_component_info));
+  
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    compptr->component_index = ci;
+    INPUT_BYTE(cinfo, compptr->component_id, return FALSE);
+    INPUT_BYTE(cinfo, c, return FALSE);
+    compptr->h_samp_factor = (c >> 4) & 15;
+    compptr->v_samp_factor = (c     ) & 15;
+    INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE);
+
+    TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT,
+	     compptr->component_id, compptr->h_samp_factor,
+	     compptr->v_samp_factor, compptr->quant_tbl_no);
+  }
+
+  cinfo->marker->saw_SOF = TRUE;
+
+  INPUT_SYNC(cinfo);
+  return TRUE;
+}
+
+
+LOCAL(boolean)
+get_sos (j_decompress_ptr cinfo)
+/* Process a SOS marker */
+{
+  INT32 length;
+  int i, ci, n, c, cc;
+  jpeg_component_info * compptr;
+  INPUT_VARS(cinfo);
+
+  if (! cinfo->marker->saw_SOF)
+    ERREXIT(cinfo, JERR_SOS_NO_SOF);
+
+  INPUT_2BYTES(cinfo, length, return FALSE);
+
+  INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */
+
+  TRACEMS1(cinfo, 1, JTRC_SOS, n);
+
+  if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN)
+    ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+  cinfo->comps_in_scan = n;
+
+  /* Collect the component-spec parameters */
+
+  for (i = 0; i < n; i++) {
+    INPUT_BYTE(cinfo, cc, return FALSE);
+    INPUT_BYTE(cinfo, c, return FALSE);
+    
+    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+	 ci++, compptr++) {
+      if (cc == compptr->component_id)
+	goto id_found;
+    }
+
+    ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
+
+  id_found:
+
+    cinfo->cur_comp_info[i] = compptr;
+    compptr->dc_tbl_no = (c >> 4) & 15;
+    compptr->ac_tbl_no = (c     ) & 15;
+    
+    TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
+	     compptr->dc_tbl_no, compptr->ac_tbl_no);
+  }
+
+  /* Collect the additional scan parameters Ss, Se, Ah/Al. */
+  INPUT_BYTE(cinfo, c, return FALSE);
+  cinfo->Ss = c;
+  INPUT_BYTE(cinfo, c, return FALSE);
+  cinfo->Se = c;
+  INPUT_BYTE(cinfo, c, return FALSE);
+  cinfo->Ah = (c >> 4) & 15;
+  cinfo->Al = (c     ) & 15;
+
+  TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se,
+	   cinfo->Ah, cinfo->Al);
+
+  /* Prepare to scan data & restart markers */
+  cinfo->marker->next_restart_num = 0;
+
+  /* Count another SOS marker */
+  cinfo->input_scan_number++;
+
+  INPUT_SYNC(cinfo);
+  return TRUE;
+}
+
+
+#ifdef D_ARITH_CODING_SUPPORTED
+
+LOCAL(boolean)
+get_dac (j_decompress_ptr cinfo)
+/* Process a DAC marker */
+{
+  INT32 length;
+  int index, val;
+  INPUT_VARS(cinfo);
+
+  INPUT_2BYTES(cinfo, length, return FALSE);
+  length -= 2;
+  
+  while (length > 0) {
+    INPUT_BYTE(cinfo, index, return FALSE);
+    INPUT_BYTE(cinfo, val, return FALSE);
+
+    length -= 2;
+
+    TRACEMS2(cinfo, 1, JTRC_DAC, index, val);
+
+    if (index < 0 || index >= (2*NUM_ARITH_TBLS))
+      ERREXIT1(cinfo, JERR_DAC_INDEX, index);
+
+    if (index >= NUM_ARITH_TBLS) { /* define AC table */
+      cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val;
+    } else {			/* define DC table */
+      cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F);
+      cinfo->arith_dc_U[index] = (UINT8) (val >> 4);
+      if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index])
+	ERREXIT1(cinfo, JERR_DAC_VALUE, val);
+    }
+  }
+
+  if (length != 0)
+    ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+  INPUT_SYNC(cinfo);
+  return TRUE;
+}
+
+#else /* ! D_ARITH_CODING_SUPPORTED */
+
+#define get_dac(cinfo)  skip_variable(cinfo)
+
+#endif /* D_ARITH_CODING_SUPPORTED */
+
+
+LOCAL(boolean)
+get_dht (j_decompress_ptr cinfo)
+/* Process a DHT marker */
+{
+  INT32 length;
+  UINT8 bits[17];
+  UINT8 huffval[256];
+  int i, index, count;
+  JHUFF_TBL **htblptr;
+  INPUT_VARS(cinfo);
+
+  INPUT_2BYTES(cinfo, length, return FALSE);
+  length -= 2;
+  
+  while (length > 16) {
+    INPUT_BYTE(cinfo, index, return FALSE);
+
+    TRACEMS1(cinfo, 1, JTRC_DHT, index);
+      
+    bits[0] = 0;
+    count = 0;
+    for (i = 1; i <= 16; i++) {
+      INPUT_BYTE(cinfo, bits[i], return FALSE);
+      count += bits[i];
+    }
+
+    length -= 1 + 16;
+
+    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
+	     bits[1], bits[2], bits[3], bits[4],
+	     bits[5], bits[6], bits[7], bits[8]);
+    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
+	     bits[9], bits[10], bits[11], bits[12],
+	     bits[13], bits[14], bits[15], bits[16]);
+
+    /* Here we just do minimal validation of the counts to avoid walking
+     * off the end of our table space.  jdhuff.c will check more carefully.
+     */
+    if (count > 256 || ((INT32) count) > length)
+      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+
+    for (i = 0; i < count; i++)
+      INPUT_BYTE(cinfo, huffval[i], return FALSE);
+
+    length -= count;
+
+    if (index & 0x10) {		/* AC table definition */
+      index -= 0x10;
+      htblptr = &cinfo->ac_huff_tbl_ptrs[index];
+    } else {			/* DC table definition */
+      htblptr = &cinfo->dc_huff_tbl_ptrs[index];
+    }
+
+    if (index < 0 || index >= NUM_HUFF_TBLS)
+      ERREXIT1(cinfo, JERR_DHT_INDEX, index);
+
+    if (*htblptr == NULL)
+      *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
+  
+    MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
+    MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval));
+  }
+
+  if (length != 0)
+    ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+  INPUT_SYNC(cinfo);
+  return TRUE;
+}
+
+
+LOCAL(boolean)
+get_dqt (j_decompress_ptr cinfo)
+/* Process a DQT marker */
+{
+  INT32 length;
+  int n, i, prec;
+  unsigned int tmp;
+  JQUANT_TBL *quant_ptr;
+  INPUT_VARS(cinfo);
+
+  INPUT_2BYTES(cinfo, length, return FALSE);
+  length -= 2;
+
+  while (length > 0) {
+    INPUT_BYTE(cinfo, n, return FALSE);
+    prec = n >> 4;
+    n &= 0x0F;
+
+    TRACEMS2(cinfo, 1, JTRC_DQT, n, prec);
+
+    if (n >= NUM_QUANT_TBLS)
+      ERREXIT1(cinfo, JERR_DQT_INDEX, n);
+      
+    if (cinfo->quant_tbl_ptrs[n] == NULL)
+      cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo);
+    quant_ptr = cinfo->quant_tbl_ptrs[n];
+
+    for (i = 0; i < DCTSIZE2; i++) {
+      if (prec)
+	INPUT_2BYTES(cinfo, tmp, return FALSE);
+      else
+	INPUT_BYTE(cinfo, tmp, return FALSE);
+      /* We convert the zigzag-order table to natural array order. */
+      quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp;
+    }
+
+    if (cinfo->err->trace_level >= 2) {
+      for (i = 0; i < DCTSIZE2; i += 8) {
+	TRACEMS8(cinfo, 2, JTRC_QUANTVALS,
+		 quant_ptr->quantval[i],   quant_ptr->quantval[i+1],
+		 quant_ptr->quantval[i+2], quant_ptr->quantval[i+3],
+		 quant_ptr->quantval[i+4], quant_ptr->quantval[i+5],
+		 quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]);
+      }
+    }
+
+    length -= DCTSIZE2+1;
+    if (prec) length -= DCTSIZE2;
+  }
+
+  if (length != 0)
+    ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+  INPUT_SYNC(cinfo);
+  return TRUE;
+}
+
+
+LOCAL(boolean)
+get_dri (j_decompress_ptr cinfo)
+/* Process a DRI marker */
+{
+  INT32 length;
+  unsigned int tmp;
+  INPUT_VARS(cinfo);
+
+  INPUT_2BYTES(cinfo, length, return FALSE);
+  
+  if (length != 4)
+    ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+  INPUT_2BYTES(cinfo, tmp, return FALSE);
+
+  TRACEMS1(cinfo, 1, JTRC_DRI, tmp);
+
+  cinfo->restart_interval = tmp;
+
+  INPUT_SYNC(cinfo);
+  return TRUE;
+}
+
+
+/*
+ * Routines for processing APPn and COM markers.
+ * These are either saved in memory or discarded, per application request.
+ * APP0 and APP14 are specially checked to see if they are
+ * JFIF and Adobe markers, respectively.
+ */
+
+#define APP0_DATA_LEN	14	/* Length of interesting data in APP0 */
+#define APP14_DATA_LEN	12	/* Length of interesting data in APP14 */
+#define APPN_DATA_LEN	14	/* Must be the largest of the above!! */
+
+
+LOCAL(void)
+examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
+	      unsigned int datalen, INT32 remaining)
+/* Examine first few bytes from an APP0.
+ * Take appropriate action if it is a JFIF marker.
+ * datalen is # of bytes at data[], remaining is length of rest of marker data.
+ */
+{
+  INT32 totallen = (INT32) datalen + remaining;
+
+  if (datalen >= APP0_DATA_LEN &&
+      GETJOCTET(data[0]) == 0x4A &&
+      GETJOCTET(data[1]) == 0x46 &&
+      GETJOCTET(data[2]) == 0x49 &&
+      GETJOCTET(data[3]) == 0x46 &&
+      GETJOCTET(data[4]) == 0) {
+    /* Found JFIF APP0 marker: save info */
+    cinfo->saw_JFIF_marker = TRUE;
+    cinfo->JFIF_major_version = GETJOCTET(data[5]);
+    cinfo->JFIF_minor_version = GETJOCTET(data[6]);
+    cinfo->density_unit = GETJOCTET(data[7]);
+    cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
+    cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
+    /* Check version.
+     * Major version must be 1, anything else signals an incompatible change.
+     * (We used to treat this as an error, but now it's a nonfatal warning,
+     * because some bozo at Hijaak couldn't read the spec.)
+     * Minor version should be 0..2, but process anyway if newer.
+     */
+    if (cinfo->JFIF_major_version != 1)
+      WARNMS2(cinfo, JWRN_JFIF_MAJOR,
+	      cinfo->JFIF_major_version, cinfo->JFIF_minor_version);
+    /* Generate trace messages */
+    TRACEMS5(cinfo, 1, JTRC_JFIF,
+	     cinfo->JFIF_major_version, cinfo->JFIF_minor_version,
+	     cinfo->X_density, cinfo->Y_density, cinfo->density_unit);
+    /* Validate thumbnail dimensions and issue appropriate messages */
+    if (GETJOCTET(data[12]) | GETJOCTET(data[13]))
+      TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,
+	       GETJOCTET(data[12]), GETJOCTET(data[13]));
+    totallen -= APP0_DATA_LEN;
+    if (totallen !=
+	((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3))
+      TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen);
+  } else if (datalen >= 6 &&
+      GETJOCTET(data[0]) == 0x4A &&
+      GETJOCTET(data[1]) == 0x46 &&
+      GETJOCTET(data[2]) == 0x58 &&
+      GETJOCTET(data[3]) == 0x58 &&
+      GETJOCTET(data[4]) == 0) {
+    /* Found JFIF "JFXX" extension APP0 marker */
+    /* The library doesn't actually do anything with these,
+     * but we try to produce a helpful trace message.
+     */
+    switch (GETJOCTET(data[5])) {
+    case 0x10:
+      TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen);
+      break;
+    case 0x11:
+      TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen);
+      break;
+    case 0x13:
+      TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen);
+      break;
+    default:
+      TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
+	       GETJOCTET(data[5]), (int) totallen);
+      break;
+    }
+  } else {
+    /* Start of APP0 does not match "JFIF" or "JFXX", or too short */
+    TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen);
+  }
+}
+
+
+LOCAL(void)
+examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
+	       unsigned int datalen, INT32 remaining)
+/* Examine first few bytes from an APP14.
+ * Take appropriate action if it is an Adobe marker.
+ * datalen is # of bytes at data[], remaining is length of rest of marker data.
+ */
+{
+  unsigned int version, flags0, flags1, transform;
+
+  if (datalen >= APP14_DATA_LEN &&
+      GETJOCTET(data[0]) == 0x41 &&
+      GETJOCTET(data[1]) == 0x64 &&
+      GETJOCTET(data[2]) == 0x6F &&
+      GETJOCTET(data[3]) == 0x62 &&
+      GETJOCTET(data[4]) == 0x65) {
+    /* Found Adobe APP14 marker */
+    version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
+    flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
+    flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
+    transform = GETJOCTET(data[11]);
+    TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
+    cinfo->saw_Adobe_marker = TRUE;
+    cinfo->Adobe_transform = (UINT8) transform;
+  } else {
+    /* Start of APP14 does not match "Adobe", or too short */
+    TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));
+  }
+}
+
+
+METHODDEF(boolean)
+get_interesting_appn (j_decompress_ptr cinfo)
+/* Process an APP0 or APP14 marker without saving it */
+{
+  INT32 length;
+  JOCTET b[APPN_DATA_LEN];
+  unsigned int i, numtoread;
+  INPUT_VARS(cinfo);
+
+  INPUT_2BYTES(cinfo, length, return FALSE);
+  length -= 2;
+
+  /* get the interesting part of the marker data */
+  if (length >= APPN_DATA_LEN)
+    numtoread = APPN_DATA_LEN;
+  else if (length > 0)
+    numtoread = (unsigned int) length;
+  else
+    numtoread = 0;
+  for (i = 0; i < numtoread; i++)
+    INPUT_BYTE(cinfo, b[i], return FALSE);
+  length -= numtoread;
+
+  /* process it */
+  switch (cinfo->unread_marker) {
+  case M_APP0:
+    examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length);
+    break;
+  case M_APP14:
+    examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length);
+    break;
+  default:
+    /* can't get here unless jpeg_save_markers chooses wrong processor */
+    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
+    break;
+  }
+
+  /* skip any remaining data -- could be lots */
+  INPUT_SYNC(cinfo);
+  if (length > 0)
+    (*cinfo->src->skip_input_data) (cinfo, (long) length);
+
+  return TRUE;
+}
+
+
+#ifdef SAVE_MARKERS_SUPPORTED
+
+METHODDEF(boolean)
+save_marker (j_decompress_ptr cinfo)
+/* Save an APPn or COM marker into the marker list */
+{
+  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+  jpeg_saved_marker_ptr cur_marker = marker->cur_marker;
+  unsigned int bytes_read, data_length;
+  JOCTET FAR * data;
+  INT32 length = 0;
+  INPUT_VARS(cinfo);
+
+  if (cur_marker == NULL) {
+    /* begin reading a marker */
+    INPUT_2BYTES(cinfo, length, return FALSE);
+    length -= 2;
+    if (length >= 0) {		/* watch out for bogus length word */
+      /* figure out how much we want to save */
+      unsigned int limit;
+      if (cinfo->unread_marker == (int) M_COM)
+	limit = marker->length_limit_COM;
+      else
+	limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0];
+      if ((unsigned int) length < limit)
+	limit = (unsigned int) length;
+      /* allocate and initialize the marker item */
+      cur_marker = (jpeg_saved_marker_ptr)
+	(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				    SIZEOF(struct jpeg_marker_struct) + limit);
+      cur_marker->next = NULL;
+      cur_marker->marker = (UINT8) cinfo->unread_marker;
+      cur_marker->original_length = (unsigned int) length;
+      cur_marker->data_length = limit;
+      /* data area is just beyond the jpeg_marker_struct */
+      data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1);
+      marker->cur_marker = cur_marker;
+      marker->bytes_read = 0;
+      bytes_read = 0;
+      data_length = limit;
+    } else {
+      /* deal with bogus length word */
+      bytes_read = data_length = 0;
+      data = NULL;
+    }
+  } else {
+    /* resume reading a marker */
+    bytes_read = marker->bytes_read;
+    data_length = cur_marker->data_length;
+    data = cur_marker->data + bytes_read;
+  }
+
+  while (bytes_read < data_length) {
+    INPUT_SYNC(cinfo);		/* move the restart point to here */
+    marker->bytes_read = bytes_read;
+    /* If there's not at least one byte in buffer, suspend */
+    MAKE_BYTE_AVAIL(cinfo, return FALSE);
+    /* Copy bytes with reasonable rapidity */
+    while (bytes_read < data_length && bytes_in_buffer > 0) {
+      *data++ = *next_input_byte++;
+      bytes_in_buffer--;
+      bytes_read++;
+    }
+  }
+
+  /* Done reading what we want to read */
+  if (cur_marker != NULL) {	/* will be NULL if bogus length word */
+    /* Add new marker to end of list */
+    if (cinfo->marker_list == NULL) {
+      cinfo->marker_list = cur_marker;
+    } else {
+      jpeg_saved_marker_ptr prev = cinfo->marker_list;
+      while (prev->next != NULL)
+	prev = prev->next;
+      prev->next = cur_marker;
+    }
+    /* Reset pointer & calc remaining data length */
+    data = cur_marker->data;
+    length = cur_marker->original_length - data_length;
+  }
+  /* Reset to initial state for next marker */
+  marker->cur_marker = NULL;
+
+  /* Process the marker if interesting; else just make a generic trace msg */
+  switch (cinfo->unread_marker) {
+  case M_APP0:
+    examine_app0(cinfo, data, data_length, length);
+    break;
+  case M_APP14:
+    examine_app14(cinfo, data, data_length, length);
+    break;
+  default:
+    TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,
+	     (int) (data_length + length));
+    break;
+  }
+
+  /* skip any remaining data -- could be lots */
+  INPUT_SYNC(cinfo);		/* do before skip_input_data */
+  if (length > 0)
+    (*cinfo->src->skip_input_data) (cinfo, (long) length);
+
+  return TRUE;
+}
+
+#endif /* SAVE_MARKERS_SUPPORTED */
+
+
+METHODDEF(boolean)
+skip_variable (j_decompress_ptr cinfo)
+/* Skip over an unknown or uninteresting variable-length marker */
+{
+  INT32 length;
+  INPUT_VARS(cinfo);
+
+  INPUT_2BYTES(cinfo, length, return FALSE);
+  length -= 2;
+  
+  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);
+
+  INPUT_SYNC(cinfo);		/* do before skip_input_data */
+  if (length > 0)
+    (*cinfo->src->skip_input_data) (cinfo, (long) length);
+
+  return TRUE;
+}
+
+
+/*
+ * Find the next JPEG marker, save it in cinfo->unread_marker.
+ * Returns FALSE if had to suspend before reaching a marker;
+ * in that case cinfo->unread_marker is unchanged.
+ *
+ * Note that the result might not be a valid marker code,
+ * but it will never be 0 or FF.
+ */
+
+LOCAL(boolean)
+next_marker (j_decompress_ptr cinfo)
+{
+  int c;
+  INPUT_VARS(cinfo);
+
+  for (;;) {
+    INPUT_BYTE(cinfo, c, return FALSE);
+    /* Skip any non-FF bytes.
+     * This may look a bit inefficient, but it will not occur in a valid file.
+     * We sync after each discarded byte so that a suspending data source
+     * can discard the byte from its buffer.
+     */
+    while (c != 0xFF) {
+      cinfo->marker->discarded_bytes++;
+      INPUT_SYNC(cinfo);
+      INPUT_BYTE(cinfo, c, return FALSE);
+    }
+    /* This loop swallows any duplicate FF bytes.  Extra FFs are legal as
+     * pad bytes, so don't count them in discarded_bytes.  We assume there
+     * will not be so many consecutive FF bytes as to overflow a suspending
+     * data source's input buffer.
+     */
+    do {
+      INPUT_BYTE(cinfo, c, return FALSE);
+    } while (c == 0xFF);
+    if (c != 0)
+      break;			/* found a valid marker, exit loop */
+    /* Reach here if we found a stuffed-zero data sequence (FF/00).
+     * Discard it and loop back to try again.
+     */
+    cinfo->marker->discarded_bytes += 2;
+    INPUT_SYNC(cinfo);
+  }
+
+  if (cinfo->marker->discarded_bytes != 0) {
+    WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);
+    cinfo->marker->discarded_bytes = 0;
+  }
+
+  cinfo->unread_marker = c;
+
+  INPUT_SYNC(cinfo);
+  return TRUE;
+}
+
+
+LOCAL(boolean)
+first_marker (j_decompress_ptr cinfo)
+/* Like next_marker, but used to obtain the initial SOI marker. */
+/* For this marker, we do not allow preceding garbage or fill; otherwise,
+ * we might well scan an entire input file before realizing it ain't JPEG.
+ * If an application wants to process non-JFIF files, it must seek to the
+ * SOI before calling the JPEG library.
+ */
+{
+  int c, c2;
+  INPUT_VARS(cinfo);
+
+  INPUT_BYTE(cinfo, c, return FALSE);
+  INPUT_BYTE(cinfo, c2, return FALSE);
+  if (c != 0xFF || c2 != (int) M_SOI)
+    ERREXIT2(cinfo, JERR_NO_SOI, c, c2);
+
+  cinfo->unread_marker = c2;
+
+  INPUT_SYNC(cinfo);
+  return TRUE;
+}
+
+
+/*
+ * Read markers until SOS or EOI.
+ *
+ * Returns same codes as are defined for jpeg_consume_input:
+ * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
+ */
+
+METHODDEF(int)
+read_markers (j_decompress_ptr cinfo)
+{
+  /* Outer loop repeats once for each marker. */
+  for (;;) {
+    /* Collect the marker proper, unless we already did. */
+    /* NB: first_marker() enforces the requirement that SOI appear first. */
+    if (cinfo->unread_marker == 0) {
+      if (! cinfo->marker->saw_SOI) {
+	if (! first_marker(cinfo))
+	  return JPEG_SUSPENDED;
+      } else {
+	if (! next_marker(cinfo))
+	  return JPEG_SUSPENDED;
+      }
+    }
+    /* At this point cinfo->unread_marker contains the marker code and the
+     * input point is just past the marker proper, but before any parameters.
+     * A suspension will cause us to return with this state still true.
+     */
+    switch (cinfo->unread_marker) {
+    case M_SOI:
+      if (! get_soi(cinfo))
+	return JPEG_SUSPENDED;
+      break;
+
+    case M_SOF0:		/* Baseline */
+    case M_SOF1:		/* Extended sequential, Huffman */
+      if (! get_sof(cinfo, FALSE, FALSE))
+	return JPEG_SUSPENDED;
+      break;
+
+    case M_SOF2:		/* Progressive, Huffman */
+      if (! get_sof(cinfo, TRUE, FALSE))
+	return JPEG_SUSPENDED;
+      break;
+
+    case M_SOF9:		/* Extended sequential, arithmetic */
+      if (! get_sof(cinfo, FALSE, TRUE))
+	return JPEG_SUSPENDED;
+      break;
+
+    case M_SOF10:		/* Progressive, arithmetic */
+      if (! get_sof(cinfo, TRUE, TRUE))
+	return JPEG_SUSPENDED;
+      break;
+
+    /* Currently unsupported SOFn types */
+    case M_SOF3:		/* Lossless, Huffman */
+    case M_SOF5:		/* Differential sequential, Huffman */
+    case M_SOF6:		/* Differential progressive, Huffman */
+    case M_SOF7:		/* Differential lossless, Huffman */
+    case M_JPG:			/* Reserved for JPEG extensions */
+    case M_SOF11:		/* Lossless, arithmetic */
+    case M_SOF13:		/* Differential sequential, arithmetic */
+    case M_SOF14:		/* Differential progressive, arithmetic */
+    case M_SOF15:		/* Differential lossless, arithmetic */
+      ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker);
+      break;
+
+    case M_SOS:
+      if (! get_sos(cinfo))
+	return JPEG_SUSPENDED;
+      cinfo->unread_marker = 0;	/* processed the marker */
+      return JPEG_REACHED_SOS;
+    
+    case M_EOI:
+      TRACEMS(cinfo, 1, JTRC_EOI);
+      cinfo->unread_marker = 0;	/* processed the marker */
+      return JPEG_REACHED_EOI;
+      
+    case M_DAC:
+      if (! get_dac(cinfo))
+	return JPEG_SUSPENDED;
+      break;
+      
+    case M_DHT:
+      if (! get_dht(cinfo))
+	return JPEG_SUSPENDED;
+      break;
+      
+    case M_DQT:
+      if (! get_dqt(cinfo))
+	return JPEG_SUSPENDED;
+      break;
+      
+    case M_DRI:
+      if (! get_dri(cinfo))
+	return JPEG_SUSPENDED;
+      break;
+      
+    case M_APP0:
+    case M_APP1:
+    case M_APP2:
+    case M_APP3:
+    case M_APP4:
+    case M_APP5:
+    case M_APP6:
+    case M_APP7:
+    case M_APP8:
+    case M_APP9:
+    case M_APP10:
+    case M_APP11:
+    case M_APP12:
+    case M_APP13:
+    case M_APP14:
+    case M_APP15:
+      if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[
+		cinfo->unread_marker - (int) M_APP0]) (cinfo))
+	return JPEG_SUSPENDED;
+      break;
+      
+    case M_COM:
+      if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo))
+	return JPEG_SUSPENDED;
+      break;
+
+    case M_RST0:		/* these are all parameterless */
+    case M_RST1:
+    case M_RST2:
+    case M_RST3:
+    case M_RST4:
+    case M_RST5:
+    case M_RST6:
+    case M_RST7:
+    case M_TEM:
+      TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker);
+      break;
+
+    case M_DNL:			/* Ignore DNL ... perhaps the wrong thing */
+      if (! skip_variable(cinfo))
+	return JPEG_SUSPENDED;
+      break;
+
+    default:			/* must be DHP, EXP, JPGn, or RESn */
+      /* For now, we treat the reserved markers as fatal errors since they are
+       * likely to be used to signal incompatible JPEG Part 3 extensions.
+       * Once the JPEG 3 version-number marker is well defined, this code
+       * ought to change!
+       */
+      ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
+      break;
+    }
+    /* Successfully processed marker, so reset state variable */
+    cinfo->unread_marker = 0;
+  } /* end loop */
+}
+
+
+/*
+ * Read a restart marker, which is expected to appear next in the datastream;
+ * if the marker is not there, take appropriate recovery action.
+ * Returns FALSE if suspension is required.
+ *
+ * This is called by the entropy decoder after it has read an appropriate
+ * number of MCUs.  cinfo->unread_marker may be nonzero if the entropy decoder
+ * has already read a marker from the data source.  Under normal conditions
+ * cinfo->unread_marker will be reset to 0 before returning; if not reset,
+ * it holds a marker which the decoder will be unable to read past.
+ */
+
+METHODDEF(boolean)
+read_restart_marker (j_decompress_ptr cinfo)
+{
+  /* Obtain a marker unless we already did. */
+  /* Note that next_marker will complain if it skips any data. */
+  if (cinfo->unread_marker == 0) {
+    if (! next_marker(cinfo))
+      return FALSE;
+  }
+
+  if (cinfo->unread_marker ==
+      ((int) M_RST0 + cinfo->marker->next_restart_num)) {
+    /* Normal case --- swallow the marker and let entropy decoder continue */
+    TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);
+    cinfo->unread_marker = 0;
+  } else {
+    /* Uh-oh, the restart markers have been messed up. */
+    /* Let the data source manager determine how to resync. */
+    if (! (*cinfo->src->resync_to_restart) (cinfo,
+					    cinfo->marker->next_restart_num))
+      return FALSE;
+  }
+
+  /* Update next-restart state */
+  cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;
+
+  return TRUE;
+}
+
+
+/*
+ * This is the default resync_to_restart method for data source managers
+ * to use if they don't have any better approach.  Some data source managers
+ * may be able to back up, or may have additional knowledge about the data
+ * which permits a more intelligent recovery strategy; such managers would
+ * presumably supply their own resync method.
+ *
+ * read_restart_marker calls resync_to_restart if it finds a marker other than
+ * the restart marker it was expecting.  (This code is *not* used unless
+ * a nonzero restart interval has been declared.)  cinfo->unread_marker is
+ * the marker code actually found (might be anything, except 0 or FF).
+ * The desired restart marker number (0..7) is passed as a parameter.
+ * This routine is supposed to apply whatever error recovery strategy seems
+ * appropriate in order to position the input stream to the next data segment.
+ * Note that cinfo->unread_marker is treated as a marker appearing before
+ * the current data-source input point; usually it should be reset to zero
+ * before returning.
+ * Returns FALSE if suspension is required.
+ *
+ * This implementation is substantially constrained by wanting to treat the
+ * input as a data stream; this means we can't back up.  Therefore, we have
+ * only the following actions to work with:
+ *   1. Simply discard the marker and let the entropy decoder resume at next
+ *      byte of file.
+ *   2. Read forward until we find another marker, discarding intervening
+ *      data.  (In theory we could look ahead within the current bufferload,
+ *      without having to discard data if we don't find the desired marker.
+ *      This idea is not implemented here, in part because it makes behavior
+ *      dependent on buffer size and chance buffer-boundary positions.)
+ *   3. Leave the marker unread (by failing to zero cinfo->unread_marker).
+ *      This will cause the entropy decoder to process an empty data segment,
+ *      inserting dummy zeroes, and then we will reprocess the marker.
+ *
+ * #2 is appropriate if we think the desired marker lies ahead, while #3 is
+ * appropriate if the found marker is a future restart marker (indicating
+ * that we have missed the desired restart marker, probably because it got
+ * corrupted).
+ * We apply #2 or #3 if the found marker is a restart marker no more than
+ * two counts behind or ahead of the expected one.  We also apply #2 if the
+ * found marker is not a legal JPEG marker code (it's certainly bogus data).
+ * If the found marker is a restart marker more than 2 counts away, we do #1
+ * (too much risk that the marker is erroneous; with luck we will be able to
+ * resync at some future point).
+ * For any valid non-restart JPEG marker, we apply #3.  This keeps us from
+ * overrunning the end of a scan.  An implementation limited to single-scan
+ * files might find it better to apply #2 for markers other than EOI, since
+ * any other marker would have to be bogus data in that case.
+ */
+
+GLOBAL(boolean)
+jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)
+{
+  int marker = cinfo->unread_marker;
+  int action = 1;
+  
+  /* Always put up a warning. */
+  WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);
+  
+  /* Outer loop handles repeated decision after scanning forward. */
+  for (;;) {
+    if (marker < (int) M_SOF0)
+      action = 2;		/* invalid marker */
+    else if (marker < (int) M_RST0 || marker > (int) M_RST7)
+      action = 3;		/* valid non-restart marker */
+    else {
+      if (marker == ((int) M_RST0 + ((desired+1) & 7)) ||
+	  marker == ((int) M_RST0 + ((desired+2) & 7)))
+	action = 3;		/* one of the next two expected restarts */
+      else if (marker == ((int) M_RST0 + ((desired-1) & 7)) ||
+	       marker == ((int) M_RST0 + ((desired-2) & 7)))
+	action = 2;		/* a prior restart, so advance */
+      else
+	action = 1;		/* desired restart or too far away */
+    }
+    TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);
+    switch (action) {
+    case 1:
+      /* Discard marker and let entropy decoder resume processing. */
+      cinfo->unread_marker = 0;
+      return TRUE;
+    case 2:
+      /* Scan to the next marker, and repeat the decision loop. */
+      if (! next_marker(cinfo))
+	return FALSE;
+      marker = cinfo->unread_marker;
+      break;
+    case 3:
+      /* Return without advancing past this marker. */
+      /* Entropy decoder will be forced to process an empty segment. */
+      return TRUE;
+    }
+  } /* end loop */
+}
+
+
+/*
+ * Reset marker processing state to begin a fresh datastream.
+ */
+
+METHODDEF(void)
+reset_marker_reader (j_decompress_ptr cinfo)
+{
+  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+
+  cinfo->comp_info = NULL;		/* until allocated by get_sof */
+  cinfo->input_scan_number = 0;		/* no SOS seen yet */
+  cinfo->unread_marker = 0;		/* no pending marker */
+  marker->pub.saw_SOI = FALSE;		/* set internal state too */
+  marker->pub.saw_SOF = FALSE;
+  marker->pub.discarded_bytes = 0;
+  marker->cur_marker = NULL;
+}
+
+
+/*
+ * Initialize the marker reader module.
+ * This is called only once, when the decompression object is created.
+ */
+
+GLOBAL(void)
+jinit_marker_reader (j_decompress_ptr cinfo)
+{
+  my_marker_ptr marker;
+  int i;
+
+  /* Create subobject in permanent pool */
+  marker = (my_marker_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+				SIZEOF(my_marker_reader));
+  cinfo->marker = (struct jpeg_marker_reader *) marker;
+  /* Initialize public method pointers */
+  marker->pub.reset_marker_reader = reset_marker_reader;
+  marker->pub.read_markers = read_markers;
+  marker->pub.read_restart_marker = read_restart_marker;
+  /* Initialize COM/APPn processing.
+   * By default, we examine and then discard APP0 and APP14,
+   * but simply discard COM and all other APPn.
+   */
+  marker->process_COM = skip_variable;
+  marker->length_limit_COM = 0;
+  for (i = 0; i < 16; i++) {
+    marker->process_APPn[i] = skip_variable;
+    marker->length_limit_APPn[i] = 0;
+  }
+  marker->process_APPn[0] = get_interesting_appn;
+  marker->process_APPn[14] = get_interesting_appn;
+  /* Reset marker processing state */
+  reset_marker_reader(cinfo);
+}
+
+
+/*
+ * Control saving of COM and APPn markers into marker_list.
+ */
+
+#ifdef SAVE_MARKERS_SUPPORTED
+
+GLOBAL(void)
+jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
+		   unsigned int length_limit)
+{
+  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+  long maxlength;
+  jpeg_marker_parser_method processor;
+
+  /* Length limit mustn't be larger than what we can allocate
+   * (should only be a concern in a 16-bit environment).
+   */
+  maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct);
+  if (((long) length_limit) > maxlength)
+    length_limit = (unsigned int) maxlength;
+
+  /* Choose processor routine to use.
+   * APP0/APP14 have special requirements.
+   */
+  if (length_limit) {
+    processor = save_marker;
+    /* If saving APP0/APP14, save at least enough for our internal use. */
+    if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN)
+      length_limit = APP0_DATA_LEN;
+    else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN)
+      length_limit = APP14_DATA_LEN;
+  } else {
+    processor = skip_variable;
+    /* If discarding APP0/APP14, use our regular on-the-fly processor. */
+    if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14)
+      processor = get_interesting_appn;
+  }
+
+  if (marker_code == (int) M_COM) {
+    marker->process_COM = processor;
+    marker->length_limit_COM = length_limit;
+  } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) {
+    marker->process_APPn[marker_code - (int) M_APP0] = processor;
+    marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit;
+  } else
+    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
+}
+
+#endif /* SAVE_MARKERS_SUPPORTED */
+
+
+/*
+ * Install a special processing method for COM or APPn markers.
+ */
+
+GLOBAL(void)
+jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code,
+			   jpeg_marker_parser_method routine)
+{
+  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+
+  if (marker_code == (int) M_COM)
+    marker->process_COM = routine;
+  else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15)
+    marker->process_APPn[marker_code - (int) M_APP0] = routine;
+  else
+    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
+}
diff --git a/src/libjpeg/jdmaster.c b/src/libjpeg/jdmaster.c
new file mode 100644
index 0000000..eda4b3f
--- /dev/null
+++ b/src/libjpeg/jdmaster.c
@@ -0,0 +1,557 @@
+/*
+ * jdmaster.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains master control logic for the JPEG decompressor.
+ * These routines are concerned with selecting the modules to be executed
+ * and with determining the number of passes and the work to be done in each
+ * pass.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private state */
+
+typedef struct {
+  struct jpeg_decomp_master pub; /* public fields */
+
+  int pass_number;		/* # of passes completed */
+
+  boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */
+
+  /* Saved references to initialized quantizer modules,
+   * in case we need to switch modes.
+   */
+  struct jpeg_color_quantizer * quantizer_1pass;
+  struct jpeg_color_quantizer * quantizer_2pass;
+} my_decomp_master;
+
+typedef my_decomp_master * my_master_ptr;
+
+
+/*
+ * Determine whether merged upsample/color conversion should be used.
+ * CRUCIAL: this must match the actual capabilities of jdmerge.c!
+ */
+
+LOCAL(boolean)
+use_merged_upsample (j_decompress_ptr cinfo)
+{
+#ifdef UPSAMPLE_MERGING_SUPPORTED
+  /* Merging is the equivalent of plain box-filter upsampling */
+  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
+    return FALSE;
+  /* jdmerge.c only supports YCC=>RGB color conversion */
+  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
+      cinfo->out_color_space != JCS_RGB ||
+      cinfo->out_color_components != RGB_PIXELSIZE)
+    return FALSE;
+  /* and it only handles 2h1v or 2h2v sampling ratios */
+  if (cinfo->comp_info[0].h_samp_factor != 2 ||
+      cinfo->comp_info[1].h_samp_factor != 1 ||
+      cinfo->comp_info[2].h_samp_factor != 1 ||
+      cinfo->comp_info[0].v_samp_factor >  2 ||
+      cinfo->comp_info[1].v_samp_factor != 1 ||
+      cinfo->comp_info[2].v_samp_factor != 1)
+    return FALSE;
+  /* furthermore, it doesn't work if we've scaled the IDCTs differently */
+  if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
+      cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
+      cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size)
+    return FALSE;
+  /* ??? also need to test for upsample-time rescaling, when & if supported */
+  return TRUE;			/* by golly, it'll work... */
+#else
+  return FALSE;
+#endif
+}
+
+
+/*
+ * Compute output image dimensions and related values.
+ * NOTE: this is exported for possible use by application.
+ * Hence it mustn't do anything that can't be done twice.
+ * Also note that it may be called before the master module is initialized!
+ */
+
+GLOBAL(void)
+jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
+/* Do computations that are needed before master selection phase */
+{
+#ifdef IDCT_SCALING_SUPPORTED
+  int ci;
+  jpeg_component_info *compptr;
+#endif
+
+  /* Prevent application from calling me at wrong times */
+  if (cinfo->global_state != DSTATE_READY)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+#ifdef IDCT_SCALING_SUPPORTED
+
+  /* Compute actual output image dimensions and DCT scaling choices. */
+  if (cinfo->scale_num * 8 <= cinfo->scale_denom) {
+    /* Provide 1/8 scaling */
+    cinfo->output_width = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_width, 8L);
+    cinfo->output_height = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_height, 8L);
+    cinfo->min_DCT_scaled_size = 1;
+  } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) {
+    /* Provide 1/4 scaling */
+    cinfo->output_width = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_width, 4L);
+    cinfo->output_height = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_height, 4L);
+    cinfo->min_DCT_scaled_size = 2;
+  } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) {
+    /* Provide 1/2 scaling */
+    cinfo->output_width = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_width, 2L);
+    cinfo->output_height = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_height, 2L);
+    cinfo->min_DCT_scaled_size = 4;
+  } else {
+    /* Provide 1/1 scaling */
+    cinfo->output_width = cinfo->image_width;
+    cinfo->output_height = cinfo->image_height;
+    cinfo->min_DCT_scaled_size = DCTSIZE;
+  }
+  /* In selecting the actual DCT scaling for each component, we try to
+   * scale up the chroma components via IDCT scaling rather than upsampling.
+   * This saves time if the upsampler gets to use 1:1 scaling.
+   * Note this code assumes that the supported DCT scalings are powers of 2.
+   */
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    int ssize = cinfo->min_DCT_scaled_size;
+    while (ssize < DCTSIZE &&
+	   (compptr->h_samp_factor * ssize * 2 <=
+	    cinfo->max_h_samp_factor * cinfo->min_DCT_scaled_size) &&
+	   (compptr->v_samp_factor * ssize * 2 <=
+	    cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size)) {
+      ssize = ssize * 2;
+    }
+    compptr->DCT_scaled_size = ssize;
+  }
+
+  /* Recompute downsampled dimensions of components;
+   * application needs to know these if using raw downsampled data.
+   */
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* Size in samples, after IDCT scaling */
+    compptr->downsampled_width = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_width *
+		    (long) (compptr->h_samp_factor * compptr->DCT_scaled_size),
+		    (long) (cinfo->max_h_samp_factor * DCTSIZE));
+    compptr->downsampled_height = (JDIMENSION)
+      jdiv_round_up((long) cinfo->image_height *
+		    (long) (compptr->v_samp_factor * compptr->DCT_scaled_size),
+		    (long) (cinfo->max_v_samp_factor * DCTSIZE));
+  }
+
+#else /* !IDCT_SCALING_SUPPORTED */
+
+  /* Hardwire it to "no scaling" */
+  cinfo->output_width = cinfo->image_width;
+  cinfo->output_height = cinfo->image_height;
+  /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,
+   * and has computed unscaled downsampled_width and downsampled_height.
+   */
+
+#endif /* IDCT_SCALING_SUPPORTED */
+
+  /* Report number of components in selected colorspace. */
+  /* Probably this should be in the color conversion module... */
+  switch (cinfo->out_color_space) {
+  case JCS_GRAYSCALE:
+    cinfo->out_color_components = 1;
+    break;
+  case JCS_RGB:
+#if RGB_PIXELSIZE != 3
+    cinfo->out_color_components = RGB_PIXELSIZE;
+    break;
+#endif /* else share code with YCbCr */
+  case JCS_YCbCr:
+    cinfo->out_color_components = 3;
+    break;
+  case JCS_CMYK:
+  case JCS_YCCK:
+    cinfo->out_color_components = 4;
+    break;
+  default:			/* else must be same colorspace as in file */
+    cinfo->out_color_components = cinfo->num_components;
+    break;
+  }
+  cinfo->output_components = (cinfo->quantize_colors ? 1 :
+			      cinfo->out_color_components);
+
+  /* See if upsampler will want to emit more than one row at a time */
+  if (use_merged_upsample(cinfo))
+    cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;
+  else
+    cinfo->rec_outbuf_height = 1;
+}
+
+
+/*
+ * Several decompression processes need to range-limit values to the range
+ * 0..MAXJSAMPLE; the input value may fall somewhat outside this range
+ * due to noise introduced by quantization, roundoff error, etc.  These
+ * processes are inner loops and need to be as fast as possible.  On most
+ * machines, particularly CPUs with pipelines or instruction prefetch,
+ * a (subscript-check-less) C table lookup
+ *		x = sample_range_limit[x];
+ * is faster than explicit tests
+ *		if (x < 0)  x = 0;
+ *		else if (x > MAXJSAMPLE)  x = MAXJSAMPLE;
+ * These processes all use a common table prepared by the routine below.
+ *
+ * For most steps we can mathematically guarantee that the initial value
+ * of x is within MAXJSAMPLE+1 of the legal range, so a table running from
+ * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient.  But for the initial
+ * limiting step (just after the IDCT), a wildly out-of-range value is 
+ * possible if the input data is corrupt.  To avoid any chance of indexing
+ * off the end of memory and getting a bad-pointer trap, we perform the
+ * post-IDCT limiting thus:
+ *		x = range_limit[x & MASK];
+ * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
+ * samples.  Under normal circumstances this is more than enough range and
+ * a correct output will be generated; with bogus input data the mask will
+ * cause wraparound, and we will safely generate a bogus-but-in-range output.
+ * For the post-IDCT step, we want to convert the data from signed to unsigned
+ * representation by adding CENTERJSAMPLE at the same time that we limit it.
+ * So the post-IDCT limiting table ends up looking like this:
+ *   CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
+ *   MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
+ *   0          (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
+ *   0,1,...,CENTERJSAMPLE-1
+ * Negative inputs select values from the upper half of the table after
+ * masking.
+ *
+ * We can save some space by overlapping the start of the post-IDCT table
+ * with the simpler range limiting table.  The post-IDCT table begins at
+ * sample_range_limit + CENTERJSAMPLE.
+ *
+ * Note that the table is allocated in near data space on PCs; it's small
+ * enough and used often enough to justify this.
+ */
+
+LOCAL(void)
+prepare_range_limit_table (j_decompress_ptr cinfo)
+/* Allocate and fill in the sample_range_limit table */
+{
+  JSAMPLE * table;
+  int i;
+
+  table = (JSAMPLE *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+		(5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));
+  table += (MAXJSAMPLE+1);	/* allow negative subscripts of simple table */
+  cinfo->sample_range_limit = table;
+  /* First segment of "simple" table: limit[x] = 0 for x < 0 */
+  MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
+  /* Main part of "simple" table: limit[x] = x */
+  for (i = 0; i <= MAXJSAMPLE; i++)
+    table[i] = (JSAMPLE) i;
+  table += CENTERJSAMPLE;	/* Point to where post-IDCT table starts */
+  /* End of simple table, rest of first half of post-IDCT table */
+  for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
+    table[i] = MAXJSAMPLE;
+  /* Second half of post-IDCT table */
+  MEMZERO(table + (2 * (MAXJSAMPLE+1)),
+	  (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));
+  MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),
+	  cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));
+}
+
+
+/*
+ * Master selection of decompression modules.
+ * This is done once at jpeg_start_decompress time.  We determine
+ * which modules will be used and give them appropriate initialization calls.
+ * We also initialize the decompressor input side to begin consuming data.
+ *
+ * Since jpeg_read_header has finished, we know what is in the SOF
+ * and (first) SOS markers.  We also have all the application parameter
+ * settings.
+ */
+
+LOCAL(void)
+master_selection (j_decompress_ptr cinfo)
+{
+  my_master_ptr master = (my_master_ptr) cinfo->master;
+  boolean use_c_buffer;
+  long samplesperrow;
+  JDIMENSION jd_samplesperrow;
+
+  /* Initialize dimensions and other stuff */
+  jpeg_calc_output_dimensions(cinfo);
+  prepare_range_limit_table(cinfo);
+
+  /* Width of an output scanline must be representable as JDIMENSION. */
+  samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;
+  jd_samplesperrow = (JDIMENSION) samplesperrow;
+  if ((long) jd_samplesperrow != samplesperrow)
+    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
+
+  /* Initialize my private state */
+  master->pass_number = 0;
+  master->using_merged_upsample = use_merged_upsample(cinfo);
+
+  /* Color quantizer selection */
+  master->quantizer_1pass = NULL;
+  master->quantizer_2pass = NULL;
+  /* No mode changes if not using buffered-image mode. */
+  if (! cinfo->quantize_colors || ! cinfo->buffered_image) {
+    cinfo->enable_1pass_quant = FALSE;
+    cinfo->enable_external_quant = FALSE;
+    cinfo->enable_2pass_quant = FALSE;
+  }
+  if (cinfo->quantize_colors) {
+    if (cinfo->raw_data_out)
+      ERREXIT(cinfo, JERR_NOTIMPL);
+    /* 2-pass quantizer only works in 3-component color space. */
+    if (cinfo->out_color_components != 3) {
+      cinfo->enable_1pass_quant = TRUE;
+      cinfo->enable_external_quant = FALSE;
+      cinfo->enable_2pass_quant = FALSE;
+      cinfo->colormap = NULL;
+    } else if (cinfo->colormap != NULL) {
+      cinfo->enable_external_quant = TRUE;
+    } else if (cinfo->two_pass_quantize) {
+      cinfo->enable_2pass_quant = TRUE;
+    } else {
+      cinfo->enable_1pass_quant = TRUE;
+    }
+
+    if (cinfo->enable_1pass_quant) {
+#ifdef QUANT_1PASS_SUPPORTED
+      jinit_1pass_quantizer(cinfo);
+      master->quantizer_1pass = cinfo->cquantize;
+#else
+      ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+    }
+
+    /* We use the 2-pass code to map to external colormaps. */
+    if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {
+#ifdef QUANT_2PASS_SUPPORTED
+      jinit_2pass_quantizer(cinfo);
+      master->quantizer_2pass = cinfo->cquantize;
+#else
+      ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+    }
+    /* If both quantizers are initialized, the 2-pass one is left active;
+     * this is necessary for starting with quantization to an external map.
+     */
+  }
+
+  /* Post-processing: in particular, color conversion first */
+  if (! cinfo->raw_data_out) {
+    if (master->using_merged_upsample) {
+#ifdef UPSAMPLE_MERGING_SUPPORTED
+      jinit_merged_upsampler(cinfo); /* does color conversion too */
+#else
+      ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+    } else {
+      jinit_color_deconverter(cinfo);
+      jinit_upsampler(cinfo);
+    }
+    jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);
+  }
+  /* Inverse DCT */
+  jinit_inverse_dct(cinfo);
+  /* Entropy decoding: either Huffman or arithmetic coding. */
+  if (cinfo->arith_code) {
+    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
+  } else {
+    if (cinfo->progressive_mode) {
+#ifdef D_PROGRESSIVE_SUPPORTED
+      jinit_phuff_decoder(cinfo);
+#else
+      ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+    } else
+      jinit_huff_decoder(cinfo);
+  }
+
+  /* Initialize principal buffer controllers. */
+  use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;
+  jinit_d_coef_controller(cinfo, use_c_buffer);
+
+  if (! cinfo->raw_data_out)
+    jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);
+
+  /* We can now tell the memory manager to allocate virtual arrays. */
+  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
+
+  /* Initialize input side of decompressor to consume first scan. */
+  (*cinfo->inputctl->start_input_pass) (cinfo);
+
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+  /* If jpeg_start_decompress will read the whole file, initialize
+   * progress monitoring appropriately.  The input step is counted
+   * as one pass.
+   */
+  if (cinfo->progress != NULL && ! cinfo->buffered_image &&
+      cinfo->inputctl->has_multiple_scans) {
+    int nscans;
+    /* Estimate number of scans to set pass_limit. */
+    if (cinfo->progressive_mode) {
+      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
+      nscans = 2 + 3 * cinfo->num_components;
+    } else {
+      /* For a nonprogressive multiscan file, estimate 1 scan per component. */
+      nscans = cinfo->num_components;
+    }
+    cinfo->progress->pass_counter = 0L;
+    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
+    cinfo->progress->completed_passes = 0;
+    cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);
+    /* Count the input pass as done */
+    master->pass_number++;
+  }
+#endif /* D_MULTISCAN_FILES_SUPPORTED */
+}
+
+
+/*
+ * Per-pass setup.
+ * This is called at the beginning of each output pass.  We determine which
+ * modules will be active during this pass and give them appropriate
+ * start_pass calls.  We also set is_dummy_pass to indicate whether this
+ * is a "real" output pass or a dummy pass for color quantization.
+ * (In the latter case, jdapistd.c will crank the pass to completion.)
+ */
+
+METHODDEF(void)
+prepare_for_output_pass (j_decompress_ptr cinfo)
+{
+  my_master_ptr master = (my_master_ptr) cinfo->master;
+
+  if (master->pub.is_dummy_pass) {
+#ifdef QUANT_2PASS_SUPPORTED
+    /* Final pass of 2-pass quantization */
+    master->pub.is_dummy_pass = FALSE;
+    (*cinfo->cquantize->start_pass) (cinfo, FALSE);
+    (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);
+    (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);
+#else
+    ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif /* QUANT_2PASS_SUPPORTED */
+  } else {
+    if (cinfo->quantize_colors && cinfo->colormap == NULL) {
+      /* Select new quantization method */
+      if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {
+	cinfo->cquantize = master->quantizer_2pass;
+	master->pub.is_dummy_pass = TRUE;
+      } else if (cinfo->enable_1pass_quant) {
+	cinfo->cquantize = master->quantizer_1pass;
+      } else {
+	ERREXIT(cinfo, JERR_MODE_CHANGE);
+      }
+    }
+    (*cinfo->idct->start_pass) (cinfo);
+    (*cinfo->coef->start_output_pass) (cinfo);
+    if (! cinfo->raw_data_out) {
+      if (! master->using_merged_upsample)
+	(*cinfo->cconvert->start_pass) (cinfo);
+      (*cinfo->upsample->start_pass) (cinfo);
+      if (cinfo->quantize_colors)
+	(*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);
+      (*cinfo->post->start_pass) (cinfo,
+	    (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
+      (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
+    }
+  }
+
+  /* Set up progress monitor's pass info if present */
+  if (cinfo->progress != NULL) {
+    cinfo->progress->completed_passes = master->pass_number;
+    cinfo->progress->total_passes = master->pass_number +
+				    (master->pub.is_dummy_pass ? 2 : 1);
+    /* In buffered-image mode, we assume one more output pass if EOI not
+     * yet reached, but no more passes if EOI has been reached.
+     */
+    if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) {
+      cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);
+    }
+  }
+}
+
+
+/*
+ * Finish up at end of an output pass.
+ */
+
+METHODDEF(void)
+finish_output_pass (j_decompress_ptr cinfo)
+{
+  my_master_ptr master = (my_master_ptr) cinfo->master;
+
+  if (cinfo->quantize_colors)
+    (*cinfo->cquantize->finish_pass) (cinfo);
+  master->pass_number++;
+}
+
+
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+
+/*
+ * Switch to a new external colormap between output passes.
+ */
+
+GLOBAL(void)
+jpeg_new_colormap (j_decompress_ptr cinfo)
+{
+  my_master_ptr master = (my_master_ptr) cinfo->master;
+
+  /* Prevent application from calling me at wrong times */
+  if (cinfo->global_state != DSTATE_BUFIMAGE)
+    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+  if (cinfo->quantize_colors && cinfo->enable_external_quant &&
+      cinfo->colormap != NULL) {
+    /* Select 2-pass quantizer for external colormap use */
+    cinfo->cquantize = master->quantizer_2pass;
+    /* Notify quantizer of colormap change */
+    (*cinfo->cquantize->new_color_map) (cinfo);
+    master->pub.is_dummy_pass = FALSE; /* just in case */
+  } else
+    ERREXIT(cinfo, JERR_MODE_CHANGE);
+}
+
+#endif /* D_MULTISCAN_FILES_SUPPORTED */
+
+
+/*
+ * Initialize master decompression control and select active modules.
+ * This is performed at the start of jpeg_start_decompress.
+ */
+
+GLOBAL(void)
+jinit_master_decompress (j_decompress_ptr cinfo)
+{
+  my_master_ptr master;
+
+  master = (my_master_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(my_decomp_master));
+  cinfo->master = (struct jpeg_decomp_master *) master;
+  master->pub.prepare_for_output_pass = prepare_for_output_pass;
+  master->pub.finish_output_pass = finish_output_pass;
+
+  master->pub.is_dummy_pass = FALSE;
+
+  master_selection(cinfo);
+}
diff --git a/src/libjpeg/jdmerge.c b/src/libjpeg/jdmerge.c
new file mode 100644
index 0000000..9e3a595
--- /dev/null
+++ b/src/libjpeg/jdmerge.c
@@ -0,0 +1,400 @@
+/*
+ * jdmerge.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains code for merged upsampling/color conversion.
+ *
+ * This file combines functions from jdsample.c and jdcolor.c;
+ * read those files first to understand what's going on.
+ *
+ * When the chroma components are to be upsampled by simple replication
+ * (ie, box filtering), we can save some work in color conversion by
+ * calculating all the output pixels corresponding to a pair of chroma
+ * samples at one time.  In the conversion equations
+ *	R = Y           + K1 * Cr
+ *	G = Y + K2 * Cb + K3 * Cr
+ *	B = Y + K4 * Cb
+ * only the Y term varies among the group of pixels corresponding to a pair
+ * of chroma samples, so the rest of the terms can be calculated just once.
+ * At typical sampling ratios, this eliminates half or three-quarters of the
+ * multiplications needed for color conversion.
+ *
+ * This file currently provides implementations for the following cases:
+ *	YCbCr => RGB color conversion only.
+ *	Sampling ratios of 2h1v or 2h2v.
+ *	No scaling needed at upsample time.
+ *	Corner-aligned (non-CCIR601) sampling alignment.
+ * Other special cases could be added, but in most applications these are
+ * the only common cases.  (For uncommon cases we fall back on the more
+ * general code in jdsample.c and jdcolor.c.)
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+#ifdef UPSAMPLE_MERGING_SUPPORTED
+
+
+/* Private subobject */
+
+typedef struct {
+  struct jpeg_upsampler pub;	/* public fields */
+
+  /* Pointer to routine to do actual upsampling/conversion of one row group */
+  JMETHOD(void, upmethod, (j_decompress_ptr cinfo,
+			   JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
+			   JSAMPARRAY output_buf));
+
+  /* Private state for YCC->RGB conversion */
+  int * Cr_r_tab;		/* => table for Cr to R conversion */
+  int * Cb_b_tab;		/* => table for Cb to B conversion */
+  INT32 * Cr_g_tab;		/* => table for Cr to G conversion */
+  INT32 * Cb_g_tab;		/* => table for Cb to G conversion */
+
+  /* For 2:1 vertical sampling, we produce two output rows at a time.
+   * We need a "spare" row buffer to hold the second output row if the
+   * application provides just a one-row buffer; we also use the spare
+   * to discard the dummy last row if the image height is odd.
+   */
+  JSAMPROW spare_row;
+  boolean spare_full;		/* T if spare buffer is occupied */
+
+  JDIMENSION out_row_width;	/* samples per output row */
+  JDIMENSION rows_to_go;	/* counts rows remaining in image */
+} my_upsampler;
+
+typedef my_upsampler * my_upsample_ptr;
+
+#define SCALEBITS	16	/* speediest right-shift on some machines */
+#define ONE_HALF	((INT32) 1 << (SCALEBITS-1))
+#define FIX(x)		((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
+
+
+/*
+ * Initialize tables for YCC->RGB colorspace conversion.
+ * This is taken directly from jdcolor.c; see that file for more info.
+ */
+
+LOCAL(void)
+build_ycc_rgb_table (j_decompress_ptr cinfo)
+{
+  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+  int i;
+  INT32 x;
+  SHIFT_TEMPS
+
+  upsample->Cr_r_tab = (int *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(MAXJSAMPLE+1) * SIZEOF(int));
+  upsample->Cb_b_tab = (int *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(MAXJSAMPLE+1) * SIZEOF(int));
+  upsample->Cr_g_tab = (INT32 *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(MAXJSAMPLE+1) * SIZEOF(INT32));
+  upsample->Cb_g_tab = (INT32 *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(MAXJSAMPLE+1) * SIZEOF(INT32));
+
+  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
+    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
+    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
+    /* Cr=>R value is nearest int to 1.40200 * x */
+    upsample->Cr_r_tab[i] = (int)
+		    RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
+    /* Cb=>B value is nearest int to 1.77200 * x */
+    upsample->Cb_b_tab[i] = (int)
+		    RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
+    /* Cr=>G value is scaled-up -0.71414 * x */
+    upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x;
+    /* Cb=>G value is scaled-up -0.34414 * x */
+    /* We also add in ONE_HALF so that need not do it in inner loop */
+    upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
+  }
+}
+
+
+/*
+ * Initialize for an upsampling pass.
+ */
+
+METHODDEF(void)
+start_pass_merged_upsample (j_decompress_ptr cinfo)
+{
+  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+
+  /* Mark the spare buffer empty */
+  upsample->spare_full = FALSE;
+  /* Initialize total-height counter for detecting bottom of image */
+  upsample->rows_to_go = cinfo->output_height;
+}
+
+
+/*
+ * Control routine to do upsampling (and color conversion).
+ *
+ * The control routine just handles the row buffering considerations.
+ */
+
+METHODDEF(void)
+merged_2v_upsample (j_decompress_ptr cinfo,
+		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+		    JDIMENSION in_row_groups_avail,
+		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+		    JDIMENSION out_rows_avail)
+/* 2:1 vertical sampling case: may need a spare row. */
+{
+  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+  JSAMPROW work_ptrs[2];
+  JDIMENSION num_rows;		/* number of rows returned to caller */
+
+  if (upsample->spare_full) {
+    /* If we have a spare row saved from a previous cycle, just return it. */
+    jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,
+		      1, upsample->out_row_width);
+    num_rows = 1;
+    upsample->spare_full = FALSE;
+  } else {
+    /* Figure number of rows to return to caller. */
+    num_rows = 2;
+    /* Not more than the distance to the end of the image. */
+    if (num_rows > upsample->rows_to_go)
+      num_rows = upsample->rows_to_go;
+    /* And not more than what the client can accept: */
+    out_rows_avail -= *out_row_ctr;
+    if (num_rows > out_rows_avail)
+      num_rows = out_rows_avail;
+    /* Create output pointer array for upsampler. */
+    work_ptrs[0] = output_buf[*out_row_ctr];
+    if (num_rows > 1) {
+      work_ptrs[1] = output_buf[*out_row_ctr + 1];
+    } else {
+      work_ptrs[1] = upsample->spare_row;
+      upsample->spare_full = TRUE;
+    }
+    /* Now do the upsampling. */
+    (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
+  }
+
+  /* Adjust counts */
+  *out_row_ctr += num_rows;
+  upsample->rows_to_go -= num_rows;
+  /* When the buffer is emptied, declare this input row group consumed */
+  if (! upsample->spare_full)
+    (*in_row_group_ctr)++;
+}
+
+
+METHODDEF(void)
+merged_1v_upsample (j_decompress_ptr cinfo,
+		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+		    JDIMENSION in_row_groups_avail,
+		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+		    JDIMENSION out_rows_avail)
+/* 1:1 vertical sampling case: much easier, never need a spare row. */
+{
+  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+
+  /* Just do the upsampling. */
+  (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
+			 output_buf + *out_row_ctr);
+  /* Adjust counts */
+  (*out_row_ctr)++;
+  (*in_row_group_ctr)++;
+}
+
+
+/*
+ * These are the routines invoked by the control routines to do
+ * the actual upsampling/conversion.  One row group is processed per call.
+ *
+ * Note: since we may be writing directly into application-supplied buffers,
+ * we have to be honest about the output width; we can't assume the buffer
+ * has been rounded up to an even width.
+ */
+
+
+/*
+ * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.
+ */
+
+METHODDEF(void)
+h2v1_merged_upsample (j_decompress_ptr cinfo,
+		      JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
+		      JSAMPARRAY output_buf)
+{
+  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+  register int y, cred, cgreen, cblue;
+  int cb, cr;
+  register JSAMPROW outptr;
+  JSAMPROW inptr0, inptr1, inptr2;
+  JDIMENSION col;
+  /* copy these pointers into registers if possible */
+  register JSAMPLE * range_limit = cinfo->sample_range_limit;
+  int * Crrtab = upsample->Cr_r_tab;
+  int * Cbbtab = upsample->Cb_b_tab;
+  INT32 * Crgtab = upsample->Cr_g_tab;
+  INT32 * Cbgtab = upsample->Cb_g_tab;
+  SHIFT_TEMPS
+
+  inptr0 = input_buf[0][in_row_group_ctr];
+  inptr1 = input_buf[1][in_row_group_ctr];
+  inptr2 = input_buf[2][in_row_group_ctr];
+  outptr = output_buf[0];
+  /* Loop for each pair of output pixels */
+  for (col = cinfo->output_width >> 1; col > 0; col--) {
+    /* Do the chroma part of the calculation */
+    cb = GETJSAMPLE(*inptr1++);
+    cr = GETJSAMPLE(*inptr2++);
+    cred = Crrtab[cr];
+    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
+    cblue = Cbbtab[cb];
+    /* Fetch 2 Y values and emit 2 pixels */
+    y  = GETJSAMPLE(*inptr0++);
+    outptr[RGB_RED] =   range_limit[y + cred];
+    outptr[RGB_GREEN] = range_limit[y + cgreen];
+    outptr[RGB_BLUE] =  range_limit[y + cblue];
+    outptr += RGB_PIXELSIZE;
+    y  = GETJSAMPLE(*inptr0++);
+    outptr[RGB_RED] =   range_limit[y + cred];
+    outptr[RGB_GREEN] = range_limit[y + cgreen];
+    outptr[RGB_BLUE] =  range_limit[y + cblue];
+    outptr += RGB_PIXELSIZE;
+  }
+  /* If image width is odd, do the last output column separately */
+  if (cinfo->output_width & 1) {
+    cb = GETJSAMPLE(*inptr1);
+    cr = GETJSAMPLE(*inptr2);
+    cred = Crrtab[cr];
+    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
+    cblue = Cbbtab[cb];
+    y  = GETJSAMPLE(*inptr0);
+    outptr[RGB_RED] =   range_limit[y + cred];
+    outptr[RGB_GREEN] = range_limit[y + cgreen];
+    outptr[RGB_BLUE] =  range_limit[y + cblue];
+  }
+}
+
+
+/*
+ * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.
+ */
+
+METHODDEF(void)
+h2v2_merged_upsample (j_decompress_ptr cinfo,
+		      JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
+		      JSAMPARRAY output_buf)
+{
+  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+  register int y, cred, cgreen, cblue;
+  int cb, cr;
+  register JSAMPROW outptr0, outptr1;
+  JSAMPROW inptr00, inptr01, inptr1, inptr2;
+  JDIMENSION col;
+  /* copy these pointers into registers if possible */
+  register JSAMPLE * range_limit = cinfo->sample_range_limit;
+  int * Crrtab = upsample->Cr_r_tab;
+  int * Cbbtab = upsample->Cb_b_tab;
+  INT32 * Crgtab = upsample->Cr_g_tab;
+  INT32 * Cbgtab = upsample->Cb_g_tab;
+  SHIFT_TEMPS
+
+  inptr00 = input_buf[0][in_row_group_ctr*2];
+  inptr01 = input_buf[0][in_row_group_ctr*2 + 1];
+  inptr1 = input_buf[1][in_row_group_ctr];
+  inptr2 = input_buf[2][in_row_group_ctr];
+  outptr0 = output_buf[0];
+  outptr1 = output_buf[1];
+  /* Loop for each group of output pixels */
+  for (col = cinfo->output_width >> 1; col > 0; col--) {
+    /* Do the chroma part of the calculation */
+    cb = GETJSAMPLE(*inptr1++);
+    cr = GETJSAMPLE(*inptr2++);
+    cred = Crrtab[cr];
+    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
+    cblue = Cbbtab[cb];
+    /* Fetch 4 Y values and emit 4 pixels */
+    y  = GETJSAMPLE(*inptr00++);
+    outptr0[RGB_RED] =   range_limit[y + cred];
+    outptr0[RGB_GREEN] = range_limit[y + cgreen];
+    outptr0[RGB_BLUE] =  range_limit[y + cblue];
+    outptr0 += RGB_PIXELSIZE;
+    y  = GETJSAMPLE(*inptr00++);
+    outptr0[RGB_RED] =   range_limit[y + cred];
+    outptr0[RGB_GREEN] = range_limit[y + cgreen];
+    outptr0[RGB_BLUE] =  range_limit[y + cblue];
+    outptr0 += RGB_PIXELSIZE;
+    y  = GETJSAMPLE(*inptr01++);
+    outptr1[RGB_RED] =   range_limit[y + cred];
+    outptr1[RGB_GREEN] = range_limit[y + cgreen];
+    outptr1[RGB_BLUE] =  range_limit[y + cblue];
+    outptr1 += RGB_PIXELSIZE;
+    y  = GETJSAMPLE(*inptr01++);
+    outptr1[RGB_RED] =   range_limit[y + cred];
+    outptr1[RGB_GREEN] = range_limit[y + cgreen];
+    outptr1[RGB_BLUE] =  range_limit[y + cblue];
+    outptr1 += RGB_PIXELSIZE;
+  }
+  /* If image width is odd, do the last output column separately */
+  if (cinfo->output_width & 1) {
+    cb = GETJSAMPLE(*inptr1);
+    cr = GETJSAMPLE(*inptr2);
+    cred = Crrtab[cr];
+    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
+    cblue = Cbbtab[cb];
+    y  = GETJSAMPLE(*inptr00);
+    outptr0[RGB_RED] =   range_limit[y + cred];
+    outptr0[RGB_GREEN] = range_limit[y + cgreen];
+    outptr0[RGB_BLUE] =  range_limit[y + cblue];
+    y  = GETJSAMPLE(*inptr01);
+    outptr1[RGB_RED] =   range_limit[y + cred];
+    outptr1[RGB_GREEN] = range_limit[y + cgreen];
+    outptr1[RGB_BLUE] =  range_limit[y + cblue];
+  }
+}
+
+
+/*
+ * Module initialization routine for merged upsampling/color conversion.
+ *
+ * NB: this is called under the conditions determined by use_merged_upsample()
+ * in jdmaster.c.  That routine MUST correspond to the actual capabilities
+ * of this module; no safety checks are made here.
+ */
+
+GLOBAL(void)
+jinit_merged_upsampler (j_decompress_ptr cinfo)
+{
+  my_upsample_ptr upsample;
+
+  upsample = (my_upsample_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_upsampler));
+  cinfo->upsample = (struct jpeg_upsampler *) upsample;
+  upsample->pub.start_pass = start_pass_merged_upsample;
+  upsample->pub.need_context_rows = FALSE;
+
+  upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;
+
+  if (cinfo->max_v_samp_factor == 2) {
+    upsample->pub.upsample = merged_2v_upsample;
+    upsample->upmethod = h2v2_merged_upsample;
+    /* Allocate a spare row buffer */
+    upsample->spare_row = (JSAMPROW)
+      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+		(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
+  } else {
+    upsample->pub.upsample = merged_1v_upsample;
+    upsample->upmethod = h2v1_merged_upsample;
+    /* No spare row needed */
+    upsample->spare_row = NULL;
+  }
+
+  build_ycc_rgb_table(cinfo);
+}
+
+#endif /* UPSAMPLE_MERGING_SUPPORTED */
diff --git a/src/libjpeg/jdphuff.c b/src/libjpeg/jdphuff.c
new file mode 100644
index 0000000..2404743
--- /dev/null
+++ b/src/libjpeg/jdphuff.c
@@ -0,0 +1,668 @@
+/*
+ * jdphuff.c
+ *
+ * Copyright (C) 1995-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains Huffman entropy decoding routines for progressive JPEG.
+ *
+ * Much of the complexity here has to do with supporting input suspension.
+ * If the data source module demands suspension, we want to be able to back
+ * up to the start of the current MCU.  To do this, we copy state variables
+ * into local working storage, and update them back to the permanent
+ * storage only upon successful completion of an MCU.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdhuff.h"		/* Declarations shared with jdhuff.c */
+
+
+#ifdef D_PROGRESSIVE_SUPPORTED
+
+/*
+ * Expanded entropy decoder object for progressive Huffman decoding.
+ *
+ * The savable_state subrecord contains fields that change within an MCU,
+ * but must not be updated permanently until we complete the MCU.
+ */
+
+typedef struct {
+  unsigned int EOBRUN;			/* remaining EOBs in EOBRUN */
+  int last_dc_val[MAX_COMPS_IN_SCAN];	/* last DC coef for each component */
+} savable_state;
+
+/* This macro is to work around compilers with missing or broken
+ * structure assignment.  You'll need to fix this code if you have
+ * such a compiler and you change MAX_COMPS_IN_SCAN.
+ */
+
+#ifndef NO_STRUCT_ASSIGN
+#define ASSIGN_STATE(dest,src)  ((dest) = (src))
+#else
+#if MAX_COMPS_IN_SCAN == 4
+#define ASSIGN_STATE(dest,src)  \
+	((dest).EOBRUN = (src).EOBRUN, \
+	 (dest).last_dc_val[0] = (src).last_dc_val[0], \
+	 (dest).last_dc_val[1] = (src).last_dc_val[1], \
+	 (dest).last_dc_val[2] = (src).last_dc_val[2], \
+	 (dest).last_dc_val[3] = (src).last_dc_val[3])
+#endif
+#endif
+
+
+typedef struct {
+  struct jpeg_entropy_decoder pub; /* public fields */
+
+  /* These fields are loaded into local variables at start of each MCU.
+   * In case of suspension, we exit WITHOUT updating them.
+   */
+  bitread_perm_state bitstate;	/* Bit buffer at start of MCU */
+  savable_state saved;		/* Other state at start of MCU */
+
+  /* These fields are NOT loaded into local working state. */
+  unsigned int restarts_to_go;	/* MCUs left in this restart interval */
+
+  /* Pointers to derived tables (these workspaces have image lifespan) */
+  d_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
+
+  d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */
+} phuff_entropy_decoder;
+
+typedef phuff_entropy_decoder * phuff_entropy_ptr;
+
+/* Forward declarations */
+METHODDEF(boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo,
+					    JBLOCKROW *MCU_data));
+METHODDEF(boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo,
+					    JBLOCKROW *MCU_data));
+METHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo,
+					     JBLOCKROW *MCU_data));
+METHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo,
+					     JBLOCKROW *MCU_data));
+
+
+/*
+ * Initialize for a Huffman-compressed scan.
+ */
+
+METHODDEF(void)
+start_pass_phuff_decoder (j_decompress_ptr cinfo)
+{
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  boolean is_DC_band, bad;
+  int ci, coefi, tbl;
+  int *coef_bit_ptr;
+  jpeg_component_info * compptr;
+
+  is_DC_band = (cinfo->Ss == 0);
+
+  /* Validate scan parameters */
+  bad = FALSE;
+  if (is_DC_band) {
+    if (cinfo->Se != 0)
+      bad = TRUE;
+  } else {
+    /* need not check Ss/Se < 0 since they came from unsigned bytes */
+    if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2)
+      bad = TRUE;
+    /* AC scans may have only one component */
+    if (cinfo->comps_in_scan != 1)
+      bad = TRUE;
+  }
+  if (cinfo->Ah != 0) {
+    /* Successive approximation refinement scan: must have Al = Ah-1. */
+    if (cinfo->Al != cinfo->Ah-1)
+      bad = TRUE;
+  }
+  if (cinfo->Al > 13)		/* need not check for < 0 */
+    bad = TRUE;
+  /* Arguably the maximum Al value should be less than 13 for 8-bit precision,
+   * but the spec doesn't say so, and we try to be liberal about what we
+   * accept.  Note: large Al values could result in out-of-range DC
+   * coefficients during early scans, leading to bizarre displays due to
+   * overflows in the IDCT math.  But we won't crash.
+   */
+  if (bad)
+    ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
+	     cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
+  /* Update progression status, and verify that scan order is legal.
+   * Note that inter-scan inconsistencies are treated as warnings
+   * not fatal errors ... not clear if this is right way to behave.
+   */
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    int cindex = cinfo->cur_comp_info[ci]->component_index;
+    coef_bit_ptr = & cinfo->coef_bits[cindex][0];
+    if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
+      WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
+    for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
+      int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
+      if (cinfo->Ah != expected)
+	WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
+      coef_bit_ptr[coefi] = cinfo->Al;
+    }
+  }
+
+  /* Select MCU decoding routine */
+  if (cinfo->Ah == 0) {
+    if (is_DC_band)
+      entropy->pub.decode_mcu = decode_mcu_DC_first;
+    else
+      entropy->pub.decode_mcu = decode_mcu_AC_first;
+  } else {
+    if (is_DC_band)
+      entropy->pub.decode_mcu = decode_mcu_DC_refine;
+    else
+      entropy->pub.decode_mcu = decode_mcu_AC_refine;
+  }
+
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+    compptr = cinfo->cur_comp_info[ci];
+    /* Make sure requested tables are present, and compute derived tables.
+     * We may build same derived table more than once, but it's not expensive.
+     */
+    if (is_DC_band) {
+      if (cinfo->Ah == 0) {	/* DC refinement needs no table */
+	tbl = compptr->dc_tbl_no;
+	jpeg_make_d_derived_tbl(cinfo, TRUE, tbl,
+				& entropy->derived_tbls[tbl]);
+      }
+    } else {
+      tbl = compptr->ac_tbl_no;
+      jpeg_make_d_derived_tbl(cinfo, FALSE, tbl,
+			      & entropy->derived_tbls[tbl]);
+      /* remember the single active table */
+      entropy->ac_derived_tbl = entropy->derived_tbls[tbl];
+    }
+    /* Initialize DC predictions to 0 */
+    entropy->saved.last_dc_val[ci] = 0;
+  }
+
+  /* Initialize bitread state variables */
+  entropy->bitstate.bits_left = 0;
+  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
+  entropy->pub.insufficient_data = FALSE;
+
+  /* Initialize private state variables */
+  entropy->saved.EOBRUN = 0;
+
+  /* Initialize restart counter */
+  entropy->restarts_to_go = cinfo->restart_interval;
+}
+
+
+/*
+ * Figure F.12: extend sign bit.
+ * On some machines, a shift and add will be faster than a table lookup.
+ */
+
+#ifdef AVOID_TABLES
+
+#define HUFF_EXTEND(x,s)  ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
+
+#else
+
+#define HUFF_EXTEND(x,s)  ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
+
+static const int extend_test[16] =   /* entry n is 2**(n-1) */
+  { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
+    0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
+
+static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
+  { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
+    ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
+    ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
+    ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
+
+#endif /* AVOID_TABLES */
+
+
+/*
+ * Check for a restart marker & resynchronize decoder.
+ * Returns FALSE if must suspend.
+ */
+
+LOCAL(boolean)
+process_restart (j_decompress_ptr cinfo)
+{
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  int ci;
+
+  /* Throw away any unused bits remaining in bit buffer; */
+  /* include any full bytes in next_marker's count of discarded bytes */
+  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
+  entropy->bitstate.bits_left = 0;
+
+  /* Advance past the RSTn marker */
+  if (! (*cinfo->marker->read_restart_marker) (cinfo))
+    return FALSE;
+
+  /* Re-initialize DC predictions to 0 */
+  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
+    entropy->saved.last_dc_val[ci] = 0;
+  /* Re-init EOB run count, too */
+  entropy->saved.EOBRUN = 0;
+
+  /* Reset restart counter */
+  entropy->restarts_to_go = cinfo->restart_interval;
+
+  /* Reset out-of-data flag, unless read_restart_marker left us smack up
+   * against a marker.  In that case we will end up treating the next data
+   * segment as empty, and we can avoid producing bogus output pixels by
+   * leaving the flag set.
+   */
+  if (cinfo->unread_marker == 0)
+    entropy->pub.insufficient_data = FALSE;
+
+  return TRUE;
+}
+
+
+/*
+ * Huffman MCU decoding.
+ * Each of these routines decodes and returns one MCU's worth of
+ * Huffman-compressed coefficients. 
+ * The coefficients are reordered from zigzag order into natural array order,
+ * but are not dequantized.
+ *
+ * The i'th block of the MCU is stored into the block pointed to by
+ * MCU_data[i].  WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.
+ *
+ * We return FALSE if data source requested suspension.  In that case no
+ * changes have been made to permanent state.  (Exception: some output
+ * coefficients may already have been assigned.  This is harmless for
+ * spectral selection, since we'll just re-assign them on the next call.
+ * Successive approximation AC refinement has to be more careful, however.)
+ */
+
+/*
+ * MCU decoding for DC initial scan (either spectral selection,
+ * or first pass of successive approximation).
+ */
+
+METHODDEF(boolean)
+decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+{   
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  int Al = cinfo->Al;
+  register int s, r;
+  int blkn, ci;
+  JBLOCKROW block;
+  BITREAD_STATE_VARS;
+  savable_state state;
+  d_derived_tbl * tbl;
+  jpeg_component_info * compptr;
+
+  /* Process restart marker if needed; may have to suspend */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0)
+      if (! process_restart(cinfo))
+	return FALSE;
+  }
+
+  /* If we've run out of data, just leave the MCU set to zeroes.
+   * This way, we return uniform gray for the remainder of the segment.
+   */
+  if (! entropy->pub.insufficient_data) {
+
+    /* Load up working state */
+    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
+    ASSIGN_STATE(state, entropy->saved);
+
+    /* Outer loop handles each block in the MCU */
+
+    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+      block = MCU_data[blkn];
+      ci = cinfo->MCU_membership[blkn];
+      compptr = cinfo->cur_comp_info[ci];
+      tbl = entropy->derived_tbls[compptr->dc_tbl_no];
+
+      /* Decode a single block's worth of coefficients */
+
+      /* Section F.2.2.1: decode the DC coefficient difference */
+      HUFF_DECODE(s, br_state, tbl, return FALSE, label1);
+      if (s) {
+	CHECK_BIT_BUFFER(br_state, s, return FALSE);
+	r = GET_BITS(s);
+	s = HUFF_EXTEND(r, s);
+      }
+
+      /* Convert DC difference to actual value, update last_dc_val */
+      s += state.last_dc_val[ci];
+      state.last_dc_val[ci] = s;
+      /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
+      (*block)[0] = (JCOEF) (s << Al);
+    }
+
+    /* Completed MCU, so update state */
+    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
+    ASSIGN_STATE(entropy->saved, state);
+  }
+
+  /* Account for restart interval (no-op if not using restarts) */
+  entropy->restarts_to_go--;
+
+  return TRUE;
+}
+
+
+/*
+ * MCU decoding for AC initial scan (either spectral selection,
+ * or first pass of successive approximation).
+ */
+
+METHODDEF(boolean)
+decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+{   
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  int Se = cinfo->Se;
+  int Al = cinfo->Al;
+  register int s, k, r;
+  unsigned int EOBRUN;
+  JBLOCKROW block;
+  BITREAD_STATE_VARS;
+  d_derived_tbl * tbl;
+
+  /* Process restart marker if needed; may have to suspend */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0)
+      if (! process_restart(cinfo))
+	return FALSE;
+  }
+
+  /* If we've run out of data, just leave the MCU set to zeroes.
+   * This way, we return uniform gray for the remainder of the segment.
+   */
+  if (! entropy->pub.insufficient_data) {
+
+    /* Load up working state.
+     * We can avoid loading/saving bitread state if in an EOB run.
+     */
+    EOBRUN = entropy->saved.EOBRUN;	/* only part of saved state we need */
+
+    /* There is always only one block per MCU */
+
+    if (EOBRUN > 0)		/* if it's a band of zeroes... */
+      EOBRUN--;			/* ...process it now (we do nothing) */
+    else {
+      BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
+      block = MCU_data[0];
+      tbl = entropy->ac_derived_tbl;
+
+      for (k = cinfo->Ss; k <= Se; k++) {
+	HUFF_DECODE(s, br_state, tbl, return FALSE, label2);
+	r = s >> 4;
+	s &= 15;
+	if (s) {
+	  k += r;
+	  CHECK_BIT_BUFFER(br_state, s, return FALSE);
+	  r = GET_BITS(s);
+	  s = HUFF_EXTEND(r, s);
+	  /* Scale and output coefficient in natural (dezigzagged) order */
+	  (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al);
+	} else {
+	  if (r == 15) {	/* ZRL */
+	    k += 15;		/* skip 15 zeroes in band */
+	  } else {		/* EOBr, run length is 2^r + appended bits */
+	    EOBRUN = 1 << r;
+	    if (r) {		/* EOBr, r > 0 */
+	      CHECK_BIT_BUFFER(br_state, r, return FALSE);
+	      r = GET_BITS(r);
+	      EOBRUN += r;
+	    }
+	    EOBRUN--;		/* this band is processed at this moment */
+	    break;		/* force end-of-band */
+	  }
+	}
+      }
+
+      BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
+    }
+
+    /* Completed MCU, so update state */
+    entropy->saved.EOBRUN = EOBRUN;	/* only part of saved state we need */
+  }
+
+  /* Account for restart interval (no-op if not using restarts) */
+  entropy->restarts_to_go--;
+
+  return TRUE;
+}
+
+
+/*
+ * MCU decoding for DC successive approximation refinement scan.
+ * Note: we assume such scans can be multi-component, although the spec
+ * is not very clear on the point.
+ */
+
+METHODDEF(boolean)
+decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+{   
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  int p1 = 1 << cinfo->Al;	/* 1 in the bit position being coded */
+  int blkn;
+  JBLOCKROW block;
+  BITREAD_STATE_VARS;
+
+  /* Process restart marker if needed; may have to suspend */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0)
+      if (! process_restart(cinfo))
+	return FALSE;
+  }
+
+  /* Not worth the cycles to check insufficient_data here,
+   * since we will not change the data anyway if we read zeroes.
+   */
+
+  /* Load up working state */
+  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
+
+  /* Outer loop handles each block in the MCU */
+
+  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+    block = MCU_data[blkn];
+
+    /* Encoded data is simply the next bit of the two's-complement DC value */
+    CHECK_BIT_BUFFER(br_state, 1, return FALSE);
+    if (GET_BITS(1))
+      (*block)[0] |= p1;
+    /* Note: since we use |=, repeating the assignment later is safe */
+  }
+
+  /* Completed MCU, so update state */
+  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
+
+  /* Account for restart interval (no-op if not using restarts) */
+  entropy->restarts_to_go--;
+
+  return TRUE;
+}
+
+
+/*
+ * MCU decoding for AC successive approximation refinement scan.
+ */
+
+METHODDEF(boolean)
+decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+{   
+  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+  int Se = cinfo->Se;
+  int p1 = 1 << cinfo->Al;	/* 1 in the bit position being coded */
+  int m1 = (-1) << cinfo->Al;	/* -1 in the bit position being coded */
+  register int s, k, r;
+  unsigned int EOBRUN;
+  JBLOCKROW block;
+  JCOEFPTR thiscoef;
+  BITREAD_STATE_VARS;
+  d_derived_tbl * tbl;
+  int num_newnz;
+  int newnz_pos[DCTSIZE2];
+
+  /* Process restart marker if needed; may have to suspend */
+  if (cinfo->restart_interval) {
+    if (entropy->restarts_to_go == 0)
+      if (! process_restart(cinfo))
+	return FALSE;
+  }
+
+  /* If we've run out of data, don't modify the MCU.
+   */
+  if (! entropy->pub.insufficient_data) {
+
+    /* Load up working state */
+    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
+    EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
+
+    /* There is always only one block per MCU */
+    block = MCU_data[0];
+    tbl = entropy->ac_derived_tbl;
+
+    /* If we are forced to suspend, we must undo the assignments to any newly
+     * nonzero coefficients in the block, because otherwise we'd get confused
+     * next time about which coefficients were already nonzero.
+     * But we need not undo addition of bits to already-nonzero coefficients;
+     * instead, we can test the current bit to see if we already did it.
+     */
+    num_newnz = 0;
+
+    /* initialize coefficient loop counter to start of band */
+    k = cinfo->Ss;
+
+    if (EOBRUN == 0) {
+      for (; k <= Se; k++) {
+	HUFF_DECODE(s, br_state, tbl, goto undoit, label3);
+	r = s >> 4;
+	s &= 15;
+	if (s) {
+	  if (s != 1)		/* size of new coef should always be 1 */
+	    WARNMS(cinfo, JWRN_HUFF_BAD_CODE);
+	  CHECK_BIT_BUFFER(br_state, 1, goto undoit);
+	  if (GET_BITS(1))
+	    s = p1;		/* newly nonzero coef is positive */
+	  else
+	    s = m1;		/* newly nonzero coef is negative */
+	} else {
+	  if (r != 15) {
+	    EOBRUN = 1 << r;	/* EOBr, run length is 2^r + appended bits */
+	    if (r) {
+	      CHECK_BIT_BUFFER(br_state, r, goto undoit);
+	      r = GET_BITS(r);
+	      EOBRUN += r;
+	    }
+	    break;		/* rest of block is handled by EOB logic */
+	  }
+	  /* note s = 0 for processing ZRL */
+	}
+	/* Advance over already-nonzero coefs and r still-zero coefs,
+	 * appending correction bits to the nonzeroes.  A correction bit is 1
+	 * if the absolute value of the coefficient must be increased.
+	 */
+	do {
+	  thiscoef = *block + jpeg_natural_order[k];
+	  if (*thiscoef != 0) {
+	    CHECK_BIT_BUFFER(br_state, 1, goto undoit);
+	    if (GET_BITS(1)) {
+	      if ((*thiscoef & p1) == 0) { /* do nothing if already set it */
+		if (*thiscoef >= 0)
+		  *thiscoef += p1;
+		else
+		  *thiscoef += m1;
+	      }
+	    }
+	  } else {
+	    if (--r < 0)
+	      break;		/* reached target zero coefficient */
+	  }
+	  k++;
+	} while (k <= Se);
+	if (s) {
+	  int pos = jpeg_natural_order[k];
+	  /* Output newly nonzero coefficient */
+	  (*block)[pos] = (JCOEF) s;
+	  /* Remember its position in case we have to suspend */
+	  newnz_pos[num_newnz++] = pos;
+	}
+      }
+    }
+
+    if (EOBRUN > 0) {
+      /* Scan any remaining coefficient positions after the end-of-band
+       * (the last newly nonzero coefficient, if any).  Append a correction
+       * bit to each already-nonzero coefficient.  A correction bit is 1
+       * if the absolute value of the coefficient must be increased.
+       */
+      for (; k <= Se; k++) {
+	thiscoef = *block + jpeg_natural_order[k];
+	if (*thiscoef != 0) {
+	  CHECK_BIT_BUFFER(br_state, 1, goto undoit);
+	  if (GET_BITS(1)) {
+	    if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */
+	      if (*thiscoef >= 0)
+		*thiscoef += p1;
+	      else
+		*thiscoef += m1;
+	    }
+	  }
+	}
+      }
+      /* Count one block completed in EOB run */
+      EOBRUN--;
+    }
+
+    /* Completed MCU, so update state */
+    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
+    entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
+  }
+
+  /* Account for restart interval (no-op if not using restarts) */
+  entropy->restarts_to_go--;
+
+  return TRUE;
+
+undoit:
+  /* Re-zero any output coefficients that we made newly nonzero */
+  while (num_newnz > 0)
+    (*block)[newnz_pos[--num_newnz]] = 0;
+
+  return FALSE;
+}
+
+
+/*
+ * Module initialization routine for progressive Huffman entropy decoding.
+ */
+
+GLOBAL(void)
+jinit_phuff_decoder (j_decompress_ptr cinfo)
+{
+  phuff_entropy_ptr entropy;
+  int *coef_bit_ptr;
+  int ci, i;
+
+  entropy = (phuff_entropy_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(phuff_entropy_decoder));
+  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
+  entropy->pub.start_pass = start_pass_phuff_decoder;
+
+  /* Mark derived tables unallocated */
+  for (i = 0; i < NUM_HUFF_TBLS; i++) {
+    entropy->derived_tbls[i] = NULL;
+  }
+
+  /* Create progression status table */
+  cinfo->coef_bits = (int (*)[DCTSIZE2])
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				cinfo->num_components*DCTSIZE2*SIZEOF(int));
+  coef_bit_ptr = & cinfo->coef_bits[0][0];
+  for (ci = 0; ci < cinfo->num_components; ci++) 
+    for (i = 0; i < DCTSIZE2; i++)
+      *coef_bit_ptr++ = -1;
+}
+
+#endif /* D_PROGRESSIVE_SUPPORTED */
diff --git a/src/libjpeg/jdpostct.c b/src/libjpeg/jdpostct.c
new file mode 100644
index 0000000..7ba9eed
--- /dev/null
+++ b/src/libjpeg/jdpostct.c
@@ -0,0 +1,290 @@
+/*
+ * jdpostct.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the decompression postprocessing controller.
+ * This controller manages the upsampling, color conversion, and color
+ * quantization/reduction steps; specifically, it controls the buffering
+ * between upsample/color conversion and color quantization/reduction.
+ *
+ * If no color quantization/reduction is required, then this module has no
+ * work to do, and it just hands off to the upsample/color conversion code.
+ * An integrated upsample/convert/quantize process would replace this module
+ * entirely.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private buffer controller object */
+
+typedef struct {
+  struct jpeg_d_post_controller pub; /* public fields */
+
+  /* Color quantization source buffer: this holds output data from
+   * the upsample/color conversion step to be passed to the quantizer.
+   * For two-pass color quantization, we need a full-image buffer;
+   * for one-pass operation, a strip buffer is sufficient.
+   */
+  jvirt_sarray_ptr whole_image;	/* virtual array, or NULL if one-pass */
+  JSAMPARRAY buffer;		/* strip buffer, or current strip of virtual */
+  JDIMENSION strip_height;	/* buffer size in rows */
+  /* for two-pass mode only: */
+  JDIMENSION starting_row;	/* row # of first row in current strip */
+  JDIMENSION next_row;		/* index of next row to fill/empty in strip */
+} my_post_controller;
+
+typedef my_post_controller * my_post_ptr;
+
+
+/* Forward declarations */
+METHODDEF(void) post_process_1pass
+	JPP((j_decompress_ptr cinfo,
+	     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+	     JDIMENSION in_row_groups_avail,
+	     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+	     JDIMENSION out_rows_avail));
+#ifdef QUANT_2PASS_SUPPORTED
+METHODDEF(void) post_process_prepass
+	JPP((j_decompress_ptr cinfo,
+	     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+	     JDIMENSION in_row_groups_avail,
+	     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+	     JDIMENSION out_rows_avail));
+METHODDEF(void) post_process_2pass
+	JPP((j_decompress_ptr cinfo,
+	     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+	     JDIMENSION in_row_groups_avail,
+	     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+	     JDIMENSION out_rows_avail));
+#endif
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+  my_post_ptr post = (my_post_ptr) cinfo->post;
+
+  switch (pass_mode) {
+  case JBUF_PASS_THRU:
+    if (cinfo->quantize_colors) {
+      /* Single-pass processing with color quantization. */
+      post->pub.post_process_data = post_process_1pass;
+      /* We could be doing buffered-image output before starting a 2-pass
+       * color quantization; in that case, jinit_d_post_controller did not
+       * allocate a strip buffer.  Use the virtual-array buffer as workspace.
+       */
+      if (post->buffer == NULL) {
+	post->buffer = (*cinfo->mem->access_virt_sarray)
+	  ((j_common_ptr) cinfo, post->whole_image,
+	   (JDIMENSION) 0, post->strip_height, TRUE);
+      }
+    } else {
+      /* For single-pass processing without color quantization,
+       * I have no work to do; just call the upsampler directly.
+       */
+      post->pub.post_process_data = cinfo->upsample->upsample;
+    }
+    break;
+#ifdef QUANT_2PASS_SUPPORTED
+  case JBUF_SAVE_AND_PASS:
+    /* First pass of 2-pass quantization */
+    if (post->whole_image == NULL)
+      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+    post->pub.post_process_data = post_process_prepass;
+    break;
+  case JBUF_CRANK_DEST:
+    /* Second pass of 2-pass quantization */
+    if (post->whole_image == NULL)
+      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+    post->pub.post_process_data = post_process_2pass;
+    break;
+#endif /* QUANT_2PASS_SUPPORTED */
+  default:
+    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+    break;
+  }
+  post->starting_row = post->next_row = 0;
+}
+
+
+/*
+ * Process some data in the one-pass (strip buffer) case.
+ * This is used for color precision reduction as well as one-pass quantization.
+ */
+
+METHODDEF(void)
+post_process_1pass (j_decompress_ptr cinfo,
+		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+		    JDIMENSION in_row_groups_avail,
+		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+		    JDIMENSION out_rows_avail)
+{
+  my_post_ptr post = (my_post_ptr) cinfo->post;
+  JDIMENSION num_rows, max_rows;
+
+  /* Fill the buffer, but not more than what we can dump out in one go. */
+  /* Note we rely on the upsampler to detect bottom of image. */
+  max_rows = out_rows_avail - *out_row_ctr;
+  if (max_rows > post->strip_height)
+    max_rows = post->strip_height;
+  num_rows = 0;
+  (*cinfo->upsample->upsample) (cinfo,
+		input_buf, in_row_group_ctr, in_row_groups_avail,
+		post->buffer, &num_rows, max_rows);
+  /* Quantize and emit data. */
+  (*cinfo->cquantize->color_quantize) (cinfo,
+		post->buffer, output_buf + *out_row_ctr, (int) num_rows);
+  *out_row_ctr += num_rows;
+}
+
+
+#ifdef QUANT_2PASS_SUPPORTED
+
+/*
+ * Process some data in the first pass of 2-pass quantization.
+ */
+
+METHODDEF(void)
+post_process_prepass (j_decompress_ptr cinfo,
+		      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+		      JDIMENSION in_row_groups_avail,
+		      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+		      JDIMENSION out_rows_avail)
+{
+  my_post_ptr post = (my_post_ptr) cinfo->post;
+  JDIMENSION old_next_row, num_rows;
+
+  /* Reposition virtual buffer if at start of strip. */
+  if (post->next_row == 0) {
+    post->buffer = (*cinfo->mem->access_virt_sarray)
+	((j_common_ptr) cinfo, post->whole_image,
+	 post->starting_row, post->strip_height, TRUE);
+  }
+
+  /* Upsample some data (up to a strip height's worth). */
+  old_next_row = post->next_row;
+  (*cinfo->upsample->upsample) (cinfo,
+		input_buf, in_row_group_ctr, in_row_groups_avail,
+		post->buffer, &post->next_row, post->strip_height);
+
+  /* Allow quantizer to scan new data.  No data is emitted, */
+  /* but we advance out_row_ctr so outer loop can tell when we're done. */
+  if (post->next_row > old_next_row) {
+    num_rows = post->next_row - old_next_row;
+    (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,
+					 (JSAMPARRAY) NULL, (int) num_rows);
+    *out_row_ctr += num_rows;
+  }
+
+  /* Advance if we filled the strip. */
+  if (post->next_row >= post->strip_height) {
+    post->starting_row += post->strip_height;
+    post->next_row = 0;
+  }
+}
+
+
+/*
+ * Process some data in the second pass of 2-pass quantization.
+ */
+
+METHODDEF(void)
+post_process_2pass (j_decompress_ptr cinfo,
+		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+		    JDIMENSION in_row_groups_avail,
+		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+		    JDIMENSION out_rows_avail)
+{
+  my_post_ptr post = (my_post_ptr) cinfo->post;
+  JDIMENSION num_rows, max_rows;
+
+  /* Reposition virtual buffer if at start of strip. */
+  if (post->next_row == 0) {
+    post->buffer = (*cinfo->mem->access_virt_sarray)
+	((j_common_ptr) cinfo, post->whole_image,
+	 post->starting_row, post->strip_height, FALSE);
+  }
+
+  /* Determine number of rows to emit. */
+  num_rows = post->strip_height - post->next_row; /* available in strip */
+  max_rows = out_rows_avail - *out_row_ctr; /* available in output area */
+  if (num_rows > max_rows)
+    num_rows = max_rows;
+  /* We have to check bottom of image here, can't depend on upsampler. */
+  max_rows = cinfo->output_height - post->starting_row;
+  if (num_rows > max_rows)
+    num_rows = max_rows;
+
+  /* Quantize and emit data. */
+  (*cinfo->cquantize->color_quantize) (cinfo,
+		post->buffer + post->next_row, output_buf + *out_row_ctr,
+		(int) num_rows);
+  *out_row_ctr += num_rows;
+
+  /* Advance if we filled the strip. */
+  post->next_row += num_rows;
+  if (post->next_row >= post->strip_height) {
+    post->starting_row += post->strip_height;
+    post->next_row = 0;
+  }
+}
+
+#endif /* QUANT_2PASS_SUPPORTED */
+
+
+/*
+ * Initialize postprocessing controller.
+ */
+
+GLOBAL(void)
+jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
+{
+  my_post_ptr post;
+
+  post = (my_post_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_post_controller));
+  cinfo->post = (struct jpeg_d_post_controller *) post;
+  post->pub.start_pass = start_pass_dpost;
+  post->whole_image = NULL;	/* flag for no virtual arrays */
+  post->buffer = NULL;		/* flag for no strip buffer */
+
+  /* Create the quantization buffer, if needed */
+  if (cinfo->quantize_colors) {
+    /* The buffer strip height is max_v_samp_factor, which is typically
+     * an efficient number of rows for upsampling to return.
+     * (In the presence of output rescaling, we might want to be smarter?)
+     */
+    post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;
+    if (need_full_buffer) {
+      /* Two-pass color quantization: need full-image storage. */
+      /* We round up the number of rows to a multiple of the strip height. */
+#ifdef QUANT_2PASS_SUPPORTED
+      post->whole_image = (*cinfo->mem->request_virt_sarray)
+	((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+	 cinfo->output_width * cinfo->out_color_components,
+	 (JDIMENSION) jround_up((long) cinfo->output_height,
+				(long) post->strip_height),
+	 post->strip_height);
+#else
+      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+#endif /* QUANT_2PASS_SUPPORTED */
+    } else {
+      /* One-pass color quantization: just make a strip buffer. */
+      post->buffer = (*cinfo->mem->alloc_sarray)
+	((j_common_ptr) cinfo, JPOOL_IMAGE,
+	 cinfo->output_width * cinfo->out_color_components,
+	 post->strip_height);
+    }
+  }
+}
diff --git a/src/libjpeg/jdsample.c b/src/libjpeg/jdsample.c
new file mode 100644
index 0000000..e0d9040
--- /dev/null
+++ b/src/libjpeg/jdsample.c
@@ -0,0 +1,478 @@
+/*
+ * jdsample.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains upsampling routines.
+ *
+ * Upsampling input data is counted in "row groups".  A row group
+ * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
+ * sample rows of each component.  Upsampling will normally produce
+ * max_v_samp_factor pixel rows from each row group (but this could vary
+ * if the upsampler is applying a scale factor of its own).
+ *
+ * An excellent reference for image resampling is
+ *   Digital Image Warping, George Wolberg, 1990.
+ *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Pointer to routine to upsample a single component */
+typedef JMETHOD(void, upsample1_ptr,
+		(j_decompress_ptr cinfo, jpeg_component_info * compptr,
+		 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
+
+/* Private subobject */
+
+typedef struct {
+  struct jpeg_upsampler pub;	/* public fields */
+
+  /* Color conversion buffer.  When using separate upsampling and color
+   * conversion steps, this buffer holds one upsampled row group until it
+   * has been color converted and output.
+   * Note: we do not allocate any storage for component(s) which are full-size,
+   * ie do not need rescaling.  The corresponding entry of color_buf[] is
+   * simply set to point to the input data array, thereby avoiding copying.
+   */
+  JSAMPARRAY color_buf[MAX_COMPONENTS];
+
+  /* Per-component upsampling method pointers */
+  upsample1_ptr methods[MAX_COMPONENTS];
+
+  int next_row_out;		/* counts rows emitted from color_buf */
+  JDIMENSION rows_to_go;	/* counts rows remaining in image */
+
+  /* Height of an input row group for each component. */
+  int rowgroup_height[MAX_COMPONENTS];
+
+  /* These arrays save pixel expansion factors so that int_expand need not
+   * recompute them each time.  They are unused for other upsampling methods.
+   */
+  UINT8 h_expand[MAX_COMPONENTS];
+  UINT8 v_expand[MAX_COMPONENTS];
+} my_upsampler;
+
+typedef my_upsampler * my_upsample_ptr;
+
+
+/*
+ * Initialize for an upsampling pass.
+ */
+
+METHODDEF(void)
+start_pass_upsample (j_decompress_ptr cinfo)
+{
+  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+
+  /* Mark the conversion buffer empty */
+  upsample->next_row_out = cinfo->max_v_samp_factor;
+  /* Initialize total-height counter for detecting bottom of image */
+  upsample->rows_to_go = cinfo->output_height;
+}
+
+
+/*
+ * Control routine to do upsampling (and color conversion).
+ *
+ * In this version we upsample each component independently.
+ * We upsample one row group into the conversion buffer, then apply
+ * color conversion a row at a time.
+ */
+
+METHODDEF(void)
+sep_upsample (j_decompress_ptr cinfo,
+	      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+	      JDIMENSION in_row_groups_avail,
+	      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+	      JDIMENSION out_rows_avail)
+{
+  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+  int ci;
+  jpeg_component_info * compptr;
+  JDIMENSION num_rows;
+
+  /* Fill the conversion buffer, if it's empty */
+  if (upsample->next_row_out >= cinfo->max_v_samp_factor) {
+    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+	 ci++, compptr++) {
+      /* Invoke per-component upsample method.  Notice we pass a POINTER
+       * to color_buf[ci], so that fullsize_upsample can change it.
+       */
+      (*upsample->methods[ci]) (cinfo, compptr,
+	input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]),
+	upsample->color_buf + ci);
+    }
+    upsample->next_row_out = 0;
+  }
+
+  /* Color-convert and emit rows */
+
+  /* How many we have in the buffer: */
+  num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out);
+  /* Not more than the distance to the end of the image.  Need this test
+   * in case the image height is not a multiple of max_v_samp_factor:
+   */
+  if (num_rows > upsample->rows_to_go) 
+    num_rows = upsample->rows_to_go;
+  /* And not more than what the client can accept: */
+  out_rows_avail -= *out_row_ctr;
+  if (num_rows > out_rows_avail)
+    num_rows = out_rows_avail;
+
+  (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,
+				     (JDIMENSION) upsample->next_row_out,
+				     output_buf + *out_row_ctr,
+				     (int) num_rows);
+
+  /* Adjust counts */
+  *out_row_ctr += num_rows;
+  upsample->rows_to_go -= num_rows;
+  upsample->next_row_out += num_rows;
+  /* When the buffer is emptied, declare this input row group consumed */
+  if (upsample->next_row_out >= cinfo->max_v_samp_factor)
+    (*in_row_group_ctr)++;
+}
+
+
+/*
+ * These are the routines invoked by sep_upsample to upsample pixel values
+ * of a single component.  One row group is processed per call.
+ */
+
+
+/*
+ * For full-size components, we just make color_buf[ci] point at the
+ * input buffer, and thus avoid copying any data.  Note that this is
+ * safe only because sep_upsample doesn't declare the input row group
+ * "consumed" until we are done color converting and emitting it.
+ */
+
+METHODDEF(void)
+fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+		   JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+  *output_data_ptr = input_data;
+}
+
+
+/*
+ * This is a no-op version used for "uninteresting" components.
+ * These components will not be referenced by color conversion.
+ */
+
+METHODDEF(void)
+noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+  *output_data_ptr = NULL;	/* safety check */
+}
+
+
+/*
+ * This version handles any integral sampling ratios.
+ * This is not used for typical JPEG files, so it need not be fast.
+ * Nor, for that matter, is it particularly accurate: the algorithm is
+ * simple replication of the input pixel onto the corresponding output
+ * pixels.  The hi-falutin sampling literature refers to this as a
+ * "box filter".  A box filter tends to introduce visible artifacts,
+ * so if you are actually going to use 3:1 or 4:1 sampling ratios
+ * you would be well advised to improve this code.
+ */
+
+METHODDEF(void)
+int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	      JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+  JSAMPARRAY output_data = *output_data_ptr;
+  register JSAMPROW inptr, outptr;
+  register JSAMPLE invalue;
+  register int h;
+  JSAMPROW outend;
+  int h_expand, v_expand;
+  int inrow, outrow;
+
+  h_expand = upsample->h_expand[compptr->component_index];
+  v_expand = upsample->v_expand[compptr->component_index];
+
+  inrow = outrow = 0;
+  while (outrow < cinfo->max_v_samp_factor) {
+    /* Generate one output row with proper horizontal expansion */
+    inptr = input_data[inrow];
+    outptr = output_data[outrow];
+    outend = outptr + cinfo->output_width;
+    while (outptr < outend) {
+      invalue = *inptr++;	/* don't need GETJSAMPLE() here */
+      for (h = h_expand; h > 0; h--) {
+	*outptr++ = invalue;
+      }
+    }
+    /* Generate any additional output rows by duplicating the first one */
+    if (v_expand > 1) {
+      jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
+			v_expand-1, cinfo->output_width);
+    }
+    inrow++;
+    outrow += v_expand;
+  }
+}
+
+
+/*
+ * Fast processing for the common case of 2:1 horizontal and 1:1 vertical.
+ * It's still a box filter.
+ */
+
+METHODDEF(void)
+h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+  JSAMPARRAY output_data = *output_data_ptr;
+  register JSAMPROW inptr, outptr;
+  register JSAMPLE invalue;
+  JSAMPROW outend;
+  int inrow;
+
+  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
+    inptr = input_data[inrow];
+    outptr = output_data[inrow];
+    outend = outptr + cinfo->output_width;
+    while (outptr < outend) {
+      invalue = *inptr++;	/* don't need GETJSAMPLE() here */
+      *outptr++ = invalue;
+      *outptr++ = invalue;
+    }
+  }
+}
+
+
+/*
+ * Fast processing for the common case of 2:1 horizontal and 2:1 vertical.
+ * It's still a box filter.
+ */
+
+METHODDEF(void)
+h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+  JSAMPARRAY output_data = *output_data_ptr;
+  register JSAMPROW inptr, outptr;
+  register JSAMPLE invalue;
+  JSAMPROW outend;
+  int inrow, outrow;
+
+  inrow = outrow = 0;
+  while (outrow < cinfo->max_v_samp_factor) {
+    inptr = input_data[inrow];
+    outptr = output_data[outrow];
+    outend = outptr + cinfo->output_width;
+    while (outptr < outend) {
+      invalue = *inptr++;	/* don't need GETJSAMPLE() here */
+      *outptr++ = invalue;
+      *outptr++ = invalue;
+    }
+    jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
+		      1, cinfo->output_width);
+    inrow++;
+    outrow += 2;
+  }
+}
+
+
+/*
+ * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.
+ *
+ * The upsampling algorithm is linear interpolation between pixel centers,
+ * also known as a "triangle filter".  This is a good compromise between
+ * speed and visual quality.  The centers of the output pixels are 1/4 and 3/4
+ * of the way between input pixel centers.
+ *
+ * A note about the "bias" calculations: when rounding fractional values to
+ * integer, we do not want to always round 0.5 up to the next integer.
+ * If we did that, we'd introduce a noticeable bias towards larger values.
+ * Instead, this code is arranged so that 0.5 will be rounded up or down at
+ * alternate pixel locations (a simple ordered dither pattern).
+ */
+
+METHODDEF(void)
+h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+		     JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+  JSAMPARRAY output_data = *output_data_ptr;
+  register JSAMPROW inptr, outptr;
+  register int invalue;
+  register JDIMENSION colctr;
+  int inrow;
+
+  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
+    inptr = input_data[inrow];
+    outptr = output_data[inrow];
+    /* Special case for first column */
+    invalue = GETJSAMPLE(*inptr++);
+    *outptr++ = (JSAMPLE) invalue;
+    *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2);
+
+    for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
+      /* General case: 3/4 * nearer pixel + 1/4 * further pixel */
+      invalue = GETJSAMPLE(*inptr++) * 3;
+      *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2);
+      *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2);
+    }
+
+    /* Special case for last column */
+    invalue = GETJSAMPLE(*inptr);
+    *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2);
+    *outptr++ = (JSAMPLE) invalue;
+  }
+}
+
+
+/*
+ * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.
+ * Again a triangle filter; see comments for h2v1 case, above.
+ *
+ * It is OK for us to reference the adjacent input rows because we demanded
+ * context from the main buffer controller (see initialization code).
+ */
+
+METHODDEF(void)
+h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+		     JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+  JSAMPARRAY output_data = *output_data_ptr;
+  register JSAMPROW inptr0, inptr1, outptr;
+#if BITS_IN_JSAMPLE == 8
+  register int thiscolsum, lastcolsum, nextcolsum;
+#else
+  register INT32 thiscolsum, lastcolsum, nextcolsum;
+#endif
+  register JDIMENSION colctr;
+  int inrow, outrow, v;
+
+  inrow = outrow = 0;
+  while (outrow < cinfo->max_v_samp_factor) {
+    for (v = 0; v < 2; v++) {
+      /* inptr0 points to nearest input row, inptr1 points to next nearest */
+      inptr0 = input_data[inrow];
+      if (v == 0)		/* next nearest is row above */
+	inptr1 = input_data[inrow-1];
+      else			/* next nearest is row below */
+	inptr1 = input_data[inrow+1];
+      outptr = output_data[outrow++];
+
+      /* Special case for first column */
+      thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
+      nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
+      *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4);
+      *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
+      lastcolsum = thiscolsum; thiscolsum = nextcolsum;
+
+      for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
+	/* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */
+	/* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */
+	nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
+	*outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
+	*outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
+	lastcolsum = thiscolsum; thiscolsum = nextcolsum;
+      }
+
+      /* Special case for last column */
+      *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
+      *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4);
+    }
+    inrow++;
+  }
+}
+
+
+/*
+ * Module initialization routine for upsampling.
+ */
+
+GLOBAL(void)
+jinit_upsampler (j_decompress_ptr cinfo)
+{
+  my_upsample_ptr upsample;
+  int ci;
+  jpeg_component_info * compptr;
+  boolean need_buffer, do_fancy;
+  int h_in_group, v_in_group, h_out_group, v_out_group;
+
+  upsample = (my_upsample_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_upsampler));
+  cinfo->upsample = (struct jpeg_upsampler *) upsample;
+  upsample->pub.start_pass = start_pass_upsample;
+  upsample->pub.upsample = sep_upsample;
+  upsample->pub.need_context_rows = FALSE; /* until we find out differently */
+
+  if (cinfo->CCIR601_sampling)	/* this isn't supported */
+    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
+
+  /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1,
+   * so don't ask for it.
+   */
+  do_fancy = cinfo->do_fancy_upsampling && cinfo->min_DCT_scaled_size > 1;
+
+  /* Verify we can handle the sampling factors, select per-component methods,
+   * and create storage as needed.
+   */
+  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+       ci++, compptr++) {
+    /* Compute size of an "input group" after IDCT scaling.  This many samples
+     * are to be converted to max_h_samp_factor * max_v_samp_factor pixels.
+     */
+    h_in_group = (compptr->h_samp_factor * compptr->DCT_scaled_size) /
+		 cinfo->min_DCT_scaled_size;
+    v_in_group = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
+		 cinfo->min_DCT_scaled_size;
+    h_out_group = cinfo->max_h_samp_factor;
+    v_out_group = cinfo->max_v_samp_factor;
+    upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
+    need_buffer = TRUE;
+    if (! compptr->component_needed) {
+      /* Don't bother to upsample an uninteresting component. */
+      upsample->methods[ci] = noop_upsample;
+      need_buffer = FALSE;
+    } else if (h_in_group == h_out_group && v_in_group == v_out_group) {
+      /* Fullsize components can be processed without any work. */
+      upsample->methods[ci] = fullsize_upsample;
+      need_buffer = FALSE;
+    } else if (h_in_group * 2 == h_out_group &&
+	       v_in_group == v_out_group) {
+      /* Special cases for 2h1v upsampling */
+      if (do_fancy && compptr->downsampled_width > 2)
+	upsample->methods[ci] = h2v1_fancy_upsample;
+      else
+	upsample->methods[ci] = h2v1_upsample;
+    } else if (h_in_group * 2 == h_out_group &&
+	       v_in_group * 2 == v_out_group) {
+      /* Special cases for 2h2v upsampling */
+      if (do_fancy && compptr->downsampled_width > 2) {
+	upsample->methods[ci] = h2v2_fancy_upsample;
+	upsample->pub.need_context_rows = TRUE;
+      } else
+	upsample->methods[ci] = h2v2_upsample;
+    } else if ((h_out_group % h_in_group) == 0 &&
+	       (v_out_group % v_in_group) == 0) {
+      /* Generic integral-factors upsampling method */
+      upsample->methods[ci] = int_upsample;
+      upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group);
+      upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);
+    } else
+      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
+    if (need_buffer) {
+      upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
+	((j_common_ptr) cinfo, JPOOL_IMAGE,
+	 (JDIMENSION) jround_up((long) cinfo->output_width,
+				(long) cinfo->max_h_samp_factor),
+	 (JDIMENSION) cinfo->max_v_samp_factor);
+    }
+  }
+}
diff --git a/src/libjpeg/jdtrans.c b/src/libjpeg/jdtrans.c
new file mode 100644
index 0000000..12c193c
--- /dev/null
+++ b/src/libjpeg/jdtrans.c
@@ -0,0 +1,143 @@
+/*
+ * jdtrans.c
+ *
+ * Copyright (C) 1995-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains library routines for transcoding decompression,
+ * that is, reading raw DCT coefficient arrays from an input JPEG file.
+ * The routines in jdapimin.c will also be needed by a transcoder.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Forward declarations */
+LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo));
+
+
+/*
+ * Read the coefficient arrays from a JPEG file.
+ * jpeg_read_header must be completed before calling this.
+ *
+ * The entire image is read into a set of virtual coefficient-block arrays,
+ * one per component.  The return value is a pointer to the array of
+ * virtual-array descriptors.  These can be manipulated directly via the
+ * JPEG memory manager, or handed off to jpeg_write_coefficients().
+ * To release the memory occupied by the virtual arrays, call
+ * jpeg_finish_decompress() when done with the data.
+ *
+ * An alternative usage is to simply obtain access to the coefficient arrays
+ * during a buffered-image-mode decompression operation.  This is allowed
+ * after any jpeg_finish_output() call.  The arrays can be accessed until
+ * jpeg_finish_decompress() is called.  (Note that any call to the library
+ * may reposition the arrays, so don't rely on access_virt_barray() results
+ * to stay valid across library calls.)
+ *
+ * Returns NULL if suspended.  This case need be checked only if
+ * a suspending data source is used.
+ */
+
+GLOBAL(jvirt_barray_ptr *)
+jpeg_read_coefficients (j_decompress_ptr cinfo)
+{
+  if (cinfo->global_state == DSTATE_READY) {
+    /* First call: initialize active modules */
+    transdecode_master_selection(cinfo);
+    cinfo->global_state = DSTATE_RDCOEFS;
+  }
+  if (cinfo->global_state == DSTATE_RDCOEFS) {
+    /* Absorb whole file into the coef buffer */
+    for (;;) {
+      int retcode;
+      /* Call progress monitor hook if present */
+      if (cinfo->progress != NULL)
+	(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+      /* Absorb some more input */
+      retcode = (*cinfo->inputctl->consume_input) (cinfo);
+      if (retcode == JPEG_SUSPENDED)
+	return NULL;
+      if (retcode == JPEG_REACHED_EOI)
+	break;
+      /* Advance progress counter if appropriate */
+      if (cinfo->progress != NULL &&
+	  (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
+	if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
+	  /* startup underestimated number of scans; ratchet up one scan */
+	  cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
+	}
+      }
+    }
+    /* Set state so that jpeg_finish_decompress does the right thing */
+    cinfo->global_state = DSTATE_STOPPING;
+  }
+  /* At this point we should be in state DSTATE_STOPPING if being used
+   * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access
+   * to the coefficients during a full buffered-image-mode decompression.
+   */
+  if ((cinfo->global_state == DSTATE_STOPPING ||
+       cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) {
+    return cinfo->coef->coef_arrays;
+  }
+  /* Oops, improper usage */
+  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+  return NULL;			/* keep compiler happy */
+}
+
+
+/*
+ * Master selection of decompression modules for transcoding.
+ * This substitutes for jdmaster.c's initialization of the full decompressor.
+ */
+
+LOCAL(void)
+transdecode_master_selection (j_decompress_ptr cinfo)
+{
+  /* This is effectively a buffered-image operation. */
+  cinfo->buffered_image = TRUE;
+
+  /* Entropy decoding: either Huffman or arithmetic coding. */
+  if (cinfo->arith_code) {
+    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
+  } else {
+    if (cinfo->progressive_mode) {
+#ifdef D_PROGRESSIVE_SUPPORTED
+      jinit_phuff_decoder(cinfo);
+#else
+      ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+    } else
+      jinit_huff_decoder(cinfo);
+  }
+
+  /* Always get a full-image coefficient buffer. */
+  jinit_d_coef_controller(cinfo, TRUE);
+
+  /* We can now tell the memory manager to allocate virtual arrays. */
+  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
+
+  /* Initialize input side of decompressor to consume first scan. */
+  (*cinfo->inputctl->start_input_pass) (cinfo);
+
+  /* Initialize progress monitoring. */
+  if (cinfo->progress != NULL) {
+    int nscans;
+    /* Estimate number of scans to set pass_limit. */
+    if (cinfo->progressive_mode) {
+      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
+      nscans = 2 + 3 * cinfo->num_components;
+    } else if (cinfo->inputctl->has_multiple_scans) {
+      /* For a nonprogressive multiscan file, estimate 1 scan per component. */
+      nscans = cinfo->num_components;
+    } else {
+      nscans = 1;
+    }
+    cinfo->progress->pass_counter = 0L;
+    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
+    cinfo->progress->completed_passes = 0;
+    cinfo->progress->total_passes = 1;
+  }
+}
diff --git a/src/libjpeg/jerror.c b/src/libjpeg/jerror.c
new file mode 100644
index 0000000..c98aed7
--- /dev/null
+++ b/src/libjpeg/jerror.c
@@ -0,0 +1,252 @@
+/*
+ * jerror.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains simple error-reporting and trace-message routines.
+ * These are suitable for Unix-like systems and others where writing to
+ * stderr is the right thing to do.  Many applications will want to replace
+ * some or all of these routines.
+ *
+ * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile,
+ * you get a Windows-specific hack to display error messages in a dialog box.
+ * It ain't much, but it beats dropping error messages into the bit bucket,
+ * which is what happens to output to stderr under most Windows C compilers.
+ *
+ * These routines are used by both the compression and decompression code.
+ */
+
+/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jversion.h"
+#include "jerror.h"
+
+#ifdef USE_WINDOWS_MESSAGEBOX
+#include <windows.h>
+#endif
+
+#ifndef EXIT_FAILURE		/* define exit() codes if not provided */
+#define EXIT_FAILURE  1
+#endif
+
+
+/*
+ * Create the message string table.
+ * We do this from the master message list in jerror.h by re-reading
+ * jerror.h with a suitable definition for macro JMESSAGE.
+ * The message table is made an external symbol just in case any applications
+ * want to refer to it directly.
+ */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_std_message_table	jMsgTable
+#endif
+
+#define JMESSAGE(code,string)	string ,
+
+const char * const jpeg_std_message_table[] = {
+#include "jerror.h"
+  NULL
+};
+
+
+/*
+ * Error exit handler: must not return to caller.
+ *
+ * Applications may override this if they want to get control back after
+ * an error.  Typically one would longjmp somewhere instead of exiting.
+ * The setjmp buffer can be made a private field within an expanded error
+ * handler object.  Note that the info needed to generate an error message
+ * is stored in the error object, so you can generate the message now or
+ * later, at your convenience.
+ * You should make sure that the JPEG object is cleaned up (with jpeg_abort
+ * or jpeg_destroy) at some point.
+ */
+
+METHODDEF(void)
+error_exit (j_common_ptr cinfo)
+{
+  /* Always display the message */
+  (*cinfo->err->output_message) (cinfo);
+
+  /* Let the memory manager delete any temp files before we die */
+  jpeg_destroy(cinfo);
+
+  exit(EXIT_FAILURE);
+}
+
+
+/*
+ * Actual output of an error or trace message.
+ * Applications may override this method to send JPEG messages somewhere
+ * other than stderr.
+ *
+ * On Windows, printing to stderr is generally completely useless,
+ * so we provide optional code to produce an error-dialog popup.
+ * Most Windows applications will still prefer to override this routine,
+ * but if they don't, it'll do something at least marginally useful.
+ *
+ * NOTE: to use the library in an environment that doesn't support the
+ * C stdio library, you may have to delete the call to fprintf() entirely,
+ * not just not use this routine.
+ */
+
+METHODDEF(void)
+output_message (j_common_ptr cinfo)
+{
+  char buffer[JMSG_LENGTH_MAX];
+
+  /* Create the message */
+  (*cinfo->err->format_message) (cinfo, buffer);
+
+#ifdef USE_WINDOWS_MESSAGEBOX
+  /* Display it in a message dialog box */
+  MessageBox(GetActiveWindow(), buffer, "JPEG Library Error",
+	     MB_OK | MB_ICONERROR);
+#else
+  /* Send it to stderr, adding a newline */
+  fprintf(stderr, "%s\n", buffer);
+#endif
+}
+
+
+/*
+ * Decide whether to emit a trace or warning message.
+ * msg_level is one of:
+ *   -1: recoverable corrupt-data warning, may want to abort.
+ *    0: important advisory messages (always display to user).
+ *    1: first level of tracing detail.
+ *    2,3,...: successively more detailed tracing messages.
+ * An application might override this method if it wanted to abort on warnings
+ * or change the policy about which messages to display.
+ */
+
+METHODDEF(void)
+emit_message (j_common_ptr cinfo, int msg_level)
+{
+  struct jpeg_error_mgr * err = cinfo->err;
+
+  if (msg_level < 0) {
+    /* It's a warning message.  Since corrupt files may generate many warnings,
+     * the policy implemented here is to show only the first warning,
+     * unless trace_level >= 3.
+     */
+    if (err->num_warnings == 0 || err->trace_level >= 3)
+      (*err->output_message) (cinfo);
+    /* Always count warnings in num_warnings. */
+    err->num_warnings++;
+  } else {
+    /* It's a trace message.  Show it if trace_level >= msg_level. */
+    if (err->trace_level >= msg_level)
+      (*err->output_message) (cinfo);
+  }
+}
+
+
+/*
+ * Format a message string for the most recent JPEG error or message.
+ * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX
+ * characters.  Note that no '\n' character is added to the string.
+ * Few applications should need to override this method.
+ */
+
+METHODDEF(void)
+format_message (j_common_ptr cinfo, char * buffer)
+{
+  struct jpeg_error_mgr * err = cinfo->err;
+  int msg_code = err->msg_code;
+  const char * msgtext = NULL;
+  const char * msgptr;
+  char ch;
+  boolean isstring;
+
+  /* Look up message string in proper table */
+  if (msg_code > 0 && msg_code <= err->last_jpeg_message) {
+    msgtext = err->jpeg_message_table[msg_code];
+  } else if (err->addon_message_table != NULL &&
+	     msg_code >= err->first_addon_message &&
+	     msg_code <= err->last_addon_message) {
+    msgtext = err->addon_message_table[msg_code - err->first_addon_message];
+  }
+
+  /* Defend against bogus message number */
+  if (msgtext == NULL) {
+    err->msg_parm.i[0] = msg_code;
+    msgtext = err->jpeg_message_table[0];
+  }
+
+  /* Check for string parameter, as indicated by %s in the message text */
+  isstring = FALSE;
+  msgptr = msgtext;
+  while ((ch = *msgptr++) != '\0') {
+    if (ch == '%') {
+      if (*msgptr == 's') isstring = TRUE;
+      break;
+    }
+  }
+
+  /* Format the message into the passed buffer */
+  if (isstring)
+    sprintf(buffer, msgtext, err->msg_parm.s);
+  else
+    sprintf(buffer, msgtext,
+	    err->msg_parm.i[0], err->msg_parm.i[1],
+	    err->msg_parm.i[2], err->msg_parm.i[3],
+	    err->msg_parm.i[4], err->msg_parm.i[5],
+	    err->msg_parm.i[6], err->msg_parm.i[7]);
+}
+
+
+/*
+ * Reset error state variables at start of a new image.
+ * This is called during compression startup to reset trace/error
+ * processing to default state, without losing any application-specific
+ * method pointers.  An application might possibly want to override
+ * this method if it has additional error processing state.
+ */
+
+METHODDEF(void)
+reset_error_mgr (j_common_ptr cinfo)
+{
+  cinfo->err->num_warnings = 0;
+  /* trace_level is not reset since it is an application-supplied parameter */
+  cinfo->err->msg_code = 0;	/* may be useful as a flag for "no error" */
+}
+
+
+/*
+ * Fill in the standard error-handling methods in a jpeg_error_mgr object.
+ * Typical call is:
+ *	struct jpeg_compress_struct cinfo;
+ *	struct jpeg_error_mgr err;
+ *
+ *	cinfo.err = jpeg_std_error(&err);
+ * after which the application may override some of the methods.
+ */
+
+GLOBAL(struct jpeg_error_mgr *)
+jpeg_std_error (struct jpeg_error_mgr * err)
+{
+  err->error_exit = error_exit;
+  err->emit_message = emit_message;
+  err->output_message = output_message;
+  err->format_message = format_message;
+  err->reset_error_mgr = reset_error_mgr;
+
+  err->trace_level = 0;		/* default = no tracing */
+  err->num_warnings = 0;	/* no warnings emitted yet */
+  err->msg_code = 0;		/* may be useful as a flag for "no error" */
+
+  /* Initialize message table pointers */
+  err->jpeg_message_table = jpeg_std_message_table;
+  err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;
+
+  err->addon_message_table = NULL;
+  err->first_addon_message = 0;	/* for safety */
+  err->last_addon_message = 0;
+
+  return err;
+}
diff --git a/src/libjpeg/jerror.h b/src/libjpeg/jerror.h
new file mode 100644
index 0000000..79084f2
--- /dev/null
+++ b/src/libjpeg/jerror.h
@@ -0,0 +1,291 @@
+/*
+ * jerror.h
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the error and message codes for the JPEG library.
+ * Edit this file to add new codes, or to translate the message strings to
+ * some other language.
+ * A set of error-reporting macros are defined too.  Some applications using
+ * the JPEG library may wish to include this file to get the error codes
+ * and/or the macros.
+ */
+
+/*
+ * To define the enum list of message codes, include this file without
+ * defining macro JMESSAGE.  To create a message string table, include it
+ * again with a suitable JMESSAGE definition (see jerror.c for an example).
+ */
+#ifndef JMESSAGE
+#ifndef JERROR_H
+/* First time through, define the enum list */
+#define JMAKE_ENUM_LIST
+#else
+/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
+#define JMESSAGE(code,string)
+#endif /* JERROR_H */
+#endif /* JMESSAGE */
+
+#ifdef JMAKE_ENUM_LIST
+
+typedef enum {
+
+#define JMESSAGE(code,string)	code ,
+
+#endif /* JMAKE_ENUM_LIST */
+
+JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
+
+/* For maintenance convenience, list is alphabetical by message code name */
+JMESSAGE(JERR_ARITH_NOTIMPL,
+	 "Sorry, there are legal restrictions on arithmetic coding")
+JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
+JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
+JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
+JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
+JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
+JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
+JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
+JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
+JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
+JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
+JMESSAGE(JERR_BAD_LIB_VERSION,
+	 "Wrong JPEG library version: library is %d, caller expects %d")
+JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
+JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
+JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
+JMESSAGE(JERR_BAD_PROGRESSION,
+	 "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
+JMESSAGE(JERR_BAD_PROG_SCRIPT,
+	 "Invalid progressive parameters at scan script entry %d")
+JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
+JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
+JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
+JMESSAGE(JERR_BAD_STRUCT_SIZE,
+	 "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
+JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
+JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
+JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
+JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
+JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
+JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
+JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
+JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
+JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
+JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
+JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
+JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
+JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
+JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
+JMESSAGE(JERR_FILE_READ, "Input file read error")
+JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
+JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
+JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
+JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
+JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
+JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
+JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
+JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
+	 "Cannot transcode due to multiple use of quantization table %d")
+JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
+JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
+JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
+JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
+JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
+JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
+JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
+JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
+JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
+JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
+JMESSAGE(JERR_QUANT_COMPONENTS,
+	 "Cannot quantize more than %d color components")
+JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
+JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
+JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
+JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
+JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
+JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
+JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
+JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
+JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
+JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
+JMESSAGE(JERR_TFILE_WRITE,
+	 "Write failed on temporary file --- out of disk space?")
+JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
+JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
+JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
+JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
+JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
+JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
+JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
+JMESSAGE(JMSG_VERSION, JVERSION)
+JMESSAGE(JTRC_16BIT_TABLES,
+	 "Caution: quantization tables are too coarse for baseline JPEG")
+JMESSAGE(JTRC_ADOBE,
+	 "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
+JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
+JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
+JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
+JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
+JMESSAGE(JTRC_DQT, "Define Quantization Table %d  precision %d")
+JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
+JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
+JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
+JMESSAGE(JTRC_EOI, "End Of Image")
+JMESSAGE(JTRC_HUFFBITS, "        %3d %3d %3d %3d %3d %3d %3d %3d")
+JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d  %d")
+JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
+	 "Warning: thumbnail image size does not match data length %u")
+JMESSAGE(JTRC_JFIF_EXTENSION,
+	 "JFIF extension marker: type 0x%02x, length %u")
+JMESSAGE(JTRC_JFIF_THUMBNAIL, "    with %d x %d thumbnail image")
+JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
+JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
+JMESSAGE(JTRC_QUANTVALS, "        %4u %4u %4u %4u %4u %4u %4u %4u")
+JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
+JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
+JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
+JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
+JMESSAGE(JTRC_RST, "RST%d")
+JMESSAGE(JTRC_SMOOTH_NOTIMPL,
+	 "Smoothing not supported with nonstandard sampling ratios")
+JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
+JMESSAGE(JTRC_SOF_COMPONENT, "    Component %d: %dhx%dv q=%d")
+JMESSAGE(JTRC_SOI, "Start of Image")
+JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
+JMESSAGE(JTRC_SOS_COMPONENT, "    Component %d: dc=%d ac=%d")
+JMESSAGE(JTRC_SOS_PARAMS, "  Ss=%d, Se=%d, Ah=%d, Al=%d")
+JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
+JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
+JMESSAGE(JTRC_THUMB_JPEG,
+	 "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
+JMESSAGE(JTRC_THUMB_PALETTE,
+	 "JFIF extension marker: palette thumbnail image, length %u")
+JMESSAGE(JTRC_THUMB_RGB,
+	 "JFIF extension marker: RGB thumbnail image, length %u")
+JMESSAGE(JTRC_UNKNOWN_IDS,
+	 "Unrecognized component IDs %d %d %d, assuming YCbCr")
+JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
+JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
+JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
+JMESSAGE(JWRN_BOGUS_PROGRESSION,
+	 "Inconsistent progression sequence for component %d coefficient %d")
+JMESSAGE(JWRN_EXTRANEOUS_DATA,
+	 "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
+JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
+JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
+JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
+JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
+JMESSAGE(JWRN_MUST_RESYNC,
+	 "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
+JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
+JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
+
+#ifdef JMAKE_ENUM_LIST
+
+  JMSG_LASTMSGCODE
+} J_MESSAGE_CODE;
+
+#undef JMAKE_ENUM_LIST
+#endif /* JMAKE_ENUM_LIST */
+
+/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
+#undef JMESSAGE
+
+
+#ifndef JERROR_H
+#define JERROR_H
+
+/* Macros to simplify using the error and trace message stuff */
+/* The first parameter is either type of cinfo pointer */
+
+/* Fatal errors (print message and exit) */
+#define ERREXIT(cinfo,code)  \
+  ((cinfo)->err->msg_code = (code), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT1(cinfo,code,p1)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT2(cinfo,code,p1,p2)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT3(cinfo,code,p1,p2,p3)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (cinfo)->err->msg_parm.i[2] = (p3), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT4(cinfo,code,p1,p2,p3,p4)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (cinfo)->err->msg_parm.i[2] = (p3), \
+   (cinfo)->err->msg_parm.i[3] = (p4), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXITS(cinfo,code,str)  \
+  ((cinfo)->err->msg_code = (code), \
+   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+
+#define MAKESTMT(stuff)		do { stuff } while (0)
+
+/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
+#define WARNMS(cinfo,code)  \
+  ((cinfo)->err->msg_code = (code), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+#define WARNMS1(cinfo,code,p1)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+#define WARNMS2(cinfo,code,p1,p2)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+
+/* Informational/debugging messages */
+#define TRACEMS(cinfo,lvl,code)  \
+  ((cinfo)->err->msg_code = (code), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS1(cinfo,lvl,code,p1)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS2(cinfo,lvl,code,p1,p2)  \
+  ((cinfo)->err->msg_code = (code), \
+   (cinfo)->err->msg_parm.i[0] = (p1), \
+   (cinfo)->err->msg_parm.i[1] = (p2), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS3(cinfo,lvl,code,p1,p2,p3)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+	   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
+	   (cinfo)->err->msg_code = (code); \
+	   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+	   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+	   (cinfo)->err->msg_code = (code); \
+	   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+	   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+	   _mp[4] = (p5); \
+	   (cinfo)->err->msg_code = (code); \
+	   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8)  \
+  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+	   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+	   _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
+	   (cinfo)->err->msg_code = (code); \
+	   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMSS(cinfo,lvl,code,str)  \
+  ((cinfo)->err->msg_code = (code), \
+   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+
+#endif /* JERROR_H */
diff --git a/src/libjpeg/jfdctflt.c b/src/libjpeg/jfdctflt.c
new file mode 100644
index 0000000..7ccfb38
--- /dev/null
+++ b/src/libjpeg/jfdctflt.c
@@ -0,0 +1,168 @@
+/*
+ * jfdctflt.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a floating-point implementation of the
+ * forward DCT (Discrete Cosine Transform).
+ *
+ * This implementation should be more accurate than either of the integer
+ * DCT implementations.  However, it may not give the same results on all
+ * machines because of differences in roundoff behavior.  Speed will depend
+ * on the hardware's floating point capacity.
+ *
+ * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
+ * on each column.  Direct algorithms are also available, but they are
+ * much more complex and seem not to be any faster when reduced to code.
+ *
+ * This implementation is based on Arai, Agui, and Nakajima's algorithm for
+ * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in
+ * Japanese, but the algorithm is described in the Pennebaker & Mitchell
+ * JPEG textbook (see REFERENCES section in file README).  The following code
+ * is based directly on figure 4-8 in P&M.
+ * While an 8-point DCT cannot be done in less than 11 multiplies, it is
+ * possible to arrange the computation so that many of the multiplies are
+ * simple scalings of the final outputs.  These multiplies can then be
+ * folded into the multiplications or divisions by the JPEG quantization
+ * table entries.  The AA&N method leaves only 5 multiplies and 29 adds
+ * to be done in the DCT itself.
+ * The primary disadvantage of this method is that with a fixed-point
+ * implementation, accuracy is lost due to imprecise representation of the
+ * scaled quantization values.  However, that problem does not arise if
+ * we use floating point arithmetic.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h"		/* Private declarations for DCT subsystem */
+
+#ifdef DCT_FLOAT_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/*
+ * Perform the forward DCT on one block of samples.
+ */
+
+GLOBAL(void)
+jpeg_fdct_float (FAST_FLOAT * data)
+{
+  FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+  FAST_FLOAT tmp10, tmp11, tmp12, tmp13;
+  FAST_FLOAT z1, z2, z3, z4, z5, z11, z13;
+  FAST_FLOAT *dataptr;
+  int ctr;
+
+  /* Pass 1: process rows. */
+
+  dataptr = data;
+  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
+    tmp0 = dataptr[0] + dataptr[7];
+    tmp7 = dataptr[0] - dataptr[7];
+    tmp1 = dataptr[1] + dataptr[6];
+    tmp6 = dataptr[1] - dataptr[6];
+    tmp2 = dataptr[2] + dataptr[5];
+    tmp5 = dataptr[2] - dataptr[5];
+    tmp3 = dataptr[3] + dataptr[4];
+    tmp4 = dataptr[3] - dataptr[4];
+    
+    /* Even part */
+    
+    tmp10 = tmp0 + tmp3;	/* phase 2 */
+    tmp13 = tmp0 - tmp3;
+    tmp11 = tmp1 + tmp2;
+    tmp12 = tmp1 - tmp2;
+    
+    dataptr[0] = tmp10 + tmp11; /* phase 3 */
+    dataptr[4] = tmp10 - tmp11;
+    
+    z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */
+    dataptr[2] = tmp13 + z1;	/* phase 5 */
+    dataptr[6] = tmp13 - z1;
+    
+    /* Odd part */
+
+    tmp10 = tmp4 + tmp5;	/* phase 2 */
+    tmp11 = tmp5 + tmp6;
+    tmp12 = tmp6 + tmp7;
+
+    /* The rotator is modified from fig 4-8 to avoid extra negations. */
+    z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */
+    z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */
+    z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */
+    z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */
+
+    z11 = tmp7 + z3;		/* phase 5 */
+    z13 = tmp7 - z3;
+
+    dataptr[5] = z13 + z2;	/* phase 6 */
+    dataptr[3] = z13 - z2;
+    dataptr[1] = z11 + z4;
+    dataptr[7] = z11 - z4;
+
+    dataptr += DCTSIZE;		/* advance pointer to next row */
+  }
+
+  /* Pass 2: process columns. */
+
+  dataptr = data;
+  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
+    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
+    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
+    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
+    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
+    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
+    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
+    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
+    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
+    
+    /* Even part */
+    
+    tmp10 = tmp0 + tmp3;	/* phase 2 */
+    tmp13 = tmp0 - tmp3;
+    tmp11 = tmp1 + tmp2;
+    tmp12 = tmp1 - tmp2;
+    
+    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
+    dataptr[DCTSIZE*4] = tmp10 - tmp11;
+    
+    z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */
+    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
+    dataptr[DCTSIZE*6] = tmp13 - z1;
+    
+    /* Odd part */
+
+    tmp10 = tmp4 + tmp5;	/* phase 2 */
+    tmp11 = tmp5 + tmp6;
+    tmp12 = tmp6 + tmp7;
+
+    /* The rotator is modified from fig 4-8 to avoid extra negations. */
+    z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */
+    z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */
+    z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */
+    z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */
+
+    z11 = tmp7 + z3;		/* phase 5 */
+    z13 = tmp7 - z3;
+
+    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
+    dataptr[DCTSIZE*3] = z13 - z2;
+    dataptr[DCTSIZE*1] = z11 + z4;
+    dataptr[DCTSIZE*7] = z11 - z4;
+
+    dataptr++;			/* advance pointer to next column */
+  }
+}
+
+#endif /* DCT_FLOAT_SUPPORTED */
diff --git a/src/libjpeg/jfdctfst.c b/src/libjpeg/jfdctfst.c
new file mode 100644
index 0000000..005a74f
--- /dev/null
+++ b/src/libjpeg/jfdctfst.c
@@ -0,0 +1,224 @@
+/*
+ * jfdctfst.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a fast, not so accurate integer implementation of the
+ * forward DCT (Discrete Cosine Transform).
+ *
+ * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
+ * on each column.  Direct algorithms are also available, but they are
+ * much more complex and seem not to be any faster when reduced to code.
+ *
+ * This implementation is based on Arai, Agui, and Nakajima's algorithm for
+ * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in
+ * Japanese, but the algorithm is described in the Pennebaker & Mitchell
+ * JPEG textbook (see REFERENCES section in file README).  The following code
+ * is based directly on figure 4-8 in P&M.
+ * While an 8-point DCT cannot be done in less than 11 multiplies, it is
+ * possible to arrange the computation so that many of the multiplies are
+ * simple scalings of the final outputs.  These multiplies can then be
+ * folded into the multiplications or divisions by the JPEG quantization
+ * table entries.  The AA&N method leaves only 5 multiplies and 29 adds
+ * to be done in the DCT itself.
+ * The primary disadvantage of this method is that with fixed-point math,
+ * accuracy is lost due to imprecise representation of the scaled
+ * quantization values.  The smaller the quantization table entry, the less
+ * precise the scaled value, so this implementation does worse with high-
+ * quality-setting files than with low-quality ones.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h"		/* Private declarations for DCT subsystem */
+
+#ifdef DCT_IFAST_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/* Scaling decisions are generally the same as in the LL&M algorithm;
+ * see jfdctint.c for more details.  However, we choose to descale
+ * (right shift) multiplication products as soon as they are formed,
+ * rather than carrying additional fractional bits into subsequent additions.
+ * This compromises accuracy slightly, but it lets us save a few shifts.
+ * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
+ * everywhere except in the multiplications proper; this saves a good deal
+ * of work on 16-bit-int machines.
+ *
+ * Again to save a few shifts, the intermediate results between pass 1 and
+ * pass 2 are not upscaled, but are represented only to integral precision.
+ *
+ * A final compromise is to represent the multiplicative constants to only
+ * 8 fractional bits, rather than 13.  This saves some shifting work on some
+ * machines, and may also reduce the cost of multiplication (since there
+ * are fewer one-bits in the constants).
+ */
+
+#define CONST_BITS  8
+
+
+/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
+ * causing a lot of useless floating-point operations at run time.
+ * To get around this we use the following pre-calculated constants.
+ * If you change CONST_BITS you may want to add appropriate values.
+ * (With a reasonable C compiler, you can just rely on the FIX() macro...)
+ */
+
+#if CONST_BITS == 8
+#define FIX_0_382683433  ((INT32)   98)		/* FIX(0.382683433) */
+#define FIX_0_541196100  ((INT32)  139)		/* FIX(0.541196100) */
+#define FIX_0_707106781  ((INT32)  181)		/* FIX(0.707106781) */
+#define FIX_1_306562965  ((INT32)  334)		/* FIX(1.306562965) */
+#else
+#define FIX_0_382683433  FIX(0.382683433)
+#define FIX_0_541196100  FIX(0.541196100)
+#define FIX_0_707106781  FIX(0.707106781)
+#define FIX_1_306562965  FIX(1.306562965)
+#endif
+
+
+/* We can gain a little more speed, with a further compromise in accuracy,
+ * by omitting the addition in a descaling shift.  This yields an incorrectly
+ * rounded result half the time...
+ */
+
+#ifndef USE_ACCURATE_ROUNDING
+#undef DESCALE
+#define DESCALE(x,n)  RIGHT_SHIFT(x, n)
+#endif
+
+
+/* Multiply a DCTELEM variable by an INT32 constant, and immediately
+ * descale to yield a DCTELEM result.
+ */
+
+#define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
+
+
+/*
+ * Perform the forward DCT on one block of samples.
+ */
+
+GLOBAL(void)
+jpeg_fdct_ifast (DCTELEM * data)
+{
+  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+  DCTELEM tmp10, tmp11, tmp12, tmp13;
+  DCTELEM z1, z2, z3, z4, z5, z11, z13;
+  DCTELEM *dataptr;
+  int ctr;
+  SHIFT_TEMPS
+
+  /* Pass 1: process rows. */
+
+  dataptr = data;
+  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
+    tmp0 = dataptr[0] + dataptr[7];
+    tmp7 = dataptr[0] - dataptr[7];
+    tmp1 = dataptr[1] + dataptr[6];
+    tmp6 = dataptr[1] - dataptr[6];
+    tmp2 = dataptr[2] + dataptr[5];
+    tmp5 = dataptr[2] - dataptr[5];
+    tmp3 = dataptr[3] + dataptr[4];
+    tmp4 = dataptr[3] - dataptr[4];
+    
+    /* Even part */
+    
+    tmp10 = tmp0 + tmp3;	/* phase 2 */
+    tmp13 = tmp0 - tmp3;
+    tmp11 = tmp1 + tmp2;
+    tmp12 = tmp1 - tmp2;
+    
+    dataptr[0] = tmp10 + tmp11; /* phase 3 */
+    dataptr[4] = tmp10 - tmp11;
+    
+    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
+    dataptr[2] = tmp13 + z1;	/* phase 5 */
+    dataptr[6] = tmp13 - z1;
+    
+    /* Odd part */
+
+    tmp10 = tmp4 + tmp5;	/* phase 2 */
+    tmp11 = tmp5 + tmp6;
+    tmp12 = tmp6 + tmp7;
+
+    /* The rotator is modified from fig 4-8 to avoid extra negations. */
+    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
+    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
+    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
+    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
+
+    z11 = tmp7 + z3;		/* phase 5 */
+    z13 = tmp7 - z3;
+
+    dataptr[5] = z13 + z2;	/* phase 6 */
+    dataptr[3] = z13 - z2;
+    dataptr[1] = z11 + z4;
+    dataptr[7] = z11 - z4;
+
+    dataptr += DCTSIZE;		/* advance pointer to next row */
+  }
+
+  /* Pass 2: process columns. */
+
+  dataptr = data;
+  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
+    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
+    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
+    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
+    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
+    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
+    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
+    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
+    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
+    
+    /* Even part */
+    
+    tmp10 = tmp0 + tmp3;	/* phase 2 */
+    tmp13 = tmp0 - tmp3;
+    tmp11 = tmp1 + tmp2;
+    tmp12 = tmp1 - tmp2;
+    
+    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
+    dataptr[DCTSIZE*4] = tmp10 - tmp11;
+    
+    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
+    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
+    dataptr[DCTSIZE*6] = tmp13 - z1;
+    
+    /* Odd part */
+
+    tmp10 = tmp4 + tmp5;	/* phase 2 */
+    tmp11 = tmp5 + tmp6;
+    tmp12 = tmp6 + tmp7;
+
+    /* The rotator is modified from fig 4-8 to avoid extra negations. */
+    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
+    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
+    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
+    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
+
+    z11 = tmp7 + z3;		/* phase 5 */
+    z13 = tmp7 - z3;
+
+    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
+    dataptr[DCTSIZE*3] = z13 - z2;
+    dataptr[DCTSIZE*1] = z11 + z4;
+    dataptr[DCTSIZE*7] = z11 - z4;
+
+    dataptr++;			/* advance pointer to next column */
+  }
+}
+
+#endif /* DCT_IFAST_SUPPORTED */
diff --git a/src/libjpeg/jfdctint.c b/src/libjpeg/jfdctint.c
new file mode 100644
index 0000000..d626927
--- /dev/null
+++ b/src/libjpeg/jfdctint.c
@@ -0,0 +1,283 @@
+/*
+ * jfdctint.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a slow-but-accurate integer implementation of the
+ * forward DCT (Discrete Cosine Transform).
+ *
+ * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
+ * on each column.  Direct algorithms are also available, but they are
+ * much more complex and seem not to be any faster when reduced to code.
+ *
+ * This implementation is based on an algorithm described in
+ *   C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
+ *   Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
+ *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
+ * The primary algorithm described there uses 11 multiplies and 29 adds.
+ * We use their alternate method with 12 multiplies and 32 adds.
+ * The advantage of this method is that no data path contains more than one
+ * multiplication; this allows a very simple and accurate implementation in
+ * scaled fixed-point arithmetic, with a minimal number of shifts.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h"		/* Private declarations for DCT subsystem */
+
+#ifdef DCT_ISLOW_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/*
+ * The poop on this scaling stuff is as follows:
+ *
+ * Each 1-D DCT step produces outputs which are a factor of sqrt(N)
+ * larger than the true DCT outputs.  The final outputs are therefore
+ * a factor of N larger than desired; since N=8 this can be cured by
+ * a simple right shift at the end of the algorithm.  The advantage of
+ * this arrangement is that we save two multiplications per 1-D DCT,
+ * because the y0 and y4 outputs need not be divided by sqrt(N).
+ * In the IJG code, this factor of 8 is removed by the quantization step
+ * (in jcdctmgr.c), NOT in this module.
+ *
+ * We have to do addition and subtraction of the integer inputs, which
+ * is no problem, and multiplication by fractional constants, which is
+ * a problem to do in integer arithmetic.  We multiply all the constants
+ * by CONST_SCALE and convert them to integer constants (thus retaining
+ * CONST_BITS bits of precision in the constants).  After doing a
+ * multiplication we have to divide the product by CONST_SCALE, with proper
+ * rounding, to produce the correct output.  This division can be done
+ * cheaply as a right shift of CONST_BITS bits.  We postpone shifting
+ * as long as possible so that partial sums can be added together with
+ * full fractional precision.
+ *
+ * The outputs of the first pass are scaled up by PASS1_BITS bits so that
+ * they are represented to better-than-integral precision.  These outputs
+ * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
+ * with the recommended scaling.  (For 12-bit sample data, the intermediate
+ * array is INT32 anyway.)
+ *
+ * To avoid overflow of the 32-bit intermediate results in pass 2, we must
+ * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis
+ * shows that the values given below are the most effective.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define CONST_BITS  13
+#define PASS1_BITS  2
+#else
+#define CONST_BITS  13
+#define PASS1_BITS  1		/* lose a little precision to avoid overflow */
+#endif
+
+/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
+ * causing a lot of useless floating-point operations at run time.
+ * To get around this we use the following pre-calculated constants.
+ * If you change CONST_BITS you may want to add appropriate values.
+ * (With a reasonable C compiler, you can just rely on the FIX() macro...)
+ */
+
+#if CONST_BITS == 13
+#define FIX_0_298631336  ((INT32)  2446)	/* FIX(0.298631336) */
+#define FIX_0_390180644  ((INT32)  3196)	/* FIX(0.390180644) */
+#define FIX_0_541196100  ((INT32)  4433)	/* FIX(0.541196100) */
+#define FIX_0_765366865  ((INT32)  6270)	/* FIX(0.765366865) */
+#define FIX_0_899976223  ((INT32)  7373)	/* FIX(0.899976223) */
+#define FIX_1_175875602  ((INT32)  9633)	/* FIX(1.175875602) */
+#define FIX_1_501321110  ((INT32)  12299)	/* FIX(1.501321110) */
+#define FIX_1_847759065  ((INT32)  15137)	/* FIX(1.847759065) */
+#define FIX_1_961570560  ((INT32)  16069)	/* FIX(1.961570560) */
+#define FIX_2_053119869  ((INT32)  16819)	/* FIX(2.053119869) */
+#define FIX_2_562915447  ((INT32)  20995)	/* FIX(2.562915447) */
+#define FIX_3_072711026  ((INT32)  25172)	/* FIX(3.072711026) */
+#else
+#define FIX_0_298631336  FIX(0.298631336)
+#define FIX_0_390180644  FIX(0.390180644)
+#define FIX_0_541196100  FIX(0.541196100)
+#define FIX_0_765366865  FIX(0.765366865)
+#define FIX_0_899976223  FIX(0.899976223)
+#define FIX_1_175875602  FIX(1.175875602)
+#define FIX_1_501321110  FIX(1.501321110)
+#define FIX_1_847759065  FIX(1.847759065)
+#define FIX_1_961570560  FIX(1.961570560)
+#define FIX_2_053119869  FIX(2.053119869)
+#define FIX_2_562915447  FIX(2.562915447)
+#define FIX_3_072711026  FIX(3.072711026)
+#endif
+
+
+/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
+ * For 8-bit samples with the recommended scaling, all the variable
+ * and constant values involved are no more than 16 bits wide, so a
+ * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
+ * For 12-bit samples, a full 32-bit multiplication will be needed.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)
+#else
+#define MULTIPLY(var,const)  ((var) * (const))
+#endif
+
+
+/*
+ * Perform the forward DCT on one block of samples.
+ */
+
+GLOBAL(void)
+jpeg_fdct_islow (DCTELEM * data)
+{
+  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+  INT32 tmp10, tmp11, tmp12, tmp13;
+  INT32 z1, z2, z3, z4, z5;
+  DCTELEM *dataptr;
+  int ctr;
+  SHIFT_TEMPS
+
+  /* Pass 1: process rows. */
+  /* Note results are scaled up by sqrt(8) compared to a true DCT; */
+  /* furthermore, we scale the results by 2**PASS1_BITS. */
+
+  dataptr = data;
+  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
+    tmp0 = dataptr[0] + dataptr[7];
+    tmp7 = dataptr[0] - dataptr[7];
+    tmp1 = dataptr[1] + dataptr[6];
+    tmp6 = dataptr[1] - dataptr[6];
+    tmp2 = dataptr[2] + dataptr[5];
+    tmp5 = dataptr[2] - dataptr[5];
+    tmp3 = dataptr[3] + dataptr[4];
+    tmp4 = dataptr[3] - dataptr[4];
+    
+    /* Even part per LL&M figure 1 --- note that published figure is faulty;
+     * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
+     */
+    
+    tmp10 = tmp0 + tmp3;
+    tmp13 = tmp0 - tmp3;
+    tmp11 = tmp1 + tmp2;
+    tmp12 = tmp1 - tmp2;
+    
+    dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS);
+    dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
+    
+    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
+    dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
+				   CONST_BITS-PASS1_BITS);
+    dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
+				   CONST_BITS-PASS1_BITS);
+    
+    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
+     * cK represents cos(K*pi/16).
+     * i0..i3 in the paper are tmp4..tmp7 here.
+     */
+    
+    z1 = tmp4 + tmp7;
+    z2 = tmp5 + tmp6;
+    z3 = tmp4 + tmp6;
+    z4 = tmp5 + tmp7;
+    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
+    
+    tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
+    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
+    tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
+    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
+    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
+    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
+    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
+    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
+    
+    z3 += z5;
+    z4 += z5;
+    
+    dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
+    dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
+    dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
+    dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
+    
+    dataptr += DCTSIZE;		/* advance pointer to next row */
+  }
+
+  /* Pass 2: process columns.
+   * We remove the PASS1_BITS scaling, but leave the results scaled up
+   * by an overall factor of 8.
+   */
+
+  dataptr = data;
+  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
+    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
+    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
+    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
+    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
+    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
+    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
+    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
+    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
+    
+    /* Even part per LL&M figure 1 --- note that published figure is faulty;
+     * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
+     */
+    
+    tmp10 = tmp0 + tmp3;
+    tmp13 = tmp0 - tmp3;
+    tmp11 = tmp1 + tmp2;
+    tmp12 = tmp1 - tmp2;
+    
+    dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
+    dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
+    
+    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
+    dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
+					   CONST_BITS+PASS1_BITS);
+    dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
+					   CONST_BITS+PASS1_BITS);
+    
+    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
+     * cK represents cos(K*pi/16).
+     * i0..i3 in the paper are tmp4..tmp7 here.
+     */
+    
+    z1 = tmp4 + tmp7;
+    z2 = tmp5 + tmp6;
+    z3 = tmp4 + tmp6;
+    z4 = tmp5 + tmp7;
+    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
+    
+    tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
+    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
+    tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
+    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
+    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
+    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
+    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
+    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
+    
+    z3 += z5;
+    z4 += z5;
+    
+    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3,
+					   CONST_BITS+PASS1_BITS);
+    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4,
+					   CONST_BITS+PASS1_BITS);
+    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3,
+					   CONST_BITS+PASS1_BITS);
+    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4,
+					   CONST_BITS+PASS1_BITS);
+    
+    dataptr++;			/* advance pointer to next column */
+  }
+}
+
+#endif /* DCT_ISLOW_SUPPORTED */
diff --git a/src/libjpeg/jidctflt.c b/src/libjpeg/jidctflt.c
new file mode 100644
index 0000000..5fea54c
--- /dev/null
+++ b/src/libjpeg/jidctflt.c
@@ -0,0 +1,242 @@
+/*
+ * jidctflt.c
+ *
+ * Copyright (C) 1994-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a floating-point implementation of the
+ * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine
+ * must also perform dequantization of the input coefficients.
+ *
+ * This implementation should be more accurate than either of the integer
+ * IDCT implementations.  However, it may not give the same results on all
+ * machines because of differences in roundoff behavior.  Speed will depend
+ * on the hardware's floating point capacity.
+ *
+ * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
+ * on each row (or vice versa, but it's more convenient to emit a row at
+ * a time).  Direct algorithms are also available, but they are much more
+ * complex and seem not to be any faster when reduced to code.
+ *
+ * This implementation is based on Arai, Agui, and Nakajima's algorithm for
+ * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in
+ * Japanese, but the algorithm is described in the Pennebaker & Mitchell
+ * JPEG textbook (see REFERENCES section in file README).  The following code
+ * is based directly on figure 4-8 in P&M.
+ * While an 8-point DCT cannot be done in less than 11 multiplies, it is
+ * possible to arrange the computation so that many of the multiplies are
+ * simple scalings of the final outputs.  These multiplies can then be
+ * folded into the multiplications or divisions by the JPEG quantization
+ * table entries.  The AA&N method leaves only 5 multiplies and 29 adds
+ * to be done in the DCT itself.
+ * The primary disadvantage of this method is that with a fixed-point
+ * implementation, accuracy is lost due to imprecise representation of the
+ * scaled quantization values.  However, that problem does not arise if
+ * we use floating point arithmetic.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h"		/* Private declarations for DCT subsystem */
+
+#ifdef DCT_FLOAT_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/* Dequantize a coefficient by multiplying it by the multiplier-table
+ * entry; produce a float result.
+ */
+
+#define DEQUANTIZE(coef,quantval)  (((FAST_FLOAT) (coef)) * (quantval))
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients.
+ */
+
+GLOBAL(void)
+jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+		 JCOEFPTR coef_block,
+		 JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+  FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+  FAST_FLOAT tmp10, tmp11, tmp12, tmp13;
+  FAST_FLOAT z5, z10, z11, z12, z13;
+  JCOEFPTR inptr;
+  FLOAT_MULT_TYPE * quantptr;
+  FAST_FLOAT * wsptr;
+  JSAMPROW outptr;
+  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+  int ctr;
+  FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */
+  SHIFT_TEMPS
+
+  /* Pass 1: process columns from input, store into work array. */
+
+  inptr = coef_block;
+  quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table;
+  wsptr = workspace;
+  for (ctr = DCTSIZE; ctr > 0; ctr--) {
+    /* Due to quantization, we will usually find that many of the input
+     * coefficients are zero, especially the AC terms.  We can exploit this
+     * by short-circuiting the IDCT calculation for any column in which all
+     * the AC terms are zero.  In that case each output is equal to the
+     * DC coefficient (with scale factor as needed).
+     * With typical images and quantization tables, half or more of the
+     * column DCT calculations can be simplified this way.
+     */
+    
+    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
+	inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
+	inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
+	inptr[DCTSIZE*7] == 0) {
+      /* AC terms all zero */
+      FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+      
+      wsptr[DCTSIZE*0] = dcval;
+      wsptr[DCTSIZE*1] = dcval;
+      wsptr[DCTSIZE*2] = dcval;
+      wsptr[DCTSIZE*3] = dcval;
+      wsptr[DCTSIZE*4] = dcval;
+      wsptr[DCTSIZE*5] = dcval;
+      wsptr[DCTSIZE*6] = dcval;
+      wsptr[DCTSIZE*7] = dcval;
+      
+      inptr++;			/* advance pointers to next column */
+      quantptr++;
+      wsptr++;
+      continue;
+    }
+    
+    /* Even part */
+
+    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
+    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
+    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
+
+    tmp10 = tmp0 + tmp2;	/* phase 3 */
+    tmp11 = tmp0 - tmp2;
+
+    tmp13 = tmp1 + tmp3;	/* phases 5-3 */
+    tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */
+
+    tmp0 = tmp10 + tmp13;	/* phase 2 */
+    tmp3 = tmp10 - tmp13;
+    tmp1 = tmp11 + tmp12;
+    tmp2 = tmp11 - tmp12;
+    
+    /* Odd part */
+
+    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
+    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
+    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
+    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
+
+    z13 = tmp6 + tmp5;		/* phase 6 */
+    z10 = tmp6 - tmp5;
+    z11 = tmp4 + tmp7;
+    z12 = tmp4 - tmp7;
+
+    tmp7 = z11 + z13;		/* phase 5 */
+    tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */
+
+    z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
+    tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */
+    tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */
+
+    tmp6 = tmp12 - tmp7;	/* phase 2 */
+    tmp5 = tmp11 - tmp6;
+    tmp4 = tmp10 + tmp5;
+
+    wsptr[DCTSIZE*0] = tmp0 + tmp7;
+    wsptr[DCTSIZE*7] = tmp0 - tmp7;
+    wsptr[DCTSIZE*1] = tmp1 + tmp6;
+    wsptr[DCTSIZE*6] = tmp1 - tmp6;
+    wsptr[DCTSIZE*2] = tmp2 + tmp5;
+    wsptr[DCTSIZE*5] = tmp2 - tmp5;
+    wsptr[DCTSIZE*4] = tmp3 + tmp4;
+    wsptr[DCTSIZE*3] = tmp3 - tmp4;
+
+    inptr++;			/* advance pointers to next column */
+    quantptr++;
+    wsptr++;
+  }
+  
+  /* Pass 2: process rows from work array, store into output array. */
+  /* Note that we must descale the results by a factor of 8 == 2**3. */
+
+  wsptr = workspace;
+  for (ctr = 0; ctr < DCTSIZE; ctr++) {
+    outptr = output_buf[ctr] + output_col;
+    /* Rows of zeroes can be exploited in the same way as we did with columns.
+     * However, the column calculation has created many nonzero AC terms, so
+     * the simplification applies less often (typically 5% to 10% of the time).
+     * And testing floats for zero is relatively expensive, so we don't bother.
+     */
+    
+    /* Even part */
+
+    tmp10 = wsptr[0] + wsptr[4];
+    tmp11 = wsptr[0] - wsptr[4];
+
+    tmp13 = wsptr[2] + wsptr[6];
+    tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13;
+
+    tmp0 = tmp10 + tmp13;
+    tmp3 = tmp10 - tmp13;
+    tmp1 = tmp11 + tmp12;
+    tmp2 = tmp11 - tmp12;
+
+    /* Odd part */
+
+    z13 = wsptr[5] + wsptr[3];
+    z10 = wsptr[5] - wsptr[3];
+    z11 = wsptr[1] + wsptr[7];
+    z12 = wsptr[1] - wsptr[7];
+
+    tmp7 = z11 + z13;
+    tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562);
+
+    z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
+    tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */
+    tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */
+
+    tmp6 = tmp12 - tmp7;
+    tmp5 = tmp11 - tmp6;
+    tmp4 = tmp10 + tmp5;
+
+    /* Final output stage: scale down by a factor of 8 and range-limit */
+
+    outptr[0] = range_limit[(int) DESCALE((INT32) (tmp0 + tmp7), 3)
+			    & RANGE_MASK];
+    outptr[7] = range_limit[(int) DESCALE((INT32) (tmp0 - tmp7), 3)
+			    & RANGE_MASK];
+    outptr[1] = range_limit[(int) DESCALE((INT32) (tmp1 + tmp6), 3)
+			    & RANGE_MASK];
+    outptr[6] = range_limit[(int) DESCALE((INT32) (tmp1 - tmp6), 3)
+			    & RANGE_MASK];
+    outptr[2] = range_limit[(int) DESCALE((INT32) (tmp2 + tmp5), 3)
+			    & RANGE_MASK];
+    outptr[5] = range_limit[(int) DESCALE((INT32) (tmp2 - tmp5), 3)
+			    & RANGE_MASK];
+    outptr[4] = range_limit[(int) DESCALE((INT32) (tmp3 + tmp4), 3)
+			    & RANGE_MASK];
+    outptr[3] = range_limit[(int) DESCALE((INT32) (tmp3 - tmp4), 3)
+			    & RANGE_MASK];
+    
+    wsptr += DCTSIZE;		/* advance pointer to next row */
+  }
+}
+
+#endif /* DCT_FLOAT_SUPPORTED */
diff --git a/src/libjpeg/jidctfst.c b/src/libjpeg/jidctfst.c
new file mode 100644
index 0000000..078b8c4
--- /dev/null
+++ b/src/libjpeg/jidctfst.c
@@ -0,0 +1,368 @@
+/*
+ * jidctfst.c
+ *
+ * Copyright (C) 1994-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a fast, not so accurate integer implementation of the
+ * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine
+ * must also perform dequantization of the input coefficients.
+ *
+ * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
+ * on each row (or vice versa, but it's more convenient to emit a row at
+ * a time).  Direct algorithms are also available, but they are much more
+ * complex and seem not to be any faster when reduced to code.
+ *
+ * This implementation is based on Arai, Agui, and Nakajima's algorithm for
+ * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in
+ * Japanese, but the algorithm is described in the Pennebaker & Mitchell
+ * JPEG textbook (see REFERENCES section in file README).  The following code
+ * is based directly on figure 4-8 in P&M.
+ * While an 8-point DCT cannot be done in less than 11 multiplies, it is
+ * possible to arrange the computation so that many of the multiplies are
+ * simple scalings of the final outputs.  These multiplies can then be
+ * folded into the multiplications or divisions by the JPEG quantization
+ * table entries.  The AA&N method leaves only 5 multiplies and 29 adds
+ * to be done in the DCT itself.
+ * The primary disadvantage of this method is that with fixed-point math,
+ * accuracy is lost due to imprecise representation of the scaled
+ * quantization values.  The smaller the quantization table entry, the less
+ * precise the scaled value, so this implementation does worse with high-
+ * quality-setting files than with low-quality ones.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h"		/* Private declarations for DCT subsystem */
+
+#ifdef DCT_IFAST_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/* Scaling decisions are generally the same as in the LL&M algorithm;
+ * see jidctint.c for more details.  However, we choose to descale
+ * (right shift) multiplication products as soon as they are formed,
+ * rather than carrying additional fractional bits into subsequent additions.
+ * This compromises accuracy slightly, but it lets us save a few shifts.
+ * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
+ * everywhere except in the multiplications proper; this saves a good deal
+ * of work on 16-bit-int machines.
+ *
+ * The dequantized coefficients are not integers because the AA&N scaling
+ * factors have been incorporated.  We represent them scaled up by PASS1_BITS,
+ * so that the first and second IDCT rounds have the same input scaling.
+ * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to
+ * avoid a descaling shift; this compromises accuracy rather drastically
+ * for small quantization table entries, but it saves a lot of shifts.
+ * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway,
+ * so we use a much larger scaling factor to preserve accuracy.
+ *
+ * A final compromise is to represent the multiplicative constants to only
+ * 8 fractional bits, rather than 13.  This saves some shifting work on some
+ * machines, and may also reduce the cost of multiplication (since there
+ * are fewer one-bits in the constants).
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define CONST_BITS  8
+#define PASS1_BITS  2
+#else
+#define CONST_BITS  8
+#define PASS1_BITS  1		/* lose a little precision to avoid overflow */
+#endif
+
+/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
+ * causing a lot of useless floating-point operations at run time.
+ * To get around this we use the following pre-calculated constants.
+ * If you change CONST_BITS you may want to add appropriate values.
+ * (With a reasonable C compiler, you can just rely on the FIX() macro...)
+ */
+
+#if CONST_BITS == 8
+#define FIX_1_082392200  ((INT32)  277)		/* FIX(1.082392200) */
+#define FIX_1_414213562  ((INT32)  362)		/* FIX(1.414213562) */
+#define FIX_1_847759065  ((INT32)  473)		/* FIX(1.847759065) */
+#define FIX_2_613125930  ((INT32)  669)		/* FIX(2.613125930) */
+#else
+#define FIX_1_082392200  FIX(1.082392200)
+#define FIX_1_414213562  FIX(1.414213562)
+#define FIX_1_847759065  FIX(1.847759065)
+#define FIX_2_613125930  FIX(2.613125930)
+#endif
+
+
+/* We can gain a little more speed, with a further compromise in accuracy,
+ * by omitting the addition in a descaling shift.  This yields an incorrectly
+ * rounded result half the time...
+ */
+
+#ifndef USE_ACCURATE_ROUNDING
+#undef DESCALE
+#define DESCALE(x,n)  RIGHT_SHIFT(x, n)
+#endif
+
+
+/* Multiply a DCTELEM variable by an INT32 constant, and immediately
+ * descale to yield a DCTELEM result.
+ */
+
+#define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
+
+
+/* Dequantize a coefficient by multiplying it by the multiplier-table
+ * entry; produce a DCTELEM result.  For 8-bit data a 16x16->16
+ * multiplication will do.  For 12-bit data, the multiplier table is
+ * declared INT32, so a 32-bit multiply will be used.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define DEQUANTIZE(coef,quantval)  (((IFAST_MULT_TYPE) (coef)) * (quantval))
+#else
+#define DEQUANTIZE(coef,quantval)  \
+	DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS)
+#endif
+
+
+/* Like DESCALE, but applies to a DCTELEM and produces an int.
+ * We assume that int right shift is unsigned if INT32 right shift is.
+ */
+
+#ifdef RIGHT_SHIFT_IS_UNSIGNED
+#define ISHIFT_TEMPS	DCTELEM ishift_temp;
+#if BITS_IN_JSAMPLE == 8
+#define DCTELEMBITS  16		/* DCTELEM may be 16 or 32 bits */
+#else
+#define DCTELEMBITS  32		/* DCTELEM must be 32 bits */
+#endif
+#define IRIGHT_SHIFT(x,shft)  \
+    ((ishift_temp = (x)) < 0 ? \
+     (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
+     (ishift_temp >> (shft)))
+#else
+#define ISHIFT_TEMPS
+#define IRIGHT_SHIFT(x,shft)	((x) >> (shft))
+#endif
+
+#ifdef USE_ACCURATE_ROUNDING
+#define IDESCALE(x,n)  ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))
+#else
+#define IDESCALE(x,n)  ((int) IRIGHT_SHIFT(x, n))
+#endif
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients.
+ */
+
+GLOBAL(void)
+jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+		 JCOEFPTR coef_block,
+		 JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+  DCTELEM tmp10, tmp11, tmp12, tmp13;
+  DCTELEM z5, z10, z11, z12, z13;
+  JCOEFPTR inptr;
+  IFAST_MULT_TYPE * quantptr;
+  int * wsptr;
+  JSAMPROW outptr;
+  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+  int ctr;
+  int workspace[DCTSIZE2];	/* buffers data between passes */
+  SHIFT_TEMPS			/* for DESCALE */
+  ISHIFT_TEMPS			/* for IDESCALE */
+
+  /* Pass 1: process columns from input, store into work array. */
+
+  inptr = coef_block;
+  quantptr = (IFAST_MULT_TYPE *) compptr->dct_table;
+  wsptr = workspace;
+  for (ctr = DCTSIZE; ctr > 0; ctr--) {
+    /* Due to quantization, we will usually find that many of the input
+     * coefficients are zero, especially the AC terms.  We can exploit this
+     * by short-circuiting the IDCT calculation for any column in which all
+     * the AC terms are zero.  In that case each output is equal to the
+     * DC coefficient (with scale factor as needed).
+     * With typical images and quantization tables, half or more of the
+     * column DCT calculations can be simplified this way.
+     */
+    
+    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
+	inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
+	inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
+	inptr[DCTSIZE*7] == 0) {
+      /* AC terms all zero */
+      int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+
+      wsptr[DCTSIZE*0] = dcval;
+      wsptr[DCTSIZE*1] = dcval;
+      wsptr[DCTSIZE*2] = dcval;
+      wsptr[DCTSIZE*3] = dcval;
+      wsptr[DCTSIZE*4] = dcval;
+      wsptr[DCTSIZE*5] = dcval;
+      wsptr[DCTSIZE*6] = dcval;
+      wsptr[DCTSIZE*7] = dcval;
+      
+      inptr++;			/* advance pointers to next column */
+      quantptr++;
+      wsptr++;
+      continue;
+    }
+    
+    /* Even part */
+
+    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
+    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
+    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
+
+    tmp10 = tmp0 + tmp2;	/* phase 3 */
+    tmp11 = tmp0 - tmp2;
+
+    tmp13 = tmp1 + tmp3;	/* phases 5-3 */
+    tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */
+
+    tmp0 = tmp10 + tmp13;	/* phase 2 */
+    tmp3 = tmp10 - tmp13;
+    tmp1 = tmp11 + tmp12;
+    tmp2 = tmp11 - tmp12;
+    
+    /* Odd part */
+
+    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
+    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
+    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
+    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
+
+    z13 = tmp6 + tmp5;		/* phase 6 */
+    z10 = tmp6 - tmp5;
+    z11 = tmp4 + tmp7;
+    z12 = tmp4 - tmp7;
+
+    tmp7 = z11 + z13;		/* phase 5 */
+    tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
+
+    z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
+    tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
+    tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
+
+    tmp6 = tmp12 - tmp7;	/* phase 2 */
+    tmp5 = tmp11 - tmp6;
+    tmp4 = tmp10 + tmp5;
+
+    wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
+    wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
+    wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6);
+    wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
+    wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);
+    wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
+    wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);
+    wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);
+
+    inptr++;			/* advance pointers to next column */
+    quantptr++;
+    wsptr++;
+  }
+  
+  /* Pass 2: process rows from work array, store into output array. */
+  /* Note that we must descale the results by a factor of 8 == 2**3, */
+  /* and also undo the PASS1_BITS scaling. */
+
+  wsptr = workspace;
+  for (ctr = 0; ctr < DCTSIZE; ctr++) {
+    outptr = output_buf[ctr] + output_col;
+    /* Rows of zeroes can be exploited in the same way as we did with columns.
+     * However, the column calculation has created many nonzero AC terms, so
+     * the simplification applies less often (typically 5% to 10% of the time).
+     * On machines with very fast multiplication, it's possible that the
+     * test takes more time than it's worth.  In that case this section
+     * may be commented out.
+     */
+    
+#ifndef NO_ZERO_ROW_TEST
+    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
+	wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
+      /* AC terms all zero */
+      JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)
+				  & RANGE_MASK];
+      
+      outptr[0] = dcval;
+      outptr[1] = dcval;
+      outptr[2] = dcval;
+      outptr[3] = dcval;
+      outptr[4] = dcval;
+      outptr[5] = dcval;
+      outptr[6] = dcval;
+      outptr[7] = dcval;
+
+      wsptr += DCTSIZE;		/* advance pointer to next row */
+      continue;
+    }
+#endif
+    
+    /* Even part */
+
+    tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);
+    tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);
+
+    tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);
+    tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)
+	    - tmp13;
+
+    tmp0 = tmp10 + tmp13;
+    tmp3 = tmp10 - tmp13;
+    tmp1 = tmp11 + tmp12;
+    tmp2 = tmp11 - tmp12;
+
+    /* Odd part */
+
+    z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3];
+    z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3];
+    z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7];
+    z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7];
+
+    tmp7 = z11 + z13;		/* phase 5 */
+    tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
+
+    z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
+    tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
+    tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
+
+    tmp6 = tmp12 - tmp7;	/* phase 2 */
+    tmp5 = tmp11 - tmp6;
+    tmp4 = tmp10 + tmp5;
+
+    /* Final output stage: scale down by a factor of 8 and range-limit */
+
+    outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)
+			    & RANGE_MASK];
+
+    wsptr += DCTSIZE;		/* advance pointer to next row */
+  }
+}
+
+#endif /* DCT_IFAST_SUPPORTED */
diff --git a/src/libjpeg/jidctint.c b/src/libjpeg/jidctint.c
new file mode 100644
index 0000000..4f47fe8
--- /dev/null
+++ b/src/libjpeg/jidctint.c
@@ -0,0 +1,389 @@
+/*
+ * jidctint.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a slow-but-accurate integer implementation of the
+ * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine
+ * must also perform dequantization of the input coefficients.
+ *
+ * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
+ * on each row (or vice versa, but it's more convenient to emit a row at
+ * a time).  Direct algorithms are also available, but they are much more
+ * complex and seem not to be any faster when reduced to code.
+ *
+ * This implementation is based on an algorithm described in
+ *   C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
+ *   Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
+ *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
+ * The primary algorithm described there uses 11 multiplies and 29 adds.
+ * We use their alternate method with 12 multiplies and 32 adds.
+ * The advantage of this method is that no data path contains more than one
+ * multiplication; this allows a very simple and accurate implementation in
+ * scaled fixed-point arithmetic, with a minimal number of shifts.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h"		/* Private declarations for DCT subsystem */
+
+#ifdef DCT_ISLOW_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/*
+ * The poop on this scaling stuff is as follows:
+ *
+ * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
+ * larger than the true IDCT outputs.  The final outputs are therefore
+ * a factor of N larger than desired; since N=8 this can be cured by
+ * a simple right shift at the end of the algorithm.  The advantage of
+ * this arrangement is that we save two multiplications per 1-D IDCT,
+ * because the y0 and y4 inputs need not be divided by sqrt(N).
+ *
+ * We have to do addition and subtraction of the integer inputs, which
+ * is no problem, and multiplication by fractional constants, which is
+ * a problem to do in integer arithmetic.  We multiply all the constants
+ * by CONST_SCALE and convert them to integer constants (thus retaining
+ * CONST_BITS bits of precision in the constants).  After doing a
+ * multiplication we have to divide the product by CONST_SCALE, with proper
+ * rounding, to produce the correct output.  This division can be done
+ * cheaply as a right shift of CONST_BITS bits.  We postpone shifting
+ * as long as possible so that partial sums can be added together with
+ * full fractional precision.
+ *
+ * The outputs of the first pass are scaled up by PASS1_BITS bits so that
+ * they are represented to better-than-integral precision.  These outputs
+ * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
+ * with the recommended scaling.  (To scale up 12-bit sample data further, an
+ * intermediate INT32 array would be needed.)
+ *
+ * To avoid overflow of the 32-bit intermediate results in pass 2, we must
+ * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis
+ * shows that the values given below are the most effective.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define CONST_BITS  13
+#define PASS1_BITS  2
+#else
+#define CONST_BITS  13
+#define PASS1_BITS  1		/* lose a little precision to avoid overflow */
+#endif
+
+/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
+ * causing a lot of useless floating-point operations at run time.
+ * To get around this we use the following pre-calculated constants.
+ * If you change CONST_BITS you may want to add appropriate values.
+ * (With a reasonable C compiler, you can just rely on the FIX() macro...)
+ */
+
+#if CONST_BITS == 13
+#define FIX_0_298631336  ((INT32)  2446)	/* FIX(0.298631336) */
+#define FIX_0_390180644  ((INT32)  3196)	/* FIX(0.390180644) */
+#define FIX_0_541196100  ((INT32)  4433)	/* FIX(0.541196100) */
+#define FIX_0_765366865  ((INT32)  6270)	/* FIX(0.765366865) */
+#define FIX_0_899976223  ((INT32)  7373)	/* FIX(0.899976223) */
+#define FIX_1_175875602  ((INT32)  9633)	/* FIX(1.175875602) */
+#define FIX_1_501321110  ((INT32)  12299)	/* FIX(1.501321110) */
+#define FIX_1_847759065  ((INT32)  15137)	/* FIX(1.847759065) */
+#define FIX_1_961570560  ((INT32)  16069)	/* FIX(1.961570560) */
+#define FIX_2_053119869  ((INT32)  16819)	/* FIX(2.053119869) */
+#define FIX_2_562915447  ((INT32)  20995)	/* FIX(2.562915447) */
+#define FIX_3_072711026  ((INT32)  25172)	/* FIX(3.072711026) */
+#else
+#define FIX_0_298631336  FIX(0.298631336)
+#define FIX_0_390180644  FIX(0.390180644)
+#define FIX_0_541196100  FIX(0.541196100)
+#define FIX_0_765366865  FIX(0.765366865)
+#define FIX_0_899976223  FIX(0.899976223)
+#define FIX_1_175875602  FIX(1.175875602)
+#define FIX_1_501321110  FIX(1.501321110)
+#define FIX_1_847759065  FIX(1.847759065)
+#define FIX_1_961570560  FIX(1.961570560)
+#define FIX_2_053119869  FIX(2.053119869)
+#define FIX_2_562915447  FIX(2.562915447)
+#define FIX_3_072711026  FIX(3.072711026)
+#endif
+
+
+/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
+ * For 8-bit samples with the recommended scaling, all the variable
+ * and constant values involved are no more than 16 bits wide, so a
+ * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
+ * For 12-bit samples, a full 32-bit multiplication will be needed.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)
+#else
+#define MULTIPLY(var,const)  ((var) * (const))
+#endif
+
+
+/* Dequantize a coefficient by multiplying it by the multiplier-table
+ * entry; produce an int result.  In this module, both inputs and result
+ * are 16 bits or less, so either int or short multiply will work.
+ */
+
+#define DEQUANTIZE(coef,quantval)  (((ISLOW_MULT_TYPE) (coef)) * (quantval))
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients.
+ */
+
+GLOBAL(void)
+jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+		 JCOEFPTR coef_block,
+		 JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+  INT32 tmp0, tmp1, tmp2, tmp3;
+  INT32 tmp10, tmp11, tmp12, tmp13;
+  INT32 z1, z2, z3, z4, z5;
+  JCOEFPTR inptr;
+  ISLOW_MULT_TYPE * quantptr;
+  int * wsptr;
+  JSAMPROW outptr;
+  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+  int ctr;
+  int workspace[DCTSIZE2];	/* buffers data between passes */
+  SHIFT_TEMPS
+
+  /* Pass 1: process columns from input, store into work array. */
+  /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
+  /* furthermore, we scale the results by 2**PASS1_BITS. */
+
+  inptr = coef_block;
+  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
+  wsptr = workspace;
+  for (ctr = DCTSIZE; ctr > 0; ctr--) {
+    /* Due to quantization, we will usually find that many of the input
+     * coefficients are zero, especially the AC terms.  We can exploit this
+     * by short-circuiting the IDCT calculation for any column in which all
+     * the AC terms are zero.  In that case each output is equal to the
+     * DC coefficient (with scale factor as needed).
+     * With typical images and quantization tables, half or more of the
+     * column DCT calculations can be simplified this way.
+     */
+    
+    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
+	inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
+	inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
+	inptr[DCTSIZE*7] == 0) {
+      /* AC terms all zero */
+      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
+      
+      wsptr[DCTSIZE*0] = dcval;
+      wsptr[DCTSIZE*1] = dcval;
+      wsptr[DCTSIZE*2] = dcval;
+      wsptr[DCTSIZE*3] = dcval;
+      wsptr[DCTSIZE*4] = dcval;
+      wsptr[DCTSIZE*5] = dcval;
+      wsptr[DCTSIZE*6] = dcval;
+      wsptr[DCTSIZE*7] = dcval;
+      
+      inptr++;			/* advance pointers to next column */
+      quantptr++;
+      wsptr++;
+      continue;
+    }
+    
+    /* Even part: reverse the even part of the forward DCT. */
+    /* The rotator is sqrt(2)*c(-6). */
+    
+    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
+    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
+    
+    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
+    tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
+    tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
+    
+    z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
+
+    tmp0 = (z2 + z3) << CONST_BITS;
+    tmp1 = (z2 - z3) << CONST_BITS;
+    
+    tmp10 = tmp0 + tmp3;
+    tmp13 = tmp0 - tmp3;
+    tmp11 = tmp1 + tmp2;
+    tmp12 = tmp1 - tmp2;
+    
+    /* Odd part per figure 8; the matrix is unitary and hence its
+     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.
+     */
+    
+    tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
+    tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
+    tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
+    tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
+    
+    z1 = tmp0 + tmp3;
+    z2 = tmp1 + tmp2;
+    z3 = tmp0 + tmp2;
+    z4 = tmp1 + tmp3;
+    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
+    
+    tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
+    tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
+    tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
+    tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
+    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
+    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
+    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
+    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
+    
+    z3 += z5;
+    z4 += z5;
+    
+    tmp0 += z1 + z3;
+    tmp1 += z2 + z4;
+    tmp2 += z2 + z3;
+    tmp3 += z1 + z4;
+    
+    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
+    
+    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
+    wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
+    wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
+    wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
+    wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
+    wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
+    wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
+    wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
+    
+    inptr++;			/* advance pointers to next column */
+    quantptr++;
+    wsptr++;
+  }
+  
+  /* Pass 2: process rows from work array, store into output array. */
+  /* Note that we must descale the results by a factor of 8 == 2**3, */
+  /* and also undo the PASS1_BITS scaling. */
+
+  wsptr = workspace;
+  for (ctr = 0; ctr < DCTSIZE; ctr++) {
+    outptr = output_buf[ctr] + output_col;
+    /* Rows of zeroes can be exploited in the same way as we did with columns.
+     * However, the column calculation has created many nonzero AC terms, so
+     * the simplification applies less often (typically 5% to 10% of the time).
+     * On machines with very fast multiplication, it's possible that the
+     * test takes more time than it's worth.  In that case this section
+     * may be commented out.
+     */
+    
+#ifndef NO_ZERO_ROW_TEST
+    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
+	wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
+      /* AC terms all zero */
+      JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
+				  & RANGE_MASK];
+      
+      outptr[0] = dcval;
+      outptr[1] = dcval;
+      outptr[2] = dcval;
+      outptr[3] = dcval;
+      outptr[4] = dcval;
+      outptr[5] = dcval;
+      outptr[6] = dcval;
+      outptr[7] = dcval;
+
+      wsptr += DCTSIZE;		/* advance pointer to next row */
+      continue;
+    }
+#endif
+    
+    /* Even part: reverse the even part of the forward DCT. */
+    /* The rotator is sqrt(2)*c(-6). */
+    
+    z2 = (INT32) wsptr[2];
+    z3 = (INT32) wsptr[6];
+    
+    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
+    tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
+    tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
+    
+    tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS;
+    tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS;
+    
+    tmp10 = tmp0 + tmp3;
+    tmp13 = tmp0 - tmp3;
+    tmp11 = tmp1 + tmp2;
+    tmp12 = tmp1 - tmp2;
+    
+    /* Odd part per figure 8; the matrix is unitary and hence its
+     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.
+     */
+    
+    tmp0 = (INT32) wsptr[7];
+    tmp1 = (INT32) wsptr[5];
+    tmp2 = (INT32) wsptr[3];
+    tmp3 = (INT32) wsptr[1];
+    
+    z1 = tmp0 + tmp3;
+    z2 = tmp1 + tmp2;
+    z3 = tmp0 + tmp2;
+    z4 = tmp1 + tmp3;
+    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
+    
+    tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
+    tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
+    tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
+    tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
+    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
+    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
+    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
+    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
+    
+    z3 += z5;
+    z4 += z5;
+    
+    tmp0 += z1 + z3;
+    tmp1 += z2 + z4;
+    tmp2 += z2 + z3;
+    tmp3 += z1 + z4;
+    
+    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
+    
+    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp3,
+					  CONST_BITS+PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[7] = range_limit[(int) DESCALE(tmp10 - tmp3,
+					  CONST_BITS+PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[1] = range_limit[(int) DESCALE(tmp11 + tmp2,
+					  CONST_BITS+PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[6] = range_limit[(int) DESCALE(tmp11 - tmp2,
+					  CONST_BITS+PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[2] = range_limit[(int) DESCALE(tmp12 + tmp1,
+					  CONST_BITS+PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[5] = range_limit[(int) DESCALE(tmp12 - tmp1,
+					  CONST_BITS+PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[3] = range_limit[(int) DESCALE(tmp13 + tmp0,
+					  CONST_BITS+PASS1_BITS+3)
+			    & RANGE_MASK];
+    outptr[4] = range_limit[(int) DESCALE(tmp13 - tmp0,
+					  CONST_BITS+PASS1_BITS+3)
+			    & RANGE_MASK];
+    
+    wsptr += DCTSIZE;		/* advance pointer to next row */
+  }
+}
+
+#endif /* DCT_ISLOW_SUPPORTED */
diff --git a/src/libjpeg/jidctred.c b/src/libjpeg/jidctred.c
new file mode 100644
index 0000000..911899b
--- /dev/null
+++ b/src/libjpeg/jidctred.c
@@ -0,0 +1,398 @@
+/*
+ * jidctred.c
+ *
+ * Copyright (C) 1994-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains inverse-DCT routines that produce reduced-size output:
+ * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block.
+ *
+ * The implementation is based on the Loeffler, Ligtenberg and Moschytz (LL&M)
+ * algorithm used in jidctint.c.  We simply replace each 8-to-8 1-D IDCT step
+ * with an 8-to-4 step that produces the four averages of two adjacent outputs
+ * (or an 8-to-2 step producing two averages of four outputs, for 2x2 output).
+ * These steps were derived by computing the corresponding values at the end
+ * of the normal LL&M code, then simplifying as much as possible.
+ *
+ * 1x1 is trivial: just take the DC coefficient divided by 8.
+ *
+ * See jidctint.c for additional comments.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h"		/* Private declarations for DCT subsystem */
+
+#ifdef IDCT_SCALING_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/* Scaling is the same as in jidctint.c. */
+
+#if BITS_IN_JSAMPLE == 8
+#define CONST_BITS  13
+#define PASS1_BITS  2
+#else
+#define CONST_BITS  13
+#define PASS1_BITS  1		/* lose a little precision to avoid overflow */
+#endif
+
+/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
+ * causing a lot of useless floating-point operations at run time.
+ * To get around this we use the following pre-calculated constants.
+ * If you change CONST_BITS you may want to add appropriate values.
+ * (With a reasonable C compiler, you can just rely on the FIX() macro...)
+ */
+
+#if CONST_BITS == 13
+#define FIX_0_211164243  ((INT32)  1730)	/* FIX(0.211164243) */
+#define FIX_0_509795579  ((INT32)  4176)	/* FIX(0.509795579) */
+#define FIX_0_601344887  ((INT32)  4926)	/* FIX(0.601344887) */
+#define FIX_0_720959822  ((INT32)  5906)	/* FIX(0.720959822) */
+#define FIX_0_765366865  ((INT32)  6270)	/* FIX(0.765366865) */
+#define FIX_0_850430095  ((INT32)  6967)	/* FIX(0.850430095) */
+#define FIX_0_899976223  ((INT32)  7373)	/* FIX(0.899976223) */
+#define FIX_1_061594337  ((INT32)  8697)	/* FIX(1.061594337) */
+#define FIX_1_272758580  ((INT32)  10426)	/* FIX(1.272758580) */
+#define FIX_1_451774981  ((INT32)  11893)	/* FIX(1.451774981) */
+#define FIX_1_847759065  ((INT32)  15137)	/* FIX(1.847759065) */
+#define FIX_2_172734803  ((INT32)  17799)	/* FIX(2.172734803) */
+#define FIX_2_562915447  ((INT32)  20995)	/* FIX(2.562915447) */
+#define FIX_3_624509785  ((INT32)  29692)	/* FIX(3.624509785) */
+#else
+#define FIX_0_211164243  FIX(0.211164243)
+#define FIX_0_509795579  FIX(0.509795579)
+#define FIX_0_601344887  FIX(0.601344887)
+#define FIX_0_720959822  FIX(0.720959822)
+#define FIX_0_765366865  FIX(0.765366865)
+#define FIX_0_850430095  FIX(0.850430095)
+#define FIX_0_899976223  FIX(0.899976223)
+#define FIX_1_061594337  FIX(1.061594337)
+#define FIX_1_272758580  FIX(1.272758580)
+#define FIX_1_451774981  FIX(1.451774981)
+#define FIX_1_847759065  FIX(1.847759065)
+#define FIX_2_172734803  FIX(2.172734803)
+#define FIX_2_562915447  FIX(2.562915447)
+#define FIX_3_624509785  FIX(3.624509785)
+#endif
+
+
+/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
+ * For 8-bit samples with the recommended scaling, all the variable
+ * and constant values involved are no more than 16 bits wide, so a
+ * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
+ * For 12-bit samples, a full 32-bit multiplication will be needed.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)
+#else
+#define MULTIPLY(var,const)  ((var) * (const))
+#endif
+
+
+/* Dequantize a coefficient by multiplying it by the multiplier-table
+ * entry; produce an int result.  In this module, both inputs and result
+ * are 16 bits or less, so either int or short multiply will work.
+ */
+
+#define DEQUANTIZE(coef,quantval)  (((ISLOW_MULT_TYPE) (coef)) * (quantval))
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients,
+ * producing a reduced-size 4x4 output block.
+ */
+
+GLOBAL(void)
+jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	       JCOEFPTR coef_block,
+	       JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+  INT32 tmp0, tmp2, tmp10, tmp12;
+  INT32 z1, z2, z3, z4;
+  JCOEFPTR inptr;
+  ISLOW_MULT_TYPE * quantptr;
+  int * wsptr;
+  JSAMPROW outptr;
+  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+  int ctr;
+  int workspace[DCTSIZE*4];	/* buffers data between passes */
+  SHIFT_TEMPS
+
+  /* Pass 1: process columns from input, store into work array. */
+
+  inptr = coef_block;
+  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
+  wsptr = workspace;
+  for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {
+    /* Don't bother to process column 4, because second pass won't use it */
+    if (ctr == DCTSIZE-4)
+      continue;
+    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
+	inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*5] == 0 &&
+	inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) {
+      /* AC terms all zero; we need not examine term 4 for 4x4 output */
+      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
+      
+      wsptr[DCTSIZE*0] = dcval;
+      wsptr[DCTSIZE*1] = dcval;
+      wsptr[DCTSIZE*2] = dcval;
+      wsptr[DCTSIZE*3] = dcval;
+      
+      continue;
+    }
+    
+    /* Even part */
+    
+    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+    tmp0 <<= (CONST_BITS+1);
+    
+    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
+    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
+
+    tmp2 = MULTIPLY(z2, FIX_1_847759065) + MULTIPLY(z3, - FIX_0_765366865);
+    
+    tmp10 = tmp0 + tmp2;
+    tmp12 = tmp0 - tmp2;
+    
+    /* Odd part */
+    
+    z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
+    z2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
+    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
+    z4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
+    
+    tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
+	 + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
+	 + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */
+	 + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */
+    
+    tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */
+	 + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */
+	 + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */
+	 + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
+
+    /* Final output stage */
+    
+    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1);
+    wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1);
+    wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1);
+    wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1);
+  }
+  
+  /* Pass 2: process 4 rows from work array, store into output array. */
+
+  wsptr = workspace;
+  for (ctr = 0; ctr < 4; ctr++) {
+    outptr = output_buf[ctr] + output_col;
+    /* It's not clear whether a zero row test is worthwhile here ... */
+
+#ifndef NO_ZERO_ROW_TEST
+    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 &&
+	wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
+      /* AC terms all zero */
+      JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
+				  & RANGE_MASK];
+      
+      outptr[0] = dcval;
+      outptr[1] = dcval;
+      outptr[2] = dcval;
+      outptr[3] = dcval;
+      
+      wsptr += DCTSIZE;		/* advance pointer to next row */
+      continue;
+    }
+#endif
+    
+    /* Even part */
+    
+    tmp0 = ((INT32) wsptr[0]) << (CONST_BITS+1);
+    
+    tmp2 = MULTIPLY((INT32) wsptr[2], FIX_1_847759065)
+	 + MULTIPLY((INT32) wsptr[6], - FIX_0_765366865);
+    
+    tmp10 = tmp0 + tmp2;
+    tmp12 = tmp0 - tmp2;
+    
+    /* Odd part */
+    
+    z1 = (INT32) wsptr[7];
+    z2 = (INT32) wsptr[5];
+    z3 = (INT32) wsptr[3];
+    z4 = (INT32) wsptr[1];
+    
+    tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
+	 + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
+	 + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */
+	 + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */
+    
+    tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */
+	 + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */
+	 + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */
+	 + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
+
+    /* Final output stage */
+    
+    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp2,
+					  CONST_BITS+PASS1_BITS+3+1)
+			    & RANGE_MASK];
+    outptr[3] = range_limit[(int) DESCALE(tmp10 - tmp2,
+					  CONST_BITS+PASS1_BITS+3+1)
+			    & RANGE_MASK];
+    outptr[1] = range_limit[(int) DESCALE(tmp12 + tmp0,
+					  CONST_BITS+PASS1_BITS+3+1)
+			    & RANGE_MASK];
+    outptr[2] = range_limit[(int) DESCALE(tmp12 - tmp0,
+					  CONST_BITS+PASS1_BITS+3+1)
+			    & RANGE_MASK];
+    
+    wsptr += DCTSIZE;		/* advance pointer to next row */
+  }
+}
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients,
+ * producing a reduced-size 2x2 output block.
+ */
+
+GLOBAL(void)
+jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	       JCOEFPTR coef_block,
+	       JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+  INT32 tmp0, tmp10, z1;
+  JCOEFPTR inptr;
+  ISLOW_MULT_TYPE * quantptr;
+  int * wsptr;
+  JSAMPROW outptr;
+  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+  int ctr;
+  int workspace[DCTSIZE*2];	/* buffers data between passes */
+  SHIFT_TEMPS
+
+  /* Pass 1: process columns from input, store into work array. */
+
+  inptr = coef_block;
+  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
+  wsptr = workspace;
+  for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {
+    /* Don't bother to process columns 2,4,6 */
+    if (ctr == DCTSIZE-2 || ctr == DCTSIZE-4 || ctr == DCTSIZE-6)
+      continue;
+    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*3] == 0 &&
+	inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*7] == 0) {
+      /* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */
+      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
+      
+      wsptr[DCTSIZE*0] = dcval;
+      wsptr[DCTSIZE*1] = dcval;
+      
+      continue;
+    }
+    
+    /* Even part */
+    
+    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+    tmp10 = z1 << (CONST_BITS+2);
+    
+    /* Odd part */
+
+    z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
+    tmp0 = MULTIPLY(z1, - FIX_0_720959822); /* sqrt(2) * (c7-c5+c3-c1) */
+    z1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
+    tmp0 += MULTIPLY(z1, FIX_0_850430095); /* sqrt(2) * (-c1+c3+c5+c7) */
+    z1 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
+    tmp0 += MULTIPLY(z1, - FIX_1_272758580); /* sqrt(2) * (-c1+c3-c5-c7) */
+    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
+    tmp0 += MULTIPLY(z1, FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
+
+    /* Final output stage */
+    
+    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2);
+    wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2);
+  }
+  
+  /* Pass 2: process 2 rows from work array, store into output array. */
+
+  wsptr = workspace;
+  for (ctr = 0; ctr < 2; ctr++) {
+    outptr = output_buf[ctr] + output_col;
+    /* It's not clear whether a zero row test is worthwhile here ... */
+
+#ifndef NO_ZERO_ROW_TEST
+    if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) {
+      /* AC terms all zero */
+      JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
+				  & RANGE_MASK];
+      
+      outptr[0] = dcval;
+      outptr[1] = dcval;
+      
+      wsptr += DCTSIZE;		/* advance pointer to next row */
+      continue;
+    }
+#endif
+    
+    /* Even part */
+    
+    tmp10 = ((INT32) wsptr[0]) << (CONST_BITS+2);
+    
+    /* Odd part */
+
+    tmp0 = MULTIPLY((INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */
+	 + MULTIPLY((INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */
+	 + MULTIPLY((INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */
+	 + MULTIPLY((INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
+
+    /* Final output stage */
+    
+    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp0,
+					  CONST_BITS+PASS1_BITS+3+2)
+			    & RANGE_MASK];
+    outptr[1] = range_limit[(int) DESCALE(tmp10 - tmp0,
+					  CONST_BITS+PASS1_BITS+3+2)
+			    & RANGE_MASK];
+    
+    wsptr += DCTSIZE;		/* advance pointer to next row */
+  }
+}
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients,
+ * producing a reduced-size 1x1 output block.
+ */
+
+GLOBAL(void)
+jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+	       JCOEFPTR coef_block,
+	       JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+  int dcval;
+  ISLOW_MULT_TYPE * quantptr;
+  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+  SHIFT_TEMPS
+
+  /* We hardly need an inverse DCT routine for this: just take the
+   * average pixel value, which is one-eighth of the DC coefficient.
+   */
+  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
+  dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
+  dcval = (int) DESCALE((INT32) dcval, 3);
+
+  output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];
+}
+
+#endif /* IDCT_SCALING_SUPPORTED */
diff --git a/src/libjpeg/jinclude.h b/src/libjpeg/jinclude.h
new file mode 100644
index 0000000..5ff60fe
--- /dev/null
+++ b/src/libjpeg/jinclude.h
@@ -0,0 +1,91 @@
+/*
+ * jinclude.h
+ *
+ * Copyright (C) 1991-1994, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file exists to provide a single place to fix any problems with
+ * including the wrong system include files.  (Common problems are taken
+ * care of by the standard jconfig symbols, but on really weird systems
+ * you may have to edit this file.)
+ *
+ * NOTE: this file is NOT intended to be included by applications using the
+ * JPEG library.  Most applications need only include jpeglib.h.
+ */
+
+
+/* Include auto-config file to find out which system include files we need. */
+
+#include "jconfig.h"		/* auto configuration options */
+#define JCONFIG_INCLUDED	/* so that jpeglib.h doesn't do it again */
+
+/*
+ * We need the NULL macro and size_t typedef.
+ * On an ANSI-conforming system it is sufficient to include <stddef.h>.
+ * Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to
+ * pull in <sys/types.h> as well.
+ * Note that the core JPEG library does not require <stdio.h>;
+ * only the default error handler and data source/destination modules do.
+ * But we must pull it in because of the references to FILE in jpeglib.h.
+ * You can remove those references if you want to compile without <stdio.h>.
+ */
+
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef NEED_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#include <stdio.h>
+
+/*
+ * We need memory copying and zeroing functions, plus strncpy().
+ * ANSI and System V implementations declare these in <string.h>.
+ * BSD doesn't have the mem() functions, but it does have bcopy()/bzero().
+ * Some systems may declare memset and memcpy in <memory.h>.
+ *
+ * NOTE: we assume the size parameters to these functions are of type size_t.
+ * Change the casts in these macros if not!
+ */
+
+#ifdef NEED_BSD_STRINGS
+
+#include <strings.h>
+#define MEMZERO(target,size)	bzero((void *)(target), (size_t)(size))
+#define MEMCOPY(dest,src,size)	bcopy((const void *)(src), (void *)(dest), (size_t)(size))
+
+#else /* not BSD, assume ANSI/SysV string lib */
+
+#include <string.h>
+#define MEMZERO(target,size)	memset((void *)(target), 0, (size_t)(size))
+#define MEMCOPY(dest,src,size)	memcpy((void *)(dest), (const void *)(src), (size_t)(size))
+
+#endif
+
+/*
+ * In ANSI C, and indeed any rational implementation, size_t is also the
+ * type returned by sizeof().  However, it seems there are some irrational
+ * implementations out there, in which sizeof() returns an int even though
+ * size_t is defined as long or unsigned long.  To ensure consistent results
+ * we always use this SIZEOF() macro in place of using sizeof() directly.
+ */
+
+#define SIZEOF(object)	((size_t) sizeof(object))
+
+/*
+ * The modules that use fread() and fwrite() always invoke them through
+ * these macros.  On some systems you may need to twiddle the argument casts.
+ * CAUTION: argument order is different from underlying functions!
+ */
+
+#define JFREAD(file,buf,sizeofbuf)  \
+  ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
+#define JFWRITE(file,buf,sizeofbuf)  \
+  ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
diff --git a/src/libjpeg/jmemansi.c b/src/libjpeg/jmemansi.c
new file mode 100644
index 0000000..b5da474
--- /dev/null
+++ b/src/libjpeg/jmemansi.c
@@ -0,0 +1,167 @@
+/*
+ * jmemansi.c
+ *
+ * Copyright (C) 1992-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file provides a simple generic implementation of the system-
+ * dependent portion of the JPEG memory manager.  This implementation
+ * assumes that you have the ANSI-standard library routine tmpfile().
+ * Also, the problem of determining the amount of memory available
+ * is shoved onto the user.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jmemsys.h"		/* import the system-dependent declarations */
+
+#ifndef HAVE_STDLIB_H		/* <stdlib.h> should declare malloc(),free() */
+extern void * malloc JPP((size_t size));
+extern void free JPP((void *ptr));
+#endif
+
+#ifndef SEEK_SET		/* pre-ANSI systems may not define this; */
+#define SEEK_SET  0		/* if not, assume 0 is correct */
+#endif
+
+
+/*
+ * Memory allocation and freeing are controlled by the regular library
+ * routines malloc() and free().
+ */
+
+GLOBAL(void *)
+jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
+{
+  return (void *) malloc(sizeofobject);
+}
+
+GLOBAL(void)
+jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
+{
+  free(object);
+}
+
+
+/*
+ * "Large" objects are treated the same as "small" ones.
+ * NB: although we include FAR keywords in the routine declarations,
+ * this file won't actually work in 80x86 small/medium model; at least,
+ * you probably won't be able to process useful-size images in only 64KB.
+ */
+
+GLOBAL(void FAR *)
+jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
+{
+  return (void FAR *) malloc(sizeofobject);
+}
+
+GLOBAL(void)
+jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
+{
+  free(object);
+}
+
+
+/*
+ * This routine computes the total memory space available for allocation.
+ * It's impossible to do this in a portable way; our current solution is
+ * to make the user tell us (with a default value set at compile time).
+ * If you can actually get the available space, it's a good idea to subtract
+ * a slop factor of 5% or so.
+ */
+
+#ifndef DEFAULT_MAX_MEM		/* so can override from makefile */
+#define DEFAULT_MAX_MEM		1000000L /* default: one megabyte */
+#endif
+
+GLOBAL(long)
+jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
+		    long max_bytes_needed, long already_allocated)
+{
+  return cinfo->mem->max_memory_to_use - already_allocated;
+}
+
+
+/*
+ * Backing store (temporary file) management.
+ * Backing store objects are only used when the value returned by
+ * jpeg_mem_available is less than the total space needed.  You can dispense
+ * with these routines if you have plenty of virtual memory; see jmemnobs.c.
+ */
+
+
+METHODDEF(void)
+read_backing_store (j_common_ptr cinfo, backing_store_ptr info,
+		    void FAR * buffer_address,
+		    long file_offset, long byte_count)
+{
+  if (fseek(info->temp_file, file_offset, SEEK_SET))
+    ERREXIT(cinfo, JERR_TFILE_SEEK);
+  if (JFREAD(info->temp_file, buffer_address, byte_count)
+      != (size_t) byte_count)
+    ERREXIT(cinfo, JERR_TFILE_READ);
+}
+
+
+METHODDEF(void)
+write_backing_store (j_common_ptr cinfo, backing_store_ptr info,
+		     void FAR * buffer_address,
+		     long file_offset, long byte_count)
+{
+  if (fseek(info->temp_file, file_offset, SEEK_SET))
+    ERREXIT(cinfo, JERR_TFILE_SEEK);
+  if (JFWRITE(info->temp_file, buffer_address, byte_count)
+      != (size_t) byte_count)
+    ERREXIT(cinfo, JERR_TFILE_WRITE);
+}
+
+
+METHODDEF(void)
+close_backing_store (j_common_ptr cinfo, backing_store_ptr info)
+{
+  fclose(info->temp_file);
+  /* Since this implementation uses tmpfile() to create the file,
+   * no explicit file deletion is needed.
+   */
+}
+
+
+/*
+ * Initial opening of a backing-store object.
+ *
+ * This version uses tmpfile(), which constructs a suitable file name
+ * behind the scenes.  We don't have to use info->temp_name[] at all;
+ * indeed, we can't even find out the actual name of the temp file.
+ */
+
+GLOBAL(void)
+jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
+			 long total_bytes_needed)
+{
+  if ((info->temp_file = tmpfile()) == NULL)
+    ERREXITS(cinfo, JERR_TFILE_CREATE, "");
+  info->read_backing_store = read_backing_store;
+  info->write_backing_store = write_backing_store;
+  info->close_backing_store = close_backing_store;
+}
+
+
+/*
+ * These routines take care of any system-dependent initialization and
+ * cleanup required.
+ */
+
+GLOBAL(long)
+jpeg_mem_init (j_common_ptr cinfo)
+{
+  return DEFAULT_MAX_MEM;	/* default for max_memory_to_use */
+}
+
+GLOBAL(void)
+jpeg_mem_term (j_common_ptr cinfo)
+{
+  /* no work */
+}
diff --git a/src/libjpeg/jmemmgr.c b/src/libjpeg/jmemmgr.c
new file mode 100644
index 0000000..b636f1b
--- /dev/null
+++ b/src/libjpeg/jmemmgr.c
@@ -0,0 +1,1118 @@
+/*
+ * jmemmgr.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the JPEG system-independent memory management
+ * routines.  This code is usable across a wide variety of machines; most
+ * of the system dependencies have been isolated in a separate file.
+ * The major functions provided here are:
+ *   * pool-based allocation and freeing of memory;
+ *   * policy decisions about how to divide available memory among the
+ *     virtual arrays;
+ *   * control logic for swapping virtual arrays between main memory and
+ *     backing storage.
+ * The separate system-dependent file provides the actual backing-storage
+ * access code, and it contains the policy decision about how much total
+ * main memory to use.
+ * This file is system-dependent in the sense that some of its functions
+ * are unnecessary in some systems.  For example, if there is enough virtual
+ * memory so that backing storage will never be used, much of the virtual
+ * array control logic could be removed.  (Of course, if you have that much
+ * memory then you shouldn't care about a little bit of unused code...)
+ */
+
+#define JPEG_INTERNALS
+#define AM_MEMORY_MANAGER	/* we define jvirt_Xarray_control structs */
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jmemsys.h"		/* import the system-dependent declarations */
+
+#ifndef NO_GETENV
+#ifndef HAVE_STDLIB_H		/* <stdlib.h> should declare getenv() */
+extern char * getenv JPP((const char * name));
+#endif
+#endif
+
+
+/*
+ * Some important notes:
+ *   The allocation routines provided here must never return NULL.
+ *   They should exit to error_exit if unsuccessful.
+ *
+ *   It's not a good idea to try to merge the sarray and barray routines,
+ *   even though they are textually almost the same, because samples are
+ *   usually stored as bytes while coefficients are shorts or ints.  Thus,
+ *   in machines where byte pointers have a different representation from
+ *   word pointers, the resulting machine code could not be the same.
+ */
+
+
+/*
+ * Many machines require storage alignment: longs must start on 4-byte
+ * boundaries, doubles on 8-byte boundaries, etc.  On such machines, malloc()
+ * always returns pointers that are multiples of the worst-case alignment
+ * requirement, and we had better do so too.
+ * There isn't any really portable way to determine the worst-case alignment
+ * requirement.  This module assumes that the alignment requirement is
+ * multiples of sizeof(ALIGN_TYPE).
+ * By default, we define ALIGN_TYPE as double.  This is necessary on some
+ * workstations (where doubles really do need 8-byte alignment) and will work
+ * fine on nearly everything.  If your machine has lesser alignment needs,
+ * you can save a few bytes by making ALIGN_TYPE smaller.
+ * The only place I know of where this will NOT work is certain Macintosh
+ * 680x0 compilers that define double as a 10-byte IEEE extended float.
+ * Doing 10-byte alignment is counterproductive because longwords won't be
+ * aligned well.  Put "#define ALIGN_TYPE long" in jconfig.h if you have
+ * such a compiler.
+ */
+
+#ifndef ALIGN_TYPE		/* so can override from jconfig.h */
+#define ALIGN_TYPE  double
+#endif
+
+
+/*
+ * We allocate objects from "pools", where each pool is gotten with a single
+ * request to jpeg_get_small() or jpeg_get_large().  There is no per-object
+ * overhead within a pool, except for alignment padding.  Each pool has a
+ * header with a link to the next pool of the same class.
+ * Small and large pool headers are identical except that the latter's
+ * link pointer must be FAR on 80x86 machines.
+ * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE
+ * field.  This forces the compiler to make SIZEOF(small_pool_hdr) a multiple
+ * of the alignment requirement of ALIGN_TYPE.
+ */
+
+typedef union small_pool_struct * small_pool_ptr;
+
+typedef union small_pool_struct {
+  struct {
+    small_pool_ptr next;	/* next in list of pools */
+    size_t bytes_used;		/* how many bytes already used within pool */
+    size_t bytes_left;		/* bytes still available in this pool */
+  } hdr;
+  ALIGN_TYPE dummy;		/* included in union to ensure alignment */
+} small_pool_hdr;
+
+typedef union large_pool_struct FAR * large_pool_ptr;
+
+typedef union large_pool_struct {
+  struct {
+    large_pool_ptr next;	/* next in list of pools */
+    size_t bytes_used;		/* how many bytes already used within pool */
+    size_t bytes_left;		/* bytes still available in this pool */
+  } hdr;
+  ALIGN_TYPE dummy;		/* included in union to ensure alignment */
+} large_pool_hdr;
+
+
+/*
+ * Here is the full definition of a memory manager object.
+ */
+
+typedef struct {
+  struct jpeg_memory_mgr pub;	/* public fields */
+
+  /* Each pool identifier (lifetime class) names a linked list of pools. */
+  small_pool_ptr small_list[JPOOL_NUMPOOLS];
+  large_pool_ptr large_list[JPOOL_NUMPOOLS];
+
+  /* Since we only have one lifetime class of virtual arrays, only one
+   * linked list is necessary (for each datatype).  Note that the virtual
+   * array control blocks being linked together are actually stored somewhere
+   * in the small-pool list.
+   */
+  jvirt_sarray_ptr virt_sarray_list;
+  jvirt_barray_ptr virt_barray_list;
+
+  /* This counts total space obtained from jpeg_get_small/large */
+  long total_space_allocated;
+
+  /* alloc_sarray and alloc_barray set this value for use by virtual
+   * array routines.
+   */
+  JDIMENSION last_rowsperchunk;	/* from most recent alloc_sarray/barray */
+} my_memory_mgr;
+
+typedef my_memory_mgr * my_mem_ptr;
+
+
+/*
+ * The control blocks for virtual arrays.
+ * Note that these blocks are allocated in the "small" pool area.
+ * System-dependent info for the associated backing store (if any) is hidden
+ * inside the backing_store_info struct.
+ */
+
+struct jvirt_sarray_control {
+  JSAMPARRAY mem_buffer;	/* => the in-memory buffer */
+  JDIMENSION rows_in_array;	/* total virtual array height */
+  JDIMENSION samplesperrow;	/* width of array (and of memory buffer) */
+  JDIMENSION maxaccess;		/* max rows accessed by access_virt_sarray */
+  JDIMENSION rows_in_mem;	/* height of memory buffer */
+  JDIMENSION rowsperchunk;	/* allocation chunk size in mem_buffer */
+  JDIMENSION cur_start_row;	/* first logical row # in the buffer */
+  JDIMENSION first_undef_row;	/* row # of first uninitialized row */
+  boolean pre_zero;		/* pre-zero mode requested? */
+  boolean dirty;		/* do current buffer contents need written? */
+  boolean b_s_open;		/* is backing-store data valid? */
+  jvirt_sarray_ptr next;	/* link to next virtual sarray control block */
+  backing_store_info b_s_info;	/* System-dependent control info */
+};
+
+struct jvirt_barray_control {
+  JBLOCKARRAY mem_buffer;	/* => the in-memory buffer */
+  JDIMENSION rows_in_array;	/* total virtual array height */
+  JDIMENSION blocksperrow;	/* width of array (and of memory buffer) */
+  JDIMENSION maxaccess;		/* max rows accessed by access_virt_barray */
+  JDIMENSION rows_in_mem;	/* height of memory buffer */
+  JDIMENSION rowsperchunk;	/* allocation chunk size in mem_buffer */
+  JDIMENSION cur_start_row;	/* first logical row # in the buffer */
+  JDIMENSION first_undef_row;	/* row # of first uninitialized row */
+  boolean pre_zero;		/* pre-zero mode requested? */
+  boolean dirty;		/* do current buffer contents need written? */
+  boolean b_s_open;		/* is backing-store data valid? */
+  jvirt_barray_ptr next;	/* link to next virtual barray control block */
+  backing_store_info b_s_info;	/* System-dependent control info */
+};
+
+
+#ifdef MEM_STATS		/* optional extra stuff for statistics */
+
+LOCAL(void)
+print_mem_stats (j_common_ptr cinfo, int pool_id)
+{
+  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+  small_pool_ptr shdr_ptr;
+  large_pool_ptr lhdr_ptr;
+
+  /* Since this is only a debugging stub, we can cheat a little by using
+   * fprintf directly rather than going through the trace message code.
+   * This is helpful because message parm array can't handle longs.
+   */
+  fprintf(stderr, "Freeing pool %d, total space = %ld\n",
+	  pool_id, mem->total_space_allocated);
+
+  for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;
+       lhdr_ptr = lhdr_ptr->hdr.next) {
+    fprintf(stderr, "  Large chunk used %ld\n",
+	    (long) lhdr_ptr->hdr.bytes_used);
+  }
+
+  for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;
+       shdr_ptr = shdr_ptr->hdr.next) {
+    fprintf(stderr, "  Small chunk used %ld free %ld\n",
+	    (long) shdr_ptr->hdr.bytes_used,
+	    (long) shdr_ptr->hdr.bytes_left);
+  }
+}
+
+#endif /* MEM_STATS */
+
+
+LOCAL(void)
+out_of_memory (j_common_ptr cinfo, int which)
+/* Report an out-of-memory error and stop execution */
+/* If we compiled MEM_STATS support, report alloc requests before dying */
+{
+#ifdef MEM_STATS
+  cinfo->err->trace_level = 2;	/* force self_destruct to report stats */
+#endif
+  ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which);
+}
+
+
+/*
+ * Allocation of "small" objects.
+ *
+ * For these, we use pooled storage.  When a new pool must be created,
+ * we try to get enough space for the current request plus a "slop" factor,
+ * where the slop will be the amount of leftover space in the new pool.
+ * The speed vs. space tradeoff is largely determined by the slop values.
+ * A different slop value is provided for each pool class (lifetime),
+ * and we also distinguish the first pool of a class from later ones.
+ * NOTE: the values given work fairly well on both 16- and 32-bit-int
+ * machines, but may be too small if longs are 64 bits or more.
+ */
+
+static const size_t first_pool_slop[JPOOL_NUMPOOLS] = 
+{
+	1600,			/* first PERMANENT pool */
+	16000			/* first IMAGE pool */
+};
+
+static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = 
+{
+	0,			/* additional PERMANENT pools */
+	5000			/* additional IMAGE pools */
+};
+
+#define MIN_SLOP  50		/* greater than 0 to avoid futile looping */
+
+
+METHODDEF(void *)
+alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
+/* Allocate a "small" object */
+{
+  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+  small_pool_ptr hdr_ptr, prev_hdr_ptr;
+  char * data_ptr;
+  size_t odd_bytes, min_request, slop;
+
+  /* Check for unsatisfiable request (do now to ensure no overflow below) */
+  if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr)))
+    out_of_memory(cinfo, 1);	/* request exceeds malloc's ability */
+
+  /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
+  odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
+  if (odd_bytes > 0)
+    sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
+
+  /* See if space is available in any existing pool */
+  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
+    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */
+  prev_hdr_ptr = NULL;
+  hdr_ptr = mem->small_list[pool_id];
+  while (hdr_ptr != NULL) {
+    if (hdr_ptr->hdr.bytes_left >= sizeofobject)
+      break;			/* found pool with enough space */
+    prev_hdr_ptr = hdr_ptr;
+    hdr_ptr = hdr_ptr->hdr.next;
+  }
+
+  /* Time to make a new pool? */
+  if (hdr_ptr == NULL) {
+    /* min_request is what we need now, slop is what will be leftover */
+    min_request = sizeofobject + SIZEOF(small_pool_hdr);
+    if (prev_hdr_ptr == NULL)	/* first pool in class? */
+      slop = first_pool_slop[pool_id];
+    else
+      slop = extra_pool_slop[pool_id];
+    /* Don't ask for more than MAX_ALLOC_CHUNK */
+    if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request))
+      slop = (size_t) (MAX_ALLOC_CHUNK-min_request);
+    /* Try to get space, if fail reduce slop and try again */
+    for (;;) {
+      hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);
+      if (hdr_ptr != NULL)
+	break;
+      slop /= 2;
+      if (slop < MIN_SLOP)	/* give up when it gets real small */
+	out_of_memory(cinfo, 2); /* jpeg_get_small failed */
+    }
+    mem->total_space_allocated += min_request + slop;
+    /* Success, initialize the new pool header and add to end of list */
+    hdr_ptr->hdr.next = NULL;
+    hdr_ptr->hdr.bytes_used = 0;
+    hdr_ptr->hdr.bytes_left = sizeofobject + slop;
+    if (prev_hdr_ptr == NULL)	/* first pool in class? */
+      mem->small_list[pool_id] = hdr_ptr;
+    else
+      prev_hdr_ptr->hdr.next = hdr_ptr;
+  }
+
+  /* OK, allocate the object from the current pool */
+  data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */
+  data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */
+  hdr_ptr->hdr.bytes_used += sizeofobject;
+  hdr_ptr->hdr.bytes_left -= sizeofobject;
+
+  return (void *) data_ptr;
+}
+
+
+/*
+ * Allocation of "large" objects.
+ *
+ * The external semantics of these are the same as "small" objects,
+ * except that FAR pointers are used on 80x86.  However the pool
+ * management heuristics are quite different.  We assume that each
+ * request is large enough that it may as well be passed directly to
+ * jpeg_get_large; the pool management just links everything together
+ * so that we can free it all on demand.
+ * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY
+ * structures.  The routines that create these structures (see below)
+ * deliberately bunch rows together to ensure a large request size.
+ */
+
+METHODDEF(void FAR *)
+alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
+/* Allocate a "large" object */
+{
+  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+  large_pool_ptr hdr_ptr;
+  size_t odd_bytes;
+
+  /* Check for unsatisfiable request (do now to ensure no overflow below) */
+  if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)))
+    out_of_memory(cinfo, 3);	/* request exceeds malloc's ability */
+
+  /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
+  odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
+  if (odd_bytes > 0)
+    sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
+
+  /* Always make a new pool */
+  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
+    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */
+
+  hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject +
+					    SIZEOF(large_pool_hdr));
+  if (hdr_ptr == NULL)
+    out_of_memory(cinfo, 4);	/* jpeg_get_large failed */
+  mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr);
+
+  /* Success, initialize the new pool header and add to list */
+  hdr_ptr->hdr.next = mem->large_list[pool_id];
+  /* We maintain space counts in each pool header for statistical purposes,
+   * even though they are not needed for allocation.
+   */
+  hdr_ptr->hdr.bytes_used = sizeofobject;
+  hdr_ptr->hdr.bytes_left = 0;
+  mem->large_list[pool_id] = hdr_ptr;
+
+  return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */
+}
+
+
+/*
+ * Creation of 2-D sample arrays.
+ * The pointers are in near heap, the samples themselves in FAR heap.
+ *
+ * To minimize allocation overhead and to allow I/O of large contiguous
+ * blocks, we allocate the sample rows in groups of as many rows as possible
+ * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request.
+ * NB: the virtual array control routines, later in this file, know about
+ * this chunking of rows.  The rowsperchunk value is left in the mem manager
+ * object so that it can be saved away if this sarray is the workspace for
+ * a virtual array.
+ */
+
+METHODDEF(JSAMPARRAY)
+alloc_sarray (j_common_ptr cinfo, int pool_id,
+	      JDIMENSION samplesperrow, JDIMENSION numrows)
+/* Allocate a 2-D sample array */
+{
+  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+  JSAMPARRAY result;
+  JSAMPROW workspace;
+  JDIMENSION rowsperchunk, currow, i;
+  long ltemp;
+
+  /* Calculate max # of rows allowed in one allocation chunk */
+  ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
+	  ((long) samplesperrow * SIZEOF(JSAMPLE));
+  if (ltemp <= 0)
+    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
+  if (ltemp < (long) numrows)
+    rowsperchunk = (JDIMENSION) ltemp;
+  else
+    rowsperchunk = numrows;
+  mem->last_rowsperchunk = rowsperchunk;
+
+  /* Get space for row pointers (small object) */
+  result = (JSAMPARRAY) alloc_small(cinfo, pool_id,
+				    (size_t) (numrows * SIZEOF(JSAMPROW)));
+
+  /* Get the rows themselves (large objects) */
+  currow = 0;
+  while (currow < numrows) {
+    rowsperchunk = MIN(rowsperchunk, numrows - currow);
+    workspace = (JSAMPROW) alloc_large(cinfo, pool_id,
+	(size_t) ((size_t) rowsperchunk * (size_t) samplesperrow
+		  * SIZEOF(JSAMPLE)));
+    for (i = rowsperchunk; i > 0; i--) {
+      result[currow++] = workspace;
+      workspace += samplesperrow;
+    }
+  }
+
+  return result;
+}
+
+
+/*
+ * Creation of 2-D coefficient-block arrays.
+ * This is essentially the same as the code for sample arrays, above.
+ */
+
+METHODDEF(JBLOCKARRAY)
+alloc_barray (j_common_ptr cinfo, int pool_id,
+	      JDIMENSION blocksperrow, JDIMENSION numrows)
+/* Allocate a 2-D coefficient-block array */
+{
+  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+  JBLOCKARRAY result;
+  JBLOCKROW workspace;
+  JDIMENSION rowsperchunk, currow, i;
+  long ltemp;
+
+  /* Calculate max # of rows allowed in one allocation chunk */
+  ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
+	  ((long) blocksperrow * SIZEOF(JBLOCK));
+  if (ltemp <= 0)
+    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
+  if (ltemp < (long) numrows)
+    rowsperchunk = (JDIMENSION) ltemp;
+  else
+    rowsperchunk = numrows;
+  mem->last_rowsperchunk = rowsperchunk;
+
+  /* Get space for row pointers (small object) */
+  result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,
+				     (size_t) (numrows * SIZEOF(JBLOCKROW)));
+
+  /* Get the rows themselves (large objects) */
+  currow = 0;
+  while (currow < numrows) {
+    rowsperchunk = MIN(rowsperchunk, numrows - currow);
+    workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,
+	(size_t) ((size_t) rowsperchunk * (size_t) blocksperrow
+		  * SIZEOF(JBLOCK)));
+    for (i = rowsperchunk; i > 0; i--) {
+      result[currow++] = workspace;
+      workspace += blocksperrow;
+    }
+  }
+
+  return result;
+}
+
+
+/*
+ * About virtual array management:
+ *
+ * The above "normal" array routines are only used to allocate strip buffers
+ * (as wide as the image, but just a few rows high).  Full-image-sized buffers
+ * are handled as "virtual" arrays.  The array is still accessed a strip at a
+ * time, but the memory manager must save the whole array for repeated
+ * accesses.  The intended implementation is that there is a strip buffer in
+ * memory (as high as is possible given the desired memory limit), plus a
+ * backing file that holds the rest of the array.
+ *
+ * The request_virt_array routines are told the total size of the image and
+ * the maximum number of rows that will be accessed at once.  The in-memory
+ * buffer must be at least as large as the maxaccess value.
+ *
+ * The request routines create control blocks but not the in-memory buffers.
+ * That is postponed until realize_virt_arrays is called.  At that time the
+ * total amount of space needed is known (approximately, anyway), so free
+ * memory can be divided up fairly.
+ *
+ * The access_virt_array routines are responsible for making a specific strip
+ * area accessible (after reading or writing the backing file, if necessary).
+ * Note that the access routines are told whether the caller intends to modify
+ * the accessed strip; during a read-only pass this saves having to rewrite
+ * data to disk.  The access routines are also responsible for pre-zeroing
+ * any newly accessed rows, if pre-zeroing was requested.
+ *
+ * In current usage, the access requests are usually for nonoverlapping
+ * strips; that is, successive access start_row numbers differ by exactly
+ * num_rows = maxaccess.  This means we can get good performance with simple
+ * buffer dump/reload logic, by making the in-memory buffer be a multiple
+ * of the access height; then there will never be accesses across bufferload
+ * boundaries.  The code will still work with overlapping access requests,
+ * but it doesn't handle bufferload overlaps very efficiently.
+ */
+
+
+METHODDEF(jvirt_sarray_ptr)
+request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
+		     JDIMENSION samplesperrow, JDIMENSION numrows,
+		     JDIMENSION maxaccess)
+/* Request a virtual 2-D sample array */
+{
+  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+  jvirt_sarray_ptr result;
+
+  /* Only IMAGE-lifetime virtual arrays are currently supported */
+  if (pool_id != JPOOL_IMAGE)
+    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */
+
+  /* get control block */
+  result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id,
+					  SIZEOF(struct jvirt_sarray_control));
+
+  result->mem_buffer = NULL;	/* marks array not yet realized */
+  result->rows_in_array = numrows;
+  result->samplesperrow = samplesperrow;
+  result->maxaccess = maxaccess;
+  result->pre_zero = pre_zero;
+  result->b_s_open = FALSE;	/* no associated backing-store object */
+  result->next = mem->virt_sarray_list; /* add to list of virtual arrays */
+  mem->virt_sarray_list = result;
+
+  return result;
+}
+
+
+METHODDEF(jvirt_barray_ptr)
+request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
+		     JDIMENSION blocksperrow, JDIMENSION numrows,
+		     JDIMENSION maxaccess)
+/* Request a virtual 2-D coefficient-block array */
+{
+  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+  jvirt_barray_ptr result;
+
+  /* Only IMAGE-lifetime virtual arrays are currently supported */
+  if (pool_id != JPOOL_IMAGE)
+    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */
+
+  /* get control block */
+  result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id,
+					  SIZEOF(struct jvirt_barray_control));
+
+  result->mem_buffer = NULL;	/* marks array not yet realized */
+  result->rows_in_array = numrows;
+  result->blocksperrow = blocksperrow;
+  result->maxaccess = maxaccess;
+  result->pre_zero = pre_zero;
+  result->b_s_open = FALSE;	/* no associated backing-store object */
+  result->next = mem->virt_barray_list; /* add to list of virtual arrays */
+  mem->virt_barray_list = result;
+
+  return result;
+}
+
+
+METHODDEF(void)
+realize_virt_arrays (j_common_ptr cinfo)
+/* Allocate the in-memory buffers for any unrealized virtual arrays */
+{
+  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+  long space_per_minheight, maximum_space, avail_mem;
+  long minheights, max_minheights;
+  jvirt_sarray_ptr sptr;
+  jvirt_barray_ptr bptr;
+
+  /* Compute the minimum space needed (maxaccess rows in each buffer)
+   * and the maximum space needed (full image height in each buffer).
+   * These may be of use to the system-dependent jpeg_mem_available routine.
+   */
+  space_per_minheight = 0;
+  maximum_space = 0;
+  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
+    if (sptr->mem_buffer == NULL) { /* if not realized yet */
+      space_per_minheight += (long) sptr->maxaccess *
+			     (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
+      maximum_space += (long) sptr->rows_in_array *
+		       (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
+    }
+  }
+  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
+    if (bptr->mem_buffer == NULL) { /* if not realized yet */
+      space_per_minheight += (long) bptr->maxaccess *
+			     (long) bptr->blocksperrow * SIZEOF(JBLOCK);
+      maximum_space += (long) bptr->rows_in_array *
+		       (long) bptr->blocksperrow * SIZEOF(JBLOCK);
+    }
+  }
+
+  if (space_per_minheight <= 0)
+    return;			/* no unrealized arrays, no work */
+
+  /* Determine amount of memory to actually use; this is system-dependent. */
+  avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,
+				 mem->total_space_allocated);
+
+  /* If the maximum space needed is available, make all the buffers full
+   * height; otherwise parcel it out with the same number of minheights
+   * in each buffer.
+   */
+  if (avail_mem >= maximum_space)
+    max_minheights = 1000000000L;
+  else {
+    max_minheights = avail_mem / space_per_minheight;
+    /* If there doesn't seem to be enough space, try to get the minimum
+     * anyway.  This allows a "stub" implementation of jpeg_mem_available().
+     */
+    if (max_minheights <= 0)
+      max_minheights = 1;
+  }
+
+  /* Allocate the in-memory buffers and initialize backing store as needed. */
+
+  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
+    if (sptr->mem_buffer == NULL) { /* if not realized yet */
+      minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L;
+      if (minheights <= max_minheights) {
+	/* This buffer fits in memory */
+	sptr->rows_in_mem = sptr->rows_in_array;
+      } else {
+	/* It doesn't fit in memory, create backing store. */
+	sptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess);
+	jpeg_open_backing_store(cinfo, & sptr->b_s_info,
+				(long) sptr->rows_in_array *
+				(long) sptr->samplesperrow *
+				(long) SIZEOF(JSAMPLE));
+	sptr->b_s_open = TRUE;
+      }
+      sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE,
+				      sptr->samplesperrow, sptr->rows_in_mem);
+      sptr->rowsperchunk = mem->last_rowsperchunk;
+      sptr->cur_start_row = 0;
+      sptr->first_undef_row = 0;
+      sptr->dirty = FALSE;
+    }
+  }
+
+  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
+    if (bptr->mem_buffer == NULL) { /* if not realized yet */
+      minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L;
+      if (minheights <= max_minheights) {
+	/* This buffer fits in memory */
+	bptr->rows_in_mem = bptr->rows_in_array;
+      } else {
+	/* It doesn't fit in memory, create backing store. */
+	bptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess);
+	jpeg_open_backing_store(cinfo, & bptr->b_s_info,
+				(long) bptr->rows_in_array *
+				(long) bptr->blocksperrow *
+				(long) SIZEOF(JBLOCK));
+	bptr->b_s_open = TRUE;
+      }
+      bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE,
+				      bptr->blocksperrow, bptr->rows_in_mem);
+      bptr->rowsperchunk = mem->last_rowsperchunk;
+      bptr->cur_start_row = 0;
+      bptr->first_undef_row = 0;
+      bptr->dirty = FALSE;
+    }
+  }
+}
+
+
+LOCAL(void)
+do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)
+/* Do backing store read or write of a virtual sample array */
+{
+  long bytesperrow, file_offset, byte_count, rows, thisrow, i;
+
+  bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);
+  file_offset = ptr->cur_start_row * bytesperrow;
+  /* Loop to read or write each allocation chunk in mem_buffer */
+  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
+    /* One chunk, but check for short chunk at end of buffer */
+    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
+    /* Transfer no more than is currently defined */
+    thisrow = (long) ptr->cur_start_row + i;
+    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
+    /* Transfer no more than fits in file */
+    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
+    if (rows <= 0)		/* this chunk might be past end of file! */
+      break;
+    byte_count = rows * bytesperrow;
+    if (writing)
+      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
+					    (void FAR *) ptr->mem_buffer[i],
+					    file_offset, byte_count);
+    else
+      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
+					   (void FAR *) ptr->mem_buffer[i],
+					   file_offset, byte_count);
+    file_offset += byte_count;
+  }
+}
+
+
+LOCAL(void)
+do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
+/* Do backing store read or write of a virtual coefficient-block array */
+{
+  long bytesperrow, file_offset, byte_count, rows, thisrow, i;
+
+  bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);
+  file_offset = ptr->cur_start_row * bytesperrow;
+  /* Loop to read or write each allocation chunk in mem_buffer */
+  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
+    /* One chunk, but check for short chunk at end of buffer */
+    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
+    /* Transfer no more than is currently defined */
+    thisrow = (long) ptr->cur_start_row + i;
+    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
+    /* Transfer no more than fits in file */
+    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
+    if (rows <= 0)		/* this chunk might be past end of file! */
+      break;
+    byte_count = rows * bytesperrow;
+    if (writing)
+      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
+					    (void FAR *) ptr->mem_buffer[i],
+					    file_offset, byte_count);
+    else
+      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
+					   (void FAR *) ptr->mem_buffer[i],
+					   file_offset, byte_count);
+    file_offset += byte_count;
+  }
+}
+
+
+METHODDEF(JSAMPARRAY)
+access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,
+		    JDIMENSION start_row, JDIMENSION num_rows,
+		    boolean writable)
+/* Access the part of a virtual sample array starting at start_row */
+/* and extending for num_rows rows.  writable is true if  */
+/* caller intends to modify the accessed area. */
+{
+  JDIMENSION end_row = start_row + num_rows;
+  JDIMENSION undef_row;
+
+  /* debugging check */
+  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
+      ptr->mem_buffer == NULL)
+    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+
+  /* Make the desired part of the virtual array accessible */
+  if (start_row < ptr->cur_start_row ||
+      end_row > ptr->cur_start_row+ptr->rows_in_mem) {
+    if (! ptr->b_s_open)
+      ERREXIT(cinfo, JERR_VIRTUAL_BUG);
+    /* Flush old buffer contents if necessary */
+    if (ptr->dirty) {
+      do_sarray_io(cinfo, ptr, TRUE);
+      ptr->dirty = FALSE;
+    }
+    /* Decide what part of virtual array to access.
+     * Algorithm: if target address > current window, assume forward scan,
+     * load starting at target address.  If target address < current window,
+     * assume backward scan, load so that target area is top of window.
+     * Note that when switching from forward write to forward read, will have
+     * start_row = 0, so the limiting case applies and we load from 0 anyway.
+     */
+    if (start_row > ptr->cur_start_row) {
+      ptr->cur_start_row = start_row;
+    } else {
+      /* use long arithmetic here to avoid overflow & unsigned problems */
+      long ltemp;
+
+      ltemp = (long) end_row - (long) ptr->rows_in_mem;
+      if (ltemp < 0)
+	ltemp = 0;		/* don't fall off front end of file */
+      ptr->cur_start_row = (JDIMENSION) ltemp;
+    }
+    /* Read in the selected part of the array.
+     * During the initial write pass, we will do no actual read
+     * because the selected part is all undefined.
+     */
+    do_sarray_io(cinfo, ptr, FALSE);
+  }
+  /* Ensure the accessed part of the array is defined; prezero if needed.
+   * To improve locality of access, we only prezero the part of the array
+   * that the caller is about to access, not the entire in-memory array.
+   */
+  if (ptr->first_undef_row < end_row) {
+    if (ptr->first_undef_row < start_row) {
+      if (writable)		/* writer skipped over a section of array */
+	ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+      undef_row = start_row;	/* but reader is allowed to read ahead */
+    } else {
+      undef_row = ptr->first_undef_row;
+    }
+    if (writable)
+      ptr->first_undef_row = end_row;
+    if (ptr->pre_zero) {
+      size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE);
+      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
+      end_row -= ptr->cur_start_row;
+      while (undef_row < end_row) {
+	jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
+	undef_row++;
+      }
+    } else {
+      if (! writable)		/* reader looking at undefined data */
+	ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+    }
+  }
+  /* Flag the buffer dirty if caller will write in it */
+  if (writable)
+    ptr->dirty = TRUE;
+  /* Return address of proper part of the buffer */
+  return ptr->mem_buffer + (start_row - ptr->cur_start_row);
+}
+
+
+METHODDEF(JBLOCKARRAY)
+access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr,
+		    JDIMENSION start_row, JDIMENSION num_rows,
+		    boolean writable)
+/* Access the part of a virtual block array starting at start_row */
+/* and extending for num_rows rows.  writable is true if  */
+/* caller intends to modify the accessed area. */
+{
+  JDIMENSION end_row = start_row + num_rows;
+  JDIMENSION undef_row;
+
+  /* debugging check */
+  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
+      ptr->mem_buffer == NULL)
+    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+
+  /* Make the desired part of the virtual array accessible */
+  if (start_row < ptr->cur_start_row ||
+      end_row > ptr->cur_start_row+ptr->rows_in_mem) {
+    if (! ptr->b_s_open)
+      ERREXIT(cinfo, JERR_VIRTUAL_BUG);
+    /* Flush old buffer contents if necessary */
+    if (ptr->dirty) {
+      do_barray_io(cinfo, ptr, TRUE);
+      ptr->dirty = FALSE;
+    }
+    /* Decide what part of virtual array to access.
+     * Algorithm: if target address > current window, assume forward scan,
+     * load starting at target address.  If target address < current window,
+     * assume backward scan, load so that target area is top of window.
+     * Note that when switching from forward write to forward read, will have
+     * start_row = 0, so the limiting case applies and we load from 0 anyway.
+     */
+    if (start_row > ptr->cur_start_row) {
+      ptr->cur_start_row = start_row;
+    } else {
+      /* use long arithmetic here to avoid overflow & unsigned problems */
+      long ltemp;
+
+      ltemp = (long) end_row - (long) ptr->rows_in_mem;
+      if (ltemp < 0)
+	ltemp = 0;		/* don't fall off front end of file */
+      ptr->cur_start_row = (JDIMENSION) ltemp;
+    }
+    /* Read in the selected part of the array.
+     * During the initial write pass, we will do no actual read
+     * because the selected part is all undefined.
+     */
+    do_barray_io(cinfo, ptr, FALSE);
+  }
+  /* Ensure the accessed part of the array is defined; prezero if needed.
+   * To improve locality of access, we only prezero the part of the array
+   * that the caller is about to access, not the entire in-memory array.
+   */
+  if (ptr->first_undef_row < end_row) {
+    if (ptr->first_undef_row < start_row) {
+      if (writable)		/* writer skipped over a section of array */
+	ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+      undef_row = start_row;	/* but reader is allowed to read ahead */
+    } else {
+      undef_row = ptr->first_undef_row;
+    }
+    if (writable)
+      ptr->first_undef_row = end_row;
+    if (ptr->pre_zero) {
+      size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK);
+      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
+      end_row -= ptr->cur_start_row;
+      while (undef_row < end_row) {
+	jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
+	undef_row++;
+      }
+    } else {
+      if (! writable)		/* reader looking at undefined data */
+	ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+    }
+  }
+  /* Flag the buffer dirty if caller will write in it */
+  if (writable)
+    ptr->dirty = TRUE;
+  /* Return address of proper part of the buffer */
+  return ptr->mem_buffer + (start_row - ptr->cur_start_row);
+}
+
+
+/*
+ * Release all objects belonging to a specified pool.
+ */
+
+METHODDEF(void)
+free_pool (j_common_ptr cinfo, int pool_id)
+{
+  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+  small_pool_ptr shdr_ptr;
+  large_pool_ptr lhdr_ptr;
+  size_t space_freed;
+
+  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
+    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */
+
+#ifdef MEM_STATS
+  if (cinfo->err->trace_level > 1)
+    print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */
+#endif
+
+  /* If freeing IMAGE pool, close any virtual arrays first */
+  if (pool_id == JPOOL_IMAGE) {
+    jvirt_sarray_ptr sptr;
+    jvirt_barray_ptr bptr;
+
+    for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
+      if (sptr->b_s_open) {	/* there may be no backing store */
+	sptr->b_s_open = FALSE;	/* prevent recursive close if error */
+	(*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info);
+      }
+    }
+    mem->virt_sarray_list = NULL;
+    for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
+      if (bptr->b_s_open) {	/* there may be no backing store */
+	bptr->b_s_open = FALSE;	/* prevent recursive close if error */
+	(*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info);
+      }
+    }
+    mem->virt_barray_list = NULL;
+  }
+
+  /* Release large objects */
+  lhdr_ptr = mem->large_list[pool_id];
+  mem->large_list[pool_id] = NULL;
+
+  while (lhdr_ptr != NULL) {
+    large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next;
+    space_freed = lhdr_ptr->hdr.bytes_used +
+		  lhdr_ptr->hdr.bytes_left +
+		  SIZEOF(large_pool_hdr);
+    jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed);
+    mem->total_space_allocated -= space_freed;
+    lhdr_ptr = next_lhdr_ptr;
+  }
+
+  /* Release small objects */
+  shdr_ptr = mem->small_list[pool_id];
+  mem->small_list[pool_id] = NULL;
+
+  while (shdr_ptr != NULL) {
+    small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next;
+    space_freed = shdr_ptr->hdr.bytes_used +
+		  shdr_ptr->hdr.bytes_left +
+		  SIZEOF(small_pool_hdr);
+    jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed);
+    mem->total_space_allocated -= space_freed;
+    shdr_ptr = next_shdr_ptr;
+  }
+}
+
+
+/*
+ * Close up shop entirely.
+ * Note that this cannot be called unless cinfo->mem is non-NULL.
+ */
+
+METHODDEF(void)
+self_destruct (j_common_ptr cinfo)
+{
+  int pool;
+
+  /* Close all backing store, release all memory.
+   * Releasing pools in reverse order might help avoid fragmentation
+   * with some (brain-damaged) malloc libraries.
+   */
+  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
+    free_pool(cinfo, pool);
+  }
+
+  /* Release the memory manager control block too. */
+  jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr));
+  cinfo->mem = NULL;		/* ensures I will be called only once */
+
+  jpeg_mem_term(cinfo);		/* system-dependent cleanup */
+}
+
+
+/*
+ * Memory manager initialization.
+ * When this is called, only the error manager pointer is valid in cinfo!
+ */
+
+GLOBAL(void)
+jinit_memory_mgr (j_common_ptr cinfo)
+{
+  my_mem_ptr mem;
+  long max_to_use;
+  int pool;
+  size_t test_mac;
+
+  cinfo->mem = NULL;		/* for safety if init fails */
+
+  /* Check for configuration errors.
+   * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably
+   * doesn't reflect any real hardware alignment requirement.
+   * The test is a little tricky: for X>0, X and X-1 have no one-bits
+   * in common if and only if X is a power of 2, ie has only one one-bit.
+   * Some compilers may give an "unreachable code" warning here; ignore it.
+   */
+  if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0)
+    ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE);
+  /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be
+   * a multiple of SIZEOF(ALIGN_TYPE).
+   * Again, an "unreachable code" warning may be ignored here.
+   * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK.
+   */
+  test_mac = (size_t) MAX_ALLOC_CHUNK;
+  if ((long) test_mac != MAX_ALLOC_CHUNK ||
+      (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0)
+    ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
+
+  max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */
+
+  /* Attempt to allocate memory manager's control block */
+  mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr));
+
+  if (mem == NULL) {
+    jpeg_mem_term(cinfo);	/* system-dependent cleanup */
+    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0);
+  }
+
+  /* OK, fill in the method pointers */
+  mem->pub.alloc_small = alloc_small;
+  mem->pub.alloc_large = alloc_large;
+  mem->pub.alloc_sarray = alloc_sarray;
+  mem->pub.alloc_barray = alloc_barray;
+  mem->pub.request_virt_sarray = request_virt_sarray;
+  mem->pub.request_virt_barray = request_virt_barray;
+  mem->pub.realize_virt_arrays = realize_virt_arrays;
+  mem->pub.access_virt_sarray = access_virt_sarray;
+  mem->pub.access_virt_barray = access_virt_barray;
+  mem->pub.free_pool = free_pool;
+  mem->pub.self_destruct = self_destruct;
+
+  /* Make MAX_ALLOC_CHUNK accessible to other modules */
+  mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK;
+
+  /* Initialize working state */
+  mem->pub.max_memory_to_use = max_to_use;
+
+  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
+    mem->small_list[pool] = NULL;
+    mem->large_list[pool] = NULL;
+  }
+  mem->virt_sarray_list = NULL;
+  mem->virt_barray_list = NULL;
+
+  mem->total_space_allocated = SIZEOF(my_memory_mgr);
+
+  /* Declare ourselves open for business */
+  cinfo->mem = & mem->pub;
+
+  /* Check for an environment variable JPEGMEM; if found, override the
+   * default max_memory setting from jpeg_mem_init.  Note that the
+   * surrounding application may again override this value.
+   * If your system doesn't support getenv(), define NO_GETENV to disable
+   * this feature.
+   */
+#ifndef NO_GETENV
+  { char * memenv;
+
+    if ((memenv = getenv("JPEGMEM")) != NULL) {
+      char ch = 'x';
+
+      if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) {
+	if (ch == 'm' || ch == 'M')
+	  max_to_use *= 1000L;
+	mem->pub.max_memory_to_use = max_to_use * 1000L;
+      }
+    }
+  }
+#endif
+
+}
diff --git a/src/libjpeg/jmemname.c b/src/libjpeg/jmemname.c
new file mode 100644
index 0000000..e28b212
--- /dev/null
+++ b/src/libjpeg/jmemname.c
@@ -0,0 +1,276 @@
+/*
+ * jmemname.c
+ *
+ * Copyright (C) 1992-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file provides a generic implementation of the system-dependent
+ * portion of the JPEG memory manager.  This implementation assumes that
+ * you must explicitly construct a name for each temp file.
+ * Also, the problem of determining the amount of memory available
+ * is shoved onto the user.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jmemsys.h"		/* import the system-dependent declarations */
+
+#ifndef HAVE_STDLIB_H		/* <stdlib.h> should declare malloc(),free() */
+extern void * malloc JPP((size_t size));
+extern void free JPP((void *ptr));
+#endif
+
+#ifndef SEEK_SET		/* pre-ANSI systems may not define this; */
+#define SEEK_SET  0		/* if not, assume 0 is correct */
+#endif
+
+#ifdef DONT_USE_B_MODE		/* define mode parameters for fopen() */
+#define READ_BINARY	"r"
+#define RW_BINARY	"w+"
+#else
+#ifdef VMS			/* VMS is very nonstandard */
+#define READ_BINARY	"rb", "ctx=stm"
+#define RW_BINARY	"w+b", "ctx=stm"
+#else				/* standard ANSI-compliant case */
+#define READ_BINARY	"rb"
+#define RW_BINARY	"w+b"
+#endif
+#endif
+
+
+/*
+ * Selection of a file name for a temporary file.
+ * This is system-dependent!
+ *
+ * The code as given is suitable for most Unix systems, and it is easily
+ * modified for most non-Unix systems.  Some notes:
+ *  1.  The temp file is created in the directory named by TEMP_DIRECTORY.
+ *      The default value is /usr/tmp, which is the conventional place for
+ *      creating large temp files on Unix.  On other systems you'll probably
+ *      want to change the file location.  You can do this by editing the
+ *      #define, or (preferred) by defining TEMP_DIRECTORY in jconfig.h.
+ *
+ *  2.  If you need to change the file name as well as its location,
+ *      you can override the TEMP_FILE_NAME macro.  (Note that this is
+ *      actually a printf format string; it must contain %s and %d.)
+ *      Few people should need to do this.
+ *
+ *  3.  mktemp() is used to ensure that multiple processes running
+ *      simultaneously won't select the same file names.  If your system
+ *      doesn't have mktemp(), define NO_MKTEMP to do it the hard way.
+ *      (If you don't have <errno.h>, also define NO_ERRNO_H.)
+ *
+ *  4.  You probably want to define NEED_SIGNAL_CATCHER so that cjpeg.c/djpeg.c
+ *      will cause the temp files to be removed if you stop the program early.
+ */
+
+#ifndef TEMP_DIRECTORY		/* can override from jconfig.h or Makefile */
+#define TEMP_DIRECTORY  "/usr/tmp/" /* recommended setting for Unix */
+#endif
+
+static int next_file_num;	/* to distinguish among several temp files */
+
+#ifdef NO_MKTEMP
+
+#ifndef TEMP_FILE_NAME		/* can override from jconfig.h or Makefile */
+#define TEMP_FILE_NAME  "%sJPG%03d.TMP"
+#endif
+
+#ifndef NO_ERRNO_H
+#include <errno.h>		/* to define ENOENT */
+#endif
+
+/* ANSI C specifies that errno is a macro, but on older systems it's more
+ * likely to be a plain int variable.  And not all versions of errno.h
+ * bother to declare it, so we have to in order to be most portable.  Thus:
+ */
+#ifndef errno
+extern int errno;
+#endif
+
+
+LOCAL(void)
+select_file_name (char * fname)
+{
+  FILE * tfile;
+
+  /* Keep generating file names till we find one that's not in use */
+  for (;;) {
+    next_file_num++;		/* advance counter */
+    sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
+    if ((tfile = fopen(fname, READ_BINARY)) == NULL) {
+      /* fopen could have failed for a reason other than the file not
+       * being there; for example, file there but unreadable.
+       * If <errno.h> isn't available, then we cannot test the cause.
+       */
+#ifdef ENOENT
+      if (errno != ENOENT)
+	continue;
+#endif
+      break;
+    }
+    fclose(tfile);		/* oops, it's there; close tfile & try again */
+  }
+}
+
+#else /* ! NO_MKTEMP */
+
+/* Note that mktemp() requires the initial filename to end in six X's */
+#ifndef TEMP_FILE_NAME		/* can override from jconfig.h or Makefile */
+#define TEMP_FILE_NAME  "%sJPG%dXXXXXX"
+#endif
+
+LOCAL(void)
+select_file_name (char * fname)
+{
+  next_file_num++;		/* advance counter */
+  sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
+  mktemp(fname);		/* make sure file name is unique */
+  /* mktemp replaces the trailing XXXXXX with a unique string of characters */
+}
+
+#endif /* NO_MKTEMP */
+
+
+/*
+ * Memory allocation and freeing are controlled by the regular library
+ * routines malloc() and free().
+ */
+
+GLOBAL(void *)
+jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
+{
+  return (void *) malloc(sizeofobject);
+}
+
+GLOBAL(void)
+jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
+{
+  free(object);
+}
+
+
+/*
+ * "Large" objects are treated the same as "small" ones.
+ * NB: although we include FAR keywords in the routine declarations,
+ * this file won't actually work in 80x86 small/medium model; at least,
+ * you probably won't be able to process useful-size images in only 64KB.
+ */
+
+GLOBAL(void FAR *)
+jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
+{
+  return (void FAR *) malloc(sizeofobject);
+}
+
+GLOBAL(void)
+jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
+{
+  free(object);
+}
+
+
+/*
+ * This routine computes the total memory space available for allocation.
+ * It's impossible to do this in a portable way; our current solution is
+ * to make the user tell us (with a default value set at compile time).
+ * If you can actually get the available space, it's a good idea to subtract
+ * a slop factor of 5% or so.
+ */
+
+#ifndef DEFAULT_MAX_MEM		/* so can override from makefile */
+#define DEFAULT_MAX_MEM		1000000L /* default: one megabyte */
+#endif
+
+GLOBAL(long)
+jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
+		    long max_bytes_needed, long already_allocated)
+{
+  return cinfo->mem->max_memory_to_use - already_allocated;
+}
+
+
+/*
+ * Backing store (temporary file) management.
+ * Backing store objects are only used when the value returned by
+ * jpeg_mem_available is less than the total space needed.  You can dispense
+ * with these routines if you have plenty of virtual memory; see jmemnobs.c.
+ */
+
+
+METHODDEF(void)
+read_backing_store (j_common_ptr cinfo, backing_store_ptr info,
+		    void FAR * buffer_address,
+		    long file_offset, long byte_count)
+{
+  if (fseek(info->temp_file, file_offset, SEEK_SET))
+    ERREXIT(cinfo, JERR_TFILE_SEEK);
+  if (JFREAD(info->temp_file, buffer_address, byte_count)
+      != (size_t) byte_count)
+    ERREXIT(cinfo, JERR_TFILE_READ);
+}
+
+
+METHODDEF(void)
+write_backing_store (j_common_ptr cinfo, backing_store_ptr info,
+		     void FAR * buffer_address,
+		     long file_offset, long byte_count)
+{
+  if (fseek(info->temp_file, file_offset, SEEK_SET))
+    ERREXIT(cinfo, JERR_TFILE_SEEK);
+  if (JFWRITE(info->temp_file, buffer_address, byte_count)
+      != (size_t) byte_count)
+    ERREXIT(cinfo, JERR_TFILE_WRITE);
+}
+
+
+METHODDEF(void)
+close_backing_store (j_common_ptr cinfo, backing_store_ptr info)
+{
+  fclose(info->temp_file);	/* close the file */
+  unlink(info->temp_name);	/* delete the file */
+/* If your system doesn't have unlink(), use remove() instead.
+ * remove() is the ANSI-standard name for this function, but if
+ * your system was ANSI you'd be using jmemansi.c, right?
+ */
+  TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name);
+}
+
+
+/*
+ * Initial opening of a backing-store object.
+ */
+
+GLOBAL(void)
+jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
+			 long total_bytes_needed)
+{
+  select_file_name(info->temp_name);
+  if ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL)
+    ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
+  info->read_backing_store = read_backing_store;
+  info->write_backing_store = write_backing_store;
+  info->close_backing_store = close_backing_store;
+  TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
+}
+
+
+/*
+ * These routines take care of any system-dependent initialization and
+ * cleanup required.
+ */
+
+GLOBAL(long)
+jpeg_mem_init (j_common_ptr cinfo)
+{
+  next_file_num = 0;		/* initialize temp file name generator */
+  return DEFAULT_MAX_MEM;	/* default for max_memory_to_use */
+}
+
+GLOBAL(void)
+jpeg_mem_term (j_common_ptr cinfo)
+{
+  /* no work */
+}
diff --git a/src/libjpeg/jmemnobs.c b/src/libjpeg/jmemnobs.c
new file mode 100644
index 0000000..6aa1e92
--- /dev/null
+++ b/src/libjpeg/jmemnobs.c
@@ -0,0 +1,109 @@
+/*
+ * jmemnobs.c
+ *
+ * Copyright (C) 1992-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file provides a really simple implementation of the system-
+ * dependent portion of the JPEG memory manager.  This implementation
+ * assumes that no backing-store files are needed: all required space
+ * can be obtained from malloc().
+ * This is very portable in the sense that it'll compile on almost anything,
+ * but you'd better have lots of main memory (or virtual memory) if you want
+ * to process big images.
+ * Note that the max_memory_to_use option is ignored by this implementation.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jmemsys.h"		/* import the system-dependent declarations */
+
+#ifndef HAVE_STDLIB_H		/* <stdlib.h> should declare malloc(),free() */
+extern void * malloc JPP((size_t size));
+extern void free JPP((void *ptr));
+#endif
+
+
+/*
+ * Memory allocation and freeing are controlled by the regular library
+ * routines malloc() and free().
+ */
+
+GLOBAL(void *)
+jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
+{
+  return (void *) malloc(sizeofobject);
+}
+
+GLOBAL(void)
+jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
+{
+  free(object);
+}
+
+
+/*
+ * "Large" objects are treated the same as "small" ones.
+ * NB: although we include FAR keywords in the routine declarations,
+ * this file won't actually work in 80x86 small/medium model; at least,
+ * you probably won't be able to process useful-size images in only 64KB.
+ */
+
+GLOBAL(void FAR *)
+jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
+{
+  return (void FAR *) malloc(sizeofobject);
+}
+
+GLOBAL(void)
+jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
+{
+  free(object);
+}
+
+
+/*
+ * This routine computes the total memory space available for allocation.
+ * Here we always say, "we got all you want bud!"
+ */
+
+GLOBAL(long)
+jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
+		    long max_bytes_needed, long already_allocated)
+{
+  return max_bytes_needed;
+}
+
+
+/*
+ * Backing store (temporary file) management.
+ * Since jpeg_mem_available always promised the moon,
+ * this should never be called and we can just error out.
+ */
+
+GLOBAL(void)
+jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
+			 long total_bytes_needed)
+{
+  ERREXIT(cinfo, JERR_NO_BACKING_STORE);
+}
+
+
+/*
+ * These routines take care of any system-dependent initialization and
+ * cleanup required.  Here, there isn't any.
+ */
+
+GLOBAL(long)
+jpeg_mem_init (j_common_ptr cinfo)
+{
+  return 0;			/* just set max_memory_to_use to 0 */
+}
+
+GLOBAL(void)
+jpeg_mem_term (j_common_ptr cinfo)
+{
+  /* no work */
+}
diff --git a/src/libjpeg/jmemsys.h b/src/libjpeg/jmemsys.h
new file mode 100644
index 0000000..2a87961
--- /dev/null
+++ b/src/libjpeg/jmemsys.h
@@ -0,0 +1,198 @@
+/*
+ * jmemsys.h
+ *
+ * Copyright (C) 1992-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This include file defines the interface between the system-independent
+ * and system-dependent portions of the JPEG memory manager.  No other
+ * modules need include it.  (The system-independent portion is jmemmgr.c;
+ * there are several different versions of the system-dependent portion.)
+ *
+ * This file works as-is for the system-dependent memory managers supplied
+ * in the IJG distribution.  You may need to modify it if you write a
+ * custom memory manager.  If system-dependent changes are needed in
+ * this file, the best method is to #ifdef them based on a configuration
+ * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR
+ * and USE_MAC_MEMMGR.
+ */
+
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_get_small		jGetSmall
+#define jpeg_free_small		jFreeSmall
+#define jpeg_get_large		jGetLarge
+#define jpeg_free_large		jFreeLarge
+#define jpeg_mem_available	jMemAvail
+#define jpeg_open_backing_store	jOpenBackStore
+#define jpeg_mem_init		jMemInit
+#define jpeg_mem_term		jMemTerm
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/*
+ * These two functions are used to allocate and release small chunks of
+ * memory.  (Typically the total amount requested through jpeg_get_small is
+ * no more than 20K or so; this will be requested in chunks of a few K each.)
+ * Behavior should be the same as for the standard library functions malloc
+ * and free; in particular, jpeg_get_small must return NULL on failure.
+ * On most systems, these ARE malloc and free.  jpeg_free_small is passed the
+ * size of the object being freed, just in case it's needed.
+ * On an 80x86 machine using small-data memory model, these manage near heap.
+ */
+
+EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject));
+EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object,
+				  size_t sizeofobject));
+
+/*
+ * These two functions are used to allocate and release large chunks of
+ * memory (up to the total free space designated by jpeg_mem_available).
+ * The interface is the same as above, except that on an 80x86 machine,
+ * far pointers are used.  On most other machines these are identical to
+ * the jpeg_get/free_small routines; but we keep them separate anyway,
+ * in case a different allocation strategy is desirable for large chunks.
+ */
+
+EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo,
+				       size_t sizeofobject));
+EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,
+				  size_t sizeofobject));
+
+/*
+ * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may
+ * be requested in a single call to jpeg_get_large (and jpeg_get_small for that
+ * matter, but that case should never come into play).  This macro is needed
+ * to model the 64Kb-segment-size limit of far addressing on 80x86 machines.
+ * On those machines, we expect that jconfig.h will provide a proper value.
+ * On machines with 32-bit flat address spaces, any large constant may be used.
+ *
+ * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type
+ * size_t and will be a multiple of sizeof(align_type).
+ */
+
+#ifndef MAX_ALLOC_CHUNK		/* may be overridden in jconfig.h */
+#define MAX_ALLOC_CHUNK  1000000000L
+#endif
+
+/*
+ * This routine computes the total space still available for allocation by
+ * jpeg_get_large.  If more space than this is needed, backing store will be
+ * used.  NOTE: any memory already allocated must not be counted.
+ *
+ * There is a minimum space requirement, corresponding to the minimum
+ * feasible buffer sizes; jmemmgr.c will request that much space even if
+ * jpeg_mem_available returns zero.  The maximum space needed, enough to hold
+ * all working storage in memory, is also passed in case it is useful.
+ * Finally, the total space already allocated is passed.  If no better
+ * method is available, cinfo->mem->max_memory_to_use - already_allocated
+ * is often a suitable calculation.
+ *
+ * It is OK for jpeg_mem_available to underestimate the space available
+ * (that'll just lead to more backing-store access than is really necessary).
+ * However, an overestimate will lead to failure.  Hence it's wise to subtract
+ * a slop factor from the true available space.  5% should be enough.
+ *
+ * On machines with lots of virtual memory, any large constant may be returned.
+ * Conversely, zero may be returned to always use the minimum amount of memory.
+ */
+
+EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo,
+				     long min_bytes_needed,
+				     long max_bytes_needed,
+				     long already_allocated));
+
+
+/*
+ * This structure holds whatever state is needed to access a single
+ * backing-store object.  The read/write/close method pointers are called
+ * by jmemmgr.c to manipulate the backing-store object; all other fields
+ * are private to the system-dependent backing store routines.
+ */
+
+#define TEMP_NAME_LENGTH   64	/* max length of a temporary file's name */
+
+
+#ifdef USE_MSDOS_MEMMGR		/* DOS-specific junk */
+
+typedef unsigned short XMSH;	/* type of extended-memory handles */
+typedef unsigned short EMSH;	/* type of expanded-memory handles */
+
+typedef union {
+  short file_handle;		/* DOS file handle if it's a temp file */
+  XMSH xms_handle;		/* handle if it's a chunk of XMS */
+  EMSH ems_handle;		/* handle if it's a chunk of EMS */
+} handle_union;
+
+#endif /* USE_MSDOS_MEMMGR */
+
+#ifdef USE_MAC_MEMMGR		/* Mac-specific junk */
+#include <Files.h>
+#endif /* USE_MAC_MEMMGR */
+
+
+typedef struct backing_store_struct * backing_store_ptr;
+
+typedef struct backing_store_struct {
+  /* Methods for reading/writing/closing this backing-store object */
+  JMETHOD(void, read_backing_store, (j_common_ptr cinfo,
+				     backing_store_ptr info,
+				     void FAR * buffer_address,
+				     long file_offset, long byte_count));
+  JMETHOD(void, write_backing_store, (j_common_ptr cinfo,
+				      backing_store_ptr info,
+				      void FAR * buffer_address,
+				      long file_offset, long byte_count));
+  JMETHOD(void, close_backing_store, (j_common_ptr cinfo,
+				      backing_store_ptr info));
+
+  /* Private fields for system-dependent backing-store management */
+#ifdef USE_MSDOS_MEMMGR
+  /* For the MS-DOS manager (jmemdos.c), we need: */
+  handle_union handle;		/* reference to backing-store storage object */
+  char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
+#else
+#ifdef USE_MAC_MEMMGR
+  /* For the Mac manager (jmemmac.c), we need: */
+  short temp_file;		/* file reference number to temp file */
+  FSSpec tempSpec;		/* the FSSpec for the temp file */
+  char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
+#else
+  /* For a typical implementation with temp files, we need: */
+  FILE * temp_file;		/* stdio reference to temp file */
+  char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */
+#endif
+#endif
+} backing_store_info;
+
+
+/*
+ * Initial opening of a backing-store object.  This must fill in the
+ * read/write/close pointers in the object.  The read/write routines
+ * may take an error exit if the specified maximum file size is exceeded.
+ * (If jpeg_mem_available always returns a large value, this routine can
+ * just take an error exit.)
+ */
+
+EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,
+					  backing_store_ptr info,
+					  long total_bytes_needed));
+
+
+/*
+ * These routines take care of any system-dependent initialization and
+ * cleanup required.  jpeg_mem_init will be called before anything is
+ * allocated (and, therefore, nothing in cinfo is of use except the error
+ * manager pointer).  It should return a suitable default value for
+ * max_memory_to_use; this may subsequently be overridden by the surrounding
+ * application.  (Note that max_memory_to_use is only important if
+ * jpeg_mem_available chooses to consult it ... no one else will.)
+ * jpeg_mem_term may assume that all requested memory has been freed and that
+ * all opened backing-store objects have been closed.
+ */
+
+EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo));
+EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo));
diff --git a/src/libjpeg/jmorecfg.h b/src/libjpeg/jmorecfg.h
new file mode 100644
index 0000000..c856e22
--- /dev/null
+++ b/src/libjpeg/jmorecfg.h
@@ -0,0 +1,363 @@
+/*
+ * jmorecfg.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains additional configuration options that customize the
+ * JPEG software for special applications or support machine-dependent
+ * optimizations.  Most users will not need to touch this file.
+ */
+
+
+/*
+ * Define BITS_IN_JSAMPLE as either
+ *   8   for 8-bit sample values (the usual setting)
+ *   12  for 12-bit sample values
+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the
+ * JPEG standard, and the IJG code does not support anything else!
+ * We do not support run-time selection of data precision, sorry.
+ */
+
+#define BITS_IN_JSAMPLE  8	/* use 8 or 12 */
+
+
+/*
+ * Maximum number of components (color channels) allowed in JPEG image.
+ * To meet the letter of the JPEG spec, set this to 255.  However, darn
+ * few applications need more than 4 channels (maybe 5 for CMYK + alpha
+ * mask).  We recommend 10 as a reasonable compromise; use 4 if you are
+ * really short on memory.  (Each allowed component costs a hundred or so
+ * bytes of storage, whether actually used in an image or not.)
+ */
+
+#define MAX_COMPONENTS  10	/* maximum number of image components */
+
+
+/*
+ * Basic data types.
+ * You may need to change these if you have a machine with unusual data
+ * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
+ * or "long" not 32 bits.  We don't care whether "int" is 16 or 32 bits,
+ * but it had better be at least 16.
+ */
+
+/* Representation of a single sample (pixel element value).
+ * We frequently allocate large arrays of these, so it's important to keep
+ * them small.  But if you have memory to burn and access to char or short
+ * arrays is very slow on your hardware, you might want to change these.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+/* JSAMPLE should be the smallest type that will hold the values 0..255.
+ * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
+ */
+
+#ifdef HAVE_UNSIGNED_CHAR
+
+typedef unsigned char JSAMPLE;
+#define GETJSAMPLE(value)  ((int) (value))
+
+#else /* not HAVE_UNSIGNED_CHAR */
+
+typedef char JSAMPLE;
+#ifdef CHAR_IS_UNSIGNED
+#define GETJSAMPLE(value)  ((int) (value))
+#else
+#define GETJSAMPLE(value)  ((int) (value) & 0xFF)
+#endif /* CHAR_IS_UNSIGNED */
+
+#endif /* HAVE_UNSIGNED_CHAR */
+
+#define MAXJSAMPLE	255
+#define CENTERJSAMPLE	128
+
+#endif /* BITS_IN_JSAMPLE == 8 */
+
+
+#if BITS_IN_JSAMPLE == 12
+/* JSAMPLE should be the smallest type that will hold the values 0..4095.
+ * On nearly all machines "short" will do nicely.
+ */
+
+typedef short JSAMPLE;
+#define GETJSAMPLE(value)  ((int) (value))
+
+#define MAXJSAMPLE	4095
+#define CENTERJSAMPLE	2048
+
+#endif /* BITS_IN_JSAMPLE == 12 */
+
+
+/* Representation of a DCT frequency coefficient.
+ * This should be a signed value of at least 16 bits; "short" is usually OK.
+ * Again, we allocate large arrays of these, but you can change to int
+ * if you have memory to burn and "short" is really slow.
+ */
+
+typedef short JCOEF;
+
+
+/* Compressed datastreams are represented as arrays of JOCTET.
+ * These must be EXACTLY 8 bits wide, at least once they are written to
+ * external storage.  Note that when using the stdio data source/destination
+ * managers, this is also the data type passed to fread/fwrite.
+ */
+
+#ifdef HAVE_UNSIGNED_CHAR
+
+typedef unsigned char JOCTET;
+#define GETJOCTET(value)  (value)
+
+#else /* not HAVE_UNSIGNED_CHAR */
+
+typedef char JOCTET;
+#ifdef CHAR_IS_UNSIGNED
+#define GETJOCTET(value)  (value)
+#else
+#define GETJOCTET(value)  ((value) & 0xFF)
+#endif /* CHAR_IS_UNSIGNED */
+
+#endif /* HAVE_UNSIGNED_CHAR */
+
+
+/* These typedefs are used for various table entries and so forth.
+ * They must be at least as wide as specified; but making them too big
+ * won't cost a huge amount of memory, so we don't provide special
+ * extraction code like we did for JSAMPLE.  (In other words, these
+ * typedefs live at a different point on the speed/space tradeoff curve.)
+ */
+
+/* UINT8 must hold at least the values 0..255. */
+
+#ifdef HAVE_UNSIGNED_CHAR
+typedef unsigned char UINT8;
+#else /* not HAVE_UNSIGNED_CHAR */
+#ifdef CHAR_IS_UNSIGNED
+typedef char UINT8;
+#else /* not CHAR_IS_UNSIGNED */
+typedef short UINT8;
+#endif /* CHAR_IS_UNSIGNED */
+#endif /* HAVE_UNSIGNED_CHAR */
+
+/* UINT16 must hold at least the values 0..65535. */
+
+#ifdef HAVE_UNSIGNED_SHORT
+typedef unsigned short UINT16;
+#else /* not HAVE_UNSIGNED_SHORT */
+typedef unsigned int UINT16;
+#endif /* HAVE_UNSIGNED_SHORT */
+
+/* INT16 must hold at least the values -32768..32767. */
+
+#ifndef XMD_H			/* X11/xmd.h correctly defines INT16 */
+typedef short INT16;
+#endif
+
+/* INT32 must hold at least signed 32-bit values. */
+
+#ifndef XMD_H			/* X11/xmd.h correctly defines INT32 */
+typedef long INT32;
+#endif
+
+/* Datatype used for image dimensions.  The JPEG standard only supports
+ * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore
+ * "unsigned int" is sufficient on all machines.  However, if you need to
+ * handle larger images and you don't mind deviating from the spec, you
+ * can change this datatype.
+ */
+
+typedef unsigned int JDIMENSION;
+
+#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */
+
+
+/* These macros are used in all function definitions and extern declarations.
+ * You could modify them if you need to change function linkage conventions;
+ * in particular, you'll need to do that to make the library a Windows DLL.
+ * Another application is to make all functions global for use with debuggers
+ * or code profilers that require it.
+ */
+
+/* a function called through method pointers: */
+#define METHODDEF(type)		static type
+/* a function used only in its module: */
+#define LOCAL(type)		static type
+/* a function referenced thru EXTERNs: */
+#define GLOBAL(type)		type
+/* a reference to a GLOBAL function: */
+#define EXTERN(type)		extern type
+
+
+/* This macro is used to declare a "method", that is, a function pointer.
+ * We want to supply prototype parameters if the compiler can cope.
+ * Note that the arglist parameter must be parenthesized!
+ * Again, you can customize this if you need special linkage keywords.
+ */
+
+#ifdef HAVE_PROTOTYPES
+#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist
+#else
+#define JMETHOD(type,methodname,arglist)  type (*methodname) ()
+#endif
+
+
+/* Here is the pseudo-keyword for declaring pointers that must be "far"
+ * on 80x86 machines.  Most of the specialized coding for 80x86 is handled
+ * by just saying "FAR *" where such a pointer is needed.  In a few places
+ * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
+ */
+
+#ifdef NEED_FAR_POINTERS
+#define FAR  far
+#else
+#define FAR
+#endif
+
+
+/*
+ * On a few systems, type boolean and/or its values FALSE, TRUE may appear
+ * in standard header files.  Or you may have conflicts with application-
+ * specific header files that you want to include together with these files.
+ * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
+ */
+
+#ifndef HAVE_BOOLEAN
+typedef int boolean;
+#endif
+#ifndef FALSE			/* in case these macros already exist */
+#define FALSE	0		/* values of boolean */
+#endif
+#ifndef TRUE
+#define TRUE	1
+#endif
+
+
+/*
+ * The remaining options affect code selection within the JPEG library,
+ * but they don't need to be visible to most applications using the library.
+ * To minimize application namespace pollution, the symbols won't be
+ * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
+ */
+
+#ifdef JPEG_INTERNALS
+#define JPEG_INTERNAL_OPTIONS
+#endif
+
+#ifdef JPEG_INTERNAL_OPTIONS
+
+
+/*
+ * These defines indicate whether to include various optional functions.
+ * Undefining some of these symbols will produce a smaller but less capable
+ * library.  Note that you can leave certain source files out of the
+ * compilation/linking process if you've #undef'd the corresponding symbols.
+ * (You may HAVE to do that if your compiler doesn't like null source files.)
+ */
+
+/* Arithmetic coding is unsupported for legal reasons.  Complaints to IBM. */
+
+/* Capability options common to encoder and decoder: */
+
+#define DCT_ISLOW_SUPPORTED	/* slow but accurate integer algorithm */
+#define DCT_IFAST_SUPPORTED	/* faster, less accurate integer method */
+#define DCT_FLOAT_SUPPORTED	/* floating-point: accurate, fast on fast HW */
+
+/* Encoder capability options: */
+
+#undef  C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */
+#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
+#define C_PROGRESSIVE_SUPPORTED	    /* Progressive JPEG? (Requires MULTISCAN)*/
+#define ENTROPY_OPT_SUPPORTED	    /* Optimization of entropy coding parms? */
+/* Note: if you selected 12-bit data precision, it is dangerous to turn off
+ * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit
+ * precision, so jchuff.c normally uses entropy optimization to compute
+ * usable tables for higher precision.  If you don't want to do optimization,
+ * you'll have to supply different default Huffman tables.
+ * The exact same statements apply for progressive JPEG: the default tables
+ * don't work for progressive mode.  (This may get fixed, however.)
+ */
+#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */
+
+/* Decoder capability options: */
+
+#undef  D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */
+#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
+#define D_PROGRESSIVE_SUPPORTED	    /* Progressive JPEG? (Requires MULTISCAN)*/
+#define SAVE_MARKERS_SUPPORTED	    /* jpeg_save_markers() needed? */
+#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */
+#define IDCT_SCALING_SUPPORTED	    /* Output rescaling via IDCT? */
+#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */
+#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */
+#define QUANT_1PASS_SUPPORTED	    /* 1-pass color quantization? */
+#define QUANT_2PASS_SUPPORTED	    /* 2-pass color quantization? */
+
+/* more capability options later, no doubt */
+
+
+/*
+ * Ordering of RGB data in scanlines passed to or from the application.
+ * If your application wants to deal with data in the order B,G,R, just
+ * change these macros.  You can also deal with formats such as R,G,B,X
+ * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing
+ * the offsets will also change the order in which colormap data is organized.
+ * RESTRICTIONS:
+ * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
+ * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
+ *    useful if you are using JPEG color spaces other than YCbCr or grayscale.
+ * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
+ *    is not 3 (they don't understand about dummy color components!).  So you
+ *    can't use color quantization if you change that value.
+ */
+
+#define RGB_RED		0	/* Offset of Red in an RGB scanline element */
+#define RGB_GREEN	1	/* Offset of Green */
+#define RGB_BLUE	2	/* Offset of Blue */
+#define RGB_PIXELSIZE	3	/* JSAMPLEs per RGB scanline element */
+
+
+/* Definitions for speed-related optimizations. */
+
+
+/* If your compiler supports inline functions, define INLINE
+ * as the inline keyword; otherwise define it as empty.
+ */
+
+#ifndef INLINE
+#ifdef __GNUC__			/* for instance, GNU C knows about inline */
+#define INLINE __inline__
+#endif
+#ifndef INLINE
+#define INLINE			/* default is to define it as empty */
+#endif
+#endif
+
+
+/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
+ * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER
+ * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.
+ */
+
+#ifndef MULTIPLIER
+#define MULTIPLIER  int		/* type for fastest integer multiply */
+#endif
+
+
+/* FAST_FLOAT should be either float or double, whichever is done faster
+ * by your compiler.  (Note that this type is only used in the floating point
+ * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
+ * Typically, float is faster in ANSI C compilers, while double is faster in
+ * pre-ANSI compilers (because they insist on converting to double anyway).
+ * The code below therefore chooses float if we have ANSI-style prototypes.
+ */
+
+#ifndef FAST_FLOAT
+#ifdef HAVE_PROTOTYPES
+#define FAST_FLOAT  float
+#else
+#define FAST_FLOAT  double
+#endif
+#endif
+
+#endif /* JPEG_INTERNAL_OPTIONS */
diff --git a/src/libjpeg/jpegint.h b/src/libjpeg/jpegint.h
new file mode 100644
index 0000000..685a361
--- /dev/null
+++ b/src/libjpeg/jpegint.h
@@ -0,0 +1,392 @@
+/*
+ * jpegint.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file provides common declarations for the various JPEG modules.
+ * These declarations are considered internal to the JPEG library; most
+ * applications using the library shouldn't need to include this file.
+ */
+
+
+/* Declarations for both compression & decompression */
+
+typedef enum {			/* Operating modes for buffer controllers */
+	JBUF_PASS_THRU,		/* Plain stripwise operation */
+	/* Remaining modes require a full-image buffer to have been created */
+	JBUF_SAVE_SOURCE,	/* Run source subobject only, save output */
+	JBUF_CRANK_DEST,	/* Run dest subobject only, using saved data */
+	JBUF_SAVE_AND_PASS	/* Run both subobjects, save output */
+} J_BUF_MODE;
+
+/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
+#define CSTATE_START	100	/* after create_compress */
+#define CSTATE_SCANNING	101	/* start_compress done, write_scanlines OK */
+#define CSTATE_RAW_OK	102	/* start_compress done, write_raw_data OK */
+#define CSTATE_WRCOEFS	103	/* jpeg_write_coefficients done */
+#define DSTATE_START	200	/* after create_decompress */
+#define DSTATE_INHEADER	201	/* reading header markers, no SOS yet */
+#define DSTATE_READY	202	/* found SOS, ready for start_decompress */
+#define DSTATE_PRELOAD	203	/* reading multiscan file in start_decompress*/
+#define DSTATE_PRESCAN	204	/* performing dummy pass for 2-pass quant */
+#define DSTATE_SCANNING	205	/* start_decompress done, read_scanlines OK */
+#define DSTATE_RAW_OK	206	/* start_decompress done, read_raw_data OK */
+#define DSTATE_BUFIMAGE	207	/* expecting jpeg_start_output */
+#define DSTATE_BUFPOST	208	/* looking for SOS/EOI in jpeg_finish_output */
+#define DSTATE_RDCOEFS	209	/* reading file in jpeg_read_coefficients */
+#define DSTATE_STOPPING	210	/* looking for EOI in jpeg_finish_decompress */
+
+
+/* Declarations for compression modules */
+
+/* Master control module */
+struct jpeg_comp_master {
+  JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));
+  JMETHOD(void, pass_startup, (j_compress_ptr cinfo));
+  JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
+
+  /* State variables made visible to other modules */
+  boolean call_pass_startup;	/* True if pass_startup must be called */
+  boolean is_last_pass;		/* True during last pass */
+};
+
+/* Main buffer control (downsampled-data buffer) */
+struct jpeg_c_main_controller {
+  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
+  JMETHOD(void, process_data, (j_compress_ptr cinfo,
+			       JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+			       JDIMENSION in_rows_avail));
+};
+
+/* Compression preprocessing (downsampling input buffer control) */
+struct jpeg_c_prep_controller {
+  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
+  JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,
+				   JSAMPARRAY input_buf,
+				   JDIMENSION *in_row_ctr,
+				   JDIMENSION in_rows_avail,
+				   JSAMPIMAGE output_buf,
+				   JDIMENSION *out_row_group_ctr,
+				   JDIMENSION out_row_groups_avail));
+};
+
+/* Coefficient buffer control */
+struct jpeg_c_coef_controller {
+  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
+  JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,
+				   JSAMPIMAGE input_buf));
+};
+
+/* Colorspace conversion */
+struct jpeg_color_converter {
+  JMETHOD(void, start_pass, (j_compress_ptr cinfo));
+  JMETHOD(void, color_convert, (j_compress_ptr cinfo,
+				JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+				JDIMENSION output_row, int num_rows));
+};
+
+/* Downsampling */
+struct jpeg_downsampler {
+  JMETHOD(void, start_pass, (j_compress_ptr cinfo));
+  JMETHOD(void, downsample, (j_compress_ptr cinfo,
+			     JSAMPIMAGE input_buf, JDIMENSION in_row_index,
+			     JSAMPIMAGE output_buf,
+			     JDIMENSION out_row_group_index));
+
+  boolean need_context_rows;	/* TRUE if need rows above & below */
+};
+
+/* Forward DCT (also controls coefficient quantization) */
+struct jpeg_forward_dct {
+  JMETHOD(void, start_pass, (j_compress_ptr cinfo));
+  /* perhaps this should be an array??? */
+  JMETHOD(void, forward_DCT, (j_compress_ptr cinfo,
+			      jpeg_component_info * compptr,
+			      JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
+			      JDIMENSION start_row, JDIMENSION start_col,
+			      JDIMENSION num_blocks));
+};
+
+/* Entropy encoding */
+struct jpeg_entropy_encoder {
+  JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
+  JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
+  JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
+};
+
+/* Marker writing */
+struct jpeg_marker_writer {
+  JMETHOD(void, write_file_header, (j_compress_ptr cinfo));
+  JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));
+  JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));
+  JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));
+  JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));
+  /* These routines are exported to allow insertion of extra markers */
+  /* Probably only COM and APPn markers should be written this way */
+  JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,
+				      unsigned int datalen));
+  JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));
+};
+
+
+/* Declarations for decompression modules */
+
+/* Master control module */
+struct jpeg_decomp_master {
+  JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));
+  JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
+
+  /* State variables made visible to other modules */
+  boolean is_dummy_pass;	/* True during 1st pass for 2-pass quant */
+};
+
+/* Input control module */
+struct jpeg_input_controller {
+  JMETHOD(int, consume_input, (j_decompress_ptr cinfo));
+  JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));
+  JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
+  JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));
+
+  /* State variables made visible to other modules */
+  boolean has_multiple_scans;	/* True if file has multiple scans */
+  boolean eoi_reached;		/* True when EOI has been consumed */
+};
+
+/* Main buffer control (downsampled-data buffer) */
+struct jpeg_d_main_controller {
+  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
+  JMETHOD(void, process_data, (j_decompress_ptr cinfo,
+			       JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+			       JDIMENSION out_rows_avail));
+};
+
+/* Coefficient buffer control */
+struct jpeg_d_coef_controller {
+  JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
+  JMETHOD(int, consume_data, (j_decompress_ptr cinfo));
+  JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));
+  JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,
+				 JSAMPIMAGE output_buf));
+  /* Pointer to array of coefficient virtual arrays, or NULL if none */
+  jvirt_barray_ptr *coef_arrays;
+};
+
+/* Decompression postprocessing (color quantization buffer control) */
+struct jpeg_d_post_controller {
+  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
+  JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,
+				    JSAMPIMAGE input_buf,
+				    JDIMENSION *in_row_group_ctr,
+				    JDIMENSION in_row_groups_avail,
+				    JSAMPARRAY output_buf,
+				    JDIMENSION *out_row_ctr,
+				    JDIMENSION out_rows_avail));
+};
+
+/* Marker reading & parsing */
+struct jpeg_marker_reader {
+  JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));
+  /* Read markers until SOS or EOI.
+   * Returns same codes as are defined for jpeg_consume_input:
+   * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
+   */
+  JMETHOD(int, read_markers, (j_decompress_ptr cinfo));
+  /* Read a restart marker --- exported for use by entropy decoder only */
+  jpeg_marker_parser_method read_restart_marker;
+
+  /* State of marker reader --- nominally internal, but applications
+   * supplying COM or APPn handlers might like to know the state.
+   */
+  boolean saw_SOI;		/* found SOI? */
+  boolean saw_SOF;		/* found SOF? */
+  int next_restart_num;		/* next restart number expected (0-7) */
+  unsigned int discarded_bytes;	/* # of bytes skipped looking for a marker */
+};
+
+/* Entropy decoding */
+struct jpeg_entropy_decoder {
+  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+  JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
+				JBLOCKROW *MCU_data));
+
+  /* This is here to share code between baseline and progressive decoders; */
+  /* other modules probably should not use it */
+  boolean insufficient_data;	/* set TRUE after emitting warning */
+};
+
+/* Inverse DCT (also performs dequantization) */
+typedef JMETHOD(void, inverse_DCT_method_ptr,
+		(j_decompress_ptr cinfo, jpeg_component_info * compptr,
+		 JCOEFPTR coef_block,
+		 JSAMPARRAY output_buf, JDIMENSION output_col));
+
+struct jpeg_inverse_dct {
+  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+  /* It is useful to allow each component to have a separate IDCT method. */
+  inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
+};
+
+/* Upsampling (note that upsampler must also call color converter) */
+struct jpeg_upsampler {
+  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+  JMETHOD(void, upsample, (j_decompress_ptr cinfo,
+			   JSAMPIMAGE input_buf,
+			   JDIMENSION *in_row_group_ctr,
+			   JDIMENSION in_row_groups_avail,
+			   JSAMPARRAY output_buf,
+			   JDIMENSION *out_row_ctr,
+			   JDIMENSION out_rows_avail));
+
+  boolean need_context_rows;	/* TRUE if need rows above & below */
+};
+
+/* Colorspace conversion */
+struct jpeg_color_deconverter {
+  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+  JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
+				JSAMPIMAGE input_buf, JDIMENSION input_row,
+				JSAMPARRAY output_buf, int num_rows));
+};
+
+/* Color quantization or color precision reduction */
+struct jpeg_color_quantizer {
+  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));
+  JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
+				 JSAMPARRAY input_buf, JSAMPARRAY output_buf,
+				 int num_rows));
+  JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
+  JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
+};
+
+
+/* Miscellaneous useful macros */
+
+#undef MAX
+#define MAX(a,b)	((a) > (b) ? (a) : (b))
+#undef MIN
+#define MIN(a,b)	((a) < (b) ? (a) : (b))
+
+
+/* We assume that right shift corresponds to signed division by 2 with
+ * rounding towards minus infinity.  This is correct for typical "arithmetic
+ * shift" instructions that shift in copies of the sign bit.  But some
+ * C compilers implement >> with an unsigned shift.  For these machines you
+ * must define RIGHT_SHIFT_IS_UNSIGNED.
+ * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
+ * It is only applied with constant shift counts.  SHIFT_TEMPS must be
+ * included in the variables of any routine using RIGHT_SHIFT.
+ */
+
+#ifdef RIGHT_SHIFT_IS_UNSIGNED
+#define SHIFT_TEMPS	INT32 shift_temp;
+#define RIGHT_SHIFT(x,shft)  \
+	((shift_temp = (x)) < 0 ? \
+	 (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
+	 (shift_temp >> (shft)))
+#else
+#define SHIFT_TEMPS
+#define RIGHT_SHIFT(x,shft)	((x) >> (shft))
+#endif
+
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jinit_compress_master	jICompress
+#define jinit_c_master_control	jICMaster
+#define jinit_c_main_controller	jICMainC
+#define jinit_c_prep_controller	jICPrepC
+#define jinit_c_coef_controller	jICCoefC
+#define jinit_color_converter	jICColor
+#define jinit_downsampler	jIDownsampler
+#define jinit_forward_dct	jIFDCT
+#define jinit_huff_encoder	jIHEncoder
+#define jinit_phuff_encoder	jIPHEncoder
+#define jinit_marker_writer	jIMWriter
+#define jinit_master_decompress	jIDMaster
+#define jinit_d_main_controller	jIDMainC
+#define jinit_d_coef_controller	jIDCoefC
+#define jinit_d_post_controller	jIDPostC
+#define jinit_input_controller	jIInCtlr
+#define jinit_marker_reader	jIMReader
+#define jinit_huff_decoder	jIHDecoder
+#define jinit_phuff_decoder	jIPHDecoder
+#define jinit_inverse_dct	jIIDCT
+#define jinit_upsampler		jIUpsampler
+#define jinit_color_deconverter	jIDColor
+#define jinit_1pass_quantizer	jI1Quant
+#define jinit_2pass_quantizer	jI2Quant
+#define jinit_merged_upsampler	jIMUpsampler
+#define jinit_memory_mgr	jIMemMgr
+#define jdiv_round_up		jDivRound
+#define jround_up		jRound
+#define jcopy_sample_rows	jCopySamples
+#define jcopy_block_row		jCopyBlocks
+#define jzero_far		jZeroFar
+#define jpeg_zigzag_order	jZIGTable
+#define jpeg_natural_order	jZAGTable
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/* Compression module initialization routines */
+EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
+					 boolean transcode_only));
+EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,
+					  boolean need_full_buffer));
+EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,
+					  boolean need_full_buffer));
+EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,
+					  boolean need_full_buffer));
+EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
+/* Decompression module initialization routines */
+EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,
+					  boolean need_full_buffer));
+EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,
+					  boolean need_full_buffer));
+EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
+					  boolean need_full_buffer));
+EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));
+/* Memory manager initialization */
+EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
+
+/* Utility routines in jutils.c */
+EXTERN(long) jdiv_round_up JPP((long a, long b));
+EXTERN(long) jround_up JPP((long a, long b));
+EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
+				    JSAMPARRAY output_array, int dest_row,
+				    int num_rows, JDIMENSION num_cols));
+EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
+				  JDIMENSION num_blocks));
+EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
+/* Constant tables in jutils.c */
+#if 0				/* This table is not actually needed in v6a */
+extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
+#endif
+extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
+
+/* Suppress undefined-structure complaints if necessary. */
+
+#ifdef INCOMPLETE_TYPES_BROKEN
+#ifndef AM_MEMORY_MANAGER	/* only jmemmgr.c defines these */
+struct jvirt_sarray_control { long dummy; };
+struct jvirt_barray_control { long dummy; };
+#endif
+#endif /* INCOMPLETE_TYPES_BROKEN */
diff --git a/src/libjpeg/jpeglib.h b/src/libjpeg/jpeglib.h
new file mode 100644
index 0000000..b9356f3
--- /dev/null
+++ b/src/libjpeg/jpeglib.h
@@ -0,0 +1,1096 @@
+/*
+ * jpeglib.h
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the application interface for the JPEG library.
+ * Most applications using the library need only include this file,
+ * and perhaps jerror.h if they want to know the exact error codes.
+ */
+
+#ifndef JPEGLIB_H
+#define JPEGLIB_H
+
+/*
+ * First we include the configuration files that record how this
+ * installation of the JPEG library is set up.  jconfig.h can be
+ * generated automatically for many systems.  jmorecfg.h contains
+ * manual configuration options that most people need not worry about.
+ */
+
+#ifndef JCONFIG_INCLUDED	/* in case jinclude.h already did */
+#include "jconfig.h"		/* widely used configuration options */
+#endif
+#include "jmorecfg.h"		/* seldom changed options */
+
+
+/* Version ID for the JPEG library.
+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
+ */
+
+#define JPEG_LIB_VERSION  62	/* Version 6b */
+
+
+/* Various constants determining the sizes of things.
+ * All of these are specified by the JPEG standard, so don't change them
+ * if you want to be compatible.
+ */
+
+#define DCTSIZE		    8	/* The basic DCT block is 8x8 samples */
+#define DCTSIZE2	    64	/* DCTSIZE squared; # of elements in a block */
+#define NUM_QUANT_TBLS      4	/* Quantization tables are numbered 0..3 */
+#define NUM_HUFF_TBLS       4	/* Huffman tables are numbered 0..3 */
+#define NUM_ARITH_TBLS      16	/* Arith-coding tables are numbered 0..15 */
+#define MAX_COMPS_IN_SCAN   4	/* JPEG limit on # of components in one scan */
+#define MAX_SAMP_FACTOR     4	/* JPEG limit on sampling factors */
+/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
+ * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
+ * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
+ * to handle it.  We even let you do this from the jconfig.h file.  However,
+ * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
+ * sometimes emits noncompliant files doesn't mean you should too.
+ */
+#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */
+#ifndef D_MAX_BLOCKS_IN_MCU
+#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */
+#endif
+
+
+/* Data structures for images (arrays of samples and of DCT coefficients).
+ * On 80x86 machines, the image arrays are too big for near pointers,
+ * but the pointer arrays can fit in near memory.
+ */
+
+typedef JSAMPLE FAR *JSAMPROW;	/* ptr to one image row of pixel samples. */
+typedef JSAMPROW *JSAMPARRAY;	/* ptr to some rows (a 2-D sample array) */
+typedef JSAMPARRAY *JSAMPIMAGE;	/* a 3-D sample array: top index is color */
+
+typedef JCOEF JBLOCK[DCTSIZE2];	/* one block of coefficients */
+typedef JBLOCK FAR *JBLOCKROW;	/* pointer to one row of coefficient blocks */
+typedef JBLOCKROW *JBLOCKARRAY;		/* a 2-D array of coefficient blocks */
+typedef JBLOCKARRAY *JBLOCKIMAGE;	/* a 3-D array of coefficient blocks */
+
+typedef JCOEF FAR *JCOEFPTR;	/* useful in a couple of places */
+
+
+/* Types for JPEG compression parameters and working tables. */
+
+
+/* DCT coefficient quantization tables. */
+
+typedef struct {
+  /* This array gives the coefficient quantizers in natural array order
+   * (not the zigzag order in which they are stored in a JPEG DQT marker).
+   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
+   */
+  UINT16 quantval[DCTSIZE2];	/* quantization step for each coefficient */
+  /* This field is used only during compression.  It's initialized FALSE when
+   * the table is created, and set TRUE when it's been output to the file.
+   * You could suppress output of a table by setting this to TRUE.
+   * (See jpeg_suppress_tables for an example.)
+   */
+  boolean sent_table;		/* TRUE when table has been output */
+} JQUANT_TBL;
+
+
+/* Huffman coding tables. */
+
+typedef struct {
+  /* These two fields directly represent the contents of a JPEG DHT marker */
+  UINT8 bits[17];		/* bits[k] = # of symbols with codes of */
+				/* length k bits; bits[0] is unused */
+  UINT8 huffval[256];		/* The symbols, in order of incr code length */
+  /* This field is used only during compression.  It's initialized FALSE when
+   * the table is created, and set TRUE when it's been output to the file.
+   * You could suppress output of a table by setting this to TRUE.
+   * (See jpeg_suppress_tables for an example.)
+   */
+  boolean sent_table;		/* TRUE when table has been output */
+} JHUFF_TBL;
+
+
+/* Basic info about one component (color channel). */
+
+typedef struct {
+  /* These values are fixed over the whole image. */
+  /* For compression, they must be supplied by parameter setup; */
+  /* for decompression, they are read from the SOF marker. */
+  int component_id;		/* identifier for this component (0..255) */
+  int component_index;		/* its index in SOF or cinfo->comp_info[] */
+  int h_samp_factor;		/* horizontal sampling factor (1..4) */
+  int v_samp_factor;		/* vertical sampling factor (1..4) */
+  int quant_tbl_no;		/* quantization table selector (0..3) */
+  /* These values may vary between scans. */
+  /* For compression, they must be supplied by parameter setup; */
+  /* for decompression, they are read from the SOS marker. */
+  /* The decompressor output side may not use these variables. */
+  int dc_tbl_no;		/* DC entropy table selector (0..3) */
+  int ac_tbl_no;		/* AC entropy table selector (0..3) */
+  
+  /* Remaining fields should be treated as private by applications. */
+  
+  /* These values are computed during compression or decompression startup: */
+  /* Component's size in DCT blocks.
+   * Any dummy blocks added to complete an MCU are not counted; therefore
+   * these values do not depend on whether a scan is interleaved or not.
+   */
+  JDIMENSION width_in_blocks;
+  JDIMENSION height_in_blocks;
+  /* Size of a DCT block in samples.  Always DCTSIZE for compression.
+   * For decompression this is the size of the output from one DCT block,
+   * reflecting any scaling we choose to apply during the IDCT step.
+   * Values of 1,2,4,8 are likely to be supported.  Note that different
+   * components may receive different IDCT scalings.
+   */
+  int DCT_scaled_size;
+  /* The downsampled dimensions are the component's actual, unpadded number
+   * of samples at the main buffer (preprocessing/compression interface), thus
+   * downsampled_width = ceil(image_width * Hi/Hmax)
+   * and similarly for height.  For decompression, IDCT scaling is included, so
+   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE)
+   */
+  JDIMENSION downsampled_width;	 /* actual width in samples */
+  JDIMENSION downsampled_height; /* actual height in samples */
+  /* This flag is used only for decompression.  In cases where some of the
+   * components will be ignored (eg grayscale output from YCbCr image),
+   * we can skip most computations for the unused components.
+   */
+  boolean component_needed;	/* do we need the value of this component? */
+
+  /* These values are computed before starting a scan of the component. */
+  /* The decompressor output side may not use these variables. */
+  int MCU_width;		/* number of blocks per MCU, horizontally */
+  int MCU_height;		/* number of blocks per MCU, vertically */
+  int MCU_blocks;		/* MCU_width * MCU_height */
+  int MCU_sample_width;		/* MCU width in samples, MCU_width*DCT_scaled_size */
+  int last_col_width;		/* # of non-dummy blocks across in last MCU */
+  int last_row_height;		/* # of non-dummy blocks down in last MCU */
+
+  /* Saved quantization table for component; NULL if none yet saved.
+   * See jdinput.c comments about the need for this information.
+   * This field is currently used only for decompression.
+   */
+  JQUANT_TBL * quant_table;
+
+  /* Private per-component storage for DCT or IDCT subsystem. */
+  void * dct_table;
+} jpeg_component_info;
+
+
+/* The script for encoding a multiple-scan file is an array of these: */
+
+typedef struct {
+  int comps_in_scan;		/* number of components encoded in this scan */
+  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
+  int Ss, Se;			/* progressive JPEG spectral selection parms */
+  int Ah, Al;			/* progressive JPEG successive approx. parms */
+} jpeg_scan_info;
+
+/* The decompressor can save APPn and COM markers in a list of these: */
+
+typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;
+
+struct jpeg_marker_struct {
+  jpeg_saved_marker_ptr next;	/* next in list, or NULL */
+  UINT8 marker;			/* marker code: JPEG_COM, or JPEG_APP0+n */
+  unsigned int original_length;	/* # bytes of data in the file */
+  unsigned int data_length;	/* # bytes of data saved at data[] */
+  JOCTET FAR * data;		/* the data contained in the marker */
+  /* the marker length word is not counted in data_length or original_length */
+};
+
+/* Known color spaces. */
+
+typedef enum {
+	JCS_UNKNOWN,		/* error/unspecified */
+	JCS_GRAYSCALE,		/* monochrome */
+	JCS_RGB,		/* red/green/blue */
+	JCS_YCbCr,		/* Y/Cb/Cr (also known as YUV) */
+	JCS_CMYK,		/* C/M/Y/K */
+	JCS_YCCK		/* Y/Cb/Cr/K */
+} J_COLOR_SPACE;
+
+/* DCT/IDCT algorithm options. */
+
+typedef enum {
+	JDCT_ISLOW,		/* slow but accurate integer algorithm */
+	JDCT_IFAST,		/* faster, less accurate integer method */
+	JDCT_FLOAT		/* floating-point: accurate, fast on fast HW */
+} J_DCT_METHOD;
+
+#ifndef JDCT_DEFAULT		/* may be overridden in jconfig.h */
+#define JDCT_DEFAULT  JDCT_ISLOW
+#endif
+#ifndef JDCT_FASTEST		/* may be overridden in jconfig.h */
+#define JDCT_FASTEST  JDCT_IFAST
+#endif
+
+/* Dithering options for decompression. */
+
+typedef enum {
+	JDITHER_NONE,		/* no dithering */
+	JDITHER_ORDERED,	/* simple ordered dither */
+	JDITHER_FS		/* Floyd-Steinberg error diffusion dither */
+} J_DITHER_MODE;
+
+
+/* Common fields between JPEG compression and decompression master structs. */
+
+#define jpeg_common_fields \
+  struct jpeg_error_mgr * err;	/* Error handler module */\
+  struct jpeg_memory_mgr * mem;	/* Memory manager module */\
+  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
+  void * client_data;		/* Available for use by application */\
+  boolean is_decompressor;	/* So common code can tell which is which */\
+  int global_state		/* For checking call sequence validity */
+
+/* Routines that are to be used by both halves of the library are declared
+ * to receive a pointer to this structure.  There are no actual instances of
+ * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
+ */
+struct jpeg_common_struct {
+  jpeg_common_fields;		/* Fields common to both master struct types */
+  /* Additional fields follow in an actual jpeg_compress_struct or
+   * jpeg_decompress_struct.  All three structs must agree on these
+   * initial fields!  (This would be a lot cleaner in C++.)
+   */
+};
+
+typedef struct jpeg_common_struct * j_common_ptr;
+typedef struct jpeg_compress_struct * j_compress_ptr;
+typedef struct jpeg_decompress_struct * j_decompress_ptr;
+
+
+/* Master record for a compression instance */
+
+struct jpeg_compress_struct {
+  jpeg_common_fields;		/* Fields shared with jpeg_decompress_struct */
+
+  /* Destination for compressed data */
+  struct jpeg_destination_mgr * dest;
+
+  /* Description of source image --- these fields must be filled in by
+   * outer application before starting compression.  in_color_space must
+   * be correct before you can even call jpeg_set_defaults().
+   */
+
+  JDIMENSION image_width;	/* input image width */
+  JDIMENSION image_height;	/* input image height */
+  int input_components;		/* # of color components in input image */
+  J_COLOR_SPACE in_color_space;	/* colorspace of input image */
+
+  double input_gamma;		/* image gamma of input image */
+
+  /* Compression parameters --- these fields must be set before calling
+   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to
+   * initialize everything to reasonable defaults, then changing anything
+   * the application specifically wants to change.  That way you won't get
+   * burnt when new parameters are added.  Also note that there are several
+   * helper routines to simplify changing parameters.
+   */
+
+  int data_precision;		/* bits of precision in image data */
+
+  int num_components;		/* # of color components in JPEG image */
+  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
+
+  jpeg_component_info * comp_info;
+  /* comp_info[i] describes component that appears i'th in SOF */
+  
+  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
+  /* ptrs to coefficient quantization tables, or NULL if not defined */
+  
+  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  /* ptrs to Huffman coding tables, or NULL if not defined */
+  
+  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+  int num_scans;		/* # of entries in scan_info array */
+  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
+  /* The default value of scan_info is NULL, which causes a single-scan
+   * sequential JPEG file to be emitted.  To create a multi-scan file,
+   * set num_scans and scan_info to point to an array of scan definitions.
+   */
+
+  boolean raw_data_in;		/* TRUE=caller supplies downsampled data */
+  boolean arith_code;		/* TRUE=arithmetic coding, FALSE=Huffman */
+  boolean optimize_coding;	/* TRUE=optimize entropy encoding parms */
+  boolean CCIR601_sampling;	/* TRUE=first samples are cosited */
+  int smoothing_factor;		/* 1..100, or 0 for no input smoothing */
+  J_DCT_METHOD dct_method;	/* DCT algorithm selector */
+
+  /* The restart interval can be specified in absolute MCUs by setting
+   * restart_interval, or in MCU rows by setting restart_in_rows
+   * (in which case the correct restart_interval will be figured
+   * for each scan).
+   */
+  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
+  int restart_in_rows;		/* if > 0, MCU rows per restart interval */
+
+  /* Parameters controlling emission of special markers. */
+
+  boolean write_JFIF_header;	/* should a JFIF marker be written? */
+  UINT8 JFIF_major_version;	/* What to write for the JFIF version number */
+  UINT8 JFIF_minor_version;
+  /* These three values are not used by the JPEG code, merely copied */
+  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */
+  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */
+  /* ratio is defined by X_density/Y_density even when density_unit=0. */
+  UINT8 density_unit;		/* JFIF code for pixel size units */
+  UINT16 X_density;		/* Horizontal pixel density */
+  UINT16 Y_density;		/* Vertical pixel density */
+  boolean write_Adobe_marker;	/* should an Adobe marker be written? */
+  
+  /* State variable: index of next scanline to be written to
+   * jpeg_write_scanlines().  Application may use this to control its
+   * processing loop, e.g., "while (next_scanline < image_height)".
+   */
+
+  JDIMENSION next_scanline;	/* 0 .. image_height-1  */
+
+  /* Remaining fields are known throughout compressor, but generally
+   * should not be touched by a surrounding application.
+   */
+
+  /*
+   * These fields are computed during compression startup
+   */
+  boolean progressive_mode;	/* TRUE if scan script uses progressive mode */
+  int max_h_samp_factor;	/* largest h_samp_factor */
+  int max_v_samp_factor;	/* largest v_samp_factor */
+
+  JDIMENSION total_iMCU_rows;	/* # of iMCU rows to be input to coef ctlr */
+  /* The coefficient controller receives data in units of MCU rows as defined
+   * for fully interleaved scans (whether the JPEG file is interleaved or not).
+   * There are v_samp_factor * DCTSIZE sample rows of each component in an
+   * "iMCU" (interleaved MCU) row.
+   */
+  
+  /*
+   * These fields are valid during any one scan.
+   * They describe the components and MCUs actually appearing in the scan.
+   */
+  int comps_in_scan;		/* # of JPEG components in this scan */
+  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
+  /* *cur_comp_info[i] describes component that appears i'th in SOS */
+  
+  JDIMENSION MCUs_per_row;	/* # of MCUs across the image */
+  JDIMENSION MCU_rows_in_scan;	/* # of MCU rows in the image */
+  
+  int blocks_in_MCU;		/* # of DCT blocks per MCU */
+  int MCU_membership[C_MAX_BLOCKS_IN_MCU];
+  /* MCU_membership[i] is index in cur_comp_info of component owning */
+  /* i'th block in an MCU */
+
+  int Ss, Se, Ah, Al;		/* progressive JPEG parameters for scan */
+
+  /*
+   * Links to compression subobjects (methods and private variables of modules)
+   */
+  struct jpeg_comp_master * master;
+  struct jpeg_c_main_controller * main;
+  struct jpeg_c_prep_controller * prep;
+  struct jpeg_c_coef_controller * coef;
+  struct jpeg_marker_writer * marker;
+  struct jpeg_color_converter * cconvert;
+  struct jpeg_downsampler * downsample;
+  struct jpeg_forward_dct * fdct;
+  struct jpeg_entropy_encoder * entropy;
+  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
+  int script_space_size;
+};
+
+
+/* Master record for a decompression instance */
+
+struct jpeg_decompress_struct {
+  jpeg_common_fields;		/* Fields shared with jpeg_compress_struct */
+
+  /* Source of compressed data */
+  struct jpeg_source_mgr * src;
+
+  /* Basic description of image --- filled in by jpeg_read_header(). */
+  /* Application may inspect these values to decide how to process image. */
+
+  JDIMENSION image_width;	/* nominal image width (from SOF marker) */
+  JDIMENSION image_height;	/* nominal image height */
+  int num_components;		/* # of color components in JPEG image */
+  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
+
+  /* Decompression processing parameters --- these fields must be set before
+   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes
+   * them to default values.
+   */
+
+  J_COLOR_SPACE out_color_space; /* colorspace for output */
+
+  unsigned int scale_num, scale_denom; /* fraction by which to scale image */
+
+  double output_gamma;		/* image gamma wanted in output */
+
+  boolean buffered_image;	/* TRUE=multiple output passes */
+  boolean raw_data_out;		/* TRUE=downsampled data wanted */
+
+  J_DCT_METHOD dct_method;	/* IDCT algorithm selector */
+  boolean do_fancy_upsampling;	/* TRUE=apply fancy upsampling */
+  boolean do_block_smoothing;	/* TRUE=apply interblock smoothing */
+
+  boolean quantize_colors;	/* TRUE=colormapped output wanted */
+  /* the following are ignored if not quantize_colors: */
+  J_DITHER_MODE dither_mode;	/* type of color dithering to use */
+  boolean two_pass_quantize;	/* TRUE=use two-pass color quantization */
+  int desired_number_of_colors;	/* max # colors to use in created colormap */
+  /* these are significant only in buffered-image mode: */
+  boolean enable_1pass_quant;	/* enable future use of 1-pass quantizer */
+  boolean enable_external_quant;/* enable future use of external colormap */
+  boolean enable_2pass_quant;	/* enable future use of 2-pass quantizer */
+
+  /* Description of actual output image that will be returned to application.
+   * These fields are computed by jpeg_start_decompress().
+   * You can also use jpeg_calc_output_dimensions() to determine these values
+   * in advance of calling jpeg_start_decompress().
+   */
+
+  JDIMENSION output_width;	/* scaled image width */
+  JDIMENSION output_height;	/* scaled image height */
+  int out_color_components;	/* # of color components in out_color_space */
+  int output_components;	/* # of color components returned */
+  /* output_components is 1 (a colormap index) when quantizing colors;
+   * otherwise it equals out_color_components.
+   */
+  int rec_outbuf_height;	/* min recommended height of scanline buffer */
+  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
+   * high, space and time will be wasted due to unnecessary data copying.
+   * Usually rec_outbuf_height will be 1 or 2, at most 4.
+   */
+
+  /* When quantizing colors, the output colormap is described by these fields.
+   * The application can supply a colormap by setting colormap non-NULL before
+   * calling jpeg_start_decompress; otherwise a colormap is created during
+   * jpeg_start_decompress or jpeg_start_output.
+   * The map has out_color_components rows and actual_number_of_colors columns.
+   */
+  int actual_number_of_colors;	/* number of entries in use */
+  JSAMPARRAY colormap;		/* The color map as a 2-D pixel array */
+
+  /* State variables: these variables indicate the progress of decompression.
+   * The application may examine these but must not modify them.
+   */
+
+  /* Row index of next scanline to be read from jpeg_read_scanlines().
+   * Application may use this to control its processing loop, e.g.,
+   * "while (output_scanline < output_height)".
+   */
+  JDIMENSION output_scanline;	/* 0 .. output_height-1  */
+
+  /* Current input scan number and number of iMCU rows completed in scan.
+   * These indicate the progress of the decompressor input side.
+   */
+  int input_scan_number;	/* Number of SOS markers seen so far */
+  JDIMENSION input_iMCU_row;	/* Number of iMCU rows completed */
+
+  /* The "output scan number" is the notional scan being displayed by the
+   * output side.  The decompressor will not allow output scan/row number
+   * to get ahead of input scan/row, but it can fall arbitrarily far behind.
+   */
+  int output_scan_number;	/* Nominal scan number being displayed */
+  JDIMENSION output_iMCU_row;	/* Number of iMCU rows read */
+
+  /* Current progression status.  coef_bits[c][i] indicates the precision
+   * with which component c's DCT coefficient i (in zigzag order) is known.
+   * It is -1 when no data has yet been received, otherwise it is the point
+   * transform (shift) value for the most recent scan of the coefficient
+   * (thus, 0 at completion of the progression).
+   * This pointer is NULL when reading a non-progressive file.
+   */
+  int (*coef_bits)[DCTSIZE2];	/* -1 or current Al value for each coef */
+
+  /* Internal JPEG parameters --- the application usually need not look at
+   * these fields.  Note that the decompressor output side may not use
+   * any parameters that can change between scans.
+   */
+
+  /* Quantization and Huffman tables are carried forward across input
+   * datastreams when processing abbreviated JPEG datastreams.
+   */
+
+  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
+  /* ptrs to coefficient quantization tables, or NULL if not defined */
+
+  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
+  /* ptrs to Huffman coding tables, or NULL if not defined */
+
+  /* These parameters are never carried across datastreams, since they
+   * are given in SOF/SOS markers or defined to be reset by SOI.
+   */
+
+  int data_precision;		/* bits of precision in image data */
+
+  jpeg_component_info * comp_info;
+  /* comp_info[i] describes component that appears i'th in SOF */
+
+  boolean progressive_mode;	/* TRUE if SOFn specifies progressive mode */
+  boolean arith_code;		/* TRUE=arithmetic coding, FALSE=Huffman */
+
+  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
+
+  /* These fields record data obtained from optional markers recognized by
+   * the JPEG library.
+   */
+  boolean saw_JFIF_marker;	/* TRUE iff a JFIF APP0 marker was found */
+  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
+  UINT8 JFIF_major_version;	/* JFIF version number */
+  UINT8 JFIF_minor_version;
+  UINT8 density_unit;		/* JFIF code for pixel size units */
+  UINT16 X_density;		/* Horizontal pixel density */
+  UINT16 Y_density;		/* Vertical pixel density */
+  boolean saw_Adobe_marker;	/* TRUE iff an Adobe APP14 marker was found */
+  UINT8 Adobe_transform;	/* Color transform code from Adobe marker */
+
+  boolean CCIR601_sampling;	/* TRUE=first samples are cosited */
+
+  /* Aside from the specific data retained from APPn markers known to the
+   * library, the uninterpreted contents of any or all APPn and COM markers
+   * can be saved in a list for examination by the application.
+   */
+  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
+
+  /* Remaining fields are known throughout decompressor, but generally
+   * should not be touched by a surrounding application.
+   */
+
+  /*
+   * These fields are computed during decompression startup
+   */
+  int max_h_samp_factor;	/* largest h_samp_factor */
+  int max_v_samp_factor;	/* largest v_samp_factor */
+
+  int min_DCT_scaled_size;	/* smallest DCT_scaled_size of any component */
+
+  JDIMENSION total_iMCU_rows;	/* # of iMCU rows in image */
+  /* The coefficient controller's input and output progress is measured in
+   * units of "iMCU" (interleaved MCU) rows.  These are the same as MCU rows
+   * in fully interleaved JPEG scans, but are used whether the scan is
+   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block
+   * rows of each component.  Therefore, the IDCT output contains
+   * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row.
+   */
+
+  JSAMPLE * sample_range_limit; /* table for fast range-limiting */
+
+  /*
+   * These fields are valid during any one scan.
+   * They describe the components and MCUs actually appearing in the scan.
+   * Note that the decompressor output side must not use these fields.
+   */
+  int comps_in_scan;		/* # of JPEG components in this scan */
+  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
+  /* *cur_comp_info[i] describes component that appears i'th in SOS */
+
+  JDIMENSION MCUs_per_row;	/* # of MCUs across the image */
+  JDIMENSION MCU_rows_in_scan;	/* # of MCU rows in the image */
+
+  int blocks_in_MCU;		/* # of DCT blocks per MCU */
+  int MCU_membership[D_MAX_BLOCKS_IN_MCU];
+  /* MCU_membership[i] is index in cur_comp_info of component owning */
+  /* i'th block in an MCU */
+
+  int Ss, Se, Ah, Al;		/* progressive JPEG parameters for scan */
+
+  /* This field is shared between entropy decoder and marker parser.
+   * It is either zero or the code of a JPEG marker that has been
+   * read from the data source, but has not yet been processed.
+   */
+  int unread_marker;
+
+  /*
+   * Links to decompression subobjects (methods, private variables of modules)
+   */
+  struct jpeg_decomp_master * master;
+  struct jpeg_d_main_controller * main;
+  struct jpeg_d_coef_controller * coef;
+  struct jpeg_d_post_controller * post;
+  struct jpeg_input_controller * inputctl;
+  struct jpeg_marker_reader * marker;
+  struct jpeg_entropy_decoder * entropy;
+  struct jpeg_inverse_dct * idct;
+  struct jpeg_upsampler * upsample;
+  struct jpeg_color_deconverter * cconvert;
+  struct jpeg_color_quantizer * cquantize;
+};
+
+
+/* "Object" declarations for JPEG modules that may be supplied or called
+ * directly by the surrounding application.
+ * As with all objects in the JPEG library, these structs only define the
+ * publicly visible methods and state variables of a module.  Additional
+ * private fields may exist after the public ones.
+ */
+
+
+/* Error handler object */
+
+struct jpeg_error_mgr {
+  /* Error exit handler: does not return to caller */
+  JMETHOD(void, error_exit, (j_common_ptr cinfo));
+  /* Conditionally emit a trace or warning message */
+  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
+  /* Routine that actually outputs a trace or error message */
+  JMETHOD(void, output_message, (j_common_ptr cinfo));
+  /* Format a message string for the most recent JPEG error or message */
+  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
+#define JMSG_LENGTH_MAX  200	/* recommended size of format_message buffer */
+  /* Reset error state variables at start of a new image */
+  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
+  
+  /* The message ID code and any parameters are saved here.
+   * A message can have one string parameter or up to 8 int parameters.
+   */
+  int msg_code;
+#define JMSG_STR_PARM_MAX  80
+  union {
+    int i[8];
+    char s[JMSG_STR_PARM_MAX];
+  } msg_parm;
+  
+  /* Standard state variables for error facility */
+  
+  int trace_level;		/* max msg_level that will be displayed */
+  
+  /* For recoverable corrupt-data errors, we emit a warning message,
+   * but keep going unless emit_message chooses to abort.  emit_message
+   * should count warnings in num_warnings.  The surrounding application
+   * can check for bad data by seeing if num_warnings is nonzero at the
+   * end of processing.
+   */
+  long num_warnings;		/* number of corrupt-data warnings */
+
+  /* These fields point to the table(s) of error message strings.
+   * An application can change the table pointer to switch to a different
+   * message list (typically, to change the language in which errors are
+   * reported).  Some applications may wish to add additional error codes
+   * that will be handled by the JPEG library error mechanism; the second
+   * table pointer is used for this purpose.
+   *
+   * First table includes all errors generated by JPEG library itself.
+   * Error code 0 is reserved for a "no such error string" message.
+   */
+  const char * const * jpeg_message_table; /* Library errors */
+  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */
+  /* Second table can be added by application (see cjpeg/djpeg for example).
+   * It contains strings numbered first_addon_message..last_addon_message.
+   */
+  const char * const * addon_message_table; /* Non-library errors */
+  int first_addon_message;	/* code for first string in addon table */
+  int last_addon_message;	/* code for last string in addon table */
+};
+
+
+/* Progress monitor object */
+
+struct jpeg_progress_mgr {
+  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
+
+  long pass_counter;		/* work units completed in this pass */
+  long pass_limit;		/* total number of work units in this pass */
+  int completed_passes;		/* passes completed so far */
+  int total_passes;		/* total number of passes expected */
+};
+
+
+/* Data destination object for compression */
+
+struct jpeg_destination_mgr {
+  JOCTET * next_output_byte;	/* => next byte to write in buffer */
+  size_t free_in_buffer;	/* # of byte spaces remaining in buffer */
+
+  JMETHOD(void, init_destination, (j_compress_ptr cinfo));
+  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
+  JMETHOD(void, term_destination, (j_compress_ptr cinfo));
+};
+
+
+/* Data source object for decompression */
+
+struct jpeg_source_mgr {
+  const JOCTET * next_input_byte; /* => next byte to read from buffer */
+  size_t bytes_in_buffer;	/* # of bytes remaining in buffer */
+
+  JMETHOD(void, init_source, (j_decompress_ptr cinfo));
+  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
+  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
+  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
+  JMETHOD(void, term_source, (j_decompress_ptr cinfo));
+};
+
+
+/* Memory manager object.
+ * Allocates "small" objects (a few K total), "large" objects (tens of K),
+ * and "really big" objects (virtual arrays with backing store if needed).
+ * The memory manager does not allow individual objects to be freed; rather,
+ * each created object is assigned to a pool, and whole pools can be freed
+ * at once.  This is faster and more convenient than remembering exactly what
+ * to free, especially where malloc()/free() are not too speedy.
+ * NB: alloc routines never return NULL.  They exit to error_exit if not
+ * successful.
+ */
+
+#define JPOOL_PERMANENT	0	/* lasts until master record is destroyed */
+#define JPOOL_IMAGE	1	/* lasts until done with image/datastream */
+#define JPOOL_NUMPOOLS	2
+
+typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
+typedef struct jvirt_barray_control * jvirt_barray_ptr;
+
+
+struct jpeg_memory_mgr {
+  /* Method pointers */
+  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
+				size_t sizeofobject));
+  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,
+				     size_t sizeofobject));
+  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
+				     JDIMENSION samplesperrow,
+				     JDIMENSION numrows));
+  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
+				      JDIMENSION blocksperrow,
+				      JDIMENSION numrows));
+  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
+						  int pool_id,
+						  boolean pre_zero,
+						  JDIMENSION samplesperrow,
+						  JDIMENSION numrows,
+						  JDIMENSION maxaccess));
+  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
+						  int pool_id,
+						  boolean pre_zero,
+						  JDIMENSION blocksperrow,
+						  JDIMENSION numrows,
+						  JDIMENSION maxaccess));
+  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
+  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
+					   jvirt_sarray_ptr ptr,
+					   JDIMENSION start_row,
+					   JDIMENSION num_rows,
+					   boolean writable));
+  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
+					    jvirt_barray_ptr ptr,
+					    JDIMENSION start_row,
+					    JDIMENSION num_rows,
+					    boolean writable));
+  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
+  JMETHOD(void, self_destruct, (j_common_ptr cinfo));
+
+  /* Limit on memory allocation for this JPEG object.  (Note that this is
+   * merely advisory, not a guaranteed maximum; it only affects the space
+   * used for virtual-array buffers.)  May be changed by outer application
+   * after creating the JPEG object.
+   */
+  long max_memory_to_use;
+
+  /* Maximum allocation request accepted by alloc_large. */
+  long max_alloc_chunk;
+};
+
+
+/* Routine signature for application-supplied marker processing methods.
+ * Need not pass marker code since it is stored in cinfo->unread_marker.
+ */
+typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
+
+
+/* Declarations for routines called by application.
+ * The JPP macro hides prototype parameters from compilers that can't cope.
+ * Note JPP requires double parentheses.
+ */
+
+#ifdef HAVE_PROTOTYPES
+#define JPP(arglist)	arglist
+#else
+#define JPP(arglist)	()
+#endif
+
+
+/* Short forms of external names for systems with brain-damaged linkers.
+ * We shorten external names to be unique in the first six letters, which
+ * is good enough for all known systems.
+ * (If your compiler itself needs names to be unique in less than 15 
+ * characters, you are out of luck.  Get a better compiler.)
+ */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_std_error		jStdError
+#define jpeg_CreateCompress	jCreaCompress
+#define jpeg_CreateDecompress	jCreaDecompress
+#define jpeg_destroy_compress	jDestCompress
+#define jpeg_destroy_decompress	jDestDecompress
+#define jpeg_stdio_dest		jStdDest
+#define jpeg_stdio_src		jStdSrc
+#define jpeg_set_defaults	jSetDefaults
+#define jpeg_set_colorspace	jSetColorspace
+#define jpeg_default_colorspace	jDefColorspace
+#define jpeg_set_quality	jSetQuality
+#define jpeg_set_linear_quality	jSetLQuality
+#define jpeg_add_quant_table	jAddQuantTable
+#define jpeg_quality_scaling	jQualityScaling
+#define jpeg_simple_progression	jSimProgress
+#define jpeg_suppress_tables	jSuppressTables
+#define jpeg_alloc_quant_table	jAlcQTable
+#define jpeg_alloc_huff_table	jAlcHTable
+#define jpeg_start_compress	jStrtCompress
+#define jpeg_write_scanlines	jWrtScanlines
+#define jpeg_finish_compress	jFinCompress
+#define jpeg_write_raw_data	jWrtRawData
+#define jpeg_write_marker	jWrtMarker
+#define jpeg_write_m_header	jWrtMHeader
+#define jpeg_write_m_byte	jWrtMByte
+#define jpeg_write_tables	jWrtTables
+#define jpeg_read_header	jReadHeader
+#define jpeg_start_decompress	jStrtDecompress
+#define jpeg_read_scanlines	jReadScanlines
+#define jpeg_finish_decompress	jFinDecompress
+#define jpeg_read_raw_data	jReadRawData
+#define jpeg_has_multiple_scans	jHasMultScn
+#define jpeg_start_output	jStrtOutput
+#define jpeg_finish_output	jFinOutput
+#define jpeg_input_complete	jInComplete
+#define jpeg_new_colormap	jNewCMap
+#define jpeg_consume_input	jConsumeInput
+#define jpeg_calc_output_dimensions	jCalcDimensions
+#define jpeg_save_markers	jSaveMarkers
+#define jpeg_set_marker_processor	jSetMarker
+#define jpeg_read_coefficients	jReadCoefs
+#define jpeg_write_coefficients	jWrtCoefs
+#define jpeg_copy_critical_parameters	jCopyCrit
+#define jpeg_abort_compress	jAbrtCompress
+#define jpeg_abort_decompress	jAbrtDecompress
+#define jpeg_abort		jAbort
+#define jpeg_destroy		jDestroy
+#define jpeg_resync_to_restart	jResyncRestart
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/* Default error-management setup */
+EXTERN(struct jpeg_error_mgr *) jpeg_std_error
+	JPP((struct jpeg_error_mgr * err));
+
+/* Initialization of JPEG compression objects.
+ * jpeg_create_compress() and jpeg_create_decompress() are the exported
+ * names that applications should call.  These expand to calls on
+ * jpeg_CreateCompress and jpeg_CreateDecompress with additional information
+ * passed for version mismatch checking.
+ * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
+ */
+#define jpeg_create_compress(cinfo) \
+    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
+			(size_t) sizeof(struct jpeg_compress_struct))
+#define jpeg_create_decompress(cinfo) \
+    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
+			  (size_t) sizeof(struct jpeg_decompress_struct))
+EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
+				      int version, size_t structsize));
+EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
+					int version, size_t structsize));
+/* Destruction of JPEG compression objects */
+EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
+
+/* Standard data source and destination managers: stdio streams. */
+/* Caller is responsible for opening the file before and closing after. */
+EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));
+EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
+
+/* Default parameter setup for compression */
+EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
+/* Compression parameter setup aids */
+EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
+				      J_COLOR_SPACE colorspace));
+EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
+				   boolean force_baseline));
+EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
+					  int scale_factor,
+					  boolean force_baseline));
+EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
+				       const unsigned int *basic_table,
+				       int scale_factor,
+				       boolean force_baseline));
+EXTERN(int) jpeg_quality_scaling JPP((int quality));
+EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
+				       boolean suppress));
+EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
+EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
+
+/* Main entry points for compression */
+EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
+				      boolean write_all_tables));
+EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
+					     JSAMPARRAY scanlines,
+					     JDIMENSION num_lines));
+EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
+
+/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
+EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
+					    JSAMPIMAGE data,
+					    JDIMENSION num_lines));
+
+/* Write a special marker.  See libjpeg.doc concerning safe usage. */
+EXTERN(void) jpeg_write_marker
+	JPP((j_compress_ptr cinfo, int marker,
+	     const JOCTET * dataptr, unsigned int datalen));
+/* Same, but piecemeal. */
+EXTERN(void) jpeg_write_m_header
+	JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
+EXTERN(void) jpeg_write_m_byte
+	JPP((j_compress_ptr cinfo, int val));
+
+/* Alternate compression function: just write an abbreviated table file */
+EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
+
+/* Decompression startup: read start of JPEG datastream to see what's there */
+EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
+				  boolean require_image));
+/* Return value is one of: */
+#define JPEG_SUSPENDED		0 /* Suspended due to lack of input data */
+#define JPEG_HEADER_OK		1 /* Found valid image datastream */
+#define JPEG_HEADER_TABLES_ONLY	2 /* Found valid table-specs-only datastream */
+/* If you pass require_image = TRUE (normal case), you need not check for
+ * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
+ * JPEG_SUSPENDED is only possible if you use a data source module that can
+ * give a suspension return (the stdio source module doesn't).
+ */
+
+/* Main entry points for decompression */
+EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
+EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
+					    JSAMPARRAY scanlines,
+					    JDIMENSION max_lines));
+EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
+
+/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
+EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
+					   JSAMPIMAGE data,
+					   JDIMENSION max_lines));
+
+/* Additional entry points for buffered-image mode. */
+EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
+EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
+				       int scan_number));
+EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
+EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
+EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
+/* Return value is one of: */
+/* #define JPEG_SUSPENDED	0    Suspended due to lack of input data */
+#define JPEG_REACHED_SOS	1 /* Reached start of new scan */
+#define JPEG_REACHED_EOI	2 /* Reached end of image */
+#define JPEG_ROW_COMPLETED	3 /* Completed one iMCU row */
+#define JPEG_SCAN_COMPLETED	4 /* Completed last iMCU row of a scan */
+
+/* Precalculate output dimensions for current decompression parameters. */
+EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
+
+/* Control saving of COM and APPn markers into marker_list. */
+EXTERN(void) jpeg_save_markers
+	JPP((j_decompress_ptr cinfo, int marker_code,
+	     unsigned int length_limit));
+
+/* Install a special processing method for COM or APPn markers. */
+EXTERN(void) jpeg_set_marker_processor
+	JPP((j_decompress_ptr cinfo, int marker_code,
+	     jpeg_marker_parser_method routine));
+
+/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
+EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
+					  jvirt_barray_ptr * coef_arrays));
+EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
+						j_compress_ptr dstinfo));
+
+/* If you choose to abort compression or decompression before completing
+ * jpeg_finish_(de)compress, then you need to clean up to release memory,
+ * temporary files, etc.  You can just call jpeg_destroy_(de)compress
+ * if you're done with the JPEG object, but if you want to clean it up and
+ * reuse it, call this:
+ */
+EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
+
+/* Generic versions of jpeg_abort and jpeg_destroy that work on either
+ * flavor of JPEG object.  These may be more convenient in some places.
+ */
+EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
+EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
+
+/* Default restart-marker-resync procedure for use by data source modules */
+EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
+					    int desired));
+
+
+/* These marker codes are exported since applications and data source modules
+ * are likely to want to use them.
+ */
+
+#define JPEG_RST0	0xD0	/* RST0 marker code */
+#define JPEG_EOI	0xD9	/* EOI marker code */
+#define JPEG_APP0	0xE0	/* APP0 marker code */
+#define JPEG_COM	0xFE	/* COM marker code */
+
+
+/* If we have a brain-damaged compiler that emits warnings (or worse, errors)
+ * for structure definitions that are never filled in, keep it quiet by
+ * supplying dummy definitions for the various substructures.
+ */
+
+#ifdef INCOMPLETE_TYPES_BROKEN
+#ifndef JPEG_INTERNALS		/* will be defined in jpegint.h */
+struct jvirt_sarray_control { long dummy; };
+struct jvirt_barray_control { long dummy; };
+struct jpeg_comp_master { long dummy; };
+struct jpeg_c_main_controller { long dummy; };
+struct jpeg_c_prep_controller { long dummy; };
+struct jpeg_c_coef_controller { long dummy; };
+struct jpeg_marker_writer { long dummy; };
+struct jpeg_color_converter { long dummy; };
+struct jpeg_downsampler { long dummy; };
+struct jpeg_forward_dct { long dummy; };
+struct jpeg_entropy_encoder { long dummy; };
+struct jpeg_decomp_master { long dummy; };
+struct jpeg_d_main_controller { long dummy; };
+struct jpeg_d_coef_controller { long dummy; };
+struct jpeg_d_post_controller { long dummy; };
+struct jpeg_input_controller { long dummy; };
+struct jpeg_marker_reader { long dummy; };
+struct jpeg_entropy_decoder { long dummy; };
+struct jpeg_inverse_dct { long dummy; };
+struct jpeg_upsampler { long dummy; };
+struct jpeg_color_deconverter { long dummy; };
+struct jpeg_color_quantizer { long dummy; };
+#endif /* JPEG_INTERNALS */
+#endif /* INCOMPLETE_TYPES_BROKEN */
+
+
+/*
+ * The JPEG library modules define JPEG_INTERNALS before including this file.
+ * The internal structure declarations are read only when that is true.
+ * Applications using the library should not include jpegint.h, but may wish
+ * to include jerror.h.
+ */
+
+#ifdef JPEG_INTERNALS
+#include "jpegint.h"		/* fetch private declarations */
+#include "jerror.h"		/* fetch error codes too */
+#endif
+
+#endif /* JPEGLIB_H */
diff --git a/src/libjpeg/jpegtran.c b/src/libjpeg/jpegtran.c
new file mode 100644
index 0000000..719aaa7
--- /dev/null
+++ b/src/libjpeg/jpegtran.c
@@ -0,0 +1,504 @@
+/*
+ * jpegtran.c
+ *
+ * Copyright (C) 1995-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a command-line user interface for JPEG transcoding.
+ * It is very similar to cjpeg.c, but provides lossless transcoding between
+ * different JPEG file formats.  It also provides some lossless and sort-of-
+ * lossless transformations of JPEG data.
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+#include "transupp.h"		/* Support routines for jpegtran */
+#include "jversion.h"		/* for version message */
+
+#ifdef USE_CCOMMAND		/* command-line reader for Macintosh */
+#ifdef __MWERKS__
+#include <SIOUX.h>              /* Metrowerks needs this */
+#include <console.h>		/* ... and this */
+#endif
+#ifdef THINK_C
+#include <console.h>		/* Think declares it here */
+#endif
+#endif
+
+
+/*
+ * Argument-parsing code.
+ * The switch parser is designed to be useful with DOS-style command line
+ * syntax, ie, intermixed switches and file names, where only the switches
+ * to the left of a given file name affect processing of that file.
+ * The main program in this file doesn't actually use this capability...
+ */
+
+
+static const char * progname;	/* program name for error messages */
+static char * outfilename;	/* for -outfile switch */
+static JCOPY_OPTION copyoption;	/* -copy switch */
+static jpeg_transform_info transformoption; /* image transformation options */
+
+
+LOCAL(void)
+usage (void)
+/* complain about bad command line */
+{
+  fprintf(stderr, "usage: %s [switches] ", progname);
+#ifdef TWO_FILE_COMMANDLINE
+  fprintf(stderr, "inputfile outputfile\n");
+#else
+  fprintf(stderr, "[inputfile]\n");
+#endif
+
+  fprintf(stderr, "Switches (names may be abbreviated):\n");
+  fprintf(stderr, "  -copy none     Copy no extra markers from source file\n");
+  fprintf(stderr, "  -copy comments Copy only comment markers (default)\n");
+  fprintf(stderr, "  -copy all      Copy all extra markers\n");
+#ifdef ENTROPY_OPT_SUPPORTED
+  fprintf(stderr, "  -optimize      Optimize Huffman table (smaller file, but slow compression)\n");
+#endif
+#ifdef C_PROGRESSIVE_SUPPORTED
+  fprintf(stderr, "  -progressive   Create progressive JPEG file\n");
+#endif
+#if TRANSFORMS_SUPPORTED
+  fprintf(stderr, "Switches for modifying the image:\n");
+  fprintf(stderr, "  -grayscale     Reduce to grayscale (omit color data)\n");
+  fprintf(stderr, "  -flip [horizontal|vertical]  Mirror image (left-right or top-bottom)\n");
+  fprintf(stderr, "  -rotate [90|180|270]         Rotate image (degrees clockwise)\n");
+  fprintf(stderr, "  -transpose     Transpose image\n");
+  fprintf(stderr, "  -transverse    Transverse transpose image\n");
+  fprintf(stderr, "  -trim          Drop non-transformable edge blocks\n");
+#endif /* TRANSFORMS_SUPPORTED */
+  fprintf(stderr, "Switches for advanced users:\n");
+  fprintf(stderr, "  -restart N     Set restart interval in rows, or in blocks with B\n");
+  fprintf(stderr, "  -maxmemory N   Maximum memory to use (in kbytes)\n");
+  fprintf(stderr, "  -outfile name  Specify name for output file\n");
+  fprintf(stderr, "  -verbose  or  -debug   Emit debug output\n");
+  fprintf(stderr, "Switches for wizards:\n");
+#ifdef C_ARITH_CODING_SUPPORTED
+  fprintf(stderr, "  -arithmetic    Use arithmetic coding\n");
+#endif
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+  fprintf(stderr, "  -scans file    Create multi-scan JPEG per script file\n");
+#endif
+  exit(EXIT_FAILURE);
+}
+
+
+LOCAL(void)
+select_transform (JXFORM_CODE transform)
+/* Silly little routine to detect multiple transform options,
+ * which we can't handle.
+ */
+{
+#if TRANSFORMS_SUPPORTED
+  if (transformoption.transform == JXFORM_NONE ||
+      transformoption.transform == transform) {
+    transformoption.transform = transform;
+  } else {
+    fprintf(stderr, "%s: can only do one image transformation at a time\n",
+	    progname);
+    usage();
+  }
+#else
+  fprintf(stderr, "%s: sorry, image transformation was not compiled\n",
+	  progname);
+  exit(EXIT_FAILURE);
+#endif
+}
+
+
+LOCAL(int)
+parse_switches (j_compress_ptr cinfo, int argc, char **argv,
+		int last_file_arg_seen, boolean for_real)
+/* Parse optional switches.
+ * Returns argv[] index of first file-name argument (== argc if none).
+ * Any file names with indexes <= last_file_arg_seen are ignored;
+ * they have presumably been processed in a previous iteration.
+ * (Pass 0 for last_file_arg_seen on the first or only iteration.)
+ * for_real is FALSE on the first (dummy) pass; we may skip any expensive
+ * processing.
+ */
+{
+  int argn;
+  char * arg;
+  boolean simple_progressive;
+  char * scansarg = NULL;	/* saves -scans parm if any */
+
+  /* Set up default JPEG parameters. */
+  simple_progressive = FALSE;
+  outfilename = NULL;
+  copyoption = JCOPYOPT_DEFAULT;
+  transformoption.transform = JXFORM_NONE;
+  transformoption.trim = FALSE;
+  transformoption.force_grayscale = FALSE;
+  cinfo->err->trace_level = 0;
+
+  /* Scan command line options, adjust parameters */
+
+  for (argn = 1; argn < argc; argn++) {
+    arg = argv[argn];
+    if (*arg != '-') {
+      /* Not a switch, must be a file name argument */
+      if (argn <= last_file_arg_seen) {
+	outfilename = NULL;	/* -outfile applies to just one input file */
+	continue;		/* ignore this name if previously processed */
+      }
+      break;			/* else done parsing switches */
+    }
+    arg++;			/* advance past switch marker character */
+
+    if (keymatch(arg, "arithmetic", 1)) {
+      /* Use arithmetic coding. */
+#ifdef C_ARITH_CODING_SUPPORTED
+      cinfo->arith_code = TRUE;
+#else
+      fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
+	      progname);
+      exit(EXIT_FAILURE);
+#endif
+
+    } else if (keymatch(arg, "copy", 1)) {
+      /* Select which extra markers to copy. */
+      if (++argn >= argc)	/* advance to next argument */
+	usage();
+      if (keymatch(argv[argn], "none", 1)) {
+	copyoption = JCOPYOPT_NONE;
+      } else if (keymatch(argv[argn], "comments", 1)) {
+	copyoption = JCOPYOPT_COMMENTS;
+      } else if (keymatch(argv[argn], "all", 1)) {
+	copyoption = JCOPYOPT_ALL;
+      } else
+	usage();
+
+    } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
+      /* Enable debug printouts. */
+      /* On first -d, print version identification */
+      static boolean printed_version = FALSE;
+
+      if (! printed_version) {
+	fprintf(stderr, "Independent JPEG Group's JPEGTRAN, version %s\n%s\n",
+		JVERSION, JCOPYRIGHT);
+	printed_version = TRUE;
+      }
+      cinfo->err->trace_level++;
+
+    } else if (keymatch(arg, "flip", 1)) {
+      /* Mirror left-right or top-bottom. */
+      if (++argn >= argc)	/* advance to next argument */
+	usage();
+      if (keymatch(argv[argn], "horizontal", 1))
+	select_transform(JXFORM_FLIP_H);
+      else if (keymatch(argv[argn], "vertical", 1))
+	select_transform(JXFORM_FLIP_V);
+      else
+	usage();
+
+    } else if (keymatch(arg, "grayscale", 1) || keymatch(arg, "greyscale",1)) {
+      /* Force to grayscale. */
+#if TRANSFORMS_SUPPORTED
+      transformoption.force_grayscale = TRUE;
+#else
+      select_transform(JXFORM_NONE);	/* force an error */
+#endif
+
+    } else if (keymatch(arg, "maxmemory", 3)) {
+      /* Maximum memory in Kb (or Mb with 'm'). */
+      long lval;
+      char ch = 'x';
+
+      if (++argn >= argc)	/* advance to next argument */
+	usage();
+      if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
+	usage();
+      if (ch == 'm' || ch == 'M')
+	lval *= 1000L;
+      cinfo->mem->max_memory_to_use = lval * 1000L;
+
+    } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) {
+      /* Enable entropy parm optimization. */
+#ifdef ENTROPY_OPT_SUPPORTED
+      cinfo->optimize_coding = TRUE;
+#else
+      fprintf(stderr, "%s: sorry, entropy optimization was not compiled\n",
+	      progname);
+      exit(EXIT_FAILURE);
+#endif
+
+    } else if (keymatch(arg, "outfile", 4)) {
+      /* Set output file name. */
+      if (++argn >= argc)	/* advance to next argument */
+	usage();
+      outfilename = argv[argn];	/* save it away for later use */
+
+    } else if (keymatch(arg, "progressive", 1)) {
+      /* Select simple progressive mode. */
+#ifdef C_PROGRESSIVE_SUPPORTED
+      simple_progressive = TRUE;
+      /* We must postpone execution until num_components is known. */
+#else
+      fprintf(stderr, "%s: sorry, progressive output was not compiled\n",
+	      progname);
+      exit(EXIT_FAILURE);
+#endif
+
+    } else if (keymatch(arg, "restart", 1)) {
+      /* Restart interval in MCU rows (or in MCUs with 'b'). */
+      long lval;
+      char ch = 'x';
+
+      if (++argn >= argc)	/* advance to next argument */
+	usage();
+      if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
+	usage();
+      if (lval < 0 || lval > 65535L)
+	usage();
+      if (ch == 'b' || ch == 'B') {
+	cinfo->restart_interval = (unsigned int) lval;
+	cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */
+      } else {
+	cinfo->restart_in_rows = (int) lval;
+	/* restart_interval will be computed during startup */
+      }
+
+    } else if (keymatch(arg, "rotate", 2)) {
+      /* Rotate 90, 180, or 270 degrees (measured clockwise). */
+      if (++argn >= argc)	/* advance to next argument */
+	usage();
+      if (keymatch(argv[argn], "90", 2))
+	select_transform(JXFORM_ROT_90);
+      else if (keymatch(argv[argn], "180", 3))
+	select_transform(JXFORM_ROT_180);
+      else if (keymatch(argv[argn], "270", 3))
+	select_transform(JXFORM_ROT_270);
+      else
+	usage();
+
+    } else if (keymatch(arg, "scans", 1)) {
+      /* Set scan script. */
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+      if (++argn >= argc)	/* advance to next argument */
+	usage();
+      scansarg = argv[argn];
+      /* We must postpone reading the file in case -progressive appears. */
+#else
+      fprintf(stderr, "%s: sorry, multi-scan output was not compiled\n",
+	      progname);
+      exit(EXIT_FAILURE);
+#endif
+
+    } else if (keymatch(arg, "transpose", 1)) {
+      /* Transpose (across UL-to-LR axis). */
+      select_transform(JXFORM_TRANSPOSE);
+
+    } else if (keymatch(arg, "transverse", 6)) {
+      /* Transverse transpose (across UR-to-LL axis). */
+      select_transform(JXFORM_TRANSVERSE);
+
+    } else if (keymatch(arg, "trim", 3)) {
+      /* Trim off any partial edge MCUs that the transform can't handle. */
+      transformoption.trim = TRUE;
+
+    } else {
+      usage();			/* bogus switch */
+    }
+  }
+
+  /* Post-switch-scanning cleanup */
+
+  if (for_real) {
+
+#ifdef C_PROGRESSIVE_SUPPORTED
+    if (simple_progressive)	/* process -progressive; -scans can override */
+      jpeg_simple_progression(cinfo);
+#endif
+
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+    if (scansarg != NULL)	/* process -scans if it was present */
+      if (! read_scan_script(cinfo, scansarg))
+	usage();
+#endif
+  }
+
+  return argn;			/* return index of next arg (file name) */
+}
+
+
+/*
+ * The main program.
+ */
+
+int
+main (int argc, char **argv)
+{
+  struct jpeg_decompress_struct srcinfo;
+  struct jpeg_compress_struct dstinfo;
+  struct jpeg_error_mgr jsrcerr, jdsterr;
+#ifdef PROGRESS_REPORT
+  struct cdjpeg_progress_mgr progress;
+#endif
+  jvirt_barray_ptr * src_coef_arrays;
+  jvirt_barray_ptr * dst_coef_arrays;
+  int file_index;
+  FILE * input_file;
+  FILE * output_file;
+
+  /* On Mac, fetch a command line. */
+#ifdef USE_CCOMMAND
+  argc = ccommand(&argv);
+#endif
+
+  progname = argv[0];
+  if (progname == NULL || progname[0] == 0)
+    progname = "jpegtran";	/* in case C library doesn't provide it */
+
+  /* Initialize the JPEG decompression object with default error handling. */
+  srcinfo.err = jpeg_std_error(&jsrcerr);
+  jpeg_create_decompress(&srcinfo);
+  /* Initialize the JPEG compression object with default error handling. */
+  dstinfo.err = jpeg_std_error(&jdsterr);
+  jpeg_create_compress(&dstinfo);
+
+  /* Now safe to enable signal catcher.
+   * Note: we assume only the decompression object will have virtual arrays.
+   */
+#ifdef NEED_SIGNAL_CATCHER
+  enable_signal_catcher((j_common_ptr) &srcinfo);
+#endif
+
+  /* Scan command line to find file names.
+   * It is convenient to use just one switch-parsing routine, but the switch
+   * values read here are mostly ignored; we will rescan the switches after
+   * opening the input file.  Also note that most of the switches affect the
+   * destination JPEG object, so we parse into that and then copy over what
+   * needs to affects the source too.
+   */
+
+  file_index = parse_switches(&dstinfo, argc, argv, 0, FALSE);
+  jsrcerr.trace_level = jdsterr.trace_level;
+  srcinfo.mem->max_memory_to_use = dstinfo.mem->max_memory_to_use;
+
+#ifdef TWO_FILE_COMMANDLINE
+  /* Must have either -outfile switch or explicit output file name */
+  if (outfilename == NULL) {
+    if (file_index != argc-2) {
+      fprintf(stderr, "%s: must name one input and one output file\n",
+	      progname);
+      usage();
+    }
+    outfilename = argv[file_index+1];
+  } else {
+    if (file_index != argc-1) {
+      fprintf(stderr, "%s: must name one input and one output file\n",
+	      progname);
+      usage();
+    }
+  }
+#else
+  /* Unix style: expect zero or one file name */
+  if (file_index < argc-1) {
+    fprintf(stderr, "%s: only one input file\n", progname);
+    usage();
+  }
+#endif /* TWO_FILE_COMMANDLINE */
+
+  /* Open the input file. */
+  if (file_index < argc) {
+    if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {
+      fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]);
+      exit(EXIT_FAILURE);
+    }
+  } else {
+    /* default input file is stdin */
+    input_file = read_stdin();
+  }
+
+  /* Open the output file. */
+  if (outfilename != NULL) {
+    if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
+      fprintf(stderr, "%s: can't open %s\n", progname, outfilename);
+      exit(EXIT_FAILURE);
+    }
+  } else {
+    /* default output file is stdout */
+    output_file = write_stdout();
+  }
+
+#ifdef PROGRESS_REPORT
+  start_progress_monitor((j_common_ptr) &dstinfo, &progress);
+#endif
+
+  /* Specify data source for decompression */
+  jpeg_stdio_src(&srcinfo, input_file);
+
+  /* Enable saving of extra markers that we want to copy */
+  jcopy_markers_setup(&srcinfo, copyoption);
+
+  /* Read file header */
+  (void) jpeg_read_header(&srcinfo, TRUE);
+
+  /* Any space needed by a transform option must be requested before
+   * jpeg_read_coefficients so that memory allocation will be done right.
+   */
+#if TRANSFORMS_SUPPORTED
+  jtransform_request_workspace(&srcinfo, &transformoption);
+#endif
+
+  /* Read source file as DCT coefficients */
+  src_coef_arrays = jpeg_read_coefficients(&srcinfo);
+
+  /* Initialize destination compression parameters from source values */
+  jpeg_copy_critical_parameters(&srcinfo, &dstinfo);
+
+  /* Adjust destination parameters if required by transform options;
+   * also find out which set of coefficient arrays will hold the output.
+   */
+#if TRANSFORMS_SUPPORTED
+  dst_coef_arrays = jtransform_adjust_parameters(&srcinfo, &dstinfo,
+						 src_coef_arrays,
+						 &transformoption);
+#else
+  dst_coef_arrays = src_coef_arrays;
+#endif
+
+  /* Adjust default compression parameters by re-parsing the options */
+  file_index = parse_switches(&dstinfo, argc, argv, 0, TRUE);
+
+  /* Specify data destination for compression */
+  jpeg_stdio_dest(&dstinfo, output_file);
+
+  /* Start compressor (note no image data is actually written here) */
+  jpeg_write_coefficients(&dstinfo, dst_coef_arrays);
+
+  /* Copy to the output file any extra markers that we want to preserve */
+  jcopy_markers_execute(&srcinfo, &dstinfo, copyoption);
+
+  /* Execute image transformation, if any */
+#if TRANSFORMS_SUPPORTED
+  jtransform_execute_transformation(&srcinfo, &dstinfo,
+				    src_coef_arrays,
+				    &transformoption);
+#endif
+
+  /* Finish compression and release memory */
+  jpeg_finish_compress(&dstinfo);
+  jpeg_destroy_compress(&dstinfo);
+  (void) jpeg_finish_decompress(&srcinfo);
+  jpeg_destroy_decompress(&srcinfo);
+
+  /* Close files, if we opened them */
+  if (input_file != stdin)
+    fclose(input_file);
+  if (output_file != stdout)
+    fclose(output_file);
+
+#ifdef PROGRESS_REPORT
+  end_progress_monitor((j_common_ptr) &dstinfo);
+#endif
+
+  /* All done. */
+  exit(jsrcerr.num_warnings + jdsterr.num_warnings ?EXIT_WARNING:EXIT_SUCCESS);
+  return 0;			/* suppress no-return-value warnings */
+}
diff --git a/src/libjpeg/jquant1.c b/src/libjpeg/jquant1.c
new file mode 100644
index 0000000..aaa34a1
--- /dev/null
+++ b/src/libjpeg/jquant1.c
@@ -0,0 +1,856 @@
+/*
+ * jquant1.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains 1-pass color quantization (color mapping) routines.
+ * These routines provide mapping to a fixed color map using equally spaced
+ * color values.  Optional Floyd-Steinberg or ordered dithering is available.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+#ifdef QUANT_1PASS_SUPPORTED
+
+
+/*
+ * The main purpose of 1-pass quantization is to provide a fast, if not very
+ * high quality, colormapped output capability.  A 2-pass quantizer usually
+ * gives better visual quality; however, for quantized grayscale output this
+ * quantizer is perfectly adequate.  Dithering is highly recommended with this
+ * quantizer, though you can turn it off if you really want to.
+ *
+ * In 1-pass quantization the colormap must be chosen in advance of seeing the
+ * image.  We use a map consisting of all combinations of Ncolors[i] color
+ * values for the i'th component.  The Ncolors[] values are chosen so that
+ * their product, the total number of colors, is no more than that requested.
+ * (In most cases, the product will be somewhat less.)
+ *
+ * Since the colormap is orthogonal, the representative value for each color
+ * component can be determined without considering the other components;
+ * then these indexes can be combined into a colormap index by a standard
+ * N-dimensional-array-subscript calculation.  Most of the arithmetic involved
+ * can be precalculated and stored in the lookup table colorindex[].
+ * colorindex[i][j] maps pixel value j in component i to the nearest
+ * representative value (grid plane) for that component; this index is
+ * multiplied by the array stride for component i, so that the
+ * index of the colormap entry closest to a given pixel value is just
+ *    sum( colorindex[component-number][pixel-component-value] )
+ * Aside from being fast, this scheme allows for variable spacing between
+ * representative values with no additional lookup cost.
+ *
+ * If gamma correction has been applied in color conversion, it might be wise
+ * to adjust the color grid spacing so that the representative colors are
+ * equidistant in linear space.  At this writing, gamma correction is not
+ * implemented by jdcolor, so nothing is done here.
+ */
+
+
+/* Declarations for ordered dithering.
+ *
+ * We use a standard 16x16 ordered dither array.  The basic concept of ordered
+ * dithering is described in many references, for instance Dale Schumacher's
+ * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991).
+ * In place of Schumacher's comparisons against a "threshold" value, we add a
+ * "dither" value to the input pixel and then round the result to the nearest
+ * output value.  The dither value is equivalent to (0.5 - threshold) times
+ * the distance between output values.  For ordered dithering, we assume that
+ * the output colors are equally spaced; if not, results will probably be
+ * worse, since the dither may be too much or too little at a given point.
+ *
+ * The normal calculation would be to form pixel value + dither, range-limit
+ * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual.
+ * We can skip the separate range-limiting step by extending the colorindex
+ * table in both directions.
+ */
+
+#define ODITHER_SIZE  16	/* dimension of dither matrix */
+/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */
+#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE)	/* # cells in matrix */
+#define ODITHER_MASK  (ODITHER_SIZE-1) /* mask for wrapping around counters */
+
+typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE];
+typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE];
+
+static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = {
+  /* Bayer's order-4 dither array.  Generated by the code given in
+   * Stephen Hawley's article "Ordered Dithering" in Graphics Gems I.
+   * The values in this array must range from 0 to ODITHER_CELLS-1.
+   */
+  {   0,192, 48,240, 12,204, 60,252,  3,195, 51,243, 15,207, 63,255 },
+  { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },
+  {  32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },
+  { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },
+  {   8,200, 56,248,  4,196, 52,244, 11,203, 59,251,  7,199, 55,247 },
+  { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },
+  {  40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },
+  { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },
+  {   2,194, 50,242, 14,206, 62,254,  1,193, 49,241, 13,205, 61,253 },
+  { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },
+  {  34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },
+  { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },
+  {  10,202, 58,250,  6,198, 54,246,  9,201, 57,249,  5,197, 53,245 },
+  { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },
+  {  42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },
+  { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }
+};
+
+
+/* Declarations for Floyd-Steinberg dithering.
+ *
+ * Errors are accumulated into the array fserrors[], at a resolution of
+ * 1/16th of a pixel count.  The error at a given pixel is propagated
+ * to its not-yet-processed neighbors using the standard F-S fractions,
+ *		...	(here)	7/16
+ *		3/16	5/16	1/16
+ * We work left-to-right on even rows, right-to-left on odd rows.
+ *
+ * We can get away with a single array (holding one row's worth of errors)
+ * by using it to store the current row's errors at pixel columns not yet
+ * processed, but the next row's errors at columns already processed.  We
+ * need only a few extra variables to hold the errors immediately around the
+ * current column.  (If we are lucky, those variables are in registers, but
+ * even if not, they're probably cheaper to access than array elements are.)
+ *
+ * The fserrors[] array is indexed [component#][position].
+ * We provide (#columns + 2) entries per component; the extra entry at each
+ * end saves us from special-casing the first and last pixels.
+ *
+ * Note: on a wide image, we might not have enough room in a PC's near data
+ * segment to hold the error array; so it is allocated with alloc_large.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+typedef INT16 FSERROR;		/* 16 bits should be enough */
+typedef int LOCFSERROR;		/* use 'int' for calculation temps */
+#else
+typedef INT32 FSERROR;		/* may need more than 16 bits */
+typedef INT32 LOCFSERROR;	/* be sure calculation temps are big enough */
+#endif
+
+typedef FSERROR FAR *FSERRPTR;	/* pointer to error array (in FAR storage!) */
+
+
+/* Private subobject */
+
+#define MAX_Q_COMPS 4		/* max components I can handle */
+
+typedef struct {
+  struct jpeg_color_quantizer pub; /* public fields */
+
+  /* Initially allocated colormap is saved here */
+  JSAMPARRAY sv_colormap;	/* The color map as a 2-D pixel array */
+  int sv_actual;		/* number of entries in use */
+
+  JSAMPARRAY colorindex;	/* Precomputed mapping for speed */
+  /* colorindex[i][j] = index of color closest to pixel value j in component i,
+   * premultiplied as described above.  Since colormap indexes must fit into
+   * JSAMPLEs, the entries of this array will too.
+   */
+  boolean is_padded;		/* is the colorindex padded for odither? */
+
+  int Ncolors[MAX_Q_COMPS];	/* # of values alloced to each component */
+
+  /* Variables for ordered dithering */
+  int row_index;		/* cur row's vertical index in dither matrix */
+  ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */
+
+  /* Variables for Floyd-Steinberg dithering */
+  FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */
+  boolean on_odd_row;		/* flag to remember which row we are on */
+} my_cquantizer;
+
+typedef my_cquantizer * my_cquantize_ptr;
+
+
+/*
+ * Policy-making subroutines for create_colormap and create_colorindex.
+ * These routines determine the colormap to be used.  The rest of the module
+ * only assumes that the colormap is orthogonal.
+ *
+ *  * select_ncolors decides how to divvy up the available colors
+ *    among the components.
+ *  * output_value defines the set of representative values for a component.
+ *  * largest_input_value defines the mapping from input values to
+ *    representative values for a component.
+ * Note that the latter two routines may impose different policies for
+ * different components, though this is not currently done.
+ */
+
+
+LOCAL(int)
+select_ncolors (j_decompress_ptr cinfo, int Ncolors[])
+/* Determine allocation of desired colors to components, */
+/* and fill in Ncolors[] array to indicate choice. */
+/* Return value is total number of colors (product of Ncolors[] values). */
+{
+  int nc = cinfo->out_color_components; /* number of color components */
+  int max_colors = cinfo->desired_number_of_colors;
+  int total_colors, iroot, i, j;
+  boolean changed;
+  long temp;
+  static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE };
+
+  /* We can allocate at least the nc'th root of max_colors per component. */
+  /* Compute floor(nc'th root of max_colors). */
+  iroot = 1;
+  do {
+    iroot++;
+    temp = iroot;		/* set temp = iroot ** nc */
+    for (i = 1; i < nc; i++)
+      temp *= iroot;
+  } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */
+  iroot--;			/* now iroot = floor(root) */
+
+  /* Must have at least 2 color values per component */
+  if (iroot < 2)
+    ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp);
+
+  /* Initialize to iroot color values for each component */
+  total_colors = 1;
+  for (i = 0; i < nc; i++) {
+    Ncolors[i] = iroot;
+    total_colors *= iroot;
+  }
+  /* We may be able to increment the count for one or more components without
+   * exceeding max_colors, though we know not all can be incremented.
+   * Sometimes, the first component can be incremented more than once!
+   * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.)
+   * In RGB colorspace, try to increment G first, then R, then B.
+   */
+  do {
+    changed = FALSE;
+    for (i = 0; i < nc; i++) {
+      j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i);
+      /* calculate new total_colors if Ncolors[j] is incremented */
+      temp = total_colors / Ncolors[j];
+      temp *= Ncolors[j]+1;	/* done in long arith to avoid oflo */
+      if (temp > (long) max_colors)
+	break;			/* won't fit, done with this pass */
+      Ncolors[j]++;		/* OK, apply the increment */
+      total_colors = (int) temp;
+      changed = TRUE;
+    }
+  } while (changed);
+
+  return total_colors;
+}
+
+
+LOCAL(int)
+output_value (j_decompress_ptr cinfo, int ci, int j, int maxj)
+/* Return j'th output value, where j will range from 0 to maxj */
+/* The output values must fall in 0..MAXJSAMPLE in increasing order */
+{
+  /* We always provide values 0 and MAXJSAMPLE for each component;
+   * any additional values are equally spaced between these limits.
+   * (Forcing the upper and lower values to the limits ensures that
+   * dithering can't produce a color outside the selected gamut.)
+   */
+  return (int) (((INT32) j * MAXJSAMPLE + maxj/2) / maxj);
+}
+
+
+LOCAL(int)
+largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj)
+/* Return largest input value that should map to j'th output value */
+/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */
+{
+  /* Breakpoints are halfway between values returned by output_value */
+  return (int) (((INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));
+}
+
+
+/*
+ * Create the colormap.
+ */
+
+LOCAL(void)
+create_colormap (j_decompress_ptr cinfo)
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  JSAMPARRAY colormap;		/* Created colormap */
+  int total_colors;		/* Number of distinct output colors */
+  int i,j,k, nci, blksize, blkdist, ptr, val;
+
+  /* Select number of colors for each component */
+  total_colors = select_ncolors(cinfo, cquantize->Ncolors);
+
+  /* Report selected color counts */
+  if (cinfo->out_color_components == 3)
+    TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS,
+	     total_colors, cquantize->Ncolors[0],
+	     cquantize->Ncolors[1], cquantize->Ncolors[2]);
+  else
+    TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors);
+
+  /* Allocate and fill in the colormap. */
+  /* The colors are ordered in the map in standard row-major order, */
+  /* i.e. rightmost (highest-indexed) color changes most rapidly. */
+
+  colormap = (*cinfo->mem->alloc_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE,
+     (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components);
+
+  /* blksize is number of adjacent repeated entries for a component */
+  /* blkdist is distance between groups of identical entries for a component */
+  blkdist = total_colors;
+
+  for (i = 0; i < cinfo->out_color_components; i++) {
+    /* fill in colormap entries for i'th color component */
+    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
+    blksize = blkdist / nci;
+    for (j = 0; j < nci; j++) {
+      /* Compute j'th output value (out of nci) for component */
+      val = output_value(cinfo, i, j, nci-1);
+      /* Fill in all colormap entries that have this value of this component */
+      for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) {
+	/* fill in blksize entries beginning at ptr */
+	for (k = 0; k < blksize; k++)
+	  colormap[i][ptr+k] = (JSAMPLE) val;
+      }
+    }
+    blkdist = blksize;		/* blksize of this color is blkdist of next */
+  }
+
+  /* Save the colormap in private storage,
+   * where it will survive color quantization mode changes.
+   */
+  cquantize->sv_colormap = colormap;
+  cquantize->sv_actual = total_colors;
+}
+
+
+/*
+ * Create the color index table.
+ */
+
+LOCAL(void)
+create_colorindex (j_decompress_ptr cinfo)
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  JSAMPROW indexptr;
+  int i,j,k, nci, blksize, val, pad;
+
+  /* For ordered dither, we pad the color index tables by MAXJSAMPLE in
+   * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE).
+   * This is not necessary in the other dithering modes.  However, we
+   * flag whether it was done in case user changes dithering mode.
+   */
+  if (cinfo->dither_mode == JDITHER_ORDERED) {
+    pad = MAXJSAMPLE*2;
+    cquantize->is_padded = TRUE;
+  } else {
+    pad = 0;
+    cquantize->is_padded = FALSE;
+  }
+
+  cquantize->colorindex = (*cinfo->mem->alloc_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE,
+     (JDIMENSION) (MAXJSAMPLE+1 + pad),
+     (JDIMENSION) cinfo->out_color_components);
+
+  /* blksize is number of adjacent repeated entries for a component */
+  blksize = cquantize->sv_actual;
+
+  for (i = 0; i < cinfo->out_color_components; i++) {
+    /* fill in colorindex entries for i'th color component */
+    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
+    blksize = blksize / nci;
+
+    /* adjust colorindex pointers to provide padding at negative indexes. */
+    if (pad)
+      cquantize->colorindex[i] += MAXJSAMPLE;
+
+    /* in loop, val = index of current output value, */
+    /* and k = largest j that maps to current val */
+    indexptr = cquantize->colorindex[i];
+    val = 0;
+    k = largest_input_value(cinfo, i, 0, nci-1);
+    for (j = 0; j <= MAXJSAMPLE; j++) {
+      while (j > k)		/* advance val if past boundary */
+	k = largest_input_value(cinfo, i, ++val, nci-1);
+      /* premultiply so that no multiplication needed in main processing */
+      indexptr[j] = (JSAMPLE) (val * blksize);
+    }
+    /* Pad at both ends if necessary */
+    if (pad)
+      for (j = 1; j <= MAXJSAMPLE; j++) {
+	indexptr[-j] = indexptr[0];
+	indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE];
+      }
+  }
+}
+
+
+/*
+ * Create an ordered-dither array for a component having ncolors
+ * distinct output values.
+ */
+
+LOCAL(ODITHER_MATRIX_PTR)
+make_odither_array (j_decompress_ptr cinfo, int ncolors)
+{
+  ODITHER_MATRIX_PTR odither;
+  int j,k;
+  INT32 num,den;
+
+  odither = (ODITHER_MATRIX_PTR)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(ODITHER_MATRIX));
+  /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1).
+   * Hence the dither value for the matrix cell with fill order f
+   * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1).
+   * On 16-bit-int machine, be careful to avoid overflow.
+   */
+  den = 2 * ODITHER_CELLS * ((INT32) (ncolors - 1));
+  for (j = 0; j < ODITHER_SIZE; j++) {
+    for (k = 0; k < ODITHER_SIZE; k++) {
+      num = ((INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))
+	    * MAXJSAMPLE;
+      /* Ensure round towards zero despite C's lack of consistency
+       * about rounding negative values in integer division...
+       */
+      odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den);
+    }
+  }
+  return odither;
+}
+
+
+/*
+ * Create the ordered-dither tables.
+ * Components having the same number of representative colors may 
+ * share a dither table.
+ */
+
+LOCAL(void)
+create_odither_tables (j_decompress_ptr cinfo)
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  ODITHER_MATRIX_PTR odither;
+  int i, j, nci;
+
+  for (i = 0; i < cinfo->out_color_components; i++) {
+    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
+    odither = NULL;		/* search for matching prior component */
+    for (j = 0; j < i; j++) {
+      if (nci == cquantize->Ncolors[j]) {
+	odither = cquantize->odither[j];
+	break;
+      }
+    }
+    if (odither == NULL)	/* need a new table? */
+      odither = make_odither_array(cinfo, nci);
+    cquantize->odither[i] = odither;
+  }
+}
+
+
+/*
+ * Map some rows of pixels to the output colormapped representation.
+ */
+
+METHODDEF(void)
+color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
+		JSAMPARRAY output_buf, int num_rows)
+/* General case, no dithering */
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  JSAMPARRAY colorindex = cquantize->colorindex;
+  register int pixcode, ci;
+  register JSAMPROW ptrin, ptrout;
+  int row;
+  JDIMENSION col;
+  JDIMENSION width = cinfo->output_width;
+  register int nc = cinfo->out_color_components;
+
+  for (row = 0; row < num_rows; row++) {
+    ptrin = input_buf[row];
+    ptrout = output_buf[row];
+    for (col = width; col > 0; col--) {
+      pixcode = 0;
+      for (ci = 0; ci < nc; ci++) {
+	pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]);
+      }
+      *ptrout++ = (JSAMPLE) pixcode;
+    }
+  }
+}
+
+
+METHODDEF(void)
+color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
+		 JSAMPARRAY output_buf, int num_rows)
+/* Fast path for out_color_components==3, no dithering */
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  register int pixcode;
+  register JSAMPROW ptrin, ptrout;
+  JSAMPROW colorindex0 = cquantize->colorindex[0];
+  JSAMPROW colorindex1 = cquantize->colorindex[1];
+  JSAMPROW colorindex2 = cquantize->colorindex[2];
+  int row;
+  JDIMENSION col;
+  JDIMENSION width = cinfo->output_width;
+
+  for (row = 0; row < num_rows; row++) {
+    ptrin = input_buf[row];
+    ptrout = output_buf[row];
+    for (col = width; col > 0; col--) {
+      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]);
+      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]);
+      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]);
+      *ptrout++ = (JSAMPLE) pixcode;
+    }
+  }
+}
+
+
+METHODDEF(void)
+quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
+		     JSAMPARRAY output_buf, int num_rows)
+/* General case, with ordered dithering */
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  register JSAMPROW input_ptr;
+  register JSAMPROW output_ptr;
+  JSAMPROW colorindex_ci;
+  int * dither;			/* points to active row of dither matrix */
+  int row_index, col_index;	/* current indexes into dither matrix */
+  int nc = cinfo->out_color_components;
+  int ci;
+  int row;
+  JDIMENSION col;
+  JDIMENSION width = cinfo->output_width;
+
+  for (row = 0; row < num_rows; row++) {
+    /* Initialize output values to 0 so can process components separately */
+    jzero_far((void FAR *) output_buf[row],
+	      (size_t) (width * SIZEOF(JSAMPLE)));
+    row_index = cquantize->row_index;
+    for (ci = 0; ci < nc; ci++) {
+      input_ptr = input_buf[row] + ci;
+      output_ptr = output_buf[row];
+      colorindex_ci = cquantize->colorindex[ci];
+      dither = cquantize->odither[ci][row_index];
+      col_index = 0;
+
+      for (col = width; col > 0; col--) {
+	/* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,
+	 * select output value, accumulate into output code for this pixel.
+	 * Range-limiting need not be done explicitly, as we have extended
+	 * the colorindex table to produce the right answers for out-of-range
+	 * inputs.  The maximum dither is +- MAXJSAMPLE; this sets the
+	 * required amount of padding.
+	 */
+	*output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];
+	input_ptr += nc;
+	output_ptr++;
+	col_index = (col_index + 1) & ODITHER_MASK;
+      }
+    }
+    /* Advance row index for next row */
+    row_index = (row_index + 1) & ODITHER_MASK;
+    cquantize->row_index = row_index;
+  }
+}
+
+
+METHODDEF(void)
+quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
+		      JSAMPARRAY output_buf, int num_rows)
+/* Fast path for out_color_components==3, with ordered dithering */
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  register int pixcode;
+  register JSAMPROW input_ptr;
+  register JSAMPROW output_ptr;
+  JSAMPROW colorindex0 = cquantize->colorindex[0];
+  JSAMPROW colorindex1 = cquantize->colorindex[1];
+  JSAMPROW colorindex2 = cquantize->colorindex[2];
+  int * dither0;		/* points to active row of dither matrix */
+  int * dither1;
+  int * dither2;
+  int row_index, col_index;	/* current indexes into dither matrix */
+  int row;
+  JDIMENSION col;
+  JDIMENSION width = cinfo->output_width;
+
+  for (row = 0; row < num_rows; row++) {
+    row_index = cquantize->row_index;
+    input_ptr = input_buf[row];
+    output_ptr = output_buf[row];
+    dither0 = cquantize->odither[0][row_index];
+    dither1 = cquantize->odither[1][row_index];
+    dither2 = cquantize->odither[2][row_index];
+    col_index = 0;
+
+    for (col = width; col > 0; col--) {
+      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) +
+					dither0[col_index]]);
+      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) +
+					dither1[col_index]]);
+      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) +
+					dither2[col_index]]);
+      *output_ptr++ = (JSAMPLE) pixcode;
+      col_index = (col_index + 1) & ODITHER_MASK;
+    }
+    row_index = (row_index + 1) & ODITHER_MASK;
+    cquantize->row_index = row_index;
+  }
+}
+
+
+METHODDEF(void)
+quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
+		    JSAMPARRAY output_buf, int num_rows)
+/* General case, with Floyd-Steinberg dithering */
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  register LOCFSERROR cur;	/* current error or pixel value */
+  LOCFSERROR belowerr;		/* error for pixel below cur */
+  LOCFSERROR bpreverr;		/* error for below/prev col */
+  LOCFSERROR bnexterr;		/* error for below/next col */
+  LOCFSERROR delta;
+  register FSERRPTR errorptr;	/* => fserrors[] at column before current */
+  register JSAMPROW input_ptr;
+  register JSAMPROW output_ptr;
+  JSAMPROW colorindex_ci;
+  JSAMPROW colormap_ci;
+  int pixcode;
+  int nc = cinfo->out_color_components;
+  int dir;			/* 1 for left-to-right, -1 for right-to-left */
+  int dirnc;			/* dir * nc */
+  int ci;
+  int row;
+  JDIMENSION col;
+  JDIMENSION width = cinfo->output_width;
+  JSAMPLE *range_limit = cinfo->sample_range_limit;
+  SHIFT_TEMPS
+
+  for (row = 0; row < num_rows; row++) {
+    /* Initialize output values to 0 so can process components separately */
+    jzero_far((void FAR *) output_buf[row],
+	      (size_t) (width * SIZEOF(JSAMPLE)));
+    for (ci = 0; ci < nc; ci++) {
+      input_ptr = input_buf[row] + ci;
+      output_ptr = output_buf[row];
+      if (cquantize->on_odd_row) {
+	/* work right to left in this row */
+	input_ptr += (width-1) * nc; /* so point to rightmost pixel */
+	output_ptr += width-1;
+	dir = -1;
+	dirnc = -nc;
+	errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */
+      } else {
+	/* work left to right in this row */
+	dir = 1;
+	dirnc = nc;
+	errorptr = cquantize->fserrors[ci]; /* => entry before first column */
+      }
+      colorindex_ci = cquantize->colorindex[ci];
+      colormap_ci = cquantize->sv_colormap[ci];
+      /* Preset error values: no error propagated to first pixel from left */
+      cur = 0;
+      /* and no error propagated to row below yet */
+      belowerr = bpreverr = 0;
+
+      for (col = width; col > 0; col--) {
+	/* cur holds the error propagated from the previous pixel on the
+	 * current line.  Add the error propagated from the previous line
+	 * to form the complete error correction term for this pixel, and
+	 * round the error term (which is expressed * 16) to an integer.
+	 * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct
+	 * for either sign of the error value.
+	 * Note: errorptr points to *previous* column's array entry.
+	 */
+	cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4);
+	/* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.
+	 * The maximum error is +- MAXJSAMPLE; this sets the required size
+	 * of the range_limit array.
+	 */
+	cur += GETJSAMPLE(*input_ptr);
+	cur = GETJSAMPLE(range_limit[cur]);
+	/* Select output value, accumulate into output code for this pixel */
+	pixcode = GETJSAMPLE(colorindex_ci[cur]);
+	*output_ptr += (JSAMPLE) pixcode;
+	/* Compute actual representation error at this pixel */
+	/* Note: we can do this even though we don't have the final */
+	/* pixel code, because the colormap is orthogonal. */
+	cur -= GETJSAMPLE(colormap_ci[pixcode]);
+	/* Compute error fractions to be propagated to adjacent pixels.
+	 * Add these into the running sums, and simultaneously shift the
+	 * next-line error sums left by 1 column.
+	 */
+	bnexterr = cur;
+	delta = cur * 2;
+	cur += delta;		/* form error * 3 */
+	errorptr[0] = (FSERROR) (bpreverr + cur);
+	cur += delta;		/* form error * 5 */
+	bpreverr = belowerr + cur;
+	belowerr = bnexterr;
+	cur += delta;		/* form error * 7 */
+	/* At this point cur contains the 7/16 error value to be propagated
+	 * to the next pixel on the current line, and all the errors for the
+	 * next line have been shifted over. We are therefore ready to move on.
+	 */
+	input_ptr += dirnc;	/* advance input ptr to next column */
+	output_ptr += dir;	/* advance output ptr to next column */
+	errorptr += dir;	/* advance errorptr to current column */
+      }
+      /* Post-loop cleanup: we must unload the final error value into the
+       * final fserrors[] entry.  Note we need not unload belowerr because
+       * it is for the dummy column before or after the actual array.
+       */
+      errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */
+    }
+    cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE);
+  }
+}
+
+
+/*
+ * Allocate workspace for Floyd-Steinberg errors.
+ */
+
+LOCAL(void)
+alloc_fs_workspace (j_decompress_ptr cinfo)
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  size_t arraysize;
+  int i;
+
+  arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
+  for (i = 0; i < cinfo->out_color_components; i++) {
+    cquantize->fserrors[i] = (FSERRPTR)
+      (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
+  }
+}
+
+
+/*
+ * Initialize for one-pass color quantization.
+ */
+
+METHODDEF(void)
+start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  size_t arraysize;
+  int i;
+
+  /* Install my colormap. */
+  cinfo->colormap = cquantize->sv_colormap;
+  cinfo->actual_number_of_colors = cquantize->sv_actual;
+
+  /* Initialize for desired dithering mode. */
+  switch (cinfo->dither_mode) {
+  case JDITHER_NONE:
+    if (cinfo->out_color_components == 3)
+      cquantize->pub.color_quantize = color_quantize3;
+    else
+      cquantize->pub.color_quantize = color_quantize;
+    break;
+  case JDITHER_ORDERED:
+    if (cinfo->out_color_components == 3)
+      cquantize->pub.color_quantize = quantize3_ord_dither;
+    else
+      cquantize->pub.color_quantize = quantize_ord_dither;
+    cquantize->row_index = 0;	/* initialize state for ordered dither */
+    /* If user changed to ordered dither from another mode,
+     * we must recreate the color index table with padding.
+     * This will cost extra space, but probably isn't very likely.
+     */
+    if (! cquantize->is_padded)
+      create_colorindex(cinfo);
+    /* Create ordered-dither tables if we didn't already. */
+    if (cquantize->odither[0] == NULL)
+      create_odither_tables(cinfo);
+    break;
+  case JDITHER_FS:
+    cquantize->pub.color_quantize = quantize_fs_dither;
+    cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */
+    /* Allocate Floyd-Steinberg workspace if didn't already. */
+    if (cquantize->fserrors[0] == NULL)
+      alloc_fs_workspace(cinfo);
+    /* Initialize the propagated errors to zero. */
+    arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
+    for (i = 0; i < cinfo->out_color_components; i++)
+      jzero_far((void FAR *) cquantize->fserrors[i], arraysize);
+    break;
+  default:
+    ERREXIT(cinfo, JERR_NOT_COMPILED);
+    break;
+  }
+}
+
+
+/*
+ * Finish up at the end of the pass.
+ */
+
+METHODDEF(void)
+finish_pass_1_quant (j_decompress_ptr cinfo)
+{
+  /* no work in 1-pass case */
+}
+
+
+/*
+ * Switch to a new external colormap between output passes.
+ * Shouldn't get to this module!
+ */
+
+METHODDEF(void)
+new_color_map_1_quant (j_decompress_ptr cinfo)
+{
+  ERREXIT(cinfo, JERR_MODE_CHANGE);
+}
+
+
+/*
+ * Module initialization routine for 1-pass color quantization.
+ */
+
+GLOBAL(void)
+jinit_1pass_quantizer (j_decompress_ptr cinfo)
+{
+  my_cquantize_ptr cquantize;
+
+  cquantize = (my_cquantize_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_cquantizer));
+  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
+  cquantize->pub.start_pass = start_pass_1_quant;
+  cquantize->pub.finish_pass = finish_pass_1_quant;
+  cquantize->pub.new_color_map = new_color_map_1_quant;
+  cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */
+  cquantize->odither[0] = NULL;	/* Also flag odither arrays not allocated */
+
+  /* Make sure my internal arrays won't overflow */
+  if (cinfo->out_color_components > MAX_Q_COMPS)
+    ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS);
+  /* Make sure colormap indexes can be represented by JSAMPLEs */
+  if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1))
+    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1);
+
+  /* Create the colormap and color index table. */
+  create_colormap(cinfo);
+  create_colorindex(cinfo);
+
+  /* Allocate Floyd-Steinberg workspace now if requested.
+   * We do this now since it is FAR storage and may affect the memory
+   * manager's space calculations.  If the user changes to FS dither
+   * mode in a later pass, we will allocate the space then, and will
+   * possibly overrun the max_memory_to_use setting.
+   */
+  if (cinfo->dither_mode == JDITHER_FS)
+    alloc_fs_workspace(cinfo);
+}
+
+#endif /* QUANT_1PASS_SUPPORTED */
diff --git a/src/libjpeg/jquant2.c b/src/libjpeg/jquant2.c
new file mode 100644
index 0000000..87a3920
--- /dev/null
+++ b/src/libjpeg/jquant2.c
@@ -0,0 +1,1310 @@
+/*
+ * jquant2.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains 2-pass color quantization (color mapping) routines.
+ * These routines provide selection of a custom color map for an image,
+ * followed by mapping of the image to that color map, with optional
+ * Floyd-Steinberg dithering.
+ * It is also possible to use just the second pass to map to an arbitrary
+ * externally-given color map.
+ *
+ * Note: ordered dithering is not supported, since there isn't any fast
+ * way to compute intercolor distances; it's unclear that ordered dither's
+ * fundamental assumptions even hold with an irregularly spaced color map.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+#ifdef QUANT_2PASS_SUPPORTED
+
+
+/*
+ * This module implements the well-known Heckbert paradigm for color
+ * quantization.  Most of the ideas used here can be traced back to
+ * Heckbert's seminal paper
+ *   Heckbert, Paul.  "Color Image Quantization for Frame Buffer Display",
+ *   Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304.
+ *
+ * In the first pass over the image, we accumulate a histogram showing the
+ * usage count of each possible color.  To keep the histogram to a reasonable
+ * size, we reduce the precision of the input; typical practice is to retain
+ * 5 or 6 bits per color, so that 8 or 4 different input values are counted
+ * in the same histogram cell.
+ *
+ * Next, the color-selection step begins with a box representing the whole
+ * color space, and repeatedly splits the "largest" remaining box until we
+ * have as many boxes as desired colors.  Then the mean color in each
+ * remaining box becomes one of the possible output colors.
+ * 
+ * The second pass over the image maps each input pixel to the closest output
+ * color (optionally after applying a Floyd-Steinberg dithering correction).
+ * This mapping is logically trivial, but making it go fast enough requires
+ * considerable care.
+ *
+ * Heckbert-style quantizers vary a good deal in their policies for choosing
+ * the "largest" box and deciding where to cut it.  The particular policies
+ * used here have proved out well in experimental comparisons, but better ones
+ * may yet be found.
+ *
+ * In earlier versions of the IJG code, this module quantized in YCbCr color
+ * space, processing the raw upsampled data without a color conversion step.
+ * This allowed the color conversion math to be done only once per colormap
+ * entry, not once per pixel.  However, that optimization precluded other
+ * useful optimizations (such as merging color conversion with upsampling)
+ * and it also interfered with desired capabilities such as quantizing to an
+ * externally-supplied colormap.  We have therefore abandoned that approach.
+ * The present code works in the post-conversion color space, typically RGB.
+ *
+ * To improve the visual quality of the results, we actually work in scaled
+ * RGB space, giving G distances more weight than R, and R in turn more than
+ * B.  To do everything in integer math, we must use integer scale factors.
+ * The 2/3/1 scale factors used here correspond loosely to the relative
+ * weights of the colors in the NTSC grayscale equation.
+ * If you want to use this code to quantize a non-RGB color space, you'll
+ * probably need to change these scale factors.
+ */
+
+#define R_SCALE 2		/* scale R distances by this much */
+#define G_SCALE 3		/* scale G distances by this much */
+#define B_SCALE 1		/* and B by this much */
+
+/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined
+ * in jmorecfg.h.  As the code stands, it will do the right thing for R,G,B
+ * and B,G,R orders.  If you define some other weird order in jmorecfg.h,
+ * you'll get compile errors until you extend this logic.  In that case
+ * you'll probably want to tweak the histogram sizes too.
+ */
+
+#if RGB_RED == 0
+#define C0_SCALE R_SCALE
+#endif
+#if RGB_BLUE == 0
+#define C0_SCALE B_SCALE
+#endif
+#if RGB_GREEN == 1
+#define C1_SCALE G_SCALE
+#endif
+#if RGB_RED == 2
+#define C2_SCALE R_SCALE
+#endif
+#if RGB_BLUE == 2
+#define C2_SCALE B_SCALE
+#endif
+
+
+/*
+ * First we have the histogram data structure and routines for creating it.
+ *
+ * The number of bits of precision can be adjusted by changing these symbols.
+ * We recommend keeping 6 bits for G and 5 each for R and B.
+ * If you have plenty of memory and cycles, 6 bits all around gives marginally
+ * better results; if you are short of memory, 5 bits all around will save
+ * some space but degrade the results.
+ * To maintain a fully accurate histogram, we'd need to allocate a "long"
+ * (preferably unsigned long) for each cell.  In practice this is overkill;
+ * we can get by with 16 bits per cell.  Few of the cell counts will overflow,
+ * and clamping those that do overflow to the maximum value will give close-
+ * enough results.  This reduces the recommended histogram size from 256Kb
+ * to 128Kb, which is a useful savings on PC-class machines.
+ * (In the second pass the histogram space is re-used for pixel mapping data;
+ * in that capacity, each cell must be able to store zero to the number of
+ * desired colors.  16 bits/cell is plenty for that too.)
+ * Since the JPEG code is intended to run in small memory model on 80x86
+ * machines, we can't just allocate the histogram in one chunk.  Instead
+ * of a true 3-D array, we use a row of pointers to 2-D arrays.  Each
+ * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and
+ * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries.  Note that
+ * on 80x86 machines, the pointer row is in near memory but the actual
+ * arrays are in far memory (same arrangement as we use for image arrays).
+ */
+
+#define MAXNUMCOLORS  (MAXJSAMPLE+1) /* maximum size of colormap */
+
+/* These will do the right thing for either R,G,B or B,G,R color order,
+ * but you may not like the results for other color orders.
+ */
+#define HIST_C0_BITS  5		/* bits of precision in R/B histogram */
+#define HIST_C1_BITS  6		/* bits of precision in G histogram */
+#define HIST_C2_BITS  5		/* bits of precision in B/R histogram */
+
+/* Number of elements along histogram axes. */
+#define HIST_C0_ELEMS  (1<<HIST_C0_BITS)
+#define HIST_C1_ELEMS  (1<<HIST_C1_BITS)
+#define HIST_C2_ELEMS  (1<<HIST_C2_BITS)
+
+/* These are the amounts to shift an input value to get a histogram index. */
+#define C0_SHIFT  (BITS_IN_JSAMPLE-HIST_C0_BITS)
+#define C1_SHIFT  (BITS_IN_JSAMPLE-HIST_C1_BITS)
+#define C2_SHIFT  (BITS_IN_JSAMPLE-HIST_C2_BITS)
+
+
+typedef UINT16 histcell;	/* histogram cell; prefer an unsigned type */
+
+typedef histcell FAR * histptr;	/* for pointers to histogram cells */
+
+typedef histcell hist1d[HIST_C2_ELEMS]; /* typedefs for the array */
+typedef hist1d FAR * hist2d;	/* type for the 2nd-level pointers */
+typedef hist2d * hist3d;	/* type for top-level pointer */
+
+
+/* Declarations for Floyd-Steinberg dithering.
+ *
+ * Errors are accumulated into the array fserrors[], at a resolution of
+ * 1/16th of a pixel count.  The error at a given pixel is propagated
+ * to its not-yet-processed neighbors using the standard F-S fractions,
+ *		...	(here)	7/16
+ *		3/16	5/16	1/16
+ * We work left-to-right on even rows, right-to-left on odd rows.
+ *
+ * We can get away with a single array (holding one row's worth of errors)
+ * by using it to store the current row's errors at pixel columns not yet
+ * processed, but the next row's errors at columns already processed.  We
+ * need only a few extra variables to hold the errors immediately around the
+ * current column.  (If we are lucky, those variables are in registers, but
+ * even if not, they're probably cheaper to access than array elements are.)
+ *
+ * The fserrors[] array has (#columns + 2) entries; the extra entry at
+ * each end saves us from special-casing the first and last pixels.
+ * Each entry is three values long, one value for each color component.
+ *
+ * Note: on a wide image, we might not have enough room in a PC's near data
+ * segment to hold the error array; so it is allocated with alloc_large.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+typedef INT16 FSERROR;		/* 16 bits should be enough */
+typedef int LOCFSERROR;		/* use 'int' for calculation temps */
+#else
+typedef INT32 FSERROR;		/* may need more than 16 bits */
+typedef INT32 LOCFSERROR;	/* be sure calculation temps are big enough */
+#endif
+
+typedef FSERROR FAR *FSERRPTR;	/* pointer to error array (in FAR storage!) */
+
+
+/* Private subobject */
+
+typedef struct {
+  struct jpeg_color_quantizer pub; /* public fields */
+
+  /* Space for the eventually created colormap is stashed here */
+  JSAMPARRAY sv_colormap;	/* colormap allocated at init time */
+  int desired;			/* desired # of colors = size of colormap */
+
+  /* Variables for accumulating image statistics */
+  hist3d histogram;		/* pointer to the histogram */
+
+  boolean needs_zeroed;		/* TRUE if next pass must zero histogram */
+
+  /* Variables for Floyd-Steinberg dithering */
+  FSERRPTR fserrors;		/* accumulated errors */
+  boolean on_odd_row;		/* flag to remember which row we are on */
+  int * error_limiter;		/* table for clamping the applied error */
+} my_cquantizer;
+
+typedef my_cquantizer * my_cquantize_ptr;
+
+
+/*
+ * Prescan some rows of pixels.
+ * In this module the prescan simply updates the histogram, which has been
+ * initialized to zeroes by start_pass.
+ * An output_buf parameter is required by the method signature, but no data
+ * is actually output (in fact the buffer controller is probably passing a
+ * NULL pointer).
+ */
+
+METHODDEF(void)
+prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
+		  JSAMPARRAY output_buf, int num_rows)
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  register JSAMPROW ptr;
+  register histptr histp;
+  register hist3d histogram = cquantize->histogram;
+  int row;
+  JDIMENSION col;
+  JDIMENSION width = cinfo->output_width;
+
+  for (row = 0; row < num_rows; row++) {
+    ptr = input_buf[row];
+    for (col = width; col > 0; col--) {
+      /* get pixel value and index into the histogram */
+      histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]
+			 [GETJSAMPLE(ptr[1]) >> C1_SHIFT]
+			 [GETJSAMPLE(ptr[2]) >> C2_SHIFT];
+      /* increment, check for overflow and undo increment if so. */
+      if (++(*histp) <= 0)
+	(*histp)--;
+      ptr += 3;
+    }
+  }
+}
+
+
+/*
+ * Next we have the really interesting routines: selection of a colormap
+ * given the completed histogram.
+ * These routines work with a list of "boxes", each representing a rectangular
+ * subset of the input color space (to histogram precision).
+ */
+
+typedef struct {
+  /* The bounds of the box (inclusive); expressed as histogram indexes */
+  int c0min, c0max;
+  int c1min, c1max;
+  int c2min, c2max;
+  /* The volume (actually 2-norm) of the box */
+  INT32 volume;
+  /* The number of nonzero histogram cells within this box */
+  long colorcount;
+} box;
+
+typedef box * boxptr;
+
+
+LOCAL(boxptr)
+find_biggest_color_pop (boxptr boxlist, int numboxes)
+/* Find the splittable box with the largest color population */
+/* Returns NULL if no splittable boxes remain */
+{
+  register boxptr boxp;
+  register int i;
+  register long maxc = 0;
+  boxptr which = NULL;
+  
+  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
+    if (boxp->colorcount > maxc && boxp->volume > 0) {
+      which = boxp;
+      maxc = boxp->colorcount;
+    }
+  }
+  return which;
+}
+
+
+LOCAL(boxptr)
+find_biggest_volume (boxptr boxlist, int numboxes)
+/* Find the splittable box with the largest (scaled) volume */
+/* Returns NULL if no splittable boxes remain */
+{
+  register boxptr boxp;
+  register int i;
+  register INT32 maxv = 0;
+  boxptr which = NULL;
+  
+  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
+    if (boxp->volume > maxv) {
+      which = boxp;
+      maxv = boxp->volume;
+    }
+  }
+  return which;
+}
+
+
+LOCAL(void)
+update_box (j_decompress_ptr cinfo, boxptr boxp)
+/* Shrink the min/max bounds of a box to enclose only nonzero elements, */
+/* and recompute its volume and population */
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  hist3d histogram = cquantize->histogram;
+  histptr histp;
+  int c0,c1,c2;
+  int c0min,c0max,c1min,c1max,c2min,c2max;
+  INT32 dist0,dist1,dist2;
+  long ccount;
+  
+  c0min = boxp->c0min;  c0max = boxp->c0max;
+  c1min = boxp->c1min;  c1max = boxp->c1max;
+  c2min = boxp->c2min;  c2max = boxp->c2max;
+  
+  if (c0max > c0min)
+    for (c0 = c0min; c0 <= c0max; c0++)
+      for (c1 = c1min; c1 <= c1max; c1++) {
+	histp = & histogram[c0][c1][c2min];
+	for (c2 = c2min; c2 <= c2max; c2++)
+	  if (*histp++ != 0) {
+	    boxp->c0min = c0min = c0;
+	    goto have_c0min;
+	  }
+      }
+ have_c0min:
+  if (c0max > c0min)
+    for (c0 = c0max; c0 >= c0min; c0--)
+      for (c1 = c1min; c1 <= c1max; c1++) {
+	histp = & histogram[c0][c1][c2min];
+	for (c2 = c2min; c2 <= c2max; c2++)
+	  if (*histp++ != 0) {
+	    boxp->c0max = c0max = c0;
+	    goto have_c0max;
+	  }
+      }
+ have_c0max:
+  if (c1max > c1min)
+    for (c1 = c1min; c1 <= c1max; c1++)
+      for (c0 = c0min; c0 <= c0max; c0++) {
+	histp = & histogram[c0][c1][c2min];
+	for (c2 = c2min; c2 <= c2max; c2++)
+	  if (*histp++ != 0) {
+	    boxp->c1min = c1min = c1;
+	    goto have_c1min;
+	  }
+      }
+ have_c1min:
+  if (c1max > c1min)
+    for (c1 = c1max; c1 >= c1min; c1--)
+      for (c0 = c0min; c0 <= c0max; c0++) {
+	histp = & histogram[c0][c1][c2min];
+	for (c2 = c2min; c2 <= c2max; c2++)
+	  if (*histp++ != 0) {
+	    boxp->c1max = c1max = c1;
+	    goto have_c1max;
+	  }
+      }
+ have_c1max:
+  if (c2max > c2min)
+    for (c2 = c2min; c2 <= c2max; c2++)
+      for (c0 = c0min; c0 <= c0max; c0++) {
+	histp = & histogram[c0][c1min][c2];
+	for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)
+	  if (*histp != 0) {
+	    boxp->c2min = c2min = c2;
+	    goto have_c2min;
+	  }
+      }
+ have_c2min:
+  if (c2max > c2min)
+    for (c2 = c2max; c2 >= c2min; c2--)
+      for (c0 = c0min; c0 <= c0max; c0++) {
+	histp = & histogram[c0][c1min][c2];
+	for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)
+	  if (*histp != 0) {
+	    boxp->c2max = c2max = c2;
+	    goto have_c2max;
+	  }
+      }
+ have_c2max:
+
+  /* Update box volume.
+   * We use 2-norm rather than real volume here; this biases the method
+   * against making long narrow boxes, and it has the side benefit that
+   * a box is splittable iff norm > 0.
+   * Since the differences are expressed in histogram-cell units,
+   * we have to shift back to JSAMPLE units to get consistent distances;
+   * after which, we scale according to the selected distance scale factors.
+   */
+  dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE;
+  dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE;
+  dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE;
+  boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2;
+  
+  /* Now scan remaining volume of box and compute population */
+  ccount = 0;
+  for (c0 = c0min; c0 <= c0max; c0++)
+    for (c1 = c1min; c1 <= c1max; c1++) {
+      histp = & histogram[c0][c1][c2min];
+      for (c2 = c2min; c2 <= c2max; c2++, histp++)
+	if (*histp != 0) {
+	  ccount++;
+	}
+    }
+  boxp->colorcount = ccount;
+}
+
+
+LOCAL(int)
+median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,
+	    int desired_colors)
+/* Repeatedly select and split the largest box until we have enough boxes */
+{
+  int n,lb;
+  int c0,c1,c2,cmax;
+  register boxptr b1,b2;
+
+  while (numboxes < desired_colors) {
+    /* Select box to split.
+     * Current algorithm: by population for first half, then by volume.
+     */
+    if (numboxes*2 <= desired_colors) {
+      b1 = find_biggest_color_pop(boxlist, numboxes);
+    } else {
+      b1 = find_biggest_volume(boxlist, numboxes);
+    }
+    if (b1 == NULL)		/* no splittable boxes left! */
+      break;
+    b2 = &boxlist[numboxes];	/* where new box will go */
+    /* Copy the color bounds to the new box. */
+    b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max;
+    b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min;
+    /* Choose which axis to split the box on.
+     * Current algorithm: longest scaled axis.
+     * See notes in update_box about scaling distances.
+     */
+    c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE;
+    c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE;
+    c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE;
+    /* We want to break any ties in favor of green, then red, blue last.
+     * This code does the right thing for R,G,B or B,G,R color orders only.
+     */
+#if RGB_RED == 0
+    cmax = c1; n = 1;
+    if (c0 > cmax) { cmax = c0; n = 0; }
+    if (c2 > cmax) { n = 2; }
+#else
+    cmax = c1; n = 1;
+    if (c2 > cmax) { cmax = c2; n = 2; }
+    if (c0 > cmax) { n = 0; }
+#endif
+    /* Choose split point along selected axis, and update box bounds.
+     * Current algorithm: split at halfway point.
+     * (Since the box has been shrunk to minimum volume,
+     * any split will produce two nonempty subboxes.)
+     * Note that lb value is max for lower box, so must be < old max.
+     */
+    switch (n) {
+    case 0:
+      lb = (b1->c0max + b1->c0min) / 2;
+      b1->c0max = lb;
+      b2->c0min = lb+1;
+      break;
+    case 1:
+      lb = (b1->c1max + b1->c1min) / 2;
+      b1->c1max = lb;
+      b2->c1min = lb+1;
+      break;
+    case 2:
+      lb = (b1->c2max + b1->c2min) / 2;
+      b1->c2max = lb;
+      b2->c2min = lb+1;
+      break;
+    }
+    /* Update stats for boxes */
+    update_box(cinfo, b1);
+    update_box(cinfo, b2);
+    numboxes++;
+  }
+  return numboxes;
+}
+
+
+LOCAL(void)
+compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
+/* Compute representative color for a box, put it in colormap[icolor] */
+{
+  /* Current algorithm: mean weighted by pixels (not colors) */
+  /* Note it is important to get the rounding correct! */
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  hist3d histogram = cquantize->histogram;
+  histptr histp;
+  int c0,c1,c2;
+  int c0min,c0max,c1min,c1max,c2min,c2max;
+  long count;
+  long total = 0;
+  long c0total = 0;
+  long c1total = 0;
+  long c2total = 0;
+  
+  c0min = boxp->c0min;  c0max = boxp->c0max;
+  c1min = boxp->c1min;  c1max = boxp->c1max;
+  c2min = boxp->c2min;  c2max = boxp->c2max;
+  
+  for (c0 = c0min; c0 <= c0max; c0++)
+    for (c1 = c1min; c1 <= c1max; c1++) {
+      histp = & histogram[c0][c1][c2min];
+      for (c2 = c2min; c2 <= c2max; c2++) {
+	if ((count = *histp++) != 0) {
+	  total += count;
+	  c0total += ((c0 << C0_SHIFT) + ((1<<C0_SHIFT)>>1)) * count;
+	  c1total += ((c1 << C1_SHIFT) + ((1<<C1_SHIFT)>>1)) * count;
+	  c2total += ((c2 << C2_SHIFT) + ((1<<C2_SHIFT)>>1)) * count;
+	}
+      }
+    }
+  
+  cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);
+  cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);
+  cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);
+}
+
+
+LOCAL(void)
+select_colors (j_decompress_ptr cinfo, int desired_colors)
+/* Master routine for color selection */
+{
+  boxptr boxlist;
+  int numboxes;
+  int i;
+
+  /* Allocate workspace for box list */
+  boxlist = (boxptr) (*cinfo->mem->alloc_small)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box));
+  /* Initialize one box containing whole space */
+  numboxes = 1;
+  boxlist[0].c0min = 0;
+  boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT;
+  boxlist[0].c1min = 0;
+  boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT;
+  boxlist[0].c2min = 0;
+  boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT;
+  /* Shrink it to actually-used volume and set its statistics */
+  update_box(cinfo, & boxlist[0]);
+  /* Perform median-cut to produce final box list */
+  numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors);
+  /* Compute the representative color for each box, fill colormap */
+  for (i = 0; i < numboxes; i++)
+    compute_color(cinfo, & boxlist[i], i);
+  cinfo->actual_number_of_colors = numboxes;
+  TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes);
+}
+
+
+/*
+ * These routines are concerned with the time-critical task of mapping input
+ * colors to the nearest color in the selected colormap.
+ *
+ * We re-use the histogram space as an "inverse color map", essentially a
+ * cache for the results of nearest-color searches.  All colors within a
+ * histogram cell will be mapped to the same colormap entry, namely the one
+ * closest to the cell's center.  This may not be quite the closest entry to
+ * the actual input color, but it's almost as good.  A zero in the cache
+ * indicates we haven't found the nearest color for that cell yet; the array
+ * is cleared to zeroes before starting the mapping pass.  When we find the
+ * nearest color for a cell, its colormap index plus one is recorded in the
+ * cache for future use.  The pass2 scanning routines call fill_inverse_cmap
+ * when they need to use an unfilled entry in the cache.
+ *
+ * Our method of efficiently finding nearest colors is based on the "locally
+ * sorted search" idea described by Heckbert and on the incremental distance
+ * calculation described by Spencer W. Thomas in chapter III.1 of Graphics
+ * Gems II (James Arvo, ed.  Academic Press, 1991).  Thomas points out that
+ * the distances from a given colormap entry to each cell of the histogram can
+ * be computed quickly using an incremental method: the differences between
+ * distances to adjacent cells themselves differ by a constant.  This allows a
+ * fairly fast implementation of the "brute force" approach of computing the
+ * distance from every colormap entry to every histogram cell.  Unfortunately,
+ * it needs a work array to hold the best-distance-so-far for each histogram
+ * cell (because the inner loop has to be over cells, not colormap entries).
+ * The work array elements have to be INT32s, so the work array would need
+ * 256Kb at our recommended precision.  This is not feasible in DOS machines.
+ *
+ * To get around these problems, we apply Thomas' method to compute the
+ * nearest colors for only the cells within a small subbox of the histogram.
+ * The work array need be only as big as the subbox, so the memory usage
+ * problem is solved.  Furthermore, we need not fill subboxes that are never
+ * referenced in pass2; many images use only part of the color gamut, so a
+ * fair amount of work is saved.  An additional advantage of this
+ * approach is that we can apply Heckbert's locality criterion to quickly
+ * eliminate colormap entries that are far away from the subbox; typically
+ * three-fourths of the colormap entries are rejected by Heckbert's criterion,
+ * and we need not compute their distances to individual cells in the subbox.
+ * The speed of this approach is heavily influenced by the subbox size: too
+ * small means too much overhead, too big loses because Heckbert's criterion
+ * can't eliminate as many colormap entries.  Empirically the best subbox
+ * size seems to be about 1/512th of the histogram (1/8th in each direction).
+ *
+ * Thomas' article also describes a refined method which is asymptotically
+ * faster than the brute-force method, but it is also far more complex and
+ * cannot efficiently be applied to small subboxes.  It is therefore not
+ * useful for programs intended to be portable to DOS machines.  On machines
+ * with plenty of memory, filling the whole histogram in one shot with Thomas'
+ * refined method might be faster than the present code --- but then again,
+ * it might not be any faster, and it's certainly more complicated.
+ */
+
+
+/* log2(histogram cells in update box) for each axis; this can be adjusted */
+#define BOX_C0_LOG  (HIST_C0_BITS-3)
+#define BOX_C1_LOG  (HIST_C1_BITS-3)
+#define BOX_C2_LOG  (HIST_C2_BITS-3)
+
+#define BOX_C0_ELEMS  (1<<BOX_C0_LOG) /* # of hist cells in update box */
+#define BOX_C1_ELEMS  (1<<BOX_C1_LOG)
+#define BOX_C2_ELEMS  (1<<BOX_C2_LOG)
+
+#define BOX_C0_SHIFT  (C0_SHIFT + BOX_C0_LOG)
+#define BOX_C1_SHIFT  (C1_SHIFT + BOX_C1_LOG)
+#define BOX_C2_SHIFT  (C2_SHIFT + BOX_C2_LOG)
+
+
+/*
+ * The next three routines implement inverse colormap filling.  They could
+ * all be folded into one big routine, but splitting them up this way saves
+ * some stack space (the mindist[] and bestdist[] arrays need not coexist)
+ * and may allow some compilers to produce better code by registerizing more
+ * inner-loop variables.
+ */
+
+LOCAL(int)
+find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
+		    JSAMPLE colorlist[])
+/* Locate the colormap entries close enough to an update box to be candidates
+ * for the nearest entry to some cell(s) in the update box.  The update box
+ * is specified by the center coordinates of its first cell.  The number of
+ * candidate colormap entries is returned, and their colormap indexes are
+ * placed in colorlist[].
+ * This routine uses Heckbert's "locally sorted search" criterion to select
+ * the colors that need further consideration.
+ */
+{
+  int numcolors = cinfo->actual_number_of_colors;
+  int maxc0, maxc1, maxc2;
+  int centerc0, centerc1, centerc2;
+  int i, x, ncolors;
+  INT32 minmaxdist, min_dist, max_dist, tdist;
+  INT32 mindist[MAXNUMCOLORS];	/* min distance to colormap entry i */
+
+  /* Compute true coordinates of update box's upper corner and center.
+   * Actually we compute the coordinates of the center of the upper-corner
+   * histogram cell, which are the upper bounds of the volume we care about.
+   * Note that since ">>" rounds down, the "center" values may be closer to
+   * min than to max; hence comparisons to them must be "<=", not "<".
+   */
+  maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT));
+  centerc0 = (minc0 + maxc0) >> 1;
+  maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT));
+  centerc1 = (minc1 + maxc1) >> 1;
+  maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT));
+  centerc2 = (minc2 + maxc2) >> 1;
+
+  /* For each color in colormap, find:
+   *  1. its minimum squared-distance to any point in the update box
+   *     (zero if color is within update box);
+   *  2. its maximum squared-distance to any point in the update box.
+   * Both of these can be found by considering only the corners of the box.
+   * We save the minimum distance for each color in mindist[];
+   * only the smallest maximum distance is of interest.
+   */
+  minmaxdist = 0x7FFFFFFFL;
+
+  for (i = 0; i < numcolors; i++) {
+    /* We compute the squared-c0-distance term, then add in the other two. */
+    x = GETJSAMPLE(cinfo->colormap[0][i]);
+    if (x < minc0) {
+      tdist = (x - minc0) * C0_SCALE;
+      min_dist = tdist*tdist;
+      tdist = (x - maxc0) * C0_SCALE;
+      max_dist = tdist*tdist;
+    } else if (x > maxc0) {
+      tdist = (x - maxc0) * C0_SCALE;
+      min_dist = tdist*tdist;
+      tdist = (x - minc0) * C0_SCALE;
+      max_dist = tdist*tdist;
+    } else {
+      /* within cell range so no contribution to min_dist */
+      min_dist = 0;
+      if (x <= centerc0) {
+	tdist = (x - maxc0) * C0_SCALE;
+	max_dist = tdist*tdist;
+      } else {
+	tdist = (x - minc0) * C0_SCALE;
+	max_dist = tdist*tdist;
+      }
+    }
+
+    x = GETJSAMPLE(cinfo->colormap[1][i]);
+    if (x < minc1) {
+      tdist = (x - minc1) * C1_SCALE;
+      min_dist += tdist*tdist;
+      tdist = (x - maxc1) * C1_SCALE;
+      max_dist += tdist*tdist;
+    } else if (x > maxc1) {
+      tdist = (x - maxc1) * C1_SCALE;
+      min_dist += tdist*tdist;
+      tdist = (x - minc1) * C1_SCALE;
+      max_dist += tdist*tdist;
+    } else {
+      /* within cell range so no contribution to min_dist */
+      if (x <= centerc1) {
+	tdist = (x - maxc1) * C1_SCALE;
+	max_dist += tdist*tdist;
+      } else {
+	tdist = (x - minc1) * C1_SCALE;
+	max_dist += tdist*tdist;
+      }
+    }
+
+    x = GETJSAMPLE(cinfo->colormap[2][i]);
+    if (x < minc2) {
+      tdist = (x - minc2) * C2_SCALE;
+      min_dist += tdist*tdist;
+      tdist = (x - maxc2) * C2_SCALE;
+      max_dist += tdist*tdist;
+    } else if (x > maxc2) {
+      tdist = (x - maxc2) * C2_SCALE;
+      min_dist += tdist*tdist;
+      tdist = (x - minc2) * C2_SCALE;
+      max_dist += tdist*tdist;
+    } else {
+      /* within cell range so no contribution to min_dist */
+      if (x <= centerc2) {
+	tdist = (x - maxc2) * C2_SCALE;
+	max_dist += tdist*tdist;
+      } else {
+	tdist = (x - minc2) * C2_SCALE;
+	max_dist += tdist*tdist;
+      }
+    }
+
+    mindist[i] = min_dist;	/* save away the results */
+    if (max_dist < minmaxdist)
+      minmaxdist = max_dist;
+  }
+
+  /* Now we know that no cell in the update box is more than minmaxdist
+   * away from some colormap entry.  Therefore, only colors that are
+   * within minmaxdist of some part of the box need be considered.
+   */
+  ncolors = 0;
+  for (i = 0; i < numcolors; i++) {
+    if (mindist[i] <= minmaxdist)
+      colorlist[ncolors++] = (JSAMPLE) i;
+  }
+  return ncolors;
+}
+
+
+LOCAL(void)
+find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
+		  int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])
+/* Find the closest colormap entry for each cell in the update box,
+ * given the list of candidate colors prepared by find_nearby_colors.
+ * Return the indexes of the closest entries in the bestcolor[] array.
+ * This routine uses Thomas' incremental distance calculation method to
+ * find the distance from a colormap entry to successive cells in the box.
+ */
+{
+  int ic0, ic1, ic2;
+  int i, icolor;
+  register INT32 * bptr;	/* pointer into bestdist[] array */
+  JSAMPLE * cptr;		/* pointer into bestcolor[] array */
+  INT32 dist0, dist1;		/* initial distance values */
+  register INT32 dist2;		/* current distance in inner loop */
+  INT32 xx0, xx1;		/* distance increments */
+  register INT32 xx2;
+  INT32 inc0, inc1, inc2;	/* initial values for increments */
+  /* This array holds the distance to the nearest-so-far color for each cell */
+  INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
+
+  /* Initialize best-distance for each cell of the update box */
+  bptr = bestdist;
+  for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--)
+    *bptr++ = 0x7FFFFFFFL;
+  
+  /* For each color selected by find_nearby_colors,
+   * compute its distance to the center of each cell in the box.
+   * If that's less than best-so-far, update best distance and color number.
+   */
+  
+  /* Nominal steps between cell centers ("x" in Thomas article) */
+#define STEP_C0  ((1 << C0_SHIFT) * C0_SCALE)
+#define STEP_C1  ((1 << C1_SHIFT) * C1_SCALE)
+#define STEP_C2  ((1 << C2_SHIFT) * C2_SCALE)
+  
+  for (i = 0; i < numcolors; i++) {
+    icolor = GETJSAMPLE(colorlist[i]);
+    /* Compute (square of) distance from minc0/c1/c2 to this color */
+    inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;
+    dist0 = inc0*inc0;
+    inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;
+    dist0 += inc1*inc1;
+    inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;
+    dist0 += inc2*inc2;
+    /* Form the initial difference increments */
+    inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0;
+    inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1;
+    inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2;
+    /* Now loop over all cells in box, updating distance per Thomas method */
+    bptr = bestdist;
+    cptr = bestcolor;
+    xx0 = inc0;
+    for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) {
+      dist1 = dist0;
+      xx1 = inc1;
+      for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) {
+	dist2 = dist1;
+	xx2 = inc2;
+	for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) {
+	  if (dist2 < *bptr) {
+	    *bptr = dist2;
+	    *cptr = (JSAMPLE) icolor;
+	  }
+	  dist2 += xx2;
+	  xx2 += 2 * STEP_C2 * STEP_C2;
+	  bptr++;
+	  cptr++;
+	}
+	dist1 += xx1;
+	xx1 += 2 * STEP_C1 * STEP_C1;
+      }
+      dist0 += xx0;
+      xx0 += 2 * STEP_C0 * STEP_C0;
+    }
+  }
+}
+
+
+LOCAL(void)
+fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)
+/* Fill the inverse-colormap entries in the update box that contains */
+/* histogram cell c0/c1/c2.  (Only that one cell MUST be filled, but */
+/* we can fill as many others as we wish.) */
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  hist3d histogram = cquantize->histogram;
+  int minc0, minc1, minc2;	/* lower left corner of update box */
+  int ic0, ic1, ic2;
+  register JSAMPLE * cptr;	/* pointer into bestcolor[] array */
+  register histptr cachep;	/* pointer into main cache array */
+  /* This array lists the candidate colormap indexes. */
+  JSAMPLE colorlist[MAXNUMCOLORS];
+  int numcolors;		/* number of candidate colors */
+  /* This array holds the actually closest colormap index for each cell. */
+  JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
+
+  /* Convert cell coordinates to update box ID */
+  c0 >>= BOX_C0_LOG;
+  c1 >>= BOX_C1_LOG;
+  c2 >>= BOX_C2_LOG;
+
+  /* Compute true coordinates of update box's origin corner.
+   * Actually we compute the coordinates of the center of the corner
+   * histogram cell, which are the lower bounds of the volume we care about.
+   */
+  minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1);
+  minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1);
+  minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1);
+  
+  /* Determine which colormap entries are close enough to be candidates
+   * for the nearest entry to some cell in the update box.
+   */
+  numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist);
+
+  /* Determine the actually nearest colors. */
+  find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist,
+		   bestcolor);
+
+  /* Save the best color numbers (plus 1) in the main cache array */
+  c0 <<= BOX_C0_LOG;		/* convert ID back to base cell indexes */
+  c1 <<= BOX_C1_LOG;
+  c2 <<= BOX_C2_LOG;
+  cptr = bestcolor;
+  for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) {
+    for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) {
+      cachep = & histogram[c0+ic0][c1+ic1][c2];
+      for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) {
+	*cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1);
+      }
+    }
+  }
+}
+
+
+/*
+ * Map some rows of pixels to the output colormapped representation.
+ */
+
+METHODDEF(void)
+pass2_no_dither (j_decompress_ptr cinfo,
+		 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
+/* This version performs no dithering */
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  hist3d histogram = cquantize->histogram;
+  register JSAMPROW inptr, outptr;
+  register histptr cachep;
+  register int c0, c1, c2;
+  int row;
+  JDIMENSION col;
+  JDIMENSION width = cinfo->output_width;
+
+  for (row = 0; row < num_rows; row++) {
+    inptr = input_buf[row];
+    outptr = output_buf[row];
+    for (col = width; col > 0; col--) {
+      /* get pixel value and index into the cache */
+      c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;
+      c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;
+      c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;
+      cachep = & histogram[c0][c1][c2];
+      /* If we have not seen this color before, find nearest colormap entry */
+      /* and update the cache */
+      if (*cachep == 0)
+	fill_inverse_cmap(cinfo, c0,c1,c2);
+      /* Now emit the colormap index for this cell */
+      *outptr++ = (JSAMPLE) (*cachep - 1);
+    }
+  }
+}
+
+
+METHODDEF(void)
+pass2_fs_dither (j_decompress_ptr cinfo,
+		 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
+/* This version performs Floyd-Steinberg dithering */
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  hist3d histogram = cquantize->histogram;
+  register LOCFSERROR cur0, cur1, cur2;	/* current error or pixel value */
+  LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */
+  LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */
+  register FSERRPTR errorptr;	/* => fserrors[] at column before current */
+  JSAMPROW inptr;		/* => current input pixel */
+  JSAMPROW outptr;		/* => current output pixel */
+  histptr cachep;
+  int dir;			/* +1 or -1 depending on direction */
+  int dir3;			/* 3*dir, for advancing inptr & errorptr */
+  int row;
+  JDIMENSION col;
+  JDIMENSION width = cinfo->output_width;
+  JSAMPLE *range_limit = cinfo->sample_range_limit;
+  int *error_limit = cquantize->error_limiter;
+  JSAMPROW colormap0 = cinfo->colormap[0];
+  JSAMPROW colormap1 = cinfo->colormap[1];
+  JSAMPROW colormap2 = cinfo->colormap[2];
+  SHIFT_TEMPS
+
+  for (row = 0; row < num_rows; row++) {
+    inptr = input_buf[row];
+    outptr = output_buf[row];
+    if (cquantize->on_odd_row) {
+      /* work right to left in this row */
+      inptr += (width-1) * 3;	/* so point to rightmost pixel */
+      outptr += width-1;
+      dir = -1;
+      dir3 = -3;
+      errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */
+      cquantize->on_odd_row = FALSE; /* flip for next time */
+    } else {
+      /* work left to right in this row */
+      dir = 1;
+      dir3 = 3;
+      errorptr = cquantize->fserrors; /* => entry before first real column */
+      cquantize->on_odd_row = TRUE; /* flip for next time */
+    }
+    /* Preset error values: no error propagated to first pixel from left */
+    cur0 = cur1 = cur2 = 0;
+    /* and no error propagated to row below yet */
+    belowerr0 = belowerr1 = belowerr2 = 0;
+    bpreverr0 = bpreverr1 = bpreverr2 = 0;
+
+    for (col = width; col > 0; col--) {
+      /* curN holds the error propagated from the previous pixel on the
+       * current line.  Add the error propagated from the previous line
+       * to form the complete error correction term for this pixel, and
+       * round the error term (which is expressed * 16) to an integer.
+       * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct
+       * for either sign of the error value.
+       * Note: errorptr points to *previous* column's array entry.
+       */
+      cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4);
+      cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4);
+      cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4);
+      /* Limit the error using transfer function set by init_error_limit.
+       * See comments with init_error_limit for rationale.
+       */
+      cur0 = error_limit[cur0];
+      cur1 = error_limit[cur1];
+      cur2 = error_limit[cur2];
+      /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.
+       * The maximum error is +- MAXJSAMPLE (or less with error limiting);
+       * this sets the required size of the range_limit array.
+       */
+      cur0 += GETJSAMPLE(inptr[0]);
+      cur1 += GETJSAMPLE(inptr[1]);
+      cur2 += GETJSAMPLE(inptr[2]);
+      cur0 = GETJSAMPLE(range_limit[cur0]);
+      cur1 = GETJSAMPLE(range_limit[cur1]);
+      cur2 = GETJSAMPLE(range_limit[cur2]);
+      /* Index into the cache with adjusted pixel value */
+      cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT];
+      /* If we have not seen this color before, find nearest colormap */
+      /* entry and update the cache */
+      if (*cachep == 0)
+	fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT);
+      /* Now emit the colormap index for this cell */
+      { register int pixcode = *cachep - 1;
+	*outptr = (JSAMPLE) pixcode;
+	/* Compute representation error for this pixel */
+	cur0 -= GETJSAMPLE(colormap0[pixcode]);
+	cur1 -= GETJSAMPLE(colormap1[pixcode]);
+	cur2 -= GETJSAMPLE(colormap2[pixcode]);
+      }
+      /* Compute error fractions to be propagated to adjacent pixels.
+       * Add these into the running sums, and simultaneously shift the
+       * next-line error sums left by 1 column.
+       */
+      { register LOCFSERROR bnexterr, delta;
+
+	bnexterr = cur0;	/* Process component 0 */
+	delta = cur0 * 2;
+	cur0 += delta;		/* form error * 3 */
+	errorptr[0] = (FSERROR) (bpreverr0 + cur0);
+	cur0 += delta;		/* form error * 5 */
+	bpreverr0 = belowerr0 + cur0;
+	belowerr0 = bnexterr;
+	cur0 += delta;		/* form error * 7 */
+	bnexterr = cur1;	/* Process component 1 */
+	delta = cur1 * 2;
+	cur1 += delta;		/* form error * 3 */
+	errorptr[1] = (FSERROR) (bpreverr1 + cur1);
+	cur1 += delta;		/* form error * 5 */
+	bpreverr1 = belowerr1 + cur1;
+	belowerr1 = bnexterr;
+	cur1 += delta;		/* form error * 7 */
+	bnexterr = cur2;	/* Process component 2 */
+	delta = cur2 * 2;
+	cur2 += delta;		/* form error * 3 */
+	errorptr[2] = (FSERROR) (bpreverr2 + cur2);
+	cur2 += delta;		/* form error * 5 */
+	bpreverr2 = belowerr2 + cur2;
+	belowerr2 = bnexterr;
+	cur2 += delta;		/* form error * 7 */
+      }
+      /* At this point curN contains the 7/16 error value to be propagated
+       * to the next pixel on the current line, and all the errors for the
+       * next line have been shifted over.  We are therefore ready to move on.
+       */
+      inptr += dir3;		/* Advance pixel pointers to next column */
+      outptr += dir;
+      errorptr += dir3;		/* advance errorptr to current column */
+    }
+    /* Post-loop cleanup: we must unload the final error values into the
+     * final fserrors[] entry.  Note we need not unload belowerrN because
+     * it is for the dummy column before or after the actual array.
+     */
+    errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */
+    errorptr[1] = (FSERROR) bpreverr1;
+    errorptr[2] = (FSERROR) bpreverr2;
+  }
+}
+
+
+/*
+ * Initialize the error-limiting transfer function (lookup table).
+ * The raw F-S error computation can potentially compute error values of up to
+ * +- MAXJSAMPLE.  But we want the maximum correction applied to a pixel to be
+ * much less, otherwise obviously wrong pixels will be created.  (Typical
+ * effects include weird fringes at color-area boundaries, isolated bright
+ * pixels in a dark area, etc.)  The standard advice for avoiding this problem
+ * is to ensure that the "corners" of the color cube are allocated as output
+ * colors; then repeated errors in the same direction cannot cause cascading
+ * error buildup.  However, that only prevents the error from getting
+ * completely out of hand; Aaron Giles reports that error limiting improves
+ * the results even with corner colors allocated.
+ * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty
+ * well, but the smoother transfer function used below is even better.  Thanks
+ * to Aaron Giles for this idea.
+ */
+
+LOCAL(void)
+init_error_limit (j_decompress_ptr cinfo)
+/* Allocate and fill in the error_limiter table */
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  int * table;
+  int in, out;
+
+  table = (int *) (*cinfo->mem->alloc_small)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int));
+  table += MAXJSAMPLE;		/* so can index -MAXJSAMPLE .. +MAXJSAMPLE */
+  cquantize->error_limiter = table;
+
+#define STEPSIZE ((MAXJSAMPLE+1)/16)
+  /* Map errors 1:1 up to +- MAXJSAMPLE/16 */
+  out = 0;
+  for (in = 0; in < STEPSIZE; in++, out++) {
+    table[in] = out; table[-in] = -out;
+  }
+  /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */
+  for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) {
+    table[in] = out; table[-in] = -out;
+  }
+  /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */
+  for (; in <= MAXJSAMPLE; in++) {
+    table[in] = out; table[-in] = -out;
+  }
+#undef STEPSIZE
+}
+
+
+/*
+ * Finish up at the end of each pass.
+ */
+
+METHODDEF(void)
+finish_pass1 (j_decompress_ptr cinfo)
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+
+  /* Select the representative colors and fill in cinfo->colormap */
+  cinfo->colormap = cquantize->sv_colormap;
+  select_colors(cinfo, cquantize->desired);
+  /* Force next pass to zero the color index table */
+  cquantize->needs_zeroed = TRUE;
+}
+
+
+METHODDEF(void)
+finish_pass2 (j_decompress_ptr cinfo)
+{
+  /* no work */
+}
+
+
+/*
+ * Initialize for each processing pass.
+ */
+
+METHODDEF(void)
+start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+  hist3d histogram = cquantize->histogram;
+  int i;
+
+  /* Only F-S dithering or no dithering is supported. */
+  /* If user asks for ordered dither, give him F-S. */
+  if (cinfo->dither_mode != JDITHER_NONE)
+    cinfo->dither_mode = JDITHER_FS;
+
+  if (is_pre_scan) {
+    /* Set up method pointers */
+    cquantize->pub.color_quantize = prescan_quantize;
+    cquantize->pub.finish_pass = finish_pass1;
+    cquantize->needs_zeroed = TRUE; /* Always zero histogram */
+  } else {
+    /* Set up method pointers */
+    if (cinfo->dither_mode == JDITHER_FS)
+      cquantize->pub.color_quantize = pass2_fs_dither;
+    else
+      cquantize->pub.color_quantize = pass2_no_dither;
+    cquantize->pub.finish_pass = finish_pass2;
+
+    /* Make sure color count is acceptable */
+    i = cinfo->actual_number_of_colors;
+    if (i < 1)
+      ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1);
+    if (i > MAXNUMCOLORS)
+      ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
+
+    if (cinfo->dither_mode == JDITHER_FS) {
+      size_t arraysize = (size_t) ((cinfo->output_width + 2) *
+				   (3 * SIZEOF(FSERROR)));
+      /* Allocate Floyd-Steinberg workspace if we didn't already. */
+      if (cquantize->fserrors == NULL)
+	cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
+	  ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
+      /* Initialize the propagated errors to zero. */
+      jzero_far((void FAR *) cquantize->fserrors, arraysize);
+      /* Make the error-limit table if we didn't already. */
+      if (cquantize->error_limiter == NULL)
+	init_error_limit(cinfo);
+      cquantize->on_odd_row = FALSE;
+    }
+
+  }
+  /* Zero the histogram or inverse color map, if necessary */
+  if (cquantize->needs_zeroed) {
+    for (i = 0; i < HIST_C0_ELEMS; i++) {
+      jzero_far((void FAR *) histogram[i],
+		HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell));
+    }
+    cquantize->needs_zeroed = FALSE;
+  }
+}
+
+
+/*
+ * Switch to a new external colormap between output passes.
+ */
+
+METHODDEF(void)
+new_color_map_2_quant (j_decompress_ptr cinfo)
+{
+  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
+
+  /* Reset the inverse color map */
+  cquantize->needs_zeroed = TRUE;
+}
+
+
+/*
+ * Module initialization routine for 2-pass color quantization.
+ */
+
+GLOBAL(void)
+jinit_2pass_quantizer (j_decompress_ptr cinfo)
+{
+  my_cquantize_ptr cquantize;
+  int i;
+
+  cquantize = (my_cquantize_ptr)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				SIZEOF(my_cquantizer));
+  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
+  cquantize->pub.start_pass = start_pass_2_quant;
+  cquantize->pub.new_color_map = new_color_map_2_quant;
+  cquantize->fserrors = NULL;	/* flag optional arrays not allocated */
+  cquantize->error_limiter = NULL;
+
+  /* Make sure jdmaster didn't give me a case I can't handle */
+  if (cinfo->out_color_components != 3)
+    ERREXIT(cinfo, JERR_NOTIMPL);
+
+  /* Allocate the histogram/inverse colormap storage */
+  cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d));
+  for (i = 0; i < HIST_C0_ELEMS; i++) {
+    cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE,
+       HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell));
+  }
+  cquantize->needs_zeroed = TRUE; /* histogram is garbage now */
+
+  /* Allocate storage for the completed colormap, if required.
+   * We do this now since it is FAR storage and may affect
+   * the memory manager's space calculations.
+   */
+  if (cinfo->enable_2pass_quant) {
+    /* Make sure color count is acceptable */
+    int desired = cinfo->desired_number_of_colors;
+    /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */
+    if (desired < 8)
+      ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8);
+    /* Make sure colormap indexes can be represented by JSAMPLEs */
+    if (desired > MAXNUMCOLORS)
+      ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
+    cquantize->sv_colormap = (*cinfo->mem->alloc_sarray)
+      ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3);
+    cquantize->desired = desired;
+  } else
+    cquantize->sv_colormap = NULL;
+
+  /* Only F-S dithering or no dithering is supported. */
+  /* If user asks for ordered dither, give him F-S. */
+  if (cinfo->dither_mode != JDITHER_NONE)
+    cinfo->dither_mode = JDITHER_FS;
+
+  /* Allocate Floyd-Steinberg workspace if necessary.
+   * This isn't really needed until pass 2, but again it is FAR storage.
+   * Although we will cope with a later change in dither_mode,
+   * we do not promise to honor max_memory_to_use if dither_mode changes.
+   */
+  if (cinfo->dither_mode == JDITHER_FS) {
+    cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE,
+       (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR))));
+    /* Might as well create the error-limiting table too. */
+    init_error_limit(cinfo);
+  }
+}
+
+#endif /* QUANT_2PASS_SUPPORTED */
diff --git a/src/libjpeg/jutils.c b/src/libjpeg/jutils.c
new file mode 100644
index 0000000..286cda2
--- /dev/null
+++ b/src/libjpeg/jutils.c
@@ -0,0 +1,179 @@
+/*
+ * jutils.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains tables and miscellaneous utility routines needed
+ * for both compression and decompression.
+ * Note we prefix all global names with "j" to minimize conflicts with
+ * a surrounding application.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element
+ * of a DCT block read in natural order (left to right, top to bottom).
+ */
+
+#if 0				/* This table is not actually needed in v6a */
+
+const int jpeg_zigzag_order[DCTSIZE2] = {
+   0,  1,  5,  6, 14, 15, 27, 28,
+   2,  4,  7, 13, 16, 26, 29, 42,
+   3,  8, 12, 17, 25, 30, 41, 43,
+   9, 11, 18, 24, 31, 40, 44, 53,
+  10, 19, 23, 32, 39, 45, 52, 54,
+  20, 22, 33, 38, 46, 51, 55, 60,
+  21, 34, 37, 47, 50, 56, 59, 61,
+  35, 36, 48, 49, 57, 58, 62, 63
+};
+
+#endif
+
+/*
+ * jpeg_natural_order[i] is the natural-order position of the i'th element
+ * of zigzag order.
+ *
+ * When reading corrupted data, the Huffman decoders could attempt
+ * to reference an entry beyond the end of this array (if the decoded
+ * zero run length reaches past the end of the block).  To prevent
+ * wild stores without adding an inner-loop test, we put some extra
+ * "63"s after the real entries.  This will cause the extra coefficient
+ * to be stored in location 63 of the block, not somewhere random.
+ * The worst case would be a run-length of 15, which means we need 16
+ * fake entries.
+ */
+
+const int jpeg_natural_order[DCTSIZE2+16] = {
+  0,  1,  8, 16,  9,  2,  3, 10,
+ 17, 24, 32, 25, 18, 11,  4,  5,
+ 12, 19, 26, 33, 40, 48, 41, 34,
+ 27, 20, 13,  6,  7, 14, 21, 28,
+ 35, 42, 49, 56, 57, 50, 43, 36,
+ 29, 22, 15, 23, 30, 37, 44, 51,
+ 58, 59, 52, 45, 38, 31, 39, 46,
+ 53, 60, 61, 54, 47, 55, 62, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
+ 63, 63, 63, 63, 63, 63, 63, 63
+};
+
+
+/*
+ * Arithmetic utilities
+ */
+
+GLOBAL(long)
+jdiv_round_up (long a, long b)
+/* Compute a/b rounded up to next integer, ie, ceil(a/b) */
+/* Assumes a >= 0, b > 0 */
+{
+  return (a + b - 1L) / b;
+}
+
+
+GLOBAL(long)
+jround_up (long a, long b)
+/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */
+/* Assumes a >= 0, b > 0 */
+{
+  a += b - 1L;
+  return a - (a % b);
+}
+
+
+/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays
+ * and coefficient-block arrays.  This won't work on 80x86 because the arrays
+ * are FAR and we're assuming a small-pointer memory model.  However, some
+ * DOS compilers provide far-pointer versions of memcpy() and memset() even
+ * in the small-model libraries.  These will be used if USE_FMEM is defined.
+ * Otherwise, the routines below do it the hard way.  (The performance cost
+ * is not all that great, because these routines aren't very heavily used.)
+ */
+
+#ifndef NEED_FAR_POINTERS	/* normal case, same as regular macros */
+#define FMEMCOPY(dest,src,size)	MEMCOPY(dest,src,size)
+#define FMEMZERO(target,size)	MEMZERO(target,size)
+#else				/* 80x86 case, define if we can */
+#ifdef USE_FMEM
+#define FMEMCOPY(dest,src,size)	_fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size))
+#define FMEMZERO(target,size)	_fmemset((void FAR *)(target), 0, (size_t)(size))
+#endif
+#endif
+
+
+GLOBAL(void)
+jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
+		   JSAMPARRAY output_array, int dest_row,
+		   int num_rows, JDIMENSION num_cols)
+/* Copy some rows of samples from one place to another.
+ * num_rows rows are copied from input_array[source_row++]
+ * to output_array[dest_row++]; these areas may overlap for duplication.
+ * The source and destination arrays must be at least as wide as num_cols.
+ */
+{
+  register JSAMPROW inptr, outptr;
+#ifdef FMEMCOPY
+  register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));
+#else
+  register JDIMENSION count;
+#endif
+  register int row;
+
+  input_array += source_row;
+  output_array += dest_row;
+
+  for (row = num_rows; row > 0; row--) {
+    inptr = *input_array++;
+    outptr = *output_array++;
+#ifdef FMEMCOPY
+    FMEMCOPY(outptr, inptr, count);
+#else
+    for (count = num_cols; count > 0; count--)
+      *outptr++ = *inptr++;	/* needn't bother with GETJSAMPLE() here */
+#endif
+  }
+}
+
+
+GLOBAL(void)
+jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,
+		 JDIMENSION num_blocks)
+/* Copy a row of coefficient blocks from one place to another. */
+{
+#ifdef FMEMCOPY
+  FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
+#else
+  register JCOEFPTR inptr, outptr;
+  register long count;
+
+  inptr = (JCOEFPTR) input_row;
+  outptr = (JCOEFPTR) output_row;
+  for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {
+    *outptr++ = *inptr++;
+  }
+#endif
+}
+
+
+GLOBAL(void)
+jzero_far (void FAR * target, size_t bytestozero)
+/* Zero out a chunk of FAR memory. */
+/* This might be sample-array data, block-array data, or alloc_large data. */
+{
+#ifdef FMEMZERO
+  FMEMZERO(target, bytestozero);
+#else
+  register char FAR * ptr = (char FAR *) target;
+  register size_t count;
+
+  for (count = bytestozero; count > 0; count--) {
+    *ptr++ = 0;
+  }
+#endif
+}
diff --git a/src/libjpeg/jversion.h b/src/libjpeg/jversion.h
new file mode 100644
index 0000000..dadd453
--- /dev/null
+++ b/src/libjpeg/jversion.h
@@ -0,0 +1,14 @@
+/*
+ * jversion.h
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains software version identification.
+ */
+
+
+#define JVERSION	"6b  27-Mar-1998"
+
+#define JCOPYRIGHT	"Copyright (C) 1998, Thomas G. Lane"
diff --git a/src/libjpeg/rdbmp.c b/src/libjpeg/rdbmp.c
new file mode 100644
index 0000000..4f61bcf
--- /dev/null
+++ b/src/libjpeg/rdbmp.c
@@ -0,0 +1,439 @@
+/*
+ * rdbmp.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to read input images in Microsoft "BMP"
+ * format (MS Windows 3.x, OS/2 1.x, and OS/2 2.x flavors).
+ * Currently, only 8-bit and 24-bit images are supported, not 1-bit or
+ * 4-bit (feeding such low-depth images into JPEG would be silly anyway).
+ * Also, we don't support RLE-compressed files.
+ *
+ * These routines may need modification for non-Unix environments or
+ * specialized applications.  As they stand, they assume input from
+ * an ordinary stdio stream.  They further assume that reading begins
+ * at the start of the file; start_input may need work if the
+ * user interface has already read some data (e.g., to determine that
+ * the file is indeed BMP format).
+ *
+ * This code contributed by James Arthur Boucher.
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef BMP_SUPPORTED
+
+
+/* Macros to deal with unsigned chars as efficiently as compiler allows */
+
+#ifdef HAVE_UNSIGNED_CHAR
+typedef unsigned char U_CHAR;
+#define UCH(x)	((int) (x))
+#else /* !HAVE_UNSIGNED_CHAR */
+#ifdef CHAR_IS_UNSIGNED
+typedef char U_CHAR;
+#define UCH(x)	((int) (x))
+#else
+typedef char U_CHAR;
+#define UCH(x)	((int) (x) & 0xFF)
+#endif
+#endif /* HAVE_UNSIGNED_CHAR */
+
+
+#define	ReadOK(file,buffer,len)	(JFREAD(file,buffer,len) == ((size_t) (len)))
+
+
+/* Private version of data source object */
+
+typedef struct _bmp_source_struct * bmp_source_ptr;
+
+typedef struct _bmp_source_struct {
+  struct cjpeg_source_struct pub; /* public fields */
+
+  j_compress_ptr cinfo;		/* back link saves passing separate parm */
+
+  JSAMPARRAY colormap;		/* BMP colormap (converted to my format) */
+
+  jvirt_sarray_ptr whole_image;	/* Needed to reverse row order */
+  JDIMENSION source_row;	/* Current source row number */
+  JDIMENSION row_width;		/* Physical width of scanlines in file */
+
+  int bits_per_pixel;		/* remembers 8- or 24-bit format */
+} bmp_source_struct;
+
+
+LOCAL(int)
+read_byte (bmp_source_ptr sinfo)
+/* Read next byte from BMP file */
+{
+  register FILE *infile = sinfo->pub.input_file;
+  register int c;
+
+  if ((c = getc(infile)) == EOF)
+    ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);
+  return c;
+}
+
+
+LOCAL(void)
+read_colormap (bmp_source_ptr sinfo, int cmaplen, int mapentrysize)
+/* Read the colormap from a BMP file */
+{
+  int i;
+
+  switch (mapentrysize) {
+  case 3:
+    /* BGR format (occurs in OS/2 files) */
+    for (i = 0; i < cmaplen; i++) {
+      sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);
+      sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);
+      sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);
+    }
+    break;
+  case 4:
+    /* BGR0 format (occurs in MS Windows files) */
+    for (i = 0; i < cmaplen; i++) {
+      sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);
+      sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);
+      sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);
+      (void) read_byte(sinfo);
+    }
+    break;
+  default:
+    ERREXIT(sinfo->cinfo, JERR_BMP_BADCMAP);
+    break;
+  }
+}
+
+
+/*
+ * Read one row of pixels.
+ * The image has been read into the whole_image array, but is otherwise
+ * unprocessed.  We must read it out in top-to-bottom row order, and if
+ * it is an 8-bit image, we must expand colormapped pixels to 24bit format.
+ */
+
+METHODDEF(JDIMENSION)
+get_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading 8-bit colormap indexes */
+{
+  bmp_source_ptr source = (bmp_source_ptr) sinfo;
+  register JSAMPARRAY colormap = source->colormap;
+  JSAMPARRAY image_ptr;
+  register int t;
+  register JSAMPROW inptr, outptr;
+  register JDIMENSION col;
+
+  /* Fetch next row from virtual array */
+  source->source_row--;
+  image_ptr = (*cinfo->mem->access_virt_sarray)
+    ((j_common_ptr) cinfo, source->whole_image,
+     source->source_row, (JDIMENSION) 1, FALSE);
+
+  /* Expand the colormap indexes to real data */
+  inptr = image_ptr[0];
+  outptr = source->pub.buffer[0];
+  for (col = cinfo->image_width; col > 0; col--) {
+    t = GETJSAMPLE(*inptr++);
+    *outptr++ = colormap[0][t];	/* can omit GETJSAMPLE() safely */
+    *outptr++ = colormap[1][t];
+    *outptr++ = colormap[2][t];
+  }
+
+  return 1;
+}
+
+
+METHODDEF(JDIMENSION)
+get_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading 24-bit pixels */
+{
+  bmp_source_ptr source = (bmp_source_ptr) sinfo;
+  JSAMPARRAY image_ptr;
+  register JSAMPROW inptr, outptr;
+  register JDIMENSION col;
+
+  /* Fetch next row from virtual array */
+  source->source_row--;
+  image_ptr = (*cinfo->mem->access_virt_sarray)
+    ((j_common_ptr) cinfo, source->whole_image,
+     source->source_row, (JDIMENSION) 1, FALSE);
+
+  /* Transfer data.  Note source values are in BGR order
+   * (even though Microsoft's own documents say the opposite).
+   */
+  inptr = image_ptr[0];
+  outptr = source->pub.buffer[0];
+  for (col = cinfo->image_width; col > 0; col--) {
+    outptr[2] = *inptr++;	/* can omit GETJSAMPLE() safely */
+    outptr[1] = *inptr++;
+    outptr[0] = *inptr++;
+    outptr += 3;
+  }
+
+  return 1;
+}
+
+
+/*
+ * This method loads the image into whole_image during the first call on
+ * get_pixel_rows.  The get_pixel_rows pointer is then adjusted to call
+ * get_8bit_row or get_24bit_row on subsequent calls.
+ */
+
+METHODDEF(JDIMENSION)
+preload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  bmp_source_ptr source = (bmp_source_ptr) sinfo;
+  register FILE *infile = source->pub.input_file;
+  register int c;
+  register JSAMPROW out_ptr;
+  JSAMPARRAY image_ptr;
+  JDIMENSION row, col;
+  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
+
+  /* Read the data into a virtual array in input-file row order. */
+  for (row = 0; row < cinfo->image_height; row++) {
+    if (progress != NULL) {
+      progress->pub.pass_counter = (long) row;
+      progress->pub.pass_limit = (long) cinfo->image_height;
+      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
+    }
+    image_ptr = (*cinfo->mem->access_virt_sarray)
+      ((j_common_ptr) cinfo, source->whole_image,
+       row, (JDIMENSION) 1, TRUE);
+    out_ptr = image_ptr[0];
+    for (col = source->row_width; col > 0; col--) {
+      /* inline copy of read_byte() for speed */
+      if ((c = getc(infile)) == EOF)
+	ERREXIT(cinfo, JERR_INPUT_EOF);
+      *out_ptr++ = (JSAMPLE) c;
+    }
+  }
+  if (progress != NULL)
+    progress->completed_extra_passes++;
+
+  /* Set up to read from the virtual array in top-to-bottom order */
+  switch (source->bits_per_pixel) {
+  case 8:
+    source->pub.get_pixel_rows = get_8bit_row;
+    break;
+  case 24:
+    source->pub.get_pixel_rows = get_24bit_row;
+    break;
+  default:
+    ERREXIT(cinfo, JERR_BMP_BADDEPTH);
+  }
+  source->source_row = cinfo->image_height;
+
+  /* And read the first row */
+  return (*source->pub.get_pixel_rows) (cinfo, sinfo);
+}
+
+
+/*
+ * Read the file header; return image size and component count.
+ */
+
+METHODDEF(void)
+start_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  bmp_source_ptr source = (bmp_source_ptr) sinfo;
+  U_CHAR bmpfileheader[14];
+  U_CHAR bmpinfoheader[64];
+#define GET_2B(array,offset)  ((unsigned int) UCH(array[offset]) + \
+			       (((unsigned int) UCH(array[offset+1])) << 8))
+#define GET_4B(array,offset)  ((INT32) UCH(array[offset]) + \
+			       (((INT32) UCH(array[offset+1])) << 8) + \
+			       (((INT32) UCH(array[offset+2])) << 16) + \
+			       (((INT32) UCH(array[offset+3])) << 24))
+  INT32 bfOffBits;
+  INT32 headerSize;
+  INT32 biWidth = 0;		/* initialize to avoid compiler warning */
+  INT32 biHeight = 0;
+  unsigned int biPlanes;
+  INT32 biCompression;
+  INT32 biXPelsPerMeter,biYPelsPerMeter;
+  INT32 biClrUsed = 0;
+  int mapentrysize = 0;		/* 0 indicates no colormap */
+  INT32 bPad;
+  JDIMENSION row_width;
+
+  /* Read and verify the bitmap file header */
+  if (! ReadOK(source->pub.input_file, bmpfileheader, 14))
+    ERREXIT(cinfo, JERR_INPUT_EOF);
+  if (GET_2B(bmpfileheader,0) != 0x4D42) /* 'BM' */
+    ERREXIT(cinfo, JERR_BMP_NOT);
+  bfOffBits = (INT32) GET_4B(bmpfileheader,10);
+  /* We ignore the remaining fileheader fields */
+
+  /* The infoheader might be 12 bytes (OS/2 1.x), 40 bytes (Windows),
+   * or 64 bytes (OS/2 2.x).  Check the first 4 bytes to find out which.
+   */
+  if (! ReadOK(source->pub.input_file, bmpinfoheader, 4))
+    ERREXIT(cinfo, JERR_INPUT_EOF);
+  headerSize = (INT32) GET_4B(bmpinfoheader,0);
+  if (headerSize < 12 || headerSize > 64)
+    ERREXIT(cinfo, JERR_BMP_BADHEADER);
+  if (! ReadOK(source->pub.input_file, bmpinfoheader+4, headerSize-4))
+    ERREXIT(cinfo, JERR_INPUT_EOF);
+
+  switch ((int) headerSize) {
+  case 12:
+    /* Decode OS/2 1.x header (Microsoft calls this a BITMAPCOREHEADER) */
+    biWidth = (INT32) GET_2B(bmpinfoheader,4);
+    biHeight = (INT32) GET_2B(bmpinfoheader,6);
+    biPlanes = GET_2B(bmpinfoheader,8);
+    source->bits_per_pixel = (int) GET_2B(bmpinfoheader,10);
+
+    switch (source->bits_per_pixel) {
+    case 8:			/* colormapped image */
+      mapentrysize = 3;		/* OS/2 uses RGBTRIPLE colormap */
+      TRACEMS2(cinfo, 1, JTRC_BMP_OS2_MAPPED, (int) biWidth, (int) biHeight);
+      break;
+    case 24:			/* RGB image */
+      TRACEMS2(cinfo, 1, JTRC_BMP_OS2, (int) biWidth, (int) biHeight);
+      break;
+    default:
+      ERREXIT(cinfo, JERR_BMP_BADDEPTH);
+      break;
+    }
+    if (biPlanes != 1)
+      ERREXIT(cinfo, JERR_BMP_BADPLANES);
+    break;
+  case 40:
+  case 64:
+    /* Decode Windows 3.x header (Microsoft calls this a BITMAPINFOHEADER) */
+    /* or OS/2 2.x header, which has additional fields that we ignore */
+    biWidth = GET_4B(bmpinfoheader,4);
+    biHeight = GET_4B(bmpinfoheader,8);
+    biPlanes = GET_2B(bmpinfoheader,12);
+    source->bits_per_pixel = (int) GET_2B(bmpinfoheader,14);
+    biCompression = GET_4B(bmpinfoheader,16);
+    biXPelsPerMeter = GET_4B(bmpinfoheader,24);
+    biYPelsPerMeter = GET_4B(bmpinfoheader,28);
+    biClrUsed = GET_4B(bmpinfoheader,32);
+    /* biSizeImage, biClrImportant fields are ignored */
+
+    switch (source->bits_per_pixel) {
+    case 8:			/* colormapped image */
+      mapentrysize = 4;		/* Windows uses RGBQUAD colormap */
+      TRACEMS2(cinfo, 1, JTRC_BMP_MAPPED, (int) biWidth, (int) biHeight);
+      break;
+    case 24:			/* RGB image */
+      TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight);
+      break;
+    default:
+      ERREXIT(cinfo, JERR_BMP_BADDEPTH);
+      break;
+    }
+    if (biPlanes != 1)
+      ERREXIT(cinfo, JERR_BMP_BADPLANES);
+    if (biCompression != 0)
+      ERREXIT(cinfo, JERR_BMP_COMPRESSED);
+
+    if (biXPelsPerMeter > 0 && biYPelsPerMeter > 0) {
+      /* Set JFIF density parameters from the BMP data */
+      cinfo->X_density = (UINT16) (biXPelsPerMeter/100); /* 100 cm per meter */
+      cinfo->Y_density = (UINT16) (biYPelsPerMeter/100);
+      cinfo->density_unit = 2;	/* dots/cm */
+    }
+    break;
+  default:
+    ERREXIT(cinfo, JERR_BMP_BADHEADER);
+    break;
+  }
+
+  /* Compute distance to bitmap data --- will adjust for colormap below */
+  bPad = bfOffBits - (headerSize + 14);
+
+  /* Read the colormap, if any */
+  if (mapentrysize > 0) {
+    if (biClrUsed <= 0)
+      biClrUsed = 256;		/* assume it's 256 */
+    else if (biClrUsed > 256)
+      ERREXIT(cinfo, JERR_BMP_BADCMAP);
+    /* Allocate space to store the colormap */
+    source->colormap = (*cinfo->mem->alloc_sarray)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE,
+       (JDIMENSION) biClrUsed, (JDIMENSION) 3);
+    /* and read it from the file */
+    read_colormap(source, (int) biClrUsed, mapentrysize);
+    /* account for size of colormap */
+    bPad -= biClrUsed * mapentrysize;
+  }
+
+  /* Skip any remaining pad bytes */
+  if (bPad < 0)			/* incorrect bfOffBits value? */
+    ERREXIT(cinfo, JERR_BMP_BADHEADER);
+  while (--bPad >= 0) {
+    (void) read_byte(source);
+  }
+
+  /* Compute row width in file, including padding to 4-byte boundary */
+  if (source->bits_per_pixel == 24)
+    row_width = (JDIMENSION) (biWidth * 3);
+  else
+    row_width = (JDIMENSION) biWidth;
+  while ((row_width & 3) != 0) row_width++;
+  source->row_width = row_width;
+
+  /* Allocate space for inversion array, prepare for preload pass */
+  source->whole_image = (*cinfo->mem->request_virt_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+     row_width, (JDIMENSION) biHeight, (JDIMENSION) 1);
+  source->pub.get_pixel_rows = preload_image;
+  if (cinfo->progress != NULL) {
+    cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
+    progress->total_extra_passes++; /* count file input as separate pass */
+  }
+
+  /* Allocate one-row buffer for returned data */
+  source->pub.buffer = (*cinfo->mem->alloc_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE,
+     (JDIMENSION) (biWidth * 3), (JDIMENSION) 1);
+  source->pub.buffer_height = 1;
+
+  cinfo->in_color_space = JCS_RGB;
+  cinfo->input_components = 3;
+  cinfo->data_precision = 8;
+  cinfo->image_width = (JDIMENSION) biWidth;
+  cinfo->image_height = (JDIMENSION) biHeight;
+}
+
+
+/*
+ * Finish up at the end of the file.
+ */
+
+METHODDEF(void)
+finish_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  /* no work */
+}
+
+
+/*
+ * The module selection routine for BMP format input.
+ */
+
+GLOBAL(cjpeg_source_ptr)
+jinit_read_bmp (j_compress_ptr cinfo)
+{
+  bmp_source_ptr source;
+
+  /* Create module interface object */
+  source = (bmp_source_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(bmp_source_struct));
+  source->cinfo = cinfo;	/* make back link for subroutines */
+  /* Fill in method ptrs, except get_pixel_rows which start_input sets */
+  source->pub.start_input = start_input_bmp;
+  source->pub.finish_input = finish_input_bmp;
+
+  return (cjpeg_source_ptr) source;
+}
+
+#endif /* BMP_SUPPORTED */
diff --git a/src/libjpeg/rdcolmap.c b/src/libjpeg/rdcolmap.c
new file mode 100644
index 0000000..eebf834
--- /dev/null
+++ b/src/libjpeg/rdcolmap.c
@@ -0,0 +1,253 @@
+/*
+ * rdcolmap.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file implements djpeg's "-map file" switch.  It reads a source image
+ * and constructs a colormap to be supplied to the JPEG decompressor.
+ *
+ * Currently, these file formats are supported for the map file:
+ *   GIF: the contents of the GIF's global colormap are used.
+ *   PPM (either text or raw flavor): the entire file is read and
+ *      each unique pixel value is entered in the map.
+ * Note that reading a large PPM file will be horrendously slow.
+ * Typically, a PPM-format map file should contain just one pixel
+ * of each desired color.  Such a file can be extracted from an
+ * ordinary image PPM file with ppmtomap(1).
+ *
+ * Rescaling a PPM that has a maxval unequal to MAXJSAMPLE is not
+ * currently implemented.
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef QUANT_2PASS_SUPPORTED	/* otherwise can't quantize to supplied map */
+
+/* Portions of this code are based on the PBMPLUS library, which is:
+**
+** Copyright (C) 1988 by Jef Poskanzer.
+**
+** Permission to use, copy, modify, and distribute this software and its
+** documentation for any purpose and without fee is hereby granted, provided
+** that the above copyright notice appear in all copies and that both that
+** copyright notice and this permission notice appear in supporting
+** documentation.  This software is provided "as is" without express or
+** implied warranty.
+*/
+
+
+/*
+ * Add a (potentially) new color to the color map.
+ */
+
+LOCAL(void)
+add_map_entry (j_decompress_ptr cinfo, int R, int G, int B)
+{
+  JSAMPROW colormap0 = cinfo->colormap[0];
+  JSAMPROW colormap1 = cinfo->colormap[1];
+  JSAMPROW colormap2 = cinfo->colormap[2];
+  int ncolors = cinfo->actual_number_of_colors;
+  int index;
+
+  /* Check for duplicate color. */
+  for (index = 0; index < ncolors; index++) {
+    if (GETJSAMPLE(colormap0[index]) == R &&
+	GETJSAMPLE(colormap1[index]) == G &&
+	GETJSAMPLE(colormap2[index]) == B)
+      return;			/* color is already in map */
+  }
+
+  /* Check for map overflow. */
+  if (ncolors >= (MAXJSAMPLE+1))
+    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, (MAXJSAMPLE+1));
+
+  /* OK, add color to map. */
+  colormap0[ncolors] = (JSAMPLE) R;
+  colormap1[ncolors] = (JSAMPLE) G;
+  colormap2[ncolors] = (JSAMPLE) B;
+  cinfo->actual_number_of_colors++;
+}
+
+
+/*
+ * Extract color map from a GIF file.
+ */
+
+LOCAL(void)
+read_gif_map (j_decompress_ptr cinfo, FILE * infile)
+{
+  int header[13];
+  int i, colormaplen;
+  int R, G, B;
+
+  /* Initial 'G' has already been read by read_color_map */
+  /* Read the rest of the GIF header and logical screen descriptor */
+  for (i = 1; i < 13; i++) {
+    if ((header[i] = getc(infile)) == EOF)
+      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+  }
+
+  /* Verify GIF Header */
+  if (header[1] != 'I' || header[2] != 'F')
+    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+
+  /* There must be a global color map. */
+  if ((header[10] & 0x80) == 0)
+    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+
+  /* OK, fetch it. */
+  colormaplen = 2 << (header[10] & 0x07);
+
+  for (i = 0; i < colormaplen; i++) {
+    R = getc(infile);
+    G = getc(infile);
+    B = getc(infile);
+    if (R == EOF || G == EOF || B == EOF)
+      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+    add_map_entry(cinfo,
+		  R << (BITS_IN_JSAMPLE-8),
+		  G << (BITS_IN_JSAMPLE-8),
+		  B << (BITS_IN_JSAMPLE-8));
+  }
+}
+
+
+/* Support routines for reading PPM */
+
+
+LOCAL(int)
+pbm_getc (FILE * infile)
+/* Read next char, skipping over any comments */
+/* A comment/newline sequence is returned as a newline */
+{
+  register int ch;
+  
+  ch = getc(infile);
+  if (ch == '#') {
+    do {
+      ch = getc(infile);
+    } while (ch != '\n' && ch != EOF);
+  }
+  return ch;
+}
+
+
+LOCAL(unsigned int)
+read_pbm_integer (j_decompress_ptr cinfo, FILE * infile)
+/* Read an unsigned decimal integer from the PPM file */
+/* Swallows one trailing character after the integer */
+/* Note that on a 16-bit-int machine, only values up to 64k can be read. */
+/* This should not be a problem in practice. */
+{
+  register int ch;
+  register unsigned int val;
+  
+  /* Skip any leading whitespace */
+  do {
+    ch = pbm_getc(infile);
+    if (ch == EOF)
+      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+  } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r');
+  
+  if (ch < '0' || ch > '9')
+    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+  
+  val = ch - '0';
+  while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {
+    val *= 10;
+    val += ch - '0';
+  }
+  return val;
+}
+
+
+/*
+ * Extract color map from a PPM file.
+ */
+
+LOCAL(void)
+read_ppm_map (j_decompress_ptr cinfo, FILE * infile)
+{
+  int c;
+  unsigned int w, h, maxval, row, col;
+  int R, G, B;
+
+  /* Initial 'P' has already been read by read_color_map */
+  c = getc(infile);		/* save format discriminator for a sec */
+
+  /* while we fetch the remaining header info */
+  w = read_pbm_integer(cinfo, infile);
+  h = read_pbm_integer(cinfo, infile);
+  maxval = read_pbm_integer(cinfo, infile);
+
+  if (w <= 0 || h <= 0 || maxval <= 0) /* error check */
+    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+
+  /* For now, we don't support rescaling from an unusual maxval. */
+  if (maxval != (unsigned int) MAXJSAMPLE)
+    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+
+  switch (c) {
+  case '3':			/* it's a text-format PPM file */
+    for (row = 0; row < h; row++) {
+      for (col = 0; col < w; col++) {
+	R = read_pbm_integer(cinfo, infile);
+	G = read_pbm_integer(cinfo, infile);
+	B = read_pbm_integer(cinfo, infile);
+	add_map_entry(cinfo, R, G, B);
+      }
+    }
+    break;
+
+  case '6':			/* it's a raw-format PPM file */
+    for (row = 0; row < h; row++) {
+      for (col = 0; col < w; col++) {
+	R = getc(infile);
+	G = getc(infile);
+	B = getc(infile);
+	if (R == EOF || G == EOF || B == EOF)
+	  ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+	add_map_entry(cinfo, R, G, B);
+      }
+    }
+    break;
+
+  default:
+    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+    break;
+  }
+}
+
+
+/*
+ * Main entry point from djpeg.c.
+ *  Input: opened input file (from file name argument on command line).
+ *  Output: colormap and actual_number_of_colors fields are set in cinfo.
+ */
+
+GLOBAL(void)
+read_color_map (j_decompress_ptr cinfo, FILE * infile)
+{
+  /* Allocate space for a color map of maximum supported size. */
+  cinfo->colormap = (*cinfo->mem->alloc_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE,
+     (JDIMENSION) (MAXJSAMPLE+1), (JDIMENSION) 3);
+  cinfo->actual_number_of_colors = 0; /* initialize map to empty */
+
+  /* Read first byte to determine file format */
+  switch (getc(infile)) {
+  case 'G':
+    read_gif_map(cinfo, infile);
+    break;
+  case 'P':
+    read_ppm_map(cinfo, infile);
+    break;
+  default:
+    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
+    break;
+  }
+}
+
+#endif /* QUANT_2PASS_SUPPORTED */
diff --git a/src/libjpeg/rdgif.c b/src/libjpeg/rdgif.c
new file mode 100644
index 0000000..b0757e7
--- /dev/null
+++ b/src/libjpeg/rdgif.c
@@ -0,0 +1,38 @@
+/*
+ * rdgif.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to read input images in GIF format.
+ *
+ *****************************************************************************
+ * NOTE: to avoid entanglements with Unisys' patent on LZW compression,      *
+ * the ability to read GIF files has been removed from the IJG distribution. *
+ * Sorry about that.                                                         *
+ *****************************************************************************
+ *
+ * We are required to state that
+ *    "The Graphics Interchange Format(c) is the Copyright property of
+ *    CompuServe Incorporated. GIF(sm) is a Service Mark property of
+ *    CompuServe Incorporated."
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef GIF_SUPPORTED
+
+/*
+ * The module selection routine for GIF format input.
+ */
+
+GLOBAL(cjpeg_source_ptr)
+jinit_read_gif (j_compress_ptr cinfo)
+{
+  fprintf(stderr, "GIF input is unsupported for legal reasons.  Sorry.\n");
+  exit(EXIT_FAILURE);
+  return NULL;			/* keep compiler happy */
+}
+
+#endif /* GIF_SUPPORTED */
diff --git a/src/libjpeg/rdjpgcom.c b/src/libjpeg/rdjpgcom.c
new file mode 100644
index 0000000..c8b94bb
--- /dev/null
+++ b/src/libjpeg/rdjpgcom.c
@@ -0,0 +1,496 @@
+/*
+ * rdjpgcom.c
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a very simple stand-alone application that displays
+ * the text in COM (comment) markers in a JFIF file.
+ * This may be useful as an example of the minimum logic needed to parse
+ * JPEG markers.
+ */
+
+#define JPEG_CJPEG_DJPEG	/* to get the command-line config symbols */
+#include "jinclude.h"		/* get auto-config symbols, <stdio.h> */
+
+#include <ctype.h>		/* to declare isupper(), tolower() */
+#ifdef USE_SETMODE
+#include <fcntl.h>		/* to declare setmode()'s parameter macros */
+/* If you have setmode() but not <io.h>, just delete this line: */
+#include <io.h>			/* to declare setmode() */
+#endif
+
+#ifdef USE_CCOMMAND		/* command-line reader for Macintosh */
+#ifdef __MWERKS__
+#include <SIOUX.h>              /* Metrowerks needs this */
+#include <console.h>		/* ... and this */
+#endif
+#ifdef THINK_C
+#include <console.h>		/* Think declares it here */
+#endif
+#endif
+
+#ifdef DONT_USE_B_MODE		/* define mode parameters for fopen() */
+#define READ_BINARY	"r"
+#else
+#ifdef VMS			/* VMS is very nonstandard */
+#define READ_BINARY	"rb", "ctx=stm"
+#else				/* standard ANSI-compliant case */
+#define READ_BINARY	"rb"
+#endif
+#endif
+
+#ifndef EXIT_FAILURE		/* define exit() codes if not provided */
+#define EXIT_FAILURE  1
+#endif
+#ifndef EXIT_SUCCESS
+#ifdef VMS
+#define EXIT_SUCCESS  1		/* VMS is very nonstandard */
+#else
+#define EXIT_SUCCESS  0
+#endif
+#endif
+
+
+/*
+ * These macros are used to read the input file.
+ * To reuse this code in another application, you might need to change these.
+ */
+
+static FILE * infile;		/* input JPEG file */
+
+/* Return next input byte, or EOF if no more */
+#define NEXTBYTE()  getc(infile)
+
+
+/* Error exit handler */
+#define ERREXIT(msg)  (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE))
+
+
+/* Read one byte, testing for EOF */
+static int
+read_1_byte (void)
+{
+  int c;
+
+  c = NEXTBYTE();
+  if (c == EOF)
+    ERREXIT("Premature EOF in JPEG file");
+  return c;
+}
+
+/* Read 2 bytes, convert to unsigned int */
+/* All 2-byte quantities in JPEG markers are MSB first */
+static unsigned int
+read_2_bytes (void)
+{
+  int c1, c2;
+
+  c1 = NEXTBYTE();
+  if (c1 == EOF)
+    ERREXIT("Premature EOF in JPEG file");
+  c2 = NEXTBYTE();
+  if (c2 == EOF)
+    ERREXIT("Premature EOF in JPEG file");
+  return (((unsigned int) c1) << 8) + ((unsigned int) c2);
+}
+
+
+/*
+ * JPEG markers consist of one or more 0xFF bytes, followed by a marker
+ * code byte (which is not an FF).  Here are the marker codes of interest
+ * in this program.  (See jdmarker.c for a more complete list.)
+ */
+
+#define M_SOF0  0xC0		/* Start Of Frame N */
+#define M_SOF1  0xC1		/* N indicates which compression process */
+#define M_SOF2  0xC2		/* Only SOF0-SOF2 are now in common use */
+#define M_SOF3  0xC3
+#define M_SOF5  0xC5		/* NB: codes C4 and CC are NOT SOF markers */
+#define M_SOF6  0xC6
+#define M_SOF7  0xC7
+#define M_SOF9  0xC9
+#define M_SOF10 0xCA
+#define M_SOF11 0xCB
+#define M_SOF13 0xCD
+#define M_SOF14 0xCE
+#define M_SOF15 0xCF
+#define M_SOI   0xD8		/* Start Of Image (beginning of datastream) */
+#define M_EOI   0xD9		/* End Of Image (end of datastream) */
+#define M_SOS   0xDA		/* Start Of Scan (begins compressed data) */
+#define M_APP0	0xE0		/* Application-specific marker, type N */
+#define M_APP12	0xEC		/* (we don't bother to list all 16 APPn's) */
+#define M_COM   0xFE		/* COMment */
+
+
+/*
+ * Find the next JPEG marker and return its marker code.
+ * We expect at least one FF byte, possibly more if the compressor used FFs
+ * to pad the file.
+ * There could also be non-FF garbage between markers.  The treatment of such
+ * garbage is unspecified; we choose to skip over it but emit a warning msg.
+ * NB: this routine must not be used after seeing SOS marker, since it will
+ * not deal correctly with FF/00 sequences in the compressed image data...
+ */
+
+static int
+next_marker (void)
+{
+  int c;
+  int discarded_bytes = 0;
+
+  /* Find 0xFF byte; count and skip any non-FFs. */
+  c = read_1_byte();
+  while (c != 0xFF) {
+    discarded_bytes++;
+    c = read_1_byte();
+  }
+  /* Get marker code byte, swallowing any duplicate FF bytes.  Extra FFs
+   * are legal as pad bytes, so don't count them in discarded_bytes.
+   */
+  do {
+    c = read_1_byte();
+  } while (c == 0xFF);
+
+  if (discarded_bytes != 0) {
+    fprintf(stderr, "Warning: garbage data found in JPEG file\n");
+  }
+
+  return c;
+}
+
+
+/*
+ * Read the initial marker, which should be SOI.
+ * For a JFIF file, the first two bytes of the file should be literally
+ * 0xFF M_SOI.  To be more general, we could use next_marker, but if the
+ * input file weren't actually JPEG at all, next_marker might read the whole
+ * file and then return a misleading error message...
+ */
+
+static int
+first_marker (void)
+{
+  int c1, c2;
+
+  c1 = NEXTBYTE();
+  c2 = NEXTBYTE();
+  if (c1 != 0xFF || c2 != M_SOI)
+    ERREXIT("Not a JPEG file");
+  return c2;
+}
+
+
+/*
+ * Most types of marker are followed by a variable-length parameter segment.
+ * This routine skips over the parameters for any marker we don't otherwise
+ * want to process.
+ * Note that we MUST skip the parameter segment explicitly in order not to
+ * be fooled by 0xFF bytes that might appear within the parameter segment;
+ * such bytes do NOT introduce new markers.
+ */
+
+static void
+skip_variable (void)
+/* Skip over an unknown or uninteresting variable-length marker */
+{
+  unsigned int length;
+
+  /* Get the marker parameter length count */
+  length = read_2_bytes();
+  /* Length includes itself, so must be at least 2 */
+  if (length < 2)
+    ERREXIT("Erroneous JPEG marker length");
+  length -= 2;
+  /* Skip over the remaining bytes */
+  while (length > 0) {
+    (void) read_1_byte();
+    length--;
+  }
+}
+
+
+/*
+ * Process a COM marker.
+ * We want to print out the marker contents as legible text;
+ * we must guard against non-text junk and varying newline representations.
+ */
+
+static void
+process_COM (void)
+{
+  unsigned int length;
+  int ch;
+  int lastch = 0;
+
+  /* Get the marker parameter length count */
+  length = read_2_bytes();
+  /* Length includes itself, so must be at least 2 */
+  if (length < 2)
+    ERREXIT("Erroneous JPEG marker length");
+  length -= 2;
+
+  while (length > 0) {
+    ch = read_1_byte();
+    /* Emit the character in a readable form.
+     * Nonprintables are converted to \nnn form,
+     * while \ is converted to \\.
+     * Newlines in CR, CR/LF, or LF form will be printed as one newline.
+     */
+    if (ch == '\r') {
+      printf("\n");
+    } else if (ch == '\n') {
+      if (lastch != '\r')
+	printf("\n");
+    } else if (ch == '\\') {
+      printf("\\\\");
+    } else if (isprint(ch)) {
+      putc(ch, stdout);
+    } else {
+      printf("\\%03o", ch);
+    }
+    lastch = ch;
+    length--;
+  }
+  printf("\n");
+}
+
+
+/*
+ * Process a SOFn marker.
+ * This code is only needed if you want to know the image dimensions...
+ */
+
+static void
+process_SOFn (int marker)
+{
+  unsigned int length;
+  unsigned int image_height, image_width;
+  int data_precision, num_components;
+  const char * process;
+  int ci;
+
+  length = read_2_bytes();	/* usual parameter length count */
+
+  data_precision = read_1_byte();
+  image_height = read_2_bytes();
+  image_width = read_2_bytes();
+  num_components = read_1_byte();
+
+  switch (marker) {
+  case M_SOF0:	process = "Baseline";  break;
+  case M_SOF1:	process = "Extended sequential";  break;
+  case M_SOF2:	process = "Progressive";  break;
+  case M_SOF3:	process = "Lossless";  break;
+  case M_SOF5:	process = "Differential sequential";  break;
+  case M_SOF6:	process = "Differential progressive";  break;
+  case M_SOF7:	process = "Differential lossless";  break;
+  case M_SOF9:	process = "Extended sequential, arithmetic coding";  break;
+  case M_SOF10:	process = "Progressive, arithmetic coding";  break;
+  case M_SOF11:	process = "Lossless, arithmetic coding";  break;
+  case M_SOF13:	process = "Differential sequential, arithmetic coding";  break;
+  case M_SOF14:	process = "Differential progressive, arithmetic coding"; break;
+  case M_SOF15:	process = "Differential lossless, arithmetic coding";  break;
+  default:	process = "Unknown";  break;
+  }
+
+  printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n",
+	 image_width, image_height, num_components, data_precision);
+  printf("JPEG process: %s\n", process);
+
+  if (length != (unsigned int) (8 + num_components * 3))
+    ERREXIT("Bogus SOF marker length");
+
+  for (ci = 0; ci < num_components; ci++) {
+    (void) read_1_byte();	/* Component ID code */
+    (void) read_1_byte();	/* H, V sampling factors */
+    (void) read_1_byte();	/* Quantization table number */
+  }
+}
+
+
+/*
+ * Parse the marker stream until SOS or EOI is seen;
+ * display any COM markers.
+ * While the companion program wrjpgcom will always insert COM markers before
+ * SOFn, other implementations might not, so we scan to SOS before stopping.
+ * If we were only interested in the image dimensions, we would stop at SOFn.
+ * (Conversely, if we only cared about COM markers, there would be no need
+ * for special code to handle SOFn; we could treat it like other markers.)
+ */
+
+static int
+scan_JPEG_header (int verbose)
+{
+  int marker;
+
+  /* Expect SOI at start of file */
+  if (first_marker() != M_SOI)
+    ERREXIT("Expected SOI marker first");
+
+  /* Scan miscellaneous markers until we reach SOS. */
+  for (;;) {
+    marker = next_marker();
+    switch (marker) {
+      /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,
+       * treated as SOFn.  C4 in particular is actually DHT.
+       */
+    case M_SOF0:		/* Baseline */
+    case M_SOF1:		/* Extended sequential, Huffman */
+    case M_SOF2:		/* Progressive, Huffman */
+    case M_SOF3:		/* Lossless, Huffman */
+    case M_SOF5:		/* Differential sequential, Huffman */
+    case M_SOF6:		/* Differential progressive, Huffman */
+    case M_SOF7:		/* Differential lossless, Huffman */
+    case M_SOF9:		/* Extended sequential, arithmetic */
+    case M_SOF10:		/* Progressive, arithmetic */
+    case M_SOF11:		/* Lossless, arithmetic */
+    case M_SOF13:		/* Differential sequential, arithmetic */
+    case M_SOF14:		/* Differential progressive, arithmetic */
+    case M_SOF15:		/* Differential lossless, arithmetic */
+      if (verbose)
+	process_SOFn(marker);
+      else
+	skip_variable();
+      break;
+
+    case M_SOS:			/* stop before hitting compressed data */
+      return marker;
+
+    case M_EOI:			/* in case it's a tables-only JPEG stream */
+      return marker;
+
+    case M_COM:
+      process_COM();
+      break;
+
+    case M_APP12:
+      /* Some digital camera makers put useful textual information into
+       * APP12 markers, so we print those out too when in -verbose mode.
+       */
+      if (verbose) {
+	printf("APP12 contains:\n");
+	process_COM();
+      } else
+	skip_variable();
+      break;
+
+    default:			/* Anything else just gets skipped */
+      skip_variable();		/* we assume it has a parameter count... */
+      break;
+    }
+  } /* end loop */
+}
+
+
+/* Command line parsing code */
+
+static const char * progname;	/* program name for error messages */
+
+
+static void
+usage (void)
+/* complain about bad command line */
+{
+  fprintf(stderr, "rdjpgcom displays any textual comments in a JPEG file.\n");
+
+  fprintf(stderr, "Usage: %s [switches] [inputfile]\n", progname);
+
+  fprintf(stderr, "Switches (names may be abbreviated):\n");
+  fprintf(stderr, "  -verbose    Also display dimensions of JPEG image\n");
+
+  exit(EXIT_FAILURE);
+}
+
+
+static int
+keymatch (char * arg, const char * keyword, int minchars)
+/* Case-insensitive matching of (possibly abbreviated) keyword switches. */
+/* keyword is the constant keyword (must be lower case already), */
+/* minchars is length of minimum legal abbreviation. */
+{
+  register int ca, ck;
+  register int nmatched = 0;
+
+  while ((ca = *arg++) != '\0') {
+    if ((ck = *keyword++) == '\0')
+      return 0;			/* arg longer than keyword, no good */
+    if (isupper(ca))		/* force arg to lcase (assume ck is already) */
+      ca = tolower(ca);
+    if (ca != ck)
+      return 0;			/* no good */
+    nmatched++;			/* count matched characters */
+  }
+  /* reached end of argument; fail if it's too short for unique abbrev */
+  if (nmatched < minchars)
+    return 0;
+  return 1;			/* A-OK */
+}
+
+
+/*
+ * The main program.
+ */
+
+int
+main (int argc, char **argv)
+{
+  int argn;
+  char * arg;
+  int verbose = 0;
+
+  /* On Mac, fetch a command line. */
+#ifdef USE_CCOMMAND
+  argc = ccommand(&argv);
+#endif
+
+  progname = argv[0];
+  if (progname == NULL || progname[0] == 0)
+    progname = "rdjpgcom";	/* in case C library doesn't provide it */
+
+  /* Parse switches, if any */
+  for (argn = 1; argn < argc; argn++) {
+    arg = argv[argn];
+    if (arg[0] != '-')
+      break;			/* not switch, must be file name */
+    arg++;			/* advance over '-' */
+    if (keymatch(arg, "verbose", 1)) {
+      verbose++;
+    } else
+      usage();
+  }
+
+  /* Open the input file. */
+  /* Unix style: expect zero or one file name */
+  if (argn < argc-1) {
+    fprintf(stderr, "%s: only one input file\n", progname);
+    usage();
+  }
+  if (argn < argc) {
+    if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {
+      fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
+      exit(EXIT_FAILURE);
+    }
+  } else {
+    /* default input file is stdin */
+#ifdef USE_SETMODE		/* need to hack file mode? */
+    setmode(fileno(stdin), O_BINARY);
+#endif
+#ifdef USE_FDOPEN		/* need to re-open in binary mode? */
+    if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) {
+      fprintf(stderr, "%s: can't open stdin\n", progname);
+      exit(EXIT_FAILURE);
+    }
+#else
+    infile = stdin;
+#endif
+  }
+
+  /* Scan the JPEG headers. */
+  (void) scan_JPEG_header(verbose);
+
+  /* All done. */
+  exit(EXIT_SUCCESS);
+  return 0;			/* suppress no-return-value warnings */
+}
diff --git a/src/libjpeg/rdppm.c b/src/libjpeg/rdppm.c
new file mode 100644
index 0000000..bec0bc0
--- /dev/null
+++ b/src/libjpeg/rdppm.c
@@ -0,0 +1,458 @@
+/*
+ * rdppm.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to read input images in PPM/PGM format.
+ * The extended 2-byte-per-sample raw PPM/PGM formats are supported.
+ * The PBMPLUS library is NOT required to compile this software
+ * (but it is highly useful as a set of PPM image manipulation programs).
+ *
+ * These routines may need modification for non-Unix environments or
+ * specialized applications.  As they stand, they assume input from
+ * an ordinary stdio stream.  They further assume that reading begins
+ * at the start of the file; start_input may need work if the
+ * user interface has already read some data (e.g., to determine that
+ * the file is indeed PPM format).
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef PPM_SUPPORTED
+
+
+/* Portions of this code are based on the PBMPLUS library, which is:
+**
+** Copyright (C) 1988 by Jef Poskanzer.
+**
+** Permission to use, copy, modify, and distribute this software and its
+** documentation for any purpose and without fee is hereby granted, provided
+** that the above copyright notice appear in all copies and that both that
+** copyright notice and this permission notice appear in supporting
+** documentation.  This software is provided "as is" without express or
+** implied warranty.
+*/
+
+
+/* Macros to deal with unsigned chars as efficiently as compiler allows */
+
+#ifdef HAVE_UNSIGNED_CHAR
+typedef unsigned char U_CHAR;
+#define UCH(x)	((int) (x))
+#else /* !HAVE_UNSIGNED_CHAR */
+#ifdef CHAR_IS_UNSIGNED
+typedef char U_CHAR;
+#define UCH(x)	((int) (x))
+#else
+typedef char U_CHAR;
+#define UCH(x)	((int) (x) & 0xFF)
+#endif
+#endif /* HAVE_UNSIGNED_CHAR */
+
+
+#define	ReadOK(file,buffer,len)	(JFREAD(file,buffer,len) == ((size_t) (len)))
+
+
+/*
+ * On most systems, reading individual bytes with getc() is drastically less
+ * efficient than buffering a row at a time with fread().  On PCs, we must
+ * allocate the buffer in near data space, because we are assuming small-data
+ * memory model, wherein fread() can't reach far memory.  If you need to
+ * process very wide images on a PC, you might have to compile in large-memory
+ * model, or else replace fread() with a getc() loop --- which will be much
+ * slower.
+ */
+
+
+/* Private version of data source object */
+
+typedef struct {
+  struct cjpeg_source_struct pub; /* public fields */
+
+  U_CHAR *iobuffer;		/* non-FAR pointer to I/O buffer */
+  JSAMPROW pixrow;		/* FAR pointer to same */
+  size_t buffer_width;		/* width of I/O buffer */
+  JSAMPLE *rescale;		/* => maxval-remapping array, or NULL */
+} ppm_source_struct;
+
+typedef ppm_source_struct * ppm_source_ptr;
+
+
+LOCAL(int)
+pbm_getc (FILE * infile)
+/* Read next char, skipping over any comments */
+/* A comment/newline sequence is returned as a newline */
+{
+  register int ch;
+
+  ch = getc(infile);
+  if (ch == '#') {
+    do {
+      ch = getc(infile);
+    } while (ch != '\n' && ch != EOF);
+  }
+  return ch;
+}
+
+
+LOCAL(unsigned int)
+read_pbm_integer (j_compress_ptr cinfo, FILE * infile)
+/* Read an unsigned decimal integer from the PPM file */
+/* Swallows one trailing character after the integer */
+/* Note that on a 16-bit-int machine, only values up to 64k can be read. */
+/* This should not be a problem in practice. */
+{
+  register int ch;
+  register unsigned int val;
+
+  /* Skip any leading whitespace */
+  do {
+    ch = pbm_getc(infile);
+    if (ch == EOF)
+      ERREXIT(cinfo, JERR_INPUT_EOF);
+  } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r');
+
+  if (ch < '0' || ch > '9')
+    ERREXIT(cinfo, JERR_PPM_NONNUMERIC);
+
+  val = ch - '0';
+  while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {
+    val *= 10;
+    val += ch - '0';
+  }
+  return val;
+}
+
+
+/*
+ * Read one row of pixels.
+ *
+ * We provide several different versions depending on input file format.
+ * In all cases, input is scaled to the size of JSAMPLE.
+ *
+ * A really fast path is provided for reading byte/sample raw files with
+ * maxval = MAXJSAMPLE, which is the normal case for 8-bit data.
+ */
+
+
+METHODDEF(JDIMENSION)
+get_text_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading text-format PGM files with any maxval */
+{
+  ppm_source_ptr source = (ppm_source_ptr) sinfo;
+  FILE * infile = source->pub.input_file;
+  register JSAMPROW ptr;
+  register JSAMPLE *rescale = source->rescale;
+  JDIMENSION col;
+
+  ptr = source->pub.buffer[0];
+  for (col = cinfo->image_width; col > 0; col--) {
+    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];
+  }
+  return 1;
+}
+
+
+METHODDEF(JDIMENSION)
+get_text_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading text-format PPM files with any maxval */
+{
+  ppm_source_ptr source = (ppm_source_ptr) sinfo;
+  FILE * infile = source->pub.input_file;
+  register JSAMPROW ptr;
+  register JSAMPLE *rescale = source->rescale;
+  JDIMENSION col;
+
+  ptr = source->pub.buffer[0];
+  for (col = cinfo->image_width; col > 0; col--) {
+    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];
+    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];
+    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];
+  }
+  return 1;
+}
+
+
+METHODDEF(JDIMENSION)
+get_scaled_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading raw-byte-format PGM files with any maxval */
+{
+  ppm_source_ptr source = (ppm_source_ptr) sinfo;
+  register JSAMPROW ptr;
+  register U_CHAR * bufferptr;
+  register JSAMPLE *rescale = source->rescale;
+  JDIMENSION col;
+
+  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
+    ERREXIT(cinfo, JERR_INPUT_EOF);
+  ptr = source->pub.buffer[0];
+  bufferptr = source->iobuffer;
+  for (col = cinfo->image_width; col > 0; col--) {
+    *ptr++ = rescale[UCH(*bufferptr++)];
+  }
+  return 1;
+}
+
+
+METHODDEF(JDIMENSION)
+get_scaled_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading raw-byte-format PPM files with any maxval */
+{
+  ppm_source_ptr source = (ppm_source_ptr) sinfo;
+  register JSAMPROW ptr;
+  register U_CHAR * bufferptr;
+  register JSAMPLE *rescale = source->rescale;
+  JDIMENSION col;
+
+  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
+    ERREXIT(cinfo, JERR_INPUT_EOF);
+  ptr = source->pub.buffer[0];
+  bufferptr = source->iobuffer;
+  for (col = cinfo->image_width; col > 0; col--) {
+    *ptr++ = rescale[UCH(*bufferptr++)];
+    *ptr++ = rescale[UCH(*bufferptr++)];
+    *ptr++ = rescale[UCH(*bufferptr++)];
+  }
+  return 1;
+}
+
+
+METHODDEF(JDIMENSION)
+get_raw_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading raw-byte-format files with maxval = MAXJSAMPLE.
+ * In this case we just read right into the JSAMPLE buffer!
+ * Note that same code works for PPM and PGM files.
+ */
+{
+  ppm_source_ptr source = (ppm_source_ptr) sinfo;
+
+  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
+    ERREXIT(cinfo, JERR_INPUT_EOF);
+  return 1;
+}
+
+
+METHODDEF(JDIMENSION)
+get_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading raw-word-format PGM files with any maxval */
+{
+  ppm_source_ptr source = (ppm_source_ptr) sinfo;
+  register JSAMPROW ptr;
+  register U_CHAR * bufferptr;
+  register JSAMPLE *rescale = source->rescale;
+  JDIMENSION col;
+
+  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
+    ERREXIT(cinfo, JERR_INPUT_EOF);
+  ptr = source->pub.buffer[0];
+  bufferptr = source->iobuffer;
+  for (col = cinfo->image_width; col > 0; col--) {
+    register int temp;
+    temp  = UCH(*bufferptr++);
+    temp |= UCH(*bufferptr++) << 8;
+    *ptr++ = rescale[temp];
+  }
+  return 1;
+}
+
+
+METHODDEF(JDIMENSION)
+get_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading raw-word-format PPM files with any maxval */
+{
+  ppm_source_ptr source = (ppm_source_ptr) sinfo;
+  register JSAMPROW ptr;
+  register U_CHAR * bufferptr;
+  register JSAMPLE *rescale = source->rescale;
+  JDIMENSION col;
+
+  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
+    ERREXIT(cinfo, JERR_INPUT_EOF);
+  ptr = source->pub.buffer[0];
+  bufferptr = source->iobuffer;
+  for (col = cinfo->image_width; col > 0; col--) {
+    register int temp;
+    temp  = UCH(*bufferptr++);
+    temp |= UCH(*bufferptr++) << 8;
+    *ptr++ = rescale[temp];
+    temp  = UCH(*bufferptr++);
+    temp |= UCH(*bufferptr++) << 8;
+    *ptr++ = rescale[temp];
+    temp  = UCH(*bufferptr++);
+    temp |= UCH(*bufferptr++) << 8;
+    *ptr++ = rescale[temp];
+  }
+  return 1;
+}
+
+
+/*
+ * Read the file header; return image size and component count.
+ */
+
+METHODDEF(void)
+start_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  ppm_source_ptr source = (ppm_source_ptr) sinfo;
+  int c;
+  unsigned int w, h, maxval;
+  boolean need_iobuffer, use_raw_buffer, need_rescale;
+
+  if (getc(source->pub.input_file) != 'P')
+    ERREXIT(cinfo, JERR_PPM_NOT);
+
+  c = getc(source->pub.input_file); /* subformat discriminator character */
+
+  /* detect unsupported variants (ie, PBM) before trying to read header */
+  switch (c) {
+  case '2':			/* it's a text-format PGM file */
+  case '3':			/* it's a text-format PPM file */
+  case '5':			/* it's a raw-format PGM file */
+  case '6':			/* it's a raw-format PPM file */
+    break;
+  default:
+    ERREXIT(cinfo, JERR_PPM_NOT);
+    break;
+  }
+
+  /* fetch the remaining header info */
+  w = read_pbm_integer(cinfo, source->pub.input_file);
+  h = read_pbm_integer(cinfo, source->pub.input_file);
+  maxval = read_pbm_integer(cinfo, source->pub.input_file);
+
+  if (w <= 0 || h <= 0 || maxval <= 0) /* error check */
+    ERREXIT(cinfo, JERR_PPM_NOT);
+
+  cinfo->data_precision = BITS_IN_JSAMPLE; /* we always rescale data to this */
+  cinfo->image_width = (JDIMENSION) w;
+  cinfo->image_height = (JDIMENSION) h;
+
+  /* initialize flags to most common settings */
+  need_iobuffer = TRUE;		/* do we need an I/O buffer? */
+  use_raw_buffer = FALSE;	/* do we map input buffer onto I/O buffer? */
+  need_rescale = TRUE;		/* do we need a rescale array? */
+
+  switch (c) {
+  case '2':			/* it's a text-format PGM file */
+    cinfo->input_components = 1;
+    cinfo->in_color_space = JCS_GRAYSCALE;
+    TRACEMS2(cinfo, 1, JTRC_PGM_TEXT, w, h);
+    source->pub.get_pixel_rows = get_text_gray_row;
+    need_iobuffer = FALSE;
+    break;
+
+  case '3':			/* it's a text-format PPM file */
+    cinfo->input_components = 3;
+    cinfo->in_color_space = JCS_RGB;
+    TRACEMS2(cinfo, 1, JTRC_PPM_TEXT, w, h);
+    source->pub.get_pixel_rows = get_text_rgb_row;
+    need_iobuffer = FALSE;
+    break;
+
+  case '5':			/* it's a raw-format PGM file */
+    cinfo->input_components = 1;
+    cinfo->in_color_space = JCS_GRAYSCALE;
+    TRACEMS2(cinfo, 1, JTRC_PGM, w, h);
+    if (maxval > 255) {
+      source->pub.get_pixel_rows = get_word_gray_row;
+    } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) {
+      source->pub.get_pixel_rows = get_raw_row;
+      use_raw_buffer = TRUE;
+      need_rescale = FALSE;
+    } else {
+      source->pub.get_pixel_rows = get_scaled_gray_row;
+    }
+    break;
+
+  case '6':			/* it's a raw-format PPM file */
+    cinfo->input_components = 3;
+    cinfo->in_color_space = JCS_RGB;
+    TRACEMS2(cinfo, 1, JTRC_PPM, w, h);
+    if (maxval > 255) {
+      source->pub.get_pixel_rows = get_word_rgb_row;
+    } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) {
+      source->pub.get_pixel_rows = get_raw_row;
+      use_raw_buffer = TRUE;
+      need_rescale = FALSE;
+    } else {
+      source->pub.get_pixel_rows = get_scaled_rgb_row;
+    }
+    break;
+  }
+
+  /* Allocate space for I/O buffer: 1 or 3 bytes or words/pixel. */
+  if (need_iobuffer) {
+    source->buffer_width = (size_t) w * cinfo->input_components *
+      ((maxval<=255) ? SIZEOF(U_CHAR) : (2*SIZEOF(U_CHAR)));
+    source->iobuffer = (U_CHAR *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  source->buffer_width);
+  }
+
+  /* Create compressor input buffer. */
+  if (use_raw_buffer) {
+    /* For unscaled raw-input case, we can just map it onto the I/O buffer. */
+    /* Synthesize a JSAMPARRAY pointer structure */
+    /* Cast here implies near->far pointer conversion on PCs */
+    source->pixrow = (JSAMPROW) source->iobuffer;
+    source->pub.buffer = & source->pixrow;
+    source->pub.buffer_height = 1;
+  } else {
+    /* Need to translate anyway, so make a separate sample buffer. */
+    source->pub.buffer = (*cinfo->mem->alloc_sarray)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE,
+       (JDIMENSION) w * cinfo->input_components, (JDIMENSION) 1);
+    source->pub.buffer_height = 1;
+  }
+
+  /* Compute the rescaling array if required. */
+  if (need_rescale) {
+    INT32 val, half_maxval;
+
+    /* On 16-bit-int machines we have to be careful of maxval = 65535 */
+    source->rescale = (JSAMPLE *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  (size_t) (((long) maxval + 1L) * SIZEOF(JSAMPLE)));
+    half_maxval = maxval / 2;
+    for (val = 0; val <= (INT32) maxval; val++) {
+      /* The multiplication here must be done in 32 bits to avoid overflow */
+      source->rescale[val] = (JSAMPLE) ((val*MAXJSAMPLE + half_maxval)/maxval);
+    }
+  }
+}
+
+
+/*
+ * Finish up at the end of the file.
+ */
+
+METHODDEF(void)
+finish_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  /* no work */
+}
+
+
+/*
+ * The module selection routine for PPM format input.
+ */
+
+GLOBAL(cjpeg_source_ptr)
+jinit_read_ppm (j_compress_ptr cinfo)
+{
+  ppm_source_ptr source;
+
+  /* Create module interface object */
+  source = (ppm_source_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(ppm_source_struct));
+  /* Fill in method ptrs, except get_pixel_rows which start_input sets */
+  source->pub.start_input = start_input_ppm;
+  source->pub.finish_input = finish_input_ppm;
+
+  return (cjpeg_source_ptr) source;
+}
+
+#endif /* PPM_SUPPORTED */
diff --git a/src/libjpeg/rdrle.c b/src/libjpeg/rdrle.c
new file mode 100644
index 0000000..df871e0
--- /dev/null
+++ b/src/libjpeg/rdrle.c
@@ -0,0 +1,387 @@
+/*
+ * rdrle.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to read input images in Utah RLE format.
+ * The Utah Raster Toolkit library is required (version 3.1 or later).
+ *
+ * These routines may need modification for non-Unix environments or
+ * specialized applications.  As they stand, they assume input from
+ * an ordinary stdio stream.  They further assume that reading begins
+ * at the start of the file; start_input may need work if the
+ * user interface has already read some data (e.g., to determine that
+ * the file is indeed RLE format).
+ *
+ * Based on code contributed by Mike Lijewski,
+ * with updates from Robert Hutchinson.
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef RLE_SUPPORTED
+
+/* rle.h is provided by the Utah Raster Toolkit. */
+
+#include <rle.h>
+
+/*
+ * We assume that JSAMPLE has the same representation as rle_pixel,
+ * to wit, "unsigned char".  Hence we can't cope with 12- or 16-bit samples.
+ */
+
+#if BITS_IN_JSAMPLE != 8
+  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */
+#endif
+
+/*
+ * We support the following types of RLE files:
+ *   
+ *   GRAYSCALE   - 8 bits, no colormap
+ *   MAPPEDGRAY  - 8 bits, 1 channel colomap
+ *   PSEUDOCOLOR - 8 bits, 3 channel colormap
+ *   TRUECOLOR   - 24 bits, 3 channel colormap
+ *   DIRECTCOLOR - 24 bits, no colormap
+ *
+ * For now, we ignore any alpha channel in the image.
+ */
+
+typedef enum
+  { GRAYSCALE, MAPPEDGRAY, PSEUDOCOLOR, TRUECOLOR, DIRECTCOLOR } rle_kind;
+
+
+/*
+ * Since RLE stores scanlines bottom-to-top, we have to invert the image
+ * to conform to JPEG's top-to-bottom order.  To do this, we read the
+ * incoming image into a virtual array on the first get_pixel_rows call,
+ * then fetch the required row from the virtual array on subsequent calls.
+ */
+
+typedef struct _rle_source_struct * rle_source_ptr;
+
+typedef struct _rle_source_struct {
+  struct cjpeg_source_struct pub; /* public fields */
+
+  rle_kind visual;              /* actual type of input file */
+  jvirt_sarray_ptr image;       /* virtual array to hold the image */
+  JDIMENSION row;		/* current row # in the virtual array */
+  rle_hdr header;               /* Input file information */
+  rle_pixel** rle_row;          /* holds a row returned by rle_getrow() */
+
+} rle_source_struct;
+
+
+/*
+ * Read the file header; return image size and component count.
+ */
+
+METHODDEF(void)
+start_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  rle_source_ptr source = (rle_source_ptr) sinfo;
+  JDIMENSION width, height;
+#ifdef PROGRESS_REPORT
+  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
+#endif
+
+  /* Use RLE library routine to get the header info */
+  source->header = *rle_hdr_init(NULL);
+  source->header.rle_file = source->pub.input_file;
+  switch (rle_get_setup(&(source->header))) {
+  case RLE_SUCCESS:
+    /* A-OK */
+    break;
+  case RLE_NOT_RLE:
+    ERREXIT(cinfo, JERR_RLE_NOT);
+    break;
+  case RLE_NO_SPACE:
+    ERREXIT(cinfo, JERR_RLE_MEM);
+    break;
+  case RLE_EMPTY:
+    ERREXIT(cinfo, JERR_RLE_EMPTY);
+    break;
+  case RLE_EOF:
+    ERREXIT(cinfo, JERR_RLE_EOF);
+    break;
+  default:
+    ERREXIT(cinfo, JERR_RLE_BADERROR);
+    break;
+  }
+
+  /* Figure out what we have, set private vars and return values accordingly */
+  
+  width  = source->header.xmax - source->header.xmin + 1;
+  height = source->header.ymax - source->header.ymin + 1;
+  source->header.xmin = 0;		/* realign horizontally */
+  source->header.xmax = width-1;
+
+  cinfo->image_width      = width;
+  cinfo->image_height     = height;
+  cinfo->data_precision   = 8;  /* we can only handle 8 bit data */
+
+  if (source->header.ncolors == 1 && source->header.ncmap == 0) {
+    source->visual     = GRAYSCALE;
+    TRACEMS2(cinfo, 1, JTRC_RLE_GRAY, width, height);
+  } else if (source->header.ncolors == 1 && source->header.ncmap == 1) {
+    source->visual     = MAPPEDGRAY;
+    TRACEMS3(cinfo, 1, JTRC_RLE_MAPGRAY, width, height,
+             1 << source->header.cmaplen);
+  } else if (source->header.ncolors == 1 && source->header.ncmap == 3) {
+    source->visual     = PSEUDOCOLOR;
+    TRACEMS3(cinfo, 1, JTRC_RLE_MAPPED, width, height,
+	     1 << source->header.cmaplen);
+  } else if (source->header.ncolors == 3 && source->header.ncmap == 3) {
+    source->visual     = TRUECOLOR;
+    TRACEMS3(cinfo, 1, JTRC_RLE_FULLMAP, width, height,
+	     1 << source->header.cmaplen);
+  } else if (source->header.ncolors == 3 && source->header.ncmap == 0) {
+    source->visual     = DIRECTCOLOR;
+    TRACEMS2(cinfo, 1, JTRC_RLE, width, height);
+  } else
+    ERREXIT(cinfo, JERR_RLE_UNSUPPORTED);
+  
+  if (source->visual == GRAYSCALE || source->visual == MAPPEDGRAY) {
+    cinfo->in_color_space   = JCS_GRAYSCALE;
+    cinfo->input_components = 1;
+  } else {
+    cinfo->in_color_space   = JCS_RGB;
+    cinfo->input_components = 3;
+  }
+
+  /*
+   * A place to hold each scanline while it's converted.
+   * (GRAYSCALE scanlines don't need converting)
+   */
+  if (source->visual != GRAYSCALE) {
+    source->rle_row = (rle_pixel**) (*cinfo->mem->alloc_sarray)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE,
+       (JDIMENSION) width, (JDIMENSION) cinfo->input_components);
+  }
+
+  /* request a virtual array to hold the image */
+  source->image = (*cinfo->mem->request_virt_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+     (JDIMENSION) (width * source->header.ncolors),
+     (JDIMENSION) height, (JDIMENSION) 1);
+
+#ifdef PROGRESS_REPORT
+  if (progress != NULL) {
+    /* count file input as separate pass */
+    progress->total_extra_passes++;
+  }
+#endif
+
+  source->pub.buffer_height = 1;
+}
+
+
+/*
+ * Read one row of pixels.
+ * Called only after load_image has read the image into the virtual array.
+ * Used for GRAYSCALE, MAPPEDGRAY, TRUECOLOR, and DIRECTCOLOR images.
+ */
+
+METHODDEF(JDIMENSION)
+get_rle_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  rle_source_ptr source = (rle_source_ptr) sinfo;
+
+  source->row--;
+  source->pub.buffer = (*cinfo->mem->access_virt_sarray)
+    ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);
+
+  return 1;
+}
+
+/*
+ * Read one row of pixels.
+ * Called only after load_image has read the image into the virtual array.
+ * Used for PSEUDOCOLOR images.
+ */
+
+METHODDEF(JDIMENSION)
+get_pseudocolor_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  rle_source_ptr source = (rle_source_ptr) sinfo;
+  JSAMPROW src_row, dest_row;
+  JDIMENSION col;
+  rle_map *colormap;
+  int val;
+
+  colormap = source->header.cmap;
+  dest_row = source->pub.buffer[0];
+  source->row--;
+  src_row = * (*cinfo->mem->access_virt_sarray)
+    ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);
+
+  for (col = cinfo->image_width; col > 0; col--) {
+    val = GETJSAMPLE(*src_row++);
+    *dest_row++ = (JSAMPLE) (colormap[val      ] >> 8);
+    *dest_row++ = (JSAMPLE) (colormap[val + 256] >> 8);
+    *dest_row++ = (JSAMPLE) (colormap[val + 512] >> 8);
+  }
+
+  return 1;
+}
+
+
+/*
+ * Load the image into a virtual array.  We have to do this because RLE
+ * files start at the lower left while the JPEG standard has them starting
+ * in the upper left.  This is called the first time we want to get a row
+ * of input.  What we do is load the RLE data into the array and then call
+ * the appropriate routine to read one row from the array.  Before returning,
+ * we set source->pub.get_pixel_rows so that subsequent calls go straight to
+ * the appropriate row-reading routine.
+ */
+
+METHODDEF(JDIMENSION)
+load_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  rle_source_ptr source = (rle_source_ptr) sinfo;
+  JDIMENSION row, col;
+  JSAMPROW  scanline, red_ptr, green_ptr, blue_ptr;
+  rle_pixel **rle_row;
+  rle_map *colormap;
+  char channel;
+#ifdef PROGRESS_REPORT
+  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
+#endif
+
+  colormap = source->header.cmap;
+  rle_row = source->rle_row;
+
+  /* Read the RLE data into our virtual array.
+   * We assume here that (a) rle_pixel is represented the same as JSAMPLE,
+   * and (b) we are not on a machine where FAR pointers differ from regular.
+   */
+  RLE_CLR_BIT(source->header, RLE_ALPHA); /* don't read the alpha channel */
+
+#ifdef PROGRESS_REPORT
+  if (progress != NULL) {
+    progress->pub.pass_limit = cinfo->image_height;
+    progress->pub.pass_counter = 0;
+    (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
+  }
+#endif
+
+  switch (source->visual) {
+
+  case GRAYSCALE:
+  case PSEUDOCOLOR:
+    for (row = 0; row < cinfo->image_height; row++) {
+      rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)
+         ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);
+      rle_getrow(&source->header, rle_row);
+#ifdef PROGRESS_REPORT
+      if (progress != NULL) {
+        progress->pub.pass_counter++;
+        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
+      }
+#endif
+    }
+    break;
+
+  case MAPPEDGRAY:
+  case TRUECOLOR:
+    for (row = 0; row < cinfo->image_height; row++) {
+      scanline = * (*cinfo->mem->access_virt_sarray)
+        ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);
+      rle_row = source->rle_row;
+      rle_getrow(&source->header, rle_row);
+
+      for (col = 0; col < cinfo->image_width; col++) {
+        for (channel = 0; channel < source->header.ncolors; channel++) {
+          *scanline++ = (JSAMPLE)
+            (colormap[GETJSAMPLE(rle_row[channel][col]) + 256 * channel] >> 8);
+        }
+      }
+
+#ifdef PROGRESS_REPORT
+      if (progress != NULL) {
+        progress->pub.pass_counter++;
+        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
+      }
+#endif
+    }
+    break;
+
+  case DIRECTCOLOR:
+    for (row = 0; row < cinfo->image_height; row++) {
+      scanline = * (*cinfo->mem->access_virt_sarray)
+        ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);
+      rle_getrow(&source->header, rle_row);
+
+      red_ptr   = rle_row[0];
+      green_ptr = rle_row[1];
+      blue_ptr  = rle_row[2];
+
+      for (col = cinfo->image_width; col > 0; col--) {
+        *scanline++ = *red_ptr++;
+        *scanline++ = *green_ptr++;
+        *scanline++ = *blue_ptr++;
+      }
+
+#ifdef PROGRESS_REPORT
+      if (progress != NULL) {
+        progress->pub.pass_counter++;
+        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
+      }
+#endif
+    }
+  }
+
+#ifdef PROGRESS_REPORT
+  if (progress != NULL)
+    progress->completed_extra_passes++;
+#endif
+
+  /* Set up to call proper row-extraction routine in future */
+  if (source->visual == PSEUDOCOLOR) {
+    source->pub.buffer = source->rle_row;
+    source->pub.get_pixel_rows = get_pseudocolor_row;
+  } else {
+    source->pub.get_pixel_rows = get_rle_row;
+  }
+  source->row = cinfo->image_height;
+
+  /* And fetch the topmost (bottommost) row */
+  return (*source->pub.get_pixel_rows) (cinfo, sinfo);   
+}
+
+
+/*
+ * Finish up at the end of the file.
+ */
+
+METHODDEF(void)
+finish_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  /* no work */
+}
+
+
+/*
+ * The module selection routine for RLE format input.
+ */
+
+GLOBAL(cjpeg_source_ptr)
+jinit_read_rle (j_compress_ptr cinfo)
+{
+  rle_source_ptr source;
+
+  /* Create module interface object */
+  source = (rle_source_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+                                  SIZEOF(rle_source_struct));
+  /* Fill in method ptrs */
+  source->pub.start_input = start_input_rle;
+  source->pub.finish_input = finish_input_rle;
+  source->pub.get_pixel_rows = load_image;
+
+  return (cjpeg_source_ptr) source;
+}
+
+#endif /* RLE_SUPPORTED */
diff --git a/src/libjpeg/rdswitch.c b/src/libjpeg/rdswitch.c
new file mode 100644
index 0000000..b915ad9
--- /dev/null
+++ b/src/libjpeg/rdswitch.c
@@ -0,0 +1,332 @@
+/*
+ * rdswitch.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to process some of cjpeg's more complicated
+ * command-line switches.  Switches processed here are:
+ *	-qtables file		Read quantization tables from text file
+ *	-scans file		Read scan script from text file
+ *	-qslots N[,N,...]	Set component quantization table selectors
+ *	-sample HxV[,HxV,...]	Set component sampling factors
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+#include <ctype.h>		/* to declare isdigit(), isspace() */
+
+
+LOCAL(int)
+text_getc (FILE * file)
+/* Read next char, skipping over any comments (# to end of line) */
+/* A comment/newline sequence is returned as a newline */
+{
+  register int ch;
+  
+  ch = getc(file);
+  if (ch == '#') {
+    do {
+      ch = getc(file);
+    } while (ch != '\n' && ch != EOF);
+  }
+  return ch;
+}
+
+
+LOCAL(boolean)
+read_text_integer (FILE * file, long * result, int * termchar)
+/* Read an unsigned decimal integer from a file, store it in result */
+/* Reads one trailing character after the integer; returns it in termchar */
+{
+  register int ch;
+  register long val;
+  
+  /* Skip any leading whitespace, detect EOF */
+  do {
+    ch = text_getc(file);
+    if (ch == EOF) {
+      *termchar = ch;
+      return FALSE;
+    }
+  } while (isspace(ch));
+  
+  if (! isdigit(ch)) {
+    *termchar = ch;
+    return FALSE;
+  }
+
+  val = ch - '0';
+  while ((ch = text_getc(file)) != EOF) {
+    if (! isdigit(ch))
+      break;
+    val *= 10;
+    val += ch - '0';
+  }
+  *result = val;
+  *termchar = ch;
+  return TRUE;
+}
+
+
+GLOBAL(boolean)
+read_quant_tables (j_compress_ptr cinfo, char * filename,
+		   int scale_factor, boolean force_baseline)
+/* Read a set of quantization tables from the specified file.
+ * The file is plain ASCII text: decimal numbers with whitespace between.
+ * Comments preceded by '#' may be included in the file.
+ * There may be one to NUM_QUANT_TBLS tables in the file, each of 64 values.
+ * The tables are implicitly numbered 0,1,etc.
+ * NOTE: does not affect the qslots mapping, which will default to selecting
+ * table 0 for luminance (or primary) components, 1 for chrominance components.
+ * You must use -qslots if you want a different component->table mapping.
+ */
+{
+  FILE * fp;
+  int tblno, i, termchar;
+  long val;
+  unsigned int table[DCTSIZE2];
+
+  if ((fp = fopen(filename, "r")) == NULL) {
+    fprintf(stderr, "Can't open table file %s\n", filename);
+    return FALSE;
+  }
+  tblno = 0;
+
+  while (read_text_integer(fp, &val, &termchar)) { /* read 1st element of table */
+    if (tblno >= NUM_QUANT_TBLS) {
+      fprintf(stderr, "Too many tables in file %s\n", filename);
+      fclose(fp);
+      return FALSE;
+    }
+    table[0] = (unsigned int) val;
+    for (i = 1; i < DCTSIZE2; i++) {
+      if (! read_text_integer(fp, &val, &termchar)) {
+	fprintf(stderr, "Invalid table data in file %s\n", filename);
+	fclose(fp);
+	return FALSE;
+      }
+      table[i] = (unsigned int) val;
+    }
+    jpeg_add_quant_table(cinfo, tblno, table, scale_factor, force_baseline);
+    tblno++;
+  }
+
+  if (termchar != EOF) {
+    fprintf(stderr, "Non-numeric data in file %s\n", filename);
+    fclose(fp);
+    return FALSE;
+  }
+
+  fclose(fp);
+  return TRUE;
+}
+
+
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+
+LOCAL(boolean)
+read_scan_integer (FILE * file, long * result, int * termchar)
+/* Variant of read_text_integer that always looks for a non-space termchar;
+ * this simplifies parsing of punctuation in scan scripts.
+ */
+{
+  register int ch;
+
+  if (! read_text_integer(file, result, termchar))
+    return FALSE;
+  ch = *termchar;
+  while (ch != EOF && isspace(ch))
+    ch = text_getc(file);
+  if (isdigit(ch)) {		/* oops, put it back */
+    if (ungetc(ch, file) == EOF)
+      return FALSE;
+    ch = ' ';
+  } else {
+    /* Any separators other than ';' and ':' are ignored;
+     * this allows user to insert commas, etc, if desired.
+     */
+    if (ch != EOF && ch != ';' && ch != ':')
+      ch = ' ';
+  }
+  *termchar = ch;
+  return TRUE;
+}
+
+
+GLOBAL(boolean)
+read_scan_script (j_compress_ptr cinfo, char * filename)
+/* Read a scan script from the specified text file.
+ * Each entry in the file defines one scan to be emitted.
+ * Entries are separated by semicolons ';'.
+ * An entry contains one to four component indexes,
+ * optionally followed by a colon ':' and four progressive-JPEG parameters.
+ * The component indexes denote which component(s) are to be transmitted
+ * in the current scan.  The first component has index 0.
+ * Sequential JPEG is used if the progressive-JPEG parameters are omitted.
+ * The file is free format text: any whitespace may appear between numbers
+ * and the ':' and ';' punctuation marks.  Also, other punctuation (such
+ * as commas or dashes) can be placed between numbers if desired.
+ * Comments preceded by '#' may be included in the file.
+ * Note: we do very little validity checking here;
+ * jcmaster.c will validate the script parameters.
+ */
+{
+  FILE * fp;
+  int scanno, ncomps, termchar;
+  long val;
+  jpeg_scan_info * scanptr;
+#define MAX_SCANS  100		/* quite arbitrary limit */
+  jpeg_scan_info scans[MAX_SCANS];
+
+  if ((fp = fopen(filename, "r")) == NULL) {
+    fprintf(stderr, "Can't open scan definition file %s\n", filename);
+    return FALSE;
+  }
+  scanptr = scans;
+  scanno = 0;
+
+  while (read_scan_integer(fp, &val, &termchar)) {
+    if (scanno >= MAX_SCANS) {
+      fprintf(stderr, "Too many scans defined in file %s\n", filename);
+      fclose(fp);
+      return FALSE;
+    }
+    scanptr->component_index[0] = (int) val;
+    ncomps = 1;
+    while (termchar == ' ') {
+      if (ncomps >= MAX_COMPS_IN_SCAN) {
+	fprintf(stderr, "Too many components in one scan in file %s\n",
+		filename);
+	fclose(fp);
+	return FALSE;
+      }
+      if (! read_scan_integer(fp, &val, &termchar))
+	goto bogus;
+      scanptr->component_index[ncomps] = (int) val;
+      ncomps++;
+    }
+    scanptr->comps_in_scan = ncomps;
+    if (termchar == ':') {
+      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
+	goto bogus;
+      scanptr->Ss = (int) val;
+      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
+	goto bogus;
+      scanptr->Se = (int) val;
+      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
+	goto bogus;
+      scanptr->Ah = (int) val;
+      if (! read_scan_integer(fp, &val, &termchar))
+	goto bogus;
+      scanptr->Al = (int) val;
+    } else {
+      /* set non-progressive parameters */
+      scanptr->Ss = 0;
+      scanptr->Se = DCTSIZE2-1;
+      scanptr->Ah = 0;
+      scanptr->Al = 0;
+    }
+    if (termchar != ';' && termchar != EOF) {
+bogus:
+      fprintf(stderr, "Invalid scan entry format in file %s\n", filename);
+      fclose(fp);
+      return FALSE;
+    }
+    scanptr++, scanno++;
+  }
+
+  if (termchar != EOF) {
+    fprintf(stderr, "Non-numeric data in file %s\n", filename);
+    fclose(fp);
+    return FALSE;
+  }
+
+  if (scanno > 0) {
+    /* Stash completed scan list in cinfo structure.
+     * NOTE: for cjpeg's use, JPOOL_IMAGE is the right lifetime for this data,
+     * but if you want to compress multiple images you'd want JPOOL_PERMANENT.
+     */
+    scanptr = (jpeg_scan_info *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  scanno * SIZEOF(jpeg_scan_info));
+    MEMCOPY(scanptr, scans, scanno * SIZEOF(jpeg_scan_info));
+    cinfo->scan_info = scanptr;
+    cinfo->num_scans = scanno;
+  }
+
+  fclose(fp);
+  return TRUE;
+}
+
+#endif /* C_MULTISCAN_FILES_SUPPORTED */
+
+
+GLOBAL(boolean)
+set_quant_slots (j_compress_ptr cinfo, char *arg)
+/* Process a quantization-table-selectors parameter string, of the form
+ *     N[,N,...]
+ * If there are more components than parameters, the last value is replicated.
+ */
+{
+  int val = 0;			/* default table # */
+  int ci;
+  char ch;
+
+  for (ci = 0; ci < MAX_COMPONENTS; ci++) {
+    if (*arg) {
+      ch = ',';			/* if not set by sscanf, will be ',' */
+      if (sscanf(arg, "%d%c", &val, &ch) < 1)
+	return FALSE;
+      if (ch != ',')		/* syntax check */
+	return FALSE;
+      if (val < 0 || val >= NUM_QUANT_TBLS) {
+	fprintf(stderr, "JPEG quantization tables are numbered 0..%d\n",
+		NUM_QUANT_TBLS-1);
+	return FALSE;
+      }
+      cinfo->comp_info[ci].quant_tbl_no = val;
+      while (*arg && *arg++ != ',') /* advance to next segment of arg string */
+	;
+    } else {
+      /* reached end of parameter, set remaining components to last table */
+      cinfo->comp_info[ci].quant_tbl_no = val;
+    }
+  }
+  return TRUE;
+}
+
+
+GLOBAL(boolean)
+set_sample_factors (j_compress_ptr cinfo, char *arg)
+/* Process a sample-factors parameter string, of the form
+ *     HxV[,HxV,...]
+ * If there are more components than parameters, "1x1" is assumed for the rest.
+ */
+{
+  int ci, val1, val2;
+  char ch1, ch2;
+
+  for (ci = 0; ci < MAX_COMPONENTS; ci++) {
+    if (*arg) {
+      ch2 = ',';		/* if not set by sscanf, will be ',' */
+      if (sscanf(arg, "%d%c%d%c", &val1, &ch1, &val2, &ch2) < 3)
+	return FALSE;
+      if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */
+	return FALSE;
+      if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {
+	fprintf(stderr, "JPEG sampling factors must be 1..4\n");
+	return FALSE;
+      }
+      cinfo->comp_info[ci].h_samp_factor = val1;
+      cinfo->comp_info[ci].v_samp_factor = val2;
+      while (*arg && *arg++ != ',') /* advance to next segment of arg string */
+	;
+    } else {
+      /* reached end of parameter, set remaining components to 1x1 sampling */
+      cinfo->comp_info[ci].h_samp_factor = 1;
+      cinfo->comp_info[ci].v_samp_factor = 1;
+    }
+  }
+  return TRUE;
+}
diff --git a/src/libjpeg/rdtarga.c b/src/libjpeg/rdtarga.c
new file mode 100644
index 0000000..d7ffc33
--- /dev/null
+++ b/src/libjpeg/rdtarga.c
@@ -0,0 +1,500 @@
+/*
+ * rdtarga.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to read input images in Targa format.
+ *
+ * These routines may need modification for non-Unix environments or
+ * specialized applications.  As they stand, they assume input from
+ * an ordinary stdio stream.  They further assume that reading begins
+ * at the start of the file; start_input may need work if the
+ * user interface has already read some data (e.g., to determine that
+ * the file is indeed Targa format).
+ *
+ * Based on code contributed by Lee Daniel Crocker.
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef TARGA_SUPPORTED
+
+
+/* Macros to deal with unsigned chars as efficiently as compiler allows */
+
+#ifdef HAVE_UNSIGNED_CHAR
+typedef unsigned char U_CHAR;
+#define UCH(x)	((int) (x))
+#else /* !HAVE_UNSIGNED_CHAR */
+#ifdef CHAR_IS_UNSIGNED
+typedef char U_CHAR;
+#define UCH(x)	((int) (x))
+#else
+typedef char U_CHAR;
+#define UCH(x)	((int) (x) & 0xFF)
+#endif
+#endif /* HAVE_UNSIGNED_CHAR */
+
+
+#define	ReadOK(file,buffer,len)	(JFREAD(file,buffer,len) == ((size_t) (len)))
+
+
+/* Private version of data source object */
+
+typedef struct _tga_source_struct * tga_source_ptr;
+
+typedef struct _tga_source_struct {
+  struct cjpeg_source_struct pub; /* public fields */
+
+  j_compress_ptr cinfo;		/* back link saves passing separate parm */
+
+  JSAMPARRAY colormap;		/* Targa colormap (converted to my format) */
+
+  jvirt_sarray_ptr whole_image;	/* Needed if funny input row order */
+  JDIMENSION current_row;	/* Current logical row number to read */
+
+  /* Pointer to routine to extract next Targa pixel from input file */
+  JMETHOD(void, read_pixel, (tga_source_ptr sinfo));
+
+  /* Result of read_pixel is delivered here: */
+  U_CHAR tga_pixel[4];
+
+  int pixel_size;		/* Bytes per Targa pixel (1 to 4) */
+
+  /* State info for reading RLE-coded pixels; both counts must be init to 0 */
+  int block_count;		/* # of pixels remaining in RLE block */
+  int dup_pixel_count;		/* # of times to duplicate previous pixel */
+
+  /* This saves the correct pixel-row-expansion method for preload_image */
+  JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
+				       cjpeg_source_ptr sinfo));
+} tga_source_struct;
+
+
+/* For expanding 5-bit pixel values to 8-bit with best rounding */
+
+static const UINT8 c5to8bits[32] = {
+    0,   8,  16,  25,  33,  41,  49,  58,
+   66,  74,  82,  90,  99, 107, 115, 123,
+  132, 140, 148, 156, 165, 173, 181, 189,
+  197, 206, 214, 222, 230, 239, 247, 255
+};
+
+
+
+LOCAL(int)
+read_byte (tga_source_ptr sinfo)
+/* Read next byte from Targa file */
+{
+  register FILE *infile = sinfo->pub.input_file;
+  register int c;
+
+  if ((c = getc(infile)) == EOF)
+    ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);
+  return c;
+}
+
+
+LOCAL(void)
+read_colormap (tga_source_ptr sinfo, int cmaplen, int mapentrysize)
+/* Read the colormap from a Targa file */
+{
+  int i;
+
+  /* Presently only handles 24-bit BGR format */
+  if (mapentrysize != 24)
+    ERREXIT(sinfo->cinfo, JERR_TGA_BADCMAP);
+
+  for (i = 0; i < cmaplen; i++) {
+    sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);
+    sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);
+    sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);
+  }
+}
+
+
+/*
+ * read_pixel methods: get a single pixel from Targa file into tga_pixel[]
+ */
+
+METHODDEF(void)
+read_non_rle_pixel (tga_source_ptr sinfo)
+/* Read one Targa pixel from the input file; no RLE expansion */
+{
+  register FILE *infile = sinfo->pub.input_file;
+  register int i;
+
+  for (i = 0; i < sinfo->pixel_size; i++) {
+    sinfo->tga_pixel[i] = (U_CHAR) getc(infile);
+  }
+}
+
+
+METHODDEF(void)
+read_rle_pixel (tga_source_ptr sinfo)
+/* Read one Targa pixel from the input file, expanding RLE data as needed */
+{
+  register FILE *infile = sinfo->pub.input_file;
+  register int i;
+
+  /* Duplicate previously read pixel? */
+  if (sinfo->dup_pixel_count > 0) {
+    sinfo->dup_pixel_count--;
+    return;
+  }
+
+  /* Time to read RLE block header? */
+  if (--sinfo->block_count < 0) { /* decrement pixels remaining in block */
+    i = read_byte(sinfo);
+    if (i & 0x80) {		/* Start of duplicate-pixel block? */
+      sinfo->dup_pixel_count = i & 0x7F; /* number of dups after this one */
+      sinfo->block_count = 0;	/* then read new block header */
+    } else {
+      sinfo->block_count = i & 0x7F; /* number of pixels after this one */
+    }
+  }
+
+  /* Read next pixel */
+  for (i = 0; i < sinfo->pixel_size; i++) {
+    sinfo->tga_pixel[i] = (U_CHAR) getc(infile);
+  }
+}
+
+
+/*
+ * Read one row of pixels.
+ *
+ * We provide several different versions depending on input file format.
+ */
+
+
+METHODDEF(JDIMENSION)
+get_8bit_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading 8-bit grayscale pixels */
+{
+  tga_source_ptr source = (tga_source_ptr) sinfo;
+  register JSAMPROW ptr;
+  register JDIMENSION col;
+  
+  ptr = source->pub.buffer[0];
+  for (col = cinfo->image_width; col > 0; col--) {
+    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */
+    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);
+  }
+  return 1;
+}
+
+METHODDEF(JDIMENSION)
+get_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading 8-bit colormap indexes */
+{
+  tga_source_ptr source = (tga_source_ptr) sinfo;
+  register int t;
+  register JSAMPROW ptr;
+  register JDIMENSION col;
+  register JSAMPARRAY colormap = source->colormap;
+
+  ptr = source->pub.buffer[0];
+  for (col = cinfo->image_width; col > 0; col--) {
+    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */
+    t = UCH(source->tga_pixel[0]);
+    *ptr++ = colormap[0][t];
+    *ptr++ = colormap[1][t];
+    *ptr++ = colormap[2][t];
+  }
+  return 1;
+}
+
+METHODDEF(JDIMENSION)
+get_16bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading 16-bit pixels */
+{
+  tga_source_ptr source = (tga_source_ptr) sinfo;
+  register int t;
+  register JSAMPROW ptr;
+  register JDIMENSION col;
+  
+  ptr = source->pub.buffer[0];
+  for (col = cinfo->image_width; col > 0; col--) {
+    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */
+    t = UCH(source->tga_pixel[0]);
+    t += UCH(source->tga_pixel[1]) << 8;
+    /* We expand 5 bit data to 8 bit sample width.
+     * The format of the 16-bit (LSB first) input word is
+     *     xRRRRRGGGGGBBBBB
+     */
+    ptr[2] = (JSAMPLE) c5to8bits[t & 0x1F];
+    t >>= 5;
+    ptr[1] = (JSAMPLE) c5to8bits[t & 0x1F];
+    t >>= 5;
+    ptr[0] = (JSAMPLE) c5to8bits[t & 0x1F];
+    ptr += 3;
+  }
+  return 1;
+}
+
+METHODDEF(JDIMENSION)
+get_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+/* This version is for reading 24-bit pixels */
+{
+  tga_source_ptr source = (tga_source_ptr) sinfo;
+  register JSAMPROW ptr;
+  register JDIMENSION col;
+  
+  ptr = source->pub.buffer[0];
+  for (col = cinfo->image_width; col > 0; col--) {
+    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */
+    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[2]); /* change BGR to RGB order */
+    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[1]);
+    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);
+  }
+  return 1;
+}
+
+/*
+ * Targa also defines a 32-bit pixel format with order B,G,R,A.
+ * We presently ignore the attribute byte, so the code for reading
+ * these pixels is identical to the 24-bit routine above.
+ * This works because the actual pixel length is only known to read_pixel.
+ */
+
+#define get_32bit_row  get_24bit_row
+
+
+/*
+ * This method is for re-reading the input data in standard top-down
+ * row order.  The entire image has already been read into whole_image
+ * with proper conversion of pixel format, but it's in a funny row order.
+ */
+
+METHODDEF(JDIMENSION)
+get_memory_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  tga_source_ptr source = (tga_source_ptr) sinfo;
+  JDIMENSION source_row;
+
+  /* Compute row of source that maps to current_row of normal order */
+  /* For now, assume image is bottom-up and not interlaced. */
+  /* NEEDS WORK to support interlaced images! */
+  source_row = cinfo->image_height - source->current_row - 1;
+
+  /* Fetch that row from virtual array */
+  source->pub.buffer = (*cinfo->mem->access_virt_sarray)
+    ((j_common_ptr) cinfo, source->whole_image,
+     source_row, (JDIMENSION) 1, FALSE);
+
+  source->current_row++;
+  return 1;
+}
+
+
+/*
+ * This method loads the image into whole_image during the first call on
+ * get_pixel_rows.  The get_pixel_rows pointer is then adjusted to call
+ * get_memory_row on subsequent calls.
+ */
+
+METHODDEF(JDIMENSION)
+preload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  tga_source_ptr source = (tga_source_ptr) sinfo;
+  JDIMENSION row;
+  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
+
+  /* Read the data into a virtual array in input-file row order. */
+  for (row = 0; row < cinfo->image_height; row++) {
+    if (progress != NULL) {
+      progress->pub.pass_counter = (long) row;
+      progress->pub.pass_limit = (long) cinfo->image_height;
+      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
+    }
+    source->pub.buffer = (*cinfo->mem->access_virt_sarray)
+      ((j_common_ptr) cinfo, source->whole_image, row, (JDIMENSION) 1, TRUE);
+    (*source->get_pixel_rows) (cinfo, sinfo);
+  }
+  if (progress != NULL)
+    progress->completed_extra_passes++;
+
+  /* Set up to read from the virtual array in unscrambled order */
+  source->pub.get_pixel_rows = get_memory_row;
+  source->current_row = 0;
+  /* And read the first row */
+  return get_memory_row(cinfo, sinfo);
+}
+
+
+/*
+ * Read the file header; return image size and component count.
+ */
+
+METHODDEF(void)
+start_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  tga_source_ptr source = (tga_source_ptr) sinfo;
+  U_CHAR targaheader[18];
+  int idlen, cmaptype, subtype, flags, interlace_type, components;
+  unsigned int width, height, maplen;
+  boolean is_bottom_up;
+
+#define GET_2B(offset)	((unsigned int) UCH(targaheader[offset]) + \
+			 (((unsigned int) UCH(targaheader[offset+1])) << 8))
+
+  if (! ReadOK(source->pub.input_file, targaheader, 18))
+    ERREXIT(cinfo, JERR_INPUT_EOF);
+
+  /* Pretend "15-bit" pixels are 16-bit --- we ignore attribute bit anyway */
+  if (targaheader[16] == 15)
+    targaheader[16] = 16;
+
+  idlen = UCH(targaheader[0]);
+  cmaptype = UCH(targaheader[1]);
+  subtype = UCH(targaheader[2]);
+  maplen = GET_2B(5);
+  width = GET_2B(12);
+  height = GET_2B(14);
+  source->pixel_size = UCH(targaheader[16]) >> 3;
+  flags = UCH(targaheader[17]);	/* Image Descriptor byte */
+
+  is_bottom_up = ((flags & 0x20) == 0);	/* bit 5 set => top-down */
+  interlace_type = flags >> 6;	/* bits 6/7 are interlace code */
+
+  if (cmaptype > 1 ||		/* cmaptype must be 0 or 1 */
+      source->pixel_size < 1 || source->pixel_size > 4 ||
+      (UCH(targaheader[16]) & 7) != 0 || /* bits/pixel must be multiple of 8 */
+      interlace_type != 0)	/* currently don't allow interlaced image */
+    ERREXIT(cinfo, JERR_TGA_BADPARMS);
+  
+  if (subtype > 8) {
+    /* It's an RLE-coded file */
+    source->read_pixel = read_rle_pixel;
+    source->block_count = source->dup_pixel_count = 0;
+    subtype -= 8;
+  } else {
+    /* Non-RLE file */
+    source->read_pixel = read_non_rle_pixel;
+  }
+
+  /* Now should have subtype 1, 2, or 3 */
+  components = 3;		/* until proven different */
+  cinfo->in_color_space = JCS_RGB;
+
+  switch (subtype) {
+  case 1:			/* Colormapped image */
+    if (source->pixel_size == 1 && cmaptype == 1)
+      source->get_pixel_rows = get_8bit_row;
+    else
+      ERREXIT(cinfo, JERR_TGA_BADPARMS);
+    TRACEMS2(cinfo, 1, JTRC_TGA_MAPPED, width, height);
+    break;
+  case 2:			/* RGB image */
+    switch (source->pixel_size) {
+    case 2:
+      source->get_pixel_rows = get_16bit_row;
+      break;
+    case 3:
+      source->get_pixel_rows = get_24bit_row;
+      break;
+    case 4:
+      source->get_pixel_rows = get_32bit_row;
+      break;
+    default:
+      ERREXIT(cinfo, JERR_TGA_BADPARMS);
+      break;
+    }
+    TRACEMS2(cinfo, 1, JTRC_TGA, width, height);
+    break;
+  case 3:			/* Grayscale image */
+    components = 1;
+    cinfo->in_color_space = JCS_GRAYSCALE;
+    if (source->pixel_size == 1)
+      source->get_pixel_rows = get_8bit_gray_row;
+    else
+      ERREXIT(cinfo, JERR_TGA_BADPARMS);
+    TRACEMS2(cinfo, 1, JTRC_TGA_GRAY, width, height);
+    break;
+  default:
+    ERREXIT(cinfo, JERR_TGA_BADPARMS);
+    break;
+  }
+
+  if (is_bottom_up) {
+    /* Create a virtual array to buffer the upside-down image. */
+    source->whole_image = (*cinfo->mem->request_virt_sarray)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+       (JDIMENSION) width * components, (JDIMENSION) height, (JDIMENSION) 1);
+    if (cinfo->progress != NULL) {
+      cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
+      progress->total_extra_passes++; /* count file input as separate pass */
+    }
+    /* source->pub.buffer will point to the virtual array. */
+    source->pub.buffer_height = 1; /* in case anyone looks at it */
+    source->pub.get_pixel_rows = preload_image;
+  } else {
+    /* Don't need a virtual array, but do need a one-row input buffer. */
+    source->whole_image = NULL;
+    source->pub.buffer = (*cinfo->mem->alloc_sarray)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE,
+       (JDIMENSION) width * components, (JDIMENSION) 1);
+    source->pub.buffer_height = 1;
+    source->pub.get_pixel_rows = source->get_pixel_rows;
+  }
+  
+  while (idlen--)		/* Throw away ID field */
+    (void) read_byte(source);
+
+  if (maplen > 0) {
+    if (maplen > 256 || GET_2B(3) != 0)
+      ERREXIT(cinfo, JERR_TGA_BADCMAP);
+    /* Allocate space to store the colormap */
+    source->colormap = (*cinfo->mem->alloc_sarray)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) maplen, (JDIMENSION) 3);
+    /* and read it from the file */
+    read_colormap(source, (int) maplen, UCH(targaheader[7]));
+  } else {
+    if (cmaptype)		/* but you promised a cmap! */
+      ERREXIT(cinfo, JERR_TGA_BADPARMS);
+    source->colormap = NULL;
+  }
+
+  cinfo->input_components = components;
+  cinfo->data_precision = 8;
+  cinfo->image_width = width;
+  cinfo->image_height = height;
+}
+
+
+/*
+ * Finish up at the end of the file.
+ */
+
+METHODDEF(void)
+finish_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
+{
+  /* no work */
+}
+
+
+/*
+ * The module selection routine for Targa format input.
+ */
+
+GLOBAL(cjpeg_source_ptr)
+jinit_read_targa (j_compress_ptr cinfo)
+{
+  tga_source_ptr source;
+
+  /* Create module interface object */
+  source = (tga_source_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(tga_source_struct));
+  source->cinfo = cinfo;	/* make back link for subroutines */
+  /* Fill in method ptrs, except get_pixel_rows which start_input sets */
+  source->pub.start_input = start_input_tga;
+  source->pub.finish_input = finish_input_tga;
+
+  return (cjpeg_source_ptr) source;
+}
+
+#endif /* TARGA_SUPPORTED */
diff --git a/src/libjpeg/transupp.c b/src/libjpeg/transupp.c
new file mode 100644
index 0000000..53a9940
--- /dev/null
+++ b/src/libjpeg/transupp.c
@@ -0,0 +1,928 @@
+/*
+ * transupp.c
+ *
+ * Copyright (C) 1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains image transformation routines and other utility code
+ * used by the jpegtran sample application.  These are NOT part of the core
+ * JPEG library.  But we keep these routines separate from jpegtran.c to
+ * ease the task of maintaining jpegtran-like programs that have other user
+ * interfaces.
+ */
+
+/* Although this file really shouldn't have access to the library internals,
+ * it's helpful to let it call jround_up() and jcopy_block_row().
+ */
+#define JPEG_INTERNALS
+
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "transupp.h"		/* My own external interface */
+
+
+#if TRANSFORMS_SUPPORTED
+
+/*
+ * Lossless image transformation routines.  These routines work on DCT
+ * coefficient arrays and thus do not require any lossy decompression
+ * or recompression of the image.
+ * Thanks to Guido Vollbeding for the initial design and code of this feature.
+ *
+ * Horizontal flipping is done in-place, using a single top-to-bottom
+ * pass through the virtual source array.  It will thus be much the
+ * fastest option for images larger than main memory.
+ *
+ * The other routines require a set of destination virtual arrays, so they
+ * need twice as much memory as jpegtran normally does.  The destination
+ * arrays are always written in normal scan order (top to bottom) because
+ * the virtual array manager expects this.  The source arrays will be scanned
+ * in the corresponding order, which means multiple passes through the source
+ * arrays for most of the transforms.  That could result in much thrashing
+ * if the image is larger than main memory.
+ *
+ * Some notes about the operating environment of the individual transform
+ * routines:
+ * 1. Both the source and destination virtual arrays are allocated from the
+ *    source JPEG object, and therefore should be manipulated by calling the
+ *    source's memory manager.
+ * 2. The destination's component count should be used.  It may be smaller
+ *    than the source's when forcing to grayscale.
+ * 3. Likewise the destination's sampling factors should be used.  When
+ *    forcing to grayscale the destination's sampling factors will be all 1,
+ *    and we may as well take that as the effective iMCU size.
+ * 4. When "trim" is in effect, the destination's dimensions will be the
+ *    trimmed values but the source's will be untrimmed.
+ * 5. All the routines assume that the source and destination buffers are
+ *    padded out to a full iMCU boundary.  This is true, although for the
+ *    source buffer it is an undocumented property of jdcoefct.c.
+ * Notes 2,3,4 boil down to this: generally we should use the destination's
+ * dimensions and ignore the source's.
+ */
+
+
+LOCAL(void)
+do_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	   jvirt_barray_ptr *src_coef_arrays)
+/* Horizontal flip; done in-place, so no separate dest array is required */
+{
+  JDIMENSION MCU_cols, comp_width, blk_x, blk_y;
+  int ci, k, offset_y;
+  JBLOCKARRAY buffer;
+  JCOEFPTR ptr1, ptr2;
+  JCOEF temp1, temp2;
+  jpeg_component_info *compptr;
+
+  /* Horizontal mirroring of DCT blocks is accomplished by swapping
+   * pairs of blocks in-place.  Within a DCT block, we perform horizontal
+   * mirroring by changing the signs of odd-numbered columns.
+   * Partial iMCUs at the right edge are left untouched.
+   */
+  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    for (blk_y = 0; blk_y < compptr->height_in_blocks;
+	 blk_y += compptr->v_samp_factor) {
+      buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {
+	  ptr1 = buffer[offset_y][blk_x];
+	  ptr2 = buffer[offset_y][comp_width - blk_x - 1];
+	  /* this unrolled loop doesn't need to know which row it's on... */
+	  for (k = 0; k < DCTSIZE2; k += 2) {
+	    temp1 = *ptr1;	/* swap even column */
+	    temp2 = *ptr2;
+	    *ptr1++ = temp2;
+	    *ptr2++ = temp1;
+	    temp1 = *ptr1;	/* swap odd column with sign change */
+	    temp2 = *ptr2;
+	    *ptr1++ = -temp2;
+	    *ptr2++ = -temp1;
+	  }
+	}
+      }
+    }
+  }
+}
+
+
+LOCAL(void)
+do_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	   jvirt_barray_ptr *src_coef_arrays,
+	   jvirt_barray_ptr *dst_coef_arrays)
+/* Vertical flip */
+{
+  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JBLOCKROW src_row_ptr, dst_row_ptr;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* We output into a separate array because we can't touch different
+   * rows of the source virtual array simultaneously.  Otherwise, this
+   * is a pretty straightforward analog of horizontal flip.
+   * Within a DCT block, vertical mirroring is done by changing the signs
+   * of odd-numbered rows.
+   * Partial iMCUs at the bottom edge are copied verbatim.
+   */
+  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      if (dst_blk_y < comp_height) {
+	/* Row is within the mirrorable area. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	   comp_height - dst_blk_y - (JDIMENSION) compptr->v_samp_factor,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      } else {
+	/* Bottom-edge blocks will be copied verbatim. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_y,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      }
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	if (dst_blk_y < comp_height) {
+	  /* Row is within the mirrorable area. */
+	  dst_row_ptr = dst_buffer[offset_y];
+	  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
+	  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	       dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[dst_blk_x];
+	    for (i = 0; i < DCTSIZE; i += 2) {
+	      /* copy even row */
+	      for (j = 0; j < DCTSIZE; j++)
+		*dst_ptr++ = *src_ptr++;
+	      /* copy odd row with sign change */
+	      for (j = 0; j < DCTSIZE; j++)
+		*dst_ptr++ = - *src_ptr++;
+	    }
+	  }
+	} else {
+	  /* Just copy row verbatim. */
+	  jcopy_block_row(src_buffer[offset_y], dst_buffer[offset_y],
+			  compptr->width_in_blocks);
+	}
+      }
+    }
+  }
+}
+
+
+LOCAL(void)
+do_transpose (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	      jvirt_barray_ptr *src_coef_arrays,
+	      jvirt_barray_ptr *dst_coef_arrays)
+/* Transpose source into destination */
+{
+  JDIMENSION dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* Transposing pixels within a block just requires transposing the
+   * DCT coefficients.
+   * Partial iMCUs at the edges require no special treatment; we simply
+   * process all the available DCT blocks for every component.
+   */
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  src_buffer = (*srcinfo->mem->access_virt_barray)
+	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
+	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+	    for (i = 0; i < DCTSIZE; i++)
+	      for (j = 0; j < DCTSIZE; j++)
+		dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	  }
+	}
+      }
+    }
+  }
+}
+
+
+LOCAL(void)
+do_rot_90 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	   jvirt_barray_ptr *src_coef_arrays,
+	   jvirt_barray_ptr *dst_coef_arrays)
+/* 90 degree rotation is equivalent to
+ *   1. Transposing the image;
+ *   2. Horizontal mirroring.
+ * These two steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* Because of the horizontal mirror step, we can't process partial iMCUs
+   * at the (output) right edge properly.  They just get transposed and
+   * not mirrored.
+   */
+  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  src_buffer = (*srcinfo->mem->access_virt_barray)
+	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
+	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+	    if (dst_blk_x < comp_width) {
+	      /* Block is within the mirrorable area. */
+	      dst_ptr = dst_buffer[offset_y]
+		[comp_width - dst_blk_x - offset_x - 1];
+	      for (i = 0; i < DCTSIZE; i++) {
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		i++;
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+	      }
+	    } else {
+	      /* Edge blocks are transposed but not mirrored. */
+	      dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+	      for (i = 0; i < DCTSIZE; i++)
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	    }
+	  }
+	}
+      }
+    }
+  }
+}
+
+
+LOCAL(void)
+do_rot_270 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	    jvirt_barray_ptr *src_coef_arrays,
+	    jvirt_barray_ptr *dst_coef_arrays)
+/* 270 degree rotation is equivalent to
+ *   1. Horizontal mirroring;
+ *   2. Transposing the image.
+ * These two steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* Because of the horizontal mirror step, we can't process partial iMCUs
+   * at the (output) bottom edge properly.  They just get transposed and
+   * not mirrored.
+   */
+  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  src_buffer = (*srcinfo->mem->access_virt_barray)
+	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
+	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+	    if (dst_blk_y < comp_height) {
+	      /* Block is within the mirrorable area. */
+	      src_ptr = src_buffer[offset_x]
+		[comp_height - dst_blk_y - offset_y - 1];
+	      for (i = 0; i < DCTSIZE; i++) {
+		for (j = 0; j < DCTSIZE; j++) {
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		  j++;
+		  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		}
+	      }
+	    } else {
+	      /* Edge blocks are transposed but not mirrored. */
+	      src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+	      for (i = 0; i < DCTSIZE; i++)
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	    }
+	  }
+	}
+      }
+    }
+  }
+}
+
+
+LOCAL(void)
+do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	    jvirt_barray_ptr *src_coef_arrays,
+	    jvirt_barray_ptr *dst_coef_arrays)
+/* 180 degree rotation is equivalent to
+ *   1. Vertical mirroring;
+ *   2. Horizontal mirroring.
+ * These two steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JBLOCKROW src_row_ptr, dst_row_ptr;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      if (dst_blk_y < comp_height) {
+	/* Row is within the vertically mirrorable area. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	   comp_height - dst_blk_y - (JDIMENSION) compptr->v_samp_factor,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      } else {
+	/* Bottom-edge rows are only mirrored horizontally. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_y,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      }
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	if (dst_blk_y < comp_height) {
+	  /* Row is within the mirrorable area. */
+	  dst_row_ptr = dst_buffer[offset_y];
+	  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
+	  /* Process the blocks that can be mirrored both ways. */
+	  for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
+	    for (i = 0; i < DCTSIZE; i += 2) {
+	      /* For even row, negate every odd column. */
+	      for (j = 0; j < DCTSIZE; j += 2) {
+		*dst_ptr++ = *src_ptr++;
+		*dst_ptr++ = - *src_ptr++;
+	      }
+	      /* For odd row, negate every even column. */
+	      for (j = 0; j < DCTSIZE; j += 2) {
+		*dst_ptr++ = - *src_ptr++;
+		*dst_ptr++ = *src_ptr++;
+	      }
+	    }
+	  }
+	  /* Any remaining right-edge blocks are only mirrored vertically. */
+	  for (; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[dst_blk_x];
+	    for (i = 0; i < DCTSIZE; i += 2) {
+	      for (j = 0; j < DCTSIZE; j++)
+		*dst_ptr++ = *src_ptr++;
+	      for (j = 0; j < DCTSIZE; j++)
+		*dst_ptr++ = - *src_ptr++;
+	    }
+	  }
+	} else {
+	  /* Remaining rows are just mirrored horizontally. */
+	  dst_row_ptr = dst_buffer[offset_y];
+	  src_row_ptr = src_buffer[offset_y];
+	  /* Process the blocks that can be mirrored. */
+	  for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
+	    for (i = 0; i < DCTSIZE2; i += 2) {
+	      *dst_ptr++ = *src_ptr++;
+	      *dst_ptr++ = - *src_ptr++;
+	    }
+	  }
+	  /* Any remaining right-edge blocks are only copied. */
+	  for (; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[dst_blk_x];
+	    for (i = 0; i < DCTSIZE2; i++)
+	      *dst_ptr++ = *src_ptr++;
+	  }
+	}
+      }
+    }
+  }
+}
+
+
+LOCAL(void)
+do_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	       jvirt_barray_ptr *src_coef_arrays,
+	       jvirt_barray_ptr *dst_coef_arrays)
+/* Transverse transpose is equivalent to
+ *   1. 180 degree rotation;
+ *   2. Transposition;
+ * or
+ *   1. Horizontal mirroring;
+ *   2. Transposition;
+ *   3. Horizontal mirroring.
+ * These steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  src_buffer = (*srcinfo->mem->access_virt_barray)
+	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
+	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    if (dst_blk_y < comp_height) {
+	      src_ptr = src_buffer[offset_x]
+		[comp_height - dst_blk_y - offset_y - 1];
+	      if (dst_blk_x < comp_width) {
+		/* Block is within the mirrorable area. */
+		dst_ptr = dst_buffer[offset_y]
+		  [comp_width - dst_blk_x - offset_x - 1];
+		for (i = 0; i < DCTSIZE; i++) {
+		  for (j = 0; j < DCTSIZE; j++) {
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		    j++;
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		  }
+		  i++;
+		  for (j = 0; j < DCTSIZE; j++) {
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		    j++;
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		  }
+		}
+	      } else {
+		/* Right-edge blocks are mirrored in y only */
+		dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+		for (i = 0; i < DCTSIZE; i++) {
+		  for (j = 0; j < DCTSIZE; j++) {
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		    j++;
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		  }
+		}
+	      }
+	    } else {
+	      src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+	      if (dst_blk_x < comp_width) {
+		/* Bottom-edge blocks are mirrored in x only */
+		dst_ptr = dst_buffer[offset_y]
+		  [comp_width - dst_blk_x - offset_x - 1];
+		for (i = 0; i < DCTSIZE; i++) {
+		  for (j = 0; j < DCTSIZE; j++)
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		  i++;
+		  for (j = 0; j < DCTSIZE; j++)
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		}
+	      } else {
+		/* At lower right corner, just transpose, no mirroring */
+		dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+		for (i = 0; i < DCTSIZE; i++)
+		  for (j = 0; j < DCTSIZE; j++)
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	      }
+	    }
+	  }
+	}
+      }
+    }
+  }
+}
+
+
+/* Request any required workspace.
+ *
+ * We allocate the workspace virtual arrays from the source decompression
+ * object, so that all the arrays (both the original data and the workspace)
+ * will be taken into account while making memory management decisions.
+ * Hence, this routine must be called after jpeg_read_header (which reads
+ * the image dimensions) and before jpeg_read_coefficients (which realizes
+ * the source's virtual arrays).
+ */
+
+GLOBAL(void)
+jtransform_request_workspace (j_decompress_ptr srcinfo,
+			      jpeg_transform_info *info)
+{
+  jvirt_barray_ptr *coef_arrays = NULL;
+  jpeg_component_info *compptr;
+  int ci;
+
+  if (info->force_grayscale &&
+      srcinfo->jpeg_color_space == JCS_YCbCr &&
+      srcinfo->num_components == 3) {
+    /* We'll only process the first component */
+    info->num_components = 1;
+  } else {
+    /* Process all the components */
+    info->num_components = srcinfo->num_components;
+  }
+
+  switch (info->transform) {
+  case JXFORM_NONE:
+  case JXFORM_FLIP_H:
+    /* Don't need a workspace array */
+    break;
+  case JXFORM_FLIP_V:
+  case JXFORM_ROT_180:
+    /* Need workspace arrays having same dimensions as source image.
+     * Note that we allocate arrays padded out to the next iMCU boundary,
+     * so that transform routines need not worry about missing edge blocks.
+     */
+    coef_arrays = (jvirt_barray_ptr *)
+      (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,
+	SIZEOF(jvirt_barray_ptr) * info->num_components);
+    for (ci = 0; ci < info->num_components; ci++) {
+      compptr = srcinfo->comp_info + ci;
+      coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
+	((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,
+	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
+				(long) compptr->h_samp_factor),
+	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+				(long) compptr->v_samp_factor),
+	 (JDIMENSION) compptr->v_samp_factor);
+    }
+    break;
+  case JXFORM_TRANSPOSE:
+  case JXFORM_TRANSVERSE:
+  case JXFORM_ROT_90:
+  case JXFORM_ROT_270:
+    /* Need workspace arrays having transposed dimensions.
+     * Note that we allocate arrays padded out to the next iMCU boundary,
+     * so that transform routines need not worry about missing edge blocks.
+     */
+    coef_arrays = (jvirt_barray_ptr *)
+      (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,
+	SIZEOF(jvirt_barray_ptr) * info->num_components);
+    for (ci = 0; ci < info->num_components; ci++) {
+      compptr = srcinfo->comp_info + ci;
+      coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
+	((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,
+	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+				(long) compptr->v_samp_factor),
+	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
+				(long) compptr->h_samp_factor),
+	 (JDIMENSION) compptr->h_samp_factor);
+    }
+    break;
+  }
+  info->workspace_coef_arrays = coef_arrays;
+}
+
+
+/* Transpose destination image parameters */
+
+LOCAL(void)
+transpose_critical_parameters (j_compress_ptr dstinfo)
+{
+  int tblno, i, j, ci, itemp;
+  jpeg_component_info *compptr;
+  JQUANT_TBL *qtblptr;
+  JDIMENSION dtemp;
+  UINT16 qtemp;
+
+  /* Transpose basic image dimensions */
+  dtemp = dstinfo->image_width;
+  dstinfo->image_width = dstinfo->image_height;
+  dstinfo->image_height = dtemp;
+
+  /* Transpose sampling factors */
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    itemp = compptr->h_samp_factor;
+    compptr->h_samp_factor = compptr->v_samp_factor;
+    compptr->v_samp_factor = itemp;
+  }
+
+  /* Transpose quantization tables */
+  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
+    qtblptr = dstinfo->quant_tbl_ptrs[tblno];
+    if (qtblptr != NULL) {
+      for (i = 0; i < DCTSIZE; i++) {
+	for (j = 0; j < i; j++) {
+	  qtemp = qtblptr->quantval[i*DCTSIZE+j];
+	  qtblptr->quantval[i*DCTSIZE+j] = qtblptr->quantval[j*DCTSIZE+i];
+	  qtblptr->quantval[j*DCTSIZE+i] = qtemp;
+	}
+      }
+    }
+  }
+}
+
+
+/* Trim off any partial iMCUs on the indicated destination edge */
+
+LOCAL(void)
+trim_right_edge (j_compress_ptr dstinfo)
+{
+  int ci, max_h_samp_factor;
+  JDIMENSION MCU_cols;
+
+  /* We have to compute max_h_samp_factor ourselves,
+   * because it hasn't been set yet in the destination
+   * (and we don't want to use the source's value).
+   */
+  max_h_samp_factor = 1;
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    int h_samp_factor = dstinfo->comp_info[ci].h_samp_factor;
+    max_h_samp_factor = MAX(max_h_samp_factor, h_samp_factor);
+  }
+  MCU_cols = dstinfo->image_width / (max_h_samp_factor * DCTSIZE);
+  if (MCU_cols > 0)		/* can't trim to 0 pixels */
+    dstinfo->image_width = MCU_cols * (max_h_samp_factor * DCTSIZE);
+}
+
+LOCAL(void)
+trim_bottom_edge (j_compress_ptr dstinfo)
+{
+  int ci, max_v_samp_factor;
+  JDIMENSION MCU_rows;
+
+  /* We have to compute max_v_samp_factor ourselves,
+   * because it hasn't been set yet in the destination
+   * (and we don't want to use the source's value).
+   */
+  max_v_samp_factor = 1;
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    int v_samp_factor = dstinfo->comp_info[ci].v_samp_factor;
+    max_v_samp_factor = MAX(max_v_samp_factor, v_samp_factor);
+  }
+  MCU_rows = dstinfo->image_height / (max_v_samp_factor * DCTSIZE);
+  if (MCU_rows > 0)		/* can't trim to 0 pixels */
+    dstinfo->image_height = MCU_rows * (max_v_samp_factor * DCTSIZE);
+}
+
+
+/* Adjust output image parameters as needed.
+ *
+ * This must be called after jpeg_copy_critical_parameters()
+ * and before jpeg_write_coefficients().
+ *
+ * The return value is the set of virtual coefficient arrays to be written
+ * (either the ones allocated by jtransform_request_workspace, or the
+ * original source data arrays).  The caller will need to pass this value
+ * to jpeg_write_coefficients().
+ */
+
+GLOBAL(jvirt_barray_ptr *)
+jtransform_adjust_parameters (j_decompress_ptr srcinfo,
+			      j_compress_ptr dstinfo,
+			      jvirt_barray_ptr *src_coef_arrays,
+			      jpeg_transform_info *info)
+{
+  /* If force-to-grayscale is requested, adjust destination parameters */
+  if (info->force_grayscale) {
+    /* We use jpeg_set_colorspace to make sure subsidiary settings get fixed
+     * properly.  Among other things, the target h_samp_factor & v_samp_factor
+     * will get set to 1, which typically won't match the source.
+     * In fact we do this even if the source is already grayscale; that
+     * provides an easy way of coercing a grayscale JPEG with funny sampling
+     * factors to the customary 1,1.  (Some decoders fail on other factors.)
+     */
+    if ((dstinfo->jpeg_color_space == JCS_YCbCr &&
+	 dstinfo->num_components == 3) ||
+	(dstinfo->jpeg_color_space == JCS_GRAYSCALE &&
+	 dstinfo->num_components == 1)) {
+      /* We have to preserve the source's quantization table number. */
+      int sv_quant_tbl_no = dstinfo->comp_info[0].quant_tbl_no;
+      jpeg_set_colorspace(dstinfo, JCS_GRAYSCALE);
+      dstinfo->comp_info[0].quant_tbl_no = sv_quant_tbl_no;
+    } else {
+      /* Sorry, can't do it */
+      ERREXIT(dstinfo, JERR_CONVERSION_NOTIMPL);
+    }
+  }
+
+  /* Correct the destination's image dimensions etc if necessary */
+  switch (info->transform) {
+  case JXFORM_NONE:
+    /* Nothing to do */
+    break;
+  case JXFORM_FLIP_H:
+    if (info->trim)
+      trim_right_edge(dstinfo);
+    break;
+  case JXFORM_FLIP_V:
+    if (info->trim)
+      trim_bottom_edge(dstinfo);
+    break;
+  case JXFORM_TRANSPOSE:
+    transpose_critical_parameters(dstinfo);
+    /* transpose does NOT have to trim anything */
+    break;
+  case JXFORM_TRANSVERSE:
+    transpose_critical_parameters(dstinfo);
+    if (info->trim) {
+      trim_right_edge(dstinfo);
+      trim_bottom_edge(dstinfo);
+    }
+    break;
+  case JXFORM_ROT_90:
+    transpose_critical_parameters(dstinfo);
+    if (info->trim)
+      trim_right_edge(dstinfo);
+    break;
+  case JXFORM_ROT_180:
+    if (info->trim) {
+      trim_right_edge(dstinfo);
+      trim_bottom_edge(dstinfo);
+    }
+    break;
+  case JXFORM_ROT_270:
+    transpose_critical_parameters(dstinfo);
+    if (info->trim)
+      trim_bottom_edge(dstinfo);
+    break;
+  }
+
+  /* Return the appropriate output data set */
+  if (info->workspace_coef_arrays != NULL)
+    return info->workspace_coef_arrays;
+  return src_coef_arrays;
+}
+
+
+/* Execute the actual transformation, if any.
+ *
+ * This must be called *after* jpeg_write_coefficients, because it depends
+ * on jpeg_write_coefficients to have computed subsidiary values such as
+ * the per-component width and height fields in the destination object.
+ *
+ * Note that some transformations will modify the source data arrays!
+ */
+
+GLOBAL(void)
+jtransform_execute_transformation (j_decompress_ptr srcinfo,
+				   j_compress_ptr dstinfo,
+				   jvirt_barray_ptr *src_coef_arrays,
+				   jpeg_transform_info *info)
+{
+  jvirt_barray_ptr *dst_coef_arrays = info->workspace_coef_arrays;
+
+  switch (info->transform) {
+  case JXFORM_NONE:
+    break;
+  case JXFORM_FLIP_H:
+    do_flip_h(srcinfo, dstinfo, src_coef_arrays);
+    break;
+  case JXFORM_FLIP_V:
+    do_flip_v(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_TRANSPOSE:
+    do_transpose(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_TRANSVERSE:
+    do_transverse(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_ROT_90:
+    do_rot_90(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_ROT_180:
+    do_rot_180(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_ROT_270:
+    do_rot_270(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  }
+}
+
+#endif /* TRANSFORMS_SUPPORTED */
+
+
+/* Setup decompression object to save desired markers in memory.
+ * This must be called before jpeg_read_header() to have the desired effect.
+ */
+
+GLOBAL(void)
+jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)
+{
+#ifdef SAVE_MARKERS_SUPPORTED
+  int m;
+
+  /* Save comments except under NONE option */
+  if (option != JCOPYOPT_NONE) {
+    jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF);
+  }
+  /* Save all types of APPn markers iff ALL option */
+  if (option == JCOPYOPT_ALL) {
+    for (m = 0; m < 16; m++)
+      jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);
+  }
+#endif /* SAVE_MARKERS_SUPPORTED */
+}
+
+/* Copy markers saved in the given source object to the destination object.
+ * This should be called just after jpeg_start_compress() or
+ * jpeg_write_coefficients().
+ * Note that those routines will have written the SOI, and also the
+ * JFIF APP0 or Adobe APP14 markers if selected.
+ */
+
+GLOBAL(void)
+jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+		       JCOPY_OPTION option)
+{
+  jpeg_saved_marker_ptr marker;
+
+  /* In the current implementation, we don't actually need to examine the
+   * option flag here; we just copy everything that got saved.
+   * But to avoid confusion, we do not output JFIF and Adobe APP14 markers
+   * if the encoder library already wrote one.
+   */
+  for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) {
+    if (dstinfo->write_JFIF_header &&
+	marker->marker == JPEG_APP0 &&
+	marker->data_length >= 5 &&
+	GETJOCTET(marker->data[0]) == 0x4A &&
+	GETJOCTET(marker->data[1]) == 0x46 &&
+	GETJOCTET(marker->data[2]) == 0x49 &&
+	GETJOCTET(marker->data[3]) == 0x46 &&
+	GETJOCTET(marker->data[4]) == 0)
+      continue;			/* reject duplicate JFIF */
+    if (dstinfo->write_Adobe_marker &&
+	marker->marker == JPEG_APP0+14 &&
+	marker->data_length >= 5 &&
+	GETJOCTET(marker->data[0]) == 0x41 &&
+	GETJOCTET(marker->data[1]) == 0x64 &&
+	GETJOCTET(marker->data[2]) == 0x6F &&
+	GETJOCTET(marker->data[3]) == 0x62 &&
+	GETJOCTET(marker->data[4]) == 0x65)
+      continue;			/* reject duplicate Adobe */
+#ifdef NEED_FAR_POINTERS
+    /* We could use jpeg_write_marker if the data weren't FAR... */
+    {
+      unsigned int i;
+      jpeg_write_m_header(dstinfo, marker->marker, marker->data_length);
+      for (i = 0; i < marker->data_length; i++)
+	jpeg_write_m_byte(dstinfo, marker->data[i]);
+    }
+#else
+    jpeg_write_marker(dstinfo, marker->marker,
+		      marker->data, marker->data_length);
+#endif
+  }
+}
diff --git a/src/libjpeg/transupp.h b/src/libjpeg/transupp.h
new file mode 100644
index 0000000..eb0b055
--- /dev/null
+++ b/src/libjpeg/transupp.h
@@ -0,0 +1,135 @@
+/*
+ * transupp.h
+ *
+ * Copyright (C) 1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains declarations for image transformation routines and
+ * other utility code used by the jpegtran sample application.  These are
+ * NOT part of the core JPEG library.  But we keep these routines separate
+ * from jpegtran.c to ease the task of maintaining jpegtran-like programs
+ * that have other user interfaces.
+ *
+ * NOTE: all the routines declared here have very specific requirements
+ * about when they are to be executed during the reading and writing of the
+ * source and destination files.  See the comments in transupp.c, or see
+ * jpegtran.c for an example of correct usage.
+ */
+
+/* If you happen not to want the image transform support, disable it here */
+#ifndef TRANSFORMS_SUPPORTED
+#define TRANSFORMS_SUPPORTED 1		/* 0 disables transform code */
+#endif
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jtransform_request_workspace		jTrRequest
+#define jtransform_adjust_parameters		jTrAdjust
+#define jtransform_execute_transformation	jTrExec
+#define jcopy_markers_setup			jCMrkSetup
+#define jcopy_markers_execute			jCMrkExec
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/*
+ * Codes for supported types of image transformations.
+ */
+
+typedef enum {
+	JXFORM_NONE,		/* no transformation */
+	JXFORM_FLIP_H,		/* horizontal flip */
+	JXFORM_FLIP_V,		/* vertical flip */
+	JXFORM_TRANSPOSE,	/* transpose across UL-to-LR axis */
+	JXFORM_TRANSVERSE,	/* transpose across UR-to-LL axis */
+	JXFORM_ROT_90,		/* 90-degree clockwise rotation */
+	JXFORM_ROT_180,		/* 180-degree rotation */
+	JXFORM_ROT_270		/* 270-degree clockwise (or 90 ccw) */
+} JXFORM_CODE;
+
+/*
+ * Although rotating and flipping data expressed as DCT coefficients is not
+ * hard, there is an asymmetry in the JPEG format specification for images
+ * whose dimensions aren't multiples of the iMCU size.  The right and bottom
+ * image edges are padded out to the next iMCU boundary with junk data; but
+ * no padding is possible at the top and left edges.  If we were to flip
+ * the whole image including the pad data, then pad garbage would become
+ * visible at the top and/or left, and real pixels would disappear into the
+ * pad margins --- perhaps permanently, since encoders & decoders may not
+ * bother to preserve DCT blocks that appear to be completely outside the
+ * nominal image area.  So, we have to exclude any partial iMCUs from the
+ * basic transformation.
+ *
+ * Transpose is the only transformation that can handle partial iMCUs at the
+ * right and bottom edges completely cleanly.  flip_h can flip partial iMCUs
+ * at the bottom, but leaves any partial iMCUs at the right edge untouched.
+ * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched.
+ * The other transforms are defined as combinations of these basic transforms
+ * and process edge blocks in a way that preserves the equivalence.
+ *
+ * The "trim" option causes untransformable partial iMCUs to be dropped;
+ * this is not strictly lossless, but it usually gives the best-looking
+ * result for odd-size images.  Note that when this option is active,
+ * the expected mathematical equivalences between the transforms may not hold.
+ * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim
+ * followed by -rot 180 -trim trims both edges.)
+ *
+ * We also offer a "force to grayscale" option, which simply discards the
+ * chrominance channels of a YCbCr image.  This is lossless in the sense that
+ * the luminance channel is preserved exactly.  It's not the same kind of
+ * thing as the rotate/flip transformations, but it's convenient to handle it
+ * as part of this package, mainly because the transformation routines have to
+ * be aware of the option to know how many components to work on.
+ */
+
+typedef struct {
+  /* Options: set by caller */
+  JXFORM_CODE transform;	/* image transform operator */
+  boolean trim;			/* if TRUE, trim partial MCUs as needed */
+  boolean force_grayscale;	/* if TRUE, convert color image to grayscale */
+
+  /* Internal workspace: caller should not touch these */
+  int num_components;		/* # of components in workspace */
+  jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */
+} jpeg_transform_info;
+
+
+#if TRANSFORMS_SUPPORTED
+
+/* Request any required workspace */
+EXTERN(void) jtransform_request_workspace
+	JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));
+/* Adjust output image parameters */
+EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters
+	JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	     jvirt_barray_ptr *src_coef_arrays,
+	     jpeg_transform_info *info));
+/* Execute the actual transformation, if any */
+EXTERN(void) jtransform_execute_transformation
+	JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	     jvirt_barray_ptr *src_coef_arrays,
+	     jpeg_transform_info *info));
+
+#endif /* TRANSFORMS_SUPPORTED */
+
+
+/*
+ * Support for copying optional markers from source to destination file.
+ */
+
+typedef enum {
+	JCOPYOPT_NONE,		/* copy no optional markers */
+	JCOPYOPT_COMMENTS,	/* copy only comment (COM) markers */
+	JCOPYOPT_ALL		/* copy all optional markers */
+} JCOPY_OPTION;
+
+#define JCOPYOPT_DEFAULT  JCOPYOPT_COMMENTS	/* recommended default */
+
+/* Setup decompression object to save desired markers in memory */
+EXTERN(void) jcopy_markers_setup
+	JPP((j_decompress_ptr srcinfo, JCOPY_OPTION option));
+/* Copy markers saved in the given source object to the destination object */
+EXTERN(void) jcopy_markers_execute
+	JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	     JCOPY_OPTION option));
diff --git a/src/libjpeg/wrbmp.c b/src/libjpeg/wrbmp.c
new file mode 100644
index 0000000..2b8146e
--- /dev/null
+++ b/src/libjpeg/wrbmp.c
@@ -0,0 +1,442 @@
+/*
+ * wrbmp.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to write output images in Microsoft "BMP"
+ * format (MS Windows 3.x and OS/2 1.x flavors).
+ * Either 8-bit colormapped or 24-bit full-color format can be written.
+ * No compression is supported.
+ *
+ * These routines may need modification for non-Unix environments or
+ * specialized applications.  As they stand, they assume output to
+ * an ordinary stdio stream.
+ *
+ * This code contributed by James Arthur Boucher.
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef BMP_SUPPORTED
+
+
+/*
+ * To support 12-bit JPEG data, we'd have to scale output down to 8 bits.
+ * This is not yet implemented.
+ */
+
+#if BITS_IN_JSAMPLE != 8
+  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */
+#endif
+
+/*
+ * Since BMP stores scanlines bottom-to-top, we have to invert the image
+ * from JPEG's top-to-bottom order.  To do this, we save the outgoing data
+ * in a virtual array during put_pixel_row calls, then actually emit the
+ * BMP file during finish_output.  The virtual array contains one JSAMPLE per
+ * pixel if the output is grayscale or colormapped, three if it is full color.
+ */
+
+/* Private version of data destination object */
+
+typedef struct {
+  struct djpeg_dest_struct pub;	/* public fields */
+
+  boolean is_os2;		/* saves the OS2 format request flag */
+
+  jvirt_sarray_ptr whole_image;	/* needed to reverse row order */
+  JDIMENSION data_width;	/* JSAMPLEs per row */
+  JDIMENSION row_width;		/* physical width of one row in the BMP file */
+  int pad_bytes;		/* number of padding bytes needed per row */
+  JDIMENSION cur_output_row;	/* next row# to write to virtual array */
+} bmp_dest_struct;
+
+typedef bmp_dest_struct * bmp_dest_ptr;
+
+
+/* Forward declarations */
+LOCAL(void) write_colormap
+	JPP((j_decompress_ptr cinfo, bmp_dest_ptr dest,
+	     int map_colors, int map_entry_size));
+
+
+/*
+ * Write some pixel data.
+ * In this module rows_supplied will always be 1.
+ */
+
+METHODDEF(void)
+put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+		JDIMENSION rows_supplied)
+/* This version is for writing 24-bit pixels */
+{
+  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;
+  JSAMPARRAY image_ptr;
+  register JSAMPROW inptr, outptr;
+  register JDIMENSION col;
+  int pad;
+
+  /* Access next row in virtual array */
+  image_ptr = (*cinfo->mem->access_virt_sarray)
+    ((j_common_ptr) cinfo, dest->whole_image,
+     dest->cur_output_row, (JDIMENSION) 1, TRUE);
+  dest->cur_output_row++;
+
+  /* Transfer data.  Note destination values must be in BGR order
+   * (even though Microsoft's own documents say the opposite).
+   */
+  inptr = dest->pub.buffer[0];
+  outptr = image_ptr[0];
+  for (col = cinfo->output_width; col > 0; col--) {
+    outptr[2] = *inptr++;	/* can omit GETJSAMPLE() safely */
+    outptr[1] = *inptr++;
+    outptr[0] = *inptr++;
+    outptr += 3;
+  }
+
+  /* Zero out the pad bytes. */
+  pad = dest->pad_bytes;
+  while (--pad >= 0)
+    *outptr++ = 0;
+}
+
+METHODDEF(void)
+put_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+	       JDIMENSION rows_supplied)
+/* This version is for grayscale OR quantized color output */
+{
+  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;
+  JSAMPARRAY image_ptr;
+  register JSAMPROW inptr, outptr;
+  register JDIMENSION col;
+  int pad;
+
+  /* Access next row in virtual array */
+  image_ptr = (*cinfo->mem->access_virt_sarray)
+    ((j_common_ptr) cinfo, dest->whole_image,
+     dest->cur_output_row, (JDIMENSION) 1, TRUE);
+  dest->cur_output_row++;
+
+  /* Transfer data. */
+  inptr = dest->pub.buffer[0];
+  outptr = image_ptr[0];
+  for (col = cinfo->output_width; col > 0; col--) {
+    *outptr++ = *inptr++;	/* can omit GETJSAMPLE() safely */
+  }
+
+  /* Zero out the pad bytes. */
+  pad = dest->pad_bytes;
+  while (--pad >= 0)
+    *outptr++ = 0;
+}
+
+
+/*
+ * Startup: normally writes the file header.
+ * In this module we may as well postpone everything until finish_output.
+ */
+
+METHODDEF(void)
+start_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
+{
+  /* no work here */
+}
+
+
+/*
+ * Finish up at the end of the file.
+ *
+ * Here is where we really output the BMP file.
+ *
+ * First, routines to write the Windows and OS/2 variants of the file header.
+ */
+
+LOCAL(void)
+write_bmp_header (j_decompress_ptr cinfo, bmp_dest_ptr dest)
+/* Write a Windows-style BMP file header, including colormap if needed */
+{
+  char bmpfileheader[14];
+  char bmpinfoheader[40];
+#define PUT_2B(array,offset,value)  \
+	(array[offset] = (char) ((value) & 0xFF), \
+	 array[offset+1] = (char) (((value) >> 8) & 0xFF))
+#define PUT_4B(array,offset,value)  \
+	(array[offset] = (char) ((value) & 0xFF), \
+	 array[offset+1] = (char) (((value) >> 8) & 0xFF), \
+	 array[offset+2] = (char) (((value) >> 16) & 0xFF), \
+	 array[offset+3] = (char) (((value) >> 24) & 0xFF))
+  INT32 headersize, bfSize;
+  int bits_per_pixel, cmap_entries;
+
+  /* Compute colormap size and total file size */
+  if (cinfo->out_color_space == JCS_RGB) {
+    if (cinfo->quantize_colors) {
+      /* Colormapped RGB */
+      bits_per_pixel = 8;
+      cmap_entries = 256;
+    } else {
+      /* Unquantized, full color RGB */
+      bits_per_pixel = 24;
+      cmap_entries = 0;
+    }
+  } else {
+    /* Grayscale output.  We need to fake a 256-entry colormap. */
+    bits_per_pixel = 8;
+    cmap_entries = 256;
+  }
+  /* File size */
+  headersize = 14 + 40 + cmap_entries * 4; /* Header and colormap */
+  bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;
+  
+  /* Set unused fields of header to 0 */
+  MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));
+  MEMZERO(bmpinfoheader, SIZEOF(bmpinfoheader));
+
+  /* Fill the file header */
+  bmpfileheader[0] = 0x42;	/* first 2 bytes are ASCII 'B', 'M' */
+  bmpfileheader[1] = 0x4D;
+  PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */
+  /* we leave bfReserved1 & bfReserved2 = 0 */
+  PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */
+
+  /* Fill the info header (Microsoft calls this a BITMAPINFOHEADER) */
+  PUT_2B(bmpinfoheader, 0, 40);	/* biSize */
+  PUT_4B(bmpinfoheader, 4, cinfo->output_width); /* biWidth */
+  PUT_4B(bmpinfoheader, 8, cinfo->output_height); /* biHeight */
+  PUT_2B(bmpinfoheader, 12, 1);	/* biPlanes - must be 1 */
+  PUT_2B(bmpinfoheader, 14, bits_per_pixel); /* biBitCount */
+  /* we leave biCompression = 0, for none */
+  /* we leave biSizeImage = 0; this is correct for uncompressed data */
+  if (cinfo->density_unit == 2) { /* if have density in dots/cm, then */
+    PUT_4B(bmpinfoheader, 24, (INT32) (cinfo->X_density*100)); /* XPels/M */
+    PUT_4B(bmpinfoheader, 28, (INT32) (cinfo->Y_density*100)); /* XPels/M */
+  }
+  PUT_2B(bmpinfoheader, 32, cmap_entries); /* biClrUsed */
+  /* we leave biClrImportant = 0 */
+
+  if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14)
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+  if (JFWRITE(dest->pub.output_file, bmpinfoheader, 40) != (size_t) 40)
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+
+  if (cmap_entries > 0)
+    write_colormap(cinfo, dest, cmap_entries, 4);
+}
+
+
+LOCAL(void)
+write_os2_header (j_decompress_ptr cinfo, bmp_dest_ptr dest)
+/* Write an OS2-style BMP file header, including colormap if needed */
+{
+  char bmpfileheader[14];
+  char bmpcoreheader[12];
+  INT32 headersize, bfSize;
+  int bits_per_pixel, cmap_entries;
+
+  /* Compute colormap size and total file size */
+  if (cinfo->out_color_space == JCS_RGB) {
+    if (cinfo->quantize_colors) {
+      /* Colormapped RGB */
+      bits_per_pixel = 8;
+      cmap_entries = 256;
+    } else {
+      /* Unquantized, full color RGB */
+      bits_per_pixel = 24;
+      cmap_entries = 0;
+    }
+  } else {
+    /* Grayscale output.  We need to fake a 256-entry colormap. */
+    bits_per_pixel = 8;
+    cmap_entries = 256;
+  }
+  /* File size */
+  headersize = 14 + 12 + cmap_entries * 3; /* Header and colormap */
+  bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;
+  
+  /* Set unused fields of header to 0 */
+  MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));
+  MEMZERO(bmpcoreheader, SIZEOF(bmpcoreheader));
+
+  /* Fill the file header */
+  bmpfileheader[0] = 0x42;	/* first 2 bytes are ASCII 'B', 'M' */
+  bmpfileheader[1] = 0x4D;
+  PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */
+  /* we leave bfReserved1 & bfReserved2 = 0 */
+  PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */
+
+  /* Fill the info header (Microsoft calls this a BITMAPCOREHEADER) */
+  PUT_2B(bmpcoreheader, 0, 12);	/* bcSize */
+  PUT_2B(bmpcoreheader, 4, cinfo->output_width); /* bcWidth */
+  PUT_2B(bmpcoreheader, 6, cinfo->output_height); /* bcHeight */
+  PUT_2B(bmpcoreheader, 8, 1);	/* bcPlanes - must be 1 */
+  PUT_2B(bmpcoreheader, 10, bits_per_pixel); /* bcBitCount */
+
+  if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14)
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+  if (JFWRITE(dest->pub.output_file, bmpcoreheader, 12) != (size_t) 12)
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+
+  if (cmap_entries > 0)
+    write_colormap(cinfo, dest, cmap_entries, 3);
+}
+
+
+/*
+ * Write the colormap.
+ * Windows uses BGR0 map entries; OS/2 uses BGR entries.
+ */
+
+LOCAL(void)
+write_colormap (j_decompress_ptr cinfo, bmp_dest_ptr dest,
+		int map_colors, int map_entry_size)
+{
+  JSAMPARRAY colormap = cinfo->colormap;
+  int num_colors = cinfo->actual_number_of_colors;
+  FILE * outfile = dest->pub.output_file;
+  int i;
+
+  if (colormap != NULL) {
+    if (cinfo->out_color_components == 3) {
+      /* Normal case with RGB colormap */
+      for (i = 0; i < num_colors; i++) {
+	putc(GETJSAMPLE(colormap[2][i]), outfile);
+	putc(GETJSAMPLE(colormap[1][i]), outfile);
+	putc(GETJSAMPLE(colormap[0][i]), outfile);
+	if (map_entry_size == 4)
+	  putc(0, outfile);
+      }
+    } else {
+      /* Grayscale colormap (only happens with grayscale quantization) */
+      for (i = 0; i < num_colors; i++) {
+	putc(GETJSAMPLE(colormap[0][i]), outfile);
+	putc(GETJSAMPLE(colormap[0][i]), outfile);
+	putc(GETJSAMPLE(colormap[0][i]), outfile);
+	if (map_entry_size == 4)
+	  putc(0, outfile);
+      }
+    }
+  } else {
+    /* If no colormap, must be grayscale data.  Generate a linear "map". */
+    for (i = 0; i < 256; i++) {
+      putc(i, outfile);
+      putc(i, outfile);
+      putc(i, outfile);
+      if (map_entry_size == 4)
+	putc(0, outfile);
+    }
+  }
+  /* Pad colormap with zeros to ensure specified number of colormap entries */ 
+  if (i > map_colors)
+    ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, i);
+  for (; i < map_colors; i++) {
+    putc(0, outfile);
+    putc(0, outfile);
+    putc(0, outfile);
+    if (map_entry_size == 4)
+      putc(0, outfile);
+  }
+}
+
+
+METHODDEF(void)
+finish_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
+{
+  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;
+  register FILE * outfile = dest->pub.output_file;
+  JSAMPARRAY image_ptr;
+  register JSAMPROW data_ptr;
+  JDIMENSION row;
+  register JDIMENSION col;
+  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
+
+  /* Write the header and colormap */
+  if (dest->is_os2)
+    write_os2_header(cinfo, dest);
+  else
+    write_bmp_header(cinfo, dest);
+
+  /* Write the file body from our virtual array */
+  for (row = cinfo->output_height; row > 0; row--) {
+    if (progress != NULL) {
+      progress->pub.pass_counter = (long) (cinfo->output_height - row);
+      progress->pub.pass_limit = (long) cinfo->output_height;
+      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
+    }
+    image_ptr = (*cinfo->mem->access_virt_sarray)
+      ((j_common_ptr) cinfo, dest->whole_image, row-1, (JDIMENSION) 1, FALSE);
+    data_ptr = image_ptr[0];
+    for (col = dest->row_width; col > 0; col--) {
+      putc(GETJSAMPLE(*data_ptr), outfile);
+      data_ptr++;
+    }
+  }
+  if (progress != NULL)
+    progress->completed_extra_passes++;
+
+  /* Make sure we wrote the output file OK */
+  fflush(outfile);
+  if (ferror(outfile))
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+}
+
+
+/*
+ * The module selection routine for BMP format output.
+ */
+
+GLOBAL(djpeg_dest_ptr)
+jinit_write_bmp (j_decompress_ptr cinfo, boolean is_os2)
+{
+  bmp_dest_ptr dest;
+  JDIMENSION row_width;
+
+  /* Create module interface object, fill in method pointers */
+  dest = (bmp_dest_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(bmp_dest_struct));
+  dest->pub.start_output = start_output_bmp;
+  dest->pub.finish_output = finish_output_bmp;
+  dest->is_os2 = is_os2;
+
+  if (cinfo->out_color_space == JCS_GRAYSCALE) {
+    dest->pub.put_pixel_rows = put_gray_rows;
+  } else if (cinfo->out_color_space == JCS_RGB) {
+    if (cinfo->quantize_colors)
+      dest->pub.put_pixel_rows = put_gray_rows;
+    else
+      dest->pub.put_pixel_rows = put_pixel_rows;
+  } else {
+    ERREXIT(cinfo, JERR_BMP_COLORSPACE);
+  }
+
+  /* Calculate output image dimensions so we can allocate space */
+  jpeg_calc_output_dimensions(cinfo);
+
+  /* Determine width of rows in the BMP file (padded to 4-byte boundary). */
+  row_width = cinfo->output_width * cinfo->output_components;
+  dest->data_width = row_width;
+  while ((row_width & 3) != 0) row_width++;
+  dest->row_width = row_width;
+  dest->pad_bytes = (int) (row_width - dest->data_width);
+
+  /* Allocate space for inversion array, prepare for write pass */
+  dest->whole_image = (*cinfo->mem->request_virt_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+     row_width, cinfo->output_height, (JDIMENSION) 1);
+  dest->cur_output_row = 0;
+  if (cinfo->progress != NULL) {
+    cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
+    progress->total_extra_passes++; /* count file input as separate pass */
+  }
+
+  /* Create decompressor output buffer. */
+  dest->pub.buffer = (*cinfo->mem->alloc_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, row_width, (JDIMENSION) 1);
+  dest->pub.buffer_height = 1;
+
+  return (djpeg_dest_ptr) dest;
+}
+
+#endif /* BMP_SUPPORTED */
diff --git a/src/libjpeg/wrgif.c b/src/libjpeg/wrgif.c
new file mode 100644
index 0000000..13f953b
--- /dev/null
+++ b/src/libjpeg/wrgif.c
@@ -0,0 +1,399 @@
+/*
+ * wrgif.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to write output images in GIF format.
+ *
+ **************************************************************************
+ * NOTE: to avoid entanglements with Unisys' patent on LZW compression,   *
+ * this code has been modified to output "uncompressed GIF" files.        *
+ * There is no trace of the LZW algorithm in this file.                   *
+ **************************************************************************
+ *
+ * These routines may need modification for non-Unix environments or
+ * specialized applications.  As they stand, they assume output to
+ * an ordinary stdio stream.
+ */
+
+/*
+ * This code is loosely based on ppmtogif from the PBMPLUS distribution
+ * of Feb. 1991.  That file contains the following copyright notice:
+ *    Based on GIFENCODE by David Rowley <mgardi at watdscu.waterloo.edu>.
+ *    Lempel-Ziv compression based on "compress" by Spencer W. Thomas et al.
+ *    Copyright (C) 1989 by Jef Poskanzer.
+ *    Permission to use, copy, modify, and distribute this software and its
+ *    documentation for any purpose and without fee is hereby granted, provided
+ *    that the above copyright notice appear in all copies and that both that
+ *    copyright notice and this permission notice appear in supporting
+ *    documentation.  This software is provided "as is" without express or
+ *    implied warranty.
+ *
+ * We are also required to state that
+ *    "The Graphics Interchange Format(c) is the Copyright property of
+ *    CompuServe Incorporated. GIF(sm) is a Service Mark property of
+ *    CompuServe Incorporated."
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef GIF_SUPPORTED
+
+
+/* Private version of data destination object */
+
+typedef struct {
+  struct djpeg_dest_struct pub;	/* public fields */
+
+  j_decompress_ptr cinfo;	/* back link saves passing separate parm */
+
+  /* State for packing variable-width codes into a bitstream */
+  int n_bits;			/* current number of bits/code */
+  int maxcode;			/* maximum code, given n_bits */
+  INT32 cur_accum;		/* holds bits not yet output */
+  int cur_bits;			/* # of bits in cur_accum */
+
+  /* State for GIF code assignment */
+  int ClearCode;		/* clear code (doesn't change) */
+  int EOFCode;			/* EOF code (ditto) */
+  int code_counter;		/* counts output symbols */
+
+  /* GIF data packet construction buffer */
+  int bytesinpkt;		/* # of bytes in current packet */
+  char packetbuf[256];		/* workspace for accumulating packet */
+
+} gif_dest_struct;
+
+typedef gif_dest_struct * gif_dest_ptr;
+
+/* Largest value that will fit in N bits */
+#define MAXCODE(n_bits)	((1 << (n_bits)) - 1)
+
+
+/*
+ * Routines to package finished data bytes into GIF data blocks.
+ * A data block consists of a count byte (1..255) and that many data bytes.
+ */
+
+LOCAL(void)
+flush_packet (gif_dest_ptr dinfo)
+/* flush any accumulated data */
+{
+  if (dinfo->bytesinpkt > 0) {	/* never write zero-length packet */
+    dinfo->packetbuf[0] = (char) dinfo->bytesinpkt++;
+    if (JFWRITE(dinfo->pub.output_file, dinfo->packetbuf, dinfo->bytesinpkt)
+	!= (size_t) dinfo->bytesinpkt)
+      ERREXIT(dinfo->cinfo, JERR_FILE_WRITE);
+    dinfo->bytesinpkt = 0;
+  }
+}
+
+
+/* Add a character to current packet; flush to disk if necessary */
+#define CHAR_OUT(dinfo,c)  \
+	{ (dinfo)->packetbuf[++(dinfo)->bytesinpkt] = (char) (c);  \
+	    if ((dinfo)->bytesinpkt >= 255)  \
+	      flush_packet(dinfo);  \
+	}
+
+
+/* Routine to convert variable-width codes into a byte stream */
+
+LOCAL(void)
+output (gif_dest_ptr dinfo, int code)
+/* Emit a code of n_bits bits */
+/* Uses cur_accum and cur_bits to reblock into 8-bit bytes */
+{
+  dinfo->cur_accum |= ((INT32) code) << dinfo->cur_bits;
+  dinfo->cur_bits += dinfo->n_bits;
+
+  while (dinfo->cur_bits >= 8) {
+    CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF);
+    dinfo->cur_accum >>= 8;
+    dinfo->cur_bits -= 8;
+  }
+}
+
+
+/* The pseudo-compression algorithm.
+ *
+ * In this module we simply output each pixel value as a separate symbol;
+ * thus, no compression occurs.  In fact, there is expansion of one bit per
+ * pixel, because we use a symbol width one bit wider than the pixel width.
+ *
+ * GIF ordinarily uses variable-width symbols, and the decoder will expect
+ * to ratchet up the symbol width after a fixed number of symbols.
+ * To simplify the logic and keep the expansion penalty down, we emit a
+ * GIF Clear code to reset the decoder just before the width would ratchet up.
+ * Thus, all the symbols in the output file will have the same bit width.
+ * Note that emitting the Clear codes at the right times is a mere matter of
+ * counting output symbols and is in no way dependent on the LZW patent.
+ *
+ * With a small basic pixel width (low color count), Clear codes will be
+ * needed very frequently, causing the file to expand even more.  So this
+ * simplistic approach wouldn't work too well on bilevel images, for example.
+ * But for output of JPEG conversions the pixel width will usually be 8 bits
+ * (129 to 256 colors), so the overhead added by Clear symbols is only about
+ * one symbol in every 256.
+ */
+
+LOCAL(void)
+compress_init (gif_dest_ptr dinfo, int i_bits)
+/* Initialize pseudo-compressor */
+{
+  /* init all the state variables */
+  dinfo->n_bits = i_bits;
+  dinfo->maxcode = MAXCODE(dinfo->n_bits);
+  dinfo->ClearCode = (1 << (i_bits - 1));
+  dinfo->EOFCode = dinfo->ClearCode + 1;
+  dinfo->code_counter = dinfo->ClearCode + 2;
+  /* init output buffering vars */
+  dinfo->bytesinpkt = 0;
+  dinfo->cur_accum = 0;
+  dinfo->cur_bits = 0;
+  /* GIF specifies an initial Clear code */
+  output(dinfo, dinfo->ClearCode);
+}
+
+
+LOCAL(void)
+compress_pixel (gif_dest_ptr dinfo, int c)
+/* Accept and "compress" one pixel value.
+ * The given value must be less than n_bits wide.
+ */
+{
+  /* Output the given pixel value as a symbol. */
+  output(dinfo, c);
+  /* Issue Clear codes often enough to keep the reader from ratcheting up
+   * its symbol size.
+   */
+  if (dinfo->code_counter < dinfo->maxcode) {
+    dinfo->code_counter++;
+  } else {
+    output(dinfo, dinfo->ClearCode);
+    dinfo->code_counter = dinfo->ClearCode + 2;	/* reset the counter */
+  }
+}
+
+
+LOCAL(void)
+compress_term (gif_dest_ptr dinfo)
+/* Clean up at end */
+{
+  /* Send an EOF code */
+  output(dinfo, dinfo->EOFCode);
+  /* Flush the bit-packing buffer */
+  if (dinfo->cur_bits > 0) {
+    CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF);
+  }
+  /* Flush the packet buffer */
+  flush_packet(dinfo);
+}
+
+
+/* GIF header construction */
+
+
+LOCAL(void)
+put_word (gif_dest_ptr dinfo, unsigned int w)
+/* Emit a 16-bit word, LSB first */
+{
+  putc(w & 0xFF, dinfo->pub.output_file);
+  putc((w >> 8) & 0xFF, dinfo->pub.output_file);
+}
+
+
+LOCAL(void)
+put_3bytes (gif_dest_ptr dinfo, int val)
+/* Emit 3 copies of same byte value --- handy subr for colormap construction */
+{
+  putc(val, dinfo->pub.output_file);
+  putc(val, dinfo->pub.output_file);
+  putc(val, dinfo->pub.output_file);
+}
+
+
+LOCAL(void)
+emit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap)
+/* Output the GIF file header, including color map */
+/* If colormap==NULL, synthesize a gray-scale colormap */
+{
+  int BitsPerPixel, ColorMapSize, InitCodeSize, FlagByte;
+  int cshift = dinfo->cinfo->data_precision - 8;
+  int i;
+
+  if (num_colors > 256)
+    ERREXIT1(dinfo->cinfo, JERR_TOO_MANY_COLORS, num_colors);
+  /* Compute bits/pixel and related values */
+  BitsPerPixel = 1;
+  while (num_colors > (1 << BitsPerPixel))
+    BitsPerPixel++;
+  ColorMapSize = 1 << BitsPerPixel;
+  if (BitsPerPixel <= 1)
+    InitCodeSize = 2;
+  else
+    InitCodeSize = BitsPerPixel;
+  /*
+   * Write the GIF header.
+   * Note that we generate a plain GIF87 header for maximum compatibility.
+   */
+  putc('G', dinfo->pub.output_file);
+  putc('I', dinfo->pub.output_file);
+  putc('F', dinfo->pub.output_file);
+  putc('8', dinfo->pub.output_file);
+  putc('7', dinfo->pub.output_file);
+  putc('a', dinfo->pub.output_file);
+  /* Write the Logical Screen Descriptor */
+  put_word(dinfo, (unsigned int) dinfo->cinfo->output_width);
+  put_word(dinfo, (unsigned int) dinfo->cinfo->output_height);
+  FlagByte = 0x80;		/* Yes, there is a global color table */
+  FlagByte |= (BitsPerPixel-1) << 4; /* color resolution */
+  FlagByte |= (BitsPerPixel-1);	/* size of global color table */
+  putc(FlagByte, dinfo->pub.output_file);
+  putc(0, dinfo->pub.output_file); /* Background color index */
+  putc(0, dinfo->pub.output_file); /* Reserved (aspect ratio in GIF89) */
+  /* Write the Global Color Map */
+  /* If the color map is more than 8 bits precision, */
+  /* we reduce it to 8 bits by shifting */
+  for (i=0; i < ColorMapSize; i++) {
+    if (i < num_colors) {
+      if (colormap != NULL) {
+	if (dinfo->cinfo->out_color_space == JCS_RGB) {
+	  /* Normal case: RGB color map */
+	  putc(GETJSAMPLE(colormap[0][i]) >> cshift, dinfo->pub.output_file);
+	  putc(GETJSAMPLE(colormap[1][i]) >> cshift, dinfo->pub.output_file);
+	  putc(GETJSAMPLE(colormap[2][i]) >> cshift, dinfo->pub.output_file);
+	} else {
+	  /* Grayscale "color map": possible if quantizing grayscale image */
+	  put_3bytes(dinfo, GETJSAMPLE(colormap[0][i]) >> cshift);
+	}
+      } else {
+	/* Create a gray-scale map of num_colors values, range 0..255 */
+	put_3bytes(dinfo, (i * 255 + (num_colors-1)/2) / (num_colors-1));
+      }
+    } else {
+      /* fill out the map to a power of 2 */
+      put_3bytes(dinfo, 0);
+    }
+  }
+  /* Write image separator and Image Descriptor */
+  putc(',', dinfo->pub.output_file); /* separator */
+  put_word(dinfo, 0);		/* left/top offset */
+  put_word(dinfo, 0);
+  put_word(dinfo, (unsigned int) dinfo->cinfo->output_width); /* image size */
+  put_word(dinfo, (unsigned int) dinfo->cinfo->output_height);
+  /* flag byte: not interlaced, no local color map */
+  putc(0x00, dinfo->pub.output_file);
+  /* Write Initial Code Size byte */
+  putc(InitCodeSize, dinfo->pub.output_file);
+
+  /* Initialize for "compression" of image data */
+  compress_init(dinfo, InitCodeSize+1);
+}
+
+
+/*
+ * Startup: write the file header.
+ */
+
+METHODDEF(void)
+start_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
+{
+  gif_dest_ptr dest = (gif_dest_ptr) dinfo;
+
+  if (cinfo->quantize_colors)
+    emit_header(dest, cinfo->actual_number_of_colors, cinfo->colormap);
+  else
+    emit_header(dest, 256, (JSAMPARRAY) NULL);
+}
+
+
+/*
+ * Write some pixel data.
+ * In this module rows_supplied will always be 1.
+ */
+
+METHODDEF(void)
+put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+		JDIMENSION rows_supplied)
+{
+  gif_dest_ptr dest = (gif_dest_ptr) dinfo;
+  register JSAMPROW ptr;
+  register JDIMENSION col;
+
+  ptr = dest->pub.buffer[0];
+  for (col = cinfo->output_width; col > 0; col--) {
+    compress_pixel(dest, GETJSAMPLE(*ptr++));
+  }
+}
+
+
+/*
+ * Finish up at the end of the file.
+ */
+
+METHODDEF(void)
+finish_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
+{
+  gif_dest_ptr dest = (gif_dest_ptr) dinfo;
+
+  /* Flush "compression" mechanism */
+  compress_term(dest);
+  /* Write a zero-length data block to end the series */
+  putc(0, dest->pub.output_file);
+  /* Write the GIF terminator mark */
+  putc(';', dest->pub.output_file);
+  /* Make sure we wrote the output file OK */
+  fflush(dest->pub.output_file);
+  if (ferror(dest->pub.output_file))
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+}
+
+
+/*
+ * The module selection routine for GIF format output.
+ */
+
+GLOBAL(djpeg_dest_ptr)
+jinit_write_gif (j_decompress_ptr cinfo)
+{
+  gif_dest_ptr dest;
+
+  /* Create module interface object, fill in method pointers */
+  dest = (gif_dest_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(gif_dest_struct));
+  dest->cinfo = cinfo;		/* make back link for subroutines */
+  dest->pub.start_output = start_output_gif;
+  dest->pub.put_pixel_rows = put_pixel_rows;
+  dest->pub.finish_output = finish_output_gif;
+
+  if (cinfo->out_color_space != JCS_GRAYSCALE &&
+      cinfo->out_color_space != JCS_RGB)
+    ERREXIT(cinfo, JERR_GIF_COLORSPACE);
+
+  /* Force quantization if color or if > 8 bits input */
+  if (cinfo->out_color_space != JCS_GRAYSCALE || cinfo->data_precision > 8) {
+    /* Force quantization to at most 256 colors */
+    cinfo->quantize_colors = TRUE;
+    if (cinfo->desired_number_of_colors > 256)
+      cinfo->desired_number_of_colors = 256;
+  }
+
+  /* Calculate output image dimensions so we can allocate space */
+  jpeg_calc_output_dimensions(cinfo);
+
+  if (cinfo->output_components != 1) /* safety check: just one component? */
+    ERREXIT(cinfo, JERR_GIF_BUG);
+
+  /* Create decompressor output buffer. */
+  dest->pub.buffer = (*cinfo->mem->alloc_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->output_width, (JDIMENSION) 1);
+  dest->pub.buffer_height = 1;
+
+  return (djpeg_dest_ptr) dest;
+}
+
+#endif /* GIF_SUPPORTED */
diff --git a/src/libjpeg/wrjpgcom.c b/src/libjpeg/wrjpgcom.c
new file mode 100644
index 0000000..7d10ee6
--- /dev/null
+++ b/src/libjpeg/wrjpgcom.c
@@ -0,0 +1,583 @@
+/*
+ * wrjpgcom.c
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a very simple stand-alone application that inserts
+ * user-supplied text as a COM (comment) marker in a JFIF file.
+ * This may be useful as an example of the minimum logic needed to parse
+ * JPEG markers.
+ */
+
+#define JPEG_CJPEG_DJPEG	/* to get the command-line config symbols */
+#include "jinclude.h"		/* get auto-config symbols, <stdio.h> */
+
+#ifndef HAVE_STDLIB_H		/* <stdlib.h> should declare malloc() */
+extern void * malloc ();
+#endif
+#include <ctype.h>		/* to declare isupper(), tolower() */
+#ifdef USE_SETMODE
+#include <fcntl.h>		/* to declare setmode()'s parameter macros */
+/* If you have setmode() but not <io.h>, just delete this line: */
+#include <io.h>			/* to declare setmode() */
+#endif
+
+#ifdef USE_CCOMMAND		/* command-line reader for Macintosh */
+#ifdef __MWERKS__
+#include <SIOUX.h>              /* Metrowerks needs this */
+#include <console.h>		/* ... and this */
+#endif
+#ifdef THINK_C
+#include <console.h>		/* Think declares it here */
+#endif
+#endif
+
+#ifdef DONT_USE_B_MODE		/* define mode parameters for fopen() */
+#define READ_BINARY	"r"
+#define WRITE_BINARY	"w"
+#else
+#ifdef VMS			/* VMS is very nonstandard */
+#define READ_BINARY	"rb", "ctx=stm"
+#define WRITE_BINARY	"wb", "ctx=stm"
+#else				/* standard ANSI-compliant case */
+#define READ_BINARY	"rb"
+#define WRITE_BINARY	"wb"
+#endif
+#endif
+
+#ifndef EXIT_FAILURE		/* define exit() codes if not provided */
+#define EXIT_FAILURE  1
+#endif
+#ifndef EXIT_SUCCESS
+#ifdef VMS
+#define EXIT_SUCCESS  1		/* VMS is very nonstandard */
+#else
+#define EXIT_SUCCESS  0
+#endif
+#endif
+
+/* Reduce this value if your malloc() can't allocate blocks up to 64K.
+ * On DOS, compiling in large model is usually a better solution.
+ */
+
+#ifndef MAX_COM_LENGTH
+#define MAX_COM_LENGTH 65000L	/* must be <= 65533 in any case */
+#endif
+
+
+/*
+ * These macros are used to read the input file and write the output file.
+ * To reuse this code in another application, you might need to change these.
+ */
+
+static FILE * infile;		/* input JPEG file */
+
+/* Return next input byte, or EOF if no more */
+#define NEXTBYTE()  getc(infile)
+
+static FILE * outfile;		/* output JPEG file */
+
+/* Emit an output byte */
+#define PUTBYTE(x)  putc((x), outfile)
+
+
+/* Error exit handler */
+#define ERREXIT(msg)  (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE))
+
+
+/* Read one byte, testing for EOF */
+static int
+read_1_byte (void)
+{
+  int c;
+
+  c = NEXTBYTE();
+  if (c == EOF)
+    ERREXIT("Premature EOF in JPEG file");
+  return c;
+}
+
+/* Read 2 bytes, convert to unsigned int */
+/* All 2-byte quantities in JPEG markers are MSB first */
+static unsigned int
+read_2_bytes (void)
+{
+  int c1, c2;
+
+  c1 = NEXTBYTE();
+  if (c1 == EOF)
+    ERREXIT("Premature EOF in JPEG file");
+  c2 = NEXTBYTE();
+  if (c2 == EOF)
+    ERREXIT("Premature EOF in JPEG file");
+  return (((unsigned int) c1) << 8) + ((unsigned int) c2);
+}
+
+
+/* Routines to write data to output file */
+
+static void
+write_1_byte (int c)
+{
+  PUTBYTE(c);
+}
+
+static void
+write_2_bytes (unsigned int val)
+{
+  PUTBYTE((val >> 8) & 0xFF);
+  PUTBYTE(val & 0xFF);
+}
+
+static void
+write_marker (int marker)
+{
+  PUTBYTE(0xFF);
+  PUTBYTE(marker);
+}
+
+static void
+copy_rest_of_file (void)
+{
+  int c;
+
+  while ((c = NEXTBYTE()) != EOF)
+    PUTBYTE(c);
+}
+
+
+/*
+ * JPEG markers consist of one or more 0xFF bytes, followed by a marker
+ * code byte (which is not an FF).  Here are the marker codes of interest
+ * in this program.  (See jdmarker.c for a more complete list.)
+ */
+
+#define M_SOF0  0xC0		/* Start Of Frame N */
+#define M_SOF1  0xC1		/* N indicates which compression process */
+#define M_SOF2  0xC2		/* Only SOF0-SOF2 are now in common use */
+#define M_SOF3  0xC3
+#define M_SOF5  0xC5		/* NB: codes C4 and CC are NOT SOF markers */
+#define M_SOF6  0xC6
+#define M_SOF7  0xC7
+#define M_SOF9  0xC9
+#define M_SOF10 0xCA
+#define M_SOF11 0xCB
+#define M_SOF13 0xCD
+#define M_SOF14 0xCE
+#define M_SOF15 0xCF
+#define M_SOI   0xD8		/* Start Of Image (beginning of datastream) */
+#define M_EOI   0xD9		/* End Of Image (end of datastream) */
+#define M_SOS   0xDA		/* Start Of Scan (begins compressed data) */
+#define M_COM   0xFE		/* COMment */
+
+
+/*
+ * Find the next JPEG marker and return its marker code.
+ * We expect at least one FF byte, possibly more if the compressor used FFs
+ * to pad the file.  (Padding FFs will NOT be replicated in the output file.)
+ * There could also be non-FF garbage between markers.  The treatment of such
+ * garbage is unspecified; we choose to skip over it but emit a warning msg.
+ * NB: this routine must not be used after seeing SOS marker, since it will
+ * not deal correctly with FF/00 sequences in the compressed image data...
+ */
+
+static int
+next_marker (void)
+{
+  int c;
+  int discarded_bytes = 0;
+
+  /* Find 0xFF byte; count and skip any non-FFs. */
+  c = read_1_byte();
+  while (c != 0xFF) {
+    discarded_bytes++;
+    c = read_1_byte();
+  }
+  /* Get marker code byte, swallowing any duplicate FF bytes.  Extra FFs
+   * are legal as pad bytes, so don't count them in discarded_bytes.
+   */
+  do {
+    c = read_1_byte();
+  } while (c == 0xFF);
+
+  if (discarded_bytes != 0) {
+    fprintf(stderr, "Warning: garbage data found in JPEG file\n");
+  }
+
+  return c;
+}
+
+
+/*
+ * Read the initial marker, which should be SOI.
+ * For a JFIF file, the first two bytes of the file should be literally
+ * 0xFF M_SOI.  To be more general, we could use next_marker, but if the
+ * input file weren't actually JPEG at all, next_marker might read the whole
+ * file and then return a misleading error message...
+ */
+
+static int
+first_marker (void)
+{
+  int c1, c2;
+
+  c1 = NEXTBYTE();
+  c2 = NEXTBYTE();
+  if (c1 != 0xFF || c2 != M_SOI)
+    ERREXIT("Not a JPEG file");
+  return c2;
+}
+
+
+/*
+ * Most types of marker are followed by a variable-length parameter segment.
+ * This routine skips over the parameters for any marker we don't otherwise
+ * want to process.
+ * Note that we MUST skip the parameter segment explicitly in order not to
+ * be fooled by 0xFF bytes that might appear within the parameter segment;
+ * such bytes do NOT introduce new markers.
+ */
+
+static void
+copy_variable (void)
+/* Copy an unknown or uninteresting variable-length marker */
+{
+  unsigned int length;
+
+  /* Get the marker parameter length count */
+  length = read_2_bytes();
+  write_2_bytes(length);
+  /* Length includes itself, so must be at least 2 */
+  if (length < 2)
+    ERREXIT("Erroneous JPEG marker length");
+  length -= 2;
+  /* Skip over the remaining bytes */
+  while (length > 0) {
+    write_1_byte(read_1_byte());
+    length--;
+  }
+}
+
+static void
+skip_variable (void)
+/* Skip over an unknown or uninteresting variable-length marker */
+{
+  unsigned int length;
+
+  /* Get the marker parameter length count */
+  length = read_2_bytes();
+  /* Length includes itself, so must be at least 2 */
+  if (length < 2)
+    ERREXIT("Erroneous JPEG marker length");
+  length -= 2;
+  /* Skip over the remaining bytes */
+  while (length > 0) {
+    (void) read_1_byte();
+    length--;
+  }
+}
+
+
+/*
+ * Parse the marker stream until SOFn or EOI is seen;
+ * copy data to output, but discard COM markers unless keep_COM is true.
+ */
+
+static int
+scan_JPEG_header (int keep_COM)
+{
+  int marker;
+
+  /* Expect SOI at start of file */
+  if (first_marker() != M_SOI)
+    ERREXIT("Expected SOI marker first");
+  write_marker(M_SOI);
+
+  /* Scan miscellaneous markers until we reach SOFn. */
+  for (;;) {
+    marker = next_marker();
+    switch (marker) {
+      /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,
+       * treated as SOFn.  C4 in particular is actually DHT.
+       */
+    case M_SOF0:		/* Baseline */
+    case M_SOF1:		/* Extended sequential, Huffman */
+    case M_SOF2:		/* Progressive, Huffman */
+    case M_SOF3:		/* Lossless, Huffman */
+    case M_SOF5:		/* Differential sequential, Huffman */
+    case M_SOF6:		/* Differential progressive, Huffman */
+    case M_SOF7:		/* Differential lossless, Huffman */
+    case M_SOF9:		/* Extended sequential, arithmetic */
+    case M_SOF10:		/* Progressive, arithmetic */
+    case M_SOF11:		/* Lossless, arithmetic */
+    case M_SOF13:		/* Differential sequential, arithmetic */
+    case M_SOF14:		/* Differential progressive, arithmetic */
+    case M_SOF15:		/* Differential lossless, arithmetic */
+      return marker;
+
+    case M_SOS:			/* should not see compressed data before SOF */
+      ERREXIT("SOS without prior SOFn");
+      break;
+
+    case M_EOI:			/* in case it's a tables-only JPEG stream */
+      return marker;
+
+    case M_COM:			/* Existing COM: conditionally discard */
+      if (keep_COM) {
+	write_marker(marker);
+	copy_variable();
+      } else {
+	skip_variable();
+      }
+      break;
+
+    default:			/* Anything else just gets copied */
+      write_marker(marker);
+      copy_variable();		/* we assume it has a parameter count... */
+      break;
+    }
+  } /* end loop */
+}
+
+
+/* Command line parsing code */
+
+static const char * progname;	/* program name for error messages */
+
+
+static void
+usage (void)
+/* complain about bad command line */
+{
+  fprintf(stderr, "wrjpgcom inserts a textual comment in a JPEG file.\n");
+  fprintf(stderr, "You can add to or replace any existing comment(s).\n");
+
+  fprintf(stderr, "Usage: %s [switches] ", progname);
+#ifdef TWO_FILE_COMMANDLINE
+  fprintf(stderr, "inputfile outputfile\n");
+#else
+  fprintf(stderr, "[inputfile]\n");
+#endif
+
+  fprintf(stderr, "Switches (names may be abbreviated):\n");
+  fprintf(stderr, "  -replace         Delete any existing comments\n");
+  fprintf(stderr, "  -comment \"text\"  Insert comment with given text\n");
+  fprintf(stderr, "  -cfile name      Read comment from named file\n");
+  fprintf(stderr, "Notice that you must put quotes around the comment text\n");
+  fprintf(stderr, "when you use -comment.\n");
+  fprintf(stderr, "If you do not give either -comment or -cfile on the command line,\n");
+  fprintf(stderr, "then the comment text is read from standard input.\n");
+  fprintf(stderr, "It can be multiple lines, up to %u characters total.\n",
+	  (unsigned int) MAX_COM_LENGTH);
+#ifndef TWO_FILE_COMMANDLINE
+  fprintf(stderr, "You must specify an input JPEG file name when supplying\n");
+  fprintf(stderr, "comment text from standard input.\n");
+#endif
+
+  exit(EXIT_FAILURE);
+}
+
+
+static int
+keymatch (char * arg, const char * keyword, int minchars)
+/* Case-insensitive matching of (possibly abbreviated) keyword switches. */
+/* keyword is the constant keyword (must be lower case already), */
+/* minchars is length of minimum legal abbreviation. */
+{
+  register int ca, ck;
+  register int nmatched = 0;
+
+  while ((ca = *arg++) != '\0') {
+    if ((ck = *keyword++) == '\0')
+      return 0;			/* arg longer than keyword, no good */
+    if (isupper(ca))		/* force arg to lcase (assume ck is already) */
+      ca = tolower(ca);
+    if (ca != ck)
+      return 0;			/* no good */
+    nmatched++;			/* count matched characters */
+  }
+  /* reached end of argument; fail if it's too short for unique abbrev */
+  if (nmatched < minchars)
+    return 0;
+  return 1;			/* A-OK */
+}
+
+
+/*
+ * The main program.
+ */
+
+int
+main (int argc, char **argv)
+{
+  int argn;
+  char * arg;
+  int keep_COM = 1;
+  char * comment_arg = NULL;
+  FILE * comment_file = NULL;
+  unsigned int comment_length = 0;
+  int marker;
+
+  /* On Mac, fetch a command line. */
+#ifdef USE_CCOMMAND
+  argc = ccommand(&argv);
+#endif
+
+  progname = argv[0];
+  if (progname == NULL || progname[0] == 0)
+    progname = "wrjpgcom";	/* in case C library doesn't provide it */
+
+  /* Parse switches, if any */
+  for (argn = 1; argn < argc; argn++) {
+    arg = argv[argn];
+    if (arg[0] != '-')
+      break;			/* not switch, must be file name */
+    arg++;			/* advance over '-' */
+    if (keymatch(arg, "replace", 1)) {
+      keep_COM = 0;
+    } else if (keymatch(arg, "cfile", 2)) {
+      if (++argn >= argc) usage();
+      if ((comment_file = fopen(argv[argn], "r")) == NULL) {
+	fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
+	exit(EXIT_FAILURE);
+      }
+    } else if (keymatch(arg, "comment", 1)) {
+      if (++argn >= argc) usage();
+      comment_arg = argv[argn];
+      /* If the comment text starts with '"', then we are probably running
+       * under MS-DOG and must parse out the quoted string ourselves.  Sigh.
+       */
+      if (comment_arg[0] == '"') {
+	comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);
+	if (comment_arg == NULL)
+	  ERREXIT("Insufficient memory");
+	strcpy(comment_arg, argv[argn]+1);
+	for (;;) {
+	  comment_length = (unsigned int) strlen(comment_arg);
+	  if (comment_length > 0 && comment_arg[comment_length-1] == '"') {
+	    comment_arg[comment_length-1] = '\0'; /* zap terminating quote */
+	    break;
+	  }
+	  if (++argn >= argc)
+	    ERREXIT("Missing ending quote mark");
+	  strcat(comment_arg, " ");
+	  strcat(comment_arg, argv[argn]);
+	}
+      }
+      comment_length = (unsigned int) strlen(comment_arg);
+    } else
+      usage();
+  }
+
+  /* Cannot use both -comment and -cfile. */
+  if (comment_arg != NULL && comment_file != NULL)
+    usage();
+  /* If there is neither -comment nor -cfile, we will read the comment text
+   * from stdin; in this case there MUST be an input JPEG file name.
+   */
+  if (comment_arg == NULL && comment_file == NULL && argn >= argc)
+    usage();
+
+  /* Open the input file. */
+  if (argn < argc) {
+    if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {
+      fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
+      exit(EXIT_FAILURE);
+    }
+  } else {
+    /* default input file is stdin */
+#ifdef USE_SETMODE		/* need to hack file mode? */
+    setmode(fileno(stdin), O_BINARY);
+#endif
+#ifdef USE_FDOPEN		/* need to re-open in binary mode? */
+    if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) {
+      fprintf(stderr, "%s: can't open stdin\n", progname);
+      exit(EXIT_FAILURE);
+    }
+#else
+    infile = stdin;
+#endif
+  }
+
+  /* Open the output file. */
+#ifdef TWO_FILE_COMMANDLINE
+  /* Must have explicit output file name */
+  if (argn != argc-2) {
+    fprintf(stderr, "%s: must name one input and one output file\n",
+	    progname);
+    usage();
+  }
+  if ((outfile = fopen(argv[argn+1], WRITE_BINARY)) == NULL) {
+    fprintf(stderr, "%s: can't open %s\n", progname, argv[argn+1]);
+    exit(EXIT_FAILURE);
+  }
+#else
+  /* Unix style: expect zero or one file name */
+  if (argn < argc-1) {
+    fprintf(stderr, "%s: only one input file\n", progname);
+    usage();
+  }
+  /* default output file is stdout */
+#ifdef USE_SETMODE		/* need to hack file mode? */
+  setmode(fileno(stdout), O_BINARY);
+#endif
+#ifdef USE_FDOPEN		/* need to re-open in binary mode? */
+  if ((outfile = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {
+    fprintf(stderr, "%s: can't open stdout\n", progname);
+    exit(EXIT_FAILURE);
+  }
+#else
+  outfile = stdout;
+#endif
+#endif /* TWO_FILE_COMMANDLINE */
+
+  /* Collect comment text from comment_file or stdin, if necessary */
+  if (comment_arg == NULL) {
+    FILE * src_file;
+    int c;
+
+    comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);
+    if (comment_arg == NULL)
+      ERREXIT("Insufficient memory");
+    comment_length = 0;
+    src_file = (comment_file != NULL ? comment_file : stdin);
+    while ((c = getc(src_file)) != EOF) {
+      if (comment_length >= (unsigned int) MAX_COM_LENGTH) {
+	fprintf(stderr, "Comment text may not exceed %u bytes\n",
+		(unsigned int) MAX_COM_LENGTH);
+	exit(EXIT_FAILURE);
+      }
+      comment_arg[comment_length++] = (char) c;
+    }
+    if (comment_file != NULL)
+      fclose(comment_file);
+  }
+
+  /* Copy JPEG headers until SOFn marker;
+   * we will insert the new comment marker just before SOFn.
+   * This (a) causes the new comment to appear after, rather than before,
+   * existing comments; and (b) ensures that comments come after any JFIF
+   * or JFXX markers, as required by the JFIF specification.
+   */
+  marker = scan_JPEG_header(keep_COM);
+  /* Insert the new COM marker, but only if nonempty text has been supplied */
+  if (comment_length > 0) {
+    write_marker(M_COM);
+    write_2_bytes(comment_length + 2);
+    while (comment_length > 0) {
+      write_1_byte(*comment_arg++);
+      comment_length--;
+    }
+  }
+  /* Duplicate the remainder of the source file.
+   * Note that any COM markers occuring after SOF will not be touched.
+   */
+  write_marker(marker);
+  copy_rest_of_file();
+
+  /* All done. */
+  exit(EXIT_SUCCESS);
+  return 0;			/* suppress no-return-value warnings */
+}
diff --git a/src/libjpeg/wrppm.c b/src/libjpeg/wrppm.c
new file mode 100644
index 0000000..cfd4160
--- /dev/null
+++ b/src/libjpeg/wrppm.c
@@ -0,0 +1,268 @@
+/*
+ * wrppm.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to write output images in PPM/PGM format.
+ * The extended 2-byte-per-sample raw PPM/PGM formats are supported.
+ * The PBMPLUS library is NOT required to compile this software
+ * (but it is highly useful as a set of PPM image manipulation programs).
+ *
+ * These routines may need modification for non-Unix environments or
+ * specialized applications.  As they stand, they assume output to
+ * an ordinary stdio stream.
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef PPM_SUPPORTED
+
+
+/*
+ * For 12-bit JPEG data, we either downscale the values to 8 bits
+ * (to write standard byte-per-sample PPM/PGM files), or output
+ * nonstandard word-per-sample PPM/PGM files.  Downscaling is done
+ * if PPM_NORAWWORD is defined (this can be done in the Makefile
+ * or in jconfig.h).
+ * (When the core library supports data precision reduction, a cleaner
+ * implementation will be to ask for that instead.)
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define PUTPPMSAMPLE(ptr,v)  *ptr++ = (char) (v)
+#define BYTESPERSAMPLE 1
+#define PPM_MAXVAL 255
+#else
+#ifdef PPM_NORAWWORD
+#define PUTPPMSAMPLE(ptr,v)  *ptr++ = (char) ((v) >> (BITS_IN_JSAMPLE-8))
+#define BYTESPERSAMPLE 1
+#define PPM_MAXVAL 255
+#else
+/* The word-per-sample format always puts the LSB first. */
+#define PUTPPMSAMPLE(ptr,v)			\
+	{ register int val_ = v;		\
+	  *ptr++ = (char) (val_ & 0xFF);	\
+	  *ptr++ = (char) ((val_ >> 8) & 0xFF);	\
+	}
+#define BYTESPERSAMPLE 2
+#define PPM_MAXVAL ((1<<BITS_IN_JSAMPLE)-1)
+#endif
+#endif
+
+
+/*
+ * When JSAMPLE is the same size as char, we can just fwrite() the
+ * decompressed data to the PPM or PGM file.  On PCs, in order to make this
+ * work the output buffer must be allocated in near data space, because we are
+ * assuming small-data memory model wherein fwrite() can't reach far memory.
+ * If you need to process very wide images on a PC, you might have to compile
+ * in large-memory model, or else replace fwrite() with a putc() loop ---
+ * which will be much slower.
+ */
+
+
+/* Private version of data destination object */
+
+typedef struct {
+  struct djpeg_dest_struct pub;	/* public fields */
+
+  /* Usually these two pointers point to the same place: */
+  char *iobuffer;		/* fwrite's I/O buffer */
+  JSAMPROW pixrow;		/* decompressor output buffer */
+  size_t buffer_width;		/* width of I/O buffer */
+  JDIMENSION samples_per_row;	/* JSAMPLEs per output row */
+} ppm_dest_struct;
+
+typedef ppm_dest_struct * ppm_dest_ptr;
+
+
+/*
+ * Write some pixel data.
+ * In this module rows_supplied will always be 1.
+ *
+ * put_pixel_rows handles the "normal" 8-bit case where the decompressor
+ * output buffer is physically the same as the fwrite buffer.
+ */
+
+METHODDEF(void)
+put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+		JDIMENSION rows_supplied)
+{
+  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
+
+  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
+}
+
+
+/*
+ * This code is used when we have to copy the data and apply a pixel
+ * format translation.  Typically this only happens in 12-bit mode.
+ */
+
+METHODDEF(void)
+copy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+		 JDIMENSION rows_supplied)
+{
+  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
+  register char * bufferptr;
+  register JSAMPROW ptr;
+  register JDIMENSION col;
+
+  ptr = dest->pub.buffer[0];
+  bufferptr = dest->iobuffer;
+  for (col = dest->samples_per_row; col > 0; col--) {
+    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(*ptr++));
+  }
+  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
+}
+
+
+/*
+ * Write some pixel data when color quantization is in effect.
+ * We have to demap the color index values to straight data.
+ */
+
+METHODDEF(void)
+put_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+		  JDIMENSION rows_supplied)
+{
+  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
+  register char * bufferptr;
+  register int pixval;
+  register JSAMPROW ptr;
+  register JSAMPROW color_map0 = cinfo->colormap[0];
+  register JSAMPROW color_map1 = cinfo->colormap[1];
+  register JSAMPROW color_map2 = cinfo->colormap[2];
+  register JDIMENSION col;
+
+  ptr = dest->pub.buffer[0];
+  bufferptr = dest->iobuffer;
+  for (col = cinfo->output_width; col > 0; col--) {
+    pixval = GETJSAMPLE(*ptr++);
+    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map0[pixval]));
+    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map1[pixval]));
+    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map2[pixval]));
+  }
+  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
+}
+
+
+METHODDEF(void)
+put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+		   JDIMENSION rows_supplied)
+{
+  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
+  register char * bufferptr;
+  register JSAMPROW ptr;
+  register JSAMPROW color_map = cinfo->colormap[0];
+  register JDIMENSION col;
+
+  ptr = dest->pub.buffer[0];
+  bufferptr = dest->iobuffer;
+  for (col = cinfo->output_width; col > 0; col--) {
+    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map[GETJSAMPLE(*ptr++)]));
+  }
+  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
+}
+
+
+/*
+ * Startup: write the file header.
+ */
+
+METHODDEF(void)
+start_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
+{
+  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
+
+  /* Emit file header */
+  switch (cinfo->out_color_space) {
+  case JCS_GRAYSCALE:
+    /* emit header for raw PGM format */
+    fprintf(dest->pub.output_file, "P5\n%ld %ld\n%d\n",
+	    (long) cinfo->output_width, (long) cinfo->output_height,
+	    PPM_MAXVAL);
+    break;
+  case JCS_RGB:
+    /* emit header for raw PPM format */
+    fprintf(dest->pub.output_file, "P6\n%ld %ld\n%d\n",
+	    (long) cinfo->output_width, (long) cinfo->output_height,
+	    PPM_MAXVAL);
+    break;
+  default:
+    ERREXIT(cinfo, JERR_PPM_COLORSPACE);
+  }
+}
+
+
+/*
+ * Finish up at the end of the file.
+ */
+
+METHODDEF(void)
+finish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
+{
+  /* Make sure we wrote the output file OK */
+  fflush(dinfo->output_file);
+  if (ferror(dinfo->output_file))
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+}
+
+
+/*
+ * The module selection routine for PPM format output.
+ */
+
+GLOBAL(djpeg_dest_ptr)
+jinit_write_ppm (j_decompress_ptr cinfo)
+{
+  ppm_dest_ptr dest;
+
+  /* Create module interface object, fill in method pointers */
+  dest = (ppm_dest_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(ppm_dest_struct));
+  dest->pub.start_output = start_output_ppm;
+  dest->pub.finish_output = finish_output_ppm;
+
+  /* Calculate output image dimensions so we can allocate space */
+  jpeg_calc_output_dimensions(cinfo);
+
+  /* Create physical I/O buffer.  Note we make this near on a PC. */
+  dest->samples_per_row = cinfo->output_width * cinfo->out_color_components;
+  dest->buffer_width = dest->samples_per_row * (BYTESPERSAMPLE * SIZEOF(char));
+  dest->iobuffer = (char *) (*cinfo->mem->alloc_small)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width);
+
+  if (cinfo->quantize_colors || BITS_IN_JSAMPLE != 8 ||
+      SIZEOF(JSAMPLE) != SIZEOF(char)) {
+    /* When quantizing, we need an output buffer for colormap indexes
+     * that's separate from the physical I/O buffer.  We also need a
+     * separate buffer if pixel format translation must take place.
+     */
+    dest->pub.buffer = (*cinfo->mem->alloc_sarray)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE,
+       cinfo->output_width * cinfo->output_components, (JDIMENSION) 1);
+    dest->pub.buffer_height = 1;
+    if (! cinfo->quantize_colors)
+      dest->pub.put_pixel_rows = copy_pixel_rows;
+    else if (cinfo->out_color_space == JCS_GRAYSCALE)
+      dest->pub.put_pixel_rows = put_demapped_gray;
+    else
+      dest->pub.put_pixel_rows = put_demapped_rgb;
+  } else {
+    /* We will fwrite() directly from decompressor output buffer. */
+    /* Synthesize a JSAMPARRAY pointer structure */
+    /* Cast here implies near->far pointer conversion on PCs */
+    dest->pixrow = (JSAMPROW) dest->iobuffer;
+    dest->pub.buffer = & dest->pixrow;
+    dest->pub.buffer_height = 1;
+    dest->pub.put_pixel_rows = put_pixel_rows;
+  }
+
+  return (djpeg_dest_ptr) dest;
+}
+
+#endif /* PPM_SUPPORTED */
diff --git a/src/libjpeg/wrrle.c b/src/libjpeg/wrrle.c
new file mode 100644
index 0000000..7a00c0d
--- /dev/null
+++ b/src/libjpeg/wrrle.c
@@ -0,0 +1,305 @@
+/*
+ * wrrle.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to write output images in RLE format.
+ * The Utah Raster Toolkit library is required (version 3.1 or later).
+ *
+ * These routines may need modification for non-Unix environments or
+ * specialized applications.  As they stand, they assume output to
+ * an ordinary stdio stream.
+ *
+ * Based on code contributed by Mike Lijewski,
+ * with updates from Robert Hutchinson.
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef RLE_SUPPORTED
+
+/* rle.h is provided by the Utah Raster Toolkit. */
+
+#include <rle.h>
+
+/*
+ * We assume that JSAMPLE has the same representation as rle_pixel,
+ * to wit, "unsigned char".  Hence we can't cope with 12- or 16-bit samples.
+ */
+
+#if BITS_IN_JSAMPLE != 8
+  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */
+#endif
+
+
+/*
+ * Since RLE stores scanlines bottom-to-top, we have to invert the image
+ * from JPEG's top-to-bottom order.  To do this, we save the outgoing data
+ * in a virtual array during put_pixel_row calls, then actually emit the
+ * RLE file during finish_output.
+ */
+
+
+/*
+ * For now, if we emit an RLE color map then it is always 256 entries long,
+ * though not all of the entries need be used.
+ */
+
+#define CMAPBITS	8
+#define CMAPLENGTH	(1<<(CMAPBITS))
+
+typedef struct {
+  struct djpeg_dest_struct pub; /* public fields */
+
+  jvirt_sarray_ptr image;	/* virtual array to store the output image */
+  rle_map *colormap;	 	/* RLE-style color map, or NULL if none */
+  rle_pixel **rle_row;		/* To pass rows to rle_putrow() */
+
+} rle_dest_struct;
+
+typedef rle_dest_struct * rle_dest_ptr;
+
+/* Forward declarations */
+METHODDEF(void) rle_put_pixel_rows
+    JPP((j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+	 JDIMENSION rows_supplied));
+
+
+/*
+ * Write the file header.
+ *
+ * In this module it's easier to wait till finish_output to write anything.
+ */
+
+METHODDEF(void)
+start_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
+{
+  rle_dest_ptr dest = (rle_dest_ptr) dinfo;
+  size_t cmapsize;
+  int i, ci;
+#ifdef PROGRESS_REPORT
+  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
+#endif
+
+  /*
+   * Make sure the image can be stored in RLE format.
+   *
+   * - RLE stores image dimensions as *signed* 16 bit integers.  JPEG
+   *   uses unsigned, so we have to check the width.
+   *
+   * - Colorspace is expected to be grayscale or RGB.
+   *
+   * - The number of channels (components) is expected to be 1 (grayscale/
+   *   pseudocolor) or 3 (truecolor/directcolor).
+   *   (could be 2 or 4 if using an alpha channel, but we aren't)
+   */
+
+  if (cinfo->output_width > 32767 || cinfo->output_height > 32767)
+    ERREXIT2(cinfo, JERR_RLE_DIMENSIONS, cinfo->output_width, 
+	     cinfo->output_height);
+
+  if (cinfo->out_color_space != JCS_GRAYSCALE &&
+      cinfo->out_color_space != JCS_RGB)
+    ERREXIT(cinfo, JERR_RLE_COLORSPACE);
+
+  if (cinfo->output_components != 1 && cinfo->output_components != 3)
+    ERREXIT1(cinfo, JERR_RLE_TOOMANYCHANNELS, cinfo->num_components);
+
+  /* Convert colormap, if any, to RLE format. */
+
+  dest->colormap = NULL;
+
+  if (cinfo->quantize_colors) {
+    /* Allocate storage for RLE-style cmap, zero any extra entries */
+    cmapsize = cinfo->out_color_components * CMAPLENGTH * SIZEOF(rle_map);
+    dest->colormap = (rle_map *) (*cinfo->mem->alloc_small)
+      ((j_common_ptr) cinfo, JPOOL_IMAGE, cmapsize);
+    MEMZERO(dest->colormap, cmapsize);
+
+    /* Save away data in RLE format --- note 8-bit left shift! */
+    /* Shifting would need adjustment for JSAMPLEs wider than 8 bits. */
+    for (ci = 0; ci < cinfo->out_color_components; ci++) {
+      for (i = 0; i < cinfo->actual_number_of_colors; i++) {
+        dest->colormap[ci * CMAPLENGTH + i] =
+          GETJSAMPLE(cinfo->colormap[ci][i]) << 8;
+      }
+    }
+  }
+
+  /* Set the output buffer to the first row */
+  dest->pub.buffer = (*cinfo->mem->access_virt_sarray)
+    ((j_common_ptr) cinfo, dest->image, (JDIMENSION) 0, (JDIMENSION) 1, TRUE);
+  dest->pub.buffer_height = 1;
+
+  dest->pub.put_pixel_rows = rle_put_pixel_rows;
+
+#ifdef PROGRESS_REPORT
+  if (progress != NULL) {
+    progress->total_extra_passes++;  /* count file writing as separate pass */
+  }
+#endif
+}
+
+
+/*
+ * Write some pixel data.
+ *
+ * This routine just saves the data away in a virtual array.
+ */
+
+METHODDEF(void)
+rle_put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+		    JDIMENSION rows_supplied)
+{
+  rle_dest_ptr dest = (rle_dest_ptr) dinfo;
+
+  if (cinfo->output_scanline < cinfo->output_height) {
+    dest->pub.buffer = (*cinfo->mem->access_virt_sarray)
+      ((j_common_ptr) cinfo, dest->image,
+       cinfo->output_scanline, (JDIMENSION) 1, TRUE);
+  }
+}
+
+/*
+ * Finish up at the end of the file.
+ *
+ * Here is where we really output the RLE file.
+ */
+
+METHODDEF(void)
+finish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
+{
+  rle_dest_ptr dest = (rle_dest_ptr) dinfo;
+  rle_hdr header;		/* Output file information */
+  rle_pixel **rle_row, *red, *green, *blue;
+  JSAMPROW output_row;
+  char cmapcomment[80];
+  int row, col;
+  int ci;
+#ifdef PROGRESS_REPORT
+  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
+#endif
+
+  /* Initialize the header info */
+  header = *rle_hdr_init(NULL);
+  header.rle_file = dest->pub.output_file;
+  header.xmin     = 0;
+  header.xmax     = cinfo->output_width  - 1;
+  header.ymin     = 0;
+  header.ymax     = cinfo->output_height - 1;
+  header.alpha    = 0;
+  header.ncolors  = cinfo->output_components;
+  for (ci = 0; ci < cinfo->output_components; ci++) {
+    RLE_SET_BIT(header, ci);
+  }
+  if (cinfo->quantize_colors) {
+    header.ncmap   = cinfo->out_color_components;
+    header.cmaplen = CMAPBITS;
+    header.cmap    = dest->colormap;
+    /* Add a comment to the output image with the true colormap length. */
+    sprintf(cmapcomment, "color_map_length=%d", cinfo->actual_number_of_colors);
+    rle_putcom(cmapcomment, &header);
+  }
+
+  /* Emit the RLE header and color map (if any) */
+  rle_put_setup(&header);
+
+  /* Now output the RLE data from our virtual array.
+   * We assume here that (a) rle_pixel is represented the same as JSAMPLE,
+   * and (b) we are not on a machine where FAR pointers differ from regular.
+   */
+
+#ifdef PROGRESS_REPORT
+  if (progress != NULL) {
+    progress->pub.pass_limit = cinfo->output_height;
+    progress->pub.pass_counter = 0;
+    (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
+  }
+#endif
+
+  if (cinfo->output_components == 1) {
+    for (row = cinfo->output_height-1; row >= 0; row--) {
+      rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)
+        ((j_common_ptr) cinfo, dest->image,
+	 (JDIMENSION) row, (JDIMENSION) 1, FALSE);
+      rle_putrow(rle_row, (int) cinfo->output_width, &header);
+#ifdef PROGRESS_REPORT
+      if (progress != NULL) {
+        progress->pub.pass_counter++;
+        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
+      }
+#endif
+    }
+  } else {
+    for (row = cinfo->output_height-1; row >= 0; row--) {
+      rle_row = (rle_pixel **) dest->rle_row;
+      output_row = * (*cinfo->mem->access_virt_sarray)
+        ((j_common_ptr) cinfo, dest->image,
+	 (JDIMENSION) row, (JDIMENSION) 1, FALSE);
+      red = rle_row[0];
+      green = rle_row[1];
+      blue = rle_row[2];
+      for (col = cinfo->output_width; col > 0; col--) {
+        *red++ = GETJSAMPLE(*output_row++);
+        *green++ = GETJSAMPLE(*output_row++);
+        *blue++ = GETJSAMPLE(*output_row++);
+      }
+      rle_putrow(rle_row, (int) cinfo->output_width, &header);
+#ifdef PROGRESS_REPORT
+      if (progress != NULL) {
+        progress->pub.pass_counter++;
+        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
+      }
+#endif
+    }
+  }
+
+#ifdef PROGRESS_REPORT
+  if (progress != NULL)
+    progress->completed_extra_passes++;
+#endif
+
+  /* Emit file trailer */
+  rle_puteof(&header);
+  fflush(dest->pub.output_file);
+  if (ferror(dest->pub.output_file))
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+}
+
+
+/*
+ * The module selection routine for RLE format output.
+ */
+
+GLOBAL(djpeg_dest_ptr)
+jinit_write_rle (j_decompress_ptr cinfo)
+{
+  rle_dest_ptr dest;
+
+  /* Create module interface object, fill in method pointers */
+  dest = (rle_dest_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+                                  SIZEOF(rle_dest_struct));
+  dest->pub.start_output = start_output_rle;
+  dest->pub.finish_output = finish_output_rle;
+
+  /* Calculate output image dimensions so we can allocate space */
+  jpeg_calc_output_dimensions(cinfo);
+
+  /* Allocate a work array for output to the RLE library. */
+  dest->rle_row = (*cinfo->mem->alloc_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE,
+     cinfo->output_width, (JDIMENSION) cinfo->output_components);
+
+  /* Allocate a virtual array to hold the image. */
+  dest->image = (*cinfo->mem->request_virt_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+     (JDIMENSION) (cinfo->output_width * cinfo->output_components),
+     cinfo->output_height, (JDIMENSION) 1);
+
+  return (djpeg_dest_ptr) dest;
+}
+
+#endif /* RLE_SUPPORTED */
diff --git a/src/libjpeg/wrtarga.c b/src/libjpeg/wrtarga.c
new file mode 100644
index 0000000..6566273
--- /dev/null
+++ b/src/libjpeg/wrtarga.c
@@ -0,0 +1,253 @@
+/*
+ * wrtarga.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to write output images in Targa format.
+ *
+ * These routines may need modification for non-Unix environments or
+ * specialized applications.  As they stand, they assume output to
+ * an ordinary stdio stream.
+ *
+ * Based on code contributed by Lee Daniel Crocker.
+ */
+
+#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
+
+#ifdef TARGA_SUPPORTED
+
+
+/*
+ * To support 12-bit JPEG data, we'd have to scale output down to 8 bits.
+ * This is not yet implemented.
+ */
+
+#if BITS_IN_JSAMPLE != 8
+  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */
+#endif
+
+/*
+ * The output buffer needs to be writable by fwrite().  On PCs, we must
+ * allocate the buffer in near data space, because we are assuming small-data
+ * memory model, wherein fwrite() can't reach far memory.  If you need to
+ * process very wide images on a PC, you might have to compile in large-memory
+ * model, or else replace fwrite() with a putc() loop --- which will be much
+ * slower.
+ */
+
+
+/* Private version of data destination object */
+
+typedef struct {
+  struct djpeg_dest_struct pub;	/* public fields */
+
+  char *iobuffer;		/* physical I/O buffer */
+  JDIMENSION buffer_width;	/* width of one row */
+} tga_dest_struct;
+
+typedef tga_dest_struct * tga_dest_ptr;
+
+
+LOCAL(void)
+write_header (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, int num_colors)
+/* Create and write a Targa header */
+{
+  char targaheader[18];
+
+  /* Set unused fields of header to 0 */
+  MEMZERO(targaheader, SIZEOF(targaheader));
+
+  if (num_colors > 0) {
+    targaheader[1] = 1;		/* color map type 1 */
+    targaheader[5] = (char) (num_colors & 0xFF);
+    targaheader[6] = (char) (num_colors >> 8);
+    targaheader[7] = 24;	/* 24 bits per cmap entry */
+  }
+
+  targaheader[12] = (char) (cinfo->output_width & 0xFF);
+  targaheader[13] = (char) (cinfo->output_width >> 8);
+  targaheader[14] = (char) (cinfo->output_height & 0xFF);
+  targaheader[15] = (char) (cinfo->output_height >> 8);
+  targaheader[17] = 0x20;	/* Top-down, non-interlaced */
+
+  if (cinfo->out_color_space == JCS_GRAYSCALE) {
+    targaheader[2] = 3;		/* image type = uncompressed gray-scale */
+    targaheader[16] = 8;	/* bits per pixel */
+  } else {			/* must be RGB */
+    if (num_colors > 0) {
+      targaheader[2] = 1;	/* image type = colormapped RGB */
+      targaheader[16] = 8;
+    } else {
+      targaheader[2] = 2;	/* image type = uncompressed RGB */
+      targaheader[16] = 24;
+    }
+  }
+
+  if (JFWRITE(dinfo->output_file, targaheader, 18) != (size_t) 18)
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+}
+
+
+/*
+ * Write some pixel data.
+ * In this module rows_supplied will always be 1.
+ */
+
+METHODDEF(void)
+put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+		JDIMENSION rows_supplied)
+/* used for unquantized full-color output */
+{
+  tga_dest_ptr dest = (tga_dest_ptr) dinfo;
+  register JSAMPROW inptr;
+  register char * outptr;
+  register JDIMENSION col;
+
+  inptr = dest->pub.buffer[0];
+  outptr = dest->iobuffer;
+  for (col = cinfo->output_width; col > 0; col--) {
+    outptr[0] = (char) GETJSAMPLE(inptr[2]); /* RGB to BGR order */
+    outptr[1] = (char) GETJSAMPLE(inptr[1]);
+    outptr[2] = (char) GETJSAMPLE(inptr[0]);
+    inptr += 3, outptr += 3;
+  }
+  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
+}
+
+METHODDEF(void)
+put_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+	       JDIMENSION rows_supplied)
+/* used for grayscale OR quantized color output */
+{
+  tga_dest_ptr dest = (tga_dest_ptr) dinfo;
+  register JSAMPROW inptr;
+  register char * outptr;
+  register JDIMENSION col;
+
+  inptr = dest->pub.buffer[0];
+  outptr = dest->iobuffer;
+  for (col = cinfo->output_width; col > 0; col--) {
+    *outptr++ = (char) GETJSAMPLE(*inptr++);
+  }
+  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
+}
+
+
+/*
+ * Write some demapped pixel data when color quantization is in effect.
+ * For Targa, this is only applied to grayscale data.
+ */
+
+METHODDEF(void)
+put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
+		   JDIMENSION rows_supplied)
+{
+  tga_dest_ptr dest = (tga_dest_ptr) dinfo;
+  register JSAMPROW inptr;
+  register char * outptr;
+  register JSAMPROW color_map0 = cinfo->colormap[0];
+  register JDIMENSION col;
+
+  inptr = dest->pub.buffer[0];
+  outptr = dest->iobuffer;
+  for (col = cinfo->output_width; col > 0; col--) {
+    *outptr++ = (char) GETJSAMPLE(color_map0[GETJSAMPLE(*inptr++)]);
+  }
+  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
+}
+
+
+/*
+ * Startup: write the file header.
+ */
+
+METHODDEF(void)
+start_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
+{
+  tga_dest_ptr dest = (tga_dest_ptr) dinfo;
+  int num_colors, i;
+  FILE *outfile;
+
+  if (cinfo->out_color_space == JCS_GRAYSCALE) {
+    /* Targa doesn't have a mapped grayscale format, so we will */
+    /* demap quantized gray output.  Never emit a colormap. */
+    write_header(cinfo, dinfo, 0);
+    if (cinfo->quantize_colors)
+      dest->pub.put_pixel_rows = put_demapped_gray;
+    else
+      dest->pub.put_pixel_rows = put_gray_rows;
+  } else if (cinfo->out_color_space == JCS_RGB) {
+    if (cinfo->quantize_colors) {
+      /* We only support 8-bit colormap indexes, so only 256 colors */
+      num_colors = cinfo->actual_number_of_colors;
+      if (num_colors > 256)
+	ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, num_colors);
+      write_header(cinfo, dinfo, num_colors);
+      /* Write the colormap.  Note Targa uses BGR byte order */
+      outfile = dest->pub.output_file;
+      for (i = 0; i < num_colors; i++) {
+	putc(GETJSAMPLE(cinfo->colormap[2][i]), outfile);
+	putc(GETJSAMPLE(cinfo->colormap[1][i]), outfile);
+	putc(GETJSAMPLE(cinfo->colormap[0][i]), outfile);
+      }
+      dest->pub.put_pixel_rows = put_gray_rows;
+    } else {
+      write_header(cinfo, dinfo, 0);
+      dest->pub.put_pixel_rows = put_pixel_rows;
+    }
+  } else {
+    ERREXIT(cinfo, JERR_TGA_COLORSPACE);
+  }
+}
+
+
+/*
+ * Finish up at the end of the file.
+ */
+
+METHODDEF(void)
+finish_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
+{
+  /* Make sure we wrote the output file OK */
+  fflush(dinfo->output_file);
+  if (ferror(dinfo->output_file))
+    ERREXIT(cinfo, JERR_FILE_WRITE);
+}
+
+
+/*
+ * The module selection routine for Targa format output.
+ */
+
+GLOBAL(djpeg_dest_ptr)
+jinit_write_targa (j_decompress_ptr cinfo)
+{
+  tga_dest_ptr dest;
+
+  /* Create module interface object, fill in method pointers */
+  dest = (tga_dest_ptr)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				  SIZEOF(tga_dest_struct));
+  dest->pub.start_output = start_output_tga;
+  dest->pub.finish_output = finish_output_tga;
+
+  /* Calculate output image dimensions so we can allocate space */
+  jpeg_calc_output_dimensions(cinfo);
+
+  /* Create I/O buffer.  Note we make this near on a PC. */
+  dest->buffer_width = cinfo->output_width * cinfo->output_components;
+  dest->iobuffer = (char *)
+    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+				(size_t) (dest->buffer_width * SIZEOF(char)));
+
+  /* Create decompressor output buffer. */
+  dest->pub.buffer = (*cinfo->mem->alloc_sarray)
+    ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width, (JDIMENSION) 1);
+  dest->pub.buffer_height = 1;
+
+  return (djpeg_dest_ptr) dest;
+}
+
+#endif /* TARGA_SUPPORTED */
diff --git a/src/libspl/include/spl_mutex.h b/src/libspl/include/spl_mutex.h
new file mode 100644
index 0000000..1073bba
--- /dev/null
+++ b/src/libspl/include/spl_mutex.h
@@ -0,0 +1,141 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Ren� Stuhr (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_mutex.h
+/// @version	1.0
+/// @brief		Cross platform mutex class.
+/// @author		Ren� Stuhr
+/// @remarks	All thread safe classes of SPL are derivated from this class. 
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_MUTEX_H__
+#define		__SPL_MUTEX_H__
+
+#ifndef		__SPL_PLATFORM_H__
+#include	"spl_platform.h"
+#endif
+
+#if				SPL_PLATFORM == SPL_PLATFORM_LINUX
+	#include	<errno.h>
+	#include	<pthread.h>
+#endif
+
+#if				SPL_PLATFORM == SPL_PLATFORM_WIN32
+	#include	<windows.h>
+#endif
+
+#ifndef		EBUSY
+#define		EBUSY	16	
+#endif
+
+#if SPL_PLATFORM == SPL_PLATFORM_WIN32
+	#if		defined ( SPL_MAKE_DLL )
+		#define SPL_API		__declspec( dllexport )
+	#elif	defined ( SPL_USE_DLL )
+		#define SPL_API		__declspec( dllimport )
+	#else 
+		#define SPL_API	
+	#endif
+#else
+	#define SPL_API 
+#endif
+
+namespace SPL 
+{
+
+//---------------------------------------------------------------------------------------------------------------------------
+///	@brief		Multiplatform mutex class.
+///	@ingroup	SPL
+//---------------------------------------------------------------------------------------------------------------------------
+class slcMutex
+{
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//***********************************************     CON/DESTRUCTION     ***********************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default constructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	SPL_API slcMutex( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default destructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual SPL_API ~slcMutex( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//************************************************     MODIFICATION     *************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Locks a section - If section is already busy then block and wait until it's ready again.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void SPL_API Lock( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Locks a section - If section is busy, return without blocking.
+	///	@return		The method returns one of the following values:
+	///	@retval		EBUSY | Section is still locked from another caller.
+	///	@retval		0     | Section is now locked by current call.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API TryLock( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unlocks a section.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void SPL_API Unlock( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//*************************************************     ATTRIBUTES     **************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+private:
+
+#if	SPL_PLATFORM == SPL_PLATFORM_WIN32		
+	
+	HANDLE				m_access;				///< WIN32 mutex.
+	SECURITY_ATTRIBUTES m_sa;
+
+#elif SPL_PLATFORM == SPL_PLATFORM_LINUX
+
+	pthread_mutex_t		m_access;				///< POSIX mutex.
+
+#endif	
+};
+
+} // End of namespace SPL
+
+#endif	// __SPL_MUTEX_H__
+
diff --git a/src/libspl/include/spl_platform.h b/src/libspl/include/spl_platform.h
new file mode 100644
index 0000000..bc2e5b5
--- /dev/null
+++ b/src/libspl/include/spl_platform.h
@@ -0,0 +1,122 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren�Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_platform.h
+/// @version	1.0
+/// @brief		Platform handling & detection.
+/// @author		Andreas Loeffler
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLATFORM_H__
+#define		__SPL_PLATFORM_H__
+
+//
+// PLATFORM DEFINES
+//
+#define		SPL_PLATFORM_WIN32			1
+#define		SPL_PLATFORM_LINUX			2
+#define		SPL_PLATFORM_APPLE			3
+#define 	SPL_PLATFORM_SOLARIS			4
+
+//
+// COMPILER DEFINES
+//
+#define		SPL_COMPILER_VCPLUSPLUS		1
+#define		SPL_COMPILER_BCPLUSPLUS		2
+#define		SPL_COMPILER_GNUC			3
+#define		SPL_COMPILER_CODEWARRIOR	4
+#define		SPL_COMPILER_SUNFORTE7		5
+
+//
+// PLATFORM DETECTION
+//
+#if	defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+	#define SPL_PLATFORM				SPL_PLATFORM_WIN32
+	
+	//
+	// Save compile date and time to lib
+	//
+	#pragma comment( user, "Compiled on " __DATE__ " at " __TIME__ )
+
+#elif defined( __LINUX__ ) || defined( linux ) || defined( __FreeBSD__ )
+
+	#define SPL_PLATFORM				SPL_PLATFORM_LINUX
+
+#elif defined( __APPLE_CC__ ) || defined( APPLE_CC )
+
+	#define	SPL_PLATFORM				SPL_PLATFORM_APPLE
+
+#elif defined(sparc) && defined(sun) && defined(unix)	
+
+	//
+	// (karg) Solaris port stuff	
+	//
+	#define SPL_PLATFORM				SPL_PLATFORM_SOLARIS
+
+#else
+
+	#error "ERROR: Operating system is unknown!"
+
+#endif	//	PLATFORM
+
+//
+// COMPILER DETECTION
+//
+#if defined( _MSC_VER )
+
+	#define SPL_COMPILER				SPL_COMPILER_VCPLUSPLUS
+
+#elif defined( __BORLANDC__ ) || defined( __BCPLUSPLUS__ )
+
+	#define SPL_COMPILER				SPL_COMPILER_BCPLUSPLUS
+
+#elif defined( __GNUC__ )
+
+	#define SPL_COMPILER				SPL_COMPILER_GNUC
+
+#elif defined( __MWERKS__ )
+
+	#define SPL_COMPILER				SPL_COMPILER_CODEWARRIOR
+
+#elif defined( __SUNPRO_CC)
+
+	//
+	// Sun forte compiler, the solaris port (karg)
+	//
+	#define SPL_COMPILER				SPL_COMPILER_SUNFORTE7
+
+#else
+
+	#error "ERROR: Compiler is unknown!"
+
+#endif	//	COMPILER
+
+
+#endif	//	__SPL_PLATFORM_H__
+
diff --git a/src/libspl/include/spl_pluginargs.h b/src/libspl/include/spl_pluginargs.h
new file mode 100644
index 0000000..969e7cf
--- /dev/null
+++ b/src/libspl/include/spl_pluginargs.h
@@ -0,0 +1,153 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Ren� Stuhr (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_pluginargs.h
+/// @version	1.0
+/// @brief		The plugin argument class.
+/// @author		Ren� Stuhr
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLUGINARGS_H__
+#define		__SPL_PLUGINARGS_H__
+
+#ifndef		__SPL_TYPEDEFS_H__
+#include	"spl_typedefs.h"
+#endif
+
+#ifndef		__SPL_MUTEX_H__
+#include	"spl_mutex.h"
+#endif
+
+#ifndef		_MAP_
+#include	<map>
+#endif
+
+#ifndef		_STRING_
+#include	<string>
+#endif
+
+#if SPL_PLATFORM == SPL_PLATFORM_WIN32
+	#if		defined ( SPL_MAKE_DLL )
+		#define SPL_API		__declspec( dllexport )
+	#elif	defined ( SPL_USE_DLL )
+		#define SPL_API		__declspec( dllimport )
+	#else 
+		#define SPL_API	
+	#endif
+#else
+	#define SPL_API 
+#endif
+
+
+using namespace std;
+
+namespace SPL {
+
+//---------------------------------------------------------------------------------------------------------------------------
+///	@brief		The plugin argument class.
+///	@ingroup	SPL
+//---------------------------------------------------------------------------------------------------------------------------
+class slcPluginArgs : public slcMutex
+{
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//***********************************************     CON/DESTRUCTION     ***********************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default constructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	SPL_API slcPluginArgs( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Copy constructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	SPL_API slcPluginArgs( const slcPluginArgs& a_pluginArgs );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default destructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual SPL_API ~slcPluginArgs( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//************************************************     MODIFICATION     *************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Sets an argument at the specified index (0-based).
+	///	@param		a_lIndex	[in] Index where to fill the argument in.
+	///	@param		a_pvArg		[in] Pointer to an argument.
+	///	@return		The argument's index (should not differ from a_lIndex!).
+	//-----------------------------------------------------------------------------------------------------------------------
+	long SPL_API SetArg( long a_lIndex, void* a_pvArg );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Sets an argument at the next free position.
+	///	@param		a_pvArg		[in] Pointer to an argument.
+	///	@return		The argument's index.
+	//-----------------------------------------------------------------------------------------------------------------------
+	long SPL_API SetArg( void* a_pvArg );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the number of arguments.
+	///	@return		Number of arguments.
+	//-----------------------------------------------------------------------------------------------------------------------
+	long SPL_API GetCount( void );// const;
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Gets the argument at the specified index.
+	///	@param		a_lIndex	[in] Index of argument to get.
+	///	@param		a_pvArg		[out] Pointer to a valid, allocated memory block holding the argument.
+	///	@return		The argument's index (should not differ from a_lIndex!).
+	//-----------------------------------------------------------------------------------------------------------------------
+	long SPL_API GetArg( long a_lIndex, void* a_pvArg );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the number of deleted arguments.
+	///	@return		Number of arguments.
+	//-----------------------------------------------------------------------------------------------------------------------
+	long SPL_API Clear( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//*************************************************     ATTRIBUTES     **************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+private:
+	
+	map< long, SPL_BITTYPE >	m_mapArgs;		///< Map for arguments.
+};
+
+} // End of namespace SPL
+
+#endif	// End __SPL_PLUGINARGS_H__
diff --git a/src/libspl/include/spl_plugininfo.h b/src/libspl/include/spl_plugininfo.h
new file mode 100644
index 0000000..be1a2b8
--- /dev/null
+++ b/src/libspl/include/spl_plugininfo.h
@@ -0,0 +1,259 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Ren� Stuhr (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_plugininfo.h
+/// @version	1.0
+/// @brief		The plugin info class.
+/// @author		Ren� Stuhr
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLUGININFO_H__
+#define		__SPL_PLUGININFO_H__
+
+#ifndef		__SPL_TYPEDEFS_H__
+#include	"spl_typedefs.h"
+#endif
+
+#ifndef		__SPL_PLATFORM_H__
+#include	"spl_platform.h"
+#endif
+
+#ifndef		__SPL_MUTEX_H__
+#include	"spl_mutex.h"
+#endif
+
+#ifndef		_MAP_
+#include	<map>
+#endif
+
+#ifndef		_STRING_
+#include	<string>
+#endif
+
+#if SPL_PLATFORM == SPL_PLATFORM_WIN32
+	#if		defined ( SPL_MAKE_DLL )
+		#define SPL_API		__declspec( dllexport )
+	#elif	defined ( SPL_USE_DLL )
+		#define SPL_API		__declspec( dllimport )
+	#else 
+		#define SPL_API	
+	#endif
+#else
+	#define SPL_API 
+#endif
+
+using namespace std;
+
+namespace SPL {
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+///	@brief		The plugin information class.
+///	@ingroup	SPL
+//---------------------------------------------------------------------------------------------------------------------------
+class slcPluginInfo : public slcMutex
+{
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//**************************************************     STRUCTURES     *************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//---------------------------------------------------------------------------------------------------------------------------
+	///	@brief		Function enumeration for argument lookups.
+	///	@ingroup	SPL
+	//---------------------------------------------------------------------------------------------------------------------------
+	enum sleFunction
+	{
+		sleFunction_Init = 0,
+		sleFunction_Run,
+		sleFunction_Shutdown
+	};
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//***********************************************     CON/DESTRUCTION     ***********************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default constructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	SPL_API slcPluginInfo( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Copy constructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	SPL_API slcPluginInfo( const slcPluginInfo& a_pluginInfo );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default destructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual SPL_API ~slcPluginInfo( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//************************************************     MODIFICATION     *************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Clears the structure.
+	//-----------------------------------------------------------------------------------------------------------------------
+	void SPL_API Clear( void ); 
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the argument count of the specified function.
+	///	@param		a_enuFunc	[in] Function to get the argument count from.
+	///	@return		Number of arguments of the specified function.
+	//-----------------------------------------------------------------------------------------------------------------------
+	long SPL_API GetArgCount( sleFunction a_enuFunc );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns an argument's description.
+	///	@param		a_enuFunc	[in] Function to get the argument description from.
+	///	@param		a_lIndex	[in] Index (0-based) of argument.
+	///	@return		The argument's description.
+	//-----------------------------------------------------------------------------------------------------------------------
+	string SPL_API GetArgDescription( sleFunction a_enuFunc, const long a_lIndex );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns an argument's name.
+	///	@param		a_enuFunc	[in] Function to get the argument description from.
+	///	@param		a_lIndex	[in] Index (0-based) of argument.
+	///	@return		The argument's name.
+	//-----------------------------------------------------------------------------------------------------------------------
+	string SPL_API GetArgName( sleFunction a_enuFunc, const long a_lIndex );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the plugin's name.
+	///	@return		The plugin's name.
+	//-----------------------------------------------------------------------------------------------------------------------
+	string SPL_API GetName( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the plugin's vendor.
+	///	@return		The plugin's vendor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	string SPL_API GetVendor( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the plugin's information string.
+	///	@return		The plugin's information string.
+	//-----------------------------------------------------------------------------------------------------------------------
+	string SPL_API GetInfo( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the plugin's description.
+	///	@return		The plugin's description.
+	//-----------------------------------------------------------------------------------------------------------------------
+	string SPL_API GetDescription( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the plugin's homepage.
+	///	@return		The plugin's homepage.
+	//-----------------------------------------------------------------------------------------------------------------------
+	string SPL_API GetHomepage( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the plugin's e-mail address.
+	///	@return		The plugin's e-mail address.
+	//-----------------------------------------------------------------------------------------------------------------------
+	string SPL_API GetEmail( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the plugin's major version (e.g. 1.xx).
+	///	@return		The plugin's major version.
+	//-----------------------------------------------------------------------------------------------------------------------
+	long SPL_API GetMajorVersion( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the plugin's minor version (e.g. x.12).
+	///	@return		The plugin's minor version.
+	//-----------------------------------------------------------------------------------------------------------------------
+	long SPL_API GetMinorVersion( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the plugin's build version.
+	///	@return		The plugin's build version.
+	//-----------------------------------------------------------------------------------------------------------------------
+	long SPL_API GetBuildVersion( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the plugin's UUID.
+	///	@return		The plugin's UUID.
+	//-----------------------------------------------------------------------------------------------------------------------
+	string SPL_API GetUUID( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Reports whether the plugin has public arguments or not.
+	///	@return		The method returns one of the following values:
+	///	@retval		true	| The plugin has public arguments.
+	///	@retval		false	| The plugin has no public arguments.
+	//-----------------------------------------------------------------------------------------------------------------------
+	bool SPL_API HasPublicArgs( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Copy operator.
+	///	@param		a_pluginInfo	[in] Plugin class to copy from.
+	///	@return		The new plugin class.
+	//-----------------------------------------------------------------------------------------------------------------------
+	slcPluginInfo SPL_API operator=( const slcPluginInfo& a_pluginInfo );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//*************************************************     ATTRIBUTES     **************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+protected:
+
+	string							m_strName;				// The plugin's name.
+	string							m_strVendor;			// The plugin's vendor.
+	string							m_strInfo;				// The plugin's information string.
+	string							m_strDescription;		// The plugin's description.
+	string							m_strHomepage;			// The vendor's homepage.
+	string							m_strEmail;				// The vendor's e-mail address.
+	long							m_lMajor;				// The plugin's major version (e.g. 1.xx)
+	long							m_lMinor;				// The plugin's minor version (e.g. x.12)
+	long							m_lBuild;				// The plugin's build version.
+	string							m_strUUID;				// The plugin's UUID.
+	bool							m_bPuplicArgInfos;		// The plugin's argument infos flag.	
+
+	map< long, string >				m_mapInitArgs;			// Map for holding the plugin initialize arguments and their description.
+	map< long, string >				m_mapShutdownArgs;		// Map for holding the plugin shutdown arguments and their description.
+	map< long, string >				m_mapRunArgs;			// Map for holding the plugin run arguments and their description.
+	map< long, string >::iterator	itmapArgs;				// The map's iterator.
+};
+
+
+} // End of namespace SPL
+
+#endif	//	__SPL_PLUGININFO_H__
diff --git a/src/libspl/include/spl_pluginserver.h b/src/libspl/include/spl_pluginserver.h
new file mode 100644
index 0000000..e0d49ba
--- /dev/null
+++ b/src/libspl/include/spl_pluginserver.h
@@ -0,0 +1,289 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_pluginserver.h
+/// @version	1.0
+/// @brief		The plugin server class.
+/// @author		Andreas Loeffler
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLUGINSERVER_H__
+#define		__SPL_PLUGINSERVER_H__
+
+#ifndef		__SPL_TYPEDEFS_H__
+#include	"spl_typedefs.h"
+#endif
+
+#ifndef		__SPL_PLUGININFO_H__
+#include	"spl_plugininfo.h"
+#endif
+
+#ifndef		__SPL_PLUGINARGS_H__
+#include	"spl_pluginargs.h"
+#endif
+
+#ifndef		__SPL_MUTEX_H__
+#include	"spl_mutex.h"
+#endif
+
+#ifndef		_MAP_
+#include	<map>
+#endif
+
+#ifndef		_STRING_
+#include	<string>
+#endif
+
+
+#if SPL_PLATFORM == SPL_PLATFORM_WIN32
+	#if		defined ( SPL_MAKE_DLL )
+		#define SPL_API		__declspec( dllexport )
+	#elif	defined ( SPL_USE_DLL )
+		#define SPL_API		__declspec( dllimport )
+	#else 
+		#define SPL_API	
+	#endif
+#else
+	#define SPL_API 
+#endif
+
+using namespace std;
+
+namespace SPL 
+{
+
+//---------------------------------------------------------------------------------------------------------------------------
+///	@brief		Abstract plugin server class.
+///	@ingroup	SPL
+//---------------------------------------------------------------------------------------------------------------------------
+class slaPluginServer : public slcMutex
+{
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//***********************************************     CON/DESTRUCTION     ***********************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default constructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	SPL_API slaPluginServer( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default destructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual SPL_API ~slaPluginServer( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//************************************************     MODIFICATION     *************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+
+protected:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Cleanup all internal maps.
+	//  @remarks	This function is only for internal use!
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void SPL_API Clear( void );
+
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns the current number of loaded plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API GetLoadedPlugins( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns information about a plugin from internal plugin info map.
+	/// @remarks	Index is 0-based.
+	///	@param		a_lIndex		[in] The plugin's index.
+	///	@retval		A slcPluginInfo structure containing the plugin's information.
+	/// @sa			slcPluginInfo
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual slcPluginInfo SPL_API GetSafedPluginInfo( const long a_lIndex );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Returns information about a plugin, use this to safe the info to info map.
+	/// @remarks	Index is 0-based.
+	///	@param		a_lIndex		[in] The plugin's index.
+	///	@retval		A slcPluginInfo structure containing the plugin's information.
+	/// @sa			slcPluginInfo
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual slcPluginInfo SPL_API GetPluginInfo( const long a_lIndex ) = 0;
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Automatically retrieves information about all loaded plugins.
+	//  @remarks	This function is pure virtual and must be overwritten!
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void SPL_API GetAllPluginInfos( void ) = 0;
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Loads all plugins with a given wildcard in a specified path.
+	///	@param		a_strPath		[in] Valid path for searching the plugins.
+	///	@param		a_strWildcard	[in] File wildcard (e.g. *.*, *.dll) for the plugins.
+  /// @param    init_plugin After plugin loading, run the init function.
+	///	@param		a_pPluginArgs	[in] Pointer to arguments for initializing all plugins after they have been loaded.
+	///	@return		Number of successfully loaded plugins.
+	//  @remarks	This function is pure virtual and must be overwritten!
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API LoadAllPlugins( const string&		  a_strPath, 
+								 const string&		  a_strWildcard, bool init_plugin,
+								 const slcPluginArgs* a_pPluginArgs = NULL ) = 0;
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Loads a plugin with the specified file name.
+	///	@param		a_strFileName	[in] The plugin's file name.
+  /// @param    init_plugin After plugin loading, run the init function.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's start function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		-2 | Plugin was not found.
+	///	@retval		-1 | Plugin's initialize function was not found.
+	///	@retval		 0 | Error while executing the intialisation function.
+	///	@retval		 1 | Plugin was successfully loaded.
+	//  @remarks	This function is pure virtual and must be overwritten!
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API LoadPlugin( const string& a_strFileName, bool init_plugin, const slcPluginArgs* a_pPluginArgs = NULL ) = 0;
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads a plugin with the given index (0-based).
+	///	@param		a_lIndex		[in] The plugin's index.
+  /// @param    shutdown_plugin Run the plugin's shutdown function before unloading it.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's shutdown function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		true	| The plugin was unloaded successfully.
+	///	@retval		false	| Could not unload plugin.
+	//  @remarks	This function is pure virtual and must be overwritten!
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual bool SPL_API UnloadPlugin( const long a_lIndex, bool shutdown_plugin, const slcPluginArgs* a_pPluginArgs = NULL ) = 0;
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads all plugins.
+	///	@param		a_pPluginArgs	[in] Pointer to arguments for shutting down all plugins after they have been unloaded.
+	//  @remarks	This function is pure virtual and must be overwritten!
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void SPL_API UnloadAllPlugins( const slcPluginArgs* a_pPluginArgs = NULL ) = 0;
+  
+  //-----------------------------------------------------------------------------------------------------------------------
+  /// @brief    Runs the plugin's init function.
+  /// @param    a_lIndex    [in] The plugin's index.
+  /// @param    a_pPluginArgs [in] Pointer to plugin's run function arguments.
+  /// @return   The method returns one of the following values:
+  /// @retval   true  | The plugin execution was successful.
+  /// @retval   false | An error occured while executing the plugin.
+  //  @remarks  This function is pure virtual and must be overwritten!
+  //-----------------------------------------------------------------------------------------------------------------------
+  virtual bool SPL_API RunPluginInit( const long a_lIndex, const slcPluginArgs* a_pPluginArgs = NULL ) = 0;
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Runs a plugin with the given index (0-based) and arguments.
+	///	@param		a_lIndex		[in] The plugin's index.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's run function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		true	| The plugin execution was successful.
+	///	@retval		false	| An error occured while executing the plugin.
+	//  @remarks	This function is pure virtual and must be overwritten!
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual bool SPL_API RunPlugin( const long a_lIndex, const slcPluginArgs* a_pPluginArgs = NULL ) = 0;
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Runs all plugins with the given arguments.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's run function arguments.
+	///	@return		Number of successfully executed plugins.
+	//  @remarks	This function is pure virtual and must be overwritten!
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API RunAllPlugins( const slcPluginArgs* a_pPluginArgs = NULL ) = 0;
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads all plugins and looks for new plugins in the given path.
+	///	@param		a_strPath				[in] Valid path for searching the plugins.
+	///	@param		a_strWildcard			[in] File wildcard (e.g. *.*, *.dll) for the plugins.
+	///	@param		a_pPluginShutdownArgs	[in] Pointer to arguments for shutting down all plugins before they will be unloaded.
+	///	@param		a_pPluginInitArgs		[in] Pointer to arguments for initializing all plugins after they have been loaded.
+	///	@return		Number of successfully loaded plugins.
+	//  @remarks	This function is pure virtual and must be overwritten!
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API Refresh( const string&		   a_strPath, 
+						  const string&		   a_strWildcard, 
+						  const	slcPluginArgs* a_pPluginShutdownArgs = NULL, 
+						  const slcPluginArgs* a_pPluginInitArgs = NULL ) = 0;
+
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//*************************************************     ATTRIBUTES     **************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+protected:
+
+	map< long, SPL_BITTYPE >				m_mapPluginIds;		///< Map containing the plugin IDs.
+	map< long, SPL_BITTYPE > ::iterator		itIds;				///< Iterator for plugin IDs.
+
+	map< long, slcPluginInfo >				m_mapPluginInfos;	///< Map containing the plugin infos.
+	map< long, slcPluginInfo > ::iterator	itInfos;			///< Iterator for plugin infos.
+
+	slcPluginArgs							m_nullArgs;			///< Dummy argument for internal use.
+	slcPluginInfo							m_nullInfo;			///< Dummy argument for internal use.
+};
+
+#define		SPL_INIT_NAME			"splInitialize"					///< The initialisation function's name.
+#define		SPL_INIT_NAME_CODE		splInitialize					///< The initialisation function's name for internal macros.
+#define		SPL_RUN_NAME			"splRun"						///< The run function's name.
+#define		SPL_RUN_NAME_CODE		splRun							///< The run function's name for internal macros.
+#define		SPL_SHUTDOWN_NAME		"splShutdown"					///< The shutdown function's name.
+#define		SPL_SHUTDOWN_NAME_CODE	splShutdown						///< The shutdown function's name for internal macros.
+#define		SPL_GETINFO_NAME		"splGetInfo"					///< The information function's name.
+#define		SPL_GETINFO_NAME_CODE	splGetInfo						///< The information function's name for internal macros.
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		The plugin's initialisation function.
+//-----------------------------------------------------------------------------------------------------------------------
+typedef bool( *SPL_INIT_FUNC )( const slcPluginArgs* );
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		The plugin's run function.
+//-----------------------------------------------------------------------------------------------------------------------
+typedef bool( *SPL_RUN_FUNC )( const slcPluginArgs* );
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		The plugin's shutdown function.
+//-----------------------------------------------------------------------------------------------------------------------
+typedef bool( *SPL_SHUTDOWN_FUNC )( const slcPluginArgs* );
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		The plugin's information function.
+//-----------------------------------------------------------------------------------------------------------------------
+typedef slcPluginInfo*( *SPL_INFO_FUNC )( void );
+
+} // End of namespace SPL
+
+using namespace SPL;
+
+#endif	//	__SPL_PLUGINSERVER_H__
diff --git a/src/libspl/include/spl_pluginserver_linux.h b/src/libspl/include/spl_pluginserver_linux.h
new file mode 100644
index 0000000..78ea284
--- /dev/null
+++ b/src/libspl/include/spl_pluginserver_linux.h
@@ -0,0 +1,173 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_pluginserver_linux.h
+/// @version	1.0
+/// @brief		The plugin server's linux implementation.
+/// @author		Andreas Loeffler
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLUGINSERVER_LINUX_H__
+#define		__SPL_PLUGINSERVER_LINUX_H__
+
+#ifndef		__SPL_PLUGINSERVER_H__
+#include	"spl_pluginserver.h"
+#endif
+
+namespace SPL 
+{
+
+//---------------------------------------------------------------------------------------------------------------------------
+///	@brief		Plugin server class for linux and other POSIX-based systems.
+///	@ingroup	SPL
+//---------------------------------------------------------------------------------------------------------------------------
+class slcPluginServer : public slaPluginServer
+{
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//***********************************************     CON/DESTRUCTION     ***********************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default constructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	slcPluginServer( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default destructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual ~slcPluginServer( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//************************************************     MODIFICATION     *************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Retrieves information about one loaded plugin.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual slcPluginInfo GetPluginInfo( const long a_lIndex );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Automatically retrieves information about all loaded plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void GetAllPluginInfos( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Loads all plugins with a given wildcard in a specified path.
+	///	@param		a_strPath		[in] Valid path for searching the plugins.
+	///	@param		a_strWildcard	[in] File wildcard (e.g. *.*, *.dll) for the plugins.
+  /// @param    init_plugin After plugin loading, run the init function.
+	///	@param		a_pPluginArgs	[in] Pointer to arguments for initializing all plugins after they have been loaded.
+	///	@return		Number of successfully loaded plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long LoadAllPlugins( const string&		  a_strPath, 
+								 const string&		  a_strWildcard, bool init_plugin,
+								 const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Loads a plugin with the specified file name.
+	///	@param		a_strFileName	[in] The plugin's file name.
+  /// @param    init_plugin After plugin loading, run the init function.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's start function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		-2 | Plugin was not found.
+	///	@retval		-1 | Plugin's initialize function was not found.
+	///	@retval		 0 | Error while executing the intialisation function.
+	///	@retval		 1 | Plugin was successfully loaded.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long LoadPlugin( const string& a_strFileName, bool init_plugin, const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads a plugin with the given index (0-based).
+	///	@param		a_lIndex		[in] The plugin's index.
+  /// @param    shutdown_plugin Run the plugin's shutdown function before unloading it.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's shutdown function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		true	| The plugin was unloaded successfully.
+	///	@retval		false	| Could not unload plugin.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual bool UnloadPlugin( const long a_lIndex, bool shutdown_plugin, const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads all plugins.
+	///	@param		a_pPluginArgs	[in] Arguments for shutting down all plugins after they have been unloaded.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void UnloadAllPlugins( const slcPluginArgs* a_pPluginArgs = NULL );
+  
+  //-----------------------------------------------------------------------------------------------------------------------
+  /// @brief    Runs the plugin's init function.
+  /// @param    a_lIndex    [in] The plugin's index.
+  /// @param    a_pPluginArgs [in] Pointer to plugin's run function arguments.
+  /// @return   The method returns one of the following values:
+  /// @retval   true  | The plugin execution was successful.
+  /// @retval   false | An error occured while executing the plugin.
+  //  @remarks  This function is pure virtual and must be overwritten!
+  //-----------------------------------------------------------------------------------------------------------------------
+  virtual bool SPL_API RunPluginInit( const long a_lIndex, const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Runs a plugin with the given index (0-based) and arguments.
+	///	@param		a_lIndex		[in] The plugin's index.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's run function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		true	| The plugin execution was successful.
+	///	@retval		false	| An error occured while executing the plugin.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual bool RunPlugin( const long a_lIndex, const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Runs all plugins with the given arguments.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's run function arguments.
+	///	@return		Number of successfully executed plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long RunAllPlugins( const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads all plugins and looks for new plugins in the given path.
+	///	@param		a_strPath				[in] Valid path for searching the plugins.
+	///	@param		a_strWildcard			[in] File wildcard (e.g. *.*, *.dll) for the plugins.
+	///	@param		a_pPluginShutdownArgs	[in] Pointer to arguments for shutting down all plugins before they will be unloaded.
+	///	@param		a_pPluginInitArgs		[in] Pointer to arguments for initializing all plugins after they have been loaded.
+	///	@return		Number of successfully loaded plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long Refresh( const string&		   a_strPath, 
+						  const string&		   a_strWildcard, 
+						  const	slcPluginArgs* a_pPluginShutdownArgs = NULL, 
+						  const	slcPluginArgs* a_pPluginInitArgs = NULL );
+};
+
+} // End of namespace SPL
+
+using namespace SPL;
+
+#endif	//	__SPL_PLUGINSERVER_H__
diff --git a/src/libspl/include/spl_pluginserver_solaris.h b/src/libspl/include/spl_pluginserver_solaris.h
new file mode 100644
index 0000000..40c68bd
--- /dev/null
+++ b/src/libspl/include/spl_pluginserver_solaris.h
@@ -0,0 +1,173 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_pluginserver_solaris.h
+/// @version	1.0
+/// @brief		The plugin server's solaris implementation.
+/// @author		Stefan Dicu (karg)
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLUGINSERVER_SOLARIS_H__
+#define		__SPL_PLUGINSERVER_SOLARIS_H__
+
+#ifndef		__SPL_PLUGINSERVER_H__
+#include	"spl_pluginserver.h"
+#endif
+
+namespace SPL 
+{
+
+//---------------------------------------------------------------------------------------------------------------------------
+///	@brief		Plugin server class for solaris
+///	@ingroup	SPL
+//---------------------------------------------------------------------------------------------------------------------------
+class slcPluginServer : public slaPluginServer
+{
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//***********************************************     CON/DESTRUCTION     ***********************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default constructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	slcPluginServer( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default destructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual ~slcPluginServer( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//************************************************     MODIFICATION     *************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Retrieves information about one loaded plugin.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual slcPluginInfo GetPluginInfo( const long a_lIndex );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Automatically retrieves information about all loaded plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void GetAllPluginInfos( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Loads all plugins with a given wildcard in a specified path.
+	///	@param		a_strPath		[in] Valid path for searching the plugins.
+	///	@param		a_strWildcard	[in] File wildcard (e.g. *.*, *.dll) for the plugins.
+  /// @param    init_plugin After plugin loading, run the init function.
+	///	@param		a_pPluginArgs	[in] Pointer to arguments for initializing all plugins after they have been loaded.
+	///	@return		Number of successfully loaded plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long LoadAllPlugins( const string&		  a_strPath, 
+								 const string&		  a_strWildcard, bool init_plugin,
+								 const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Loads a plugin with the specified file name.
+	///	@param		a_strFileName	[in] The plugin's file name.
+  /// @param    init_plugin After plugin loading, run the init function.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's start function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		-2 | Plugin was not found.
+	///	@retval		-1 | Plugin's initialize function was not found.
+	///	@retval		 0 | Error while executing the intialisation function.
+	///	@retval		 1 | Plugin was successfully loaded.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long LoadPlugin( const string& a_strFileName, bool init_plugin, const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads a plugin with the given index (0-based).
+	///	@param		a_lIndex		[in] The plugin's index.
+  /// @param    shutdown_plugin Run the plugin's shutdown function before unloading it.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's shutdown function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		true	| The plugin was unloaded successfully.
+	///	@retval		false	| Could not unload plugin.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual bool UnloadPlugin( const long a_lIndex, bool shutdown_plugin, const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads all plugins.
+	///	@param		a_pPluginArgs	[in] Arguments for shutting down all plugins after they have been unloaded.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void UnloadAllPlugins( const slcPluginArgs* a_pPluginArgs = NULL );
+  
+  //-----------------------------------------------------------------------------------------------------------------------
+  /// @brief    Runs the plugin's init function.
+  /// @param    a_lIndex    [in] The plugin's index.
+  /// @param    a_pPluginArgs [in] Pointer to plugin's run function arguments.
+  /// @return   The method returns one of the following values:
+  /// @retval   true  | The plugin execution was successful.
+  /// @retval   false | An error occured while executing the plugin.
+  //  @remarks  This function is pure virtual and must be overwritten!
+  //-----------------------------------------------------------------------------------------------------------------------
+  virtual bool SPL_API RunPluginInit( const long a_lIndex, const slcPluginArgs* a_pPluginArgs = NULL );  
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Runs a plugin with the given index (0-based) and arguments.
+	///	@param		a_lIndex		[in] The plugin's index.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's run function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		true	| The plugin execution was successful.
+	///	@retval		false	| An error occured while executing the plugin.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual bool RunPlugin( const long a_lIndex, const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Runs all plugins with the given arguments.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's run function arguments.
+	///	@return		Number of successfully executed plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long RunAllPlugins( const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads all plugins and looks for new plugins in the given path.
+	///	@param		a_strPath				[in] Valid path for searching the plugins.
+	///	@param		a_strWildcard			[in] File wildcard (e.g. *.*, *.dll) for the plugins.
+	///	@param		a_pPluginShutdownArgs	[in] Pointer to arguments for shutting down all plugins before they will be unloaded.
+	///	@param		a_pPluginInitArgs		[in] Pointer to arguments for initializing all plugins after they have been loaded.
+	///	@return		Number of successfully loaded plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long Refresh( const string&		   a_strPath, 
+						  const string&		   a_strWildcard, 
+						  const	slcPluginArgs* a_pPluginShutdownArgs = NULL, 
+						  const	slcPluginArgs* a_pPluginInitArgs = NULL );
+};
+
+} // End of namespace SPL
+
+using namespace SPL;
+
+#endif	//	__SPL_PLUGINSERVER_H__
diff --git a/src/libspl/include/spl_pluginserver_win32.h b/src/libspl/include/spl_pluginserver_win32.h
new file mode 100644
index 0000000..ee744c7
--- /dev/null
+++ b/src/libspl/include/spl_pluginserver_win32.h
@@ -0,0 +1,186 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_pluginserver_win32.h
+/// @version	1.0
+/// @brief		The plugin server's Win32 implementation.
+/// @author		Andreas Loeffler
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLUGINSERVER_WIN32_H__
+#define		__SPL_PLUGINSERVER_WIN32_H__
+
+#ifndef		__SPL_PLUGINSERVER_H__
+#include	"spl_pluginserver.h"
+#endif
+
+
+#if SPL_PLATFORM == SPL_PLATFORM_WIN32
+	#if		defined ( SPL_MAKE_DLL )
+		#define SPL_API		__declspec( dllexport )
+	#elif	defined ( SPL_USE_DLL )
+		#define SPL_API		__declspec( dllimport )
+	#else 
+		#define SPL_API	
+	#endif
+#else
+	#define SPL_API 
+#endif
+
+namespace SPL 
+{
+
+//---------------------------------------------------------------------------------------------------------------------------
+///	@brief		Plugin server class for Win32.
+///	@ingroup	SPL
+//---------------------------------------------------------------------------------------------------------------------------
+class slcPluginServer : public slaPluginServer
+{
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//***********************************************     CON/DESTRUCTION     ***********************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default constructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	SPL_API slcPluginServer( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default destructor.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual SPL_API ~slcPluginServer( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//************************************************     MODIFICATION     *************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Retrieves information about one loaded plugin.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual SPL_API slcPluginInfo GetPluginInfo( const long a_lIndex );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Automatically retrieves information about all loaded plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void SPL_API GetAllPluginInfos( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Loads all plugins with a given wildcard in a specified path.
+	///	@param		a_strPath		[in] Valid path for searching the plugins.
+	///	@param		a_strWildcard	[in] File wildcard (e.g. *.*, *.dll) for the plugins.
+  /// @param    init_plugin After plugin loading, run the init function.
+	///	@param		a_pPluginArgs	[in] Pointer to arguments for initializing all plugins after they have been loaded.
+	///	@return		Number of successfully loaded plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API LoadAllPlugins( const string&		  a_strPath, 
+								 const string&		  a_strWildcard, bool init_plugin,
+								 const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Loads a plugin with the specified file name.
+	///	@param		a_strFileName	[in] The plugin's file name.
+  /// @param    init_plugin After plugin loading, run the init function.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's start function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		-2 | Plugin was not found.
+	///	@retval		-1 | Plugin's initialize function was not found.
+	///	@retval		 0 | Error while executing the intialisation function.
+	///	@retval		 1 | Plugin was successfully loaded.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API LoadPlugin( const string& a_strFileName, bool init_plugin, const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads a plugin with the given index (0-based).
+	///	@param		a_lIndex		[in] The plugin's index.
+  /// @param    shutdown_plugin Run the plugin's shutdown function before unloading it.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's shutdown function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		true	| The plugin was unloaded successfully.
+	///	@retval		false	| Could not unload plugin.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual bool SPL_API UnloadPlugin( const long a_lIndex, bool shutdown_plugin, const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads all plugins.
+	///	@param		a_pPluginArgs	[in] Arguments for shutting down all plugins after they have been unloaded.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void SPL_API UnloadAllPlugins( const slcPluginArgs* a_pPluginArgs = NULL );
+  
+  //-----------------------------------------------------------------------------------------------------------------------
+  /// @brief    Runs the plugin's init function.
+  /// @param    a_lIndex    [in] The plugin's index.
+  /// @param    a_pPluginArgs [in] Pointer to plugin's run function arguments.
+  /// @return   The method returns one of the following values:
+  /// @retval   true  | The plugin execution was successful.
+  /// @retval   false | An error occured while executing the plugin.
+  //  @remarks  This function is pure virtual and must be overwritten!
+  //-----------------------------------------------------------------------------------------------------------------------
+  virtual bool SPL_API RunPluginInit( const long a_lIndex, const slcPluginArgs* a_pPluginArgs = NULL );  
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Runs a plugin with the given index (0-based) and arguments.
+	///	@param		a_lIndex		[in] The plugin's index.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's run function arguments.
+	///	@return		The method returns one of the following values:
+	///	@retval		true	| The plugin execution was successful.
+	///	@retval		false	| An error occured while executing the plugin.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual bool SPL_API RunPlugin( const long a_lIndex, const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Runs all plugins with the given arguments.
+	///	@param		a_pPluginArgs	[in] Pointer to plugin's run function arguments.
+	///	@return		Number of successfully executed plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API RunAllPlugins( const slcPluginArgs* a_pPluginArgs = NULL );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unloads all plugins and looks for new plugins in the given path.
+	///	@param		a_strPath				[in] Valid path for searching the plugins.
+	///	@param		a_strWildcard			[in] File wildcard (e.g. *.*, *.dll) for the plugins.
+	///	@param		a_pPluginShutdownArgs	[in] Pointer to arguments for shutting down all plugins before they will be unloaded.
+	///	@param		a_pPluginInitArgs		[in] Pointer to arguments for initializing all plugins after they have been loaded.
+	///	@return		Number of successfully loaded plugins.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API Refresh( const string&		   a_strPath, 
+						  const string&		   a_strWildcard, 
+						  const	slcPluginArgs* a_pPluginShutdownArgs = NULL, 
+						  const	slcPluginArgs* a_pPluginInitArgs = NULL );
+};
+
+} // End of namespace SPL
+
+using namespace SPL;
+
+#endif	//	__SPL_PLUGINSERVER_H__
diff --git a/src/libspl/include/spl_threadlock.h b/src/libspl/include/spl_threadlock.h
new file mode 100644
index 0000000..5e6aadd
--- /dev/null
+++ b/src/libspl/include/spl_threadlock.h
@@ -0,0 +1,132 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Ren� Stuhr (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_threadlock.h
+/// @version	1.0
+/// @brief		Simple utility locking class.
+/// @author		Ren� Stuhr
+/// @remarks	Lock object to make operations thread safe. 
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_THREADLOCK_H__
+#define		__SPL_THREADLOCK_H__
+
+#ifndef		__SPL_TYPEDEFS_H__
+#include	"spl_typedefs.h"
+#endif
+
+#ifndef		__SPL_MUTEX_H__
+#include	"spl_mutex.h"
+#endif
+
+#if 		SPL_PLATFORM == SPL_PLATFORM_LINUX
+#include	<errno.h>
+#endif
+
+
+#if SPL_PLATFORM == SPL_PLATFORM_WIN32
+	#if		defined ( SPL_MAKE_DLL )
+		#define SPL_API		__declspec( dllexport )
+	#elif	defined ( SPL_USE_DLL )
+		#define SPL_API		__declspec( dllimport )
+	#else 
+		#define SPL_API	
+	#endif
+#else
+	#define SPL_API 
+#endif
+
+namespace SPL 
+{
+
+//---------------------------------------------------------------------------------------------------------------------------
+///	@brief		Thread safe utility class.
+///	@ingroup	SPL
+//---------------------------------------------------------------------------------------------------------------------------
+class slcThreadLock
+{
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//***********************************************     CON/DESTRUCTION     ***********************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Initialisation constructor.
+	///	@param		a_pMutex		[in] Pointer to a slcMutex object for locking (usually "this").
+	///	@param		a_bLock			[in] Flag to lock automatically for implicitly or explicitly usage.
+	//-----------------------------------------------------------------------------------------------------------------------
+	SPL_API slcThreadLock( slcMutex* a_pMutex, bool a_bLock = false );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Default destructor.
+	/// @remarks	Clears all open (forgotten) locks for deadlock safety.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual SPL_API ~slcThreadLock( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//************************************************     MODIFICATION     *************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+public:
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Locks a section - If section is already busy then block and wait until it's ready again.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void SPL_API Lock( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Locks a section - If section is busy, return without blocking.
+	///	@return		The method returns one of the following values:
+	///	@retval		EBUSY | Section is still locked from another caller.
+	///	@retval		0     | Section is now locked by current call.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual long SPL_API TryLock( void );
+
+	//-----------------------------------------------------------------------------------------------------------------------
+	///	@brief		Unlocks a section.
+	//-----------------------------------------------------------------------------------------------------------------------
+	virtual void SPL_API Unlock( void );
+
+	//
+	//-----------------------------------------------------------------------------------------------------------------------
+	//*************************************************     ATTRIBUTES     **************************************************
+	//-----------------------------------------------------------------------------------------------------------------------
+	//
+private:
+	
+	slcMutex*		m_pMutex;			///< Pointer to mutex object.
+	long			m_lLockCount;		///< Internal lock counter.
+};
+
+} // End of namespace SPL
+
+#endif	// __SPL_THREADLOCK_H__
+
diff --git a/src/libspl/include/spl_typedefs.h b/src/libspl/include/spl_typedefs.h
new file mode 100644
index 0000000..a219418
--- /dev/null
+++ b/src/libspl/include/spl_typedefs.h
@@ -0,0 +1,94 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_typedefs.h
+/// @version	1.0
+/// @brief		Type definitions
+/// @author		Andreas Loeffler
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_TYPEDEFS_H__
+#define		__SPL_TYPEDEFS_H__
+
+#ifndef		__SPL_PLATFORM_H__
+#include	"spl_platform.h"
+#endif
+
+//
+// NULL DEFINE
+//
+
+#ifdef		NULL
+	#undef	NULL
+#endif
+
+#if SPL_PLATFORM == SPL_PLATFORM_WIN32
+
+	#define	NULL			0L
+
+#else
+
+	#define NULL			0L
+
+#endif	//	SPL_PLATFORM
+
+//
+// DEFINE 64-BIT DATATYPE
+//
+#define			SPL_BITTYPE_32		long
+
+#if SPL_COMPILER == SPL_COMPILER_VCPLUSPLUS  || SPL_COMPILER == SPL_COMPILER_BCPLUSPLUS
+
+	#define		SPL_BITTYPE_64		__int64
+
+#else
+
+	#define		SPL_BITTYPE_64		long long
+
+#endif	// SPL_COMPILER
+
+//
+// TODO: ADD YOUR BITTYPE BELOW THIS COMMENT.
+//		 EXAMPLES: 
+//				
+//		 #define SPL_BITTYPE		SPL_BITTYPE_32		---> for 32 bit platforms.
+//		 #define SPL_BITTYPE		SPL_BITTYPE_64		---> for 64 bit platforms.
+//
+
+// TODO: INSERT YOUR BITTYPE HERE!
+#define SPL_BITTYPE		SPL_BITTYPE_32
+
+//
+// BIT TYPE CHECKING, DO NOT REMOVE!
+//
+#ifndef			SPL_BITTYPE
+	#error		"Bit type NOT specified yet, please edit spl_typedefs.h line 84 to compile!"
+#endif
+
+#endif	//	__SPL_TYPEDEFS_H__
+
diff --git a/src/libspl/source/spl_mutex.cpp b/src/libspl/source/spl_mutex.cpp
new file mode 100644
index 0000000..78ff08d
--- /dev/null
+++ b/src/libspl/source/spl_mutex.cpp
@@ -0,0 +1,143 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Ren� Stuhr (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_mutex.cpp
+/// @version	1.0
+/// @author		Ren� Stuhr
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_MUTEX_H__
+#include	"spl_mutex.h"
+#endif
+
+#ifndef		__SPL_TYPEDEFS_H__
+#include	"spl_typedefs.h"
+#endif
+
+#include <stdio.h>
+
+using namespace SPL;
+
+slcMutex::slcMutex( void )
+{
+#if		SPL_PLATFORM == SPL_PLATFORM_LINUX	
+
+	pthread_mutexattr_t access_attr;
+	pthread_mutexattr_init( &access_attr );
+	pthread_mutexattr_settype( &access_attr, PTHREAD_MUTEX_RECURSIVE );
+	pthread_mutex_init( &this->m_access, &access_attr );
+
+#elif	SPL_PLATFORM == SPL_PLATFORM_WIN32	
+
+	this->m_sa.nLength = sizeof( m_sa );
+	this->m_sa.lpSecurityDescriptor = NULL;
+	this->m_sa.bInheritHandle = TRUE;
+
+	//
+	// CREATE A RANDOM MUTEX UUID
+	//
+	char szUUID[ 41 ] = { 0 };
+	SYSTEMTIME st;
+	::GetSystemTime( &st );
+	sprintf( szUUID, "UUID:%02d:%02d:%02d:%03d:%02d:%02d:%02d:%04d", 
+		st.wDay, st.wDayOfWeek, st.wHour, st.wMilliseconds, st.wMinute,
+		st.wMonth, st.wSecond, st.wYear );
+
+	this->m_access = ::CreateMutex( &this->m_sa, FALSE, szUUID );
+
+#endif
+}
+
+slcMutex::~slcMutex( void )
+{
+#if		SPL_PLATFORM == SPL_PLATFORM_LINUX	
+
+	pthread_mutex_destroy( &this->m_access );
+
+#elif	SPL_PLATFORM == SPL_PLATFORM_WIN32	
+
+	::CloseHandle( this->m_access );
+
+#endif
+}
+
+void slcMutex::Lock( void )
+{
+#if		SPL_PLATFORM == SPL_PLATFORM_LINUX	
+
+	pthread_mutex_lock( &this->m_access );
+
+#elif	SPL_PLATFORM == SPL_PLATFORM_WIN32	
+
+	::WaitForSingleObject( this->m_access, INFINITE );
+
+#endif
+}
+
+long slcMutex::TryLock( void )
+{
+	// 
+	// Set default to signaled.
+	//
+	long lResult = 0;
+
+#if		SPL_PLATFORM == SPL_PLATFORM_LINUX	
+
+	//
+	// Check if object signaled and lock if success.
+	// If object is non signaled return busy otherwise object is now locked.
+	//
+	if( ( lResult = pthread_mutex_trylock( &this->m_access ) ) == EBUSY )
+		 return EBUSY;		///< Return busy.
+
+#elif	SPL_PLATFORM == SPL_PLATFORM_WIN32	
+
+	//
+	// Wait 10 ms of signaled state and lock if success.
+	// If object is non signaled return busy otherwise object is now locked.
+	//
+	if( ( lResult = ::WaitForSingleObject( this->m_access, 10 ) ) == WAIT_TIMEOUT )
+		return EBUSY;			///< Return busy.
+
+#endif
+
+	return lResult;		///< If 0 object is successfully locked otherwise error, return result.
+}
+
+void slcMutex::Unlock( void )
+{
+#if		SPL_PLATFORM == SPL_PLATFORM_LINUX	
+
+	pthread_mutex_unlock( &this->m_access );
+
+#elif	SPL_PLATFORM == SPL_PLATFORM_WIN32	
+
+	::ReleaseMutex( this->m_access );
+
+#endif
+}
diff --git a/src/libspl/source/spl_pluginargs.cpp b/src/libspl/source/spl_pluginargs.cpp
new file mode 100644
index 0000000..01a5f2b
--- /dev/null
+++ b/src/libspl/source/spl_pluginargs.cpp
@@ -0,0 +1,157 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Ren� Stuhr (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_pluginargs.cpp
+/// @version	1.0
+/// @author		Ren� Stuhr
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLUGINARGS_H__
+#include	"spl_pluginargs.h"
+#endif
+
+#ifndef		__SPL_THREADLOCK_H__
+#include	"spl_threadlock.h"
+#endif
+
+using namespace SPL;
+
+slcPluginArgs::slcPluginArgs( void ) 
+{
+
+}
+
+slcPluginArgs::slcPluginArgs( const slcPluginArgs& a_pluginArgs )
+{
+	if( a_pluginArgs.m_mapArgs.size() == 0 )
+	{
+		return;
+	}
+
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	//
+	// COPY MAP ELEMENTS
+	//
+	this->m_mapArgs = a_pluginArgs.m_mapArgs;
+}
+
+slcPluginArgs::~slcPluginArgs( void )
+{
+}
+
+long slcPluginArgs::SetArg( long a_lIndex, void* a_pvArg )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	if( ( a_lIndex < 0 ) ||
+		( NULL == a_pvArg ) )
+	{
+		return -1;
+	}
+
+	//
+	// IF a_lIndex OUT OF RANGE FIX IT
+	//
+	if( a_lIndex > (long) this->m_mapArgs.size() )
+		a_lIndex = (long) this->m_mapArgs.size();
+
+	//
+	// SAVE ARGUMENT
+	//
+	this->m_mapArgs.insert( pair< long, SPL_BITTYPE> ( a_lIndex, (SPL_BITTYPE) a_pvArg ) );
+
+	return a_lIndex;
+}
+
+long slcPluginArgs::SetArg( void* a_pvArg )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	//
+	// SAVE ARGUMENT
+	//
+	this->m_mapArgs.insert( pair< long, SPL_BITTYPE> ( (long) this->m_mapArgs.size(), (SPL_BITTYPE) a_pvArg ) );
+
+	return (long) this->m_mapArgs.size() - 1;
+}
+
+long slcPluginArgs::GetCount( void ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return (long) this->m_mapArgs.size();
+}
+
+long slcPluginArgs::GetArg( long a_lIndex, void* a_pvArg )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	if( ( a_lIndex > (long) this->m_mapArgs.size() ) ||
+		( a_lIndex < 0 ) )
+	{
+		return -1;
+	}
+
+	*( SPL_BITTYPE* )a_pvArg = ( SPL_BITTYPE )this->m_mapArgs[ a_lIndex ];
+	return a_lIndex;
+}
+
+long slcPluginArgs::Clear( void )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	long lArguments = (long) this->m_mapArgs.size();
+	this->m_mapArgs.clear();
+	return lArguments;
+}
+
diff --git a/src/libspl/source/spl_plugininfo.cpp b/src/libspl/source/spl_plugininfo.cpp
new file mode 100644
index 0000000..7107b78
--- /dev/null
+++ b/src/libspl/source/spl_plugininfo.cpp
@@ -0,0 +1,423 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Ren� Stuhr (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_plugininfo.cpp
+/// @version	1.0
+/// @author		Ren� Stuhr
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLUGININFO_H__
+#include	"spl_plugininfo.h"
+#endif
+
+#ifndef		__SPL_THREADLOCK_H__
+#include	"spl_threadlock.h"
+#endif
+
+using namespace SPL;
+
+slcPluginInfo::slcPluginInfo( void ) : m_lMajor( -1 ),
+									   m_lMinor( -1 ),
+									   m_lBuild( -1 ),
+									   m_bPuplicArgInfos( false )
+{
+
+}
+
+slcPluginInfo::slcPluginInfo( const slcPluginInfo& a_pluginInfo )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	this->m_lMajor = a_pluginInfo.m_lMajor;
+	this->m_lMinor = a_pluginInfo.m_lMinor;
+	this->m_lBuild = a_pluginInfo.m_lBuild;
+
+	this->m_bPuplicArgInfos = a_pluginInfo.m_bPuplicArgInfos;
+
+	this->m_strDescription	= a_pluginInfo.m_strDescription;
+	this->m_strEmail		= a_pluginInfo.m_strEmail;
+	this->m_strHomepage		= a_pluginInfo.m_strHomepage;
+	this->m_strInfo			= a_pluginInfo.m_strInfo;
+	this->m_strName			= a_pluginInfo.m_strName;
+	this->m_strUUID			= a_pluginInfo.m_strUUID;
+	this->m_strVendor		= a_pluginInfo.m_strVendor;
+
+    this->m_mapInitArgs		= a_pluginInfo.m_mapInitArgs;
+	this->m_mapRunArgs		= a_pluginInfo.m_mapRunArgs;
+	this->m_mapShutdownArgs = a_pluginInfo.m_mapShutdownArgs;
+	this->itmapArgs			= a_pluginInfo.itmapArgs;
+}
+
+slcPluginInfo::~slcPluginInfo( void )
+{
+
+}
+
+void slcPluginInfo::Clear( void )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	this->m_lMajor = -1;
+	this->m_lMinor = -1;
+	this->m_lBuild = -1;
+	this->m_bPuplicArgInfos = false;
+
+	//
+	// CLEANUP ALL MAP ENTRYS
+	//
+	this->m_mapInitArgs.clear();
+	this->m_mapShutdownArgs.clear();
+	this->m_mapRunArgs.clear();
+}
+
+//
+// ARGUMENT INFO FUNCTIONS
+//
+
+long slcPluginInfo::GetArgCount( sleFunction a_enuFunc ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	long lCount = 0;
+	
+	switch( a_enuFunc )
+	{
+		case sleFunction_Init:
+			lCount = ( long )this->m_mapInitArgs.size( );
+			break;
+
+		case sleFunction_Run:
+			lCount = ( long )this->m_mapRunArgs.size( );
+			break;
+
+		case sleFunction_Shutdown:
+			lCount = ( long )this->m_mapShutdownArgs.size( );
+			break;
+	}
+
+	return lCount;
+}
+
+string slcPluginInfo::GetArgDescription( sleFunction a_enuFunc, const long a_lIndex )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	switch( a_enuFunc )
+	{
+		case sleFunction_Init:
+
+			this->itmapArgs = this->m_mapInitArgs.find( a_lIndex );
+
+			//
+			// NO MATCH FOUND, RETURN AN EMPTY STRING
+			//
+			if( this->itmapArgs == this->m_mapInitArgs.end() )
+				return string( "" );
+
+			break;
+
+		case sleFunction_Shutdown:
+
+			this->itmapArgs = this->m_mapShutdownArgs.find( a_lIndex );
+
+			//
+			// NO MATCH FOUND, RETURN AN EMPTY STRING
+			//
+			if( this->itmapArgs == this->m_mapShutdownArgs.end() )
+				return string( "" );
+
+			break;
+		
+		case sleFunction_Run:
+		default:
+
+			this->itmapArgs = this->m_mapRunArgs.find( a_lIndex );
+
+			//
+			// NO MATCH FOUND, RETURN AN EMPTY STRING
+			//
+			if( this->itmapArgs == this->m_mapRunArgs.end() )
+				return string( "" );
+
+			break;
+	}
+
+	//
+	// SERCH DESCRIPTION SEPARATOR
+	//
+	size_t lPos = this->itmapArgs->second.find_first_of( ';' );
+
+	//
+	// NOT FOUND, RETURN A EMPTY STRING
+	//
+	if ( lPos == string::npos )
+		return string( "" );
+		
+	//
+	// FOUND, RETURN SECOND SUBSTRING
+	//
+	return this->itmapArgs->second.substr( lPos + 1, this->itmapArgs->second.size() - lPos );
+}
+
+string slcPluginInfo::GetArgName( sleFunction a_enuFunc, const long a_lIndex )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	switch( a_enuFunc )
+	{
+		case sleFunction_Init:
+
+			this->itmapArgs = this->m_mapInitArgs.find( a_lIndex );
+
+			//
+			// NO MATCH FOUND, RETURN AN EMPTY STRING
+			//
+			if( this->itmapArgs == this->m_mapInitArgs.end() )
+				return string( "" );
+
+			break;
+
+		case sleFunction_Shutdown:
+
+			this->itmapArgs = this->m_mapShutdownArgs.find( a_lIndex );
+
+			//
+			// NO MATCH FOUND, RETURN AN EMPTY STRING
+			//
+			if( this->itmapArgs == this->m_mapShutdownArgs.end() )
+				return string( "" );
+
+			break;
+
+		case sleFunction_Run:
+		default:
+
+			this->itmapArgs = this->m_mapRunArgs.find( a_lIndex );
+
+			//
+			// NO MATCH FOUND, RETURN AN EMPTY STRING
+			//
+			if( this->itmapArgs == this->m_mapRunArgs.end() )
+				return string( "" );
+
+			break;
+	}
+		
+	//
+	// SERCH DESCRIPTION SEPARATOR
+	//
+	size_t lPos = this->itmapArgs->second.find_first_of( ';' );
+
+	//
+	// NOT FOUND - NO DESCRIPTION USED, RETURN FULL STRING
+	//
+	if ( lPos == string::npos )
+		return this->itmapArgs->second;
+
+	//
+	// FOUND, RETURN FIRST SUBSTRING
+	//
+	return this->itmapArgs->second.substr( 0, lPos );
+}
+
+//
+// PLUGIN INFO FUNCTIONS
+//
+
+string slcPluginInfo::GetName( void )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_strName;
+}
+
+string slcPluginInfo::GetVendor( void )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_strVendor;
+}
+
+string slcPluginInfo::GetInfo( void )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_strInfo;
+}
+
+string slcPluginInfo::GetDescription( void ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_strDescription;
+}
+
+string slcPluginInfo::GetHomepage( void ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_strHomepage;
+}
+
+string slcPluginInfo::GetEmail( void ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_strEmail;
+}
+
+long slcPluginInfo::GetMajorVersion( void ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_lMajor;
+}
+
+long slcPluginInfo::GetMinorVersion( void ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_lMinor;
+}
+
+long slcPluginInfo::GetBuildVersion( void ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_lBuild;
+}
+
+string slcPluginInfo::GetUUID( void ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_strUUID;
+}
+
+
+bool slcPluginInfo::HasPublicArgs( void ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return this->m_bPuplicArgInfos;
+}
+
+slcPluginInfo slcPluginInfo::operator=( const slcPluginInfo& pluginInfo )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	this->m_lMajor = pluginInfo.m_lMajor;
+	this->m_lMinor = pluginInfo.m_lMinor;
+	this->m_lBuild = pluginInfo.m_lBuild;
+
+	this->m_bPuplicArgInfos = pluginInfo.m_bPuplicArgInfos;
+
+	this->m_strDescription	= pluginInfo.m_strDescription;
+	this->m_strEmail		= pluginInfo.m_strEmail;
+	this->m_strHomepage		= pluginInfo.m_strHomepage;
+	this->m_strInfo			= pluginInfo.m_strInfo;
+	this->m_strName			= pluginInfo.m_strName;
+	this->m_strUUID			= pluginInfo.m_strUUID;
+	this->m_strVendor		= pluginInfo.m_strVendor;
+
+	this->m_mapInitArgs		= pluginInfo.m_mapInitArgs;
+	this->m_mapRunArgs		= pluginInfo.m_mapRunArgs;
+	this->m_mapShutdownArgs = pluginInfo.m_mapShutdownArgs;
+	this->itmapArgs			= pluginInfo.itmapArgs;
+
+	return *this;
+}
+
diff --git a/src/libspl/source/spl_pluginserver.cpp b/src/libspl/source/spl_pluginserver.cpp
new file mode 100644
index 0000000..4120a89
--- /dev/null
+++ b/src/libspl/source/spl_pluginserver.cpp
@@ -0,0 +1,95 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_pluginserver.cpp
+/// @version	1.0
+/// @author		Andreas Loeffler
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLUGINSERVER_H__
+#include	"spl_pluginserver.h"
+#endif
+
+#ifndef		__SPL_THREADLOCK_H__
+#include	"spl_threadlock.h"
+#endif
+
+slaPluginServer::slaPluginServer( void )
+{
+
+}
+
+slaPluginServer::~slaPluginServer( void )
+{
+
+}
+
+void slaPluginServer::Clear( void )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	//
+	// cleanup all internal maps
+	//
+	this->m_mapPluginIds.clear();
+	this->m_mapPluginInfos.clear();
+}
+
+slcPluginInfo slaPluginServer::GetSafedPluginInfo( const long a_lIndex ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	this->itInfos  = this->m_mapPluginInfos.find( a_lIndex ); 
+
+	if( this->itInfos != this->m_mapPluginInfos.end() )
+	{
+		return this->itInfos->second;
+	}
+	
+	return this->m_nullInfo;
+}
+
+long slaPluginServer::GetLoadedPlugins( void ) 
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	return( long )this->m_mapPluginIds.size();
+}
+
diff --git a/src/libspl/source/spl_pluginserver_linux.cpp b/src/libspl/source/spl_pluginserver_linux.cpp
new file mode 100644
index 0000000..61802bc
--- /dev/null
+++ b/src/libspl/source/spl_pluginserver_linux.cpp
@@ -0,0 +1,466 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren�Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_pluginserver_linux.cpp
+/// @version	1.0
+/// @author		Andreas Loeffler
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLATFORM_H__
+#include	"spl_platform.h"
+#endif
+
+#ifndef		__SPL_THREADLOCK_H__
+#include	"spl_threadlock.h"
+#endif
+
+#if			SPL_PLATFORM == SPL_PLATFORM_LINUX
+
+#include	<dlfcn.h>
+#include	<sys/types.h>
+#include	<sys/stat.h>
+#include	<dirent.h>
+
+#ifndef		__SPL_PLUGINSERVER_LINUX_H__
+#include	"spl_pluginserver_linux.h"
+#endif
+
+
+slcPluginServer::slcPluginServer( void )
+{
+
+}
+
+slcPluginServer::~slcPluginServer( void )
+{
+	if( this->GetLoadedPlugins() > 0 )
+		this->UnloadAllPlugins();
+}
+
+slcPluginInfo slcPluginServer::GetPluginInfo( const long a_lIndex )
+{
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	if( ( a_lIndex < 0 ) ||
+		( a_lIndex > ( long )this->m_mapPluginInfos.size() ) )
+	{
+		slcPluginInfo invalidInfo;
+		return invalidInfo;
+	}
+
+	this->itIds  = this->m_mapPluginIds.find( a_lIndex ); 
+	if( this->itIds != this->m_mapPluginIds.end() )
+	{
+		SPL_INFO_FUNC pInfoFunc = ( SPL_INFO_FUNC )dlsym( ( void* )( SPL_BITTYPE )itIds->second, 
+														  SPL_GETINFO_NAME );
+		if( NULL != pInfoFunc )
+		{
+			slcPluginInfo plugInfo = *pInfoFunc();
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( this->m_mapPluginInfos.size() , plugInfo ) );
+		}
+		else
+		{
+			//
+			// INFO FUNCTION NOT LOADED, INSERT DUMMY ENTRY TO AVOID ASYNCRON MAPS 
+			//
+			slcPluginInfo nullInfo;
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( this->m_mapPluginInfos.size(), nullInfo ) );
+		}
+	}
+
+	return this->m_mapPluginInfos[ a_lIndex ];
+}
+
+void slcPluginServer::GetAllPluginInfos( void )
+{
+	long l = 0;
+
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	for( this->itIds  = this->m_mapPluginIds.begin(); 
+		 this->itIds != this->m_mapPluginIds.end(); this->itIds++ )
+	{
+		SPL_INFO_FUNC pInfoFunc = ( SPL_INFO_FUNC )dlsym( ( void* )( SPL_BITTYPE )itIds->second, 
+														  SPL_GETINFO_NAME );
+		if( NULL != pInfoFunc )
+		{
+			slcPluginInfo plugInfo = *pInfoFunc();
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( l++, plugInfo ) );
+		}
+		else
+		{
+			//
+			// INFO FUNCTION NOT LOADED, INSERT DUMMY ENTRY TO AVOID ASYNCRON MAPS 
+			//
+			slcPluginInfo nullInfo;
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( l++, nullInfo ) );
+		}
+	}
+}
+
+long slcPluginServer::LoadAllPlugins( const string&		   a_strPath, 
+									  const string&		   a_strWildcard, bool init_plugin,
+									  const	slcPluginArgs* a_pPluginArgs )
+{
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	string strWildcard;
+
+	if( a_strWildcard.empty() )
+		strWildcard = "*.*";
+	else
+		strWildcard = a_strWildcard;
+
+	DIR* dirHandle;
+	struct dirent* dirEntry;
+	struct stat statBuffer;
+	string strFileName;
+	string strExtension;
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	//
+	// OPEN PATH
+	//
+	if( false == ( dirHandle = opendir( a_strPath.c_str() ) ) )
+		return 0;
+
+	//
+	// REMOVE * FROM EXTENSION
+	//
+	strExtension = a_strWildcard;
+        
+	unsigned int iPos = 0;
+	if( ( iPos = strExtension.find( '*', 0 ) ) != string::npos )
+		strExtension.erase( iPos, 1 );
+
+	//
+	// STEP TROUGH DIRECTORY AND FILTER ALL UNWANTED ENTRIES AND DIRECTORIES
+	//
+	while( 0 != ( dirEntry = readdir( dirHandle ) ) )
+	{
+		strFileName = a_strPath;
+
+		//
+		// CHECK IF GIVEN PATH HAS '/' AT END OF STRING
+		// IF NOT APPEND IT
+		//
+		if( strFileName.find( '/', strFileName.length() - 1 ) == string::npos )
+			strFileName += '/';
+
+		//
+		// ADD FOUNDED FILENAME TO FILEPATH
+		//
+		strFileName += dirEntry->d_name;
+                
+		//
+		// GET STATUS FROM FOUND FILE TO FILTER ALL DIRECTORY ENTRIES
+		//
+		stat( strFileName.c_str(), &statBuffer );
+
+		//
+		// IS CURRENT ENTRY A DIRECTORY? SKIP IT!
+		//
+		if( S_ISDIR( statBuffer.st_mode ) )
+			continue;
+
+		//
+		// CHECK FOR VALID EXTENSION, SKIP WRONG EXTENSIONS
+		//
+		if( strFileName.find( strExtension.c_str(),
+			strFileName.length() - strExtension.length() -1 ) == string::npos )
+			continue;
+
+		//
+		// GET PLUGIN HANDLE
+		//
+		void* pvHandle = NULL;
+		if( NULL == ( pvHandle = dlopen( strFileName.c_str(), RTLD_NOW ) ) )
+		{
+			continue;
+		}
+		else
+		{
+			//
+			// ADD HANDLE TO MAP
+			//
+			this->m_mapPluginIds.insert( pair<long, SPL_BITTYPE >( ( long )this->m_mapPluginIds.size(), ( SPL_BITTYPE )pvHandle ) );
+
+			//
+			// EXECUTE INITIALISATION FUNCTION
+			//
+      if( init_plugin ) {
+  			SPL_INIT_FUNC pInitFunc = ( SPL_INIT_FUNC )dlsym( pvHandle , SPL_INIT_NAME );
+        if( pInitFunc != NULL )
+			  {
+  				pInitFunc( pPluginArgs );
+			  }
+      }
+		}
+	}
+
+	closedir( dirHandle );
+	return( long )m_mapPluginIds.size();
+}
+
+long slcPluginServer::LoadPlugin( const string& a_strFileName, bool init_plugin, const slcPluginArgs* a_pPluginArgs )
+{
+	if( a_strFileName.empty() )
+		return -2;
+
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	void* pvHandle = NULL;
+	if( NULL == ( pvHandle = dlopen( a_strFileName.c_str(), RTLD_NOW ) ) )
+		return -2;
+
+	this->m_mapPluginIds.insert( pair<long, SPL_BITTYPE >( ( long )this->m_mapPluginIds.size(), ( SPL_BITTYPE )pvHandle ) );
+
+  if( init_plugin ) {
+  	SPL_INIT_FUNC pInitFunc = ( SPL_INIT_FUNC )dlsym( pvHandle , SPL_INIT_NAME );
+  	if( NULL != pInitFunc )
+  	{
+		  return pInitFunc( pPluginArgs ) ? 1 : 0;
+	  }
+  }
+
+	return -1;
+}
+
+bool slcPluginServer::UnloadPlugin( const long a_lIndex, bool shutdown_plugin, const slcPluginArgs* a_pPluginArgs )
+{
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	this->itIds = this->m_mapPluginIds.find( a_lIndex );
+
+	if( this->itIds != this->m_mapPluginIds.end() )
+	{
+		SPL_SHUTDOWN_FUNC pShutdownFunc = ( SPL_SHUTDOWN_FUNC )dlsym( ( void* )( SPL_BITTYPE )this->itIds->second,
+																	  SPL_SHUTDOWN_NAME );
+		if( NULL != pShutdownFunc )
+		{
+      if( shutdown_plugin ) {
+			  pShutdownFunc( pPluginArgs );
+      }
+		}
+
+		//
+		// DECREASE KERNEL HANDLE COUNTER (0 = LIBRARY IS COMPLETELY UNLOADED)
+		//
+		if( dlclose( ( void* )( SPL_BITTYPE )this->itIds->second ) != 0 )
+			return false;
+
+		//
+		// REMOVE LIBRARY FROM ID-MAP AND INFO-MAP
+		//
+		this->m_mapPluginIds.erase( this->itIds->first );
+		this->m_mapPluginInfos.erase( this->itIds->first );
+
+		//
+		// REFRESH ALL MAP IDS (CREATE NEW KEYS FOR ALL VALUES)
+		//
+		int i = 0;
+
+		long lSize = this->m_mapPluginIds.size();
+		map< long, SPL_BITTYPE > tempIds;
+		map< long, SPL_BITTYPE >::iterator itTempIds;
+		
+		tempIds = this->m_mapPluginIds;
+		this->m_mapPluginIds.clear();
+		itTempIds = tempIds.begin();
+		
+		for( i = 0 ; i < lSize; i++, itTempIds++ )
+			this->m_mapPluginIds.insert( pair<long, SPL_BITTYPE> (i, itTempIds->second ) );
+
+		lSize = this->m_mapPluginInfos.size();
+		map< long, slcPluginInfo > tempInfos;
+		map< long, slcPluginInfo >::iterator itTempInfos;
+		
+		tempInfos = this->m_mapPluginInfos; 
+		this->m_mapPluginInfos.clear();
+		itTempInfos = tempInfos.begin();
+		
+		for( i = 0 ; i < lSize; i++, itTempInfos++ )
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo> (i, itTempInfos->second ) );
+
+		return true;
+	}
+
+	return false;
+}
+
+void slcPluginServer::UnloadAllPlugins( const slcPluginArgs* a_pPluginArgs )
+{
+	long lCount =  ( long )this->m_mapPluginIds.size();
+	for( long l = 0; l < lCount;  l++ )
+	{
+		this->UnloadPlugin( 0, true, a_pPluginArgs );
+	}
+
+	this->Clear();
+}
+
+
+bool slcPluginServer::RunPluginInit( long a_lIndex, const slcPluginArgs* a_pPluginArgs )
+{
+  if( ( a_lIndex < 0 ) ||
+    ( a_lIndex > ( long )this->m_mapPluginInfos.size() ) )
+  {
+    return false;
+  }
+
+  const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+  if( NULL == pPluginArgs )
+    pPluginArgs = &this->m_nullArgs;
+
+  //
+  // Lock this object for exclusive use, unlocks automatical at end of function.
+  // Implicitly usage.
+  //
+  slcThreadLock threadLock( this, true );
+
+  this->itIds = this->m_mapPluginIds.find( a_lIndex );
+  if( this->itIds != this->m_mapPluginIds.end() )
+  {
+    SPL_INIT_FUNC pInitFunc = ( SPL_INIT_FUNC )dlsym( ( void* )( SPL_BITTYPE )this->itIds->second , SPL_INIT_NAME );
+    
+    if( pInitFunc != 0 ) {
+      return pInitFunc( pPluginArgs );
+    } else {
+      return false;
+    }
+  }
+
+  return false;
+}
+
+
+bool slcPluginServer::RunPlugin( long a_lIndex, const slcPluginArgs* a_pPluginArgs )
+{
+	if( ( a_lIndex < 0 ) ||
+		( a_lIndex > ( long )this->m_mapPluginInfos.size() ) )
+	{
+		return false;
+	}
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	this->itIds = this->m_mapPluginIds.find( a_lIndex );
+	if( this->itIds != this->m_mapPluginIds.end() )
+	{
+		SPL_RUN_FUNC pRunFunc = ( SPL_RUN_FUNC )dlsym( ( void* )( SPL_BITTYPE )this->itIds->second,
+													   SPL_RUN_NAME );
+		if( NULL != pRunFunc )
+		{
+			return pRunFunc( pPluginArgs );
+		}
+	}
+
+	return false;
+}
+
+long slcPluginServer::RunAllPlugins( const slcPluginArgs* a_pPluginArgs )
+{
+	long lPluginsRunned = 0;
+
+	if( this->m_mapPluginIds.empty() )
+		return 0;
+
+	for( long l = 0; l < ( long )this->m_mapPluginIds.size(); l++ )
+	{
+		if( this->RunPlugin( l, a_pPluginArgs ) )
+			lPluginsRunned++;
+	}
+
+	return lPluginsRunned;	
+}
+
+long slcPluginServer::Refresh( const string&	    a_strPath, 
+							   const string&	    a_strWildcard, 
+							   const slcPluginArgs* a_pPluginShutdownArgs, 
+							   const slcPluginArgs* a_pPluginInitArgs )
+{
+	this->UnloadAllPlugins( a_pPluginShutdownArgs );
+
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Explicitly usage.
+	//
+	slcThreadLock threadLock( this );
+
+	threadLock.Lock();
+	this->Clear();
+	threadLock.Unlock();
+
+	return( this->LoadAllPlugins( a_strPath, a_strWildcard, true, a_pPluginInitArgs ) ); 
+}
+
+#endif	//	SPL_PLATFORM_LINUX
diff --git a/src/libspl/source/spl_pluginserver_solaris.cpp b/src/libspl/source/spl_pluginserver_solaris.cpp
new file mode 100644
index 0000000..9ad9396
--- /dev/null
+++ b/src/libspl/source/spl_pluginserver_solaris.cpp
@@ -0,0 +1,476 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_pluginserver_solaris.cpp
+/// @version	1.0
+/// @author		Andreas Loeffler
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLATFORM_H__
+#include	"spl_platform.h"
+#endif
+
+#ifndef		__SPL_THREADLOCK_H__
+#include	"spl_threadlock.h"
+#endif
+
+
+#if			SPL_PLATFORM == SPL_PLATFORM_SOLARIS
+
+#include	<dlfcn.h>
+#include	<sys/types.h>
+#include	<sys/stat.h>
+#include	<dirent.h>
+
+#include	"spl_pluginserver_solaris.h"
+
+
+slcPluginServer::slcPluginServer( void )
+{
+
+}
+
+slcPluginServer::~slcPluginServer( void )
+{
+	if( this->GetLoadedPlugins() > 0 )
+		this->UnloadAllPlugins();
+}
+
+slcPluginInfo slcPluginServer::GetPluginInfo( const long a_lIndex )
+{
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	if( ( a_lIndex < 0 ) ||
+		( a_lIndex > ( long )this->m_mapPluginInfos.size() ) )
+	{
+		slcPluginInfo invalidInfo;
+		return invalidInfo;
+	}
+
+	this->itIds  = this->m_mapPluginIds.find( a_lIndex ); 
+	if( this->itIds != this->m_mapPluginIds.end() )
+	{
+		SPL_INFO_FUNC pInfoFunc = ( SPL_INFO_FUNC )dlsym( ( void* )( SPL_BITTYPE )itIds->second, 
+														  SPL_GETINFO_NAME );
+		if( NULL != pInfoFunc )
+		{
+			slcPluginInfo plugInfo = *pInfoFunc();
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( this->m_mapPluginInfos.size() , plugInfo ) );
+		}
+		else
+		{
+			//
+			// INFO FUNCTION NOT LOADED, INSERT DUMMY ENTRY TO AVOID ASYNCRON MAPS 
+			//
+			slcPluginInfo nullInfo;
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( this->m_mapPluginInfos.size(), nullInfo ) );
+		}
+	}
+
+	return this->m_mapPluginInfos[ a_lIndex ];
+}
+
+void slcPluginServer::GetAllPluginInfos( void )
+{
+	long l = 0;
+
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	for( this->itIds  = this->m_mapPluginIds.begin(); 
+		 this->itIds != this->m_mapPluginIds.end(); this->itIds++ )
+	{
+		SPL_INFO_FUNC pInfoFunc = ( SPL_INFO_FUNC )dlsym( ( void* )( SPL_BITTYPE )itIds->second, 
+														  SPL_GETINFO_NAME );
+		if( NULL != pInfoFunc )
+		{
+			slcPluginInfo plugInfo = *pInfoFunc();
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( l++, plugInfo ) );
+		}
+		else
+		{
+			//
+			// INFO FUNCTION NOT LOADED, INSERT DUMMY ENTRY TO AVOID ASYNCRON MAPS 
+			//
+			slcPluginInfo nullInfo;
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( l++, nullInfo ) );
+		}
+	}
+}
+
+long slcPluginServer::LoadAllPlugins( const string&		   a_strPath, 
+									  const string&		   a_strWildcard,  bool init_plugin,
+									  const	slcPluginArgs* a_pPluginArgs )
+{
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	string strWildcard;
+
+	if( a_strWildcard.empty() )
+		strWildcard = "*.so";
+	else
+		strWildcard = a_strWildcard;
+
+	DIR* dirHandle;
+	struct dirent* dirEntry;
+	struct stat statBuffer;
+	string strFileName;
+	string strExtension;
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	//
+	// OPEN PATH
+	//
+	if( false == ( dirHandle = opendir( a_strPath.c_str() ) ) )
+		return 0;
+
+	//
+	// REMOVE * FROM EXTENSION
+	//
+	strExtension = a_strWildcard;
+
+	unsigned int iPos = 0;
+	if( ( iPos = strExtension.find( '*', 0 ) ) != string::npos )
+		strExtension.erase( iPos, 1 );
+
+	//
+	// STEP TROUGH DIRECTORY AND FILTER ALL UNWANTED ENTRIES AND DIRECTORIES
+	//
+	while( 0 != ( dirEntry = readdir( dirHandle ) ) )
+	{
+		strFileName = a_strPath;
+
+		//
+		// CHECK IF GIVEN PATH HAS '/' AT END OF STRING
+		// IF NOT APPEND IT
+		//
+		if( strFileName.find( '/', strFileName.length() - 1 ) == string::npos )
+			strFileName += '/';
+
+		//
+		// ADD FOUNDED FILENAME TO FILEPATH
+		//
+		strFileName += dirEntry->d_name;
+
+		//
+		// GET STATUS FROM FOUND FILE TO FILTER ALL DIRECTORY ENTRIES
+		//
+		stat( strFileName.c_str(), &statBuffer );
+
+		//
+		// IS CURRENT ENTRY A DIRECTORY? SKIP IT!
+		//
+		if( S_ISDIR( statBuffer.st_mode ) )
+			continue;
+
+		//
+		// CHECK FOR VALID EXTENSION, SKIP WRONG EXTENSIONS
+		//
+		if( strFileName.find( strExtension.c_str(),
+			strFileName.length() - strExtension.length() -1 ) == string::npos )
+			continue;
+
+		//
+		// GET PLUGIN HANDLE
+		//
+		void* pvHandle = NULL;
+		if( NULL == ( pvHandle = dlopen( strFileName.c_str(), RTLD_NOW ) ) )
+		{
+			continue;
+		}
+		else
+		{
+			//
+			// ADD HANDLE TO MAP
+			//
+			this->m_mapPluginIds.insert( pair<long, SPL_BITTYPE >( ( long )this->m_mapPluginIds.size(), ( SPL_BITTYPE )pvHandle ) );
+
+			//
+			// EXECUTE INITIALISATION FUNCTION
+			//
+			SPL_INIT_FUNC pInitFunc = ( SPL_INIT_FUNC )dlsym( pvHandle , SPL_INIT_NAME );
+			if( pInitFunc != NULL )
+			{
+        if( init_plugin ) {
+				  pInitFunc( pPluginArgs );
+        }
+			}
+		}
+	}
+
+	closedir( dirHandle );
+	return( long )m_mapPluginIds.size();
+}
+
+long slcPluginServer::LoadPlugin( const string& a_strFileName, bool init_plugin, const slcPluginArgs* a_pPluginArgs )
+{
+	if( a_strFileName.empty() )
+		return -2;
+
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	void* pvHandle = NULL;
+	if( NULL == ( pvHandle = dlopen( a_strFileName.c_str(), RTLD_NOW ) ) )
+		return -2;
+
+	this->m_mapPluginIds.insert( pair<long, SPL_BITTYPE >( ( long )this->m_mapPluginIds.size(), ( SPL_BITTYPE )pvHandle ) );
+
+	SPL_INIT_FUNC pInitFunc = ( SPL_INIT_FUNC )dlsym( pvHandle , SPL_INIT_NAME );
+	if( NULL != pInitFunc )
+	{
+    if( init_plugin ) {
+		  return pInitFunc( pPluginArgs ) ? 1 : 0;
+    } else {
+      return 1;
+    }
+	}
+
+	return -1;
+}
+
+bool slcPluginServer::UnloadPlugin( const long a_lIndex, bool shutdown_plugin, const slcPluginArgs* a_pPluginArgs )
+{
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	this->itIds = this->m_mapPluginIds.find( a_lIndex );
+
+	if( this->itIds != this->m_mapPluginIds.end() )
+	{
+		SPL_SHUTDOWN_FUNC pShutdownFunc = ( SPL_SHUTDOWN_FUNC )dlsym( ( void* )( SPL_BITTYPE )this->itIds->second,
+																	  SPL_SHUTDOWN_NAME );
+		if( NULL != pShutdownFunc )
+		{
+      if( shutdown_plugin ) {
+			  pShutdownFunc( pPluginArgs );
+      }
+		}
+
+		//
+		// DECREASE KERNEL HANDLE COUNTER (0 = LIBRARY IS COMPLETELY UNLOADED)
+		//
+		if( dlclose( ( void* )( SPL_BITTYPE )this->itIds->second ) != 0 )
+			return false;
+
+		//
+		// REMOVE LIBRARY FROM ID-MAP AND INFO-MAP
+		//
+		this->m_mapPluginIds.erase( this->itIds->first );
+		this->m_mapPluginInfos.erase( this->itIds->first );
+
+		//
+		// REFRESH ALL MAP IDS (CREATE NEW KEYS FOR ALL VALUES)
+		//
+		int i = 0;
+
+		long lSize = this->m_mapPluginIds.size();
+		map< long, SPL_BITTYPE > tempIds;
+		map< long, SPL_BITTYPE >::iterator itTempIds;
+		
+		tempIds = this->m_mapPluginIds;
+		this->m_mapPluginIds.clear();
+		itTempIds = tempIds.begin();
+		
+		for( i = 0 ; i < lSize; i++, itTempIds++ )
+			this->m_mapPluginIds.insert( pair<long, SPL_BITTYPE> (i, itTempIds->second ) );
+
+		lSize = this->m_mapPluginInfos.size();
+		map< long, slcPluginInfo > tempInfos;
+		map< long, slcPluginInfo >::iterator itTempInfos;
+		
+		tempInfos = this->m_mapPluginInfos; 
+		this->m_mapPluginInfos.clear();
+		itTempInfos = tempInfos.begin();
+		
+		for( i = 0 ; i < lSize; i++, itTempInfos++ )
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo> (i, itTempInfos->second ) );
+
+		return true;
+	}
+
+	return false;
+}
+
+void slcPluginServer::UnloadAllPlugins( const slcPluginArgs* a_pPluginArgs )
+{
+	long lCount =  ( long )this->m_mapPluginIds.size();
+	for( long l = 0; l < lCount;  l++ )
+	{
+		this->UnloadPlugin( 0, true, a_pPluginArgs );
+	}
+
+	this->Clear();
+}
+
+
+bool slcPluginServer::RunPluginInit(const long a_lIndex, const slcPluginArgs* a_pPluginArgs )
+{
+  if( ( a_lIndex < 0 ) ||
+    ( a_lIndex > ( long )this->m_mapPluginInfos.size() ) )
+  {
+    return false;
+  }
+
+  const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+  if( NULL == pPluginArgs )
+  {
+    pPluginArgs = &this->m_nullArgs;
+  } 
+
+  //
+  // Lock this object for exclusive use, unlocks automatical at end of function.
+  // Implicitly usage.
+  //
+  slcThreadLock threadLock( this, true );
+
+  this->itIds = this->m_mapPluginIds.find( a_lIndex );
+  if( this->itIds != this->m_mapPluginIds.end() )
+  {
+    SPL_INIT_FUNC pInitFunc = ( SPL_INIT_FUNC )dlsym( ( void* )( SPL_BITTYPE )this->itIds->second , SPL_INIT_NAME );
+    if( NULL != pInitFunc )
+    {
+      return pInitFunc( pPluginArgs ) ? 1 : 0;
+    } else {
+      return false;
+    }
+  }
+  
+  return false;
+}
+
+
+// Karg - linking error, the first parameter was long not const long :D
+bool slcPluginServer::RunPlugin(const long a_lIndex, const slcPluginArgs* a_pPluginArgs )
+{
+	if( ( a_lIndex < 0 ) ||
+		( a_lIndex > ( long )this->m_mapPluginInfos.size() ) )
+	{
+		return false;
+	}
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+	{
+		pPluginArgs = &this->m_nullArgs;
+	}	
+
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Implicitly usage.
+	//
+	slcThreadLock threadLock( this, true );
+
+	this->itIds = this->m_mapPluginIds.find( a_lIndex );
+	if( this->itIds != this->m_mapPluginIds.end() )
+	{
+		SPL_RUN_FUNC pRunFunc = ( SPL_RUN_FUNC )dlsym( ( void* )( SPL_BITTYPE )this->itIds->second,
+													   SPL_RUN_NAME );
+		
+		// Karg - not finding a symbol in a plugin is a fairly serious error - maybe log it with dlerror()
+		if( NULL != pRunFunc )
+		{
+			return pRunFunc( pPluginArgs );
+		}
+	}
+	
+	return false;
+}
+
+long slcPluginServer::RunAllPlugins( const slcPluginArgs* a_pPluginArgs )
+{
+	long lPluginsRunned = 0;
+	
+	if( this->m_mapPluginIds.empty() )
+	{
+		return 0;
+	}	
+
+	for( long l = 0; l < ( long )this->m_mapPluginIds.size(); l++ )
+	{
+		if( this->RunPlugin( l, a_pPluginArgs ) )
+			lPluginsRunned++;
+	}
+
+	return lPluginsRunned;	
+}
+
+long slcPluginServer::Refresh( const string&	    a_strPath, 
+							   const string&	    a_strWildcard, 
+							   const slcPluginArgs* a_pPluginShutdownArgs, 
+							   const slcPluginArgs* a_pPluginInitArgs )
+{
+	this->UnloadAllPlugins( a_pPluginShutdownArgs );
+
+	//
+	// Lock this object for exclusive use, unlocks automatical at end of function.
+	// Explicitly usage.
+	//
+	slcThreadLock threadLock( this );
+
+	threadLock.Lock();
+	this->Clear();
+	threadLock.Unlock();
+
+	return( this->LoadAllPlugins( a_strPath, a_strWildcard, a_pPluginInitArgs ) ); 
+}
+
+#endif	//	SPL_PLATFORM_SOLARIS
diff --git a/src/libspl/source/spl_pluginserver_win32.cpp b/src/libspl/source/spl_pluginserver_win32.cpp
new file mode 100644
index 0000000..8e36200
--- /dev/null
+++ b/src/libspl/source/spl_pluginserver_win32.cpp
@@ -0,0 +1,450 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_pluginserver_win32.cpp
+/// @version	1.0
+/// @author		Andreas Loeffler
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_PLATFORM_H__
+#include	"spl_platform.h"
+#endif
+
+
+#if			SPL_PLATFORM == SPL_PLATFORM_WIN32
+
+#define		_WIN32_WINNT 0x0400
+
+#ifndef		_WINDOWS_
+#include	<windows.h>
+#endif
+
+#ifndef		__SPL_PLUGINSERVER_WIN32_H__
+#include	"spl_pluginserver_win32.h"
+#endif
+
+#ifndef		__SPL_THREADLOCK_H__
+#include	"spl_threadlock.h"
+#endif
+
+//
+// Disable warning messages
+//
+#pragma warning( disable : 4311 4312 4267 )  
+
+slcPluginServer::slcPluginServer( void )
+{
+
+}
+
+slcPluginServer::~slcPluginServer( void )
+{
+	if( this->GetLoadedPlugins() > 0 )
+		this->UnloadAllPlugins();
+}
+
+slcPluginInfo slcPluginServer::GetPluginInfo( const long a_lIndex )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	if( ( a_lIndex < 0 ) ||
+		( a_lIndex > ( long )this->m_mapPluginInfos.size() ) )
+	{
+		slcPluginInfo invalidInfo;
+		return invalidInfo;
+	}
+
+	this->itIds  = this->m_mapPluginIds.find( a_lIndex ); 
+	if( this->itIds != this->m_mapPluginIds.end() )
+	{
+		SPL_INFO_FUNC pInfoFunc = ( SPL_INFO_FUNC )::GetProcAddress( ( HMODULE )( SPL_BITTYPE )this->itIds->second, 	SPL_GETINFO_NAME );
+		if( NULL != pInfoFunc )
+		{
+			slcPluginInfo plugInfo = *pInfoFunc();
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( this->m_mapPluginInfos.size() , plugInfo ) );
+		}
+		else
+		{
+			//
+			// INFO FUNCTION NOT LOADED, INSERT DUMMY ENTRY TO AVOID ASYNCRON MAPS 
+			//
+			slcPluginInfo nullInfo;
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( this->m_mapPluginInfos.size(), nullInfo ) );
+		}
+	}
+
+	return this->m_mapPluginInfos[ a_lIndex ];
+}
+
+void slcPluginServer::GetAllPluginInfos( void )
+{
+	long l = 0;
+
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	for( this->itIds  = this->m_mapPluginIds.begin(); 
+		 this->itIds != this->m_mapPluginIds.end(); this->itIds++ )
+	{
+		SPL_INFO_FUNC pInfoFunc = ( SPL_INFO_FUNC )::GetProcAddress( ( HMODULE )( SPL_BITTYPE )this->itIds->second, 
+																	 SPL_GETINFO_NAME );
+		if( NULL != pInfoFunc )
+		{
+			slcPluginInfo plugInfo = *pInfoFunc();
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( l++, plugInfo ) );
+		}
+		else
+		{
+			//
+			// INFO FUNCTION NOT LOADED, INSERT DUMMY ENTRY TO AVOID ASYNCRON MAPS 
+			//
+			slcPluginInfo nullInfo;
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo>( l++, nullInfo ) );
+		}
+	}
+}
+
+long slcPluginServer::LoadAllPlugins( const string&		   a_strPath, 
+									  const string&		   a_strWildcard, bool init_plugin,
+									  const	slcPluginArgs* a_pPluginArgs )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	WIN32_FIND_DATA FindData;
+	string strWildcard;
+
+	if( a_strWildcard.empty() )
+		strWildcard = "*.dll";
+	else
+		strWildcard = a_strWildcard;
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	::SetCurrentDirectory( a_strPath.c_str() );
+	HANDLE hDirectory = ::FindFirstFileEx( strWildcard.c_str(), FindExInfoStandard, 
+		&FindData, FindExSearchNameMatch, NULL, 0 );
+
+	if( hDirectory != INVALID_HANDLE_VALUE )
+	{
+		do {
+			if( ( strcmp( FindData.cFileName, "." ) != 0 ) &&
+				( strcmp( FindData.cFileName, ".." ) != 0 ) )
+			{
+				HMODULE hModule = ::LoadLibrary( FindData.cFileName );
+				if ( NULL != hModule )
+				{ 
+					  SPL_INIT_FUNC pInitFunc =( SPL_INIT_FUNC )::GetProcAddress( ( HINSTANCE )hModule, 
+																				SPL_INIT_NAME );
+					  if( NULL != pInitFunc )
+					  {
+              if( init_plugin ) {
+						   pInitFunc( pPluginArgs );
+              }
+						  this->m_mapPluginIds.insert( pair< long, SPL_BITTYPE >( ( long )this->m_mapPluginIds.size(), ( SPL_BITTYPE )hModule ) );
+					  }
+				}
+			}	
+		} 
+		while( ::FindNextFile( hDirectory, &FindData ) );
+
+		::FindClose( hDirectory );
+	}
+
+	return ( long )this->m_mapPluginIds.size();
+}
+
+long slcPluginServer::LoadPlugin( const string& a_strFileName, bool init_plugin, const slcPluginArgs* a_pPluginArgs )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	if( a_strFileName.empty() )
+		return -2;
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	HMODULE hModule = ::LoadLibrary( a_strFileName.c_str() );
+
+	if ( NULL != hModule )
+	{ 
+		SPL_INIT_FUNC pInitFunc =( SPL_INIT_FUNC )::GetProcAddress( ( HINSTANCE )hModule, 
+																	SPL_INIT_NAME );
+
+		this->m_mapPluginIds.insert( pair< long, SPL_BITTYPE >( ( long )this->m_mapPluginIds.size(), ( SPL_BITTYPE )hModule ) );
+		if( NULL != pInitFunc )
+		{
+      if( init_plugin ) {
+			 return pInitFunc( pPluginArgs ) ? 1 : 0;
+      } else {
+        return 1;
+      }
+		}
+
+		return -1;
+	}
+
+	return -2;
+}
+
+bool slcPluginServer::UnloadPlugin( const long a_lIndex, bool shutdown_plugin, const slcPluginArgs* a_pPluginArgs )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	if( ( a_lIndex < 0 ) ||
+		( a_lIndex > ( long )this->m_mapPluginInfos.size() ) )
+	{
+		return false;
+	}
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	this->itIds = this->m_mapPluginIds.find( a_lIndex );
+
+	if( this->itIds != this->m_mapPluginIds.end() )
+	{
+		SPL_SHUTDOWN_FUNC pShutdownFunc =( SPL_SHUTDOWN_FUNC )::GetProcAddress( ( HINSTANCE )this->itIds->second, 
+																				SPL_SHUTDOWN_NAME );
+		if( NULL != pShutdownFunc )
+		{
+      if( shutdown_plugin ) {
+			  pShutdownFunc( pPluginArgs );
+      }
+		}
+
+		//
+		// UNLOAD LIBRARY
+		//
+		::FreeLibrary( ( HMODULE )this->itIds->second ); 
+
+		//
+		// REMOVE LIBRARY FROM ID-MAP AND INFO-MAP
+		//
+		this->m_mapPluginInfos.erase( this->itIds->first );
+		this->m_mapPluginIds.erase( this->itIds->first );
+
+		//
+		// REFRESH ALL MAP IDS (CREATE NEW KEYS FOR ALL VALUES)
+		//
+		int i = 0;
+
+		long lSize = this->m_mapPluginIds.size();
+		map< long, SPL_BITTYPE > tempIds;
+		map< long, SPL_BITTYPE >::iterator itTempIds;
+		
+		tempIds = this->m_mapPluginIds;
+		this->m_mapPluginIds.clear();
+		itTempIds = tempIds.begin();
+		
+		for( i = 0 ; i < lSize; i++, itTempIds++ )
+			this->m_mapPluginIds.insert( pair<long, SPL_BITTYPE> (i, itTempIds->second ) );
+
+		lSize = this->m_mapPluginInfos.size();
+		map< long, slcPluginInfo > tempInfos;
+		map< long, slcPluginInfo >::iterator itTempInfos;
+		
+		tempInfos = this->m_mapPluginInfos; 
+		this->m_mapPluginInfos.clear();
+		itTempInfos = tempInfos.begin();
+		
+		for( i = 0 ; i < lSize; i++, itTempInfos++ )
+			this->m_mapPluginInfos.insert( pair<long, slcPluginInfo> (i, itTempInfos->second ) );
+
+		return true;
+	}
+
+	return false;
+}
+
+void slcPluginServer::UnloadAllPlugins( const slcPluginArgs* a_pPluginArgs )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	long lCount =  ( long )this->m_mapPluginIds.size();
+	for( long l = 0; l < lCount;  l++ )
+	{
+		this->UnloadPlugin( 0, true, a_pPluginArgs );
+	}
+
+	this->Clear();
+}
+
+
+bool slcPluginServer::RunPluginInit( long a_lIndex, const slcPluginArgs* a_pPluginArgs )
+{
+  //
+  // LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+  // IMPLICIT USAGE.
+  //
+  slcThreadLock threadLock( this, true );
+
+  const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+  if( NULL == pPluginArgs )
+    pPluginArgs = &this->m_nullArgs;
+
+  if( ( a_lIndex < 0 ) ||
+    ( a_lIndex > ( long )this->m_mapPluginInfos.size() ) )
+  {
+    return false;
+  }
+
+  this->itIds = this->m_mapPluginIds.find( a_lIndex );
+  if( this->itIds != this->m_mapPluginIds.end() )
+  {
+    SPL_INIT_FUNC pInitFunc =( SPL_INIT_FUNC )::GetProcAddress( ( HINSTANCE )this->itIds->second, 
+                                  SPL_INIT_NAME );
+
+    if( NULL != pInitFunc )
+    {
+      return pInitFunc( pPluginArgs ) ? 1 : 0;
+    } else {
+      return false;
+    }
+  }
+
+  return false;
+}
+
+
+bool slcPluginServer::RunPlugin( long a_lIndex, const slcPluginArgs* a_pPluginArgs )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	if( ( a_lIndex < 0 ) ||
+		( a_lIndex > ( long )this->m_mapPluginInfos.size() ) )
+	{
+		return false;
+	}
+
+	this->itIds = this->m_mapPluginIds.find( a_lIndex );
+	if( this->itIds != this->m_mapPluginIds.end() )
+	{
+		SPL_RUN_FUNC pRunFunc =( SPL_RUN_FUNC )::GetProcAddress( ( HINSTANCE )this->itIds->second, 
+																 SPL_RUN_NAME );
+		if( NULL != pRunFunc )
+		{
+			return pRunFunc( pPluginArgs );
+		}
+	}
+
+	return false;
+}
+
+long slcPluginServer::RunAllPlugins( const slcPluginArgs* a_pPluginArgs )
+{
+	//
+	// LOCKS OBJECT FOR EXCLUSIVE USE, UNLOCKS AUTOMATICALLY AT THE END OF FUNCTION.
+	// IMPLICIT USAGE.
+	//
+	slcThreadLock threadLock( this, true );
+
+	long lPluginsRunned = 0;
+	const slcPluginArgs* pPluginArgs = a_pPluginArgs; 
+
+	if( NULL == pPluginArgs )
+		pPluginArgs = &this->m_nullArgs;
+
+	if( this->m_mapPluginIds.empty() )
+		return 0;
+
+	for( long l = 0; l < ( long )this->m_mapPluginIds.size(); l++ )
+	{
+		if( this->RunPlugin( l, pPluginArgs ) )
+			lPluginsRunned++;
+	}
+
+	return lPluginsRunned;
+}
+
+long slcPluginServer::Refresh( const string&	    a_strPath, 
+							   const string&	    a_strWildcard, 
+							   const slcPluginArgs* a_pPluginShutdownArgs, 
+							   const slcPluginArgs*	a_pPluginInitArgs )
+{
+	this->UnloadAllPlugins( a_pPluginShutdownArgs );
+
+	//
+	// Lock this object for exclusive use.
+	// Explicitly usage.
+	//
+	slcThreadLock threadLock( this );
+
+	threadLock.Lock();
+	this->Clear();
+	threadLock.Unlock();
+
+	return( this->LoadAllPlugins( a_strPath, a_strWildcard, true, a_pPluginInitArgs ) > 0 ); 
+}
+
+//
+// Enable warning messages
+//
+#pragma warning( default : 4311 4312 4267 )  
+
+
+#endif	//	SPL_PLATFORM_WIN32
diff --git a/src/libspl/source/spl_threadlock.cpp b/src/libspl/source/spl_threadlock.cpp
new file mode 100644
index 0000000..f6892ce
--- /dev/null
+++ b/src/libspl/source/spl_threadlock.cpp
@@ -0,0 +1,84 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Ren� Stuhr (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl_threadlock.cpp
+/// @version	1.0
+/// @author		Ren� Stuhr
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_THREADLOCK_H__
+#include	"spl_threadlock.h"
+#endif
+
+using namespace SPL;
+
+slcThreadLock::slcThreadLock( slcMutex* a_pMutex, bool a_bLock ) : m_lLockCount( 0 )
+{
+	this->m_pMutex = a_pMutex;
+
+	if( a_bLock )
+		this->Lock();
+}
+
+slcThreadLock::~slcThreadLock( void )
+{
+	while( this->m_lLockCount > 0 )
+		this->Unlock();
+}
+
+void slcThreadLock::Lock( void )
+{
+	if( this->m_pMutex )
+	{
+		this->m_pMutex->Lock();
+		this->m_lLockCount ++;
+	}
+}
+
+long slcThreadLock::TryLock( void )
+{
+	long lResult = 0;
+
+	if( this->m_pMutex )
+	{
+		lResult = this->m_pMutex->TryLock();
+		if( lResult != EBUSY )		///< Lock success?
+			this->m_lLockCount ++;  ///< Incrase lock counter
+	}
+
+	return lResult;
+}
+
+void slcThreadLock::Unlock( void )
+{
+	if( this->m_pMutex )
+	{
+		this->m_pMutex->Unlock();
+		this->m_lLockCount--;
+	}
+}
diff --git a/src/libspl/spl.h b/src/libspl/spl.h
new file mode 100644
index 0000000..a6a256f
--- /dev/null
+++ b/src/libspl/spl.h
@@ -0,0 +1,264 @@
+
+/*!
+
+\section terms_of_use Terms of Use
+
+libspl - the simple plugin layer library.
+Copyright (C) 2004 Andreas Loeffler and Ren� Stuhr (www.unitedbytes.de).
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+\section author Author
+Andreas Loeffler (www.unitedbytes.de)
+
+*/
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @file		spl.h
+/// @version	1.0
+/// @brief		SPL's main header.
+/// @author		Andreas Loeffler
+//---------------------------------------------------------------------------------------------------------------------------
+
+#ifndef		__SPL_H__
+#define		__SPL_H__
+
+#ifndef		__SPL_PLATFORM_H__
+#include	"include/spl_platform.h"
+#endif
+
+#ifndef		__SPL_TYPEDEFS_H__
+#include	"include/spl_typedefs.h"
+#endif
+
+#ifndef		__SPL_PLUGINARGS_H__
+#include	"include/spl_pluginargs.h"
+#endif
+
+#ifndef		__SPL_PLUGININFO_H__
+#include	"include/spl_plugininfo.h"
+#endif
+
+#ifndef		__SPL_PLUGINSERVER_H__
+#include	"include/spl_pluginserver.h"
+#endif
+
+#if SPL_PLATFORM == SPL_PLATFORM_WIN32
+
+	#ifndef		__SPL_PLUGINSERVER_WIN32_H__
+	#include	"include/spl_pluginserver_win32.h"
+	#endif
+
+#elif SPL_PLATFORM == SPL_PLATFORM_LINUX
+
+	#ifndef		__SPL_PLUGINSERVER_LINUX_H__
+	#include	"include/spl_pluginserver_linux.h"
+	#endif
+
+#elif SPL_PLATFORM == SPL_PLATFORM_SOLARIS
+
+	#ifndef		__SPL_PLUGINSERVER_SOLARIS_H__
+	#include	"include/spl_pluginserver_solaris.h"
+	#endif
+
+#endif
+
+#include		<string>
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		Macro for exporting SPL functions.
+//-----------------------------------------------------------------------------------------------------------------------
+#if SPL_PLATFORM == SPL_PLATFORM_WIN32
+
+	#define SPL_PLUGIN_API		__declspec( dllexport )
+
+#elif SPL_PLATFORM == SPL_PLATFORM_LINUX
+
+	#define SPL_PLUGIN_API		extern "C"
+
+#elif SPL_PLATFORM == SPL_PLATFORM_SOLARIS
+
+	#define SPL_PLUGIN_API		extern "C"
+
+#else
+
+	#define SPL_PLUGIN_API
+
+#endif
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		Macro for exporting SPL's default functions.
+//-----------------------------------------------------------------------------------------------------------------------
+#if SPL_PLATFORM == SPL_PLATFORM_WIN32
+	
+	#define SPL_DEFINE_PLUGIN_EXPORTS()													\
+																						\
+		extern "C" SPL_PLUGIN_API bool splInitialize( slcPluginArgs* a_pPluginArgs );	\
+		extern "C" SPL_PLUGIN_API bool splRun( slcPluginArgs* a_pPluginArgs );			\
+		extern "C" SPL_PLUGIN_API bool splShutdown( slcPluginArgs* a_pPluginArgs );		\
+		extern "C" SPL_PLUGIN_API slcPluginInfo* splGetInfo( void );
+
+	#define SPL_DEFINE_PLUGIN_DLLMAIN()							\
+																\
+		BOOL APIENTRY DllMain( HANDLE a_hModule,				\
+							   DWORD  a_dwReasonForCall,		\
+							   LPVOID a_lpReserved )			\
+		{														\
+			switch( a_dwReasonForCall )							\
+			{													\
+				case DLL_PROCESS_ATTACH:						\
+				case DLL_THREAD_ATTACH:							\
+				case DLL_THREAD_DETACH:							\
+				case DLL_PROCESS_DETACH:						\
+					break;										\
+			}													\
+																\
+			return TRUE;										\
+		}
+
+#else 
+
+	#define SPL_DEFINE_PLUGIN_DLLMAIN()
+	#define SPL_DEFINE_PLUGIN_EXPORTS()
+
+#endif
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		Macro for exporting SPL's default functions.
+//-----------------------------------------------------------------------------------------------------------------------
+#define SPL_DEFINE_PLUGIN_INFO( a_lBuildNumber,					\
+								a_lMajorVersion,				\
+								a_lMinorVersion,				\
+								a_bPublicArgInfos,				\
+								a_strName,						\
+								a_strVendor,					\
+								a_strDescription,				\
+								a_strInfo,						\
+								a_strHomepage,					\
+								a_strEmail,						\
+								a_strUUID )						\
+																\
+	class _pluginInfo : public slcPluginInfo					\
+	{															\
+		public:													\
+																\
+			_pluginInfo( void )					\
+			{													\
+				this->m_lBuild = a_lBuildNumber;				\
+				this->m_lMajor = a_lMajorVersion;				\
+				this->m_lMinor = a_lMinorVersion;				\
+				this->m_bPuplicArgInfos = a_bPublicArgInfos;	\
+				this->m_strName = a_strName;					\
+				this->m_strVendor = a_strVendor;				\
+				this->m_strDescription = a_strDescription;		\
+				this->m_strInfo = a_strInfo;					\
+				this->m_strHomepage = a_strHomepage;			\
+				this->m_strEmail = a_strEmail;					\
+				this->m_strUUID = a_strUUID;					\
+																\
+				this->m_mapInitArgs.clear();					\
+				this->m_mapRunArgs.clear();						\
+				this->m_mapShutdownArgs.clear();				\
+			};													\
+																\
+			bool SetArgument( int         a_iFunc,				\
+							  string	  a_strArgument,		\
+							  string	  a_strDesc )			\
+			{														\
+				string strFinal = a_strArgument + ";" + a_strDesc;	\
+																	\
+				switch( a_iFunc )								\
+				{												\
+					case 0:										\
+																\
+						this->m_mapInitArgs.insert( pair< long, string >( ( long )this->m_mapInitArgs.size(), strFinal ) );					\
+						break;																												\
+																																			\
+					case 2:																								\
+																																			\
+						this->m_mapShutdownArgs.insert( pair< long, string >( ( long )this->m_mapShutdownArgs.size(), strFinal ) );			\
+						break;																												\
+																																			\
+					case 1:																									\
+					default:																												\
+																																			\
+						this->m_mapRunArgs.insert( pair< long, string >( ( long )this->m_mapRunArgs.size(), strFinal ) );					\
+						break;																												\
+				}												\
+																\
+				return true;									\
+			};													\
+	};															\
+																\
+	_pluginInfo g_pluginInfo;
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		Macro for setting the plugin-side arguments for the "splInitialize" function.
+//-----------------------------------------------------------------------------------------------------------------------
+#define SPL_SET_PLUGIN_INIT_ARGUMENT( a_strArgumentName, a_strArgumentDescription )		\
+																						\
+	g_pluginInfo.SetArgument( slcPluginInfo::sleFunction_Init, a_strArgumentName, a_strArgumentDescription );										
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		Macro for setting the plugin-side arguments for the "splRun" function.
+//-----------------------------------------------------------------------------------------------------------------------
+#define SPL_SET_PLUGIN_RUN_ARGUMENT( a_strArgumentName, a_strArgumentDescription )		\
+																						\
+	g_pluginInfo.SetArgument( slcPluginInfo::sleFunction_Run, a_strArgumentName, a_strArgumentDescription );
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		Macro for setting the plugin-side arguments for the "splShutdown" function.
+//-----------------------------------------------------------------------------------------------------------------------
+#define SPL_SET_PLUGIN_SHUTDOWN_ARGUMENT( a_strArgumentName, a_strArgumentDescription )		\
+																							\
+	g_pluginInfo.SetArgument( slcPluginInfo::sleFunction_Shutdown, a_strArgumentName, a_strArgumentDescription );
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		Macro for implementing a default "splGetInfo" function.
+//-----------------------------------------------------------------------------------------------------------------------
+#define SPL_IMPLEMENT_PLUGIN_GETINFO()								\
+																	\
+	SPL_PLUGIN_API slcPluginInfo* SPL_GETINFO_NAME_CODE( void )		\
+	{																\
+		return &g_pluginInfo;										\
+	}
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		Macro for implementing a default "splInitialize" function.
+//-----------------------------------------------------------------------------------------------------------------------
+#define SPL_IMPLEMENT_PLUGIN_INITIALIZE()									\
+																			\
+	SPL_PLUGIN_API bool SPL_INIT_NAME_CODE( slcPluginArgs* a_pPluginArgs )	\
+	{																		\
+		return true;														\
+	}
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		Macro for implementing a default "splShutdown" function.
+//-----------------------------------------------------------------------------------------------------------------------
+#define SPL_IMPLEMENT_PLUGIN_SHUTDOWN()											\
+																				\
+	SPL_PLUGIN_API bool SPL_SHUTDOWN_NAME_CODE( slcPluginArgs* a_pPluginArgs )	\
+	{																			\
+		return true;															\
+	}
+
+//-----------------------------------------------------------------------------------------------------------------------
+///	@brief		We're using SPL's namespace from now on ... 
+//-----------------------------------------------------------------------------------------------------------------------
+//using namespace SPL;
+
+#endif	//	__SPL_H__
+
diff --git a/src/qwt/include/qwt.h b/src/qwt/include/qwt.h
new file mode 100644
index 0000000..1140d77
--- /dev/null
+++ b/src/qwt/include/qwt.h
@@ -0,0 +1,22 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_H
+#define QWT_H
+
+#include "qwt_global.h"
+
+/*!
+  Some constants for use within Qwt.
+*/
+namespace Qwt 
+{
+};
+
+#endif
diff --git a/src/qwt/include/qwt_abstract_scale.h b/src/qwt/include/qwt_abstract_scale.h
new file mode 100644
index 0000000..261ca33
--- /dev/null
+++ b/src/qwt/include/qwt_abstract_scale.h
@@ -0,0 +1,67 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_ABSTRACT_SCALE_H
+#define QWT_ABSTRACT_SCALE_H
+
+#include "qwt_global.h"
+
+class QwtScaleEngine;
+class QwtAbstractScaleDraw;
+class QwtScaleDiv;
+class QwtDoubleInterval;
+
+/*!
+  \brief An abstract base class for classes containing a scale 
+
+  QwtAbstractScale is used to provide classes with a QwtScaleDraw, 
+  and a QwtScaleDiv. The QwtScaleDiv might be set explicitely 
+  or calculated by a QwtScaleEngine.
+*/
+
+class QWT_EXPORT QwtAbstractScale
+{
+public:
+    QwtAbstractScale();
+    virtual ~QwtAbstractScale();
+    
+    void setScale(double vmin, double vmax, double step = 0.0);
+    void setScale(const QwtDoubleInterval &, double step = 0.0);
+    void setScale(const QwtScaleDiv &s);
+
+    void setAutoScale();
+    bool autoScale() const;
+
+    void setScaleMaxMajor( int ticks);
+    int scaleMaxMinor() const;
+
+    void setScaleMaxMinor( int ticks);
+    int scaleMaxMajor() const; 
+
+    void setScaleEngine(QwtScaleEngine *);
+    const QwtScaleEngine *scaleEngine() const;
+    QwtScaleEngine *scaleEngine();
+
+protected:
+    void rescale(double vmin, double vmax, double step = 0.0);
+
+    void setAbstractScaleDraw(QwtAbstractScaleDraw *);
+    const QwtAbstractScaleDraw *abstractScaleDraw() const;
+    QwtAbstractScaleDraw *abstractScaleDraw();
+
+    virtual void scaleChange();
+
+private:
+    void updateScaleDraw();
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_abstract_scale_draw.h b/src/qwt/include/qwt_abstract_scale_draw.h
new file mode 100644
index 0000000..4705b3e
--- /dev/null
+++ b/src/qwt/include/qwt_abstract_scale_draw.h
@@ -0,0 +1,141 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_ABSTRACT_SCALE_DRAW_H
+#define QWT_ABSTRACT_SCALE_DRAW_H
+
+#include "qwt_global.h"
+#include "qwt_scale_div.h"
+#include "qwt_text.h"
+
+
+#if QT_VERSION < 0x040000
+class QColorGroup;
+#else
+class QPalette;
+#endif
+class QPainter;
+class QFont;
+class QwtScaleTransformation;
+class QwtScaleMap;
+
+/*!
+  \brief A abstract base class for drawing scales
+
+  QwtAbstractScaleDraw can be used to draw linear or logarithmic scales.
+
+  After a scale division has been specified as a QwtScaleDiv object
+  using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s),
+  the scale can be drawn with the QwtAbstractScaleDraw::draw() member.
+*/
+class QWT_EXPORT QwtAbstractScaleDraw
+{
+public:
+
+    enum ScaleComponent
+    { 
+        /*!
+            Components of a scale
+            \sa QwtAbstractScaleDraw::enableComponent, 
+                QwtAbstractScaleDraw::hasComponent
+        */
+
+        Backbone = 1,
+        Ticks = 2,
+        Labels = 4
+    };
+ 
+    QwtAbstractScaleDraw();
+    QwtAbstractScaleDraw( const QwtAbstractScaleDraw & );
+    virtual ~QwtAbstractScaleDraw();
+
+    QwtAbstractScaleDraw &operator=(const QwtAbstractScaleDraw &);
+    
+    void setScaleDiv(const QwtScaleDiv &s);
+    const QwtScaleDiv& scaleDiv() const;
+
+    void setTransformation(const QwtScaleTransformation&);
+    const QwtScaleMap &map() const;
+
+    void enableComponent(ScaleComponent, bool enable = true);
+    bool hasComponent(ScaleComponent) const;
+
+    void setTickLength(QwtScaleDiv::TickType, int length);
+    int tickLength(QwtScaleDiv::TickType) const;
+    int majTickLength() const;
+
+    void setSpacing(int margin);
+    int spacing() const;
+        
+#if QT_VERSION < 0x040000
+    virtual void draw(QPainter *, const QColorGroup &) const;
+#else
+    virtual void draw(QPainter *, const QPalette &) const;
+#endif
+
+    virtual QwtText label(double) const;
+
+    /*!  
+      Calculate the extent 
+
+      The extent is the distcance from the baseline to the outermost
+      pixel of the scale draw in opposite to its orienatation.
+      It is at least minimumExtent() pixels.
+ 
+      \sa setMinimumExtent(), minimumExtent()
+    */
+    virtual int extent(const QPen &, const QFont &) const = 0;
+
+    void setMinimumExtent(int);
+    int minimumExtent() const;
+
+protected:
+    /*!
+       Draw a tick
+  
+       \param painter Painter
+       \param value Value of the tick
+       \param len Lenght of the tick
+
+       \sa drawBackbone(), drawLabel()
+    */  
+    virtual void drawTick(QPainter *painter, double value, int len) const = 0;
+
+    /*!
+      Draws the baseline of the scale
+      \param painter Painter
+
+      \sa drawTick(), drawLabel()
+    */
+    virtual void drawBackbone(QPainter *painter) const = 0;
+
+    /*!  
+        Draws the label for a major scale tick
+    
+        \param painter Painter
+        \param value Value
+
+        \sa drawTick, drawBackbone
+    */ 
+    virtual void drawLabel(QPainter *painter, double value) const = 0;
+
+    QwtScaleMap &scaleMap();
+
+    void invalidateCache();
+    const QwtText &tickLabel(const QFont &, double value) const;
+
+private:
+    int operator==(const QwtAbstractScaleDraw &) const;
+    int operator!=(const QwtAbstractScaleDraw &) const;
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_abstract_slider.h b/src/qwt/include/qwt_abstract_slider.h
new file mode 100644
index 0000000..6412c43
--- /dev/null
+++ b/src/qwt/include/qwt_abstract_slider.h
@@ -0,0 +1,182 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_ABSTRACT_SLIDER_H
+#define QWT_ABSTRACT_SLIDER_H
+
+#include <qwidget.h>
+#include "qwt_global.h"
+#include "qwt_double_range.h"
+
+/*!
+  \brief An abstract base class for slider widgets
+
+  QwtAbstractSlider is a base class for
+  slider widgets. It handles mouse events
+  and updates the slider's value accordingly. Derived classes
+  only have to implement the getValue() and 
+  getScrollMode() members, and should react to a
+  valueChange(), which normally requires repainting. 
+*/
+
+class QWT_EXPORT QwtAbstractSlider : public QWidget, public QwtDoubleRange
+{
+    Q_OBJECT 
+    Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
+    Q_PROPERTY( bool valid READ isValid WRITE setValid )
+    Q_PROPERTY( double mass READ mass WRITE setMass )
+#ifndef Q_MOC_RUN // Qt3 moc
+#define QWT_PROPERTY Q_PROPERTY
+    Q_PROPERTY( Orientation orientation 
+        READ orientation WRITE setOrientation )
+#else // Qt4 moc
+// MOC_SKIP_BEGIN
+    Q_PROPERTY( Qt::Orientation orientation 
+        READ orientation WRITE setOrientation )
+// MOC_SKIP_END
+#endif
+
+public:
+    enum ScrollMode { ScrNone, ScrMouse, 
+        ScrTimer, ScrDirect, ScrPage };
+    
+    explicit QwtAbstractSlider(Qt::Orientation, QWidget *parent = NULL);
+    virtual ~QwtAbstractSlider();
+
+    void setUpdateTime(int t);
+    void stopMoving();
+    void setTracking(bool enable);
+    
+    virtual void setMass(double val);
+    virtual double mass() const;
+
+#if QT_VERSION >= 0x040000
+    virtual void setOrientation(Qt::Orientation o);
+    Qt::Orientation orientation() const;
+#else
+    virtual void setOrientation(Orientation o);
+    Orientation orientation() const;
+#endif
+
+    bool isReadOnly() const;
+
+    /* 
+        Wrappers for QwtDblRange::isValid/QwtDblRange::setValid made
+        to be available as Q_PROPERTY in the designer.
+    */
+
+    /*! 
+      \sa QwtDblRange::isValid
+    */
+    bool isValid() const { return QwtDoubleRange::isValid(); }
+
+    /*! 
+      \sa QwtDblRange::isValid
+    */
+    void setValid(bool valid) { QwtDoubleRange::setValid(valid); }
+
+public slots:
+    virtual void setValue(double val);
+    virtual void fitValue(double val);
+    virtual void incValue(int steps);
+
+    virtual void setReadOnly(bool); 
+
+signals:
+
+    /*!
+      \brief Notify a change of value.
+
+      In the default setting 
+      (tracking enabled), this signal will be emitted every 
+      time the value changes ( see setTracking() ). 
+      \param value new value
+    */
+    void valueChanged(double value);
+
+    /*!
+      This signal is emitted when the user presses the 
+      movable part of the slider (start ScrMouse Mode).
+    */
+    void sliderPressed();
+
+    /*!
+      This signal is emitted when the user releases the 
+      movable part of the slider.
+    */
+
+    void sliderReleased();
+    /*!
+      This signal is emitted when the user moves the
+      slider with the mouse.
+      \param value new value
+    */
+    void sliderMoved(double value);
+    
+protected:
+    void setPosition(const QPoint &p);
+    virtual void valueChange();
+
+    virtual void timerEvent(QTimerEvent *e);
+    virtual void mousePressEvent(QMouseEvent *e);
+    virtual void mouseReleaseEvent(QMouseEvent *e);
+    virtual void mouseMoveEvent(QMouseEvent *e);
+    virtual void keyPressEvent(QKeyEvent *e);
+    virtual void wheelEvent(QWheelEvent *e);
+
+  /*!
+    \brief Determine the value corresponding to a specified poind
+
+    This is an abstract virtual function which is called when
+    the user presses or releases a mouse button or moves the
+    mouse. It has to be implemented by the derived class.
+    \param p point 
+  */
+    virtual double getValue(const QPoint & p) = 0;
+  /*!
+    \brief Determine what to do when the user presses a mouse button.
+
+    This function is abstract and has to be implemented by derived classes.
+    It is called on a mousePress event. The derived class can determine
+    what should happen next in dependence of the position where the mouse
+    was pressed by returning scrolling mode and direction. QwtAbstractSlider
+    knows the following modes:<dl>
+    <dt>QwtAbstractSlider::ScrNone
+    <dd>Scrolling switched off. Don't change the value.
+    <dt>QwtAbstractSlider::ScrMouse
+    <dd>Change the value while the user keeps the
+        button pressed and moves the mouse.
+    <dt>QwtAbstractSlider::ScrTimer
+    <dd>Automatic scrolling. Increment the value
+        in the specified direction as long as
+    the user keeps the button pressed.
+    <dt>QwtAbstractSlider::ScrPage
+    <dd>Automatic scrolling. Same as ScrTimer, but
+        increment by page size.</dl>
+
+    \param p point where the mouse was pressed
+    \retval scrollMode The scrolling mode
+    \retval direction  direction: 1, 0, or -1.
+  */
+    virtual void getScrollMode( const QPoint &p,
+                  int &scrollMode, int &direction) = 0;
+
+    void setMouseOffset(double);
+    double mouseOffset() const;
+
+    int scrollMode() const;
+
+private:
+    void buttonReleased();
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_analog_clock.h b/src/qwt/include/qwt_analog_clock.h
new file mode 100644
index 0000000..f9d378a
--- /dev/null
+++ b/src/qwt/include/qwt_analog_clock.h
@@ -0,0 +1,85 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_ANALOG_CLOCK_H
+#define QWT_ANALOG_CLOCK_H
+
+#include <qdatetime.h>
+#include "qwt_global.h"
+#include "qwt_dial.h"
+#include "qwt_dial_needle.h"
+
+/*!
+  \brief An analog clock
+
+  \image html analogclock.gif
+
+  \par Example
+  \verbatim #include <qwt_analog_clock.h>
+
+  QwtAnalogClock *clock = new QwtAnalogClock(...);
+  clock->scaleDraw()->setPenWidth(3);
+  clock->setLineWidth(6);
+  clock->setFrameShadow(QwtDial::Sunken);
+  clock->setTime();
+
+  // update the clock every second
+  QTimer *timer = new QTimer(clock);
+  timer->connect(timer, SIGNAL(timeout()), clock, SLOT(setCurrentTime()));
+  timer->start(1000);
+
+  \endverbatim
+
+  Qwt is missing a set of good looking hands.
+  Contributions are very welcome.
+
+  \note The examples/dials example shows how to use QwtAnalogClock.
+*/
+
+class QWT_EXPORT QwtAnalogClock: public QwtDial
+{
+    Q_OBJECT
+
+public:
+    enum Hand
+    {
+        SecondHand,
+        MinuteHand,
+        HourHand,
+
+        NHands
+    };
+
+    explicit QwtAnalogClock(QWidget* parent = NULL);
+    virtual ~QwtAnalogClock();
+
+    virtual void setHand(Hand, QwtDialNeedle *);
+    const QwtDialNeedle *hand(Hand) const;
+    QwtDialNeedle *hand(Hand);
+
+public slots:
+    void setCurrentTime();
+    void setTime(const QTime & = QTime::currentTime());
+
+protected:
+    virtual QwtText scaleLabel(double) const;
+
+    virtual void drawNeedle(QPainter *, const QPoint &,
+        int radius, double direction, QPalette::ColorGroup) const;
+
+    virtual void drawHand(QPainter *, Hand, const QPoint &,
+        int radius, double direction, QPalette::ColorGroup) const;
+
+private:
+    virtual void setNeedle(QwtDialNeedle *);
+
+    QwtDialNeedle *d_hand[NHands];
+};
+
+#endif
diff --git a/src/qwt/include/qwt_array.h b/src/qwt/include/qwt_array.h
new file mode 100644
index 0000000..7dc5806
--- /dev/null
+++ b/src/qwt/include/qwt_array.h
@@ -0,0 +1,29 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_ARRAY_H
+#define QWT_ARRAY_H
+
+#include "qwt_global.h"
+
+/*!
+  \def QwtArray
+ */
+
+#if QT_VERSION < 0x040000
+#include <qmemarray.h>
+#define QwtArray QMemArray
+#else
+#include <qvector.h>
+#define QwtArray QVector
+#endif
+
+#endif
diff --git a/src/qwt/include/qwt_arrow_button.h b/src/qwt/include/qwt_arrow_button.h
new file mode 100644
index 0000000..860b719
--- /dev/null
+++ b/src/qwt/include/qwt_arrow_button.h
@@ -0,0 +1,54 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_ARROW_BUTTON_H
+#define QWT_ARROW_BUTTON_H
+
+#include <qpushbutton.h>
+#include "qwt_global.h"
+
+/*!
+  \brief Arrow Button
+
+  A push button with one or more filled triangles on its front.
+  An Arrow button can have 1 to 3 arrows in a row, pointing
+  up, down, left or right.
+*/
+class QWT_EXPORT QwtArrowButton : public QPushButton
+{
+public:
+    explicit QwtArrowButton (int num, Qt::ArrowType, QWidget *parent = NULL);
+    virtual ~QwtArrowButton();
+
+    Qt::ArrowType arrowType() const;
+    int num() const;
+
+    virtual QSize sizeHint() const;
+    virtual QSize minimumSizeHint() const;
+
+protected:
+#if QT_VERSION >= 0x040000
+    virtual void paintEvent(QPaintEvent *event);
+#endif
+
+    virtual void drawButtonLabel(QPainter *p);
+    virtual void drawArrow(QPainter *, 
+        const QRect &, Qt::ArrowType) const;
+    virtual QRect labelRect() const;
+    virtual QSize arrowSize(Qt::ArrowType,
+        const QSize &boundingSize) const;
+
+    virtual void keyPressEvent(QKeyEvent *);
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_compass.h b/src/qwt/include/qwt_compass.h
new file mode 100644
index 0000000..cb0bb74
--- /dev/null
+++ b/src/qwt/include/qwt_compass.h
@@ -0,0 +1,80 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_COMPASS_H
+#define QWT_COMPASS_H 1
+
+#include <qstring.h>
+#include <qmap.h>
+#include "qwt_dial.h"
+
+#if defined(QWT_TEMPLATEDLL)
+
+#if defined(QT_NO_STL) || QT_VERSION < 0x040000 || QT_VERSION > 0x040001
+/*
+  Unfortunately Qt 4.0.0/Qt 4.0.1 contains uncompilable 
+  code in the STL adaptors of qmap.h. The declaration below 
+  instantiates this code resulting in compiler errors. 
+  If you really need the map to be exported, remove the condition above
+  and fix the qmap.h
+*/
+// MOC_SKIP_BEGIN
+template class QWT_EXPORT QMap<double, QString>;
+// MOC_SKIP_END
+#endif
+
+#endif
+
+
+class QwtCompassRose;
+
+/*!
+  \brief A Compass Widget
+
+  QwtCompass is a widget to display and enter directions. It consists
+  of a scale, an optional needle and rose. 
+
+  \image html compass.gif 
+
+  \note The examples/dials example shows how to use QwtCompass.
+*/
+
+class QWT_EXPORT QwtCompass: public QwtDial 
+{
+    Q_OBJECT
+
+public:
+    explicit QwtCompass( QWidget* parent = NULL);
+    virtual ~QwtCompass();
+
+    void setRose(QwtCompassRose *rose);
+    const QwtCompassRose *rose() const;
+    QwtCompassRose *rose();
+
+    const QMap<double, QString> &labelMap() const;
+    QMap<double, QString> &labelMap();
+    void setLabelMap(const QMap<double, QString> &map);
+
+protected:
+    virtual QwtText scaleLabel(double value) const;
+
+    virtual void drawRose(QPainter *, const QPoint &center,
+        int radius, double north, QPalette::ColorGroup) const;
+
+    virtual void drawScaleContents(QPainter *, 
+        const QPoint &center, int radius) const; 
+
+    virtual void keyPressEvent(QKeyEvent *);
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_compass_rose.h b/src/qwt/include/qwt_compass_rose.h
new file mode 100644
index 0000000..b83454d
--- /dev/null
+++ b/src/qwt/include/qwt_compass_rose.h
@@ -0,0 +1,70 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_COMPASS_ROSE_H
+#define QWT_COMPASS_ROSE_H 1
+
+#include <qpalette.h>
+#include "qwt_global.h"
+
+class QPainter;
+
+class QWT_EXPORT QwtCompassRose
+{
+public:
+    virtual ~QwtCompassRose() {};
+
+    virtual void setPalette(const QPalette &p) { d_palette = p; }
+    const QPalette &palette() const { return d_palette; }
+
+    virtual void draw(QPainter *, const QPoint &center, 
+        int radius, double north, 
+        QPalette::ColorGroup = QPalette::Active) const = 0;
+
+private:
+    QPalette d_palette;
+};
+
+class QWT_EXPORT QwtSimpleCompassRose: public QwtCompassRose
+{
+public:
+    QwtSimpleCompassRose(int numThorns = 8, int numThornLevels = -1);
+
+    void setWidth(double w);
+    double width() const { return d_width; }
+
+    void setNumThorns(int count);
+    int numThorns() const;
+
+    void setNumThornLevels(int count);
+    int numThornLevels() const;
+
+    void setShrinkFactor(double factor) { d_shrinkFactor = factor; }
+    double shrinkFactor() const { return d_shrinkFactor; }
+
+    virtual void draw(QPainter *, const QPoint &center, int radius, 
+        double north, QPalette::ColorGroup = QPalette::Active) const;
+
+    static void drawRose(QPainter *, 
+#if QT_VERSION < 0x040000
+        const QColorGroup &,
+#else
+        const QPalette &,
+#endif
+        const QPoint &center, int radius, double origin, double width, 
+        int numThorns, int numThornLevels, double shrinkFactor);
+
+private:
+    double d_width;     
+    int d_numThorns;        
+    int d_numThornLevels; 
+    double d_shrinkFactor;
+};
+
+#endif // QWT_COMPASS_ROSE_H
diff --git a/src/qwt/include/qwt_counter.h b/src/qwt/include/qwt_counter.h
new file mode 100644
index 0000000..c8375f2
--- /dev/null
+++ b/src/qwt/include/qwt_counter.h
@@ -0,0 +1,153 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_COUNTER_H
+#define QWT_COUNTER_H
+
+#include <qwidget.h>
+#include "qwt_global.h"
+#include "qwt_double_range.h"
+
+/*!
+  \brief The Counter Widget
+
+  A Counter consists of a label displaying a number and
+  one ore more (up to three) push buttons on each side
+  of the label which can be used to increment or decrement
+  the counter's value.
+
+  A Counter has a range from a minimum value to a maximum value
+  and a step size. The range can be specified using
+  QwtDblRange::setRange().
+  The counter's value is an integer multiple of the step size.
+  The number of steps by which a button increments or decrements
+  the value can be specified using QwtCounter::setIncSteps().
+  The number of buttons can be changed with
+  QwtCounter::setNumButtons().
+
+  Holding the space bar down with focus on a button is the
+  fastest method to step through the counter values.
+  When the counter underflows/overflows, the focus is set
+  to the smallest up/down button and counting is disabled.
+  Counting is re-enabled on a button release event (mouse or
+  space bar).
+
+  Example:
+\code
+#include "../include/qwt_counter.h>
+
+QwtCounter *cnt;
+
+cnt = new QwtCounter(parent, name);
+
+cnt->setRange(0.0, 100.0, 1.0);             // From 0.0 to 100, step 1.0
+cnt->setNumButtons(2);                      // Two buttons each side
+cnt->setIncSteps(QwtCounter::Button1, 1);   // Button 1 increments 1 step
+cnt->setIncSteps(QwtCounter::Button2, 20);  // Button 2 increments 20 steps
+
+connect(cnt, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(double)));
+\endcode
+ */
+
+class QWT_EXPORT QwtCounter : public QWidget, public QwtDoubleRange
+{
+    Q_OBJECT
+
+    Q_PROPERTY( int numButtons READ numButtons WRITE setNumButtons )
+    Q_PROPERTY( double basicstep READ step WRITE setStep )
+    Q_PROPERTY( double minValue READ minVal WRITE setMinValue )
+    Q_PROPERTY( double maxValue READ maxVal WRITE setMaxValue )
+    Q_PROPERTY( int stepButton1 READ stepButton1 WRITE setStepButton1 )
+    Q_PROPERTY( int stepButton2 READ stepButton2 WRITE setStepButton2 )
+    Q_PROPERTY( int stepButton3 READ stepButton3 WRITE setStepButton3 )
+    Q_PROPERTY( double value READ value WRITE setValue )
+    Q_PROPERTY( bool editable READ editable WRITE setEditable )
+
+public:
+    /*!
+        Button index
+    */
+
+    enum Button 
+    {   
+        Button1,    
+        Button2,    
+        Button3,    
+        ButtonCnt   
+    };
+
+    explicit QwtCounter(QWidget *parent = NULL);
+    virtual ~QwtCounter();
+
+    bool editable() const;
+    void setEditable(bool);
+ 
+    void setNumButtons(int n);
+    int numButtons() const;
+    
+    void setIncSteps(QwtCounter::Button btn, int nSteps);
+    int incSteps(QwtCounter::Button btn) const;
+
+    virtual void setValue(double);
+    virtual QSize sizeHint() const;
+
+    virtual void polish();
+
+    // a set of dummies to help the designer
+
+    double step() const;
+    void setStep(double s);
+    double minVal() const;
+    void setMinValue(double m);
+    double maxVal() const;
+    void setMaxValue(double m);
+    void setStepButton1(int nSteps);
+    int stepButton1() const;
+    void setStepButton2(int nSteps);
+    int stepButton2() const;
+    void setStepButton3(int nSteps);
+    int stepButton3() const;
+    virtual double value() const;
+
+signals:
+    /*!
+        This signal is emitted when a button has been released
+        \param value The new value
+    */
+    void buttonReleased (double value);  
+
+    /*!
+        This signal is emitted when the counter's value has changed
+        \param value The new value
+    */
+    void valueChanged (double value);
+
+protected:
+    virtual bool event(QEvent *);
+    virtual void wheelEvent(QWheelEvent *);
+    virtual void keyPressEvent(QKeyEvent *);
+    virtual void rangeChange();
+
+private slots:
+    void btnReleased();
+    void btnClicked();
+    void textChanged();
+
+private:
+    void updateButtons();
+    void showNum(double);
+    virtual void valueChange();
+    
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_data.h b/src/qwt/include/qwt_data.h
new file mode 100644
index 0000000..fc2b588
--- /dev/null
+++ b/src/qwt/include/qwt_data.h
@@ -0,0 +1,159 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_DATA_H
+#define QWT_DATA_H 1
+
+#include "qwt_global.h"
+#include "qwt_array.h"
+#include "qwt_double_rect.h"
+
+// MOC_SKIP_BEGIN
+#if defined(QWT_TEMPLATEDLL)
+template class QWT_EXPORT QwtArray<double>;
+#endif 
+// MOC_SKIP_END
+
+/*!
+  \brief QwtData defines an interface to any type of data.
+
+  Classes, derived from QwtData may:
+  - store the data in almost any type of container
+  - calculate the data on the fly instead of storing it
+  - implement data with error bars (this implies subclassing QwtPlot,
+    QwtCurve and QwtPlotCurve)
+
+  \warning In the future, "almost any type of container" may be limited to
+  containers supporting bi-directional iterators like the vector, array
+  and list classes in Qt or in the standard template library.
+ */
+
+class QWT_EXPORT QwtData
+{
+public:
+    QwtData();
+    virtual ~QwtData(); 
+    /*!
+      Return a pointer to a copy (virtual copy constructor)
+     */
+    virtual QwtData *copy() const = 0;
+
+    /*!
+      Return the size of the data set
+     */
+    virtual size_t size() const = 0;
+    /*!
+      Return the x value of data point i
+      \param i Index
+      \return x X value of data point i
+     */
+    virtual double x(size_t i) const = 0;
+    /*!
+      Return the y value of data point i
+      \param i Index
+      \return y Y value of data point i
+     */
+    virtual double y(size_t i) const = 0;
+
+    virtual QwtDoubleRect boundingRect() const;
+
+protected:
+    /*!
+      Assignment operator (virtualized)
+     */
+    QwtData &operator=(const QwtData &);
+};
+
+/*!
+  \brief Data class containing a single QwtArray<QwtDoublePoint> object. 
+ */
+class QWT_EXPORT QwtDoublePointData: public QwtData
+{
+public:
+    /*!
+      Constructor
+      
+      \sa QwtCurve::setData and QwtPlot::setCurveData.
+     */
+    QwtDoublePointData(const QwtArray<QwtDoublePoint> &);
+    QwtDoublePointData &operator=(const QwtDoublePointData &);
+    virtual QwtData *copy() const;
+
+    virtual size_t size() const;
+    virtual double x(size_t i) const;
+    virtual double y(size_t i) const;
+
+    const QwtArray<QwtDoublePoint> data() const;
+
+private:
+    QwtArray<QwtDoublePoint> d_data;
+};
+
+/*!
+  \brief Data class containing two QwtArray<double> objects.
+ */
+
+class QWT_EXPORT QwtArrayData: public QwtData
+{
+public:
+    QwtArrayData(const QwtArray<double> &x, const QwtArray<double> &y);
+    QwtArrayData(const double *x, const double *y, size_t size);
+    QwtArrayData &operator=(const QwtArrayData &);
+    virtual QwtData *copy() const;
+
+    virtual size_t size() const;
+    virtual double x(size_t i) const;
+    virtual double y(size_t i) const;
+
+    const QwtArray<double> &xData() const;
+    const QwtArray<double> &yData() const;
+
+    virtual QwtDoubleRect boundingRect() const;
+
+private:
+    QwtArray<double> d_x;
+    QwtArray<double> d_y;
+};
+
+/*!
+  \brief Data class containing two pointers to memory blocks of doubles.
+ */
+class QWT_EXPORT QwtCPointerData: public QwtData
+{
+public:
+    /*!
+      Constructor
+      
+      \warning The programmer must assure that the memory blocks referenced
+      by the pointers remain valid during the lifetime of the QwtPlotCPointer
+      object.
+      \sa QwtCurve::setRawData and QwtPlot::setCurveRawData.
+     */
+    QwtCPointerData(const double *x, const double *y, size_t size);
+    QwtCPointerData &operator=(const QwtCPointerData &);
+    virtual QwtData *copy() const;
+
+    virtual size_t size() const;
+    virtual double x(size_t i) const;
+    virtual double y(size_t i) const;
+
+    const double *xData() const;
+    const double *yData() const;
+
+    virtual QwtDoubleRect boundingRect() const;
+
+private:
+    const double *d_x;
+    const double *d_y;
+    size_t d_size;
+};
+
+#endif // !QWT_DATA
diff --git a/src/qwt/include/qwt_dial.h b/src/qwt/include/qwt_dial.h
new file mode 100644
index 0000000..93c0e5b
--- /dev/null
+++ b/src/qwt/include/qwt_dial.h
@@ -0,0 +1,209 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_DIAL_H
+#define QWT_DIAL_H 1
+
+#include <qframe.h>
+#include <qpalette.h>
+#include "qwt_global.h"
+#include "qwt_abstract_slider.h"
+#include "qwt_round_scale_draw.h"
+
+class QwtDialNeedle;
+class QwtDial;
+
+/*!
+  A special scale draw made for QwtDial
+  
+  \sa QwtDial, QwtCompass
+*/
+
+class QWT_EXPORT QwtDialScaleDraw: public QwtRoundScaleDraw
+{
+public:
+    explicit QwtDialScaleDraw(QwtDial *);
+    virtual QwtText label(double value) const;
+
+    void setPenWidth(uint);
+    uint penWidth() const;
+
+private:
+    QwtDial *d_parent;
+    int d_penWidth;
+};
+
+/*!
+  \brief QwtDial class provides a rounded range control. 
+
+  QwtDial is intended as base class for dial widgets like
+  speedometers, compass widgets, clocks ... 
+
+  \image html dial.gif
+
+  A dial contains a scale and a needle indicating the current value
+  of the dial. Depending on Mode one of them is fixed and the 
+  other is rotating. If not isReadOnly() the
+  dial can be rotated by dragging the mouse or using keyboard inputs 
+  (see keyPressEvent()). A dial might be wrapping, what means
+  a rotation below/above one limit continues on the other limit (f.e compass).
+  The scale might cover any arc of the dial, its values are related to
+  the origin() of the dial.
+  
+  Qwt is missing a set of good looking needles (QwtDialNeedle).
+  Contributions are very welcome.
+  
+  \sa QwtCompass, QwtAnalogClock, QwtDialNeedle
+  \note The examples/dials example shows different types of dials.
+*/
+
+class QWT_EXPORT QwtDial: public QwtAbstractSlider
+{
+    Q_OBJECT
+
+    Q_ENUMS(Shadow)
+    Q_ENUMS(Mode)
+
+    Q_PROPERTY(bool visibleBackground READ hasVisibleBackground WRITE showBackground)
+    Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth)
+    Q_PROPERTY(Shadow frameShadow READ frameShadow WRITE setFrameShadow)
+    Q_PROPERTY(Mode mode READ mode WRITE setMode)
+    Q_PROPERTY(double origin READ origin WRITE setOrigin)
+    Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping)
+
+    friend class QwtDialScaleDraw;
+public:
+
+    /*!
+        \brief Frame shadow
+
+         Unfortunately it is not possible to use QFrame::Shadow
+         as a property of a widget that is not derived from QFrame.
+         The following enum is made for the designer only. It is safe
+         to use QFrame::Shadow instead.
+     */
+    enum Shadow
+    {
+        Plain = QFrame::Plain,
+        Raised = QFrame::Raised,
+        Sunken = QFrame::Sunken
+    };
+
+    //! see QwtDial::setScaleOptions
+    enum ScaleOptions
+    {
+        ScaleBackbone = 1,
+        ScaleTicks = 2,
+        ScaleLabel = 4
+    };
+
+    /*!
+        In case of RotateNeedle the needle is rotating, in case of
+        RotateScale, the needle points to origin()
+        and the scale is rotating.
+    */
+    enum Mode
+    {
+        RotateNeedle,
+        RotateScale
+    };
+
+    QwtDial( QWidget* parent = NULL);
+    virtual ~QwtDial();
+
+    void setFrameShadow(Shadow);
+    Shadow frameShadow() const;
+
+    bool hasVisibleBackground() const;
+    void showBackground(bool);
+
+    void setLineWidth(int);
+    int lineWidth() const;
+
+    void setMode(Mode);
+    Mode mode() const;
+
+    virtual void setWrapping(bool);
+    bool wrapping() const;
+
+    virtual void setScale(int maxMajIntv, int maxMinIntv, double step = 0.0);
+
+    void setScaleArc(double min, double max);
+    void setScaleOptions(int);
+    void setScaleTicks(int minLen, int medLen, int majLen, int penWidth = 1);
+
+    double minScaleArc() const;
+    double maxScaleArc() const;
+
+    virtual void setOrigin(double);
+    double origin() const;
+
+    virtual void setNeedle(QwtDialNeedle *);
+    const QwtDialNeedle *needle() const;
+    QwtDialNeedle *needle();
+
+    QRect boundingRect() const;
+    QRect contentsRect() const;
+    virtual QRect scaleContentsRect() const;
+
+    virtual QSize sizeHint() const;
+    virtual QSize minimumSizeHint() const;
+
+    virtual void setScaleDraw(QwtDialScaleDraw *);
+
+    QwtDialScaleDraw *scaleDraw();
+    const QwtDialScaleDraw *scaleDraw() const;
+
+protected:
+    virtual void paintEvent(QPaintEvent *);
+    virtual void resizeEvent(QResizeEvent *);
+    virtual void keyPressEvent(QKeyEvent *);
+
+    virtual void updateMask();
+
+    virtual void drawFrame(QPainter *p);
+    virtual void drawContents(QPainter *) const;
+    virtual void drawFocusIndicator(QPainter *) const;
+
+    virtual void drawScale(QPainter *, const QPoint &center,
+        int radius, double origin, double arcMin, double arcMax) const;
+
+    /*!
+      Draw the contents inside the scale
+
+      Paints nothing.
+
+      \param painter Painter
+      \param center Center of the contents circle
+      \param radius Radius of the contents circle
+    */
+    virtual void drawScaleContents(QPainter *painter, const QPoint &center, 
+        int radius) const;
+
+    virtual void drawNeedle(QPainter *, const QPoint &, 
+        int radius, double direction, QPalette::ColorGroup) const;
+
+    virtual QwtText scaleLabel(double) const;
+    void updateScale();
+
+    virtual void rangeChange();
+    virtual void valueChange();
+
+    virtual double getValue(const QPoint &);
+    virtual void getScrollMode(const QPoint &, 
+        int &scrollMode, int &direction);
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_dial_needle.h b/src/qwt/include/qwt_dial_needle.h
new file mode 100644
index 0000000..a144678
--- /dev/null
+++ b/src/qwt/include/qwt_dial_needle.h
@@ -0,0 +1,195 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_DIAL_NEEDLE_H
+#define QWT_DIAL_NEEDLE_H 1
+
+#include <qpalette.h>
+#include "qwt_global.h"
+
+class QPainter;
+class QPoint;
+
+/*!
+  \brief Base class for needles that can be used in a QwtDial.
+
+  QwtDialNeedle is a pointer that indicates a value by pointing 
+  to a specific direction. 
+    
+  Qwt is missing a set of good looking needles. 
+  Contributions are very welcome.
+
+  \sa QwtDial, QwtCompass
+*/
+
+class QWT_EXPORT QwtDialNeedle
+{
+public:
+    QwtDialNeedle();
+    virtual ~QwtDialNeedle();
+
+    /*!
+        Draw the needle
+
+        \param painter Painter
+        \param center Center of the dial, start position for the needle
+        \param length Length of the needle
+        \param direction Direction of the needle, in degrees counter clockwise
+        \param cg Color group, used for painting
+    */
+    virtual void draw(QPainter *painter, const QPoint &center, 
+        int length, double direction, 
+        QPalette::ColorGroup cg = QPalette::Active) const = 0;
+
+    virtual void setPalette(const QPalette &);
+    const QPalette &palette() const; 
+
+protected:
+    static void drawKnob(QPainter *, const QPoint &pos, 
+        int width, const QBrush &, bool sunken);
+
+private:
+    QPalette d_palette;
+};
+
+/*!
+  A needle for dial widgets
+
+  The following colors are used:
+  - QColorGroup::Mid\n
+    Pointer
+  - QColorGroup::base\n
+    Knob
+
+  \sa QwtDial, QwtCompass
+*/
+
+class QWT_EXPORT QwtDialSimpleNeedle: public QwtDialNeedle
+{
+public:
+    enum Style
+    {
+        Arrow,
+        Ray
+    };
+
+    QwtDialSimpleNeedle(Style, bool hasKnob = true, 
+        const QColor &mid = Qt::gray, const QColor &base = Qt::darkGray);
+
+    virtual void draw(QPainter *, const QPoint &, int length, 
+        double direction, QPalette::ColorGroup = QPalette::Active) const;
+
+    static void drawArrowNeedle(QPainter *, 
+        const QPalette&, QPalette::ColorGroup,
+        const QPoint &, int length, int width, double direction, 
+        bool hasKnob);
+
+    static void drawRayNeedle(QPainter *, 
+        const QPalette&, QPalette::ColorGroup,
+        const QPoint &, int length, int width, double direction, 
+        bool hasKnob);
+
+    void setWidth(int width);
+    int width() const;
+
+private:
+    Style d_style;
+    bool d_hasKnob;
+    int d_width;
+};
+
+/*!
+  \brief A magnet needle for compass widgets
+
+  A magnet needle points to two opposite directions indicating
+  north and south.
+
+  The following colors are used:
+  - QColorGroup::Light\n
+    Used for pointing south
+  - QColorGroup::Dark\n
+    Used for pointing north
+  - QColorGroup::Base\n
+    Knob (ThinStyle only)
+
+  \sa QwtDial, QwtCompass
+*/
+
+class QWT_EXPORT QwtCompassMagnetNeedle: public QwtDialNeedle
+{
+public:
+    enum Style
+    {
+        TriangleStyle,
+        ThinStyle
+    };
+    QwtCompassMagnetNeedle(Style = TriangleStyle,
+        const QColor &light = Qt::white, const QColor &dark = Qt::red);
+
+    virtual void draw(QPainter *, const QPoint &, int length, 
+        double direction, QPalette::ColorGroup = QPalette::Active) const;
+
+    static void drawTriangleNeedle(QPainter *, 
+        const QPalette &, QPalette::ColorGroup,
+        const QPoint &, int length, double direction); 
+
+    static void drawThinNeedle(QPainter *,
+        const QPalette &, QPalette::ColorGroup,
+        const QPoint &, int length, double direction);
+
+protected:
+    static void drawPointer(QPainter *painter, const QBrush &brush,
+        int colorOffset, const QPoint &center, 
+        int length, int width, double direction);
+
+private:
+    Style d_style;
+};
+
+/*!
+  \brief An indicator for the wind direction
+
+  QwtCompassWindArrow shows the direction where the wind comes from.
+
+  - QColorGroup::Light\n
+    Used for Style1, or the light half of Style2
+  - QColorGroup::Dark\n
+    Used for the dark half of Style2
+
+  \sa QwtDial, QwtCompass
+*/
+
+class QWT_EXPORT QwtCompassWindArrow: public QwtDialNeedle
+{
+public:
+    enum Style
+    {
+        Style1,
+        Style2
+    };
+
+    QwtCompassWindArrow(Style, const QColor &light = Qt::white,
+        const QColor &dark = Qt::gray);
+
+    virtual void draw(QPainter *, const QPoint &, int length,
+        double direction, QPalette::ColorGroup = QPalette::Active) const;
+
+    static void drawStyle1Needle(QPainter *, 
+        const QPalette &, QPalette::ColorGroup,
+        const QPoint &, int length, double direction);
+
+    static void drawStyle2Needle(QPainter *, 
+        const QPalette &, QPalette::ColorGroup,
+        const QPoint &, int length, double direction);
+
+private:
+    Style d_style;
+};
+
+#endif // QWT_DIAL_NEEDLE_H
diff --git a/src/qwt/include/qwt_double_interval.h b/src/qwt/include/qwt_double_interval.h
new file mode 100644
index 0000000..a7b1055
--- /dev/null
+++ b/src/qwt/include/qwt_double_interval.h
@@ -0,0 +1,151 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_DOUBLE_INTERVAL_H
+#define QWT_DOUBLE_INTERVAL_H
+
+#include "qwt_global.h"
+
+class QWT_EXPORT QwtDoubleInterval
+{
+public:
+    inline QwtDoubleInterval();
+    inline QwtDoubleInterval(double minValue, double maxValue);
+
+    inline void setInterval(double minValue, double maxValue);
+
+    QwtDoubleInterval normalized() const;
+    QwtDoubleInterval invert() const;
+    QwtDoubleInterval limit(double minValue, double maxValue) const;
+
+    inline int operator==(const QwtDoubleInterval &) const;
+    inline int operator!=(const QwtDoubleInterval &) const;
+
+    inline double minValue() const;
+    inline double maxValue() const;
+    
+    inline double width() const;
+
+    inline void setMinValue(double);
+    inline void setMaxValue(double);
+
+    bool contains(double value) const;
+
+    bool intersects(const QwtDoubleInterval &) const;
+    QwtDoubleInterval intersect(const QwtDoubleInterval &) const;
+    QwtDoubleInterval unite(const QwtDoubleInterval &) const;
+
+    inline QwtDoubleInterval operator|(const QwtDoubleInterval &) const;
+    inline QwtDoubleInterval operator&(const QwtDoubleInterval &) const;
+
+    QwtDoubleInterval &operator|=(const QwtDoubleInterval &);
+    QwtDoubleInterval &operator&=(const QwtDoubleInterval &);
+
+    QwtDoubleInterval extend(double value) const;
+    inline QwtDoubleInterval operator|(double) const;
+    QwtDoubleInterval &operator|=(double);
+
+    inline bool isValid() const;
+    inline bool isNull() const;
+    inline void invalidate();
+
+    QwtDoubleInterval symmetrize(double value) const;
+
+private:
+    double d_minValue;
+    double d_maxValue;
+};
+
+inline QwtDoubleInterval::QwtDoubleInterval():
+    d_minValue(0.0),
+    d_maxValue(-1.0)
+{
+}
+
+inline QwtDoubleInterval::QwtDoubleInterval(double minValue, double maxValue):
+    d_minValue(minValue),
+    d_maxValue(maxValue)
+{
+}
+
+inline void QwtDoubleInterval::setInterval(double minValue, double maxValue)
+{
+    d_minValue = minValue;
+    d_maxValue = maxValue;
+}
+
+inline void QwtDoubleInterval::setMinValue(double minValue)
+{   
+    d_minValue = minValue;
+}
+
+inline void QwtDoubleInterval::setMaxValue(double maxValue)
+{
+    d_maxValue = maxValue;
+}
+
+inline double QwtDoubleInterval::minValue() const 
+{ 
+    return d_minValue; 
+}
+
+inline double QwtDoubleInterval::maxValue() const 
+{ 
+    return d_maxValue; 
+}
+
+inline double QwtDoubleInterval::width() const 
+{ 
+    return isValid() ? (d_maxValue - d_minValue) : 0.0; 
+}
+
+inline QwtDoubleInterval QwtDoubleInterval::operator&(
+    const QwtDoubleInterval &interval ) const
+{
+    return intersect(interval);
+}
+
+inline QwtDoubleInterval QwtDoubleInterval::operator|(
+    const QwtDoubleInterval &interval) const
+{
+    return unite(interval);
+}
+
+inline int QwtDoubleInterval::operator==(const QwtDoubleInterval &other) const
+{
+    return (d_minValue == other.d_minValue) &&
+        (d_maxValue == other.d_maxValue);
+}
+
+inline int QwtDoubleInterval::operator!=(const QwtDoubleInterval &other) const
+{
+    return (!(*this == other));
+}
+
+inline QwtDoubleInterval QwtDoubleInterval::operator|(double value) const
+{
+    return extend(value);
+}
+
+inline bool QwtDoubleInterval::isNull() const
+{
+    return d_minValue >= d_maxValue;
+}
+
+inline bool QwtDoubleInterval::isValid() const
+{
+    return d_minValue <= d_maxValue;
+}
+
+inline void QwtDoubleInterval::invalidate()
+{
+    d_minValue = 0.0;
+    d_maxValue = -1.0;
+}
+#endif
diff --git a/src/qwt/include/qwt_double_range.h b/src/qwt/include/qwt_double_range.h
new file mode 100644
index 0000000..dfe36e7
--- /dev/null
+++ b/src/qwt/include/qwt_double_range.h
@@ -0,0 +1,88 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_DOUBLE_RANGE_H
+#define QWT_DOUBLE_RANGE_H
+
+#include "qwt_global.h"
+
+/*!
+  \brief A class which controls a value within an interval
+
+  This class is useful as a base class or a member for sliders.
+  It represents an interval of type double within which a value can
+  be moved. The value can be either an arbitrary point inside 
+  the interval (see QwtDoubleRange::setValue), or it can be fitted
+  into a step raster (see QwtDoubleRange::fitValue and
+  QwtDoubleRange::incValue).
+
+  As a special case, a QwtDoubleRange can be periodic, which means that
+  a value outside the interval will be mapped to a value inside the
+  interval when QwtDoubleRange::setValue(), QwtDoubleRange::fitValue(), 
+  QwtDoubleRange::incValue() or QwtDoubleRange::incPages() are called.
+*/
+
+class QWT_EXPORT QwtDoubleRange
+{
+public:
+    QwtDoubleRange();
+    virtual ~QwtDoubleRange();
+
+    void setRange(double vmin, double vmax, double vstep = 0.0,
+        int pagesize = 1);
+
+    void setValid(bool);
+    bool isValid() const;
+
+    virtual void setValue(double);
+    double value() const;
+
+    void setPeriodic(bool tf);
+    bool periodic() const;
+
+    void setStep(double);
+    double step() const;
+
+    double maxValue() const;
+    double minValue() const; 
+
+    int pageSize() const;
+
+    virtual void incValue(int);
+    virtual void incPages(int);
+    virtual void fitValue(double);
+
+protected:
+
+    double exactValue() const;
+    double exactPrevValue() const;
+    double prevValue() const;
+
+    virtual void valueChange();
+    virtual void stepChange();
+    virtual void rangeChange();
+
+private:
+    void setNewValue(double x,int align = 0);
+
+    double d_minValue;
+    double d_maxValue;
+    double d_step;
+    int d_pageSize;
+
+    bool d_isValid;
+    double d_value;
+    double d_exactValue;
+    double d_exactPrevValue;
+    double d_prevValue;
+
+    bool d_periodic;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_double_rect.h b/src/qwt/include/qwt_double_rect.h
new file mode 100644
index 0000000..af3c079
--- /dev/null
+++ b/src/qwt/include/qwt_double_rect.h
@@ -0,0 +1,440 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_DOUBLE_RECT_H
+#define QWT_DOUBLE_RECT_H 1
+
+#include "qwt_global.h"
+#include "qwt_array.h"
+
+#if QT_VERSION >= 0x040000
+
+#include <QPointF>
+#include <QSizeF>
+#include <QRectF>
+
+typedef QPointF QwtDoublePoint;
+typedef QSizeF QwtDoubleSize;
+typedef QRectF QwtDoubleRect;
+
+// MOC_SKIP_BEGIN
+#if defined(QWT_TEMPLATEDLL)
+
+#if defined(Q_CC_MSVC_NET)
+// == QVector<QPointF> 
+extern template class __declspec(dllimport) QwtArray<QPointF>;
+#else
+template class QWT_EXPORT QwtArray<QPointF>;
+#endif
+
+#endif 
+// MOC_SKIP_END
+
+#else
+
+#include <qpoint.h>
+#include <qsize.h>
+#include <qrect.h>
+
+/*!
+  The QwtDoublePoint class defines a point in double coordinates
+*/
+
+class QWT_EXPORT QwtDoublePoint
+{
+public:
+    QwtDoublePoint();
+    QwtDoublePoint(double x, double y);
+    QwtDoublePoint(const QPoint &);
+
+    QPoint toPoint() const;
+
+    bool isNull()    const;
+
+    double x() const;
+    double y() const;
+
+    double &rx();
+    double &ry();
+
+    void setX(double x);
+    void setY(double y);
+
+    bool operator==(const QwtDoublePoint &) const;
+    bool operator!=(const QwtDoublePoint &) const;
+
+    const QwtDoublePoint operator-() const;
+    const QwtDoublePoint operator+(const QwtDoublePoint &) const;
+    const QwtDoublePoint operator-(const QwtDoublePoint &) const;
+    const QwtDoublePoint operator*(double) const;
+    const QwtDoublePoint operator/(double) const;
+
+    QwtDoublePoint &operator+=(const QwtDoublePoint &);
+    QwtDoublePoint &operator-=(const QwtDoublePoint &);
+    QwtDoublePoint &operator*=(double);
+    QwtDoublePoint &operator/=(double);
+
+private:
+    double d_x;
+    double d_y;
+};
+
+/*!
+  The QwtDoubleSize class defines a size in double coordinates
+*/
+
+class QWT_EXPORT QwtDoubleSize
+{
+public:
+    QwtDoubleSize();
+    QwtDoubleSize(double width, double height);
+    QwtDoubleSize(const QSize &);
+
+    bool isNull() const;
+    bool isEmpty() const;
+    bool isValid() const;
+
+    double width() const;
+    double height() const;
+    void setWidth( double w );
+    void setHeight( double h );
+    void transpose();
+
+    QwtDoubleSize expandedTo(const QwtDoubleSize &) const;
+    QwtDoubleSize boundedTo(const QwtDoubleSize &) const;
+
+    bool operator==(const QwtDoubleSize &) const;
+    bool operator!=(const QwtDoubleSize &) const;
+
+    const QwtDoubleSize operator+(const QwtDoubleSize &) const;
+    const QwtDoubleSize operator-(const QwtDoubleSize &) const;
+    const QwtDoubleSize operator*(double) const;
+    const QwtDoubleSize operator/(double) const;
+
+    QwtDoubleSize &operator+=(const QwtDoubleSize &);
+    QwtDoubleSize &operator-=(const QwtDoubleSize &);
+    QwtDoubleSize &operator*=(double c);
+    QwtDoubleSize &operator/=(double c);
+
+private:
+    double d_width;
+    double d_height;
+};
+
+/*!
+  The QwtDoubleRect class defines a size in double coordinates.
+*/
+
+class QWT_EXPORT QwtDoubleRect  
+{
+public:
+    QwtDoubleRect();
+    QwtDoubleRect(double left, double top, double width, double height);
+    QwtDoubleRect(const QwtDoublePoint&, const QwtDoubleSize &);
+
+    bool isNull()    const;
+    bool isEmpty()   const;
+    bool isValid()   const;
+
+    QwtDoubleRect normalized() const;
+
+    double left()  const;
+    double right()  const;
+    double top()  const;
+    double bottom()  const;
+
+    void setLeft(double);
+    void setRight(double);
+    void setTop(double);
+    void setBottom(double);
+
+    QwtDoublePoint center()  const;
+
+    void moveLeft(double x);
+    void moveRight(double x);
+    void moveTop(double y );
+    void moveBottom(double y );
+    void moveTo(double x, double y);
+    void moveTo(const QwtDoublePoint &);
+    void moveBy(double dx, double dy);
+    void moveCenter(const QwtDoublePoint &);
+    void moveCenter(double dx, double dy);
+
+    void setRect(double x1, double x2, double width, double height);
+
+    double width()   const;
+    double height()  const;
+    QwtDoubleSize size() const;
+
+    void setWidth(double w );
+    void setHeight(double h );
+    void setSize(const QwtDoubleSize &);
+
+    QwtDoubleRect  operator|(const QwtDoubleRect &r) const;
+    QwtDoubleRect  operator&(const QwtDoubleRect &r) const;
+    QwtDoubleRect &operator|=(const QwtDoubleRect &r);
+    QwtDoubleRect &operator&=(const QwtDoubleRect &r);
+    bool operator==( const QwtDoubleRect &) const;
+    bool operator!=( const QwtDoubleRect &) const;
+
+    bool contains(const QwtDoublePoint &p, bool proper = false) const;
+    bool contains(double x, double y, bool proper = false) const; 
+    bool contains(const QwtDoubleRect &r, bool proper=false) const;
+
+    QwtDoubleRect unite(const QwtDoubleRect &) const;
+    QwtDoubleRect intersect(const QwtDoubleRect &) const;
+    bool intersects(const QwtDoubleRect &) const;
+
+private:
+    double d_left;
+    double d_right;
+    double d_top;
+    double d_bottom;
+};
+
+/*! 
+    Returns true if the point is null; otherwise returns false.
+
+    A point is considered to be null if both the x- and y-coordinates 
+    are equal to zero.
+*/
+inline bool QwtDoublePoint::isNull() const
+{ 
+    return d_x == 0.0 && d_y == 0.0; 
+}
+
+//! Returns the x-coordinate of the point.
+inline double QwtDoublePoint::x() const
+{ 
+    return d_x; 
+}
+
+//! Returns the y-coordinate of the point.
+inline double QwtDoublePoint::y() const
+{   
+    return d_y; 
+}
+
+//! Returns a reference to the x-coordinate of the point.
+inline double &QwtDoublePoint::rx()
+{
+    return d_x;
+}
+
+//! Returns a reference to the y-coordinate of the point.
+inline double &QwtDoublePoint::ry()
+{
+    return d_y;
+}
+
+//! Sets the x-coordinate of the point to the value specified by x.
+inline void QwtDoublePoint::setX(double x)
+{ 
+    d_x = x; 
+}
+
+//! Sets the y-coordinate of the point to the value specified by y.
+inline void QwtDoublePoint::setY(double y)
+{ 
+    d_y = y; 
+}
+
+/*!
+   Rounds the coordinates of this point to the nearest integer and 
+   returns a QPoint with these rounded coordinates.
+*/
+inline QPoint QwtDoublePoint::toPoint() const
+{
+    return QPoint(qRound(d_x), qRound(d_y));
+}
+
+/*!
+  Returns true if the width is 0 and the height is 0; 
+  otherwise returns false.
+*/
+inline bool QwtDoubleSize::isNull() const
+{ 
+    return d_width == 0.0 && d_height == 0.0; 
+}
+
+/*! 
+  Returns true if the width is <= 0.0 or the height is <= 0.0, 
+  otherwise false. 
+*/
+inline bool QwtDoubleSize::isEmpty() const
+{ 
+    return d_width <= 0.0 || d_height <= 0.0; 
+}
+
+/*!
+  Returns true if the width is equal to or greater than 0.0 and the height 
+  is equal to or greater than 0.0; otherwise returns false.
+*/
+inline bool QwtDoubleSize::isValid() const
+{ 
+    return d_width >= 0.0 && d_height >= 0.0; 
+}
+
+//! Returns the width. 
+inline double QwtDoubleSize::width() const
+{ 
+    return d_width; 
+}
+
+//! Returns the height. 
+inline double QwtDoubleSize::height() const
+{ 
+    return d_height; 
+}
+
+//! Sets the width to width. 
+inline void QwtDoubleSize::setWidth(double width)
+{ 
+    d_width = width; 
+}
+
+//! Sets the height to height. 
+inline void QwtDoubleSize::setHeight(double height)
+{ 
+    d_height = height; 
+}
+
+/*!
+    Returns true if the rectangle is a null rectangle; otherwise returns false.
+    A null rectangle has both the width and the height set to 0.
+    A null rectangle is also empty and invalid.
+
+    \sa QwtDoubleRect::isEmpty, QwtDoubleRect::isValid
+*/
+inline bool QwtDoubleRect::isNull() const
+{ 
+    return d_right == d_left && d_bottom == d_top;
+}
+
+/*!
+    Returns true if the rectangle is empty; otherwise returns false.
+    An empty rectangle has a width() <= 0 or height() <= 0.
+    An empty rectangle is not valid. isEmpty() == !isValid()
+
+    \sa QwtDoubleRect::isNull, QwtDoubleRect::isValid
+*/
+inline bool QwtDoubleRect::isEmpty() const
+{ 
+    return d_left >= d_right || d_top >= d_bottom; 
+}
+
+/*!
+    Returns true if the rectangle is valid; otherwise returns false.
+    A valid rectangle has a width() > 0 and height() > 0.
+    Note that non-trivial operations like intersections are not defined 
+    for invalid rectangles.  isValid() == !isEmpty()
+
+    \sa isNull(), isEmpty(), and normalized().
+*/
+inline bool QwtDoubleRect::isValid() const
+{ 
+    return d_left < d_right && d_top < d_bottom; 
+}
+
+//! Returns left
+inline double QwtDoubleRect::left() const
+{ 
+    return d_left; 
+}
+
+//! Returns right
+inline double QwtDoubleRect::right() const
+{ 
+    return d_right; 
+}
+
+//! Returns top
+inline double QwtDoubleRect::top() const
+{ 
+    return d_top; 
+}
+
+//! Returns bottom
+inline double QwtDoubleRect::bottom() const
+{ 
+    return d_bottom; 
+}
+
+//! Set left  
+inline void QwtDoubleRect::setLeft(double x)
+{ 
+    d_left = x;
+}
+
+//! Set right  
+inline void QwtDoubleRect::setRight(double x)
+{ 
+    d_right = x;
+}
+
+//! Set top  
+inline void QwtDoubleRect::setTop(double y)
+{ 
+    d_top = y;
+}
+
+//! Set bottom  
+inline void QwtDoubleRect::setBottom(double y)
+{ 
+    d_bottom = y;
+}
+
+//! Returns the width
+inline double QwtDoubleRect::width() const
+{ 
+    return  d_right - d_left; 
+}
+
+//! Returns the height
+inline double QwtDoubleRect::height() const
+{ 
+    return  d_bottom - d_top; 
+}
+
+//! Returns the size
+inline QwtDoubleSize QwtDoubleRect::size() const
+{ 
+    return QwtDoubleSize(width(), height());
+}
+
+//! Set the width, by right = left + w;
+inline void QwtDoubleRect::setWidth(double w)
+{
+    d_right = d_left + w;
+}
+
+//! Set the height, by bottom = top + h;
+inline void QwtDoubleRect::setHeight(double h)
+{
+    d_bottom = d_top + h;
+}
+
+/*! 
+    Moves the top left corner of the rectangle to p, 
+    without changing the rectangles size.
+*/
+inline void QwtDoubleRect::moveTo(const QwtDoublePoint &p)
+{
+    moveTo(p.x(), p.y());
+}
+
+// MOC_SKIP_BEGIN
+#if defined(QWT_TEMPLATEDLL)
+template class QWT_EXPORT QwtArray<QwtDoublePoint>;
+#endif
+// MOC_SKIP_END
+
+#endif // QT_VERSION < 0x040000
+
+#endif // QWT_DOUBLE_RECT_H
diff --git a/src/qwt/include/qwt_dyngrid_layout.h b/src/qwt/include/qwt_dyngrid_layout.h
new file mode 100644
index 0000000..10cc470
--- /dev/null
+++ b/src/qwt/include/qwt_dyngrid_layout.h
@@ -0,0 +1,101 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_DYNGRID_LAYOUT_H
+#define QWT_DYNGRID_LAYOUT_H
+
+#include <qlayout.h>
+#include <qsize.h>
+#if QT_VERSION >= 0x040000
+#include <qlist.h>
+#else
+#include <qvaluelist.h>
+#endif
+#include "qwt_global.h"
+#include "qwt_array.h"
+
+/*!
+  \brief The QwtDynGridLayout class lays out widgets in a grid,
+         adjusting the number of columns and rows to the current size.
+         
+  QwtDynGridLayout takes the space it gets, divides it up into rows and 
+  columns, and puts each of the widgets it manages into the correct cell(s). 
+  It lays out as many number of columns as possible (limited by maxCols()).
+*/
+
+class QWT_EXPORT QwtDynGridLayout : public QLayout
+{
+    Q_OBJECT
+public:
+    explicit QwtDynGridLayout(QWidget *, int margin = 0, int space = -1);
+#if QT_VERSION < 0x040000
+    explicit QwtDynGridLayout(QLayout *, int space = -1);
+#endif
+    explicit QwtDynGridLayout(int space = -1);
+
+    virtual ~QwtDynGridLayout();
+
+    virtual void invalidate();
+
+    void setMaxCols(uint maxCols);
+    uint maxCols() const;
+
+    uint numRows () const; 
+    uint numCols () const;
+
+    virtual void addItem(QLayoutItem *);
+
+#if QT_VERSION >= 0x040000
+    virtual QLayoutItem *itemAt( int index ) const;
+    virtual QLayoutItem *takeAt( int index );
+    virtual int count() const;
+
+    void setExpandingDirections(Qt::Orientations);
+    virtual Qt::Orientations expandingDirections() const;
+    QList<QRect> layoutItems(const QRect &, uint numCols) const;
+#else
+    virtual QLayoutIterator iterator();
+
+    void setExpanding(QSizePolicy::ExpandData);
+    virtual QSizePolicy::ExpandData expanding() const;
+    QValueList<QRect> layoutItems(const QRect &, uint numCols) const;
+#endif
+
+    virtual int maxItemWidth() const;
+
+    virtual void setGeometry(const QRect &rect);
+
+    virtual bool hasHeightForWidth() const;
+    virtual int heightForWidth(int) const;
+
+    virtual QSize sizeHint() const;
+
+    virtual bool isEmpty() const;
+    uint itemCount() const;
+
+    virtual uint columnsForWidth(int width) const;
+
+protected:
+
+    void layoutGrid(uint numCols,
+        QwtArray<int>& rowHeight, QwtArray<int>& colWidth) const;
+    void stretchGrid(const QRect &rect, uint numCols, 
+        QwtArray<int>& rowHeight, QwtArray<int>& colWidth) const;
+
+
+private:
+    void init();
+    int maxRowWidth(int numCols) const;
+    void updateLayoutCache();
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_event_pattern.h b/src/qwt/include/qwt_event_pattern.h
new file mode 100644
index 0000000..48a8b7d
--- /dev/null
+++ b/src/qwt/include/qwt_event_pattern.h
@@ -0,0 +1,219 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_EVENT_PATTERN
+#define QWT_EVENT_PATTERN 1
+
+#include <qnamespace.h>
+#include "qwt_array.h"
+
+class QMouseEvent;
+class QKeyEvent;
+
+/*!
+  \brief A collection of event patterns
+
+  QwtEventPattern introduces an level of indirection for mouse and
+  keyboard inputs. Those are represented by symbolic names, so 
+  the application code can be configured by individual mappings.
+
+  \sa QwtPicker, QwtPickerMachine, QwtPlotZoomer
+*/
+class QWT_EXPORT QwtEventPattern
+{
+public:
+    /*!
+      \brief Symbolic mouse input codes
+
+      The default initialization for 3 button mice is:
+      - MouseSelect1\n
+        Qt::LeftButton
+      - MouseSelect2\n
+        Qt::RightButton
+      - MouseSelect3\n
+        Qt::MidButton
+      - MouseSelect4\n
+        Qt::LeftButton + Qt::ShiftButton
+      - MouseSelect5\n
+        Qt::RightButton + Qt::ShiftButton
+      - MouseSelect6\n
+        Qt::MidButton + Qt::ShiftButton
+
+      The default initialization for 2 button mice is:
+      - MouseSelect1\n
+        Qt::LeftButton
+      - MouseSelect2\n
+        Qt::RightButton
+      - MouseSelect3\n
+        Qt::LeftButton + Qt::AltButton
+      - MouseSelect4\n
+        Qt::LeftButton + Qt::ShiftButton
+      - MouseSelect5\n
+        Qt::RightButton + Qt::ShiftButton
+      - MouseSelect6\n
+        Qt::LeftButton + Qt::AltButton + Qt::ShiftButton
+
+      The default initialization for 1 button mice is:
+      - MouseSelect1\n
+        Qt::LeftButton
+      - MouseSelect2\n
+        Qt::LeftButton + Qt::ControlButton
+      - MouseSelect3\n
+        Qt::LeftButton + Qt::AltButton
+      - MouseSelect4\n
+        Qt::LeftButton + Qt::ShiftButton
+      - MouseSelect5\n
+        Qt::LeftButton + Qt::ControlButton + Qt::ShiftButton
+      - MouseSelect6\n
+        Qt::LeftButton + Qt::AltButton + Qt::ShiftButton
+
+      \sa initMousePattern()
+    */
+
+    enum MousePatternCode
+    {
+        MouseSelect1,
+        MouseSelect2,
+        MouseSelect3,
+        MouseSelect4,
+        MouseSelect5,
+        MouseSelect6,
+
+        MousePatternCount
+    };
+
+    /*!
+      \brief Symbolic keyboard input codes
+
+      Default initialization:
+      - KeySelect1\n
+        Qt::Key_Return
+      - KeySelect2\n
+        Qt::Key_Space
+      - KeyAbort\n
+        Qt::Key_Escape
+
+      - KeyLeft\n
+        Qt::Key_Left
+      - KeyRight\n
+        Qt::Key_Right
+      - KeyUp\n
+        Qt::Key_Up
+      - KeyDown\n
+        Qt::Key_Down
+
+      - KeyUndo\n
+        Qt::Key_Minus
+      - KeyRedo\n
+        Qt::Key_Plus
+      - KeyHome\n
+        Qt::Key_Escape
+    */
+    enum KeyPatternCode
+    {
+        KeySelect1,
+        KeySelect2,
+        KeyAbort,
+
+        KeyLeft,
+        KeyRight,
+        KeyUp,
+        KeyDown,
+
+        KeyRedo,
+        KeyUndo,
+        KeyHome,
+
+        KeyPatternCount
+    };
+
+    class MousePattern
+    {
+    public:
+        MousePattern(int btn = Qt::NoButton, int st = Qt::NoButton) 
+        { 
+            button = btn;
+            state = st;
+        }
+
+        int button;
+        int state;
+    };
+
+    class KeyPattern
+    {
+    public:
+        KeyPattern(int k = 0, int st = Qt::NoButton)    
+        { 
+            key = k; 
+            state = st;
+        }
+
+        int key;
+        int state;
+    };
+
+    QwtEventPattern();
+    virtual ~QwtEventPattern();
+
+    void initMousePattern(int numButtons);
+    void initKeyPattern();
+
+    void setMousePattern(uint pattern, int button, int state = Qt::NoButton);
+    void setKeyPattern(uint pattern, int key, int state = Qt::NoButton);
+
+    void setMousePattern(const QwtArray<MousePattern> &);
+    void setKeyPattern(const QwtArray<KeyPattern> &);
+
+    const QwtArray<MousePattern> &mousePattern() const;
+    const QwtArray<KeyPattern> &keyPattern() const;
+
+    QwtArray<MousePattern> &mousePattern();
+    QwtArray<KeyPattern> &keyPattern();
+
+    bool mouseMatch(uint pattern, const QMouseEvent *) const;
+    bool keyMatch(uint pattern, const QKeyEvent *) const;
+
+protected:
+    virtual bool mouseMatch(const MousePattern &, const QMouseEvent *) const;
+    virtual bool keyMatch(const KeyPattern &, const QKeyEvent *) const;
+    
+private:
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable: 4251)
+#endif
+    QwtArray<MousePattern> d_mousePattern;
+    QwtArray<KeyPattern> d_keyPattern;
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+};
+
+inline bool operator==(QwtEventPattern::MousePattern b1, 
+   QwtEventPattern::MousePattern  b2)
+{ 
+    return b1.button == b2.button && b1.state == b2.state; 
+}
+
+inline bool operator==(QwtEventPattern::KeyPattern b1, 
+   QwtEventPattern::KeyPattern  b2)
+{ 
+    return b1.key == b2.key && b1.state == b2.state; 
+}
+
+#if defined(QWT_TEMPLATEDLL)
+// MOC_SKIP_BEGIN
+template class QWT_EXPORT QwtArray<QwtEventPattern::MousePattern>;
+template class QWT_EXPORT QwtArray<QwtEventPattern::KeyPattern>;
+// MOC_SKIP_END
+#endif
+
+#endif
diff --git a/src/qwt/include/qwt_global.h b/src/qwt/include/qwt_global.h
new file mode 100644
index 0000000..736c3a4
--- /dev/null
+++ b/src/qwt/include/qwt_global.h
@@ -0,0 +1,65 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_GLOBAL_H
+#define QWT_GLOBAL_H
+
+#include <qglobal.h>
+#if QT_VERSION < 0x040000
+#include <qmodules.h>
+#endif
+
+#define QWT_VERSION       0x050000
+#define QWT_VERSION_STR   "5.0.0cvs"
+
+//
+// Create Qwt DLL if QWT_DLL is defined (Windows only)
+//
+
+#if defined(Q_WS_WIN)
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+/* template-class specialization 'identifier' is already instantiated */
+#pragma warning(disable: 4660)
+#endif
+
+#if defined(QWT_NODLL)
+#undef QWT_MAKEDLL
+#undef QWT_DLL
+#undef QWT_TEMPLATEDLL
+#endif
+
+#ifdef QWT_DLL
+#if defined(QWT_MAKEDLL)     /* create a Qwt DLL library */
+#undef QWT_DLL
+#define QWT_EXPORT  __declspec(dllexport)
+#define QWT_TEMPLATEDLL
+#endif
+#endif
+
+#if defined(QWT_DLL)     /* use a Qwt DLL library */
+#define QWT_EXPORT  __declspec(dllimport)
+#define QWT_TEMPLATEDLL
+#endif
+
+#else // ! Q_WS_WIN
+#undef QWT_MAKEDLL       /* ignore these for other platforms */
+#undef QWT_DLL
+#undef QWT_TEMPLATEDLL
+#endif
+
+#ifndef QWT_EXPORT
+#define QWT_EXPORT
+#endif
+
+// #define QWT_NO_COMPAT 1 // disable withdrawn functionality
+
+#endif // QWT_GLOBAL_H
diff --git a/src/qwt/include/qwt_interval_data.h b/src/qwt/include/qwt_interval_data.h
new file mode 100644
index 0000000..d69d372
--- /dev/null
+++ b/src/qwt/include/qwt_interval_data.h
@@ -0,0 +1,70 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_INTERVAL_DATA_H
+#define QWT_INTERVAL_DATA_H 1
+
+#include "qwt_global.h"
+#include "qwt_math.h"
+#include "qwt_array.h"
+#include "qwt_double_interval.h"
+#include "qwt_double_rect.h"
+
+#if defined(_MSC_VER) && (_MSC_VER > 1310)
+#include <string.h>
+#endif
+
+#if defined(QWT_TEMPLATEDLL)
+// MOC_SKIP_BEGIN
+template class QWT_EXPORT QwtArray<QwtDoubleInterval>;
+template class QWT_EXPORT QwtArray<double>;
+// MOC_SKIP_END
+#endif
+
+/*!
+  \brief Interval data class.
+
+*/
+class QWT_EXPORT QwtIntervalData
+{
+public:
+    QwtIntervalData();
+    QwtIntervalData(const QwtArray<QwtDoubleInterval> &, 
+        const QwtArray<double> &);
+    
+    void setData(const QwtArray<QwtDoubleInterval> &, 
+        const QwtArray<double> &);
+
+    size_t size() const;
+    const QwtDoubleInterval &interval(size_t i) const;
+    double y(size_t i) const;
+
+    QwtDoubleRect boundingRect() const;
+
+private:
+    QwtArray<QwtDoubleInterval> d_interval;
+    QwtArray<double> d_y;
+};
+
+inline size_t QwtIntervalData::size() const
+{
+    return qwtMin(d_interval.size(), d_y.size());
+}
+
+inline const QwtDoubleInterval &QwtIntervalData::interval(size_t i) const
+{
+    return d_interval[int(i)];
+}
+
+inline double QwtIntervalData::y(size_t i) const
+{
+    return d_y[int(i)];
+}
+
+#endif 
diff --git a/src/qwt/include/qwt_knob.h b/src/qwt/include/qwt_knob.h
new file mode 100644
index 0000000..9e3bf08
--- /dev/null
+++ b/src/qwt/include/qwt_knob.h
@@ -0,0 +1,96 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_KNOB_H
+#define QWT_KNOB_H
+
+#include "qwt_global.h"
+#include "qwt_abstract_slider.h"
+#include "qwt_abstract_scale.h"
+
+class QwtRoundScaleDraw;
+
+/*!
+  \brief The Knob Widget
+
+  The QwtKnob widget imitates look and behaviour of a volume knob on a radio.
+  It contains a scale around the knob which is set up automatically or can
+  be configured manually (see QwtAbstractScale).
+  Automatic scrolling is enabled when the user presses a mouse
+  button on the scale. For a description of signals, slots and other
+  members, see QwtAbstractSlider.
+
+  \image html knob.gif
+  \sa   QwtAbstractSlider and QwtAbstractScale for the descriptions
+    of the inherited members.
+*/
+
+class QWT_EXPORT QwtKnob : public QwtAbstractSlider, public QwtAbstractScale
+{
+    Q_OBJECT 
+    Q_ENUMS (Symbol)
+    Q_PROPERTY( int knobWidth READ knobWidth WRITE setKnobWidth )
+    Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
+    Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
+    Q_PROPERTY( Symbol symbol READ symbol WRITE setSymbol )
+
+public:
+    /*!
+        Symbol
+        \sa QwtKnob::QwtKnob()
+    */
+
+    enum Symbol { Line, Dot };
+
+    explicit QwtKnob(QWidget* parent = NULL);
+    virtual ~QwtKnob();
+
+    void setKnobWidth(int w);
+    int knobWidth() const;
+
+    void setTotalAngle (double angle);
+    double totalAngle() const;
+
+    void setBorderWidth(int bw);
+    int borderWidth() const;
+
+    void setSymbol(Symbol);
+    Symbol symbol() const;
+
+    virtual QSize sizeHint() const;
+    virtual QSize minimumSizeHint() const;
+    
+    void setScaleDraw(QwtRoundScaleDraw *);
+    const QwtRoundScaleDraw *scaleDraw() const;
+    QwtRoundScaleDraw *scaleDraw();
+
+protected:
+    virtual void paintEvent(QPaintEvent *e);
+    virtual void resizeEvent(QResizeEvent *e);
+
+    void draw(QPainter *p, const QRect& ur);
+    void drawKnob(QPainter *p, const QRect &r);
+    void drawMarker(QPainter *p, double arc, const QColor &c);
+
+private:
+    void layoutKnob( bool update = true );
+    double getValue(const QPoint &p);
+    void getScrollMode( const QPoint &p, int &scrollMode, int &direction );
+    void recalcAngle();
+    
+    virtual void valueChange();
+    virtual void rangeChange();
+    virtual void scaleChange();
+    virtual void fontChange(const QFont &oldFont);
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_layout_metrics.h b/src/qwt/include/qwt_layout_metrics.h
new file mode 100644
index 0000000..9efa02c
--- /dev/null
+++ b/src/qwt/include/qwt_layout_metrics.h
@@ -0,0 +1,153 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_LAYOUT_METRICS_H
+#define QWT_LAYOUT_METRICS_H
+
+#include <qsize.h>
+#include <qrect.h>
+#if QT_VERSION < 0x040000
+#include <qpointarray.h>
+#else
+#include <qpolygon.h>
+#endif
+#include "qwt_global.h"
+
+class QPainter;
+class QString;
+class QFontMetrics;
+#if QT_VERSION < 0x040000
+class QWMatrix;
+#else
+class QMatrix;
+#endif
+class QPaintDevice;
+
+class QWT_EXPORT QwtMetricsMap
+{
+public:
+    QwtMetricsMap();
+
+    bool isIdentity() const;
+
+    void setMetrics(const QPaintDevice *layoutMetrics,
+        const QPaintDevice *deviceMetrics);
+
+    int layoutToDeviceX(int x) const;
+    int deviceToLayoutX(int x) const;
+    int screenToLayoutX(int x) const;
+    int layoutToScreenX(int x) const;
+
+    int layoutToDeviceY(int y) const;
+    int deviceToLayoutY(int y) const;
+    int screenToLayoutY(int y) const;
+    int layoutToScreenY(int y) const;
+
+    QPoint layoutToDevice(const QPoint &, const QPainter * = NULL) const;
+    QPoint deviceToLayout(const QPoint &, const QPainter * = NULL) const;
+    QPoint screenToLayout(const QPoint &) const;
+
+    QSize layoutToDevice(const QSize &) const;
+    QSize deviceToLayout(const QSize &) const;
+    QSize screenToLayout(const QSize &) const;
+
+    QRect layoutToDevice(const QRect &, const QPainter * = NULL) const;
+    QRect deviceToLayout(const QRect &, const QPainter * = NULL) const;
+    QRect screenToLayout(const QRect &) const;
+
+#if QT_VERSION < 0x040000
+    QPointArray layoutToDevice(const QPointArray &, 
+        const QPainter * = NULL) const;
+    QPointArray deviceToLayout(const QPointArray &, 
+        const QPainter * = NULL) const;
+
+    static QPointArray translate(const QWMatrix &, const QPointArray &);
+    static QRect translate(const QWMatrix &, const QRect &);
+#else
+    QPolygon layoutToDevice(const QPolygon &, 
+        const QPainter * = NULL) const;
+    QPolygon deviceToLayout(const QPolygon &, 
+        const QPainter * = NULL) const;
+
+    static QPolygon translate(const QMatrix &, const QPolygon &);
+    static QRect translate(const QMatrix &, const QRect &);
+#endif
+
+private:
+    double d_screenToLayoutX;
+    double d_screenToLayoutY;
+
+    double d_deviceToLayoutX;
+    double d_deviceToLayoutY;
+};
+
+inline bool QwtMetricsMap::isIdentity() const
+{
+    return d_deviceToLayoutX == 1.0 && d_deviceToLayoutY == 1.0;
+}
+
+inline int QwtMetricsMap::layoutToDeviceX(int x) const
+{
+    return qRound(x / d_deviceToLayoutX);
+}
+
+inline int QwtMetricsMap::deviceToLayoutX(int x) const
+{
+    return qRound(x * d_deviceToLayoutX);
+}
+
+inline int QwtMetricsMap::screenToLayoutX(int x) const
+{
+    return qRound(x * d_screenToLayoutX);
+}
+
+inline int QwtMetricsMap::layoutToScreenX(int x) const
+{
+    return qRound(x / d_screenToLayoutX);
+}
+
+inline int QwtMetricsMap::layoutToDeviceY(int y) const
+{
+    return qRound(y / d_deviceToLayoutY);
+}
+
+inline int QwtMetricsMap::deviceToLayoutY(int y) const
+{
+    return qRound(y * d_deviceToLayoutY);
+}
+
+inline int QwtMetricsMap::screenToLayoutY(int y) const
+{
+    return qRound(y * d_screenToLayoutY);
+}
+
+inline int QwtMetricsMap::layoutToScreenY(int y) const
+{
+    return qRound(y / d_screenToLayoutY);
+}
+
+inline QSize QwtMetricsMap::layoutToDevice(const QSize &size) const
+{
+    return QSize(layoutToDeviceX(size.width()), 
+        layoutToDeviceY(size.height()));
+}
+
+inline QSize QwtMetricsMap::deviceToLayout(const QSize &size) const
+{
+    return QSize(deviceToLayoutX(size.width()), 
+        deviceToLayoutY(size.height()));
+}
+
+inline QSize QwtMetricsMap::screenToLayout(const QSize &size) const
+{
+    return QSize(screenToLayoutX(size.width()), 
+        screenToLayoutY(size.height()));
+}
+
+#endif
diff --git a/src/qwt/include/qwt_legend.h b/src/qwt/include/qwt_legend.h
new file mode 100644
index 0000000..98ff9ba
--- /dev/null
+++ b/src/qwt/include/qwt_legend.h
@@ -0,0 +1,124 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_LEGEND_H
+#define QWT_LEGEND_H
+
+#include <qframe.h>
+#include "qwt_global.h"
+#if QT_VERSION < 0x040000
+#include <qvaluelist.h>
+#else
+#include <qlist.h>
+#endif
+
+class QScrollBar;
+class QwtPlotItem;
+
+/*!
+  \brief The legend widget
+
+  The QwtLegend widget is a tabular arrangement of legend items. Legend
+  items might be any type of widget, but in general they will be
+  a QwtLegendItem.
+
+  \sa QwtLegendItem, QwtPlot
+*/
+
+class QWT_EXPORT QwtLegend : public QFrame
+{
+    Q_OBJECT
+
+public:
+    /*!
+      \brief Display policy
+
+       - None\n
+         the client code is responsible how to display of each legend item.
+         The Qwt library will not interfere.
+
+       - Fixed\n
+         all legend items are displayed with the QwtLegendItem::IdentifierMode
+         to be passed in 'mode'.
+
+       - Auto\n
+         each legend item is displayed with a mode that is a bitwise or of
+         - QwtLegendItem::ShowLine (if its curve is drawn with a line) and
+         - QwtLegendItem::ShowSymbol (if its curve is drawn with symbols) and
+         - QwtLegendItem::ShowText (if the has a title).
+
+       Default is LegendDisplayPolicy::Auto.
+       \sa QwtLegend::setDisplayPolicy, QwtLegend::displayPolicy,                          QwtLegendItem::IdentifierMode
+     */
+
+    enum LegendDisplayPolicy
+    {
+        None = 0,
+        Fixed = 1,
+        Auto = 2
+    };
+
+    enum LegendItemMode
+    {
+        ReadOnlyItem,
+        ClickableItem,
+        CheckableItem
+    };
+
+    explicit QwtLegend(QWidget *parent = NULL);
+    virtual ~QwtLegend();
+    
+    void setDisplayPolicy(LegendDisplayPolicy policy, int mode = -1);
+    LegendDisplayPolicy displayPolicy() const;
+
+    void setItemMode(LegendItemMode);
+    LegendItemMode itemMode() const;
+
+    int identifierMode() const;
+
+    QWidget *contentsWidget();
+    const QWidget *contentsWidget() const;
+
+    void insert(const QwtPlotItem *, QWidget *);
+    void remove(const QwtPlotItem *);
+
+    QWidget *find(const QwtPlotItem *) const;
+    QwtPlotItem *find(const QWidget *) const;
+
+#if QT_VERSION < 0x040000
+    virtual QValueList<QWidget *> legendItems() const;
+#else
+    virtual QList<QWidget *> legendItems() const;
+#endif
+
+    void clear();
+    
+    bool isEmpty() const;
+    uint itemCount() const;
+
+    virtual bool eventFilter(QObject *, QEvent *);
+
+    virtual QSize sizeHint() const;
+    virtual int heightForWidth(int w) const;
+
+    QScrollBar *horizontalScrollBar() const;
+    QScrollBar *verticalScrollBar() const;
+
+protected:
+    virtual void resizeEvent(QResizeEvent *);
+    virtual void layoutContents();
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif // QWT_LEGEND_H
diff --git a/src/qwt/include/qwt_legend_item.h b/src/qwt/include/qwt_legend_item.h
new file mode 100644
index 0000000..cf4e0d5
--- /dev/null
+++ b/src/qwt/include/qwt_legend_item.h
@@ -0,0 +1,109 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_LEGEND_ITEM_H
+#define QWT_LEGEND_ITEM_H
+
+#include "qwt_global.h"
+#include "qwt_legend.h"
+#include "qwt_text.h"
+#include "qwt_text_label.h"
+
+class QPainter;
+class QPen;
+class QwtSymbol;
+
+/*!
+  \brief A legend label
+
+  QwtLegendItem represents a curve on a legend.
+  It displays an curve identifier with an explaining text.
+  The identifier might be a combination of curve symbol and line.
+  In readonly mode it behaves like a label, otherwise like 
+  an unstylish push button.
+
+  \sa QwtLegend, QwtCurve
+*/
+class QWT_EXPORT QwtLegendItem: public QwtTextLabel
+{
+    Q_OBJECT
+public:
+    
+    /*!
+       \brief Identifier mode
+
+       Default is ShowLine | ShowText
+       \sa QwtLegendItem::identifierMode, QwtLegendItem::setIdentifierMode
+     */
+
+    enum IdentifierMode
+    {
+        NoIdentifier = 0,
+        ShowLine = 1,
+        ShowSymbol = 2,
+        ShowText = 4
+    };
+
+    explicit QwtLegendItem(QWidget *parent = 0);
+    explicit QwtLegendItem(const QwtSymbol &, const QPen &,
+        const QwtText &, QWidget *parent = 0);
+    virtual ~QwtLegendItem();
+
+    virtual void setText(const QwtText &);
+
+    void setItemMode(QwtLegend::LegendItemMode);
+    QwtLegend::LegendItemMode itemMode() const;
+
+    void setIdentifierMode(int);
+    int identifierMode() const;
+
+    void setSymbol(const QwtSymbol &);
+    const QwtSymbol& symbol() const;
+
+    void setCurvePen(const QPen &);
+    const QPen& curvePen() const;
+
+    virtual void drawIdentifier(QPainter *, const QRect &) const;
+    virtual void drawItem(QPainter *p, const QRect &) const; 
+
+    virtual QSize sizeHint() const;
+
+    bool isChecked() const;
+
+public slots:
+    void setChecked(bool on);
+
+signals:
+    void clicked();
+    void pressed();
+    void released();
+    void checked(bool);
+
+protected:
+    void setDown(bool);
+    bool isDown() const;
+
+    virtual void paintEvent(QPaintEvent *);
+    virtual void mousePressEvent(QMouseEvent *);
+    virtual void mouseReleaseEvent(QMouseEvent *);
+    virtual void keyPressEvent(QKeyEvent *);
+    virtual void keyReleaseEvent(QKeyEvent *);
+
+    virtual void drawText(QPainter *, const QRect &);
+
+private:
+    void init(const QwtText &);
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif // QWT_LEGEND_ITEM_H
diff --git a/src/qwt/include/qwt_math.h b/src/qwt/include/qwt_math.h
new file mode 100644
index 0000000..1aa74e6
--- /dev/null
+++ b/src/qwt/include/qwt_math.h
@@ -0,0 +1,175 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+/*!
+  \file qwt_math.h
+  \brief A set of mathematical routines
+*/
+
+#ifndef QWT_MATH_H
+#define QWT_MATH_H
+
+#include <math.h>
+#include <qpoint.h>
+#include "qwt_global.h"
+
+#if QT_VERSION < 0x040000
+
+#define qwtMax QMAX
+#define qwtMin QMIN
+#define qwtAbs QABS
+
+#else // QT_VERSION >= 0x040000
+
+#define qwtMax qMax
+#define qwtMin qMin
+#define qwtAbs qAbs
+
+#endif
+
+#ifndef LOG10_2
+#define LOG10_2     0.30102999566398119802  /* log10(2) */
+#endif
+
+#ifndef LOG10_3
+#define LOG10_3     0.47712125471966243540  /* log10(3) */
+#endif
+
+#ifndef LOG10_5
+#define LOG10_5     0.69897000433601885749  /* log10(5) */
+#endif
+
+#ifndef M_2PI
+#define M_2PI       6.28318530717958623200  /* 2 pi */
+#endif
+
+#ifndef LOG_MIN
+//! Mininum value for logarithmic scales
+#define LOG_MIN 1.0e-100
+#endif
+
+#ifndef LOG_MAX
+//! Maximum value for logarithmic scales
+#define LOG_MAX 1.0e100
+#endif
+
+#ifndef M_E
+#define M_E            2.7182818284590452354   /* e */
+#endif
+
+#ifndef M_LOG2E
+#define M_LOG2E 1.4426950408889634074   /* log_2 e */
+#endif
+
+#ifndef M_LOG2E
+#define M_LOG10E    0.43429448190325182765  /* log_10 e */
+#endif
+
+#ifndef M_LN2
+#define M_LN2       0.69314718055994530942  /* log_e 2 */
+#endif
+
+#ifndef M_LN10
+#define M_LN10         2.30258509299404568402  /* log_e 10 */
+#endif
+
+#ifndef M_PI
+#define M_PI        3.14159265358979323846  /* pi */
+#endif
+
+#ifndef M_PI_2
+#define M_PI_2      1.57079632679489661923  /* pi/2 */
+#endif
+
+#ifndef M_PI_4
+#define M_PI_4      0.78539816339744830962  /* pi/4 */
+#endif
+
+#ifndef M_1_PI
+#define M_1_PI      0.31830988618379067154  /* 1/pi */
+#endif
+
+#ifndef M_2_PI
+#define M_2_PI      0.63661977236758134308  /* 2/pi */
+#endif
+
+#ifndef M_2_SQRTPI
+#define M_2_SQRTPI  1.12837916709551257390  /* 2/sqrt(pi) */
+#endif
+
+#ifndef M_SQRT2
+#define M_SQRT2 1.41421356237309504880  /* sqrt(2) */
+#endif
+
+#ifndef M_SQRT1_2
+#define M_SQRT1_2   0.70710678118654752440  /* 1/sqrt(2) */
+#endif
+
+QWT_EXPORT double qwtGetMin(const double *array, int size);
+QWT_EXPORT double qwtGetMax(const double *array, int size);
+
+
+//! Return the sign 
+inline int qwtSign(double x)
+{
+    if (x > 0.0)
+       return 1;
+    else if (x < 0.0)
+       return (-1);
+    else
+       return 0;
+}            
+
+//! Return the square of a number
+inline double qwtSqr(const double x)
+{
+    return x*x;
+}
+
+/*!
+  \brief Limit a value to fit into a specified interval
+  \param x Input value
+  \param x1 First interval boundary
+  \param x2 Second interval boundary  
+*/
+template <class T>
+T qwtLim(const T& x, const T& x1, const T& x2)
+{
+    T rv;
+    T xmin, xmax;
+    
+    xmin = qwtMin(x1, x2);
+    xmax = qwtMax(x1, x2);
+
+    if ( x < xmin )
+       rv = xmin;
+    else if ( x > xmax )
+       rv = xmax;
+    else
+       rv = x;
+
+    return rv;
+}
+
+inline QPoint qwtPolar2Pos(const QPoint &center,
+    double radius, double angle)
+{
+    const double x = center.x() + radius * cos(angle);
+    const double y = center.y() - radius * sin(angle);
+
+    return QPoint(qRound(x), qRound(y));
+}
+
+inline QPoint qwtDegree2Pos(const QPoint &center,
+    double radius, double angle)
+{
+    return qwtPolar2Pos(center, radius, angle / 180.0 * M_PI);
+}
+
+#endif
diff --git a/src/qwt/include/qwt_paint_buffer.h b/src/qwt/include/qwt_paint_buffer.h
new file mode 100644
index 0000000..d128502
--- /dev/null
+++ b/src/qwt/include/qwt_paint_buffer.h
@@ -0,0 +1,65 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_PAINT_BUFFER_H
+#define QWT_PAINT_BUFFER_H 1
+
+#include <qglobal.h>
+#if QT_VERSION < 0x040000
+
+#include <qpixmap.h>
+#include "qwt_global.h"
+
+class QPainter;
+
+/*!
+  \brief Paint buffer for Qwt widgets
+
+  QwtPaintBuffer offers a simple way to en/disable double buffering.
+  Double buffering is enabled as default and in general there will be
+  no reason to change this. 
+*/
+
+class QWT_EXPORT QwtPaintBuffer
+{
+public:
+    explicit QwtPaintBuffer();
+    explicit QwtPaintBuffer(QPaintDevice *, const QRect &, QPainter *p = NULL);
+
+    virtual ~QwtPaintBuffer();
+
+    void open(QPaintDevice *, const QRect &, QPainter *p = NULL);
+    void close();
+
+    QPainter *painter();
+    const QPaintDevice *device();
+    
+    static void setEnabled(bool enable);
+    static bool isEnabled();
+
+    //! Return Buffer used for double buffering
+    const QPixmap &buffer() const { return d_pixBuffer; }
+
+protected:
+    void flush();
+
+private:
+    QPixmap d_pixBuffer;
+    QRect d_rect;
+
+    QPaintDevice *d_device; // use QGuardedPtr
+    QPainter *d_painter; // use QGuardedPtr
+    QPainter *d_devicePainter; // use QGuardedPtr
+
+    static bool d_enabled;
+};
+
+#endif // QT_VERSION < 0x040000
+
+#endif
diff --git a/src/qwt/include/qwt_painter.h b/src/qwt/include/qwt_painter.h
new file mode 100644
index 0000000..bb683b2
--- /dev/null
+++ b/src/qwt/include/qwt_painter.h
@@ -0,0 +1,140 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_PAINTER_H
+#define QWT_PAINTER_H
+
+#include <qpoint.h>
+#include <qrect.h>
+#include "qwt_global.h"
+#include "qwt_layout_metrics.h"
+
+class QPainter;
+class QBrush;
+class QColor;
+class QWidget;
+
+#if QT_VERSION < 0x040000
+class QColorGroup;
+class QSimpleRichText;
+#else
+class QPalette;
+class QTextDocument;
+#endif
+
+#if defined(Q_WS_X11)
+// Warning: QCOORD_MIN, QCOORD_MAX are wrong on X11.
+#define QWT_COORD_MAX 16384
+#define QWT_COORD_MIN (-QWT_COORD_MAX - 1)
+#else
+#define QWT_COORD_MAX 2147483647
+#define QWT_COORD_MIN -QWT_COORD_MAX - 1
+#endif
+
+/*!
+  \brief A collection of QPainter workarounds
+
+  1) Clipping to coordinate system limits (Qt3 only)
+
+  On X11 pixel coordinates are stored in shorts. Qt 
+  produces overruns when mapping QCOORDS to shorts. 
+
+  2) Scaling to device metrics
+
+  QPainter scales fonts, line and fill patterns to the metrics
+  of the paint device. Other values like the geometries of rects, points
+  remain device independend. To enable a device independent widget 
+  implementation, QwtPainter adds scaling of these geometries.
+  (Unfortunately QPainter::scale scales both types of paintings,
+   so the objects of the first type would be scaled twice).
+*/
+
+class QWT_EXPORT QwtPainter
+{
+public:
+    static void setMetricsMap(const QPaintDevice *layout,
+        const QPaintDevice *device);
+    static void setMetricsMap(const QwtMetricsMap &);
+    static void resetMetricsMap();
+    static const QwtMetricsMap &metricsMap();
+
+    static void setDeviceClipping(bool);
+    static bool deviceClipping();
+
+    static void setClipRect(QPainter *, const QRect &);
+
+    static void drawText(QPainter *, int x, int y, 
+        const QString &);
+    static void drawText(QPainter *, const QPoint &, 
+        const QString &);
+    static void drawText(QPainter *, int x, int y, int w, int h, 
+        int flags, const QString &);
+    static void drawText(QPainter *, const QRect &, 
+        int flags, const QString &);
+
+#ifndef QT_NO_RICHTEXT
+#if QT_VERSION < 0x040000
+    static void drawSimpleRichText(QPainter *, const QRect &,
+        int flags, QSimpleRichText &);
+#else
+    static void drawSimpleRichText(QPainter *, const QRect &,
+        int flags, QTextDocument &);
+#endif
+#endif
+
+    static void drawRect(QPainter *, int x, int y, int w, int h);
+    static void drawRect(QPainter *, const QRect &rect);
+    static void fillRect(QPainter *, const QRect &, const QBrush &); 
+
+    static void drawEllipse(QPainter *, const QRect &);
+
+    static void drawLine(QPainter *, int x1, int y1, int x2, int y2);
+    static void drawLine(QPainter *, const QPoint &p1, const QPoint &p2);
+#if QT_VERSION < 0x040000
+    static void drawPolygon(QPainter *, const QPointArray &pa);
+    static void drawPolyline(QPainter *, const QPointArray &pa);
+#else
+    static void drawPolygon(QPainter *, const QPolygon &pa);
+    static void drawPolyline(QPainter *, const QPolygon &pa);
+#endif
+    static void drawPoint(QPainter *, int x, int y);
+
+#if QT_VERSION < 0x040000
+    static void drawRoundFrame(QPainter *, const QRect &,
+        int width, const QColorGroup &cg, bool sunken);
+#else
+    static void drawRoundFrame(QPainter *, const QRect &,
+        int width, const QPalette &, bool sunken);
+#endif
+    static void drawFocusRect(QPainter *, QWidget *);
+    static void drawFocusRect(QPainter *, QWidget *, const QRect &);
+
+#if QT_VERSION < 0x040000
+    static QPointArray clip(const QPointArray &);
+#else
+    static QPolygon clip(const QPolygon &);
+#endif
+
+private:
+    static void drawColoredArc(QPainter *, const QRect &,
+        int peak, int arc, int intervall, const QColor &c1, const QColor &c2);
+
+    static const QRect &deviceClipRect();
+    static bool d_deviceClipping;
+    static QwtMetricsMap d_metricsMap;
+};
+
+//!  Wrapper for QPainter::drawLine()
+inline void QwtPainter::drawLine(QPainter *painter,
+    const QPoint &p1, const QPoint &p2)
+{
+    drawLine(painter, p1.x(), p1.y(), p2.x(), p2.y());
+}
+
+#endif
diff --git a/src/qwt/include/qwt_picker.h b/src/qwt/include/qwt_picker.h
new file mode 100644
index 0000000..16ecfdb
--- /dev/null
+++ b/src/qwt/include/qwt_picker.h
@@ -0,0 +1,377 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_PICKER
+#define QWT_PICKER 1
+
+#include <qobject.h>
+#include <qpen.h>
+#include <qfont.h>
+#include <qrect.h>
+#include "qwt_global.h"
+#include "qwt_text.h"
+#include "qwt_event_pattern.h"
+#if QT_VERSION < 0x040000
+#include <qpointarray.h>
+#else
+#include <qpolygon.h>
+#endif
+
+class QWidget;
+class QMouseEvent;
+class QWheelEvent;
+class QKeyEvent;
+class QwtPickerMachine;
+
+/*!
+  \brief QwtPicker provides selections on a widget
+
+  QwtPicker filters all mouse and keyboard events of a widget
+  and translates them into an array of selected points. Depending
+  on the QwtPicker::SelectionType the selection might be a single point,
+  a rectangle or a polygon. The selection process is supported by 
+  optional rubberbands (rubberband selection) and position trackers. 
+
+  QwtPicker is useful for widgets where the event handlers
+  can�t be overloaded, like for components of composite widgets.
+  It offers alternative handlers for mouse and key events.
+
+  \par Example 
+  \verbatim #include <qwt_picker.h>
+
+QwtPicker *picker = new QwtPicker(widget);
+picker->setTrackerMode(QwtPicker::ActiveOnly);
+connect(picker, SIGNAL(selected(const SelectedPoints &)), ...);
+
+// emit the position of clicks on widget
+picker->setSelectionFlags(QwtPicker::PointSelection | QwtPicker::ClickSelection);
+
+    ...
+    
+// now select rectangles
+picker->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
+picker->setRubberBand(QwtPicker::RectRubberBand); \endverbatim\n
+
+  The selection process uses the commands begin(), append(), move() and end().
+  append() adds a new point to the selection, move() changes the position of 
+  the latest point. 
+
+  The commands are initiated from a small state machine (QwtPickerMachine) 
+  that translates mouse and key events. There are a couple of predefined 
+  state machines for point, rect and polygon selections. The selectionFlags()
+  control which one should be used. It is possible to use other machines 
+  by overloading stateMachine().
+
+  The picker is active (isActive()), between begin() and end().
+  In active state the rubberband is displayed, and the tracker is visible
+  in case of trackerMode is ActiveOnly or AlwaysOn.
+
+  The cursor can be moved using the arrow keys. All selections can be aborted
+  using the abort key. (QwtEventPattern::KeyPatternCode)
+
+  \warning In case of QWidget::NoFocus the focus policy of the observed
+           widget is set to QWidget::WheelFocus and mouse tracking
+           will be manipulated for ClickSelection while the picker is active,
+           or if trackerMode() is AlwayOn.
+*/
+
+class QWT_EXPORT QwtPicker: public QObject, public QwtEventPattern
+{
+    Q_OBJECT
+
+    Q_ENUMS(RubberBand)
+    Q_ENUMS(DisplayMode)
+    Q_ENUMS(ResizeMode)
+
+    Q_PROPERTY(int selectionFlags READ selectionFlags WRITE setSelectionFlags)
+    Q_PROPERTY(DisplayMode trackerMode READ trackerMode WRITE setTrackerMode)
+    Q_PROPERTY(QFont trackerFont READ trackerFont WRITE setTrackerFont)
+    Q_PROPERTY(RubberBand rubberBand READ rubberBand WRITE setRubberBand)
+    Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode)
+    Q_PROPERTY(bool isEnabled READ isEnabled WRITE setEnabled)
+
+    Q_PROPERTY(QPen trackerPen READ trackerPen WRITE setTrackerPen)
+    Q_PROPERTY(QPen rubberBandPen READ rubberBandPen WRITE setRubberBandPen)
+
+public:
+    /*! 
+      This enum type describes the type of a selection. It can be or�d
+      with QwtPicker::RectSelectionType and QwtPicker::SelectionMode
+      and passed to QwtPicker::setSelectionFlags()
+      - NoSelection\n
+        Selection is disabled. Note this is different to the disabled
+        state, as you might have a tracker.
+      - PointSelection\n
+        Select a single point.
+      - RectSelection\n
+        Select a rectangle.
+      - PolygonSelection\n
+        Select a polygon.
+
+      The default value is NoSelection.
+      \sa QwtPicker::setSelectionFlags(), QwtPicker::selectionFlags()
+    */
+
+    enum SelectionType
+    {
+        NoSelection = 0,
+        PointSelection = 1,
+        RectSelection = 2,
+        PolygonSelection = 4
+    };
+
+    /*! 
+      \brief Selection subtype for RectSelection
+      This enum type describes the type of rectangle selections. 
+      It can be or�d with QwtPicker::RectSelectionType and 
+      QwtPicker::SelectionMode and passed to QwtPicker::setSelectionFlags().
+      - CornerToCorner\n
+        The first and the second selected point are the corners
+        of the rectangle.
+      - CenterToCorner\n
+        The first point is the center, the second a corner of the
+        rectangle.
+      - CenterToRadius\n
+        The first point is the center of a quadrat, calculated by the maximum 
+        of the x- and y-distance.
+
+      The default value is CornerToCorner.
+      \sa QwtPicker::setSelectionFlags(), QwtPicker::selectionFlags()
+    */
+    enum RectSelectionType
+    {
+        CornerToCorner = 64,
+        CenterToCorner = 128,
+        CenterToRadius = 256
+    };
+
+    /*! 
+      Values of this enum type or�d together with a SelectionType value
+      identifies which state machine should be used for the selection.
+
+      The default value is ClickSelection.
+      \sa stateMachine()
+    */
+    enum SelectionMode
+    {
+        ClickSelection = 1024,
+        DragSelection = 2048
+    };
+
+#if QT_VERSION < 0x040000
+    typedef QPointArray SelectedPoints;
+#else
+    typedef QPolygon SelectedPoints;
+#endif
+    /*! 
+      Rubberband style
+      - NoRubberBand\n
+        No rubberband.
+      - HLineRubberBand & PointSelection\n
+        A horizontal line.
+      - VLineRubberBand & PointSelection\n
+        A vertical line.
+      - CrossRubberBand & PointSelection\n
+        A horizontal and a vertical line.
+      - RectRubberBand & RectSelection\n
+        A rectangle.
+      - EllipseRubberBand & RectSelection\n
+        An ellipse.
+      - PolygonRubberBand &PolygonSelection\n
+        A polygon.
+      - UserRubberBand\n
+        Values >= UserRubberBand can be used to define additional
+        rubber bands.
+
+      The default value is NoRubberBand.
+      \sa QwtPicker::setRubberBand(), QwtPicker::rubberBand()
+    */
+
+    enum RubberBand
+    {
+        NoRubberBand = 0,
+
+        // Point
+        HLineRubberBand,
+        VLineRubberBand,
+        CrossRubberBand,
+
+        // Rect
+        RectRubberBand,
+        EllipseRubberBand,
+
+        // Polygon
+        PolygonRubberBand,
+
+        UserRubberBand = 100
+    };
+
+    /*! 
+      - AlwaysOff\n
+        Display never.
+      - AlwaysOn\n
+        Display always.
+      - ActiveOnly\n
+        Display only when the selection is active.
+
+      \sa QwtPicker::setTrackerMode(), QwtPicker::trackerMode(), 
+          QwtPicker::isActive()
+    */
+    enum DisplayMode
+    {
+        AlwaysOff,
+        AlwaysOn,
+        ActiveOnly
+    };
+
+    /*! 
+      Controls what to do with the selected points of an active
+         selection when the observed widget is resized.
+      - Stretch\n
+         All points are scaled according to the new size, 
+      - KeepSize\n
+         All points remain unchanged.
+
+      The default value is Stretch.
+      \sa QwtPicker::setResizeMode(), QwtPicker::resize()
+    */
+
+    enum ResizeMode
+    {
+        Stretch,
+        KeepSize
+    };
+
+    explicit QwtPicker(QWidget *parent);
+    explicit QwtPicker(int selectionFlags, RubberBand rubberBand,
+        DisplayMode trackerMode, QWidget *);
+
+    virtual ~QwtPicker();
+
+    virtual void setSelectionFlags(int);
+    int selectionFlags() const;
+
+    virtual void setRubberBand(RubberBand);
+    RubberBand rubberBand() const;
+
+    virtual void setTrackerMode(DisplayMode);
+    DisplayMode trackerMode() const;
+
+    virtual void setResizeMode(ResizeMode);
+    ResizeMode resizeMode() const;
+
+    virtual void setRubberBandPen(const QPen &);
+    QPen rubberBandPen() const;
+
+    virtual void setTrackerPen(const QPen &);
+    QPen trackerPen() const;
+
+    virtual void setTrackerFont(const QFont &);
+    QFont trackerFont() const;
+
+    bool isEnabled() const;
+    virtual void setEnabled(bool);
+
+    bool isActive() const;
+
+    virtual bool eventFilter(QObject *, QEvent *);
+
+    QWidget *parentWidget();
+    const QWidget *parentWidget() const;
+
+    virtual QRect pickRect() const;
+    const SelectedPoints &selection() const; 
+
+    virtual void drawRubberBand(QPainter *) const;
+    virtual void drawTracker(QPainter *) const;
+
+signals:
+    /*!
+      A signal emitting the selected points, 
+      at the end of a selection.
+
+      \param pa Selected points
+    */
+    void selected(const QwtPicker::SelectedPoints &pa);
+
+    /*!
+      A signal emitted when a point has been appended to the selection
+
+      \param pos Position of the appended point.
+      \sa append(). moved()
+    */
+    void appended(const QPoint &pos);
+
+    /*!
+      A signal emitted whenever the last appended point of the 
+      selection has been moved.
+
+      \param pos Position of the moved last point of the selection.
+      \sa move(), appended()
+    */
+    void moved(const QPoint &pos);
+
+    /*!
+      A signal emitted when the active selection has been changed.
+      This might happen when the observed widget is resized.
+
+      \param pa Changed selection
+      \sa stretchSelection()
+    */
+    void changed(const SelectedPoints &pa);
+
+protected:
+    /*!
+      \brief Validate and fixup the selection
+
+      Accepts all selections unmodified
+    
+      \param selection Selection to validate and fixup
+      \return true, when accepted, false otherwise
+    */
+    virtual bool accept(SelectedPoints &selection) const;
+
+    virtual void transition(const QEvent *);
+
+    virtual void begin();
+    virtual void append(const QPoint &);
+    virtual void move(const QPoint &);
+    virtual bool end(bool ok = true);
+
+    virtual void widgetMousePressEvent(QMouseEvent *);
+    virtual void widgetMouseReleaseEvent(QMouseEvent *);
+    virtual void widgetMouseDoubleClickEvent(QMouseEvent *); 
+    virtual void widgetMouseMoveEvent(QMouseEvent *); 
+    virtual void widgetWheelEvent(QWheelEvent *);
+    virtual void widgetKeyPressEvent(QKeyEvent *); 
+    virtual void widgetKeyReleaseEvent(QKeyEvent *); 
+
+    QRect trackerRect(QPainter *painter) const;
+
+    virtual void stretchSelection(const QSize &oldSize, 
+        const QSize &newSize);
+
+    virtual QwtText trackerText(const QPoint &pos) const;
+
+    virtual QwtPickerMachine *stateMachine(int) const;
+
+private:
+    void init(QWidget *, int selectionFlags, RubberBand rubberBand,
+        DisplayMode trackerMode);
+
+    void setStateMachine(QwtPickerMachine *);
+    void setMouseTracking(bool);
+
+    void updateDisplay();
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+            
+#endif
diff --git a/src/qwt/include/qwt_picker_machine.h b/src/qwt/include/qwt_picker_machine.h
new file mode 100644
index 0000000..7d78a62
--- /dev/null
+++ b/src/qwt/include/qwt_picker_machine.h
@@ -0,0 +1,152 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_PICKER_MACHINE
+#define QWT_PICKER_MACHINE 1
+
+#include "qwt_global.h"
+#if QT_VERSION < 0x040000
+#include <qvaluelist.h>
+#else
+#include <qlist.h>
+#endif
+
+class QEvent;
+class QwtEventPattern;
+
+/*!
+  \brief A state machine for QwtPicker selections
+
+  QwtPickerMachine accepts key and mouse events and translates them
+  into selection commands. 
+
+  \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
+*/
+
+class QWT_EXPORT QwtPickerMachine
+{
+public:
+    enum Command
+    {
+        Begin,
+        Append,
+        Move,
+        End
+    };
+
+#if QT_VERSION < 0x040000
+    typedef QValueList<Command> CommandList;
+#else
+    typedef QList<Command> CommandList;
+#endif
+
+    virtual ~QwtPickerMachine();
+
+    //! Transition
+    virtual CommandList transition(
+        const QwtEventPattern &, const QEvent *) = 0;
+    void reset(); 
+
+protected:
+    QwtPickerMachine();
+
+    int state() const;
+    void setState(int);
+
+private:
+    int d_state;
+};
+
+/*!
+  \brief A state machine for point selections
+
+  Pressing QwtEventPattern::MouseSelect1 or 
+  QwtEventPattern::KeySelect1 selects a point.
+
+  \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
+*/
+class QWT_EXPORT QwtPickerClickPointMachine: public QwtPickerMachine
+{
+public:
+    virtual CommandList transition(
+        const QwtEventPattern &, const QEvent *);
+};
+
+/*!
+  \brief A state machine for point selections
+
+  Pressing QwtEventPattern::MouseSelect1 or QwtEventPattern::KeySelect1 
+  starts the selection, releasing QwtEventPattern::MouseSelect1 or 
+  a second press of QwtEventPattern::KeySelect1 terminates it.
+*/
+class QWT_EXPORT QwtPickerDragPointMachine: public QwtPickerMachine
+{
+public:
+    virtual CommandList transition(
+        const QwtEventPattern &, const QEvent *);
+};
+
+/*!
+  \brief A state machine for rectangle selections
+
+  Pressing QwtEventPattern::MouseSelect1 starts
+  the selection, releasing it selects the first point. Pressing it
+  again selects the second point and terminates the selection.
+  Pressing QwtEventPattern::KeySelect1 also starts the 
+  selection, a second press selects the first point. A third one selects 
+  the second point and terminates the selection. 
+
+  \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
+*/
+
+class QWT_EXPORT QwtPickerClickRectMachine: public QwtPickerMachine
+{
+public:
+    virtual CommandList transition(
+        const QwtEventPattern &, const QEvent *);
+};
+
+/*!
+  \brief A state machine for rectangle selections
+
+  Pressing QwtEventPattern::MouseSelect1 selects
+  the first point, releasing it the second point.
+  Pressing QwtEventPattern::KeySelect1 also selects the 
+  first point, a second press selects the second point and terminates 
+  the selection.
+
+  \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
+*/
+
+class QWT_EXPORT QwtPickerDragRectMachine: public QwtPickerMachine
+{
+public:
+    virtual CommandList transition(
+        const QwtEventPattern &, const QEvent *);
+};
+
+/*!
+  \brief A state machine for polygon selections
+
+  Pressing QwtEventPattern::MouseSelect1 or QwtEventPattern::KeySelect1 
+  starts the selection and selects the first point, or appends a point. 
+  Pressing QwtEventPattern::MouseSelect2 or QwtEventPattern::KeySelect2 
+  appends the last point and terminates the selection.
+
+  \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
+*/
+
+class QWT_EXPORT QwtPickerPolygonMachine: public QwtPickerMachine
+{
+public:
+    virtual CommandList transition(
+        const QwtEventPattern &, const QEvent *);
+};
+
+#endif
diff --git a/src/qwt/include/qwt_plot.h b/src/qwt/include/qwt_plot.h
new file mode 100644
index 0000000..d9215c7
--- /dev/null
+++ b/src/qwt/include/qwt_plot.h
@@ -0,0 +1,318 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_PLOT_H
+#define QWT_PLOT_H
+
+#include <qframe.h>
+#include "qwt_global.h"
+#include "qwt_array.h"
+#include "qwt_text.h"
+#include "qwt_plot_dict.h"
+#include "qwt_scale_map.h"
+#include "qwt_plot_printfilter.h"
+
+class QwtPlotLayout;
+class QwtLegend;
+class QwtScaleWidget;
+class QwtScaleEngine;
+class QwtScaleDiv;
+class QwtScaleDraw;
+class QwtTextLabel;
+class QwtPlotCanvas;
+class QwtPlotPrintFilter;
+
+/*!
+  \brief A 2-D plotting widget
+
+  QwtPlot is a widget for plotting two-dimensional graphs.
+  An unlimited number of plot items can be displayed on 
+  its canvas. Plot items might be curves (QwtPlotCurve), markers 
+  (QwtPlotMarker), the grid (QwtPlotGrid), or anything else derived 
+  from QwtPlotItem.
+  A plot can have up to four axes, with each plot item attached to an x- and
+  a y axis. The scales at the axes can be explicitely set (QwtScaleDiv), or
+  are calculated from the plot items, using algorithms (QwtScaleEngine) which 
+  can be configured separately for each axis. 
+
+  \par Example
+  The following example shows (schematically) the most simple
+  way to use QwtPlot. By default, only the left and bottom axes are
+  visible and their scales are computed automatically.
+  \verbatim
+#include "../include/qwt_plot.h>
+#include "../include/qwt_plot_curve.h>
+
+QwtPlot *myPlot;
+double x[100], y1[100], y2[100];        // x and y values
+
+myPlot = new QwtPlot("Two Curves", parent);
+
+// add curves
+QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
+QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2");
+
+getSomeValues(x, y1, y2);
+
+// copy the data into the curves
+curve1->setData(x, y1, 100);
+curve2->setData(x, y2, 100);
+
+curve1->attach(myPlot);
+curve2->attach(myPlot);
+
+// finally, refresh the plot
+myPlot->replot();
+\endverbatim
+*/
+
+class QWT_EXPORT QwtPlot: public QFrame, public QwtPlotDict
+{
+    friend class QwtPlotCanvas;
+
+    Q_OBJECT
+
+    Q_ENUMS( Axis Position )
+        
+    // plot
+    Q_PROPERTY( bool autoReplot READ autoReplot WRITE setAutoReplot )
+
+    // canvas
+    Q_PROPERTY( QColor canvasBackground READ canvasBackground 
+        WRITE setCanvasBackground )
+    Q_PROPERTY( int canvasLineWidth READ canvasLineWidth 
+        WRITE setCanvasLineWidth )
+
+    // axes  
+    Q_PROPERTY( bool xBottomAxis READ xBottomAxisEnabled 
+        WRITE enableXBottomAxis )
+    Q_PROPERTY( bool xTopAxis READ xTopAxisEnabled WRITE enableXTopAxis )
+    Q_PROPERTY( bool yLeftAxis READ yLeftAxisEnabled WRITE enableYLeftAxis )
+    Q_PROPERTY( bool yRightAxis READ yRightAxisEnabled WRITE enableYRightAxis )
+
+public:
+    //! Axis index
+    enum Axis 
+    { 
+        yLeft, 
+        yRight, 
+        xBottom, 
+        xTop, 
+        axisCnt 
+    };
+
+    //! Position
+    enum LegendPosition 
+    {
+        LeftLegend,
+        RightLegend,
+        BottomLegend,
+        TopLegend
+    };
+
+    explicit QwtPlot(QWidget *p = 0);
+    explicit QwtPlot(const QwtText &title, QWidget *p = NULL);
+    virtual ~QwtPlot();
+
+    //! Designer API for enableAxis
+    void enableXBottomAxis(bool b) {enableAxis(xBottom,b);}     
+    //! Designer API for axisEnabled
+    bool xBottomAxisEnabled() const {return axisEnabled(xBottom);};
+    //! Designer API for enableAxis
+    void enableXTopAxis(bool b) {enableAxis(xTop,b);}       
+    //! Designer API for axisEnabled
+    bool xTopAxisEnabled() const {return axisEnabled(xTop);};
+    //! Designer API for enableAxis
+    void enableYRightAxis(bool b) {enableAxis(yRight,b);}       
+    //! Designer API for axisEnabled
+    bool yRightAxisEnabled() const {return axisEnabled(yRight);};
+    //! Designer API for enableAxis
+    void enableYLeftAxis(bool b) {enableAxis(yLeft,b);}     
+    //! Designer API for axisEnabled
+    bool yLeftAxisEnabled() const {return axisEnabled(yLeft);};
+
+    void setAutoReplot(bool tf = true);
+    bool autoReplot() const;
+
+    void print(QPaintDevice &p,
+        const QwtPlotPrintFilter & = QwtPlotPrintFilter()) const;
+    virtual void print(QPainter *, const QRect &rect,
+        const QwtPlotPrintFilter & = QwtPlotPrintFilter()) const;
+
+    // Layout
+
+    QwtPlotLayout *plotLayout();
+    const QwtPlotLayout *plotLayout() const;
+
+    void setMargin(int margin);
+    int margin() const;
+
+    // Title
+
+    void setTitle(const QString &);
+    void setTitle(const QwtText &t);
+    QwtText title() const;
+
+    QwtTextLabel *titleLabel();
+    const QwtTextLabel *titleLabel() const;
+
+    // Canvas
+
+    QwtPlotCanvas *canvas();
+    const QwtPlotCanvas *canvas() const;
+
+    void setCanvasBackground (const QColor &c);
+    const QColor& canvasBackground() const;
+
+    void setCanvasLineWidth(int w);
+    int canvasLineWidth() const;
+
+    virtual QwtScaleMap canvasMap(int axisId) const;
+
+    double invTransform(int axisId, int pos) const;
+    int transform(int axisId, double value) const;
+
+    // Axes
+
+    QwtScaleEngine *axisScaleEngine(int axisId);
+    const QwtScaleEngine *axisScaleEngine(int axisId) const;
+    void setAxisScaleEngine(int axisId, QwtScaleEngine *);
+
+    void setAxisAutoScale(int axisId);
+    bool axisAutoScale(int axisId) const;
+
+    void enableAxis(int axisId, bool tf = true);
+    bool axisEnabled(int axisId) const;
+
+    void setAxisFont(int axisId, const QFont &f);
+    QFont axisFont(int axisId) const;
+
+    void setAxisScale(int axisId, double min, double max, double step = 0);
+    void setAxisScaleDiv(int axisId, const QwtScaleDiv &);
+    void setAxisScaleDraw(int axisId, QwtScaleDraw *);
+
+    const QwtScaleDiv *axisScaleDiv(int axisId) const;
+    QwtScaleDiv *axisScaleDiv(int axisId);
+
+    const QwtScaleDraw *axisScaleDraw(int axisId) const;
+    QwtScaleDraw *axisScaleDraw(int axisId);
+
+    const QwtScaleWidget *axisWidget(int axisId) const;
+    QwtScaleWidget *axisWidget(int axisId);
+
+#if QT_VERSION < 0x040000
+    void setAxisLabelAlignment(int axisId, int);
+#else
+    void setAxisLabelAlignment(int axisId, Qt::Alignment);
+#endif
+    void setAxisLabelRotation(int axisId, double rotation);
+
+    void setAxisTitle(int axisId, const QString &);
+    void setAxisTitle(int axisId, const QwtText &);
+    QwtText axisTitle(int axisId) const;
+
+    void setAxisMaxMinor(int axisId, int maxMinor);
+    int axisMaxMajor(int axisId) const;
+    void setAxisMaxMajor(int axisId, int maxMajor);
+    int axisMaxMinor(int axisId) const;
+
+    // Legend 
+
+    void insertLegend(QwtLegend *, LegendPosition = QwtPlot::RightLegend,
+        double ratio = -1.0);
+
+    QwtLegend *legend();
+    const QwtLegend *legend() const;
+
+    // Misc
+
+    virtual void polish();
+    virtual QSize sizeHint() const;
+    virtual QSize minimumSizeHint() const;
+
+    void updateLayout();
+
+    virtual bool event(QEvent *);
+
+signals:
+    /*!
+      A signal which is emitted when the user has clicked on 
+      a legend item, which is in QwtLegend::ClickableItem mode. 
+
+      \param plotItem Corresponding plot item of the
+                 selected legend item
+
+      \note clicks are disabled as default
+      \sa QwtLegend::setItemMode, QwtLegend::itemMode
+     */
+    void legendClicked(QwtPlotItem *plotItem);
+
+    /*!
+      A signal which is emitted when the user has clicked on 
+      a legend item, which is in QwtLegend::CheckableItem mode
+
+      \param plotItem Corresponding plot item of the
+                 selected legend item
+      \param on True when the legen item is checked
+
+      \note clicks are disabled as default
+      \sa QwtLegend::setItemMode, QwtLegend::itemMode
+     */
+
+    void legendChecked(QwtPlotItem *plotItem, bool on);
+
+public slots:
+    void clear();
+
+    virtual void replot();
+    void autoRefresh();
+
+protected slots:
+    virtual void legendItemClicked();
+    virtual void legendItemChecked(bool);
+
+protected:
+    static bool axisValid(int axisId);
+
+    virtual void drawCanvas(QPainter *);
+    virtual void drawItems(QPainter *, const QRect &,
+        const QwtArray<QwtScaleMap> &,
+        const QwtPlotPrintFilter &) const;
+
+    virtual void updateTabOrder();
+
+    void updateAxes();
+
+    virtual void resizeEvent(QResizeEvent *e);
+
+    virtual void printLegendItem(QPainter *, 
+        const QWidget *, const QRect &) const;
+
+    virtual void printTitle(QPainter *, const QRect &) const;
+    virtual void printScale(QPainter *, int axisId, int startDist, int endDist,
+        int baseDist, const QRect &) const;
+    virtual void printCanvas(QPainter *, const QRect &,
+        const QwtArray<QwtScaleMap> &, const QwtPlotPrintFilter &) const;
+    virtual void printLegend(QPainter *, const QRect &) const;
+
+private:
+    void initAxesData();
+    void deleteAxesData();
+    void updateScaleDiv();
+
+    void initPlot(const QwtText &title);
+
+    class AxisData;
+    AxisData *d_axisData[axisCnt];
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_plot_canvas.h b/src/qwt/include/qwt_plot_canvas.h
new file mode 100644
index 0000000..9e138e1
--- /dev/null
+++ b/src/qwt/include/qwt_plot_canvas.h
@@ -0,0 +1,117 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_PLOT_CANVAS_H
+#define QWT_PLOT_CANVAS_H
+
+#include <qframe.h>
+#include <qpen.h>
+#include "qwt_global.h"
+
+class QwtPlot;
+class QPixmap;
+
+/*!
+  \brief Canvas of a QwtPlot. 
+
+  \sa  QwtPlot 
+*/
+
+class QWT_EXPORT QwtPlotCanvas : public QFrame
+{
+    Q_OBJECT
+    friend class QwtPlot;
+
+public:
+
+    /*!
+      \brief Paint attributes
+ 
+      - PaintCached\n
+        Paint double buffered and reuse the content of the pixmap buffer 
+        for some spontaneous repaints that happen when a plot gets unhidden, 
+        deiconified or changes the focus.
+        Disabling the cache will improve the performance for
+        incremental paints (using QwtPlotCurve::draw). 
+
+      - PaintPacked\n
+        Suppress system background repaints and paint it together with 
+        the canvas contents.
+        Painting packed might avoid flickering for expensive repaints,
+        when there is a notable gap between painting the background
+        and the plot contents.
+
+      The default setting enables PaintCached and PaintPacked
+
+      \sa setPaintAttribute(), testPaintAttribute(), paintCache()
+     */
+    enum PaintAttribute
+    {
+        PaintCached = 1,
+        PaintPacked = 2
+    };
+
+    /*!
+      \brief Focus indicator
+
+      - NoFocusIndicator\n
+        Don�t paint a focus indicator
+
+      - CanvasFocusIndicator\n
+        The focus is related to the complete canvas.
+        Paint the focus indicator using paintFocus()
+
+      - ItemFocusIndicator\n
+        The focus is related to an item (curve, point, ...) on
+        the canvas. It is up to the application to display a
+        focus indication using f.e. highlighting.
+
+      \sa setFocusIndicator(), focusIndicator(), paintFocus()
+    */
+
+    enum FocusIndicator
+    {
+        NoFocusIndicator,
+        CanvasFocusIndicator,
+        ItemFocusIndicator
+    };
+
+    void setFocusIndicator(FocusIndicator);
+    FocusIndicator focusIndicator() const;
+
+    void setPaintAttribute(PaintAttribute, bool on = true);
+    bool testPaintAttribute(PaintAttribute) const;
+
+    QPixmap *paintCache();
+    const QPixmap *paintCache() const;
+    void invalidatePaintCache();
+
+protected:
+    explicit QwtPlotCanvas(QwtPlot *);
+    virtual ~QwtPlotCanvas();
+
+    virtual void hideEvent(QHideEvent *);
+
+    virtual void paintEvent(QPaintEvent *);
+
+    virtual void drawContents(QPainter *);
+    virtual void drawFocusIndicator(QPainter *);
+
+    void drawCanvas(QPainter *painter = NULL);
+
+private:    
+    void setSystemBackground(bool);
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_plot_curve.h b/src/qwt/include/qwt_plot_curve.h
new file mode 100644
index 0000000..0d5fdef
--- /dev/null
+++ b/src/qwt/include/qwt_plot_curve.h
@@ -0,0 +1,260 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_PLOT_CURVE_H
+#define QWT_PLOT_CURVE_H
+
+#include <qpen.h>
+#include <qstring.h>
+#include "qwt_global.h"
+#include "qwt_plot_item.h"
+#include "qwt_text.h"
+#include "qwt_data.h"
+
+class QPainter;
+class QwtScaleMap;
+class QwtSymbol;
+
+#if QT_VERSION < 0x040000
+class QPointArray;
+#else
+class QPolygon;
+#endif
+
+/*!
+  \brief A class which draws curves
+
+  This class can be used to display data as a curve in the  x-y plane.
+  It supports different display styles, spline interpolation and symbols.
+
+  \par Usage
+  <dl><dt>A. Assign curve properties</dt>
+  <dd>When a curve is created, it is configured to draw black solid lines
+  with QwtPlotCurve::Lines and no symbols. You can change this by calling 
+  QwtPlotCurve::setPen(), QwtPlotCurve::setStyle() and QwtPlotCurve::setSymbol().</dd>
+  <dt>B. Assign or change data.</dt>
+  <dd>Data can be set in two ways:<ul>
+  <li>QwtPlotCurve::setData() is overloaded to initialize the x and y data by
+  copying from different data structures with different kind of copy semantics.
+  <li>QwtPlotCurve::setRawData() only stores the pointers and size information
+  and is provided for backwards compatibility.  This function is less safe (you
+  must not delete the data while they are attached), but has been more
+  efficient, and has been more convenient for dynamically changing data.
+  Use of QwtPlotCurve::setData() in combination with a problem-specific subclass
+  of QwtData is always preferrable.</ul></dd>
+  <dt>C. Draw</dt>
+  <dd>QwtPlotCurve::draw() maps the data into pixel coordinates and paints them.
+  </dd></dl>
+
+  \par Example:
+  see examples/curvdemo
+
+  \sa QwtData, QwtSymbol, QwtScaleMap
+*/
+class QWT_EXPORT QwtPlotCurve: public QwtPlotItem
+{
+public:
+    /*! 
+        Curve styles. 
+        \sa QwtPlotCurve::setStyle
+    */
+    enum CurveStyle
+    {
+        NoCurve,
+        Lines,
+        Sticks,
+        Steps,
+        Dots,
+        Spline,
+        UserCurve = 100
+    };
+
+    /*! 
+        Curve attributes. 
+        \sa QwtPlotCurve::setCurveAttribute, QwtPlotCurve::testCurveAttribute
+    */
+    enum CurveAttribute
+    {
+        Auto = 0,
+        Yfx = 1,
+        Xfy = 2,
+        Parametric = 4,
+        Periodic = 8,
+        Inverted = 16
+    };
+
+    /*! 
+        Paint attributes 
+        \sa QwtPlotCurve::setPaintAttribute, testPaintAttribute
+    */
+    enum PaintAttribute
+    {
+        PaintFiltered = 1,
+        ClipPolygons = 2
+    };
+
+    explicit QwtPlotCurve();
+    explicit QwtPlotCurve(const QwtText &title);
+    explicit QwtPlotCurve(const QString &title);
+    explicit QwtPlotCurve(const QwtPlotCurve &c);
+
+    virtual ~QwtPlotCurve();
+
+    const QwtPlotCurve& operator= (const QwtPlotCurve &c);
+
+    virtual int rtti() const;
+
+    void setPaintAttribute(PaintAttribute, bool on = true);
+    bool testPaintAttribute(PaintAttribute) const;
+
+    void setRawData(const double *x, const double *y, int size);
+    void setData(const double *xData, const double *yData, int size);
+    void setData(const QwtArray<double> &xData, const QwtArray<double> &yData);
+    void setData(const QwtArray<QwtDoublePoint> &data);
+    void setData(const QwtData &data);
+    
+    int closestPoint(const QPoint &pos, double *dist = NULL) const;
+
+    QwtData &data();
+    const QwtData &data() const;
+
+    int dataSize() const;
+    inline double x(int i) const;
+    inline double y(int i) const;
+
+    virtual QwtDoubleRect boundingRect() const;
+
+    //! boundingRect().left()
+    inline double minXValue() const { return boundingRect().left(); }
+    //! boundingRect().right()
+    inline double maxXValue() const { return boundingRect().right(); }
+    //! boundingRect().top()
+    inline double minYValue() const { return boundingRect().top(); }
+    //! boundingRect().bottom()
+    inline double maxYValue() const { return boundingRect().bottom(); }
+
+    void setCurveAttribute(CurveAttribute, bool on = true);
+    bool testCurveAttribute(CurveAttribute) const;
+
+    void setTitle(const QString &title);
+    void setTitle(const QwtText &title);
+    const QwtText &title() const;
+
+    void setPen(const QPen &);
+    const QPen &pen() const;
+
+    void setBrush(const QBrush &);
+    const QBrush &brush() const;
+
+    void setBaseline(double ref);
+    double baseline() const;
+
+    void setStyle(CurveStyle style);
+    CurveStyle style() const;
+
+    void setSymbol(const QwtSymbol &s);
+    const QwtSymbol& symbol() const;
+
+    void setSplineSize(int s);
+    int splineSize() const;
+
+    virtual void draw(QPainter *p, 
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        const QRect &) const;
+
+    virtual void draw(QPainter *p, 
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        int from, int to) const;
+
+    void draw(int from, int to) const;
+
+    virtual void updateLegend(QwtLegend *) const;
+
+protected:
+
+    void init(const QwtText &title);
+    void copy(const QwtPlotCurve &c);
+
+    virtual void drawCurve(QPainter *p, int style,
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        int from, int to) const;
+
+    virtual void drawSymbols(QPainter *p, const QwtSymbol &,
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        int from, int to) const;
+
+    void drawLines(QPainter *p,
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        int from, int to) const;
+    void drawSticks(QPainter *p,
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        int from, int to) const;
+    void drawDots(QPainter *p,
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        int from, int to) const;
+    void drawSteps(QPainter *p,
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        int from, int to) const;
+    void drawSpline(QPainter *p,
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap) const;
+
+#if QT_VERSION < 0x040000
+    void fillCurve(QPainter *,
+        const QwtScaleMap &, const QwtScaleMap &,
+        QPointArray &) const;
+    void closePolyline(const QwtScaleMap &, const QwtScaleMap &,
+        QPointArray &) const;
+#else
+    void fillCurve(QPainter *,
+        const QwtScaleMap &, const QwtScaleMap &,
+        QPolygon &) const;
+    void closePolyline(const QwtScaleMap &, const QwtScaleMap &,
+        QPolygon &) const;
+#endif
+
+    int verifyRange(int &i1, int &i2) const;
+
+private:
+    QwtData *d_xy;
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+//! \return the the curve data
+inline QwtData &QwtPlotCurve::data()
+{
+    return *d_xy;
+}
+
+//! \return the the curve data
+inline const QwtData &QwtPlotCurve::data() const
+{
+    return *d_xy;
+}
+
+/*!
+    \param i index
+    \return x-value at position i
+*/
+inline double QwtPlotCurve::x(int i) const 
+{ 
+    return d_xy->x(i); 
+}
+
+/*!
+    \param i index
+    \return y-value at position i
+*/
+inline double QwtPlotCurve::y(int i) const 
+{ 
+    return d_xy->y(i); 
+}
+
+#endif
diff --git a/src/qwt/include/qwt_plot_dict.h b/src/qwt/include/qwt_plot_dict.h
new file mode 100644
index 0000000..9f6e2a3
--- /dev/null
+++ b/src/qwt/include/qwt_plot_dict.h
@@ -0,0 +1,51 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_PLOT_DICT
+#define QWT_PLOT_DICT
+
+#include "qwt_global.h"
+#include "qwt_plot_item.h"
+
+#if QT_VERSION < 0x040000
+#include <qvaluelist.h>
+typedef QValueListConstIterator<QwtPlotItem *> QwtPlotItemIterator;
+typedef QValueList<QwtPlotItem *> QwtPlotItemList;
+#else
+#include <qlist.h>
+typedef QList<QwtPlotItem *>::ConstIterator QwtPlotItemIterator;
+typedef QList<QwtPlotItem *> QwtPlotItemList;
+#endif
+
+class QWT_EXPORT QwtPlotDict
+{
+public:
+    explicit QwtPlotDict();
+    ~QwtPlotDict();
+
+    void setAutoDelete(bool);
+    bool autoDelete() const;
+
+    const QwtPlotItemList& itemList() const;
+
+    void detachItems(int rtti = QwtPlotItem::Rtti_PlotItem,
+        bool autoDelete = true);
+
+private:
+    friend class QwtPlotItem;
+
+    void attachItem(QwtPlotItem *, bool);
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_plot_grid.h b/src/qwt/include/qwt_plot_grid.h
new file mode 100644
index 0000000..29e4f1f
--- /dev/null
+++ b/src/qwt/include/qwt_plot_grid.h
@@ -0,0 +1,87 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_PLOT_GRID_H
+#define QWT_PLOT_GRID_H
+
+#include "qwt_global.h"
+#include "qwt_plot_item.h"
+#include "qwt_scale_div.h"
+
+class QPainter;
+class QPen;
+class QwtScaleMap;
+class QwtScaleDiv;
+
+/*!
+  \brief A class which draws a coordinate grid
+
+  The QwtPlotGrid class can be used to draw a coordinate grid.
+  A coordinate grid consists of major and minor vertical
+  and horizontal gridlines. The locations of the gridlines
+  are determined by the X and Y scale divisions which can
+  be assigned with QwtPlotGrid::setXDiv and QwtPlotGrid::setYDiv()
+  The draw() member draws the grid within a bounding
+  rectangle.
+*/
+
+class QWT_EXPORT QwtPlotGrid: public QwtPlotItem
+{
+public:
+    explicit QwtPlotGrid();
+    virtual ~QwtPlotGrid();
+
+    virtual int rtti() const;
+
+    void enableX(bool tf);
+    bool xEnabled() const;
+
+    void enableY(bool tf);
+    bool yEnabled() const;
+
+    void enableXMin(bool tf);
+    bool xMinEnabled() const;
+
+    void enableYMin(bool tf);
+    bool yMinEnabled() const;
+
+    void setXDiv(const QwtScaleDiv &sx);
+    const QwtScaleDiv &xScaleDiv() const;
+
+    void setYDiv(const QwtScaleDiv &sy);
+    const QwtScaleDiv &yScaleDiv() const;
+
+    void setPen(const QPen &p);
+
+    void setMajPen(const QPen &p);
+    const QPen& majPen() const;
+
+    void setMinPen(const QPen &p);
+    const QPen& minPen() const;
+
+    virtual void draw(QPainter *p, 
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        const QRect &rect) const;
+
+    virtual void updateScaleDiv(const QwtScaleDiv&,
+        const QwtScaleDiv&);
+
+protected:
+    virtual void gridChanged();
+
+private:
+    void drawLines(QPainter *painter, const QRect &,
+        Qt::Orientation orientation, const QwtScaleMap &, 
+        const QwtTickList &) const;
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_plot_item.h b/src/qwt/include/qwt_plot_item.h
new file mode 100644
index 0000000..39c28ba
--- /dev/null
+++ b/src/qwt/include/qwt_plot_item.h
@@ -0,0 +1,109 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_PLOT_ITEM_H
+#define QWT_PLOT_ITEM_H
+
+#include "qwt_global.h"
+#include "qwt_double_rect.h"
+
+class QRect;
+class QPainter;
+class QWidget;
+class QwtPlot;
+class QwtLegend;
+class QwtScaleMap;
+class QwtScaleDiv;
+
+/*!
+  \brief Base class for items on the plot canvas
+*/
+
+class QWT_EXPORT QwtPlotItem
+{
+public:
+    enum RttiValues
+    { 
+        Rtti_PlotItem = 0,
+
+        Rtti_PlotGrid,
+        Rtti_PlotMarker,
+        Rtti_PlotCurve,
+        Rtti_PlotHistogram,
+
+        Rtti_PlotUserItem = 1000
+    };
+
+    enum ItemAttribute
+    {
+        Legend = 1,
+        AutoScale = 2
+    };
+
+#if QT_VERSION >= 0x040000
+    enum RenderHint
+    {
+        RenderAntialiased = 1
+    };
+#endif
+
+    explicit QwtPlotItem();
+    virtual ~QwtPlotItem();
+
+    void attach(QwtPlot *plot);
+    void detach() { attach(NULL); }
+
+    QwtPlot *plot() const;
+    
+    virtual int rtti() const;
+
+    void setItemAttribute(ItemAttribute, bool on = true);
+    bool testItemAttribute(ItemAttribute) const;
+
+#if QT_VERSION >= 0x040000
+    void setRenderHint(RenderHint, bool on = true);
+    bool testRenderHint(RenderHint) const;
+#endif
+
+    double z() const; 
+    void setZ(double z);
+
+    void show();
+    void hide();
+    virtual void setVisible(bool);
+    bool isVisible () const;
+
+    void setAxis(int xAxis, int yAxis);
+
+    void setXAxis(int axis);
+    int xAxis() const;
+
+    void setYAxis(int axis);
+    int yAxis() const;
+
+    virtual void itemChanged();
+
+    virtual void draw(QPainter *p, 
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        const QRect &rect) const = 0;
+
+    virtual QwtDoubleRect boundingRect() const;
+
+    virtual void updateLegend(QwtLegend *) const;
+    virtual void updateScaleDiv(const QwtScaleDiv&,
+        const QwtScaleDiv&);
+
+    virtual QWidget *legendItem() const;
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+            
+#endif
diff --git a/src/qwt/include/qwt_plot_layout.h b/src/qwt/include/qwt_plot_layout.h
new file mode 100644
index 0000000..d0bd089
--- /dev/null
+++ b/src/qwt/include/qwt_plot_layout.h
@@ -0,0 +1,87 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_PLOT_LAYOUT_H
+#define QWT_PLOT_LAYOUT_H
+
+#include "qwt_global.h"
+#include "qwt_plot.h"
+
+/*!
+  \brief Layout class for QwtPlot.
+
+  Organizes the geometry for the different QwtPlot components.
+*/
+
+class QWT_EXPORT QwtPlotLayout
+{
+public:
+    enum Options
+    {
+        AlignScales = 1,
+        IgnoreScrollbars = 2,
+        IgnoreFrames = 4,
+        IgnoreMargin = 8,
+        IgnoreLegend = 16
+    };
+
+    explicit QwtPlotLayout();
+    virtual ~QwtPlotLayout();
+
+    void setMargin(int);
+    int margin() const;
+
+    void setCanvasMargin(int margin, int axis = -1);
+    int canvasMargin(int axis) const;
+
+    void setAlignCanvasToScales(bool);
+    bool alignCanvasToScales() const;
+
+    void setSpacing(int);
+    int spacing() const;
+
+    void setLegendPosition(QwtPlot::LegendPosition pos, double ratio);
+    void setLegendPosition(QwtPlot::LegendPosition pos);
+    QwtPlot::LegendPosition legendPosition() const;
+
+    void setLegendRatio(double ratio);
+    double legendRatio() const;
+
+    virtual QSize minimumSizeHint(const QwtPlot *) const;    
+
+    virtual void activate(const QwtPlot *, 
+        const QRect &rect, int options = 0);
+
+    virtual void invalidate();
+
+    const QRect &titleRect() const;
+    const QRect &legendRect() const;
+    const QRect &scaleRect(int axis) const;
+    const QRect &canvasRect() const;
+
+protected:
+
+    QRect layoutLegend(int options, const QRect &) const;
+    QRect alignLegend(const QRect &canvasRect, 
+        const QRect &legendRect) const;
+
+    void expandLineBreaks(int options, const QRect &rect, 
+        int &dimTitle, int dimAxes[QwtPlot::axisCnt]) const;
+
+    void alignScales(int options, QRect &canvasRect,
+        QRect scaleRect[QwtPlot::axisCnt]) const;
+
+private:
+    class LayoutData;
+    class PrivateData;
+
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_plot_marker.h b/src/qwt/include/qwt_plot_marker.h
new file mode 100644
index 0000000..249079c
--- /dev/null
+++ b/src/qwt/include/qwt_plot_marker.h
@@ -0,0 +1,103 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_PLOT_MARKER_H
+#define QWT_PLOT_MARKER_H
+
+#include <qpen.h>
+#include <qfont.h>
+#include <qstring.h>
+#include <qbrush.h>
+#include "qwt_global.h"
+#include "qwt_plot_item.h"
+
+class QRect;
+class QwtText;
+class QwtSymbol;
+
+/*!
+  \brief A class for drawing markers
+
+  A marker can be a horizontal line, a vertical line,
+  a symbol, a label or any combination of them, which can
+  be drawn around a center point inside a bounding rectangle.
+
+  The QwtPlotMarker::setSymbol() member assigns a symbol to the marker.
+  The symbol is drawn at the specified point.
+
+  With QwtPlotMarker::setLabel(), a label can be assigned to the marker.
+  The QwtPlotMarker::setLabelAlignment() member specifies where the label is
+  drawn. All the Align*-constants in Qt::AlignmentFlags (see Qt documentation)
+  are valid. The interpretation of the alignment depends on the marker's
+  line style. The alignment refers to the center point of
+  the marker, which means, for example, that the label would be printed
+  left above the center point if the alignment was set to AlignLeft|AlignTop.
+*/
+
+class QWT_EXPORT QwtPlotMarker: public QwtPlotItem
+{
+public:
+
+    /*!
+        Line styles.
+        \sa QwtPlotMarker::setLineStyle, QwtPlotMarker::lineStyle
+    */
+    enum LineStyle {NoLine, HLine, VLine, Cross};
+   
+    explicit QwtPlotMarker();
+    virtual ~QwtPlotMarker();
+
+    QwtPlotMarker(const QwtPlotMarker&);
+    QwtPlotMarker &operator=(const QwtPlotMarker&);
+    
+    virtual int rtti() const;
+
+    double xValue() const;
+    double yValue() const;
+    QwtDoublePoint value() const;
+
+    void setXValue(double);
+    void setYValue(double);
+    void setValue(double, double);
+    void setValue(const QwtDoublePoint &);
+
+    void setLineStyle(LineStyle st);
+    LineStyle lineStyle() const;
+
+    void setLinePen(const QPen &p);
+    const QPen &linePen() const;
+
+    void setSymbol(const QwtSymbol &s);
+    const QwtSymbol &symbol() const;
+
+    void setLabel(const QwtText&);
+    QwtText label() const;
+
+#if QT_VERSION < 0x040000
+    void setLabelAlignment(int align);
+    int labelAlignment() const;
+#else
+    void setLabelAlignment(Qt::Alignment);
+    Qt::Alignment labelAlignment() const;
+#endif
+
+    virtual void draw(QPainter *p, 
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        const QRect &) const;
+    
+    virtual QwtDoubleRect boundingRect() const;
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_plot_picker.h b/src/qwt/include/qwt_plot_picker.h
new file mode 100644
index 0000000..d601b79
--- /dev/null
+++ b/src/qwt/include/qwt_plot_picker.h
@@ -0,0 +1,122 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_PLOT_PICKER_H
+#define QWT_PLOT_PICKER_H
+
+#include "qwt_double_rect.h"
+#include "qwt_plot_canvas.h"
+#include "qwt_picker.h"
+
+class QwtPlot;
+
+/*!
+  \brief QwtPlotPicker provides selections on a plot canvas
+
+  QwtPlotPicker is a QwtPicker tailored for selections on
+  a plot canvas. It is set to a x-Axis and y-Axis and
+  translates all pixel coordinates into this coodinate system.
+
+  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
+           leaves the axis in an 'intermediate' state.
+           In this case, to prevent buggy behaviour, your must call
+       QwtPlot::replot() before calling QwtPlotPicker::scaleRect(),
+       QwtPlotZoomer::scaleRect(), QwtPlotPicker::QwtPlotPicker() or
+       QwtPlotZoomer::QwtPlotZoomer().
+           This quirk will be removed in a future release.
+*/
+
+class QWT_EXPORT QwtPlotPicker: public QwtPicker
+{
+    Q_OBJECT
+
+public:
+    explicit QwtPlotPicker(QwtPlotCanvas *);
+
+    explicit QwtPlotPicker(int xAxis, int yAxis,
+        QwtPlotCanvas *);
+
+    explicit QwtPlotPicker(int xAxis, int yAxis, int selectionFlags, 
+        RubberBand rubberBand, DisplayMode trackerMode, 
+        QwtPlotCanvas *);
+
+    virtual void setAxis(int xAxis, int yAxis);
+
+    int xAxis() const;
+    int yAxis() const;
+
+    QwtPlot *plot();
+    const QwtPlot *plot() const;
+    
+    QwtPlotCanvas *canvas();
+    const QwtPlotCanvas *canvas() const;
+
+signals:
+
+    /*!
+      A signal emitted in case of selectionFlags() & PointSelection.
+      \param pos Selected point
+    */
+    void selected(const QwtDoublePoint &pos);
+
+    /*!
+      A signal emitted in case of selectionFlags() & RectSelection.
+      \param rect Selected rectangle
+    */
+    void selected(const QwtDoubleRect &rect);
+
+    /*!
+      A signal emitting the selected points,
+      at the end of a selection.
+
+      \param pa Selected points
+    */
+    void selected(const QwtArray<QwtDoublePoint> &pa);
+
+    /*!
+      A signal emitted when a point has been appended to the selection
+
+      \param pos Position of the appended point.
+      \sa append(). moved()
+    */
+    void appended(const QwtDoublePoint &pos);
+
+    /*!
+      A signal emitted whenever the last appended point of the
+      selection has been moved.
+
+      \param pos Position of the moved last point of the selection.
+      \sa move(), appended() 
+    */
+    void moved(const QwtDoublePoint &pos);
+
+protected:
+    QwtDoubleRect scaleRect() const;
+
+    QwtDoubleRect invTransform(const QRect &) const;
+    QRect transform(const QwtDoubleRect &) const;
+
+    QwtDoublePoint invTransform(const QPoint &) const;
+    QPoint transform(const QwtDoublePoint &) const;
+
+    virtual QwtText trackerText(const QPoint &) const;
+    virtual QwtText trackerText(const QwtDoublePoint &) const;
+
+    virtual void move(const QPoint &);
+    virtual void append(const QPoint &);
+    virtual bool end(bool ok = true);
+
+private:
+    int d_xAxis;
+    int d_yAxis;
+};
+            
+#endif
diff --git a/src/qwt/include/qwt_plot_printfilter.h b/src/qwt/include/qwt_plot_printfilter.h
new file mode 100644
index 0000000..39c26b9
--- /dev/null
+++ b/src/qwt/include/qwt_plot_printfilter.h
@@ -0,0 +1,79 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_PLOT_PRINTFILTER_H
+#define QWT_PLOT_PRINTFILTER_H
+
+#include <qcolor.h>
+#include <qfont.h>
+#include "qwt_global.h"
+
+class QwtPlot;
+class QwtPlotItem;
+
+/*!
+  \brief A base class for plot print filters
+
+  QwtPlotPrintFilter can be used to customize QwtPlot::print.
+*/
+
+class QWT_EXPORT QwtPlotPrintFilter
+{
+public:
+    //! Print options
+    enum Options 
+    {
+        PrintMargin = 1,
+        PrintTitle = 2,
+        PrintLegend = 4,
+        PrintGrid = 8,
+        PrintCanvasBackground = 16,
+        PrintWidgetBackground = 32,
+
+        PrintAll = ~PrintWidgetBackground
+    }; 
+
+    //! Print items
+    enum Item
+    {
+        Title,
+        Legend,
+        Curve,
+        CurveSymbol,
+        Marker,
+        MarkerSymbol,
+        MajorGrid,
+        MinorGrid,
+        CanvasBackground,
+        AxisScale,
+        AxisTitle,
+        WidgetBackground
+    };
+
+    explicit QwtPlotPrintFilter();
+    virtual ~QwtPlotPrintFilter(); 
+
+    virtual QColor color(const QColor &, Item item) const;
+    virtual QFont font(const QFont &, Item item) const;
+
+    void setOptions(int options);
+    int options() const;
+
+    virtual void apply(QwtPlot *) const;
+    virtual void reset(QwtPlot *) const;
+
+    virtual void apply(QwtPlotItem *) const;
+    virtual void reset(QwtPlotItem *) const;
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_plot_zoomer.h b/src/qwt/include/qwt_plot_zoomer.h
new file mode 100644
index 0000000..10745f5
--- /dev/null
+++ b/src/qwt/include/qwt_plot_zoomer.h
@@ -0,0 +1,127 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_PLOT_ZOOMER_H
+#define QWT_PLOT_ZOOMER_H
+
+#include <qglobal.h>
+#if QT_VERSION < 0x040000
+#include <qvaluestack.h>
+#else
+#include <qstack.h>
+#endif
+
+#include "qwt_double_rect.h"
+#include "qwt_plot_picker.h"
+
+/*!
+  \brief QwtPlotZoomer provides stacked zooming for a plot widget
+
+  QwtPlotZoomer offers rubberband selections on the plot canvas, 
+  translating the selected rectangles into plot coordinates and
+  adjusting the axes to them. Zooming can repeated as often as 
+  possible, limited only by maxStackDepth() or minZoomSize(). 
+  Each rectangle is pushed on a stack. 
+
+  Zoom rectangles can be selected depending on selectionFlags() using the
+  mouse or keyboard (QwtEventPattern, QwtPickerMachine).
+  QwtEventPattern::MouseSelect3/QwtEventPattern::KeyUndo, 
+  or QwtEventPattern::MouseSelect6/QwtEventPattern::KeyRedo 
+  walk up and down the zoom stack.
+  QwtEventPattern::MouseSelect2 or QwtEventPattern::KeyHome unzoom to
+  the initial size. 
+  
+  QwtPlotZoomer is tailored for plots with one x and y axis, but it is
+  allowed to attach a second QwtPlotZoomer for the other axes.
+
+  \note The realtime example includes an derived zoomer class that adds 
+        scrollbars to the plot canvas.
+
+  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
+           leaves the axis in an 'intermediate' state.
+           In this case, to prevent buggy behaviour, your must call
+       QwtPlot::replot() before calling QwtPlotPicker::scaleRect(),
+       QwtPlotZoomer::scaleRect(), QwtPlotPicker::QwtPlotPicker() or
+       QwtPlotZoomer::QwtPlotZoomer().
+           This quirk will be removed in a future release.
+*/
+
+class QWT_EXPORT QwtPlotZoomer: public QwtPlotPicker
+{
+    Q_OBJECT
+public:
+    explicit QwtPlotZoomer(QwtPlotCanvas *);
+    explicit QwtPlotZoomer(int xAxis, int yAxis, QwtPlotCanvas *);
+    explicit QwtPlotZoomer(int xAxis, int yAxis, int selectionFlags,
+        DisplayMode trackerMode, QwtPlotCanvas *);
+
+    virtual ~QwtPlotZoomer();
+
+    virtual void setZoomBase();
+    virtual void setZoomBase(const QwtDoubleRect &);
+
+    QwtDoubleRect zoomBase() const;
+    QwtDoubleRect zoomRect() const;
+
+    virtual void setAxis(int xAxis, int yAxis);
+
+    void setMaxStackDepth(int);
+    int maxStackDepth() const;
+
+#if QT_VERSION < 0x040000
+    const QValueStack<QwtDoubleRect> &zoomStack() const;
+#else
+    const QStack<QwtDoubleRect> &zoomStack() const;
+#endif
+    uint zoomRectIndex() const;
+
+    virtual void setSelectionFlags(int);
+
+public slots:
+    void moveBy(double x, double y);
+    virtual void move(double x, double y);
+
+    virtual void zoom(const QwtDoubleRect &);
+    virtual void zoom(int up);
+
+signals:
+    /*!
+      A signal emitting the zoomRect(), when the plot has been 
+      zoomed in or out.
+
+      \param rect Current zoom rectangle.
+      \warning zoomed() is only emitted after selections in end(), but never
+               in zoom().
+    */
+
+    void zoomed(const QwtDoubleRect &rect);
+
+protected:
+    virtual void rescale();
+
+    virtual QwtDoubleSize minZoomSize() const;
+
+    virtual void widgetMouseReleaseEvent(QMouseEvent *);
+    virtual void widgetKeyPressEvent(QKeyEvent *);
+
+    virtual void begin();
+    virtual bool end(bool ok = true);
+    virtual bool accept(SelectedPoints &) const;
+
+private:
+    void init(int selectionFlags = RectSelection & ClickSelection, 
+        DisplayMode trackerMode = ActiveOnly);
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+            
+#endif
diff --git a/src/qwt/include/qwt_rect.h b/src/qwt/include/qwt_rect.h
new file mode 100644
index 0000000..dd80cfa
--- /dev/null
+++ b/src/qwt/include/qwt_rect.h
@@ -0,0 +1,50 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_RECT_H
+#define QWT_RECT_H
+
+#include <qrect.h>
+#if QT_VERSION < 0x040000
+#include <qpointarray.h>
+#else
+#include <qpolygon.h>
+#endif
+#include "qwt_global.h"
+
+/*!
+  \brief Some extensions for QRect
+*/
+
+class QWT_EXPORT QwtRect : public QRect
+{
+public:
+    QwtRect();
+    QwtRect(const QRect &r);
+
+#if QT_VERSION < 0x040000
+    QPointArray clip(const QPointArray &) const;
+#else
+    QPolygon clip(const QPolygon &) const;
+#endif
+
+private:
+    enum Edge { Left, Top, Right, Bottom, NEdges };
+
+#if QT_VERSION < 0x040000
+    void clipEdge(Edge, const QPointArray &, QPointArray &) const;
+#else
+    void clipEdge(Edge, const QPolygon &, QPolygon &) const;
+#endif
+    bool insideEdge(const QPoint &, Edge edge) const;
+    QPoint intersectEdge(const QPoint &p1, 
+        const QPoint &p2, Edge edge) const;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_round_scale_draw.h b/src/qwt/include/qwt_round_scale_draw.h
new file mode 100644
index 0000000..ea7d562
--- /dev/null
+++ b/src/qwt/include/qwt_round_scale_draw.h
@@ -0,0 +1,72 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_ROUND_SCALE_DRAW_H
+#define QWT_ROUND_SCALE_DRAW_H
+
+#include <qpoint.h>
+#include "qwt_global.h"
+#include "qwt_abstract_scale_draw.h"
+
+class QPen;
+
+/*!
+  \brief A class for drawing round scales
+
+  QwtRoundScaleDraw can be used to draw round scales.
+  The circle segment can be adjusted by QwtRoundScaleDraw::setAngleRange().
+  The geometry of the scale can be specified with 
+  QwtRoundScaleDraw::moveCenter() and QwtRoundScaleDraw::setRadius().
+
+  After a scale division has been specified as a QwtScaleDiv object
+  using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s),
+  the scale can be drawn with the QwtAbstractScaleDraw::draw() member.
+*/
+
+class QWT_EXPORT QwtRoundScaleDraw: public QwtAbstractScaleDraw
+{
+public:
+    QwtRoundScaleDraw();
+    QwtRoundScaleDraw(const QwtRoundScaleDraw &);
+
+    virtual ~QwtRoundScaleDraw();
+
+    QwtRoundScaleDraw &operator=(const QwtRoundScaleDraw &other);
+
+    void setRadius(int radius);
+    int radius() const;
+
+    void moveCenter(int x, int y);
+    void moveCenter(const QPoint &);
+    QPoint center() const;
+
+    void setAngleRange(double angle1, double angle2);
+
+    virtual int extent(const QPen &, const QFont &) const;
+
+protected:
+    QPoint labelCenter( const QFont &, double arc, const QwtText &) const;
+    QSize labelSize(const QFont &, double val) const;
+    QRect labelRect(const QFont &, double val) const;
+
+    virtual void drawTick(QPainter *p, double val, int len) const;
+    virtual void drawBackbone(QPainter *p) const;
+    virtual void drawLabel(QPainter *p, double val) const;
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+inline void QwtRoundScaleDraw::moveCenter(int x, int y)
+{
+    moveCenter(QPoint(x, y));
+}
+
+#endif
diff --git a/src/qwt/include/qwt_scale_div.h b/src/qwt/include/qwt_scale_div.h
new file mode 100644
index 0000000..b0b7ef8
--- /dev/null
+++ b/src/qwt/include/qwt_scale_div.h
@@ -0,0 +1,132 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_SCALE_DIV_H
+#define QWT_SCALE_DIV_H
+
+#include "qwt_global.h"
+
+class QwtDoubleInterval;
+
+#if QT_VERSION < 0x040000
+
+#include <qvaluelist.h>
+
+#if defined(QWT_TEMPLATEDLL)
+// MOC_SKIP_BEGIN
+template class QWT_EXPORT QValueList<double>;
+// MOC_SKIP_END
+#endif
+
+typedef QValueList<double> QwtTickList;
+
+#else
+
+#include <qlist.h>
+
+#if defined(QWT_TEMPLATEDLL)
+
+#if defined Q_CC_MSVC  // Q_CC_MSVC_NET
+// Some definitions, needed to avoid a MSVC crash
+#include <qset.h>
+#include <qvector.h>
+inline uint qHash(double key) { return uint(key); }
+#endif
+
+// MOC_SKIP_BEGIN
+template class QWT_EXPORT QList<double>;
+// MOC_SKIP_END
+#endif
+
+typedef QList<double> QwtTickList;
+
+#endif
+
+
+/*!
+  \brief A class representing a scale division
+
+  A scale division consists of its limits and 3 list
+  of tick values qualified as major, medium and minor ticks.
+
+  In most cases scale divisions are calculated by a QwtScaleEngine.
+
+  \sa QwtScaleEngine::subDivideInto, QwtScaleEngine::subDivide
+*/
+
+class QWT_EXPORT QwtScaleDiv
+{
+public:
+    enum TickType
+    {
+        NoTick = -1,
+
+        MinorTick,
+        MediumTick,
+        MajorTick,
+
+        NTickTypes
+    };
+
+    explicit QwtScaleDiv();
+    explicit QwtScaleDiv(const QwtDoubleInterval &,
+        QwtTickList[NTickTypes]);
+    explicit QwtScaleDiv(double lBound, double rBound,
+        QwtTickList[NTickTypes]);
+
+    int operator==(const QwtScaleDiv &s) const;
+    int operator!=(const QwtScaleDiv &s) const;
+    
+    inline double lBound() const;
+    inline double hBound() const;
+    inline double range() const;
+
+    bool contains(double v) const;
+
+    const QwtTickList &ticks(int type) const;
+
+    void invalidate();
+    bool isValid() const;
+ 
+    void invert();
+
+private:
+    double d_lBound;
+    double d_hBound;
+    QwtTickList d_ticks[NTickTypes];
+
+    bool d_isValid;
+};
+
+/*! 
+  \return left bound
+  \sa QwtScaleDiv::hBound
+*/
+inline double QwtScaleDiv::lBound() const 
+{ 
+    return d_lBound;
+}
+
+/*! 
+  \return right bound
+  \sa QwtScaleDiv::lBound
+*/
+inline double QwtScaleDiv::hBound() const 
+{ 
+    return d_hBound;
+}
+
+/*! 
+  \return hBound() - lBound()
+*/
+inline double QwtScaleDiv::range() const 
+{ 
+    return d_hBound - d_lBound;
+}
+#endif
diff --git a/src/qwt/include/qwt_scale_draw.h b/src/qwt/include/qwt_scale_draw.h
new file mode 100644
index 0000000..124a379
--- /dev/null
+++ b/src/qwt/include/qwt_scale_draw.h
@@ -0,0 +1,107 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_SCALE_DRAW_H
+#define QWT_SCALE_DRAW_H
+
+#include <qpoint.h>
+#include "qwt_global.h"
+#include "qwt_abstract_scale_draw.h"
+
+/*!
+  \brief A class for drawing scales
+
+  QwtScaleDraw can be used to draw linear or logarithmic scales.
+  A scale has a position, an alignment and a length, which can be specified .
+  The labels can be rotated and aligned
+  to the ticks using setLabelRotation() and setLabelAlignment().
+
+  After a scale division has been specified as a QwtScaleDiv object
+  using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s),
+  the scale can be drawn with the QwtAbstractScaleDraw::draw() member.
+*/
+
+class QWT_EXPORT QwtScaleDraw: public QwtAbstractScaleDraw
+{
+public:
+    /*! 
+        Alignment of the scale draw
+        \sa setAlignment(), alignment()
+     */
+    enum Alignment { BottomScale, TopScale, LeftScale, RightScale };
+
+    QwtScaleDraw();
+    QwtScaleDraw(const QwtScaleDraw &);
+
+    virtual ~QwtScaleDraw();
+
+    QwtScaleDraw& operator=(const QwtScaleDraw &other);
+
+    void getBorderDistHint(const QFont &, int &start, int &end) const;
+    int minLabelDist(const QFont &) const;
+
+    int minLength(const QPen &, const QFont &) const;
+    virtual int extent(const QPen &, const QFont &) const;
+
+    void move(int x, int y);
+    void move(const QPoint &);
+    void setLength(int length);
+
+    Alignment alignment() const;
+    void setAlignment(Alignment);
+
+    Qt::Orientation orientation() const;
+
+    QPoint pos() const;
+    int length() const;
+
+#if QT_VERSION < 0x040000
+    void setLabelAlignment(int);
+    int labelAlignment() const;
+#else
+    void setLabelAlignment(Qt::Alignment);
+    Qt::Alignment labelAlignment() const;
+#endif
+
+    void setLabelRotation(double rotation);
+    double labelRotation() const;
+
+    int maxLabelHeight(const QFont &) const;
+    int maxLabelWidth(const QFont &) const;
+
+    QPoint labelPosition(double val) const;
+
+    QRect labelRect(const QFont &, double val) const;
+    QSize labelSize(const QFont &, double val) const;
+
+protected:
+
+#if QT_VERSION < 0x040000
+    QWMatrix labelMatrix(const QPoint &, const QSize &) const;
+#else   
+    QMatrix labelMatrix(const QPoint &, const QSize &) const;
+#endif  
+
+    virtual void drawTick(QPainter *p, double val, int len) const;
+    virtual void drawBackbone(QPainter *p) const;
+    virtual void drawLabel(QPainter *p, double val) const;
+
+private:
+    void updateMap();
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+inline void QwtScaleDraw::move(int x, int y)
+{
+    move(QPoint(x, y));
+}
+
+#endif
diff --git a/src/qwt/include/qwt_scale_engine.h b/src/qwt/include/qwt_scale_engine.h
new file mode 100644
index 0000000..4b4bce6
--- /dev/null
+++ b/src/qwt/include/qwt_scale_engine.h
@@ -0,0 +1,180 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_SCALE_ENGINE_H
+#define QWT_SCALE_ENGINE_H
+
+#include "qwt_global.h"
+#include "qwt_scale_div.h"
+#include "qwt_double_interval.h"
+
+class QwtScaleTransformation;
+
+/*!
+  Arithmetic including a tolerance
+*/
+class QWT_EXPORT QwtScaleArithmetic
+{
+public:
+    static int compareEps(
+        double value1, double value2, double intervalSize);
+
+    static double ceilEps(double value, double intervalSize);
+    static double floorEps(double value, double intervalSize);
+
+    static double divideEps(double interval, double steps);
+
+    static double ceil125(double x);
+    static double floor125(double x);
+};
+
+/*!
+  \brief Base class for scale engines.
+
+  A scale engine trys to find "reasonable" ranges and step sizes
+  for scales. 
+
+  The layout of the scale can be varied with setOptions().
+
+  Qwt offers implementations for logarithmic (log10) 
+  and linear scales. Contributions for other types of scale engines 
+  (date/time, log2 ... ) are welcome.
+*/
+
+class QWT_EXPORT QwtScaleEngine
+{
+public:
+    //! see QwtScaleEngine::setOption, testOption
+    enum Attribute
+    {
+        NoAttribute = 0,
+        IncludeReference = 1, 
+        Symmetric = 2, 
+        Floating = 4,
+        Inverted = 8 
+    };
+
+    explicit QwtScaleEngine();
+    virtual ~QwtScaleEngine();
+
+    void setAttribute(Attribute, bool on = true);
+    bool testAttribute(Attribute) const;
+
+    void setAttributes(int);
+    int attributes() const;
+
+    void setReference(double reference);
+    double reference() const;
+
+    void setMargins(double m1, double m2);
+    double loMargin() const;
+    double hiMargin() const;
+
+    virtual void autoScale(int maxSteps, 
+        double &x1, double &x2, double &stepSize) const = 0;
+
+    virtual QwtScaleDiv divideScale(double x1, double x2,
+        int numMajorSteps, int numMinorSteps, 
+        double stepSize = 0.0) const = 0;
+
+    virtual QwtScaleTransformation transformation() const = 0;
+
+protected:
+    bool contains(const QwtDoubleInterval &, double val) const;
+    QwtTickList strip(const QwtTickList&, const QwtDoubleInterval &) const;
+    double divideInterval(double interval, int numSteps) const;
+
+    QwtDoubleInterval buildInterval(double v) const;
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+/*!
+  \brief A scale engine for linear scales
+
+  The step size will fit into the pattern 
+  \f$\left\{ 1,2,5\right\} \cdot 10^{n}\f$, where n is an integer.
+*/
+
+class QWT_EXPORT QwtLinearScaleEngine: public QwtScaleEngine
+{
+public:
+    virtual void autoScale(int maxSteps, 
+        double &x1, double &x2, double &stepSize) const;
+
+    virtual QwtScaleDiv divideScale(double x1, double x2,
+        int numMajorSteps, int numMinorSteps,
+        double stepSize = 0.0) const;
+
+    virtual QwtScaleTransformation transformation() const;
+
+protected:
+    QwtDoubleInterval align(const QwtDoubleInterval&,
+        double stepSize) const;
+
+private:
+    void buildTicks(
+        const QwtDoubleInterval &, double stepSize, int maxMinSteps,
+        QwtTickList ticks[QwtScaleDiv::NTickTypes]) const;
+
+    void buildMinorTicks(
+        const QwtTickList& majorTicks,
+        int maxMinMark, double step,
+        QwtTickList &, QwtTickList &) const;
+
+    QwtTickList buildMajorTicks(
+        const QwtDoubleInterval &interval, double stepSize) const;
+};
+
+/*!
+  \brief A scale engine for logarithmic (base 10) scales
+
+  The step size is measured in *decades*
+  and the major step size will be adjusted to fit the pattern
+  \f$\left\{ 1,2,3,5\right\} \cdot 10^{n}\f$, where n is a natural number
+  including zero.
+
+  \warning the step size as well as the margins are measured in *decades*.
+*/
+
+class QWT_EXPORT QwtLog10ScaleEngine: public QwtScaleEngine
+{
+public:
+    virtual void autoScale(int maxSteps, 
+        double &x1, double &x2, double &stepSize) const;
+
+    virtual QwtScaleDiv divideScale(double x1, double x2,
+        int numMajorSteps, int numMinorSteps,
+        double stepSize = 0.0) const;
+
+    virtual QwtScaleTransformation transformation() const;
+
+protected:
+    QwtDoubleInterval log10(const QwtDoubleInterval&) const;
+    QwtDoubleInterval pow10(const QwtDoubleInterval&) const;
+
+private:
+    QwtDoubleInterval align(const QwtDoubleInterval&,
+        double stepSize) const;
+
+    void buildTicks(
+        const QwtDoubleInterval &, double stepSize, int maxMinSteps,
+        QwtTickList ticks[QwtScaleDiv::NTickTypes]) const;
+
+    QwtTickList buildMinorTicks(
+        const QwtTickList& majorTicks,
+        int maxMinMark, double step) const;
+
+    QwtTickList buildMajorTicks(
+        const QwtDoubleInterval &interval, double stepSize) const;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_scale_map.h b/src/qwt/include/qwt_scale_map.h
new file mode 100644
index 0000000..910dcd9
--- /dev/null
+++ b/src/qwt/include/qwt_scale_map.h
@@ -0,0 +1,167 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_SCALE_MAP_H
+#define QWT_SCALE_MAP_H
+
+#include "qwt_global.h"
+#include "qwt_math.h"
+
+/*!
+   Operations for linear or logarithmic (base 10) transformations
+*/
+class QWT_EXPORT QwtScaleTransformation
+{
+public:
+    QwtScaleTransformation();
+    QwtScaleTransformation(
+        double (*xForm)(double x, double s1, double s2, 
+            double p1, double p2, void *),
+        double (*invXForm)(double x, double p1, double p2, 
+            double s1, double s2, void *)
+    );
+
+    static double linearXForm(double x, double s1, double s2,
+        double p1, double p2, void *);
+
+    static double log10XForm(double x, double s1, double s2,
+        double p1, double p2, void *);
+    static double log10InvXForm(double x, double p1, double p2,
+        double s1, double s2, void *);
+
+    double (*xForm)(double x, double s1, double s2, 
+        double p1, double p2, void *);
+    double (*invXForm)(double y, double p1, double p2, 
+        double s1, double s2, void *);
+};
+
+/*!
+   \brief A scale map
+
+   QwtScaleMap offers transformations from a scale 
+   into a paint interval and vice versa.
+*/
+class QWT_EXPORT QwtScaleMap
+{
+public:
+    QwtScaleMap();
+    QwtScaleMap(int i1, int i2, double d1, double d2);
+    ~QwtScaleMap();
+
+    void setTransformation(bool logarithmic);
+    void setTransformation(const QwtScaleTransformation& );
+    const QwtScaleTransformation &transformation() const;
+
+    void setPaintInterval(int p1, int p2);
+    void setPaintXInterval(double p1, double p2);
+    void setScaleInterval(double s1, double s2);
+
+    void setTransformationData(void *);
+    void *transformationData() const;
+
+    int transform(double x) const;
+    double invTransform(double i) const;
+
+    double xTransform(double x) const;
+
+    inline double p1() const;
+    inline double p2() const;
+
+    inline double s1() const;
+    inline double s2() const;
+
+    QT_STATIC_CONST double LogMin;
+    QT_STATIC_CONST double LogMax;
+
+private:
+    void newFactor();   
+
+    double d_s1, d_s2;     // scale interval boundaries
+    double d_p1, d_p2;     // paint device interval boundaries
+
+    double d_cnv;       // conversion factor
+    void *d_transformationData;  // data, passed to the transformations
+
+    QwtScaleTransformation d_transformation;
+};
+
+/*!
+    \return First border of the scale interval
+*/
+inline double QwtScaleMap::s1() const 
+{
+    return d_s1;
+}
+
+/*!
+    \return Second border of the scale interval
+*/
+inline double QwtScaleMap::s2() const 
+{
+    return d_s2;
+}
+
+/*!
+    \return First border of the paint interval
+*/
+inline double QwtScaleMap::p1() const 
+{
+    return d_p1;
+}
+
+/*!
+    \return Second border of the paint interval
+*/
+inline double QwtScaleMap::p2() const 
+{
+    return d_p2;
+}
+
+/*!
+  Transform a point related to the scale interval into an point 
+  related to the interval of the paint device
+*/
+inline double QwtScaleMap::xTransform(double x) const
+{
+    // try to inline code from QwtScaleTransformation::linearXForm,
+    // QwtScaleTransformation::logXForm. 
+
+    if ( d_transformation.xForm == QwtScaleTransformation::linearXForm )
+        return d_p1 + (x - d_s1) * d_cnv;
+
+    if ( d_transformation.xForm == QwtScaleTransformation::log10XForm )
+        return d_p1 + log(x / d_s1) * d_cnv;
+
+    return (*d_transformation.xForm)(x, d_s1, d_s2, 
+        d_p1, d_p2, d_transformationData );
+}
+
+/*!
+  \brief Transform an paint device value into a value in the
+         interval of the scale.
+*/
+inline double QwtScaleMap::invTransform(double y) const
+{
+    return (*d_transformation.invXForm)(y, d_p1, d_p2, 
+        d_s1, d_s2, d_transformationData);
+}
+
+/*!
+  Transform a point related to the scale interval into an point 
+  related to the interval of the paint device and round it to
+  an integer. (In Qt <= 3.x paint devices are integer based. )
+
+  \sa QwtScaleMap::xTransform
+*/
+inline int QwtScaleMap::transform(double x) const
+{
+    return qRound(xTransform(x));
+}
+
+#endif
diff --git a/src/qwt/include/qwt_scale_widget.h b/src/qwt/include/qwt_scale_widget.h
new file mode 100644
index 0000000..cddefe5
--- /dev/null
+++ b/src/qwt/include/qwt_scale_widget.h
@@ -0,0 +1,105 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_SCALE_WIDGET_H
+#define QWT_SCALE_WIDGET_H
+
+#include <qwidget.h>
+#include <qfont.h>
+#include <qcolor.h>
+#include <qstring.h>
+
+#include "qwt_global.h"
+#include "qwt_text.h"
+#include "qwt_scale_draw.h"
+
+class QPainter;
+class QwtScaleTransformation;
+class QwtScaleDiv;
+
+/*!
+  \brief A Widget which contains a scale
+
+  This Widget can be used to decorate composite widgets with
+  a scale.
+*/
+
+class QWT_EXPORT QwtScaleWidget : public QWidget
+{
+    Q_OBJECT 
+
+public:
+    explicit QwtScaleWidget(QWidget *parent = NULL);
+    explicit QwtScaleWidget(QwtScaleDraw::Alignment, QWidget *parent = NULL);
+    virtual ~QwtScaleWidget();
+
+    void setTitle(const QString &title);
+    void setTitle(const QwtText &title);
+    QwtText title() const;
+
+    void setBorderDist(int start, int end);
+    int startBorderDist() const;
+    int endBorderDist() const;
+
+    void getBorderDistHint(int &start, int &end) const;
+
+    void getMinBorderDist(int &start, int &end) const;
+    void setMinBorderDist(int start, int end);
+
+    void setBaselineDist(int bd);
+    int baseLineDist() const;
+
+    void setTitleDist(int td);
+    int titleDist() const;
+
+    void setScaleDiv(const QwtScaleTransformation&, const QwtScaleDiv &sd);
+    void setScaleDraw(QwtScaleDraw *);
+    const QwtScaleDraw *scaleDraw() const;
+    QwtScaleDraw *scaleDraw();
+
+#if QT_VERSION < 0x040000
+    void setLabelAlignment(int);
+#else
+    void setLabelAlignment(Qt::Alignment);
+#endif
+    void setLabelRotation(double rotation);
+
+    virtual QSize sizeHint() const;
+    virtual QSize minimumSizeHint() const;
+
+    int titleHeightForWidth(int width) const;
+    int dimForLength(int length, const QFont &scaleFont) const;
+
+    void drawTitle(QPainter *painter, QwtScaleDraw::Alignment,
+        const QRect &rect) const;
+        
+    void setAlignment(QwtScaleDraw::Alignment);
+    QwtScaleDraw::Alignment alignment() const;
+
+protected:
+    virtual void paintEvent(QPaintEvent *e);
+    virtual void resizeEvent(QResizeEvent *e);
+
+#if QT_VERSION < 0x040000
+    virtual void fontChange(const QFont &oldfont);
+#endif
+
+    void draw(QPainter *p) const;
+
+    void scaleChange();
+    void layoutScale( bool update = true );
+
+private:
+    void initScale(QwtScaleDraw::Alignment);
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_slider.h b/src/qwt/include/qwt_slider.h
new file mode 100644
index 0000000..ced263d
--- /dev/null
+++ b/src/qwt/include/qwt_slider.h
@@ -0,0 +1,117 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_SLIDER_H
+#define QWT_SLIDER_H
+
+#include "qwt_global.h"
+#include "qwt_abstract_scale.h"
+#include "qwt_abstract_slider.h"
+
+class QwtScaleDraw;
+
+/*!
+  \brief The Slider Widget
+
+  QwtSlider is a slider widget which operates on an interval
+  of type double. QwtSlider supports different layouts as
+  well as a scale.
+  \sa QwtAbstractSlider and QwtAbstractScale for the descriptions
+      of the inherited members.
+*/
+
+class QWT_EXPORT QwtSlider : public QwtAbstractSlider, public QwtAbstractScale
+{
+    Q_OBJECT
+    Q_ENUMS( ScalePos )
+    Q_ENUMS( BGSTYLE )
+    Q_PROPERTY( ScalePos scalePosition READ scalePosition
+        WRITE setScalePosition )
+    Q_PROPERTY( BGSTYLE bgStyle READ bgStyle WRITE setBgStyle )
+    Q_PROPERTY( int thumbLength READ thumbLength WRITE setThumbLength )
+    Q_PROPERTY( int thumbWidth READ thumbWidth WRITE setThumbWidth )
+    Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
+ 
+public:
+
+    /*! 
+      Scale position. QwtSlider tries to enforce valid combinations of its
+      orientation and scale position:
+      - Qt::Horizonal combines with None, Top and Bottom
+      - Qt::Vertical combines with None, Left and Right
+
+      \sa QwtSlider::QwtSlider
+     */
+    enum ScalePos { None, Left, Right, Top, Bottom };
+
+    /*! 
+      Background style.
+      \sa QwtSlider::QwtSlider
+     */
+    enum BGSTYLE { BgTrough = 0x1, BgSlot = 0x2, BgBoth = BgTrough | BgSlot};
+
+    explicit QwtSlider(QWidget *parent,
+          Qt::Orientation = Qt::Horizontal,
+          ScalePos = None, BGSTYLE bgStyle = BgTrough);
+    
+    virtual ~QwtSlider();
+
+    virtual void setOrientation(Qt::Orientation); 
+
+    void setBgStyle(BGSTYLE);
+    BGSTYLE bgStyle() const;
+    
+    void setScalePosition(ScalePos s);
+    ScalePos scalePosition() const;
+
+    int thumbLength() const;
+    int thumbWidth() const;
+    int borderWidth() const;
+
+    void setThumbLength(int l);
+    void setThumbWidth(int w);
+    void setBorderWidth(int bw);
+    void setMargins(int x, int y);
+
+    virtual QSize sizeHint() const;
+    virtual QSize minimumSizeHint() const;
+    
+    void setScaleDraw(QwtScaleDraw *);
+    const QwtScaleDraw *scaleDraw() const;
+
+protected:
+    virtual double getValue(const QPoint &p);
+    virtual void getScrollMode(const QPoint &p, 
+        int &scrollMode, int &direction);
+
+    void draw(QPainter *p, const QRect& update_rect);
+    virtual void drawSlider (QPainter *p, const QRect &r);
+    virtual void drawThumb(QPainter *p, const QRect &, int pos);
+
+    virtual void resizeEvent(QResizeEvent *e);
+    virtual void paintEvent (QPaintEvent *e);
+
+    virtual void valueChange();
+    virtual void rangeChange();
+    virtual void scaleChange();
+    virtual void fontChange(const QFont &oldFont);
+
+    void layoutSlider( bool update = true );
+    int xyPosition(double v) const;
+
+    QwtScaleDraw *scaleDraw();
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_spline.h b/src/qwt/include/qwt_spline.h
new file mode 100644
index 0000000..f04adff
--- /dev/null
+++ b/src/qwt/include/qwt_spline.h
@@ -0,0 +1,82 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_SPLINE_H
+#define QWT_SPLINE_H
+
+#include "qwt_global.h"
+
+/*!
+  \brief A class for spline interpolation
+
+  The QwtSpline class is used for cubical spline interpolation.
+  Two types of splines, natural and periodic, are supported.
+  
+  \par Usage:
+  <ol>
+  <li>First call QwtSpline::recalc() to determine the spline coefficients 
+      for a tabulated function y(x).
+  <li>After the coefficients have been set up, the interpolated
+      function value for an argument x can be determined by calling 
+      QwtSpline::value().
+  </ol>
+  In order to save storage space, QwtSpline can be advised
+  not to buffer the contents of x and y.
+  This means that the arrays have to remain valid and unchanged
+  for the interpolation to work properly. This can be achieved
+  by calling QwtSpline::copyValues().
+
+  \par Example:
+  \code
+#include<qwt_spline.h>
+#include<iostream.h>
+
+QwtSpline s;
+double x[30], y[30], xInter[300], yInter[300];
+int i;
+
+for(i=0;i<30;i++)               // fill up x[] and y[]
+cin >> x[i] >> y[i];
+
+if (s.recalc(x,y,30,0) == 0)    // build natural spline
+{
+   for(i=0;i<300;i++)          // interpolate
+   {
+     xInter[i] = x[0] + double(i) * (x[29] - x[0]) / 299.0;
+     yInter[i] = s.value( xInter[i] );
+   }
+
+   do_something(xInter, yInter, 300);
+}
+else
+  cerr << "Uhhh...\n";
+  \endcode
+*/
+
+class QWT_EXPORT QwtSpline
+{
+public:
+    QwtSpline();
+    ~QwtSpline();
+
+    double value(double x) const;
+    bool recalc(double *x, double *y, int n, bool periodic = false);
+    void copyValues(bool tf = true);
+
+private:
+    bool buildPerSpline();
+    bool buildNatSpline();
+    int lookup(double x) const;
+    void cleanup();
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_symbol.h b/src/qwt/include/qwt_symbol.h
new file mode 100644
index 0000000..60996f4
--- /dev/null
+++ b/src/qwt/include/qwt_symbol.h
@@ -0,0 +1,66 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_SYMBOL_H
+#define QWT_SYMBOL_H
+
+#include <qbrush.h>
+#include <qpen.h>
+#include <qsize.h>
+#include "qwt_global.h"
+
+class QPainter;
+class QRect;
+
+//! A class for drawing symbols
+class QWT_EXPORT QwtSymbol
+{
+public:
+    /*!
+        Style
+        \sa QwtSymbol::setStyle, QwtSymbol::style
+     */
+    enum Style { None, Ellipse, Rect, Diamond, Triangle, DTriangle,
+        UTriangle, LTriangle, RTriangle, Cross, XCross, StyleCnt }; 
+   
+public:
+    QwtSymbol();
+    QwtSymbol(Style st, const QBrush &bd, const QPen &pn, const QSize &s);
+    virtual ~QwtSymbol();
+    
+    bool operator!=(const QwtSymbol &) const;
+    bool operator==(const QwtSymbol &) const;
+
+    void setSize(const QSize &s);
+    void setSize(int a, int b = -1);
+    void setBrush(const QBrush& b);
+    void setPen(const QPen &p);
+    void setStyle (Style s);
+
+    //! Return Brush
+    const QBrush& brush() const { return d_brush; }
+    //! Return Pen
+    const QPen& pen() const { return d_pen; }
+    //! Return Size
+    const QSize& size() const { return d_size; }
+    //! Return Style
+    Style style() const { return d_style; } 
+    
+    void draw(QPainter *p, const QPoint &pt) const; 
+    void draw(QPainter *p, int x, int y) const;
+    virtual void draw(QPainter *p, const QRect &r) const;
+
+private:
+    QBrush d_brush;
+    QPen d_pen;
+    QSize d_size;
+    Style d_style;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_text.h b/src/qwt/include/qwt_text.h
new file mode 100644
index 0000000..6ff4ef1
--- /dev/null
+++ b/src/qwt/include/qwt_text.h
@@ -0,0 +1,112 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2003   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_TEXT_H
+#define QWT_TEXT_H
+
+#include <qstring.h>
+#include <qsize.h>
+#include <qfont.h>
+#include "qwt_global.h"
+
+class QColor;
+class QPen;
+class QBrush;
+class QRect;
+class QPainter;
+class QwtTextEngine;
+
+class QWT_EXPORT QwtText
+{
+public:
+    enum TextFormat
+    {
+        AutoText = 0,
+        
+        PlainText,
+        RichText
+    };
+
+    enum PaintAttributes
+    {
+        PaintUsingPainter = 0,
+
+        PaintUsingTextFont = 1,
+        PaintUsingTextColor = 2,
+
+        PaintBackground = 4
+    };
+
+    enum LayoutAttributes
+    {
+        DefaultLayout = 0,
+        MinimumLayout = 1
+    };
+
+    QwtText(const QString & = QString::null, 
+        TextFormat textFormat = AutoText);
+    QwtText(const QwtText &);
+    ~QwtText();
+
+    QwtText &operator=(const QwtText &);
+
+    int operator==(const QwtText &) const;
+    int operator!=(const QwtText &) const;
+
+    void setText(const QString &, 
+        QwtText::TextFormat textFormat = AutoText);
+    QString text() const;
+
+    inline bool isNull() const { return text().isNull(); }
+    inline bool isEmpty() const { return text().isEmpty(); }
+
+    void setFont(const QFont &);
+    QFont font() const;
+
+    QFont usedFont(const QFont &) const;
+
+    void setFlags(int flags);
+    int flags() const;
+
+    void setColor(const QColor &);
+    QColor color() const;
+
+    QColor usedColor(const QColor &) const;
+
+    void setBackgroundPen(const QPen &);
+    QPen backgroundPen() const;
+
+    void setBackgroundBrush(const QBrush &);
+    QBrush backgroundBrush() const;
+
+    void setPaintAttributes(int);
+    int paintAttributes() const;
+
+    void setLayoutAttributes(int);
+    int layoutAttributes() const;
+
+    int heightForWidth(int width, const QFont & = QFont()) const;
+    QSize textSize(const QFont & = QFont()) const;
+
+    void draw(QPainter *painter, const QRect &rect) const;
+
+private:
+    QwtTextEngine *textEngine(const QString &text,
+        QwtText::TextFormat textFormat = AutoText) const;
+
+    class PrivateData;
+    PrivateData *d_data;
+
+    class LayoutCache;
+    LayoutCache *d_layoutCache;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_text_engine.h b/src/qwt/include/qwt_text_engine.h
new file mode 100644
index 0000000..5f21592
--- /dev/null
+++ b/src/qwt/include/qwt_text_engine.h
@@ -0,0 +1,121 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2003   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#ifndef QWT_TEXT_ENGINE_H
+#define QWT_TEXT_ENGINE_H 1
+
+#include <qsize.h>
+#include "qwt_global.h"
+
+class QFont;
+class QRect;
+class QString;
+class QPainter;
+
+class QWT_EXPORT QwtTextEngine
+{
+public:
+    virtual ~QwtTextEngine();
+
+    /*!
+      Find the height for a given width
+     */
+    virtual int heightForWidth(const QFont &font, int flags, 
+        const QString &text, int width) const = 0;
+
+    /*!
+      Returns the size, that is needed to render text
+     */
+    virtual QSize textSize(const QFont &font, int flags,
+        const QString &text) const = 0;
+
+    /*!
+      \brief Draw the text in a clipping rectangle
+      \param painter Painter
+      \param rect Clipping rectangle
+     */ 
+    virtual void draw(QPainter *painter, const QRect &rect,
+        int flags, const QString &text) const = 0;
+
+    virtual bool mightRender(const QString &) const = 0;
+
+    /*!
+      Return margins around the texts
+
+      The textSize might include margins around the 
+      text, like QFontMetrics::descent. In situations
+      where texts need to be aligend in detail, knowing
+      these margins might improve the layout calculations.
+     */
+    virtual void textMargins(const QFont &, const QString &,
+        int &left, int &right, int &top, int &bottom);
+
+protected:
+    QwtTextEngine();
+};
+
+
+/*!
+  \brief Plain text drawing support
+ */
+class QWT_EXPORT QwtPlainTextEngine: public QwtTextEngine
+{
+public:
+    QwtPlainTextEngine();
+    virtual ~QwtPlainTextEngine();
+
+    virtual int heightForWidth(const QFont &font, int flags, 
+        const QString &text, int width) const;
+
+    virtual QSize textSize(const QFont &font, int flags,
+        const QString &text) const;
+
+    virtual void draw(QPainter *painter, const QRect &rect,
+        int flags, const QString &text) const;
+
+    virtual bool mightRender(const QString &) const;
+
+    virtual void textMargins(const QFont &, const QString &,
+        int &left, int &right, int &top, int &bottom);
+
+private:
+    class PrivateData; 
+    PrivateData *d_data;
+};
+
+
+#ifndef QT_NO_RICHTEXT
+
+/*!
+  \brief Rich text drawing support
+ */
+class QWT_EXPORT QwtRichTextEngine: public QwtTextEngine
+{
+public:
+    QwtRichTextEngine();
+
+    virtual int heightForWidth(const QFont &font, int flags, 
+        const QString &text, int width) const;
+
+    virtual QSize textSize(const QFont &font, int flags,
+        const QString &text) const;
+
+    virtual void draw(QPainter *painter, const QRect &rect,
+        int flags, const QString &text) const;
+
+    virtual bool mightRender(const QString &) const;
+private:
+    QString taggedText(const QString &, int flags) const;
+};
+
+#endif // !QT_NO_RICHTEXT
+
+#endif
diff --git a/src/qwt/include/qwt_text_label.h b/src/qwt/include/qwt_text_label.h
new file mode 100644
index 0000000..bc6141c
--- /dev/null
+++ b/src/qwt/include/qwt_text_label.h
@@ -0,0 +1,72 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_TEXT_LABEL_H
+#define QWT_TEXT_LABEL_H
+
+#include <qframe.h>
+#include "qwt_global.h"
+#include "qwt_text.h"
+
+class QString;
+class QPaintEvent;
+class QPainter;
+
+/*!
+  A Widget which displays a QwtText
+*/
+
+class QWT_EXPORT QwtTextLabel : public QFrame
+{
+    Q_OBJECT 
+
+    Q_PROPERTY( int indent READ indent WRITE setIndent )
+    Q_PROPERTY( int margin READ margin WRITE setMargin )
+
+public:
+    explicit QwtTextLabel(QWidget *parent = NULL);
+    explicit QwtTextLabel(const QwtText &, QWidget *parent = NULL);
+    virtual ~QwtTextLabel();
+
+public slots:
+    void setText(const QString &, 
+        QwtText::TextFormat textFormat = QwtText::AutoText);
+    virtual void setText(const QwtText &);
+
+    void clear();
+
+public:
+    const QwtText &text() const;
+
+    int indent() const;
+    void setIndent(int);
+
+    int margin() const;
+    void setMargin(int);
+
+    virtual QSize sizeHint() const;
+    virtual QSize minimumSizeHint() const;
+    virtual int heightForWidth(int) const;
+
+    QRect textRect() const;
+
+protected:
+    virtual void paintEvent(QPaintEvent *e);
+    virtual void drawContents(QPainter *);
+    virtual void drawText(QPainter *, const QRect &);
+
+private:
+    void init();
+    int defaultIndent() const;
+
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_thermo.h b/src/qwt/include/qwt_thermo.h
new file mode 100644
index 0000000..8e36296
--- /dev/null
+++ b/src/qwt/include/qwt_thermo.h
@@ -0,0 +1,168 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_THERMO_H
+#define QWT_THERMO_H
+
+#include <qwidget.h>
+#include <qcolor.h>
+#include <qfont.h>
+#include <qrect.h>
+#include "qwt_global.h"
+#include "qwt_abstract_scale.h"
+
+class QwtScaleDraw;
+
+/*!
+  \brief The Thermometer Widget
+
+  QwtThermo is a widget which displays a value in an interval. It supports:
+  - a horizontal or vertical layout;
+  - a range;
+  - a scale;
+  - an alarm level.
+
+  By default, the scale and range run over the same interval of values.
+  QwtAbstractScale::setScale() changes the interval of the scale and allows
+  easy conversion between physical units.
+  The example shows how to make the scale indicate in degrees Fahrenheit and
+  to set the value in degrees Kelvin:
+\code
+#include <qapplication.h>
+#include <qwt_thermo.h>
+
+double Kelvin2Fahrenheit(double kelvin)
+{
+    // see http://en.wikipedia.org/wiki/Kelvin
+    return 1.8*kelvin - 459.67;
+}
+
+int main(int argc, char **argv)
+{
+    const double minKelvin = 0.0;
+    const double maxKelvin = 500.0;
+
+    QApplication a(argc, argv);
+    QwtThermo t;
+    t.setRange(minKelvin, maxKelvin);
+    t.setScale(Kelvin2Fahrenheit(minKelvin), Kelvin2Fahrenheit(maxKelvin));
+    // set the value in Kelvin but the scale displays in Fahrenheit
+    // 273.15 Kelvin = 0 Celsius = 32 Fahrenheit
+    t.setValue(273.15);
+    a.setMainWidget(&t);
+    t.show();
+    return a.exec();
+}
+\endcode
+
+  \todo Improve the support for a logarithmic range and/or scale. 
+*/
+class QWT_EXPORT QwtThermo: public QWidget, public QwtAbstractScale
+{
+    Q_OBJECT
+
+    Q_ENUMS( ScalePos )
+
+    Q_PROPERTY( QBrush alarmBrush READ alarmBrush WRITE setAlarmBrush )
+    Q_PROPERTY( QColor alarmColor READ alarmColor WRITE setAlarmColor )
+    Q_PROPERTY( bool alarmEnabled READ alarmEnabled WRITE setAlarmEnabled )
+    Q_PROPERTY( double alarmLevel READ alarmLevel WRITE setAlarmLevel )
+    Q_PROPERTY( ScalePos scalePosition READ scalePosition
+        WRITE setScalePosition )
+    Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
+    Q_PROPERTY( QBrush fillBrush READ fillBrush WRITE setFillBrush )
+    Q_PROPERTY( QColor fillColor READ fillColor WRITE setFillColor )
+    Q_PROPERTY( double maxValue READ maxValue WRITE setMaxValue )
+    Q_PROPERTY( double minValue READ minValue WRITE setMinValue )
+    Q_PROPERTY( int pipeWidth READ pipeWidth WRITE setPipeWidth )
+    Q_PROPERTY( double value READ value WRITE setValue )
+
+public:
+    /*
+      Scale position. QwtThermo tries to enforce valid combinations of its
+      orientation and scale position:
+      - Qt::Horizonal combines with None, Top and Bottom
+      - Qt::Vertical combines with None, Left and Right
+      
+      \sa QwtThermo::setOrientation, QwtThermo::setScalePosition
+    */
+    enum ScalePos {None, Left, Right, Top, Bottom};
+
+    explicit QwtThermo(QWidget *parent = NULL);
+    virtual ~QwtThermo();
+
+    void setOrientation(Qt::Orientation o, ScalePos s);
+
+    void setScalePosition(ScalePos s);
+    ScalePos scalePosition() const;
+
+    void setBorderWidth(int w);
+    int borderWidth() const;
+
+    void setFillBrush(const QBrush &b);
+    const QBrush &fillBrush() const;
+
+    void setFillColor(const QColor &c);
+    const QColor &fillColor() const;
+ 
+    void setAlarmBrush(const QBrush &b);
+    const QBrush &alarmBrush() const;
+
+    void setAlarmColor(const QColor &c);
+    const QColor &alarmColor() const;
+
+    void setAlarmLevel(double v);
+    double alarmLevel() const;
+
+    void setAlarmEnabled(bool tf);
+    bool alarmEnabled() const;
+
+    void setPipeWidth(int w);
+    int pipeWidth() const;
+
+    void setMaxValue(double v);
+    double maxValue() const;
+
+    void setMinValue(double v);
+    double minValue() const;
+
+    double value() const;
+
+    void setRange(double vmin, double vmax, bool lg = false);
+    void setMargin(int m);
+
+    virtual QSize sizeHint() const;
+    virtual QSize minimumSizeHint() const;
+
+    void setScaleDraw(QwtScaleDraw *);
+    const QwtScaleDraw *scaleDraw() const;
+
+public slots:
+    void setValue(double val);
+    
+protected:
+    void draw(QPainter *p, const QRect& update_rect);
+    void drawThermo(QPainter *p);
+    void layoutThermo( bool update = true );
+    virtual void scaleChange();
+    virtual void fontChange(const QFont &oldFont);
+
+    virtual void paintEvent(QPaintEvent *e);
+    virtual void resizeEvent(QResizeEvent *e);
+
+    QwtScaleDraw *scaleDraw();
+
+private:
+    int transform(double v) const;
+    
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/include/qwt_wheel.h b/src/qwt/include/qwt_wheel.h
new file mode 100644
index 0000000..b41dcd6
--- /dev/null
+++ b/src/qwt/include/qwt_wheel.h
@@ -0,0 +1,79 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#ifndef QWT_WHEEL_H
+#define QWT_WHEEL_H
+
+#include "qwt_global.h"
+#include "qwt_abstract_slider.h"
+
+/*!
+  \brief The Wheel Widget
+
+  The wheel widget can be used to change values over a very large range
+  in very small steps. Using the setMass member, it can be configured
+  as a flywheel.
+
+  \sa The radio example.
+*/
+class QWT_EXPORT QwtWheel : public QwtAbstractSlider
+{
+    Q_OBJECT 
+    Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
+    Q_PROPERTY( double viewAngle READ viewAngle WRITE setViewAngle )
+    Q_PROPERTY( int    tickCnt READ tickCnt WRITE setTickCnt )
+    Q_PROPERTY( int    internalBorder READ internalBorder WRITE setInternalBorder )
+    Q_PROPERTY( double mass READ mass WRITE setMass )
+            
+public:
+    explicit QwtWheel(QWidget *parent = NULL);
+    virtual ~QwtWheel();
+
+    virtual void setOrientation(Qt::Orientation);
+
+    double totalAngle() const;
+    double viewAngle() const;
+    int tickCnt() const;
+    int internalBorder() const;
+
+    double mass() const;
+
+    void setTotalAngle (double angle);
+    void setTickCnt(int cnt);
+    void setViewAngle(double angle);
+    void setInternalBorder(int width);
+    void setMass(double val);
+    void setWheelWidth( int w );
+
+    virtual QSize sizeHint() const;
+    virtual QSize minimumSizeHint() const;
+
+protected:
+    virtual void resizeEvent(QResizeEvent *e);
+    virtual void paintEvent(QPaintEvent *e);
+
+    void layoutWheel( bool update = true );
+    void draw(QPainter *p, const QRect& update_rect);
+    void drawWheel(QPainter *p, const QRect &r);
+    void drawWheelBackground(QPainter *p, const QRect &r);
+    void setColorArray();
+
+    virtual void valueChange();
+    virtual void paletteChange( const QPalette &);
+
+    virtual double getValue(const QPoint &p);
+    virtual void getScrollMode(const QPoint &p, 
+        int &scrollMode, int &direction);
+
+private:
+    class PrivateData;
+    PrivateData *d_data;
+};
+
+#endif
diff --git a/src/qwt/qwt_abstract_scale.cpp b/src/qwt/qwt_abstract_scale.cpp
new file mode 100644
index 0000000..d65ac51
--- /dev/null
+++ b/src/qwt/qwt_abstract_scale.cpp
@@ -0,0 +1,300 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_scale_engine.h"
+#include "qwt_scale_draw.h"
+#include "qwt_scale_div.h"
+#include "qwt_scale_map.h"
+#include "qwt_double_interval.h"
+#include "qwt_abstract_scale.h"
+
+class QwtAbstractScale::PrivateData
+{
+public:
+    PrivateData():
+        maxMajor(5),
+        maxMinor(3),
+        stepSize(0.0),
+        autoScale(true)
+    {
+        scaleEngine = new QwtLinearScaleEngine;
+        scaleDraw = new QwtScaleDraw();
+    }
+
+    ~PrivateData()
+    {
+        delete scaleEngine;
+        delete scaleDraw;
+    }
+
+    QwtScaleEngine *scaleEngine;
+    QwtAbstractScaleDraw *scaleDraw;
+
+    int maxMajor;
+    int maxMinor;
+    double stepSize;
+
+    bool autoScale;
+};
+
+/*!
+  Constructor
+
+  Creates a default QwtScaleDraw and a QwtLinearScaleEngine. 
+  Autoscaling is enabled, and the stepSize is initialized by 0.0.
+*/
+   
+QwtAbstractScale::QwtAbstractScale()
+{
+    d_data = new PrivateData;
+    rescale(0.0, 100.0);
+}
+
+//! Destructor
+QwtAbstractScale::~QwtAbstractScale()
+{
+    delete d_data;
+}
+
+/*!
+  \brief Specify a scale.
+
+  Disable autoscaling and define a scale by an interval and a step size
+
+  \param vmin lower limit of the scale interval
+  \param vmax upper limit of the scale interval
+  \param stepSize major step size
+  \sa QwtAbstractScale::setAutoScale()
+*/
+void QwtAbstractScale::setScale(double vmin, double vmax, double stepSize)
+{
+    d_data->autoScale = false;
+    d_data->stepSize = stepSize;
+
+    rescale(vmin, vmax, stepSize);
+}
+
+/*!
+  \brief Specify a scale.
+
+  Disable autoscaling and define a scale by an interval and a step size
+
+  \param interval Interval
+  \param stepSize major step size
+  \sa QwtAbstractScale::setAutoScale()
+*/
+void QwtAbstractScale::setScale(const QwtDoubleInterval &interval, 
+    double stepSize)
+{
+    setScale(interval.minValue(), interval.maxValue(), stepSize);
+}
+
+
+/*!
+  \brief Specify a scale.
+
+  Disable autoscaling and define a scale by a scale division
+
+  \param scaleDiv Scale division
+  \sa QwtAbstractScale::setAutoScale()
+*/
+void QwtAbstractScale::setScale(const QwtScaleDiv &scaleDiv)
+{
+    d_data->autoScale = false;
+
+    if (scaleDiv != d_data->scaleDraw->scaleDiv())
+    {
+        d_data->scaleDraw->setScaleDiv(scaleDiv);
+        scaleChange();
+    }
+}
+
+/*!
+  Recalculate the scale division and update the scale draw.
+
+  \param vmin Lower limit of the scale interval
+  \param vmax Upper limit of the scale interval
+  \param stepSize Major step size
+
+  \sa QwtAbstractScale::scaleChange
+*/
+void QwtAbstractScale::rescale(double vmin, double vmax, double stepSize) 
+{
+    const QwtScaleDiv scaleDiv = d_data->scaleEngine->divideScale(
+        vmin, vmax, d_data->maxMajor, d_data->maxMinor, stepSize);
+
+    if ( scaleDiv != d_data->scaleDraw->scaleDiv() )
+    {
+        d_data->scaleDraw->setTransformation(
+            d_data->scaleEngine->transformation());
+        d_data->scaleDraw->setScaleDiv(scaleDiv);
+        scaleChange();
+    }
+}
+
+/*!
+  \brief Advise the widget to control the scale range internally.
+
+  Autoscaling is on by default. 
+  \sa QwtAbstractScale::setScale(), QwtAbstractScale::autoScale
+*/
+void QwtAbstractScale::setAutoScale()
+{
+    if (!d_data->autoScale) 
+    {
+        d_data->autoScale = true;
+        scaleChange();
+    }
+}
+
+/*!
+  \return \c true if autoscaling is enabled
+*/  
+bool QwtAbstractScale::autoScale() const
+{
+    return d_data->autoScale;
+}
+
+/*!
+  \brief Set the maximum number of major tick intervals.
+
+  The scale's major ticks are calculated automatically such that
+  the number of major intervals does not exceed ticks.
+  The default value is 5.
+  \param ticks maximal number of major ticks.
+  \sa QwtAbstractScaleDraw
+*/
+void QwtAbstractScale::setScaleMaxMajor(int ticks)
+{
+    if (ticks != d_data->maxMajor)
+    {
+        d_data->maxMajor = ticks;
+        updateScaleDraw();
+    }
+}
+
+/*!
+  \brief Set the maximum number of minor tick intervals
+
+  The scale's minor ticks are calculated automatically such that
+  the number of minor intervals does not exceed ticks.
+  The default value is 3.
+  \param ticks
+  \sa QwtAbstractScaleDraw
+*/
+void QwtAbstractScale::setScaleMaxMinor(int ticks)
+{
+    if ( ticks != d_data->maxMinor)
+    {
+        d_data->maxMinor = ticks;
+        updateScaleDraw();
+    }
+}
+
+/*! 
+  \return Max. number of minor tick intervals 
+  The default value is 3.
+*/
+int QwtAbstractScale::scaleMaxMinor() const 
+{
+    return d_data->maxMinor;
+}
+
+/*! 
+  \return Max. number of major tick intervals 
+  The default value is 5.
+*/
+int QwtAbstractScale::scaleMaxMajor() const 
+{
+    return d_data->maxMajor;
+}
+
+/*!
+  \brief Set a scale draw
+
+  scaleDraw has to be created with new and will be deleted in
+  ~QwtAbstractScale or the next call of setScaleDraw.
+*/
+void QwtAbstractScale::setAbstractScaleDraw(QwtAbstractScaleDraw *scaleDraw)
+{
+    if ( scaleDraw == NULL || scaleDraw == d_data->scaleDraw )
+        return;
+
+    delete d_data->scaleDraw;
+    d_data->scaleDraw = scaleDraw;
+} 
+
+/*!
+    \return Scale draw
+    \sa QwtAbstractScale::setScaleDraw
+*/
+QwtAbstractScaleDraw *QwtAbstractScale::abstractScaleDraw() 
+{
+    return d_data->scaleDraw;
+}
+
+/*!
+    \return Scale draw
+    \sa QwtAbstractScale::setScaleDraw
+*/
+const QwtAbstractScaleDraw *QwtAbstractScale::abstractScaleDraw() const
+{
+    return d_data->scaleDraw;
+}
+
+void QwtAbstractScale::updateScaleDraw()
+{
+    rescale( d_data->scaleDraw->scaleDiv().lBound(), 
+        d_data->scaleDraw->scaleDiv().hBound(), d_data->stepSize);
+}
+
+/*!
+  \brief Set a scale engine
+
+  The scale engine is responsible for calculating the scale division,
+  and in case of auto scaling how to align the scale.
+
+  scaleEngine has to be created with new and will be deleted in
+  ~QwtAbstractScale or the next call of setScaleEngine.
+*/
+void QwtAbstractScale::setScaleEngine(QwtScaleEngine *scaleEngine)
+{
+    if ( scaleEngine != NULL && scaleEngine != d_data->scaleEngine )
+    {
+        delete d_data->scaleEngine;
+        d_data->scaleEngine = scaleEngine;
+    }
+}
+
+/*!
+    \return Scale engine
+    \sa QwtAbstractScale::setScaleEngine
+*/
+const QwtScaleEngine *QwtAbstractScale::scaleEngine() const
+{
+    return d_data->scaleEngine;
+}
+
+/*!
+    \return Scale engine
+    \sa QwtAbstractScale::setScaleEngine
+*/
+QwtScaleEngine *QwtAbstractScale::scaleEngine()
+{
+    return d_data->scaleEngine;
+}
+
+/*!
+  \brief Notify changed scale
+
+  Dummy empty implementation, intended to be overloaded by derived classes
+*/
+void QwtAbstractScale::scaleChange()
+{
+}
diff --git a/src/qwt/qwt_abstract_scale_draw.cpp b/src/qwt/qwt_abstract_scale_draw.cpp
new file mode 100644
index 0000000..4f7c3a9
--- /dev/null
+++ b/src/qwt/qwt_abstract_scale_draw.cpp
@@ -0,0 +1,397 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qpainter.h>
+#include <qpalette.h>
+#include <qmap.h>
+#include "qwt_math.h"
+#include "qwt_text.h"
+#include "qwt_painter.h"
+#include "qwt_scale_map.h"
+#include "qwt_scale_draw.h"
+
+class QwtAbstractScaleDraw::PrivateData
+{
+public:
+    PrivateData():
+        components(Backbone | Ticks | Labels),
+        spacing(4),
+        minExtent(0)
+    {
+        tickLength[QwtScaleDiv::MinorTick] = 4;
+        tickLength[QwtScaleDiv::MediumTick] = 6;
+        tickLength[QwtScaleDiv::MajorTick] = 8;
+    }
+
+    int components;
+    
+    QwtScaleMap map;
+    QwtScaleDiv scldiv;
+        
+    int spacing;
+    int tickLength[QwtScaleDiv::NTickTypes];
+
+    int minExtent;
+
+    QMap<double, QwtText> labelCache;
+};
+
+/*!
+  \brief Constructor
+
+  The range of the scale is initialized to [0, 100],
+  The spacing (distance between ticks and labels) is
+  set to 4, the tick lengths are set to 4,6 and 8 pixels
+*/
+QwtAbstractScaleDraw::QwtAbstractScaleDraw()
+{
+    d_data = new QwtAbstractScaleDraw::PrivateData;
+}
+
+//! Copy constructor
+QwtAbstractScaleDraw::QwtAbstractScaleDraw(const QwtAbstractScaleDraw &other)
+{
+    d_data = new QwtAbstractScaleDraw::PrivateData(*other.d_data);
+}
+
+//! Destructor
+QwtAbstractScaleDraw::~QwtAbstractScaleDraw()
+{
+    delete d_data;
+}
+//! Assignment operator
+QwtAbstractScaleDraw &QwtAbstractScaleDraw::operator=(const QwtAbstractScaleDraw &other)
+{
+    *d_data = *other.d_data;
+    return *this;
+}
+
+/*!  
+  En/Disable a component of the scale
+  \sa QwtAbstractScaleDraw::hasComponent
+*/
+void QwtAbstractScaleDraw::enableComponent(
+    ScaleComponent component, bool enable)
+{
+    if ( enable )
+        d_data->components |= component;
+    else
+        d_data->components &= ~component;
+}
+
+/*! 
+  Check if a component is enabled 
+  \sa QwtAbstractScaleDraw::enableComponent
+*/
+bool QwtAbstractScaleDraw::hasComponent(ScaleComponent component) const
+{
+    return (d_data->components & component);
+}
+
+/*!
+  Change the scale division
+  \param sd New scale division
+*/
+void QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &sd)
+{
+    d_data->scldiv = sd;
+    d_data->map.setScaleInterval(sd.lBound(), sd.hBound());
+    d_data->labelCache.clear();
+}
+
+/*!
+  Change the transformation of the scale
+  \param transformation New scale transformation
+*/
+void QwtAbstractScaleDraw::setTransformation(
+    const QwtScaleTransformation &transformation)
+{
+    d_data->map.setTransformation(transformation);
+}
+
+//! \return Map how to translate between scale and pixel values
+const QwtScaleMap &QwtAbstractScaleDraw::map() const
+{
+    return d_data->map;
+}
+
+//! \return Map how to translate between scale and pixel values
+QwtScaleMap &QwtAbstractScaleDraw::scaleMap() 
+{
+    return d_data->map;
+}
+
+//! \return scale division 
+const QwtScaleDiv& QwtAbstractScaleDraw::scaleDiv() const 
+{ 
+    return d_data->scldiv; 
+}
+
+#if QT_VERSION < 0x040000
+/*!
+  \brief Draw the scale
+
+  \param painter    The painter
+
+  \param colorGroup Color group, text color is used for the labels, 
+                    foreground color for ticks and backbone
+*/
+void QwtAbstractScaleDraw::draw(QPainter *painter, 
+    const QColorGroup& colorGroup) const
+
+#else
+
+/*!
+  \brief Draw the scale
+
+  \param painter    The painter
+
+  \param palette    Palette, text color is used for the labels, 
+                    foreground color for ticks and backbone
+*/
+void QwtAbstractScaleDraw::draw(QPainter *painter, 
+    const QPalette& palette) const
+#endif
+{
+    if ( hasComponent(QwtAbstractScaleDraw::Labels) )
+    {
+        painter->save();
+
+#if QT_VERSION < 0x040000
+        painter->setPen(colorGroup.text()); // ignore pen style
+#else
+        painter->setPen(palette.color(QPalette::Text)); // ignore pen style
+#endif
+
+        const QwtTickList &majorTicks = 
+            d_data->scldiv.ticks(QwtScaleDiv::MajorTick);
+
+        for (int i = 0; i < (int)majorTicks.count(); i++)
+        {
+            const double v = majorTicks[i];
+            if ( d_data->scldiv.contains(v) )
+                drawLabel(painter, majorTicks[i]);
+        }
+
+        painter->restore();
+    }
+
+    if ( hasComponent(QwtAbstractScaleDraw::Ticks) )
+    {
+        painter->save();
+
+        QPen pen = painter->pen();
+#if QT_VERSION < 0x040000
+        pen.setColor(colorGroup.foreground());
+#else
+        pen.setColor(palette.color(QPalette::Foreground));
+#endif
+        painter->setPen(pen);
+
+        for ( int tickType = QwtScaleDiv::MinorTick; 
+            tickType < QwtScaleDiv::NTickTypes; tickType++ )
+        {
+            const QwtTickList &ticks = d_data->scldiv.ticks(tickType);
+            for (int i = 0; i < (int)ticks.count(); i++)
+            {
+                const double v = ticks[i];
+                if ( d_data->scldiv.contains(v) )
+                    drawTick(painter, v, d_data->tickLength[tickType]);
+            }
+        }
+
+        painter->restore();
+    }
+
+    if ( hasComponent(QwtAbstractScaleDraw::Backbone) )
+    {
+        painter->save();
+
+        QPen pen = painter->pen();
+#if QT_VERSION < 0x040000
+        pen.setColor(colorGroup.foreground());
+#else
+        pen.setColor(palette.color(QPalette::Foreground));
+#endif
+        painter->setPen(pen);
+
+        drawBackbone(painter);
+
+        painter->restore();
+    }
+}
+
+/*!
+  \brief Set the spacing between tick and labels
+
+  The spacing is the distance between ticks and labels.
+  The default spacing is 4 pixels.
+
+  \param spacing Spacing
+
+  \sa QwtAbstractScaleDraw::spacing
+*/
+void QwtAbstractScaleDraw::setSpacing(int spacing)
+{
+    if ( spacing < 0 )
+        spacing = 0;
+
+    d_data->spacing = spacing;
+}
+
+/*!
+  \brief Get the spacing
+
+  The spacing is the distance between ticks and labels.
+  The default spacing is 4 pixels.
+
+  \sa QwtAbstractScaleDraw::setSpacing
+*/
+int QwtAbstractScaleDraw::spacing() const
+{
+    return d_data->spacing;
+}
+
+/*!
+  \brief Set a minimum for the extent
+
+  The extent is calculated from the coomponents of the
+  scale draw. In situations, where the labels are
+  changing and the layout depends on the extent (f.e scrolling
+  a scale), setting an upper limit as minimum extent will
+  avoid jumps of the layout.
+
+  \param minExtent Minimum extent
+
+  \sa extent(), minimumExtent()
+*/
+void QwtAbstractScaleDraw::setMinimumExtent(int minExtent)
+{
+    if ( minExtent < 0 )
+        minExtent = 0;
+
+    d_data->minExtent = minExtent;
+}
+
+/*!
+  Get the minimum extent
+  \sa extent(), setMinimumExtent()
+*/
+int QwtAbstractScaleDraw::minimumExtent() const
+{
+    return d_data->minExtent;
+}
+
+/*!
+  Set the length of the ticks
+   
+  \param tickType Tick type
+  \param length New length
+
+  \warning the length is limited to [0..1000]
+*/
+void QwtAbstractScaleDraw::setTickLength(
+    QwtScaleDiv::TickType tickType, int length)
+{
+    if ( tickType < QwtScaleDiv::MinorTick || 
+        tickType > QwtScaleDiv::MajorTick )
+    {
+        return;
+    }
+
+    if ( length < 0 )
+        length = 0;
+
+    const int maxTickLen = 1000;
+    if ( length > maxTickLen )
+        length = 1000;
+
+    d_data->tickLength[tickType] = length;
+}
+
+/*!
+    Return the length of the ticks
+
+    \sa QwtAbstractScaleDraw::setTickLength, 
+        QwtAbstractScaleDraw::majTickLength
+*/
+int QwtAbstractScaleDraw::tickLength(QwtScaleDiv::TickType tickType) const
+{
+    if ( tickType < QwtScaleDiv::MinorTick || 
+        tickType > QwtScaleDiv::MajorTick )
+    {
+        return 0;
+    }
+
+    return d_data->tickLength[tickType];
+}
+
+/*!
+   The same as QwtAbstractScaleDraw::tickLength(QwtScaleDiv::MajorTick).
+*/
+int QwtAbstractScaleDraw::majTickLength() const
+{
+    return d_data->tickLength[QwtScaleDiv::MajorTick];
+}
+
+/*!
+  \brief Convert a value into its representing label 
+
+  The value is converted to a plain text using QString::number(value).
+  This method is often overloaded by applications to have individual
+  labels.
+
+  \param value Value
+  \return Label string.
+*/
+QwtText QwtAbstractScaleDraw::label(double value) const
+{
+    return QString::number(value);
+}
+
+/*!
+   Convert a value into its representing label and cache it.
+
+   The conversion between value and label is called very often
+   in the layout and painting code. Also the
+   calculation of the label sizes might be slow (really slow
+   for rich text in Qt4). QwtAbstractScaleDraw::tickLabel
+   calls QwtAbstractScaleDraw::label and caches its result.
+*/
+const QwtText &QwtAbstractScaleDraw::tickLabel(
+    const QFont &font, double value) const
+{
+    QMap<double, QwtText>::const_iterator it = d_data->labelCache.find(value);
+    if ( it == d_data->labelCache.end() )
+    {
+        QwtText lbl = label(value);
+        lbl.setFlags(0);
+        lbl.setLayoutAttributes(QwtText::MinimumLayout);
+
+        (void)lbl.textSize(font); // initialize the internal cache
+
+        it = d_data->labelCache.insert(value, lbl);
+    }
+
+    return (*it);
+}
+
+/*!
+   Invalidate the cache used by QwtAbstractScaleDraw::tickLabel
+
+   The cache is invalidated, when a new QwtScaleDiv is set. If
+   the labels need to be changed. while the same QwtScaleDiv is set,
+   QwtAbstractScaleDraw::invalidateCache needs to be called manually.
+*/
+void QwtAbstractScaleDraw::invalidateCache()
+{
+    d_data->labelCache.clear();
+}
diff --git a/src/qwt/qwt_abstract_slider.cpp b/src/qwt/qwt_abstract_slider.cpp
new file mode 100644
index 0000000..5ca1be2
--- /dev/null
+++ b/src/qwt/qwt_abstract_slider.cpp
@@ -0,0 +1,565 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qevent.h>
+#include <qdatetime.h>
+#include "qwt_abstract_slider.h"
+#include "qwt_math.h"
+
+#ifndef WHEEL_DELTA
+#define WHEEL_DELTA 120
+#endif
+
+class QwtAbstractSlider::PrivateData
+{
+public:
+    PrivateData():
+        scrollMode(ScrNone),
+        mouseOffset(0.0),
+        tracking(true),
+        tmrID(0),
+        updTime(150),
+        mass(0.0),
+        readOnly(false)
+    {
+    }
+
+    int scrollMode;
+    double mouseOffset;
+    int direction;
+    int tracking;
+
+    int tmrID;
+    int updTime;
+    int timerTick;
+    QTime time;
+    double speed;
+    double mass;
+    Qt::Orientation orientation;
+    bool readOnly;
+};
+
+//! Constructor
+QwtAbstractSlider::QwtAbstractSlider(Qt::Orientation orient, QWidget *parent): 
+    QWidget(parent, NULL)
+{
+    d_data = new QwtAbstractSlider::PrivateData;
+    d_data->orientation = orient;
+
+#if QT_VERSION >= 0x040000
+    using namespace Qt;
+#endif
+    setFocusPolicy(TabFocus);
+}
+
+//! Destructor
+QwtAbstractSlider::~QwtAbstractSlider()
+{
+    if(d_data->tmrID) 
+        killTimer(d_data->tmrID);
+
+    delete d_data;
+}
+
+/*!
+  En/Disable read only mode
+
+  In read only mode the slider can�t be controlled by mouse
+  or keyboard.
+
+  \param readOnly Enables in case of true
+  \sa isReadOnly
+*/
+void QwtAbstractSlider::setReadOnly(bool readOnly)
+{
+    d_data->readOnly = readOnly;
+    update();
+}
+
+/*!
+  In read only mode the slider can�t be controlled by mouse
+  or keyboard.
+
+  \return true if read only
+  \sa setReadOnly
+*/
+bool QwtAbstractSlider::isReadOnly() const
+{
+    return d_data->readOnly;
+}
+
+/*!
+  \brief Set the orientation.
+  \param o Orientation. Allowed values are
+           Qt::Horizontal and Qt::Vertical.
+*/
+void QwtAbstractSlider::setOrientation(Qt::Orientation o)
+{
+    d_data->orientation = o;
+}
+
+/*! 
+  \return Orientation
+  \sa QwtAbstractSlider::setOrientation
+*/
+Qt::Orientation QwtAbstractSlider::orientation() const
+{
+    return d_data->orientation;
+}
+
+//! Stop updating if automatic scrolling is active
+
+void QwtAbstractSlider::stopMoving() 
+{
+    if(d_data->tmrID)
+    {
+        killTimer(d_data->tmrID);
+        d_data->tmrID = 0;
+    }
+}
+
+/*!
+  \brief Specify the update interval for automatic scrolling
+  \param t update interval in milliseconds
+  \sa QwtAbstractSlider::getScrollMode()
+*/
+void QwtAbstractSlider::setUpdateTime(int t) 
+{
+    if (t < 50) 
+        t = 50;
+    d_data->updTime = t;
+}
+
+
+//! Mouse press event handler
+void QwtAbstractSlider::mousePressEvent(QMouseEvent *e) 
+{
+    if ( isReadOnly() )
+    {
+        e->ignore();
+        return;
+    }
+    if ( !isValid() )
+        return;
+
+    const QPoint &p = e->pos();
+
+    d_data->timerTick = 0;
+
+    getScrollMode(p, d_data->scrollMode, d_data->direction);
+    stopMoving();
+    
+    switch(d_data->scrollMode)
+    {
+        case ScrPage:
+        case ScrTimer:
+            d_data->mouseOffset = 0;
+            d_data->tmrID = startTimer(qwtMax(250, 2 * d_data->updTime));
+            break;
+        
+        case ScrMouse:
+            d_data->time.start();
+            d_data->speed = 0;
+            d_data->mouseOffset = getValue(p) - value();
+            emit sliderPressed();
+            break;
+        
+        default:
+            d_data->mouseOffset = 0;
+            d_data->direction = 0;
+            break;
+    }
+}
+
+
+//! Emits a valueChanged() signal if necessary
+void QwtAbstractSlider::buttonReleased()
+{
+    if ((!d_data->tracking) || (value() != prevValue()))
+        emit valueChanged(value());
+}
+
+
+//! Mouse Release Event handler
+void QwtAbstractSlider::mouseReleaseEvent(QMouseEvent *e)
+{
+    if ( isReadOnly() )
+    {
+        e->ignore();
+        return;
+    }
+    if ( !isValid() )
+        return;
+
+    const double inc = step();
+    
+    switch(d_data->scrollMode) 
+    {
+        case ScrMouse:
+        {
+            setPosition(e->pos());
+            d_data->direction = 0;
+            d_data->mouseOffset = 0;
+            if (d_data->mass > 0.0) 
+            {
+                const int ms = d_data->time.elapsed();
+                if ((fabs(d_data->speed) >  0.0) && (ms < 50))
+                    d_data->tmrID = startTimer(d_data->updTime);
+            }
+            else
+            {
+                d_data->scrollMode = ScrNone;
+                buttonReleased();
+            }
+            emit sliderReleased();
+            
+            break;
+        }
+
+        case ScrDirect:
+        {
+            setPosition(e->pos());
+            d_data->direction = 0;
+            d_data->mouseOffset = 0;
+            d_data->scrollMode = ScrNone;
+            buttonReleased();
+            break;
+        }
+
+        case ScrPage:
+        {
+            stopMoving();
+            if (!d_data->timerTick)
+                QwtDoubleRange::incPages(d_data->direction);
+            d_data->timerTick = 0;
+            buttonReleased();
+            d_data->scrollMode = ScrNone;
+            break;
+        }
+
+        case ScrTimer:
+        {
+            stopMoving();
+            if (!d_data->timerTick)
+                QwtDoubleRange::fitValue(value() + double(d_data->direction) * inc);
+            d_data->timerTick = 0;
+            buttonReleased();
+            d_data->scrollMode = ScrNone;
+            break;
+        }
+
+        default:
+        {
+            d_data->scrollMode = ScrNone;
+            buttonReleased();
+        }
+    }
+}
+
+
+/*!
+  Move the slider to a specified point, adjust the value
+  and emit signals if necessary.
+*/
+void QwtAbstractSlider::setPosition(const QPoint &p) 
+{
+    QwtDoubleRange::fitValue(getValue(p) - d_data->mouseOffset);
+}
+
+
+/*!
+  \brief Enables or disables tracking.
+
+  If tracking is enabled, the slider emits a
+  valueChanged() signal whenever its value
+  changes (the default behaviour). If tracking
+  is disabled, the value changed() signal will only
+  be emitted if:<ul>
+  <li>the user releases the mouse
+      button and the value has changed or
+  <li>at the end of automatic scrolling.</ul>
+  Tracking is enabled by default.
+  \param enable \c true (enable) or \c false (disable) tracking.
+*/
+void QwtAbstractSlider::setTracking(bool enable)
+{
+    d_data->tracking = enable;
+}
+
+//! Mouse Move Event handler
+void QwtAbstractSlider::mouseMoveEvent(QMouseEvent *e)
+{
+    if ( isReadOnly() )
+    {
+        e->ignore();
+        return;
+    }
+
+    if ( !isValid() )
+        return;
+
+    if (d_data->scrollMode == ScrMouse )
+    {
+        setPosition(e->pos());
+        if (d_data->mass > 0.0) 
+        {
+            double ms = double(d_data->time.elapsed());
+            if (ms < 1.0) 
+                ms = 1.0;
+            d_data->speed = (exactValue() - exactPrevValue()) / ms;
+            d_data->time.start();
+        }
+        if (value() != prevValue())
+            emit sliderMoved(value());
+    }
+}
+
+//! Qt wheel event
+void QwtAbstractSlider::wheelEvent(QWheelEvent *e)
+{
+    if ( isReadOnly() )
+    {
+        e->ignore();
+        return;
+    }
+
+    if ( !isValid() )
+        return;
+
+    int mode = ScrNone, direction = 0;
+
+    // Give derived classes a chance to say ScrNone
+    getScrollMode(e->pos(), mode, direction);
+    if ( mode != ScrNone )
+    {
+        const int inc = e->delta() / WHEEL_DELTA;
+        QwtDoubleRange::incPages(inc);
+        if (value() != prevValue())
+            emit sliderMoved(value());
+    }
+}
+
+/*!
+  Handles key events
+
+  - Key_Down, KeyLeft\n
+    Decrement by 1
+  - Key_Up, Key_Right\n
+    Increment by 1
+
+  \sa isReadOnly()
+*/
+
+void QwtAbstractSlider::keyPressEvent(QKeyEvent *e)
+{
+    if ( isReadOnly() )
+    {
+        e->ignore();
+        return;
+    }
+
+    if ( !isValid() )
+        return;
+
+    int increment = 0;
+    switch ( e->key() ) 
+    {
+        case Qt::Key_Down:
+            if ( orientation() == Qt::Vertical )
+                increment = -1;
+            break;
+        case Qt::Key_Up:
+            if ( orientation() == Qt::Vertical )
+                increment = 1;
+            break;
+        case Qt::Key_Left:
+            if ( orientation() == Qt::Horizontal )
+                increment = -1;
+            break;
+        case Qt::Key_Right:
+            if ( orientation() == Qt::Horizontal )
+                increment = 1;
+            break;
+        default:;
+            e->ignore();
+    }
+
+    if ( increment != 0 )
+    {
+        QwtDoubleRange::incValue(increment);
+        if (value() != prevValue())
+            emit sliderMoved(value());
+    }
+}
+
+//! Qt timer event
+void QwtAbstractSlider::timerEvent(QTimerEvent *)
+{
+    const double inc = step();
+
+    switch (d_data->scrollMode)
+    {
+        case ScrMouse:
+        {
+            if (d_data->mass > 0.0)
+            {
+                d_data->speed *= exp( - double(d_data->updTime) * 0.001 / d_data->mass );
+                const double newval = 
+                    exactValue() + d_data->speed * double(d_data->updTime);
+                QwtDoubleRange::fitValue(newval);
+                // stop if d_data->speed < one step per second
+                if (fabs(d_data->speed) < 0.001 * fabs(step()))
+                {
+                    d_data->speed = 0;
+                    stopMoving();
+                    buttonReleased();
+                }
+
+            }
+            else
+               stopMoving();
+            break;
+        }
+
+        case ScrPage:
+        {
+            QwtDoubleRange::incPages(d_data->direction);
+            if (!d_data->timerTick) 
+            {
+                killTimer(d_data->tmrID);
+                d_data->tmrID = startTimer(d_data->updTime);
+            }
+            break;
+        }
+        case ScrTimer:
+        {
+            QwtDoubleRange::fitValue(value() +  double(d_data->direction) * inc);
+            if (!d_data->timerTick) 
+            {
+                killTimer(d_data->tmrID);
+                d_data->tmrID = startTimer(d_data->updTime);
+            }
+            break;
+        }
+        default:
+        {
+            stopMoving();
+            break;
+        }
+    }
+
+    d_data->timerTick = 1;
+}
+
+
+/*!
+  Notify change of value
+
+  This function can be reimplemented by derived classes
+  in order to keep track of changes, i.e. repaint the widget.
+  The default implementation emits a valueChanged() signal
+  if tracking is enabled.
+*/
+void QwtAbstractSlider::valueChange() 
+{
+    if (d_data->tracking)
+       emit valueChanged(value());  
+}
+
+/*!
+  \brief Set the slider's mass for flywheel effect.
+
+  If the slider's mass is greater then 0, it will continue
+  to move after the mouse button has been released. Its speed
+  decreases with time at a rate depending on the slider's mass.
+  A large mass means that it will continue to move for a
+  long time.
+
+  Derived widgets may overload this function to make it public.
+
+  \param val new mass in kg
+
+  \bug If the mass is smaller than 1g, it is set to zero.
+       The maximal mass is limited to 100kg.
+  \sa QwtAbstractSlider::mass
+*/
+void QwtAbstractSlider::setMass(double val)
+{
+    if (val < 0.001)
+       d_data->mass = 0.0;
+    else if (val > 100.0)
+       d_data->mass = 100.0;
+    else
+       d_data->mass = val;
+}
+
+/*!
+    \return mass
+    \sa QwtAbstractSlider::setMass
+*/
+double QwtAbstractSlider::mass() const
+{   
+    return d_data->mass; 
+}
+
+
+/*!
+  \brief Move the slider to a specified value
+
+  This function can be used to move the slider to a value
+  which is not an integer multiple of the step size.
+  \param val new value
+  \sa QwtAbstractSlider::fitValue
+*/
+void QwtAbstractSlider::setValue(double val)
+{
+    if (d_data->scrollMode == ScrMouse) 
+        stopMoving();
+    QwtDoubleRange::setValue(val);
+}
+
+
+/*!
+  \brief Set the slider's value to the nearest integer multiple
+         of the step size.
+     \sa QwtAbstractSlider::setValue()
+*/
+void QwtAbstractSlider::fitValue(double val)
+{
+    if (d_data->scrollMode == ScrMouse) 
+        stopMoving();
+    QwtDoubleRange::fitValue(val);
+}
+
+
+/*!
+  \brief Increment the value by a specified number of steps
+  \param steps number of steps
+*/
+void QwtAbstractSlider::incValue(int steps)
+{
+    if (d_data->scrollMode == ScrMouse) 
+        stopMoving();
+    QwtDoubleRange::incValue(steps);
+}
+
+void QwtAbstractSlider::setMouseOffset(double offset)
+{
+    d_data->mouseOffset = offset;
+} 
+
+double QwtAbstractSlider::mouseOffset() const
+{
+    return d_data->mouseOffset;
+}
+
+int QwtAbstractSlider::scrollMode() const
+{
+    return d_data->scrollMode;
+}
diff --git a/src/qwt/qwt_analog_clock.cpp b/src/qwt/qwt_analog_clock.cpp
new file mode 100644
index 0000000..c657986
--- /dev/null
+++ b/src/qwt/qwt_analog_clock.cpp
@@ -0,0 +1,213 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_analog_clock.h"
+
+/*!
+  Constructor
+  \param parent Parent widget
+*/
+QwtAnalogClock::QwtAnalogClock(QWidget *parent):
+    QwtDial(parent)
+{
+    setWrapping(true);
+    setReadOnly(true);
+
+    setOrigin(270.0);
+    setRange(0.0, 60.0 * 60.0 * 12.0); // seconds
+    setScale(-1, 5, 60.0 * 60.0);
+
+    setScaleOptions(ScaleTicks | ScaleLabel);
+    setScaleTicks(1, 0, 8);
+
+    QColor knobColor =
+#if QT_VERSION < 0x040000
+        palette().color(QPalette::Active, QColorGroup::Text);
+#else
+        palette().color(QPalette::Active, QPalette::Text);
+#endif
+    knobColor = knobColor.dark(120);
+
+    QColor handColor;
+    int width;
+
+    for ( int i = 0; i < NHands; i++ )
+    {
+        if ( i == SecondHand )
+        {
+            width = 2;
+            handColor = knobColor.dark(120);
+        }
+        else
+        {
+            width = 8;
+            handColor = knobColor;
+        }
+
+        QwtDialSimpleNeedle *hand = new QwtDialSimpleNeedle(
+            QwtDialSimpleNeedle::Arrow, true, handColor, knobColor);
+        hand->setWidth(width);
+
+        d_hand[i] = NULL;
+        setHand((Hand)i, hand);
+    }
+}
+
+//! Destructor
+QwtAnalogClock::~QwtAnalogClock()
+{
+    for ( int i = 0; i < NHands; i++ )
+        delete d_hand[i];
+}
+
+/*! 
+  Nop method, use setHand instead
+  \sa QwtAnalogClock::setHand
+*/
+void QwtAnalogClock::setNeedle(QwtDialNeedle *)
+{
+    // no op
+    return;
+}
+
+/*!
+   Set a clockhand
+   \param hand Specifies the type of hand
+   \param needle Hand
+   \sa QwtAnalogClock::hand()
+*/
+void QwtAnalogClock::setHand(Hand hand, QwtDialNeedle *needle)
+{
+    if ( hand >= 0 || hand < NHands )
+    {
+        delete d_hand[hand];
+        d_hand[hand] = needle;
+    }
+}
+
+/*!
+  \return Clock hand
+  \param hd Specifies the type of hand
+  \sa QwtAnalogClock::setHand
+*/
+QwtDialNeedle *QwtAnalogClock::hand(Hand hd)
+{
+    if ( hd < 0 || hd >= NHands )
+        return NULL;
+
+    return d_hand[hd];
+}
+
+/*!
+  \return Clock hand
+  \param hd Specifies the type of hand
+  \sa QwtAnalogClock::setHand
+*/
+const QwtDialNeedle *QwtAnalogClock::hand(Hand hd) const
+{
+    return ((QwtAnalogClock *)this)->hand(hd);
+}
+
+/*!
+  \brief Set the current time
+
+  This is the same as QwtAnalogClock::setTime(), but Qt < 3.0
+  can�t handle default parameters for slots.
+*/
+void QwtAnalogClock::setCurrentTime()
+{ 
+    setTime(QTime::currentTime()); 
+}
+
+/*!
+  Set a time 
+  \param time Time to display
+*/
+void QwtAnalogClock::setTime(const QTime &time)
+{
+    if ( time.isValid() )
+    {
+        setValue((time.hour() % 12) * 60.0 * 60.0 
+            + time.minute() * 60.0 + time.second());
+    }
+    else
+        setValid(false);
+}
+
+/*! 
+  Find the scale label for a given value
+
+  \param value Value
+  \return Label
+*/
+QwtText QwtAnalogClock::scaleLabel(double value) const
+{
+    if ( value == 0.0 )
+        value = 60.0 * 60.0 * 12.0;
+
+    return QString::number(int(value / (60.0 * 60.0)));
+}
+
+/*!
+  \brief Draw the needle
+
+  A clock has no single needle but three hands instead. drawNeedle
+  translates value() into directions for the hands and calls
+  drawHand().
+
+  \param painter Painter
+  \param center Center of the clock
+  \param radius Maximum length for the hands
+  \param direction Dummy, not used.
+  \param cg ColorGroup
+
+  \sa QwtAnalogClock::drawHand()
+*/
+void QwtAnalogClock::drawNeedle(QPainter *painter, const QPoint &center,
+        int radius, double, QPalette::ColorGroup cg) const
+{
+    if ( isValid() )
+    {
+        const double hours = value() / (60.0 * 60.0);
+        const double minutes = (value() - (int)hours * 60.0 * 60.0) / 60.0;
+        const double seconds = value() - (int)hours * 60.0 * 60.0 
+            - (int)minutes * 60.0;
+
+        drawHand(painter, HourHand, center, radius,
+            360.0 - (origin() + 360.0 * hours / 12.0), cg);
+        drawHand(painter, MinuteHand, center, radius,
+            360.0 - (origin() + 360.0 * minutes / 60.0), cg);
+        drawHand(painter, SecondHand, center, radius,
+            360.0 - (origin() + 360.0 * seconds / 60.0), cg);
+    }
+}
+
+/*!
+  Draw a clock hand
+
+  \param painter Painter
+  \param hd Specify the type of hand
+  \param center Center of the clock
+  \param radius Maximum length for the hands
+  \param direction Direction of the hand in degrees, counter clockwise
+  \param cg ColorGroup
+*/
+void QwtAnalogClock::drawHand(QPainter *painter, Hand hd,
+    const QPoint &center, int radius, double direction, 
+    QPalette::ColorGroup cg) const
+{
+    const QwtDialNeedle *needle = hand(hd);
+    if ( needle )
+    {
+        if ( hd == HourHand )
+            radius = qRound(0.8 * radius);
+
+        needle->draw(painter, center, radius, direction, cg);
+    }
+}
diff --git a/src/qwt/qwt_arrow_button.cpp b/src/qwt/qwt_arrow_button.cpp
new file mode 100644
index 0000000..7d43d10
--- /dev/null
+++ b/src/qwt/qwt_arrow_button.cpp
@@ -0,0 +1,362 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qpainter.h>
+#include <qstyle.h>
+#include <qevent.h>
+#include "qwt_math.h"
+#include "qwt_arrow_button.h"
+
+#if QT_VERSION < 0x040000
+#include <qpointarray.h>
+#define QwtPointArray QPointArray
+#else
+#include <qpolygon.h>
+#define QwtPointArray QPolygon
+#endif
+
+static const int MaxNum = 3;
+static const int Margin = 2;
+static const int Spacing = 1;
+
+class QwtArrowButton::PrivateData
+{
+public:
+    int num;
+    Qt::ArrowType arrowType;
+};
+
+
+#if QT_VERSION >= 0x040000
+#include <qstyleoption.h>
+static QStyleOptionButton styleOpt(const QwtArrowButton* btn)
+{
+    QStyleOptionButton option;
+    option.init(btn);
+    option.features = QStyleOptionButton::None;
+    if (btn->isFlat())
+        option.features |= QStyleOptionButton::Flat;
+    if (btn->menu())
+        option.features |= QStyleOptionButton::HasMenu;
+    if (btn->autoDefault() || btn->isDefault())
+        option.features |= QStyleOptionButton::AutoDefaultButton;
+    if (btn->isDefault())
+        option.features |= QStyleOptionButton::DefaultButton;
+    if (btn->isDown())
+        option.state |= QStyle::State_Sunken;
+    if (!btn->isFlat() && !btn->isDown())
+        option.state |= QStyle::State_Raised;
+
+    return option;
+}
+#endif
+
+/*!
+  \param num Number of arrows
+  \param arrowType see Qt::ArowType in the Qt docs.
+  \param parent Parent widget
+*/
+QwtArrowButton::QwtArrowButton(int num, 
+        Qt::ArrowType arrowType, QWidget *parent): 
+    QPushButton(parent)
+{
+    d_data = new PrivateData;
+    d_data->num = qwtLim(num, 1, MaxNum);
+    d_data->arrowType = arrowType;
+
+    setAutoRepeat(true);
+    setAutoDefault(false);
+
+    switch(d_data->arrowType)
+    {
+        case Qt::LeftArrow:
+        case Qt::RightArrow:
+            setSizePolicy(QSizePolicy::Expanding, 
+                QSizePolicy::Fixed);
+            break;
+        default:
+            setSizePolicy(QSizePolicy::Fixed, 
+                QSizePolicy::Expanding);
+    }
+}
+
+QwtArrowButton::~QwtArrowButton()
+{
+    delete d_data;
+    d_data = NULL;
+}
+
+/*!
+  \brief The direction of the arrows
+*/
+Qt::ArrowType QwtArrowButton::arrowType() const 
+{ 
+    return d_data->arrowType; 
+}
+
+/*!
+  \brief The number of arrows
+*/
+int QwtArrowButton::num() const 
+{ 
+    return d_data->num; 
+}
+
+/*!
+  \return the bounding rect for the label
+*/
+QRect QwtArrowButton::labelRect() const
+{
+    const int m = Margin;
+
+    QRect r = rect();
+    r.setRect(r.x() + m, r.y() + m, 
+        r.width() - 2 * m, r.height() - 2 * m);
+
+    if ( isDown() )
+    {
+        int ph, pv;
+#if QT_VERSION < 0x040000
+        ph = style().pixelMetric(
+            QStyle::PM_ButtonShiftHorizontal, this);
+        pv = style().pixelMetric(
+            QStyle::PM_ButtonShiftVertical, this);
+        r.moveBy(ph, pv);
+#else
+        QStyleOptionButton option = styleOpt(this);
+        ph = style()->pixelMetric(
+            QStyle::PM_ButtonShiftHorizontal, &option, this);
+        pv = style()->pixelMetric(
+            QStyle::PM_ButtonShiftVertical, &option, this);
+        r.translate(ph, pv);
+#endif
+    }
+
+    return r;
+}
+
+#if QT_VERSION >= 0x040000
+void QwtArrowButton::paintEvent(QPaintEvent *event)
+{
+    QPushButton::paintEvent(event);
+    QPainter painter(this);
+    drawButtonLabel(&painter);
+}
+#endif
+
+/*!
+  \brief Draw the button label
+  \sa The Qt Manual on QPushButton
+*/
+void QwtArrowButton::drawButtonLabel(QPainter *p)
+{
+    const bool isVertical = d_data->arrowType == Qt::UpArrow ||
+        d_data->arrowType == Qt::DownArrow;
+
+    const QRect r = labelRect();
+    QSize boundingSize = labelRect().size();
+    if ( isVertical )
+        boundingSize.transpose();
+        
+    const int w = 
+        (boundingSize.width() - (MaxNum - 1) * Spacing) / MaxNum;
+
+    QSize arrow = arrowSize(Qt::RightArrow, 
+        QSize(w, boundingSize.height()));
+
+    if ( isVertical )
+        arrow.transpose();
+
+    QRect contentsSize; // aligned rect where to paint all arrows
+    if ( d_data->arrowType == Qt::LeftArrow || d_data->arrowType == Qt::RightArrow )
+    {
+        contentsSize.setWidth(d_data->num * arrow.width() 
+            + (d_data->num - 1) * Spacing);
+        contentsSize.setHeight(arrow.height());
+    }
+    else
+    {
+        contentsSize.setWidth(arrow.width());
+        contentsSize.setHeight(d_data->num * arrow.height() 
+            + (d_data->num - 1) * Spacing);
+    }
+
+    QRect arrowRect(contentsSize);
+    arrowRect.moveCenter(r.center());
+    arrowRect.setSize(arrow);
+
+    p->save();
+    for (int i = 0; i < d_data->num; i++)
+    {
+        drawArrow(p, arrowRect, d_data->arrowType);
+
+        int dx = 0;
+        int dy = 0;
+
+        if ( isVertical )
+            dy = arrow.height() + Spacing;
+        else
+            dx = arrow.width() + Spacing;
+
+#if QT_VERSION >= 0x040000
+        arrowRect.translate(dx, dy);
+#else
+        arrowRect.moveBy(dx, dy);
+#endif
+    }
+    p->restore();
+
+    if ( hasFocus() )
+    {
+#if QT_VERSION >= 0x040000
+        QStyleOptionFocusRect option;
+        option.init(this);
+        option.backgroundColor = palette().color(QPalette::Background);
+
+        style()->drawPrimitive(QStyle::PE_FrameFocusRect, 
+            &option, p, this);
+#else
+        const QRect focusRect =  
+            style().subRect(QStyle::SR_PushButtonFocusRect, this);
+        style().drawPrimitive(QStyle::PE_FocusRect, p,
+            focusRect, colorGroup());
+#endif
+    }
+}
+
+/*!
+    Draw an arrow int a bounding rect
+
+    \param p Painter
+    \param r Rectangle where to paint the arrow
+    \param arrowType Arrow type
+*/
+void QwtArrowButton::drawArrow(QPainter *p, 
+    const QRect &r, Qt::ArrowType arrowType) const 
+{
+    QwtPointArray pa(3);
+
+    switch(arrowType)
+    {
+        case Qt::UpArrow:
+            pa.setPoint(0, r.bottomLeft());
+            pa.setPoint(1, r.bottomRight());
+            pa.setPoint(2, r.center().x(), r.top());
+            break;
+        case Qt::DownArrow:
+            pa.setPoint(0, r.topLeft());
+            pa.setPoint(1, r.topRight());
+            pa.setPoint(2, r.center().x(), r.bottom());
+            break;
+        case Qt::RightArrow:
+            pa.setPoint(0, r.topLeft());
+            pa.setPoint(1, r.bottomLeft());
+            pa.setPoint(2, r.right(), r.center().y());
+            break;
+        case Qt::LeftArrow:
+            pa.setPoint(0, r.topRight());
+            pa.setPoint(1, r.bottomRight());
+            pa.setPoint(2, r.left(), r.center().y());
+            break;
+        default:
+            break;
+    }
+
+    p->save();
+#if QT_VERSION < 0x040000
+    p->setPen(colorGroup().buttonText());
+    p->setBrush(colorGroup().brush(QColorGroup::ButtonText));
+#else
+    p->setPen(palette().color(QPalette::ButtonText));
+    p->setBrush(palette().brush(QPalette::ButtonText));
+#endif
+    p->drawPolygon(pa);
+    p->restore();
+}
+
+/*!
+  \return a size hint
+*/
+QSize QwtArrowButton::sizeHint() const
+{
+    return minimumSizeHint();
+}
+
+/*!
+  \brief Return a minimum size hint
+*/
+QSize QwtArrowButton::minimumSizeHint() const
+{
+    const QSize asz = arrowSize(Qt::RightArrow, QSize()); 
+
+    QSize sz(
+        2 * Margin + (MaxNum - 1) * Spacing + MaxNum * asz.width(),
+        2 * Margin + asz.height()
+    );
+
+    if ( d_data->arrowType == Qt::UpArrow || d_data->arrowType == Qt::DownArrow )
+        sz.transpose();
+
+#if QT_VERSION >= 0x040000
+    QStyleOption styleOption;
+    styleOption.init(this);
+
+    sz = style()->sizeFromContents(QStyle::CT_PushButton, 
+        &styleOption, sz, this);
+#else
+    sz = style().sizeFromContents(QStyle::CT_PushButton, this, sz);
+#endif
+
+    return sz;
+}
+
+/*!
+   Calculate the size for a arrow that fits into a rect of a given size
+
+   \param arrowType Arrow type
+   \param boundingSize Bounding size
+   \return Size of the arrow
+*/
+QSize QwtArrowButton::arrowSize(Qt::ArrowType arrowType,
+    const QSize &boundingSize) const
+{
+    QSize bs = boundingSize;
+    if ( arrowType == Qt::UpArrow || arrowType == Qt::DownArrow )
+        bs.transpose();
+        
+    const int MinLen = 2;
+    const QSize sz = bs.expandedTo(
+        QSize(MinLen, 2 * MinLen - 1)); // minimum
+
+    int w = sz.width();
+    int h = 2 * w - 1;
+
+    if ( h > sz.height() )
+    {
+        h = sz.height();
+        w = (h + 1) / 2;
+    }
+
+    QSize arrSize(w, h);
+    if ( arrowType == Qt::UpArrow || arrowType == Qt::DownArrow )
+        arrSize.transpose();
+
+    return arrSize;
+}
+
+/*!
+  \brief autoRepeat for the space keys
+*/
+void QwtArrowButton::keyPressEvent(QKeyEvent *e)
+{
+    if ( e->isAutoRepeat() && e->key() == Qt::Key_Space )
+        emit clicked();
+
+    QPushButton::keyPressEvent(e);
+}
diff --git a/src/qwt/qwt_compass.cpp b/src/qwt/qwt_compass.cpp
new file mode 100644
index 0000000..f0c9197
--- /dev/null
+++ b/src/qwt/qwt_compass.cpp
@@ -0,0 +1,287 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <math.h>
+#include <qpainter.h>
+#include <qpixmap.h>
+#include <qevent.h>
+#include "qwt_math.h"
+#include "qwt_scale_draw.h"
+#include "qwt_paint_buffer.h"
+#include "qwt_painter.h"
+#include "qwt_dial_needle.h"
+#include "qwt_compass_rose.h"
+#include "qwt_compass.h"
+
+class QwtCompass::PrivateData
+{
+public:
+    PrivateData():
+        rose(NULL)
+    {
+    }
+
+    ~PrivateData()
+    {
+        delete rose;
+    }
+
+    QwtCompassRose *rose;
+    QMap<double, QString> labelMap;
+};
+
+/*!
+  \brief Constructor
+  \param parent Parent widget
+
+  Create a compass widget with a scale, no needle and no rose. 
+  The default origin is 270.0 with no valid value. It accepts
+  mouse and keyboard inputs and has no step size. The default mode
+  is QwtDial::RotateNeedle.
+*/  
+QwtCompass::QwtCompass(QWidget* parent):
+    QwtDial(parent)
+{
+    d_data = new PrivateData;
+
+    setScaleOptions(ScaleLabel); // Only labels, no backbone, no ticks
+
+    setOrigin(270.0);
+    setWrapping(true);
+
+
+    d_data->labelMap.insert(0.0, QString::fromLatin1("N"));
+    d_data->labelMap.insert(45.0, QString::fromLatin1("NE"));
+    d_data->labelMap.insert(90.0, QString::fromLatin1("E"));
+    d_data->labelMap.insert(135.0, QString::fromLatin1("SE"));
+    d_data->labelMap.insert(180.0, QString::fromLatin1("S"));
+    d_data->labelMap.insert(225.0, QString::fromLatin1("SW"));
+    d_data->labelMap.insert(270.0, QString::fromLatin1("W"));
+    d_data->labelMap.insert(315.0, QString::fromLatin1("NW"));
+
+#if 0
+    d_data->labelMap.insert(22.5, QString::fromLatin1("NNE"));
+    d_data->labelMap.insert(67.5, QString::fromLatin1("NEE"));
+    d_data->labelMap.insert(112.5, QString::fromLatin1("SEE"));
+    d_data->labelMap.insert(157.5, QString::fromLatin1("SSE"));
+    d_data->labelMap.insert(202.5, QString::fromLatin1("SSW"));
+    d_data->labelMap.insert(247.5, QString::fromLatin1("SWW"));
+    d_data->labelMap.insert(292.5, QString::fromLatin1("NWW"));
+    d_data->labelMap.insert(337.5, QString::fromLatin1("NNW"));
+#endif
+}
+
+//!  Destructor
+QwtCompass::~QwtCompass() 
+{
+    delete d_data;
+}
+
+//! Draw the contents of the scale
+void QwtCompass::drawScaleContents(QPainter *painter, 
+        const QPoint &center, int radius) const
+{
+    QPalette::ColorGroup cg;
+    if ( isEnabled() )
+        cg = hasFocus() ? QPalette::Active : QPalette::Inactive;
+    else
+        cg = QPalette::Disabled;
+
+    double north = origin();
+    if ( isValid() )
+    {
+        if ( mode() == RotateScale )
+            north -= value(); 
+    }
+
+    const int margin = 4;
+    drawRose(painter, center, radius - margin, 360.0 - north,  cg);
+}
+
+/*!
+  Draw the compass rose
+  
+  \param painter Painter
+  \param center Center of the compass
+  \param radius of the circle, where to paint the rose
+  \param north Direction pointing north, in degrees counter clockwise
+  \param cg Color group
+*/
+void QwtCompass::drawRose(QPainter *painter, const QPoint &center,
+    int radius, double north, QPalette::ColorGroup cg) const
+{
+    if ( d_data->rose )
+        d_data->rose->draw(painter, center, radius, north,  cg);
+}
+
+/*!
+  Set a rose for the compass
+  \param rose Compass rose
+  \warning The rose will be deleted, when a different rose is
+    set or in ~QwtCompass
+  \sa QwtCompass::rose
+*/
+void QwtCompass::setRose(QwtCompassRose *rose)
+{
+    if ( rose != d_data->rose )
+    {
+        if ( d_data->rose )
+            delete d_data->rose;
+
+        d_data->rose = rose;
+        update();
+    }
+}
+
+/*! 
+  \return rose
+  \sa QwtCompass::setRose
+*/
+const QwtCompassRose *QwtCompass::rose() const 
+{ 
+    return d_data->rose; 
+}
+
+/*! 
+  \return rose
+  \sa QwtCompass::setRose
+*/
+QwtCompassRose *QwtCompass::rose() 
+{ 
+    return d_data->rose; 
+}
+
+/*! 
+  Handles key events
+
+  Beside the keys described in QwtDial::keyPressEvent numbers
+  from 1-9 (without 5) set the direction according to their
+  position on the num pad.
+
+  \sa isReadOnly()
+*/
+void QwtCompass::keyPressEvent(QKeyEvent *kev) 
+{
+    if (isReadOnly()) 
+        return;
+
+#if 0
+    if ( kev->key() == Key_5 )
+    {
+        invalidate(); // signal ???
+        return;
+    }
+#endif
+
+    double newValue = value();
+
+    if ( kev->key() >= Qt::Key_1 && kev->key() <= Qt::Key_9 )
+    {
+        if ( mode() != RotateNeedle || kev->key() == Qt::Key_5 )
+            return;
+
+        switch (kev->key()) 
+        {
+            case Qt::Key_6: 
+                newValue = 180.0 * 0.0;
+                break;
+            case Qt::Key_3: 
+                newValue = 180.0 * 0.25;
+                break;
+            case Qt::Key_2: 
+                newValue = 180.0 * 0.5;
+                break;
+            case Qt::Key_1: 
+                newValue = 180.0 * 0.75;
+                break;
+            case Qt::Key_4: 
+                newValue = 180.0 * 1.0;
+                break;
+            case Qt::Key_7: 
+                newValue = 180.0 * 1.25;
+                break;
+            case Qt::Key_8: 
+                newValue = 180.0 * 1.5;
+                break;
+            case Qt::Key_9: 
+                newValue = 180.0 * 1.75;
+                break;
+        }
+        newValue -= origin();
+        setValue(newValue);
+    }
+    else
+    {
+        QwtDial::keyPressEvent(kev);
+    }
+}
+
+/*!
+  \return map, mapping values to labels
+  \sa QwtCompass::setLabelMap
+*/
+const QMap<double, QString> &QwtCompass::labelMap() const 
+{ 
+    return d_data->labelMap; 
+}
+
+/*!
+  \return map, mapping values to labels
+  \sa QwtCompass::setLabelMap
+*/
+QMap<double, QString> &QwtCompass::labelMap() 
+{ 
+    return d_data->labelMap; 
+}
+
+/*!
+  \brief Set a map, mapping values to labels
+  \param map value to label map
+
+  The values of the major ticks are found by looking into this
+  map. The default map consists of the labels N, NE, E, SE, S, SW, W, NW.
+
+  \warning The map will have no effect for values that are no major
+           tick values. Major ticks can be changed by QwtScaleDraw::setScale
+
+  \sa QwtCompass::labelMap, QwtCompass::scaleDraw, QwtScaleDraw::setScale
+*/
+void QwtCompass::setLabelMap(const QMap<double, QString> &map) 
+{ 
+    d_data->labelMap = map; 
+}
+
+/*!
+  Map a value to a corresponding label
+  \param value Value that will be mapped
+  \return Label, or QString::null
+
+  label() looks in a map for a corresponding label for value
+  or return an null text.
+  \sa QwtCompass::labelMap, QwtCompass::setLabelMap
+*/
+
+QwtText QwtCompass::scaleLabel(double value) const
+{
+#if 0
+    // better solution ???
+    if ( value == -0 )
+        value = 0.0;
+#endif
+
+    if ( value < 0.0 )
+        value += 360.0;
+
+    if ( d_data->labelMap.contains(value) )
+        return d_data->labelMap[value];
+
+    return QwtText();
+}
diff --git a/src/qwt/qwt_compass_rose.cpp b/src/qwt/qwt_compass_rose.cpp
new file mode 100644
index 0000000..d7d428e
--- /dev/null
+++ b/src/qwt/qwt_compass_rose.cpp
@@ -0,0 +1,238 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <math.h>
+#include <qpainter.h>
+#include "qwt_math.h"
+#include "qwt_painter.h"
+#include "qwt_compass_rose.h"
+
+#if QT_VERSION < 0x040000
+#include <qpointarray.h>
+#define QwtPointArray QPointArray
+#else
+#include <qpolygon.h>
+#define QwtPointArray QPolygon
+#endif
+
+static QPoint cutPoint(QPoint p11, QPoint p12, QPoint p21, QPoint p22)
+{
+    double dx1 = p12.x() - p11.x();
+    double dy1 = p12.y() - p11.y();
+    double dx2 = p22.x() - p21.x();
+    double dy2 = p22.y() - p21.y();
+
+    if ( dx1 == 0.0 && dx2 == 0.0 )
+        return QPoint();
+
+    if ( dx1 == 0.0 )
+    {
+        const double m = dy2 / dx2;
+        const double t = p21.y() - m * p21.x();
+        return QPoint(p11.x(), qRound(m * p11.x() + t));
+    }
+
+    if ( dx2 == 0 )
+    {
+        const double m = dy1 / dx1;
+        const double t = p11.y() - m * p11.x();
+        return QPoint(p21.x(), qRound(m * p21.x() + t));
+    }
+
+    const double m1 = dy1 / dx1;
+    const double t1 = p11.y() - m1 * p11.x();
+
+    const double m2 = dy2 / dx2;
+    const double t2 = p21.y() - m2 * p21.x();
+
+    if ( m1 == m2 )
+        return QPoint();
+
+    const double x = ( t2 - t1 ) / ( m1 - m2 );
+    const double y = t1 + m1 * x;
+
+    return QPoint(qRound(x), qRound(y));
+}
+
+QwtSimpleCompassRose::QwtSimpleCompassRose(int numThorns, int numThornLevels):
+    d_width(0.2),
+    d_numThorns(numThorns),
+    d_numThornLevels(numThornLevels),
+    d_shrinkFactor(0.9)
+{
+    const QColor dark(128,128,255);
+    const QColor light(192,255,255);
+    
+    QPalette palette;
+    for ( int i = 0; i < QPalette::NColorGroups; i++ )
+    {
+#if QT_VERSION < 0x040000
+        palette.setColor((QPalette::ColorGroup)i,
+            QColorGroup::Dark, dark);
+        palette.setColor((QPalette::ColorGroup)i,
+            QColorGroup::Light, light);
+#else
+        palette.setColor((QPalette::ColorGroup)i,
+            QPalette::Dark, dark);
+        palette.setColor((QPalette::ColorGroup)i,
+            QPalette::Light, light);
+#endif
+    }
+
+    setPalette(palette);
+}
+
+void QwtSimpleCompassRose::draw(QPainter *painter, const QPoint &center, 
+    int radius, double north, QPalette::ColorGroup cg) const
+{
+#if QT_VERSION < 0x040000
+    QColorGroup colorGroup;
+    switch(cg)
+    {
+        case QPalette::Disabled:
+            colorGroup = palette().disabled();
+        case QPalette::Inactive:
+            colorGroup = palette().inactive();
+        default:
+            colorGroup = palette().active();
+    }
+
+    drawRose(painter, colorGroup, center, radius, north, d_width, 
+        d_numThorns, d_numThornLevels, d_shrinkFactor);
+#else
+    QPalette pal = palette();
+    pal.setCurrentColorGroup(cg);
+    drawRose(painter, pal, center, radius, north, d_width, 
+        d_numThorns, d_numThornLevels, d_shrinkFactor);
+#endif
+}
+
+void QwtSimpleCompassRose::drawRose(
+    QPainter *painter, 
+#if QT_VERSION < 0x040000
+    const QColorGroup &cg,
+#else
+    const QPalette &palette,
+#endif
+    const QPoint &center, int radius, double north, double width,
+    int numThorns, int numThornLevels, double shrinkFactor)
+{
+    if ( numThorns < 4 )
+        numThorns = 4;
+
+    if ( numThorns % 4 )
+        numThorns += 4 - numThorns % 4;
+
+    if ( numThornLevels <= 0 )
+        numThornLevels = numThorns / 4;
+
+    if ( shrinkFactor >= 1.0 )
+        shrinkFactor = 1.0;
+
+    if ( shrinkFactor <= 0.5 )
+        shrinkFactor = 0.5;
+
+    painter->save();
+
+    painter->setPen(Qt::NoPen);
+
+    for ( int j = 1; j <= numThornLevels; j++ )
+    {
+        double step =  pow(2.0, j) * M_PI / (double)numThorns;
+        if ( step > M_PI_2 )
+            break;
+
+        double r = radius;
+        for ( int k = 0; k < 3; k++ )
+        {
+            if ( j + k < numThornLevels )
+                r *= shrinkFactor;
+        }
+
+        double leafWidth = r * width;
+        if ( 2.0 * M_PI / step > 32 )
+            leafWidth = 16;
+
+        const double origin = north / 180.0 * M_PI;
+        for ( double angle = origin; 
+            angle < 2.0 * M_PI + origin; angle += step)
+        {
+            const QPoint p = qwtPolar2Pos(center, r, angle);
+            QPoint p1 = qwtPolar2Pos(center, leafWidth, angle + M_PI_2);
+            QPoint p2 = qwtPolar2Pos(center, leafWidth, angle - M_PI_2);
+
+            QwtPointArray pa(3);
+            pa.setPoint(0, center);
+            pa.setPoint(1, p);
+
+            QPoint p3 = qwtPolar2Pos(center, r, angle + step / 2.0);
+            p1 = cutPoint(center, p3, p1, p);
+            pa.setPoint(2, p1);
+#if QT_VERSION < 0x040000
+            painter->setBrush(cg.brush(QColorGroup::Dark));
+#else
+            painter->setBrush(palette.brush(QPalette::Dark));
+#endif
+            painter->drawPolygon(pa);
+
+            QPoint p4 = qwtPolar2Pos(center, r, angle - step / 2.0);
+            p2 = cutPoint(center, p4, p2, p);
+
+            pa.setPoint(2, p2);
+#if QT_VERSION < 0x040000
+            painter->setBrush(cg.brush(QColorGroup::Light));
+#else
+            painter->setBrush(palette.brush(QPalette::Light));
+#endif
+            painter->drawPolygon(pa);
+        }
+    }
+    painter->restore();
+}
+
+/**
+* Set the width of the rose heads. Lower value make thinner heads.
+* The range is limited from 0.03 to 0.4.
+*/
+
+void QwtSimpleCompassRose::setWidth(double w) 
+{
+   d_width = w;
+   if (d_width < 0.03) 
+        d_width = 0.03;
+
+   if (d_width > 0.4) 
+        d_width = 0.4;
+}
+
+void QwtSimpleCompassRose::setNumThorns(int numThorns) 
+{
+    if ( numThorns < 4 )
+        numThorns = 4;
+
+    if ( numThorns % 4 )
+        numThorns += 4 - numThorns % 4;
+
+    d_numThorns = numThorns;
+}
+
+int QwtSimpleCompassRose::numThorns() const
+{
+   return d_numThorns;
+}
+
+void QwtSimpleCompassRose::setNumThornLevels(int numThornLevels) 
+{
+    d_numThornLevels = numThornLevels;
+}
+
+int QwtSimpleCompassRose::numThornLevels() const
+{
+    return d_numThornLevels;
+}
diff --git a/src/qwt/qwt_counter.cpp b/src/qwt/qwt_counter.cpp
new file mode 100644
index 0000000..3cf0920
--- /dev/null
+++ b/src/qwt/qwt_counter.cpp
@@ -0,0 +1,603 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qvalidator.h>
+#include <qevent.h>
+#include <qstyle.h>
+#include "qwt_math.h"
+#include "qwt_counter.h"
+#include "qwt_arrow_button.h"
+
+class QwtCounter::PrivateData
+{
+public:
+    PrivateData():
+        editable(true)
+    {
+        increment[Button1] = 1;
+        increment[Button2] = 10;
+        increment[Button3] = 100;
+    }
+
+    QwtArrowButton *buttonDown[ButtonCnt];
+    QwtArrowButton *buttonUp[ButtonCnt];
+    QLineEdit *valueEdit;
+
+    int increment[ButtonCnt];
+    int nButtons;
+
+    bool editable;
+};
+
+/*!
+  The default number of buttons is set to 2. The default increments are:
+  \li Button 1: 1 step
+  \li Button 2: 10 steps
+  \li Button 3: 100 steps
+
+  \param parent
+ */
+QwtCounter::QwtCounter(QWidget *parent):
+    QWidget(parent) 
+{
+    d_data = new PrivateData;
+
+#if QT_VERSION >= 0x040000
+    using namespace Qt;
+#endif
+
+    QHBoxLayout *layout = new QHBoxLayout(this);
+    layout->setSpacing(0);
+    layout->setMargin(0);
+
+    int i;
+    for(i = ButtonCnt - 1; i >= 0; i--)
+    {
+        QwtArrowButton *btn =
+            new QwtArrowButton(i+1, Qt::DownArrow,this);
+        btn->setFocusPolicy(NoFocus);
+        btn->installEventFilter(this);
+        layout->addWidget(btn);
+
+        connect(btn, SIGNAL(released()), SLOT(btnReleased()));
+        connect(btn, SIGNAL(clicked()), SLOT(btnClicked()));
+
+        d_data->buttonDown[i] = btn;
+    }
+
+    d_data->valueEdit = new QLineEdit(this);
+    d_data->valueEdit->setReadOnly(false);
+    d_data->valueEdit->setValidator(new QDoubleValidator(d_data->valueEdit));
+    layout->addWidget(d_data->valueEdit);
+
+#if QT_VERSION >= 0x040000
+    connect( d_data->valueEdit, SIGNAL(editingFinished()), 
+        SLOT(textChanged()) );
+#else
+    connect( d_data->valueEdit, SIGNAL(returnPressed()), SLOT(textChanged()) );
+    connect( d_data->valueEdit, SIGNAL(lostFocus()), SLOT(textChanged()) );
+#endif
+
+    layout->setStretchFactor(d_data->valueEdit, 10);
+
+    for(i = 0; i < ButtonCnt; i++)
+    {
+#if QT_VERSION >= 0x040000
+        using namespace Qt;
+#endif
+        QwtArrowButton *btn =
+            new QwtArrowButton(i+1, Qt::UpArrow, this);
+        btn->setFocusPolicy(NoFocus);
+        btn->installEventFilter(this);
+        layout->addWidget(btn);
+
+        connect(btn, SIGNAL(released()), SLOT(btnReleased()));
+        connect(btn, SIGNAL(clicked()), SLOT(btnClicked()));
+    
+        d_data->buttonUp[i] = btn;
+    }
+
+    setNumButtons(2);
+    setRange(0.0,1.0,0.001);
+    setValue(0.0);
+
+    setSizePolicy(
+        QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
+
+    setFocusProxy(d_data->valueEdit);
+    setFocusPolicy(StrongFocus);
+}
+
+QwtCounter::~QwtCounter()
+{
+    delete d_data;
+}
+
+/*!
+  Sets the minimum width for the buttons
+*/
+void QwtCounter::polish()
+{
+    const int w = d_data->valueEdit->fontMetrics().width("W") + 8;
+
+    for ( int i = 0; i < ButtonCnt; i++ )
+    {
+        d_data->buttonDown[i]->setMinimumWidth(w);
+        d_data->buttonUp[i]->setMinimumWidth(w);
+    }
+
+#if QT_VERSION < 0x040000
+    QWidget::polish();
+#endif
+}
+
+//! Set from lineedit
+void QwtCounter::textChanged() 
+{
+    if ( !d_data->editable ) 
+        return;
+
+    bool converted = false;
+
+    const double value = d_data->valueEdit->text().toDouble(&converted);
+    if ( converted ) 
+       setValue( value );
+}
+
+/**
+  \brief Allow/disallow the user to manually edit the value
+
+  \param editable true enables editing
+  \sa editable()
+*/
+void QwtCounter::setEditable(bool editable)
+{
+#if QT_VERSION >= 0x040000
+    using namespace Qt;
+#endif
+    if ( editable == d_data->editable ) 
+        return;
+
+    d_data->editable = editable;
+    d_data->valueEdit->setReadOnly(!editable);
+}
+
+//! returns whether the line edit is edatble. (default is yes)
+bool QwtCounter::editable() const 
+{   
+    return d_data->editable;
+}
+
+/*!
+   Handle PolishRequest events 
+*/
+bool QwtCounter::event ( QEvent * e ) 
+{
+#if QT_VERSION >= 0x040000
+    if ( e->type() == QEvent::PolishRequest )
+        polish();
+#endif
+    return QWidget::event(e);
+}
+
+/*!
+  Handles key events
+
+  - Ctrl + Qt::Key_Home
+    Step to minValue()
+  - Ctrl + Qt::Key_End
+    Step to maxValue()
+  - Qt::Key_Up
+    Increment by incSteps(QwtCounter::Button1)
+  - Qt::Key_Down
+    Decrement by incSteps(QwtCounter::Button1)
+  - Qt::Key_PageUp
+    Increment by incSteps(QwtCounter::Button2)
+  - Qt::Key_PageDown
+    Decrement by incSteps(QwtCounter::Button2)
+  - Shift + Qt::Key_PageUp
+    Increment by incSteps(QwtCounter::Button3)
+  - Shift + Qt::Key_PageDown
+    Decrement by incSteps(QwtCounter::Button3)
+*/
+
+void QwtCounter::keyPressEvent (QKeyEvent *e)
+{
+    bool accepted = true;
+
+    switch ( e->key() )
+    {
+        case Qt::Key_Home:
+#if QT_VERSION >= 0x040000
+            if ( e->modifiers() & Qt::ControlModifier )
+#else
+            if ( e->state() & Qt::ControlButton )
+#endif
+                setValue(minValue());
+            else
+                accepted = false;
+            break;
+        case Qt::Key_End:
+#if QT_VERSION >= 0x040000
+            if ( e->modifiers() & Qt::ControlModifier )
+#else
+            if ( e->state() & Qt::ControlButton )
+#endif
+                setValue(maxValue());
+            else
+                accepted = false;
+            break;
+        case Qt::Key_Up:
+            incValue(d_data->increment[0]);
+            break;
+        case Qt::Key_Down:
+            incValue(-d_data->increment[0]);
+            break;
+        case Qt::Key_PageUp:
+        case Qt::Key_PageDown:
+        {
+            int increment = d_data->increment[0];
+            if ( d_data->nButtons >= 2 )
+                increment = d_data->increment[1];
+            if ( d_data->nButtons >= 3 )
+            {
+#if QT_VERSION >= 0x040000
+                if ( e->modifiers() & Qt::ShiftModifier )
+#else
+                if ( e->state() & Qt::ShiftButton )
+#endif
+                    increment = d_data->increment[2];
+            }
+            if ( e->key() == Qt::Key_PageDown )
+                increment = -increment;
+            incValue(increment);
+            break;
+        }
+        default:
+            accepted = false;
+    }
+
+    if ( accepted )
+    {
+        e->accept();
+        return;
+    }
+
+    QWidget::keyPressEvent (e);
+}
+
+void QwtCounter::wheelEvent(QWheelEvent *e)
+{
+    e->accept();
+
+    if ( d_data->nButtons <= 0 )
+        return;
+
+    int increment = d_data->increment[0];
+    if ( d_data->nButtons >= 2 )
+    {
+#if QT_VERSION >= 0x040000
+        if ( e->modifiers() & Qt::ControlModifier )
+#else
+        if ( e->state() & Qt::ControlButton )
+#endif
+            increment = d_data->increment[1];
+    }
+    if ( d_data->nButtons >= 3 )
+    {
+#if QT_VERSION >= 0x040000
+        if ( e->modifiers() & Qt::ShiftModifier )
+#else
+        if ( e->state() & Qt::ShiftButton )
+#endif
+            increment = d_data->increment[2];
+    }
+        
+    for ( int i = 0; i < d_data->nButtons; i++ )
+    {
+        if ( d_data->buttonDown[i]->geometry().contains(e->pos()) ||
+            d_data->buttonUp[i]->geometry().contains(e->pos()) )
+        {
+            increment = d_data->increment[i];
+        }
+    }
+
+    const int wheel_delta = 120;
+
+    int delta = e->delta();
+    if ( delta >= 2 * wheel_delta )
+        delta /= 2; // Never saw an abs(delta) < 240
+
+    incValue(delta / wheel_delta * increment);
+}
+
+/*!
+  Specify the number of steps by which the value
+  is incremented or decremented when a specified button
+  is pushed.
+
+  \param btn One of \c QwtCounter::Button1, \c QwtCounter::Button2,
+             \c QwtCounter::Button3
+  \param nSteps Number of steps
+*/
+void QwtCounter::setIncSteps(QwtCounter::Button btn, int nSteps)
+{
+    if (( btn >= 0) && (btn < ButtonCnt))
+       d_data->increment[btn] = nSteps;
+}
+
+/*!
+  \return the number of steps by which a specified button increments the value
+  or 0 if the button is invalid.
+  \param btn One of \c QwtCounter::Button1, \c QwtCounter::Button2,
+  \c QwtCounter::Button3
+*/
+int QwtCounter::incSteps(QwtCounter::Button btn) const
+{
+    if (( btn >= 0) && (btn < ButtonCnt))
+       return d_data->increment[btn];
+
+    return 0;
+}
+
+/*!
+  \brief Set a new value
+  \param v new value
+  Calls QwtDoubleRange::setValue and does all visual updates.
+  \sa QwtDoubleRange::setValue
+*/
+
+void QwtCounter::setValue(double v)
+{
+    QwtDoubleRange::setValue(v);
+
+    showNum(value());
+    updateButtons();
+}
+
+/*!
+  \brief Notify a change of value
+*/
+void QwtCounter::valueChange()
+{
+    if ( isValid() )
+        showNum(value());
+    else
+        d_data->valueEdit->setText(QString::null);
+
+    updateButtons();
+
+    if ( isValid() )
+        emit valueChanged(value());
+}
+
+/*!
+  \brief Update buttons according to the current value
+
+  When the QwtCounter under- or over-flows, the focus is set to the smallest
+  up- or down-button and counting is disabled.
+
+  Counting is re-enabled on a button release event (mouse or space bar).
+*/
+void QwtCounter::updateButtons()
+{
+    if ( isValid() )
+    {
+        // 1. save enabled state of the smallest down- and up-button
+        // 2. change enabled state on under- or over-flow
+
+        for ( int i = 0; i < ButtonCnt; i++ )
+        {
+            d_data->buttonDown[i]->setEnabled(value() > minValue());
+            d_data->buttonUp[i]->setEnabled(value() < maxValue());
+        }
+    }
+    else
+    {
+        for ( int i = 0; i < ButtonCnt; i++ )
+        {
+            d_data->buttonDown[i]->setEnabled(false);
+            d_data->buttonUp[i]->setEnabled(false);
+        }
+    }
+}
+
+/*!
+  \brief Specify the number of buttons on each side of the label
+  \param n Number of buttons
+*/
+void QwtCounter::setNumButtons(int n)
+{
+    if ( n<0 || n>ButtonCnt )
+        return;
+
+    for ( int i = 0; i < ButtonCnt; i++ )
+    {
+        if ( i < n )
+        {
+            d_data->buttonDown[i]->show();
+            d_data->buttonUp[i]->show();
+        }
+        else
+        {
+            d_data->buttonDown[i]->hide();
+            d_data->buttonUp[i]->hide();
+        }
+    }
+
+    d_data->nButtons = n;
+}
+
+/*!
+    \return The number of buttons on each side of the widget.
+*/
+int QwtCounter::numButtons() const 
+{ 
+    return d_data->nButtons; 
+}
+
+//!  Display number string
+void QwtCounter::showNum(double d)
+{
+    QString v;
+    v.setNum(d);
+
+    const int cursorPos = d_data->valueEdit->cursorPosition();
+    d_data->valueEdit->setText(v);
+    d_data->valueEdit->setCursorPosition(cursorPos);
+}
+
+//!  Button clicked
+void QwtCounter::btnClicked()
+{
+    for ( int i = 0; i < ButtonCnt; i++ )
+    {
+        if ( d_data->buttonUp[i] == sender() )
+            incValue(d_data->increment[i]);
+
+        if ( d_data->buttonDown[i] == sender() )
+            incValue(-d_data->increment[i]);
+    }
+}
+
+//!  Button released
+void QwtCounter::btnReleased()
+{
+    emit buttonReleased(value());
+}
+
+/*!
+  \brief Notify change of range
+
+  This function updates the enabled property of
+  all buttons contained in QwtCounter.
+*/
+void QwtCounter::rangeChange()
+{
+    updateButtons();
+}
+
+//! A size hint
+QSize QwtCounter::sizeHint() const
+{
+    QString tmp;
+
+    int w = tmp.setNum(minValue()).length();
+    int w1 = tmp.setNum(maxValue()).length();
+    if ( w1 > w )
+        w = w1;
+    w1 = tmp.setNum(minValue() + step()).length();
+    if ( w1 > w )
+        w = w1;
+    w1 = tmp.setNum(maxValue() - step()).length();
+    if ( w1 > w )
+        w = w1;
+
+    tmp.fill('9', w);
+
+    QFontMetrics fm(d_data->valueEdit->font());
+    w = fm.width(tmp) + 2;
+#if QT_VERSION >= 0x040000
+    if ( d_data->valueEdit->hasFrame() )
+        w += 2 * style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
+#else
+    w += 2 * d_data->valueEdit->frameWidth(); 
+#endif
+
+    // Now we replace default sizeHint contribution of d_data->valueEdit by
+    // what we really need.
+
+    w += QWidget::sizeHint().width() - d_data->valueEdit->sizeHint().width();
+
+    const int h = qwtMin(QWidget::sizeHint().height(), 
+        d_data->valueEdit->minimumSizeHint().height());
+    return QSize(w, h);
+}
+
+//! returns the step size
+double QwtCounter::step() const
+{
+    return QwtDoubleRange::step();
+}
+    
+//! sets the step size
+void QwtCounter::setStep(double s)
+{
+    QwtDoubleRange::setStep(s);
+}
+
+//! returns the minimum value of the range
+double QwtCounter::minVal() const
+{
+    return minValue();
+}
+
+//! sets the minimum value of the range
+void QwtCounter::setMinValue(double m)
+{
+    setRange(m, maxValue(), step());
+}
+
+//! returns the maximum value of the range
+double QwtCounter::maxVal() const
+{
+    return QwtDoubleRange::maxValue();
+}
+
+//! sets the maximum value of the range
+void QwtCounter::setMaxValue(double m)
+{
+    setRange(minValue(), m, step());
+}
+
+//! set the number of increment steps for button 1
+void QwtCounter::setStepButton1(int nSteps)
+{
+    setIncSteps(Button1, nSteps);
+}
+
+//! returns the number of increment steps for button 1
+int QwtCounter::stepButton1() const
+{
+    return incSteps(Button1);
+}
+
+//! set the number of increment steps for button 2
+void QwtCounter::setStepButton2(int nSteps)
+{
+    setIncSteps(Button2, nSteps);
+}
+
+//! returns the number of increment steps for button 2
+int QwtCounter::stepButton2() const
+{
+    return incSteps(Button2);
+}
+
+//! set the number of increment steps for button 3
+void QwtCounter::setStepButton3(int nSteps)
+{
+    setIncSteps(Button3, nSteps);
+}
+
+//! returns the number of increment steps for button 3
+int QwtCounter::stepButton3() const
+{
+    return incSteps(Button3);
+}
+
+double QwtCounter::value() const
+{
+    return QwtDoubleRange::value();
+}
+
diff --git a/src/qwt/qwt_data.cpp b/src/qwt/qwt_data.cpp
new file mode 100644
index 0000000..55fb4f1
--- /dev/null
+++ b/src/qwt/qwt_data.cpp
@@ -0,0 +1,294 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_math.h"
+#include "qwt_data.h"
+
+QwtData::QwtData()
+{
+}
+
+QwtData::~QwtData()
+{
+}
+
+/*!
+  Returns the bounding rectangle of the data. If there is
+  no bounding rect, like for empty data the rectangle is invalid:
+  QwtDoubleRect::isValid() == false
+
+  \warning This is an slow implementation iterating over all points. 
+           It is intended to be overloaded by derived classes. In case of
+           auto scaling boundingRect() is called for every replot, so it 
+           might be worth to implement a cache, or use x(0), x(size() - 1)
+           for ordered data ...
+*/
+QwtDoubleRect QwtData::boundingRect() const
+{
+    const size_t sz = size();
+
+    if ( sz <= 0 )
+        return QwtDoubleRect(1.0, 1.0, -2.0, -2.0); // invalid
+
+    double minX, maxX, minY, maxY;
+    minX = maxX = x(0);
+    minY = maxY = y(0);
+
+    for ( size_t i = 1; i < sz; i++ )
+    {
+        const double xv = x(i);
+        if ( xv < minX )
+            minX = xv;
+        if ( xv > maxX )
+            maxX = xv;
+
+        const double yv = y(i);
+        if ( yv < minY )
+            minY = yv;
+        if ( yv > maxY )
+            maxY = yv;
+    }
+    return QwtDoubleRect(minX, minY, maxX - minX, maxY - minY);
+}
+
+QwtDoublePointData::QwtDoublePointData(const QwtArray<QwtDoublePoint> &data):
+    d_data(data)
+{
+}
+
+//! Assignment 
+QwtDoublePointData& QwtDoublePointData::operator=(
+    const QwtDoublePointData &data)
+{
+    if (this != &data)
+    {
+        d_data = data.d_data;
+    }
+    return *this;
+}
+
+size_t QwtDoublePointData::size() const 
+{ 
+    return d_data.size(); 
+}
+
+double QwtDoublePointData::x(size_t i) const 
+{ 
+    return d_data[int(i)].x(); 
+}
+
+double QwtDoublePointData::y(size_t i) const 
+{ 
+    return d_data[int(i)].y(); 
+}
+
+const QwtArray<QwtDoublePoint> QwtDoublePointData::data() const
+{
+    return d_data;
+}
+
+QwtData *QwtDoublePointData::copy() const 
+{ 
+    return new QwtDoublePointData(d_data); 
+}
+
+/*!
+  Constructor
+  
+  \sa QwtCurve::setData and QwtPlot::setCurveData.
+*/
+QwtArrayData::QwtArrayData(
+        const QwtArray<double> &x, const QwtArray<double> &y): 
+    d_x(x), 
+    d_y(y)
+{
+}
+
+/*!
+  Constructor
+  
+  \sa QwtCurve::setData and QwtPlot::setCurveData.
+*/
+QwtArrayData::QwtArrayData(const double *x, const double *y, size_t size)
+{
+#if QT_VERSION >= 0x040000
+    d_x.resize(size);
+    qMemCopy(d_x.data(), x, size * sizeof(double));
+
+    d_y.resize(size);
+    qMemCopy(d_y.data(), y, size * sizeof(double));
+#else
+    d_x.detach();
+    d_x.duplicate(x, size);
+
+    d_y.detach();
+    d_y.duplicate(y, size);
+#endif
+}
+
+//! Assignment 
+QwtArrayData& QwtArrayData::operator=(const QwtArrayData &data)
+{
+    if (this != &data)
+    {
+        d_x = data.d_x;
+        d_y = data.d_y;
+    }
+    return *this;
+}
+
+size_t QwtArrayData::size() const 
+{ 
+    return qwtMin(d_x.size(), d_y.size()); 
+}
+
+double QwtArrayData::x(size_t i) const 
+{ 
+    return d_x[int(i)]; 
+}
+
+double QwtArrayData::y(size_t i) const 
+{ 
+    return d_y[int(i)]; 
+}
+
+const QwtArray<double> &QwtArrayData::xData() const
+{
+    return d_x;
+}
+
+const QwtArray<double> &QwtArrayData::yData() const
+{
+    return d_y;
+}
+
+QwtData *QwtArrayData::copy() const 
+{ 
+    return new QwtArrayData(d_x, d_y); 
+}
+
+/*!
+  Returns the bounding rectangle of the data. If there is
+  no bounding rect, like for empty data the rectangle is invalid:
+  QwtDoubleRect::isValid() == false
+*/
+QwtDoubleRect QwtArrayData::boundingRect() const
+{
+    const size_t sz = size();
+
+    if ( sz <= 0 )
+        return QwtDoubleRect(1.0, 1.0, -2.0, -2.0); // invalid
+
+    double minX, maxX, minY, maxY;
+    QwtArray<double>::ConstIterator xIt = d_x.begin();
+    QwtArray<double>::ConstIterator yIt = d_y.begin();
+    QwtArray<double>::ConstIterator end = d_x.begin() + sz;
+    minX = maxX = *xIt++;
+    minY = maxY = *yIt++;
+
+    while ( xIt < end )
+    {
+        const double xv = *xIt++;
+        if ( xv < minX )
+            minX = xv;
+        if ( xv > maxX )
+            maxX = xv;
+
+        const double yv = *yIt++;
+        if ( yv < minY )
+            minY = yv;
+        if ( yv > maxY )
+            maxY = yv;
+    }
+    return QwtDoubleRect(minX, minY, maxX - minX, maxY - minY);
+}
+
+QwtCPointerData::QwtCPointerData(const double *x, const double *y,
+                                 size_t size):
+    d_x(x), d_y(y), d_size(size)
+{
+}
+
+//! Assignment 
+QwtCPointerData& QwtCPointerData::operator=(const QwtCPointerData &data)
+{
+    if (this != &data)
+    {
+        d_x = data.d_x;
+        d_y = data.d_y;
+        d_size = data.d_size;
+    }
+    return *this;
+}
+
+size_t QwtCPointerData::size() const 
+{   
+    return d_size; 
+}
+
+double QwtCPointerData::x(size_t i) const 
+{ 
+    return d_x[int(i)]; 
+}
+
+double QwtCPointerData::y(size_t i) const 
+{ 
+    return d_y[int(i)]; 
+}
+
+const double *QwtCPointerData::xData() const
+{
+    return d_x;
+}
+
+const double *QwtCPointerData::yData() const
+{
+    return d_y;
+}
+
+QwtData *QwtCPointerData::copy() const 
+{
+    return new QwtCPointerData(d_x, d_y, d_size);
+}
+
+/*!
+  Returns the bounding rectangle of the data. If there is
+  no bounding rect, like for empty data the rectangle is invalid:
+  QwtDoubleRect::isValid() == false
+*/
+QwtDoubleRect QwtCPointerData::boundingRect() const
+{
+    const size_t sz = size();
+
+    if ( sz <= 0 )
+        return QwtDoubleRect(1.0, 1.0, -2.0, -2.0); // invalid
+
+    double minX, maxX, minY, maxY;
+    const double *xIt = d_x;
+    const double *yIt = d_y;
+    const double *end = d_x + sz;
+    minX = maxX = *xIt++;
+    minY = maxY = *yIt++;
+
+    while ( xIt < end )
+    {
+        const double xv = *xIt++;
+        if ( xv < minX )
+            minX = xv;
+        if ( xv > maxX )
+            maxX = xv;
+
+        const double yv = *yIt++;
+        if ( yv < minY )
+            minY = yv;
+        if ( yv > maxY )
+            maxY = yv;
+    }
+    return QwtDoubleRect(minX, minY, maxX - minX, maxY - minY);
+}
diff --git a/src/qwt/qwt_dial.cpp b/src/qwt/qwt_dial.cpp
new file mode 100644
index 0000000..0ee9ed1
--- /dev/null
+++ b/src/qwt/qwt_dial.cpp
@@ -0,0 +1,1216 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <math.h>
+#include <qpainter.h>
+#if QT_VERSION >= 0x040000
+#include <qpaintengine.h>
+#include <qbitmap.h>
+#include <qpalette.h>
+#endif
+#include <qpixmap.h>
+#include <qevent.h>
+#include "qwt_math.h"
+#include "qwt_scale_engine.h"
+#include "qwt_scale_map.h"
+#include "qwt_paint_buffer.h"
+#include "qwt_painter.h"
+#include "qwt_dial_needle.h"
+#include "qwt_dial.h"
+
+#if QT_VERSION >= 0x040000
+static void setAntialiasing(QPainter *painter, bool on)
+{
+    QPaintEngine *engine = painter->paintEngine();
+    if ( engine && engine->hasFeature(QPaintEngine::Antialiasing) )
+        painter->setRenderHint(QPainter::Antialiasing, on);
+}
+#else
+static void setAntialiasing(QPainter *, bool)
+{
+}
+#endif
+
+class QwtDial::PrivateData
+{
+public:
+    PrivateData():
+        visibleBackground(true),
+        frameShadow(Sunken),
+        lineWidth(0),
+        mode(RotateNeedle),
+        origin(90.0),
+        minScaleArc(0.0),
+        maxScaleArc(0.0),
+        scaleDraw(0),
+        maxMajIntv(36),
+        maxMinIntv(10),
+        scaleStep(0.0),
+        needle(0)
+    {
+    }
+
+    ~PrivateData()
+    {
+        delete scaleDraw;
+        delete needle;
+    }
+    bool visibleBackground;
+    Shadow frameShadow;
+    int lineWidth;
+
+    QwtDial::Mode mode;
+
+    double origin;
+    double minScaleArc;
+    double maxScaleArc;
+
+    QwtDialScaleDraw *scaleDraw;
+    int maxMajIntv;
+    int maxMinIntv;
+    double scaleStep;
+
+    QwtDialNeedle *needle;
+
+    static double previousDir;
+};
+
+double QwtDial::PrivateData::previousDir = -1.0;
+
+/*!
+  Constructor
+
+  \param parent Parent dial widget
+*/
+QwtDialScaleDraw::QwtDialScaleDraw(QwtDial *parent):
+    d_parent(parent),
+    d_penWidth(1)
+{
+}
+
+/*!
+  Set the pen width used for painting the scale
+
+  \param penWidth Pen width
+  \sa penWidth(), QwtDial::drawScale()
+*/
+    
+void QwtDialScaleDraw::setPenWidth(uint penWidth)
+{
+    d_penWidth = penWidth;
+}
+
+/*!
+  \return Pen width used for painting the scale
+  \sa setPenWidth, QwtDial::drawScale()
+*/
+uint QwtDialScaleDraw::penWidth() const
+{
+    return d_penWidth;
+}
+
+/*! 
+  Call QwtDial::scaleLabel of the parent dial widget.
+
+  \param value Value to display
+    
+  \sa QwtDial::scaleLabel
+*/  
+QwtText QwtDialScaleDraw::label(double value) const
+{
+    if ( d_parent == NULL )
+        return QwtRoundScaleDraw::label(value);
+
+    return d_parent->scaleLabel(value);
+}
+
+/*!
+  \brief Constructor
+  \param parent Parent widget
+
+  Create a dial widget with no scale and no needle. 
+  The default origin is 90.0 with no valid value. It accepts
+  mouse and keyboard inputs and has no step size. The default mode
+  is QwtDial::RotateNeedle.
+*/  
+
+QwtDial::QwtDial(QWidget* parent):
+    QwtAbstractSlider(Qt::Horizontal, parent)
+{
+    d_data = new PrivateData;
+
+#if QT_VERSION < 0x040000
+    setWFlags(Qt::WNoAutoErase);
+#endif 
+
+#if QT_VERSION >= 0x040000
+    using namespace Qt;
+#endif
+    setFocusPolicy(TabFocus);
+
+    QPalette p = palette();
+    for ( int i = 0; i < QPalette::NColorGroups; i++ )
+    {
+        const QPalette::ColorGroup cg = (QPalette::ColorGroup)i;
+
+        // Base: background color of the circle inside the frame.
+        // Foreground: background color of the circle inside the scale
+
+#if QT_VERSION < 0x040000
+        p.setColor(cg, QColorGroup::Foreground, 
+            p.color(cg, QColorGroup::Base));
+#else
+        p.setColor(cg, QPalette::Foreground, 
+            p.color(cg, QPalette::Base));
+#endif
+    }
+    setPalette(p);
+
+    d_data->scaleDraw = new QwtDialScaleDraw(this);
+    d_data->scaleDraw->setRadius(0);
+
+    setScaleArc(0.0, 360.0); // scale as a full circle
+    setRange(0.0, 360.0, 1.0, 10); // degrees as deafult
+}
+
+//!  Destructor
+QwtDial::~QwtDial() 
+{
+    delete d_data;
+}
+
+/*!
+  Show/Hide the area outside of the frame
+  \param show Show if true, hide if false
+
+  \sa QwtDial::hasVisibleBackground, QWidget::setMask
+  \warning When QwtDial is a toplevel widget the window
+           border might disappear too.
+*/
+void QwtDial::showBackground(bool show)
+{
+    if ( d_data->visibleBackground != show )
+    {
+        d_data->visibleBackground = show;
+        updateMask();
+    }
+}
+
+/*!
+  true when the area outside of the frame is visible
+
+  \sa QwtDial::showBackground, QWidget::setMask
+*/
+bool QwtDial::hasVisibleBackground() const 
+{ 
+    return d_data->visibleBackground; 
+}
+
+/*!
+  Sets the frame shadow value from the frame style.
+  \param shadow Frame shadow
+  \sa QwtDial::setLineWidth, QFrame::setFrameShadow
+*/
+void QwtDial::setFrameShadow(Shadow shadow)
+{
+    if ( shadow != d_data->frameShadow )
+    {
+        d_data->frameShadow = shadow;
+        if ( lineWidth() > 0 )
+            update();
+    }
+}
+
+/*!
+  \return Frame shadow
+  /sa QwtDial::setFrameShadow, QwtDial::lineWidth, 
+      QFrame::frameShadow
+*/
+QwtDial::Shadow QwtDial::frameShadow() const 
+{ 
+    return d_data->frameShadow; 
+}
+
+/*!
+  Sets the line width
+
+  \param lineWidth Line width
+  \sa QwtDial::setFrameShadow
+*/
+void QwtDial::setLineWidth(int lineWidth)
+{
+    if ( lineWidth < 0 )
+        lineWidth = 0;
+
+    if ( d_data->lineWidth != lineWidth )
+    {
+        d_data->lineWidth = lineWidth;
+        update();
+    }
+}
+
+/*!
+  \return Line width of the frame
+  \sa QwtDial::setLineWidth, QwtDial::frameShadow, 
+      QFrame::lineWidth
+*/
+int QwtDial::lineWidth() const 
+{ 
+    return d_data->lineWidth; 
+}
+
+/*!
+  \return bounding rect of the circle inside the frame
+  \sa QwtDial::setLineWidth, QwtDial::scaleContentsRect, QwtDial::boundingRect
+*/
+QRect QwtDial::contentsRect() const
+{
+    const int lw = lineWidth();
+
+    QRect r = boundingRect();
+    if ( lw > 0 )
+    {
+        r.setRect(r.x() + lw, r.y() + lw, 
+            r.width() - 2 * lw, r.height() - 2 * lw);
+    }
+    return r;
+}
+
+/*!
+  \return bounding rect of the dial including the frame
+  \sa QwtDial::setLineWidth, QwtDial::scaleContentsRect, QwtDial::contentsRect
+*/
+QRect QwtDial::boundingRect() const
+{
+    const int radius = qwtMin(width(), height()) / 2;
+
+    QRect r(0, 0, 2 * radius, 2 * radius);
+    r.moveCenter(rect().center());
+    return r;
+}
+
+/*!
+  \return rect inside the scale
+  \sa setLineWidth, QwtDial::boundingRect, QwtDial::contentsRect
+*/
+QRect QwtDial::scaleContentsRect() const
+{
+#if QT_VERSION < 0x040000
+    const QPen scalePen(colorGroup().text(), 0, Qt::NoPen);
+#else
+    const QPen scalePen(palette().text(), 0, Qt::NoPen);
+#endif
+
+    int scaleDist = 0;
+    if ( d_data->scaleDraw )
+    {
+        scaleDist = d_data->scaleDraw->extent(scalePen, font());
+        scaleDist++; // margin
+    }
+
+    const QRect rect = contentsRect();
+    return QRect(rect.x() + scaleDist, rect.y() + scaleDist,
+        rect.width() - 2 * scaleDist, rect.height() - 2 * scaleDist);
+}
+
+/*!
+  \brief Change the mode of the meter.
+  \param mode New mode 
+    
+  The value of the meter is indicated by the difference
+  between north of the scale and the direction of the needle.
+  In case of QwtDial::RotateNeedle north is pointing
+  to the origin() and the needle is rotating, in case of
+  QwtDial::RotateScale, the needle points to origin()
+  and the scale is rotating.
+    
+  The default mode is QwtDial::RotateNeedle.
+
+  \sa QwtDial::mode, QwtDial::setValue, QwtDial::setOrigin
+*/  
+void QwtDial::setMode(Mode mode)
+{   
+    if ( mode != d_data->mode )
+    {
+        d_data->mode = mode;
+        update(); 
+    }
+}       
+
+/*! 
+  \return mode of the dial.
+    
+  The value of the dial is indicated by the difference
+  between the origin and the direction of the needle.
+  In case of QwtDial::RotateNeedle the scale arc is fixed
+  to the origin() and the needle is rotating, in case of
+  QwtDial::RotateScale, the needle points to origin()
+  and the scale is rotating.
+ 
+  The default mode is QwtDial::RotateNeedle.
+
+  \sa QwtDial::setMode, QwtDial::origin, QwtDial::setScaleArc, QwtDial::value
+*/
+QwtDial::Mode QwtDial::mode() const
+{
+    return d_data->mode;
+}
+
+/*! 
+    Sets whether it is possible to step the value from the highest value to 
+    the lowest value and vice versa to on.
+
+    \param wrapping en/disables wrapping
+
+    \sa QwtDial::wrapping, QwtDoubleRange::periodic
+    \note The meaning of wrapping is like the wrapping property of QSpinBox,
+          but not like it is used in QDial. 
+*/
+void QwtDial::setWrapping(bool wrapping)
+{
+    setPeriodic(wrapping);
+} 
+
+/*! 
+    wrapping() holds whether it is possible to step the value from the 
+    highest value to the lowest value and vice versa. 
+
+    \sa QwtDial::setWrapping, QwtDoubleRange::setPeriodic
+    \note The meaning of wrapping is like the wrapping property of QSpinBox,
+          but not like it is used in QDial. 
+*/ 
+bool QwtDial::wrapping() const
+{
+    return periodic();
+}
+
+//! Resize the dial widget
+void QwtDial::resizeEvent(QResizeEvent *e)
+{
+    QWidget::resizeEvent(e);
+
+    if ( !hasVisibleBackground() )
+        updateMask();
+}
+
+//! Repaint the dial 
+void QwtDial::paintEvent(QPaintEvent *e)
+{
+    const QRect &ur = e->rect();
+    if ( ur.isValid() )
+    {
+#if QT_VERSION < 0x040000
+        QwtPaintBuffer paintBuffer(this, ur);
+        QPainter &painter = *paintBuffer.painter();
+#else
+        QPainter painter(this);
+#endif
+
+        setAntialiasing(&painter, true);
+
+        painter.save();
+        drawContents(&painter);
+        painter.restore();
+
+        painter.save();
+        drawFrame(&painter);
+        painter.restore();
+
+        if ( hasFocus() )
+            drawFocusIndicator(&painter);
+    }
+}
+
+/*!
+  Draw a dotted round circle, if !isReadOnly()
+
+  \param painter Painter
+*/
+void QwtDial::drawFocusIndicator(QPainter *painter) const
+{
+    if ( !isReadOnly() )
+    {
+        QRect focusRect = contentsRect();
+
+        const int margin = 2;
+        focusRect.setRect( 
+            focusRect.x() + margin,
+            focusRect.y() + margin,
+            focusRect.width() - 2 * margin,
+            focusRect.height() - 2 * margin);
+
+#if QT_VERSION < 0x040000
+        QColor color = colorGroup().color(QColorGroup::Base);
+#else
+        QColor color = palette().color(QPalette::Base);
+#endif
+        if (color.isValid())
+        {
+            const QColor gray(Qt::gray);
+
+            int h, s, v;
+#if QT_VERSION < 0x040000
+            color.hsv(&h, &s, &v);
+#else
+            color.getHsv(&h, &s, &v);
+#endif
+            color = (v > 128) ? gray.dark(120) : gray.light(120);
+        }
+        else
+            color = Qt::darkGray;
+
+        painter->save();
+        painter->setBrush(Qt::NoBrush);
+        painter->setPen(QPen(color, 0, Qt::DotLine));
+        painter->drawEllipse(focusRect);
+        painter->restore();
+    }
+}
+
+/*!
+  Draw the frame around the dial
+
+  \param painter Painter
+  \sa QwtDial::lineWidth, QwtDial::frameShadow
+*/
+void QwtDial::drawFrame(QPainter *painter)
+{
+    const int lw = lineWidth();
+    const int off = (lw + 1) % 2;
+
+    QRect r = boundingRect();
+    r.setRect(r.x() + lw / 2 - off, r.y() + lw / 2 - off,
+        r.width() - lw + off + 1, r.height() - lw + off + 1);
+#if QT_VERSION >= 0x040000
+#ifdef __GNUC__
+#warning QwtPainter::drawRoundFrame 
+#endif
+    r.setX(r.x() + 1);
+    r.setY(r.y() + 1);
+    r.setWidth(r.width() - 2);
+    r.setHeight(r.height() - 2);
+#endif
+
+    if ( lw > 0 )
+    {
+        switch(d_data->frameShadow)
+        {
+            case QwtDial::Raised:
+#if QT_VERSION < 0x040000
+                QwtPainter::drawRoundFrame(painter, r, 
+                    lw, colorGroup(), false);
+#else
+                QwtPainter::drawRoundFrame(painter, r, 
+                    lw, palette(), false);
+#endif
+                break;
+            case QwtDial::Sunken:
+#if QT_VERSION < 0x040000
+                QwtPainter::drawRoundFrame(painter, r, 
+                    lw, colorGroup(), true);
+#else
+                QwtPainter::drawRoundFrame(painter, r, 
+                    lw, palette(), true);
+#endif
+                break;
+            default: // Plain
+            {
+                painter->save();
+                painter->setPen(QPen(Qt::black, lw));
+                painter->setBrush(Qt::NoBrush);
+                painter->drawEllipse(r);
+                painter->restore();
+            }
+        }
+    }
+}
+
+/*!
+  \brief Draw the contents inside the frame
+ 
+  QColorGroup::Background is the background color outside of the frame.
+  QColorGroup::Base is the background color inside the frame.
+  QColorGroup::Foreground is the background color inside the scale.
+
+  \param painter Painter
+  \sa QwtDial::boundingRect, QwtDial::contentsRect,
+    QwtDial::scaleContentsRect, QWidget::setPalette
+*/
+void QwtDial::drawContents(QPainter *painter) const
+{
+#if QT_VERSION < 0x040000
+    if ( backgroundMode() == Qt::NoBackground || 
+        colorGroup().brush(QColorGroup::Base) != 
+            colorGroup().brush(QColorGroup::Background) )
+#else
+    if ( testAttribute(Qt::WA_NoSystemBackground) ||
+        palette().brush(QPalette::Base) != 
+            palette().brush(QPalette::Background) )
+#endif
+    {
+
+        const QRect br = boundingRect();
+
+        painter->save();
+        painter->setPen(Qt::NoPen);
+
+#if QT_VERSION < 0x040000
+        painter->setBrush(colorGroup().brush(QColorGroup::Base));
+#else
+        painter->setBrush(palette().brush(QPalette::Base));
+#endif
+
+        painter->drawEllipse(br);
+        painter->restore();
+    }
+
+
+    const QRect insideScaleRect = scaleContentsRect();
+#if QT_VERSION < 0x040000
+    if ( colorGroup().brush(QColorGroup::Foreground) !=
+        colorGroup().brush(QColorGroup::Base) )
+#else
+    if ( palette().brush(QPalette::Foreground) !=
+        palette().brush(QPalette::Base) )
+#endif
+    {
+        painter->save();
+        painter->setPen(Qt::NoPen);
+
+#if QT_VERSION < 0x040000
+        painter->setBrush(colorGroup().brush(QColorGroup::Foreground));
+#else
+        painter->setBrush(palette().brush(QPalette::Foreground));
+#endif
+
+        painter->drawEllipse(insideScaleRect.x() - 1, insideScaleRect.y() - 1,
+            insideScaleRect.width(), insideScaleRect.height() );
+
+        painter->restore();
+    }
+
+    const QPoint center = insideScaleRect.center();
+    const int radius = insideScaleRect.width() / 2;
+
+    painter->save();
+    drawScaleContents(painter, center, radius);
+    painter->restore();
+
+    double direction = d_data->origin;
+
+    if (isValid())
+    {
+        direction = d_data->origin + d_data->minScaleArc;
+        if ( maxValue() > minValue() && d_data->maxScaleArc > d_data->minScaleArc )
+        {
+            const double ratio = 
+                (value() - minValue()) / (maxValue() - minValue());
+            direction += ratio * (d_data->maxScaleArc - d_data->minScaleArc);
+        }
+
+        if ( direction >= 360.0 )
+            direction -= 360.0;
+    }
+
+    double origin = d_data->origin;
+    if ( mode() == RotateScale )
+    {
+        origin -= direction - d_data->origin;
+        direction = d_data->origin;
+    }
+
+    painter->save();
+    drawScale(painter, center, radius, origin, d_data->minScaleArc, d_data->maxScaleArc);
+    painter->restore();
+
+    if ( isValid() )
+    {
+        QPalette::ColorGroup cg;
+        if ( isEnabled() )
+            cg = hasFocus() ? QPalette::Active : QPalette::Inactive;
+        else
+            cg = QPalette::Disabled;
+
+        painter->save();
+        drawNeedle(painter, center, radius, direction, cg);
+        painter->restore();
+    }
+}
+
+/*!
+  Draw the needle
+
+  Qwt is missing a set of good looking needles.
+  Contributions are very welcome.
+
+  \param painter Painter
+  \param center Center of the dial
+  \param radius Length for the needle
+  \param direction Direction of the needle in degrees, counter clockwise
+  \param cg ColorGroup
+*/
+void QwtDial::drawNeedle(QPainter *painter, const QPoint &center, 
+    int radius, double direction, QPalette::ColorGroup cg) const
+{
+    if ( d_data->needle )
+    {
+        direction = 360.0 - direction; // counter clockwise
+        d_data->needle->draw(painter, center, radius, direction, cg);
+    }
+}
+
+/*!
+  Draw the scale
+
+  \param painter Painter
+  \param center Center of the dial
+  \param radius Radius of the scale
+  \param origin Origin of the scale
+  \param minArc Minimum of the arc 
+  \param maxArc Minimum of the arc 
+  
+  \sa QwtAbstractScaleDraw::setAngleRange
+*/
+void QwtDial::drawScale(QPainter *painter, const QPoint &center,
+    int radius, double origin, double minArc, double maxArc) const
+{
+    if ( d_data->scaleDraw == NULL )
+        return;
+
+    origin -= 270.0; // hardcoded origin of QwtScaleDraw
+
+    double angle = maxArc - minArc;
+    if ( angle > 360.0 )
+        angle = fmod(angle, 360.0);
+
+    minArc += origin;
+    if ( minArc < -360.0 )
+        minArc = fmod(minArc, 360.0);
+    
+    maxArc = minArc + angle;
+    if ( maxArc > 360.0 )
+    {
+        // QwtAbstractScaleDraw::setAngleRange accepts only values
+        // in the range [-360.0..360.0]
+        minArc -= 360.0;
+        maxArc -= 360.0;
+    }
+    
+    painter->setFont(font());
+
+    d_data->scaleDraw->setAngleRange(minArc, maxArc);
+    d_data->scaleDraw->setRadius(radius);
+    d_data->scaleDraw->moveCenter(center);
+
+#if QT_VERSION < 0x040000
+    QColorGroup cg = colorGroup();
+
+    const QColor textColor = cg.color(QColorGroup::Text);
+    cg.setColor(QColorGroup::Foreground, textColor);
+    painter->setPen(QPen(textColor, d_data->scaleDraw->penWidth()));
+    
+    d_data->scaleDraw->draw(painter, cg);
+#else
+    QPalette pal = palette();
+
+    const QColor textColor = pal.color(QPalette::Text);
+    pal.setColor(QPalette::Foreground, textColor); //ticks, backbone
+    
+    painter->setPen(QPen(textColor, d_data->scaleDraw->penWidth()));
+
+    d_data->scaleDraw->draw(painter, pal);
+#endif
+}
+
+void QwtDial::drawScaleContents(QPainter *, 
+    const QPoint &, int) const
+{
+    // empty default implementation
+}
+
+/*!
+  Set a needle for the dial
+
+  Qwt is missing a set of good looking needles. 
+  Contributions are very welcome.
+
+  \param needle Needle
+  \warning The needle will be deleted, when a different needle is
+    set or in ~QwtDial
+*/
+void QwtDial::setNeedle(QwtDialNeedle *needle)
+{
+    if ( needle != d_data->needle )
+    {
+        if ( d_data->needle )
+            delete d_data->needle;
+
+        d_data->needle = needle;
+        update();
+    }
+}
+
+/*! 
+  \return needle
+  \sa QwtDial::setNeedle
+*/
+const QwtDialNeedle *QwtDial::needle() const 
+{ 
+    return d_data->needle; 
+}
+
+/*! 
+  \return needle
+  \sa QwtDial::setNeedle
+*/
+QwtDialNeedle *QwtDial::needle() 
+{ 
+    return d_data->needle; 
+}
+
+//! QwtDoubleRange update hook
+void QwtDial::rangeChange()
+{
+    updateScale();
+}
+
+/*! 
+  Update the scale with the current attributes
+  \sa QwtDial::setScale
+*/
+void QwtDial::updateScale()
+{
+    if ( d_data->scaleDraw )
+    {
+        QwtLinearScaleEngine scaleEngine;
+
+        const QwtScaleDiv scaleDiv = scaleEngine.divideScale(
+            minValue(), maxValue(), 
+            d_data->maxMajIntv, d_data->maxMinIntv, d_data->scaleStep);
+
+        d_data->scaleDraw->setTransformation(scaleEngine.transformation());
+        d_data->scaleDraw->setScaleDiv(scaleDiv);
+    }
+}
+
+//! Return the scale draw
+QwtDialScaleDraw *QwtDial::scaleDraw() 
+{ 
+    return d_data->scaleDraw; 
+}
+
+//! Return the scale draw
+const QwtDialScaleDraw *QwtDial::scaleDraw() const 
+{ 
+    return d_data->scaleDraw; 
+}
+
+/*!
+  Set an individual scale draw
+
+  \warning The previous scale draw is deleted
+*/
+void QwtDial::setScaleDraw(QwtDialScaleDraw *scaleDraw)
+{
+    if ( scaleDraw != d_data->scaleDraw )
+    {
+        if ( d_data->scaleDraw )
+            delete d_data->scaleDraw;
+    
+        d_data->scaleDraw = scaleDraw;
+        updateScale();
+        update();
+    }
+}
+
+/*!
+  Change the intervals of the scale
+  \sa QwtAbstractScaleDraw::setScale
+*/
+void QwtDial::setScale(int maxMajIntv, int maxMinIntv, double step)
+{
+    d_data->maxMajIntv = maxMajIntv;
+    d_data->maxMinIntv = maxMinIntv;
+    d_data->scaleStep = step;
+
+    updateScale();
+}
+
+/*!
+  A wrapper method for accessing the scale draw. 
+
+  - options == 0\n
+    No visible scale: setScaleDraw(NULL)
+  - options & ScaleBackbone\n
+    En/disable the backbone of the scale.
+  - options & ScaleTicks\n
+    En/disable the ticks of the scale.
+  - options & ScaleLabel\n
+    En/disable scale labels
+    
+  \sa QwtAbstractScaleDraw::enableComponent 
+*/
+void QwtDial::setScaleOptions(int options)
+{
+    if ( options == 0 )
+        setScaleDraw(NULL);
+
+    QwtDialScaleDraw *sd = d_data->scaleDraw;
+    if ( sd == NULL )
+        return;
+
+    sd->enableComponent(QwtAbstractScaleDraw::Backbone, 
+        options & ScaleBackbone);
+
+    sd->enableComponent(QwtAbstractScaleDraw::Ticks, 
+        options & ScaleTicks);
+    
+    sd->enableComponent(QwtAbstractScaleDraw::Labels, 
+        options & ScaleLabel);
+}
+
+//! See: QwtAbstractScaleDraw::setTickLength, QwtDialScaleDraw::setPenWidth
+void QwtDial::setScaleTicks(int minLen, int medLen, 
+    int majLen, int penWidth)
+{
+    QwtDialScaleDraw *sd = d_data->scaleDraw;
+    if ( sd )
+    {
+        sd->setTickLength(QwtScaleDiv::MinorTick, minLen);
+        sd->setTickLength(QwtScaleDiv::MediumTick, medLen);
+        sd->setTickLength(QwtScaleDiv::MajorTick, majLen);
+        sd->setPenWidth(penWidth);
+    }
+}
+
+/*!
+   \return the label for a value
+*/
+QwtText QwtDial::scaleLabel(double value) const
+{
+#if 1
+    if ( value == -0 )
+        value = 0;
+#endif
+
+    return QString::number(value);
+}
+
+//! Return the lower limit of the scale arc
+double QwtDial::minScaleArc() const 
+{ 
+    return d_data->minScaleArc; 
+}
+
+//! Return the upper limit of the scale arc
+double QwtDial::maxScaleArc() const 
+{ 
+    return d_data->maxScaleArc; 
+}
+
+/*!
+  \brief Change the origin 
+ 
+  The origin is the angle where scale and needle is relative to.
+
+  \param origin New origin
+  \sa QwtDial::origin()
+*/
+void QwtDial::setOrigin(double origin)
+{
+    d_data->origin = origin;
+    update();
+}
+
+/*!
+  The origin is the angle where scale and needle is relative to.
+
+  \return Origin of the dial
+  \sa QwtDial::setOrigin()
+*/
+double QwtDial::origin() const
+{
+    return d_data->origin;
+}
+
+/*!
+  Change the arc of the scale
+
+  \param minArc Lower limit
+  \param maxArc Upper limit
+*/
+void QwtDial::setScaleArc(double minArc, double maxArc)
+{
+    if ( minArc != 360.0 && minArc != -360.0 )
+        minArc = fmod(minArc, 360.0);
+    if ( maxArc != 360.0 && maxArc != -360.0 )
+        maxArc = fmod(maxArc, 360.0);
+
+    d_data->minScaleArc = qwtMin(minArc, maxArc);
+    d_data->maxScaleArc = qwtMax(minArc, maxArc);
+    if ( d_data->maxScaleArc - d_data->minScaleArc > 360.0 )
+        d_data->maxScaleArc = d_data->minScaleArc + 360.0;
+    
+    update();
+}
+
+//! QwtDoubleRange update hook
+void QwtDial::valueChange()
+{
+    update();
+    QwtAbstractSlider::valueChange();
+}
+
+/*!
+  \return QwtDial::sizeHint()
+*/
+QSize QwtDial::sizeHint() const
+{
+    int sh = 0;
+    if ( d_data->scaleDraw )
+        sh = d_data->scaleDraw->extent( QPen(), font() );
+
+    const int d = 6 * sh + 2 * lineWidth();
+    
+    return QSize( d, d );
+}
+
+/*! 
+  \brief Return a minimum size hint
+  \warning The return value of QwtDial::minimumSizeHint() depends on the
+           font and the scale.
+*/  
+QSize QwtDial::minimumSizeHint() const
+{   
+    int sh = 0;
+    if ( d_data->scaleDraw )
+        sh = d_data->scaleDraw->extent(QPen(), font() );
+
+    const int d = 3 * sh + 2 * lineWidth();
+    
+    return QSize( d, d );
+}
+
+static double line2Radians(const QPoint &p1, const QPoint &p2)
+{
+    const QPoint p = p2 - p1;
+
+    double angle;
+    if ( p.x() == 0 )
+        angle = ( p.y() <= 0 ) ? M_PI_2 : 3 * M_PI_2;
+    else
+    {
+        angle = atan(double(-p.y()) / double(p.x()));
+        if ( p.x() < 0 )
+            angle += M_PI;
+        if ( angle < 0.0 )
+            angle += 2 * M_PI;
+    }
+    return 360.0 - angle * 180.0 / M_PI;
+}
+
+/*!
+  Find the value for a given position
+
+  \param pos
+  \return Value
+*/
+double QwtDial::getValue(const QPoint &pos)
+{
+    if ( d_data->maxScaleArc == d_data->minScaleArc || maxValue() == minValue() )
+        return minValue();
+
+    double dir = line2Radians(rect().center(), pos) - d_data->origin;
+    if ( dir < 0.0 )
+        dir += 360.0;
+
+    if ( mode() == RotateScale )
+        dir = 360.0 - dir;
+
+    // The position might be in the area that is outside the scale arc.
+    // We need the range of the scale if it was a complete circle.
+
+    const double completeCircle = 360.0 / (d_data->maxScaleArc - d_data->minScaleArc) 
+        * (maxValue() - minValue());
+
+    double posValue = minValue() + completeCircle * dir / 360.0;
+
+    if ( scrollMode() == ScrMouse )
+    {
+        if ( d_data->previousDir >= 0.0 ) // valid direction
+        {
+            // We have to find out whether the mouse is moving
+            // clock or counter clockwise
+
+            bool clockWise = false;
+
+            const double angle = dir - d_data->previousDir;
+            if ( (angle >= 0.0 && angle <= 180.0) || angle < -180.0 )
+                clockWise = true;
+
+            if ( clockWise )
+            {
+                if ( dir < d_data->previousDir && mouseOffset() > 0.0 )
+                {
+                    // We passed 360 -> 0
+                    setMouseOffset(mouseOffset() - completeCircle);
+                }
+
+                if ( wrapping() )
+                {
+                    if ( posValue - mouseOffset() > maxValue() )
+                    {
+                        // We passed maxValue and the value will be set
+                        // to minValue. We have to adjust the mouseOffset.
+
+                        setMouseOffset(posValue - minValue());
+                    }
+                }
+                else
+                {
+                    if ( posValue - mouseOffset() > maxValue() ||
+                        value() == maxValue() )
+                    {
+                        // We fix the value at maxValue by adjusting
+                        // the mouse offset.
+
+                        setMouseOffset(posValue - maxValue());
+                    }
+                }
+            }
+            else
+            {
+                if ( dir > d_data->previousDir && mouseOffset() < 0.0 )
+                {
+                    // We passed 0 -> 360 
+                    setMouseOffset(mouseOffset() + completeCircle);    
+                }
+
+                if ( wrapping() )
+                {
+                    if ( posValue - mouseOffset() < minValue() )
+                    {
+                        // We passed minValue and the value will be set
+                        // to maxValue. We have to adjust the mouseOffset.
+
+                        setMouseOffset(posValue - maxValue());
+                    }
+                }
+                else
+                {
+                    if ( posValue - mouseOffset() < minValue() ||
+                        value() == minValue() )
+                    {
+                        // We fix the value at minValue by adjusting
+                        // the mouse offset.
+
+                        setMouseOffset(posValue - minValue());
+                    }
+                }
+            }
+        }
+        d_data->previousDir = dir;
+    }
+
+    return posValue;
+}
+
+/*!
+  \sa QwtAbstractSlider::getScrollMode
+*/
+void QwtDial::getScrollMode(const QPoint &p, int &scrollMode, int &direction)
+{
+    direction = 0;
+    scrollMode = ScrNone;
+
+    const QRegion region(contentsRect(), QRegion::Ellipse);
+    if ( region.contains(p) && p != rect().center() )
+    {
+        scrollMode = ScrMouse;
+        d_data->previousDir = -1.0;
+    }
+}
+
+/*! 
+  Handles key events
+
+  - Key_Down, KeyLeft\n
+    Decrement by 1
+  - Key_Prior\n
+    Decrement by pageSize()
+  - Key_Home\n
+    Set the value to minValue()
+
+  - Key_Up, KeyRight\n
+    Increment by 1
+  - Key_Next\n
+    Increment by pageSize()
+  - Key_End\n
+    Set the value to maxValue()
+
+  \sa isReadOnly()
+*/
+void QwtDial::keyPressEvent(QKeyEvent *e)
+{
+    if ( isReadOnly() )
+    {
+        e->ignore();
+        return;
+    }
+
+    if ( !isValid() )
+        return;
+
+    double previous = prevValue();
+    switch ( e->key() )
+    {
+        case Qt::Key_Down:
+        case Qt::Key_Left:
+            QwtDoubleRange::incValue(-1);
+            break;
+#if QT_VERSION < 0x040000
+        case Qt::Key_Prior:
+#else
+        case Qt::Key_PageUp:
+#endif
+            QwtDoubleRange::incValue(-pageSize());
+            break;
+        case Qt::Key_Home:
+            setValue(minValue());
+            break;
+
+        case Qt::Key_Up:
+        case Qt::Key_Right:
+            QwtDoubleRange::incValue(1);
+            break;
+#if QT_VERSION < 0x040000
+        case Qt::Key_Next:
+#else
+        case Qt::Key_PageDown:
+#endif
+            QwtDoubleRange::incValue(pageSize());
+            break;
+        case Qt::Key_End:
+            setValue(maxValue());
+            break;
+        default:;
+            e->ignore();
+    }
+
+    if (value() != previous)
+        emit sliderMoved(value());
+}
+
+void QwtDial::updateMask()
+{
+    if ( d_data->visibleBackground )
+        clearMask();
+    else
+        setMask(QRegion(boundingRect(), QRegion::Ellipse));
+}
diff --git a/src/qwt/qwt_dial_needle.cpp b/src/qwt/qwt_dial_needle.cpp
new file mode 100644
index 0000000..0375756
--- /dev/null
+++ b/src/qwt/qwt_dial_needle.cpp
@@ -0,0 +1,546 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <math.h>
+#include <qapplication.h>
+#include <qpainter.h>
+#include "qwt_math.h"
+#include "qwt_painter.h"
+#include "qwt_dial_needle.h"
+
+#if QT_VERSION < 0x040000
+#include <qpointarray.h>
+#define QwtPointArray QPointArray
+typedef QColorGroup QwtPalette;
+#else
+#include <qpolygon.h>
+#define QwtPointArray QPolygon
+typedef QPalette QwtPalette;
+#endif
+
+//! Constructor
+QwtDialNeedle::QwtDialNeedle():
+    d_palette(QApplication::palette())
+{
+}
+
+//! Destructor
+QwtDialNeedle::~QwtDialNeedle() 
+{
+}
+
+/*!
+    Sets the palette for the needle.
+
+    \param palette New Palette
+*/
+void QwtDialNeedle::setPalette(const QPalette &palette) 
+{ 
+    d_palette = palette; 
+}
+
+/*!
+  \return the palette of the needle.
+*/
+const QPalette &QwtDialNeedle::palette() const 
+{ 
+    return d_palette; 
+}
+
+//!  Draw the knob 
+void QwtDialNeedle::drawKnob(QPainter *painter,
+    const QPoint &pos, int width, const QBrush &brush, bool sunken)
+{
+    painter->save();
+
+    QRect rect(0, 0, width, width);
+    rect.moveCenter(pos);
+
+    painter->setPen(Qt::NoPen);
+    painter->setBrush(brush);
+    painter->drawEllipse(rect);
+
+    painter->setBrush(Qt::NoBrush);
+
+    const int colorOffset = 20;
+
+    int startAngle = 45;
+    if ( sunken )
+        startAngle += 180;
+
+    QPen pen;
+    pen.setWidth(1);
+
+    pen.setColor(brush.color().dark(100 - colorOffset));
+    painter->setPen(pen);
+    painter->drawArc(rect, startAngle * 16, 180 * 16);
+
+    pen.setColor(brush.color().dark(100 + colorOffset));
+    painter->setPen(pen);
+    painter->drawArc(rect, (startAngle + 180) * 16, 180 * 16);
+
+    painter->restore();
+}
+
+/*!
+  Constructor
+*/
+QwtDialSimpleNeedle::QwtDialSimpleNeedle(Style style, bool hasKnob, 
+        const QColor &mid, const QColor &base):
+    d_style(style),
+    d_hasKnob(hasKnob),
+    d_width(-1)
+{
+    QPalette palette;
+    for ( int i = 0; i < QPalette::NColorGroups; i++ )
+    {
+        palette.setColor((QPalette::ColorGroup)i,
+            QwtPalette::Mid, mid);
+        palette.setColor((QPalette::ColorGroup)i,
+            QwtPalette::Base, base);
+    }
+
+    setPalette(palette);
+}
+
+//! Set the width of the needle
+void QwtDialSimpleNeedle::setWidth(int width)
+{
+    d_width = width;
+}
+
+/*!
+  \return the width of the needle
+*/
+int QwtDialSimpleNeedle::width() const
+{
+    return d_width;
+}
+
+/*!
+ Draw the needle
+
+ \param painter Painter
+ \param center Center of the dial, start position for the needle
+ \param length Length of the needle
+ \param direction Direction of the needle, in degrees counter clockwise
+ \param colorGroup Color group, used for painting
+*/
+void QwtDialSimpleNeedle::draw(QPainter *painter, const QPoint &center,
+    int length, double direction, QPalette::ColorGroup colorGroup) const
+{
+    if ( d_style == Arrow )
+    {
+        drawArrowNeedle(painter, palette(), colorGroup,
+            center, length, d_width, direction, d_hasKnob);
+    }
+    else
+    {
+        drawRayNeedle(painter, palette(), colorGroup, 
+            center, length, d_width, direction, d_hasKnob); 
+    }
+}
+
+/*!
+  Draw a needle looking like a ray
+*/
+void QwtDialSimpleNeedle::drawRayNeedle(QPainter *painter, 
+    const QPalette &palette, QPalette::ColorGroup colorGroup,
+    const QPoint &center, int length, int width, double direction, 
+    bool hasKnob)
+{
+    if ( width <= 0 )
+        width = 5;
+
+    direction *= M_PI / 180.0;
+
+    painter->save();
+
+    const QPoint p1(center.x() + 1, center.y() + 2);
+    const QPoint p2 = qwtPolar2Pos(p1, length, direction);
+
+    if ( width == 1 )
+    {
+        const QColor midColor =
+            palette.color(colorGroup, QwtPalette::Mid);
+
+        painter->setPen(QPen(midColor, 1));
+        painter->drawLine(p1, p2);
+    }
+    else
+    {
+        QwtPointArray pa(4);
+        pa.setPoint(0, qwtPolar2Pos(p1, width / 2, direction + M_PI_2));
+        pa.setPoint(1, qwtPolar2Pos(p2, width / 2, direction + M_PI_2));
+        pa.setPoint(2, qwtPolar2Pos(p2, width / 2, direction - M_PI_2));
+        pa.setPoint(3, qwtPolar2Pos(p1, width / 2, direction - M_PI_2));
+
+        painter->setPen(Qt::NoPen);
+        painter->setBrush(palette.brush(colorGroup, QwtPalette::Mid));
+        painter->drawPolygon(pa);
+    }
+    if ( hasKnob )
+    {
+        int knobWidth = qwtMax(qRound(width * 0.7), 5);
+        if ( knobWidth % 2 == 0 )
+            knobWidth++;
+
+        drawKnob(painter, center, knobWidth, 
+            palette.brush(colorGroup, QwtPalette::Base), 
+            false);
+    }
+
+    painter->restore();
+}
+
+/*!
+  Draw a needle looking like an arrow
+*/
+void QwtDialSimpleNeedle::drawArrowNeedle(QPainter *painter, 
+    const QPalette &palette, QPalette::ColorGroup colorGroup,
+    const QPoint &center, int length, int width,
+    double direction, bool hasKnob)
+{
+    direction *= M_PI / 180.0;
+
+    painter->save();
+
+    if ( width <= 0 )
+    {
+        width = (int)qwtMax(length * 0.06, 9.0);
+        if ( width % 2 == 0 )
+            width++;
+    }
+
+    const int peak = 3;
+    const QPoint p1(center.x() + 1, center.y() + 1);
+    const QPoint p2 = qwtPolar2Pos(p1, length - peak, direction);
+    const QPoint p3 = qwtPolar2Pos(p1, length, direction);
+
+    QwtPointArray pa(5);
+    pa.setPoint(0, qwtPolar2Pos(p1, width / 2, direction - M_PI_2));
+    pa.setPoint(1, qwtPolar2Pos(p2, 1, direction - M_PI_2));
+    pa.setPoint(2, p3);
+    pa.setPoint(3, qwtPolar2Pos(p2, 1, direction + M_PI_2));
+    pa.setPoint(4, qwtPolar2Pos(p1, width / 2, direction + M_PI_2));
+
+    painter->setPen(Qt::NoPen);
+    painter->setBrush(palette.brush(colorGroup, QwtPalette::Mid));
+    painter->drawPolygon(pa);
+
+    QwtPointArray shadowPa(3);
+
+    const int colorOffset = 10;
+
+    int i;
+    for ( i = 0; i < 3; i++ )
+        shadowPa.setPoint(i, pa[i]);
+
+    const QColor midColor = palette.color(colorGroup, QwtPalette::Mid);
+
+    painter->setPen(midColor.dark(100 + colorOffset));
+    painter->drawPolyline(shadowPa);
+
+    for ( i = 0; i < 3; i++ )
+        shadowPa.setPoint(i, pa[i + 2]);
+
+    painter->setPen(midColor.dark(100 - colorOffset));
+    painter->drawPolyline(shadowPa);
+
+    if ( hasKnob )
+    {
+        drawKnob(painter, center, qRound(width * 1.3), 
+            palette.brush(colorGroup, QwtPalette::Base),
+            false);
+    }
+
+    painter->restore();
+}
+
+//! Constructor
+
+QwtCompassMagnetNeedle::QwtCompassMagnetNeedle(Style style,
+        const QColor &light, const QColor &dark):
+    d_style(style)
+{   
+    QPalette palette;
+    for ( int i = 0; i < QPalette::NColorGroups; i++ )
+    {
+        palette.setColor((QPalette::ColorGroup)i,
+            QwtPalette::Light, light);
+        palette.setColor((QPalette::ColorGroup)i,
+            QwtPalette::Dark, dark);
+        palette.setColor((QPalette::ColorGroup)i,
+            QwtPalette::Base, Qt::darkGray);
+    }
+
+    setPalette(palette); 
+}
+
+/*!
+    Draw the needle
+
+    \param painter Painter
+    \param center Center of the dial, start position for the needle
+    \param length Length of the needle
+    \param direction Direction of the needle, in degrees counter clockwise
+    \param colorGroup Color group, used for painting
+*/
+void QwtCompassMagnetNeedle::draw(QPainter *painter, const QPoint &center,
+    int length, double direction, QPalette::ColorGroup colorGroup) const
+{
+    if ( d_style == ThinStyle )
+    {
+        drawThinNeedle(painter, palette(), colorGroup, 
+            center, length, direction); 
+    }
+    else
+    {
+        drawTriangleNeedle(painter, palette(), colorGroup,
+            center, length, direction);
+    }
+}
+
+/*!
+  Draw a compass needle 
+*/
+void QwtCompassMagnetNeedle::drawTriangleNeedle(QPainter *painter, 
+    const QPalette &palette, QPalette::ColorGroup colorGroup,
+    const QPoint &center, int length, double direction) 
+{
+    const QBrush darkBrush = palette.brush(colorGroup, QwtPalette::Dark);
+    const QBrush lightBrush = palette.brush(colorGroup, QwtPalette::Light);
+
+    QBrush brush;
+
+    const int width = qRound(length / 3.0);
+    const int colorOffset =  10;
+
+    painter->save();
+    painter->setPen(Qt::NoPen);
+
+    const QPoint arrowCenter(center.x() + 1, center.y() + 1);
+
+    QwtPointArray pa(3);
+    pa.setPoint(0, arrowCenter);
+    pa.setPoint(1, qwtDegree2Pos(arrowCenter, length, direction));
+
+    pa.setPoint(2, qwtDegree2Pos(arrowCenter, width / 2, direction + 90.0));
+
+    brush = darkBrush;
+    brush.setColor(brush.color().dark(100 + colorOffset));
+    painter->setBrush(brush);
+    painter->drawPolygon(pa);
+
+    pa.setPoint(2, qwtDegree2Pos(arrowCenter, width / 2, direction - 90.0));
+
+    brush = darkBrush;
+    brush.setColor(brush.color().dark(100 - colorOffset));
+    painter->setBrush(brush);
+    painter->drawPolygon(pa);
+
+    // --
+
+    pa.setPoint(1, qwtDegree2Pos(arrowCenter, length, direction + 180.0));
+
+    pa.setPoint(2, qwtDegree2Pos(arrowCenter, width / 2, direction + 90.0));
+
+    brush = lightBrush;
+    brush.setColor(brush.color().dark(100 + colorOffset));
+    painter->setBrush(brush);
+    painter->drawPolygon(pa);
+
+    pa.setPoint(2, qwtDegree2Pos(arrowCenter, width / 2, direction - 90.0));
+
+    brush = lightBrush;
+    brush.setColor(brush.color().dark(100 - colorOffset));
+    painter->setBrush(brush);
+    painter->drawPolygon(pa);
+
+    painter->restore();
+}
+
+/*!
+  Draw a compass needle 
+*/
+void QwtCompassMagnetNeedle::drawThinNeedle(QPainter *painter, 
+    const QPalette &palette, QPalette::ColorGroup colorGroup,
+    const QPoint &center, int length, double direction) 
+{
+    const QBrush darkBrush = palette.brush(colorGroup, QwtPalette::Dark);
+    const QBrush lightBrush = palette.brush(colorGroup, QwtPalette::Light);
+    const QBrush baseBrush = palette.brush(colorGroup, QwtPalette::Base);
+
+    const int colorOffset = 10;
+    const int width = qwtMax(qRound(length / 6.0), 3);
+
+    painter->save();
+
+    const QPoint arrowCenter(center.x() + 1, center.y() + 1);
+
+    drawPointer(painter, darkBrush, colorOffset, 
+        arrowCenter, length, width, direction);
+    drawPointer(painter, lightBrush, -colorOffset, 
+        arrowCenter, length, width, direction + 180.0);
+    
+    drawKnob(painter, arrowCenter, width, baseBrush, true);
+
+    painter->restore();
+}
+
+/*!
+  Draw a compass needle 
+*/
+void QwtCompassMagnetNeedle::drawPointer(
+    QPainter *painter, const QBrush &brush,
+    int colorOffset, const QPoint &center, int length, 
+    int width, double direction)
+{
+    painter->save();
+
+    const int peak = qwtMax(qRound(length / 10.0), 5);
+
+    const int knobWidth = width + 8;
+    QRect knobRect(0, 0, knobWidth, knobWidth);
+    knobRect.moveCenter(center);
+
+    QwtPointArray pa(5);
+
+    pa.setPoint(0, qwtDegree2Pos(center, width / 2, direction + 90.0));
+    pa.setPoint(1, center);
+    pa.setPoint(2, qwtDegree2Pos(pa.point(1), length - peak, direction));
+    pa.setPoint(3, qwtDegree2Pos(center, length, direction));
+    pa.setPoint(4, qwtDegree2Pos(pa.point(0), length - peak, direction));
+
+    painter->setPen(Qt::NoPen);
+
+    QBrush darkBrush = brush;
+    darkBrush.setColor(darkBrush.color().dark(100 + colorOffset));
+    painter->setBrush(darkBrush);
+    painter->drawPolygon(pa);
+    painter->drawPie(knobRect, qRound(direction * 16), 90 * 16);
+
+    pa.setPoint(0, qwtDegree2Pos(center, width / 2, direction - 90.0));
+    pa.setPoint(4, qwtDegree2Pos(pa.point(0), length - peak, direction));
+
+    QBrush lightBrush = brush;
+    lightBrush.setColor(lightBrush.color().dark(100 - colorOffset));
+    painter->setBrush(lightBrush);
+    painter->drawPolygon(pa);
+    painter->drawPie(knobRect, qRound(direction * 16), -90 * 16);
+
+    painter->restore();
+}
+
+//! Constructor
+
+QwtCompassWindArrow::QwtCompassWindArrow(Style style, 
+        const QColor &light, const QColor &dark):
+    d_style(style)
+{
+    QPalette palette;
+    for ( int i = 0; i < QPalette::NColorGroups; i++ )
+    {
+        palette.setColor((QPalette::ColorGroup)i,
+            QwtPalette::Light, light);
+        palette.setColor((QPalette::ColorGroup)i,
+            QwtPalette::Dark, dark);
+    }
+
+    setPalette(palette);
+}
+
+/*!
+ Draw the needle
+
+ \param painter Painter
+ \param center Center of the dial, start position for the needle
+ \param length Length of the needle
+ \param direction Direction of the needle, in degrees counter clockwise
+ \param colorGroup Color group, used for painting
+*/
+void QwtCompassWindArrow::draw(QPainter *painter, const QPoint &center,
+    int length, double direction, QPalette::ColorGroup colorGroup) const
+{
+    if ( d_style == Style1 )
+    {
+        drawStyle1Needle(painter, palette(), colorGroup,
+            center, length, direction);
+    }
+    else
+    {
+        drawStyle2Needle(painter, palette(), colorGroup,
+            center, length, direction); 
+    }
+}
+
+/*!
+  Draw a compass needle 
+*/
+void QwtCompassWindArrow::drawStyle1Needle(QPainter *painter, 
+    const QPalette &palette, QPalette::ColorGroup colorGroup,
+    const QPoint &center, int length, double direction) 
+{
+    const QBrush lightBrush = palette.brush(colorGroup, QwtPalette::Light);
+
+    const double AR1[] = {0, 0.4, 0.3, 1, 0.8, 1, 0.3, 0.4};
+    const double AW1[] = {0, -45, -20, -15, 0, 15, 20, 45};
+
+    const QPoint arrowCenter(center.x() + 1, center.y() + 1);
+
+    QwtPointArray pa(8);
+    pa.setPoint(0, arrowCenter);
+    for (int i=1; i<8; i++) 
+    {
+        const QPoint p = qwtDegree2Pos(center, 
+            AR1[i] * length, direction + AW1[i]);
+        pa.setPoint(i, p);
+    }
+
+    painter->save();
+    painter->setPen(Qt::NoPen);
+    painter->setBrush(lightBrush);
+    painter->drawPolygon(pa);
+    painter->restore();
+}
+
+/*!
+  Draw a compass needle 
+*/
+void QwtCompassWindArrow::drawStyle2Needle(QPainter *painter, 
+    const QPalette &palette, QPalette::ColorGroup colorGroup,
+    const QPoint &center, int length, double direction) 
+{
+    const QBrush lightBrush = palette.brush(colorGroup, QwtPalette::Light);
+    const QBrush darkBrush = palette.brush(colorGroup, QwtPalette::Dark);
+
+    painter->save();
+    painter->setPen(Qt::NoPen);
+
+    const double angle = 12.0;
+    const double ratio = 0.7;
+
+    const QPoint arrowCenter(center.x() + 1, center.y() + 1);
+
+    QwtPointArray pa(3);
+
+    pa.setPoint(0, center);
+    pa.setPoint(2, qwtDegree2Pos(arrowCenter, ratio * length, direction));
+
+    pa.setPoint(1, qwtDegree2Pos(arrowCenter, length, direction + angle));
+    painter->setBrush(darkBrush);
+    painter->drawPolygon(pa);
+
+    pa.setPoint(1, qwtDegree2Pos(arrowCenter, length, direction - angle));
+    painter->setBrush(lightBrush);
+    painter->drawPolygon(pa);
+
+    painter->restore();
+}
+
diff --git a/src/qwt/qwt_double_interval.cpp b/src/qwt/qwt_double_interval.cpp
new file mode 100644
index 0000000..9b43778
--- /dev/null
+++ b/src/qwt/qwt_double_interval.cpp
@@ -0,0 +1,149 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qglobal.h>
+#if QT_VERSION >= 0x040000
+#include <qalgorithms.h>
+#else
+#include <qtl.h>
+#endif
+
+#include "qwt_math.h"
+#include "qwt_double_interval.h"
+
+QwtDoubleInterval QwtDoubleInterval::normalized() const
+{
+    if ( !isValid() )
+    {
+        return QwtDoubleInterval(d_maxValue, d_minValue);
+    }
+    else
+        return *this;
+}
+
+QwtDoubleInterval QwtDoubleInterval::invert() const
+{
+    return QwtDoubleInterval(d_maxValue, d_minValue);
+}
+
+bool QwtDoubleInterval::contains(double value) const
+{
+    if ( !isValid() )
+        return false;
+
+    return (value >= d_minValue) && (value <= d_maxValue);
+}
+
+QwtDoubleInterval QwtDoubleInterval::unite(
+    const QwtDoubleInterval &interval) const
+{
+    if ( !isValid() )
+    {
+        if ( !interval.isValid() )
+            return QwtDoubleInterval();
+        else
+            return interval;
+    }
+    if ( !interval.isValid() )
+        return *this;
+
+    const double minValue = qwtMin(d_minValue, interval.minValue());
+    const double maxValue = qwtMax(d_maxValue, interval.maxValue());
+
+    return QwtDoubleInterval(minValue, maxValue);
+}
+
+QwtDoubleInterval QwtDoubleInterval::intersect(
+    const QwtDoubleInterval &interval) const
+{
+    if ( !interval.isValid() || !isValid() )
+        return QwtDoubleInterval();
+
+    QwtDoubleInterval i1 = *this;
+    QwtDoubleInterval i2 = interval;
+
+    if ( i1.minValue() > i2.minValue() )
+        qSwap(i1, i2);
+
+    if ( i1.maxValue() < i2.minValue() )
+        return QwtDoubleInterval();
+
+    return QwtDoubleInterval(i2.minValue(), 
+                qwtMin(i1.maxValue(), i2.maxValue()));
+}
+
+QwtDoubleInterval& QwtDoubleInterval::operator|=(
+    const QwtDoubleInterval &interval)
+{
+    *this = *this | interval;
+    return *this;
+}
+
+QwtDoubleInterval& QwtDoubleInterval::operator&=(
+    const QwtDoubleInterval &interval) 
+{
+    *this = *this & interval;
+    return *this;
+}
+
+bool QwtDoubleInterval::intersects(const QwtDoubleInterval &interval) const
+{
+    if ( !isValid() || !interval.isValid() )
+        return false;
+
+    QwtDoubleInterval i1 = *this;
+    QwtDoubleInterval i2 = interval;
+
+    if ( i1.minValue() > i2.minValue() )
+        qSwap(i1, i2);
+
+    return i1.maxValue() >= i2.minValue();
+}
+
+QwtDoubleInterval QwtDoubleInterval::symmetrize(double center) const
+{
+    if ( !isValid() )
+        return *this;
+
+    const double delta =
+        qwtMax(qwtAbs(center - d_maxValue), qwtAbs(center - d_minValue));
+
+    return QwtDoubleInterval(center - delta, center + delta);
+}
+
+QwtDoubleInterval QwtDoubleInterval::limit(
+    double lBound, double hBound) const
+{
+    if ( !isValid() || lBound > hBound )
+        return QwtDoubleInterval();
+
+    double minValue = qwtMax(d_minValue, lBound);
+    minValue = qwtMin(minValue, hBound);
+
+    double maxValue = qwtMax(d_maxValue, lBound);
+    maxValue = qwtMin(maxValue, hBound);
+
+    return QwtDoubleInterval(minValue, maxValue);
+}
+
+QwtDoubleInterval QwtDoubleInterval::extend(double v) const
+{
+    if ( !isValid() )
+        return *this;
+
+    return QwtDoubleInterval(
+        qwtMin(v, d_minValue), qwtMax(v, d_maxValue) );
+}
+
+QwtDoubleInterval& QwtDoubleInterval::operator|=(double value)
+{
+    *this = *this | value;
+    return *this;
+}
+
diff --git a/src/qwt/qwt_double_range.cpp b/src/qwt/qwt_double_range.cpp
new file mode 100644
index 0000000..26e3ef6
--- /dev/null
+++ b/src/qwt/qwt_double_range.cpp
@@ -0,0 +1,389 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_double_range.h"
+#include "qwt_math.h"
+
+static double MinRelStep = 1.0e-10;
+static double DefaultRelStep = 1.0e-2;
+static double MinEps = 1.0e-10;
+
+/*!
+  The range is initialized to [0.0, 100.0], the
+  step size to 1.0, and the value to 0.0.
+*/
+QwtDoubleRange::QwtDoubleRange():
+    d_minValue(0.0),
+    d_maxValue(0.0),
+    d_step(1.0),
+    d_pageSize(1),
+    d_isValid(false),
+    d_value(0.0),
+    d_exactValue(0.0),
+    d_exactPrevValue(0.0),
+    d_prevValue(0.0),
+    d_periodic(false)
+{
+}
+
+//! Destroys the QwtDoubleRange
+QwtDoubleRange::~QwtDoubleRange()
+{
+}
+
+//! Set the value to be valid/invalid
+void QwtDoubleRange::setValid(bool isValid)
+{
+    if ( isValid != d_isValid )
+    {
+        d_isValid = isValid;
+        valueChange();
+    }
+}
+
+//! Indicates if the value is valid
+bool QwtDoubleRange::isValid() const
+{
+    return d_isValid;
+}
+
+/*!
+  \brief No docs
+  
+  Description
+  \param x ???
+  \param align
+  \todo Documentation
+*/
+void QwtDoubleRange::setNewValue(double x, int align)
+{
+    double vmin,vmax;
+    
+    d_prevValue = d_value;
+
+    vmin = qwtMin(d_minValue, d_maxValue);
+    vmax = qwtMax(d_minValue, d_maxValue);
+
+    // 
+    // Range check
+    //
+    if (x < vmin)
+    {
+        if ((d_periodic) && (vmin != vmax))
+           d_value = x + ceil( (vmin - x) / (vmax - vmin ) ) 
+              * (vmax - vmin);
+        else
+           d_value = vmin;
+    }
+    else if (x > vmax)
+    {
+        if ((d_periodic) && (vmin != vmax))
+           d_value = x - ceil( ( x - vmax) / (vmax - vmin )) 
+              * (vmax - vmin);
+        else
+           d_value = vmax;
+    }
+    else
+       d_value = x;
+
+    d_exactPrevValue = d_exactValue;
+    d_exactValue = d_value;
+    
+    // align to grid
+    if (align)
+    {
+        if (d_step != 0.0)
+           d_value = d_minValue +
+             qRound((d_value - d_minValue) / d_step) * d_step;
+        else
+           d_value = d_minValue;
+        
+        // correct rounding error at the border
+        if (fabs(d_value - d_maxValue) < MinEps * qwtAbs(d_step))
+           d_value = d_maxValue;
+
+        // correct rounding error if value = 0
+        if (fabs(d_value) < MinEps * qwtAbs(d_step))
+           d_value = 0.0;
+    }
+
+    if (!d_isValid || d_prevValue != d_value)
+    {
+        d_isValid = true;
+        valueChange();
+    }
+}
+
+/*!
+  \brief  Adjust the value to the closest point in the step raster.
+  \param x value
+  \warning The value is clipped when it lies outside the range.
+  When the range is QwtDoubleRange::periodic, it will
+  be mapped to a point in the interval such that
+  \verbatim new value := x + n * (max. value - min. value)\endverbatim
+  with an integer number n.
+*/
+void QwtDoubleRange::fitValue(double x)
+{
+    setNewValue(x,1);
+}
+
+
+/*!
+  \brief Set a new value without adjusting to the step raster
+  \param x new value
+  \warning The value is clipped when it lies outside the range.
+  When the range is QwtDoubleRange::periodic, it will
+  be mapped to a point in the interval such that
+  \verbatim new value := x + n * (max. value - min. value)\endverbatim
+  with an integer number n.
+*/
+void QwtDoubleRange::setValue(double x)
+{
+    setNewValue(x,0);
+}
+
+/*!
+  \brief Specify  range and step size
+
+  \param vmin   lower boundary of the interval
+  \param vmax   higher boundary of the interval
+  \param vstep  step width
+  \param pageSize  page size in steps
+  \warning
+  \li A change of the range changes the value if it lies outside the
+      new range. The current value
+      will *not* be adjusted to the new step raster.
+  \li vmax < vmin is allowed.
+  \li If the step size is left out or set to zero, it will be
+      set to 1/100 of the interval length.
+  \li If the step size has an absurd value, it will be corrected
+      to a better one.
+*/
+void QwtDoubleRange::setRange(double vmin, double vmax, double vstep, int pageSize)
+{
+    bool rchg = ((d_maxValue != vmax) || (d_minValue != vmin));
+    
+    if (rchg) 
+    {
+        d_minValue = vmin;
+        d_maxValue = vmax;
+    }
+    
+    //
+    // look if the step width has an acceptable 
+    // value or otherwise change it.
+    //
+    setStep(vstep);
+
+    //
+    // limit page size
+    //
+    d_pageSize = qwtLim(pageSize,0, 
+        int(qwtAbs((d_maxValue - d_minValue) / d_step))); 
+    
+    // 
+    // If the value lies out of the range, it 
+    // will be changed. Note that it will not be adjusted to 
+    // the new step width.
+    setNewValue(d_value,0);
+    
+    // call notifier after the step width has been 
+    // adjusted.
+    if (rchg)
+       rangeChange();
+}
+
+/*!
+  \brief Change the step raster     
+  \param vstep new step width
+  \warning The value will \e not be adjusted to the new step raster.
+*/
+void QwtDoubleRange::setStep(double vstep)
+{
+    double intv = d_maxValue - d_minValue;
+    
+    double newStep;
+    if (vstep == 0.0)
+       newStep = intv * DefaultRelStep;
+    else
+    {
+        if ((intv > 0) && (vstep < 0) || (intv < 0) && (vstep > 0))
+           newStep = -vstep;
+        else
+           newStep = vstep;
+        
+        if ( fabs(newStep) < fabs(MinRelStep * intv) )
+           newStep = MinRelStep * intv;
+    }
+    
+    if (newStep != d_step)
+    {
+        d_step = newStep;
+        stepChange();
+    }
+}
+
+
+/*!
+  \brief Make the range periodic
+
+  When the range is periodic, the value will be set to a point
+  inside the interval such that
+
+  \verbatim point = value + n * width \endverbatim
+
+  if the user tries to set a new value which is outside the range.
+  If the range is nonperiodic (the default), values outside the
+  range will be clipped.
+
+  \param tf true for a periodic range
+*/
+void QwtDoubleRange::setPeriodic(bool tf)
+{
+    d_periodic = tf;
+}
+
+/*!
+  \brief Increment the value by a specified number of steps
+  \param nSteps Number of steps to increment
+  \warning As a result of this operation, the new value will always be
+       adjusted to the step raster.
+*/
+void QwtDoubleRange::incValue(int nSteps)
+{
+    if ( isValid() )
+        setNewValue(d_value + double(nSteps) * d_step,1);
+}
+
+/*!
+  \brief Increment the value by a specified number of pages
+  \param nPages Number of pages to increment.
+        A negative number decrements the value.
+  \warning The Page size is specified in the constructor.
+*/
+void QwtDoubleRange::incPages(int nPages)
+{
+    if ( isValid() )
+        setNewValue(d_value + double(nPages) * double(d_pageSize) * d_step,1);
+}
+
+/*!
+  \brief Notify a change of value
+
+  This virtual function is called whenever the value changes.
+  The default implementation does nothing.
+*/
+void QwtDoubleRange::valueChange()
+{
+}
+
+
+/*!
+  \brief Notify a change of the range
+
+  This virtual function is called whenever the range changes.
+  The default implementation does nothing.
+*/
+void QwtDoubleRange::rangeChange()
+{
+}
+
+
+/*!
+  \brief Notify a change of the step size
+
+  This virtual function is called whenever the step size changes.
+  The default implementation does nothing.
+*/
+void QwtDoubleRange::stepChange()
+{
+}
+
+/*!
+  \return the step size
+  \sa QwtDoubleRange::setStep, QwtDoubleRange::setRange
+*/
+double QwtDoubleRange::step() const
+{
+    return qwtAbs(d_step);
+}
+
+/*!
+  \brief Returns the value of the second border of the range
+
+  maxValue returns the value which has been specified
+  as the second parameter in  QwtDoubleRange::setRange.
+    
+  \sa QwtDoubleRange::setRange()
+*/  
+double QwtDoubleRange::maxValue() const
+{   
+    return d_maxValue;
+} 
+    
+/*!
+  \brief Returns the value at the first border of the range
+    
+  minValue returns the value which has been specified
+  as the first parameter in  setRange().
+    
+  \sa QwtDoubleRange::setRange()
+*/
+double QwtDoubleRange::minValue() const 
+{
+    return d_minValue; 
+}   
+
+/*!
+  \brief Returns true if the range is periodic
+  \sa QwtDoubleRange::setPeriodic()
+*/
+bool QwtDoubleRange::periodic() const 
+{ 
+    return d_periodic; 
+}
+
+//! Returns the page size in steps.
+int QwtDoubleRange::pageSize() const 
+{ 
+    return d_pageSize; 
+}
+
+//! Returns the current value.
+double QwtDoubleRange::value() const 
+{ 
+    return d_value; 
+}
+
+/*!
+  \brief Returns the exact value
+
+  The exact value is the value which QwtDoubleRange::value would return
+  if the value were not adjusted to the step raster. It differs from
+  the current value only if QwtDoubleRange::fitValue or
+  QwtDoubleRange::incValue have been used before. This function
+  is intended for internal use in derived classes.
+*/
+double QwtDoubleRange::exactValue() const 
+{ 
+    return d_exactValue; 
+}
+
+//! Returns the exact previous value
+double QwtDoubleRange::exactPrevValue() const 
+{ 
+    return d_exactPrevValue; 
+}
+
+//! Returns the previous value
+double QwtDoubleRange::prevValue() const 
+{ 
+    return d_prevValue; 
+}
diff --git a/src/qwt/qwt_double_rect.cpp b/src/qwt/qwt_double_rect.cpp
new file mode 100644
index 0000000..4923685
--- /dev/null
+++ b/src/qwt/qwt_double_rect.cpp
@@ -0,0 +1,592 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qglobal.h>
+
+#if QT_VERSION < 0x040000
+
+#include "qwt_math.h"
+#include "qwt_double_rect.h"
+
+/*! 
+    Constructs a null point.
+
+    \sa QwtDoublePoint::isNull
+*/
+QwtDoublePoint::QwtDoublePoint():
+    d_x(0.0),
+    d_y(0.0)
+{
+}
+
+//! Constructs a point with coordinates specified by x and y.
+QwtDoublePoint::QwtDoublePoint(double x, double y ):
+    d_x(x),
+    d_y(y)
+{
+}
+
+/*! 
+    Copy constructor. 
+
+    Constructs a point using the values of the point specified.
+*/
+QwtDoublePoint::QwtDoublePoint(const QPoint &p):
+    d_x(double(p.x())),
+    d_y(double(p.y()))
+{
+}
+
+/*! 
+    Returns true if point1 is equal to point2; otherwise returns false.
+
+    Two points are equal to each other if both x-coordinates and 
+    both y-coordinates are the same.
+*/
+bool QwtDoublePoint::operator==(const QwtDoublePoint &other) const
+{
+    return (d_x == other.d_x) && (d_y == other.d_y);
+}
+
+//! Returns true if point1 is not equal to point2; otherwise returns false.
+bool QwtDoublePoint::operator!=(const QwtDoublePoint &other) const
+{
+    return !operator==(other);
+}
+
+/*! 
+    Negates the coordinates of the point, and returns a point with the 
+    new coordinates. (Inversion).
+*/
+const QwtDoublePoint QwtDoublePoint::operator-() const
+{
+    return QwtDoublePoint(-d_x, -d_y);
+}
+
+/*! 
+    Adds the coordinates of the point to the corresponding coordinates of 
+    the other point, and returns a point with the new coordinates. 
+    (Vector addition.)
+*/
+const QwtDoublePoint QwtDoublePoint::operator+(
+    const QwtDoublePoint &other) const
+{
+    return QwtDoublePoint(d_x + other.d_x, d_y + other.d_y);
+}
+
+/*! 
+    Subtracts the coordinates of the other point from the corresponding 
+    coordinates of the given point, and returns a point with the new 
+    coordinates. (Vector subtraction.)
+*/
+const QwtDoublePoint QwtDoublePoint::operator-(
+    const QwtDoublePoint &other) const
+{
+    return QwtDoublePoint(d_x - other.d_x, d_y - other.d_y);
+}
+
+/*!
+    Multiplies the coordinates of the point by the given scale factor, 
+    and returns a point with the new coordinates. 
+    (Scalar multiplication of a vector.)
+*/
+const QwtDoublePoint QwtDoublePoint::operator*(double factor) const
+{
+    return QwtDoublePoint(d_x * factor, d_y * factor);
+}
+
+/*!
+    Divides the coordinates of the point by the given scale factor, 
+    and returns a point with the new coordinates. 
+    (Scalar division of a vector.)
+*/
+const QwtDoublePoint QwtDoublePoint::operator/(double factor) const
+{
+    return QwtDoublePoint(d_x / factor, d_y / factor);
+}
+
+/*!
+    Adds the coordinates of this point to the corresponding coordinates 
+    of the other point, and returns a reference to this point with the 
+    new coordinates. This is equivalent to vector addition.
+*/
+QwtDoublePoint &QwtDoublePoint::operator+=(const QwtDoublePoint &other)
+{
+    d_x += other.d_x;
+    d_y += other.d_y;
+    return *this;
+}
+
+/*!
+    Subtracts the coordinates of the other point from the corresponding 
+    coordinates of this point, and returns a reference to this point with 
+    the new coordinates. This is equivalent to vector subtraction.
+*/
+QwtDoublePoint &QwtDoublePoint::operator-=(const QwtDoublePoint &other)
+{
+    d_x -= other.d_x;
+    d_y -= other.d_y;
+    return *this;
+}
+
+/*!
+    Multiplies the coordinates of this point by the given scale factor, 
+    and returns a reference to this point with the new coordinates. 
+    This is equivalent to scalar multiplication of a vector.
+*/
+QwtDoublePoint &QwtDoublePoint::operator*=(double factor)
+{
+    d_x *= factor;
+    d_y *= factor;
+    return *this;
+}
+
+/*!
+    Divides the coordinates of this point by the given scale factor, 
+    and returns a references to this point with the new coordinates. 
+    This is equivalent to scalar division of a vector.
+*/
+QwtDoublePoint &QwtDoublePoint::operator/=(double factor)
+{
+    d_x /= factor;
+    d_y /= factor;
+    return *this;
+}
+
+//! Constructs an invalid size.
+QwtDoubleSize::QwtDoubleSize():
+    d_width(-1.0),
+    d_height(-1.0)
+{   
+}   
+
+//! Constructs a size with width width and height height.
+QwtDoubleSize::QwtDoubleSize( double width, double height ):
+    d_width(width),
+    d_height(height)
+{   
+}   
+
+//! Constructs a size with floating point accuracy from the given size.
+QwtDoubleSize::QwtDoubleSize(const QSize &sz):
+    d_width(double(sz.width())),
+    d_height(double(sz.height()))
+{   
+}   
+
+//! Swaps the width and height values.
+void QwtDoubleSize::transpose()
+{   
+    double tmp = d_width;
+    d_width = d_height;
+    d_height = tmp;
+}
+
+/*! 
+    Returns a size with the maximum width and height of this 
+    size and other.
+*/
+QwtDoubleSize QwtDoubleSize::expandedTo(
+    const QwtDoubleSize &other) const
+{   
+    return QwtDoubleSize(
+        qwtMax(d_width, other.d_width),
+        qwtMax(d_height, other.d_height)
+    );  
+}   
+
+/*!
+    Returns a size with the minimum width and height of this size and other.
+*/
+QwtDoubleSize QwtDoubleSize::boundedTo(
+    const QwtDoubleSize &other) const
+{   
+    return QwtDoubleSize(
+        qwtMin(d_width, other.d_width),
+        qwtMin(d_height, other.d_height)
+    );  
+}   
+
+//! Returns true if s1 and s2 are equal; otherwise returns false.
+bool QwtDoubleSize::operator==(const QwtDoubleSize &other) const
+{ 
+    return d_width == other.d_width && d_height == other.d_height;
+}   
+
+//! Returns true if s1 and s2 are different; otherwise returns false.
+bool QwtDoubleSize::operator!=(const QwtDoubleSize &other) const
+{ 
+    return !operator==(other);
+}   
+
+/*! 
+  Returns the size formed by adding both components by
+  the components of other. Each component is added separately.
+*/
+const QwtDoubleSize QwtDoubleSize::operator+(
+    const QwtDoubleSize &other) const
+{   
+    return QwtDoubleSize(d_width + other.d_width,
+        d_height + other.d_height); 
+}       
+
+/*! 
+  Returns the size formed by subtracting both components by
+  the components of other. Each component is subtracted separately.
+*/  
+const QwtDoubleSize QwtDoubleSize::operator-(
+    const QwtDoubleSize &other) const
+{   
+    return QwtDoubleSize(d_width - other.d_width,
+        d_height - other.d_height); 
+}       
+
+//! Returns the size formed by multiplying both components by c.
+const QwtDoubleSize QwtDoubleSize::operator*(double c) const
+{ 
+    return QwtDoubleSize(d_width * c, d_height * c);
+}   
+
+//! Returns the size formed by dividing both components by c.
+const QwtDoubleSize QwtDoubleSize::operator/(double c) const
+{ 
+    return QwtDoubleSize(d_width / c, d_height / c);
+}   
+
+//! Adds size other to this size and returns a reference to this size.
+QwtDoubleSize &QwtDoubleSize::operator+=(const QwtDoubleSize &other)
+{   
+    d_width += other.d_width; 
+    d_height += other.d_height;
+    return *this;
+}
+
+//! Subtracts size other from this size and returns a reference to this size.
+QwtDoubleSize &QwtDoubleSize::operator-=(const QwtDoubleSize &other)
+{   
+    d_width -= other.d_width; 
+    d_height -= other.d_height;
+    return *this;
+}
+
+/* 
+  Multiplies this size's width and height by c, 
+  and returns a reference to this size.
+*/
+QwtDoubleSize &QwtDoubleSize::operator*=(double c)
+{   
+    d_width *= c; 
+    d_height *= c;
+    return *this;
+}
+
+/* 
+  Devides this size's width and height by c, 
+  and returns a reference to this size.
+*/
+QwtDoubleSize &QwtDoubleSize::operator/=(double c)
+{
+    d_width /= c;
+    d_height /= c;
+    return *this;
+}   
+
+//! Constructs an rectangle with all components set to 0.0 
+QwtDoubleRect::QwtDoubleRect():
+    d_left(0.0),
+    d_right(0.0),
+    d_top(0.0),
+    d_bottom(0.0)
+{
+}
+
+/*! 
+  Constructs an rectangle with x1 to x2 as x-range and,
+  y1 to y2 as y-range.
+*/
+QwtDoubleRect::QwtDoubleRect(double left, double top,
+        double width, double height):
+    d_left(left),
+    d_right(left + width),
+    d_top(top),
+    d_bottom(top + height)
+{
+}
+
+/*! 
+  Constructs a rectangle with topLeft as the top-left corner and 
+  size as the rectangle size.
+*/
+QwtDoubleRect::QwtDoubleRect(
+        const QwtDoublePoint &p, const QwtDoubleSize &size):
+    d_left(p.x()),
+    d_right(p.x() + size.width()),
+    d_top(p.y()),
+    d_bottom(p.y() + size.height())
+{
+}
+
+/*! 
+  Set the x-range from x1 to x2 and the y-range from y1 to y2.
+*/
+void QwtDoubleRect::setRect(double left, double top, 
+    double width, double height)
+{
+    d_left = left;
+    d_right = left + width;
+    d_top = top;
+    d_bottom = top + height;
+}
+
+/*!
+  Sets the size of the rectangle to size. 
+  Changes x2 and y2 only.
+*/
+void QwtDoubleRect::setSize(const QwtDoubleSize &size)
+{
+    setWidth(size.width());
+    setHeight(size.height());
+}
+
+/*!
+  Returns a normalized rectangle, i.e. a rectangle that has a non-negative 
+  width and height. 
+
+  It swaps x1 and x2 if x1() > x2(), and swaps y1 and y2 if y1() > y2(). 
+*/
+QwtDoubleRect QwtDoubleRect::normalized() const
+{
+    QwtDoubleRect r;
+    if ( d_right < d_left ) 
+    {
+        r.d_left = d_right;
+        r.d_right = d_left;
+    } 
+    else 
+    {
+        r.d_left = d_left;
+        r.d_right = d_right; 
+    }
+    if ( d_bottom < d_top ) 
+    { 
+        r.d_top = d_bottom; 
+        r.d_bottom = d_top;
+    } 
+    else 
+    {
+        r.d_top = d_top;
+        r.d_bottom = d_bottom;
+    }
+    return r;
+}
+
+/*!
+  Returns the bounding rectangle of this rectangle and rectangle other. 
+  r.unite(s) is equivalent to r|s. 
+*/
+QwtDoubleRect QwtDoubleRect::unite(const QwtDoubleRect &other) const
+{
+    return *this | other;
+}
+
+/*!
+  Returns the intersection of this rectangle and rectangle other. 
+  r.intersect(s) is equivalent to r&s. 
+*/
+QwtDoubleRect QwtDoubleRect::intersect(const QwtDoubleRect &other) const
+{
+    return *this & other;
+}
+
+/*!
+  Returns true if this rectangle intersects with rectangle other; 
+  otherwise returns false. 
+*/
+bool QwtDoubleRect::intersects(const QwtDoubleRect &other) const
+{
+    return ( qwtMax(d_left, other.d_left) <= qwtMin(d_right, other.d_right) ) &&
+         ( qwtMax(d_top, other.d_top ) <= qwtMin(d_bottom, other.d_bottom) );
+}
+
+//! Returns true if this rect and other are equal; otherwise returns false. 
+bool QwtDoubleRect::operator==(const QwtDoubleRect &other) const
+{
+    return d_left == other.d_left && d_right == other.d_right && 
+        d_top == other.d_top && d_bottom == other.d_bottom;
+}
+
+//! Returns true if this rect and other are different; otherwise returns false. 
+bool QwtDoubleRect::operator!=(const QwtDoubleRect &other) const
+{
+    return !operator==(other);
+}
+
+/*!
+  Returns the bounding rectangle of this rectangle and rectangle other. 
+  The bounding rectangle of a nonempty rectangle and an empty or 
+  invalid rectangle is defined to be the nonempty rectangle. 
+*/
+QwtDoubleRect QwtDoubleRect::operator|(const QwtDoubleRect &other) const
+{
+    if ( !isEmpty() ) 
+        return other;
+
+    if ( !other.isEmpty() ) 
+        return *this;
+        
+    const double minX = qwtMin(d_left, other.d_left);
+    const double maxX = qwtMax(d_right, other.d_right);
+    const double minY = qwtMin(d_top, other.d_top);
+    const double maxY = qwtMax(d_bottom, other.d_bottom);
+
+    return QwtDoubleRect(minX, minY, maxX - minX, maxY - minY);
+}
+
+/*!
+  Returns the intersection of this rectangle and rectangle other. 
+  Returns an empty rectangle if there is no intersection. 
+*/
+QwtDoubleRect QwtDoubleRect::operator&(const QwtDoubleRect &other) const
+{
+    if (isNull() || other.isNull())
+        return QwtDoubleRect();
+
+    const QwtDoubleRect r1 = normalized();
+    const QwtDoubleRect r2 = other.normalized();
+
+    const double minX = qwtMax(r1.left(), r2.left());
+    const double maxX = qwtMin(r1.right(), r2.right());
+    const double minY = qwtMax(r1.top(), r2.top());
+    const double maxY = qwtMin(r1.bottom(), r2.bottom());
+
+    return QwtDoubleRect(minX, minY, maxX - minX, maxY - minY);
+}
+
+//! Unites this rectangle with rectangle other. 
+QwtDoubleRect &QwtDoubleRect::operator|=(const QwtDoubleRect &other)
+{
+    *this = *this | other;
+    return *this;
+}
+
+//! Intersects this rectangle with rectangle other. 
+QwtDoubleRect &QwtDoubleRect::operator&=(const QwtDoubleRect &other)
+{
+    *this = *this & other;
+    return *this;
+}
+
+//! Returns the center point of the rectangle. 
+QwtDoublePoint QwtDoubleRect::center() const
+{
+    return QwtDoublePoint(d_left + (d_right - d_left) / 2.0, 
+        d_top + (d_bottom - d_top) / 2.0);
+}
+
+/*!
+  Returns true if the point (x, y) is inside or on the edge of the rectangle; 
+  otherwise returns false. 
+
+  If proper is true, this function returns true only if p is inside 
+  (not on the edge). 
+*/
+bool QwtDoubleRect::contains(double x, double y, bool proper) const
+{
+    if ( proper )
+        return x > d_left && x < d_right && y > d_top && y < d_bottom;
+    else
+        return x >= d_left && x <= d_right && y >= d_top && y <= d_bottom;
+}
+
+/*!
+  Returns true if the point p is inside or on the edge of the rectangle; 
+  otherwise returns false. 
+
+  If proper is true, this function returns true only if p is inside 
+  (not on the edge). 
+*/
+bool QwtDoubleRect::contains(const QwtDoublePoint &p, bool proper) const
+{
+    return contains(p.x(), p.y(), proper);
+}
+
+/*!
+  Returns true if the rectangle other is inside this rectangle; 
+  otherwise returns false. 
+
+  If proper is true, this function returns true only if other is entirely 
+  inside (not on the edge). 
+*/
+bool QwtDoubleRect::contains(const QwtDoubleRect &other, bool proper) const
+{
+    return contains(other.d_left, other.d_top, proper) && 
+        contains(other.d_right, other.d_bottom, proper);
+}
+
+//! moves x1() to x, leaving the size unchanged
+void QwtDoubleRect::moveLeft(double x)
+{
+    const double w = width();
+    d_left = x;
+    d_right = d_left + w;
+}
+
+//! moves x1() to x, leaving the size unchanged
+void QwtDoubleRect::moveRight(double x)
+{
+    const double w = width();
+    d_right = x;
+    d_left = d_right - w;
+}
+
+//! moves y1() to y, leaving the size unchanged
+void QwtDoubleRect::moveTop(double y)
+{
+    const double h = height();
+    d_top = y;
+    d_bottom = d_top + h;
+}
+
+//! moves y1() to y, leaving the size unchanged
+void QwtDoubleRect::moveBottom(double y)
+{
+    const double h = height();
+    d_bottom = y;
+    d_top = d_bottom - h;
+}
+
+//! moves left() to x and top() to y, leaving the size unchanged
+void QwtDoubleRect::moveTo(double x, double y)
+{
+    moveLeft(x);
+    moveTop(y);
+}
+
+//! moves x1() by dx and y1() by dy. leaving the size unchanged
+void QwtDoubleRect::moveBy(double dx, double dy)
+{
+    d_left += dx;
+    d_right += dx;
+    d_top += dy;
+    d_bottom += dy;
+}
+
+//! moves the center to pos, leaving the size unchanged
+void QwtDoubleRect::moveCenter(const QwtDoublePoint &pos)
+{
+    moveCenter(pos.x(), pos.y());
+}
+
+//! moves the center to (x, y), leaving the size unchanged
+void QwtDoubleRect::moveCenter(double x, double y)
+{
+    moveTo(x - width() / 2.0, y - height() / 2.0);
+}
+
+#endif // QT_VERSION < 0x040000
diff --git a/src/qwt/qwt_dyngrid_layout.cpp b/src/qwt/qwt_dyngrid_layout.cpp
new file mode 100644
index 0000000..5436c6b
--- /dev/null
+++ b/src/qwt/qwt_dyngrid_layout.cpp
@@ -0,0 +1,691 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qwidget.h>
+#include "qwt_dyngrid_layout.h"
+#include "qwt_math.h"
+
+#if QT_VERSION < 0x040000
+#include <qvaluelist.h>
+#else
+#include <qlist.h>
+#endif
+
+class QwtDynGridLayout::PrivateData
+{
+public:
+
+#if QT_VERSION < 0x040000
+    class LayoutIterator: public QGLayoutIterator
+    {
+    public:
+        LayoutIterator(PrivateData *data):
+            d_data(data)  
+        {
+            d_iterator = d_data->itemList.begin();
+        }
+
+        virtual QLayoutItem *current()
+        { 
+            if (d_iterator == d_data->itemList.end())
+               return NULL;
+
+            return *d_iterator;
+        }
+
+        virtual QLayoutItem *next()
+        { 
+            if (d_iterator == d_data->itemList.end())
+               return NULL;
+
+            d_iterator++;
+            if (d_iterator == d_data->itemList.end())
+               return NULL;
+
+            return *d_iterator;
+        }
+
+        virtual QLayoutItem *takeCurrent()
+        { 
+            if ( d_iterator == d_data->itemList.end() )
+                return NULL;
+
+            QLayoutItem *item = *d_iterator;
+
+            d_data->isDirty = true;
+            d_iterator = d_data->itemList.remove(d_iterator);
+            return item;
+        }
+
+    private:
+        
+        QValueListIterator<QLayoutItem*> d_iterator;
+        QwtDynGridLayout::PrivateData *d_data;
+    };
+#endif
+
+    PrivateData():
+        isDirty(true)
+    {
+    }
+
+#if QT_VERSION < 0x040000
+    typedef QValueList<QLayoutItem*> LayoutItemList;
+#else
+    typedef QList<QLayoutItem*> LayoutItemList;
+#endif
+
+    mutable LayoutItemList itemList;
+
+    uint maxCols;
+    uint numRows;
+    uint numCols;
+
+#if QT_VERSION < 0x040000
+    QSizePolicy::ExpandData expanding;
+#else
+    Qt::Orientations expanding;
+#endif
+
+    bool isDirty;
+    QwtArray<QSize> itemSizeHints;
+};
+
+
+/*!
+  \param parent Parent widget
+  \param margin Margin
+  \param spacing Spacing
+*/
+
+QwtDynGridLayout::QwtDynGridLayout(QWidget *parent, 
+        int margin, int spacing):
+    QLayout(parent)
+{
+    init();
+
+    setSpacing(spacing);
+    setMargin(margin);
+}
+
+#if QT_VERSION < 0x040000
+/*!
+  \param parent Parent widget
+  \param spacing Spacing
+*/
+QwtDynGridLayout::QwtDynGridLayout(QLayout *parent, int spacing):
+    QLayout(parent, spacing)
+{
+    init();
+}
+#endif
+
+/*!
+  \param spacing Spacing
+*/
+
+QwtDynGridLayout::QwtDynGridLayout(int spacing)
+{
+    init();
+    setSpacing(spacing);
+}
+
+/*!
+  Initialize the layout with default values.
+*/
+void QwtDynGridLayout::init()
+{
+    d_data = new QwtDynGridLayout::PrivateData;
+    d_data->maxCols = d_data->numRows 
+        = d_data->numCols = 0;
+
+#if QT_VERSION < 0x040000
+    d_data->expanding = QSizePolicy::NoDirection;
+    setSupportsMargin(true);
+#else
+    d_data->expanding = 0;
+#endif
+}
+
+//! Destructor
+
+QwtDynGridLayout::~QwtDynGridLayout()
+{
+#if QT_VERSION < 0x040000
+    deleteAllItems(); 
+#endif
+
+    delete d_data;
+}
+
+void QwtDynGridLayout::invalidate()
+{
+    d_data->isDirty = true;
+    QLayout::invalidate();
+}
+
+void QwtDynGridLayout::updateLayoutCache()
+{
+    d_data->itemSizeHints.resize(itemCount());
+
+    int index = 0;
+
+    for (PrivateData::LayoutItemList::iterator it = d_data->itemList.begin();
+        it != d_data->itemList.end(); ++it, index++)
+    {
+        d_data->itemSizeHints[int(index)] = (*it)->sizeHint();
+    }
+
+    d_data->isDirty = false;
+}
+
+/*!
+  Limit the number of columns.
+  \param maxCols upper limit, 0 means unlimited
+  \sa QwtDynGridLayout::maxCols()
+*/
+  
+void QwtDynGridLayout::setMaxCols(uint maxCols)
+{
+    d_data->maxCols = maxCols;
+}
+
+/*!
+  Return the upper limit for the number of columns.
+  0 means unlimited, what is the default.
+  \sa QwtDynGridLayout::setMaxCols()
+*/
+
+uint QwtDynGridLayout::maxCols() const 
+{ 
+    return d_data->maxCols; 
+}
+
+//! Adds item to the next free position.
+
+void QwtDynGridLayout::addItem(QLayoutItem *item)
+{
+    d_data->itemList.append(item);
+    invalidate();
+}
+
+/*! 
+  \return true if this layout is empty. 
+*/
+
+bool QwtDynGridLayout::isEmpty() const
+{
+    return d_data->itemList.isEmpty();
+}
+
+/*! 
+  \return number of layout items
+*/
+
+uint QwtDynGridLayout::itemCount() const
+{
+    return d_data->itemList.count();
+}
+
+#if  QT_VERSION < 0x040000
+/*! 
+  \return An iterator over the children of this layout.
+*/
+
+QLayoutIterator QwtDynGridLayout::iterator()
+{       
+    return QLayoutIterator( 
+        new QwtDynGridLayout::PrivateData::LayoutIterator(d_data) );
+}
+
+/*!
+  Set whether this layout can make use of more space than sizeHint(). 
+  A value of Vertical or Horizontal means that it wants to grow in only 
+  one dimension, while BothDirections means that it wants to grow in 
+  both dimensions. The default value is NoDirection. 
+  \sa QwtDynGridLayout::expanding()
+*/
+
+void QwtDynGridLayout::setExpanding(QSizePolicy::ExpandData expanding)
+{
+    d_data->expanding = expanding;
+}
+
+/*!
+  Returns whether this layout can make use of more space than sizeHint(). 
+  A value of Vertical or Horizontal means that it wants to grow in only 
+  one dimension, while BothDirections means that it wants to grow in 
+  both dimensions. 
+  \sa QwtDynGridLayout::setExpanding()
+*/
+
+QSizePolicy::ExpandData QwtDynGridLayout::expanding() const
+{
+    return d_data->expanding;
+}
+
+#else // QT_VERSION >= 0x040000
+
+QLayoutItem *QwtDynGridLayout::itemAt( int index ) const
+{
+    if ( index < 0 || index >= d_data->itemList.count() )
+        return NULL;
+
+    return d_data->itemList.at(index);
+}
+    
+QLayoutItem *QwtDynGridLayout::takeAt( int index )
+{
+    if ( index < 0 || index >= d_data->itemList.count() )
+        return NULL;
+  
+    d_data->isDirty = true;
+    return d_data->itemList.takeAt(index);
+}
+
+int QwtDynGridLayout::count() const
+{
+    return d_data->itemList.count();
+}
+
+void QwtDynGridLayout::setExpandingDirections(Qt::Orientations expanding)
+{
+    d_data->expanding = expanding;
+}
+
+Qt::Orientations QwtDynGridLayout::expandingDirections() const
+{
+    return d_data->expanding;
+}
+
+#endif
+
+/*!
+  Reorganizes columns and rows and resizes managed widgets within 
+  the rectangle rect. 
+*/
+
+void QwtDynGridLayout::setGeometry(const QRect &rect)
+{
+    QLayout::setGeometry(rect);
+
+    if ( isEmpty() )
+        return;
+
+    d_data->numCols = columnsForWidth(rect.width());
+    d_data->numRows = itemCount() / d_data->numCols;
+    if ( itemCount() % d_data->numCols )
+        d_data->numRows++;
+
+#if QT_VERSION < 0x040000
+    QValueList<QRect> itemGeometries = layoutItems(rect, d_data->numCols);
+#else
+    QList<QRect> itemGeometries = layoutItems(rect, d_data->numCols);
+#endif
+
+    int index = 0;
+    for (PrivateData::LayoutItemList::iterator it = d_data->itemList.begin();
+        it != d_data->itemList.end(); ++it)
+    {
+        QWidget *w = (*it)->widget();
+        if ( w )
+        {
+            w->setGeometry(itemGeometries[index]);
+            index++;
+        }
+    }
+}
+
+/*! 
+  Calculate the number of columns for a given width. It tries to
+  use as many columns as possible (limited by maxCols())
+
+  \param width Available width for all columns
+  \sa QwtDynGridLayout::maxCols(), QwtDynGridLayout::setMaxCols()
+*/
+
+uint QwtDynGridLayout::columnsForWidth(int width) const
+{
+    if ( isEmpty() )
+        return 0;
+
+    const int maxCols = (d_data->maxCols > 0) ? d_data->maxCols : itemCount();
+    if ( maxRowWidth(maxCols) <= width )
+        return maxCols;
+
+    for (int numCols = 2; numCols <= maxCols; numCols++ )
+    {
+        const int rowWidth = maxRowWidth(numCols);
+        if ( rowWidth > width )
+            return numCols - 1;
+    }
+
+    return 1; // At least 1 column
+}
+
+/*! 
+  Calculate the width of a layout for a given number of
+  columns.
+
+  \param numCols Given number of columns
+  \param itemWidth Array of the width hints for all items
+*/
+int QwtDynGridLayout::maxRowWidth(int numCols) const
+{
+    int col;
+
+    QwtArray<int> colWidth(numCols);
+    for ( col = 0; col < (int)numCols; col++ )
+        colWidth[col] = 0;
+
+    if ( d_data->isDirty )
+        ((QwtDynGridLayout*)this)->updateLayoutCache();
+
+    for ( uint index = 0; 
+        index < (uint)d_data->itemSizeHints.count(); index++ )
+    {
+        col = index % numCols;
+        colWidth[col] = qwtMax(colWidth[col], 
+            d_data->itemSizeHints[int(index)].width());
+    }
+
+    int rowWidth = 2 * margin() + (numCols - 1) * spacing();
+    for ( col = 0; col < (int)numCols; col++ )
+        rowWidth += colWidth[col];
+
+    return rowWidth;
+}
+
+/*!
+  \return the maximum width of all layout items
+*/
+
+int QwtDynGridLayout::maxItemWidth() const
+{
+    if ( isEmpty() )
+        return 0;
+
+    if ( d_data->isDirty )
+        ((QwtDynGridLayout*)this)->updateLayoutCache();
+
+    int w = 0;
+    for ( uint i = 0; i < (uint)d_data->itemSizeHints.count(); i++ )
+    {
+        const int itemW = d_data->itemSizeHints[int(i)].width();
+        if ( itemW > w )
+            w = itemW;
+    }
+
+    return w;
+}
+
+/*!
+  Calculate the geometries of the layout items for a layout
+  with numCols columns and a given rect.
+  \param rect Rect where to place the items
+  \param numCols Number of columns
+  \return item geometries
+*/
+
+#if QT_VERSION < 0x040000
+QValueList<QRect> QwtDynGridLayout::layoutItems(const QRect &rect,
+    uint numCols) const
+#else
+QList<QRect> QwtDynGridLayout::layoutItems(const QRect &rect,
+    uint numCols) const
+#endif
+{
+#if QT_VERSION < 0x040000
+    QValueList<QRect> itemGeometries;
+#else
+    QList<QRect> itemGeometries;
+#endif
+    if ( numCols == 0 || isEmpty() )
+        return itemGeometries;
+
+    uint numRows = itemCount() / numCols;
+    if ( numRows % itemCount() )
+        numRows++;
+ 
+    QwtArray<int> rowHeight(numRows);
+    QwtArray<int> colWidth(numCols);
+ 
+    layoutGrid(numCols, rowHeight, colWidth);
+
+    bool expandH, expandV;
+#if QT_VERSION >= 0x040000
+    expandH = expandingDirections() & Qt::Horizontal;
+    expandV = expandingDirections() & Qt::Vertical;
+#else
+    expandH = expanding() & QSizePolicy::Horizontally;
+    expandV = expanding() & QSizePolicy::Vertically;
+#endif
+
+    if ( expandH || expandV )
+        stretchGrid(rect, numCols, rowHeight, colWidth);
+
+    QwtDynGridLayout *that = (QwtDynGridLayout *)this;
+    const int maxCols = d_data->maxCols;
+    that->d_data->maxCols = numCols;
+    const QRect alignedRect = alignmentRect(rect);
+    that->d_data->maxCols = maxCols;
+
+    const int xOffset = expandH ? 0 : alignedRect.x();
+    const int yOffset = expandV ? 0 : alignedRect.y();
+
+    QwtArray<int> colX(numCols);
+    QwtArray<int> rowY(numRows);
+
+    const int xySpace = spacing();
+
+    rowY[0] = yOffset + margin();
+    for ( int r = 1; r < (int)numRows; r++ )
+        rowY[r] = rowY[r-1] + rowHeight[r-1] + xySpace;
+
+    colX[0] = xOffset + margin();
+    for ( int c = 1; c < (int)numCols; c++ )
+        colX[c] = colX[c-1] + colWidth[c-1] + xySpace;
+    
+    const int itemCount = d_data->itemList.size();
+    for ( int i = 0; i < itemCount; i++ )
+    {
+        const int row = i / numCols;
+        const int col = i % numCols;
+
+        QRect itemGeometry(colX[col], rowY[row], 
+            colWidth[col], rowHeight[row]);
+        itemGeometries.append(itemGeometry);
+    }
+
+    return itemGeometries;
+}
+
+
+/*!
+  Calculate the dimensions for the columns and rows for a grid
+  of numCols columns.
+  \param numCols Number of columns.
+  \param rowHeight Array where to fill in the calculated row heights.
+  \param colWidth Array where to fill in the calculated column widths.
+*/
+
+void QwtDynGridLayout::layoutGrid(uint numCols, 
+    QwtArray<int>& rowHeight, QwtArray<int>& colWidth) const
+{
+    if ( numCols <= 0 )
+        return;
+
+    if ( d_data->isDirty )
+        ((QwtDynGridLayout*)this)->updateLayoutCache();
+
+    for ( uint index = 0; 
+        index < (uint)d_data->itemSizeHints.count(); index++ )
+    {
+        const int row = index / numCols;
+        const int col = index % numCols;
+
+        const QSize &size = d_data->itemSizeHints[int(index)];
+
+        rowHeight[row] = (col == 0) 
+            ? size.height() : qwtMax(rowHeight[row], size.height());
+        colWidth[col] = (row == 0) 
+            ? size.width() : qwtMax(colWidth[col], size.width());
+    }
+}
+
+/*!
+  \return true: QwtDynGridLayout implements heightForWidth.
+  \sa QwtDynGridLayout::heightForWidth()
+*/
+
+bool QwtDynGridLayout::hasHeightForWidth() const
+{
+    return true;
+}
+
+/*!
+  \return The preferred height for this layout, given the width w. 
+  \sa QwtDynGridLayout::hasHeightForWidth()
+*/
+
+int QwtDynGridLayout::heightForWidth(int width) const
+{
+    if ( isEmpty() )
+        return 0;
+
+    const uint numCols = columnsForWidth(width);
+    uint numRows = itemCount() / numCols;
+    if ( itemCount() % numCols )
+        numRows++;
+
+    QwtArray<int> rowHeight(numRows);
+    QwtArray<int> colWidth(numCols);
+
+    layoutGrid(numCols, rowHeight, colWidth);
+
+    int h = 2 * margin() + (numRows - 1) * spacing();
+    for ( int row = 0; row < (int)numRows; row++ )
+        h += rowHeight[row];
+
+    return h;
+}
+
+/*!
+  Stretch columns in case of expanding() & QSizePolicy::Horizontal and
+  rows in case of expanding() & QSizePolicy::Vertical to fill the entire
+  rect. Rows and columns are stretched with the same factor.
+  \sa QwtDynGridLayout::setExpanding(), QwtDynGridLayout::expanding()
+*/
+
+void QwtDynGridLayout::stretchGrid(const QRect &rect, 
+    uint numCols, QwtArray<int>& rowHeight, QwtArray<int>& colWidth) const
+{
+    if ( numCols == 0 || isEmpty() )
+        return;
+
+    bool expandH, expandV;
+#if QT_VERSION >= 0x040000
+    expandH = expandingDirections() & Qt::Horizontal;
+    expandV = expandingDirections() & Qt::Vertical;
+#else
+    expandH = expanding() & QSizePolicy::Horizontally;
+    expandV = expanding() & QSizePolicy::Vertically;
+#endif
+
+    if ( expandH )
+    {
+        int xDelta = rect.width() - 2 * margin() - (numCols - 1) * spacing();
+        for ( int col = 0; col < (int)numCols; col++ )
+            xDelta -= colWidth[col];
+
+        if ( xDelta > 0 )
+        {
+            for ( int col = 0; col < (int)numCols; col++ )
+            {
+                const int space = xDelta / (numCols - col);
+                colWidth[col] += space;
+                xDelta -= space;
+            }
+        }
+    }
+
+    if ( expandV )
+    {
+        uint numRows = itemCount() / numCols;
+        if ( itemCount() % numCols )
+            numRows++;
+
+        int yDelta = rect.height() - 2 * margin() - (numRows - 1) * spacing();
+        for ( int row = 0; row < (int)numRows; row++ )
+            yDelta -= rowHeight[row];
+
+        if ( yDelta > 0 )
+        {
+            for ( int row = 0; row < (int)numRows; row++ )
+            {
+                const int space = yDelta / (numRows - row);
+                rowHeight[row] += space;
+                yDelta -= space;
+            }
+        }
+    }
+}
+
+/*!
+   Return the size hint. If maxCols() > 0 it is the size for
+   a grid with maxCols() columns, otherwise it is the size for
+   a grid with only one row.
+   \sa QwtDynGridLayout::maxCols(), QwtDynGridLayout::setMaxCols()
+*/
+
+QSize QwtDynGridLayout::sizeHint() const
+{
+    if ( isEmpty() )
+        return QSize();
+
+    const uint numCols = (d_data->maxCols > 0 ) ? d_data->maxCols : itemCount();
+    uint numRows = itemCount() / numCols;
+    if ( itemCount() % numCols )
+        numRows++;
+
+    QwtArray<int> rowHeight(numRows);
+    QwtArray<int> colWidth(numCols);
+
+    layoutGrid(numCols, rowHeight, colWidth);
+
+    int h = 2 * margin() + (numRows - 1) * spacing();
+    for ( int row = 0; row < (int)numRows; row++ )
+        h += rowHeight[row];
+
+    int w = 2 * margin() + (numCols - 1) * spacing(); 
+    for ( int col = 0; col < (int)numCols; col++ )
+        w += colWidth[col];
+
+    return QSize(w, h);
+}
+
+/*!
+  \return Number of rows of the current layout.
+  \sa QwtDynGridLayout::numCols
+  \warning The number of rows might change whenever the geometry changes
+*/
+uint QwtDynGridLayout::numRows() const 
+{ 
+    return d_data->numRows; 
+}
+
+/*!
+  \return Number of columns of the current layout.
+  \sa QwtDynGridLayout::numRows
+  \warning The number of columns might change whenever the geometry changes
+*/
+uint QwtDynGridLayout::numCols() const 
+{ 
+    return d_data->numCols; 
+}
diff --git a/src/qwt/qwt_event_pattern.cpp b/src/qwt/qwt_event_pattern.cpp
new file mode 100644
index 0000000..cedf4f7
--- /dev/null
+++ b/src/qwt/qwt_event_pattern.cpp
@@ -0,0 +1,288 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qevent.h>
+#include "qwt_event_pattern.h"
+
+/*! 
+  Constructor
+
+  \sa MousePatternCode, KeyPatternCode
+*/
+
+QwtEventPattern::QwtEventPattern():
+    d_mousePattern(MousePatternCount),
+    d_keyPattern(KeyPatternCount)
+{
+    initKeyPattern();
+    initMousePattern(3);
+}
+
+//! Destructor
+QwtEventPattern::~QwtEventPattern()
+{
+}
+
+/*!
+  Set default mouse patterns, depending on the number of mouse buttons
+
+  \param numButtons Number of mouse buttons ( <= 3 )
+  \sa MousePatternCode
+*/
+void QwtEventPattern::initMousePattern(int numButtons)
+{
+#if QT_VERSION < 0x040000
+    const int altButton = Qt::AltButton;
+    const int controlButton = Qt::ControlButton;
+    const int shiftButton = Qt::ShiftButton;
+#else
+    const int altButton = Qt::AltModifier;
+    const int controlButton = Qt::ControlModifier;
+    const int shiftButton = Qt::ShiftModifier;
+#endif
+
+    d_mousePattern.resize(MousePatternCount);
+
+    switch(numButtons)
+    {
+        case 1:
+        {
+            setMousePattern(MouseSelect1, Qt::LeftButton);
+            setMousePattern(MouseSelect2, Qt::LeftButton, controlButton);
+            setMousePattern(MouseSelect3, Qt::LeftButton, altButton);
+            break;
+        }
+        case 2:
+        {
+            setMousePattern(MouseSelect1, Qt::LeftButton);
+            setMousePattern(MouseSelect2, Qt::RightButton);
+            setMousePattern(MouseSelect3, Qt::LeftButton, altButton);
+            break;
+        }
+        default:
+        {
+            setMousePattern(MouseSelect1, Qt::LeftButton);
+            setMousePattern(MouseSelect2, Qt::RightButton);
+            setMousePattern(MouseSelect3, Qt::MidButton);
+        }
+    }
+    for ( int i = 0; i < 3; i++ )
+    {
+        setMousePattern(MouseSelect4 + i, 
+            d_mousePattern[MouseSelect1 + i].button,
+            d_mousePattern[MouseSelect1 + i].state | shiftButton);
+    }
+}
+
+/*!
+  Set default mouse patterns.
+
+  \sa KeyPatternCode
+*/
+void QwtEventPattern::initKeyPattern()
+{
+    d_keyPattern.resize(KeyPatternCount);
+
+    setKeyPattern(KeySelect1, Qt::Key_Return);
+    setKeyPattern(KeySelect2, Qt::Key_Space);
+    setKeyPattern(KeyAbort, Qt::Key_Escape);
+
+    setKeyPattern(KeyLeft, Qt::Key_Left);
+    setKeyPattern(KeyRight, Qt::Key_Right);
+    setKeyPattern(KeyUp, Qt::Key_Up);
+    setKeyPattern(KeyDown, Qt::Key_Down);
+
+    setKeyPattern(KeyRedo, Qt::Key_Plus);
+    setKeyPattern(KeyUndo, Qt::Key_Minus);
+    setKeyPattern(KeyHome, Qt::Key_Escape);
+}
+
+/*!
+  Change one mouse pattern
+
+  \param pattern Index of the pattern
+  \param button Button
+  \param state State
+
+  \sa QMouseEvent
+*/
+void QwtEventPattern::setMousePattern(uint pattern, int button, int state)
+{
+    if ( pattern < (uint)d_mousePattern.count() )
+    {
+        d_mousePattern[int(pattern)].button = button;
+        d_mousePattern[int(pattern)].state = state;
+    }
+}
+
+/*!
+  Change one key pattern
+
+  \param pattern Index of the pattern
+  \param key Key
+  \param state State
+
+  \sa QKeyEvent
+*/
+void QwtEventPattern::setKeyPattern(uint pattern, int key, int state)
+{
+    if ( pattern < (uint)d_keyPattern.count() )
+    {
+        d_keyPattern[int(pattern)].key = key;
+        d_keyPattern[int(pattern)].state = state;
+    }
+}
+
+//! Change the mouse event patterns
+void QwtEventPattern::setMousePattern(const QwtArray<MousePattern> &pattern)
+{
+    d_mousePattern = pattern;
+}
+
+//! Change the key event patterns
+void QwtEventPattern::setKeyPattern(const QwtArray<KeyPattern> &pattern)
+{
+    d_keyPattern = pattern;
+}
+
+//! Return mouse patterns
+const QwtArray<QwtEventPattern::MousePattern> &
+QwtEventPattern::mousePattern() const
+{
+    return d_mousePattern;
+}
+
+//! Return key patterns
+const QwtArray<QwtEventPattern::KeyPattern> &
+QwtEventPattern::keyPattern() const
+{
+    return d_keyPattern;
+}
+
+//! Return ,ouse patterns
+QwtArray<QwtEventPattern::MousePattern> &QwtEventPattern::mousePattern() 
+{
+    return d_mousePattern;
+}
+
+//! Return Key patterns
+QwtArray<QwtEventPattern::KeyPattern> &QwtEventPattern::keyPattern() 
+{
+    return d_keyPattern;
+}
+
+/*!
+  \brief Compare a mouse event with an event pattern. 
+
+  A mouse event matches the pattern when both have the same button
+  value and in the state value the same key flags(Qt::KeyButtonMask)
+  are set.
+  
+  \param pattern Index of the event pattern
+  \param e Mouse event
+  \return true if matches
+
+  \sa keyMatch()
+*/
+bool QwtEventPattern::mouseMatch(uint pattern, const QMouseEvent *e) const
+{
+    bool ok = false;
+
+    if ( e && pattern < (uint)d_mousePattern.count() )
+        ok = mouseMatch(d_mousePattern[int(pattern)], e);
+
+    return ok;
+}
+
+/*!
+  \brief Compare a mouse event with an event pattern. 
+
+  A mouse event matches the pattern when both have the same button
+  value and in the state value the same key flags(Qt::KeyButtonMask)
+  are set.
+  
+  \param pattern Mouse event pattern
+  \param e Mouse event
+  \return true if matches
+
+  \sa keyMatch()
+*/
+
+bool QwtEventPattern::mouseMatch(const MousePattern &pattern,
+    const QMouseEvent *e) const
+{
+    if ( e->button() != pattern.button )
+        return false;
+
+    const bool matched =
+#if QT_VERSION < 0x040000
+        (e->state() & Qt::KeyButtonMask) == 
+            (pattern.state & Qt::KeyButtonMask);
+#else
+        (e->modifiers() & Qt::KeyboardModifierMask) == 
+            (int)(pattern.state & Qt::KeyboardModifierMask);
+#endif
+
+    return matched;
+}
+
+/*!
+  \brief Compare a key event with an event pattern. 
+
+  A key event matches the pattern when both have the same key
+  value and in the state value the same key flags (Qt::KeyButtonMask)
+  are set.
+  
+  \param pattern Index of the event pattern
+  \param e Key event
+  \return true if matches
+
+  \sa mouseMatch()
+*/
+bool QwtEventPattern::keyMatch(uint pattern, const QKeyEvent *e) const
+{
+    bool ok = false;
+
+    if ( e && pattern < (uint)d_keyPattern.count() )
+        ok = keyMatch(d_keyPattern[int(pattern)], e);
+
+    return ok;
+}
+
+/*!
+  \brief Compare a key event with an event pattern. 
+
+  A key event matches the pattern when both have the same key
+  value and in the state value the same key flags (Qt::KeyButtonMask)
+  are set.
+  
+  \param pattern Key event pattern
+  \param e Key event
+  \return true if matches
+
+  \sa mouseMatch()
+*/
+
+bool QwtEventPattern::keyMatch(
+    const KeyPattern &pattern, const QKeyEvent *e) const
+{
+    if ( e->key() != pattern.key)
+        return false;
+
+    const bool matched =
+#if QT_VERSION < 0x040000
+        (e->state() & Qt::KeyButtonMask) == 
+            (pattern.state & Qt::KeyButtonMask);
+#else
+        (e->modifiers() & Qt::KeyboardModifierMask) == 
+            (int)(pattern.state & Qt::KeyboardModifierMask);
+#endif
+
+    return matched;
+}
diff --git a/src/qwt/qwt_interval_data.cpp b/src/qwt/qwt_interval_data.cpp
new file mode 100644
index 0000000..841d290
--- /dev/null
+++ b/src/qwt/qwt_interval_data.cpp
@@ -0,0 +1,74 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_math.h"
+#include "qwt_interval_data.h"
+
+QwtIntervalData::QwtIntervalData()
+{
+}
+
+QwtIntervalData::QwtIntervalData(
+        const QwtArray<QwtDoubleInterval> &interval, 
+        const QwtArray<double> &y):
+    d_interval(interval),
+    d_y(y)
+{
+}
+    
+void QwtIntervalData::setData(
+    const QwtArray<QwtDoubleInterval> &interval,
+    const QwtArray<double> &y)
+{
+    d_interval = interval;
+    d_y = y;
+}
+
+QwtDoubleRect QwtIntervalData::boundingRect() const
+{
+    double minX, maxX, minY, maxY;
+    minX = maxX = minY = maxY = 0.0;
+
+    bool isValid = false;
+
+    const size_t sz = size();
+    for ( size_t i = 0; i < sz; i++ )
+    {
+        const QwtDoubleInterval intv = interval(i);
+        if ( !intv.isValid() )
+            continue;
+
+        const double yv = y(i);
+
+        if ( !isValid )
+        {
+            minX = intv.minValue();
+            maxX = intv.maxValue();
+            minY = maxY = yv;
+
+            isValid = true;
+        }
+        else
+        {
+            if ( intv.minValue() < minX )
+                minX = intv.minValue();
+            if ( intv.maxValue() > maxX )
+                maxX = intv.maxValue();
+
+            if ( yv < minY )
+                minY = yv;
+            if ( yv > maxY )
+                maxY = yv;
+        }
+    }
+    if ( !isValid )
+        return QwtDoubleRect(1.0, 1.0, -2.0, -2.0); // invalid
+
+    return QwtDoubleRect(minX, minY, maxX - minX, maxY - minY);
+}
diff --git a/src/qwt/qwt_knob.cpp b/src/qwt/qwt_knob.cpp
new file mode 100644
index 0000000..7419b13
--- /dev/null
+++ b/src/qwt/qwt_knob.cpp
@@ -0,0 +1,524 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qpainter.h>
+#if QT_VERSION >= 0x040000
+#include <qpaintengine.h>
+#endif
+#include <qpalette.h>
+#include <qstyle.h>
+#include <qevent.h>
+#include "qwt_round_scale_draw.h"
+#include "qwt_knob.h"
+#include "qwt_math.h"
+#include "qwt_painter.h"
+#include "qwt_paint_buffer.h"
+
+class QwtKnob::PrivateData
+{
+public:
+    PrivateData()
+    {
+        angle = 0.0;
+        nTurns = 0.0;
+        borderWidth = 2;
+        borderDist = 4;
+        totalAngle = 270.0;
+        scaleDist = 4;
+        symbol = Line;
+        maxScaleTicks = 11;
+        knobWidth = 50;
+        dotWidth = 8;
+    }
+
+    int borderWidth;
+    int borderDist;
+    int scaleDist;
+    int maxScaleTicks;
+    int knobWidth;
+    int dotWidth;
+
+    Symbol symbol;
+    double angle;
+    double totalAngle;
+    double nTurns;
+
+    QRect knobRect; // bounding rect of the knob without scale
+};
+
+/*!
+  \brief Constructor
+  \param parent Parent widget
+*/
+QwtKnob::QwtKnob(QWidget* parent): 
+    QwtAbstractSlider(Qt::Horizontal, parent)
+{
+#if QT_VERSION < 0x040000
+    setWFlags(Qt::WNoAutoErase);
+#endif
+
+    d_data = new PrivateData;
+
+    setScaleDraw(new QwtRoundScaleDraw());
+
+    setUpdateTime(50);
+    setTotalAngle( 270.0 );
+    recalcAngle();
+    setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
+
+    setRange(0.0, 10.0, 1.0);
+    setValue(0.0);
+}
+
+//! Destructor
+QwtKnob::~QwtKnob()
+{
+    delete d_data;
+}
+
+/*!
+  \brief Set the symbol of the knob
+  \sa QwtKnob::symbol()
+*/
+void QwtKnob::setSymbol(QwtKnob::Symbol s)
+{
+    if ( d_data->symbol != s )
+    {
+        d_data->symbol = s;
+        update();
+    }
+}
+
+/*! 
+    \return symbol of the knob
+    \sa QwtKnob::setSymbol()
+*/
+QwtKnob::Symbol QwtKnob::symbol() const
+{
+    return d_data->symbol;
+}
+
+/*!
+  \brief Set the total angle by which the knob can be turned
+  \param angle Angle in degrees.
+
+  The default angle is 270 degrees. It is possible to specify
+  an angle of more than 360 degrees so that the knob can be
+  turned several times around its axis.
+*/
+void QwtKnob::setTotalAngle (double angle)
+{
+    if (angle < 10.0)
+       d_data->totalAngle = 10.0;
+    else
+       d_data->totalAngle = angle;
+
+    scaleDraw()->setAngleRange( -0.5 * d_data->totalAngle, 
+        0.5 * d_data->totalAngle);
+    layoutKnob();
+}
+
+//! Return the total angle
+double QwtKnob::totalAngle() const 
+{
+    return d_data->totalAngle;
+}
+
+/*!
+   Change the scale draw of the knob
+
+   For changing the labels of the scales, it
+   is necessary to derive from QwtRoundScaleDraw and
+   overload QwtRoundScaleDraw::label(). 
+
+   \sa scaleDraw()
+*/
+void QwtKnob::setScaleDraw(QwtRoundScaleDraw *scaleDraw)
+{
+    setAbstractScaleDraw(scaleDraw);
+}
+
+/*! 
+   \return the scale draw of the knob
+   \sa setScaleDraw()
+*/
+const QwtRoundScaleDraw *QwtKnob::scaleDraw() const
+{
+    return (QwtRoundScaleDraw *)abstractScaleDraw();
+}
+
+/*! 
+   \return the scale draw of the knob
+   \sa setScaleDraw()
+*/
+QwtRoundScaleDraw *QwtKnob::scaleDraw()
+{
+    return (QwtRoundScaleDraw *)abstractScaleDraw();
+}
+
+/*!
+  \brief Draw the knob
+  \param painter painter
+  \param r Bounding rectangle of the knob (without scale)
+*/
+void QwtKnob::drawKnob(QPainter *painter, const QRect &r)
+{
+#if QT_VERSION < 0x040000
+    const QBrush buttonBrush = colorGroup().brush(QColorGroup::Button);
+    const QColor buttonTextColor = colorGroup().buttonText();
+    const QColor lightColor = colorGroup().light();
+    const QColor darkColor = colorGroup().dark();
+#else
+    const QBrush buttonBrush = palette().brush(QPalette::Button);
+    const QColor buttonTextColor = palette().color(QPalette::ButtonText);
+    const QColor lightColor = palette().color(QPalette::Light);
+    const QColor darkColor = palette().color(QPalette::Dark);
+#endif
+
+    const int bw2 = d_data->borderWidth / 2;
+
+    const int radius = (qwtMin(r.width(), r.height()) - bw2) / 2;
+
+    const QRect aRect( 
+        r.center().x() - radius, r.center().y() - radius,
+        2 * radius, 2 * radius);
+
+    //
+    // draw button face
+    //
+    painter->setBrush(buttonBrush);
+    painter->drawEllipse(aRect);
+
+    //
+    // draw button shades
+    //
+    QPen pn;
+    pn.setWidth(d_data->borderWidth);
+
+    pn.setColor(lightColor);
+    painter->setPen(pn);
+    painter->drawArc(aRect, 45*16, 180*16);
+
+    pn.setColor(darkColor);
+    painter->setPen(pn);
+    painter->drawArc(aRect, 225*16, 180*16);
+
+    //
+    // draw marker
+    //
+    if ( isValid() )
+        drawMarker(painter, d_data->angle, buttonTextColor);
+}
+
+/*!
+  \brief Notify change of value
+
+  Sets the knob's value to the nearest multiple
+  of the step size.
+*/
+void QwtKnob::valueChange()
+{
+    recalcAngle();
+    update();
+    QwtAbstractSlider::valueChange();
+}
+
+/*!
+  \brief Determine the value corresponding to a specified position
+
+  Called by QwtAbstractSlider
+  \param p point
+*/
+double QwtKnob::getValue(const QPoint &p)
+{
+    const double dx = double((rect().x() + rect().width() / 2) - p.x() );
+    const double dy = double((rect().y() + rect().height() / 2) - p.y() );
+
+    const double arc = atan2(-dx,dy) * 180.0 / M_PI;
+
+    double newValue =  0.5 * (minValue() + maxValue())
+       + (arc + d_data->nTurns * 360.0) * (maxValue() - minValue())
+      / d_data->totalAngle;
+
+    const double oneTurn = fabs(maxValue() - minValue()) * 360.0 / d_data->totalAngle;
+    const double eqValue = value() + mouseOffset();
+
+    if (fabs(newValue - eqValue) > 0.5 * oneTurn)
+    {
+        if (newValue < eqValue)
+           newValue += oneTurn;
+        else
+           newValue -= oneTurn;
+    }
+
+    return newValue;    
+}
+
+/*!
+  \brief Set the scrolling mode and direction
+
+  Called by QwtAbstractSlider
+  \param p Point in question
+*/
+void QwtKnob::getScrollMode(const QPoint &p, int &scrollMode, int &direction)
+{
+    const int r = d_data->knobRect.width() / 2;
+
+    const int dx = d_data->knobRect.x() + r - p.x();
+    const int dy = d_data->knobRect.y() + r - p.y();
+
+    if ( (dx * dx) + (dy * dy) <= (r * r)) // point is inside the knob
+    {
+        scrollMode = ScrMouse;
+        direction = 0;
+    }
+    else                                // point lies outside
+    {
+        scrollMode = ScrTimer;
+        double arc = atan2(double(-dx),double(dy)) * 180.0 / M_PI;
+        if ( arc < d_data->angle)
+           direction = -1;
+        else if (arc > d_data->angle)
+           direction = 1;
+        else
+           direction = 0;
+    }
+}
+
+
+/*!
+  \brief Notify a change of the range
+
+  Called by QwtAbstractSlider
+*/
+void QwtKnob::rangeChange()
+{
+    if (autoScale())
+        rescale(minValue(), maxValue());
+
+    layoutKnob();
+    recalcAngle();
+}
+
+/*!
+  \brief Qt Resize Event
+*/
+void QwtKnob::resizeEvent(QResizeEvent *)
+{
+    layoutKnob( false );
+}
+
+//! Recalculate the knob's geometry and layout based on
+//  the current rect and fonts.
+//  \param update_geometry  notify the layout system and call update
+//         to redraw the scale
+void QwtKnob::layoutKnob( bool update_geometry )
+{
+    const QRect r = rect();
+    const int radius = d_data->knobWidth / 2;
+
+    d_data->knobRect.setWidth(2 * radius);
+    d_data->knobRect.setHeight(2 * radius);
+    d_data->knobRect.moveCenter(r.center());
+
+    scaleDraw()->setRadius(radius + d_data->scaleDist);
+    scaleDraw()->moveCenter(r.center());
+
+    if ( update_geometry )
+    {
+        updateGeometry();
+        update();
+    }
+}
+
+/*!
+  \brief Repaint the knob
+*/
+void QwtKnob::paintEvent(QPaintEvent *e)
+{
+    const QRect &ur = e->rect();
+    if ( ur.isValid() ) 
+    {
+#if QT_VERSION < 0x040000
+        QwtPaintBuffer paintBuffer(this, ur);
+        draw(paintBuffer.painter(), ur);
+#else
+        QPainter painter(this);
+        if ( paintEngine()->hasFeature(QPaintEngine::Antialiasing) )
+            painter.setRenderHint(QPainter::Antialiasing);
+        draw(&painter, ur);
+#endif
+    }
+}
+
+/*!
+  \brief Repaint the knob
+*/
+void QwtKnob::draw(QPainter *painter, const QRect& ur)
+{
+    if ( !d_data->knobRect.contains( ur ) ) // event from valueChange()
+    {
+#if QT_VERSION < 0x040000
+        scaleDraw()->draw( painter, colorGroup() );
+#else
+        scaleDraw()->draw( painter, palette() );
+#endif
+    }
+
+    drawKnob( painter, d_data->knobRect );
+
+    if ( hasFocus() )
+        QwtPainter::drawFocusRect(painter, this);
+}
+
+/*!
+  \brief Draw the marker at the knob's front
+  \param p Painter
+  \param arc Angle of the marker
+  \param c Marker color
+*/
+void QwtKnob::drawMarker(QPainter *p, double arc, const QColor &c)
+{
+    const double rarc = arc * M_PI / 180.0;
+    const double ca = cos(rarc);
+    const double sa = - sin(rarc);
+
+    int radius = d_data->knobRect.width() / 2 - d_data->borderWidth;
+    if (radius < 3) 
+        radius = 3; 
+
+    const int ym = d_data->knobRect.y() + radius + d_data->borderWidth;
+    const int xm = d_data->knobRect.x() + radius + d_data->borderWidth;
+
+    switch (d_data->symbol)
+    {
+        case Dot:
+        {
+            p->setBrush(c);
+            p->setPen(Qt::NoPen);
+
+            const double rb = double(qwtMax(radius - 4 - d_data->dotWidth / 2, 0));
+            p->drawEllipse(xm - qRound(sa * rb) - d_data->dotWidth / 2,
+                   ym - qRound(ca * rb) - d_data->dotWidth / 2,
+                   d_data->dotWidth, d_data->dotWidth);
+            break;
+        }
+        case Line:
+        {
+            p->setPen(QPen(c, 2));
+
+            const double rb = qwtMax(double((radius - 4) / 3.0), 0.0);
+            const double re = qwtMax(double(radius - 4), 0.0);
+            
+            p->drawLine ( xm - qRound(sa * rb), ym - qRound(ca * rb),
+                xm - qRound(sa * re), ym - qRound(ca * re));
+            
+            break;
+        }
+    }
+}
+
+/*!
+  \brief Change the knob's width.
+
+  The specified width must be >= 5, or it will be clipped.
+  \param w New width
+*/
+void QwtKnob::setKnobWidth(int w)
+{
+    d_data->knobWidth = qwtMax(w,5);
+    layoutKnob();
+}
+
+//! Return the width of the knob
+int QwtKnob::knobWidth() const 
+{
+    return d_data->knobWidth;
+}
+
+/*!
+  \brief Set the knob's border width
+  \param bw new border width
+*/
+void QwtKnob::setBorderWidth(int bw)
+{
+    d_data->borderWidth = qwtMax(bw, 0);
+    layoutKnob();
+}
+
+//! Return the border width
+int QwtKnob::borderWidth() const 
+{
+    return d_data->borderWidth;
+}
+
+/*!
+  \brief Recalculate the marker angle corresponding to the
+    current value
+*/
+void QwtKnob::recalcAngle()
+{
+    //
+    // calculate the angle corresponding to the value
+    //
+    if (maxValue() == minValue())
+    {
+        d_data->angle = 0;
+        d_data->nTurns = 0;
+    }
+    else
+    {
+        d_data->angle = (value() - 0.5 * (minValue() + maxValue()))
+            / (maxValue() - minValue()) * d_data->totalAngle;
+        d_data->nTurns = floor((d_data->angle + 180.0) / 360.0);
+        d_data->angle = d_data->angle - d_data->nTurns * 360.0;
+    }
+}
+
+
+/*!
+    Recalculates the layout
+    \sa QwtKnob::layoutKnob()
+*/
+void QwtKnob::scaleChange()
+{
+    layoutKnob();
+}
+
+/*!
+    Recalculates the layout
+    \sa QwtKnob::layoutKnob()
+*/
+void QwtKnob::fontChange(const QFont &f)
+{
+    QwtAbstractSlider::fontChange( f );
+    layoutKnob();
+}
+
+/*!
+  \return QwtKnob::minimumSizeHint()
+*/
+QSize QwtKnob::sizeHint() const
+{
+    return minimumSizeHint();
+}
+
+/*!
+  \brief Return a minimum size hint
+  \warning The return value of QwtKnob::minimumSizeHint() depends on the 
+           font and the scale.
+*/
+QSize QwtKnob::minimumSizeHint() const
+{
+    // Add the scale radial thickness to the knobWidth
+    const int sh = scaleDraw()->extent( QPen(), font() );
+    const int d = 2 * sh + 2 * d_data->scaleDist + d_data->knobWidth;
+
+    return QSize( d, d );
+}
diff --git a/src/qwt/qwt_layout_metrics.cpp b/src/qwt/qwt_layout_metrics.cpp
new file mode 100644
index 0000000..a236845
--- /dev/null
+++ b/src/qwt/qwt_layout_metrics.cpp
@@ -0,0 +1,309 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qapplication.h>
+#include <qpainter.h>
+#if QT_VERSION < 0x040000
+#include <qpaintdevicemetrics.h> 
+#include <qwmatrix.h> 
+#include <qpointarray.h> 
+#define QwtPointArray QPointArray
+#define QwtMatrix QWMatrix
+#else
+#include <qmatrix.h> 
+#include <qpolygon.h> 
+#define QwtPointArray QPolygon
+#define QwtMatrix QMatrix
+#endif
+#include <qpaintdevice.h> 
+#include <qdesktopwidget.h> 
+#include "qwt_math.h"
+#include "qwt_layout_metrics.h"
+
+static QSize deviceDpi(const QPaintDevice *device)
+{
+    QSize dpi;
+#if QT_VERSION < 0x040000
+    const QPaintDeviceMetrics metrics(device);
+    dpi.setWidth(metrics.logicalDpiX());
+    dpi.setHeight(metrics.logicalDpiY());
+#else
+    dpi.setWidth(device->logicalDpiX());
+    dpi.setHeight(device->logicalDpiY());
+#endif
+
+    return dpi;
+}
+
+#if QT_VERSION < 0x040000
+
+inline static const QWMatrix &matrix(const QPainter *painter)
+{
+    return painter->worldMatrix();
+}
+inline static QWMatrix invMatrix(const QPainter *painter)
+{
+    return painter->worldMatrix().invert();
+}
+
+#else // QT_VERSION >= 0x040000
+
+inline static const QMatrix &matrix(const QPainter *painter)
+{
+    return painter->matrix();
+}
+inline static QMatrix invMatrix(const QPainter *painter)
+{
+    return painter->matrix().inverted();
+}
+
+#endif
+
+QwtMetricsMap::QwtMetricsMap()
+{
+    d_screenToLayoutX = d_screenToLayoutY = 
+        d_deviceToLayoutX = d_deviceToLayoutY = 1.0;
+}
+
+void QwtMetricsMap::setMetrics(const QPaintDevice *layoutDevice, 
+    const QPaintDevice *paintDevice)
+{
+    const QSize screenDpi = deviceDpi(QApplication::desktop());
+    const QSize layoutDpi = deviceDpi(layoutDevice);
+    const QSize paintDpi = deviceDpi(paintDevice);
+
+    d_screenToLayoutX = double(layoutDpi.width()) / 
+        double(screenDpi.width());
+    d_screenToLayoutY = double(layoutDpi.height()) / 
+        double(screenDpi.height());
+
+    d_deviceToLayoutX = double(layoutDpi.width()) / 
+        double(paintDpi.width());
+    d_deviceToLayoutY = double(layoutDpi.height()) / 
+        double(paintDpi.height());
+}
+
+#ifndef QT_NO_TRANSFORMATIONS
+QPoint QwtMetricsMap::layoutToDevice(const QPoint &point, 
+    const QPainter *painter) const
+#else
+QPoint QwtMetricsMap::layoutToDevice(const QPoint &point, 
+    const QPainter *) const
+#endif
+{
+    if ( isIdentity() )
+        return point;
+
+    QPoint mappedPoint(point);
+
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedPoint = matrix(painter).map(mappedPoint);
+#endif
+
+    mappedPoint.setX(layoutToDeviceX(mappedPoint.x()));
+    mappedPoint.setY(layoutToDeviceY(mappedPoint.y()));
+
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedPoint = invMatrix(painter).map(mappedPoint);
+#endif
+
+    return mappedPoint;
+}
+
+#ifndef QT_NO_TRANSFORMATIONS
+QPoint QwtMetricsMap::deviceToLayout(const QPoint &point, 
+    const QPainter *painter) const
+#else
+QPoint QwtMetricsMap::deviceToLayout(const QPoint &point, 
+    const QPainter *) const
+#endif
+{
+    if ( isIdentity() )
+        return point;
+
+    QPoint mappedPoint(point);
+
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedPoint = matrix(painter).map(mappedPoint);
+#endif
+
+    mappedPoint.setX(deviceToLayoutX(mappedPoint.x()));
+    mappedPoint.setY(deviceToLayoutY(mappedPoint.y()));
+
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedPoint = invMatrix(painter).map(mappedPoint);
+#endif
+
+    return mappedPoint;
+}
+
+QPoint QwtMetricsMap::screenToLayout(const QPoint &point) const
+{
+    if ( d_screenToLayoutX == 1.0 && d_screenToLayoutY == 1.0 )
+        return point;
+
+    return QPoint(screenToLayoutX(point.x()), screenToLayoutY(point.y()));
+}
+
+#ifndef QT_NO_TRANSFORMATIONS
+QRect QwtMetricsMap::layoutToDevice(const QRect &rect, 
+    const QPainter *painter) const
+#else
+QRect QwtMetricsMap::layoutToDevice(const QRect &rect, 
+    const QPainter *) const
+#endif
+{
+    if ( isIdentity() )
+        return rect;
+
+    QRect mappedRect(rect);
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedRect = translate(matrix(painter), mappedRect);
+#endif
+
+    mappedRect = QRect(
+        layoutToDeviceX(mappedRect.x()), 
+        layoutToDeviceY(mappedRect.y()),
+        layoutToDeviceX(mappedRect.width()), 
+        layoutToDeviceY(mappedRect.height())
+    );
+
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedRect = translate(invMatrix(painter), mappedRect);
+#endif
+
+    return mappedRect;
+}
+
+#ifndef QT_NO_TRANSFORMATIONS
+QRect QwtMetricsMap::deviceToLayout(const QRect &rect,
+    const QPainter *painter) const
+#else
+QRect QwtMetricsMap::deviceToLayout(const QRect &rect,
+    const QPainter *) const
+#endif
+{
+    if ( isIdentity() )
+        return rect;
+
+    QRect mappedRect(rect);
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedRect = translate(matrix(painter), mappedRect);
+#endif
+
+    mappedRect = QRect(
+        deviceToLayoutX(mappedRect.x()), 
+        deviceToLayoutY(mappedRect.y()),
+        deviceToLayoutX(mappedRect.width()), 
+        deviceToLayoutY(mappedRect.height())
+    );
+
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedRect = translate(invMatrix(painter), mappedRect);
+#endif
+
+    return mappedRect;
+}
+
+QRect QwtMetricsMap::screenToLayout(const QRect &rect) const
+{
+    if ( d_screenToLayoutX == 1.0 && d_screenToLayoutY == 1.0 )
+        return rect;
+
+    return QRect(screenToLayoutX(rect.x()), screenToLayoutY(rect.y()),
+        screenToLayoutX(rect.width()), screenToLayoutY(rect.height()));
+}
+
+#ifndef QT_NO_TRANSFORMATIONS
+QwtPointArray QwtMetricsMap::layoutToDevice(const QwtPointArray &pa, 
+    const QPainter *painter) const
+#else
+QwtPointArray QwtMetricsMap::layoutToDevice(const QwtPointArray &pa, 
+    const QPainter *) const
+#endif
+{
+    if ( isIdentity() )
+        return pa;
+    
+    QwtPointArray mappedPa(pa);
+
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedPa = translate(matrix(painter), mappedPa);
+#endif
+
+    QwtMatrix m;
+    m.scale(1.0 / d_deviceToLayoutX, 1.0 / d_deviceToLayoutY);
+    mappedPa = translate(m, mappedPa);
+
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedPa = translate(invMatrix(painter), mappedPa);
+#endif
+
+    return mappedPa;
+}
+
+#ifndef QT_NO_TRANSFORMATIONS
+QwtPointArray QwtMetricsMap::deviceToLayout(const QwtPointArray &pa, 
+    const QPainter *painter) const
+#else
+QwtPointArray QwtMetricsMap::deviceToLayout(const QwtPointArray &pa, 
+    const QPainter *) const
+#endif
+{
+    if ( isIdentity() )
+        return pa;
+    
+    QwtPointArray mappedPa(pa);
+
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedPa = translate(matrix(painter), mappedPa);
+#endif
+
+    QwtMatrix m;
+    m.scale(d_deviceToLayoutX, d_deviceToLayoutY);
+    mappedPa = translate(m, mappedPa);
+
+#ifndef QT_NO_TRANSFORMATIONS
+    if ( painter )
+        mappedPa = translate(invMatrix(painter), mappedPa);
+#endif
+
+    return mappedPa;
+}
+
+/*!
+  Wrapper for QwtMatrix::mapRect. 
+*/
+
+QRect QwtMetricsMap::translate(
+    const QwtMatrix &m, const QRect &rect) 
+{
+    return m.mapRect(rect);
+}
+
+/*!
+  QwtPointArray QwtMatrix::operator*(const QwtPointArray &) const.
+*/
+
+QwtPointArray QwtMetricsMap::translate(
+    const QwtMatrix &m, const QwtPointArray &pa) 
+{
+    return m.map(pa);
+}
diff --git a/src/qwt/qwt_legend.cpp b/src/qwt/qwt_legend.cpp
new file mode 100644
index 0000000..279ccef
--- /dev/null
+++ b/src/qwt/qwt_legend.cpp
@@ -0,0 +1,595 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qapplication.h> 
+#include <qmap.h> 
+#if QT_VERSION >= 0x040000
+#include <qscrollbar.h> 
+#endif
+#include "qwt_math.h"
+#include "qwt_dyngrid_layout.h"
+#include "qwt_plot_item.h"
+#include "qwt_legend_item.h"
+#include "qwt_legend.h"
+
+class QwtLegend::PrivateData
+{
+public:
+    class LegendMap
+    {
+    public:
+        void insert(const QwtPlotItem *, QWidget *);
+
+        void remove(const QwtPlotItem *);
+        void remove(QWidget *);
+
+        void clear();
+
+        uint count() const;
+
+        inline const QWidget *find(const QwtPlotItem *) const;
+        inline QWidget *find(const QwtPlotItem *);
+
+        inline const QwtPlotItem *find(const QWidget *) const;
+        inline QwtPlotItem *find(const QWidget *);
+
+        const QMap<QWidget *, const QwtPlotItem *> &widgetMap() const;
+        QMap<QWidget *, const QwtPlotItem *> &widgetMap();
+
+    private:
+        QMap<QWidget *, const QwtPlotItem *> d_widgetMap;
+        QMap<const QwtPlotItem *, QWidget *> d_itemMap;
+    };
+
+    QwtLegend::LegendItemMode itemMode;
+    QwtLegend::LegendDisplayPolicy displayPolicy;
+    int identifierMode;
+
+    LegendMap map;
+
+    class LegendView;
+    LegendView *view;
+};
+
+#if QT_VERSION < 0x040000
+#include <qscrollview.h>
+
+class QwtLegend::PrivateData::LegendView: public QScrollView
+{
+public:
+    LegendView(QWidget *parent):
+        QScrollView(parent)
+    {
+        setResizePolicy(Manual);
+
+        viewport()->setBackgroundMode(Qt::NoBackground); // Avoid flicker
+
+        contentsWidget = new QWidget(viewport());
+
+        addChild(contentsWidget);
+    }
+
+    void viewportResizeEvent(QResizeEvent *e)
+    {
+        QScrollView::viewportResizeEvent(e);
+
+        // It's not safe to update the layout now, because
+        // we are in an internal update of the scrollview framework.
+        // So we delay the update by posting a LayoutHint.
+
+        QApplication::postEvent(contentsWidget, 
+            new QEvent(QEvent::LayoutHint));
+    }
+
+    QWidget *contentsWidget;
+};
+
+#else // QT_VERSION >= 0x040000
+
+#include <qscrollarea.h>
+
+class QwtLegend::PrivateData::LegendView: public QScrollArea
+{
+public:
+    LegendView(QWidget *parent):
+        QScrollArea(parent)
+    {
+        contentsWidget = new QWidget(this);
+
+        setWidget(contentsWidget);
+        setWidgetResizable(false);
+    }
+
+    virtual bool viewportEvent(QEvent *e) 
+    {
+        bool ok = QScrollArea::viewportEvent(e);
+
+        if ( e->type() == QEvent::Resize )
+        {
+            QApplication::postEvent(contentsWidget, 
+                new QEvent(QEvent::LayoutRequest));
+        }
+        return ok;
+    }
+
+    QSize viewportSize(int w, int h) const
+    {
+        const int sbHeight = horizontalScrollBar()->sizeHint().height();
+        const int sbWidth = verticalScrollBar()->sizeHint().width();
+    
+        const int cw = contentsRect().width();
+        const int ch = contentsRect().height();
+
+        int vw = cw;
+        int vh = ch;
+
+        if ( w > vw )
+            vh -= sbHeight;
+
+        if ( h > vh )
+        {
+            vw -= sbWidth;
+            if ( w > vw && vh == ch )
+                vh -= sbHeight;
+        }
+        return QSize(vw, vh);
+    }
+
+    QWidget *contentsWidget;
+};
+
+#endif
+
+
+void QwtLegend::PrivateData::LegendMap::insert(
+    const QwtPlotItem *item, QWidget *widget)
+{
+    d_itemMap.insert(item, widget);
+    d_widgetMap.insert(widget, item);
+}
+
+void QwtLegend::PrivateData::LegendMap::remove(const QwtPlotItem *item)
+{
+    QWidget *widget = d_itemMap[item];
+    d_itemMap.remove(item);
+    d_widgetMap.remove(widget);
+}
+
+void QwtLegend::PrivateData::LegendMap::remove(QWidget *widget)
+{
+    const QwtPlotItem *item = d_widgetMap[widget];
+    d_itemMap.remove(item);
+    d_widgetMap.remove(widget);
+}
+
+void QwtLegend::PrivateData::LegendMap::clear()
+{
+    QMap<QWidget *, const QwtPlotItem *>::const_iterator it;
+    for ( it = d_widgetMap.begin(); it != d_widgetMap.end(); ++it ) 
+        delete it.key();
+
+    d_itemMap.clear();
+    d_widgetMap.clear();
+}
+
+uint QwtLegend::PrivateData::LegendMap::count() const
+{
+    return d_itemMap.count();
+}
+
+inline const QWidget *QwtLegend::PrivateData::LegendMap::find(const QwtPlotItem *item) const
+{
+    if ( !d_itemMap.contains((QwtPlotItem *)item) )
+        return NULL;
+
+    return d_itemMap[(QwtPlotItem *)item];
+}
+
+inline QWidget *QwtLegend::PrivateData::LegendMap::find(const QwtPlotItem *item)
+{
+    if ( !d_itemMap.contains((QwtPlotItem *)item) )
+        return NULL;
+
+    return d_itemMap[(QwtPlotItem *)item];
+}
+
+inline const QwtPlotItem *QwtLegend::PrivateData::LegendMap::find(
+    const QWidget *widget) const
+{
+    if ( !d_widgetMap.contains((QWidget *)widget) )
+        return NULL;
+
+    return d_widgetMap[(QWidget *)widget];
+}
+
+inline QwtPlotItem *QwtLegend::PrivateData::LegendMap::find(
+    const QWidget *widget)
+{
+    if ( !d_widgetMap.contains((QWidget *)widget) )
+        return NULL;
+
+    return (QwtPlotItem *)d_widgetMap[(QWidget *)widget];
+}
+
+inline const QMap<QWidget *, const QwtPlotItem *> &
+    QwtLegend::PrivateData::LegendMap::widgetMap() const
+{
+    return d_widgetMap;
+} 
+
+inline QMap<QWidget *, const QwtPlotItem *> &
+    QwtLegend::PrivateData::LegendMap::widgetMap() 
+{
+    return d_widgetMap;
+} 
+
+/*!
+  \param parent Parent widget
+*/
+QwtLegend::QwtLegend(QWidget *parent): 
+    QFrame(parent)
+{
+    setFrameStyle(NoFrame);
+
+    d_data = new QwtLegend::PrivateData;
+    d_data->itemMode = QwtLegend::ReadOnlyItem;
+    d_data->displayPolicy = QwtLegend::Auto;
+    d_data->identifierMode = QwtLegendItem::ShowLine | 
+        QwtLegendItem::ShowSymbol | QwtLegendItem::ShowText;
+
+    d_data->view = new QwtLegend::PrivateData::LegendView(this);
+    d_data->view->setFrameStyle(NoFrame);
+
+    QwtDynGridLayout *layout = new QwtDynGridLayout(
+        d_data->view->contentsWidget);
+#if QT_VERSION < 0x040000
+    layout->setAutoAdd(true);
+#endif
+    layout->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
+
+    d_data->view->contentsWidget->installEventFilter(this);
+}
+
+QwtLegend::~QwtLegend()
+{
+    delete d_data;
+}
+
+/*!
+  Set the legend display policy to:
+
+  \param policy Legend display policy
+  \param mode Identifier mode (or'd ShowLine, ShowSymbol, ShowText)
+
+  \sa QwtLegend::displayPolicy, QwtLegend::LegendDisplayPolicy
+*/
+void QwtLegend::setDisplayPolicy(LegendDisplayPolicy policy, int mode)
+{
+    d_data->displayPolicy = policy;
+    if (-1 != mode)
+       d_data->identifierMode = mode;
+
+    QMap<QWidget *, const QwtPlotItem *> &map = 
+        d_data->map.widgetMap();
+
+    QMap<QWidget *, const QwtPlotItem *>::iterator it;
+    for ( it = map.begin(); it != map.end(); ++it ) 
+    {
+#if QT_VERSION < 0x040000
+        QwtPlotItem *item = (QwtPlotItem *)it.data();
+#else
+        QwtPlotItem *item = (QwtPlotItem *)it.value();
+#endif
+        if ( item )
+            item->updateLegend(this);
+    }
+}
+
+/*! 
+  \return the legend display policy.
+  Default is LegendDisplayPolicy::Auto.
+  \sa QwtLegend::setDisplayPolicy, QwtLegend::LegendDisplayPolicy
+*/ 
+
+QwtLegend::LegendDisplayPolicy QwtLegend::displayPolicy() const 
+{ 
+    return d_data->displayPolicy; 
+}
+
+void QwtLegend::setItemMode(LegendItemMode mode)
+{
+    d_data->itemMode = mode;
+}
+
+QwtLegend::LegendItemMode QwtLegend::itemMode() const
+{
+    return d_data->itemMode;
+}
+
+/*!
+  \return the IdentifierMode to be used in combination with
+  LegendDisplayPolicy::Fixed.
+
+  Default is ShowLine | ShowSymbol | ShowText.
+*/
+
+int QwtLegend::identifierMode() const
+{
+    return d_data->identifierMode;
+}
+
+/*! 
+  The contents widget is the only child of the viewport() and
+  the parent widget of all legend items.
+*/
+QWidget *QwtLegend::contentsWidget() 
+{ 
+    return d_data->view->contentsWidget; 
+}
+
+QScrollBar *QwtLegend::horizontalScrollBar() const
+{
+    return d_data->view->horizontalScrollBar();
+}
+
+QScrollBar *QwtLegend::verticalScrollBar() const
+{
+    return d_data->view->horizontalScrollBar();
+}
+
+/*!  
+  The contents widget is the only child of the viewport() and
+  the parent widget of all legend items.
+*/
+
+const QWidget *QwtLegend::contentsWidget() const 
+{ 
+    return d_data->view->contentsWidget; 
+}
+
+/*!
+  Insert a new item for a plot item
+  \param plotItem Plot item
+  \param legendItem New legend item
+  \note The parent of item will be changed to QwtLegend::contentsWidget()
+*/
+void QwtLegend::insert(const QwtPlotItem *plotItem, QWidget *legendItem)
+{
+    if ( legendItem == NULL || plotItem == NULL )
+        return;
+
+    QWidget *contentsWidget = d_data->view->contentsWidget;
+
+    if ( legendItem->parent() != contentsWidget )
+    {
+#if QT_VERSION >= 0x040000
+        legendItem->setParent(contentsWidget);
+#else
+        legendItem->reparent(contentsWidget, QPoint(0, 0));
+#endif
+    }
+
+    legendItem->show();
+
+    d_data->map.insert(plotItem, legendItem);
+
+    layoutContents();
+
+    if ( contentsWidget->layout() )
+    {
+#if QT_VERSION >= 0x040000
+        contentsWidget->layout()->addWidget(legendItem);
+#endif
+
+        // set tab focus chain
+
+        QWidget *w = NULL;
+
+#if QT_VERSION < 0x040000
+        QLayoutIterator layoutIterator = 
+            contentsWidget->layout()->iterator();
+        for ( QLayoutItem *item = layoutIterator.current();
+            item != 0; item = ++layoutIterator)
+        {
+#else
+        for (int i = 0; i < contentsWidget->layout()->count(); i++)
+        {
+            QLayoutItem *item = contentsWidget->layout()->itemAt(i);
+#endif
+            if ( w && item->widget() )
+            {
+                QWidget::setTabOrder(w, item->widget());
+                w = item->widget();
+            }
+        }
+    }
+}
+
+QWidget *QwtLegend::find(const QwtPlotItem *plotItem) const
+{
+    return d_data->map.find(plotItem);
+}
+
+QwtPlotItem *QwtLegend::find(const QWidget *legendItem) const
+{
+    return d_data->map.find(legendItem);
+}
+
+//! Find the corresponding item for a plotItem and remove it from the item list.
+void QwtLegend::remove(const QwtPlotItem *plotItem)
+{ 
+    QWidget *legendItem = d_data->map.find(plotItem);
+    d_data->map.remove(legendItem); 
+    delete legendItem;
+}
+
+//! Remove all items.
+void QwtLegend::clear()
+{
+#if QT_VERSION < 0x040000
+    bool doUpdate = isUpdatesEnabled();
+#else
+    bool doUpdate = updatesEnabled();
+#endif
+    setUpdatesEnabled(false);
+
+    d_data->map.clear();
+
+    setUpdatesEnabled(doUpdate);
+    update();
+}
+
+//! Return a size hint.
+QSize QwtLegend::sizeHint() const
+{
+    QSize hint = d_data->view->contentsWidget->sizeHint();
+    hint += QSize(2 * frameWidth(), 2 * frameWidth());
+
+    return hint;
+}
+
+/*!
+  \return The preferred height, for the width w.
+*/
+int QwtLegend::heightForWidth(int w) const
+{
+    w -= 2 * frameWidth();
+
+    int h = d_data->view->contentsWidget->heightForWidth(w);
+#if QT_VERSION < 0x040000
+
+    // Asking the layout is the default implementation in Qt4 
+
+    if ( h <= 0 ) 
+    {
+        QLayout *l = d_data->view->contentsWidget->layout();
+        if ( l && l->hasHeightForWidth() )
+            h = l->heightForWidth(w);
+    }
+#endif
+    if ( h >= 0 )
+        h += 2 * frameWidth();
+
+    return h;
+}
+
+/*!
+  Adjust contents widget and item layout to the size of the viewport().
+*/
+void QwtLegend::layoutContents()
+{
+    const QSize visibleSize = d_data->view->viewport()->size();
+
+    const QLayout *l = d_data->view->contentsWidget->layout();
+    if ( l && l->inherits("QwtDynGridLayout") )
+    {
+        const QwtDynGridLayout *tl = (const QwtDynGridLayout *)l;
+
+        const int minW = int(tl->maxItemWidth()) + 2 * tl->margin();
+
+        int w = qwtMax(visibleSize.width(), minW);
+        int h = qwtMax(tl->heightForWidth(w), visibleSize.height());
+
+        const int vpWidth = d_data->view->viewportSize(w, h).width();
+        if ( w > vpWidth )
+        {
+            w = qwtMax(vpWidth, minW);
+            h = qwtMax(tl->heightForWidth(w), visibleSize.height());
+        }
+
+        d_data->view->contentsWidget->resize(w, h);
+#if QT_VERSION < 0x040000
+        d_data->view->resizeContents(w, h);
+#endif
+    }
+}
+
+/*
+  Filter layout related events of QwtLegend::contentsWidget().
+*/
+
+bool QwtLegend::eventFilter(QObject *o, QEvent *e)
+{
+    if ( o == d_data->view->contentsWidget )
+    {
+        switch(e->type())
+        {
+            case QEvent::ChildRemoved:
+            {   
+                const QChildEvent *ce = (const QChildEvent *)e;
+                if ( ce->child()->isWidgetType() )
+                    d_data->map.remove((QWidget *)ce->child());
+                break;
+            }
+#if QT_VERSION < 0x040000
+            case QEvent::LayoutHint:
+#else
+            case QEvent::LayoutRequest:
+#endif
+            {
+                layoutContents();
+                break;
+            }
+#if QT_VERSION < 0x040000
+            case QEvent::Resize:
+            {
+                updateGeometry();
+                break;
+            }
+#endif
+            default:
+                break;
+        }
+    }
+    
+    return QFrame::eventFilter(o, e);
+}
+
+
+//! Return true, if there are no legend items.
+bool QwtLegend::isEmpty() const
+{
+    return d_data->map.count() == 0;
+}
+
+//! Return the number of legend items.
+uint QwtLegend::itemCount() const
+{
+    return d_data->map.count();
+}
+
+#if QT_VERSION < 0x040000
+QValueList<QWidget *> QwtLegend::legendItems() const
+#else
+QList<QWidget *> QwtLegend::legendItems() const
+#endif
+{
+    const QMap<QWidget *, const QwtPlotItem *> &map = 
+        d_data->map.widgetMap();
+
+#if QT_VERSION < 0x040000
+    QValueList<QWidget *> list;
+#else
+    QList<QWidget *> list;
+#endif
+
+    QMap<QWidget *, const QwtPlotItem *>::const_iterator it;
+    for ( it = map.begin(); it != map.end(); ++it ) 
+        list += it.key();
+
+    return list;
+}
+
+void QwtLegend::resizeEvent(QResizeEvent *e)
+{
+    QFrame::resizeEvent(e);
+    d_data->view->setGeometry(contentsRect());
+}
diff --git a/src/qwt/qwt_legend_item.cpp b/src/qwt/qwt_legend_item.cpp
new file mode 100644
index 0000000..9b0bf9b
--- /dev/null
+++ b/src/qwt/qwt_legend_item.cpp
@@ -0,0 +1,459 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qpainter.h>
+#include <qdrawutil.h>
+#include <qstyle.h>
+#include <qpen.h>
+#if QT_VERSION >= 0x040000
+#include <qevent.h>
+#include <qstyleoption.h>
+#endif
+#include "qwt_painter.h"
+#include "qwt_symbol.h"
+#include "qwt_legend_item.h"
+
+static const int IdentifierWidth = 8;
+static const int Margin = 2;
+static const int ButtonFrame = 2;
+
+static QSize buttonShift(const QwtLegendItem *w)
+{
+#if QT_VERSION < 0x040000
+    const int ph = w->style().pixelMetric(
+        QStyle::PM_ButtonShiftHorizontal, w);
+    const int pv = w->style().pixelMetric(
+        QStyle::PM_ButtonShiftVertical, w);
+#else
+    QStyleOption option;
+    option.init(w);
+
+    const int ph = w->style()->pixelMetric(
+        QStyle::PM_ButtonShiftHorizontal, &option, w);
+    const int pv = w->style()->pixelMetric(
+        QStyle::PM_ButtonShiftVertical, &option, w);
+#endif
+    return QSize(ph, pv);
+}
+
+class QwtLegendItem::PrivateData
+{
+public:
+    PrivateData():
+        itemMode(QwtLegend::ReadOnlyItem),
+        isDown(false),
+        identifierMode(QwtLegendItem::ShowLine | QwtLegendItem::ShowText),
+        curvePen(Qt::NoPen)
+    {
+    }
+
+    QwtLegend::LegendItemMode itemMode;
+    bool isDown;
+
+    int identifierMode;
+    QwtSymbol symbol;
+    QPen curvePen;
+};
+
+/*!
+  \param parent Parent widget
+*/
+QwtLegendItem::QwtLegendItem(QWidget *parent):
+    QwtTextLabel(parent)
+{
+    d_data = new PrivateData;
+    init(QwtText());
+}
+
+/*!
+  \param symbol Curve symbol
+  \param curvePen Curve pen
+  \param text Label text
+  \param parent Parent widget
+*/
+QwtLegendItem::QwtLegendItem(const QwtSymbol &symbol, 
+        const QPen &curvePen, const QwtText &text, 
+        QWidget *parent):
+    QwtTextLabel(parent)
+{
+    d_data = new PrivateData;
+
+    d_data->symbol = symbol;
+    d_data->curvePen = curvePen;
+
+    init(text);
+}
+
+void QwtLegendItem::init(const QwtText &text)
+{
+    setIndent(Margin + IdentifierWidth + 2 * Margin);
+    setMargin(Margin);
+    setText(text);
+}
+
+QwtLegendItem::~QwtLegendItem()
+{
+    delete d_data;
+    d_data = NULL;
+}
+
+void QwtLegendItem::setText(const QwtText &text)
+{
+    const int flags = Qt::AlignLeft | Qt::AlignVCenter
+#if QT_VERSION < 0x040000
+        | Qt::WordBreak | Qt::ExpandTabs;
+#else
+        | Qt::TextExpandTabs | Qt::TextWordWrap;
+#endif
+
+    QwtText txt = text;
+    txt.setFlags(flags);
+
+    QwtTextLabel::setText(txt);
+}
+
+void QwtLegendItem::setItemMode(QwtLegend::LegendItemMode mode) 
+{ 
+    d_data->itemMode = mode; 
+    d_data->isDown = false; 
+
+#if QT_VERSION >= 0x040000
+    using namespace Qt;
+#endif
+    setFocusPolicy(mode != QwtLegend::ReadOnlyItem ? TabFocus : NoFocus);
+    setMargin(Margin + ButtonFrame);
+
+    updateGeometry();
+}
+
+QwtLegend::LegendItemMode QwtLegendItem::itemMode() const 
+{ 
+    return d_data->itemMode; 
+}
+
+/*!
+  Set identifier mode.
+  Default is ShowLine | ShowText.
+  \param mode Or'd values of IdentifierMode
+
+  \sa QwtLegendItem::identifierMode()
+*/
+void QwtLegendItem::setIdentifierMode(int mode)
+{
+    if ( mode != d_data->identifierMode )
+    {
+        d_data->identifierMode = mode;
+        update();
+    }
+}
+
+/*!
+  Or'd values of IdentifierMode.
+  \sa QwtLegendItem::setIdentifierMode(), QwtLegendItem::IdentifierMode
+*/
+int QwtLegendItem::identifierMode() const 
+{ 
+    return d_data->identifierMode; 
+}
+
+/*! 
+  Set curve symbol.
+  \param symbol Symbol
+
+  \sa QwtLegendItem::symbol()
+*/
+void QwtLegendItem::setSymbol(const QwtSymbol &symbol) 
+{
+    if ( symbol != d_data->symbol )
+    {
+        d_data->symbol = symbol;
+        update();
+    }
+}
+    
+/*!
+  \return The curve symbol.
+  \sa QwtLegendItem::setSymbol()
+*/
+const QwtSymbol& QwtLegendItem::symbol() const 
+{ 
+    return d_data->symbol; 
+}
+    
+
+/*! 
+  Set curve pen.
+  \param pen Curve pen
+
+  \sa QwtLegendItem::curvePen()
+*/
+void QwtLegendItem::setCurvePen(const QPen &pen) 
+{
+    if ( pen != d_data->curvePen )
+    {
+        d_data->curvePen = pen;
+        update();
+    }
+}
+
+/*!
+  \return The curve pen.
+  \sa QwtLegendItem::setCurvePen()
+*/
+const QPen& QwtLegendItem::curvePen() const 
+{ 
+    return d_data->curvePen; 
+}
+
+/*! 
+  Paint the identifier to a given rect.
+  \param painter Painter
+  \param rect Rect where to paint
+*/
+void QwtLegendItem::drawIdentifier(
+    QPainter *painter, const QRect &rect) const
+{
+    if ( rect.isEmpty() )
+        return;
+
+    if ( (d_data->identifierMode & ShowLine ) && (d_data->curvePen.style() != Qt::NoPen) )
+    {
+        painter->save();
+        painter->setPen(d_data->curvePen);
+        QwtPainter::drawLine(painter, rect.left(), rect.center().y(), 
+            rect.right(), rect.center().y());
+        painter->restore();
+    }
+
+    if ( (d_data->identifierMode & ShowSymbol) 
+        && (d_data->symbol.style() != QwtSymbol::None) )
+    {
+        QSize symbolSize = 
+            QwtPainter::metricsMap().screenToLayout(d_data->symbol.size());
+
+        // scale the symbol size down if it doesn't fit into rect.
+
+        if ( rect.width() < symbolSize.width() )
+        {
+            const double ratio = 
+                double(symbolSize.width()) / double(rect.width());
+            symbolSize.setWidth(rect.width());
+            symbolSize.setHeight(qRound(symbolSize.height() / ratio));
+        }
+        if ( rect.height() < symbolSize.height() )
+        {
+            const double ratio = 
+                double(symbolSize.width()) / double(rect.width());
+            symbolSize.setHeight(rect.height());
+            symbolSize.setWidth(qRound(symbolSize.width() / ratio));
+        }
+
+        QRect symbolRect;
+        symbolRect.setSize(symbolSize);
+        symbolRect.moveCenter(rect.center());
+
+        painter->save();
+        painter->setBrush(d_data->symbol.brush());
+        painter->setPen(d_data->symbol.pen());
+        d_data->symbol.draw(painter, symbolRect);
+        painter->restore();
+    }
+}
+
+/*!
+  Draw the legend item to a given rect.
+  \param painter Painter
+  \param rect Rect where to paint the button
+*/
+
+void QwtLegendItem::drawItem(QPainter *painter, const QRect &rect) const
+{
+    painter->save();
+
+    const QwtMetricsMap &map = QwtPainter::metricsMap();
+
+    const int margin = map.screenToLayoutX(Margin);
+
+    const QRect identifierRect(rect.x() + margin, rect.y(), 
+        map.screenToLayoutX(IdentifierWidth), rect.height());
+    drawIdentifier(painter, identifierRect);
+
+    // Label
+
+    QRect titleRect = rect;
+    titleRect.setX(identifierRect.right() + 2 * margin);
+     
+    text().draw(painter, titleRect);
+
+    painter->restore();
+}
+
+void QwtLegendItem::paintEvent(QPaintEvent *e)
+{
+    const QRect cr = contentsRect();
+
+    QPainter painter(this);
+    painter.setClipRegion(e->region());
+
+    if ( d_data->isDown )
+    {
+        qDrawWinButton(&painter, 0, 0, width(), height(), 
+#if QT_VERSION < 0x040000
+            colorGroup(), 
+#else
+            palette(),
+#endif
+            true);
+    }
+
+    painter.save();
+
+    if ( d_data->isDown )
+    {
+        const QSize shiftSize = buttonShift(this);
+        painter.translate(shiftSize.width(), shiftSize.height());
+    }
+
+    painter.setClipRect(cr);
+
+    drawContents(&painter);
+
+    QRect rect = cr;
+    rect.setX(rect.x() + Margin);
+    if ( d_data->itemMode != QwtLegend::ReadOnlyItem )
+        rect.setX(rect.x() + ButtonFrame);
+
+    rect.setWidth(IdentifierWidth);
+
+    drawIdentifier(&painter, rect);
+
+    painter.restore();
+}
+
+void QwtLegendItem::mousePressEvent(QMouseEvent *e)
+{
+    if ( e->button() != Qt::LeftButton )
+        return;
+
+    switch(d_data->itemMode)
+    {
+        case QwtLegend::ClickableItem:
+        {
+            setDown(true);
+            break;
+        }
+        case QwtLegend::CheckableItem:
+        {
+            setDown(!isDown());
+            break;
+        }
+        default:;
+    }
+}
+
+void QwtLegendItem::mouseReleaseEvent(QMouseEvent *e)
+{
+    if ( !e->button() == Qt::LeftButton )
+        return;
+
+    if ( d_data->itemMode == QwtLegend::ClickableItem )
+        setDown(false);
+}
+
+void QwtLegendItem::keyPressEvent(QKeyEvent *e)
+{
+    if ( e->key() != Qt::Key_Space || e->isAutoRepeat() )
+        return;
+
+    switch(d_data->itemMode)
+    {
+        case QwtLegend::ClickableItem:
+        {
+            setDown(true);
+            break;
+        }
+        case QwtLegend::CheckableItem:
+        {
+            setDown(!isDown());
+            break;
+        }
+        default:;
+    }
+}
+
+void QwtLegendItem::keyReleaseEvent(QKeyEvent *e)
+{
+    if ( e->key() != Qt::Key_Space || e->isAutoRepeat() )
+        return;
+
+    if ( d_data->itemMode == QwtLegend::ClickableItem )
+        setDown(false);
+}
+
+void QwtLegendItem::setChecked(bool on)
+{
+    if ( d_data->itemMode == QwtLegend::CheckableItem )
+    {
+        const bool isBlocked = signalsBlocked();
+        blockSignals(true);
+
+        setDown(on);
+
+        blockSignals(isBlocked);
+    }
+}
+
+bool QwtLegendItem::isChecked() const
+{
+    return d_data->itemMode == QwtLegend::CheckableItem && isDown();
+}
+
+void QwtLegendItem::setDown(bool down)
+{
+    if ( down == d_data->isDown )
+        return;
+
+    d_data->isDown = down;
+    update();
+
+    if ( d_data->itemMode == QwtLegend::ClickableItem )
+    {
+        if ( d_data->isDown )
+            emit pressed();
+        else
+        {
+            emit released();
+            emit clicked();
+        }
+    }
+
+    if ( d_data->itemMode == QwtLegend::CheckableItem )
+        emit checked(d_data->isDown);
+}
+
+bool QwtLegendItem::isDown() const
+{
+    return d_data->isDown;
+}
+
+QSize QwtLegendItem::sizeHint() const
+{
+    QSize sz = QwtTextLabel::sizeHint();
+    if ( d_data->itemMode != QwtLegend::ReadOnlyItem )
+        sz += buttonShift(this);
+
+    return sz;
+}
+
+void QwtLegendItem::drawText(QPainter *painter, const QRect &rect)
+{
+    QwtTextLabel::drawText(painter, rect);
+}
diff --git a/src/qwt/qwt_math.cpp b/src/qwt/qwt_math.cpp
new file mode 100644
index 0000000..63099be
--- /dev/null
+++ b/src/qwt/qwt_math.cpp
@@ -0,0 +1,47 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include "qwt_math.h"
+
+/*!
+  \brief Find the smallest value in an array
+  \param array Pointer to an array
+  \param size Array size
+*/
+double qwtGetMin(const double *array, int size)
+{
+    if (size <= 0)
+       return 0.0;
+
+    double rv = array[0];
+    for (int i = 1; i < size; i++)
+       rv = qwtMin(rv, array[i]);
+
+    return rv;
+}
+
+
+/*!
+  \brief Find the largest value in an array
+  \param array Pointer to an array
+  \param size Array size
+*/
+double qwtGetMax(const double *array, int size)
+{
+    if (size <= 0)
+       return 0.0;
+    
+    double rv = array[0];
+    for (int i = 1; i < size; i++)
+       rv = qwtMax(rv, array[i]);
+
+    return rv;
+}
diff --git a/src/qwt/qwt_paint_buffer.cpp b/src/qwt/qwt_paint_buffer.cpp
new file mode 100644
index 0000000..1aa45bd
--- /dev/null
+++ b/src/qwt/qwt_paint_buffer.cpp
@@ -0,0 +1,201 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+
+#include <qglobal.h>
+#if QT_VERSION < 0x040000
+
+#include <qwidget.h>
+#include <qpainter.h>
+#include "qwt_paint_buffer.h"
+
+bool QwtPaintBuffer::d_enabled = true;
+
+//! Default constructor
+QwtPaintBuffer::QwtPaintBuffer():
+    d_device(0),
+    d_painter(0),
+    d_devicePainter(0)
+{
+}
+
+/*! 
+    Create an open paint buffer
+    \param device Device to paint on
+    \param rect Rect to paint on
+    \param painter Painter to paint on device. In case of 0
+                   QwtPaintBuffer uses an internal painter
+
+    \sa QwtPaintBuffer::open()
+*/
+
+QwtPaintBuffer::QwtPaintBuffer(QPaintDevice *device, 
+        const QRect &rect, QPainter *painter):
+    d_device(0),
+    d_painter(0),
+    d_devicePainter(0)
+{
+    open(device, rect, painter);
+}
+
+/*! 
+    Closes the buffer
+    \sa QwtPaintBuffer::close()
+*/
+QwtPaintBuffer::~QwtPaintBuffer()
+{
+    close();
+}
+
+/*! 
+  \return Depending on isEnabled() the painter
+          connected to an internal pixmap buffer 
+          otherwise the painter connected to the device.
+*/
+
+QPainter *QwtPaintBuffer::painter() 
+{ 
+    return d_painter; 
+}
+
+/*! 
+  \return Device to paint on
+*/
+const QPaintDevice *QwtPaintBuffer::device() 
+{ 
+    return d_device; 
+}
+
+/*! 
+    Enable/Disable double buffering. Please note that
+    this is a global switch for all QwtPaintBuffers, but
+    won't change opened buffers.
+*/
+void QwtPaintBuffer::setEnabled(bool enable) 
+{ 
+    d_enabled = enable; 
+}
+
+/*! 
+  \return true if double buffering is enabled, false otherwise.
+*/
+bool QwtPaintBuffer::isEnabled() 
+{ 
+    return d_enabled; 
+}
+
+/*! 
+    Open the buffer
+    \param device Device to paint on
+    \param rect Rect to paint on
+    \param painter Painter to paint on device. In case of 0
+                   QwtPaintBuffer uses an internal painter
+*/
+
+void QwtPaintBuffer::open(QPaintDevice *device, 
+        const QRect &rect, QPainter *painter)
+{
+    close();
+
+    if ( device == 0 || !rect.isValid() )
+        return;
+
+    d_device = device;
+    d_devicePainter = painter;
+    d_rect = rect;
+
+    if ( isEnabled() )
+    {
+#ifdef Q_WS_X11
+        if ( d_pixBuffer.x11Screen() != d_device->x11Screen() )
+            d_pixBuffer.x11SetScreen(d_device->x11Screen());
+#endif
+        d_pixBuffer.resize(d_rect.size());
+
+        d_painter = new QPainter();
+        if ( d_device->devType() == QInternal::Widget )
+        {
+            QWidget *w = (QWidget *)d_device;
+            d_pixBuffer.fill(w, d_rect.topLeft());
+            d_painter->begin(&d_pixBuffer, w);
+            d_painter->translate(-d_rect.x(), -d_rect.y());
+        }
+        else
+        {
+            d_painter->begin(&d_pixBuffer);
+        }
+    }
+    else
+    {
+        if ( d_devicePainter )
+            d_painter = d_devicePainter;
+        else
+            d_painter = new QPainter(d_device);
+
+        if ( d_device->devType() == QInternal::Widget )
+        {
+            QWidget *w = (QWidget *)d_device;
+            if ( w->testWFlags( Qt::WNoAutoErase ) )
+                d_painter->eraseRect(d_rect);
+        }
+    }
+}
+
+/*! 
+    Flush the internal pixmap buffer to the device.
+*/
+void QwtPaintBuffer::flush()
+{
+    if ( d_enabled && d_device != 0 && d_rect.isValid())
+    {
+        // We need a painter to find out if
+        // there is a painter redirection for d_device.
+
+        QPainter *p;
+        if ( d_devicePainter == 0 )
+            p = new QPainter(d_device);
+        else 
+            p = d_devicePainter;
+
+        QPaintDevice *device = p->device();
+        if ( device->isExtDev() )
+            d_devicePainter->drawPixmap(d_rect.topLeft(), d_pixBuffer);
+        else
+            bitBlt(device, d_rect.topLeft(), &d_pixBuffer );
+
+        if ( d_devicePainter == 0 )
+            delete p;
+    }
+}
+
+/*! 
+    Flush the internal pixmap buffer to the device and close the buffer.
+*/
+void QwtPaintBuffer::close()
+{
+    flush();
+
+    if ( d_painter )
+    {
+        if ( d_painter->isActive() )
+            d_painter->end();
+
+        if ( d_painter != d_devicePainter )
+            delete d_painter;
+    }
+
+    if ( !d_pixBuffer.isNull() )
+        d_pixBuffer = QPixmap();
+
+    d_device = 0;
+    d_painter = 0;
+    d_devicePainter = 0;
+} 
+
+#endif // QT_VERSION < 0x040000
diff --git a/src/qwt/qwt_painter.cpp b/src/qwt/qwt_painter.cpp
new file mode 100644
index 0000000..d20d872
--- /dev/null
+++ b/src/qwt/qwt_painter.cpp
@@ -0,0 +1,545 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qwindowdefs.h>
+#include <qwidget.h>
+#include <qrect.h>
+#include <qpainter.h>
+#include <qpalette.h>
+#include <qpaintdevice.h>
+#include <qpixmap.h>
+#include <qstyle.h>
+#if QT_VERSION < 0x040000
+#include <qsimplerichtext.h>
+#include <qpointarray.h>
+#define QwtPointArray QPointArray
+#else
+#include <qtextdocument.h>
+#include <qabstracttextdocumentlayout.h>
+#include <qstyleoption.h>
+#include <qpolygon.h>
+#define QwtPointArray QPolygon
+#endif
+
+#include "qwt_painter.h"
+#include "qwt_rect.h"
+#include "qwt_math.h"
+
+QwtMetricsMap QwtPainter::d_metricsMap;
+
+#if defined(Q_WS_X11)
+bool QwtPainter::d_deviceClipping = true;
+#else
+bool QwtPainter::d_deviceClipping = false;
+#endif
+
+/*!
+  En/Disable device clipping. On X11 the default
+  for device clipping is enabled, otherwise it is disabled.
+  \sa QwtPainter::deviceClipping()
+*/
+void QwtPainter::setDeviceClipping(bool enable)
+{
+    d_deviceClipping = enable;
+}
+
+/*!
+  Returns whether device clipping is enabled. On X11 the default
+  is enabled, otherwise it is disabled.
+  \sa QwtPainter::setDeviceClipping()
+*/
+
+bool QwtPainter::deviceClipping()
+{
+    return d_deviceClipping;
+}
+
+/*!
+  Returns rect for device clipping
+  \sa QwtPainter::setDeviceClipping()
+*/
+const QRect &QwtPainter::deviceClipRect()
+{
+    static QRect clip;
+
+    if ( !clip.isValid() )
+    {
+        clip.setCoords(QWT_COORD_MIN, QWT_COORD_MIN,
+            QWT_COORD_MAX, QWT_COORD_MAX);
+    }
+    return clip;
+}
+
+//! Clip a point array
+QwtPointArray QwtPainter::clip(const QwtPointArray &pa)
+{
+    const QwtRect rect(deviceClipRect());
+    return rect.clip(pa);
+}
+
+/*!
+  Scale all QwtPainter drawing operations using the ratio
+  QwtPaintMetrics(from).logicalDpiX() / QwtPaintMetrics(to).logicalDpiX()
+  and QwtPaintMetrics(from).logicalDpiY() / QwtPaintMetrics(to).logicalDpiY()
+
+  \sa QwtPainter::resetScaleMetrics(), QwtPainter::scaleMetricsX,
+        QwtPainter::scaleMetricsY()
+*/
+void QwtPainter::setMetricsMap(const QPaintDevice *layout,
+    const QPaintDevice *device)
+{
+    d_metricsMap.setMetrics(layout, device);
+}
+
+/*! 
+  Change the metrics map 
+  \sa QwtPainter::resetMetricsMap, QwtPainter::metricsMap
+*/
+void QwtPainter::setMetricsMap(const QwtMetricsMap &map)
+{
+    d_metricsMap = map;
+}
+
+/*! 
+   Reset the metrics map to the ratio 1:1
+   \sa QwtPainter::setMetricsMap, QwtPainter::resetMetricsMap
+*/
+void QwtPainter::resetMetricsMap()
+{
+    d_metricsMap = QwtMetricsMap();
+}
+
+/*!
+  \return Metrics map
+*/
+const QwtMetricsMap &QwtPainter::metricsMap()
+{
+    return d_metricsMap;
+}
+
+/*!
+    Wrapper for QPainter::setClipRect()
+*/
+void QwtPainter::setClipRect(QPainter *painter, const QRect &rect)
+{
+    painter->setClipRect(d_metricsMap.layoutToDevice(rect, painter));
+}
+
+/*!
+    Wrapper for QPainter::drawRect()
+*/
+void QwtPainter::drawRect(QPainter *painter, int x, int y, int w, int h) 
+{
+    drawRect(painter, QRect(x, y, w, h));
+}
+
+/*!
+    Wrapper for QPainter::drawRect()
+*/
+void QwtPainter::drawRect(QPainter *painter, const QRect &rect) 
+{
+    const QRect r = d_metricsMap.layoutToDevice(rect, painter);
+
+    QRect clipRect;
+
+#if QT_VERSION == 0x040000 
+    /*
+      Performance of Qt4.0.0 is horrible for non trivial brushs. Without
+      clipping expect minutes or hours for repainting large rects
+      (might result from zooming). Announced to be fixed in 4.0.1.
+     */
+    clipRect = painter->window();
+    if ( painter->hasClipping() )
+        clipRect &= painter->clipRegion().boundingRect();
+    if ( d_deviceClipping )
+        clipRect &= deviceClipRect();
+#else
+    if ( d_deviceClipping )
+        clipRect = deviceClipRect();
+#endif
+    if ( clipRect.isValid() )
+    {
+        if ( !clipRect.intersects(r) )
+            return;
+
+        if ( !clipRect.contains(r) )
+        {
+            fillRect(painter, r & clipRect, painter->brush());
+
+#ifdef __GNUC__
+#warning alignment of rects needs to be checked
+#endif
+            int pw = painter->pen().width();
+            pw = pw % 2 + pw / 2;
+
+            QwtPointArray pa(5);
+            pa.setPoint(0, r.left(), r.top());
+            pa.setPoint(1, r.right() - pw, r.top());
+            pa.setPoint(2, r.right() - pw, r.bottom() - pw);
+            pa.setPoint(3, r.left(), r.bottom() - pw);
+            pa.setPoint(4, r.left(), r.top());
+
+            painter->save();
+            painter->setBrush(Qt::NoBrush);
+            drawPolyline(painter, pa);
+            painter->restore();
+
+            return;
+        }
+    }
+
+    painter->drawRect(r);
+}
+
+/*!
+    Wrapper for QPainter::fillRect()
+*/
+void QwtPainter::fillRect(QPainter *painter, 
+    const QRect &rect, const QBrush &brush)
+{
+    if ( !rect.isValid() )
+        return;
+
+    QRect clipRect;
+#if QT_VERSION >= 0x040000
+
+    /*
+      Performance of Qt4 is horrible for non trivial brushs. Without
+      clipping expect minutes or hours for repainting large rects
+      (might result from zooming)
+    */
+
+    clipRect = painter->window();
+    if ( painter->hasClipping() )
+        clipRect &= painter->clipRegion().boundingRect();
+    if ( d_deviceClipping )
+        clipRect &= deviceClipRect();
+#else
+    if ( d_deviceClipping )
+        clipRect = deviceClipRect();
+#endif
+
+    QRect r = d_metricsMap.layoutToDevice(rect, painter);
+    if ( clipRect.isValid() )
+        r = r.intersect(clipRect);
+
+    if ( r.isValid() )
+        painter->fillRect(r, brush);
+}
+
+/*!
+    Wrapper for QPainter::drawEllipse()
+*/
+void QwtPainter::drawEllipse(QPainter *painter, const QRect &rect)
+{
+    const QRect r = d_metricsMap.layoutToDevice(rect, painter);
+
+    if ( d_deviceClipping && !deviceClipRect().contains(rect) )
+        return;
+
+    painter->drawEllipse(r);
+}
+
+/*!
+    Wrapper for QPainter::drawText()
+*/
+void QwtPainter::drawText(QPainter *painter, int x, int y, 
+        const QString &text)
+{
+    drawText(painter, QPoint(x, y), text);
+}
+
+/*!
+    Wrapper for QPainter::drawText()
+*/
+void QwtPainter::drawText(QPainter *painter, const QPoint &pos, 
+        const QString &text)
+{
+    const QPoint p = d_metricsMap.layoutToDevice(pos, painter);
+
+    if ( d_deviceClipping && !deviceClipRect().contains(p) )
+        return;
+
+    painter->drawText(p, text);
+}
+
+/*!
+    Wrapper for QPainter::drawText()
+*/
+void QwtPainter::drawText(QPainter *painter, int x, int y, int w, int h, 
+        int flags, const QString &text)
+{
+    drawText(painter, QRect(x, y, w, h), flags, text);
+}
+
+/*!
+    Wrapper for QPainter::drawText()
+*/
+void QwtPainter::drawText(QPainter *painter, const QRect &rect, 
+        int flags, const QString &text)
+{
+    painter->drawText(
+        d_metricsMap.layoutToDevice(rect, painter), flags, text);
+}
+
+#ifndef QT_NO_RICHTEXT
+
+/*!
+  Wrapper for QSimpleRichText::draw()
+*/
+#if QT_VERSION < 0x040000
+
+void QwtPainter::drawSimpleRichText(QPainter *painter, const QRect &rect,
+    int flags, QSimpleRichText &text)
+{
+    QColorGroup cg;
+    cg.setColor(QColorGroup::Text, painter->pen().color());
+
+    const QRect scaledRect = d_metricsMap.layoutToDevice(rect, painter);
+
+    text.setWidth(painter, scaledRect.width());
+
+    // QSimpleRichText is Qt::AlignTop by default
+
+    int y = scaledRect.y();
+    if (flags & Qt::AlignBottom)
+        y += (scaledRect.height() - text.height());
+    else if (flags & Qt::AlignVCenter)
+        y += (scaledRect.height() - text.height())/2;
+
+    text.draw(painter, scaledRect.x(), y, scaledRect, cg);
+}
+#else
+void QwtPainter::drawSimpleRichText(QPainter *painter, const QRect &rect,
+    int flags, QTextDocument &text)
+{
+    const QRect scaledRect = d_metricsMap.layoutToDevice(rect, painter);
+    text.setPageSize(QSize(scaledRect.width(), QWIDGETSIZE_MAX));
+
+    QAbstractTextDocumentLayout* layout = text.documentLayout();
+
+    const int height = qRound(layout->documentSize().height());
+    int y = scaledRect.y();
+    if (flags & Qt::AlignBottom)
+        y += (scaledRect.height() - height);
+    else if (flags & Qt::AlignVCenter)
+        y += (scaledRect.height() - height)/2;
+
+    QAbstractTextDocumentLayout::PaintContext context;
+    context.palette.setColor(QPalette::Text, painter->pen().color());
+
+    painter->save();
+
+    painter->translate(scaledRect.x(), scaledRect.y());
+    layout->draw(painter, context);
+
+    painter->restore();
+}
+#endif
+
+#endif // !QT_NO_RICHTEXT
+
+
+/*!
+  Wrapper for QPainter::drawLine()
+*/
+void QwtPainter::drawLine(QPainter *painter, int x1, int y1, int x2, int y2)
+{
+    if ( d_deviceClipping && 
+        !(deviceClipRect().contains(x1, y1) && deviceClipRect().contains(x2, y2)) )
+    {
+        QwtPointArray pa(2);
+        pa.setPoint(0, x1, y1);
+        pa.setPoint(1, x2, y2);
+        drawPolyline(painter, pa);
+        return;
+    }
+
+    if ( d_metricsMap.isIdentity() )
+    {
+#if QT_VERSION >= 0x030200 && QT_VERSION < 0x040000
+        if ( !painter->device()->isExtDev() )
+#endif
+        {
+            painter->drawLine(x1, y1, x2, y2);
+            return;
+        }
+    }
+
+    const QPoint p1 = d_metricsMap.layoutToDevice(QPoint(x1, y1));
+    const QPoint p2 = d_metricsMap.layoutToDevice(QPoint(x2, y2));
+
+#if QT_VERSION >= 0x030200 && QT_VERSION < 0x040000
+    if ( painter->device()->isExtDev() )
+    {
+        // Strange: the postscript driver of QPrinter adds an offset 
+        // of 0.5 to the start/endpoint when using drawLine, but not
+        // for lines painted with drawLineSegments.
+
+        QwtPointArray pa(2);
+        pa.setPoint(0, p1);
+        pa.setPoint(1, p2);
+        painter->drawLineSegments(pa);
+    }
+    else
+        painter->drawLine(p1, p2);
+#else
+    painter->drawLine(p1, p2);
+#endif
+}
+
+/*!
+  Wrapper for QPainter::drawPolygon()
+*/
+void QwtPainter::drawPolygon(QPainter *painter, const QwtPointArray &pa)
+{
+    QwtPointArray cpa = d_metricsMap.layoutToDevice(pa);
+    if ( d_deviceClipping )
+    {
+#ifdef __GNUC__
+#warning clipping ignores painter transformations
+#endif
+        cpa = clip(cpa);
+    }
+    painter->drawPolygon(cpa);
+}
+
+/*!
+    Wrapper for QPainter::drawPolyline()
+*/
+void QwtPainter::drawPolyline(QPainter *painter, const QwtPointArray &pa)
+{
+    QwtPointArray cpa = d_metricsMap.layoutToDevice(pa);
+    if ( d_deviceClipping )
+        cpa = clip(cpa);
+    painter->drawPolyline(cpa);
+}
+
+/*!
+    Wrapper for QPainter::drawPoint()
+*/
+
+void QwtPainter::drawPoint(QPainter *painter, int x, int y)
+{
+    const QPoint pos = d_metricsMap.layoutToDevice(QPoint(x, y));
+
+    if ( d_deviceClipping && !deviceClipRect().contains(pos) )
+        return;
+
+    painter->drawPoint(pos);
+}
+
+void QwtPainter::drawColoredArc(QPainter *painter, const QRect &rect, 
+    int peak, int arc, int interval, const QColor &c1, const QColor &c2)
+{
+    int h1, s1, v1;
+    int h2, s2, v2;
+
+#if QT_VERSION < 0x040000
+    c1.hsv(&h1, &s1, &v1);
+    c2.hsv(&h2, &s2, &v2);
+#else
+    c1.getHsv(&h1, &s1, &v1);
+    c2.getHsv(&h2, &s2, &v2);
+#endif
+    
+    arc /= 2;
+    for ( int angle = -arc; angle < arc; angle += interval)
+    {
+        double ratio;
+        if ( angle >= 0 )
+            ratio = 1.0 - angle / double(arc);
+        else
+            ratio = 1.0 + angle / double(arc);
+            
+
+        QColor c;
+        c.setHsv( h1 + qRound(ratio * (h2 - h1)),
+            s1 + qRound(ratio * (s2 - s1)),
+            v1 + qRound(ratio * (v2 - v1)) );
+
+        painter->setPen(QPen(c, painter->pen().width()));
+        painter->drawArc(rect, (peak + angle) * 16, interval * 16);
+    }
+}
+
+void QwtPainter::drawFocusRect(QPainter *painter, QWidget *widget)
+{
+    drawFocusRect(painter, widget, widget->rect());
+}
+
+void QwtPainter::drawFocusRect(QPainter *painter, QWidget *widget,
+    const QRect &rect)
+{
+#if QT_VERSION < 0x040000
+        widget->style().drawPrimitive(QStyle::PE_FocusRect, painter,
+            rect, widget->colorGroup());
+#else
+        QStyleOptionFocusRect opt;
+        opt.init(widget);
+        opt.rect = rect;
+        opt.state |= QStyle::State_HasFocus;
+
+        widget->style()->drawPrimitive(QStyle::PE_FrameFocusRect, 
+            &opt, painter, widget);
+#endif
+
+}
+
+//!  Draw a round frame
+#if QT_VERSION < 0x040000
+void QwtPainter::drawRoundFrame(QPainter *painter, const QRect &rect,
+    int width, const QColorGroup &cg, bool sunken)
+#else
+void QwtPainter::drawRoundFrame(QPainter *painter, const QRect &rect,
+    int width, const QPalette &palette, bool sunken)
+#endif
+{
+
+#if QT_VERSION < 0x040000
+    QColor c0 = cg.mid();
+    QColor c1, c2;
+    if ( sunken )
+    {
+        c1 = cg.dark();
+        c2 = cg.light();
+    }
+    else
+    {
+        c1 = cg.light();
+        c2 = cg.dark();
+    }
+#else
+    QColor c0 = palette.color(QPalette::Mid);
+    QColor c1, c2;
+    if ( sunken )
+    {
+        c1 = palette.color(QPalette::Dark);
+        c2 = palette.color(QPalette::Light);
+    }
+    else
+    {
+        c1 = palette.color(QPalette::Light);
+        c2 = palette.color(QPalette::Dark);
+    }
+#endif
+
+    painter->setPen(QPen(c0, width));
+    painter->drawArc(rect, 0, 360 * 16); // full
+
+    const int peak = 150;
+    const int interval = 2;
+
+    if ( c0 != c1 )
+        drawColoredArc(painter, rect, peak, 160, interval, c0, c1);
+    if ( c0 != c2 )
+        drawColoredArc(painter, rect, peak + 180, 120, interval, c0, c2);
+}
diff --git a/src/qwt/qwt_picker.cpp b/src/qwt/qwt_picker.cpp
new file mode 100644
index 0000000..6c8f246
--- /dev/null
+++ b/src/qwt/qwt_picker.cpp
@@ -0,0 +1,1294 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qapplication.h>
+#include <qevent.h>
+#include <qpainter.h>
+#include <qframe.h>
+#include <qcursor.h>
+#include <qbitmap.h>
+#include "qwt_math.h"
+#include "qwt_painter.h"
+#include "qwt_picker_machine.h"
+#include "qwt_picker.h"
+#if QT_VERSION < 0x040000
+#include <qguardedptr.h>
+#else
+#include <qpointer.h>
+#endif
+
+class QwtPicker::PrivateData
+{
+public:
+    class PickerWidget: public QWidget
+    {
+    public:
+        enum Type
+        {
+            RubberBand,
+            Text
+        };
+        PickerWidget(QwtPicker *, QWidget *, Type);
+        virtual void updateMask();
+
+    protected:
+        virtual void paintEvent(QPaintEvent *);
+
+        QwtPicker *d_picker;
+        Type d_type;
+    };
+
+    bool enabled;
+
+    QwtPickerMachine *stateMachine;
+
+    int selectionFlags;
+    QwtPicker::ResizeMode resizeMode;
+
+    QwtPicker::RubberBand rubberBand;
+    QPen rubberBandPen;
+
+    QwtPicker::DisplayMode trackerMode;
+    QPen trackerPen;
+    QFont trackerFont;
+
+    QwtPicker::SelectedPoints selection;
+    bool isActive;
+    QPoint labelPosition;
+
+    bool mouseTracking; // used to save previous value
+
+    /*
+      On X11 the widget below the picker widgets gets paint events
+      with a region that is the bounding rect of the mask, if it is complex.
+      In case of (f.e) a CrossRubberBand and a text this creates complete
+      repaints of the widget. So we better use two different widgets.
+     */
+     
+#if QT_VERSION < 0x040000
+    QGuardedPtr<PickerWidget> rubberBandWidget;
+    QGuardedPtr<PickerWidget> textLabelWidget;
+#else
+    QPointer<PickerWidget> rubberBandWidget;
+    QPointer<PickerWidget> textLabelWidget;
+#endif
+};
+
+QwtPicker::PrivateData::PickerWidget::PickerWidget(
+        QwtPicker *picker, QWidget *parent, Type type):
+    QWidget(parent),
+    d_picker(picker),
+    d_type(type)
+{
+#if QT_VERSION >= 0x040000
+    setAttribute(Qt::WA_TransparentForMouseEvents);
+    setAttribute(Qt::WA_NoSystemBackground);
+    setAttribute(Qt::WA_PaintOnScreen);
+    setFocusPolicy(Qt::NoFocus);
+#else
+    setBackgroundMode(Qt::NoBackground);
+    setFocusPolicy(QWidget::NoFocus);
+#endif
+    hide();
+}
+
+void QwtPicker::PrivateData::PickerWidget::updateMask()
+{
+    QBitmap bm(width(), height());
+    bm.fill(Qt::color0);
+
+    QPainter painter(&bm);
+
+    if ( d_type == RubberBand )
+    {
+        QPen pen = d_picker->rubberBandPen();
+        pen.setColor(Qt::color1);
+        painter.setPen(pen);
+
+        d_picker->drawRubberBand(&painter);
+    }
+    if ( d_type == Text )
+    {
+        QPen pen = d_picker->trackerPen();
+        pen.setColor(Qt::color1);
+        painter.setPen(pen);
+
+        d_picker->drawTracker(&painter);
+    }
+
+    painter.end();
+
+
+#if QT_VERSION < 0x040000
+    QWidget *w = parentWidget();
+    const bool doUpdate = w->isUpdatesEnabled();
+    const Qt::BackgroundMode bgMode = w->backgroundMode();
+    w->setUpdatesEnabled(false);
+    if ( bgMode != Qt::NoBackground )
+        w->setBackgroundMode(Qt::NoBackground);
+#endif
+
+    const QRegion r(bm);
+    setMask(r);
+
+#if QT_VERSION < 0x040000
+    if ( bgMode != Qt::NoBackground )
+        w->setBackgroundMode(bgMode);
+
+    w->setUpdatesEnabled(doUpdate);
+#endif
+
+    setShown(!r.isEmpty());
+}
+
+void QwtPicker::PrivateData::PickerWidget::paintEvent(QPaintEvent *e)
+{
+    QPainter painter(this);
+
+    if ( d_type == RubberBand )
+    {
+        painter.setClipRegion(e->region());
+        painter.setPen(d_picker->rubberBandPen());
+        d_picker->drawRubberBand(&painter);
+    }
+
+    if ( d_type == Text )
+    {
+        painter.setClipRegion(e->region());
+        painter.setPen(d_picker->trackerPen());
+        d_picker->drawTracker(&painter);
+    }
+}
+
+/*!
+  Constructor
+
+  Creates an picker that is enabled, but where selection flag
+  is set to NoSelection, rubberband and tracker are disabled.
+  
+  \param parent Parent widget, that will be observed
+ */
+
+QwtPicker::QwtPicker(QWidget *parent):
+    QObject(parent)
+{
+    init(parent, NoSelection, NoRubberBand, AlwaysOff);
+}
+
+/*!
+  Constructor
+
+  \param selectionFlags Or�d value of SelectionType, RectSelectionType and 
+                        SelectionMode
+  \param rubberBand Rubberband style
+  \param trackerMode Tracker mode
+  \param parent Parent widget, that will be observed
+ */
+QwtPicker::QwtPicker(int selectionFlags, RubberBand rubberBand,
+        DisplayMode trackerMode, QWidget *parent):
+    QObject(parent)
+{
+    init(parent, selectionFlags, rubberBand, trackerMode);
+}
+
+//! Destructor
+QwtPicker::~QwtPicker()
+{
+    setMouseTracking(false);
+    delete d_data->stateMachine;
+    delete d_data->rubberBandWidget;
+    delete d_data->textLabelWidget;
+    delete d_data;
+}
+
+//! Init the picker, used by the constructors
+void QwtPicker::init(QWidget *parent, int selectionFlags, 
+    RubberBand rubberBand, DisplayMode trackerMode)
+{
+    d_data = new PrivateData;
+
+    d_data->rubberBandWidget = NULL;
+    d_data->textLabelWidget = NULL;
+
+    d_data->rubberBand = rubberBand;
+    d_data->enabled = false;
+    d_data->resizeMode = Stretch;
+    d_data->trackerMode = AlwaysOff;
+    d_data->isActive = false;
+    d_data->labelPosition = QPoint(-1, -1);
+    d_data->mouseTracking = false;
+
+    d_data->stateMachine = NULL;
+    setSelectionFlags(selectionFlags);
+
+    if ( parent )
+    {
+#if QT_VERSION >= 0x040000
+        if ( parent->focusPolicy() == Qt::NoFocus )
+            parent->setFocusPolicy(Qt::WheelFocus);
+#else
+        if ( parent->focusPolicy() == QWidget::NoFocus )
+            parent->setFocusPolicy(QWidget::WheelFocus);
+#endif
+
+        d_data->trackerFont = parent->font();
+        d_data->mouseTracking = parent->hasMouseTracking();
+        setEnabled(true);
+    }
+    setTrackerMode(trackerMode);
+}
+
+/*!
+   Set a state machine and delete the previous one
+*/
+void QwtPicker::setStateMachine(QwtPickerMachine *stateMachine)
+{
+    if ( d_data->stateMachine != stateMachine )
+    {
+        if ( isActive() )
+            end(false);
+
+        delete d_data->stateMachine;
+        d_data->stateMachine = stateMachine;
+
+        if ( d_data->stateMachine )
+            d_data->stateMachine->reset();
+    }
+}
+
+/*!
+   Create a state machine depending on the selection flags.
+
+   - PointSelection | ClickSelection\n
+     QwtPickerClickPointMachine()
+   - PointSelection | DragSelection\n
+     QwtPickerDragPointMachine()
+   - RectSelection | ClickSelection\n
+     QwtPickerClickRectMachine()
+   - RectSelection | DragSelection\n
+     QwtPickerDragRectMachine()
+   - PolygonSelection\n
+     QwtPickerPolygonMachine()
+
+   \sa setSelectionFlags()
+*/
+QwtPickerMachine *QwtPicker::stateMachine(int flags) const
+{
+    if ( flags & PointSelection )
+    {
+        if ( flags & ClickSelection )
+            return new QwtPickerClickPointMachine;
+        else
+            return new QwtPickerDragPointMachine;
+    }
+    if ( flags & RectSelection )
+    {
+        if ( flags & ClickSelection )
+            return new QwtPickerClickRectMachine;
+        else
+            return new QwtPickerDragRectMachine;
+    }
+    if ( flags & PolygonSelection )
+    {
+        return new QwtPickerPolygonMachine();
+    }
+    return NULL;
+}
+
+//! Return the parent widget, where the selection happens
+QWidget *QwtPicker::parentWidget()
+{
+    QObject *obj = parent();
+    if ( obj && obj->isWidgetType() )
+        return (QWidget *)obj;
+
+    return NULL;
+}
+
+//! Return the parent widget, where the selection happens
+const QWidget *QwtPicker::parentWidget() const
+{
+    QObject *obj = parent();
+    if ( obj && obj->isWidgetType() )
+        return (QWidget *)obj;
+
+    return NULL;
+}
+
+/*!
+  Set the selection flags
+
+  \param flags Or�d value of SelectionType, RectSelectionType and 
+               SelectionMode. The default value is NoSelection.
+
+  \sa selectionFlags(), SelectionType, RectSelectionType, SelectionMode
+*/
+
+void QwtPicker::setSelectionFlags(int flags)
+{
+    d_data->selectionFlags = flags;
+    setStateMachine(stateMachine(flags));
+}
+
+/*!
+  \return Selection flags, an Or�d value of SelectionType, RectSelectionType and
+          SelectionMode.
+  \sa setSelectionFlags(), SelectionType, RectSelectionType, SelectionMode
+*/
+int QwtPicker::selectionFlags() const
+{
+    return d_data->selectionFlags;
+}
+
+/*!
+  Set the rubberband style 
+
+  \param rubberBand Rubberband style
+         The default value is NoRubberBand.
+
+  \sa rubberBand(), RubberBand, setRubberBandPen()
+*/
+void QwtPicker::setRubberBand(RubberBand rubberBand)
+{
+    d_data->rubberBand = rubberBand;
+}
+
+/*!
+  \return Rubberband style
+  \sa setRubberBand(), RubberBand, rubberBandPen()
+*/
+QwtPicker::RubberBand QwtPicker::rubberBand() const
+{
+    return d_data->rubberBand;
+}
+
+/*!
+  \brief Set the display mode of the tracker.
+
+  A tracker displays information about current position of
+  the cursor as a string. The display mode controls
+  if the tracker has to be displayed whenever the observed
+  widget has focus and cursor (AlwaysOn), never (AlwaysOff), or
+  only when the selection is active (ActiveOnly).
+  
+  \param mode Tracker display mode
+
+  \warning In case of AlwaysOn, mouseTracking will be enabled
+           for the observed widget.
+  \sa trackerMode(), DisplayMode
+*/
+
+void QwtPicker::setTrackerMode(DisplayMode mode)
+{   
+    if ( d_data->trackerMode != mode )
+    {
+        d_data->trackerMode = mode;
+        setMouseTracking(d_data->trackerMode == AlwaysOn);
+    }
+}   
+
+/*!
+  \return Tracker display mode
+  \sa setTrackerMode(), DisplayMode
+*/
+QwtPicker::DisplayMode QwtPicker::trackerMode() const
+{   
+    return d_data->trackerMode;
+}   
+
+/*!
+  \brief Set the resize mode.
+
+  The resize mode controls what to do with the selected points of an active
+  selection when the observed widget is resized.
+
+  Stretch means the points are scaled according to the new
+  size, KeepSize means the points remain unchanged.
+
+  The default mode is Stretch.
+
+  \param mode Resize mode
+  \sa resizeMode(), ResizeMode
+*/
+void QwtPicker::setResizeMode(ResizeMode mode)
+{
+    d_data->resizeMode = mode;
+}   
+
+/*!
+  \return Resize mode
+  \sa setResizeMode(), ResizeMode
+*/
+
+QwtPicker::ResizeMode QwtPicker::resizeMode() const
+{   
+    return d_data->resizeMode;
+}
+
+/*!
+  \brief En/disable the picker
+
+  When enabled is true an event filter is installed for
+  the observed widget, otherwise the event filter is removed.
+
+  \param enabled true or false
+  \sa isEnabled(), eventFilter()
+*/
+void QwtPicker::setEnabled(bool enabled)
+{
+    if ( d_data->enabled != enabled )
+    {
+        d_data->enabled = enabled;
+
+        QWidget *w = parentWidget();
+        if ( w )
+        {
+            if ( enabled )
+                w->installEventFilter(this);
+            else
+                w->removeEventFilter(this);
+        }
+
+        updateDisplay();
+    }
+}
+
+/*!
+  \return true when enabled, false otherwise
+  \sa setEnabled, eventFilter()
+*/
+
+bool QwtPicker::isEnabled() const
+{
+    return d_data->enabled;
+}
+
+/*!
+  Set the font for the tracker
+
+  \param font Tracker font
+  \sa trackerFont(), setTrackerMode(), setTrackerPen()
+*/
+void QwtPicker::setTrackerFont(const QFont &font)
+{
+    if ( font != d_data->trackerFont )
+    {
+        d_data->trackerFont = font;
+        updateDisplay();
+    }
+}
+
+/*!
+  \return Tracker font
+  \sa setTrackerFont(), trackerMode(), trackerPen()
+*/
+
+QFont QwtPicker::trackerFont() const
+{
+    return d_data->trackerFont;
+}
+
+/*!
+  Set the pen for the tracker
+
+  \param pen Tracker pen
+  \sa trackerPen(), setTrackerMode(), setTrackerFont()
+*/
+void QwtPicker::setTrackerPen(const QPen &pen)
+{
+    if ( pen != d_data->trackerPen )
+    {
+        d_data->trackerPen = pen;
+        updateDisplay();
+    }
+}
+
+/*!
+  \return Tracker pen
+  \sa setTrackerPen(), trackerMode(), trackerFont()
+*/
+QPen QwtPicker::trackerPen() const
+{
+    return d_data->trackerPen;
+}
+
+/*!
+  Set the pen for the rubberband
+
+  \param pen Rubberband pen
+  \sa rubberBandPen(), setRubberBand()
+*/
+void QwtPicker::setRubberBandPen(const QPen &pen)
+{
+    if ( pen != d_data->rubberBandPen )
+    {
+        d_data->rubberBandPen = pen;
+        updateDisplay();
+    }
+}
+
+/*!
+  \return Rubberband pen
+  \sa setRubberBandPen(), rubberBand()
+*/
+QPen QwtPicker::rubberBandPen() const
+{
+    return d_data->rubberBandPen;
+}
+
+/*!
+   \brief Return the label for a position
+
+   In case of HLineRubberBand the label is the value of the
+   y position, in case of VLineRubberBand the value of the x position.
+   Otherwise the label contains x and y position separated by a �, �.
+
+   The format for the string conversion is "%d".
+
+   \param pos Position
+   \return Converted position as string
+*/
+
+QwtText QwtPicker::trackerText(const QPoint &pos) const
+{
+    QString label;
+
+    switch(rubberBand())
+    {
+        case HLineRubberBand:
+            label.sprintf("%d", pos.y());
+            break;
+        case VLineRubberBand:
+            label.sprintf("%d", pos.x());
+            break;
+        default:
+            label.sprintf("%d, %d", pos.x(), pos.y());
+    }
+    return label;
+}
+
+/*!
+   Draw a rubberband , depending on rubberBand() and selectionFlags()
+
+   \param painter Painter, initialized with clip rect 
+
+   \sa rubberBand(), RubberBand, selectionFlags()
+*/
+
+void QwtPicker::drawRubberBand(QPainter *painter) const
+{
+    if ( !isActive() || rubberBand() == NoRubberBand || 
+        rubberBandPen().style() == Qt::NoPen )
+    {
+        return;
+    }
+
+    const QRect &pRect = pickRect();
+    const SelectedPoints &pa = d_data->selection;
+
+    if ( selectionFlags() & PointSelection )
+    {
+        if ( pa.count() < 1 )
+            return;
+
+        const QPoint pos = pa[0];
+
+        switch(rubberBand())
+        {
+            case VLineRubberBand:
+                QwtPainter::drawLine(painter, pos.x(),
+                    pRect.top(), pos.x(), pRect.bottom());
+                break;
+
+            case HLineRubberBand:
+                QwtPainter::drawLine(painter, pRect.left(), 
+                    pos.y(), pRect.right(), pos.y());
+                break;
+
+            case CrossRubberBand:
+                QwtPainter::drawLine(painter, pos.x(),
+                    pRect.top(), pos.x(), pRect.bottom());
+                QwtPainter::drawLine(painter, pRect.left(), 
+                    pos.y(), pRect.right(), pos.y());
+                break;
+            default:
+                break;
+        }
+    }
+
+    else if ( selectionFlags() & RectSelection )
+    {
+        if ( pa.count() < 2 )
+            return;
+
+        QPoint p1 = pa[0];
+        QPoint p2 = pa[int(pa.count() - 1)];
+
+        if ( selectionFlags() & CenterToCorner )
+        {
+            p1.setX(p1.x() - (p2.x() - p1.x()));
+            p1.setY(p1.y() - (p2.y() - p1.y()));
+        }
+        else if ( selectionFlags() & CenterToRadius )
+        {
+            const int radius = qwtMax(qwtAbs(p2.x() - p1.x()), 
+                qwtAbs(p2.y() - p1.y()));
+            p2.setX(p1.x() + radius);
+            p2.setY(p1.y() + radius);
+            p1.setX(p1.x() - radius);
+            p1.setY(p1.y() - radius);
+        }
+
+#if QT_VERSION < 0x040000
+        const QRect rect = QRect(p1, p2).normalize();
+#else
+        const QRect rect = QRect(p1, p2).normalized();
+#endif
+        switch(rubberBand())
+        {
+            case EllipseRubberBand:
+                QwtPainter::drawEllipse(painter, rect);
+                break;
+            case RectRubberBand:
+                QwtPainter::drawRect(painter, rect);
+                break;
+            default:
+                break;
+        }
+    }
+    else if ( selectionFlags() & PolygonSelection )
+    {
+        if ( rubberBand() == PolygonRubberBand )
+            painter->drawPolyline(pa);
+    }
+}
+
+/*!
+   Draw the tracker
+
+   \param painter Painter
+   \sa trackerRect(), trackerText()
+*/
+
+void QwtPicker::drawTracker(QPainter *painter) const
+{
+    const QRect textRect = trackerRect(painter);
+    if ( !textRect.isEmpty() )
+    {
+        QwtText label = trackerText(d_data->labelPosition);
+        if ( !label.isEmpty() )
+            label.draw(painter, textRect);
+    }
+}
+
+QRect QwtPicker::trackerRect(QPainter *painter) const
+{
+    if ( trackerMode() == AlwaysOff || 
+        (trackerMode() == ActiveOnly && !isActive() ) )
+    {
+        return QRect();
+    }
+
+    if ( d_data->labelPosition.x() < 0 || d_data->labelPosition.y() < 0 )
+        return QRect();
+
+    QwtText text = trackerText(d_data->labelPosition);
+    if ( text.isEmpty() )
+        return QRect();
+
+    QRect textRect(QPoint(0, 0), text.textSize(painter->font()));
+
+    const QPoint &pos = d_data->labelPosition;
+
+    int alignment = 0;
+    if ( isActive() && d_data->selection.count() > 1 
+        && rubberBand() != NoRubberBand )
+    {
+        const QPoint last = 
+            d_data->selection[int(d_data->selection.count()) - 2];
+
+        alignment |= (pos.x() >= last.x()) ? Qt::AlignRight : Qt::AlignLeft;
+        alignment |= (pos.y() > last.y()) ? Qt::AlignBottom : Qt::AlignTop;
+    }
+    else
+        alignment = Qt::AlignTop | Qt::AlignRight;
+
+    const int margin = 5;
+
+    int x = pos.x();
+    if ( alignment & Qt::AlignLeft )
+        x -= textRect.width() + margin;
+    else if ( alignment & Qt::AlignRight )
+        x += margin;
+
+    int y = pos.y();
+    if ( alignment & Qt::AlignBottom )
+        y += margin;
+    else if ( alignment & Qt::AlignTop )
+        y -= textRect.height() + margin;
+    
+    textRect.moveTopLeft(QPoint(x, y));
+
+    int right = qwtMin(textRect.right(), pickRect().right() - margin);
+    int bottom = qwtMin(textRect.bottom(), pickRect().bottom() - margin);
+    textRect.moveBottomRight(QPoint(right, bottom));
+
+    int left = qwtMax(textRect.left(), pickRect().left() + margin);
+    int top = qwtMax(textRect.top(), pickRect().top() + margin);
+    textRect.moveTopLeft(QPoint(left, top));
+
+    return textRect;
+}
+
+/*!
+  \brief Event filter
+
+  When isEnabled() == true all events of the observed widget are filtered.
+  Mouse and keyboard events are translated into widgetMouse- and widgetKey-
+  and widgetWheel-events. Paint and Resize events are handled to keep 
+  rubberband and tracker up to date.
+
+  \sa event(), widgetMousePressEvent(), widgetMouseReleaseEvent(),
+      widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(),
+      widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
+*/
+bool QwtPicker::eventFilter(QObject *o, QEvent *e)
+{
+    if ( o && o == parentWidget() )
+    {
+        switch(e->type())
+        {
+            case QEvent::Resize:
+            {
+                const QResizeEvent *re = (QResizeEvent *)e;
+                if ( d_data->resizeMode == Stretch )
+                    stretchSelection(re->oldSize(), re->size());
+
+                if ( d_data->rubberBandWidget )
+                    d_data->rubberBandWidget->resize(re->size());
+             
+                if ( d_data->textLabelWidget )
+                    d_data->textLabelWidget->resize(re->size());
+                break;
+            }
+            case QEvent::MouseButtonPress:
+                widgetMousePressEvent((QMouseEvent *)e);
+                break;
+            case QEvent::MouseButtonRelease:
+                widgetMouseReleaseEvent((QMouseEvent *)e);
+                break;
+            case QEvent::MouseButtonDblClick:
+                widgetMouseDoubleClickEvent((QMouseEvent *)e);
+                break;
+            case QEvent::MouseMove:
+                widgetMouseMoveEvent((QMouseEvent *)e);
+                break;
+            case QEvent::KeyPress:
+                widgetKeyPressEvent((QKeyEvent *)e);
+                break;
+            case QEvent::KeyRelease:
+                widgetKeyReleaseEvent((QKeyEvent *)e);
+                break;
+            case QEvent::Wheel:
+                widgetWheelEvent((QWheelEvent *)e);
+                break;
+            default:
+                break;
+        }
+    }
+    return false;
+}
+
+/*!
+  Handle a mouse press event for the observed widget.
+
+  Begin and/or end a selection depending on the selection flags.
+
+  \sa QwtPicker, selectionFlags()
+  \sa eventFilter(), widgetMouseReleaseEvent(),
+      widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(),
+      widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
+*/
+void QwtPicker::widgetMousePressEvent(QMouseEvent *e)
+{
+    transition(e);
+}
+
+/*!
+  Handle a mouse move event for the observed widget.
+
+  Move the last point of the selection in case of isActive() == true
+
+  \sa eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(),
+      widgetMouseDoubleClickEvent(),
+      widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
+*/
+void QwtPicker::widgetMouseMoveEvent(QMouseEvent *e)
+{
+    if ( pickRect().contains(e->pos()) )
+        d_data->labelPosition = e->pos();
+    else
+        d_data->labelPosition = QPoint(-1, -1);
+
+    if ( !isActive() )
+        updateDisplay();
+
+    transition(e);
+}
+
+/*!
+  Handle a mouse relase event for the observed widget.
+
+  End a selection depending on the selection flags.
+
+  \sa QwtPicker, selectionFlags()
+  \sa eventFilter(), widgetMousePressEvent(), 
+      widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(),
+      widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
+*/
+void QwtPicker::widgetMouseReleaseEvent(QMouseEvent *e)
+{
+    transition(e);
+}
+
+/*!
+  Handle mouse double click event for the observed widget.
+
+  Empty implementation, does nothing.
+
+  \sa eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(),
+      widgetMouseMoveEvent(),
+      widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
+*/
+void QwtPicker::widgetMouseDoubleClickEvent(QMouseEvent *me)
+{
+    transition(me);
+}
+    
+
+/*!
+  Handle a wheel event for the observed widget.
+
+  Move the last point of the selection in case of isActive() == true
+
+  \sa eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(),
+      widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(),
+      widgetKeyPressEvent(), widgetKeyReleaseEvent()
+*/
+void QwtPicker::widgetWheelEvent(QWheelEvent *e)
+{
+    if ( pickRect().contains(e->pos()) )
+        d_data->labelPosition = e->pos();
+    else
+        d_data->labelPosition = QPoint(-1, -1);
+
+    updateDisplay();
+
+    transition(e);
+}
+
+/*!
+  Handle a key press event for the observed widget.
+
+  Selections can be completely done by the keyboard. The arrow keys
+  move the cursor, the abort key aborts a selection. All other keys
+  are handled by the current state machine.
+
+  \sa QwtPicker, selectionFlags()
+  \sa eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(),
+      widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(),
+      widgetWheelEvent(), widgetKeyReleaseEvent(), stateMachine(),
+      QwtEventPattern::KeyPatternCode
+*/
+void QwtPicker::widgetKeyPressEvent(QKeyEvent *ke)
+{
+    int dx = 0;
+    int dy = 0;
+
+    int offset = 1;
+    if ( ke->isAutoRepeat() )
+        offset = 5;
+
+    if ( keyMatch(KeyLeft, ke) )
+        dx = -offset;
+    else if ( keyMatch(KeyRight, ke) )
+        dx = offset;
+    else if ( keyMatch(KeyUp, ke) )
+        dy = -offset;
+    else if ( keyMatch(KeyDown, ke) )
+        dy = offset;
+    else if ( keyMatch(KeyAbort, ke) )
+    {
+        if ( d_data->stateMachine )
+            d_data->stateMachine->reset();
+
+        if (isActive())
+            end(false);
+    }
+    else
+        transition(ke);
+
+    if ( dx != 0 || dy != 0 )
+    {
+        const QRect rect = pickRect();
+        const QPoint pos = parentWidget()->mapFromGlobal(QCursor::pos());
+
+        int x = pos.x() + dx;
+        x = qwtMax(rect.left(), x);
+        x = qwtMin(rect.right(), x);
+
+        int y = pos.y() + dy;
+        y = qwtMax(rect.top(), y);
+        y = qwtMin(rect.bottom(), y);
+
+        QCursor::setPos(parentWidget()->mapToGlobal(QPoint(x, y)));
+    }
+}
+ 
+/*!
+  Handle a key release event for the observed widget.
+
+  Passes the event to the state machine.
+
+  \sa eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(),
+      widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(),
+      widgetWheelEvent(), widgetKeyPressEvent(), stateMachine()
+*/
+void QwtPicker::widgetKeyReleaseEvent(QKeyEvent *ke)
+{
+    transition(ke);
+}
+
+/*!
+  Passes an event to the state machine and executes the resulting 
+  commands. Append and Move commands use the current position
+  of the cursor (QCursor::pos()).
+
+  \param e Event
+*/
+void QwtPicker::transition(const QEvent *e)
+{
+    if ( !d_data->stateMachine )
+        return;
+
+    QwtPickerMachine::CommandList commandList =
+        d_data->stateMachine->transition(*this, e);
+
+    QPoint pos;
+    switch(e->type())
+    {
+        case QEvent::MouseButtonDblClick:
+        case QEvent::MouseButtonPress:
+        case QEvent::MouseButtonRelease:
+        case QEvent::MouseMove:
+        {
+            const QMouseEvent *me = (QMouseEvent *)e;
+            pos = me->pos();
+            break;
+        }
+        default:
+            pos = parentWidget()->mapFromGlobal(QCursor::pos());
+    }
+
+    for ( uint i = 0; i < (uint)commandList.count(); i++ )
+    {
+        switch(commandList[i])
+        {
+            case QwtPickerMachine::Begin:
+            {
+                begin();
+                break;
+            }
+            case QwtPickerMachine::Append:
+            {
+                append(pos);
+                break;
+            }
+            case QwtPickerMachine::Move:
+            {
+                move(pos);
+                break;
+            }
+            case QwtPickerMachine::End:
+            {
+                end();
+                break;
+            }
+        }
+    }
+}
+
+/*!
+  Open a selection setting the state to active
+
+  \sa isActive, end(), append(), move()
+*/
+void QwtPicker::begin()
+{
+    if ( d_data->isActive )
+        return;
+
+    d_data->selection.resize(0);
+    d_data->isActive = true;
+
+    if ( trackerMode() != AlwaysOff )
+    {
+        if ( d_data->labelPosition.x() < 0 || d_data->labelPosition.y() < 0 ) 
+        {
+            QWidget *w = parentWidget();
+            if ( w )
+                d_data->labelPosition = w->mapFromGlobal(QCursor::pos());
+        }
+    }
+
+    updateDisplay();
+    setMouseTracking(true);
+}
+
+/*!
+  \brief Close a selection setting the state to inactive.
+
+  The selection is validated and maybe fixed by QwtPicker::accept().
+
+  \param ok If true, complete the selection and emit a selected signal
+            otherwise discard the selection.
+  \return true if the selection is accepted, false otherwise
+  \sa isActive, begin(), append(), move(), selected(), accept()
+*/
+bool QwtPicker::end(bool ok)
+{
+    if ( d_data->isActive )
+    {
+        setMouseTracking(false);
+
+        d_data->isActive = false;
+
+        if ( trackerMode() == ActiveOnly )
+            d_data->labelPosition = QPoint(-1, -1);
+
+        if ( ok )
+            ok = accept(d_data->selection);
+
+        if ( ok )
+            emit selected(d_data->selection);
+        else
+            d_data->selection.resize(0);
+
+        updateDisplay();
+    }
+    else
+        ok = false;
+
+    return ok;
+}
+
+/*!
+  Append a point to the selection and update rubberband and tracker.
+  The appended() signal is emitted.
+
+  \param pos Additional point
+
+  \sa isActive, begin(), end(), move(), appended()
+*/
+void QwtPicker::append(const QPoint &pos)
+{
+    if ( d_data->isActive )
+    {
+        const int idx = d_data->selection.count();
+        d_data->selection.resize(idx + 1);
+        d_data->selection[idx] = pos;
+
+        updateDisplay();
+
+        emit appended(pos);
+    }
+}
+
+/*!
+  Move the last point of the selection
+  The moved() signal is emitted.
+
+  \param pos New position
+  \sa isActive, begin(), end(), append()
+
+*/
+void QwtPicker::move(const QPoint &pos)
+{
+    if ( d_data->isActive )
+    {
+        const int idx = d_data->selection.count() - 1;
+        if ( idx >= 0 )
+        {
+            if ( d_data->selection[idx] != pos )
+            {
+                d_data->selection[idx] = pos;
+
+                updateDisplay();
+
+                emit moved(pos);
+            }
+        }
+    }
+}
+
+bool QwtPicker::accept(SelectedPoints &) const
+{
+    return true;
+}
+
+/*!
+  A picker is active between begin() and end().
+  \return true if the selection is active.
+*/
+bool QwtPicker::isActive() const 
+{
+    return d_data->isActive;
+}
+
+//!  Return Selected points
+const QwtPicker::SelectedPoints &QwtPicker::selection() const
+{
+    return d_data->selection;
+}
+
+/*!
+  Scale the selection by the ratios of oldSize and newSize
+  The changed() signal is emitted.
+
+  \param oldSize Previous size
+  \param newSize Current size
+
+  \sa ResizeMode, setResizeMode(), resizeMode()
+*/
+void QwtPicker::stretchSelection(const QSize &oldSize, const QSize &newSize)
+{
+    const double xRatio =
+        double(newSize.width()) / double(oldSize.width());
+    const double yRatio =
+        double(newSize.height()) / double(oldSize.height());
+
+    for ( int i = 0; i < int(d_data->selection.count()); i++ )
+    {
+        QPoint &p = d_data->selection[i];
+        p.setX(qRound(p.x() * xRatio));
+        p.setY(qRound(p.y() * yRatio));
+
+        emit changed(d_data->selection);
+    }
+}
+
+/*!
+  Set mouse tracking for the observed widget.
+
+  In case of enable is true, the previous value
+  is saved, that is restored when enable is false.
+
+  \warning Even when enable is false, mouse tracking might be restored
+           to true. When mouseTracking for the observed widget
+           has been changed directly by QWidget::setMouseTracking
+           while mouse tracking has been set to true, this value can�t
+           be restored.
+*/
+
+void QwtPicker::setMouseTracking(bool enable)
+{
+    QWidget *widget = parentWidget();
+    if ( !widget )
+        return;
+
+    if ( enable )
+    {
+        d_data->mouseTracking = widget->hasMouseTracking();
+        widget->setMouseTracking(true);
+    }
+    else
+    {
+        widget->setMouseTracking(d_data->mouseTracking);
+    }
+}
+
+/*!
+  Find the area of the observed widget, where selection might happen.
+
+  \return QFrame::contentsRect() if it is a QFrame, QWidget::rect() otherwise.
+*/
+QRect QwtPicker::pickRect() const
+{
+    QRect rect;
+
+    const QWidget *widget = parentWidget();
+    if ( !widget )
+        return rect;
+
+    if ( widget->inherits("QFrame") )
+        rect = ((QFrame *)widget)->contentsRect();
+    else
+        rect = widget->rect();
+
+    return rect;
+}
+
+void QwtPicker::updateDisplay()
+{
+    QWidget *w = parentWidget();
+
+    bool showRubberband = false;
+    bool showTracker = false;
+    if ( w && w->isVisible() && d_data->enabled )
+    {
+        if ( rubberBand() != NoRubberBand && isActive() &&
+            rubberBandPen().style() != Qt::NoPen )
+        {
+            showRubberband = true;
+        }
+
+        if ( trackerMode() == AlwaysOn ||
+            (trackerMode() == ActiveOnly && isActive() ) )
+        {
+            if ( trackerPen() != Qt::NoPen )
+                showTracker = true;
+        }
+    }
+
+#if QT_VERSION < 0x040000
+    QGuardedPtr<PrivateData::PickerWidget> &rw = d_data->rubberBandWidget;
+#else
+    QPointer<PrivateData::PickerWidget> &rw = d_data->rubberBandWidget;
+#endif
+    if ( showRubberband )
+    {
+        if ( rw.isNull() )
+        {
+            rw = new PrivateData::PickerWidget(
+                this, w, PrivateData::PickerWidget::RubberBand);
+            rw->resize(w->size());
+        }
+        rw->updateMask();
+    }
+    else
+        delete rw;
+
+#if QT_VERSION < 0x040000
+    QGuardedPtr<PrivateData::PickerWidget> &tw = d_data->textLabelWidget;
+#else
+    QPointer<PrivateData::PickerWidget> &tw = d_data->textLabelWidget;
+#endif
+    if ( showTracker )
+    {
+        if ( tw.isNull() )
+        {
+            tw = new PrivateData::PickerWidget(
+                this, w, PrivateData::PickerWidget::Text);
+            tw->resize(w->size());
+        }
+        tw->updateMask();
+    }
+    else
+        delete tw;
+}
diff --git a/src/qwt/qwt_picker_machine.cpp b/src/qwt/qwt_picker_machine.cpp
new file mode 100644
index 0000000..301e295
--- /dev/null
+++ b/src/qwt/qwt_picker_machine.cpp
@@ -0,0 +1,371 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qevent.h>
+#include "qwt_event_pattern.h"
+#include "qwt_picker_machine.h"
+
+//! Constructor
+QwtPickerMachine::QwtPickerMachine():
+    d_state(0)
+{
+}
+
+//! Destructor
+QwtPickerMachine::~QwtPickerMachine()
+{
+}
+
+//! Return the current state
+int QwtPickerMachine::state() const
+{
+    return d_state;
+}
+
+//! Change the current state
+void QwtPickerMachine::setState(int state)
+{
+    d_state = state;
+}
+
+//! Set the current state to 0.
+void QwtPickerMachine::reset() 
+{
+    setState(0);
+}
+
+//! Transition
+QwtPickerMachine::CommandList QwtPickerClickPointMachine::transition(
+    const QwtEventPattern &eventPattern, const QEvent *e)
+{   
+    QwtPickerMachine::CommandList cmdList;
+
+    switch(e->type())
+    {
+        case QEvent::MouseButtonPress:
+        {
+            if ( eventPattern.mouseMatch(
+                QwtEventPattern::MouseSelect1, (const QMouseEvent *)e) )
+            {
+                cmdList += Begin;
+                cmdList += Append;
+                cmdList += End;
+            }
+            break;
+        }
+        case QEvent::KeyPress:
+        {   
+            if ( eventPattern.keyMatch(
+                QwtEventPattern::KeySelect1, (const QKeyEvent *)e) )
+            {
+                cmdList += Begin;
+                cmdList += Append;
+                cmdList += End;
+            }   
+            break;
+        }
+        default:
+            break;
+    }
+
+    return cmdList;
+}
+
+//! Transition
+QwtPickerMachine::CommandList QwtPickerDragPointMachine::transition(
+    const QwtEventPattern &eventPattern, const QEvent *e)
+{   
+    QwtPickerMachine::CommandList cmdList;
+
+    switch(e->type())
+    {
+        case QEvent::MouseButtonPress:
+        {
+            if ( eventPattern.mouseMatch(
+                QwtEventPattern::MouseSelect1, (const QMouseEvent *)e) )
+            {
+                if ( state() == 0 )
+                {
+                    cmdList += Begin;
+                    cmdList += Append;
+                    setState(1);
+                }
+            }
+            break;
+        }
+        case QEvent::MouseMove:
+        case QEvent::Wheel:
+        {
+            if ( state() != 0 )
+                cmdList += Move;
+            break;
+        }
+        case QEvent::MouseButtonRelease:
+        {
+            if ( state() != 0 )
+            {
+                cmdList += End;
+                setState(0);
+            }
+            break;
+        }
+        case QEvent::KeyPress:
+        {
+            if ( eventPattern.keyMatch(
+                QwtEventPattern::KeySelect1, (const QKeyEvent *)e) )
+            {
+                if ( state() == 0 )
+                {
+                    cmdList += Begin;
+                    cmdList += Append;
+                    setState(1);
+                }
+                else
+                {
+                    cmdList += End;
+                    setState(0);
+                }
+            }
+            break;
+        }
+        default:
+            break;
+    }
+
+    return cmdList;
+}
+
+//! Transition
+QwtPickerMachine::CommandList QwtPickerClickRectMachine::transition(
+    const QwtEventPattern &eventPattern, const QEvent *e)
+{   
+    QwtPickerMachine::CommandList cmdList;
+
+    switch(e->type())
+    {
+        case QEvent::MouseButtonPress:
+        {
+            if ( eventPattern.mouseMatch(
+                QwtEventPattern::MouseSelect1, (const QMouseEvent *)e) )
+            {
+                switch(state())
+                {
+                    case 0:
+                    {   
+                        cmdList += Begin;
+                        cmdList += Append;
+                        setState(1);
+                        break;
+                    }
+                    case 1:
+                    {
+                        // Uh, strange we missed the MouseButtonRelease
+                        break; 
+                    }
+                    default:
+                    {
+                        cmdList += End;
+                        setState(0);
+                    }
+                }
+            }
+        }
+        case QEvent::MouseMove:
+        case QEvent::Wheel:
+        {
+            if ( state() != 0 )
+                cmdList += Move;
+            break;
+        }
+        case QEvent::MouseButtonRelease:
+        {
+            if ( eventPattern.mouseMatch(
+                QwtEventPattern::MouseSelect1, (const QMouseEvent *)e) )
+            {
+                if ( state() == 1 )
+                {
+                    cmdList += Append;
+                    setState(2);
+                }
+            }
+            break;
+        }
+        case QEvent::KeyPress:
+        {   
+            if ( eventPattern.keyMatch(
+                QwtEventPattern::KeySelect1, (const QKeyEvent *)e) )
+            {
+                if ( state() == 0 )
+                {
+                    cmdList += Begin;
+                    cmdList += Append;
+                    setState(1);
+                }
+                else
+                {
+                    if ( state() == 1 )
+                    {
+                        cmdList += Append;
+                        setState(2);
+                    }
+                    else if ( state() == 2 )
+                    {
+                        cmdList += End;
+                        setState(0);
+                    }
+                }
+            }   
+            break;
+        }
+        default:
+            break;
+    }
+
+    return cmdList;
+}
+
+//! Transition
+QwtPickerMachine::CommandList QwtPickerDragRectMachine::transition(
+    const QwtEventPattern &eventPattern, const QEvent *e)
+{   
+    QwtPickerMachine::CommandList cmdList;
+
+    switch(e->type())
+    {
+        case QEvent::MouseButtonPress:
+        {
+            if ( eventPattern.mouseMatch(
+                QwtEventPattern::MouseSelect1, (const QMouseEvent *)e) )
+            {
+                if ( state() == 0 )
+                {
+                    cmdList += Begin;
+                    cmdList += Append;
+                    cmdList += Append;
+                    setState(2);
+                }
+            }
+            break;
+        }
+        case QEvent::MouseMove:
+        case QEvent::Wheel:
+        {
+            if ( state() != 0 )
+                cmdList += Move;
+            break;
+        }
+        case QEvent::MouseButtonRelease:
+        {
+            if ( state() == 2 )
+            {
+                cmdList += End;
+                setState(0);
+            }
+            break;
+        }
+        case QEvent::KeyPress:
+        {
+            if ( eventPattern.keyMatch(
+                QwtEventPattern::KeySelect1, (const QKeyEvent *)e) )
+            {
+                if ( state() == 0 )
+                {
+                    cmdList += Begin;
+                    cmdList += Append;
+                    cmdList += Append;
+                    setState(2);
+                }
+                else
+                {
+                    cmdList += End;
+                    setState(0);
+                }
+            }
+            break;
+        }
+        default:
+            break;
+    }
+
+    return cmdList;
+}
+
+//! Transition
+QwtPickerMachine::CommandList QwtPickerPolygonMachine::transition(
+    const QwtEventPattern &eventPattern, const QEvent *e)
+{
+    QwtPickerMachine::CommandList cmdList;
+
+    switch(e->type())
+    {
+        case QEvent::MouseButtonPress:
+        {
+            if ( eventPattern.mouseMatch(
+                QwtEventPattern::MouseSelect1, (const QMouseEvent *)e) )
+            {
+                if (state() == 0)
+                {
+                    cmdList += Begin;
+                    cmdList += Append;
+                    cmdList += Append;
+                    setState(1);
+                }
+                else
+                {
+                    cmdList += End;
+                    setState(0);
+                }
+            }
+            if ( eventPattern.mouseMatch(
+                QwtEventPattern::MouseSelect2, (const QMouseEvent *)e) )
+            {
+                if (state() == 1)
+                    cmdList += Append;
+            }
+            break;
+        }
+        case QEvent::MouseMove:
+        case QEvent::Wheel:
+        {
+            if ( state() != 0 )
+                cmdList += Move;
+            break;
+        }
+        case QEvent::KeyPress:
+        {
+            if ( eventPattern.keyMatch(
+                QwtEventPattern::KeySelect1, (const QKeyEvent *)e) )
+            {
+                if ( state() == 0 )
+                {
+                    cmdList += Begin;
+                    cmdList += Append;
+                    cmdList += Append;
+                    setState(1);
+                }
+                else
+                {
+                    cmdList += End;
+                    setState(0);
+                }
+            }
+            else if ( eventPattern.keyMatch(
+                QwtEventPattern::KeySelect2, (const QKeyEvent *)e) )
+            {
+                if ( state() == 1 )
+                    cmdList += Append;
+            }
+            break;
+        }
+        default:
+            break;
+    }
+
+    return cmdList;
+}
diff --git a/src/qwt/qwt_plot.cpp b/src/qwt/qwt_plot.cpp
new file mode 100644
index 0000000..428dd83
--- /dev/null
+++ b/src/qwt/qwt_plot.cpp
@@ -0,0 +1,839 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qpainter.h>
+#if QT_VERSION < 0x040000
+#include <qfocusdata.h>
+#else
+#include <qpaintengine.h>
+#endif
+#include <qapplication.h>
+#include <qevent.h>
+#include "qwt_plot.h"
+#include "qwt_plot_dict.h"
+#include "qwt_plot_layout.h"
+#include "qwt_rect.h"
+#include "qwt_scale_widget.h"
+#include "qwt_scale_engine.h"
+#include "qwt_text_label.h"
+#include "qwt_legend.h"
+#include "qwt_dyngrid_layout.h"
+#include "qwt_plot_canvas.h"
+#include "qwt_paint_buffer.h"
+
+class QwtPlot::PrivateData
+{
+public:
+    QwtTextLabel *lblTitle;
+    QwtPlotCanvas *canvas;
+    QwtLegend *legend;
+    QwtPlotLayout *layout;
+
+    bool autoReplot;
+};
+
+/*!
+  \brief Constructor
+  \param parent Parent widget
+ */
+
+QwtPlot::QwtPlot(QWidget *parent):
+    QFrame(parent)
+{
+    initPlot(QwtText());
+}
+
+
+/*!
+  \brief Constructor
+  \param title Title text
+  \param parent Parent widget
+ */
+QwtPlot::QwtPlot(const QwtText &title, QWidget *parent) :
+    QFrame(parent)
+{
+    initPlot(title);
+}
+
+//! Destructor
+QwtPlot::~QwtPlot()
+{
+    detachItems(QwtPlotItem::Rtti_PlotItem, autoDelete());
+
+    delete d_data->layout;
+    deleteAxesData();
+    delete d_data;
+}
+
+/*!
+  \brief Initializes a QwtPlot instance
+  \param title Title text
+ */
+void QwtPlot::initPlot(const QwtText &title)
+{
+    d_data = new PrivateData;
+
+#if QT_VERSION < 0x040000
+    setWFlags(Qt::WNoAutoErase);
+#endif 
+
+    d_data->layout = new QwtPlotLayout;
+
+    d_data->autoReplot = false;
+
+    d_data->lblTitle = new QwtTextLabel(title, this);
+    d_data->lblTitle->setFont(QFont(fontInfo().family(), 14, QFont::Bold));
+
+    QwtText text(title);
+    int flags = Qt::AlignCenter;
+#if QT_VERSION < 0x040000
+    flags |= Qt::WordBreak | Qt::ExpandTabs;
+#else
+    flags |= Qt::TextWordWrap;
+#endif
+    text.setFlags(flags);
+    d_data->lblTitle->setText(text);
+
+    d_data->legend = NULL;
+
+    initAxesData();
+
+    d_data->canvas = new QwtPlotCanvas(this);
+    d_data->canvas->setFrameStyle(QFrame::Panel|QFrame::Sunken);
+    d_data->canvas->setLineWidth(2);
+    d_data->canvas->setMidLineWidth(0);
+
+    updateTabOrder();
+
+    setSizePolicy(QSizePolicy::MinimumExpanding, 
+        QSizePolicy::MinimumExpanding);
+}
+
+/*!
+  \brief Adds handling of layout requests
+*/
+bool QwtPlot::event(QEvent *e)
+{
+    bool ok = QFrame::event(e);
+    switch(e->type())
+    {
+#if QT_VERSION < 0x040000
+        case QEvent::LayoutHint:
+#else
+        case QEvent::LayoutRequest:
+#endif
+            updateLayout();
+            break;
+#if QT_VERSION >= 0x040000
+        case QEvent::PolishRequest:
+            polish();
+            break;
+#endif
+        default:;
+    }
+    return ok;
+}
+
+/*!
+  \brief Replots the plot if QwtPlot::autoReplot() is \c true.
+*/
+
+void QwtPlot::autoRefresh()
+{
+    if (d_data->autoReplot)
+        replot();
+}
+
+/*!
+  \brief Set or reset the autoReplot option
+  If the autoReplot option is set, the plot will be
+  updated implicitly by manipulating member functions.
+  Since this may be time-consuming, it is recommended
+  to leave this option switched off and call replot()
+  explicitly if necessary.
+
+  The autoReplot option is set to false by default, which
+  means that the user has to call replot() in order to make
+  changes visible.
+  \param tf \c true or \c false. Defaults to \c true.
+  \sa replot()
+*/
+void QwtPlot::setAutoReplot(bool tf)
+{
+    d_data->autoReplot = tf;
+}
+
+/*!
+    \return true if the autoReplot option is set.
+*/
+bool QwtPlot::autoReplot() const
+{
+    return d_data->autoReplot; 
+}
+
+/*!
+  \brief Change the plot's title
+  \param t new title
+*/
+void QwtPlot::setTitle(const QString &t)
+{
+    d_data->lblTitle->setText(t);
+}
+
+/*!
+  \brief Change the plot's title
+  \param t new title
+*/
+void QwtPlot::setTitle(const QwtText &t)
+{
+    d_data->lblTitle->setText(t);
+}
+
+/*!
+  \return the plot's title
+*/
+
+QwtText QwtPlot::title() const
+{
+    return d_data->lblTitle->text();
+}
+
+/*!
+  \return the plot's layout
+*/
+QwtPlotLayout *QwtPlot::plotLayout()
+{
+    return d_data->layout;
+}
+
+/*!
+  \return the plot's layout
+*/
+const QwtPlotLayout *QwtPlot::plotLayout() const
+{
+    return d_data->layout;
+}
+
+/*!
+  \return the plot's titel label.
+*/
+QwtTextLabel *QwtPlot::titleLabel()
+{
+    return d_data->lblTitle;
+}
+
+/*!
+  \return the plot's titel label.
+*/
+const QwtTextLabel *QwtPlot::titleLabel() const
+{
+    return d_data->lblTitle;
+}
+
+/*!
+  \return the plot's legend
+  \sa printLegendItem()
+*/
+QwtLegend *QwtPlot::legend()
+{ 
+    return d_data->legend;
+}   
+
+/*!
+  \return the plot's legend
+  \sa printLegendItem()
+*/
+const QwtLegend *QwtPlot::legend() const
+{ 
+    return d_data->legend;
+}   
+
+
+/*!
+  \return the plot's canvas
+*/
+QwtPlotCanvas *QwtPlot::canvas()
+{ 
+    return d_data->canvas;
+}   
+
+/*!
+  \return the plot's canvas
+*/
+const QwtPlotCanvas *QwtPlot::canvas() const
+{ 
+    return d_data->canvas;
+}
+
+void QwtPlot::polish()
+{
+    replot();
+
+#if QT_VERSION < 0x040000
+    QFrame::polish();
+#endif
+}
+
+/*!  
+  Return sizeHint
+  \sa QwtPlot::minimumSizeHint()
+*/
+
+QSize QwtPlot::sizeHint() const
+{
+    int dw = 0;
+    int dh = 0;
+    for ( int axisId = 0; axisId < axisCnt; axisId++ )
+    {
+        if ( axisEnabled(axisId) )
+        {   
+            const int niceDist = 40;
+            const QwtScaleWidget *scaleWidget = axisWidget(axisId);
+            const QwtScaleDiv &scaleDiv = scaleWidget->scaleDraw()->scaleDiv();
+            const int majCnt = scaleDiv.ticks(QwtScaleDiv::MajorTick).count();
+
+            if ( axisId == yLeft || axisId == yRight )
+            {
+                int hDiff = (majCnt - 1) * niceDist 
+                    - scaleWidget->minimumSizeHint().height();
+                if ( hDiff > dh )
+                    dh = hDiff;
+            }
+            else
+            {
+                int wDiff = (majCnt - 1) * niceDist 
+                    - scaleWidget->minimumSizeHint().width();
+                if ( wDiff > dw )
+                    dw = wDiff;
+            }
+        }
+    }
+    return minimumSizeHint() + QSize(dw, dh);
+}
+
+/*!
+  \brief Return a minimum size hint
+*/
+QSize QwtPlot::minimumSizeHint() const
+{
+    QSize hint = d_data->layout->minimumSizeHint(this);
+    hint += QSize(2 * frameWidth(), 2 * frameWidth());
+
+    return hint;
+}
+
+//! Resize and update internal layout
+void QwtPlot::resizeEvent(QResizeEvent *e)
+{
+    QFrame::resizeEvent(e);
+    updateLayout();
+}
+
+/*!
+  \brief Redraw the plot
+
+  If the autoReplot option is not set (which is the default)
+  or if any curves are attached to raw data, the plot has to
+  be refreshed explicitly in order to make changes visible.
+
+  \sa setAutoReplot()
+  \warning Calls canvas()->repaint, take care of infinite recursions
+*/
+void QwtPlot::replot()
+{
+    bool doAutoReplot = autoReplot();
+    setAutoReplot(false);
+
+    updateAxes();
+
+    /*
+      Maybe the layout needs to be updated, because of changed
+      axes labels. We need to process them here before painting
+      to avoid that scales and canvas get out of sync.
+     */
+#if QT_VERSION >= 0x040000
+    QApplication::sendPostedEvents(this, QEvent::LayoutRequest);
+#else
+    QApplication::sendPostedEvents(this, QEvent::LayoutHint);
+#endif
+
+    QwtPlotCanvas &canvas = *d_data->canvas;
+
+    canvas.invalidatePaintCache();
+
+    /*
+      In case of cached or packed painting the canvas
+      is repainted completely and doesn't need to be erased.
+     */
+    const bool erase = 
+        !canvas.testPaintAttribute(QwtPlotCanvas::PaintPacked) 
+        && !canvas.testPaintAttribute(QwtPlotCanvas::PaintCached);
+
+#if QT_VERSION >= 0x040000
+    const bool noBackgroundMode = canvas.testAttribute(Qt::WA_NoBackground);
+    if ( !erase && !noBackgroundMode )
+        canvas.setAttribute(Qt::WA_NoBackground, true);
+
+    canvas.repaint(canvas.contentsRect());
+
+    if ( !erase && !noBackgroundMode )
+        canvas.setAttribute(Qt::WA_NoBackground, false);
+#else
+    canvas.repaint(canvas.contentsRect(), erase);
+#endif
+
+    setAutoReplot(doAutoReplot);
+}
+
+/*!
+  \brief Adjust plot content to its current size.
+  \sa QwtPlot::resizeEvent
+*/
+void QwtPlot::updateLayout()
+{
+    d_data->layout->activate(this, contentsRect());
+
+    //
+    // resize and show the visible widgets
+    //
+    if (!d_data->lblTitle->text().isEmpty())
+    {
+        d_data->lblTitle->setGeometry(d_data->layout->titleRect());
+        if (!d_data->lblTitle->isVisible())
+            d_data->lblTitle->show();
+    }
+    else
+        d_data->lblTitle->hide();
+
+    for (int axisId = 0; axisId < axisCnt; axisId++ )
+    {
+        if (axisEnabled(axisId) )
+        {
+            axisWidget(axisId)->setGeometry(d_data->layout->scaleRect(axisId));
+
+            if ( axisId == xBottom || axisId == xTop )
+            {
+                QRegion r(d_data->layout->scaleRect(axisId));
+                if ( axisEnabled(yLeft) )
+                    r = r.subtract(QRegion(d_data->layout->scaleRect(yLeft)));
+                if ( axisEnabled(yRight) )
+                    r = r.subtract(QRegion(d_data->layout->scaleRect(yRight)));
+                r.translate(-d_data->layout->scaleRect(axisId).x(), 
+                    -d_data->layout->scaleRect(axisId).y());
+
+                axisWidget(axisId)->setMask(r);
+            }
+            if (!axisWidget(axisId)->isVisible())
+                axisWidget(axisId)->show();
+        }
+        else
+            axisWidget(axisId)->hide();
+    }
+
+    if ( d_data->legend )
+    {
+        if (d_data->legend->itemCount() > 0)
+        {
+            d_data->legend->setGeometry(d_data->layout->legendRect());
+            d_data->legend->show();
+        }
+        else
+            d_data->legend->hide();
+    }
+
+    d_data->canvas->setGeometry(d_data->layout->canvasRect());
+}
+
+//! Update the focus tab order
+
+void QwtPlot::updateTabOrder()
+{
+#if QT_VERSION >= 0x040000
+    using namespace Qt; // QWidget::NoFocus/Qt::NoFocus
+#endif
+    if ( !legend() || legend()->legendItems().count() == 0
+        || d_data->canvas->focusPolicy() == NoFocus )
+    {
+        return;
+    }
+
+    // Depending on the position of the legend the 
+    // tab order will be changed that the canvas is
+    // next to the last legend item, or before
+    // the first one. 
+
+    const bool canvasFirst = 
+        d_data->layout->legendPosition() == QwtPlot::BottomLegend ||
+        d_data->layout->legendPosition() == QwtPlot::RightLegend;
+
+    QWidget *previous = NULL; 
+
+    QWidget *w;
+#if QT_VERSION >= 0x040000
+    while ( nextInFocusChain() != d_data->canvas );
+    while ( (w = nextInFocusChain()) != d_data->canvas )
+#else
+    if ( focusData() == NULL )
+        return;
+
+    while ( focusData()->next() != d_data->canvas );
+    while ( (w = focusData()->next()) != d_data->canvas )
+#endif
+    {
+        bool isLegendItem = false;
+        if ( w->focusPolicy() != NoFocus 
+            && w->parent() && w->parent() == d_data->legend->contentsWidget() )
+        {
+            isLegendItem = true;
+        }
+
+        if ( canvasFirst )
+        {
+            if ( isLegendItem )
+                break;
+
+            previous = w;
+        }
+        else
+        {
+            if ( isLegendItem )
+                previous = w;
+            else
+            {
+                if ( previous )
+                    break;
+            }
+        }
+    }
+
+    if ( previous && previous != d_data->canvas)
+        setTabOrder(previous, d_data->canvas);
+}
+
+/*! 
+  Redraw the canvas.
+  \param painter Painter used for drawing
+
+  \warning drawCanvas calls drawCanvasItems what is also used
+           for printing. Applications that like to add individual
+           plot items better overload QwtPlot::drawCanvasItems
+  \sa QwtPlot::drawCanvasItems
+*/
+
+void QwtPlot::drawCanvas(QPainter *painter)
+{
+    QwtArray<QwtScaleMap> maps(axisCnt);
+    for ( int axisId = 0; axisId < axisCnt; axisId++ )
+        maps[axisId] = canvasMap(axisId);
+
+    drawItems(painter, 
+        d_data->canvas->contentsRect(), maps, QwtPlotPrintFilter());
+}
+
+/*! 
+  Redraw the canvas items.
+  \param painter Painter used for drawing
+  \param rect Bounding rectangle where to paint
+  \param map QwtPlot::axisCnt maps, mapping between plot and paint device coordinates
+  \param pfilter Plot print filter
+*/
+
+void QwtPlot::drawItems(QPainter *painter, const QRect &rect, 
+        const QwtArray<QwtScaleMap> &map, 
+        const QwtPlotPrintFilter &pfilter) const
+{
+    painter->save();
+
+    const QwtPlotItemList& itmList = itemList();
+    for ( QwtPlotItemIterator it = itmList.begin();
+        it != itmList.end(); ++it )
+    {
+        QwtPlotItem *item = *it;
+        if ( item && item->isVisible() )
+        {
+            if ( !(pfilter.options() & QwtPlotPrintFilter::PrintGrid)
+                && item->rtti() == QwtPlotItem::Rtti_PlotGrid )
+            {
+                continue;
+            }
+
+#if QT_VERSION >= 0x040000
+            const QPaintEngine *pe = painter->device()->paintEngine();
+            if (pe->hasFeature(QPaintEngine::Antialiasing) )
+            {
+                painter->setRenderHint(QPainter::Antialiasing,
+                    item->testRenderHint(QwtPlotItem::RenderAntialiased) );
+            }
+#endif
+
+            item->draw(painter, 
+                map[item->xAxis()], map[item->yAxis()],
+                rect);
+        }
+    }
+
+    painter->restore();
+}
+
+/*!
+  \param axisId Axis
+  \return Map for the axis on the canvas. With this map pixel coordinates can
+          translated to plot coordinates and vice versa.
+  \sa QwtScaleMap, QwtPlot::transform, QwtPlot::invTransform
+  
+*/
+QwtScaleMap QwtPlot::canvasMap(int axisId) const
+{
+    QwtScaleMap map;
+    if ( !d_data->canvas )
+        return map;
+
+    map.setTransformation(axisScaleEngine(axisId)->transformation());
+
+    const QwtScaleDiv *sd = axisScaleDiv(axisId);
+    map.setScaleInterval(sd->lBound(), sd->hBound());
+
+    if ( axisEnabled(axisId) )
+    {
+        const QwtScaleWidget *s = axisWidget(axisId);
+        if ( axisId == yLeft || axisId == yRight )
+        {
+            int y = s->y() + s->startBorderDist() - d_data->canvas->y();
+            int h = s->height() - s->startBorderDist() - s->endBorderDist();
+            map.setPaintInterval(y + h - 1, y);
+        }
+        else
+        {
+            int x = s->x() + s->startBorderDist() - d_data->canvas->x();
+            int w = s->width() - s->startBorderDist() - s->endBorderDist();
+            map.setPaintInterval(x, x + w - 1);
+        }
+    }
+    else
+    {
+        const int margin = plotLayout()->canvasMargin(axisId);
+
+        const QRect &canvasRect = d_data->canvas->contentsRect();
+        if ( axisId == yLeft || axisId == yRight )
+        {
+            map.setPaintInterval(canvasRect.bottom() - margin, 
+                canvasRect.top() + margin);
+        }
+        else
+        {
+            map.setPaintInterval(canvasRect.left() + margin, 
+                canvasRect.right() - margin);
+        }
+    }
+    return map;
+}
+
+/*!
+  Change the margin of the plot. The margin is the space
+  around all components.
+
+  \param margin new margin
+  \sa QwtPlotLayout::setMargin(), QwtPlot::margin(), QwtPlot::plotLayout()
+*/
+void QwtPlot::setMargin(int margin)
+{
+    if ( margin < 0 )
+        margin = 0;
+
+    if ( margin != d_data->layout->margin() )
+    {
+        d_data->layout->setMargin(margin);
+        updateLayout();
+    }
+}
+
+/*!
+    \return margin
+    \sa QwtPlot::setMargin(), QwtPlotLayout::margin(), QwtPlot::plotLayout()
+*/
+int QwtPlot::margin() const
+{
+    return d_data->layout->margin();
+}
+
+/*!
+  \brief Change the background of the plotting area
+  
+  Sets c to QColorGroup::Background of all colorgroups of 
+  the palette of the canvas. Using canvas()->setPalette()
+  is a more powerful way to set these colors.
+  \param c new background color
+*/
+void QwtPlot::setCanvasBackground(const QColor &c)
+{
+    QPalette p = d_data->canvas->palette();
+
+    for ( int i = 0; i < QPalette::NColorGroups; i++ )
+    {
+#if QT_VERSION < 0x040000
+        p.setColor((QPalette::ColorGroup)i, QColorGroup::Background, c);
+#else
+        p.setColor((QPalette::ColorGroup)i, QPalette::Background, c);
+#endif
+    }
+
+    canvas()->setPalette(p);
+}
+
+/*!
+  Nothing else than: canvas()->palette().color(
+        QPalette::Normal, QColorGroup::Background);
+  
+  \return the background color of the plotting area.
+*/
+const QColor & QwtPlot::canvasBackground() const
+{
+#if QT_VERSION < 0x040000
+    return canvas()->palette().color(
+        QPalette::Normal, QColorGroup::Background);
+#else
+    return canvas()->palette().color(
+        QPalette::Normal, QPalette::Background);
+#endif
+}
+
+/*!
+  \brief Change the border width of the plotting area
+  Nothing else than canvas()->setLineWidth(w), 
+  left for compatibility only.
+  \param w new border width
+*/
+void QwtPlot::setCanvasLineWidth(int w)
+{
+    canvas()->setLineWidth(w);
+}
+ 
+/*! 
+  Nothing else than: canvas()->lineWidth(), 
+  left for compatibility only.
+  \return the border width of the plotting area
+*/
+int QwtPlot::canvasLineWidth() const
+{ 
+    return canvas()->lineWidth();
+}
+
+/*!
+  \return \c true if the specified axis exists, otherwise \c false
+  \param axisId axis index
+ */
+bool QwtPlot::axisValid(int axisId)
+{
+    return ((axisId >= QwtPlot::yLeft) && (axisId < QwtPlot::axisCnt));
+}
+
+/*!
+  Called internally when the legend has been clicked on.
+  Emits a legendClicked() signal.
+*/
+
+void QwtPlot::legendItemClicked()
+{
+    if ( d_data->legend && sender()->isWidgetType() )
+    {
+        QwtPlotItem *plotItem = d_data->legend->find((QWidget *)sender());
+        if ( plotItem )
+            emit legendClicked(plotItem);
+    }
+}
+
+void QwtPlot::legendItemChecked(bool on)
+{
+    if ( d_data->legend && sender()->isWidgetType() )
+    {
+        QwtPlotItem *plotItem = d_data->legend->find((QWidget *)sender());
+        if ( plotItem )
+            emit legendChecked(plotItem, on);
+    }
+}
+
+//! Remove all curves and markers
+void QwtPlot::clear()
+{
+    detachItems(QwtPlotItem::Rtti_PlotCurve);
+    detachItems(QwtPlotItem::Rtti_PlotMarker);
+}
+
+/*!
+  \brief Insert a legend
+
+  If the position legend is \c QwtPlot::LeftLegend or \c QwtPlot::RightLegend
+  the legend will be organized in one column from top to down. 
+  Otherwise the legend items will be placed be placed in a table 
+  with a best fit number of columns from left to right.
+
+  The plot widget will become parent of the legend. It
+  will be deleted when the plot is deleted, or another
+  legend is set with insertLegend().
+       
+  \param legend Legend
+  \param pos The legend's position. Valid values are \c QwtPlot::LeftLegend,
+           \c QwtPlot::RightLegend, \c QwtPlot::TopLegend, 
+           \c QwtPlot::BottomLegend.
+
+  \param ratio Ratio between legend and the bounding rect
+               of title, canvas and axes. The legend will be shrinked
+               if it would need more space than the given ratio.
+               The ratio is limited to ]0.0 .. 1.0]. In case of <= 0.0
+               it will be reset to the default ratio.
+               The default vertical/horizontal ratio is 0.33/0.5.
+
+  \sa QwtPlotLayout::legendPosition(), QwtPlotLayout::setLegendPosition()
+*/
+void QwtPlot::insertLegend(QwtLegend *legend, 
+    QwtPlot::LegendPosition pos, double ratio)
+{
+    d_data->layout->setLegendPosition(pos, ratio);
+
+    if ( legend != d_data->legend )
+    {
+        delete d_data->legend;
+        d_data->legend = legend;
+
+        if ( d_data->legend )
+        {
+            if ( d_data->legend->parent() != this )
+            {
+#if QT_VERSION < 0x040000
+                d_data->legend->reparent(this, QPoint(0, 0));
+#else
+                d_data->legend->setParent(this);
+#endif
+            }
+
+            const QwtPlotItemList& itmList = itemList();
+            for ( QwtPlotItemIterator it = itmList.begin();
+                it != itmList.end(); ++it )
+            {
+                (*it)->updateLegend(d_data->legend);
+            }
+
+            QLayout *l = d_data->legend->contentsWidget()->layout();
+            if ( l && l->inherits("QwtDynGridLayout") )
+            {
+                QwtDynGridLayout *tl = (QwtDynGridLayout *)l;
+                if ( d_data->layout->legendPosition() == QwtPlot::TopLegend ||
+                    d_data->layout->legendPosition() == QwtPlot::BottomLegend )
+                {
+                    tl->setMaxCols(0); // unlimited
+                }
+                else
+                    tl->setMaxCols(1); // 1 column: align vertical
+            }
+        }
+        updateTabOrder();
+    }
+
+    updateLayout();
+}
diff --git a/src/qwt/qwt_plot_axis.cpp b/src/qwt/qwt_plot_axis.cpp
new file mode 100644
index 0000000..c44c2ca
--- /dev/null
+++ b/src/qwt/qwt_plot_axis.cpp
@@ -0,0 +1,603 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_plot.h"
+#include "qwt_math.h"
+#include "qwt_scale_widget.h"
+#include "qwt_scale_div.h"
+#include "qwt_scale_engine.h"
+
+class QwtPlot::AxisData
+{
+public:
+    bool isEnabled;
+    bool doAutoScale;
+
+    double minValue;
+    double maxValue;
+    double stepSize;
+
+    int maxMajor;
+    int maxMinor;
+
+    QwtScaleDiv scaleDiv;
+    QwtScaleEngine *scaleEngine;
+    QwtScaleWidget *scaleWidget;
+};
+
+//! Initialize axes
+void QwtPlot::initAxesData()
+{
+    int axisId;
+
+    for( axisId = 0; axisId < axisCnt; axisId++)
+        d_axisData[axisId] = new AxisData;
+
+    d_axisData[yLeft]->scaleWidget = 
+        new QwtScaleWidget(QwtScaleDraw::LeftScale, this);
+    d_axisData[yRight]->scaleWidget = 
+        new QwtScaleWidget(QwtScaleDraw::RightScale, this);
+    d_axisData[xTop]->scaleWidget = 
+        new QwtScaleWidget(QwtScaleDraw::TopScale, this);
+    d_axisData[xBottom]->scaleWidget = 
+        new QwtScaleWidget(QwtScaleDraw::BottomScale, this);
+
+
+    QFont fscl(fontInfo().family(), 10);
+    QFont fttl(fontInfo().family(), 12, QFont::Bold);
+
+    for(axisId = 0; axisId < axisCnt; axisId++)
+    {
+        AxisData &d = *d_axisData[axisId];
+
+        d.scaleWidget->setFont(fscl);
+        d.scaleWidget->setBaselineDist(2);
+
+        QwtText text;
+        text.setFont(fttl);
+        d.scaleWidget->setTitle(text);
+
+        d.doAutoScale = true;
+
+        d.minValue = 0.0;
+        d.maxValue = 1000.0;
+        d.stepSize = 0.0;
+
+        d.maxMinor = 5;
+        d.maxMajor = 8;
+
+        d.scaleEngine = new QwtLinearScaleEngine;
+
+        d.scaleDiv.invalidate();
+    }
+
+    d_axisData[yLeft]->isEnabled = true;
+    d_axisData[yRight]->isEnabled = false;
+    d_axisData[xBottom]->isEnabled = true;
+    d_axisData[xTop]->isEnabled = false;
+}
+
+void QwtPlot::deleteAxesData()
+{
+    for( int axisId = 0; axisId < axisCnt; axisId++)
+    {
+        delete d_axisData[axisId]->scaleEngine;
+        delete d_axisData[axisId];
+        d_axisData[axisId] = NULL;
+    }
+}
+
+/*!
+  \return specified axis, or NULL if axisId is invalid.
+  \param axisId axis index
+*/
+const QwtScaleWidget *QwtPlot::axisWidget(int axisId) const
+{
+    if (axisValid(axisId))
+        return d_axisData[axisId]->scaleWidget;
+
+    return NULL;
+}
+
+/*!
+  \return specified axis, or NULL if axisId is invalid.
+  \param axisId axis index
+*/
+QwtScaleWidget *QwtPlot::axisWidget(int axisId)
+{
+    if (axisValid(axisId))
+        return d_axisData[axisId]->scaleWidget;
+
+    return NULL;
+}
+
+void QwtPlot::setAxisScaleEngine(int axisId, QwtScaleEngine *scaleEngine)
+{
+    if (axisValid(axisId) && scaleEngine != NULL )
+    {
+        AxisData &d = *d_axisData[axisId];
+
+        delete d.scaleEngine;
+        d.scaleEngine = scaleEngine;
+
+        d.scaleDiv.invalidate();
+
+        autoRefresh();
+    }
+}
+
+QwtScaleEngine *QwtPlot::axisScaleEngine(int axisId)
+{
+    if (axisValid(axisId))
+        return d_axisData[axisId]->scaleEngine;
+    else
+        return NULL;
+}
+
+const QwtScaleEngine *QwtPlot::axisScaleEngine(int axisId) const
+{
+    if (axisValid(axisId))
+        return d_axisData[axisId]->scaleEngine;
+    else
+        return NULL;
+}
+/*!
+  \return \c true if autoscaling is enabled
+  \param axisId axis index
+*/
+bool QwtPlot::axisAutoScale(int axisId) const
+{
+    if (axisValid(axisId))
+        return d_axisData[axisId]->doAutoScale;
+    else
+        return false;
+    
+}
+
+/*!
+  \return \c true if a specified axis is enabled
+  \param axisId axis index
+*/
+bool QwtPlot::axisEnabled(int axisId) const
+{
+    if (axisValid(axisId))
+        return d_axisData[axisId]->isEnabled;
+    else
+        return false;
+}
+
+/*!
+  \return the font of the scale labels for a specified axis
+  \param axisId axis index
+*/
+QFont QwtPlot::axisFont(int axisId) const
+{
+    if (axisValid(axisId))
+        return axisWidget(axisId)->font();
+    else
+        return QFont();
+    
+}
+
+/*!
+  \return the maximum number of major ticks for a specified axis
+  \param axisId axis index
+*/
+int QwtPlot::axisMaxMajor(int axisId) const
+{
+    if (axisValid(axisId))
+        return d_axisData[axisId]->maxMajor;
+    else
+        return 0;
+}
+
+/*!
+  \return the maximum number of minor ticks for a specified axis
+  \param axisId axis index
+*/
+int QwtPlot::axisMaxMinor(int axisId) const
+{
+    if (axisValid(axisId))
+        return d_axisData[axisId]->maxMinor;
+    else
+        return 0;
+}
+
+/*!
+  \returns the scale division of a specified axis
+  \param axisId axis index
+  \sa QwtScaleDiv
+*/
+const QwtScaleDiv *QwtPlot::axisScaleDiv(int axisId) const
+{
+    if (!axisValid(axisId))
+        return NULL;
+
+    return &d_axisData[axisId]->scaleDiv;
+}
+
+/*!
+  \returns the scale division of a specified axis
+  \param axisId axis index
+  \sa QwtScaleDiv
+*/
+QwtScaleDiv *QwtPlot::axisScaleDiv(int axisId) 
+{
+    if (!axisValid(axisId))
+        return NULL;
+
+    return &d_axisData[axisId]->scaleDiv;
+}
+
+/*!
+  \returns the scale draw of a specified axis
+  \param axisId axis index
+  \return specified scaleDraw for axis, or NULL if axis is invalid.
+  \sa QwtScaleDraw
+*/
+const QwtScaleDraw *QwtPlot::axisScaleDraw(int axisId) const
+{
+    if (!axisValid(axisId))
+        return NULL;
+
+    return axisWidget(axisId)->scaleDraw();
+}
+
+/*!
+  \returns the scale draw of a specified axis
+  \param axisId axis index
+  \return specified scaleDraw for axis, or NULL if axis is invalid.
+  \sa QwtScaleDraw
+*/
+QwtScaleDraw *QwtPlot::axisScaleDraw(int axisId) 
+{
+    if (!axisValid(axisId))
+        return NULL;
+
+    return axisWidget(axisId)->scaleDraw();
+}
+
+/*!
+  \return the title of a specified axis
+  \param axisId axis index
+*/
+QwtText QwtPlot::axisTitle(int axisId) const
+{
+    if (axisValid(axisId))
+        return axisWidget(axisId)->title();
+    else
+        return QwtText();
+}
+
+/*!
+  \brief Enable or disable a specified axis
+
+  When an axis is disabled, this only means that it is not
+  visible on the screen. Curves, markers and can be attached
+  to disabled axes, and transformation of screen coordinates
+  into values works as normal.
+
+  Only xBottom and yLeft are enabled by default.
+  \param axisId axis index
+  \param tf \c true (enabled) or \c false (disabled)
+*/
+void QwtPlot::enableAxis(int axisId, bool tf)
+{
+    if (axisValid(axisId) && tf != d_axisData[axisId]->isEnabled)
+    {
+        d_axisData[axisId]->isEnabled = tf;
+        updateLayout();
+    }
+}
+
+/*!
+  Transform the x or y coordinate of a position in the
+  drawing region into a value.
+  \param axisId axis index
+  \param pos position
+  \warning The position can be an x or a y coordinate,
+           depending on the specified axis.
+*/
+double QwtPlot::invTransform(int axisId, int pos) const
+{
+    if (axisValid(axisId))
+       return(canvasMap(axisId).invTransform(pos));
+    else
+       return 0.0;
+}
+
+
+/*!
+  \brief Transform a value into a coordinate in the plotting region
+  \param axisId axis index
+  \param value value
+  \return X or y coordinate in the plotting region corresponding
+          to the value.
+*/
+int QwtPlot::transform(int axisId, double value) const
+{
+    if (axisValid(axisId))
+       return(canvasMap(axisId).transform(value));
+    else
+       return 0;
+    
+}
+
+/*!
+  \brief Change the font of an axis
+  \param axisId axis index
+  \param f font
+  \warning This function changes the font of the tick labels,
+           not of the axis title.
+*/
+void QwtPlot::setAxisFont(int axisId, const QFont &f)
+{
+    if (axisValid(axisId))
+        axisWidget(axisId)->setFont(f);
+}
+
+/*!
+  \brief Enable autoscaling for a specified axis
+
+  This member function is used to switch back to autoscaling mode
+  after a fixed scale has been set. Autoscaling is enabled by default.
+
+  \param axisId axis index
+  \sa QwtPlot::setAxisScale(), QwtPlot::setAxisScaleDiv()
+*/
+void QwtPlot::setAxisAutoScale(int axisId)
+{
+    if (axisValid(axisId) && !d_axisData[axisId]->doAutoScale )
+    {
+        d_axisData[axisId]->doAutoScale = true;
+        autoRefresh();
+    }
+}
+
+/*!
+  \brief Disable autoscaling and specify a fixed scale for a selected axis.
+  \param axisId axis index
+  \param min
+  \param max minimum and maximum of the scale
+  \param stepSize Major step size. If <code>step == 0</code>, the step size is
+            calculated automatically using the maxMajor setting.
+  \sa QwtPlot::setAxisMaxMajor(), QwtPlot::setAxisAutoScale()
+*/
+void QwtPlot::setAxisScale(int axisId, double min, double max, double stepSize)
+{
+    if (axisValid(axisId))
+    {
+        AxisData &d = *d_axisData[axisId];
+
+        d.doAutoScale = false;
+        d.scaleDiv.invalidate();
+
+        d.minValue = min;
+        d.maxValue = max;
+        d.stepSize = stepSize;
+            
+        autoRefresh();
+    }
+}
+
+/*!
+  \brief Disable autoscaling and specify a fixed scale for a selected axis.
+  \param axisId axis index
+  \param scaleDiv Scale division
+  \sa QwtPlot::setAxisScale(), QwtPlot::setAxisAutoScale()
+*/
+void QwtPlot::setAxisScaleDiv(int axisId, const QwtScaleDiv &scaleDiv)
+{
+    if (axisValid(axisId))
+    {
+        AxisData &d = *d_axisData[axisId];
+
+        d.doAutoScale = false;
+        d.scaleDiv = scaleDiv;
+
+        autoRefresh();
+    }
+}
+
+/*!
+  \brief Set a scale draw
+  \param axisId axis index
+  \param scaleDraw object responsible for drawing scales.
+
+  By passing scaleDraw it is possible to extend QwtScaleDraw
+  functionality and let it take place in QwtPlot. Please note
+  that scaleDraw has to be created with new and will be deleted
+  by the corresponding QwtScale member ( like a child object ).
+
+  \sa QwtScaleDraw, QwtScale
+  \warning The attributes of scaleDraw will be overwritten by those of the  
+           previous QwtScaleDraw. 
+*/
+
+void QwtPlot::setAxisScaleDraw(int axisId, QwtScaleDraw *scaleDraw)
+{
+    if (axisValid(axisId))
+    {
+        axisWidget(axisId)->setScaleDraw(scaleDraw);
+        autoRefresh();
+    }
+}
+
+/*!
+  Change the alignment of the tick labels
+  \param axisId axis index
+  \param alignment Or'd Qt::AlignmentFlags <see qnamespace.h>
+  \sa QwtScaleDraw::setLabelAlignment()
+*/
+#if QT_VERSION < 0x040000
+void QwtPlot::setAxisLabelAlignment(int axisId, int alignment)
+#else
+void QwtPlot::setAxisLabelAlignment(int axisId, Qt::Alignment alignment)
+#endif
+{
+    if (axisValid(axisId))
+        axisWidget(axisId)->setLabelAlignment(alignment);
+}
+
+/*!
+  Rotate all tick labels
+  \param axisId axis index
+  \param rotation Angle in degrees. When changing the label rotation,
+                  the label alignment might be adjusted too.
+  \sa QwtScaleDraw::setLabelRotation(), QwtPlot::setAxisLabelAlignment
+*/
+void QwtPlot::setAxisLabelRotation(int axisId, double rotation)
+{
+    if (axisValid(axisId))
+        axisWidget(axisId)->setLabelRotation(rotation);
+}
+
+/*!
+  \brief Set the maximum number of minor scale intervals for a specified axis
+  \param axisId axis index
+  \param maxMinor maximum number of minor steps
+  \sa QwtAutoScale::setMaxMinor
+*/
+void QwtPlot::setAxisMaxMinor(int axisId, int maxMinor)
+{
+    if (axisValid(axisId))
+    {
+        if ( maxMinor < 0 )
+            maxMinor = 0;
+        if ( maxMinor > 100 )
+            maxMinor = 100;
+            
+        AxisData &d = *d_axisData[axisId];
+
+        if ( maxMinor != d.maxMinor )
+        {
+            d.maxMinor = maxMinor;
+            d.scaleDiv.invalidate();
+            autoRefresh();
+        }
+    }
+}
+
+/*!
+  \brief Set the maximum number of major scale intervals for a specified axis
+  \param axisId axis index
+  \param maxMajor maximum number of major steps
+  \sa QwtAutoScale::setMaxMajor
+*/
+void QwtPlot::setAxisMaxMajor(int axisId, int maxMajor)
+{
+    if (axisValid(axisId))
+    {
+        if ( maxMajor < 1 )
+            maxMajor = 1;
+        if ( maxMajor > 1000 )
+            maxMajor = 10000;
+            
+        AxisData &d = *d_axisData[axisId];
+        if ( maxMajor != d.maxMinor )
+        {
+            d.maxMajor = maxMajor;
+            d.scaleDiv.invalidate();
+            autoRefresh();
+        }
+    }
+}
+
+/*!
+  \brief Change the title of a specified axis
+  \param axisId axis index
+  \param title axis title
+*/
+void QwtPlot::setAxisTitle(int axisId, const QString &title)
+{
+    if (axisValid(axisId))
+        axisWidget(axisId)->setTitle(title);
+}
+
+/*!
+  \brief Change the title of a specified axis
+  \param axisId axis index
+  \param title axis title
+*/
+void QwtPlot::setAxisTitle(int axisId, const QwtText &title)
+{
+    if (axisValid(axisId))
+        axisWidget(axisId)->setTitle(title);
+}
+
+//! Rebuild the scales and maps
+void QwtPlot::updateAxes() 
+{
+    // Find bounding interval of the item data
+    // for all axes, where autoscaling is enabled
+    
+    QwtDoubleInterval intv[axisCnt];
+
+    const QwtPlotItemList& itmList = itemList();
+
+    QwtPlotItemIterator it;
+    for ( it = itmList.begin(); it != itmList.end(); ++it )
+    {
+        const QwtPlotItem *item = *it;
+
+        if ( !item->testItemAttribute(QwtPlotItem::AutoScale) )
+            continue;
+
+        if ( axisAutoScale(item->xAxis()) || axisAutoScale(item->yAxis()) )
+        {
+            const QwtDoubleRect rect = item->boundingRect();
+            intv[item->xAxis()] |= QwtDoubleInterval(rect.left(), rect.right());
+            intv[item->yAxis()] |= QwtDoubleInterval(rect.top(), rect.bottom());
+        }
+    }
+
+    // Adjust scales
+
+    for (int axisId = 0; axisId < axisCnt; axisId++)
+    {
+        AxisData &d = *d_axisData[axisId];
+
+        double minValue = d.minValue;
+        double maxValue = d.maxValue;
+        double stepSize = d.stepSize;
+
+        if ( d.doAutoScale && intv[axisId].isValid() )
+        {
+            d.scaleDiv.invalidate();
+
+            minValue = intv[axisId].minValue();
+            maxValue = intv[axisId].maxValue();
+
+            d.scaleEngine->autoScale(d.maxMajor, 
+                minValue, maxValue, stepSize);
+        }
+        if ( !d.scaleDiv.isValid() )
+        {
+            d.scaleDiv = d.scaleEngine->divideScale(
+                minValue, maxValue, 
+                d.maxMajor, d.maxMinor, stepSize);
+        }
+
+        QwtScaleWidget *scaleWidget = axisWidget(axisId);
+        scaleWidget->setScaleDiv(
+            d.scaleEngine->transformation(), d.scaleDiv);
+
+        int startDist, endDist;
+        scaleWidget->getBorderDistHint(startDist, endDist);
+        scaleWidget->setBorderDist(startDist, endDist);
+    }
+
+    for ( it = itmList.begin(); it != itmList.end(); ++it )
+    {
+        QwtPlotItem *item = *it;
+        item->updateScaleDiv( *axisScaleDiv(item->xAxis()),
+            *axisScaleDiv(item->yAxis()));
+    }
+}
+
diff --git a/src/qwt/qwt_plot_canvas.cpp b/src/qwt/qwt_plot_canvas.cpp
new file mode 100644
index 0000000..9d619f1
--- /dev/null
+++ b/src/qwt/qwt_plot_canvas.cpp
@@ -0,0 +1,355 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qpainter.h>
+#include <qstyle.h>
+#if QT_VERSION >= 0x040000
+#include <qstyleoption.h>
+#include <qpaintengine.h>
+#ifdef Q_WS_X11
+#include <qx11info_x11.h>
+#endif
+#endif
+#include <qevent.h>
+#include "qwt_painter.h"
+#include "qwt_math.h"
+#include "qwt_plot.h"
+#include "qwt_paint_buffer.h"
+#include "qwt_plot_canvas.h"
+
+class QwtPlotCanvas::PrivateData
+{
+public:
+    PrivateData():
+        focusIndicator(CanvasFocusIndicator),
+        paintAttributes(0),
+        cache(NULL)
+    {
+    }
+
+    ~PrivateData()
+    {
+        delete cache;
+    }
+
+    FocusIndicator focusIndicator;
+    int paintAttributes;
+    QPixmap *cache;
+};
+
+//! Sets a cross cursor, enables QwtPlotCanvas::PaintCached
+
+QwtPlotCanvas::QwtPlotCanvas(QwtPlot *plot):
+    QFrame(plot)
+{
+    d_data = new PrivateData;
+
+#if QT_VERSION >= 0x040100
+    setAutoFillBackground(true);
+#endif
+
+#if QT_VERSION < 0x040000
+    setWFlags(Qt::WNoAutoErase);
+    setCursor(Qt::crossCursor);
+#else
+    setAttribute(Qt::WA_PaintOnScreen, true);
+    setCursor(Qt::CrossCursor);
+#endif // >= 0x040000
+
+    setPaintAttribute(PaintCached, true);
+    setPaintAttribute(PaintPacked, true);
+}
+
+//! Destructor
+QwtPlotCanvas::~QwtPlotCanvas()
+{
+    delete d_data;
+}
+
+/*!
+  \brief Changing the paint attributes
+
+  \param attribute Paint attribute
+  \param on On/Off
+
+  The default setting enables PaintCached and PaintPacked
+
+  \sa testPaintAttribute(), drawCanvas(), drawContents(), paintCache()
+*/
+void QwtPlotCanvas::setPaintAttribute(PaintAttribute attribute, bool on)
+{
+    if ( bool(d_data->paintAttributes & attribute) == on )
+        return;
+
+    if ( on )
+        d_data->paintAttributes |= attribute;
+    else
+        d_data->paintAttributes &= ~attribute;
+
+    switch(attribute)
+    {
+        case PaintCached:
+        {
+            if ( on )
+            {
+                if ( d_data->cache == NULL )
+                    d_data->cache = new QPixmap();
+
+                if ( isVisible() )
+                {
+                    const QRect cr = contentsRect();
+                    *d_data->cache = QPixmap::grabWidget(this,
+                        cr.x(), cr.y(), cr.width(), cr.height() );
+                }
+            }
+            else
+            {
+                delete d_data->cache;
+                d_data->cache = NULL;
+            }
+            break;
+        }
+        case PaintPacked:
+        {
+            /*
+              If not visible, changing of the background mode
+              is delayed until it becomes visible. This tries to avoid 
+              looking through the canvas when the canvas is shown the first 
+              time.
+             */
+
+            if ( on == false || isVisible() )
+                QwtPlotCanvas::setSystemBackground(!on);
+
+            break;
+        }
+    }
+}
+
+/*!
+  Test wether a paint attribute is enabled
+
+  \param attribute Paint attribute
+  \return true if the attribute is enabled
+*/
+bool QwtPlotCanvas::testPaintAttribute(PaintAttribute attribute) const
+{
+    return (d_data->paintAttributes & attribute) != 0;
+}
+
+//! Return the paint cache, might be null
+QPixmap *QwtPlotCanvas::paintCache()
+{
+    return d_data->cache;
+}
+
+//! Return the paint cache, might be null
+const QPixmap *QwtPlotCanvas::paintCache() const
+{
+    return d_data->cache;
+}
+
+//! Invalidate the internal paint cache
+void QwtPlotCanvas::invalidatePaintCache()
+{
+    if ( d_data->cache )
+        *d_data->cache = QPixmap();
+}
+
+/*!
+  Set the focus indicator
+
+  \sa FocusIndicator, focusIndicator
+*/
+void QwtPlotCanvas::setFocusIndicator(FocusIndicator focusIndicator)
+{
+    d_data->focusIndicator = focusIndicator;
+}
+
+/*!
+  \return Focus indicator
+  
+  \sa FocusIndicator, setFocusIndicator
+*/
+QwtPlotCanvas::FocusIndicator QwtPlotCanvas::focusIndicator() const
+{
+    return d_data->focusIndicator;
+}
+
+void QwtPlotCanvas::hideEvent(QHideEvent *e)
+{
+    QFrame::hideEvent(e);
+
+    if ( d_data->paintAttributes & PaintPacked )
+    {
+        // enable system background to avoid the "looking through
+        // the canvas" effect, for the next show
+
+        setSystemBackground(true);
+    }
+}
+
+void QwtPlotCanvas::paintEvent(QPaintEvent *event)
+{
+#if QT_VERSION >= 0x040000
+    QPainter painter(this);
+    
+    if ( !contentsRect().contains( event->rect() ) ) 
+    {
+        painter.save();
+        painter.setClipRegion( event->region() & frameRect() );
+        drawFrame( &painter );
+        painter.restore(); 
+    }
+
+#if defined(Q_WS_WIN)
+
+#ifdef __GNUC__
+#warning Clipping bugs on Win32
+#endif
+
+#else
+    painter.setClipRegion(event->region() & contentsRect());
+#endif
+
+    drawContents( &painter );
+#else // QT_VERSION < 0x040000
+    QFrame::paintEvent(event);
+#endif
+
+    if ( d_data->paintAttributes & PaintPacked )
+        setSystemBackground(false);
+}
+
+//! Redraw the canvas, and focus rect
+void QwtPlotCanvas::drawContents(QPainter *painter)
+{
+    if ( d_data->paintAttributes & PaintCached && d_data->cache 
+        && d_data->cache->size() == contentsRect().size() )
+    {
+        painter->drawPixmap(contentsRect().topLeft(), *d_data->cache);
+    }
+    else
+        drawCanvas(painter);
+
+    if ( hasFocus() && focusIndicator() == CanvasFocusIndicator )
+        drawFocusIndicator(painter);
+}
+
+/*!
+  Draw the the canvas
+
+  Paints all plot items to the contentsRect(), using QwtPlot::drawCanvas
+  and updates the paint cache.
+
+  \sa QwtPlot::drawCanvas, setPaintAttributes(), testPaintAttributes()
+*/
+
+void QwtPlotCanvas::drawCanvas(QPainter *painter)
+{
+    if ( !contentsRect().isValid() )
+        return;
+
+    if ( d_data->paintAttributes & PaintCached && d_data->cache )
+    {
+        *d_data->cache = QPixmap(contentsRect().size());
+
+#ifdef Q_WS_X11
+#if QT_VERSION >= 0x040000
+        if ( d_data->cache->x11Info().screen() != x11Info().screen() )
+            d_data->cache->x11SetScreen(x11Info().screen());
+#else
+        if ( d_data->cache->x11Screen() != x11Screen() )
+            d_data->cache->x11SetScreen(x11Screen());
+#endif
+#endif
+
+        if ( d_data->paintAttributes & PaintPacked )
+        {
+            QPainter bgPainter(d_data->cache);
+            bgPainter.setPen(Qt::NoPen);
+
+            QBrush bgBrush;
+#if QT_VERSION >= 0x040000
+                bgBrush = palette().brush(backgroundRole());
+#else
+            QColorGroup::ColorRole role = 
+                QPalette::backgroundRoleFromMode( backgroundMode() );
+            bgBrush = colorGroup().brush( role );
+#endif
+            bgPainter.setBrush(bgBrush);
+            bgPainter.drawRect(d_data->cache->rect());
+        }
+        else
+            d_data->cache->fill(this, d_data->cache->rect().topLeft());
+
+        QPainter cachePainter(d_data->cache);
+        cachePainter.translate(-contentsRect().x(),
+            -contentsRect().y());
+
+        ((QwtPlot *)parent())->drawCanvas(&cachePainter);
+
+        cachePainter.end();
+
+        painter->drawPixmap(contentsRect(), *d_data->cache);
+    }
+    else
+    {
+        if ( d_data->paintAttributes & PaintPacked )
+        {
+            painter->save();
+            painter->setPen(Qt::NoPen);
+
+            const QBrush brush =
+#if QT_VERSION < 0x040000
+                backgroundBrush();
+#else
+                palette().brush(backgroundRole());
+#endif
+            painter->setBrush(brush);
+
+            painter->drawRect(contentsRect());
+            painter->restore();
+        }
+        ((QwtPlot *)parent())->drawCanvas(painter);
+    }
+}
+
+//! Draw the focus indication
+void QwtPlotCanvas::drawFocusIndicator(QPainter *painter)
+{
+    const int margin = 1;
+
+    QRect focusRect = contentsRect();
+    focusRect.setRect(focusRect.x() + margin, focusRect.y() + margin,
+        focusRect.width() - 2 * margin, focusRect.height() - 2 * margin);
+
+    QwtPainter::drawFocusRect(painter, this, focusRect);
+}
+
+void QwtPlotCanvas::setSystemBackground(bool on)
+{
+#if QT_VERSION < 0x040000
+    if ( backgroundMode() == Qt::NoBackground )
+    {
+        if ( on )
+            setBackgroundMode(Qt::PaletteBackground);
+    }
+    else
+    {
+        if ( !on )
+            setBackgroundMode(Qt::NoBackground);
+    }
+#else
+    if ( testAttribute(Qt::WA_NoSystemBackground) == on )
+        setAttribute(Qt::WA_NoSystemBackground, !on);
+#endif
+}
diff --git a/src/qwt/qwt_plot_curve.cpp b/src/qwt/qwt_plot_curve.cpp
new file mode 100644
index 0000000..c772e4a
--- /dev/null
+++ b/src/qwt/qwt_plot_curve.cpp
@@ -0,0 +1,1469 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qpainter.h>
+#include <qpixmap.h>
+#include <qbitarray.h>
+#include "qwt_global.h"
+#include "qwt_legend.h"
+#include "qwt_legend_item.h"
+#include "qwt_data.h"
+#include "qwt_rect.h"
+#include "qwt_scale_map.h"
+#include "qwt_double_rect.h"
+#include "qwt_math.h"
+#include "qwt_painter.h"
+#include "qwt_plot.h"
+#include "qwt_plot_canvas.h"
+#include "qwt_spline.h"
+#include "qwt_symbol.h"
+#include "qwt_plot_curve.h"
+
+#if QT_VERSION >= 0x040000
+
+#include <qevent.h>
+
+class QwtPlotCurvePaintHelper: public QObject
+{
+public:
+    QwtPlotCurvePaintHelper(const QwtPlotCurve *curve, int from, int to):
+        _curve(curve),
+        _from(from),
+        _to(to)
+    {
+    }
+
+    virtual bool eventFilter(QObject *, QEvent *event)
+    {
+        if ( event->type() == QEvent::Paint )
+        {
+            _curve->draw(_from, _to);
+            return true;
+        }
+        return false;
+    }
+private:
+    const QwtPlotCurve *_curve;
+    int _from;
+    int _to;
+};
+
+#endif // QT_VERSION >= 0x040000
+
+#if QT_VERSION < 0x040000
+#define QwtPointArray QPointArray
+#else
+#define QwtPointArray QPolygon
+#endif
+
+class QwtPlotCurve::PrivateData
+{
+public:
+    class PixelMatrix: private QBitArray
+    {
+    public:
+        PixelMatrix(const QRect& rect):
+            QBitArray(rect.width() * rect.height()),
+            _rect(rect)
+        {
+            fill(false);
+        }
+
+        inline bool testPixel(const QPoint& pos)
+        {
+            if ( !_rect.contains(pos) )
+                return false;
+
+            const int idx = _rect.width() * (pos.y() - _rect.y()) + 
+                (pos.x() - _rect.x());
+
+            const bool marked = testBit(idx);
+            if ( !marked )
+                setBit(idx, true);
+
+            return !marked;
+        }
+
+    private:
+        QRect _rect;
+    };
+
+    PrivateData()
+    {
+        pen = QPen(Qt::black, 0);
+        reference = 0.0;
+        splineSize = 250;
+        attributes = Auto;
+        paintAttributes = 0;
+        style = QwtPlotCurve::Lines;
+    }
+
+    QwtPlotCurve::CurveStyle style;
+    double reference;
+
+    QwtSymbol sym;
+
+    QPen pen;
+    QBrush brush;
+    QwtText title;
+
+    int attributes;
+    int splineSize;
+    int paintAttributes;
+};
+
+static int qwtChkMono(const double *array, int size)
+{
+    if (size < 2)
+        return 0;
+
+    int rv = qwtSign(array[1] - array[0]);
+    for (int i = 1; i < size - 1; i++)
+    {
+        if ( qwtSign(array[i+1] - array[i]) != rv )
+        {
+            rv = 0;
+            break;
+        }
+    }
+    return rv;
+}
+
+static void qwtTwistArray(double *array, int size)
+{
+    const int s2 = size / 2;
+
+    for (int i=0; i < s2; i++)
+    {
+        const int itmp = size - 1 - i;
+        const double dtmp = array[i];
+        array[i] = array[itmp];
+        array[itmp] = dtmp;
+    }
+}
+
+/*!
+  \brief Ctor
+*/
+QwtPlotCurve::QwtPlotCurve()
+{
+    init(QwtText());
+}
+
+/*!
+  \brief Ctor
+  \param title title of the curve   
+*/
+QwtPlotCurve::QwtPlotCurve(const QwtText &title)
+{
+    init(title);
+}
+
+/*!
+  \brief Ctor
+  \param title title of the curve   
+*/
+QwtPlotCurve::QwtPlotCurve(const QString &title)
+{
+    init(title);
+}
+
+/*!
+  \brief Copy Constructor
+*/
+QwtPlotCurve::QwtPlotCurve(const QwtPlotCurve &c):
+    QwtPlotItem(c)
+{
+    init(c.d_data->title);
+    copy(c);
+}
+
+//! Dtor
+QwtPlotCurve::~QwtPlotCurve()
+{
+    delete d_xy;
+    delete d_data;
+}
+
+/*!
+  \brief Initialize data members
+*/
+void QwtPlotCurve::init(const QwtText &title)
+{
+    setItemAttribute(QwtPlotItem::Legend);
+    setItemAttribute(QwtPlotItem::AutoScale);
+
+    d_data = new PrivateData;
+    d_data->title = title;
+
+    d_xy = new QwtDoublePointData(QwtArray<QwtDoublePoint>());
+
+    setZ(20.0);
+}
+
+/*!
+  \brief Copy the contents of a curve into another curve
+*/
+void QwtPlotCurve::copy(const QwtPlotCurve &c)
+{
+    if (this != &c)
+    {
+        *d_data = *c.d_data;
+
+        delete d_xy;
+        d_xy = c.d_xy->copy();
+
+        itemChanged();
+    }
+}
+
+
+/*!
+  \brief Copy Assignment
+*/
+const QwtPlotCurve& QwtPlotCurve::operator=(const QwtPlotCurve &c)
+{
+    copy(c);
+    return *this;
+}
+
+int QwtPlotCurve::rtti() const
+{
+    return QwtPlotItem::Rtti_PlotCurve;
+}
+
+/*!
+  \brief Specify an attribute how to draw the curve
+
+  The attributes can be used to modify the drawing algorithm.
+
+  The following attributes are defined:<dl>
+  <dt>QwtPlotCurve::PaintFiltered</dt>
+  <dd>Tries to reduce the data that has to be painted, by sorting out
+      duplicates, or paintings outside the visible area. Might have a
+      notable impact on curves with many close points. 
+      Only a couple of very basic filtering algos are implemented.</dd>
+  <dt>QwtPlotCurve::ClipPolygons</dt>
+  <dd>Clip polygons before painting them.
+  </dl>
+
+  The default is, that no paint attributes are enabled.
+
+  \param attribute Paint attribute
+  \param on On/Off
+  /sa QwtPlotCurve::testPaintAttribute()
+*/
+void QwtPlotCurve::setPaintAttribute(PaintAttribute attribute, bool on)
+{
+    if ( on )
+        d_data->paintAttributes |= attribute;
+    else
+        d_data->paintAttributes &= ~attribute;
+}
+
+/*!
+    \brief Return the current paint attributes
+    \sa QwtPlotCurve::setPaintAttribute
+*/
+bool QwtPlotCurve::testPaintAttribute(PaintAttribute attribute) const
+{
+    return (d_data->paintAttributes & attribute);
+}
+
+/*!
+  \brief Set the curve's drawing style
+
+  Valid styles are:
+  <dl>
+  <dt>QwtPlotCurve::NoCurve</dt>
+  <dd>Don't draw a curve. Note: This doesn't affect the symbol. </dd>
+  <dt>QwtPlotCurve::Lines</dt>
+  <dd>Connect the points with straight lines.</dd>
+  <dt>QwtPlotCurve::Sticks</dt>
+  <dd>Draw vertical sticks from a baseline which is defined by setBaseline().</dd>
+  <dt>QwtPlotCurve::Steps</dt>
+  <dd>Connect the points with a step function. The step function
+      is drawn from the left to the right or vice versa,
+      depending on the 'Inverted' option.</dd>
+  <dt>QwtPlotCurves::Dots</dt>
+  <dd>Draw dots at the locations of the data points. Note:
+      This is different from a dotted line (see setPen()).</dd>
+  <dt>QwtPlotCurve::Spline</dt>
+  <dd>Interpolate the points with a spline. The spline
+      type can be specified with setCurveAttribute(),
+      the size of the spline (= number of interpolated points)
+      can be specified with setSplineSize().</dd>
+  <dt>QwtPlotCurve::UserCurve ...</dt>
+  <dd>Styles >= QwtPlotCurve::UserCurve are reserved for derived
+      classes of QwtPlotCurve that overload QwtPlotCurve::draw() with
+      additional application specific curve types.</dd>
+  </dl>
+  \sa QwtPlotCurve::style()
+*/
+void QwtPlotCurve::setStyle(CurveStyle style)
+{
+    if ( style != d_data->style )
+    {
+        d_data->style = style;
+        itemChanged();
+    }
+}
+
+/*!
+    \fn CurveStyle QwtPlotCurve::style() const
+    \brief Return the current style
+    \sa QwtPlotCurve::setStyle
+*/
+QwtPlotCurve::CurveStyle QwtPlotCurve::style() const 
+{ 
+    return d_data->style; 
+}
+
+/*!
+  \brief Assign a symbol
+  \param s symbol
+  \sa QwtSymbol
+*/
+void QwtPlotCurve::setSymbol(const QwtSymbol &s )
+{
+    d_data->sym = s;
+    itemChanged();
+}
+
+/*!
+    \brief Return the current symbol
+    \sa QwtPlotCurve::setSymbol
+*/
+const QwtSymbol &QwtPlotCurve::symbol() const 
+{ 
+    return d_data->sym; 
+}
+
+/*!
+  \brief Assign a pen
+  \param p New pen
+*/
+void QwtPlotCurve::setPen(const QPen &p)
+{
+    if ( p != d_data->pen )
+    {
+        d_data->pen = p;
+        itemChanged();
+    }
+}
+
+/*!
+    \brief Return the pen used to draw the lines
+    \sa QwtPlotCurve::setPen
+*/
+const QPen& QwtPlotCurve::pen() const 
+{ 
+    return d_data->pen; 
+}
+
+/*!
+  \brief Assign a brush. 
+         In case of brush.style() != QBrush::NoBrush 
+         and style() != QwtPlotCurve::Sticks
+         the area between the curve and the baseline will be filled.
+         In case !brush.color().isValid() the area will be filled by
+         pen.color(). The fill algorithm simply connects the first and the
+         last curve point to the baseline. So the curve data has to be sorted 
+         (ascending or descending). 
+  \param brush New brush
+    \sa QwtPlotCurve::brush, QwtPlotCurve::setBaseline, QwtPlotCurve::baseline
+*/
+void QwtPlotCurve::setBrush(const QBrush &brush)
+{
+    if ( brush != d_data->brush )
+    {
+        d_data->brush = brush;
+        itemChanged();
+    }
+}
+
+/*!
+  \brief Return the brush used to fill the area between lines and the baseline
+
+  \sa QwtPlotCurve::setBrush, QwtPlotCurve::setBaseline, QwtPlotCurve::baseline
+*/
+const QBrush& QwtPlotCurve::brush() const 
+{
+    return d_data->brush;
+}
+
+
+/*!
+  \brief Set data by copying x- and y-values from specified memory blocks
+  Contrary to \b QwtPlot::setCurveRawData, this function makes a 'deep copy' of
+  the data.
+
+  \param xData pointer to x values
+  \param yData pointer to y values
+  \param size size of xData and yData
+
+  \sa QwData::setData.
+*/
+void QwtPlotCurve::setData(const double *xData, const double *yData, int size)
+{
+    delete d_xy;
+    d_xy = new QwtArrayData(xData, yData, size);
+    itemChanged();
+}
+
+/*!
+  \brief Initialize data with x- and y-arrays (explicitly shared)
+
+  \param xData x data
+  \param yData y data
+
+  \sa QwtData::setData.
+*/
+void QwtPlotCurve::setData(const QwtArray<double> &xData, 
+    const QwtArray<double> &yData)
+{
+    delete d_xy;
+    d_xy = new QwtArrayData(xData, yData);
+    itemChanged();
+}
+
+/*!
+  Initialize data with an array of points (explicitly shared).
+
+  \param data Data
+
+  \sa QwtDoublePointData::setData.
+*/
+void QwtPlotCurve::setData(const QwtArray<QwtDoublePoint> &data)
+{
+    delete d_xy;
+    d_xy = new QwtDoublePointData(data);
+    itemChanged();
+}
+
+/*!
+  Initialize data with a pointer to QwtData.
+
+  \param data Data
+
+  \sa QwtData::copy.
+*/
+void QwtPlotCurve::setData(const QwtData &data)
+{
+    delete d_xy;
+    d_xy = data.copy();
+    itemChanged();
+}
+
+/*!
+  \brief Initialize the data by pointing to memory blocks which are not managed
+  by QwtPlotCurve.
+
+  setRawData is provided for efficiency. It is important to keep the pointers
+  during the lifetime of the underlying QwtCPointerData class.
+
+  \param xData pointer to x data
+  \param yData pointer to y data
+  \param size size of x and y
+
+  \sa QwtCPointerData::setData.
+*/
+void QwtPlotCurve::setRawData(const double *xData, const double *yData, int size)
+{
+    delete d_xy;
+    d_xy = new QwtCPointerData(xData, yData, size);
+    itemChanged();
+}
+
+/*!
+  \brief Assign a title to a curve
+  \param title new title
+*/
+void QwtPlotCurve::setTitle(const QString &title)
+{
+    setTitle(QwtText(title));
+}
+
+/*!
+  \brief Assign a title to a curve
+  \param title new title
+*/
+void QwtPlotCurve::setTitle(const QwtText &title)
+{
+    d_data->title = title;
+    itemChanged();
+}
+
+/*!
+    \brief Return the title.
+    \sa QwtPlotCurve::setTitle
+*/
+const QwtText &QwtPlotCurve::title() const 
+{ 
+    return d_data->title; 
+}
+
+/*!
+  Returns the bounding rectangle of the curve data. If there is
+  no bounding rect, like for empty data the rectangle is invalid:
+  QwtDoubleRect.isValid() == false
+*/
+
+QwtDoubleRect QwtPlotCurve::boundingRect() const
+{
+    if ( d_xy == NULL )
+        return QwtDoubleRect(1.0, 1.0, -2.0, -2.0); // invalid
+
+    return d_xy->boundingRect();
+}
+
+
+/*!
+  \brief Checks if a range of indices is valid and corrects it if necessary
+  \param i1 Index 1
+  \param i2 Index 2
+*/
+int QwtPlotCurve::verifyRange(int &i1, int &i2) const
+{
+    int size = dataSize();
+
+    if (size < 1) return 0;
+
+    i1 = qwtLim(i1, 0, size-1);
+    i2 = qwtLim(i2, 0, size-1);
+
+    if ( i1 > i2 )
+        qSwap(i1, i2);
+
+    return (i2 - i1 + 1);
+}
+
+void QwtPlotCurve::draw(QPainter *painter,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+    const QRect &) const
+{
+    draw(painter, xMap, yMap, 0, -1);
+}
+
+/*!
+  \brief Draw a set of points of a curve.
+
+  When observing an measurement while it is running, new points have to be
+  added to an existing curve. drawCurve can be used to display them avoiding
+  a complete redraw of the canvas.
+
+  Setting plot()->canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, true);
+  will result in faster painting, if the paint engine of the canvas widget
+  supports this feature. 
+
+  \param from Index of the first point to be painted
+  \param to Index of the last point to be painted. If to < 0 the
+         curve will be painted to its last point.
+
+  \sa QwtCurve::draw
+*/
+void QwtPlotCurve::draw(int from, int to) const
+{
+    if ( !plot() )
+        return;
+
+    QwtPlotCanvas *canvas = plot()->canvas();
+
+    bool directPaint = true;
+
+#if QT_VERSION >= 0x040000
+    if ( !canvas->testAttribute(Qt::WA_WState_InPaintEvent) &&
+        !canvas->testAttribute(Qt::WA_PaintOutsidePaintEvent) )
+    {
+        /*
+          We save curve and range in helper and call repaint.
+          The helper filters the Paint event, to repeat
+          the QwtPlotCurve::draw, but now from inside the paint
+          event.
+         */
+
+        QwtPlotCurvePaintHelper helper(this, from, to);
+        canvas->installEventFilter(&helper);
+        canvas->repaint();
+
+        return;
+    }
+#endif
+
+    const QwtScaleMap xMap = plot()->canvasMap(xAxis());
+    const QwtScaleMap yMap = plot()->canvasMap(yAxis());
+
+    if ( canvas->testPaintAttribute(QwtPlotCanvas::PaintCached) &&
+        canvas->paintCache() && !canvas->paintCache()->isNull() )
+    {
+        QPainter cachePainter((QPixmap *)canvas->paintCache());
+        cachePainter.translate(-canvas->contentsRect().x(),
+            -canvas->contentsRect().y());
+
+        draw(&cachePainter, xMap, yMap, from, to);
+    }
+
+    if ( directPaint )
+    {
+        QPainter painter(canvas);
+
+        painter.setClipping(true);
+        painter.setClipRect(canvas->contentsRect());
+
+        draw(&painter, xMap, yMap, from, to);
+
+        return;
+    }
+
+#if QT_VERSION >= 0x040000
+    if ( canvas->testPaintAttribute(QwtPlotCanvas::PaintCached) &&
+        canvas->paintCache() )
+    {
+        /*
+          The cache is up to date. We flush it via repaint to the
+          canvas. This works flicker free but is much ( > 10x )
+          slower than direct painting.
+         */
+
+        const bool noBG = canvas->testAttribute(Qt::WA_NoBackground);
+        if ( !noBG )
+            canvas->setAttribute(Qt::WA_NoBackground, true);
+
+        canvas->repaint(canvas->contentsRect());
+
+        if ( !noBG )
+            canvas->setAttribute(Qt::WA_NoBackground, false);
+
+        return;
+    }
+#endif
+
+    // Ok, we give up 
+    canvas->repaint(canvas->contentsRect());
+}
+
+/*!
+  \brief Draw an interval of the curve
+  \param painter Painter
+  \param xMap maps x-values into pixel coordinates.
+  \param yMap maps y-values into pixel coordinates.
+  \param from index of the first point to be painted
+  \param to index of the last point to be painted. If to < 0 the 
+         curve will be painted to its last point.
+
+  \sa QwtPlotCurve::drawCurve, QwtPlotCurve::drawDots,
+      QwtPlotCurve::drawLines, QwtPlotCurve::drawSpline,
+      QwtPlotCurve::drawSteps, QwtPlotCurve::drawSticks
+*/
+void QwtPlotCurve::draw(QPainter *painter,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap, 
+    int from, int to) const
+{
+    if ( !painter || dataSize() <= 0 )
+        return;
+
+    if (to < 0)
+        to = dataSize() - 1;
+
+    if ( verifyRange(from, to) > 0 )
+    {
+        painter->save();
+        painter->setPen(d_data->pen);
+
+        /*
+          Qt 4.0.0 is slow when drawing lines, but it´s even 
+          slower when the painter has a brush. So we don't
+          set the brush before we need it.
+         */
+
+        drawCurve(painter, d_data->style, xMap, yMap, from, to);
+        painter->restore();
+
+        if (d_data->sym.style() != QwtSymbol::None)
+        {
+            painter->save();
+            drawSymbols(painter, d_data->sym, xMap, yMap, from, to);
+            painter->restore();
+        }
+    }
+}
+
+/*!
+  \brief Draw the line part (without symbols) of a curve interval. 
+  \param painter Painter
+  \param style curve style, see QwtPlotCurve::CurveStyle
+  \param xMap x map
+  \param yMap y map
+  \param from index of the first point to be painted
+  \param to index of the last point to be painted
+  \sa QwtPlotCurve::draw, QwtPlotCurve::drawDots, QwtPlotCurve::drawLines,
+      QwtPlotCurve::drawSpline, QwtPlotCurve::drawSteps, QwtPlotCurve::drawSticks
+*/
+
+void QwtPlotCurve::drawCurve(QPainter *painter, int style,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap, 
+    int from, int to) const
+{
+    switch (style)
+    {
+        case Lines:
+            drawLines(painter, xMap, yMap, from, to);
+            break;
+        case Sticks:
+            drawSticks(painter, xMap, yMap, from, to);
+            break;
+        case Steps:
+            drawSteps(painter, xMap, yMap, from, to);
+            break;
+        case Spline:
+            if ( from > 0 || to < dataSize() - 1 )
+                drawLines(painter, xMap, yMap, from, to);
+            else
+                drawSpline(painter, xMap, yMap);
+            break;
+        case Dots:
+            drawDots(painter, xMap, yMap, from, to);
+            break;
+        case NoCurve:
+        default:
+            break;
+    }
+}
+
+/*!
+  \brief Draw lines
+  \param painter Painter
+  \param xMap x map
+  \param yMap y map
+  \param from index of the first point to be painted
+  \param to index of the last point to be painted
+  \sa QwtPlotCurve::draw, QwtPlotCurve::drawLines, QwtPlotCurve::drawDots, 
+      QwtPlotCurve::drawSpline, QwtPlotCurve::drawSteps, QwtPlotCurve::drawSticks
+*/
+void QwtPlotCurve::drawLines(QPainter *painter,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap, 
+    int from, int to) const
+{
+    const int size = to - from + 1;
+    if ( size <= 0 )
+        return;
+
+    QwtPointArray polyline(size);
+
+    if ( d_data->paintAttributes & PaintFiltered )
+    {
+        QPoint pp( xMap.transform(x(from)), yMap.transform(y(from)) );
+        polyline.setPoint(0, pp);
+
+        int count = 1;
+        for (int i = from + 1; i <= to; i++)
+        {
+            const QPoint pi(xMap.transform(x(i)), yMap.transform(y(i)));
+            if ( pi != pp )
+            {
+                polyline.setPoint(count, pi);
+                count++;
+
+                pp = pi;
+            }
+        }
+        if ( count != size )
+            polyline.resize(count);
+    }
+    else
+    {
+        for (int i = from; i <= to; i++)
+        {
+            int xi = xMap.transform(x(i));
+            int yi = yMap.transform(y(i));
+
+            polyline.setPoint(i - from, xi, yi);
+        }
+    }
+
+    if ( d_data->paintAttributes & ClipPolygons )
+    {
+        QwtRect r = painter->window();
+        polyline = r.clip(polyline);
+    }
+
+    QwtPainter::drawPolyline(painter, polyline);
+
+    if ( d_data->brush.style() != Qt::NoBrush )
+        fillCurve(painter, xMap, yMap, polyline);
+}
+
+/*!
+  \brief Draw sticks
+  \param painter Painter
+  \param xMap x map
+  \param yMap y map
+  \param from index of the first point to be painted
+  \param to index of the last point to be painted
+  \sa QwtPlotCurve::draw, QwtPlotCurve::drawCurve, QwtPlotCurve::drawDots, 
+      QwtPlotCurve::drawLines, QwtPlotCurve::drawSpline, QwtPlotCurve::drawSteps
+*/
+void QwtPlotCurve::drawSticks(QPainter *painter,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap, 
+    int from, int to) const
+{
+    int x0 = xMap.transform(d_data->reference);
+    int y0 = yMap.transform(d_data->reference);
+
+    for (int i = from; i <= to; i++)
+    {
+        const int xi = xMap.transform(x(i));
+        const int yi = yMap.transform(y(i));
+
+        if (d_data->attributes & Xfy)
+            QwtPainter::drawLine(painter, x0, yi, xi, yi);
+        else
+            QwtPainter::drawLine(painter, xi, y0, xi, yi);
+    }
+}
+
+/*!
+  \brief Draw dots
+  \param painter Painter
+  \param xMap x map
+  \param yMap y map
+  \param from index of the first point to be painted
+  \param to index of the last point to be painted
+  \sa QwtPlotCurve::drawPolyline, QwtPlotCurve::drawLine, 
+      QwtPlotCurve::drawLines, QwtPlotCurve::drawSpline, QwtPlotCurve::drawSteps
+      QwtPlotCurve::drawPolyline, QwtPlotCurve::drawPolygon
+*/
+void QwtPlotCurve::drawDots(QPainter *painter,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap, 
+    int from, int to) const
+{
+    const QRect window = painter->window();
+    if ( window.isEmpty() )
+        return;
+
+    const bool doFill = d_data->brush.style() != Qt::NoBrush;
+
+    QwtPointArray polyline;
+    if ( doFill )
+        polyline.resize(to - from + 1);
+
+    if ( to > from && d_data->paintAttributes & PaintFiltered )
+    {
+        int count = 0;
+
+        if ( doFill )   
+        {
+            QPoint pp( xMap.transform(x(from)), yMap.transform(y(from)) );
+            polyline.setPoint(0, pp);
+
+            int count = 1;
+            for (int i = from + 1; i <= to; i++)
+            {
+                const QPoint pi(xMap.transform(x(i)), yMap.transform(y(i)));
+                if ( pi != pp )
+                {
+                    polyline.setPoint(count, pi);
+                    count++;
+
+                    pp = pi;
+                }
+            }
+        }
+        else
+        {
+            // if we don't need to fill, we can sort out
+            // duplicates independent from the order
+
+            PrivateData::PixelMatrix pixelMatrix(window);
+
+            for (int i = from; i <= to; i++)
+            {
+                const QPoint p( xMap.transform(x(i)),
+                    yMap.transform(y(i)) );
+
+                if ( pixelMatrix.testPixel(p) )
+                {
+                    polyline[count] = p;
+                    count++;
+                }
+            }
+        }
+        if ( int(polyline.size()) != count )
+            polyline.resize(count);
+    }
+    else
+    {
+        for (int i = from; i <= to; i++)
+        {
+            const int xi = xMap.transform(x(i));
+            const int yi = yMap.transform(y(i));
+            QwtPainter::drawPoint(painter, xi, yi);
+
+            if ( doFill )
+                polyline.setPoint(i - from, xi, yi);
+        }
+    }
+
+    if ( d_data->paintAttributes & ClipPolygons )
+    {
+        const QwtRect r = painter->window();
+        polyline = r.clip(polyline);
+    }
+
+    if ( doFill )
+        fillCurve(painter, xMap, yMap, polyline);
+}
+
+/*!
+  \brief Draw step function
+  \param painter Painter
+  \param xMap x map
+  \param yMap y map
+  \param from index of the first point to be painted
+  \param to index of the last point to be painted
+  \sa QwtPlotCurve::draw, QwtPlotCurve::drawCurve, QwtPlotCurve::drawDots, 
+      QwtPlotCurve::drawLines, QwtPlotCurve::drawSpline, QwtPlotCurve::drawSticks
+*/
+void QwtPlotCurve::drawSteps(QPainter *painter,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap, 
+    int from, int to) const
+{
+    QwtPointArray polyline(2 * (to - from) + 1);
+
+    bool inverted = d_data->attributes & Yfx;
+    if ( d_data->attributes & Inverted )
+        inverted = !inverted;
+
+    int i,ip;
+    for (i = from, ip = 0; i <= to; i++, ip += 2)
+    {
+        const int xi = xMap.transform(x(i));
+        const int yi = yMap.transform(y(i));
+
+        if ( ip > 0 )
+        {
+            if (inverted)
+                polyline.setPoint(ip - 1, polyline[ip-2].x(), yi);
+            else
+                polyline.setPoint(ip - 1, xi, polyline[ip-2].y());
+        }
+
+        polyline.setPoint(ip, xi, yi);
+    }
+
+    if ( d_data->paintAttributes & ClipPolygons )
+    {
+        const QwtRect r = painter->window();
+        polyline = r.clip(polyline);
+    }
+
+    QwtPainter::drawPolyline(painter, polyline);
+
+    if ( d_data->brush.style() != Qt::NoBrush )
+        fillCurve(painter, xMap, yMap, polyline);
+}
+
+/*!
+  \brief Draw a spline
+  \param painter Painter
+  \param xMap x map
+  \param yMap y map
+  \sa QwtPlotCurve::draw, QwtPlotCurve::drawCurve, QwtPlotCurve::drawDots,
+      QwtPlotCurve::drawLines, QwtPlotCurve::drawSteps, QwtPlotCurve::drawSticks
+*/
+void QwtPlotCurve::drawSpline(QPainter *painter,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap) const
+{
+    int i;
+
+    const int size = dataSize();
+    double *txval = new double[size];
+    double *tyval = new double[size];
+
+    //
+    // Transform x and y values to window coordinates
+    // to avoid a distinction between linear and
+    // logarithmic scales.
+    //
+    for (i=0;i<size;i++)
+    {
+        txval[i] = xMap.xTransform(x(i));
+        tyval[i] = yMap.xTransform(y(i));
+    }
+
+    int stype;
+    if (! (d_data->attributes & (Yfx|Xfy|Parametric)))
+    {
+        if (qwtChkMono(txval, size))
+        {
+            stype = Yfx;
+        }
+        else if(qwtChkMono(tyval, size))
+        {
+            stype = Xfy;
+        }
+        else
+        {
+            stype = Parametric;
+            if ( (d_data->attributes & Periodic) ||
+                ( (x(0) == x(size-1))
+                && (y(0) == y(size-1))))
+            {
+                stype |= Periodic;
+            }
+        }
+    }
+    else
+    {
+        stype = d_data->attributes;
+    }
+
+    bool ok = false;
+    QwtPointArray polyline(d_data->splineSize);
+
+    if (stype & Parametric)
+    {
+        //
+        // setup parameter vector
+        //
+        double *param = new double[size];
+        param[0] = 0.0;
+        for (i=1; i<size; i++)
+        {
+            const double delta = sqrt( qwtSqr(txval[i] - txval[i-1])
+                          + qwtSqr( tyval[i] - tyval[i-1]));
+            param[i] = param[i-1] + qwtMax(delta, 1.0);
+        }
+
+        //
+        // setup splines
+        QwtSpline spx, spy;
+        ok = spx.recalc(param, txval, size, stype & Periodic);
+        if (ok)
+            ok = spy.recalc(param, tyval, size, stype & Periodic);
+
+        if ( ok )
+        {
+            // fill point array
+            const double delta = 
+                param[size - 1] / double(d_data->splineSize-1);
+            for (i = 0; i < d_data->splineSize; i++)
+            {
+                const double dtmp = delta * double(i);
+                polyline.setPoint(i, qRound(spx.value(dtmp)), 
+                    qRound(spy.value(dtmp)) );
+            }
+        }
+        delete[] param;
+    }
+    else if (stype & Xfy)
+    {
+        if (tyval[size-1] < tyval[0])
+        {
+            qwtTwistArray(txval, size);
+            qwtTwistArray(tyval, size);
+        }
+
+        // 1. Calculate spline coefficients
+        QwtSpline spx;
+        ok = spx.recalc(tyval, txval, size, stype & Periodic);
+        if ( ok )
+        {
+            const double ymin = qwtGetMin(tyval, size);
+            const double ymax = qwtGetMax(tyval, size);
+            const double delta = (ymax - ymin) / double(d_data->splineSize - 1);
+
+            for (i = 0; i < d_data->splineSize; i++)
+            {
+                const double dtmp = ymin + delta * double(i);
+                polyline.setPoint(i, 
+                    qRound(spx.value(dtmp)), qRound(dtmp + 0.5));
+            }
+        }
+    }
+    else
+    {
+        if (txval[size-1] < txval[0])
+        {
+            qwtTwistArray(tyval, size);
+            qwtTwistArray(txval, size);
+        }
+
+        // 1. Calculate spline coefficients
+        QwtSpline spy;
+        ok = spy.recalc(txval, tyval, size, stype & Periodic);
+        if ( ok )
+        {
+            const double xmin = qwtGetMin(txval, size);
+            const double xmax = qwtGetMax(txval, size);
+            const double delta = (xmax - xmin) / double(d_data->splineSize - 1);
+
+            for (i = 0; i < d_data->splineSize; i++)
+            {
+                double dtmp = xmin + delta * double(i);
+                polyline.setPoint(i, 
+                    qRound(dtmp), qRound(spy.value(dtmp)));
+            }
+        }
+    }
+
+    delete[] txval;
+    delete[] tyval;
+
+    if ( ok )
+    {
+        if ( d_data->paintAttributes & ClipPolygons )
+        {
+            const QwtRect r = painter->window();
+            polyline = r.clip(polyline);
+        }
+
+        QwtPainter::drawPolyline(painter, polyline);
+
+        if ( d_data->brush.style() != Qt::NoBrush )
+            fillCurve(painter, xMap, yMap, polyline);
+    }
+    else
+        drawLines(painter, xMap, yMap, 0, size - 1);
+}
+
+/*!
+  \brief Specify an attribute for the drawing style  
+
+  The attributes can be used to modify the drawing style.
+  The following attributes are defined:<dl>
+  <dt>QwtPlotCurve::Auto</dt>
+  <dd>The default setting. For QwtPlotCurve::spline,
+      this means that the type of the spline is
+      determined automatically, depending on the data.
+      For all other styles, this means that y is
+      regarded as a function of x.</dd>
+  <dt>QwtPlotCurve::Yfx</dt>
+  <dd>Draws y as a function of x (the default). The
+      baseline is interpreted as a horizontal line
+      with y = baseline().</dd>
+  <dt>QwtPlotCurve::Xfy</dt>
+  <dd>Draws x as a function of y. The baseline is
+      interpreted as a vertical line with x = baseline().</dd>
+  <dt>QwtPlotCurve::Parametric</dt>
+  <dd>For QwtPlotCurve::Spline only. Draws a parametric spline.</dd>
+  <dt>QwtPlotCurve::Periodic</dt>
+  <dd>For QwtPlotCurve::Spline only. Draws a periodic spline.</dd>
+  <dt>QwtPlotCurve::Inverted</dt>
+  <dd>For QwtPlotCurve::Steps only. Draws a step function
+      from the right to the left.</dd></dl>
+
+  \param attribute Curve attribute
+  \param on On/Off
+  /sa QwtPlotCurve::testCurveAttribute()
+*/
+void QwtPlotCurve::setCurveAttribute(CurveAttribute attribute, bool on)
+{
+    if ( bool(d_data->attributes & attribute) == on )
+        return;
+
+    if ( on )
+        d_data->attributes |= attribute;
+    else
+        d_data->attributes &= ~attribute;
+
+    itemChanged();
+}
+
+/*!
+    \brief Return the current curve attributes
+    \sa QwtPlotCurve::setCurveAttribute
+*/
+bool QwtPlotCurve::testCurveAttribute(CurveAttribute attribute) const 
+{ 
+    return d_data->attributes & attribute;
+}
+
+/*!
+  \brief Change the number of interpolated points
+  \param s new size
+  \warning The default is 250 points.
+*/
+void QwtPlotCurve::setSplineSize(int s)
+{
+    d_data->splineSize = qwtMax(s, 10);
+    itemChanged();
+}
+
+/*!
+    \fn int QwtPlotCurve::splineSize() const
+    \brief Return the spline size
+    \sa QwtPlotCurve::setSplineSize
+*/
+
+int QwtPlotCurve::splineSize() const 
+{ 
+    return d_data->splineSize; 
+}
+
+/*! 
+  Fill the area between the polygon and the baseline with 
+  the curve brush
+
+  \param painter Painter
+  \param xMap x map
+  \param yMap y map
+  \param pa Polygon
+
+  \sa QwtPlotCurve::setBrush()
+*/
+
+void QwtPlotCurve::fillCurve(QPainter *painter,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+    QwtPointArray &pa) const
+{
+    if ( d_data->brush.style() == Qt::NoBrush )
+        return;
+
+    closePolyline(xMap, yMap, pa);
+    if ( pa.count() <= 2 ) // a line can't be filled
+        return;
+
+    QBrush b = d_data->brush;
+    if ( !b.color().isValid() )
+        b.setColor(d_data->pen.color());
+
+    painter->save();
+
+    painter->setPen(QPen(Qt::NoPen));
+    painter->setBrush(b);
+
+    QwtPainter::drawPolygon(painter, pa);
+
+    painter->restore();
+}
+
+/*!
+  \brief Complete a polygon to be a closed polygon 
+         including the area between the original polygon
+         and the baseline.
+  \param xMap X map
+  \param yMap Y map
+  \param pa Polygon to be completed
+*/
+
+void QwtPlotCurve::closePolyline(
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+    QwtPointArray &pa) const
+{
+    const int sz = pa.size();
+    if ( sz < 2 )
+        return;
+
+    pa.resize(sz + 2);
+
+    if ( d_data->attributes & QwtPlotCurve::Xfy )
+    {
+        pa.setPoint(sz,
+            xMap.transform(d_data->reference), pa.point(sz - 1).y());
+        pa.setPoint(sz + 1,
+            xMap.transform(d_data->reference), pa.point(0).y());
+    }
+    else
+    {
+        pa.setPoint(sz,
+            pa.point(sz - 1).x(), yMap.transform(d_data->reference));
+        pa.setPoint(pa.size() - 1,
+            pa.point(0).x(), yMap.transform(d_data->reference));
+    }
+}
+
+/*!
+  \brief Draw symbols
+  \param painter Painter
+  \param symbol Curve symbol
+  \param xMap x map
+  \param yMap y map
+  \param from index of the first point to be painted
+  \param to index of the last point to be painted
+*/
+void QwtPlotCurve::drawSymbols(QPainter *painter, const QwtSymbol &symbol,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap, 
+    int from, int to) const
+{
+    painter->setBrush(symbol.brush());
+    painter->setPen(symbol.pen());
+
+    QRect rect;
+    rect.setSize(QwtPainter::metricsMap().screenToLayout(symbol.size()));
+
+    if ( to > from && d_data->paintAttributes & PaintFiltered )
+    {
+        const QRect window = painter->window();
+        if ( window.isEmpty() )
+            return;
+
+        PrivateData::PixelMatrix pixelMatrix(window);
+
+        for (int i = from; i <= to; i++)
+        {
+            const QPoint pi( xMap.transform(x(i)),
+                yMap.transform(y(i)) );
+
+            if ( pixelMatrix.testPixel(pi) )
+            {
+                rect.moveCenter(pi);
+                symbol.draw(painter, rect);
+            }
+        }
+    }
+    else
+    {
+        for (int i = from; i <= to; i++)
+        {
+            const int xi = xMap.transform(x(i));
+            const int yi = yMap.transform(y(i));
+
+            rect.moveCenter(QPoint(xi, yi));
+            symbol.draw(painter, rect);
+        }
+    }
+}
+
+/*!
+  \brief Set the value of the baseline
+
+  The baseline is needed for filling the curve with a brush or
+  the QwtPlotCurve::Sticks drawing style. 
+  The default value is 0.0. The interpretation
+  of the baseline depends on the style options. With QwtPlotCurve::Yfx,
+  the baseline is interpreted as a horizontal line at y = baseline(),
+  with QwtPlotCurve::Yfy, it is interpreted as a vertical line at
+  x = baseline().
+  \param reference baseline
+  \sa QwtPlotCurve::setBrush(), QwtPlotCurve::setStyle(), QwtPlotCurve::setCurveAttribute()
+*/
+void QwtPlotCurve::setBaseline(double reference)
+{
+    if ( d_data->reference != reference )
+    {
+        d_data->reference = reference;
+        itemChanged();
+    }
+}
+
+/*!
+    \brief Return the value of the baseline
+    \sa QwtPlotCurve::setBaseline
+*/
+double QwtPlotCurve::baseline() const 
+{ 
+    return d_data->reference; 
+}
+
+/*!
+  Return the size of the data arrays
+*/
+int QwtPlotCurve::dataSize() const
+{
+    return d_xy->size();
+}
+
+int QwtPlotCurve::closestPoint(const QPoint &pos, double *dist) const
+{
+    if ( plot() == NULL || dataSize() <= 0 )
+        return -1;
+
+    const QwtScaleMap xMap = plot()->canvasMap(xAxis());
+    const QwtScaleMap yMap = plot()->canvasMap(yAxis());
+
+    int index = -1;
+    double dmin = 1.0e10;
+
+    for (int i=0; i < dataSize(); i++)
+    {
+        const double cx = xMap.xTransform(x(i)) - pos.x();
+        const double cy = yMap.xTransform(y(i)) - pos.y();
+
+        const double f = qwtSqr(cx) + qwtSqr(cy);
+        if (f < dmin)
+        {
+            index = i;
+            dmin = f;
+        }
+    }
+    if ( dist )
+        *dist = sqrt(dmin);
+
+    return index;
+}
+
+void QwtPlotCurve::updateLegend(QwtLegend *legend) const
+{
+    if ( !legend )
+        return;
+
+    QwtPlotItem::updateLegend(legend);
+
+    QWidget *widget = legend->find(this);
+    if ( !widget || !widget->inherits("QwtLegendItem") )
+        return;
+
+    QwtLegendItem *legendItem = (QwtLegendItem *)widget;
+
+#if QT_VERSION < 0x040000
+    const bool doUpdate = legendItem->isUpdatesEnabled();
+#else
+    const bool doUpdate = legendItem->updatesEnabled();
+#endif
+    legendItem->setUpdatesEnabled(false);
+
+    const int policy = legend->displayPolicy();
+
+    if (policy == QwtLegend::Fixed)
+    {
+        int mode = legend->identifierMode();
+
+        if (mode & QwtLegendItem::ShowLine)
+            legendItem->setCurvePen(pen());
+
+        if (mode & QwtLegendItem::ShowSymbol)
+            legendItem->setSymbol(symbol());
+
+        if (mode & QwtLegendItem::ShowText)
+            legendItem->setText(title());
+        else
+            legendItem->setText(QwtText());
+
+        legendItem->setIdentifierMode(mode);
+    }
+    else if (policy == QwtLegend::Auto)
+    {
+        int mode = 0;
+
+        if (QwtPlotCurve::NoCurve != style())
+        {
+            legendItem->setCurvePen(pen());
+            mode |= QwtLegendItem::ShowLine;
+        }
+        if (QwtSymbol::None != symbol().style())
+        {
+            legendItem->setSymbol(symbol());
+            mode |= QwtLegendItem::ShowSymbol;
+        }
+        if ( !title().isEmpty() )
+        {
+            legendItem->setText(title());
+            mode |= QwtLegendItem::ShowText;
+        }
+        else
+        {
+            legendItem->setText(QwtText());
+        }
+        legendItem->setIdentifierMode(mode);
+    }
+
+    legendItem->setUpdatesEnabled(doUpdate);
+    legendItem->update();
+}
diff --git a/src/qwt/qwt_plot_dict.cpp b/src/qwt/qwt_plot_dict.cpp
new file mode 100644
index 0000000..298ea8e
--- /dev/null
+++ b/src/qwt/qwt_plot_dict.cpp
@@ -0,0 +1,185 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include "qwt_plot_dict.h"
+
+class QwtPlotDict::PrivateData
+{
+public:
+
+#if QT_VERSION < 0x040000
+    class ItemList: public QValueList<QwtPlotItem *>
+#else
+    class ItemList: public QList<QwtPlotItem *>
+#endif
+    {
+    public:
+        void insertItem(QwtPlotItem *item)
+        {
+            if ( item == NULL )
+                return;
+
+            // Unfortunately there is no inSort operation
+            // for lists in Qt4. The implementation below
+            // is slow, but there shouldn't be many plot items.
+
+#ifdef __GNUC__
+#warning binary search missing
+#endif
+
+#if QT_VERSION < 0x040000
+            QValueListIterator<QwtPlotItem *> it;
+#else
+            QList<QwtPlotItem *>::Iterator it;
+#endif
+            for ( it = begin(); it != end(); ++it )
+            {
+                if ( *it == item )
+                    return;
+
+                if ( (*it)->z() > item->z() )
+                {
+                    insert(it, item);
+                    return;
+                }
+            }
+            append(item);
+        }
+
+        void removeItem(QwtPlotItem *item)
+        {
+            if ( item == NULL )
+                return;
+
+            int i = 0;
+
+#if QT_VERSION < 0x040000
+            QValueListIterator<QwtPlotItem *> it;
+#else
+            QList<QwtPlotItem *>::Iterator it;
+#endif
+            for ( it = begin(); it != end(); ++it )
+            {
+                if ( item == *it )
+                {
+#if QT_VERSION < 0x040000
+                    remove(it);
+#else
+                    removeAt(i);
+#endif
+                    return;
+                }
+                i++;
+            }
+        }
+    };
+
+    ItemList itemList;
+    bool autoDelete;
+};
+
+/*! 
+   Constructor 
+
+   Auto deletion is enabled.
+   \sa setAutoDelete, attachItem
+*/
+QwtPlotDict::QwtPlotDict()
+{
+    d_data = new QwtPlotDict::PrivateData;
+    d_data->autoDelete = true;
+}
+
+/*! 
+   Destructor
+
+   If autoDelete is on, all attached items will be deleted
+   \sa setAutoDelete, autoDelete, attachItem
+*/
+QwtPlotDict::~QwtPlotDict()
+{
+    detachItems(QwtPlotItem::Rtti_PlotItem, d_data->autoDelete);
+    delete d_data;
+}
+
+/*!
+   En/Disable Auto deletion
+
+   If Auto deletion is on all attached plot items will be deleted
+   in the destructor of QwtPlotDict. The default value is on.
+
+   \sa autoDelete, attachItem
+*/
+void QwtPlotDict::setAutoDelete(bool autoDelete)
+{
+    d_data->autoDelete = autoDelete;
+}
+
+/*!
+   \return true if auto deletion is enabled
+   \sa setAutoDelete, attachItem
+*/
+bool QwtPlotDict::autoDelete() const
+{
+    return d_data->autoDelete;
+}
+
+/*!
+   Attach/Detach a plot item
+
+   Attached items will be deleted in the destructor,
+   if auto deletion is enabled (default). Manually detached
+   items are not deleted.
+
+   \param item Plot item to attach/detach
+   \ on If true attach, else detach the item
+
+   \sa setAutoDelete, ~QwtPlotDict
+*/
+void QwtPlotDict::attachItem(QwtPlotItem *item, bool on)
+{
+    if ( on )
+        d_data->itemList.insertItem(item);
+    else
+        d_data->itemList.removeItem(item);
+}
+
+/*!
+   Detach items from the dictionary
+
+   \param rtti In case of QwtPlotItem::Rtti_PlotItem detach all items 
+               otherwise only those items of the type rtti.
+   \param autoDelete If true, delete all detached items
+*/
+void QwtPlotDict::detachItems(int rtti, bool autoDelete)
+{
+    PrivateData::ItemList list = d_data->itemList;
+    QwtPlotItemIterator it = list.begin();
+    while ( it != list.end() )
+    {
+        QwtPlotItem *item = *it;
+
+        ++it; // increment before removing item from the list
+
+        if ( rtti == QwtPlotItem::Rtti_PlotItem || item->rtti() == rtti )
+        {
+            item->attach(NULL);
+            if ( autoDelete )
+                delete item;
+        }
+    }
+}
+
+//! \return List of all attached plot items
+const QwtPlotItemList &QwtPlotDict::itemList() const
+{
+    return d_data->itemList;
+}
diff --git a/src/qwt/qwt_plot_grid.cpp b/src/qwt/qwt_plot_grid.cpp
new file mode 100644
index 0000000..dc26242
--- /dev/null
+++ b/src/qwt/qwt_plot_grid.cpp
@@ -0,0 +1,349 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qpainter.h>
+#include <qpen.h>
+#include "qwt_painter.h"
+#include "qwt_scale_map.h"
+#include "qwt_scale_div.h"
+#include "qwt_plot_grid.h"
+
+class QwtPlotGrid::PrivateData
+{
+public:
+    PrivateData():
+        xEnabled(true),
+        yEnabled(true),
+        xMinEnabled(false),
+        yMinEnabled(false)
+    {
+    }
+
+    bool xEnabled;
+    bool yEnabled;
+    bool xMinEnabled;
+    bool yMinEnabled;
+
+    QwtScaleDiv sdx;
+    QwtScaleDiv sdy;
+
+    QPen majPen;
+    QPen minPen;
+};
+
+//! Enables major grid, disables minor grid
+QwtPlotGrid::QwtPlotGrid()
+{
+    d_data = new PrivateData;
+    setZ(10.0);
+}
+
+//! dtor
+QwtPlotGrid::~QwtPlotGrid()
+{
+    delete d_data;
+}
+
+int QwtPlotGrid::rtti() const
+{
+    return QwtPlotItem::Rtti_PlotGrid;
+}
+
+/*!
+  \brief Enable or disable vertical gridlines
+  \param tf Enable (true) or disable
+
+  \sa Minor gridlines can be enabled or disabled with
+      QwtPlotGrid::enableXMin()
+*/
+void QwtPlotGrid::enableX(bool tf)
+{
+    if ( d_data->xEnabled != tf )
+    {
+        d_data->xEnabled = tf;
+        gridChanged();
+    }
+}
+
+/*!
+  \brief Enable or disable horizontal gridlines
+  \param tf Enable (true) or disable
+  \sa Minor gridlines can be enabled or disabled with QwtPlotGrid::enableYMin()
+*/
+void QwtPlotGrid::enableY(bool tf)
+{
+    if ( d_data->yEnabled != tf )
+    {
+        d_data->yEnabled = tf;  
+        gridChanged();
+    }
+}
+
+/*!
+  \brief Enable or disable  minor vertical gridlines.
+  \param tf Enable (true) or disable
+  \sa QwtPlotGrid::enableX()
+*/
+void QwtPlotGrid::enableXMin(bool tf)
+{
+    if ( d_data->xMinEnabled != tf )
+    {
+        d_data->xMinEnabled = tf;
+        gridChanged();
+    }
+}
+
+/*!
+  \brief Enable or disable minor horizontal gridlines
+  \param tf Enable (true) or disable
+  \sa QwtPlotGrid::enableY()
+*/
+void QwtPlotGrid::enableYMin(bool tf)
+{
+    if ( d_data->yMinEnabled != tf )
+    {
+        d_data->yMinEnabled = tf;
+        gridChanged();
+    }
+}
+
+/*!
+  \brief Assign an x axis scale division
+  \param sx Scale division
+  \warning QwtPlotGrid uses implicit sharing (see Qt Manual) for
+  the scale divisions.
+  \sa QwtScaleDiv
+*/
+void QwtPlotGrid::setXDiv(const QwtScaleDiv &sx)
+{
+    if ( d_data->sdx != sx )
+    {
+        d_data->sdx = sx;
+        gridChanged();
+    }
+}
+
+/*!
+  \brief Assign a y axis division
+  \param sy Scale division
+  \warning QwtPlotGrid uses implicit sharing (see Qt Manual) for
+  the scale divisions.
+  \sa QwtScaleDiv
+*/
+void QwtPlotGrid::setYDiv(const QwtScaleDiv &sy)
+{
+    if ( d_data->sdy != sy )
+    {
+        d_data->sdy = sy;    
+        gridChanged();
+    }
+}
+
+/*!
+  \brief Assign a pen for both major and minor gridlines
+  \param p Pen
+*/
+void QwtPlotGrid::setPen(const QPen &p)
+{
+    if ( d_data->majPen != p || d_data->minPen != p )
+    {
+        d_data->majPen = p;
+        d_data->minPen = p;
+        gridChanged();
+    }
+}
+
+/*!
+  \brief Assign a pen for the major gridlines
+  \param p Pen
+*/
+void QwtPlotGrid::setMajPen(const QPen &p)
+{
+    if ( d_data->majPen != p )
+    {
+        d_data->majPen = p;
+        gridChanged();
+    }
+}
+
+/*!
+  \brief Assign a pen for the minor gridlines
+  \param p Pen
+*/
+void QwtPlotGrid::setMinPen(const QPen &p)
+{
+    if ( d_data->minPen != p )
+    {
+        d_data->minPen = p;  
+        gridChanged();
+    }
+}
+
+/*!
+  \brief Draw the grid
+  
+  The grid is drawn into the bounding rectangle such that 
+  gridlines begin and end at the rectangle's borders. The X and Y
+  maps are used to map the scale divisions into the drawing region
+  screen.
+  \param painter  Painter
+  \param mx X axis map
+  \param my Y axis 
+  \param r Contents rect of the plot canvas
+*/
+void QwtPlotGrid::draw(QPainter *painter, 
+    const QwtScaleMap &mx, const QwtScaleMap &my,
+    const QRect &r) const
+{
+    //  draw minor gridlines
+    painter->setPen(d_data->minPen);
+    
+    if (d_data->xEnabled && d_data->xMinEnabled)
+    {
+        drawLines(painter, r, Qt::Vertical, mx, 
+            d_data->sdx.ticks(QwtScaleDiv::MinorTick));
+        drawLines(painter, r, Qt::Vertical, mx, 
+            d_data->sdx.ticks(QwtScaleDiv::MediumTick));
+    }
+
+    if (d_data->yEnabled && d_data->yMinEnabled)
+    {
+        drawLines(painter, r, Qt::Horizontal, my, 
+            d_data->sdy.ticks(QwtScaleDiv::MinorTick));
+        drawLines(painter, r, Qt::Horizontal, my, 
+            d_data->sdy.ticks(QwtScaleDiv::MediumTick));
+    }
+
+    //  draw major gridlines
+    painter->setPen(d_data->majPen);
+    
+    if (d_data->xEnabled)
+    {
+        drawLines(painter, r, Qt::Vertical, mx,
+            d_data->sdx.ticks(QwtScaleDiv::MajorTick));
+    }
+
+    if (d_data->yEnabled)
+    {
+        drawLines(painter, r, Qt::Horizontal, my,
+            d_data->sdy.ticks(QwtScaleDiv::MajorTick));
+    }
+}
+
+void QwtPlotGrid::drawLines(QPainter *painter, const QRect &rect,
+    Qt::Orientation orientation, const QwtScaleMap &map, 
+    const QwtTickList &values) const
+{
+    const int x1 = rect.left();
+    const int x2 = rect.right();
+    const int y1 = rect.top();
+    const int y2 = rect.bottom();
+
+    for (uint i = 0; i < (uint)values.count(); i++)
+    {
+        const int value = map.transform(values[i]);
+        if ( orientation == Qt::Horizontal )
+        {
+            if ((value >= y1) && (value <= y2))
+                QwtPainter::drawLine(painter, x1, value, x2, value);
+        }
+        else
+        {
+            if ((value >= x1) && (value <= x2))
+                QwtPainter::drawLine(painter, value, y1, value, y2);
+        }
+    }
+}
+
+/*!
+  \return the pen for the major gridlines
+  \sa QwtPlotGrid::setMinPen, QwtPlotGrid::setPen
+*/
+const QPen &QwtPlotGrid::majPen() const 
+{ 
+    return d_data->majPen; 
+}
+
+/*!
+  \return the pen for the minor gridlines
+  \sa QwtPlotGrid::setMinPen, QwtPlotGrid::setPen
+*/
+const QPen &QwtPlotGrid::minPen() const 
+{ 
+    return d_data->minPen; 
+}
+  
+/*!
+  \return true if vertical gridlines are enabled
+  \sa QwtPlotGrid::enableX
+*/
+bool QwtPlotGrid::xEnabled() const
+{ 
+    return d_data->xEnabled; 
+}
+
+/*!
+  \return true if minor vertical gridlines are enabled
+  \sa QwtPlotGrid::enableXMin
+*/
+bool QwtPlotGrid::xMinEnabled() const 
+{ 
+    return d_data->xMinEnabled; 
+}
+
+/*!
+  \return true if horizontal gridlines are enabled
+  \sa QwtPlotGrid::enableY
+*/
+bool QwtPlotGrid::yEnabled() const 
+{ 
+    return d_data->yEnabled; 
+}
+
+/*!
+  \return true if minor horizontal gridlines are enabled
+  \sa QwtPlotGrid::enableYMin
+*/
+bool QwtPlotGrid::yMinEnabled() const 
+{
+    return d_data->yMinEnabled; 
+}
+
+  
+/*! \return the scale division of the x axis */
+const QwtScaleDiv &QwtPlotGrid::xScaleDiv() const 
+{ 
+    return d_data->sdx; 
+}
+
+/*! \return the scale division of the y axis */
+const QwtScaleDiv &QwtPlotGrid::yScaleDiv() const 
+{ 
+    return d_data->sdy; 
+}
+ 
+void QwtPlotGrid::updateScaleDiv(const QwtScaleDiv& xDiv,
+    const QwtScaleDiv& yDiv)
+{
+    setXDiv(xDiv);
+    setYDiv(yDiv);
+}
+
+/*!
+  \brief Notify a change of attributes
+
+  This virtual function is called when an attribute of the grid
+  has changed. It can be redefined by derived classes. The
+  default implementation does nothing.
+*/
+void QwtPlotGrid::gridChanged() 
+{
+    itemChanged();
+}
+
diff --git a/src/qwt/qwt_plot_item.cpp b/src/qwt/qwt_plot_item.cpp
new file mode 100644
index 0000000..6227782
--- /dev/null
+++ b/src/qwt/qwt_plot_item.cpp
@@ -0,0 +1,295 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_plot.h"
+#include "qwt_legend.h"
+#include "qwt_legend_item.h"
+#include "qwt_plot_item.h"
+
+class QwtPlotItem::PrivateData
+{
+public:
+    PrivateData():
+        plot(NULL),
+        isVisible(true),
+        attributes(0),
+#if QT_VERSION >= 0x040000
+        renderHints(0),
+#endif
+        z(0.0),
+        xAxis(QwtPlot::xBottom),
+        yAxis(QwtPlot::yLeft)
+    {
+    }
+
+    mutable QwtPlot *plot;
+
+    bool isVisible;
+    int attributes;
+#if QT_VERSION >= 0x040000
+    int renderHints;
+#endif
+    double z;
+
+    int xAxis;
+    int yAxis;
+};
+
+//! Constructor
+QwtPlotItem::QwtPlotItem()
+{
+    d_data = new PrivateData;
+}
+
+//! Destroy the QwtPlotItem
+QwtPlotItem::~QwtPlotItem()
+{
+    attach(NULL);
+    delete d_data;
+}
+
+/*! 
+  Attach the item to a plot
+*/
+void QwtPlotItem::attach(QwtPlot *plot)
+{
+    if ( plot == d_data->plot )
+        return;
+
+    // remove the item from the previous plot
+
+    if ( d_data->plot )
+    {
+        if ( d_data->plot->legend() )
+        {
+            QWidget *legendItem = d_data->plot->legend()->find(this);
+            if ( legendItem )
+                delete legendItem; 
+        }
+
+        d_data->plot->attachItem(this, false);
+
+        if ( d_data->plot->autoReplot() )
+            d_data->plot->update();
+    }
+
+    d_data->plot = plot;
+
+    if ( d_data->plot )
+    {
+        // insert the item into the current plot
+
+        d_data->plot->attachItem(this, true);
+        itemChanged();
+    }
+}
+
+int QwtPlotItem::rtti() const
+{
+    return Rtti_PlotItem;
+}
+
+//! Return attached plot
+QwtPlot *QwtPlotItem::plot() const 
+{ 
+    return d_data->plot; 
+}
+
+double QwtPlotItem::z() const 
+{ 
+    return d_data->z; 
+}
+
+void QwtPlotItem::setZ(double z) 
+{ 
+    if ( d_data->z != z )
+    {
+        d_data->z = z; 
+        itemChanged();
+    }
+}
+
+void QwtPlotItem::setItemAttribute(ItemAttribute attribute, bool on)
+{
+    if ( bool(d_data->attributes & attribute) != on )
+    {
+        if ( on )
+            d_data->attributes |= attribute;
+        else
+            d_data->attributes &= ~attribute;
+
+        itemChanged();
+    }
+}
+
+bool QwtPlotItem::testItemAttribute(ItemAttribute attribute) const
+{
+    return d_data->attributes & attribute;
+}
+
+#if QT_VERSION >= 0x040000
+
+void QwtPlotItem::setRenderHint(RenderHint hint, bool on)
+{
+    if ( (d_data->renderHints & hint) != on )
+    {
+        if ( on )
+            d_data->renderHints |= hint;
+        else
+            d_data->renderHints &= ~hint;
+
+        itemChanged();
+    }
+}
+
+bool QwtPlotItem::testRenderHint(RenderHint hint) const
+{
+    return (d_data->renderHints & hint);
+}
+
+#endif
+
+void QwtPlotItem::show()
+{
+    setVisible(true);
+}
+
+void QwtPlotItem::hide()
+{
+    setVisible(false);
+}
+
+/*! 
+    \sa QwtPlotItem::setVisible
+*/
+void QwtPlotItem::setVisible(bool on) 
+{ 
+    if ( on != d_data->isVisible )
+    {
+        d_data->isVisible = on; 
+        itemChanged(); 
+    }
+}
+
+/*! 
+    \return true if enabled
+    \sa QwtPlotItem::setEnabled
+*/
+bool QwtPlotItem::isVisible() const
+{ 
+    return d_data->isVisible; 
+}
+
+//! Call QwtPlot::autoRefresh for the parent plot
+void QwtPlotItem::itemChanged()
+{
+    if ( d_data->plot )
+    {
+        if ( d_data->plot->legend() )
+            updateLegend(d_data->plot->legend());
+
+        d_data->plot->autoRefresh();
+    }
+}
+
+//!  Set x and y axis
+void QwtPlotItem::setAxis(int xAxis, int yAxis)
+{
+    if (xAxis == QwtPlot::xBottom || xAxis == QwtPlot::xTop )
+       d_data->xAxis = xAxis;
+
+    if (yAxis == QwtPlot::yLeft || yAxis == QwtPlot::yRight )
+       d_data->yAxis = yAxis;
+
+    itemChanged();    
+}
+
+//!  Set y axis
+void QwtPlotItem::setXAxis(int axis)
+{
+    if (axis == QwtPlot::xBottom || axis == QwtPlot::xTop )
+    {
+       d_data->xAxis = axis;
+       itemChanged();    
+    }
+}
+
+//!  Set y axis
+void QwtPlotItem::setYAxis(int axis)
+{
+    if (axis == QwtPlot::yLeft || axis == QwtPlot::yRight )
+    {
+       d_data->yAxis = axis;
+       itemChanged();   
+    }
+}
+
+//! Return xAxis
+int QwtPlotItem::xAxis() const 
+{ 
+    return d_data->xAxis; 
+}
+
+//! Return yAxis
+int QwtPlotItem::yAxis() const 
+{ 
+    return d_data->yAxis; 
+}
+
+QwtDoubleRect QwtPlotItem::boundingRect() const
+{
+    return QwtDoubleRect(1.0, 1.0, -2.0, -2.0); // invalid
+}
+
+QWidget *QwtPlotItem::legendItem() const
+{
+    return new QwtLegendItem;
+}
+
+void QwtPlotItem::updateLegend(QwtLegend *legend) const
+{
+    if ( !legend )
+        return;
+
+    QWidget *lgdItem = legend->find(this);
+    if ( testItemAttribute(QwtPlotItem::Legend) )
+    {
+        if ( lgdItem == NULL )
+        {
+            lgdItem = legendItem();
+            if ( lgdItem )
+            {
+                if ( lgdItem->inherits("QwtLegendItem") )
+                {
+                    QwtLegendItem *label = (QwtLegendItem *)lgdItem;
+                    label->setItemMode(legend->itemMode());
+
+                    if ( d_data->plot )
+                    {
+                        QObject::connect(label, SIGNAL(clicked()), 
+                            d_data->plot, SLOT(legendItemClicked()));
+                        QObject::connect(label, SIGNAL(checked(bool)), 
+                            d_data->plot, SLOT(legendItemChecked(bool)));
+                    }
+                }
+                legend->insert(this, lgdItem);
+            }
+        }
+    }
+    else
+    {
+        delete lgdItem;
+    }
+}
+
+void QwtPlotItem::updateScaleDiv(const QwtScaleDiv &,
+    const QwtScaleDiv &) 
+{ 
+}
+
diff --git a/src/qwt/qwt_plot_layout.cpp b/src/qwt/qwt_plot_layout.cpp
new file mode 100644
index 0000000..9cda383
--- /dev/null
+++ b/src/qwt/qwt_plot_layout.cpp
@@ -0,0 +1,1165 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qscrollbar.h>
+#include "qwt_rect.h"
+#include "qwt_text.h"
+#include "qwt_text_label.h"
+#include "qwt_plot_canvas.h"
+#include "qwt_scale_widget.h"
+#include "qwt_legend.h"
+#include "qwt_plot_layout.h"
+
+class QwtPlotLayout::LayoutData
+{
+public:
+    void init(const QwtPlot *, const QRect &rect);
+
+    struct t_legendData
+    {
+        int frameWidth;
+        int vScrollBarWidth;
+        int hScrollBarHeight;
+        QSize hint;
+    } legend;
+    
+    struct t_titleData
+    {
+        QwtText text;
+        int frameWidth;
+    } title;
+
+    struct t_scaleData
+    {
+        bool isEnabled;
+        const QwtScaleWidget *scaleWidget;
+        QFont scaleFont;
+        int start;
+        int end;
+        int baseLineOffset;
+        int tickOffset; 
+        int dimWithoutTitle;
+    } scale[QwtPlot::axisCnt];
+
+    struct t_canvasData
+    {
+        int frameWidth;
+    } canvas;
+};
+
+/*
+  Extract all layout relevant data from the plot components
+*/
+
+void QwtPlotLayout::LayoutData::init(const QwtPlot *plot, const QRect &rect)
+{
+    // legend
+
+    if ( plot->legend() )
+    {
+        legend.frameWidth = plot->legend()->frameWidth();
+        legend.vScrollBarWidth = 
+            plot->legend()->verticalScrollBar()->sizeHint().width();
+        legend.hScrollBarHeight = 
+            plot->legend()->horizontalScrollBar()->sizeHint().height();
+
+        const QSize hint = plot->legend()->sizeHint();
+
+        int w = qwtMin(hint.width(), rect.width());
+        int h = plot->legend()->heightForWidth(w);
+        if ( h == 0 )
+            h = hint.height();
+
+        if ( h > rect.height() )
+            w += legend.vScrollBarWidth;
+
+        legend.hint = QSize(w, h);
+    }
+
+    // title 
+
+    title.frameWidth = 0;
+
+    if (plot->titleLabel() && !plot->titleLabel()->text().isEmpty())
+    {
+        const QwtTextLabel *label = plot->titleLabel();
+        title.text = label->text(); 
+        if ( !(title.text.paintAttributes() & QwtText::PaintUsingTextFont))
+            title.text.setFont(label->font());
+        
+        title.frameWidth = plot->titleLabel()->frameWidth();
+    }
+
+    // scales 
+
+    for (int axis = 0; axis < QwtPlot::axisCnt; axis++ )
+    {
+        if ( plot->axisEnabled(axis) )
+        {
+            const QwtScaleWidget *scaleWidget = plot->axisWidget(axis);
+
+            scale[axis].isEnabled = true;
+
+            scale[axis].scaleWidget = scaleWidget;
+
+            scale[axis].scaleFont = scaleWidget->font();
+
+            scale[axis].start = scaleWidget->startBorderDist();
+            scale[axis].end = scaleWidget->endBorderDist();
+
+            scale[axis].baseLineOffset = scaleWidget->baseLineDist();
+            scale[axis].tickOffset = scaleWidget->baseLineDist();
+            if ( scaleWidget->scaleDraw()->hasComponent(
+                QwtAbstractScaleDraw::Ticks) )
+            {
+                scale[axis].tickOffset += 
+                    (int)scaleWidget->scaleDraw()->majTickLength();
+            }
+
+            scale[axis].dimWithoutTitle = scaleWidget->dimForLength(
+                QWIDGETSIZE_MAX, scale[axis].scaleFont);
+
+            if ( !scaleWidget->title().isEmpty() )
+            {
+                scale[axis].dimWithoutTitle -= 
+                    scaleWidget->titleHeightForWidth(QWIDGETSIZE_MAX);
+            }
+        }
+        else
+        {
+            scale[axis].isEnabled = false;
+            scale[axis].start = 0;
+            scale[axis].end = 0;
+            scale[axis].baseLineOffset = 0;
+            scale[axis].tickOffset = 0;
+            scale[axis].dimWithoutTitle = 0;
+        }
+    }
+
+    // canvas 
+
+    canvas.frameWidth = plot->canvas()->frameWidth();
+}
+
+class QwtPlotLayout::PrivateData
+{
+public:
+    PrivateData():
+        margin(0),
+        spacing(5),
+        alignCanvasToScales(false)
+    {
+    }
+
+    QRect titleRect;
+    QRect legendRect;
+    QRect scaleRect[QwtPlot::axisCnt];
+    QRect canvasRect;
+
+    QwtPlotLayout::LayoutData layoutData;
+
+    QwtPlot::LegendPosition legendPos;
+    double legendRatio;
+    unsigned int margin;
+    unsigned int spacing;
+    unsigned int canvasMargin[QwtPlot::axisCnt];
+    bool alignCanvasToScales;
+};
+
+/*!
+  \brief Constructor
+ */
+
+QwtPlotLayout::QwtPlotLayout()
+{
+    d_data = new PrivateData;
+
+    setLegendPosition(QwtPlot::BottomLegend);
+    setCanvasMargin(4);
+
+    invalidate();
+}
+
+//! Destructor
+QwtPlotLayout::~QwtPlotLayout()
+{
+    delete d_data;
+}
+
+/*!
+  Change the margin of the plot. The margin is the space
+  around all components.
+ 
+  \param margin new margin
+  \sa QwtPlotLayout::margin(), QwtPlotLayout::setSpacing(),
+      QwtPlot::setMargin()
+*/
+
+void QwtPlotLayout::setMargin(int margin)
+{
+    if ( margin < 0 )
+        margin = 0;
+    d_data->margin = margin;
+}
+
+/*!
+    \return margin
+    \sa QwtPlotLayout::setMargin(), QwtPlotLayout::spacing(), 
+        QwtPlot::margin()
+*/
+
+int QwtPlotLayout::margin() const
+{
+    return d_data->margin;
+}
+
+/*!
+  Change a margin of the canvas. The margin is the space
+  above/below the scale ticks. A negative margin will
+  be set to -1, excluding the borders of the scales.
+ 
+  \param margin New margin
+  \param axis One of QwtPlot::Axis. Specifies where the position of the margin. 
+              -1 means margin at all borders.
+  \sa QwtPlotLayout::canvasMargin() 
+
+  \warning The canvas will have no effect when alignCanvasToScales is true
+*/
+
+void QwtPlotLayout::setCanvasMargin(int margin, int axis)
+{
+    if ( margin < -1 )
+        margin = -1;
+
+    if ( axis == -1 )
+    {
+        for (axis = 0; axis < QwtPlot::axisCnt; axis++)
+            d_data->canvasMargin[axis] = margin;
+    }
+    else if ( axis >= 0 || axis < QwtPlot::axisCnt )
+        d_data->canvasMargin[axis] = margin;
+}
+
+/*!
+    \return Margin around the scale tick borders
+    \sa QwtPlotLayout::setCanvasMargin()
+*/
+
+int QwtPlotLayout::canvasMargin(int axis) const
+{
+    if ( axis < 0 || axis >= QwtPlot::axisCnt )
+        return 0;
+
+    return d_data->canvasMargin[axis];
+}
+
+
+/*!
+  Change the align-canvas-to-axis-scales setting. The canvas may:
+  - extend beyond the axis scale ends to maximize its size,
+  - align with the axis scale ends to control its size.
+
+  \param alignCanvasToScales New align-canvas-to-axis-scales setting
+
+  \sa QwtPlotLayout::alignCanvasToTicks, QwtPlotLayout::setCanvasMargin() 
+  \note In this context the term 'scale' means the backbone of a scale.
+  \warning In case of alignCanvasToScales == true canvasMargin will have 
+           no effect
+*/
+
+void QwtPlotLayout::setAlignCanvasToScales(bool alignCanvasToScales)
+{
+    d_data->alignCanvasToScales = alignCanvasToScales;
+}
+
+/*!
+  Return the align-canvas-to-axis-scales setting. The canvas may:
+  - extend beyond the axis scale ends to maximize its size
+  - align with the axis scale ends to control its size.
+
+  \return align-canvas-to-axis-scales setting
+  \sa QwtPlotLayout::setAlignCanvasToScales, QwtPlotLayout::setCanvasMargin() 
+  \note In this context the term 'scale' means the backbone of a scale.
+*/
+
+bool QwtPlotLayout::alignCanvasToScales() const
+{
+    return d_data->alignCanvasToScales;
+}
+
+/*!
+  Change the spacing of the plot. The spacing is the distance
+  between the plot components.
+ 
+  \param spacing new spacing
+  \sa QwtPlotLayout::setMargin(), QwtPlotLayout::spacing() 
+*/
+
+void QwtPlotLayout::setSpacing(int spacing)
+{
+    d_data->spacing = qwtMax(0, spacing);
+}
+
+/*!
+  \return spacing
+  \sa QwtPlotLayout::margin(), QwtPlotLayout::setSpacing() 
+*/
+int QwtPlotLayout::spacing() const
+{
+    return d_data->spacing;
+}
+
+/*!
+  \brief Specify the position of the legend
+  \param pos The legend's position. Valid values are \c QwtPlot::LeftLegend,
+           \c QwtPlot::RightLegend, \c QwtPlot::TopLegend, \c QwtPlotLegend::Bottom.
+  \param ratio Ratio between legend and the bounding rect 
+               of title, canvas and axes. The legend will be shrinked
+               if it would need more space than the given ratio.
+               The ratio is limited to ]0.0 .. 1.0]. In case of <= 0.0
+               it will be reset to the default ratio.
+               The default vertical/horizontal ratio is 0.33/0.5. 
+               
+  \sa QwtPlot::setLegendPosition()
+*/
+
+void QwtPlotLayout::setLegendPosition(QwtPlot::LegendPosition pos, double ratio)
+{
+    if ( ratio > 1.0 )
+        ratio = 1.0;
+
+    switch(pos)
+    {
+        case QwtPlot::TopLegend:
+        case QwtPlot::BottomLegend:
+            if ( ratio <= 0.0 )
+                ratio = 0.33;
+            d_data->legendRatio = ratio;
+            d_data->legendPos = pos;
+            break;
+        case QwtPlot::LeftLegend:
+        case QwtPlot::RightLegend:
+            if ( ratio <= 0.0 )
+                ratio = 0.5;
+            d_data->legendRatio = ratio;
+            d_data->legendPos = pos;
+            break;
+        default:
+            break;
+    }
+}
+
+/*!
+  \brief Specify the position of the legend
+  \param pos The legend's position. Valid values are \c QwtPlot::LeftLegend,
+           \c QwtPlot::RightLegend, \c QwtPlot::TopLegend, \c QwtPlot::BottomLegend.
+               
+  \sa QwtPlot::setLegendPosition()
+*/
+
+void QwtPlotLayout::setLegendPosition(QwtPlot::LegendPosition pos)
+{
+    setLegendPosition(pos, 0.0);
+}
+
+/*!
+  \return Position of the legend
+  \sa QwtPlotLayout::setLegendPosition(), QwtPlot::setLegendPosition(),
+      QwtPlot::legendPosition()
+*/
+
+QwtPlot::LegendPosition QwtPlotLayout::legendPosition() const
+{
+    return d_data->legendPos;
+}
+
+/*!
+  Specify the relative size of the legend in the plot
+  \param ratio Ratio between legend and the bounding rect 
+               of title, canvas and axes. The legend will be shrinked
+               if it would need more space than the given ratio.
+               The ratio is limited to ]0.0 .. 1.0]. In case of <= 0.0
+               it will be reset to the default ratio.
+               The default vertical/horizontal ratio is 0.33/0.5. 
+               
+  \sa QwtPlot::setLegendPosition()
+*/
+void QwtPlotLayout::setLegendRatio(double ratio)
+{
+    setLegendPosition(legendPosition(), ratio);
+}
+
+/*!
+  \return The relative size of the legend in the plot.
+  \sa QwtPlotLayout::setLegendPos(), QwtPlot::setLegendPos()
+*/
+
+double QwtPlotLayout::legendRatio() const
+{
+    return d_data->legendRatio;
+}
+
+/*!
+  \return Geometry for the title
+  \sa QwtPlotLayout::activate(), QwtPlotLayout::invalidate()
+*/
+
+const QRect &QwtPlotLayout::titleRect() const
+{
+    return d_data->titleRect;
+}
+
+/*!
+  \return Geometry for the legend
+  \sa QwtPlotLayout::activate(), QwtPlotLayout::invalidate()
+*/
+
+const QRect &QwtPlotLayout::legendRect() const
+{
+    return d_data->legendRect;
+}
+
+/*!
+  \param axis Axis index
+  \return Geometry for the scale
+  \sa QwtPlotLayout::activate(), QwtPlotLayout::invalidate()
+*/
+
+const QRect &QwtPlotLayout::scaleRect(int axis) const
+{
+    if ( axis < 0 || axis >= QwtPlot::axisCnt )
+    {
+        static QRect dummyRect;
+        return dummyRect;
+    }
+    return d_data->scaleRect[axis];
+}
+
+/*!
+  \return Geometry for the canvas
+  \sa QwtPlotLayout::activate(), QwtPlotLayout::invalidate()
+*/
+
+const QRect &QwtPlotLayout::canvasRect() const
+{
+    return d_data->canvasRect;
+}
+
+/*!
+  Invalidate the geometry of all components. 
+  \sa QwtPlotLayout::activate()
+*/
+void QwtPlotLayout::invalidate()
+{
+    d_data->titleRect = d_data->legendRect = d_data->canvasRect = QRect();
+    for (int axis = 0; axis < QwtPlot::axisCnt; axis++ )
+        d_data->scaleRect[axis] = QRect();
+}
+
+/*!  
+  \brief Return a minimum size hint
+  \sa QwtPlot::minimumSizeHint()
+*/
+
+QSize QwtPlotLayout::minimumSizeHint(const QwtPlot *plot) const
+{
+    class ScaleData
+    {
+    public:
+        ScaleData()
+        {
+            w = h = minLeft = minRight = tickOffset = 0;
+        }
+
+        int w;
+        int h;
+        int minLeft;
+        int minRight;
+        int tickOffset;
+    } scaleData[QwtPlot::axisCnt];
+
+    int canvasBorder[QwtPlot::axisCnt];
+
+    int axis;
+    for ( axis = 0; axis < QwtPlot::axisCnt; axis++ )
+    {
+        if ( plot->axisEnabled(axis) )
+        {
+            const QwtScaleWidget *scl = plot->axisWidget(axis);
+            ScaleData &sd = scaleData[axis];
+
+            const QSize hint = scl->minimumSizeHint();
+            sd.w = hint.width(); 
+            sd.h = hint.height(); 
+            scl->getBorderDistHint(sd.minLeft, sd.minRight);
+            sd.tickOffset = scl->baseLineDist();
+            if ( scl->scaleDraw()->hasComponent(QwtAbstractScaleDraw::Ticks) )
+                sd.tickOffset += scl->scaleDraw()->majTickLength();
+        }
+
+        canvasBorder[axis] = plot->canvas()->frameWidth() +
+            d_data->canvasMargin[axis] + 1;
+            
+    }
+
+
+    for ( axis = 0; axis < QwtPlot::axisCnt; axis++ )
+    {
+        ScaleData &sd = scaleData[axis];
+        if ( sd.w && (axis == QwtPlot::xBottom || axis == QwtPlot::xTop) )
+        {
+            if ( (sd.minLeft > canvasBorder[QwtPlot::yLeft]) 
+                && scaleData[QwtPlot::yLeft].w )
+            {
+                int shiftLeft = sd.minLeft - canvasBorder[QwtPlot::yLeft];
+                if ( shiftLeft > scaleData[QwtPlot::yLeft].w )
+                    shiftLeft = scaleData[QwtPlot::yLeft].w;
+
+                sd.w -= shiftLeft;
+            }
+            if ( (sd.minRight > canvasBorder[QwtPlot::yRight]) 
+                && scaleData[QwtPlot::yRight].w )
+            {
+                int shiftRight = sd.minRight - canvasBorder[QwtPlot::yRight];
+                if ( shiftRight > scaleData[QwtPlot::yRight].w )
+                    shiftRight = scaleData[QwtPlot::yRight].w;
+
+                sd.w -= shiftRight;
+            }
+        }
+
+        if ( sd.h && (axis == QwtPlot::yLeft || axis == QwtPlot::yRight) )
+        {
+            if ( (sd.minLeft > canvasBorder[QwtPlot::xBottom]) &&
+                scaleData[QwtPlot::xBottom].h )
+            {
+                int shiftBottom = sd.minLeft - canvasBorder[QwtPlot::xBottom];
+                if ( shiftBottom > scaleData[QwtPlot::xBottom].tickOffset )
+                    shiftBottom = scaleData[QwtPlot::xBottom].tickOffset;
+
+                sd.h -= shiftBottom;
+            }
+            if ( (sd.minLeft > canvasBorder[QwtPlot::xTop]) &&
+                scaleData[QwtPlot::xTop].h )
+            {
+                int shiftTop = sd.minRight - canvasBorder[QwtPlot::xTop];
+                if ( shiftTop > scaleData[QwtPlot::xTop].tickOffset )
+                    shiftTop = scaleData[QwtPlot::xTop].tickOffset;
+
+                sd.h -= shiftTop;
+            }
+        }
+    }
+
+    const QwtPlotCanvas *canvas = plot->canvas();
+
+    int w = scaleData[QwtPlot::yLeft].w + scaleData[QwtPlot::yRight].w
+        + qwtMax(scaleData[QwtPlot::xBottom].w, scaleData[QwtPlot::xTop].w)
+        + 2 * (canvas->frameWidth() + 1);
+    int h = scaleData[QwtPlot::xBottom].h + scaleData[QwtPlot::xTop].h 
+        + qwtMax(scaleData[QwtPlot::yLeft].h, scaleData[QwtPlot::yRight].h)
+        + 2 * (canvas->frameWidth() + 1);
+
+    const QwtTextLabel *title = plot->titleLabel();
+    if (title && !title->text().isEmpty())
+    {
+        // If only QwtPlot::yLeft or QwtPlot::yRight is showing, 
+        // we center on the plot canvas.
+        const bool centerOnCanvas = !(plot->axisEnabled(QwtPlot::yLeft) 
+            && plot->axisEnabled(QwtPlot::yRight));
+
+        int titleW = w;
+        if ( centerOnCanvas )
+        {
+            titleW -= scaleData[QwtPlot::yLeft].w 
+                + scaleData[QwtPlot::yRight].w;
+        }
+
+        int titleH = title->heightForWidth(titleW);
+        if ( titleH > titleW ) // Compensate for a long title
+        {
+            w = titleW = titleH;
+            if ( centerOnCanvas )
+            {
+                w += scaleData[QwtPlot::yLeft].w
+                    + scaleData[QwtPlot::yRight].w;
+            }
+
+            titleH = title->heightForWidth(titleW);
+        }
+        h += titleH + d_data->spacing;
+    }
+
+    // Compute the legend contribution
+
+    const QwtLegend *legend = plot->legend();
+    if ( legend && !legend->isEmpty() )
+    {
+        if ( d_data->legendPos == QwtPlot::LeftLegend 
+            || d_data->legendPos == QwtPlot::RightLegend )
+        {
+            int legendW = legend->sizeHint().width();
+            int legendH = legend->heightForWidth(legendW); 
+
+            if ( legend->frameWidth() > 0 )
+                w += d_data->spacing;
+
+            if ( legendH > h )
+                legendW += legend->verticalScrollBar()->sizeHint().height();
+
+            if ( d_data->legendRatio < 1.0 )
+                legendW = qwtMin(legendW, int(w / (1.0 - d_data->legendRatio)));
+
+            w += legendW;
+        }
+        else // QwtPlot::Top, QwtPlot::Bottom
+        {
+            int legendW = qwtMin(legend->sizeHint().width(), w);
+            int legendH = legend->heightForWidth(legendW); 
+
+            if ( legend->frameWidth() > 0 )
+                h += d_data->spacing;
+
+            if ( d_data->legendRatio < 1.0 )
+                legendH = qwtMin(legendH, int(h / (1.0 - d_data->legendRatio)));
+            
+            h += legendH;
+        }
+    }
+
+    w += 2 * d_data->margin;
+    h += 2 * d_data->margin;
+
+    return QSize( w, h );
+}
+
+/*!
+  Find the geometry for the legend
+  \param options Options how to layout the legend
+  \param rect Rectangle where to place the legend
+  \return Geometry for the legend
+*/
+
+QRect QwtPlotLayout::layoutLegend(int options, 
+    const QRect &rect) const
+{
+    const QSize hint(d_data->layoutData.legend.hint);
+
+    int dim;
+    if ( d_data->legendPos == QwtPlot::LeftLegend 
+        || d_data->legendPos == QwtPlot::RightLegend )
+    {
+        // We don't allow vertical legends to take more than
+        // half of the available space.
+
+        dim = qwtMin(hint.width(), int(rect.width() * d_data->legendRatio));
+
+        if ( !(options & IgnoreScrollbars) )
+        {
+            if ( hint.height() > rect.height() )
+            {
+                // The legend will need additional
+                // space for the vertical scrollbar. 
+
+                dim += d_data->layoutData.legend.vScrollBarWidth;
+            }
+        }
+    }
+    else
+    {
+        dim = qwtMin(hint.height(), int(rect.height() * d_data->legendRatio));
+        dim = qwtMax(dim, d_data->layoutData.legend.hScrollBarHeight);
+    }
+
+    QRect legendRect = rect;
+    switch(d_data->legendPos)
+    {
+        case QwtPlot::LeftLegend:
+            legendRect.setWidth(dim);
+            break;
+        case QwtPlot::RightLegend:
+            legendRect.setX(rect.right() - dim + 1);
+            legendRect.setWidth(dim);
+            break;
+        case QwtPlot::TopLegend:
+            legendRect.setHeight(dim);
+            break;
+        case QwtPlot::BottomLegend:
+            legendRect.setY(rect.bottom() - dim + 1);
+            legendRect.setHeight(dim);
+            break;
+    }
+
+    return legendRect;
+}
+
+/*!
+  Align the legend to the canvas
+  \param canvasRect Geometry of the canvas
+  \param legendRect Maximum geometry for the legend
+  \return Geometry for the aligned legend
+*/
+QRect QwtPlotLayout::alignLegend(const QRect &canvasRect, 
+    const QRect &legendRect) const
+{
+    QRect alignedRect = legendRect;
+
+    if ( d_data->legendPos == QwtPlot::BottomLegend 
+        || d_data->legendPos == QwtPlot::TopLegend )
+    {
+        if ( d_data->layoutData.legend.hint.width() < canvasRect.width() )
+        {
+            alignedRect.setX(canvasRect.x());
+            alignedRect.setWidth(canvasRect.width());
+        }
+    }
+    else
+    {
+        if ( d_data->layoutData.legend.hint.height() < canvasRect.height() )
+        {
+            alignedRect.setY(canvasRect.y());
+            alignedRect.setHeight(canvasRect.height());
+        }
+    }
+
+    return alignedRect;
+}
+
+/*!
+  Expand all line breaks in text labels, and calculate the height
+  of their widgets in orientation of the text.
+
+  \param options Options how to layout the legend
+  \param rect Bounding rect for title, axes and canvas.
+  \param dimTitle Expanded height of the title widget
+  \param dimAxis Expanded heights of the axis in axis orientation.
+*/
+void QwtPlotLayout::expandLineBreaks(int options, const QRect &rect, 
+    int &dimTitle, int dimAxis[QwtPlot::axisCnt]) const
+{
+    dimTitle = 0;
+    for ( int i = 0; i < QwtPlot::axisCnt; i++ )
+        dimAxis[i] = 0;
+
+    bool done = false;
+    while (!done)
+    {
+        done = true;
+
+        // the size for the 4 axis depend on each other. Expanding
+        // the height of a horizontal axis will shrink the height
+        // for the vertical axis, shrinking the height of a vertical
+        // axis will result in a line break what will expand the
+        // width and results in shrinking the width of a horizontal
+        // axis what might result in a line break of a horizontal
+        // axis ... . So we loop as long until no size changes.
+
+        if ( !d_data->layoutData.title.text.isEmpty() )
+        {
+            int w = rect.width();
+
+            if ( d_data->layoutData.scale[QwtPlot::yLeft].isEnabled
+                != d_data->layoutData.scale[QwtPlot::yRight].isEnabled )
+            {
+                // center to the canvas
+                w -= dimAxis[QwtPlot::yLeft] + dimAxis[QwtPlot::yRight]; 
+            }
+
+            int d = d_data->layoutData.title.text.heightForWidth(w);
+            if ( !(options & IgnoreFrames) )
+                d += 2 * d_data->layoutData.title.frameWidth;
+
+            if ( d > dimTitle )
+            {
+                dimTitle = d;
+                done = false;
+            }
+        }
+
+        for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
+        {
+            int backboneOffset = d_data->canvasMargin[axis];
+            if ( !(options & IgnoreFrames) )
+                backboneOffset += d_data->layoutData.canvas.frameWidth;
+
+            const struct LayoutData::t_scaleData &scaleData = 
+                d_data->layoutData.scale[axis];
+
+            if (scaleData.isEnabled)
+            {
+                int length;
+                if ( axis == QwtPlot::xTop || axis == QwtPlot::xBottom )
+                {
+                    length = rect.width() - dimAxis[QwtPlot::yLeft] 
+                        - dimAxis[QwtPlot::yRight];
+                    length += qwtMin(dimAxis[QwtPlot::yLeft], 
+                        scaleData.start - backboneOffset);
+                    length += qwtMin(dimAxis[QwtPlot::yRight], 
+                        scaleData.end - backboneOffset);
+                }
+                else // QwtPlot::yLeft, QwtPlot::yRight
+                {
+                    length = rect.height() - dimAxis[QwtPlot::xTop] 
+                        - dimAxis[QwtPlot::xBottom];
+
+                    if ( dimAxis[QwtPlot::xBottom] > 0 )
+                    {
+                        length += qwtMin(
+                            d_data->layoutData.scale[QwtPlot::xBottom].tickOffset, 
+                            scaleData.start - backboneOffset);
+                    }
+                    if ( dimAxis[QwtPlot::xTop] > 0 )
+                    {
+                        length += qwtMin(
+                            d_data->layoutData.scale[QwtPlot::xTop].tickOffset, 
+                            scaleData.end - backboneOffset);
+                    }
+
+                    if ( dimTitle > 0 )
+                        length -= dimTitle + d_data->spacing;
+                }
+
+                int d = scaleData.dimWithoutTitle;
+                if ( !scaleData.scaleWidget->title().isEmpty() )
+                {
+                    d += scaleData.scaleWidget->titleHeightForWidth(length);
+                }
+
+                if ( d > dimAxis[axis] )
+                {
+                    dimAxis[axis] = d;
+                    done = false;
+                }
+            }
+        }
+    }
+}
+
+/*!
+  Align the ticks of the axis to the canvas borders using
+  the empty corners.
+*/
+
+void QwtPlotLayout::alignScales(int options,
+    QRect &canvasRect, QRect scaleRect[QwtPlot::axisCnt]) const
+{
+    int axis;
+
+    int backboneOffset[QwtPlot::axisCnt];
+    for (axis = 0; axis < QwtPlot::axisCnt; axis++ )
+    {
+        backboneOffset[axis] = 0;
+        if ( !d_data->alignCanvasToScales )
+            backboneOffset[axis] += d_data->canvasMargin[axis];
+        if ( !(options & IgnoreFrames) )
+            backboneOffset[axis] += d_data->layoutData.canvas.frameWidth;
+    }
+
+    for (axis = 0; axis < QwtPlot::axisCnt; axis++ )
+    {
+        if ( !scaleRect[axis].isValid() )
+            continue;
+
+        const int startDist = d_data->layoutData.scale[axis].start;
+        const int endDist = d_data->layoutData.scale[axis].end;
+
+        QRect &axisRect = scaleRect[axis];
+
+        if ( axis == QwtPlot::xTop || axis == QwtPlot::xBottom )
+        {
+            const int leftOffset = backboneOffset[QwtPlot::yLeft] - startDist;
+
+            if ( scaleRect[QwtPlot::yLeft].isValid() )
+            {
+                int minLeft = scaleRect[QwtPlot::yLeft].left();
+                int left = axisRect.left() + leftOffset;
+                axisRect.setLeft(qwtMax(left, minLeft));
+            }
+            else
+            {
+                if ( d_data->alignCanvasToScales )
+                {
+                    canvasRect.setLeft(qwtMax(canvasRect.left(), 
+                        axisRect.left() - leftOffset));
+                }
+                else
+                {
+                    if ( leftOffset > 0 )
+                        axisRect.setLeft(axisRect.left() + leftOffset);
+                }
+            }
+
+            const int rightOffset = backboneOffset[QwtPlot::yRight] - endDist;
+
+            if ( scaleRect[QwtPlot::yRight].isValid() )
+            {
+                int maxRight = scaleRect[QwtPlot::yRight].right();
+                int right = axisRect.right() - rightOffset;
+                axisRect.setRight(qwtMin(right, maxRight));
+            }
+            else
+            {
+                if ( d_data->alignCanvasToScales )
+                {
+                    canvasRect.setRight( qwtMin(canvasRect.right(), 
+                        axisRect.right() + rightOffset) );
+                }
+                else
+                {
+                    if ( rightOffset > 0 )
+                        axisRect.setRight(axisRect.right() - rightOffset);
+                }
+            }
+        }
+        else // QwtPlot::yLeft, QwtPlot::yRight
+        {
+            const int bottomOffset = 
+                backboneOffset[QwtPlot::xBottom] - startDist;
+
+            if ( scaleRect[QwtPlot::xBottom].isValid() )
+            {
+                int maxBottom = scaleRect[QwtPlot::xBottom].top() + 
+                    d_data->layoutData.scale[QwtPlot::xBottom].tickOffset;
+
+                int bottom = axisRect.bottom() - bottomOffset;
+                axisRect.setBottom(qwtMin(bottom, maxBottom));
+            }
+            else
+            {
+                if ( d_data->alignCanvasToScales )
+                {
+                    canvasRect.setBottom(qwtMin(canvasRect.bottom(), 
+                        axisRect.bottom() + bottomOffset));
+                }
+                else
+                {
+                    if ( bottomOffset > 0 )
+                        axisRect.setBottom(axisRect.bottom() - bottomOffset);
+                }
+            }
+        
+            const int topOffset = backboneOffset[QwtPlot::xTop] - endDist;
+
+            if ( scaleRect[QwtPlot::xTop].isValid() )
+            {
+                int minTop = scaleRect[QwtPlot::xTop].bottom() -
+                    d_data->layoutData.scale[QwtPlot::xTop].tickOffset;
+
+                int top = axisRect.top() + topOffset;
+                axisRect.setTop(qwtMax(top, minTop));
+            }
+            else
+            {
+                if ( d_data->alignCanvasToScales )
+                {
+                    canvasRect.setTop(qwtMax(canvasRect.top(), 
+                        axisRect.top() + - topOffset));
+                }
+                else
+                {
+                    if ( topOffset > 0 )
+                        axisRect.setTop(axisRect.top() + topOffset);
+                }
+            }
+        }
+    }
+}
+
+/*!
+  \brief Recalculate the geometry of all components. 
+
+  \param plot Plot to be layout
+  \param plotRect Rect where to place the components
+  \param options Options
+
+  \sa QwtPlotLayout::invalidate(), QwtPlotLayout::titleRect(),
+      QwtPlotLayout::legendRect(), QwtPlotLayout::scaleRect(), 
+      QwtPlotLayout::canvasRect()
+*/
+
+void QwtPlotLayout::activate(const QwtPlot *plot,
+    const QRect &plotRect, int options) 
+{
+    invalidate();
+
+    QRect rect(plotRect);  // undistributed rest of the plot rect
+
+    if ( !(options & IgnoreMargin) )
+    {
+        // subtract the margin
+
+        rect.setRect(
+            rect.x() + d_data->margin, 
+            rect.y() + d_data->margin,
+            rect.width() - 2 * d_data->margin, 
+            rect.height() - 2 * d_data->margin
+        );
+    }
+
+    // We extract all layout relevant data from the widgets,
+    // filter them through pfilter and save them to d_data->layoutData.
+
+    d_data->layoutData.init(plot, rect);
+
+    if (!(options & IgnoreLegend)
+        && plot->legend() && !plot->legend()->isEmpty() )
+    {
+        d_data->legendRect = layoutLegend(options, rect);
+
+        // subtract d_data->legendRect from rect
+
+        const QRegion region(rect);
+        rect = region.subtract(d_data->legendRect).boundingRect(); 
+
+        if ( d_data->layoutData.legend.frameWidth && 
+            !(options & IgnoreFrames ) )
+        {
+            // In case of a frame we have to insert a spacing.
+            // Otherwise the leading of the font separates
+            // legend and scale/canvas
+
+            switch(d_data->legendPos)
+            {
+                case QwtPlot::LeftLegend:
+                    rect.setLeft(rect.left() + d_data->spacing);
+                    break;
+                case QwtPlot::RightLegend:
+                    rect.setRight(rect.right() - d_data->spacing);
+                    break;
+                case QwtPlot::TopLegend:
+                    rect.setTop(rect.top() + d_data->spacing);
+                    break;
+                case QwtPlot::BottomLegend:
+                    rect.setBottom(rect.bottom() - d_data->spacing);
+                    break;
+            }
+        }
+    }
+
+    /*
+     +---+-----------+---+
+     |       Title       |
+     +---+-----------+---+
+     |   |   Axis    |   |
+     +---+-----------+---+
+     | A |           | A |
+     | x |  Canvas   | x |
+     | i |           | i |
+     | s |           | s |
+     +---+-----------+---+
+     |   |   Axis    |   |
+     +---+-----------+---+
+    */
+
+
+    // axes and title include text labels. The height of each
+    // label depends on its line breaks, that depend on the width
+    // for the label. A line break in a horizontal text will reduce
+    // the available width for vertical texts and vice versa. 
+    // expandLineBreaks finds the height/width for title and axes
+    // including all line breaks.
+
+    int dimTitle, dimAxes[QwtPlot::axisCnt];
+    expandLineBreaks(options, rect, dimTitle, dimAxes);
+
+    if (dimTitle > 0 )
+    {
+        d_data->titleRect = QRect(rect.x(), rect.y(),
+            rect.width(), dimTitle);
+
+        if ( d_data->layoutData.scale[QwtPlot::yLeft].isEnabled !=
+            d_data->layoutData.scale[QwtPlot::yRight].isEnabled )
+        {
+            // if only one of the y axes is missing we align
+            // the title centered to the canvas
+
+            d_data->titleRect.setX(rect.x() + dimAxes[QwtPlot::yLeft]);
+            d_data->titleRect.setWidth(rect.width() 
+                - dimAxes[QwtPlot::yLeft] - dimAxes[QwtPlot::yRight]);
+        }
+
+        // subtract title 
+        rect.setTop(rect.top() + dimTitle + d_data->spacing);
+    }
+
+    d_data->canvasRect.setRect(
+        rect.x() + dimAxes[QwtPlot::yLeft],
+        rect.y() + dimAxes[QwtPlot::xTop],
+        rect.width() - dimAxes[QwtPlot::yRight] - dimAxes[QwtPlot::yLeft],
+        rect.height() - dimAxes[QwtPlot::xBottom] - dimAxes[QwtPlot::xTop]);
+
+    for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
+    {
+        // set the rects for the axes
+
+        if ( dimAxes[axis] )
+        {
+            int dim = dimAxes[axis];
+            QRect &scaleRect = d_data->scaleRect[axis];
+
+            scaleRect = d_data->canvasRect;
+            switch(axis)
+            {
+                case QwtPlot::yLeft:
+                    scaleRect.setX(d_data->canvasRect.left() - dim);
+                    scaleRect.setWidth(dim);
+                    break;
+                case QwtPlot::yRight:
+                    scaleRect.setX(d_data->canvasRect.right() + 1);
+                    scaleRect.setWidth(dim);
+                    break;
+                case QwtPlot::xBottom:
+                    scaleRect.setY(d_data->canvasRect.bottom() + 1);
+                    scaleRect.setHeight(dim);
+                    break;
+                case QwtPlot::xTop:
+                    scaleRect.setY(d_data->canvasRect.top() - dim);
+                    scaleRect.setHeight(dim);
+                    break;
+            }
+#if QT_VERSION < 0x040000
+            scaleRect = scaleRect.normalize();
+#else
+            scaleRect = scaleRect.normalized();
+#endif
+        }
+    }
+
+    // +---+-----------+---+
+    // |  <-   Axis   ->   |
+    // +-^-+-----------+-^-+
+    // | | |           | | |
+    // |   |           |   |
+    // | A |           | A |
+    // | x |  Canvas   | x |
+    // | i |           | i |
+    // | s |           | s |
+    // |   |           |   |
+    // | | |           | | |
+    // +-V-+-----------+-V-+
+    // |   <-  Axis   ->   |
+    // +---+-----------+---+
+
+    // The ticks of the axes - not the labels above - should
+    // be aligned to the canvas. So we try to use the empty
+    // corners to extend the axes, so that the label texts
+    // left/right of the min/max ticks are moved into them.
+ 
+    alignScales(options, d_data->canvasRect, d_data->scaleRect);
+
+    if (!d_data->legendRect.isEmpty() )
+    {
+        // We prefer to align the legend to the canvas - not to
+        // the complete plot - if possible.
+
+        d_data->legendRect = alignLegend(d_data->canvasRect, d_data->legendRect);
+    }
+}
diff --git a/src/qwt/qwt_plot_marker.cpp b/src/qwt/qwt_plot_marker.cpp
new file mode 100644
index 0000000..7cf5daf
--- /dev/null
+++ b/src/qwt/qwt_plot_marker.cpp
@@ -0,0 +1,386 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qpainter.h>
+#include "qwt_painter.h"
+#include "qwt_scale_map.h"
+#include "qwt_plot_marker.h"
+#include "qwt_symbol.h"
+#include "qwt_text.h"
+#include "qwt_math.h"
+
+static const int LabelDist = 2;
+
+class QwtPlotMarker::PrivateData
+{
+public:
+    PrivateData():
+        align(Qt::AlignCenter),
+        style(NoLine),
+        xValue(0.0),
+        yValue(0.0)
+    {
+    }
+
+    QwtText label;
+#if QT_VERSION < 0x040000
+    int align;
+#else
+    Qt::Alignment align;
+#endif
+    QPen pen;
+    QwtSymbol sym;
+    LineStyle style;
+
+    double xValue;
+    double yValue;
+};
+
+//! Sets alignment to Qt::AlignCenter, and style to NoLine
+QwtPlotMarker::QwtPlotMarker()
+{
+    d_data = new PrivateData;
+    setZ(30.0);
+}
+
+//! Destructor
+QwtPlotMarker::~QwtPlotMarker()
+{
+    delete d_data;
+}
+
+/*!
+  \brief Copy constructor
+  \param m Marker
+*/
+QwtPlotMarker::QwtPlotMarker(const QwtPlotMarker &m):
+    QwtPlotItem(m)
+{
+    *this = m;
+}
+
+/*!
+  \brief Assignment operator
+  \param m Marker
+*/
+QwtPlotMarker& QwtPlotMarker::operator=(const QwtPlotMarker &m)
+{
+    if (this != &m)
+    {
+        QwtPlotItem::operator=((const QwtPlotItem &)m);
+
+        d_data->label = m.d_data->label;
+        d_data->align = m.d_data->align;
+        d_data->pen = m.d_data->pen;
+        d_data->sym = m.d_data->sym;
+        d_data->style = m.d_data->style;
+        d_data->xValue = m.d_data->xValue;
+        d_data->yValue = m.d_data->yValue;
+
+        itemChanged(); 
+    }
+
+    return *this;
+}
+
+int QwtPlotMarker::rtti() const
+{
+    return QwtPlotItem::Rtti_PlotMarker;
+}
+
+//! Return Value
+QwtDoublePoint QwtPlotMarker::value() const
+{
+    return QwtDoublePoint(d_data->xValue, d_data->yValue);
+}
+
+//! Return x Value
+double QwtPlotMarker::xValue() const 
+{ 
+    return d_data->xValue; 
+}
+
+//! Return y Value
+double QwtPlotMarker::yValue() const 
+{ 
+    return d_data->yValue; 
+}
+
+//! Set Value
+void QwtPlotMarker::setValue(const QwtDoublePoint& pos)
+{
+    setValue(pos.x(), pos.y());
+}
+
+//! Set Value
+void QwtPlotMarker::setValue(double x, double y) 
+{
+    if ( x != d_data->xValue || y != d_data->yValue )
+    {
+        d_data->xValue = x; 
+        d_data->yValue = y; 
+        itemChanged(); 
+    }
+}
+
+//! Set X Value
+void QwtPlotMarker::setXValue(double x) 
+{ 
+    setValue(x, d_data->yValue);
+}
+
+//! Set Y Value
+void QwtPlotMarker::setYValue(double y) 
+{ 
+    setValue(d_data->xValue, y);
+}
+
+/*!
+  \brief Draw the marker
+  \param p Painter
+  \param xMap x Scale Map
+  \param yMap y Scale Map
+  \param r Bounding rect, where to paint
+*/
+void QwtPlotMarker::draw(QPainter *p,
+    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+    const QRect &r) const
+{
+    const int x = xMap.transform(d_data->xValue);
+    const int y = yMap.transform(d_data->yValue);
+
+    // draw lines
+    if (d_data->style != NoLine)
+    {
+        p->setPen(d_data->pen);
+        if ((d_data->style == HLine) || (d_data->style == Cross))
+            QwtPainter::drawLine(p, r.left(), y, r.right(), y);
+        if ((d_data->style == VLine)||(d_data->style == Cross))
+            QwtPainter::drawLine(p, x, r.top(), x, r.bottom());
+    }
+
+    // draw symbol
+    QSize sSym(0, 0);
+    if (d_data->sym.style() != QwtSymbol::None)
+    {
+        sSym = d_data->sym.size();
+        d_data->sym.draw(p, x, y);
+    }
+
+    // draw label
+    if (!d_data->label.isEmpty())
+    {
+        int xlw = qwtMax(int(d_data->pen.width()), 1);
+        int ylw = xlw;
+        int xlw1;
+        int ylw1;
+
+        const int xLabelDist = 
+            QwtPainter::metricsMap().screenToLayoutX(LabelDist);
+        const int yLabelDist = 
+            QwtPainter::metricsMap().screenToLayoutY(LabelDist);
+
+        if ((d_data->style == VLine) || (d_data->style == HLine))
+        {
+            xlw1 = (xlw + 1) / 2 + xLabelDist;
+            xlw = xlw / 2 + xLabelDist;
+            ylw1 = (ylw + 1) / 2 + yLabelDist;
+            ylw = ylw / 2 + yLabelDist;
+        }
+        else 
+        {
+            xlw1 = qwtMax((xlw + 1) / 2, (sSym.width() + 1) / 2) + xLabelDist;
+            xlw = qwtMax(xlw / 2, (sSym.width() + 1) / 2) + xLabelDist;
+            ylw1 = qwtMax((ylw + 1) / 2, (sSym.height() + 1) / 2) + yLabelDist;
+            ylw = qwtMax(ylw / 2, (sSym. height() + 1) / 2) + yLabelDist;
+        }
+
+        QRect tr(QPoint(0, 0), d_data->label.textSize(p->font()));
+        tr.moveCenter(QPoint(0, 0));
+
+        int dx = x;
+        int dy = y;
+
+        if (d_data->style == VLine)
+        {
+            if (d_data->align & (int) Qt::AlignTop)
+                dy = r.top() + yLabelDist - tr.y();
+            else if (d_data->align & (int) Qt::AlignBottom)
+                dy = r.bottom() - yLabelDist + tr.y();
+            else
+                dy = r.top() + r.height() / 2;
+        }
+        else
+        {
+            if (d_data->align & (int) Qt::AlignTop)
+                dy += tr.y() - ylw1;
+            else if (d_data->align & (int) Qt::AlignBottom)
+                dy -= tr.y() - ylw1;
+        }
+
+
+        if (d_data->style == HLine)
+        {
+            if (d_data->align & (int) Qt::AlignLeft)
+                dx = r.left() + xLabelDist - tr.x();
+            else if (d_data->align & (int) Qt::AlignRight)
+                dx = r.right() - xLabelDist + tr.x();
+            else
+                dx = r.left() + r.width() / 2;
+        }
+        else
+        {
+            if (d_data->align & (int) Qt::AlignLeft)
+                dx += tr.x() - xlw1;
+            else if (d_data->align & (int) Qt::AlignRight)
+                dx -= tr.x() - xlw1;
+        }
+
+#if QT_VERSION < 0x040000
+        tr.moveBy(dx, dy);
+#else
+        tr.translate(dx, dy);
+#endif
+        d_data->label.draw(p, tr);
+    }
+}
+
+/*!
+  \brief Set the line style
+  \param st Line style. Can be one of QwtPlotMarker::NoLine,
+    QwtPlotMarker::HLine, QwtPlotMarker::VLine or QwtPlotMarker::Cross
+  \sa QwtPlotMarker::lineStyle()
+*/
+void QwtPlotMarker::setLineStyle(QwtPlotMarker::LineStyle st)
+{
+    if ( st != d_data->style )
+    {
+        d_data->style = st;
+        itemChanged();
+    }
+}
+
+/*!
+  \return the line style
+  \sa For a description of line styles, see QwtPlotMarker::setLineStyle()
+*/
+QwtPlotMarker::LineStyle QwtPlotMarker::lineStyle() const 
+{ 
+    return d_data->style; 
+}
+
+/*!
+  \brief Assign a symbol
+  \param s New symbol 
+  \sa QwtSymbol, QwtPlotMarker::symbol()
+*/
+void QwtPlotMarker::setSymbol(const QwtSymbol &s)
+{
+    d_data->sym = s;
+    itemChanged();
+}
+
+/*!
+  \return the symbol
+  \sa QwtPlotMarker::setSymbol(), QwtSymbol
+*/
+const QwtSymbol &QwtPlotMarker::symbol() const 
+{ 
+    return d_data->sym; 
+}
+
+/*!
+  \brief Set the label
+  \param label label text
+  \sa QwtPlotMarker::label()
+*/
+void QwtPlotMarker::setLabel(const QwtText& label)
+{
+    if ( label != d_data->label )
+    {
+        d_data->label = label;
+        itemChanged();
+    }
+}
+
+/*!
+  \return the label
+  \sa QwtPlotMarker::setLabel()
+*/
+QwtText QwtPlotMarker::label() const 
+{ 
+    return d_data->label; 
+}
+
+/*!
+  \brief Set the alignment of the label
+
+  The alignment determines where the label is drawn relative to
+  the marker's position.
+
+  \param align Alignment. A combination of AlignTop, AlignBottom,
+    AlignLeft, AlignRight, AlignCenter, AlgnHCenter,
+    AlignVCenter.  
+  \sa QwtPlotMarker::labelAlignment()
+*/
+#if QT_VERSION < 0x040000
+void QwtPlotMarker::setLabelAlignment(int align)
+#else
+void QwtPlotMarker::setLabelAlignment(Qt::Alignment align)
+#endif
+{
+    if ( align == d_data->align )
+        return;
+    
+    d_data->align = align;
+    itemChanged();
+}
+
+/*!
+  \return the label alignment
+  \sa QwtPlotMarker::setLabelAlignment()
+*/
+#if QT_VERSION < 0x040000
+int QwtPlotMarker::labelAlignment() const 
+#else
+Qt::Alignment QwtPlotMarker::labelAlignment() const 
+#endif
+{ 
+    return d_data->align; 
+}
+
+/*!
+  \brief Specify a pen for the line.
+  \param p New pen
+  \sa QwtPlotMarker::linePen()
+*/
+void QwtPlotMarker::setLinePen(const QPen &p)
+{
+    if ( p != d_data->pen )
+    {
+        d_data->pen = p;
+        itemChanged();
+    }
+}
+
+/*!
+  \return the line pen
+  \sa QwtPlotMarker::setLinePen()
+*/
+const QPen &QwtPlotMarker::linePen() const 
+{ 
+    return d_data->pen; 
+}
+
+QwtDoubleRect QwtPlotMarker::boundingRect() const
+{
+    return QwtDoubleRect(d_data->xValue, d_data->yValue, 0.0, 0.0);
+}
diff --git a/src/qwt/qwt_plot_picker.cpp b/src/qwt/qwt_plot_picker.cpp
new file mode 100644
index 0000000..9375ee1
--- /dev/null
+++ b/src/qwt/qwt_plot_picker.cpp
@@ -0,0 +1,405 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include "qwt_plot.h"
+#include "qwt_double_rect.h"
+#include "qwt_scale_div.h"
+#include "qwt_painter.h"
+#include "qwt_scale_map.h"
+#include "qwt_plot_picker.h"
+
+/*!
+  \brief Create a plot picker
+
+  The picker is set to those x- and y-axis of the plot
+  that are enabled. If both or no x-axis are enabled, the picker
+  is set to QwtPlot::xBottom. If both or no y-axis are
+  enabled, it is set to QwtPlot::yLeft.
+
+  \param canvas Plot canvas to observe, also the parent object
+
+  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
+           leaves the axis in an 'intermediate' state.
+           In this case, to prevent buggy behaviour, you must call
+           QwtPlot::replot() before calling QwtPlotPicker().
+           This quirk will be removed in a future release.
+
+  \sa QwtPlot::autoReplot(), QwtPlot::replot(), QwtPlotPicker::scaleRect()
+*/
+  
+QwtPlotPicker::QwtPlotPicker(QwtPlotCanvas *canvas):
+    QwtPicker(canvas),
+    d_xAxis(-1),
+    d_yAxis(-1)
+{
+    if ( !canvas )
+        return;
+
+    // attach axes
+
+    int xAxis = QwtPlot::xBottom;
+
+    const QwtPlot *plot = QwtPlotPicker::plot();
+    if ( !plot->axisEnabled(QwtPlot::xBottom) &&
+        plot->axisEnabled(QwtPlot::xTop) )
+    {
+        xAxis = QwtPlot::xTop;
+    }
+
+    int yAxis = QwtPlot::yLeft;
+    if ( !plot->axisEnabled(QwtPlot::yLeft) &&
+        plot->axisEnabled(QwtPlot::yRight) )
+    {
+        yAxis = QwtPlot::yRight;
+    }
+
+    setAxis(xAxis, yAxis);
+}
+
+/*!
+  Create a plot picker
+
+  \param xAxis Set the x axis of the picker
+  \param yAxis Set the y axis of the picker
+  \param canvas Plot canvas to observe, also the parent object
+
+  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
+           leaves the axis in an 'intermediate' state.
+           In this case, to prevent buggy behaviour, you must call
+           QwtPlot::replot() before calling QwtPlotPicker().
+           This quirk will be removed in a future release.
+
+  \sa QwtPlot::autoReplot(), QwtPlot::replot(), QwtPlotPicker::scaleRect()
+*/
+QwtPlotPicker::QwtPlotPicker(int xAxis, int yAxis, QwtPlotCanvas *canvas):
+    QwtPicker(canvas),
+    d_xAxis(xAxis),
+    d_yAxis(yAxis)
+{
+}
+
+/*!
+  Create a plot picker
+
+  \param xAxis X axis of the picker
+  \param yAxis Y axis of the picker
+  \param selectionFlags Or�d value of SelectionType, RectSelectionType and
+                        SelectionMode
+  \param rubberBand Rubberband style
+  \param trackerMode Tracker mode
+  \param canvas Plot canvas to observe, also the parent object
+
+  \sa QwtPicker, QwtPicker::setSelectionFlags(), QwtPicker::setRubberBand(),
+      QwtPicker::setTrackerMode
+
+  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
+           leaves the axis in an 'intermediate' state.
+           In this case, to prevent buggy behaviour, you must call
+           QwtPlot::replot() before calling QwtPlotPicker().
+           This quirk will be removed in a future release.
+
+  \sa QwtPlot::autoReplot(), QwtPlot::replot(), QwtPlotPicker::scaleRect()
+*/
+QwtPlotPicker::QwtPlotPicker(int xAxis, int yAxis, int selectionFlags,
+        RubberBand rubberBand, DisplayMode trackerMode,
+        QwtPlotCanvas *canvas):
+    QwtPicker(selectionFlags, rubberBand, trackerMode, canvas),
+    d_xAxis(xAxis),
+    d_yAxis(yAxis)
+{
+}
+
+//! Return observed plot canvas
+QwtPlotCanvas *QwtPlotPicker::canvas()
+{
+    QWidget *w = parentWidget();
+    if ( w && w->inherits("QwtPlotCanvas") )
+        return (QwtPlotCanvas *)w;
+
+    return NULL;
+}
+
+//! Return Observed plot canvas
+const QwtPlotCanvas *QwtPlotPicker::canvas() const
+{
+    return ((QwtPlotPicker *)this)->canvas();
+}
+
+//! Return plot widget, containing the observed plot canvas
+QwtPlot *QwtPlotPicker::plot()
+{
+    QObject *w = canvas();
+    if ( w )
+    {
+        w = w->parent();
+        if ( w && w->inherits("QwtPlot") )
+            return (QwtPlot *)w;
+    }
+
+    return NULL;
+}
+
+//! Return plot widget, containing the observed plot canvas
+const QwtPlot *QwtPlotPicker::plot() const
+{
+    return ((QwtPlotPicker *)this)->plot();
+}
+
+/*!
+  Return normalized bounding rect of the axes
+
+  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
+           leaves the axis in an 'intermediate' state.
+           In this case, to prevent buggy behaviour, you must call
+           QwtPlot::replot() before calling QwtPlotPicker::scaleRect().
+           This quirk will be removed in a future release.
+
+  \sa QwtPlot::autoReplot(), QwtPlot::replot().
+*/
+QwtDoubleRect QwtPlotPicker::scaleRect() const
+{
+    const QwtScaleDiv *xs = plot()->axisScaleDiv(xAxis());
+    const QwtScaleDiv *ys = plot()->axisScaleDiv(yAxis());
+
+    const QwtDoubleRect rect( xs->lBound(), ys->lBound(), 
+        xs->range(), ys->range() );
+
+    return rect.normalized();
+}
+
+/*!
+  Set the x and y axes of the picker
+
+  \param xAxis X axis
+  \param yAxis Y axis
+*/
+void QwtPlotPicker::setAxis(int xAxis, int yAxis)
+{
+    const QwtPlot *plt = plot();
+    if ( !plt )
+        return;
+
+    if ( xAxis != d_xAxis || yAxis != d_yAxis )
+    {
+        d_xAxis = xAxis;
+        d_yAxis = yAxis;
+    }
+}
+
+//! Return x axis
+int QwtPlotPicker::xAxis() const
+{
+    return d_xAxis;
+}
+
+//! Return y axis
+int QwtPlotPicker::yAxis() const
+{
+    return d_yAxis;
+}
+
+/*!
+  Translate a pixel position into a position string
+
+  \param pos Position in pixel coordinates
+  \return Position string
+*/
+QwtText QwtPlotPicker::trackerText(const QPoint &pos) const
+{
+    return trackerText(invTransform(pos));
+}
+
+/*!
+  \brief Translate a position into a position string
+
+  In case of HLineRubberBand the label is the value of the
+  y position, in case of VLineRubberBand the value of the x position.
+  Otherwise the label contains x and y position separated by a �, �.
+
+  The format for the double to string conversion is "%.4f".
+
+  \param pos Position
+  \return Position string
+*/
+QwtText QwtPlotPicker::trackerText(const QwtDoublePoint &pos) const
+{
+    switch(rubberBand())
+    {
+        case HLineRubberBand:
+            return QString().sprintf("%.4f", pos.y());
+        case VLineRubberBand:
+            return QString().sprintf("%.4f", pos.x());
+        default:
+            return QString().sprintf("%.4f, %.4f", pos.x(), pos.y());
+    }
+    return QwtText(); // make some dumb compilers happy
+}
+
+/*! 
+  Append a point to the selection and update rubberband and tracker.
+    
+  \param pos Additional point
+  \sa isActive, begin(), end(), move(), appended()
+
+  \note The appended(const QPoint &), appended(const QDoublePoint &) 
+        signals are emitted.
+*/
+void QwtPlotPicker::append(const QPoint &pos)
+{
+    QwtPicker::append(pos);
+    emit appended(invTransform(pos));
+}
+
+/*!
+  Move the last point of the selection
+
+  \param pos New position
+  \sa isActive, begin(), end(), append()
+
+  \note The moved(const QPoint &), moved(const QDoublePoint &) 
+        signals are emitted.
+*/
+void QwtPlotPicker::move(const QPoint &pos)
+{
+    QwtPicker::move(pos);
+    emit moved(invTransform(pos));
+}
+
+/*!
+  Close a selection setting the state to inactive.
+
+  \param ok If true, complete the selection and emit selected signals
+            otherwise discard the selection.
+  \return true if the selection is accepted, false otherwise
+*/
+
+bool QwtPlotPicker::end(bool ok)
+{
+    ok = QwtPicker::end(ok);
+    if ( !ok )
+        return false;
+
+    QwtPlot *plot = QwtPlotPicker::plot();
+    if ( !plot )
+        return false;
+
+    const SelectedPoints &pa = selection();
+    if ( pa.count() == 0 )
+        return false;
+
+    if ( selectionFlags() & PointSelection )
+    {
+        const QwtDoublePoint pos = invTransform(pa[0]);
+        emit selected(pos);
+    }
+    else if ( (selectionFlags() & RectSelection) && pa.count() >= 2 )
+    {
+        QPoint p1 = pa[0];
+        QPoint p2 = pa[int(pa.count() - 1)];
+
+        if ( selectionFlags() & CenterToCorner )
+        {
+            p1.setX(p1.x() - (p2.x() - p1.x()));
+            p1.setY(p1.y() - (p2.y() - p1.y()));
+        }
+        else if ( selectionFlags() & CenterToRadius )
+        {
+            const int radius = qwtMax(qwtAbs(p2.x() - p1.x()),
+                qwtAbs(p2.y() - p1.y()));
+            p2.setX(p1.x() + radius);
+            p2.setY(p1.y() + radius);
+            p1.setX(p1.x() - radius);
+            p1.setY(p1.y() - radius);
+        }
+
+        emit selected(invTransform(QRect(p1, p2)).normalized());
+    }
+    else 
+    {
+        QwtArray<QwtDoublePoint> dpa(pa.count());
+        for ( int i = 0; i < int(pa.count()); i++ )
+            dpa[i] = invTransform(pa[i]);
+
+        emit selected(dpa);
+    }
+
+    return true;
+}
+
+/*!
+    Translate a rectangle from pixel into plot coordinates
+
+    \return Rectangle in plot coordinates
+    \sa QwtPlotPicker::transform()
+*/
+QwtDoubleRect QwtPlotPicker::invTransform(const QRect &rect) const
+{
+    QwtScaleMap xMap = plot()->canvasMap(d_xAxis);
+    QwtScaleMap yMap = plot()->canvasMap(d_yAxis);
+
+    const double left = xMap.invTransform(rect.left());
+    const double right = xMap.invTransform(rect.right());
+    const double top = yMap.invTransform(rect.top());
+    const double bottom = yMap.invTransform(rect.bottom());
+
+    return QwtDoubleRect(left, top,
+        right - left, bottom - top);
+}
+
+/*!
+    Translate a rectangle from plot into pixel coordinates
+    \return Rectangle in pixel coordinates
+    \sa QwtPlotPicker::invTransform()
+*/
+QRect QwtPlotPicker::transform(const QwtDoubleRect &rect) const
+{
+    QwtScaleMap xMap = plot()->canvasMap(d_xAxis);
+    QwtScaleMap yMap = plot()->canvasMap(d_yAxis);
+
+    const int left = xMap.transform(rect.left());
+    const int right = xMap.transform(rect.right());
+    const int top = yMap.transform(rect.top());
+    const int bottom = yMap.transform(rect.bottom());
+
+    return QRect(left, top, right - left, bottom - top);
+}
+
+/*!
+    Translate a point from pixel into plot coordinates
+    \return Point in plot coordinates
+    \sa QwtPlotPicker::transform()
+*/
+QwtDoublePoint QwtPlotPicker::invTransform(const QPoint &pos) const
+{
+    QwtScaleMap xMap = plot()->canvasMap(d_xAxis);
+    QwtScaleMap yMap = plot()->canvasMap(d_yAxis);
+
+    return QwtDoublePoint(
+        xMap.invTransform(pos.x()),
+        yMap.invTransform(pos.y())
+    );
+}
+
+/*!
+    Translate a point from plot into pixel coordinates
+    \return Point in pixel coordinates
+    \sa QwtPlotPicker::invTransform()
+*/
+QPoint QwtPlotPicker::transform(const QwtDoublePoint &pos) const
+{
+    QwtScaleMap xMap = plot()->canvasMap(d_xAxis);
+    QwtScaleMap yMap = plot()->canvasMap(d_yAxis);
+
+    return QPoint(
+        xMap.transform(pos.x()),
+        yMap.transform(pos.y())
+    );
+}
diff --git a/src/qwt/qwt_plot_print.cpp b/src/qwt/qwt_plot_print.cpp
new file mode 100644
index 0000000..46f1eb8
--- /dev/null
+++ b/src/qwt/qwt_plot_print.cpp
@@ -0,0 +1,487 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qpainter.h>
+#if QT_VERSION < 0x040000
+#include <qpaintdevicemetrics.h>
+#else
+#include <qpaintengine.h>
+#endif
+#include "qwt_painter.h"
+#include "qwt_legend_item.h"
+#include "qwt_plot.h"
+#include "qwt_plot_canvas.h"
+#include "qwt_plot_layout.h"
+#include "qwt_legend.h"
+#include "qwt_rect.h"
+#include "qwt_dyngrid_layout.h"
+#include "qwt_scale_widget.h"
+#include "qwt_scale_engine.h"
+#include "qwt_text.h"
+#include "qwt_text_label.h"
+#include "qwt_math.h"
+
+/*!
+  \brief Print the plot to a \c QPaintDevice (\c QPrinter)
+  This function prints the contents of a QwtPlot instance to
+  \c QPaintDevice object. The size is derived from its device
+  metrics.
+
+  \param paintDev device to paint on, often a printer
+  \param pfilter print filter
+  \sa QwtPlot::print
+  \sa QwtPlotPrintFilter
+*/
+
+void QwtPlot::print(QPaintDevice &paintDev,
+   const QwtPlotPrintFilter &pfilter) const
+{
+#if QT_VERSION < 0x040000
+    QPaintDeviceMetrics mpr(&paintDev);
+    int w = mpr.width();
+    int h = mpr.height();
+#else
+    int w = paintDev.width();
+    int h = paintDev.height();
+#endif
+
+    QRect rect(0, 0, w, h);
+    double aspect = double(rect.width())/double(rect.height());
+    if ((aspect < 1.0))
+        rect.setHeight(int(aspect*rect.width()));
+
+    QPainter p(&paintDev);
+    print(&p, rect, pfilter);
+}
+
+/*!
+  \brief Paint the plot into a given rectangle.
+  Paint the contents of a QwtPlot instance into a given rectangle.
+
+  \param painter Painter
+  \param plotRect Bounding rectangle
+  \param pfilter Print filter
+  \sa QwtPlotPrintFilter
+*/
+void QwtPlot::print(QPainter *painter, const QRect &plotRect,
+        const QwtPlotPrintFilter &pfilter) const
+{
+    int axisId;
+
+    if ( painter == 0 || !painter->isActive() ||
+            !plotRect.isValid() || size().isNull() )
+       return;
+
+    painter->save();
+
+    // All paint operations need to be scaled according to
+    // the paint device metrics. 
+
+    QwtPainter::setMetricsMap(this, painter->device());
+    const QwtMetricsMap &metricsMap = QwtPainter::metricsMap();
+
+    // It is almost impossible to integrate into the Qt layout
+    // framework, when using different fonts for printing
+    // and screen. To avoid writing different and Qt unconform
+    // layout engines we change the widget attributes, print and 
+    // reset the widget attributes again. This way we produce a lot of
+    // useless layout events ...
+
+    pfilter.apply((QwtPlot *)this);
+
+    int baseLineDists[QwtPlot::axisCnt];
+    if ( !(pfilter.options() & QwtPlotPrintFilter::PrintCanvasBackground) )
+    {
+        // In case of no background we set the backbone of
+        // the scale on the frame of the canvas.
+
+        for (axisId = 0; axisId < QwtPlot::axisCnt; axisId++ )
+        {
+            QwtScaleWidget *scaleWidget = (QwtScaleWidget *)axisWidget(axisId);
+            if ( scaleWidget )
+            {
+                baseLineDists[axisId] = scaleWidget->baseLineDist();
+                scaleWidget->setBaselineDist(0);
+            }
+        }
+    }
+    // Calculate the layout for the print.
+
+    int layoutOptions = QwtPlotLayout::IgnoreScrollbars 
+        | QwtPlotLayout::IgnoreFrames;
+    if ( !(pfilter.options() & QwtPlotPrintFilter::PrintMargin) )
+        layoutOptions |= QwtPlotLayout::IgnoreMargin;
+    if ( !(pfilter.options() & QwtPlotPrintFilter::PrintLegend) )
+        layoutOptions |= QwtPlotLayout::IgnoreLegend;
+
+    ((QwtPlot *)this)->plotLayout()->activate(this, 
+        QwtPainter::metricsMap().deviceToLayout(plotRect), 
+        layoutOptions);
+
+    if ((pfilter.options() & QwtPlotPrintFilter::PrintTitle)
+        && (!titleLabel()->text().isEmpty()))
+    {
+        printTitle(painter, plotLayout()->titleRect());
+    }
+
+    if ( (pfilter.options() & QwtPlotPrintFilter::PrintLegend)
+        && legend() && !legend()->isEmpty() )
+    {
+        printLegend(painter, plotLayout()->legendRect());
+    }
+
+    for ( axisId = 0; axisId < QwtPlot::axisCnt; axisId++ )
+    {
+        QwtScaleWidget *scaleWidget = (QwtScaleWidget *)axisWidget(axisId);
+        if (scaleWidget)
+        {
+            int baseDist = scaleWidget->baseLineDist();
+
+            int startDist, endDist;
+            scaleWidget->getBorderDistHint(startDist, endDist);
+
+            printScale(painter, axisId, startDist, endDist,
+                baseDist, plotLayout()->scaleRect(axisId));
+        }
+    }
+
+    const QRect canvasRect = metricsMap.layoutToDevice(plotLayout()->canvasRect());
+
+    // When using QwtPainter all sizes where computed in pixel
+    // coordinates and scaled by QwtPainter later. This limits
+    // the precision to screen resolution. A much better solution
+    // is to scale the maps and print in unlimited resolution.
+
+    QwtArray<QwtScaleMap> map(axisCnt);
+    for (axisId = 0; axisId < axisCnt; axisId++)
+    {
+        map[axisId].setTransformation(axisScaleEngine(axisId)->transformation());
+
+        const QwtScaleDiv &scaleDiv = *axisScaleDiv(axisId);
+        map[axisId].setScaleInterval(scaleDiv.lBound(), scaleDiv.hBound());
+
+        double from, to;
+        if ( axisEnabled(axisId) )
+        {
+            const int sDist = axisWidget(axisId)->startBorderDist();
+            const int eDist = axisWidget(axisId)->endBorderDist();
+            const QRect &scaleRect = plotLayout()->scaleRect(axisId);
+
+            if ( axisId == xTop || axisId == xBottom )
+            {
+                from = metricsMap.layoutToDeviceX(scaleRect.left() + sDist);
+                to = metricsMap.layoutToDeviceX(scaleRect.right() - eDist);
+            }
+            else
+            {
+                from = metricsMap.layoutToDeviceY(scaleRect.bottom() - sDist);
+                to = metricsMap.layoutToDeviceY(scaleRect.top() + eDist);
+            }
+        }
+        else
+        {
+            const int margin = plotLayout()->canvasMargin(axisId);
+
+            const QRect &canvasRect = plotLayout()->canvasRect();
+            if ( axisId == yLeft || axisId == yRight )
+            {
+                from = metricsMap.layoutToDeviceX(canvasRect.bottom() - margin);
+                to = metricsMap.layoutToDeviceX(canvasRect.top() + margin);
+            }
+            else
+            {
+                from = metricsMap.layoutToDeviceY(canvasRect.left() + margin);
+                to = metricsMap.layoutToDeviceY(canvasRect.right() - margin);
+            }
+        }
+        map[axisId].setPaintXInterval(from, to);
+    }
+
+
+    // The canvas maps are already scaled. 
+    QwtPainter::setMetricsMap(painter->device(), painter->device());
+
+    printCanvas(painter, canvasRect, map, pfilter);
+
+    QwtPainter::resetMetricsMap();
+
+    ((QwtPlot *)this)->plotLayout()->invalidate();
+
+    // reset all widgets with their original attributes.
+    if ( !(pfilter.options() & QwtPlotPrintFilter::PrintCanvasBackground) )
+    {
+        // restore the previous base line dists
+
+        for (axisId = 0; axisId < QwtPlot::axisCnt; axisId++ )
+        {
+            QwtScaleWidget *scaleWidget = (QwtScaleWidget *)axisWidget(axisId);
+            if ( scaleWidget  )
+                scaleWidget->setBaselineDist(baseLineDists[axisId]);
+        }
+    }
+
+    pfilter.reset((QwtPlot *)this);
+
+    painter->restore();
+}
+
+/*!
+  Print the title into a given rectangle.
+
+  \param painter Painter
+  \param rect Bounding rectangle
+*/
+
+void QwtPlot::printTitle(QPainter *painter, const QRect &rect) const
+{
+    painter->setFont(titleLabel()->font());
+
+    const QColor color = 
+#if QT_VERSION < 0x040000
+        titleLabel()->palette().color(
+            QPalette::Active, QColorGroup::Text);
+#else
+        titleLabel()->palette().color(
+            QPalette::Active, QPalette::Text);
+#endif
+
+    painter->setPen(color);
+    titleLabel()->text().draw(painter, rect);
+}
+
+/*!
+  Print the legend into a given rectangle.
+
+  \param painter Painter
+  \param rect Bounding rectangle
+*/
+
+void QwtPlot::printLegend(QPainter *painter, const QRect &rect) const
+{
+    if ( !legend() || legend()->isEmpty() )
+        return;
+
+    QLayout *l = legend()->contentsWidget()->layout();
+    if ( l == 0 || !l->inherits("QwtDynGridLayout") )
+        return;
+
+    QwtDynGridLayout *legendLayout = (QwtDynGridLayout *)l;
+
+    uint numCols = legendLayout->columnsForWidth(rect.width());
+#if QT_VERSION < 0x040000
+    QValueList<QRect> itemRects = 
+        legendLayout->layoutItems(rect, numCols);
+#else
+    QList<QRect> itemRects = 
+        legendLayout->layoutItems(rect, numCols);
+#endif
+
+    int index = 0;
+
+#if QT_VERSION < 0x040000
+    QLayoutIterator layoutIterator = legendLayout->iterator();
+    for ( QLayoutItem *item = layoutIterator.current(); 
+        item != 0; item = ++layoutIterator)
+    {
+#else
+    for ( int i = 0; i < legendLayout->count(); i++ )
+    {
+        QLayoutItem *item = legendLayout->itemAt(i);
+#endif
+        QWidget *w = item->widget();
+        if ( w )
+        {
+            painter->save();
+            painter->setClipping(true);
+            QwtPainter::setClipRect(painter, itemRects[index]);
+
+            printLegendItem(painter, w, itemRects[index]);
+
+            index++;
+            painter->restore();
+        }
+    }
+}
+
+/*!
+  Print the legend item into a given rectangle.
+
+  \param painter Painter
+  \param w Widget representing a legend item
+  \param rect Bounding rectangle
+*/
+
+void QwtPlot::printLegendItem(QPainter *painter, 
+    const QWidget *w, const QRect &rect) const
+{
+    if ( w->inherits("QwtLegendItem") )
+    {
+        QwtLegendItem *item = (QwtLegendItem *)w;
+
+        painter->setFont(item->font());
+        item->drawItem(painter, rect);
+    }
+}
+
+/*!
+  \brief Paint a scale into a given rectangle.
+  Paint the scale into a given rectangle.
+
+  \param painter Painter
+  \param axisId Axis
+  \param startDist Start border distance
+  \param endDist End border distance
+  \param baseDist Base distance
+  \param rect Bounding rectangle
+*/
+
+void QwtPlot::printScale(QPainter *painter,
+    int axisId, int startDist, int endDist, int baseDist, 
+    const QRect &rect) const
+{
+    if (!axisEnabled(axisId))
+        return;
+
+    QwtScaleDraw::Alignment align;
+    int x, y, w;
+
+    switch(axisId)
+    {
+        case yLeft:
+        {
+            x = rect.right() - baseDist + 1;
+            y = rect.y() + startDist;
+            w = rect.height() - startDist - endDist;
+            align = QwtScaleDraw::LeftScale;
+            break;
+        }
+        case yRight:
+        {
+            x = rect.left() + baseDist;
+            y = rect.y() + startDist;
+            w = rect.height() - startDist - endDist;
+            align = QwtScaleDraw::RightScale;
+            break;
+        }
+        case xTop:
+        {
+            x = rect.left() + startDist;
+            y = rect.bottom() - baseDist + 1;
+            w = rect.width() - startDist - endDist;
+            align = QwtScaleDraw::TopScale;
+            break;
+        }
+        case xBottom:
+        {
+            x = rect.left() + startDist;
+            y = rect.top() + baseDist;
+            w = rect.width() - startDist - endDist;
+            align = QwtScaleDraw::BottomScale;
+            break;
+        }
+        default:
+            return;
+    }
+
+    const QwtScaleWidget *scaleWidget = axisWidget(axisId);
+    scaleWidget->drawTitle(painter, align, rect);
+
+    painter->save();
+    painter->setFont(scaleWidget->font());
+
+    QwtScaleDraw *sd = (QwtScaleDraw *)scaleWidget->scaleDraw();
+    const QPoint sdPos = sd->pos();
+    const int sdLength = sd->length();
+
+    sd->move(x, y);
+    sd->setLength(w);
+
+#if QT_VERSION < 0x040000
+    sd->draw(painter, scaleWidget->palette().active());
+#else
+    QPalette palette = scaleWidget->palette();
+    palette.setCurrentColorGroup(QPalette::Active);
+    sd->draw(painter, palette);
+#endif
+    // reset previous values
+    sd->move(sdPos); 
+    sd->setLength(sdLength); 
+
+    painter->restore();
+}
+
+/*!
+  Print the canvas into a given rectangle.
+
+  \param painter Painter
+  \param map Maps mapping between plot and paint device coordinates
+  \param canvasRect Bounding rectangle
+  \param pfilter Print filter
+  \sa QwtPlotPrintFilter
+*/
+
+void QwtPlot::printCanvas(QPainter *painter, const QRect &canvasRect,
+    const QwtArray<QwtScaleMap> &map, const QwtPlotPrintFilter &pfilter) const
+{
+    if ( pfilter.options() & QwtPlotPrintFilter::PrintCanvasBackground )
+    {
+        painter->setPen(Qt::NoPen);
+
+        QBrush bgBrush;
+#if QT_VERSION >= 0x040000
+            bgBrush = canvas()->palette().brush(backgroundRole());
+#else
+        QColorGroup::ColorRole role =
+            QPalette::backgroundRoleFromMode( backgroundMode() ); 
+        bgBrush = canvas()->colorGroup().brush( role );
+#endif
+        painter->setBrush(bgBrush);
+        
+        int x1 = 0;
+        int x2 = 0;
+        int y1 = 0;
+        int y2 = 0;
+
+#if QT_VERSION >= 0x040000
+        switch(painter->device()->paintEngine()->type())
+        {
+            case QPaintEngine::PostScript:
+                x2 = 1;
+                y2 = 1;
+                break;
+            default:;
+        }
+#endif
+
+        const QwtMetricsMap map = QwtPainter::metricsMap();
+        x1 = map.screenToLayoutX(x1);
+        x2 = map.screenToLayoutX(x2);
+        y1 = map.screenToLayoutY(y1);
+        y2 = map.screenToLayoutY(y2);
+
+        QwtPainter::drawRect(painter, 
+            canvasRect.x() + x1, canvasRect.y() + y1, 
+            canvasRect.width() - x2, canvasRect.height() - y2); 
+    }
+    else
+    {
+        // Paint the canvas borders instead.
+        painter->setPen(QPen(Qt::black));
+        painter->setBrush(QBrush(Qt::NoBrush));
+        QwtPainter::drawRect(painter, canvasRect); 
+    }
+
+
+    painter->setClipping(true);
+    QwtPainter::setClipRect(painter, canvasRect);
+
+    drawItems(painter, canvasRect, map, pfilter);
+}
diff --git a/src/qwt/qwt_plot_printfilter.cpp b/src/qwt/qwt_plot_printfilter.cpp
new file mode 100644
index 0000000..93d8047
--- /dev/null
+++ b/src/qwt/qwt_plot_printfilter.cpp
@@ -0,0 +1,593 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qmap.h>
+#include "qwt_plot.h"
+#include "qwt_plot_grid.h"
+#include "qwt_plot_curve.h"
+#include "qwt_plot_marker.h"
+#include "qwt_symbol.h"
+#include "qwt_legend.h"
+#include "qwt_legend_item.h"
+#include "qwt_scale_widget.h"
+#include "qwt_text_label.h"
+#include "qwt_plot_printfilter.h"
+
+#if QT_VERSION < 0x040000
+typedef QColorGroup Palette;
+#else
+typedef QPalette Palette;
+#endif
+
+class QwtPlotPrintFilter::PrivateData
+{
+public:
+    PrivateData():
+        options(QwtPlotPrintFilter::PrintAll),
+        cache(NULL)
+    {
+    }
+
+    ~PrivateData()
+    {
+        delete cache;
+    }
+
+    class Cache
+    {
+    public:
+        QColor titleColor;
+        QFont titleFont;
+
+        QwtText scaleTitle[QwtPlot::axisCnt];
+        QColor scaleColor[QwtPlot::axisCnt];
+        QFont scaleFont[QwtPlot::axisCnt];
+        QColor scaleTitleColor[QwtPlot::axisCnt];
+        QFont scaleTitleFont[QwtPlot::axisCnt];
+
+        QMap<QWidget *, QFont> legendFonts;
+
+        QColor widgetBackground;
+        QColor canvasBackground;
+        QColor gridColors[2];
+
+        QMap<const QwtPlotItem *, QColor> curveColors;
+        QMap<const QwtPlotItem *, QColor> curveSymbolBrushColors;
+        QMap<const QwtPlotItem *, QColor> curveSymbolPenColors;
+
+        QMap<const QwtPlotItem *, QFont> markerFonts;
+        QMap<const QwtPlotItem *, QColor> markerLabelColors;
+        QMap<const QwtPlotItem *, QColor> markerLineColors;
+        QMap<const QwtPlotItem *, QColor> markerSymbolBrushColors;
+        QMap<const QwtPlotItem *, QColor> markerSymbolPenColors;
+    };
+
+    int options;
+    mutable Cache *cache;
+};
+
+
+/*!
+  Sets filter options to QwtPlotPrintFilter::PrintAll
+*/  
+
+QwtPlotPrintFilter::QwtPlotPrintFilter()
+{
+    d_data = new PrivateData;
+}
+
+//! Destructor
+QwtPlotPrintFilter::~QwtPlotPrintFilter()
+{
+    delete d_data;
+}
+
+/*!
+  \brief Set plot print options
+  \param options Or'd QwtPlotPrintFilter::Options values
+
+  \sa QwtPlotPrintFilter::options()
+*/
+void QwtPlotPrintFilter::setOptions(int options) 
+{ 
+    d_data->options = options; 
+}
+
+/*! 
+  \brief Get plot print options
+  \sa QwtPlotPrintFilter::setOptions()
+*/
+int QwtPlotPrintFilter::options() const 
+{ 
+    return d_data->options; 
+}
+
+/*!
+  \brief Modifies a color for printing
+  \param c Color to be modified
+  \param item Type of item where the color belongs
+  \return Modified color.
+
+  In case of !(QwtPlotPrintFilter::options() & PrintBackground) 
+  MajorGrid is modified to Qt::darkGray, MinorGrid to Qt::gray. 
+  All other colors are returned unmodified.
+*/
+
+QColor QwtPlotPrintFilter::color(const QColor &c, Item item) const
+{
+    if ( !(options() & PrintCanvasBackground))
+    {
+        switch(item)
+        {
+            case MajorGrid:
+                return Qt::darkGray;
+            case MinorGrid:
+                return Qt::gray;
+            default:;
+        }
+    }
+    return c;
+}
+
+/*!
+  \brief Modifies a font for printing
+  \param f Font to be modified
+  \param item Type of item where the font belongs
+
+  All fonts are returned unmodified
+*/
+
+QFont QwtPlotPrintFilter::font(const QFont &f, Item) const
+{
+    return f;
+}
+
+/*! 
+  Change color and fonts of a plot
+  \sa QwtPlotPrintFilter::apply
+*/
+void QwtPlotPrintFilter::apply(QwtPlot *plot) const
+{
+    const bool doAutoReplot = plot->autoReplot();
+    plot->setAutoReplot(false);
+
+    delete d_data->cache;
+    d_data->cache = new PrivateData::Cache;
+
+    PrivateData::Cache &cache = *d_data->cache;
+
+    if ( plot->titleLabel() )
+    {
+        QPalette palette = plot->titleLabel()->palette();
+        cache.titleColor = palette.color(
+            QPalette::Active, Palette::Text);
+        palette.setColor(QPalette::Active, Palette::Text,
+                         color(cache.titleColor, Title));
+        plot->titleLabel()->setPalette(palette);
+
+        cache.titleFont = plot->titleLabel()->font();
+        plot->titleLabel()->setFont(font(cache.titleFont, Title));
+    }
+    if ( plot->legend() )
+    {
+#if QT_VERSION < 0x040000
+        QValueList<QWidget *> list = plot->legend()->legendItems();
+        for ( QValueListIterator<QWidget *> it = list.begin();
+            it != list.end(); ++it )
+#else
+        QList<QWidget *> list = plot->legend()->legendItems();
+        for ( QList<QWidget*>::iterator it = list.begin();
+            it != list.end(); ++it )
+#endif
+        {
+            QWidget *w = *it;
+
+            cache.legendFonts.insert(w, w->font());
+            w->setFont(font(w->font(), Legend));
+
+            if ( w->inherits("QwtLegendItem") )
+            {
+                QwtLegendItem *label = (QwtLegendItem *)w;
+
+                QwtSymbol symbol = label->symbol();
+                QPen pen = symbol.pen();
+                QBrush brush = symbol.brush();
+
+                pen.setColor(color(pen.color(), CurveSymbol));
+                brush.setColor(color(brush.color(), CurveSymbol));
+
+                symbol.setPen(pen);
+                symbol.setBrush(brush);
+                label->setSymbol(symbol);
+
+                pen = label->curvePen();
+                pen.setColor(color(pen.color(), Curve));
+                label->setCurvePen(pen);
+            }
+        }
+    }
+    for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
+    {
+        QwtScaleWidget *scaleWidget = plot->axisWidget(axis);
+        if ( scaleWidget )
+        {
+            cache.scaleColor[axis] = scaleWidget->palette().color(
+                QPalette::Active, Palette::Foreground);
+            QPalette palette = scaleWidget->palette();
+            palette.setColor(QPalette::Active, Palette::Foreground,
+                             color(cache.scaleColor[axis], AxisScale));
+            scaleWidget->setPalette(palette);
+
+            cache.scaleFont[axis] = scaleWidget->font();
+            scaleWidget->setFont(font(cache.scaleFont[axis], AxisScale));
+
+            cache.scaleTitle[axis] = scaleWidget->title();
+
+            QwtText scaleTitle = scaleWidget->title();
+            if ( scaleTitle.paintAttributes() & QwtText::PaintUsingTextColor )
+            {
+                cache.scaleTitleColor[axis] = scaleTitle.color();
+                scaleTitle.setColor(
+                    color(cache.scaleTitleColor[axis], AxisTitle));
+            }
+
+            if ( scaleTitle.paintAttributes() & QwtText::PaintUsingTextFont )
+            {
+                cache.scaleTitleFont[axis] = scaleTitle.font();
+                scaleTitle.setFont(
+                    font(cache.scaleTitleFont[axis], AxisTitle));
+            }
+
+            scaleWidget->setTitle(scaleTitle);
+
+            int startDist, endDist;
+            scaleWidget->getBorderDistHint(startDist, endDist);
+            scaleWidget->setBorderDist(startDist, endDist);
+        }
+    }
+
+
+    QPalette p = plot->palette();
+    cache.widgetBackground = plot->palette().color(
+        QPalette::Active, Palette::Background);
+    p.setColor(QPalette::Active, Palette::Background, 
+        color(cache.widgetBackground, WidgetBackground));
+    plot->setPalette(p);
+
+    cache.canvasBackground = plot->canvasBackground();
+    plot->setCanvasBackground(color(cache.canvasBackground, CanvasBackground));
+
+    const QwtPlotItemList& itmList = plot->itemList();
+    for ( QwtPlotItemIterator it = itmList.begin();
+        it != itmList.end(); ++it )
+    {
+        apply(*it);
+    }
+
+    plot->setAutoReplot(doAutoReplot);
+}
+
+void QwtPlotPrintFilter::apply(QwtPlotItem *item) const
+{
+    PrivateData::Cache &cache = *d_data->cache;
+
+    switch(item->rtti())
+    {
+        case QwtPlotItem::Rtti_PlotGrid:
+        {
+            QwtPlotGrid *grid = (QwtPlotGrid *)item;
+
+            QPen pen = grid->majPen();
+            cache.gridColors[0] = pen.color();
+            pen.setColor(color(pen.color(), MajorGrid));
+            grid->setMajPen(pen);
+
+            pen = grid->minPen();
+            cache.gridColors[1] = pen.color();
+            pen.setColor(color(pen.color(), MinorGrid));
+            grid->setMinPen(pen);
+
+            break;
+        }
+        case QwtPlotItem::Rtti_PlotCurve:
+        {
+            QwtPlotCurve *c = (QwtPlotCurve *)item;
+
+            QwtSymbol symbol = c->symbol();
+
+            QPen pen = symbol.pen();
+            cache.curveSymbolPenColors.insert(c, pen.color());
+            pen.setColor(color(pen.color(), CurveSymbol));
+            symbol.setPen(pen);
+
+            QBrush brush = symbol.brush();
+            cache.curveSymbolBrushColors.insert(c, brush.color());
+            brush.setColor(color(brush.color(), CurveSymbol));
+            symbol.setBrush(brush);
+
+            c->setSymbol(symbol);
+
+            pen = c->pen();
+            cache.curveColors.insert(c, pen.color());
+            pen.setColor(color(pen.color(), Curve));
+            c->setPen(pen);
+
+            break;
+        }
+        case QwtPlotItem::Rtti_PlotMarker:
+        {
+            QwtPlotMarker *m = (QwtPlotMarker *)item;
+
+#ifdef __GNUC__
+#warning filtering of rectPen/rectBrush missing
+#endif
+
+            QwtText label = m->label();
+            cache.markerFonts.insert(m, label.font());
+            label.setFont(font(label.font(), Marker));
+            cache.markerLabelColors.insert(m, label.color());
+            label.setColor(color(label.color(), Marker));
+            m->setLabel(label);
+            
+            QPen pen = m->linePen();
+            cache.markerLineColors.insert(m, pen.color());
+            pen.setColor(color(pen.color(), Marker));
+            m->setLinePen(pen);
+
+            QwtSymbol symbol = m->symbol();
+
+            pen = symbol.pen();
+            cache.markerSymbolPenColors.insert(m, pen.color());
+            pen.setColor(color(pen.color(), MarkerSymbol));
+            symbol.setPen(pen);
+
+            QBrush brush = symbol.brush();
+            cache.markerSymbolBrushColors.insert(m, brush.color());
+            brush.setColor(color(brush.color(), MarkerSymbol));
+            symbol.setBrush(brush);
+
+            m->setSymbol(symbol);
+
+            break;
+        }
+        default:    
+            break;
+    }
+}
+
+/*! 
+   Reset color and fonts of a plot
+   \sa QwtPlotPrintFilter::apply
+*/
+void QwtPlotPrintFilter::reset(QwtPlot *plot) const
+{
+    if ( d_data->cache == 0 )
+        return;
+
+    const bool doAutoReplot = plot->autoReplot();
+    plot->setAutoReplot(false);
+
+    const PrivateData::Cache &cache = *d_data->cache;
+
+    if ( plot->titleLabel() )
+    {
+        QwtTextLabel* title = plot->titleLabel();
+        if ( title->text().paintAttributes() & QwtText::PaintUsingTextFont )
+        {
+            QwtText text = title->text();
+            text.setColor(cache.titleColor);
+            title->setText(text);
+        }
+        else
+        {
+            QPalette palette = title->palette();
+            palette.setColor(
+                QPalette::Active, Palette::Text, cache.titleColor);
+            title->setPalette(palette);
+        }
+
+        if ( title->text().paintAttributes() & QwtText::PaintUsingTextFont )
+        {
+            QwtText text = title->text();
+            text.setFont(cache.titleFont);
+            title->setText(text);
+        }
+        else
+        {
+            title->setFont(cache.titleFont);
+        }
+    }
+
+    if ( plot->legend() )
+    {
+#if QT_VERSION < 0x040000
+        QValueList<QWidget *> list = plot->legend()->legendItems();
+        for ( QValueListIterator<QWidget *> it = list.begin();
+            it != list.end(); ++it )
+#else
+        QList<QWidget *> list = plot->legend()->legendItems();
+        for ( QList<QWidget*>::iterator it = list.begin();
+            it != list.end(); ++it )
+#endif
+        {
+            QWidget *w = *it;
+
+            if ( cache.legendFonts.contains(w) )
+                w->setFont(cache.legendFonts[w]);
+
+            if ( w->inherits("QwtLegendItem") )
+            {
+                QwtLegendItem *label = (QwtLegendItem *)w;
+                const QwtPlotItem *plotItem = plot->legend()->find(label);
+
+                QwtSymbol symbol = label->symbol();
+                if ( cache.curveSymbolPenColors.contains(plotItem) )
+                {
+                    QPen pen = symbol.pen();
+                    pen.setColor(cache.curveSymbolPenColors[plotItem]);
+                    symbol.setPen(pen);
+                }
+
+                if ( cache.curveSymbolBrushColors.contains(plotItem) )
+                {
+                    QBrush brush = symbol.brush();
+                    brush.setColor(cache.curveSymbolBrushColors[plotItem]);
+                    symbol.setBrush(brush);
+                }
+                label->setSymbol(symbol);
+
+                if ( cache.curveColors.contains(plotItem) )
+                {
+                    QPen pen = label->curvePen();
+                    pen.setColor(cache.curveColors[plotItem]);
+                    label->setCurvePen(pen);
+                }
+            }
+        }
+    }
+    for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
+    {
+        QwtScaleWidget *scaleWidget = plot->axisWidget(axis);
+        if ( scaleWidget )
+        {
+            QPalette palette = scaleWidget->palette();
+            palette.setColor(QPalette::Active, Palette::Foreground,
+                             cache.scaleColor[axis]);
+            scaleWidget->setPalette(palette);
+
+            scaleWidget->setFont(cache.scaleFont[axis]);
+            scaleWidget->setTitle(cache.scaleTitle[axis]);
+
+            int startDist, endDist;
+            scaleWidget->getBorderDistHint(startDist, endDist);
+            scaleWidget->setBorderDist(startDist, endDist);
+        }
+    }
+
+    QPalette p = plot->palette();
+    p.setColor(QPalette::Active, Palette::Background, cache.widgetBackground);
+    plot->setPalette(p);
+
+    plot->setCanvasBackground(cache.canvasBackground);
+   
+    const QwtPlotItemList& itmList = plot->itemList();
+    for ( QwtPlotItemIterator it = itmList.begin();
+        it != itmList.end(); ++it )
+    {
+        reset(*it);
+    }
+
+    delete d_data->cache;
+    d_data->cache = 0;
+
+    plot->setAutoReplot(doAutoReplot);
+}
+
+void QwtPlotPrintFilter::reset(QwtPlotItem *item) const
+{
+    if ( d_data->cache == 0 )
+        return;
+
+    const PrivateData::Cache &cache = *d_data->cache;
+
+    switch(item->rtti())
+    {
+        case QwtPlotItem::Rtti_PlotGrid:
+        {
+            QwtPlotGrid *grid = (QwtPlotGrid *)item;
+
+            QPen pen = grid->majPen();
+            pen.setColor(cache.gridColors[0]);
+            grid->setMajPen(pen);
+
+            pen = grid->minPen();
+            pen.setColor(cache.gridColors[1]);
+            grid->setMinPen(pen);
+
+            break;
+        }
+        case QwtPlotItem::Rtti_PlotCurve:
+        {
+            QwtPlotCurve *c = (QwtPlotCurve *)item;
+
+            QwtSymbol symbol = c->symbol();
+
+            if ( cache.curveSymbolPenColors.contains(c) )
+            {
+                symbol.setPen(cache.curveSymbolPenColors[c]);
+            }
+
+            if ( cache.curveSymbolBrushColors.contains(c) )
+            {
+                QBrush brush = symbol.brush();
+                brush.setColor(cache.curveSymbolBrushColors[c]);
+                symbol.setBrush(brush);
+            }
+            c->setSymbol(symbol);
+
+            if ( cache.curveColors.contains(c) )
+            {
+                QPen pen = c->pen();
+                pen.setColor(cache.curveColors[c]);
+                c->setPen(pen);
+            }
+
+            break;
+        }
+        case QwtPlotItem::Rtti_PlotMarker:
+        {
+            QwtPlotMarker *m = (QwtPlotMarker *)item;
+
+            if ( cache.markerFonts.contains(m) )
+            {
+                QwtText label = m->label();
+                label.setFont(cache.markerFonts[m]);
+                m->setLabel(label);
+            }
+
+            if ( cache.markerLabelColors.contains(m) )
+            {
+                QwtText label = m->label();
+                label.setColor(cache.markerLabelColors[m]);
+                m->setLabel(label);
+            }
+
+            if ( cache.markerLineColors.contains(m) )
+            {
+                QPen pen = m->linePen();
+                pen.setColor(cache.markerLineColors[m]);
+                m->setLinePen(pen);
+            }
+            
+            QwtSymbol symbol = m->symbol();
+
+            if ( cache.markerSymbolPenColors.contains(m) )
+            {
+                QPen pen = symbol.pen();
+                pen.setColor(cache.markerSymbolPenColors[m]);
+                symbol.setPen(pen);
+            }
+
+            if ( cache.markerSymbolBrushColors.contains(m) )
+            {
+                QBrush brush = symbol.brush();
+                brush.setColor(cache.markerSymbolBrushColors[m]);
+                symbol.setBrush(brush);
+            }
+
+            m->setSymbol(symbol);
+
+            break;
+        }
+        default:
+            break;
+    }
+}
diff --git a/src/qwt/qwt_plot_zoomer.cpp b/src/qwt/qwt_plot_zoomer.cpp
new file mode 100644
index 0000000..0b462d6
--- /dev/null
+++ b/src/qwt/qwt_plot_zoomer.cpp
@@ -0,0 +1,637 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <math.h>
+#include "qwt_plot.h"
+#include "qwt_plot_canvas.h"
+#include "qwt_plot_zoomer.h"
+#include "qwt_scale_div.h"
+#if QT_VERSION < 0x040000
+typedef QValueStack<QwtDoubleRect> QwtZoomStack;
+#else
+typedef QStack<QwtDoubleRect> QwtZoomStack;
+#endif
+
+class QwtPlotZoomer::PrivateData
+{
+public:
+    uint zoomRectIndex;
+    QwtZoomStack zoomStack;
+
+    int maxStackDepth;
+};
+
+/*!
+  \brief Create a zoomer for a plot canvas.
+
+  The zoomer is set to those x- and y-axis of the parent plot of the
+  canvas that are enabled. If both or no x-axis are enabled, the picker
+  is set to QwtPlot::xBottom. If both or no y-axis are
+  enabled, it is set to QwtPlot::yLeft.
+
+  The selectionFlags() are set to 
+  QwtPicker::RectSelection & QwtPicker::ClickSelection, the
+  tracker mode to QwtPicker::ActiveOnly.
+
+  \param canvas Plot canvas to observe, also the parent object
+
+  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
+           leaves the axis in an 'intermediate' state.
+           In this case, to prevent buggy behaviour, you must call
+           QwtPlot::replot() before calling QwtPlotZoomer().
+           This quirk will be removed in a future release.
+
+  \sa QwtPlot::autoReplot(), QwtPlot::replot(), QwtPlotPicker::setZoomBase()
+*/
+QwtPlotZoomer::QwtPlotZoomer(QwtPlotCanvas *canvas):
+    QwtPlotPicker(canvas)
+{
+    if ( canvas )
+        init();
+}
+
+/*!
+  \brief Create a zoomer for a plot canvas.
+
+  The selectionFlags() are set to 
+  QwtPicker::RectSelection & QwtPicker::ClickSelection, the
+  tracker mode to QwtPicker::ActiveOnly. 
+
+  \param xAxis X axis of the zoomer
+  \param yAxis Y axis of the zoomer
+  \param canvas Plot canvas to observe, also the parent object
+
+  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
+           leaves the axis in an 'intermediate' state.
+           In this case, to prevent buggy behaviour, you must call
+           QwtPlot::replot() before calling QwtPlotZoomer().
+           This quirk will be removed in a future release.
+
+  \sa QwtPlot::autoReplot(), QwtPlot::replot(), QwtPlotPicker::setZoomBase()
+*/
+
+QwtPlotZoomer::QwtPlotZoomer(int xAxis, int yAxis,
+        QwtPlotCanvas *canvas):
+    QwtPlotPicker(xAxis, yAxis, canvas)
+{
+    if ( canvas )
+    {
+        init();
+    }
+}
+
+/*!
+  Create a zoomer for a plot canvas.
+
+  \param xAxis X axis of the zoomer
+  \param yAxis Y axis of the zoomer
+  \param selectionFlags Or�d value of QwtPicker::RectSelectionType and
+                        QwtPicker::SelectionMode. 
+                        QwtPicker::RectSelection will be auto added.
+  \param trackerMode Tracker mode
+  \param canvas Plot canvas to observe, also the parent object
+
+  \sa QwtPicker, QwtPicker::setSelectionFlags(), QwtPicker::setRubberBand(),
+      QwtPicker::setTrackerMode
+
+  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
+           leaves the axis in an 'intermediate' state.
+           In this case, to prevent buggy behaviour, you must call
+           QwtPlot::replot() before calling QwtPlotZoomer().
+           This quirk will be removed in a future release.
+
+  \sa QwtPlot::autoReplot(), QwtPlot::replot(), QwtPlotPicker::setZoomBase()
+*/
+
+QwtPlotZoomer::QwtPlotZoomer(int xAxis, int yAxis, int selectionFlags,
+        DisplayMode trackerMode, QwtPlotCanvas *canvas):
+    QwtPlotPicker(xAxis, yAxis,canvas)
+{
+    if ( canvas )
+    {
+        init(selectionFlags, trackerMode);
+    }
+}
+
+//! Init the zoomer, used by the constructors
+void QwtPlotZoomer::init(int selectionFlags, DisplayMode trackerMode)
+{
+    d_data = new PrivateData;
+
+    d_data->maxStackDepth = -1;
+
+    setSelectionFlags(selectionFlags);
+    setTrackerMode(trackerMode);
+    setRubberBand(RectRubberBand);
+
+    setZoomBase(scaleRect());
+}
+
+QwtPlotZoomer::~QwtPlotZoomer()
+{
+    delete d_data;
+}
+
+/*!
+  \brief Limit the number of recursive zoom operations to depth.
+
+  A value of -1 set the depth to unlimited, 0 disables zooming.
+  If the current zoom rectangle is below depth, the plot is unzoomed.
+
+  \param depth Maximum for the stack depth
+  \sa maxStackDepth()
+  \note depth doesn�t include the zoom base, so zoomStack().count() might be
+              maxStackDepth() + 1.
+*/
+void QwtPlotZoomer::setMaxStackDepth(int depth)
+{
+    d_data->maxStackDepth = depth;
+
+    if ( depth >= 0 )
+    {
+        // unzoom if the current depth is below d_data->maxStackDepth
+
+        const int zoomOut = 
+            int(d_data->zoomStack.count()) - 1 - depth; // -1 for the zoom base
+
+        if ( zoomOut > 0 )
+        {
+            zoom(-zoomOut);
+            for ( int i = int(d_data->zoomStack.count()) - 1; 
+                i > int(d_data->zoomRectIndex); i-- )
+            {
+                (void)d_data->zoomStack.pop(); // remove trailing rects
+            }
+        }
+    }
+}
+
+/*!
+  \return Maximal depth of the zoom stack.
+  \sa setMaxStackDepth()
+*/
+int QwtPlotZoomer::maxStackDepth() const
+{
+    return d_data->maxStackDepth;
+}
+
+/*!
+  Return the zoom stack. zoomStack()[0] is the zoom base,
+  zoomStack()[1] the first zoomed rectangle.
+*/
+const QwtZoomStack &QwtPlotZoomer::zoomStack() const
+{
+    return d_data->zoomStack;
+}
+
+/*!
+  \return Initial rectangle of the zoomer
+  \sa setZoomBase(), zoomRect()
+*/
+QwtDoubleRect QwtPlotZoomer::zoomBase() const
+{
+    return d_data->zoomStack[0];
+}
+
+/*!
+  Reinitialized the zoom stack with scaleRect() as base.
+
+  \sa zoomBase(), scaleRect()
+
+  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
+           leaves the axis in an 'intermediate' state.
+           In this case, to prevent buggy behaviour, you must call
+           QwtPlot::replot() before calling QwtPlotZoomer::setZoomBase().
+           This quirk will be removed in a future release.
+
+  \sa QwtPlot::autoReplot(), QwtPlot::replot().
+*/
+void QwtPlotZoomer::setZoomBase()
+{
+    const QwtPlot *plt = plot();
+    if ( !plt )
+        return;
+
+    d_data->zoomStack.clear();
+    d_data->zoomStack.push(scaleRect());
+    d_data->zoomRectIndex = 0;
+
+    rescale();
+}
+
+/*!
+  \brief Set the initial size of the zoomer.
+
+  base is united with the current scaleRect() and the zoom stack is
+  reinitalized with it as zoom base. plot is zoomed to scaleRect().
+  
+  \param base Zoom base
+  
+  \sa zoomBase(), scaleRect()
+*/
+void QwtPlotZoomer::setZoomBase(const QwtDoubleRect &base)
+{
+/*    const QwtPlot *plt = plot();
+    if ( !plt )
+        return;
+
+    const QwtDoubleRect sRect = scaleRect();
+    const QwtDoubleRect bRect = base | sRect;
+
+    d_data->zoomStack.clear();
+    d_data->zoomStack.push(bRect);
+    d_data->zoomRectIndex = 0;
+
+    if ( base != sRect )
+    {
+        d_data->zoomStack.push(sRect);
+        d_data->zoomRectIndex++;
+    }
+
+    rescale();*/
+
+    const QwtPlot *plt = plot();
+    if ( !plt )
+        return;
+
+    d_data->zoomStack.clear();
+    d_data->zoomStack.push(base);
+    d_data->zoomRectIndex = 0;
+
+    rescale();
+}
+
+/*! 
+  Rectangle at the current position on the zoom stack. 
+
+  \sa QwtPlotZoomer::zoomRectIndex(), QwtPlotZoomer::scaleRect().
+*/
+QwtDoubleRect QwtPlotZoomer::zoomRect() const
+{
+    return d_data->zoomStack[d_data->zoomRectIndex];
+}
+
+/*! 
+  \return Index of current position of zoom stack.
+*/
+uint QwtPlotZoomer::zoomRectIndex() const
+{
+    return d_data->zoomRectIndex;
+}
+
+/*!
+  \brief Zoom in
+
+  Clears all rectangles above the current position of the
+  zoom stack and pushs the intersection of zoomRect() and 
+  the normalized rect on it.
+
+  \note If the maximal stack depth is reached, zoom is ignored.
+*/
+
+void QwtPlotZoomer::zoom(const QwtDoubleRect &rect)
+{   
+    if ( d_data->maxStackDepth >= 0 && 
+        int(d_data->zoomRectIndex) >= d_data->maxStackDepth )
+    {
+        return;
+    }
+
+    const QwtDoubleRect zoomRect = d_data->zoomStack[0] & rect.normalized();
+    if ( zoomRect != d_data->zoomStack[d_data->zoomRectIndex] )
+    {
+        for ( uint i = int(d_data->zoomStack.count()) - 1; 
+           i > d_data->zoomRectIndex; i-- )
+        {
+            (void)d_data->zoomStack.pop();
+        }
+
+        d_data->zoomStack.push(zoomRect);
+        d_data->zoomRectIndex++;
+
+        rescale();
+    }
+}
+
+/*!
+  \brief Zoom in or out
+
+  Activate a rectangle on the zoom stack with an offset relative
+  to the current position. Negative values of offest will zoom out,
+  positive zoom in. A value of 0 zooms out to the zoom base.
+
+  \param offset Offset relative to the current position of the zoom stack.
+  \sa zoomRectIndex()
+*/
+void QwtPlotZoomer::zoom(int offset)
+{
+    if ( offset == 0 )
+        d_data->zoomRectIndex = 0;
+    else
+    {
+        int newIndex = d_data->zoomRectIndex + offset;
+        newIndex = qwtMax(0, newIndex);
+        newIndex = qwtMin(int(d_data->zoomStack.count()) - 1, newIndex);
+
+        d_data->zoomRectIndex = uint(newIndex);
+    }
+
+    rescale();
+}
+
+/*! 
+  Adjust the observed plot to zoomRect()
+
+  \note Initiates QwtPlot::replot
+*/
+
+void QwtPlotZoomer::rescale()
+{
+    QwtPlot *plt = plot();
+    if ( !plt )
+        return;
+
+    const QwtDoubleRect &rect = d_data->zoomStack[d_data->zoomRectIndex];
+    if ( rect != scaleRect() )
+    {
+        const bool doReplot = plt->autoReplot();
+        plt->setAutoReplot(false);
+
+        double x1 = rect.left();
+        double x2 = rect.right();
+        if ( plt->axisScaleDiv(xAxis())->lBound() > 
+            plt->axisScaleDiv(xAxis())->hBound() )
+        {
+            qSwap(x1, x2);
+        }
+
+        plt->setAxisScale(xAxis(), x1, x2);
+
+        double y1 = rect.top();
+        double y2 = rect.bottom();
+        if ( plt->axisScaleDiv(yAxis())->lBound() > 
+            plt->axisScaleDiv(yAxis())->hBound() )
+        {
+            qSwap(y1, y2);
+        }
+        plt->setAxisScale(yAxis(), y1, y2);
+
+        plt->setAutoReplot(doReplot);
+
+        plt->replot();
+    }
+}
+
+/*!
+  Reinitialize the axes, and set the zoom base to their scales.
+
+  \param xAxis X axis 
+  \param yAxis Y axis
+*/
+
+void QwtPlotZoomer::setAxis(int xAxis, int yAxis)
+{
+    if ( xAxis != QwtPlotPicker::xAxis() || yAxis != QwtPlotPicker::yAxis() )
+    {
+        QwtPlotPicker::setAxis(xAxis, yAxis);
+        setZoomBase(scaleRect());
+    }
+}
+
+/*!
+   Qt::MidButton zooms out one position on the zoom stack,
+   Qt::RightButton to the zoom base.
+
+   Changes the current position on the stack, but doesn�t pop
+   any rectangle.
+
+   \note The mouse events can be changed, using
+         QwtEventPattern::setMousePattern: 2, 1
+*/
+void QwtPlotZoomer::widgetMouseReleaseEvent(QMouseEvent *me)
+{
+    if ( mouseMatch(MouseSelect2, me) )
+        zoom(0);
+    else if ( mouseMatch(MouseSelect3, me) )
+        zoom(-1);
+    else if ( mouseMatch(MouseSelect6, me) )
+        zoom(+1);
+    else 
+        QwtPlotPicker::widgetMouseReleaseEvent(me);
+}
+
+/*!
+   Qt::Key_Plus zooms out, Qt::Key_Minus zooms in one position on the 
+   zoom stack, Qt::Key_Escape zooms out to the zoom base.
+
+   Changes the current position on the stack, but doesn�t pop
+   any rectangle.
+
+   \note The keys codes can be changed, using
+         QwtEventPattern::setKeyPattern: 3, 4, 5
+*/
+
+void QwtPlotZoomer::widgetKeyPressEvent(QKeyEvent *ke)
+{
+    if ( !isActive() )
+    {
+        if ( keyMatch(KeyUndo, ke) )
+            zoom(-1);
+        else if ( keyMatch(KeyRedo, ke) )
+            zoom(+1);
+        else if ( keyMatch(KeyHome, ke) )
+            zoom(0);
+    }
+
+    QwtPlotPicker::widgetKeyPressEvent(ke);
+}
+
+/*!
+  Move the current zoom rectangle.
+
+  \param dx X offset
+  \param dy Y offset
+
+  \note The changed rectangle is limited by the zoom base
+*/
+void QwtPlotZoomer::moveBy(double dx, double dy)
+{
+    const QwtDoubleRect &rect = d_data->zoomStack[d_data->zoomRectIndex];
+    move(rect.left() + dx, rect.top() + dy);
+}
+
+/*!
+  Move the the current zoom rectangle.
+
+  \param x X value
+  \param y Y value
+
+  \sa QwtDoubleRect::move
+  \note The changed rectangle is limited by the zoom base
+*/
+void QwtPlotZoomer::move(double x, double y)
+{
+    x = qwtMax(x, zoomBase().left());
+    x = qwtMin(x, zoomBase().right() - zoomRect().width());
+
+    y = qwtMax(y, zoomBase().top());
+    y = qwtMin(y, zoomBase().bottom() - zoomRect().height());
+
+    if ( x != zoomRect().left() || y != zoomRect().top() )
+    {
+        d_data->zoomStack[d_data->zoomRectIndex].moveTo(x, y);
+        rescale();
+    }
+}
+
+/*!
+  \brief Check and correct a selected rectangle
+
+  Reject rectangles with a hight or width < 2, otherwise
+  expand the selected rectangle to a minimum size of 11x11
+  and accept it.
+  
+  \return true If rect is accepted, or has been changed
+          to a accepted rectangle. 
+*/
+
+bool QwtPlotZoomer::accept(SelectedPoints &pa) const
+{
+    if ( pa.count() < 2 )
+        return false;
+
+    QRect rect = QRect(pa[0], pa[int(pa.count()) - 1]);
+#if QT_VERSION < 0x040000
+    rect = rect.normalize();
+#else
+    rect = rect.normalized();
+#endif
+
+    const int minSize = 2;
+    if (rect.width() < minSize && rect.height() < minSize )
+        return false; 
+
+    const int minZoomSize = 11;
+
+    const QPoint center = rect.center();
+    rect.setSize(rect.size().expandedTo(QSize(minZoomSize, minZoomSize)));
+    rect.moveCenter(center);
+
+    pa.resize(2);
+    pa[0] = rect.topLeft();
+    pa[1] = rect.bottomRight();
+
+    return true;
+}
+
+/*!
+  \brief Limit zooming by a minimum rectangle
+
+  \return zoomBase().width() / 10e4, zoomBase().height() / 10e4
+*/
+QwtDoubleSize QwtPlotZoomer::minZoomSize() const
+{
+    return QwtDoubleSize(
+        d_data->zoomStack[0].width() / 10e4,
+        d_data->zoomStack[0].height() / 10e4
+    );
+}
+
+/*! 
+  Rejects selections, when the stack depth is too deep, or
+  the zoomed rectangle is minZoomSize().
+
+  \sa minZoomSize(), maxStackDepth()
+*/
+void QwtPlotZoomer::begin()
+{
+    if ( d_data->maxStackDepth >= 0 )
+    {
+        if ( d_data->zoomRectIndex >= uint(d_data->maxStackDepth) )
+            return;
+    }
+
+    const QwtDoubleSize minSize = minZoomSize();
+    if ( minSize.isValid() )
+    {
+        const QwtDoubleSize sz = 
+            d_data->zoomStack[d_data->zoomRectIndex].size() * 0.9999;
+
+        if ( minSize.width() >= sz.width() &&
+            minSize.height() >= sz.height() )
+        {
+            return;
+        }
+    }
+
+    QwtPlotPicker::begin();
+}
+
+/*!
+  Expand the selected rectangle to minZoomSize() and zoom in
+  if accepted.
+
+  \note The zoomed signal is emitted.
+  \sa QwtPlotZoomer::accept()a, QwtPlotZoomer::minZoomSize()
+*/
+bool QwtPlotZoomer::end(bool ok)
+{
+    ok = QwtPlotPicker::end(ok);
+    if (!ok)
+        return false;
+
+    QwtPlot *plot = QwtPlotZoomer::plot();
+    if ( !plot )
+        return false;
+
+    const SelectedPoints &pa = selection();
+    if ( pa.count() < 2 )
+        return false;
+
+    QRect rect = QRect(pa[0], pa[int(pa.count() - 1)]);
+#if QT_VERSION < 0x040000
+    rect = rect.normalize();
+#else
+    rect = rect.normalized();
+#endif
+
+
+    QwtDoubleRect zoomRect = invTransform(rect).normalized();
+
+    const QwtDoublePoint center = zoomRect.center();
+    zoomRect.setSize(zoomRect.size().expandedTo(minZoomSize()));
+    zoomRect.moveCenter(center);
+
+    zoom(zoomRect);
+    emit zoomed(zoomRect);
+
+    return true;
+}
+
+/*!
+  Set the selection flags
+  
+  \param flags Or�d value of QwtPicker::RectSelectionType and
+               QwtPicker::SelectionMode. The default value is 
+               QwtPicker::RectSelection & QwtPicker::ClickSelection.
+
+  \sa selectionFlags(), SelectionType, RectSelectionType, SelectionMode
+  \note QwtPicker::RectSelection will be auto added.
+*/
+
+void QwtPlotZoomer::setSelectionFlags(int flags)
+{
+    // we accept only rects
+    flags &= ~(PointSelection | PolygonSelection);
+    flags |= RectSelection;
+
+    QwtPlotPicker::setSelectionFlags(flags);
+}
diff --git a/src/qwt/qwt_rect.cpp b/src/qwt/qwt_rect.cpp
new file mode 100644
index 0000000..aa63e8a
--- /dev/null
+++ b/src/qwt/qwt_rect.cpp
@@ -0,0 +1,157 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_math.h"
+#include "qwt_rect.h"
+
+#if QT_VERSION < 0x040000
+#define QwtPointArray QPointArray
+#else
+#define QwtPointArray QPolygon
+#endif
+
+//! Constructor
+
+QwtRect::QwtRect(): 
+    QRect() 
+{
+}
+
+//! Copy constructor
+QwtRect::QwtRect(const QRect &r): 
+    QRect(r) 
+{
+}
+
+inline static void addPoint(QwtPointArray &pa, uint pos, const QPoint &point)
+{
+    if ( uint(pa.size()) <= pos ) 
+        pa.resize(pos + 5);
+
+    pa.setPoint(pos, point);
+}
+
+//! Sutherland-Hodgman polygon clipping
+
+QwtPointArray QwtRect::clip(const QwtPointArray &pa) const
+{
+    if ( contains( pa.boundingRect() ) )
+        return pa;
+
+    QwtPointArray cpa(pa.size());
+
+    clipEdge((Edge)0, pa, cpa);
+
+    for ( uint edge = 1; edge < NEdges; edge++ ) 
+    {
+        const QwtPointArray rpa = cpa;
+#if QT_VERSION < 0x040000
+        cpa.detach();
+#endif
+        clipEdge((Edge)edge, rpa, cpa);
+    }
+
+    return cpa;
+}
+
+bool QwtRect::insideEdge(const QPoint &p, Edge edge) const
+{
+    switch(edge) 
+    {
+        case Left:
+            return p.x() > left();
+        case Top:
+            return p.y() > top();
+        case Right:
+            return p.x() < right();
+        case Bottom:
+            return p.y() < bottom();
+        default:
+            break;
+    }
+
+    return false;
+}
+
+QPoint QwtRect::intersectEdge(const QPoint &p1, 
+    const QPoint &p2, Edge edge ) const
+{
+    int x=0, y=0;
+    double m = 0;
+
+    const double dy = p2.y() - p1.y();
+    const double dx = p2.x() - p1.x();
+
+    switch ( edge ) 
+    {
+        case Left:
+            x = left();
+            m = double(qwtAbs(p1.x() - x)) / qwtAbs(dx);
+            y = p1.y() + int(dy * m);
+            break;
+        case Top:
+            y = top();
+            m = double(qwtAbs(p1.y() - y)) / qwtAbs(dy);
+            x = p1.x() + int(dx * m);
+            break;
+        case Right:
+            x = right();
+            m = double(qwtAbs(p1.x() - x)) / qwtAbs(dx);
+            y = p1.y() + int(dy * m);
+            break;
+        case Bottom:
+            y = bottom();
+            m = double(qwtAbs(p1.y() - y)) / qwtAbs(dy);
+            x = p1.x() + int(dx * m);
+            break;
+        default:
+            break;
+    }
+
+    return QPoint(x,y);
+}
+
+void QwtRect::clipEdge(Edge edge, 
+    const QwtPointArray &pa, QwtPointArray &cpa) const
+{
+    if ( pa.count() == 0 )
+    {
+        cpa.resize(0);
+        return;
+    }
+
+    unsigned int count = 0;
+
+    QPoint p1 = pa.point(0);
+    if ( insideEdge(p1, edge) )
+        addPoint(cpa, count++, p1);
+
+    const uint nPoints = pa.size();
+    for ( uint i = 1; i < nPoints; i++ )
+    {
+        const QPoint p2 = pa.point(i);
+        if ( insideEdge(p2, edge) )
+        {
+            if ( insideEdge(p1, edge) )
+                addPoint(cpa, count++, p2);
+            else
+            {
+                addPoint(cpa, count++, intersectEdge(p1, p2, edge));
+                addPoint(cpa, count++, p2);
+            }
+        }
+        else
+        {
+            if ( insideEdge(p1, edge) )
+                addPoint(cpa, count++, intersectEdge(p1, p2, edge));
+        }
+        p1 = p2;
+    }
+    cpa.resize(count);
+}
diff --git a/src/qwt/qwt_round_scale_draw.cpp b/src/qwt/qwt_round_scale_draw.cpp
new file mode 100644
index 0000000..acc40ac
--- /dev/null
+++ b/src/qwt/qwt_round_scale_draw.cpp
@@ -0,0 +1,392 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <math.h>
+#include <qpen.h>
+#include <qpainter.h>
+#include <qfontmetrics.h>
+#include "qwt_painter.h"
+#include "qwt_scale_div.h"
+#include "qwt_scale_map.h"
+#include "qwt_round_scale_draw.h"
+
+class QwtRoundScaleDraw::PrivateData
+{
+public:
+    PrivateData():
+        center(50, 50),
+        radius(50),
+        minAngle(-135 * 16),
+        maxAngle(135 * 16)
+    {
+    }
+
+    QPoint center;
+    int radius; 
+
+    int minAngle;
+    int maxAngle;
+};
+
+/*!
+  \brief Constructor
+
+  The range of the scale is initialized to [0, 100],
+  The center is set to (50, 50) with a radius of 50.
+  The angle range is set to [-135, 135].
+*/
+QwtRoundScaleDraw::QwtRoundScaleDraw()
+{
+    d_data = new QwtRoundScaleDraw::PrivateData;
+
+    setRadius(50);
+    scaleMap().setPaintInterval(d_data->minAngle, d_data->maxAngle);
+}
+
+//! Copy constructor
+QwtRoundScaleDraw::QwtRoundScaleDraw(const QwtRoundScaleDraw &other):
+    QwtAbstractScaleDraw(other)
+{
+    d_data = new QwtRoundScaleDraw::PrivateData(*other.d_data);
+}
+
+
+//! Destructor
+QwtRoundScaleDraw::~QwtRoundScaleDraw()
+{
+    delete d_data;
+}
+
+//! Assignment operator
+QwtRoundScaleDraw &QwtRoundScaleDraw::operator=(const QwtRoundScaleDraw &other)
+{
+    *(QwtAbstractScaleDraw*)this = (const QwtAbstractScaleDraw &)other;
+    *d_data = *other.d_data;
+    return *this;
+}
+
+/*!
+  Change of radius the scale
+
+  Radius is the radius of the backbone without ticks and labels.
+
+  \param radius New Radius
+  \sa moveCenter
+*/
+void QwtRoundScaleDraw::setRadius(int radius)
+{
+    d_data->radius = radius;
+}
+
+/*!
+  Get the radius 
+
+  Radius is the radius of the backbone without ticks and labels.
+
+  \sa setRadius(), extent()
+*/
+int QwtRoundScaleDraw::radius() const
+{
+    return d_data->radius;
+}
+
+/*!
+   Move the center of the scale draw, leaving the radius unchanged
+
+   \param center New center
+   \sa setRadius
+*/
+void QwtRoundScaleDraw::moveCenter(const QPoint &center)
+{
+    d_data->center = center;
+}
+
+//! Get the center of the scale
+QPoint QwtRoundScaleDraw::center() const
+{
+    return d_data->center;
+}
+
+/*!
+  \brief Adjust the baseline circle segment for round scales.
+
+  The baseline will be drawn from min(angle1,angle2) to max(angle1, angle2).
+  The default setting is [ -135, 135 ].
+  An angle of 0 degrees corresponds to the 12 o'clock position,
+  and positive angles count in a clockwise direction.
+  \param angle1
+  \param angle2 boundaries of the angle interval in degrees.
+  \warning <ul> 
+  <li>The angle range is limited to [-360, 360] degrees. Angles exceeding
+      this range will be clipped.
+  <li>For angles more than 359 degrees above or below min(angle1, angle2),
+      scale marks will not be drawn.
+  <li>If you need a counterclockwise scale, use QwtScaleDiv::setRange
+  </ul>
+*/
+void QwtRoundScaleDraw::setAngleRange(double angle1, double angle2)
+{
+    angle1 = qwtLim(angle1, -360.0, 360.0);
+    angle2 = qwtLim(angle2, -360.0, 360.0);
+
+    int amin = qRound(qwtMin(angle1, angle2) * 16.0);
+    int amax = qRound(qwtMax(angle1, angle2) * 16.0); 
+ 
+    if (amin == amax)
+    {
+        amin -= 1;
+        amax += 1;
+    }
+ 
+    d_data->minAngle = amin;
+    d_data->maxAngle = amax;
+    scaleMap().setPaintInterval(d_data->minAngle, d_data->maxAngle);
+}
+
+/*!
+   Draws the label for a major scale tick
+
+   \param painter Painter
+   \param value Value
+
+   \sa drawTick(), drawBackbone()
+*/
+void QwtRoundScaleDraw::drawLabel(QPainter *painter, double value) const
+{
+    const QwtText label = tickLabel(painter->font(), value);
+    if ( label.isEmpty() )
+        return; 
+
+    const int tval = map().transform(value);
+    if ((tval > d_data->minAngle + 359 * 16)
+        || (tval < d_data->minAngle - 359 * 16))
+    {
+       return; 
+    }
+
+    const double arc = tval / 16.0 / 360.0 * 2 * M_PI;
+
+    QRect r( QPoint(0, 0), label.textSize(painter->font()) );
+    r.moveCenter(labelCenter(painter->font(), arc, label));
+
+    label.draw(painter, r);
+}
+
+/*!
+   Draw a tick
+   
+   \param painter Painter
+   \param value Value of the tick
+   \param len Lenght of the tick
+
+   \sa drawBackbone(), drawLabel() 
+*/
+void QwtRoundScaleDraw::drawTick(QPainter *painter, double value, int len) const
+{
+    if ( len <= 0 )
+        return;
+
+    const int tval = map().transform(value);
+
+    const int cx = d_data->center.x();
+    const int cy = d_data->center.y();
+    const int radius = d_data->radius;
+
+    if ((tval <= d_data->minAngle + 359 * 16)
+        || (tval >= d_data->minAngle - 359 * 16))
+    {
+        const double arc = double(tval) / 16.0 * M_PI / 180.0;
+
+        const double sinArc = sin(arc);
+        const double cosArc = cos(arc);
+
+        const int x1 = qRound( cx + radius * sinArc );
+        const int x2 = qRound( cx + (radius + len) * sinArc );
+        const int y1 = qRound( cy - radius * cosArc );
+        const int y2 = qRound( cy - (radius + len) * cosArc );
+
+        QwtPainter::drawLine(painter, x1, y1, x2, y2);
+    }
+}
+
+/*!
+   Draws the baseline of the scale
+   \param painter Painter
+
+   \sa drawTick(), drawLabel()
+*/
+void QwtRoundScaleDraw::drawBackbone(QPainter *painter) const
+{
+    const int a1 = qRound(qwtMin(map().p1(), map().p2()) - 90 * 16);
+    const int a2 = qRound(qwtMax(map().p1(), map().p2()) - 90 * 16);
+
+    const int radius = d_data->radius;
+    const int x = d_data->center.x() - radius;
+    const int y = d_data->center.y() - radius;
+
+    painter->drawArc(x, y, 2 * radius, 2 * radius,
+        -a2, a2 - a1 + 1);           // counterclockwise
+}
+
+/*!
+   Calculate the extent of the scale
+
+   The extent is the distcance between the baseline to the outermost
+   pixel of the scale draw. radius() + extent() is an upper limit 
+   for the radius of the bounding circle.
+
+   \param pen Pen that is used for painting backbone and ticks
+   \param font Font used for painting the labels
+
+   \sa setMinimumExtent(), minimumExtent()
+   \warning The implemented algo is not too smart and
+            calculates only an upper limit, that might be a
+            few pixels too large
+*/
+int QwtRoundScaleDraw::extent(const QPen &pen, const QFont &font) const
+{
+    int d = 0;
+
+    if ( hasComponent(QwtAbstractScaleDraw::Labels) )
+    {
+        const QwtScaleDiv &sd = scaleDiv();
+        const QwtTickList &ticks = sd.ticks(QwtScaleDiv::MajorTick);
+        for (uint i = 0; i < (uint)ticks.count(); i++)
+        {
+            const double v = ticks[i];
+            if ( sd.contains(v) )
+            {
+                const QRect r = labelRect(font, v);
+                if ( !r.isEmpty() )
+                {
+                    int dx = r.center().x() - d_data->center.x();
+                    int dy = r.center().y() - d_data->center.y();
+
+                    const int dist1 = 
+                        qRound(sqrt((double)(dx * dx + dy * dy)));
+
+                    dx = r.width() / 2 + r.width() % 2;
+                    dy = r.height() / 2 + r.height() % 2;
+
+                    const int dist2 = 
+                        qRound(sqrt((double)(dx * dx + dy * dy)));
+
+                    int dist = dist1 + dist2;
+                    if ( dist > d )
+                        d = dist;
+                }
+            }
+        }
+        d -= d_data->radius;
+    }
+
+    if ( d == 0 )
+    {
+        if ( hasComponent(QwtAbstractScaleDraw::Ticks) )
+        {
+            d += majTickLength();
+        }
+
+        if ( hasComponent(QwtAbstractScaleDraw::Backbone) )
+        {
+            const int pw = qwtMax( 1, pen.width() );  // penwidth can be zero
+            d += pw;
+        }
+
+    }
+    d = qwtMax(d, minimumExtent());
+
+    return d;
+}
+
+/*!
+  Find the size of the label. 
+
+  \param font Font
+  \param value Value
+*/
+QSize QwtRoundScaleDraw::labelSize(
+    const QFont &font, double value) const
+{   
+    return tickLabel(font, value).textSize(font);
+}
+
+/*!
+  Calculate the bounding rect for a tick label
+
+  \param font Font, that will be used to paint the scale draw 
+  \param value Value of the tick label
+
+  \sa labelSize(), labelCenter()
+*/
+QRect QwtRoundScaleDraw::labelRect(const QFont &font, double value) const
+{
+    const QwtText label = tickLabel(font, value);
+    if ( label.isEmpty() )
+        return QRect(); 
+
+    const int tval = map().transform(value);
+    if ((tval > d_data->minAngle + 359 * 16)
+        || (tval < d_data->minAngle - 359 * 16))
+    {
+       return QRect();
+    }
+
+    const double arc = tval / 16.0 / 360.0 * 2 * M_PI;
+
+    QRect r( QPoint(0, 0), label.textSize(font) );
+    r.moveCenter(labelCenter(font, arc, label));
+
+    return r;
+}
+
+/*!
+  Find the position, where to move the center of a label 
+*/
+QPoint QwtRoundScaleDraw::labelCenter( 
+    const QFont &font, double arc, const QwtText& label) const
+{   
+    const QFont fnt = label.usedFont(font);
+
+    QFontMetrics fm(fnt);
+    const int fmh = fm.ascent() - 2;
+
+    double radius = d_data->radius + spacing();
+    if ( hasComponent(QwtAbstractScaleDraw::Ticks) )
+        radius += majTickLength();
+
+    // First we find the point on a circle enlarged
+    // by half of the font height.
+
+    double xOffset = ( radius + fmh / 2 ) * sin(arc);
+    double yOffset = ( radius + fmh / 2 ) * cos(arc);
+
+    if ( qRound(xOffset) != 0 )
+    {
+        // The centered label might cut the circle
+        // with distance: d_data->radius + d_data->majLen + d_data->vpad
+        // We align the label to the circle by moving
+        // the x-coordinate, because we have only
+        // horizontal labels here.
+
+        const int brw = label.textSize(font).width();
+
+        const double circleX = radius * sin(arc);
+        if ( xOffset < 0 )
+            xOffset = circleX - brw / 2; // left
+        else
+            xOffset = circleX + brw / 2; // right
+    }
+    const int x = d_data->center.x() + qRound(xOffset);
+    const int y = d_data->center.y() - qRound(yOffset);
+
+    return QPoint(x, y);
+}
diff --git a/src/qwt/qwt_scale_div.cpp b/src/qwt/qwt_scale_div.cpp
new file mode 100644
index 0000000..5967ee5
--- /dev/null
+++ b/src/qwt/qwt_scale_div.cpp
@@ -0,0 +1,146 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_scale_div.h"
+#include "qwt_math.h"
+#include "qwt_double_interval.h"
+
+//! Construct an invalid QwtScaleDiv instance.
+QwtScaleDiv::QwtScaleDiv():
+    d_lBound(0.0),
+    d_hBound(0.0),
+    d_isValid(false)
+{
+}
+
+/*! 
+  Construct QwtScaleDiv instance.
+
+  \param interval Interval
+  \param ticks List of major, medium and minor ticks
+*/
+QwtScaleDiv::QwtScaleDiv(
+        const QwtDoubleInterval &interval, 
+        QwtTickList ticks[NTickTypes]):
+    d_lBound(interval.minValue()),
+    d_hBound(interval.maxValue()),
+    d_isValid(true)
+{
+    for ( int i = 0; i < NTickTypes; i++ )
+        d_ticks[i] = ticks[i];
+}
+
+/*! 
+  Construct QwtScaleDiv instance.
+
+  \param lBound First interval limit
+  \param hBound Second interval limit
+  \param ticks List of major, medium and minor ticks
+*/
+QwtScaleDiv::QwtScaleDiv(
+        double lBound, double hBound,
+        QwtTickList ticks[NTickTypes]):
+    d_lBound(lBound),
+    d_hBound(hBound),
+    d_isValid(true)
+{
+    for ( int i = 0; i < NTickTypes; i++ )
+        d_ticks[i] = ticks[i];
+}
+
+/*!
+  \brief Equality operator
+  \return true if this instance is equal to other
+*/
+int QwtScaleDiv::operator==(const QwtScaleDiv &other) const
+{
+    if ( d_lBound != other.d_lBound ||
+        d_hBound != other.d_hBound ||
+        d_isValid != other.d_isValid )
+    {
+        return false;
+    }
+
+    for ( int i = 0; i < NTickTypes; i++ )
+    {
+        if ( d_ticks[i] != other.d_ticks[i] )
+            return false;
+    }
+
+    return true;
+}
+
+/*!
+  \brief Inequality
+  \return true if this instance is not equal to s
+*/
+int QwtScaleDiv::operator!=(const QwtScaleDiv &s) const
+{
+    return (!(*this == s));
+}
+
+//! Invalidate the scale division
+void QwtScaleDiv::invalidate()
+{
+    d_isValid = false;
+
+    // detach arrays
+    for ( int i = 0; i < NTickTypes; i++ )
+        d_ticks[i].clear();
+
+    d_lBound = d_hBound = 0;
+}
+
+//! Check if the scale division is valid
+bool QwtScaleDiv::isValid() const
+{
+    return d_isValid;
+}
+
+bool QwtScaleDiv::contains(double v) const
+{
+    if ( !d_isValid )
+        return false;
+
+    const double min = qwtMin(d_lBound, d_hBound);
+    const double max = qwtMax(d_lBound, d_hBound);
+
+    return v >= min && v <= max;
+}
+
+//! Invert the scale divison
+void QwtScaleDiv::invert()
+{
+    qSwap(d_lBound, d_hBound);
+
+    for ( int i = 0; i < NTickTypes; i++ )
+    {
+        QwtTickList& ticks = d_ticks[i];
+
+        const int size = ticks.count();
+        const int size2 = size / 2;
+ 
+        for (int i=0; i < size2; i++)
+            qSwap(ticks[i], ticks[size - 1 - i]);
+    }
+}
+
+/*!
+   Return a list of ticks
+
+   \param type MinorTick, MediumTick or MajorTick
+*/
+const QwtTickList &QwtScaleDiv::ticks(int type) const
+{
+    if ( type >= 0 || type < NTickTypes )
+        return d_ticks[type];
+
+    static QwtTickList noTicks;
+    return noTicks;
+}
diff --git a/src/qwt/qwt_scale_draw.cpp b/src/qwt/qwt_scale_draw.cpp
new file mode 100644
index 0000000..ca2b8d7
--- /dev/null
+++ b/src/qwt/qwt_scale_draw.cpp
@@ -0,0 +1,833 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qpen.h>
+#include <qpainter.h>
+#include "qwt_math.h"
+#include "qwt_painter.h"
+#include "qwt_scale_div.h"
+#include "qwt_scale_map.h"
+#include "qwt_scale_draw.h"
+
+#if QT_VERSION < 0x040000
+#include <qwmatrix.h>
+#define QwtMatrix QWMatrix
+#define QwtPointArray QPointArray
+#else
+#include <qmatrix.h>
+#define QwtMatrix QMatrix
+#define QwtPointArray QPolygon
+#endif
+
+class QwtScaleDraw::PrivateData
+{
+public:
+    PrivateData():
+        len(0),
+        alignment(QwtScaleDraw::BottomScale),
+        labelAlignment(0),
+        labelRotation(0.0)
+    {
+    }
+
+    QPoint pos;
+    int len;
+
+    Alignment alignment;
+
+#if QT_VERSION < 0x040000
+    int labelAlignment;
+#else
+    Qt::Alignment labelAlignment;
+#endif
+    double labelRotation;
+};
+
+/*!
+  \brief Constructor
+
+  The range of the scale is initialized to [0, 100],
+  The position is at (0, 0) with a length of 100.
+  The orientation is QwtAbstractScaleDraw::Bottom.
+*/
+QwtScaleDraw::QwtScaleDraw()
+{
+    d_data = new QwtScaleDraw::PrivateData;
+    setLength(100);
+}
+
+//! Copy constructor
+QwtScaleDraw::QwtScaleDraw(const QwtScaleDraw &other):
+    QwtAbstractScaleDraw(other)
+{
+    d_data = new QwtScaleDraw::PrivateData(*other.d_data);
+}
+
+//! Destructor
+QwtScaleDraw::~QwtScaleDraw()
+{
+    delete d_data;
+}
+
+//! Assignment operator
+QwtScaleDraw &QwtScaleDraw::operator=(const QwtScaleDraw &other)
+{
+    *(QwtAbstractScaleDraw*)this = (const QwtAbstractScaleDraw &)other;
+    *d_data = *other.d_data;
+    return *this;
+}
+
+/*! 
+   Return alignment of the scale
+   \sa setAlignment()
+*/
+QwtScaleDraw::Alignment QwtScaleDraw::alignment() const 
+{
+    return d_data->alignment; 
+}
+
+/*!
+   Set the alignment of the scale
+
+   The default alignment is QwtScaleDraw::BottomScale
+   \sa alignment()
+*/
+void QwtScaleDraw::setAlignment(Alignment align)
+{
+    d_data->alignment = align;
+}
+
+/*!
+  Return the orientation
+
+  TopScale, BottomScale are horizontal (Qt::Horizontal) scales,
+  LeftScale, RightScale are vertical (Qt::Vertical) scales.
+
+  \sa alignment()
+*/
+Qt::Orientation QwtScaleDraw::orientation() const
+{
+    switch(d_data->alignment)
+    {
+        case TopScale:
+        case BottomScale:
+            return Qt::Horizontal;
+        case LeftScale:
+        case RightScale:
+        default:
+            return Qt::Vertical;
+    }
+}
+
+/*!
+  \brief Determine the minimum border distance
+
+  This member function returns the minimum space
+  needed to draw the mark labels at the scale's endpoints.
+
+  \param font Font
+  \param start Start border distance
+  \param end End border distance
+*/
+void QwtScaleDraw::getBorderDistHint(const QFont &font,
+    int &start, int &end ) const
+{
+    start = 0;
+    end = 0;
+    
+    if ( !hasComponent(QwtAbstractScaleDraw::Labels) )
+        return;
+
+    const QwtTickList &ticks = scaleDiv().ticks(QwtScaleDiv::MajorTick);
+    if ( ticks.count() == 0 ) 
+        return;
+
+    QRect lr = labelRect(font, ticks[0]);
+
+    // find the distance between tick and border
+    int off = qwtAbs(map().transform(ticks[0]) - qRound(map().p1()));
+
+    if ( orientation() == Qt::Vertical )
+        end = lr.bottom() + 1 - off;
+    else
+        start = -lr.left() - off;
+
+    const int lastTick = ticks.count() - 1;
+    lr = labelRect(font, ticks[lastTick]);
+
+    // find the distance between tick and border
+    off = qwtAbs(map().transform(ticks[lastTick]) - qRound(map().p2()));
+
+    if ( orientation() == Qt::Vertical )
+        start = -lr.top() - off;
+    else
+        end = lr.right() + 1 - off;
+
+    // if the distance between tick and border is larger
+    // than half of the label width/height, we set to 0
+
+    if ( start < 0 )
+        start = 0;
+    if ( end < 0 )
+        end = 0;
+}
+
+/*!
+  Determine the minimum distance between two labels, that is necessary
+  that the texts don't overlap.
+
+  \param font Font
+  \return The maximum width of a label
+
+  \sa getBorderDistHint()
+*/
+
+int QwtScaleDraw::minLabelDist(const QFont &font) const
+{
+    if ( !hasComponent(QwtAbstractScaleDraw::Labels) )
+        return 0;
+
+    const QwtTickList &ticks = scaleDiv().ticks(QwtScaleDiv::MajorTick);
+    if (ticks.count() == 0)
+        return 0;
+
+    const QFontMetrics fm(font);
+
+    const bool vertical = (orientation() == Qt::Vertical);
+
+    QRect bRect1;
+    QRect bRect2 = labelRect(font, ticks[0]);
+    if ( vertical )
+    {
+        bRect2.setRect(-bRect2.bottom(), 0, bRect2.height(), bRect2.width());
+    }
+    int maxDist = 0;
+
+    for (uint i = 1; i < (uint)ticks.count(); i++ )
+    {
+        bRect1 = bRect2;
+        bRect2 = labelRect(font, ticks[i]);
+        if ( vertical )
+        {
+            bRect2.setRect(-bRect2.bottom(), 0,
+                bRect2.height(), bRect2.width());
+        }
+
+        int dist = fm.leading(); // space between the labels
+        if ( bRect1.right() > 0 )
+            dist += bRect1.right();
+        if ( bRect2.left() < 0 )
+            dist += -bRect2.left();
+
+        if ( dist > maxDist )
+            maxDist = dist;
+    }
+
+    double angle = labelRotation() / 180.0 * M_PI;
+    if ( vertical )
+        angle += M_PI / 2;
+
+    if ( sin(angle) == 0.0 )
+        return maxDist;
+
+    const int fmHeight = fm.ascent() - 2; 
+
+    // The distance we need until there is
+    // the height of the label font. This height is needed
+    // for the neighbour labal.
+
+    int labelDist = (int)(fmHeight / sin(angle) * cos(angle));
+    if ( labelDist < 0 )
+        labelDist = -labelDist;
+
+    // The cast above floored labelDist. We want to ceil.
+    labelDist++; 
+
+    // For text orientations close to the scale orientation 
+
+    if ( labelDist > maxDist )
+        labelDist = maxDist;
+
+    // For text orientations close to the opposite of the 
+    // scale orientation
+
+    if ( labelDist < fmHeight )
+        labelDist = fmHeight;
+
+    return labelDist;
+}
+
+/*!
+   Calculate the width/height that is needed for a
+   vertical/horizontal scale.
+
+   The extent is calculated from the pen width of the backbone,
+   the major tick length, the spacing and the maximum width/height
+   of the labels.
+
+   \param pen Pen that is used for painting backbone and ticks
+   \param font Font used for painting the labels
+
+   \sa minLength()
+*/
+int QwtScaleDraw::extent(const QPen &pen, const QFont &font) const
+{
+    int d = 0;
+
+    if ( hasComponent(QwtAbstractScaleDraw::Labels) )
+    {
+        if ( orientation() == Qt::Vertical )
+            d = maxLabelWidth(font);
+        else
+            d = maxLabelHeight(font);
+
+        if ( d > 0 )
+            d += spacing();
+    }
+
+    if ( hasComponent(QwtAbstractScaleDraw::Ticks) )
+    {
+        d += majTickLength();
+    }
+
+    if ( hasComponent(QwtAbstractScaleDraw::Backbone) )
+    {
+        const int pw = qwtMax( 1, pen.width() );  // penwidth can be zero
+        d += pw;
+    }
+
+    d = qwtMax(d, minimumExtent());
+    return d;
+}
+
+/*!
+   Calculate the minimum length that is needed to draw the scale
+
+   \param pen Pen that is used for painting backbone and ticks
+   \param font Font used for painting the labels
+
+   \sa extent()
+*/
+int QwtScaleDraw::minLength(const QPen &pen, const QFont &font) const
+{
+    int startDist, endDist;
+    getBorderDistHint(font, startDist, endDist);
+
+    const QwtScaleDiv &sd = scaleDiv();
+
+    const uint minorCount =
+        sd.ticks(QwtScaleDiv::MinorTick).count() +
+        sd.ticks(QwtScaleDiv::MediumTick).count();
+    const uint majorCount =
+        sd.ticks(QwtScaleDiv::MajorTick).count();
+
+    int lengthForLabels = 0;
+    if ( hasComponent(QwtAbstractScaleDraw::Labels) )
+    {
+        if ( majorCount >= 2 )
+            lengthForLabels = minLabelDist(font) * (majorCount - 1);
+    }
+
+    int lengthForTicks = 0;
+    if ( hasComponent(QwtAbstractScaleDraw::Ticks) )
+    {
+        const int pw = qwtMax( 1, pen.width() );  // penwidth can be zero
+        lengthForTicks = 2 * (majorCount + minorCount) * pw;
+    }
+
+    return startDist + endDist + qwtMax(lengthForLabels, lengthForTicks);
+}
+
+/*!
+   Find the position, where to paint a label
+
+   The position has a distance of majTickLength() + spacing() + 1
+   from the backbone. The direction depends on the alignment()
+
+   \param value Value
+*/
+QPoint QwtScaleDraw::labelPosition( double value) const
+{
+    const int tval = map().transform(value);
+    int dist = spacing() + 1;
+    if ( hasComponent(QwtAbstractScaleDraw::Ticks) )
+        dist += majTickLength();
+
+    int px = 0;
+    int py = 0;
+
+    switch(alignment())
+    {
+        case RightScale:
+        {
+            px = d_data->pos.x() + dist;
+            py = tval;
+            break;
+        }
+        case LeftScale:
+        {
+            px = d_data->pos.x() - dist;
+            py = tval;
+            break;
+        }
+        case BottomScale:
+        {
+            px = tval;
+            py = d_data->pos.y() + dist;
+            break;
+        }
+        case TopScale:
+        {
+            px = tval;
+            py = d_data->pos.y() - dist;
+            break;
+        }
+    }
+
+    return QPoint(px, py);
+}
+
+/*!
+   Draw a tick
+
+   \param painter Painter
+   \param value Value of the tick
+   \param len Lenght of the tick
+
+   \sa drawBackbone(), drawLabel()
+*/
+void QwtScaleDraw::drawTick(QPainter *painter, double value, int len) const
+{
+    if ( len <= 0 )
+        return;
+    
+    const int tval = map().transform(value);
+
+    switch(alignment())
+    {
+        case LeftScale:
+            QwtPainter::drawLine(painter, d_data->pos.x(), tval,
+                d_data->pos.x() - len, tval);
+            break;
+
+        case RightScale:
+            QwtPainter::drawLine(painter, d_data->pos.x(), tval,
+                d_data->pos.x() + len, tval);
+            break;
+    
+        case BottomScale:
+            QwtPainter::drawLine(painter, tval, d_data->pos.y(),
+                tval, d_data->pos.y() + len);
+            break;
+
+        case TopScale:
+            QwtPainter::drawLine(painter, tval, d_data->pos.y(),
+                tval, d_data->pos.y() - len);
+            break;
+    }
+}
+
+/*! 
+   Draws the baseline of the scale
+   \param painter Painter
+
+   \sa drawTick(), drawLabel()
+*/
+void QwtScaleDraw::drawBackbone(QPainter *painter) const
+{
+    const int bw2 = painter->pen().width() / 2;
+
+    const QPoint &pos = d_data->pos;
+    const int len = d_data->len - 1;
+
+    switch(alignment())
+    {
+        case LeftScale:
+            QwtPainter::drawLine(painter, pos.x() - bw2,
+                pos.y(), pos.x() - bw2, pos.y() + len);
+            break;
+        case RightScale:
+            QwtPainter::drawLine(painter, pos.x() + bw2,
+                pos.y(), pos.x() + bw2, pos.y() + len);
+            break;
+        case TopScale:
+            QwtPainter::drawLine(painter, pos.x(), pos.y() - bw2,
+                pos.x() + len, pos.y() - bw2);
+            break;
+        case BottomScale:
+            QwtPainter::drawLine(painter, pos.x(), pos.y() + bw2,
+                pos.x() + len, pos.y() + bw2);
+            break;
+    }
+}
+
+/*!
+  \brief Move the position of the scale
+
+  The meaning of the parameter pos depends on the alignment:
+  <dl>
+  <dt>QwtScaleDraw::LeftScale
+  <dd>The origin is the topmost point of the
+      backbone. The backbone is a vertical line. 
+      Scale marks and labels are drawn 
+      at the left of the backbone.
+  <dt>QwtScaleDraw::RightScale
+  <dd>The origin is the topmost point of the
+      backbone. The backbone is a vertical line. 
+      Scale marks and labels are drawn
+      at the right of the backbone.
+  <dt>QwtScaleDraw::TopScale
+  <dd>The origin is the leftmost point of the
+      backbone. The backbone is a horizontal line. 
+      Scale marks and labels are drawn
+      above the backbone.
+  <dt>QwtScaleDraw::BottomScale
+  <dd>The origin is the leftmost point of the
+      backbone. The backbone is a horizontal line 
+      Scale marks and labels are drawn
+      below the backbone.
+  </dl>
+
+  \param pos Origin of the scale
+
+  \sa pos(), setLength()
+*/
+void QwtScaleDraw::move(const QPoint &pos)
+{
+    d_data->pos = pos;
+    updateMap();
+}
+
+/*! 
+   \return Origin of the scale
+   \sa move(), length()
+*/
+QPoint QwtScaleDraw::pos() const
+{
+    return d_data->pos;
+}
+
+/*!
+  Set the length of the backbone.
+  
+  The length doesn't include the space needed for
+  overlapping labels.
+
+  \sa move(), minLabelDist()
+*/
+void QwtScaleDraw::setLength(int length)
+{
+    d_data->len = qwtMax(length, 10);
+    updateMap();
+}
+
+/*! 
+   \return the length of the backbone
+   \sa setLength(), pos()
+*/
+int QwtScaleDraw::length() const
+{
+    return d_data->len;
+}
+
+/*! 
+   Draws the label for a major scale tick
+
+   \param painter Painter
+   \param value Value
+
+   \sa drawTick, drawBackbone
+*/
+void QwtScaleDraw::drawLabel(QPainter *painter, double value) const
+{
+    QwtText lbl = tickLabel(painter->font(), value);
+    if ( lbl.isEmpty() )
+        return; 
+
+    const QPoint pos = labelPosition(value);
+
+    QSize labelSize = lbl.textSize(painter->font());
+    if ( labelSize.height() % 2 )
+        labelSize.setHeight(labelSize.height() + 1);
+    
+    const QwtMatrix m = labelMatrix( pos, labelSize);
+
+    painter->save();
+#if QT_VERSION < 0x040000
+    painter->setWorldMatrix(m, true);
+#else
+    painter->setMatrix(m, true);
+#endif
+
+    lbl.draw (painter, QRect(QPoint(0, 0), labelSize) );
+    painter->restore();
+}
+
+/*!
+   Calculate the matrix that is needed to paint a label
+   depending on its alignment and rotation.
+
+   \param pos Position where to paint the label
+   \param size Size of the label
+
+   \sa setLabelAlignment(), setLabelRotation()
+*/
+QwtMatrix QwtScaleDraw::labelMatrix( 
+    const QPoint &pos, const QSize &size) const
+{   
+    QwtMatrix m;
+    m.translate(pos.x(), pos.y());
+    m.rotate(labelRotation());
+    
+    int flags = labelAlignment();
+    if ( flags == 0 )
+    {
+        switch(alignment())
+        {
+            case RightScale:
+            {
+                if ( flags == 0 )
+                    flags = Qt::AlignRight | Qt::AlignVCenter;
+                break;
+            }
+            case LeftScale:
+            {
+                if ( flags == 0 )
+                    flags = Qt::AlignLeft | Qt::AlignVCenter;
+                break;
+            }
+            case BottomScale:
+            {
+                if ( flags == 0 )
+                    flags = Qt::AlignHCenter | Qt::AlignBottom;
+                break;
+            }
+            case TopScale:
+            {
+                if ( flags == 0 )
+                    flags = Qt::AlignHCenter | Qt::AlignTop;
+                break;
+            }
+        }
+    }
+
+    const int w = size.width();
+    const int h = size.height();
+
+    int x, y;
+    
+    if ( flags & Qt::AlignLeft )
+        x = -w;
+    else if ( flags & Qt::AlignRight )
+        x = -(w % 2); 
+    else // Qt::AlignHCenter
+        x = -(w / 2);
+        
+    if ( flags & Qt::AlignTop )
+        y =  -h ;
+    else if ( flags & Qt::AlignBottom )
+        y = -(h % 2); 
+    else // Qt::AlignVCenter
+        y = -(h/2);
+        
+    m.translate(x, y);
+    
+    return m;
+}   
+
+/*!
+  Find the bounding rect for the label. The coordinates of
+  the rect are relative to spacing + ticklength from the backbone
+  in direction of the tick.
+
+  \param font Font used for painting
+  \param value Value
+*/
+QRect QwtScaleDraw::labelRect(const QFont &font, double value) const
+{   
+    QwtText lbl = tickLabel(font, value);
+    if ( lbl.isEmpty() )
+        return QRect(0, 0, 0, 0);
+
+    const QPoint pos = labelPosition(value);
+
+    QSize labelSize = lbl.textSize(font);
+    if ( labelSize.height() % 2 )
+    {
+#ifdef __GNUC__
+#warning canvas content is one pixel wrong for fonts with odd pixels height
+#endif
+        labelSize.setHeight(labelSize.height() + 1);
+    }
+
+    const QwtMatrix m = labelMatrix(pos, labelSize);
+
+#if 0
+    QRect br = QwtMetricsMap::translate(m, QRect(QPoint(0, 0), labelSize));
+#else
+    QwtPointArray pol(4);
+    pol.setPoint(0, 0, 0); 
+    pol.setPoint(1, 0, labelSize.height() - 1 );
+    pol.setPoint(2, labelSize.width() - 1, 0);
+    pol.setPoint(3, labelSize.width() - 1, labelSize.height() - 1 );
+
+    pol = QwtMetricsMap::translate(m, pol);
+    QRect br = pol.boundingRect();
+#endif
+
+#if QT_VERSION < 0x040000
+    br.moveBy(-pos.x(), -pos.y());
+#else
+    br.translate(-pos.x(), -pos.y());
+#endif
+
+    return br;
+}
+
+/*!
+   Calculate the size that is needed to draw a label
+
+   \param font Label font
+   \param value Value
+*/
+QSize QwtScaleDraw::labelSize(const QFont &font, double value) const
+{
+    return labelRect(font, value).size();
+}
+
+/*!
+  Rotate all labels.
+
+  When changing the rotation, it might be necessary to
+  adjust the label flags too. Finding a useful combination is
+  often the result of try and error.
+
+  \param rotation Angle in degrees. When changing the label rotation,
+                  the label flags often needs to be adjusted too.
+
+  \sa setLabelAlignment(), labelRotation(), labelAlignment().
+
+*/
+void QwtScaleDraw::setLabelRotation(double rotation)
+{
+    d_data->labelRotation = rotation;
+}
+
+/*!
+  \return the label rotation
+  \sa setLabelRotation(), labelAlignment()
+*/
+double QwtScaleDraw::labelRotation() const
+{
+    return d_data->labelRotation;
+}
+
+/*!
+  \brief Change the label flags
+
+  Labels are aligned to the point ticklength + spacing away from the backbone.
+
+  The alignment is relative to the orientation of the label text.
+  In case of an flags of 0 the label will be aligned  
+  depending on the orientation of the scale: 
+  
+      QwtScaleDraw::TopScale: Qt::AlignHCenter | Qt::AlignTop\n
+      QwtScaleDraw::BottomScale: Qt::AlignHCenter | Qt::AlignBottom\n
+      QwtScaleDraw::LeftScale: Qt::AlignLeft | Qt::AlignVCenter\n
+      QwtScaleDraw::RightScale: Qt::AlignRight | Qt::AlignVCenter\n
+  
+  Changing the alignment is often necessary for rotated labels.
+  
+  \param alignment Or'd Qt::AlignmentFlags <see qnamespace.h>
+
+  \sa setLabelRotation(), labelRotation(), labelAlignment()
+  \warning The various alignments might be confusing. 
+           The alignment of the label is not the alignment
+           of the scale and is not the alignment of the flags
+           (QwtText::flags()) returned from QwtAbstractScaleDraw::label().
+*/    
+      
+#if QT_VERSION < 0x040000
+void QwtScaleDraw::setLabelAlignment(int alignment)
+#else
+void QwtScaleDraw::setLabelAlignment(Qt::Alignment alignment)
+#endif
+{
+    d_data->labelAlignment = alignment;
+}   
+
+/*!
+  \return the label flags
+  \sa setLabelAlignment(), labelRotation()
+*/
+#if QT_VERSION < 0x040000
+int QwtScaleDraw::labelAlignment() const
+#else
+Qt::Alignment QwtScaleDraw::labelAlignment() const
+#endif
+{
+    return d_data->labelAlignment;
+}
+
+/*!
+  \param font Font
+  \return the maximum width of a label
+*/
+int QwtScaleDraw::maxLabelWidth(const QFont &font) const
+{
+    int maxWidth = 0;
+
+    const QwtTickList &ticks = scaleDiv().ticks(QwtScaleDiv::MajorTick);
+    for (uint i = 0; i < (uint)ticks.count(); i++)
+    {
+        const double v = ticks[i];
+        if ( scaleDiv().contains(v) )
+        {
+            const int w = labelSize(font, ticks[i]).width();
+            if ( w > maxWidth )
+                maxWidth = w;
+        }
+    }
+
+    return maxWidth;
+}
+
+/*!
+  \param font Font
+  \return the maximum height of a label
+*/
+int QwtScaleDraw::maxLabelHeight(const QFont &font) const
+{
+    int maxHeight = 0;
+    
+    const QwtTickList &ticks = scaleDiv().ticks(QwtScaleDiv::MajorTick);
+    for (uint i = 0; i < (uint)ticks.count(); i++)
+    {
+        const double v = ticks[i];
+        if ( scaleDiv().contains(v) )
+        {
+            const int h = labelSize(font, ticks[i]).height();
+            if ( h > maxHeight )
+                maxHeight = h; 
+        }       
+    }   
+    
+    return maxHeight;
+}   
+
+void QwtScaleDraw::updateMap()
+{
+    QwtScaleMap &sm = scaleMap();
+    if ( orientation() == Qt::Vertical )
+        sm.setPaintInterval(d_data->pos.y() + d_data->len - 1, d_data->pos.y());
+    else
+        sm.setPaintInterval(d_data->pos.x(), d_data->pos.x() + d_data->len - 1);
+}
diff --git a/src/qwt/qwt_scale_engine.cpp b/src/qwt/qwt_scale_engine.cpp
new file mode 100644
index 0000000..9b4913c
--- /dev/null
+++ b/src/qwt/qwt_scale_engine.cpp
@@ -0,0 +1,916 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_math.h"
+#include "qwt_scale_map.h"
+#include "qwt_scale_engine.h"
+
+static const double _eps = 1.0e-6;
+
+/*!
+  \brief Compare 2 values, relative to an interval
+
+  Values are "equal", when :
+  \f$\cdot value2 - value1 <= abs(intervalSize * 10e^{-6})\f$
+
+  \param value1 First value to compare
+  \param value2 Second value to compare
+  \param intervalSize interval size
+
+  \return 0: if equal, -1: if value2 > value1, 1: if value1 > value2
+*/
+int QwtScaleArithmetic::compareEps(double value1, double value2, 
+    double intervalSize) 
+{
+    const double eps = qwtAbs(_eps * intervalSize);
+
+    if ( value2 - value1 > eps )
+        return -1;
+
+    if ( value1 - value2 > eps )
+        return 1;
+
+    return 0;
+}
+
+/*!
+  Ceil a value, relative to an interval
+
+  \param value Value to ceil
+  \param intervalSize Interval size
+ 
+  \sa floorEps
+*/
+double QwtScaleArithmetic::ceilEps(double value, 
+    double intervalSize) 
+{
+    const double eps = _eps * intervalSize;
+
+    value = (value - eps) / intervalSize;
+    return ceil(value) * intervalSize;
+}
+
+/*!
+  Floor a value, relative to an interval
+
+  \param value Value to floor
+  \param intervalSize Interval size
+ 
+  \sa floorEps
+*/
+double QwtScaleArithmetic::floorEps(double value, double intervalSize) 
+{
+    const double eps = _eps * intervalSize;
+
+    value = (value + eps) / intervalSize;
+    return floor(value) * intervalSize;
+}
+
+/*
+  \brief Divide an interval into steps
+
+  \f$stepSize = (intervalSize - intervalSize * 10e^{-6}) / numSteps\f$
+
+  \param intervalSize Interval size
+  \param numSteps Number of steps
+  \return Step size
+*/
+double QwtScaleArithmetic::divideEps(double intervalSize, double numSteps) 
+{
+    if ( numSteps == 0.0 || intervalSize == 0.0 )
+        return 0.0;
+
+    return (intervalSize - (_eps * intervalSize)) / numSteps;
+} 
+
+/*!
+  Find the smallest value out of {1,2,5}*10^n with an integer number n
+  which is greater than or equal to x
+  
+  \param x Input value
+*/
+double QwtScaleArithmetic::ceil125(double x) 
+{
+    if (x == 0.0) 
+        return 0.0;
+
+    const double sign = (x > 0) ? 1.0 : -1.0;
+    const double lx = log10(fabs(x));
+    const double p10 = floor(lx);
+    
+    double fr = pow(10.0, lx - p10);
+    if (fr <=1.0)
+       fr = 1.0; 
+    else if (fr <= 2.0)
+       fr = 2.0;
+    else if (fr <= 5.0) 
+       fr = 5.0;
+    else
+       fr = 10.0;
+
+    return sign * fr * pow(10.0, p10);
+}
+
+/*!
+  \brief Find the largest value out of {1,2,5}*10^n with an integer number n
+  which is smaller than or equal to x
+
+  \param x Input value
+*/
+double QwtScaleArithmetic::floor125(double x) 
+{
+    if (x == 0.0)
+        return 0.0;
+
+    double sign = (x > 0) ? 1.0 : -1.0;
+    const double lx = log10(fabs(x));
+    const double p10 = floor(lx);
+
+    double fr = pow(10.0, lx - p10);
+    if (fr >= 10.0)
+       fr = 10.0;
+    else if (fr >= 5.0)
+       fr = 5.0;
+    else if (fr >= 2.0)
+       fr = 2.0;
+    else
+       fr = 1.0;
+
+    return sign * fr * pow(10.0, p10);
+}
+
+class QwtScaleEngine::PrivateData
+{
+public:
+    PrivateData():
+        attributes(QwtScaleEngine::NoAttribute),
+        loMargin(0.0),
+        hiMargin(0.0),
+        referenceValue(0.0)
+    {
+    }
+
+    int attributes;       // scale attributes
+
+    double loMargin;      // margins
+    double hiMargin;
+
+    double referenceValue; // reference value
+
+};
+
+//! Ctor
+QwtScaleEngine::QwtScaleEngine()
+{
+    d_data = new PrivateData;
+}
+
+
+//! Dtor
+QwtScaleEngine::~QwtScaleEngine ()
+{
+    delete d_data;
+}
+
+/*!
+    \return the margin at the lower end of the scale
+    The default margin is 0.
+
+    \sa QwtScaleEngine::setMargins()
+*/
+double QwtScaleEngine::loMargin() const 
+{ 
+    return d_data->loMargin; 
+}
+
+/*!
+    \return the margin at the upper end of the scale
+    The default margin is 0.
+
+    \sa QwtScaleEngine::setMargins()
+*/
+double QwtScaleEngine::hiMargin() const 
+{ 
+    return d_data->hiMargin; 
+}
+
+/*!
+  \brief Specify margins at the scale's endpoints
+  \param mlo minimum distance between the scale's lower boundary and the
+             smallest enclosed value
+  \param mhi minimum distance between the scale's upper boundary and the
+             greatest enclosed value
+
+  Margins can be used to leave a minimum amount of space between
+  the enclosed intervals and the boundaries of the scale.
+
+  \warning
+  \li QwtLog10ScaleEngine measures the margins in decades.
+
+  \sa QwtScaleEngine::hiMargin, QwtScaleEngine::loMargin
+*/
+
+void QwtScaleEngine::setMargins(double mlo, double mhi)
+{
+    d_data->loMargin = qwtMax(mlo,0.0);
+    d_data->hiMargin = qwtMax(mhi,0.0);
+}
+
+/*!
+  Calculate a step size for an interval size
+
+  \param intervalSize Interval size
+  \param numSteps Number of steps
+  
+  \return Step size
+*/
+double QwtScaleEngine::divideInterval(
+    double intervalSize, int numSteps) const
+{
+    if ( numSteps <= 0 )
+        return 0.0;
+
+    double v = QwtScaleArithmetic::divideEps(intervalSize, numSteps);
+    return QwtScaleArithmetic::ceil125(v);
+}
+
+/*!
+  Check if an interval "contains" a value
+
+  \param interval Interval
+  \param value Value
+
+  \sa QwtScaleArithmetic::compareEps
+*/
+bool QwtScaleEngine::contains(
+    const QwtDoubleInterval &interval, double value) const
+{
+    if (!interval.isValid() )
+        return false;
+    
+    if ( QwtScaleArithmetic::compareEps(value, 
+        interval.minValue(), interval.width()) < 0 )
+    {
+        return false;
+    }
+
+    if ( QwtScaleArithmetic::compareEps(value, 
+        interval.maxValue(), interval.width()) > 0 )
+    {
+        return false;
+    }
+
+    return true;
+}
+
+/*!
+  Remove ticks from a list, that are not inside an interval
+
+  \param ticks Tick list
+  \param interval Interval
+
+  \return Stripped tick list
+*/
+QwtTickList QwtScaleEngine::strip( 
+    const QwtTickList& ticks, 
+    const QwtDoubleInterval &interval) const
+{
+    if ( !interval.isValid() || ticks.count() == 0 )
+        return QwtTickList();
+
+    if ( contains(interval, ticks.first())
+        && contains(interval, ticks.last()) )
+    {
+        return ticks;
+    }
+
+    QwtTickList strippedTicks;
+    for ( int i = 0; i < (int)ticks.count(); i++ )
+    {
+        if ( contains(interval, ticks[i]) )
+            strippedTicks += ticks[i];
+    }
+    return strippedTicks;
+}
+
+/*!
+  \brief Build an interval for a value
+
+  In case of v == 0.0 the interval is [-0.5, 0.5],
+  otherwide it is [0.5 * v, 1.5 * v]
+*/
+
+QwtDoubleInterval QwtScaleEngine::buildInterval(double v) const
+{
+#if 1
+    const double delta = (v == 0.0) ? 0.5 : qwtAbs(0.5 * v);
+    return QwtDoubleInterval(v - delta, v + delta);
+#else
+    if ( v == 0.0 )
+        return QwtDoubleInterval(-0.5, 0.5);
+
+    return QwtDoubleInterval(0.5 * v, 1.5 * v);
+#endif
+}
+
+/*!
+  Change a scale attribute
+
+  \param attribute Attribute to change
+  \param on On/Off
+
+  The behaviour of the scale engine can be changed
+  with the following attributes:
+  <dl>
+  <dt>QwtAutoscale::IncludeReference
+  <dd>Build a scale which includes the reference value.
+  <dt>QwtScaleEngine::Symmetric
+  <dd>Build a scale which is symmetric to the reference value.
+  <dt>QwtScaleEngine::Floating
+  <dd>The endpoints of the scale are supposed to be equal the outmost included
+  values plus the specified margins (see setMargins()). If this attribute is
+  *not* set, the endpoints of the scale will be integer multiples of the step
+  size.
+  <dt>QwtScaleEngine::Inverted
+  <dd>Turn the scale upside down.
+  </dl>
+
+  \sa QwtScaleEngine::testAttribute()
+*/
+void QwtScaleEngine::setAttribute(Attribute attribute, bool on)
+{
+    if (on)
+       d_data->attributes |= attribute;
+    else
+       d_data->attributes &= (~attribute);
+}
+
+/*!
+  Check if a attribute is set.
+
+  \param attribute Attribute to be tested
+  \sa QwtScaleEngine::setAttribute() for a description of the possible options.
+*/
+bool QwtScaleEngine::testAttribute(Attribute attribute) const
+{
+    return bool(d_data->attributes & attribute);
+}
+
+/*!
+  Change the scale attribute
+
+  \param attributes Set scale attributes
+  \sa QwtScaleEngine::attributes()
+*/
+void QwtScaleEngine::setAttributes(int attributes)
+{
+    d_data->attributes = attributes;
+}
+
+/*!
+  Return the scale attributes
+*/
+int QwtScaleEngine::attributes() const
+{
+    return d_data->attributes;
+}
+
+/*!
+  \brief Specify a reference point
+  \param r new reference value
+
+  The reference point is needed if options IncludeRef or
+  Symmetric are active. Its default value is 0.0.
+*/
+void QwtScaleEngine::setReference(double r)
+{
+    d_data->referenceValue = r;
+}
+
+/*!
+ \return the reference value
+ \sa QwtScaleEngine::setReference(), QwtScaleEngine::setOptions()
+*/
+double QwtScaleEngine::reference() const 
+{ 
+    return d_data->referenceValue; 
+}
+
+/*!
+  Return a transformation, for linear scales
+*/
+QwtScaleTransformation QwtLinearScaleEngine::transformation() const
+{
+    return QwtScaleTransformation(QwtScaleTransformation::linearXForm, 
+        QwtScaleTransformation::linearXForm);
+}
+
+/*!
+    Align and divide an interval 
+
+   \param maxNumSteps Max. number of steps
+   \param x1 First limit of the interval (In/Out)
+   \param x2 Second limit of the interval (In/Out)
+   \param stepSize Step size (Out)
+
+   \sa QwtLinearScaleEngine::setAttribute
+*/
+void QwtLinearScaleEngine::autoScale(int maxNumSteps, 
+    double &x1, double &x2, double &stepSize) const
+{
+    QwtDoubleInterval interval(x1, x2);
+    interval = interval.normalized();
+
+    interval.setMinValue(interval.minValue() - loMargin());
+    interval.setMaxValue(interval.maxValue() + hiMargin());
+
+    if (testAttribute(QwtScaleEngine::Symmetric))
+        interval = interval.symmetrize(reference());
+ 
+    if (testAttribute(QwtScaleEngine::IncludeReference))
+        interval = interval.extend(reference());
+
+    if (interval.width() == 0.0)
+        interval = buildInterval(interval.minValue());
+
+    stepSize = divideInterval(interval.width(), qwtMax(maxNumSteps, 1));
+
+    if ( !testAttribute(QwtScaleEngine::Floating) )
+        interval = align(interval, stepSize);
+
+    x1 = interval.minValue();
+    x2 = interval.maxValue();
+
+    if (testAttribute(QwtScaleEngine::Inverted))
+    {
+        qSwap(x1, x2);
+        stepSize = -stepSize;
+    }
+}
+
+/*!
+   \brief Calculate a scale division
+
+   \param x1 First interval limit 
+   \param x2 Second interval limit 
+   \param maxMajSteps Maximum for the number of major steps
+   \param maxMinSteps Maximum number of minor steps
+   \param stepSize Step size. If stepSize == 0, the scaleEngine
+                   calculates one.
+
+   \sa QwtScaleEngine::stepSize, QwtScaleEngine::subDivide
+*/
+QwtScaleDiv QwtLinearScaleEngine::divideScale(double x1, double x2,
+    int maxMajSteps, int maxMinSteps, double stepSize) const
+{
+    QwtDoubleInterval interval = QwtDoubleInterval(x1, x2).normalized();
+    if (interval.width() <= 0 )
+        return QwtScaleDiv();
+
+    stepSize = qwtAbs(stepSize);
+    if ( stepSize == 0.0 )
+    {
+        if ( maxMajSteps < 1 )
+            maxMajSteps = 1;
+
+        stepSize = divideInterval(interval.width(), maxMajSteps);
+    }
+
+    QwtScaleDiv scaleDiv;
+
+    if ( stepSize != 0.0 )
+    {
+        QwtTickList ticks[QwtScaleDiv::NTickTypes];
+        buildTicks(interval, stepSize, maxMinSteps, ticks);
+
+        scaleDiv = QwtScaleDiv(interval, ticks);
+    }
+
+    if ( x1 > x2 )
+        scaleDiv.invert();
+
+    return scaleDiv;
+}
+
+void QwtLinearScaleEngine::buildTicks(
+    const QwtDoubleInterval& interval, double stepSize, int maxMinSteps,
+    QwtTickList ticks[QwtScaleDiv::NTickTypes]) const
+{
+    const QwtDoubleInterval boundingInterval =
+        align(interval, stepSize);
+    
+    ticks[QwtScaleDiv::MajorTick] = 
+        buildMajorTicks(boundingInterval, stepSize);
+
+    if ( maxMinSteps > 0 )
+    {
+        buildMinorTicks(ticks[QwtScaleDiv::MajorTick], maxMinSteps, stepSize,
+            ticks[QwtScaleDiv::MinorTick], ticks[QwtScaleDiv::MediumTick]);
+    }
+    
+    for ( int i = 0; i < QwtScaleDiv::NTickTypes; i++ )
+    {
+        ticks[i] = strip(ticks[i], interval);
+
+        // ticks very close to 0.0 are 
+        // explicitely set to 0.0
+
+        for ( int j = 0; j < (int)ticks[i].count(); j++ )
+        {
+            if ( QwtScaleArithmetic::compareEps(ticks[i][j], 0.0, stepSize) == 0 )
+                ticks[i][j] = 0.0;
+        }
+    }
+}
+
+QwtTickList QwtLinearScaleEngine::buildMajorTicks(
+    const QwtDoubleInterval &interval, double stepSize) const
+{
+    int numTicks = qRound(interval.width() / stepSize) + 1;
+#if 1
+    if ( numTicks > 10000 )
+        numTicks = 10000;
+#endif
+
+    QwtTickList ticks;
+
+    ticks += interval.minValue();
+    for (int i = 1; i < numTicks - 1; i++)
+        ticks += interval.minValue() + i * stepSize;
+    ticks += interval.maxValue();
+
+    return ticks;
+}
+
+void QwtLinearScaleEngine::buildMinorTicks(
+    const QwtTickList& majorTicks,
+    int maxMinSteps, double stepSize,
+    QwtTickList &minorTicks, 
+    QwtTickList &mediumTicks) const
+{   
+    double minStep = divideInterval(stepSize, maxMinSteps);
+    if (minStep == 0.0)  
+        return; 
+        
+    // # minor steps per interval
+    int nMin = qwtAbs(qRound(stepSize / minStep)) - 1;
+    
+    // Do the minor steps fit into the interval?
+    if ( QwtScaleArithmetic::compareEps((nMin +  1) * qwtAbs(minStep), 
+        qwtAbs(stepSize), stepSize) > 0)
+    {   
+        nMin = 1;
+        minStep = stepSize * 0.5;
+    }
+
+    int medIndex = -1;
+    if ( nMin % 2 )
+        medIndex = nMin / 2;
+
+    // calculate minor ticks
+
+    for (int i = 0; i < (int)majorTicks.count(); i++)
+    {
+        double val = majorTicks[i];
+        for (int k=0; k< nMin; k++)
+        {
+            val += minStep;
+
+            double alignedValue = val;
+            if (QwtScaleArithmetic::compareEps(val, 0.0, stepSize) == 0) 
+                alignedValue = 0.0;
+
+            if ( k == medIndex )
+                mediumTicks += alignedValue;
+            else
+                minorTicks += alignedValue;
+        }
+    }
+}
+
+/*!
+  \brief Align an interval to a step size
+
+  The limits of an interval are aligned that both are integer
+  multiples of the step size.
+
+  \param interval Interval
+  \param stepSize Step size
+
+  \return Aligned interval
+*/
+QwtDoubleInterval QwtLinearScaleEngine::align(
+    const QwtDoubleInterval &interval, double stepSize) const
+{
+    const double x1 = 
+        QwtScaleArithmetic::floorEps(interval.minValue(), stepSize);
+    const double x2 = 
+        QwtScaleArithmetic::ceilEps(interval.maxValue(), stepSize);
+
+    return QwtDoubleInterval(x1, x2);
+}
+
+/*!
+  Return a transformation, for logarithmic (base 10) scales
+*/
+QwtScaleTransformation QwtLog10ScaleEngine::transformation() const
+{
+    return QwtScaleTransformation(QwtScaleTransformation::log10XForm, 
+        QwtScaleTransformation::log10InvXForm);
+}
+
+/*!
+    Align and divide an interval
+
+   \param maxNumSteps Max. number of steps
+   \param x1 First limit of the interval (In/Out)
+   \param x2 Second limit of the interval (In/Out)
+   \param stepSize Step size (Out)
+
+   \sa QwtScaleEngine::setAttribute
+*/
+void QwtLog10ScaleEngine::autoScale(int maxNumSteps, 
+    double &x1, double &x2, double &stepSize) const
+{
+    if ( x1 > x2 )
+        qSwap(x1, x2);
+
+    QwtDoubleInterval interval(x1 / pow(10.0, loMargin()), 
+        x2 * pow(10.0, hiMargin()) );
+
+    double logRef = 1.0;
+    if (reference() > LOG_MIN / 2)
+        logRef = qwtMin(reference(), LOG_MAX / 2);
+
+    if (testAttribute(QwtScaleEngine::Symmetric))
+    {
+        const double delta = qwtMax(interval.maxValue() / logRef,  
+            logRef / interval.minValue());
+        interval.setInterval(logRef / delta, logRef * delta);
+    }
+
+    if (testAttribute(QwtScaleEngine::IncludeReference))
+        interval = interval.extend(logRef);
+
+    interval = interval.limit(LOG_MIN, LOG_MAX);
+
+    if (interval.width() == 0.0)
+        interval = buildInterval(interval.minValue());
+
+    stepSize = divideInterval(log10(interval).width(), qwtMax(maxNumSteps, 1));
+    if ( stepSize < 1.0 )
+        stepSize = 1.0;
+
+    if (!testAttribute(QwtScaleEngine::Floating))
+        interval = align(interval, stepSize);
+
+    x1 = interval.minValue();
+    x2 = interval.maxValue();
+
+    if (testAttribute(QwtScaleEngine::Inverted))
+    {
+        qSwap(x1, x2);
+        stepSize = -stepSize;
+    }
+}
+
+/*!
+   \brief Calculate a scale division
+
+   \param x1 First interval limit 
+   \param x2 Second interval limit 
+   \param maxMajSteps Maximum for the number of major steps
+   \param maxMinSteps Maximum number of minor steps
+   \param stepSize Step size. If stepSize == 0, the scaleEngine
+                   calculates one.
+
+   \sa QwtScaleEngine::stepSize, QwtLog10ScaleEngine::subDivide
+*/
+QwtScaleDiv QwtLog10ScaleEngine::divideScale(double x1, double x2,
+    int maxMajSteps, int maxMinSteps, double stepSize) const
+{
+    QwtDoubleInterval interval = QwtDoubleInterval(x1, x2).normalized();
+    interval = interval.limit(LOG_MIN, LOG_MAX);
+
+    if (interval.width() <= 0 )
+        return QwtScaleDiv();
+
+    if (interval.maxValue() / interval.minValue() < 10.0)
+    {
+        // scale width is less than one decade -> build linear scale
+    
+        QwtLinearScaleEngine linearScaler;
+        linearScaler.setAttributes(attributes());
+        linearScaler.setReference(reference());
+        linearScaler.setMargins(loMargin(), hiMargin());
+
+        return linearScaler.divideScale(x1, x2, 
+            maxMajSteps, maxMinSteps, stepSize);
+    }
+
+    stepSize = qwtAbs(stepSize);
+    if ( stepSize == 0.0 )
+    {
+        if ( maxMajSteps < 1 )
+            maxMajSteps = 1;
+
+        stepSize = divideInterval(log10(interval).width(), maxMajSteps);
+        if ( stepSize < 1.0 )
+            stepSize = 1.0; // major step must be >= 1 decade
+    }
+
+    QwtScaleDiv scaleDiv;
+    if ( stepSize != 0.0 )
+    {
+        QwtTickList ticks[QwtScaleDiv::NTickTypes];
+        buildTicks(interval, stepSize, maxMinSteps, ticks);
+
+        scaleDiv = QwtScaleDiv(interval, ticks);
+    }
+
+    if ( x1 > x2 )
+        scaleDiv.invert();
+
+    return scaleDiv;
+}
+
+void QwtLog10ScaleEngine::buildTicks(
+    const QwtDoubleInterval& interval, double stepSize, int maxMinSteps,
+    QwtTickList ticks[QwtScaleDiv::NTickTypes]) const
+{
+    const QwtDoubleInterval boundingInterval =
+        align(interval, stepSize);
+    
+    ticks[QwtScaleDiv::MajorTick] = 
+        buildMajorTicks(boundingInterval, stepSize);
+
+    if ( maxMinSteps > 0 )
+    {
+        ticks[QwtScaleDiv::MinorTick] = buildMinorTicks(
+            ticks[QwtScaleDiv::MajorTick], maxMinSteps, stepSize);
+    }
+    
+    for ( int i = 0; i < QwtScaleDiv::NTickTypes; i++ )
+        ticks[i] = strip(ticks[i], interval);
+}
+
+QwtTickList QwtLog10ScaleEngine::buildMajorTicks(
+    const QwtDoubleInterval &interval, double stepSize) const
+{
+    double width = log10(interval).width();
+
+    int numTicks = qRound(width / stepSize) + 1;
+    if ( numTicks > 10000 )
+        numTicks = 10000;
+
+    const double lxmin = log(interval.minValue());
+    const double lxmax = log(interval.maxValue());
+    const double lstep = (lxmax - lxmin) / double(numTicks - 1);
+
+    QwtTickList ticks;
+
+    ticks += interval.minValue();
+
+    for (int i = 1; i < numTicks; i++)
+       ticks += exp(lxmin + double(i) * lstep);
+
+    ticks += interval.maxValue();
+
+    return ticks;
+}
+
+QwtTickList QwtLog10ScaleEngine::buildMinorTicks(
+    const QwtTickList &majorTicks, 
+    int maxMinSteps, double stepSize) const
+{   
+    if (stepSize < 1.1)            // major step width is one decade
+    {
+        if ( maxMinSteps < 1 )
+            return QwtTickList();
+            
+        int k0, kstep, kmax;
+        
+        if (maxMinSteps >= 8)
+        {
+            k0 = 2;
+            kmax = 9;
+            kstep = 1;
+        }   
+        else if (maxMinSteps >= 4)
+        {
+            k0 = 2;
+            kmax = 8;
+            kstep = 2;
+        }   
+        else if (maxMinSteps >= 2)
+        {
+            k0 = 2;
+            kmax = 5;
+            kstep = 3;
+        }
+        else
+        {
+            k0 = 5;
+            kmax = 5;
+            kstep = 1;
+        }
+
+        QwtTickList minorTicks;
+
+        for (int i = 0; i < (int)majorTicks.count(); i++)
+        {
+            const double v = majorTicks[i];
+            for (int k = k0; k<= kmax; k+=kstep)
+                minorTicks += v * double(k);
+        }
+
+        return minorTicks;
+    }
+    else  // major step > one decade
+    {
+        double minStep = divideInterval(stepSize, maxMinSteps);
+        if ( minStep == 0.0 )
+            return QwtTickList();
+
+        if ( minStep < 1.0 )
+            minStep = 1.0;
+
+        // # subticks per interval
+        int nMin = qRound(stepSize / minStep) - 1;
+
+        // Do the minor steps fit into the interval?
+
+        if ( QwtScaleArithmetic::compareEps((nMin +  1) * minStep, 
+            qwtAbs(stepSize), stepSize) > 0)
+        {
+            nMin = 0;
+        }
+
+        if (nMin < 1)
+            return QwtTickList();      // no subticks
+
+        // substep factor = 10^substeps
+        const double minFactor = qwtMax(pow(10.0, minStep), 10.0);
+
+        QwtTickList minorTicks;
+        for (int i = 0; i < (int)majorTicks.count(); i++)
+        {
+            double val = majorTicks[i];
+            for (int k=0; k< nMin; k++)
+            {
+                val *= minFactor;
+                minorTicks += val;
+            }
+        }
+        return minorTicks;
+    }
+}
+
+/*!
+  \brief Align an interval to a step size
+
+  The limits of an interval are aligned that both are integer
+  multiples of the step size.
+
+  \param interval Interval
+  \param stepSize Step size
+
+  \return Aligned interval
+*/
+QwtDoubleInterval QwtLog10ScaleEngine::align(
+    const QwtDoubleInterval &interval, double stepSize) const
+{
+    const QwtDoubleInterval intv = log10(interval);
+
+    const double x1 = QwtScaleArithmetic::floorEps(intv.minValue(), stepSize);
+    const double x2 = QwtScaleArithmetic::ceilEps(intv.maxValue(), stepSize);
+
+    return pow10(QwtDoubleInterval(x1, x2));
+}
+
+/*!
+  Return the interval [log10(interval.minValue(), log10(interval.maxValue]
+*/
+
+QwtDoubleInterval QwtLog10ScaleEngine::log10(
+    const QwtDoubleInterval &interval) const
+{
+    return QwtDoubleInterval(::log10(interval.minValue()),
+            ::log10(interval.maxValue()));
+}
+
+/*!
+  Return the interval [pow10(interval.minValue(), pow10(interval.maxValue]
+*/
+QwtDoubleInterval QwtLog10ScaleEngine::pow10(
+    const QwtDoubleInterval &interval) const
+{
+    return QwtDoubleInterval(pow(10.0, interval.minValue()),
+            pow(10.0, interval.maxValue()));
+}
diff --git a/src/qwt/qwt_scale_map.cpp b/src/qwt/qwt_scale_map.cpp
new file mode 100644
index 0000000..3706e8e
--- /dev/null
+++ b/src/qwt/qwt_scale_map.cpp
@@ -0,0 +1,251 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_scale_map.h"
+
+QT_STATIC_CONST_IMPL double QwtScaleMap::LogMin = 1.0e-150;
+QT_STATIC_CONST_IMPL double QwtScaleMap::LogMax = 1.0e150;
+
+QwtScaleTransformation::QwtScaleTransformation():
+    xForm(linearXForm),
+    invXForm(linearXForm)
+{
+}
+
+QwtScaleTransformation::QwtScaleTransformation(
+        double (*xf)(double x, double s1, double s2, 
+            double p1, double p2, void *),
+        double (*invxf)(double y, double p1, double p2, 
+            double s1, double s2, void *) ):
+    xForm(xf),
+    invXForm(invxf)
+{
+}
+
+/*!
+  \brief Transform a value between 2 linear intervals
+
+  \param x value related to the interval [x1, x2]
+  \param x1 first border of source interval
+  \param x2 first border of source interval
+  \param y1 first border of target interval
+  \param y2 first border of target interval
+  \return 
+  <dl>
+  <dt>linear mapping:<dd>y1 + (y2 - y1) / (x2 - x1) * (x - x1)
+  </dl>
+*/
+
+double QwtScaleTransformation::linearXForm(    
+    double x, double x1, double x2, double y1, double y2, void *)
+{
+    const double ratio = (y2 - y1) / (x2 - x1);
+    return y1 + (x - x1) * ratio;
+}
+
+/*!
+  \brief Transform a value from a logarithmic to a linear interval
+
+  \param x value related to the logarithmic interval [s1, s2]
+  \param s1 first border of logarithmic interval
+  \param s2 first border of logarithmic interval
+  \param p1 first border of linear interval
+  \param p2 first border of linear interval
+  \return 
+  <dl>
+  <dt>p1 + (p2 - p1) / log(s2 / s1) * log(x / s1)
+  </dl>
+*/
+
+
+double QwtScaleTransformation::log10XForm(double x, double s1, double s2, 
+    double p1, double p2, void *)
+{
+    return p1 + (p2 - p1) / log(s2 / s1) * log(x / s1);
+}
+
+/*!
+  \brief Transform a value from a linear to a logarithmic interval
+
+  \param x value related to the linear interval [p1, p2]
+  \param p1 first border of linear interval
+  \param p2 first border of linear interval
+  \param s1 first border of logarithmic interval
+  \param s2 first border of logarithmic interval
+  \return 
+  <dl>
+  <dt>exp((x - p1) / (p2 - p1) * log(s2 / s1)) * s1;
+  </dl>
+*/
+
+double QwtScaleTransformation::log10InvXForm(double x, double p1, double p2, 
+    double s1, double s2, void *)
+{
+    return exp((x - p1) / (p2 - p1) * log(s2 / s1)) * s1;
+}
+
+/*!
+  \brief Constructor
+
+  The scale and paint device intervals are both set to [0,1].
+*/
+QwtScaleMap::QwtScaleMap():
+    d_s1(0.0),
+    d_s2(1.0),
+    d_p1(0.0),
+    d_p2(1.0),
+    d_cnv(1.0),
+    d_transformationData(NULL)
+{
+}
+
+
+/*!
+  \brief Constructor
+
+  Constructs a QwtScaleMap instance with initial paint device
+  and scale intervals
+
+  \param p1 first border of paint device interval
+  \param p2 second border of paint device interval
+  \param s1 first border of scale interval
+  \param s2 second border of scale interval
+*/ 
+QwtScaleMap::QwtScaleMap(int p1, int p2, double s1, double s2):
+    d_p1(p1),
+    d_p2(p2),
+    d_transformationData(NULL)
+{
+    setScaleInterval(s1, s2);
+}
+
+/*!
+  Destructor
+*/
+QwtScaleMap::~QwtScaleMap()
+{
+}
+
+/*!
+   Initialize the map with a linear/logarithmic transformation
+*/
+void QwtScaleMap::setTransformation(bool logarithmic)
+{
+    QwtScaleTransformation transformation;
+    if ( logarithmic )
+    {
+        transformation.xForm = QwtScaleTransformation::log10XForm;
+        transformation.invXForm = QwtScaleTransformation::log10InvXForm;
+    }
+    else
+    {
+        transformation.xForm = QwtScaleTransformation::linearXForm;
+        transformation.invXForm = QwtScaleTransformation::linearXForm;
+    }
+    setTransformation(transformation);
+}
+
+/*!
+   Initialize the map with a transformation
+*/
+void QwtScaleMap::setTransformation(
+    const QwtScaleTransformation &transformation)
+{
+    d_transformation = transformation;
+}
+
+//! Get the transformation
+const QwtScaleTransformation &QwtScaleMap::transformation() const
+{
+    return d_transformation;
+}
+
+/*!
+   Add data, that will passed to the transformations
+
+   \warning The transformationData has to be deleted by the application
+*/
+void QwtScaleMap::setTransformationData(void *transformationData)
+{
+    d_transformationData = transformationData;
+}
+
+//! Get the data, that is passed to the transformations
+void *QwtScaleMap::transformationData() const
+{
+    return d_transformationData;
+}
+
+/*!
+  \brief Specify the borders of the scale interval
+  \param s1 first border
+  \param s2 second border 
+  \warning logarithmic scales might be aligned to [LogMin, LogMax]
+*/
+void QwtScaleMap::setScaleInterval(double s1, double s2)
+{
+    if (d_transformation.xForm == QwtScaleTransformation::log10XForm)
+    {
+        if (s1 < LogMin) 
+           s1 = LogMin;
+        else if (s1 > LogMax) 
+           s1 = LogMax;
+        
+        if (s2 < LogMin) 
+           s2 = LogMin;
+        else if (s2 > LogMax) 
+           s2 = LogMax;
+    }
+
+    d_s1 = s1;
+    d_s2 = s2;
+
+    newFactor();
+}
+
+/*!
+  \brief Specify the borders of the paint device interval
+  \param p1 first border
+  \param p2 second border
+*/
+void QwtScaleMap::setPaintInterval(int p1, int p2)
+{
+    d_p1 = p1;
+    d_p2 = p2;
+    newFactor();
+}
+
+/*!
+  \brief Specify the borders of the paint device interval
+  \param p1 first border
+  \param p2 second border
+*/
+void QwtScaleMap::setPaintXInterval(double p1, double p2)
+{
+    d_p1 = p1;
+    d_p2 = p2;
+    newFactor();
+}
+
+/*!
+  \brief Re-calculate the conversion factor.
+*/
+void QwtScaleMap::newFactor()
+{
+    d_cnv = 0.0;
+#if 1
+    if (d_s2 == d_s1)
+        return;
+#endif
+
+    if (d_transformation.xForm == QwtScaleTransformation::linearXForm)
+        d_cnv = (d_p2 - d_p1) / (d_s2 - d_s1); 
+    else if (d_transformation.xForm == QwtScaleTransformation::log10XForm)
+        d_cnv = (d_p2 - d_p1) / log(d_s2 / d_s1);
+}
diff --git a/src/qwt/qwt_scale_widget.cpp b/src/qwt/qwt_scale_widget.cpp
new file mode 100644
index 0000000..793df69
--- /dev/null
+++ b/src/qwt/qwt_scale_widget.cpp
@@ -0,0 +1,707 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qpainter.h>
+#include <qevent.h>
+#include "qwt_painter.h"
+#include "qwt_scale_widget.h"
+#include "qwt_math.h"
+#include "qwt_paint_buffer.h"
+#include "qwt_scale_div.h"
+#include "qwt_text.h"
+
+class QwtScaleWidget::PrivateData
+{
+public:
+    PrivateData():
+        scaleDraw(NULL)
+    {
+    }
+
+    ~PrivateData()
+    {
+        delete scaleDraw;
+    }
+
+    QwtScaleDraw *scaleDraw;
+
+    int borderDist[2];
+    int minBorderDist[2];
+    int scaleLength;
+    int baseDist;
+
+    int titleOffset;
+    int titleDist;
+    QwtText title;
+};
+
+/*!
+  \brief Create a scale with the position QwtScaleWidget::Left
+  \param parent Parent widget
+
+  \warning Workaround of a designer problem
+*/
+QwtScaleWidget::QwtScaleWidget(QWidget *parent):
+    QWidget(parent)
+{
+    initScale(QwtScaleDraw::LeftScale);
+}
+
+/*!
+  \brief Constructor
+  \param align Alignment. 
+  \param parent Parent widget
+*/
+QwtScaleWidget::QwtScaleWidget(
+        QwtScaleDraw::Alignment align, QWidget *parent):
+    QWidget(parent)
+{
+    initScale(align);
+}
+
+//! Destructor
+QwtScaleWidget::~QwtScaleWidget()
+{
+    delete d_data;
+}
+
+//! Initialize the scale
+void QwtScaleWidget::initScale(QwtScaleDraw::Alignment align)
+{
+    d_data = new PrivateData;
+
+#if QT_VERSION < 0x040000
+    setWFlags(Qt::WNoAutoErase);
+#endif 
+
+    d_data->borderDist[0] = 0;
+    d_data->borderDist[1] = 0;
+    d_data->minBorderDist[0] = 0;
+    d_data->minBorderDist[1] = 0;
+    d_data->baseDist = 4;
+    d_data->titleOffset = 0;
+    d_data->titleDist = 2;
+
+    d_data->scaleDraw = new QwtScaleDraw;
+    d_data->scaleDraw->setAlignment(align);
+    d_data->scaleDraw->setLength(10);
+
+    const int flags = Qt::AlignHCenter
+#if QT_VERSION < 0x040000
+        | Qt::WordBreak | Qt::ExpandTabs;
+#else
+        | Qt::TextExpandTabs | Qt::TextWordWrap;
+#endif
+    d_data->title.setFlags(flags); 
+    d_data->title.setFont(font()); 
+
+    QSizePolicy policy(QSizePolicy::MinimumExpanding,
+        QSizePolicy::Fixed);
+    if ( d_data->scaleDraw->orientation() == Qt::Vertical )
+        policy.transpose();
+
+    setSizePolicy(policy);
+    
+#if QT_VERSION >= 0x040000
+    setAttribute(Qt::WA_WState_OwnSizePolicy, false);
+#else
+    clearWState( WState_OwnSizePolicy );
+#endif
+
+}
+
+void QwtScaleWidget::setTitle(const QString &title)
+{
+    if ( d_data->title.text() != title )
+    {
+        d_data->title.setText(title);
+        layoutScale();
+    }
+}
+
+/*!
+  \brief Give title new text contents
+  \param title New title
+  \sa QwtScaleWidget::title
+  \warning The title flags are interpreted in
+               direction of the label, AlignTop, AlignBottom can't be set
+               as the title will always be aligned to the scale.
+*/
+void QwtScaleWidget::setTitle(const QwtText &title)
+{
+    QwtText t = title;
+    const int flags = title.flags() & ~(Qt::AlignTop | Qt::AlignBottom);
+    t.setFlags(flags);
+
+    if (t != d_data->title)
+    {
+        d_data->title = t;
+        layoutScale();
+    }
+}
+
+/*!
+  Change the alignment
+
+  \param alignment New alignment
+  \sa QwtScaleWidget::alignment
+*/
+void QwtScaleWidget::setAlignment(QwtScaleDraw::Alignment alignment)
+{
+#if QT_VERSION >= 0x040000
+    if ( !testAttribute(Qt::WA_WState_OwnSizePolicy) )
+#else
+    if ( !testWState( WState_OwnSizePolicy ) )
+#endif
+    {
+        QSizePolicy policy(QSizePolicy::MinimumExpanding,
+            QSizePolicy::Fixed);
+        if ( d_data->scaleDraw->orientation() == Qt::Vertical )
+            policy.transpose();
+        setSizePolicy(policy);
+
+#if QT_VERSION >= 0x040000
+        setAttribute(Qt::WA_WState_OwnSizePolicy, false);
+#else
+        clearWState( WState_OwnSizePolicy );
+#endif
+    }
+
+    if (d_data->scaleDraw)
+        d_data->scaleDraw->setAlignment(alignment);
+    layoutScale();
+}
+
+        
+/*! 
+    \return position 
+    \sa QwtScaleWidget::setPosition
+*/
+QwtScaleDraw::Alignment QwtScaleWidget::alignment() const 
+{
+    if (!scaleDraw())
+        return QwtScaleDraw::LeftScale;
+
+    return scaleDraw()->alignment();
+}
+
+/*!
+  Specify distances of the scale's endpoints from the
+  widget's borders. The actual borders will never be less
+  than minimum border distance.
+  \param dist1 Left or top Distance
+  \param dist2 Right or bottom distance
+  \sa QwtScaleWidget::borderDist
+*/
+void QwtScaleWidget::setBorderDist(int dist1, int dist2)
+{
+    if ( dist1 != d_data->borderDist[0] || dist2 != d_data->borderDist[1] )
+    {
+        d_data->borderDist[0] = dist1;
+        d_data->borderDist[1] = dist2;
+        layoutScale();
+    }
+}
+
+/*!
+  \brief Specify the border distance of the scale's base line.
+  \param bd border distance of the baseline
+  \sa QwtScaleWidget::baseLineDist
+*/
+void QwtScaleWidget::setBaselineDist(int bd)
+{
+    bd = qwtMax( 0, bd );
+    if ( bd != d_data->baseDist )
+    {
+        d_data->baseDist = bd;
+        layoutScale();
+    }
+}
+
+/*!
+  \brief Specify the distance between scale and title
+  \param td Title distance
+  \sa QwtScaleWidget::titleDist
+*/
+void QwtScaleWidget::setTitleDist(int td)
+{
+    td = qwtMax( 0, td );
+    if ( td != d_data->titleDist )
+    {
+        d_data->titleDist = td;
+        layoutScale();
+    }
+}
+
+/*!
+  \brief Change the alignment for the labels.
+
+  \sa QwtScaleDraw::setLabelAlignment(), QwtScaleWidget::setLabelRotation()
+*/
+#if QT_VERSION < 0x040000
+void QwtScaleWidget::setLabelAlignment(int alignment)
+#else
+void QwtScaleWidget::setLabelAlignment(Qt::Alignment alignment)
+#endif
+{
+    d_data->scaleDraw->setLabelAlignment(alignment);
+    layoutScale();
+}
+
+/*!
+  \brief Change the rotation for the labels.
+  See QwtScaleDraw::setLabelRotation().
+  \sa QwtScaleDraw::setLabelRotation(), QwtScaleWidget::setLabelFlags()
+*/
+void QwtScaleWidget::setLabelRotation(double rotation)
+{
+    d_data->scaleDraw->setLabelRotation(rotation);
+    layoutScale();
+}
+
+/*!
+  \brief Set a scale draw
+  sd has to be created with new and will be deleted in
+  QwtScaleWidget::~QwtScale or the next call of QwtScaleWidget::setScaleDraw.
+*/
+void QwtScaleWidget::setScaleDraw(QwtScaleDraw *sd)
+{
+    if ( sd == NULL || sd == d_data->scaleDraw )
+        return;
+
+    if ( d_data->scaleDraw )
+        *sd = *d_data->scaleDraw;
+
+    delete d_data->scaleDraw;
+    d_data->scaleDraw = sd;
+
+    layoutScale();
+}
+
+/*! 
+    scaleDraw of this scale
+    \sa QwtScaleDraw::setScaleDraw
+*/
+const QwtScaleDraw *QwtScaleWidget::scaleDraw() const 
+{ 
+    return d_data->scaleDraw; 
+}
+
+/*! 
+    scaleDraw of this scale
+    \sa QwtScaleDraw::setScaleDraw
+*/
+QwtScaleDraw *QwtScaleWidget::scaleDraw() 
+{ 
+    return d_data->scaleDraw; 
+}
+
+/*! 
+    \return title 
+    \sa QwtScaleWidget::setTitle
+*/
+QwtText QwtScaleWidget::title() const 
+{
+    return d_data->title;
+}
+
+/*! 
+    \return start border distance 
+    \sa QwtScaleWidget::setBorderDist
+*/
+int QwtScaleWidget::startBorderDist() const 
+{ 
+    return d_data->borderDist[0]; 
+}  
+
+/*! 
+    \return end border distance 
+    \sa QwtScaleWidget::setBorderDist
+*/
+int QwtScaleWidget::endBorderDist() const 
+{ 
+    return d_data->borderDist[1]; 
+}
+
+/*! 
+    \return base line distance 
+    \sa QwtScaleWidget::setBaselineDist
+*/
+int QwtScaleWidget::baseLineDist() const 
+{ 
+    return d_data->baseDist; 
+}
+
+/*! 
+    \return distance between scale and title
+    \sa QwtScaleWidget::setBaselineDist
+*/
+int QwtScaleWidget::titleDist() const 
+{ 
+    return d_data->titleDist; 
+}
+
+/*!
+  \brief paintEvent
+*/
+void QwtScaleWidget::paintEvent(QPaintEvent *e)
+{
+    const QRect &ur = e->rect();
+    if ( ur.isValid() )
+    {
+#if QT_VERSION < 0x040000
+        QwtPaintBuffer paintBuffer(this, ur);
+        draw(paintBuffer.painter());
+#else
+        QPainter painter(this);
+        draw(&painter);
+#endif
+    }
+}
+
+/*!
+  \brief draw the scale
+*/
+void QwtScaleWidget::draw(QPainter *p) const
+{
+#if QT_VERSION < 0x040000
+    d_data->scaleDraw->draw(p, colorGroup());
+#else
+    d_data->scaleDraw->draw(p, palette());
+#endif
+
+    QRect r = rect();
+    if ( d_data->scaleDraw->orientation() == Qt::Horizontal )
+    {
+        r.setLeft(r.left() + d_data->borderDist[0]);
+        r.setWidth(r.width() - d_data->borderDist[1]);
+    }
+    else
+    {
+        r.setTop(r.top() + d_data->borderDist[1]);
+        r.setHeight(r.height() - d_data->borderDist[0]);
+    }
+
+    switch(d_data->scaleDraw->alignment())
+    {
+        case QwtScaleDraw::BottomScale:
+            r.setTop( r.top() + d_data->titleOffset );
+            break;
+
+        case QwtScaleDraw::LeftScale:
+            r.setRight( r.right() - d_data->titleOffset );
+            break;
+
+        case QwtScaleDraw::RightScale:
+            r.setLeft( r.left() + d_data->titleOffset );
+            break;
+
+        case QwtScaleDraw::TopScale:
+        default:
+            r.setBottom( r.bottom() - d_data->titleOffset );
+            break;
+    }
+
+    drawTitle(p, d_data->scaleDraw->alignment(), r);
+}
+
+/*!
+  \brief resizeEvent
+*/
+void QwtScaleWidget::resizeEvent(QResizeEvent *)
+{
+    layoutScale(false);
+}
+
+//! Recalculate the scale's geometry and layout based on
+//  the current rect and fonts.
+//  \param update_geometry   notify the layout system and call update
+//         to redraw the scale
+
+void QwtScaleWidget::layoutScale( bool update_geometry )
+{
+    int bd0, bd1;
+    getBorderDistHint(bd0, bd1);
+    if ( d_data->borderDist[0] > bd0 )
+        bd0 = d_data->borderDist[0];
+    if ( d_data->borderDist[1] > bd1 )
+        bd1 = d_data->borderDist[1];
+
+    const QRect r = rect();
+    int x, y, length;
+
+    if ( d_data->scaleDraw->orientation() == Qt::Vertical )
+    {
+        y = r.top() + bd0;
+        length = r.height() - (bd0 + bd1);
+
+        if ( d_data->scaleDraw->alignment() == QwtScaleDraw::LeftScale )
+            x = r.right() - d_data->baseDist;
+        else
+            x = r.left() + d_data->baseDist;
+    }
+    else
+    {
+        x = r.left() + bd0; 
+        length = r.width() - (bd0 + bd1);
+
+        if ( d_data->scaleDraw->alignment() == QwtScaleDraw::BottomScale )
+            y = r.top() + d_data->baseDist;
+        else
+            y = r.bottom() - d_data->baseDist;
+    }
+
+    d_data->scaleDraw->move(x, y);
+    d_data->scaleDraw->setLength(length);
+
+    d_data->titleOffset = d_data->baseDist + d_data->titleDist +
+        d_data->scaleDraw->extent(QPen(), font());;
+
+    if ( update_geometry )
+    {
+      updateGeometry();
+      update();
+    }
+}
+
+/*!
+  Rotate and paint a title according to its position into a given rectangle.
+  \param painter Painter
+  \param align Alignment
+  \param rect Bounding rectangle
+*/
+
+void QwtScaleWidget::drawTitle(QPainter *painter,
+    QwtScaleDraw::Alignment align, const QRect &rect) const
+{
+    QRect r;
+    double angle;
+    int flags = d_data->title.flags() & 
+        ~(Qt::AlignTop | Qt::AlignBottom | Qt::AlignVCenter);
+
+    switch(align)
+    {
+        case QwtScaleDraw::LeftScale:
+            flags |= Qt::AlignTop;
+            angle = -90.0;
+            r.setRect(rect.left(), rect.bottom(), rect.height(), rect.width());
+            break;
+        case QwtScaleDraw::RightScale:
+            flags |= Qt::AlignTop;
+            angle = 90.0;
+            r.setRect(rect.right(), rect.top(), rect.height(), rect.width());
+            break;
+        case QwtScaleDraw::TopScale:
+            flags |= Qt::AlignTop;
+            angle = 0.0;
+            r = rect;
+            break;
+        case QwtScaleDraw::BottomScale:
+        default:
+            flags |= Qt::AlignBottom;
+            angle = 0.0;
+            r = rect;
+            break;
+    }
+
+    painter->save();
+    painter->setFont(font());
+#if QT_VERSION < 0x040000
+    painter->setPen(colorGroup().color(QColorGroup::Text));
+#else
+    painter->setPen(palette().color(QPalette::Text));
+#endif
+
+    painter->translate(r.x(), r.y());
+    if (angle != 0.0)
+        painter->rotate(angle);
+
+
+    QwtText title = d_data->title;
+    title.setFlags(flags);
+    title.draw(painter, QRect(0, 0, r.width(), r.height()));
+
+    painter->restore();
+}
+
+/*!
+  \brief Notify a change of the scale
+
+  This virtual function can be overloaded by derived
+  classes. The default implementation updates the geometry
+  and repaints the widget.
+*/
+
+void QwtScaleWidget::scaleChange()
+{
+    layoutScale();
+}
+
+/*!
+  \return a size hint
+*/
+QSize QwtScaleWidget::sizeHint() const
+{
+    return minimumSizeHint();
+}
+
+/*!
+  \return a minimum size hint
+*/
+QSize QwtScaleWidget::minimumSizeHint() const
+{
+    const Qt::Orientation o = d_data->scaleDraw->orientation();
+
+    // Border Distance cannot be less than the scale borderDistHint
+    // Note, the borderDistHint is already included in minHeight/minWidth
+    int length = 0;
+    int mbd1, mbd2;
+    getBorderDistHint(mbd1, mbd2);
+    length += qwtMax( 0, d_data->borderDist[0] - mbd1 );
+    length += qwtMax( 0, d_data->borderDist[1] - mbd2 );
+    length += d_data->scaleDraw->minLength(QPen(), font());
+
+    int dim = dimForLength(length, font());
+    if ( length < dim )
+    {
+        // compensate for long titles
+        length = dim;
+        dim = dimForLength(length, font());
+    }
+
+    QSize size(length + 2, dim);
+    if ( o == Qt::Vertical )
+        size.transpose();
+
+    return size;
+}
+
+/*!
+  \brief Find the height of the title for a given width.
+  \param width Width
+  \return height Height
+ */
+
+int QwtScaleWidget::titleHeightForWidth(int width) const
+{
+    return d_data->title.heightForWidth(width, font());
+}
+
+/*!
+  \brief Find the minimum dimension for a given length.
+         dim is the height, length the width seen in
+         direction of the title.
+  \param length width for horizontal, height for vertical scales
+  \param scaleFont Font of the scale
+  \return height for horizontal, width for vertical scales
+*/
+
+int QwtScaleWidget::dimForLength(int length, const QFont &scaleFont) const
+{
+    int dim = d_data->baseDist;
+    dim += d_data->scaleDraw->extent(QPen(), scaleFont);
+
+    if ( !d_data->title.isEmpty() )
+    {
+        dim += titleHeightForWidth(length) + d_data->titleDist;
+    }
+    return dim;
+}
+
+/*!
+  \brief Calculate a hint for the border distances.
+
+  This member function calculates the distance
+  of the scale's endpoints from the widget borders which
+  is required for the mark labels to fit into the widget.
+  The maximum of this distance an the minimum border distance
+  is returned.
+
+  \warning
+  <ul> <li>The minimum border distance depends on the font.</ul>
+  \sa setMinBorderDist(), getMinBorderDist(), setBorderDist()
+*/
+void QwtScaleWidget::getBorderDistHint(int &start, int &end) const
+{
+    d_data->scaleDraw->getBorderDistHint(font(), start, end);
+
+    if ( start < d_data->minBorderDist[0] )
+        start = d_data->minBorderDist[0];
+
+    if ( end < d_data->minBorderDist[1] )
+        end = d_data->minBorderDist[1];
+}
+
+/*!
+  Set a minimum value for the distances of the scale's endpoints from 
+  the widget borders. This is useful to avoid that the scales
+  are "jumping", when the tick labels or their positions change 
+  often.
+
+  \sa getMinBorderDist(), getBorderDistHint()
+*/
+void QwtScaleWidget::setMinBorderDist(int start, int end)
+{
+    d_data->minBorderDist[0] = start;
+    d_data->minBorderDist[1] = end;
+}
+
+/*!
+  Get the minimum value for the distances of the scale's endpoints from 
+  the widget borders.
+
+  \sa setMinBorderDist(), getBorderDistHint()
+*/
+void QwtScaleWidget::getMinBorderDist(int &start, int &end) const
+{
+    start = d_data->minBorderDist[0];
+    end = d_data->minBorderDist[1];
+}
+
+#if QT_VERSION < 0x040000
+
+/*!
+  \brief Notify a change of the font
+
+  This virtual function may be overloaded by derived widgets.
+  The default implementation resizes the scale and repaints
+  the widget.
+  \param oldFont Previous font
+*/
+void QwtScaleWidget::fontChange(const QFont &oldFont)
+{
+    QWidget::fontChange( oldFont );
+    layoutScale();
+}
+
+#endif
+
+/*!
+  \brief Assign a scale division
+
+  The scale division determines where to set the tick marks.
+
+  \param transformation Transformation, needed to translate between
+                        scale and pixal values
+  \param scaleDiv Scale Division
+  \sa For more information about scale divisions, see QwtScaleDiv.
+*/
+void QwtScaleWidget::setScaleDiv(
+    const QwtScaleTransformation& transformation,
+    const QwtScaleDiv &scaleDiv)
+{
+    if (d_data->scaleDraw->scaleDiv() != scaleDiv)
+    {
+        d_data->scaleDraw->setTransformation(transformation);
+        d_data->scaleDraw->setScaleDiv(scaleDiv);
+        layoutScale();
+    }
+}
diff --git a/src/qwt/qwt_slider.cpp b/src/qwt/qwt_slider.cpp
new file mode 100644
index 0000000..247c61e
--- /dev/null
+++ b/src/qwt/qwt_slider.cpp
@@ -0,0 +1,796 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <math.h>
+#include <qevent.h>
+#include <qdrawutil.h>
+#include <qpainter.h>
+#include <qwt_painter.h>
+#include "qwt_paint_buffer.h"
+#include "qwt_scale_draw.h"
+#include "qwt_scale_map.h"
+#include "qwt_slider.h"
+
+class QwtSlider::PrivateData
+{
+public:
+    QRect sliderRect;
+
+    int thumbLength;
+    int thumbWidth;
+    int borderWidth;
+    int scaleDist;
+    int xMargin;
+    int yMargin;
+
+    QwtSlider::ScalePos scalePos;
+    QwtSlider::BGSTYLE bgStyle;
+
+    /*
+      Scale and values might have different maps. This is
+      confusing and I can't see strong arguments for such
+      a feature. TODO ...
+     */
+    QwtScaleMap map; // linear map
+    mutable QSize sizeHintCache;
+};
+
+/*!
+  \brief Constructor
+  \param parent parent widget
+  \param orientation Orientation of the slider. Can be Qt::Horizontal
+         or Qt::Vertical. Defaults to Horizontal.
+  \param scalePos Position of the scale.  Can be QwtSlider::None,
+         QwtSlider::Left, QwtSlider::Right, QwtSlider::Top,
+         or QwtSlider::Bottom. Defaults to QwtSlider::None.
+  \param bgStyle Background style. QwtSlider::BgTrough draws the
+         slider button in a trough, QwtSlider::BgSlot draws
+         a slot underneath the button. An or-combination of both
+         may also be used. The default is QwtSlider::BgTrough.
+
+  QwtSlider enforces valid combinations of its orientation and scale position.
+  If the combination is invalid, the scale position will be set to None. Valid
+  combinations are:
+  - Qt::Horizonal with None, Top, or Bottom;
+  - Qt::Vertical with None, Left, or Right.
+*/
+QwtSlider::QwtSlider(QWidget *parent,
+        Qt::Orientation orientation, ScalePos scalePos, BGSTYLE bgStyle): 
+    QwtAbstractSlider(orientation, parent)
+{
+    if (orientation == Qt::Vertical) 
+        setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
+    else
+        setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+
+#if QT_VERSION >= 0x040000
+    setAttribute(Qt::WA_WState_OwnSizePolicy, false);
+#else
+    clearWState( WState_OwnSizePolicy );
+#endif
+
+
+#if QT_VERSION < 0x040000
+    setWFlags(Qt::WNoAutoErase);
+#endif
+
+    d_data = new QwtSlider::PrivateData;
+
+    d_data->borderWidth = 2;
+    d_data->scaleDist = 4;
+    d_data->scalePos = scalePos;
+    d_data->xMargin = 0;
+    d_data->yMargin = 0;
+    d_data->bgStyle = bgStyle;
+
+    if (bgStyle == BgSlot)
+    {
+        d_data->thumbLength = 16;
+        d_data->thumbWidth = 30;
+    }
+    else
+    {
+        d_data->thumbLength = 31;
+        d_data->thumbWidth = 16;
+    }
+
+    d_data->sliderRect.setRect(0,0,8,8);
+
+    QwtScaleDraw::Alignment align;
+    if ( orientation == Qt::Vertical )
+    {
+        // enforce a valid combination of scale position and orientation
+        if ((d_data->scalePos == Bottom) || (d_data->scalePos == Top))
+            d_data->scalePos = None;
+        // adopt the policy of layoutSlider (None lays out like Left)
+        if (d_data->scalePos == Right)
+           align = QwtScaleDraw::RightScale;
+        else
+           align = QwtScaleDraw::LeftScale;
+    }
+    else
+    {
+        // enforce a valid combination of scale position and orientation
+        if ((d_data->scalePos == Left) || (d_data->scalePos == Right))
+            d_data->scalePos = None;
+        // adopt the policy of layoutSlider (None lays out like Bottom)
+        if (d_data->scalePos == Top)
+           align = QwtScaleDraw::TopScale;
+        else
+           align = QwtScaleDraw::BottomScale;
+    }
+
+    scaleDraw()->setAlignment(align);
+    scaleDraw()->setLength(100);
+
+    setRange(0.0, 100.0, 1.0);
+    setValue(0.0);
+}
+
+QwtSlider::~QwtSlider()
+{
+    delete d_data;
+}
+
+/*!
+  \brief Set the orientation.
+  \param o Orientation. Allowed values are Qt::Horizontal and Qt::Vertical.
+  
+  If the new orientation and the old scale position are an invalid combination,
+  the scale position will be set to None.
+  \sa QwtAbstractSlider::orientation()
+*/
+void QwtSlider::setOrientation(Qt::Orientation o) 
+{
+    if ( o == orientation() )
+        return;
+
+    if (o == Qt::Horizontal)
+    {
+        if ((d_data->scalePos == Left) || (d_data->scalePos == Right))
+            d_data->scalePos = None;
+    }
+    else // if (o == Qt::Vertical)
+    {
+        if ((d_data->scalePos == Bottom) || (d_data->scalePos == Top))
+            d_data->scalePos = None;
+    }
+
+#if QT_VERSION >= 0x040000
+    if ( !testAttribute(Qt::WA_WState_OwnSizePolicy) )
+#else
+    if ( !testWState( WState_OwnSizePolicy ) ) 
+#endif
+    {
+        QSizePolicy sp = sizePolicy();
+        sp.transpose();
+        setSizePolicy(sp);
+
+#if QT_VERSION >= 0x040000
+        setAttribute(Qt::WA_WState_OwnSizePolicy, false);
+#else
+        clearWState( WState_OwnSizePolicy );
+#endif
+    }
+
+    QwtAbstractSlider::setOrientation(o);
+    layoutSlider();
+}
+
+/*!
+  \brief Change the scale position (and slider orientation).
+
+  \param s Position of the scale.
+
+  A valid combination of scale position and orientation is enforced:
+  - if the new scale position is Left or Right, the scale orientation will
+    become Qt::Vertical;
+  - if the new scale position is Bottom or Top the scale orientation will
+    become Qt::Horizontal;
+  - if the new scale position is None, the scale orientation will not change.
+*/
+void QwtSlider::setScalePosition(ScalePos s)
+{
+    d_data->scalePos = s;
+    if ((s == Bottom) || (s == Top))
+        setOrientation(Qt::Horizontal);
+    else if ((s == Left) || (s == Right))
+        setOrientation(Qt::Vertical);
+    else
+        layoutSlider();
+}
+
+//! Return the scale position.
+QwtSlider::ScalePos QwtSlider::scalePosition() const
+{
+    return d_data->scalePos;
+}
+
+/*!
+  \brief Change the slider's border width
+  \param bd border width
+*/
+void QwtSlider::setBorderWidth(int bd)
+{
+    if ( bd < 0 )
+        bd = 0;
+
+    if ( bd != d_data->borderWidth )
+    {
+        d_data->borderWidth = bd;
+        layoutSlider();
+    }
+}
+
+/*!
+  \brief Set the slider's thumb length
+  \param thumbLength new length
+*/
+void QwtSlider::setThumbLength(int thumbLength)
+{
+    if ( thumbLength < 8 )
+        thumbLength = 8;
+
+    if ( thumbLength != d_data->thumbLength )
+    {
+        d_data->thumbLength = thumbLength;
+        layoutSlider();
+    }
+}
+
+/*!
+  \brief Change the width of the thumb
+  \param w new width
+*/
+void QwtSlider::setThumbWidth(int w)
+{
+    if ( w < 4 )
+        w = 4;
+
+    if ( d_data->thumbWidth != w )
+    {
+        d_data->thumbWidth = w;
+        layoutSlider();
+    }
+}
+
+void QwtSlider::setScaleDraw(QwtScaleDraw *scaleDraw)
+{
+    setAbstractScaleDraw(scaleDraw);
+}
+
+const QwtScaleDraw *QwtSlider::scaleDraw() const
+{
+    return (QwtScaleDraw *)abstractScaleDraw();
+}
+
+QwtScaleDraw *QwtSlider::scaleDraw()
+{
+    return (QwtScaleDraw *)abstractScaleDraw();
+}
+
+//! Notify changed scale
+void QwtSlider::scaleChange()
+{
+    layoutSlider();
+}
+
+
+//! Notify change in font
+void QwtSlider::fontChange(const QFont &f)
+{
+    QwtAbstractSlider::fontChange( f );
+    layoutSlider();
+}
+
+//! Draw the slider into the specified rectangle.
+void QwtSlider::drawSlider(QPainter *p, const QRect &r)
+{
+    QRect cr(r);
+
+    if (d_data->bgStyle & BgTrough)
+    {
+        qDrawShadePanel(p, r.x(), r.y(),
+            r.width(), r.height(),
+#if QT_VERSION < 0x040000
+            colorGroup(), 
+#else
+            palette(), 
+#endif
+            true, d_data->borderWidth,0);
+
+        cr.setRect(r.x() + d_data->borderWidth,
+            r.y() + d_data->borderWidth,
+            r.width() - 2 * d_data->borderWidth,
+            r.height() - 2 * d_data->borderWidth);
+
+        p->fillRect(cr.x(), cr.y(), cr.width(), cr.height(), 
+#if QT_VERSION < 0x040000
+            colorGroup().brush(QColorGroup::Mid)
+#else
+            palette().brush(QPalette::Mid)
+#endif
+        );
+    }
+
+    if ( d_data->bgStyle & BgSlot)
+    {
+        int ws = 4;
+        int ds = d_data->thumbLength / 2 - 4;
+        if ( ds < 1 )
+            ds = 1;
+
+        QRect rSlot;
+        if (orientation() == Qt::Horizontal)
+        {
+            if ( cr.height() & 1 )
+                ws++;
+            rSlot = QRect(cr.x() + ds, 
+                    cr.y() + (cr.height() - ws) / 2,
+                    cr.width() - 2 * ds, ws);
+        }
+        else
+        {
+            if ( cr.width() & 1 )
+                ws++;
+            rSlot = QRect(cr.x() + (cr.width() - ws) / 2, 
+                    cr.y() + ds,
+                    ws, cr.height() - 2 * ds);
+        }
+        p->fillRect(rSlot.x(), rSlot.y(), rSlot.width(), rSlot.height(),
+#if QT_VERSION < 0x040000
+            colorGroup().brush(QColorGroup::Dark)
+#else
+            palette().brush(QPalette::Dark)
+#endif
+        );
+        qDrawShadePanel(p, rSlot.x(), rSlot.y(),
+            rSlot.width(), rSlot.height(), 
+#if QT_VERSION < 0x040000
+            colorGroup(), 
+#else
+            palette(), 
+#endif
+            true, 1 ,0);
+
+    }
+
+    if ( isValid() )
+        drawThumb(p, cr, xyPosition(value()));
+}
+
+//! Draw the thumb at a position
+void QwtSlider::drawThumb(QPainter *p, const QRect &sliderRect, int pos)
+{
+    pos++; // shade line points one pixel below
+    if (orientation() == Qt::Horizontal)
+    {
+        qDrawShadePanel(p, pos - d_data->thumbLength / 2, 
+            sliderRect.y(), d_data->thumbLength, sliderRect.height(),
+#if QT_VERSION < 0x040000
+            colorGroup(), 
+#else
+            palette(), 
+#endif
+            false, d_data->borderWidth, 
+#if QT_VERSION < 0x040000
+            &colorGroup().brush(QColorGroup::Button)
+#else
+            &palette().brush(QPalette::Button)
+#endif
+        );
+
+        qDrawShadeLine(p, pos, sliderRect.y(), 
+            pos, sliderRect.y() + sliderRect.height() - 2, 
+#if QT_VERSION < 0x040000
+            colorGroup(), 
+#else
+            palette(), 
+#endif
+            true, 1);
+    }
+    else // Vertical
+    {
+        qDrawShadePanel(p,sliderRect.x(), pos - d_data->thumbLength / 2, 
+            sliderRect.width(), d_data->thumbLength,
+#if QT_VERSION < 0x040000
+            colorGroup(),
+#else
+            palette(), 
+#endif
+            false, d_data->borderWidth, 
+#if QT_VERSION < 0x040000
+            &colorGroup().brush(QColorGroup::Button)
+#else
+            &palette().brush(QPalette::Button)
+#endif
+        );
+
+        qDrawShadeLine(p, sliderRect.x(), pos,
+            sliderRect.x() + sliderRect.width() - 2, pos, 
+#if QT_VERSION < 0x040000
+            colorGroup(), 
+#else
+            palette(), 
+#endif
+            true, 1);
+    }
+}
+
+//! Find the x/y position for a given value v
+int QwtSlider::xyPosition(double v) const
+{
+    return d_data->map.transform(v);
+}
+
+//! Determine the value corresponding to a specified mouse location.
+double QwtSlider::getValue(const QPoint &p)
+{
+    return d_data->map.invTransform(
+        orientation() == Qt::Horizontal ? p.x() : p.y());
+}
+
+
+/*!
+  \brief Determine scrolling mode and direction
+  \param p point
+  \param scrollMode Scrolling mode
+  \param direction Direction
+*/
+void QwtSlider::getScrollMode(const QPoint &p, 
+    int &scrollMode, int &direction )
+{
+    if (!d_data->sliderRect.contains(p))
+    {
+        scrollMode = ScrNone;
+        direction = 0;
+        return;
+    }
+
+    const int pos = ( orientation() == Qt::Horizontal ) ? p.x() : p.y();
+    const int markerPos = xyPosition(value());
+
+    if ((pos > markerPos - d_data->thumbLength / 2)
+        && (pos < markerPos + d_data->thumbLength / 2))
+    {
+        scrollMode = ScrMouse;
+        direction = 0;
+        return;
+    }
+
+    scrollMode = ScrPage;
+    direction = (pos > markerPos) ? 1 : -1;
+
+    if ( scaleDraw()->map().p1() > scaleDraw()->map().p2() )
+        direction = -direction;
+}
+
+//! Qt paint event
+void QwtSlider::paintEvent(QPaintEvent *e)
+{
+    const QRect &ur = e->rect();
+    if ( ur.isValid() )
+    {
+#if QT_VERSION < 0x040000
+        QwtPaintBuffer paintBuffer(this, ur);
+        draw(paintBuffer.painter(), ur);
+#else
+        QPainter painter(this);
+        draw(&painter, ur);
+#endif
+    }
+}
+
+//! Draw the QwtSlider
+void QwtSlider::draw(QPainter *painter, const QRect&)
+{
+    if (d_data->scalePos != None)
+    {
+#if QT_VERSION < 0x040000
+        scaleDraw()->draw(painter, colorGroup());
+#else
+        scaleDraw()->draw(painter, palette());
+#endif
+    }
+
+    drawSlider(painter, d_data->sliderRect);
+
+    if ( hasFocus() )
+        QwtPainter::drawFocusRect(painter, this, d_data->sliderRect);
+}
+
+//! Qt resize event
+void QwtSlider::resizeEvent(QResizeEvent *)
+{
+    layoutSlider( false );
+}
+
+/*!
+  Recalculate the slider's geometry and layout based on
+  the current rect and fonts.
+  \param update_geometry  notify the layout system and call update
+         to redraw the scale
+*/
+void QwtSlider::layoutSlider( bool update_geometry )
+{
+    int sliderWidth = d_data->thumbWidth;
+    int sld1 = d_data->thumbLength / 2 - 1;
+    int sld2 = d_data->thumbLength / 2 + d_data->thumbLength % 2;
+    if ( d_data->bgStyle & BgTrough )
+    {
+        sliderWidth += 2 * d_data->borderWidth;
+        sld1 += d_data->borderWidth;
+        sld2 += d_data->borderWidth;
+    }
+
+    int scd = 0;
+    if ( d_data->scalePos != None )
+    {
+        int d1, d2;
+        scaleDraw()->getBorderDistHint(font(), d1, d2);
+        scd = qwtMax(d1, d2);
+    }
+
+    int slo = scd - sld1;
+    if ( slo < 0 )
+        slo = 0;
+
+    int x, y, length;
+
+    const QRect r = rect();
+    if (orientation() == Qt::Horizontal)
+    {
+        switch (d_data->scalePos)
+        {
+            case Top:
+            {
+                d_data->sliderRect.setRect(
+                    r.x() + d_data->xMargin + slo,
+                    r.y() + r.height() -
+                    d_data->yMargin - sliderWidth,
+                    r.width() - 2 * d_data->xMargin - 2 * slo,
+                    sliderWidth);
+
+                x = d_data->sliderRect.x() + sld1;
+                y = d_data->sliderRect.y() - d_data->scaleDist;
+
+                break;
+            }
+
+            case Bottom:
+            {
+                d_data->sliderRect.setRect(
+                    r.x() + d_data->xMargin + slo,
+                    r.y() + d_data->yMargin,
+                    r.width() - 2 * d_data->xMargin - 2 * slo,
+                    sliderWidth);
+    
+                x = d_data->sliderRect.x() + sld1;
+                y = d_data->sliderRect.y() + d_data->sliderRect.height() 
+                    + d_data->scaleDist;
+
+                break;
+            }
+
+            case None: // like Bottom, but no scale. See QwtSlider().
+            default:   // inconsistent orientation and scale position
+            {
+                d_data->sliderRect.setRect(
+                    r.x() + d_data->xMargin + slo,
+                    r.y() + d_data->yMargin,
+                    r.width() - 2 * d_data->xMargin - 2 * slo,
+                    sliderWidth);
+
+                x = d_data->sliderRect.x() + sld1;
+                y = 0;
+
+                break;
+            }
+        }
+        length = d_data->sliderRect.width() - (sld1 + sld2);
+    }
+    else // if (orientation() == Qt::Vertical
+    {
+        switch (d_data->scalePos)
+        {
+            case Right:
+                d_data->sliderRect.setRect(
+                    r.x() + d_data->xMargin,
+                    r.y() + d_data->yMargin + slo,
+                    sliderWidth,
+                    r.height() - 2 * d_data->yMargin - 2 * slo);
+
+                x = d_data->sliderRect.x() + d_data->sliderRect.width() 
+                    + d_data->scaleDist;
+                y = d_data->sliderRect.y() + sld1;
+
+                break;
+
+            case Left:
+                d_data->sliderRect.setRect(
+                    r.x() + r.width() - sliderWidth - d_data->xMargin,
+                    r.y() + d_data->yMargin + slo,
+                    sliderWidth,
+                    r.height() - 2 * d_data->yMargin - 2 * slo);
+
+                x = d_data->sliderRect.x() - d_data->scaleDist;
+                y = d_data->sliderRect.y() + sld1;
+
+                break;
+
+            case None: // like Left, but no scale. See QwtSlider().
+            default:   // inconsistent orientation and scale position
+                d_data->sliderRect.setRect(
+                    r.x() + r.width() - sliderWidth - d_data->xMargin,
+                    r.y() + d_data->yMargin + slo,
+                    sliderWidth,
+                    r.height() - 2 * d_data->yMargin - 2 * slo);
+
+                x = 0;
+                y = d_data->sliderRect.y() + sld1;
+
+                break;
+        }
+        length = d_data->sliderRect.height() - (sld1 + sld2);
+    }
+
+    scaleDraw()->move(x, y);
+    scaleDraw()->setLength(length);
+
+    d_data->map.setPaintXInterval(scaleDraw()->map().p1(),
+        scaleDraw()->map().p2());
+
+    if ( update_geometry )
+    {
+        d_data->sizeHintCache = QSize(); // invalidate
+        updateGeometry();
+        update();
+    }
+}
+
+//! Notify change of value
+void QwtSlider::valueChange()
+{
+    QwtAbstractSlider::valueChange();
+    update();
+}
+
+
+//! Notify change of range
+void QwtSlider::rangeChange()
+{
+    d_data->map.setScaleInterval(minValue(), maxValue());
+
+    if (autoScale())
+        rescale(minValue(), maxValue());
+
+    QwtAbstractSlider::rangeChange();
+    layoutSlider();
+}
+
+/*!
+  \brief Set distances between the widget's border and internals.
+  \param xMargin Horizontal margin
+  \param yMargin Vertical margin
+*/
+void QwtSlider::setMargins(int xMargin, int yMargin)
+{
+    if ( xMargin < 0 )
+        xMargin = 0;
+    if ( yMargin < 0 )
+        yMargin = 0;
+
+    if ( xMargin != d_data->xMargin || yMargin != d_data->yMargin )
+    {
+        d_data->xMargin = xMargin;
+        d_data->yMargin = yMargin;
+        layoutSlider();
+    }
+}
+
+/*!
+  Set the background style.
+*/
+void QwtSlider::setBgStyle(BGSTYLE st) 
+{
+    d_data->bgStyle = st; 
+    layoutSlider();
+}
+
+/*!
+  \return the background style.
+*/
+QwtSlider::BGSTYLE QwtSlider::bgStyle() const 
+{ 
+    return d_data->bgStyle; 
+}
+
+/*!
+  \return the thumb length.
+*/
+int QwtSlider::thumbLength() const 
+{
+    return d_data->thumbLength;
+}
+
+/*!
+  \return the thumb width.
+*/
+int QwtSlider::thumbWidth() const 
+{
+    return d_data->thumbWidth;
+}
+
+/*!
+  \return the border width.
+*/
+int QwtSlider::borderWidth() const 
+{
+    return d_data->borderWidth;
+}
+
+/*!
+  \return QwtSlider::minimumSizeHint()
+*/
+QSize QwtSlider::sizeHint() const
+{
+    return minimumSizeHint();
+}
+
+/*!
+  \brief Return a minimum size hint
+  \warning The return value of QwtSlider::minimumSizeHint() depends on 
+           the font and the scale.
+*/
+QSize QwtSlider::minimumSizeHint() const
+{
+    if (!d_data->sizeHintCache.isEmpty()) 
+        return d_data->sizeHintCache;
+
+    int sliderWidth = d_data->thumbWidth;
+    if (d_data->bgStyle & BgTrough)
+        sliderWidth += 2 * d_data->borderWidth;
+
+    int w = 0, h = 0;
+    if (d_data->scalePos != None)
+    {
+        int d1, d2;
+        scaleDraw()->getBorderDistHint(font(), d1, d2);
+        int msMbd = qwtMax(d1, d2);
+
+        int mbd = d_data->thumbLength / 2;
+        if (d_data->bgStyle & BgTrough)
+            mbd += d_data->borderWidth;
+
+        if ( mbd < msMbd )
+            mbd = msMbd;
+
+        const int sdExtent = scaleDraw()->extent( QPen(), font() );
+        const int sdLength = scaleDraw()->minLength( QPen(), font() );
+
+        h = sliderWidth + sdExtent + d_data->scaleDist;
+        w = sdLength - 2 * msMbd + 2 * mbd;
+    }
+    else  // no scale
+    {
+        w = 200;
+        h = sliderWidth;
+    }
+
+    if ( orientation() == Qt::Vertical )
+        qSwap(w, h);
+
+    w += 2 * d_data->xMargin;
+    h += 2 * d_data->yMargin;
+
+    d_data->sizeHintCache = QSize(w, h);
+    return d_data->sizeHintCache;
+}
diff --git a/src/qwt/qwt_spline.cpp b/src/qwt/qwt_spline.cpp
new file mode 100644
index 0000000..41d813b
--- /dev/null
+++ b/src/qwt/qwt_spline.cpp
@@ -0,0 +1,381 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include "qwt_spline.h"
+#include "qwt_math.h"
+
+class QwtSpline::PrivateData
+{
+public:
+    PrivateData():
+        size(0),
+        buffered(false)
+    {
+        a = b = c = NULL;
+        xbuffer = ybuffer = x = y = NULL;
+    }
+
+    // coefficient vectors
+    double *a;
+    double *b;
+    double *c;
+    double *d;
+
+    // values
+    double *x;
+    double *y;
+    double *xbuffer;
+    double *ybuffer;
+    int size;
+
+    //flags
+    bool buffered;
+};
+
+//! CTOR
+QwtSpline::QwtSpline()
+{
+    d_data = new PrivateData;
+}
+
+//! DTOR
+QwtSpline::~QwtSpline()
+{
+    cleanup();
+    delete d_data;
+}
+
+
+/*!
+  \brief Advise recalc() to buffer the tabulated function or switch off
+         internal buffering
+
+  By default, QwtSpline maintains an internal copy of the
+  tabulated function given as *x and *y arguments
+  of QwtSpline::recalc(). 
+
+  If QwtSpline::copyValues() is called with zero argument,
+  subsequent calls to QwtSpline::recalc() will not buffer these values
+  anymore and just store the pointers instead. The QwtSpline::value()
+  function will then silently assume that these pointers remained valid
+  and that the contents of the arrays have not been changed since
+  the last QwtSpline::recalc().
+
+  If called with no or nonzero argument,
+  any following QwtSpline::recalc() calls will use the internal buffer. 
+
+  \param tf if nonzero, the function table will be buffered
+  \warning copyValues() resets all the contents of QwtSpline.
+           A subsequent recalc() will be necessary.
+*/
+void QwtSpline::copyValues(bool tf)
+{
+    cleanup();
+    d_data->buffered = tf;
+}
+
+/*!
+  Calculate the interpolated function value corresponding 
+  to a given argument x.
+*/
+double QwtSpline::value(double x) const
+{
+    if (!d_data->a)
+        return 0.0;
+
+    const int i = lookup(x);
+
+    const double delta = x - d_data->x[i];
+    return( ( ( ( d_data->a[i] * delta) + d_data->b[i] ) 
+        * delta + d_data->c[i] ) * delta + d_data->y[i] );
+}
+
+//! Determine the function table index corresponding to a value x
+int QwtSpline::lookup(double x) const
+{
+    int i1, i2, i3;
+    
+    if (x <= d_data->x[0])
+       i1 = 0;
+    else if (x >= d_data->x[d_data->size - 2])
+       i1 = d_data->size -2;
+    else
+    {
+        i1 = 0;
+        i2 = d_data->size -2;
+        i3 = 0;
+
+        while ( i2 - i1 > 1 )
+        {
+            i3 = i1 + ((i2 - i1) >> 1);
+
+            if (d_data->x[i3] > x)
+               i2 = i3;
+            else
+               i1 = i3;
+
+        }
+    }
+    return i1;
+}
+
+
+/*!
+  \brief re-calculate the spline coefficients
+
+  Depending on the value of \a periodic, this function
+  will determine the coefficients for a natural or a periodic
+  spline and store them internally. By default, it also buffers the
+  values of x and y, which are needed for the
+  interpolation (See QwtSpline::value()). In order to save memory,
+  this last behaviour may be changed with the QwtSpline::copyValues() function.
+  
+  \param x
+  \param y points
+  \param n number of points
+  \param periodic if true, calculate periodic spline
+  \return true if successful
+  \warning The sequence of x (but not y) values has to be strictly monotone
+           increasing, which means <code>x[0] < x[1] < .... < x[n-1]</code>.
+       If this is not the case, the function will return false
+*/
+bool QwtSpline::recalc(double *x, double *y, int n, bool periodic)
+{
+    cleanup();
+
+    if (n <= 2)
+        return false;
+
+    d_data->size = n;
+
+    if (d_data->buffered)
+    {
+        d_data->xbuffer = new double[n];
+        d_data->ybuffer = new double[n];
+
+        for (int i = 0; i < n; i++)
+        {
+            d_data->xbuffer[i] = x[i];
+            d_data->ybuffer[i] = y[i];
+        }
+        d_data->x = d_data->xbuffer;
+        d_data->y = d_data->ybuffer;
+    }
+    else
+    {
+        d_data->x = x;
+        d_data->y = y;
+    }
+    
+    d_data->a = new double[n-1];
+    d_data->b = new double[n-1];
+    d_data->c = new double[n-1];
+
+    bool ok;
+    if(periodic)
+       ok =  buildPerSpline();
+    else
+       ok =  buildNatSpline();
+
+    if (!ok) 
+        cleanup();
+
+    return ok;
+}
+
+/*!
+  \brief Determines the coefficients for a natural spline
+  \return true if successful
+*/
+bool QwtSpline::buildNatSpline()
+{
+    int i;
+    
+    double *d = new double[d_data->size-1];
+    double *h = new double[d_data->size-1];
+    double *s = new double[d_data->size];
+
+    //
+    //  set up tridiagonal equation system; use coefficient
+    //  vectors as temporary buffers
+    for (i = 0; i < d_data->size - 1; i++) 
+    {
+        h[i] = d_data->x[i+1] - d_data->x[i];
+        if (h[i] <= 0)
+        {
+            delete[] h;
+            delete[] s;
+            delete[] d;
+            return false;
+        }
+    }
+    
+    double dy1 = (d_data->y[1] - d_data->y[0]) / h[0];
+    for (i = 1; i < d_data->size - 1; i++)
+    {
+        d_data->b[i] = d_data->c[i] = h[i];
+        d_data->a[i] = 2.0 * (h[i-1] + h[i]);
+
+        const double dy2 = (d_data->y[i+1] - d_data->y[i]) / h[i];
+        d[i] = 6.0 * ( dy1 - dy2);
+        dy1 = dy2;
+    }
+
+    //
+    // solve it
+    //
+    
+    // L-U Factorization
+    for(i = 1; i < d_data->size - 2;i++)
+    {
+        d_data->c[i] /= d_data->a[i];
+        d_data->a[i+1] -= d_data->b[i] * d_data->c[i]; 
+    }
+
+    // forward elimination
+    s[1] = d[1];
+    for(i=2;i<d_data->size - 1;i++)
+       s[i] = d[i] - d_data->c[i-1] * s[i-1];
+    
+    // backward elimination
+    s[d_data->size - 2] = - s[d_data->size - 2] / d_data->a[d_data->size - 2];
+    for (i= d_data->size -3; i > 0; i--)
+       s[i] = - (s[i] + d_data->b[i] * s[i+1]) / d_data->a[i];
+
+    //
+    // Finally, determine the spline coefficients
+    //
+    s[d_data->size - 1] = s[0] = 0.0;
+    for (i = 0; i < d_data->size - 1; i++)
+    {
+        d_data->a[i] = ( s[i+1] - s[i] ) / ( 6.0 * h[i]);
+        d_data->b[i] = 0.5 * s[i];
+        d_data->c[i] = ( d_data->y[i+1] - d_data->y[i] ) 
+            / h[i] - (s[i+1] + 2.0 * s[i] ) * h[i] / 6.0; 
+    }
+
+    delete[] d;
+    delete[] s;
+    delete[] h;
+
+    return true;
+}
+
+/*!
+  \brief Determines the coefficients for a periodic spline
+  \return true if successful
+*/
+bool QwtSpline::buildPerSpline()
+{
+    int i;
+    
+    double *d = new double[d_data->size-1];
+    double *h = new double[d_data->size-1];
+    double *s = new double[d_data->size];
+    
+    //
+    //  setup equation system; use coefficient
+    //  vectors as temporary buffers
+    //
+    for (i=0; i<d_data->size - 1; i++)
+    {
+        h[i] = d_data->x[i+1] - d_data->x[i];
+        if (h[i] <= 0.0)
+        {
+            delete[] h;
+            delete[] s;
+            delete[] d;
+            return false;
+        }
+    }
+    
+    const int imax = d_data->size - 2;
+    double htmp = h[imax];
+    double dy1 = (d_data->y[0] - d_data->y[imax]) / htmp;
+    for (i=0; i <= imax; i++)
+    {
+        d_data->b[i] = d_data->c[i] = h[i];
+        d_data->a[i] = 2.0 * (htmp + h[i]);
+        const double dy2 = (d_data->y[i+1] - d_data->y[i]) / h[i];
+        d[i] = 6.0 * ( dy1 - dy2);
+        dy1 = dy2;
+        htmp = h[i];
+    }
+
+    //
+    // solve it
+    //
+    
+    // L-U Factorization
+    d_data->a[0] = sqrt(d_data->a[0]);
+    d_data->c[0] = h[imax] / d_data->a[0];
+    double sum = 0;
+
+    for(i=0;i<imax-1;i++)
+    {
+        d_data->b[i] /= d_data->a[i];
+        if (i > 0)
+           d_data->c[i] = - d_data->c[i-1] * d_data->b[i-1] / d_data->a[i];
+        d_data->a[i+1] = sqrt( d_data->a[i+1] - qwtSqr(d_data->b[i]));
+        sum += qwtSqr(d_data->c[i]);
+    }
+    d_data->b[imax-1] = (d_data->b[imax-1] - d_data->c[imax-2] * d_data->b[imax-2]) / d_data->a[imax-1];
+    d_data->a[imax] = sqrt(d_data->a[imax] - qwtSqr(d_data->b[imax-1]) - sum);
+    
+
+    // forward elimination
+    s[0] = d[0] / d_data->a[0];
+    sum = 0;
+    for(i=1;i<imax;i++)
+    {
+        s[i] = (d[i] - d_data->b[i-1] * s[i-1]) / d_data->a[i];
+        sum += d_data->c[i-1] * s[i-1];
+    }
+    s[imax] = (d[imax] - d_data->b[imax-1]*s[imax-1] - sum) / d_data->a[imax];
+    
+    
+    // backward elimination
+    s[imax] = - s[imax] / d_data->a[imax];
+    s[imax-1] = -(s[imax-1] + d_data->b[imax-1] * s[imax]) / d_data->a[imax-1];
+    for (i= imax - 2; i >= 0; i--)
+       s[i] = - (s[i] + d_data->b[i] * s[i+1] + d_data->c[i] * s[imax]) / d_data->a[i];
+
+    //
+    // Finally, determine the spline coefficients
+    //
+    s[d_data->size-1] = s[0];
+    for (i=0;i<d_data->size-1;i++)
+    {
+        d_data->a[i] = ( s[i+1] - s[i] ) / ( 6.0 * h[i]);
+        d_data->b[i] = 0.5 * s[i];
+        d_data->c[i] = ( d_data->y[i+1] - d_data->y[i] ) 
+            / h[i] - (s[i+1] + 2.0 * s[i] ) * h[i] / 6.0; 
+    }
+
+    delete[] d;
+    delete[] s;
+    delete[] h;
+
+    return true;
+}
+
+
+//! Free allocated memory and set size to 0
+void QwtSpline::cleanup()
+{
+    delete[] d_data->a;
+    delete[] d_data->b;
+    delete[] d_data->c;
+    delete[] d_data->xbuffer;
+    delete[] d_data->ybuffer;
+
+    d_data->a = d_data->b = d_data->c = NULL;
+    d_data->xbuffer = d_data->ybuffer = d_data->x = d_data->y = NULL;
+    d_data->size = 0;
+}
diff --git a/src/qwt/qwt_symbol.cpp b/src/qwt/qwt_symbol.cpp
new file mode 100644
index 0000000..927ce25
--- /dev/null
+++ b/src/qwt/qwt_symbol.cpp
@@ -0,0 +1,265 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qpainter.h>
+#include <qapplication.h>
+#include "qwt_painter.h"
+#include "qwt_symbol.h"
+
+#if QT_VERSION < 0x040000
+#include <qpointarray.h>
+#define QwtPointArray QPointArray
+#else
+#include <qpolygon.h>
+#define QwtPointArray QPolygon
+#endif
+
+/*!
+  Default Constructor
+
+  The symbol is constructed with gray interior,
+  black outline with zero width, no size and style 'None'.
+*/
+QwtSymbol::QwtSymbol(): 
+    d_brush(Qt::gray), 
+    d_pen(Qt::black), 
+    d_size(0,0),
+    d_style(QwtSymbol::None)
+{
+}
+
+/*!
+  \brief Constructor
+  \param style Symbol Style
+  \param brush brush to fill the interior
+  \param pen outline pen 
+  \param size size
+*/
+QwtSymbol::QwtSymbol(QwtSymbol::Style style, const QBrush &brush, 
+        const QPen &pen, const QSize &size): 
+    d_brush(brush), 
+    d_pen(pen), 
+    d_size(size),
+    d_style(style)
+{
+}
+
+//! Destructor
+QwtSymbol::~QwtSymbol()
+{
+}
+
+/*!
+  \brief Specify the symbol's size
+
+  If the 'h' parameter is left out or less than 0,
+  and the 'w' parameter is greater than or equal to 0,
+  the symbol size will be set to (w,w).
+  \param w width
+  \param h height (defaults to -1)
+*/
+void QwtSymbol::setSize(int w, int h)
+{
+    if ((w >= 0) && (h < 0)) 
+        h = w;
+    d_size = QSize(w,h);
+}
+
+//! Set the symbol's size
+void QwtSymbol::setSize(const QSize &s)
+{
+    if (s.isValid()) 
+        d_size = s;
+}
+
+/*!
+  \brief Assign a brush
+
+  The brush is used to draw the interior of the symbol.
+  \param br brush
+*/
+void QwtSymbol::setBrush(const QBrush &br)
+{
+    d_brush = br;
+}
+
+/*!
+  \brief Assign a pen
+
+  The pen is used to draw the symbol's outline.
+
+  \param pn pen
+*/
+void QwtSymbol::setPen(const QPen &pn)
+{
+    d_pen = pn;
+}
+
+/*!
+  \brief Draw the symbol at a point (x,y).
+*/
+void QwtSymbol::draw(QPainter *painter, int x, int y) const
+{
+    draw(painter, QPoint(x, y));
+}
+
+
+/*!
+  \brief Draw the symbol into a bounding rectangle.
+
+  This function assumes that the painter has been initialized with
+  brush and pen before. This allows a much more performant implementation
+  when painting many symbols with the same brush and pen like in curves.
+
+  \param painter Painter
+  \param r Bounding rectangle
+*/
+void QwtSymbol::draw(QPainter *painter, const QRect& r) const
+{
+    switch(d_style)
+    {
+        case QwtSymbol::Ellipse:
+            QwtPainter::drawEllipse(painter, r);
+            break;
+        case QwtSymbol::Rect:
+            QwtPainter::drawRect(painter, r);
+            break;
+        case QwtSymbol::Diamond:
+        {
+            const int w2 = r.width() / 2;
+            const int h2 = r.height() / 2;
+
+            QwtPointArray pa(4);
+            pa.setPoint(0, r.x() + w2, r.y());
+            pa.setPoint(1, r.right(), r.y() + h2);
+            pa.setPoint(2, r.x() + w2, r.bottom());
+            pa.setPoint(3, r.x(), r.y() + h2);
+            QwtPainter::drawPolygon(painter, pa);
+            break;
+        }
+        case QwtSymbol::Cross:
+        {
+            const int w2 = r.width() / 2;
+            const int h2 = r.height() / 2;
+
+            QwtPainter::drawLine(painter, r.x() + w2, r.y(), 
+                r.x() + w2, r.bottom());
+            QwtPainter::drawLine(painter, r.x(), r.y() + h2, 
+                r.right(), r.y() + h2);
+            break;
+        }
+        case QwtSymbol::XCross:
+        {
+            QwtPainter::drawLine(painter, r.left(), r.top(), 
+                r.right(), r.bottom());
+            QwtPainter::drawLine(painter, r.left(), r.bottom(), 
+                r.right(), r.top());
+            break;
+        }
+        case QwtSymbol::Triangle:
+        case QwtSymbol::UTriangle:
+        {
+            const int w2 = r.width() / 2;
+
+            QwtPointArray pa(3);
+            pa.setPoint(0, r.x() + w2, r.y());
+            pa.setPoint(1, r.right(), r.bottom());
+            pa.setPoint(2, r.x(), r.bottom());
+            QwtPainter::drawPolygon(painter, pa);
+            break;
+        }
+        case QwtSymbol::DTriangle:
+        {
+            const int w2 = r.width() / 2;
+
+            QwtPointArray pa(3);
+            pa.setPoint(0, r.x(), r.y());
+            pa.setPoint(1, r.right(), r.y());
+            pa.setPoint(2, r.x() + w2, r.bottom());
+            QwtPainter::drawPolygon(painter, pa);
+            break;
+        }
+        case QwtSymbol::RTriangle:
+        {
+            const int h2 = r.height() / 2;
+
+            QwtPointArray pa(3);
+            pa.setPoint(0, r.x(), r.y());
+            pa.setPoint(1, r.right(), r.y() + h2);
+            pa.setPoint(2, r.x(), r.bottom());
+            QwtPainter::drawPolygon(painter, pa);
+            break;
+        }
+        case QwtSymbol::LTriangle:
+        {
+            const int h2 = r.height() / 2;
+
+            QwtPointArray pa(3);
+            pa.setPoint(0, r.right(), r.y());
+            pa.setPoint(1, r.x(), r.y() + h2);
+            pa.setPoint(2, r.right(), r.bottom());
+            QwtPainter::drawPolygon(painter, pa);
+            break;
+        }
+        default:;
+    }
+}
+
+/*!
+  \brief Draw the symbol at a specified point
+
+  \param painter Painter
+  \param pos Center of the symbol
+*/
+void QwtSymbol::draw(QPainter *painter, const QPoint &pos) const
+{
+    QRect rect;
+    rect.setSize(QwtPainter::metricsMap().screenToLayout(d_size));
+    rect.moveCenter(pos);
+
+    painter->setBrush(d_brush);
+    painter->setPen(d_pen);
+    
+    draw(painter, rect);
+}
+
+/*!
+  \brief Specify the symbol style
+
+  The following styles are defined:<dl>
+  <dt>QwtSymbol::None<dd>No Style. The symbol cannot be drawn.
+  <dt>QwtSymbol::Ellipse<dd>Ellipse or circle
+  <dt>QwtSymbol::Rect<dd>Rectangle
+  <dt>QwtSymbol::Diamond<dd>Diamond
+  <dt>QwtSymbol::Triangle<dd>Triangle pointing upwards
+  <dt>QwtSymbol::DTriangle<dd>Triangle pointing downwards
+  <dt>QwtSymbol::UTriangle<dd>Triangle pointing upwards
+  <dt>QwtSymbol::LTriangle<dd>Triangle pointing left
+  <dt>QwtSymbol::RTriangle<dd>Triangle pointing right
+  <dt>QwtSymbol::Cross<dd>Cross
+  <dt>QwtSymbol::XCross<dd>Diagonal cross</dl>
+  \param s style
+*/
+void QwtSymbol::setStyle(QwtSymbol::Style s)
+{
+    d_style = s;
+}
+
+//! == operator
+bool QwtSymbol::operator==(const QwtSymbol &other) const
+{
+    return brush() == other.brush() && pen() == other.pen()
+            && style() == other.style() && size() == other.size();
+}
+
+//! != operator
+bool QwtSymbol::operator!=(const QwtSymbol &other) const
+{
+    return !(*this == other);
+}
diff --git a/src/qwt/qwt_text.cpp b/src/qwt/qwt_text.cpp
new file mode 100644
index 0000000..6e88a42
--- /dev/null
+++ b/src/qwt/qwt_text.cpp
@@ -0,0 +1,389 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2003   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qfont.h>
+#include <qcolor.h>
+#include <qpen.h>
+#include <qbrush.h>
+#include <qpainter.h>
+#include "qwt_painter.h"
+#include "qwt_text_engine.h"
+#include "qwt_text.h"
+#if QT_VERSION >= 0x040000
+#include <qapplication.h>
+#include <qdesktopwidget.h>
+#endif
+class QwtText::PrivateData
+{
+public:
+    PrivateData():
+        flags(Qt::AlignCenter),
+        backgroundPen(Qt::NoPen),
+        backgroundBrush(Qt::NoBrush),
+        paintAttributes(QwtText::PaintUsingPainter),
+        layoutAttributes(QwtText::DefaultLayout),
+        textEngine(NULL)
+    {
+    }
+
+    int flags;
+    QString text;
+    QFont font;
+    QColor color;
+    QPen backgroundPen;
+    QBrush backgroundBrush;
+
+    int paintAttributes;
+    int layoutAttributes;
+
+    QwtTextEngine *textEngine;
+};
+
+class QwtText::LayoutCache
+{
+public:
+    void invalidate()
+    {
+        textSize = QSize();
+    }
+
+    QFont font;
+    QSize textSize;
+};
+
+QwtText::QwtText(const QString &text, QwtText::TextFormat textFormat)
+{
+    d_data = new PrivateData;
+    d_data->text = text;
+    d_data->textEngine = textEngine(text, textFormat);
+
+    d_layoutCache = new LayoutCache;
+}
+
+QwtText::QwtText(const QwtText &other)
+{
+    d_data = new PrivateData;
+    *d_data = *other.d_data;
+
+    d_layoutCache = new LayoutCache;
+    *d_layoutCache = *other.d_layoutCache;
+}
+
+//! Destructor
+QwtText::~QwtText() 
+{
+    delete d_data;
+    delete d_layoutCache;
+}
+
+QwtText &QwtText::operator=(const QwtText &other)
+{
+    *d_data = *other.d_data;
+    *d_layoutCache = *other.d_layoutCache;
+    return *this;
+}
+    
+int QwtText::operator==(const QwtText &other) const
+{
+    return d_data->flags == other.d_data->flags &&
+        d_data->text == other.d_data->text &&
+        d_data->font == other.d_data->font &&
+        d_data->color == other.d_data->color &&
+        d_data->backgroundPen == other.d_data->backgroundPen &&
+        d_data->backgroundBrush == other.d_data->backgroundBrush &&
+        d_data->paintAttributes == other.d_data->paintAttributes &&
+        d_data->textEngine == other.d_data->textEngine;
+}
+
+int QwtText::operator!=(const QwtText &other) const // invalidate
+{
+   return !(other == *this);
+}
+
+void QwtText::setText(const QString &text, 
+    QwtText::TextFormat textFormat) 
+{ 
+    d_data->text = text; 
+    d_data->textEngine = textEngine(text, textFormat);
+    d_layoutCache->invalidate();
+}
+
+//! Return the text.
+QString QwtText::text() const 
+{ 
+    return d_data->text; 
+}
+
+void QwtText::setFlags(int flags) 
+{ 
+    if ( flags != d_data->flags )
+    {
+        d_data->flags = flags; 
+#if 1
+        d_layoutCache->invalidate();
+#endif
+    }
+}
+
+int QwtText::flags() const 
+{ 
+    return d_data->flags; 
+}
+
+//! Set the font.
+void QwtText::setFont(const QFont &font) 
+{
+    d_data->font = font; 
+    d_data->paintAttributes |= PaintUsingTextFont;
+}
+
+//! Return the font.
+QFont QwtText::font() const 
+{ 
+    return d_data->font; 
+}
+
+QFont QwtText::usedFont(const QFont &font) const
+{
+    if ( d_data->paintAttributes & PaintUsingTextFont )
+        return d_data->font;
+
+    return font;
+}
+
+void QwtText::setColor(const QColor &color) 
+{ 
+    d_data->paintAttributes |= PaintUsingTextColor;
+    d_data->color = color; 
+}
+
+QColor QwtText::color() const 
+{ 
+    return d_data->color; 
+}
+
+QColor QwtText::usedColor(const QColor &color) const
+{
+    if ( d_data->paintAttributes & PaintUsingTextColor )
+        return d_data->color;
+
+    return color;
+}
+
+void QwtText::setBackgroundPen(const QPen &pen) 
+{ 
+    d_data->paintAttributes |= PaintBackground;
+    d_data->backgroundPen = pen; 
+}
+
+QPen QwtText::backgroundPen() const 
+{ 
+    return d_data->backgroundPen; 
+}
+
+void QwtText::setBackgroundBrush(const QBrush &brush) 
+{ 
+    d_data->paintAttributes |= PaintBackground;
+    d_data->backgroundBrush = brush; 
+}
+
+QBrush QwtText::backgroundBrush() const 
+{ 
+    return d_data->backgroundBrush; 
+}
+
+void QwtText::setPaintAttributes(int attributes)
+{
+    d_data->paintAttributes = attributes;
+}
+
+int QwtText::paintAttributes() const
+{
+    return d_data->paintAttributes;
+}
+
+void QwtText::setLayoutAttributes(int attributes)
+{
+    d_data->layoutAttributes = attributes;
+}
+
+int QwtText::layoutAttributes() const
+{
+    return d_data->layoutAttributes;
+}
+
+int QwtText::heightForWidth(int width, const QFont &font) const
+{
+    const QwtMetricsMap map = QwtPainter::metricsMap();
+    width = map.layoutToScreenX(width);
+
+#if QT_VERSION < 0x040000
+    const QFont fnt = usedFont(font);
+#else
+    // We want to calculate in screen metrics. So
+    // we need a font that uses screen metrics
+
+    const QFont fnt(usedFont(font), QApplication::desktop());
+#endif
+
+    int h = 0;
+
+    if ( d_data->layoutAttributes & MinimumLayout )
+    {
+        int left, right, top, bottom;
+        d_data->textEngine->textMargins(fnt, d_data->text,
+            left, right, top, bottom);
+
+        h = d_data->textEngine->heightForWidth(
+            fnt, d_data->flags, d_data->text, 
+            width + left + right);
+
+        h -= top + bottom;
+    }
+    else
+    {
+        h = d_data->textEngine->heightForWidth(
+            fnt, d_data->flags, d_data->text, width);
+    }
+
+    h = map.screenToLayoutY(h);
+    return h;
+}
+
+QSize QwtText::textSize(const QFont &font) const
+{
+#if QT_VERSION < 0x040000
+    const QFont fnt(usedFont(font));
+#else
+    // We want to calculate in screen metrics. So
+    // we need a font that uses screen metrics
+
+    const QFont fnt(usedFont(font), QApplication::desktop());
+#endif
+
+    if ( !d_layoutCache->textSize.isValid() 
+        || d_layoutCache->font != fnt )
+    {
+        d_layoutCache->textSize = d_data->textEngine->textSize(
+            fnt, d_data->flags, d_data->text);
+        d_layoutCache->font = fnt;
+    }
+
+    QSize sz = d_layoutCache->textSize;
+
+    if ( d_data->layoutAttributes & MinimumLayout )
+    {
+        int left, right, top, bottom;
+        d_data->textEngine->textMargins(fnt, d_data->text,
+            left, right, top, bottom);
+        sz -= QSize(left + right, top + bottom);
+    }
+
+    const QwtMetricsMap map = QwtPainter::metricsMap();
+    sz = map.screenToLayout(sz);
+    return sz;
+}
+
+void QwtText::draw(QPainter *painter, const QRect &rect) const
+{
+    if ( d_data->paintAttributes & PaintBackground )
+    {
+        if ( d_data->backgroundPen != Qt::NoPen || 
+            d_data->backgroundBrush != Qt::NoBrush )
+        {
+            painter->save();
+            painter->setPen(d_data->backgroundPen);
+            painter->setBrush(d_data->backgroundBrush);
+            QwtPainter::drawRect(painter, rect);
+            painter->restore();
+        }
+    }
+
+    painter->save();
+
+    if ( d_data->paintAttributes & PaintUsingTextFont )
+    {
+        painter->setFont(d_data->font);
+    }
+
+    if ( d_data->paintAttributes & PaintUsingTextColor )
+    {
+        if ( d_data->color.isValid() )
+            painter->setPen(d_data->color);
+    }
+
+    QRect expandedRect = rect;
+    if ( d_data->layoutAttributes & MinimumLayout )
+    {
+#if QT_VERSION < 0x040000
+        const QFont fnt(painter->font());
+#else
+        // We want to calculate in screen metrics. So
+        // we need a font that uses screen metrics
+
+        const QFont fnt(painter->font(), QApplication::desktop());
+#endif
+
+        int left, right, top, bottom;
+        d_data->textEngine->textMargins(
+            fnt, d_data->text,
+            left, right, top, bottom);
+
+        const QwtMetricsMap map = QwtPainter::metricsMap();
+        left = map.screenToLayoutX(left);
+        right = map.screenToLayoutX(right);
+        top = map.screenToLayoutY(top);
+        bottom = map.screenToLayoutY(bottom);
+
+        expandedRect.setTop(rect.top() - top);
+        expandedRect.setBottom(rect.bottom() + bottom);
+        expandedRect.setLeft(rect.left() - left);
+        expandedRect.setRight(rect.right() + right);
+    }
+
+    d_data->textEngine->draw(painter, expandedRect, 
+        d_data->flags, d_data->text);
+
+    painter->restore();
+}
+
+QwtTextEngine *QwtText::textEngine(const QString &text,
+    QwtText::TextFormat format) const
+{
+#ifndef QT_NO_RICHTEXT
+    static QwtRichTextEngine richTextEngine;
+#endif
+    static QwtPlainTextEngine plainTextEngine;
+
+    switch(format)
+    {
+        case QwtText::AutoText:
+        {
+#ifndef QT_NO_RICHTEXT
+            if ( richTextEngine.mightRender(text) )
+                return &richTextEngine;
+#endif
+            break;
+        }
+        case QwtText::RichText:
+        {
+#ifndef QT_NO_RICHTEXT
+            return &richTextEngine;
+#endif
+            break;
+        }
+        case QwtText::PlainText:
+        default:
+            return &plainTextEngine;
+    }
+
+    return &plainTextEngine;
+}
diff --git a/src/qwt/qwt_text_engine.cpp b/src/qwt/qwt_text_engine.cpp
new file mode 100644
index 0000000..7538ab6
--- /dev/null
+++ b/src/qwt/qwt_text_engine.cpp
@@ -0,0 +1,314 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2003   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qpainter.h>
+#include <qpixmap.h>
+#include <qimage.h>
+#include <qmap.h>
+#include <qwidget.h>
+#include "qwt_math.h"
+#include "qwt_painter.h"
+#include "qwt_text_engine.h"
+
+#if QT_VERSION < 0x040000
+
+#include <qsimplerichtext.h>
+#include <qstylesheet.h>
+
+class QwtRichTextDocument: public QSimpleRichText
+{
+public:
+    QwtRichTextDocument(const QString &text, const QFont &font):
+        QSimpleRichText(text, font)
+    {
+    }
+};
+
+#else // QT_VERSION >= 0x040000
+
+#define USE_LABEL 1
+#ifdef USE_LABEL
+#include <qlabel.h>
+#else
+#include <qtextobject.h>
+#endif
+#include <qtextdocument.h>
+#include <qabstracttextdocumentlayout.h>
+
+class QwtRichTextDocument: public QTextDocument
+{
+public:
+    QwtRichTextDocument(const QString &text, const QFont &font)
+    {
+        setUndoRedoEnabled(false);
+        setDefaultFont(font);
+        setHtml(text);
+
+        // make sure we have a document layout
+        (void)documentLayout();
+    }
+};
+
+#endif
+
+class QwtPlainTextEngine::PrivateData
+{
+public:
+    int effectiveAscent(const QFont &font) const
+    {
+        const QString fontKey = font.key();
+
+        QMap<QString, int>::const_iterator it = 
+            d_ascentCache.find(fontKey);
+        if ( it == d_ascentCache.end() )
+        {
+            int ascent = findAscent(font);
+            it = d_ascentCache.insert(fontKey, ascent);
+        }
+
+        return (*it);
+    }
+
+private:
+    int findAscent(const QFont &font) const
+    {
+        static const QString dummy("E");
+        static const QColor white(Qt::white);
+
+        const QFontMetrics fm(font);
+        QPixmap pm(fm.width(dummy), fm.height()); 
+        pm.fill(white);
+
+        QPainter p(&pm);
+        p.setFont(font);  
+        p.drawText(0, 0,  pm.width(), pm.height(), 0, dummy);
+        p.end();
+
+    #if QT_VERSION < 0x040000
+        const QImage img = pm.convertToImage();
+    #else
+        const QImage img = pm.toImage();
+    #endif
+
+        int row = 0;
+        for ( row = 0; row < img.height(); row++ )
+        {   
+            const QRgb *line = (const QRgb *)img.scanLine(row);
+
+            const int w = pm.width();
+            for ( int col = 0; col < w; col++ )
+            {   
+                if ( line[col] != white.rgb() )
+                    return fm.ascent() - row + 1;
+            }
+        }
+
+        return fm.ascent();
+    }   
+
+    mutable QMap<QString, int> d_ascentCache;
+};
+
+
+QwtTextEngine::QwtTextEngine()
+{
+}
+
+QwtTextEngine::~QwtTextEngine()
+{
+}
+
+void QwtTextEngine::textMargins(const QFont &, const QString &,
+    int &left, int &right, int &top, int &bottom)
+{
+    left = right = top = bottom = 0;
+}
+
+QwtPlainTextEngine::QwtPlainTextEngine()
+{
+    d_data = new PrivateData;
+}
+
+QwtPlainTextEngine::~QwtPlainTextEngine()
+{
+    delete d_data;
+}
+
+int QwtPlainTextEngine::heightForWidth(const QFont& font, int flags,
+        const QString& text, int width) const
+{
+    const QFontMetrics fm(font);
+    const QRect rect = fm.boundingRect(
+        0, 0, width, QWIDGETSIZE_MAX, flags, text);
+
+    return rect.height();
+}
+
+QSize QwtPlainTextEngine::textSize(const QFont &font,
+    int flags, const QString& text) const
+{
+    const QFontMetrics fm(font);
+    const QRect rect = fm.boundingRect(
+        0, 0, QWIDGETSIZE_MAX, QWIDGETSIZE_MAX, flags, text);
+
+    return rect.size();
+}
+
+void QwtPlainTextEngine::textMargins(const QFont &font, const QString &,
+    int &left, int &right, int &top, int &bottom)
+{
+    left = right = top = 0;
+
+    const QFontMetrics fm(font);
+    top = fm.ascent() - d_data->effectiveAscent(font);
+    bottom = fm.descent() + 1;
+}
+
+void QwtPlainTextEngine::draw(QPainter *painter, const QRect &rect,
+    int flags, const QString& text) const
+{
+    QwtPainter::drawText(painter, rect, flags, text);
+}
+
+bool QwtPlainTextEngine::mightRender(const QString &) const
+{
+    return true;
+}
+
+
+#ifndef QT_NO_RICHTEXT
+
+QwtRichTextEngine::QwtRichTextEngine()
+{
+}
+
+int QwtRichTextEngine::heightForWidth(const QFont& font, int flags,
+        const QString& text, int width) const
+{
+    QwtRichTextDocument doc(taggedText(text, flags), font);
+
+#if QT_VERSION < 0x040000
+    doc.setWidth(width);
+    const int h = doc.height();
+#else
+    doc.setPageSize(QSize(width, QWIDGETSIZE_MAX));
+    const int h = qRound(doc.documentLayout()->documentSize().height());
+#endif
+    return h;
+}
+
+QSize QwtRichTextEngine::textSize(const QFont &font,
+    int flags, const QString& text) const
+{
+    QwtRichTextDocument doc(taggedText(text, flags), font);
+
+#if QT_VERSION < 0x040000
+    doc.setWidth(QWIDGETSIZE_MAX);
+
+    int w = doc.widthUsed();
+    int h = doc.height();
+#else
+#if USE_LABEL 
+    /*
+      Unfortunately offering the bounding rect calculation in the
+      API of QTextDocument has been forgotten in Qt <= 4.1.x. It
+      is planned to come with Qt 4.2.x.
+      In the meantime we need a hack with a temporary QLabel,
+      to reengineer the internal calculations.
+     */
+
+    static int off = 0;
+    static QLabel *label = NULL;
+    if ( label == NULL )
+    {
+        label = new QLabel;
+        label->hide();
+
+        const char *s = "XXXXX";
+        label->setText(s);
+        int w1 = label->sizeHint().width();
+        const QFontMetrics fm(label->font());
+        int w2 = fm.width(s);
+        off = w1 - w2;
+    }
+    label->setFont(doc.defaultFont());
+    label->setText(text);
+
+    int w = qwtMax(label->sizeHint().width() - off, 0);
+    doc.setPageSize(QSize(w, QWIDGETSIZE_MAX));
+    
+    int h = qRound(doc.documentLayout()->documentSize().height());
+#else
+    QTextLayout *layout = doc.begin().layout();
+    layout->beginLayout();
+    for(qreal y = 0;;)  
+    {
+        QTextLine line = layout->createLine();
+        if (!line.isValid())
+            break;
+        line.setPosition(QPointF(0, y));
+        y += line.height();
+    }
+    layout->endLayout();
+
+    int w = qRound(layout->maximumWidth());
+    int h = qRound(layout->boundingRect().height());
+
+    h += QFontMetrics(font).descent() + 4;
+    w += 2 * 4;
+#endif
+#endif
+
+    return QSize(w, h);
+}
+
+void QwtRichTextEngine::draw(QPainter *painter, const QRect &rect,
+    int flags, const QString& text) const
+{
+    QwtRichTextDocument doc(taggedText(text, flags), painter->font());
+    QwtPainter::drawSimpleRichText(painter, rect, flags, doc);
+}
+
+//! Wrap text into <div align=...> </div> tags according align
+QString QwtRichTextEngine::taggedText(const QString &text, int flags) const
+{
+    QString richText = text;
+
+    // By default QSimpleRichText is Qt::AlignLeft
+    if (flags & Qt::AlignJustify)
+    {
+        richText.prepend(QString::fromLatin1("<div align=\"justify\">"));
+        richText.append(QString::fromLatin1("</div>"));
+    }
+    else if (flags & Qt::AlignRight)
+    {
+        richText.prepend(QString::fromLatin1("<div align=\"right\">"));
+        richText.append(QString::fromLatin1("</div>"));
+    }
+    else if (flags & Qt::AlignHCenter)
+    {
+        richText.prepend(QString::fromLatin1("<div align=\"center\">"));
+        richText.append(QString::fromLatin1("</div>"));
+    }
+
+    return richText;
+}
+
+bool QwtRichTextEngine::mightRender(const QString &text) const
+{
+#if QT_VERSION < 0x040000
+    return QStyleSheet::mightBeRichText(text);
+#else
+    return Qt::mightBeRichText(text);
+#endif
+}
+
+#endif // !QT_NO_RICHTEXT
diff --git a/src/qwt/qwt_text_label.cpp b/src/qwt/qwt_text_label.cpp
new file mode 100644
index 0000000..5d7854b
--- /dev/null
+++ b/src/qwt/qwt_text_label.cpp
@@ -0,0 +1,304 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+// vim: expandtab
+
+#include <qpainter.h>
+#include <qevent.h>
+#include "qwt_text.h"
+#include "qwt_painter.h"
+#include "qwt_text_label.h"
+
+class QwtTextLabel::PrivateData
+{
+public:
+    PrivateData():
+        indent(4),
+        margin(0)
+    {
+    }
+
+    int indent;
+    int margin;
+    QwtText text;
+};
+
+/*! 
+  Constructs an empty label.
+  \param parent Parent widget
+*/
+
+QwtTextLabel::QwtTextLabel(QWidget *parent):
+    QFrame(parent)
+{
+    init();
+}
+
+/*!
+  Constructs a label that displays the text, text
+  \param parent Parent widget
+  \param text Text
+*/
+QwtTextLabel::QwtTextLabel(const QwtText &text, QWidget *parent):
+    QFrame(parent)
+{
+    init();
+    d_data->text = text;
+}
+
+//! Destructor
+QwtTextLabel::~QwtTextLabel()
+{
+    delete d_data;
+}
+
+void QwtTextLabel::init()
+{
+    d_data = new PrivateData();
+    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
+}
+
+/*!
+   Change the label´s text, keeping all other QwtText attributes
+   \param text New text
+   \param textFormat Format of text
+
+  \sa QwtText
+*/
+void QwtTextLabel::setText(const QString &text, QwtText::TextFormat textFormat)
+{
+    d_data->text.setText(text, textFormat);
+    update();
+}
+
+/*!
+   Change the label´s text
+   \param text New text
+*/
+void QwtTextLabel::setText(const QwtText &text)
+{
+    d_data->text = text;
+    update();
+}
+
+//! Return the text
+const QwtText &QwtTextLabel::text() const
+{
+    return d_data->text;
+}
+
+//! Clear the text and all QwtText attributes
+void QwtTextLabel::clear()
+{
+    d_data->text = QwtText();
+    update();
+}
+
+//! Return label's text indent in pixels
+int QwtTextLabel::indent() const
+{
+    return d_data->indent;
+}
+
+/*!
+  Set label's text indent in pixels
+  \param indent Indentation in pixels
+*/
+void QwtTextLabel::setIndent(int indent)
+{
+    if ( indent < 0 )
+        indent = 0;
+
+    d_data->indent = indent;
+    update();
+}
+
+//! Return label's text indent in pixels
+int QwtTextLabel::margin() const
+{
+    return d_data->margin;
+}
+
+/*!
+  Set label's margin in pixels
+  \param margin Margin in pixels
+*/
+void QwtTextLabel::setMargin(int margin)
+{
+    d_data->margin = margin;
+    update();
+}
+
+//! Return label's margin in pixels
+QSize QwtTextLabel::sizeHint() const
+{
+    return minimumSizeHint();
+}
+
+//! Return a minimum size hint
+QSize QwtTextLabel::minimumSizeHint() const
+{
+    QSize sz = d_data->text.textSize(font());
+
+    int mw = 2 * (frameWidth() + d_data->margin);
+    int mh = mw;
+
+    int indent = d_data->indent;
+    if ( indent <= 0 )
+        indent = defaultIndent();
+
+    if ( indent > 0 )
+    {
+        const int align = d_data->text.flags();
+        if ( align & Qt::AlignLeft || align & Qt::AlignRight )
+            mw += d_data->indent;
+        else if ( align & Qt::AlignTop || align & Qt::AlignBottom )
+            mh += d_data->indent;
+    }
+        
+    sz += QSize(mw, mh);
+
+    return sz;
+}
+
+/*!
+   Returns the preferred height for this widget, given the width.
+   \param width Width
+*/
+int QwtTextLabel::heightForWidth(int width) const
+{
+    const int align = d_data->text.flags();
+
+    int indent = d_data->indent;
+    if ( indent <= 0 )
+        indent = defaultIndent();
+
+    width -= 2 * frameWidth();
+    if ( align & Qt::AlignLeft || align & Qt::AlignRight )
+        width -= indent;
+
+    int height = d_data->text.heightForWidth(width, font());
+    if ( align & Qt::AlignTop || align & Qt::AlignBottom )
+        height += indent;
+
+    height += 2 * frameWidth();
+
+    return height;
+}
+
+//! Qt paint event
+void QwtTextLabel::paintEvent(QPaintEvent *event)
+{
+#if QT_VERSION >= 0x040000
+    QPainter painter(this);
+
+    if ( !contentsRect().contains( event->rect() ) )
+    {
+        painter.save();
+        painter.setClipRegion( event->region() & frameRect() );
+        drawFrame( &painter );
+        painter.restore();
+    }
+
+    painter.setClipRegion(event->region() & contentsRect());
+
+    drawContents( &painter );
+#else // QT_VERSION < 0x040000
+    QFrame::paintEvent(event);
+#endif
+
+}
+
+//! Redraw the text and focus indicator
+void QwtTextLabel::drawContents(QPainter *painter)
+{
+    const QRect r = textRect();
+    if ( r.isEmpty() )
+        return;
+
+    painter->setFont(font());
+#if QT_VERSION < 0x040000
+    painter->setPen(palette().color(QPalette::Active, QColorGroup::Text));
+#else
+    painter->setPen(palette().color(QPalette::Active, QPalette::Text));
+#endif
+
+    drawText(painter, r);
+
+    if ( hasFocus() )
+    {
+        const int margin = 2;
+
+        QRect focusRect = contentsRect();
+        focusRect.setRect(focusRect.x() + margin, focusRect.y() + margin,
+            focusRect.width() - 2 * margin - 2, 
+            focusRect.height() - 2 * margin - 2);
+
+        QwtPainter::drawFocusRect(painter, this, focusRect);
+    }
+}
+
+//! Redraw the text
+void QwtTextLabel::drawText(QPainter *painter, const QRect &textRect)
+{
+    d_data->text.draw(painter, textRect);
+}
+
+/*! 
+  Calculate the rect for the text in widget coordinates
+  \return Text rect
+*/
+QRect QwtTextLabel::textRect() const
+{
+    QRect r = contentsRect();
+
+    if ( !r.isEmpty() && d_data->margin > 0 )
+    {
+        r.setRect(r.x() + d_data->margin, r.y() + d_data->margin,
+            r.width() - 2 * d_data->margin, r.height() - 2 * d_data->margin );
+    }
+
+    if ( !r.isEmpty() )
+    {
+        int indent = d_data->indent;
+        if ( indent <= 0 )
+            indent = defaultIndent();
+
+        if ( indent > 0 )
+        {
+            const int align = d_data->text.flags();
+
+            if ( align & Qt::AlignLeft )
+                r.setX(r.x() + indent);
+            else if ( align & Qt::AlignRight )
+                r.setWidth(r.width() - indent);
+            else if ( align & Qt::AlignTop )
+                r.setY(r.y() + indent);
+            else if ( align & Qt::AlignBottom )
+                r.setHeight(r.height() - indent);
+        }
+    }
+
+    return r;
+}
+
+int QwtTextLabel::defaultIndent() const
+{
+    if ( frameWidth() <= 0 )
+        return 0;
+
+    QFont fnt;
+    if ( d_data->text.paintAttributes() & QwtText::PaintUsingTextFont )
+        fnt = d_data->text.font();
+    else
+        fnt = font();
+
+    return QFontMetrics(fnt).width('x') / 2;
+}
+
diff --git a/src/qwt/qwt_thermo.cpp b/src/qwt/qwt_thermo.cpp
new file mode 100644
index 0000000..b2405f8
--- /dev/null
+++ b/src/qwt/qwt_thermo.cpp
@@ -0,0 +1,810 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qpainter.h>
+#include <qevent.h>
+#include <qstyle.h>
+#include <qpixmap.h>
+#include <qdrawutil.h>
+#include "qwt_math.h"
+#include "qwt_scale_engine.h"
+#include "qwt_scale_draw.h"
+#include "qwt_scale_map.h"
+#include "qwt_paint_buffer.h"
+#include "qwt_thermo.h"
+
+class QwtThermo::PrivateData
+{
+public:
+    PrivateData():
+        fillBrush(Qt::black),
+        alarmBrush(Qt::white),
+        orientation(Qt::Vertical),
+        scalePos(QwtThermo::Left),
+        borderWidth(2),
+        scaleDist(3),
+        thermoWidth(10),
+        minValue(0.0),
+        maxValue(1.0),
+        value(0.0),
+        alarmLevel(0.0),
+        alarmEnabled(false)
+    {
+        map.setScaleInterval(minValue, maxValue);
+    }
+
+    QwtScaleMap map;
+    QRect thermoRect;
+    QBrush fillBrush;
+    QBrush alarmBrush;
+
+    Qt::Orientation orientation;
+    ScalePos scalePos;
+    int borderWidth;
+    int scaleDist;
+    int thermoWidth;
+
+    double minValue;
+    double maxValue;
+    double value;
+    double alarmLevel;
+    bool alarmEnabled;
+};
+
+//! Constructor
+QwtThermo::QwtThermo(QWidget *parent): 
+    QWidget(parent)
+{
+#if QT_VERSION < 0x040000
+    setWFlags(Qt::WNoAutoErase);
+#endif
+    d_data = new PrivateData;
+    setRange(d_data->minValue, d_data->maxValue, false);
+
+    QSizePolicy policy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
+    if (d_data->orientation == Qt::Vertical) 
+        policy.transpose();
+
+    setSizePolicy(policy);
+    
+#if QT_VERSION >= 0x040000
+    setAttribute(Qt::WA_WState_OwnSizePolicy, false);
+#else
+    clearWState( WState_OwnSizePolicy );
+#endif
+}
+
+//! Destructor
+QwtThermo::~QwtThermo()
+{
+    delete d_data;
+}
+
+//! Set the maximum value.
+void QwtThermo::setMaxValue(double v) 
+{ 
+    setRange(d_data->minValue, v); 
+}
+
+//! Return the maximum value.
+double QwtThermo::maxValue() const 
+{ 
+    return d_data->maxValue; 
+}
+
+//! Set the minimum value.
+void QwtThermo::setMinValue(double v) 
+{ 
+    setRange(v, d_data->maxValue); 
+}
+
+//! Return the minimum value.
+double QwtThermo::minValue() const 
+{ 
+    return d_data->minValue; 
+}
+
+//! Set the current value.
+void QwtThermo::setValue(double v)
+{
+    if (d_data->value != v)
+    {
+        d_data->value = v;
+        update();
+    }
+}
+
+//! Return the value.
+double QwtThermo::value() const 
+{ 
+    return d_data->value; 
+}
+
+void QwtThermo::setScaleDraw(QwtScaleDraw *scaleDraw)
+{
+    setAbstractScaleDraw(scaleDraw);
+}
+
+const QwtScaleDraw *QwtThermo::scaleDraw() const
+{
+    return (QwtScaleDraw *)abstractScaleDraw();
+}
+
+QwtScaleDraw *QwtThermo::scaleDraw() 
+{
+    return (QwtScaleDraw *)abstractScaleDraw();
+}
+
+//! Qt paint event.
+void QwtThermo::paintEvent(QPaintEvent *e)
+{
+    // Use double-buffering
+    const QRect &ur = e->rect();
+    if ( ur.isValid() )
+    {
+#if QT_VERSION < 0x040000
+        QwtPaintBuffer paintBuffer(this, ur);
+        draw(paintBuffer.painter(), ur);
+#else
+        QPainter painter(this);
+        draw(&painter, ur);
+#endif
+    }
+}
+
+//! Draw the whole QwtThermo.
+void QwtThermo::draw(QPainter *p, const QRect& ur)
+{
+    if ( !d_data->thermoRect.contains(ur) )
+    {
+        if (d_data->scalePos != None)
+        {
+#if QT_VERSION < 0x040000
+            scaleDraw()->draw(p, colorGroup());
+#else
+            scaleDraw()->draw(p, palette());
+#endif
+        }
+
+        qDrawShadePanel(p,
+            d_data->thermoRect.x() - d_data->borderWidth,
+            d_data->thermoRect.y() - d_data->borderWidth,
+            d_data->thermoRect.width() + 2*d_data->borderWidth,
+            d_data->thermoRect.height() + 2*d_data->borderWidth,
+#if QT_VERSION < 0x040000
+            colorGroup(), 
+#else
+            palette(), 
+#endif
+            true, d_data->borderWidth,0);
+    }
+    drawThermo(p);
+}
+
+//! Qt resize event handler
+void QwtThermo::resizeEvent(QResizeEvent *)
+{
+    layoutThermo( false );
+}
+
+/*!
+  Recalculate the QwtThermo geometry and layout based on
+  the QwtThermo::rect() and the fonts.
+  \param update_geometry notify the layout system and call update
+         to redraw the scale
+*/
+void QwtThermo::layoutThermo( bool update_geometry )
+{
+    QRect r = rect();
+    int mbd = 0;
+    if ( d_data->scalePos != None )
+    {
+        int d1, d2;
+        scaleDraw()->getBorderDistHint(font(), d1, d2);
+        mbd = qwtMax(d1, d2);
+    }
+
+    if ( d_data->orientation == Qt::Horizontal )
+    {
+        switch ( d_data->scalePos )
+        {
+            case Top:
+            {
+                d_data->thermoRect.setRect(
+                    r.x() + mbd + d_data->borderWidth,
+                    r.y() + r.height()
+                    - d_data->thermoWidth - 2*d_data->borderWidth,
+                    r.width() - 2*(d_data->borderWidth + mbd),
+                    d_data->thermoWidth);
+                scaleDraw()->setAlignment(QwtScaleDraw::TopScale);
+                scaleDraw()->move( d_data->thermoRect.x(),
+                    d_data->thermoRect.y() - d_data->borderWidth 
+                        - d_data->scaleDist);
+                scaleDraw()->setLength(d_data->thermoRect.width());
+                break;
+            }
+
+            case Bottom:
+            case None: // like Bottom but without scale
+            default:   // inconsistent orientation and scale position
+                       // Mapping between values and pixels requires
+                       // initialization of the scale geometry
+            {
+                d_data->thermoRect.setRect(
+                    r.x() + mbd + d_data->borderWidth,
+                    r.y() + d_data->borderWidth,
+                    r.width() - 2*(d_data->borderWidth + mbd),
+                    d_data->thermoWidth);
+                scaleDraw()->setAlignment(QwtScaleDraw::BottomScale);
+                scaleDraw()->move(
+                    d_data->thermoRect.x(),
+                    d_data->thermoRect.y() + d_data->thermoRect.height()
+                        + d_data->borderWidth + d_data->scaleDist );
+                scaleDraw()->setLength(d_data->thermoRect.width());
+                break;
+            }
+        }
+        d_data->map.setPaintInterval(d_data->thermoRect.x(),
+            d_data->thermoRect.x() + d_data->thermoRect.width() - 1);
+    }
+    else // Qt::Vertical
+    {
+        switch ( d_data->scalePos )
+        {
+            case Right:
+            {
+                d_data->thermoRect.setRect(
+                    r.x() + d_data->borderWidth,
+                    r.y() + mbd + d_data->borderWidth,
+                    d_data->thermoWidth,
+                    r.height() - 2*(d_data->borderWidth + mbd));
+                scaleDraw()->setAlignment(QwtScaleDraw::RightScale);
+                scaleDraw()->move(
+                    d_data->thermoRect.x() + d_data->thermoRect.width()
+                        + d_data->borderWidth + d_data->scaleDist,
+                    d_data->thermoRect.y());
+                scaleDraw()->setLength(d_data->thermoRect.height());
+                break;
+            }
+
+            case Left:
+            case None: // like Left but without scale
+            default:   // inconsistent orientation and scale position
+                       // Mapping between values and pixels requires
+                       // initialization of the scale geometry
+            {
+                d_data->thermoRect.setRect(
+                    r.x() + r.width() - 2*d_data->borderWidth - d_data->thermoWidth,
+                    r.y() + mbd + d_data->borderWidth,
+                    d_data->thermoWidth,
+                    r.height() - 2*(d_data->borderWidth + mbd));
+                scaleDraw()->setAlignment(QwtScaleDraw::LeftScale);
+                scaleDraw()->move(
+                    d_data->thermoRect.x() - d_data->scaleDist 
+                        - d_data->borderWidth,
+                    d_data->thermoRect.y() );
+                scaleDraw()->setLength(d_data->thermoRect.height());
+                break;
+            }
+        }
+        d_data->map.setPaintInterval(
+            d_data->thermoRect.y() + d_data->thermoRect.height() - 1,
+            d_data->thermoRect.y());
+    }
+    if ( update_geometry )
+    {
+        updateGeometry();
+        update();
+    }
+}
+
+/*!
+  \brief Set the thermometer orientation and the scale position.
+
+  The scale position None disables the scale.
+  \param o orientation. Possible values are Qt::Horizontal and Qt::Vertical.
+         The default value is Qt::Vertical.
+  \param s Position of the scale.
+         The default value is None.
+
+  A valid combination of scale position and orientation is enforced:
+  - a horizontal thermometer can have the scale positions Top, Bottom or None;
+  - a vertical thermometer can have the scale positions Left, Right or None;
+  - an invalid scale position will default to None.
+
+  \sa QwtThermo::setScalePosition()
+*/
+void QwtThermo::setOrientation(Qt::Orientation o, ScalePos s)
+{
+    if ( o == d_data->orientation )
+        return;
+
+    switch(o)
+    {
+        case Qt::Horizontal:
+        {
+            d_data->orientation = Qt::Horizontal;
+            if ((s == None) || (s == Bottom) || (s == Top))
+                d_data->scalePos = s;
+            else
+                d_data->scalePos = None;
+            break;
+        }
+        case Qt::Vertical:
+        {
+            d_data->orientation = Qt::Vertical;
+            if ((s == None) || (s == Left) || (s == Right))
+                d_data->scalePos = s;
+            else
+                d_data->scalePos = None;
+            break;
+        }
+    }
+
+#if QT_VERSION >= 0x040000
+    if ( !testAttribute(Qt::WA_WState_OwnSizePolicy) )
+#else
+    if ( !testWState( WState_OwnSizePolicy ) )
+#endif
+    {
+        QSizePolicy sp = sizePolicy();
+        sp.transpose();
+        setSizePolicy(sp);
+
+#if QT_VERSION >= 0x040000
+        setAttribute(Qt::WA_WState_OwnSizePolicy, false);
+#else
+        clearWState( WState_OwnSizePolicy );
+#endif
+    }
+
+    layoutThermo();
+}
+
+/*!
+  \brief Change the scale position (and thermometer orientation).
+
+  \param s Position of the scale.
+  
+  A valid combination of scale position and orientation is enforced:
+  - if the new scale position is Left or Right, the scale orientation will
+    become Qt::Vertical;
+  - if the new scale position is Bottom or Top, the scale orientation will
+    become Qt::Horizontal;
+  - if the new scale position is None, the scale orientation will not change.
+
+  \sa QwtThermo::setOrientation()
+*/
+void QwtThermo::setScalePosition(ScalePos s)
+{
+    if ((s == Bottom) || (s == Top))
+        setOrientation(Qt::Horizontal, s);
+    else if ((s == Left) || (s == Right))
+        setOrientation(Qt::Vertical, s);
+    else
+        setOrientation(d_data->orientation, None);
+}
+
+//! Return the scale position.
+QwtThermo::ScalePos QwtThermo::scalePosition() const
+{
+    return d_data->scalePos;
+}
+
+//! Notify a font change.
+void QwtThermo::fontChange(const QFont &f)
+{
+    QWidget::fontChange( f );
+    layoutThermo();
+}
+
+//! Notify a scale change.
+void QwtThermo::scaleChange()
+{
+    update();
+    layoutThermo();
+}
+
+//! Redraw the liquid in thermometer pipe.
+void QwtThermo::drawThermo(QPainter *p)
+{
+    int alarm  = 0, taval = 0;
+
+    QRect fRect;
+    QRect aRect;
+    QRect bRect;
+
+    int inverted = ( d_data->maxValue < d_data->minValue );
+
+    //
+    //  Determine if value exceeds alarm threshold.
+    //  Note: The alarm value is allowed to lie
+    //        outside the interval (minValue, maxValue).
+    //
+    if (d_data->alarmEnabled)
+    {
+        if (inverted)
+        {
+            alarm = ((d_data->alarmLevel >= d_data->maxValue)
+                 && (d_data->alarmLevel <= d_data->minValue)
+                 && (d_data->value >= d_data->alarmLevel));
+        
+        }
+        else
+        {
+            alarm = (( d_data->alarmLevel >= d_data->minValue)
+                 && (d_data->alarmLevel <= d_data->maxValue)
+                 && (d_data->value >= d_data->alarmLevel));
+        }
+    }
+
+    //
+    //  transform values
+    //
+    int tval = transform(d_data->value);
+
+    if (alarm)
+       taval = transform(d_data->alarmLevel);
+
+    //
+    //  calculate recangles
+    //
+    if ( d_data->orientation == Qt::Horizontal )
+    {
+        if (inverted)
+        {
+            bRect.setRect(d_data->thermoRect.x(), d_data->thermoRect.y(),
+                  tval - d_data->thermoRect.x(),
+                  d_data->thermoRect.height());
+        
+            if (alarm)
+            {
+                aRect.setRect(tval, d_data->thermoRect.y(),
+                      taval - tval + 1,
+                      d_data->thermoRect.height());
+                fRect.setRect(taval + 1, d_data->thermoRect.y(),
+                      d_data->thermoRect.x() + d_data->thermoRect.width() - (taval + 1),
+                      d_data->thermoRect.height());
+            }
+            else
+            {
+                fRect.setRect(tval, d_data->thermoRect.y(),
+                      d_data->thermoRect.x() + d_data->thermoRect.width() - tval,
+                      d_data->thermoRect.height());
+            }
+        }
+        else
+        {
+            bRect.setRect(tval + 1, d_data->thermoRect.y(),
+                  d_data->thermoRect.width() - (tval + 1 - d_data->thermoRect.x()),
+                  d_data->thermoRect.height());
+        
+            if (alarm)
+            {
+                aRect.setRect(taval, d_data->thermoRect.y(),
+                      tval - taval + 1,
+                      d_data->thermoRect.height());
+                fRect.setRect(d_data->thermoRect.x(), d_data->thermoRect.y(),
+                      taval - d_data->thermoRect.x(),
+                      d_data->thermoRect.height());
+            }
+            else
+            {
+                fRect.setRect(d_data->thermoRect.x(), d_data->thermoRect.y(),
+                      tval - d_data->thermoRect.x() + 1,
+                      d_data->thermoRect.height());
+            }
+        
+        }
+    }
+    else // Qt::Vertical
+    {
+        if (tval < d_data->thermoRect.y())
+            tval = d_data->thermoRect.y();
+        else 
+        {
+            if (tval > d_data->thermoRect.y() + d_data->thermoRect.height())
+                tval = d_data->thermoRect.y() + d_data->thermoRect.height();
+        }
+
+        if (inverted)
+        {
+            bRect.setRect(d_data->thermoRect.x(), tval + 1,
+            d_data->thermoRect.width(),
+            d_data->thermoRect.height() - (tval + 1 - d_data->thermoRect.y()));
+
+            if (alarm)
+            {
+                aRect.setRect(d_data->thermoRect.x(), taval,
+                    d_data->thermoRect.width(),
+                    tval - taval + 1);
+                fRect.setRect(d_data->thermoRect.x(), d_data->thermoRect.y(),
+                    d_data->thermoRect.width(),
+                taval - d_data->thermoRect.y());
+            }
+            else
+            {
+                fRect.setRect(d_data->thermoRect.x(), d_data->thermoRect.y(),
+                    d_data->thermoRect.width(),
+                    tval - d_data->thermoRect.y() + 1);
+            }
+        }
+        else
+        {
+            bRect.setRect(d_data->thermoRect.x(), d_data->thermoRect.y(),
+            d_data->thermoRect.width(),
+            tval - d_data->thermoRect.y());
+            if (alarm)
+            {
+                aRect.setRect(d_data->thermoRect.x(),tval,
+                    d_data->thermoRect.width(),
+                    taval - tval + 1);
+                fRect.setRect(d_data->thermoRect.x(),taval + 1,
+                    d_data->thermoRect.width(),
+                    d_data->thermoRect.y() + d_data->thermoRect.height() - (taval + 1));
+            }
+            else
+            {
+                fRect.setRect(d_data->thermoRect.x(),tval,
+                    d_data->thermoRect.width(),
+                d_data->thermoRect.y() + d_data->thermoRect.height() - tval);
+            }
+        }
+    }
+
+    //
+    // paint thermometer
+    //
+    const QColor bgColor =
+#if QT_VERSION < 0x040000
+        colorGroup().color(QColorGroup::Background);
+#else
+        palette().color(QPalette::Background);
+#endif
+    p->fillRect(bRect, bgColor);
+
+    if (alarm)
+       p->fillRect(aRect, d_data->alarmBrush);
+
+    p->fillRect(fRect, d_data->fillBrush);
+}
+
+//! Set the border width of the pipe.
+void QwtThermo::setBorderWidth(int w)
+{
+    if ((w >= 0) && (w < (qwtMin(d_data->thermoRect.width(), 
+        d_data->thermoRect.height()) + d_data->borderWidth) / 2  - 1))
+    {
+        d_data->borderWidth = w;
+        layoutThermo();
+    }
+}
+
+//! Return the border width of the thermometer pipe.
+int QwtThermo::borderWidth() const
+{
+    return d_data->borderWidth;
+}
+
+/*!
+  \brief Set the range
+  \param vmin value corresponding lower or left end of the thermometer
+  \param vmax value corresponding to the upper or right end of the thermometer
+  \param logarithmic logarithmic mapping, true or false 
+*/
+void QwtThermo::setRange(double vmin, double vmax, bool logarithmic)
+{
+    d_data->minValue = vmin;
+    d_data->maxValue = vmax;
+
+    if ( logarithmic )
+        setScaleEngine(new QwtLog10ScaleEngine);
+    else
+        setScaleEngine(new QwtLinearScaleEngine);
+
+    /*
+      There are two different maps, one for the scale, the other
+      for the values. This is confusing and will be changed
+      in the future. TODO ...
+     */
+
+    d_data->map.setTransformation(scaleEngine()->transformation());
+    d_data->map.setScaleInterval(d_data->minValue, d_data->maxValue);
+
+    if (autoScale())
+        rescale(d_data->minValue, d_data->maxValue);
+
+    layoutThermo();
+}
+
+/*!
+  \brief Change the brush of the liquid.
+  \param brush New brush. The default brush is solid black.
+*/
+void QwtThermo::setFillBrush(const QBrush& brush)
+{
+    d_data->fillBrush = brush;
+    update();
+}
+
+//! Return the liquid brush.
+const QBrush& QwtThermo::fillBrush() const
+{
+    return d_data->fillBrush;
+}
+
+/*!
+  \brief Change the color of the liquid.
+  \param c New color. The default color is black.
+*/
+void QwtThermo::setFillColor(const QColor &c)
+{
+    d_data->fillBrush.setColor(c);
+    update();
+}
+
+//! Return the liquid color.
+const QColor &QwtThermo::fillColor() const
+{
+    return d_data->fillBrush.color();
+}
+
+/*!
+  \brief Specify the liquid brush above the alarm threshold
+  \param brush New brush. The default is solid white.
+*/
+void QwtThermo::setAlarmBrush(const QBrush& brush)
+{
+    d_data->alarmBrush = brush;
+    update();
+}
+
+//! Return the liquid brush above the alarm threshold.
+const QBrush& QwtThermo::alarmBrush() const
+{
+    return d_data->alarmBrush;
+}
+
+/*!
+  \brief Specify the liquid color above the alarm threshold
+  \param c New color. The default is white.
+*/
+void QwtThermo::setAlarmColor(const QColor &c)
+{
+    d_data->alarmBrush.setColor(c);
+    update();
+}
+
+//! Return the liquid color above the alarm threshold.
+const QColor &QwtThermo::alarmColor() const
+{
+    return d_data->alarmBrush.color();
+}
+
+//! Specify the alarm threshold.
+void QwtThermo::setAlarmLevel(double v)
+{
+    d_data->alarmLevel = v;
+    d_data->alarmEnabled = 1;
+    update();
+}
+
+//! Return the alarm threshold.
+double QwtThermo::alarmLevel() const
+{
+    return d_data->alarmLevel;
+}
+
+//! Change the width of the pipe.
+void QwtThermo::setPipeWidth(int w)
+{
+    if (w > 0)
+    {
+        d_data->thermoWidth = w;
+        layoutThermo();
+    }
+}
+
+//! Return the width of the pipe.
+int QwtThermo::pipeWidth() const
+{
+    return d_data->thermoWidth;
+}
+
+
+/*!
+  \brief Specify the distance between the pipe's endpoints
+         and the widget's border
+
+  The margin is used to leave some space for the scale
+  labels. If a large font is used, it is advisable to
+  adjust the margins.
+  \param m New Margin. The default values are 10 for
+           horizontal orientation and 20 for vertical
+           orientation.
+  \warning The margin has no effect if the scale is disabled.
+  \warning This function is a NOOP because margins are determined
+           automatically.
+*/
+void QwtThermo::setMargin(int)
+{
+}
+
+
+/*!
+  \brief Enable or disable the alarm threshold
+  \param tf true (disabled) or false (enabled)
+*/
+void QwtThermo::setAlarmEnabled(bool tf)
+{
+    d_data->alarmEnabled = tf;
+    update();
+}
+
+//! Return if the alarm threshold is enabled or disabled.
+bool QwtThermo::alarmEnabled() const
+{
+    return d_data->alarmEnabled;
+}
+
+/*!
+  \return the minimum size hint
+  \sa QwtThermo::minimumSizeHint
+*/
+QSize QwtThermo::sizeHint() const
+{
+    return minimumSizeHint();
+}
+
+/*!
+  \brief Return a minimum size hint
+  \warning The return value depends on the font and the scale.
+  \sa QwtThermo::sizeHint
+*/
+QSize QwtThermo::minimumSizeHint() const
+{
+    int w = 0, h = 0;
+
+    if ( d_data->scalePos != None )
+    {
+        const int sdExtent = scaleDraw()->extent( QPen(), font() );
+        const int sdLength = scaleDraw()->minLength( QPen(), font() );
+
+        w = sdLength;
+        h = d_data->thermoWidth + sdExtent + 
+            d_data->borderWidth + d_data->scaleDist;
+
+    }
+    else // no scale
+    {
+        w = 200;
+        h = d_data->thermoWidth;
+    }
+
+    if ( d_data->orientation == Qt::Vertical )
+        qSwap(w, h);
+
+    w += 2 * d_data->borderWidth;
+    h += 2 * d_data->borderWidth;
+
+    return QSize( w, h );
+}
+
+int QwtThermo::transform(double value) const
+{
+    const double min = qwtMin(d_data->map.s1(), d_data->map.s2());
+    const double max = qwtMax(d_data->map.s1(), d_data->map.s2());
+
+    if ( value > max )
+        value = max;
+    if ( value < min )
+        value = min;
+
+    return d_data->map.transform(value);
+}
diff --git a/src/qwt/qwt_wheel.cpp b/src/qwt/qwt_wheel.cpp
new file mode 100644
index 0000000..9200acd
--- /dev/null
+++ b/src/qwt/qwt_wheel.cpp
@@ -0,0 +1,637 @@
+/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+ * Qwt Widget Library
+ * Copyright (C) 1997   Josef Wilgen
+ * Copyright (C) 2002   Uwe Rathmann
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the Qwt License, Version 1.0
+ *****************************************************************************/
+
+#include <qevent.h>
+#include <qdrawutil.h>
+#include <qpainter.h>
+#include <qstyle.h>
+#include "qwt_math.h"
+#include "qwt_painter.h"
+#include "qwt_paint_buffer.h"
+#include "qwt_wheel.h"
+
+#define NUM_COLORS 30
+
+class QwtWheel::PrivateData
+{
+public:
+    PrivateData()
+    {
+        viewAngle = 175.0;
+        totalAngle = 360.0;
+        tickCnt = 10;
+        intBorder = 2;
+        borderWidth = 2;
+        wheelWidth = 20;
+#if QT_VERSION < 0x040000
+        allocContext = 0;
+#endif
+    };
+
+    QRect sliderRect;
+    double viewAngle;
+    double totalAngle;
+    int tickCnt;
+    int intBorder;
+    int borderWidth;
+    int wheelWidth;
+#if QT_VERSION < 0x040000
+    int allocContext;
+#endif
+    QColor colors[NUM_COLORS];
+};
+
+//! Constructor
+QwtWheel::QwtWheel(QWidget *parent): 
+    QwtAbstractSlider(Qt::Horizontal, parent)
+{
+    d_data = new PrivateData;
+
+#if QT_VERSION < 0x040000
+    setWFlags(Qt::WNoAutoErase);
+#endif
+
+    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+
+#if QT_VERSION >= 0x040000
+    setAttribute(Qt::WA_WState_OwnSizePolicy, false);
+#else
+    clearWState( WState_OwnSizePolicy );
+#endif
+
+    setUpdateTime(50);
+}
+
+//! Destructor
+QwtWheel::~QwtWheel()  
+{
+#if QT_VERSION < 0x040000
+    if ( d_data->allocContext )
+        QColor::destroyAllocContext( d_data->allocContext );
+#endif
+    delete d_data;
+}
+
+//! Set up the color array for the background pixmap.
+void QwtWheel::setColorArray()
+{
+    if ( !d_data->colors ) 
+        return;
+
+#if QT_VERSION < 0x040000
+    const QColor light = colorGroup().light();
+    const QColor dark = colorGroup().dark();
+#else
+    const QColor light = palette().color(QPalette::Light);
+    const QColor dark = palette().color(QPalette::Dark);
+#endif
+
+    if ( !d_data->colors[0].isValid() ||
+        d_data->colors[0] != light ||
+        d_data->colors[NUM_COLORS - 1] != dark )
+    {
+#if QT_VERSION < 0x040000
+        if ( d_data->allocContext )
+            QColor::destroyAllocContext( d_data->allocContext );
+
+        d_data->allocContext = QColor::enterAllocContext();
+#endif
+
+        d_data->colors[0] = light;
+        d_data->colors[NUM_COLORS - 1] = dark;
+
+        int dh, ds, dv, lh, ls, lv;
+#if QT_VERSION < 0x040000
+        d_data->colors[0].rgb(&lh, &ls, &lv);
+        d_data->colors[NUM_COLORS - 1].rgb(&dh, &ds, &dv);
+#else
+        d_data->colors[0].getRgb(&lh, &ls, &lv);
+        d_data->colors[NUM_COLORS - 1].getRgb(&dh, &ds, &dv);
+#endif
+
+        for ( int i = 1; i < NUM_COLORS - 1; ++i )
+        {
+            const double factor = double(i) / double(NUM_COLORS);
+
+            d_data->colors[i].setRgb( lh + int( double(dh - lh) * factor ),
+                      ls + int( double(ds - ls) * factor ),
+                      lv + int( double(dv - lv) * factor ));
+        }
+#if QT_VERSION < 0x040000
+        QColor::leaveAllocContext();
+#endif
+    }
+}
+
+/*!
+  \brief Adjust the number of grooves in the wheel's surface.
+
+  The number of grooves is limited to 6 <= cnt <= 50.
+  Values outside this range will be clipped.
+  The default value is 10.
+  \param cnt Number of grooves per 360 degrees
+*/
+void QwtWheel::setTickCnt(int cnt)
+{
+    d_data->tickCnt = qwtLim( cnt, 6, 50 );
+    update();
+}
+
+int QwtWheel::tickCnt() const 
+{
+    return d_data->tickCnt;
+}
+
+/*!
+    \return mass
+*/
+double QwtWheel::mass() const
+{
+    return QwtAbstractSlider::mass();
+}
+
+/*!
+  \brief Set the internal border width of the wheel.
+
+  The internal border must not be smaller than 1
+  and is limited in dependence on the wheel's size.
+  Values outside the allowed range will be clipped.
+
+  The internal border defaults to 2.
+  \param w border width
+*/
+void QwtWheel::setInternalBorder( int w )
+{
+    const int d = qwtMin( width(), height() ) / 3;
+    w = qwtMin( w, d );
+    d_data->intBorder = qwtMax( w, 1 );
+    layoutWheel();
+}
+
+int QwtWheel::internalBorder() const 
+{
+    return d_data->intBorder;
+}
+
+//! Draw the Wheel's background gradient
+void QwtWheel::drawWheelBackground( QPainter *p, const QRect &r )
+{
+    p->save();
+
+    //
+    // initialize pens
+    //
+#if QT_VERSION < 0x040000
+    const QColor light = colorGroup().light();
+    const QColor dark = colorGroup().dark();
+#else
+    const QColor light = palette().color(QPalette::Light);
+    const QColor dark = palette().color(QPalette::Dark);
+#endif
+
+    QPen lightPen;
+    lightPen.setColor(light);
+    lightPen.setWidth(d_data->intBorder);
+
+    QPen darkPen;
+    darkPen.setColor(dark);
+    darkPen.setWidth(d_data->intBorder);
+
+    setColorArray();
+
+    //
+    // initialize auxiliary variables
+    //
+
+    const int nFields = NUM_COLORS * 13 / 10;
+    const int hiPos = nFields - NUM_COLORS + 1;
+
+    if ( orientation() == Qt::Horizontal )
+    {
+        const int rx = r.x();
+        int ry = r.y() + d_data->intBorder;
+        const int rh = r.height() - 2* d_data->intBorder;
+        const int rw = r.width();
+        //
+        //  draw shaded background
+        //
+        int x1 = rx;
+        for (int i = 1; i < nFields; i++ )
+        {
+            const int x2 = rx + (rw * i) / nFields;
+            p->fillRect(x1, ry, x2-x1 + 1 ,rh, d_data->colors[qwtAbs(i-hiPos)]);
+            x1 = x2 + 1;
+        }
+        p->fillRect(x1, ry, rw - (x1 - rx), rh, d_data->colors[NUM_COLORS - 1]);
+
+        //
+        // draw internal border
+        //
+        p->setPen(lightPen);
+        ry = r.y() + d_data->intBorder / 2;
+        p->drawLine(r.x(), ry, r.x() + r.width() , ry);
+
+        p->setPen(darkPen);
+        ry = r.y() + r.height() - (d_data->intBorder - d_data->intBorder / 2);
+        p->drawLine(r.x(), ry , r.x() + r.width(), ry);
+    }
+    else // Qt::Vertical
+    {
+        int rx = r.x() + d_data->intBorder;
+        const int ry = r.y();
+        const int rh = r.height();
+        const int rw = r.width() - 2 * d_data->intBorder;
+
+        //
+        // draw shaded background
+        //
+        int y1 = ry;
+        for ( int i = 1; i < nFields; i++ )
+        {
+            const int y2 = ry + (rh * i) / nFields;
+            p->fillRect(rx, y1, rw, y2-y1 + 1, d_data->colors[qwtAbs(i-hiPos)]);
+            y1 = y2 + 1;
+        }
+        p->fillRect(rx, y1, rw, rh - (y1 - ry), d_data->colors[NUM_COLORS - 1]);
+
+        //
+        //  draw internal borders
+        //
+        p->setPen(lightPen);
+        rx = r.x() + d_data->intBorder / 2;
+        p->drawLine(rx, r.y(), rx, r.y() + r.height());
+
+        p->setPen(darkPen);
+        rx = r.x() + r.width() - (d_data->intBorder - d_data->intBorder / 2);
+        p->drawLine(rx, r.y(), rx , r.y() + r.height());
+    }
+
+    p->restore();
+}
+
+
+/*!
+  \brief Set the total angle which the wheel can be turned.
+
+  One full turn of the wheel corresponds to an angle of
+  360 degrees. A total angle of n*360 degrees means
+  that the wheel has to be turned n times around its axis
+  to get from the minimum value to the maximum value.
+
+  The default setting of the total angle is 360 degrees.
+  \param angle total angle in degrees
+*/
+void QwtWheel::setTotalAngle(double angle)
+{
+    d_data->totalAngle = qwtLim( angle, 10.0, 3600.0 );
+    update();
+}
+
+double QwtWheel::totalAngle() const 
+{
+    return d_data->totalAngle;
+}
+
+/*!
+  \brief Set the wheel's orientation.
+  \param o Orientation. Allowed values are
+           Qt::Horizontal and Qt::Vertical.
+   Defaults to Qt::Horizontal.
+  \sa QwtAbstractSlider::orientation()
+*/
+void QwtWheel::setOrientation(Qt::Orientation o)
+{
+    if ( orientation() == o )
+        return;
+
+#if QT_VERSION >= 0x040000
+    if ( !testAttribute(Qt::WA_WState_OwnSizePolicy) )
+#else
+    if ( !testWState( WState_OwnSizePolicy ) ) 
+#endif
+    {
+        QSizePolicy sp = sizePolicy();
+        sp.transpose();
+        setSizePolicy(sp);
+
+#if QT_VERSION >= 0x040000
+        setAttribute(Qt::WA_WState_OwnSizePolicy, false);
+#else
+        clearWState( WState_OwnSizePolicy );
+#endif
+    }
+
+    QwtAbstractSlider::setOrientation(o);
+    layoutWheel();
+}
+
+/*!
+  \brief Specify the visible portion of the wheel.
+
+  You may use this function for fine-tuning the appearance of
+  the wheel. The default value is 175 degrees. The value is
+  limited from 10 to 175 degrees.
+  \param angle Visible angle in degrees
+*/
+void QwtWheel::setViewAngle(double angle)
+{
+    d_data->viewAngle = qwtLim( angle, 10.0, 175.0 );
+    update();
+}
+
+double QwtWheel::viewAngle() const 
+{
+    return d_data->viewAngle;
+}
+
+/*!
+  \brief Redraw the wheel
+  \param p painter
+  \param r contents rectangle
+*/
+void QwtWheel::drawWheel( QPainter *p, const QRect &r )
+{
+#if QT_VERSION < 0x040000
+    const QColor light = colorGroup().light();
+    const QColor dark = colorGroup().dark();
+#else
+    const QColor light = palette().color(QPalette::Light);
+    const QColor dark = palette().color(QPalette::Dark);
+#endif
+
+    const double sign = (minValue() < maxValue()) ? 1.0 : -1.0;
+    double cnvFactor = qwtAbs(d_data->totalAngle / (maxValue() - minValue()));
+    const double halfIntv = 0.5 * d_data->viewAngle / cnvFactor;
+    const double loValue = value() - halfIntv;
+    const double hiValue = value() + halfIntv;
+    const double tickWidth = 360.0 / double(d_data->tickCnt) / cnvFactor;
+    const double sinArc = sin(d_data->viewAngle * M_PI / 360.0);
+    cnvFactor *= M_PI / 180.0;
+
+    //
+    // draw background gradient
+    //
+    drawWheelBackground( p, r );
+
+    //
+    // draw grooves
+    //
+    if ( orientation() == Qt::Horizontal )
+    {
+        const double halfSize = double(r.width()) * 0.5;
+
+        int l1 = r.y() + d_data->intBorder;
+        int l2 = r.y() + r.height() - d_data->intBorder - 1;
+
+        // draw one point over the border if border > 1
+        if ( d_data->intBorder > 1 )
+        {
+            l1 --;
+            l2 ++;
+        }
+
+        const int maxpos = r.x() + r.width() - 2;
+        const int minpos = r.x() + 2;
+
+        //
+        // draw tick marks
+        //
+        for ( double tickValue = ceil(loValue / tickWidth) * tickWidth;
+            tickValue < hiValue; tickValue += tickWidth )
+        {
+            //
+            //  calculate position
+            //
+            const int tickPos = r.x() + r.width()
+                - int( halfSize
+                    * (sinArc + sign *  sin((tickValue - value()) * cnvFactor))
+                    / sinArc);
+            //
+            // draw vertical line
+            //
+            if ( (tickPos <= maxpos) && (tickPos > minpos) )
+            {
+                p->setPen(dark);
+                p->drawLine(tickPos -1 , l1, tickPos - 1,  l2 );  
+                p->setPen(light);
+                p->drawLine(tickPos, l1, tickPos, l2);  
+            }
+        }
+    }
+    else if ( orientation() == Qt::Vertical )
+    {
+        const double halfSize = double(r.height()) * 0.5;
+
+        int l1 = r.x() + d_data->intBorder;
+        int l2 = r.x() + r.width() - d_data->intBorder - 1;
+
+        if ( d_data->intBorder > 1 )
+        {
+            l1--;
+            l2++;
+        }
+
+        const int maxpos = r.y() + r.height() - 2;
+        const int minpos = r.y() + 2;
+
+        //
+        // draw tick marks
+        //
+        for ( double tickValue = ceil(loValue / tickWidth) * tickWidth;
+            tickValue < hiValue; tickValue += tickWidth )
+        {
+
+            //
+            // calculate position
+            //
+            const int tickPos = r.y() + int( halfSize *
+                (sinArc + sign * sin((tickValue - value()) * cnvFactor))
+                / sinArc);
+
+            //
+            //  draw horizontal line
+            //
+            if ( (tickPos <= maxpos) && (tickPos > minpos) )
+            {
+                p->setPen(dark);
+                p->drawLine(l1, tickPos - 1 ,l2, tickPos - 1);  
+                p->setPen(light);
+                p->drawLine(l1, tickPos, l2, tickPos);  
+            }
+        }
+    }
+}
+
+
+//! Determine the value corresponding to a specified point
+double QwtWheel::getValue( const QPoint &p )
+{
+    // The reference position is arbitrary, but the
+    // sign of the offset is important
+    int w, dx;
+    if ( orientation() == Qt::Vertical )
+    {
+        w = d_data->sliderRect.height();
+        dx = d_data->sliderRect.y() - p.y();
+    }
+    else
+    {
+        w = d_data->sliderRect.width();
+        dx = p.x() - d_data->sliderRect.x();
+    }
+
+    // w pixels is an arc of viewAngle degrees,
+    // so we convert change in pixels to change in angle
+    const double ang = dx * d_data->viewAngle / w;
+
+    // value range maps to totalAngle degrees,
+    // so convert the change in angle to a change in value
+    const double val = ang * ( maxValue() - minValue() ) / d_data->totalAngle;
+
+    // Note, range clamping and rasterizing to step is automatically
+    // handled by QwtAbstractSlider, so we simply return the change in value
+    return val;
+}
+
+//! Qt Resize Event
+void QwtWheel::resizeEvent(QResizeEvent *)
+{
+    layoutWheel( false );
+}
+
+//! Recalculate the slider's geometry and layout based on
+//  the current rect and fonts.
+//  \param update_geometry  notify the layout system and call update
+//         to redraw the scale
+void QwtWheel::layoutWheel( bool update_geometry )
+{
+    const QRect r = this->rect();
+    d_data->sliderRect.setRect(r.x() + d_data->borderWidth, r.y() + d_data->borderWidth,
+        r.width() - 2*d_data->borderWidth, r.height() - 2*d_data->borderWidth);
+
+    if ( update_geometry )
+    {
+        updateGeometry();
+        update();
+    }
+}
+
+//! Qt Paint Event
+void QwtWheel::paintEvent(QPaintEvent *e)
+{
+    // Use double-buffering
+    const QRect &ur = e->rect();
+    if ( ur.isValid() )
+    {
+#if QT_VERSION < 0x040000
+        QwtPaintBuffer paintBuffer(this, ur);
+        draw(paintBuffer.painter(), ur);
+#else
+        QPainter painter(this);
+        draw(&painter, ur);
+#endif
+    }
+}
+
+//! Redraw panel and wheel
+void QwtWheel::draw(QPainter *painter, const QRect&)
+{
+    qDrawShadePanel( painter, rect().x(), rect().y(),
+        rect().width(), rect().height(),
+#if QT_VERSION < 0x040000
+        colorGroup(), 
+#else
+        palette(), 
+#endif
+        true, d_data->borderWidth );
+
+    drawWheel( painter, d_data->sliderRect );
+
+    if ( hasFocus() )
+        QwtPainter::drawFocusRect(painter, this);
+}
+
+//! Notify value change 
+void QwtWheel::valueChange()
+{
+    QwtAbstractSlider::valueChange();
+    update();
+}
+
+
+/*!
+  \brief Determine the scrolling mode and direction corresponding
+         to a specified point
+  \param p point
+  \param scrollMode scrolling mode
+  \param direction direction
+*/
+void QwtWheel::getScrollMode( const QPoint &p, int &scrollMode, int &direction)
+{
+    if ( d_data->sliderRect.contains(p) )
+        scrollMode = ScrMouse;
+    else
+        scrollMode = ScrNone;
+
+    direction = 0;
+}
+
+/*!
+  \brief Set the mass of the wheel
+
+  Assigning a mass turns the wheel into a flywheel.
+  \param val the wheel's mass
+*/
+void QwtWheel::setMass(double val)
+{
+    QwtAbstractSlider::setMass(val);
+}
+
+/*!
+  \brief Set the width of the wheel
+
+  Corresponds to the wheel height for horizontal orientation,
+  and the wheel width for vertical orientation.
+  \param w the wheel's width
+*/
+void QwtWheel::setWheelWidth(int w)
+{
+    d_data->wheelWidth = w;
+    layoutWheel();
+}
+
+/*!
+  \return a size hint
+*/
+QSize QwtWheel::sizeHint() const
+{
+    return minimumSizeHint();
+}
+
+/*!
+  \brief Return a minimum size hint
+  \warning The return value is based on the wheel width.
+*/
+QSize QwtWheel::minimumSizeHint() const
+{
+    QSize sz( 3*d_data->wheelWidth + 2*d_data->borderWidth,
+    d_data->wheelWidth + 2*d_data->borderWidth );
+    if ( orientation() != Qt::Horizontal )
+        sz.transpose();
+    return sz;
+}
+
+/*!
+  \brief Call update() when the palette changes
+*/
+void QwtWheel::paletteChange( const QPalette& )
+{
+    update();
+}
+
diff --git a/src/shapelib/dbfopen.c b/src/shapelib/dbfopen.c
new file mode 100644
index 0000000..b7c04c9
--- /dev/null
+++ b/src/shapelib/dbfopen.c
@@ -0,0 +1,1539 @@
+/******************************************************************************
+ * $Id: dbfopen.c 2249 2004-11-01 15:11:39Z juan $
+ *
+ * Project:  Shapelib
+ * Purpose:  Implementation of .dbf access API documented in dbf_api.html.
+ * Author:   Frank Warmerdam, warmerdam at pobox.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * This software is available under the following "MIT Style" license,
+ * or at the option of the licensee under the LGPL (see LICENSE.LGPL).  This
+ * option is discussed in more detail in shapelib.html.
+ *
+ * --
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log$
+ * Revision 1.4  2004/04/29 14:48:57  lubia
+ * modificacao de tempo
+ *
+ * Revision 1.3  2004/02/20 14:10:42  lubia
+ * Migrando para ultima versao da shapelib: 1.2.10
+ *
+ * Revision 1.48  2003/03/10 14:51:27  warmerda
+ * DBFWrite* calls now return FALSE if they have to truncate
+ *
+ * Revision 1.47  2002/11/20 03:32:22  warmerda
+ * Ensure field name in DBFGetFieldIndex() is properly terminated.
+ *
+ * Revision 1.46  2002/10/09 13:10:21  warmerda
+ * Added check that width is positive.
+ *
+ * Revision 1.45  2002/09/29 00:00:08  warmerda
+ * added FTLogical and logical attribute read/write calls
+ *
+ * Revision 1.44  2002/05/07 13:46:11  warmerda
+ * Added DBFWriteAttributeDirectly().
+ *
+ * Revision 1.43  2002/02/13 19:39:21  warmerda
+ * Fix casting issues in DBFCloneEmpty().
+ *
+ * Revision 1.42  2002/01/15 14:36:07  warmerda
+ * updated email address
+ *
+ * Revision 1.41  2002/01/15 14:31:49  warmerda
+ * compute rather than copying nHeaderLength in DBFCloneEmpty()
+ *
+ * Revision 1.40  2002/01/09 04:32:35  warmerda
+ * fixed to read correct amount of header
+ *
+ * Revision 1.39  2001/12/11 22:41:03  warmerda
+ * improve io related error checking when reading header
+ *
+ * Revision 1.38  2001/11/28 16:07:31  warmerda
+ * Cleanup to avoid compiler warnings as suggested by Richard Hash.
+ *
+ * Revision 1.37  2001/07/04 05:18:09  warmerda
+ * do last fix properly
+ *
+ * Revision 1.36  2001/07/04 05:16:09  warmerda
+ * fixed fieldname comparison in DBFGetFieldIndex
+ *
+ * Revision 1.35  2001/06/22 02:10:06  warmerda
+ * fixed NULL shape support with help from Jim Matthews
+ *
+ * Revision 1.33  2001/05/31 19:20:13  warmerda
+ * added DBFGetFieldIndex()
+ *
+ * Revision 1.32  2001/05/31 18:15:40  warmerda
+ * Added support for NULL fields in DBF files
+ *
+ * Revision 1.31  2001/05/23 13:36:52  warmerda
+ * added use of SHPAPI_CALL
+ *
+ * Revision 1.30  2000/12/05 14:43:38  warmerda
+ * DBReadAttribute() white space trimming bug fix
+ *
+ * Revision 1.29  2000/10/05 14:36:44  warmerda
+ * fix bug with writing very wide numeric fields
+ *
+ * Revision 1.28  2000/09/25 14:18:07  warmerda
+ * Added some casts of strlen() return result to fix warnings on some
+ * systems, as submitted by Daniel.
+ *
+ * Revision 1.27  2000/09/25 14:15:51  warmerda
+ * added DBFGetNativeFieldType()
+ *
+ * Revision 1.26  2000/07/07 13:39:45  warmerda
+ * removed unused variables, and added system include files
+ *
+ * Revision 1.25  2000/05/29 18:19:13  warmerda
+ * avoid use of uchar, and adding casting fix
+ *
+ * Revision 1.24  2000/05/23 13:38:27  warmerda
+ * Added error checks on return results of fread() and fseek().
+ *
+ * Revision 1.23  2000/05/23 13:25:49  warmerda
+ * Avoid crashing if field or record are out of range in dbfread*attribute().
+ *
+ * Revision 1.22  1999/12/15 13:47:24  warmerda
+ * Added stdlib.h to ensure that atof() is prototyped.
+ *
+ * Revision 1.21  1999/12/13 17:25:46  warmerda
+ * Added support for upper case .DBF extention.
+ *
+ * Revision 1.20  1999/11/30 16:32:11  warmerda
+ * Use atof() instead of sscanf().
+ *
+ * Revision 1.19  1999/11/05 14:12:04  warmerda
+ * updated license terms
+ *
+ * Revision 1.18  1999/07/27 00:53:28  warmerda
+ * ensure that whole old field value clear on write of string
+ *
+ * Revision 1.1  1999/07/05 18:58:07  warmerda
+ * New
+ *
+ * Revision 1.17  1999/06/11 19:14:12  warmerda
+ * Fixed some memory leaks.
+ *
+ * Revision 1.16  1999/06/11 19:04:11  warmerda
+ * Remoted some unused variables.
+ *
+ * Revision 1.15  1999/05/11 03:19:28  warmerda
+ * added new Tuple api, and improved extension handling - add from candrsn
+ *
+ * Revision 1.14  1999/05/04 15:01:48  warmerda
+ * Added 'F' support.
+ *
+ * Revision 1.13  1999/03/23 17:38:59  warmerda
+ * DBFAddField() now actually does return the new field number, or -1 if
+ * it fails.
+ *
+ * Revision 1.12  1999/03/06 02:54:46  warmerda
+ * Added logic to convert shapefile name to dbf filename in DBFOpen()
+ * for convenience.
+ *
+ * Revision 1.11  1998/12/31 15:30:34  warmerda
+ * Improved the interchangability of numeric and string attributes.  Add
+ * white space trimming option for attributes.
+ *
+ * Revision 1.10  1998/12/03 16:36:44  warmerda
+ * Use r+b instead of rb+ for binary access.
+ *
+ * Revision 1.9  1998/12/03 15:34:23  warmerda
+ * Updated copyright message.
+ *
+ * Revision 1.8  1997/12/04 15:40:15  warmerda
+ * Added newline character after field definitions.
+ *
+ * Revision 1.7  1997/03/06 14:02:10  warmerda
+ * Ensure bUpdated is initialized.
+ *
+ * Revision 1.6  1996/02/12 04:54:41  warmerda
+ * Ensure that DBFWriteAttribute() returns TRUE if it succeeds.
+ *
+ * Revision 1.5  1995/10/21  03:15:12  warmerda
+ * Changed to use binary file access, and ensure that the
+ * field name field is zero filled, and limited to 10 chars.
+ *
+ * Revision 1.4  1995/08/24  18:10:42  warmerda
+ * Added use of SfRealloc() to avoid pre-ANSI realloc() functions such
+ * as on the Sun.
+ *
+ * Revision 1.3  1995/08/04  03:15:16  warmerda
+ * Fixed up header.
+ *
+ * Revision 1.2  1995/08/04  03:14:43  warmerda
+ * Added header.
+ */
+
+/* static char rcsid[] = 
+  "$Id: dbfopen.c 2249 2004-11-01 15:11:39Z juan $"; */
+
+#include "shapefil.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+
+#ifndef FALSE
+#  define FALSE		0
+#  define TRUE		1
+#endif
+
+static int	nStringFieldLen = 0;
+static char * pszStringField = NULL;
+
+/************************************************************************/
+/*                             SfRealloc()                              */
+/*                                                                      */
+/*      A realloc cover function that will access a NULL pointer as     */
+/*      a valid input.                                                  */
+/************************************************************************/
+
+static void * SfRealloc( void * pMem, int nNewSize )
+
+{
+    if( pMem == NULL )
+        return( (void *) malloc(nNewSize) );
+    else
+        return( (void *) realloc(pMem,nNewSize) );
+}
+
+/************************************************************************/
+/*                           DBFWriteHeader()                           */
+/*                                                                      */
+/*      This is called to write out the file header, and field          */
+/*      descriptions before writing any actual data records.  This      */
+/*      also computes all the DBFDataSet field offset/size/decimals     */
+/*      and so forth values.                                            */
+/************************************************************************/
+
+static void DBFWriteHeader(DBFHandle psDBF)
+
+{
+    unsigned char	abyHeader[XBASE_FLDHDR_SZ];
+    int		i;
+
+    if( !psDBF->bNoHeader )
+        return;
+
+    psDBF->bNoHeader = FALSE;
+
+/* -------------------------------------------------------------------- */
+/*	Initialize the file header information.				*/
+/* -------------------------------------------------------------------- */
+    for( i = 0; i < XBASE_FLDHDR_SZ; i++ )
+        abyHeader[i] = 0;
+
+    abyHeader[0] = 0x03;		/* memo field? - just copying 	*/
+
+    /* date updated on close, record count preset at zero */
+
+    abyHeader[8] = psDBF->nHeaderLength % 256;
+    abyHeader[9] = psDBF->nHeaderLength / 256;
+    
+    abyHeader[10] = psDBF->nRecordLength % 256;
+    abyHeader[11] = psDBF->nRecordLength / 256;
+
+/* -------------------------------------------------------------------- */
+/*      Write the initial 32 byte file header, and all the field        */
+/*      descriptions.                                     		*/
+/* -------------------------------------------------------------------- */
+    fseek( psDBF->fp, 0, 0 );
+    fwrite( abyHeader, XBASE_FLDHDR_SZ, 1, psDBF->fp );
+    fwrite( psDBF->pszHeader, XBASE_FLDHDR_SZ, psDBF->nFields, psDBF->fp );
+
+/* -------------------------------------------------------------------- */
+/*      Write out the newline character if there is room for it.        */
+/* -------------------------------------------------------------------- */
+    if( psDBF->nHeaderLength > 32*psDBF->nFields + 32 )
+    {
+        char	cNewline;
+
+        cNewline = 0x0d;
+        fwrite( &cNewline, 1, 1, psDBF->fp );
+    }
+}
+
+/************************************************************************/
+/*                           DBFFlushRecord()                           */
+/*                                                                      */
+/*      Write out the current record if there is one.                   */
+/************************************************************************/
+
+static void DBFFlushRecord( DBFHandle psDBF )
+
+{
+    int		nRecordOffset;
+
+    if( psDBF->bCurrentRecordModified && psDBF->nCurrentRecord > -1 )
+    {
+	psDBF->bCurrentRecordModified = FALSE;
+
+	nRecordOffset = psDBF->nRecordLength * psDBF->nCurrentRecord 
+	                                             + psDBF->nHeaderLength;
+
+	fseek( psDBF->fp, nRecordOffset, 0 );
+	fwrite( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
+    }
+}
+
+/************************************************************************/
+/*                              DBFOpen()                               */
+/*                                                                      */
+/*      Open a .dbf file.                                               */
+/************************************************************************/
+   
+DBFHandle SHPAPI_CALL
+DBFOpen( const char * pszFilename, const char * pszAccess )
+
+{
+    DBFHandle		psDBF;
+    unsigned char		*pabyBuf;
+    int			nFields, nHeadLen, nRecLen, iField, i;
+    char		*pszBasename, *pszFullname;
+
+/* -------------------------------------------------------------------- */
+/*      We only allow the access strings "rb" and "r+".                  */
+/* -------------------------------------------------------------------- */
+    if( strcmp(pszAccess,"r") != 0 && strcmp(pszAccess,"r+") != 0 
+        && strcmp(pszAccess,"rb") != 0 && strcmp(pszAccess,"rb+") != 0
+        && strcmp(pszAccess,"r+b") != 0 )
+        return( NULL );
+
+    if( strcmp(pszAccess,"r") == 0 )
+        pszAccess = "rb";
+ 
+    if( strcmp(pszAccess,"r+") == 0 )
+        pszAccess = "rb+";
+
+/* -------------------------------------------------------------------- */
+/*	Compute the base (layer) name.  If there is any extension	*/
+/*	on the passed in filename we will strip it off.			*/
+/* -------------------------------------------------------------------- */
+    pszBasename = (char *) malloc(strlen(pszFilename)+5);
+    strcpy( pszBasename, pszFilename );
+    for( i = strlen(pszBasename)-1; 
+	 i > 0 && pszBasename[i] != '.' && pszBasename[i] != '/'
+	       && pszBasename[i] != '\\';
+	 i-- ) {}
+
+    if( pszBasename[i] == '.' )
+        pszBasename[i] = '\0';
+
+    pszFullname = (char *) malloc(strlen(pszBasename) + 5);
+    sprintf( pszFullname, "%s.dbf", pszBasename );
+        
+    psDBF = (DBFHandle) calloc( 1, sizeof(DBFInfo) );
+    psDBF->fp = fopen( pszFullname, pszAccess );
+
+    if( psDBF->fp == NULL )
+    {
+        sprintf( pszFullname, "%s.DBF", pszBasename );
+        psDBF->fp = fopen(pszFullname, pszAccess );
+    }
+    
+    free( pszBasename );
+    free( pszFullname );
+    
+    if( psDBF->fp == NULL )
+    {
+        free( psDBF );
+        return( NULL );
+    }
+
+    psDBF->bNoHeader = FALSE;
+    psDBF->nCurrentRecord = -1;
+    psDBF->bCurrentRecordModified = FALSE;
+
+/* -------------------------------------------------------------------- */
+/*  Read Table Header info                                              */
+/* -------------------------------------------------------------------- */
+    pabyBuf = (unsigned char *) malloc(500);
+    if( fread( pabyBuf, 32, 1, psDBF->fp ) != 1 )
+    {
+        fclose( psDBF->fp );
+        free( pabyBuf );
+        free( psDBF );
+        return NULL;
+    }
+
+    psDBF->nRecords = 
+     pabyBuf[4] + pabyBuf[5]*256 + pabyBuf[6]*256*256 + pabyBuf[7]*256*256*256;
+
+    psDBF->nHeaderLength = nHeadLen = pabyBuf[8] + pabyBuf[9]*256;
+    psDBF->nRecordLength = nRecLen = pabyBuf[10] + pabyBuf[11]*256;
+    
+    psDBF->nFields = nFields = (nHeadLen - 32) / 32;
+
+    psDBF->pszCurrentRecord = (char *) malloc(nRecLen);
+
+/* -------------------------------------------------------------------- */
+/*  Read in Field Definitions                                           */
+/* -------------------------------------------------------------------- */
+    
+    pabyBuf = (unsigned char *) SfRealloc(pabyBuf,nHeadLen);
+    psDBF->pszHeader = (char *) pabyBuf;
+
+    fseek( psDBF->fp, 32, 0 );
+    if( fread( pabyBuf, nHeadLen-32, 1, psDBF->fp ) != 1 )
+    {
+        fclose( psDBF->fp );
+        free( pabyBuf );
+        free( psDBF );
+        return NULL;
+    }
+
+    psDBF->panFieldOffset = (int *) malloc(sizeof(int) * nFields);
+    psDBF->panFieldSize = (int *) malloc(sizeof(int) * nFields);
+    psDBF->panFieldDecimals = (int *) malloc(sizeof(int) * nFields);
+    psDBF->pachFieldType = (char *) malloc(sizeof(char) * nFields);
+
+    for( iField = 0; iField < nFields; iField++ )
+    {
+	unsigned char		*pabyFInfo;
+
+	pabyFInfo = pabyBuf+iField*32;
+
+	if( pabyFInfo[11] == 'N' || pabyFInfo[11] == 'F' )
+	{
+	    psDBF->panFieldSize[iField] = pabyFInfo[16];
+	    psDBF->panFieldDecimals[iField] = pabyFInfo[17];
+	}
+	else
+	{
+	    psDBF->panFieldSize[iField] = pabyFInfo[16] + pabyFInfo[17]*256;
+	    psDBF->panFieldDecimals[iField] = 0;
+	}
+
+	psDBF->pachFieldType[iField] = (char) pabyFInfo[11];
+	if( iField == 0 )
+	    psDBF->panFieldOffset[iField] = 1;
+	else
+	    psDBF->panFieldOffset[iField] = 
+	      psDBF->panFieldOffset[iField-1] + psDBF->panFieldSize[iField-1];
+    }
+
+    return( psDBF );
+}
+
+/************************************************************************/
+/*                              DBFClose()                              */
+/************************************************************************/
+
+void SHPAPI_CALL
+DBFClose(DBFHandle psDBF)
+{
+/* -------------------------------------------------------------------- */
+/*      Write out header if not already written.                        */
+/* -------------------------------------------------------------------- */
+    if( psDBF->bNoHeader )
+        DBFWriteHeader( psDBF );
+
+    DBFFlushRecord( psDBF );
+
+/* -------------------------------------------------------------------- */
+/*      Update last access date, and number of records if we have	*/
+/*	write access.                					*/
+/* -------------------------------------------------------------------- */
+    if( psDBF->bUpdated )
+    {
+	unsigned char		abyFileHeader[32];
+
+	fseek( psDBF->fp, 0, 0 );
+	fread( abyFileHeader, 32, 1, psDBF->fp );
+
+	abyFileHeader[1] = 95;			/* YY */
+	abyFileHeader[2] = 7;			/* MM */
+	abyFileHeader[3] = 26;			/* DD */
+
+	abyFileHeader[4] = psDBF->nRecords % 256;
+	abyFileHeader[5] = (psDBF->nRecords/256) % 256;
+	abyFileHeader[6] = (psDBF->nRecords/(256*256)) % 256;
+	abyFileHeader[7] = (psDBF->nRecords/(256*256*256)) % 256;
+
+	fseek( psDBF->fp, 0, 0 );
+	fwrite( abyFileHeader, 32, 1, psDBF->fp );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Close, and free resources.                                      */
+/* -------------------------------------------------------------------- */
+    fclose( psDBF->fp );
+
+    if( psDBF->panFieldOffset != NULL )
+    {
+        free( psDBF->panFieldOffset );
+        free( psDBF->panFieldSize );
+        free( psDBF->panFieldDecimals );
+        free( psDBF->pachFieldType );
+    }
+
+    free( psDBF->pszHeader );
+    free( psDBF->pszCurrentRecord );
+
+    free( psDBF );
+
+    if( pszStringField != NULL )
+    {
+        free( pszStringField );
+        pszStringField = NULL;
+        nStringFieldLen = 0;
+    }
+}
+
+/************************************************************************/
+/*                             DBFCreate()                              */
+/*                                                                      */
+/*      Create a new .dbf file.                                         */
+/************************************************************************/
+
+DBFHandle SHPAPI_CALL
+DBFCreate( const char * pszFilename )
+
+{
+    DBFHandle	psDBF;
+    FILE	*fp;
+    char	*pszFullname, *pszBasename;
+    int		i;
+
+/* -------------------------------------------------------------------- */
+/*	Compute the base (layer) name.  If there is any extension	*/
+/*	on the passed in filename we will strip it off.			*/
+/* -------------------------------------------------------------------- */
+    pszBasename = (char *) malloc(strlen(pszFilename)+5);
+    strcpy( pszBasename, pszFilename );
+    for( i = strlen(pszBasename)-1; 
+	 i > 0 && pszBasename[i] != '.' && pszBasename[i] != '/'
+	       && pszBasename[i] != '\\';
+	 i-- ) {}
+
+    if( pszBasename[i] == '.' )
+        pszBasename[i] = '\0';
+
+    pszFullname = (char *) malloc(strlen(pszBasename) + 5);
+    sprintf( pszFullname, "%s.dbf", pszBasename );
+    free( pszBasename );
+
+/* -------------------------------------------------------------------- */
+/*      Create the file.                                                */
+/* -------------------------------------------------------------------- */
+    fp = fopen( pszFullname, "wb" );
+    if( fp == NULL )
+        return( NULL );
+
+    fputc( 0, fp );
+    fclose( fp );
+
+    fp = fopen( pszFullname, "rb+" );
+    if( fp == NULL )
+        return( NULL );
+
+    free( pszFullname );
+
+/* -------------------------------------------------------------------- */
+/*	Create the info structure.					*/
+/* -------------------------------------------------------------------- */
+    psDBF = (DBFHandle) malloc(sizeof(DBFInfo));
+
+    psDBF->fp = fp;
+    psDBF->nRecords = 0;
+    psDBF->nFields = 0;
+    psDBF->nRecordLength = 1;
+    psDBF->nHeaderLength = 33;
+    
+    psDBF->panFieldOffset = NULL;
+    psDBF->panFieldSize = NULL;
+    psDBF->panFieldDecimals = NULL;
+    psDBF->pachFieldType = NULL;
+    psDBF->pszHeader = NULL;
+
+    psDBF->nCurrentRecord = -1;
+    psDBF->bCurrentRecordModified = FALSE;
+    psDBF->pszCurrentRecord = NULL;
+
+    psDBF->bNoHeader = TRUE;
+
+    return( psDBF );
+}
+
+/************************************************************************/
+/*                            DBFAddField()                             */
+/*                                                                      */
+/*      Add a field to a newly created .dbf file before any records     */
+/*      are written.                                                    */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFAddField(DBFHandle psDBF, const char * pszFieldName, 
+            DBFFieldType eType, int nWidth, int nDecimals )
+
+{
+    char	*pszFInfo;
+    int		i;
+
+/* -------------------------------------------------------------------- */
+/*      Do some checking to ensure we can add records to this file.     */
+/* -------------------------------------------------------------------- */
+    if( psDBF->nRecords > 0 )
+        return( -1 );
+
+    if( !psDBF->bNoHeader )
+        return( -1 );
+
+    if( eType != FTDouble && nDecimals != 0 )
+        return( -1 );
+
+    if( nWidth < 1 )
+        return -1;
+
+/* -------------------------------------------------------------------- */
+/*      SfRealloc all the arrays larger to hold the additional field      */
+/*      information.                                                    */
+/* -------------------------------------------------------------------- */
+    psDBF->nFields++;
+
+    psDBF->panFieldOffset = (int *) 
+      SfRealloc( psDBF->panFieldOffset, sizeof(int) * psDBF->nFields );
+
+    psDBF->panFieldSize = (int *) 
+      SfRealloc( psDBF->panFieldSize, sizeof(int) * psDBF->nFields );
+
+    psDBF->panFieldDecimals = (int *) 
+      SfRealloc( psDBF->panFieldDecimals, sizeof(int) * psDBF->nFields );
+
+    psDBF->pachFieldType = (char *) 
+      SfRealloc( psDBF->pachFieldType, sizeof(char) * psDBF->nFields );
+
+/* -------------------------------------------------------------------- */
+/*      Assign the new field information fields.                        */
+/* -------------------------------------------------------------------- */
+    psDBF->panFieldOffset[psDBF->nFields-1] = psDBF->nRecordLength;
+    psDBF->nRecordLength += nWidth;
+    psDBF->panFieldSize[psDBF->nFields-1] = nWidth;
+    psDBF->panFieldDecimals[psDBF->nFields-1] = nDecimals;
+
+    if( eType == FTDate )
+        psDBF->pachFieldType[psDBF->nFields-1] = 'D';
+    else if( eType == FTLogical )
+        psDBF->pachFieldType[psDBF->nFields-1] = 'L';
+    else if( eType == FTString )
+        psDBF->pachFieldType[psDBF->nFields-1] = 'C';
+    else
+        psDBF->pachFieldType[psDBF->nFields-1] = 'N';
+
+/* -------------------------------------------------------------------- */
+/*      Extend the required header information.                         */
+/* -------------------------------------------------------------------- */
+    psDBF->nHeaderLength += 32;
+    psDBF->bUpdated = FALSE;
+
+    psDBF->pszHeader = (char *) SfRealloc(psDBF->pszHeader,psDBF->nFields*32);
+
+    pszFInfo = psDBF->pszHeader + 32 * (psDBF->nFields-1);
+
+    for( i = 0; i < 32; i++ )
+        pszFInfo[i] = '\0';
+
+    if( (int) strlen(pszFieldName) < 10 )
+        strncpy( pszFInfo, pszFieldName, strlen(pszFieldName));
+    else
+        strncpy( pszFInfo, pszFieldName, 10);
+
+    pszFInfo[11] = psDBF->pachFieldType[psDBF->nFields-1];
+
+    if( eType == FTDate )
+    {
+        pszFInfo[16] = 8 % 256;
+        pszFInfo[17] = 8 / 256;
+    }
+    else if( eType == FTString )
+    {
+        pszFInfo[16] = nWidth % 256;
+        pszFInfo[17] = nWidth / 256;
+    }
+    else
+    {
+        pszFInfo[16] = nWidth;
+        pszFInfo[17] = nDecimals;
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Make the current record buffer appropriately larger.            */
+/* -------------------------------------------------------------------- */
+    psDBF->pszCurrentRecord = (char *) SfRealloc(psDBF->pszCurrentRecord,
+					       psDBF->nRecordLength);
+
+    return( psDBF->nFields-1 );
+}
+
+/************************************************************************/
+/*                          DBFReadAttribute()                          */
+/*                                                                      */
+/*      Read one of the attribute fields of a record.                   */
+/************************************************************************/
+
+static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField,
+                              char chReqType )
+
+{
+    int	       	nRecordOffset;
+    unsigned char	*pabyRec;
+    void	*pReturnField = NULL;
+
+    static double dDoubleField;
+
+/* -------------------------------------------------------------------- */
+/*      Verify selection.                                               */
+/* -------------------------------------------------------------------- */
+    if( hEntity < 0 || hEntity >= psDBF->nRecords )
+        return( NULL );
+
+    if( iField < 0 || iField >= psDBF->nFields )
+        return( NULL );
+
+/* -------------------------------------------------------------------- */
+/*	Have we read the record?					*/
+/* -------------------------------------------------------------------- */
+    if( psDBF->nCurrentRecord != hEntity )
+    {
+	DBFFlushRecord( psDBF );
+
+	nRecordOffset = psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
+
+	if( fseek( psDBF->fp, nRecordOffset, 0 ) != 0 )
+        {
+            fprintf( stderr, "fseek(%d) failed on DBF file.\n",
+                     nRecordOffset );
+            return NULL;
+        }
+
+	if( fread( psDBF->pszCurrentRecord, psDBF->nRecordLength, 
+                   1, psDBF->fp ) != 1 )
+        {
+            fprintf( stderr, "fread(%d) failed on DBF file.\n",
+                     psDBF->nRecordLength );
+            return NULL;
+        }
+
+	psDBF->nCurrentRecord = hEntity;
+    }
+
+    pabyRec = (unsigned char *) psDBF->pszCurrentRecord;
+
+/* -------------------------------------------------------------------- */
+/*	Ensure our field buffer is large enough to hold this buffer.	*/
+/* -------------------------------------------------------------------- */
+    if( psDBF->panFieldSize[iField]+1 > nStringFieldLen )
+    {
+	nStringFieldLen = psDBF->panFieldSize[iField]*2 + 10;
+	pszStringField = (char *) SfRealloc(pszStringField,nStringFieldLen);
+    }
+
+/* -------------------------------------------------------------------- */
+/*	Extract the requested field.					*/
+/* -------------------------------------------------------------------- */
+    strncpy( pszStringField, 
+	     ((const char *) pabyRec) + psDBF->panFieldOffset[iField],
+	     psDBF->panFieldSize[iField] );
+    pszStringField[psDBF->panFieldSize[iField]] = '\0';
+
+    pReturnField = pszStringField;
+
+/* -------------------------------------------------------------------- */
+/*      Decode the field.                                               */
+/* -------------------------------------------------------------------- */
+    if( chReqType == 'D' )
+    {
+		char dateField[11];
+		sprintf(dateField,"%4s/%2s/%2s",pszStringField,pszStringField+4,pszStringField+6);
+		dateField[10] = '\0';
+		pReturnField = dateField;
+    }   
+	else if( chReqType == 'N' )
+    {
+        dDoubleField = atof(pszStringField);
+
+	pReturnField = &dDoubleField;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Should we trim white space off the string attribute value?      */
+/* -------------------------------------------------------------------- */
+#ifdef TRIM_DBF_WHITESPACE
+    else
+    {
+        char	*pchSrc, *pchDst;
+
+        pchDst = pchSrc = pszStringField;
+        while( *pchSrc == ' ' )
+            pchSrc++;
+
+        while( *pchSrc != '\0' )
+            *(pchDst++) = *(pchSrc++);
+        *pchDst = '\0';
+
+        while( pchDst != pszStringField && *(--pchDst) == ' ' )
+            *pchDst = '\0';
+    }
+#endif
+    
+    return( pReturnField );
+}
+
+/************************************************************************/
+/*                        DBFReadIntAttribute()                         */
+/*                                                                      */
+/*      Read an integer attribute.                                      */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFReadIntegerAttribute( DBFHandle psDBF, int iRecord, int iField )
+
+{
+    double	*pdValue;
+
+    pdValue = (double *) DBFReadAttribute( psDBF, iRecord, iField, 'N' );
+
+    if( pdValue == NULL )
+        return 0;
+    else
+        return( (int) *pdValue );
+}
+
+/************************************************************************/
+/*                        DBFReadDoubleAttribute()                      */
+/*                                                                      */
+/*      Read a double attribute.                                        */
+/************************************************************************/
+
+double SHPAPI_CALL
+DBFReadDoubleAttribute( DBFHandle psDBF, int iRecord, int iField )
+
+{
+    double	*pdValue;
+
+    pdValue = (double *) DBFReadAttribute( psDBF, iRecord, iField, 'N' );
+
+    if( pdValue == NULL )
+        return 0.0;
+    else
+        return( *pdValue );
+}
+
+/************************************************************************/
+/*                        DBFReadStringAttribute()                      */
+/*                                                                      */
+/*      Read a string attribute.                                        */
+/************************************************************************/
+
+const char SHPAPI_CALL1(*)
+DBFReadStringAttribute( DBFHandle psDBF, int iRecord, int iField )
+
+{
+    return( (const char *) DBFReadAttribute( psDBF, iRecord, iField, 'C' ) );
+}
+
+/************************************************************************/
+/*                        DBFReadStringAttribute()                      */
+/*                                                                      */
+/*      Read a string attribute.                                        */
+/************************************************************************/
+
+const char SHPAPI_CALL1(*)
+DBFReadDateAttribute( DBFHandle psDBF, int iRecord, int iField )
+
+{
+    return( (const char *) DBFReadAttribute( psDBF, iRecord, iField, 'D' ) );
+}
+
+/************************************************************************/
+/*                        DBFReadLogicalAttribute()                     */
+/*                                                                      */
+/*      Read a logical attribute.                                       */
+/************************************************************************/
+
+const char SHPAPI_CALL1(*)
+DBFReadLogicalAttribute( DBFHandle psDBF, int iRecord, int iField )
+
+{
+    return( (const char *) DBFReadAttribute( psDBF, iRecord, iField, 'L' ) );
+}
+
+/************************************************************************/
+/*                         DBFIsAttributeNULL()                         */
+/*                                                                      */
+/*      Return TRUE if value for field is NULL.                         */
+/*                                                                      */
+/*      Contributed by Jim Matthews.                                    */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFIsAttributeNULL( DBFHandle psDBF, int iRecord, int iField )
+
+{
+    const char	*pszValue;
+
+    pszValue = DBFReadStringAttribute( psDBF, iRecord, iField );
+
+    switch(psDBF->pachFieldType[iField])
+    {
+      case 'N':
+      case 'F':
+        /* NULL numeric fields have value "****************" */
+        return pszValue[0] == '*';
+
+      case 'D':
+        /* NULL date fields have value "00000000" */
+        return strncmp(pszValue,"00000000",8) == 0;
+
+      case 'L':
+        /* NULL boolean fields have value "?" */ 
+        return pszValue[0] == '?';
+
+      default:
+        /* empty string fields are considered NULL */
+        return strlen(pszValue) == 0;
+    }
+}
+
+/************************************************************************/
+/*                          DBFGetFieldCount()                          */
+/*                                                                      */
+/*      Return the number of fields in this table.                      */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFGetFieldCount( DBFHandle psDBF )
+
+{
+    return( psDBF->nFields );
+}
+
+/************************************************************************/
+/*                         DBFGetRecordCount()                          */
+/*                                                                      */
+/*      Return the number of records in this table.                     */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFGetRecordCount( DBFHandle psDBF )
+
+{
+    return( psDBF->nRecords );
+}
+
+/************************************************************************/
+/*                          DBFGetFieldInfo()                           */
+/*                                                                      */
+/*      Return any requested information about the field.               */
+/************************************************************************/
+
+DBFFieldType SHPAPI_CALL
+DBFGetFieldInfo( DBFHandle psDBF, int iField, char * pszFieldName,
+                 int * pnWidth, int * pnDecimals )
+
+{
+    if( iField < 0 || iField >= psDBF->nFields )
+        return( FTInvalid );
+
+    if( pnWidth != NULL )
+        *pnWidth = psDBF->panFieldSize[iField];
+
+    if( pnDecimals != NULL )
+        *pnDecimals = psDBF->panFieldDecimals[iField];
+
+    if( pszFieldName != NULL )
+    {
+	int	i;
+
+	strncpy( pszFieldName, (char *) psDBF->pszHeader+iField*32, 11 );
+	pszFieldName[11] = '\0';
+	for( i = 10; i > 0 && pszFieldName[i] == ' '; i-- )
+	    pszFieldName[i] = '\0';
+    }
+
+    if ( psDBF->pachFieldType[iField] == 'L' )
+	return( FTLogical);
+	else if ( psDBF->pachFieldType[iField] == 'D')
+		return (FTDate);
+    else if( psDBF->pachFieldType[iField] == 'N' || psDBF->pachFieldType[iField] == 'F')
+    {
+		if( psDBF->panFieldDecimals[iField] > 0 )
+			return( FTDouble );
+		else
+			return( FTInteger );
+    }
+    else
+    {
+		return( FTString );
+    }
+}
+
+/************************************************************************/
+/*                         DBFWriteAttribute()                          */
+/*																		*/
+/*	Write an attribute record to the file.								*/
+/************************************************************************/
+
+static int DBFWriteAttribute(DBFHandle psDBF, int hEntity, int iField,
+			     void * pValue )
+
+{
+    int	       	nRecordOffset, i, j, nRetResult = TRUE;
+    unsigned char	*pabyRec;
+    char	szSField[400], szFormat[20];
+
+/* -------------------------------------------------------------------- */
+/*	Is this a valid record?						*/
+/* -------------------------------------------------------------------- */
+    if( hEntity < 0 || hEntity > psDBF->nRecords )
+        return( FALSE );
+
+    if( psDBF->bNoHeader )
+        DBFWriteHeader(psDBF);
+
+/* -------------------------------------------------------------------- */
+/*      Is this a brand new record?                                     */
+/* -------------------------------------------------------------------- */
+    if( hEntity == psDBF->nRecords )
+    {
+	DBFFlushRecord( psDBF );
+
+	psDBF->nRecords++;
+	for( i = 0; i < psDBF->nRecordLength; i++ )
+	    psDBF->pszCurrentRecord[i] = ' ';
+
+	psDBF->nCurrentRecord = hEntity;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Is this an existing record, but different than the last one     */
+/*      we accessed?                                                    */
+/* -------------------------------------------------------------------- */
+    if( psDBF->nCurrentRecord != hEntity )
+    {
+	DBFFlushRecord( psDBF );
+
+	nRecordOffset = psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
+
+	fseek( psDBF->fp, nRecordOffset, 0 );
+	fread( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
+
+	psDBF->nCurrentRecord = hEntity;
+    }
+
+    pabyRec = (unsigned char *) psDBF->pszCurrentRecord;
+
+    psDBF->bCurrentRecordModified = TRUE;
+    psDBF->bUpdated = TRUE;
+
+/* -------------------------------------------------------------------- */
+/*      Translate NULL value to valid DBF file representation.          */
+/*                                                                      */
+/*      Contributed by Jim Matthews.                                    */
+/* -------------------------------------------------------------------- */
+    if( pValue == NULL )
+    {
+        switch(psDBF->pachFieldType[iField])
+        {
+          case 'N':
+          case 'F':
+	    /* NULL numeric fields have value "****************" */
+            memset( (char *) (pabyRec+psDBF->panFieldOffset[iField]), '*', 
+                    psDBF->panFieldSize[iField] );
+            break;
+
+          case 'D':
+	    /* NULL date fields have value "00000000" */
+            memset( (char *) (pabyRec+psDBF->panFieldOffset[iField]), '0', 
+                    psDBF->panFieldSize[iField] );
+            break;
+
+          case 'L':
+	    /* NULL boolean fields have value "?" */ 
+            memset( (char *) (pabyRec+psDBF->panFieldOffset[iField]), '?', 
+                    psDBF->panFieldSize[iField] );
+            break;
+
+          default:
+            /* empty string fields are considered NULL */
+            memset( (char *) (pabyRec+psDBF->panFieldOffset[iField]), '\0', 
+                    psDBF->panFieldSize[iField] );
+            break;
+        }
+        return TRUE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Assign all the record fields.                                   */
+/* -------------------------------------------------------------------- */
+	switch( psDBF->pachFieldType[iField] )
+	{
+	case 'N':
+	case 'F':
+		if( psDBF->panFieldDecimals[iField] == 0 )
+		{
+			int	nWidth = psDBF->panFieldSize[iField];
+
+			if( sizeof(szSField)-2 < (unsigned int)nWidth )
+			nWidth = sizeof(szSField)-2;
+
+			sprintf( szFormat, "%%%dd", nWidth );
+			sprintf(szSField, szFormat, (int) *((double *) pValue) );
+			if( (int)strlen(szSField) > psDBF->panFieldSize[iField] )
+			{
+				szSField[psDBF->panFieldSize[iField]] = '\0';
+				nRetResult = FALSE;
+			}
+
+			strncpy((char *) (pabyRec+psDBF->panFieldOffset[iField]),
+			szSField, strlen(szSField) );
+		}
+		else
+		{
+			int		nWidth = psDBF->panFieldSize[iField];
+
+			if( sizeof(szSField)-2 < (unsigned int)nWidth )
+			nWidth = sizeof(szSField)-2;
+
+			sprintf( szFormat, "%%%d.%df", 
+			nWidth, psDBF->panFieldDecimals[iField] );
+			sprintf(szSField, szFormat, *((double *) pValue) );
+			if( (int) strlen(szSField) > psDBF->panFieldSize[iField] )
+			{
+				szSField[psDBF->panFieldSize[iField]] = '\0';
+				nRetResult = FALSE;
+			}
+			strncpy((char *) (pabyRec+psDBF->panFieldOffset[iField]),
+			szSField, strlen(szSField) );
+		}
+		break;
+
+	case 'L':
+		if (psDBF->panFieldSize[iField] >= 1  && 
+			(*(char*)pValue == 'F' || *(char*)pValue == 'T'))
+			*(pabyRec+psDBF->panFieldOffset[iField]) = *(char*)pValue;
+		break;
+
+	default:
+		if( (int) strlen((char *) pValue) > psDBF->panFieldSize[iField] )
+		{
+			j = psDBF->panFieldSize[iField];
+			nRetResult = FALSE;
+		}
+		else
+		{
+			memset( pabyRec+psDBF->panFieldOffset[iField], ' ',
+			psDBF->panFieldSize[iField] );
+			j = strlen((char *) pValue);
+		}
+
+		strncpy((char *) (pabyRec+psDBF->panFieldOffset[iField]),(char *) pValue, j );
+		break;
+	}
+
+    return( nRetResult );
+}
+
+/************************************************************************/
+/*                     DBFWriteAttributeDirectly()                      */
+/*                                                                      */
+/*      Write an attribute record to the file, but without any          */
+/*      reformatting based on type.  The provided buffer is written     */
+/*      as is to the field position in the record.                      */
+/************************************************************************/
+
+int DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField,
+                              void * pValue )
+
+{
+    int	       	nRecordOffset, i, j;
+    unsigned char	*pabyRec;
+
+/* -------------------------------------------------------------------- */
+/*	Is this a valid record?						*/
+/* -------------------------------------------------------------------- */
+    if( hEntity < 0 || hEntity > psDBF->nRecords )
+        return( FALSE );
+
+    if( psDBF->bNoHeader )
+        DBFWriteHeader(psDBF);
+
+/* -------------------------------------------------------------------- */
+/*      Is this a brand new record?                                     */
+/* -------------------------------------------------------------------- */
+    if( hEntity == psDBF->nRecords )
+    {
+	DBFFlushRecord( psDBF );
+
+	psDBF->nRecords++;
+	for( i = 0; i < psDBF->nRecordLength; i++ )
+	    psDBF->pszCurrentRecord[i] = ' ';
+
+	psDBF->nCurrentRecord = hEntity;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Is this an existing record, but different than the last one     */
+/*      we accessed?                                                    */
+/* -------------------------------------------------------------------- */
+    if( psDBF->nCurrentRecord != hEntity )
+    {
+	DBFFlushRecord( psDBF );
+
+	nRecordOffset = psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
+
+	fseek( psDBF->fp, nRecordOffset, 0 );
+	fread( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
+
+	psDBF->nCurrentRecord = hEntity;
+    }
+
+    pabyRec = (unsigned char *) psDBF->pszCurrentRecord;
+
+/* -------------------------------------------------------------------- */
+/*      Assign all the record fields.                                   */
+/* -------------------------------------------------------------------- */
+    if( (int)strlen((char *) pValue) > psDBF->panFieldSize[iField] )
+        j = psDBF->panFieldSize[iField];
+    else
+    {
+        memset( pabyRec+psDBF->panFieldOffset[iField], ' ',
+                psDBF->panFieldSize[iField] );
+        j = strlen((char *) pValue);
+    }
+
+    strncpy((char *) (pabyRec+psDBF->panFieldOffset[iField]),
+            (char *) pValue, j );
+
+    psDBF->bCurrentRecordModified = TRUE;
+    psDBF->bUpdated = TRUE;
+
+    return( TRUE );
+}
+
+/************************************************************************/
+/*                      DBFWriteDoubleAttribute()                       */
+/*                                                                      */
+/*      Write a double attribute.                                       */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFWriteDoubleAttribute( DBFHandle psDBF, int iRecord, int iField,
+                         double dValue )
+
+{
+    return( DBFWriteAttribute( psDBF, iRecord, iField, (void *) &dValue ) );
+}
+
+/************************************************************************/
+/*                      DBFWriteIntegerAttribute()                      */
+/*                                                                      */
+/*      Write a integer attribute.                                      */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFWriteIntegerAttribute( DBFHandle psDBF, int iRecord, int iField,
+                          int nValue )
+
+{
+    double	dValue = nValue;
+
+    return( DBFWriteAttribute( psDBF, iRecord, iField, (void *) &dValue ) );
+}
+
+/************************************************************************/
+/*                      DBFWriteStringAttribute()                       */
+/*                                                                      */
+/*      Write a string attribute.                                       */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFWriteStringAttribute( DBFHandle psDBF, int iRecord, int iField,
+                         const char * pszValue )
+
+{
+    return( DBFWriteAttribute( psDBF, iRecord, iField, (void *) pszValue ) );
+}
+
+/************************************************************************/
+/*                      DBFWriteDateAttribute()		                    */
+/*                                                                      */
+/*      Write a date attribute.                                       */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFWriteDateAttribute( DBFHandle psDBF, int iRecord, int iField,
+                         const char * pszValue )
+
+{
+    return( DBFWriteAttribute( psDBF, iRecord, iField, (void *) pszValue ) );
+}
+
+/************************************************************************/
+/*                      DBFWriteNULLAttribute()                         */
+/*                                                                      */
+/*      Write a string attribute.                                       */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFWriteNULLAttribute( DBFHandle psDBF, int iRecord, int iField )
+
+{
+    return( DBFWriteAttribute( psDBF, iRecord, iField, NULL ) );
+}
+
+/************************************************************************/
+/*                      DBFWriteLogicalAttribute()                      */
+/*                                                                      */
+/*      Write a logical attribute.                                      */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFWriteLogicalAttribute( DBFHandle psDBF, int iRecord, int iField,
+		       const char lValue)
+
+{
+    return( DBFWriteAttribute( psDBF, iRecord, iField, (void *) (&lValue) ) );
+}
+
+/************************************************************************/
+/*                         DBFWriteTuple()                              */
+/*									*/
+/*	Write an attribute record to the file.				*/
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFWriteTuple(DBFHandle psDBF, int hEntity, void * pRawTuple )
+
+{
+    int	       	nRecordOffset, i;
+    unsigned char	*pabyRec;
+
+/* -------------------------------------------------------------------- */
+/*	Is this a valid record?						*/
+/* -------------------------------------------------------------------- */
+    if( hEntity < 0 || hEntity > psDBF->nRecords )
+        return( FALSE );
+
+    if( psDBF->bNoHeader )
+        DBFWriteHeader(psDBF);
+
+/* -------------------------------------------------------------------- */
+/*      Is this a brand new record?                                     */
+/* -------------------------------------------------------------------- */
+    if( hEntity == psDBF->nRecords )
+    {
+	DBFFlushRecord( psDBF );
+
+	psDBF->nRecords++;
+	for( i = 0; i < psDBF->nRecordLength; i++ )
+	    psDBF->pszCurrentRecord[i] = ' ';
+
+	psDBF->nCurrentRecord = hEntity;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Is this an existing record, but different than the last one     */
+/*      we accessed?                                                    */
+/* -------------------------------------------------------------------- */
+    if( psDBF->nCurrentRecord != hEntity )
+    {
+	DBFFlushRecord( psDBF );
+
+	nRecordOffset = psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
+
+	fseek( psDBF->fp, nRecordOffset, 0 );
+	fread( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
+
+	psDBF->nCurrentRecord = hEntity;
+    }
+
+    pabyRec = (unsigned char *) psDBF->pszCurrentRecord;
+
+    memcpy ( pabyRec, pRawTuple,  psDBF->nRecordLength );
+
+    psDBF->bCurrentRecordModified = TRUE;
+    psDBF->bUpdated = TRUE;
+
+    return( TRUE );
+}
+
+/************************************************************************/
+/*                          DBFReadTuple()                              */
+/*                                                                      */
+/*      Read one of the attribute fields of a record.                   */
+/************************************************************************/
+
+const char SHPAPI_CALL1(*)
+DBFReadTuple(DBFHandle psDBF, int hEntity )
+
+{
+    int	       	nRecordOffset;
+    unsigned char	*pabyRec;
+    static char	*pReturnTuple = NULL;
+
+    static int	nTupleLen = 0;
+
+/* -------------------------------------------------------------------- */
+/*	Have we read the record?					*/
+/* -------------------------------------------------------------------- */
+    if( hEntity < 0 || hEntity >= psDBF->nRecords )
+        return( NULL );
+
+    if( psDBF->nCurrentRecord != hEntity )
+    {
+	DBFFlushRecord( psDBF );
+
+	nRecordOffset = psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
+
+	fseek( psDBF->fp, nRecordOffset, 0 );
+	fread( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
+
+	psDBF->nCurrentRecord = hEntity;
+    }
+
+    pabyRec = (unsigned char *) psDBF->pszCurrentRecord;
+
+    if ( nTupleLen < psDBF->nRecordLength) {
+      nTupleLen = psDBF->nRecordLength;
+      pReturnTuple = (char *) SfRealloc(pReturnTuple, psDBF->nRecordLength);
+    }
+    
+    memcpy ( pReturnTuple, pabyRec, psDBF->nRecordLength );
+        
+    return( pReturnTuple );
+}
+
+/************************************************************************/
+/*                          DBFCloneEmpty()                              */
+/*                                                                      */
+/*      Read one of the attribute fields of a record.                   */
+/************************************************************************/
+
+DBFHandle SHPAPI_CALL
+DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename ) 
+{
+    DBFHandle	newDBF;
+
+   newDBF = DBFCreate ( pszFilename );
+   if ( newDBF == NULL ) return ( NULL ); 
+   
+   newDBF->pszHeader = (char *) malloc ( 32 * psDBF->nFields );
+   memcpy ( newDBF->pszHeader, psDBF->pszHeader, 32 * psDBF->nFields );
+   
+   newDBF->nFields = psDBF->nFields;
+   newDBF->nRecordLength = psDBF->nRecordLength;
+   newDBF->nHeaderLength = 32 * (psDBF->nFields+1);
+    
+   newDBF->panFieldOffset = (int *) malloc ( sizeof(int) * psDBF->nFields ); 
+   memcpy ( newDBF->panFieldOffset, psDBF->panFieldOffset, sizeof(int) * psDBF->nFields );
+   newDBF->panFieldSize = (int *) malloc ( sizeof(int) * psDBF->nFields );
+   memcpy ( newDBF->panFieldSize, psDBF->panFieldSize, sizeof(int) * psDBF->nFields );
+   newDBF->panFieldDecimals = (int *) malloc ( sizeof(int) * psDBF->nFields );
+   memcpy ( newDBF->panFieldDecimals, psDBF->panFieldDecimals, sizeof(int) * psDBF->nFields );
+   newDBF->pachFieldType = (char *) malloc ( sizeof(int) * psDBF->nFields );
+   memcpy ( newDBF->pachFieldType, psDBF->pachFieldType, sizeof(int) * psDBF->nFields );
+
+   newDBF->bNoHeader = TRUE;
+   newDBF->bUpdated = TRUE;
+   
+   DBFWriteHeader ( newDBF );
+   DBFClose ( newDBF );
+   
+   newDBF = DBFOpen ( pszFilename, "rb+" );
+
+   return ( newDBF );
+}
+
+/************************************************************************/
+/*                       DBFGetNativeFieldType()                        */
+/*                                                                      */
+/*      Return the DBase field type for the specified field.            */
+/*                                                                      */
+/*      Value can be one of: 'C' (String), 'D' (Date), 'F' (Float),     */
+/*                           'N' (Numeric, with or without decimal),    */
+/*                           'L' (Logical),                             */
+/*                           'M' (Memo: 10 digits .DBT block ptr)       */
+/************************************************************************/
+
+char SHPAPI_CALL
+DBFGetNativeFieldType( DBFHandle psDBF, int iField )
+
+{
+    if( iField >=0 && iField < psDBF->nFields )
+        return psDBF->pachFieldType[iField];
+
+    return  ' ';
+}
+
+/************************************************************************/
+/*                            str_to_upper()                            */
+/************************************************************************/
+
+static void str_to_upper (char *string)
+{
+    int len;
+    short i = -1;
+
+    len = strlen (string);
+
+    while (++i < len)
+        if (isalpha(string[i]) && islower(string[i]))
+            string[i] = toupper ((int)string[i]);
+}
+
+/************************************************************************/
+/*                          DBFGetFieldIndex()                          */
+/*                                                                      */
+/*      Get the index number for a field in a .dbf file.                */
+/*                                                                      */
+/*      Contributed by Jim Matthews.                                    */
+/************************************************************************/
+
+int SHPAPI_CALL
+DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName)
+
+{
+    char          name[12], name1[12], name2[12];
+    int           i;
+
+    strncpy(name1, pszFieldName,11);
+    name1[11] = '\0';
+    str_to_upper(name1);
+
+    for( i = 0; i < DBFGetFieldCount(psDBF); i++ )
+    {
+        DBFGetFieldInfo( psDBF, i, name, NULL, NULL );
+        strncpy(name2,name,11);
+        str_to_upper(name2);
+
+        if(!strncmp(name1,name2,10))
+            return(i);
+    }
+    return(-1);
+}
diff --git a/src/shapelib/shapefil.h b/src/shapelib/shapefil.h
new file mode 100644
index 0000000..8095c43
--- /dev/null
+++ b/src/shapelib/shapefil.h
@@ -0,0 +1,493 @@
+#ifndef _SHAPEFILE_H_INCLUDED
+#define _SHAPEFILE_H_INCLUDED
+
+/******************************************************************************
+ * $Id: shapefil.h 1430 2004-04-29 14:48:57Z lubia $
+ *
+ * Project:  Shapelib
+ * Purpose:  Primary include file for Shapelib.
+ * Author:   Frank Warmerdam, warmerdam at pobox.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * This software is available under the following "MIT Style" license,
+ * or at the option of the licensee under the LGPL (see LICENSE.LGPL).  This
+ * option is discussed in more detail in shapelib.html.
+ *
+ * --
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log$
+ * Revision 1.2  2004/02/20 14:10:42  lubia
+ * Migrando para ultima versao da shapelib: 1.2.10
+ *
+ * Revision 1.26  2002/09/29 00:00:08  warmerda
+ * added FTLogical and logical attribute read/write calls
+ *
+ * Revision 1.25  2002/05/07 13:46:30  warmerda
+ * added DBFWriteAttributeDirectly().
+ *
+ * Revision 1.24  2002/04/10 16:59:54  warmerda
+ * added SHPRewindObject
+ *
+ * Revision 1.23  2002/01/15 14:36:07  warmerda
+ * updated email address
+ *
+ * Revision 1.22  2002/01/15 14:32:00  warmerda
+ * try to improve SHPAPI_CALL docs
+ *
+ * Revision 1.21  2001/11/01 16:29:55  warmerda
+ * move pabyRec into SHPInfo for thread safety
+ *
+ * Revision 1.20  2001/07/20 13:06:02  warmerda
+ * fixed SHPAPI attribute for SHPTreeFindLikelyShapes
+ *
+ * Revision 1.19  2001/05/31 19:20:13  warmerda
+ * added DBFGetFieldIndex()
+ *
+ * Revision 1.18  2001/05/31 18:15:40  warmerda
+ * Added support for NULL fields in DBF files
+ *
+ * Revision 1.17  2001/05/23 13:36:52  warmerda
+ * added use of SHPAPI_CALL
+ *
+ * Revision 1.16  2000/09/25 14:15:59  warmerda
+ * added DBFGetNativeFieldType()
+ *
+ * Revision 1.15  2000/02/16 16:03:51  warmerda
+ * added null shape support
+ *
+ * Revision 1.14  1999/11/05 14:12:05  warmerda
+ * updated license terms
+ *
+ * Revision 1.13  1999/06/02 18:24:21  warmerda
+ * added trimming code
+ *
+ * Revision 1.12  1999/06/02 17:56:12  warmerda
+ * added quad'' subnode support for trees
+ *
+ * Revision 1.11  1999/05/18 19:11:11  warmerda
+ * Added example searching capability
+ *
+ * Revision 1.10  1999/05/18 17:49:38  warmerda
+ * added initial quadtree support
+ *
+ * Revision 1.9  1999/05/11 03:19:28  warmerda
+ * added new Tuple api, and improved extension handling - add from candrsn
+ *
+ * Revision 1.8  1999/03/23 17:22:27  warmerda
+ * Added extern "C" protection for C++ users of shapefil.h.
+ *
+ * Revision 1.7  1998/12/31 15:31:07  warmerda
+ * Added the TRIM_DBF_WHITESPACE and DISABLE_MULTIPATCH_MEASURE options.
+ *
+ * Revision 1.6  1998/12/03 15:48:15  warmerda
+ * Added SHPCalculateExtents().
+ *
+ * Revision 1.5  1998/11/09 20:57:16  warmerda
+ * Altered SHPGetInfo() call.
+ *
+ * Revision 1.4  1998/11/09 20:19:33  warmerda
+ * Added 3D support, and use of SHPObject.
+ *
+ * Revision 1.3  1995/08/23 02:24:05  warmerda
+ * Added support for reading bounds.
+ *
+ * Revision 1.2  1995/08/04  03:17:39  warmerda
+ * Added header.
+ *
+ */
+
+#include <stdio.h>
+
+#ifdef USE_DBMALLOC
+#include <dbmalloc.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/************************************************************************/
+/*                        Configuration options.                        */
+/************************************************************************/
+
+/* -------------------------------------------------------------------- */
+/*      Should the DBFReadStringAttribute() strip leading and           */
+/*      trailing white space?                                           */
+/* -------------------------------------------------------------------- */
+#define TRIM_DBF_WHITESPACE
+
+/* -------------------------------------------------------------------- */
+/*      Should we write measure values to the Multipatch object?        */
+/*      Reportedly ArcView crashes if we do write it, so for now it     */
+/*      is disabled.                                                    */
+/* -------------------------------------------------------------------- */
+#define DISABLE_MULTIPATCH_MEASURE
+
+/* -------------------------------------------------------------------- */
+/*      SHPAPI_CALL                                                     */
+/*                                                                      */
+/*      The following two macros are present to allow forcing           */
+/*      various calling conventions on the Shapelib API.                */
+/*                                                                      */
+/*      To force __stdcall conventions (needed to call Shapelib         */
+/*      from Visual Basic and/or Dephi I believe) the makefile could    */
+/*      be modified to define:                                          */
+/*                                                                      */
+/*        /DSHPAPI_CALL=__stdcall                                       */
+/*                                                                      */
+/*      If it is desired to force export of the Shapelib API without    */
+/*      using the shapelib.def file, use the following definition.      */
+/*                                                                      */
+/*        /DSHAPELIB_DLLEXPORT                                          */
+/*                                                                      */
+/*      To get both at once it will be necessary to hack this           */
+/*      include file to define:                                         */
+/*                                                                      */
+/*        #define SHPAPI_CALL __declspec(dllexport) __stdcall           */
+/*        #define SHPAPI_CALL1 __declspec(dllexport) * __stdcall        */
+/*                                                                      */
+/*      The complexity of the situtation is partly caused by the        */
+/*      peculiar requirement of Visual C++ that __stdcall appear        */
+/*      after any "*"'s in the return value of a function while the     */
+/*      __declspec(dllexport) must appear before them.                  */
+/* -------------------------------------------------------------------- */
+
+#ifdef SHAPELIB_DLLEXPORT
+#  define SHPAPI_CALL __declspec(dllexport)
+#  define SHPAPI_CALL1(x)  __declspec(dllexport) x
+#endif
+
+#ifndef SHPAPI_CALL
+#  define SHPAPI_CALL
+#endif
+
+#ifndef SHPAPI_CALL1
+#  define SHPAPI_CALL1(x)      x SHPAPI_CALL
+#endif
+    
+/************************************************************************/
+/*                             SHP Support.                             */
+/************************************************************************/
+typedef	struct
+{
+    FILE        *fpSHP;
+    FILE	*fpSHX;
+
+    int		nShapeType;				/* SHPT_* */
+    
+    int		nFileSize;				/* SHP file */
+
+    int         nRecords;
+    int		nMaxRecords;
+    int		*panRecOffset;
+    int		*panRecSize;
+
+    double	adBoundsMin[4];
+    double	adBoundsMax[4];
+
+    int		bUpdated;
+
+    unsigned char *pabyRec;
+    int         nBufSize;
+} SHPInfo;
+
+typedef SHPInfo * SHPHandle;
+
+/* -------------------------------------------------------------------- */
+/*      Shape types (nSHPType)                                          */
+/* -------------------------------------------------------------------- */
+#define SHPT_NULL	0
+#define SHPT_POINT	1
+#define SHPT_ARC	3
+#define SHPT_POLYGON	5
+#define SHPT_MULTIPOINT	8
+#define SHPT_POINTZ	11
+#define SHPT_ARCZ	13
+#define SHPT_POLYGONZ	15
+#define SHPT_MULTIPOINTZ 18
+#define SHPT_POINTM	21
+#define SHPT_ARCM	23
+#define SHPT_POLYGONM	25
+#define SHPT_MULTIPOINTM 28
+#define SHPT_MULTIPATCH 31
+
+
+/* -------------------------------------------------------------------- */
+/*      Part types - everything but SHPT_MULTIPATCH just uses           */
+/*      SHPP_RING.                                                      */
+/* -------------------------------------------------------------------- */
+
+#define SHPP_TRISTRIP	0
+#define SHPP_TRIFAN	1
+#define SHPP_OUTERRING	2
+#define SHPP_INNERRING	3
+#define SHPP_FIRSTRING	4
+#define SHPP_RING	5
+
+/* -------------------------------------------------------------------- */
+/*      SHPObject - represents on shape (without attributes) read       */
+/*      from the .shp file.                                             */
+/* -------------------------------------------------------------------- */
+typedef struct
+{
+    int		nSHPType;
+
+    int		nShapeId; /* -1 is unknown/unassigned */
+
+    int		nParts;
+    int		*panPartStart;
+    int		*panPartType;
+    
+    int		nVertices;
+    double	*padfX;
+    double	*padfY;
+    double	*padfZ;
+    double	*padfM;
+
+    double	dfXMin;
+    double	dfYMin;
+    double	dfZMin;
+    double	dfMMin;
+
+    double	dfXMax;
+    double	dfYMax;
+    double	dfZMax;
+    double	dfMMax;
+} SHPObject;
+
+/* -------------------------------------------------------------------- */
+/*      SHP API Prototypes                                              */
+/* -------------------------------------------------------------------- */
+SHPHandle SHPAPI_CALL
+      SHPOpen( const char * pszShapeFile, const char * pszAccess );
+SHPHandle SHPAPI_CALL
+      SHPCreate( const char * pszShapeFile, int nShapeType );
+void SHPAPI_CALL
+      SHPGetInfo( SHPHandle hSHP, int * pnEntities, int * pnShapeType,
+                  double * padfMinBound, double * padfMaxBound );
+
+SHPObject SHPAPI_CALL1(*)
+      SHPReadObject( SHPHandle hSHP, int iShape );
+int SHPAPI_CALL
+      SHPWriteObject( SHPHandle hSHP, int iShape, SHPObject * psObject );
+
+void SHPAPI_CALL
+      SHPDestroyObject( SHPObject * psObject );
+void SHPAPI_CALL
+      SHPComputeExtents( SHPObject * psObject );
+SHPObject SHPAPI_CALL1(*)
+      SHPCreateObject( int nSHPType, int nShapeId,
+                       int nParts, int * panPartStart, int * panPartType,
+                       int nVertices, double * padfX, double * padfY,
+                       double * padfZ, double * padfM );
+SHPObject SHPAPI_CALL1(*)
+      SHPCreateSimpleObject( int nSHPType, int nVertices,
+                             double * padfX, double * padfY, double * padfZ );
+
+int SHPAPI_CALL
+      SHPRewindObject( SHPHandle hSHP, SHPObject * psObject );
+
+void SHPAPI_CALL
+      SHPClose( SHPHandle hSHP );
+
+const char SHPAPI_CALL1(*)
+      SHPTypeName( int nSHPType );
+const char SHPAPI_CALL1(*)
+      SHPPartTypeName( int nPartType );
+
+/* -------------------------------------------------------------------- */
+/*      Shape quadtree indexing API.                                    */
+/* -------------------------------------------------------------------- */
+
+/* this can be two or four for binary or quad tree */
+#define MAX_SUBNODE	4
+
+typedef struct shape_tree_node
+{
+    /* region covered by this node */
+    double	adfBoundsMin[4];
+    double	adfBoundsMax[4];
+
+    /* list of shapes stored at this node.  The papsShapeObj pointers
+       or the whole list can be NULL */
+    int		nShapeCount;
+    int		*panShapeIds;
+    SHPObject   **papsShapeObj;
+
+    int		nSubNodes;
+    struct shape_tree_node *apsSubNode[MAX_SUBNODE];
+    
+} SHPTreeNode;
+
+typedef struct
+{
+    SHPHandle   hSHP;
+    
+    int		nMaxDepth;
+    int		nDimension;
+    
+    SHPTreeNode	*psRoot;
+} SHPTree;
+
+SHPTree SHPAPI_CALL1(*)
+      SHPCreateTree( SHPHandle hSHP, int nDimension, int nMaxDepth,
+                     double *padfBoundsMin, double *padfBoundsMax );
+void    SHPAPI_CALL
+      SHPDestroyTree( SHPTree * hTree );
+
+int	SHPAPI_CALL
+      SHPWriteTree( SHPTree *hTree, const char * pszFilename );
+SHPTree SHPAPI_CALL
+      SHPReadTree( const char * pszFilename );
+
+int	SHPAPI_CALL
+      SHPTreeAddObject( SHPTree * hTree, SHPObject * psObject );
+int	SHPAPI_CALL
+      SHPTreeAddShapeId( SHPTree * hTree, SHPObject * psObject );
+int	SHPAPI_CALL
+      SHPTreeRemoveShapeId( SHPTree * hTree, int nShapeId );
+
+void 	SHPAPI_CALL
+      SHPTreeTrimExtraNodes( SHPTree * hTree );
+
+int    SHPAPI_CALL1(*)
+      SHPTreeFindLikelyShapes( SHPTree * hTree,
+                               double * padfBoundsMin,
+                               double * padfBoundsMax,
+                               int * );
+int     SHPAPI_CALL
+      SHPCheckBoundsOverlap( double *, double *, double *, double *, int );
+
+/************************************************************************/
+/*                             DBF Support.                             */
+/************************************************************************/
+typedef	struct
+{
+    FILE	*fp;
+
+    int         nRecords;
+
+    int		nRecordLength;
+    int		nHeaderLength;
+    int		nFields;
+    int		*panFieldOffset;
+    int		*panFieldSize;
+    int		*panFieldDecimals;
+    char	*pachFieldType;
+
+    char	*pszHeader;
+
+    int		nCurrentRecord;
+    int		bCurrentRecordModified;
+    char	*pszCurrentRecord;
+    
+    int		bNoHeader;
+    int		bUpdated;
+} DBFInfo;
+
+typedef DBFInfo * DBFHandle;
+
+typedef enum {
+  FTString,
+  FTInteger,
+  FTDouble,
+  FTLogical,
+  FTInvalid,
+  FTDate,
+} DBFFieldType;
+
+#define XBASE_FLDHDR_SZ       32
+
+DBFHandle SHPAPI_CALL
+      DBFOpen( const char * pszDBFFile, const char * pszAccess );
+DBFHandle SHPAPI_CALL
+      DBFCreate( const char * pszDBFFile );
+
+int	SHPAPI_CALL
+      DBFGetFieldCount( DBFHandle psDBF );
+int	SHPAPI_CALL
+      DBFGetRecordCount( DBFHandle psDBF );
+int	SHPAPI_CALL
+      DBFAddField( DBFHandle hDBF, const char * pszFieldName,
+                   DBFFieldType eType, int nWidth, int nDecimals );
+
+DBFFieldType SHPAPI_CALL
+      DBFGetFieldInfo( DBFHandle psDBF, int iField, 
+                       char * pszFieldName, int * pnWidth, int * pnDecimals );
+
+int SHPAPI_CALL
+      DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName);
+
+int 	SHPAPI_CALL
+      DBFReadIntegerAttribute( DBFHandle hDBF, int iShape, int iField );
+double 	SHPAPI_CALL
+      DBFReadDoubleAttribute( DBFHandle hDBF, int iShape, int iField );
+const char SHPAPI_CALL1(*)
+      DBFReadStringAttribute( DBFHandle hDBF, int iShape, int iField );
+const char SHPAPI_CALL1(*)
+      DBFReadDatettribute( DBFHandle hDBF, int iShape, int iField );
+const char SHPAPI_CALL1(*)
+      DBFReadLogicalAttribute( DBFHandle hDBF, int iShape, int iField );
+int     SHPAPI_CALL
+      DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField );
+
+int SHPAPI_CALL
+      DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField, 
+                                int nFieldValue );
+int SHPAPI_CALL
+      DBFWriteDoubleAttribute( DBFHandle hDBF, int iShape, int iField,
+                               double dFieldValue );
+int SHPAPI_CALL
+      DBFWriteStringAttribute( DBFHandle hDBF, int iShape, int iField,
+                               const char * pszFieldValue );
+int SHPAPI_CALL
+      DBFWriteDateAttribute( DBFHandle hDBF, int iShape, int iField,
+                               const char * pszFieldValue );
+int SHPAPI_CALL
+     DBFWriteNULLAttribute( DBFHandle hDBF, int iShape, int iField );
+
+int SHPAPI_CALL
+     DBFWriteLogicalAttribute( DBFHandle hDBF, int iShape, int iField,
+			       const char lFieldValue);
+int SHPAPI_CALL
+     DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField,
+                               void * pValue );
+const char SHPAPI_CALL1(*)
+      DBFReadTuple(DBFHandle psDBF, int hEntity );
+int SHPAPI_CALL
+      DBFWriteTuple(DBFHandle psDBF, int hEntity, void * pRawTuple );
+
+DBFHandle SHPAPI_CALL
+      DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename );
+ 
+void	SHPAPI_CALL
+      DBFClose( DBFHandle hDBF );
+char    SHPAPI_CALL
+      DBFGetNativeFieldType( DBFHandle hDBF, int iField );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ndef _SHAPEFILE_H_INCLUDED */
diff --git a/src/shapelib/shpopen.c b/src/shapelib/shpopen.c
new file mode 100644
index 0000000..3373cf5
--- /dev/null
+++ b/src/shapelib/shpopen.c
@@ -0,0 +1,1869 @@
+/******************************************************************************
+ * $Id: shpopen.c 2248 2004-11-01 14:54:44Z juan $
+ *
+ * Project:  Shapelib
+ * Purpose:  Implementation of core Shapefile read/write functions.
+ * Author:   Frank Warmerdam, warmerdam at pobox.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, 2001, Frank Warmerdam
+ *
+ * This software is available under the following "MIT Style" license,
+ * or at the option of the licensee under the LGPL (see LICENSE.LGPL).  This
+ * option is discussed in more detail in shapelib.html.
+ *
+ * --
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log$
+ * Revision 1.3  2004/02/20 14:10:42  lubia
+ * Migrando para ultima versao da shapelib: 1.2.10
+ *
+ * Revision 1.39  2002/08/26 06:46:56  warmerda
+ * avoid c++ comments
+ *
+ * Revision 1.38  2002/05/07 16:43:39  warmerda
+ * Removed debugging printf.
+ *
+ * Revision 1.37  2002/04/10 17:35:22  warmerda
+ * fixed bug in ring reversal code
+ *
+ * Revision 1.36  2002/04/10 16:59:54  warmerda
+ * added SHPRewindObject
+ *
+ * Revision 1.35  2001/12/07 15:10:44  warmerda
+ * fix if .shx fails to open
+ *
+ * Revision 1.34  2001/11/01 16:29:55  warmerda
+ * move pabyRec into SHPInfo for thread safety
+ *
+ * Revision 1.33  2001/07/03 12:18:15  warmerda
+ * Improved cleanup if SHX not found, provied by Riccardo Cohen.
+ *
+ * Revision 1.32  2001/06/22 01:58:07  warmerda
+ * be more careful about establishing initial bounds in face of NULL shapes
+ *
+ * Revision 1.31  2001/05/31 19:35:29  warmerda
+ * added support for writing null shapes
+ *
+ * Revision 1.30  2001/05/28 12:46:29  warmerda
+ * Add some checking on reasonableness of record count when opening.
+ *
+ * Revision 1.29  2001/05/23 13:36:52  warmerda
+ * added use of SHPAPI_CALL
+ *
+ * Revision 1.28  2001/02/06 22:25:06  warmerda
+ * fixed memory leaks when SHPOpen() fails
+ *
+ * Revision 1.27  2000/07/18 15:21:33  warmerda
+ * added better enforcement of -1 for append in SHPWriteObject
+ *
+ * Revision 1.26  2000/02/16 16:03:51  warmerda
+ * added null shape support
+ *
+ * Revision 1.25  1999/12/15 13:47:07  warmerda
+ * Fixed record size settings in .shp file (was 4 words too long)
+ * Added stdlib.h.
+ *
+ * Revision 1.24  1999/11/05 14:12:04  warmerda
+ * updated license terms
+ *
+ * Revision 1.23  1999/07/27 00:53:46  warmerda
+ * added support for rewriting shapes
+ *
+ * Revision 1.22  1999/06/11 19:19:11  warmerda
+ * Cleanup pabyRec static buffer on SHPClose().
+ *
+ * Revision 1.21  1999/06/02 14:57:56  kshih
+ * Remove unused variables
+ *
+ * Revision 1.20  1999/04/19 21:04:17  warmerda
+ * Fixed syntax error.
+ *
+ * Revision 1.19  1999/04/19 21:01:57  warmerda
+ * Force access string to binary in SHPOpen().
+ *
+ * Revision 1.18  1999/04/01 18:48:07  warmerda
+ * Try upper case extensions if lower case doesn't work.
+ *
+ * Revision 1.17  1998/12/31 15:29:39  warmerda
+ * Disable writing measure values to multipatch objects if
+ * DISABLE_MULTIPATCH_MEASURE is defined.
+ *
+ * Revision 1.16  1998/12/16 05:14:33  warmerda
+ * Added support to write MULTIPATCH.  Fixed reading Z coordinate of
+ * MULTIPATCH. Fixed record size written for all feature types.
+ *
+ * Revision 1.15  1998/12/03 16:35:29  warmerda
+ * r+b is proper binary access string, not rb+.
+ *
+ * Revision 1.14  1998/12/03 15:47:56  warmerda
+ * Fixed setting of nVertices in SHPCreateObject().
+ *
+ * Revision 1.13  1998/12/03 15:33:54  warmerda
+ * Made SHPCalculateExtents() separately callable.
+ *
+ * Revision 1.12  1998/11/11 20:01:50  warmerda
+ * Fixed bug writing ArcM/Z, and PolygonM/Z for big endian machines.
+ *
+ * Revision 1.11  1998/11/09 20:56:44  warmerda
+ * Fixed up handling of file wide bounds.
+ *
+ * Revision 1.10  1998/11/09 20:18:51  warmerda
+ * Converted to support 3D shapefiles, and use of SHPObject.
+ *
+ * Revision 1.9  1998/02/24 15:09:05  warmerda
+ * Fixed memory leak.
+ *
+ * Revision 1.8  1997/12/04 15:40:29  warmerda
+ * Fixed byte swapping of record number, and record length fields in the
+ * .shp file.
+ *
+ * Revision 1.7  1995/10/21 03:15:58  warmerda
+ * Added support for binary file access, the magic cookie 9997
+ * and tried to improve the int32 selection logic for 16bit systems.
+ *
+ * Revision 1.6  1995/09/04  04:19:41  warmerda
+ * Added fix for file bounds.
+ *
+ * Revision 1.5  1995/08/25  15:16:44  warmerda
+ * Fixed a couple of problems with big endian systems ... one with bounds
+ * and the other with multipart polygons.
+ *
+ * Revision 1.4  1995/08/24  18:10:17  warmerda
+ * Switch to use SfRealloc() to avoid problems with pre-ANSI realloc()
+ * functions (such as on the Sun).
+ *
+ * Revision 1.3  1995/08/23  02:23:15  warmerda
+ * Added support for reading bounds, and fixed up problems in setting the
+ * file wide bounds.
+ *
+ * Revision 1.2  1995/08/04  03:16:57  warmerda
+ * Added header.
+ *
+ */
+
+/* static char rcsid[] = 
+  "$Id: shpopen.c 2248 2004-11-01 14:54:44Z juan $"; */
+
+#include "shapefil.h"
+
+#include <math.h>
+#include <limits.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+
+typedef unsigned char uchar;
+
+#if UINT_MAX == 65535
+typedef long	      int32;
+#else
+typedef int	      int32;
+#endif
+
+#ifndef FALSE
+#  define FALSE		0
+#  define TRUE		1
+#endif
+
+#define ByteCopy( a, b, c )	memcpy( b, a, c )
+#ifndef MAX
+#  define MIN(a,b)      ((a<b) ? a : b)
+#  define MAX(a,b)      ((a>b) ? a : b)
+#endif
+
+static int 	bBigEndian;
+
+
+/************************************************************************/
+/*                              SwapWord()                              */
+/*                                                                      */
+/*      Swap a 2, 4 or 8 byte word.                                     */
+/************************************************************************/
+
+static void	SwapWord( int length, void * wordP )
+
+{
+    int		i;
+    uchar	temp;
+
+    for( i=0; i < length/2; i++ )
+    {
+	temp = ((uchar *) wordP)[i];
+	((uchar *)wordP)[i] = ((uchar *) wordP)[length-i-1];
+	((uchar *) wordP)[length-i-1] = temp;
+    }
+}
+
+/************************************************************************/
+/*                             SfRealloc()                              */
+/*                                                                      */
+/*      A realloc cover function that will access a NULL pointer as     */
+/*      a valid input.                                                  */
+/************************************************************************/
+
+static void * SfRealloc( void * pMem, int nNewSize )
+
+{
+    if( pMem == NULL )
+        return( (void *) malloc(nNewSize) );
+    else
+        return( (void *) realloc(pMem,nNewSize) );
+}
+
+/************************************************************************/
+/*                          SHPWriteHeader()                            */
+/*                                                                      */
+/*      Write out a header for the .shp and .shx files as well as the	*/
+/*	contents of the index (.shx) file.				*/
+/************************************************************************/
+
+static void SHPWriteHeader( SHPHandle psSHP )
+
+{
+    uchar     	abyHeader[100];
+    int		i;
+    int32	i32;
+    double	dValue;
+    int32	*panSHX;
+
+/* -------------------------------------------------------------------- */
+/*      Prepare header block for .shp file.                             */
+/* -------------------------------------------------------------------- */
+    for( i = 0; i < 100; i++ )
+      abyHeader[i] = 0;
+
+    abyHeader[2] = 0x27;				/* magic cookie */
+    abyHeader[3] = 0x0a;
+
+    i32 = psSHP->nFileSize/2;				/* file size */
+    ByteCopy( &i32, abyHeader+24, 4 );
+    if( !bBigEndian ) SwapWord( 4, abyHeader+24 );
+    
+    i32 = 1000;						/* version */
+    ByteCopy( &i32, abyHeader+28, 4 );
+    if( bBigEndian ) SwapWord( 4, abyHeader+28 );
+    
+    i32 = psSHP->nShapeType;				/* shape type */
+    ByteCopy( &i32, abyHeader+32, 4 );
+    if( bBigEndian ) SwapWord( 4, abyHeader+32 );
+
+    dValue = psSHP->adBoundsMin[0];			/* set bounds */
+    ByteCopy( &dValue, abyHeader+36, 8 );
+    if( bBigEndian ) SwapWord( 8, abyHeader+36 );
+
+    dValue = psSHP->adBoundsMin[1];
+    ByteCopy( &dValue, abyHeader+44, 8 );
+    if( bBigEndian ) SwapWord( 8, abyHeader+44 );
+
+    dValue = psSHP->adBoundsMax[0];
+    ByteCopy( &dValue, abyHeader+52, 8 );
+    if( bBigEndian ) SwapWord( 8, abyHeader+52 );
+
+    dValue = psSHP->adBoundsMax[1];
+    ByteCopy( &dValue, abyHeader+60, 8 );
+    if( bBigEndian ) SwapWord( 8, abyHeader+60 );
+
+    dValue = psSHP->adBoundsMin[2];			/* z */
+    ByteCopy( &dValue, abyHeader+68, 8 );
+    if( bBigEndian ) SwapWord( 8, abyHeader+68 );
+
+    dValue = psSHP->adBoundsMax[2];
+    ByteCopy( &dValue, abyHeader+76, 8 );
+    if( bBigEndian ) SwapWord( 8, abyHeader+76 );
+
+    dValue = psSHP->adBoundsMin[3];			/* m */
+    ByteCopy( &dValue, abyHeader+84, 8 );
+    if( bBigEndian ) SwapWord( 8, abyHeader+84 );
+
+    dValue = psSHP->adBoundsMax[3];
+    ByteCopy( &dValue, abyHeader+92, 8 );
+    if( bBigEndian ) SwapWord( 8, abyHeader+92 );
+
+/* -------------------------------------------------------------------- */
+/*      Write .shp file header.                                         */
+/* -------------------------------------------------------------------- */
+    fseek( psSHP->fpSHP, 0, 0 );
+    fwrite( abyHeader, 100, 1, psSHP->fpSHP );
+
+/* -------------------------------------------------------------------- */
+/*      Prepare, and write .shx file header.                            */
+/* -------------------------------------------------------------------- */
+    i32 = (psSHP->nRecords * 2 * sizeof(int32) + 100)/2;   /* file size */
+    ByteCopy( &i32, abyHeader+24, 4 );
+    if( !bBigEndian ) SwapWord( 4, abyHeader+24 );
+    
+    fseek( psSHP->fpSHX, 0, 0 );
+    fwrite( abyHeader, 100, 1, psSHP->fpSHX );
+
+/* -------------------------------------------------------------------- */
+/*      Write out the .shx contents.                                    */
+/* -------------------------------------------------------------------- */
+    panSHX = (int32 *) malloc(sizeof(int32) * 2 * psSHP->nRecords);
+
+    for( i = 0; i < psSHP->nRecords; i++ )
+    {
+	panSHX[i*2  ] = psSHP->panRecOffset[i]/2;
+	panSHX[i*2+1] = psSHP->panRecSize[i]/2;
+	if( !bBigEndian ) SwapWord( 4, panSHX+i*2 );
+	if( !bBigEndian ) SwapWord( 4, panSHX+i*2+1 );
+    }
+
+    fwrite( panSHX, sizeof(int32) * 2, psSHP->nRecords, psSHP->fpSHX );
+
+    free( panSHX );
+}
+
+/************************************************************************/
+/*                              SHPOpen()                               */
+/*                                                                      */
+/*      Open the .shp and .shx files based on the basename of the       */
+/*      files or either file name.                                      */
+/************************************************************************/
+   
+SHPHandle SHPAPI_CALL
+SHPOpen( const char * pszLayer, const char * pszAccess )
+
+{
+    char		*pszFullname, *pszBasename;
+    SHPHandle		psSHP;
+    
+    uchar		*pabyBuf;
+    int			i;
+    double		dValue;
+    
+/* -------------------------------------------------------------------- */
+/*      Ensure the access string is one of the legal ones.  We          */
+/*      ensure the result string indicates binary to avoid common       */
+/*      problems on Windows.                                            */
+/* -------------------------------------------------------------------- */
+    if( strcmp(pszAccess,"rb+") == 0 || strcmp(pszAccess,"r+b") == 0
+        || strcmp(pszAccess,"r+") == 0 )
+        pszAccess = "r+b";
+    else
+        pszAccess = "rb";
+    
+/* -------------------------------------------------------------------- */
+/*	Establish the byte order on this machine.			*/
+/* -------------------------------------------------------------------- */
+    i = 1;
+    if( *((uchar *) &i) == 1 )
+        bBigEndian = FALSE;
+    else
+        bBigEndian = TRUE;
+
+/* -------------------------------------------------------------------- */
+/*	Initialize the info structure.					*/
+/* -------------------------------------------------------------------- */
+    psSHP = (SHPHandle) calloc(sizeof(SHPInfo),1);
+
+    psSHP->bUpdated = FALSE;
+
+/* -------------------------------------------------------------------- */
+/*	Compute the base (layer) name.  If there is any extension	*/
+/*	on the passed in filename we will strip it off.			*/
+/* -------------------------------------------------------------------- */
+    pszBasename = (char *) malloc(strlen(pszLayer)+5);
+    strcpy( pszBasename, pszLayer );
+    for( i = strlen(pszBasename)-1; 
+	 i > 0 && pszBasename[i] != '.' && pszBasename[i] != '/'
+	       && pszBasename[i] != '\\';
+	 i-- ) {}
+
+    if( pszBasename[i] == '.' )
+        pszBasename[i] = '\0';
+
+/* -------------------------------------------------------------------- */
+/*	Open the .shp and .shx files.  Note that files pulled from	*/
+/*	a PC to Unix with upper case filenames won't work!		*/
+/* -------------------------------------------------------------------- */
+    pszFullname = (char *) malloc(strlen(pszBasename) + 5);
+    sprintf( pszFullname, "%s.shp", pszBasename );
+    psSHP->fpSHP = fopen(pszFullname, pszAccess );
+    if( psSHP->fpSHP == NULL )
+    {
+        sprintf( pszFullname, "%s.SHP", pszBasename );
+        psSHP->fpSHP = fopen(pszFullname, pszAccess );
+    }
+    
+    if( psSHP->fpSHP == NULL )
+    {
+        free( psSHP );
+        free( pszBasename );
+        free( pszFullname );
+        return( NULL );
+    }
+
+    sprintf( pszFullname, "%s.shx", pszBasename );
+    psSHP->fpSHX = fopen(pszFullname, pszAccess );
+    if( psSHP->fpSHX == NULL )
+    {
+        sprintf( pszFullname, "%s.SHX", pszBasename );
+        psSHP->fpSHX = fopen(pszFullname, pszAccess );
+    }
+    
+    if( psSHP->fpSHX == NULL )
+    {
+        fclose( psSHP->fpSHP );
+        free( psSHP );
+        free( pszBasename );
+        free( pszFullname );
+        return( NULL );
+    }
+
+    free( pszFullname );
+    free( pszBasename );
+
+/* -------------------------------------------------------------------- */
+/*  Read the file size from the SHP file.				*/
+/* -------------------------------------------------------------------- */
+    pabyBuf = (uchar *) malloc(100);
+    fread( pabyBuf, 100, 1, psSHP->fpSHP );
+
+    psSHP->nFileSize = (pabyBuf[24] * 256 * 256 * 256
+			+ pabyBuf[25] * 256 * 256
+			+ pabyBuf[26] * 256
+			+ pabyBuf[27]) * 2;
+
+/* -------------------------------------------------------------------- */
+/*  Read SHX file Header info                                           */
+/* -------------------------------------------------------------------- */
+    fread( pabyBuf, 100, 1, psSHP->fpSHX );
+
+    if( pabyBuf[0] != 0 
+        || pabyBuf[1] != 0 
+        || pabyBuf[2] != 0x27 
+        || (pabyBuf[3] != 0x0a && pabyBuf[3] != 0x0d) )
+    {
+	fclose( psSHP->fpSHP );
+	fclose( psSHP->fpSHX );
+	free( psSHP );
+
+	return( NULL );
+    }
+
+    psSHP->nRecords = pabyBuf[27] + pabyBuf[26] * 256
+      + pabyBuf[25] * 256 * 256 + pabyBuf[24] * 256 * 256 * 256;
+    psSHP->nRecords = (psSHP->nRecords*2 - 100) / 8;
+
+    psSHP->nShapeType = pabyBuf[32];
+
+    if( psSHP->nRecords < 0 || psSHP->nRecords > 256000000 )
+    {
+        /* this header appears to be corrupt.  Give up. */
+	fclose( psSHP->fpSHP );
+	fclose( psSHP->fpSHX );
+	free( psSHP );
+
+	return( NULL );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Read the bounds.                                                */
+/* -------------------------------------------------------------------- */
+    if( bBigEndian ) SwapWord( 8, pabyBuf+36 );
+    memcpy( &dValue, pabyBuf+36, 8 );
+    psSHP->adBoundsMin[0] = dValue;
+
+    if( bBigEndian ) SwapWord( 8, pabyBuf+44 );
+    memcpy( &dValue, pabyBuf+44, 8 );
+    psSHP->adBoundsMin[1] = dValue;
+
+    if( bBigEndian ) SwapWord( 8, pabyBuf+52 );
+    memcpy( &dValue, pabyBuf+52, 8 );
+    psSHP->adBoundsMax[0] = dValue;
+
+    if( bBigEndian ) SwapWord( 8, pabyBuf+60 );
+    memcpy( &dValue, pabyBuf+60, 8 );
+    psSHP->adBoundsMax[1] = dValue;
+
+    if( bBigEndian ) SwapWord( 8, pabyBuf+68 );		/* z */
+    memcpy( &dValue, pabyBuf+68, 8 );
+    psSHP->adBoundsMin[2] = dValue;
+    
+    if( bBigEndian ) SwapWord( 8, pabyBuf+76 );
+    memcpy( &dValue, pabyBuf+76, 8 );
+    psSHP->adBoundsMax[2] = dValue;
+    
+    if( bBigEndian ) SwapWord( 8, pabyBuf+84 );		/* z */
+    memcpy( &dValue, pabyBuf+84, 8 );
+    psSHP->adBoundsMin[3] = dValue;
+
+    if( bBigEndian ) SwapWord( 8, pabyBuf+92 );
+    memcpy( &dValue, pabyBuf+92, 8 );
+    psSHP->adBoundsMax[3] = dValue;
+
+    free( pabyBuf );
+
+/* -------------------------------------------------------------------- */
+/*	Read the .shx file to get the offsets to each record in 	*/
+/*	the .shp file.							*/
+/* -------------------------------------------------------------------- */
+    psSHP->nMaxRecords = psSHP->nRecords;
+
+    psSHP->panRecOffset =
+        (int *) malloc(sizeof(int) * MAX(1,psSHP->nMaxRecords) );
+    psSHP->panRecSize =
+        (int *) malloc(sizeof(int) * MAX(1,psSHP->nMaxRecords) );
+
+    pabyBuf = (uchar *) malloc(8 * MAX(1,psSHP->nRecords) );
+    fread( pabyBuf, 8, psSHP->nRecords, psSHP->fpSHX );
+
+    for( i = 0; i < psSHP->nRecords; i++ )
+    {
+	int32		nOffset, nLength;
+
+	memcpy( &nOffset, pabyBuf + i * 8, 4 );
+	if( !bBigEndian ) SwapWord( 4, &nOffset );
+
+	memcpy( &nLength, pabyBuf + i * 8 + 4, 4 );
+	if( !bBigEndian ) SwapWord( 4, &nLength );
+
+	psSHP->panRecOffset[i] = nOffset*2;
+	psSHP->panRecSize[i] = nLength*2;
+    }
+    free( pabyBuf );
+
+    return( psSHP );
+}
+
+/************************************************************************/
+/*                              SHPClose()                              */
+/*								       	*/
+/*	Close the .shp and .shx files.					*/
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPClose(SHPHandle psSHP )
+
+{
+/* -------------------------------------------------------------------- */
+/*	Update the header if we have modified anything.			*/
+/* -------------------------------------------------------------------- */
+    if( psSHP->bUpdated )
+    {
+	SHPWriteHeader( psSHP );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Free all resources, and close files.                            */
+/* -------------------------------------------------------------------- */
+    free( psSHP->panRecOffset );
+    free( psSHP->panRecSize );
+
+    fclose( psSHP->fpSHX );
+    fclose( psSHP->fpSHP );
+
+    if( psSHP->pabyRec != NULL )
+    {
+        free( psSHP->pabyRec );
+    }
+    
+    free( psSHP );
+}
+
+/************************************************************************/
+/*                             SHPGetInfo()                             */
+/*                                                                      */
+/*      Fetch general information about the shape file.                 */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPGetInfo(SHPHandle psSHP, int * pnEntities, int * pnShapeType,
+           double * padfMinBound, double * padfMaxBound )
+
+{
+    int		i;
+    
+    if( pnEntities != NULL )
+        *pnEntities = psSHP->nRecords;
+
+    if( pnShapeType != NULL )
+        *pnShapeType = psSHP->nShapeType;
+
+    for( i = 0; i < 4; i++ )
+    {
+        if( padfMinBound != NULL )
+            padfMinBound[i] = psSHP->adBoundsMin[i];
+        if( padfMaxBound != NULL )
+            padfMaxBound[i] = psSHP->adBoundsMax[i];
+    }
+}
+
+/************************************************************************/
+/*                             SHPCreate()                              */
+/*                                                                      */
+/*      Create a new shape file and return a handle to the open         */
+/*      shape file with read/write access.                              */
+/************************************************************************/
+
+SHPHandle SHPAPI_CALL
+SHPCreate( const char * pszLayer, int nShapeType )
+
+{
+    char	*pszBasename, *pszFullname;
+    int		i;
+    FILE	*fpSHP, *fpSHX;
+    uchar     	abyHeader[100];
+    int32	i32;
+    double	dValue;
+    
+/* -------------------------------------------------------------------- */
+/*      Establish the byte order on this system.                        */
+/* -------------------------------------------------------------------- */
+    i = 1;
+    if( *((uchar *) &i) == 1 )
+        bBigEndian = FALSE;
+    else
+        bBigEndian = TRUE;
+
+/* -------------------------------------------------------------------- */
+/*	Compute the base (layer) name.  If there is any extension	*/
+/*	on the passed in filename we will strip it off.			*/
+/* -------------------------------------------------------------------- */
+    pszBasename = (char *) malloc(strlen(pszLayer)+5);
+    strcpy( pszBasename, pszLayer );
+    for( i = strlen(pszBasename)-1; 
+	 i > 0 && pszBasename[i] != '.' && pszBasename[i] != '/'
+	       && pszBasename[i] != '\\';
+	 i-- ) {}
+
+    if( pszBasename[i] == '.' )
+        pszBasename[i] = '\0';
+
+/* -------------------------------------------------------------------- */
+/*      Open the two files so we can write their headers.               */
+/* -------------------------------------------------------------------- */
+    pszFullname = (char *) malloc(strlen(pszBasename) + 5);
+    sprintf( pszFullname, "%s.shp", pszBasename );
+    fpSHP = fopen(pszFullname, "wb" );
+    if( fpSHP == NULL )
+        return( NULL );
+
+    sprintf( pszFullname, "%s.shx", pszBasename );
+    fpSHX = fopen(pszFullname, "wb" );
+    if( fpSHX == NULL )
+        return( NULL );
+
+    free( pszFullname );
+    free( pszBasename );
+
+/* -------------------------------------------------------------------- */
+/*      Prepare header block for .shp file.                             */
+/* -------------------------------------------------------------------- */
+    for( i = 0; i < 100; i++ )
+      abyHeader[i] = 0;
+
+    abyHeader[2] = 0x27;				/* magic cookie */
+    abyHeader[3] = 0x0a;
+
+    i32 = 50;						/* file size */
+    ByteCopy( &i32, abyHeader+24, 4 );
+    if( !bBigEndian ) SwapWord( 4, abyHeader+24 );
+    
+    i32 = 1000;						/* version */
+    ByteCopy( &i32, abyHeader+28, 4 );
+    if( bBigEndian ) SwapWord( 4, abyHeader+28 );
+    
+    i32 = nShapeType;					/* shape type */
+    ByteCopy( &i32, abyHeader+32, 4 );
+    if( bBigEndian ) SwapWord( 4, abyHeader+32 );
+
+    dValue = 0.0;					/* set bounds */
+    ByteCopy( &dValue, abyHeader+36, 8 );
+    ByteCopy( &dValue, abyHeader+44, 8 );
+    ByteCopy( &dValue, abyHeader+52, 8 );
+    ByteCopy( &dValue, abyHeader+60, 8 );
+
+/* -------------------------------------------------------------------- */
+/*      Write .shp file header.                                         */
+/* -------------------------------------------------------------------- */
+    fwrite( abyHeader, 100, 1, fpSHP );
+
+/* -------------------------------------------------------------------- */
+/*      Prepare, and write .shx file header.                            */
+/* -------------------------------------------------------------------- */
+    i32 = 50;						/* file size */
+    ByteCopy( &i32, abyHeader+24, 4 );
+    if( !bBigEndian ) SwapWord( 4, abyHeader+24 );
+    
+    fwrite( abyHeader, 100, 1, fpSHX );
+
+/* -------------------------------------------------------------------- */
+/*      Close the files, and then open them as regular existing files.  */
+/* -------------------------------------------------------------------- */
+    fclose( fpSHP );
+    fclose( fpSHX );
+
+    return( SHPOpen( pszLayer, "r+b" ) );
+}
+
+/************************************************************************/
+/*                           _SHPSetBounds()                            */
+/*                                                                      */
+/*      Compute a bounds rectangle for a shape, and set it into the     */
+/*      indicated location in the record.                               */
+/************************************************************************/
+
+static void	_SHPSetBounds( uchar * pabyRec, SHPObject * psShape )
+
+{
+    ByteCopy( &(psShape->dfXMin), pabyRec +  0, 8 );
+    ByteCopy( &(psShape->dfYMin), pabyRec +  8, 8 );
+    ByteCopy( &(psShape->dfXMax), pabyRec + 16, 8 );
+    ByteCopy( &(psShape->dfYMax), pabyRec + 24, 8 );
+
+    if( bBigEndian )
+    {
+        SwapWord( 8, pabyRec + 0 );
+        SwapWord( 8, pabyRec + 8 );
+        SwapWord( 8, pabyRec + 16 );
+        SwapWord( 8, pabyRec + 24 );
+    }
+}
+
+/************************************************************************/
+/*                         SHPComputeExtents()                          */
+/*                                                                      */
+/*      Recompute the extents of a shape.  Automatically done by        */
+/*      SHPCreateObject().                                              */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPComputeExtents( SHPObject * psObject )
+
+{
+    int		i;
+    
+/* -------------------------------------------------------------------- */
+/*      Build extents for this object.                                  */
+/* -------------------------------------------------------------------- */
+    if( psObject->nVertices > 0 )
+    {
+        psObject->dfXMin = psObject->dfXMax = psObject->padfX[0];
+        psObject->dfYMin = psObject->dfYMax = psObject->padfY[0];
+        psObject->dfZMin = psObject->dfZMax = psObject->padfZ[0];
+        psObject->dfMMin = psObject->dfMMax = psObject->padfM[0];
+    }
+    
+    for( i = 0; i < psObject->nVertices; i++ )
+    {
+        psObject->dfXMin = MIN(psObject->dfXMin, psObject->padfX[i]);
+        psObject->dfYMin = MIN(psObject->dfYMin, psObject->padfY[i]);
+        psObject->dfZMin = MIN(psObject->dfZMin, psObject->padfZ[i]);
+        psObject->dfMMin = MIN(psObject->dfMMin, psObject->padfM[i]);
+
+        psObject->dfXMax = MAX(psObject->dfXMax, psObject->padfX[i]);
+        psObject->dfYMax = MAX(psObject->dfYMax, psObject->padfY[i]);
+        psObject->dfZMax = MAX(psObject->dfZMax, psObject->padfZ[i]);
+        psObject->dfMMax = MAX(psObject->dfMMax, psObject->padfM[i]);
+    }
+}
+
+/************************************************************************/
+/*                          SHPCreateObject()                           */
+/*                                                                      */
+/*      Create a shape object.  It should be freed with                 */
+/*      SHPDestroyObject().                                             */
+/************************************************************************/
+
+SHPObject SHPAPI_CALL1(*)
+SHPCreateObject( int nSHPType, int nShapeId, int nParts,
+                 int * panPartStart, int * panPartType,
+                 int nVertices, double * padfX, double * padfY,
+                 double * padfZ, double * padfM )
+
+{
+    SHPObject	*psObject;
+    int		i, bHasM, bHasZ;
+
+    psObject = (SHPObject *) calloc(1,sizeof(SHPObject));
+    psObject->nSHPType = nSHPType;
+    psObject->nShapeId = nShapeId;
+
+/* -------------------------------------------------------------------- */
+/*	Establish whether this shape type has M, and Z values.		*/
+/* -------------------------------------------------------------------- */
+    if( nSHPType == SHPT_ARCM
+        || nSHPType == SHPT_POINTM
+        || nSHPType == SHPT_POLYGONM
+        || nSHPType == SHPT_MULTIPOINTM )
+    {
+        bHasM = TRUE;
+        bHasZ = FALSE;
+    }
+    else if( nSHPType == SHPT_ARCZ
+             || nSHPType == SHPT_POINTZ
+             || nSHPType == SHPT_POLYGONZ
+             || nSHPType == SHPT_MULTIPOINTZ
+             || nSHPType == SHPT_MULTIPATCH )
+    {
+        bHasM = TRUE;
+        bHasZ = TRUE;
+    }
+    else
+    {
+        bHasM = FALSE;
+        bHasZ = FALSE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Capture parts.  Note that part type is optional, and            */
+/*      defaults to ring.                                               */
+/* -------------------------------------------------------------------- */
+    if( nSHPType == SHPT_ARC || nSHPType == SHPT_POLYGON
+        || nSHPType == SHPT_ARCM || nSHPType == SHPT_POLYGONM
+        || nSHPType == SHPT_ARCZ || nSHPType == SHPT_POLYGONZ
+        || nSHPType == SHPT_MULTIPATCH )
+    {
+        psObject->nParts = MAX(1,nParts);
+
+        psObject->panPartStart = (int *)
+            malloc(sizeof(int) * psObject->nParts);
+        psObject->panPartType = (int *)
+            malloc(sizeof(int) * psObject->nParts);
+
+        psObject->panPartStart[0] = 0;
+        psObject->panPartType[0] = SHPP_RING;
+        
+        for( i = 0; i < nParts; i++ )
+        {
+            psObject->panPartStart[i] = panPartStart[i];
+            if( panPartType != NULL )
+                psObject->panPartType[i] = panPartType[i];
+            else
+                psObject->panPartType[i] = SHPP_RING;
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Capture vertices.  Note that Z and M are optional, but X and    */
+/*      Y are not.                                                      */
+/* -------------------------------------------------------------------- */
+    if( nVertices > 0 )
+    {
+        psObject->padfX = (double *) calloc(sizeof(double),nVertices);
+        psObject->padfY = (double *) calloc(sizeof(double),nVertices);
+        psObject->padfZ = (double *) calloc(sizeof(double),nVertices);
+        psObject->padfM = (double *) calloc(sizeof(double),nVertices);
+
+        assert( padfX != NULL );
+        assert( padfY != NULL );
+    
+        for( i = 0; i < nVertices; i++ )
+        {
+            psObject->padfX[i] = padfX[i];
+            psObject->padfY[i] = padfY[i];
+            if( padfZ != NULL && bHasZ )
+                psObject->padfZ[i] = padfZ[i];
+            if( padfM != NULL && bHasM )
+                psObject->padfM[i] = padfM[i];
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Compute the extents.                                            */
+/* -------------------------------------------------------------------- */
+    psObject->nVertices = nVertices;
+    SHPComputeExtents( psObject );
+
+    return( psObject );
+}
+
+/************************************************************************/
+/*                       SHPCreateSimpleObject()                        */
+/*                                                                      */
+/*      Create a simple (common) shape object.  Destroy with            */
+/*      SHPDestroyObject().                                             */
+/************************************************************************/
+
+SHPObject SHPAPI_CALL1(*)
+SHPCreateSimpleObject( int nSHPType, int nVertices,
+                       double * padfX, double * padfY,
+                       double * padfZ )
+
+{
+    return( SHPCreateObject( nSHPType, -1, 0, NULL, NULL,
+                             nVertices, padfX, padfY, padfZ, NULL ) );
+}
+                                  
+/************************************************************************/
+/*                           SHPWriteObject()                           */
+/*                                                                      */
+/*      Write out the vertices of a new structure.  Note that it is     */
+/*      only possible to write vertices at the end of the file.         */
+/************************************************************************/
+
+int SHPAPI_CALL
+SHPWriteObject(SHPHandle psSHP, int nShapeId, SHPObject * psObject )
+		      
+{
+    int	       	nRecordOffset, i, nRecordSize;
+    uchar	*pabyRec;
+    int32	i32;
+
+    psSHP->bUpdated = TRUE;
+
+/* -------------------------------------------------------------------- */
+/*      Ensure that shape object matches the type of the file it is     */
+/*      being written to.                                               */
+/* -------------------------------------------------------------------- */
+    assert( psObject->nSHPType == psSHP->nShapeType 
+            || psObject->nSHPType == SHPT_NULL );
+
+/* -------------------------------------------------------------------- */
+/*      Ensure that -1 is used for appends.  Either blow an             */
+/*      assertion, or if they are disabled, set the shapeid to -1       */
+/*      for appends.                                                    */
+/* -------------------------------------------------------------------- */
+    assert( nShapeId == -1 
+            || (nShapeId >= 0 && nShapeId < psSHP->nRecords) );
+
+    if( nShapeId != -1 && nShapeId >= psSHP->nRecords )
+        nShapeId = -1;
+
+/* -------------------------------------------------------------------- */
+/*      Add the new entity to the in memory index.                      */
+/* -------------------------------------------------------------------- */
+    if( nShapeId == -1 && psSHP->nRecords+1 > psSHP->nMaxRecords )
+    {
+	psSHP->nMaxRecords =(int) ( psSHP->nMaxRecords * 1.3 + 100);
+
+	psSHP->panRecOffset = (int *) 
+            SfRealloc(psSHP->panRecOffset,sizeof(int) * psSHP->nMaxRecords );
+	psSHP->panRecSize = (int *) 
+            SfRealloc(psSHP->panRecSize,sizeof(int) * psSHP->nMaxRecords );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Initialize record.                                              */
+/* -------------------------------------------------------------------- */
+    pabyRec = (uchar *) malloc(psObject->nVertices * 4 * sizeof(double) 
+			       + psObject->nParts * 8 + 128);
+    
+/* -------------------------------------------------------------------- */
+/*  Extract vertices for a Polygon or Arc.				*/
+/* -------------------------------------------------------------------- */
+    if( psObject->nSHPType == SHPT_POLYGON
+        || psObject->nSHPType == SHPT_POLYGONZ
+        || psObject->nSHPType == SHPT_POLYGONM
+        || psObject->nSHPType == SHPT_ARC 
+        || psObject->nSHPType == SHPT_ARCZ
+        || psObject->nSHPType == SHPT_ARCM
+        || psObject->nSHPType == SHPT_MULTIPATCH )
+    {
+	int32		nPoints, nParts;
+	int    		i;
+
+	nPoints = psObject->nVertices;
+	nParts = psObject->nParts;
+
+	_SHPSetBounds( pabyRec + 12, psObject );
+
+	if( bBigEndian ) SwapWord( 4, &nPoints );
+	if( bBigEndian ) SwapWord( 4, &nParts );
+
+	ByteCopy( &nPoints, pabyRec + 40 + 8, 4 );
+	ByteCopy( &nParts, pabyRec + 36 + 8, 4 );
+
+        nRecordSize = 52;
+
+        /*
+         * Write part start positions.
+         */
+	ByteCopy( psObject->panPartStart, pabyRec + 44 + 8,
+                  4 * psObject->nParts );
+	for( i = 0; i < psObject->nParts; i++ )
+	{
+	    if( bBigEndian ) SwapWord( 4, pabyRec + 44 + 8 + 4*i );
+            nRecordSize += 4;
+	}
+
+        /*
+         * Write multipatch part types if needed.
+         */
+        if( psObject->nSHPType == SHPT_MULTIPATCH )
+        {
+            memcpy( pabyRec + nRecordSize, psObject->panPartType,
+                    4*psObject->nParts );
+            for( i = 0; i < psObject->nParts; i++ )
+            {
+                if( bBigEndian ) SwapWord( 4, pabyRec + nRecordSize );
+                nRecordSize += 4;
+            }
+        }
+
+        /*
+         * Write the (x,y) vertex values.
+         */
+	for( i = 0; i < psObject->nVertices; i++ )
+	{
+	    ByteCopy( psObject->padfX + i, pabyRec + nRecordSize, 8 );
+	    ByteCopy( psObject->padfY + i, pabyRec + nRecordSize + 8, 8 );
+
+	    if( bBigEndian )
+                SwapWord( 8, pabyRec + nRecordSize );
+            
+	    if( bBigEndian )
+                SwapWord( 8, pabyRec + nRecordSize + 8 );
+
+            nRecordSize += 2 * 8;
+	}
+
+        /*
+         * Write the Z coordinates (if any).
+         */
+        if( psObject->nSHPType == SHPT_POLYGONZ
+            || psObject->nSHPType == SHPT_ARCZ
+            || psObject->nSHPType == SHPT_MULTIPATCH )
+        {
+            ByteCopy( &(psObject->dfZMin), pabyRec + nRecordSize, 8 );
+            if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+            nRecordSize += 8;
+            
+            ByteCopy( &(psObject->dfZMax), pabyRec + nRecordSize, 8 );
+            if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+            nRecordSize += 8;
+
+            for( i = 0; i < psObject->nVertices; i++ )
+            {
+                ByteCopy( psObject->padfZ + i, pabyRec + nRecordSize, 8 );
+                if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+                nRecordSize += 8;
+            }
+        }
+
+        /*
+         * Write the M values, if any.
+         */
+        if( psObject->nSHPType == SHPT_POLYGONM
+            || psObject->nSHPType == SHPT_ARCM
+#ifndef DISABLE_MULTIPATCH_MEASURE            
+            || psObject->nSHPType == SHPT_MULTIPATCH
+#endif            
+            || psObject->nSHPType == SHPT_POLYGONZ
+            || psObject->nSHPType == SHPT_ARCZ )
+        {
+            ByteCopy( &(psObject->dfMMin), pabyRec + nRecordSize, 8 );
+            if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+            nRecordSize += 8;
+            
+            ByteCopy( &(psObject->dfMMax), pabyRec + nRecordSize, 8 );
+            if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+            nRecordSize += 8;
+
+            for( i = 0; i < psObject->nVertices; i++ )
+            {
+                ByteCopy( psObject->padfM + i, pabyRec + nRecordSize, 8 );
+                if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+                nRecordSize += 8;
+            }
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*  Extract vertices for a MultiPoint.					*/
+/* -------------------------------------------------------------------- */
+    else if( psObject->nSHPType == SHPT_MULTIPOINT
+             || psObject->nSHPType == SHPT_MULTIPOINTZ
+             || psObject->nSHPType == SHPT_MULTIPOINTM )
+    {
+	int32		nPoints;
+	int    		i;
+
+	nPoints = psObject->nVertices;
+
+        _SHPSetBounds( pabyRec + 12, psObject );
+
+	if( bBigEndian ) SwapWord( 4, &nPoints );
+	ByteCopy( &nPoints, pabyRec + 44, 4 );
+	
+	for( i = 0; i < psObject->nVertices; i++ )
+	{
+	    ByteCopy( psObject->padfX + i, pabyRec + 48 + i*16, 8 );
+	    ByteCopy( psObject->padfY + i, pabyRec + 48 + i*16 + 8, 8 );
+
+	    if( bBigEndian ) SwapWord( 8, pabyRec + 48 + i*16 );
+	    if( bBigEndian ) SwapWord( 8, pabyRec + 48 + i*16 + 8 );
+	}
+
+	nRecordSize = 48 + 16 * psObject->nVertices;
+
+        if( psObject->nSHPType == SHPT_MULTIPOINTZ )
+        {
+            ByteCopy( &(psObject->dfZMin), pabyRec + nRecordSize, 8 );
+            if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+            nRecordSize += 8;
+
+            ByteCopy( &(psObject->dfZMax), pabyRec + nRecordSize, 8 );
+            if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+            nRecordSize += 8;
+            
+            for( i = 0; i < psObject->nVertices; i++ )
+            {
+                ByteCopy( psObject->padfZ + i, pabyRec + nRecordSize, 8 );
+                if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+                nRecordSize += 8;
+            }
+        }
+
+        if( psObject->nSHPType == SHPT_MULTIPOINTZ
+            || psObject->nSHPType == SHPT_MULTIPOINTM )
+        {
+            ByteCopy( &(psObject->dfMMin), pabyRec + nRecordSize, 8 );
+            if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+            nRecordSize += 8;
+
+            ByteCopy( &(psObject->dfMMax), pabyRec + nRecordSize, 8 );
+            if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+            nRecordSize += 8;
+            
+            for( i = 0; i < psObject->nVertices; i++ )
+            {
+                ByteCopy( psObject->padfM + i, pabyRec + nRecordSize, 8 );
+                if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+                nRecordSize += 8;
+            }
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Write point.							*/
+/* -------------------------------------------------------------------- */
+    else if( psObject->nSHPType == SHPT_POINT
+             || psObject->nSHPType == SHPT_POINTZ
+             || psObject->nSHPType == SHPT_POINTM )
+    {
+	ByteCopy( psObject->padfX, pabyRec + 12, 8 );
+	ByteCopy( psObject->padfY, pabyRec + 20, 8 );
+
+	if( bBigEndian ) SwapWord( 8, pabyRec + 12 );
+	if( bBigEndian ) SwapWord( 8, pabyRec + 20 );
+
+        nRecordSize = 28;
+        
+        if( psObject->nSHPType == SHPT_POINTZ )
+        {
+            ByteCopy( psObject->padfZ, pabyRec + nRecordSize, 8 );
+            if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+            nRecordSize += 8;
+        }
+        
+        if( psObject->nSHPType == SHPT_POINTZ
+            || psObject->nSHPType == SHPT_POINTM )
+        {
+            ByteCopy( psObject->padfM, pabyRec + nRecordSize, 8 );
+            if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+            nRecordSize += 8;
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Not much to do for null geometries.                             */
+/* -------------------------------------------------------------------- */
+    else if( psObject->nSHPType == SHPT_NULL )
+    {
+        nRecordSize = 12;
+    }
+
+    else
+    {
+        /* unknown type */
+        assert( FALSE );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Establish where we are going to put this record. If we are      */
+/*      rewriting and existing record, and it will fit, then put it     */
+/*      back where the original came from.  Otherwise write at the end. */
+/* -------------------------------------------------------------------- */
+    if( nShapeId == -1 || psSHP->panRecSize[nShapeId] < nRecordSize-8 )
+    {
+        if( nShapeId == -1 )
+            nShapeId = psSHP->nRecords++;
+
+        psSHP->panRecOffset[nShapeId] = nRecordOffset = psSHP->nFileSize;
+        psSHP->panRecSize[nShapeId] = nRecordSize-8;
+        psSHP->nFileSize += nRecordSize;
+    }
+    else
+    {
+        nRecordOffset = psSHP->panRecOffset[nShapeId];
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Set the shape type, record number, and record size.             */
+/* -------------------------------------------------------------------- */
+    i32 = nShapeId+1;					/* record # */
+    if( !bBigEndian ) SwapWord( 4, &i32 );
+    ByteCopy( &i32, pabyRec, 4 );
+
+    i32 = (nRecordSize-8)/2;				/* record size */
+    if( !bBigEndian ) SwapWord( 4, &i32 );
+    ByteCopy( &i32, pabyRec + 4, 4 );
+
+    i32 = psObject->nSHPType;				/* shape type */
+    if( bBigEndian ) SwapWord( 4, &i32 );
+    ByteCopy( &i32, pabyRec + 8, 4 );
+
+/* -------------------------------------------------------------------- */
+/*      Write out record.                                               */
+/* -------------------------------------------------------------------- */
+    if( fseek( psSHP->fpSHP, nRecordOffset, 0 ) != 0
+        || fwrite( pabyRec, nRecordSize, 1, psSHP->fpSHP ) < 1 )
+    {
+        printf( "Error in fseek() or fwrite().\n" );
+        free( pabyRec );
+        return -1;
+    }
+    
+    free( pabyRec );
+
+/* -------------------------------------------------------------------- */
+/*	Expand file wide bounds based on this shape.			*/
+/* -------------------------------------------------------------------- */
+    if( psSHP->adBoundsMin[0] == 0.0
+        && psSHP->adBoundsMax[0] == 0.0
+        && psSHP->adBoundsMin[1] == 0.0
+        && psSHP->adBoundsMax[1] == 0.0 
+        && psObject->nSHPType != SHPT_NULL )
+    {
+        psSHP->adBoundsMin[0] = psSHP->adBoundsMax[0] = psObject->padfX[0];
+        psSHP->adBoundsMin[1] = psSHP->adBoundsMax[1] = psObject->padfY[0];
+        psSHP->adBoundsMin[2] = psSHP->adBoundsMax[2] = psObject->padfZ[0];
+        psSHP->adBoundsMin[3] = psSHP->adBoundsMax[3] = psObject->padfM[0];
+    }
+
+    for( i = 0; i < psObject->nVertices; i++ )
+    {
+	psSHP->adBoundsMin[0] = MIN(psSHP->adBoundsMin[0],psObject->padfX[i]);
+	psSHP->adBoundsMin[1] = MIN(psSHP->adBoundsMin[1],psObject->padfY[i]);
+	psSHP->adBoundsMin[2] = MIN(psSHP->adBoundsMin[2],psObject->padfZ[i]);
+	psSHP->adBoundsMin[3] = MIN(psSHP->adBoundsMin[3],psObject->padfM[i]);
+	psSHP->adBoundsMax[0] = MAX(psSHP->adBoundsMax[0],psObject->padfX[i]);
+	psSHP->adBoundsMax[1] = MAX(psSHP->adBoundsMax[1],psObject->padfY[i]);
+	psSHP->adBoundsMax[2] = MAX(psSHP->adBoundsMax[2],psObject->padfZ[i]);
+	psSHP->adBoundsMax[3] = MAX(psSHP->adBoundsMax[3],psObject->padfM[i]);
+    }
+
+    return( nShapeId  );
+}
+
+/************************************************************************/
+/*                          SHPReadObject()                             */
+/*                                                                      */
+/*      Read the vertices, parts, and other non-attribute information	*/
+/*	for one shape.							*/
+/************************************************************************/
+
+SHPObject SHPAPI_CALL1(*)
+SHPReadObject( SHPHandle psSHP, int hEntity )
+
+{
+    SHPObject		*psShape;
+
+/* -------------------------------------------------------------------- */
+/*      Validate the record/entity number.                              */
+/* -------------------------------------------------------------------- */
+    if( hEntity < 0 || hEntity >= psSHP->nRecords )
+        return( NULL );
+
+/* -------------------------------------------------------------------- */
+/*      Ensure our record buffer is large enough.                       */
+/* -------------------------------------------------------------------- */
+    if( psSHP->panRecSize[hEntity]+8 > psSHP->nBufSize )
+    {
+	psSHP->nBufSize = psSHP->panRecSize[hEntity]+8;
+	psSHP->pabyRec = (uchar *) SfRealloc(psSHP->pabyRec,psSHP->nBufSize);
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Read the record.                                                */
+/* -------------------------------------------------------------------- */
+    fseek( psSHP->fpSHP, psSHP->panRecOffset[hEntity], 0 );
+    fread( psSHP->pabyRec, psSHP->panRecSize[hEntity]+8, 1, psSHP->fpSHP );
+
+/* -------------------------------------------------------------------- */
+/*	Allocate and minimally initialize the object.			*/
+/* -------------------------------------------------------------------- */
+    psShape = (SHPObject *) calloc(1,sizeof(SHPObject));
+    psShape->nShapeId = hEntity;
+
+    memcpy( &psShape->nSHPType, psSHP->pabyRec + 8, 4 );
+    if( bBigEndian ) SwapWord( 4, &(psShape->nSHPType) );
+
+/* ==================================================================== */
+/*  Extract vertices for a Polygon or Arc.				*/
+/* ==================================================================== */
+    if( psShape->nSHPType == SHPT_POLYGON || psShape->nSHPType == SHPT_ARC
+        || psShape->nSHPType == SHPT_POLYGONZ
+        || psShape->nSHPType == SHPT_POLYGONM
+        || psShape->nSHPType == SHPT_ARCZ
+        || psShape->nSHPType == SHPT_ARCM
+        || psShape->nSHPType == SHPT_MULTIPATCH )
+    {
+	int32		nPoints, nParts;
+	int    		i, nOffset;
+
+/* -------------------------------------------------------------------- */
+/*	Get the X/Y bounds.						*/
+/* -------------------------------------------------------------------- */
+        memcpy( &(psShape->dfXMin), psSHP->pabyRec + 8 +  4, 8 );
+        memcpy( &(psShape->dfYMin), psSHP->pabyRec + 8 + 12, 8 );
+        memcpy( &(psShape->dfXMax), psSHP->pabyRec + 8 + 20, 8 );
+        memcpy( &(psShape->dfYMax), psSHP->pabyRec + 8 + 28, 8 );
+
+	if( bBigEndian ) SwapWord( 8, &(psShape->dfXMin) );
+	if( bBigEndian ) SwapWord( 8, &(psShape->dfYMin) );
+	if( bBigEndian ) SwapWord( 8, &(psShape->dfXMax) );
+	if( bBigEndian ) SwapWord( 8, &(psShape->dfYMax) );
+
+/* -------------------------------------------------------------------- */
+/*      Extract part/point count, and build vertex and part arrays      */
+/*      to proper size.                                                 */
+/* -------------------------------------------------------------------- */
+	memcpy( &nPoints, psSHP->pabyRec + 40 + 8, 4 );
+	memcpy( &nParts, psSHP->pabyRec + 36 + 8, 4 );
+
+	if( bBigEndian ) SwapWord( 4, &nPoints );
+	if( bBigEndian ) SwapWord( 4, &nParts );
+
+	psShape->nVertices = nPoints;
+        psShape->padfX = (double *) calloc(nPoints,sizeof(double));
+        psShape->padfY = (double *) calloc(nPoints,sizeof(double));
+        psShape->padfZ = (double *) calloc(nPoints,sizeof(double));
+        psShape->padfM = (double *) calloc(nPoints,sizeof(double));
+
+	psShape->nParts = nParts;
+        psShape->panPartStart = (int *) calloc(nParts,sizeof(int));
+        psShape->panPartType = (int *) calloc(nParts,sizeof(int));
+
+        for( i = 0; i < nParts; i++ )
+            psShape->panPartType[i] = SHPP_RING;
+
+/* -------------------------------------------------------------------- */
+/*      Copy out the part array from the record.                        */
+/* -------------------------------------------------------------------- */
+	memcpy( psShape->panPartStart, psSHP->pabyRec + 44 + 8, 4 * nParts );
+	for( i = 0; i < nParts; i++ )
+	{
+	    if( bBigEndian ) SwapWord( 4, psShape->panPartStart+i );
+	}
+
+	nOffset = 44 + 8 + 4*nParts;
+
+/* -------------------------------------------------------------------- */
+/*      If this is a multipatch, we will also have parts types.         */
+/* -------------------------------------------------------------------- */
+        if( psShape->nSHPType == SHPT_MULTIPATCH )
+        {
+            memcpy( psShape->panPartType, psSHP->pabyRec + nOffset, 4*nParts );
+            for( i = 0; i < nParts; i++ )
+            {
+                if( bBigEndian ) SwapWord( 4, psShape->panPartType+i );
+            }
+
+            nOffset += 4*nParts;
+        }
+        
+/* -------------------------------------------------------------------- */
+/*      Copy out the vertices from the record.                          */
+/* -------------------------------------------------------------------- */
+	for( i = 0; i < nPoints; i++ )
+	{
+	    memcpy(psShape->padfX + i,
+		   psSHP->pabyRec + nOffset + i * 16,
+		   8 );
+
+	    memcpy(psShape->padfY + i,
+		   psSHP->pabyRec + nOffset + i * 16 + 8,
+		   8 );
+
+	    if( bBigEndian ) SwapWord( 8, psShape->padfX + i );
+	    if( bBigEndian ) SwapWord( 8, psShape->padfY + i );
+	}
+
+        nOffset += 16*nPoints;
+        
+/* -------------------------------------------------------------------- */
+/*      If we have a Z coordinate, collect that now.                    */
+/* -------------------------------------------------------------------- */
+        if( psShape->nSHPType == SHPT_POLYGONZ
+            || psShape->nSHPType == SHPT_ARCZ
+            || psShape->nSHPType == SHPT_MULTIPATCH )
+        {
+            memcpy( &(psShape->dfZMin), psSHP->pabyRec + nOffset, 8 );
+            memcpy( &(psShape->dfZMax), psSHP->pabyRec + nOffset + 8, 8 );
+            
+            if( bBigEndian ) SwapWord( 8, &(psShape->dfZMin) );
+            if( bBigEndian ) SwapWord( 8, &(psShape->dfZMax) );
+            
+            for( i = 0; i < nPoints; i++ )
+            {
+                memcpy( psShape->padfZ + i,
+                        psSHP->pabyRec + nOffset + 16 + i*8, 8 );
+                if( bBigEndian ) SwapWord( 8, psShape->padfZ + i );
+            }
+
+            nOffset += 16 + 8*nPoints;
+        }
+
+/* -------------------------------------------------------------------- */
+/*      If we have a M measure value, then read it now.  We assume      */
+/*      that the measure can be present for any shape if the size is    */
+/*      big enough, but really it will only occur for the Z shapes      */
+/*      (options), and the M shapes.                                    */
+/* -------------------------------------------------------------------- */
+        if( psSHP->panRecSize[hEntity]+8 >= nOffset + 16 + 8*nPoints )
+        {
+            memcpy( &(psShape->dfMMin), psSHP->pabyRec + nOffset, 8 );
+            memcpy( &(psShape->dfMMax), psSHP->pabyRec + nOffset + 8, 8 );
+            
+            if( bBigEndian ) SwapWord( 8, &(psShape->dfMMin) );
+            if( bBigEndian ) SwapWord( 8, &(psShape->dfMMax) );
+            
+            for( i = 0; i < nPoints; i++ )
+            {
+                memcpy( psShape->padfM + i,
+                        psSHP->pabyRec + nOffset + 16 + i*8, 8 );
+                if( bBigEndian ) SwapWord( 8, psShape->padfM + i );
+            }
+        }
+        
+    }
+
+/* ==================================================================== */
+/*  Extract vertices for a MultiPoint.					*/
+/* ==================================================================== */
+    else if( psShape->nSHPType == SHPT_MULTIPOINT
+             || psShape->nSHPType == SHPT_MULTIPOINTM
+             || psShape->nSHPType == SHPT_MULTIPOINTZ )
+    {
+	int32		nPoints;
+	int    		i, nOffset;
+
+	memcpy( &nPoints, psSHP->pabyRec + 44, 4 );
+	if( bBigEndian ) SwapWord( 4, &nPoints );
+
+	psShape->nVertices = nPoints;
+        psShape->padfX = (double *) calloc(nPoints,sizeof(double));
+        psShape->padfY = (double *) calloc(nPoints,sizeof(double));
+        psShape->padfZ = (double *) calloc(nPoints,sizeof(double));
+        psShape->padfM = (double *) calloc(nPoints,sizeof(double));
+
+	for( i = 0; i < nPoints; i++ )
+	{
+	    memcpy(psShape->padfX+i, psSHP->pabyRec + 48 + 16 * i, 8 );
+	    memcpy(psShape->padfY+i, psSHP->pabyRec + 48 + 16 * i + 8, 8 );
+
+	    if( bBigEndian ) SwapWord( 8, psShape->padfX + i );
+	    if( bBigEndian ) SwapWord( 8, psShape->padfY + i );
+	}
+
+        nOffset = 48 + 16*nPoints;
+        
+/* -------------------------------------------------------------------- */
+/*	Get the X/Y bounds.						*/
+/* -------------------------------------------------------------------- */
+        memcpy( &(psShape->dfXMin), psSHP->pabyRec + 8 +  4, 8 );
+        memcpy( &(psShape->dfYMin), psSHP->pabyRec + 8 + 12, 8 );
+        memcpy( &(psShape->dfXMax), psSHP->pabyRec + 8 + 20, 8 );
+        memcpy( &(psShape->dfYMax), psSHP->pabyRec + 8 + 28, 8 );
+
+	if( bBigEndian ) SwapWord( 8, &(psShape->dfXMin) );
+	if( bBigEndian ) SwapWord( 8, &(psShape->dfYMin) );
+	if( bBigEndian ) SwapWord( 8, &(psShape->dfXMax) );
+	if( bBigEndian ) SwapWord( 8, &(psShape->dfYMax) );
+
+/* -------------------------------------------------------------------- */
+/*      If we have a Z coordinate, collect that now.                    */
+/* -------------------------------------------------------------------- */
+        if( psShape->nSHPType == SHPT_MULTIPOINTZ )
+        {
+            memcpy( &(psShape->dfZMin), psSHP->pabyRec + nOffset, 8 );
+            memcpy( &(psShape->dfZMax), psSHP->pabyRec + nOffset + 8, 8 );
+            
+            if( bBigEndian ) SwapWord( 8, &(psShape->dfZMin) );
+            if( bBigEndian ) SwapWord( 8, &(psShape->dfZMax) );
+            
+            for( i = 0; i < nPoints; i++ )
+            {
+                memcpy( psShape->padfZ + i,
+                        psSHP->pabyRec + nOffset + 16 + i*8, 8 );
+                if( bBigEndian ) SwapWord( 8, psShape->padfZ + i );
+            }
+
+            nOffset += 16 + 8*nPoints;
+        }
+
+/* -------------------------------------------------------------------- */
+/*      If we have a M measure value, then read it now.  We assume      */
+/*      that the measure can be present for any shape if the size is    */
+/*      big enough, but really it will only occur for the Z shapes      */
+/*      (options), and the M shapes.                                    */
+/* -------------------------------------------------------------------- */
+        if( psSHP->panRecSize[hEntity]+8 >= nOffset + 16 + 8*nPoints )
+        {
+            memcpy( &(psShape->dfMMin), psSHP->pabyRec + nOffset, 8 );
+            memcpy( &(psShape->dfMMax), psSHP->pabyRec + nOffset + 8, 8 );
+            
+            if( bBigEndian ) SwapWord( 8, &(psShape->dfMMin) );
+            if( bBigEndian ) SwapWord( 8, &(psShape->dfMMax) );
+            
+            for( i = 0; i < nPoints; i++ )
+            {
+                memcpy( psShape->padfM + i,
+                        psSHP->pabyRec + nOffset + 16 + i*8, 8 );
+                if( bBigEndian ) SwapWord( 8, psShape->padfM + i );
+            }
+        }
+    }
+
+/* ==================================================================== */
+/*      Extract vertices for a point.                                   */
+/* ==================================================================== */
+    else if( psShape->nSHPType == SHPT_POINT
+             || psShape->nSHPType == SHPT_POINTM
+             || psShape->nSHPType == SHPT_POINTZ )
+    {
+        int	nOffset;
+        
+	psShape->nVertices = 1;
+        psShape->padfX = (double *) calloc(1,sizeof(double));
+        psShape->padfY = (double *) calloc(1,sizeof(double));
+        psShape->padfZ = (double *) calloc(1,sizeof(double));
+        psShape->padfM = (double *) calloc(1,sizeof(double));
+
+	memcpy( psShape->padfX, psSHP->pabyRec + 12, 8 );
+	memcpy( psShape->padfY, psSHP->pabyRec + 20, 8 );
+
+	if( bBigEndian ) SwapWord( 8, psShape->padfX );
+	if( bBigEndian ) SwapWord( 8, psShape->padfY );
+
+        nOffset = 20 + 8;
+        
+/* -------------------------------------------------------------------- */
+/*      If we have a Z coordinate, collect that now.                    */
+/* -------------------------------------------------------------------- */
+        if( psShape->nSHPType == SHPT_POINTZ )
+        {
+            memcpy( psShape->padfZ, psSHP->pabyRec + nOffset, 8 );
+        
+            if( bBigEndian ) SwapWord( 8, psShape->padfZ );
+            
+            nOffset += 8;
+        }
+
+/* -------------------------------------------------------------------- */
+/*      If we have a M measure value, then read it now.  We assume      */
+/*      that the measure can be present for any shape if the size is    */
+/*      big enough, but really it will only occur for the Z shapes      */
+/*      (options), and the M shapes.                                    */
+/* -------------------------------------------------------------------- */
+        if( psSHP->panRecSize[hEntity]+8 >= nOffset + 8 )
+        {
+            memcpy( psShape->padfM, psSHP->pabyRec + nOffset, 8 );
+        
+            if( bBigEndian ) SwapWord( 8, psShape->padfM );
+        }
+
+/* -------------------------------------------------------------------- */
+/*      Since no extents are supplied in the record, we will apply      */
+/*      them from the single vertex.                                    */
+/* -------------------------------------------------------------------- */
+        psShape->dfXMin = psShape->dfXMax = psShape->padfX[0];
+        psShape->dfYMin = psShape->dfYMax = psShape->padfY[0];
+        psShape->dfZMin = psShape->dfZMax = psShape->padfZ[0];
+        psShape->dfMMin = psShape->dfMMax = psShape->padfM[0];
+    }
+
+    return( psShape );
+}
+
+/************************************************************************/
+/*                            SHPTypeName()                             */
+/************************************************************************/
+
+const char SHPAPI_CALL1(*)
+SHPTypeName( int nSHPType )
+
+{
+    switch( nSHPType )
+    {
+      case SHPT_NULL:
+        return "NullShape";
+
+      case SHPT_POINT:
+        return "Point";
+
+      case SHPT_ARC:
+        return "Arc";
+
+      case SHPT_POLYGON:
+        return "Polygon";
+
+      case SHPT_MULTIPOINT:
+        return "MultiPoint";
+        
+      case SHPT_POINTZ:
+        return "PointZ";
+
+      case SHPT_ARCZ:
+        return "ArcZ";
+
+      case SHPT_POLYGONZ:
+        return "PolygonZ";
+
+      case SHPT_MULTIPOINTZ:
+        return "MultiPointZ";
+        
+      case SHPT_POINTM:
+        return "PointM";
+
+      case SHPT_ARCM:
+        return "ArcM";
+
+      case SHPT_POLYGONM:
+        return "PolygonM";
+
+      case SHPT_MULTIPOINTM:
+        return "MultiPointM";
+
+      case SHPT_MULTIPATCH:
+        return "MultiPatch";
+
+      default:
+        return "UnknownShapeType";
+    }
+}
+
+/************************************************************************/
+/*                          SHPPartTypeName()                           */
+/************************************************************************/
+
+const char SHPAPI_CALL1(*)
+SHPPartTypeName( int nPartType )
+
+{
+    switch( nPartType )
+    {
+      case SHPP_TRISTRIP:
+        return "TriangleStrip";
+        
+      case SHPP_TRIFAN:
+        return "TriangleFan";
+
+      case SHPP_OUTERRING:
+        return "OuterRing";
+
+      case SHPP_INNERRING:
+        return "InnerRing";
+
+      case SHPP_FIRSTRING:
+        return "FirstRing";
+
+      case SHPP_RING:
+        return "Ring";
+
+      default:
+        return "UnknownPartType";
+    }
+}
+
+/************************************************************************/
+/*                          SHPDestroyObject()                          */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPDestroyObject( SHPObject * psShape )
+
+{
+    if( psShape == NULL )
+        return;
+    
+    if( psShape->padfX != NULL )
+        free( psShape->padfX );
+    if( psShape->padfY != NULL )
+        free( psShape->padfY );
+    if( psShape->padfZ != NULL )
+        free( psShape->padfZ );
+    if( psShape->padfM != NULL )
+        free( psShape->padfM );
+
+    if( psShape->panPartStart != NULL )
+        free( psShape->panPartStart );
+    if( psShape->panPartType != NULL )
+        free( psShape->panPartType );
+
+    free( psShape );
+}
+
+/************************************************************************/
+/*                          SHPRewindObject()                           */
+/*                                                                      */
+/*      Reset the winding of polygon objects to adhere to the           */
+/*      specification.                                                  */
+/************************************************************************/
+
+int SHPAPI_CALL
+SHPRewindObject( SHPHandle hSHP, SHPObject * psObject )
+
+{
+    int  iOpRing, bAltered = 0;
+
+/* -------------------------------------------------------------------- */
+/*      Do nothing if this is not a polygon object.                     */
+/* -------------------------------------------------------------------- */
+    if( psObject->nSHPType != SHPT_POLYGON
+        && psObject->nSHPType != SHPT_POLYGONZ
+        && psObject->nSHPType != SHPT_POLYGONM )
+        return 0;
+
+/* -------------------------------------------------------------------- */
+/*      Process each of the rings.                                      */
+/* -------------------------------------------------------------------- */
+    for( iOpRing = 0; iOpRing < psObject->nParts; iOpRing++ )
+    {
+        int      bInner, iVert, nVertCount, nVertStart, iCheckRing;
+        double   dfSum, dfTestX, dfTestY;
+
+/* -------------------------------------------------------------------- */
+/*      Determine if this ring is an inner ring or an outer ring        */
+/*      relative to all the other rings.  For now we assume the         */
+/*      first ring is outer and all others are inner, but eventually    */
+/*      we need to fix this to handle multiple island polygons and      */
+/*      unordered sets of rings.                                        */
+/* -------------------------------------------------------------------- */
+        dfTestX = psObject->padfX[psObject->panPartStart[iOpRing]];
+        dfTestY = psObject->padfY[psObject->panPartStart[iOpRing]];
+
+        bInner = FALSE;
+        for( iCheckRing = 0; iCheckRing < psObject->nParts; iCheckRing++ )
+        {
+            int iEdge;
+
+            if( iCheckRing == iOpRing )
+                continue;
+            
+            nVertStart = psObject->panPartStart[iCheckRing];
+
+            if( iCheckRing == psObject->nParts-1 )
+                nVertCount = psObject->nVertices 
+                    - psObject->panPartStart[iCheckRing];
+            else
+                nVertCount = psObject->panPartStart[iCheckRing+1] 
+                    - psObject->panPartStart[iCheckRing];
+
+            for( iEdge = 0; iEdge < nVertCount; iEdge++ )
+            {
+                int iNext;
+
+                if( iEdge < nVertCount-1 )
+                    iNext = iEdge+1;
+                else
+                    iNext = 0;
+
+                if( (psObject->padfY[iEdge+nVertStart] < dfTestY 
+                     && psObject->padfY[iNext+nVertStart] >= dfTestY)
+                    || (psObject->padfY[iNext+nVertStart] < dfTestY 
+                        && psObject->padfY[iEdge+nVertStart] >= dfTestY) )
+                {
+                    if( psObject->padfX[iEdge+nVertStart] 
+                        + (dfTestY - psObject->padfY[iEdge+nVertStart])
+                           / (psObject->padfY[iNext+nVertStart]
+                              - psObject->padfY[iEdge+nVertStart])
+                           * (psObject->padfX[iNext+nVertStart]
+                              - psObject->padfX[iEdge+nVertStart]) < dfTestX )
+                        bInner = !bInner;
+                }
+            }
+        }
+
+/* -------------------------------------------------------------------- */
+/*      Determine the current order of this ring so we will know if     */
+/*      it has to be reversed.                                          */
+/* -------------------------------------------------------------------- */
+        nVertStart = psObject->panPartStart[iOpRing];
+
+        if( iOpRing == psObject->nParts-1 )
+            nVertCount = psObject->nVertices - psObject->panPartStart[iOpRing];
+        else
+            nVertCount = psObject->panPartStart[iOpRing+1] 
+                - psObject->panPartStart[iOpRing];
+
+        dfSum = 0.0;
+        for( iVert = nVertStart; iVert < nVertStart+nVertCount-1; iVert++ )
+        {
+            dfSum += psObject->padfX[iVert] * psObject->padfY[iVert+1]
+                - psObject->padfY[iVert] * psObject->padfX[iVert+1];
+        }
+
+        dfSum += psObject->padfX[iVert] * psObject->padfY[nVertStart]
+               - psObject->padfY[iVert] * psObject->padfX[nVertStart];
+
+/* -------------------------------------------------------------------- */
+/*      Reverse if necessary.                                           */
+/* -------------------------------------------------------------------- */
+        if( (dfSum < 0.0 && bInner) || (dfSum > 0.0 && !bInner) )
+        {
+            int   i;
+
+            bAltered++;
+            for( i = 0; i < nVertCount/2; i++ )
+            {
+                double dfSaved;
+
+                /* Swap X */
+                dfSaved = psObject->padfX[nVertStart+i];
+                psObject->padfX[nVertStart+i] = 
+                    psObject->padfX[nVertStart+nVertCount-i-1];
+                psObject->padfX[nVertStart+nVertCount-i-1] = dfSaved;
+
+                /* Swap Y */
+                dfSaved = psObject->padfY[nVertStart+i];
+                psObject->padfY[nVertStart+i] = 
+                    psObject->padfY[nVertStart+nVertCount-i-1];
+                psObject->padfY[nVertStart+nVertCount-i-1] = dfSaved;
+
+                /* Swap Z */
+                if( psObject->padfZ )
+                {
+                    dfSaved = psObject->padfZ[nVertStart+i];
+                    psObject->padfZ[nVertStart+i] = 
+                        psObject->padfZ[nVertStart+nVertCount-i-1];
+                    psObject->padfZ[nVertStart+nVertCount-i-1] = dfSaved;
+                }
+
+                /* Swap M */
+                if( psObject->padfM )
+                {
+                    dfSaved = psObject->padfM[nVertStart+i];
+                    psObject->padfM[nVertStart+i] = 
+                        psObject->padfM[nVertStart+nVertCount-i-1];
+                    psObject->padfM[nVertStart+nVertCount-i-1] = dfSaved;
+                }
+            }
+        }
+    }
+
+    return bAltered;
+}
diff --git a/src/terralib/drivers/DXF/TeDXFDriver.cpp b/src/terralib/drivers/DXF/TeDXFDriver.cpp
new file mode 100644
index 0000000..a11f165
--- /dev/null
+++ b/src/terralib/drivers/DXF/TeDXFDriver.cpp
@@ -0,0 +1,107 @@
+#include "TeDXFDriver.h"
+#include "TeProjection.h"
+#include "TeSTElementSet.h"
+#include "tedxflayer.h"
+#include "tedxfvisitor.h"
+
+TeDXFDriver::TeDXFDriver(const string & fileName) :
+TeGeoDataDriver()
+{
+	fileName_ = fileName;
+	numObjs_ = 0;
+}
+
+TeDXFDriver::~TeDXFDriver() 
+{
+}
+
+std::string TeDXFDriver::getFileName() 
+{
+	return fileName_;
+}
+
+bool TeDXFDriver::isDataAccessible() 
+{
+	return TeCheckFileExistence(fileName_);
+}
+
+TeProjection * TeDXFDriver::getDataProjection() 
+{
+	return NULL;
+}
+
+bool TeDXFDriver::getDataInfo(unsigned int & nObjects, TeBox & ext, TeGeomRep & repres) 
+{
+	nObjects = numObjs_;
+	ext = box_;
+
+	repres = geomType_;
+
+	return true;
+}
+
+bool TeDXFDriver::getDataAttributesList(TeAttributeList & /*attList*/) 
+{
+	return true;
+}
+
+bool TeDXFDriver::loadData(TeSTElementSet * dataSet) 
+{
+    TeDXFVisitor* visitor = new TeDXFVisitor(fileName_);
+	vector<TeDXFLayer*> layers = visitor->getLayers();
+	vector<TeDXFLayer*>::iterator it;
+
+	delete visitor;
+
+	for(it = layers.begin(); it != layers.end(); ++it)
+	{
+		TeDXFLayer* layer = *it;
+
+		if(!layer->getPoints().empty())
+		{
+			TePointSet pts = layer->getPoints();
+			TePointSet::iterator pIt;
+			
+			for(pIt = pts.begin(); pIt != pts.end(); ++pIt)
+			{
+				TeSTInstance obj;
+				obj.addGeometry(*pIt);
+				dataSet->insertSTInstance(obj);
+			}
+			updateBox(box_, pts.box());
+			numObjs_ += pts.size();
+		}
+		if(!layer->getLines().empty())
+		{
+			TeLineSet ls = layer->getLines();
+			TeLineSet::iterator lIt;
+			
+			for(lIt = ls.begin(); lIt != ls.end(); ++lIt)
+			{
+				TeSTInstance obj;
+				obj.addGeometry(*lIt);
+				dataSet->insertSTInstance(obj);
+			}
+			updateBox(box_, ls.box());
+			numObjs_ += ls.size();
+		}
+		if(!layer->getPolygons().empty())
+		{
+			TePolygonSet pts = layer->getPolygons();
+			TePolygonSet ::iterator pIt;
+			
+			for(pIt = pts.begin(); pIt != pts.end(); ++pIt)
+			{
+				TeSTInstance obj;
+				obj.addGeometry(*pIt);
+				dataSet->insertSTInstance(obj);
+			}
+			updateBox(box_, pts.box());
+			numObjs_ += pts.size();
+		}
+		delete layer;
+	}
+
+	return true;
+}
+
diff --git a/src/terralib/drivers/DXF/TeDXFDriver.h b/src/terralib/drivers/DXF/TeDXFDriver.h
new file mode 100644
index 0000000..ae71bde
--- /dev/null
+++ b/src/terralib/drivers/DXF/TeDXFDriver.h
@@ -0,0 +1,92 @@
+/*********************************
+ * FUNCATE - GIS development team
+ *
+ * TerraLib INPE
+ *********************************/
+/** @file TeDXFDriver.h
+ *  @brief This files contains a definition for a driver for DXF files. 
+ * The driver is used to read from a file.
+ *  @version 1.0
+ *  @author Frederico Augusto Bed�
+ *  @date 11/2009
+ */
+#ifndef _TEDXFDRIVER_H
+#define _TEDXFDRIVER_H
+
+#include "tedxfdefines.h"
+#include "TeGeoDataDriver.h"
+#include <string>
+using namespace std;
+#include "TeBox.h"
+#include "TeDataTypes.h"
+#include "TeAttribute.h"
+
+class TeProjection;
+class TeSTElementSet;
+class TeDXFLayer;
+class TeDXFVisitor;
+
+/** @class TeDXFDriver
+ *  @brief Concrete implementation of a driver for DXF files. 
+ */
+class TEDXF_DLL TeDXFDriver : public TeGeoDataDriver 
+{
+  public:
+    /** @brief 
+         */
+        TeDXFDriver(const string & fileName);
+
+    /** @brief 
+         */
+        ~TeDXFDriver();
+
+    //! Returns the complete access path associated to this driver
+    virtual std::string getFileName();
+
+    //! Returns true or false whether the data file is accessible
+    virtual bool isDataAccessible();
+
+    //! Returns the spatial reference associated to the data as an instance of TeProjection 
+    virtual TeProjection * getDataProjection();
+
+    //! Loads the minimum metadata information about the data
+    //
+    //		\param nObjects to return the number of objects accessible in the data set
+    //		\param ext	to return the spatial extension of the geometries in the data set
+    //		\param repres to return the type of geometries in the file
+    //		\return true if or false whether it can retrieve the information or not
+    //	
+    virtual bool getDataInfo(unsigned int & nObjects, TeBox & ext, TeGeomRep & repres);
+
+    //! Loads the list of descriptive attributes of the objetcts represented in the file
+    virtual bool getDataAttributesList(TeAttributeList & attList);
+
+    //! Loads the data into an TeSTElementSet structure in memory
+    //
+    //		\param dataSet to return data set
+    //		\return true if or false whether it can retrieve the information or not
+    //	
+    virtual bool loadData(TeSTElementSet * dataSet);
+
+
+  protected:
+    string fileName_; //!< Complete file name, including teh complete path and its extension.    
+
+    TeBox box_; //!< 
+
+    unsigned int numObjs_; //!< 
+
+    TeGeomRep geomType_; //!< 
+
+
+  private:
+    /** @brief No copy allowed.    
+         */
+        TeDXFDriver(const TeDXFDriver & source);
+
+    /** @brief No copy allowed.    
+         */
+        TeDXFDriver & operator=(const TeDXFDriver & source);
+
+};
+#endif
diff --git a/src/terralib/drivers/DXF/TeDXFDriverFactory.cpp b/src/terralib/drivers/DXF/TeDXFDriverFactory.cpp
new file mode 100644
index 0000000..e6307e5
--- /dev/null
+++ b/src/terralib/drivers/DXF/TeDXFDriverFactory.cpp
@@ -0,0 +1,28 @@
+#include "TeDXFDriverFactory.h"
+#include "TeDXFDriver.h"
+#include "TeGeoDataDriver.h"
+
+TeDXFDriverFactory::TeDXFDriverFactory() :
+TeGDriverFactory("DXF")
+{
+}
+
+TeDXFDriverFactory::~TeDXFDriverFactory() 
+{
+}
+
+TeGeoDataDriver * TeDXFDriverFactory::build(TeGDriverParams * params) 
+{
+	TeGeoDataDriver* driver = NULL;
+
+	if(params != NULL && !params->fileName_.empty())
+		driver = new TeDXFDriver(params->fileName_);
+
+	return driver;
+}
+
+TeGeoDataDriver* TeDXFDriverFactory::build() 
+{
+	return NULL;
+}
+
diff --git a/src/terralib/drivers/DXF/TeDXFDriverFactory.h b/src/terralib/drivers/DXF/TeDXFDriverFactory.h
new file mode 100644
index 0000000..ffb3890
--- /dev/null
+++ b/src/terralib/drivers/DXF/TeDXFDriverFactory.h
@@ -0,0 +1,28 @@
+
+#ifndef _TEDXFDRIVERFACTORY_H
+#define _TEDXFDRIVERFACTORY_H
+
+#include "tedxfdefines.h"
+#include "TeGDriverFactory.h"
+
+class TeDXFDriver;
+class TeGeoDataDriver;
+struct TeGDriverParams;
+
+class TEDXF_DLL TeDXFDriverFactory : public TeGDriverFactory 
+{
+  public:
+    TeDXFDriverFactory();
+
+    ~TeDXFDriverFactory();
+
+
+  protected:
+    //!  Builds a new product from a set of parameters (should be implemented by descendants)
+    TeGeoDataDriver * build(TeGDriverParams * params); 
+
+    //!  Builds a new product without parameters (should be implemented by descendants)
+    TeGeoDataDriver* build();
+
+};
+#endif
diff --git a/src/terralib/drivers/DXF/tedxfdefines.h b/src/terralib/drivers/DXF/tedxfdefines.h
new file mode 100644
index 0000000..39c263f
--- /dev/null
+++ b/src/terralib/drivers/DXF/tedxfdefines.h
@@ -0,0 +1,15 @@
+#ifndef  __TEDXF_INTERNAL_DEFINES_H
+#define  __TEDXF_INTERNAL_DEFINES_H
+
+#ifdef WIN32
+
+	#ifdef TEDXF_EXPORTS
+		#define TEDXF_DLL  __declspec(dllexport)   // export DLL information
+	#else
+		#define TEDXF_DLL  __declspec(dllimport)   // import DLL information
+	#endif
+#else
+	#define TEDXF_DLL
+#endif
+
+#endif
diff --git a/src/terralib/drivers/DXF/tedxflayer.cpp b/src/terralib/drivers/DXF/tedxflayer.cpp
new file mode 100644
index 0000000..39b2890
--- /dev/null
+++ b/src/terralib/drivers/DXF/tedxflayer.cpp
@@ -0,0 +1,58 @@
+#include "tedxflayer.h"
+#include "TeGeometry.h"
+
+TeDXFLayer::TeDXFLayer(const string & layerName) 
+{
+	name_ = layerName;
+	_visible = false;
+}
+
+TeDXFLayer::~TeDXFLayer() 
+{
+}
+
+const string TeDXFLayer::getName() const 
+{
+  return name_;
+}
+
+void TeDXFLayer::addPoint(const TePoint & pt) 
+{
+	_points.add(pt);
+}
+
+void TeDXFLayer::addLine(const TeLine2D & line) 
+{
+	_lines.add(line);
+}
+
+void TeDXFLayer::addPolygon(const TePolygon & poly) 
+{
+	_polygons.add(poly);
+}
+
+const TePointSet TeDXFLayer::getPoints() const 
+{
+  return _points;
+}
+
+const TeLineSet TeDXFLayer::getLines() const 
+{
+  return _lines;
+}
+
+const TePolygonSet TeDXFLayer::getPolygons() const 
+{
+  return _polygons;
+}
+
+void TeDXFLayer::setVisible(const bool & value) 
+{
+  _visible = value;
+}
+
+const bool TeDXFLayer::getVisible() const 
+{
+  return _visible;
+}
+
diff --git a/src/terralib/drivers/DXF/tedxflayer.h b/src/terralib/drivers/DXF/tedxflayer.h
new file mode 100644
index 0000000..c339acf
--- /dev/null
+++ b/src/terralib/drivers/DXF/tedxflayer.h
@@ -0,0 +1,90 @@
+/*********************************
+ * FUNCATE - GIS development team
+ *
+ * Tdk Framework
+ *********************************/
+/** @file tedxflayer.h
+ *  @brief 
+ *  @version 1.0
+ *  @author Frederico Augusto Bed�
+ *  @date 11/2009
+ */
+#ifndef _TEDXFLAYER_H
+#define _TEDXFLAYER_H
+
+#include "tedxfdefines.h"
+#include <string>
+using namespace std;
+#include "TeGeometry.h"
+
+class TePoint;
+class TeLine2D;
+class TePolygon;
+
+/** @class TeDXFLayer
+ *  @brief 
+ */
+class TEDXF_DLL TeDXFLayer 
+{
+  public:
+    /** @brief 
+         */
+        TeDXFLayer(const string & layerName);
+
+    /** @brief 
+         */
+        ~TeDXFLayer();
+
+    /** @brief 
+         */
+        const string getName() const;
+
+    /** @brief 
+         */
+        void addPoint(const TePoint & pt);
+
+    /** @brief 
+         */
+        void addLine(const TeLine2D & line);
+
+    /** @brief 
+         */
+        void addPolygon(const TePolygon & poly);
+
+    //Return the point collection.
+    const TePointSet getPoints() const;
+
+    //Returns the line collection.
+    const TeLineSet getLines() const;
+
+    //Returns the polygon collection.
+    const TePolygonSet getPolygons() const;
+
+    void setVisible(const bool & value);
+
+    const bool getVisible() const;
+
+
+  protected:
+    string name_; //!< 
+
+    bool _visible; //!< Defines if the layer is visible or not.    
+
+    TePointSet _points; //!< point collection.    
+
+    TeLineSet _lines; //!< line collection.    
+
+    TePolygonSet _polygons; //!< poligons collection.    
+
+
+  private:
+    /** @brief No copy allowed.    
+         */
+        TeDXFLayer(const TeDXFLayer & source);
+
+    /** @brief No copy allowed.    
+         */
+        TeDXFLayer & operator=(const TeDXFLayer & source);
+
+};
+#endif
diff --git a/src/terralib/drivers/DXF/tedxfvisitor.cpp b/src/terralib/drivers/DXF/tedxfvisitor.cpp
new file mode 100644
index 0000000..22e0e92
--- /dev/null
+++ b/src/terralib/drivers/DXF/tedxfvisitor.cpp
@@ -0,0 +1,81 @@
+#include "tedxfvisitor.h"
+#include "dl_entities.h"
+#include "tedxflayer.h"
+#include "dl_dxf.h"
+
+TeDXFVisitor::TeDXFVisitor(const string & fileName) 
+{
+	DL_Dxf* dxf = new DL_Dxf();
+
+    if (!dxf->in(fileName, this)) 
+	{ // if file open failed
+		delete dxf;
+        return;
+    }
+
+	delete dxf;
+}
+
+TeDXFVisitor::~TeDXFVisitor() 
+{
+}
+
+void TeDXFVisitor::addLayer(const DL_LayerData & data) 
+{
+	TeDXFLayer* layer = new TeDXFLayer(data.name);
+	layers_.push_back(layer);
+}
+
+void TeDXFVisitor::addPoint(const DL_PointData & data) 
+{
+	TePoint p(data.x, data.y);
+
+	if(!layers_.empty())
+		layers_[layers_.size()-1]->addPoint(p);
+}
+
+void TeDXFVisitor::addLine(const DL_LineData & data) 
+{
+	TeLine2D l;
+	l.add(TeCoord2D(data.x1, data.y1));
+	l.add(TeCoord2D(data.x2, data.y2));
+
+	if(!layers_.empty())
+		layers_[layers_.size()-1]->addLine(l);
+}
+
+void TeDXFVisitor::addPolyline(const DL_PolylineData & /*data*/) 
+{
+}
+
+void TeDXFVisitor::addVertex(const DL_VertexData & data) 
+{
+	TeCoord2D c(data.x, data.y);
+
+	line_.add(c);
+}
+
+void TeDXFVisitor::endEntity() 
+{
+	if(!line_.empty())
+	{
+		if(line_[0] == line_[line_.size()-1])
+		{
+			TePolygon p;
+			p.add(line_);
+
+			if(!layers_.empty())
+				layers_[layers_.size()-1]->addPolygon(p);
+		}
+		else if(!layers_.empty())
+			layers_[layers_.size()-1]->addLine(line_);
+	}
+
+	line_ = TeLinearRing();
+}
+
+const vector<TeDXFLayer *> & TeDXFVisitor::getLayers() const 
+{
+  return layers_;
+}
+
diff --git a/src/terralib/drivers/DXF/tedxfvisitor.h b/src/terralib/drivers/DXF/tedxfvisitor.h
new file mode 100644
index 0000000..810fdfa
--- /dev/null
+++ b/src/terralib/drivers/DXF/tedxfvisitor.h
@@ -0,0 +1,89 @@
+/*********************************
+ * FUNCATE - GIS development team
+ *
+ * Tdk Framework
+ *********************************/
+/** @file tedxfvisitor.h
+ *  @brief 
+ *  @version 1.0
+ *  @author Frederico Augusto Bed�
+ *  @date 11/2009
+ */
+#ifndef _TEDXFVISITOR_H
+#define _TEDXFVISITOR_H
+
+#include "tedxfdefines.h"
+#include "dl_creationadapter.h"
+#include <string>
+using namespace std;
+#include <vector>
+using namespace std;
+#include "TeGeometry.h"
+
+struct DL_LayerData;
+struct DL_PointData;
+struct DL_LineData;
+struct DL_PolylineData;
+struct DL_VertexData;
+class TeDXFLayer;
+class DL_Dxf;
+
+/** @class TeDXFVisitor
+ *  @brief 
+ */
+class TEDXF_DLL TeDXFVisitor : public DL_CreationAdapter 
+{
+  public:
+    /** @brief 
+         */
+        TeDXFVisitor(const string & fileName);
+
+    /** @brief 
+         */
+        ~TeDXFVisitor();
+
+    /** @brief 
+         */
+        void addLayer(const DL_LayerData & data);
+
+    /** @brief 
+         */
+        void addPoint(const DL_PointData & data);
+
+    /** @brief 
+         */
+        void addLine(const DL_LineData & data);
+
+    /** @brief 
+         */
+        void addPolyline(const DL_PolylineData & data);
+
+    /** @brief 
+         */
+        void addVertex(const DL_VertexData & data);
+
+    void endEntity();
+
+    //Return the parsed layers.
+    const vector<TeDXFLayer *> & getLayers() const;
+
+
+  protected:
+    vector<TeDXFLayer *> layers_; //!< 
+
+    string name_; //!< 
+
+    TeLinearRing line_; //!< 
+
+
+  private:
+    /** @brief Copy not allowed.    
+         */
+        TeDXFVisitor(const TeDXFVisitor & source);
+
+    /** @brief Copy not allowed.    
+         */
+        TeDXFVisitor & operator=(const TeDXFVisitor & source);
+
+};
+#endif
diff --git a/src/terralib/drivers/Firebird/TeFirebird.cpp b/src/terralib/drivers/Firebird/TeFirebird.cpp
new file mode 100644
index 0000000..ab117f8
--- /dev/null
+++ b/src/terralib/drivers/Firebird/TeFirebird.cpp
@@ -0,0 +1,3597 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeFirebird.h"
+#include <stdio.h>
+#include <sys/types.h>
+#include <TeProject.h>
+#include <cstring>
+
+#ifndef MAX
+  #define MAX(a,b) ((a>b)?a:b)
+#endif
+#ifndef MIN
+  #define MIN(a,b) ((a<b)?a:b)
+#endif
+
+void convertChar2Blob(char* buffer, const int& size, IBPP::Blob& blob)
+{
+	int bufferSize = 10240,
+		segments = size / bufferSize;
+
+	char* aux = buffer;
+
+	blob->Create();
+
+	for(int i=0; i<segments; i++)
+	{
+		blob->Write(aux, bufferSize);
+		aux += bufferSize;
+	}
+		
+	int resto = size - (segments*bufferSize);
+
+	if(resto > 0)
+	{
+		blob->Write(aux, resto);
+	}
+}
+
+void convertBlob2Char(const IBPP::Blob& blob, char*& buffer, int& size)
+{
+	blob->Open();
+
+	int bufferSize,
+		segments;
+
+	blob->Info(&size, &bufferSize, &segments);
+	buffer = new char[size];
+
+	segments = size/bufferSize;
+
+	char* aux = buffer;
+
+	for(int i=0; i<segments; i++)
+	{		
+		blob->Read(aux, bufferSize);
+		aux += bufferSize;
+	}
+
+	int resto = size - bufferSize*segments;
+	if(resto > 0)
+	{
+		blob->Read(aux, resto);
+	}
+}
+
+void teRing2Buffer(const TeLinearRing& line, char*& buffer, int& bufferSize)
+{
+	double* points = NULL;
+	TeLinearRing::iterator it;
+	points = new double[2*line.size()]; 
+	int iac = 0;
+
+	for(unsigned int i = 0; i < line.size(); i++)
+	{
+		points[iac++]=line[i].x();
+		points[iac++]=line[i].y();
+	}
+
+	bufferSize = 2*sizeof(double)*line.size();
+	buffer = (char*)(points);
+}
+
+void buffer2TeRing(const char* buffer, const int& numCoords, TeLinearRing& line)
+{
+	for(int i=0; i<numCoords; i++)
+	{
+		double x,
+			   y;
+
+		memcpy(&x, buffer+((2*i)*sizeof(double)),sizeof(double));
+		memcpy(&y, buffer+((2*i+1)*sizeof(double)),sizeof(double));
+
+		line.add(TeCoord2D(x, y));
+	}	
+}
+
+void loadFromBlob(IBPP::Statement& st, TeLinearRing& ring)
+{
+	int	nc;
+
+	st->Get("num_coords", nc);
+
+	IBPP::Blob blob = IBPP::BlobFactory(st->DatabasePtr(), st->TransactionPtr());
+	st->Get("spatial_data", blob);
+
+	int size;
+	char* buffer;
+
+	convertBlob2Char(blob, buffer, size);
+	buffer2TeRing(buffer, size/(2*sizeof(double)), ring);
+
+	blob->Close();
+
+	delete []buffer;
+}
+
+void saveLineInBlob(IBPP::Blob& blob, TeLinearRing& ring)
+{
+	int bLen = 0; //Buffer size.
+
+	char* buffer;
+
+	teRing2Buffer(ring, buffer, bLen);
+
+	convertChar2Blob(buffer, bLen, blob);
+
+	blob->Close();
+
+	delete []buffer;	
+}
+
+bool generateLablesForPolygonal(IBPP::Database db, TeTheme* theme, const TeGeomRep& geomType, 
+								std::string& errorMsg, const std::string& objId)
+{
+	std::string collTable = theme->collectionTable(),
+				geomTable = theme->layer()->tableName(geomType),
+				query = "SELECT object_id, lower_x, lower_y, upper_x, upper_y FROM " + geomTable;
+
+	TeDatabasePortal* portal = theme->layer()->database()->getPortal();
+
+	bool res = true;
+
+	if(!portal->query(query))
+	{
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error on query:\n" + portal->errorMessage());
+	}
+
+	if(!portal->fetchRow())
+	{
+		return res;
+	}
+
+	IBPP::Transaction tr = IBPP::TransactionFactory(db);
+
+	try
+	{
+		query = "UPDATE " + collTable + " SET label_x=?, label_y=? WHERE c_object_id=?";
+		
+		if(!objId.empty())
+		{
+			query += " AND c_object_id=?";
+		}
+		
+		tr->Start();
+
+		IBPP::Statement st = IBPP::StatementFactory(db, tr);
+
+		st->Prepare(query);
+
+		do
+		{
+			TeBox box(portal->getDouble(1), portal->getDouble(2), portal->getDouble(3), portal->getDouble(4));
+			std::string oId = portal->getData(0);
+
+			st->Set(1, box.center().x());
+			st->Set(2, box.center().y());
+			st->Set(3, oId);
+
+			if(!objId.empty())
+			{
+				st->Set(4, objId);
+			}
+
+			st->Execute();
+
+		} while(portal->fetchRow());		
+
+		tr->Commit();
+	}
+	catch(IBPP::SQLException& e)
+	{
+		tr->Rollback();
+		errorMsg = e.ErrorMessage();
+		res = false;
+	}
+	catch(IBPP::LogicException& e)
+	{
+		tr->Rollback();
+		errorMsg = e.ErrorMessage();
+		res = false;
+	}
+
+	delete portal;
+	return res;
+}
+
+
+void createGeneratorTrigger(TeFirebird* db)
+{
+	TeDatabasePortal* portal = db->getPortal();
+	std::string sql = "SELECT RDB$TRIGGER_NAME FROM RDB$TRIGGERS WHERE RDB$TRIGGER_NAME = 'REM_AUTO_INCR'";
+
+	if(!portal->query(sql))
+	{
+		throw;
+	}
+
+	bool exists = portal->fetchRow();
+	delete portal;
+
+	if(exists)
+	{
+		sql = "DELETE FROM RDB$TRIGGERS WHERE RDB$TRIGGER_NAME = 'REM_AUTO_INCR'";
+		if(!db->execute(sql))
+		{
+			throw TeException(UNKNOWN_ERROR_TYPE, ("Error removing trigger REM_AUTO_INCR!"));
+		}
+	}
+		
+	sql = "CREATE TRIGGER REM_AUTO_INCR FOR RDB$GENERATORS ";
+	sql += "ACTIVE BEFORE INSERT POSITION 0 ";
+	sql += "AS BEGIN "; 
+	sql += " IF (EXISTS (SELECT RDB$GENERATOR_NAME FROM RDB$GENERATORS WHERE RDB$GENERATOR_NAME = NEW.RDB$GENERATOR_NAME)) THEN ";
+	sql += " DELETE FROM RDB$GENERATORS WHERE RDB$GENERATOR_NAME = NEW.RDB$GENERATOR_NAME;";
+	sql += "END "; 
+
+	if(!db->execute(sql))
+	{
+		throw TeException(UNKNOWN_ERROR_TYPE, ("Error creating trigger to remove generators!"));
+	}
+}
+
+TeFirebird::TeFirebird() :
+TeDatabase()
+{
+	isConnected_ = false;
+	dbmsName_ = "Firebird";
+}
+
+
+TeFirebird::~TeFirebird()
+{
+	if (isConnected_)
+		close ();
+}
+
+IBPP::Database TeFirebird::getIBPPFirebird()
+{
+	return firebird_;
+}
+
+void
+TeFirebird::close()
+{
+	if(firebird_ == NULL)
+	{
+		return;
+	}
+	if(firebird_->Connected())
+	{
+		if(transaction_->Started())
+		{
+			transaction_->Commit();
+		}
+
+		firebird_->Disconnect();
+	}
+}
+
+bool TeFirebird::beginTransaction()
+{
+	transaction_->Start();
+	return true;
+}
+
+bool TeFirebird::commitTransaction()
+{
+	if(transaction_->Started())
+	{
+		transaction_->Commit();
+	}
+
+	return true;
+}
+
+bool TeFirebird::rollbackTransaction()
+{
+	if(transaction_->Started())
+	{
+		transaction_->Rollback();
+	}
+
+	return true;
+}
+
+std::string TeFirebird::mapToFirebirdType(const TeAttribute& teRep) const
+{
+	std::string type;
+
+	switch(teRep.rep_.type_)
+	{
+		case TeREAL:
+			type = "DOUBLE PRECISION";
+		break;
+
+		case TeINT:
+		case TeUNSIGNEDINT:
+			type = "INTEGER ";							
+		break;
+
+		case TeCHARACTER:
+			type = "CHAR(1) ";							
+		break;
+
+		case TeDATETIME:
+			type = "TIMESTAMP ";  //time
+		break;
+
+		case TeBOOLEAN:
+			type = "SMALLINT ";
+		break;
+	
+		case TeBLOB:
+			type = "BLOB SUB_TYPE 0";
+		break;
+
+		case TePOINTTYPE:
+		case TePOINTSETTYPE:
+			type += "x DOUBLE PRECISION DEFAULT 0.0";
+			type += ", y DOUBLE PRECISION DEFAULT 0.0";
+		break;
+
+		case TeLINE2DTYPE:
+		case TeLINESETTYPE:
+			type += "num_coords INTEGER NOT NULL,";
+			type += "lower_x DOUBLE PRECISION NOT NULL,";
+			type += "lower_y DOUBLE PRECISION NOT NULL,";
+			type += "upper_x DOUBLE PRECISION NOT NULL,";
+			type += "upper_y DOUBLE PRECISION NOT NULL,";
+			type += "ext_max DOUBLE PRECISION NOT NULL, ";
+			type += "spatial_data BLOB NOT NULL";
+		break;
+
+		case TePOLYGONTYPE:
+		case TePOLYGONSETTYPE:
+			type += "num_coords INTEGER NOT NULL,";
+			type += "num_holes INTEGER NOT NULL,";
+			type += "parent_id INTEGER NOT NULL,";
+			type += "lower_x DOUBLE PRECISION NOT NULL,";
+			type += "lower_y DOUBLE PRECISION NOT NULL,";
+			type += "upper_x DOUBLE PRECISION NOT NULL,";
+			type += "upper_y DOUBLE PRECISION NOT NULL,";
+			type += "ext_max DOUBLE PRECISION NOT NULL,";
+			type += "spatial_data BLOB NOT NULL";
+		break;
+
+		case TeCELLTYPE:
+		case TeCELLSETTYPE:
+			type += "lower_x DOUBLE PRECISION NOT NULL,";
+			type += "lower_y DOUBLE PRECISION NOT NULL,";
+			type += "upper_x DOUBLE PRECISION NOT NULL,";
+			type += "upper_y DOUBLE PRECISION NOT NULL,";
+			type += "col_number	INTEGER NOT NULL,";
+			type += "row_number	INTEGER NOT NULL ";
+		break;
+
+		case TeRASTERTYPE:
+			type += "lower_x DOUBLE PRECISION NOT NULL, ";
+			type += "lower_y DOUBLE PRECISION NOT NULL, ";
+			type += "upper_x DOUBLE PRECISION NOT NULL, ";
+			type += "upper_y DOUBLE PRECISION NOT NULL, ";
+			type += "band_id INTEGER NOT NULL, ";
+			type += "resolution_factor INTEGER, ";
+			type += "subband INTEGER,";
+			type += "spatial_data BLOB NOT NULL, ";
+			type += "block_size INTEGER NOT NULL ";
+		break;
+
+		case TeNODETYPE:
+		case TeNODESETTYPE:
+			type += "x DOUBLE PRECISION DEFAULT 0.0";
+			type += ", y DOUBLE PRECISION DEFAULT 0.0";
+		break;
+
+		case TeTEXTTYPE:
+		case TeTEXTSETTYPE:
+		case TeSTRING:
+		default:
+			if(teRep.rep_.numChar_ > 0)
+			{
+				type = "VARCHAR(" + Te2String(teRep.rep_.numChar_) + ") ";
+			}
+			else
+			{
+				type = "VARCHAR(4096)"; //de forma que possam ser usadas ate 8 colunas deste tamanho. o tamanho de uma linha = 64K
+			}
+		break;
+	}
+
+	return type;
+}
+
+bool
+TeFirebird::getIndexesFromTable(const string& tableName, std::vector<TeDatabaseIndex>& vecIndexes)
+{
+	
+	std::vector<TeDatabaseIndex> indexes;
+
+	string dbName = this->databaseName();
+
+	string query1 = "select I.RDB$INDEX_NAME as INDEX_NAME, S.RDB$FIELD_NAME as COLUMN_NAME ";
+		query1 += "from RDB$INDICES I, RDB$INDEX_SEGMENTS S ";
+		query1 += "where I.RDB$RELATION_NAME = '"+tableName+"' and I.RDB$INDEX_NAME = S.RDB$INDEX_NAME ";
+		query1 += "and I.RDB$INDEX_NAME not in ( select RDB$INDEX_NAME from RDB$RELATION_CONSTRAINTS ";
+		query1 += "where RDB$INDEX_NAME IS NOT NULL)";
+
+	TeDatabasePortal* portal = getPortal();
+
+	std::vector<std::string> names;
+	std::vector<std::string> cols;
+
+	std::set<std::string> idxNames;
+
+	std::multimap<std::string, std::string> idxAttrs;
+	
+	if(portal->query(query1))
+	{
+		while(portal->fetchRow())
+		{
+			std::string idxName = portal->getData("INDEX_NAME");
+			std::string attrName = portal->getData("COLUMN_NAME");
+
+			idxAttrs.insert(std::pair<std::string, std::string>(idxName, attrName));
+			
+			idxNames.insert(idxName);
+		}		
+
+	}else
+	{
+		delete portal;
+		return false;
+	}
+
+	portal->freeResult();
+
+	delete portal;
+	portal =  NULL;
+
+	std::set<std::string>::iterator it = idxNames.begin();
+	while(it != idxNames.end())
+	{
+		std::string idxName = *it;
+
+		TeDatabaseIndex idxx;
+		idxx.setIndexName(idxName);
+		idxx.setIsPrimaryKey(false);
+		
+		std::vector<string> attNames;
+		std::pair<std::multimap<std::string, std::string>::iterator, std::multimap<std::string, std::string>::iterator> itAttrs = idxAttrs.equal_range(idxName);
+		std::multimap<std::string, std::string>::iterator itA;
+		for (itA=itAttrs.first; itA!=itAttrs.second; ++itA)
+		{
+			std::string attrName = itA->second;
+			attNames.push_back(attrName);
+		}
+
+		idxx.setColumns(attNames);
+
+		indexes.push_back(idxx);
+
+		++it;
+	}	
+
+	vecIndexes = indexes;	
+
+	return true;
+
+}
+
+bool TeFirebird::createAutoIncrement(const std::string& table, const std::string& column)
+{
+	/** Needs to create a generator for firebird to do auto increment. **/
+	/** The name of the generator is composed by the name of table and the column name. **/
+	std::string gen = "CREATE GENERATOR ",
+				genName = ((table.size() <= 28) ? table : table.substr(0, 27))+ "_tr"; 
+	gen += genName + "; \n";
+	
+	if(!execute(gen))
+	{
+		return false;
+	}
+
+	gen = "SET GENERATOR " + genName + " TO 0";
+
+	if(!execute(gen))
+	{
+		return false;
+	}
+
+	gen = "CREATE TRIGGER " + genName + " FOR " + table + " ACTIVE BEFORE ";
+	gen += "INSERT POSITION 0 AS \n" 
+		+ std::string("BEGIN \n ")
+		+ "if((NEW." + column + " is NULL) OR (NEW." + column + "<=0)) then "
+		+ "NEW." + column + " = GEN_ID(" + genName + ", 1); \n END";
+
+	if(!execute(gen))
+	{
+		return false;
+	}
+
+	return true;
+}
+
+int TeFirebird::getLastGeneratedAutoNumber(const std::string& table)
+{
+	int id = -1;
+
+	std::string genName = ((table.size() <= 21) ? table : table.substr(0, 20))+ "_tr"; 
+	genName = TeConvertToUpperCase(genName);
+	std::string sql = "SELECT GEN_ID(" + genName + ",1) FROM RDB$GENERATORS WHERE RDB$GENERATOR_NAME='" + genName + "'";
+
+	TeDatabasePortal* portal = getPortal();
+	
+	if(portal->query(sql) && portal->fetchRow())
+	{
+		id = portal->getInt(0);
+	}
+
+	delete portal;
+
+	sql = "SET GENERATOR " + genName + " TO " + Te2String(id-1);
+	execute(sql);
+
+	return id;
+}
+
+bool TeFirebird::newDatabase(const string& database, const string& user, const string& password, const string& host, const int & port, bool terralibModel, const std::string& characterSet)
+{
+	try
+	{
+#ifdef WIN32
+		DeleteFile((const TCHAR*) database.c_str());
+#else
+		DeleteFile(database.c_str());
+#endif
+		firebird_ = IBPP::DatabaseFactory(host, database, user, password, "", "", "PAGE_SIZE = 8192");
+
+		firebird_->Create(3);		// 3 is the dialect of the database (could have been 1)
+
+		IBPP::Service svc = IBPP::ServiceFactory(host, user, password);
+
+		svc->Connect();
+		svc->SetPageBuffers(database, 256);	// Instead of default 2048
+		svc->SetSweepInterval(database, 5000);	// instead of 20000 by default
+		svc->SetReadOnly(database, false);	// That's the default anyway
+		svc->Disconnect();
+
+		if(!connect(host, user, password, database, port))
+		{
+			firebird_->Drop();
+			return false;
+		}
+		
+		if(terralibModel)
+		{
+			//create conceptual model
+			if(!createConceptualModel())
+			{
+				firebird_->Drop();
+				return false;
+			}
+		}
+	}
+	catch(IBPP::LogicException& e)
+	{
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+	catch(IBPP::SQLException& e)
+	{
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+
+bool 
+TeFirebird::connect (const string& host, const string& user, const string& password, const string& database, int port)
+{
+	try 
+	{
+		firebird_ = IBPP::DatabaseFactory(host, database, user, password);
+		firebird_->Connect();
+
+		isConnected_ = firebird_->Connected();
+
+		if(!isConnected_)
+		{
+			return false;
+		}
+
+		// The following transaction configuration values are the defaults and
+		// those parameters could have as well be omitted to simplify writing.
+		transaction_ = IBPP::TransactionFactory(firebird_, IBPP::amWrite, IBPP::ilConcurrency, IBPP::lrWait);
+
+		user_ = user;
+		host_ = host;
+		password_ = password;
+		database_ = database;
+		portNumber_ = port;
+
+		createGeneratorTrigger(this);
+	}
+	catch(IBPP::SQLException& e)
+	{
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+	catch(IBPP::LogicException& e)
+	{
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+
+bool 
+TeFirebird::showDatabases (const string&/* host*/, const string&/* user*/, const string& /*password*/, vector<string>& /*dbNames*/, int /*port*/)
+{
+	/** There is function for this method in Firebird DBMS. It can't list its own databases. **/
+	return true;
+}
+
+
+bool 
+TeFirebird::execute (const string &q)
+{
+	try
+	{
+		bool started = true;
+
+		if(!transaction_->Started())
+		{
+			transaction_->Start();
+			started = false;
+		}
+
+		IBPP::Statement st = IBPP::StatementFactory(firebird_, transaction_);
+		st->ExecuteImmediate(q);
+
+		(started) ? transaction_->CommitRetain() : transaction_->Commit();
+	}
+	catch(IBPP::SQLException& e)
+	{
+		transaction_->Rollback();
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+	catch(IBPP::LogicException& e)
+	{
+		transaction_->Rollback();
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeFirebird::createTable(const string& table, TeAttributeList &attr)
+{
+	string createStr = " CREATE TABLE " + table + " (";
+	string type;
+	string pkeys,
+		   autoNumColumn;
+
+	for(unsigned int i = 0; i < attr.size(); i++)
+	{
+		if(i>0)
+		{
+			createStr += ",";
+		}
+
+		type = "";
+
+		string name = attr[i].rep_.name_;
+		
+		bool complexType = (attr[i].rep_.type_ == TePOINTTYPE) ||
+							(attr[i].rep_.type_ == TePOINTSETTYPE) ||
+							(attr[i].rep_.type_ == TeLINE2DTYPE) ||
+							(attr[i].rep_.type_ == TeLINESETTYPE) ||
+							(attr[i].rep_.type_ == TePOLYGONTYPE) ||
+							(attr[i].rep_.type_ == TePOLYGONSETTYPE) ||
+							(attr[i].rep_.type_ == TeCELLTYPE) ||
+							(attr[i].rep_.type_ == TeCELLSETTYPE) ||
+							(attr[i].rep_.type_ == TeRASTERTYPE) ||
+							(attr[i].rep_.type_ == TeNODETYPE) ||
+							(attr[i].rep_.type_ == TeNODESETTYPE);
+
+		createStr += (!complexType) ? name + " " + mapToFirebirdType(attr[i]) : mapToFirebirdType(attr[i]);
+
+		if(!(attr[i].rep_.defaultValue_.empty()) && !complexType)
+		{
+			type = " DEFAULT '" + attr[i].rep_.defaultValue_ + "' ";
+		}
+
+		if(!(attr[i].rep_.null_) && !complexType)
+		{
+			type = " NOT NULL ";
+		}
+
+		if(attr[i].rep_.isAutoNumber_)
+		{
+			autoNumColumn = attr[i].rep_.name_;
+		}
+
+		createStr += " " + type;
+
+		// check if column is part of primary key
+		if((attr[i].rep_.isPrimaryKey_) && (attr[i].rep_.type_ != TeBLOB))
+		{
+			if(!pkeys.empty())
+				pkeys += ",";
+
+			pkeys += attr[i].rep_.name_;
+		}
+	}
+
+	if(!pkeys.empty())
+		createStr += ",PRIMARY KEY (" + pkeys + ") ";
+
+	createStr += ")";
+
+	if(!execute(createStr))
+	{
+		return false;
+	}
+
+	if(!autoNumColumn.empty())
+	{
+		if(!createAutoIncrement(table, autoNumColumn))
+		{
+			return  false;
+		}
+	}
+
+	return true;
+}
+
+bool
+TeFirebird::tableExist(const string& table)
+{
+	TeDatabasePortal* portal = getPortal();
+	bool res = true;
+	
+	try
+	{		
+		std::string sql = "SELECT RDB$RELATION_NAME FROM RDB$RELATIONS WHERE RDB$RELATION_NAME='" 
+			+ TeConvertToUpperCase(table) + "'";
+		
+		if(!portal->query(sql))
+		{
+			throw TeException(UNKNOWN_ERROR_TYPE, "Error on query statement.");
+		}
+
+		if(!portal->fetchRow())
+		{
+			res = false;
+		}
+	}
+	catch(TeException& e)
+	{
+		errorMessage_ = e.message();
+		res = false;
+	}
+
+	delete portal;
+
+	return res;
+}
+
+bool 
+TeFirebird::columnExist(const string& table, const string&  column ,TeAttribute& /*attr*/)
+{
+	TeDatabasePortal* portal = getPortal();
+	bool res = true;
+
+	try
+	{
+		std::string sql = "SELECT RDB$FIELD_NAME FROM RDB$RELATION_FIELDS";
+		sql += " WHERE RDB$RELATION_NAME='" + TeConvertToUpperCase(table) + "'";
+		sql += " AND RDB$FIELD_NAME='" + TeConvertToUpperCase(column) + "'";
+
+		if(!portal->query(sql))
+		{
+			throw TeException(UNKNOWN_ERROR_TYPE, "Error on query statement.");
+		}
+
+		if(!portal->fetchRow())
+		{
+			res = false;
+		}
+	}
+	catch(TeException& e)
+	{
+		errorMessage_ = e.message();
+		res = false;
+	}
+
+	delete portal;
+
+	return res;
+}
+
+bool TeFirebird::addColumn (const string& table, TeAttributeRep &rep)
+{
+	string q ="ALTER TABLE " + table +" ADD ";
+	//string type;
+
+	string field = TeGetExtension(rep.name_.c_str());
+	if(field.empty())
+		field = rep.name_;
+
+	bool complexType = (rep.type_ == TePOINTTYPE) ||
+							(rep.type_ == TePOINTSETTYPE) ||
+							(rep.type_ == TeLINE2DTYPE) ||
+							(rep.type_ == TeLINESETTYPE) ||
+							(rep.type_ == TePOLYGONTYPE) ||
+							(rep.type_ == TePOLYGONSETTYPE) ||
+							(rep.type_ == TeCELLTYPE) ||
+							(rep.type_ == TeCELLSETTYPE) ||
+							(rep.type_ == TeRASTERTYPE) ||
+							(rep.type_ == TeNODETYPE) ||
+							(rep.type_ == TeNODESETTYPE);
+
+	TeAttribute attr;
+	attr.rep_ = rep;
+
+	q += (!complexType) ? field + " " + mapToFirebirdType(attr) : mapToFirebirdType(attr);
+
+	if (execute(q))
+	{
+		alterTableInfoInMemory(table);
+		return true;
+	}
+	
+	return false;
+}
+
+bool 
+TeFirebird::alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName)
+{
+	if(!tableExist(tableName))
+		return false;
+
+	string tab;
+
+	if(oldColName.empty())
+	{
+		tab = " ALTER TABLE " + tableName + " ALTER ";		
+	}
+	else
+	{
+		tab = " ALTER TABLE " + tableName + " ALTER ";
+		tab += oldColName + " ";
+	}
+
+	bool complexType = (rep.type_ == TePOINTTYPE) ||
+							(rep.type_ == TePOINTSETTYPE) ||
+							(rep.type_ == TeLINE2DTYPE) ||
+							(rep.type_ == TeLINESETTYPE) ||
+							(rep.type_ == TePOLYGONTYPE) ||
+							(rep.type_ == TePOLYGONSETTYPE) ||
+							(rep.type_ == TeCELLTYPE) ||
+							(rep.type_ == TeCELLSETTYPE) ||
+							(rep.type_ == TeRASTERTYPE) ||
+							(rep.type_ == TeNODETYPE) ||
+							(rep.type_ == TeNODESETTYPE);
+
+	if(!complexType)
+	{
+		tab += rep.name_ +" ";
+	}
+	tab += "TYPE ";
+
+	TeAttribute attr;
+	attr.rep_ = rep;
+
+	tab += mapToFirebirdType(attr);
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error alter table " + tableName + " !";
+		return false;
+	}
+
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + tableName + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+
+	if(tableId.empty() == false)
+	{
+		if(oldColName.empty() == false) // column name changed
+		{
+			 // update relation
+			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
+			sql += " WHERE related_table_id = " + tableId;
+			sql += " AND related_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
+			sql += " WHERE external_table_name = '" + tableName + "'";
+			sql += " AND external_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			 // update grouping
+			sql = "UPDATE te_grouping SET grouping_attr = '" + tableName + "." + rep.name_ + "'";
+			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+		else // column type changed
+		{
+			// delete relation
+			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+			sql += " AND related_attr = '" + rep.name_ + "')";
+			sql += " OR (external_table_name = '" + tableName + "'";
+			sql += " AND external_attr = '" + rep.name_ + "')";
+			if(execute(sql) == false)
+				return false;
+
+			// delete grouping
+			TeDatabasePortal* portal = getPortal();
+			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(portal->query(sql) && portal->fetchRow())
+			{
+				string themeId = portal->getData(0);
+
+				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
+				if(execute(sql) == false)
+				{
+					delete portal;
+					return false;
+				}
+			}
+			delete portal;
+
+			sql = "DELETE FROM te_grouping";
+			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+	}
+
+	alterTableInfoInMemory(tableName);
+	return true;
+}
+
+TeDatabasePortal*  
+TeFirebird::getPortal ()
+{
+	return new TeFirebirdPortal (this);
+}
+
+string TeFirebird::getConcatFieldsExpression(const vector<string>& fNamesVec)
+{
+	std::string value;
+
+	for(unsigned int i = 0; i < fNamesVec.size(); i++)
+	{
+		if(i > 0)
+		{
+			value += " || ";
+		}
+		value += fNamesVec[i];
+	}
+
+	return value;
+}
+
+
+
+
+TeFirebirdPortal::TeFirebirdPortal (TeFirebird* firebird) :
+TeDatabasePortal(),
+currRow_(0)
+{
+	firebird_ = firebird->getIBPPFirebird();
+	numRows_ = 0;
+	numFields_ = 0;
+	db_ = firebird;
+}
+
+
+TeFirebirdPortal::TeFirebirdPortal ( const TeFirebirdPortal& p) : 
+TeDatabasePortal(),
+currRow_(p.currRow_)
+{
+	firebird_ = p.firebird_;
+	numRows_ = 0;
+	numFields_ = 0;
+}
+
+
+TeFirebirdPortal::~TeFirebirdPortal ()
+{
+	freeResult ();
+}
+
+
+string 
+TeFirebird::escapeSequence(const string& from)
+{
+	int  fa = 0;
+	std::string to = from;
+    to.insert(0, " ");
+    std::string::iterator it = to.begin();
+    while(it != to.end())
+    {
+            int f = to.find("'", fa);
+            if(f > fa)
+            {
+                    to.insert(f, "'");
+                    fa = f + 2;
+            }
+            else
+                    break;
+    }
+    to = to.substr(1, to.size() - 1);
+    return to;
+}
+
+bool TeFirebirdPortal::query (const string &q, TeCursorLocation /*l*/, TeCursorType  /*t*/, TeCursorEditType e, TeCursorDataType /*dt*/)
+{
+	currRow_ = 0;
+
+	try
+	{
+		attList_.clear ();
+
+		IBPP::TAM tam = (e == TeREADONLY) ? IBPP::amRead : IBPP::amWrite;
+		transaction_ = IBPP::TransactionFactory(firebird_, tam, IBPP::ilConcurrency, IBPP::lrWait);
+		transaction_->Start();
+		result_ = IBPP::StatementFactory(firebird_, transaction_);
+		result_->Execute(q);
+
+		numFields_ = result_->Columns();
+
+		query_ = q;
+
+		for(int i = 1; i <= numFields_; i++)
+		{
+			TeAttribute att;
+
+			IBPP::SDT ftype = result_->ColumnType(i);
+
+			switch(ftype)
+			{
+				case IBPP::sdInteger :
+				case IBPP::sdLargeint:
+					att.rep_.type_ = TeINT;
+					att.rep_.numChar_ = result_->ColumnSize(i);
+					att.rep_.name_ = result_->ColumnName(i);
+				break;
+
+				case IBPP::sdDouble :
+				case IBPP::sdFloat :
+					att.rep_.type_ = TeREAL;
+					att.rep_.decimals_ = result_->ColumnScale(i);
+					att.rep_.numChar_ = result_->ColumnSize(i);
+				break;
+
+				case IBPP::sdDate :
+				case IBPP::sdTime:
+				case IBPP::sdTimestamp :
+					att.rep_.type_ = TeDATETIME;
+					att.dateTimeFormat_ = "YYYYsMMsDDsHHsmmsSS24";
+					att.dateChronon_ = TeSECOND;
+				break;
+
+				case IBPP::sdSmallint :
+					att.rep_.type_ = TeBOOLEAN;
+					break;
+
+				case IBPP::sdBlob :
+					if(result_->ColumnSubtype(i) == 0)
+					{
+						att.rep_.type_ = TeBLOB;
+					}
+					else
+					{
+						att.rep_.type_ = TeSTRING;
+					}
+				break;
+
+				case IBPP::sdString :
+					att.rep_.type_ = TeSTRING;
+					att.rep_.numChar_ = result_->ColumnSize(i);
+				break;
+
+				default:
+					att.rep_.type_ = TeUNKNOWN;
+				break;
+			}
+
+			att.rep_.name_ = result_->ColumnAlias(i);
+			attList_.push_back(att);
+		}
+	}
+	catch(IBPP::SQLException& e)
+	{
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+	catch(IBPP::LogicException& e)
+	{
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+
+bool 
+TeFirebirdPortal::fetchRow ()
+{
+	bool res = true;
+
+	try
+	{
+		res = result_->Fetch();
+		if(res) 
+		{
+			numRows_++;
+			currRow_++;
+		}
+	}
+	catch(IBPP::LogicException& e)
+	{
+		errorMessage_ = e.ErrorMessage();
+		res = false;
+	}
+
+	return res;
+}
+
+
+bool 
+TeFirebirdPortal::fetchRow (int i)
+{
+	bool res = true;
+
+	if(query_.empty())
+	{
+		return false;
+	}
+
+	if(i == currRow_+1)
+	{
+		res = fetchRow();
+		currRow_++;
+	}
+	else
+	{
+		try
+		{
+			if(!transaction_->Started())
+			{
+				transaction_->Start();
+			}
+
+			int pos = query_.find("SELECT");
+
+			if(pos < 0)
+			{
+				return false;
+			}
+
+			std::string sql = "SELECT SKIP " + Te2String(i) + query_.substr(pos + 6);
+			
+			result_ = IBPP::StatementFactory(firebird_, transaction_);
+
+			result_->Execute(sql);
+			numFields_ = result_->Columns();
+
+			res = fetchRow();
+
+			if(res) 
+			{
+				currRow_ = i;
+			}
+		}
+		catch(IBPP::LogicException& e)
+		{
+			errorMessage_ = e.ErrorMessage();
+			res = false;
+		}
+		catch(IBPP::SQLException& e)
+		{
+			errorMessage_ = e.ErrorMessage();
+			res = false;
+		}
+	}
+
+	return res;
+}
+
+
+void TeFirebirdPortal::freeResult ()
+{
+	numRows_ = 0;
+	numFields_= 0;
+
+	result_ = IBPP::StatementFactory(firebird_, transaction_);
+}
+
+bool TeFirebird::insertProjection (TeProjection *proj)
+{
+	TeProjectionParams par = proj->params();
+
+	int id = getLastGeneratedAutoNumber("te_projection");
+
+	string insert = "INSERT INTO te_projection (projection_id, name, long0, lat0,";
+	insert += " offx, offy, stlat1, stlat2, unit, scale, hemis, datum, ";
+	insert += " radius, flattening, dx , dy, dz ) VALUES ( ";
+	insert += Te2String(proj->id());
+	insert += ", '" + escapeSequence(par.name) + "'";
+	insert += ", " + Te2String(par.lon0*TeCRD,10);
+	insert += ", " + Te2String(par.lat0*TeCRD,10);
+	insert += ", " + Te2String(par.offx,10);
+	insert += ", " + Te2String(par.offy,10);
+	insert += ", " + Te2String(par.stlat1*TeCRD,10);
+	insert += ", " + Te2String(par.stlat2*TeCRD,10);
+	insert += ", '" + escapeSequence(par.units) + "'";
+	insert += ", " + Te2String(par.scale,10);
+	insert += ", " + Te2String(par.hemisphere);
+	insert += ", '" + escapeSequence(par.datum.name()) + "'";
+	insert += ", " + Te2String(par.datum.radius(),10);
+	insert += ", " + Te2String(par.datum.flattening(),10);
+	insert += ", " + Te2String(par.datum.xShift(),10);
+	insert += ", " + Te2String(par.datum.yShift(),10);
+	insert += ", " + Te2String(par.datum.zShift(),10);
+	insert += ")";
+
+	if (!execute(insert))
+	{
+		return false;
+	}
+
+	proj->id(id);
+
+	return true;
+}
+
+bool TeFirebird::updateProjection (TeProjection *proj)
+{
+	if (proj->id() <= 0)
+		return false;
+	string sql;
+	sql = "UPDATE te_projection SET ";
+	sql += "name='" + proj->name() + "',";
+	sql += " long0=" + Te2String(proj->params().lon0*TeCRD)+ ",";
+	sql += " lat0=" + Te2String(proj->params().lat0*TeCRD) + ",";
+	sql += " offx=" +Te2String(proj->params().offx) + ",";
+	sql += " offy=" +Te2String(proj->params().offy) + ",";
+	sql += " stlat1="+ Te2String(proj->params().stlat1*TeCRD) + ",";
+	sql += " stlat2=" +Te2String(proj->params().stlat2*TeCRD) + ",";
+	sql += " unit='" + proj->params().units + "',";
+	sql += " scale=" + Te2String(proj->params().scale) + ",";
+	sql += " hemis=" + Te2String(proj->params().hemisphere) + ",";
+	sql += " datum='" + proj->datum().name() + "',";
+	sql += " radius=" + Te2String(proj->datum().radius()) + ",";
+	sql += " flattening=" + Te2String(proj->datum().flattening()) + ",";
+	sql += " dx=" + Te2String(proj->datum().xShift()) + ",";
+	sql += " dy=" + Te2String(proj->datum().yShift()) + ",";
+	sql += " dz=" + Te2String(proj->datum().zShift()) ;
+	sql += " WHERE projection_id = " + Te2String(proj->id());
+	return execute(sql);
+}
+
+bool
+TeFirebird::insertView (TeView *view)
+{
+	std::string ins;
+	int id = getLastGeneratedAutoNumber("te_view");
+
+	TeProjection* proj = view->projection();
+	if ( !proj || !insertProjection(proj))
+	{
+		errorMessage_ = "N�o � poss�vel inserir vista sem proje��o";
+		return false;
+	}
+	
+	ins = "INSERT INTO te_view (view_id, projection_id, name, user_name, visibility)";
+	ins += " VALUES (";
+	ins += Te2String(view->id());
+	ins += ", " + Te2String(proj->id());
+	ins += ", '" + escapeSequence(view->name ()) + "'";
+	ins += ", '" + escapeSequence(view->user ()) + "'";
+	ins += ", " + Te2String((int)view->isVisible());
+	ins += " )";
+	
+	if(!execute (ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_view!";   
+		return false;
+	}
+
+
+	int size = view->size();
+
+	for (int th=0; th<size; th++)
+	{
+		TeViewNode* node = view->get(th);
+		if (node->type() == TeTHEME)
+		{
+			TeTheme *theme = (TeTheme*) node;
+			insertTheme (theme);
+		}
+		else
+		{
+			TeViewTree* tree = (TeViewTree*)node;
+			insertViewTree (tree);
+		}
+	}
+
+	view->id(id);
+
+	// Insert view in the view map
+	viewMap()[view->id()] = view;
+	return true;
+}
+
+
+bool 
+TeFirebird::insertViewTree (TeViewTree *tree)
+{
+	int id = getLastGeneratedAutoNumber("te_theme");
+
+	string save;
+	save = "INSERT INTO te_theme (name,node_type,view_id,parent_id,priority) VALUES('";
+	save += tree->name() +  "'," + Te2String((int)tree->type()) + "," + Te2String(tree->view()) + 
+		"," + Te2String(tree->parentId()) + "," + Te2String(tree->priority()) + ")";
+	
+	if (!execute(save))
+		return false;
+
+	tree->id(id);
+
+	return true;
+}
+
+
+bool 
+TeFirebird::insertTheme (TeAbstractTheme *tem)
+{
+	string save;
+	save = "INSERT INTO te_theme ";
+	save += "(layer_id, view_id, name, parent_id, priority, node_type, min_scale, max_scale, ";
+	save += "generate_attribute_where, generate_spatial_where, generate_temporal_where, ";
+	save += "collection_table, visible_rep, enable_visibility, lower_x, lower_y, upper_x, upper_y, creation_time) ";
+	save += " VALUES(";
+	
+	if(tem->type()==TeTHEME)
+		save += Te2String(static_cast<TeTheme*>(tem)->layerId()) +", " ;
+	else
+		save += " NULL, ";
+
+	save += Te2String(tem->view()) +", ";
+	save += "'" + escapeSequence(tem->name()) + "', ";
+	save += Te2String(tem->parentId()) +", ";
+	save += Te2String(tem->priority()) +", ";
+	save += Te2String(tem->type()) +", ";
+	save += Te2String(tem->minScale()) +", ";
+	save += Te2String(tem->maxScale()) +", ";
+	save += "'" + escapeSequence(tem->attributeRest()) + "', ";
+	save += "'" + escapeSequence(tem->spatialRest()) + "', ";
+	save += "'" + escapeSequence(tem->temporalRest()) + "', ";
+
+	if(tem->type()==TeTHEME)
+		save += " '" + escapeSequence(static_cast<TeTheme*>(tem)->collectionTable()) + "', ";
+	else
+		save += " '', ";
+
+	save += Te2String(tem->visibleRep()) +", ";
+	save += Te2String(tem->visibility()) +", ";
+	save += Te2String(tem->box().x1(), 10) +", ";
+	save += Te2String(tem->box().y1(), 10) +", ";
+	save += Te2String(tem->box().x2(), 10) +", ";
+	save += Te2String(tem->box().y2(), 10) +",  ";
+
+	TeTime creationTime = tem->getCreationTime();
+	save += getSQLTime(creationTime);
+
+	save += " ) ";
+
+	int id = getLastGeneratedAutoNumber("te_theme");
+	if (!execute(save))
+		return false;
+
+	tem->id(id);
+
+	if((tem->type()==TeTHEME || tem->type()==TeEXTERNALTHEME)&& static_cast<TeTheme*>(tem)->collectionTable().empty())
+	{
+		string colTab = "te_collection_" + Te2String(tem->id());
+		static_cast<TeTheme*>(tem)->collectionTable(colTab);
+		save = "UPDATE te_theme SET collection_table='" + colTab + "' WHERE theme_id=" ;
+		save += Te2String(tem->id());
+		execute(save);
+	}
+	if(tem->parentId() == 0)
+	{
+		std::string sql = "UPDATE te_theme SET";
+		sql += "  parent_id = " + Te2String(tem->id());
+		sql += " WHERE theme_id = ";
+		sql += Te2String(tem->id());
+
+		tem->parentId(tem->id());
+
+		if(!this->execute(sql))
+			return false;
+	}
+
+	bool status;
+
+	// insert grouping
+	int numSlices = 0;
+	if(tem->grouping().groupMode_ != TeNoGrouping)
+	{
+		if(!insertGrouping (tem->id(), tem->grouping()))
+			return false;
+		numSlices = tem->grouping().groupNumSlices_;
+	}
+		
+	tem->outOfCollectionLegend().group(-1); 
+	tem->outOfCollectionLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->outOfCollectionLegend())); 
+	if (!status)
+		return status;
+
+	tem->withoutDataConnectionLegend().group(-2); 
+	tem->withoutDataConnectionLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->withoutDataConnectionLegend())); 
+	if (!status)
+		return status;
+
+	tem->defaultLegend().group(-3); 
+	tem->defaultLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->defaultLegend())); 
+	if (!status)
+		return status;
+
+	tem->pointingLegend().group(-4); 
+	tem->pointingLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->pointingLegend())); 
+	if (!status)
+		return status;
+
+	tem->queryLegend().group(-5); 
+	tem->queryLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->queryLegend())); 
+	if (!status)
+		return status;
+
+	tem->queryAndPointingLegend().group(-6); 
+	tem->queryAndPointingLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->queryAndPointingLegend())); 
+	if (!status)
+		return status;
+
+	for (int i = 0; i < numSlices; i++)
+	{
+		tem->legend()[i].group(i);
+		tem->legend()[i].theme(tem->id());
+		status = insertLegend (&(tem->legend()[i]));
+		if (!status)
+			return status;
+	}
+	if (!status)
+		return status;
+
+	//insert metadata theme
+	if(!tem->saveMetadata(this))
+		return false;
+
+	themeMap()[tem->id()] = tem;
+
+	if(tem->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(tem)))
+		return false;
+
+	return true;
+}
+
+bool 
+TeFirebird::insertThemeGroup (TeViewTree* tree)
+{
+	string save;
+	save = "INSERT INTO te_theme ";
+	save += "(name,parent_id,node_type,view_id,priority) ";
+	save += " VALUES ('" + tree->name() + "',1,1, ";
+	save += Te2String(tree->view()) +", ";
+	save += Te2String(tree->priority()) +") ";
+
+	int id = getLastGeneratedAutoNumber("te_theme");
+
+	if (!execute(save))
+		return false;
+
+	tree->id(id);
+
+	return true;
+}
+
+bool 
+TeFirebird::generateLabelPositions (TeTheme *theme, const std::string& objectId)
+{
+	std::string collTable = theme->collectionTable();
+
+	if((collTable.empty()) || (!tableExist(collTable)))
+	{
+		return false;
+	}
+
+	if (theme->layer()->hasGeometry(TeLINES))
+	{	
+		generateLablesForPolygonal(firebird_, theme, TeLINES, errorMessage_, objectId);
+	}
+
+	if (theme->layer()->hasGeometry(TePOINTS))
+	{
+		std::string geomTable = theme->layer()->tableName(TePOINTS),
+					query = "SELECT object_id, x, y FROM " + geomTable;
+
+		TeDatabasePortal* portal = theme->layer()->database()->getPortal();
+
+		if(!portal->query(query))
+		{
+			throw TeException(UNKNOWN_ERROR_TYPE, "Error on query:\n" + portal->errorMessage());
+		}
+
+		if(!portal->fetchRow())
+		{
+			return true;
+		}
+
+		IBPP::Transaction tr = IBPP::TransactionFactory(firebird_);
+		
+		try
+		{
+			query = "UPDATE " + collTable + " SET label_x=?, label_y=? WHERE c_object_id=?";
+			if(!objectId.empty())
+			{
+				query += " AND c_object_id=?";
+			}
+
+			tr->Start();
+		
+			IBPP::Statement st = IBPP::StatementFactory(firebird_, tr);
+
+			st->Prepare(query);
+
+			do
+			{
+				double x = portal->getDouble(1),
+					y = portal->getDouble(2);
+
+				std::string oId = portal->getData(0);
+
+				st->Set(1, x);
+				st->Set(2, y);
+				st->Set(3, oId);
+				if(!objectId.empty())
+				{
+					st->Set(4, objectId);
+				}
+
+				st->Execute();
+
+			} while(portal->fetchRow());		
+
+			tr->Commit();
+			delete portal;
+		}
+		catch(IBPP::SQLException& e)
+		{
+			tr->Rollback();
+			errorMessage_ = e.ErrorMessage();
+			return false;
+		}
+		catch(IBPP::LogicException& e)
+		{
+			tr->Rollback();
+			errorMessage_ = e.ErrorMessage();
+			return false;
+		}
+
+		return true;
+	}
+	
+	if (theme->layer()->hasGeometry(TePOLYGONS))
+	{	
+		return generateLablesForPolygonal(firebird_, theme, TePOLYGONS, errorMessage_, objectId);
+	}
+	
+	if(theme->layer()->hasGeometry(TeCELLS))
+	{
+		return generateLablesForPolygonal(firebird_, theme, TeCELLS, errorMessage_, objectId);
+	}
+
+	return true;
+}
+
+bool TeFirebird::layerExist	(string layerName)
+{
+	if(layerName.size() > 31)
+	{
+		layerName.erase(30, layerName.size());		
+	}
+
+	return TeDatabase::layerExist(layerName);
+}
+
+bool
+TeFirebird::insertLayer (TeLayer* layer)
+{
+	std::string		ins;
+	char			value[1024];
+
+	TeProjection* proj = layer->projection();
+	if (!proj || !insertProjection(proj))
+	{
+		errorMessage_ = "N�o � poss�vel inserir layer sem proje��o";
+		return false;
+	}
+
+	if(layer->name().size() > 31)
+	{
+		std::string name = layer->name();
+		name.erase(30, name.size());	
+		layer->name(name);
+	}
+
+	ins = "INSERT INTO te_layer (projection_id, name ";
+	ins += ", lower_x, lower_y, upper_x, upper_y, edition_time) ";
+	ins += " VALUES ( ";
+	ins += Te2String(proj->id());
+	ins += ", '" + escapeSequence(layer->name()) + "'";
+
+	sprintf(value,",%g,%g,%g,%g",layer->box().x1(),layer->box().y1(),layer->box().x2(),layer->box().y2());
+	ins +=value;
+
+	TeTime editionTime = layer->getEditionTime();
+	ins += ", " + getSQLTime(editionTime) + ")";
+
+	int id = getLastGeneratedAutoNumber("te_layer");
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_layer!";   
+		return false;
+	}
+
+	layer->id(id);
+
+	layerMap()[layer->id()] = layer;
+	return true;
+}
+
+bool TeFirebird::updateLayer(TeLayer *layer)
+{
+	if (!layer)
+		return false;
+
+	if (layer->projection())
+		updateProjection(layer->projection());
+
+	string sql;
+	sql = "UPDATE te_layer SET ";
+	sql += "name = '" + layer->name() + "' ";
+	if (layer->box().isValid())
+	{
+		sql += ", lower_x = " + Te2String(layer->box().x1()) + " ";
+		sql += ", lower_y = " + Te2String(layer->box().y1()) + " ";
+		sql += ", upper_x = " + Te2String(layer->box().x2()) + " ";
+		sql += ", upper_y = " + Te2String(layer->box().y2()) + " ";
+	}else
+	{
+		sql += ", lower_x = " + Te2String(layer->box().x1()) + " ";
+		sql += ", lower_y = " + Te2String(layer->box().y1()) + " ";
+		sql += ", upper_x = " + Te2String(layer->box().x2()) + " ";
+		sql += ", upper_y = " + Te2String(layer->box().y2()) + " ";
+	}
+	if(layer->getEditionTime().isValid())
+	{
+		TeTime editionTime = layer->getEditionTime();
+		sql += ", edition_time = " + this->getSQLTime(editionTime);
+	}
+
+	sql +=  " WHERE layer_id = " + Te2String(layer->id());
+
+	return (this->execute (sql));
+}
+
+bool TeFirebird::insertProject (TeProject* project)
+{
+	if (!project)
+		return false;
+
+	string save = "INSERT INTO te_project (project_id, name, description, current_view) VALUES(0,";
+	save += "'" + project->name() + "', ";
+	save += "'" + project->description() + "', ";
+	save += Te2String(project->getCurrentViewId())+ ")";
+
+	int id = getLastGeneratedAutoNumber("te_project");
+
+	// if layer insertion fails remove projection
+	if (!execute (save))
+		return false;
+	
+	project->setId(id);
+
+	projectMap()[project->id()] = project;
+	for (unsigned int i=0; i<project->getViewVector().size(); i++)
+		insertProjectViewRel(project->id(), project->getViewVector()[i]);
+
+	return true;
+}
+
+bool TeFirebird::updateRepresentation (int layerId, TeRepresentation& rep)
+{
+	if (layerId <= 0)
+		return false;
+
+	string sql;
+	sql  = "UPDATE te_representation SET ";
+	sql += " lower_x= " + Te2String(rep.box_.x1());
+	sql += ", lower_y= " + Te2String(rep.box_.y1());
+	sql += ", upper_x= " + Te2String(rep.box_.x2());
+	sql += ", upper_y= " + Te2String(rep.box_.y2());
+	sql += ", description= '" + rep.description_ + "'";
+	sql += ", res_x= " + Te2String(rep.resX_);
+	sql += ", res_y= " + Te2String(rep.resY_);
+	sql += ", num_cols=" + Te2String(rep.nCols_);
+	sql += ", num_rows=" + Te2String(rep.nLins_);
+
+	if (rep.geomRep_ != TeTEXT)
+		sql += ", geom_table='" + rep.tableName_ + "'";
+
+	sql += " WHERE layer_id=" + Te2String(layerId);
+	sql += " AND geom_type= " + Te2String(rep.geomRep_);
+
+	if (rep.geomRep_ == TeTEXT)
+		sql += " AND geom_table='" + rep.tableName_ + "'";
+
+	return execute(sql);
+}
+
+bool TeFirebird::insertRasterGeometry(const string& tableName, TeRasterParams& par, const string& objectId)
+{
+	if (tableName.empty())
+		return false;
+	
+	string objId; 
+	if (objectId.empty())
+		objId = "O1";
+	else
+		objId = objectId;
+
+	//------ this check is made for compatibility reasons with old versions of TerraLib databases
+	TeAttributeRep	attrRep;
+	attrRep.name_ = "tiling_type";
+	attrRep.type_ = TeINT;
+		
+	TeAttribute att;
+	if(!columnExist(tableName, attrRep.name_,att))
+	{
+		addColumn (tableName, attrRep);
+		string sql = "UPDATE " + tableName + " SET tiling_type = " + Te2String(static_cast<int>(TeRasterParams::TeExpansible));
+		this->execute(sql);
+	}
+
+	//------
+
+	// finds the name of the raster geometry table
+	TeDatabasePortal* portal = getPortal();
+	//if(!portal)
+	//	return false;
+
+	TeBox box = par.boundingBox();
+
+	string ins = "INSERT INTO " + tableName + " (object_id, raster_table, lut_table, ";
+	ins += "res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, ";
+	ins += "lower_x, lower_y, upper_x, upper_y, tiling_type) ";
+	ins += " VALUES ('" + objId + "', '" + par.fileName_+ "', '" +  par.lutName_ + "', ";
+	ins += Te2String(par.resx_) + ", " + Te2String(par.resy_) + ", ";
+	ins += Te2String(par.nBands()) + ", " + Te2String(par.ncols_) + ", " + Te2String(par.nlines_) + ", ";
+	ins += Te2String(par.blockHeight_) + ", " + Te2String(par.blockWidth_) + ", ";
+	ins += Te2String(box.x1_) +", " + Te2String(box.y1_) + ", ";
+	ins += Te2String(box.x2_) +", " + Te2String(box.y2_) + ", ";
+	ins	+= Te2String(par.tiling_type_) + ")";
+	if (!this->execute(ins))
+	{
+		delete portal;
+		return false;
+	}
+
+	// save the pallete associated to the raster
+	// if it doesn?t exist yet
+	if (par.photometric_[0] == TeRasterParams::TePallete && !par.lutName_.empty()) 
+	{
+		 if (!this->tableExist(par.lutName_))
+		 {
+			 if (this->createLUTTable(par.lutName_))
+			{
+				for (unsigned int i=0; i<par.lutb_.size(); i++)
+				{
+					string sql = "INSERT INTO " + par.lutName_ + " VALUES(";
+					sql += Te2String(i) + ", ";
+					sql += Te2String(par.lutr_[i]) + ", ";
+					sql += Te2String(par.lutg_[i]) + ", ";
+					sql += Te2String(par.lutb_[i]) + ", '";
+					sql += par.lutClassName_[i] + "')";
+					this->execute(sql);
+				}
+			 }
+		 }
+	}
+	
+	ins = "SELECT geom_id FROM " + tableName + " WHERE object_id='" + objId + "'";
+	ins += " AND raster_table='" + par.fileName_+ "'";
+	if(!portal->query(ins) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	int geomId = atoi(portal->getData(0));
+	delete portal;
+	string 	metadataTableName = tableName+"_metadata";
+	insertRasterMetadata(metadataTableName, geomId,par);
+	 return true;
+}
+
+bool TeFirebird::updateRasterRepresentation(int layerId, TeRasterParams& par, const string& objectId)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+
+	string sql = "SELECT repres_id, lower_x, lower_y, upper_x, upper_y, geom_table ";
+	sql += " FROM te_representation WHERE layer_id= " + Te2String(layerId);
+	sql += " AND geom_type= " + Te2String(TeRASTER);
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	TeBox box (portal->getDouble(1),portal->getDouble(2),
+		       portal->getDouble(3),portal->getDouble(4));
+	int represId = atoi(portal->getData(0));
+	string rasterrep = portal->getData(5);
+	portal->freeResult();
+
+	updateBox(box,par.boundingBox());
+	sql = "UPDATE te_representation SET lower_x = " + Te2String(box.x1_);
+	sql += ", lower_y = " + Te2String(box.y1_) + ", upper_x = " + Te2String(box.x2_);
+	sql += ", upper_y = " + Te2String(box.y2_);
+
+	if(par.date_.isValid())
+	{	
+		std::string sqlTime = getSQLTime(par.date_);
+		if(!sqlTime.empty())
+		{
+			sql += ", initial_time = " + sqlTime;
+			sql += ", final_time = " + sqlTime;
+		}
+	}
+	sql += " WHERE repres_id=" + Te2String(represId);
+	if(!execute(sql))
+	{
+		delete portal;
+		return false;
+	}	 
+
+	string objId; 
+	if (objectId.empty())
+		objId = "O1";
+	else
+		objId = objectId;
+
+	box = par.boundingBox();
+
+	sql = "UPDATE " + rasterrep + " SET lut_table ='" + par.lutName_ + "'";
+	sql += ", res_x= " + Te2String(par.resx_) + ", res_y=" + Te2String(par.resy_);
+	sql += ", num_bands=" + Te2String(par.nBands()) + ", num_cols=" + Te2String(par.ncols_);
+	sql += ", num_rows=" + Te2String(par.nlines_) + ", block_height=" +  Te2String(par.blockHeight_);
+	sql += ", block_width= " + Te2String(par.blockWidth_) + ", lower_x = " + Te2String(box.x1_);
+	sql += ", lower_y = " + Te2String(box.y1_) +  ", upper_x = " + Te2String(box.x2_);
+	sql += ", upper_y = " + Te2String(box.y2_);
+	sql += "  WHERE object_id='" + objId + "' AND raster_table='" + par.fileName_ + "'";
+	if (!this->execute(sql))
+	{
+		delete portal;
+		return false;
+	}
+	
+	sql = "SELECT geom_id FROM " + rasterrep + " WHERE object_id='" + objId + "'";
+	sql+= " AND raster_table='" + par.fileName_+ "'";
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	// save the pallete associated to the raster
+	// if it doesn�t exist yet
+	if (par.photometric_[0] == TeRasterParams::TePallete && !par.lutName_.empty()) 
+	{
+
+		 if (!this->tableExist(par.lutName_))
+		 {
+			 if (this->createLUTTable(par.lutName_))
+			{
+				for (unsigned int i=0; i<par.lutb_.size(); i++)
+				{
+					string sql = "INSERT INTO " + par.lutName_ + " VALUES(";
+					sql += Te2String(i) + ", ";
+					sql += Te2String(par.lutr_[i]) + ", ";
+					sql += Te2String(par.lutg_[i]) + ", ";
+					sql += Te2String(par.lutb_[i]) + ", '";
+					sql += par.lutClassName_[i] + "')";
+					if (!this->execute(sql) )	
+					{
+						delete portal;
+						return false;						
+					}
+				}
+			 }
+		 }
+	}
+
+	int geomId = atoi(portal->getData(0));
+	delete portal;
+	string metadatatabel = rasterrep + "_metadata";
+	return updateRasterMetadata(metadatatabel,geomId,par);
+}
+
+bool TeFirebird::insertLegend (TeLegendEntry *legend)
+{
+//	if(legend->id())
+	string ins = "INSERT INTO te_legend (legend_id, theme_id, group_id, ";
+	ins += " num_objs, lower_value, upper_value, label) VALUES (0";
+//	ins += Te2String(legend->id());
+	ins += ", " + Te2String(legend->theme());
+	ins += ", " + Te2String(legend->group());
+	ins += ", " + Te2String(legend->count());
+	ins += ", '" + escapeSequence(legend->from()) + "'";
+	ins += ", '" + escapeSequence(legend->to()) + "'";
+	ins += ", '" + escapeSequence(legend->label()) + "'";
+	ins += ")";
+		
+	int id = getLastGeneratedAutoNumber("te_legend");
+
+	if (!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_legend!"; 
+		return false;
+	}
+		
+	legend->id(id);
+
+	legendMap()[legend->id()] = legend;
+	return insertVisual(legend);
+}
+
+
+bool
+TeFirebird::insertRepresentation (int layerId, TeRepresentation& rep)
+{
+	if (layerId <= 0)
+		return false;
+	
+	string ins;
+
+	try
+	{
+		char value[1024];
+
+		ins = " INSERT INTO te_representation (repres_id, layer_id, geom_type, geom_table, ";
+		ins += " description, lower_x, lower_y, upper_x, upper_y, res_x, res_y, num_cols, ";
+		ins += " num_rows) VALUES (";
+		ins += Te2String(rep.id_);
+		ins += ", " + Te2String(layerId);
+		ins += ", " + Te2String(static_cast<int>(rep.geomRep_));
+		ins += ", '" + escapeSequence(rep.tableName_) + "'";
+		ins += ", '" + escapeSequence(rep.description_) + "'";
+
+		sprintf(value,",%g,%g,%g,%g",rep.box_.x1(),rep.box_.y1(),rep.box_.x2(),rep.box_.y2());
+		ins += value;
+		ins += ", " + Te2String(rep.resX_,10);
+		ins += ", " + Te2String(rep.resY_,10);
+		ins += ", " + Te2String(rep.nCols_);
+		ins += ", " + Te2String(rep.nLins_);
+		ins += ")";
+
+		int id = getLastGeneratedAutoNumber("te_representation");
+
+		if(!execute(ins))
+		{
+			if(errorMessage_.empty())
+				errorMessage_ = "Error inserting in the table te_representation!";   
+			return false;
+		}
+
+		rep.id_ = id;
+	}
+	catch(IBPP::SQLException& e)
+	{
+		errorMessage_ = "Error inserting in the table te_representation.\n";
+		errorMessage_ += e.ErrorMessage();
+
+		return false;
+	}
+	catch(IBPP::LogicException& e)
+	{
+		errorMessage_ = "Error inserting in the table te_representation.\n";
+		errorMessage_ += e.ErrorMessage();
+
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeFirebird::insertRelationInfo(const int tableId, const string& tField,
+						    const string& eTable, const string& eField, int& relId)
+{
+	//// check if relation already exists
+	TeDatabasePortal* portal = getPortal();
+
+	relId = -1;
+	string sel = "SELECT relation_id FROM te_tables_relation WHERE";
+	sel += " related_table_id = " + Te2String(tableId);
+	sel += " AND related_attr = '" + tField + "'";
+	sel += " AND external_table_name = '" + eTable + "'";
+	sel += " AND external_attr = '" + eField + "'";
+
+	if (!portal->query(sel))
+	{
+		delete portal;
+		return false;
+	}
+
+	if (portal->fetchRow())
+	{
+		relId = atoi(portal->getData(0));
+		delete portal;
+		return true;
+	}
+
+	delete portal;
+
+	string sql = "INSERT INTO te_tables_relation(related_table_id, related_attr, external_table_name, external_attr) ";
+	sql += " VALUES( ";
+	sql += Te2String(tableId);
+	sql += ",'" + tField + "'";
+	sql += ",'" + eTable + "'";
+	sql += ",'" + eField + "')";
+
+	relId = getLastGeneratedAutoNumber("te_tables_relation");
+
+	if (!execute(sql))
+		return false;
+
+	return true;
+}
+
+bool 
+TeFirebird::insertTable(TeTable &table)
+{
+	string tableName = table.name();
+	int size = table.size();
+	TeAttributeList att = table.attributeList();
+	TeAttributeList::iterator it = att.begin();
+	TeAttributeList::iterator itEnd = att.end();
+	TeTableRow row;
+
+	
+	int realMaxSize = 15; //limitacao do firebird. 18 digitos, sem contar o separador decimal
+	if(firebird_->Dialect() == 3)
+	{
+		realMaxSize = 18;
+	}
+
+	
+	if (!beginTransaction())
+		return false;
+
+	int i;
+	unsigned int j;
+	for ( i = 0; i < size; i++ )	
+	{
+		row = table[i];
+		it = att.begin();
+		string attrs;
+		string values;
+		j = 1;
+		unsigned int jj = 0;
+		while ( it != itEnd )
+		{
+			TeAttributeRep rep = (*it).rep_;
+			if ((jj>=row.size()) || row[jj].empty() || (*it).rep_.isAutoNumber_)
+			{
+				++it;
+				j++;
+				jj++;
+				continue;
+			}
+			
+			if (!values.empty())
+			{
+				attrs += ", ";
+				values += ", ";
+			}			
+			attrs += (*it).rep_.name_;			
+
+			std::string strValue,
+						temp_dt;
+			TeTime t;
+
+			int maxSizeToUse = realMaxSize;
+
+			switch ((*it).rep_.type_)
+			{
+				case TeSTRING:
+					values += "'"+ escapeSequence( row[jj] ) +"'";
+				break;
+
+				case TeREAL:
+					strValue = row[jj];
+					replace(strValue.begin(), strValue.end(), ',', '.');
+					if((int)strValue.size() > realMaxSize)
+					{
+						basic_string <char>::size_type index;
+						if ( (index=strValue.find(".")) != string::npos )
+						{
+							maxSizeToUse += 1;// caso tenha separador decinal, podemos usar mais um caractere
+						}
+						strValue = strValue.substr(0, maxSizeToUse);
+					}
+					else
+					{
+						strValue = row[jj];
+					}
+
+					values += strValue;
+				break;
+
+				case TeINT:
+					values += row[jj];
+				break;
+
+				case TeDATETIME:
+					temp_dt = string(row[jj].c_str());
+					t = TeTime(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
+					values += getSQLTime(t);
+				break;
+
+				case TeCHARACTER:
+					values += "'" + escapeSequence(row[jj]) + "'";
+				break;
+
+				case TeBOOLEAN:
+				{
+					std::string value = "0";
+					if(row[jj] == "1" || TeConvertToLowerCase(row[jj]) == "t" || TeConvertToLowerCase(row[jj]) == "true")
+					{
+						value = "1";
+					}
+					values += value;
+				}
+				break;
+
+				case TeBLOB:
+					values += "'" + escapeSequence(row[jj]) + "'";
+				break;
+
+				default:
+					values += "'"+ escapeSequence(row[jj]) +"'";
+			}
+			++it;
+			j++;
+			jj++;
+		}
+
+		if (values.empty()) 
+			continue;
+
+		string q = "INSERT INTO "+tableName + " ("+ attrs+") " + " VALUES ("+values+") ";
+		if (!execute(q)) 
+			continue;
+	}
+
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+
+	return true;
+}
+
+bool
+TeFirebird::updateTable(TeTable &table)
+{
+	TeAttributeList& att = table.attributeList();
+	unsigned int i;
+	string uniqueVal;
+	bool isUniqueValString = false;
+	
+	if (!beginTransaction())
+		return false;
+
+	string uniqueName = table.uniqueName(); // primary key explicitly defined or 
+	if (table.uniqueName().empty())			// check in the attribute list
+	{								
+		for (i=0; i<att.size(); ++i)
+			if (att[i].rep_.isPrimaryKey_)
+			{
+				uniqueName = att[i].rep_.name_;
+				table.setUniqueName(uniqueName);
+				break;
+			}
+	}
+
+	TeAttributeList::iterator it;
+	TeTableRow row;
+	unsigned int j;
+	bool useComma = false;
+	for (i = 0; i < table.size(); i++  )
+	{
+		row = table[i];
+		it = att.begin();
+		string q;
+		j = 1;
+		int jj = 0;
+		while ( it != att.end() )
+		{
+			if (uniqueName != (*it).rep_.name_)
+			{
+				if ((*it).rep_.isAutoNumber_)
+				{
+					++it;
+					j++;
+					jj++;
+					continue;
+				}			
+				if(useComma == true)
+				{
+					q += ", ";
+				}
+				else
+				{
+					useComma = true;
+				}
+				q += (*it).rep_.name_ + " = ";
+				  				
+				if(row[jj].empty())
+				{
+					q += " null";
+
+					++it;
+					j++;
+					jj++;
+					continue;
+				}
+
+  				switch ((*it).rep_.type_)
+  				{
+  					case TeSTRING:
+						q += "'"+escapeSequence(row[jj])+"'";
+  					break;
+  					case TeREAL:
+					{
+						std::string value = row[jj];
+						replace(value.begin(), value.end(), ',', '.');
+						q += value;
+					}
+  					break;
+  					case TeINT:
+						q += row[jj];
+  					break;
+					case TeDATETIME:
+					{
+						const string temp_dt = string(row[jj].c_str());
+						TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
+						q += this->getSQLTime(t);
+					}
+  					break;
+					case TeCHARACTER:
+						q += "'" + escapeSequence(row[jj]) + "'";
+  					break;
+					case TeBLOB:
+						q += "'" + escapeSequence(row[jj]) + "'";
+					break;
+  					default:
+						q += "'"+escapeSequence(row[jj])+"'";
+  					break;
+  				}
+			}
+			else
+			{
+				uniqueVal = row[jj];
+				isUniqueValString = ((*it).rep_.type_ == TeSTRING);
+			}
+			++it;
+			j++;
+			jj++;
+		}
+		if (q.empty())
+			continue;
+		
+		if (!uniqueName.empty() && !uniqueVal.empty())  
+		{
+			if(isUniqueValString)
+				q += " WHERE " + uniqueName + " = '" + uniqueVal +"'";
+			else
+				q += " WHERE " + uniqueName + " = " + uniqueVal;
+		}
+		string sql = "UPDATE "+ table.name() + " SET " + q;
+		if (!execute(sql))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeFirebird::insertTableInfo (int layerId, TeTable &table, const string& user)
+{
+	string sql;
+
+	sql = "INSERT INTO te_layer_table (unique_id, attr_link,attr_initial_time, attr_final_time, attr_time_unit,attr_table_type, ";
+	sql += " user_name, attr_table ";
+	if (layerId > 0)
+		sql += ",layer_id";
+	sql += ") VALUES( ";
+	sql += "'" + table.uniqueName() + "', ";
+	sql += "'" + table.linkName() + "', ";
+	sql += "'" + table.attInitialTime() + "', ";
+	sql += "'" + table.attFinalTime() + "', ";
+	sql += "" + Te2String(table.attTimeUnit()) + ", ";
+	sql += ""+ Te2String(table.tableType()) + ", ";
+	sql += "'" + user + "','" + table.name() +"'";
+	if (layerId > 0)
+		sql += ", " + Te2String(layerId) ;
+	sql += ")";
+
+	int id = getLastGeneratedAutoNumber("te_layer_table");
+
+	if (!execute(sql))
+		return false;
+
+	table.setId(id);
+
+	return true;
+}
+
+bool
+TeFirebird::updateTheme (TeAbstractTheme *theme)
+{
+	string sql;
+
+	if (theme->id() <= 0 )  // theme doesn?t exist in the database yet
+	{
+		return this->insertTheme(theme);
+	}
+	
+	// update theme metadata
+	sql = "UPDATE te_theme SET ";
+	
+	if(theme->type()==TeTHEME)
+	{
+		sql += " layer_id=" + Te2String (static_cast<TeTheme*>(theme)->layerId());
+		sql += ", ";
+	}
+	
+	sql += "  view_id=" + Te2String (theme->view());
+	sql += ", name='" + escapeSequence(theme->name())+"'";
+	sql += ", parent_id=" + Te2String (theme->parentId());
+	sql += ", priority=" + Te2String (theme->priority());
+	sql += ", node_type=" + Te2String (theme->type());
+	sql += ", min_scale=" + Te2String (theme->minScale());
+	sql += ", max_scale=" + Te2String (theme->maxScale());
+	sql += ", generate_attribute_where='" + escapeSequence(theme->attributeRest())+"'";
+	sql += ", generate_spatial_where='" + escapeSequence(theme->spatialRest())+"'";
+	sql += ", generate_temporal_where='" + escapeSequence(theme->temporalRest())+"'";
+
+	if(theme->type()==TeTHEME || theme->type()==TeEXTERNALTHEME )
+		sql += ", collection_table='" + static_cast<TeTheme*>(theme)->collectionTable() + "'";
+
+	sql += ", visible_rep= " + Te2String(theme->visibleRep ());
+	sql += ", enable_visibility= " + Te2String(theme->visibility()); 
+	sql += ", lower_x = " + Te2String(theme->box().x1()); 
+	sql += ", lower_y = " + Te2String(theme->box().y1()); 
+	sql += ", upper_x = " + Te2String(theme->box().x2()); 
+	sql += ", upper_y = " + Te2String(theme->box().y2()); 
+	
+	if(theme->getCreationTime().isValid())
+	{
+		TeTime creationTime = theme->getCreationTime();
+		sql += ", creation_time = " + this->getSQLTime(creationTime);
+	}
+
+	sql += " WHERE theme_id=" + Te2String (theme->id());
+
+	if (!this->execute (sql))
+		return false;
+         
+	//delete grouping 
+	sql = "DELETE FROM te_grouping WHERE theme_id= "+ Te2String(theme->id());
+	this->execute (sql);
+		
+	if(theme->grouping().groupMode_ != TeNoGrouping)
+	{
+		if(!insertGrouping(theme->id(), theme->grouping()))
+			return false;
+	}
+	
+	// update each of its legends
+	bool status = true;
+	
+	if(theme->legend().size() == 0)
+	{
+		if(!deleteLegend(theme->id()))
+			return false;
+	}
+	else
+	{
+		status = updateLegend(theme->legend());
+		if (!status)
+			return status;
+	}
+
+	status = updateLegend(&(theme->withoutDataConnectionLegend()));
+	if (!status)
+		return status;
+
+	status = updateLegend(&(theme->outOfCollectionLegend()));
+	if (!status)
+		return status;
+
+	status = updateLegend(&(theme->defaultLegend()));
+	if (!status)
+		return status;
+
+	status = updateLegend(&(theme->pointingLegend()));
+	if (!status)
+		return status;
+
+	status = updateLegend(&(theme->queryLegend()));
+	if (!status)
+		return status;
+
+	status = updateLegend(&(theme->queryAndPointingLegend()));
+	if (!status)
+		return status;
+	
+	//insert metadata theme
+	if(!theme->saveMetadata(this))
+		return false;
+
+	// theme tables
+	if(theme->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(theme)))
+		return false;
+
+	return true;
+}
+
+bool 
+TeFirebird::insertThemeTable (int themeId, int tableId, int relationId, int tableOrder)
+{
+	string relId;
+	if (relationId > 0)
+		relId = Te2String(relationId);
+	else
+		relId = "NULL";
+
+	string sql = "INSERT INTO te_theme_table VALUES (0,";
+	sql += Te2String(themeId) + "," + Te2String(tableId) + ",";
+	sql += relId + "," + Te2String(tableOrder) + ")";
+
+	if (!execute(sql))
+		return false;
+
+	return true;
+}
+
+bool 
+TeFirebird::insertPolygon (const string& table, TePolygon &poly )
+{
+	try
+	{
+		IBPP::Blob blob = IBPP::BlobFactory(firebird_, transaction_);
+
+				// insert data
+		std::string ins = "INSERT INTO " + table + " ( ";
+		ins += "object_id, num_coords, num_holes, ";
+		ins += " parent_id, lower_x, lower_y, upper_x, upper_y, "; 
+		ins += " ext_max, spatial_data) VALUES (?,?,?,?,?,?,?,?,?,?)";
+
+		IBPP::Statement st = IBPP::StatementFactory(firebird_, transaction_, ins);
+		st->Prepare(ins);
+
+		int polyGeomId = -1; 
+		
+		for(unsigned int i=0; i<poly.size(); i++)
+		{
+			string obId = escapeSequence(poly.objectId());
+			TeBox b = poly.box();
+
+			saveLineInBlob(blob, poly[i]);
+			int geomId = getLastGeneratedAutoNumber(table);
+			poly[i].geomId(geomId);
+
+			if(i == 0)
+			{
+				polyGeomId = geomId;
+			}
+
+			st->Set(1,obId);
+			st->Set(2, (int)poly[i].size());
+			st->Set(3, (i != 0) ? 0 : (int)poly.size()-1);
+			st->Set(4, polyGeomId);
+			st->Set(5, b.lowerLeft().x());
+			st->Set(6, b.lowerLeft().y());
+			st->Set(7, b.upperRight().x());
+			st->Set(8, b.upperRight().y());
+			st->Set(9, MAX(b.width(), b.height()));
+			st->Set(10, blob);
+
+			st->Execute();
+		}
+	}
+	catch(IBPP::SQLException& e1)
+	{
+		errorMessage_ = e1.ErrorMessage();
+		return false;
+	}
+	catch(IBPP::LogicException& e1)
+	{
+		errorMessage_ = e1.ErrorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeFirebird::updatePolygon (const string& table, TePolygon &poly )
+{
+	try
+	{
+		IBPP::Blob blob = IBPP::BlobFactory(firebird_, transaction_);
+
+				// insert data
+		std::string ins = "UPDATE " + table + " SET ";
+		ins += "object_id=?, num_coords=?, num_holes=?, ";
+		ins += " parent_id=?, lower_x=?, lower_y=?, upper_x=?, upper_y=?, "; 
+		ins += " ext_max=?, spatial_data=? WHERE geom_id = " + Te2String(poly.geomId());
+
+		IBPP::Statement st = IBPP::StatementFactory(firebird_, transaction_, ins);
+		st->Prepare(ins);
+
+		for(unsigned int i=0; i<poly.size(); i++)
+		{
+			string obId = escapeSequence(poly.objectId());
+			TeBox b = poly.box();
+
+			saveLineInBlob(blob, poly[i]);
+
+			st->Set(1, obId);
+			st->Set(2, (int)poly[i].size());
+			st->Set(3, (i != 0) ? 0 : (int)poly.size()-1);
+			st->Set(4, poly[0].geomId());
+			st->Set(5, b.lowerLeft().x());
+			st->Set(6, b.lowerLeft().y());
+			st->Set(7, b.upperRight().x());
+			st->Set(8, b.upperRight().y());
+			st->Set(9, MAX(b.width(), b.height()));
+			st->Set(10, blob);
+
+			st->Execute();
+		}
+	}
+	catch(IBPP::SQLException& e1)
+	{
+		errorMessage_ = e1.ErrorMessage();
+		return false;
+	}
+	catch(IBPP::LogicException& e1)
+	{
+		errorMessage_ = e1.ErrorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeFirebirdPortal::fetchGeometry (TePolygon& poly)
+{
+	int geomId = getInt("geom_id");
+	string oId = getData("object_id");
+
+	TeBox b(getDouble("lower_x"), getDouble("lower_y"), getDouble("upper_x"), getDouble("upper_x"));
+
+	TeLinearRing l;
+
+	loadFromBlob(result_, l);
+	l.geomId(geomId);
+
+	poly.geomId(geomId);
+	poly.objectId (oId);
+	poly.add (l);
+
+	int parentId = poly.geomId();
+
+	while (fetchRow())
+	{
+		if (getInt("parent_id") == parentId)
+		{
+			TeLinearRing hole;
+			loadFromBlob(result_, hole);
+
+			hole.geomId(getInt("geom_id"));
+			hole.objectId (getData("object_id"));
+
+			poly.add (hole);
+		}
+		else
+			return true;
+	}
+
+	return false;
+}
+
+bool 
+TeFirebirdPortal::fetchGeometry (TePolygon& poly, const unsigned int& initIndex)
+{
+	TeLinearRing l;
+
+	loadFromBlob(result_, l);
+
+	poly.geomId(getInt(initIndex));
+	poly.objectId (getData(initIndex+1));
+	poly.add (l);
+
+	int parentId = poly.geomId();
+
+	while (fetchRow())
+	{
+		if (getInt(initIndex+4) == parentId)
+		{
+			l.clear();
+			loadFromBlob(result_, l);
+			l.geomId(getInt(initIndex));
+			l.objectId (getData(initIndex+1));
+
+			poly.add (l);
+		}
+		else
+			return true;
+	}
+
+	return false;
+}
+
+
+TeLinearRing 
+TeFirebirdPortal::getLinearRing (int &/*ni*/)
+{
+	int index = atoi(getData("geom_id"));
+	string object_id = getData("object_id");
+	//int np = atoi (getData("num_coords"));
+	TeBox b (getDouble("lower_x"),getDouble("lower_y"),getDouble("upper_x"),getDouble("upper_y"));
+	TeLinearRing line;
+
+	loadFromBlob(result_, line);
+
+	line.objectId(object_id);
+	line.geomId (index);
+	line.setBox (b);
+	
+	return line;
+}
+
+bool 
+TeFirebird::insertLine (const string& table, TeLine2D &l)
+{
+	try
+	{
+		IBPP::Blob blob = IBPP::BlobFactory(firebird_, transaction_);
+
+				// insert data
+		std::string ins = "INSERT INTO " + table + " ( ";
+		ins += " object_id, num_coords, ";
+		ins += " lower_x, lower_y, upper_x, upper_y, "; 
+		ins += " ext_max, spatial_data) VALUES (?,?,?,?,?,?,?,?)";
+
+		IBPP::Statement st = IBPP::StatementFactory(firebird_, transaction_, ins);
+		st->Prepare(ins);
+
+		std::string obId = escapeSequence(l.objectId());
+		TeBox b = l.box();
+
+		int index = getLastGeneratedAutoNumber(table);
+	
+		TeLinearRing ring;
+		ring.copyElements(l);
+
+		saveLineInBlob(blob, ring);
+
+		st->Set(1, obId);
+		st->Set(2, (int)ring.size());
+		st->Set(3, b.lowerLeft().x());
+		st->Set(4, b.lowerLeft().y());
+		st->Set(5, b.upperRight().x());
+		st->Set(6, b.upperRight().y());
+		st->Set(7, MAX(b.width(), b.height()));
+		st->Set(8, blob);
+
+		st->Execute();
+
+		l.geomId(index);
+	}
+	catch(IBPP::SQLException& e1)
+	{
+		errorMessage_ = e1.ErrorMessage();
+		return false;
+	}
+	catch(IBPP::LogicException& e1)
+	{
+		errorMessage_ = e1.ErrorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+
+bool 
+TeFirebird::updateLine (const string& table, TeLine2D &l)
+{
+	try
+	{
+		IBPP::Blob blob = IBPP::BlobFactory(firebird_, transaction_);
+
+				// insert data
+		std::string ins = "UPDATE " + table + " SET (";
+		ins += "object_id=?, num_coords=?, ";
+		ins += "lower_x=?, lower_y=?, upper_x=?, upper_y=?, "; 
+		ins += "ext_max=?, spatial_data=?) WHERE geom_id="+Te2String(l.geomId());
+
+		IBPP::Statement st = IBPP::StatementFactory(firebird_, transaction_, ins);
+		st->Prepare(ins);
+
+		std::string obId = escapeSequence(l.objectId());
+		TeBox b = l.box();
+
+		TeLinearRing ring = l;
+		saveLineInBlob(blob, ring);
+
+		st->Set(1, obId);
+		st->Set(2, (int)l.size());
+		st->Set(3, b.lowerLeft().x());
+		st->Set(4, b.lowerLeft().y());
+		st->Set(5, b.upperRight().x());
+		st->Set(6, b.upperRight().y());
+		st->Set(7, MAX(b.width(), b.height()));
+		st->Set(8, blob);
+
+		st->Execute();
+	}
+	catch(IBPP::SQLException& e1)
+	{
+		errorMessage_ = e1.ErrorMessage();
+		return false;
+	}
+	catch(IBPP::LogicException& e1)
+	{
+		errorMessage_ = e1.ErrorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+bool
+TeFirebirdPortal::fetchGeometry(TeLine2D& line)
+{
+	int ni;
+	line = getLinearRing(ni);
+
+	return(fetchRow());
+}
+
+bool
+TeFirebirdPortal::fetchGeometry(TeLine2D& line, const unsigned int& initIndex)
+{
+	//int index = getInt(initIndex);
+	string object_id = getData (initIndex+1);
+	//int np = getInt(initIndex+2);
+
+	TeLinearRing l;
+	loadFromBlob(result_, l);
+
+	l.geomId(getInt(initIndex));
+	l.objectId(getData(initIndex+1));
+
+	line.copyElements(l);
+
+	return (fetchRow());
+}
+
+
+bool 
+TeFirebird::insertPoint(const string& table, TePoint &p)
+{
+	string q = "INSERT INTO " + table + " VALUES(0,";
+	q += "'" + escapeSequence(p.objectId()) + "',";
+	q += Te2String(p.location().x_) + ",";
+	q += Te2String(p.location().y_) + ")";
+	
+	int geomId = getLastGeneratedAutoNumber(table);
+
+	if (!execute(string(q)))
+	{
+		return false;
+	}
+
+	p.geomId(geomId);
+
+	return true;
+}
+
+
+bool 
+TeFirebirdPortal::fetchGeometry(TePoint& p)
+{
+	TeCoord2D c(getDouble("x"), getDouble("y"));
+	p.geomId(getInt("geom_id"));
+	p.objectId(getData("object_id"));
+	p.add(c);
+
+	return (fetchRow());
+}
+
+bool 
+TeFirebirdPortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
+{
+	TeCoord2D c(getDouble(initIndex+2), getDouble(initIndex+3));
+	p.geomId(getInt(initIndex));
+	p.objectId(getData(initIndex+1));
+	p.add(c);
+
+	return (fetchRow());
+}
+
+
+bool 
+TeFirebird::insertText(const string& table, TeText &t)
+{
+	char q[256];
+
+	int geomId = getLastGeneratedAutoNumber(table);
+
+	sprintf (q,"INSERT INTO %s values(0,'%s',%.12f,%.12f,'%s',%.12f, %.12f, %.12f, %.12f)",
+		table.c_str(), escapeSequence(t.objectId()).c_str(),
+		t.location().x_, t.location().y_,
+		t.textValue().c_str(), t.angle(), t.height(),t.alignmentVert(),t.alignmentHoriz());
+	
+	if (!execute(string(q)))
+		return false;
+	
+	t.geomId(geomId);
+
+	return true;
+}
+
+
+bool 
+TeFirebird::insertArc(const string& table, TeArc &arc)
+{
+	char q[256];
+	int geomId = getLastGeneratedAutoNumber(table);
+
+	sprintf (q,"INSERT INTO %s values(0,'%s',%d,%d)",
+		table.c_str(),escapeSequence(arc.objectId()).c_str(),arc.fromNode().geomId(),arc.toNode().geomId());
+	
+	if (!this->execute(string(q)))
+	{
+		return false;
+	}
+
+	arc.geomId(geomId);
+	return true;
+}
+
+
+bool
+TeFirebird::insertNode(const string& table, TeNode &node)
+{
+	char q[256];
+	int geomId = getLastGeneratedAutoNumber(table);
+
+	sprintf (q,"INSERT INTO %s values(0,'%s',%.12f,%.12f)",table.c_str(),node.objectId().c_str(),node.location().x(),node.location().y());
+	if (!execute(string(q)))
+	{
+		return false;
+	}
+
+	node.geomId(geomId);
+	return true;
+}
+
+bool 
+TeFirebird::insertBlob (const string& tableName, const string& columnBlob , const string& whereClause, unsigned char* data, int size)
+{
+	if (whereClause.empty())
+		return false;
+
+	TeDatabasePortal* portal = getPortal();
+	
+	string q = "SELECT * FROM "+ tableName +" WHERE "+ whereClause;
+
+	if((!portal->query(q)) || (!portal->fetchRow()))
+	{
+		delete portal;
+		return false;
+	}
+
+	delete portal;
+
+	std::string sql  = "UPDATE ";
+	sql += tableName;
+	sql += " SET ";
+	sql += columnBlob;
+	sql += " = ?";
+	sql += " WHERE ";
+	sql += whereClause;
+
+	try
+	{
+		bool started = true;
+		
+		if(!transaction_->Started())
+		{
+			transaction_->Start();
+			started = false;
+		}
+
+		IBPP::Blob blob = IBPP::BlobFactory(firebird_, transaction_);
+
+				// insert data
+
+		IBPP::Statement st = IBPP::StatementFactory(firebird_, transaction_, sql);
+
+		convertChar2Blob((char*)data, size, blob);
+
+		blob->Close();
+		
+		st->Prepare(sql);
+		st->Set(1, blob);
+		st->Execute();
+
+		(started) ? transaction_->CommitRetain() : transaction_->Commit();
+	}
+	catch(IBPP::SQLException& e1)
+	{
+		errorMessage_ = e1.ErrorMessage();
+		return false;
+	}
+	catch(IBPP::LogicException& e1)
+	{
+		errorMessage_ = e1.ErrorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+bool
+TeFirebird::insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, 
+						   unsigned char *buf,unsigned long size, int band, unsigned int res, unsigned int subband)
+{
+	if (blockId.empty()) // no block identifier provided
+	{
+		errorMessage_ = "bloco sem identificador";
+		return false;
+	}
+
+	TeDatabasePortal* portal = getPortal();
+	bool update = false;
+
+	std::string sql = "SELECT block_id FROM " + table + " WHERE block_id='" + blockId + "'";
+	if(!portal->query(sql))
+	{
+		delete portal;
+		errorMessage_ = portal->errorMessage();
+		
+		return false;
+	}
+
+	if(portal->fetchRow())
+	{
+		update = true;
+	}
+
+	delete portal;
+
+	try
+	{
+		IBPP::Statement st = IBPP::StatementFactory(firebird_, transaction_);
+
+		if(!update)
+		{
+			sql = "INSERT INTO " + table + " (lower_x, lower_y, upper_x, upper_y, band_id, resolution_factor, subband, block_size, spatial_data, block_id) ";
+			sql += " VALUES (?,?,?,?,?,?,?,?,?,?)"; 
+		}
+		else
+		{
+			sql = "UPDATE " + table + " SET lower_x=?, lower_y=?, upper_x=?, upper_y=?, band_id=?,";
+			sql += "resolution_factor=?, subband=?, block_size=?, spatial_data=? WHERE block_id=? ";
+		}
+
+		bool trStarted = true;
+
+		if(!transaction_->Started())
+		{
+			transaction_->Start();
+			trStarted = false;
+		}
+
+		IBPP::Blob blob = IBPP::BlobFactory(firebird_, transaction_);
+		convertChar2Blob(reinterpret_cast<char*>(buf), size, blob);
+		blob->Close();
+
+		st->Prepare(sql);
+
+		st->Set(1, ll.x());
+		st->Set(2, ll.y());
+		st->Set(3, ur.x());
+		st->Set(4, ur.y());
+		st->Set(5, band);
+		st->Set(6, (int)res);
+		st->Set(7, (int)subband);
+		st->Set(8, (int)size);
+		st->Set(9, blob);
+		st->Set(10, blockId);
+
+		st->Execute();
+		(trStarted)? transaction_->CommitRetain() : transaction_->Commit();
+	}
+	catch(IBPP::SQLException& e)
+	{
+		transaction_->Rollback();
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+	catch(IBPP::LogicException& e)
+	{
+		transaction_->Rollback();
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeFirebird::getAttributeList(const string& tableName,TeAttributeList& attList)
+{
+	if(!TeDatabase::getAttributeList(tableName, attList))
+	{
+		return false;
+	}
+
+	std::string sql = "SELECT trim(ixs.RDB$FIELD_NAME) from rdb$RELATION_CONSTRAINTS con";
+	sql += " JOIN RDB$INDEX_SEGMENTS ixs On ixs.RDB$INDEX_NAME = con.RDB$INDEX_NAME";
+	sql += " WHERE upper(con.RDB$RELATION_NAME) = upper('" + tableName + "') and con.RDB$CONSTRAINT_TYPE = 'PRIMARY KEY'";
+
+	TeDatabasePortal* portal = getPortal();
+
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		std::string columnName = portal->getData(0);
+
+		for(unsigned int i = 0; i < attList.size(); ++i)
+		{
+			if(columnName == attList[i].rep_.name_)
+			{
+				attList[i].rep_.isPrimaryKey_ = true;
+			}
+		}
+	}
+
+	delete portal;
+
+	return true;
+}
+
+bool
+TeFirebirdPortal::fetchGeometry(TeNode& n)
+{
+	TeCoord2D c(getDouble("x"), getDouble("y"));
+	n.geomId(getInt("geom_id"));
+	n.objectId(getData("object_id"));
+	n.add(c);
+	return (fetchRow());
+}
+
+bool
+TeFirebirdPortal::fetchGeometry(TeNode& n, const unsigned int& initIndex)
+{
+	TeCoord2D c(getDouble(initIndex+2), getDouble(initIndex+3));
+	n.geomId( getInt(initIndex));
+	n.objectId(getData(initIndex+1));
+	n.add(c);
+	return (fetchRow());
+}
+
+bool
+TeFirebird::insertCell(const string& table, TeCell &c)
+{
+	TeBox	b=c.box();
+	char	q[256];
+	int geomId = getLastGeneratedAutoNumber(table);
+	
+	sprintf (q,"INSERT INTO %s values(0,'%s',%.15f,%.15f,%.15f,%.15f,%d,%d)",
+		table.c_str(),c.objectId().c_str(),
+		b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),
+		c.column(),c.line());
+
+	if (!execute (q))
+	{
+		return false;
+	}
+
+	c.geomId(geomId);
+	return true;
+}
+
+
+TeTime
+TeFirebirdPortal::getDate (int i)
+{ 
+	string s = getData(i);
+	TeTime t(s, TeSECOND, "YYYYsMMsDDsHHsmmsSS","."); 
+	return t; 
+}
+
+TeTime
+TeFirebirdPortal::getDate (const string& s)
+{ 
+	string sv = getData(s);
+	TeTime t(sv, TeSECOND, "YYYYsMMsDDsHHsmmsSS","."); 
+	return t; 
+}
+
+string 
+TeFirebirdPortal::getDateAsString(const string& s)
+{
+	TeTime t = this->getDate(s);
+	if (t.isValid())
+	{		
+		string tval = "\'"+t.getDateTime("YYYYsMMsDDsHHsmmsSS", ".")+"\'";
+		return tval;
+	}
+	else
+		return "";
+}
+
+string 
+
+TeFirebirdPortal::getDateAsString(int i)
+{
+	TeTime t = this->getDate(i);
+	if (t.isValid())
+	{		
+		string tval = "\'"+t.getDateTime("YYYYsMMsDDsHHsmmsSS", ".")+"\'";
+		return tval;
+	}
+	else
+		return "";
+}
+
+double 
+TeFirebirdPortal::getDouble (const string& s)
+{
+	return atof(getData(s));
+}
+
+
+double 
+TeFirebirdPortal::getDouble (int i)
+{
+	return atof(getData(i));
+}
+
+int 
+TeFirebirdPortal::getInt (const string& s)
+{
+	return atoi(getData(s));
+}
+
+
+int 
+TeFirebirdPortal::getInt (int i)
+{
+	return atoi(getData(i));
+}
+
+
+char* 
+TeFirebirdPortal::getData (int i)
+{
+	double fValue;
+	int iValue;
+	IBPP::Date dValue;
+	IBPP::Time tValue;
+	IBPP::Timestamp tsValue;
+	IBPP::Blob bValue;
+	std::string sValue;
+
+	data_.clear();
+
+	try
+	{
+		i++;
+		int numcols = result_->Columns();
+
+		if((i>0) && (i <= numcols))
+		{
+			IBPP::SDT fbType = result_->ColumnType(i);
+
+			switch(fbType)
+			{
+				case IBPP::sdFloat :
+				case IBPP::sdDouble :
+					if(!result_->Get(i, fValue))
+					{
+						char result[100];
+						sprintf( result, "%f", fValue );
+						data_ = result;
+					}
+				break;
+
+				case IBPP::sdInteger :
+				case IBPP::sdLargeint :
+				case IBPP::sdSmallint :
+					if(!result_->Get(i, &iValue))
+					{
+						data_ = Te2String(iValue);
+					}
+				break;
+
+				case IBPP::sdString :
+					if(!result_->Get(i, sValue))
+					{
+						data_ = sValue;
+					}
+				break;
+
+				case IBPP::sdDate:
+					if(!result_->Get(i, dValue))
+					{
+						//data_ = Te2String(dValue.GetDate());
+						data_ = Te2String(dValue.Year()) + "." + Te2String(dValue.Month()) + "." + Te2String(dValue.Day());
+					}
+				break;
+
+				case IBPP::sdTime:
+					if(!result_->Get(i, tValue))
+					{
+						//data_ = Te2String(tValue.GetTime());
+						data_ = Te2String(tValue.Hours()) + ":" + Te2String(tValue.Minutes()) + ":" + Te2String(tValue.Seconds());
+					}
+				break;
+
+				case IBPP::sdTimestamp:
+					if(!result_->Get(i, tsValue))
+					{
+						//data_ = Te2String(tsValue.GetTime());
+
+						data_ = Te2String(tsValue.Year()) + "." + Te2String(tsValue.Month()) + "." + Te2String(tsValue.Day());
+						data_ += " " + Te2String(tsValue.Hours()) + ":" + Te2String(tsValue.Minutes()) + ":" + Te2String(tsValue.Seconds());						
+					}
+				break;
+
+				case IBPP::sdBlob:
+					bValue  = IBPP::BlobFactory(firebird_, transaction_);
+					
+					if(!result_->Get(i, bValue))
+					{
+						bValue->Load(data_);
+					}
+					bValue->Close();
+				break;
+
+				default:
+				break;
+			}
+		}
+	}
+	catch(IBPP::LogicException& e)
+	{
+		errorMessage_ = std::string("Error on function getData():\n") + e.ErrorMessage();
+		return "-1";
+	}
+	
+	return (char*) data_.c_str();
+}
+
+char* 
+TeFirebirdPortal::getData (const string& s)
+{
+	std::string::size_type pos = s.find(".");
+	std::string data = (pos == std::string::npos) ? s : s.substr(pos+1);
+
+	int index = result_->ColumnNum(data);
+
+	return getData(index-1);
+}
+
+bool TeFirebirdPortal::getBlob(const int& column, unsigned char* &data, unsigned long& size)
+{
+	try
+	{
+		IBPP::Blob blob = IBPP::BlobFactory(firebird_, transaction_);
+//		std::string blobS;
+		
+		result_->Get(column, blob);
+
+		char* buffer;
+		int bufSize;
+		convertBlob2Char(blob, buffer, bufSize);
+		blob->Close();
+
+		if(data == NULL)
+		{
+			data = new unsigned char[bufSize];
+		}
+
+		size = bufSize;
+		memcpy(data, buffer, bufSize);
+
+		delete []buffer;
+	}
+	catch(IBPP::LogicException& e)
+	{
+		errorMessage_ = e.ErrorMessage();
+		return false;
+	}
+	catch(...)
+	{
+	}
+
+	return true;
+}
+
+bool
+TeFirebirdPortal::getBlob (const string& s, unsigned char* &data, long& size) 
+{
+	std::string::size_type pos = s.find(".");
+	std::string fieldS = (pos == std::string::npos) ? s : s.substr(pos+1);
+	int field = result_->ColumnNum(fieldS);
+	unsigned long aux;
+	bool res = getBlob(field, data, aux);
+	
+	if(res)
+	{
+		size = static_cast<unsigned long>(aux);
+	}
+
+	return res;
+}
+
+
+bool 
+TeFirebirdPortal::getBool (const string& s)
+{
+	int val = getInt(s);
+	return val ? true : false;
+}
+
+
+bool 
+TeFirebirdPortal::getBool (int i)
+{
+	int val = getInt(i);
+	return val ? true : false;
+}
+
+bool 
+TeFirebirdPortal::getRasterBlock(unsigned long& size, unsigned char* ptData)
+{
+	int idx = getColumnIndex("spatial_data")+1;
+	return getBlob(idx, ptData, size);
+}
+
+bool
+TeFirebird::inClauseValues(const string& query, const string& attribute, vector<string>& inClauseVector)
+{
+	int i = 0, numRows = 0, count = 0, chunk = 200;
+	string id, inClause = "(", plic = "'";
+
+	TeDatabasePortal *pt = getPortal();
+	if(pt->query(query) == false)
+	{
+		delete pt;
+		return false;
+	}
+
+	while (numRows < pt->numRows())
+	{
+		if(count < chunk && pt->fetchRow())
+		{
+			id = pt->getData(attribute);
+			inClause = inClause + plic + id + "',";
+			++count;
+			++numRows;
+		}
+		else
+		{
+			inClause = inClause.substr(0, inClause.size()-1);
+			inClause += ")";
+			inClauseVector.push_back(inClause);
+			count = 0;
+			++i;
+			inClause = "(";
+		}
+	}
+	if (numRows == 0)
+	{
+		delete pt;
+		return true;
+	}
+	else
+	{
+		inClause = inClause.substr(0, inClause.size()-1);
+		inClause += ")";
+		inClauseVector.push_back(inClause);
+	}
+
+	delete pt;
+	return true;
+}
+
+string 
+TeFirebird::getSQLTime(const TeTime& time) const
+{
+	string result = "'"+ time.getDateTime("YYYYsMMsDDsHHsmmsSS", ".", ":") +"'";
+	return result;
+}
+
+string
+TeFirebird::getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, 
+						   const string& initialTime, const string& finalTime)
+{
+	
+	//In Firebird the first day of the week is monday with index 0
+	if(chr==TeDAYOFWEEK)
+	{
+		time1 = time1-1;
+		if(time1<0)
+			time1=6;
+		time2 = time2-1;
+		if(time2<0)
+			time2=6;
+	}
+
+	return(TeDatabase::getSQLTemporalWhere(time1, time2, chr, rel, initialTime, finalTime));
+}
+		
+
+string TeFirebird::concatValues(vector<string>& values, const string& unionString)
+{
+	string concat = "CONCAT(";
+	
+	for(unsigned int i = 0; i < values.size(); ++i)
+	{
+		if(i != 0)
+		{
+			concat += ", ";
+
+			if(!unionString.empty())
+			{
+				concat += "'";
+				concat += unionString;
+				concat += "'";
+				concat += ", ";
+			}
+		}
+
+		concat += values[i];
+	}
+
+	concat += ")";
+
+	return concat;
+}
+
+bool 
+TeFirebird::updateLayerBox(TeLayer* layer)
+{
+	if (!layer)
+		return false;
+	TeBox box = layer->box();
+	string sql = "UPDATE te_layer SET lower_x = " + Te2String(box.x1());
+		   sql += ", lower_y = " + Te2String(box.y1());
+		   sql += ", upper_x = " + Te2String(box.x2());
+		   sql += ", upper_y = " + Te2String(box.y2());
+		   sql += " WHERE layer_id=" + Te2String(layer->id());
+
+	return this->execute(sql);
+}
+
+string TeFirebird::toUpper(const string& value)
+{
+	string result  = "upper(";
+	       result += value;
+		   result += ")";
+
+	return result;
+}
+
diff --git a/src/terralib/drivers/Firebird/TeFirebird.h b/src/terralib/drivers/Firebird/TeFirebird.h
new file mode 100644
index 0000000..80ba30e
--- /dev/null
+++ b/src/terralib/drivers/Firebird/TeFirebird.h
@@ -0,0 +1,316 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeFirebird.h
+    \brief This file contains the particularities of a Firebird driver
+*/
+#ifndef  __TERRALIB_INTERNAL_FIREBIRD_H
+#define  __TERRALIB_INTERNAL_FIREBIRD_H
+
+#ifdef WIN32
+#include <winsock.h>
+#endif
+
+#include <TeTable.h>
+#include <TeDatabase.h>
+#include <TeDatabaseFactory.h>
+
+#ifdef IBPP_WINDOWS
+#include <windows.h>
+#endif
+
+#include <ibpp/core/ibpp.h>
+
+#include "TeFirebirdDefines.h"
+
+#ifdef IBPP_UNIX
+#include <unistd.h>
+#define DeleteFile(x) unlink(x)
+#define Sleep(x) usleep(1000 * x)
+#endif
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+//! A concrete implementation of a driver to the Firebird SGDB
+class TLFIREBIRD_DLL TeFirebird : public TeDatabase
+{
+friend class TeFirebirdPortal;
+
+public: 
+
+	TeFirebird();
+
+	virtual ~TeFirebird();
+
+	IBPP::Database getIBPPFirebird();
+
+	string  escapeSequence(const string& from);
+
+	bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int &port=-1, bool terralibModel=true, const std::string& characterSet = "");
+
+	bool connect (const string& host, const string& user, const string& password, const string& database, int port=-1);
+
+	bool showDatabases (const string& host, const string& user, const string& password, vector<string>& dbNames, int port=-1);
+
+	void close();
+
+	bool tableExist(const string& table);
+
+	bool columnExist(const string& table, const string& column, TeAttribute& attr);
+
+	bool addColumn (const string& table,TeAttributeRep &rep);
+
+	bool createRelation (const string& /* relName */, const string& /* table */, const string& /* fieldName */,
+						const string& /* relatedTable */, const string& /* relatedField */, bool /* cascadeDeletion */)
+	{ return true; }
+
+	TeDBRelationType existRelation(const string& /* tableName */, const string& /* relName */)
+
+	{	return TeNoRelation; }
+
+	bool execute ( const string &q);
+
+	bool createTable(const string& table, TeAttributeList &attr);
+
+	bool alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName = "");
+
+	virtual TeDatabasePortal* getPortal ();
+
+// specific TerraLib database access methods
+
+	bool insertProjection (TeProjection *proj);
+	bool updateProjection (TeProjection *proj);
+
+	//! Check if a particular layer exists (passing its name)
+	virtual bool layerExist	(string layerName);
+
+	bool insertLayer(TeLayer* layer);
+	bool updateLayer(TeLayer *layer);
+
+	bool insertProject(TeProject* project);
+	bool insertRepresentation(int layerId, TeRepresentation& rep);	
+	bool insertTable(TeTable &table);
+	bool updateTable	(TeTable &table);
+	bool insertTableInfo (int layerId, TeTable &table, const string& user="");
+	bool insertRelationInfo(const int tableId, const string& tField,
+						    const string& eTable, const string& eField, int& relId);
+	bool insertView (TeView *view);
+	bool insertViewTree (TeViewTree *tree);	
+	bool insertTheme(TeAbstractTheme *theme);
+	bool insertThemeGroup (TeViewTree* tree);
+	bool generateLabelPositions (TeTheme *theme, const std::string& objectId = "");
+	bool updateTheme (TeAbstractTheme *theme);
+	bool insertThemeTable (int themeId, int tableId, int relationId, int tableOrder);
+	bool updateRepresentation (int layerId, TeRepresentation& rep);
+
+	//! Return a TeDatabaseIndex vector from a table
+	virtual bool getIndexesFromTable(const string& tableName, std::vector<TeDatabaseIndex>& vecIndexes);
+
+	/** @name Raster Tables
+	*  Retrieving/Inserting/Modifying/Deleting raster representations in the database. 
+	*/
+	//@{ 
+	//! Inserts information about a raster geometry associated to an object
+	/*!
+		\param tableName name of the table that stores the raster representation
+		\param par raster parameters 
+		\param objectId identification of the object associated to the raster geometry
+	*/
+	bool insertRasterGeometry(const string& tableName, TeRasterParams& par, const string& objectId = "");
+	//@}
+
+	//! Updates the information about the raster geometry associated to an object of a layer
+	/*!
+		\param layerId layer unique database identification
+		\param par raster parameters 
+		\param objectId identification of the object associated to the raster geometry
+	*/
+	virtual bool updateRasterRepresentation(int layerId, TeRasterParams& par, const string& objectId="");
+
+	bool insertLegend (TeLegendEntry *legend);
+	virtual bool insertPolygon	(const string& table, TePolygon &p);
+	virtual bool updatePolygon	(const string& table, TePolygon &p);
+	virtual bool insertLine (const string&  table, TeLine2D &l);
+	virtual bool updateLine (const string& table, TeLine2D &l);
+	bool insertPoint (const string& table, TePoint &p);
+	bool insertText (const string& table, TeText &t);
+	bool insertArc (const string& table,TeArc &arc);
+	bool insertNode	(const string& table, TeNode &node);	
+	bool insertCell	(const string& table, TeCell &c);
+
+	bool insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char *buf,unsigned long size, int band=0, unsigned int res=1, unsigned int subband=0);
+
+	string getSQLTime(const TeTime& time) const;
+	string getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, 
+						   const string& initialTime, const string& finalTime);
+
+	bool inClauseValues(const string& query, const string& attribute, vector<string>& inClauseVector);
+
+	bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size);
+	
+	//! Concat values in a vector using unionString as the join between each value
+	string concatValues(vector<string>& values, const string& unionString);
+
+	bool updateLayerBox(TeLayer* layer);
+
+	//! Returns the SQL function for upper case
+	string toUpper(const string& value);
+
+	string getConcatFieldsExpression(const vector<string>& fNamesVec);
+
+	bool beginTransaction();
+    bool commitTransaction();
+    bool rollbackTransaction();
+
+	virtual std::string mapToFirebirdType(const TeAttribute& teRep) const;
+
+	bool createAutoIncrement(const std::string& table, const std::string& column);
+
+	int getLastGeneratedAutoNumber(const std::string& table);
+
+	//! Gets the list of attributes of a table
+	virtual bool getAttributeList(const string& tableName,TeAttributeList& attList);
+
+protected :
+	IBPP::Database firebird_;
+	IBPP::Transaction transaction_;
+};
+
+//! A concrete implementation of a portal to a Firebird database
+class TLFIREBIRD_DLL TeFirebirdPortal  : public TeDatabasePortal
+{
+private:
+
+public :
+
+// Constructor / Destructor
+
+	TeFirebirdPortal (TeFirebird* firebird);
+
+	TeFirebirdPortal (const TeFirebirdPortal& p);
+
+	virtual ~TeFirebirdPortal ();
+
+// Basic database methods
+
+	bool query (const string &qry, TeCursorLocation l = TeSERVERSIDE, TeCursorType t = TeUNIDIRECTIONAL, TeCursorEditType e = TeREADONLY, TeCursorDataType dt = TeTEXTCURSOR );
+
+	bool fetchRow ();
+
+	bool fetchRow (int i);
+
+	void freeResult ();
+
+// specific SQL SELECT command methods
+
+	char*		getData (int i);
+	char*		getData (const string& s);
+	double		getDouble (int i);
+	double		getDouble (const string& s);
+	int			getInt (int i);
+	int			getInt (const string& s);
+	bool		getBool (const string& s);
+	bool		getBool (int i);
+
+	virtual bool fetchGeometry(TePolygon& pol);
+	virtual bool fetchGeometry(TeLine2D& line);
+	bool fetchGeometry(TeNode& n);
+	bool fetchGeometry(TePoint& p);
+	virtual bool fetchGeometry(TePolygon& pol, const unsigned int& initIndex);
+	virtual bool fetchGeometry(TeLine2D& line, const unsigned int& initIndex);
+	bool fetchGeometry(TeNode& n, const unsigned int& initIndex);
+	bool fetchGeometry(TePoint& p, const unsigned int& initIndex);
+	
+	bool setData (int /* field */, string /* val */)
+	{return true; }
+
+	bool getBlob (const int& column, unsigned char* &data, unsigned long& size);
+	bool getBlob (const string& s, unsigned char* &data, long& size);
+	bool getRasterBlock(unsigned long& size, unsigned char* ptData);
+
+	TeTime getDate (int i);
+	TeTime getDate (const string& s);
+
+	string getDateAsString(int i);
+	string getDateAsString(const string& s);
+
+protected:
+	virtual TeLinearRing getLinearRing (int &ni);
+
+	IBPP::Database firebird_;
+	IBPP::Statement result_;
+	IBPP::Transaction transaction_;
+	std::string data_,
+				query_;
+	int currRow_;
+};
+
+
+/**
+ * @brief This is the class for TeFirebird driver factory.
+ * @author Frederico Augusto Bed� Teot�nio<frederico.bede at funcate.org.br>
+ * @ingroup DatabaseUtils
+ */
+class TLFIREBIRD_DLL TeFirebirdFactory : public TeDatabaseFactory
+{
+  public :
+      
+    /**
+     * Default constructor
+     */
+    TeFirebirdFactory() : TeDatabaseFactory( std::string( "Firebird" ) ) {};      
+      
+    /**
+     * Default Destructor
+     */
+    ~TeFirebirdFactory() {};
+      
+  protected :  
+  
+    /**
+     * Implementation for the abstract TeFactory::build.
+     *
+     * @param arg A const reference to the parameters used by the
+     * database.
+     * @return A pointer to the new generated database instance.
+     */
+    TeDatabase* build( const TeDatabaseFactoryParams& arg )
+    {
+      TeFirebird* instance_ptr = new TeFirebird();
+      
+      if( arg.host_ != "" ) {
+        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
+          arg.database_, arg.port_ );
+      }
+  
+      return (TeDatabase*)instance_ptr;
+    }
+};
+
+namespace {
+  static TeFirebirdFactory TeFirebirdFactory_instance;
+}; 
+
+#endif
+
diff --git a/src/terralib/drivers/Firebird/TeFirebirdDefines.h b/src/terralib/drivers/Firebird/TeFirebirdDefines.h
new file mode 100644
index 0000000..6c614cb
--- /dev/null
+++ b/src/terralib/drivers/Firebird/TeFirebirdDefines.h
@@ -0,0 +1,49 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeFirbirdDefines.h
+    \brief Provides a set of general definitions used by te_firebird project.
+*/
+#ifndef  __TERRALIB_INTERNAL_FIREBIRDDEFINES_H
+#define  __TERRALIB_INTERNAL_FIREBIRDDEFINES_H
+
+/** @defgroup TerraLib_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLFIREBIRD_AS_DLL
+#define TLFIREBIRD_DLL __declspec(dllexport)
+#else
+#define TLFIREBIRD_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TLFIREBIRD_DLL
+#endif
+/** @} */ 
+
+#endif //__TERRALIB_INTERNAL_FIREBIRDDEFINES_H
diff --git a/src/terralib/drivers/Firebird/ibpp/core/_dpb.cpp b/src/terralib/drivers/Firebird/ibpp/core/_dpb.cpp
new file mode 100644
index 0000000..d3dec8d
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/_dpb.cpp
@@ -0,0 +1,119 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: _dpb.cpp 7665 2009-03-03 16:39:22Z fredbed $
+//	Subject : IBPP, internal DPB class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* DPB == Database Parameter Block/Buffer, see Interbase 6.0 C-API
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+#include <cstring>
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+using namespace ibpp_internals;
+
+const int DPB::BUFFERINCR = 128;
+
+void DPB::Grow(int needed)
+{
+	if (mBuffer == 0) ++needed;	// Initial alloc will require one more byte
+	if ((mSize + needed) > mAlloc)
+	{
+		// We need to grow the buffer. We use increments of BUFFERINCR bytes.
+		needed = (needed / BUFFERINCR + 1) * BUFFERINCR;
+		char* newbuffer = new char[mAlloc + needed];
+		if (mBuffer == 0)
+		{
+			// Initial allocation, initialize the version tag
+			newbuffer[0] = isc_dpb_version1;
+			mSize = 1;
+		}
+		else
+		{
+			// Move the old buffer content to the new one
+			memcpy(newbuffer, mBuffer, mSize);
+			delete [] mBuffer;
+		}
+		mBuffer = newbuffer;
+		mAlloc += needed;
+	}
+}
+
+void DPB::Insert(char type, const char* data)
+{
+	int len = (int)strlen(data);
+	Grow(len + 2);
+    mBuffer[mSize++] = type;
+	mBuffer[mSize++] = char(len);
+    strncpy(&mBuffer[mSize], data, len);
+    mSize += len;
+}
+
+void DPB::Insert(char type, int16_t data)
+{
+	Grow(2 + 2);
+    mBuffer[mSize++] = type;
+	mBuffer[mSize++] = char(2);
+    *(int16_t*)&mBuffer[mSize] = int16_t((*gds.Call()->m_vax_integer)((char*)&data, 2));
+    mSize += 2;
+}
+
+void DPB::Insert(char type, bool data)
+{
+	Grow(2 + 1);
+    mBuffer[mSize++] = type;
+	mBuffer[mSize++] = char(1);
+    mBuffer[mSize++] = char(data ? 1 : 0);
+}
+
+void DPB::Insert(char type, char data)
+{
+	Grow(2 + 1);
+    mBuffer[mSize++] = type;
+	mBuffer[mSize++] = char(1);
+    mBuffer[mSize++] = data;
+}
+
+void DPB::Reset()
+{
+	if (mAlloc != 0)
+    {
+    	delete [] mBuffer;
+        mBuffer = 0;
+        mSize = 0;
+		mAlloc = 0;
+    }
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/_ibpp.cpp b/src/terralib/drivers/Firebird/ibpp/core/_ibpp.cpp
new file mode 100644
index 0000000..dfe3b6d
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/_ibpp.cpp
@@ -0,0 +1,369 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: _ibpp.cpp 8861 2010-08-26 17:10:07Z frederico.bede $
+//	Subject : IBPP, Initialization of the library
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+#include <limits>
+
+#include <stdlib.h>
+
+#ifdef IBPP_WINDOWS
+// New (optional) Registry Keys introduced by Firebird Server 1.5
+#define REG_KEY_ROOT_INSTANCES TEXT("SOFTWARE\\Firebird Project\\Firebird Server\\Instances") 
+#define FB_DEFAULT_INSTANCE TEXT("DefaultInstance") 
+#endif
+
+namespace ibpp_internals
+{
+	const double consts::dscales[19] = {
+		  1, 1E1, 1E2, 1E3, 1E4, 1E5, 1E6, 1E7, 1E8,
+		  1E9, 1E10, 1E11, 1E12, 1E13, 1E14, 1E15,
+		  1E16, 1E17, 1E18 };
+
+	const int consts::Dec31_1899 = 693595;
+
+// Many compilers confuses those following min/max with macros min and max !
+#undef min
+#undef max
+
+#ifdef __DMC__ // Needs to break-down the declaration else compiler crash (!)
+	const std::numeric_limits<int16_t> i16_limits;
+	const std::numeric_limits<int32_t> i32_limits;
+	const int16_t consts::min16 = i16_limits.min();
+	const int16_t consts::max16 = i16_limits.max();
+	const int32_t consts::min32 = i32_limits.min();
+	const int32_t consts::max32 = i32_limits.max();
+#else
+	const int16_t consts::min16 = std::numeric_limits<int16_t>::min();
+	const int16_t consts::max16 = std::numeric_limits<int16_t>::max();
+	const int32_t consts::min32 = std::numeric_limits<int32_t>::min();
+	const int32_t consts::max32 = std::numeric_limits<int32_t>::max();
+#endif
+
+	GDS gds;	// Global unique GDS instance
+
+#ifdef IBPP_WINDOWS
+	std::string AppPath;	// Used by GDS::Call() below
+#endif
+
+#ifdef _DEBUG
+	std::ostream& operator<< (std::ostream& a, flush_debug_stream_type)
+	{
+		if (std::stringstream* p = dynamic_cast<std::stringstream*>(&a))
+		{
+#ifdef IBPP_WINDOWS
+			::OutputDebugString((const TCHAR *) ("IBPP: " + p->str() + "\n").c_str()); 
+#endif
+			p->str("");
+		}
+		return a;
+	}
+#endif	// _DEBUG
+
+}
+
+using namespace ibpp_internals;
+
+GDS* GDS::Call()
+{
+	// Let's load the CLIENT library, if it is not already loaded.
+	// The load is guaranteed to be done only once per application.
+
+	if (! mReady)
+	{
+#ifdef IBPP_WINDOWS
+
+		// Let's load the FBCLIENT.DLL or GDS32.DLL, we will never release it.
+		// Windows will do that for us when the executable will terminate.
+
+		TCHAR fbdll[MAX_PATH];
+		HKEY hkey_instances;
+
+		// Try to load FBCLIENT.DLL from each of the additional optional paths
+		// that may have been specified through ClientLibSearchPaths().
+		// We also want to actually update the environment PATH so that it references
+		// the specific path from where we attempt the load. This is useful because
+		// it directs the system to attempt finding dependencies (like the C/C++
+		// runtime libraries) from the same location where FBCLIENT is found.
+
+		mHandle = 0;
+
+		std::string SysPath(getenv("PATH"));
+		std::string::size_type pos = 0;
+		while (pos < mSearchPaths.size())
+		{
+			std::string::size_type newpos = mSearchPaths.find(';', pos);
+
+			std::string path;
+			if (newpos == std::string::npos) path = mSearchPaths.substr(pos);
+			else path = mSearchPaths.substr(pos, newpos-pos);
+
+			if (path.size() >= 1)
+			{
+				if (path[path.size()-1] != '\\') path += '\\';
+
+				AppPath.assign("PATH=");
+				AppPath.append(path).append(";").append(SysPath);
+				putenv(AppPath.c_str());
+
+				path.append("fbclient.dll");
+				LoadLibrary((const TCHAR *) path.c_str());
+				if (mHandle != 0 || newpos == std::string::npos) break;
+			}
+			pos = newpos + 1;
+		}
+
+		if (mHandle == 0)
+		{
+			// Try to load FBCLIENT.DLL from the current application location.  This
+			// is a usefull step for applications using the embedded version of FB
+			// or a local copy (for whatever reasons) of the dll.
+
+			if (! AppPath.empty())
+			{
+				// Restores the original system path
+				AppPath.assign("PATH=");
+				AppPath.append(SysPath);
+				putenv(AppPath.c_str());
+			}
+
+			int len = GetModuleFileName(NULL, fbdll, sizeof(fbdll));
+			if (len != 0)
+			{
+				// Get to the last '\' (this one precedes the filename part).
+				// There is always one after a success call to GetModuleFileName().
+				TCHAR* p = fbdll + len;
+				do {--p;} while (*p != '\\');
+				*p = '\0';
+				lstrcat(fbdll, TEXT("\\fbembed.dll")); // Local copy could be named fbembed.dll
+				mHandle = LoadLibrary(fbdll);
+				if (mHandle == 0)
+				{
+					*p = '\0';
+					lstrcat(fbdll, TEXT("\\fbembed.dll")); 	// Or possibly renamed fbclient.dll
+					mHandle = LoadLibrary(fbdll);
+				}
+			}
+		}
+
+		if (mHandle == 0)
+		{
+			// Try to locate FBCLIENT.DLL through the optional FB registry key.
+
+			if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_KEY_ROOT_INSTANCES, 0,
+				KEY_READ, &hkey_instances) == ERROR_SUCCESS)
+			{
+				DWORD keytype;
+				DWORD buflen = sizeof(fbdll);
+				if (RegQueryValueEx(hkey_instances, FB_DEFAULT_INSTANCE, 0,
+						&keytype, reinterpret_cast<UCHAR*>(fbdll),
+							&buflen) == ERROR_SUCCESS && keytype == REG_SZ)
+				{
+					lstrcat(fbdll, TEXT("bin\\fbembed.dll")); 
+					mHandle = LoadLibrary(fbdll);
+				}
+				RegCloseKey(hkey_instances);
+			}
+		}
+
+		if (mHandle == 0)
+		{
+			// Let's try from the PATH and System directories
+			mHandle = LoadLibrary(TEXT("fbclient.dll")); 
+			if (mHandle == 0)
+			{
+				// Not found. Last try : attemps loading gds32.dll from PATH and
+				// System directories
+				 mHandle = LoadLibrary(TEXT("gds32.dll")); 
+				if (mHandle == 0)
+					throw LogicExceptionImpl("GDS::Call()",
+						_("Can't find or load FBCLIENT.DLL or GDS32.DLL"));
+			}
+		}
+#endif
+
+		mGDSVersion = 60;
+
+		// Get the entry points that we need
+
+#ifdef IBPP_WINDOWS
+#define IB_ENTRYPOINT(X) \
+			if ((m_##X = (proto_##X*)GetProcAddress(mHandle, "isc_"#X)) == 0) \
+				throw LogicExceptionImpl("GDS:gds()", _("Entry-point isc_"#X" not found"))
+#endif
+#ifdef IBPP_UNIX
+/* TODO : perform a late-bind on unix --- not so important, well I think (OM) */
+#define IB_ENTRYPOINT(X) m_##X = (proto_##X*)isc_##X
+#endif
+
+		IB_ENTRYPOINT(create_database);
+		IB_ENTRYPOINT(attach_database);
+		IB_ENTRYPOINT(detach_database);
+		IB_ENTRYPOINT(drop_database);
+		IB_ENTRYPOINT(database_info);
+		IB_ENTRYPOINT(open_blob2);
+		IB_ENTRYPOINT(create_blob2);
+		IB_ENTRYPOINT(close_blob);
+		IB_ENTRYPOINT(cancel_blob);
+		IB_ENTRYPOINT(get_segment);
+		IB_ENTRYPOINT(put_segment);
+		IB_ENTRYPOINT(blob_info);
+		IB_ENTRYPOINT(array_lookup_bounds);
+		IB_ENTRYPOINT(array_get_slice);
+		IB_ENTRYPOINT(array_put_slice);
+		IB_ENTRYPOINT(vax_integer);
+		IB_ENTRYPOINT(sqlcode);
+		IB_ENTRYPOINT(sql_interprete);
+		IB_ENTRYPOINT(interprete);
+		IB_ENTRYPOINT(que_events);
+		IB_ENTRYPOINT(cancel_events);
+		IB_ENTRYPOINT(start_multiple);
+		IB_ENTRYPOINT(commit_transaction);
+		IB_ENTRYPOINT(commit_retaining);
+		IB_ENTRYPOINT(rollback_transaction);
+		IB_ENTRYPOINT(rollback_retaining);
+		IB_ENTRYPOINT(dsql_execute_immediate);
+		IB_ENTRYPOINT(dsql_allocate_statement);
+		IB_ENTRYPOINT(dsql_describe);
+		IB_ENTRYPOINT(dsql_describe_bind);
+		IB_ENTRYPOINT(dsql_prepare);
+		IB_ENTRYPOINT(dsql_execute);
+		IB_ENTRYPOINT(dsql_execute2);
+		IB_ENTRYPOINT(dsql_fetch);
+		IB_ENTRYPOINT(dsql_free_statement);
+		IB_ENTRYPOINT(dsql_set_cursor_name);
+		IB_ENTRYPOINT(dsql_sql_info);
+
+		IB_ENTRYPOINT(service_attach);
+		IB_ENTRYPOINT(service_detach);
+		IB_ENTRYPOINT(service_start);
+		IB_ENTRYPOINT(service_query);
+
+		mReady = true;
+	}
+
+	return this;
+}
+
+namespace IBPP
+{
+
+	bool CheckVersion(uint32_t AppVersion)
+	{
+		//(void)gds.Call(); 		// Just call it to trigger the initialization
+		return (AppVersion & 0xFFFFFF00) ==
+				(IBPP::Version & 0xFFFFFF00) ? true : false;
+	}
+
+	int GDSVersion()
+	{
+		return gds.Call()->mGDSVersion;
+	}
+
+#ifdef IBPP_WINDOWS
+	void ClientLibSearchPaths(const std::string& paths)
+	{
+		gds.mSearchPaths.assign(paths);
+	}
+#else
+	void ClientLibSearchPaths(const std::string&)
+	{
+	}
+#endif
+
+	//	Factories for our Interface objects
+
+	Service ServiceFactory(const std::string& ServerName,
+				const std::string& UserName, const std::string& UserPassword)
+	{
+		(void)gds.Call();			// Triggers the initialization, if needed
+		return new ServiceImpl(ServerName, UserName, UserPassword);
+	}
+
+	Database DatabaseFactory(const std::string& ServerName,
+		const std::string& DatabaseName, const std::string& UserName,
+		const std::string& UserPassword, const std::string& RoleName,
+		const std::string& CharSet, const std::string& CreateParams)
+	{
+		(void)gds.Call();			// Triggers the initialization, if needed
+		return new DatabaseImpl(ServerName, DatabaseName, UserName,
+								UserPassword, RoleName, CharSet, CreateParams);
+	}
+
+	Transaction TransactionFactory(Database db, TAM am,
+					TIL il, TLR lr, TFF flags)
+	{
+		(void)gds.Call();			// Triggers the initialization, if needed
+		return new TransactionImpl(	dynamic_cast<DatabaseImpl*>(db.intf()),
+									am, il, lr, flags);
+	}
+
+	Statement StatementFactory(Database db, Transaction tr,
+		const std::string& sql)
+	{
+		(void)gds.Call();			// Triggers the initialization, if needed
+		return new StatementImpl(	dynamic_cast<DatabaseImpl*>(db.intf()),
+									dynamic_cast<TransactionImpl*>(tr.intf()),
+									sql);
+	}
+
+	Blob BlobFactory(Database db, Transaction tr)
+	{
+		(void)gds.Call();			// Triggers the initialization, if needed
+		return new BlobImpl(dynamic_cast<DatabaseImpl*>(db.intf()),
+							dynamic_cast<TransactionImpl*>(tr.intf()));
+	}
+
+	Array ArrayFactory(Database db, Transaction tr)
+	{
+		(void)gds.Call();			// Triggers the initialization, if needed
+		return new ArrayImpl(dynamic_cast<DatabaseImpl*>(db.intf()),
+							dynamic_cast<TransactionImpl*>(tr.intf()));
+	}
+
+	Events EventsFactory(Database db)
+	{
+		(void)gds.Call();			// Triggers the initialization, if needed
+		return new EventsImpl(dynamic_cast<DatabaseImpl*>(db.intf()));
+	}
+
+}
+
+//
+//	EOF
+//
+
diff --git a/src/terralib/drivers/Firebird/ibpp/core/_ibpp.h b/src/terralib/drivers/Firebird/ibpp/core/_ibpp.h
new file mode 100644
index 0000000..ddbb028
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/_ibpp.h
@@ -0,0 +1,1414 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: _ibpp.h 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP internal declarations
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//
+//	* 'Internal declarations' means everything used to implement ibpp. This
+//	  file and its contents is NOT needed by users of the library. All those
+//	  declarations are wrapped in a namespace : 'ibpp_internals'.
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef __INTERNAL_IBPP_H__
+#define __INTERNAL_IBPP_H__
+
+#include "ibpp.h"
+
+#if defined(__BCPLUSPLUS__) || defined(_MSC_VER) || defined(__DMC__)
+#define HAS_HDRSTOP
+#endif
+
+#if (defined(__GNUC__) && defined(IBPP_WINDOWS))
+//	Setting flags for ibase.h -- using GCC/Cygwin/MinGW on Win32
+#ifndef _MSC_VER
+#define _MSC_VER 1299
+#endif
+#ifndef _WIN32
+#define _WIN32   1
+#endif
+#endif
+
+#include "ibase.h"		// From Firebird 1.x or InterBase 6.x installation
+
+#if (defined(__GNUC__) && defined(IBPP_WINDOWS))
+//	UNSETTING flags used above for ibase.h -- Huge conflicts with libstdc++ !
+#undef _MSC_VER
+#undef _WIN32
+#endif
+
+#ifdef IBPP_WINDOWS
+#include <windows.h>
+#endif
+
+#include <limits>
+#include <string>
+#include <vector>
+#include <sstream>
+#include <cstdarg>
+
+#ifdef _DEBUG
+#define ASSERTION(x)	{if (!(x)) {throw LogicExceptionImpl("ASSERTION", \
+							"'"#x"' is not verified at %s, line %d", \
+								__FILE__, __LINE__);}}
+#else
+#define ASSERTION(x)	/* x */
+#endif
+
+// Fix to famous MSVC 6 variable scope bug
+#if defined(_MSC_VER) && (_MSC_VER < 1300)	// MSVC 6 should be < 1300
+#define for if(true)for
+#endif
+
+namespace ibpp_internals
+{
+
+enum flush_debug_stream_type {fds};
+
+#ifdef _DEBUG
+
+struct DebugStream : public std::stringstream
+{
+	// next two operators fix some g++ and vc++ related problems
+	std::ostream& operator<< (const char* p)
+		{ static_cast<std::stringstream&>(*this)<< p; return *this; }
+
+	std::ostream& operator<< (const std::string& p)
+		{ static_cast<std::stringstream&>(*this)<< p; return *this; }
+
+	DebugStream& operator=(const DebugStream&) {return *this;}
+	DebugStream(const DebugStream&) {}
+	DebugStream() {}
+};
+std::ostream& operator<< (std::ostream& a, flush_debug_stream_type);
+
+#else
+
+struct DebugStream
+{
+	template<class T> DebugStream& operator<< (const T&) { return *this; }
+	// for manipulators
+	DebugStream& operator<< (std::ostream&(*)(std::ostream&)) { return *this; }
+};
+
+#endif	// _DEBUG
+
+class DatabaseImpl;
+class TransactionImpl;
+class StatementImpl;
+class BlobImpl;
+class ArrayImpl;
+class EventsImpl;
+
+//	Native data types
+typedef enum {ivArray, ivBlob, ivDate, ivTime, ivTimestamp, ivString,
+			ivInt16, ivInt32, ivInt64, ivFloat, ivDouble,
+			ivBool, ivDBKey, ivByte} IITYPE;
+
+//
+//	Those are the Interbase C API prototypes that we use
+//	Taken 'asis' from IBASE.H, prefix 'isc_' replaced with 'proto_',
+//	and 'typedef' preprended...
+//
+
+typedef ISC_STATUS ISC_EXPORT proto_create_database (ISC_STATUS *,
+					    short,
+					    char *,
+					    isc_db_handle *,
+					    short,
+					    char *,
+					    short);
+
+typedef ISC_STATUS ISC_EXPORT proto_attach_database (ISC_STATUS *,
+					    short,
+					    char *,
+					    isc_db_handle *,
+					    short,
+					    char *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_detach_database (ISC_STATUS *,
+					    isc_db_handle *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_drop_database (ISC_STATUS *,
+					  isc_db_handle *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_database_info (ISC_STATUS *,
+					  isc_db_handle *,
+					  short,
+					  char *,
+					  short,
+					  char *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_execute_immediate (ISC_STATUS *,
+						   isc_db_handle *,
+						   isc_tr_handle *,
+						   unsigned short,
+						   char *,
+						   unsigned short,
+						   XSQLDA *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_open_blob2 (ISC_STATUS *,
+				       isc_db_handle *,
+				       isc_tr_handle *,
+				       isc_blob_handle *,
+				       ISC_QUAD *,
+				       short,
+				       char *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_create_blob2 (ISC_STATUS *,
+					isc_db_handle *,
+					isc_tr_handle *,
+					isc_blob_handle *,
+					ISC_QUAD *,
+					short,
+					char *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_close_blob (ISC_STATUS *,
+				       isc_blob_handle *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_cancel_blob (ISC_STATUS *,
+				        isc_blob_handle *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_get_segment (ISC_STATUS *,
+				        isc_blob_handle *,
+				        unsigned short *,
+				        unsigned short,
+				        char *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_put_segment (ISC_STATUS *,
+					isc_blob_handle *,
+					unsigned short,
+					char *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_blob_info (ISC_STATUS *,
+				      isc_blob_handle *,
+				      short,
+ 				      char *,
+				      short,
+				      char *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_array_lookup_bounds (ISC_STATUS *,
+						isc_db_handle *,
+						isc_tr_handle *,
+						char *,
+						char *,
+						ISC_ARRAY_DESC *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_array_get_slice (ISC_STATUS *,
+					    isc_db_handle *,
+					    isc_tr_handle *,
+					    ISC_QUAD *,
+					    ISC_ARRAY_DESC *,
+					    void *,
+					    ISC_LONG *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_array_put_slice (ISC_STATUS *,
+					    isc_db_handle *,
+					    isc_tr_handle *,
+					    ISC_QUAD *,
+					    ISC_ARRAY_DESC *,
+					    void *,
+					    ISC_LONG *);
+
+typedef ISC_LONG    ISC_EXPORT proto_vax_integer (char *,
+					short);
+
+typedef ISC_LONG    ISC_EXPORT proto_sqlcode (ISC_STATUS *);
+
+typedef void        ISC_EXPORT proto_sql_interprete (short,
+					   char *,
+					   short);
+
+typedef ISC_STATUS  ISC_EXPORT proto_interprete (char *,
+				       ISC_STATUS * *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_que_events (ISC_STATUS *,
+				       isc_db_handle *,
+				       ISC_LONG *,
+				       short,
+				       char *,
+				       isc_callback,
+				       void *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_cancel_events (ISC_STATUS *,
+					  isc_db_handle *,
+					  ISC_LONG *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_start_multiple (ISC_STATUS *,
+					   isc_tr_handle *,
+					   short,
+					   void *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_commit_transaction (ISC_STATUS *,
+					       isc_tr_handle *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_commit_retaining (ISC_STATUS *,
+					     isc_tr_handle *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_rollback_transaction (ISC_STATUS *,
+						 isc_tr_handle *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_rollback_retaining (ISC_STATUS *,
+						 isc_tr_handle *);
+
+///////////
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_allocate_statement (ISC_STATUS *,
+						    isc_db_handle *,
+						    isc_stmt_handle *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_describe (ISC_STATUS *,
+					  isc_stmt_handle *,
+					  unsigned short,
+					  XSQLDA *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_describe_bind (ISC_STATUS *,
+					       isc_stmt_handle *,
+					       unsigned short,
+					       XSQLDA *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_execute (ISC_STATUS *,
+					 isc_tr_handle *,
+					 isc_stmt_handle *,
+					 unsigned short,
+					 XSQLDA *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_execute2 (ISC_STATUS *,
+					  isc_tr_handle *,
+					  isc_stmt_handle *,
+					  unsigned short,
+					  XSQLDA *,
+					  XSQLDA *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_fetch (ISC_STATUS *,
+				       isc_stmt_handle *,
+				       unsigned short,
+				       XSQLDA *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_free_statement (ISC_STATUS *,
+						isc_stmt_handle *,
+						unsigned short);
+
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_prepare (ISC_STATUS *,
+					 isc_tr_handle *,
+					 isc_stmt_handle *,
+					 unsigned short,
+					 char *,
+					 unsigned short,
+				 	 XSQLDA *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_set_cursor_name (ISC_STATUS *,
+						 isc_stmt_handle *,
+						 char *,
+						 unsigned short);
+
+typedef ISC_STATUS  ISC_EXPORT proto_dsql_sql_info (ISC_STATUS *,
+					  isc_stmt_handle *,
+					  short,
+					  char *,
+					  short,
+					  char *);
+
+typedef void        ISC_EXPORT proto_decode_date (ISC_QUAD *,
+					void *);
+
+typedef void        ISC_EXPORT proto_encode_date (void *,
+					ISC_QUAD *);
+
+typedef int			ISC_EXPORT proto_add_user (ISC_STATUS *, USER_SEC_DATA *);
+typedef int			ISC_EXPORT proto_delete_user (ISC_STATUS *, USER_SEC_DATA *);
+typedef int			ISC_EXPORT proto_modify_user (ISC_STATUS *, USER_SEC_DATA *);
+
+//
+//	Those API are only available in versions 6.x of the GDS32.DLL
+//
+
+typedef ISC_STATUS  ISC_EXPORT proto_service_attach (ISC_STATUS *,
+					   unsigned short,
+					   char *,
+					   isc_svc_handle *,
+					   unsigned short,
+					   char *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_service_detach (ISC_STATUS *,
+					   isc_svc_handle *);
+
+typedef ISC_STATUS  ISC_EXPORT proto_service_query (ISC_STATUS *,
+					  isc_svc_handle *,
+                      		          isc_resv_handle *,
+					  unsigned short,
+					  char *,
+					  unsigned short,
+					  char *,
+					  unsigned short,
+					  char *);
+
+typedef ISC_STATUS ISC_EXPORT proto_service_start (ISC_STATUS *,
+    					 isc_svc_handle *,
+                         		 isc_resv_handle *,
+    					 unsigned short,
+    					 char*);
+
+typedef void        ISC_EXPORT proto_decode_sql_date (ISC_DATE *,
+					void *);
+
+typedef void        ISC_EXPORT proto_decode_sql_time (ISC_TIME *,
+					void *);
+
+typedef void        ISC_EXPORT proto_decode_timestamp (ISC_TIMESTAMP *,
+					void *);
+
+typedef void        ISC_EXPORT proto_encode_sql_date (void *,
+					ISC_DATE *);
+
+typedef void        ISC_EXPORT proto_encode_sql_time (void *,
+					ISC_TIME *);
+
+typedef void        ISC_EXPORT proto_encode_timestamp (void *,
+					ISC_TIMESTAMP *);
+
+//
+//	Internal binding structure to the GDS32 DLL
+//
+
+struct GDS
+{
+	// Attributes
+	bool mReady;
+	int mGDSVersion; 		// Version of the GDS32.DLL (50 for 5.0, 60 for 6.0)
+
+#ifdef IBPP_WINDOWS
+	HMODULE mHandle;			// The GDS32.DLL HMODULE
+	std::string mSearchPaths;	// Optional additional search paths
+#endif
+
+	GDS* Call();
+
+	// GDS32 Entry Points
+	proto_create_database*			m_create_database;
+	proto_attach_database*			m_attach_database;
+	proto_detach_database*			m_detach_database;
+	proto_drop_database*			m_drop_database;
+	proto_database_info*			m_database_info;
+	proto_dsql_execute_immediate*	m_dsql_execute_immediate;
+	proto_open_blob2*				m_open_blob2;
+	proto_create_blob2*				m_create_blob2;
+	proto_close_blob*				m_close_blob;
+	proto_cancel_blob*				m_cancel_blob;
+	proto_get_segment*				m_get_segment;
+	proto_put_segment*				m_put_segment;
+	proto_blob_info*				m_blob_info;
+	proto_array_lookup_bounds*		m_array_lookup_bounds;
+	proto_array_get_slice*			m_array_get_slice;
+	proto_array_put_slice*			m_array_put_slice;
+
+	proto_vax_integer*				m_vax_integer;
+	proto_sqlcode*					m_sqlcode;
+	proto_sql_interprete*			m_sql_interprete;
+	proto_interprete*				m_interprete;
+	proto_que_events*				m_que_events;
+	proto_cancel_events* 			m_cancel_events;
+	proto_start_multiple*			m_start_multiple;
+	proto_commit_transaction*		m_commit_transaction;
+	proto_commit_retaining*			m_commit_retaining;
+	proto_rollback_transaction*		m_rollback_transaction;
+	proto_rollback_retaining*		m_rollback_retaining;
+	proto_dsql_allocate_statement*	m_dsql_allocate_statement;
+	proto_dsql_describe*			m_dsql_describe;
+	proto_dsql_describe_bind*		m_dsql_describe_bind;
+	proto_dsql_prepare*				m_dsql_prepare;
+	proto_dsql_execute*				m_dsql_execute;
+	proto_dsql_execute2*			m_dsql_execute2;
+	proto_dsql_fetch*				m_dsql_fetch;
+	proto_dsql_free_statement*		m_dsql_free_statement;
+	proto_dsql_set_cursor_name*		m_dsql_set_cursor_name;
+	proto_dsql_sql_info* 			m_dsql_sql_info;
+	//proto_decode_date*				m_decode_date;
+	//proto_encode_date*				m_encode_date;
+	//proto_add_user*					m_add_user;
+	//proto_delete_user*				m_delete_user;
+	//proto_modify_user*				m_modify_user;
+
+	proto_service_attach*			m_service_attach;
+	proto_service_detach*			m_service_detach;
+	proto_service_start*			m_service_start;
+	proto_service_query*			m_service_query;
+	//proto_decode_sql_date*			m_decode_sql_date;
+	//proto_decode_sql_time*			m_decode_sql_time;
+	//proto_decode_timestamp*			m_decode_timestamp;
+	//proto_encode_sql_date*			m_encode_sql_date;
+	//proto_encode_sql_time*			m_encode_sql_time;
+	//proto_encode_timestamp*			m_encode_timestamp;
+
+	// Constructor (No need for a specific destructor)
+	GDS()
+	{
+		mReady = false;
+		mGDSVersion = 0;
+#ifdef IBPP_WINDOWS
+		mHandle = 0;
+#endif
+	};
+};
+
+extern GDS gds;
+
+//
+//	Service Parameter Block (used to define a service)
+//
+
+class SPB
+{
+	static const int BUFFERINCR;
+
+	char* mBuffer;				// Dynamically allocated SPB structure
+	int mSize;  				// Its used size in bytes
+	int mAlloc;					// Its allocated size in bytes
+
+	void Grow(int needed);		// Alloc or grow the mBuffer
+
+public:
+	void Insert(char);			// Insert a single byte code
+	void InsertString(char, int, const char*);	// Insert a string, len can be defined as 1 or 2 bytes
+	void InsertByte(char type, char data);
+	void InsertQuad(char type, int32_t data);
+	void Reset();			// Clears the SPB
+	char* Self() { return mBuffer; }
+	short Size() { return (short)mSize; }
+
+	SPB() : mBuffer(0), mSize(0), mAlloc(0) { }
+	~SPB() { Reset(); }
+};
+
+//
+//	Database Parameter Block (used to define a database)
+//
+
+class DPB
+{
+	static const int BUFFERINCR;
+
+	char* mBuffer;				// Dynamically allocated DPB structure
+	int mSize;  				// Its used size in bytes
+	int mAlloc;					// Its allocated size in bytes
+
+	void Grow(int needed);		// Allocate or grow the mBuffer, so that
+								// 'needed' bytes can be written (at least)
+
+public:
+	void Insert(char, const char*);	// Insert a new char* 'cluster'
+	void Insert(char, int16_t);		// Insert a new int16_t 'cluster'
+	void Insert(char, bool);   		// Insert a new bool 'cluster'
+	void Insert(char, char);   		// Insert a new byte 'cluster'
+	void Reset();				// Clears the DPB
+	char* Self() { return mBuffer; }
+	short Size() { return (short)mSize; }
+
+	DPB() : mBuffer(0), mSize(0), mAlloc(0) { }
+	~DPB() { Reset(); }
+};
+
+//
+//	Transaction Parameter Block (used to define a transaction)
+//
+
+class TPB
+{
+	static const int BUFFERINCR;
+
+	char* mBuffer;					// Dynamically allocated TPB structure
+	int mSize;						// Its used size in bytes
+	int mAlloc;						// Its allocated size
+
+	void Grow(int needed);			// Alloc or re-alloc the mBuffer
+
+public:
+	void Insert(char);				// Insert a flag item
+	void Insert(const std::string& data); // Insert a string (typically table name)
+	void Reset();				// Clears the TPB
+	char* Self() { return mBuffer; }
+	int Size() { return mSize; }
+
+	TPB() : mBuffer(0), mSize(0), mAlloc(0) { }
+	~TPB() { Reset(); }
+};
+
+//
+//	Used to receive (and process) a results buffer in various API calls
+//
+
+class RB
+{
+	char* mBuffer;
+	int mSize;
+
+	char* FindToken(char token);
+	char* FindToken(char token, char subtoken);
+
+public:
+	void Reset();
+	int GetValue(char token);
+	int GetCountValue(char token);
+	int GetValue(char token, char subtoken);
+	bool GetBool(char token);
+	int GetString(char token, std::string& data);
+
+	char* Self() { return mBuffer; }
+	short Size() { return (short)mSize; }
+
+	RB();
+	RB(int Size);
+	~RB();
+};
+
+//
+//	Used to receive status info from API calls
+//
+
+class IBS
+{
+	mutable ISC_STATUS mVector[20];
+	mutable std::string mMessage;
+
+public:
+	ISC_STATUS* Self() { return mVector; }
+	bool Errors() { return (mVector[0] == 1 && mVector[1] > 0) ? true : false; }
+	const char* ErrorMessage() const;
+	int SqlCode() const;
+	int EngineCode() const { return (mVector[0] == 1) ? (int)mVector[1] : 0; }
+	void Reset();
+
+	IBS();
+	IBS(IBS&);	// Copy Constructor
+	~IBS();
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+//	Implementation of the "hidden" classes associated with their public
+//	counterparts. Their private data and methods can freely change without
+//	breaking the compatibility of the DLL. If they receive new public methods,
+//	and those methods are reflected in the public class, then the compatibility
+//	is broken.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+//
+// Hidden implementation of Exception classes.
+//
+
+/*
+                         std::exception
+                                |
+                         IBPP::Exception
+                       /                 \
+                      /                   \
+  IBPP::LogicException    ExceptionBase    IBPP::SQLException
+        |        \         /   |     \     /
+        |   LogicExceptionImpl |   SQLExceptionImpl
+        |                      |
+    IBPP::WrongType            |
+               \               |
+              IBPP::WrongTypeImpl
+*/
+
+class ExceptionBase
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+protected:
+	std::string mContext; 			// Exception context ("IDatabase::Drop")
+	std::string mWhat;				// Full formatted message
+
+	void buildErrorMessage(const char* message);
+	void raise(const std::string& context, const char* message, va_list argptr);
+
+public:
+	// The following constructors are small and could be inlined, but for object
+	// code compacity of the library it is much better to have them non-inlined.
+	// The amount of code generated by compilers for a throw is well-enough.
+
+	ExceptionBase() throw();
+	ExceptionBase(const ExceptionBase& copied) throw();
+	ExceptionBase& operator=(const ExceptionBase& copied) throw();
+	ExceptionBase(const std::string& context, const char* message = 0, ...) throw();
+
+	virtual ~ExceptionBase() throw();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+
+    virtual const char* Origin() const throw();
+    virtual const char* ErrorMessage() const throw();
+	virtual const char* what() const throw();
+};
+
+class LogicExceptionImpl : public IBPP::LogicException, public ExceptionBase
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+public:
+	// The following constructors are small and could be inlined, but for object
+	// code compacity of the library it is much better to have them non-inlined.
+	// The amount of code generated by compilers for a throw is well-enough.
+
+	LogicExceptionImpl() throw();
+	LogicExceptionImpl(const LogicExceptionImpl& copied) throw();
+	LogicExceptionImpl& operator=(const LogicExceptionImpl& copied) throw();
+	LogicExceptionImpl(const std::string& context, const char* message = 0, ...) throw();
+
+	virtual ~LogicExceptionImpl() throw ();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+	//
+	//	The object public interface is partly implemented by inheriting from
+	//	the ExceptionBase class.
+
+public:
+    virtual const char* Origin() const throw();
+    virtual const char* ErrorMessage() const throw();
+	virtual const char* what() const throw();
+};
+
+class SQLExceptionImpl : public IBPP::SQLException, public ExceptionBase
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+private:
+	int mSqlCode;
+	int mEngineCode;
+
+public:
+	// The following constructors are small and could be inlined, but for object
+	// code compacity of the library it is much better to have them non-inlined.
+	// The amount of code generated by compilers for a throw is well-enough.
+
+	SQLExceptionImpl() throw();
+	SQLExceptionImpl(const SQLExceptionImpl& copied) throw();
+	SQLExceptionImpl& operator=(const SQLExceptionImpl& copied) throw();
+	SQLExceptionImpl(const IBS& status, const std::string& context,
+						const char* message = 0, ...) throw();
+
+	virtual ~SQLExceptionImpl() throw ();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+	//
+	//	The object public interface is partly implemented by inheriting from
+	//	the ExceptionBase class.
+
+public:
+    virtual const char* Origin() const throw();
+    virtual const char* ErrorMessage() const throw();
+	virtual const char* what() const throw();
+	virtual int SqlCode() const throw();
+	virtual int EngineCode() const throw();
+};
+
+class WrongTypeImpl : public IBPP::WrongType, public ExceptionBase
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+public:
+	// The following constructors are small and could be inlined, but for object
+	// code compacity of the library it is much better to have them non-inlined.
+	// The amount of code generated by compilers for a throw is well-enough.
+
+	WrongTypeImpl() throw();
+	WrongTypeImpl(const WrongTypeImpl& copied) throw();
+	WrongTypeImpl& operator=(const WrongTypeImpl& copied) throw();
+	WrongTypeImpl(const std::string& context, int sqlType, IITYPE varType,
+					const char* message = 0, ...) throw();
+
+	virtual ~WrongTypeImpl() throw ();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+	//
+	//	The object public interface is partly implemented by inheriting from
+	//	the ExceptionBase class.
+
+public:
+    virtual const char* Origin() const throw();
+    virtual const char* ErrorMessage() const throw();
+	virtual const char* what() const throw();
+};
+
+class ServiceImpl : public IBPP::IService
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+private:
+	int mRefCount;				// Reference counter
+    isc_svc_handle mHandle;		// InterBase API Service Handle
+	std::string mServerName;	// Nom du serveur
+    std::string mUserName;		// Nom de l'utilisateur
+    std::string mUserPassword;	// Mot de passe de l'utilisateur
+	std::string mWaitMessage;	// Progress message returned by WaitMsg()
+
+	isc_svc_handle* GetHandlePtr() { return &mHandle; }
+	void SetServerName(const char*);
+	void SetUserName(const char*);
+	void SetUserPassword(const char*);
+
+public:
+	isc_svc_handle GetHandle() { return mHandle; }
+
+	ServiceImpl(const std::string& ServerName, const std::string& UserName,
+					const std::string& UserPassword);
+    ~ServiceImpl();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+
+public:
+    void Connect();
+	bool Connected() { return mHandle == 0 ? false : true; }
+	void Disconnect();
+
+	void GetVersion(std::string& version);
+
+	void AddUser(const IBPP::User&);
+	void GetUser(IBPP::User&);
+	void GetUsers(std::vector<IBPP::User>&);
+	void ModifyUser(const IBPP::User&);
+	void RemoveUser(const std::string& username);
+
+	void SetPageBuffers(const std::string& dbfile, int buffers);
+	void SetSweepInterval(const std::string& dbfile, int sweep);
+	void SetSyncWrite(const std::string& dbfile, bool);
+	void SetReadOnly(const std::string& dbfile, bool);
+	void SetReserveSpace(const std::string& dbfile, bool);
+
+	void Shutdown(const std::string& dbfile, IBPP::DSM mode, int sectimeout);
+	void Restart(const std::string& dbfile);
+	void Sweep(const std::string& dbfile);
+	void Repair(const std::string& dbfile, IBPP::RPF flags);
+
+	void StartBackup(const std::string& dbfile, const std::string& bkfile,
+		IBPP::BRF flags = IBPP::BRF(0));
+	void StartRestore(const std::string& bkfile, const std::string& dbfile,
+		int pagesize, IBPP::BRF flags = IBPP::BRF(0));
+
+	const char* WaitMsg();
+	void Wait();
+
+	IBPP::IService* AddRef();
+	void Release();
+};
+
+class DatabaseImpl : public IBPP::IDatabase
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+	int mRefCount;				// Reference counter
+    isc_db_handle mHandle;		// InterBase API Session Handle
+	std::string mServerName;	// Server name
+    std::string mDatabaseName;	// Database name (path/file)
+    std::string mUserName;	  	// User name
+    std::string mUserPassword;	// User password
+    std::string mRoleName;	  	// Role used for the duration of the connection
+	std::string mCharSet;	  	// Character Set used for the connection
+	std::string mCreateParams;	// Other parameters (creation only)
+
+	int mDialect;							// 1 if IB5, 1 or 3 if IB6/FB1
+	std::vector<TransactionImpl*> mTransactions;// Table of Transaction*
+	std::vector<StatementImpl*> mStatements;// Table of Statement*
+	std::vector<BlobImpl*> mBlobs;			// Table of Blob*
+	std::vector<ArrayImpl*> mArrays;		// Table of Array*
+	std::vector<EventsImpl*> mEvents;		// Table of Events*
+
+public:
+	isc_db_handle* GetHandlePtr() { return &mHandle; }
+	isc_db_handle GetHandle() { return mHandle; }
+
+	void AttachTransactionImpl(TransactionImpl*);
+	void DetachTransactionImpl(TransactionImpl*);
+	void AttachStatementImpl(StatementImpl*);
+	void DetachStatementImpl(StatementImpl*);
+	void AttachBlobImpl(BlobImpl*);
+	void DetachBlobImpl(BlobImpl*);
+	void AttachArrayImpl(ArrayImpl*);
+	void DetachArrayImpl(ArrayImpl*);
+	void AttachEventsImpl(EventsImpl*);
+	void DetachEventsImpl(EventsImpl*);
+
+	DatabaseImpl(const std::string& ServerName, const std::string& DatabaseName,
+				const std::string& UserName, const std::string& UserPassword,
+				const std::string& RoleName, const std::string& CharSet,
+				const std::string& CreateParams);
+    ~DatabaseImpl();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+
+public:
+	const char* ServerName() const		{ return mServerName.c_str(); }
+	const char* DatabaseName() const	{ return mDatabaseName.c_str(); }
+	const char* Username() const		{ return mUserName.c_str(); }
+	const char* UserPassword() const	{ return mUserPassword.c_str(); }
+	const char* RoleName() const		{ return mRoleName.c_str(); }
+	const char* CharSet() const			{ return mCharSet.c_str(); }
+	const char* CreateParams() const	{ return mCreateParams.c_str(); }
+
+	void Info(int* ODSMajor, int* ODSMinor,
+		int* PageSize, int* Pages, int* Buffers, int* Sweep,
+		bool* SyncWrites, bool* Reserve);
+	void Statistics(int* Fetches, int* Marks, int* Reads, int* Writes);
+	void Counts(int* Insert, int* Update, int* Delete,
+		int* ReadIdx, int* ReadSeq);
+	void Users(std::vector<std::string>& users);
+	int Dialect() { return mDialect; }
+
+    void Create(int dialect);
+	void Connect();
+	bool Connected() { return mHandle == 0 ? false : true; }
+	void Inactivate();
+	void Disconnect();
+    void Drop();
+
+	IBPP::IDatabase* AddRef();
+	void Release();
+};
+
+class TransactionImpl : public IBPP::ITransaction
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+private:
+	int mRefCount;					// Reference counter
+    isc_tr_handle mHandle;			// Transaction InterBase
+
+	std::vector<DatabaseImpl*> mDatabases;   	// Tableau de IDatabase*
+	std::vector<StatementImpl*> mStatements;	// Tableau de IStatement*
+	std::vector<BlobImpl*> mBlobs;				// Tableau de IBlob*
+	std::vector<ArrayImpl*> mArrays;			// Tableau de Array*
+	std::vector<TPB*> mTPBs;					// Tableau de TPB
+
+	void Init();			// A usage exclusif des constructeurs
+
+public:
+	isc_tr_handle* GetHandlePtr() { return &mHandle; }
+	isc_tr_handle GetHandle() { return mHandle; }
+
+	void AttachStatementImpl(StatementImpl*);
+	void DetachStatementImpl(StatementImpl*);
+	void AttachBlobImpl(BlobImpl*);
+	void DetachBlobImpl(BlobImpl*);
+	void AttachArrayImpl(ArrayImpl*);
+	void DetachArrayImpl(ArrayImpl*);
+    void AttachDatabaseImpl(DatabaseImpl* dbi, IBPP::TAM am = IBPP::amWrite,
+			IBPP::TIL il = IBPP::ilConcurrency,
+			IBPP::TLR lr = IBPP::lrWait, IBPP::TFF flags = IBPP::TFF(0));
+    void DetachDatabaseImpl(DatabaseImpl* dbi);
+
+	TransactionImpl(DatabaseImpl* db, IBPP::TAM am = IBPP::amWrite,
+		IBPP::TIL il = IBPP::ilConcurrency,
+		IBPP::TLR lr = IBPP::lrWait, IBPP::TFF flags = IBPP::TFF(0));
+    ~TransactionImpl();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+
+public:
+    void AttachDatabase(IBPP::Database db, IBPP::TAM am = IBPP::amWrite,
+			IBPP::TIL il = IBPP::ilConcurrency,
+			IBPP::TLR lr = IBPP::lrWait, IBPP::TFF flags = IBPP::TFF(0));
+    void DetachDatabase(IBPP::Database db);
+	void AddReservation(IBPP::Database db,
+			const std::string& table, IBPP::TTR tr);
+
+    void Start();
+	bool Started() { return mHandle == 0 ? false : true; }
+    void Commit();
+    void Rollback();
+    void CommitRetain();
+	void RollbackRetain();
+
+	IBPP::ITransaction* AddRef();
+	void Release();
+};
+
+class RowImpl : public IBPP::IRow
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+private:
+	int mRefCount;					// Reference counter
+
+	XSQLDA* mDescrArea;				// XSQLDA descriptor itself
+	std::vector<double> mNumerics;	// Temporary storage for Numerics
+	std::vector<float> mFloats;	 	// Temporary storage for Floats
+	std::vector<int64_t> mInt64s;	// Temporary storage for 64 bits
+	std::vector<int32_t> mInt32s;	// Temporary storage for 32 bits
+	std::vector<int16_t> mInt16s;	// Temporary storage for 16 bits
+	std::vector<char> mBools;		// Temporary storage for Bools
+	std::vector<std::string> mStrings;	// Temporary storage for Strings
+	std::vector<bool> mUpdated;		// Which columns where updated (Set()) ?
+
+	int mDialect;					// Related database dialect
+	DatabaseImpl* mDatabase;		// Related Database (important for Blobs, ...)
+	TransactionImpl* mTransaction;	// Related Transaction (same remark)
+
+	void SetValue(int, IITYPE, const void* value, int = 0);
+	void* GetValue(int, IITYPE, void* = 0);
+
+public:
+	void Free();
+	short AllocatedSize() { return mDescrArea->sqln; }
+	void Resize(int n);
+	void AllocVariables();
+	bool MissingValues();		// Returns wether one of the mMissing[] is true
+	XSQLDA* Self() { return mDescrArea; }
+
+	RowImpl& operator=(const RowImpl& copied);
+	RowImpl(const RowImpl& copied);
+	RowImpl(int dialect, int size, DatabaseImpl* db, TransactionImpl* tr);
+    ~RowImpl();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+
+public:
+	void SetNull(int);
+	void Set(int, bool);
+	void Set(int, const char*);				// c-strings
+	void Set(int, const void*, int);		// byte buffers
+	void Set(int, const std::string&);
+	void Set(int, int16_t);
+	void Set(int, int32_t);
+	void Set(int, int64_t);
+	void Set(int, float);
+	void Set(int, double);
+	void Set(int, const IBPP::Timestamp&);
+	void Set(int, const IBPP::Date&);
+	void Set(int, const IBPP::Time&);
+	void Set(int, const IBPP::DBKey&);
+	void Set(int, const IBPP::Blob&);
+	void Set(int, const IBPP::Array&);
+
+	bool IsNull(int);
+	bool Get(int, bool&);
+	bool Get(int, char*);  		// c-strings, len unchecked
+	bool Get(int, void*, int&);	// byte buffers
+	bool Get(int, std::string&);
+	bool Get(int, int16_t&);
+	bool Get(int, int32_t&);
+	bool Get(int, int64_t&);
+	bool Get(int, float&);
+	bool Get(int, double&);
+	bool Get(int, IBPP::Timestamp&);
+	bool Get(int, IBPP::Date&);
+	bool Get(int, IBPP::Time&);
+	bool Get(int, IBPP::DBKey&);
+	bool Get(int, IBPP::Blob&);
+	bool Get(int, IBPP::Array&);
+
+	bool IsNull(const std::string&);
+	bool Get(const std::string&, bool&);
+	bool Get(const std::string&, char*);	// c-strings, len unchecked
+	bool Get(const std::string&, void*, int&);	// byte buffers
+	bool Get(const std::string&, std::string&);
+	bool Get(const std::string&, int16_t&);
+	bool Get(const std::string&, int32_t&);
+	bool Get(const std::string&, int64_t&);
+	bool Get(const std::string&, float&);
+	bool Get(const std::string&, double&);
+	bool Get(const std::string&, IBPP::Timestamp&);
+	bool Get(const std::string&, IBPP::Date&);
+	bool Get(const std::string&, IBPP::Time&);
+	bool Get(const std::string&, IBPP::DBKey&);
+	bool Get(const std::string&, IBPP::Blob&);
+	bool Get(const std::string&, IBPP::Array&);
+
+	int ColumnNum(const std::string&);
+	const char* ColumnName(int);
+	const char* ColumnAlias(int);
+	const char* ColumnTable(int);
+	IBPP::SDT ColumnType(int);
+	int ColumnSubtype(int);
+	int ColumnSize(int);
+	int ColumnScale(int);
+	int Columns();
+
+	bool ColumnUpdated(int);
+	bool Updated();
+
+	IBPP::Database DatabasePtr() const;
+	IBPP::Transaction TransactionPtr() const;
+
+	IBPP::IRow* Clone();
+	IBPP::IRow* AddRef();
+	void Release();
+};
+
+class StatementImpl : public IBPP::IStatement
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+private:
+	friend class TransactionImpl;
+
+	int mRefCount;				// Reference counter
+	isc_stmt_handle mHandle;	// Statement Handle
+
+	DatabaseImpl* mDatabase;		// Attached database
+	TransactionImpl* mTransaction;	// Attached transaction
+	RowImpl* mInRow;
+	//bool* mInMissing;			// Quels param�tres n'ont pas �t� sp�cifi�s
+	RowImpl* mOutRow;
+	bool mResultSetAvailable;	// Executed and result set is available
+	bool mCursorOpened;			// dsql_set_cursor_name was called
+	IBPP::STT mType;			// Type de requ�te
+	std::string mSql;			// Last SQL statement prepared or executed
+
+	// Internal Methods
+	void CursorFree();
+
+public:
+	// Properties and Attributes Access Methods
+	isc_stmt_handle GetHandle() { return mHandle; }
+
+	void AttachDatabaseImpl(DatabaseImpl*);
+	void DetachDatabaseImpl();
+	void AttachTransactionImpl(TransactionImpl*);
+	void DetachTransactionImpl();
+
+	StatementImpl(DatabaseImpl*, TransactionImpl*, const std::string&);
+    ~StatementImpl();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+
+public:
+	void Prepare(const std::string& sql);
+	void Execute(const std::string& sql);
+	inline void Execute()	{ Execute(std::string()); }
+	void ExecuteImmediate(const std::string&);
+	void CursorExecute(const std::string& cursor, const std::string& sql);
+	inline void CursorExecute(const std::string& cursor)	{ CursorExecute(cursor, std::string()); }
+	bool Fetch();
+	bool Fetch(IBPP::Row&);
+	int AffectedRows();
+	void Close();	// Free resources, attachments maintained
+	std::string& Sql() { return mSql; }
+	IBPP::STT Type() { return mType; }
+
+	void SetNull(int);
+	void Set(int, bool);
+	void Set(int, const char*);				// c-strings
+	void Set(int, const void*, int);		// byte buffers
+	void Set(int, const std::string&);
+	void Set(int, int16_t);
+	void Set(int, int32_t);
+	void Set(int, int64_t);
+	void Set(int, float);
+	void Set(int, double);
+	void Set(int, const IBPP::Timestamp&);
+	void Set(int, const IBPP::Date&);
+	void Set(int, const IBPP::Time&);
+	void Set(int, const IBPP::DBKey&);
+	void Set(int, const IBPP::Blob&);
+	void Set(int, const IBPP::Array&);
+
+	bool IsNull(int);
+	bool Get(int, bool*);
+	bool Get(int, bool&);
+	bool Get(int, char*);				// c-strings, len unchecked
+	bool Get(int, void*, int&);			// byte buffers
+	bool Get(int, std::string&);
+	bool Get(int, int16_t*);
+	bool Get(int, int16_t&);
+	bool Get(int, int32_t*);
+	bool Get(int, int32_t&);
+	bool Get(int, int64_t*);
+	bool Get(int, int64_t&);
+	bool Get(int, float*);
+	bool Get(int, float&);
+	bool Get(int, double*);
+	bool Get(int, double&);
+	bool Get(int, IBPP::Timestamp&);
+	bool Get(int, IBPP::Date&);
+	bool Get(int, IBPP::Time&);
+	bool Get(int, IBPP::DBKey&);
+	bool Get(int, IBPP::Blob&);
+	bool Get(int, IBPP::Array&);
+
+	bool IsNull(const std::string&);
+	bool Get(const std::string&, bool*);
+	bool Get(const std::string&, bool&);
+	bool Get(const std::string&, char*);		// c-strings, len unchecked
+	bool Get(const std::string&, void*, int&);	// byte buffers
+	bool Get(const std::string&, std::string&);
+	bool Get(const std::string&, int16_t*);
+	bool Get(const std::string&, int16_t&);
+	bool Get(const std::string&, int32_t*);
+	bool Get(const std::string&, int32_t&);
+	bool Get(const std::string&, int64_t*);
+	bool Get(const std::string&, int64_t&);
+	bool Get(const std::string&, float*);
+	bool Get(const std::string&, float&);
+	bool Get(const std::string&, double*);
+	bool Get(const std::string&, double&);
+	bool Get(const std::string&, IBPP::Timestamp&);
+	bool Get(const std::string&, IBPP::Date&);
+	bool Get(const std::string&, IBPP::Time&);
+	bool Get(const std::string&, IBPP::DBKey&);
+	bool Get(const std::string&, IBPP::Blob&);
+	bool Get(const std::string&, IBPP::Array&);
+
+	int ColumnNum(const std::string&);
+    int ColumnNumAlias(const std::string&);
+	const char* ColumnName(int);
+	const char* ColumnAlias(int);
+	const char* ColumnTable(int);
+	IBPP::SDT ColumnType(int);
+	int ColumnSubtype(int);
+	int ColumnSize(int);
+	int ColumnScale(int);
+	int Columns();
+
+	IBPP::SDT ParameterType(int);
+	int ParameterSubtype(int);
+	int ParameterSize(int);
+	int ParameterScale(int);
+	int Parameters();
+
+	void Plan(std::string&);
+
+	IBPP::Database DatabasePtr() const;
+	IBPP::Transaction TransactionPtr() const;
+
+	IBPP::IStatement* AddRef();
+	void Release();
+};
+
+class BlobImpl : public IBPP::IBlob
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+private:
+	friend class RowImpl;
+
+	int mRefCount;
+	bool					mIdAssigned;
+	ISC_QUAD				mId;
+	isc_blob_handle			mHandle;
+	bool					mWriteMode;
+	DatabaseImpl*  			mDatabase;		// Belongs to this database
+	TransactionImpl*		mTransaction;	// Belongs to this transaction
+
+	void Init();
+	void SetId(ISC_QUAD*);
+	void GetId(ISC_QUAD*);
+
+public:
+	void AttachDatabaseImpl(DatabaseImpl*);
+	void DetachDatabaseImpl();
+	void AttachTransactionImpl(TransactionImpl*);
+	void DetachTransactionImpl();
+
+	BlobImpl(const BlobImpl&);
+	BlobImpl(DatabaseImpl*, TransactionImpl* = 0);
+	~BlobImpl();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+
+public:
+	void Create();
+	void Open();
+	void Close();
+	void Cancel();
+	int Read(void*, int size);
+	void Write(const void*, int size);
+	void Info(int* Size, int* Largest, int* Segments);
+
+	void Save(const std::string& data);
+	void Load(std::string& data);
+
+	IBPP::Database DatabasePtr() const;
+	IBPP::Transaction TransactionPtr() const;
+
+	IBPP::IBlob* AddRef();
+	void Release();
+};
+
+class ArrayImpl : public IBPP::IArray
+{
+	//	(((((((( OBJECT INTERNALS ))))))))
+
+private:
+	friend class RowImpl;
+
+	int					mRefCount;		// Reference counter
+	bool				mIdAssigned;
+	ISC_QUAD			mId;
+	bool				mDescribed;
+	ISC_ARRAY_DESC		mDesc;
+	DatabaseImpl*  		mDatabase;		// Database attach�e
+	TransactionImpl*	mTransaction;	// Transaction attach�e
+	void*				mBuffer;		// Buffer for native data
+	int					mBufferSize;	// Size of this buffer in bytes
+	int					mElemCount;		// Count of elements in this array
+	int					mElemSize;		// Size of an element in the buffer
+
+	void Init();
+	void SetId(ISC_QUAD*);
+	void GetId(ISC_QUAD*);
+	void ResetId();
+	void AllocArrayBuffer();
+
+public:
+	void AttachDatabaseImpl(DatabaseImpl*);
+	void DetachDatabaseImpl();
+	void AttachTransactionImpl(TransactionImpl*);
+	void DetachTransactionImpl();
+
+	ArrayImpl(const ArrayImpl&);
+	ArrayImpl(DatabaseImpl*, TransactionImpl* = 0);
+	~ArrayImpl();
+
+	//	(((((((( OBJECT INTERFACE ))))))))
+
+public:
+	void Describe(const std::string& table, const std::string& column);
+	void ReadTo(IBPP::ADT, void*, int);
+	void WriteFrom(IBPP::ADT, const void*, int);
+	IBPP::SDT ElementType();
+	int ElementSize();
+	int ElementScale();
+	int Dimensions();
+	void Bounds(int dim, int* low, int* high);
+	void SetBounds(int dim, int low, int high);
+
+	IBPP::Database DatabasePtr() const;
+	IBPP::Transaction TransactionPtr() const;
+
+	IBPP::IArray* AddRef();
+	void Release();
+};
+
+//
+//	EventBufferIterator: used in EventsImpl implementation.
+//
+
+template<class It>
+struct EventBufferIterator
+{
+	It mIt;
+
+public:
+	EventBufferIterator& operator++()
+		{ mIt += 1 + static_cast<int>(*mIt) + 4; return *this; }
+
+	bool operator == (const EventBufferIterator& i) const { return i.mIt == mIt; }
+	bool operator != (const EventBufferIterator& i) const { return i.mIt != mIt; }
+
+#ifdef __BCPLUSPLUS__
+#pragma warn -8027
+#endif
+	std::string get_name() const
+	{
+		return std::string(mIt + 1, mIt + 1 + static_cast<int32_t>(*mIt));
+	}
+#ifdef __BCPLUSPLUS__
+#pragma warn .8027
+#endif
+
+	uint32_t get_count() const
+	{
+		return (*gds.Call()->m_vax_integer)
+			(const_cast<char*>(&*(mIt + 1 + static_cast<int>(*mIt))), 4);
+	}
+
+	// Those container like begin() and end() allow access to the underlying type
+	It begin()	{ return mIt; }
+	It end()	{ return mIt + 1 + static_cast<int>(*mIt) + 4; }
+
+	EventBufferIterator() {}
+	EventBufferIterator(It it) : mIt(it) {}
+};
+
+class EventsImpl : public IBPP::IEvents
+{
+	static const size_t MAXEVENTNAMELEN;
+	static void EventHandler(const char*, short, const char*);
+
+	typedef std::vector<IBPP::EventInterface*> ObjRefs;
+	ObjRefs mObjectReferences;
+
+	typedef std::vector<char> Buffer;
+	Buffer mEventBuffer;
+	Buffer mResultsBuffer;
+
+	int mRefCount;		// Reference counter
+
+	DatabaseImpl* mDatabase;
+	ISC_LONG mId;			// Firebird internal Id of these events
+	bool mQueued;			// Has isc_que_events() been called?
+	bool mTrapped;			// EventHandled() was called since last que_events()
+
+	void FireActions();
+	void Queue();
+	void Cancel();
+
+	EventsImpl& operator=(const EventsImpl&);
+	EventsImpl(const EventsImpl&);
+
+public:
+	void AttachDatabaseImpl(DatabaseImpl*);
+	void DetachDatabaseImpl();
+	
+	EventsImpl(DatabaseImpl* dbi);
+	~EventsImpl();
+		
+	//	(((((((( OBJECT INTERFACE ))))))))
+
+public:
+	void Add(const std::string&, IBPP::EventInterface*);
+	void Drop(const std::string&);
+	void List(std::vector<std::string>&);
+	void Clear();				// Drop all events
+	void Dispatch();			// Dispatch NON async events
+
+	IBPP::Database DatabasePtr() const;
+
+	IBPP::IEvents* AddRef();
+	void Release();
+};
+
+void encodeDate(ISC_DATE& isc_dt, const IBPP::Date& dt);
+void decodeDate(IBPP::Date& dt, const ISC_DATE& isc_dt);
+
+void encodeTime(ISC_TIME& isc_tm, const IBPP::Time& tm);
+void decodeTime(IBPP::Time& tm, const ISC_TIME& isc_tm);
+
+void encodeTimestamp(ISC_TIMESTAMP& isc_ts, const IBPP::Timestamp& ts);
+void decodeTimestamp(IBPP::Timestamp& ts, const ISC_TIMESTAMP& isc_ts);
+
+struct consts	// See _ibpp.cpp for initializations of these constants
+{
+	static const double dscales[19];
+	static const int Dec31_1899;
+	static const int16_t min16;
+	static const int16_t max16;
+	static const int32_t min32;
+	static const int32_t max32;
+};
+
+}	// namespace ibpp_internal
+
+#endif // __INTERNAL_IBPP_H__
+
+//
+//	Eof
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/_ibs.cpp b/src/terralib/drivers/Firebird/ibpp/core/_ibs.cpp
new file mode 100644
index 0000000..08d9837
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/_ibs.cpp
@@ -0,0 +1,108 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: _ibs.cpp 7665 2009-03-03 16:39:22Z fredbed $
+//	Subject : IBPP, internal Status class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+#include <cstring>
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+using namespace ibpp_internals;
+
+int IBS::SqlCode() const
+{
+	return (int)(*gds.Call()->m_sqlcode)(&mVector[0]);
+}
+
+const char* IBS::ErrorMessage() const
+{
+	char msg[1024];
+	ISC_LONG sqlcode;
+
+	if (! mMessage.empty()) return mMessage.c_str();	// If message compiled, returns it
+
+	// Compiles the message (SQL part)
+	std::ostringstream message;
+	sqlcode = (*gds.Call()->m_sqlcode)(mVector);
+	if (sqlcode != -999)
+	{
+		(*gds.Call()->m_sql_interprete)((short)sqlcode, msg, sizeof(msg));
+		message<< _("SQL Message : ")<< sqlcode<< "\n"<< msg<< "\n\n";
+	}
+
+	message<< _("Engine Code    : ")<< EngineCode()<< "\n";
+
+	// Compiles the message (Engine part)
+	ISC_STATUS* error = &mVector[0];
+	try { (*gds.Call()->m_interprete)(msg, &error); }
+	catch(...) { msg[0] = '\0'; }
+	message<< _("Engine Message :")<< "\n"<< msg;
+	try
+	{
+		while ((*gds.Call()->m_interprete)(msg, &error))
+			message<< "\n"<< msg;
+	}
+	catch (...) { }
+
+	message<< "\n";
+	mMessage = message.str();
+	return mMessage.c_str();
+}
+
+void IBS::Reset()
+{
+	for (int i = 0; i < 20; i++) mVector[i] = 0;
+	mMessage.erase();
+}
+
+IBS::IBS()
+{
+	Reset();
+}
+
+IBS::~IBS()
+{
+}
+
+/** Copy Constructor
+*/
+
+IBS::IBS(IBS& copied)
+{
+	memcpy(mVector, copied.mVector, sizeof(mVector));
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/_rb.cpp b/src/terralib/drivers/Firebird/ibpp/core/_rb.cpp
new file mode 100644
index 0000000..03ff6e4
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/_rb.cpp
@@ -0,0 +1,204 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: _rb.cpp 7665 2009-03-03 16:39:22Z fredbed $
+//	Subject : IBPP, internal RB class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* RB == Result Block/Buffer, see Interbase 6.0 C-API
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+#include <cstring>
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+using namespace ibpp_internals;
+
+char* RB::FindToken(char token)
+{
+	char* p = mBuffer;
+
+	while (*p != isc_info_end)
+	{
+		int len;
+
+		if (*p == token) return p;
+		len = (*gds.Call()->m_vax_integer)(p+1, 2);
+		p += (len + 3);
+	}
+
+	return 0;
+}
+
+char* RB::FindToken(char token, char subtoken)
+{
+	char* p = mBuffer;
+
+	while (*p != isc_info_end)
+	{
+		int len;
+
+		if (*p == token)
+		{
+			// Found token, now find subtoken
+			int inlen = (*gds.Call()->m_vax_integer)(p+1, 2);
+			p += 3;
+			while (inlen > 0)
+			{
+				if (*p == subtoken) return p;
+				len = (*gds.Call()->m_vax_integer)(p+1, 2);
+				p += (len + 3);
+				inlen -= (len + 3);
+			}
+			return 0;
+		}
+		len = (*gds.Call()->m_vax_integer)(p+1, 2);
+		p += (len + 3);
+	}
+
+	return 0;
+}
+
+int RB::GetValue(char token)
+{
+	int value;
+	int len;
+	char* p = FindToken(token);
+
+	if (p == 0)
+		throw LogicExceptionImpl("RB::GetValue", _("Token not found."));
+
+	len = (*gds.Call()->m_vax_integer)(p+1, 2);
+	if (len == 0) value = 0;
+	else value = (*gds.Call()->m_vax_integer)(p+3, (short)len);
+
+	return value;
+}
+
+int RB::GetCountValue(char token)
+{
+	// Specifically used on tokens like isc_info_insert_count and the like
+	// which return detailed counts per relation. We sum up the values.
+	int value;
+	int len;
+	char* p = FindToken(token);
+
+	if (p == 0)
+		throw LogicExceptionImpl("RB::GetCountValue", _("Token not found."));
+
+	// len is the number of bytes in the following array
+	len = (*gds.Call()->m_vax_integer)(p+1, 2);
+	p += 3;
+	value = 0;
+	while (len > 0)
+	{
+		// Each array item is 6 bytes : 2 bytes for the relation_id which
+		// we skip, and 4 bytes for the count value which we sum up accross
+		// all tables.
+		value += (*gds.Call()->m_vax_integer)(p+2, 4);
+		p += 6;
+		len -= 6;
+	}
+
+	return value;
+}
+
+int RB::GetValue(char token, char subtoken)
+{
+	int value;
+	int len;
+	char* p = FindToken(token, subtoken);
+
+	if (p == 0)
+		throw LogicExceptionImpl("RB::GetValue", _("Token/Subtoken not found."));
+
+	len = (*gds.Call()->m_vax_integer)(p+1, 2);
+	if (len == 0) value = 0;
+	else value = (*gds.Call()->m_vax_integer)(p+3, (short)len);
+
+	return value;
+}
+
+bool RB::GetBool(char token)
+{
+	int value;
+	char* p = FindToken(token);
+
+	if (p == 0)
+		throw LogicExceptionImpl("RB::GetBool", _("Token not found."));
+
+	value = (*gds.Call()->m_vax_integer)(p+1, 4);
+
+	return value == 0 ? false : true;
+}
+
+int RB::GetString(char token, std::string& data)
+{
+	int len;
+	char* p = FindToken(token);
+
+	if (p == 0)
+		throw LogicExceptionImpl("RB::GetString", _("Token not found."));
+
+	len = (*gds.Call()->m_vax_integer)(p+1, 2);
+	data = std::string(p+3, len);
+	return len;
+}
+
+void RB::Reset()
+{
+	delete [] mBuffer;
+	mBuffer = new char [mSize];
+	memset(mBuffer, 255, mSize);
+}
+
+RB::RB()
+{
+	mSize = 1024;
+	mBuffer = new char [1024];
+	memset(mBuffer, 255, mSize);
+}
+
+RB::RB(int Size)
+{
+	mSize = Size;
+	mBuffer = new char [Size];
+	memset(mBuffer, 255, mSize);
+}
+
+RB::~RB()
+{
+	try { delete [] mBuffer; }
+		catch (...) { }
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/_spb.cpp b/src/terralib/drivers/Firebird/ibpp/core/_spb.cpp
new file mode 100644
index 0000000..0373fcb
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/_spb.cpp
@@ -0,0 +1,134 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: _spb.cpp 7665 2009-03-03 16:39:22Z fredbed $
+//	Subject : IBPP, internal SPB class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* SPB == Service Parameter Block/Buffer, see Interbase 6.0 C-API
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+#include <cstring>
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+using namespace ibpp_internals;
+
+const int SPB::BUFFERINCR = 128;
+
+void SPB::Grow(int needed)
+{
+	if ((mSize + needed) > mAlloc)
+	{
+		// We need to grow the buffer. We use increments of BUFFERINCR bytes.
+		needed = (needed / BUFFERINCR + 1) * BUFFERINCR;
+		char* newbuffer = new char[mAlloc + needed];
+		if (mBuffer != 0)
+		{
+			// Move the old buffer content to the new one
+			memcpy(newbuffer, mBuffer, mSize);
+			delete [] mBuffer;
+		}
+		mBuffer = newbuffer;
+		mAlloc += needed;
+	}
+}
+
+void SPB::Insert(char opcode)
+{
+	Grow(1);
+	mBuffer[mSize++] = opcode;
+}
+
+void SPB::InsertString(char type, int lenwidth, const char* data)
+{
+	int16_t len = (int16_t)strlen(data);
+
+	Grow(1 + lenwidth + len);
+	mBuffer[mSize++] = type;
+	switch (lenwidth)
+	{
+		case 1 :	mBuffer[mSize] = char(len); mSize++; break;
+		case 2 :	*(int16_t*)&mBuffer[mSize] = int16_t((*gds.Call()->m_vax_integer)((char*)&len, 2));
+					mSize += 2; break;
+		default :	throw LogicExceptionImpl("IISPB::IISPB", _("Invalid length parameter"));
+	}
+	strncpy(&mBuffer[mSize], data, len);
+	mSize += len;
+}
+
+void SPB::InsertByte(char type, char data)
+{
+	Grow(1 + 1);
+	mBuffer[mSize++] = type;
+	mBuffer[mSize++] = data;
+}
+
+void SPB::InsertQuad(char type, int32_t data)
+{
+	Grow(1 + 4);
+	mBuffer[mSize++] = type;
+	*(int32_t*)&mBuffer[mSize] = int32_t((*gds.Call()->m_vax_integer)((char*)&data, 4));
+	mSize += 4;
+}
+
+void SPB::Reset()
+{
+	if (mBuffer != 0)
+	{
+		delete [] mBuffer;
+		mBuffer = 0;
+		mSize = 0;
+		mAlloc = 0;
+    }
+}
+
+/*
+void SPB::Insert(char type, short data)
+{
+	Grow(1 + 3);
+	mBuffer[mSize++] = type;
+	mBuffer[mSize++] = char(2);
+	*(short*)&mBuffer[mSize] = data;
+	mSize += 2;
+}
+
+void SPB::Insert(char type, bool data)
+{
+	Grow(1 + 2);
+	mBuffer[mSize++] = type;
+	mBuffer[mSize++] = char(1);
+	mBuffer[mSize++] = char(data ? 1 : 0);
+}
+*/
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/_tpb.cpp b/src/terralib/drivers/Firebird/ibpp/core/_tpb.cpp
new file mode 100644
index 0000000..5218023
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/_tpb.cpp
@@ -0,0 +1,99 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: _tpb.cpp 7665 2009-03-03 16:39:22Z fredbed $
+//	Subject : IBPP, internal TPB class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* TPB == Transaction Parameter Block/Buffer, see Interbase 6.0 C-API
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+#include <cstring>
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+using namespace ibpp_internals;
+
+const int TPB::BUFFERINCR = 128;
+
+void TPB::Grow(int needed)
+{
+	if (mBuffer == 0) ++needed;	// Initial alloc will require one more byte
+	if ((mSize + needed) > mAlloc)
+	{
+		// We need to grow the buffer. We use increments of BUFFERINCR bytes.
+		needed = (needed / BUFFERINCR + 1) * BUFFERINCR;
+		char* newbuffer = new char[mAlloc + needed];
+		if (mBuffer == 0)
+		{
+			// Initial allocation, initialize the version tag
+			newbuffer[0] = isc_tpb_version3;
+			mSize = 1;
+		}
+		else
+		{
+			// Move the old buffer content to the new one
+			memcpy(newbuffer, mBuffer, mSize);
+			delete [] mBuffer;
+		}
+		mBuffer = newbuffer;
+		mAlloc += needed;
+	}
+}
+
+void TPB::Insert(char item)
+{
+	Grow(1);
+	mBuffer[mSize++] = item;
+}
+
+void TPB::Insert(const std::string& data)
+{
+	int len = (int)data.length();
+	Grow(1 + len);
+	mBuffer[mSize++] = (char)len;
+	strncpy(&mBuffer[mSize], data.c_str(), len);
+	mSize += len;
+}
+
+void TPB::Reset()
+{
+	if (mSize != 0)
+	{
+		delete [] mBuffer;
+		mBuffer = 0;
+		mSize = 0;
+		mAlloc = 0;
+	}
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/all_in_one.cpp b/src/terralib/drivers/Firebird/ibpp/core/all_in_one.cpp
new file mode 100644
index 0000000..4f3cd2a
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/all_in_one.cpp
@@ -0,0 +1,56 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: all_in_one.cpp 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : "All In One" source code file
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//	* This file is just an "all in one" holder for all the core source files
+//	  of IBPP. When you build a project made of each individual source code
+//	  files, please DON'T include this one.
+//	  Though if you prefer, maybe for better compiler optimizations, you can
+//	  compile all of IBPP at once by just compiling this single .cpp file,
+//	  which in turn, includes all the others. Presenting such a single
+//	  compilation unit to the compiler may help it do better optimizations.
+//	  This is just provided for convenience and is in no case required.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include "_ibpp.cpp"
+#include "_dpb.cpp"
+#include "_ibs.cpp"
+#include "_rb.cpp"
+#include "_spb.cpp"
+#include "_tpb.cpp"
+
+#include "array.cpp"
+#include "blob.cpp"
+#include "database.cpp"
+#include "date.cpp"
+#include "dbkey.cpp"
+#include "events.cpp"
+#include "exception.cpp"
+#include "row.cpp"
+#include "service.cpp"
+#include "statement.cpp"
+#include "time.cpp"
+#include "transaction.cpp"
+#include "user.cpp"
+
+// Eof
diff --git a/src/terralib/drivers/Firebird/ibpp/core/array.cpp b/src/terralib/drivers/Firebird/ibpp/core/array.cpp
new file mode 100644
index 0000000..426d883
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/array.cpp
@@ -0,0 +1,1046 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: array.cpp 7665 2009-03-03 16:39:22Z fredbed $
+//	Subject : IBPP, Array class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+#include <cstring>
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+#include <math.h>
+
+using namespace ibpp_internals;
+
+//	(((((((( OBJECT INTERFACE IMPLEMENTATION ))))))))
+
+void ArrayImpl::Describe(const std::string& table, const std::string& column)
+{
+	//if (mIdAssigned)
+	//	throw LogicExceptionImpl("Array::Lookup", _("Array already in use."));
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Array::Lookup", _("No Database is attached."));
+	if (mTransaction == 0)
+		throw LogicExceptionImpl("Array::Lookup", _("No Transaction is attached."));
+
+	ResetId();	// Re-use this array object if was previously assigned
+
+	IBS status;
+	(*gds.Call()->m_array_lookup_bounds)(status.Self(), mDatabase->GetHandlePtr(),
+		mTransaction->GetHandlePtr(), const_cast<char*>(table.c_str()),
+			const_cast<char*>(column.c_str()), &mDesc);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Array::Lookup",
+			_("isc_array_lookup_bounds failed."));
+
+	AllocArrayBuffer();
+
+	mDescribed = true;
+}
+
+void ArrayImpl::SetBounds(int dim, int low, int high)
+{
+	if (! mDescribed)
+		throw LogicExceptionImpl("Array::SetBounds", _("Array description not set."));
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Array::SetBounds", _("No Database is attached."));
+	if (mTransaction == 0)
+		throw LogicExceptionImpl("Array::SetBounds", _("No Transaction is attached."));
+	if (dim < 0 || dim > mDesc.array_desc_dimensions-1)
+		throw LogicExceptionImpl("Array::SetBounds", _("Invalid dimension."));
+	if (low > high ||
+		low < mDesc.array_desc_bounds[dim].array_bound_lower ||
+		low > mDesc.array_desc_bounds[dim].array_bound_upper ||
+		high > mDesc.array_desc_bounds[dim].array_bound_upper ||
+		high < mDesc.array_desc_bounds[dim].array_bound_lower)
+		throw LogicExceptionImpl("Array::SetBounds",
+			_("Invalid bounds. You can only narrow the bounds."));
+
+	mDesc.array_desc_bounds[dim].array_bound_lower = short(low);
+	mDesc.array_desc_bounds[dim].array_bound_upper = short(high);
+
+	AllocArrayBuffer();
+}
+
+IBPP::SDT ArrayImpl::ElementType()
+{
+	if (! mDescribed)
+		throw LogicExceptionImpl("Array::ElementType",
+			_("Array description not set."));
+
+	IBPP::SDT value;
+	switch (mDesc.array_desc_dtype)
+	{
+		case blr_text :			value = IBPP::sdString;		break;
+		case blr_varying : 		value = IBPP::sdString;		break;
+		case blr_cstring : 		value = IBPP::sdString;		break;
+		case blr_short :		value = IBPP::sdSmallint;	break;
+		case blr_long :			value = IBPP::sdInteger;	break;
+		case blr_int64 :		value = IBPP::sdLargeint;	break;
+		case blr_float :		value = IBPP::sdFloat;		break;
+		case blr_double :		value = IBPP::sdDouble;		break;
+		case blr_timestamp :	value = IBPP::sdTimestamp;	break;
+		case blr_sql_date :		value = IBPP::sdDate;		break;
+		case blr_sql_time :		value = IBPP::sdTime;		break;
+		default : throw LogicExceptionImpl("Array::ElementType",
+						_("Found an unknown sqltype !"));
+	}
+
+	return value;
+}
+
+int ArrayImpl::ElementSize()
+{
+	if (! mDescribed)
+		throw LogicExceptionImpl("Array::ElementSize",
+			_("Array description not set."));
+
+	return mDesc.array_desc_length;
+}
+
+int ArrayImpl::ElementScale()
+{
+	if (! mDescribed)
+		throw LogicExceptionImpl("Array::ElementScale",
+			_("Array description not set."));
+
+	return mDesc.array_desc_scale;
+}
+
+int ArrayImpl::Dimensions()
+{
+	if (! mDescribed)
+		throw LogicExceptionImpl("Array::Dimensions",
+			_("Array description not set."));
+
+	return mDesc.array_desc_dimensions;
+}
+
+void ArrayImpl::Bounds(int dim, int* low, int* high)
+{
+	if (! mDescribed)
+		throw LogicExceptionImpl("Array::Bounds", _("Array description not set."));
+	if (dim < 0 || dim > mDesc.array_desc_dimensions-1)
+		throw LogicExceptionImpl("Array::Bounds", _("Invalid dimension."));
+	if (low == 0 || high == 0)
+		throw LogicExceptionImpl("Array::Bounds", _("Null reference detected."));
+
+	*low =  mDesc.array_desc_bounds[dim].array_bound_lower;
+	*high = mDesc.array_desc_bounds[dim].array_bound_upper;
+}
+
+/*
+
+COMMENTS
+
+1)
+For an array column of type CHAR(X), the internal type returned or expected is blr_text.
+In such case, the byte array received or submitted to get/put_slice is formatted in
+elements of X bytes, which correspond to what is reported in array_desc_length.
+The elements are not '\0' terminated but are right-padded with spaces ' '.
+
+2)
+For an array column of type VARCHAR(X), the internal type is blr_varying.
+The underlying format is rather curious and different than what is used in XSQLDA.
+The element size is reported in array_desc_length as X.
+Yet each element of the byte array is expected to be of size X+2 (just as if we were
+to stuff a short in the first 2 bytes to store the length (as is done with XSQLDA).
+No. The string of X characters maximum has to be stored in the chunks of X+2 bytes as
+a zero-terminated c-string. Note that the buffer is indeed one byte too large.
+Internally, the API probably convert in-place in these chunks the zero-terminated string
+to a variable-size string with a short in front and the string data non zero-terminated
+behind.
+
+3)
+With Interbase 6.0 and Firebird 1.0 (initial april 2002 release), the int64 support is
+broken regarding the arrays. It is not possible to work on arrays using a datatype stored
+in an int64, as for instance any NUMERIC(x,0) where x is equal or greater than 10. That's
+a bug in the engine, not in IBPP, which has been fixed in june 2002. Engines compiled from
+the current Firebird CVS code as of july 2002 are okay. As will be the 1.01 Firebird version.
+We have no idea if this is fixed or not in Interbase 6.5 though.
+
+*/
+
+void ArrayImpl::ReadTo(IBPP::ADT adtype, void* data, int datacount)
+{
+	if (! mIdAssigned)
+		throw LogicExceptionImpl("Array::ReadTo", _("Array Id not read from column."));
+	if (! mDescribed)
+		throw LogicExceptionImpl("Array::ReadTo", _("Array description not set."));
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Array::ReadTo", _("No Database is attached."));
+	if (mTransaction == 0)
+		throw LogicExceptionImpl("Array::ReadTo", _("No Transaction is attached."));
+	if (datacount != mElemCount)
+		throw LogicExceptionImpl("Array::ReadTo", _("Wrong count of array elements"));
+
+	IBS status;
+	ISC_LONG lenbuf = mBufferSize;
+	(*gds.Call()->m_array_get_slice)(status.Self(), mDatabase->GetHandlePtr(),
+		mTransaction->GetHandlePtr(), &mId, &mDesc, mBuffer, &lenbuf);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Array::ReadTo", _("isc_array_get_slice failed."));
+	if (lenbuf != mBufferSize)
+		throw SQLExceptionImpl(status, "Array::ReadTo", _("Internal buffer size discrepancy."));
+
+	// Now, convert the types and copy values to the user array...
+	int len;
+	char* src = (char*)mBuffer;
+	char* dst = (char*)data;
+
+	switch (mDesc.array_desc_dtype)
+	{
+		case blr_text :
+			if (adtype == IBPP::adString)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					strncpy(dst, src, mElemSize);
+					dst[mElemSize] = '\0';
+					src += mElemSize;
+					dst += (mElemSize + 1);
+				}
+			}
+			else if (adtype == IBPP::adBool)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					if (*src == 't' || *src == 'T' || *src == 'y' || *src == 'Y' ||	*src == '1')
+						*(bool*)dst = true;
+					else *(bool*)dst = false;
+					src += mElemSize;
+					dst += sizeof(bool);
+				}
+			}
+			else throw LogicExceptionImpl("Array::ReadTo", _("Incompatible types."));
+			break;
+
+		case blr_varying :
+			if (adtype == IBPP::adString)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					len = (int)strlen(src);
+					if (len > mElemSize-2) len = mElemSize-2;
+					strncpy(dst, src, len);
+					dst[len] = '\0';
+					src += mElemSize;
+					dst += (mElemSize - 2 + 1);
+				}
+			}
+			else if (adtype == IBPP::adBool)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					if (*src == 't' || *src == 'T' || *src == 'y' || *src == 'Y' ||	*src == '1')
+						*(bool*)dst = true;
+					else *(bool*)dst = false;
+					src += mElemSize;
+					dst += sizeof(bool);
+				}
+			}
+			else throw LogicExceptionImpl("Array::ReadTo", _("Incompatible types."));
+			break;
+
+		case blr_short :
+			if (adtype == IBPP::adBool)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(bool*)dst = (*(short*)src != 0) ? true : false;
+					src += mElemSize;
+					dst += sizeof(bool);
+				}
+			}
+			else if (adtype == IBPP::adInt16)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(short*)dst = *(short*)src;
+					src += mElemSize;
+					dst += sizeof(short);
+				}
+			}
+			else if (adtype == IBPP::adInt32)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(int*)dst = (int)*(short*)src;
+					src += mElemSize;
+					dst += sizeof(int);
+				}
+			}
+			else if (adtype == IBPP::adInt64)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(int64_t*)dst = (int64_t)*(short*)src;
+					src += mElemSize;
+					dst += sizeof(int64_t);
+				}
+			}
+			else if (adtype == IBPP::adFloat)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(float*)dst = (float)(*(short*)src / divisor);
+					src += mElemSize;
+					dst += sizeof(float);
+				}
+			}
+			else if (adtype == IBPP::adDouble)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(double*)dst = (double)(*(short*)src / divisor);
+					src += mElemSize;
+					dst += sizeof(double);
+				}
+			}
+			else throw LogicExceptionImpl("Array::ReadTo", _("Incompatible types."));
+			break;
+
+		case blr_long :
+			if (adtype == IBPP::adBool)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(bool*)dst = (*(long*)src != 0) ? true : false;
+					src += mElemSize;
+					dst += sizeof(bool);
+				}
+			}
+			else if (adtype == IBPP::adInt16)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					if (*(long*)src < consts::min16 || *(long*)src > consts::max16)
+						throw LogicExceptionImpl("Array::ReadTo",
+							_("Out of range numeric conversion !"));
+					*(short*)dst = short(*(long*)src);
+					src += mElemSize;
+					dst += sizeof(short);
+				}
+			}
+			else if (adtype == IBPP::adInt32)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(long*)dst = *(long*)src;
+					src += mElemSize;
+					dst += sizeof(long);
+				}
+			}
+			else if (adtype == IBPP::adInt64)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(int64_t*)dst = (int64_t)*(long*)src;
+					src += mElemSize;
+					dst += sizeof(int64_t);
+				}
+			}
+			else if (adtype == IBPP::adFloat)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(float*)dst = (float)(*(long*)src / divisor);
+					src += mElemSize;
+					dst += sizeof(float);
+				}
+			}
+			else if (adtype == IBPP::adDouble)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(double*)dst = (double)(*(long*)src / divisor);
+					src += mElemSize;
+					dst += sizeof(double);
+				}
+			}
+			else throw LogicExceptionImpl("Array::ReadTo", _("Incompatible types."));
+			break;
+
+		case blr_int64 :
+			if (adtype == IBPP::adBool)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(bool*)dst = (*(int64_t*)src != 0) ? true : false;
+					src += mElemSize;
+					dst += sizeof(bool);
+				}
+			}
+			else if (adtype == IBPP::adInt16)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					if (*(int64_t*)src < consts::min16 || *(int64_t*)src > consts::max16)
+						throw LogicExceptionImpl("Array::ReadTo",
+							_("Out of range numeric conversion !"));
+					*(short*)dst = short(*(int64_t*)src);
+					src += mElemSize;
+					dst += sizeof(short);
+				}
+			}
+			else if (adtype == IBPP::adInt32)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					if (*(int64_t*)src < consts::min32 || *(int64_t*)src > consts::max32)
+						throw LogicExceptionImpl("Array::ReadTo",
+							_("Out of range numeric conversion !"));
+					*(long*)dst = (long)*(int64_t*)src;
+					src += mElemSize;
+					dst += sizeof(long);
+				}
+			}
+			else if (adtype == IBPP::adInt64)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(int64_t*)dst = *(int64_t*)src;
+					src += mElemSize;
+					dst += sizeof(int64_t);
+				}
+			}
+			else if (adtype == IBPP::adFloat)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(float*)dst = (float)(*(int64_t*)src / divisor);
+					src += mElemSize;
+					dst += sizeof(float);
+				}
+			}
+			else if (adtype == IBPP::adDouble)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(double*)dst = (double)(*(int64_t*)src / divisor);
+					src += mElemSize;
+					dst += sizeof(double);
+				}
+			}
+			else throw LogicExceptionImpl("Array::ReadTo", _("Incompatible types."));
+			break;
+
+		case blr_float :
+			if (adtype != IBPP::adFloat || mDesc.array_desc_scale != 0)
+				throw LogicExceptionImpl("Array::ReadTo", _("Incompatible types."));
+			for (int i = 0; i < mElemCount; i++)
+			{
+				*(float*)dst = *(float*)src;
+				src += mElemSize;
+				dst += sizeof(float);
+			}
+			break;
+
+		case blr_double :
+			if (adtype != IBPP::adDouble) throw LogicExceptionImpl("Array::ReadTo",
+										_("Incompatible types."));
+			if (mDesc.array_desc_scale != 0)
+			{
+				// Round to scale of NUMERIC(x,y)
+				double divisor = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(double*)dst =	(double)(*(double*)src / divisor);
+					src += mElemSize;
+					dst += sizeof(double);
+				}
+			}
+			else
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(double*)dst = *(double*)src;
+					src += mElemSize;
+					dst += sizeof(double);
+				}
+			}
+			break;
+
+		case blr_timestamp :
+			if (adtype != IBPP::adTimestamp) throw LogicExceptionImpl("Array::ReadTo",
+												_("Incompatible types."));
+			for (int i = 0; i < mElemCount; i++)
+			{
+				decodeTimestamp(*(IBPP::Timestamp*)dst, *(ISC_TIMESTAMP*)src);
+				src += mElemSize;
+				dst += sizeof(IBPP::Timestamp);
+			}
+			break;
+
+		case blr_sql_date :
+			if (adtype != IBPP::adDate) throw LogicExceptionImpl("Array::ReadTo",
+												_("Incompatible types."));
+			for (int i = 0; i < mElemCount; i++)
+			{
+				decodeDate(*(IBPP::Date*)dst, *(ISC_DATE*)src);
+				src += mElemSize;
+				dst += sizeof(IBPP::Date);
+			}
+			break;
+
+		case blr_sql_time :
+			if (adtype != IBPP::adTime) throw LogicExceptionImpl("Array::ReadTo",
+												_("Incompatible types."));
+			for (int i = 0; i < mElemCount; i++)
+			{
+				decodeTime(*(IBPP::Time*)dst, *(ISC_TIME*)src);
+				src += mElemSize;
+				dst += sizeof(IBPP::Time);
+			}
+			break;
+
+		default :
+			throw LogicExceptionImpl("Array::ReadTo", _("Unknown sql type."));
+	}
+}
+
+void ArrayImpl::WriteFrom(IBPP::ADT adtype, const void* data, int datacount)
+{
+	if (! mDescribed)
+		throw LogicExceptionImpl("Array::WriteFrom", _("Array description not set."));
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Array::WriteFrom", _("No Database is attached."));
+	if (mTransaction == 0)
+		throw LogicExceptionImpl("Array::WriteFrom", _("No Transaction is attached."));
+	if (datacount != mElemCount)
+		throw LogicExceptionImpl("Array::ReadTo", _("Wrong count of array elements"));
+
+	// Read user data and convert types to the mBuffer
+	int len;
+	char* src = (char*)data;
+	char* dst = (char*)mBuffer;
+
+	switch (mDesc.array_desc_dtype)
+	{
+		case blr_text :
+			if (adtype == IBPP::adString)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					len = (int)strlen(src);
+					if (len > mElemSize) len = mElemSize;
+					strncpy(dst, src, len);
+					while (len < mElemSize) dst[len++] = ' ';
+					src += (mElemSize + 1);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adBool)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*dst = *(bool*)src ? 'T' : 'F';
+					len = 1;
+					while (len < mElemSize) dst[len++] = ' ';
+					src += sizeof(bool);
+					dst += mElemSize;
+				}
+			}
+			else throw LogicExceptionImpl("Array::WriteFrom", _("Incompatible types."));
+			break;
+
+		case blr_varying :
+			if (adtype == IBPP::adString)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					len = (int)strlen(src);
+					if (len > mElemSize-2) len = mElemSize-2;
+					strncpy(dst, src, len);
+					dst[len] = '\0';
+					src += (mElemSize - 2 + 1);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adBool)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(short*)dst = (short)1;
+					dst[2] = *(bool*)src ? 'T' : 'F';
+					src += sizeof(bool);
+					dst += mElemSize;
+				}
+			}
+			else throw LogicExceptionImpl("Array::WriteFrom", _("Incompatible types."));
+			break;
+
+		case blr_short :
+			if (adtype == IBPP::adBool)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(short*)dst = short(*(bool*)src ? 1 : 0);
+					src += sizeof(bool);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adInt16)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(short*)dst = *(short*)src;
+					src += sizeof(short);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adInt32)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					if (*(long*)src < consts::min16 || *(long*)src > consts::max16)
+						throw LogicExceptionImpl("Array::WriteFrom",
+							_("Out of range numeric conversion !"));
+					*(short*)dst = (short)*(int*)src;
+					src += sizeof(int);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adInt64)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					if (*(int64_t*)src < consts::min16 || *(int64_t*)src > consts::max16)
+						throw LogicExceptionImpl("Array::WriteFrom",
+							_("Out of range numeric conversion !"));
+					*(short*)dst = (short)*(int64_t*)src;
+					src += sizeof(int64_t);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adFloat)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(short*)dst =
+						(short)floor(*(float*)src * multiplier + 0.5);
+					src += sizeof(float);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adDouble)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(short*)dst =
+						(short)floor(*(double*)src * multiplier + 0.5);
+					src += sizeof(double);
+					dst += mElemSize;
+				}
+			}
+			else throw LogicExceptionImpl("Array::WriteFrom", _("Incompatible types."));
+			break;
+
+		case blr_long :
+			if (adtype == IBPP::adBool)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(long*)dst = *(bool*)src ? 1 : 0;
+					src += sizeof(bool);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adInt16)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(long*)dst = *(short*)src;
+					src += sizeof(short);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adInt32)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(long*)dst = *(long*)src;
+					src += sizeof(long);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adInt64)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					if (*(int64_t*)src < consts::min32 || *(int64_t*)src > consts::max32)
+						throw LogicExceptionImpl("Array::WriteFrom",
+							_("Out of range numeric conversion !"));
+					*(long*)dst = (long)*(int64_t*)src;
+					src += sizeof(int64_t);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adFloat)
+			{
+				// This SQL_INT is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(long*)dst =
+						(long)floor(*(float*)src * multiplier + 0.5);
+					src += sizeof(float);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adDouble)
+			{
+				// This SQL_INT is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(long*)dst =
+						(long)floor(*(double*)src * multiplier + 0.5);
+					src += sizeof(double);
+					dst += mElemSize;
+				}
+			}
+			else throw LogicExceptionImpl("Array::WriteFrom", _("Incompatible types."));
+			break;
+
+		case blr_int64 :
+			if (adtype == IBPP::adBool)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(int64_t*)dst = *(bool*)src ? 1 : 0;
+					src += sizeof(bool);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adInt16)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(int64_t*)dst = *(short*)src;
+					src += sizeof(short);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adInt32)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(int64_t*)dst = *(long*)src;
+					src += sizeof(long);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adInt64)
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(int64_t*)dst = *(int64_t*)src;
+					src += sizeof(int64_t);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adFloat)
+			{
+				// This SQL_INT is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(int64_t*)dst =
+						(int64_t)floor(*(float*)src * multiplier + 0.5);
+					src += sizeof(float);
+					dst += mElemSize;
+				}
+			}
+			else if (adtype == IBPP::adDouble)
+			{
+				// This SQL_INT is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(int64_t*)dst =
+						(int64_t)floor(*(double*)src * multiplier + 0.5);
+					src += sizeof(double);
+					dst += mElemSize;
+				}
+			}
+			else
+				throw LogicExceptionImpl("Array::WriteFrom",
+					_("Incompatible types (blr_int64 and ADT %d)."), (int)adtype);
+			break;
+
+		case blr_float :
+			if (adtype != IBPP::adFloat || mDesc.array_desc_scale != 0)
+				throw LogicExceptionImpl("Array::WriteFrom", _("Incompatible types."));
+			for (int i = 0; i < mElemCount; i++)
+			{
+				*(float*)dst = *(float*)src;
+				src += sizeof(float);
+				dst += mElemSize;
+			}
+			break;
+
+		case blr_double :
+			if (adtype != IBPP::adDouble) throw LogicExceptionImpl("Array::WriteFrom",
+										_("Incompatible types."));
+			if (mDesc.array_desc_scale != 0)
+			{
+				// Round to scale of NUMERIC(x,y)
+				double multiplier = consts::dscales[-mDesc.array_desc_scale];
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(double*)dst =
+						floor(*(double*)src * multiplier + 0.5) / multiplier;
+					src += sizeof(double);
+					dst += mElemSize;
+				}
+			}
+			else
+			{
+				for (int i = 0; i < mElemCount; i++)
+				{
+					*(double*)dst = *(double*)src;
+					src += sizeof(double);
+					dst += mElemSize;
+				}
+			}
+			break;
+
+		case blr_timestamp :
+			if (adtype != IBPP::adTimestamp) throw LogicExceptionImpl("Array::ReadTo",
+												_("Incompatible types."));
+			for (int i = 0; i < mElemCount; i++)
+			{
+				encodeTimestamp(*(ISC_TIMESTAMP*)dst, *(IBPP::Timestamp*)src);
+				src += sizeof(IBPP::Timestamp);
+				dst += mElemSize;
+			}
+			break;
+
+		case blr_sql_date :
+			if (adtype != IBPP::adDate) throw LogicExceptionImpl("Array::ReadTo",
+												_("Incompatible types."));
+			for (int i = 0; i < mElemCount; i++)
+			{
+				encodeDate(*(ISC_DATE*)dst, *(IBPP::Date*)src); 
+				src += sizeof(IBPP::Date);
+				dst += mElemSize;
+			}
+			break;
+
+		case blr_sql_time :
+			if (adtype != IBPP::adTime) throw LogicExceptionImpl("Array::ReadTo",
+												_("Incompatible types."));
+			for (int i = 0; i < mElemCount; i++)
+			{
+				encodeTime(*(ISC_TIME*)dst, *(IBPP::Time*)src);
+				src += sizeof(IBPP::Time);
+				dst += mElemSize;
+			}
+			break;
+
+		default :
+			throw LogicExceptionImpl("Array::WriteFrom", _("Unknown sql type."));
+	}
+
+	IBS status;
+	ISC_LONG lenbuf = mBufferSize;
+	(*gds.Call()->m_array_put_slice)(status.Self(), mDatabase->GetHandlePtr(),
+		mTransaction->GetHandlePtr(), &mId, &mDesc, mBuffer, &lenbuf);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Array::WriteFrom", _("isc_array_put_slice failed."));
+	if (lenbuf != mBufferSize)
+		throw SQLExceptionImpl(status, "Array::WriteFrom", _("Internal buffer size discrepancy."));
+}
+
+IBPP::Database ArrayImpl::DatabasePtr() const
+{
+	if (mDatabase == 0) throw LogicExceptionImpl("Array::DatabasePtr",
+			_("No Database is attached."));
+	return mDatabase;
+}
+
+IBPP::Transaction ArrayImpl::TransactionPtr() const
+{
+	if (mTransaction == 0) throw LogicExceptionImpl("Array::TransactionPtr",
+			_("No Transaction is attached."));
+	return mTransaction;
+}
+
+IBPP::IArray* ArrayImpl::AddRef()
+{
+	ASSERTION(mRefCount >= 0);
+	++mRefCount;
+	return this;
+}
+
+void ArrayImpl::Release()
+{
+	// Release cannot throw, except in DEBUG builds on assertion
+	ASSERTION(mRefCount >= 0);
+	--mRefCount;
+	try { if (mRefCount <= 0) delete this; }
+		catch (...) { }
+}
+
+//	(((((((( OBJECT INTERNAL METHODS ))))))))
+
+void ArrayImpl::Init()
+{
+	ResetId();
+	mDescribed = false;
+	mDatabase = 0;
+	mTransaction = 0;
+	mBuffer = 0;
+	mBufferSize = 0;
+}
+
+void ArrayImpl::SetId(ISC_QUAD* quad)
+{
+	if (quad == 0)
+		throw LogicExceptionImpl("ArrayImpl::SetId", _("Null Id reference detected."));
+
+	memcpy(&mId, quad, sizeof(mId));
+	mIdAssigned = true;
+}
+
+void ArrayImpl::GetId(ISC_QUAD* quad)
+{
+	if (quad == 0)
+		throw LogicExceptionImpl("ArrayImpl::GetId", _("Null Id reference detected."));
+
+	memcpy(quad, &mId, sizeof(mId));
+}
+
+void ArrayImpl::ResetId()
+{
+	memset(&mId, 0, sizeof(mId));
+	mIdAssigned = false;
+}
+
+void ArrayImpl::AllocArrayBuffer()
+{
+	// Clean previous buffer if any
+	if (mBuffer != 0) delete [] (char*)mBuffer;
+	mBuffer = 0;
+
+	// Computes total number of elements in the array or slice
+	mElemCount = 1;
+	for (int i = 0; i < mDesc.array_desc_dimensions; i++)
+	{
+		mElemCount = mElemCount *
+			(mDesc.array_desc_bounds[i].array_bound_upper -
+				mDesc.array_desc_bounds[i].array_bound_lower + 1);
+	}
+
+	// Allocates a buffer for this count of elements
+	mElemSize = mDesc.array_desc_length;
+	if (mDesc.array_desc_dtype == blr_varying) mElemSize += 2;
+	else if (mDesc.array_desc_dtype == blr_cstring) mElemSize += 1;
+	mBufferSize = mElemSize * mElemCount;
+	mBuffer = (void*) new char[mBufferSize];
+}
+
+void ArrayImpl::AttachDatabaseImpl(DatabaseImpl* database)
+{
+	if (database == 0) throw LogicExceptionImpl("Array::AttachDatabase",
+			_("Can't attach a 0 Database object."));
+
+	if (mDatabase != 0) mDatabase->DetachArrayImpl(this);
+	mDatabase = database;
+	mDatabase->AttachArrayImpl(this);
+}
+
+void ArrayImpl::AttachTransactionImpl(TransactionImpl* transaction)
+{
+	if (transaction == 0) throw LogicExceptionImpl("Array::AttachTransaction",
+			_("Can't attach a 0 Transaction object."));
+
+	if (mTransaction != 0) mTransaction->DetachArrayImpl(this);
+	mTransaction = transaction;
+	mTransaction->AttachArrayImpl(this);
+}
+
+void ArrayImpl::DetachDatabaseImpl()
+{
+	if (mDatabase == 0) return;
+
+	mDatabase->DetachArrayImpl(this);
+	mDatabase = 0;
+}
+
+void ArrayImpl::DetachTransactionImpl()
+{
+	if (mTransaction == 0) return;
+
+	mTransaction->DetachArrayImpl(this);
+	mTransaction = 0;
+}
+
+ArrayImpl::ArrayImpl(DatabaseImpl* database, TransactionImpl* transaction)
+	: mRefCount(0)
+{
+	Init();
+	AttachDatabaseImpl(database);
+	if (transaction != 0) AttachTransactionImpl(transaction);
+}
+
+ArrayImpl::~ArrayImpl()
+{
+	try { if (mTransaction != 0) mTransaction->DetachArrayImpl(this); }
+		catch (...) {}
+	try { if (mDatabase != 0) mDatabase->DetachArrayImpl(this); }
+		catch (...) {}
+	try { if (mBuffer != 0) delete [] (char*)mBuffer; }
+		catch (...) {}
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/blob.cpp b/src/terralib/drivers/Firebird/ibpp/core/blob.cpp
new file mode 100644
index 0000000..d15505d
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/blob.cpp
@@ -0,0 +1,380 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: blob.cpp 7665 2009-03-03 16:39:22Z fredbed $
+//	Subject : IBPP, Blob class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+#include <cstring>
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+using namespace ibpp_internals;
+
+//	(((((((( OBJECT INTERFACE IMPLEMENTATION ))))))))
+
+void BlobImpl::Open()
+{
+	if (mHandle != 0)
+		throw LogicExceptionImpl("Blob::Open", _("Blob already opened."));
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Blob::Open", _("No Database is attached."));
+	if (mTransaction == 0)
+		throw LogicExceptionImpl("Blob::Open", _("No Transaction is attached."));
+	if (! mIdAssigned)
+		throw LogicExceptionImpl("Blob::Open", _("Blob Id is not assigned."));
+
+	IBS status;
+	(*gds.Call()->m_open_blob2)(status.Self(), mDatabase->GetHandlePtr(),
+		mTransaction->GetHandlePtr(), &mHandle, &mId, 0, 0);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Blob::Open", _("isc_open_blob2 failed."));
+	mWriteMode = false;
+}
+
+void BlobImpl::Create()
+{
+	if (mHandle != 0)
+		throw LogicExceptionImpl("Blob::Create", _("Blob already opened."));
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Blob::Create", _("No Database is attached."));
+	if (mTransaction == 0)
+		throw LogicExceptionImpl("Blob::Create", _("No Transaction is attached."));
+
+	IBS status;
+	(*gds.Call()->m_create_blob2)(status.Self(), mDatabase->GetHandlePtr(),
+		mTransaction->GetHandlePtr(), &mHandle, &mId, 0, 0);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Blob::Create",
+			_("isc_create_blob failed."));
+	mIdAssigned = true;
+	mWriteMode = true;
+}
+
+void BlobImpl::Close()
+{
+	if (mHandle == 0) return;	// Not opened anyway
+
+	IBS status;
+	(*gds.Call()->m_close_blob)(status.Self(), &mHandle);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Blob::Close", _("isc_close_blob failed."));
+	mHandle = 0;
+}
+
+void BlobImpl::Cancel()
+{
+	if (mHandle == 0) return;	// Not opened anyway
+
+	if (! mWriteMode)
+		throw LogicExceptionImpl("Blob::Cancel", _("Can't cancel a Blob opened for read"));
+
+	IBS status;
+	(*gds.Call()->m_cancel_blob)(status.Self(), &mHandle);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Blob::Cancel", _("isc_cancel_blob failed."));
+	mHandle = 0;
+	mIdAssigned = false;
+}
+
+int BlobImpl::Read(void* buffer, int size)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Blob::Read", _("The Blob is not opened"));
+	if (mWriteMode)
+		throw LogicExceptionImpl("Blob::Read", _("Can't read from Blob opened for write"));
+	if (size < 1 || size > (64*1024-1))
+		throw LogicExceptionImpl("Blob::Read", _("Invalid segment size (max 64Kb-1)"));
+
+	IBS status;
+	unsigned short bytesread;
+	int result = (*gds.Call()->m_get_segment)(status.Self(), &mHandle, &bytesread,
+					(unsigned short)size, (char*)buffer);
+	if (result == isc_segstr_eof) return 0;	// Fin du blob
+	if (result != isc_segment && status.Errors())
+		throw SQLExceptionImpl(status, "Blob::Read", _("isc_get_segment failed."));
+	return (int)bytesread;
+}
+
+void BlobImpl::Write(const void* buffer, int size)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Blob::Write", _("The Blob is not opened"));
+	if (! mWriteMode)
+		throw LogicExceptionImpl("Blob::Write", _("Can't write to Blob opened for read"));
+	if (size < 1 || size > (64*1024-1))
+		throw LogicExceptionImpl("Blob::Write", _("Invalid segment size (max 64Kb-1)"));
+
+	IBS status;
+	(*gds.Call()->m_put_segment)(status.Self(), &mHandle,
+		(unsigned short)size, (char*)buffer);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Blob::Write", _("isc_put_segment failed."));
+}
+
+void BlobImpl::Info(int* Size, int* Largest, int* Segments)
+{
+	char items[] = {isc_info_blob_total_length,
+					isc_info_blob_max_segment,
+					isc_info_blob_num_segments};
+
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Blob::GetInfo", _("The Blob is not opened"));
+
+	IBS status;
+	RB result(100);
+	(*gds.Call()->m_blob_info)(status.Self(), &mHandle, sizeof(items), items,
+		(short)result.Size(), result.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Blob::GetInfo", _("isc_blob_info failed."));
+
+	if (Size != 0) *Size = result.GetValue(isc_info_blob_total_length);
+	if (Largest != 0) *Largest = result.GetValue(isc_info_blob_max_segment);
+	if (Segments != 0) *Segments = result.GetValue(isc_info_blob_num_segments);
+}
+
+void BlobImpl::Save(const std::string& data)
+{
+	if (mHandle != 0)
+		throw LogicExceptionImpl("Blob::Save", _("Blob already opened."));
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Blob::Save", _("No Database is attached."));
+	if (mTransaction == 0)
+		throw LogicExceptionImpl("Blob::Save", _("No Transaction is attached."));
+
+	IBS status;
+	(*gds.Call()->m_create_blob2)(status.Self(), mDatabase->GetHandlePtr(),
+		mTransaction->GetHandlePtr(), &mHandle, &mId, 0, 0);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Blob::Save",
+			_("isc_create_blob failed."));
+	mIdAssigned = true;
+	mWriteMode = true;
+
+	size_t pos = 0;
+	size_t len = data.size();
+	while (len != 0)
+	{
+		size_t blklen = (len < 32*1024-1) ? len : 32*1024-1;
+		status.Reset();
+		(*gds.Call()->m_put_segment)(status.Self(), &mHandle,
+			(unsigned short)blklen, const_cast<char*>(data.data()+pos));
+		if (status.Errors())
+			throw SQLExceptionImpl(status, "Blob::Save",
+					_("isc_put_segment failed."));
+		pos += blklen;
+		len -= blklen;
+	}
+	
+	status.Reset();
+	(*gds.Call()->m_close_blob)(status.Self(), &mHandle);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Blob::Save", _("isc_close_blob failed."));
+	mHandle = 0;
+}
+
+void BlobImpl::Load(std::string& data)
+{
+	if (mHandle != 0)
+		throw LogicExceptionImpl("Blob::Load", _("Blob already opened."));
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Blob::Load", _("No Database is attached."));
+	if (mTransaction == 0)
+		throw LogicExceptionImpl("Blob::Load", _("No Transaction is attached."));
+	if (! mIdAssigned)
+		throw LogicExceptionImpl("Blob::Load", _("Blob Id is not assigned."));
+
+	IBS status;
+	(*gds.Call()->m_open_blob2)(status.Self(), mDatabase->GetHandlePtr(),
+		mTransaction->GetHandlePtr(), &mHandle, &mId, 0, 0);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Blob::Load", _("isc_open_blob2 failed."));
+	mWriteMode = false;
+
+	size_t blklen = 32*1024-1;
+	data.resize(blklen);
+
+	size_t size = 0;
+	size_t pos = 0;
+	for (;;)
+	{
+		status.Reset();
+		unsigned short bytesread;
+		int result = (*gds.Call()->m_get_segment)(status.Self(), &mHandle,
+						&bytesread, (unsigned short)blklen,
+							const_cast<char*>(data.data()+pos));
+		if (result == isc_segstr_eof) break;	// End of blob
+		if (result != isc_segment && status.Errors())
+			throw SQLExceptionImpl(status, "Blob::Load", _("isc_get_segment failed."));
+
+		pos += bytesread;
+		size += bytesread;
+		data.resize(size + blklen);
+	}
+	data.resize(size);
+	
+	status.Reset();
+	(*gds.Call()->m_close_blob)(status.Self(), &mHandle);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Blob::Load", _("isc_close_blob failed."));
+	mHandle = 0;
+}
+
+IBPP::Database BlobImpl::DatabasePtr() const
+{
+	if (mDatabase == 0) throw LogicExceptionImpl("Blob::DatabasePtr",
+			_("No Database is attached."));
+	return mDatabase;
+}
+
+IBPP::Transaction BlobImpl::TransactionPtr() const
+{
+	if (mTransaction == 0) throw LogicExceptionImpl("Blob::TransactionPtr",
+			_("No Transaction is attached."));
+	return mTransaction;
+}
+
+IBPP::IBlob* BlobImpl::AddRef()
+{
+	ASSERTION(mRefCount >= 0);
+	++mRefCount;
+	return this;
+}
+
+void BlobImpl::Release()
+{
+	// Release cannot throw, except in DEBUG builds on assertion
+	ASSERTION(mRefCount >= 0);
+	--mRefCount;
+	try { if (mRefCount <= 0) delete this; }
+		catch (...) { }
+}
+
+//	(((((((( OBJECT INTERNAL METHODS ))))))))
+
+void BlobImpl::Init()
+{
+	mIdAssigned = false;
+	mWriteMode = false;
+	mHandle = 0;
+	mDatabase = 0;
+	mTransaction = 0;
+}
+
+void BlobImpl::SetId(ISC_QUAD* quad)
+{
+	if (mHandle != 0)
+		throw LogicExceptionImpl("BlobImpl::SetId", _("Can't set Id on an opened BlobImpl."));
+	if (quad == 0)
+		throw LogicExceptionImpl("BlobImpl::SetId", _("Null Id reference detected."));
+
+	memcpy(&mId, quad, sizeof(mId));
+	mIdAssigned = true;
+}
+
+void BlobImpl::GetId(ISC_QUAD* quad)
+{
+	if (mHandle != 0)
+		throw LogicExceptionImpl("BlobImpl::GetId", _("Can't get Id on an opened BlobImpl."));
+	if (! mWriteMode)
+		throw LogicExceptionImpl("BlobImpl::GetId", _("Can only get Id of a newly created Blob."));
+	if (quad == 0)
+		throw LogicExceptionImpl("BlobImpl::GetId", _("Null Id reference detected."));
+
+	memcpy(quad, &mId, sizeof(mId));
+}
+
+void BlobImpl::AttachDatabaseImpl(DatabaseImpl* database)
+{
+	if (database == 0) throw LogicExceptionImpl("Blob::AttachDatabase",
+			_("Can't attach a NULL Database object."));
+
+	if (mDatabase != 0) mDatabase->DetachBlobImpl(this);
+	mDatabase = database;
+	mDatabase->AttachBlobImpl(this);
+}
+
+void BlobImpl::AttachTransactionImpl(TransactionImpl* transaction)
+{
+	if (transaction == 0) throw LogicExceptionImpl("Blob::AttachTransaction",
+			_("Can't attach a NULL Transaction object."));
+
+	if (mTransaction != 0) mTransaction->DetachBlobImpl(this);
+	mTransaction = transaction;
+	mTransaction->AttachBlobImpl(this);
+}
+
+void BlobImpl::DetachDatabaseImpl()
+{
+	if (mDatabase == 0) return;
+
+	mDatabase->DetachBlobImpl(this);
+	mDatabase = 0;
+}
+
+void BlobImpl::DetachTransactionImpl()
+{
+	if (mTransaction == 0) return;
+
+	mTransaction->DetachBlobImpl(this);
+	mTransaction = 0;
+}
+
+BlobImpl::BlobImpl(DatabaseImpl* database, TransactionImpl* transaction)
+	: mRefCount(0)
+{
+	Init();
+	AttachDatabaseImpl(database);
+	if (transaction != 0) AttachTransactionImpl(transaction);
+}
+
+BlobImpl::~BlobImpl()
+{
+	try
+	{
+		if (mHandle != 0)
+		{
+			if (mWriteMode) Cancel();
+			else Close();
+		}
+	}
+	catch (...) { }
+	
+	try { if (mTransaction != 0) mTransaction->DetachBlobImpl(this); }
+		catch (...) { }
+	try { if (mDatabase != 0) mDatabase->DetachBlobImpl(this); }
+		catch (...) { }
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/database.cpp b/src/terralib/drivers/Firebird/ibpp/core/database.cpp
new file mode 100644
index 0000000..08b7856
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/database.cpp
@@ -0,0 +1,481 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: database.cpp 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP, Database class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+#include <algorithm>
+
+using namespace ibpp_internals;
+
+//	(((((((( OBJECT INTERFACE IMPLEMENTATION ))))))))
+
+void DatabaseImpl::Create(int dialect)
+{
+	if (mHandle != 0)
+		throw LogicExceptionImpl("Database::Create", _("Database is already connected."));
+	if (mDatabaseName.empty())
+		throw LogicExceptionImpl("Database::Create", _("Unspecified database name."));
+	if (mUserName.empty())
+		throw LogicExceptionImpl("Database::Create", _("Unspecified user name."));
+	if (dialect != 1 && dialect != 3)
+		throw LogicExceptionImpl("Database::Create", _("Only dialects 1 and 3 are supported."));
+
+	// Build the SQL Create Statement
+	std::string create;
+	create.assign("CREATE DATABASE '");
+	if (! mServerName.empty()) create.append(mServerName).append(":");
+	create.append(mDatabaseName).append("' ");
+
+	create.append("USER '").append(mUserName).append("' ");
+	if (! mUserPassword.empty())
+		create.append("PASSWORD '").append(mUserPassword).append("' ");
+
+	if (! mCreateParams.empty()) create.append(mCreateParams);
+
+	// Call ExecuteImmediate to create the database
+	isc_tr_handle tr_handle = 0;
+	IBS status;
+    (*gds.Call()->m_dsql_execute_immediate)(status.Self(), &mHandle, &tr_handle,
+    	0, const_cast<char*>(create.c_str()), short(dialect), NULL);
+    if (status.Errors())
+		throw SQLExceptionImpl(status, "Database::Create", _("isc_dsql_execute_immediate failed"));
+
+	Disconnect();
+}
+
+void DatabaseImpl::Connect()
+{
+	if (mHandle != 0) return;	// Already connected
+
+	if (mDatabaseName.empty())
+		throw LogicExceptionImpl("Database::Connect", _("Unspecified database name."));
+	if (mUserName.empty())
+		throw LogicExceptionImpl("Database::Connect", _("Unspecified user name."));
+
+    // Build a DPB based on the properties
+	DPB dpb;
+    dpb.Insert(isc_dpb_user_name, mUserName.c_str());
+    dpb.Insert(isc_dpb_password, mUserPassword.c_str());
+    if (! mRoleName.empty()) dpb.Insert(isc_dpb_sql_role_name, mRoleName.c_str());
+    if (! mCharSet.empty()) dpb.Insert(isc_dpb_lc_ctype, mCharSet.c_str());
+
+	std::string connect;
+	if (! mServerName.empty())
+		connect.assign(mServerName).append(":");
+	connect.append(mDatabaseName);
+
+	IBS status;
+	(*gds.Call()->m_attach_database)(status.Self(), (short)connect.size(),
+		const_cast<char*>(connect.c_str()), &mHandle, dpb.Size(), dpb.Self());
+    if (status.Errors())
+    {
+        mHandle = 0;     // Should be, but better be sure...
+		throw SQLExceptionImpl(status, "Database::Connect", _("isc_attach_database failed"));
+    }
+
+	// Now, get ODS version information and dialect.
+	// If ODS major is lower of equal to 9, we reject the connection.
+	// If ODS major is 10 or higher, this is at least an InterBase 6.x Server
+	// OR Firebird 1.x Server.
+
+	char items[] = {isc_info_ods_version,
+					isc_info_db_SQL_dialect,
+					isc_info_end};
+	RB result(100);
+
+	status.Reset();
+	(*gds.Call()->m_database_info)(status.Self(), &mHandle, sizeof(items), items,
+		result.Size(), result.Self());
+	if (status.Errors())
+	{
+		status.Reset();
+	    (*gds.Call()->m_detach_database)(status.Self(), &mHandle);
+        mHandle = 0;     // Should be, but better be sure...
+		throw SQLExceptionImpl(status, "Database::Connect", _("isc_database_info failed"));
+	}
+
+	int ODS = result.GetValue(isc_info_ods_version);
+	if (ODS <= 9)
+	{
+		status.Reset();
+	    (*gds.Call()->m_detach_database)(status.Self(), &mHandle);
+        mHandle = 0;     // Should be, but better be sure...
+		throw LogicExceptionImpl("Database::Connect",
+			_("Unsupported Server : wrong ODS version (%d), at least '10' required."), ODS);
+	}
+
+	mDialect = result.GetValue(isc_info_db_SQL_dialect);
+	if (mDialect != 1 && mDialect != 3)
+	{
+		status.Reset();
+	    (*gds.Call()->m_detach_database)(status.Self(), &mHandle);
+        mHandle = 0;     // Should be, but better be sure...
+		throw LogicExceptionImpl("Database::Connect", _("Dialect 1 or 3 required"));
+	}
+
+	// Now, verify the GDS32.DLL we are using is compatible with the server
+	if (ODS >= 10 && gds.Call()->mGDSVersion < 60)
+	{
+		status.Reset();
+	    (*gds.Call()->m_detach_database)(status.Self(), &mHandle);
+        mHandle = 0;     // Should be, but better be sure...
+		throw LogicExceptionImpl("Database::Connect", _("GDS32.DLL version 5 against IBSERVER 6"));
+	}
+}
+
+void DatabaseImpl::Inactivate()
+{
+	if (mHandle == 0) return;	// Not connected anyway
+
+    // Rollback any started transaction...
+	for (unsigned i = 0; i < mTransactions.size(); i++)
+	{
+		if (mTransactions[i]->Started())
+			mTransactions[i]->Rollback();
+	}
+
+	// Cancel all pending event traps
+	for (unsigned i = 0; i < mEvents.size(); i++)
+		mEvents[i]->Clear();
+
+	// Let's detach from all Blobs
+	while (mBlobs.size() > 0)
+		mBlobs.back()->DetachDatabaseImpl();
+
+	// Let's detach from all Arrays
+	while (mArrays.size() > 0)
+		mArrays.back()->DetachDatabaseImpl();
+
+	// Let's detach from all Statements
+	while (mStatements.size() > 0)
+		mStatements.back()->DetachDatabaseImpl();
+
+	// Let's detach from all Transactions
+	while (mTransactions.size() > 0)
+		mTransactions.back()->DetachDatabaseImpl(this);
+
+	// Let's detach from all Events
+	while (mEvents.size() > 0)
+		mEvents.back()->DetachDatabaseImpl();
+}
+
+void DatabaseImpl::Disconnect()
+{
+	if (mHandle == 0) return;	// Not connected anyway
+
+	// Put the connection to rest
+	Inactivate();
+
+	// Detach from the server
+	IBS status;
+    (*gds.Call()->m_detach_database)(status.Self(), &mHandle);
+
+    // Should we throw, set mHandle to 0 first, because Disconnect() may
+	// be called from Database destructor (keeps the object coherent).
+	mHandle = 0;
+    if (status.Errors())
+		throw SQLExceptionImpl(status, "Database::Disconnect", _("isc_detach_database failed"));
+}
+
+void DatabaseImpl::Drop()
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Database::Drop", _("Database must be connected."));
+
+	// Put the connection to a rest
+	Inactivate();
+
+	IBS vector;
+	(*gds.Call()->m_drop_database)(vector.Self(), &mHandle);
+    if (vector.Errors())
+    	throw SQLExceptionImpl(vector, "Database::Drop", _("isc_drop_database failed"));
+
+    mHandle = 0;
+}
+
+void DatabaseImpl::Info(int* ODSMajor, int* ODSMinor,
+	int* PageSize, int* Pages, int* Buffers, int* Sweep,
+	bool* Sync, bool* Reserve)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Database::Info", _("Database is not connected."));
+
+	char items[] = {isc_info_ods_version,
+					isc_info_ods_minor_version,
+					isc_info_page_size,
+					isc_info_allocation,
+					isc_info_num_buffers,
+					isc_info_sweep_interval,
+					isc_info_forced_writes,
+					isc_info_no_reserve,
+					isc_info_end};
+    IBS status;
+	RB result(256);
+
+	status.Reset();
+	(*gds.Call()->m_database_info)(status.Self(), &mHandle, sizeof(items), items,
+		result.Size(), result.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Database::Info", _("isc_database_info failed"));
+
+	if (ODSMajor != 0) *ODSMajor = result.GetValue(isc_info_ods_version);
+	if (ODSMinor != 0) *ODSMinor = result.GetValue(isc_info_ods_minor_version);
+	if (PageSize != 0) *PageSize = result.GetValue(isc_info_page_size);
+	if (Pages != 0) *Pages = result.GetValue(isc_info_allocation);
+	if (Buffers != 0) *Buffers = result.GetValue(isc_info_num_buffers);
+	if (Sweep != 0) *Sweep = result.GetValue(isc_info_sweep_interval);
+	if (Sync != 0)
+		*Sync = result.GetValue(isc_info_forced_writes) == 1 ? true : false;
+	if (Reserve != 0)
+		*Reserve = result.GetValue(isc_info_no_reserve) == 1 ? false : true;
+}
+
+void DatabaseImpl::Statistics(int* Fetches, int* Marks, int* Reads, int* Writes)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Database::Statistics", _("Database is not connected."));
+
+	char items[] = {isc_info_fetches,
+					isc_info_marks,
+					isc_info_reads,
+					isc_info_writes,
+					isc_info_end};
+    IBS status;
+	RB result(128);
+
+	status.Reset();
+	(*gds.Call()->m_database_info)(status.Self(), &mHandle, sizeof(items), items,
+		result.Size(), result.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Database::Statistics", _("isc_database_info failed"));
+
+	if (Fetches != 0) *Fetches = result.GetValue(isc_info_fetches);
+	if (Marks != 0) *Marks = result.GetValue(isc_info_marks);
+	if (Reads != 0) *Reads = result.GetValue(isc_info_reads);
+	if (Writes != 0) *Writes = result.GetValue(isc_info_writes);
+}
+
+void DatabaseImpl::Counts(int* Insert, int* Update, int* Delete, 
+	int* ReadIdx, int* ReadSeq)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Database::Counts", _("Database is not connected."));
+
+	char items[] = {isc_info_insert_count,
+					isc_info_update_count,
+					isc_info_delete_count,
+					isc_info_read_idx_count,
+					isc_info_read_seq_count,
+					isc_info_end};
+    IBS status;
+	RB result(1024);
+
+	status.Reset();
+	(*gds.Call()->m_database_info)(status.Self(), &mHandle, sizeof(items), items,
+		result.Size(), result.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Database::Counts", _("isc_database_info failed"));
+
+	if (Insert != 0) *Insert = result.GetCountValue(isc_info_insert_count);
+	if (Update != 0) *Update = result.GetCountValue(isc_info_update_count);
+	if (Delete != 0) *Delete = result.GetCountValue(isc_info_delete_count);
+	if (ReadIdx != 0) *ReadIdx = result.GetCountValue(isc_info_read_idx_count);
+	if (ReadSeq != 0) *ReadSeq = result.GetCountValue(isc_info_read_seq_count);
+}
+
+void DatabaseImpl::Users(std::vector<std::string>& users)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Database::Users", _("Database is not connected."));
+
+	char items[] = {isc_info_user_names,
+					isc_info_end};
+    IBS status;
+	RB result(8000);
+
+	status.Reset();
+	(*gds.Call()->m_database_info)(status.Self(), &mHandle, sizeof(items), items,
+		result.Size(), result.Self());
+	if (status.Errors())
+	{
+		status.Reset();
+		throw SQLExceptionImpl(status, "Database::Users", _("isc_database_info failed"));
+	}
+
+	users.clear();
+	char* p = result.Self();
+	while (*p == isc_info_user_names)
+	{
+		p += 3;		// Get to the length byte (there are two undocumented bytes which we skip)
+		int len = (int)(*p);
+		++p;		// Get to the first char of username
+    	if (len != 0) users.push_back(std::string().append(p, len));
+   		p += len;	// Skip username
+    }
+	return;
+}
+
+IBPP::IDatabase* DatabaseImpl::AddRef()
+{
+	ASSERTION(mRefCount >= 0);
+	++mRefCount;
+	return this;
+}
+
+void DatabaseImpl::Release()
+{
+	// Release cannot throw, except in DEBUG builds on assertion
+	ASSERTION(mRefCount >= 0);
+	--mRefCount;
+	try { if (mRefCount <= 0) delete this; }
+		catch (...) { }
+}
+
+//	(((((((( OBJECT INTERNAL METHODS ))))))))
+
+void DatabaseImpl::AttachTransactionImpl(TransactionImpl* tr)
+{
+	if (tr == 0)
+		throw LogicExceptionImpl("Database::AttachTransaction",
+					_("Transaction object is null."));
+
+	mTransactions.push_back(tr);
+}
+
+void DatabaseImpl::DetachTransactionImpl(TransactionImpl* tr)
+{
+	if (tr == 0)
+		throw LogicExceptionImpl("Database::DetachTransaction",
+				_("ITransaction object is null."));
+
+	mTransactions.erase(std::find(mTransactions.begin(), mTransactions.end(), tr));
+}
+
+void DatabaseImpl::AttachStatementImpl(StatementImpl* st)
+{
+	if (st == 0)
+		throw LogicExceptionImpl("Database::AttachStatement",
+					_("Can't attach a null Statement object."));
+
+	mStatements.push_back(st);
+}
+
+void DatabaseImpl::DetachStatementImpl(StatementImpl* st)
+{
+	if (st == 0)
+		throw LogicExceptionImpl("Database::DetachStatement",
+				_("Can't detach a null Statement object."));
+
+	mStatements.erase(std::find(mStatements.begin(), mStatements.end(), st));
+}
+
+void DatabaseImpl::AttachBlobImpl(BlobImpl* bb)
+{
+	if (bb == 0)
+		throw LogicExceptionImpl("Database::AttachBlob",
+					_("Can't attach a null Blob object."));
+
+	mBlobs.push_back(bb);
+}
+
+void DatabaseImpl::DetachBlobImpl(BlobImpl* bb)
+{
+	if (bb == 0)
+		throw LogicExceptionImpl("Database::DetachBlob",
+				_("Can't detach a null Blob object."));
+
+	mBlobs.erase(std::find(mBlobs.begin(), mBlobs.end(), bb));
+}
+
+void DatabaseImpl::AttachArrayImpl(ArrayImpl* ar)
+{
+	if (ar == 0)
+		throw LogicExceptionImpl("Database::AttachArray",
+					_("Can't attach a null Array object."));
+
+	mArrays.push_back(ar);
+}
+
+void DatabaseImpl::DetachArrayImpl(ArrayImpl* ar)
+{
+	if (ar == 0)
+		throw LogicExceptionImpl("Database::DetachArray",
+				_("Can't detach a null Array object."));
+
+	mArrays.erase(std::find(mArrays.begin(), mArrays.end(), ar));
+}
+
+void DatabaseImpl::AttachEventsImpl(EventsImpl* ev)
+{
+	if (ev == 0)
+		throw LogicExceptionImpl("Database::AttachEventsImpl",
+					_("Can't attach a null Events object."));
+
+	mEvents.push_back(ev);
+}
+
+void DatabaseImpl::DetachEventsImpl(EventsImpl* ev)
+{
+	if (ev == 0)
+		throw LogicExceptionImpl("Database::DetachEventsImpl",
+				_("Can't detach a null Events object."));
+
+	mEvents.erase(std::find(mEvents.begin(), mEvents.end(), ev));
+}
+
+DatabaseImpl::DatabaseImpl(const std::string& ServerName, const std::string& DatabaseName,
+						   const std::string& UserName, const std::string& UserPassword,
+						   const std::string& RoleName, const std::string& CharSet,
+						   const std::string& CreateParams) :
+
+	mRefCount(0), mHandle(0),
+	mServerName(ServerName), mDatabaseName(DatabaseName),
+	mUserName(UserName), mUserPassword(UserPassword), mRoleName(RoleName),
+	mCharSet(CharSet), mCreateParams(CreateParams),
+	mDialect(3)
+{
+}
+
+DatabaseImpl::~DatabaseImpl()
+{
+	try { if (Connected()) Disconnect(); }
+		catch(...) { }
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/date.cpp b/src/terralib/drivers/Firebird/ibpp/core/date.cpp
new file mode 100644
index 0000000..42c0f0e
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/date.cpp
@@ -0,0 +1,209 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: date.cpp 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP, Date class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+#include <time.h>		// Can't use <ctime> thanks to MSVC6 buggy library
+
+using namespace ibpp_internals;
+
+void IBPP::Date::Today()
+{
+	time_t systime = time(0);
+	tm* loctime = localtime(&systime);
+
+	if (! IBPP::itod(&mDate, loctime->tm_year + 1900,
+		loctime->tm_mon + 1, loctime->tm_mday))
+			throw LogicExceptionImpl("Date::Today", _("Out of range"));
+}
+
+void IBPP::Date::SetDate(int dt)
+{
+	if (! IBPP::dtoi(dt, 0, 0, 0))
+		throw LogicExceptionImpl("Date::SetDate", _("Out of range"));
+	mDate = dt;
+}
+
+void IBPP::Date::SetDate(int year, int month, int day)
+{
+	if (! IBPP::itod(&mDate, year, month, day))
+		throw LogicExceptionImpl("Date::SetDate", _("Out of range"));
+}
+
+void IBPP::Date::GetDate(int& year, int& month, int& day) const
+{
+	if (! IBPP::dtoi(mDate, &year, &month, &day))
+		throw LogicExceptionImpl("Date::GetDate", _("Out of range"));
+}
+
+int IBPP::Date::Year() const
+{
+	int year;
+	if (! IBPP::dtoi(mDate, &year, 0, 0))
+		throw LogicExceptionImpl("Date::Year", _("Out of range"));
+	return year;
+}
+
+int IBPP::Date::Month() const
+{
+	int month;
+	if (! IBPP::dtoi(mDate, 0, &month, 0))
+		throw LogicExceptionImpl("Date::Month", _("Out of range"));
+	return month;
+}
+
+int IBPP::Date::Day() const
+{
+	int day;
+	if (! IBPP::dtoi(mDate, 0, 0, &day))
+		throw LogicExceptionImpl("Date::Day", _("Out of range"));
+	return day;
+}
+
+void IBPP::Date::Add(int days)
+{
+	int newdate = mDate + days;		// days can be signed
+	if (! IBPP::dtoi(newdate, 0, 0, 0))
+		throw LogicExceptionImpl("Date::Add()", _("Out of range"));
+	mDate = newdate;
+}
+
+void IBPP::Date::StartOfMonth()
+{
+	int year, month;
+	if (! IBPP::dtoi(mDate, &year, &month, 0))
+		throw LogicExceptionImpl("Date::StartOfMonth()", _("Out of range"));
+	if (! IBPP::itod(&mDate, year, month, 1))		// First of same month
+		throw LogicExceptionImpl("Date::StartOfMonth()", _("Out of range"));
+}
+
+void IBPP::Date::EndOfMonth()
+{
+	int year, month;
+	if (! IBPP::dtoi(mDate, &year, &month, 0))
+		throw LogicExceptionImpl("Date::EndOfMonth()", _("Out of range"));
+	if (++month > 12) { month = 1; year++; }
+	if (! IBPP::itod(&mDate, year, month, 1))	// First of next month
+		throw LogicExceptionImpl("Date::EndOfMonth()", _("Out of range"));
+	mDate--;	// Last day of original month, all weird cases accounted for
+}
+
+IBPP::Date::Date(int year, int month, int day)
+{
+	SetDate(year, month, day);
+}
+
+IBPP::Date::Date(const IBPP::Date& copied)
+{
+	mDate = copied.mDate;
+}
+
+IBPP::Date& IBPP::Date::operator=(const IBPP::Timestamp& assigned)
+{
+	mDate = assigned.GetDate();
+	return *this;
+}
+
+IBPP::Date& IBPP::Date::operator=(const IBPP::Date& assigned)
+{
+	mDate = assigned.mDate;
+	return *this;
+}
+
+// The following date calculations were inspired by web pages found on
+// Peter Baum web homepage at 'http://www.capecod.net/~pbaum/'.
+// His contact info is at : 'http://home.capecod.net/~pbaum/contact.htm'.
+// Please, understand that Peter Baum is not related to this IBPP project.
+// So __please__, do not contact him regarding IBPP matters.
+
+//	Take a date, in its integer format as used in IBPP internals and splits
+//	it in year (4 digits), month (1-12), day (1-31)
+
+bool IBPP::dtoi (int date, int *y, int *m, int *d)
+{
+    int RataDie, Z, H, A, B, C;
+    int year, month, day;
+
+	// Validity control.
+	if (date < IBPP::MinDate || date > IBPP::MaxDate)
+		return false;
+
+	// The "Rata Die" is the date specified as the number of days elapsed since
+	// 31 Dec of year 0. So 1 Jan 0001 is 1.
+
+	RataDie = date + ibpp_internals::consts::Dec31_1899;	// Because IBPP sets the '0' on 31 Dec 1899.
+
+    Z = RataDie + 306;
+    H = 100*Z - 25;
+    A = H/3652425;
+    B = A - A/4;
+    year = (100*B + H) / 36525;
+    C = B + Z - 365*year - year / 4;
+    month = (5*C + 456) / 153;
+    day = C - (153*month - 457) / 5;
+    if (month > 12) { year += 1; month -= 12; }
+
+	if (y != 0) *y = (int)year;
+	if (m != 0) *m = (int)month;
+	if (d != 0) *d = (int)day;
+
+	return true;
+}
+
+//	Take a date from its components year, month, day and convert it to the
+//	integer representation used internally in IBPP.
+
+bool IBPP::itod (int *pdate, int year, int month, int day)
+{
+    int RataDie, result;
+	int y, m, d;
+
+	d = day;	m = month;		y = year;
+    if (m < 3) { m += 12; y -= 1; }
+    RataDie = d + (153*m - 457) / 5 + 365*y + y/4 - y/100 + y/400 - 306;
+
+	result = RataDie - ibpp_internals::consts::Dec31_1899;   // Because IBPP sets the '0' on 31 Dec 1899
+
+	// Validity control
+	if (result < IBPP::MinDate || result > IBPP::MaxDate)
+		return false;
+
+	*pdate = result;
+	return true;
+}
+
+//	Eof
diff --git a/src/terralib/drivers/Firebird/ibpp/core/dbkey.cpp b/src/terralib/drivers/Firebird/ibpp/core/dbkey.cpp
new file mode 100644
index 0000000..f009bef
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/dbkey.cpp
@@ -0,0 +1,120 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: dbkey.cpp 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP, DBKey class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+
+using namespace ibpp_internals;
+
+//	Private implementation
+
+//	Public implementation
+
+void IBPP::DBKey::Clear()
+{
+	mDBKey.erase();
+	mString.erase();
+}
+
+void IBPP::DBKey::SetKey(const void* key, int size)
+{
+	if (key == 0)
+		throw LogicExceptionImpl("IBPP::DBKey::SetKey", _("Null DBKey reference detected."));
+	if (size <= 0 || ((size >> 3) << 3) != size)
+		throw LogicExceptionImpl("IBPP::DBKey::SetKey", _("Invalid DBKey size."));
+
+	mDBKey.assign((const char*)key, (size_t)size);
+	mString.erase();
+}
+
+void IBPP::DBKey::GetKey(void* key, int size) const
+{
+	if (mDBKey.empty())
+		throw LogicExceptionImpl("IBPP::DBKey::GetKey", _("DBKey not assigned."));
+	if (key == 0)
+		throw LogicExceptionImpl("IBPP::DBKey::GetKey", _("Null DBKey reference detected."));
+	if (size != (int)mDBKey.size())
+		throw LogicExceptionImpl("IBPP::DBKey::GetKey", _("Incompatible DBKey size detected."));
+
+	mDBKey.copy((char*)key, mDBKey.size());
+}
+
+const char* IBPP::DBKey::AsString() const
+{
+	if (mDBKey.empty())
+		throw LogicExceptionImpl("IBPP::DBKey::GetString", _("DBKey not assigned."));
+
+	if (mString.empty())
+	{
+		std::ostringstream hexkey;
+		hexkey.setf(std::ios::hex, std::ios::basefield);
+		hexkey.setf(std::ios::uppercase);
+
+		const uint32_t* key = reinterpret_cast<const uint32_t*>(mDBKey.data());
+		int n = (int)mDBKey.size() / 8;
+		for (int i = 0; i < n; i++)
+		{
+			if (i != 0) hexkey<< "-";
+			hexkey<< std::setw(4)<< key[i*2]<< ":";
+			hexkey<< std::setw(8)<< key[i*2+1];
+		}
+
+		mString = hexkey.str();
+	}
+
+	return mString.c_str();
+}
+
+IBPP::DBKey::DBKey(const DBKey& copied)
+{
+	mDBKey = copied.mDBKey;
+	mString = copied.mString;
+}
+
+IBPP::DBKey& IBPP::DBKey::operator=(const IBPP::DBKey& assigned)
+{
+	mDBKey = assigned.mDBKey;
+	mString = assigned.mString;
+	return *this;
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/events.cpp b/src/terralib/drivers/Firebird/ibpp/core/events.cpp
new file mode 100644
index 0000000..f351616
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/events.cpp
@@ -0,0 +1,372 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: events.cpp 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP, internal EventsImpl class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+//	SPECIAL WARNING COMMENT (by Olivier Mascia, 2000 Nov 12)
+//	The way this source file handles events is not publicly documented, in
+//	the ibase.h header file or in the IB 6.0 documentation. This documentation
+//	suggests to use the API isc_event_block to construct vectors of events.
+//	Unfortunately, this API takes a variable number of parameters to specify
+//	the list of event names. In addition, the documentation warn on not using
+//	more than 15 names. This is a sad limitation, partly because the maximum
+//	number of parameters safely processed in such an API is very compiler
+//	dependant and also because isc_event_counts() is designed to return counts
+//	through the IB status vector which is a vector of 20 32-bits integers !
+//	From reverse engineering of the isc_event_block() API in
+//	source file jrd/alt.c (as available on fourceforge.net/project/InterBase as
+//	of 2000 Nov 12), it looks like the internal format of those EPB is simple.
+//	An EPB starts by a byte with value 1. A version identifier of some sort.
+//	Then a small cluster is used for each event name. The cluster starts with
+//	a byte for the length of the event name (no final '\0'). Followed by the N
+//	characters of the name itself (no final '\0'). The cluster ends with 4 bytes
+//	preset to 0.
+//
+//	SPECIAL CREDIT (July 2004) : this is a complete re-implementation of this
+//	class, directly based on work by Val Samko.
+//	The whole event handling has then be completely redesigned, based on the old
+//	EPB class to bring up the current IBPP::Events implementation.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+using namespace ibpp_internals;
+
+const size_t EventsImpl::MAXEVENTNAMELEN = 127;
+
+//	(((((((( OBJECT INTERFACE IMPLEMENTATION ))))))))
+
+void EventsImpl::Add(const std::string& eventname, IBPP::EventInterface* objref)
+{
+	if (eventname.size() == 0)
+		throw LogicExceptionImpl("Events::Add", _("Zero length event names not permitted"));
+	if (eventname.size() > MAXEVENTNAMELEN)
+		throw LogicExceptionImpl("Events::Add", _("Event name is too long"));
+	if ((mEventBuffer.size() + eventname.length() + 5) > 32766)	// max signed 16 bits integer minus one
+		throw LogicExceptionImpl("Events::Add",
+			_("Can't add this event, the events list would overflow IB/FB limitation"));
+
+	Cancel();
+
+	// 1) Alloc or grow the buffers
+	size_t prev_buffer_size = mEventBuffer.size();
+	size_t needed = ((prev_buffer_size==0) ? 1 : 0) + eventname.length() + 5;
+	// Initial alloc will require one more byte, we need 4 more bytes for
+	// the count itself, and one byte for the string length prefix
+
+	mEventBuffer.resize(mEventBuffer.size() + needed);
+	mResultsBuffer.resize(mResultsBuffer.size() + needed);
+	if (prev_buffer_size == 0)
+		mEventBuffer[0] = mResultsBuffer[0] = 1; // First byte is a 'one'. Documentation ??
+
+	// 2) Update the buffers (append)
+	{
+		Buffer::iterator it = mEventBuffer.begin() +
+				((prev_buffer_size==0) ? 1 : prev_buffer_size); // Byte after current content
+		*(it++) = static_cast<char>(eventname.length());
+		it = std::copy(eventname.begin(), eventname.end(), it);
+		// We initialize the counts to (uint32_t)(-1) to initialize properly, see FireActions()
+		*(it++) = -1; *(it++) = -1; *(it++) = -1; *it = -1;
+	}
+
+	// copying new event to the results buffer to keep event_buffer_ and results_buffer_ consistant,
+	// otherwise we might get a problem in `FireActions`
+	// Val Samko, val at digiways.com
+	std::copy(mEventBuffer.begin() + prev_buffer_size,
+		mEventBuffer.end(), mResultsBuffer.begin() + prev_buffer_size);
+
+	// 3) Alloc or grow the objref array and update the objref array (append)
+	mObjectReferences.push_back(objref);
+
+	Queue();
+}
+
+void EventsImpl::Drop(const std::string& eventname)
+{
+	if (eventname.size() == 0)
+		throw LogicExceptionImpl("EventsImpl::Drop", _("Zero length event names not permitted"));
+	if (eventname.size() > MAXEVENTNAMELEN)
+		throw LogicExceptionImpl("EventsImpl::Drop", _("Event name is too long"));
+
+	if (mEventBuffer.size() <= 1) return;	// Nothing to do, but not an error
+
+	Cancel();
+
+	// 1) Find the event in the buffers
+	typedef EventBufferIterator<Buffer::iterator> EventIterator;
+	EventIterator eit(mEventBuffer.begin()+1);
+	EventIterator rit(mResultsBuffer.begin()+1);
+
+	for (ObjRefs::iterator oit = mObjectReferences.begin();
+			oit != mObjectReferences.end();
+				++oit, ++eit, ++rit)
+	{
+		if (eventname != eit.get_name()) continue;
+		
+		// 2) Event found, remove it
+		mEventBuffer.erase(eit.begin(), eit.end());
+		mResultsBuffer.erase(rit.begin(), rit.end());
+		mObjectReferences.erase(oit);
+		break;
+	}
+
+	Queue();
+}
+
+void EventsImpl::List(std::vector<std::string>& events)
+{
+	events.clear();
+	
+	if (mEventBuffer.size() <= 1) return;	// Nothing to do, but not an error
+
+	typedef EventBufferIterator<Buffer::iterator> EventIterator;
+	EventIterator eit(mEventBuffer.begin()+1);
+
+	for (ObjRefs::iterator oit = mObjectReferences.begin();
+			oit != mObjectReferences.end();
+				++oit, ++eit)
+	{
+		events.push_back(eit.get_name());
+	}
+}
+
+void EventsImpl::Clear()
+{
+	Cancel();
+	
+	mObjectReferences.clear();
+	mEventBuffer.clear();
+	mResultsBuffer.clear();
+}
+
+void EventsImpl::Dispatch()
+{
+	// If no events registered, nothing to do of course.
+	if (mEventBuffer.size() == 0) return;
+
+	// Let's fire the events actions for all the events which triggered, if any, and requeue.
+	FireActions();
+	Queue();
+}
+
+IBPP::Database EventsImpl::DatabasePtr() const
+{
+	if (mDatabase == 0) throw LogicExceptionImpl("Events::DatabasePtr",
+			_("No Database is attached."));
+	return mDatabase;
+}
+
+IBPP::IEvents* EventsImpl::AddRef()
+{
+	ASSERTION(mRefCount >= 0);
+	++mRefCount;
+	return this;
+}
+
+void EventsImpl::Release()
+{
+	// Release cannot throw, except in DEBUG builds on assertion
+	ASSERTION(mRefCount >= 0);
+	--mRefCount;
+	try { if (mRefCount <= 0) delete this; }
+		catch (...) { }
+}
+
+//	(((((((( OBJECT INTERNAL METHODS ))))))))
+
+void EventsImpl::Queue()
+{
+	if (! mQueued)
+	{
+		if (mDatabase->GetHandle() == 0)
+			throw LogicExceptionImpl("EventsImpl::Queue",
+				  _("Database is not connected"));
+
+		IBS vector;
+		mTrapped = false;
+		mQueued = true;
+		(*gds.Call()->m_que_events)(vector.Self(), mDatabase->GetHandlePtr(), &mId,
+			short(mEventBuffer.size()), &mEventBuffer[0],
+				(isc_callback)EventHandler, (char*)this);
+
+		if (vector.Errors())
+		{
+			mId = 0;	// Should be, but better be safe
+			mQueued = false;
+			throw SQLExceptionImpl(vector, "EventsImpl::Queue",
+				_("isc_que_events failed"));
+		}
+	}
+}
+
+void EventsImpl::Cancel()
+{
+	if (mQueued)
+	{
+		if (mDatabase->GetHandle() == 0) throw LogicExceptionImpl("EventsImpl::Cancel",
+			_("Database is not connected"));
+
+		IBS vector;
+
+		// A call to cancel_events will call *once* the handler routine, even
+		// though no events had fired. This is why we first set mEventsQueued
+		// to false, so that we can be sure to dismiss those unwanted callbacks
+		// subsequent to the execution of isc_cancel_events().
+		mTrapped = false;
+		mQueued = false;
+		(*gds.Call()->m_cancel_events)(vector.Self(), mDatabase->GetHandlePtr(), &mId);
+
+	    if (vector.Errors())
+		{
+			mQueued = true;	// Need to restore this as cancel failed
+	    	throw SQLExceptionImpl(vector, "EventsImpl::Cancel",
+	    		_("isc_cancel_events failed"));
+		}
+
+		mId = 0;	// Should be, but better be safe
+	}
+}
+
+void EventsImpl::FireActions()
+{
+	if (mTrapped)
+	{
+		typedef EventBufferIterator<Buffer::iterator> EventIterator;
+		EventIterator eit(mEventBuffer.begin()+1);
+		EventIterator rit(mResultsBuffer.begin()+1);
+
+		for (ObjRefs::iterator oit = mObjectReferences.begin();
+			 oit != mObjectReferences.end();
+				 ++oit, ++eit, ++rit)
+		{
+			if (eit == EventIterator(mEventBuffer.end())
+				  || rit == EventIterator(mResultsBuffer.end()))
+				throw LogicExceptionImpl("EventsImpl::FireActions", _("Internal buffer size error"));
+			uint32_t vnew = rit.get_count();
+			uint32_t vold = eit.get_count();
+			if (vnew > vold)
+			{
+				// Fire the action
+				try
+				{
+					(*oit)->ibppEventHandler(this, eit.get_name(), (int)(vnew - vold));
+				}
+				catch (...)
+				{
+					std::copy(rit.begin(), rit.end(), eit.begin());
+					throw;
+				}
+				std::copy(rit.begin(), rit.end(), eit.begin());
+			}
+			// This handles initialization too, where vold == (uint32_t)(-1)
+			// Thanks to M. Hieke for this idea and related initialization to (-1)
+			if (vnew != vold)
+ 				std::copy(rit.begin(), rit.end(), eit.begin());
+		}
+	}
+}
+
+// This function must keep this prototype to stay compatible with
+// what isc_que_events() expects
+
+void EventsImpl::EventHandler(const char* object, short size, const char* tmpbuffer)
+{
+	// >>>>> This method is a STATIC member !! <<<<<
+	// Consider this method as a kind of "interrupt handler". It should do as
+	// few work as possible as quickly as possible and then return.
+	// Never forget: this is called by the Firebird client code, on *some*
+	// thread which might not be (and won't probably be) any of your application
+	// thread. This function is to be considered as an "interrupt-handler" of a
+	// hardware driver.
+
+	// There can be spurious calls to EventHandler from FB internal. We must
+	// dismiss those calls.
+	if (object == 0 || size == 0 || tmpbuffer == 0) return;
+		
+	EventsImpl* evi = (EventsImpl*)object;	// Ugly, but wanted, c-style cast
+
+	if (evi->mQueued)
+	{
+		try
+		{
+			char* rb = &evi->mResultsBuffer[0];
+			if (evi->mEventBuffer.size() < (unsigned)size) size = (short)evi->mEventBuffer.size();
+			for (int i = 0; i < size; i++)
+				rb[i] = tmpbuffer[i];
+			evi->mTrapped = true;
+			evi->mQueued = false;
+		}
+		catch (...) { }
+	}
+}
+
+void EventsImpl::AttachDatabaseImpl(DatabaseImpl* database)
+{
+	if (database == 0) throw LogicExceptionImpl("EventsImpl::AttachDatabase",
+			_("Can't attach a null Database object."));
+
+	if (mDatabase != 0) mDatabase->DetachEventsImpl(this);
+	mDatabase = database;
+	mDatabase->AttachEventsImpl(this);
+}
+
+void EventsImpl::DetachDatabaseImpl()
+{
+	if (mDatabase == 0) return;
+
+	mDatabase->DetachEventsImpl(this);
+	mDatabase = 0;
+}
+
+EventsImpl::EventsImpl(DatabaseImpl* database)
+	: mRefCount(0)
+{
+	mDatabase = 0;
+	mId = 0;
+	mQueued = mTrapped = false;
+	AttachDatabaseImpl(database);
+}
+
+EventsImpl::~EventsImpl()
+{
+	try { Clear(); }
+		catch (...) { }
+	
+	try { if (mDatabase != 0) mDatabase->DetachEventsImpl(this); }
+		catch (...) { }
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/exception.cpp b/src/terralib/drivers/Firebird/ibpp/core/exception.cpp
new file mode 100644
index 0000000..c9c9104
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/exception.cpp
@@ -0,0 +1,351 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: exception.cpp 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP, Initialization of the library
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+#include <stdarg.h>
+#include <stdio.h>
+
+using namespace ibpp_internals;
+
+// None of the exception classes methods are implemented inline, because they
+// are all declared throw() and Borland compilers at least, but possibly some
+// others emit a warning like "W8026 - functions with exception specification
+// are not expanded inline". Nothing we have to worry about, but we don't want
+// people concerned by such warnings.
+
+IBPP::Exception::~Exception() throw()
+{
+}
+
+IBPP::LogicException::~LogicException() throw()
+{
+}
+
+IBPP::SQLException::~SQLException() throw()
+{
+}
+
+IBPP::WrongType::~WrongType() throw()
+{
+}
+
+//
+//	(((((((( ExceptionBase Implementation ))))))))
+//
+
+void ExceptionBase::buildErrorMessage(const char* message)
+{
+	if (! mContext.empty())
+		mWhat.append(_("Context: ")).append(mContext).append("\n");
+
+	if (message != 0 && *message != 0 )
+		mWhat.append(_("Message: ")).append(message).append("\n");
+	
+	mWhat.append("\n");
+}
+
+void ExceptionBase::raise(const std::string& context, const char* message, va_list argptr)
+{
+	mContext.assign(context);
+
+	if (message != 0)
+	{
+		char buffer[1024];
+#if defined(_MSC_VER) || defined(__DMC__)
+		_vsnprintf(buffer, sizeof(buffer)-1, message, argptr);
+#else
+		vsnprintf(buffer, sizeof(buffer)-1, message, argptr);
+#endif
+		buffer[sizeof(buffer)-1] = 0;
+	
+		buildErrorMessage(buffer);
+	}
+	else
+		buildErrorMessage(0);
+}
+
+ExceptionBase::ExceptionBase() throw()
+{
+}
+
+ExceptionBase::ExceptionBase(const ExceptionBase& copied) throw()
+{
+	mContext = copied.mContext;
+	mWhat = copied.mWhat;
+}
+
+ExceptionBase& ExceptionBase::operator=(const ExceptionBase& copied) throw()
+{
+	mContext = copied.mContext;
+	mWhat = copied.mWhat;
+	return *this;
+}
+
+ExceptionBase::ExceptionBase(const std::string& context,
+								const char* message, ...) throw()
+{
+	va_list argptr;
+	va_start(argptr, message);
+	mWhat.assign("*** IBPP::Exception ***\n");
+	raise(context, message, argptr);
+	va_end(argptr);
+}
+
+ExceptionBase::~ExceptionBase() throw()
+{
+}
+
+const char* ExceptionBase::Origin() const throw()
+{
+	return mContext.c_str();
+}
+
+const char* ExceptionBase::ErrorMessage() const throw()
+{
+	return mWhat.c_str();
+}
+
+const char* ExceptionBase::what() const throw()
+{
+	return mWhat.c_str();
+}
+
+//	(((((((( LogicExceptionImpl Implementation ))))))))
+
+// The following constructors are small and could be inlined, but for object
+// code compacity of the library it is much better to have them non-inlined.
+// The amount of code generated by compilers for a throw is well-enough.
+
+LogicExceptionImpl::LogicExceptionImpl() throw()
+	: ExceptionBase()
+{
+}
+
+LogicExceptionImpl::LogicExceptionImpl(const LogicExceptionImpl& copied) throw()
+	: IBPP::LogicException(), ExceptionBase(copied)
+{
+}
+
+LogicExceptionImpl& LogicExceptionImpl::operator=(const LogicExceptionImpl& copied) throw()
+{
+	ExceptionBase::operator=(copied);
+	return *this;
+}
+
+LogicExceptionImpl::LogicExceptionImpl(const std::string& context,
+										const char* message, ...) throw()
+{
+	va_list argptr;
+	va_start(argptr, message);
+	mWhat.assign("*** IBPP::LogicException ***\n");
+	raise(context, message, argptr);
+	va_end(argptr);
+}
+
+LogicExceptionImpl::~LogicExceptionImpl() throw ()
+{
+}
+
+const char* LogicExceptionImpl::Origin() const throw()
+{
+	return ExceptionBase::Origin();
+}
+
+const char* LogicExceptionImpl::ErrorMessage() const throw()
+{
+	return ExceptionBase::what();
+}
+
+const char* LogicExceptionImpl::what() const throw()
+{
+	return ExceptionBase::what();
+}
+
+//	(((((((( SQLExceptionImpl Implementation ))))))))
+
+SQLExceptionImpl::SQLExceptionImpl() throw()
+	: ExceptionBase(), mSqlCode(0), mEngineCode(0)
+{
+}
+
+SQLExceptionImpl::SQLExceptionImpl(const SQLExceptionImpl& copied) throw()
+	: IBPP::SQLException(), ExceptionBase(copied), mSqlCode(copied.mSqlCode),
+		mEngineCode(copied.mEngineCode)
+{
+}
+
+SQLExceptionImpl& SQLExceptionImpl::operator=(const SQLExceptionImpl& copied) throw()
+{
+	ExceptionBase::operator=(copied);
+	mSqlCode = copied.mSqlCode;
+	mEngineCode = copied.mEngineCode;
+	return *this;
+}
+
+SQLExceptionImpl::SQLExceptionImpl(const IBS& status, const std::string& context,
+									const char* message, ...) throw()
+{
+	va_list argptr;
+	va_start(argptr, message);
+	mWhat.assign("*** IBPP::SQLException ***\n");
+	raise(context, message, argptr);
+	va_end(argptr);
+	mSqlCode = status.SqlCode();
+	mEngineCode = status.EngineCode();
+	mWhat.append(status.ErrorMessage());
+}
+
+SQLExceptionImpl::~SQLExceptionImpl() throw ()
+{
+}
+
+const char* SQLExceptionImpl::Origin() const throw()
+{
+	return ExceptionBase::Origin();
+}
+
+const char* SQLExceptionImpl::ErrorMessage() const throw()
+{
+	return ExceptionBase::what();
+}
+
+const char* SQLExceptionImpl::what() const throw()
+{
+	return ExceptionBase::what();
+}
+
+int SQLExceptionImpl::SqlCode() const throw()
+{
+	return mSqlCode;
+}
+
+int SQLExceptionImpl::EngineCode() const throw()
+{
+	return mEngineCode;
+}
+
+//	(((((((( WrongTypeImpl Implementation ))))))))
+
+// The following constructors are small and could be inlined, but for object
+// code compacity of the library it is much better to have them non-inlined.
+// The amount of code generated by compilers for a throw is well-enough.
+
+WrongTypeImpl::WrongTypeImpl() throw()
+	: IBPP::WrongType(), ExceptionBase()
+{
+}
+
+WrongTypeImpl::WrongTypeImpl(const WrongTypeImpl& copied) throw()
+	: IBPP::WrongType(), ExceptionBase(copied)
+{
+}
+
+WrongTypeImpl& WrongTypeImpl::operator=(const WrongTypeImpl& copied) throw()
+{
+	ExceptionBase::operator=(copied);
+	return *this;
+}
+
+WrongTypeImpl::WrongTypeImpl(const std::string& context, int sqlType, IITYPE varType,
+				const char* message, ...) throw()
+{
+	va_list argptr;
+	va_start(argptr, message);
+	mWhat.assign("*** IBPP::WrongType ***\n");
+	raise(context, message, argptr);
+	va_end(argptr);
+
+	std::string info;
+	switch (sqlType & ~1)
+	{
+		case SQL_TEXT :			info.append("CHAR"); break;
+		case SQL_VARYING :		info.append("VARCHAR"); break;
+		case SQL_SHORT :		info.append("SMALLINT"); break;
+		case SQL_LONG :			info.append("INTEGER"); break;
+		case SQL_INT64 :		info.append("BIGINT"); break;
+		case SQL_FLOAT :		info.append("FLOAT"); break;
+		case SQL_DOUBLE :		info.append("DOUBLE"); break;
+		case SQL_TIMESTAMP :	info.append("TIMESTAMP"); break;
+		case SQL_TYPE_DATE :	info.append("DATE"); break;
+		case SQL_TYPE_TIME :	info.append("TIME"); break;
+		case SQL_BLOB :			info.append("BLOB"); break;
+		case SQL_ARRAY :		info.append("ARRAY"); break;
+	}
+	info.append(" ").append(_(" and ")).append(" ");
+	switch (varType)
+	{
+		case ivArray :		info.append("Array"); break;
+		case ivBlob :		info.append("Blob"); break;
+		case ivDate :		info.append("Date"); break;
+		case ivTime :		info.append("Time"); break;
+		case ivTimestamp :	info.append("Timestamp"); break;
+		case ivString :		info.append("std::string"); break;
+		case ivInt16 :		info.append("int16_t"); break;
+		case ivInt32 :		info.append("int32_t"); break;
+		case ivInt64 :		info.append("int64_t"); break;
+		case ivFloat :		info.append("float"); break;
+		case ivDouble :		info.append("double"); break;
+		case ivBool :		info.append("bool"); break;
+		case ivDBKey :		info.append("DBKey"); break;
+		case ivByte :		info.append("int8_t"); break;
+	}
+	mWhat.append(info).append("\n");
+}
+
+WrongTypeImpl::~WrongTypeImpl() throw ()
+{
+}
+
+const char* WrongTypeImpl::Origin() const throw()
+{
+	return ExceptionBase::Origin();
+}
+
+const char* WrongTypeImpl::ErrorMessage() const throw()
+{
+	return ExceptionBase::what();
+}
+
+const char* WrongTypeImpl::what() const throw()
+{
+	return ExceptionBase::what();
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/ibase.h b/src/terralib/drivers/Firebird/ibpp/core/ibase.h
new file mode 100644
index 0000000..2844d23
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/ibase.h
@@ -0,0 +1,2714 @@
+/*
+ *	MODULE:		ibase.h
+ *	DESCRIPTION:	OSRI entrypoints and defines
+ *
+ * The contents of this file are subject to the Interbase Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy
+ * of the License at http://www.Inprise.com/IPL.html
+ *
+ * Software distributed under the License is distributed on an
+ * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * The Original Code was created by Inprise Corporation
+ * and its predecessors. Portions created by Inprise Corporation are
+ * Copyright (C) Inprise Corporation.
+ *
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ * Added TCP_NO_DELAY option for superserver on Linux
+ * FSG 16.03.2001
+ * 2001.07.28: John Bellardo:  Added blr_skip
+ * 2001.09.18: Ann Harrison:   New info codes
+ * 17-Oct-2001 Mike Nordell: CPU affinity
+ * 2001-04-16 Paul Beach: ISC_TIME_SECONDS_PRECISION_SCALE modified for HP10
+ * Compiler Compatibility
+ * 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports:
+ *                          - EPSON, XENIX, MAC (MAC_AUX), Cray and OS/2
+ * 2002.10.29 Nickolay Samofatov: Added support for savepoints
+ *
+ * 2002.10.29 Sean Leyne - Removed support for obsolete IPX/SPX Protocol
+ *
+ */
+
+#ifndef JRD_IBASE_H
+#define JRD_IBASE_H
+
+#define FB_API_VER 20
+#define isc_version4
+
+#define  ISC_TRUE	1
+#define  ISC_FALSE	0
+#if !(defined __cplusplus)
+#define  ISC__TRUE	ISC_TRUE
+#define  ISC__FALSE	ISC_FALSE
+#endif
+
+#define ISC_FAR
+
+#if defined _MSC_VER && _MSC_VER >= 1300
+#define FB_API_DEPRECATED __declspec(deprecated)
+#elif defined __GNUC__ && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
+#define FB_API_DEPRECATED __attribute__((__deprecated__))
+#else
+#define FB_API_DEPRECATED
+#endif
+
+
+#ifndef INCLUDE_TYPES_PUB_H
+#define INCLUDE_TYPES_PUB_H
+
+#if defined(_LP64) || defined(__LP64__) || defined(__arch64__)
+typedef unsigned int    FB_API_HANDLE;
+#else
+typedef void*           FB_API_HANDLE;
+#endif
+
+typedef long ISC_STATUS;
+
+#define ISC_STATUS_LENGTH       20
+typedef ISC_STATUS ISC_STATUS_ARRAY[ISC_STATUS_LENGTH];
+
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+        #define  ISC_EXPORT     __stdcall
+        #define  ISC_EXPORT_VARARG      __cdecl
+#else
+        #define  ISC_EXPORT
+        #define  ISC_EXPORT_VARARG
+#endif
+
+#if defined(_LP64) || defined(__LP64__) || defined(__arch64__)
+typedef int             ISC_LONG;
+typedef unsigned int    ISC_ULONG;
+#else
+typedef signed long     ISC_LONG;
+typedef unsigned long   ISC_ULONG;
+#endif
+
+typedef signed short    ISC_SHORT;
+typedef unsigned short  ISC_USHORT;
+
+typedef unsigned char   ISC_UCHAR;
+typedef char            ISC_SCHAR;
+
+#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && !defined(__GNUC__)
+typedef __int64                         ISC_INT64;
+typedef unsigned __int64        ISC_UINT64;
+#else
+typedef long long int                   ISC_INT64;
+typedef unsigned long long int  ISC_UINT64;
+#endif
+
+#ifndef ISC_TIMESTAMP_DEFINED
+typedef int                     ISC_DATE;
+typedef unsigned int    ISC_TIME;
+typedef struct
+{
+        ISC_DATE timestamp_date;
+        ISC_TIME timestamp_time;
+} ISC_TIMESTAMP;
+#define ISC_TIMESTAMP_DEFINED
+#endif  
+
+struct GDS_QUAD_t {
+        ISC_LONG gds_quad_high;
+        ISC_ULONG gds_quad_low;
+};
+
+typedef struct GDS_QUAD_t GDS_QUAD;
+typedef struct GDS_QUAD_t ISC_QUAD;
+
+#define isc_quad_high   gds_quad_high
+#define isc_quad_low    gds_quad_low
+
+#endif 
+
+/********************************/
+/* InterBase Handle Definitions */
+/********************************/
+
+typedef FB_API_HANDLE isc_att_handle;
+typedef FB_API_HANDLE isc_blob_handle;
+typedef FB_API_HANDLE isc_db_handle;
+typedef FB_API_HANDLE isc_req_handle;
+typedef FB_API_HANDLE isc_stmt_handle;
+typedef FB_API_HANDLE isc_svc_handle;
+typedef FB_API_HANDLE isc_tr_handle;
+typedef void (* isc_callback) ();
+typedef ISC_LONG isc_resv_handle;
+
+typedef void (*ISC_PRINT_CALLBACK) (void*, ISC_SHORT, const char*);
+typedef void (*ISC_VERSION_CALLBACK)(void*, const char*);
+typedef void (*ISC_EVENT_CALLBACK)(void*, ISC_USHORT, const ISC_UCHAR*);
+
+/*******************************************************************/
+/* Blob id structure                                               */
+/*******************************************************************/
+
+#if !(defined __cplusplus)
+typedef GDS_QUAD GDS__QUAD;
+#endif /* !(defined __cplusplus) */
+
+typedef struct
+{
+	short array_bound_lower;
+	short array_bound_upper;
+} ISC_ARRAY_BOUND;
+
+typedef struct
+{
+	ISC_UCHAR	array_desc_dtype;
+	ISC_SCHAR			array_desc_scale;
+	unsigned short	array_desc_length;
+	ISC_SCHAR			array_desc_field_name[32];
+	ISC_SCHAR			array_desc_relation_name[32];
+	short			array_desc_dimensions;
+	short			array_desc_flags;
+	ISC_ARRAY_BOUND	array_desc_bounds[16];
+} ISC_ARRAY_DESC;
+
+typedef struct
+{
+	short			blob_desc_subtype;
+	short			blob_desc_charset;
+	short			blob_desc_segment_size;
+	ISC_UCHAR	blob_desc_field_name[32];
+	ISC_UCHAR	blob_desc_relation_name[32];
+} ISC_BLOB_DESC;
+
+/***************************/
+/* Blob control structure  */
+/***************************/
+
+typedef struct isc_blob_ctl
+{
+	ISC_STATUS	(* ctl_source)();	/* Source filter */
+	struct isc_blob_ctl*	ctl_source_handle;	/* Argument to pass to source filter */
+	short					ctl_to_sub_type;		/* Target type */
+	short					ctl_from_sub_type;		/* Source type */
+	unsigned short			ctl_buffer_length;		/* Length of buffer */
+	unsigned short			ctl_segment_length;		/* Length of current segment */
+	unsigned short			ctl_bpb_length;			/* Length of blob parameter  block */
+	/* Internally, this is const UCHAR*, but this public struct probably can't change. */
+	ISC_SCHAR*					ctl_bpb;				/* Address of blob parameter block */
+	ISC_UCHAR*			ctl_buffer;				/* Address of segment buffer */
+	ISC_LONG				ctl_max_segment;		/* Length of longest segment */
+	ISC_LONG				ctl_number_segments;	/* Total number of segments */
+	ISC_LONG				ctl_total_length;		/* Total length of blob */
+	ISC_STATUS*				ctl_status;				/* Address of status vector */
+	long					ctl_data[8];			/* Application specific data */
+} * ISC_BLOB_CTL;
+
+/***************************/
+/* Blob stream definitions */
+/***************************/
+
+typedef struct bstream
+{
+	isc_blob_handle	bstr_blob;		/* Blob handle */
+	ISC_SCHAR *			bstr_buffer;	/* Address of buffer */
+	ISC_SCHAR *			bstr_ptr;		/* Next character */
+	short			bstr_length;	/* Length of buffer */
+	short			bstr_cnt;		/* Characters in buffer */
+	char			bstr_mode;		/* (mode) ? OUTPUT : INPUT */
+} BSTREAM;
+
+/* Three ugly macros, one even using octal radix... sigh... */
+#define getb(p)	(--(p)->bstr_cnt >= 0 ? *(p)->bstr_ptr++ & 0377: BLOB_get (p))
+#define putb(x,p) (((x) == '\n' || (!(--(p)->bstr_cnt))) ? BLOB_put ((x),p) : ((int) (*(p)->bstr_ptr++ = (unsigned) (x))))
+#define putbx(x,p) ((!(--(p)->bstr_cnt)) ? BLOB_put ((x),p) : ((int) (*(p)->bstr_ptr++ = (unsigned) (x))))
+
+/********************************************************************/
+/* CVC: Public blob interface definition held in val.h.             */
+/* For some unknown reason, it was only documented in langRef       */
+/* and being the structure passed by the engine to UDFs it never    */
+/* made its way into this public definitions file.                  */
+/* Being its original name "blob", I renamed it blobcallback here.  */
+/* I did the full definition with the proper parameters instead of  */
+/* the weak C declaration with any number and type of parameters.   */
+/* Since the first parameter -BLB- is unknown outside the engine,   */
+/* it's more accurate to use void* than int* as the blob pointer    */
+/********************************************************************/
+
+#if !defined(JRD_VAL_H) && !defined(REQUESTER)
+/* Blob passing structure */
+
+/* This enum applies to parameter "mode" in blob_lseek */
+enum blob_lseek_mode {blb_seek_relative = 1, blb_seek_from_tail = 2};
+/* This enum applies to the value returned by blob_get_segment */
+enum blob_get_result {blb_got_fragment = -1, blb_got_eof = 0, blb_got_full_segment = 1};
+
+typedef struct blobcallback {
+    short (*blob_get_segment)
+		(void* hnd, ISC_UCHAR* buffer, ISC_USHORT buf_size, ISC_USHORT* result_len);
+    void*		blob_handle;
+    ISC_LONG	blob_number_segments;
+    ISC_LONG	blob_max_segment;
+    ISC_LONG	blob_total_length;
+    void (*blob_put_segment)
+		(void* hnd, const ISC_UCHAR* buffer, ISC_USHORT buf_size);
+    ISC_LONG (*blob_lseek)
+		(void* hnd, ISC_USHORT mode, ISC_LONG offset);
+}  *BLOBCALLBACK;
+#endif /* !defined(JRD_VAL_H) && !defined(REQUESTER) */
+
+
+/********************************************************************/
+/* CVC: Public descriptor interface held in dsc2.h.                  */
+/* We need it documented to be able to recognize NULL in UDFs.      */
+/* Being its original name "dsc", I renamed it paramdsc here.       */
+/* Notice that I adjust to the original definition: contrary to     */
+/* other cases, the typedef is the same struct not the pointer.     */
+/* I included the enumeration of dsc_dtype possible values.         */
+/* Ultimately, dsc2.h should be part of the public interface.        */
+/********************************************************************/
+
+#if !defined(JRD_DSC_H)
+/* This is the famous internal descriptor that UDFs can use, too. */
+typedef struct paramdsc {
+    ISC_UCHAR	dsc_dtype;
+    signed char		dsc_scale;
+    ISC_USHORT		dsc_length;
+    short		dsc_sub_type;
+    ISC_USHORT		dsc_flags;
+    ISC_UCHAR	*dsc_address;
+} PARAMDSC;
+
+#if !defined(JRD_VAL_H)
+/* This is a helper struct to work with varchars. */
+typedef struct paramvary {
+    ISC_USHORT		vary_length;
+    ISC_UCHAR		vary_string[1];
+} PARAMVARY;
+#endif /* !defined(JRD_VAL_H) */
+
+
+#ifndef JRD_DSC_PUB_H
+#define JRD_DSC_PUB_H
+
+#define DSC_null                1
+#define DSC_no_subtype          2       
+#define DSC_nullable            4       
+
+#define dtype_unknown   0
+#define dtype_text      1
+#define dtype_cstring   2
+#define dtype_varying   3
+
+#define dtype_packed    6
+#define dtype_byte      7
+#define dtype_short     8
+#define dtype_long      9
+#define dtype_quad      10
+#define dtype_real      11
+#define dtype_double    12
+#define dtype_d_float   13
+#define dtype_sql_date  14
+#define dtype_sql_time  15
+#define dtype_timestamp 16
+#define dtype_blob      17
+#define dtype_array     18
+#define dtype_int64     19
+#define DTYPE_TYPE_MAX  20
+
+#define ISC_TIME_SECONDS_PRECISION              10000
+#define ISC_TIME_SECONDS_PRECISION_SCALE        (-4)
+
+#endif 
+
+
+#endif /* !defined(JRD_DSC_H) */
+
+/***************************/
+/* Dynamic SQL definitions */
+/***************************/
+
+
+#ifndef DSQL_SQLDA_PUB_H
+#define DSQL_SQLDA_PUB_H
+
+#define DSQL_close      1
+#define DSQL_drop       2
+
+typedef struct
+{
+        ISC_SHORT       sqltype;                        
+        ISC_SHORT       sqlscale;                       
+        ISC_SHORT       sqlsubtype;                     
+        ISC_SHORT       sqllen;                         
+        ISC_SCHAR*      sqldata;                        
+        ISC_SHORT*      sqlind;                         
+        ISC_SHORT       sqlname_length;         
+        ISC_SCHAR       sqlname[32];            
+        ISC_SHORT       relname_length;         
+        ISC_SCHAR       relname[32];            
+        ISC_SHORT       ownname_length;         
+        ISC_SCHAR       ownname[32];            
+        ISC_SHORT       aliasname_length;       
+        ISC_SCHAR       aliasname[32];          
+} XSQLVAR;
+
+#define SQLDA_VERSION1          1
+
+typedef struct
+{
+        ISC_SHORT       version;                        
+        ISC_SCHAR       sqldaid[8];                     
+        ISC_LONG        sqldabc;                        
+        ISC_SHORT       sqln;                           
+        ISC_SHORT       sqld;                           
+        XSQLVAR sqlvar[1];                      
+} XSQLDA;
+
+#define XSQLDA_LENGTH(n)        (sizeof (XSQLDA) + (n - 1) * sizeof (XSQLVAR))
+
+#define SQL_TEXT                           452
+#define SQL_VARYING                        448
+#define SQL_SHORT                          500
+#define SQL_LONG                           496
+#define SQL_FLOAT                          482
+#define SQL_DOUBLE                         480
+#define SQL_D_FLOAT                        530
+#define SQL_TIMESTAMP                      510
+#define SQL_BLOB                           520
+#define SQL_ARRAY                          540
+#define SQL_QUAD                           550
+#define SQL_TYPE_TIME                      560
+#define SQL_TYPE_DATE                      570
+#define SQL_INT64                          580
+
+#define SQL_DATE                           SQL_TIMESTAMP
+
+#define SQL_DIALECT_V5                          1       
+#define SQL_DIALECT_V6_TRANSITION       2       
+#define SQL_DIALECT_V6                          3       
+#define SQL_DIALECT_CURRENT             SQL_DIALECT_V6  
+
+#endif 
+
+
+/***************************/
+/* OSRI database functions */
+/***************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ISC_STATUS ISC_EXPORT isc_attach_database(ISC_STATUS*,
+										  short,
+										  const ISC_SCHAR*,
+										  isc_db_handle*,
+										  short,
+										  const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_array_gen_sdl(ISC_STATUS*,
+										const ISC_ARRAY_DESC*,
+										ISC_SHORT*,
+										ISC_UCHAR*,
+										ISC_SHORT*);
+
+ISC_STATUS ISC_EXPORT isc_array_get_slice(ISC_STATUS*,
+										  isc_db_handle*,
+										  isc_tr_handle*,
+										  ISC_QUAD*,
+										  const ISC_ARRAY_DESC*,
+										  void*,
+										  ISC_LONG*);
+
+ISC_STATUS ISC_EXPORT isc_array_lookup_bounds(ISC_STATUS*,
+											  isc_db_handle*,
+											  isc_tr_handle*,
+											  const ISC_SCHAR*,
+											  const ISC_SCHAR*,
+											  ISC_ARRAY_DESC*);
+
+ISC_STATUS ISC_EXPORT isc_array_lookup_desc(ISC_STATUS*,
+											isc_db_handle*,
+											isc_tr_handle*,
+											const ISC_SCHAR*,
+											const ISC_SCHAR*,
+											ISC_ARRAY_DESC*);
+
+ISC_STATUS ISC_EXPORT isc_array_set_desc(ISC_STATUS*,
+										 const ISC_SCHAR*,
+										 const ISC_SCHAR*,
+										 const short*,
+										 const short*,
+										 const short*,
+										 ISC_ARRAY_DESC*);
+
+ISC_STATUS ISC_EXPORT isc_array_put_slice(ISC_STATUS*,
+										  isc_db_handle*,
+										  isc_tr_handle*,
+										  ISC_QUAD*,
+										  const ISC_ARRAY_DESC*,
+										  void*,
+										  ISC_LONG *);
+
+void ISC_EXPORT isc_blob_default_desc(ISC_BLOB_DESC*,
+									  const ISC_UCHAR*,
+									  const ISC_UCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_blob_gen_bpb(ISC_STATUS*,
+									   const ISC_BLOB_DESC*,
+									   const ISC_BLOB_DESC*,
+									   unsigned short,
+									   ISC_UCHAR*,
+									   unsigned short*);
+
+ISC_STATUS ISC_EXPORT isc_blob_info(ISC_STATUS*,
+									isc_blob_handle*,
+									short,
+									const ISC_SCHAR*,
+									short,
+									ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_blob_lookup_desc(ISC_STATUS*,
+										   isc_db_handle*,
+										   isc_tr_handle*,
+										   const ISC_UCHAR*,
+										   const ISC_UCHAR*,
+										   ISC_BLOB_DESC*,
+										   ISC_UCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_blob_set_desc(ISC_STATUS*,
+										const ISC_UCHAR*,
+										const ISC_UCHAR*,
+										short,
+										short,
+										short,
+										ISC_BLOB_DESC*);
+
+ISC_STATUS ISC_EXPORT isc_cancel_blob(ISC_STATUS *,
+									  isc_blob_handle *);
+
+ISC_STATUS ISC_EXPORT isc_cancel_events(ISC_STATUS *,
+										isc_db_handle *,
+										ISC_LONG *);
+
+ISC_STATUS ISC_EXPORT isc_close_blob(ISC_STATUS *,
+									 isc_blob_handle *);
+
+ISC_STATUS ISC_EXPORT isc_commit_retaining(ISC_STATUS *,
+										   isc_tr_handle *);
+
+ISC_STATUS ISC_EXPORT isc_commit_transaction(ISC_STATUS *,
+											 isc_tr_handle *);
+
+ISC_STATUS ISC_EXPORT isc_create_blob(ISC_STATUS*,
+									  isc_db_handle*,
+									  isc_tr_handle*,
+									  isc_blob_handle*,
+									  ISC_QUAD*);
+
+ISC_STATUS ISC_EXPORT isc_create_blob2(ISC_STATUS*,
+									   isc_db_handle*,
+									   isc_tr_handle*,
+									   isc_blob_handle*,
+									   ISC_QUAD*,
+									   short,
+									   const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_create_database(ISC_STATUS*,
+										  short,
+										  const ISC_SCHAR*,
+										  isc_db_handle*,
+										  short,
+										  const ISC_SCHAR*,
+										  short);
+
+ISC_STATUS ISC_EXPORT isc_database_info(ISC_STATUS*,
+										isc_db_handle*,
+										short,
+										const ISC_SCHAR*,
+										short,
+										ISC_SCHAR*);
+
+void ISC_EXPORT isc_decode_date(const ISC_QUAD*,
+								void*);
+
+void ISC_EXPORT isc_decode_sql_date(const ISC_DATE*,
+									void*);
+
+void ISC_EXPORT isc_decode_sql_time(const ISC_TIME*,
+									void*);
+
+void ISC_EXPORT isc_decode_timestamp(const ISC_TIMESTAMP*,
+									 void*);
+
+ISC_STATUS ISC_EXPORT isc_detach_database(ISC_STATUS *,
+										  isc_db_handle *);
+
+ISC_STATUS ISC_EXPORT isc_drop_database(ISC_STATUS *,
+										isc_db_handle *);
+
+ISC_STATUS ISC_EXPORT isc_dsql_allocate_statement(ISC_STATUS *,
+												  isc_db_handle *,
+												  isc_stmt_handle *);
+
+ISC_STATUS ISC_EXPORT isc_dsql_alloc_statement2(ISC_STATUS *,
+												isc_db_handle *,
+												isc_stmt_handle *);
+
+ISC_STATUS ISC_EXPORT isc_dsql_describe(ISC_STATUS *,
+										isc_stmt_handle *,
+										unsigned short,
+										XSQLDA *);
+
+ISC_STATUS ISC_EXPORT isc_dsql_describe_bind(ISC_STATUS *,
+											 isc_stmt_handle *,
+											 unsigned short,
+											 XSQLDA *);
+
+ISC_STATUS ISC_EXPORT isc_dsql_exec_immed2(ISC_STATUS*,
+										   isc_db_handle*,
+										   isc_tr_handle*,
+										   unsigned short,
+										   const ISC_SCHAR*,
+										   unsigned short,
+										   XSQLDA*,
+										   XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_execute(ISC_STATUS*,
+									   isc_tr_handle*,
+									   isc_stmt_handle*,
+									   unsigned short,
+									   XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_execute2(ISC_STATUS*,
+										isc_tr_handle*,
+										isc_stmt_handle*,
+										unsigned short,
+										XSQLDA*,
+										XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_execute_immediate(ISC_STATUS*,
+												 isc_db_handle*,
+												 isc_tr_handle*,
+												 unsigned short,
+												 const ISC_SCHAR*,
+												 unsigned short,
+												 XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_fetch(ISC_STATUS *,
+									 isc_stmt_handle *,
+									 unsigned short,
+									 XSQLDA *);
+
+ISC_STATUS ISC_EXPORT isc_dsql_finish(isc_db_handle *);
+
+ISC_STATUS ISC_EXPORT isc_dsql_free_statement(ISC_STATUS *,
+											  isc_stmt_handle *,
+											  unsigned short);
+
+ISC_STATUS ISC_EXPORT isc_dsql_insert(ISC_STATUS*,
+									  isc_stmt_handle*,
+									  unsigned short,
+									  XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_prepare(ISC_STATUS*,
+									   isc_tr_handle*,
+									   isc_stmt_handle*,
+									   unsigned short,
+									   const ISC_SCHAR*,
+									   unsigned short,
+									   XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_set_cursor_name(ISC_STATUS*,
+											   isc_stmt_handle*,
+											   const ISC_SCHAR*,
+											   unsigned short);
+
+ISC_STATUS ISC_EXPORT isc_dsql_sql_info(ISC_STATUS*,
+										isc_stmt_handle*,
+										short,
+										const ISC_SCHAR*,
+										short,
+										ISC_SCHAR*);
+
+void ISC_EXPORT isc_encode_date(const void*,
+								ISC_QUAD*);
+
+void ISC_EXPORT isc_encode_sql_date(const void*,
+									ISC_DATE*);
+
+void ISC_EXPORT isc_encode_sql_time(const void*,
+									ISC_TIME*);
+
+void ISC_EXPORT isc_encode_timestamp(const void*,
+									 ISC_TIMESTAMP*);
+
+ISC_LONG ISC_EXPORT_VARARG isc_event_block(ISC_UCHAR**,
+										   ISC_UCHAR**,
+										   unsigned short, ...);
+
+void ISC_EXPORT isc_event_counts(ISC_ULONG*,
+								 short,
+								 ISC_UCHAR*,
+								 const ISC_UCHAR *);
+
+/* 17 May 2001 - isc_expand_dpb is DEPRECATED */
+void FB_API_DEPRECATED ISC_EXPORT_VARARG isc_expand_dpb(ISC_SCHAR**,
+											  			short*, ...);
+
+int ISC_EXPORT isc_modify_dpb(ISC_SCHAR**,
+							  short*,
+							  unsigned short,
+							  const ISC_SCHAR*,
+							  short);
+
+ISC_LONG ISC_EXPORT isc_free(ISC_SCHAR *);
+
+ISC_STATUS ISC_EXPORT isc_get_segment(ISC_STATUS *,
+									  isc_blob_handle *,
+									  unsigned short *,
+									  unsigned short,
+									  ISC_SCHAR *);
+
+ISC_STATUS ISC_EXPORT isc_get_slice(ISC_STATUS*,
+									isc_db_handle*,
+									isc_tr_handle*,
+									ISC_QUAD*,
+									short,
+									const ISC_SCHAR*,
+									short,
+									const ISC_LONG*,
+									ISC_LONG,
+									void*,
+									ISC_LONG*);
+
+/* CVC: This non-const signature is needed for compatibility, see gds.cpp. */
+ISC_LONG FB_API_DEPRECATED ISC_EXPORT isc_interprete(ISC_SCHAR*,
+									 ISC_STATUS**);
+
+/* This const params version used in the engine and other places. */
+ISC_LONG ISC_EXPORT fb_interpret(ISC_SCHAR*,
+								 unsigned int,
+								 const ISC_STATUS**);
+
+ISC_STATUS ISC_EXPORT isc_open_blob(ISC_STATUS*,
+									isc_db_handle*,
+									isc_tr_handle*,
+									isc_blob_handle*,
+									ISC_QUAD*);
+
+ISC_STATUS ISC_EXPORT isc_open_blob2(ISC_STATUS*,
+									 isc_db_handle*,
+									 isc_tr_handle*,
+									 isc_blob_handle*,
+									 ISC_QUAD*,
+									 ISC_USHORT,
+									 const ISC_UCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_prepare_transaction2(ISC_STATUS*,
+											   isc_tr_handle*,
+											   ISC_USHORT,
+											   const ISC_UCHAR*);
+
+void ISC_EXPORT isc_print_sqlerror(ISC_SHORT,
+								   const ISC_STATUS*);
+
+ISC_STATUS ISC_EXPORT isc_print_status(const ISC_STATUS*);
+
+ISC_STATUS ISC_EXPORT isc_put_segment(ISC_STATUS*,
+									  isc_blob_handle*,
+									  unsigned short,
+									  const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_put_slice(ISC_STATUS*,
+									isc_db_handle*,
+									isc_tr_handle*,
+									ISC_QUAD*,
+									short,
+									const ISC_SCHAR*,
+									short,
+									const ISC_LONG*,
+									ISC_LONG,
+									void*);
+
+ISC_STATUS ISC_EXPORT isc_que_events(ISC_STATUS*,
+									 isc_db_handle*,
+									 ISC_LONG*,
+									 short,
+									 const ISC_UCHAR*,
+									 ISC_EVENT_CALLBACK,
+									 void*);
+
+ISC_STATUS ISC_EXPORT isc_rollback_retaining(ISC_STATUS *,
+											 isc_tr_handle *);
+
+ISC_STATUS ISC_EXPORT isc_rollback_transaction(ISC_STATUS *,
+											   isc_tr_handle *);
+
+ISC_STATUS ISC_EXPORT isc_start_multiple(ISC_STATUS *,
+										 isc_tr_handle *,
+										 short,
+										 void *);
+
+ISC_STATUS ISC_EXPORT_VARARG isc_start_transaction(ISC_STATUS *,
+												   isc_tr_handle *,
+												   short, ...);
+
+ISC_LONG ISC_EXPORT isc_sqlcode(const ISC_STATUS*);
+
+void ISC_EXPORT isc_sql_interprete(short,
+								   ISC_SCHAR *,
+								   short);
+
+ISC_STATUS ISC_EXPORT isc_transaction_info(ISC_STATUS*,
+										   isc_tr_handle*,
+										   short,
+										   const ISC_SCHAR*,
+										   short,
+										   ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_transact_request(ISC_STATUS*,
+										   isc_db_handle*,
+										   isc_tr_handle*,
+										   unsigned short,
+										   const ISC_SCHAR*,
+										   unsigned short,
+										   ISC_SCHAR*,
+										   unsigned short,
+										   ISC_SCHAR*);
+
+ISC_LONG ISC_EXPORT isc_vax_integer(const ISC_SCHAR*,
+									short);
+
+ISC_INT64 ISC_EXPORT isc_portable_integer(const ISC_UCHAR*,
+										  short);
+
+/*************************************/
+/* Security Functions and structures */
+/*************************************/
+
+#define sec_uid_spec		    0x01
+#define sec_gid_spec		    0x02
+#define sec_server_spec		    0x04
+#define sec_password_spec	    0x08
+#define sec_group_name_spec	    0x10
+#define sec_first_name_spec	    0x20
+#define sec_middle_name_spec        0x40
+#define sec_last_name_spec	    0x80
+#define sec_dba_user_name_spec      0x100
+#define sec_dba_password_spec       0x200
+
+#define sec_protocol_tcpip            1
+#define sec_protocol_netbeui          2
+#define sec_protocol_spx              3 /* -- Deprecated Protocol. Declaration retained for compatibility   */
+#define sec_protocol_local            4
+
+typedef struct {
+	short sec_flags;			/* which fields are specified */
+	int uid;					/* the user's id */
+	int gid;					/* the user's group id */
+	int protocol;				/* protocol to use for connection */
+	ISC_SCHAR *server;				/* server to administer */
+	ISC_SCHAR *user_name;			/* the user's name */
+	ISC_SCHAR *password;				/* the user's password */
+	ISC_SCHAR *group_name;			/* the group name */
+	ISC_SCHAR *first_name;			/* the user's first name */
+	ISC_SCHAR *middle_name;			/* the user's middle name */
+	ISC_SCHAR *last_name;			/* the user's last name */
+	ISC_SCHAR *dba_user_name;		/* the dba user name */
+	ISC_SCHAR *dba_password;			/* the dba password */
+} USER_SEC_DATA;
+
+ISC_STATUS ISC_EXPORT isc_add_user(ISC_STATUS*, const USER_SEC_DATA*);
+
+ISC_STATUS ISC_EXPORT isc_delete_user(ISC_STATUS*, const USER_SEC_DATA*);
+
+ISC_STATUS ISC_EXPORT isc_modify_user(ISC_STATUS*, const USER_SEC_DATA*);
+
+/**********************************/
+/*  Other OSRI functions          */
+/**********************************/
+
+ISC_STATUS ISC_EXPORT isc_compile_request(ISC_STATUS*,
+										  isc_db_handle*,
+										  isc_req_handle*,
+										  short,
+										  const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_compile_request2(ISC_STATUS*,
+										   isc_db_handle*,
+										   isc_req_handle*,
+										   short,
+										   const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_ddl(ISC_STATUS*,
+							  isc_db_handle*,
+							  isc_tr_handle*,
+							  short,
+							  const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_prepare_transaction(ISC_STATUS*,
+											  isc_tr_handle*);
+
+
+ISC_STATUS ISC_EXPORT isc_receive(ISC_STATUS*,
+								  isc_req_handle*,
+								  short,
+								  short,
+								  void*,
+								  short);
+
+ISC_STATUS ISC_EXPORT isc_reconnect_transaction(ISC_STATUS*,
+												isc_db_handle*,
+												isc_tr_handle*,
+												short,
+												const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_release_request(ISC_STATUS*,
+										  isc_req_handle*);
+
+ISC_STATUS ISC_EXPORT isc_request_info(ISC_STATUS*,
+									   isc_req_handle*,
+									   short,
+									   short,
+									   const ISC_SCHAR*,
+									   short,
+									   ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_seek_blob(ISC_STATUS*,
+									isc_blob_handle*,
+									short,
+									ISC_LONG,
+									ISC_LONG*);
+
+ISC_STATUS ISC_EXPORT isc_send(ISC_STATUS*,
+							   isc_req_handle*,
+							   short,
+							   short,
+							   const void*,
+							   short);
+
+ISC_STATUS ISC_EXPORT isc_start_and_send(ISC_STATUS*,
+										 isc_req_handle*,
+										 isc_tr_handle*,
+										 short,
+										 short,
+										 const void*,
+										 short);
+
+ISC_STATUS ISC_EXPORT isc_start_request(ISC_STATUS *,
+										isc_req_handle *,
+										isc_tr_handle *,
+										short);
+
+ISC_STATUS ISC_EXPORT isc_unwind_request(ISC_STATUS *,
+										 isc_tr_handle *,
+										 short);
+
+ISC_STATUS ISC_EXPORT isc_wait_for_event(ISC_STATUS*,
+										 isc_db_handle*,
+										 short,
+										 const ISC_UCHAR*,
+										 ISC_UCHAR*);
+
+
+/*****************************/
+/* Other Sql functions       */
+/*****************************/
+
+ISC_STATUS ISC_EXPORT isc_close(ISC_STATUS*,
+								const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_declare(ISC_STATUS*,
+								  const ISC_SCHAR*,
+								  const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_describe(ISC_STATUS*,
+								   const ISC_SCHAR*,
+								   XSQLDA *);
+
+ISC_STATUS ISC_EXPORT isc_describe_bind(ISC_STATUS*,
+										const ISC_SCHAR*,
+										XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_execute(ISC_STATUS*,
+								  isc_tr_handle*,
+								  const ISC_SCHAR*,
+								  XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_execute_immediate(ISC_STATUS*,
+											isc_db_handle*,
+											isc_tr_handle*,
+											short*,
+											const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_fetch(ISC_STATUS*,
+								const ISC_SCHAR*,
+								XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_open(ISC_STATUS*,
+							   isc_tr_handle*,
+							   const ISC_SCHAR*,
+							   XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_prepare(ISC_STATUS*,
+								  isc_db_handle*,
+								  isc_tr_handle*,
+								  const ISC_SCHAR*,
+								  short*,
+								  const ISC_SCHAR*,
+								  XSQLDA*);
+
+
+/*************************************/
+/* Other Dynamic sql functions       */
+/*************************************/
+
+ISC_STATUS ISC_EXPORT isc_dsql_execute_m(ISC_STATUS*,
+										 isc_tr_handle*,
+										 isc_stmt_handle*,
+										 unsigned short,
+										 const ISC_SCHAR*,
+										 unsigned short,
+										 unsigned short,
+										 ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_execute2_m(ISC_STATUS*,
+										  isc_tr_handle*,
+										  isc_stmt_handle*,
+										  unsigned short,
+										  const ISC_SCHAR*,
+										  unsigned short,
+										  unsigned short,
+										  const ISC_SCHAR*,
+										  unsigned short,
+										  ISC_SCHAR*,
+										  unsigned short,
+										  unsigned short,
+										  ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_execute_immediate_m(ISC_STATUS*,
+												   isc_db_handle*,
+												   isc_tr_handle*,
+												   unsigned short,
+												   const ISC_SCHAR*,
+												   unsigned short,
+												   unsigned short,
+												   const ISC_SCHAR*,
+												   unsigned short,
+												   unsigned short,
+												   ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_exec_immed3_m(ISC_STATUS*,
+											 isc_db_handle*,
+											 isc_tr_handle*,
+											 unsigned short,
+											 const ISC_SCHAR*,
+											 unsigned short,
+											 unsigned short,
+											 const ISC_SCHAR*,
+											 unsigned short,
+											 unsigned short,
+											 ISC_SCHAR*,
+											 unsigned short,
+											 ISC_SCHAR*,
+											 unsigned short,
+											 unsigned short,
+											 ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_fetch_m(ISC_STATUS*,
+									   isc_stmt_handle*,
+									   unsigned short,
+									   const ISC_SCHAR*,
+									   unsigned short,
+									   unsigned short,
+									   ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_insert_m(ISC_STATUS*,
+										isc_stmt_handle*,
+										unsigned short,
+										const ISC_SCHAR*,
+										unsigned short,
+										unsigned short,
+										const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_prepare_m(ISC_STATUS*,
+										 isc_tr_handle*,
+										 isc_stmt_handle*,
+										 unsigned short,
+										 const ISC_SCHAR*,
+										 unsigned short,
+										 unsigned short,
+										 const ISC_SCHAR*,
+										 unsigned short,
+										 ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_dsql_release(ISC_STATUS*,
+									   const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_close(ISC_STATUS*,
+										   const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_declare(ISC_STATUS*,
+											 const ISC_SCHAR*,
+											 const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_describe(ISC_STATUS*,
+											  const ISC_SCHAR*,
+											  unsigned short,
+											  XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_describe_bind(ISC_STATUS*,
+												   const ISC_SCHAR*,
+												   unsigned short,
+												   XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_execute(ISC_STATUS*,
+											 isc_tr_handle*,
+											 const ISC_SCHAR*,
+											 unsigned short,
+											 XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_execute2(ISC_STATUS*,
+											  isc_tr_handle*,
+											  const ISC_SCHAR*,
+											  unsigned short,
+											  XSQLDA*,
+											  XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_execute_immed(ISC_STATUS*,
+												   isc_db_handle*,
+												   isc_tr_handle*,
+												   unsigned short,
+												   const ISC_SCHAR*,
+												   unsigned short,
+												   XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_fetch(ISC_STATUS*,
+										   const ISC_SCHAR*,
+										   unsigned short,
+										   XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_open(ISC_STATUS*,
+										  isc_tr_handle*,
+										  const ISC_SCHAR*,
+										  unsigned short,
+										  XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_open2(ISC_STATUS*,
+										   isc_tr_handle*,
+										   const ISC_SCHAR*,
+										   unsigned short,
+										   XSQLDA*,
+										   XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_insert(ISC_STATUS*,
+											const ISC_SCHAR*,
+											unsigned short,
+											XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_prepare(ISC_STATUS*,
+											 isc_db_handle*,
+											 isc_tr_handle*,
+											 const ISC_SCHAR*,
+											 unsigned short,
+											 const ISC_SCHAR*,
+											 unsigned short,
+											 XSQLDA*);
+
+ISC_STATUS ISC_EXPORT isc_embed_dsql_release(ISC_STATUS*,
+											 const ISC_SCHAR*);
+
+
+/******************************/
+/* Other Blob functions       */
+/******************************/
+
+BSTREAM* ISC_EXPORT BLOB_open(isc_blob_handle,
+									  ISC_SCHAR*,
+									  int);
+
+int ISC_EXPORT BLOB_put(ISC_SCHAR,
+						BSTREAM*);
+
+int ISC_EXPORT BLOB_close(BSTREAM*);
+
+int ISC_EXPORT BLOB_get(BSTREAM*);
+
+int ISC_EXPORT BLOB_display(ISC_QUAD*,
+							isc_db_handle,
+							isc_tr_handle,
+							const ISC_SCHAR*);
+
+int ISC_EXPORT BLOB_dump(ISC_QUAD*,
+						 isc_db_handle,
+						 isc_tr_handle,
+						 const ISC_SCHAR*);
+
+int ISC_EXPORT BLOB_edit(ISC_QUAD*,
+						 isc_db_handle,
+						 isc_tr_handle,
+						 const ISC_SCHAR*);
+
+int ISC_EXPORT BLOB_load(ISC_QUAD*,
+						 isc_db_handle,
+						 isc_tr_handle,
+						 const ISC_SCHAR*);
+
+int ISC_EXPORT BLOB_text_dump(ISC_QUAD*,
+							  isc_db_handle,
+							  isc_tr_handle,
+							  const ISC_SCHAR*);
+
+int ISC_EXPORT BLOB_text_load(ISC_QUAD*,
+							  isc_db_handle,
+							  isc_tr_handle,
+							  const ISC_SCHAR*);
+
+BSTREAM* ISC_EXPORT Bopen(ISC_QUAD*,
+								  isc_db_handle,
+								  isc_tr_handle,
+								  const ISC_SCHAR*);
+
+/* Disabled, not found anywhere.
+BSTREAM* ISC_EXPORT Bopen2(ISC_QUAD*,
+								   isc_db_handle,
+								   isc_tr_handle,
+								   const ISC_SCHAR*,
+								   unsigned short);
+*/
+
+
+/******************************/
+/* Other Misc functions       */
+/******************************/
+
+ISC_LONG ISC_EXPORT isc_ftof(const ISC_SCHAR*,
+							 const unsigned short,
+							 ISC_SCHAR*,
+							 const unsigned short);
+
+ISC_STATUS ISC_EXPORT isc_print_blr(const ISC_SCHAR*,
+									ISC_PRINT_CALLBACK,
+									void*,
+									short);
+
+void ISC_EXPORT isc_set_debug(int);
+
+void ISC_EXPORT isc_qtoq(const ISC_QUAD*,
+						 ISC_QUAD*);
+
+void ISC_EXPORT isc_vtof(const ISC_SCHAR*,
+						 ISC_SCHAR*,
+						 unsigned short);
+
+void ISC_EXPORT isc_vtov(const ISC_SCHAR*,
+						 ISC_SCHAR*,
+						 short);
+
+int ISC_EXPORT isc_version(isc_db_handle*,
+						   ISC_VERSION_CALLBACK,
+						   void*);
+
+ISC_LONG ISC_EXPORT isc_reset_fpe(ISC_USHORT);
+
+
+/*****************************************/
+/* Service manager functions             */
+/*****************************************/
+
+#define ADD_SPB_LENGTH(p, length)	{*(p)++ = (length); \
+    					 *(p)++ = (length) >> 8;}
+
+#define ADD_SPB_NUMERIC(p, data)	{*(p)++ = (ISC_SCHAR) (data); \
+    					 *(p)++ = (ISC_SCHAR) ((data) >> 8); \
+					 *(p)++ = (ISC_SCHAR) ((data) >> 16); \
+					 *(p)++ = (ISC_SCHAR) ((data) >> 24);}
+
+ISC_STATUS ISC_EXPORT isc_service_attach(ISC_STATUS*,
+										 unsigned short,
+										 const ISC_SCHAR*,
+										 isc_svc_handle*,
+										 unsigned short,
+										 const ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_service_detach(ISC_STATUS *,
+										 isc_svc_handle *);
+
+ISC_STATUS ISC_EXPORT isc_service_query(ISC_STATUS*,
+										isc_svc_handle*,
+										isc_resv_handle*,
+										unsigned short,
+										const ISC_SCHAR*,
+										unsigned short,
+										const ISC_SCHAR*,
+										unsigned short,
+										ISC_SCHAR*);
+
+ISC_STATUS ISC_EXPORT isc_service_start(ISC_STATUS*,
+										isc_svc_handle*,
+										isc_resv_handle*,
+										unsigned short,
+										const ISC_SCHAR*);
+
+
+/********************************/
+/* Client information functions */
+/********************************/
+
+void ISC_EXPORT isc_get_client_version ( ISC_SCHAR  *);
+int  ISC_EXPORT isc_get_client_major_version ();
+int  ISC_EXPORT isc_get_client_minor_version ();
+
+#ifdef __cplusplus
+}	/* extern "C" */
+#endif
+
+
+/***************************************************/
+/* Actions to pass to the blob filter (ctl_source) */
+/***************************************************/
+
+#define isc_blob_filter_open             0
+#define isc_blob_filter_get_segment      1
+#define isc_blob_filter_close            2
+#define isc_blob_filter_create           3
+#define isc_blob_filter_put_segment      4
+#define isc_blob_filter_alloc            5
+#define isc_blob_filter_free             6
+#define isc_blob_filter_seek             7
+
+/*******************/
+/* Blr definitions */
+/*******************/
+
+
+#ifndef JRD_BLR_H
+#define JRD_BLR_H
+
+#define blr_text                (unsigned char)14
+#define blr_text2               (unsigned char)15       
+#define blr_short               (unsigned char)7
+#define blr_long                (unsigned char)8
+#define blr_quad                (unsigned char)9
+#define blr_float               (unsigned char)10
+#define blr_double              (unsigned char)27
+#define blr_d_float             (unsigned char)11
+#define blr_timestamp           (unsigned char)35
+#define blr_varying             (unsigned char)37
+#define blr_varying2            (unsigned char)38       
+#define blr_blob                (unsigned short)261
+#define blr_cstring             (unsigned char)40       
+#define blr_cstring2            (unsigned char)41       
+#define blr_blob_id             (unsigned char)45       
+#define blr_sql_date            (unsigned char)12
+#define blr_sql_time            (unsigned char)13
+#define blr_int64               (unsigned char)16
+#define blr_blob2               (unsigned char)17
+
+#define blr_date                blr_timestamp
+
+#define blr_inner               (unsigned char)0
+#define blr_left                (unsigned char)1
+#define blr_right               (unsigned char)2
+#define blr_full                (unsigned char)3
+
+#define blr_gds_code            (unsigned char)0
+#define blr_sql_code            (unsigned char)1
+#define blr_exception           (unsigned char)2
+#define blr_trigger_code        (unsigned char)3
+#define blr_default_code        (unsigned char)4
+#define blr_raise                       (unsigned char)5
+#define blr_exception_msg       (unsigned char)6
+
+#define blr_version4            (unsigned char)4
+#define blr_version5            (unsigned char)5
+#define blr_eoc                 (unsigned char)76
+#define blr_end                 (unsigned char)255      
+
+#define blr_assignment          (unsigned char)1
+#define blr_begin               (unsigned char)2
+#define blr_dcl_variable        (unsigned char)3        
+#define blr_message             (unsigned char)4
+#define blr_erase               (unsigned char)5
+#define blr_fetch               (unsigned char)6
+#define blr_for                 (unsigned char)7
+#define blr_if                  (unsigned char)8
+#define blr_loop                (unsigned char)9
+#define blr_modify              (unsigned char)10
+#define blr_handler             (unsigned char)11
+#define blr_receive             (unsigned char)12
+#define blr_select              (unsigned char)13
+#define blr_send                (unsigned char)14
+#define blr_store               (unsigned char)15
+#define blr_label               (unsigned char)17
+#define blr_leave               (unsigned char)18
+#define blr_store2              (unsigned char)19
+#define blr_post                (unsigned char)20
+#define blr_literal             (unsigned char)21
+#define blr_dbkey               (unsigned char)22
+#define blr_field               (unsigned char)23
+#define blr_fid                 (unsigned char)24
+#define blr_parameter           (unsigned char)25
+#define blr_variable            (unsigned char)26
+#define blr_average             (unsigned char)27
+#define blr_count               (unsigned char)28
+#define blr_maximum             (unsigned char)29
+#define blr_minimum             (unsigned char)30
+#define blr_total               (unsigned char)31
+
+#define blr_add                 (unsigned char)34
+#define blr_subtract            (unsigned char)35
+#define blr_multiply            (unsigned char)36
+#define blr_divide              (unsigned char)37
+#define blr_negate              (unsigned char)38
+#define blr_concatenate         (unsigned char)39
+#define blr_substring           (unsigned char)40
+#define blr_parameter2          (unsigned char)41
+#define blr_from                (unsigned char)42
+#define blr_via                 (unsigned char)43
+#define blr_parameter2_old      (unsigned char)44       
+#define blr_user_name           (unsigned char)44       
+#define blr_null                (unsigned char)45
+
+#define blr_equiv                       (unsigned char)46
+#define blr_eql                 (unsigned char)47
+#define blr_neq                 (unsigned char)48
+#define blr_gtr                 (unsigned char)49
+#define blr_geq                 (unsigned char)50
+#define blr_lss                 (unsigned char)51
+#define blr_leq                 (unsigned char)52
+#define blr_containing          (unsigned char)53
+#define blr_matching            (unsigned char)54
+#define blr_starting            (unsigned char)55
+#define blr_between             (unsigned char)56
+#define blr_or                  (unsigned char)57
+#define blr_and                 (unsigned char)58
+#define blr_not                 (unsigned char)59
+#define blr_any                 (unsigned char)60
+#define blr_missing             (unsigned char)61
+#define blr_unique              (unsigned char)62
+#define blr_like                (unsigned char)63
+
+#define blr_rse                 (unsigned char)67
+#define blr_first               (unsigned char)68
+#define blr_project             (unsigned char)69
+#define blr_sort                (unsigned char)70
+#define blr_boolean             (unsigned char)71
+#define blr_ascending           (unsigned char)72
+#define blr_descending          (unsigned char)73
+#define blr_relation            (unsigned char)74
+#define blr_rid                 (unsigned char)75
+#define blr_union               (unsigned char)76
+#define blr_map                 (unsigned char)77
+#define blr_group_by            (unsigned char)78
+#define blr_aggregate           (unsigned char)79
+#define blr_join_type           (unsigned char)80
+
+#define blr_agg_count           (unsigned char)83
+#define blr_agg_max             (unsigned char)84
+#define blr_agg_min             (unsigned char)85
+#define blr_agg_total           (unsigned char)86
+#define blr_agg_average         (unsigned char)87
+#define blr_parameter3          (unsigned char)88       
+#define blr_run_max             (unsigned char)89
+#define blr_run_min             (unsigned char)90
+#define blr_run_total           (unsigned char)91
+#define blr_run_average         (unsigned char)92
+#define blr_agg_count2          (unsigned char)93
+#define blr_agg_count_distinct  (unsigned char)94
+#define blr_agg_total_distinct  (unsigned char)95
+#define blr_agg_average_distinct (unsigned char)96
+
+#define blr_function            (unsigned char)100
+#define blr_gen_id              (unsigned char)101
+#define blr_prot_mask           (unsigned char)102
+#define blr_upcase              (unsigned char)103
+#define blr_lock_state          (unsigned char)104
+#define blr_value_if            (unsigned char)105
+#define blr_matching2           (unsigned char)106
+#define blr_index               (unsigned char)107
+#define blr_ansi_like           (unsigned char)108
+
+#define blr_seek                (unsigned char)112
+
+#define blr_continue            (unsigned char)0
+#define blr_forward             (unsigned char)1
+#define blr_backward            (unsigned char)2
+#define blr_bof_forward         (unsigned char)3
+#define blr_eof_backward        (unsigned char)4
+
+#define blr_run_count           (unsigned char)118      
+#define blr_rs_stream           (unsigned char)119
+#define blr_exec_proc           (unsigned char)120
+
+#define blr_procedure           (unsigned char)124
+#define blr_pid                 (unsigned char)125
+#define blr_exec_pid            (unsigned char)126
+#define blr_singular            (unsigned char)127
+#define blr_abort               (unsigned char)128
+#define blr_block               (unsigned char)129
+#define blr_error_handler       (unsigned char)130
+
+#define blr_cast                (unsigned char)131
+
+#define blr_start_savepoint     (unsigned char)134
+#define blr_end_savepoint       (unsigned char)135
+
+#define blr_plan                (unsigned char)139      
+#define blr_merge               (unsigned char)140
+#define blr_join                (unsigned char)141
+#define blr_sequential          (unsigned char)142
+#define blr_navigational        (unsigned char)143
+#define blr_indices             (unsigned char)144
+#define blr_retrieve            (unsigned char)145
+
+#define blr_relation2           (unsigned char)146
+#define blr_rid2                (unsigned char)147
+
+#define blr_set_generator       (unsigned char)150
+
+#define blr_ansi_any            (unsigned char)151   
+#define blr_exists              (unsigned char)152   
+
+#define blr_record_version      (unsigned char)154      
+#define blr_stall               (unsigned char)155      
+
+#define blr_ansi_all            (unsigned char)158   
+
+#define blr_extract             (unsigned char)159
+
+#define blr_extract_year        (unsigned char)0
+#define blr_extract_month       (unsigned char)1
+#define blr_extract_day         (unsigned char)2
+#define blr_extract_hour        (unsigned char)3
+#define blr_extract_minute      (unsigned char)4
+#define blr_extract_second      (unsigned char)5
+#define blr_extract_weekday     (unsigned char)6
+#define blr_extract_yearday     (unsigned char)7
+
+#define blr_current_date        (unsigned char)160
+#define blr_current_timestamp   (unsigned char)161
+#define blr_current_time        (unsigned char)162
+
+#define blr_current_role        (unsigned char)174
+#define blr_skip                (unsigned char)175
+
+#define blr_exec_sql            (unsigned char)176
+#define blr_internal_info       (unsigned char)177
+#define blr_nullsfirst          (unsigned char)178
+#define blr_writelock           (unsigned char)179
+#define blr_nullslast       (unsigned char)180
+
+#define blr_lowcase                     (unsigned char)181
+#define blr_strlen                      (unsigned char)182
+
+#define blr_strlen_bit          (unsigned char)0
+#define blr_strlen_char         (unsigned char)1
+#define blr_strlen_octet        (unsigned char)2
+
+#define blr_trim                        (unsigned char)183
+
+#define blr_trim_both           (unsigned char)0
+#define blr_trim_leading        (unsigned char)1
+#define blr_trim_trailing       (unsigned char)2
+
+#define blr_trim_spaces         (unsigned char)0
+#define blr_trim_characters     (unsigned char)1
+
+#define blr_post_arg            (unsigned char)163
+#define blr_exec_into           (unsigned char)164
+#define blr_user_savepoint      (unsigned char)165
+#define blr_dcl_cursor          (unsigned char)166
+#define blr_cursor_stmt         (unsigned char)167
+#define blr_current_timestamp2  (unsigned char)168
+#define blr_current_time2       (unsigned char)169
+
+#define blr_savepoint_set       (unsigned char)0
+#define blr_savepoint_release   (unsigned char)1
+#define blr_savepoint_undo      (unsigned char)2
+#define blr_savepoint_release_single    (unsigned char)3
+
+#define blr_cursor_open                 (unsigned char)0
+#define blr_cursor_close                (unsigned char)1
+#define blr_cursor_fetch                (unsigned char)2
+
+#endif 
+
+
+/**********************************/
+/* Database parameter block stuff */
+/**********************************/
+
+#define isc_dpb_version1                  1
+#define isc_dpb_cdd_pathname              1
+#define isc_dpb_allocation                2
+#define isc_dpb_journal                   3
+#define isc_dpb_page_size                 4
+#define isc_dpb_num_buffers               5
+#define isc_dpb_buffer_length             6
+#define isc_dpb_debug                     7
+#define isc_dpb_garbage_collect           8
+#define isc_dpb_verify                    9
+#define isc_dpb_sweep                     10
+#define isc_dpb_enable_journal            11
+#define isc_dpb_disable_journal           12
+#define isc_dpb_dbkey_scope               13
+#define isc_dpb_number_of_users           14
+#define isc_dpb_trace                     15
+#define isc_dpb_no_garbage_collect        16
+#define isc_dpb_damaged                   17
+#define isc_dpb_license                   18
+#define isc_dpb_sys_user_name             19
+#define isc_dpb_encrypt_key               20
+#define isc_dpb_activate_shadow           21
+#define isc_dpb_sweep_interval            22
+#define isc_dpb_delete_shadow             23
+#define isc_dpb_force_write               24
+#define isc_dpb_begin_log                 25
+#define isc_dpb_quit_log                  26
+#define isc_dpb_no_reserve                27
+#define isc_dpb_user_name                 28
+#define isc_dpb_password                  29
+#define isc_dpb_password_enc              30
+#define isc_dpb_sys_user_name_enc         31
+#define isc_dpb_interp                    32
+#define isc_dpb_online_dump               33
+#define isc_dpb_old_file_size             34
+#define isc_dpb_old_num_files             35
+#define isc_dpb_old_file                  36
+#define isc_dpb_old_start_page            37
+#define isc_dpb_old_start_seqno           38
+#define isc_dpb_old_start_file            39
+#define isc_dpb_drop_walfile              40
+#define isc_dpb_old_dump_id               41
+#define isc_dpb_wal_backup_dir            42
+#define isc_dpb_wal_chkptlen              43
+#define isc_dpb_wal_numbufs               44
+#define isc_dpb_wal_bufsize               45
+#define isc_dpb_wal_grp_cmt_wait          46
+#define isc_dpb_lc_messages               47
+#define isc_dpb_lc_ctype                  48
+#define isc_dpb_cache_manager             49
+#define isc_dpb_shutdown                  50
+#define isc_dpb_online                    51
+#define isc_dpb_shutdown_delay            52
+#define isc_dpb_reserved                  53
+#define isc_dpb_overwrite                 54
+#define isc_dpb_sec_attach                55
+#define isc_dpb_disable_wal               56
+#define isc_dpb_connect_timeout           57
+#define isc_dpb_dummy_packet_interval     58
+#define isc_dpb_gbak_attach               59
+#define isc_dpb_sql_role_name             60
+#define isc_dpb_set_page_buffers          61
+#define isc_dpb_working_directory         62
+#define isc_dpb_sql_dialect               63
+#define isc_dpb_set_db_readonly           64
+#define isc_dpb_set_db_sql_dialect        65
+#define isc_dpb_gfix_attach               66
+#define isc_dpb_gstat_attach              67
+#define isc_dpb_set_db_charset            68
+#define isc_dpb_gsec_attach               69
+#define isc_dpb_address_path              70
+
+/**************************************************/
+/* clumplet tags used inside isc_dpb_address_path */
+/*						 and isc_spb_address_path */
+/**************************************************/
+
+/* Format of this clumplet is the following:
+
+ <address-path-clumplet> ::=
+	isc_dpb_address_path <byte-clumplet-length> <address-stack>
+
+ <address-stack> ::=
+	<address-descriptor> |
+	<address-stack> <address-descriptor>
+
+ <address-descriptor> ::=
+	isc_dpb_address <byte-clumplet-length> <address-elements>
+
+ <address-elements> ::=
+	<address-element> |
+	<address-elements> <address-element>
+
+ <address-element> ::=
+	isc_dpb_addr_protocol <byte-clumplet-length> <protocol-string> |
+	isc_dpb_addr_endpoint <byte-clumplet-length> <remote-endpoint-string>
+
+ <protocol-string> ::=
+	"TCPv4" |
+	"TCPv6" |
+	"XNET" |
+	"WNET" |
+	....
+
+ <remote-endpoint-string> ::=
+	<IPv4-address> | // such as "172.20.1.1"
+	<IPv6-address> | // such as "2001:0:13FF:09FF::1"
+	<xnet-process-id> | // such as "17864"
+	...
+*/
+
+#define isc_dpb_address 1
+
+#define isc_dpb_addr_protocol 1
+#define isc_dpb_addr_endpoint 2
+
+/*********************************/
+/* isc_dpb_verify specific flags */
+/*********************************/
+
+#define isc_dpb_pages                     1
+#define isc_dpb_records                   2
+#define isc_dpb_indices                   4
+#define isc_dpb_transactions              8
+#define isc_dpb_no_update                 16
+#define isc_dpb_repair                    32
+#define isc_dpb_ignore                    64
+
+/***********************************/
+/* isc_dpb_shutdown specific flags */
+/***********************************/
+
+#define isc_dpb_shut_cache               0x1
+#define isc_dpb_shut_attachment          0x2
+#define isc_dpb_shut_transaction         0x4
+#define isc_dpb_shut_force               0x8
+#define isc_dpb_shut_mode_mask          0x70
+
+#define isc_dpb_shut_default             0x0
+#define isc_dpb_shut_normal             0x10
+#define isc_dpb_shut_multi              0x20
+#define isc_dpb_shut_single             0x30
+#define isc_dpb_shut_full               0x40
+
+/**************************************/
+/* Bit assignments in RDB$SYSTEM_FLAG */
+/**************************************/
+
+#define RDB_system                         1
+#define RDB_id_assigned                    2
+/* 2 is for QLI. See jrd/constants.h for more Firebird-specific values. */
+
+
+/*************************************/
+/* Transaction parameter block stuff */
+/*************************************/
+
+#define isc_tpb_version1                  1
+#define isc_tpb_version3                  3
+#define isc_tpb_consistency               1
+#define isc_tpb_concurrency               2
+#define isc_tpb_shared                    3
+#define isc_tpb_protected                 4
+#define isc_tpb_exclusive                 5
+#define isc_tpb_wait                      6
+#define isc_tpb_nowait                    7
+#define isc_tpb_read                      8
+#define isc_tpb_write                     9
+#define isc_tpb_lock_read                 10
+#define isc_tpb_lock_write                11
+#define isc_tpb_verb_time                 12
+#define isc_tpb_commit_time               13
+#define isc_tpb_ignore_limbo              14
+#define isc_tpb_read_committed	          15
+#define isc_tpb_autocommit                16
+#define isc_tpb_rec_version               17
+#define isc_tpb_no_rec_version            18
+#define isc_tpb_restart_requests          19
+#define isc_tpb_no_auto_undo              20
+#define isc_tpb_lock_timeout              21
+
+
+/************************/
+/* Blob Parameter Block */
+/************************/
+
+#define isc_bpb_version1                  1
+#define isc_bpb_source_type               1
+#define isc_bpb_target_type               2
+#define isc_bpb_type                      3
+#define isc_bpb_source_interp             4
+#define isc_bpb_target_interp             5
+#define isc_bpb_filter_parameter          6
+
+#define isc_bpb_type_segmented            0
+#define isc_bpb_type_stream               1
+
+
+/*********************************/
+/* Service parameter block stuff */
+/*********************************/
+
+#define isc_spb_version1                  1
+#define isc_spb_current_version           2
+#define isc_spb_version			  isc_spb_current_version
+#define isc_spb_user_name                 isc_dpb_user_name
+#define isc_spb_sys_user_name             isc_dpb_sys_user_name
+#define isc_spb_sys_user_name_enc         isc_dpb_sys_user_name_enc
+#define isc_spb_password                  isc_dpb_password
+#define isc_spb_password_enc              isc_dpb_password_enc
+#define isc_spb_command_line              105
+#define isc_spb_dbname                    106
+#define isc_spb_verbose                   107
+#define isc_spb_options                   108
+#define isc_spb_address_path              109
+
+
+#define isc_spb_connect_timeout           isc_dpb_connect_timeout
+#define isc_spb_dummy_packet_interval     isc_dpb_dummy_packet_interval
+#define isc_spb_sql_role_name             isc_dpb_sql_role_name
+
+
+/*********************************/
+/* Information call declarations */
+/*********************************/
+
+
+#ifndef JRD_INF_PUB_H
+#define JRD_INF_PUB_H
+
+#define isc_info_end                    1
+#define isc_info_truncated              2
+#define isc_info_error                  3
+#define isc_info_data_not_ready           4
+#define isc_info_flag_end                 127
+
+enum db_info_types
+{
+        isc_info_db_id                  = 4,
+        isc_info_reads                  = 5,
+        isc_info_writes             = 6,
+        isc_info_fetches                = 7,
+        isc_info_marks                  = 8,
+
+        isc_info_implementation = 11,
+        isc_info_isc_version            = 12,
+        isc_info_base_level             = 13,
+        isc_info_page_size              = 14,
+        isc_info_num_buffers    = 15,
+        isc_info_limbo                  = 16,
+        isc_info_current_memory = 17,
+        isc_info_max_memory             = 18,
+        isc_info_window_turns   = 19,
+        isc_info_license                = 20,
+
+        isc_info_allocation             = 21,
+        isc_info_attachment_id   = 22,
+        isc_info_read_seq_count = 23,
+        isc_info_read_idx_count = 24,
+        isc_info_insert_count           = 25,
+        isc_info_update_count           = 26,
+        isc_info_delete_count           = 27,
+        isc_info_backout_count          = 28,
+        isc_info_purge_count            = 29,
+        isc_info_expunge_count          = 30,
+
+        isc_info_sweep_interval = 31,
+        isc_info_ods_version            = 32,
+        isc_info_ods_minor_version      = 33,
+        isc_info_no_reserve             = 34,
+
+        isc_info_logfile                = 35,
+        isc_info_cur_logfile_name       = 36,
+        isc_info_cur_log_part_offset    = 37,
+        isc_info_num_wal_buffers        = 38,
+        isc_info_wal_buffer_size        = 39,
+        isc_info_wal_ckpt_length        = 40,
+
+        isc_info_wal_cur_ckpt_interval = 41,
+        isc_info_wal_prv_ckpt_fname     = 42,
+        isc_info_wal_prv_ckpt_poffset   = 43,
+        isc_info_wal_recv_ckpt_fname    = 44,
+        isc_info_wal_recv_ckpt_poffset = 45,
+        isc_info_wal_grpc_wait_usecs    = 47,
+        isc_info_wal_num_io             = 48,
+        isc_info_wal_avg_io_size        = 49,
+        isc_info_wal_num_commits        = 50,
+        isc_info_wal_avg_grpc_size      = 51,
+
+        isc_info_forced_writes          = 52,
+        isc_info_user_names = 53,
+        isc_info_page_errors = 54,
+        isc_info_record_errors = 55,
+        isc_info_bpage_errors = 56,
+        isc_info_dpage_errors = 57,
+        isc_info_ipage_errors = 58,
+        isc_info_ppage_errors = 59,
+        isc_info_tpage_errors = 60,
+
+        isc_info_set_page_buffers = 61,
+        isc_info_db_sql_dialect = 62,   
+        isc_info_db_read_only = 63,
+        isc_info_db_size_in_pages = 64,
+
+        frb_info_att_charset = 101,
+        isc_info_db_class = 102,
+        isc_info_firebird_version = 103,
+        isc_info_oldest_transaction = 104,
+        isc_info_oldest_active = 105,
+        isc_info_oldest_snapshot = 106,
+        isc_info_next_transaction = 107,
+        isc_info_db_provider = 108,
+        isc_info_active_transactions = 109,
+        isc_info_active_tran_count = 110,
+        isc_info_creation_date = 111,
+
+        isc_info_db_last_value   
+};
+
+#define isc_info_version isc_info_isc_version
+
+enum  info_db_implementations
+{
+        isc_info_db_impl_rdb_vms = 1,
+        isc_info_db_impl_rdb_eln = 2,
+        isc_info_db_impl_rdb_eln_dev = 3,
+        isc_info_db_impl_rdb_vms_y = 4,
+        isc_info_db_impl_rdb_eln_y = 5,
+        isc_info_db_impl_jri = 6,
+        isc_info_db_impl_jsv = 7,
+
+        isc_info_db_impl_isc_apl_68K = 25,
+        isc_info_db_impl_isc_vax_ultr = 26,
+        isc_info_db_impl_isc_vms = 27,
+        isc_info_db_impl_isc_sun_68k = 28,
+        isc_info_db_impl_isc_os2 = 29,
+        isc_info_db_impl_isc_sun4 = 30,    
+
+        isc_info_db_impl_isc_hp_ux = 31,
+        isc_info_db_impl_isc_sun_386i = 32,
+        isc_info_db_impl_isc_vms_orcl = 33,
+        isc_info_db_impl_isc_mac_aux = 34,
+        isc_info_db_impl_isc_rt_aix = 35,
+        isc_info_db_impl_isc_mips_ult = 36,
+        isc_info_db_impl_isc_xenix = 37,
+        isc_info_db_impl_isc_dg = 38,
+        isc_info_db_impl_isc_hp_mpexl = 39,
+        isc_info_db_impl_isc_hp_ux68K = 40,       
+
+        isc_info_db_impl_isc_sgi = 41,
+        isc_info_db_impl_isc_sco_unix = 42,
+        isc_info_db_impl_isc_cray = 43,
+        isc_info_db_impl_isc_imp = 44,
+        isc_info_db_impl_isc_delta = 45,
+        isc_info_db_impl_isc_next = 46,
+        isc_info_db_impl_isc_dos = 47,
+        isc_info_db_impl_m88K = 48,
+        isc_info_db_impl_unixware = 49,
+        isc_info_db_impl_isc_winnt_x86 = 50,
+
+        isc_info_db_impl_isc_epson = 51,
+        isc_info_db_impl_alpha_osf = 52,
+        isc_info_db_impl_alpha_vms = 53,
+        isc_info_db_impl_netware_386 = 54, 
+        isc_info_db_impl_win_only = 55,
+        isc_info_db_impl_ncr_3000 = 56,
+        isc_info_db_impl_winnt_ppc = 57,
+        isc_info_db_impl_dg_x86 = 58,
+        isc_info_db_impl_sco_ev = 59,
+        isc_info_db_impl_i386 = 60,
+
+        isc_info_db_impl_freebsd = 61,
+        isc_info_db_impl_netbsd = 62,
+        isc_info_db_impl_darwin = 63,
+        isc_info_db_impl_sinixz = 64,
+
+        isc_info_db_impl_linux_sparc = 65,
+        isc_info_db_impl_linux_amd64 = 66,
+
+        isc_info_db_impl_freebsd_amd64 = 67,
+
+        isc_info_db_impl_last_value   
+};
+
+#define isc_info_db_impl_isc_a            isc_info_db_impl_isc_apl_68K
+#define isc_info_db_impl_isc_u            isc_info_db_impl_isc_vax_ultr
+#define isc_info_db_impl_isc_v            isc_info_db_impl_isc_vms
+#define isc_info_db_impl_isc_s            isc_info_db_impl_isc_sun_68k
+
+enum info_db_class
+{
+        isc_info_db_class_access = 1,
+        isc_info_db_class_y_valve = 2,
+        isc_info_db_class_rem_int = 3,
+        isc_info_db_class_rem_srvr = 4,
+        isc_info_db_class_pipe_int = 7,
+        isc_info_db_class_pipe_srvr = 8,
+        isc_info_db_class_sam_int = 9,
+        isc_info_db_class_sam_srvr = 10,
+        isc_info_db_class_gateway = 11,
+        isc_info_db_class_cache = 12,
+        isc_info_db_class_classic_access = 13,
+        isc_info_db_class_server_access = 14,
+
+        isc_info_db_class_last_value   
+};
+
+enum info_db_provider
+{
+        isc_info_db_code_rdb_eln = 1,
+        isc_info_db_code_rdb_vms = 2,
+        isc_info_db_code_interbase = 3,
+        isc_info_db_code_firebird = 4,
+
+        isc_info_db_code_last_value   
+};
+
+#define isc_info_number_messages        4
+#define isc_info_max_message            5
+#define isc_info_max_send               6
+#define isc_info_max_receive            7
+#define isc_info_state                  8
+#define isc_info_message_number 9
+#define isc_info_message_size           10
+#define isc_info_request_cost           11
+#define isc_info_access_path            12
+#define isc_info_req_select_count       13
+#define isc_info_req_insert_count       14
+#define isc_info_req_update_count       15
+#define isc_info_req_delete_count       16
+
+#define isc_info_rsb_end                0
+#define isc_info_rsb_begin              1
+#define isc_info_rsb_type               2
+#define isc_info_rsb_relation           3
+#define isc_info_rsb_plan                       4
+
+#define isc_info_rsb_unknown            1
+#define isc_info_rsb_indexed            2
+#define isc_info_rsb_navigate           3
+#define isc_info_rsb_sequential 4
+#define isc_info_rsb_cross              5
+#define isc_info_rsb_sort               6
+#define isc_info_rsb_first              7
+#define isc_info_rsb_boolean            8
+#define isc_info_rsb_union              9
+#define isc_info_rsb_aggregate          10
+#define isc_info_rsb_merge              11
+#define isc_info_rsb_ext_sequential     12
+#define isc_info_rsb_ext_indexed        13
+#define isc_info_rsb_ext_dbkey          14
+#define isc_info_rsb_left_cross 15
+#define isc_info_rsb_select             16
+#define isc_info_rsb_sql_join           17
+#define isc_info_rsb_simulate           18
+#define isc_info_rsb_sim_cross          19
+#define isc_info_rsb_once               20
+#define isc_info_rsb_procedure          21
+#define isc_info_rsb_skip               22
+
+#define isc_info_rsb_and                1
+#define isc_info_rsb_or         2
+#define isc_info_rsb_dbkey              3
+#define isc_info_rsb_index              4
+
+#define isc_info_req_active             2
+#define isc_info_req_inactive           3
+#define isc_info_req_send               4
+#define isc_info_req_receive            5
+#define isc_info_req_select             6
+#define isc_info_req_sql_stall          7
+
+#define isc_info_blob_num_segments      4
+#define isc_info_blob_max_segment       5
+#define isc_info_blob_total_length      6
+#define isc_info_blob_type              7
+
+#define isc_info_tra_id                                         4
+#define isc_info_tra_oldest_interesting         5
+#define isc_info_tra_oldest_snapshot            6
+#define isc_info_tra_oldest_active                      7
+#define isc_info_tra_isolation                          8
+#define isc_info_tra_access                                     9
+#define isc_info_tra_lock_timeout                       10
+
+#define isc_info_tra_consistency                1
+#define isc_info_tra_concurrency                2
+#define isc_info_tra_read_committed             3
+
+#define isc_info_tra_no_rec_version             0
+#define isc_info_tra_rec_version                1
+
+#define isc_info_tra_readonly   0
+#define isc_info_tra_readwrite  1
+
+#define isc_info_sql_select             4
+#define isc_info_sql_bind               5
+#define isc_info_sql_num_variables      6
+#define isc_info_sql_describe_vars      7
+#define isc_info_sql_describe_end       8
+#define isc_info_sql_sqlda_seq          9
+#define isc_info_sql_message_seq        10
+#define isc_info_sql_type               11
+#define isc_info_sql_sub_type           12
+#define isc_info_sql_scale              13
+#define isc_info_sql_length             14
+#define isc_info_sql_null_ind           15
+#define isc_info_sql_field              16
+#define isc_info_sql_relation           17
+#define isc_info_sql_owner              18
+#define isc_info_sql_alias              19
+#define isc_info_sql_sqlda_start        20
+#define isc_info_sql_stmt_type          21
+#define isc_info_sql_get_plan             22
+#define isc_info_sql_records              23
+#define isc_info_sql_batch_fetch          24
+#define isc_info_sql_relation_alias             25
+
+#define isc_info_sql_stmt_select          1
+#define isc_info_sql_stmt_insert          2
+#define isc_info_sql_stmt_update          3
+#define isc_info_sql_stmt_delete          4
+#define isc_info_sql_stmt_ddl             5
+#define isc_info_sql_stmt_get_segment     6
+#define isc_info_sql_stmt_put_segment     7
+#define isc_info_sql_stmt_exec_procedure  8
+#define isc_info_sql_stmt_start_trans     9
+#define isc_info_sql_stmt_commit          10
+#define isc_info_sql_stmt_rollback        11
+#define isc_info_sql_stmt_select_for_upd  12
+#define isc_info_sql_stmt_set_generator   13
+#define isc_info_sql_stmt_savepoint       14
+
+#endif 
+
+
+/*****************************
+ * Service action items      *
+ *****************************/
+
+#define isc_action_svc_backup          1	/* Starts database backup process on the server */
+#define isc_action_svc_restore         2	/* Starts database restore process on the server */
+#define isc_action_svc_repair          3	/* Starts database repair process on the server */
+#define isc_action_svc_add_user        4	/* Adds a new user to the security database */
+#define isc_action_svc_delete_user     5	/* Deletes a user record from the security database */
+#define isc_action_svc_modify_user     6	/* Modifies a user record in the security database */
+#define isc_action_svc_display_user    7	/* Displays a user record from the security database */
+#define isc_action_svc_properties      8	/* Sets database properties */
+#define isc_action_svc_add_license     9	/* Adds a license to the license file */
+#define isc_action_svc_remove_license 10	/* Removes a license from the license file */
+#define isc_action_svc_db_stats	      11	/* Retrieves database statistics */
+#define isc_action_svc_get_ib_log     12	/* Retrieves the InterBase log file from the server */
+#define isc_action_svc_get_fb_log     12	/* Retrieves the Firebird log file from the server */
+
+/*****************************
+ * Service information items *
+ *****************************/
+
+#define isc_info_svc_svr_db_info      50	/* Retrieves the number of attachments and databases */
+#define isc_info_svc_get_license      51	/* Retrieves all license keys and IDs from the license file */
+#define isc_info_svc_get_license_mask 52	/* Retrieves a bitmask representing licensed options on the server */
+#define isc_info_svc_get_config       53	/* Retrieves the parameters and values for IB_CONFIG */
+#define isc_info_svc_version          54	/* Retrieves the version of the services manager */
+#define isc_info_svc_server_version   55	/* Retrieves the version of the InterBase server */
+#define isc_info_svc_implementation   56	/* Retrieves the implementation of the InterBase server */
+#define isc_info_svc_capabilities     57	/* Retrieves a bitmask representing the server's capabilities */
+#define isc_info_svc_user_dbpath      58	/* Retrieves the path to the security database in use by the server */
+#define isc_info_svc_get_env	      59	/* Retrieves the setting of $INTERBASE */
+#define isc_info_svc_get_env_lock     60	/* Retrieves the setting of $INTERBASE_LCK */
+#define isc_info_svc_get_env_msg      61	/* Retrieves the setting of $INTERBASE_MSG */
+#define isc_info_svc_line             62	/* Retrieves 1 line of service output per call */
+#define isc_info_svc_to_eof           63	/* Retrieves as much of the server output as will fit in the supplied buffer */
+#define isc_info_svc_timeout          64	/* Sets / signifies a timeout value for reading service information */
+#define isc_info_svc_get_licensed_users 65	/* Retrieves the number of users licensed for accessing the server */
+#define isc_info_svc_limbo_trans	66	/* Retrieve the limbo transactions */
+#define isc_info_svc_running		67	/* Checks to see if a service is running on an attachment */
+#define isc_info_svc_get_users		68	/* Returns the user information from isc_action_svc_display_users */
+
+/******************************************************
+ * Parameters for isc_action_{add|del|mod|disp)_user  *
+ ******************************************************/
+
+#define isc_spb_sec_userid            5
+#define isc_spb_sec_groupid           6
+#define isc_spb_sec_username          7
+#define isc_spb_sec_password          8
+#define isc_spb_sec_groupname         9
+#define isc_spb_sec_firstname         10
+#define isc_spb_sec_middlename        11
+#define isc_spb_sec_lastname          12
+
+/*******************************************************
+ * Parameters for isc_action_svc_(add|remove)_license, *
+ * isc_info_svc_get_license                            *
+ *******************************************************/
+
+#define isc_spb_lic_key               5
+#define isc_spb_lic_id                6
+#define isc_spb_lic_desc              7
+
+
+/*****************************************
+ * Parameters for isc_action_svc_backup  *
+ *****************************************/
+
+#define isc_spb_bkp_file                 5
+#define isc_spb_bkp_factor               6
+#define isc_spb_bkp_length               7
+#define isc_spb_bkp_ignore_checksums     0x01
+#define isc_spb_bkp_ignore_limbo         0x02
+#define isc_spb_bkp_metadata_only        0x04
+#define isc_spb_bkp_no_garbage_collect   0x08
+#define isc_spb_bkp_old_descriptions     0x10
+#define isc_spb_bkp_non_transportable    0x20
+#define isc_spb_bkp_convert              0x40
+#define isc_spb_bkp_expand		 0x80
+
+/********************************************
+ * Parameters for isc_action_svc_properties *
+ ********************************************/
+
+#define isc_spb_prp_page_buffers		5
+#define isc_spb_prp_sweep_interval		6
+#define isc_spb_prp_shutdown_db			7
+#define isc_spb_prp_deny_new_attachments	9
+#define isc_spb_prp_deny_new_transactions	10
+#define isc_spb_prp_reserve_space		11
+#define isc_spb_prp_write_mode			12
+#define isc_spb_prp_access_mode			13
+#define isc_spb_prp_set_sql_dialect		14
+#define isc_spb_prp_activate			0x0100
+#define isc_spb_prp_db_online			0x0200
+
+/********************************************
+ * Parameters for isc_spb_prp_reserve_space *
+ ********************************************/
+
+#define isc_spb_prp_res_use_full	35
+#define isc_spb_prp_res			36
+
+/******************************************
+ * Parameters for isc_spb_prp_write_mode  *
+ ******************************************/
+
+#define isc_spb_prp_wm_async		37
+#define isc_spb_prp_wm_sync			38
+
+/******************************************
+ * Parameters for isc_spb_prp_access_mode *
+ ******************************************/
+
+#define isc_spb_prp_am_readonly		39
+#define isc_spb_prp_am_readwrite	40
+
+/*****************************************
+ * Parameters for isc_action_svc_repair  *
+ *****************************************/
+
+#define isc_spb_rpr_commit_trans		15
+#define isc_spb_rpr_rollback_trans		34
+#define isc_spb_rpr_recover_two_phase	17
+#define isc_spb_tra_id					18
+#define isc_spb_single_tra_id			19
+#define isc_spb_multi_tra_id			20
+#define isc_spb_tra_state				21
+#define isc_spb_tra_state_limbo			22
+#define isc_spb_tra_state_commit		23
+#define isc_spb_tra_state_rollback		24
+#define isc_spb_tra_state_unknown		25
+#define isc_spb_tra_host_site			26
+#define isc_spb_tra_remote_site			27
+#define isc_spb_tra_db_path				28
+#define isc_spb_tra_advise				29
+#define isc_spb_tra_advise_commit		30
+#define isc_spb_tra_advise_rollback		31
+#define isc_spb_tra_advise_unknown		33
+
+#define isc_spb_rpr_validate_db			0x01
+#define isc_spb_rpr_sweep_db			0x02
+#define isc_spb_rpr_mend_db				0x04
+#define isc_spb_rpr_list_limbo_trans	0x08
+#define isc_spb_rpr_check_db			0x10
+#define isc_spb_rpr_ignore_checksum		0x20
+#define isc_spb_rpr_kill_shadows		0x40
+#define isc_spb_rpr_full				0x80
+
+/*****************************************
+ * Parameters for isc_action_svc_restore *
+ *****************************************/
+
+#define isc_spb_res_buffers				9
+#define isc_spb_res_page_size			10
+#define isc_spb_res_length				11
+#define isc_spb_res_access_mode			12
+#define isc_spb_res_deactivate_idx		0x0100
+#define isc_spb_res_no_shadow			0x0200
+#define isc_spb_res_no_validity			0x0400
+#define isc_spb_res_one_at_a_time		0x0800
+#define isc_spb_res_replace				0x1000
+#define isc_spb_res_create				0x2000
+#define isc_spb_res_use_all_space		0x4000
+
+/******************************************
+ * Parameters for isc_spb_res_access_mode  *
+ ******************************************/
+
+#define isc_spb_res_am_readonly			isc_spb_prp_am_readonly
+#define isc_spb_res_am_readwrite		isc_spb_prp_am_readwrite
+
+/*******************************************
+ * Parameters for isc_info_svc_svr_db_info *
+ *******************************************/
+
+#define isc_spb_num_att			5
+#define isc_spb_num_db			6
+
+/*****************************************
+ * Parameters for isc_info_svc_db_stats  *
+ *****************************************/
+
+#define isc_spb_sts_data_pages		0x01
+#define isc_spb_sts_db_log			0x02
+#define isc_spb_sts_hdr_pages		0x04
+#define isc_spb_sts_idx_pages		0x08
+#define isc_spb_sts_sys_relations	0x10
+#define isc_spb_sts_record_versions	0x20
+#define isc_spb_sts_table			0x40
+#define isc_spb_sts_nocreation		0x80
+
+/***********************************/
+/* Server configuration key values */
+/***********************************/
+
+/* Not available in Firebird 1.5 */
+
+
+/**********************************************/
+/* Dynamic Data Definition Language operators */
+/**********************************************/
+
+/******************/
+/* Version number */
+/******************/
+
+#define isc_dyn_version_1                 1
+#define isc_dyn_eoc                       255
+
+/******************************/
+/* Operations (may be nested) */
+/******************************/
+
+#define isc_dyn_begin                     2
+#define isc_dyn_end                       3
+#define isc_dyn_if                        4
+#define isc_dyn_def_database              5
+#define isc_dyn_def_global_fld            6
+#define isc_dyn_def_local_fld             7
+#define isc_dyn_def_idx                   8
+#define isc_dyn_def_rel                   9
+#define isc_dyn_def_sql_fld               10
+#define isc_dyn_def_view                  12
+#define isc_dyn_def_trigger               15
+#define isc_dyn_def_security_class        120
+#define isc_dyn_def_dimension             140
+#define isc_dyn_def_generator             24
+#define isc_dyn_def_function              25
+#define isc_dyn_def_filter                26
+#define isc_dyn_def_function_arg          27
+#define isc_dyn_def_shadow                34
+#define isc_dyn_def_trigger_msg           17
+#define isc_dyn_def_file                  36
+#define isc_dyn_mod_database              39
+#define isc_dyn_mod_rel                   11
+#define isc_dyn_mod_global_fld            13
+#define isc_dyn_mod_idx                   102
+#define isc_dyn_mod_local_fld             14
+#define isc_dyn_mod_sql_fld		  216
+#define isc_dyn_mod_view                  16
+#define isc_dyn_mod_security_class        122
+#define isc_dyn_mod_trigger               113
+#define isc_dyn_mod_trigger_msg           28
+#define isc_dyn_delete_database           18
+#define isc_dyn_delete_rel                19
+#define isc_dyn_delete_global_fld         20
+#define isc_dyn_delete_local_fld          21
+#define isc_dyn_delete_idx                22
+#define isc_dyn_delete_security_class     123
+#define isc_dyn_delete_dimensions         143
+#define isc_dyn_delete_trigger            23
+#define isc_dyn_delete_trigger_msg        29
+#define isc_dyn_delete_filter             32
+#define isc_dyn_delete_function           33
+#define isc_dyn_delete_shadow             35
+#define isc_dyn_grant                     30
+#define isc_dyn_revoke                    31
+#define isc_dyn_def_primary_key           37
+#define isc_dyn_def_foreign_key           38
+#define isc_dyn_def_unique                40
+#define isc_dyn_def_procedure             164
+#define isc_dyn_delete_procedure          165
+#define isc_dyn_def_parameter             135
+#define isc_dyn_delete_parameter          136
+#define isc_dyn_mod_procedure             175
+/* Deprecated.
+#define isc_dyn_def_log_file              176
+#define isc_dyn_def_cache_file            180
+*/
+#define isc_dyn_def_exception             181
+#define isc_dyn_mod_exception             182
+#define isc_dyn_del_exception             183
+/* Deprecated.
+#define isc_dyn_drop_log                  194
+#define isc_dyn_drop_cache                195
+#define isc_dyn_def_default_log           202
+*/
+#define isc_dyn_def_difference            220
+#define isc_dyn_drop_difference           221
+#define isc_dyn_begin_backup              222
+#define isc_dyn_end_backup                223
+
+/***********************/
+/* View specific stuff */
+/***********************/
+
+#define isc_dyn_view_blr                  43
+#define isc_dyn_view_source               44
+#define isc_dyn_view_relation             45
+#define isc_dyn_view_context              46
+#define isc_dyn_view_context_name         47
+
+/**********************/
+/* Generic attributes */
+/**********************/
+
+#define isc_dyn_rel_name                  50
+#define isc_dyn_fld_name                  51
+#define isc_dyn_new_fld_name		  215
+#define isc_dyn_idx_name                  52
+#define isc_dyn_description               53
+#define isc_dyn_security_class            54
+#define isc_dyn_system_flag               55
+#define isc_dyn_update_flag               56
+#define isc_dyn_prc_name                  166
+#define isc_dyn_prm_name                  137
+#define isc_dyn_sql_object                196
+#define isc_dyn_fld_character_set_name    174
+
+/********************************/
+/* Relation specific attributes */
+/********************************/
+
+#define isc_dyn_rel_dbkey_length          61
+#define isc_dyn_rel_store_trig            62
+#define isc_dyn_rel_modify_trig           63
+#define isc_dyn_rel_erase_trig            64
+#define isc_dyn_rel_store_trig_source     65
+#define isc_dyn_rel_modify_trig_source    66
+#define isc_dyn_rel_erase_trig_source     67
+#define isc_dyn_rel_ext_file              68
+#define isc_dyn_rel_sql_protection        69
+#define isc_dyn_rel_constraint            162
+#define isc_dyn_delete_rel_constraint     163
+
+/************************************/
+/* Global field specific attributes */
+/************************************/
+
+#define isc_dyn_fld_type                  70
+#define isc_dyn_fld_length                71
+#define isc_dyn_fld_scale                 72
+#define isc_dyn_fld_sub_type              73
+#define isc_dyn_fld_segment_length        74
+#define isc_dyn_fld_query_header          75
+#define isc_dyn_fld_edit_string           76
+#define isc_dyn_fld_validation_blr        77
+#define isc_dyn_fld_validation_source     78
+#define isc_dyn_fld_computed_blr          79
+#define isc_dyn_fld_computed_source       80
+#define isc_dyn_fld_missing_value         81
+#define isc_dyn_fld_default_value         82
+#define isc_dyn_fld_query_name            83
+#define isc_dyn_fld_dimensions            84
+#define isc_dyn_fld_not_null              85
+#define isc_dyn_fld_precision             86
+#define isc_dyn_fld_char_length           172
+#define isc_dyn_fld_collation             173
+#define isc_dyn_fld_default_source        193
+#define isc_dyn_del_default               197
+#define isc_dyn_del_validation            198
+#define isc_dyn_single_validation         199
+#define isc_dyn_fld_character_set         203
+
+/***********************************/
+/* Local field specific attributes */
+/***********************************/
+
+#define isc_dyn_fld_source                90
+#define isc_dyn_fld_base_fld              91
+#define isc_dyn_fld_position              92
+#define isc_dyn_fld_update_flag           93
+
+/*****************************/
+/* Index specific attributes */
+/*****************************/
+
+#define isc_dyn_idx_unique                100
+#define isc_dyn_idx_inactive              101
+#define isc_dyn_idx_type                  103
+#define isc_dyn_idx_foreign_key           104
+#define isc_dyn_idx_ref_column            105
+#define isc_dyn_idx_statistic		  204
+
+/*******************************/
+/* Trigger specific attributes */
+/*******************************/
+
+#define isc_dyn_trg_type                  110
+#define isc_dyn_trg_blr                   111
+#define isc_dyn_trg_source                112
+#define isc_dyn_trg_name                  114
+#define isc_dyn_trg_sequence              115
+#define isc_dyn_trg_inactive              116
+#define isc_dyn_trg_msg_number            117
+#define isc_dyn_trg_msg                   118
+
+/**************************************/
+/* Security Class specific attributes */
+/**************************************/
+
+#define isc_dyn_scl_acl                   121
+#define isc_dyn_grant_user                130
+#define isc_dyn_grant_user_explicit       219
+#define isc_dyn_grant_proc                186
+#define isc_dyn_grant_trig                187
+#define isc_dyn_grant_view                188
+#define isc_dyn_grant_options             132
+#define isc_dyn_grant_user_group          205
+#define isc_dyn_grant_role                218
+
+
+/**********************************/
+/* Dimension specific information */
+/**********************************/
+
+#define isc_dyn_dim_lower                 141
+#define isc_dyn_dim_upper                 142
+
+/****************************/
+/* File specific attributes */
+/****************************/
+
+#define isc_dyn_file_name                 125
+#define isc_dyn_file_start                126
+#define isc_dyn_file_length               127
+#define isc_dyn_shadow_number             128
+#define isc_dyn_shadow_man_auto           129
+#define isc_dyn_shadow_conditional        130
+
+/********************************/
+/* Log file specific attributes */
+/********************************/
+/* Deprecated.
+#define isc_dyn_log_file_sequence         177
+#define isc_dyn_log_file_partitions       178
+#define isc_dyn_log_file_serial           179
+#define isc_dyn_log_file_overflow         200
+#define isc_dyn_log_file_raw		  201
+*/
+
+/***************************/
+/* Log specific attributes */
+/***************************/
+/* Deprecated.
+#define isc_dyn_log_group_commit_wait     189
+#define isc_dyn_log_buffer_size           190
+#define isc_dyn_log_check_point_length    191
+#define isc_dyn_log_num_of_buffers        192
+*/
+
+/********************************/
+/* Function specific attributes */
+/********************************/
+
+#define isc_dyn_function_name             145
+#define isc_dyn_function_type             146
+#define isc_dyn_func_module_name          147
+#define isc_dyn_func_entry_point          148
+#define isc_dyn_func_return_argument      149
+#define isc_dyn_func_arg_position         150
+#define isc_dyn_func_mechanism            151
+#define isc_dyn_filter_in_subtype         152
+#define isc_dyn_filter_out_subtype        153
+
+
+#define isc_dyn_description2		  154
+#define isc_dyn_fld_computed_source2	  155
+#define isc_dyn_fld_edit_string2	  156
+#define isc_dyn_fld_query_header2	  157
+#define isc_dyn_fld_validation_source2	  158
+#define isc_dyn_trg_msg2		  159
+#define isc_dyn_trg_source2		  160
+#define isc_dyn_view_source2		  161
+#define isc_dyn_xcp_msg2		  184
+
+/*********************************/
+/* Generator specific attributes */
+/*********************************/
+
+#define isc_dyn_generator_name            95
+#define isc_dyn_generator_id              96
+
+/*********************************/
+/* Procedure specific attributes */
+/*********************************/
+
+#define isc_dyn_prc_inputs                167
+#define isc_dyn_prc_outputs               168
+#define isc_dyn_prc_source                169
+#define isc_dyn_prc_blr                   170
+#define isc_dyn_prc_source2               171
+
+/*********************************/
+/* Parameter specific attributes */
+/*********************************/
+
+#define isc_dyn_prm_number                138
+#define isc_dyn_prm_type                  139
+
+/********************************/
+/* Relation specific attributes */
+/********************************/
+
+#define isc_dyn_xcp_msg                   185
+
+/**********************************************/
+/* Cascading referential integrity values     */
+/**********************************************/
+#define isc_dyn_foreign_key_update        205
+#define isc_dyn_foreign_key_delete        206
+#define isc_dyn_foreign_key_cascade       207
+#define isc_dyn_foreign_key_default       208
+#define isc_dyn_foreign_key_null          209
+#define isc_dyn_foreign_key_none          210
+
+/***********************/
+/* SQL role values     */
+/***********************/
+#define isc_dyn_def_sql_role              211
+#define isc_dyn_sql_role_name             212
+#define isc_dyn_grant_admin_options       213
+#define isc_dyn_del_sql_role              214
+/* 215 & 216 are used some lines above. */
+
+/**********************************************/
+/* Generators again                           */
+/**********************************************/
+
+#define isc_dyn_delete_generator          217
+
+// New for comments in objects.
+#define isc_dyn_mod_function              224
+#define isc_dyn_mod_filter                225
+#define isc_dyn_mod_generator             226
+#define isc_dyn_mod_sql_role              227
+#define isc_dyn_mod_charset               228
+#define isc_dyn_mod_collation             229
+#define isc_dyn_mod_prc_parameter         230
+
+/***********************/
+/* collation values     */
+/***********************/
+#define isc_dyn_def_collation						231
+#define isc_dyn_coll_for_charset					232
+#define isc_dyn_coll_from							233
+#define isc_dyn_coll_attribute						234
+#define isc_dyn_coll_specific_attributes_charset	235
+#define isc_dyn_coll_specific_attributes			236
+#define isc_dyn_del_collation						237
+
+/****************************/
+/* Last $dyn value assigned */
+/****************************/
+
+#define isc_dyn_last_dyn_value            237
+
+/******************************************/
+/* Array slice description language (SDL) */
+/******************************************/
+
+#define isc_sdl_version1                  1
+#define isc_sdl_eoc                       255
+#define isc_sdl_relation                  2
+#define isc_sdl_rid                       3
+#define isc_sdl_field                     4
+#define isc_sdl_fid                       5
+#define isc_sdl_struct                    6
+#define isc_sdl_variable                  7
+#define isc_sdl_scalar                    8
+#define isc_sdl_tiny_integer              9
+#define isc_sdl_short_integer             10
+#define isc_sdl_long_integer              11
+#define isc_sdl_literal                   12
+#define isc_sdl_add                       13
+#define isc_sdl_subtract                  14
+#define isc_sdl_multiply                  15
+#define isc_sdl_divide                    16
+#define isc_sdl_negate                    17
+#define isc_sdl_eql                       18
+#define isc_sdl_neq                       19
+#define isc_sdl_gtr                       20
+#define isc_sdl_geq                       21
+#define isc_sdl_lss                       22
+#define isc_sdl_leq                       23
+#define isc_sdl_and                       24
+#define isc_sdl_or                        25
+#define isc_sdl_not                       26
+#define isc_sdl_while                     27
+#define isc_sdl_assignment                28
+#define isc_sdl_label                     29
+#define isc_sdl_leave                     30
+#define isc_sdl_begin                     31
+#define isc_sdl_end                       32
+#define isc_sdl_do3                       33
+#define isc_sdl_do2                       34
+#define isc_sdl_do1                       35
+#define isc_sdl_element                   36
+
+/********************************************/
+/* International text interpretation values */
+/********************************************/
+
+#define isc_interp_eng_ascii              0
+#define isc_interp_jpn_sjis               5
+#define isc_interp_jpn_euc                6
+
+/*****************/
+/* Blob Subtypes */
+/*****************/
+
+/* types less than zero are reserved for customer use */
+
+#define isc_blob_untyped                   0
+
+/* internal subtypes */
+
+#define isc_blob_text                      1
+#define isc_blob_blr                       2
+#define isc_blob_acl                       3
+#define isc_blob_ranges                    4
+#define isc_blob_summary                   5
+#define isc_blob_format                    6
+#define isc_blob_tra                       7
+#define isc_blob_extfile                   8
+#define isc_blob_max_predefined_subtype    9
+
+/* the range 20-30 is reserved for dBASE and Paradox types */
+
+#define isc_blob_formatted_memo            20
+#define isc_blob_paradox_ole               21
+#define isc_blob_graphic                   22
+#define isc_blob_dbase_ole                 23
+#define isc_blob_typed_binary              24
+
+/* Deprecated definitions maintained for compatibility only */
+
+#define isc_info_db_SQL_dialect           62
+#define isc_dpb_SQL_dialect               63
+#define isc_dpb_set_db_SQL_dialect        65
+
+
+#include "iberror.h"
+
+#endif /* JRD_IBASE_H */
+
diff --git a/src/terralib/drivers/Firebird/ibpp/core/iberror.h b/src/terralib/drivers/Firebird/ibpp/core/iberror.h
new file mode 100644
index 0000000..91ecf9d
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/iberror.h
@@ -0,0 +1,1613 @@
+
+#ifndef JRD_GEN_IBERROR_H
+#define JRD_GEN_IBERROR_H
+/*
+ * The contents of this file are subject to the Interbase Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy
+ * of the License at http://www.Inprise.com/IPL.html
+ * 
+ * Software distributed under the License is distributed on an
+ * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ * 
+ * The content of this file was generated by the Firebird project
+ * using the program jrd/codes.epp
+ */
+/*
+ * 
+ * *** WARNING *** - This file is automatically generated by codes.epp - do not edit!
+ * 
+ */
+/*
+ *	MODULE:		iberror.h
+ *	DESCRIPTION:	ISC error codes
+ *
+ */
+
+
+
+/***********************/
+/*   ISC Error Codes   */
+/***********************/
+
+
+#ifdef __cplusplus /* c++ definitions */
+
+const ISC_LONG isc_facility	= 20;
+const ISC_LONG isc_base = 335544320L;
+const ISC_LONG isc_factor = 1;
+const ISC_LONG isc_arg_end			= 0;	// end of argument list 
+const ISC_LONG isc_arg_gds			= 1;	// generic DSRI status value 
+const ISC_LONG isc_arg_string		= 2;	// string argument 
+const ISC_LONG isc_arg_cstring		= 3;	// count & string argument 
+const ISC_LONG isc_arg_number		= 4;	// numeric argument (long) 
+const ISC_LONG isc_arg_interpreted	= 5;	// interpreted status code (string) 
+const ISC_LONG isc_arg_vms			= 6;	// VAX/VMS status code (long) 
+const ISC_LONG isc_arg_unix		= 7;	// UNIX error code 
+const ISC_LONG isc_arg_domain		= 8;	// Apollo/Domain error code 
+const ISC_LONG isc_arg_dos			= 9;	// MSDOS/OS2 error code 
+const ISC_LONG isc_arg_mpexl		= 10;	// HP MPE/XL error code 
+const ISC_LONG isc_arg_mpexl_ipc	= 11;	// HP MPE/XL IPC error code 
+const ISC_LONG isc_arg_next_mach	= 15;	// NeXT/Mach error code 
+const ISC_LONG isc_arg_netware		= 16;	// NetWare error code 
+const ISC_LONG isc_arg_win32		= 17;	// Win32 error code 
+const ISC_LONG isc_arg_warning		= 18;	// warning argument 
+
+const ISC_LONG isc_arith_except                     = 335544321L;
+const ISC_LONG isc_bad_dbkey                        = 335544322L;
+const ISC_LONG isc_bad_db_format                    = 335544323L;
+const ISC_LONG isc_bad_db_handle                    = 335544324L;
+const ISC_LONG isc_bad_dpb_content                  = 335544325L;
+const ISC_LONG isc_bad_dpb_form                     = 335544326L;
+const ISC_LONG isc_bad_req_handle                   = 335544327L;
+const ISC_LONG isc_bad_segstr_handle                = 335544328L;
+const ISC_LONG isc_bad_segstr_id                    = 335544329L;
+const ISC_LONG isc_bad_tpb_content                  = 335544330L;
+const ISC_LONG isc_bad_tpb_form                     = 335544331L;
+const ISC_LONG isc_bad_trans_handle                 = 335544332L;
+const ISC_LONG isc_bug_check                        = 335544333L;
+const ISC_LONG isc_convert_error                    = 335544334L;
+const ISC_LONG isc_db_corrupt                       = 335544335L;
+const ISC_LONG isc_deadlock                         = 335544336L;
+const ISC_LONG isc_excess_trans                     = 335544337L;
+const ISC_LONG isc_from_no_match                    = 335544338L;
+const ISC_LONG isc_infinap                          = 335544339L;
+const ISC_LONG isc_infona                           = 335544340L;
+const ISC_LONG isc_infunk                           = 335544341L;
+const ISC_LONG isc_integ_fail                       = 335544342L;
+const ISC_LONG isc_invalid_blr                      = 335544343L;
+const ISC_LONG isc_io_error                         = 335544344L;
+const ISC_LONG isc_lock_conflict                    = 335544345L;
+const ISC_LONG isc_metadata_corrupt                 = 335544346L;
+const ISC_LONG isc_not_valid                        = 335544347L;
+const ISC_LONG isc_no_cur_rec                       = 335544348L;
+const ISC_LONG isc_no_dup                           = 335544349L;
+const ISC_LONG isc_no_finish                        = 335544350L;
+const ISC_LONG isc_no_meta_update                   = 335544351L;
+const ISC_LONG isc_no_priv                          = 335544352L;
+const ISC_LONG isc_no_recon                         = 335544353L;
+const ISC_LONG isc_no_record                        = 335544354L;
+const ISC_LONG isc_no_segstr_close                  = 335544355L;
+const ISC_LONG isc_obsolete_metadata                = 335544356L;
+const ISC_LONG isc_open_trans                       = 335544357L;
+const ISC_LONG isc_port_len                         = 335544358L;
+const ISC_LONG isc_read_only_field                  = 335544359L;
+const ISC_LONG isc_read_only_rel                    = 335544360L;
+const ISC_LONG isc_read_only_trans                  = 335544361L;
+const ISC_LONG isc_read_only_view                   = 335544362L;
+const ISC_LONG isc_req_no_trans                     = 335544363L;
+const ISC_LONG isc_req_sync                         = 335544364L;
+const ISC_LONG isc_req_wrong_db                     = 335544365L;
+const ISC_LONG isc_segment                          = 335544366L;
+const ISC_LONG isc_segstr_eof                       = 335544367L;
+const ISC_LONG isc_segstr_no_op                     = 335544368L;
+const ISC_LONG isc_segstr_no_read                   = 335544369L;
+const ISC_LONG isc_segstr_no_trans                  = 335544370L;
+const ISC_LONG isc_segstr_no_write                  = 335544371L;
+const ISC_LONG isc_segstr_wrong_db                  = 335544372L;
+const ISC_LONG isc_sys_request                      = 335544373L;
+const ISC_LONG isc_stream_eof                       = 335544374L;
+const ISC_LONG isc_unavailable                      = 335544375L;
+const ISC_LONG isc_unres_rel                        = 335544376L;
+const ISC_LONG isc_uns_ext                          = 335544377L;
+const ISC_LONG isc_wish_list                        = 335544378L;
+const ISC_LONG isc_wrong_ods                        = 335544379L;
+const ISC_LONG isc_wronumarg                        = 335544380L;
+const ISC_LONG isc_imp_exc                          = 335544381L;
+const ISC_LONG isc_random                           = 335544382L;
+const ISC_LONG isc_fatal_conflict                   = 335544383L;
+const ISC_LONG isc_badblk                           = 335544384L;
+const ISC_LONG isc_invpoolcl                        = 335544385L;
+const ISC_LONG isc_nopoolids                        = 335544386L;
+const ISC_LONG isc_relbadblk                        = 335544387L;
+const ISC_LONG isc_blktoobig                        = 335544388L;
+const ISC_LONG isc_bufexh                           = 335544389L;
+const ISC_LONG isc_syntaxerr                        = 335544390L;
+const ISC_LONG isc_bufinuse                         = 335544391L;
+const ISC_LONG isc_bdbincon                         = 335544392L;
+const ISC_LONG isc_reqinuse                         = 335544393L;
+const ISC_LONG isc_badodsver                        = 335544394L;
+const ISC_LONG isc_relnotdef                        = 335544395L;
+const ISC_LONG isc_fldnotdef                        = 335544396L;
+const ISC_LONG isc_dirtypage                        = 335544397L;
+const ISC_LONG isc_waifortra                        = 335544398L;
+const ISC_LONG isc_doubleloc                        = 335544399L;
+const ISC_LONG isc_nodnotfnd                        = 335544400L;
+const ISC_LONG isc_dupnodfnd                        = 335544401L;
+const ISC_LONG isc_locnotmar                        = 335544402L;
+const ISC_LONG isc_badpagtyp                        = 335544403L;
+const ISC_LONG isc_corrupt                          = 335544404L;
+const ISC_LONG isc_badpage                          = 335544405L;
+const ISC_LONG isc_badindex                         = 335544406L;
+const ISC_LONG isc_dbbnotzer                        = 335544407L;
+const ISC_LONG isc_tranotzer                        = 335544408L;
+const ISC_LONG isc_trareqmis                        = 335544409L;
+const ISC_LONG isc_badhndcnt                        = 335544410L;
+const ISC_LONG isc_wrotpbver                        = 335544411L;
+const ISC_LONG isc_wroblrver                        = 335544412L;
+const ISC_LONG isc_wrodpbver                        = 335544413L;
+const ISC_LONG isc_blobnotsup                       = 335544414L;
+const ISC_LONG isc_badrelation                      = 335544415L;
+const ISC_LONG isc_nodetach                         = 335544416L;
+const ISC_LONG isc_notremote                        = 335544417L;
+const ISC_LONG isc_trainlim                         = 335544418L;
+const ISC_LONG isc_notinlim                         = 335544419L;
+const ISC_LONG isc_traoutsta                        = 335544420L;
+const ISC_LONG isc_connect_reject                   = 335544421L;
+const ISC_LONG isc_dbfile                           = 335544422L;
+const ISC_LONG isc_orphan                           = 335544423L;
+const ISC_LONG isc_no_lock_mgr                      = 335544424L;
+const ISC_LONG isc_ctxinuse                         = 335544425L;
+const ISC_LONG isc_ctxnotdef                        = 335544426L;
+const ISC_LONG isc_datnotsup                        = 335544427L;
+const ISC_LONG isc_badmsgnum                        = 335544428L;
+const ISC_LONG isc_badparnum                        = 335544429L;
+const ISC_LONG isc_virmemexh                        = 335544430L;
+const ISC_LONG isc_blocking_signal                  = 335544431L;
+const ISC_LONG isc_lockmanerr                       = 335544432L;
+const ISC_LONG isc_journerr                         = 335544433L;
+const ISC_LONG isc_keytoobig                        = 335544434L;
+const ISC_LONG isc_nullsegkey                       = 335544435L;
+const ISC_LONG isc_sqlerr                           = 335544436L;
+const ISC_LONG isc_wrodynver                        = 335544437L;
+const ISC_LONG isc_funnotdef                        = 335544438L;
+const ISC_LONG isc_funmismat                        = 335544439L;
+const ISC_LONG isc_bad_msg_vec                      = 335544440L;
+const ISC_LONG isc_bad_detach                       = 335544441L;
+const ISC_LONG isc_noargacc_read                    = 335544442L;
+const ISC_LONG isc_noargacc_write                   = 335544443L;
+const ISC_LONG isc_read_only                        = 335544444L;
+const ISC_LONG isc_ext_err                          = 335544445L;
+const ISC_LONG isc_non_updatable                    = 335544446L;
+const ISC_LONG isc_no_rollback                      = 335544447L;
+const ISC_LONG isc_bad_sec_info                     = 335544448L;
+const ISC_LONG isc_invalid_sec_info                 = 335544449L;
+const ISC_LONG isc_misc_interpreted                 = 335544450L;
+const ISC_LONG isc_update_conflict                  = 335544451L;
+const ISC_LONG isc_unlicensed                       = 335544452L;
+const ISC_LONG isc_obj_in_use                       = 335544453L;
+const ISC_LONG isc_nofilter                         = 335544454L;
+const ISC_LONG isc_shadow_accessed                  = 335544455L;
+const ISC_LONG isc_invalid_sdl                      = 335544456L;
+const ISC_LONG isc_out_of_bounds                    = 335544457L;
+const ISC_LONG isc_invalid_dimension                = 335544458L;
+const ISC_LONG isc_rec_in_limbo                     = 335544459L;
+const ISC_LONG isc_shadow_missing                   = 335544460L;
+const ISC_LONG isc_cant_validate                    = 335544461L;
+const ISC_LONG isc_cant_start_journal               = 335544462L;
+const ISC_LONG isc_gennotdef                        = 335544463L;
+const ISC_LONG isc_cant_start_logging               = 335544464L;
+const ISC_LONG isc_bad_segstr_type                  = 335544465L;
+const ISC_LONG isc_foreign_key                      = 335544466L;
+const ISC_LONG isc_high_minor                       = 335544467L;
+const ISC_LONG isc_tra_state                        = 335544468L;
+const ISC_LONG isc_trans_invalid                    = 335544469L;
+const ISC_LONG isc_buf_invalid                      = 335544470L;
+const ISC_LONG isc_indexnotdefined                  = 335544471L;
+const ISC_LONG isc_login                            = 335544472L;
+const ISC_LONG isc_invalid_bookmark                 = 335544473L;
+const ISC_LONG isc_bad_lock_level                   = 335544474L;
+const ISC_LONG isc_relation_lock                    = 335544475L;
+const ISC_LONG isc_record_lock                      = 335544476L;
+const ISC_LONG isc_max_idx                          = 335544477L;
+const ISC_LONG isc_jrn_enable                       = 335544478L;
+const ISC_LONG isc_old_failure                      = 335544479L;
+const ISC_LONG isc_old_in_progress                  = 335544480L;
+const ISC_LONG isc_old_no_space                     = 335544481L;
+const ISC_LONG isc_no_wal_no_jrn                    = 335544482L;
+const ISC_LONG isc_num_old_files                    = 335544483L;
+const ISC_LONG isc_wal_file_open                    = 335544484L;
+const ISC_LONG isc_bad_stmt_handle                  = 335544485L;
+const ISC_LONG isc_wal_failure                      = 335544486L;
+const ISC_LONG isc_walw_err                         = 335544487L;
+const ISC_LONG isc_logh_small                       = 335544488L;
+const ISC_LONG isc_logh_inv_version                 = 335544489L;
+const ISC_LONG isc_logh_open_flag                   = 335544490L;
+const ISC_LONG isc_logh_open_flag2                  = 335544491L;
+const ISC_LONG isc_logh_diff_dbname                 = 335544492L;
+const ISC_LONG isc_logf_unexpected_eof              = 335544493L;
+const ISC_LONG isc_logr_incomplete                  = 335544494L;
+const ISC_LONG isc_logr_header_small                = 335544495L;
+const ISC_LONG isc_logb_small                       = 335544496L;
+const ISC_LONG isc_wal_illegal_attach               = 335544497L;
+const ISC_LONG isc_wal_invalid_wpb                  = 335544498L;
+const ISC_LONG isc_wal_err_rollover                 = 335544499L;
+const ISC_LONG isc_no_wal                           = 335544500L;
+const ISC_LONG isc_drop_wal                         = 335544501L;
+const ISC_LONG isc_stream_not_defined               = 335544502L;
+const ISC_LONG isc_wal_subsys_error                 = 335544503L;
+const ISC_LONG isc_wal_subsys_corrupt               = 335544504L;
+const ISC_LONG isc_no_archive                       = 335544505L;
+const ISC_LONG isc_shutinprog                       = 335544506L;
+const ISC_LONG isc_range_in_use                     = 335544507L;
+const ISC_LONG isc_range_not_found                  = 335544508L;
+const ISC_LONG isc_charset_not_found                = 335544509L;
+const ISC_LONG isc_lock_timeout                     = 335544510L;
+const ISC_LONG isc_prcnotdef                        = 335544511L;
+const ISC_LONG isc_prcmismat                        = 335544512L;
+const ISC_LONG isc_wal_bugcheck                     = 335544513L;
+const ISC_LONG isc_wal_cant_expand                  = 335544514L;
+const ISC_LONG isc_codnotdef                        = 335544515L;
+const ISC_LONG isc_xcpnotdef                        = 335544516L;
+const ISC_LONG isc_except                           = 335544517L;
+const ISC_LONG isc_cache_restart                    = 335544518L;
+const ISC_LONG isc_bad_lock_handle                  = 335544519L;
+const ISC_LONG isc_jrn_present                      = 335544520L;
+const ISC_LONG isc_wal_err_rollover2                = 335544521L;
+const ISC_LONG isc_wal_err_logwrite                 = 335544522L;
+const ISC_LONG isc_wal_err_jrn_comm                 = 335544523L;
+const ISC_LONG isc_wal_err_expansion                = 335544524L;
+const ISC_LONG isc_wal_err_setup                    = 335544525L;
+const ISC_LONG isc_wal_err_ww_sync                  = 335544526L;
+const ISC_LONG isc_wal_err_ww_start                 = 335544527L;
+const ISC_LONG isc_shutdown                         = 335544528L;
+const ISC_LONG isc_existing_priv_mod                = 335544529L;
+const ISC_LONG isc_primary_key_ref                  = 335544530L;
+const ISC_LONG isc_primary_key_notnull              = 335544531L;
+const ISC_LONG isc_ref_cnstrnt_notfound             = 335544532L;
+const ISC_LONG isc_foreign_key_notfound             = 335544533L;
+const ISC_LONG isc_ref_cnstrnt_update               = 335544534L;
+const ISC_LONG isc_check_cnstrnt_update             = 335544535L;
+const ISC_LONG isc_check_cnstrnt_del                = 335544536L;
+const ISC_LONG isc_integ_index_seg_del              = 335544537L;
+const ISC_LONG isc_integ_index_seg_mod              = 335544538L;
+const ISC_LONG isc_integ_index_del                  = 335544539L;
+const ISC_LONG isc_integ_index_mod                  = 335544540L;
+const ISC_LONG isc_check_trig_del                   = 335544541L;
+const ISC_LONG isc_check_trig_update                = 335544542L;
+const ISC_LONG isc_cnstrnt_fld_del                  = 335544543L;
+const ISC_LONG isc_cnstrnt_fld_rename               = 335544544L;
+const ISC_LONG isc_rel_cnstrnt_update               = 335544545L;
+const ISC_LONG isc_constaint_on_view                = 335544546L;
+const ISC_LONG isc_invld_cnstrnt_type               = 335544547L;
+const ISC_LONG isc_primary_key_exists               = 335544548L;
+const ISC_LONG isc_systrig_update                   = 335544549L;
+const ISC_LONG isc_not_rel_owner                    = 335544550L;
+const ISC_LONG isc_grant_obj_notfound               = 335544551L;
+const ISC_LONG isc_grant_fld_notfound               = 335544552L;
+const ISC_LONG isc_grant_nopriv                     = 335544553L;
+const ISC_LONG isc_nonsql_security_rel              = 335544554L;
+const ISC_LONG isc_nonsql_security_fld              = 335544555L;
+const ISC_LONG isc_wal_cache_err                    = 335544556L;
+const ISC_LONG isc_shutfail                         = 335544557L;
+const ISC_LONG isc_check_constraint                 = 335544558L;
+const ISC_LONG isc_bad_svc_handle                   = 335544559L;
+const ISC_LONG isc_shutwarn                         = 335544560L;
+const ISC_LONG isc_wrospbver                        = 335544561L;
+const ISC_LONG isc_bad_spb_form                     = 335544562L;
+const ISC_LONG isc_svcnotdef                        = 335544563L;
+const ISC_LONG isc_no_jrn                           = 335544564L;
+const ISC_LONG isc_transliteration_failed           = 335544565L;
+const ISC_LONG isc_start_cm_for_wal                 = 335544566L;
+const ISC_LONG isc_wal_ovflow_log_required          = 335544567L;
+const ISC_LONG isc_text_subtype                     = 335544568L;
+const ISC_LONG isc_dsql_error                       = 335544569L;
+const ISC_LONG isc_dsql_command_err                 = 335544570L;
+const ISC_LONG isc_dsql_constant_err                = 335544571L;
+const ISC_LONG isc_dsql_cursor_err                  = 335544572L;
+const ISC_LONG isc_dsql_datatype_err                = 335544573L;
+const ISC_LONG isc_dsql_decl_err                    = 335544574L;
+const ISC_LONG isc_dsql_cursor_update_err           = 335544575L;
+const ISC_LONG isc_dsql_cursor_open_err             = 335544576L;
+const ISC_LONG isc_dsql_cursor_close_err            = 335544577L;
+const ISC_LONG isc_dsql_field_err                   = 335544578L;
+const ISC_LONG isc_dsql_internal_err                = 335544579L;
+const ISC_LONG isc_dsql_relation_err                = 335544580L;
+const ISC_LONG isc_dsql_procedure_err               = 335544581L;
+const ISC_LONG isc_dsql_request_err                 = 335544582L;
+const ISC_LONG isc_dsql_sqlda_err                   = 335544583L;
+const ISC_LONG isc_dsql_var_count_err               = 335544584L;
+const ISC_LONG isc_dsql_stmt_handle                 = 335544585L;
+const ISC_LONG isc_dsql_function_err                = 335544586L;
+const ISC_LONG isc_dsql_blob_err                    = 335544587L;
+const ISC_LONG isc_collation_not_found              = 335544588L;
+const ISC_LONG isc_collation_not_for_charset        = 335544589L;
+const ISC_LONG isc_dsql_dup_option                  = 335544590L;
+const ISC_LONG isc_dsql_tran_err                    = 335544591L;
+const ISC_LONG isc_dsql_invalid_array               = 335544592L;
+const ISC_LONG isc_dsql_max_arr_dim_exceeded        = 335544593L;
+const ISC_LONG isc_dsql_arr_range_error             = 335544594L;
+const ISC_LONG isc_dsql_trigger_err                 = 335544595L;
+const ISC_LONG isc_dsql_subselect_err               = 335544596L;
+const ISC_LONG isc_dsql_crdb_prepare_err            = 335544597L;
+const ISC_LONG isc_specify_field_err                = 335544598L;
+const ISC_LONG isc_num_field_err                    = 335544599L;
+const ISC_LONG isc_col_name_err                     = 335544600L;
+const ISC_LONG isc_where_err                        = 335544601L;
+const ISC_LONG isc_table_view_err                   = 335544602L;
+const ISC_LONG isc_distinct_err                     = 335544603L;
+const ISC_LONG isc_key_field_count_err              = 335544604L;
+const ISC_LONG isc_subquery_err                     = 335544605L;
+const ISC_LONG isc_expression_eval_err              = 335544606L;
+const ISC_LONG isc_node_err                         = 335544607L;
+const ISC_LONG isc_command_end_err                  = 335544608L;
+const ISC_LONG isc_index_name                       = 335544609L;
+const ISC_LONG isc_exception_name                   = 335544610L;
+const ISC_LONG isc_field_name                       = 335544611L;
+const ISC_LONG isc_token_err                        = 335544612L;
+const ISC_LONG isc_union_err                        = 335544613L;
+const ISC_LONG isc_dsql_construct_err               = 335544614L;
+const ISC_LONG isc_field_aggregate_err              = 335544615L;
+const ISC_LONG isc_field_ref_err                    = 335544616L;
+const ISC_LONG isc_order_by_err                     = 335544617L;
+const ISC_LONG isc_return_mode_err                  = 335544618L;
+const ISC_LONG isc_extern_func_err                  = 335544619L;
+const ISC_LONG isc_alias_conflict_err               = 335544620L;
+const ISC_LONG isc_procedure_conflict_error         = 335544621L;
+const ISC_LONG isc_relation_conflict_err            = 335544622L;
+const ISC_LONG isc_dsql_domain_err                  = 335544623L;
+const ISC_LONG isc_idx_seg_err                      = 335544624L;
+const ISC_LONG isc_node_name_err                    = 335544625L;
+const ISC_LONG isc_table_name                       = 335544626L;
+const ISC_LONG isc_proc_name                        = 335544627L;
+const ISC_LONG isc_idx_create_err                   = 335544628L;
+const ISC_LONG isc_wal_shadow_err                   = 335544629L;
+const ISC_LONG isc_dependency                       = 335544630L;
+const ISC_LONG isc_idx_key_err                      = 335544631L;
+const ISC_LONG isc_dsql_file_length_err             = 335544632L;
+const ISC_LONG isc_dsql_shadow_number_err           = 335544633L;
+const ISC_LONG isc_dsql_token_unk_err               = 335544634L;
+const ISC_LONG isc_dsql_no_relation_alias           = 335544635L;
+const ISC_LONG isc_indexname                        = 335544636L;
+const ISC_LONG isc_no_stream_plan                   = 335544637L;
+const ISC_LONG isc_stream_twice                     = 335544638L;
+const ISC_LONG isc_stream_not_found                 = 335544639L;
+const ISC_LONG isc_collation_requires_text          = 335544640L;
+const ISC_LONG isc_dsql_domain_not_found            = 335544641L;
+const ISC_LONG isc_index_unused                     = 335544642L;
+const ISC_LONG isc_dsql_self_join                   = 335544643L;
+const ISC_LONG isc_stream_bof                       = 335544644L;
+const ISC_LONG isc_stream_crack                     = 335544645L;
+const ISC_LONG isc_db_or_file_exists                = 335544646L;
+const ISC_LONG isc_invalid_operator                 = 335544647L;
+const ISC_LONG isc_conn_lost                        = 335544648L;
+const ISC_LONG isc_bad_checksum                     = 335544649L;
+const ISC_LONG isc_page_type_err                    = 335544650L;
+const ISC_LONG isc_ext_readonly_err                 = 335544651L;
+const ISC_LONG isc_sing_select_err                  = 335544652L;
+const ISC_LONG isc_psw_attach                       = 335544653L;
+const ISC_LONG isc_psw_start_trans                  = 335544654L;
+const ISC_LONG isc_invalid_direction                = 335544655L;
+const ISC_LONG isc_dsql_var_conflict                = 335544656L;
+const ISC_LONG isc_dsql_no_blob_array               = 335544657L;
+const ISC_LONG isc_dsql_base_table                  = 335544658L;
+const ISC_LONG isc_duplicate_base_table             = 335544659L;
+const ISC_LONG isc_view_alias                       = 335544660L;
+const ISC_LONG isc_index_root_page_full             = 335544661L;
+const ISC_LONG isc_dsql_blob_type_unknown           = 335544662L;
+const ISC_LONG isc_req_max_clones_exceeded          = 335544663L;
+const ISC_LONG isc_dsql_duplicate_spec              = 335544664L;
+const ISC_LONG isc_unique_key_violation             = 335544665L;
+const ISC_LONG isc_srvr_version_too_old             = 335544666L;
+const ISC_LONG isc_drdb_completed_with_errs         = 335544667L;
+const ISC_LONG isc_dsql_procedure_use_err           = 335544668L;
+const ISC_LONG isc_dsql_count_mismatch              = 335544669L;
+const ISC_LONG isc_blob_idx_err                     = 335544670L;
+const ISC_LONG isc_array_idx_err                    = 335544671L;
+const ISC_LONG isc_key_field_err                    = 335544672L;
+const ISC_LONG isc_no_delete                        = 335544673L;
+const ISC_LONG isc_del_last_field                   = 335544674L;
+const ISC_LONG isc_sort_err                         = 335544675L;
+const ISC_LONG isc_sort_mem_err                     = 335544676L;
+const ISC_LONG isc_version_err                      = 335544677L;
+const ISC_LONG isc_inval_key_posn                   = 335544678L;
+const ISC_LONG isc_no_segments_err                  = 335544679L;
+const ISC_LONG isc_crrp_data_err                    = 335544680L;
+const ISC_LONG isc_rec_size_err                     = 335544681L;
+const ISC_LONG isc_dsql_field_ref                   = 335544682L;
+const ISC_LONG isc_req_depth_exceeded               = 335544683L;
+const ISC_LONG isc_no_field_access                  = 335544684L;
+const ISC_LONG isc_no_dbkey                         = 335544685L;
+const ISC_LONG isc_jrn_format_err                   = 335544686L;
+const ISC_LONG isc_jrn_file_full                    = 335544687L;
+const ISC_LONG isc_dsql_open_cursor_request         = 335544688L;
+const ISC_LONG isc_ib_error                         = 335544689L;
+const ISC_LONG isc_cache_redef                      = 335544690L;
+const ISC_LONG isc_cache_too_small                  = 335544691L;
+const ISC_LONG isc_log_redef                        = 335544692L;
+const ISC_LONG isc_log_too_small                    = 335544693L;
+const ISC_LONG isc_partition_too_small              = 335544694L;
+const ISC_LONG isc_partition_not_supp               = 335544695L;
+const ISC_LONG isc_log_length_spec                  = 335544696L;
+const ISC_LONG isc_precision_err                    = 335544697L;
+const ISC_LONG isc_scale_nogt                       = 335544698L;
+const ISC_LONG isc_expec_short                      = 335544699L;
+const ISC_LONG isc_expec_long                       = 335544700L;
+const ISC_LONG isc_expec_ushort                     = 335544701L;
+const ISC_LONG isc_like_escape_invalid              = 335544702L;
+const ISC_LONG isc_svcnoexe                         = 335544703L;
+const ISC_LONG isc_net_lookup_err                   = 335544704L;
+const ISC_LONG isc_service_unknown                  = 335544705L;
+const ISC_LONG isc_host_unknown                     = 335544706L;
+const ISC_LONG isc_grant_nopriv_on_base             = 335544707L;
+const ISC_LONG isc_dyn_fld_ambiguous                = 335544708L;
+const ISC_LONG isc_dsql_agg_ref_err                 = 335544709L;
+const ISC_LONG isc_complex_view                     = 335544710L;
+const ISC_LONG isc_unprepared_stmt                  = 335544711L;
+const ISC_LONG isc_expec_positive                   = 335544712L;
+const ISC_LONG isc_dsql_sqlda_value_err             = 335544713L;
+const ISC_LONG isc_invalid_array_id                 = 335544714L;
+const ISC_LONG isc_extfile_uns_op                   = 335544715L;
+const ISC_LONG isc_svc_in_use                       = 335544716L;
+const ISC_LONG isc_err_stack_limit                  = 335544717L;
+const ISC_LONG isc_invalid_key                      = 335544718L;
+const ISC_LONG isc_net_init_error                   = 335544719L;
+const ISC_LONG isc_loadlib_failure                  = 335544720L;
+const ISC_LONG isc_network_error                    = 335544721L;
+const ISC_LONG isc_net_connect_err                  = 335544722L;
+const ISC_LONG isc_net_connect_listen_err           = 335544723L;
+const ISC_LONG isc_net_event_connect_err            = 335544724L;
+const ISC_LONG isc_net_event_listen_err             = 335544725L;
+const ISC_LONG isc_net_read_err                     = 335544726L;
+const ISC_LONG isc_net_write_err                    = 335544727L;
+const ISC_LONG isc_integ_index_deactivate           = 335544728L;
+const ISC_LONG isc_integ_deactivate_primary         = 335544729L;
+const ISC_LONG isc_cse_not_supported                = 335544730L;
+const ISC_LONG isc_tra_must_sweep                   = 335544731L;
+const ISC_LONG isc_unsupported_network_drive        = 335544732L;
+const ISC_LONG isc_io_create_err                    = 335544733L;
+const ISC_LONG isc_io_open_err                      = 335544734L;
+const ISC_LONG isc_io_close_err                     = 335544735L;
+const ISC_LONG isc_io_read_err                      = 335544736L;
+const ISC_LONG isc_io_write_err                     = 335544737L;
+const ISC_LONG isc_io_delete_err                    = 335544738L;
+const ISC_LONG isc_io_access_err                    = 335544739L;
+const ISC_LONG isc_udf_exception                    = 335544740L;
+const ISC_LONG isc_lost_db_connection               = 335544741L;
+const ISC_LONG isc_no_write_user_priv               = 335544742L;
+const ISC_LONG isc_token_too_long                   = 335544743L;
+const ISC_LONG isc_max_att_exceeded                 = 335544744L;
+const ISC_LONG isc_login_same_as_role_name          = 335544745L;
+const ISC_LONG isc_reftable_requires_pk             = 335544746L;
+const ISC_LONG isc_usrname_too_long                 = 335544747L;
+const ISC_LONG isc_password_too_long                = 335544748L;
+const ISC_LONG isc_usrname_required                 = 335544749L;
+const ISC_LONG isc_password_required                = 335544750L;
+const ISC_LONG isc_bad_protocol                     = 335544751L;
+const ISC_LONG isc_dup_usrname_found                = 335544752L;
+const ISC_LONG isc_usrname_not_found                = 335544753L;
+const ISC_LONG isc_error_adding_sec_record          = 335544754L;
+const ISC_LONG isc_error_modifying_sec_record       = 335544755L;
+const ISC_LONG isc_error_deleting_sec_record        = 335544756L;
+const ISC_LONG isc_error_updating_sec_db            = 335544757L;
+const ISC_LONG isc_sort_rec_size_err                = 335544758L;
+const ISC_LONG isc_bad_default_value                = 335544759L;
+const ISC_LONG isc_invalid_clause                   = 335544760L;
+const ISC_LONG isc_too_many_handles                 = 335544761L;
+const ISC_LONG isc_optimizer_blk_exc                = 335544762L;
+const ISC_LONG isc_invalid_string_constant          = 335544763L;
+const ISC_LONG isc_transitional_date                = 335544764L;
+const ISC_LONG isc_read_only_database               = 335544765L;
+const ISC_LONG isc_must_be_dialect_2_and_up         = 335544766L;
+const ISC_LONG isc_blob_filter_exception            = 335544767L;
+const ISC_LONG isc_exception_access_violation       = 335544768L;
+const ISC_LONG isc_exception_datatype_missalignment = 335544769L;
+const ISC_LONG isc_exception_array_bounds_exceeded  = 335544770L;
+const ISC_LONG isc_exception_float_denormal_operand = 335544771L;
+const ISC_LONG isc_exception_float_divide_by_zero   = 335544772L;
+const ISC_LONG isc_exception_float_inexact_result   = 335544773L;
+const ISC_LONG isc_exception_float_invalid_operand  = 335544774L;
+const ISC_LONG isc_exception_float_overflow         = 335544775L;
+const ISC_LONG isc_exception_float_stack_check      = 335544776L;
+const ISC_LONG isc_exception_float_underflow        = 335544777L;
+const ISC_LONG isc_exception_integer_divide_by_zero = 335544778L;
+const ISC_LONG isc_exception_integer_overflow       = 335544779L;
+const ISC_LONG isc_exception_unknown                = 335544780L;
+const ISC_LONG isc_exception_stack_overflow         = 335544781L;
+const ISC_LONG isc_exception_sigsegv                = 335544782L;
+const ISC_LONG isc_exception_sigill                 = 335544783L;
+const ISC_LONG isc_exception_sigbus                 = 335544784L;
+const ISC_LONG isc_exception_sigfpe                 = 335544785L;
+const ISC_LONG isc_ext_file_delete                  = 335544786L;
+const ISC_LONG isc_ext_file_modify                  = 335544787L;
+const ISC_LONG isc_adm_task_denied                  = 335544788L;
+const ISC_LONG isc_extract_input_mismatch           = 335544789L;
+const ISC_LONG isc_insufficient_svc_privileges      = 335544790L;
+const ISC_LONG isc_file_in_use                      = 335544791L;
+const ISC_LONG isc_service_att_err                  = 335544792L;
+const ISC_LONG isc_ddl_not_allowed_by_db_sql_dial   = 335544793L;
+const ISC_LONG isc_cancelled                        = 335544794L;
+const ISC_LONG isc_unexp_spb_form                   = 335544795L;
+const ISC_LONG isc_sql_dialect_datatype_unsupport   = 335544796L;
+const ISC_LONG isc_svcnouser                        = 335544797L;
+const ISC_LONG isc_depend_on_uncommitted_rel        = 335544798L;
+const ISC_LONG isc_svc_name_missing                 = 335544799L;
+const ISC_LONG isc_too_many_contexts                = 335544800L;
+const ISC_LONG isc_datype_notsup                    = 335544801L;
+const ISC_LONG isc_dialect_reset_warning            = 335544802L;
+const ISC_LONG isc_dialect_not_changed              = 335544803L;
+const ISC_LONG isc_database_create_failed           = 335544804L;
+const ISC_LONG isc_inv_dialect_specified            = 335544805L;
+const ISC_LONG isc_valid_db_dialects                = 335544806L;
+const ISC_LONG isc_sqlwarn                          = 335544807L;
+const ISC_LONG isc_dtype_renamed                    = 335544808L;
+const ISC_LONG isc_extern_func_dir_error            = 335544809L;
+const ISC_LONG isc_date_range_exceeded              = 335544810L;
+const ISC_LONG isc_inv_client_dialect_specified     = 335544811L;
+const ISC_LONG isc_valid_client_dialects            = 335544812L;
+const ISC_LONG isc_optimizer_between_err            = 335544813L;
+const ISC_LONG isc_service_not_supported            = 335544814L;
+const ISC_LONG isc_generator_name                   = 335544815L;
+const ISC_LONG isc_udf_name                         = 335544816L;
+const ISC_LONG isc_bad_limit_param                  = 335544817L;
+const ISC_LONG isc_bad_skip_param                   = 335544818L;
+const ISC_LONG isc_io_32bit_exceeded_err            = 335544819L;
+const ISC_LONG isc_invalid_savepoint                = 335544820L;
+const ISC_LONG isc_dsql_column_pos_err              = 335544821L;
+const ISC_LONG isc_dsql_agg_where_err               = 335544822L;
+const ISC_LONG isc_dsql_agg_group_err               = 335544823L;
+const ISC_LONG isc_dsql_agg_column_err              = 335544824L;
+const ISC_LONG isc_dsql_agg_having_err              = 335544825L;
+const ISC_LONG isc_dsql_agg_nested_err              = 335544826L;
+const ISC_LONG isc_exec_sql_invalid_arg             = 335544827L;
+const ISC_LONG isc_exec_sql_invalid_req             = 335544828L;
+const ISC_LONG isc_exec_sql_invalid_var             = 335544829L;
+const ISC_LONG isc_exec_sql_max_call_exceeded       = 335544830L;
+const ISC_LONG isc_conf_access_denied               = 335544831L;
+const ISC_LONG isc_wrong_backup_state               = 335544832L;
+const ISC_LONG isc_wal_backup_err                   = 335544833L;
+const ISC_LONG isc_cursor_not_open                  = 335544834L;
+const ISC_LONG isc_bad_shutdown_mode                = 335544835L;
+const ISC_LONG isc_concat_overflow                  = 335544836L;
+const ISC_LONG isc_bad_substring_offset             = 335544837L;
+const ISC_LONG isc_foreign_key_target_doesnt_exist  = 335544838L;
+const ISC_LONG isc_foreign_key_references_present   = 335544839L;
+const ISC_LONG isc_no_update                        = 335544840L;
+const ISC_LONG isc_cursor_already_open              = 335544841L;
+const ISC_LONG isc_stack_trace                      = 335544842L;
+const ISC_LONG isc_ctx_var_not_found                = 335544843L;
+const ISC_LONG isc_ctx_namespace_invalid            = 335544844L;
+const ISC_LONG isc_ctx_too_big                      = 335544845L;
+const ISC_LONG isc_ctx_bad_argument                 = 335544846L;
+const ISC_LONG isc_identifier_too_long              = 335544847L;
+const ISC_LONG isc_except2                          = 335544848L;
+const ISC_LONG isc_malformed_string                 = 335544849L;
+const ISC_LONG isc_prc_out_param_mismatch           = 335544850L;
+const ISC_LONG isc_command_end_err2                 = 335544851L;
+const ISC_LONG isc_partner_idx_incompat_type        = 335544852L;
+const ISC_LONG isc_bad_substring_length             = 335544853L;
+const ISC_LONG isc_charset_not_installed            = 335544854L;
+const ISC_LONG isc_collation_not_installed          = 335544855L;
+const ISC_LONG isc_att_shutdown                     = 335544856L;
+const ISC_LONG isc_blobtoobig                       = 335544857L;
+const ISC_LONG isc_must_have_phys_field             = 335544858L;
+const ISC_LONG isc_invalid_time_precision           = 335544859L;
+const ISC_LONG isc_blob_convert_error               = 335544860L;
+const ISC_LONG isc_array_convert_error              = 335544861L;
+const ISC_LONG isc_record_lock_not_supp             = 335544862L;
+const ISC_LONG isc_partner_idx_not_found            = 335544863L;
+const ISC_LONG isc_tra_num_exc                      = 335544864L;
+const ISC_LONG isc_field_disappeared                = 335544865L;
+const ISC_LONG isc_gfix_db_name                     = 335740929L;
+const ISC_LONG isc_gfix_invalid_sw                  = 335740930L;
+const ISC_LONG isc_gfix_incmp_sw                    = 335740932L;
+const ISC_LONG isc_gfix_replay_req                  = 335740933L;
+const ISC_LONG isc_gfix_pgbuf_req                   = 335740934L;
+const ISC_LONG isc_gfix_val_req                     = 335740935L;
+const ISC_LONG isc_gfix_pval_req                    = 335740936L;
+const ISC_LONG isc_gfix_trn_req                     = 335740937L;
+const ISC_LONG isc_gfix_full_req                    = 335740940L;
+const ISC_LONG isc_gfix_usrname_req                 = 335740941L;
+const ISC_LONG isc_gfix_pass_req                    = 335740942L;
+const ISC_LONG isc_gfix_subs_name                   = 335740943L;
+const ISC_LONG isc_gfix_wal_req                     = 335740944L;
+const ISC_LONG isc_gfix_sec_req                     = 335740945L;
+const ISC_LONG isc_gfix_nval_req                    = 335740946L;
+const ISC_LONG isc_gfix_type_shut                   = 335740947L;
+const ISC_LONG isc_gfix_retry                       = 335740948L;
+const ISC_LONG isc_gfix_retry_db                    = 335740951L;
+const ISC_LONG isc_gfix_exceed_max                  = 335740991L;
+const ISC_LONG isc_gfix_corrupt_pool                = 335740992L;
+const ISC_LONG isc_gfix_mem_exhausted               = 335740993L;
+const ISC_LONG isc_gfix_bad_pool                    = 335740994L;
+const ISC_LONG isc_gfix_trn_not_valid               = 335740995L;
+const ISC_LONG isc_gfix_unexp_eoi                   = 335741012L;
+const ISC_LONG isc_gfix_recon_fail                  = 335741018L;
+const ISC_LONG isc_gfix_trn_unknown                 = 335741036L;
+const ISC_LONG isc_gfix_mode_req                    = 335741038L;
+const ISC_LONG isc_gfix_opt_SQL_dialect             = 335741039L;
+const ISC_LONG isc_gfix_pzval_req                   = 335741042L;
+const ISC_LONG isc_dsql_dbkey_from_non_table        = 336003074L;
+const ISC_LONG isc_dsql_transitional_numeric        = 336003075L;
+const ISC_LONG isc_dsql_dialect_warning_expr        = 336003076L;
+const ISC_LONG isc_sql_db_dialect_dtype_unsupport   = 336003077L;
+const ISC_LONG isc_isc_sql_dialect_conflict_num     = 336003079L;
+const ISC_LONG isc_dsql_warning_number_ambiguous    = 336003080L;
+const ISC_LONG isc_dsql_warning_number_ambiguous1   = 336003081L;
+const ISC_LONG isc_dsql_warn_precision_ambiguous    = 336003082L;
+const ISC_LONG isc_dsql_warn_precision_ambiguous1   = 336003083L;
+const ISC_LONG isc_dsql_warn_precision_ambiguous2   = 336003084L;
+const ISC_LONG isc_dsql_ambiguous_field_name        = 336003085L;
+const ISC_LONG isc_dsql_udf_return_pos_err          = 336003086L;
+const ISC_LONG isc_dsql_invalid_label               = 336003087L;
+const ISC_LONG isc_dsql_datatypes_not_comparable    = 336003088L;
+const ISC_LONG isc_dsql_cursor_invalid              = 336003089L;
+const ISC_LONG isc_dsql_cursor_redefined            = 336003090L;
+const ISC_LONG isc_dsql_cursor_not_found            = 336003091L;
+const ISC_LONG isc_dsql_cursor_exists               = 336003092L;
+const ISC_LONG isc_dsql_cursor_rel_ambiguous        = 336003093L;
+const ISC_LONG isc_dsql_cursor_rel_not_found        = 336003094L;
+const ISC_LONG isc_dsql_cursor_not_open             = 336003095L;
+const ISC_LONG isc_dsql_type_not_supp_ext_tab       = 336003096L;
+const ISC_LONG isc_dyn_role_does_not_exist          = 336068796L;
+const ISC_LONG isc_dyn_no_grant_admin_opt           = 336068797L;
+const ISC_LONG isc_dyn_user_not_role_member         = 336068798L;
+const ISC_LONG isc_dyn_delete_role_failed           = 336068799L;
+const ISC_LONG isc_dyn_grant_role_to_user           = 336068800L;
+const ISC_LONG isc_dyn_inv_sql_role_name            = 336068801L;
+const ISC_LONG isc_dyn_dup_sql_role                 = 336068802L;
+const ISC_LONG isc_dyn_kywd_spec_for_role           = 336068803L;
+const ISC_LONG isc_dyn_roles_not_supported          = 336068804L;
+const ISC_LONG isc_dyn_domain_name_exists           = 336068812L;
+const ISC_LONG isc_dyn_field_name_exists            = 336068813L;
+const ISC_LONG isc_dyn_dependency_exists            = 336068814L;
+const ISC_LONG isc_dyn_dtype_invalid                = 336068815L;
+const ISC_LONG isc_dyn_char_fld_too_small           = 336068816L;
+const ISC_LONG isc_dyn_invalid_dtype_conversion     = 336068817L;
+const ISC_LONG isc_dyn_dtype_conv_invalid           = 336068818L;
+const ISC_LONG isc_dyn_zero_len_id                  = 336068820L;
+const ISC_LONG isc_gbak_unknown_switch              = 336330753L;
+const ISC_LONG isc_gbak_page_size_missing           = 336330754L;
+const ISC_LONG isc_gbak_page_size_toobig            = 336330755L;
+const ISC_LONG isc_gbak_redir_ouput_missing         = 336330756L;
+const ISC_LONG isc_gbak_switches_conflict           = 336330757L;
+const ISC_LONG isc_gbak_unknown_device              = 336330758L;
+const ISC_LONG isc_gbak_no_protection               = 336330759L;
+const ISC_LONG isc_gbak_page_size_not_allowed       = 336330760L;
+const ISC_LONG isc_gbak_multi_source_dest           = 336330761L;
+const ISC_LONG isc_gbak_filename_missing            = 336330762L;
+const ISC_LONG isc_gbak_dup_inout_names             = 336330763L;
+const ISC_LONG isc_gbak_inv_page_size               = 336330764L;
+const ISC_LONG isc_gbak_db_specified                = 336330765L;
+const ISC_LONG isc_gbak_db_exists                   = 336330766L;
+const ISC_LONG isc_gbak_unk_device                  = 336330767L;
+const ISC_LONG isc_gbak_blob_info_failed            = 336330772L;
+const ISC_LONG isc_gbak_unk_blob_item               = 336330773L;
+const ISC_LONG isc_gbak_get_seg_failed              = 336330774L;
+const ISC_LONG isc_gbak_close_blob_failed           = 336330775L;
+const ISC_LONG isc_gbak_open_blob_failed            = 336330776L;
+const ISC_LONG isc_gbak_put_blr_gen_id_failed       = 336330777L;
+const ISC_LONG isc_gbak_unk_type                    = 336330778L;
+const ISC_LONG isc_gbak_comp_req_failed             = 336330779L;
+const ISC_LONG isc_gbak_start_req_failed            = 336330780L;
+const ISC_LONG isc_gbak_rec_failed                  = 336330781L;
+const ISC_LONG isc_gbak_rel_req_failed              = 336330782L;
+const ISC_LONG isc_gbak_db_info_failed              = 336330783L;
+const ISC_LONG isc_gbak_no_db_desc                  = 336330784L;
+const ISC_LONG isc_gbak_db_create_failed            = 336330785L;
+const ISC_LONG isc_gbak_decomp_len_error            = 336330786L;
+const ISC_LONG isc_gbak_tbl_missing                 = 336330787L;
+const ISC_LONG isc_gbak_blob_col_missing            = 336330788L;
+const ISC_LONG isc_gbak_create_blob_failed          = 336330789L;
+const ISC_LONG isc_gbak_put_seg_failed              = 336330790L;
+const ISC_LONG isc_gbak_rec_len_exp                 = 336330791L;
+const ISC_LONG isc_gbak_inv_rec_len                 = 336330792L;
+const ISC_LONG isc_gbak_exp_data_type               = 336330793L;
+const ISC_LONG isc_gbak_gen_id_failed               = 336330794L;
+const ISC_LONG isc_gbak_unk_rec_type                = 336330795L;
+const ISC_LONG isc_gbak_inv_bkup_ver                = 336330796L;
+const ISC_LONG isc_gbak_missing_bkup_desc           = 336330797L;
+const ISC_LONG isc_gbak_string_trunc                = 336330798L;
+const ISC_LONG isc_gbak_cant_rest_record            = 336330799L;
+const ISC_LONG isc_gbak_send_failed                 = 336330800L;
+const ISC_LONG isc_gbak_no_tbl_name                 = 336330801L;
+const ISC_LONG isc_gbak_unexp_eof                   = 336330802L;
+const ISC_LONG isc_gbak_db_format_too_old           = 336330803L;
+const ISC_LONG isc_gbak_inv_array_dim               = 336330804L;
+const ISC_LONG isc_gbak_xdr_len_expected            = 336330807L;
+const ISC_LONG isc_gbak_open_bkup_error             = 336330817L;
+const ISC_LONG isc_gbak_open_error                  = 336330818L;
+const ISC_LONG isc_gbak_missing_block_fac           = 336330934L;
+const ISC_LONG isc_gbak_inv_block_fac               = 336330935L;
+const ISC_LONG isc_gbak_block_fac_specified         = 336330936L;
+const ISC_LONG isc_gbak_missing_username            = 336330940L;
+const ISC_LONG isc_gbak_missing_password            = 336330941L;
+const ISC_LONG isc_gbak_missing_skipped_bytes       = 336330952L;
+const ISC_LONG isc_gbak_inv_skipped_bytes           = 336330953L;
+const ISC_LONG isc_gbak_err_restore_charset         = 336330965L;
+const ISC_LONG isc_gbak_err_restore_collation       = 336330967L;
+const ISC_LONG isc_gbak_read_error                  = 336330972L;
+const ISC_LONG isc_gbak_write_error                 = 336330973L;
+const ISC_LONG isc_gbak_db_in_use                   = 336330985L;
+const ISC_LONG isc_gbak_sysmemex                    = 336330990L;
+const ISC_LONG isc_gbak_restore_role_failed         = 336331002L;
+const ISC_LONG isc_gbak_role_op_missing             = 336331005L;
+const ISC_LONG isc_gbak_page_buffers_missing        = 336331010L;
+const ISC_LONG isc_gbak_page_buffers_wrong_param    = 336331011L;
+const ISC_LONG isc_gbak_page_buffers_restore        = 336331012L;
+const ISC_LONG isc_gbak_inv_size                    = 336331014L;
+const ISC_LONG isc_gbak_file_outof_sequence         = 336331015L;
+const ISC_LONG isc_gbak_join_file_missing           = 336331016L;
+const ISC_LONG isc_gbak_stdin_not_supptd            = 336331017L;
+const ISC_LONG isc_gbak_stdout_not_supptd           = 336331018L;
+const ISC_LONG isc_gbak_bkup_corrupt                = 336331019L;
+const ISC_LONG isc_gbak_unk_db_file_spec            = 336331020L;
+const ISC_LONG isc_gbak_hdr_write_failed            = 336331021L;
+const ISC_LONG isc_gbak_disk_space_ex               = 336331022L;
+const ISC_LONG isc_gbak_size_lt_min                 = 336331023L;
+const ISC_LONG isc_gbak_svc_name_missing            = 336331025L;
+const ISC_LONG isc_gbak_not_ownr                    = 336331026L;
+const ISC_LONG isc_gbak_mode_req                    = 336331031L;
+const ISC_LONG isc_gbak_just_data                   = 336331033L;
+const ISC_LONG isc_gbak_data_only                   = 336331034L;
+const ISC_LONG isc_dsql_too_old_ods                 = 336397205L;
+const ISC_LONG isc_dsql_table_not_found             = 336397206L;
+const ISC_LONG isc_dsql_view_not_found              = 336397207L;
+const ISC_LONG isc_dsql_line_col_error              = 336397208L;
+const ISC_LONG isc_dsql_unknown_pos                 = 336397209L;
+const ISC_LONG isc_dsql_no_dup_name                 = 336397210L;
+const ISC_LONG isc_dsql_too_many_values             = 336397211L;
+const ISC_LONG isc_gsec_cant_open_db                = 336723983L;
+const ISC_LONG isc_gsec_switches_error              = 336723984L;
+const ISC_LONG isc_gsec_no_op_spec                  = 336723985L;
+const ISC_LONG isc_gsec_no_usr_name                 = 336723986L;
+const ISC_LONG isc_gsec_err_add                     = 336723987L;
+const ISC_LONG isc_gsec_err_modify                  = 336723988L;
+const ISC_LONG isc_gsec_err_find_mod                = 336723989L;
+const ISC_LONG isc_gsec_err_rec_not_found           = 336723990L;
+const ISC_LONG isc_gsec_err_delete                  = 336723991L;
+const ISC_LONG isc_gsec_err_find_del                = 336723992L;
+const ISC_LONG isc_gsec_err_find_disp               = 336723996L;
+const ISC_LONG isc_gsec_inv_param                   = 336723997L;
+const ISC_LONG isc_gsec_op_specified                = 336723998L;
+const ISC_LONG isc_gsec_pw_specified                = 336723999L;
+const ISC_LONG isc_gsec_uid_specified               = 336724000L;
+const ISC_LONG isc_gsec_gid_specified               = 336724001L;
+const ISC_LONG isc_gsec_proj_specified              = 336724002L;
+const ISC_LONG isc_gsec_org_specified               = 336724003L;
+const ISC_LONG isc_gsec_fname_specified             = 336724004L;
+const ISC_LONG isc_gsec_mname_specified             = 336724005L;
+const ISC_LONG isc_gsec_lname_specified             = 336724006L;
+const ISC_LONG isc_gsec_inv_switch                  = 336724008L;
+const ISC_LONG isc_gsec_amb_switch                  = 336724009L;
+const ISC_LONG isc_gsec_no_op_specified             = 336724010L;
+const ISC_LONG isc_gsec_params_not_allowed          = 336724011L;
+const ISC_LONG isc_gsec_incompat_switch             = 336724012L;
+const ISC_LONG isc_gsec_inv_username                = 336724044L;
+const ISC_LONG isc_gsec_inv_pw_length               = 336724045L;
+const ISC_LONG isc_gsec_db_specified                = 336724046L;
+const ISC_LONG isc_gsec_db_admin_specified          = 336724047L;
+const ISC_LONG isc_gsec_db_admin_pw_specified       = 336724048L;
+const ISC_LONG isc_gsec_sql_role_specified          = 336724049L;
+const ISC_LONG isc_license_no_file                  = 336789504L;
+const ISC_LONG isc_license_op_specified             = 336789523L;
+const ISC_LONG isc_license_op_missing               = 336789524L;
+const ISC_LONG isc_license_inv_switch               = 336789525L;
+const ISC_LONG isc_license_inv_switch_combo         = 336789526L;
+const ISC_LONG isc_license_inv_op_combo             = 336789527L;
+const ISC_LONG isc_license_amb_switch               = 336789528L;
+const ISC_LONG isc_license_inv_parameter            = 336789529L;
+const ISC_LONG isc_license_param_specified          = 336789530L;
+const ISC_LONG isc_license_param_req                = 336789531L;
+const ISC_LONG isc_license_syntx_error              = 336789532L;
+const ISC_LONG isc_license_dup_id                   = 336789534L;
+const ISC_LONG isc_license_inv_id_key               = 336789535L;
+const ISC_LONG isc_license_err_remove               = 336789536L;
+const ISC_LONG isc_license_err_update               = 336789537L;
+const ISC_LONG isc_license_err_convert              = 336789538L;
+const ISC_LONG isc_license_err_unk                  = 336789539L;
+const ISC_LONG isc_license_svc_err_add              = 336789540L;
+const ISC_LONG isc_license_svc_err_remove           = 336789541L;
+const ISC_LONG isc_license_eval_exists              = 336789563L;
+const ISC_LONG isc_gstat_unknown_switch             = 336920577L;
+const ISC_LONG isc_gstat_retry                      = 336920578L;
+const ISC_LONG isc_gstat_wrong_ods                  = 336920579L;
+const ISC_LONG isc_gstat_unexpected_eof             = 336920580L;
+const ISC_LONG isc_gstat_open_err                   = 336920605L;
+const ISC_LONG isc_gstat_read_err                   = 336920606L;
+const ISC_LONG isc_gstat_sysmemex                   = 336920607L;
+const ISC_LONG isc_err_max                          = 763;
+
+#else /* c definitions */
+
+#define isc_facility 20
+#define isc_base 335544320L
+#define isc_factor 1
+
+#define isc_arg_end		0	/* end of argument list */
+#define isc_arg_gds		1	/* generic DSRI status value */
+#define isc_arg_string		2	/* string argument */
+#define isc_arg_cstring	3	/* count & string argument */
+#define isc_arg_number		4	/* numeric argument (long) */
+#define isc_arg_interpreted	5	/* interpreted status code (string) */
+#define isc_arg_vms		6	/* VAX/VMS status code (long) */
+#define isc_arg_unix		7	/* UNIX error code */
+#define isc_arg_domain		8	/* Apollo/Domain error code */
+#define isc_arg_dos		9	/* MSDOS/OS2 error code */
+#define isc_arg_mpexl		10	/* HP MPE/XL error code */
+#define isc_arg_mpexl_ipc	11	/* HP MPE/XL IPC error code */
+#define isc_arg_next_mach	15	/* NeXT/Mach error code */
+#define isc_arg_netware	16	/* NetWare error code */
+#define isc_arg_win32		17	/* Win32 error code */
+#define isc_arg_warning	18	/* warning argument */
+
+#define isc_arith_except                     335544321L
+#define isc_bad_dbkey                        335544322L
+#define isc_bad_db_format                    335544323L
+#define isc_bad_db_handle                    335544324L
+#define isc_bad_dpb_content                  335544325L
+#define isc_bad_dpb_form                     335544326L
+#define isc_bad_req_handle                   335544327L
+#define isc_bad_segstr_handle                335544328L
+#define isc_bad_segstr_id                    335544329L
+#define isc_bad_tpb_content                  335544330L
+#define isc_bad_tpb_form                     335544331L
+#define isc_bad_trans_handle                 335544332L
+#define isc_bug_check                        335544333L
+#define isc_convert_error                    335544334L
+#define isc_db_corrupt                       335544335L
+#define isc_deadlock                         335544336L
+#define isc_excess_trans                     335544337L
+#define isc_from_no_match                    335544338L
+#define isc_infinap                          335544339L
+#define isc_infona                           335544340L
+#define isc_infunk                           335544341L
+#define isc_integ_fail                       335544342L
+#define isc_invalid_blr                      335544343L
+#define isc_io_error                         335544344L
+#define isc_lock_conflict                    335544345L
+#define isc_metadata_corrupt                 335544346L
+#define isc_not_valid                        335544347L
+#define isc_no_cur_rec                       335544348L
+#define isc_no_dup                           335544349L
+#define isc_no_finish                        335544350L
+#define isc_no_meta_update                   335544351L
+#define isc_no_priv                          335544352L
+#define isc_no_recon                         335544353L
+#define isc_no_record                        335544354L
+#define isc_no_segstr_close                  335544355L
+#define isc_obsolete_metadata                335544356L
+#define isc_open_trans                       335544357L
+#define isc_port_len                         335544358L
+#define isc_read_only_field                  335544359L
+#define isc_read_only_rel                    335544360L
+#define isc_read_only_trans                  335544361L
+#define isc_read_only_view                   335544362L
+#define isc_req_no_trans                     335544363L
+#define isc_req_sync                         335544364L
+#define isc_req_wrong_db                     335544365L
+#define isc_segment                          335544366L
+#define isc_segstr_eof                       335544367L
+#define isc_segstr_no_op                     335544368L
+#define isc_segstr_no_read                   335544369L
+#define isc_segstr_no_trans                  335544370L
+#define isc_segstr_no_write                  335544371L
+#define isc_segstr_wrong_db                  335544372L
+#define isc_sys_request                      335544373L
+#define isc_stream_eof                       335544374L
+#define isc_unavailable                      335544375L
+#define isc_unres_rel                        335544376L
+#define isc_uns_ext                          335544377L
+#define isc_wish_list                        335544378L
+#define isc_wrong_ods                        335544379L
+#define isc_wronumarg                        335544380L
+#define isc_imp_exc                          335544381L
+#define isc_random                           335544382L
+#define isc_fatal_conflict                   335544383L
+#define isc_badblk                           335544384L
+#define isc_invpoolcl                        335544385L
+#define isc_nopoolids                        335544386L
+#define isc_relbadblk                        335544387L
+#define isc_blktoobig                        335544388L
+#define isc_bufexh                           335544389L
+#define isc_syntaxerr                        335544390L
+#define isc_bufinuse                         335544391L
+#define isc_bdbincon                         335544392L
+#define isc_reqinuse                         335544393L
+#define isc_badodsver                        335544394L
+#define isc_relnotdef                        335544395L
+#define isc_fldnotdef                        335544396L
+#define isc_dirtypage                        335544397L
+#define isc_waifortra                        335544398L
+#define isc_doubleloc                        335544399L
+#define isc_nodnotfnd                        335544400L
+#define isc_dupnodfnd                        335544401L
+#define isc_locnotmar                        335544402L
+#define isc_badpagtyp                        335544403L
+#define isc_corrupt                          335544404L
+#define isc_badpage                          335544405L
+#define isc_badindex                         335544406L
+#define isc_dbbnotzer                        335544407L
+#define isc_tranotzer                        335544408L
+#define isc_trareqmis                        335544409L
+#define isc_badhndcnt                        335544410L
+#define isc_wrotpbver                        335544411L
+#define isc_wroblrver                        335544412L
+#define isc_wrodpbver                        335544413L
+#define isc_blobnotsup                       335544414L
+#define isc_badrelation                      335544415L
+#define isc_nodetach                         335544416L
+#define isc_notremote                        335544417L
+#define isc_trainlim                         335544418L
+#define isc_notinlim                         335544419L
+#define isc_traoutsta                        335544420L
+#define isc_connect_reject                   335544421L
+#define isc_dbfile                           335544422L
+#define isc_orphan                           335544423L
+#define isc_no_lock_mgr                      335544424L
+#define isc_ctxinuse                         335544425L
+#define isc_ctxnotdef                        335544426L
+#define isc_datnotsup                        335544427L
+#define isc_badmsgnum                        335544428L
+#define isc_badparnum                        335544429L
+#define isc_virmemexh                        335544430L
+#define isc_blocking_signal                  335544431L
+#define isc_lockmanerr                       335544432L
+#define isc_journerr                         335544433L
+#define isc_keytoobig                        335544434L
+#define isc_nullsegkey                       335544435L
+#define isc_sqlerr                           335544436L
+#define isc_wrodynver                        335544437L
+#define isc_funnotdef                        335544438L
+#define isc_funmismat                        335544439L
+#define isc_bad_msg_vec                      335544440L
+#define isc_bad_detach                       335544441L
+#define isc_noargacc_read                    335544442L
+#define isc_noargacc_write                   335544443L
+#define isc_read_only                        335544444L
+#define isc_ext_err                          335544445L
+#define isc_non_updatable                    335544446L
+#define isc_no_rollback                      335544447L
+#define isc_bad_sec_info                     335544448L
+#define isc_invalid_sec_info                 335544449L
+#define isc_misc_interpreted                 335544450L
+#define isc_update_conflict                  335544451L
+#define isc_unlicensed                       335544452L
+#define isc_obj_in_use                       335544453L
+#define isc_nofilter                         335544454L
+#define isc_shadow_accessed                  335544455L
+#define isc_invalid_sdl                      335544456L
+#define isc_out_of_bounds                    335544457L
+#define isc_invalid_dimension                335544458L
+#define isc_rec_in_limbo                     335544459L
+#define isc_shadow_missing                   335544460L
+#define isc_cant_validate                    335544461L
+#define isc_cant_start_journal               335544462L
+#define isc_gennotdef                        335544463L
+#define isc_cant_start_logging               335544464L
+#define isc_bad_segstr_type                  335544465L
+#define isc_foreign_key                      335544466L
+#define isc_high_minor                       335544467L
+#define isc_tra_state                        335544468L
+#define isc_trans_invalid                    335544469L
+#define isc_buf_invalid                      335544470L
+#define isc_indexnotdefined                  335544471L
+#define isc_login                            335544472L
+#define isc_invalid_bookmark                 335544473L
+#define isc_bad_lock_level                   335544474L
+#define isc_relation_lock                    335544475L
+#define isc_record_lock                      335544476L
+#define isc_max_idx                          335544477L
+#define isc_jrn_enable                       335544478L
+#define isc_old_failure                      335544479L
+#define isc_old_in_progress                  335544480L
+#define isc_old_no_space                     335544481L
+#define isc_no_wal_no_jrn                    335544482L
+#define isc_num_old_files                    335544483L
+#define isc_wal_file_open                    335544484L
+#define isc_bad_stmt_handle                  335544485L
+#define isc_wal_failure                      335544486L
+#define isc_walw_err                         335544487L
+#define isc_logh_small                       335544488L
+#define isc_logh_inv_version                 335544489L
+#define isc_logh_open_flag                   335544490L
+#define isc_logh_open_flag2                  335544491L
+#define isc_logh_diff_dbname                 335544492L
+#define isc_logf_unexpected_eof              335544493L
+#define isc_logr_incomplete                  335544494L
+#define isc_logr_header_small                335544495L
+#define isc_logb_small                       335544496L
+#define isc_wal_illegal_attach               335544497L
+#define isc_wal_invalid_wpb                  335544498L
+#define isc_wal_err_rollover                 335544499L
+#define isc_no_wal                           335544500L
+#define isc_drop_wal                         335544501L
+#define isc_stream_not_defined               335544502L
+#define isc_wal_subsys_error                 335544503L
+#define isc_wal_subsys_corrupt               335544504L
+#define isc_no_archive                       335544505L
+#define isc_shutinprog                       335544506L
+#define isc_range_in_use                     335544507L
+#define isc_range_not_found                  335544508L
+#define isc_charset_not_found                335544509L
+#define isc_lock_timeout                     335544510L
+#define isc_prcnotdef                        335544511L
+#define isc_prcmismat                        335544512L
+#define isc_wal_bugcheck                     335544513L
+#define isc_wal_cant_expand                  335544514L
+#define isc_codnotdef                        335544515L
+#define isc_xcpnotdef                        335544516L
+#define isc_except                           335544517L
+#define isc_cache_restart                    335544518L
+#define isc_bad_lock_handle                  335544519L
+#define isc_jrn_present                      335544520L
+#define isc_wal_err_rollover2                335544521L
+#define isc_wal_err_logwrite                 335544522L
+#define isc_wal_err_jrn_comm                 335544523L
+#define isc_wal_err_expansion                335544524L
+#define isc_wal_err_setup                    335544525L
+#define isc_wal_err_ww_sync                  335544526L
+#define isc_wal_err_ww_start                 335544527L
+#define isc_shutdown                         335544528L
+#define isc_existing_priv_mod                335544529L
+#define isc_primary_key_ref                  335544530L
+#define isc_primary_key_notnull              335544531L
+#define isc_ref_cnstrnt_notfound             335544532L
+#define isc_foreign_key_notfound             335544533L
+#define isc_ref_cnstrnt_update               335544534L
+#define isc_check_cnstrnt_update             335544535L
+#define isc_check_cnstrnt_del                335544536L
+#define isc_integ_index_seg_del              335544537L
+#define isc_integ_index_seg_mod              335544538L
+#define isc_integ_index_del                  335544539L
+#define isc_integ_index_mod                  335544540L
+#define isc_check_trig_del                   335544541L
+#define isc_check_trig_update                335544542L
+#define isc_cnstrnt_fld_del                  335544543L
+#define isc_cnstrnt_fld_rename               335544544L
+#define isc_rel_cnstrnt_update               335544545L
+#define isc_constaint_on_view                335544546L
+#define isc_invld_cnstrnt_type               335544547L
+#define isc_primary_key_exists               335544548L
+#define isc_systrig_update                   335544549L
+#define isc_not_rel_owner                    335544550L
+#define isc_grant_obj_notfound               335544551L
+#define isc_grant_fld_notfound               335544552L
+#define isc_grant_nopriv                     335544553L
+#define isc_nonsql_security_rel              335544554L
+#define isc_nonsql_security_fld              335544555L
+#define isc_wal_cache_err                    335544556L
+#define isc_shutfail                         335544557L
+#define isc_check_constraint                 335544558L
+#define isc_bad_svc_handle                   335544559L
+#define isc_shutwarn                         335544560L
+#define isc_wrospbver                        335544561L
+#define isc_bad_spb_form                     335544562L
+#define isc_svcnotdef                        335544563L
+#define isc_no_jrn                           335544564L
+#define isc_transliteration_failed           335544565L
+#define isc_start_cm_for_wal                 335544566L
+#define isc_wal_ovflow_log_required          335544567L
+#define isc_text_subtype                     335544568L
+#define isc_dsql_error                       335544569L
+#define isc_dsql_command_err                 335544570L
+#define isc_dsql_constant_err                335544571L
+#define isc_dsql_cursor_err                  335544572L
+#define isc_dsql_datatype_err                335544573L
+#define isc_dsql_decl_err                    335544574L
+#define isc_dsql_cursor_update_err           335544575L
+#define isc_dsql_cursor_open_err             335544576L
+#define isc_dsql_cursor_close_err            335544577L
+#define isc_dsql_field_err                   335544578L
+#define isc_dsql_internal_err                335544579L
+#define isc_dsql_relation_err                335544580L
+#define isc_dsql_procedure_err               335544581L
+#define isc_dsql_request_err                 335544582L
+#define isc_dsql_sqlda_err                   335544583L
+#define isc_dsql_var_count_err               335544584L
+#define isc_dsql_stmt_handle                 335544585L
+#define isc_dsql_function_err                335544586L
+#define isc_dsql_blob_err                    335544587L
+#define isc_collation_not_found              335544588L
+#define isc_collation_not_for_charset        335544589L
+#define isc_dsql_dup_option                  335544590L
+#define isc_dsql_tran_err                    335544591L
+#define isc_dsql_invalid_array               335544592L
+#define isc_dsql_max_arr_dim_exceeded        335544593L
+#define isc_dsql_arr_range_error             335544594L
+#define isc_dsql_trigger_err                 335544595L
+#define isc_dsql_subselect_err               335544596L
+#define isc_dsql_crdb_prepare_err            335544597L
+#define isc_specify_field_err                335544598L
+#define isc_num_field_err                    335544599L
+#define isc_col_name_err                     335544600L
+#define isc_where_err                        335544601L
+#define isc_table_view_err                   335544602L
+#define isc_distinct_err                     335544603L
+#define isc_key_field_count_err              335544604L
+#define isc_subquery_err                     335544605L
+#define isc_expression_eval_err              335544606L
+#define isc_node_err                         335544607L
+#define isc_command_end_err                  335544608L
+#define isc_index_name                       335544609L
+#define isc_exception_name                   335544610L
+#define isc_field_name                       335544611L
+#define isc_token_err                        335544612L
+#define isc_union_err                        335544613L
+#define isc_dsql_construct_err               335544614L
+#define isc_field_aggregate_err              335544615L
+#define isc_field_ref_err                    335544616L
+#define isc_order_by_err                     335544617L
+#define isc_return_mode_err                  335544618L
+#define isc_extern_func_err                  335544619L
+#define isc_alias_conflict_err               335544620L
+#define isc_procedure_conflict_error         335544621L
+#define isc_relation_conflict_err            335544622L
+#define isc_dsql_domain_err                  335544623L
+#define isc_idx_seg_err                      335544624L
+#define isc_node_name_err                    335544625L
+#define isc_table_name                       335544626L
+#define isc_proc_name                        335544627L
+#define isc_idx_create_err                   335544628L
+#define isc_wal_shadow_err                   335544629L
+#define isc_dependency                       335544630L
+#define isc_idx_key_err                      335544631L
+#define isc_dsql_file_length_err             335544632L
+#define isc_dsql_shadow_number_err           335544633L
+#define isc_dsql_token_unk_err               335544634L
+#define isc_dsql_no_relation_alias           335544635L
+#define isc_indexname                        335544636L
+#define isc_no_stream_plan                   335544637L
+#define isc_stream_twice                     335544638L
+#define isc_stream_not_found                 335544639L
+#define isc_collation_requires_text          335544640L
+#define isc_dsql_domain_not_found            335544641L
+#define isc_index_unused                     335544642L
+#define isc_dsql_self_join                   335544643L
+#define isc_stream_bof                       335544644L
+#define isc_stream_crack                     335544645L
+#define isc_db_or_file_exists                335544646L
+#define isc_invalid_operator                 335544647L
+#define isc_conn_lost                        335544648L
+#define isc_bad_checksum                     335544649L
+#define isc_page_type_err                    335544650L
+#define isc_ext_readonly_err                 335544651L
+#define isc_sing_select_err                  335544652L
+#define isc_psw_attach                       335544653L
+#define isc_psw_start_trans                  335544654L
+#define isc_invalid_direction                335544655L
+#define isc_dsql_var_conflict                335544656L
+#define isc_dsql_no_blob_array               335544657L
+#define isc_dsql_base_table                  335544658L
+#define isc_duplicate_base_table             335544659L
+#define isc_view_alias                       335544660L
+#define isc_index_root_page_full             335544661L
+#define isc_dsql_blob_type_unknown           335544662L
+#define isc_req_max_clones_exceeded          335544663L
+#define isc_dsql_duplicate_spec              335544664L
+#define isc_unique_key_violation             335544665L
+#define isc_srvr_version_too_old             335544666L
+#define isc_drdb_completed_with_errs         335544667L
+#define isc_dsql_procedure_use_err           335544668L
+#define isc_dsql_count_mismatch              335544669L
+#define isc_blob_idx_err                     335544670L
+#define isc_array_idx_err                    335544671L
+#define isc_key_field_err                    335544672L
+#define isc_no_delete                        335544673L
+#define isc_del_last_field                   335544674L
+#define isc_sort_err                         335544675L
+#define isc_sort_mem_err                     335544676L
+#define isc_version_err                      335544677L
+#define isc_inval_key_posn                   335544678L
+#define isc_no_segments_err                  335544679L
+#define isc_crrp_data_err                    335544680L
+#define isc_rec_size_err                     335544681L
+#define isc_dsql_field_ref                   335544682L
+#define isc_req_depth_exceeded               335544683L
+#define isc_no_field_access                  335544684L
+#define isc_no_dbkey                         335544685L
+#define isc_jrn_format_err                   335544686L
+#define isc_jrn_file_full                    335544687L
+#define isc_dsql_open_cursor_request         335544688L
+#define isc_ib_error                         335544689L
+#define isc_cache_redef                      335544690L
+#define isc_cache_too_small                  335544691L
+#define isc_log_redef                        335544692L
+#define isc_log_too_small                    335544693L
+#define isc_partition_too_small              335544694L
+#define isc_partition_not_supp               335544695L
+#define isc_log_length_spec                  335544696L
+#define isc_precision_err                    335544697L
+#define isc_scale_nogt                       335544698L
+#define isc_expec_short                      335544699L
+#define isc_expec_long                       335544700L
+#define isc_expec_ushort                     335544701L
+#define isc_like_escape_invalid              335544702L
+#define isc_svcnoexe                         335544703L
+#define isc_net_lookup_err                   335544704L
+#define isc_service_unknown                  335544705L
+#define isc_host_unknown                     335544706L
+#define isc_grant_nopriv_on_base             335544707L
+#define isc_dyn_fld_ambiguous                335544708L
+#define isc_dsql_agg_ref_err                 335544709L
+#define isc_complex_view                     335544710L
+#define isc_unprepared_stmt                  335544711L
+#define isc_expec_positive                   335544712L
+#define isc_dsql_sqlda_value_err             335544713L
+#define isc_invalid_array_id                 335544714L
+#define isc_extfile_uns_op                   335544715L
+#define isc_svc_in_use                       335544716L
+#define isc_err_stack_limit                  335544717L
+#define isc_invalid_key                      335544718L
+#define isc_net_init_error                   335544719L
+#define isc_loadlib_failure                  335544720L
+#define isc_network_error                    335544721L
+#define isc_net_connect_err                  335544722L
+#define isc_net_connect_listen_err           335544723L
+#define isc_net_event_connect_err            335544724L
+#define isc_net_event_listen_err             335544725L
+#define isc_net_read_err                     335544726L
+#define isc_net_write_err                    335544727L
+#define isc_integ_index_deactivate           335544728L
+#define isc_integ_deactivate_primary         335544729L
+#define isc_cse_not_supported                335544730L
+#define isc_tra_must_sweep                   335544731L
+#define isc_unsupported_network_drive        335544732L
+#define isc_io_create_err                    335544733L
+#define isc_io_open_err                      335544734L
+#define isc_io_close_err                     335544735L
+#define isc_io_read_err                      335544736L
+#define isc_io_write_err                     335544737L
+#define isc_io_delete_err                    335544738L
+#define isc_io_access_err                    335544739L
+#define isc_udf_exception                    335544740L
+#define isc_lost_db_connection               335544741L
+#define isc_no_write_user_priv               335544742L
+#define isc_token_too_long                   335544743L
+#define isc_max_att_exceeded                 335544744L
+#define isc_login_same_as_role_name          335544745L
+#define isc_reftable_requires_pk             335544746L
+#define isc_usrname_too_long                 335544747L
+#define isc_password_too_long                335544748L
+#define isc_usrname_required                 335544749L
+#define isc_password_required                335544750L
+#define isc_bad_protocol                     335544751L
+#define isc_dup_usrname_found                335544752L
+#define isc_usrname_not_found                335544753L
+#define isc_error_adding_sec_record          335544754L
+#define isc_error_modifying_sec_record       335544755L
+#define isc_error_deleting_sec_record        335544756L
+#define isc_error_updating_sec_db            335544757L
+#define isc_sort_rec_size_err                335544758L
+#define isc_bad_default_value                335544759L
+#define isc_invalid_clause                   335544760L
+#define isc_too_many_handles                 335544761L
+#define isc_optimizer_blk_exc                335544762L
+#define isc_invalid_string_constant          335544763L
+#define isc_transitional_date                335544764L
+#define isc_read_only_database               335544765L
+#define isc_must_be_dialect_2_and_up         335544766L
+#define isc_blob_filter_exception            335544767L
+#define isc_exception_access_violation       335544768L
+#define isc_exception_datatype_missalignment 335544769L
+#define isc_exception_array_bounds_exceeded  335544770L
+#define isc_exception_float_denormal_operand 335544771L
+#define isc_exception_float_divide_by_zero   335544772L
+#define isc_exception_float_inexact_result   335544773L
+#define isc_exception_float_invalid_operand  335544774L
+#define isc_exception_float_overflow         335544775L
+#define isc_exception_float_stack_check      335544776L
+#define isc_exception_float_underflow        335544777L
+#define isc_exception_integer_divide_by_zero 335544778L
+#define isc_exception_integer_overflow       335544779L
+#define isc_exception_unknown                335544780L
+#define isc_exception_stack_overflow         335544781L
+#define isc_exception_sigsegv                335544782L
+#define isc_exception_sigill                 335544783L
+#define isc_exception_sigbus                 335544784L
+#define isc_exception_sigfpe                 335544785L
+#define isc_ext_file_delete                  335544786L
+#define isc_ext_file_modify                  335544787L
+#define isc_adm_task_denied                  335544788L
+#define isc_extract_input_mismatch           335544789L
+#define isc_insufficient_svc_privileges      335544790L
+#define isc_file_in_use                      335544791L
+#define isc_service_att_err                  335544792L
+#define isc_ddl_not_allowed_by_db_sql_dial   335544793L
+#define isc_cancelled                        335544794L
+#define isc_unexp_spb_form                   335544795L
+#define isc_sql_dialect_datatype_unsupport   335544796L
+#define isc_svcnouser                        335544797L
+#define isc_depend_on_uncommitted_rel        335544798L
+#define isc_svc_name_missing                 335544799L
+#define isc_too_many_contexts                335544800L
+#define isc_datype_notsup                    335544801L
+#define isc_dialect_reset_warning            335544802L
+#define isc_dialect_not_changed              335544803L
+#define isc_database_create_failed           335544804L
+#define isc_inv_dialect_specified            335544805L
+#define isc_valid_db_dialects                335544806L
+#define isc_sqlwarn                          335544807L
+#define isc_dtype_renamed                    335544808L
+#define isc_extern_func_dir_error            335544809L
+#define isc_date_range_exceeded              335544810L
+#define isc_inv_client_dialect_specified     335544811L
+#define isc_valid_client_dialects            335544812L
+#define isc_optimizer_between_err            335544813L
+#define isc_service_not_supported            335544814L
+#define isc_generator_name                   335544815L
+#define isc_udf_name                         335544816L
+#define isc_bad_limit_param                  335544817L
+#define isc_bad_skip_param                   335544818L
+#define isc_io_32bit_exceeded_err            335544819L
+#define isc_invalid_savepoint                335544820L
+#define isc_dsql_column_pos_err              335544821L
+#define isc_dsql_agg_where_err               335544822L
+#define isc_dsql_agg_group_err               335544823L
+#define isc_dsql_agg_column_err              335544824L
+#define isc_dsql_agg_having_err              335544825L
+#define isc_dsql_agg_nested_err              335544826L
+#define isc_exec_sql_invalid_arg             335544827L
+#define isc_exec_sql_invalid_req             335544828L
+#define isc_exec_sql_invalid_var             335544829L
+#define isc_exec_sql_max_call_exceeded       335544830L
+#define isc_conf_access_denied               335544831L
+#define isc_wrong_backup_state               335544832L
+#define isc_wal_backup_err                   335544833L
+#define isc_cursor_not_open                  335544834L
+#define isc_bad_shutdown_mode                335544835L
+#define isc_concat_overflow                  335544836L
+#define isc_bad_substring_offset             335544837L
+#define isc_foreign_key_target_doesnt_exist  335544838L
+#define isc_foreign_key_references_present   335544839L
+#define isc_no_update                        335544840L
+#define isc_cursor_already_open              335544841L
+#define isc_stack_trace                      335544842L
+#define isc_ctx_var_not_found                335544843L
+#define isc_ctx_namespace_invalid            335544844L
+#define isc_ctx_too_big                      335544845L
+#define isc_ctx_bad_argument                 335544846L
+#define isc_identifier_too_long              335544847L
+#define isc_except2                          335544848L
+#define isc_malformed_string                 335544849L
+#define isc_prc_out_param_mismatch           335544850L
+#define isc_command_end_err2                 335544851L
+#define isc_partner_idx_incompat_type        335544852L
+#define isc_bad_substring_length             335544853L
+#define isc_charset_not_installed            335544854L
+#define isc_collation_not_installed          335544855L
+#define isc_att_shutdown                     335544856L
+#define isc_blobtoobig                       335544857L
+#define isc_must_have_phys_field             335544858L
+#define isc_invalid_time_precision           335544859L
+#define isc_blob_convert_error               335544860L
+#define isc_array_convert_error              335544861L
+#define isc_record_lock_not_supp             335544862L
+#define isc_partner_idx_not_found            335544863L
+#define isc_tra_num_exc                      335544864L
+#define isc_field_disappeared                335544865L
+#define isc_gfix_db_name                     335740929L
+#define isc_gfix_invalid_sw                  335740930L
+#define isc_gfix_incmp_sw                    335740932L
+#define isc_gfix_replay_req                  335740933L
+#define isc_gfix_pgbuf_req                   335740934L
+#define isc_gfix_val_req                     335740935L
+#define isc_gfix_pval_req                    335740936L
+#define isc_gfix_trn_req                     335740937L
+#define isc_gfix_full_req                    335740940L
+#define isc_gfix_usrname_req                 335740941L
+#define isc_gfix_pass_req                    335740942L
+#define isc_gfix_subs_name                   335740943L
+#define isc_gfix_wal_req                     335740944L
+#define isc_gfix_sec_req                     335740945L
+#define isc_gfix_nval_req                    335740946L
+#define isc_gfix_type_shut                   335740947L
+#define isc_gfix_retry                       335740948L
+#define isc_gfix_retry_db                    335740951L
+#define isc_gfix_exceed_max                  335740991L
+#define isc_gfix_corrupt_pool                335740992L
+#define isc_gfix_mem_exhausted               335740993L
+#define isc_gfix_bad_pool                    335740994L
+#define isc_gfix_trn_not_valid               335740995L
+#define isc_gfix_unexp_eoi                   335741012L
+#define isc_gfix_recon_fail                  335741018L
+#define isc_gfix_trn_unknown                 335741036L
+#define isc_gfix_mode_req                    335741038L
+#define isc_gfix_opt_SQL_dialect             335741039L
+#define isc_gfix_pzval_req                   335741042L
+#define isc_dsql_dbkey_from_non_table        336003074L
+#define isc_dsql_transitional_numeric        336003075L
+#define isc_dsql_dialect_warning_expr        336003076L
+#define isc_sql_db_dialect_dtype_unsupport   336003077L
+#define isc_isc_sql_dialect_conflict_num     336003079L
+#define isc_dsql_warning_number_ambiguous    336003080L
+#define isc_dsql_warning_number_ambiguous1   336003081L
+#define isc_dsql_warn_precision_ambiguous    336003082L
+#define isc_dsql_warn_precision_ambiguous1   336003083L
+#define isc_dsql_warn_precision_ambiguous2   336003084L
+#define isc_dsql_ambiguous_field_name        336003085L
+#define isc_dsql_udf_return_pos_err          336003086L
+#define isc_dsql_invalid_label               336003087L
+#define isc_dsql_datatypes_not_comparable    336003088L
+#define isc_dsql_cursor_invalid              336003089L
+#define isc_dsql_cursor_redefined            336003090L
+#define isc_dsql_cursor_not_found            336003091L
+#define isc_dsql_cursor_exists               336003092L
+#define isc_dsql_cursor_rel_ambiguous        336003093L
+#define isc_dsql_cursor_rel_not_found        336003094L
+#define isc_dsql_cursor_not_open             336003095L
+#define isc_dsql_type_not_supp_ext_tab       336003096L
+#define isc_dyn_role_does_not_exist          336068796L
+#define isc_dyn_no_grant_admin_opt           336068797L
+#define isc_dyn_user_not_role_member         336068798L
+#define isc_dyn_delete_role_failed           336068799L
+#define isc_dyn_grant_role_to_user           336068800L
+#define isc_dyn_inv_sql_role_name            336068801L
+#define isc_dyn_dup_sql_role                 336068802L
+#define isc_dyn_kywd_spec_for_role           336068803L
+#define isc_dyn_roles_not_supported          336068804L
+#define isc_dyn_domain_name_exists           336068812L
+#define isc_dyn_field_name_exists            336068813L
+#define isc_dyn_dependency_exists            336068814L
+#define isc_dyn_dtype_invalid                336068815L
+#define isc_dyn_char_fld_too_small           336068816L
+#define isc_dyn_invalid_dtype_conversion     336068817L
+#define isc_dyn_dtype_conv_invalid           336068818L
+#define isc_dyn_zero_len_id                  336068820L
+#define isc_gbak_unknown_switch              336330753L
+#define isc_gbak_page_size_missing           336330754L
+#define isc_gbak_page_size_toobig            336330755L
+#define isc_gbak_redir_ouput_missing         336330756L
+#define isc_gbak_switches_conflict           336330757L
+#define isc_gbak_unknown_device              336330758L
+#define isc_gbak_no_protection               336330759L
+#define isc_gbak_page_size_not_allowed       336330760L
+#define isc_gbak_multi_source_dest           336330761L
+#define isc_gbak_filename_missing            336330762L
+#define isc_gbak_dup_inout_names             336330763L
+#define isc_gbak_inv_page_size               336330764L
+#define isc_gbak_db_specified                336330765L
+#define isc_gbak_db_exists                   336330766L
+#define isc_gbak_unk_device                  336330767L
+#define isc_gbak_blob_info_failed            336330772L
+#define isc_gbak_unk_blob_item               336330773L
+#define isc_gbak_get_seg_failed              336330774L
+#define isc_gbak_close_blob_failed           336330775L
+#define isc_gbak_open_blob_failed            336330776L
+#define isc_gbak_put_blr_gen_id_failed       336330777L
+#define isc_gbak_unk_type                    336330778L
+#define isc_gbak_comp_req_failed             336330779L
+#define isc_gbak_start_req_failed            336330780L
+#define isc_gbak_rec_failed                  336330781L
+#define isc_gbak_rel_req_failed              336330782L
+#define isc_gbak_db_info_failed              336330783L
+#define isc_gbak_no_db_desc                  336330784L
+#define isc_gbak_db_create_failed            336330785L
+#define isc_gbak_decomp_len_error            336330786L
+#define isc_gbak_tbl_missing                 336330787L
+#define isc_gbak_blob_col_missing            336330788L
+#define isc_gbak_create_blob_failed          336330789L
+#define isc_gbak_put_seg_failed              336330790L
+#define isc_gbak_rec_len_exp                 336330791L
+#define isc_gbak_inv_rec_len                 336330792L
+#define isc_gbak_exp_data_type               336330793L
+#define isc_gbak_gen_id_failed               336330794L
+#define isc_gbak_unk_rec_type                336330795L
+#define isc_gbak_inv_bkup_ver                336330796L
+#define isc_gbak_missing_bkup_desc           336330797L
+#define isc_gbak_string_trunc                336330798L
+#define isc_gbak_cant_rest_record            336330799L
+#define isc_gbak_send_failed                 336330800L
+#define isc_gbak_no_tbl_name                 336330801L
+#define isc_gbak_unexp_eof                   336330802L
+#define isc_gbak_db_format_too_old           336330803L
+#define isc_gbak_inv_array_dim               336330804L
+#define isc_gbak_xdr_len_expected            336330807L
+#define isc_gbak_open_bkup_error             336330817L
+#define isc_gbak_open_error                  336330818L
+#define isc_gbak_missing_block_fac           336330934L
+#define isc_gbak_inv_block_fac               336330935L
+#define isc_gbak_block_fac_specified         336330936L
+#define isc_gbak_missing_username            336330940L
+#define isc_gbak_missing_password            336330941L
+#define isc_gbak_missing_skipped_bytes       336330952L
+#define isc_gbak_inv_skipped_bytes           336330953L
+#define isc_gbak_err_restore_charset         336330965L
+#define isc_gbak_err_restore_collation       336330967L
+#define isc_gbak_read_error                  336330972L
+#define isc_gbak_write_error                 336330973L
+#define isc_gbak_db_in_use                   336330985L
+#define isc_gbak_sysmemex                    336330990L
+#define isc_gbak_restore_role_failed         336331002L
+#define isc_gbak_role_op_missing             336331005L
+#define isc_gbak_page_buffers_missing        336331010L
+#define isc_gbak_page_buffers_wrong_param    336331011L
+#define isc_gbak_page_buffers_restore        336331012L
+#define isc_gbak_inv_size                    336331014L
+#define isc_gbak_file_outof_sequence         336331015L
+#define isc_gbak_join_file_missing           336331016L
+#define isc_gbak_stdin_not_supptd            336331017L
+#define isc_gbak_stdout_not_supptd           336331018L
+#define isc_gbak_bkup_corrupt                336331019L
+#define isc_gbak_unk_db_file_spec            336331020L
+#define isc_gbak_hdr_write_failed            336331021L
+#define isc_gbak_disk_space_ex               336331022L
+#define isc_gbak_size_lt_min                 336331023L
+#define isc_gbak_svc_name_missing            336331025L
+#define isc_gbak_not_ownr                    336331026L
+#define isc_gbak_mode_req                    336331031L
+#define isc_gbak_just_data                   336331033L
+#define isc_gbak_data_only                   336331034L
+#define isc_dsql_too_old_ods                 336397205L
+#define isc_dsql_table_not_found             336397206L
+#define isc_dsql_view_not_found              336397207L
+#define isc_dsql_line_col_error              336397208L
+#define isc_dsql_unknown_pos                 336397209L
+#define isc_dsql_no_dup_name                 336397210L
+#define isc_dsql_too_many_values             336397211L
+#define isc_gsec_cant_open_db                336723983L
+#define isc_gsec_switches_error              336723984L
+#define isc_gsec_no_op_spec                  336723985L
+#define isc_gsec_no_usr_name                 336723986L
+#define isc_gsec_err_add                     336723987L
+#define isc_gsec_err_modify                  336723988L
+#define isc_gsec_err_find_mod                336723989L
+#define isc_gsec_err_rec_not_found           336723990L
+#define isc_gsec_err_delete                  336723991L
+#define isc_gsec_err_find_del                336723992L
+#define isc_gsec_err_find_disp               336723996L
+#define isc_gsec_inv_param                   336723997L
+#define isc_gsec_op_specified                336723998L
+#define isc_gsec_pw_specified                336723999L
+#define isc_gsec_uid_specified               336724000L
+#define isc_gsec_gid_specified               336724001L
+#define isc_gsec_proj_specified              336724002L
+#define isc_gsec_org_specified               336724003L
+#define isc_gsec_fname_specified             336724004L
+#define isc_gsec_mname_specified             336724005L
+#define isc_gsec_lname_specified             336724006L
+#define isc_gsec_inv_switch                  336724008L
+#define isc_gsec_amb_switch                  336724009L
+#define isc_gsec_no_op_specified             336724010L
+#define isc_gsec_params_not_allowed          336724011L
+#define isc_gsec_incompat_switch             336724012L
+#define isc_gsec_inv_username                336724044L
+#define isc_gsec_inv_pw_length               336724045L
+#define isc_gsec_db_specified                336724046L
+#define isc_gsec_db_admin_specified          336724047L
+#define isc_gsec_db_admin_pw_specified       336724048L
+#define isc_gsec_sql_role_specified          336724049L
+#define isc_license_no_file                  336789504L
+#define isc_license_op_specified             336789523L
+#define isc_license_op_missing               336789524L
+#define isc_license_inv_switch               336789525L
+#define isc_license_inv_switch_combo         336789526L
+#define isc_license_inv_op_combo             336789527L
+#define isc_license_amb_switch               336789528L
+#define isc_license_inv_parameter            336789529L
+#define isc_license_param_specified          336789530L
+#define isc_license_param_req                336789531L
+#define isc_license_syntx_error              336789532L
+#define isc_license_dup_id                   336789534L
+#define isc_license_inv_id_key               336789535L
+#define isc_license_err_remove               336789536L
+#define isc_license_err_update               336789537L
+#define isc_license_err_convert              336789538L
+#define isc_license_err_unk                  336789539L
+#define isc_license_svc_err_add              336789540L
+#define isc_license_svc_err_remove           336789541L
+#define isc_license_eval_exists              336789563L
+#define isc_gstat_unknown_switch             336920577L
+#define isc_gstat_retry                      336920578L
+#define isc_gstat_wrong_ods                  336920579L
+#define isc_gstat_unexpected_eof             336920580L
+#define isc_gstat_open_err                   336920605L
+#define isc_gstat_read_err                   336920606L
+#define isc_gstat_sysmemex                   336920607L
+#define isc_err_max                          763
+
+#endif
+
+#endif /* JRD_GEN_IBERROR_H */
diff --git a/src/terralib/drivers/Firebird/ibpp/core/ibpp.h b/src/terralib/drivers/Firebird/ibpp/core/ibpp.h
new file mode 100644
index 0000000..0d19cd7
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/ibpp.h
@@ -0,0 +1,930 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: ibpp.h 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP public header file. This is _the_ only file you include in
+//			  your application files when developing with IBPP.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+//	Contributor(s):
+//
+//		Olivier Mascia, main coding
+//		Matt Hortman, initial linux port
+//		Mark Jordan, design contributions
+//		Maxim Abrashkin, enhancement patches
+//		Torsten Martinsen, enhancement patches
+//		Michael Hieke, darwin (OS X) port, enhancement patches
+//		Val Samko, enhancement patches and debugging
+//		Mike Nordell, invaluable C++ advices
+//		Claudio Valderrama, help with not-so-well documented IB/FB features
+//		Many others, excellent suggestions, bug finding, and support
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	Tabulations should be set every four characters when editing this file.
+//
+//	When compiling a project using IBPP, the following defines should be made
+//	on the command-line (or in makefiles) according to the OS platform and
+//	compiler used.
+//
+//	Select the platform:	IBPP_WINDOWS | IBPP_LINUX | IBPP_DARWIN
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef __IBPP_H__
+#define __IBPP_H__
+
+#if !defined(IBPP_WINDOWS) && !defined(IBPP_LINUX) && !defined(IBPP_DARWIN)
+#error Please define IBPP_WINDOWS/IBPP_LINUX/IBPP_DARWIN before compiling !
+#endif
+
+#if !defined(__BCPLUSPLUS__) && !defined(__GNUC__) \
+	&& !defined(_MSC_VER) && !defined(__DMC__)
+#error Your compiler is not recognized.
+#endif
+
+#if defined(IBPP_LINUX) || defined(IBPP_DARWIN)
+#define IBPP_UNIX	// IBPP_UNIX stands as a common denominator to *NIX flavours
+#endif
+
+// IBPP is written for 32 bits systems or higher.
+// The standard type 'int' is assumed to be at least 32 bits.
+// And the standard type 'short' is assumed to be exactly 16 bits.
+// Everywhere possible, where the exact size of an integer does not matter,
+// the standard type 'int' is used. And where an exact integer size is required
+// the standard exact precision types definitions of C 99 standard are used.
+
+#if defined(_MSC_VER) || defined(__DMC__) || defined(__BCPLUSPLUS__)
+// C99 �7.18.1.1 Exact-width integer types (only those used by IBPP)
+#if defined(_MSC_VER) && (_MSC_VER < 1300)	// MSVC 6 should be < 1300
+	typedef short int16_t;
+	typedef int int32_t;
+	typedef unsigned int uint32_t;
+#else
+	typedef __int16 int16_t;
+	typedef __int32 int32_t;
+	typedef unsigned __int32 uint32_t;
+#endif
+	typedef __int64 int64_t;
+#else
+	#include <stdint.h>			// C99 (�7.18) integer types definitions
+#endif
+
+#if !defined(_)
+#define _(s)	s
+#endif
+
+#include <exception>
+#include <string>
+#include <vector>
+
+namespace IBPP
+{
+	//	Typically you use this constant in a call IBPP::CheckVersion as in:
+	//	if (! IBPP::CheckVersion(IBPP::Version)) { throw .... ; }
+	const uint32_t Version = (2<<24) + (5<<16) + (3<<8) + 1; // Version == 2.5.3.1
+
+	//	Dates range checking
+	const int MinDate = -693594;	//  1 JAN 0001
+	const int MaxDate = 2958464;	// 31 DEC 9999
+	
+	//	Transaction Access Modes
+	enum TAM {amWrite, amRead};
+
+	//	Transaction Isolation Levels
+	enum TIL {ilConcurrency, ilReadDirty, ilReadCommitted, ilConsistency};
+
+	//	Transaction Lock Resolution
+	enum TLR {lrWait, lrNoWait};
+
+	// Transaction Table Reservation
+	enum TTR {trSharedWrite, trSharedRead, trProtectedWrite, trProtectedRead};
+
+	//	Prepared Statement Types
+	enum STT {stUnknown, stUnsupported,
+		stSelect, stInsert, stUpdate, stDelete,	stDDL, stExecProcedure,
+		stSelectUpdate, stSetGenerator, stSavePoint};
+
+	//	SQL Data Types
+	enum SDT {sdArray, sdBlob, sdDate, sdTime, sdTimestamp, sdString,
+		sdSmallint, sdInteger, sdLargeint, sdFloat, sdDouble};
+
+	//	Array Data Types
+	enum ADT {adDate, adTime, adTimestamp, adString,
+		adBool, adInt16, adInt32, adInt64, adFloat, adDouble};
+
+	// Database::Shutdown Modes
+	enum DSM {dsForce, dsDenyTrans, dsDenyAttach};
+
+	// Service::StartBackup && Service::StartRestore Flags
+	enum BRF {
+		brVerbose = 0x1,
+		// Backup flags
+		brIgnoreChecksums = 0x100, brIgnoreLimbo = 0x200,
+		brMetadataOnly = 0x400, brNoGarbageCollect = 0x800,
+		brNonTransportable = 0x1000, brConvertExtTables = 0x2000,
+		// Restore flags
+		brReplace = 0x10000, brDeactivateIdx = 0x20000,
+		brNoShadow = 0x40000, brNoValidity = 0x80000,
+		brPerTableCommit = 0x100000, brUseAllSpace = 0x200000
+	};
+
+	// Service::Repair Flags
+	enum RPF
+	{
+		// Mandatory and mutually exclusives
+		rpMendRecords = 0x1, rpValidatePages = 0x2, rpValidateFull = 0x4,
+		// Options
+		rpReadOnly = 0x100, rpIgnoreChecksums = 0x200, rpKillShadows = 0x400
+	};
+
+	// TransactionFactory Flags
+	enum TFF {tfIgnoreLimbo = 0x1, tfAutoCommit = 0x2, tfNoAutoUndo = 0x4};
+
+	/* IBPP never return any error codes. It throws exceptions.
+	 * On database engine reported errors, an IBPP::SQLException is thrown.
+	 * In all other cases, IBPP throws IBPP::LogicException.
+	 * Also note that the runtime and the language might also throw exceptions
+	 * while executing some IBPP methods. A failing new operator will throw
+	 * std::bad_alloc, IBPP does nothing to alter the standard behaviour.
+	 *
+	 *                    std::exception
+	 *                           |
+	 *                   IBPP::Exception
+	 *                 /                 \
+	 *    IBPP::LogicException    IBPP::SQLException
+	 *             |
+	 *      IBPP::WrongType
+	 */
+
+	class Exception : public std::exception
+	{
+	public:
+		virtual const char* Origin() const throw() = 0;
+		virtual const char* ErrorMessage() const throw() = 0;	// Deprecated, use what()
+		virtual const char* what() const throw() = 0;
+		virtual ~Exception() throw();
+	};
+
+	class LogicException : public Exception
+	{
+	public:
+		virtual ~LogicException() throw();
+	};
+
+	class SQLException : public Exception
+	{
+	public:
+		virtual int SqlCode() const throw() = 0;
+		virtual int EngineCode() const throw() = 0;
+		
+		virtual ~SQLException() throw();
+	};
+
+	class WrongType : public LogicException
+	{
+	public:
+		virtual ~WrongType() throw();
+	};
+	
+	/* Classes Date, Time, Timestamp and DBKey are 'helper' classes.  They help
+	 * in retrieving or setting some special SQL types. Dates, times and dbkeys
+	 * are often read and written as strings in SQL scripts. When programming
+	 * with IBPP, we handle those data with these specific classes, which
+	 * enhance their usefullness and free us of format problems (M/D/Y, D/M/Y,
+	 * Y-M-D ?, and so on...). */
+
+	/* Class Date represent purely a Date (no time part specified). It is
+	 * usefull in interactions with the SQL DATE type of Interbase.  You can add
+	 * or substract a number from a Date, that will modify it to represent the
+	 * correct date, X days later or sooner. All the Y2K details taken into
+	 * account.
+	 * The full range goes from integer values IBPP::MinDate to IBPP::MaxDate
+	 * which means from 01 Jan 0001 to 31 Dec 9999. ( Which is inherently
+	 * incorrect as this assumes Gregorian calendar. ) */
+	
+	class Timestamp;	// Cross-reference between Timestamp, Date and Time
+	
+	class Date
+	{
+	protected:
+		int mDate;	// The date : 1 == 1 Jan 1900
+
+	public:
+		void Clear()	{ mDate = MinDate - 1; };
+		void Today();
+		void SetDate(int year, int month, int day);
+		void SetDate(int dt);
+		void GetDate(int& year, int& month, int& day) const;
+		int GetDate() const	{ return mDate; }
+		int Year() const;
+		int Month() const;
+		int Day() const;
+		void Add(int days);
+		void StartOfMonth();
+		void EndOfMonth();
+	
+		Date()			{ Clear(); };
+		Date(int dt)	{ SetDate(dt); }
+		Date(int year, int month, int day);
+		Date(const Date&);							// Copy Constructor
+		Date& operator=(const Timestamp&);			// Timestamp Assignment operator
+		Date& operator=(const Date&);				// Date Assignment operator
+
+		bool operator==(const Date& rv)	const { return mDate == rv.GetDate(); }
+		bool operator!=(const Date& rv)	const { return mDate != rv.GetDate(); }
+		bool operator<(const Date& rv) const { return mDate < rv.GetDate(); }
+		bool operator>(const Date& rv) const { return mDate > rv.GetDate(); }
+
+		virtual ~Date() { };
+	};
+
+	/* Class Time represent purely a Time. It is usefull in interactions
+	 * with the SQL TIME type of Interbase. */
+
+	class Time
+	{
+	protected:
+		int mTime;	// The time, in ten-thousandths of seconds since midnight
+
+	public:
+		void Clear()	{ mTime = 0; }
+		void Now();
+		void SetTime(int hour, int minute, int second, int tenthousandths = 0);
+		void SetTime(int tm);
+		void GetTime(int& hour, int& minute, int& second) const;
+		void GetTime(int& hour, int& minute, int& second, int& tenthousandths) const;
+		int GetTime() const	{ return mTime; }
+		int Hours() const;
+		int Minutes() const;
+		int Seconds() const;
+		int SubSeconds() const;		// Actually tenthousandths of seconds
+		Time()			{ Clear(); }
+		Time(int tm)	{ SetTime(tm); }
+		Time(int hour, int minute, int second, int tenthousandths = 0);
+		Time(const Time&);							// Copy Constructor
+		Time& operator=(const Timestamp&);			// Timestamp Assignment operator
+		Time& operator=(const Time&);				// Time Assignment operator
+
+		bool operator==(const Time& rv)	const { return mTime == rv.GetTime(); }
+		bool operator!=(const Time& rv)	const { return mTime != rv.GetTime(); }
+		bool operator<(const Time& rv) const { return mTime < rv.GetTime(); }
+		bool operator>(const Time& rv) const { return mTime > rv.GetTime(); }
+
+		virtual ~Time() { };
+	};
+
+	/* Class Timestamp represent a date AND a time. It is usefull in
+	 * interactions with the SQL TIMESTAMP type of Interbase. This class
+	 * inherits from Date and Time and completely inline implements its small
+	 * specific details. */
+
+	class Timestamp : public Date, public Time
+	{
+	public:
+		void Clear()	{ Date::Clear(); Time::Clear(); }
+		void Today()	{ Date::Today(); Time::Clear(); }
+		void Now()		{ Date::Today(); Time::Now(); }
+
+		Timestamp()		{ Clear(); }
+
+	  	Timestamp(int y, int m, int d)
+	  		{ Date::SetDate(y, m, d); Time::Clear(); }
+
+		Timestamp(int y, int mo, int d, int h, int mi, int s, int t = 0)
+	  		{ Date::SetDate(y, mo, d); Time::SetTime(h, mi, s, t); }
+
+		Timestamp(const Timestamp& rv)
+			: Date(rv.mDate), Time(rv.mTime) {}	// Copy Constructor
+
+		Timestamp(const Date& rv)
+			{ mDate = rv.GetDate(); mTime = 0; }
+
+		Timestamp(const Time& rv)
+			{ mDate = 0; mTime = rv.GetTime(); }
+
+		Timestamp& operator=(const Timestamp& rv)	// Timestamp Assignment operator
+			{ mDate = rv.mDate; mTime = rv.mTime; return *this; }
+
+		Timestamp& operator=(const Date& rv)		// Date Assignment operator
+			{ mDate = rv.GetDate(); return *this; }
+
+		Timestamp& operator=(const Time& rv)		// Time Assignment operator
+			{ mTime = rv.GetTime(); return *this; }
+
+		bool operator==(const Timestamp& rv) const
+			{ return (mDate == rv.GetDate()) && (mTime == rv.GetTime()); }
+
+		bool operator!=(const Timestamp& rv) const
+			{ return (mDate != rv.GetDate()) || (mTime != rv.GetTime()); }
+
+		bool operator<(const Timestamp& rv) const
+			{ return (mDate < rv.GetDate()) ||
+				(mDate == rv.GetDate() && mTime < rv.GetTime()); }
+
+		bool operator>(const Timestamp& rv) const
+			{ return (mDate > rv.GetDate()) ||
+				(mDate == rv.GetDate() && mTime > rv.GetTime()); }
+
+		~Timestamp() { }
+	};
+
+	/* Class DBKey can store a DBKEY, that special value which the hidden
+	 * RDB$DBKEY can give you from a select statement. A DBKey is nothing
+	 * specific to IBPP. It's a feature of the Firebird database engine. See its
+	 * documentation for more information. */
+
+	class DBKey
+	{
+	private:
+		std::string mDBKey;			// Stores the binary DBKey
+		mutable std::string mString;// String (temporary) representation of it
+
+	public:
+		void Clear();
+		int Size() const	{ return (int)mDBKey.size(); }
+		void SetKey(const void*, int size);
+		void GetKey(void*, int size) const;
+		const char* AsString() const;
+
+		DBKey& operator=(const DBKey&);	// Assignment operator
+		DBKey(const DBKey&);			// Copy Constructor
+		DBKey() { }
+		~DBKey() { }
+	};
+
+	/* Class User wraps all the information about a user that the engine can manage. */
+
+	class User
+	{
+	public:
+		std::string username;
+		std::string password;
+		std::string firstname;
+		std::string middlename;
+		std::string lastname;
+		uint32_t userid;		// Only relevant on unixes
+		uint32_t groupid;		// Only relevant on unixes
+
+	private:
+		void copyfrom(const User& r);
+
+	public:
+		void clear();
+		User& operator=(const User& r)	{ copyfrom(r); return *this; }
+		User(const User& r)				{ copyfrom(r); }
+		User() : userid(0), groupid(0)	{ }
+		~User() { };
+	};
+
+	//	Interface Wrapper
+	template <class T>
+	class Ptr
+	{
+	private:
+		T* mObject;
+
+	public:
+		void clear()
+		{
+			if (mObject != 0) { mObject->Release(); mObject = 0; }
+		}
+
+		T* intf() const						{ return mObject; }
+		T* operator->() const				{ return mObject; }
+
+		bool operator==(const T* p) const	{ return mObject == p; }
+		bool operator==(const Ptr& r) const	{ return mObject == r.mObject; }
+		bool operator!=(const T* p) const	{ return mObject != p; }
+		bool operator!=(const Ptr& r) const	{ return mObject != r.mObject; }
+
+		Ptr& operator=(T* p)
+		{
+			// AddRef _before_ Release gives correct behaviour on self-assigns
+			T* tmp = (p == 0 ? 0 : p->AddRef());	// Take care of 0
+			if (mObject != 0) mObject->Release();
+			mObject = tmp; return *this;
+		}
+
+		Ptr& operator=(const Ptr& r)
+		{
+			// AddRef _before_ Release gives correct behaviour on self-assigns
+			T* tmp = (r.intf() == 0 ? 0 : r->AddRef());// Take care of 0
+			if (mObject != 0) mObject->Release();
+			mObject = tmp; return *this;
+		}
+
+		Ptr(T* p) : mObject(p == 0 ? 0 : p->AddRef()) { }
+		Ptr(const Ptr& r) : mObject(r.intf() == 0 ? 0 : r->AddRef()) {  }
+
+		Ptr() : mObject(0) { }
+		~Ptr() { clear(); }
+	};
+
+	//	--- Interface Classes --- //
+
+	/* Interfaces IBlob, IArray, IService, IDatabase, ITransaction and
+	 * IStatement are at the core of IBPP. Though it is possible to program your
+	 * applications by using theses interfaces directly (as was the case with
+	 * IBPP 1.x), you should refrain from using them and prefer the new IBPP
+	 * Objects Blob, Array, ... (without the I in front). Those new objects are
+	 * typedef'd right after each interface class definition as you can read
+	 * below. If you program using the Blob (instead of the IBlob interface
+	 * itself), you'll never have to care about AddRef/Release and you'll never
+	 * have to care about deleting your objects. */
+
+	class IBlob;			typedef Ptr<IBlob> Blob;
+	class IArray;			typedef Ptr<IArray> Array;
+	class IService;			typedef Ptr<IService> Service;
+	class IDatabase;		typedef Ptr<IDatabase> Database;
+	class ITransaction;		typedef Ptr<ITransaction> Transaction;
+	class IStatement;		typedef Ptr<IStatement> Statement;
+	class IEvents;			typedef Ptr<IEvents> Events;
+	class IRow;				typedef Ptr<IRow> Row;
+
+	/* IBlob is the interface to the blob capabilities of IBPP. Blob is the
+	 * object class you actually use in your programming. In Firebird, at the
+	 * row level, a blob is merely a handle to a blob, stored elsewhere in the
+	 * database. Blob allows you to retrieve such a handle and then read from or
+	 * write to the blob, much in the same manner than you would do with a file. */
+
+	class IBlob
+	{
+	public:
+		virtual void Create() = 0;
+		virtual void Open() = 0;
+		virtual void Close() = 0;
+		virtual void Cancel() = 0;
+		virtual int Read(void*, int size) = 0;
+		virtual void Write(const void*, int size) = 0;
+		virtual void Info(int* Size, int* Largest, int* Segments) = 0;
+	
+		virtual void Save(const std::string& data) = 0;
+		virtual void Load(std::string& data) = 0;
+
+		virtual Database DatabasePtr() const = 0;
+		virtual Transaction TransactionPtr() const = 0;
+
+		virtual IBlob* AddRef() = 0;
+		virtual void Release() = 0;
+
+		virtual ~IBlob() { };
+	};
+
+	/*	IArray is the interface to the array capabilities of IBPP. Array is the
+	* object class you actually use in your programming. With an Array object, you
+	* can create, read and write Interbase Arrays, as a whole or in slices. */
+
+	class IArray
+	{
+	public:
+		virtual void Describe(const std::string& table, const std::string& column) = 0;
+		virtual void ReadTo(ADT, void* buffer, int elemcount) = 0;
+		virtual void WriteFrom(ADT, const void* buffer, int elemcount) = 0;
+		virtual SDT ElementType() = 0;
+		virtual int ElementSize() = 0;
+		virtual int ElementScale() = 0;
+		virtual int Dimensions() = 0;
+		virtual void Bounds(int dim, int* low, int* high) = 0;
+		virtual void SetBounds(int dim, int low, int high) = 0;
+
+		virtual Database DatabasePtr() const = 0;
+		virtual Transaction TransactionPtr() const = 0;
+
+		virtual IArray* AddRef() = 0;
+		virtual void Release() = 0;
+
+		virtual ~IArray() { };
+	};
+
+	/* IService is the interface to the service capabilities of IBPP. Service is
+	 * the object class you actually use in your programming. With a Service
+	 * object, you can do some maintenance work of databases and servers
+	 * (backup, restore, create/update users, ...) */
+
+	class IService
+	{
+	public:
+	    virtual void Connect() = 0;
+		virtual bool Connected() = 0;
+		virtual void Disconnect() = 0;
+
+		virtual void GetVersion(std::string& version) = 0;
+
+		virtual void AddUser(const User&) = 0;
+		virtual void GetUser(User&) = 0;
+		virtual void GetUsers(std::vector<User>&) = 0;
+		virtual void ModifyUser(const User&) = 0;
+		virtual void RemoveUser(const std::string& username) = 0;
+
+		virtual void SetPageBuffers(const std::string& dbfile, int buffers) = 0;
+		virtual void SetSweepInterval(const std::string& dbfile, int sweep) = 0;
+		virtual void SetSyncWrite(const std::string& dbfile, bool) = 0;
+		virtual void SetReadOnly(const std::string& dbfile, bool) = 0;
+		virtual void SetReserveSpace(const std::string& dbfile, bool) = 0;
+
+		virtual void Shutdown(const std::string& dbfile, DSM mode, int sectimeout) = 0;
+		virtual void Restart(const std::string& dbfile) = 0;
+		virtual void Sweep(const std::string& dbfile) = 0;
+		virtual void Repair(const std::string& dbfile, RPF flags) = 0;
+
+		virtual void StartBackup(const std::string& dbfile,
+			const std::string& bkfile, BRF flags = BRF(0)) = 0;
+		virtual void StartRestore(const std::string& bkfile, const std::string& dbfile,
+			int pagesize = 0, BRF flags = BRF(0)) = 0;
+
+		virtual const char* WaitMsg() = 0;	// With reporting (does not block)
+		virtual void Wait() = 0;			// Without reporting (does block)
+
+		virtual IService* AddRef() = 0;
+		virtual void Release() = 0;
+
+		virtual ~IService() { };
+	};
+
+	/*	IDatabase is the interface to the database connections in IBPP. Database
+	 * is the object class you actually use in your programming. With a Database
+	 * object, you can create/drop/connect databases. */
+
+	class EventInterface;	// Cross-reference between EventInterface and IDatabase
+	
+	class IDatabase
+	{
+	public:
+		virtual const char* ServerName() const = 0;
+		virtual const char* DatabaseName() const = 0;
+		virtual const char* Username() const = 0;
+		virtual const char* UserPassword() const = 0;
+		virtual const char* RoleName() const = 0;
+		virtual const char* CharSet() const = 0;
+		virtual const char* CreateParams() const = 0;
+
+		virtual void Info(int* ODS, int* ODSMinor, int* PageSize,
+			int* Pages,	int* Buffers, int* Sweep, bool* Sync,
+			bool* Reserve) = 0;
+		virtual void Statistics(int* Fetches, int* Marks,
+			int* Reads, int* Writes) = 0;
+		virtual void Counts(int* Insert, int* Update, int* Delete, 
+			int* ReadIdx, int* ReadSeq) = 0;
+		virtual void Users(std::vector<std::string>& users) = 0;
+		virtual int Dialect() = 0;
+
+		virtual void Create(int dialect) = 0;
+		virtual void Connect() = 0;
+		virtual bool Connected() = 0;
+		virtual void Inactivate() = 0;
+		virtual void Disconnect() = 0;
+		virtual void Drop() = 0;
+
+		virtual IDatabase* AddRef() = 0;
+		virtual void Release() = 0;
+
+	    virtual ~IDatabase() { };
+	};
+
+	/* ITransaction is the interface to the transaction connections in IBPP.
+	 * Transaction is the object class you actually use in your programming. A
+	 * Transaction object can be associated with more than one Database,
+	 * allowing for distributed transactions spanning multiple databases,
+	 * possibly located on different servers. IBPP is one among the few
+	 * programming interfaces to Firebird that allows you to support distributed
+	 * transactions. */
+
+	class ITransaction
+	{
+	public:
+	    virtual void AttachDatabase(Database db, TAM am = amWrite,
+			TIL il = ilConcurrency, TLR lr = lrWait, TFF flags = TFF(0)) = 0;
+	    virtual void DetachDatabase(Database db) = 0;
+	 	virtual void AddReservation(Database db,
+	 			const std::string& table, TTR tr) = 0;
+
+		virtual void Start() = 0;
+		virtual bool Started() = 0;
+	    virtual void Commit() = 0;
+	    virtual void Rollback() = 0;
+	    virtual void CommitRetain() = 0;
+		virtual void RollbackRetain() = 0;
+
+		virtual ITransaction* AddRef() = 0;
+		virtual void Release() = 0;
+
+	    virtual ~ITransaction() { };
+	};
+
+	/*
+	 *	Class Row can hold all the values of a row (from a SELECT for instance).
+	 */
+
+	class IRow
+	{
+	public:
+		virtual void SetNull(int) = 0;
+		virtual void Set(int, bool) = 0;
+		virtual void Set(int, const void*, int) = 0;		// byte buffers
+		virtual void Set(int, const char*) = 0;				// c-string
+		virtual void Set(int, const std::string&) = 0;
+		virtual void Set(int, int16_t) = 0;
+		virtual void Set(int, int32_t) = 0;
+		virtual void Set(int, int64_t) = 0;
+		virtual void Set(int, float) = 0;
+		virtual void Set(int, double) = 0;
+		virtual void Set(int, const Timestamp&) = 0;
+		virtual void Set(int, const Date&) = 0;
+		virtual void Set(int, const Time&) = 0;
+		virtual void Set(int, const DBKey&) = 0;
+		virtual void Set(int, const Blob&) = 0;
+		virtual void Set(int, const Array&) = 0;
+
+		virtual bool IsNull(int) = 0;
+		virtual bool Get(int, bool&) = 0;
+		virtual bool Get(int, void*, int&) = 0;	// byte buffers
+		virtual bool Get(int, std::string&) = 0;
+		virtual bool Get(int, int16_t&) = 0;
+		virtual bool Get(int, int32_t&) = 0;
+		virtual bool Get(int, int64_t&) = 0;
+		virtual bool Get(int, float&) = 0;
+		virtual bool Get(int, double&) = 0;
+		virtual bool Get(int, Timestamp&) = 0;
+		virtual bool Get(int, Date&) = 0;
+		virtual bool Get(int, Time&) = 0;
+		virtual bool Get(int, DBKey&) = 0;
+		virtual bool Get(int, Blob&) = 0;
+		virtual bool Get(int, Array&) = 0;
+
+		virtual bool IsNull(const std::string&) = 0;
+		virtual bool Get(const std::string&, bool&) = 0;
+		virtual bool Get(const std::string&, void*, int&) = 0;	// byte buffers
+		virtual bool Get(const std::string&, std::string&) = 0;
+		virtual bool Get(const std::string&, int16_t&) = 0;
+		virtual bool Get(const std::string&, int32_t&) = 0;
+		virtual bool Get(const std::string&, int64_t&) = 0;
+		virtual bool Get(const std::string&, float&) = 0;
+		virtual bool Get(const std::string&, double&) = 0;
+		virtual bool Get(const std::string&, Timestamp&) = 0;
+		virtual bool Get(const std::string&, Date&) = 0;
+		virtual bool Get(const std::string&, Time&) = 0;
+		virtual bool Get(const std::string&, DBKey&) = 0;
+		virtual bool Get(const std::string&, Blob&) = 0;
+		virtual bool Get(const std::string&, Array&) = 0;
+
+		virtual int ColumnNum(const std::string&) = 0;
+		virtual const char* ColumnName(int) = 0;
+		virtual const char* ColumnAlias(int) = 0;
+		virtual const char* ColumnTable(int) = 0;
+		virtual SDT ColumnType(int) = 0;
+		virtual int ColumnSubtype(int) = 0;
+		virtual int ColumnSize(int) = 0;
+		virtual int ColumnScale(int) = 0;
+		virtual int Columns() = 0;
+		
+		virtual bool ColumnUpdated(int) = 0;
+		virtual bool Updated() = 0;
+
+		virtual	Database DatabasePtr() const = 0;
+		virtual Transaction TransactionPtr() const = 0;
+
+		virtual IRow* Clone() = 0;
+		virtual IRow* AddRef() = 0;
+		virtual void Release() = 0;
+
+	    virtual ~IRow() {};
+	};
+
+	/* IStatement is the interface to the statements execution in IBPP.
+	 * Statement is the object class you actually use in your programming. A
+	 * Statement object is the work horse of IBPP. All your data manipulation
+	 * statements will be done through it. It is also used to access the result
+	 * set of a query (when the statement is such), one row at a time and in
+	 * strict forward direction. */
+
+	class IStatement
+	{
+	public:
+		virtual void Prepare(const std::string&) = 0;
+		virtual void Execute() = 0;
+		virtual void Execute(const std::string&) = 0;
+		virtual void ExecuteImmediate(const std::string&) = 0;
+		virtual void CursorExecute(const std::string& cursor) = 0;
+		virtual void CursorExecute(const std::string& cursor, const std::string&) = 0;
+		virtual bool Fetch() = 0;
+		virtual bool Fetch(Row&) = 0;
+		virtual int AffectedRows() = 0;
+		virtual void Close() = 0;
+		virtual std::string& Sql() = 0;
+		virtual STT Type() = 0;
+
+		virtual void SetNull(int) = 0;
+		virtual void Set(int, bool) = 0;
+		virtual void Set(int, const void*, int) = 0;		// byte buffers
+		virtual void Set(int, const char*) = 0;				// c-string
+		virtual void Set(int, const std::string&) = 0;
+		virtual void Set(int, int16_t value) = 0;
+		virtual void Set(int, int32_t value) = 0;
+		virtual void Set(int, int64_t value) = 0;
+		virtual void Set(int, float value) = 0;
+		virtual void Set(int, double value) = 0;
+		virtual void Set(int, const Timestamp& value) = 0;
+		virtual void Set(int, const Date& value) = 0;
+		virtual void Set(int, const Time& value) = 0;
+		virtual void Set(int, const DBKey& value) = 0;
+		virtual void Set(int, const Blob& value) = 0;
+		virtual void Set(int, const Array& value) = 0;
+
+		virtual bool IsNull(int) = 0;
+		virtual bool Get(int, bool&) = 0;
+		virtual bool Get(int, void*, int&) = 0;	// byte buffers
+		virtual bool Get(int, std::string&) = 0;
+		virtual bool Get(int, int16_t&) = 0;
+		virtual bool Get(int, int32_t&) = 0;
+		virtual bool Get(int, int64_t&) = 0;
+		virtual bool Get(int, float&) = 0;
+		virtual bool Get(int, double&) = 0;
+		virtual bool Get(int, Timestamp& value) = 0;
+		virtual bool Get(int, Date& value) = 0;
+		virtual bool Get(int, Time& value) = 0;
+		virtual bool Get(int, DBKey& value) = 0;
+		virtual bool Get(int, Blob& value) = 0;
+		virtual bool Get(int, Array& value) = 0;
+
+		virtual bool IsNull(const std::string&) = 0;
+		virtual bool Get(const std::string&, bool&) = 0;
+		virtual bool Get(const std::string&, void*, int&) = 0;	// byte buffers
+		virtual bool Get(const std::string&, std::string&) = 0;
+		virtual bool Get(const std::string&, int16_t&) = 0;
+		virtual bool Get(const std::string&, int32_t&) = 0;
+		virtual bool Get(const std::string&, int64_t&) = 0;
+		virtual bool Get(const std::string&, float&) = 0;
+		virtual bool Get(const std::string&, double&) = 0;
+		virtual bool Get(const std::string&, Timestamp& value) = 0;
+		virtual bool Get(const std::string&, Date& value) = 0;
+		virtual bool Get(const std::string&, Time& value) = 0;
+		virtual bool Get(const std::string&, DBKey& value) = 0;
+		virtual bool Get(const std::string&, Blob& value) = 0;
+		virtual bool Get(const std::string&, Array& value) = 0;
+
+		virtual int ColumnNum(const std::string&) = 0;
+		virtual const char* ColumnName(int) = 0;
+		virtual const char* ColumnAlias(int) = 0;
+		virtual const char* ColumnTable(int) = 0;
+		virtual SDT ColumnType(int) = 0;
+		virtual int ColumnSubtype(int) = 0;
+		virtual int ColumnSize(int) = 0;
+		virtual int ColumnScale(int) = 0;
+		virtual int Columns() = 0;
+
+		virtual SDT ParameterType(int) = 0;
+		virtual int ParameterSubtype(int) = 0;
+		virtual int ParameterSize(int) = 0;
+		virtual int ParameterScale(int) = 0;
+		virtual int Parameters() = 0;
+
+		virtual void Plan(std::string&) = 0;
+
+		virtual	Database DatabasePtr() const = 0;
+		virtual Transaction TransactionPtr() const = 0;
+
+		virtual IStatement* AddRef() = 0;
+		virtual void Release() = 0;
+
+	    virtual ~IStatement() { };
+
+		// DEPRECATED METHODS (WON'T BE AVAILABLE IN VERSIONS 3.x)
+		virtual bool Get(int, char*) = 0;			  		// DEPRECATED
+		virtual bool Get(const std::string&, char*) = 0;	// DEPRECATED
+		virtual bool Get(int, bool*) = 0;					// DEPRECATED
+		virtual bool Get(const std::string&, bool*) = 0;	// DEPRECATED
+		virtual bool Get(int, int16_t*) = 0;				// DEPRECATED
+		virtual bool Get(const std::string&, int16_t*) = 0;	// DEPRECATED
+		virtual bool Get(int, int32_t*) = 0;				// DEPRECATED
+		virtual bool Get(const std::string&, int32_t*) = 0;	// DEPRECATED
+		virtual bool Get(int, int64_t*) = 0;				// DEPRECATED
+		virtual bool Get(const std::string&, int64_t*) = 0;	// DEPRECATED
+		virtual bool Get(int, float*) = 0;					// DEPRECATED
+		virtual bool Get(const std::string&, float*) = 0;	// DEPRECATED
+		virtual bool Get(int, double*) = 0;					// DEPRECATED
+		virtual bool Get(const std::string&, double*) = 0;	// DEPRECATED
+	};
+	
+	class IEvents
+	{
+	public:
+		virtual void Add(const std::string&, EventInterface*) = 0;
+		virtual void Drop(const std::string&) = 0;
+		virtual void List(std::vector<std::string>&) = 0;
+		virtual void Clear() = 0;				// Drop all events
+		virtual void Dispatch() = 0;			// Dispatch events (calls handlers)
+
+		virtual	Database DatabasePtr() const = 0;
+
+		virtual IEvents* AddRef() = 0;
+		virtual void Release() = 0;
+
+	    virtual ~IEvents() { };
+	};
+	
+	/* Class EventInterface is merely a pure interface.
+	 * It is _not_ implemented by IBPP. It is only a base class definition from
+	 * which your own event interface classes have to derive from.
+	 * Please read the reference guide at http://www.ibpp.org for more info. */
+
+	class EventInterface
+	{
+	public:
+		virtual void ibppEventHandler(Events, const std::string&, int) = 0;
+		virtual ~EventInterface() { };
+	};
+
+	//	--- Factories ---
+	//	These methods are the only way to get one of the above
+	//	Interfaces.  They are at the heart of how you program using IBPP.  For
+	//	instance, to get access to a database, you'll write code similar to this:
+	//	{
+	//		Database db = DatabaseFactory("server", "databasename",
+	//						"user", "password");
+	//		db->Connect();
+	//		...
+	//		db->Disconnect();
+	//	}
+
+	Service ServiceFactory(const std::string& ServerName,
+		const std::string& UserName, const std::string& UserPassword);
+
+	Database DatabaseFactory(const std::string& ServerName,
+		const std::string& DatabaseName, const std::string& UserName,
+			const std::string& UserPassword, const std::string& RoleName,
+				const std::string& CharSet, const std::string& CreateParams);
+
+	inline Database DatabaseFactory(const std::string& ServerName,
+		const std::string& DatabaseName, const std::string& UserName,
+			const std::string& UserPassword)
+		{ return DatabaseFactory(ServerName, DatabaseName, UserName, UserPassword, "", "", ""); }
+
+	Transaction TransactionFactory(Database db, TAM am = amWrite,
+		TIL il = ilConcurrency, TLR lr = lrWait, TFF flags = TFF(0));
+
+	Statement StatementFactory(Database db, Transaction tr,
+		const std::string& sql);
+
+	inline Statement StatementFactory(Database db, Transaction tr)
+		{ return StatementFactory(db, tr, ""); }
+
+	Blob BlobFactory(Database db, Transaction tr);
+	
+	Array ArrayFactory(Database db, Transaction tr);
+	
+	Events EventsFactory(Database db);
+
+	/* IBPP uses a self initialization system. Each time an object that may
+	 * require the usage of the Interbase client C-API library is used, the
+	 * library internal handling details are automatically initialized, if not
+	 * already done. You can kick this initialization at the start of an
+	 * application by calling IBPP::CheckVersion(). This is recommended, because
+	 * IBPP::CheckVersion will assure you that YOUR code has been compiled
+	 * against a compatible version of the library. */
+
+	bool CheckVersion(uint32_t);
+	int GDSVersion();
+	
+	/* On Win32 platform, ClientLibSearchPaths() allows to setup
+	 * one or multiple additional paths (separated with a ';') where IBPP
+	 * will look for the client library (before the default implicit search
+	 * locations). This is usefull for applications distributed with a 'private'
+	 * copy of Firebird, when the registry is useless to identify the location
+	 * from where to attempt loading the fbclient.dll / gds32.dll.
+	 * If called, this function must be called *early* by the application,
+	 * before *any* other function or object methods of IBPP.
+	 * Currently, this is a NO-OP on platforms other than Win32. */
+	 
+	void ClientLibSearchPaths(const std::string&);
+
+	/* Finally, here are some date and time conversion routines used by IBPP and
+	 * that may be helpful at the application level. They do not depend on
+	 * anything related to Firebird/Interbase. Just a bonus. dtoi and itod
+	 * return false on invalid parameters or out of range conversions. */
+
+	bool dtoi(int date, int* py, int* pm, int* pd);
+	bool itod(int* pdate, int year, int month, int day);
+	void ttoi(int itime, int* phour, int* pminute, int* psecond, int* ptt);
+	void itot(int* ptime, int hour, int minute, int second = 0, int tenthousandths = 0);
+
+}
+
+#endif
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/row.cpp b/src/terralib/drivers/Firebird/ibpp/core/row.cpp
new file mode 100644
index 0000000..8b17b2d
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/row.cpp
@@ -0,0 +1,1580 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: row.cpp 7665 2009-03-03 16:39:22Z fredbed $
+//	Subject : IBPP, Row class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+#include <cstring>
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+#include <math.h>
+#include <time.h>
+
+using namespace ibpp_internals;
+
+//	(((((((( OBJECT INTERFACE IMPLEMENTATION ))))))))
+
+void RowImpl::SetNull(int param)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::SetNull", _("The row is not initialized."));
+	if (param < 1 || param > mDescrArea->sqld)
+		throw LogicExceptionImpl("Row::SetNull", _("Variable index out of range."));
+
+	XSQLVAR* var = &(mDescrArea->sqlvar[param-1]);
+	if (! (var->sqltype & 1))
+		throw LogicExceptionImpl("Row::SetNull", _("This column can't be null."));
+
+	*var->sqlind = -1;	// Set the column to SQL NULL
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, bool value)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[bool]", _("The row is not initialized."));
+
+	SetValue(param, ivBool, &value);
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, const char* cstring)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[char*]", _("The row is not initialized."));
+	if (cstring == 0)
+		throw LogicExceptionImpl("Row::Set[char*]", _("null char* pointer detected."));
+
+	SetValue(param, ivByte, cstring, (int)strlen(cstring));
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, const void* bindata, int len)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[void*]", _("The row is not initialized."));
+	if (bindata == 0)
+		throw LogicExceptionImpl("Row::Set[void*]", _("null char* pointer detected."));
+	if (len < 0)
+		throw LogicExceptionImpl("Row::Set[void*]", _("Length must be >= 0"));
+		
+	SetValue(param, ivByte, bindata, len);
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, const std::string& s)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[string]", _("The row is not initialized."));
+
+	SetValue(param, ivString, (void*)&s);
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, int16_t value)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[int16_t]", _("The row is not initialized."));
+											
+	SetValue(param, ivInt16, &value);
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, int32_t value)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[int32_t]", _("The row is not initialized."));
+
+	SetValue(param, ivInt32, &value);
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, int64_t value)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[int64_t]", _("The row is not initialized."));
+
+	SetValue(param, ivInt64, &value);
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, float value)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[float]", _("The row is not initialized."));
+
+	SetValue(param, ivFloat, &value);
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, double value)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[double]", _("The row is not initialized."));
+
+	SetValue(param, ivDouble, &value);
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, const IBPP::Timestamp& value)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[Timestamp]", _("The row is not initialized."));
+
+	SetValue(param, ivTimestamp, &value);
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, const IBPP::Date& value)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[Date]", _("The row is not initialized."));
+
+	if (mDialect == 1)
+	{
+		// In dialect 1, IBPP::Date is supposed to work with old 'DATE'
+		// fields which are actually ISC_TIMESTAMP.
+		IBPP::Timestamp timestamp(value);
+		SetValue(param, ivTimestamp, &timestamp);
+	}
+	else
+	{
+		// Dialect 3
+		SetValue(param, ivDate, (void*)&value);
+	}
+
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, const IBPP::Time& value)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[Time]", _("The row is not initialized."));
+	if (mDialect == 1)
+		throw LogicExceptionImpl("Row::Set[Time]", _("Requires use of a dialect 3 database."));
+
+	SetValue(param, ivTime, &value);
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, const IBPP::Blob& blob)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[Blob]", _("The row is not initialized."));
+	if (mDatabase != 0 && blob->DatabasePtr() != mDatabase)
+		throw LogicExceptionImpl("Row::Set[Blob]",
+			_("IBlob and Row attached to different databases"));
+	if (mTransaction != 0 && blob->TransactionPtr() != mTransaction)
+		throw LogicExceptionImpl("Row::Set[Blob]",
+			_("IBlob and Row attached to different transactions"));
+
+	SetValue(param, ivBlob, blob.intf());
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, const IBPP::Array& array)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[Array]", _("The row is not initialized."));
+	if (mDatabase != 0 && array->DatabasePtr() != mDatabase)
+		throw LogicExceptionImpl("Row::Set[Array]",
+			_("IArray and Row attached to different databases"));
+	if (mTransaction != 0 && array->TransactionPtr() != mTransaction)
+		throw LogicExceptionImpl("Row::Set[Array]",
+			_("IArray and Row attached to different transactions"));
+
+	SetValue(param, ivArray, (void*)array.intf());
+	mUpdated[param-1] = true;
+}
+
+void RowImpl::Set(int param, const IBPP::DBKey& key)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[DBKey]", _("The row is not initialized."));
+
+	SetValue(param, ivDBKey, (void*)&key);
+	mUpdated[param-1] = true;
+}
+
+/*
+void RowImpl::Set(int param, const IBPP::Value& value)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Set[Value]", _("The row is not initialized."));
+
+	//SetValue(param, ivDBKey, (void*)&key);
+	//mUpdated[param-1] = true;
+}
+*/
+
+bool RowImpl::IsNull(int column)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::IsNull", _("The row is not initialized."));
+	if (column < 1 || column > mDescrArea->sqld)
+		throw LogicExceptionImpl("Row::IsNull", _("Variable index out of range."));
+
+	XSQLVAR* var = &(mDescrArea->sqlvar[column-1]);
+	return ((var->sqltype & 1) && *(var->sqlind) != 0) ? true : false;
+}
+
+bool RowImpl::Get(int column, bool& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivBool);
+	if (pvalue != 0)
+		retvalue = (*(char*)pvalue == 0 ? false : true);
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, char* retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Row::Get", _("Null pointer detected"));
+
+	int sqllen;
+	void* pvalue = GetValue(column, ivByte, &sqllen);
+	if (pvalue != 0)
+	{
+		memcpy(retvalue, pvalue, sqllen);
+		retvalue[sqllen] = '\0';
+	}
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, void* bindata, int& userlen)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+	if (bindata == 0)
+		throw LogicExceptionImpl("Row::Get", _("Null pointer detected"));
+	if (userlen < 0)
+		throw LogicExceptionImpl("Row::Get", _("Length must be >= 0"));
+
+	int sqllen;
+	void* pvalue = GetValue(column, ivByte, &sqllen);
+	if (pvalue != 0)
+	{
+		// userlen says how much bytes the user can accept
+		// let's shorten it, if there is less bytes available
+		if (sqllen < userlen) userlen = sqllen;
+		memcpy(bindata, pvalue, userlen);
+	}
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, std::string& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivString, &retvalue);
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, int16_t& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivInt16);
+	if (pvalue != 0)
+		retvalue = *(int16_t*)pvalue;
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, int32_t& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivInt32);
+	if (pvalue != 0)
+		retvalue = *(int32_t*)pvalue;
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, int64_t& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivInt64);
+	if (pvalue != 0)
+		retvalue = *(int64_t*)pvalue;
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, float& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivFloat);
+	if (pvalue != 0)
+		retvalue = *(float*)pvalue;
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, double& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivDouble);
+	if (pvalue != 0)
+		retvalue = *(double*)pvalue;
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, IBPP::Timestamp& timestamp)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivTimestamp, (void*)&timestamp);
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, IBPP::Date& date)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	if (mDialect == 1)
+	{
+		// Dialect 1. IBPP::Date is supposed to work with old 'DATE'
+		// fields which are actually ISC_TIMESTAMP.
+		IBPP::Timestamp timestamp;
+		void* pvalue = GetValue(column, ivTimestamp, (void*)&timestamp);
+		if (pvalue != 0) date = timestamp;
+		return pvalue == 0 ? true : false;
+	}
+	else
+	{
+		void* pvalue = GetValue(column, ivDate, (void*)&date);
+		return pvalue == 0 ? true : false;
+	}
+}
+
+bool RowImpl::Get(int column, IBPP::Time& time)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivTime, (void*)&time);
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, IBPP::Blob& retblob)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivBlob, (void*)retblob.intf());
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, IBPP::DBKey& retkey)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivDBKey, (void*)&retkey);
+	return pvalue == 0 ? true : false;
+}
+
+bool RowImpl::Get(int column, IBPP::Array& retarray)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	void* pvalue = GetValue(column, ivArray, (void*)retarray.intf());
+	return pvalue == 0 ? true : false;
+}
+
+/*
+const IBPP::Value RowImpl::Get(int column)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	//void* value = GetValue(column, ivArray, (void*)retarray.intf());
+	//return value == 0 ? true : false;
+	return IBPP::Value();
+}
+*/
+
+bool RowImpl::IsNull(const std::string& name)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::IsNull", _("The row is not initialized."));
+
+	return IsNull(ColumnNum(name));
+}
+
+bool RowImpl::Get(const std::string& name, bool& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, char* retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get[char*]", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, void* retvalue, int& count)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get[void*,int]", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue, count);
+}
+
+bool RowImpl::Get(const std::string& name, std::string& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::GetString", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, int16_t& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, int32_t& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, int64_t& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, float& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, double& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, IBPP::Timestamp& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, IBPP::Date& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, IBPP::Time& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string&name, IBPP::Blob& retblob)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retblob);
+}
+
+bool RowImpl::Get(const std::string& name, IBPP::DBKey& retvalue)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retvalue);
+}
+
+bool RowImpl::Get(const std::string& name, IBPP::Array& retarray)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name), retarray);
+}
+
+/*
+const IBPP::Value RowImpl::Get(const std::string& name)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Get", _("The row is not initialized."));
+
+	return Get(ColumnNum(name));
+}
+*/
+
+int RowImpl::Columns()
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::Columns", _("The row is not initialized."));
+
+	return mDescrArea->sqld;
+}
+
+int RowImpl::ColumnNum(const std::string& name)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::ColumnNum", _("The row is not initialized."));
+	if (name.empty())
+		throw LogicExceptionImpl("Row::ColumnNum", _("Column name <empty> not found."));
+
+	XSQLVAR* var;
+	char Uname[sizeof(var->sqlname)+1];		// Max size of sqlname + '\0'
+
+	// Local upper case copy of the column name
+	size_t len = name.length();
+	if (len > sizeof(var->sqlname)) len = sizeof(var->sqlname);
+	strncpy(Uname, name.c_str(), len);
+	Uname[len] = '\0';
+	char* p = Uname;
+	while (*p != '\0') { *p = char(toupper(*p)); ++p; }
+
+	// Loop through the columns of the descriptor
+	for (int i = 0; i < mDescrArea->sqld; i++)
+	{
+		var = &(mDescrArea->sqlvar[i]);
+		if (var->sqlname_length != (int16_t)len) continue;
+		if (strncmp(Uname, var->sqlname, len) == 0) return i+1;
+	}
+
+	// Failed finding the column name, let's retry using the aliases
+	char Ualias[sizeof(var->aliasname)+1];		// Max size of aliasname + '\0'
+
+	// Local upper case copy of the column name
+	len = name.length();
+	if (len > sizeof(var->aliasname)) len = sizeof(var->aliasname);
+	strncpy(Ualias, name.c_str(), len);
+	Ualias[len] = '\0';
+	p = Ualias;
+	while (*p != '\0') { *p = char(toupper(*p)); ++p; }
+
+	// Loop through the columns of the descriptor
+	for (int i = 0; i < mDescrArea->sqld; i++)
+	{
+		var = &(mDescrArea->sqlvar[i]);
+		if (var->aliasname_length != (int16_t)len) continue;
+		if (strncmp(Ualias, var->aliasname, len) == 0) return i+1;
+	}
+
+	throw LogicExceptionImpl("Row::ColumnNum", _("Could not find matching column."));
+#ifdef __DMC__
+	return 0;	// DMC errronously warns here about a missing return
+#endif
+}
+
+/*
+ColumnName, ColumnAlias, ColumnTable : all these 3 have a mistake.
+Ideally, the strings should be stored elsewhere (like _Numerics and so on) to
+take into account the final '\0' which needs to be added. For now, we insert
+the '\0' in the original data, which will cut the 32th character. Not terribly
+bad, but should be cleanly rewritten.
+*/
+
+const char* RowImpl::ColumnName(int varnum)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::ColumnName", _("The row is not initialized."));
+	if (varnum < 1 || varnum > mDescrArea->sqld)
+		throw LogicExceptionImpl("Row::ColumName", _("Variable index out of range."));
+
+	XSQLVAR* var = &(mDescrArea->sqlvar[varnum-1]);
+	if (var->sqlname_length >= 31) var->sqlname_length = 31;
+	var->sqlname[var->sqlname_length] = '\0';
+	return var->sqlname;
+}
+
+const char* RowImpl::ColumnAlias(int varnum)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::ColumnAlias", _("The row is not initialized."));
+	if (varnum < 1 || varnum > mDescrArea->sqld)
+		throw LogicExceptionImpl("Row::ColumnAlias", _("Variable index out of range."));
+
+	XSQLVAR* var = &(mDescrArea->sqlvar[varnum-1]);
+	if (var->aliasname_length >= 31) var->aliasname_length = 31;
+	var->aliasname[var->aliasname_length] = '\0';
+	return var->aliasname;
+}
+
+const char* RowImpl::ColumnTable(int varnum)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::ColumnTable", _("The row is not initialized."));
+	if (varnum < 1 || varnum > mDescrArea->sqld)
+		throw LogicExceptionImpl("Row::ColumnTable", _("Variable index out of range."));
+
+	XSQLVAR* var = &(mDescrArea->sqlvar[varnum-1]);
+	if (var->relname_length >= 31) var->relname_length = 31;
+	var->relname[var->relname_length] = '\0';
+	return var->relname;
+}
+
+IBPP::SDT RowImpl::ColumnType(int varnum)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::ColumnType", _("The row is not initialized."));
+	if (varnum < 1 || varnum > mDescrArea->sqld)
+		throw LogicExceptionImpl("Row::ColumnType", _("Variable index out of range."));
+
+	IBPP::SDT value;
+	XSQLVAR* var = &(mDescrArea->sqlvar[varnum-1]);
+
+	switch (var->sqltype & ~1)
+	{
+		case SQL_TEXT :      value = IBPP::sdString;    break;
+		case SQL_VARYING :   value = IBPP::sdString;    break;
+		case SQL_SHORT :     value = IBPP::sdSmallint;  break;
+		case SQL_LONG :      value = IBPP::sdInteger;   break;
+		case SQL_INT64 :     value = IBPP::sdLargeint;  break;
+		case SQL_FLOAT :     value = IBPP::sdFloat;     break;
+		case SQL_DOUBLE :    value = IBPP::sdDouble;    break;
+		case SQL_TIMESTAMP : value = IBPP::sdTimestamp; break;
+		case SQL_TYPE_DATE : value = IBPP::sdDate;      break;
+		case SQL_TYPE_TIME : value = IBPP::sdTime;      break;
+		case SQL_BLOB :      value = IBPP::sdBlob;      break;
+		case SQL_ARRAY :     value = IBPP::sdArray;     break;
+		default : throw LogicExceptionImpl("Row::ColumnType",
+						_("Found an unknown sqltype !"));
+	}
+
+	return value;
+}
+
+int RowImpl::ColumnSubtype(int varnum)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::ColumnSubtype", _("The row is not initialized."));
+	if (varnum < 1 || varnum > mDescrArea->sqld)
+		throw LogicExceptionImpl("Row::ColumnSubtype", _("Variable index out of range."));
+
+	XSQLVAR* var = &(mDescrArea->sqlvar[varnum-1]);
+	return (int)var->sqlsubtype;
+}
+
+int RowImpl::ColumnSize(int varnum)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::ColumnSize", _("The row is not initialized."));
+	if (varnum < 1 || varnum > mDescrArea->sqld)
+		throw LogicExceptionImpl("Row::ColumnSize", _("Variable index out of range."));
+
+	XSQLVAR* var = &(mDescrArea->sqlvar[varnum-1]);
+    return var->sqllen;
+}
+
+int RowImpl::ColumnScale(int varnum)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::ColumnScale", _("The row is not initialized."));
+	if (varnum < 1 || varnum > mDescrArea->sqld)
+		throw LogicExceptionImpl("Row::ColumnScale", _("Variable index out of range."));
+
+	XSQLVAR* var = &(mDescrArea->sqlvar[varnum-1]);
+    return -var->sqlscale;
+}
+
+bool RowImpl::ColumnUpdated(int varnum)
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::ColumnUpdated", _("The row is not initialized."));
+	if (varnum < 1 || varnum > mDescrArea->sqld)
+		throw LogicExceptionImpl("Row::ColumnUpdated", _("Variable index out of range."));
+
+	return mUpdated[varnum-1];
+}
+
+bool RowImpl::Updated()
+{
+	if (mDescrArea == 0)
+		throw LogicExceptionImpl("Row::ColumnUpdated", _("The row is not initialized."));
+
+	for (int i = 0; i < mDescrArea->sqld; i++)
+		if (mUpdated[i]) return true;
+	return false;
+}
+
+IBPP::Database RowImpl::DatabasePtr() const
+{
+	return mDatabase;
+}
+
+IBPP::Transaction RowImpl::TransactionPtr() const
+{
+	return mTransaction;
+}
+
+IBPP::IRow* RowImpl::Clone()
+{
+	// By definition the clone of an IBPP Row is a new row (so refcount=0).
+
+	RowImpl* clone = new RowImpl(*this);
+	return clone;
+}
+
+IBPP::IRow* RowImpl::AddRef()
+{
+	ASSERTION(mRefCount >= 0);
+	++mRefCount;
+	return this;
+}
+
+void RowImpl::Release()
+{
+	// Release cannot throw, except in DEBUG builds on assertion
+	ASSERTION(mRefCount >= 0);
+	--mRefCount;
+	try { if (mRefCount <= 0) delete this; }
+		catch (...) { }
+}
+
+//	(((((((( OBJECT INTERNAL METHODS ))))))))
+
+void RowImpl::SetValue(int varnum, IITYPE ivType, const void* value, int userlen)
+{
+	if (varnum < 1 || varnum > mDescrArea->sqld)
+		throw LogicExceptionImpl("RowImpl::SetValue", _("Variable index out of range."));
+	if (value == 0)
+		throw LogicExceptionImpl("RowImpl::SetValue", _("Unexpected null pointer detected."));
+
+	int16_t len;
+	XSQLVAR* var = &(mDescrArea->sqlvar[varnum-1]);
+	switch (var->sqltype & ~1)
+	{
+		case SQL_TEXT :
+			if (ivType == ivString)
+			{
+				std::string* svalue = (std::string*)value;
+				len = (int16_t)svalue->length();
+				if (len > var->sqllen) len = var->sqllen;
+				strncpy(var->sqldata, svalue->c_str(), len);
+				while (len < var->sqllen) var->sqldata[len++] = ' ';
+			}
+			else if (ivType == ivByte)
+			{
+				if (userlen > var->sqllen) userlen = var->sqllen;
+				memcpy(var->sqldata, value, userlen);
+				while (userlen < var->sqllen) var->sqldata[userlen++] = ' ';
+			}
+			else if (ivType == ivDBKey)
+			{
+				IBPP::DBKey* key = (IBPP::DBKey*)value;
+				key->GetKey(var->sqldata, var->sqllen);
+			}
+			else if (ivType == ivBool)
+			{
+				var->sqldata[0] = *(bool*)value ? 'T' : 'F';
+				len = 1;
+				while (len < var->sqllen) var->sqldata[len++] = ' ';
+			}
+			else throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_VARYING :
+			if (ivType == ivString)
+			{
+				std::string* svalue = (std::string*)value;
+				len = (int16_t)svalue->length();
+				if (len > var->sqllen) len = var->sqllen;
+				*(int16_t*)var->sqldata = (int16_t)len;
+				strncpy(var->sqldata+2, svalue->c_str(), len);
+			}
+			else if (ivType == ivByte)
+			{
+				if (userlen > var->sqllen) userlen = var->sqllen;
+				*(int16_t*)var->sqldata = (int16_t)userlen;
+				memcpy(var->sqldata+2, value, userlen);
+			}
+			else if (ivType == ivBool)
+			{
+				*(int16_t*)var->sqldata = (int16_t)1;
+				var->sqldata[2] = *(bool*)value ? 'T' : 'F';
+			}
+			else throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_SHORT :
+			if (ivType == ivBool)
+			{
+				*(int16_t*)var->sqldata = int16_t(*(bool*)value ? 1 : 0);
+			}
+			else if (ivType == ivInt16)
+			{
+				*(int16_t*)var->sqldata = *(int16_t*)value;
+			}
+			else if (ivType == ivInt32)
+			{
+				if (*(int32_t*)value < consts::min16 || *(int32_t*)value > consts::max16)
+					throw LogicExceptionImpl("RowImpl::SetValue",
+						_("Out of range numeric conversion !"));
+				*(int16_t*)var->sqldata = (int16_t)*(int32_t*)value;
+			}
+			else if (ivType == ivInt64)
+			{
+				if (*(int64_t*)value < consts::min16 || *(int64_t*)value > consts::max16)
+					throw LogicExceptionImpl("RowImpl::SetValue",
+						_("Out of range numeric conversion !"));
+				*(int16_t*)var->sqldata = (int16_t)*(int64_t*)value;
+			}
+			else if (ivType == ivFloat)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-var->sqlscale];
+				*(int16_t*)var->sqldata =
+					(int16_t)floor(*(float*)value * multiplier + 0.5);
+			}
+			else if (ivType == ivDouble)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-var->sqlscale];
+				*(int16_t*)var->sqldata =
+					(int16_t)floor(*(double*)value * multiplier + 0.5);
+			}
+			else throw WrongTypeImpl("RowImpl::SetValue",  var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_LONG :
+			if (ivType == ivBool)
+			{
+				*(ISC_LONG*)var->sqldata = *(bool*)value ? 1 : 0;
+			}
+			else if (ivType == ivInt16)
+			{
+				*(ISC_LONG*)var->sqldata = *(int16_t*)value;
+			}
+			else if (ivType == ivInt32)
+			{
+				*(ISC_LONG*)var->sqldata = *(ISC_LONG*)value;
+			}
+			else if (ivType == ivInt64)
+			{
+				if (*(int64_t*)value < consts::min32 || *(int64_t*)value > consts::max32)
+					throw LogicExceptionImpl("RowImpl::SetValue",
+						_("Out of range numeric conversion !"));
+				*(ISC_LONG*)var->sqldata = (ISC_LONG)*(int64_t*)value;
+			}
+			else if (ivType == ivFloat)
+			{
+				// This SQL_LONG is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-var->sqlscale];
+				*(ISC_LONG*)var->sqldata =
+					(ISC_LONG)floor(*(float*)value * multiplier + 0.5);
+			}
+			else if (ivType == ivDouble)
+			{
+				// This SQL_LONG is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-var->sqlscale];
+				*(ISC_LONG*)var->sqldata =
+					(ISC_LONG)floor(*(double*)value * multiplier + 0.5);
+			}
+			else throw WrongTypeImpl("RowImpl::SetValue",  var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_INT64 :
+			if (ivType == ivBool)
+			{
+				*(int64_t*)var->sqldata = *(bool*)value ? 1 : 0;
+			}
+			else if (ivType == ivInt16)
+			{
+				*(int64_t*)var->sqldata = *(int16_t*)value;
+			}
+			else if (ivType == ivInt32)
+			{
+				*(int64_t*)var->sqldata = *(int32_t*)value;
+			}
+			else if (ivType == ivInt64)
+			{
+				*(int64_t*)var->sqldata = *(int64_t*)value;
+			}
+			else if (ivType == ivFloat)
+			{
+				// This SQL_INT64 is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-var->sqlscale];
+				*(int64_t*)var->sqldata =
+					(int64_t)floor(*(float*)value * multiplier + 0.5);
+			}
+			else if (ivType == ivDouble)
+			{
+				// This SQL_INT64 is a NUMERIC(x,y), scale it !
+				double multiplier = consts::dscales[-var->sqlscale];
+				*(int64_t*)var->sqldata =
+					(int64_t)floor(*(double*)value * multiplier + 0.5);
+			}
+			else throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_FLOAT :
+			if (ivType != ivFloat || var->sqlscale != 0)
+				throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+									_("Incompatible types."));
+			*(float*)var->sqldata = *(float*)value;
+			break;
+
+		case SQL_DOUBLE :
+			if (ivType != ivDouble)
+				throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			if (var->sqlscale != 0)
+			{
+				// Round to scale of NUMERIC(x,y)
+				double multiplier = consts::dscales[-var->sqlscale];
+				*(double*)var->sqldata =
+					floor(*(double*)value * multiplier + 0.5) / multiplier;
+			}
+			else *(double*)var->sqldata = *(double*)value;
+			break;
+
+		case SQL_TIMESTAMP :
+			if (ivType != ivTimestamp)
+				throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			encodeTimestamp(*(ISC_TIMESTAMP*)var->sqldata, *(IBPP::Timestamp*)value);
+			break;
+
+		case SQL_TYPE_DATE :
+			if (ivType != ivDate)
+				throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			encodeDate(*(ISC_DATE*)var->sqldata, *(IBPP::Date*)value);
+			break;
+
+		case SQL_TYPE_TIME :
+			if (ivType != ivTime)
+				throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+											_("Incompatible types."));
+			encodeTime(*(ISC_TIME*)var->sqldata, *(IBPP::Time*)value);
+			break;
+
+		case SQL_BLOB :
+			if (ivType == ivBlob)
+			{
+				BlobImpl* blob = (BlobImpl*)value;
+				blob->GetId((ISC_QUAD*)var->sqldata);
+			}
+			else if (ivType == ivString)
+			{
+				BlobImpl blob(mDatabase, mTransaction);
+				blob.Save(*(std::string*)value);
+				blob.GetId((ISC_QUAD*)var->sqldata);
+			}
+			else throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_ARRAY :
+			if (ivType != ivArray)
+				throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			{
+				ArrayImpl* array = (ArrayImpl*)value;
+				array->GetId((ISC_QUAD*)var->sqldata);
+				// When an array has been affected to a column, we want to reset
+				// its ID. This way, the next WriteFrom() on the same Array object
+				// will allocate a new ID. This protects against storing the same
+				// array ID in multiple columns or rows.
+				array->ResetId();
+			}
+			break;
+
+		default : throw LogicExceptionImpl("RowImpl::SetValue",
+						_("The field uses an unsupported SQL type !"));
+	}
+
+	if (var->sqltype & 1) *var->sqlind = 0;		// Remove the 0 flag
+}
+
+void* RowImpl::GetValue(int varnum, IITYPE ivType, void* retvalue)
+{
+	if (varnum < 1 || varnum > mDescrArea->sqld)
+		throw LogicExceptionImpl("RowImpl::GetValue", _("Variable index out of range."));
+
+	void* value;
+	int len;
+	XSQLVAR* var = &(mDescrArea->sqlvar[varnum-1]);
+
+	// When there is no value (SQL NULL)
+	if ((var->sqltype & 1) && *(var->sqlind) != 0) return 0;
+
+	switch (var->sqltype & ~1)
+	{
+		case SQL_TEXT :
+			if (ivType == ivString)
+			{
+				// In case of ivString, 'void* retvalue' points to a std::string where we
+				// will directly store the data.
+				std::string* str = (std::string*)retvalue;
+				str->erase();
+				str->append(var->sqldata, var->sqllen);
+				value = retvalue;	// value != 0 means 'not null'
+			}
+			else if (ivType == ivByte)
+			{
+				// In case of ivByte, void* retvalue points to an int where we
+				// will store the len of the available data
+				if (retvalue != 0) *(int*)retvalue = var->sqllen;
+				value = var->sqldata;
+			}
+			else if (ivType == ivDBKey)
+			{
+				IBPP::DBKey* key = (IBPP::DBKey*)retvalue;
+				key->SetKey(var->sqldata, var->sqllen);
+				value = retvalue;
+			}
+			else if (ivType == ivBool)
+			{
+				mBools[varnum-1] = 0;
+				if (var->sqllen >= 1)
+				{
+					char c = var->sqldata[0];
+					if (c == 't' || c == 'T' || c == 'y' || c == 'Y' ||	c == '1')
+						mBools[varnum-1] = 1;
+				}
+				value = &mBools[varnum-1];
+			}
+			else throw WrongTypeImpl("RowImpl::GetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_VARYING :
+			if (ivType == ivString)
+			{
+				// In case of ivString, 'void* retvalue' points to a std::string where we
+				// will directly store the data.
+				std::string* str = (std::string*)retvalue;
+				str->erase();
+				str->append(var->sqldata+2, (int32_t)*(int16_t*)var->sqldata);
+				value = retvalue;
+			}
+			else if (ivType == ivByte)
+			{
+				// In case of ivByte, void* retvalue points to an int where we
+				// will store the len of the available data
+				if (retvalue != 0) *(int*)retvalue = (int)*(int16_t*)var->sqldata;
+				value = var->sqldata+2;
+			}
+			else if (ivType == ivBool)
+			{
+				mBools[varnum-1] = 0;
+				len = *(int16_t*)var->sqldata;
+				if (len >= 1)
+				{
+					char c = var->sqldata[2];
+					if (c == 't' || c == 'T' || c == 'y' || c == 'Y' ||	c == '1')
+						mBools[varnum-1] = 1;
+				}
+				value = &mBools[varnum-1];
+			}
+			else throw WrongTypeImpl("RowImpl::GetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_SHORT :
+			if (ivType == ivInt16)
+			{
+				value = var->sqldata;
+			}
+			else if (ivType == ivBool)
+			{
+				if (*(int16_t*)var->sqldata == 0) mBools[varnum-1] = 0;
+				else mBools[varnum-1] = 1;
+				value = &mBools[varnum-1];
+			}
+			else if (ivType == ivInt32)
+			{
+				mInt32s[varnum-1] = *(int16_t*)var->sqldata;
+				value = &mInt32s[varnum-1];
+			}
+			else if (ivType == ivInt64)
+			{
+				mInt64s[varnum-1] = *(int16_t*)var->sqldata;
+				value = &mInt64s[varnum-1];
+			}
+			else if (ivType == ivFloat)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-var->sqlscale];
+				mFloats[varnum-1] = (float)(*(int16_t*)var->sqldata / divisor);
+
+				value = &mFloats[varnum-1];
+			}
+			else if (ivType == ivDouble)
+			{
+				// This SQL_SHORT is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-var->sqlscale];
+				mNumerics[varnum-1] = *(int16_t*)var->sqldata / divisor;
+				value = &mNumerics[varnum-1];
+			}
+			else throw WrongTypeImpl("RowImpl::GetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_LONG :
+			if (ivType == ivInt32)
+			{
+				value = var->sqldata;
+			}
+			else if (ivType == ivBool)
+			{
+				if (*(int32_t*)var->sqldata == 0) mBools[varnum-1] = 0;
+				else mBools[varnum-1] = 1;
+				value = &mBools[varnum-1];
+			}
+			else if (ivType == ivInt16)
+			{
+				int32_t tmp = *(int32_t*)var->sqldata;
+				if (tmp < consts::min16 || tmp > consts::max16)
+					throw LogicExceptionImpl("RowImpl::GetValue",
+						_("Out of range numeric conversion !"));
+				mInt16s[varnum-1] = (int16_t)tmp;
+				value = &mInt16s[varnum-1];
+			}
+			else if (ivType == ivInt64)
+			{
+				mInt64s[varnum-1] = *(int32_t*)var->sqldata;
+				value = &mInt64s[varnum-1];
+			}
+			else if (ivType == ivFloat)
+			{
+				// This SQL_LONG is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-var->sqlscale];
+				mFloats[varnum-1] = (float)(*(int32_t*)var->sqldata / divisor);
+				value = &mFloats[varnum-1];
+			}
+			else if (ivType == ivDouble)
+			{
+				// This SQL_LONG is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-var->sqlscale];
+				mNumerics[varnum-1] = *(int32_t*)var->sqldata / divisor;
+				value = &mNumerics[varnum-1];
+			}
+			else throw WrongTypeImpl("RowImpl::GetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_INT64 :
+			if (ivType == ivInt64)
+			{
+				value = var->sqldata;
+			}
+			else if (ivType == ivBool)
+			{
+				if (*(int64_t*)var->sqldata == 0) mBools[varnum-1] = 0;
+				else mBools[varnum-1] = 1;
+				value = &mBools[varnum-1];
+			}
+			else if (ivType == ivInt16)
+			{
+				int64_t tmp = *(int64_t*)var->sqldata;
+				if (tmp < consts::min16 || tmp > consts::max16)
+					throw LogicExceptionImpl("RowImpl::GetValue",
+						_("Out of range numeric conversion !"));
+				mInt16s[varnum-1] = (int16_t)tmp;
+				value = &mInt16s[varnum-1];
+			}
+			else if (ivType == ivInt32)
+			{
+				int64_t tmp = *(int64_t*)var->sqldata;
+				if (tmp < consts::min32 || tmp > consts::max32)
+					throw LogicExceptionImpl("RowImpl::GetValue",
+						_("Out of range numeric conversion !"));
+				mInt32s[varnum-1] = (int32_t)tmp;
+				value = &mInt32s[varnum-1];
+			}
+			else if (ivType == ivFloat)
+			{
+				// This SQL_INT64 is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-var->sqlscale];
+				mFloats[varnum-1] = (float)(*(int64_t*)var->sqldata / divisor);
+				value = &mFloats[varnum-1];
+			}
+			else if (ivType == ivDouble)
+			{
+				// This SQL_INT64 is a NUMERIC(x,y), scale it !
+				double divisor = consts::dscales[-var->sqlscale];
+				mNumerics[varnum-1] = *(int64_t*)var->sqldata / divisor;
+				value = &mNumerics[varnum-1];
+			}
+			else throw WrongTypeImpl("RowImpl::GetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+
+		case SQL_FLOAT :
+			if (ivType != ivFloat)
+				throw WrongTypeImpl("RowImpl::GetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			value = var->sqldata;
+			break;
+
+		case SQL_DOUBLE :
+			if (ivType != ivDouble)
+				throw WrongTypeImpl("RowImpl::GetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			if (var->sqlscale != 0)
+			{
+				// Round to scale y of NUMERIC(x,y)
+				double multiplier = consts::dscales[-var->sqlscale];
+				mNumerics[varnum-1] =
+					floor(*(double*)var->sqldata * multiplier + 0.5) / multiplier;
+				value = &mNumerics[varnum-1];
+			}
+			else value = var->sqldata;
+			break;
+
+		case SQL_TIMESTAMP :
+			if (ivType != ivTimestamp)
+				throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			decodeTimestamp(*(IBPP::Timestamp*)retvalue, *(ISC_TIMESTAMP*)var->sqldata);
+			value = retvalue;
+			break;
+
+		case SQL_TYPE_DATE :
+			if (ivType != ivDate)
+				throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			decodeDate(*(IBPP::Date*)retvalue, *(ISC_DATE*)var->sqldata);
+			value = retvalue;
+			break;
+
+		case SQL_TYPE_TIME :
+			if (ivType != ivTime)
+				throw WrongTypeImpl("RowImpl::SetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			decodeTime(*(IBPP::Time*)retvalue, *(ISC_TIME*)var->sqldata);
+			value = retvalue;
+			break;
+
+		case SQL_BLOB :
+			if (ivType == ivBlob)
+			{
+				BlobImpl* blob = (BlobImpl*)retvalue;
+				blob->SetId((ISC_QUAD*)var->sqldata);
+				value = retvalue;
+			}
+			else if (ivType == ivString)
+			{
+				BlobImpl blob(mDatabase, mTransaction);
+				blob.SetId((ISC_QUAD*)var->sqldata);
+				std::string* str = (std::string*)retvalue;
+				blob.Load(*str);
+				value = retvalue;
+			}
+			else throw WrongTypeImpl("RowImpl::GetValue", var->sqltype, ivType,
+										_("Incompatible types."));
+			break;
+			
+		case SQL_ARRAY :
+			if (ivType != ivArray)
+				throw WrongTypeImpl("RowImpl::GetValue", var->sqltype, ivType,
+											_("Incompatible types."));
+			{
+				ArrayImpl* array = (ArrayImpl*)retvalue;
+				array->SetId((ISC_QUAD*)var->sqldata);
+				value = retvalue;
+			}
+			break;
+
+		default : throw LogicExceptionImpl("RowImpl::GetValue",
+						_("Found an unknown sqltype !"));
+	}
+
+	return value;
+}
+
+void RowImpl::Free()
+{
+	if (mDescrArea != 0)
+	{
+		for (int i = 0; i < mDescrArea->sqln; i++)
+		{
+			XSQLVAR* var = &(mDescrArea->sqlvar[i]);
+			if (var->sqldata != 0)
+			{
+				switch (var->sqltype & ~1)
+				{
+					case SQL_ARRAY :
+					case SQL_BLOB :		delete (ISC_QUAD*) var->sqldata; break;
+					case SQL_TIMESTAMP :delete (ISC_TIMESTAMP*) var->sqldata; break;
+					case SQL_TYPE_TIME :delete (ISC_TIME*) var->sqldata; break;
+					case SQL_TYPE_DATE :delete (ISC_DATE*) var->sqldata; break;
+					case SQL_TEXT :
+					case SQL_VARYING :	delete [] var->sqldata; break;
+					case SQL_SHORT :	delete (int16_t*) var->sqldata; break;
+					case SQL_LONG :		delete (int32_t*) var->sqldata; break;
+					case SQL_INT64 :	delete (int64_t*) var->sqldata; break;
+					case SQL_FLOAT : 	delete (float*) var->sqldata; break;
+					case SQL_DOUBLE :	delete (double*) var->sqldata; break;
+					default : throw LogicExceptionImpl("RowImpl::Free",
+								_("Found an unknown sqltype !"));
+				}
+			}
+			if (var->sqlind != 0) delete var->sqlind;
+		}
+		delete [] (char*)mDescrArea;
+		mDescrArea = 0;
+	}
+
+	mNumerics.clear();
+	mFloats.clear();
+	mInt64s.clear();
+	mInt32s.clear();
+	mInt16s.clear();
+	mBools.clear();
+	mStrings.clear();
+	mUpdated.clear();
+
+	mDialect = 0;
+	mDatabase = 0;
+	mTransaction = 0;
+}
+
+void RowImpl::Resize(int n)
+{
+	const int size = XSQLDA_LENGTH(n);
+
+	Free();
+    mDescrArea = (XSQLDA*) new char[size];
+
+	memset(mDescrArea, 0, size);
+	mNumerics.resize(n);
+	mFloats.resize(n);
+	mInt64s.resize(n);
+	mInt32s.resize(n);
+	mInt16s.resize(n);
+	mBools.resize(n);
+	mStrings.resize(n);
+	mUpdated.resize(n);
+	for (int i = 0; i < n; i++)
+	{
+		mNumerics[i] = 0.0;
+		mFloats[i] = 0.0;
+		mInt64s[i] = 0;
+		mInt32s[i] = 0;
+		mInt16s[i] = 0;
+		mBools[i] = 0;
+		mStrings[i].erase();
+		mUpdated[i] = false;
+	}
+
+	mDescrArea->version = SQLDA_VERSION1;
+	mDescrArea->sqln = (int16_t)n;
+}
+
+void RowImpl::AllocVariables()
+{
+	int i;
+	for (i = 0; i < mDescrArea->sqld; i++)
+	{
+		XSQLVAR* var = &(mDescrArea->sqlvar[i]);
+		switch (var->sqltype & ~1)
+		{
+			case SQL_ARRAY :
+			case SQL_BLOB :		var->sqldata = (char*) new ISC_QUAD;
+								memset(var->sqldata, 0, sizeof(ISC_QUAD));
+								break;
+			case SQL_TIMESTAMP :var->sqldata = (char*) new ISC_TIMESTAMP;
+								memset(var->sqldata, 0, sizeof(ISC_TIMESTAMP));
+								break;
+			case SQL_TYPE_TIME :var->sqldata = (char*) new ISC_TIME;
+								memset(var->sqldata, 0, sizeof(ISC_TIME));
+								break;
+			case SQL_TYPE_DATE :var->sqldata = (char*) new ISC_DATE;
+								memset(var->sqldata, 0, sizeof(ISC_DATE));
+								break;
+			case SQL_TEXT :		var->sqldata = new char[var->sqllen+1];
+								memset(var->sqldata, ' ', var->sqllen);
+								var->sqldata[var->sqllen] = '\0';
+								break;
+			case SQL_VARYING :	var->sqldata = new char[var->sqllen+3];
+								memset(var->sqldata, 0, 2);
+								memset(var->sqldata+2, ' ', var->sqllen);
+								var->sqldata[var->sqllen+2] = '\0';
+								break;
+			case SQL_SHORT :	var->sqldata = (char*) new int16_t(0); break;
+			case SQL_LONG :		var->sqldata = (char*) new int32_t(0); break;
+			case SQL_INT64 :	var->sqldata = (char*) new int64_t(0); break;
+			case SQL_FLOAT : 	var->sqldata = (char*) new float(0.0); break;
+			case SQL_DOUBLE :	var->sqldata = (char*) new double(0.0); break;
+			default : throw LogicExceptionImpl("RowImpl::AllocVariables",
+						_("Found an unknown sqltype !"));
+		}
+		if (var->sqltype & 1) var->sqlind = new short(-1);	// 0 indicator
+	}
+}
+
+bool RowImpl::MissingValues()
+{
+	for (int i = 0; i < mDescrArea->sqld; i++)
+		if (! mUpdated[i]) return true;
+	return false;
+}
+
+RowImpl& RowImpl::operator=(const RowImpl& copied)
+{
+	Free();
+
+	const int n = copied.mDescrArea->sqln;
+	const int size = XSQLDA_LENGTH(n);
+
+	// Initial brute copy
+    mDescrArea = (XSQLDA*) new char[size];
+	memcpy(mDescrArea, copied.mDescrArea, size);
+
+	// Copy of the columns data
+	for (int i = 0; i < mDescrArea->sqld; i++)
+	{
+		XSQLVAR* var = &(mDescrArea->sqlvar[i]);
+		XSQLVAR* org = &(copied.mDescrArea->sqlvar[i]);
+		switch (var->sqltype & ~1)
+		{
+			case SQL_ARRAY :
+			case SQL_BLOB :		var->sqldata = (char*) new ISC_QUAD;
+								memcpy(var->sqldata, org->sqldata, sizeof(ISC_QUAD));
+								break;
+			case SQL_TIMESTAMP :var->sqldata = (char*) new ISC_TIMESTAMP;
+								memcpy(var->sqldata, org->sqldata, sizeof(ISC_TIMESTAMP));
+								break;
+			case SQL_TYPE_TIME :var->sqldata = (char*) new ISC_TIME;
+								memcpy(var->sqldata, org->sqldata, sizeof(ISC_TIME));
+								break;
+			case SQL_TYPE_DATE :var->sqldata = (char*) new ISC_DATE;
+								memcpy(var->sqldata, org->sqldata, sizeof(ISC_DATE));
+								break;
+			case SQL_TEXT :		var->sqldata = new char[var->sqllen+1];
+								memcpy(var->sqldata, org->sqldata, var->sqllen+1);
+								break;
+			case SQL_VARYING :	var->sqldata = new char[var->sqllen+3];
+								memcpy(var->sqldata, org->sqldata, var->sqllen+3);
+								break;
+			case SQL_SHORT :	var->sqldata = (char*) new int16_t(*(int16_t*)org->sqldata); break;
+			case SQL_LONG :		var->sqldata = (char*) new int32_t(*(int32_t*)org->sqldata); break;
+			case SQL_INT64 :	var->sqldata = (char*) new int64_t(*(int64_t*)org->sqldata); break;
+			case SQL_FLOAT : 	var->sqldata = (char*) new float(*(float*)org->sqldata); break;
+			case SQL_DOUBLE :	var->sqldata = (char*) new double(*(double*)org->sqldata); break;
+			default : throw LogicExceptionImpl("RowImpl::Ctor",
+						_("Found an unknown sqltype !"));
+		}
+		if (var->sqltype & 1) var->sqlind = new short(*org->sqlind);	// 0 indicator
+	}
+
+	// Pointers init, real data copy
+	mNumerics = copied.mNumerics;
+	mFloats = copied.mFloats;
+	mInt64s = copied.mInt64s;
+	mInt32s = copied.mInt32s;
+	mInt16s = copied.mInt16s;
+	mBools = copied.mBools;
+	mStrings = copied.mStrings;
+
+	mDialect = copied.mDialect;
+	mDatabase = copied.mDatabase;
+	mTransaction = copied.mTransaction;
+	
+	return *this;
+}
+
+RowImpl::RowImpl(const RowImpl& copied)
+	: IBPP::IRow(), mRefCount(0), mDescrArea(0)
+{
+	// mRefCount and mDescrArea are set to 0 before using the assignment operator
+	*this = copied;		// The assignment operator does the real copy
+}
+
+RowImpl::RowImpl(int dialect, int n, DatabaseImpl* db, TransactionImpl* tr)
+	: mRefCount(0), mDescrArea(0)
+{
+	Resize(n);
+	mDialect = dialect;
+	mDatabase = db;
+	mTransaction = tr;
+}
+
+RowImpl::~RowImpl()
+{
+	try { Free(); }
+		catch (...) { }
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/service.cpp b/src/terralib/drivers/Firebird/ibpp/core/service.cpp
new file mode 100644
index 0000000..1d4d4f4
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/service.cpp
@@ -0,0 +1,774 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: service.cpp 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP, Service class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+using namespace ibpp_internals;
+
+#ifdef IBPP_UNIX
+#include <unistd.h>
+#define Sleep(x) usleep(x)
+#endif
+
+//	(((((((( OBJECT INTERFACE IMPLEMENTATION ))))))))
+
+void ServiceImpl::Connect()
+{
+	if (mHandle	!= 0) return;	// Already connected
+	
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mUserName.empty())
+		throw LogicExceptionImpl("Service::Connect", _("Unspecified user name."));
+	if (mUserPassword.empty())
+		throw LogicExceptionImpl("Service::Connect", _("Unspecified user password."));
+
+	// Attach to the Service Manager
+	IBS status;
+	SPB spb;
+	std::string connect;
+
+	// Build a SPB based on	the	properties
+	spb.Insert(isc_spb_version);
+	spb.Insert(isc_spb_current_version);
+	spb.InsertString(isc_spb_user_name, 1, mUserName.c_str());
+	spb.InsertString(isc_spb_password, 1, mUserPassword.c_str());
+
+	if (! mServerName.empty())
+	{
+		connect = mServerName;
+		connect += ":";
+	}
+
+	connect += "service_mgr";
+
+	(*gds.Call()->m_service_attach)(status.Self(), (short)connect.size(), (char*)connect.c_str(),
+		&mHandle, spb.Size(), spb.Self());
+	if (status.Errors())
+	{
+		mHandle	= 0;		// Should be, but better be	sure...
+		throw SQLExceptionImpl(status, "Service::Connect", _("isc_service_attach failed"));
+	}
+}
+
+void ServiceImpl::Disconnect()
+{
+	if (mHandle	== 0) return; // Already disconnected
+	
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+
+	IBS status;
+
+	// Detach from the service manager
+	(*gds.Call()->m_service_detach)(status.Self(), &mHandle);
+
+	// Set mHandle to 0 now, just in case we need to throw, because Disconnect()
+	// is called from Service destructor and we want to maintain a coherent state.
+	mHandle	= 0;
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::Disconnect", _("isc_service_detach failed"));
+}
+
+void ServiceImpl::GetVersion(std::string& version)
+{
+	// Based on a patch provided by Torsten Martinsen (SourceForge 'bullestock')
+
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Service::GetVersion", _("Service is not connected."));
+
+	IBS status;
+	SPB spb;
+	RB result(250);
+
+	spb.Insert(isc_info_svc_server_version);
+
+	(*gds.Call()->m_service_query)(status.Self(), &mHandle, 0, 0, 0, spb.Size(), spb.Self(),
+		result.Size(), result.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::GetVersion", _("isc_service_query failed"));
+
+	result.GetString(isc_info_svc_server_version, version);
+}
+
+void ServiceImpl::AddUser(const IBPP::User& user)
+{
+	if (gds.Call()->mGDSVersion >= 60 && mHandle == 0)
+		throw LogicExceptionImpl("Service::AddUser", _("Service is not connected."));
+	if (user.username.empty())
+		throw LogicExceptionImpl("Service::AddUser", _("Username required."));
+	if (user.password.empty())
+		throw LogicExceptionImpl("Service::AddUser", _("Password required."));
+
+	IBS status;
+	SPB spb;
+	spb.Insert(isc_action_svc_add_user);
+	spb.InsertString(isc_spb_sec_username, 2, user.username.c_str());
+	spb.InsertString(isc_spb_sec_password, 2, user.password.c_str());
+	if (! user.firstname.empty())
+			spb.InsertString(isc_spb_sec_firstname, 2, user.firstname.c_str());
+	if (! user.middlename.empty())
+			spb.InsertString(isc_spb_sec_middlename, 2, user.middlename.c_str());
+	if (! user.lastname.empty())
+			spb.InsertString(isc_spb_sec_lastname, 2, user.lastname.c_str());
+	if (user.userid != 0)
+			spb.InsertQuad(isc_spb_sec_userid, (int32_t)user.userid);
+	if (user.groupid != 0)
+			spb.InsertQuad(isc_spb_sec_groupid, (int32_t)user.groupid);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::AddUser", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::ModifyUser(const IBPP::User& user)
+{
+	if (gds.Call()->mGDSVersion >= 60 && mHandle == 0)
+		throw LogicExceptionImpl("Service::ModifyUser", _("Service is not connected."));
+	if (user.username.empty())
+		throw LogicExceptionImpl("Service::ModifyUser", _("Username required."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_modify_user);
+	spb.InsertString(isc_spb_sec_username, 2, user.username.c_str());
+	if (! user.password.empty())
+			spb.InsertString(isc_spb_sec_password, 2, user.password.c_str());
+	if (! user.firstname.empty())
+			spb.InsertString(isc_spb_sec_firstname, 2, user.firstname.c_str());
+	if (! user.middlename.empty())
+			spb.InsertString(isc_spb_sec_middlename, 2, user.middlename.c_str());
+	if (! user.lastname.empty())
+			spb.InsertString(isc_spb_sec_lastname, 2, user.lastname.c_str());
+	if (user.userid != 0)
+			spb.InsertQuad(isc_spb_sec_userid, (int32_t)user.userid);
+	if (user.groupid != 0)
+			spb.InsertQuad(isc_spb_sec_groupid, (int32_t)user.groupid);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::ModifyUser", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::RemoveUser(const std::string& username)
+{
+
+	if (gds.Call()->mGDSVersion >= 60 && mHandle == 0)
+		throw LogicExceptionImpl("Service::RemoveUser", _("Service is not connected."));
+	if (username.empty())
+		throw LogicExceptionImpl("Service::RemoveUser", _("Username required."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_delete_user);
+	spb.InsertString(isc_spb_sec_username, 2, username.c_str());
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::RemoveUser", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::GetUser(IBPP::User& user)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Service::GetUser", _("Service is not connected."));
+	if (user.username.empty())
+		throw LogicExceptionImpl("Service::GetUser", _("Username required."));
+
+	SPB spb;
+	spb.Insert(isc_action_svc_display_user);
+	spb.InsertString(isc_spb_sec_username, 2, user.username.c_str());
+
+	IBS status;
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::GetUser", _("isc_service_start failed"));
+
+	RB result(8000);
+	char request[] = {isc_info_svc_get_users};
+	status.Reset();
+	(*gds.Call()->m_service_query)(status.Self(), &mHandle, 0, 0, 0,
+		sizeof(request), request, result.Size(), result.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::GetUser", _("isc_service_query failed"));
+
+	char* p = result.Self();
+	if (*p != isc_info_svc_get_users)
+		throw SQLExceptionImpl(status, "Service::GetUser", _("isc_service_query returned unexpected answer"));
+
+	p += 3;	// Skips the 'isc_info_svc_get_users' and its total length
+	user.clear();
+	while (*p != isc_info_end)
+	{
+		if (*p == isc_spb_sec_userid)
+		{
+			user.userid = (uint32_t)(*gds.Call()->m_vax_integer)(p+1, 4);
+			p += 5;
+		}
+		else if (*p == isc_spb_sec_groupid)
+		{
+			user.groupid = (uint32_t)(*gds.Call()->m_vax_integer)(p+1, 4);
+			p += 5;
+		}
+		else
+		{
+			unsigned short len = (unsigned short)(*gds.Call()->m_vax_integer)(p+1, 2);
+			switch (*p)
+			{
+			case isc_spb_sec_username :
+				// For each user, this is the first element returned
+				if (len != 0) user.username.assign(p+3, len);
+				break;
+			case isc_spb_sec_password :
+				if (len != 0) user.password.assign(p+3, len);
+				break;
+			case isc_spb_sec_firstname :
+				if (len != 0) user.firstname.assign(p+3, len);
+				break;
+			case isc_spb_sec_middlename :
+				if (len != 0) user.middlename.assign(p+3, len);
+				break;
+			case isc_spb_sec_lastname :
+				if (len != 0) user.lastname.assign(p+3, len);
+				break;
+			}
+			p += (3 + len);
+		}
+    }
+}
+
+void ServiceImpl::GetUsers(std::vector<IBPP::User>& users)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Service::GetUsers", _("Service is not connected."));
+
+	SPB spb;
+	spb.Insert(isc_action_svc_display_user);
+
+	IBS status;
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::GetUsers", _("isc_service_start failed"));
+
+	RB result(8000);
+	char request[] = {isc_info_svc_get_users};
+	status.Reset();
+	(*gds.Call()->m_service_query)(status.Self(), &mHandle, 0, 0, 0,
+		sizeof(request), request, result.Size(), result.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::GetUsers", _("isc_service_query failed"));
+
+	users.clear();
+	char* p = result.Self();
+	if (*p != isc_info_svc_get_users)
+		throw SQLExceptionImpl(status, "Service::GetUsers", _("isc_service_query returned unexpected answer"));
+
+	p += 3;	// Skips the 'isc_info_svc_get_users' and its total length
+	IBPP::User user;
+	while (*p != isc_info_end)
+	{
+		if (*p == isc_spb_sec_userid)
+		{
+			user.userid = (uint32_t)(*gds.Call()->m_vax_integer)(p+1, 4);
+			p += 5;
+		}
+		else if (*p == isc_spb_sec_groupid)
+		{
+			user.groupid = (uint32_t)(*gds.Call()->m_vax_integer)(p+1, 4);
+			p += 5;
+		}
+		else
+		{
+			unsigned short len = (unsigned short)(*gds.Call()->m_vax_integer)(p+1, 2);
+			switch (*p)
+			{
+			case isc_spb_sec_username :
+				// For each user, this is the first element returned
+				if (! user.username.empty()) users.push_back(user);	// Flush previous user
+				user.clear();
+				if (len != 0) user.username.assign(p+3, len);
+				break;
+			case isc_spb_sec_password :
+				if (len != 0) user.password.assign(p+3, len);
+				break;
+			case isc_spb_sec_firstname :
+				if (len != 0) user.firstname.assign(p+3, len);
+				break;
+			case isc_spb_sec_middlename :
+				if (len != 0) user.middlename.assign(p+3, len);
+				break;
+			case isc_spb_sec_lastname :
+				if (len != 0) user.lastname.assign(p+3, len);
+				break;
+			}
+			p += (3 + len);
+		}
+    }
+	if (! user.username.empty()) users.push_back(user);	// Flush last user
+}
+
+void ServiceImpl::SetPageBuffers(const std::string& dbfile, int buffers)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::SetPageBuffers", _("Service is not connected."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::SetPageBuffers", _("Main database file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_properties);
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+	spb.InsertQuad(isc_spb_prp_page_buffers, buffers);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::SetPageBuffers", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::SetSweepInterval(const std::string& dbfile, int sweep)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::SetSweepInterval", _("Service is not connected."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::SetSweepInterval", _("Main database file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_properties);
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+	spb.InsertQuad(isc_spb_prp_sweep_interval, sweep);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::SetSweepInterval", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::SetSyncWrite(const std::string& dbfile, bool sync)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::SetSyncWrite", _("Service is not connected."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::SetSyncWrite", _("Main database file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_properties);
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+	if (sync) spb.InsertByte(isc_spb_prp_write_mode, (char)isc_spb_prp_wm_sync);
+	else spb.InsertByte(isc_spb_prp_write_mode, (char)isc_spb_prp_wm_async);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::SetSyncWrite", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::SetReadOnly(const std::string& dbfile, bool readonly)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::SetReadOnly", _("Service is not connected."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::SetReadOnly", _("Main database file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_properties);
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+	if (readonly) spb.InsertByte(isc_spb_prp_access_mode, (char)isc_spb_prp_am_readonly);
+	else spb.InsertByte(isc_spb_prp_access_mode, (char)isc_spb_prp_am_readwrite);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::SetReadOnly", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::SetReserveSpace(const std::string& dbfile, bool reserve)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::SetReserveSpace", _("Service is not connected."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::SetReserveSpace", _("Main database file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_properties);
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+	if (reserve) spb.InsertByte(isc_spb_prp_reserve_space, (char)isc_spb_prp_res);
+	else spb.InsertByte(isc_spb_prp_reserve_space, (char)isc_spb_prp_res_use_full);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::SetReserveSpace", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::Shutdown(const std::string& dbfile, IBPP::DSM mode, int sectimeout)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::Shutdown", _("Service is not connected."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::Shutdown", _("Main database file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_properties);
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+	switch (mode)
+	{
+		case IBPP::dsDenyAttach :
+			spb.InsertQuad(isc_spb_prp_deny_new_attachments, sectimeout);
+			break;
+		case IBPP::dsDenyTrans :
+			spb.InsertQuad(isc_spb_prp_deny_new_transactions, sectimeout);
+			break;
+		case IBPP::dsForce :
+			spb.InsertQuad(isc_spb_prp_shutdown_db, sectimeout);
+			break;
+	}
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::Shutdown", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::Restart(const std::string& dbfile)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::Restart", _("Service is not connected."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::Restart", _("Main database file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_properties);
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+	spb.InsertQuad(isc_spb_options, isc_spb_prp_db_online);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::Restart", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::Sweep(const std::string& dbfile)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::Sweep", _("Service is not connected."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::Sweep", _("Main database file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_repair);
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+	spb.InsertQuad(isc_spb_options, isc_spb_rpr_sweep_db);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::Sweep", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::Repair(const std::string& dbfile, IBPP::RPF flags)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::Repair", _("Service is not connected."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::Repair", _("Main database file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_repair);
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+
+	unsigned int mask;
+	if (flags & IBPP::rpValidateFull) mask = (isc_spb_rpr_full | isc_spb_rpr_validate_db);
+	else if (flags & IBPP::rpValidatePages) mask = isc_spb_rpr_validate_db;
+	else if (flags & IBPP::rpMendRecords) mask = isc_spb_rpr_mend_db;
+	else throw LogicExceptionImpl("Service::Repair",
+		_("One of rpMendRecords, rpValidatePages, rpValidateFull is required."));
+
+	if (flags & IBPP::rpReadOnly)			mask |= isc_spb_rpr_check_db;
+	if (flags & IBPP::rpIgnoreChecksums)	mask |= isc_spb_rpr_ignore_checksum;
+	if (flags & IBPP::rpKillShadows)		mask |= isc_spb_rpr_kill_shadows;
+	
+	spb.InsertQuad(isc_spb_options, mask);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::Repair", _("isc_service_start failed"));
+
+	Wait();
+}
+
+void ServiceImpl::StartBackup(const std::string& dbfile,
+	const std::string& bkfile, IBPP::BRF flags)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::Backup", _("Service is not connected."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::Backup", _("Main database file must be specified."));
+	if (bkfile.empty())
+		throw LogicExceptionImpl("Service::Backup", _("Backup file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_backup);
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+	spb.InsertString(isc_spb_bkp_file, 2, bkfile.c_str());
+	if (flags & IBPP::brVerbose) spb.Insert(isc_spb_verbose);
+
+	unsigned int mask = 0;
+	if (flags & IBPP::brIgnoreChecksums)	mask |= isc_spb_bkp_ignore_checksums;
+	if (flags & IBPP::brIgnoreLimbo)		mask |= isc_spb_bkp_ignore_limbo;
+	if (flags & IBPP::brMetadataOnly)		mask |= isc_spb_bkp_metadata_only;
+	if (flags & IBPP::brNoGarbageCollect)	mask |= isc_spb_bkp_no_garbage_collect;
+	if (flags & IBPP::brNonTransportable)	mask |= isc_spb_bkp_non_transportable;
+	if (flags & IBPP::brConvertExtTables)	mask |= isc_spb_bkp_convert;
+	if (mask != 0) spb.InsertQuad(isc_spb_options, mask);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::Backup", _("isc_service_start failed"));
+}
+
+void ServiceImpl::StartRestore(const std::string& bkfile, const std::string& dbfile,
+	int	pagesize, IBPP::BRF flags)
+{
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+	if (mHandle	== 0)
+		throw LogicExceptionImpl("Service::Restore", _("Service is not connected."));
+	if (bkfile.empty())
+		throw LogicExceptionImpl("Service::Restore", _("Backup file must be specified."));
+	if (dbfile.empty())
+		throw LogicExceptionImpl("Service::Restore", _("Main database file must be specified."));
+
+	IBS status;
+	SPB spb;
+
+	spb.Insert(isc_action_svc_restore);
+	spb.InsertString(isc_spb_bkp_file, 2, bkfile.c_str());
+	spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
+	if (flags & IBPP::brVerbose) spb.Insert(isc_spb_verbose);
+	if (pagesize !=	0) spb.InsertQuad(isc_spb_res_page_size, pagesize);
+
+	unsigned int mask;
+	if (flags & IBPP::brReplace) mask = isc_spb_res_replace;
+		else mask = isc_spb_res_create;	// Safe default mode
+
+	if (flags & IBPP::brDeactivateIdx)	mask |= isc_spb_res_deactivate_idx;
+	if (flags & IBPP::brNoShadow)		mask |= isc_spb_res_no_shadow;
+	if (flags & IBPP::brNoValidity)		mask |= isc_spb_res_no_validity;
+	if (flags & IBPP::brPerTableCommit)	mask |= isc_spb_res_one_at_a_time;
+	if (flags & IBPP::brUseAllSpace)	mask |= isc_spb_res_use_all_space;
+	if (mask != 0) spb.InsertQuad(isc_spb_options, mask);
+
+	(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Service::Restore", _("isc_service_start failed"));
+}
+
+const char* ServiceImpl::WaitMsg()
+{
+	IBS status;
+	SPB req;
+	RB result(1024);
+
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+
+	req.Insert(isc_info_svc_line);	// Request one line of textual output
+
+	// _service_query will only block until a line of result is available
+	// (or until the end of the task if it does not report information)
+	(*gds.Call()->m_service_query)(status.Self(), &mHandle, 0, 0, 0,
+		req.Size(),	req.Self(),	result.Size(), result.Self());
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "ServiceImpl::Wait", _("isc_service_query failed"));
+
+	// If message length is	zero bytes,	task is	finished
+	if (result.GetString(isc_info_svc_line,	mWaitMessage) == 0) return 0;
+
+	// Task	is not finished, but we	have something to report
+	return mWaitMessage.c_str();
+}
+
+void ServiceImpl::Wait()
+{
+	IBS status;
+	SPB spb;
+	RB result(1024);
+	std::string msg;
+
+	if (gds.Call()->mGDSVersion < 60)
+		throw LogicExceptionImpl("Service", _("Requires the version 6 of GDS32.DLL"));
+
+	spb.Insert(isc_info_svc_line);
+	for (;;)
+	{
+		// Sleeps 1 millisecond upfront. This will release the remaining
+		// timeslot of the thread. Doing so will give a good chance for small
+		// services tasks to finish before we check if they are still running.
+		// The deal is to limit (in that particular case) the number of loops
+		// polling _service_query that will happen.
+
+		Sleep(1);
+
+		// _service_query will only block until a line of result is available
+		// (or until the end of the task if it does not report information) 
+		(*gds.Call()->m_service_query)(status.Self(), &mHandle, 0, 0,	0,
+			spb.Size(),	spb.Self(),	result.Size(), result.Self());
+		if (status.Errors())
+			throw SQLExceptionImpl(status, "ServiceImpl::Wait", _("isc_service_query failed"));
+
+		// If message length is	zero bytes,	task is	finished
+		if (result.GetString(isc_info_svc_line,	msg) ==	0) return;
+
+		status.Reset();
+		result.Reset();
+	}
+}
+
+IBPP::IService* ServiceImpl::AddRef()
+{
+	ASSERTION(mRefCount >= 0);
+	++mRefCount;
+	return this;
+}
+
+void ServiceImpl::Release()
+{
+	// Release cannot throw, except in DEBUG builds on assertion
+	ASSERTION(mRefCount >= 0);
+	--mRefCount;
+	try { if (mRefCount <= 0) delete this; }
+		catch (...) { }
+}
+
+//	(((((((( OBJECT INTERNAL METHODS ))))))))
+
+void ServiceImpl::SetServerName(const char* newName)
+{
+	if (newName == 0) mServerName.erase();
+	else mServerName = newName;
+}
+
+void ServiceImpl::SetUserName(const char* newName)
+{
+	if (newName == 0) mUserName.erase();
+	else mUserName = newName;
+}
+
+void ServiceImpl::SetUserPassword(const char* newPassword)
+{
+	if (newPassword == 0) mUserPassword.erase();
+	else mUserPassword = newPassword;
+}
+
+ServiceImpl::ServiceImpl(const std::string& ServerName,
+			const std::string& UserName, const std::string& UserPassword)
+	:	mRefCount(0), mHandle(0),
+		mServerName(ServerName), mUserName(UserName), mUserPassword(UserPassword)
+{
+}
+
+ServiceImpl::~ServiceImpl()
+{
+	try { if (Connected()) Disconnect(); }
+		catch (...) { }
+}
+
+//
+//	Eof
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/statement.cpp b/src/terralib/drivers/Firebird/ibpp/core/statement.cpp
new file mode 100644
index 0000000..aef4490
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/statement.cpp
@@ -0,0 +1,1306 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: statement.cpp 7665 2009-03-03 16:39:22Z fredbed $
+//	Subject : IBPP, Service class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+#include <cstring>
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+using namespace ibpp_internals;
+
+//	(((((((( OBJECT INTERFACE IMPLEMENTATION ))))))))
+
+void StatementImpl::Prepare(const std::string& sql)
+{
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Statement::Prepare", _("An IDatabase must be attached."));
+	if (mDatabase->GetHandle() == 0)
+		throw LogicExceptionImpl("Statement::Prepare", _("IDatabase must be connected."));
+	if (mTransaction == 0)
+		throw LogicExceptionImpl("Statement::Prepare", _("An ITransaction must be attached."));
+	if (mTransaction->GetHandle() == 0)
+		throw LogicExceptionImpl("Statement::Prepare", _("ITransaction must be started."));
+	if (sql.empty())
+		throw LogicExceptionImpl("Statement::Prepare", _("SQL statement can't be 0."));
+
+	// Saves the SQL sentence, only for reporting reasons in case of errors
+	mSql = sql;
+
+	IBS status;
+
+	// Free all resources currently attached to this Statement, then allocate
+	// a new statement descriptor.
+	Close();
+	(*gds.Call()->m_dsql_allocate_statement)(status.Self(), mDatabase->GetHandlePtr(), &mHandle);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Statement::Prepare",
+			_("isc_dsql_allocate_statement failed"));
+
+	// Empirical estimate of parameters count and output columns count.
+	// This is by far not an exact estimation, which would require parsing the
+	// SQL statement. If the SQL statement contains '?' and ',' in string
+	// constants, this count will obviously be wrong, but it will be exagerated.
+	// It won't hurt. We just try to not have to re-allocate those descriptors later.
+	// So we prefer to get them a little bit larger than needed than the other way.
+	int16_t inEstimate = 0;
+	int16_t outEstimate = 1;
+	for (size_t i = 0; i < strlen(sql.c_str()); i++)
+	{
+		if (sql[i] == '?') ++inEstimate;
+		if (sql[i] == ',') ++outEstimate;
+	}
+
+	/*
+	DebugStream()<< "Prepare(\""<< sql<< "\")"<< fds;
+	DebugStream()<< _("Estimation: ")<< inEstimate<< _(" IN parameters and ")
+			<< outEstimate<< _(" OUT columns")<< fds;
+	*/
+
+	// Allocates output descriptor and prepares the statement
+	mOutRow = new RowImpl(mDatabase->Dialect(), outEstimate, mDatabase, mTransaction);
+	mOutRow->AddRef();
+
+	status.Reset();
+	(*gds.Call()->m_dsql_prepare)(status.Self(), mTransaction->GetHandlePtr(),
+		&mHandle, (short)sql.length(), const_cast<char*>(sql.c_str()),
+			short(mDatabase->Dialect()), mOutRow->Self());
+	if (status.Errors())
+	{
+		Close();
+		std::string context = "Statement::Prepare( ";
+		context.append(mSql).append(" )");
+		throw SQLExceptionImpl(status, context.c_str(),
+			_("isc_dsql_prepare failed"));
+	}
+
+	// Read what kind of statement was prepared
+	status.Reset();
+	char itemsReq[] = {isc_info_sql_stmt_type};
+	char itemsRes[8];
+	(*gds.Call()->m_dsql_sql_info)(status.Self(), &mHandle, 1, itemsReq,
+		sizeof(itemsRes), itemsRes);
+	if (status.Errors())
+	{
+		Close();
+		throw SQLExceptionImpl(status, "Statement::Prepare",
+			_("isc_dsql_sql_info failed"));
+	}
+	if (itemsRes[0] == isc_info_sql_stmt_type)
+	{
+		switch (itemsRes[3])
+		{
+			case isc_info_sql_stmt_select :		mType = IBPP::stSelect; break;
+			case isc_info_sql_stmt_insert :		mType = IBPP::stInsert; break;
+			case isc_info_sql_stmt_update :		mType = IBPP::stUpdate; break;
+			case isc_info_sql_stmt_delete :		mType = IBPP::stDelete; break;
+			case isc_info_sql_stmt_ddl :		mType = IBPP::stDDL; break;
+			case isc_info_sql_stmt_exec_procedure : mType = IBPP::stExecProcedure; break;
+			case isc_info_sql_stmt_select_for_upd : mType = IBPP::stSelectUpdate; break;
+			case isc_info_sql_stmt_set_generator :	mType = IBPP::stSetGenerator; break;
+			case isc_info_sql_stmt_savepoint :	mType = IBPP::stSavePoint; break;
+			default : mType = IBPP::stUnsupported;
+		}
+	}
+	if (mType == IBPP::stUnknown || mType == IBPP::stUnsupported)
+	{
+		Close();
+		throw LogicExceptionImpl("Statement::Prepare",
+			_("Unknown or unsupported statement type"));
+	}
+
+	if (mOutRow->Columns() == 0)
+	{
+		// Get rid of the output descriptor, if it wasn't required (no output)
+		mOutRow->Release();
+		mOutRow = 0;
+		/*
+		DebugStream()<< _("Dropped output descriptor which was not required")<< fds;
+		*/
+	}
+	else if (mOutRow->Columns() > mOutRow->AllocatedSize())
+	{
+		// Resize the output descriptor (which is too small).
+		// The statement does not need to be prepared again, though the
+		// output columns must be described again.
+
+		/*
+		DebugStream()<< _("Resize output descriptor from ")
+			<< mOutRow->AllocatedSize()<< _(" to ")<< mOutRow->Columns()<< fds;
+		*/
+
+		mOutRow->Resize(mOutRow->Columns());
+		status.Reset();
+		(*gds.Call()->m_dsql_describe)(status.Self(), &mHandle, 1, mOutRow->Self());
+		if (status.Errors())
+		{
+			Close();
+			throw SQLExceptionImpl(status, "Statement::Prepare",
+				_("isc_dsql_describe failed"));
+		}
+	}
+
+	if (inEstimate > 0)
+	{
+		// Ready an input descriptor
+		mInRow = new RowImpl(mDatabase->Dialect(), inEstimate, mDatabase, mTransaction);
+		mInRow->AddRef();
+
+		status.Reset();
+		(*gds.Call()->m_dsql_describe_bind)(status.Self(), &mHandle, 1, mInRow->Self());
+		if (status.Errors())
+		{
+			Close();
+			throw SQLExceptionImpl(status, "Statement::Prepare",
+				_("isc_dsql_describe_bind failed"));
+		}
+
+		if (mInRow->Columns() == 0)
+		{
+			// Get rid of the input descriptor, if it wasn't required (no parameters)
+			mInRow->Release();
+			mInRow = 0;
+			/*
+			DebugStream()<< _("Dropped input descriptor which was not required")<< fds;
+			*/
+		}
+		else if (mInRow->Columns() > mInRow->AllocatedSize())
+		{
+			// Resize the input descriptor (which is too small).
+			// The statement does not need to be prepared again, though the
+			// parameters must be described again.
+
+			/*
+			DebugStream()<< _("Resize input descriptor from ")
+					<< mInRow->AllocatedSize()<< _(" to ")
+					<< mInRow->Columns()<< fds;
+			*/
+
+			mInRow->Resize(mInRow->Columns());
+			status.Reset();
+			(*gds.Call()->m_dsql_describe_bind)(status.Self(), &mHandle, 1, mInRow->Self());
+			if (status.Errors())
+			{
+				Close();
+				throw SQLExceptionImpl(status, "Statement::Prepare",
+					_("isc_dsql_describe_bind failed"));
+			}
+		}
+	}
+
+	// Allocates variables of the input descriptor
+	if (mInRow != 0)
+	{
+		// Turn on 'can be NULL' on each input parameter
+		for (int i = 0; i < mInRow->Columns(); i++)
+		{
+			XSQLVAR* var = &(mInRow->Self()->sqlvar[i]);
+			if (! (var->sqltype & 1)) var->sqltype += short(1);
+		}
+		mInRow->AllocVariables();
+	}
+
+	// Allocates variables of the output descriptor
+	if (mOutRow != 0) mOutRow->AllocVariables();
+}
+
+void StatementImpl::Plan(std::string& plan)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Plan", _("No statement has been prepared."));
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Statement::Plan", _("A Database must be attached."));
+	if (mDatabase->GetHandle() == 0)
+		throw LogicExceptionImpl("Statement::Plan", _("Database must be connected."));
+
+	IBS status;
+	RB result(4096);
+	char itemsReq[] = {isc_info_sql_get_plan};
+
+	(*gds.Call()->m_dsql_sql_info)(status.Self(), &mHandle, 1, itemsReq,
+								   result.Size(), result.Self());
+	if (status.Errors()) throw SQLExceptionImpl(status,
+								"Statement::Plan", _("isc_dsql_sql_info failed."));
+
+	result.GetString(isc_info_sql_get_plan, plan);
+	if (plan[0] == '\n') plan.erase(0, 1);
+}
+
+void StatementImpl::Execute(const std::string& sql)
+{
+	if (! sql.empty()) Prepare(sql);
+
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Execute",
+			_("No statement has been prepared."));
+
+	// Check that a value has been set for each input parameter
+	if (mInRow != 0 && mInRow->MissingValues())
+		throw LogicExceptionImpl("Statement::Execute",
+			_("All parameters must be specified."));
+
+	CursorFree();	// Free a previous 'cursor' if any
+
+	IBS status;
+	if (mType == IBPP::stSelect)
+	{
+		// Could return a result set (none, single or multi rows)
+		(*gds.Call()->m_dsql_execute)(status.Self(), mTransaction->GetHandlePtr(),
+			&mHandle, 1, mInRow == 0 ? 0 : mInRow->Self());
+		if (status.Errors())
+		{
+			//Close();	Commented because Execute error should not free the statement
+			std::string context = "Statement::Execute( ";
+			context.append(mSql).append(" )");
+			throw SQLExceptionImpl(status, context.c_str(),
+				_("isc_dsql_execute failed"));
+		}
+		if (mOutRow != 0)
+		{
+			mResultSetAvailable = true;
+			mCursorOpened = true;
+		}
+	}
+	else
+	{
+		// Should return at most a single row
+		(*gds.Call()->m_dsql_execute2)(status.Self(), mTransaction->GetHandlePtr(),
+			&mHandle, 1, mInRow == 0 ? 0 : mInRow->Self(),
+			mOutRow == 0 ? 0 : mOutRow->Self());
+		if (status.Errors())
+		{
+			//Close();	Commented because Execute error should not free the statement
+			std::string context = "Statement::Execute( ";
+			context.append(mSql).append(" )");
+			throw SQLExceptionImpl(status, context.c_str(),
+				_("isc_dsql_execute2 failed"));
+		}
+	}
+}
+
+void StatementImpl::CursorExecute(const std::string& cursor, const std::string& sql)
+{
+	if (cursor.empty())
+		throw LogicExceptionImpl("Statement::CursorExecute", _("Cursor name can't be 0."));
+
+	if (! sql.empty()) Prepare(sql);
+
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::CursorExecute", _("No statement has been prepared."));
+	if (mType != IBPP::stSelectUpdate)
+		throw LogicExceptionImpl("Statement::CursorExecute", _("Statement must be a SELECT FOR UPDATE."));
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::CursorExecute", _("Statement would return no rows."));
+
+	// Check that a value has been set for each input parameter
+	if (mInRow != 0 && mInRow->MissingValues())
+		throw LogicExceptionImpl("Statement::CursorExecute",
+			_("All parameters must be specified."));
+
+	CursorFree();	// Free a previous 'cursor' if any
+
+	IBS status;
+	(*gds.Call()->m_dsql_execute)(status.Self(), mTransaction->GetHandlePtr(),
+		&mHandle, 1, mInRow == 0 ? 0 : mInRow->Self());
+	if (status.Errors())
+	{
+		//Close();	Commented because Execute error should not free the statement
+		std::string context = "Statement::CursorExecute( ";
+		context.append(mSql).append(" )");
+		throw SQLExceptionImpl(status, context.c_str(),
+			_("isc_dsql_execute failed"));
+	}
+
+	status.Reset();
+	(*gds.Call()->m_dsql_set_cursor_name)(status.Self(), &mHandle, const_cast<char*>(cursor.c_str()), 0);
+	if (status.Errors())
+	{
+		//Close();	Commented because Execute error should not free the statement
+		throw SQLExceptionImpl(status, "Statement::CursorExecute",
+			_("isc_dsql_set_cursor_name failed"));
+	}
+
+	mResultSetAvailable = true;
+	mCursorOpened = true;
+}
+
+void StatementImpl::ExecuteImmediate(const std::string& sql)
+{
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Statement::ExecuteImmediate", _("An IDatabase must be attached."));
+	if (mDatabase->GetHandle() == 0)
+		throw LogicExceptionImpl("Statement::ExecuteImmediate", _("IDatabase must be connected."));
+	if (mTransaction == 0)
+		throw LogicExceptionImpl("Statement::ExecuteImmediate", _("An ITransaction must be attached."));
+	if (mTransaction->GetHandle() == 0)
+		throw LogicExceptionImpl("Statement::ExecuteImmediate", _("ITransaction must be started."));
+	if (sql.empty())
+		throw LogicExceptionImpl("Statement::ExecuteImmediate", _("SQL statement can't be 0."));
+
+	IBS status;
+	Close();
+    (*gds.Call()->m_dsql_execute_immediate)(status.Self(), mDatabase->GetHandlePtr(),
+    	mTransaction->GetHandlePtr(), 0, const_cast<char*>(sql.c_str()),
+    		short(mDatabase->Dialect()), 0);
+    if (status.Errors())
+	{
+		std::string context = "Statement::ExecuteImmediate( ";
+		context.append(sql).append(" )");
+		throw SQLExceptionImpl(status, context.c_str(),
+			_("isc_dsql_execute_immediate failed"));
+	}
+}
+
+int StatementImpl::AffectedRows()
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::AffectedRows", _("No statement has been prepared."));
+	if (mDatabase == 0)
+		throw LogicExceptionImpl("Statement::AffectedRows", _("A Database must be attached."));
+	if (mDatabase->GetHandle() == 0)
+		throw LogicExceptionImpl("Statement::AffectedRows", _("Database must be connected."));
+
+	int count;
+	IBS status;
+	RB result;
+	char itemsReq[] = {isc_info_sql_records};
+
+	(*gds.Call()->m_dsql_sql_info)(status.Self(), &mHandle, 1, itemsReq,
+		result.Size(), result.Self());
+	if (status.Errors()) throw SQLExceptionImpl(status,
+			"Statement::AffectedRows", _("isc_dsql_sql_info failed."));
+
+	if (mType == IBPP::stInsert)
+			count = result.GetValue(isc_info_sql_records, isc_info_req_insert_count);
+	else if (mType == IBPP::stUpdate)
+			count = result.GetValue(isc_info_sql_records, isc_info_req_update_count);
+	else if (mType == IBPP::stDelete)
+			count = result.GetValue(isc_info_sql_records, isc_info_req_delete_count);
+	else if (mType == IBPP::stSelect)
+			count = result.GetValue(isc_info_sql_records, isc_info_req_select_count);
+	else	count = 0;	// Returns zero count for unknown cases
+
+	return count;
+}
+
+bool StatementImpl::Fetch()
+{
+	if (! mResultSetAvailable)
+		throw LogicExceptionImpl("Statement::Fetch",
+			_("No statement has been executed or no result set available."));
+
+	IBS status;
+	int code = (*gds.Call()->m_dsql_fetch)(status.Self(), &mHandle, 1, mOutRow->Self());
+	if (code == 100)	// This special code means "no more rows"
+	{
+		mResultSetAvailable = false;
+		// Oddly enough, fetching rows up to the last one seems to open
+		// an 'implicit' cursor that needs to be closed.
+		mCursorOpened = true;
+		CursorFree();	// Free the explicit or implicit cursor/result-set
+		return false;
+	}
+	if (status.Errors())
+	{
+		Close();
+		throw SQLExceptionImpl(status, "Statement::Fetch",
+			_("isc_dsql_fetch failed."));
+	}
+
+	return true;
+}
+
+bool StatementImpl::Fetch(IBPP::Row& row)
+{
+	if (! mResultSetAvailable)
+		throw LogicExceptionImpl("Statement::Fetch(row)",
+			_("No statement has been executed or no result set available."));
+
+	RowImpl* rowimpl = new RowImpl(*mOutRow);
+	row = rowimpl;
+
+	IBS status;
+	int code = (*gds.Call()->m_dsql_fetch)(status.Self(), &mHandle, 1,
+					rowimpl->Self());
+	if (code == 100)	// This special code means "no more rows"
+	{
+		mResultSetAvailable = false;
+		// Oddly enough, fetching rows up to the last one seems to open
+		// an 'implicit' cursor that needs to be closed.
+		mCursorOpened = true;
+		CursorFree();	// Free the explicit or implicit cursor/result-set
+		row.clear();
+		return false;
+	}
+	if (status.Errors())
+	{
+		Close();
+		row.clear();
+		throw SQLExceptionImpl(status, "Statement::Fetch(row)",
+			_("isc_dsql_fetch failed."));
+	}
+
+	return true;
+}
+
+void StatementImpl::Close()
+{
+	// Free all statement resources.
+	// Used before preparing a new statement or from destructor.
+
+	if (mInRow != 0) { mInRow->Release(); mInRow = 0; }
+	if (mOutRow != 0) { mOutRow->Release(); mOutRow = 0; }
+
+	mResultSetAvailable = false;
+	mCursorOpened = false;
+	mType = IBPP::stUnknown;
+
+	if (mHandle != 0)
+	{
+		IBS status;
+		(*gds.Call()->m_dsql_free_statement)(status.Self(), &mHandle, DSQL_drop);
+		mHandle = 0;
+		if (status.Errors())
+			throw SQLExceptionImpl(status, "Statement::Close(DSQL_drop)",
+				_("isc_dsql_free_statement failed."));
+	}
+}
+
+void StatementImpl::SetNull(int param)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::SetNull", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::SetNull", _("The statement does not take parameters."));
+
+	mInRow->SetNull(param);
+}
+
+void StatementImpl::Set(int param, bool value)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[bool]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[bool]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, value);
+}
+
+void StatementImpl::Set(int param, const char* cstring)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[char*]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[char*]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, cstring);
+}
+
+void StatementImpl::Set(int param, const void* bindata, int len)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[void*]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[void*]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, bindata, len);
+}
+
+void StatementImpl::Set(int param, const std::string& s)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[string]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[string]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, s);
+}
+
+void StatementImpl::Set(int param, int16_t value)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[int16_t]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[int16_t]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, value);
+}
+
+void StatementImpl::Set(int param, int32_t value)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[int32_t]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[int32_t]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, value);
+}
+
+void StatementImpl::Set(int param, int64_t value)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[int64_t]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[int64_t]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, value);
+}
+
+void StatementImpl::Set(int param, float value)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[float]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[float]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, value);
+}
+
+void StatementImpl::Set(int param, double value)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[double]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[double]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, value);
+}
+
+void StatementImpl::Set(int param, const IBPP::Timestamp& value)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[Timestamp]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[Timestamp]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, value);
+}
+
+void StatementImpl::Set(int param, const IBPP::Date& value)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[Date]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[Date]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, value);
+}
+
+void StatementImpl::Set(int param, const IBPP::Time& value)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[Time]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[Time]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, value);
+}
+
+void StatementImpl::Set(int param, const IBPP::Blob& blob)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[Blob]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[Blob]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, blob);
+}
+
+void StatementImpl::Set(int param, const IBPP::Array& array)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[Array]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[Array]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, array);
+}
+
+void StatementImpl::Set(int param, const IBPP::DBKey& key)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[DBKey]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[DBKey]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, key);
+}
+
+/*
+void StatementImpl::Set(int param, const IBPP::Value& value)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Set[Value]", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Set[Value]", _("The statement does not take parameters."));
+
+	mInRow->Set(param, value);
+}
+*/
+
+bool StatementImpl::IsNull(int column)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::IsNull", _("The row is not initialized."));
+
+	return mOutRow->IsNull(column);
+}
+
+bool StatementImpl::Get(int column, bool* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(column, *retvalue);
+}
+
+bool StatementImpl::Get(int column, bool& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, retvalue);
+}
+
+bool StatementImpl::Get(int column, char* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, retvalue);
+}
+
+bool StatementImpl::Get(int column, void* bindata, int& userlen)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, bindata, userlen);
+}
+
+bool StatementImpl::Get(int column, std::string& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, retvalue);
+}
+
+bool StatementImpl::Get(int column, int16_t* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(column, *retvalue);
+}
+
+bool StatementImpl::Get(int column, int16_t& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, retvalue);
+}
+
+bool StatementImpl::Get(int column, int32_t* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(column, *retvalue);
+}
+
+bool StatementImpl::Get(int column, int32_t& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, retvalue);
+}
+
+bool StatementImpl::Get(int column, int64_t* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(column, *retvalue);
+}
+
+bool StatementImpl::Get(int column, int64_t& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, retvalue);
+}
+
+bool StatementImpl::Get(int column, float* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(column, *retvalue);
+}
+
+bool StatementImpl::Get(int column, float& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, retvalue);
+}
+
+bool StatementImpl::Get(int column, double* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(column, *retvalue);
+}
+
+bool StatementImpl::Get(int column, double& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, retvalue);
+}
+
+bool StatementImpl::Get(int column, IBPP::Timestamp& timestamp)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, timestamp);
+}
+
+bool StatementImpl::Get(int column, IBPP::Date& date)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, date);
+}
+
+bool StatementImpl::Get(int column, IBPP::Time& time)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, time);
+}
+
+bool StatementImpl::Get(int column, IBPP::Blob& blob)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, blob);
+}
+
+bool StatementImpl::Get(int column, IBPP::DBKey& key)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, key);
+}
+
+bool StatementImpl::Get(int column, IBPP::Array& array)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column, array);
+}
+
+/*
+const IBPP::Value StatementImpl::Get(int column)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(column);
+}
+*/
+
+bool StatementImpl::IsNull(const std::string& name)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::IsNull", _("The row is not initialized."));
+
+	return mOutRow->IsNull(name);
+}
+
+bool StatementImpl::Get(const std::string& name, bool* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(name, *retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, bool& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, char* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get[char*]", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, void* retvalue, int& count)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get[void*,int]", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue, count);
+}
+
+bool StatementImpl::Get(const std::string& name, std::string& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::GetString", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, int16_t* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(name, *retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, int16_t& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, int32_t* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(name, *retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, int32_t& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, int64_t* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(name, *retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, int64_t& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, float* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(name, *retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, float& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, double* retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+	if (retvalue == 0)
+		throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
+
+	return mOutRow->Get(name, *retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, double& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, IBPP::Timestamp& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, IBPP::Date& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, IBPP::Time& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string&name, IBPP::Blob& retblob)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retblob);
+}
+
+bool StatementImpl::Get(const std::string& name, IBPP::DBKey& retvalue)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retvalue);
+}
+
+bool StatementImpl::Get(const std::string& name, IBPP::Array& retarray)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name, retarray);
+}
+
+/*
+const IBPP::Value StatementImpl::Get(const std::string& name)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
+
+	return mOutRow->Get(name);
+}
+*/
+
+int StatementImpl::Columns()
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Columns", _("The row is not initialized."));
+
+	return mOutRow->Columns();
+}
+
+int StatementImpl::ColumnNum(const std::string& name)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::ColumnNum", _("The row is not initialized."));
+
+	return mOutRow->ColumnNum(name);
+}
+
+const char* StatementImpl::ColumnName(int varnum)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Columns", _("The row is not initialized."));
+
+	return mOutRow->ColumnName(varnum);
+}
+
+const char* StatementImpl::ColumnAlias(int varnum)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Columns", _("The row is not initialized."));
+
+	return mOutRow->ColumnAlias(varnum);
+}
+
+const char* StatementImpl::ColumnTable(int varnum)
+{
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::Columns", _("The row is not initialized."));
+
+	return mOutRow->ColumnTable(varnum);
+}
+
+IBPP::SDT StatementImpl::ColumnType(int varnum)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::ColumnType", _("No statement has been prepared."));
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::ColumnType", _("The statement does not return results."));
+
+    return mOutRow->ColumnType(varnum);
+}
+
+int StatementImpl::ColumnSubtype(int varnum)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::ColumnSubtype", _("No statement has been prepared."));
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::ColumnSubtype", _("The statement does not return results."));
+
+    return mOutRow->ColumnSubtype(varnum);
+}
+
+int StatementImpl::ColumnSize(int varnum)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::ColumnSize", _("No statement has been prepared."));
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::ColumnSize", _("The row is not initialized."));
+
+	return mOutRow->ColumnSize(varnum);
+}
+
+int StatementImpl::ColumnScale(int varnum)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::ColumnScale", _("No statement has been prepared."));
+	if (mOutRow == 0)
+		throw LogicExceptionImpl("Statement::ColumnScale", _("The row is not initialized."));
+
+	return mOutRow->ColumnScale(varnum);
+}
+
+int StatementImpl::Parameters()
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::Parameters", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::Parameters", _("The statement uses no parameters."));
+
+	return mInRow->Columns();
+}
+
+IBPP::SDT StatementImpl::ParameterType(int varnum)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::ParameterType", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::ParameterType", _("The statement uses no parameters."));
+
+    return mInRow->ColumnType(varnum);
+}
+
+int StatementImpl::ParameterSubtype(int varnum)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::ParameterSubtype", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::ParameterSubtype", _("The statement uses no parameters."));
+
+    return mInRow->ColumnSubtype(varnum);
+}
+
+int StatementImpl::ParameterSize(int varnum)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::ParameterSize", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::ParameterSize", _("The statement uses no parameters."));
+
+	return mInRow->ColumnSize(varnum);
+}
+
+int StatementImpl::ParameterScale(int varnum)
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Statement::ParameterScale", _("No statement has been prepared."));
+	if (mInRow == 0)
+		throw LogicExceptionImpl("Statement::ParameterScale", _("The statement uses no parameters."));
+
+	return mInRow->ColumnScale(varnum);
+}
+
+IBPP::Database StatementImpl::DatabasePtr() const
+{
+	return mDatabase;
+}
+
+IBPP::Transaction StatementImpl::TransactionPtr() const
+{
+	return mTransaction;
+}
+
+IBPP::IStatement* StatementImpl::AddRef()
+{
+	ASSERTION(mRefCount >= 0);
+	++mRefCount;
+
+	return this;
+}
+
+void StatementImpl::Release()
+{
+	// Release cannot throw, except in DEBUG builds on assertion
+	ASSERTION(mRefCount >= 0);
+	--mRefCount;
+	try { if (mRefCount <= 0) delete this; }
+		catch (...) { }
+}
+
+//	(((((((( OBJECT INTERNAL METHODS ))))))))
+
+void StatementImpl::AttachDatabaseImpl(DatabaseImpl* database)
+{
+	if (database == 0)
+		throw LogicExceptionImpl("Statement::AttachDatabase",
+			_("Can't attach a 0 IDatabase object."));
+
+	if (mDatabase != 0) mDatabase->DetachStatementImpl(this);
+	mDatabase = database;
+	mDatabase->AttachStatementImpl(this);
+}
+
+void StatementImpl::DetachDatabaseImpl()
+{
+	if (mDatabase == 0) return;
+
+	Close();
+	mDatabase->DetachStatementImpl(this);
+	mDatabase = 0;
+}
+
+void StatementImpl::AttachTransactionImpl(TransactionImpl* transaction)
+{
+	if (transaction == 0)
+		throw LogicExceptionImpl("Statement::AttachTransaction",
+			_("Can't attach a 0 ITransaction object."));
+
+	if (mTransaction != 0) mTransaction->DetachStatementImpl(this);
+	mTransaction = transaction;
+	mTransaction->AttachStatementImpl(this);
+}
+
+void StatementImpl::DetachTransactionImpl()
+{
+	if (mTransaction == 0) return;
+
+	Close();
+	mTransaction->DetachStatementImpl(this);
+	mTransaction = 0;
+}
+
+void StatementImpl::CursorFree()
+{
+	if (mCursorOpened)
+	{
+		mCursorOpened = false;
+		if (mHandle != 0)
+		{
+			IBS status;
+			(*gds.Call()->m_dsql_free_statement)(status.Self(), &mHandle, DSQL_close);
+			if (status.Errors())
+				throw SQLExceptionImpl(status, "StatementImpl::CursorFree(DSQL_close)",
+					_("isc_dsql_free_statement failed."));
+		}
+	}
+}
+
+StatementImpl::StatementImpl(DatabaseImpl* database, TransactionImpl* transaction,
+	const std::string& sql)
+	: mRefCount(0), mHandle(0), mDatabase(0), mTransaction(0),
+	mInRow(0), mOutRow(0),
+	mResultSetAvailable(false), mCursorOpened(false), mType(IBPP::stUnknown)
+{
+	AttachDatabaseImpl(database);
+	if (transaction != 0) AttachTransactionImpl(transaction);
+	if (! sql.empty()) Prepare(sql);
+}
+
+StatementImpl::~StatementImpl()
+{
+	try { Close(); }
+		catch (...) { }
+	try { if (mTransaction != 0) mTransaction->DetachStatementImpl(this); }
+		catch (...) { }
+	try { if (mDatabase != 0) mDatabase->DetachStatementImpl(this); }
+		catch (...) { }
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/time.cpp b/src/terralib/drivers/Firebird/ibpp/core/time.cpp
new file mode 100644
index 0000000..bb57f55
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/time.cpp
@@ -0,0 +1,208 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: time.cpp 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP, Time class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+#include <time.h>		// Can't use <ctime> thanks to MSVC6 buggy library
+
+using namespace ibpp_internals;
+
+void IBPP::Time::Now()
+{
+	time_t systime = time(0);
+	tm* loctime = localtime(&systime);
+	IBPP::itot(&mTime, loctime->tm_hour, loctime->tm_min, loctime->tm_sec, 0);
+}
+
+void IBPP::Time::SetTime(int tm)
+{
+	if (tm < 0 || tm > 863999999)
+		throw LogicExceptionImpl("Time::SetTime", _("Invalid time value"));
+	mTime = tm;
+}
+
+void IBPP::Time::SetTime(int hour, int minute, int second, int tenthousandths)
+{
+	if (hour < 0 || hour > 23 ||
+		minute < 0 || minute > 59 ||
+			second < 0 || second > 59 ||
+				tenthousandths < 0 || tenthousandths > 9999)
+					throw LogicExceptionImpl("Time::SetTime",
+						_("Invalid hour, minute, second values"));
+	IBPP::itot(&mTime, hour, minute, second, tenthousandths);
+}
+
+void IBPP::Time::GetTime(int& hour, int& minute, int& second) const
+{
+	IBPP::ttoi(mTime, &hour, &minute, &second, 0);
+}
+
+void IBPP::Time::GetTime(int& hour, int& minute, int& second, int& tenthousandths) const
+{
+	IBPP::ttoi(mTime, &hour, &minute, &second, &tenthousandths);
+}
+
+int IBPP::Time::Hours() const
+{
+	int hours;
+	IBPP::ttoi(mTime, &hours, 0, 0, 0);
+	return hours;
+}
+
+int IBPP::Time::Minutes() const
+{
+	int minutes;
+	IBPP::ttoi(mTime, 0, &minutes, 0, 0);
+	return minutes;
+}
+
+int IBPP::Time::Seconds() const
+{
+	int seconds;
+	IBPP::ttoi(mTime, 0, 0, &seconds, 0);
+	return seconds;
+}
+
+int IBPP::Time::SubSeconds() const	// Actually tenthousandths of seconds
+{
+	int tenthousandths;
+	IBPP::ttoi(mTime, 0, 0, 0, &tenthousandths);
+	return tenthousandths;
+}
+
+IBPP::Time::Time(int hour, int minute, int second, int tenthousandths)
+{
+	SetTime(hour, minute, second, tenthousandths);
+}
+
+IBPP::Time::Time(const IBPP::Time& copied)
+{
+	mTime = copied.mTime;
+}
+
+IBPP::Time& IBPP::Time::operator=(const IBPP::Timestamp& assigned)
+{
+	mTime = assigned.GetTime();
+	return *this;
+}
+
+IBPP::Time& IBPP::Time::operator=(const IBPP::Time& assigned)
+{
+	mTime = assigned.mTime;
+	return *this;
+}
+
+//	Time calculations. Internal format is the number of seconds elapsed since
+//	midnight. Splits such a time in its hours, minutes, seconds components.
+
+void IBPP::ttoi(int itime, int *h, int *m, int *s, int* t)
+{
+	int hh, mm, ss, tt;
+
+	hh = (int) (itime / 36000000);	itime = itime - hh * 36000000;
+	mm = (int) (itime / 600000);	itime = itime - mm * 600000;
+	ss = (int) (itime / 10000);
+	tt = (int) (itime - ss * 10000);
+
+	if (h != 0) *h = hh;
+	if (m != 0) *m = mm;
+	if (s != 0) *s = ss;
+	if (t != 0) *t = tt;
+
+	return;
+}
+
+//	Get the internal time format, given hour, minute, second.
+
+void IBPP::itot (int *ptime, int hour, int minute, int second, int tenthousandths)
+{
+	*ptime = hour * 36000000 + minute * 600000 + second * 10000 + tenthousandths;
+	return;
+}
+
+namespace ibpp_internals
+{
+
+//
+//	The following functions are helper conversions functions between IBPP
+//	Date, Time, Timestamp and ISC_DATE, ISC_TIME and ISC_TIMESTAMP.
+//	(They must be maintained if the encoding used by Firebird evolve.)
+//	These helper functions are used from row.cpp and from array.cpp.
+//
+
+void encodeDate(ISC_DATE& isc_dt, const IBPP::Date& dt)
+{
+	// There simply has a shift of 15019 between the native Firebird
+	// date model and the IBPP model.
+	isc_dt = (ISC_DATE)(dt.GetDate() + 15019);
+}
+
+void decodeDate(IBPP::Date& dt, const ISC_DATE& isc_dt)
+{
+	// There simply has a shift of 15019 between the native Firebird
+	// date model and the IBPP model.
+	dt.SetDate((int)isc_dt - 15019);
+}
+
+void encodeTime(ISC_TIME& isc_tm, const IBPP::Time& tm)
+{
+	isc_tm = (ISC_TIME)tm.GetTime();
+}
+
+void decodeTime(IBPP::Time& tm, const ISC_TIME& isc_tm)
+{
+	tm.SetTime((int)isc_tm);
+}
+
+void encodeTimestamp(ISC_TIMESTAMP& isc_ts, const IBPP::Timestamp& ts)
+{
+	encodeDate(isc_ts.timestamp_date, ts);
+	encodeTime(isc_ts.timestamp_time, ts);
+}
+
+void decodeTimestamp(IBPP::Timestamp& ts, const ISC_TIMESTAMP& isc_ts)
+{
+	decodeDate(ts, isc_ts.timestamp_date);
+	decodeTime(ts, isc_ts.timestamp_time);
+}
+
+}
+
+//
+//	EOF
+//
+
diff --git a/src/terralib/drivers/Firebird/ibpp/core/transaction.cpp b/src/terralib/drivers/Firebird/ibpp/core/transaction.cpp
new file mode 100644
index 0000000..2053484
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/transaction.cpp
@@ -0,0 +1,409 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: transaction.cpp 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP, Database class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+#include <algorithm>
+
+using namespace ibpp_internals;
+
+//	(((((((( OBJECT INTERFACE IMPLEMENTATION ))))))))
+
+void TransactionImpl::AttachDatabase(IBPP::Database db,
+	IBPP::TAM am, IBPP::TIL il, IBPP::TLR lr, IBPP::TFF flags)
+{
+	if (db.intf() == 0)
+		throw LogicExceptionImpl("Transaction::AttachDatabase",
+				_("Can't attach an unbound Database."));
+
+	AttachDatabaseImpl(dynamic_cast<DatabaseImpl*>(db.intf()), am, il, lr, flags);
+}
+
+void TransactionImpl::DetachDatabase(IBPP::Database db)
+{
+	if (db.intf() == 0)
+		throw LogicExceptionImpl("Transaction::DetachDatabase",
+				_("Can't detach an unbound Database."));
+
+	DetachDatabaseImpl(dynamic_cast<DatabaseImpl*>(db.intf()));
+}
+
+void TransactionImpl::AddReservation(IBPP::Database db,
+	const std::string& table, IBPP::TTR tr)
+{
+	if (mHandle != 0)
+		throw LogicExceptionImpl("Transaction::AddReservation",
+				_("Can't add table reservation if Transaction started."));
+	if (db.intf() == 0)
+		throw LogicExceptionImpl("Transaction::AddReservation",
+				_("Can't add table reservation on an unbound Database."));
+
+	// Find the TPB associated with this database
+	std::vector<DatabaseImpl*>::iterator pos =
+		std::find(mDatabases.begin(), mDatabases.end(), dynamic_cast<DatabaseImpl*>(db.intf()));
+	if (pos != mDatabases.end())
+	{
+		size_t index = pos - mDatabases.begin();
+		TPB* tpb = mTPBs[index];
+		
+		// Now add the reservations to the TPB
+		switch (tr)
+		{
+			case IBPP::trSharedWrite :
+					tpb->Insert(isc_tpb_lock_write);
+					tpb->Insert(table);
+					tpb->Insert(isc_tpb_shared);
+					break;
+			case IBPP::trSharedRead :
+					tpb->Insert(isc_tpb_lock_read);
+					tpb->Insert(table);
+					tpb->Insert(isc_tpb_shared);
+					break;
+			case IBPP::trProtectedWrite :
+					tpb->Insert(isc_tpb_lock_write);
+					tpb->Insert(table);
+					tpb->Insert(isc_tpb_protected);
+					break;
+			case IBPP::trProtectedRead :
+					tpb->Insert(isc_tpb_lock_read);
+					tpb->Insert(table);
+					tpb->Insert(isc_tpb_protected);
+					break;
+			default :
+					throw LogicExceptionImpl("Transaction::AddReservation",
+						_("Illegal TTR value detected."));
+		}
+	}
+	else throw LogicExceptionImpl("Transaction::AddReservation",
+			_("The database connection you specified is not attached to this transaction."));
+}
+
+void TransactionImpl::Start()
+{
+	if (mHandle != 0) return;	// Already started anyway
+
+	if (mDatabases.empty())
+		throw LogicExceptionImpl("Transaction::Start", _("No Database is attached."));
+
+	struct ISC_TEB
+	{
+		ISC_LONG* db_ptr;
+		ISC_LONG tpb_len;
+		char* tpb_ptr;
+	} * teb = new ISC_TEB[mDatabases.size()];
+
+	unsigned i;
+	for (i = 0; i < mDatabases.size(); i++)
+	{
+		if (mDatabases[i]->GetHandle() == 0)
+		{
+			// All Databases must be connected to Start the transaction !
+			delete [] teb;
+			throw LogicExceptionImpl("Transaction::Start",
+					_("All attached Database should have been connected."));
+		}
+		teb[i].db_ptr = (ISC_LONG*) mDatabases[i]->GetHandlePtr();
+		teb[i].tpb_len = mTPBs[i]->Size();
+		teb[i].tpb_ptr = mTPBs[i]->Self();
+	}
+
+	IBS status;
+	(*gds.Call()->m_start_multiple)(status.Self(), &mHandle, (short)mDatabases.size(), teb);
+	delete [] teb;
+	if (status.Errors())
+	{
+		mHandle = 0;	// Should be, but better be sure...
+		throw SQLExceptionImpl(status, "Transaction::Start");
+	}
+}
+
+void TransactionImpl::Commit()
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Transaction::Commit", _("Transaction is not started."));
+		
+	IBS status;
+
+	(*gds.Call()->m_commit_transaction)(status.Self(), &mHandle);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Transaction::Commit");
+	mHandle = 0;	// Should be, better be sure
+}
+
+void TransactionImpl::CommitRetain()
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Transaction::CommitRetain", _("Transaction is not started."));
+
+	IBS status;
+
+	(*gds.Call()->m_commit_retaining)(status.Self(), &mHandle);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Transaction::CommitRetain");
+}
+
+void TransactionImpl::Rollback()
+{
+	if (mHandle == 0) return;	// Transaction not started anyway
+
+	IBS status;
+
+	(*gds.Call()->m_rollback_transaction)(status.Self(), &mHandle);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Transaction::Rollback");
+	mHandle = 0;	// Should be, better be sure
+}
+
+void TransactionImpl::RollbackRetain()
+{
+	if (mHandle == 0)
+		throw LogicExceptionImpl("Transaction::RollbackRetain", _("Transaction is not started."));
+
+	IBS status;
+
+	(*gds.Call()->m_rollback_retaining)(status.Self(), &mHandle);
+	if (status.Errors())
+		throw SQLExceptionImpl(status, "Transaction::RollbackRetain");
+}
+
+IBPP::ITransaction* TransactionImpl::AddRef()
+{
+	ASSERTION(mRefCount >= 0);
+	++mRefCount;
+	return this;
+}
+
+void TransactionImpl::Release()
+{
+	// Release cannot throw, except in DEBUG builds on assertion
+	ASSERTION(mRefCount >= 0);
+	--mRefCount;
+	try { if (mRefCount <= 0) delete this; }
+		catch (...) { }
+}
+
+//	(((((((( OBJECT INTERNAL METHODS ))))))))
+
+void TransactionImpl::Init()
+{
+	mHandle = 0;
+	mDatabases.clear();
+	mTPBs.clear();
+	mStatements.clear();
+ 	mBlobs.clear();
+	mArrays.clear();
+}
+
+void TransactionImpl::AttachStatementImpl(StatementImpl* st)
+{
+	if (st == 0)
+		throw LogicExceptionImpl("Transaction::AttachStatement",
+					_("Can't attach a 0 Statement object."));
+
+	mStatements.push_back(st);
+}
+
+void TransactionImpl::DetachStatementImpl(StatementImpl* st)
+{
+	if (st == 0)
+		throw LogicExceptionImpl("Transaction::DetachStatement",
+				_("Can't detach a 0 Statement object."));
+
+	mStatements.erase(std::find(mStatements.begin(), mStatements.end(), st));
+}
+
+void TransactionImpl::AttachBlobImpl(BlobImpl* bb)
+{
+	if (bb == 0)
+		throw LogicExceptionImpl("Transaction::AttachBlob",
+					_("Can't attach a 0 BlobImpl object."));
+
+	mBlobs.push_back(bb);
+}
+
+void TransactionImpl::DetachBlobImpl(BlobImpl* bb)
+{
+	if (bb == 0)
+		throw LogicExceptionImpl("Transaction::DetachBlob",
+				_("Can't detach a 0 BlobImpl object."));
+
+	mBlobs.erase(std::find(mBlobs.begin(), mBlobs.end(), bb));
+}
+
+void TransactionImpl::AttachArrayImpl(ArrayImpl* ar)
+{
+	if (ar == 0)
+		throw LogicExceptionImpl("Transaction::AttachArray",
+					_("Can't attach a 0 ArrayImpl object."));
+
+	mArrays.push_back(ar);
+}
+
+void TransactionImpl::DetachArrayImpl(ArrayImpl* ar)
+{
+	if (ar == 0)
+		throw LogicExceptionImpl("Transaction::DetachArray",
+				_("Can't detach a 0 ArrayImpl object."));
+
+	mArrays.erase(std::find(mArrays.begin(), mArrays.end(), ar));
+}
+
+void TransactionImpl::AttachDatabaseImpl(DatabaseImpl* dbi,
+	IBPP::TAM am, IBPP::TIL il, IBPP::TLR lr, IBPP::TFF flags)
+{
+	if (mHandle != 0)
+		throw LogicExceptionImpl("Transaction::AttachDatabase",
+				_("Can't attach a Database if Transaction started."));
+	if (dbi == 0)
+		throw LogicExceptionImpl("Transaction::AttachDatabase",
+				_("Can't attach a null Database."));
+
+	mDatabases.push_back(dbi);
+
+	// Prepare a new TPB
+	TPB* tpb = new TPB;
+    if (am == IBPP::amRead) tpb->Insert(isc_tpb_read);
+    else tpb->Insert(isc_tpb_write);
+
+	switch (il)
+	{
+		case IBPP::ilConsistency :		tpb->Insert(isc_tpb_consistency); break;
+		case IBPP::ilReadDirty :		tpb->Insert(isc_tpb_read_committed);
+						    	    	tpb->Insert(isc_tpb_rec_version); break;
+		case IBPP::ilReadCommitted :	tpb->Insert(isc_tpb_read_committed);
+										tpb->Insert(isc_tpb_no_rec_version); break;
+		default :						tpb->Insert(isc_tpb_concurrency); break;
+	}
+
+    if (lr == IBPP::lrNoWait) tpb->Insert(isc_tpb_nowait);
+    else tpb->Insert(isc_tpb_wait);
+
+	if (flags & IBPP::tfIgnoreLimbo)	tpb->Insert(isc_tpb_ignore_limbo);
+	if (flags & IBPP::tfAutoCommit)		tpb->Insert(isc_tpb_autocommit);
+	if (flags & IBPP::tfNoAutoUndo)		tpb->Insert(isc_tpb_no_auto_undo);
+
+	mTPBs.push_back(tpb);
+
+	// Signals the Database object that it has been attached to the Transaction
+	dbi->AttachTransactionImpl(this);
+}
+
+void TransactionImpl::DetachDatabaseImpl(DatabaseImpl* dbi)
+{
+	if (mHandle != 0)
+		throw LogicExceptionImpl("Transaction::DetachDatabase",
+				_("Can't detach a Database if Transaction started."));
+	if (dbi == 0)
+		throw LogicExceptionImpl("Transaction::DetachDatabase",
+				_("Can't detach a null Database."));
+
+	std::vector<DatabaseImpl*>::iterator pos =
+		std::find(mDatabases.begin(), mDatabases.end(), dbi);
+	if (pos != mDatabases.end())
+	{
+		size_t index = pos - mDatabases.begin();
+		TPB* tpb = mTPBs[index];
+		mDatabases.erase(pos);
+		mTPBs.erase(mTPBs.begin()+index);
+		delete tpb;
+	}
+
+	// Signals the Database object that it has been detached from the Transaction
+	dbi->DetachTransactionImpl(this);
+}
+
+TransactionImpl::TransactionImpl(DatabaseImpl* db,
+	IBPP::TAM am, IBPP::TIL il, IBPP::TLR lr, IBPP::TFF flags)
+	: mRefCount(0)
+{
+	Init();
+	AttachDatabaseImpl(db, am, il, lr, flags);
+}
+
+TransactionImpl::~TransactionImpl()
+{
+	// Rollback the transaction if it was Started
+	try { if (Started()) Rollback(); }
+		catch (...) { }
+
+	// Let's detach cleanly all Blobs from this Transaction.
+	// No Blob object can still maintain pointers to this
+	// Transaction which is disappearing.
+	//
+	// We use a reverse traversal of the array to avoid loops.
+	// The array shrinks on each loop (mBbCount decreases).
+	// And during the deletion, there is a packing of the array through a
+	// copy of elements from the end to the beginning of the array.
+	try {
+		while (mBlobs.size() > 0)
+			mBlobs.back()->DetachTransactionImpl();
+	} catch (...) { }
+
+	// Let's detach cleanly all Arrays from this Transaction.
+	// No Array object can still maintain pointers to this
+	// Transaction which is disappearing.
+	try {
+		while (mArrays.size() > 0)
+			mArrays.back()->DetachTransactionImpl();
+	} catch (...) { }
+
+	// Let's detach cleanly all Statements from this Transaction.
+	// No Statement object can still maintain pointers to this
+	// Transaction which is disappearing.
+	try {
+		while (mStatements.size() > 0)
+			mStatements.back()->DetachTransactionImpl();
+	} catch (...) { }
+
+	// Very important : let's detach cleanly all Databases from this
+	// Transaction. No Database object can still maintain pointers to this
+	// Transaction which is disappearing.
+	try {
+		while (mDatabases.size() > 0)
+		{
+			size_t i = mDatabases.size()-1;
+			DetachDatabaseImpl(mDatabases[i]);	// <-- remove link to database from mTPBs
+											// array and destroy TPB object
+											// Fixed : Maxim Abrashkin on 12 Jun 2002
+			//mDatabases.back()->DetachTransaction(this);
+		}
+	} catch (...) { }
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/Firebird/ibpp/core/user.cpp b/src/terralib/drivers/Firebird/ibpp/core/user.cpp
new file mode 100644
index 0000000..1337d34
--- /dev/null
+++ b/src/terralib/drivers/Firebird/ibpp/core/user.cpp
@@ -0,0 +1,70 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+//	File    : $Id: user.cpp 7637 2009-02-17 18:13:52Z fredbed $
+//	Subject : IBPP, User class implementation
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)
+//
+//	The contents of this file are subject to the IBPP License (the "License");
+//	you may not use this file except in compliance with the License.  You may
+//	obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'
+//	file which must have been distributed along with this file.
+//
+//	This software, distributed under the License, is distributed on an "AS IS"
+//	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the
+//	License for the specific language governing rights and limitations
+//	under the License.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+//	COMMENTS
+//	* Tabulations should be set every four characters when editing this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786 4996)
+#ifndef _DEBUG
+#pragma warning(disable: 4702)
+#endif
+#endif
+
+#include "_ibpp.h"
+
+#ifdef HAS_HDRSTOP
+#pragma hdrstop
+#endif
+
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+
+using namespace ibpp_internals;
+
+//	Private implementation
+
+void IBPP::User::copyfrom(const IBPP::User& r)
+{
+	username = r.username;
+	password = r.password;
+	firstname = r.firstname;
+	middlename = r.middlename;
+	lastname = r.lastname;
+	userid = r.userid;
+	groupid = r.groupid;
+}
+
+//	Public implementation
+
+void IBPP::User::clear()
+{
+	username.erase(); password.erase();
+	firstname.erase(); middlename.erase(); lastname.erase();
+	userid = groupid = 0;
+}
+
+//
+//	EOF
+//
diff --git a/src/terralib/drivers/GL/amesa.h b/src/terralib/drivers/GL/amesa.h
new file mode 100644
index 0000000..c226c60
--- /dev/null
+++ b/src/terralib/drivers/GL/amesa.h
@@ -0,0 +1,65 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  3.3
+ * 
+ * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/* Allegro (DJGPP) driver by Bernhard Tschirren (bernie-t at geocities.com) */
+
+
+#ifndef AMESA_H
+#define AMESA_H
+
+
+#define AMESA_MAJOR_VERSION 3
+#define AMESA_MINOR_VERSION 3
+
+
+typedef struct amesa_visual  *AMesaVisual;
+typedef struct amesa_buffer  *AMesaBuffer;
+typedef struct amesa_context *AMesaContext;
+
+
+extern AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth,
+                                     GLint depthSize,
+                                     GLint stencilSize,
+                                     GLint accumSize);
+
+extern void AMesaDestroyVisual(AMesaVisual visual);
+
+extern AMesaBuffer AMesaCreateBuffer(AMesaVisual visual,
+                                     GLint width, GLint height);
+
+extern void AMesaDestroyBuffer(AMesaBuffer buffer);
+
+
+extern AMesaContext AMesaCreateContext(AMesaVisual visual,
+                                       AMesaContext sharelist);
+
+extern void AMesaDestroyContext(AMesaContext context);
+
+extern GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer);
+
+extern void AMesaSwapBuffers(AMesaBuffer buffer);
+
+
+#endif /* AMESA_H */
diff --git a/src/terralib/drivers/GL/directfbgl.h b/src/terralib/drivers/GL/directfbgl.h
new file mode 100644
index 0000000..b0f8f46
--- /dev/null
+++ b/src/terralib/drivers/GL/directfbgl.h
@@ -0,0 +1,89 @@
+/*
+   (c) Copyright 2001  convergence integrated media GmbH.
+   All rights reserved.
+
+   Written by Denis Oliver Kropp <dok at convergence.de> and
+              Andreas Hundt <andi at convergence.de>.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the
+   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+*/
+
+#ifndef __DIRECTFBGL_H__
+#define __DIRECTFBGL_H__
+
+#include <directfb.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+typedef struct {
+     int        buffer_size;
+     int        depth_size;
+     int        stencil_size;
+     int        aux_buffers;
+    
+     int        red_size;
+     int        green_size;
+     int        blue_size;
+     int        alpha_size;
+
+     int        accum_red_size;
+     int        accum_green_size;
+     int        accum_blue_size;
+     int        accum_alpha_size;
+
+     DFBBoolean double_buffer;
+     DFBBoolean stereo;
+} DFBGLAttributes;
+
+
+DEFINE_INTERFACE(   IDirectFBGL,
+
+   /** Context handling **/
+
+     /*
+      * Acquire the hardware lock.
+      */
+     DFBResult (*Lock) (
+          IDirectFBGL              *thiz
+     );
+
+     /*
+      * Release the lock.
+      */
+     DFBResult (*Unlock) (
+          IDirectFBGL              *thiz
+     );
+
+     /*
+      * Query the OpenGL attributes.
+      */
+     DFBResult (*GetAttributes) (
+          IDirectFBGL              *thiz,
+          DFBGLAttributes          *attributes
+     );
+)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/terralib/drivers/GL/dmesa.h b/src/terralib/drivers/GL/dmesa.h
new file mode 100644
index 0000000..3e7f8ca
--- /dev/null
+++ b/src/terralib/drivers/GL/dmesa.h
@@ -0,0 +1,160 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  6.1
+ * 
+ * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * DOS/DJGPP device driver for Mesa
+ *
+ *  Author: Daniel Borca
+ *  Email : dborca at users.sourceforge.net
+ *  Web   : http://www.geocities.com/dborca
+ */
+
+
+#ifndef DMESA_H_included
+#define DMESA_H_included
+
+#define DMESA_MAJOR_VERSION 6
+#define DMESA_MINOR_VERSION 5
+
+/* Sample Usage:
+ *
+ * 1. Call DMesaCreateVisual() to initialize graphics.
+ * 2. Call DMesaCreateContext() to create a DMesa rendering context.
+ * 3. Call DMesaCreateBuffer() to define the window.
+ * 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext.
+ * 5. Make gl* calls to render your graphics.
+ * 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers.
+ * 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual.
+ */
+
+typedef struct dmesa_context *DMesaContext;
+typedef struct dmesa_visual *DMesaVisual;
+typedef struct dmesa_buffer *DMesaBuffer;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Create a new Visual and set graphics mode.
+ */
+DMesaVisual DMesaCreateVisual (GLint width,        /* X res */
+                               GLint height,       /* Y res */
+                               GLint colDepth,     /* BPP */
+                               GLint refresh,      /* refresh rate: 0=default */
+                               GLboolean dbFlag,   /* double-buffered */
+                               GLboolean rgbFlag,  /* RGB mode */
+                               GLint alphaSize,    /* requested bits/alpha */
+                               GLint depthSize,    /* requested bits/depth */
+                               GLint stencilSize,  /* requested bits/stencil */
+                               GLint accumSize);   /* requested bits/accum */
+
+/*
+ * Destroy Visual and restore screen.
+ */
+void DMesaDestroyVisual (DMesaVisual v);
+
+
+
+/*
+ * Create a new Context for rendering.
+ */
+DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share);
+
+/*
+ * Destroy Context.
+ */
+void DMesaDestroyContext (DMesaContext c);
+
+/*
+ * Return a handle to the current context.
+ */
+DMesaContext DMesaGetCurrentContext (void);
+
+
+
+/*
+ * Create a new Buffer (window).
+ */
+DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
+                               GLint xpos, GLint ypos,
+                               GLint width, GLint height);
+
+/*
+ * Destroy Buffer.
+ */
+void DMesaDestroyBuffer (DMesaBuffer b);
+
+/*
+ * Return a handle to the current buffer.
+ */
+DMesaBuffer DMesaGetCurrentBuffer (void);
+
+/*
+ * Swap the front and back buffers for the given Buffer.
+ * No action is taken if the buffer is not double buffered.
+ */
+void DMesaSwapBuffers (DMesaBuffer b);
+
+/*
+ * Bind Buffer to Context and make the Context the current one.
+ */
+GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
+
+
+
+/*
+ * Move/Resize current Buffer.
+ */
+GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos);
+GLboolean DMesaResizeBuffer (GLint width, GLint height);
+
+/*
+ * Set palette index, using normalized values.
+ */
+void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
+
+/*
+ * DMesa functions
+ */
+typedef void (*DMesaProc) ();
+DMesaProc DMesaGetProcAddress (const char *name);
+
+/*
+ * DMesa state retrieval.
+ */
+#define DMESA_GET_SCREEN_SIZE 0x0100
+#define DMESA_GET_DRIVER_CAPS 0x0200
+#define DMESA_GET_VIDEO_MODES 0x0300
+#define DMESA_GET_BUFFER_ADDR 0x0400
+
+#define DMESA_DRIVER_DBL_BIT 0x1 /* double-buffered */
+#define DMESA_DRIVER_YUP_BIT 0x2 /* lower-left window origin */
+int DMesaGetIntegerv (GLenum pname, GLint *params);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/terralib/drivers/GL/dri_interface.h b/src/terralib/drivers/GL/dri_interface.h
new file mode 100644
index 0000000..f928bb0
--- /dev/null
+++ b/src/terralib/drivers/GL/dri_interface.h
@@ -0,0 +1,477 @@
+/*
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * (C) Copyright IBM Corporation 2004
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file dri_interface.h
+ *
+ * This file contains all the types and functions that define the interface
+ * between a DRI driver and driver loader.  Currently, the most common driver
+ * loader is the XFree86 libGL.so.  However, other loaders do exist, and in
+ * the future the server-side libglx.a will also be a loader.
+ * 
+ * \author Kevin E. Martin <kevin at precisioninsight.com>
+ * \author Ian Romanick <idr at us.ibm.com>
+ */
+
+#ifndef DRI_INTERFACE_H
+#define DRI_INTERFACE_H
+
+#include <GL/internal/glcore.h>
+#include <drm.h>
+
+/**
+ * \name DRI interface structures
+ *
+ * The following structures define the interface between the GLX client
+ * side library and the DRI (direct rendering infrastructure).
+ */
+/*@{*/
+typedef struct __DRIdisplayRec  __DRIdisplay;
+typedef struct __DRIscreenRec   __DRIscreen;
+typedef struct __DRIcontextRec  __DRIcontext;
+typedef struct __DRIdrawableRec __DRIdrawable;
+typedef struct __DRIdriverRec   __DRIdriver;
+typedef struct __DRIframebufferRec __DRIframebuffer;
+typedef struct __DRIversionRec     __DRIversion;
+typedef struct __DRIinterfaceMethodsRec  __DRIinterfaceMethods;
+typedef unsigned long __DRIid;
+typedef void __DRInativeDisplay;
+/*@}*/
+
+
+/**
+ * \name Functions provided by the driver loader.
+ */
+/*@{*/
+/**
+ * Type of a pointer to \c glXGetScreenDriver, as returned by
+ * \c glXGetProcAddress.  This function is used to get the name of the DRI
+ * driver for the specified screen of the specified display.  The driver
+ * name is typically used with \c glXGetDriverConfig.
+ *
+ * \sa glXGetScreenDriver, glXGetProcAddress, glXGetDriverConfig
+ */
+typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int scrNum);
+
+/**
+ * Type of a pointer to \c glXGetDriverConfig, as returned by
+ * \c glXGetProcAddress.  This function is used to get the XML document
+ * describing the configuration options available for the specified driver.
+ *
+ * \sa glXGetDriverConfig, glXGetProcAddress, glXGetScreenDriver
+ */
+typedef const char * (* PFNGLXGETDRIVERCONFIGPROC) (const char *driverName);
+
+/**
+ * Type of a pointer to \c glxEnableExtension, as returned by
+ * \c __DRIinterfaceMethods::getProcAddress.  This function is used to enable
+ * a GLX extension on the specified screen.
+ */
+typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name );
+/*@}*/
+
+
+/**
+ * \name Functions and data provided by the driver.
+ */
+/*@{*/
+
+typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn,
+    __DRIscreen *psc, const __GLcontextModes * modes,
+    const __DRIversion * ddx_version, const __DRIversion * dri_version,
+    const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
+    void * pSAREA, int fd, int internal_api_version,
+    const __DRIinterfaceMethods * interface,
+    __GLcontextModes ** driver_modes);
+typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC;
+extern CREATENEWSCREENFUNC __driCreateNewScreen_20050727;
+
+
+/**
+ * XML document describing the configuration options supported by the
+ * driver.
+ */
+extern const char __driConfigOptions[];
+
+/*@}*/
+
+
+/**
+ * Stored version of some component (i.e., server-side DRI module, kernel-side
+ * DRM, etc.).
+ * 
+ * \todo
+ * There are several data structures that explicitly store a major version,
+ * minor version, and patch level.  These structures should be modified to
+ * have a \c __DRIversionRec instead.
+ */
+struct __DRIversionRec {
+    int    major;        /**< Major version number. */
+    int    minor;        /**< Minor version number. */
+    int    patch;        /**< Patch-level. */
+};
+
+
+typedef void (*__DRIfuncPtr)(void);
+
+struct __DRIinterfaceMethodsRec {
+    /**
+     * Get pointer to named function.
+     */
+    __DRIfuncPtr (*getProcAddress)( const char * proc_name );
+
+    /**
+     * Create a list of \c __GLcontextModes structures.
+     */
+    __GLcontextModes * (*createContextModes)(unsigned count,
+        size_t minimum_bytes_per_struct);
+
+    /**
+     * Destroy a list of \c __GLcontextModes structures.
+     *
+     * \todo
+     * Determine if the drivers actually need to call this.
+     */
+    void (*destroyContextModes)( __GLcontextModes * modes );
+
+    /**
+     * Get the \c __DRIscreen for a given display and screen number.
+     */
+    __DRIscreen *(*getScreen)(__DRInativeDisplay *dpy, int screenNum);
+
+
+    /**
+     * \name Client/server protocol functions.
+     *
+     * These functions implement the DRI client/server protocol for
+     * context and drawable operations.  Platforms that do not implement
+     * the wire protocol (e.g., EGL) will implement glorified no-op functions.
+     */
+    /*@{*/
+    /**
+     * Determine if the specified window ID still exists.
+     * 
+     * \note
+     * Implementations may assume that the driver will only pass an ID into
+     * this function that actually corresponds to a window.  On
+     * implementations where windows can only be destroyed by the DRI driver
+     * (e.g., EGL), this function is allowed to always return \c GL_TRUE.
+     */
+    GLboolean (*windowExists)(__DRInativeDisplay *dpy, __DRIid draw);
+
+    /**
+     * Create the server-side portion of the GL context.
+     */
+    GLboolean (* createContext)( __DRInativeDisplay *dpy, int screenNum,
+        int configID, void * contextID, drm_context_t * hw_context );
+
+    /**
+     * Destroy the server-side portion of the GL context.
+     */
+    GLboolean (* destroyContext)( __DRInativeDisplay *dpy, int screenNum,
+        __DRIid context );
+
+    /**
+     * Create the server-side portion of the drawable.
+     */
+    GLboolean (*createDrawable)( __DRInativeDisplay * ndpy, int screen,
+        __DRIid drawable, drm_drawable_t * hHWDrawable );
+
+    /**
+     * Destroy the server-side portion of the drawable.
+     */
+    GLboolean (*destroyDrawable)( __DRInativeDisplay * ndpy, int screen,
+        __DRIid drawable );
+
+    /**
+     * This function is used to get information about the position, size, and
+     * clip rects of a drawable.
+     */
+    GLboolean (* getDrawableInfo) ( __DRInativeDisplay *dpy, int scrn,
+        __DRIid draw, unsigned int * index, unsigned int * stamp,
+        int * x, int * y, int * width, int * height,
+        int * numClipRects, drm_clip_rect_t ** pClipRects,
+        int * backX, int * backY,
+        int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
+    /*@}*/
+
+
+    /**
+     * \name Timing related functions.
+     */
+    /*@{*/
+    /**
+     * Get the 64-bit unadjusted system time (UST).
+     */
+    int (*getUST)(int64_t * ust);
+
+    /**
+     * Get the media stream counter (MSC) rate.
+     * 
+     * Matching the definition in GLX_OML_sync_control, this function returns
+     * the rate of the "media stream counter".  In practical terms, this is
+     * the frame refresh rate of the display.
+     */
+    GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable,
+        int32_t * numerator, int32_t * denominator);
+    /*@}*/
+};
+
+   
+/**
+ * Framebuffer information record.  Used by libGL to communicate information
+ * about the framebuffer to the driver's \c __driCreateNewScreen function.
+ * 
+ * In XFree86, most of this information is derrived from data returned by
+ * calling \c XF86DRIGetDeviceInfo.
+ *
+ * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
+ *     __driUtilCreateNewScreen CallCreateNewScreen
+ *
+ * \bug This structure could be better named.
+ */
+struct __DRIframebufferRec {
+    unsigned char *base;    /**< Framebuffer base address in the CPU's
+			     * address space.  This value is calculated by
+			     * calling \c drmMap on the framebuffer handle
+			     * returned by \c XF86DRIGetDeviceInfo (or a
+			     * similar function).
+			     */
+    int size;               /**< Framebuffer size, in bytes. */
+    int stride;             /**< Number of bytes from one line to the next. */
+    int width;              /**< Pixel width of the framebuffer. */
+    int height;             /**< Pixel height of the framebuffer. */
+    int dev_priv_size;      /**< Size of the driver's dev-priv structure. */
+    void *dev_priv;         /**< Pointer to the driver's dev-priv structure. */
+};
+
+
+/**
+ * Screen dependent methods.  This structure is initialized during the
+ * \c __DRIdisplayRec::createScreen call.
+ */
+struct __DRIscreenRec {
+    /**
+     * Method to destroy the private DRI screen data.
+     */
+    void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate);
+
+    /**
+     * Method to create the private DRI drawable data and initialize the
+     * drawable dependent methods.
+     */
+    void *(*createNewDrawable)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
+			       __DRIid draw, __DRIdrawable *pdraw,
+			       int renderType, const int *attrs);
+
+    /**
+     * Method to return a pointer to the DRI drawable data.
+     */
+    __DRIdrawable *(*getDrawable)(__DRInativeDisplay *dpy, __DRIid draw,
+				  void *drawablePrivate);
+
+    /**
+     * Opaque pointer to private per screen direct rendering data.  \c NULL
+     * if direct rendering is not supported on this screen.  Never
+     * dereferenced in libGL.
+     */
+    void *private;
+
+    /**
+     * Get the number of vertical refreshes since some point in time before
+     * this function was first called (i.e., system start up).
+     * 
+     * \since Internal API version 20030317.
+     */
+    int (*getMSC)( void *screenPrivate, int64_t *msc );
+
+    /**
+     * Opaque pointer that points back to the containing 
+     * \c __GLXscreenConfigs.  This data structure is shared with DRI drivers
+     * but \c __GLXscreenConfigs is not. However, they are needed by some GLX
+     * functions called by DRI drivers.
+     *
+     * \since Internal API version 20030813.
+     */
+    void *screenConfigs;
+
+    /**
+     * Functions associated with MESA_allocate_memory.
+     *
+     * \since Internal API version 20030815.
+     */
+    /*@{*/
+    void *(*allocateMemory)(__DRInativeDisplay *dpy, int scrn, GLsizei size,
+			    GLfloat readfreq, GLfloat writefreq,
+			    GLfloat priority);
+   
+    void (*freeMemory)(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer);
+   
+    GLuint (*memoryOffset)(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer);
+    /*@}*/
+
+    /**
+     * Method to create the private DRI context data and initialize the
+     * context dependent methods.
+     *
+     * \since Internal API version 20031201.
+     */
+    void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
+			       int render_type,
+			       void *sharedPrivate, __DRIcontext *pctx);
+};
+
+/**
+ * Context dependent methods.  This structure is initialized during the
+ * \c __DRIscreenRec::createContext call.
+ */
+struct __DRIcontextRec {
+    /**
+     * Method to destroy the private DRI context data.
+     */
+    void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate);
+
+    /**
+     * Opaque pointer to private per context direct rendering data.
+     * \c NULL if direct rendering is not supported on the display or
+     * screen used to create this context.  Never dereferenced in libGL.
+     */
+    void *private;
+
+    /**
+     * Pointer to the mode used to create this context.
+     *
+     * \since Internal API version 20040317.
+     */
+    const __GLcontextModes * mode;
+
+    /**
+     * Method to bind a DRI drawable to a DRI graphics context.
+     *
+     * \since Internal API version 20050727.
+     */
+    GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
+			 __DRIid read, __DRIcontext *ctx);
+
+    /**
+     * Method to unbind a DRI drawable from a DRI graphics context.
+     *
+     * \since Internal API version 20050727.
+     */
+    GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
+			   __DRIid read, __DRIcontext *ctx);
+};
+
+/**
+ * Drawable dependent methods.  This structure is initialized during the
+ * \c __DRIscreenRec::createDrawable call.  \c createDrawable is not called
+ * by libGL at this time.  It's currently used via the dri_util.c utility code
+ * instead.
+ */
+struct __DRIdrawableRec {
+    /**
+     * Method to destroy the private DRI drawable data.
+     */
+    void (*destroyDrawable)(__DRInativeDisplay *dpy, void *drawablePrivate);
+
+    /**
+     * Method to swap the front and back buffers.
+     */
+    void (*swapBuffers)(__DRInativeDisplay *dpy, void *drawablePrivate);
+
+    /**
+     * Opaque pointer to private per drawable direct rendering data.
+     * \c NULL if direct rendering is not supported on the display or
+     * screen used to create this drawable.  Never dereferenced in libGL.
+     */
+    void *private;
+
+    /**
+     * Get the number of completed swap buffers for this drawable.
+     *
+     * \since Internal API version 20030317.
+     */
+    int (*getSBC)(__DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc );
+
+    /**
+     * Wait for the SBC to be greater than or equal target_sbc.
+     *
+     * \since Internal API version 20030317.
+     */
+    int (*waitForSBC)( __DRInativeDisplay * dpy, void *drawablePriv,
+		       int64_t target_sbc,
+		       int64_t * msc, int64_t * sbc );
+
+    /**
+     * Wait for the MSC to equal target_msc, or, if that has already passed,
+     * the next time (MSC % divisor) is equal to remainder.  If divisor is
+     * zero, the function will return as soon as MSC is greater than or equal
+     * to target_msc.
+     * 
+     * \since Internal API version 20030317.
+     */
+    int (*waitForMSC)( __DRInativeDisplay * dpy, void *drawablePriv,
+		       int64_t target_msc, int64_t divisor, int64_t remainder,
+		       int64_t * msc, int64_t * sbc );
+
+    /**
+     * Like \c swapBuffers, but does NOT have an implicit \c glFlush.  Once
+     * rendering is complete, waits until MSC is equal to target_msc, or
+     * if that has already passed, waits until (MSC % divisor) is equal
+     * to remainder.  If divisor is zero, the swap will happen as soon as
+     * MSC is greater than or equal to target_msc.
+     * 
+     * \since Internal API version 20030317.
+     */
+    int64_t (*swapBuffersMSC)(__DRInativeDisplay *dpy, void *drawablePrivate,
+			      int64_t target_msc,
+			      int64_t divisor, int64_t remainder);
+
+    /**
+     * Enable or disable frame usage tracking.
+     * 
+     * \since Internal API version 20030317.
+     */
+    int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, GLboolean enable);
+
+    /**
+     * Retrieve frame usage information.
+     * 
+     * \since Internal API version 20030317.
+     */
+    int (*queryFrameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate,
+			      int64_t * sbc, int64_t * missedFrames,
+			      float * lastMissedUsage, float * usage );
+
+    /**
+     * Used by drivers that implement the GLX_SGI_swap_control or
+     * GLX_MESA_swap_control extension.
+     *
+     * \since Internal API version 20030317.
+     */
+    unsigned swap_interval;
+};
+
+#endif
diff --git a/src/terralib/drivers/GL/fxmesa.h b/src/terralib/drivers/GL/fxmesa.h
new file mode 100644
index 0000000..4ac14fb
--- /dev/null
+++ b/src/terralib/drivers/GL/fxmesa.h
@@ -0,0 +1,103 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  4.0
+ * Copyright (C) 1995-2001  Brian Paul
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+/*
+ * FXMesa - 3Dfx Glide driver for Mesa.  Contributed by David Bucciarelli
+ *
+ * NOTE: This version requires Glide3 (http://sourceforge.net/projects/glide)
+ */
+
+
+#ifndef FXMESA_H
+#define FXMESA_H
+
+
+#include <glide.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define FXMESA_MAJOR_VERSION 6
+#define FXMESA_MINOR_VERSION 3
+
+
+/*
+ * Values for attribList parameter to fxMesaCreateContext():
+ */
+#define FXMESA_NONE		0	/* to terminate attribList */
+#define FXMESA_DOUBLEBUFFER	10
+#define FXMESA_ALPHA_SIZE	11      /* followed by an integer */
+#define FXMESA_DEPTH_SIZE	12      /* followed by an integer */
+#define FXMESA_STENCIL_SIZE	13      /* followed by an integer */
+#define FXMESA_ACCUM_SIZE	14      /* followed by an integer */
+#define FXMESA_COLORDEPTH	20      /* followed by an integer */
+#define FXMESA_SHARE_CONTEXT 990099	/* keep in sync with xmesa1.c! */
+
+
+
+typedef struct tfxMesaContext *fxMesaContext;
+
+
+#if defined (__BEOS__)
+#pragma export on
+#endif
+
+
+GLAPI fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, GrScreenResolution_t,
+						  GrScreenRefresh_t,
+						  const GLint attribList[]);
+
+GLAPI fxMesaContext GLAPIENTRY fxMesaCreateBestContext(GLuint win,
+						      GLint width, GLint height,
+						      const GLint attribList[]);
+GLAPI void GLAPIENTRY fxMesaDestroyContext(fxMesaContext ctx);
+
+GLAPI GLint GLAPIENTRY fxMesaSelectCurrentBoard(int n);
+
+GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx);
+
+GLAPI fxMesaContext GLAPIENTRY fxMesaGetCurrentContext(void);
+
+GLAPI void GLAPIENTRY fxMesaSwapBuffers(void);
+
+GLAPI void GLAPIENTRY fxMesaSetNearFar(GLfloat nearVal, GLfloat farVal);
+
+GLAPI void GLAPIENTRY fxMesaUpdateScreenSize(fxMesaContext ctx);
+
+GLAPI void GLAPIENTRY fxCloseHardware(void);
+
+GLAPI void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h);
+
+
+#if defined (__BEOS__)
+#pragma export off
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/src/terralib/drivers/GL/ggimesa.h b/src/terralib/drivers/GL/ggimesa.h
new file mode 100644
index 0000000..80a38e1
--- /dev/null
+++ b/src/terralib/drivers/GL/ggimesa.h
@@ -0,0 +1,85 @@
+/*
+ * Mesa 3-D graphics library GGI bindings (GGIGL [giggle])
+ * Version:  4.0
+ * Copyright (C) 1995-2000  Brian Paul
+ * Copyright (C) 1998  Uwe Maurer
+ * Copyrigth (C) 2001 Filip Spacek
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#ifndef GGIMESA_H
+#define GGIMESA_H
+
+#define GGIMESA_MAJOR_VERSION 4
+#define GGIMESA_MINOR_VERSION 0
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <ggi/ggi.h>
+#include "GL/gl.h"
+  
+typedef struct ggi_mesa_context *ggi_mesa_context_t;
+
+/*
+ * Initialize Mesa GGI extension
+ */
+int ggiMesaInit(void);
+/*
+ * Clean up Mesa GGI exension
+ */
+int ggiMesaExit(void);
+
+/*
+ * Attach Mesa GGI extension to the visual 'vis'
+ */
+int ggiMesaAttach(ggi_visual_t vis);
+/*
+ * Detach Mesa GGI extension from the visual 'vis'
+ */
+int ggiMesaDetach(ggi_visual_t vis);
+
+int ggiMesaExtendVisual(ggi_visual_t vis, GLboolean alpha_flag,
+			GLboolean stereo_flag, GLint depth_size,
+			GLint stencil_size, GLint accum_red_size,
+			GLint accum_green_size, GLint accum_blue_size,
+			GLint accum_alpha_size, GLint num_samples);
+
+/*
+ * Create a new context capable of displaying on the visual vis.
+ */
+ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis);
+/*
+ * Destroy the context 'ctx'
+ */
+void ggiMesaDestroyContext(ggi_mesa_context_t ctx);
+
+/*
+ * Make context 'ctx' the current context and bind it to visual 'vis'.
+ * Note that the context must have been created with respect to that visual.
+ */
+void ggiMesaMakeCurrent(ggi_mesa_context_t ctx, ggi_visual_t vis);
+
+void ggiMesaSwapBuffers(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/terralib/drivers/GL/gl.h b/src/terralib/drivers/GL/gl.h
new file mode 100644
index 0000000..44918a4
--- /dev/null
+++ b/src/terralib/drivers/GL/gl.h
@@ -0,0 +1,2323 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  6.5
+ *
+ * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef __gl_h_
+#define __gl_h_
+
+#if defined(USE_MGL_NAMESPACE)
+#include "gl_mangle.h"
+#endif
+
+
+/**********************************************************************
+ * Begin system-specific stuff. Do not do any of this when building
+ * for SciTech SNAP, as this is all done before this header file is
+ * included. 
+ */
+#if !defined(__SCITECH_SNAP__)
+
+#if defined(__BEOS__)
+#include <stdlib.h>     /* to get some BeOS-isms */
+#endif
+
+#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO))
+#define OPENSTEP
+#endif
+
+#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
+#define __WIN32__
+#endif
+
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
+#  if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+#    define GLAPI __declspec(dllexport)
+#  elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+#    define GLAPI __declspec(dllimport)
+#  else /* for use with static link lib build of Win32 edition only */
+#    define GLAPI extern
+#  endif /* _STATIC_MESA support */
+#  define GLAPIENTRY __stdcall
+#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
+#  define GLAPI extern
+#  define GLAPIENTRY __stdcall
+#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
+#  define GLAPI __attribute__((visibility("default")))
+#  define GLAPIENTRY
+#endif /* WIN32 && !CYGWIN */
+
+#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
+#  define PRAGMA_EXPORT_SUPPORTED		1
+#endif
+
+/*
+ * WINDOWS: Include windows.h here to define APIENTRY.
+ * It is also useful when applications include this file by
+ * including only glut.h, since glut.h depends on windows.h.
+ * Applications needing to include windows.h with parms other
+ * than "WIN32_LEAN_AND_MEAN" may include windows.h before
+ * glut.h or gl.h.
+ */
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
+#include <GL/mesa_wgl.h>
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import on
+#endif
+
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+
+/* "P" suffix to be used for a pointer to a function */
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+#ifdef CENTERLINE_CLPP
+#define signed
+#endif
+
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export on
+#endif
+
+#endif /* !__SCITECH_SNAP__ */
+/*
+ * End system-specific stuff.
+ **********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+#define GL_VERSION_1_1   1
+#define GL_VERSION_1_2   1
+#define GL_VERSION_1_3   1
+#define GL_ARB_imaging   1
+
+
+/*
+ * Datatypes
+ */
+typedef unsigned int	GLenum;
+typedef unsigned char	GLboolean;
+typedef unsigned int	GLbitfield;
+typedef void		GLvoid;
+typedef signed char	GLbyte;		/* 1-byte signed */
+typedef short		GLshort;	/* 2-byte signed */
+typedef int		GLint;		/* 4-byte signed */
+typedef unsigned char	GLubyte;	/* 1-byte unsigned */
+typedef unsigned short	GLushort;	/* 2-byte unsigned */
+typedef unsigned int	GLuint;		/* 4-byte unsigned */
+typedef int		GLsizei;	/* 4-byte signed */
+typedef float		GLfloat;	/* single precision float */
+typedef float		GLclampf;	/* single precision float in [0,1] */
+typedef double		GLdouble;	/* double precision float */
+typedef double		GLclampd;	/* double precision float in [0,1] */
+
+
+
+/*
+ * Constants
+ */
+
+/* Boolean values */
+#define GL_FALSE				0x0
+#define GL_TRUE					0x1
+
+/* Data types */
+#define GL_BYTE					0x1400
+#define GL_UNSIGNED_BYTE			0x1401
+#define GL_SHORT				0x1402
+#define GL_UNSIGNED_SHORT			0x1403
+#define GL_INT					0x1404
+#define GL_UNSIGNED_INT				0x1405
+#define GL_FLOAT				0x1406
+#define GL_2_BYTES				0x1407
+#define GL_3_BYTES				0x1408
+#define GL_4_BYTES				0x1409
+#define GL_DOUBLE				0x140A
+
+/* Primitives */
+#define GL_POINTS				0x0000
+#define GL_LINES				0x0001
+#define GL_LINE_LOOP				0x0002
+#define GL_LINE_STRIP				0x0003
+#define GL_TRIANGLES				0x0004
+#define GL_TRIANGLE_STRIP			0x0005
+#define GL_TRIANGLE_FAN				0x0006
+#define GL_QUADS				0x0007
+#define GL_QUAD_STRIP				0x0008
+#define GL_POLYGON				0x0009
+
+/* Vertex Arrays */
+#define GL_VERTEX_ARRAY				0x8074
+#define GL_NORMAL_ARRAY				0x8075
+#define GL_COLOR_ARRAY				0x8076
+#define GL_INDEX_ARRAY				0x8077
+#define GL_TEXTURE_COORD_ARRAY			0x8078
+#define GL_EDGE_FLAG_ARRAY			0x8079
+#define GL_VERTEX_ARRAY_SIZE			0x807A
+#define GL_VERTEX_ARRAY_TYPE			0x807B
+#define GL_VERTEX_ARRAY_STRIDE			0x807C
+#define GL_NORMAL_ARRAY_TYPE			0x807E
+#define GL_NORMAL_ARRAY_STRIDE			0x807F
+#define GL_COLOR_ARRAY_SIZE			0x8081
+#define GL_COLOR_ARRAY_TYPE			0x8082
+#define GL_COLOR_ARRAY_STRIDE			0x8083
+#define GL_INDEX_ARRAY_TYPE			0x8085
+#define GL_INDEX_ARRAY_STRIDE			0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE		0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE		0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE		0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE		0x808C
+#define GL_VERTEX_ARRAY_POINTER			0x808E
+#define GL_NORMAL_ARRAY_POINTER			0x808F
+#define GL_COLOR_ARRAY_POINTER			0x8090
+#define GL_INDEX_ARRAY_POINTER			0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER		0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER		0x8093
+#define GL_V2F					0x2A20
+#define GL_V3F					0x2A21
+#define GL_C4UB_V2F				0x2A22
+#define GL_C4UB_V3F				0x2A23
+#define GL_C3F_V3F				0x2A24
+#define GL_N3F_V3F				0x2A25
+#define GL_C4F_N3F_V3F				0x2A26
+#define GL_T2F_V3F				0x2A27
+#define GL_T4F_V4F				0x2A28
+#define GL_T2F_C4UB_V3F				0x2A29
+#define GL_T2F_C3F_V3F				0x2A2A
+#define GL_T2F_N3F_V3F				0x2A2B
+#define GL_T2F_C4F_N3F_V3F			0x2A2C
+#define GL_T4F_C4F_N3F_V4F			0x2A2D
+
+/* Matrix Mode */
+#define GL_MATRIX_MODE				0x0BA0
+#define GL_MODELVIEW				0x1700
+#define GL_PROJECTION				0x1701
+#define GL_TEXTURE				0x1702
+
+/* Points */
+#define GL_POINT_SMOOTH				0x0B10
+#define GL_POINT_SIZE				0x0B11
+#define GL_POINT_SIZE_GRANULARITY 		0x0B13
+#define GL_POINT_SIZE_RANGE			0x0B12
+
+/* Lines */
+#define GL_LINE_SMOOTH				0x0B20
+#define GL_LINE_STIPPLE				0x0B24
+#define GL_LINE_STIPPLE_PATTERN			0x0B25
+#define GL_LINE_STIPPLE_REPEAT			0x0B26
+#define GL_LINE_WIDTH				0x0B21
+#define GL_LINE_WIDTH_GRANULARITY		0x0B23
+#define GL_LINE_WIDTH_RANGE			0x0B22
+
+/* Polygons */
+#define GL_POINT				0x1B00
+#define GL_LINE					0x1B01
+#define GL_FILL					0x1B02
+#define GL_CW					0x0900
+#define GL_CCW					0x0901
+#define GL_FRONT				0x0404
+#define GL_BACK					0x0405
+#define GL_POLYGON_MODE				0x0B40
+#define GL_POLYGON_SMOOTH			0x0B41
+#define GL_POLYGON_STIPPLE			0x0B42
+#define GL_EDGE_FLAG				0x0B43
+#define GL_CULL_FACE				0x0B44
+#define GL_CULL_FACE_MODE			0x0B45
+#define GL_FRONT_FACE				0x0B46
+#define GL_POLYGON_OFFSET_FACTOR		0x8038
+#define GL_POLYGON_OFFSET_UNITS			0x2A00
+#define GL_POLYGON_OFFSET_POINT			0x2A01
+#define GL_POLYGON_OFFSET_LINE			0x2A02
+#define GL_POLYGON_OFFSET_FILL			0x8037
+
+/* Display Lists */
+#define GL_COMPILE				0x1300
+#define GL_COMPILE_AND_EXECUTE			0x1301
+#define GL_LIST_BASE				0x0B32
+#define GL_LIST_INDEX				0x0B33
+#define GL_LIST_MODE				0x0B30
+
+/* Depth buffer */
+#define GL_NEVER				0x0200
+#define GL_LESS					0x0201
+#define GL_EQUAL				0x0202
+#define GL_LEQUAL				0x0203
+#define GL_GREATER				0x0204
+#define GL_NOTEQUAL				0x0205
+#define GL_GEQUAL				0x0206
+#define GL_ALWAYS				0x0207
+#define GL_DEPTH_TEST				0x0B71
+#define GL_DEPTH_BITS				0x0D56
+#define GL_DEPTH_CLEAR_VALUE			0x0B73
+#define GL_DEPTH_FUNC				0x0B74
+#define GL_DEPTH_RANGE				0x0B70
+#define GL_DEPTH_WRITEMASK			0x0B72
+#define GL_DEPTH_COMPONENT			0x1902
+
+/* Lighting */
+#define GL_LIGHTING				0x0B50
+#define GL_LIGHT0				0x4000
+#define GL_LIGHT1				0x4001
+#define GL_LIGHT2				0x4002
+#define GL_LIGHT3				0x4003
+#define GL_LIGHT4				0x4004
+#define GL_LIGHT5				0x4005
+#define GL_LIGHT6				0x4006
+#define GL_LIGHT7				0x4007
+#define GL_SPOT_EXPONENT			0x1205
+#define GL_SPOT_CUTOFF				0x1206
+#define GL_CONSTANT_ATTENUATION			0x1207
+#define GL_LINEAR_ATTENUATION			0x1208
+#define GL_QUADRATIC_ATTENUATION		0x1209
+#define GL_AMBIENT				0x1200
+#define GL_DIFFUSE				0x1201
+#define GL_SPECULAR				0x1202
+#define GL_SHININESS				0x1601
+#define GL_EMISSION				0x1600
+#define GL_POSITION				0x1203
+#define GL_SPOT_DIRECTION			0x1204
+#define GL_AMBIENT_AND_DIFFUSE			0x1602
+#define GL_COLOR_INDEXES			0x1603
+#define GL_LIGHT_MODEL_TWO_SIDE			0x0B52
+#define GL_LIGHT_MODEL_LOCAL_VIEWER		0x0B51
+#define GL_LIGHT_MODEL_AMBIENT			0x0B53
+#define GL_FRONT_AND_BACK			0x0408
+#define GL_SHADE_MODEL				0x0B54
+#define GL_FLAT					0x1D00
+#define GL_SMOOTH				0x1D01
+#define GL_COLOR_MATERIAL			0x0B57
+#define GL_COLOR_MATERIAL_FACE			0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER		0x0B56
+#define GL_NORMALIZE				0x0BA1
+
+/* User clipping planes */
+#define GL_CLIP_PLANE0				0x3000
+#define GL_CLIP_PLANE1				0x3001
+#define GL_CLIP_PLANE2				0x3002
+#define GL_CLIP_PLANE3				0x3003
+#define GL_CLIP_PLANE4				0x3004
+#define GL_CLIP_PLANE5				0x3005
+
+/* Accumulation buffer */
+#define GL_ACCUM_RED_BITS			0x0D58
+#define GL_ACCUM_GREEN_BITS			0x0D59
+#define GL_ACCUM_BLUE_BITS			0x0D5A
+#define GL_ACCUM_ALPHA_BITS			0x0D5B
+#define GL_ACCUM_CLEAR_VALUE			0x0B80
+#define GL_ACCUM				0x0100
+#define GL_ADD					0x0104
+#define GL_LOAD					0x0101
+#define GL_MULT					0x0103
+#define GL_RETURN				0x0102
+
+/* Alpha testing */
+#define GL_ALPHA_TEST				0x0BC0
+#define GL_ALPHA_TEST_REF			0x0BC2
+#define GL_ALPHA_TEST_FUNC			0x0BC1
+
+/* Blending */
+#define GL_BLEND				0x0BE2
+#define GL_BLEND_SRC				0x0BE1
+#define GL_BLEND_DST				0x0BE0
+#define GL_ZERO					0x0
+#define GL_ONE					0x1
+#define GL_SRC_COLOR				0x0300
+#define GL_ONE_MINUS_SRC_COLOR			0x0301
+#define GL_SRC_ALPHA				0x0302
+#define GL_ONE_MINUS_SRC_ALPHA			0x0303
+#define GL_DST_ALPHA				0x0304
+#define GL_ONE_MINUS_DST_ALPHA			0x0305
+#define GL_DST_COLOR				0x0306
+#define GL_ONE_MINUS_DST_COLOR			0x0307
+#define GL_SRC_ALPHA_SATURATE			0x0308
+
+/* Render Mode */
+#define GL_FEEDBACK				0x1C01
+#define GL_RENDER				0x1C00
+#define GL_SELECT				0x1C02
+
+/* Feedback */
+#define GL_2D					0x0600
+#define GL_3D					0x0601
+#define GL_3D_COLOR				0x0602
+#define GL_3D_COLOR_TEXTURE			0x0603
+#define GL_4D_COLOR_TEXTURE			0x0604
+#define GL_POINT_TOKEN				0x0701
+#define GL_LINE_TOKEN				0x0702
+#define GL_LINE_RESET_TOKEN			0x0707
+#define GL_POLYGON_TOKEN			0x0703
+#define GL_BITMAP_TOKEN				0x0704
+#define GL_DRAW_PIXEL_TOKEN			0x0705
+#define GL_COPY_PIXEL_TOKEN			0x0706
+#define GL_PASS_THROUGH_TOKEN			0x0700
+#define GL_FEEDBACK_BUFFER_POINTER		0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE			0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE			0x0DF2
+
+/* Selection */
+#define GL_SELECTION_BUFFER_POINTER		0x0DF3
+#define GL_SELECTION_BUFFER_SIZE		0x0DF4
+
+/* Fog */
+#define GL_FOG					0x0B60
+#define GL_FOG_MODE				0x0B65
+#define GL_FOG_DENSITY				0x0B62
+#define GL_FOG_COLOR				0x0B66
+#define GL_FOG_INDEX				0x0B61
+#define GL_FOG_START				0x0B63
+#define GL_FOG_END				0x0B64
+#define GL_LINEAR				0x2601
+#define GL_EXP					0x0800
+#define GL_EXP2					0x0801
+
+/* Logic Ops */
+#define GL_LOGIC_OP				0x0BF1
+#define GL_INDEX_LOGIC_OP			0x0BF1
+#define GL_COLOR_LOGIC_OP			0x0BF2
+#define GL_LOGIC_OP_MODE			0x0BF0
+#define GL_CLEAR				0x1500
+#define GL_SET					0x150F
+#define GL_COPY					0x1503
+#define GL_COPY_INVERTED			0x150C
+#define GL_NOOP					0x1505
+#define GL_INVERT				0x150A
+#define GL_AND					0x1501
+#define GL_NAND					0x150E
+#define GL_OR					0x1507
+#define GL_NOR					0x1508
+#define GL_XOR					0x1506
+#define GL_EQUIV				0x1509
+#define GL_AND_REVERSE				0x1502
+#define GL_AND_INVERTED				0x1504
+#define GL_OR_REVERSE				0x150B
+#define GL_OR_INVERTED				0x150D
+
+/* Stencil */
+#define GL_STENCIL_TEST				0x0B90
+#define GL_STENCIL_WRITEMASK			0x0B98
+#define GL_STENCIL_BITS				0x0D57
+#define GL_STENCIL_FUNC				0x0B92
+#define GL_STENCIL_VALUE_MASK			0x0B93
+#define GL_STENCIL_REF				0x0B97
+#define GL_STENCIL_FAIL				0x0B94
+#define GL_STENCIL_PASS_DEPTH_PASS		0x0B96
+#define GL_STENCIL_PASS_DEPTH_FAIL		0x0B95
+#define GL_STENCIL_CLEAR_VALUE			0x0B91
+#define GL_STENCIL_INDEX			0x1901
+#define GL_KEEP					0x1E00
+#define GL_REPLACE				0x1E01
+#define GL_INCR					0x1E02
+#define GL_DECR					0x1E03
+
+/* Buffers, Pixel Drawing/Reading */
+#define GL_NONE					0x0
+#define GL_LEFT					0x0406
+#define GL_RIGHT				0x0407
+/*GL_FRONT					0x0404 */
+/*GL_BACK					0x0405 */
+/*GL_FRONT_AND_BACK				0x0408 */
+#define GL_FRONT_LEFT				0x0400
+#define GL_FRONT_RIGHT				0x0401
+#define GL_BACK_LEFT				0x0402
+#define GL_BACK_RIGHT				0x0403
+#define GL_AUX0					0x0409
+#define GL_AUX1					0x040A
+#define GL_AUX2					0x040B
+#define GL_AUX3					0x040C
+#define GL_COLOR_INDEX				0x1900
+#define GL_RED					0x1903
+#define GL_GREEN				0x1904
+#define GL_BLUE					0x1905
+#define GL_ALPHA				0x1906
+#define GL_LUMINANCE				0x1909
+#define GL_LUMINANCE_ALPHA			0x190A
+#define GL_ALPHA_BITS				0x0D55
+#define GL_RED_BITS				0x0D52
+#define GL_GREEN_BITS				0x0D53
+#define GL_BLUE_BITS				0x0D54
+#define GL_INDEX_BITS				0x0D51
+#define GL_SUBPIXEL_BITS			0x0D50
+#define GL_AUX_BUFFERS				0x0C00
+#define GL_READ_BUFFER				0x0C02
+#define GL_DRAW_BUFFER				0x0C01
+#define GL_DOUBLEBUFFER				0x0C32
+#define GL_STEREO				0x0C33
+#define GL_BITMAP				0x1A00
+#define GL_COLOR				0x1800
+#define GL_DEPTH				0x1801
+#define GL_STENCIL				0x1802
+#define GL_DITHER				0x0BD0
+#define GL_RGB					0x1907
+#define GL_RGBA					0x1908
+
+/* Implementation limits */
+#define GL_MAX_LIST_NESTING			0x0B31
+#define GL_MAX_ATTRIB_STACK_DEPTH		0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH		0x0D36
+#define GL_MAX_NAME_STACK_DEPTH			0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH		0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH		0x0D39
+#define GL_MAX_EVAL_ORDER			0x0D30
+#define GL_MAX_LIGHTS				0x0D31
+#define GL_MAX_CLIP_PLANES			0x0D32
+#define GL_MAX_TEXTURE_SIZE			0x0D33
+#define GL_MAX_PIXEL_MAP_TABLE			0x0D34
+#define GL_MAX_VIEWPORT_DIMS			0x0D3A
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH	0x0D3B
+
+/* Gets */
+#define GL_ATTRIB_STACK_DEPTH			0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH		0x0BB1
+#define GL_COLOR_CLEAR_VALUE			0x0C22
+#define GL_COLOR_WRITEMASK			0x0C23
+#define GL_CURRENT_INDEX			0x0B01
+#define GL_CURRENT_COLOR			0x0B00
+#define GL_CURRENT_NORMAL			0x0B02
+#define GL_CURRENT_RASTER_COLOR			0x0B04
+#define GL_CURRENT_RASTER_DISTANCE		0x0B09
+#define GL_CURRENT_RASTER_INDEX			0x0B05
+#define GL_CURRENT_RASTER_POSITION		0x0B07
+#define GL_CURRENT_RASTER_TEXTURE_COORDS	0x0B06
+#define GL_CURRENT_RASTER_POSITION_VALID	0x0B08
+#define GL_CURRENT_TEXTURE_COORDS		0x0B03
+#define GL_INDEX_CLEAR_VALUE			0x0C20
+#define GL_INDEX_MODE				0x0C30
+#define GL_INDEX_WRITEMASK			0x0C21
+#define GL_MODELVIEW_MATRIX			0x0BA6
+#define GL_MODELVIEW_STACK_DEPTH		0x0BA3
+#define GL_NAME_STACK_DEPTH			0x0D70
+#define GL_PROJECTION_MATRIX			0x0BA7
+#define GL_PROJECTION_STACK_DEPTH		0x0BA4
+#define GL_RENDER_MODE				0x0C40
+#define GL_RGBA_MODE				0x0C31
+#define GL_TEXTURE_MATRIX			0x0BA8
+#define GL_TEXTURE_STACK_DEPTH			0x0BA5
+#define GL_VIEWPORT				0x0BA2
+
+/* Evaluators */
+#define GL_AUTO_NORMAL				0x0D80
+#define GL_MAP1_COLOR_4				0x0D90
+#define GL_MAP1_INDEX				0x0D91
+#define GL_MAP1_NORMAL				0x0D92
+#define GL_MAP1_TEXTURE_COORD_1			0x0D93
+#define GL_MAP1_TEXTURE_COORD_2			0x0D94
+#define GL_MAP1_TEXTURE_COORD_3			0x0D95
+#define GL_MAP1_TEXTURE_COORD_4			0x0D96
+#define GL_MAP1_VERTEX_3			0x0D97
+#define GL_MAP1_VERTEX_4			0x0D98
+#define GL_MAP2_COLOR_4				0x0DB0
+#define GL_MAP2_INDEX				0x0DB1
+#define GL_MAP2_NORMAL				0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1			0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2			0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3			0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4			0x0DB6
+#define GL_MAP2_VERTEX_3			0x0DB7
+#define GL_MAP2_VERTEX_4			0x0DB8
+#define GL_MAP1_GRID_DOMAIN			0x0DD0
+#define GL_MAP1_GRID_SEGMENTS			0x0DD1
+#define GL_MAP2_GRID_DOMAIN			0x0DD2
+#define GL_MAP2_GRID_SEGMENTS			0x0DD3
+#define GL_COEFF				0x0A00
+#define GL_DOMAIN				0x0A02
+#define GL_ORDER				0x0A01
+
+/* Hints */
+#define GL_FOG_HINT				0x0C54
+#define GL_LINE_SMOOTH_HINT			0x0C52
+#define GL_PERSPECTIVE_CORRECTION_HINT		0x0C50
+#define GL_POINT_SMOOTH_HINT			0x0C51
+#define GL_POLYGON_SMOOTH_HINT			0x0C53
+#define GL_DONT_CARE				0x1100
+#define GL_FASTEST				0x1101
+#define GL_NICEST				0x1102
+
+/* Scissor box */
+#define GL_SCISSOR_TEST				0x0C11
+#define GL_SCISSOR_BOX				0x0C10
+
+/* Pixel Mode / Transfer */
+#define GL_MAP_COLOR				0x0D10
+#define GL_MAP_STENCIL				0x0D11
+#define GL_INDEX_SHIFT				0x0D12
+#define GL_INDEX_OFFSET				0x0D13
+#define GL_RED_SCALE				0x0D14
+#define GL_RED_BIAS				0x0D15
+#define GL_GREEN_SCALE				0x0D18
+#define GL_GREEN_BIAS				0x0D19
+#define GL_BLUE_SCALE				0x0D1A
+#define GL_BLUE_BIAS				0x0D1B
+#define GL_ALPHA_SCALE				0x0D1C
+#define GL_ALPHA_BIAS				0x0D1D
+#define GL_DEPTH_SCALE				0x0D1E
+#define GL_DEPTH_BIAS				0x0D1F
+#define GL_PIXEL_MAP_S_TO_S_SIZE		0x0CB1
+#define GL_PIXEL_MAP_I_TO_I_SIZE		0x0CB0
+#define GL_PIXEL_MAP_I_TO_R_SIZE		0x0CB2
+#define GL_PIXEL_MAP_I_TO_G_SIZE		0x0CB3
+#define GL_PIXEL_MAP_I_TO_B_SIZE		0x0CB4
+#define GL_PIXEL_MAP_I_TO_A_SIZE		0x0CB5
+#define GL_PIXEL_MAP_R_TO_R_SIZE		0x0CB6
+#define GL_PIXEL_MAP_G_TO_G_SIZE		0x0CB7
+#define GL_PIXEL_MAP_B_TO_B_SIZE		0x0CB8
+#define GL_PIXEL_MAP_A_TO_A_SIZE		0x0CB9
+#define GL_PIXEL_MAP_S_TO_S			0x0C71
+#define GL_PIXEL_MAP_I_TO_I			0x0C70
+#define GL_PIXEL_MAP_I_TO_R			0x0C72
+#define GL_PIXEL_MAP_I_TO_G			0x0C73
+#define GL_PIXEL_MAP_I_TO_B			0x0C74
+#define GL_PIXEL_MAP_I_TO_A			0x0C75
+#define GL_PIXEL_MAP_R_TO_R			0x0C76
+#define GL_PIXEL_MAP_G_TO_G			0x0C77
+#define GL_PIXEL_MAP_B_TO_B			0x0C78
+#define GL_PIXEL_MAP_A_TO_A			0x0C79
+#define GL_PACK_ALIGNMENT			0x0D05
+#define GL_PACK_LSB_FIRST			0x0D01
+#define GL_PACK_ROW_LENGTH			0x0D02
+#define GL_PACK_SKIP_PIXELS			0x0D04
+#define GL_PACK_SKIP_ROWS			0x0D03
+#define GL_PACK_SWAP_BYTES			0x0D00
+#define GL_UNPACK_ALIGNMENT			0x0CF5
+#define GL_UNPACK_LSB_FIRST			0x0CF1
+#define GL_UNPACK_ROW_LENGTH			0x0CF2
+#define GL_UNPACK_SKIP_PIXELS			0x0CF4
+#define GL_UNPACK_SKIP_ROWS			0x0CF3
+#define GL_UNPACK_SWAP_BYTES			0x0CF0
+#define GL_ZOOM_X				0x0D16
+#define GL_ZOOM_Y				0x0D17
+
+/* Texture mapping */
+#define GL_TEXTURE_ENV				0x2300
+#define GL_TEXTURE_ENV_MODE			0x2200
+#define GL_TEXTURE_1D				0x0DE0
+#define GL_TEXTURE_2D				0x0DE1
+#define GL_TEXTURE_WRAP_S			0x2802
+#define GL_TEXTURE_WRAP_T			0x2803
+#define GL_TEXTURE_MAG_FILTER			0x2800
+#define GL_TEXTURE_MIN_FILTER			0x2801
+#define GL_TEXTURE_ENV_COLOR			0x2201
+#define GL_TEXTURE_GEN_S			0x0C60
+#define GL_TEXTURE_GEN_T			0x0C61
+#define GL_TEXTURE_GEN_MODE			0x2500
+#define GL_TEXTURE_BORDER_COLOR			0x1004
+#define GL_TEXTURE_WIDTH			0x1000
+#define GL_TEXTURE_HEIGHT			0x1001
+#define GL_TEXTURE_BORDER			0x1005
+#define GL_TEXTURE_COMPONENTS			0x1003
+#define GL_TEXTURE_RED_SIZE			0x805C
+#define GL_TEXTURE_GREEN_SIZE			0x805D
+#define GL_TEXTURE_BLUE_SIZE			0x805E
+#define GL_TEXTURE_ALPHA_SIZE			0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE		0x8060
+#define GL_TEXTURE_INTENSITY_SIZE		0x8061
+#define GL_NEAREST_MIPMAP_NEAREST		0x2700
+#define GL_NEAREST_MIPMAP_LINEAR		0x2702
+#define GL_LINEAR_MIPMAP_NEAREST		0x2701
+#define GL_LINEAR_MIPMAP_LINEAR			0x2703
+#define GL_OBJECT_LINEAR			0x2401
+#define GL_OBJECT_PLANE				0x2501
+#define GL_EYE_LINEAR				0x2400
+#define GL_EYE_PLANE				0x2502
+#define GL_SPHERE_MAP				0x2402
+#define GL_DECAL				0x2101
+#define GL_MODULATE				0x2100
+#define GL_NEAREST				0x2600
+#define GL_REPEAT				0x2901
+#define GL_CLAMP				0x2900
+#define GL_S					0x2000
+#define GL_T					0x2001
+#define GL_R					0x2002
+#define GL_Q					0x2003
+#define GL_TEXTURE_GEN_R			0x0C62
+#define GL_TEXTURE_GEN_Q			0x0C63
+
+/* Utility */
+#define GL_VENDOR				0x1F00
+#define GL_RENDERER				0x1F01
+#define GL_VERSION				0x1F02
+#define GL_EXTENSIONS				0x1F03
+
+/* Errors */
+#define GL_NO_ERROR 				0x0
+#define GL_INVALID_VALUE			0x0501
+#define GL_INVALID_ENUM				0x0500
+#define GL_INVALID_OPERATION			0x0502
+#define GL_STACK_OVERFLOW			0x0503
+#define GL_STACK_UNDERFLOW			0x0504
+#define GL_OUT_OF_MEMORY			0x0505
+
+/* glPush/PopAttrib bits */
+#define GL_CURRENT_BIT				0x00000001
+#define GL_POINT_BIT				0x00000002
+#define GL_LINE_BIT				0x00000004
+#define GL_POLYGON_BIT				0x00000008
+#define GL_POLYGON_STIPPLE_BIT			0x00000010
+#define GL_PIXEL_MODE_BIT			0x00000020
+#define GL_LIGHTING_BIT				0x00000040
+#define GL_FOG_BIT				0x00000080
+#define GL_DEPTH_BUFFER_BIT			0x00000100
+#define GL_ACCUM_BUFFER_BIT			0x00000200
+#define GL_STENCIL_BUFFER_BIT			0x00000400
+#define GL_VIEWPORT_BIT				0x00000800
+#define GL_TRANSFORM_BIT			0x00001000
+#define GL_ENABLE_BIT				0x00002000
+#define GL_COLOR_BUFFER_BIT			0x00004000
+#define GL_HINT_BIT				0x00008000
+#define GL_EVAL_BIT				0x00010000
+#define GL_LIST_BIT				0x00020000
+#define GL_TEXTURE_BIT				0x00040000
+#define GL_SCISSOR_BIT				0x00080000
+#define GL_ALL_ATTRIB_BITS			0x000FFFFF
+
+
+/* OpenGL 1.1 */
+#define GL_PROXY_TEXTURE_1D			0x8063
+#define GL_PROXY_TEXTURE_2D			0x8064
+#define GL_TEXTURE_PRIORITY			0x8066
+#define GL_TEXTURE_RESIDENT			0x8067
+#define GL_TEXTURE_BINDING_1D			0x8068
+#define GL_TEXTURE_BINDING_2D			0x8069
+#define GL_TEXTURE_INTERNAL_FORMAT		0x1003
+#define GL_ALPHA4				0x803B
+#define GL_ALPHA8				0x803C
+#define GL_ALPHA12				0x803D
+#define GL_ALPHA16				0x803E
+#define GL_LUMINANCE4				0x803F
+#define GL_LUMINANCE8				0x8040
+#define GL_LUMINANCE12				0x8041
+#define GL_LUMINANCE16				0x8042
+#define GL_LUMINANCE4_ALPHA4			0x8043
+#define GL_LUMINANCE6_ALPHA2			0x8044
+#define GL_LUMINANCE8_ALPHA8			0x8045
+#define GL_LUMINANCE12_ALPHA4			0x8046
+#define GL_LUMINANCE12_ALPHA12			0x8047
+#define GL_LUMINANCE16_ALPHA16			0x8048
+#define GL_INTENSITY				0x8049
+#define GL_INTENSITY4				0x804A
+#define GL_INTENSITY8				0x804B
+#define GL_INTENSITY12				0x804C
+#define GL_INTENSITY16				0x804D
+#define GL_R3_G3_B2				0x2A10
+#define GL_RGB4					0x804F
+#define GL_RGB5					0x8050
+#define GL_RGB8					0x8051
+#define GL_RGB10				0x8052
+#define GL_RGB12				0x8053
+#define GL_RGB16				0x8054
+#define GL_RGBA2				0x8055
+#define GL_RGBA4				0x8056
+#define GL_RGB5_A1				0x8057
+#define GL_RGBA8				0x8058
+#define GL_RGB10_A2				0x8059
+#define GL_RGBA12				0x805A
+#define GL_RGBA16				0x805B
+#define GL_CLIENT_PIXEL_STORE_BIT		0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT		0x00000002
+#define GL_ALL_CLIENT_ATTRIB_BITS 		0xFFFFFFFF
+#define GL_CLIENT_ALL_ATTRIB_BITS 		0xFFFFFFFF
+
+
+
+/*
+ * Miscellaneous
+ */
+
+GLAPI void GLAPIENTRY glClearIndex( GLfloat c );
+
+GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glClear( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glIndexMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
+
+GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref );
+
+GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor );
+
+GLAPI void GLAPIENTRY glLogicOp( GLenum opcode );
+
+GLAPI void GLAPIENTRY glCullFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glFrontFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glPointSize( GLfloat size );
+
+GLAPI void GLAPIENTRY glLineWidth( GLfloat width );
+
+GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern );
+
+GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode );
+
+GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units );
+
+GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask );
+
+GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask );
+
+GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag );
+
+GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag );
+
+GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height);
+
+GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation );
+
+GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation );
+
+GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glReadBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnable( GLenum cap );
+
+GLAPI void GLAPIENTRY glDisable( GLenum cap );
+
+GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap );
+
+
+GLAPI void GLAPIENTRY glEnableClientState( GLenum cap );  /* 1.1 */
+
+GLAPI void GLAPIENTRY glDisableClientState( GLenum cap );  /* 1.1 */
+
+
+GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params );
+
+GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params );
+
+GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glPopAttrib( void );
+
+
+GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask );  /* 1.1 */
+
+GLAPI void GLAPIENTRY glPopClientAttrib( void );  /* 1.1 */
+
+
+GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
+
+GLAPI GLenum GLAPIENTRY glGetError( void );
+
+GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
+
+GLAPI void GLAPIENTRY glFinish( void );
+
+GLAPI void GLAPIENTRY glFlush( void );
+
+GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode );
+
+
+/*
+ * Depth Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearDepth( GLclampd depth );
+
+GLAPI void GLAPIENTRY glDepthFunc( GLenum func );
+
+GLAPI void GLAPIENTRY glDepthMask( GLboolean flag );
+
+GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val );
+
+
+/*
+ * Accumulation Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
+
+GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value );
+
+
+/*
+ * Transformation
+ */
+
+GLAPI void GLAPIENTRY glMatrixMode( GLenum mode );
+
+GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right,
+                                 GLdouble bottom, GLdouble top,
+                                 GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right,
+                                   GLdouble bottom, GLdouble top,
+                                   GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glViewport( GLint x, GLint y,
+                                    GLsizei width, GLsizei height );
+
+GLAPI void GLAPIENTRY glPushMatrix( void );
+
+GLAPI void GLAPIENTRY glPopMatrix( void );
+
+GLAPI void GLAPIENTRY glLoadIdentity( void );
+
+GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glRotated( GLdouble angle,
+                                   GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRotatef( GLfloat angle,
+                                   GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z );
+
+
+/*
+ * Display Lists
+ */
+
+GLAPI GLboolean GLAPIENTRY glIsList( GLuint list );
+
+GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range );
+
+GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range );
+
+GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode );
+
+GLAPI void GLAPIENTRY glEndList( void );
+
+GLAPI void GLAPIENTRY glCallList( GLuint list );
+
+GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type,
+                                     const GLvoid *lists );
+
+GLAPI void GLAPIENTRY glListBase( GLuint base );
+
+
+/*
+ * Drawing Functions
+ */
+
+GLAPI void GLAPIENTRY glBegin( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnd( void );
+
+
+GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex2iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex3iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex4iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz );
+GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz );
+GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz );
+GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz );
+GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz );
+
+GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glNormal3iv( const GLint *v );
+GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glIndexd( GLdouble c );
+GLAPI void GLAPIENTRY glIndexf( GLfloat c );
+GLAPI void GLAPIENTRY glIndexi( GLint c );
+GLAPI void GLAPIENTRY glIndexs( GLshort c );
+GLAPI void GLAPIENTRY glIndexub( GLubyte c );  /* 1.1 */
+
+GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c );
+GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c );
+GLAPI void GLAPIENTRY glIndexiv( const GLint *c );
+GLAPI void GLAPIENTRY glIndexsv( const GLshort *c );
+GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c );  /* 1.1 */
+
+GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue );
+GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue );
+GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue );
+GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue );
+GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue );
+GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue );
+GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue );
+GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue );
+
+GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green,
+                                   GLbyte blue, GLbyte alpha );
+GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green,
+                                   GLdouble blue, GLdouble alpha );
+GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green,
+                                   GLfloat blue, GLfloat alpha );
+GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green,
+                                   GLint blue, GLint alpha );
+GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green,
+                                   GLshort blue, GLshort alpha );
+GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green,
+                                    GLubyte blue, GLubyte alpha );
+GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green,
+                                    GLuint blue, GLuint alpha );
+GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green,
+                                    GLushort blue, GLushort alpha );
+
+
+GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor3iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor3sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor3usv( const GLushort *v );
+
+GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor4iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor4sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor4usv( const GLushort *v );
+
+
+GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s );
+GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s );
+GLAPI void GLAPIENTRY glTexCoord1i( GLint s );
+GLAPI void GLAPIENTRY glTexCoord1s( GLshort s );
+
+GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t );
+GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t );
+GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t );
+GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r );
+GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r );
+GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r );
+GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q );
+GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 );
+GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
+GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 );
+GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 );
+
+
+GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 );
+GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 );
+GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 );
+GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 );
+
+
+/*
+ * Vertex Arrays  (1.1)
+ */
+
+GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type,
+                                       GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride,
+                                       const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type,
+                                      GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride,
+                                      const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type,
+                                         GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params );
+
+GLAPI void GLAPIENTRY glArrayElement( GLint i );
+
+GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count );
+
+GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count,
+                                      GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride,
+                                           const GLvoid *pointer );
+
+/*
+ * Lighting
+ */
+
+GLAPI void GLAPIENTRY glShadeModel( GLenum mode );
+
+GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname,
+                                 const GLfloat *params );
+GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname,
+                                 const GLint *params );
+
+GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname,
+                                    GLfloat *params );
+GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname,
+                                    GLint *params );
+
+GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode );
+
+
+/*
+ * Raster functions
+ */
+
+GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor );
+
+GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize,
+                                    const GLfloat *values );
+GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize,
+                                     const GLuint *values );
+GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize,
+                                     const GLushort *values );
+
+GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values );
+GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values );
+GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values );
+
+GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height,
+                                GLfloat xorig, GLfloat yorig,
+                                GLfloat xmove, GLfloat ymove,
+                                const GLubyte *bitmap );
+
+GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y,
+                                    GLsizei width, GLsizei height,
+                                    GLenum format, GLenum type,
+                                    GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height,
+                                    GLenum format, GLenum type,
+                                    const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y,
+                                    GLsizei width, GLsizei height,
+                                    GLenum type );
+
+/*
+ * Stenciling
+ */
+
+GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
+
+GLAPI void GLAPIENTRY glClearStencil( GLint s );
+
+
+
+/*
+ * Texture mapping
+ */
+
+GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param );
+GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params );
+GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params );
+GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname,
+                                          const GLfloat *params );
+GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname,
+                                          const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target,
+                                           GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target,
+                                           GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level,
+                                                GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level,
+                                                GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level,
+                                    GLint internalFormat,
+                                    GLsizei width, GLint border,
+                                    GLenum format, GLenum type,
+                                    const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level,
+                                    GLint internalFormat,
+                                    GLsizei width, GLsizei height,
+                                    GLint border, GLenum format, GLenum type,
+                                    const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level,
+                                     GLenum format, GLenum type,
+                                     GLvoid *pixels );
+
+
+/* 1.1 functions */
+
+GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures );
+
+GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures);
+
+GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture );
+
+GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n,
+                                            const GLuint *textures,
+                                            const GLclampf *priorities );
+
+GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n,
+                                                  const GLuint *textures,
+                                                  GLboolean *residences );
+
+GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture );
+
+
+GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level,
+                                       GLint xoffset,
+                                       GLsizei width, GLenum format,
+                                       GLenum type, const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level,
+                                       GLint xoffset, GLint yoffset,
+                                       GLsizei width, GLsizei height,
+                                       GLenum format, GLenum type,
+                                       const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level,
+                                        GLenum internalformat,
+                                        GLint x, GLint y,
+                                        GLsizei width, GLint border );
+
+
+GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level,
+                                        GLenum internalformat,
+                                        GLint x, GLint y,
+                                        GLsizei width, GLsizei height,
+                                        GLint border );
+
+
+GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level,
+                                           GLint xoffset, GLint x, GLint y,
+                                           GLsizei width );
+
+
+GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level,
+                                           GLint xoffset, GLint yoffset,
+                                           GLint x, GLint y,
+                                           GLsizei width, GLsizei height );
+
+
+/*
+ * Evaluators
+ */
+
+GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2,
+                               GLint stride,
+                               GLint order, const GLdouble *points );
+GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2,
+                               GLint stride,
+                               GLint order, const GLfloat *points );
+
+GLAPI void GLAPIENTRY glMap2d( GLenum target,
+		     GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+		     GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+		     const GLdouble *points );
+GLAPI void GLAPIENTRY glMap2f( GLenum target,
+		     GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+		     GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+		     const GLfloat *points );
+
+GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v );
+GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v );
+GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v );
+
+GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u );
+GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u );
+
+GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v );
+GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v );
+
+GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 );
+GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 );
+
+GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+                                   GLint vn, GLdouble v1, GLdouble v2 );
+GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+                                   GLint vn, GLfloat v1, GLfloat v2 );
+
+GLAPI void GLAPIENTRY glEvalPoint1( GLint i );
+
+GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j );
+
+GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 );
+
+GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+
+
+/*
+ * Fog
+ */
+
+GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param );
+
+GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params );
+
+GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params );
+
+
+/*
+ * Selection and Feedback
+ */
+
+GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer );
+
+GLAPI void GLAPIENTRY glPassThrough( GLfloat token );
+
+GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer );
+
+GLAPI void GLAPIENTRY glInitNames( void );
+
+GLAPI void GLAPIENTRY glLoadName( GLuint name );
+
+GLAPI void GLAPIENTRY glPushName( GLuint name );
+
+GLAPI void GLAPIENTRY glPopName( void );
+
+
+
+/*
+ * OpenGL 1.2
+ */
+
+#define GL_RESCALE_NORMAL			0x803A
+#define GL_CLAMP_TO_EDGE			0x812F
+#define GL_MAX_ELEMENTS_VERTICES		0x80E8
+#define GL_MAX_ELEMENTS_INDICES			0x80E9
+#define GL_BGR					0x80E0
+#define GL_BGRA					0x80E1
+#define GL_UNSIGNED_BYTE_3_3_2			0x8032
+#define GL_UNSIGNED_BYTE_2_3_3_REV		0x8362
+#define GL_UNSIGNED_SHORT_5_6_5			0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV		0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4		0x8033
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV		0x8365
+#define GL_UNSIGNED_SHORT_5_5_5_1		0x8034
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV		0x8366
+#define GL_UNSIGNED_INT_8_8_8_8			0x8035
+#define GL_UNSIGNED_INT_8_8_8_8_REV		0x8367
+#define GL_UNSIGNED_INT_10_10_10_2		0x8036
+#define GL_UNSIGNED_INT_2_10_10_10_REV		0x8368
+#define GL_LIGHT_MODEL_COLOR_CONTROL		0x81F8
+#define GL_SINGLE_COLOR				0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR		0x81FA
+#define GL_TEXTURE_MIN_LOD			0x813A
+#define GL_TEXTURE_MAX_LOD			0x813B
+#define GL_TEXTURE_BASE_LEVEL			0x813C
+#define GL_TEXTURE_MAX_LEVEL			0x813D
+#define GL_SMOOTH_POINT_SIZE_RANGE		0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY	0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE		0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY	0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE		0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE		0x846E
+#define GL_PACK_SKIP_IMAGES			0x806B
+#define GL_PACK_IMAGE_HEIGHT			0x806C
+#define GL_UNPACK_SKIP_IMAGES			0x806D
+#define GL_UNPACK_IMAGE_HEIGHT			0x806E
+#define GL_TEXTURE_3D				0x806F
+#define GL_PROXY_TEXTURE_3D			0x8070
+#define GL_TEXTURE_DEPTH			0x8071
+#define GL_TEXTURE_WRAP_R			0x8072
+#define GL_MAX_3D_TEXTURE_SIZE			0x8073
+#define GL_TEXTURE_BINDING_3D			0x806A
+
+GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start,
+	GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level,
+                                      GLint internalFormat,
+                                      GLsizei width, GLsizei height,
+                                      GLsizei depth, GLint border,
+                                      GLenum format, GLenum type,
+                                      const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level,
+                                         GLint xoffset, GLint yoffset,
+                                         GLint zoffset, GLsizei width,
+                                         GLsizei height, GLsizei depth,
+                                         GLenum format,
+                                         GLenum type, const GLvoid *pixels);
+
+GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level,
+                                             GLint xoffset, GLint yoffset,
+                                             GLint zoffset, GLint x,
+                                             GLint y, GLsizei width,
+                                             GLsizei height );
+
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+
+/*
+ * GL_ARB_imaging
+ */
+
+#define GL_CONSTANT_COLOR			0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR		0x8002
+#define GL_CONSTANT_ALPHA			0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA		0x8004
+#define GL_COLOR_TABLE				0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE		0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE	0x80D2
+#define GL_PROXY_COLOR_TABLE			0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE	0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE	0x80D5
+#define GL_COLOR_TABLE_SCALE			0x80D6
+#define GL_COLOR_TABLE_BIAS			0x80D7
+#define GL_COLOR_TABLE_FORMAT			0x80D8
+#define GL_COLOR_TABLE_WIDTH			0x80D9
+#define GL_COLOR_TABLE_RED_SIZE			0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE		0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE		0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE		0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE		0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE		0x80DF
+#define GL_CONVOLUTION_1D			0x8010
+#define GL_CONVOLUTION_2D			0x8011
+#define GL_SEPARABLE_2D				0x8012
+#define GL_CONVOLUTION_BORDER_MODE		0x8013
+#define GL_CONVOLUTION_FILTER_SCALE		0x8014
+#define GL_CONVOLUTION_FILTER_BIAS		0x8015
+#define GL_REDUCE				0x8016
+#define GL_CONVOLUTION_FORMAT			0x8017
+#define GL_CONVOLUTION_WIDTH			0x8018
+#define GL_CONVOLUTION_HEIGHT			0x8019
+#define GL_MAX_CONVOLUTION_WIDTH		0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT		0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE		0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE		0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE		0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE		0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS		0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS		0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS		0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS		0x8023
+#define GL_CONSTANT_BORDER			0x8151
+#define GL_REPLICATE_BORDER			0x8153
+#define GL_CONVOLUTION_BORDER_COLOR		0x8154
+#define GL_COLOR_MATRIX				0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH		0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH		0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE		0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE	0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE		0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE	0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS		0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS		0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS		0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS		0x80BB
+#define GL_HISTOGRAM				0x8024
+#define GL_PROXY_HISTOGRAM			0x8025
+#define GL_HISTOGRAM_WIDTH			0x8026
+#define GL_HISTOGRAM_FORMAT			0x8027
+#define GL_HISTOGRAM_RED_SIZE			0x8028
+#define GL_HISTOGRAM_GREEN_SIZE			0x8029
+#define GL_HISTOGRAM_BLUE_SIZE			0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE			0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE		0x802C
+#define GL_HISTOGRAM_SINK			0x802D
+#define GL_MINMAX				0x802E
+#define GL_MINMAX_FORMAT			0x802F
+#define GL_MINMAX_SINK				0x8030
+#define GL_TABLE_TOO_LARGE			0x8031
+#define GL_BLEND_EQUATION			0x8009
+#define GL_MIN					0x8007
+#define GL_MAX					0x8008
+#define GL_FUNC_ADD				0x8006
+#define GL_FUNC_SUBTRACT			0x800A
+#define GL_FUNC_REVERSE_SUBTRACT		0x800B
+#define GL_BLEND_COLOR				0x8005
+
+
+GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat,
+                                    GLsizei width, GLenum format,
+                                    GLenum type, const GLvoid *table );
+
+GLAPI void GLAPIENTRY glColorSubTable( GLenum target,
+                                       GLsizei start, GLsizei count,
+                                       GLenum format, GLenum type,
+                                       const GLvoid *data );
+
+GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname,
+                                              const GLint *params);
+
+GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname,
+                                              const GLfloat *params);
+
+GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start,
+                                           GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat,
+                                        GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format,
+                                       GLenum type, GLvoid *table );
+
+GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname,
+                                                  GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname,
+                                                  GLint *params );
+
+GLAPI void GLAPIENTRY glBlendEquation( GLenum mode );
+
+GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green,
+                                    GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width,
+				   GLenum internalformat, GLboolean sink );
+
+GLAPI void GLAPIENTRY glResetHistogram( GLenum target );
+
+GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset,
+				      GLenum format, GLenum type,
+				      GLvoid *values );
+
+GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname,
+						 GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname,
+						 GLint *params );
+
+GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat,
+				GLboolean sink );
+
+GLAPI void GLAPIENTRY glResetMinmax( GLenum target );
+
+GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset,
+                                   GLenum format, GLenum types,
+                                   GLvoid *values );
+
+GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname,
+					      GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname,
+					      GLint *params );
+
+GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target,
+	GLenum internalformat, GLsizei width, GLenum format, GLenum type,
+	const GLvoid *image );
+
+GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target,
+	GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+	GLenum type, const GLvoid *image );
+
+GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname,
+	GLfloat params );
+
+GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname,
+	const GLfloat *params );
+
+GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname,
+	GLint params );
+
+GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname,
+	const GLint *params );
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target,
+	GLenum internalformat, GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target,
+	GLenum internalformat, GLint x, GLint y, GLsizei width,
+	GLsizei height);
+
+GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format,
+	GLenum type, GLvoid *image );
+
+GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname,
+	GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname,
+	GLint *params );
+
+GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
+	GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+	GLenum type, const GLvoid *row, const GLvoid *column );
+
+GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
+	GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
+
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+
+
+
+/*
+ * OpenGL 1.3
+ */
+
+/* multitexture */
+#define GL_TEXTURE0				0x84C0
+#define GL_TEXTURE1				0x84C1
+#define GL_TEXTURE2				0x84C2
+#define GL_TEXTURE3				0x84C3
+#define GL_TEXTURE4				0x84C4
+#define GL_TEXTURE5				0x84C5
+#define GL_TEXTURE6				0x84C6
+#define GL_TEXTURE7				0x84C7
+#define GL_TEXTURE8				0x84C8
+#define GL_TEXTURE9				0x84C9
+#define GL_TEXTURE10				0x84CA
+#define GL_TEXTURE11				0x84CB
+#define GL_TEXTURE12				0x84CC
+#define GL_TEXTURE13				0x84CD
+#define GL_TEXTURE14				0x84CE
+#define GL_TEXTURE15				0x84CF
+#define GL_TEXTURE16				0x84D0
+#define GL_TEXTURE17				0x84D1
+#define GL_TEXTURE18				0x84D2
+#define GL_TEXTURE19				0x84D3
+#define GL_TEXTURE20				0x84D4
+#define GL_TEXTURE21				0x84D5
+#define GL_TEXTURE22				0x84D6
+#define GL_TEXTURE23				0x84D7
+#define GL_TEXTURE24				0x84D8
+#define GL_TEXTURE25				0x84D9
+#define GL_TEXTURE26				0x84DA
+#define GL_TEXTURE27				0x84DB
+#define GL_TEXTURE28				0x84DC
+#define GL_TEXTURE29				0x84DD
+#define GL_TEXTURE30				0x84DE
+#define GL_TEXTURE31				0x84DF
+#define GL_ACTIVE_TEXTURE			0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE		0x84E1
+#define GL_MAX_TEXTURE_UNITS			0x84E2
+/* texture_cube_map */
+#define GL_NORMAL_MAP				0x8511
+#define GL_REFLECTION_MAP			0x8512
+#define GL_TEXTURE_CUBE_MAP			0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP		0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X		0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X		0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y		0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y		0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z		0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z		0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP		0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE		0x851C
+/* texture_compression */
+#define GL_COMPRESSED_ALPHA			0x84E9
+#define GL_COMPRESSED_LUMINANCE			0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA		0x84EB
+#define GL_COMPRESSED_INTENSITY			0x84EC
+#define GL_COMPRESSED_RGB			0x84ED
+#define GL_COMPRESSED_RGBA			0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT		0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE	0x86A0
+#define GL_TEXTURE_COMPRESSED			0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS	0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS		0x86A3
+/* multisample */
+#define GL_MULTISAMPLE				0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE		0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE			0x809F
+#define GL_SAMPLE_COVERAGE			0x80A0
+#define GL_SAMPLE_BUFFERS			0x80A8
+#define GL_SAMPLES				0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE		0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT		0x80AB
+#define GL_MULTISAMPLE_BIT			0x20000000
+/* transpose_matrix */
+#define GL_TRANSPOSE_MODELVIEW_MATRIX		0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX		0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX		0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX		0x84E6
+/* texture_env_combine */
+#define GL_COMBINE				0x8570
+#define GL_COMBINE_RGB				0x8571
+#define GL_COMBINE_ALPHA			0x8572
+#define GL_SOURCE0_RGB				0x8580
+#define GL_SOURCE1_RGB				0x8581
+#define GL_SOURCE2_RGB				0x8582
+#define GL_SOURCE0_ALPHA			0x8588
+#define GL_SOURCE1_ALPHA			0x8589
+#define GL_SOURCE2_ALPHA			0x858A
+#define GL_OPERAND0_RGB				0x8590
+#define GL_OPERAND1_RGB				0x8591
+#define GL_OPERAND2_RGB				0x8592
+#define GL_OPERAND0_ALPHA			0x8598
+#define GL_OPERAND1_ALPHA			0x8599
+#define GL_OPERAND2_ALPHA			0x859A
+#define GL_RGB_SCALE				0x8573
+#define GL_ADD_SIGNED				0x8574
+#define GL_INTERPOLATE				0x8575
+#define GL_SUBTRACT				0x84E7
+#define GL_CONSTANT				0x8576
+#define GL_PRIMARY_COLOR			0x8577
+#define GL_PREVIOUS				0x8578
+/* texture_env_dot3 */
+#define GL_DOT3_RGB				0x86AE
+#define GL_DOT3_RGBA				0x86AF
+/* texture_border_clamp */
+#define GL_CLAMP_TO_BORDER			0x812D
+
+GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
+
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img);
+
+
+/*
+ * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
+ */
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+
+#define GL_TEXTURE0_ARB				0x84C0
+#define GL_TEXTURE1_ARB				0x84C1
+#define GL_TEXTURE2_ARB				0x84C2
+#define GL_TEXTURE3_ARB				0x84C3
+#define GL_TEXTURE4_ARB				0x84C4
+#define GL_TEXTURE5_ARB				0x84C5
+#define GL_TEXTURE6_ARB				0x84C6
+#define GL_TEXTURE7_ARB				0x84C7
+#define GL_TEXTURE8_ARB				0x84C8
+#define GL_TEXTURE9_ARB				0x84C9
+#define GL_TEXTURE10_ARB			0x84CA
+#define GL_TEXTURE11_ARB			0x84CB
+#define GL_TEXTURE12_ARB			0x84CC
+#define GL_TEXTURE13_ARB			0x84CD
+#define GL_TEXTURE14_ARB			0x84CE
+#define GL_TEXTURE15_ARB			0x84CF
+#define GL_TEXTURE16_ARB			0x84D0
+#define GL_TEXTURE17_ARB			0x84D1
+#define GL_TEXTURE18_ARB			0x84D2
+#define GL_TEXTURE19_ARB			0x84D3
+#define GL_TEXTURE20_ARB			0x84D4
+#define GL_TEXTURE21_ARB			0x84D5
+#define GL_TEXTURE22_ARB			0x84D6
+#define GL_TEXTURE23_ARB			0x84D7
+#define GL_TEXTURE24_ARB			0x84D8
+#define GL_TEXTURE25_ARB			0x84D9
+#define GL_TEXTURE26_ARB			0x84DA
+#define GL_TEXTURE27_ARB			0x84DB
+#define GL_TEXTURE28_ARB			0x84DC
+#define GL_TEXTURE29_ARB			0x84DD
+#define GL_TEXTURE30_ARB			0x84DE
+#define GL_TEXTURE31_ARB			0x84DF
+#define GL_ACTIVE_TEXTURE_ARB			0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB		0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB		0x84E2
+
+GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s);
+GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s);
+GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s);
+GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s);
+GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
+GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
+GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
+GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
+GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
+GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v);
+
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+
+#endif /* GL_ARB_multitexture */
+
+
+
+/*
+ * Define this token if you want "old-style" header file behaviour (extensions
+ * defined in gl.h).  Otherwise, extensions will be included from glext.h.
+ */
+#if defined(GL_GLEXT_LEGACY)
+
+/* All extensions that used to be here are now found in glext.h */
+
+#else  /* GL_GLEXT_LEGACY */
+
+#include <GL/glext.h>
+
+#endif  /* GL_GLEXT_LEGACY */
+
+
+
+/*
+ * ???. GL_MESA_trace
+ * XXX obsolete
+ */
+#ifndef GL_MESA_trace
+#define GL_MESA_trace 1
+
+#define GL_TRACE_ALL_BITS_MESA			0xFFFF
+#define GL_TRACE_OPERATIONS_BIT_MESA		0x0001
+#define GL_TRACE_PRIMITIVES_BIT_MESA		0x0002
+#define GL_TRACE_ARRAYS_BIT_MESA		0x0004
+#define GL_TRACE_TEXTURES_BIT_MESA		0x0008
+#define GL_TRACE_PIXELS_BIT_MESA		0x0010
+#define GL_TRACE_ERRORS_BIT_MESA		0x0020
+#define GL_TRACE_MASK_MESA			0x8755
+#define GL_TRACE_NAME_MESA			0x8756
+
+GLAPI void GLAPIENTRY glEnableTraceMESA( GLbitfield mask );
+GLAPI void GLAPIENTRY glDisableTraceMESA( GLbitfield mask );
+GLAPI void GLAPIENTRY glNewTraceMESA( GLbitfield mask, const GLubyte * traceName );
+GLAPI void GLAPIENTRY glEndTraceMESA( void );
+GLAPI void GLAPIENTRY glTraceAssertAttribMESA( GLbitfield attribMask );
+GLAPI void GLAPIENTRY glTraceCommentMESA( const GLubyte * comment );
+GLAPI void GLAPIENTRY glTraceTextureMESA( GLuint name, const GLubyte* comment );
+GLAPI void GLAPIENTRY glTraceListMESA( GLuint name, const GLubyte* comment );
+GLAPI void GLAPIENTRY glTracePointerMESA( GLvoid* pointer, const GLubyte* comment );
+GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid* last, const GLubyte* comment );
+
+#endif /* GL_MESA_trace */
+
+
+/*
+ * ???. GL_MESA_packed_depth_stencil
+ * XXX obsolete
+ */
+#ifndef GL_MESA_packed_depth_stencil
+#define GL_MESA_packed_depth_stencil 1
+
+#define GL_DEPTH_STENCIL_MESA			0x8750
+#define GL_UNSIGNED_INT_24_8_MESA		0x8751
+#define GL_UNSIGNED_INT_8_24_REV_MESA		0x8752
+#define GL_UNSIGNED_SHORT_15_1_MESA		0x8753
+#define GL_UNSIGNED_SHORT_1_15_REV_MESA		0x8754
+
+#endif /* GL_MESA_packed_depth_stencil */
+
+
+#ifndef GL_MESA_program_debug
+#define GL_MESA_program_debug 1
+
+#define GL_FRAGMENT_PROGRAM_POSITION_MESA       0x8bb0
+#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA       0x8bb1
+#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA  0x8bb2
+#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA  0x8bb3
+#define GL_VERTEX_PROGRAM_POSITION_MESA         0x8bb4
+#define GL_VERTEX_PROGRAM_CALLBACK_MESA         0x8bb5
+#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA    0x8bb6
+#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA    0x8bb7
+
+typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
+
+GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
+
+GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
+
+#endif /* GL_MESA_program_debug */
+
+
+#ifndef GL_ATI_blend_equation_separate
+#define GL_ATI_blend_equation_separate 1
+
+#define GL_ALPHA_BLEND_EQUATION_ATI	        0x883D
+
+GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
+
+#endif /* GL_ATI_blend_equation_separate */
+
+
+
+#ifndef GL_EXT_timer_query
+#define GL_EXT_timer_query 1
+
+/* Define 64-bit types */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+   typedef long long int GLint64EXT;
+   typedef unsigned long long int GLuint64EXT;
+#elif defined(_WIN32)
+   typedef __int64 GLint64EXT;
+   typedef unsigned __int64 GLuint64EXT;
+#else
+   /* this might actually be a 32-bit type */
+   typedef long int GLint64EXT;
+   typedef unsigned long int GLuint64EXT;
+#endif
+
+#define GL_TIME_ELAPSED_EXT  0x88BF
+
+GLAPI void GLAPIENTRY glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params);
+GLAPI void GLAPIENTRY glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params);
+
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
+
+#endif /* GL_EXT_timer_query */
+
+
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_EXT_framebuffer_blit 1
+
+#define GL_READ_FRAMEBUFFER_EXT                0x8CA8
+#define GL_DRAW_FRAMEBUFFER_EXT                0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_EXT        0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_EXT        0x8CAA
+
+GLAPI void GLAPIENTRY
+glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+                     GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+                     GLbitfield mask, GLenum filter);
+
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)
+        (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+         GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+         GLbitfield mask, GLenum filter);
+
+#endif /* GL_EXT_framebuffer_blit */
+
+
+
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_EXT_packed_depth_stencil 1
+
+#define GL_DEPTH_STENCIL_EXT          0x84F9
+#define GL_UNSIGNED_INT_24_8_EXT      0x84FA
+#define GL_DEPTH24_STENCIL8_EXT       0x88F0
+#define GL_TEXTURE_STENCIL_SIZE_EXT   0x88F1
+
+#endif /* GL_EXT_packed_depth_stencil */
+
+
+/**
+ ** NOTE!!!!!  If you add new functions to this file, or update
+ ** glext.h be sure to regenerate the gl_mangle.h file.  See comments
+ ** in that file for details.
+ **/
+
+
+
+/**********************************************************************
+ * Begin system-specific stuff
+ */
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export off
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import off
+#endif
+/*
+ * End system-specific stuff
+ **********************************************************************/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
diff --git a/src/terralib/drivers/GL/gl_mangle.h b/src/terralib/drivers/GL/gl_mangle.h
new file mode 100644
index 0000000..18da387
--- /dev/null
+++ b/src/terralib/drivers/GL/gl_mangle.h
@@ -0,0 +1,1474 @@
+#if 0
+#define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output"
+#define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names"
+	files="gl.h glext.h"
+#define GL_MANGLE_C3 "get regeneration header - copy everything in this file above the 'REGENERATE_TO_END' line"
+	awk 	'!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0
+	echo ""
+#define GL_MANGLE_C4 get aliases
+	grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1		MANGLE(\1)/' | sort | uniq
+	echo ""
+	echo "#endif /* GL_MANGLE_H */"
+	exit
+#endif /* REGENERATION */
+
+/*
+ * If you compile Mesa with USE_MGL_NAMESPACE defined then you can link
+ * your application both with OpenGL and Mesa.  The Mesa functions will
+ * be redefined so they are prefixed with "mgl" instead of "gl".
+ * Mgl contributed by Randy Frank (rfrank at rsinc.com)
+ * Regneration code contributed by Ray Tice (rayt at ma.ultra.net)
+ */
+
+#ifndef GL_MANGLE_H
+#define GL_MANGLE_H
+
+#ifndef   MANGLE
+#define   MANGLE(x) mgl##x
+#endif  /*MANGLE*/
+
+/* Internal symbols which may collide with other OpenGL implementations. */
+#define __glCoreCreateContext __mglCoreCreateContext
+#define __glCoreNopDispatch   __mglCoreNopDispatch
+
+/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
+
+#define glAccum		MANGLE(Accum)
+#define glActiveStencilFaceEXT		MANGLE(ActiveStencilFaceEXT)
+#define glActiveTextureARB		MANGLE(ActiveTextureARB)
+#define glActiveTexture		MANGLE(ActiveTexture)
+#define glAlphaFragmentOp1ATI		MANGLE(AlphaFragmentOp1ATI)
+#define glAlphaFragmentOp2ATI		MANGLE(AlphaFragmentOp2ATI)
+#define glAlphaFragmentOp3ATI		MANGLE(AlphaFragmentOp3ATI)
+#define glAlphaFunc		MANGLE(AlphaFunc)
+#define glApplyTextureEXT		MANGLE(ApplyTextureEXT)
+#define glAreProgramsResidentNV		MANGLE(AreProgramsResidentNV)
+#define glAreTexturesResidentEXT		MANGLE(AreTexturesResidentEXT)
+#define glAreTexturesResident		MANGLE(AreTexturesResident)
+#define glArrayElementEXT		MANGLE(ArrayElementEXT)
+#define glArrayElement		MANGLE(ArrayElement)
+#define glArrayObjectATI		MANGLE(ArrayObjectATI)
+#define glAsyncMarkerSGIX		MANGLE(AsyncMarkerSGIX)
+#define glAttachObjectARB		MANGLE(AttachObjectARB)
+#define glAttachShader		MANGLE(AttachShader)
+#define glBeginFragmentShaderATI		MANGLE(BeginFragmentShaderATI)
+#define glBegin		MANGLE(Begin)
+#define glBeginOcclusionQueryNV		MANGLE(BeginOcclusionQueryNV)
+#define glBeginQueryARB		MANGLE(BeginQueryARB)
+#define glBeginQuery		MANGLE(BeginQuery)
+#define glBeginVertexShaderEXT		MANGLE(BeginVertexShaderEXT)
+#define glBindAttribLocationARB		MANGLE(BindAttribLocationARB)
+#define glBindAttribLocation		MANGLE(BindAttribLocation)
+#define glBindBufferARB		MANGLE(BindBufferARB)
+#define glBindBuffer		MANGLE(BindBuffer)
+#define glBindFragmentShaderATI		MANGLE(BindFragmentShaderATI)
+#define glBindFramebufferEXT		MANGLE(BindFramebufferEXT)
+#define glBindLightParameterEXT		MANGLE(BindLightParameterEXT)
+#define glBindMaterialParameterEXT		MANGLE(BindMaterialParameterEXT)
+#define glBindParameterEXT		MANGLE(BindParameterEXT)
+#define glBindProgramARB		MANGLE(BindProgramARB)
+#define glBindProgramNV		MANGLE(BindProgramNV)
+#define glBindRenderbufferEXT		MANGLE(BindRenderbufferEXT)
+#define glBindTexGenParameterEXT		MANGLE(BindTexGenParameterEXT)
+#define glBindTextureEXT		MANGLE(BindTextureEXT)
+#define glBindTexture		MANGLE(BindTexture)
+#define glBindTextureUnitParameterEXT		MANGLE(BindTextureUnitParameterEXT)
+#define glBindVertexArrayAPPLE		MANGLE(BindVertexArrayAPPLE)
+#define glBindVertexShaderEXT		MANGLE(BindVertexShaderEXT)
+#define glBinormal3bEXT		MANGLE(Binormal3bEXT)
+#define glBinormal3bvEXT		MANGLE(Binormal3bvEXT)
+#define glBinormal3dEXT		MANGLE(Binormal3dEXT)
+#define glBinormal3dvEXT		MANGLE(Binormal3dvEXT)
+#define glBinormal3fEXT		MANGLE(Binormal3fEXT)
+#define glBinormal3fvEXT		MANGLE(Binormal3fvEXT)
+#define glBinormal3iEXT		MANGLE(Binormal3iEXT)
+#define glBinormal3ivEXT		MANGLE(Binormal3ivEXT)
+#define glBinormal3sEXT		MANGLE(Binormal3sEXT)
+#define glBinormal3svEXT		MANGLE(Binormal3svEXT)
+#define glBinormalPointerEXT		MANGLE(BinormalPointerEXT)
+#define glBitmap		MANGLE(Bitmap)
+#define glBlendColorEXT		MANGLE(BlendColorEXT)
+#define glBlendColor		MANGLE(BlendColor)
+#define glBlendEquationEXT		MANGLE(BlendEquationEXT)
+#define glBlendEquation		MANGLE(BlendEquation)
+#define glBlendEquationSeparateATI		MANGLE(BlendEquationSeparateATI)
+#define glBlendEquationSeparateEXT		MANGLE(BlendEquationSeparateEXT)
+#define glBlendEquationSeparate		MANGLE(BlendEquationSeparate)
+#define glBlendFunc		MANGLE(BlendFunc)
+#define glBlendFuncSeparateEXT		MANGLE(BlendFuncSeparateEXT)
+#define glBlendFuncSeparateINGR		MANGLE(BlendFuncSeparateINGR)
+#define glBlendFuncSeparate		MANGLE(BlendFuncSeparate)
+#define glBufferDataARB		MANGLE(BufferDataARB)
+#define glBufferData		MANGLE(BufferData)
+#define glBufferSubDataARB		MANGLE(BufferSubDataARB)
+#define glBufferSubData		MANGLE(BufferSubData)
+#define glCallList		MANGLE(CallList)
+#define glCallLists		MANGLE(CallLists)
+#define glCheckFramebufferStatusEXT		MANGLE(CheckFramebufferStatusEXT)
+#define glClampColorARB		MANGLE(ClampColorARB)
+#define glClearAccum		MANGLE(ClearAccum)
+#define glClearColor		MANGLE(ClearColor)
+#define glClearDepth		MANGLE(ClearDepth)
+#define glClearIndex		MANGLE(ClearIndex)
+#define glClear		MANGLE(Clear)
+#define glClearStencil		MANGLE(ClearStencil)
+#define glClientActiveTextureARB		MANGLE(ClientActiveTextureARB)
+#define glClientActiveTexture		MANGLE(ClientActiveTexture)
+#define glClientActiveVertexStreamATI		MANGLE(ClientActiveVertexStreamATI)
+#define glClipPlane		MANGLE(ClipPlane)
+#define glColor3b		MANGLE(Color3b)
+#define glColor3bv		MANGLE(Color3bv)
+#define glColor3d		MANGLE(Color3d)
+#define glColor3dv		MANGLE(Color3dv)
+#define glColor3f		MANGLE(Color3f)
+#define glColor3fVertex3fSUN		MANGLE(Color3fVertex3fSUN)
+#define glColor3fVertex3fvSUN		MANGLE(Color3fVertex3fvSUN)
+#define glColor3fv		MANGLE(Color3fv)
+#define glColor3hNV		MANGLE(Color3hNV)
+#define glColor3hvNV		MANGLE(Color3hvNV)
+#define glColor3i		MANGLE(Color3i)
+#define glColor3iv		MANGLE(Color3iv)
+#define glColor3s		MANGLE(Color3s)
+#define glColor3sv		MANGLE(Color3sv)
+#define glColor3ub		MANGLE(Color3ub)
+#define glColor3ubv		MANGLE(Color3ubv)
+#define glColor3ui		MANGLE(Color3ui)
+#define glColor3uiv		MANGLE(Color3uiv)
+#define glColor3us		MANGLE(Color3us)
+#define glColor3usv		MANGLE(Color3usv)
+#define glColor4b		MANGLE(Color4b)
+#define glColor4bv		MANGLE(Color4bv)
+#define glColor4d		MANGLE(Color4d)
+#define glColor4dv		MANGLE(Color4dv)
+#define glColor4f		MANGLE(Color4f)
+#define glColor4fNormal3fVertex3fSUN		MANGLE(Color4fNormal3fVertex3fSUN)
+#define glColor4fNormal3fVertex3fvSUN		MANGLE(Color4fNormal3fVertex3fvSUN)
+#define glColor4fv		MANGLE(Color4fv)
+#define glColor4hNV		MANGLE(Color4hNV)
+#define glColor4hvNV		MANGLE(Color4hvNV)
+#define glColor4i		MANGLE(Color4i)
+#define glColor4iv		MANGLE(Color4iv)
+#define glColor4s		MANGLE(Color4s)
+#define glColor4sv		MANGLE(Color4sv)
+#define glColor4ub		MANGLE(Color4ub)
+#define glColor4ubVertex2fSUN		MANGLE(Color4ubVertex2fSUN)
+#define glColor4ubVertex2fvSUN		MANGLE(Color4ubVertex2fvSUN)
+#define glColor4ubVertex3fSUN		MANGLE(Color4ubVertex3fSUN)
+#define glColor4ubVertex3fvSUN		MANGLE(Color4ubVertex3fvSUN)
+#define glColor4ubv		MANGLE(Color4ubv)
+#define glColor4ui		MANGLE(Color4ui)
+#define glColor4uiv		MANGLE(Color4uiv)
+#define glColor4us		MANGLE(Color4us)
+#define glColor4usv		MANGLE(Color4usv)
+#define glColorFragmentOp1ATI		MANGLE(ColorFragmentOp1ATI)
+#define glColorFragmentOp2ATI		MANGLE(ColorFragmentOp2ATI)
+#define glColorFragmentOp3ATI		MANGLE(ColorFragmentOp3ATI)
+#define glColorMask		MANGLE(ColorMask)
+#define glColorMaterial		MANGLE(ColorMaterial)
+#define glColorPointerEXT		MANGLE(ColorPointerEXT)
+#define glColorPointerListIBM		MANGLE(ColorPointerListIBM)
+#define glColorPointer		MANGLE(ColorPointer)
+#define glColorPointervINTEL		MANGLE(ColorPointervINTEL)
+#define glColorSubTableEXT		MANGLE(ColorSubTableEXT)
+#define glColorSubTable		MANGLE(ColorSubTable)
+#define glColorTableEXT		MANGLE(ColorTableEXT)
+#define glColorTable		MANGLE(ColorTable)
+#define glColorTableParameterfv		MANGLE(ColorTableParameterfv)
+#define glColorTableParameterfvSGI		MANGLE(ColorTableParameterfvSGI)
+#define glColorTableParameteriv		MANGLE(ColorTableParameteriv)
+#define glColorTableParameterivSGI		MANGLE(ColorTableParameterivSGI)
+#define glColorTableSGI		MANGLE(ColorTableSGI)
+#define glCombinerInputNV		MANGLE(CombinerInputNV)
+#define glCombinerOutputNV		MANGLE(CombinerOutputNV)
+#define glCombinerParameterfNV		MANGLE(CombinerParameterfNV)
+#define glCombinerParameterfvNV		MANGLE(CombinerParameterfvNV)
+#define glCombinerParameteriNV		MANGLE(CombinerParameteriNV)
+#define glCombinerParameterivNV		MANGLE(CombinerParameterivNV)
+#define glCombinerStageParameterfvNV		MANGLE(CombinerStageParameterfvNV)
+#define glCompileShaderARB		MANGLE(CompileShaderARB)
+#define glCompileShader		MANGLE(CompileShader)
+#define glCompressedTexImage1DARB		MANGLE(CompressedTexImage1DARB)
+#define glCompressedTexImage1D		MANGLE(CompressedTexImage1D)
+#define glCompressedTexImage2DARB		MANGLE(CompressedTexImage2DARB)
+#define glCompressedTexImage2D		MANGLE(CompressedTexImage2D)
+#define glCompressedTexImage3DARB		MANGLE(CompressedTexImage3DARB)
+#define glCompressedTexImage3D		MANGLE(CompressedTexImage3D)
+#define glCompressedTexSubImage1DARB		MANGLE(CompressedTexSubImage1DARB)
+#define glCompressedTexSubImage1D		MANGLE(CompressedTexSubImage1D)
+#define glCompressedTexSubImage2DARB		MANGLE(CompressedTexSubImage2DARB)
+#define glCompressedTexSubImage2D		MANGLE(CompressedTexSubImage2D)
+#define glCompressedTexSubImage3DARB		MANGLE(CompressedTexSubImage3DARB)
+#define glCompressedTexSubImage3D		MANGLE(CompressedTexSubImage3D)
+#define glConvolutionFilter1DEXT		MANGLE(ConvolutionFilter1DEXT)
+#define glConvolutionFilter1D		MANGLE(ConvolutionFilter1D)
+#define glConvolutionFilter2DEXT		MANGLE(ConvolutionFilter2DEXT)
+#define glConvolutionFilter2D		MANGLE(ConvolutionFilter2D)
+#define glConvolutionParameterfEXT		MANGLE(ConvolutionParameterfEXT)
+#define glConvolutionParameterf		MANGLE(ConvolutionParameterf)
+#define glConvolutionParameterfvEXT		MANGLE(ConvolutionParameterfvEXT)
+#define glConvolutionParameterfv		MANGLE(ConvolutionParameterfv)
+#define glConvolutionParameteriEXT		MANGLE(ConvolutionParameteriEXT)
+#define glConvolutionParameteri		MANGLE(ConvolutionParameteri)
+#define glConvolutionParameterivEXT		MANGLE(ConvolutionParameterivEXT)
+#define glConvolutionParameteriv		MANGLE(ConvolutionParameteriv)
+#define glCopyColorSubTableEXT		MANGLE(CopyColorSubTableEXT)
+#define glCopyColorSubTable		MANGLE(CopyColorSubTable)
+#define glCopyColorTable		MANGLE(CopyColorTable)
+#define glCopyColorTableSGI		MANGLE(CopyColorTableSGI)
+#define glCopyConvolutionFilter1DEXT		MANGLE(CopyConvolutionFilter1DEXT)
+#define glCopyConvolutionFilter1D		MANGLE(CopyConvolutionFilter1D)
+#define glCopyConvolutionFilter2DEXT		MANGLE(CopyConvolutionFilter2DEXT)
+#define glCopyConvolutionFilter2D		MANGLE(CopyConvolutionFilter2D)
+#define glCopyPixels		MANGLE(CopyPixels)
+#define glCopyTexImage1DEXT		MANGLE(CopyTexImage1DEXT)
+#define glCopyTexImage1D		MANGLE(CopyTexImage1D)
+#define glCopyTexImage2DEXT		MANGLE(CopyTexImage2DEXT)
+#define glCopyTexImage2D		MANGLE(CopyTexImage2D)
+#define glCopyTexSubImage1DEXT		MANGLE(CopyTexSubImage1DEXT)
+#define glCopyTexSubImage1D		MANGLE(CopyTexSubImage1D)
+#define glCopyTexSubImage2DEXT		MANGLE(CopyTexSubImage2DEXT)
+#define glCopyTexSubImage2D		MANGLE(CopyTexSubImage2D)
+#define glCopyTexSubImage3DEXT		MANGLE(CopyTexSubImage3DEXT)
+#define glCopyTexSubImage3D		MANGLE(CopyTexSubImage3D)
+#define glCreateProgram		MANGLE(CreateProgram)
+#define glCreateProgramObjectARB		MANGLE(CreateProgramObjectARB)
+#define glCreateShader		MANGLE(CreateShader)
+#define glCreateShaderObjectARB		MANGLE(CreateShaderObjectARB)
+#define glCullFace		MANGLE(CullFace)
+#define glCullParameterdvEXT		MANGLE(CullParameterdvEXT)
+#define glCullParameterfvEXT		MANGLE(CullParameterfvEXT)
+#define glCurrentPaletteMatrixARB		MANGLE(CurrentPaletteMatrixARB)
+#define glDeformationMap3dSGIX		MANGLE(DeformationMap3dSGIX)
+#define glDeformationMap3fSGIX		MANGLE(DeformationMap3fSGIX)
+#define glDeformSGIX		MANGLE(DeformSGIX)
+#define glDeleteAsyncMarkersSGIX		MANGLE(DeleteAsyncMarkersSGIX)
+#define glDeleteBuffersARB		MANGLE(DeleteBuffersARB)
+#define glDeleteBuffers		MANGLE(DeleteBuffers)
+#define glDeleteFencesAPPLE		MANGLE(DeleteFencesAPPLE)
+#define glDeleteFencesNV		MANGLE(DeleteFencesNV)
+#define glDeleteFragmentShaderATI		MANGLE(DeleteFragmentShaderATI)
+#define glDeleteFramebuffersEXT		MANGLE(DeleteFramebuffersEXT)
+#define glDeleteLists		MANGLE(DeleteLists)
+#define glDeleteObjectARB		MANGLE(DeleteObjectARB)
+#define glDeleteOcclusionQueriesNV		MANGLE(DeleteOcclusionQueriesNV)
+#define glDeleteProgram		MANGLE(DeleteProgram)
+#define glDeleteProgramsARB		MANGLE(DeleteProgramsARB)
+#define glDeleteProgramsNV		MANGLE(DeleteProgramsNV)
+#define glDeleteQueriesARB		MANGLE(DeleteQueriesARB)
+#define glDeleteQueries		MANGLE(DeleteQueries)
+#define glDeleteRenderbuffersEXT		MANGLE(DeleteRenderbuffersEXT)
+#define glDeleteShader		MANGLE(DeleteShader)
+#define glDeleteTexturesEXT		MANGLE(DeleteTexturesEXT)
+#define glDeleteTextures		MANGLE(DeleteTextures)
+#define glDeleteVertexArraysAPPLE		MANGLE(DeleteVertexArraysAPPLE)
+#define glDeleteVertexShaderEXT		MANGLE(DeleteVertexShaderEXT)
+#define glDepthBoundsEXT		MANGLE(DepthBoundsEXT)
+#define glDepthFunc		MANGLE(DepthFunc)
+#define glDepthMask		MANGLE(DepthMask)
+#define glDepthRange		MANGLE(DepthRange)
+#define glDetachObjectARB		MANGLE(DetachObjectARB)
+#define glDetachShader		MANGLE(DetachShader)
+#define glDetailTexFuncSGIS		MANGLE(DetailTexFuncSGIS)
+#define glDisableClientState		MANGLE(DisableClientState)
+#define glDisable		MANGLE(Disable)
+#define glDisableTraceMESA		MANGLE(DisableTraceMESA)
+#define glDisableVariantClientStateEXT		MANGLE(DisableVariantClientStateEXT)
+#define glDisableVertexAttribArrayARB		MANGLE(DisableVertexAttribArrayARB)
+#define glDisableVertexAttribArray		MANGLE(DisableVertexAttribArray)
+#define glDrawArraysEXT		MANGLE(DrawArraysEXT)
+#define glDrawArrays		MANGLE(DrawArrays)
+#define glDrawBuffer		MANGLE(DrawBuffer)
+#define glDrawBuffersARB		MANGLE(DrawBuffersARB)
+#define glDrawBuffersATI		MANGLE(DrawBuffersATI)
+#define glDrawBuffers		MANGLE(DrawBuffers)
+#define glDrawElementArrayAPPLE		MANGLE(DrawElementArrayAPPLE)
+#define glDrawElementArrayATI		MANGLE(DrawElementArrayATI)
+#define glDrawElements		MANGLE(DrawElements)
+#define glDrawMeshArraysSUN		MANGLE(DrawMeshArraysSUN)
+#define glDrawPixels		MANGLE(DrawPixels)
+#define glDrawRangeElementArrayAPPLE		MANGLE(DrawRangeElementArrayAPPLE)
+#define glDrawRangeElementArrayATI		MANGLE(DrawRangeElementArrayATI)
+#define glDrawRangeElementsEXT		MANGLE(DrawRangeElementsEXT)
+#define glDrawRangeElements		MANGLE(DrawRangeElements)
+#define glEdgeFlag		MANGLE(EdgeFlag)
+#define glEdgeFlagPointerEXT		MANGLE(EdgeFlagPointerEXT)
+#define glEdgeFlagPointerListIBM		MANGLE(EdgeFlagPointerListIBM)
+#define glEdgeFlagPointer		MANGLE(EdgeFlagPointer)
+#define glEdgeFlagv		MANGLE(EdgeFlagv)
+#define glElementPointerAPPLE		MANGLE(ElementPointerAPPLE)
+#define glElementPointerATI		MANGLE(ElementPointerATI)
+#define glEnableClientState		MANGLE(EnableClientState)
+#define glEnable		MANGLE(Enable)
+#define glEnableTraceMESA		MANGLE(EnableTraceMESA)
+#define glEnableVariantClientStateEXT		MANGLE(EnableVariantClientStateEXT)
+#define glEnableVertexAttribArrayARB		MANGLE(EnableVertexAttribArrayARB)
+#define glEnableVertexAttribArray		MANGLE(EnableVertexAttribArray)
+#define glEndFragmentShaderATI		MANGLE(EndFragmentShaderATI)
+#define glEndList		MANGLE(EndList)
+#define glEnd		MANGLE(End)
+#define glEndOcclusionQueryNV		MANGLE(EndOcclusionQueryNV)
+#define glEndQueryARB		MANGLE(EndQueryARB)
+#define glEndQuery		MANGLE(EndQuery)
+#define glEndTraceMESA		MANGLE(EndTraceMESA)
+#define glEndVertexShaderEXT		MANGLE(EndVertexShaderEXT)
+#define glEvalCoord1d		MANGLE(EvalCoord1d)
+#define glEvalCoord1dv		MANGLE(EvalCoord1dv)
+#define glEvalCoord1f		MANGLE(EvalCoord1f)
+#define glEvalCoord1fv		MANGLE(EvalCoord1fv)
+#define glEvalCoord2d		MANGLE(EvalCoord2d)
+#define glEvalCoord2dv		MANGLE(EvalCoord2dv)
+#define glEvalCoord2f		MANGLE(EvalCoord2f)
+#define glEvalCoord2fv		MANGLE(EvalCoord2fv)
+#define glEvalMapsNV		MANGLE(EvalMapsNV)
+#define glEvalMesh1		MANGLE(EvalMesh1)
+#define glEvalMesh2		MANGLE(EvalMesh2)
+#define glEvalPoint1		MANGLE(EvalPoint1)
+#define glEvalPoint2		MANGLE(EvalPoint2)
+#define glExecuteProgramNV		MANGLE(ExecuteProgramNV)
+#define glExtractComponentEXT		MANGLE(ExtractComponentEXT)
+#define glFeedbackBuffer		MANGLE(FeedbackBuffer)
+#define glFinalCombinerInputNV		MANGLE(FinalCombinerInputNV)
+#define glFinishAsyncSGIX		MANGLE(FinishAsyncSGIX)
+#define glFinishFenceAPPLE		MANGLE(FinishFenceAPPLE)
+#define glFinishFenceNV		MANGLE(FinishFenceNV)
+#define glFinish		MANGLE(Finish)
+#define glFinishObjectAPPLE		MANGLE(FinishObjectAPPLE)
+#define glFinishTextureSUNX		MANGLE(FinishTextureSUNX)
+#define glFlush		MANGLE(Flush)
+#define glFlushPixelDataRangeNV		MANGLE(FlushPixelDataRangeNV)
+#define glFlushRasterSGIX		MANGLE(FlushRasterSGIX)
+#define glFlushVertexArrayRangeAPPLE		MANGLE(FlushVertexArrayRangeAPPLE)
+#define glFlushVertexArrayRangeNV		MANGLE(FlushVertexArrayRangeNV)
+#define glFogCoorddEXT		MANGLE(FogCoorddEXT)
+#define glFogCoordd		MANGLE(FogCoordd)
+#define glFogCoorddvEXT		MANGLE(FogCoorddvEXT)
+#define glFogCoorddv		MANGLE(FogCoorddv)
+#define glFogCoordfEXT		MANGLE(FogCoordfEXT)
+#define glFogCoordf		MANGLE(FogCoordf)
+#define glFogCoordfvEXT		MANGLE(FogCoordfvEXT)
+#define glFogCoordfv		MANGLE(FogCoordfv)
+#define glFogCoordhNV		MANGLE(FogCoordhNV)
+#define glFogCoordhvNV		MANGLE(FogCoordhvNV)
+#define glFogCoordPointerEXT		MANGLE(FogCoordPointerEXT)
+#define glFogCoordPointerListIBM		MANGLE(FogCoordPointerListIBM)
+#define glFogCoordPointer		MANGLE(FogCoordPointer)
+#define glFogf		MANGLE(Fogf)
+#define glFogFuncSGIS		MANGLE(FogFuncSGIS)
+#define glFogfv		MANGLE(Fogfv)
+#define glFogi		MANGLE(Fogi)
+#define glFogiv		MANGLE(Fogiv)
+#define glFragmentColorMaterialSGIX		MANGLE(FragmentColorMaterialSGIX)
+#define glFragmentLightfSGIX		MANGLE(FragmentLightfSGIX)
+#define glFragmentLightfvSGIX		MANGLE(FragmentLightfvSGIX)
+#define glFragmentLightiSGIX		MANGLE(FragmentLightiSGIX)
+#define glFragmentLightivSGIX		MANGLE(FragmentLightivSGIX)
+#define glFragmentLightModelfSGIX		MANGLE(FragmentLightModelfSGIX)
+#define glFragmentLightModelfvSGIX		MANGLE(FragmentLightModelfvSGIX)
+#define glFragmentLightModeliSGIX		MANGLE(FragmentLightModeliSGIX)
+#define glFragmentLightModelivSGIX		MANGLE(FragmentLightModelivSGIX)
+#define glFragmentMaterialfSGIX		MANGLE(FragmentMaterialfSGIX)
+#define glFragmentMaterialfvSGIX		MANGLE(FragmentMaterialfvSGIX)
+#define glFragmentMaterialiSGIX		MANGLE(FragmentMaterialiSGIX)
+#define glFragmentMaterialivSGIX		MANGLE(FragmentMaterialivSGIX)
+#define glFramebufferRenderbufferEXT		MANGLE(FramebufferRenderbufferEXT)
+#define glFramebufferTexture1DEXT		MANGLE(FramebufferTexture1DEXT)
+#define glFramebufferTexture2DEXT		MANGLE(FramebufferTexture2DEXT)
+#define glFramebufferTexture3DEXT		MANGLE(FramebufferTexture3DEXT)
+#define glFrameZoomSGIX		MANGLE(FrameZoomSGIX)
+#define glFreeObjectBufferATI		MANGLE(FreeObjectBufferATI)
+#define glFrontFace		MANGLE(FrontFace)
+#define glFrustum		MANGLE(Frustum)
+#define glGenAsyncMarkersSGIX		MANGLE(GenAsyncMarkersSGIX)
+#define glGenBuffersARB		MANGLE(GenBuffersARB)
+#define glGenBuffers		MANGLE(GenBuffers)
+#define glGenerateMipmapEXT		MANGLE(GenerateMipmapEXT)
+#define glGenFencesAPPLE		MANGLE(GenFencesAPPLE)
+#define glGenFencesNV		MANGLE(GenFencesNV)
+#define glGenFragmentShadersATI		MANGLE(GenFragmentShadersATI)
+#define glGenFramebuffersEXT		MANGLE(GenFramebuffersEXT)
+#define glGenLists		MANGLE(GenLists)
+#define glGenOcclusionQueriesNV		MANGLE(GenOcclusionQueriesNV)
+#define glGenProgramsARB		MANGLE(GenProgramsARB)
+#define glGenProgramsNV		MANGLE(GenProgramsNV)
+#define glGenQueriesARB		MANGLE(GenQueriesARB)
+#define glGenQueries		MANGLE(GenQueries)
+#define glGenRenderbuffersEXT		MANGLE(GenRenderbuffersEXT)
+#define glGenSymbolsEXT		MANGLE(GenSymbolsEXT)
+#define glGenTexturesEXT		MANGLE(GenTexturesEXT)
+#define glGenTextures		MANGLE(GenTextures)
+#define glGenVertexArraysAPPLE		MANGLE(GenVertexArraysAPPLE)
+#define glGenVertexShadersEXT		MANGLE(GenVertexShadersEXT)
+#define glGetActiveAttribARB		MANGLE(GetActiveAttribARB)
+#define glGetActiveAttrib		MANGLE(GetActiveAttrib)
+#define glGetActiveUniformARB		MANGLE(GetActiveUniformARB)
+#define glGetActiveUniform		MANGLE(GetActiveUniform)
+#define glGetArrayObjectfvATI		MANGLE(GetArrayObjectfvATI)
+#define glGetArrayObjectivATI		MANGLE(GetArrayObjectivATI)
+#define glGetAttachedObjectsARB		MANGLE(GetAttachedObjectsARB)
+#define glGetAttachedShaders		MANGLE(GetAttachedShaders)
+#define glGetAttribLocationARB		MANGLE(GetAttribLocationARB)
+#define glGetAttribLocation		MANGLE(GetAttribLocation)
+#define glGetBooleanv		MANGLE(GetBooleanv)
+#define glGetBufferParameterivARB		MANGLE(GetBufferParameterivARB)
+#define glGetBufferParameteriv		MANGLE(GetBufferParameteriv)
+#define glGetBufferPointervARB		MANGLE(GetBufferPointervARB)
+#define glGetBufferPointerv		MANGLE(GetBufferPointerv)
+#define glGetBufferSubDataARB		MANGLE(GetBufferSubDataARB)
+#define glGetBufferSubData		MANGLE(GetBufferSubData)
+#define glGetClipPlane		MANGLE(GetClipPlane)
+#define glGetColorTableEXT		MANGLE(GetColorTableEXT)
+#define glGetColorTable		MANGLE(GetColorTable)
+#define glGetColorTableParameterfvEXT		MANGLE(GetColorTableParameterfvEXT)
+#define glGetColorTableParameterfv		MANGLE(GetColorTableParameterfv)
+#define glGetColorTableParameterfvSGI		MANGLE(GetColorTableParameterfvSGI)
+#define glGetColorTableParameterivEXT		MANGLE(GetColorTableParameterivEXT)
+#define glGetColorTableParameteriv		MANGLE(GetColorTableParameteriv)
+#define glGetColorTableParameterivSGI		MANGLE(GetColorTableParameterivSGI)
+#define glGetColorTableSGI		MANGLE(GetColorTableSGI)
+#define glGetCombinerInputParameterfvNV		MANGLE(GetCombinerInputParameterfvNV)
+#define glGetCombinerInputParameterivNV		MANGLE(GetCombinerInputParameterivNV)
+#define glGetCombinerOutputParameterfvNV		MANGLE(GetCombinerOutputParameterfvNV)
+#define glGetCombinerOutputParameterivNV		MANGLE(GetCombinerOutputParameterivNV)
+#define glGetCombinerStageParameterfvNV		MANGLE(GetCombinerStageParameterfvNV)
+#define glGetCompressedTexImageARB		MANGLE(GetCompressedTexImageARB)
+#define glGetCompressedTexImage		MANGLE(GetCompressedTexImage)
+#define glGetConvolutionFilterEXT		MANGLE(GetConvolutionFilterEXT)
+#define glGetConvolutionFilter		MANGLE(GetConvolutionFilter)
+#define glGetConvolutionParameterfvEXT		MANGLE(GetConvolutionParameterfvEXT)
+#define glGetConvolutionParameterfv		MANGLE(GetConvolutionParameterfv)
+#define glGetConvolutionParameterivEXT		MANGLE(GetConvolutionParameterivEXT)
+#define glGetConvolutionParameteriv		MANGLE(GetConvolutionParameteriv)
+#define glGetDetailTexFuncSGIS		MANGLE(GetDetailTexFuncSGIS)
+#define glGetDoublev		MANGLE(GetDoublev)
+#define glGetError		MANGLE(GetError)
+#define glGetFenceivNV		MANGLE(GetFenceivNV)
+#define glGetFinalCombinerInputParameterfvNV		MANGLE(GetFinalCombinerInputParameterfvNV)
+#define glGetFinalCombinerInputParameterivNV		MANGLE(GetFinalCombinerInputParameterivNV)
+#define glGetFloatv		MANGLE(GetFloatv)
+#define glGetFogFuncSGIS		MANGLE(GetFogFuncSGIS)
+#define glGetFragmentLightfvSGIX		MANGLE(GetFragmentLightfvSGIX)
+#define glGetFragmentLightivSGIX		MANGLE(GetFragmentLightivSGIX)
+#define glGetFragmentMaterialfvSGIX		MANGLE(GetFragmentMaterialfvSGIX)
+#define glGetFragmentMaterialivSGIX		MANGLE(GetFragmentMaterialivSGIX)
+#define glGetFramebufferAttachmentParameterivEXT		MANGLE(GetFramebufferAttachmentParameterivEXT)
+#define glGetHandleARB		MANGLE(GetHandleARB)
+#define glGetHistogramEXT		MANGLE(GetHistogramEXT)
+#define glGetHistogram		MANGLE(GetHistogram)
+#define glGetHistogramParameterfvEXT		MANGLE(GetHistogramParameterfvEXT)
+#define glGetHistogramParameterfv		MANGLE(GetHistogramParameterfv)
+#define glGetHistogramParameterivEXT		MANGLE(GetHistogramParameterivEXT)
+#define glGetHistogramParameteriv		MANGLE(GetHistogramParameteriv)
+#define glGetImageTransformParameterfvHP		MANGLE(GetImageTransformParameterfvHP)
+#define glGetImageTransformParameterivHP		MANGLE(GetImageTransformParameterivHP)
+#define glGetInfoLogARB		MANGLE(GetInfoLogARB)
+#define glGetInstrumentsSGIX		MANGLE(GetInstrumentsSGIX)
+#define glGetIntegerv		MANGLE(GetIntegerv)
+#define glGetInvariantBooleanvEXT		MANGLE(GetInvariantBooleanvEXT)
+#define glGetInvariantFloatvEXT		MANGLE(GetInvariantFloatvEXT)
+#define glGetInvariantIntegervEXT		MANGLE(GetInvariantIntegervEXT)
+#define glGetLightfv		MANGLE(GetLightfv)
+#define glGetLightiv		MANGLE(GetLightiv)
+#define glGetListParameterfvSGIX		MANGLE(GetListParameterfvSGIX)
+#define glGetListParameterivSGIX		MANGLE(GetListParameterivSGIX)
+#define glGetLocalConstantBooleanvEXT		MANGLE(GetLocalConstantBooleanvEXT)
+#define glGetLocalConstantFloatvEXT		MANGLE(GetLocalConstantFloatvEXT)
+#define glGetLocalConstantIntegervEXT		MANGLE(GetLocalConstantIntegervEXT)
+#define glGetMapAttribParameterfvNV		MANGLE(GetMapAttribParameterfvNV)
+#define glGetMapAttribParameterivNV		MANGLE(GetMapAttribParameterivNV)
+#define glGetMapControlPointsNV		MANGLE(GetMapControlPointsNV)
+#define glGetMapdv		MANGLE(GetMapdv)
+#define glGetMapfv		MANGLE(GetMapfv)
+#define glGetMapiv		MANGLE(GetMapiv)
+#define glGetMapParameterfvNV		MANGLE(GetMapParameterfvNV)
+#define glGetMapParameterivNV		MANGLE(GetMapParameterivNV)
+#define glGetMaterialfv		MANGLE(GetMaterialfv)
+#define glGetMaterialiv		MANGLE(GetMaterialiv)
+#define glGetMinmaxEXT		MANGLE(GetMinmaxEXT)
+#define glGetMinmax		MANGLE(GetMinmax)
+#define glGetMinmaxParameterfvEXT		MANGLE(GetMinmaxParameterfvEXT)
+#define glGetMinmaxParameterfv		MANGLE(GetMinmaxParameterfv)
+#define glGetMinmaxParameterivEXT		MANGLE(GetMinmaxParameterivEXT)
+#define glGetMinmaxParameteriv		MANGLE(GetMinmaxParameteriv)
+#define glGetObjectBufferfvATI		MANGLE(GetObjectBufferfvATI)
+#define glGetObjectBufferivATI		MANGLE(GetObjectBufferivATI)
+#define glGetObjectParameterfvARB		MANGLE(GetObjectParameterfvARB)
+#define glGetObjectParameterivARB		MANGLE(GetObjectParameterivARB)
+#define glGetOcclusionQueryivNV		MANGLE(GetOcclusionQueryivNV)
+#define glGetOcclusionQueryuivNV		MANGLE(GetOcclusionQueryuivNV)
+#define glGetPixelMapfv		MANGLE(GetPixelMapfv)
+#define glGetPixelMapuiv		MANGLE(GetPixelMapuiv)
+#define glGetPixelMapusv		MANGLE(GetPixelMapusv)
+#define glGetPixelTexGenParameterfvSGIS		MANGLE(GetPixelTexGenParameterfvSGIS)
+#define glGetPixelTexGenParameterivSGIS		MANGLE(GetPixelTexGenParameterivSGIS)
+#define glGetPointervEXT		MANGLE(GetPointervEXT)
+#define glGetPointerv		MANGLE(GetPointerv)
+#define glGetPolygonStipple		MANGLE(GetPolygonStipple)
+#define glGetProgramEnvParameterdvARB		MANGLE(GetProgramEnvParameterdvARB)
+#define glGetProgramEnvParameterfvARB		MANGLE(GetProgramEnvParameterfvARB)
+#define glGetProgramInfoLog		MANGLE(GetProgramInfoLog)
+#define glGetProgramivARB		MANGLE(GetProgramivARB)
+#define glGetProgramiv		MANGLE(GetProgramiv)
+#define glGetProgramivNV		MANGLE(GetProgramivNV)
+#define glGetProgramLocalParameterdvARB		MANGLE(GetProgramLocalParameterdvARB)
+#define glGetProgramLocalParameterfvARB		MANGLE(GetProgramLocalParameterfvARB)
+#define glGetProgramNamedParameterdvNV		MANGLE(GetProgramNamedParameterdvNV)
+#define glGetProgramNamedParameterfvNV		MANGLE(GetProgramNamedParameterfvNV)
+#define glGetProgramParameterdvNV		MANGLE(GetProgramParameterdvNV)
+#define glGetProgramParameterfvNV		MANGLE(GetProgramParameterfvNV)
+#define glGetProgramRegisterfvMESA		MANGLE(GetProgramRegisterfvMESA)
+#define glGetProgramStringARB		MANGLE(GetProgramStringARB)
+#define glGetProgramStringNV		MANGLE(GetProgramStringNV)
+#define glGetQueryivARB		MANGLE(GetQueryivARB)
+#define glGetQueryiv		MANGLE(GetQueryiv)
+#define glGetQueryObjecti64vEXT		MANGLE(GetQueryObjecti64vEXT)
+#define glGetQueryObjectivARB		MANGLE(GetQueryObjectivARB)
+#define glGetQueryObjectiv		MANGLE(GetQueryObjectiv)
+#define glGetQueryObjectui64vEXT		MANGLE(GetQueryObjectui64vEXT)
+#define glGetQueryObjectuivARB		MANGLE(GetQueryObjectuivARB)
+#define glGetQueryObjectuiv		MANGLE(GetQueryObjectuiv)
+#define glGetRenderbufferParameterivEXT		MANGLE(GetRenderbufferParameterivEXT)
+#define glGetSeparableFilterEXT		MANGLE(GetSeparableFilterEXT)
+#define glGetSeparableFilter		MANGLE(GetSeparableFilter)
+#define glGetShaderInfoLog		MANGLE(GetShaderInfoLog)
+#define glGetShaderiv		MANGLE(GetShaderiv)
+#define glGetShaderSourceARB		MANGLE(GetShaderSourceARB)
+#define glGetShaderSource		MANGLE(GetShaderSource)
+#define glGetSharpenTexFuncSGIS		MANGLE(GetSharpenTexFuncSGIS)
+#define glGetString		MANGLE(GetString)
+#define glGetTexBumpParameterfvATI		MANGLE(GetTexBumpParameterfvATI)
+#define glGetTexBumpParameterivATI		MANGLE(GetTexBumpParameterivATI)
+#define glGetTexEnvfv		MANGLE(GetTexEnvfv)
+#define glGetTexEnviv		MANGLE(GetTexEnviv)
+#define glGetTexFilterFuncSGIS		MANGLE(GetTexFilterFuncSGIS)
+#define glGetTexGendv		MANGLE(GetTexGendv)
+#define glGetTexGenfv		MANGLE(GetTexGenfv)
+#define glGetTexGeniv		MANGLE(GetTexGeniv)
+#define glGetTexImage		MANGLE(GetTexImage)
+#define glGetTexLevelParameterfv		MANGLE(GetTexLevelParameterfv)
+#define glGetTexLevelParameteriv		MANGLE(GetTexLevelParameteriv)
+#define glGetTexParameterfv		MANGLE(GetTexParameterfv)
+#define glGetTexParameteriv		MANGLE(GetTexParameteriv)
+#define glGetTrackMatrixivNV		MANGLE(GetTrackMatrixivNV)
+#define glGetUniformfvARB		MANGLE(GetUniformfvARB)
+#define glGetUniformfv		MANGLE(GetUniformfv)
+#define glGetUniformivARB		MANGLE(GetUniformivARB)
+#define glGetUniformiv		MANGLE(GetUniformiv)
+#define glGetUniformLocationARB		MANGLE(GetUniformLocationARB)
+#define glGetUniformLocation		MANGLE(GetUniformLocation)
+#define glGetVariantArrayObjectfvATI		MANGLE(GetVariantArrayObjectfvATI)
+#define glGetVariantArrayObjectivATI		MANGLE(GetVariantArrayObjectivATI)
+#define glGetVariantBooleanvEXT		MANGLE(GetVariantBooleanvEXT)
+#define glGetVariantFloatvEXT		MANGLE(GetVariantFloatvEXT)
+#define glGetVariantIntegervEXT		MANGLE(GetVariantIntegervEXT)
+#define glGetVariantPointervEXT		MANGLE(GetVariantPointervEXT)
+#define glGetVertexAttribArrayObjectfvATI		MANGLE(GetVertexAttribArrayObjectfvATI)
+#define glGetVertexAttribArrayObjectivATI		MANGLE(GetVertexAttribArrayObjectivATI)
+#define glGetVertexAttribdvARB		MANGLE(GetVertexAttribdvARB)
+#define glGetVertexAttribdv		MANGLE(GetVertexAttribdv)
+#define glGetVertexAttribdvNV		MANGLE(GetVertexAttribdvNV)
+#define glGetVertexAttribfvARB		MANGLE(GetVertexAttribfvARB)
+#define glGetVertexAttribfv		MANGLE(GetVertexAttribfv)
+#define glGetVertexAttribfvNV		MANGLE(GetVertexAttribfvNV)
+#define glGetVertexAttribivARB		MANGLE(GetVertexAttribivARB)
+#define glGetVertexAttribiv		MANGLE(GetVertexAttribiv)
+#define glGetVertexAttribivNV		MANGLE(GetVertexAttribivNV)
+#define glGetVertexAttribPointervARB		MANGLE(GetVertexAttribPointervARB)
+#define glGetVertexAttribPointerv		MANGLE(GetVertexAttribPointerv)
+#define glGetVertexAttribPointervNV		MANGLE(GetVertexAttribPointervNV)
+#define glGlobalAlphaFactorbSUN		MANGLE(GlobalAlphaFactorbSUN)
+#define glGlobalAlphaFactordSUN		MANGLE(GlobalAlphaFactordSUN)
+#define glGlobalAlphaFactorfSUN		MANGLE(GlobalAlphaFactorfSUN)
+#define glGlobalAlphaFactoriSUN		MANGLE(GlobalAlphaFactoriSUN)
+#define glGlobalAlphaFactorsSUN		MANGLE(GlobalAlphaFactorsSUN)
+#define glGlobalAlphaFactorubSUN		MANGLE(GlobalAlphaFactorubSUN)
+#define glGlobalAlphaFactoruiSUN		MANGLE(GlobalAlphaFactoruiSUN)
+#define glGlobalAlphaFactorusSUN		MANGLE(GlobalAlphaFactorusSUN)
+#define glHint		MANGLE(Hint)
+#define glHintPGI		MANGLE(HintPGI)
+#define glHistogramEXT		MANGLE(HistogramEXT)
+#define glHistogram		MANGLE(Histogram)
+#define glIglooInterfaceSGIX		MANGLE(IglooInterfaceSGIX)
+#define glImageTransformParameterfHP		MANGLE(ImageTransformParameterfHP)
+#define glImageTransformParameterfvHP		MANGLE(ImageTransformParameterfvHP)
+#define glImageTransformParameteriHP		MANGLE(ImageTransformParameteriHP)
+#define glImageTransformParameterivHP		MANGLE(ImageTransformParameterivHP)
+#define glIndexd		MANGLE(Indexd)
+#define glIndexdv		MANGLE(Indexdv)
+#define glIndexf		MANGLE(Indexf)
+#define glIndexFuncEXT		MANGLE(IndexFuncEXT)
+#define glIndexfv		MANGLE(Indexfv)
+#define glIndexi		MANGLE(Indexi)
+#define glIndexiv		MANGLE(Indexiv)
+#define glIndexMask		MANGLE(IndexMask)
+#define glIndexMaterialEXT		MANGLE(IndexMaterialEXT)
+#define glIndexPointerEXT		MANGLE(IndexPointerEXT)
+#define glIndexPointerListIBM		MANGLE(IndexPointerListIBM)
+#define glIndexPointer		MANGLE(IndexPointer)
+#define glIndexs		MANGLE(Indexs)
+#define glIndexsv		MANGLE(Indexsv)
+#define glIndexub		MANGLE(Indexub)
+#define glIndexubv		MANGLE(Indexubv)
+#define glInitNames		MANGLE(InitNames)
+#define glInsertComponentEXT		MANGLE(InsertComponentEXT)
+#define glInstrumentsBufferSGIX		MANGLE(InstrumentsBufferSGIX)
+#define glInterleavedArrays		MANGLE(InterleavedArrays)
+#define glIsAsyncMarkerSGIX		MANGLE(IsAsyncMarkerSGIX)
+#define glIsBufferARB		MANGLE(IsBufferARB)
+#define glIsBuffer		MANGLE(IsBuffer)
+#define glIsEnabled		MANGLE(IsEnabled)
+#define glIsFenceAPPLE		MANGLE(IsFenceAPPLE)
+#define glIsFenceNV		MANGLE(IsFenceNV)
+#define glIsFramebufferEXT		MANGLE(IsFramebufferEXT)
+#define glIsList		MANGLE(IsList)
+#define glIsObjectBufferATI		MANGLE(IsObjectBufferATI)
+#define glIsOcclusionQueryNV		MANGLE(IsOcclusionQueryNV)
+#define glIsProgramARB		MANGLE(IsProgramARB)
+#define glIsProgram		MANGLE(IsProgram)
+#define glIsProgramNV		MANGLE(IsProgramNV)
+#define glIsQueryARB		MANGLE(IsQueryARB)
+#define glIsQuery		MANGLE(IsQuery)
+#define glIsRenderbufferEXT		MANGLE(IsRenderbufferEXT)
+#define glIsShader		MANGLE(IsShader)
+#define glIsTextureEXT		MANGLE(IsTextureEXT)
+#define glIsTexture		MANGLE(IsTexture)
+#define glIsVariantEnabledEXT		MANGLE(IsVariantEnabledEXT)
+#define glIsVertexArrayAPPLE		MANGLE(IsVertexArrayAPPLE)
+#define glLightEnviSGIX		MANGLE(LightEnviSGIX)
+#define glLightf		MANGLE(Lightf)
+#define glLightfv		MANGLE(Lightfv)
+#define glLighti		MANGLE(Lighti)
+#define glLightiv		MANGLE(Lightiv)
+#define glLightModelf		MANGLE(LightModelf)
+#define glLightModelfv		MANGLE(LightModelfv)
+#define glLightModeli		MANGLE(LightModeli)
+#define glLightModeliv		MANGLE(LightModeliv)
+#define glLineStipple		MANGLE(LineStipple)
+#define glLineWidth		MANGLE(LineWidth)
+#define glLinkProgramARB		MANGLE(LinkProgramARB)
+#define glLinkProgram		MANGLE(LinkProgram)
+#define glListBase		MANGLE(ListBase)
+#define glListParameterfSGIX		MANGLE(ListParameterfSGIX)
+#define glListParameterfvSGIX		MANGLE(ListParameterfvSGIX)
+#define glListParameteriSGIX		MANGLE(ListParameteriSGIX)
+#define glListParameterivSGIX		MANGLE(ListParameterivSGIX)
+#define glLoadIdentityDeformationMapSGIX		MANGLE(LoadIdentityDeformationMapSGIX)
+#define glLoadIdentity		MANGLE(LoadIdentity)
+#define glLoadMatrixd		MANGLE(LoadMatrixd)
+#define glLoadMatrixf		MANGLE(LoadMatrixf)
+#define glLoadName		MANGLE(LoadName)
+#define glLoadProgramNV		MANGLE(LoadProgramNV)
+#define glLoadTransposeMatrixdARB		MANGLE(LoadTransposeMatrixdARB)
+#define glLoadTransposeMatrixd		MANGLE(LoadTransposeMatrixd)
+#define glLoadTransposeMatrixfARB		MANGLE(LoadTransposeMatrixfARB)
+#define glLoadTransposeMatrixf		MANGLE(LoadTransposeMatrixf)
+#define glLockArraysEXT		MANGLE(LockArraysEXT)
+#define glLogicOp		MANGLE(LogicOp)
+#define glMap1d		MANGLE(Map1d)
+#define glMap1f		MANGLE(Map1f)
+#define glMap2d		MANGLE(Map2d)
+#define glMap2f		MANGLE(Map2f)
+#define glMapBufferARB		MANGLE(MapBufferARB)
+#define glMapBuffer		MANGLE(MapBuffer)
+#define glMapControlPointsNV		MANGLE(MapControlPointsNV)
+#define glMapGrid1d		MANGLE(MapGrid1d)
+#define glMapGrid1f		MANGLE(MapGrid1f)
+#define glMapGrid2d		MANGLE(MapGrid2d)
+#define glMapGrid2f		MANGLE(MapGrid2f)
+#define glMapObjectBufferATI		MANGLE(MapObjectBufferATI)
+#define glMapParameterfvNV		MANGLE(MapParameterfvNV)
+#define glMapParameterivNV		MANGLE(MapParameterivNV)
+#define glMaterialf		MANGLE(Materialf)
+#define glMaterialfv		MANGLE(Materialfv)
+#define glMateriali		MANGLE(Materiali)
+#define glMaterialiv		MANGLE(Materialiv)
+#define glMatrixIndexPointerARB		MANGLE(MatrixIndexPointerARB)
+#define glMatrixIndexubvARB		MANGLE(MatrixIndexubvARB)
+#define glMatrixIndexuivARB		MANGLE(MatrixIndexuivARB)
+#define glMatrixIndexusvARB		MANGLE(MatrixIndexusvARB)
+#define glMatrixMode		MANGLE(MatrixMode)
+#define glMinmaxEXT		MANGLE(MinmaxEXT)
+#define glMinmax		MANGLE(Minmax)
+#define glMultiDrawArraysEXT		MANGLE(MultiDrawArraysEXT)
+#define glMultiDrawArrays		MANGLE(MultiDrawArrays)
+#define glMultiDrawElementArrayAPPLE		MANGLE(MultiDrawElementArrayAPPLE)
+#define glMultiDrawElementsEXT		MANGLE(MultiDrawElementsEXT)
+#define glMultiDrawElements		MANGLE(MultiDrawElements)
+#define glMultiDrawRangeElementArrayAPPLE		MANGLE(MultiDrawRangeElementArrayAPPLE)
+#define glMultiModeDrawArraysIBM		MANGLE(MultiModeDrawArraysIBM)
+#define glMultiModeDrawElementsIBM		MANGLE(MultiModeDrawElementsIBM)
+#define glMultiTexCoord1dARB		MANGLE(MultiTexCoord1dARB)
+#define glMultiTexCoord1d		MANGLE(MultiTexCoord1d)
+#define glMultiTexCoord1dvARB		MANGLE(MultiTexCoord1dvARB)
+#define glMultiTexCoord1dv		MANGLE(MultiTexCoord1dv)
+#define glMultiTexCoord1fARB		MANGLE(MultiTexCoord1fARB)
+#define glMultiTexCoord1f		MANGLE(MultiTexCoord1f)
+#define glMultiTexCoord1fvARB		MANGLE(MultiTexCoord1fvARB)
+#define glMultiTexCoord1fv		MANGLE(MultiTexCoord1fv)
+#define glMultiTexCoord1hNV		MANGLE(MultiTexCoord1hNV)
+#define glMultiTexCoord1hvNV		MANGLE(MultiTexCoord1hvNV)
+#define glMultiTexCoord1iARB		MANGLE(MultiTexCoord1iARB)
+#define glMultiTexCoord1i		MANGLE(MultiTexCoord1i)
+#define glMultiTexCoord1ivARB		MANGLE(MultiTexCoord1ivARB)
+#define glMultiTexCoord1iv		MANGLE(MultiTexCoord1iv)
+#define glMultiTexCoord1sARB		MANGLE(MultiTexCoord1sARB)
+#define glMultiTexCoord1s		MANGLE(MultiTexCoord1s)
+#define glMultiTexCoord1svARB		MANGLE(MultiTexCoord1svARB)
+#define glMultiTexCoord1sv		MANGLE(MultiTexCoord1sv)
+#define glMultiTexCoord2dARB		MANGLE(MultiTexCoord2dARB)
+#define glMultiTexCoord2d		MANGLE(MultiTexCoord2d)
+#define glMultiTexCoord2dvARB		MANGLE(MultiTexCoord2dvARB)
+#define glMultiTexCoord2dv		MANGLE(MultiTexCoord2dv)
+#define glMultiTexCoord2fARB		MANGLE(MultiTexCoord2fARB)
+#define glMultiTexCoord2f		MANGLE(MultiTexCoord2f)
+#define glMultiTexCoord2fvARB		MANGLE(MultiTexCoord2fvARB)
+#define glMultiTexCoord2fv		MANGLE(MultiTexCoord2fv)
+#define glMultiTexCoord2hNV		MANGLE(MultiTexCoord2hNV)
+#define glMultiTexCoord2hvNV		MANGLE(MultiTexCoord2hvNV)
+#define glMultiTexCoord2iARB		MANGLE(MultiTexCoord2iARB)
+#define glMultiTexCoord2i		MANGLE(MultiTexCoord2i)
+#define glMultiTexCoord2ivARB		MANGLE(MultiTexCoord2ivARB)
+#define glMultiTexCoord2iv		MANGLE(MultiTexCoord2iv)
+#define glMultiTexCoord2sARB		MANGLE(MultiTexCoord2sARB)
+#define glMultiTexCoord2s		MANGLE(MultiTexCoord2s)
+#define glMultiTexCoord2svARB		MANGLE(MultiTexCoord2svARB)
+#define glMultiTexCoord2sv		MANGLE(MultiTexCoord2sv)
+#define glMultiTexCoord3dARB		MANGLE(MultiTexCoord3dARB)
+#define glMultiTexCoord3d		MANGLE(MultiTexCoord3d)
+#define glMultiTexCoord3dvARB		MANGLE(MultiTexCoord3dvARB)
+#define glMultiTexCoord3dv		MANGLE(MultiTexCoord3dv)
+#define glMultiTexCoord3fARB		MANGLE(MultiTexCoord3fARB)
+#define glMultiTexCoord3f		MANGLE(MultiTexCoord3f)
+#define glMultiTexCoord3fvARB		MANGLE(MultiTexCoord3fvARB)
+#define glMultiTexCoord3fv		MANGLE(MultiTexCoord3fv)
+#define glMultiTexCoord3hNV		MANGLE(MultiTexCoord3hNV)
+#define glMultiTexCoord3hvNV		MANGLE(MultiTexCoord3hvNV)
+#define glMultiTexCoord3iARB		MANGLE(MultiTexCoord3iARB)
+#define glMultiTexCoord3i		MANGLE(MultiTexCoord3i)
+#define glMultiTexCoord3ivARB		MANGLE(MultiTexCoord3ivARB)
+#define glMultiTexCoord3iv		MANGLE(MultiTexCoord3iv)
+#define glMultiTexCoord3sARB		MANGLE(MultiTexCoord3sARB)
+#define glMultiTexCoord3s		MANGLE(MultiTexCoord3s)
+#define glMultiTexCoord3svARB		MANGLE(MultiTexCoord3svARB)
+#define glMultiTexCoord3sv		MANGLE(MultiTexCoord3sv)
+#define glMultiTexCoord4dARB		MANGLE(MultiTexCoord4dARB)
+#define glMultiTexCoord4d		MANGLE(MultiTexCoord4d)
+#define glMultiTexCoord4dvARB		MANGLE(MultiTexCoord4dvARB)
+#define glMultiTexCoord4dv		MANGLE(MultiTexCoord4dv)
+#define glMultiTexCoord4fARB		MANGLE(MultiTexCoord4fARB)
+#define glMultiTexCoord4f		MANGLE(MultiTexCoord4f)
+#define glMultiTexCoord4fvARB		MANGLE(MultiTexCoord4fvARB)
+#define glMultiTexCoord4fv		MANGLE(MultiTexCoord4fv)
+#define glMultiTexCoord4hNV		MANGLE(MultiTexCoord4hNV)
+#define glMultiTexCoord4hvNV		MANGLE(MultiTexCoord4hvNV)
+#define glMultiTexCoord4iARB		MANGLE(MultiTexCoord4iARB)
+#define glMultiTexCoord4i		MANGLE(MultiTexCoord4i)
+#define glMultiTexCoord4ivARB		MANGLE(MultiTexCoord4ivARB)
+#define glMultiTexCoord4iv		MANGLE(MultiTexCoord4iv)
+#define glMultiTexCoord4sARB		MANGLE(MultiTexCoord4sARB)
+#define glMultiTexCoord4s		MANGLE(MultiTexCoord4s)
+#define glMultiTexCoord4svARB		MANGLE(MultiTexCoord4svARB)
+#define glMultiTexCoord4sv		MANGLE(MultiTexCoord4sv)
+#define glMultMatrixd		MANGLE(MultMatrixd)
+#define glMultMatrixf		MANGLE(MultMatrixf)
+#define glMultTransposeMatrixdARB		MANGLE(MultTransposeMatrixdARB)
+#define glMultTransposeMatrixd		MANGLE(MultTransposeMatrixd)
+#define glMultTransposeMatrixfARB		MANGLE(MultTransposeMatrixfARB)
+#define glMultTransposeMatrixf		MANGLE(MultTransposeMatrixf)
+#define glNewList		MANGLE(NewList)
+#define glNewObjectBufferATI		MANGLE(NewObjectBufferATI)
+#define glNewTraceMESA		MANGLE(NewTraceMESA)
+#define glNormal3b		MANGLE(Normal3b)
+#define glNormal3bv		MANGLE(Normal3bv)
+#define glNormal3d		MANGLE(Normal3d)
+#define glNormal3dv		MANGLE(Normal3dv)
+#define glNormal3f		MANGLE(Normal3f)
+#define glNormal3fVertex3fSUN		MANGLE(Normal3fVertex3fSUN)
+#define glNormal3fVertex3fvSUN		MANGLE(Normal3fVertex3fvSUN)
+#define glNormal3fv		MANGLE(Normal3fv)
+#define glNormal3hNV		MANGLE(Normal3hNV)
+#define glNormal3hvNV		MANGLE(Normal3hvNV)
+#define glNormal3i		MANGLE(Normal3i)
+#define glNormal3iv		MANGLE(Normal3iv)
+#define glNormal3s		MANGLE(Normal3s)
+#define glNormal3sv		MANGLE(Normal3sv)
+#define glNormalPointerEXT		MANGLE(NormalPointerEXT)
+#define glNormalPointerListIBM		MANGLE(NormalPointerListIBM)
+#define glNormalPointer		MANGLE(NormalPointer)
+#define glNormalPointervINTEL		MANGLE(NormalPointervINTEL)
+#define glNormalStream3bATI		MANGLE(NormalStream3bATI)
+#define glNormalStream3bvATI		MANGLE(NormalStream3bvATI)
+#define glNormalStream3dATI		MANGLE(NormalStream3dATI)
+#define glNormalStream3dvATI		MANGLE(NormalStream3dvATI)
+#define glNormalStream3fATI		MANGLE(NormalStream3fATI)
+#define glNormalStream3fvATI		MANGLE(NormalStream3fvATI)
+#define glNormalStream3iATI		MANGLE(NormalStream3iATI)
+#define glNormalStream3ivATI		MANGLE(NormalStream3ivATI)
+#define glNormalStream3sATI		MANGLE(NormalStream3sATI)
+#define glNormalStream3svATI		MANGLE(NormalStream3svATI)
+#define glOrtho		MANGLE(Ortho)
+#define glPassTexCoordATI		MANGLE(PassTexCoordATI)
+#define glPassThrough		MANGLE(PassThrough)
+#define glPixelDataRangeNV		MANGLE(PixelDataRangeNV)
+#define glPixelMapfv		MANGLE(PixelMapfv)
+#define glPixelMapuiv		MANGLE(PixelMapuiv)
+#define glPixelMapusv		MANGLE(PixelMapusv)
+#define glPixelStoref		MANGLE(PixelStoref)
+#define glPixelStorei		MANGLE(PixelStorei)
+#define glPixelTexGenParameterfSGIS		MANGLE(PixelTexGenParameterfSGIS)
+#define glPixelTexGenParameterfvSGIS		MANGLE(PixelTexGenParameterfvSGIS)
+#define glPixelTexGenParameteriSGIS		MANGLE(PixelTexGenParameteriSGIS)
+#define glPixelTexGenParameterivSGIS		MANGLE(PixelTexGenParameterivSGIS)
+#define glPixelTexGenSGIX		MANGLE(PixelTexGenSGIX)
+#define glPixelTransferf		MANGLE(PixelTransferf)
+#define glPixelTransferi		MANGLE(PixelTransferi)
+#define glPixelTransformParameterfEXT		MANGLE(PixelTransformParameterfEXT)
+#define glPixelTransformParameterfvEXT		MANGLE(PixelTransformParameterfvEXT)
+#define glPixelTransformParameteriEXT		MANGLE(PixelTransformParameteriEXT)
+#define glPixelTransformParameterivEXT		MANGLE(PixelTransformParameterivEXT)
+#define glPixelZoom		MANGLE(PixelZoom)
+#define glPNTrianglesfATI		MANGLE(PNTrianglesfATI)
+#define glPNTrianglesiATI		MANGLE(PNTrianglesiATI)
+#define glPointParameterfARB		MANGLE(PointParameterfARB)
+#define glPointParameterfEXT		MANGLE(PointParameterfEXT)
+#define glPointParameterf		MANGLE(PointParameterf)
+#define glPointParameterfSGIS		MANGLE(PointParameterfSGIS)
+#define glPointParameterfvARB		MANGLE(PointParameterfvARB)
+#define glPointParameterfvEXT		MANGLE(PointParameterfvEXT)
+#define glPointParameterfv		MANGLE(PointParameterfv)
+#define glPointParameterfvSGIS		MANGLE(PointParameterfvSGIS)
+#define glPointParameteri		MANGLE(PointParameteri)
+#define glPointParameteriNV		MANGLE(PointParameteriNV)
+#define glPointParameteriv		MANGLE(PointParameteriv)
+#define glPointParameterivNV		MANGLE(PointParameterivNV)
+#define glPointSize		MANGLE(PointSize)
+#define glPollAsyncSGIX		MANGLE(PollAsyncSGIX)
+#define glPollInstrumentsSGIX		MANGLE(PollInstrumentsSGIX)
+#define glPolygonMode		MANGLE(PolygonMode)
+#define glPolygonOffsetEXT		MANGLE(PolygonOffsetEXT)
+#define glPolygonOffset		MANGLE(PolygonOffset)
+#define glPolygonStipple		MANGLE(PolygonStipple)
+#define glPopAttrib		MANGLE(PopAttrib)
+#define glPopClientAttrib		MANGLE(PopClientAttrib)
+#define glPopMatrix		MANGLE(PopMatrix)
+#define glPopName		MANGLE(PopName)
+#define glPrimitiveRestartIndexNV		MANGLE(PrimitiveRestartIndexNV)
+#define glPrimitiveRestartNV		MANGLE(PrimitiveRestartNV)
+#define glPrioritizeTexturesEXT		MANGLE(PrioritizeTexturesEXT)
+#define glPrioritizeTextures		MANGLE(PrioritizeTextures)
+#define glProgramCallbackMESA		MANGLE(ProgramCallbackMESA)
+#define glProgramEnvParameter4dARB		MANGLE(ProgramEnvParameter4dARB)
+#define glProgramEnvParameter4dvARB		MANGLE(ProgramEnvParameter4dvARB)
+#define glProgramEnvParameter4fARB		MANGLE(ProgramEnvParameter4fARB)
+#define glProgramEnvParameter4fvARB		MANGLE(ProgramEnvParameter4fvARB)
+#define glProgramLocalParameter4dARB		MANGLE(ProgramLocalParameter4dARB)
+#define glProgramLocalParameter4dvARB		MANGLE(ProgramLocalParameter4dvARB)
+#define glProgramLocalParameter4fARB		MANGLE(ProgramLocalParameter4fARB)
+#define glProgramLocalParameter4fvARB		MANGLE(ProgramLocalParameter4fvARB)
+#define glProgramNamedParameter4dNV		MANGLE(ProgramNamedParameter4dNV)
+#define glProgramNamedParameter4dvNV		MANGLE(ProgramNamedParameter4dvNV)
+#define glProgramNamedParameter4fNV		MANGLE(ProgramNamedParameter4fNV)
+#define glProgramNamedParameter4fvNV		MANGLE(ProgramNamedParameter4fvNV)
+#define glProgramParameter4dNV		MANGLE(ProgramParameter4dNV)
+#define glProgramParameter4dvNV		MANGLE(ProgramParameter4dvNV)
+#define glProgramParameter4fNV		MANGLE(ProgramParameter4fNV)
+#define glProgramParameter4fvNV		MANGLE(ProgramParameter4fvNV)
+#define glProgramParameters4dvNV		MANGLE(ProgramParameters4dvNV)
+#define glProgramParameters4fvNV		MANGLE(ProgramParameters4fvNV)
+#define glProgramStringARB		MANGLE(ProgramStringARB)
+#define glPushAttrib		MANGLE(PushAttrib)
+#define glPushClientAttrib		MANGLE(PushClientAttrib)
+#define glPushMatrix		MANGLE(PushMatrix)
+#define glPushName		MANGLE(PushName)
+#define glRasterPos2d		MANGLE(RasterPos2d)
+#define glRasterPos2dv		MANGLE(RasterPos2dv)
+#define glRasterPos2f		MANGLE(RasterPos2f)
+#define glRasterPos2fv		MANGLE(RasterPos2fv)
+#define glRasterPos2i		MANGLE(RasterPos2i)
+#define glRasterPos2iv		MANGLE(RasterPos2iv)
+#define glRasterPos2s		MANGLE(RasterPos2s)
+#define glRasterPos2sv		MANGLE(RasterPos2sv)
+#define glRasterPos3d		MANGLE(RasterPos3d)
+#define glRasterPos3dv		MANGLE(RasterPos3dv)
+#define glRasterPos3f		MANGLE(RasterPos3f)
+#define glRasterPos3fv		MANGLE(RasterPos3fv)
+#define glRasterPos3i		MANGLE(RasterPos3i)
+#define glRasterPos3iv		MANGLE(RasterPos3iv)
+#define glRasterPos3s		MANGLE(RasterPos3s)
+#define glRasterPos3sv		MANGLE(RasterPos3sv)
+#define glRasterPos4d		MANGLE(RasterPos4d)
+#define glRasterPos4dv		MANGLE(RasterPos4dv)
+#define glRasterPos4f		MANGLE(RasterPos4f)
+#define glRasterPos4fv		MANGLE(RasterPos4fv)
+#define glRasterPos4i		MANGLE(RasterPos4i)
+#define glRasterPos4iv		MANGLE(RasterPos4iv)
+#define glRasterPos4s		MANGLE(RasterPos4s)
+#define glRasterPos4sv		MANGLE(RasterPos4sv)
+#define glReadBuffer		MANGLE(ReadBuffer)
+#define glReadInstrumentsSGIX		MANGLE(ReadInstrumentsSGIX)
+#define glReadPixels		MANGLE(ReadPixels)
+#define glRectd		MANGLE(Rectd)
+#define glRectdv		MANGLE(Rectdv)
+#define glRectf		MANGLE(Rectf)
+#define glRectfv		MANGLE(Rectfv)
+#define glRecti		MANGLE(Recti)
+#define glRectiv		MANGLE(Rectiv)
+#define glRects		MANGLE(Rects)
+#define glRectsv		MANGLE(Rectsv)
+#define glReferencePlaneSGIX		MANGLE(ReferencePlaneSGIX)
+#define glRenderbufferStorageEXT		MANGLE(RenderbufferStorageEXT)
+#define glRenderMode		MANGLE(RenderMode)
+#define glReplacementCodePointerSUN		MANGLE(ReplacementCodePointerSUN)
+#define glReplacementCodeubSUN		MANGLE(ReplacementCodeubSUN)
+#define glReplacementCodeubvSUN		MANGLE(ReplacementCodeubvSUN)
+#define glReplacementCodeuiColor3fVertex3fSUN		MANGLE(ReplacementCodeuiColor3fVertex3fSUN)
+#define glReplacementCodeuiColor3fVertex3fvSUN		MANGLE(ReplacementCodeuiColor3fVertex3fvSUN)
+#define glReplacementCodeuiColor4fNormal3fVertex3fSUN		MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fSUN)
+#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN		MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiColor4ubVertex3fSUN		MANGLE(ReplacementCodeuiColor4ubVertex3fSUN)
+#define glReplacementCodeuiColor4ubVertex3fvSUN		MANGLE(ReplacementCodeuiColor4ubVertex3fvSUN)
+#define glReplacementCodeuiNormal3fVertex3fSUN		MANGLE(ReplacementCodeuiNormal3fVertex3fSUN)
+#define glReplacementCodeuiNormal3fVertex3fvSUN		MANGLE(ReplacementCodeuiNormal3fVertex3fvSUN)
+#define glReplacementCodeuiSUN		MANGLE(ReplacementCodeuiSUN)
+#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN		MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN		MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN		MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN		MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiTexCoord2fVertex3fSUN		MANGLE(ReplacementCodeuiTexCoord2fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fVertex3fvSUN		MANGLE(ReplacementCodeuiTexCoord2fVertex3fvSUN)
+#define glReplacementCodeuiVertex3fSUN		MANGLE(ReplacementCodeuiVertex3fSUN)
+#define glReplacementCodeuiVertex3fvSUN		MANGLE(ReplacementCodeuiVertex3fvSUN)
+#define glReplacementCodeuivSUN		MANGLE(ReplacementCodeuivSUN)
+#define glReplacementCodeusSUN		MANGLE(ReplacementCodeusSUN)
+#define glReplacementCodeusvSUN		MANGLE(ReplacementCodeusvSUN)
+#define glRequestResidentProgramsNV		MANGLE(RequestResidentProgramsNV)
+#define glResetHistogramEXT		MANGLE(ResetHistogramEXT)
+#define glResetHistogram		MANGLE(ResetHistogram)
+#define glResetMinmaxEXT		MANGLE(ResetMinmaxEXT)
+#define glResetMinmax		MANGLE(ResetMinmax)
+#define glResizeBuffersMESA		MANGLE(ResizeBuffersMESA)
+#define glRotated		MANGLE(Rotated)
+#define glRotatef		MANGLE(Rotatef)
+#define glSampleCoverageARB		MANGLE(SampleCoverageARB)
+#define glSampleCoverage		MANGLE(SampleCoverage)
+#define glSampleMapATI		MANGLE(SampleMapATI)
+#define glSampleMaskEXT		MANGLE(SampleMaskEXT)
+#define glSampleMaskSGIS		MANGLE(SampleMaskSGIS)
+#define glSamplePatternEXT		MANGLE(SamplePatternEXT)
+#define glSamplePatternSGIS		MANGLE(SamplePatternSGIS)
+#define glScaled		MANGLE(Scaled)
+#define glScalef		MANGLE(Scalef)
+#define glScissor		MANGLE(Scissor)
+#define glSecondaryColor3bEXT		MANGLE(SecondaryColor3bEXT)
+#define glSecondaryColor3b		MANGLE(SecondaryColor3b)
+#define glSecondaryColor3bvEXT		MANGLE(SecondaryColor3bvEXT)
+#define glSecondaryColor3bv		MANGLE(SecondaryColor3bv)
+#define glSecondaryColor3dEXT		MANGLE(SecondaryColor3dEXT)
+#define glSecondaryColor3d		MANGLE(SecondaryColor3d)
+#define glSecondaryColor3dvEXT		MANGLE(SecondaryColor3dvEXT)
+#define glSecondaryColor3dv		MANGLE(SecondaryColor3dv)
+#define glSecondaryColor3fEXT		MANGLE(SecondaryColor3fEXT)
+#define glSecondaryColor3f		MANGLE(SecondaryColor3f)
+#define glSecondaryColor3fvEXT		MANGLE(SecondaryColor3fvEXT)
+#define glSecondaryColor3fv		MANGLE(SecondaryColor3fv)
+#define glSecondaryColor3hNV		MANGLE(SecondaryColor3hNV)
+#define glSecondaryColor3hvNV		MANGLE(SecondaryColor3hvNV)
+#define glSecondaryColor3iEXT		MANGLE(SecondaryColor3iEXT)
+#define glSecondaryColor3i		MANGLE(SecondaryColor3i)
+#define glSecondaryColor3ivEXT		MANGLE(SecondaryColor3ivEXT)
+#define glSecondaryColor3iv		MANGLE(SecondaryColor3iv)
+#define glSecondaryColor3sEXT		MANGLE(SecondaryColor3sEXT)
+#define glSecondaryColor3s		MANGLE(SecondaryColor3s)
+#define glSecondaryColor3svEXT		MANGLE(SecondaryColor3svEXT)
+#define glSecondaryColor3sv		MANGLE(SecondaryColor3sv)
+#define glSecondaryColor3ubEXT		MANGLE(SecondaryColor3ubEXT)
+#define glSecondaryColor3ub		MANGLE(SecondaryColor3ub)
+#define glSecondaryColor3ubvEXT		MANGLE(SecondaryColor3ubvEXT)
+#define glSecondaryColor3ubv		MANGLE(SecondaryColor3ubv)
+#define glSecondaryColor3uiEXT		MANGLE(SecondaryColor3uiEXT)
+#define glSecondaryColor3ui		MANGLE(SecondaryColor3ui)
+#define glSecondaryColor3uivEXT		MANGLE(SecondaryColor3uivEXT)
+#define glSecondaryColor3uiv		MANGLE(SecondaryColor3uiv)
+#define glSecondaryColor3usEXT		MANGLE(SecondaryColor3usEXT)
+#define glSecondaryColor3us		MANGLE(SecondaryColor3us)
+#define glSecondaryColor3usvEXT		MANGLE(SecondaryColor3usvEXT)
+#define glSecondaryColor3usv		MANGLE(SecondaryColor3usv)
+#define glSecondaryColorPointerEXT		MANGLE(SecondaryColorPointerEXT)
+#define glSecondaryColorPointerListIBM		MANGLE(SecondaryColorPointerListIBM)
+#define glSecondaryColorPointer		MANGLE(SecondaryColorPointer)
+#define glSelectBuffer		MANGLE(SelectBuffer)
+#define glSeparableFilter2DEXT		MANGLE(SeparableFilter2DEXT)
+#define glSeparableFilter2D		MANGLE(SeparableFilter2D)
+#define glSetFenceAPPLE		MANGLE(SetFenceAPPLE)
+#define glSetFenceNV		MANGLE(SetFenceNV)
+#define glSetFragmentShaderConstantATI		MANGLE(SetFragmentShaderConstantATI)
+#define glSetInvariantEXT		MANGLE(SetInvariantEXT)
+#define glSetLocalConstantEXT		MANGLE(SetLocalConstantEXT)
+#define glShadeModel		MANGLE(ShadeModel)
+#define glShaderOp1EXT		MANGLE(ShaderOp1EXT)
+#define glShaderOp2EXT		MANGLE(ShaderOp2EXT)
+#define glShaderOp3EXT		MANGLE(ShaderOp3EXT)
+#define glShaderSourceARB		MANGLE(ShaderSourceARB)
+#define glShaderSource		MANGLE(ShaderSource)
+#define glSharpenTexFuncSGIS		MANGLE(SharpenTexFuncSGIS)
+#define glSpriteParameterfSGIX		MANGLE(SpriteParameterfSGIX)
+#define glSpriteParameterfvSGIX		MANGLE(SpriteParameterfvSGIX)
+#define glSpriteParameteriSGIX		MANGLE(SpriteParameteriSGIX)
+#define glSpriteParameterivSGIX		MANGLE(SpriteParameterivSGIX)
+#define glStartInstrumentsSGIX		MANGLE(StartInstrumentsSGIX)
+#define glStencilFunc		MANGLE(StencilFunc)
+#define glStencilFuncSeparateATI		MANGLE(StencilFuncSeparateATI)
+#define glStencilFuncSeparate		MANGLE(StencilFuncSeparate)
+#define glStencilMask		MANGLE(StencilMask)
+#define glStencilMaskSeparate		MANGLE(StencilMaskSeparate)
+#define glStencilOp		MANGLE(StencilOp)
+#define glStencilOpSeparateATI		MANGLE(StencilOpSeparateATI)
+#define glStencilOpSeparate		MANGLE(StencilOpSeparate)
+#define glStopInstrumentsSGIX		MANGLE(StopInstrumentsSGIX)
+#define glStringMarkerGREMEDY		MANGLE(StringMarkerGREMEDY)
+#define glSwizzleEXT		MANGLE(SwizzleEXT)
+#define glTagSampleBufferSGIX		MANGLE(TagSampleBufferSGIX)
+#define glTangent3bEXT		MANGLE(Tangent3bEXT)
+#define glTangent3bvEXT		MANGLE(Tangent3bvEXT)
+#define glTangent3dEXT		MANGLE(Tangent3dEXT)
+#define glTangent3dvEXT		MANGLE(Tangent3dvEXT)
+#define glTangent3fEXT		MANGLE(Tangent3fEXT)
+#define glTangent3fvEXT		MANGLE(Tangent3fvEXT)
+#define glTangent3iEXT		MANGLE(Tangent3iEXT)
+#define glTangent3ivEXT		MANGLE(Tangent3ivEXT)
+#define glTangent3sEXT		MANGLE(Tangent3sEXT)
+#define glTangent3svEXT		MANGLE(Tangent3svEXT)
+#define glTangentPointerEXT		MANGLE(TangentPointerEXT)
+#define glTbufferMask3DFX		MANGLE(TbufferMask3DFX)
+#define glTestFenceAPPLE		MANGLE(TestFenceAPPLE)
+#define glTestFenceNV		MANGLE(TestFenceNV)
+#define glTestObjectAPPLE		MANGLE(TestObjectAPPLE)
+#define glTexBumpParameterfvATI		MANGLE(TexBumpParameterfvATI)
+#define glTexBumpParameterivATI		MANGLE(TexBumpParameterivATI)
+#define glTexCoord1d		MANGLE(TexCoord1d)
+#define glTexCoord1dv		MANGLE(TexCoord1dv)
+#define glTexCoord1f		MANGLE(TexCoord1f)
+#define glTexCoord1fv		MANGLE(TexCoord1fv)
+#define glTexCoord1hNV		MANGLE(TexCoord1hNV)
+#define glTexCoord1hvNV		MANGLE(TexCoord1hvNV)
+#define glTexCoord1i		MANGLE(TexCoord1i)
+#define glTexCoord1iv		MANGLE(TexCoord1iv)
+#define glTexCoord1s		MANGLE(TexCoord1s)
+#define glTexCoord1sv		MANGLE(TexCoord1sv)
+#define glTexCoord2d		MANGLE(TexCoord2d)
+#define glTexCoord2dv		MANGLE(TexCoord2dv)
+#define glTexCoord2fColor3fVertex3fSUN		MANGLE(TexCoord2fColor3fVertex3fSUN)
+#define glTexCoord2fColor3fVertex3fvSUN		MANGLE(TexCoord2fColor3fVertex3fvSUN)
+#define glTexCoord2fColor4fNormal3fVertex3fSUN		MANGLE(TexCoord2fColor4fNormal3fVertex3fSUN)
+#define glTexCoord2fColor4fNormal3fVertex3fvSUN		MANGLE(TexCoord2fColor4fNormal3fVertex3fvSUN)
+#define glTexCoord2fColor4ubVertex3fSUN		MANGLE(TexCoord2fColor4ubVertex3fSUN)
+#define glTexCoord2fColor4ubVertex3fvSUN		MANGLE(TexCoord2fColor4ubVertex3fvSUN)
+#define glTexCoord2f		MANGLE(TexCoord2f)
+#define glTexCoord2fNormal3fVertex3fSUN		MANGLE(TexCoord2fNormal3fVertex3fSUN)
+#define glTexCoord2fNormal3fVertex3fvSUN		MANGLE(TexCoord2fNormal3fVertex3fvSUN)
+#define glTexCoord2fVertex3fSUN		MANGLE(TexCoord2fVertex3fSUN)
+#define glTexCoord2fVertex3fvSUN		MANGLE(TexCoord2fVertex3fvSUN)
+#define glTexCoord2fv		MANGLE(TexCoord2fv)
+#define glTexCoord2hNV		MANGLE(TexCoord2hNV)
+#define glTexCoord2hvNV		MANGLE(TexCoord2hvNV)
+#define glTexCoord2i		MANGLE(TexCoord2i)
+#define glTexCoord2iv		MANGLE(TexCoord2iv)
+#define glTexCoord2s		MANGLE(TexCoord2s)
+#define glTexCoord2sv		MANGLE(TexCoord2sv)
+#define glTexCoord3d		MANGLE(TexCoord3d)
+#define glTexCoord3dv		MANGLE(TexCoord3dv)
+#define glTexCoord3f		MANGLE(TexCoord3f)
+#define glTexCoord3fv		MANGLE(TexCoord3fv)
+#define glTexCoord3hNV		MANGLE(TexCoord3hNV)
+#define glTexCoord3hvNV		MANGLE(TexCoord3hvNV)
+#define glTexCoord3i		MANGLE(TexCoord3i)
+#define glTexCoord3iv		MANGLE(TexCoord3iv)
+#define glTexCoord3s		MANGLE(TexCoord3s)
+#define glTexCoord3sv		MANGLE(TexCoord3sv)
+#define glTexCoord4d		MANGLE(TexCoord4d)
+#define glTexCoord4dv		MANGLE(TexCoord4dv)
+#define glTexCoord4fColor4fNormal3fVertex4fSUN		MANGLE(TexCoord4fColor4fNormal3fVertex4fSUN)
+#define glTexCoord4fColor4fNormal3fVertex4fvSUN		MANGLE(TexCoord4fColor4fNormal3fVertex4fvSUN)
+#define glTexCoord4f		MANGLE(TexCoord4f)
+#define glTexCoord4fVertex4fSUN		MANGLE(TexCoord4fVertex4fSUN)
+#define glTexCoord4fVertex4fvSUN		MANGLE(TexCoord4fVertex4fvSUN)
+#define glTexCoord4fv		MANGLE(TexCoord4fv)
+#define glTexCoord4hNV		MANGLE(TexCoord4hNV)
+#define glTexCoord4hvNV		MANGLE(TexCoord4hvNV)
+#define glTexCoord4i		MANGLE(TexCoord4i)
+#define glTexCoord4iv		MANGLE(TexCoord4iv)
+#define glTexCoord4s		MANGLE(TexCoord4s)
+#define glTexCoord4sv		MANGLE(TexCoord4sv)
+#define glTexCoordPointerEXT		MANGLE(TexCoordPointerEXT)
+#define glTexCoordPointerListIBM		MANGLE(TexCoordPointerListIBM)
+#define glTexCoordPointer		MANGLE(TexCoordPointer)
+#define glTexCoordPointervINTEL		MANGLE(TexCoordPointervINTEL)
+#define glTexEnvf		MANGLE(TexEnvf)
+#define glTexEnvfv		MANGLE(TexEnvfv)
+#define glTexEnvi		MANGLE(TexEnvi)
+#define glTexEnviv		MANGLE(TexEnviv)
+#define glTexFilterFuncSGIS		MANGLE(TexFilterFuncSGIS)
+#define glTexGend		MANGLE(TexGend)
+#define glTexGendv		MANGLE(TexGendv)
+#define glTexGenf		MANGLE(TexGenf)
+#define glTexGenfv		MANGLE(TexGenfv)
+#define glTexGeni		MANGLE(TexGeni)
+#define glTexGeniv		MANGLE(TexGeniv)
+#define glTexImage1D		MANGLE(TexImage1D)
+#define glTexImage2D		MANGLE(TexImage2D)
+#define glTexImage3DEXT		MANGLE(TexImage3DEXT)
+#define glTexImage3D		MANGLE(TexImage3D)
+#define glTexImage4DSGIS		MANGLE(TexImage4DSGIS)
+#define glTexParameterf		MANGLE(TexParameterf)
+#define glTexParameterfv		MANGLE(TexParameterfv)
+#define glTexParameteri		MANGLE(TexParameteri)
+#define glTexParameteriv		MANGLE(TexParameteriv)
+#define glTexSubImage1DEXT		MANGLE(TexSubImage1DEXT)
+#define glTexSubImage1D		MANGLE(TexSubImage1D)
+#define glTexSubImage2DEXT		MANGLE(TexSubImage2DEXT)
+#define glTexSubImage2D		MANGLE(TexSubImage2D)
+#define glTexSubImage3DEXT		MANGLE(TexSubImage3DEXT)
+#define glTexSubImage3D		MANGLE(TexSubImage3D)
+#define glTexSubImage4DSGIS		MANGLE(TexSubImage4DSGIS)
+#define glTextureColorMaskSGIS		MANGLE(TextureColorMaskSGIS)
+#define glTextureLightEXT		MANGLE(TextureLightEXT)
+#define glTextureMaterialEXT		MANGLE(TextureMaterialEXT)
+#define glTextureNormalEXT		MANGLE(TextureNormalEXT)
+#define glTraceAssertAttribMESA		MANGLE(TraceAssertAttribMESA)
+#define glTraceCommentMESA		MANGLE(TraceCommentMESA)
+#define glTraceListMESA		MANGLE(TraceListMESA)
+#define glTracePointerMESA		MANGLE(TracePointerMESA)
+#define glTracePointerRangeMESA		MANGLE(TracePointerRangeMESA)
+#define glTraceTextureMESA		MANGLE(TraceTextureMESA)
+#define glTrackMatrixNV		MANGLE(TrackMatrixNV)
+#define glTranslated		MANGLE(Translated)
+#define glTranslatef		MANGLE(Translatef)
+#define glUniform1fARB		MANGLE(Uniform1fARB)
+#define glUniform1f		MANGLE(Uniform1f)
+#define glUniform1fvARB		MANGLE(Uniform1fvARB)
+#define glUniform1fv		MANGLE(Uniform1fv)
+#define glUniform1iARB		MANGLE(Uniform1iARB)
+#define glUniform1i		MANGLE(Uniform1i)
+#define glUniform1ivARB		MANGLE(Uniform1ivARB)
+#define glUniform1iv		MANGLE(Uniform1iv)
+#define glUniform2fARB		MANGLE(Uniform2fARB)
+#define glUniform2f		MANGLE(Uniform2f)
+#define glUniform2fvARB		MANGLE(Uniform2fvARB)
+#define glUniform2fv		MANGLE(Uniform2fv)
+#define glUniform2iARB		MANGLE(Uniform2iARB)
+#define glUniform2i		MANGLE(Uniform2i)
+#define glUniform2ivARB		MANGLE(Uniform2ivARB)
+#define glUniform2iv		MANGLE(Uniform2iv)
+#define glUniform3fARB		MANGLE(Uniform3fARB)
+#define glUniform3f		MANGLE(Uniform3f)
+#define glUniform3fvARB		MANGLE(Uniform3fvARB)
+#define glUniform3fv		MANGLE(Uniform3fv)
+#define glUniform3iARB		MANGLE(Uniform3iARB)
+#define glUniform3i		MANGLE(Uniform3i)
+#define glUniform3ivARB		MANGLE(Uniform3ivARB)
+#define glUniform3iv		MANGLE(Uniform3iv)
+#define glUniform4fARB		MANGLE(Uniform4fARB)
+#define glUniform4f		MANGLE(Uniform4f)
+#define glUniform4fvARB		MANGLE(Uniform4fvARB)
+#define glUniform4fv		MANGLE(Uniform4fv)
+#define glUniform4iARB		MANGLE(Uniform4iARB)
+#define glUniform4i		MANGLE(Uniform4i)
+#define glUniform4ivARB		MANGLE(Uniform4ivARB)
+#define glUniform4iv		MANGLE(Uniform4iv)
+#define glUniformMatrix2fvARB		MANGLE(UniformMatrix2fvARB)
+#define glUniformMatrix2fv		MANGLE(UniformMatrix2fv)
+#define glUniformMatrix3fvARB		MANGLE(UniformMatrix3fvARB)
+#define glUniformMatrix3fv		MANGLE(UniformMatrix3fv)
+#define glUniformMatrix4fvARB		MANGLE(UniformMatrix4fvARB)
+#define glUniformMatrix4fv		MANGLE(UniformMatrix4fv)
+#define glUnlockArraysEXT		MANGLE(UnlockArraysEXT)
+#define glUnmapBufferARB		MANGLE(UnmapBufferARB)
+#define glUnmapBuffer		MANGLE(UnmapBuffer)
+#define glUnmapObjectBufferATI		MANGLE(UnmapObjectBufferATI)
+#define glUpdateObjectBufferATI		MANGLE(UpdateObjectBufferATI)
+#define glUseProgram		MANGLE(UseProgram)
+#define glUseProgramObjectARB		MANGLE(UseProgramObjectARB)
+#define glValidateProgramARB		MANGLE(ValidateProgramARB)
+#define glValidateProgram		MANGLE(ValidateProgram)
+#define glVariantArrayObjectATI		MANGLE(VariantArrayObjectATI)
+#define glVariantbvEXT		MANGLE(VariantbvEXT)
+#define glVariantdvEXT		MANGLE(VariantdvEXT)
+#define glVariantfvEXT		MANGLE(VariantfvEXT)
+#define glVariantivEXT		MANGLE(VariantivEXT)
+#define glVariantPointerEXT		MANGLE(VariantPointerEXT)
+#define glVariantsvEXT		MANGLE(VariantsvEXT)
+#define glVariantubvEXT		MANGLE(VariantubvEXT)
+#define glVariantuivEXT		MANGLE(VariantuivEXT)
+#define glVariantusvEXT		MANGLE(VariantusvEXT)
+#define glVertex2d		MANGLE(Vertex2d)
+#define glVertex2dv		MANGLE(Vertex2dv)
+#define glVertex2f		MANGLE(Vertex2f)
+#define glVertex2fv		MANGLE(Vertex2fv)
+#define glVertex2hNV		MANGLE(Vertex2hNV)
+#define glVertex2hvNV		MANGLE(Vertex2hvNV)
+#define glVertex2i		MANGLE(Vertex2i)
+#define glVertex2iv		MANGLE(Vertex2iv)
+#define glVertex2s		MANGLE(Vertex2s)
+#define glVertex2sv		MANGLE(Vertex2sv)
+#define glVertex3d		MANGLE(Vertex3d)
+#define glVertex3dv		MANGLE(Vertex3dv)
+#define glVertex3f		MANGLE(Vertex3f)
+#define glVertex3fv		MANGLE(Vertex3fv)
+#define glVertex3hNV		MANGLE(Vertex3hNV)
+#define glVertex3hvNV		MANGLE(Vertex3hvNV)
+#define glVertex3i		MANGLE(Vertex3i)
+#define glVertex3iv		MANGLE(Vertex3iv)
+#define glVertex3s		MANGLE(Vertex3s)
+#define glVertex3sv		MANGLE(Vertex3sv)
+#define glVertex4d		MANGLE(Vertex4d)
+#define glVertex4dv		MANGLE(Vertex4dv)
+#define glVertex4f		MANGLE(Vertex4f)
+#define glVertex4fv		MANGLE(Vertex4fv)
+#define glVertex4hNV		MANGLE(Vertex4hNV)
+#define glVertex4hvNV		MANGLE(Vertex4hvNV)
+#define glVertex4i		MANGLE(Vertex4i)
+#define glVertex4iv		MANGLE(Vertex4iv)
+#define glVertex4s		MANGLE(Vertex4s)
+#define glVertex4sv		MANGLE(Vertex4sv)
+#define glVertexArrayParameteriAPPLE		MANGLE(VertexArrayParameteriAPPLE)
+#define glVertexArrayRangeAPPLE		MANGLE(VertexArrayRangeAPPLE)
+#define glVertexArrayRangeNV		MANGLE(VertexArrayRangeNV)
+#define glVertexAttrib1dARB		MANGLE(VertexAttrib1dARB)
+#define glVertexAttrib1d		MANGLE(VertexAttrib1d)
+#define glVertexAttrib1dNV		MANGLE(VertexAttrib1dNV)
+#define glVertexAttrib1dvARB		MANGLE(VertexAttrib1dvARB)
+#define glVertexAttrib1dv		MANGLE(VertexAttrib1dv)
+#define glVertexAttrib1dvNV		MANGLE(VertexAttrib1dvNV)
+#define glVertexAttrib1fARB		MANGLE(VertexAttrib1fARB)
+#define glVertexAttrib1f		MANGLE(VertexAttrib1f)
+#define glVertexAttrib1fNV		MANGLE(VertexAttrib1fNV)
+#define glVertexAttrib1fvARB		MANGLE(VertexAttrib1fvARB)
+#define glVertexAttrib1fv		MANGLE(VertexAttrib1fv)
+#define glVertexAttrib1fvNV		MANGLE(VertexAttrib1fvNV)
+#define glVertexAttrib1hNV		MANGLE(VertexAttrib1hNV)
+#define glVertexAttrib1hvNV		MANGLE(VertexAttrib1hvNV)
+#define glVertexAttrib1sARB		MANGLE(VertexAttrib1sARB)
+#define glVertexAttrib1s		MANGLE(VertexAttrib1s)
+#define glVertexAttrib1sNV		MANGLE(VertexAttrib1sNV)
+#define glVertexAttrib1svARB		MANGLE(VertexAttrib1svARB)
+#define glVertexAttrib1sv		MANGLE(VertexAttrib1sv)
+#define glVertexAttrib1svNV		MANGLE(VertexAttrib1svNV)
+#define glVertexAttrib2dARB		MANGLE(VertexAttrib2dARB)
+#define glVertexAttrib2d		MANGLE(VertexAttrib2d)
+#define glVertexAttrib2dNV		MANGLE(VertexAttrib2dNV)
+#define glVertexAttrib2dvARB		MANGLE(VertexAttrib2dvARB)
+#define glVertexAttrib2dv		MANGLE(VertexAttrib2dv)
+#define glVertexAttrib2dvNV		MANGLE(VertexAttrib2dvNV)
+#define glVertexAttrib2fARB		MANGLE(VertexAttrib2fARB)
+#define glVertexAttrib2f		MANGLE(VertexAttrib2f)
+#define glVertexAttrib2fNV		MANGLE(VertexAttrib2fNV)
+#define glVertexAttrib2fvARB		MANGLE(VertexAttrib2fvARB)
+#define glVertexAttrib2fv		MANGLE(VertexAttrib2fv)
+#define glVertexAttrib2fvNV		MANGLE(VertexAttrib2fvNV)
+#define glVertexAttrib2hNV		MANGLE(VertexAttrib2hNV)
+#define glVertexAttrib2hvNV		MANGLE(VertexAttrib2hvNV)
+#define glVertexAttrib2sARB		MANGLE(VertexAttrib2sARB)
+#define glVertexAttrib2s		MANGLE(VertexAttrib2s)
+#define glVertexAttrib2sNV		MANGLE(VertexAttrib2sNV)
+#define glVertexAttrib2svARB		MANGLE(VertexAttrib2svARB)
+#define glVertexAttrib2sv		MANGLE(VertexAttrib2sv)
+#define glVertexAttrib2svNV		MANGLE(VertexAttrib2svNV)
+#define glVertexAttrib3dARB		MANGLE(VertexAttrib3dARB)
+#define glVertexAttrib3d		MANGLE(VertexAttrib3d)
+#define glVertexAttrib3dNV		MANGLE(VertexAttrib3dNV)
+#define glVertexAttrib3dvARB		MANGLE(VertexAttrib3dvARB)
+#define glVertexAttrib3dv		MANGLE(VertexAttrib3dv)
+#define glVertexAttrib3dvNV		MANGLE(VertexAttrib3dvNV)
+#define glVertexAttrib3fARB		MANGLE(VertexAttrib3fARB)
+#define glVertexAttrib3f		MANGLE(VertexAttrib3f)
+#define glVertexAttrib3fNV		MANGLE(VertexAttrib3fNV)
+#define glVertexAttrib3fvARB		MANGLE(VertexAttrib3fvARB)
+#define glVertexAttrib3fv		MANGLE(VertexAttrib3fv)
+#define glVertexAttrib3fvNV		MANGLE(VertexAttrib3fvNV)
+#define glVertexAttrib3hNV		MANGLE(VertexAttrib3hNV)
+#define glVertexAttrib3hvNV		MANGLE(VertexAttrib3hvNV)
+#define glVertexAttrib3sARB		MANGLE(VertexAttrib3sARB)
+#define glVertexAttrib3s		MANGLE(VertexAttrib3s)
+#define glVertexAttrib3sNV		MANGLE(VertexAttrib3sNV)
+#define glVertexAttrib3svARB		MANGLE(VertexAttrib3svARB)
+#define glVertexAttrib3sv		MANGLE(VertexAttrib3sv)
+#define glVertexAttrib3svNV		MANGLE(VertexAttrib3svNV)
+#define glVertexAttrib4bvARB		MANGLE(VertexAttrib4bvARB)
+#define glVertexAttrib4bv		MANGLE(VertexAttrib4bv)
+#define glVertexAttrib4dARB		MANGLE(VertexAttrib4dARB)
+#define glVertexAttrib4d		MANGLE(VertexAttrib4d)
+#define glVertexAttrib4dNV		MANGLE(VertexAttrib4dNV)
+#define glVertexAttrib4dvARB		MANGLE(VertexAttrib4dvARB)
+#define glVertexAttrib4dv		MANGLE(VertexAttrib4dv)
+#define glVertexAttrib4dvNV		MANGLE(VertexAttrib4dvNV)
+#define glVertexAttrib4fARB		MANGLE(VertexAttrib4fARB)
+#define glVertexAttrib4f		MANGLE(VertexAttrib4f)
+#define glVertexAttrib4fNV		MANGLE(VertexAttrib4fNV)
+#define glVertexAttrib4fvARB		MANGLE(VertexAttrib4fvARB)
+#define glVertexAttrib4fv		MANGLE(VertexAttrib4fv)
+#define glVertexAttrib4fvNV		MANGLE(VertexAttrib4fvNV)
+#define glVertexAttrib4hNV		MANGLE(VertexAttrib4hNV)
+#define glVertexAttrib4hvNV		MANGLE(VertexAttrib4hvNV)
+#define glVertexAttrib4ivARB		MANGLE(VertexAttrib4ivARB)
+#define glVertexAttrib4iv		MANGLE(VertexAttrib4iv)
+#define glVertexAttrib4NbvARB		MANGLE(VertexAttrib4NbvARB)
+#define glVertexAttrib4Nbv		MANGLE(VertexAttrib4Nbv)
+#define glVertexAttrib4NivARB		MANGLE(VertexAttrib4NivARB)
+#define glVertexAttrib4Niv		MANGLE(VertexAttrib4Niv)
+#define glVertexAttrib4NsvARB		MANGLE(VertexAttrib4NsvARB)
+#define glVertexAttrib4Nsv		MANGLE(VertexAttrib4Nsv)
+#define glVertexAttrib4NubARB		MANGLE(VertexAttrib4NubARB)
+#define glVertexAttrib4Nub		MANGLE(VertexAttrib4Nub)
+#define glVertexAttrib4NubvARB		MANGLE(VertexAttrib4NubvARB)
+#define glVertexAttrib4Nubv		MANGLE(VertexAttrib4Nubv)
+#define glVertexAttrib4NuivARB		MANGLE(VertexAttrib4NuivARB)
+#define glVertexAttrib4Nuiv		MANGLE(VertexAttrib4Nuiv)
+#define glVertexAttrib4NusvARB		MANGLE(VertexAttrib4NusvARB)
+#define glVertexAttrib4Nusv		MANGLE(VertexAttrib4Nusv)
+#define glVertexAttrib4sARB		MANGLE(VertexAttrib4sARB)
+#define glVertexAttrib4s		MANGLE(VertexAttrib4s)
+#define glVertexAttrib4sNV		MANGLE(VertexAttrib4sNV)
+#define glVertexAttrib4svARB		MANGLE(VertexAttrib4svARB)
+#define glVertexAttrib4sv		MANGLE(VertexAttrib4sv)
+#define glVertexAttrib4svNV		MANGLE(VertexAttrib4svNV)
+#define glVertexAttrib4ubNV		MANGLE(VertexAttrib4ubNV)
+#define glVertexAttrib4ubvARB		MANGLE(VertexAttrib4ubvARB)
+#define glVertexAttrib4ubv		MANGLE(VertexAttrib4ubv)
+#define glVertexAttrib4ubvNV		MANGLE(VertexAttrib4ubvNV)
+#define glVertexAttrib4uivARB		MANGLE(VertexAttrib4uivARB)
+#define glVertexAttrib4uiv		MANGLE(VertexAttrib4uiv)
+#define glVertexAttrib4usvARB		MANGLE(VertexAttrib4usvARB)
+#define glVertexAttrib4usv		MANGLE(VertexAttrib4usv)
+#define glVertexAttribArrayObjectATI		MANGLE(VertexAttribArrayObjectATI)
+#define glVertexAttribPointerARB		MANGLE(VertexAttribPointerARB)
+#define glVertexAttribPointer		MANGLE(VertexAttribPointer)
+#define glVertexAttribPointerNV		MANGLE(VertexAttribPointerNV)
+#define glVertexAttribs1dvNV		MANGLE(VertexAttribs1dvNV)
+#define glVertexAttribs1fvNV		MANGLE(VertexAttribs1fvNV)
+#define glVertexAttribs1hvNV		MANGLE(VertexAttribs1hvNV)
+#define glVertexAttribs1svNV		MANGLE(VertexAttribs1svNV)
+#define glVertexAttribs2dvNV		MANGLE(VertexAttribs2dvNV)
+#define glVertexAttribs2fvNV		MANGLE(VertexAttribs2fvNV)
+#define glVertexAttribs2hvNV		MANGLE(VertexAttribs2hvNV)
+#define glVertexAttribs2svNV		MANGLE(VertexAttribs2svNV)
+#define glVertexAttribs3dvNV		MANGLE(VertexAttribs3dvNV)
+#define glVertexAttribs3fvNV		MANGLE(VertexAttribs3fvNV)
+#define glVertexAttribs3hvNV		MANGLE(VertexAttribs3hvNV)
+#define glVertexAttribs3svNV		MANGLE(VertexAttribs3svNV)
+#define glVertexAttribs4dvNV		MANGLE(VertexAttribs4dvNV)
+#define glVertexAttribs4fvNV		MANGLE(VertexAttribs4fvNV)
+#define glVertexAttribs4hvNV		MANGLE(VertexAttribs4hvNV)
+#define glVertexAttribs4svNV		MANGLE(VertexAttribs4svNV)
+#define glVertexAttribs4ubvNV		MANGLE(VertexAttribs4ubvNV)
+#define glVertexBlendARB		MANGLE(VertexBlendARB)
+#define glVertexBlendEnvfATI		MANGLE(VertexBlendEnvfATI)
+#define glVertexBlendEnviATI		MANGLE(VertexBlendEnviATI)
+#define glVertexPointerEXT		MANGLE(VertexPointerEXT)
+#define glVertexPointerListIBM		MANGLE(VertexPointerListIBM)
+#define glVertexPointer		MANGLE(VertexPointer)
+#define glVertexPointervINTEL		MANGLE(VertexPointervINTEL)
+#define glVertexStream1dATI		MANGLE(VertexStream1dATI)
+#define glVertexStream1dvATI		MANGLE(VertexStream1dvATI)
+#define glVertexStream1fATI		MANGLE(VertexStream1fATI)
+#define glVertexStream1fvATI		MANGLE(VertexStream1fvATI)
+#define glVertexStream1iATI		MANGLE(VertexStream1iATI)
+#define glVertexStream1ivATI		MANGLE(VertexStream1ivATI)
+#define glVertexStream1sATI		MANGLE(VertexStream1sATI)
+#define glVertexStream1svATI		MANGLE(VertexStream1svATI)
+#define glVertexStream2dATI		MANGLE(VertexStream2dATI)
+#define glVertexStream2dvATI		MANGLE(VertexStream2dvATI)
+#define glVertexStream2fATI		MANGLE(VertexStream2fATI)
+#define glVertexStream2fvATI		MANGLE(VertexStream2fvATI)
+#define glVertexStream2iATI		MANGLE(VertexStream2iATI)
+#define glVertexStream2ivATI		MANGLE(VertexStream2ivATI)
+#define glVertexStream2sATI		MANGLE(VertexStream2sATI)
+#define glVertexStream2svATI		MANGLE(VertexStream2svATI)
+#define glVertexStream3dATI		MANGLE(VertexStream3dATI)
+#define glVertexStream3dvATI		MANGLE(VertexStream3dvATI)
+#define glVertexStream3fATI		MANGLE(VertexStream3fATI)
+#define glVertexStream3fvATI		MANGLE(VertexStream3fvATI)
+#define glVertexStream3iATI		MANGLE(VertexStream3iATI)
+#define glVertexStream3ivATI		MANGLE(VertexStream3ivATI)
+#define glVertexStream3sATI		MANGLE(VertexStream3sATI)
+#define glVertexStream3svATI		MANGLE(VertexStream3svATI)
+#define glVertexStream4dATI		MANGLE(VertexStream4dATI)
+#define glVertexStream4dvATI		MANGLE(VertexStream4dvATI)
+#define glVertexStream4fATI		MANGLE(VertexStream4fATI)
+#define glVertexStream4fvATI		MANGLE(VertexStream4fvATI)
+#define glVertexStream4iATI		MANGLE(VertexStream4iATI)
+#define glVertexStream4ivATI		MANGLE(VertexStream4ivATI)
+#define glVertexStream4sATI		MANGLE(VertexStream4sATI)
+#define glVertexStream4svATI		MANGLE(VertexStream4svATI)
+#define glVertexWeightfEXT		MANGLE(VertexWeightfEXT)
+#define glVertexWeightfvEXT		MANGLE(VertexWeightfvEXT)
+#define glVertexWeighthNV		MANGLE(VertexWeighthNV)
+#define glVertexWeighthvNV		MANGLE(VertexWeighthvNV)
+#define glVertexWeightPointerEXT		MANGLE(VertexWeightPointerEXT)
+#define glViewport		MANGLE(Viewport)
+#define glWeightbvARB		MANGLE(WeightbvARB)
+#define glWeightdvARB		MANGLE(WeightdvARB)
+#define glWeightfvARB		MANGLE(WeightfvARB)
+#define glWeightivARB		MANGLE(WeightivARB)
+#define glWeightPointerARB		MANGLE(WeightPointerARB)
+#define glWeightsvARB		MANGLE(WeightsvARB)
+#define glWeightubvARB		MANGLE(WeightubvARB)
+#define glWeightuivARB		MANGLE(WeightuivARB)
+#define glWeightusvARB		MANGLE(WeightusvARB)
+#define glWindowPos2dARB		MANGLE(WindowPos2dARB)
+#define glWindowPos2d		MANGLE(WindowPos2d)
+#define glWindowPos2dMESA		MANGLE(WindowPos2dMESA)
+#define glWindowPos2dvARB		MANGLE(WindowPos2dvARB)
+#define glWindowPos2dv		MANGLE(WindowPos2dv)
+#define glWindowPos2dvMESA		MANGLE(WindowPos2dvMESA)
+#define glWindowPos2fARB		MANGLE(WindowPos2fARB)
+#define glWindowPos2f		MANGLE(WindowPos2f)
+#define glWindowPos2fMESA		MANGLE(WindowPos2fMESA)
+#define glWindowPos2fvARB		MANGLE(WindowPos2fvARB)
+#define glWindowPos2fv		MANGLE(WindowPos2fv)
+#define glWindowPos2fvMESA		MANGLE(WindowPos2fvMESA)
+#define glWindowPos2iARB		MANGLE(WindowPos2iARB)
+#define glWindowPos2i		MANGLE(WindowPos2i)
+#define glWindowPos2iMESA		MANGLE(WindowPos2iMESA)
+#define glWindowPos2ivARB		MANGLE(WindowPos2ivARB)
+#define glWindowPos2iv		MANGLE(WindowPos2iv)
+#define glWindowPos2ivMESA		MANGLE(WindowPos2ivMESA)
+#define glWindowPos2sARB		MANGLE(WindowPos2sARB)
+#define glWindowPos2s		MANGLE(WindowPos2s)
+#define glWindowPos2sMESA		MANGLE(WindowPos2sMESA)
+#define glWindowPos2svARB		MANGLE(WindowPos2svARB)
+#define glWindowPos2sv		MANGLE(WindowPos2sv)
+#define glWindowPos2svMESA		MANGLE(WindowPos2svMESA)
+#define glWindowPos3dARB		MANGLE(WindowPos3dARB)
+#define glWindowPos3d		MANGLE(WindowPos3d)
+#define glWindowPos3dMESA		MANGLE(WindowPos3dMESA)
+#define glWindowPos3dvARB		MANGLE(WindowPos3dvARB)
+#define glWindowPos3dv		MANGLE(WindowPos3dv)
+#define glWindowPos3dvMESA		MANGLE(WindowPos3dvMESA)
+#define glWindowPos3fARB		MANGLE(WindowPos3fARB)
+#define glWindowPos3f		MANGLE(WindowPos3f)
+#define glWindowPos3fMESA		MANGLE(WindowPos3fMESA)
+#define glWindowPos3fvARB		MANGLE(WindowPos3fvARB)
+#define glWindowPos3fv		MANGLE(WindowPos3fv)
+#define glWindowPos3fvMESA		MANGLE(WindowPos3fvMESA)
+#define glWindowPos3iARB		MANGLE(WindowPos3iARB)
+#define glWindowPos3i		MANGLE(WindowPos3i)
+#define glWindowPos3iMESA		MANGLE(WindowPos3iMESA)
+#define glWindowPos3ivARB		MANGLE(WindowPos3ivARB)
+#define glWindowPos3iv		MANGLE(WindowPos3iv)
+#define glWindowPos3ivMESA		MANGLE(WindowPos3ivMESA)
+#define glWindowPos3sARB		MANGLE(WindowPos3sARB)
+#define glWindowPos3s		MANGLE(WindowPos3s)
+#define glWindowPos3sMESA		MANGLE(WindowPos3sMESA)
+#define glWindowPos3svARB		MANGLE(WindowPos3svARB)
+#define glWindowPos3sv		MANGLE(WindowPos3sv)
+#define glWindowPos3svMESA		MANGLE(WindowPos3svMESA)
+#define glWindowPos4dMESA		MANGLE(WindowPos4dMESA)
+#define glWindowPos4dvMESA		MANGLE(WindowPos4dvMESA)
+#define glWindowPos4fMESA		MANGLE(WindowPos4fMESA)
+#define glWindowPos4fvMESA		MANGLE(WindowPos4fvMESA)
+#define glWindowPos4iMESA		MANGLE(WindowPos4iMESA)
+#define glWindowPos4ivMESA		MANGLE(WindowPos4ivMESA)
+#define glWindowPos4sMESA		MANGLE(WindowPos4sMESA)
+#define glWindowPos4svMESA		MANGLE(WindowPos4svMESA)
+#define glWriteMaskEXT		MANGLE(WriteMaskEXT)
+
+#endif /* GL_MANGLE_H */
diff --git a/src/terralib/drivers/GL/glcore.h b/src/terralib/drivers/GL/glcore.h
new file mode 100644
index 0000000..6967d7a
--- /dev/null
+++ b/src/terralib/drivers/GL/glcore.h
@@ -0,0 +1,499 @@
+/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.7 2001/03/25 05:32:00 tsi Exp $ */
+#ifndef __gl_core_h_
+#define __gl_core_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+** 
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#ifndef XFree86LOADER
+#include <sys/types.h>
+#endif
+
+#ifdef CAPI
+#undef CAPI
+#endif
+#define CAPI
+
+#define GL_CORE_SGI  1
+#define GL_CORE_MESA 2
+#define GL_CORE_APPLE 4
+#define GL_CORE_WINDOWS 8
+
+typedef struct __GLcontextRec __GLcontext;
+typedef struct __GLinterfaceRec __GLinterface;
+
+/*
+** This file defines the interface between the GL core and the surrounding
+** "operating system" that supports it (currently the GLX or WGL extensions).
+**
+** Members (data and function pointers) are documented as imported or
+** exported according to how they are used by the core rendering functions.
+** Imported members are initialized by the "operating system" and used by
+** the core functions.  Exported members are initialized by the core functions
+** and used by the "operating system".
+*/
+
+/*
+** Mode and limit information for a context.  This information is
+** kept around in the context so that values can be used during
+** command execution, and for returning information about the
+** context to the application.
+*/
+typedef struct __GLcontextModesRec {
+    struct __GLcontextModesRec * next;
+
+    GLboolean rgbMode;
+    GLboolean floatMode;
+    GLboolean colorIndexMode;
+    GLuint doubleBufferMode;
+    GLuint stereoMode;
+
+    GLboolean haveAccumBuffer;
+    GLboolean haveDepthBuffer;
+    GLboolean haveStencilBuffer;
+
+    GLint redBits, greenBits, blueBits, alphaBits;	/* bits per comp */
+    GLuint redMask, greenMask, blueMask, alphaMask;
+    GLint rgbBits;		/* total bits for rgb */
+    GLint indexBits;		/* total bits for colorindex */
+
+    GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
+    GLint depthBits;
+    GLint stencilBits;
+
+    GLint numAuxBuffers;
+
+    GLint level;
+
+    GLint pixmapMode;
+
+    /* GLX */
+    GLint visualID;
+    GLint visualType;     /**< One of the GLX X visual types. (i.e., 
+			   * \c GLX_TRUE_COLOR, etc.)
+			   */
+
+    /* EXT_visual_rating / GLX 1.2 */
+    GLint visualRating;
+
+    /* EXT_visual_info / GLX 1.2 */
+    GLint transparentPixel;
+				/*    colors are floats scaled to ints */
+    GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
+    GLint transparentIndex;
+
+    /* ARB_multisample / SGIS_multisample */
+    GLint sampleBuffers;
+    GLint samples;
+
+    /* SGIX_fbconfig / GLX 1.3 */
+    GLint drawableType;
+    GLint renderType;
+    GLint xRenderable;
+    GLint fbconfigID;
+
+    /* SGIX_pbuffer / GLX 1.3 */
+    GLint maxPbufferWidth;
+    GLint maxPbufferHeight;
+    GLint maxPbufferPixels;
+    GLint optimalPbufferWidth;   /* Only for SGIX_pbuffer. */
+    GLint optimalPbufferHeight;  /* Only for SGIX_pbuffer. */
+
+    /* SGIX_visual_select_group */
+    GLint visualSelectGroup;
+
+    /* OML_swap_method */
+    GLint swapMethod;
+
+    GLint screen;
+} __GLcontextModes;
+
+/* Several fields of __GLcontextModes can take these as values.  Since
+ * GLX header files may not be available everywhere they need to be used,
+ * redefine them here.
+ */
+#define GLX_NONE                           0x8000
+#define GLX_SLOW_CONFIG                    0x8001
+#define GLX_TRUE_COLOR                     0x8002
+#define GLX_DIRECT_COLOR                   0x8003
+#define GLX_PSEUDO_COLOR                   0x8004
+#define GLX_STATIC_COLOR                   0x8005
+#define GLX_GRAY_SCALE                     0x8006
+#define GLX_STATIC_GRAY                    0x8007
+#define GLX_TRANSPARENT_RGB                0x8008
+#define GLX_TRANSPARENT_INDEX              0x8009
+#define GLX_NON_CONFORMANT_CONFIG          0x800D
+#define GLX_SWAP_EXCHANGE_OML              0x8061
+#define GLX_SWAP_COPY_OML                  0x8062
+#define GLX_SWAP_UNDEFINED_OML             0x8063
+
+#define GLX_DONT_CARE                      0xFFFFFFFF
+
+#define GLX_RGBA_BIT                       0x00000001
+#define GLX_COLOR_INDEX_BIT                0x00000002
+#define GLX_WINDOW_BIT                     0x00000001
+#define GLX_PIXMAP_BIT                     0x00000002
+#define GLX_PBUFFER_BIT                    0x00000004
+
+/************************************************************************/
+
+/*
+** Structure used for allocating and freeing drawable private memory.
+** (like software buffers, for example).
+**
+** The memory allocation routines are provided by the surrounding
+** "operating system" code, and they are to be used for allocating
+** software buffers and things which are associated with the drawable,
+** and used by any context which draws to that drawable.  There are
+** separate memory allocation functions for drawables and contexts
+** since drawables and contexts can be created and destroyed independently
+** of one another, and the "operating system" may want to use separate
+** allocation arenas for each.
+**
+** The freePrivate function is filled in by the core routines when they
+** allocates software buffers, and stick them in "private".  The freePrivate
+** function will destroy anything allocated to this drawable (to be called
+** when the drawable is destroyed).
+*/
+typedef struct __GLdrawableRegionRec __GLdrawableRegion;
+typedef struct __GLdrawableBufferRec __GLdrawableBuffer;
+typedef struct __GLdrawablePrivateRec __GLdrawablePrivate;
+
+typedef struct __GLregionRectRec {
+    /* lower left (inside the rectangle) */
+    GLint x0, y0;
+    /* upper right (outside the rectangle) */
+    GLint x1, y1;
+} __GLregionRect;
+
+struct __GLdrawableRegionRec {
+    GLint numRects;
+    __GLregionRect *rects;
+    __GLregionRect boundingRect;
+};
+
+/************************************************************************/
+
+/* masks for the buffers */
+#define __GL_FRONT_BUFFER_MASK		0x00000001
+#define	__GL_FRONT_LEFT_BUFFER_MASK	0x00000001
+#define	__GL_FRONT_RIGHT_BUFFER_MASK	0x00000002
+#define	__GL_BACK_BUFFER_MASK		0x00000004
+#define __GL_BACK_LEFT_BUFFER_MASK	0x00000004
+#define __GL_BACK_RIGHT_BUFFER_MASK	0x00000008
+#define	__GL_ACCUM_BUFFER_MASK		0x00000010
+#define	__GL_DEPTH_BUFFER_MASK		0x00000020
+#define	__GL_STENCIL_BUFFER_MASK	0x00000040
+#define	__GL_AUX_BUFFER_MASK(i)		(0x0000080 << (i))
+
+#define __GL_ALL_BUFFER_MASK		0xffffffff
+
+/* what Resize routines return if resize resorted to fallback case */
+#define __GL_BUFFER_FALLBACK	0x10
+
+typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf, 
+				      __GLdrawablePrivate *glPriv, GLint bits);
+typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf, 
+				  __GLdrawablePrivate *glPriv, GLint bits,
+				  __GLbufFallbackInitFn back);
+
+/*
+** A drawable buffer
+**
+** This data structure describes the context side of a drawable.  
+**
+** According to the spec there could be multiple contexts bound to the same
+** drawable at the same time (from different threads).  In order to avoid
+** multiple-access conflicts, locks are used to serialize access.  When a
+** thread needs to access (read or write) a member of the drawable, it takes
+** a lock first.  Some of the entries in the drawable are treated "mostly
+** constant", so we take the freedom of allowing access to them without
+** taking a lock (for optimization reasons).
+**
+** For more details regarding locking, see buffers.h in the GL core
+*/
+struct __GLdrawableBufferRec {
+    /*
+    ** Buffer dimensions
+    */
+    GLint width, height, depth;
+
+    /*
+    ** Framebuffer base address
+    */
+    void *base;
+
+    /*
+    ** Framebuffer size (in bytes)
+    */
+    GLuint size;
+
+    /*
+    ** Size (in bytes) of each element in the framebuffer
+    */
+    GLuint elementSize;
+    GLuint elementSizeLog2;
+
+    /*
+    ** Element skip from one scanline to the next.
+    ** If the buffer is part of another buffer (for example, fullscreen
+    ** front buffer), outerWidth is the width of that buffer.
+    */
+    GLint outerWidth;
+
+    /*
+    ** outerWidth * elementSize
+    */
+    GLint byteWidth;
+
+    /*
+    ** Allocation/deallocation is done based on this handle.  A handle
+    ** is conceptually different from the framebuffer 'base'.
+    */
+    void *handle;
+
+    /* imported */
+    GLboolean (*resize)(__GLdrawableBuffer *buf,
+			GLint x, GLint y, GLuint width, GLuint height, 
+			__GLdrawablePrivate *glPriv, GLuint bufferMask);
+    void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
+    void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
+    void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
+    		GLuint val, GLint x, GLint y, GLint w, GLint h);
+    void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
+
+    /* exported */
+    void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
+#ifdef __cplusplus
+    void *privatePtr;
+#else
+    void *private;
+#endif
+
+    /* private */
+    void *other;	/* implementation private data */
+    __GLbufMainInitFn mainInit;
+    __GLbufFallbackInitFn fallbackInit;
+};
+
+/*
+** The context side of the drawable private
+*/
+struct __GLdrawablePrivateRec {
+    /*
+    ** Drawable Modes
+    */
+    __GLcontextModes *modes;
+
+    /*
+    ** Drawable size
+    */
+    GLuint width, height;
+
+    /*
+    ** Origin in screen coordinates of the drawable
+    */
+    GLint xOrigin, yOrigin;
+#ifdef __GL_ALIGNED_BUFFERS
+    /*
+    ** Drawable offset from screen origin
+    */
+    GLint xOffset, yOffset;
+
+    /*
+    ** Alignment restriction
+    */
+    GLint xAlignment, yAlignment;
+#endif
+    /*
+    ** Should we invert the y axis?
+    */
+    GLint yInverted;
+
+    /*
+    ** Mask specifying which buffers are renderable by the hw
+    */
+    GLuint accelBufferMask;
+
+    /*
+    ** the buffers themselves
+    */
+    __GLdrawableBuffer frontBuffer;
+    __GLdrawableBuffer backBuffer;
+    __GLdrawableBuffer accumBuffer;
+    __GLdrawableBuffer depthBuffer;
+    __GLdrawableBuffer stencilBuffer;
+#if defined(__GL_NUMBER_OF_AUX_BUFFERS) && (__GL_NUMBER_OF_AUX_BUFFERS > 0)
+    __GLdrawableBuffer *auxBuffer;
+#endif
+
+    __GLdrawableRegion ownershipRegion;
+
+    /*
+    ** Lock for the drawable private structure
+    */
+    void *lock;
+#ifdef DEBUG
+    /* lock debugging info */
+    int lockRefCount;
+    int lockLine[10];
+    char *lockFile[10];
+#endif
+
+    /* imported */
+    void *(*malloc)(size_t size);
+    void *(*calloc)(size_t numElem, size_t elemSize);
+    void *(*realloc)(void *oldAddr, size_t newSize);
+    void (*free)(void *addr);
+
+    GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv, 
+			     GLint x, GLint y, GLsizei width, GLsizei height);
+    void (*setClipRect)(__GLdrawablePrivate *glPriv, 
+			GLint x, GLint y, GLsizei width, GLsizei height);
+    void (*updateClipRegion)(__GLdrawablePrivate *glPriv);
+    GLboolean (*resize)(__GLdrawablePrivate *glPriv);
+    void (*getDrawableSize)(__GLdrawablePrivate *glPriv, 
+			    GLint *x, GLint *y, GLuint *width, GLuint *height);
+
+    void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc);
+    void (*unlockDP)(__GLdrawablePrivate *glPriv);
+
+    /* exported */
+#ifdef __cplusplus
+    void *privatePtr;
+#else
+    void *private;
+#endif
+    void (*freePrivate)(__GLdrawablePrivate *);
+
+    /* client data */
+    void *other;
+};
+
+/*
+** Macros to lock/unlock the drawable private
+*/
+#if defined(DEBUG)
+#define __GL_LOCK_DP(glPriv,gc) \
+    (*(glPriv)->lockDP)(glPriv,gc); \
+    (glPriv)->lockLine[(glPriv)->lockRefCount] = __LINE__; \
+    (glPriv)->lockFile[(glPriv)->lockRefCount] = __FILE__; \
+    (glPriv)->lockRefCount++
+#define __GL_UNLOCK_DP(glPriv) \
+    (glPriv)->lockRefCount--; \
+    (glPriv)->lockLine[(glPriv)->lockRefCount] = 0; \
+    (glPriv)->lockFile[(glPriv)->lockRefCount] = NULL; \
+    (*(glPriv)->unlockDP)(glPriv)
+#else /* DEBUG */
+#define __GL_LOCK_DP(glPriv,gc)		(*(glPriv)->lockDP)(glPriv,gc)
+#define	__GL_UNLOCK_DP(glPriv)		(*(glPriv)->unlockDP)(glPriv)
+#endif /* DEBUG */
+
+
+/*
+** Procedures which are imported by the GL from the surrounding
+** "operating system".  Math functions are not considered part of the
+** "operating system".
+*/
+typedef struct __GLimportsRec {
+    /* Memory management */
+    void * (*malloc)(__GLcontext *gc, size_t size);
+    void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize);
+    void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize);
+    void (*free)(__GLcontext *gc, void *addr);
+
+    /* Error handling */
+    void (*warning)(__GLcontext *gc, char *fmt);
+    void (*fatal)(__GLcontext *gc, char *fmt);
+
+    /* other system calls */
+    char *(CAPI *getenv)(__GLcontext *gc, const char *var);
+    int (CAPI *atoi)(__GLcontext *gc, const char *str);
+    int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...);
+    void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode);
+    int (CAPI *fclose)(__GLcontext *gc, void *stream);
+    int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...);
+
+    /* Drawing surface management */
+    __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc);
+    __GLdrawablePrivate *(*getReadablePrivate)(__GLcontext *gc);
+
+    /* Operating system dependent data goes here */
+    void *other;
+} __GLimports;
+
+/************************************************************************/
+
+/*
+** Procedures which are exported by the GL to the surrounding "operating
+** system" so that it can manage multiple GL context's.
+*/
+typedef struct __GLexportsRec {
+    /* Context management (return GL_FALSE on failure) */
+    GLboolean (*destroyContext)(__GLcontext *gc);
+    GLboolean (*loseCurrent)(__GLcontext *gc);
+    /* oldglPriv isn't used anymore, kept for backwards compatibility */
+    GLboolean (*makeCurrent)(__GLcontext *gc);
+    GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare);
+    GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask);
+    GLboolean (*forceCurrent)(__GLcontext *gc);
+
+    /* Drawing surface notification callbacks */
+    GLboolean (*notifyResize)(__GLcontext *gc);
+    void (*notifyDestroy)(__GLcontext *gc);
+    void (*notifySwapBuffers)(__GLcontext *gc);
+
+    /* Dispatch table override control for external agents like libGLS */
+    struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc);
+    void (*beginDispatchOverride)(__GLcontext *gc);
+    void (*endDispatchOverride)(__GLcontext *gc);
+} __GLexports;
+
+/************************************************************************/
+
+/*
+** This must be the first member of a __GLcontext structure.  This is the
+** only part of a context that is exposed to the outside world; everything
+** else is opaque.
+*/
+struct __GLinterfaceRec {
+    __GLimports imports;
+    __GLexports exports;
+};
+
+extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *);
+extern void __glCoreNopDispatch(void);
+
+#endif /* __gl_core_h_ */
diff --git a/src/terralib/drivers/GL/glext.h b/src/terralib/drivers/GL/glext.h
new file mode 100644
index 0000000..0321028
--- /dev/null
+++ b/src/terralib/drivers/GL/glext.h
@@ -0,0 +1,6495 @@
+#ifndef __glext_h_
+#define __glext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+** 
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glext.h last updated 2005/06/20 */
+/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
+#define GL_GLEXT_VERSION 29
+
+#ifndef GL_VERSION_1_2
+#define GL_UNSIGNED_BYTE_3_3_2            0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_INT_8_8_8_8           0x8035
+#define GL_UNSIGNED_INT_10_10_10_2        0x8036
+#define GL_RESCALE_NORMAL                 0x803A
+#define GL_TEXTURE_BINDING_3D             0x806A
+#define GL_PACK_SKIP_IMAGES               0x806B
+#define GL_PACK_IMAGE_HEIGHT              0x806C
+#define GL_UNPACK_SKIP_IMAGES             0x806D
+#define GL_UNPACK_IMAGE_HEIGHT            0x806E
+#define GL_TEXTURE_3D                     0x806F
+#define GL_PROXY_TEXTURE_3D               0x8070
+#define GL_TEXTURE_DEPTH                  0x8071
+#define GL_TEXTURE_WRAP_R                 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE            0x8073
+#define GL_UNSIGNED_BYTE_2_3_3_REV        0x8362
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV       0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV     0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV     0x8366
+#define GL_UNSIGNED_INT_8_8_8_8_REV       0x8367
+#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
+#define GL_BGR                            0x80E0
+#define GL_BGRA                           0x80E1
+#define GL_MAX_ELEMENTS_VERTICES          0x80E8
+#define GL_MAX_ELEMENTS_INDICES           0x80E9
+#define GL_CLAMP_TO_EDGE                  0x812F
+#define GL_TEXTURE_MIN_LOD                0x813A
+#define GL_TEXTURE_MAX_LOD                0x813B
+#define GL_TEXTURE_BASE_LEVEL             0x813C
+#define GL_TEXTURE_MAX_LEVEL              0x813D
+#define GL_LIGHT_MODEL_COLOR_CONTROL      0x81F8
+#define GL_SINGLE_COLOR                   0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR        0x81FA
+#define GL_SMOOTH_POINT_SIZE_RANGE        0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY  0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE        0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY  0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#endif
+
+#ifndef GL_ARB_imaging
+#define GL_CONSTANT_COLOR                 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
+#define GL_CONSTANT_ALPHA                 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
+#define GL_BLEND_COLOR                    0x8005
+#define GL_FUNC_ADD                       0x8006
+#define GL_MIN                            0x8007
+#define GL_MAX                            0x8008
+#define GL_BLEND_EQUATION                 0x8009
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+#define GL_CONVOLUTION_1D                 0x8010
+#define GL_CONVOLUTION_2D                 0x8011
+#define GL_SEPARABLE_2D                   0x8012
+#define GL_CONVOLUTION_BORDER_MODE        0x8013
+#define GL_CONVOLUTION_FILTER_SCALE       0x8014
+#define GL_CONVOLUTION_FILTER_BIAS        0x8015
+#define GL_REDUCE                         0x8016
+#define GL_CONVOLUTION_FORMAT             0x8017
+#define GL_CONVOLUTION_WIDTH              0x8018
+#define GL_CONVOLUTION_HEIGHT             0x8019
+#define GL_MAX_CONVOLUTION_WIDTH          0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT         0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE     0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE   0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE    0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE   0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS      0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS    0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS     0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS    0x8023
+#define GL_HISTOGRAM                      0x8024
+#define GL_PROXY_HISTOGRAM                0x8025
+#define GL_HISTOGRAM_WIDTH                0x8026
+#define GL_HISTOGRAM_FORMAT               0x8027
+#define GL_HISTOGRAM_RED_SIZE             0x8028
+#define GL_HISTOGRAM_GREEN_SIZE           0x8029
+#define GL_HISTOGRAM_BLUE_SIZE            0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE           0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE       0x802C
+#define GL_HISTOGRAM_SINK                 0x802D
+#define GL_MINMAX                         0x802E
+#define GL_MINMAX_FORMAT                  0x802F
+#define GL_MINMAX_SINK                    0x8030
+#define GL_TABLE_TOO_LARGE                0x8031
+#define GL_COLOR_MATRIX                   0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH       0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH   0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE    0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE  0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE   0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE  0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS     0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS   0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS    0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS   0x80BB
+#define GL_COLOR_TABLE                    0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE   0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE  0x80D2
+#define GL_PROXY_COLOR_TABLE              0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE              0x80D6
+#define GL_COLOR_TABLE_BIAS               0x80D7
+#define GL_COLOR_TABLE_FORMAT             0x80D8
+#define GL_COLOR_TABLE_WIDTH              0x80D9
+#define GL_COLOR_TABLE_RED_SIZE           0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE         0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE          0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE         0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE     0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE     0x80DF
+#define GL_CONSTANT_BORDER                0x8151
+#define GL_REPLICATE_BORDER               0x8153
+#define GL_CONVOLUTION_BORDER_COLOR       0x8154
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE          0x84E1
+#define GL_MAX_TEXTURE_UNITS              0x84E2
+#define GL_TRANSPOSE_MODELVIEW_MATRIX     0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX    0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX       0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX         0x84E6
+#define GL_MULTISAMPLE                    0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE            0x809F
+#define GL_SAMPLE_COVERAGE                0x80A0
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+#define GL_MULTISAMPLE_BIT                0x20000000
+#define GL_NORMAL_MAP                     0x8511
+#define GL_REFLECTION_MAP                 0x8512
+#define GL_TEXTURE_CUBE_MAP               0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP         0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
+#define GL_COMPRESSED_ALPHA               0x84E9
+#define GL_COMPRESSED_LUMINANCE           0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA     0x84EB
+#define GL_COMPRESSED_INTENSITY           0x84EC
+#define GL_COMPRESSED_RGB                 0x84ED
+#define GL_COMPRESSED_RGBA                0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT       0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE  0x86A0
+#define GL_TEXTURE_COMPRESSED             0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+#define GL_CLAMP_TO_BORDER                0x812D
+#define GL_COMBINE                        0x8570
+#define GL_COMBINE_RGB                    0x8571
+#define GL_COMBINE_ALPHA                  0x8572
+#define GL_SOURCE0_RGB                    0x8580
+#define GL_SOURCE1_RGB                    0x8581
+#define GL_SOURCE2_RGB                    0x8582
+#define GL_SOURCE0_ALPHA                  0x8588
+#define GL_SOURCE1_ALPHA                  0x8589
+#define GL_SOURCE2_ALPHA                  0x858A
+#define GL_OPERAND0_RGB                   0x8590
+#define GL_OPERAND1_RGB                   0x8591
+#define GL_OPERAND2_RGB                   0x8592
+#define GL_OPERAND0_ALPHA                 0x8598
+#define GL_OPERAND1_ALPHA                 0x8599
+#define GL_OPERAND2_ALPHA                 0x859A
+#define GL_RGB_SCALE                      0x8573
+#define GL_ADD_SIGNED                     0x8574
+#define GL_INTERPOLATE                    0x8575
+#define GL_SUBTRACT                       0x84E7
+#define GL_CONSTANT                       0x8576
+#define GL_PRIMARY_COLOR                  0x8577
+#define GL_PREVIOUS                       0x8578
+#define GL_DOT3_RGB                       0x86AE
+#define GL_DOT3_RGBA                      0x86AF
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_BLEND_DST_RGB                  0x80C8
+#define GL_BLEND_SRC_RGB                  0x80C9
+#define GL_BLEND_DST_ALPHA                0x80CA
+#define GL_BLEND_SRC_ALPHA                0x80CB
+#define GL_POINT_SIZE_MIN                 0x8126
+#define GL_POINT_SIZE_MAX                 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE      0x8128
+#define GL_POINT_DISTANCE_ATTENUATION     0x8129
+#define GL_GENERATE_MIPMAP                0x8191
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+#define GL_DEPTH_COMPONENT16              0x81A5
+#define GL_DEPTH_COMPONENT24              0x81A6
+#define GL_DEPTH_COMPONENT32              0x81A7
+#define GL_MIRRORED_REPEAT                0x8370
+#define GL_FOG_COORDINATE_SOURCE          0x8450
+#define GL_FOG_COORDINATE                 0x8451
+#define GL_FRAGMENT_DEPTH                 0x8452
+#define GL_CURRENT_FOG_COORDINATE         0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE      0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE    0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER   0x8456
+#define GL_FOG_COORDINATE_ARRAY           0x8457
+#define GL_COLOR_SUM                      0x8458
+#define GL_CURRENT_SECONDARY_COLOR        0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE     0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE     0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE   0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER  0x845D
+#define GL_SECONDARY_COLOR_ARRAY          0x845E
+#define GL_MAX_TEXTURE_LOD_BIAS           0x84FD
+#define GL_TEXTURE_FILTER_CONTROL         0x8500
+#define GL_TEXTURE_LOD_BIAS               0x8501
+#define GL_INCR_WRAP                      0x8507
+#define GL_DECR_WRAP                      0x8508
+#define GL_TEXTURE_DEPTH_SIZE             0x884A
+#define GL_DEPTH_TEXTURE_MODE             0x884B
+#define GL_TEXTURE_COMPARE_MODE           0x884C
+#define GL_TEXTURE_COMPARE_FUNC           0x884D
+#define GL_COMPARE_R_TO_TEXTURE           0x884E
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+#define GL_QUERY_COUNTER_BITS             0x8864
+#define GL_CURRENT_QUERY                  0x8865
+#define GL_QUERY_RESULT                   0x8866
+#define GL_QUERY_RESULT_AVAILABLE         0x8867
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+#define GL_ARRAY_BUFFER_BINDING           0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING    0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING    0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING     0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING     0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING    0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_READ_ONLY                      0x88B8
+#define GL_WRITE_ONLY                     0x88B9
+#define GL_READ_WRITE                     0x88BA
+#define GL_BUFFER_ACCESS                  0x88BB
+#define GL_BUFFER_MAPPED                  0x88BC
+#define GL_BUFFER_MAP_POINTER             0x88BD
+#define GL_STREAM_DRAW                    0x88E0
+#define GL_STREAM_READ                    0x88E1
+#define GL_STREAM_COPY                    0x88E2
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_STATIC_READ                    0x88E5
+#define GL_STATIC_COPY                    0x88E6
+#define GL_DYNAMIC_DRAW                   0x88E8
+#define GL_DYNAMIC_READ                   0x88E9
+#define GL_DYNAMIC_COPY                   0x88EA
+#define GL_SAMPLES_PASSED                 0x8914
+#define GL_FOG_COORD_SRC                  GL_FOG_COORDINATE_SOURCE
+#define GL_FOG_COORD                      GL_FOG_COORDINATE
+#define GL_CURRENT_FOG_COORD              GL_CURRENT_FOG_COORDINATE
+#define GL_FOG_COORD_ARRAY_TYPE           GL_FOG_COORDINATE_ARRAY_TYPE
+#define GL_FOG_COORD_ARRAY_STRIDE         GL_FOG_COORDINATE_ARRAY_STRIDE
+#define GL_FOG_COORD_ARRAY_POINTER        GL_FOG_COORDINATE_ARRAY_POINTER
+#define GL_FOG_COORD_ARRAY                GL_FOG_COORDINATE_ARRAY
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
+#define GL_SRC0_RGB                       GL_SOURCE0_RGB
+#define GL_SRC1_RGB                       GL_SOURCE1_RGB
+#define GL_SRC2_RGB                       GL_SOURCE2_RGB
+#define GL_SRC0_ALPHA                     GL_SOURCE0_ALPHA
+#define GL_SRC1_ALPHA                     GL_SOURCE1_ALPHA
+#define GL_SRC2_ALPHA                     GL_SOURCE2_ALPHA
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_BLEND_EQUATION_RGB             GL_BLEND_EQUATION
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
+#define GL_CURRENT_VERTEX_ATTRIB          0x8626
+#define GL_VERTEX_PROGRAM_POINT_SIZE      0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE        0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
+#define GL_STENCIL_BACK_FUNC              0x8800
+#define GL_STENCIL_BACK_FAIL              0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
+#define GL_MAX_DRAW_BUFFERS               0x8824
+#define GL_DRAW_BUFFER0                   0x8825
+#define GL_DRAW_BUFFER1                   0x8826
+#define GL_DRAW_BUFFER2                   0x8827
+#define GL_DRAW_BUFFER3                   0x8828
+#define GL_DRAW_BUFFER4                   0x8829
+#define GL_DRAW_BUFFER5                   0x882A
+#define GL_DRAW_BUFFER6                   0x882B
+#define GL_DRAW_BUFFER7                   0x882C
+#define GL_DRAW_BUFFER8                   0x882D
+#define GL_DRAW_BUFFER9                   0x882E
+#define GL_DRAW_BUFFER10                  0x882F
+#define GL_DRAW_BUFFER11                  0x8830
+#define GL_DRAW_BUFFER12                  0x8831
+#define GL_DRAW_BUFFER13                  0x8832
+#define GL_DRAW_BUFFER14                  0x8833
+#define GL_DRAW_BUFFER15                  0x8834
+#define GL_BLEND_EQUATION_ALPHA           0x883D
+#define GL_POINT_SPRITE                   0x8861
+#define GL_COORD_REPLACE                  0x8862
+#define GL_MAX_VERTEX_ATTRIBS             0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_MAX_TEXTURE_COORDS             0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
+#define GL_FRAGMENT_SHADER                0x8B30
+#define GL_VERTEX_SHADER                  0x8B31
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS  0x8B4A
+#define GL_MAX_VARYING_FLOATS             0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_SHADER_TYPE                    0x8B4F
+#define GL_FLOAT_VEC2                     0x8B50
+#define GL_FLOAT_VEC3                     0x8B51
+#define GL_FLOAT_VEC4                     0x8B52
+#define GL_INT_VEC2                       0x8B53
+#define GL_INT_VEC3                       0x8B54
+#define GL_INT_VEC4                       0x8B55
+#define GL_BOOL                           0x8B56
+#define GL_BOOL_VEC2                      0x8B57
+#define GL_BOOL_VEC3                      0x8B58
+#define GL_BOOL_VEC4                      0x8B59
+#define GL_FLOAT_MAT2                     0x8B5A
+#define GL_FLOAT_MAT3                     0x8B5B
+#define GL_FLOAT_MAT4                     0x8B5C
+#define GL_SAMPLER_1D                     0x8B5D
+#define GL_SAMPLER_2D                     0x8B5E
+#define GL_SAMPLER_3D                     0x8B5F
+#define GL_SAMPLER_CUBE                   0x8B60
+#define GL_SAMPLER_1D_SHADOW              0x8B61
+#define GL_SAMPLER_2D_SHADOW              0x8B62
+#define GL_DELETE_STATUS                  0x8B80
+#define GL_COMPILE_STATUS                 0x8B81
+#define GL_LINK_STATUS                    0x8B82
+#define GL_VALIDATE_STATUS                0x8B83
+#define GL_INFO_LOG_LENGTH                0x8B84
+#define GL_ATTACHED_SHADERS               0x8B85
+#define GL_ACTIVE_UNIFORMS                0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
+#define GL_SHADER_SOURCE_LENGTH           0x8B88
+#define GL_ACTIVE_ATTRIBUTES              0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_CURRENT_PROGRAM                0x8B8D
+#define GL_POINT_SPRITE_COORD_ORIGIN      0x8CA0
+#define GL_LOWER_LEFT                     0x8CA1
+#define GL_UPPER_LEFT                     0x8CA2
+#define GL_STENCIL_BACK_REF               0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_TEXTURE0_ARB                   0x84C0
+#define GL_TEXTURE1_ARB                   0x84C1
+#define GL_TEXTURE2_ARB                   0x84C2
+#define GL_TEXTURE3_ARB                   0x84C3
+#define GL_TEXTURE4_ARB                   0x84C4
+#define GL_TEXTURE5_ARB                   0x84C5
+#define GL_TEXTURE6_ARB                   0x84C6
+#define GL_TEXTURE7_ARB                   0x84C7
+#define GL_TEXTURE8_ARB                   0x84C8
+#define GL_TEXTURE9_ARB                   0x84C9
+#define GL_TEXTURE10_ARB                  0x84CA
+#define GL_TEXTURE11_ARB                  0x84CB
+#define GL_TEXTURE12_ARB                  0x84CC
+#define GL_TEXTURE13_ARB                  0x84CD
+#define GL_TEXTURE14_ARB                  0x84CE
+#define GL_TEXTURE15_ARB                  0x84CF
+#define GL_TEXTURE16_ARB                  0x84D0
+#define GL_TEXTURE17_ARB                  0x84D1
+#define GL_TEXTURE18_ARB                  0x84D2
+#define GL_TEXTURE19_ARB                  0x84D3
+#define GL_TEXTURE20_ARB                  0x84D4
+#define GL_TEXTURE21_ARB                  0x84D5
+#define GL_TEXTURE22_ARB                  0x84D6
+#define GL_TEXTURE23_ARB                  0x84D7
+#define GL_TEXTURE24_ARB                  0x84D8
+#define GL_TEXTURE25_ARB                  0x84D9
+#define GL_TEXTURE26_ARB                  0x84DA
+#define GL_TEXTURE27_ARB                  0x84DB
+#define GL_TEXTURE28_ARB                  0x84DC
+#define GL_TEXTURE29_ARB                  0x84DD
+#define GL_TEXTURE30_ARB                  0x84DE
+#define GL_TEXTURE31_ARB                  0x84DF
+#define GL_ACTIVE_TEXTURE_ARB             0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB      0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB          0x84E2
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB   0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX_ARB     0x84E6
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_MULTISAMPLE_ARB                0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB   0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_ARB        0x809F
+#define GL_SAMPLE_COVERAGE_ARB            0x80A0
+#define GL_SAMPLE_BUFFERS_ARB             0x80A8
+#define GL_SAMPLES_ARB                    0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE_ARB      0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT_ARB     0x80AB
+#define GL_MULTISAMPLE_BIT_ARB            0x20000000
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_NORMAL_MAP_ARB                 0x8511
+#define GL_REFLECTION_MAP_ARB             0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB           0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB   0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB     0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB  0x851C
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_COMPRESSED_ALPHA_ARB           0x84E9
+#define GL_COMPRESSED_LUMINANCE_ARB       0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
+#define GL_COMPRESSED_INTENSITY_ARB       0x84EC
+#define GL_COMPRESSED_RGB_ARB             0x84ED
+#define GL_COMPRESSED_RGBA_ARB            0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT_ARB   0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
+#define GL_TEXTURE_COMPRESSED_ARB         0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_ARB            0x812D
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_POINT_SIZE_MIN_ARB             0x8126
+#define GL_POINT_SIZE_MAX_ARB             0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_ARB  0x8128
+#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_MAX_VERTEX_UNITS_ARB           0x86A4
+#define GL_ACTIVE_VERTEX_UNITS_ARB        0x86A5
+#define GL_WEIGHT_SUM_UNITY_ARB           0x86A6
+#define GL_VERTEX_BLEND_ARB               0x86A7
+#define GL_CURRENT_WEIGHT_ARB             0x86A8
+#define GL_WEIGHT_ARRAY_TYPE_ARB          0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_ARB        0x86AA
+#define GL_WEIGHT_ARRAY_SIZE_ARB          0x86AB
+#define GL_WEIGHT_ARRAY_POINTER_ARB       0x86AC
+#define GL_WEIGHT_ARRAY_ARB               0x86AD
+#define GL_MODELVIEW0_ARB                 0x1700
+#define GL_MODELVIEW1_ARB                 0x850A
+#define GL_MODELVIEW2_ARB                 0x8722
+#define GL_MODELVIEW3_ARB                 0x8723
+#define GL_MODELVIEW4_ARB                 0x8724
+#define GL_MODELVIEW5_ARB                 0x8725
+#define GL_MODELVIEW6_ARB                 0x8726
+#define GL_MODELVIEW7_ARB                 0x8727
+#define GL_MODELVIEW8_ARB                 0x8728
+#define GL_MODELVIEW9_ARB                 0x8729
+#define GL_MODELVIEW10_ARB                0x872A
+#define GL_MODELVIEW11_ARB                0x872B
+#define GL_MODELVIEW12_ARB                0x872C
+#define GL_MODELVIEW13_ARB                0x872D
+#define GL_MODELVIEW14_ARB                0x872E
+#define GL_MODELVIEW15_ARB                0x872F
+#define GL_MODELVIEW16_ARB                0x8730
+#define GL_MODELVIEW17_ARB                0x8731
+#define GL_MODELVIEW18_ARB                0x8732
+#define GL_MODELVIEW19_ARB                0x8733
+#define GL_MODELVIEW20_ARB                0x8734
+#define GL_MODELVIEW21_ARB                0x8735
+#define GL_MODELVIEW22_ARB                0x8736
+#define GL_MODELVIEW23_ARB                0x8737
+#define GL_MODELVIEW24_ARB                0x8738
+#define GL_MODELVIEW25_ARB                0x8739
+#define GL_MODELVIEW26_ARB                0x873A
+#define GL_MODELVIEW27_ARB                0x873B
+#define GL_MODELVIEW28_ARB                0x873C
+#define GL_MODELVIEW29_ARB                0x873D
+#define GL_MODELVIEW30_ARB                0x873E
+#define GL_MODELVIEW31_ARB                0x873F
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_MATRIX_PALETTE_ARB             0x8840
+#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
+#define GL_MAX_PALETTE_MATRICES_ARB       0x8842
+#define GL_CURRENT_PALETTE_MATRIX_ARB     0x8843
+#define GL_MATRIX_INDEX_ARRAY_ARB         0x8844
+#define GL_CURRENT_MATRIX_INDEX_ARB       0x8845
+#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB    0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB    0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB  0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_COMBINE_ARB                    0x8570
+#define GL_COMBINE_RGB_ARB                0x8571
+#define GL_COMBINE_ALPHA_ARB              0x8572
+#define GL_SOURCE0_RGB_ARB                0x8580
+#define GL_SOURCE1_RGB_ARB                0x8581
+#define GL_SOURCE2_RGB_ARB                0x8582
+#define GL_SOURCE0_ALPHA_ARB              0x8588
+#define GL_SOURCE1_ALPHA_ARB              0x8589
+#define GL_SOURCE2_ALPHA_ARB              0x858A
+#define GL_OPERAND0_RGB_ARB               0x8590
+#define GL_OPERAND1_RGB_ARB               0x8591
+#define GL_OPERAND2_RGB_ARB               0x8592
+#define GL_OPERAND0_ALPHA_ARB             0x8598
+#define GL_OPERAND1_ALPHA_ARB             0x8599
+#define GL_OPERAND2_ALPHA_ARB             0x859A
+#define GL_RGB_SCALE_ARB                  0x8573
+#define GL_ADD_SIGNED_ARB                 0x8574
+#define GL_INTERPOLATE_ARB                0x8575
+#define GL_SUBTRACT_ARB                   0x84E7
+#define GL_CONSTANT_ARB                   0x8576
+#define GL_PRIMARY_COLOR_ARB              0x8577
+#define GL_PREVIOUS_ARB                   0x8578
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_DOT3_RGB_ARB                   0x86AE
+#define GL_DOT3_RGBA_ARB                  0x86AF
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_ARB            0x8370
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_DEPTH_COMPONENT16_ARB          0x81A5
+#define GL_DEPTH_COMPONENT24_ARB          0x81A6
+#define GL_DEPTH_COMPONENT32_ARB          0x81A7
+#define GL_TEXTURE_DEPTH_SIZE_ARB         0x884A
+#define GL_DEPTH_TEXTURE_MODE_ARB         0x884B
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_TEXTURE_COMPARE_MODE_ARB       0x884C
+#define GL_TEXTURE_COMPARE_FUNC_ARB       0x884D
+#define GL_COMPARE_R_TO_TEXTURE_ARB       0x884E
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
+#endif
+
+#ifndef GL_ARB_window_pos
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_COLOR_SUM_ARB                  0x8458
+#define GL_VERTEX_PROGRAM_ARB             0x8620
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB   0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB   0x8625
+#define GL_CURRENT_VERTEX_ATTRIB_ARB      0x8626
+#define GL_PROGRAM_LENGTH_ARB             0x8627
+#define GL_PROGRAM_STRING_ARB             0x8628
+#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
+#define GL_MAX_PROGRAM_MATRICES_ARB       0x862F
+#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
+#define GL_CURRENT_MATRIX_ARB             0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB  0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB    0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
+#define GL_PROGRAM_ERROR_POSITION_ARB     0x864B
+#define GL_PROGRAM_BINDING_ARB            0x8677
+#define GL_MAX_VERTEX_ATTRIBS_ARB         0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
+#define GL_PROGRAM_ERROR_STRING_ARB       0x8874
+#define GL_PROGRAM_FORMAT_ASCII_ARB       0x8875
+#define GL_PROGRAM_FORMAT_ARB             0x8876
+#define GL_PROGRAM_INSTRUCTIONS_ARB       0x88A0
+#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB   0x88A1
+#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
+#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
+#define GL_PROGRAM_TEMPORARIES_ARB        0x88A4
+#define GL_MAX_PROGRAM_TEMPORARIES_ARB    0x88A5
+#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
+#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
+#define GL_PROGRAM_PARAMETERS_ARB         0x88A8
+#define GL_MAX_PROGRAM_PARAMETERS_ARB     0x88A9
+#define GL_PROGRAM_NATIVE_PARAMETERS_ARB  0x88AA
+#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
+#define GL_PROGRAM_ATTRIBS_ARB            0x88AC
+#define GL_MAX_PROGRAM_ATTRIBS_ARB        0x88AD
+#define GL_PROGRAM_NATIVE_ATTRIBS_ARB     0x88AE
+#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
+#define GL_PROGRAM_ADDRESS_REGISTERS_ARB  0x88B0
+#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
+#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
+#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
+#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
+#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
+#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
+#define GL_TRANSPOSE_CURRENT_MATRIX_ARB   0x88B7
+#define GL_MATRIX0_ARB                    0x88C0
+#define GL_MATRIX1_ARB                    0x88C1
+#define GL_MATRIX2_ARB                    0x88C2
+#define GL_MATRIX3_ARB                    0x88C3
+#define GL_MATRIX4_ARB                    0x88C4
+#define GL_MATRIX5_ARB                    0x88C5
+#define GL_MATRIX6_ARB                    0x88C6
+#define GL_MATRIX7_ARB                    0x88C7
+#define GL_MATRIX8_ARB                    0x88C8
+#define GL_MATRIX9_ARB                    0x88C9
+#define GL_MATRIX10_ARB                   0x88CA
+#define GL_MATRIX11_ARB                   0x88CB
+#define GL_MATRIX12_ARB                   0x88CC
+#define GL_MATRIX13_ARB                   0x88CD
+#define GL_MATRIX14_ARB                   0x88CE
+#define GL_MATRIX15_ARB                   0x88CF
+#define GL_MATRIX16_ARB                   0x88D0
+#define GL_MATRIX17_ARB                   0x88D1
+#define GL_MATRIX18_ARB                   0x88D2
+#define GL_MATRIX19_ARB                   0x88D3
+#define GL_MATRIX20_ARB                   0x88D4
+#define GL_MATRIX21_ARB                   0x88D5
+#define GL_MATRIX22_ARB                   0x88D6
+#define GL_MATRIX23_ARB                   0x88D7
+#define GL_MATRIX24_ARB                   0x88D8
+#define GL_MATRIX25_ARB                   0x88D9
+#define GL_MATRIX26_ARB                   0x88DA
+#define GL_MATRIX27_ARB                   0x88DB
+#define GL_MATRIX28_ARB                   0x88DC
+#define GL_MATRIX29_ARB                   0x88DD
+#define GL_MATRIX30_ARB                   0x88DE
+#define GL_MATRIX31_ARB                   0x88DF
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_FRAGMENT_PROGRAM_ARB           0x8804
+#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB   0x8805
+#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB   0x8806
+#define GL_PROGRAM_TEX_INDIRECTIONS_ARB   0x8807
+#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
+#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
+#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
+#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
+#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
+#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
+#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
+#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
+#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
+#define GL_MAX_TEXTURE_COORDS_ARB         0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB    0x8872
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_BUFFER_SIZE_ARB                0x8764
+#define GL_BUFFER_USAGE_ARB               0x8765
+#define GL_ARRAY_BUFFER_ARB               0x8892
+#define GL_ELEMENT_ARRAY_BUFFER_ARB       0x8893
+#define GL_ARRAY_BUFFER_BINDING_ARB       0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
+#define GL_READ_ONLY_ARB                  0x88B8
+#define GL_WRITE_ONLY_ARB                 0x88B9
+#define GL_READ_WRITE_ARB                 0x88BA
+#define GL_BUFFER_ACCESS_ARB              0x88BB
+#define GL_BUFFER_MAPPED_ARB              0x88BC
+#define GL_BUFFER_MAP_POINTER_ARB         0x88BD
+#define GL_STREAM_DRAW_ARB                0x88E0
+#define GL_STREAM_READ_ARB                0x88E1
+#define GL_STREAM_COPY_ARB                0x88E2
+#define GL_STATIC_DRAW_ARB                0x88E4
+#define GL_STATIC_READ_ARB                0x88E5
+#define GL_STATIC_COPY_ARB                0x88E6
+#define GL_DYNAMIC_DRAW_ARB               0x88E8
+#define GL_DYNAMIC_READ_ARB               0x88E9
+#define GL_DYNAMIC_COPY_ARB               0x88EA
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_QUERY_COUNTER_BITS_ARB         0x8864
+#define GL_CURRENT_QUERY_ARB              0x8865
+#define GL_QUERY_RESULT_ARB               0x8866
+#define GL_QUERY_RESULT_AVAILABLE_ARB     0x8867
+#define GL_SAMPLES_PASSED_ARB             0x8914
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_PROGRAM_OBJECT_ARB             0x8B40
+#define GL_SHADER_OBJECT_ARB              0x8B48
+#define GL_OBJECT_TYPE_ARB                0x8B4E
+#define GL_OBJECT_SUBTYPE_ARB             0x8B4F
+#define GL_FLOAT_VEC2_ARB                 0x8B50
+#define GL_FLOAT_VEC3_ARB                 0x8B51
+#define GL_FLOAT_VEC4_ARB                 0x8B52
+#define GL_INT_VEC2_ARB                   0x8B53
+#define GL_INT_VEC3_ARB                   0x8B54
+#define GL_INT_VEC4_ARB                   0x8B55
+#define GL_BOOL_ARB                       0x8B56
+#define GL_BOOL_VEC2_ARB                  0x8B57
+#define GL_BOOL_VEC3_ARB                  0x8B58
+#define GL_BOOL_VEC4_ARB                  0x8B59
+#define GL_FLOAT_MAT2_ARB                 0x8B5A
+#define GL_FLOAT_MAT3_ARB                 0x8B5B
+#define GL_FLOAT_MAT4_ARB                 0x8B5C
+#define GL_SAMPLER_1D_ARB                 0x8B5D
+#define GL_SAMPLER_2D_ARB                 0x8B5E
+#define GL_SAMPLER_3D_ARB                 0x8B5F
+#define GL_SAMPLER_CUBE_ARB               0x8B60
+#define GL_SAMPLER_1D_SHADOW_ARB          0x8B61
+#define GL_SAMPLER_2D_SHADOW_ARB          0x8B62
+#define GL_SAMPLER_2D_RECT_ARB            0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB     0x8B64
+#define GL_OBJECT_DELETE_STATUS_ARB       0x8B80
+#define GL_OBJECT_COMPILE_STATUS_ARB      0x8B81
+#define GL_OBJECT_LINK_STATUS_ARB         0x8B82
+#define GL_OBJECT_VALIDATE_STATUS_ARB     0x8B83
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB     0x8B84
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB    0x8B85
+#define GL_OBJECT_ACTIVE_UNIFORMS_ARB     0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_VERTEX_SHADER_ARB              0x8B31
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
+#define GL_MAX_VARYING_FLOATS_ARB         0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB   0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_FRAGMENT_SHADER_ARB            0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_SHADING_LANGUAGE_VERSION_ARB   0x8B8C
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_POINT_SPRITE_ARB               0x8861
+#define GL_COORD_REPLACE_ARB              0x8862
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ARB           0x8824
+#define GL_DRAW_BUFFER0_ARB               0x8825
+#define GL_DRAW_BUFFER1_ARB               0x8826
+#define GL_DRAW_BUFFER2_ARB               0x8827
+#define GL_DRAW_BUFFER3_ARB               0x8828
+#define GL_DRAW_BUFFER4_ARB               0x8829
+#define GL_DRAW_BUFFER5_ARB               0x882A
+#define GL_DRAW_BUFFER6_ARB               0x882B
+#define GL_DRAW_BUFFER7_ARB               0x882C
+#define GL_DRAW_BUFFER8_ARB               0x882D
+#define GL_DRAW_BUFFER9_ARB               0x882E
+#define GL_DRAW_BUFFER10_ARB              0x882F
+#define GL_DRAW_BUFFER11_ARB              0x8830
+#define GL_DRAW_BUFFER12_ARB              0x8831
+#define GL_DRAW_BUFFER13_ARB              0x8832
+#define GL_DRAW_BUFFER14_ARB              0x8833
+#define GL_DRAW_BUFFER15_ARB              0x8834
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_ARB          0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_ARB  0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_ARB    0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_RGBA_FLOAT_MODE_ARB            0x8820
+#define GL_CLAMP_VERTEX_COLOR_ARB         0x891A
+#define GL_CLAMP_FRAGMENT_COLOR_ARB       0x891B
+#define GL_CLAMP_READ_COLOR_ARB           0x891C
+#define GL_FIXED_ONLY_ARB                 0x891D
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_HALF_FLOAT_ARB                 0x140B
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_TEXTURE_RED_TYPE_ARB           0x8C10
+#define GL_TEXTURE_GREEN_TYPE_ARB         0x8C11
+#define GL_TEXTURE_BLUE_TYPE_ARB          0x8C12
+#define GL_TEXTURE_ALPHA_TYPE_ARB         0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE_ARB     0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE_ARB     0x8C15
+#define GL_TEXTURE_DEPTH_TYPE_ARB         0x8C16
+#define GL_UNSIGNED_NORMALIZED_ARB        0x8C17
+#define GL_RGBA32F_ARB                    0x8814
+#define GL_RGB32F_ARB                     0x8815
+#define GL_ALPHA32F_ARB                   0x8816
+#define GL_INTENSITY32F_ARB               0x8817
+#define GL_LUMINANCE32F_ARB               0x8818
+#define GL_LUMINANCE_ALPHA32F_ARB         0x8819
+#define GL_RGBA16F_ARB                    0x881A
+#define GL_RGB16F_ARB                     0x881B
+#define GL_ALPHA16F_ARB                   0x881C
+#define GL_INTENSITY16F_ARB               0x881D
+#define GL_LUMINANCE16F_ARB               0x881E
+#define GL_LUMINANCE_ALPHA16F_ARB         0x881F
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_ARB          0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_ARB        0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_ARB  0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_ABGR_EXT                       0x8000
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_CONSTANT_COLOR_EXT             0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR_EXT   0x8002
+#define GL_CONSTANT_ALPHA_EXT             0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT   0x8004
+#define GL_BLEND_COLOR_EXT                0x8005
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_POLYGON_OFFSET_EXT             0x8037
+#define GL_POLYGON_OFFSET_FACTOR_EXT      0x8038
+#define GL_POLYGON_OFFSET_BIAS_EXT        0x8039
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_ALPHA4_EXT                     0x803B
+#define GL_ALPHA8_EXT                     0x803C
+#define GL_ALPHA12_EXT                    0x803D
+#define GL_ALPHA16_EXT                    0x803E
+#define GL_LUMINANCE4_EXT                 0x803F
+#define GL_LUMINANCE8_EXT                 0x8040
+#define GL_LUMINANCE12_EXT                0x8041
+#define GL_LUMINANCE16_EXT                0x8042
+#define GL_LUMINANCE4_ALPHA4_EXT          0x8043
+#define GL_LUMINANCE6_ALPHA2_EXT          0x8044
+#define GL_LUMINANCE8_ALPHA8_EXT          0x8045
+#define GL_LUMINANCE12_ALPHA4_EXT         0x8046
+#define GL_LUMINANCE12_ALPHA12_EXT        0x8047
+#define GL_LUMINANCE16_ALPHA16_EXT        0x8048
+#define GL_INTENSITY_EXT                  0x8049
+#define GL_INTENSITY4_EXT                 0x804A
+#define GL_INTENSITY8_EXT                 0x804B
+#define GL_INTENSITY12_EXT                0x804C
+#define GL_INTENSITY16_EXT                0x804D
+#define GL_RGB2_EXT                       0x804E
+#define GL_RGB4_EXT                       0x804F
+#define GL_RGB5_EXT                       0x8050
+#define GL_RGB8_EXT                       0x8051
+#define GL_RGB10_EXT                      0x8052
+#define GL_RGB12_EXT                      0x8053
+#define GL_RGB16_EXT                      0x8054
+#define GL_RGBA2_EXT                      0x8055
+#define GL_RGBA4_EXT                      0x8056
+#define GL_RGB5_A1_EXT                    0x8057
+#define GL_RGBA8_EXT                      0x8058
+#define GL_RGB10_A2_EXT                   0x8059
+#define GL_RGBA12_EXT                     0x805A
+#define GL_RGBA16_EXT                     0x805B
+#define GL_TEXTURE_RED_SIZE_EXT           0x805C
+#define GL_TEXTURE_GREEN_SIZE_EXT         0x805D
+#define GL_TEXTURE_BLUE_SIZE_EXT          0x805E
+#define GL_TEXTURE_ALPHA_SIZE_EXT         0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE_EXT     0x8060
+#define GL_TEXTURE_INTENSITY_SIZE_EXT     0x8061
+#define GL_REPLACE_EXT                    0x8062
+#define GL_PROXY_TEXTURE_1D_EXT           0x8063
+#define GL_PROXY_TEXTURE_2D_EXT           0x8064
+#define GL_TEXTURE_TOO_LARGE_EXT          0x8065
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_PACK_SKIP_IMAGES_EXT           0x806B
+#define GL_PACK_IMAGE_HEIGHT_EXT          0x806C
+#define GL_UNPACK_SKIP_IMAGES_EXT         0x806D
+#define GL_UNPACK_IMAGE_HEIGHT_EXT        0x806E
+#define GL_TEXTURE_3D_EXT                 0x806F
+#define GL_PROXY_TEXTURE_3D_EXT           0x8070
+#define GL_TEXTURE_DEPTH_EXT              0x8071
+#define GL_TEXTURE_WRAP_R_EXT             0x8072
+#define GL_MAX_3D_TEXTURE_SIZE_EXT        0x8073
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_FILTER4_SGIS                   0x8146
+#define GL_TEXTURE_FILTER4_SIZE_SGIS      0x8147
+#endif
+
+#ifndef GL_EXT_subtexture
+#endif
+
+#ifndef GL_EXT_copy_texture
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_HISTOGRAM_EXT                  0x8024
+#define GL_PROXY_HISTOGRAM_EXT            0x8025
+#define GL_HISTOGRAM_WIDTH_EXT            0x8026
+#define GL_HISTOGRAM_FORMAT_EXT           0x8027
+#define GL_HISTOGRAM_RED_SIZE_EXT         0x8028
+#define GL_HISTOGRAM_GREEN_SIZE_EXT       0x8029
+#define GL_HISTOGRAM_BLUE_SIZE_EXT        0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE_EXT       0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT   0x802C
+#define GL_HISTOGRAM_SINK_EXT             0x802D
+#define GL_MINMAX_EXT                     0x802E
+#define GL_MINMAX_FORMAT_EXT              0x802F
+#define GL_MINMAX_SINK_EXT                0x8030
+#define GL_TABLE_TOO_LARGE_EXT            0x8031
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_CONVOLUTION_1D_EXT             0x8010
+#define GL_CONVOLUTION_2D_EXT             0x8011
+#define GL_SEPARABLE_2D_EXT               0x8012
+#define GL_CONVOLUTION_BORDER_MODE_EXT    0x8013
+#define GL_CONVOLUTION_FILTER_SCALE_EXT   0x8014
+#define GL_CONVOLUTION_FILTER_BIAS_EXT    0x8015
+#define GL_REDUCE_EXT                     0x8016
+#define GL_CONVOLUTION_FORMAT_EXT         0x8017
+#define GL_CONVOLUTION_WIDTH_EXT          0x8018
+#define GL_CONVOLUTION_HEIGHT_EXT         0x8019
+#define GL_MAX_CONVOLUTION_WIDTH_EXT      0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT_EXT     0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS_EXT  0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_COLOR_MATRIX_SGI               0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH_SGI   0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_COLOR_TABLE_SGI                0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
+#define GL_PROXY_COLOR_TABLE_SGI          0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
+#define GL_COLOR_TABLE_SCALE_SGI          0x80D6
+#define GL_COLOR_TABLE_BIAS_SGI           0x80D7
+#define GL_COLOR_TABLE_FORMAT_SGI         0x80D8
+#define GL_COLOR_TABLE_WIDTH_SGI          0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_SGI       0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_SGI     0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_SGI      0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_SGI     0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_PIXEL_TEXTURE_SGIS             0x8353
+#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
+#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
+#define GL_PIXEL_GROUP_COLOR_SGIS         0x8356
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_PIXEL_TEX_GEN_SGIX             0x8139
+#define GL_PIXEL_TEX_GEN_MODE_SGIX        0x832B
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_PACK_SKIP_VOLUMES_SGIS         0x8130
+#define GL_PACK_IMAGE_DEPTH_SGIS          0x8131
+#define GL_UNPACK_SKIP_VOLUMES_SGIS       0x8132
+#define GL_UNPACK_IMAGE_DEPTH_SGIS        0x8133
+#define GL_TEXTURE_4D_SGIS                0x8134
+#define GL_PROXY_TEXTURE_4D_SGIS          0x8135
+#define GL_TEXTURE_4DSIZE_SGIS            0x8136
+#define GL_TEXTURE_WRAP_Q_SGIS            0x8137
+#define GL_MAX_4D_TEXTURE_SIZE_SGIS       0x8138
+#define GL_TEXTURE_4D_BINDING_SGIS        0x814F
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_TEXTURE_COLOR_TABLE_SGI        0x80BC
+#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI  0x80BD
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_CMYK_EXT                       0x800C
+#define GL_CMYKA_EXT                      0x800D
+#define GL_PACK_CMYK_HINT_EXT             0x800E
+#define GL_UNPACK_CMYK_HINT_EXT           0x800F
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_TEXTURE_PRIORITY_EXT           0x8066
+#define GL_TEXTURE_RESIDENT_EXT           0x8067
+#define GL_TEXTURE_1D_BINDING_EXT         0x8068
+#define GL_TEXTURE_2D_BINDING_EXT         0x8069
+#define GL_TEXTURE_3D_BINDING_EXT         0x806A
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_DETAIL_TEXTURE_2D_SGIS         0x8095
+#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
+#define GL_LINEAR_DETAIL_SGIS             0x8097
+#define GL_LINEAR_DETAIL_ALPHA_SGIS       0x8098
+#define GL_LINEAR_DETAIL_COLOR_SGIS       0x8099
+#define GL_DETAIL_TEXTURE_LEVEL_SGIS      0x809A
+#define GL_DETAIL_TEXTURE_MODE_SGIS       0x809B
+#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_LINEAR_SHARPEN_SGIS            0x80AD
+#define GL_LINEAR_SHARPEN_ALPHA_SGIS      0x80AE
+#define GL_LINEAR_SHARPEN_COLOR_SGIS      0x80AF
+#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_UNSIGNED_BYTE_3_3_2_EXT        0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT     0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT     0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT       0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT    0x8036
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_TEXTURE_MIN_LOD_SGIS           0x813A
+#define GL_TEXTURE_MAX_LOD_SGIS           0x813B
+#define GL_TEXTURE_BASE_LEVEL_SGIS        0x813C
+#define GL_TEXTURE_MAX_LEVEL_SGIS         0x813D
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_MULTISAMPLE_SGIS               0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_SGIS      0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_SGIS       0x809F
+#define GL_SAMPLE_MASK_SGIS               0x80A0
+#define GL_1PASS_SGIS                     0x80A1
+#define GL_2PASS_0_SGIS                   0x80A2
+#define GL_2PASS_1_SGIS                   0x80A3
+#define GL_4PASS_0_SGIS                   0x80A4
+#define GL_4PASS_1_SGIS                   0x80A5
+#define GL_4PASS_2_SGIS                   0x80A6
+#define GL_4PASS_3_SGIS                   0x80A7
+#define GL_SAMPLE_BUFFERS_SGIS            0x80A8
+#define GL_SAMPLES_SGIS                   0x80A9
+#define GL_SAMPLE_MASK_VALUE_SGIS         0x80AA
+#define GL_SAMPLE_MASK_INVERT_SGIS        0x80AB
+#define GL_SAMPLE_PATTERN_SGIS            0x80AC
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_RESCALE_NORMAL_EXT             0x803A
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_VERTEX_ARRAY_EXT               0x8074
+#define GL_NORMAL_ARRAY_EXT               0x8075
+#define GL_COLOR_ARRAY_EXT                0x8076
+#define GL_INDEX_ARRAY_EXT                0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT        0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT            0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT          0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT          0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT        0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT         0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT          0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT        0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT         0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT           0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT           0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT         0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT          0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT           0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT         0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT          0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT   0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT   0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT  0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT     0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT      0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT       0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT       0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT        0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT        0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT    0x8093
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_GENERATE_MIPMAP_SGIS           0x8191
+#define GL_GENERATE_MIPMAP_HINT_SGIS      0x8192
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_LINEAR_CLIPMAP_LINEAR_SGIX     0x8170
+#define GL_TEXTURE_CLIPMAP_CENTER_SGIX    0x8171
+#define GL_TEXTURE_CLIPMAP_FRAME_SGIX     0x8172
+#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX    0x8173
+#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
+#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
+#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX     0x8176
+#define GL_MAX_CLIPMAP_DEPTH_SGIX         0x8177
+#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
+#define GL_NEAREST_CLIPMAP_NEAREST_SGIX   0x844D
+#define GL_NEAREST_CLIPMAP_LINEAR_SGIX    0x844E
+#define GL_LINEAR_CLIPMAP_NEAREST_SGIX    0x844F
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_TEXTURE_COMPARE_SGIX           0x819A
+#define GL_TEXTURE_COMPARE_OPERATOR_SGIX  0x819B
+#define GL_TEXTURE_LEQUAL_R_SGIX          0x819C
+#define GL_TEXTURE_GEQUAL_R_SGIX          0x819D
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_CLAMP_TO_EDGE_SGIS             0x812F
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_SGIS           0x812D
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_FUNC_ADD_EXT                   0x8006
+#define GL_MIN_EXT                        0x8007
+#define GL_MAX_EXT                        0x8008
+#define GL_BLEND_EQUATION_EXT             0x8009
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_FUNC_SUBTRACT_EXT              0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT      0x800B
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_INTERLACE_SGIX                 0x8094
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
+#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
+#define GL_PIXEL_TILE_WIDTH_SGIX          0x8140
+#define GL_PIXEL_TILE_HEIGHT_SGIX         0x8141
+#define GL_PIXEL_TILE_GRID_WIDTH_SGIX     0x8142
+#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX    0x8143
+#define GL_PIXEL_TILE_GRID_DEPTH_SGIX     0x8144
+#define GL_PIXEL_TILE_CACHE_SIZE_SGIX     0x8145
+#endif
+
+#ifndef GL_SGIS_texture_select
+#define GL_DUAL_ALPHA4_SGIS               0x8110
+#define GL_DUAL_ALPHA8_SGIS               0x8111
+#define GL_DUAL_ALPHA12_SGIS              0x8112
+#define GL_DUAL_ALPHA16_SGIS              0x8113
+#define GL_DUAL_LUMINANCE4_SGIS           0x8114
+#define GL_DUAL_LUMINANCE8_SGIS           0x8115
+#define GL_DUAL_LUMINANCE12_SGIS          0x8116
+#define GL_DUAL_LUMINANCE16_SGIS          0x8117
+#define GL_DUAL_INTENSITY4_SGIS           0x8118
+#define GL_DUAL_INTENSITY8_SGIS           0x8119
+#define GL_DUAL_INTENSITY12_SGIS          0x811A
+#define GL_DUAL_INTENSITY16_SGIS          0x811B
+#define GL_DUAL_LUMINANCE_ALPHA4_SGIS     0x811C
+#define GL_DUAL_LUMINANCE_ALPHA8_SGIS     0x811D
+#define GL_QUAD_ALPHA4_SGIS               0x811E
+#define GL_QUAD_ALPHA8_SGIS               0x811F
+#define GL_QUAD_LUMINANCE4_SGIS           0x8120
+#define GL_QUAD_LUMINANCE8_SGIS           0x8121
+#define GL_QUAD_INTENSITY4_SGIS           0x8122
+#define GL_QUAD_INTENSITY8_SGIS           0x8123
+#define GL_DUAL_TEXTURE_SELECT_SGIS       0x8124
+#define GL_QUAD_TEXTURE_SELECT_SGIS       0x8125
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SPRITE_SGIX                    0x8148
+#define GL_SPRITE_MODE_SGIX               0x8149
+#define GL_SPRITE_AXIS_SGIX               0x814A
+#define GL_SPRITE_TRANSLATION_SGIX        0x814B
+#define GL_SPRITE_AXIAL_SGIX              0x814C
+#define GL_SPRITE_OBJECT_ALIGNED_SGIX     0x814D
+#define GL_SPRITE_EYE_ALIGNED_SGIX        0x814E
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_POINT_SIZE_MIN_EXT             0x8126
+#define GL_POINT_SIZE_MAX_EXT             0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_EXT  0x8128
+#define GL_DISTANCE_ATTENUATION_EXT       0x8129
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_POINT_SIZE_MIN_SGIS            0x8126
+#define GL_POINT_SIZE_MAX_SGIS            0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
+#define GL_DISTANCE_ATTENUATION_SGIS      0x8129
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
+#define GL_INSTRUMENT_MEASUREMENTS_SGIX   0x8181
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_POST_TEXTURE_FILTER_BIAS_SGIX  0x8179
+#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
+#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
+#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_FRAMEZOOM_SGIX                 0x818B
+#define GL_FRAMEZOOM_FACTOR_SGIX          0x818C
+#define GL_MAX_FRAMEZOOM_FACTOR_SGIX      0x818D
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#endif
+
+#ifndef GL_FfdMaskSGIX
+#define GL_TEXTURE_DEFORMATION_BIT_SGIX   0x00000001
+#define GL_GEOMETRY_DEFORMATION_BIT_SGIX  0x00000002
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_GEOMETRY_DEFORMATION_SGIX      0x8194
+#define GL_TEXTURE_DEFORMATION_SGIX       0x8195
+#define GL_DEFORMATIONS_MASK_SGIX         0x8196
+#define GL_MAX_DEFORMATION_ORDER_SGIX     0x8197
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_REFERENCE_PLANE_SGIX           0x817D
+#define GL_REFERENCE_PLANE_EQUATION_SGIX  0x817E
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_DEPTH_COMPONENT16_SGIX         0x81A5
+#define GL_DEPTH_COMPONENT24_SGIX         0x81A6
+#define GL_DEPTH_COMPONENT32_SGIX         0x81A7
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_FOG_FUNC_SGIS                  0x812A
+#define GL_FOG_FUNC_POINTS_SGIS           0x812B
+#define GL_MAX_FOG_FUNC_POINTS_SGIS       0x812C
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_FOG_OFFSET_SGIX                0x8198
+#define GL_FOG_OFFSET_VALUE_SGIX          0x8199
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_IMAGE_SCALE_X_HP               0x8155
+#define GL_IMAGE_SCALE_Y_HP               0x8156
+#define GL_IMAGE_TRANSLATE_X_HP           0x8157
+#define GL_IMAGE_TRANSLATE_Y_HP           0x8158
+#define GL_IMAGE_ROTATE_ANGLE_HP          0x8159
+#define GL_IMAGE_ROTATE_ORIGIN_X_HP       0x815A
+#define GL_IMAGE_ROTATE_ORIGIN_Y_HP       0x815B
+#define GL_IMAGE_MAG_FILTER_HP            0x815C
+#define GL_IMAGE_MIN_FILTER_HP            0x815D
+#define GL_IMAGE_CUBIC_WEIGHT_HP          0x815E
+#define GL_CUBIC_HP                       0x815F
+#define GL_AVERAGE_HP                     0x8160
+#define GL_IMAGE_TRANSFORM_2D_HP          0x8161
+#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
+#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_IGNORE_BORDER_HP               0x8150
+#define GL_CONSTANT_BORDER_HP             0x8151
+#define GL_REPLICATE_BORDER_HP            0x8153
+#define GL_CONVOLUTION_BORDER_COLOR_HP    0x8154
+#endif
+
+#ifndef GL_INGR_palette_buffer
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_TEXTURE_ENV_BIAS_SGIX          0x80BE
+#endif
+
+#ifndef GL_EXT_color_subtable
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_VERTEX_DATA_HINT_PGI           0x1A22A
+#define GL_VERTEX_CONSISTENT_HINT_PGI     0x1A22B
+#define GL_MATERIAL_SIDE_HINT_PGI         0x1A22C
+#define GL_MAX_VERTEX_HINT_PGI            0x1A22D
+#define GL_COLOR3_BIT_PGI                 0x00010000
+#define GL_COLOR4_BIT_PGI                 0x00020000
+#define GL_EDGEFLAG_BIT_PGI               0x00040000
+#define GL_INDEX_BIT_PGI                  0x00080000
+#define GL_MAT_AMBIENT_BIT_PGI            0x00100000
+#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
+#define GL_MAT_DIFFUSE_BIT_PGI            0x00400000
+#define GL_MAT_EMISSION_BIT_PGI           0x00800000
+#define GL_MAT_COLOR_INDEXES_BIT_PGI      0x01000000
+#define GL_MAT_SHININESS_BIT_PGI          0x02000000
+#define GL_MAT_SPECULAR_BIT_PGI           0x04000000
+#define GL_NORMAL_BIT_PGI                 0x08000000
+#define GL_TEXCOORD1_BIT_PGI              0x10000000
+#define GL_TEXCOORD2_BIT_PGI              0x20000000
+#define GL_TEXCOORD3_BIT_PGI              0x40000000
+#define GL_TEXCOORD4_BIT_PGI              0x80000000
+#define GL_VERTEX23_BIT_PGI               0x00000004
+#define GL_VERTEX4_BIT_PGI                0x00000008
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PREFER_DOUBLEBUFFER_HINT_PGI   0x1A1F8
+#define GL_CONSERVE_MEMORY_HINT_PGI       0x1A1FD
+#define GL_RECLAIM_MEMORY_HINT_PGI        0x1A1FE
+#define GL_NATIVE_GRAPHICS_HANDLE_PGI     0x1A202
+#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
+#define GL_NATIVE_GRAPHICS_END_HINT_PGI   0x1A204
+#define GL_ALWAYS_FAST_HINT_PGI           0x1A20C
+#define GL_ALWAYS_SOFT_HINT_PGI           0x1A20D
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI        0x1A20E
+#define GL_ALLOW_DRAW_WIN_HINT_PGI        0x1A20F
+#define GL_ALLOW_DRAW_FRG_HINT_PGI        0x1A210
+#define GL_ALLOW_DRAW_MEM_HINT_PGI        0x1A211
+#define GL_STRICT_DEPTHFUNC_HINT_PGI      0x1A216
+#define GL_STRICT_LIGHTING_HINT_PGI       0x1A217
+#define GL_STRICT_SCISSOR_HINT_PGI        0x1A218
+#define GL_FULL_STIPPLE_HINT_PGI          0x1A219
+#define GL_CLIP_NEAR_HINT_PGI             0x1A220
+#define GL_CLIP_FAR_HINT_PGI              0x1A221
+#define GL_WIDE_LINE_HINT_PGI             0x1A222
+#define GL_BACK_NORMALS_HINT_PGI          0x1A223
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_COLOR_INDEX1_EXT               0x80E2
+#define GL_COLOR_INDEX2_EXT               0x80E3
+#define GL_COLOR_INDEX4_EXT               0x80E4
+#define GL_COLOR_INDEX8_EXT               0x80E5
+#define GL_COLOR_INDEX12_EXT              0x80E6
+#define GL_COLOR_INDEX16_EXT              0x80E7
+#define GL_TEXTURE_INDEX_SIZE_EXT         0x80ED
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT  0x80F0
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_LIST_PRIORITY_SGIX             0x8182
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_IR_INSTRUMENT1_SGIX            0x817F
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_CALLIGRAPHIC_FRAGMENT_SGIX     0x8183
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_TEXTURE_LOD_BIAS_S_SGIX        0x818E
+#define GL_TEXTURE_LOD_BIAS_T_SGIX        0x818F
+#define GL_TEXTURE_LOD_BIAS_R_SGIX        0x8190
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SHADOW_AMBIENT_SGIX            0x80BF
+#endif
+
+#ifndef GL_EXT_index_texture
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_INDEX_MATERIAL_EXT             0x81B8
+#define GL_INDEX_MATERIAL_PARAMETER_EXT   0x81B9
+#define GL_INDEX_MATERIAL_FACE_EXT        0x81BA
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_INDEX_TEST_EXT                 0x81B5
+#define GL_INDEX_TEST_FUNC_EXT            0x81B6
+#define GL_INDEX_TEST_REF_EXT             0x81B7
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_IUI_V2F_EXT                    0x81AD
+#define GL_IUI_V3F_EXT                    0x81AE
+#define GL_IUI_N3F_V2F_EXT                0x81AF
+#define GL_IUI_N3F_V3F_EXT                0x81B0
+#define GL_T2F_IUI_V2F_EXT                0x81B1
+#define GL_T2F_IUI_V3F_EXT                0x81B2
+#define GL_T2F_IUI_N3F_V2F_EXT            0x81B3
+#define GL_T2F_IUI_N3F_V3F_EXT            0x81B4
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT   0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT   0x81A9
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_CULL_VERTEX_EXT                0x81AA
+#define GL_CULL_VERTEX_EYE_POSITION_EXT   0x81AB
+#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_YCRCB_422_SGIX                 0x81BB
+#define GL_YCRCB_444_SGIX                 0x81BC
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_FRAGMENT_LIGHTING_SGIX         0x8400
+#define GL_FRAGMENT_COLOR_MATERIAL_SGIX   0x8401
+#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
+#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
+#define GL_MAX_FRAGMENT_LIGHTS_SGIX       0x8404
+#define GL_MAX_ACTIVE_LIGHTS_SGIX         0x8405
+#define GL_CURRENT_RASTER_NORMAL_SGIX     0x8406
+#define GL_LIGHT_ENV_MODE_SGIX            0x8407
+#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
+#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
+#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
+#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
+#define GL_FRAGMENT_LIGHT0_SGIX           0x840C
+#define GL_FRAGMENT_LIGHT1_SGIX           0x840D
+#define GL_FRAGMENT_LIGHT2_SGIX           0x840E
+#define GL_FRAGMENT_LIGHT3_SGIX           0x840F
+#define GL_FRAGMENT_LIGHT4_SGIX           0x8410
+#define GL_FRAGMENT_LIGHT5_SGIX           0x8411
+#define GL_FRAGMENT_LIGHT6_SGIX           0x8412
+#define GL_FRAGMENT_LIGHT7_SGIX           0x8413
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_RASTER_POSITION_UNCLIPPED_IBM  0x19262
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_TEXTURE_LIGHTING_MODE_HP       0x8167
+#define GL_TEXTURE_POST_SPECULAR_HP       0x8168
+#define GL_TEXTURE_PRE_SPECULAR_HP        0x8169
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_MAX_ELEMENTS_VERTICES_EXT      0x80E8
+#define GL_MAX_ELEMENTS_INDICES_EXT       0x80E9
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_PHONG_WIN                      0x80EA
+#define GL_PHONG_HINT_WIN                 0x80EB
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_FOG_SPECULAR_TEXTURE_WIN       0x80EC
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_FRAGMENT_MATERIAL_EXT          0x8349
+#define GL_FRAGMENT_NORMAL_EXT            0x834A
+#define GL_FRAGMENT_COLOR_EXT             0x834C
+#define GL_ATTENUATION_EXT                0x834D
+#define GL_SHADOW_ATTENUATION_EXT         0x834E
+#define GL_TEXTURE_APPLICATION_MODE_EXT   0x834F
+#define GL_TEXTURE_LIGHT_EXT              0x8350
+#define GL_TEXTURE_MATERIAL_FACE_EXT      0x8351
+#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
+/* reuse GL_FRAGMENT_DEPTH_EXT */
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_ALPHA_MIN_SGIX                 0x8320
+#define GL_ALPHA_MAX_SGIX                 0x8321
+#endif
+
+#ifndef GL_SGIX_impact_pixel_texture
+#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX   0x8184
+#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX     0x8185
+#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX     0x8186
+#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
+#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
+#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX    0x8189
+#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX    0x818A
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_BGR_EXT                        0x80E0
+#define GL_BGRA_EXT                       0x80E1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_ASYNC_MARKER_SGIX              0x8329
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_ASYNC_TEX_IMAGE_SGIX           0x835C
+#define GL_ASYNC_DRAW_PIXELS_SGIX         0x835D
+#define GL_ASYNC_READ_PIXELS_SGIX         0x835E
+#define GL_MAX_ASYNC_TEX_IMAGE_SGIX       0x835F
+#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX     0x8360
+#define GL_MAX_ASYNC_READ_PIXELS_SGIX     0x8361
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_ASYNC_HISTOGRAM_SGIX           0x832C
+#define GL_MAX_ASYNC_HISTOGRAM_SGIX       0x832D
+#endif
+
+#ifndef GL_INTEL_texture_scissor
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_PARALLEL_ARRAYS_INTEL          0x83F4
+#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
+#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
+#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
+#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_OCCLUSION_TEST_HP              0x8165
+#define GL_OCCLUSION_TEST_RESULT_HP       0x8166
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_PIXEL_TRANSFORM_2D_EXT         0x8330
+#define GL_PIXEL_MAG_FILTER_EXT           0x8331
+#define GL_PIXEL_MIN_FILTER_EXT           0x8332
+#define GL_PIXEL_CUBIC_WEIGHT_EXT         0x8333
+#define GL_CUBIC_EXT                      0x8334
+#define GL_AVERAGE_EXT                    0x8335
+#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
+#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
+#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT  0x8338
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_SHARED_TEXTURE_PALETTE_EXT     0x81FB
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT  0x81F8
+#define GL_SINGLE_COLOR_EXT               0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR_EXT    0x81FA
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_COLOR_SUM_EXT                  0x8458
+#define GL_CURRENT_SECONDARY_COLOR_EXT    0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
+#define GL_SECONDARY_COLOR_ARRAY_EXT      0x845E
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_PERTURB_EXT                    0x85AE
+#define GL_TEXTURE_NORMAL_EXT             0x85AF
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_FOG_COORDINATE_SOURCE_EXT      0x8450
+#define GL_FOG_COORDINATE_EXT             0x8451
+#define GL_FRAGMENT_DEPTH_EXT             0x8452
+#define GL_CURRENT_FOG_COORDINATE_EXT     0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT  0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
+#define GL_FOG_COORDINATE_ARRAY_EXT       0x8457
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_SCREEN_COORDINATES_REND        0x8490
+#define GL_INVERTED_SCREEN_W_REND         0x8491
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_TANGENT_ARRAY_EXT              0x8439
+#define GL_BINORMAL_ARRAY_EXT             0x843A
+#define GL_CURRENT_TANGENT_EXT            0x843B
+#define GL_CURRENT_BINORMAL_EXT           0x843C
+#define GL_TANGENT_ARRAY_TYPE_EXT         0x843E
+#define GL_TANGENT_ARRAY_STRIDE_EXT       0x843F
+#define GL_BINORMAL_ARRAY_TYPE_EXT        0x8440
+#define GL_BINORMAL_ARRAY_STRIDE_EXT      0x8441
+#define GL_TANGENT_ARRAY_POINTER_EXT      0x8442
+#define GL_BINORMAL_ARRAY_POINTER_EXT     0x8443
+#define GL_MAP1_TANGENT_EXT               0x8444
+#define GL_MAP2_TANGENT_EXT               0x8445
+#define GL_MAP1_BINORMAL_EXT              0x8446
+#define GL_MAP2_BINORMAL_EXT              0x8447
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_COMBINE_EXT                    0x8570
+#define GL_COMBINE_RGB_EXT                0x8571
+#define GL_COMBINE_ALPHA_EXT              0x8572
+#define GL_RGB_SCALE_EXT                  0x8573
+#define GL_ADD_SIGNED_EXT                 0x8574
+#define GL_INTERPOLATE_EXT                0x8575
+#define GL_CONSTANT_EXT                   0x8576
+#define GL_PRIMARY_COLOR_EXT              0x8577
+#define GL_PREVIOUS_EXT                   0x8578
+#define GL_SOURCE0_RGB_EXT                0x8580
+#define GL_SOURCE1_RGB_EXT                0x8581
+#define GL_SOURCE2_RGB_EXT                0x8582
+#define GL_SOURCE0_ALPHA_EXT              0x8588
+#define GL_SOURCE1_ALPHA_EXT              0x8589
+#define GL_SOURCE2_ALPHA_EXT              0x858A
+#define GL_OPERAND0_RGB_EXT               0x8590
+#define GL_OPERAND1_RGB_EXT               0x8591
+#define GL_OPERAND2_RGB_EXT               0x8592
+#define GL_OPERAND0_ALPHA_EXT             0x8598
+#define GL_OPERAND1_ALPHA_EXT             0x8599
+#define GL_OPERAND2_ALPHA_EXT             0x859A
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_TRANSFORM_HINT_APPLE           0x85B1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_FOG_SCALE_SGIX                 0x81FC
+#define GL_FOG_SCALE_VALUE_SGIX           0x81FD
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_UNPACK_CONSTANT_DATA_SUNX      0x81D5
+#define GL_TEXTURE_CONSTANT_DATA_SUNX     0x81D6
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_GLOBAL_ALPHA_SUN               0x81D9
+#define GL_GLOBAL_ALPHA_FACTOR_SUN        0x81DA
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_RESTART_SUN                    0x0001
+#define GL_REPLACE_MIDDLE_SUN             0x0002
+#define GL_REPLACE_OLDEST_SUN             0x0003
+#define GL_TRIANGLE_LIST_SUN              0x81D7
+#define GL_REPLACEMENT_CODE_SUN           0x81D8
+#define GL_REPLACEMENT_CODE_ARRAY_SUN     0x85C0
+#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
+#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
+#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
+#define GL_R1UI_V3F_SUN                   0x85C4
+#define GL_R1UI_C4UB_V3F_SUN              0x85C5
+#define GL_R1UI_C3F_V3F_SUN               0x85C6
+#define GL_R1UI_N3F_V3F_SUN               0x85C7
+#define GL_R1UI_C4F_N3F_V3F_SUN           0x85C8
+#define GL_R1UI_T2F_V3F_SUN               0x85C9
+#define GL_R1UI_T2F_N3F_V3F_SUN           0x85CA
+#define GL_R1UI_T2F_C4F_N3F_V3F_SUN       0x85CB
+#endif
+
+#ifndef GL_SUN_vertex
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_BLEND_DST_RGB_EXT              0x80C8
+#define GL_BLEND_SRC_RGB_EXT              0x80C9
+#define GL_BLEND_DST_ALPHA_EXT            0x80CA
+#define GL_BLEND_SRC_ALPHA_EXT            0x80CB
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_RED_MIN_CLAMP_INGR             0x8560
+#define GL_GREEN_MIN_CLAMP_INGR           0x8561
+#define GL_BLUE_MIN_CLAMP_INGR            0x8562
+#define GL_ALPHA_MIN_CLAMP_INGR           0x8563
+#define GL_RED_MAX_CLAMP_INGR             0x8564
+#define GL_GREEN_MAX_CLAMP_INGR           0x8565
+#define GL_BLUE_MAX_CLAMP_INGR            0x8566
+#define GL_ALPHA_MAX_CLAMP_INGR           0x8567
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INTERLACE_READ_INGR            0x8568
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_INCR_WRAP_EXT                  0x8507
+#define GL_DECR_WRAP_EXT                  0x8508
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_422_EXT                        0x80CC
+#define GL_422_REV_EXT                    0x80CD
+#define GL_422_AVERAGE_EXT                0x80CE
+#define GL_422_REV_AVERAGE_EXT            0x80CF
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NORMAL_MAP_NV                  0x8511
+#define GL_REFLECTION_MAP_NV              0x8512
+#endif
+
+#ifndef GL_EXT_texture_cube_map
+#define GL_NORMAL_MAP_EXT                 0x8511
+#define GL_REFLECTION_MAP_EXT             0x8512
+#define GL_TEXTURE_CUBE_MAP_EXT           0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_EXT   0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_EXT     0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT  0x851C
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_WRAP_BORDER_SUN                0x81D4
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT       0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT     0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT           0x8501
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_MODELVIEW0_STACK_DEPTH_EXT     GL_MODELVIEW_STACK_DEPTH
+#define GL_MODELVIEW1_STACK_DEPTH_EXT     0x8502
+#define GL_MODELVIEW0_MATRIX_EXT          GL_MODELVIEW_MATRIX
+#define GL_MODELVIEW1_MATRIX_EXT          0x8506
+#define GL_VERTEX_WEIGHTING_EXT           0x8509
+#define GL_MODELVIEW0_EXT                 GL_MODELVIEW
+#define GL_MODELVIEW1_EXT                 0x850A
+#define GL_CURRENT_VERTEX_WEIGHT_EXT      0x850B
+#define GL_VERTEX_WEIGHT_ARRAY_EXT        0x850C
+#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT   0x850D
+#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT   0x850E
+#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
+#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_MAX_SHININESS_NV               0x8504
+#define GL_MAX_SPOT_EXPONENT_NV           0x8505
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_NV          0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV   0x851E
+#define GL_VERTEX_ARRAY_RANGE_VALID_NV    0x851F
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_NV  0x8521
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_REGISTER_COMBINERS_NV          0x8522
+#define GL_VARIABLE_A_NV                  0x8523
+#define GL_VARIABLE_B_NV                  0x8524
+#define GL_VARIABLE_C_NV                  0x8525
+#define GL_VARIABLE_D_NV                  0x8526
+#define GL_VARIABLE_E_NV                  0x8527
+#define GL_VARIABLE_F_NV                  0x8528
+#define GL_VARIABLE_G_NV                  0x8529
+#define GL_CONSTANT_COLOR0_NV             0x852A
+#define GL_CONSTANT_COLOR1_NV             0x852B
+#define GL_PRIMARY_COLOR_NV               0x852C
+#define GL_SECONDARY_COLOR_NV             0x852D
+#define GL_SPARE0_NV                      0x852E
+#define GL_SPARE1_NV                      0x852F
+#define GL_DISCARD_NV                     0x8530
+#define GL_E_TIMES_F_NV                   0x8531
+#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
+#define GL_UNSIGNED_IDENTITY_NV           0x8536
+#define GL_UNSIGNED_INVERT_NV             0x8537
+#define GL_EXPAND_NORMAL_NV               0x8538
+#define GL_EXPAND_NEGATE_NV               0x8539
+#define GL_HALF_BIAS_NORMAL_NV            0x853A
+#define GL_HALF_BIAS_NEGATE_NV            0x853B
+#define GL_SIGNED_IDENTITY_NV             0x853C
+#define GL_SIGNED_NEGATE_NV               0x853D
+#define GL_SCALE_BY_TWO_NV                0x853E
+#define GL_SCALE_BY_FOUR_NV               0x853F
+#define GL_SCALE_BY_ONE_HALF_NV           0x8540
+#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV   0x8541
+#define GL_COMBINER_INPUT_NV              0x8542
+#define GL_COMBINER_MAPPING_NV            0x8543
+#define GL_COMBINER_COMPONENT_USAGE_NV    0x8544
+#define GL_COMBINER_AB_DOT_PRODUCT_NV     0x8545
+#define GL_COMBINER_CD_DOT_PRODUCT_NV     0x8546
+#define GL_COMBINER_MUX_SUM_NV            0x8547
+#define GL_COMBINER_SCALE_NV              0x8548
+#define GL_COMBINER_BIAS_NV               0x8549
+#define GL_COMBINER_AB_OUTPUT_NV          0x854A
+#define GL_COMBINER_CD_OUTPUT_NV          0x854B
+#define GL_COMBINER_SUM_OUTPUT_NV         0x854C
+#define GL_MAX_GENERAL_COMBINERS_NV       0x854D
+#define GL_NUM_GENERAL_COMBINERS_NV       0x854E
+#define GL_COLOR_SUM_CLAMP_NV             0x854F
+#define GL_COMBINER0_NV                   0x8550
+#define GL_COMBINER1_NV                   0x8551
+#define GL_COMBINER2_NV                   0x8552
+#define GL_COMBINER3_NV                   0x8553
+#define GL_COMBINER4_NV                   0x8554
+#define GL_COMBINER5_NV                   0x8555
+#define GL_COMBINER6_NV                   0x8556
+#define GL_COMBINER7_NV                   0x8557
+/* reuse GL_TEXTURE0_ARB */
+/* reuse GL_TEXTURE1_ARB */
+/* reuse GL_ZERO */
+/* reuse GL_NONE */
+/* reuse GL_FOG */
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_FOG_DISTANCE_MODE_NV           0x855A
+#define GL_EYE_RADIAL_NV                  0x855B
+#define GL_EYE_PLANE_ABSOLUTE_NV          0x855C
+/* reuse GL_EYE_PLANE */
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_EMBOSS_LIGHT_NV                0x855D
+#define GL_EMBOSS_CONSTANT_NV             0x855E
+#define GL_EMBOSS_MAP_NV                  0x855F
+#endif
+
+#ifndef GL_NV_blend_square
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_COMBINE4_NV                    0x8503
+#define GL_SOURCE3_RGB_NV                 0x8583
+#define GL_SOURCE3_ALPHA_NV               0x858B
+#define GL_OPERAND3_RGB_NV                0x8593
+#define GL_OPERAND3_ALPHA_NV              0x859B
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#endif
+
+#ifndef GL_MESA_window_pos
+#endif
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  0x83F3
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_CULL_VERTEX_IBM                103050
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_VERTEX_ARRAY_LIST_IBM          103070
+#define GL_NORMAL_ARRAY_LIST_IBM          103071
+#define GL_COLOR_ARRAY_LIST_IBM           103072
+#define GL_INDEX_ARRAY_LIST_IBM           103073
+#define GL_TEXTURE_COORD_ARRAY_LIST_IBM   103074
+#define GL_EDGE_FLAG_ARRAY_LIST_IBM       103075
+#define GL_FOG_COORDINATE_ARRAY_LIST_IBM  103076
+#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
+#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM   103080
+#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM   103081
+#define GL_COLOR_ARRAY_LIST_STRIDE_IBM    103082
+#define GL_INDEX_ARRAY_LIST_STRIDE_IBM    103083
+#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
+#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
+#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
+#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_PACK_SUBSAMPLE_RATE_SGIX       0x85A0
+#define GL_UNPACK_SUBSAMPLE_RATE_SGIX     0x85A1
+#define GL_PIXEL_SUBSAMPLE_4444_SGIX      0x85A2
+#define GL_PIXEL_SUBSAMPLE_2424_SGIX      0x85A3
+#define GL_PIXEL_SUBSAMPLE_4242_SGIX      0x85A4
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_YCRCB_SGIX                     0x8318
+#define GL_YCRCBA_SGIX                    0x8319
+#endif
+
+#ifndef GL_SGI_depth_pass_instrument
+#define GL_DEPTH_PASS_INSTRUMENT_SGIX     0x8310
+#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
+#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_COMPRESSED_RGB_FXT1_3DFX       0x86B0
+#define GL_COMPRESSED_RGBA_FXT1_3DFX      0x86B1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_MULTISAMPLE_3DFX               0x86B2
+#define GL_SAMPLE_BUFFERS_3DFX            0x86B3
+#define GL_SAMPLES_3DFX                   0x86B4
+#define GL_MULTISAMPLE_BIT_3DFX           0x20000000
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_MULTISAMPLE_EXT                0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_EXT       0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_EXT        0x809F
+#define GL_SAMPLE_MASK_EXT                0x80A0
+#define GL_1PASS_EXT                      0x80A1
+#define GL_2PASS_0_EXT                    0x80A2
+#define GL_2PASS_1_EXT                    0x80A3
+#define GL_4PASS_0_EXT                    0x80A4
+#define GL_4PASS_1_EXT                    0x80A5
+#define GL_4PASS_2_EXT                    0x80A6
+#define GL_4PASS_3_EXT                    0x80A7
+#define GL_SAMPLE_BUFFERS_EXT             0x80A8
+#define GL_SAMPLES_EXT                    0x80A9
+#define GL_SAMPLE_MASK_VALUE_EXT          0x80AA
+#define GL_SAMPLE_MASK_INVERT_EXT         0x80AB
+#define GL_SAMPLE_PATTERN_EXT             0x80AC
+#define GL_MULTISAMPLE_BIT_EXT            0x20000000
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_VERTEX_PRECLIP_SGIX            0x83EE
+#define GL_VERTEX_PRECLIP_HINT_SGIX       0x83EF
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_CONVOLUTION_HINT_SGIX          0x8316
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_PACK_RESAMPLE_SGIX             0x842C
+#define GL_UNPACK_RESAMPLE_SGIX           0x842D
+#define GL_RESAMPLE_REPLICATE_SGIX        0x842E
+#define GL_RESAMPLE_ZERO_FILL_SGIX        0x842F
+#define GL_RESAMPLE_DECIMATE_SGIX         0x8430
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_EYE_DISTANCE_TO_POINT_SGIS     0x81F0
+#define GL_OBJECT_DISTANCE_TO_POINT_SGIS  0x81F1
+#define GL_EYE_DISTANCE_TO_LINE_SGIS      0x81F2
+#define GL_OBJECT_DISTANCE_TO_LINE_SGIS   0x81F3
+#define GL_EYE_POINT_SGIS                 0x81F4
+#define GL_OBJECT_POINT_SGIS              0x81F5
+#define GL_EYE_LINE_SGIS                  0x81F6
+#define GL_OBJECT_LINE_SGIS               0x81F7
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_TEXTURE_COLOR_WRITEMASK_SGIS   0x81EF
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_DOT3_RGB_EXT                   0x8740
+#define GL_DOT3_RGBA_EXT                  0x8741
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_MIRROR_CLAMP_ATI               0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_ATI       0x8743
+#endif
+
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV               0x84F2
+#define GL_FENCE_STATUS_NV                0x84F3
+#define GL_FENCE_CONDITION_NV             0x84F4
+#endif
+
+#ifndef GL_IBM_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_IBM            0x8370
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_EVAL_2D_NV                     0x86C0
+#define GL_EVAL_TRIANGULAR_2D_NV          0x86C1
+#define GL_MAP_TESSELLATION_NV            0x86C2
+#define GL_MAP_ATTRIB_U_ORDER_NV          0x86C3
+#define GL_MAP_ATTRIB_V_ORDER_NV          0x86C4
+#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
+#define GL_EVAL_VERTEX_ATTRIB0_NV         0x86C6
+#define GL_EVAL_VERTEX_ATTRIB1_NV         0x86C7
+#define GL_EVAL_VERTEX_ATTRIB2_NV         0x86C8
+#define GL_EVAL_VERTEX_ATTRIB3_NV         0x86C9
+#define GL_EVAL_VERTEX_ATTRIB4_NV         0x86CA
+#define GL_EVAL_VERTEX_ATTRIB5_NV         0x86CB
+#define GL_EVAL_VERTEX_ATTRIB6_NV         0x86CC
+#define GL_EVAL_VERTEX_ATTRIB7_NV         0x86CD
+#define GL_EVAL_VERTEX_ATTRIB8_NV         0x86CE
+#define GL_EVAL_VERTEX_ATTRIB9_NV         0x86CF
+#define GL_EVAL_VERTEX_ATTRIB10_NV        0x86D0
+#define GL_EVAL_VERTEX_ATTRIB11_NV        0x86D1
+#define GL_EVAL_VERTEX_ATTRIB12_NV        0x86D2
+#define GL_EVAL_VERTEX_ATTRIB13_NV        0x86D3
+#define GL_EVAL_VERTEX_ATTRIB14_NV        0x86D4
+#define GL_EVAL_VERTEX_ATTRIB15_NV        0x86D5
+#define GL_MAX_MAP_TESSELLATION_NV        0x86D6
+#define GL_MAX_RATIONAL_EVAL_ORDER_NV     0x86D7
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_DEPTH_STENCIL_NV               0x84F9
+#define GL_UNSIGNED_INT_24_8_NV           0x84FA
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_PER_STAGE_CONSTANTS_NV         0x8535
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_NV           0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_NV   0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_NV     0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV  0x84F8
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_OFFSET_TEXTURE_RECTANGLE_NV    0x864C
+#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
+#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
+#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
+#define GL_UNSIGNED_INT_S8_S8_8_8_NV      0x86DA
+#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV  0x86DB
+#define GL_DSDT_MAG_INTENSITY_NV          0x86DC
+#define GL_SHADER_CONSISTENT_NV           0x86DD
+#define GL_TEXTURE_SHADER_NV              0x86DE
+#define GL_SHADER_OPERATION_NV            0x86DF
+#define GL_CULL_MODES_NV                  0x86E0
+#define GL_OFFSET_TEXTURE_MATRIX_NV       0x86E1
+#define GL_OFFSET_TEXTURE_SCALE_NV        0x86E2
+#define GL_OFFSET_TEXTURE_BIAS_NV         0x86E3
+#define GL_OFFSET_TEXTURE_2D_MATRIX_NV    GL_OFFSET_TEXTURE_MATRIX_NV
+#define GL_OFFSET_TEXTURE_2D_SCALE_NV     GL_OFFSET_TEXTURE_SCALE_NV
+#define GL_OFFSET_TEXTURE_2D_BIAS_NV      GL_OFFSET_TEXTURE_BIAS_NV
+#define GL_PREVIOUS_TEXTURE_INPUT_NV      0x86E4
+#define GL_CONST_EYE_NV                   0x86E5
+#define GL_PASS_THROUGH_NV                0x86E6
+#define GL_CULL_FRAGMENT_NV               0x86E7
+#define GL_OFFSET_TEXTURE_2D_NV           0x86E8
+#define GL_DEPENDENT_AR_TEXTURE_2D_NV     0x86E9
+#define GL_DEPENDENT_GB_TEXTURE_2D_NV     0x86EA
+#define GL_DOT_PRODUCT_NV                 0x86EC
+#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV   0x86ED
+#define GL_DOT_PRODUCT_TEXTURE_2D_NV      0x86EE
+#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
+#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
+#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
+#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
+#define GL_HILO_NV                        0x86F4
+#define GL_DSDT_NV                        0x86F5
+#define GL_DSDT_MAG_NV                    0x86F6
+#define GL_DSDT_MAG_VIB_NV                0x86F7
+#define GL_HILO16_NV                      0x86F8
+#define GL_SIGNED_HILO_NV                 0x86F9
+#define GL_SIGNED_HILO16_NV               0x86FA
+#define GL_SIGNED_RGBA_NV                 0x86FB
+#define GL_SIGNED_RGBA8_NV                0x86FC
+#define GL_SIGNED_RGB_NV                  0x86FE
+#define GL_SIGNED_RGB8_NV                 0x86FF
+#define GL_SIGNED_LUMINANCE_NV            0x8701
+#define GL_SIGNED_LUMINANCE8_NV           0x8702
+#define GL_SIGNED_LUMINANCE_ALPHA_NV      0x8703
+#define GL_SIGNED_LUMINANCE8_ALPHA8_NV    0x8704
+#define GL_SIGNED_ALPHA_NV                0x8705
+#define GL_SIGNED_ALPHA8_NV               0x8706
+#define GL_SIGNED_INTENSITY_NV            0x8707
+#define GL_SIGNED_INTENSITY8_NV           0x8708
+#define GL_DSDT8_NV                       0x8709
+#define GL_DSDT8_MAG8_NV                  0x870A
+#define GL_DSDT8_MAG8_INTENSITY8_NV       0x870B
+#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV   0x870C
+#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
+#define GL_HI_SCALE_NV                    0x870E
+#define GL_LO_SCALE_NV                    0x870F
+#define GL_DS_SCALE_NV                    0x8710
+#define GL_DT_SCALE_NV                    0x8711
+#define GL_MAGNITUDE_SCALE_NV             0x8712
+#define GL_VIBRANCE_SCALE_NV              0x8713
+#define GL_HI_BIAS_NV                     0x8714
+#define GL_LO_BIAS_NV                     0x8715
+#define GL_DS_BIAS_NV                     0x8716
+#define GL_DT_BIAS_NV                     0x8717
+#define GL_MAGNITUDE_BIAS_NV              0x8718
+#define GL_VIBRANCE_BIAS_NV               0x8719
+#define GL_TEXTURE_BORDER_VALUES_NV       0x871A
+#define GL_TEXTURE_HI_SIZE_NV             0x871B
+#define GL_TEXTURE_LO_SIZE_NV             0x871C
+#define GL_TEXTURE_DS_SIZE_NV             0x871D
+#define GL_TEXTURE_DT_SIZE_NV             0x871E
+#define GL_TEXTURE_MAG_SIZE_NV            0x871F
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_DOT_PRODUCT_TEXTURE_3D_NV      0x86EF
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_VERTEX_PROGRAM_NV              0x8620
+#define GL_VERTEX_STATE_PROGRAM_NV        0x8621
+#define GL_ATTRIB_ARRAY_SIZE_NV           0x8623
+#define GL_ATTRIB_ARRAY_STRIDE_NV         0x8624
+#define GL_ATTRIB_ARRAY_TYPE_NV           0x8625
+#define GL_CURRENT_ATTRIB_NV              0x8626
+#define GL_PROGRAM_LENGTH_NV              0x8627
+#define GL_PROGRAM_STRING_NV              0x8628
+#define GL_MODELVIEW_PROJECTION_NV        0x8629
+#define GL_IDENTITY_NV                    0x862A
+#define GL_INVERSE_NV                     0x862B
+#define GL_TRANSPOSE_NV                   0x862C
+#define GL_INVERSE_TRANSPOSE_NV           0x862D
+#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
+#define GL_MAX_TRACK_MATRICES_NV          0x862F
+#define GL_MATRIX0_NV                     0x8630
+#define GL_MATRIX1_NV                     0x8631
+#define GL_MATRIX2_NV                     0x8632
+#define GL_MATRIX3_NV                     0x8633
+#define GL_MATRIX4_NV                     0x8634
+#define GL_MATRIX5_NV                     0x8635
+#define GL_MATRIX6_NV                     0x8636
+#define GL_MATRIX7_NV                     0x8637
+#define GL_CURRENT_MATRIX_STACK_DEPTH_NV  0x8640
+#define GL_CURRENT_MATRIX_NV              0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_NV   0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_NV     0x8643
+#define GL_PROGRAM_PARAMETER_NV           0x8644
+#define GL_ATTRIB_ARRAY_POINTER_NV        0x8645
+#define GL_PROGRAM_TARGET_NV              0x8646
+#define GL_PROGRAM_RESIDENT_NV            0x8647
+#define GL_TRACK_MATRIX_NV                0x8648
+#define GL_TRACK_MATRIX_TRANSFORM_NV      0x8649
+#define GL_VERTEX_PROGRAM_BINDING_NV      0x864A
+#define GL_PROGRAM_ERROR_POSITION_NV      0x864B
+#define GL_VERTEX_ATTRIB_ARRAY0_NV        0x8650
+#define GL_VERTEX_ATTRIB_ARRAY1_NV        0x8651
+#define GL_VERTEX_ATTRIB_ARRAY2_NV        0x8652
+#define GL_VERTEX_ATTRIB_ARRAY3_NV        0x8653
+#define GL_VERTEX_ATTRIB_ARRAY4_NV        0x8654
+#define GL_VERTEX_ATTRIB_ARRAY5_NV        0x8655
+#define GL_VERTEX_ATTRIB_ARRAY6_NV        0x8656
+#define GL_VERTEX_ATTRIB_ARRAY7_NV        0x8657
+#define GL_VERTEX_ATTRIB_ARRAY8_NV        0x8658
+#define GL_VERTEX_ATTRIB_ARRAY9_NV        0x8659
+#define GL_VERTEX_ATTRIB_ARRAY10_NV       0x865A
+#define GL_VERTEX_ATTRIB_ARRAY11_NV       0x865B
+#define GL_VERTEX_ATTRIB_ARRAY12_NV       0x865C
+#define GL_VERTEX_ATTRIB_ARRAY13_NV       0x865D
+#define GL_VERTEX_ATTRIB_ARRAY14_NV       0x865E
+#define GL_VERTEX_ATTRIB_ARRAY15_NV       0x865F
+#define GL_MAP1_VERTEX_ATTRIB0_4_NV       0x8660
+#define GL_MAP1_VERTEX_ATTRIB1_4_NV       0x8661
+#define GL_MAP1_VERTEX_ATTRIB2_4_NV       0x8662
+#define GL_MAP1_VERTEX_ATTRIB3_4_NV       0x8663
+#define GL_MAP1_VERTEX_ATTRIB4_4_NV       0x8664
+#define GL_MAP1_VERTEX_ATTRIB5_4_NV       0x8665
+#define GL_MAP1_VERTEX_ATTRIB6_4_NV       0x8666
+#define GL_MAP1_VERTEX_ATTRIB7_4_NV       0x8667
+#define GL_MAP1_VERTEX_ATTRIB8_4_NV       0x8668
+#define GL_MAP1_VERTEX_ATTRIB9_4_NV       0x8669
+#define GL_MAP1_VERTEX_ATTRIB10_4_NV      0x866A
+#define GL_MAP1_VERTEX_ATTRIB11_4_NV      0x866B
+#define GL_MAP1_VERTEX_ATTRIB12_4_NV      0x866C
+#define GL_MAP1_VERTEX_ATTRIB13_4_NV      0x866D
+#define GL_MAP1_VERTEX_ATTRIB14_4_NV      0x866E
+#define GL_MAP1_VERTEX_ATTRIB15_4_NV      0x866F
+#define GL_MAP2_VERTEX_ATTRIB0_4_NV       0x8670
+#define GL_MAP2_VERTEX_ATTRIB1_4_NV       0x8671
+#define GL_MAP2_VERTEX_ATTRIB2_4_NV       0x8672
+#define GL_MAP2_VERTEX_ATTRIB3_4_NV       0x8673
+#define GL_MAP2_VERTEX_ATTRIB4_4_NV       0x8674
+#define GL_MAP2_VERTEX_ATTRIB5_4_NV       0x8675
+#define GL_MAP2_VERTEX_ATTRIB6_4_NV       0x8676
+#define GL_MAP2_VERTEX_ATTRIB7_4_NV       0x8677
+#define GL_MAP2_VERTEX_ATTRIB8_4_NV       0x8678
+#define GL_MAP2_VERTEX_ATTRIB9_4_NV       0x8679
+#define GL_MAP2_VERTEX_ATTRIB10_4_NV      0x867A
+#define GL_MAP2_VERTEX_ATTRIB11_4_NV      0x867B
+#define GL_MAP2_VERTEX_ATTRIB12_4_NV      0x867C
+#define GL_MAP2_VERTEX_ATTRIB13_4_NV      0x867D
+#define GL_MAP2_VERTEX_ATTRIB14_4_NV      0x867E
+#define GL_MAP2_VERTEX_ATTRIB15_4_NV      0x867F
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_TEXTURE_MAX_CLAMP_S_SGIX       0x8369
+#define GL_TEXTURE_MAX_CLAMP_T_SGIX       0x836A
+#define GL_TEXTURE_MAX_CLAMP_R_SGIX       0x836B
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SCALEBIAS_HINT_SGIX            0x8322
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_INTERLACE_OML                  0x8980
+#define GL_INTERLACE_READ_OML             0x8981
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_FORMAT_SUBSAMPLE_24_24_OML     0x8982
+#define GL_FORMAT_SUBSAMPLE_244_244_OML   0x8983
+#endif
+
+#ifndef GL_OML_resample
+#define GL_PACK_RESAMPLE_OML              0x8984
+#define GL_UNPACK_RESAMPLE_OML            0x8985
+#define GL_RESAMPLE_REPLICATE_OML         0x8986
+#define GL_RESAMPLE_ZERO_FILL_OML         0x8987
+#define GL_RESAMPLE_AVERAGE_OML           0x8988
+#define GL_RESAMPLE_DECIMATE_OML          0x8989
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_DEPTH_STENCIL_TO_RGBA_NV       0x886E
+#define GL_DEPTH_STENCIL_TO_BGRA_NV       0x886F
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_BUMP_ROT_MATRIX_ATI            0x8775
+#define GL_BUMP_ROT_MATRIX_SIZE_ATI       0x8776
+#define GL_BUMP_NUM_TEX_UNITS_ATI         0x8777
+#define GL_BUMP_TEX_UNITS_ATI             0x8778
+#define GL_DUDV_ATI                       0x8779
+#define GL_DU8DV8_ATI                     0x877A
+#define GL_BUMP_ENVMAP_ATI                0x877B
+#define GL_BUMP_TARGET_ATI                0x877C
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_FRAGMENT_SHADER_ATI            0x8920
+#define GL_REG_0_ATI                      0x8921
+#define GL_REG_1_ATI                      0x8922
+#define GL_REG_2_ATI                      0x8923
+#define GL_REG_3_ATI                      0x8924
+#define GL_REG_4_ATI                      0x8925
+#define GL_REG_5_ATI                      0x8926
+#define GL_REG_6_ATI                      0x8927
+#define GL_REG_7_ATI                      0x8928
+#define GL_REG_8_ATI                      0x8929
+#define GL_REG_9_ATI                      0x892A
+#define GL_REG_10_ATI                     0x892B
+#define GL_REG_11_ATI                     0x892C
+#define GL_REG_12_ATI                     0x892D
+#define GL_REG_13_ATI                     0x892E
+#define GL_REG_14_ATI                     0x892F
+#define GL_REG_15_ATI                     0x8930
+#define GL_REG_16_ATI                     0x8931
+#define GL_REG_17_ATI                     0x8932
+#define GL_REG_18_ATI                     0x8933
+#define GL_REG_19_ATI                     0x8934
+#define GL_REG_20_ATI                     0x8935
+#define GL_REG_21_ATI                     0x8936
+#define GL_REG_22_ATI                     0x8937
+#define GL_REG_23_ATI                     0x8938
+#define GL_REG_24_ATI                     0x8939
+#define GL_REG_25_ATI                     0x893A
+#define GL_REG_26_ATI                     0x893B
+#define GL_REG_27_ATI                     0x893C
+#define GL_REG_28_ATI                     0x893D
+#define GL_REG_29_ATI                     0x893E
+#define GL_REG_30_ATI                     0x893F
+#define GL_REG_31_ATI                     0x8940
+#define GL_CON_0_ATI                      0x8941
+#define GL_CON_1_ATI                      0x8942
+#define GL_CON_2_ATI                      0x8943
+#define GL_CON_3_ATI                      0x8944
+#define GL_CON_4_ATI                      0x8945
+#define GL_CON_5_ATI                      0x8946
+#define GL_CON_6_ATI                      0x8947
+#define GL_CON_7_ATI                      0x8948
+#define GL_CON_8_ATI                      0x8949
+#define GL_CON_9_ATI                      0x894A
+#define GL_CON_10_ATI                     0x894B
+#define GL_CON_11_ATI                     0x894C
+#define GL_CON_12_ATI                     0x894D
+#define GL_CON_13_ATI                     0x894E
+#define GL_CON_14_ATI                     0x894F
+#define GL_CON_15_ATI                     0x8950
+#define GL_CON_16_ATI                     0x8951
+#define GL_CON_17_ATI                     0x8952
+#define GL_CON_18_ATI                     0x8953
+#define GL_CON_19_ATI                     0x8954
+#define GL_CON_20_ATI                     0x8955
+#define GL_CON_21_ATI                     0x8956
+#define GL_CON_22_ATI                     0x8957
+#define GL_CON_23_ATI                     0x8958
+#define GL_CON_24_ATI                     0x8959
+#define GL_CON_25_ATI                     0x895A
+#define GL_CON_26_ATI                     0x895B
+#define GL_CON_27_ATI                     0x895C
+#define GL_CON_28_ATI                     0x895D
+#define GL_CON_29_ATI                     0x895E
+#define GL_CON_30_ATI                     0x895F
+#define GL_CON_31_ATI                     0x8960
+#define GL_MOV_ATI                        0x8961
+#define GL_ADD_ATI                        0x8963
+#define GL_MUL_ATI                        0x8964
+#define GL_SUB_ATI                        0x8965
+#define GL_DOT3_ATI                       0x8966
+#define GL_DOT4_ATI                       0x8967
+#define GL_MAD_ATI                        0x8968
+#define GL_LERP_ATI                       0x8969
+#define GL_CND_ATI                        0x896A
+#define GL_CND0_ATI                       0x896B
+#define GL_DOT2_ADD_ATI                   0x896C
+#define GL_SECONDARY_INTERPOLATOR_ATI     0x896D
+#define GL_NUM_FRAGMENT_REGISTERS_ATI     0x896E
+#define GL_NUM_FRAGMENT_CONSTANTS_ATI     0x896F
+#define GL_NUM_PASSES_ATI                 0x8970
+#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI  0x8971
+#define GL_NUM_INSTRUCTIONS_TOTAL_ATI     0x8972
+#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
+#define GL_NUM_LOOPBACK_COMPONENTS_ATI    0x8974
+#define GL_COLOR_ALPHA_PAIRING_ATI        0x8975
+#define GL_SWIZZLE_STR_ATI                0x8976
+#define GL_SWIZZLE_STQ_ATI                0x8977
+#define GL_SWIZZLE_STR_DR_ATI             0x8978
+#define GL_SWIZZLE_STQ_DQ_ATI             0x8979
+#define GL_SWIZZLE_STRQ_ATI               0x897A
+#define GL_SWIZZLE_STRQ_DQ_ATI            0x897B
+#define GL_RED_BIT_ATI                    0x00000001
+#define GL_GREEN_BIT_ATI                  0x00000002
+#define GL_BLUE_BIT_ATI                   0x00000004
+#define GL_2X_BIT_ATI                     0x00000001
+#define GL_4X_BIT_ATI                     0x00000002
+#define GL_8X_BIT_ATI                     0x00000004
+#define GL_HALF_BIT_ATI                   0x00000008
+#define GL_QUARTER_BIT_ATI                0x00000010
+#define GL_EIGHTH_BIT_ATI                 0x00000020
+#define GL_SATURATE_BIT_ATI               0x00000040
+#define GL_COMP_BIT_ATI                   0x00000002
+#define GL_NEGATE_BIT_ATI                 0x00000004
+#define GL_BIAS_BIT_ATI                   0x00000008
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_PN_TRIANGLES_ATI               0x87F0
+#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
+#define GL_PN_TRIANGLES_POINT_MODE_ATI    0x87F2
+#define GL_PN_TRIANGLES_NORMAL_MODE_ATI   0x87F3
+#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
+#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
+#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
+#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
+#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_STATIC_ATI                     0x8760
+#define GL_DYNAMIC_ATI                    0x8761
+#define GL_PRESERVE_ATI                   0x8762
+#define GL_DISCARD_ATI                    0x8763
+#define GL_OBJECT_BUFFER_SIZE_ATI         0x8764
+#define GL_OBJECT_BUFFER_USAGE_ATI        0x8765
+#define GL_ARRAY_OBJECT_BUFFER_ATI        0x8766
+#define GL_ARRAY_OBJECT_OFFSET_ATI        0x8767
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_VERTEX_SHADER_EXT              0x8780
+#define GL_VERTEX_SHADER_BINDING_EXT      0x8781
+#define GL_OP_INDEX_EXT                   0x8782
+#define GL_OP_NEGATE_EXT                  0x8783
+#define GL_OP_DOT3_EXT                    0x8784
+#define GL_OP_DOT4_EXT                    0x8785
+#define GL_OP_MUL_EXT                     0x8786
+#define GL_OP_ADD_EXT                     0x8787
+#define GL_OP_MADD_EXT                    0x8788
+#define GL_OP_FRAC_EXT                    0x8789
+#define GL_OP_MAX_EXT                     0x878A
+#define GL_OP_MIN_EXT                     0x878B
+#define GL_OP_SET_GE_EXT                  0x878C
+#define GL_OP_SET_LT_EXT                  0x878D
+#define GL_OP_CLAMP_EXT                   0x878E
+#define GL_OP_FLOOR_EXT                   0x878F
+#define GL_OP_ROUND_EXT                   0x8790
+#define GL_OP_EXP_BASE_2_EXT              0x8791
+#define GL_OP_LOG_BASE_2_EXT              0x8792
+#define GL_OP_POWER_EXT                   0x8793
+#define GL_OP_RECIP_EXT                   0x8794
+#define GL_OP_RECIP_SQRT_EXT              0x8795
+#define GL_OP_SUB_EXT                     0x8796
+#define GL_OP_CROSS_PRODUCT_EXT           0x8797
+#define GL_OP_MULTIPLY_MATRIX_EXT         0x8798
+#define GL_OP_MOV_EXT                     0x8799
+#define GL_OUTPUT_VERTEX_EXT              0x879A
+#define GL_OUTPUT_COLOR0_EXT              0x879B
+#define GL_OUTPUT_COLOR1_EXT              0x879C
+#define GL_OUTPUT_TEXTURE_COORD0_EXT      0x879D
+#define GL_OUTPUT_TEXTURE_COORD1_EXT      0x879E
+#define GL_OUTPUT_TEXTURE_COORD2_EXT      0x879F
+#define GL_OUTPUT_TEXTURE_COORD3_EXT      0x87A0
+#define GL_OUTPUT_TEXTURE_COORD4_EXT      0x87A1
+#define GL_OUTPUT_TEXTURE_COORD5_EXT      0x87A2
+#define GL_OUTPUT_TEXTURE_COORD6_EXT      0x87A3
+#define GL_OUTPUT_TEXTURE_COORD7_EXT      0x87A4
+#define GL_OUTPUT_TEXTURE_COORD8_EXT      0x87A5
+#define GL_OUTPUT_TEXTURE_COORD9_EXT      0x87A6
+#define GL_OUTPUT_TEXTURE_COORD10_EXT     0x87A7
+#define GL_OUTPUT_TEXTURE_COORD11_EXT     0x87A8
+#define GL_OUTPUT_TEXTURE_COORD12_EXT     0x87A9
+#define GL_OUTPUT_TEXTURE_COORD13_EXT     0x87AA
+#define GL_OUTPUT_TEXTURE_COORD14_EXT     0x87AB
+#define GL_OUTPUT_TEXTURE_COORD15_EXT     0x87AC
+#define GL_OUTPUT_TEXTURE_COORD16_EXT     0x87AD
+#define GL_OUTPUT_TEXTURE_COORD17_EXT     0x87AE
+#define GL_OUTPUT_TEXTURE_COORD18_EXT     0x87AF
+#define GL_OUTPUT_TEXTURE_COORD19_EXT     0x87B0
+#define GL_OUTPUT_TEXTURE_COORD20_EXT     0x87B1
+#define GL_OUTPUT_TEXTURE_COORD21_EXT     0x87B2
+#define GL_OUTPUT_TEXTURE_COORD22_EXT     0x87B3
+#define GL_OUTPUT_TEXTURE_COORD23_EXT     0x87B4
+#define GL_OUTPUT_TEXTURE_COORD24_EXT     0x87B5
+#define GL_OUTPUT_TEXTURE_COORD25_EXT     0x87B6
+#define GL_OUTPUT_TEXTURE_COORD26_EXT     0x87B7
+#define GL_OUTPUT_TEXTURE_COORD27_EXT     0x87B8
+#define GL_OUTPUT_TEXTURE_COORD28_EXT     0x87B9
+#define GL_OUTPUT_TEXTURE_COORD29_EXT     0x87BA
+#define GL_OUTPUT_TEXTURE_COORD30_EXT     0x87BB
+#define GL_OUTPUT_TEXTURE_COORD31_EXT     0x87BC
+#define GL_OUTPUT_FOG_EXT                 0x87BD
+#define GL_SCALAR_EXT                     0x87BE
+#define GL_VECTOR_EXT                     0x87BF
+#define GL_MATRIX_EXT                     0x87C0
+#define GL_VARIANT_EXT                    0x87C1
+#define GL_INVARIANT_EXT                  0x87C2
+#define GL_LOCAL_CONSTANT_EXT             0x87C3
+#define GL_LOCAL_EXT                      0x87C4
+#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
+#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
+#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
+#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
+#define GL_MAX_VERTEX_SHADER_LOCALS_EXT   0x87C9
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
+#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
+#define GL_VERTEX_SHADER_VARIANTS_EXT     0x87D0
+#define GL_VERTEX_SHADER_INVARIANTS_EXT   0x87D1
+#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
+#define GL_VERTEX_SHADER_LOCALS_EXT       0x87D3
+#define GL_VERTEX_SHADER_OPTIMIZED_EXT    0x87D4
+#define GL_X_EXT                          0x87D5
+#define GL_Y_EXT                          0x87D6
+#define GL_Z_EXT                          0x87D7
+#define GL_W_EXT                          0x87D8
+#define GL_NEGATIVE_X_EXT                 0x87D9
+#define GL_NEGATIVE_Y_EXT                 0x87DA
+#define GL_NEGATIVE_Z_EXT                 0x87DB
+#define GL_NEGATIVE_W_EXT                 0x87DC
+#define GL_ZERO_EXT                       0x87DD
+#define GL_ONE_EXT                        0x87DE
+#define GL_NEGATIVE_ONE_EXT               0x87DF
+#define GL_NORMALIZED_RANGE_EXT           0x87E0
+#define GL_FULL_RANGE_EXT                 0x87E1
+#define GL_CURRENT_VERTEX_EXT             0x87E2
+#define GL_MVP_MATRIX_EXT                 0x87E3
+#define GL_VARIANT_VALUE_EXT              0x87E4
+#define GL_VARIANT_DATATYPE_EXT           0x87E5
+#define GL_VARIANT_ARRAY_STRIDE_EXT       0x87E6
+#define GL_VARIANT_ARRAY_TYPE_EXT         0x87E7
+#define GL_VARIANT_ARRAY_EXT              0x87E8
+#define GL_VARIANT_ARRAY_POINTER_EXT      0x87E9
+#define GL_INVARIANT_VALUE_EXT            0x87EA
+#define GL_INVARIANT_DATATYPE_EXT         0x87EB
+#define GL_LOCAL_CONSTANT_VALUE_EXT       0x87EC
+#define GL_LOCAL_CONSTANT_DATATYPE_EXT    0x87ED
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_MAX_VERTEX_STREAMS_ATI         0x876B
+#define GL_VERTEX_STREAM0_ATI             0x876C
+#define GL_VERTEX_STREAM1_ATI             0x876D
+#define GL_VERTEX_STREAM2_ATI             0x876E
+#define GL_VERTEX_STREAM3_ATI             0x876F
+#define GL_VERTEX_STREAM4_ATI             0x8770
+#define GL_VERTEX_STREAM5_ATI             0x8771
+#define GL_VERTEX_STREAM6_ATI             0x8772
+#define GL_VERTEX_STREAM7_ATI             0x8773
+#define GL_VERTEX_SOURCE_ATI              0x8774
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ELEMENT_ARRAY_ATI              0x8768
+#define GL_ELEMENT_ARRAY_TYPE_ATI         0x8769
+#define GL_ELEMENT_ARRAY_POINTER_ATI      0x876A
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_QUAD_MESH_SUN                  0x8614
+#define GL_TRIANGLE_MESH_SUN              0x8615
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SLICE_ACCUM_SUN                0x85CC
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_MULTISAMPLE_FILTER_HINT_NV     0x8534
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_DEPTH_CLAMP_NV                 0x864F
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_PIXEL_COUNTER_BITS_NV          0x8864
+#define GL_CURRENT_OCCLUSION_QUERY_ID_NV  0x8865
+#define GL_PIXEL_COUNT_NV                 0x8866
+#define GL_PIXEL_COUNT_AVAILABLE_NV       0x8867
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_POINT_SPRITE_NV                0x8861
+#define GL_COORD_REPLACE_NV               0x8862
+#define GL_POINT_SPRITE_R_MODE_NV         0x8863
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
+#define GL_OFFSET_HILO_TEXTURE_2D_NV      0x8854
+#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
+#define GL_DEPENDENT_HILO_TEXTURE_2D_NV   0x8858
+#define GL_DEPENDENT_RGB_TEXTURE_3D_NV    0x8859
+#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
+#define GL_DOT_PRODUCT_PASS_THROUGH_NV    0x885B
+#define GL_DOT_PRODUCT_TEXTURE_1D_NV      0x885C
+#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
+#define GL_HILO8_NV                       0x885E
+#define GL_SIGNED_HILO8_NV                0x885F
+#define GL_FORCE_BLUE_TO_ONE_NV           0x8860
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_STENCIL_TEST_TWO_SIDE_EXT      0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT        0x8911
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_TEXT_FRAGMENT_SHADER_ATI       0x8200
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_UNPACK_CLIENT_STORAGE_APPLE    0x85B2
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_ELEMENT_ARRAY_APPLE            0x8768
+#define GL_ELEMENT_ARRAY_TYPE_APPLE       0x8769
+#define GL_ELEMENT_ARRAY_POINTER_APPLE    0x876A
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_DRAW_PIXELS_APPLE              0x8A0A
+#define GL_FENCE_APPLE                    0x8A0B
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_APPLE     0x85B5
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_APPLE       0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
+#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
+#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
+#define GL_STORAGE_CACHED_APPLE           0x85BE
+#define GL_STORAGE_SHARED_APPLE           0x85BF
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_YCBCR_422_APPLE                0x85B9
+#define GL_UNSIGNED_SHORT_8_8_APPLE       0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE   0x85BB
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_RGB_S3TC                       0x83A0
+#define GL_RGB4_S3TC                      0x83A1
+#define GL_RGBA_S3TC                      0x83A2
+#define GL_RGBA4_S3TC                     0x83A3
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ATI           0x8824
+#define GL_DRAW_BUFFER0_ATI               0x8825
+#define GL_DRAW_BUFFER1_ATI               0x8826
+#define GL_DRAW_BUFFER2_ATI               0x8827
+#define GL_DRAW_BUFFER3_ATI               0x8828
+#define GL_DRAW_BUFFER4_ATI               0x8829
+#define GL_DRAW_BUFFER5_ATI               0x882A
+#define GL_DRAW_BUFFER6_ATI               0x882B
+#define GL_DRAW_BUFFER7_ATI               0x882C
+#define GL_DRAW_BUFFER8_ATI               0x882D
+#define GL_DRAW_BUFFER9_ATI               0x882E
+#define GL_DRAW_BUFFER10_ATI              0x882F
+#define GL_DRAW_BUFFER11_ATI              0x8830
+#define GL_DRAW_BUFFER12_ATI              0x8831
+#define GL_DRAW_BUFFER13_ATI              0x8832
+#define GL_DRAW_BUFFER14_ATI              0x8833
+#define GL_DRAW_BUFFER15_ATI              0x8834
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_TYPE_RGBA_FLOAT_ATI            0x8820
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_MODULATE_ADD_ATI               0x8744
+#define GL_MODULATE_SIGNED_ADD_ATI        0x8745
+#define GL_MODULATE_SUBTRACT_ATI          0x8746
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_RGBA_FLOAT32_ATI               0x8814
+#define GL_RGB_FLOAT32_ATI                0x8815
+#define GL_ALPHA_FLOAT32_ATI              0x8816
+#define GL_INTENSITY_FLOAT32_ATI          0x8817
+#define GL_LUMINANCE_FLOAT32_ATI          0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_ATI    0x8819
+#define GL_RGBA_FLOAT16_ATI               0x881A
+#define GL_RGB_FLOAT16_ATI                0x881B
+#define GL_ALPHA_FLOAT16_ATI              0x881C
+#define GL_INTENSITY_FLOAT16_ATI          0x881D
+#define GL_LUMINANCE_FLOAT16_ATI          0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_ATI    0x881F
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_FLOAT_R_NV                     0x8880
+#define GL_FLOAT_RG_NV                    0x8881
+#define GL_FLOAT_RGB_NV                   0x8882
+#define GL_FLOAT_RGBA_NV                  0x8883
+#define GL_FLOAT_R16_NV                   0x8884
+#define GL_FLOAT_R32_NV                   0x8885
+#define GL_FLOAT_RG16_NV                  0x8886
+#define GL_FLOAT_RG32_NV                  0x8887
+#define GL_FLOAT_RGB16_NV                 0x8888
+#define GL_FLOAT_RGB32_NV                 0x8889
+#define GL_FLOAT_RGBA16_NV                0x888A
+#define GL_FLOAT_RGBA32_NV                0x888B
+#define GL_TEXTURE_FLOAT_COMPONENTS_NV    0x888C
+#define GL_FLOAT_CLEAR_COLOR_VALUE_NV     0x888D
+#define GL_FLOAT_RGBA_MODE_NV             0x888E
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
+#define GL_FRAGMENT_PROGRAM_NV            0x8870
+#define GL_MAX_TEXTURE_COORDS_NV          0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_NV     0x8872
+#define GL_FRAGMENT_PROGRAM_BINDING_NV    0x8873
+#define GL_PROGRAM_ERROR_STRING_NV        0x8874
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_HALF_FLOAT_NV                  0x140B
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_WRITE_PIXEL_DATA_RANGE_NV      0x8878
+#define GL_READ_PIXEL_DATA_RANGE_NV       0x8879
+#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
+#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
+#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
+#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_PRIMITIVE_RESTART_NV           0x8558
+#define GL_PRIMITIVE_RESTART_INDEX_NV     0x8559
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
+#endif
+
+#ifndef GL_NV_vertex_program2
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_STENCIL_BACK_FUNC_ATI          0x8800
+#define GL_STENCIL_BACK_FAIL_ATI          0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_DEPTH_BOUNDS_TEST_EXT          0x8890
+#define GL_DEPTH_BOUNDS_EXT               0x8891
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_MIRROR_CLAMP_EXT               0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT       0x8743
+#define GL_MIRROR_CLAMP_TO_BORDER_EXT     0x8912
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_BLEND_EQUATION_RGB_EXT         GL_BLEND_EQUATION
+#define GL_BLEND_EQUATION_ALPHA_EXT       0x883D
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_PACK_INVERT_MESA               0x8758
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_UNSIGNED_SHORT_8_8_MESA        0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA    0x85BB
+#define GL_YCBCR_MESA                     0x8757
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_EXT          0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_EXT        0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_EXT  0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
+#define GL_MAX_PROGRAM_CALL_DEPTH_NV      0x88F5
+#define GL_MAX_PROGRAM_IF_DEPTH_NV        0x88F6
+#define GL_MAX_PROGRAM_LOOP_DEPTH_NV      0x88F7
+#define GL_MAX_PROGRAM_LOOP_COUNT_NV      0x88F8
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
+#endif
+
+#ifndef GL_NV_vertex_program3
+/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#define GL_MAX_RENDERBUFFER_SIZE_EXT      0x84E8
+#define GL_FRAMEBUFFER_BINDING_EXT        0x8CA6
+#define GL_RENDERBUFFER_BINDING_EXT       0x8CA7
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE_EXT       0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT    0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS_EXT      0x8CDF
+#define GL_COLOR_ATTACHMENT0_EXT          0x8CE0
+#define GL_COLOR_ATTACHMENT1_EXT          0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT          0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT          0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT          0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT          0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT          0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT          0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT          0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT          0x8CE9
+#define GL_COLOR_ATTACHMENT10_EXT         0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT         0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT         0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT         0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT         0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT         0x8CEF
+#define GL_DEPTH_ATTACHMENT_EXT           0x8D00
+#define GL_STENCIL_ATTACHMENT_EXT         0x8D20
+#define GL_FRAMEBUFFER_EXT                0x8D40
+#define GL_RENDERBUFFER_EXT               0x8D41
+#define GL_RENDERBUFFER_WIDTH_EXT         0x8D42
+#define GL_RENDERBUFFER_HEIGHT_EXT        0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
+#define GL_STENCIL_INDEX1_EXT             0x8D46
+#define GL_STENCIL_INDEX4_EXT             0x8D47
+#define GL_STENCIL_INDEX8_EXT             0x8D48
+#define GL_STENCIL_INDEX16_EXT            0x8D49
+#define GL_RENDERBUFFER_RED_SIZE_EXT      0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_EXT    0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_EXT     0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_EXT    0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_EXT    0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_EXT  0x8D55
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#endif
+
+
+/*************************************************************/
+
+#include <stddef.h>
+#ifndef GL_VERSION_2_0
+/* GL type for program/shader text */
+typedef char GLchar;			/* native character */
+#endif
+
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+
+#ifndef GL_ARB_shader_objects
+/* GL types for handling shader object handles and program/shader text */
+typedef char GLcharARB;		/* native character */
+typedef unsigned int GLhandleARB;	/* shader object handle */
+#endif
+
+/* GL types for "half" precision (s10e5) float data in host memory */
+#ifndef GL_ARB_half_float_pixel
+typedef unsigned short GLhalfARB;
+#endif
+
+#ifndef GL_NV_half_float
+typedef unsigned short GLhalfNV;
+#endif
+
+#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
+GLAPI void APIENTRY glBlendEquation (GLenum);
+GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogram (GLenum);
+GLAPI void APIENTRY glResetMinmax (GLenum);
+GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTexture (GLenum);
+GLAPI void APIENTRY glClientActiveTexture (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
+GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glFogCoordf (GLfloat);
+GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
+GLAPI void APIENTRY glFogCoordd (GLdouble);
+GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
+GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
+GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3iv (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2i (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2iv (const GLint *);
+GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2sv (const GLshort *);
+GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3iv (const GLint *);
+GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQuery (GLuint);
+GLAPI void APIENTRY glBeginQuery (GLenum, GLuint);
+GLAPI void APIENTRY glEndQuery (GLenum);
+GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
+GLAPI void APIENTRY glBindBuffer (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBuffer (GLuint);
+GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum);
+GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum);
+GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *);
+GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
+GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint);
+GLAPI void APIENTRY glAttachShader (GLuint, GLuint);
+GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
+GLAPI void APIENTRY glCompileShader (GLuint);
+GLAPI GLuint APIENTRY glCreateProgram (void);
+GLAPI GLuint APIENTRY glCreateShader (GLenum);
+GLAPI void APIENTRY glDeleteProgram (GLuint);
+GLAPI void APIENTRY glDeleteShader (GLuint);
+GLAPI void APIENTRY glDetachShader (GLuint, GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glEnableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
+GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgram (GLuint);
+GLAPI GLboolean APIENTRY glIsShader (GLuint);
+GLAPI void APIENTRY glLinkProgram (GLuint);
+GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
+GLAPI void APIENTRY glUseProgram (GLuint);
+GLAPI void APIENTRY glUniform1f (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1i (GLint, GLint);
+GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glValidateProgram (GLuint);
+GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTextureARB (GLenum);
+GLAPI void APIENTRY glClientActiveTextureARB (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_ARB_transpose_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_ARB_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#define GL_ARB_texture_env_add 1
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_ARB_texture_compression 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_ARB_texture_border_clamp 1
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_ARB_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_ARB_vertex_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *);
+GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *);
+GLAPI void APIENTRY glWeightivARB (GLint, const GLint *);
+GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *);
+GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *);
+GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexBlendARB (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_ARB_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint);
+GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_ARB_texture_env_combine 1
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#define GL_ARB_texture_env_crossbar 1
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_ARB_texture_env_dot3 1
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_ARB_texture_mirrored_repeat 1
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_ARB_depth_texture 1
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_ARB_shadow 1
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_ARB_shadow_ambient 1
+#endif
+
+#ifndef GL_ARB_window_pos
+#define GL_ARB_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_ARB_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramARB (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_ARB_fragment_program 1
+/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_ARB_vertex_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBufferARB (GLuint);
+GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum);
+GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_ARB_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQueryARB (GLuint);
+GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint);
+GLAPI void APIENTRY glEndQueryARB (GLenum);
+GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum);
+GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
+GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
+GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
+GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
+GLAPI void APIENTRY glValidateProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1iARB (GLint, GLint);
+GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
+GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
+GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *);
+GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
+typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
+typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
+typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
+typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_ARB_fragment_shader 1
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_ARB_shading_language_100 1
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#define GL_ARB_texture_non_power_of_two 1
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_ARB_point_sprite 1
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#define GL_ARB_fragment_program_shadow 1
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_ARB_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_ARB_texture_rectangle 1
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_ARB_color_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_ARB_half_float_pixel 1
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_ARB_texture_float 1
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_ARB_pixel_buffer_object 1
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_EXT_texture 1
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_EXT_texture3D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_SGIS_texture_filter4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
+typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
+#endif
+
+#ifndef GL_EXT_subtexture
+#define GL_EXT_subtexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_EXT_copy_texture
+#define GL_EXT_copy_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_EXT_histogram 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogramEXT (GLenum);
+GLAPI void APIENTRY glResetMinmaxEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_EXT_convolution 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+#endif
+
+#ifndef GL_EXT_color_matrix
+#define GL_EXT_color_matrix 1
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_SGI_color_table 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_SGIX_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_SGIS_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint);
+GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *);
+GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_SGIS_texture4D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_SGI_texture_color_table 1
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_EXT_cmyka 1
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_EXT_texture_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint);
+GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
+typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_SGIS_detail_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_SGIS_sharpen_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_EXT_packed_pixels 1
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_SGIS_texture_lod 1
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_SGIS_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_EXT_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glArrayElementEXT (GLint);
+GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
+GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *);
+GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
+typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
+typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
+typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#define GL_EXT_misc_attribute 1
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_SGIS_generate_mipmap 1
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_SGIX_clipmap 1
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_SGIX_shadow 1
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_SGIS_texture_edge_clamp 1
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_SGIS_texture_border_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_SGIX_interlace 1
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_SGIX_pixel_tiles 1
+#endif
+
+#ifndef GL_SGIX_texture_select
+#define GL_SGIX_texture_select 1
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SGIX_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint);
+GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_SGIX_texture_multi_buffer 1
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_SGIS_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_SGIX_instruments 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
+GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *);
+GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *);
+GLAPI void APIENTRY glReadInstrumentsSGIX (GLint);
+GLAPI void APIENTRY glStartInstrumentsSGIX (void);
+GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
+typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
+typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
+typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_SGIX_texture_scale_bias 1
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_SGIX_framezoom 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameZoomSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#define GL_SGIX_tag_sample_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTagSampleBufferSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_SGIX_polynomial_ffd 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
+GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+GLAPI void APIENTRY glDeformSGIX (GLbitfield);
+GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_SGIX_reference_plane 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#define GL_SGIX_flush_raster 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushRasterSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_SGIX_depth_texture 1
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_SGIS_fog_function 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_SGIX_fog_offset 1
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_HP_image_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_HP_convolution_border_modes 1
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_SGIX_texture_add_env 1
+#endif
+
+#ifndef GL_EXT_color_subtable
+#define GL_EXT_color_subtable 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_PGI_vertex_hints 1
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PGI_misc_hints 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glHintPGI (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_EXT_paletted_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_EXT_clip_volume_hint 1
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_SGIX_list_priority 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat);
+GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
+GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint);
+GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_SGIX_ir_instrument1 1
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_SGIX_calligraphic_fragment 1
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_SGIX_texture_lod_bias 1
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SGIX_shadow_ambient 1
+#endif
+
+#ifndef GL_EXT_index_texture
+#define GL_EXT_index_texture 1
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_EXT_index_material 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_EXT_index_func 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_EXT_index_array_formats 1
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_EXT_compiled_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei);
+GLAPI void APIENTRY glUnlockArraysEXT (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_EXT_cull_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *);
+GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_SGIX_ycrcb 1
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_SGIX_fragment_lighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum);
+GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_IBM_rasterpos_clip 1
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_HP_texture_lighting 1
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_EXT_draw_range_elements 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_WIN_phong_shading 1
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_WIN_specular_fog 1
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_EXT_light_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glApplyTextureEXT (GLenum);
+GLAPI void APIENTRY glTextureLightEXT (GLenum);
+GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_SGIX_blend_alpha_minmax 1
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_EXT_bgra 1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_SGIX_async 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint);
+GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *);
+GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *);
+GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
+GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
+GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
+typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
+typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
+typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_SGIX_async_pixel 1
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_SGIX_async_histogram 1
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_INTEL_parallel_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *);
+GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_HP_occlusion_test 1
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_EXT_pixel_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#define GL_EXT_pixel_transform_color_table 1
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_EXT_separate_specular_color 1
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_EXT_secondary_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_EXT_texture_perturb_normal 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureNormalEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_EXT_fog_coord 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogCoordfEXT (GLfloat);
+GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *);
+GLAPI void APIENTRY glFogCoorddEXT (GLdouble);
+GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_REND_screen_coordinates 1
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_EXT_coordinate_frame 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glTangent3ivEXT (const GLint *);
+GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glTangent3svEXT (const GLshort *);
+GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glBinormal3ivEXT (const GLint *);
+GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glBinormal3svEXT (const GLshort *);
+GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
+typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
+typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
+typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
+typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
+typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
+typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
+typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
+typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
+typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
+typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_APPLE_specular_vector 1
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_APPLE_transform_hint 1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_SGIX_fog_scale 1
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_SUNX_constant_data 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFinishTextureSUNX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_SUN_global_alpha 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte);
+GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort);
+GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint);
+GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
+GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble);
+GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte);
+GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort);
+GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_SUN_triangle_list 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint);
+GLAPI void APIENTRY glReplacementCodeusSUN (GLushort);
+GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte);
+GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *);
+GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *);
+GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *);
+GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_SUN_vertex
+#define GL_SUN_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_EXT_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_blend_func_separate
+#define GL_INGR_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_INGR_color_clamp 1
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INGR_interlace_read 1
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_EXT_422_pixels 1
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NV_texgen_reflection 1
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_SUN_convolution_border_modes 1
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#define GL_EXT_texture_env_add 1
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_EXT_vertex_weighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexWeightfEXT (GLfloat);
+GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *);
+GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_NV_light_max_exponent 1
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_NV_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
+GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_NV_register_combiners 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
+GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
+GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
+GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
+GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_NV_fog_distance 1
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_NV_texgen_emboss 1
+#endif
+
+#ifndef GL_NV_blend_square
+#define GL_NV_blend_square 1
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_NV_texture_env_combine4 1
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#define GL_MESA_resize_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glResizeBuffersMESA (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
+#endif
+
+#ifndef GL_MESA_window_pos
+#define GL_MESA_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_IBM_cull_vertex 1
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#define GL_IBM_multimode_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint);
+GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_IBM_vertex_array_lists 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
+GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_SGIX_subsample 1
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_SGIX_ycrcba 1
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#define GL_SGIX_ycrcb_subsample 1
+#endif
+
+#ifndef GL_SGIX_depth_pass_instrument
+#define GL_SGIX_depth_pass_instrument 1
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_3DFX_texture_compression_FXT1 1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_3DFX_multisample 1
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#define GL_3DFX_tbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_EXT_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_SGIX_vertex_preclip 1
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_SGIX_convolution_accuracy 1
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_SGIX_resample 1
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_SGIS_point_line_texgen 1
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_SGIS_texture_color_mask 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+#endif
+
+#ifndef GL_SGIX_igloo_interface
+#define GL_SGIX_igloo_interface 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_ATI_texture_mirror_once 1
+#endif
+
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
+GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFinishFenceNV (GLuint);
+GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_NV_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *);
+GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *);
+GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_NV_packed_depth_stencil 1
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_NV_register_combiners2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#define GL_NV_texture_compression_vtc 1
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_NV_texture_rectangle 1
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_NV_texture_shader 1
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_NV_texture_shader2 1
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_NV_vertex_array_range2 1
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_NV_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
+GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
+GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
+GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
+GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
+GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
+typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_SGIX_texture_coordinate_clamp 1
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SGIX_scalebias_hint 1
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_OML_interlace 1
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_OML_subsample 1
+#endif
+
+#ifndef GL_OML_resample
+#define GL_OML_resample 1
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_NV_copy_depth_to_color 1
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_ATI_envmap_bumpmap 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *);
+GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_ATI_fragment_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint);
+GLAPI void APIENTRY glBindFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glBeginFragmentShaderATI (void);
+GLAPI void APIENTRY glEndFragmentShaderATI (void);
+GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
+typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_ATI_pn_triangles 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint);
+GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_ATI_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum);
+GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum);
+GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFreeObjectBufferATI (GLuint);
+GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
+typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_EXT_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVertexShaderEXT (void);
+GLAPI void APIENTRY glEndVertexShaderEXT (void);
+GLAPI void APIENTRY glBindVertexShaderEXT (GLuint);
+GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint);
+GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint);
+GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint);
+GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *);
+GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *);
+GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *);
+GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *);
+GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *);
+GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint);
+GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint);
+GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindParameterEXT (GLenum);
+GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum);
+GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *);
+GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
+typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
+typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
+typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
+typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
+typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
+typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
+typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
+typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
+typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_ATI_vertex_streams 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
+GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
+GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
+GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
+GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
+GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
+GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ATI_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_SUN_mesh_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SUN_slice_accum 1
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_NV_multisample_filter_hint 1
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_NV_depth_clamp 1
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_NV_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glEndOcclusionQueryNV (void);
+GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_NV_point_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_NV_texture_shader3 1
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#define GL_NV_vertex_program1_1 1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#define GL_EXT_shadow_funcs 1
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_EXT_stencil_two_side 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_ATI_text_fragment_shader 1
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_APPLE_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_APPLE_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glSetFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint);
+GLAPI void APIENTRY glFinishFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint);
+GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
+typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
+typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_APPLE_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
+GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_APPLE_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_APPLE_ycbcr_422 1
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_S3_s3tc 1
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_ATI_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_ATI_pixel_format_float 1
+/* This is really a WGL extension, but defines some associated GL enums.
+ * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
+ */
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_ATI_texture_env_combine3 1
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_ATI_texture_float 1
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_NV_float_buffer 1
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_NV_fragment_program 1
+/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *);
+GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *);
+GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_NV_half_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV);
+GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glFogCoordhNV (GLhalfNV);
+GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *);
+GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV);
+GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
+typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
+typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_NV_pixel_data_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_NV_primitive_restart 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPrimitiveRestartNV (void);
+GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_NV_texture_expand_normal 1
+#endif
+
+#ifndef GL_NV_vertex_program2
+#define GL_NV_vertex_program2 1
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#define GL_ATI_map_object_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_ATI_separate_stencil 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#define GL_ATI_vertex_attrib_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_EXT_depth_bounds_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_EXT_texture_mirror_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_EXT_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_MESA_pack_invert 1
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_MESA_ycbcr_texture 1
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_EXT_pixel_buffer_object 1
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#define GL_NV_fragment_program_option 1
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_NV_fragment_program2 1
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+#define GL_NV_vertex_program2_option 1
+#endif
+
+#ifndef GL_NV_vertex_program3
+#define GL_NV_vertex_program3 1
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
+GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
+GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
+GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
+GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
+GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#define GL_GREMEDY_string_marker 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/terralib/drivers/GL/glfbdev.h b/src/terralib/drivers/GL/glfbdev.h
new file mode 100644
index 0000000..4eec6b7
--- /dev/null
+++ b/src/terralib/drivers/GL/glfbdev.h
@@ -0,0 +1,148 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  6.5
+ *
+ * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef GLFBDEV_H
+#define GLFBDEV_H
+
+
+/* avoid including linux/fb.h */
+struct fb_fix_screeninfo;
+struct fb_var_screeninfo;
+
+
+/* public types */
+typedef struct GLFBDevVisualRec *GLFBDevVisualPtr;
+typedef struct GLFBDevBufferRec *GLFBDevBufferPtr;
+typedef struct GLFBDevContextRec *GLFBDevContextPtr;
+
+
+/* API version */
+#define GLFBDEV_VERSION_1_0       1
+
+
+/* For glFBDevCreateVisual */
+#define GLFBDEV_DOUBLE_BUFFER   100
+#define GLFBDEV_COLOR_INDEX     101
+#define GLFBDEV_DEPTH_SIZE      102
+#define GLFBDEV_STENCIL_SIZE    103
+#define GLFBDEV_ACCUM_SIZE      104
+#define GLFBDEV_LEVEL           105
+#define GLFBDEV_NONE              0
+
+/* For glFBDevGetString */
+#define GLFBDEV_VERSION         200
+#define GLFBDEV_VENDOR          201
+
+
+/* Misc functions */
+
+extern const char *
+glFBDevGetString( int str );
+
+
+typedef void (*GLFBDevProc)();
+
+
+extern GLFBDevProc
+glFBDevGetProcAddress( const char *procName );
+
+
+
+/**
+ * Create a GLFBDevVisual.
+ * \param fixInfo - needed to get the visual types, etc.
+ * \param varInfo - needed to get the bits_per_pixel, etc.
+ * \param attribs - for requesting depth, stencil, accum buffers, etc.
+ */
+extern GLFBDevVisualPtr
+glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
+                     const struct fb_var_screeninfo *varInfo,
+                     const int *attribs );
+
+extern void
+glFBDevDestroyVisual( GLFBDevVisualPtr visual );
+
+extern int
+glFBDevGetVisualAttrib( const GLFBDevVisualPtr visual, int attrib);
+
+
+
+/**
+ * Create a GLFBDevBuffer.
+ * \param fixInfo, varInfo - needed in order to get the screen size
+ * (resolution), etc.
+ * \param visual - as returned by glFBDevCreateVisual()
+ * \param frontBuffer - address of front color buffer
+ * \param backBuffer - address of back color buffer (may be NULL)
+ * \param size - size of the color buffer(s) in bytes.
+ */
+extern GLFBDevBufferPtr
+glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
+                     const struct fb_var_screeninfo *varInfo,
+                     const GLFBDevVisualPtr visual,
+                     void *frontBuffer, void *backBuffer, size_t size );
+
+extern void
+glFBDevDestroyBuffer( GLFBDevBufferPtr buffer );
+
+extern int
+glFBDevGetBufferAttrib( const GLFBDevBufferPtr buffer, int attrib);
+
+extern GLFBDevBufferPtr
+glFBDevGetCurrentDrawBuffer( void );
+
+extern GLFBDevBufferPtr
+glFBDevGetCurrentReadBuffer( void );
+
+extern void
+glFBDevSwapBuffers( GLFBDevBufferPtr buffer );
+
+
+
+/**
+ * Create a GLFBDevContext.
+ * \param visual - as created by glFBDevCreateVisual.
+ * \param share - specifies another context with which to share textures,
+ * display lists, etc. (may be NULL).
+ */
+extern GLFBDevContextPtr
+glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share );
+
+extern void
+glFBDevDestroyContext( GLFBDevContextPtr context );
+
+extern int
+glFBDevGetContextAttrib( const GLFBDevContextPtr context, int attrib);
+
+extern GLFBDevContextPtr
+glFBDevGetCurrentContext( void );
+
+extern int
+glFBDevMakeCurrent( GLFBDevContextPtr context,
+                    GLFBDevBufferPtr drawBuffer,
+                    GLFBDevBufferPtr readBuffer );
+
+
+#endif /* GLFBDEV_H */
diff --git a/src/terralib/drivers/GL/glu.h b/src/terralib/drivers/GL/glu.h
new file mode 100644
index 0000000..30e1cb5
--- /dev/null
+++ b/src/terralib/drivers/GL/glu.h
@@ -0,0 +1,340 @@
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+** 
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#ifndef __glu_h__
+#define __glu_h__
+
+#if defined(USE_MGL_NAMESPACE)
+#include "glu_mangle.h"
+#endif
+
+#include <GL/gl.h>
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+#ifndef GLAPI
+#define GLAPI
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*************************************************************/
+
+/* Extensions */
+#define GLU_EXT_object_space_tess          1
+#define GLU_EXT_nurbs_tessellator          1
+
+/* Boolean */
+#define GLU_FALSE                          0
+#define GLU_TRUE                           1
+
+/* Version */
+#define GLU_VERSION_1_1                    1
+#define GLU_VERSION_1_2                    1
+#define GLU_VERSION_1_3                    1
+
+/* StringName */
+#define GLU_VERSION                        100800
+#define GLU_EXTENSIONS                     100801
+
+/* ErrorCode */
+#define GLU_INVALID_ENUM                   100900
+#define GLU_INVALID_VALUE                  100901
+#define GLU_OUT_OF_MEMORY                  100902
+#define GLU_INCOMPATIBLE_GL_VERSION        100903
+#define GLU_INVALID_OPERATION              100904
+
+/* NurbsDisplay */
+/*      GLU_FILL */
+#define GLU_OUTLINE_POLYGON                100240
+#define GLU_OUTLINE_PATCH                  100241
+
+/* NurbsCallback */
+#define GLU_NURBS_ERROR                    100103
+#define GLU_ERROR                          100103
+#define GLU_NURBS_BEGIN                    100164
+#define GLU_NURBS_BEGIN_EXT                100164
+#define GLU_NURBS_VERTEX                   100165
+#define GLU_NURBS_VERTEX_EXT               100165
+#define GLU_NURBS_NORMAL                   100166
+#define GLU_NURBS_NORMAL_EXT               100166
+#define GLU_NURBS_COLOR                    100167
+#define GLU_NURBS_COLOR_EXT                100167
+#define GLU_NURBS_TEXTURE_COORD            100168
+#define GLU_NURBS_TEX_COORD_EXT            100168
+#define GLU_NURBS_END                      100169
+#define GLU_NURBS_END_EXT                  100169
+#define GLU_NURBS_BEGIN_DATA               100170
+#define GLU_NURBS_BEGIN_DATA_EXT           100170
+#define GLU_NURBS_VERTEX_DATA              100171
+#define GLU_NURBS_VERTEX_DATA_EXT          100171
+#define GLU_NURBS_NORMAL_DATA              100172
+#define GLU_NURBS_NORMAL_DATA_EXT          100172
+#define GLU_NURBS_COLOR_DATA               100173
+#define GLU_NURBS_COLOR_DATA_EXT           100173
+#define GLU_NURBS_TEXTURE_COORD_DATA       100174
+#define GLU_NURBS_TEX_COORD_DATA_EXT       100174
+#define GLU_NURBS_END_DATA                 100175
+#define GLU_NURBS_END_DATA_EXT             100175
+
+/* NurbsError */
+#define GLU_NURBS_ERROR1                   100251
+#define GLU_NURBS_ERROR2                   100252
+#define GLU_NURBS_ERROR3                   100253
+#define GLU_NURBS_ERROR4                   100254
+#define GLU_NURBS_ERROR5                   100255
+#define GLU_NURBS_ERROR6                   100256
+#define GLU_NURBS_ERROR7                   100257
+#define GLU_NURBS_ERROR8                   100258
+#define GLU_NURBS_ERROR9                   100259
+#define GLU_NURBS_ERROR10                  100260
+#define GLU_NURBS_ERROR11                  100261
+#define GLU_NURBS_ERROR12                  100262
+#define GLU_NURBS_ERROR13                  100263
+#define GLU_NURBS_ERROR14                  100264
+#define GLU_NURBS_ERROR15                  100265
+#define GLU_NURBS_ERROR16                  100266
+#define GLU_NURBS_ERROR17                  100267
+#define GLU_NURBS_ERROR18                  100268
+#define GLU_NURBS_ERROR19                  100269
+#define GLU_NURBS_ERROR20                  100270
+#define GLU_NURBS_ERROR21                  100271
+#define GLU_NURBS_ERROR22                  100272
+#define GLU_NURBS_ERROR23                  100273
+#define GLU_NURBS_ERROR24                  100274
+#define GLU_NURBS_ERROR25                  100275
+#define GLU_NURBS_ERROR26                  100276
+#define GLU_NURBS_ERROR27                  100277
+#define GLU_NURBS_ERROR28                  100278
+#define GLU_NURBS_ERROR29                  100279
+#define GLU_NURBS_ERROR30                  100280
+#define GLU_NURBS_ERROR31                  100281
+#define GLU_NURBS_ERROR32                  100282
+#define GLU_NURBS_ERROR33                  100283
+#define GLU_NURBS_ERROR34                  100284
+#define GLU_NURBS_ERROR35                  100285
+#define GLU_NURBS_ERROR36                  100286
+#define GLU_NURBS_ERROR37                  100287
+
+/* NurbsProperty */
+#define GLU_AUTO_LOAD_MATRIX               100200
+#define GLU_CULLING                        100201
+#define GLU_SAMPLING_TOLERANCE             100203
+#define GLU_DISPLAY_MODE                   100204
+#define GLU_PARAMETRIC_TOLERANCE           100202
+#define GLU_SAMPLING_METHOD                100205
+#define GLU_U_STEP                         100206
+#define GLU_V_STEP                         100207
+#define GLU_NURBS_MODE                     100160
+#define GLU_NURBS_MODE_EXT                 100160
+#define GLU_NURBS_TESSELLATOR              100161
+#define GLU_NURBS_TESSELLATOR_EXT          100161
+#define GLU_NURBS_RENDERER                 100162
+#define GLU_NURBS_RENDERER_EXT             100162
+
+/* NurbsSampling */
+#define GLU_OBJECT_PARAMETRIC_ERROR        100208
+#define GLU_OBJECT_PARAMETRIC_ERROR_EXT    100208
+#define GLU_OBJECT_PATH_LENGTH             100209
+#define GLU_OBJECT_PATH_LENGTH_EXT         100209
+#define GLU_PATH_LENGTH                    100215
+#define GLU_PARAMETRIC_ERROR               100216
+#define GLU_DOMAIN_DISTANCE                100217
+
+/* NurbsTrim */
+#define GLU_MAP1_TRIM_2                    100210
+#define GLU_MAP1_TRIM_3                    100211
+
+/* QuadricDrawStyle */
+#define GLU_POINT                          100010
+#define GLU_LINE                           100011
+#define GLU_FILL                           100012
+#define GLU_SILHOUETTE                     100013
+
+/* QuadricCallback */
+/*      GLU_ERROR */
+
+/* QuadricNormal */
+#define GLU_SMOOTH                         100000
+#define GLU_FLAT                           100001
+#define GLU_NONE                           100002
+
+/* QuadricOrientation */
+#define GLU_OUTSIDE                        100020
+#define GLU_INSIDE                         100021
+
+/* TessCallback */
+#define GLU_TESS_BEGIN                     100100
+#define GLU_BEGIN                          100100
+#define GLU_TESS_VERTEX                    100101
+#define GLU_VERTEX                         100101
+#define GLU_TESS_END                       100102
+#define GLU_END                            100102
+#define GLU_TESS_ERROR                     100103
+#define GLU_TESS_EDGE_FLAG                 100104
+#define GLU_EDGE_FLAG                      100104
+#define GLU_TESS_COMBINE                   100105
+#define GLU_TESS_BEGIN_DATA                100106
+#define GLU_TESS_VERTEX_DATA               100107
+#define GLU_TESS_END_DATA                  100108
+#define GLU_TESS_ERROR_DATA                100109
+#define GLU_TESS_EDGE_FLAG_DATA            100110
+#define GLU_TESS_COMBINE_DATA              100111
+
+/* TessContour */
+#define GLU_CW                             100120
+#define GLU_CCW                            100121
+#define GLU_INTERIOR                       100122
+#define GLU_EXTERIOR                       100123
+#define GLU_UNKNOWN                        100124
+
+/* TessProperty */
+#define GLU_TESS_WINDING_RULE              100140
+#define GLU_TESS_BOUNDARY_ONLY             100141
+#define GLU_TESS_TOLERANCE                 100142
+
+/* TessError */
+#define GLU_TESS_ERROR1                    100151
+#define GLU_TESS_ERROR2                    100152
+#define GLU_TESS_ERROR3                    100153
+#define GLU_TESS_ERROR4                    100154
+#define GLU_TESS_ERROR5                    100155
+#define GLU_TESS_ERROR6                    100156
+#define GLU_TESS_ERROR7                    100157
+#define GLU_TESS_ERROR8                    100158
+#define GLU_TESS_MISSING_BEGIN_POLYGON     100151
+#define GLU_TESS_MISSING_BEGIN_CONTOUR     100152
+#define GLU_TESS_MISSING_END_POLYGON       100153
+#define GLU_TESS_MISSING_END_CONTOUR       100154
+#define GLU_TESS_COORD_TOO_LARGE           100155
+#define GLU_TESS_NEED_COMBINE_CALLBACK     100156
+
+/* TessWinding */
+#define GLU_TESS_WINDING_ODD               100130
+#define GLU_TESS_WINDING_NONZERO           100131
+#define GLU_TESS_WINDING_POSITIVE          100132
+#define GLU_TESS_WINDING_NEGATIVE          100133
+#define GLU_TESS_WINDING_ABS_GEQ_TWO       100134
+
+/*************************************************************/
+
+
+#ifdef __cplusplus
+class GLUnurbs;
+class GLUquadric;
+class GLUtesselator;
+#else
+typedef struct GLUnurbs GLUnurbs;
+typedef struct GLUquadric GLUquadric;
+typedef struct GLUtesselator GLUtesselator;
+#endif
+
+typedef GLUnurbs GLUnurbsObj;
+typedef GLUquadric GLUquadricObj;
+typedef GLUtesselator GLUtesselatorObj;
+typedef GLUtesselator GLUtriangulatorObj;
+
+#define GLU_TESS_MAX_COORD 1.0e150
+
+/* Internal convenience typedefs */
+typedef void (GLAPIENTRYP _GLUfuncptr)();
+
+GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
+GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
+GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
+GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
+GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
+GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
+GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
+GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
+GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
+GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
+GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
+GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
+GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
+GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
+GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
+GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
+GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
+GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
+GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
+GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
+GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
+GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
+GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
+GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
+GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
+GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
+GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
+GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
+GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
+GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
+GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
+GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
+GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
+GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
+GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
+GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
+GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
+GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
+GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glu_h__ */
diff --git a/src/terralib/drivers/GL/glu_mangle.h b/src/terralib/drivers/GL/glu_mangle.h
new file mode 100644
index 0000000..f52ec08
--- /dev/null
+++ b/src/terralib/drivers/GL/glu_mangle.h
@@ -0,0 +1,86 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  3.0
+ * Copyright (C) 1995-1998  Brian Paul
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#ifndef GLU_MANGLE_H
+#define GLU_MANGLE_H
+
+
+#define gluLookAt mgluLookAt
+#define gluOrtho2D mgluOrtho2D
+#define gluPerspective mgluPerspective
+#define gluPickMatrix mgluPickMatrix
+#define gluProject mgluProject
+#define gluUnProject mgluUnProject
+#define gluErrorString mgluErrorString
+#define gluScaleImage mgluScaleImage
+#define gluBuild1DMipmaps mgluBuild1DMipmaps
+#define gluBuild2DMipmaps mgluBuild2DMipmaps
+#define gluNewQuadric mgluNewQuadric
+#define gluDeleteQuadric mgluDeleteQuadric
+#define gluQuadricDrawStyle mgluQuadricDrawStyle
+#define gluQuadricOrientation mgluQuadricOrientation
+#define gluQuadricNormals mgluQuadricNormals
+#define gluQuadricTexture mgluQuadricTexture
+#define gluQuadricCallback mgluQuadricCallback
+#define gluCylinder mgluCylinder
+#define gluSphere mgluSphere
+#define gluDisk mgluDisk
+#define gluPartialDisk mgluPartialDisk
+#define gluNewNurbsRenderer mgluNewNurbsRenderer
+#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer
+#define gluLoadSamplingMatrices mgluLoadSamplingMatrices
+#define gluNurbsProperty mgluNurbsProperty
+#define gluGetNurbsProperty mgluGetNurbsProperty
+#define gluBeginCurve mgluBeginCurve
+#define gluEndCurve mgluEndCurve
+#define gluNurbsCurve mgluNurbsCurve
+#define gluBeginSurface mgluBeginSurface
+#define gluEndSurface mgluEndSurface
+#define gluNurbsSurface mgluNurbsSurface
+#define gluBeginTrim mgluBeginTrim
+#define gluEndTrim mgluEndTrim
+#define gluPwlCurve mgluPwlCurve
+#define gluNurbsCallback mgluNurbsCallback
+#define gluNewTess mgluNewTess
+#define gluDeleteTess mgluDeleteTess
+#define gluTessBeginPolygon mgluTessBeginPolygon
+#define gluTessBeginContour mgluTessBeginContour
+#define gluTessVertex mgluTessVertex
+#define gluTessEndPolygon mgluTessEndPolygon
+#define gluTessEndContour mgluTessEndContour
+#define gluTessProperty mgluTessProperty
+#define gluTessNormal mgluTessNormal
+#define gluTessCallback mgluTessCallback
+#define gluGetTessProperty mgluGetTessProperty
+#define gluBeginPolygon mgluBeginPolygon
+#define gluNextContour mgluNextContour
+#define gluEndPolygon mgluEndPolygon
+#define gluGetString mgluGetString
+#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels
+#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels
+#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels
+#define gluBuild3DMipmaps mgluBuild3DMipmaps
+#define gluCheckExtension mgluCheckExtension
+#define gluUnProject4 mgluUnProject4
+#define gluNurbsCallbackData mgluNurbsCallbackData
+#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT
+
+#endif
diff --git a/src/terralib/drivers/GL/glut.h b/src/terralib/drivers/GL/glut.h
new file mode 100644
index 0000000..1325623
--- /dev/null
+++ b/src/terralib/drivers/GL/glut.h
@@ -0,0 +1,748 @@
+#ifndef __glut_h__
+#define __glut_h__
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
+
+/* This program is freely distributable without licensing fees  and is
+   provided without guarantee or warrantee expressed or  implied. This
+   program is -not- in the public domain. */
+
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WIN32)
+
+/* GLUT 3.7 now tries to avoid including <windows.h>
+   to avoid name space pollution, but Win32's <GL/gl.h>
+   needs APIENTRY and WINGDIAPI defined properly.
+
+   tjump at spgs.com contributes:
+   If users are building glut code on MS Windows, then they should
+   make sure they include windows.h early, let's not get into a
+   header definitions war since MS has proven it's capability to
+   change header dependencies w/o publishing they have done so.
+
+   So, let's not include windows.h here, as it's not really required and
+   MS own gl/gl.h *should* include it if the dependency is there. */
+
+/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
+   in your compile preprocessor options. */
+# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
+#  pragma comment (lib, "winmm.lib")      /* link with Windows MultiMedia lib */
+/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
+   define GLUT_USE_SGI_OPENGL in your compile preprocessor options.  */
+#  ifdef GLUT_USE_SGI_OPENGL
+#   pragma comment (lib, "opengl.lib")    /* link with SGI OpenGL for Windows lib */
+#   pragma comment (lib, "glu.lib")       /* link with SGI OpenGL Utility lib */
+#   pragma comment (lib, "glut.lib")      /* link with Win32 GLUT for SGI OpenGL lib */
+#  else
+#   pragma comment (lib, "opengl32.lib")  /* link with Microsoft OpenGL lib */
+#   pragma comment (lib, "glu32.lib")     /* link with Microsoft OpenGL Utility lib */
+#   pragma comment (lib, "glut32.lib")    /* link with Win32 GLUT lib */
+#  endif
+# endif
+
+/* To disable supression of annoying warnings about floats being promoted
+   to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
+   options. */
+# ifndef GLUT_NO_WARNING_DISABLE
+#  pragma warning (disable:4244)  /* Disable bogus VC++ 4.2 conversion warnings. */
+#  pragma warning (disable:4305)  /* VC++ 5.0 version of above warning. */
+# endif
+
+/* Win32 has an annoying issue where there are multiple C run-time
+   libraries (CRTs).  If the executable is linked with a different CRT
+   from the GLUT DLL, the GLUT DLL will not share the same CRT static
+   data seen by the executable.  In particular, atexit callbacks registered
+   in the executable will not be called if GLUT calls its (different)
+   exit routine).  GLUT is typically built with the
+   "/MD" option (the CRT with multithreading DLL support), but the Visual
+   C++ linker default is "/ML" (the single threaded CRT).
+
+   One workaround to this issue is requiring users to always link with
+   the same CRT as GLUT is compiled with.  That requires users supply a
+   non-standard option.  GLUT 3.7 has its own built-in workaround where
+   the executable's "exit" function pointer is covertly passed to GLUT.
+   GLUT then calls the executable's exit function pointer to ensure that
+   any "atexit" calls registered by the application are called if GLUT
+   needs to exit.
+
+   Note that the __glut*WithExit routines should NEVER be called directly.
+   To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
+
+/* XXX This is from Win32's <process.h> */
+# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl)
+   /* Define __cdecl for non-Microsoft compilers. */
+#  define __cdecl
+#  define GLUT_DEFINED___CDECL
+# endif
+# ifndef _CRTIMP
+#  ifdef _NTSDK
+    /* Definition compatible with NT SDK */
+#   define _CRTIMP
+#  else
+    /* Current definition */
+#   ifdef _DLL
+#    define _CRTIMP __declspec(dllimport)
+#   else
+#    define _CRTIMP
+#   endif
+#  endif
+#  define GLUT_DEFINED__CRTIMP
+# endif
+# ifndef GLUT_BUILDING_LIB
+extern _CRTIMP void __cdecl exit(int);
+# endif
+
+/* GLUT callback calling convention for Win32. */
+# define GLUTCALLBACK __cdecl
+
+/* for callback/function pointer defs */
+# define GLUTAPIENTRYV __cdecl
+
+/* glut-win32 specific macros, defined to prevent collision with
+   and redifinition of Windows system defs, also removes requirement of
+   pretty much any standard windows header from this file */
+
+#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
+#	define GLUTAPIENTRY __stdcall
+#else
+#	define GLUTAPIENTRY
+#endif
+
+/* GLUT API entry point declarations for Win32. */
+#if defined(GLUT_BUILDING_LIB) && defined(_DLL)
+# 	define GLUTAPI __declspec(dllexport)
+#elif defined(_DLL)
+#   define GLUTAPI __declspec(dllimport)
+#else
+#	define GLUTAPI extern
+#endif
+
+#if defined(_WIN32) && !defined(_WINDEF_) && !defined(MESA)
+#	if !defined(MESA_MINWARN)
+#		pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" )
+#		pragma message( "----: and PROC typedef. If you receive compiler warnings about either ")
+#		pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/glut.h" )
+#	endif
+#	define CALLBACK __stdcall
+typedef int (GLUTAPIENTRY *PROC)();
+typedef void *HGLRC;
+typedef void *HDC;
+typedef unsigned long COLORREF;
+#endif
+
+#if defined(_WIN32) && !defined(_WINGDI_) && !defined(MESA)
+#	if !defined(MESA_MINWARN)
+#		pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" )
+#		pragma message( "----: and macros. If you receive compiler warnings about any being multiply ")
+#		pragma message( "----: defined you should include WINDOWS.H priot to gl/glut.h" )
+#	endif
+#	define WGL_FONT_LINES      0
+#	define WGL_FONT_POLYGONS   1
+#	ifdef UNICODE
+#		define wglUseFontBitmaps  wglUseFontBitmapsW
+#		define wglUseFontOutlines  wglUseFontOutlinesW
+#	else
+#		define wglUseFontBitmaps  wglUseFontBitmapsA
+#		define wglUseFontOutlines  wglUseFontOutlinesA
+#	endif /* !UNICODE */
+typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
+typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
+#  pragma warning( push )
+#  pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
+#  define WGLAPI __declspec(dllimport)
+WGLAPI int   GLAPIENTRY wglDeleteContext(HGLRC);
+WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
+WGLAPI int   GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
+WGLAPI int   GLAPIENTRY wglSwapBuffers(HDC hdc);
+WGLAPI HDC   GLAPIENTRY wglGetCurrentDC(void);
+WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
+WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
+WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
+WGLAPI PROC  GLAPIENTRY wglGetProcAddress(const char*);
+WGLAPI int   GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
+WGLAPI int   GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
+WGLAPI int   GLAPIENTRY wglDeleteContext(HGLRC);
+WGLAPI int   GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
+WGLAPI int   GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
+WGLAPI int   GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
+WGLAPI int   GLAPIENTRY wglGetPixelFormat(HDC hdc);
+WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
+WGLAPI int   GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
+WGLAPI int   GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
+WGLAPI int   GLAPIENTRY wglShareLists(HGLRC, HGLRC);
+WGLAPI int   GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
+WGLAPI int   GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
+WGLAPI int   GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
+WGLAPI int   GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
+WGLAPI int   GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
+WGLAPI int   GLAPIENTRY SwapBuffers(HDC);
+WGLAPI int   GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
+WGLAPI int   GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
+WGLAPI int   GLAPIENTRY GetPixelFormat(HDC);
+WGLAPI int   GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
+#  undef WGLAPI
+#  pragma warning( pop )
+#endif
+
+#else /* _WIN32 not defined */
+
+/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */
+#  define GLUTAPIENTRY GLAPIENTRY
+#  define GLUTAPIENTRYV
+#  define GLUTCALLBACK
+#  define GLUTAPI extern
+
+#endif
+
+
+/**
+ GLUT API revision history:
+
+ GLUT_API_VERSION is updated to reflect incompatible GLUT
+ API changes (interface changes, semantic changes, deletions,
+ or additions).
+
+ GLUT_API_VERSION=1  First public release of GLUT.  11/29/94
+
+ GLUT_API_VERSION=2  Added support for OpenGL/GLX multisampling,
+ extension.  Supports new input devices like tablet, dial and button
+ box, and Spaceball.  Easy to query OpenGL extensions.
+
+ GLUT_API_VERSION=3  glutMenuStatus added.
+
+ GLUT_API_VERSION=4  glutInitDisplayString, glutWarpPointer,
+ glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
+ video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
+ glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
+ glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
+
+ GLUT_API_VERSION=5  glutGetProcAddress (added by BrianP)
+**/
+#ifndef GLUT_API_VERSION  /* allow this to be overriden */
+#define GLUT_API_VERSION		5
+#endif
+
+/**
+ GLUT implementation revision history:
+
+ GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
+ API revisions and implementation revisions (ie, bug fixes).
+
+ GLUT_XLIB_IMPLEMENTATION=1  mjk's first public release of
+ GLUT Xlib-based implementation.  11/29/94
+
+ GLUT_XLIB_IMPLEMENTATION=2  mjk's second public release of
+ GLUT Xlib-based implementation providing GLUT version 2
+ interfaces.
+
+ GLUT_XLIB_IMPLEMENTATION=3  mjk's GLUT 2.2 images. 4/17/95
+
+ GLUT_XLIB_IMPLEMENTATION=4  mjk's GLUT 2.3 images. 6/?/95
+
+ GLUT_XLIB_IMPLEMENTATION=5  mjk's GLUT 3.0 images. 10/?/95
+
+ GLUT_XLIB_IMPLEMENTATION=7  mjk's GLUT 3.1+ with glutWarpPoitner.  7/24/96
+
+ GLUT_XLIB_IMPLEMENTATION=8  mjk's GLUT 3.1+ with glutWarpPoitner
+ and video resize.  1/3/97
+
+ GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
+
+ GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
+
+ GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
+
+ GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
+
+ GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
+
+ GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
+**/
+#ifndef GLUT_XLIB_IMPLEMENTATION  /* Allow this to be overriden. */
+#define GLUT_XLIB_IMPLEMENTATION	15
+#endif
+
+/* Display mode bit masks. */
+#define GLUT_RGB			0
+#define GLUT_RGBA			GLUT_RGB
+#define GLUT_INDEX			1
+#define GLUT_SINGLE			0
+#define GLUT_DOUBLE			2
+#define GLUT_ACCUM			4
+#define GLUT_ALPHA			8
+#define GLUT_DEPTH			16
+#define GLUT_STENCIL			32
+#if (GLUT_API_VERSION >= 2)
+#define GLUT_MULTISAMPLE		128
+#define GLUT_STEREO			256
+#endif
+#if (GLUT_API_VERSION >= 3)
+#define GLUT_LUMINANCE			512
+#endif
+
+/* Mouse buttons. */
+#define GLUT_LEFT_BUTTON		0
+#define GLUT_MIDDLE_BUTTON		1
+#define GLUT_RIGHT_BUTTON		2
+
+/* Mouse button  state. */
+#define GLUT_DOWN			0
+#define GLUT_UP				1
+
+#if (GLUT_API_VERSION >= 2)
+/* function keys */
+#define GLUT_KEY_F1			1
+#define GLUT_KEY_F2			2
+#define GLUT_KEY_F3			3
+#define GLUT_KEY_F4			4
+#define GLUT_KEY_F5			5
+#define GLUT_KEY_F6			6
+#define GLUT_KEY_F7			7
+#define GLUT_KEY_F8			8
+#define GLUT_KEY_F9			9
+#define GLUT_KEY_F10			10
+#define GLUT_KEY_F11			11
+#define GLUT_KEY_F12			12
+/* directional keys */
+#define GLUT_KEY_LEFT			100
+#define GLUT_KEY_UP			101
+#define GLUT_KEY_RIGHT			102
+#define GLUT_KEY_DOWN			103
+#define GLUT_KEY_PAGE_UP		104
+#define GLUT_KEY_PAGE_DOWN		105
+#define GLUT_KEY_HOME			106
+#define GLUT_KEY_END			107
+#define GLUT_KEY_INSERT			108
+#endif
+
+/* Entry/exit  state. */
+#define GLUT_LEFT			0
+#define GLUT_ENTERED			1
+
+/* Menu usage  state. */
+#define GLUT_MENU_NOT_IN_USE		0
+#define GLUT_MENU_IN_USE		1
+
+/* Visibility  state. */
+#define GLUT_NOT_VISIBLE		0
+#define GLUT_VISIBLE			1
+
+/* Window status  state. */
+#define GLUT_HIDDEN			0
+#define GLUT_FULLY_RETAINED		1
+#define GLUT_PARTIALLY_RETAINED		2
+#define GLUT_FULLY_COVERED		3
+
+/* Color index component selection values. */
+#define GLUT_RED			0
+#define GLUT_GREEN			1
+#define GLUT_BLUE			2
+
+/* Layers for use. */
+#define GLUT_NORMAL			0
+#define GLUT_OVERLAY			1
+
+#if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
+/* Stroke font constants (use these in GLUT program). */
+#define GLUT_STROKE_ROMAN		((void*)0)
+#define GLUT_STROKE_MONO_ROMAN		((void*)1)
+
+/* Bitmap font constants (use these in GLUT program). */
+#define GLUT_BITMAP_9_BY_15		((void*)2)
+#define GLUT_BITMAP_8_BY_13		((void*)3)
+#define GLUT_BITMAP_TIMES_ROMAN_10	((void*)4)
+#define GLUT_BITMAP_TIMES_ROMAN_24	((void*)5)
+#if (GLUT_API_VERSION >= 3)
+#define GLUT_BITMAP_HELVETICA_10	((void*)6)
+#define GLUT_BITMAP_HELVETICA_12	((void*)7)
+#define GLUT_BITMAP_HELVETICA_18	((void*)8)
+#endif
+#else
+/* Stroke font opaque addresses (use constants instead in source code). */
+GLUTAPI void *glutStrokeRoman;
+GLUTAPI void *glutStrokeMonoRoman;
+
+/* Stroke font constants (use these in GLUT program). */
+#define GLUT_STROKE_ROMAN		(&glutStrokeRoman)
+#define GLUT_STROKE_MONO_ROMAN		(&glutStrokeMonoRoman)
+
+/* Bitmap font opaque addresses (use constants instead in source code). */
+GLUTAPI void *glutBitmap9By15;
+GLUTAPI void *glutBitmap8By13;
+GLUTAPI void *glutBitmapTimesRoman10;
+GLUTAPI void *glutBitmapTimesRoman24;
+GLUTAPI void *glutBitmapHelvetica10;
+GLUTAPI void *glutBitmapHelvetica12;
+GLUTAPI void *glutBitmapHelvetica18;
+
+/* Bitmap font constants (use these in GLUT program). */
+#define GLUT_BITMAP_9_BY_15		(&glutBitmap9By15)
+#define GLUT_BITMAP_8_BY_13		(&glutBitmap8By13)
+#define GLUT_BITMAP_TIMES_ROMAN_10	(&glutBitmapTimesRoman10)
+#define GLUT_BITMAP_TIMES_ROMAN_24	(&glutBitmapTimesRoman24)
+#if (GLUT_API_VERSION >= 3)
+#define GLUT_BITMAP_HELVETICA_10	(&glutBitmapHelvetica10)
+#define GLUT_BITMAP_HELVETICA_12	(&glutBitmapHelvetica12)
+#define GLUT_BITMAP_HELVETICA_18	(&glutBitmapHelvetica18)
+#endif
+#endif
+
+/* glutGet parameters. */
+#define GLUT_WINDOW_X			100
+#define GLUT_WINDOW_Y			101
+#define GLUT_WINDOW_WIDTH		102
+#define GLUT_WINDOW_HEIGHT		103
+#define GLUT_WINDOW_BUFFER_SIZE		104
+#define GLUT_WINDOW_STENCIL_SIZE	105
+#define GLUT_WINDOW_DEPTH_SIZE		106
+#define GLUT_WINDOW_RED_SIZE		107
+#define GLUT_WINDOW_GREEN_SIZE		108
+#define GLUT_WINDOW_BLUE_SIZE		109
+#define GLUT_WINDOW_ALPHA_SIZE		110
+#define GLUT_WINDOW_ACCUM_RED_SIZE	111
+#define GLUT_WINDOW_ACCUM_GREEN_SIZE	112
+#define GLUT_WINDOW_ACCUM_BLUE_SIZE	113
+#define GLUT_WINDOW_ACCUM_ALPHA_SIZE	114
+#define GLUT_WINDOW_DOUBLEBUFFER	115
+#define GLUT_WINDOW_RGBA		116
+#define GLUT_WINDOW_PARENT		117
+#define GLUT_WINDOW_NUM_CHILDREN	118
+#define GLUT_WINDOW_COLORMAP_SIZE	119
+#if (GLUT_API_VERSION >= 2)
+#define GLUT_WINDOW_NUM_SAMPLES		120
+#define GLUT_WINDOW_STEREO		121
+#endif
+#if (GLUT_API_VERSION >= 3)
+#define GLUT_WINDOW_CURSOR		122
+#endif
+#define GLUT_SCREEN_WIDTH		200
+#define GLUT_SCREEN_HEIGHT		201
+#define GLUT_SCREEN_WIDTH_MM		202
+#define GLUT_SCREEN_HEIGHT_MM		203
+#define GLUT_MENU_NUM_ITEMS		300
+#define GLUT_DISPLAY_MODE_POSSIBLE	400
+#define GLUT_INIT_WINDOW_X		500
+#define GLUT_INIT_WINDOW_Y		501
+#define GLUT_INIT_WINDOW_WIDTH		502
+#define GLUT_INIT_WINDOW_HEIGHT		503
+#define GLUT_INIT_DISPLAY_MODE		504
+#if (GLUT_API_VERSION >= 2)
+#define GLUT_ELAPSED_TIME		700
+#endif
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
+#define GLUT_WINDOW_FORMAT_ID		123
+#endif
+
+#if (GLUT_API_VERSION >= 2)
+/* glutDeviceGet parameters. */
+#define GLUT_HAS_KEYBOARD		600
+#define GLUT_HAS_MOUSE			601
+#define GLUT_HAS_SPACEBALL		602
+#define GLUT_HAS_DIAL_AND_BUTTON_BOX	603
+#define GLUT_HAS_TABLET			604
+#define GLUT_NUM_MOUSE_BUTTONS		605
+#define GLUT_NUM_SPACEBALL_BUTTONS	606
+#define GLUT_NUM_BUTTON_BOX_BUTTONS	607
+#define GLUT_NUM_DIALS			608
+#define GLUT_NUM_TABLET_BUTTONS		609
+#endif
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
+#define GLUT_DEVICE_IGNORE_KEY_REPEAT   610
+#define GLUT_DEVICE_KEY_REPEAT          611
+#define GLUT_HAS_JOYSTICK		612
+#define GLUT_OWNS_JOYSTICK		613
+#define GLUT_JOYSTICK_BUTTONS		614
+#define GLUT_JOYSTICK_AXES		615
+#define GLUT_JOYSTICK_POLL_RATE		616
+#endif
+
+#if (GLUT_API_VERSION >= 3)
+/* glutLayerGet parameters. */
+#define GLUT_OVERLAY_POSSIBLE           800
+#define GLUT_LAYER_IN_USE		801
+#define GLUT_HAS_OVERLAY		802
+#define GLUT_TRANSPARENT_INDEX		803
+#define GLUT_NORMAL_DAMAGED		804
+#define GLUT_OVERLAY_DAMAGED		805
+
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+/* glutVideoResizeGet parameters. */
+#define GLUT_VIDEO_RESIZE_POSSIBLE	900
+#define GLUT_VIDEO_RESIZE_IN_USE	901
+#define GLUT_VIDEO_RESIZE_X_DELTA	902
+#define GLUT_VIDEO_RESIZE_Y_DELTA	903
+#define GLUT_VIDEO_RESIZE_WIDTH_DELTA	904
+#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA	905
+#define GLUT_VIDEO_RESIZE_X		906
+#define GLUT_VIDEO_RESIZE_Y		907
+#define GLUT_VIDEO_RESIZE_WIDTH		908
+#define GLUT_VIDEO_RESIZE_HEIGHT	909
+#endif
+
+/* glutUseLayer parameters. */
+#define GLUT_NORMAL			0
+#define GLUT_OVERLAY			1
+
+/* glutGetModifiers return mask. */
+#define GLUT_ACTIVE_SHIFT               1
+#define GLUT_ACTIVE_CTRL                2
+#define GLUT_ACTIVE_ALT                 4
+
+/* glutSetCursor parameters. */
+/* Basic arrows. */
+#define GLUT_CURSOR_RIGHT_ARROW		0
+#define GLUT_CURSOR_LEFT_ARROW		1
+/* Symbolic cursor shapes. */
+#define GLUT_CURSOR_INFO		2
+#define GLUT_CURSOR_DESTROY		3
+#define GLUT_CURSOR_HELP		4
+#define GLUT_CURSOR_CYCLE		5
+#define GLUT_CURSOR_SPRAY		6
+#define GLUT_CURSOR_WAIT		7
+#define GLUT_CURSOR_TEXT		8
+#define GLUT_CURSOR_CROSSHAIR		9
+/* Directional cursors. */
+#define GLUT_CURSOR_UP_DOWN		10
+#define GLUT_CURSOR_LEFT_RIGHT		11
+/* Sizing cursors. */
+#define GLUT_CURSOR_TOP_SIDE		12
+#define GLUT_CURSOR_BOTTOM_SIDE		13
+#define GLUT_CURSOR_LEFT_SIDE		14
+#define GLUT_CURSOR_RIGHT_SIDE		15
+#define GLUT_CURSOR_TOP_LEFT_CORNER	16
+#define GLUT_CURSOR_TOP_RIGHT_CORNER	17
+#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER	18
+#define GLUT_CURSOR_BOTTOM_LEFT_CORNER	19
+/* Inherit from parent window. */
+#define GLUT_CURSOR_INHERIT		100
+/* Blank cursor. */
+#define GLUT_CURSOR_NONE		101
+/* Fullscreen crosshair (if available). */
+#define GLUT_CURSOR_FULL_CROSSHAIR	102
+#endif
+
+/* GLUT initialization sub-API. */
+GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
+#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
+GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
+#ifndef GLUT_BUILDING_LIB
+static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
+#define glutInit glutInit_ATEXIT_HACK
+#endif
+#endif
+GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
+#endif
+GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
+GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
+GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
+
+/* GLUT window sub-API. */
+GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
+#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
+GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
+#ifndef GLUT_BUILDING_LIB
+static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
+#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
+#endif
+#endif
+GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
+GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
+GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
+GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
+#endif
+GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
+GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
+GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
+GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
+GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
+GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
+GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
+GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
+GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
+GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
+GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
+GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
+#if (GLUT_API_VERSION >= 3)
+GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
+GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
+#endif
+
+/* GLUT overlay sub-API. */
+GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
+GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
+GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
+GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
+GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
+#endif
+GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
+GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
+#endif
+
+/* GLUT menu sub-API. */
+GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
+#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
+GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
+#ifndef GLUT_BUILDING_LIB
+static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
+#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
+#endif
+#endif
+GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
+GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
+GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
+GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
+GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
+GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
+GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
+GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
+GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
+GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
+
+/* GLUT window callback sub-API. */
+GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
+GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
+GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
+GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
+GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
+GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
+GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
+GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
+GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
+GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
+GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
+#if (GLUT_API_VERSION >= 2)
+GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
+GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
+GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
+GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
+GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
+GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
+GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
+GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
+#if (GLUT_API_VERSION >= 3)
+GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
+GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
+#endif
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
+GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
+GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
+GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
+#endif
+#endif
+#endif
+
+/* GLUT color index sub-API. */
+GLUTAPI void GLUTAPIENTRY glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue);
+GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
+GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
+
+/* GLUT state retrieval sub-API. */
+GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
+GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
+#if (GLUT_API_VERSION >= 2)
+/* GLUT extension support sub-API */
+GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
+#endif
+#if (GLUT_API_VERSION >= 3)
+GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
+GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
+#endif
+#if (GLUT_API_VERSION >= 5)
+typedef void (*GLUTproc)();
+GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName);
+#endif
+
+/* GLUT font sub-API */
+GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
+GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
+GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
+GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
+GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
+#endif
+
+/* GLUT pre-built models sub-API */
+GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
+GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
+GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
+GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
+GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
+GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
+GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
+GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
+GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
+GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
+GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
+GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
+GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
+GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
+GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
+GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
+GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
+GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
+
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+/* GLUT video resize sub-API. */
+GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
+GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
+GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
+GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
+GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
+
+/* GLUT debugging sub-API. */
+GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
+#endif
+
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
+/* GLUT device control sub-API. */
+/* glutSetKeyRepeat modes. */
+#define GLUT_KEY_REPEAT_OFF		0
+#define GLUT_KEY_REPEAT_ON		1
+#define GLUT_KEY_REPEAT_DEFAULT		2
+
+/* Joystick button masks. */
+#define GLUT_JOYSTICK_BUTTON_A		1
+#define GLUT_JOYSTICK_BUTTON_B		2
+#define GLUT_JOYSTICK_BUTTON_C		4
+#define GLUT_JOYSTICK_BUTTON_D		8
+
+GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
+GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
+GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
+
+/* GLUT game mode sub-API. */
+/* glutGameModeGet. */
+#define GLUT_GAME_MODE_ACTIVE           0
+#define GLUT_GAME_MODE_POSSIBLE         1
+#define GLUT_GAME_MODE_WIDTH            2
+#define GLUT_GAME_MODE_HEIGHT           3
+#define GLUT_GAME_MODE_PIXEL_DEPTH      4
+#define GLUT_GAME_MODE_REFRESH_RATE     5
+#define GLUT_GAME_MODE_DISPLAY_CHANGED  6
+
+GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
+GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
+GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
+GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif                  /* __glut_h__ */
diff --git a/src/terralib/drivers/GL/glutf90.h b/src/terralib/drivers/GL/glutf90.h
new file mode 100644
index 0000000..7dc1d67
--- /dev/null
+++ b/src/terralib/drivers/GL/glutf90.h
@@ -0,0 +1,81 @@
+#ifndef __glutf90_h__
+#define __glutf90_h__
+
+/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */
+
+/* This program is freely distributable without licensing fees 
+   and is provided without guarantee or warrantee expressed or 
+   implied. This program is -not- in the public domain. */
+
+/* This header provides the binding interface for William Mitchell's
+   f90gl Fortran 90 GLUT binding.  Other GLUT language bindings
+   can and should use this interace. */
+
+/* I appreciate the guidance from William Mitchell
+   (mitchell at cam.nist.gov) in developing this friend interface
+   for use by the f90gl package.  See ../../README.fortran */
+
+#include <GL/glut.h>
+
+/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */
+/* NOTE These values are part of a binary interface for the f90gl Fortran
+   90 binding and so must NOT changes (additions are allowed). */
+
+/* GLUTwindow callbacks. */
+#define GLUT_FCB_DISPLAY         0    /* GLUTdisplayFCB */
+#define GLUT_FCB_RESHAPE         1    /* GLUTreshapeFCB */
+#define GLUT_FCB_MOUSE           2    /* GLUTmouseFCB */
+#define GLUT_FCB_MOTION          3    /* GLUTmotionFCB */
+#define GLUT_FCB_PASSIVE         4    /* GLUTpassiveFCB */
+#define GLUT_FCB_ENTRY           5    /* GLUTentryFCB */
+#define GLUT_FCB_KEYBOARD        6    /* GLUTkeyboardFCB */
+#define GLUT_FCB_KEYBOARD_UP     7    /* GLUTkeyboardFCB */
+#define GLUT_FCB_WINDOW_STATUS   8    /* GLUTwindowStatusFCB */
+#define GLUT_FCB_VISIBILITY      9    /* GLUTvisibilityFCB */
+#define GLUT_FCB_SPECIAL         10   /* GLUTspecialFCB */
+#define GLUT_FCB_SPECIAL_UP      11   /* GLUTspecialFCB */
+#define GLUT_FCB_BUTTON_BOX      12   /* GLUTbuttonBoxFCB */
+#define GLUT_FCB_DIALS           13   /* GLUTdialsFCB */
+#define GLUT_FCB_SPACE_MOTION    14   /* GLUTspaceMotionFCB */
+#define GLUT_FCB_SPACE_ROTATE    15   /* GLUTspaceRotateFCB */
+#define GLUT_FCB_SPACE_BUTTON    16   /* GLUTspaceButtonFCB */
+#define GLUT_FCB_TABLET_MOTION   17   /* GLUTtabletMotionFCB */
+#define GLUT_FCB_TABLET_BUTTON   18   /* GLUTtabletButtonFCB */
+#define GLUT_FCB_JOYSTICK        19   /* GLUTjoystickFCB */
+/* Non-GLUTwindow callbacks. */
+#define GLUT_FCB_OVERLAY_DISPLAY 100  /* GLUTdisplayFCB */
+#define GLUT_FCB_SELECT          101  /* GLUTselectFCB */
+#define GLUT_FCB_TIMER           102  /* GLUTtimerFCB */
+
+/* GLUT Fortran callback function types. */
+typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void);
+typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *);
+/* NOTE the pressed key is int, not unsigned char for Fortran! */
+typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *);
+typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *);
+typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *);
+typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *);
+typedef void (GLUTCALLBACK *GLUTentryFCB) (int *);
+typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *);
+typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *);
+typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *);
+typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *);
+typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *);
+typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *);
+typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *);
+typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *);
+typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *);
+typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *);
+typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z);
+
+typedef void (GLUTCALLBACK *GLUTselectFCB) (int *);
+typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *);
+typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *);  /* DEPRICATED. */
+typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *);
+typedef void (GLUTCALLBACK *GLUTidleFCB) (void);
+
+/* Functions that set and return Fortran callback functions. */
+GLUTAPI void* APIENTRY __glutGetFCB(int which);
+GLUTAPI void APIENTRY __glutSetFCB(int which, void *func);
+
+#endif  /* __glutf90_h__ */
diff --git a/src/terralib/drivers/GL/glx.h b/src/terralib/drivers/GL/glx.h
new file mode 100644
index 0000000..f829bc5
--- /dev/null
+++ b/src/terralib/drivers/GL/glx.h
@@ -0,0 +1,486 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  6.5
+ * 
+ * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef GLX_H
+#define GLX_H
+
+
+#ifdef __VMS
+#include <GL/vms_x_fix.h>
+# ifdef __cplusplus
+/* VMS Xlib.h gives problems with C++.
+ * this avoids a bunch of trivial warnings */
+#pragma message disable nosimpint
+#endif
+#endif
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#ifdef __VMS
+# ifdef __cplusplus
+#pragma message enable nosimpint
+#endif
+#endif
+#include <GL/gl.h>
+
+
+#if defined(USE_MGL_NAMESPACE)
+#include "glx_mangle.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define GLX_VERSION_1_1		1
+#define GLX_VERSION_1_2		1
+#define GLX_VERSION_1_3		1
+#define GLX_VERSION_1_4		1
+
+#define GLX_EXTENSION_NAME   "GLX"
+
+
+
+/*
+ * Tokens for glXChooseVisual and glXGetConfig:
+ */
+#define GLX_USE_GL		1
+#define GLX_BUFFER_SIZE		2
+#define GLX_LEVEL		3
+#define GLX_RGBA		4
+#define GLX_DOUBLEBUFFER	5
+#define GLX_STEREO		6
+#define GLX_AUX_BUFFERS		7
+#define GLX_RED_SIZE		8
+#define GLX_GREEN_SIZE		9
+#define GLX_BLUE_SIZE		10
+#define GLX_ALPHA_SIZE		11
+#define GLX_DEPTH_SIZE		12
+#define GLX_STENCIL_SIZE	13
+#define GLX_ACCUM_RED_SIZE	14
+#define GLX_ACCUM_GREEN_SIZE	15
+#define GLX_ACCUM_BLUE_SIZE	16
+#define GLX_ACCUM_ALPHA_SIZE	17
+
+
+/*
+ * Error codes returned by glXGetConfig:
+ */
+#define GLX_BAD_SCREEN		1
+#define GLX_BAD_ATTRIBUTE	2
+#define GLX_NO_EXTENSION	3
+#define GLX_BAD_VISUAL		4
+#define GLX_BAD_CONTEXT		5
+#define GLX_BAD_VALUE       	6
+#define GLX_BAD_ENUM		7
+
+
+/*
+ * GLX 1.1 and later:
+ */
+#define GLX_VENDOR		1
+#define GLX_VERSION		2
+#define GLX_EXTENSIONS 		3
+
+
+/*
+ * GLX 1.3 and later:
+ */
+#define GLX_CONFIG_CAVEAT		0x20
+#define GLX_DONT_CARE			0xFFFFFFFF
+#define GLX_X_VISUAL_TYPE		0x22
+#define GLX_TRANSPARENT_TYPE		0x23
+#define GLX_TRANSPARENT_INDEX_VALUE	0x24
+#define GLX_TRANSPARENT_RED_VALUE	0x25
+#define GLX_TRANSPARENT_GREEN_VALUE	0x26
+#define GLX_TRANSPARENT_BLUE_VALUE	0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE	0x28
+#define GLX_WINDOW_BIT			0x00000001
+#define GLX_PIXMAP_BIT			0x00000002
+#define GLX_PBUFFER_BIT			0x00000004
+#define GLX_AUX_BUFFERS_BIT		0x00000010
+#define GLX_FRONT_LEFT_BUFFER_BIT	0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT	0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT	0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT	0x00000008
+#define GLX_DEPTH_BUFFER_BIT		0x00000020
+#define GLX_STENCIL_BUFFER_BIT		0x00000040
+#define GLX_ACCUM_BUFFER_BIT		0x00000080
+#define GLX_NONE			0x8000
+#define GLX_SLOW_CONFIG			0x8001
+#define GLX_TRUE_COLOR			0x8002
+#define GLX_DIRECT_COLOR		0x8003
+#define GLX_PSEUDO_COLOR		0x8004
+#define GLX_STATIC_COLOR		0x8005
+#define GLX_GRAY_SCALE			0x8006
+#define GLX_STATIC_GRAY			0x8007
+#define GLX_TRANSPARENT_RGB		0x8008
+#define GLX_TRANSPARENT_INDEX		0x8009
+#define GLX_VISUAL_ID			0x800B
+#define GLX_SCREEN			0x800C
+#define GLX_NON_CONFORMANT_CONFIG	0x800D
+#define GLX_DRAWABLE_TYPE		0x8010
+#define GLX_RENDER_TYPE			0x8011
+#define GLX_X_RENDERABLE		0x8012
+#define GLX_FBCONFIG_ID			0x8013
+#define GLX_RGBA_TYPE			0x8014
+#define GLX_COLOR_INDEX_TYPE		0x8015
+#define GLX_MAX_PBUFFER_WIDTH		0x8016
+#define GLX_MAX_PBUFFER_HEIGHT		0x8017
+#define GLX_MAX_PBUFFER_PIXELS		0x8018
+#define GLX_PRESERVED_CONTENTS		0x801B
+#define GLX_LARGEST_PBUFFER		0x801C
+#define GLX_WIDTH			0x801D
+#define GLX_HEIGHT			0x801E
+#define GLX_EVENT_MASK			0x801F
+#define GLX_DAMAGED			0x8020
+#define GLX_SAVED			0x8021
+#define GLX_WINDOW			0x8022
+#define GLX_PBUFFER			0x8023
+#define GLX_PBUFFER_HEIGHT              0x8040
+#define GLX_PBUFFER_WIDTH               0x8041
+#define GLX_RGBA_BIT			0x00000001
+#define GLX_COLOR_INDEX_BIT		0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK	0x08000000
+
+
+/*
+ * GLX 1.4 and later:
+ */
+#define GLX_SAMPLE_BUFFERS              0x186a0 /*100000*/
+#define GLX_SAMPLES                     0x186a1 /*100001*/
+
+
+
+typedef struct __GLXcontextRec *GLXContext;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+/* GLX 1.3 and later */
+typedef struct __GLXFBConfigRec *GLXFBConfig;
+typedef XID GLXFBConfigID;
+typedef XID GLXContextID;
+typedef XID GLXWindow;
+typedef XID GLXPbuffer;
+
+
+
+extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
+				     int *attribList );
+
+extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
+				    GLXContext shareList, Bool direct );
+
+extern void glXDestroyContext( Display *dpy, GLXContext ctx );
+
+extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
+			    GLXContext ctx);
+
+extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
+			    unsigned long mask );
+
+extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
+
+extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
+				     Pixmap pixmap );
+
+extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
+
+extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
+
+extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
+
+extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
+			 int attrib, int *value );
+
+extern GLXContext glXGetCurrentContext( void );
+
+extern GLXDrawable glXGetCurrentDrawable( void );
+
+extern void glXWaitGL( void );
+
+extern void glXWaitX( void );
+
+extern void glXUseXFont( Font font, int first, int count, int list );
+
+
+
+/* GLX 1.1 and later */
+extern const char *glXQueryExtensionsString( Display *dpy, int screen );
+
+extern const char *glXQueryServerString( Display *dpy, int screen, int name );
+
+extern const char *glXGetClientString( Display *dpy, int name );
+
+
+/* GLX 1.2 and later */
+extern Display *glXGetCurrentDisplay( void );
+
+
+/* GLX 1.3 and later */
+extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
+                                       const int *attribList, int *nitems );
+
+extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
+                                 int attribute, int *value );
+
+extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
+                                     int *nelements );
+
+extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
+                                              GLXFBConfig config );
+
+extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
+                                  Window win, const int *attribList );
+
+extern void glXDestroyWindow( Display *dpy, GLXWindow window );
+
+extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
+                                  Pixmap pixmap, const int *attribList );
+
+extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
+                                    const int *attribList );
+
+extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
+
+extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
+                              unsigned int *value );
+
+extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
+                                       int renderType, GLXContext shareList,
+                                       Bool direct );
+
+extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
+                                   GLXDrawable read, GLXContext ctx );
+
+extern GLXDrawable glXGetCurrentReadDrawable( void );
+
+extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
+                            int *value );
+
+extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
+                            unsigned long mask );
+
+extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
+                                 unsigned long *mask );
+
+
+/* GLX 1.4 and later */
+extern void (*glXGetProcAddress(const GLubyte *procname))( void );
+
+
+#ifndef GLX_GLXEXT_LEGACY
+
+#include <GL/glxext.h>
+
+#else
+
+
+
+/*
+ * ARB 2. GLX_ARB_get_proc_address
+ */
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+
+typedef void (*__GLXextFuncPtr)(void);
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
+
+#endif /* GLX_ARB_get_proc_address */
+
+
+
+#endif /* GLX_GLXEXT_LEGACY */
+
+
+/**
+ ** The following aren't in glxext.h yet.
+ **/
+
+
+/*
+ * ???. GLX_NV_vertex_array_range
+ */
+#ifndef GLX_NV_vertex_array_range
+#define GLX_NV_vertex_array_range
+
+extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+extern void glXFreeMemoryNV(GLvoid *pointer);
+typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
+
+#endif /* GLX_NV_vertex_array_range */
+
+
+/*
+ * ???. GLX_MESA_allocate_memory
+ */ 
+#ifndef GLX_MESA_allocate_memory
+#define GLX_MESA_allocate_memory 1
+
+extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
+extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer);
+extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer);
+typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
+typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer);
+typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer);
+
+#endif /* GLX_MESA_allocate_memory */
+
+
+/*
+ * Remove this when glxext.h is updated.
+ */
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+
+#define GLX_FLOAT_COMPONENTS_NV         0x20B0
+
+#endif /* GLX_NV_float_buffer */
+
+
+
+/*
+ * #?. GLX_MESA_swap_frame_usage
+ */
+#ifndef GLX_MESA_swap_frame_usage
+#define GLX_MESA_swap_frame_usage 1
+
+extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
+extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
+extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
+extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
+
+typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
+typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
+typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
+typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
+
+#endif /* GLX_MESA_swap_frame_usage */
+
+
+
+/*
+ * #?. GLX_MESA_swap_control
+ */
+#ifndef GLX_MESA_swap_control
+#define GLX_MESA_swap_control 1
+
+extern int glXSwapIntervalMESA(unsigned int interval);
+extern int glXGetSwapIntervalMESA(void);
+
+typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
+typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
+
+#endif /* GLX_MESA_swap_control */
+
+
+
+/*
+ * #?. GLX_EXT_texture_from_pixmap
+ * XXX not finished?
+ */
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap 1
+
+#define GLX_BIND_TO_TEXTURE_RGB_EXT        0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT       0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT     0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT    0x20D3
+#define GLX_Y_INVERTED_EXT                 0x20D4
+
+#define GLX_TEXTURE_FORMAT_EXT             0x20D5
+#define GLX_TEXTURE_TARGET_EXT             0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT             0x20D7
+
+#define GLX_TEXTURE_FORMAT_NONE_EXT        0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT         0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT        0x20DA
+
+#define GLX_TEXTURE_1D_BIT_EXT             0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT             0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT      0x00000004
+
+#define GLX_TEXTURE_1D_EXT                 0x20DB
+#define GLX_TEXTURE_2D_EXT                 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT          0x20DD
+
+#define GLX_FRONT_LEFT_EXT                 0x20DE
+#define GLX_FRONT_RIGHT_EXT                0x20DF
+#define GLX_BACK_LEFT_EXT                  0x20E0
+#define GLX_BACK_RIGHT_EXT                 0x20E1
+#define GLX_FRONT_EXT                      GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT                       GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT                       0x20E2
+#define GLX_AUX1_EXT                       0x20E3 
+#define GLX_AUX2_EXT                       0x20E4 
+#define GLX_AUX3_EXT                       0x20E5 
+#define GLX_AUX4_EXT                       0x20E6 
+#define GLX_AUX5_EXT                       0x20E7 
+#define GLX_AUX6_EXT                       0x20E8
+#define GLX_AUX7_EXT                       0x20E9 
+#define GLX_AUX8_EXT                       0x20EA 
+#define GLX_AUX9_EXT                       0x20EB
+
+extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
+
+#endif /* GLX_EXT_texture_from_pixmap */
+
+
+
+
+/*** Should these go here, or in another header? */
+/*
+** GLX Events
+*/
+typedef struct {
+    int event_type;		/* GLX_DAMAGED or GLX_SAVED */
+    int draw_type;		/* GLX_WINDOW or GLX_PBUFFER */
+    unsigned long serial;	/* # of last request processed by server */
+    Bool send_event;		/* true if this came for SendEvent request */
+    Display *display;		/* display the event was read from */
+    GLXDrawable drawable;	/* XID of Drawable */
+    unsigned int buffer_mask;	/* mask indicating which buffers are affected */
+    unsigned int aux_buffer;	/* which aux buffer was affected */
+    int x, y;
+    int width, height;
+    int count;			/* if nonzero, at least this many more */
+} GLXPbufferClobberEvent;
+
+typedef union __GLXEvent {
+    GLXPbufferClobberEvent glxpbufferclobber;
+    long pad[24];
+} GLXEvent;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/terralib/drivers/GL/glx_mangle.h b/src/terralib/drivers/GL/glx_mangle.h
new file mode 100644
index 0000000..de305bf
--- /dev/null
+++ b/src/terralib/drivers/GL/glx_mangle.h
@@ -0,0 +1,55 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  4.1
+ * Copyright (C) 1995-1998  Brian Paul
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#ifndef GLX_MANGLE_H
+#define GLX_MANGLE_H
+
+#define glXChooseVisual mglXChooseVisual
+#define glXCreateContext mglXCreateContext
+#define glXDestroyContext mglXDestroyContext
+#define glXMakeCurrent mglXMakeCurrent
+#define glXCopyContext mglXCopyContext
+#define glXSwapBuffers mglXSwapBuffers
+#define glXCreateGLXPixmap mglXCreateGLXPixmap
+#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
+#define glXQueryExtension mglXQueryExtension
+#define glXQueryVersion mglXQueryVersion
+#define glXIsDirect mglXIsDirect
+#define glXGetConfig mglXGetConfig
+#define glXGetCurrentContext mglXGetCurrentContext
+#define glXGetCurrentDrawable mglXGetCurrentDrawable
+#define glXWaitGL mglXWaitGL
+#define glXWaitX mglXWaitX
+#define glXUseXFont mglXUseXFont
+#define glXQueryExtensionsString mglXQueryExtensionsString
+#define glXQueryServerString mglXQueryServerString
+#define glXGetClientString mglXGetClientString
+#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
+#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
+#define glXCopySubBufferMESA mglXCopySubBufferMESA
+#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
+#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
+
+/* GLX 1.4 */
+#define glXGetProcAddress mglXGetProcAddress
+
+
+#endif
diff --git a/src/terralib/drivers/GL/glxext.h b/src/terralib/drivers/GL/glxext.h
new file mode 100644
index 0000000..c461039
--- /dev/null
+++ b/src/terralib/drivers/GL/glxext.h
@@ -0,0 +1,693 @@
+#ifndef __glxext_h_
+#define __glxext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+** 
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glxext.h last updated 2004/07/26 */
+/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
+#define GLX_GLXEXT_VERSION 6
+
+#ifndef GLX_VERSION_1_3
+#define GLX_WINDOW_BIT                     0x00000001
+#define GLX_PIXMAP_BIT                     0x00000002
+#define GLX_PBUFFER_BIT                    0x00000004
+#define GLX_RGBA_BIT                       0x00000001
+#define GLX_COLOR_INDEX_BIT                0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK           0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT          0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT         0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT           0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT          0x00000008
+#define GLX_AUX_BUFFERS_BIT                0x00000010
+#define GLX_DEPTH_BUFFER_BIT               0x00000020
+#define GLX_STENCIL_BUFFER_BIT             0x00000040
+#define GLX_ACCUM_BUFFER_BIT               0x00000080
+#define GLX_CONFIG_CAVEAT                  0x20
+#define GLX_X_VISUAL_TYPE                  0x22
+#define GLX_TRANSPARENT_TYPE               0x23
+#define GLX_TRANSPARENT_INDEX_VALUE        0x24
+#define GLX_TRANSPARENT_RED_VALUE          0x25
+#define GLX_TRANSPARENT_GREEN_VALUE        0x26
+#define GLX_TRANSPARENT_BLUE_VALUE         0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE        0x28
+#define GLX_DONT_CARE                      0xFFFFFFFF
+#define GLX_NONE                           0x8000
+#define GLX_SLOW_CONFIG                    0x8001
+#define GLX_TRUE_COLOR                     0x8002
+#define GLX_DIRECT_COLOR                   0x8003
+#define GLX_PSEUDO_COLOR                   0x8004
+#define GLX_STATIC_COLOR                   0x8005
+#define GLX_GRAY_SCALE                     0x8006
+#define GLX_STATIC_GRAY                    0x8007
+#define GLX_TRANSPARENT_RGB                0x8008
+#define GLX_TRANSPARENT_INDEX              0x8009
+#define GLX_VISUAL_ID                      0x800B
+#define GLX_SCREEN                         0x800C
+#define GLX_NON_CONFORMANT_CONFIG          0x800D
+#define GLX_DRAWABLE_TYPE                  0x8010
+#define GLX_RENDER_TYPE                    0x8011
+#define GLX_X_RENDERABLE                   0x8012
+#define GLX_FBCONFIG_ID                    0x8013
+#define GLX_RGBA_TYPE                      0x8014
+#define GLX_COLOR_INDEX_TYPE               0x8015
+#define GLX_MAX_PBUFFER_WIDTH              0x8016
+#define GLX_MAX_PBUFFER_HEIGHT             0x8017
+#define GLX_MAX_PBUFFER_PIXELS             0x8018
+#define GLX_PRESERVED_CONTENTS             0x801B
+#define GLX_LARGEST_PBUFFER                0x801C
+#define GLX_WIDTH                          0x801D
+#define GLX_HEIGHT                         0x801E
+#define GLX_EVENT_MASK                     0x801F
+#define GLX_DAMAGED                        0x8020
+#define GLX_SAVED                          0x8021
+#define GLX_WINDOW                         0x8022
+#define GLX_PBUFFER                        0x8023
+#define GLX_PBUFFER_HEIGHT                 0x8040
+#define GLX_PBUFFER_WIDTH                  0x8041
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_SAMPLE_BUFFERS                 100000
+#define GLX_SAMPLES                        100001
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_SAMPLE_BUFFERS_ARB             100000
+#define GLX_SAMPLES_ARB                    100001
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SAMPLE_BUFFERS_SGIS            100000
+#define GLX_SAMPLES_SGIS                   100001
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_X_VISUAL_TYPE_EXT              0x22
+#define GLX_TRANSPARENT_TYPE_EXT           0x23
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT    0x24
+#define GLX_TRANSPARENT_RED_VALUE_EXT      0x25
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT    0x26
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT     0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT    0x28
+#define GLX_NONE_EXT                       0x8000
+#define GLX_TRUE_COLOR_EXT                 0x8002
+#define GLX_DIRECT_COLOR_EXT               0x8003
+#define GLX_PSEUDO_COLOR_EXT               0x8004
+#define GLX_STATIC_COLOR_EXT               0x8005
+#define GLX_GRAY_SCALE_EXT                 0x8006
+#define GLX_STATIC_GRAY_EXT                0x8007
+#define GLX_TRANSPARENT_RGB_EXT            0x8008
+#define GLX_TRANSPARENT_INDEX_EXT          0x8009
+#endif
+
+#ifndef GLX_SGI_swap_control
+#endif
+
+#ifndef GLX_SGI_video_sync
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#endif
+
+#ifndef GLX_SGIX_video_source
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_VISUAL_CAVEAT_EXT              0x20
+#define GLX_SLOW_VISUAL_EXT                0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT      0x800D
+/* reuse GLX_NONE_EXT */
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_SHARE_CONTEXT_EXT              0x800A
+#define GLX_VISUAL_ID_EXT                  0x800B
+#define GLX_SCREEN_EXT                     0x800C
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_WINDOW_BIT_SGIX                0x00000001
+#define GLX_PIXMAP_BIT_SGIX                0x00000002
+#define GLX_RGBA_BIT_SGIX                  0x00000001
+#define GLX_COLOR_INDEX_BIT_SGIX           0x00000002
+#define GLX_DRAWABLE_TYPE_SGIX             0x8010
+#define GLX_RENDER_TYPE_SGIX               0x8011
+#define GLX_X_RENDERABLE_SGIX              0x8012
+#define GLX_FBCONFIG_ID_SGIX               0x8013
+#define GLX_RGBA_TYPE_SGIX                 0x8014
+#define GLX_COLOR_INDEX_TYPE_SGIX          0x8015
+/* reuse GLX_SCREEN_EXT */
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_PBUFFER_BIT_SGIX               0x00000004
+#define GLX_BUFFER_CLOBBER_MASK_SGIX       0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX     0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX    0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT_SGIX      0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX     0x00000008
+#define GLX_AUX_BUFFERS_BIT_SGIX           0x00000010
+#define GLX_DEPTH_BUFFER_BIT_SGIX          0x00000020
+#define GLX_STENCIL_BUFFER_BIT_SGIX        0x00000040
+#define GLX_ACCUM_BUFFER_BIT_SGIX          0x00000080
+#define GLX_SAMPLE_BUFFERS_BIT_SGIX        0x00000100
+#define GLX_MAX_PBUFFER_WIDTH_SGIX         0x8016
+#define GLX_MAX_PBUFFER_HEIGHT_SGIX        0x8017
+#define GLX_MAX_PBUFFER_PIXELS_SGIX        0x8018
+#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX     0x8019
+#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX    0x801A
+#define GLX_PRESERVED_CONTENTS_SGIX        0x801B
+#define GLX_LARGEST_PBUFFER_SGIX           0x801C
+#define GLX_WIDTH_SGIX                     0x801D
+#define GLX_HEIGHT_SGIX                    0x801E
+#define GLX_EVENT_MASK_SGIX                0x801F
+#define GLX_DAMAGED_SGIX                   0x8020
+#define GLX_SAVED_SGIX                     0x8021
+#define GLX_WINDOW_SGIX                    0x8022
+#define GLX_PBUFFER_SGIX                   0x8023
+#endif
+
+#ifndef GLX_SGI_cushion
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SYNC_FRAME_SGIX                0x00000000
+#define GLX_SYNC_SWAP_SGIX                 0x00000001
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX     0x8024
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#endif
+
+#ifndef GLX_SGIS_blended_overlay
+#define GLX_BLENDED_RGBA_SGIS              0x8025
+#endif
+
+#ifndef GLX_SGIS_shared_multisample
+#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
+#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#endif
+
+#ifndef GLX_3DFX_multisample
+#define GLX_SAMPLE_BUFFERS_3DFX            0x8050
+#define GLX_SAMPLES_3DFX                   0x8051
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_3DFX_WINDOW_MODE_MESA          0x1
+#define GLX_3DFX_FULLSCREEN_MODE_MESA      0x2
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_VISUAL_SELECT_GROUP_SGIX       0x8028
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_SWAP_METHOD_OML                0x8060
+#define GLX_SWAP_EXCHANGE_OML              0x8061
+#define GLX_SWAP_COPY_OML                  0x8062
+#define GLX_SWAP_UNDEFINED_OML             0x8063
+#endif
+
+#ifndef GLX_OML_sync_control
+#endif
+
+#ifndef GLX_SGIX_hyperpipe_group
+#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
+#define GLX_BAD_HYPERPIPE_CONFIG_SGIX      91
+#define GLX_BAD_HYPERPIPE_SGIX             92
+#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX    0x00000001
+#define GLX_HYPERPIPE_RENDER_PIPE_SGIX     0x00000002
+#define GLX_PIPE_RECT_SGIX                 0x00000001
+#define GLX_PIPE_RECT_LIMITS_SGIX          0x00000002
+#define GLX_HYPERPIPE_STEREO_SGIX          0x00000003
+#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX   0x00000004
+#define GLX_HYPERPIPE_ID_SGIX              0x8030
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#endif
+
+
+/*************************************************************/
+
+#ifndef GLX_ARB_get_proc_address
+typedef void (*__GLXextFuncPtr)(void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+typedef XID GLXVideoSourceSGIX;
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+typedef XID GLXFBConfigIDSGIX;
+typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+typedef XID GLXPbufferSGIX;
+typedef struct {
+    int type;
+    unsigned long serial;	  /* # of last request processed by server */
+    Bool send_event;		  /* true if this came for SendEvent request */
+    Display *display;		  /* display the event was read from */
+    GLXDrawable drawable;	  /* i.d. of Drawable */
+    int event_type;		  /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
+    int draw_type;		  /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
+    unsigned int mask;	  /* mask indicating which buffers are affected*/
+    int x, y;
+    int width, height;
+    int count;		  /* if nonzero, at least this many more */
+} GLXBufferClobberEventSGIX;
+#endif
+
+#if defined(__sun__) || defined(__osf__)
+#include <inttypes.h>
+#if defined(__STDC__)
+#if defined(__arch64__)
+typedef long int int64_t;
+#else
+typedef long long int int64_t;   
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+#elif defined( __VMS )
+#include <inttypes.h>
+#elif defined(__SCO__) || defined(__USLC__)
+#include <stdint.h>
+#elif defined(WIN32) && defined(__GNUC__)
+#include <stdint.h>
+#endif
+
+#ifndef GLX_VERSION_1_3
+#define GLX_VERSION_1_3 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *);
+extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *);
+extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *);
+extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig);
+extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *);
+extern void glXDestroyWindow (Display *, GLXWindow);
+extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *);
+extern void glXDestroyPixmap (Display *, GLXPixmap);
+extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *);
+extern void glXDestroyPbuffer (Display *, GLXPbuffer);
+extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *);
+extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool);
+extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext);
+extern GLXDrawable glXGetCurrentReadDrawable (void);
+extern Display * glXGetCurrentDisplay (void);
+extern int glXQueryContext (Display *, GLXContext, int, int *);
+extern void glXSelectEvent (Display *, GLXDrawable, unsigned long);
+extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
+typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
+typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
+typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
+typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
+typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_VERSION_1_4 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_ARB_multisample 1
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SGIS_multisample 1
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_EXT_visual_info 1
+#endif
+
+#ifndef GLX_SGI_swap_control
+#define GLX_SGI_swap_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXSwapIntervalSGI (int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
+#endif
+
+#ifndef GLX_SGI_video_sync
+#define GLX_SGI_video_sync 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetVideoSyncSGI (unsigned int *);
+extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
+typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#define GLX_SGI_make_current_read 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext);
+extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+#define GLX_SGIX_video_source 1
+#ifdef _VL_H
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode);
+extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
+typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
+#endif /* _VL_H */
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_EXT_visual_rating 1
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_EXT_import_context 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Display * glXGetCurrentDisplayEXT (void);
+extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
+extern GLXContextID glXGetContextIDEXT (const GLXContext);
+extern GLXContext glXImportContextEXT (Display *, GLXContextID);
+extern void glXFreeContextEXT (Display *, GLXContext);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
+typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
+typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
+typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_SGIX_fbconfig 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *);
+extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *);
+extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap);
+extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
+extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX);
+extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
+typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
+typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_SGIX_pbuffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
+extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX);
+extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *);
+extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long);
+extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
+typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
+#endif
+
+#ifndef GLX_SGI_cushion
+#define GLX_SGI_cushion 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCushionSGI (Display *, Window, float);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SGIX_video_resize 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXBindChannelToWindowSGIX (Display *, int, int, Window);
+extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int);
+extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *);
+extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *);
+extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
+typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
+typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
+typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
+typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_SGIX_dmbuffer 1
+#ifdef _DM_BUFFER_H_
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
+#endif /* _DM_BUFFER_H_ */
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#define GLX_SGIX_swap_group 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#define GLX_SGIX_swap_barrier 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int);
+extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
+typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#define GLX_SUN_get_transparent_index 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#define GLX_MESA_copy_sub_buffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#define GLX_MESA_pixmap_colormap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#define GLX_MESA_release_buffers 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_MESA_set_3dfx_mode 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXSet3DfxModeMESA (int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_SGIX_visual_select_group 1
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_OML_swap_method 1
+#endif
+
+#ifndef GLX_OML_sync_control
+#define GLX_OML_sync_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
+extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
+extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t);
+extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *);
+extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
+typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
+typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
+#endif
+
+#ifndef GLX_SGIX_hyperpipe_group
+#define GLX_SGIX_hyperpipe_group 1
+
+typedef struct {
+    char    pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+    int     networkId;
+} GLXHyperpipeNetworkSGIX;
+
+typedef struct {
+    char    pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+    int     channel;
+    unsigned int
+      participationType;
+    int     timeSlice;
+} GLXHyperpipeConfigSGIX;
+
+typedef struct {
+    char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+    int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
+    int destXOrigin, destYOrigin, destWidth, destHeight;
+} GLXPipeRect;
+
+typedef struct {
+    char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+    int XOrigin, YOrigin, maxHeight, maxWidth;
+} GLXPipeRectLimits;
+
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *);
+extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *);
+extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *);
+extern int glXDestroyHyperpipeConfigSGIX (Display *, int);
+extern int glXBindHyperpipeSGIX (Display *, int);
+extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *);
+extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *);
+extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
+typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
+typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
+typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
+typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
+typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#define GLX_MESA_agp_offset 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern unsigned int glXGetAGPOffsetMESA (const void *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/terralib/drivers/GL/glxint.h b/src/terralib/drivers/GL/glxint.h
new file mode 100644
index 0000000..2747964
--- /dev/null
+++ b/src/terralib/drivers/GL/glxint.h
@@ -0,0 +1,129 @@
+#ifndef __GLX_glxint_h__
+#define __GLX_glxint_h__
+
+/* $XFree86: xc/include/GL/glxint.h,v 1.3 2000/11/18 19:37:04 tsi Exp $ */
+/*
+** The contents of this file are subject to the GLX Public License Version 1.0
+** (the "License"). You may not use this file except in compliance with the
+** License. You may obtain a copy of the License at Silicon Graphics, Inc.,
+** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
+** or at http://www.sgi.com/software/opensource/glx/license.html.
+**
+** Software distributed under the License is distributed on an "AS IS"
+** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
+** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
+** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
+** language governing rights and limitations under the License.
+**
+** The Original Software is GLX version 1.2 source code, released February,
+** 1999. The developer of the Original Software is Silicon Graphics, Inc.
+** Those portions of the Subject Software created by Silicon Graphics, Inc.
+** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
+**
+** $SGI$
+*/
+
+#include <X11/X.h>
+#include <X11/Xdefs.h>
+#include "GL/gl.h"
+
+typedef struct __GLXvisualConfigRec __GLXvisualConfig;
+typedef struct __GLXFBConfigRec __GLXFBConfig;
+
+struct __GLXvisualConfigRec {
+    VisualID vid;
+    int class;
+    Bool rgba;
+    int redSize, greenSize, blueSize, alphaSize;
+    unsigned long redMask, greenMask, blueMask, alphaMask;
+    int accumRedSize, accumGreenSize, accumBlueSize, accumAlphaSize;
+    Bool doubleBuffer;
+    Bool stereo;
+    int bufferSize;
+    int depthSize;
+    int stencilSize;
+    int auxBuffers;
+    int level;
+    /* Start of Extended Visual Properties */
+    int visualRating;		/* visual_rating extension */
+    int transparentPixel;	/* visual_info extension */
+				/*    colors are floats scaled to ints */
+    int transparentRed, transparentGreen, transparentBlue, transparentAlpha;
+    int transparentIndex;
+    int multiSampleSize;
+    int nMultiSampleBuffers;
+    int visualSelectGroup;
+};
+
+#define __GLX_MIN_CONFIG_PROPS	18
+#define __GLX_MAX_CONFIG_PROPS	500
+
+#define __GLX_EXT_CONFIG_PROPS 	10
+
+/*
+** Since we send all non-core visual properties as token, value pairs,
+** we require 2 words across the wire. In order to maintain backwards
+** compatibility, we need to send the total number of words that the
+** VisualConfigs are sent back in so old libraries can simply "ignore"
+** the new properties. 
+*/
+#define __GLX_TOTAL_CONFIG       (__GLX_MIN_CONFIG_PROPS +      \
+                                    2 * __GLX_EXT_CONFIG_PROPS)
+
+struct __GLXFBConfigRec {
+    int visualType;
+    int transparentType;
+                                /*    colors are floats scaled to ints */
+    int transparentRed, transparentGreen, transparentBlue, transparentAlpha;
+    int transparentIndex;
+
+    int visualCaveat;
+
+    int associatedVisualId;
+    int screen;
+
+    int drawableType;
+    int renderType;
+
+    int maxPbufferWidth, maxPbufferHeight, maxPbufferPixels;
+    int optimalPbufferWidth, optimalPbufferHeight;  /* for SGIX_pbuffer */
+
+    int visualSelectGroup;	/* visuals grouped by select priority */
+
+    unsigned int id;          
+
+    GLboolean rgbMode;
+    GLboolean colorIndexMode;
+    GLboolean doubleBufferMode;
+    GLboolean stereoMode;
+    GLboolean haveAccumBuffer;
+    GLboolean haveDepthBuffer;
+    GLboolean haveStencilBuffer;
+
+    /* The number of bits present in various buffers */
+    GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
+    GLint depthBits;
+    GLint stencilBits;
+    GLint indexBits;
+    GLint redBits, greenBits, blueBits, alphaBits;
+    GLuint redMask, greenMask, blueMask, alphaMask;
+
+    GLuint multiSampleSize;     /* Number of samples per pixel (0 if no ms) */
+
+    GLuint nMultiSampleBuffers; /* Number of availble ms buffers */
+    GLint maxAuxBuffers;
+
+    /* frame buffer level */
+    GLint level;
+
+    /* color ranges (for SGI_color_range) */
+    GLboolean extendedRange;
+    GLdouble minRed, maxRed;
+    GLdouble minGreen, maxGreen;
+    GLdouble minBlue, maxBlue;
+    GLdouble minAlpha, maxAlpha;
+};
+
+#define __GLX_TOTAL_FBCONFIG_PROPS	 35
+
+#endif /* !__GLX_glxint_h__ */
diff --git a/src/terralib/drivers/GL/glxmd.h b/src/terralib/drivers/GL/glxmd.h
new file mode 100644
index 0000000..ab9c303
--- /dev/null
+++ b/src/terralib/drivers/GL/glxmd.h
@@ -0,0 +1,58 @@
+#ifndef _GLX_glxmd_h_
+#define _GLX_glxmd_h_
+
+/* $XFree86: xc/include/GL/glxmd.h,v 1.2 1999/06/14 07:23:28 dawes Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+/*
+** Machine dependent declarations.
+*/
+
+/*
+** Define floating point wire types.  These are in IEEE format on the wire.
+*/
+typedef float FLOAT32;
+typedef double FLOAT64;
+
+/*
+** Like B32, but this is used to store floats in a request.
+**
+** NOTE: Machines that have a native 32-bit IEEE float can define this as 
+**       nothing.  Machines that don't might mimic the float with an integer,
+**       and then define this to :32.
+*/
+#define F32
+
+#endif /* _GLX_glxmd_h_ */
diff --git a/src/terralib/drivers/GL/glxproto.h b/src/terralib/drivers/GL/glxproto.h
new file mode 100644
index 0000000..0fe68be
--- /dev/null
+++ b/src/terralib/drivers/GL/glxproto.h
@@ -0,0 +1,2527 @@
+#ifndef _GLX_glxproto_h_
+#define _GLX_glxproto_h_
+
+/* $XFree86: xc/include/GL/glxproto.h,v 1.6 2003/09/28 20:14:58 alanh Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+#include <GL/glxmd.h>
+
+/*****************************************************************************/
+
+/*
+** Errrors.
+*/
+#define GLXBadContext		0
+#define GLXBadContextState	1
+#define GLXBadDrawable		2
+#define GLXBadPixmap		3
+#define GLXBadContextTag	4
+#define GLXBadCurrentWindow	5
+#define GLXBadRenderRequest	6
+#define GLXBadLargeRequest	7
+#define GLXUnsupportedPrivateRequest	8
+#define GLXBadFBConfig		9
+#define GLXBadPbuffer		10
+#define GLXBadCurrentDrawable	11
+#define GLXBadWindow		12
+
+#define __GLX_NUMBER_ERRORS 12
+
+/*
+** Events.
+** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX
+**  event - this helps initialization if the server supports the pbuffer
+**  extension and the client doesn't.
+*/
+#define GLX_PbufferClobber	0
+
+#define __GLX_NUMBER_EVENTS 17
+
+#define GLX_EXTENSION_NAME	"GLX"
+#define GLX_EXTENSION_ALIAS	"SGI-GLX"
+
+#define __GLX_MAX_CONTEXT_PROPS 3
+
+#ifndef GLX_VENDOR
+#define GLX_VENDOR		0x1
+#endif
+#ifndef GLX_VERSION
+#define GLX_VERSION		0x2
+#endif
+#ifndef GLX_EXTENSIONS
+#define GLX_EXTENSIONS		0x3
+#endif
+
+/*****************************************************************************/
+
+/*
+** For the structure definitions in this file, we must redefine these types in
+** terms of Xmd.h types, which may include bitfields.  All of these are
+** undef'ed at the end of this file, restoring the definitions in glx.h.
+*/
+#define GLXContextID CARD32
+#define GLXPixmap CARD32
+#define GLXDrawable CARD32
+#define GLXPbuffer CARD32
+#define GLXWindow CARD32
+#define GLXFBConfigID CARD32
+#define GLXFBConfigIDSGIX CARD32
+#define GLXPbufferSGIX CARD32
+
+/*
+** ContextTag is not exposed to the API.
+*/
+typedef CARD32 GLXContextTag;
+
+/*****************************************************************************/
+
+/*
+** Sizes of basic wire types.
+*/
+#define __GLX_SIZE_INT8		1
+#define __GLX_SIZE_INT16	2
+#define __GLX_SIZE_INT32	4
+#define __GLX_SIZE_CARD8	1
+#define __GLX_SIZE_CARD16	2
+#define __GLX_SIZE_CARD32	4
+#define __GLX_SIZE_FLOAT32	4
+#define __GLX_SIZE_FLOAT64	8
+
+/*****************************************************************************/
+
+/* Requests */
+
+/*
+** Render command request.  A bunch of rendering commands are packed into
+** a single X extension request.
+*/
+typedef struct GLXRender {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextTag contextTag B32;
+} xGLXRenderReq;
+#define sz_xGLXRenderReq 8
+
+/*
+** The maximum size that a GLXRender command can be.  The value must fit
+** in 16 bits and should be a multiple of 4.
+*/
+#define __GLX_MAX_RENDER_CMD_SIZE	64000
+
+/*
+** Large render command request.  A single large rendering command
+** is output in multiple X extension requests.	The first packet
+** contains an opcode dependent header (see below) that describes
+** the data that follows.
+*/
+typedef struct GLXRenderLarge {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextTag contextTag B32;
+    CARD16	requestNumber B16;
+    CARD16	requestTotal B16;
+    CARD32	dataBytes B32;
+} xGLXRenderLargeReq;
+#define sz_xGLXRenderLargeReq 16
+
+/*
+** GLX single request.	Commands that go over as single GLX protocol
+** requests use this structure.  The glxCode will be one of the X_GLsop
+** opcodes.
+*/
+typedef struct GLXSingle {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextTag contextTag B32;
+} xGLXSingleReq;
+#define sz_xGLXSingleReq 8
+
+/*
+** glXQueryVersion request
+*/
+typedef struct GLXQueryVersion {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	majorVersion B32;
+    CARD32	minorVersion B32;
+} xGLXQueryVersionReq;
+#define sz_xGLXQueryVersionReq 12
+
+/*
+** glXIsDirect request
+*/
+typedef struct GLXIsDirect {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextID context B32;
+} xGLXIsDirectReq;
+#define sz_xGLXIsDirectReq 8
+
+/*
+** glXCreateContext request
+*/
+typedef struct GLXCreateContext {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextID context B32;
+    CARD32	visual B32;
+    CARD32	screen B32;
+    GLXContextID shareList B32;
+    BOOL	isDirect;
+    CARD8	reserved1;
+    CARD16	reserved2 B16;
+} xGLXCreateContextReq;
+#define sz_xGLXCreateContextReq 24
+
+/*
+** glXDestroyContext request
+*/
+typedef struct GLXDestroyContext {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextID context B32;
+} xGLXDestroyContextReq;
+#define sz_xGLXDestroyContextReq 8
+
+/*
+** glXMakeCurrent request
+*/
+typedef struct GLXMakeCurrent {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXDrawable drawable B32;
+    GLXContextID context B32;
+    GLXContextTag oldContextTag B32;
+} xGLXMakeCurrentReq;
+#define sz_xGLXMakeCurrentReq 16
+
+/*
+** glXWaitGL request
+*/
+typedef struct GLXWaitGL {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextTag contextTag B32;
+} xGLXWaitGLReq;
+#define sz_xGLXWaitGLReq 8
+
+/*
+** glXWaitX request
+*/
+typedef struct GLXWaitX {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextTag contextTag B32;
+} xGLXWaitXReq;
+#define sz_xGLXWaitXReq 8
+
+/*
+** glXCopyContext request
+*/
+typedef struct GLXCopyContext {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextID source B32;
+    GLXContextID dest B32;
+    CARD32	mask B32;
+    GLXContextTag contextTag B32;
+} xGLXCopyContextReq;
+#define sz_xGLXCopyContextReq 20
+
+/*
+** glXSwapBuffers request
+*/
+typedef struct GLXSwapBuffers {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextTag contextTag B32;
+    GLXDrawable drawable B32;
+} xGLXSwapBuffersReq;
+#define sz_xGLXSwapBuffersReq 12
+
+/*
+** glXUseXFont request
+*/
+typedef struct GLXUseXFont {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextTag contextTag B32;
+    CARD32	font B32;
+    CARD32	first B32;
+    CARD32	count B32;
+    CARD32	listBase B32;
+} xGLXUseXFontReq;
+#define sz_xGLXUseXFontReq 24
+
+/*
+** glXCreateGLXPixmap request
+*/
+typedef struct GLXCreateGLXPixmap {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	screen B32;
+    CARD32	visual B32;
+    CARD32	pixmap B32;
+    GLXPixmap	glxpixmap B32;
+} xGLXCreateGLXPixmapReq;
+#define sz_xGLXCreateGLXPixmapReq 20
+
+/*
+** glXDestroyGLXPixmap request
+*/
+typedef struct GLXDestroyGLXPixmap {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXPixmap	glxpixmap B32;
+} xGLXDestroyGLXPixmapReq;
+#define sz_xGLXDestroyGLXPixmapReq 8
+
+/*
+** glXGetVisualConfigs request
+*/
+typedef struct GLXGetVisualConfigs {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	screen B32;
+} xGLXGetVisualConfigsReq;
+#define sz_xGLXGetVisualConfigsReq 8
+
+/*
+** glXVendorPrivate request.
+*/
+typedef struct GLXVendorPrivate {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	vendorCode B32;		/* vendor-specific opcode */
+    GLXContextTag contextTag B32;
+    /*
+    ** More data may follow; this is just the header.
+    */
+} xGLXVendorPrivateReq;
+#define sz_xGLXVendorPrivateReq 12
+
+/*
+** glXVendorPrivateWithReply request
+*/
+typedef struct GLXVendorPrivateWithReply {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	vendorCode B32;		/* vendor-specific opcode */
+    GLXContextTag contextTag B32;
+    /*
+    ** More data may follow; this is just the header.
+    */
+} xGLXVendorPrivateWithReplyReq;
+#define sz_xGLXVendorPrivateWithReplyReq 12
+
+/*
+** glXQueryExtensionsString request
+*/
+typedef struct GLXQueryExtensionsString {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	screen B32;
+} xGLXQueryExtensionsStringReq;
+#define sz_xGLXQueryExtensionsStringReq 8
+
+/*
+** glXQueryServerString request
+*/
+typedef struct GLXQueryServerString {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	screen	B32;
+    CARD32	name B32;
+} xGLXQueryServerStringReq;
+#define sz_xGLXQueryServerStringReq 12
+
+/*
+** glXClientInfo request
+*/
+typedef struct GLXClientInfo {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	major B32;
+    CARD32	minor B32;
+    CARD32	numbytes B32;
+} xGLXClientInfoReq;
+#define sz_xGLXClientInfoReq 16
+
+/*** Start of GLX 1.3 requests */
+
+/*
+** glXGetFBConfigs request
+*/
+typedef struct GLXGetFBConfigs {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	screen B32;
+} xGLXGetFBConfigsReq;
+#define sz_xGLXGetFBConfigsReq 8
+
+/*
+** glXCreatePixmap request
+*/
+typedef struct GLXCreatePixmap {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	screen B32;
+    GLXFBConfigID fbconfig B32;
+    CARD32	pixmap B32;
+    GLXPixmap	glxpixmap B32;
+    CARD32	numAttribs B32;
+    /* followed by attribute list */
+} xGLXCreatePixmapReq;
+#define sz_xGLXCreatePixmapReq 24
+
+/*
+** glXDestroyPixmap request
+*/
+typedef struct GLXDestroyPixmap {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXPixmap	glxpixmap B32;
+} xGLXDestroyPixmapReq;
+#define sz_xGLXDestroyPixmapReq 8
+
+/*
+** glXCreateNewContext request
+*/
+typedef struct GLXCreateNewContext {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextID context B32;
+    GLXFBConfigID fbconfig B32;
+    CARD32	screen B32;
+    CARD32	renderType;
+    GLXContextID shareList B32;
+    BOOL	isDirect;
+    CARD8	reserved1;
+    CARD16	reserved2 B16;
+} xGLXCreateNewContextReq;
+#define sz_xGLXCreateNewContextReq 28
+
+/*
+** glXQueryContext request
+*/
+typedef struct GLXQueryContext {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextID context B32;
+} xGLXQueryContextReq;
+#define sz_xGLXQueryContextReq 8
+
+/*
+** glXMakeContextCurrent request
+*/
+typedef struct GLXMakeContextCurrent {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXContextTag oldContextTag B32;
+    GLXDrawable drawable B32;
+    GLXDrawable readdrawable B32;
+    GLXContextID context B32;
+} xGLXMakeContextCurrentReq;
+#define sz_xGLXMakeContextCurrentReq 20
+
+/*
+** glXCreatePbuffer request
+*/
+typedef struct GLXCreatePbuffer {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	screen B32;
+    GLXFBConfigID fbconfig B32;
+    GLXPbuffer	pbuffer B32;
+    CARD32	numAttribs B32;
+    /* followed by attribute list */
+} xGLXCreatePbufferReq;
+#define sz_xGLXCreatePbufferReq 20
+
+/*
+** glXDestroyPbuffer request
+*/
+typedef struct GLXDestroyPbuffer {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXPbuffer	pbuffer B32;
+} xGLXDestroyPbufferReq;
+#define sz_xGLXDestroyPbufferReq 8
+
+/*
+** glXGetDrawableAttributes request
+*/
+typedef struct GLXGetDrawableAttributes {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXDrawable drawable B32;
+} xGLXGetDrawableAttributesReq;
+#define sz_xGLXGetDrawableAttributesReq 8
+
+/*
+** glXChangeDrawableAttributes request
+*/
+typedef struct GLXChangeDrawableAttributes {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXDrawable drawable B32;
+    CARD32	numAttribs B32;
+    /* followed by attribute list */
+} xGLXChangeDrawableAttributesReq;
+#define sz_xGLXChangeDrawableAttributesReq 12
+
+/*
+** glXCreateWindow request
+*/
+typedef struct GLXCreateWindow {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	screen B32;
+    GLXFBConfigID fbconfig B32;
+    CARD32	window B32;
+    GLXWindow	glxwindow B32;
+    CARD32	numAttribs B32;
+    /* followed by attribute list */
+} xGLXCreateWindowReq;
+#define sz_xGLXCreateWindowReq 24
+
+/*
+** glXDestroyWindow request
+*/
+typedef struct GLXDestroyWindow {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    GLXWindow	glxwindow B32;
+} xGLXDestroyWindowReq;
+#define sz_xGLXDestroyWindowReq 8
+
+/* Replies */
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	error B32;
+    CARD32	pad2 B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXGetErrorReply;
+#define sz_xGLXGetErrorReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    GLXContextTag contextTag B32;
+    CARD32	pad2 B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXMakeCurrentReply;
+#define sz_xGLXMakeCurrentReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	pad1 B32;
+    CARD32	pad2 B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXReadPixelsReply;
+#define sz_xGLXReadPixelsReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	pad1 B32;
+    CARD32	pad2 B32;
+    CARD32	width B32;
+    CARD32	height B32;
+    CARD32	depth B32;
+    CARD32	pad6 B32;
+} xGLXGetTexImageReply;
+#define sz_xGLXGetTexImageReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	pad1 B32;
+    CARD32	pad2 B32;
+    CARD32	width B32;
+    CARD32	height B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXGetSeparableFilterReply;
+#define sz_xGLXGetSeparableFilterReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	pad1 B32;
+    CARD32	pad2 B32;
+    CARD32	width B32;
+    CARD32	height B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXGetConvolutionFilterReply;
+#define sz_xGLXGetConvolutionFilterReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	pad1 B32;
+    CARD32	pad2 B32;
+    CARD32	width B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXGetHistogramReply;
+#define sz_xGLXGetHistogramReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	pad1 B32;
+    CARD32	pad2 B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXGetMinmaxReply;
+#define sz_xGLXGetMinmaxReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	retval B32;
+    CARD32	size B32;
+    CARD32	newMode B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXRenderModeReply;
+#define sz_xGLXRenderModeReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	majorVersion B32;
+    CARD32	minorVersion B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXQueryVersionReply;
+#define sz_xGLXQueryVersionReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	numVisuals B32;
+    CARD32	numProps B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXGetVisualConfigsReply;
+#define sz_xGLXGetVisualConfigsReply 32
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    BOOL	isDirect;
+    CARD8	pad1;
+    CARD16	pad2 B16;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+    CARD32	pad7 B32;
+} xGLXIsDirectReply;
+#define sz_xGLXIsDirectReply	32
+
+/*
+** This reply structure is used for all single replies.  Single replies
+** ship either 1 piece of data or N pieces of data.  In these cases
+** size indicates how much data is to be returned.
+*/
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	retval B32;
+    CARD32	size B32;
+    CARD32	pad3 B32;		/* NOTE: may hold a single value */
+    CARD32	pad4 B32;		/* NOTE: may hold half a double */
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXSingleReply;
+#define sz_xGLXSingleReply 32
+
+/*
+** This reply structure is used for all Vendor Private replies. Vendor
+** Private replies can ship up to 24 bytes within the header or can
+** be variable sized, in which case, the reply length field indicates
+** the number of words of data which follow the header.
+*/
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	retval B32;
+    CARD32	size B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXVendorPrivReply;
+#define sz_xGLXVendorPrivReply 32
+
+/*
+**  QueryExtensionsStringReply
+**  n indicates the number of bytes to be returned.
+*/
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	pad1 B32;
+    CARD32	n B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXQueryExtensionsStringReply;
+#define sz_xGLXQueryExtensionsStringReply 32
+
+/*
+** QueryServerString Reply struct
+** n indicates the number of bytes to be returned.
+*/
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	pad1 B32;
+    CARD32	n B32;
+    CARD32	pad3 B32;		/* NOTE: may hold a single value */
+    CARD32	pad4 B32;		/* NOTE: may hold half a double */
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXQueryServerStringReply;
+#define sz_xGLXQueryServerStringReply 32
+
+/*** Start of GLX 1.3 replies */
+
+/*
+** glXGetFBConfigs reply
+*/
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	numFBConfigs B32;
+    CARD32	numAttribs B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXGetFBConfigsReply;
+#define sz_xGLXGetFBConfigsReply 32
+
+/*
+** glXQueryContext reply
+*/
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	n B32;			/* number of attribute/value pairs */
+    CARD32	pad2 B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXQueryContextReply;
+#define sz_xGLXQueryContextReply 32
+
+/*
+** glXMakeContextCurrent reply
+*/
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    GLXContextTag contextTag B32;
+    CARD32	pad2 B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXMakeContextCurrentReply;
+#define sz_xGLXMakeContextCurrentReply 32
+
+/*
+** glXCreateGLXPbuffer reply
+** This is used only in the direct rendering case on SGIs - otherwise
+**  CreateGLXPbuffer has no reply. It is not part of GLX 1.3.
+*/
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	success;
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	pad1 B32;
+    CARD32	pad2 B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXCreateGLXPbufferReply;
+#define sz_xGLXCreateGLXPbufferReply 32
+
+/*
+** glXGetDrawableAttributes reply
+*/
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	numAttribs B32;
+    CARD32	pad2 B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXGetDrawableAttributesReply;
+#define sz_xGLXGetDrawableAttributesReply 32
+
+/*
+** glXGetColorTable reply
+*/
+typedef struct {
+    BYTE	type;		       /* X_Reply */
+    CARD8	unused;		       /* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	pad1 B32;
+    CARD32	pad2 B32;
+    CARD32	width B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXGetColorTableReply;
+#define sz_xGLXGetColorTableReply 32
+
+/************************************************************************/
+
+/* GLX extension requests and replies */
+
+/*
+** glXQueryContextInfoEXT request
+*/
+typedef struct GLXQueryContextInfoEXT {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	vendorCode B32;		/* vendor-specific opcode */
+    CARD32	pad1 B32;   /* unused; corresponds to contextTag in header */
+    GLXContextID context B32;
+} xGLXQueryContextInfoEXTReq;
+#define sz_xGLXQueryContextInfoEXTReq 16
+
+/*
+** glXQueryContextInfoEXT reply
+*/
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	n B32;			/* number of attribute/value pairs */
+    CARD32	pad2 B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXQueryContextInfoEXTReply;
+#define sz_xGLXQueryContextInfoEXTReply 32
+
+/*
+** glXMakeCurrentReadSGI request
+*/
+typedef struct GLXMakeCurrentReadSGI {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	vendorCode B32;		/* vendor-specific opcode */
+    GLXContextTag oldContextTag B32;
+    GLXDrawable drawable B32;
+    GLXDrawable readable B32;
+    GLXContextID context B32;
+} xGLXMakeCurrentReadSGIReq;
+#define sz_xGLXMakeCurrentReadSGIReq 24
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    GLXContextTag contextTag B32;
+    CARD32	writeVid B32;
+    CARD32	writeType B32;
+    CARD32	readVid B32;
+    CARD32	readType B32;
+    CARD32	pad6 B32;
+} xGLXMakeCurrentReadSGIReply;
+#define sz_xGLXMakeCurrentReadSGIReply 32
+
+/*
+** glXGetFBConfigsSGIX request
+*/
+typedef struct GLXGetFBConfigsSGIX {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	vendorCode B32;		/* vendor-specific opcode */
+    CARD32	pad1 B32;   /* unused; corresponds to contextTag in header */
+    CARD32	screen B32;
+} xGLXGetFBConfigsSGIXReq;
+#define sz_xGLXGetFBConfigsSGIXReq 16
+
+/*
+** glXCreateContextWithConfigSGIX request
+*/
+
+typedef struct GLXCreateContextWithConfigSGIX {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	vendorCode B32;		/* vendor-specific opcode */
+    CARD32	pad1 B32;   /* unused; corresponds to contextTag in header */
+    GLXContextID context B32;
+    GLXFBConfigID fbconfig B32;
+    CARD32	screen B32;
+    CARD32	renderType;
+    GLXContextID shareList B32;
+    BOOL	isDirect;
+    CARD8	reserved1;
+    CARD16	reserved2 B16;
+} xGLXCreateContextWithConfigSGIXReq;
+#define sz_xGLXCreateContextWithConfigSGIXReq 36
+
+/*
+** glXCreatePixmapWithConfigSGIX request
+*/
+
+typedef struct GLXCreateGLXPixmapWithConfigSGIX {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	vendorCode B32;		/* vendor-specific opcode */
+    CARD32	pad1 B32;   /* unused; corresponds to contextTag in header */
+    CARD32	screen B32;
+    GLXFBConfigID fbconfig B32;
+    CARD32	pixmap B32;
+    GLXPixmap	glxpixmap B32;
+} xGLXCreateGLXPixmapWithConfigSGIXReq;
+#define sz_xGLXCreateGLXPixmapWithConfigSGIXReq 28
+
+/*
+** glXJoinSwapGroupSGIX request
+*/
+typedef struct GLXJoinSwapGroupSGIX {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	vendorCode B32;		/* vendor-specific opcode */
+    CARD32 	unused B32;		/* corresponds to contextTag in hdr */
+    GLXDrawable	drawable B32;
+    GLXDrawable	member B32;
+} xGLXJoinSwapGroupSGIXReq;
+#define sz_xGLXJoinSwapGroupSGIXReq 20
+
+/*
+** glXBindSwapBarrierSGIX request
+*/
+typedef struct GLXBindSwapBarrierSGIX {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	vendorCode B32;		/* vendor-specific opcode */
+    CARD32 	unused B32;		/* corresponds to contextTag in hdr */
+    GLXDrawable	drawable B32;
+    CARD32	barrier B32;
+} xGLXBindSwapBarrierSGIXReq;
+#define sz_xGLXBindSwapBarrierSGIXReq 20
+
+/*
+** glXQueryMaxSwapBarriersSGIX request
+*/
+typedef struct GLXQueryMaxSwapBarriersSGIX {
+    CARD8	reqType;
+    CARD8	glxCode;
+    CARD16	length B16;
+    CARD32	vendorCode B32;		/* vendor-specific opcode */
+    CARD32 	unused B32;		/* corresponds to contextTag in hdr */
+    CARD32	screen B32;
+} xGLXQueryMaxSwapBarriersSGIXReq;
+#define sz_xGLXQueryMaxSwapBarriersSGIXReq 16
+
+typedef struct {
+    BYTE	type;			/* X_Reply */
+    CARD8	unused;			/* not used */
+    CARD16	sequenceNumber B16;
+    CARD32	length B32;
+    CARD32	max B32;
+    CARD32	size B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+    CARD32	pad5 B32;
+    CARD32	pad6 B32;
+} xGLXQueryMaxSwapBarriersSGIXReply;
+#define sz_xGLXQueryMaxSwapBarriersSGIXReply 32
+
+/*
+** glXQueryHyperpipeNetworkSGIX request
+*/
+typedef struct GLXQueryHyperpipeNetworkSGIX {
+    CARD8       reqType;
+    CARD8       glxCode;
+    CARD16      length B16;
+    CARD32      vendorCode B32;         /* vendor-specific opcode */
+    CARD32      pad1 B32;   /* unused; corresponds to contextTag in header */
+    CARD32      screen B32;
+} xGLXQueryHyperpipeNetworkSGIXReq;
+#define sz_xGLXQueryHyperpipeNetworkSGIXReq 16
+
+/*
+** glXQueryHyperpipeNetworkSGIX reply
+*/
+typedef struct {
+    BYTE        type;                   /* X_Reply */
+    CARD8       unused;                 /* not used */
+    CARD16      sequenceNumber B16;
+    CARD32      length B32;
+    CARD32      pad1 B32;
+    CARD32      n B32;
+    CARD32      npipes B32;             /* NOTE: may hold a single value */
+    CARD32      pad4 B32;               /* NOTE: may hold half a double */
+    CARD32      pad5 B32;
+    CARD32      pad6 B32;
+} xGLXQueryHyperpipeNetworkSGIXReply;
+#define sz_xGLXQueryHyperpipeNetworkSGIXReply 32
+
+/*
+** glXDestroyHyperpipeConfigSGIX request
+*/
+typedef struct GLXDestroyHyperpipeConfigSGIX {
+    CARD8       reqType;
+    CARD8       glxCode;
+    CARD16      length B16;
+    CARD32      vendorCode B32;         /* vendor-specific opcode */
+    CARD32      pad1 B32;   /* unused; corresponds to contextTag in header */
+    CARD32      screen B32;
+    CARD32      hpId B32;
+    CARD32      pad2 B32;
+    CARD32      pad3 B32;
+    CARD32      pad4 B32;
+} xGLXDestroyHyperpipeConfigSGIXReq;
+#define sz_xGLXDestroyHyperpipeConfigSGIXReq 32
+
+/*
+** glXDestroyHyperpipeConfigSGIX reply
+*/
+typedef struct {
+    BYTE        type;                   /* X_Reply */
+    CARD8       unused;                 /* not used */
+    CARD16      sequenceNumber B16;
+    CARD32      length B32;
+    CARD32      pad1 B32;
+    CARD32      n B32;
+    CARD32      success B32;            /* NOTE: may hold a single value */
+    CARD32      pad4 B32;               /* NOTE: may hold half a double */
+    CARD32      pad5 B32;
+    CARD32      pad6 B32;
+} xGLXDestroyHyperpipeConfigSGIXReply;
+#define sz_xGLXDestroyHyperpipeConfigSGIXReply 32
+
+/*
+** glXQueryHyperpipeConfigSGIX request
+*/
+typedef struct GLXQueryHyperpipeConfigSGIX {
+    CARD8       reqType;
+    CARD8       glxCode;
+    CARD16      length B16;
+    CARD32      vendorCode B32;         /* vendor-specific opcode */
+    CARD32      pad1 B32;   /* unused; corresponds to contextTag in header */
+    CARD32      screen B32;
+    CARD32      hpId B32;
+    CARD32      pad2 B32;
+    CARD32      pad3 B32;
+    CARD32      pad4 B32;
+} xGLXQueryHyperpipeConfigSGIXReq;
+#define sz_xGLXQueryHyperpipeConfigSGIXReq 32
+
+/*
+** glXQueryHyperpipeConfigSGIX reply
+*/
+typedef struct {
+    BYTE        type;                   /* X_Reply */
+    CARD8       unused;                 /* not used */
+    CARD16      sequenceNumber B16;
+    CARD32      length B32;
+    CARD32      pad1 B32;
+    CARD32      n B32;
+    CARD32      npipes B32;
+    CARD32      pad4 B32;
+    CARD32      pad5 B32;
+    CARD32      pad6 B32;
+} xGLXQueryHyperpipeConfigSGIXReply;
+#define sz_xGLXQueryHyperpipeConfigSGIXReply 32
+
+/*
+** glXHyperpipeConfigSGIX request
+*/
+typedef struct GLXHyperpipeConfigSGIX {
+    CARD8       reqType;
+    CARD8       glxCode;
+    CARD16      length B16;
+    CARD32      vendorCode B32;         /* vendor-specific opcode */
+    CARD32      pad1 B32;   /* unused; corresponds to contextTag in header */
+    CARD32      screen B32;
+    CARD32      npipes B32;
+    CARD32      networkId B32;
+    CARD32      pad2 B32;
+    CARD32      pad3 B32;
+    /* followed by attribute list */
+} xGLXHyperpipeConfigSGIXReq;
+#define sz_xGLXHyperpipeConfigSGIXReq 32
+
+/*
+** glXHyperpipeConfigSGIX reply
+*/
+typedef struct {
+    BYTE        type;                   /* X_Reply */
+    CARD8       unused;                 /* not used */
+    CARD16      sequenceNumber B16;
+    CARD32      length B32;
+    CARD32      pad1 B32;
+    CARD32      n B32;
+    CARD32      npipes B32;
+    CARD32      hpId B32;
+    CARD32      pad5 B32;
+    CARD32      pad6 B32;
+} xGLXHyperpipeConfigSGIXReply;
+#define sz_xGLXHyperpipeConfigSGIXReply 32
+
+/************************************************************************/
+
+/*
+** Events
+*/
+
+typedef struct {
+    BYTE type;
+    BYTE pad;
+    CARD16 sequenceNumber B16;
+    CARD16 event_type B16;  /*** was clobber_class */
+    CARD16 draw_type B16;
+    CARD32 drawable B32;
+    CARD32 buffer_mask B32; /*** was mask */
+    CARD16 aux_buffer B16;
+    CARD16 x B16;
+    CARD16 y B16;
+    CARD16 width B16;
+    CARD16 height B16;
+    CARD16 count B16;
+    CARD32 unused2 B32;
+} xGLXPbufferClobberEvent;
+
+/************************************************************************/
+
+/*
+** Size of the standard X request header.
+*/
+#define __GLX_SINGLE_HDR_SIZE sz_xGLXSingleReq
+#define __GLX_VENDPRIV_HDR_SIZE sz_xGLXVendorPrivateReq
+
+#define __GLX_RENDER_HDR    \
+    CARD16	length B16; \
+    CARD16	opcode B16
+
+#define __GLX_RENDER_HDR_SIZE 4
+
+typedef struct {
+    __GLX_RENDER_HDR;
+} __GLXrenderHeader;
+
+#define __GLX_RENDER_LARGE_HDR \
+    CARD32	length B32;    \
+    CARD32	opcode B32
+
+#define __GLX_RENDER_LARGE_HDR_SIZE 8
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+} __GLXrenderLargeHeader;
+
+/*
+** The glBitmap, glPolygonStipple, glTexImage[12]D, glTexSubImage[12]D
+** and glDrawPixels calls all have a pixel header transmitted after the
+** Render or RenderLarge header and before their own opcode specific
+** headers.
+*/
+#define __GLX_PIXEL_HDR		\
+    BOOL	swapBytes;	\
+    BOOL	lsbFirst;	\
+    CARD8	reserved0;	\
+    CARD8	reserved1;	\
+    CARD32	rowLength B32;	\
+    CARD32	skipRows B32;	\
+    CARD32	skipPixels B32; \
+    CARD32	alignment B32
+
+#define __GLX_PIXEL_HDR_SIZE 20
+
+typedef struct {
+    __GLX_PIXEL_HDR;
+} __GLXpixelHeader;
+
+/*
+** glTexImage[34]D and glTexSubImage[34]D calls
+** all have a pixel header transmitted after the Render or RenderLarge
+** header and before their own opcode specific headers.
+*/
+#define __GLX_PIXEL_3D_HDR		\
+    BOOL	swapBytes;		\
+    BOOL	lsbFirst;		\
+    CARD8	reserved0;		\
+    CARD8	reserved1;		\
+    CARD32	rowLength B32;		\
+    CARD32	imageHeight B32;	\
+    CARD32	imageDepth B32;		\
+    CARD32	skipRows B32;		\
+    CARD32	skipImages B32;		\
+    CARD32	skipVolumes B32;	\
+    CARD32	skipPixels B32;		\
+    CARD32	alignment B32
+
+#define __GLX_PIXEL_3D_HDR_SIZE 36
+
+/*
+** Data that is specific to a glBitmap call.  The data is sent in the
+** following order:
+**	Render or RenderLarge header
+**	Pixel header
+**	Bitmap header
+*/
+#define __GLX_BITMAP_HDR    \
+    CARD32	width B32;  \
+    CARD32	height B32; \
+    FLOAT32	xorig F32;  \
+    FLOAT32	yorig F32;  \
+    FLOAT32	xmove F32;  \
+    FLOAT32	ymove F32
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_BITMAP_HDR;
+} __GLXbitmapHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_BITMAP_HDR;
+} __GLXbitmapLargeHeader;
+
+typedef struct {
+    __GLX_PIXEL_HDR;
+    __GLX_BITMAP_HDR;
+} __GLXdispatchBitmapHeader;
+
+#define __GLX_BITMAP_HDR_SIZE 24
+
+#define __GLX_BITMAP_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_BITMAP_HDR_SIZE)
+
+#define __GLX_BITMAP_CMD_DISPATCH_HDR_SIZE \
+    (__GLX_PIXEL_HDR_SIZE + __GLX_BITMAP_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_PIXEL_HDR;
+} __GLXpolygonStippleHeader;
+
+#define __GLX_POLYGONSTIPPLE_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE)
+
+/*
+** Data that is specific to a glTexImage1D or glTexImage2D call.  The
+** data is sent in the following order:
+**	Render or RenderLarge header
+**	Pixel header
+**	TexImage header
+** When a glTexImage1D call the height field is unexamined by the server.
+*/
+#define __GLX_TEXIMAGE_HDR	\
+    CARD32	target B32;	\
+    CARD32	level B32;	\
+    CARD32	components B32; \
+    CARD32	width B32;	\
+    CARD32	height B32;	\
+    CARD32	border B32;	\
+    CARD32	format B32;	\
+    CARD32	type B32
+
+#define __GLX_TEXIMAGE_HDR_SIZE 32
+
+#define __GLX_TEXIMAGE_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_TEXIMAGE_HDR_SIZE)
+
+#define __GLX_TEXIMAGE_CMD_DISPATCH_HDR_SIZE \
+    (__GLX_PIXEL_HDR_SIZE + __GLX_TEXIMAGE_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_TEXIMAGE_HDR;
+} __GLXtexImageHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_TEXIMAGE_HDR;
+} __GLXtexImageLargeHeader;
+
+typedef struct {
+    __GLX_PIXEL_HDR;
+    __GLX_TEXIMAGE_HDR;
+} __GLXdispatchTexImageHeader;
+
+/*
+** Data that is specific to a glTexImage3D or glTexImage4D call.  The
+** data is sent in the following order:
+**	Render or RenderLarge header
+**	Pixel 3D header
+**	TexImage 3D header
+** When a glTexImage3D call the size4d and woffset fields are unexamined
+** by the server.
+** Could be used by all TexImage commands and perhaps should be in the
+** future.
+*/
+#define __GLX_TEXIMAGE_3D_HDR \
+    CARD32	target B32;	\
+    CARD32	level B32;	\
+    CARD32	internalformat B32;	\
+    CARD32	width B32;	\
+    CARD32	height B32;	\
+    CARD32	depth B32;	\
+    CARD32	size4d B32;	\
+    CARD32	border B32;	\
+    CARD32	format B32;	\
+    CARD32	type B32;	\
+    CARD32	nullimage B32
+
+#define __GLX_TEXIMAGE_3D_HDR_SIZE 44
+
+#define __GLX_TEXIMAGE_3D_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_3D_HDR_SIZE + \
+		__GLX_TEXIMAGE_3D_HDR_SIZE)
+
+#define __GLX_TEXIMAGE_3D_CMD_DISPATCH_HDR_SIZE \
+    (__GLX_PIXEL_3D_HDR_SIZE + __GLX_TEXIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_PIXEL_3D_HDR;
+    __GLX_TEXIMAGE_3D_HDR;
+} __GLXtexImage3DHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_PIXEL_3D_HDR;
+    __GLX_TEXIMAGE_3D_HDR;
+} __GLXtexImage3DLargeHeader;
+
+typedef struct {
+    __GLX_PIXEL_3D_HDR;
+    __GLX_TEXIMAGE_3D_HDR;
+} __GLXdispatchTexImage3DHeader;
+
+/*
+** Data that is specific to a glTexSubImage1D or glTexSubImage2D call.	The
+** data is sent in the following order:
+**	Render or RenderLarge header
+**	Pixel header
+**	TexSubImage header
+** When a glTexSubImage1D call is made, the yoffset and height fields
+** are unexamined by the server and are  considered to be padding.
+*/
+#define __GLX_TEXSUBIMAGE_HDR	\
+    CARD32	target B32;	\
+    CARD32	level B32;	\
+    CARD32	xoffset B32;	\
+    CARD32	yoffset B32;	\
+    CARD32	width B32;	\
+    CARD32	height B32;	\
+    CARD32	format B32;	\
+    CARD32	type B32;	\
+    CARD32	nullImage	\
+
+#define __GLX_TEXSUBIMAGE_HDR_SIZE 36
+
+#define __GLX_TEXSUBIMAGE_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_TEXSUBIMAGE_HDR_SIZE)
+
+#define __GLX_TEXSUBIMAGE_CMD_DISPATCH_HDR_SIZE \
+    (__GLX_PIXEL_HDR_SIZE + __GLX_TEXSUBIMAGE_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_TEXSUBIMAGE_HDR;
+} __GLXtexSubImageHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_TEXSUBIMAGE_HDR;
+} __GLXtexSubImageLargeHeader;
+
+typedef struct {
+    __GLX_PIXEL_HDR;
+    __GLX_TEXSUBIMAGE_HDR;
+} __GLXdispatchTexSubImageHeader;
+
+/*
+** Data that is specific to a glTexSubImage3D and 4D calls.  The
+** data is sent in the following order:
+**	Render or RenderLarge header
+**	Pixel 3D header
+**	TexSubImage 3D header
+** When a glTexSubImage3D call is made, the woffset and size4d fields
+** are unexamined by the server and are considered to be padding.
+*/
+#define __GLX_TEXSUBIMAGE_3D_HDR	\
+    CARD32	target B32;	\
+    CARD32	level B32;	\
+    CARD32	xoffset B32;	\
+    CARD32	yoffset B32;	\
+    CARD32	zoffset B32;	\
+    CARD32	woffset B32;	\
+    CARD32	width B32;	\
+    CARD32	height B32;	\
+    CARD32	depth B32;	\
+    CARD32	size4d B32;	\
+    CARD32	format B32;	\
+    CARD32	type B32;	\
+    CARD32	nullImage	\
+
+#define __GLX_TEXSUBIMAGE_3D_HDR_SIZE 52
+
+#define __GLX_TEXSUBIMAGE_3D_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_3D_HDR_SIZE + \
+		__GLX_TEXSUBIMAGE_3D_HDR_SIZE)
+
+#define __GLX_TEXSUBIMAGE_3D_CMD_DISPATCH_HDR_SIZE \
+    (__GLX_PIXEL_3D_HDR_SIZE + __GLX_TEXSUBIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_PIXEL_3D_HDR;
+    __GLX_TEXSUBIMAGE_3D_HDR;
+} __GLXtexSubImage3DHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_PIXEL_3D_HDR;
+    __GLX_TEXSUBIMAGE_3D_HDR;
+} __GLXtexSubImage3DLargeHeader;
+
+typedef struct {
+    __GLX_PIXEL_3D_HDR;
+    __GLX_TEXSUBIMAGE_3D_HDR;
+} __GLXdispatchTexSubImage3DHeader;
+
+/**
+ * Data that is specific to a \c glCompressedTexImage1D or
+ * \c glCompressedTexImage2D call.  The data is sent in the following
+ * order:
+ *     - Render or RenderLarge header
+ *     - CompressedTexImage header
+ * 
+ * When a \c glCompressedTexImage1D call is made, the \c height field is
+ * not examined by the server and is considered padding.
+ */
+
+#define __GLX_COMPRESSED_TEXIMAGE_HDR \
+    CARD32     target B32;            \
+    CARD32     level B32;             \
+    CARD32     internalFormat B32;    \
+    CARD32     width B32;             \
+    CARD32     height B32;            \
+    CARD32     border B32;            \
+    CARD32     imageSize B32
+
+#define __GLX_COMPRESSED_TEXIMAGE_HDR_SIZE 28
+
+#define __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXIMAGE_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXIMAGE_DISPATCH_HDR_SIZE \
+    (__GLX_COMPRESSED_TEXIMAGE_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_COMPRESSED_TEXIMAGE_HDR;
+} __GLXcompressedTexImageHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_COMPRESSED_TEXIMAGE_HDR;
+} __GLXcompressedTexImageLargeHeader;
+
+typedef struct {
+    __GLX_COMPRESSED_TEXIMAGE_HDR;
+} __GLXdispatchCompressedTexImageHeader;
+
+/**
+ * Data that is specifi to a \c glCompressedTexSubImage1D or
+ * \c glCompressedTexSubImage2D call.  The data is sent in the following
+ * order:
+ *     - Render or RenderLarge header
+ *     - CompressedTexSubImage header
+ * 
+ * When a \c glCompressedTexSubImage1D call is made, the \c yoffset and
+ * \c height fields are not examined by the server and are considered padding.
+ */
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_HDR \
+    CARD32     target B32;            \
+    CARD32     level B32;             \
+    CARD32     xoffset B32;           \
+    CARD32     yoffset B32;           \
+    CARD32     width B32;             \
+    CARD32     height B32;            \
+    CARD32     format B32;            \
+    CARD32     imageSize B32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE 32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_DISPATCH_HDR_SIZE \
+    (__GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
+} __GLXcompressedTexSubImageHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
+} __GLXcompressedTexSubImageLargeHeader;
+
+typedef struct {
+    __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
+} __GLXdispatchCompressedTexSubImageHeader;
+
+/**
+ * Data that is specific to a \c glCompressedTexImage3D call.  The data is
+ * sent in the following order:
+ *     - Render or RenderLarge header
+ *     - CompressedTexImage3D header
+ */
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_HDR \
+    CARD32     target B32;            \
+    CARD32     level B32;             \
+    CARD32     internalFormat B32;    \
+    CARD32     width B32;             \
+    CARD32     height B32;            \
+    CARD32     depth B32;             \
+    CARD32     border B32;            \
+    CARD32     imageSize B32
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE 32
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_DISPATCH_HDR_SIZE \
+    (__GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
+} __GLXcompressedTexImage3DHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
+} __GLXcompressedTexImage3DLargeHeader;
+
+typedef struct {
+    __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
+} __GLXdispatchCompressedTexImage3DHeader;
+
+/**
+ * Data that is specifi to a \c glCompressedTexSubImage3D call.  The data is
+ * sent in the following order:
+ *     - Render or RenderLarge header
+ *     - CompressedTexSubImage3D header
+ */
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR \
+    CARD32     target B32;            \
+    CARD32     level B32;             \
+    CARD32     xoffset B32;           \
+    CARD32     yoffset B32;           \
+    CARD32     zoffset B32;           \
+    CARD32     width B32;             \
+    CARD32     height B32;            \
+    CARD32     depth B32;             \
+    CARD32     format B32;            \
+    CARD32     imageSize B32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE 32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_DISPATCH_HDR_SIZE \
+    (__GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
+} __GLXcompressedTexSubImage3DHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
+} __GLXcompressedTexSubImage3DLargeHeader;
+
+typedef struct {
+    __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
+} __GLXdispatchCompressedTexSubImage3DHeader;
+
+/*
+** Data that is specific to a glDrawPixels call.  The data is sent in the
+** following order:
+**	Render or RenderLarge header
+**	Pixel header
+**	DrawPixels header
+*/
+#define __GLX_DRAWPIXELS_HDR \
+    CARD32	width B32;   \
+    CARD32	height B32;  \
+    CARD32	format B32;  \
+    CARD32	type B32
+
+#define __GLX_DRAWPIXELS_HDR_SIZE 16
+
+#define __GLX_DRAWPIXELS_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_DRAWPIXELS_HDR_SIZE)
+
+#define __GLX_DRAWPIXELS_CMD_DISPATCH_HDR_SIZE \
+    (__GLX_PIXEL_HDR_SIZE + __GLX_DRAWPIXELS_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_DRAWPIXELS_HDR;
+} __GLXdrawPixelsHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_DRAWPIXELS_HDR;
+} __GLXdrawPixelsLargeHeader;
+
+typedef struct {
+    __GLX_PIXEL_HDR;
+    __GLX_DRAWPIXELS_HDR;
+} __GLXdispatchDrawPixelsHeader;
+
+/*
+** Data that is specific to a glConvolutionFilter1D or glConvolutionFilter2D
+** call.  The data is sent in the following order:
+**	Render or RenderLarge header
+**	Pixel header
+**	ConvolutionFilter header
+** When a glConvolutionFilter1D call the height field is unexamined by the server.
+*/
+#define __GLX_CONV_FILT_HDR	\
+    CARD32	target B32;	\
+    CARD32	internalformat B32;	\
+    CARD32	width B32;	\
+    CARD32	height B32;	\
+    CARD32	format B32;	\
+    CARD32	type B32
+
+#define __GLX_CONV_FILT_HDR_SIZE 24
+
+#define __GLX_CONV_FILT_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_CONV_FILT_HDR_SIZE)
+
+#define __GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE \
+    (__GLX_PIXEL_HDR_SIZE + __GLX_CONV_FILT_HDR_SIZE)
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_CONV_FILT_HDR;
+} __GLXConvolutionFilterHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_CONV_FILT_HDR;
+} __GLXConvolutionFilterLargeHeader;
+
+typedef struct {
+    __GLX_PIXEL_HDR;
+    __GLX_CONV_FILT_HDR;
+} __GLXdispatchConvolutionFilterHeader;
+
+/*
+** Data that is specific to a glDrawArraysEXT call.  The data is sent in the
+** following order:
+**	Render or RenderLarge header
+**	Draw Arrays header
+**	a variable number of Component headers
+**	vertex data for each component type
+*/
+
+#define __GLX_DRAWARRAYS_HDR \
+    CARD32	numVertexes B32; \
+    CARD32	numComponents B32; \
+    CARD32	primType B32
+
+#define __GLX_DRAWARRAYS_HDR_SIZE 12
+
+#define __GLX_DRAWARRAYS_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_DRAWARRAYS_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_DRAWARRAYS_HDR;
+} __GLXdrawArraysHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_DRAWARRAYS_HDR;
+} __GLXdrawArraysLargeHeader;
+
+typedef struct {
+    __GLX_DRAWARRAYS_HDR;
+} __GLXdispatchDrawArraysHeader;
+
+#define __GLX_COMPONENT_HDR \
+    CARD32	datatype B32; \
+    INT32	numVals B32; \
+    CARD32	component B32
+
+typedef struct {
+    __GLX_COMPONENT_HDR;
+} __GLXdispatchDrawArraysComponentHeader;
+
+#define __GLX_COMPONENT_HDR_SIZE 12
+
+/*
+** Data that is specific to a glColorTable call
+**	The data is sent in the following order:
+**	Render or RenderLarge header
+**	Pixel header
+**	ColorTable header
+*/
+
+#define __GLX_COLOR_TABLE_HDR	     \
+    CARD32	target B32;	    \
+    CARD32	internalformat B32; \
+    CARD32	width B32;	    \
+    CARD32	format B32;	    \
+    CARD32	type   B32
+
+#define __GLX_COLOR_TABLE_HDR_SIZE 20
+
+#define __GLX_COLOR_TABLE_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_COLOR_TABLE_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_COLOR_TABLE_HDR;
+} __GLXColorTableHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_COLOR_TABLE_HDR;
+} __GLXColorTableLargeHeader;
+
+typedef struct {
+    __GLX_PIXEL_HDR;
+    __GLX_COLOR_TABLE_HDR;
+} __GLXdispatchColorTableHeader;
+
+/*
+** Data that is specific to a glColorSubTable call
+**	The data is sent in the following order:
+**	Render or RenderLarge header
+**	Pixel header
+**	ColorTable header
+*/
+
+#define __GLX_COLOR_SUBTABLE_HDR    \
+    CARD32	target B32;	    \
+    CARD32	start B32; 	    \
+    CARD32	count B32;	    \
+    CARD32	format B32;	    \
+    CARD32	type   B32
+
+#define __GLX_COLOR_SUBTABLE_HDR_SIZE 20
+
+#define __GLX_COLOR_SUBTABLE_CMD_HDR_SIZE \
+    (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + \
+     __GLX_COLOR_SUBTABLE_HDR_SIZE)
+
+typedef struct {
+    __GLX_RENDER_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_COLOR_SUBTABLE_HDR;
+} __GLXColorSubTableHeader;
+
+typedef struct {
+    __GLX_RENDER_LARGE_HDR;
+    __GLX_PIXEL_HDR;
+    __GLX_COLOR_SUBTABLE_HDR;
+} __GLXColorSubTableLargeHeader;
+
+typedef struct {
+    __GLX_PIXEL_HDR;
+    __GLX_COLOR_SUBTABLE_HDR;
+} __GLXdispatchColorSubTableHeader;
+
+#define GLX_WINDOW_TYPE		1
+#define GLX_PIXMAP_TYPE		2
+#define GLX_VIDEO_SOURCE_TYPE	3
+#define GLX_PBUFFER_TYPE	4
+/* 5 is for DM_PBUFFER */
+#define GLX_GLXWINDOW_TYPE	6	
+
+/*****************************************************************************/
+
+/*
+** Restore these definitions back to the typedefs in glx.h
+*/
+#undef GLXContextID
+#undef GLXPixmap
+#undef GLXDrawable
+#undef GLXPbuffer
+#undef GLXWindow
+#undef GLXFBConfigID
+#undef GLXFBConfigIDSGIX
+#undef GLXPbufferSGIX
+
+
+/* Opcodes for GLX commands */
+
+#define X_GLXRender                       1
+#define X_GLXRenderLarge                  2
+#define X_GLXCreateContext                3
+#define X_GLXDestroyContext               4
+#define X_GLXMakeCurrent                  5
+#define X_GLXIsDirect                     6
+#define X_GLXQueryVersion                 7
+#define X_GLXWaitGL                       8
+#define X_GLXWaitX                        9
+#define X_GLXCopyContext                 10
+#define X_GLXSwapBuffers                 11
+#define X_GLXUseXFont                    12
+#define X_GLXCreateGLXPixmap             13
+#define X_GLXGetVisualConfigs            14
+#define X_GLXDestroyGLXPixmap            15
+#define X_GLXVendorPrivate               16
+#define X_GLXVendorPrivateWithReply      17
+#define X_GLXQueryExtensionsString       18
+#define X_GLXQueryServerString           19
+#define X_GLXClientInfo                  20
+#define X_GLXGetFBConfigs                21
+#define X_GLXCreatePixmap                22
+#define X_GLXDestroyPixmap               23
+#define X_GLXCreateNewContext            24
+#define X_GLXQueryContext                25
+#define X_GLXMakeContextCurrent          26
+#define X_GLXCreatePbuffer               27
+#define X_GLXDestroyPbuffer              28
+#define X_GLXGetDrawableAttributes       29
+#define X_GLXChangeDrawableAttributes    30
+#define X_GLXCreateWindow                31
+#define X_GLXDestroyWindow               32
+
+
+/* Opcodes for single commands (part of GLX command space) */
+
+#define X_GLsop_NewList                    101
+#define X_GLsop_EndList                    102
+#define X_GLsop_DeleteLists                103
+#define X_GLsop_GenLists                   104
+#define X_GLsop_FeedbackBuffer             105
+#define X_GLsop_SelectBuffer               106
+#define X_GLsop_RenderMode                 107
+#define X_GLsop_Finish                     108
+#define X_GLsop_Flush                      142
+#define X_GLsop_PixelStoref                109
+#define X_GLsop_PixelStorei                110
+#define X_GLsop_ReadPixels                 111
+#define X_GLsop_GetBooleanv                112
+#define X_GLsop_GetClipPlane               113
+#define X_GLsop_GetDoublev                 114
+#define X_GLsop_GetError                   115
+#define X_GLsop_GetFloatv                  116
+#define X_GLsop_GetIntegerv                117
+#define X_GLsop_GetLightfv                 118
+#define X_GLsop_GetLightiv                 119
+#define X_GLsop_GetMapdv                   120
+#define X_GLsop_GetMapfv                   121
+#define X_GLsop_GetMapiv                   122
+#define X_GLsop_GetMaterialfv              123
+#define X_GLsop_GetMaterialiv              124
+#define X_GLsop_GetPixelMapfv              125
+#define X_GLsop_GetPixelMapuiv             126
+#define X_GLsop_GetPixelMapusv             127
+#define X_GLsop_GetPolygonStipple          128
+#define X_GLsop_GetString                  129
+#define X_GLsop_GetTexEnvfv                130
+#define X_GLsop_GetTexEnviv                131
+#define X_GLsop_GetTexGendv                132
+#define X_GLsop_GetTexGenfv                133
+#define X_GLsop_GetTexGeniv                134
+#define X_GLsop_GetTexImage                135
+#define X_GLsop_GetTexParameterfv          136
+#define X_GLsop_GetTexParameteriv          137
+#define X_GLsop_GetTexLevelParameterfv     138
+#define X_GLsop_GetTexLevelParameteriv     139
+#define X_GLsop_IsEnabled                  140
+#define X_GLsop_IsList                     141
+#define X_GLsop_AreTexturesResident        143
+#define X_GLsop_DeleteTextures             144
+#define X_GLsop_GenTextures                145
+#define X_GLsop_IsTexture                  146
+#define X_GLsop_GetColorTable              147
+#define X_GLsop_GetColorTableParameterfv   148
+#define X_GLsop_GetColorTableParameteriv   149
+#define X_GLsop_GetConvolutionFilter       150
+#define X_GLsop_GetConvolutionParameterfv  151
+#define X_GLsop_GetConvolutionParameteriv  152
+#define X_GLsop_GetSeparableFilter         153
+#define X_GLsop_GetHistogram               154
+#define X_GLsop_GetHistogramParameterfv    155
+#define X_GLsop_GetHistogramParameteriv    156
+#define X_GLsop_GetMinmax                  157
+#define X_GLsop_GetMinmaxParameterfv       158
+#define X_GLsop_GetMinmaxParameteriv       159
+#define X_GLsop_GetCompressedTexImage      160
+
+
+/* Opcodes for rendering commands */
+
+#define X_GLrop_CallList                     1
+#define X_GLrop_CallLists                    2
+#define X_GLrop_ListBase                     3
+#define X_GLrop_Begin                        4
+#define X_GLrop_Bitmap                       5
+#define X_GLrop_Color3bv                     6
+#define X_GLrop_Color3dv                     7
+#define X_GLrop_Color3fv                     8
+#define X_GLrop_Color3iv                     9
+#define X_GLrop_Color3sv                    10
+#define X_GLrop_Color3ubv                   11
+#define X_GLrop_Color3uiv                   12
+#define X_GLrop_Color3usv                   13
+#define X_GLrop_Color4bv                    14
+#define X_GLrop_Color4dv                    15
+#define X_GLrop_Color4fv                    16
+#define X_GLrop_Color4iv                    17
+#define X_GLrop_Color4sv                    18
+#define X_GLrop_Color4ubv                   19
+#define X_GLrop_Color4uiv                   20
+#define X_GLrop_Color4usv                   21
+#define X_GLrop_EdgeFlagv                   22
+#define X_GLrop_End                         23
+#define X_GLrop_Indexdv                     24
+#define X_GLrop_Indexfv                     25
+#define X_GLrop_Indexiv                     26
+#define X_GLrop_Indexsv                     27
+#define X_GLrop_Normal3bv                   28
+#define X_GLrop_Normal3dv                   29
+#define X_GLrop_Normal3fv                   30
+#define X_GLrop_Normal3iv                   31
+#define X_GLrop_Normal3sv                   32
+#define X_GLrop_RasterPos2dv                33
+#define X_GLrop_RasterPos2fv                34
+#define X_GLrop_RasterPos2iv                35
+#define X_GLrop_RasterPos2sv                36
+#define X_GLrop_RasterPos3dv                37
+#define X_GLrop_RasterPos3fv                38
+#define X_GLrop_RasterPos3iv                39
+#define X_GLrop_RasterPos3sv                40
+#define X_GLrop_RasterPos4dv                41
+#define X_GLrop_RasterPos4fv                42
+#define X_GLrop_RasterPos4iv                43
+#define X_GLrop_RasterPos4sv                44
+#define X_GLrop_Rectdv                      45
+#define X_GLrop_Rectfv                      46
+#define X_GLrop_Rectiv                      47
+#define X_GLrop_Rectsv                      48
+#define X_GLrop_TexCoord1dv                 49
+#define X_GLrop_TexCoord1fv                 50
+#define X_GLrop_TexCoord1iv                 51
+#define X_GLrop_TexCoord1sv                 52
+#define X_GLrop_TexCoord2dv                 53
+#define X_GLrop_TexCoord2fv                 54
+#define X_GLrop_TexCoord2iv                 55
+#define X_GLrop_TexCoord2sv                 56
+#define X_GLrop_TexCoord3dv                 57
+#define X_GLrop_TexCoord3fv                 58
+#define X_GLrop_TexCoord3iv                 59
+#define X_GLrop_TexCoord3sv                 60
+#define X_GLrop_TexCoord4dv                 61
+#define X_GLrop_TexCoord4fv                 62
+#define X_GLrop_TexCoord4iv                 63
+#define X_GLrop_TexCoord4sv                 64
+#define X_GLrop_Vertex2dv                   65
+#define X_GLrop_Vertex2fv                   66
+#define X_GLrop_Vertex2iv                   67
+#define X_GLrop_Vertex2sv                   68
+#define X_GLrop_Vertex3dv                   69
+#define X_GLrop_Vertex3fv                   70
+#define X_GLrop_Vertex3iv                   71
+#define X_GLrop_Vertex3sv                   72
+#define X_GLrop_Vertex4dv                   73
+#define X_GLrop_Vertex4fv                   74
+#define X_GLrop_Vertex4iv                   75
+#define X_GLrop_Vertex4sv                   76
+#define X_GLrop_ClipPlane                   77
+#define X_GLrop_ColorMaterial               78
+#define X_GLrop_CullFace                    79
+#define X_GLrop_Fogf                        80
+#define X_GLrop_Fogfv                       81
+#define X_GLrop_Fogi                        82
+#define X_GLrop_Fogiv                       83
+#define X_GLrop_FrontFace                   84
+#define X_GLrop_Hint                        85
+#define X_GLrop_Lightf                      86
+#define X_GLrop_Lightfv                     87
+#define X_GLrop_Lighti                      88
+#define X_GLrop_Lightiv                     89
+#define X_GLrop_LightModelf                 90
+#define X_GLrop_LightModelfv                91
+#define X_GLrop_LightModeli                 92
+#define X_GLrop_LightModeliv                93
+#define X_GLrop_LineStipple                 94
+#define X_GLrop_LineWidth                   95
+#define X_GLrop_Materialf                   96
+#define X_GLrop_Materialfv                  97
+#define X_GLrop_Materiali                   98
+#define X_GLrop_Materialiv                  99
+#define X_GLrop_PointSize                  100
+#define X_GLrop_PolygonMode                101
+#define X_GLrop_PolygonStipple             102
+#define X_GLrop_Scissor                    103
+#define X_GLrop_ShadeModel                 104
+#define X_GLrop_TexParameterf              105
+#define X_GLrop_TexParameterfv             106
+#define X_GLrop_TexParameteri              107
+#define X_GLrop_TexParameteriv             108
+#define X_GLrop_TexImage1D                 109
+#define X_GLrop_TexImage2D                 110
+#define X_GLrop_TexEnvf                    111
+#define X_GLrop_TexEnvfv                   112
+#define X_GLrop_TexEnvi                    113
+#define X_GLrop_TexEnviv                   114
+#define X_GLrop_TexGend                    115
+#define X_GLrop_TexGendv                   116
+#define X_GLrop_TexGenf                    117
+#define X_GLrop_TexGenfv                   118
+#define X_GLrop_TexGeni                    119
+#define X_GLrop_TexGeniv                   120
+#define X_GLrop_InitNames                  121
+#define X_GLrop_LoadName                   122
+#define X_GLrop_PassThrough                123
+#define X_GLrop_PopName                    124
+#define X_GLrop_PushName                   125
+#define X_GLrop_DrawBuffer                 126
+#define X_GLrop_Clear                      127
+#define X_GLrop_ClearAccum                 128
+#define X_GLrop_ClearIndex                 129
+#define X_GLrop_ClearColor                 130
+#define X_GLrop_ClearStencil               131
+#define X_GLrop_ClearDepth                 132
+#define X_GLrop_StencilMask                133
+#define X_GLrop_ColorMask                  134
+#define X_GLrop_DepthMask                  135
+#define X_GLrop_IndexMask                  136
+#define X_GLrop_Accum                      137
+#define X_GLrop_Disable                    138
+#define X_GLrop_Enable                     139
+#define X_GLrop_PopAttrib                  141
+#define X_GLrop_PushAttrib                 142
+#define X_GLrop_Map1d                      143
+#define X_GLrop_Map1f                      144
+#define X_GLrop_Map2d                      145
+#define X_GLrop_Map2f                      146
+#define X_GLrop_MapGrid1d                  147
+#define X_GLrop_MapGrid1f                  148
+#define X_GLrop_MapGrid2d                  149
+#define X_GLrop_MapGrid2f                  150
+#define X_GLrop_EvalCoord1dv               151
+#define X_GLrop_EvalCoord1fv               152
+#define X_GLrop_EvalCoord2dv               153
+#define X_GLrop_EvalCoord2fv               154
+#define X_GLrop_EvalMesh1                  155
+#define X_GLrop_EvalPoint1                 156
+#define X_GLrop_EvalMesh2                  157
+#define X_GLrop_EvalPoint2                 158
+#define X_GLrop_AlphaFunc                  159
+#define X_GLrop_BlendFunc                  160
+#define X_GLrop_LogicOp                    161
+#define X_GLrop_StencilFunc                162
+#define X_GLrop_StencilOp                  163
+#define X_GLrop_DepthFunc                  164
+#define X_GLrop_PixelZoom                  165
+#define X_GLrop_PixelTransferf             166
+#define X_GLrop_PixelTransferi             167
+#define X_GLrop_PixelMapfv                 168
+#define X_GLrop_PixelMapuiv                169
+#define X_GLrop_PixelMapusv                170
+#define X_GLrop_ReadBuffer                 171
+#define X_GLrop_CopyPixels                 172
+#define X_GLrop_DrawPixels                 173
+#define X_GLrop_DepthRange                 174
+#define X_GLrop_Frustum                    175
+#define X_GLrop_LoadIdentity               176
+#define X_GLrop_LoadMatrixf                177
+#define X_GLrop_LoadMatrixd                178
+#define X_GLrop_MatrixMode                 179
+#define X_GLrop_MultMatrixf                180
+#define X_GLrop_MultMatrixd                181
+#define X_GLrop_Ortho                      182
+#define X_GLrop_PopMatrix                  183
+#define X_GLrop_PushMatrix                 184
+#define X_GLrop_Rotated                    185
+#define X_GLrop_Rotatef                    186
+#define X_GLrop_Scaled                     187
+#define X_GLrop_Scalef                     188
+#define X_GLrop_Translated                 189
+#define X_GLrop_Translatef                 190
+#define X_GLrop_Viewport                   191
+#define X_GLrop_DrawArrays                 193
+#define X_GLrop_PolygonOffset              192
+#define X_GLrop_CopyTexImage1D             4119
+#define X_GLrop_CopyTexImage2D             4120
+#define X_GLrop_CopyTexSubImage1D          4121
+#define X_GLrop_CopyTexSubImage2D          4122
+#define X_GLrop_TexSubImage1D              4099
+#define X_GLrop_TexSubImage2D              4100
+#define X_GLrop_BindTexture                4117
+#define X_GLrop_PrioritizeTextures         4118
+#define X_GLrop_Indexubv                   194
+#define X_GLrop_BlendColor                 4096
+#define X_GLrop_BlendEquation              4097
+#define X_GLrop_ColorTable                 2053
+#define X_GLrop_ColorTableParameterfv      2054
+#define X_GLrop_ColorTableParameteriv      2055
+#define X_GLrop_CopyColorTable             2056
+#define X_GLrop_ColorSubTable              195
+#define X_GLrop_CopyColorSubTable          196
+#define X_GLrop_ConvolutionFilter1D        4101
+#define X_GLrop_ConvolutionFilter2D        4102
+#define X_GLrop_ConvolutionParameterf      4103
+#define X_GLrop_ConvolutionParameterfv     4104
+#define X_GLrop_ConvolutionParameteri      4105
+#define X_GLrop_ConvolutionParameteriv     4106
+#define X_GLrop_CopyConvolutionFilter1D    4107
+#define X_GLrop_CopyConvolutionFilter2D    4108
+#define X_GLrop_SeparableFilter2D          4109
+#define X_GLrop_Histogram                  4110
+#define X_GLrop_Minmax                     4111
+#define X_GLrop_ResetHistogram             4112
+#define X_GLrop_ResetMinmax                4113
+#define X_GLrop_TexImage3D                 4114
+#define X_GLrop_TexSubImage3D              4115
+#define X_GLrop_CopyTexSubImage3D          4123
+#define X_GLrop_DrawArraysEXT              4116
+
+/* Added for core GL version 1.3 */
+
+#define X_GLrop_ActiveTextureARB            197
+#define X_GLrop_MultiTexCoord1dvARB         198
+#define X_GLrop_MultiTexCoord1fvARB         199
+#define X_GLrop_MultiTexCoord1ivARB         200
+#define X_GLrop_MultiTexCoord1svARB         201
+#define X_GLrop_MultiTexCoord2dvARB         202
+#define X_GLrop_MultiTexCoord2fvARB         203
+#define X_GLrop_MultiTexCoord2ivARB         204
+#define X_GLrop_MultiTexCoord2svARB         205
+#define X_GLrop_MultiTexCoord3dvARB         206
+#define X_GLrop_MultiTexCoord3fvARB         207
+#define X_GLrop_MultiTexCoord3ivARB         208
+#define X_GLrop_MultiTexCoord3svARB         209
+#define X_GLrop_MultiTexCoord4dvARB         210
+#define X_GLrop_MultiTexCoord4fvARB         211
+#define X_GLrop_MultiTexCoord4ivARB         212
+#define X_GLrop_MultiTexCoord4svARB         213
+#define X_GLrop_CompressedTexImage1D        214
+#define X_GLrop_CompressedTexImage2D        215
+#define X_GLrop_CompressedTexImage3D        216
+#define X_GLrop_CompressedTexSubImage1D     217
+#define X_GLrop_CompressedTexSubImage2D     218
+#define X_GLrop_CompressedTexSubImage3D     219
+#define X_GLrop_SampleCoverageARB           229
+
+/* Added for core GL version 1.4 */
+
+#define X_GLrop_WindowPos3fARB              230
+#define X_GLrop_FogCoordfv                  4124
+#define X_GLrop_FogCoorddv                  4125
+#define X_GLrop_PointParameterfARB          2065
+#define X_GLrop_PointParameterfvARB         2066
+#define X_GLrop_SecondaryColor3bv           4126
+#define X_GLrop_SecondaryColor3sv           4127
+#define X_GLrop_SecondaryColor3iv           4128
+#define X_GLrop_SecondaryColor3fv           4129
+#define X_GLrop_SecondaryColor3dv           4130
+#define X_GLrop_SecondaryColor3ubv          4131
+#define X_GLrop_SecondaryColor3usv          4132
+#define X_GLrop_SecondaryColor3uiv          4133
+#define X_GLrop_BlendFuncSeparate           4134
+#define X_GLrop_PointParameteri             4221
+#define X_GLrop_PointParameteriv            4222
+
+/* Added for core GL version 1.5 */
+/* XXX opcodes not defined in the spec */
+
+/* Opcodes for Vendor Private commands */
+
+
+#define X_GLvop_GetConvolutionFilterEXT        1
+#define X_GLvop_GetConvolutionParameterfvEXT   2
+#define X_GLvop_GetConvolutionParameterivEXT   3
+#define X_GLvop_GetSeparableFilterEXT          4
+#define X_GLvop_GetHistogramEXT                5
+#define X_GLvop_GetHistogramParameterfvEXT     6
+#define X_GLvop_GetHistogramParameterivEXT     7
+#define X_GLvop_GetMinmaxEXT                   8
+#define X_GLvop_GetMinmaxParameterfvEXT        9
+#define X_GLvop_GetMinmaxParameterivEXT        10
+#define X_GLvop_AreTexturesResidentEXT         11
+#define X_GLvop_DeleteTexturesEXT              12
+#define X_GLvop_GenTexturesEXT                 13
+#define X_GLvop_IsTextureEXT                   14
+#define X_GLvop_GetCombinerInputParameterfvNV  1270
+#define X_GLvop_GetCombinerInputParameterivNV  1271
+#define X_GLvop_GetCombinerOutputParameterfvNV 1272
+#define X_GLvop_GetCombinerOutputParameterivNV 1273
+#define X_GLvop_GetFinalCombinerOutputParameterfvNV 1274
+#define X_GLvop_GetFinalCombinerOutputParameterivNV 1275
+#define X_GLvop_DeleteFenceNV                  1276
+#define X_GLvop_GenFencesNV                    1277
+#define X_GLvop_IsFenceNV                      1278
+#define X_GLvop_TestFenceNV                    1279
+#define X_GLvop_GetFenceivNV                   1280
+#define X_GLvop_AreProgramsResidentNV          1293
+#define X_GLvop_DeleteProgramARB               1294
+#define X_GLvop_GenProgramsARB                 1295
+#define X_GLvop_GetProgramEnvParameterfvARB    1296
+#define X_GLvop_GetProgramEnvParameterdvARB    1297
+#define X_GLvop_GetProgramEnvParameterivNV     1298
+#define X_GLvop_GetProgramStringNV             1299
+#define X_GLvop_GetTrackMatrixivNV             1300
+#define X_GLvop_GetVertexAttribdvARB           1301
+#define X_GLvop_GetVertexAttribfvARB           1302
+#define X_GLvop_GetVertexAttribivARB           1303
+#define X_GLvop_IsProgramARB                   1304
+#define X_GLvop_GetProgramLocalParameterfvARB  1305
+#define X_GLvop_GetProgramLocalParameterdvARB  1306
+#define X_GLvop_GetProgramivARB                1307
+#define X_GLvop_GetProgramStringARB            1308
+#define X_GLvop_GetProgramNamedParameter4fvNV  1310
+#define X_GLvop_GetProgramNamedParameter4dvNV  1311
+#define X_GLvop_SampleMaskSGIS                 2048
+#define X_GLvop_SamplePatternSGIS              2049
+#define X_GLvop_GetDetailTexFuncSGIS           4096
+#define X_GLvop_GetSharpenTexFuncSGIS          4097
+#define X_GLvop_GetColorTableSGI               4098
+#define X_GLvop_GetColorTableParameterfvSGI    4099
+#define X_GLvop_GetColorTableParameterivSGI    4100
+#define X_GLvop_GetTexFilterFuncSGIS           4101
+#define X_GLvop_GetInstrumentsSGIX             4102
+#define X_GLvop_InstrumentsBufferSGIX          4103
+#define X_GLvop_PollInstrumentsSGIX            4104
+#define X_GLvop_FlushRasterSGIX                4105
+
+/* Opcodes for GLX vendor private commands */
+
+#define X_GLXvop_QueryContextInfoEXT            1024
+#define X_GLXvop_SwapIntervalSGI                65536
+#define X_GLXvop_MakeCurrentReadSGI             65537
+#define X_GLXvop_CreateGLXVideoSourceSGIX       65538
+#define X_GLXvop_DestroyGLXVideoSourceSGIX      65539
+#define X_GLXvop_GetFBConfigsSGIX               65540
+#define X_GLXvop_CreateContextWithConfigSGIX    65541
+#define X_GLXvop_CreateGLXPixmapWithConfigSGIX  65542
+#define X_GLXvop_CreateGLXPbufferSGIX           65543
+#define X_GLXvop_DestroyGLXPbufferSGIX          65544
+#define X_GLXvop_ChangeDrawableAttributesSGIX   65545
+#define X_GLXvop_GetDrawableAttributesSGIX      65546
+#define X_GLXvop_JoinSwapGroupSGIX              65547
+#define X_GLXvop_BindSwapBarrierSGIX            65548
+#define X_GLXvop_QueryMaxSwapBarriersSGIX       65549
+#define X_GLXvop_QueryHyperpipeNetworkSGIX      65550
+#define X_GLXvop_QueryHyperpipeConfigSGIX       65551
+#define X_GLXvop_HyperpipeConfigSGIX            65552
+#define X_GLXvop_DestroyHyperpipeConfigSGIX     65553
+#define X_GLXvop_BindTexImageEXT                5152
+#define X_GLXvop_ReleaseTexImageEXT             5153
+
+/* ARB extension opcodes */
+
+/*  1. GL_ARB_multitexture - see GL 1.2 opcodes */
+/*  5. GL_ARB_multisample - see GL 1.3 opcodes */
+/* 12. GL_ARB_texture_compression - see GL 1.3 opcodes */
+/* 14. GL_ARB_point_parameters - see GL 1.4 opcodees */
+
+/* 15. GL_ARB_vertex_blend */
+#define X_GLrop_WeightbvARB                  220
+#define X_GLrop_WeightubvARB                 221
+#define X_GLrop_WeightsvARB                  222
+#define X_GLrop_WeightusvARB                 223
+#define X_GLrop_WeightivARB                  224
+#define X_GLrop_WeightuivARB                 225
+#define X_GLrop_VertexBlendARB               226
+#define X_GLrop_WeightfvARB                  227
+#define X_GLrop_WeightdvARB                  228
+
+/* 16. GL_ARB_matrix_palette */
+/* XXX opcodes not defined in the spec */
+
+/* 25. GL_ARB_window_pos - see GL 1.4 opcodes */
+
+/* 26. GL_ARB_vertex_program */
+#define X_GLrop_BindProgramARB              4180
+#define X_GLrop_ProgramEnvParameter4fvARB   4184
+#define X_GLrop_ProgramEnvParameter4dvARB   4185
+#define X_GLrop_VertexAttrib1svARB          4189
+#define X_GLrop_VertexAttrib2svARB          4190
+#define X_GLrop_VertexAttrib3svARB          4191
+#define X_GLrop_VertexAttrib4svARB          4192
+#define X_GLrop_VertexAttrib1fvARB          4193
+#define X_GLrop_VertexAttrib2fvARB          4194
+#define X_GLrop_VertexAttrib3fvARB          4195
+#define X_GLrop_VertexAttrib4fvARB          4196
+#define X_GLrop_VertexAttrib1dvARB          4197
+#define X_GLrop_VertexAttrib2dvARB          4198
+#define X_GLrop_VertexAttrib3dvARB          4199
+#define X_GLrop_ProgramLocalParameter4fvARB 4215
+#define X_GLrop_ProgramLocalParameter4dvARB 4216
+#define X_GLrop_ProgramStringARB            4217
+#define X_GLrop_VertexAttrib4dvARB          4200
+#define X_GLrop_VertexAttrib4NubvARB        4201
+#define X_GLrop_VertexAttrib4bvARB          4230
+#define X_GLrop_VertexAttrib4ivARB          4231
+#define X_GLrop_VertexAttrib4ubvARB         4232
+#define X_GLrop_VertexAttrib4usvARB         4233
+#define X_GLrop_VertexAttrib4uivARB         4234
+#define X_GLrop_VertexAttrib4NbvARB         4235
+#define X_GLrop_VertexAttrib4NsvARB         4236
+#define X_GLrop_VertexAttrib4NivARB         4237
+#define X_GLrop_VertexAttrib4NusvARB        4238
+#define X_GLrop_VertexAttrib4NuivARB        4239
+
+/* 27. GL_ARB_fragment_program - see GL_ARB_vertex_program opcodes */
+
+/* 29. GL_ARB_occlusion_query */
+/* XXX opcodes not defined in the spec */
+
+
+/* New extension opcodes */
+
+/* 145. GL_EXT_secondary_color - see GL 1.4 opcodes */
+
+/* 188. GL_EXT_vertex_weighting */
+#define X_GLrop_VertexWeightfvEXT           4135
+
+/* 191. GL_NV_register_combiners */
+#define X_GLrop_CombinerParameterfNV        4136
+#define X_GLrop_CombinerParameterfvNV       4137
+#define X_GLrop_CombinerParameteriNV        4138
+#define X_GLrop_CombinerParameterivNV       4139
+#define X_GLrop_CombinerInputNV             4140
+#define X_GLrop_CombinerOutputNV            4141
+#define X_GLrop_FinalCombinerInputNV        4142
+
+/* 222. GL_NV_fence */
+#define X_GLrop_SetFenceNV                  4143
+#define X_GLrop_FinishFenceNV               4144
+
+/* 227. GL_NV_register_combiners2 */
+/* XXX opcodes not defined in the spec */
+
+/* 233. GL_NV_vertex_program - see also GL_ARB_vertex_program opcodes */
+#define X_GLrop_ExecuteProgramNV            4181
+#define X_GLrop_RequestResidentProgramsNV   4182
+#define X_GLrop_LoadProgamNV                4183
+#define X_GLrop_ProgramParameters4fvNV      4186
+#define X_GLrop_ProgramParameters4dvNV      4187
+#define X_GLrop_TrackMatrixNV               4188
+#define X_GLrop_VertexAttribs1svNV          4202
+#define X_GLrop_VertexAttribs2svNV          4203
+#define X_GLrop_VertexAttribs3svNV          4204
+#define X_GLrop_VertexAttribs4svNV          4205
+#define X_GLrop_VertexAttribs1fvNV          4206
+#define X_GLrop_VertexAttribs2fvNV          4207
+#define X_GLrop_VertexAttribs3fvNV          4208
+#define X_GLrop_VertexAttribs4fvNV          4209
+#define X_GLrop_VertexAttribs1dvNV          4210
+#define X_GLrop_VertexAttribs2dvNV          4211
+#define X_GLrop_VertexAttribs3dvNV          4212
+#define X_GLrop_VertexAttribs4dvNV          4213
+#define X_GLrop_VertexAttribs4ubvNV         4214
+
+/* 261. GL_NV_occlusion_query */
+/* XXX opcodes not defined in the spec */
+
+/* 262. GL_NV_point_sprite - see GL 1.4 opcodes */
+
+/* 268. GL_EXT_stencil_two_side */
+#define X_GLrop_ActiveStencilFaceEXT        4220
+
+/* 282. GL_NV_fragment_program - see also GL_NV_vertex_program and GL_ARB_vertex_program opcodes */
+#define X_GLrop_ProgramNamedParameter4fvNV  4218
+#define X_GLrop_ProgramNamedParameter4dvNV  4219
+
+/* 285. GL_NV_primitive_restart */
+/* XXX opcodes not defined in the spec */
+
+/* 297. GL_EXT_depth_bounds_test */
+#define X_GLrop_DepthBoundsEXT              4229
+
+/* 299. GL_EXT_blend_equation_separate */
+#define X_GLrop_BlendEquationSeparateEXT    4228
+
+/* 310. GL_EXT_framebuffer_object */
+#define X_GLvop_IsRenderbufferEXT                      1422
+#define X_GLvop_GenRenderbuffersEXT                    1423
+#define X_GLvop_GetRenderbufferParameterivEXT          1424
+#define X_GLvop_IsFramebufferEXT                       1425
+#define X_GLvop_GenFramebuffersEXT                     1426
+#define X_GLvop_CheckFramebufferStatusEXT              1427
+#define X_GLvop_GetFramebufferAttachmentParameterivEXT 1428
+
+#endif /* _GLX_glxproto_h_ */
diff --git a/src/terralib/drivers/GL/glxtokens.h b/src/terralib/drivers/GL/glxtokens.h
new file mode 100644
index 0000000..7908a45
--- /dev/null
+++ b/src/terralib/drivers/GL/glxtokens.h
@@ -0,0 +1,286 @@
+#ifndef __GLX_glxtokens_h__
+#define __GLX_glxtokens_h__
+
+/* $XFree86: xc/include/GL/glxtokens.h,v 1.5 2001/03/21 15:51:38 dawes Exp $ */
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+** 
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define GLX_VERSION_1_1 1
+#define GLX_VERSION_1_2 1
+#define GLX_VERSION_1_3 1
+#define GLX_VERSION_1_4 1
+
+/*
+** Visual Config Attributes (glXGetConfig, glXGetFBConfigAttrib)
+*/
+#define GLX_USE_GL		1	/* support GLX rendering */
+#define GLX_BUFFER_SIZE		2	/* depth of the color buffer */
+#define GLX_LEVEL		3	/* level in plane stacking */
+#define GLX_RGBA		4	/* true if RGBA mode */
+#define GLX_DOUBLEBUFFER	5	/* double buffering supported */
+#define GLX_STEREO		6	/* stereo buffering supported */
+#define GLX_AUX_BUFFERS		7	/* number of aux buffers */
+#define GLX_RED_SIZE		8	/* number of red component bits */
+#define GLX_GREEN_SIZE		9	/* number of green component bits */
+#define GLX_BLUE_SIZE		10	/* number of blue component bits */
+#define GLX_ALPHA_SIZE		11	/* number of alpha component bits */
+#define GLX_DEPTH_SIZE		12	/* number of depth bits */
+#define GLX_STENCIL_SIZE	13	/* number of stencil bits */
+#define GLX_ACCUM_RED_SIZE	14	/* number of red accum bits */
+#define GLX_ACCUM_GREEN_SIZE	15	/* number of green accum bits */
+#define GLX_ACCUM_BLUE_SIZE	16	/* number of blue accum bits */
+#define GLX_ACCUM_ALPHA_SIZE	17	/* number of alpha accum bits */
+/*
+** FBConfig-specific attributes
+*/
+#define GLX_X_VISUAL_TYPE		0x22
+#define GLX_CONFIG_CAVEAT		0x20	/* Like visual_info VISUAL_CAVEAT_EXT */
+#define GLX_TRANSPARENT_TYPE		0x23
+#define GLX_TRANSPARENT_INDEX_VALUE	0x24
+#define GLX_TRANSPARENT_RED_VALUE	0x25
+#define GLX_TRANSPARENT_GREEN_VALUE	0x26
+#define GLX_TRANSPARENT_BLUE_VALUE	0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE	0x28
+#define GLX_DRAWABLE_TYPE		0x8010
+#define GLX_RENDER_TYPE			0x8011
+#define GLX_X_RENDERABLE		0x8012
+#define GLX_FBCONFIG_ID			0x8013
+#define GLX_MAX_PBUFFER_WIDTH		0x8016
+#define GLX_MAX_PBUFFER_HEIGHT		0x8017
+#define GLX_MAX_PBUFFER_PIXELS		0x8018
+#define GLX_VISUAL_ID			0x800B
+
+/* FBConfigSGIX Attributes */
+#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX	0x8019
+#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX	0x801A
+
+/*
+** Error return values from glXGetConfig.  Success is indicated by
+** a value of 0.
+*/
+#define GLX_BAD_SCREEN		1	/* screen # is bad */
+#define GLX_BAD_ATTRIBUTE	2	/* attribute to get is bad */
+#define GLX_NO_EXTENSION	3	/* no glx extension on server */
+#define GLX_BAD_VISUAL		4	/* visual # not known by GLX */
+#define GLX_BAD_CONTEXT		5	/* returned only by import_context EXT? */
+#define GLX_BAD_VALUE		6	/* returned only by glXSwapIntervalSGI? */
+#define GLX_BAD_ENUM		7	/* unused? */
+
+/* FBConfig attribute values */
+
+/*
+** Generic "don't care" value for glX ChooseFBConfig attributes (except
+** GLX_LEVEL)
+*/
+#define GLX_DONT_CARE			0xFFFFFFFF
+
+/* GLX_RENDER_TYPE bits */
+#define GLX_RGBA_BIT			0x00000001
+#define GLX_COLOR_INDEX_BIT		0x00000002
+
+/* GLX_DRAWABLE_TYPE bits */
+#define GLX_WINDOW_BIT			0x00000001
+#define GLX_PIXMAP_BIT			0x00000002
+#define GLX_PBUFFER_BIT			0x00000004
+
+/* GLX_CONFIG_CAVEAT attribute values */
+#define GLX_NONE			0x8000
+#define GLX_SLOW_CONFIG			0x8001
+#define GLX_NON_CONFORMANT_CONFIG	0x800D
+
+/* GLX_X_VISUAL_TYPE attribute values */
+#define GLX_TRUE_COLOR			0x8002
+#define GLX_DIRECT_COLOR		0x8003
+#define GLX_PSEUDO_COLOR		0x8004
+#define GLX_STATIC_COLOR		0x8005
+#define GLX_GRAY_SCALE			0x8006
+#define GLX_STATIC_GRAY			0x8007
+
+/* GLX_TRANSPARENT_TYPE attribute values */
+/* #define GLX_NONE			   0x8000 */
+#define GLX_TRANSPARENT_RGB		0x8008
+#define GLX_TRANSPARENT_INDEX		0x8009
+
+/* glXCreateGLXPbuffer attributes */
+#define GLX_PRESERVED_CONTENTS		0x801B
+#define GLX_LARGEST_PBUFFER		0x801C
+#define GLX_PBUFFER_HEIGHT		0x8040	/* New for GLX 1.3 */
+#define GLX_PBUFFER_WIDTH		0x8041	/* New for GLX 1.3 */
+
+/* glXQueryGLXPBuffer attributes */
+#define GLX_WIDTH			0x801D
+#define GLX_HEIGHT			0x801E
+#define GLX_EVENT_MASK			0x801F
+
+/* glXCreateNewContext render_type attribute values */
+#define GLX_RGBA_TYPE			0x8014
+#define GLX_COLOR_INDEX_TYPE		0x8015
+
+/* glXQueryContext attributes */
+/* #define GLX_FBCONFIG_ID		  0x8013 */
+/* #define GLX_RENDER_TYPE		  0x8011 */
+#define GLX_SCREEN			0x800C
+
+/* glXSelectEvent event mask bits */
+#define GLX_PBUFFER_CLOBBER_MASK	0x08000000
+
+/* GLXPbufferClobberEvent event_type values */
+#define GLX_DAMAGED			0x8020
+#define GLX_SAVED			0x8021
+
+/* GLXPbufferClobberEvent draw_type values */
+#define GLX_WINDOW			0x8022
+#define GLX_PBUFFER			0x8023
+
+/* GLXPbufferClobberEvent buffer_mask bits */
+#define GLX_FRONT_LEFT_BUFFER_BIT	0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT	0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT	0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT	0x00000008
+#define GLX_AUX_BUFFERS_BIT		0x00000010
+#define GLX_DEPTH_BUFFER_BIT		0x00000020
+#define GLX_STENCIL_BUFFER_BIT		0x00000040
+#define GLX_ACCUM_BUFFER_BIT		0x00000080
+
+/*
+** Extension return values from glXGetConfig.  These are also
+** accepted as parameter values for glXChooseVisual.
+*/
+
+#define GLX_X_VISUAL_TYPE_EXT	0x22	/* visual_info extension type */
+#define GLX_TRANSPARENT_TYPE_EXT 0x23	/* visual_info extension */
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24	/* visual_info extension */
+#define GLX_TRANSPARENT_RED_VALUE_EXT	0x25	/* visual_info extension */
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26	/* visual_info extension */
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT	0x27	/* visual_info extension */
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28	/* visual_info extension */
+
+/* Property values for visual_type */
+#define GLX_TRUE_COLOR_EXT	0x8002
+#define GLX_DIRECT_COLOR_EXT	0x8003
+#define GLX_PSEUDO_COLOR_EXT	0x8004
+#define GLX_STATIC_COLOR_EXT	0x8005
+#define GLX_GRAY_SCALE_EXT	0x8006
+#define GLX_STATIC_GRAY_EXT	0x8007
+
+/* Property values for transparent pixel */
+#define GLX_NONE_EXT		0x8000
+#define GLX_TRANSPARENT_RGB_EXT		0x8008
+#define GLX_TRANSPARENT_INDEX_EXT	0x8009
+
+/* Property values for visual_rating */
+#define GLX_VISUAL_CAVEAT_EXT		0x20  /* visual_rating extension type */
+#define GLX_SLOW_VISUAL_EXT		0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT	0x800D
+
+/* Property values for swap method (GLX_OML_swap_method) */
+#define GLX_SWAP_METHOD_OML                0x8060
+#define GLX_SWAP_EXCHANGE_OML              0x8061
+#define GLX_SWAP_COPY_OML                  0x8062
+#define GLX_SWAP_UNDEFINED_OML             0x8063
+
+/* Property values for multi-sampling */
+#define GLX_VISUAL_SELECT_GROUP_SGIX	0x8028	/* visuals grouped by select priority */
+
+/*
+** Names for attributes to glXGetClientString.
+*/
+#define GLX_VENDOR		0x1
+#define GLX_VERSION		0x2
+#define GLX_EXTENSIONS		0x3
+
+/*
+** Names for attributes to glXQueryContextInfoEXT.
+*/
+#define GLX_SHARE_CONTEXT_EXT	0x800A	/* id of share context */
+#define GLX_VISUAL_ID_EXT	0x800B	/* id of context's visual */
+#define GLX_SCREEN_EXT		0x800C	/* screen number */
+
+/*
+** GLX_EXT_texture_from_pixmap
+*/
+#define GLX_BIND_TO_TEXTURE_RGB_EXT        0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT       0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT     0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT    0x20D3
+#define GLX_Y_INVERTED_EXT                 0x20D4
+
+#define GLX_TEXTURE_FORMAT_EXT             0x20D5
+#define GLX_TEXTURE_TARGET_EXT             0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT             0x20D7
+
+#define GLX_TEXTURE_FORMAT_NONE_EXT        0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT         0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT        0x20DA
+
+#define GLX_TEXTURE_1D_BIT_EXT             0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT             0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT      0x00000004
+
+#define GLX_TEXTURE_1D_EXT                 0x20DB
+#define GLX_TEXTURE_2D_EXT                 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT          0x20DD
+
+#define GLX_FRONT_LEFT_EXT                 0x20DE
+#define GLX_FRONT_RIGHT_EXT                0x20DF
+#define GLX_BACK_LEFT_EXT                  0x20E0
+#define GLX_BACK_RIGHT_EXT                 0x20E1
+#define GLX_FRONT_EXT                      GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT                       GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT                       0x20E2
+#define GLX_AUX1_EXT                       0x20E3 
+#define GLX_AUX2_EXT                       0x20E4 
+#define GLX_AUX3_EXT                       0x20E5 
+#define GLX_AUX4_EXT                       0x20E6 
+#define GLX_AUX5_EXT                       0x20E7 
+#define GLX_AUX6_EXT                       0x20E8
+#define GLX_AUX7_EXT                       0x20E9 
+#define GLX_AUX8_EXT                       0x20EA 
+#define GLX_AUX9_EXT                       0x20EB
+
+/*
+ * GLX 1.4 and later:
+ */
+#define GLX_SAMPLE_BUFFERS_SGIS            100000
+#define GLX_SAMPLES_SGIS                   100001
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !__GLX_glxtokens_h__ */
diff --git a/src/terralib/drivers/GL/internal/dri_interface.h b/src/terralib/drivers/GL/internal/dri_interface.h
new file mode 100644
index 0000000..f928bb0
--- /dev/null
+++ b/src/terralib/drivers/GL/internal/dri_interface.h
@@ -0,0 +1,477 @@
+/*
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * (C) Copyright IBM Corporation 2004
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file dri_interface.h
+ *
+ * This file contains all the types and functions that define the interface
+ * between a DRI driver and driver loader.  Currently, the most common driver
+ * loader is the XFree86 libGL.so.  However, other loaders do exist, and in
+ * the future the server-side libglx.a will also be a loader.
+ * 
+ * \author Kevin E. Martin <kevin at precisioninsight.com>
+ * \author Ian Romanick <idr at us.ibm.com>
+ */
+
+#ifndef DRI_INTERFACE_H
+#define DRI_INTERFACE_H
+
+#include <GL/internal/glcore.h>
+#include <drm.h>
+
+/**
+ * \name DRI interface structures
+ *
+ * The following structures define the interface between the GLX client
+ * side library and the DRI (direct rendering infrastructure).
+ */
+/*@{*/
+typedef struct __DRIdisplayRec  __DRIdisplay;
+typedef struct __DRIscreenRec   __DRIscreen;
+typedef struct __DRIcontextRec  __DRIcontext;
+typedef struct __DRIdrawableRec __DRIdrawable;
+typedef struct __DRIdriverRec   __DRIdriver;
+typedef struct __DRIframebufferRec __DRIframebuffer;
+typedef struct __DRIversionRec     __DRIversion;
+typedef struct __DRIinterfaceMethodsRec  __DRIinterfaceMethods;
+typedef unsigned long __DRIid;
+typedef void __DRInativeDisplay;
+/*@}*/
+
+
+/**
+ * \name Functions provided by the driver loader.
+ */
+/*@{*/
+/**
+ * Type of a pointer to \c glXGetScreenDriver, as returned by
+ * \c glXGetProcAddress.  This function is used to get the name of the DRI
+ * driver for the specified screen of the specified display.  The driver
+ * name is typically used with \c glXGetDriverConfig.
+ *
+ * \sa glXGetScreenDriver, glXGetProcAddress, glXGetDriverConfig
+ */
+typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int scrNum);
+
+/**
+ * Type of a pointer to \c glXGetDriverConfig, as returned by
+ * \c glXGetProcAddress.  This function is used to get the XML document
+ * describing the configuration options available for the specified driver.
+ *
+ * \sa glXGetDriverConfig, glXGetProcAddress, glXGetScreenDriver
+ */
+typedef const char * (* PFNGLXGETDRIVERCONFIGPROC) (const char *driverName);
+
+/**
+ * Type of a pointer to \c glxEnableExtension, as returned by
+ * \c __DRIinterfaceMethods::getProcAddress.  This function is used to enable
+ * a GLX extension on the specified screen.
+ */
+typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name );
+/*@}*/
+
+
+/**
+ * \name Functions and data provided by the driver.
+ */
+/*@{*/
+
+typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn,
+    __DRIscreen *psc, const __GLcontextModes * modes,
+    const __DRIversion * ddx_version, const __DRIversion * dri_version,
+    const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
+    void * pSAREA, int fd, int internal_api_version,
+    const __DRIinterfaceMethods * interface,
+    __GLcontextModes ** driver_modes);
+typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC;
+extern CREATENEWSCREENFUNC __driCreateNewScreen_20050727;
+
+
+/**
+ * XML document describing the configuration options supported by the
+ * driver.
+ */
+extern const char __driConfigOptions[];
+
+/*@}*/
+
+
+/**
+ * Stored version of some component (i.e., server-side DRI module, kernel-side
+ * DRM, etc.).
+ * 
+ * \todo
+ * There are several data structures that explicitly store a major version,
+ * minor version, and patch level.  These structures should be modified to
+ * have a \c __DRIversionRec instead.
+ */
+struct __DRIversionRec {
+    int    major;        /**< Major version number. */
+    int    minor;        /**< Minor version number. */
+    int    patch;        /**< Patch-level. */
+};
+
+
+typedef void (*__DRIfuncPtr)(void);
+
+struct __DRIinterfaceMethodsRec {
+    /**
+     * Get pointer to named function.
+     */
+    __DRIfuncPtr (*getProcAddress)( const char * proc_name );
+
+    /**
+     * Create a list of \c __GLcontextModes structures.
+     */
+    __GLcontextModes * (*createContextModes)(unsigned count,
+        size_t minimum_bytes_per_struct);
+
+    /**
+     * Destroy a list of \c __GLcontextModes structures.
+     *
+     * \todo
+     * Determine if the drivers actually need to call this.
+     */
+    void (*destroyContextModes)( __GLcontextModes * modes );
+
+    /**
+     * Get the \c __DRIscreen for a given display and screen number.
+     */
+    __DRIscreen *(*getScreen)(__DRInativeDisplay *dpy, int screenNum);
+
+
+    /**
+     * \name Client/server protocol functions.
+     *
+     * These functions implement the DRI client/server protocol for
+     * context and drawable operations.  Platforms that do not implement
+     * the wire protocol (e.g., EGL) will implement glorified no-op functions.
+     */
+    /*@{*/
+    /**
+     * Determine if the specified window ID still exists.
+     * 
+     * \note
+     * Implementations may assume that the driver will only pass an ID into
+     * this function that actually corresponds to a window.  On
+     * implementations where windows can only be destroyed by the DRI driver
+     * (e.g., EGL), this function is allowed to always return \c GL_TRUE.
+     */
+    GLboolean (*windowExists)(__DRInativeDisplay *dpy, __DRIid draw);
+
+    /**
+     * Create the server-side portion of the GL context.
+     */
+    GLboolean (* createContext)( __DRInativeDisplay *dpy, int screenNum,
+        int configID, void * contextID, drm_context_t * hw_context );
+
+    /**
+     * Destroy the server-side portion of the GL context.
+     */
+    GLboolean (* destroyContext)( __DRInativeDisplay *dpy, int screenNum,
+        __DRIid context );
+
+    /**
+     * Create the server-side portion of the drawable.
+     */
+    GLboolean (*createDrawable)( __DRInativeDisplay * ndpy, int screen,
+        __DRIid drawable, drm_drawable_t * hHWDrawable );
+
+    /**
+     * Destroy the server-side portion of the drawable.
+     */
+    GLboolean (*destroyDrawable)( __DRInativeDisplay * ndpy, int screen,
+        __DRIid drawable );
+
+    /**
+     * This function is used to get information about the position, size, and
+     * clip rects of a drawable.
+     */
+    GLboolean (* getDrawableInfo) ( __DRInativeDisplay *dpy, int scrn,
+        __DRIid draw, unsigned int * index, unsigned int * stamp,
+        int * x, int * y, int * width, int * height,
+        int * numClipRects, drm_clip_rect_t ** pClipRects,
+        int * backX, int * backY,
+        int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
+    /*@}*/
+
+
+    /**
+     * \name Timing related functions.
+     */
+    /*@{*/
+    /**
+     * Get the 64-bit unadjusted system time (UST).
+     */
+    int (*getUST)(int64_t * ust);
+
+    /**
+     * Get the media stream counter (MSC) rate.
+     * 
+     * Matching the definition in GLX_OML_sync_control, this function returns
+     * the rate of the "media stream counter".  In practical terms, this is
+     * the frame refresh rate of the display.
+     */
+    GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable,
+        int32_t * numerator, int32_t * denominator);
+    /*@}*/
+};
+
+   
+/**
+ * Framebuffer information record.  Used by libGL to communicate information
+ * about the framebuffer to the driver's \c __driCreateNewScreen function.
+ * 
+ * In XFree86, most of this information is derrived from data returned by
+ * calling \c XF86DRIGetDeviceInfo.
+ *
+ * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
+ *     __driUtilCreateNewScreen CallCreateNewScreen
+ *
+ * \bug This structure could be better named.
+ */
+struct __DRIframebufferRec {
+    unsigned char *base;    /**< Framebuffer base address in the CPU's
+			     * address space.  This value is calculated by
+			     * calling \c drmMap on the framebuffer handle
+			     * returned by \c XF86DRIGetDeviceInfo (or a
+			     * similar function).
+			     */
+    int size;               /**< Framebuffer size, in bytes. */
+    int stride;             /**< Number of bytes from one line to the next. */
+    int width;              /**< Pixel width of the framebuffer. */
+    int height;             /**< Pixel height of the framebuffer. */
+    int dev_priv_size;      /**< Size of the driver's dev-priv structure. */
+    void *dev_priv;         /**< Pointer to the driver's dev-priv structure. */
+};
+
+
+/**
+ * Screen dependent methods.  This structure is initialized during the
+ * \c __DRIdisplayRec::createScreen call.
+ */
+struct __DRIscreenRec {
+    /**
+     * Method to destroy the private DRI screen data.
+     */
+    void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate);
+
+    /**
+     * Method to create the private DRI drawable data and initialize the
+     * drawable dependent methods.
+     */
+    void *(*createNewDrawable)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
+			       __DRIid draw, __DRIdrawable *pdraw,
+			       int renderType, const int *attrs);
+
+    /**
+     * Method to return a pointer to the DRI drawable data.
+     */
+    __DRIdrawable *(*getDrawable)(__DRInativeDisplay *dpy, __DRIid draw,
+				  void *drawablePrivate);
+
+    /**
+     * Opaque pointer to private per screen direct rendering data.  \c NULL
+     * if direct rendering is not supported on this screen.  Never
+     * dereferenced in libGL.
+     */
+    void *private;
+
+    /**
+     * Get the number of vertical refreshes since some point in time before
+     * this function was first called (i.e., system start up).
+     * 
+     * \since Internal API version 20030317.
+     */
+    int (*getMSC)( void *screenPrivate, int64_t *msc );
+
+    /**
+     * Opaque pointer that points back to the containing 
+     * \c __GLXscreenConfigs.  This data structure is shared with DRI drivers
+     * but \c __GLXscreenConfigs is not. However, they are needed by some GLX
+     * functions called by DRI drivers.
+     *
+     * \since Internal API version 20030813.
+     */
+    void *screenConfigs;
+
+    /**
+     * Functions associated with MESA_allocate_memory.
+     *
+     * \since Internal API version 20030815.
+     */
+    /*@{*/
+    void *(*allocateMemory)(__DRInativeDisplay *dpy, int scrn, GLsizei size,
+			    GLfloat readfreq, GLfloat writefreq,
+			    GLfloat priority);
+   
+    void (*freeMemory)(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer);
+   
+    GLuint (*memoryOffset)(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer);
+    /*@}*/
+
+    /**
+     * Method to create the private DRI context data and initialize the
+     * context dependent methods.
+     *
+     * \since Internal API version 20031201.
+     */
+    void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
+			       int render_type,
+			       void *sharedPrivate, __DRIcontext *pctx);
+};
+
+/**
+ * Context dependent methods.  This structure is initialized during the
+ * \c __DRIscreenRec::createContext call.
+ */
+struct __DRIcontextRec {
+    /**
+     * Method to destroy the private DRI context data.
+     */
+    void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate);
+
+    /**
+     * Opaque pointer to private per context direct rendering data.
+     * \c NULL if direct rendering is not supported on the display or
+     * screen used to create this context.  Never dereferenced in libGL.
+     */
+    void *private;
+
+    /**
+     * Pointer to the mode used to create this context.
+     *
+     * \since Internal API version 20040317.
+     */
+    const __GLcontextModes * mode;
+
+    /**
+     * Method to bind a DRI drawable to a DRI graphics context.
+     *
+     * \since Internal API version 20050727.
+     */
+    GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
+			 __DRIid read, __DRIcontext *ctx);
+
+    /**
+     * Method to unbind a DRI drawable from a DRI graphics context.
+     *
+     * \since Internal API version 20050727.
+     */
+    GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
+			   __DRIid read, __DRIcontext *ctx);
+};
+
+/**
+ * Drawable dependent methods.  This structure is initialized during the
+ * \c __DRIscreenRec::createDrawable call.  \c createDrawable is not called
+ * by libGL at this time.  It's currently used via the dri_util.c utility code
+ * instead.
+ */
+struct __DRIdrawableRec {
+    /**
+     * Method to destroy the private DRI drawable data.
+     */
+    void (*destroyDrawable)(__DRInativeDisplay *dpy, void *drawablePrivate);
+
+    /**
+     * Method to swap the front and back buffers.
+     */
+    void (*swapBuffers)(__DRInativeDisplay *dpy, void *drawablePrivate);
+
+    /**
+     * Opaque pointer to private per drawable direct rendering data.
+     * \c NULL if direct rendering is not supported on the display or
+     * screen used to create this drawable.  Never dereferenced in libGL.
+     */
+    void *private;
+
+    /**
+     * Get the number of completed swap buffers for this drawable.
+     *
+     * \since Internal API version 20030317.
+     */
+    int (*getSBC)(__DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc );
+
+    /**
+     * Wait for the SBC to be greater than or equal target_sbc.
+     *
+     * \since Internal API version 20030317.
+     */
+    int (*waitForSBC)( __DRInativeDisplay * dpy, void *drawablePriv,
+		       int64_t target_sbc,
+		       int64_t * msc, int64_t * sbc );
+
+    /**
+     * Wait for the MSC to equal target_msc, or, if that has already passed,
+     * the next time (MSC % divisor) is equal to remainder.  If divisor is
+     * zero, the function will return as soon as MSC is greater than or equal
+     * to target_msc.
+     * 
+     * \since Internal API version 20030317.
+     */
+    int (*waitForMSC)( __DRInativeDisplay * dpy, void *drawablePriv,
+		       int64_t target_msc, int64_t divisor, int64_t remainder,
+		       int64_t * msc, int64_t * sbc );
+
+    /**
+     * Like \c swapBuffers, but does NOT have an implicit \c glFlush.  Once
+     * rendering is complete, waits until MSC is equal to target_msc, or
+     * if that has already passed, waits until (MSC % divisor) is equal
+     * to remainder.  If divisor is zero, the swap will happen as soon as
+     * MSC is greater than or equal to target_msc.
+     * 
+     * \since Internal API version 20030317.
+     */
+    int64_t (*swapBuffersMSC)(__DRInativeDisplay *dpy, void *drawablePrivate,
+			      int64_t target_msc,
+			      int64_t divisor, int64_t remainder);
+
+    /**
+     * Enable or disable frame usage tracking.
+     * 
+     * \since Internal API version 20030317.
+     */
+    int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, GLboolean enable);
+
+    /**
+     * Retrieve frame usage information.
+     * 
+     * \since Internal API version 20030317.
+     */
+    int (*queryFrameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate,
+			      int64_t * sbc, int64_t * missedFrames,
+			      float * lastMissedUsage, float * usage );
+
+    /**
+     * Used by drivers that implement the GLX_SGI_swap_control or
+     * GLX_MESA_swap_control extension.
+     *
+     * \since Internal API version 20030317.
+     */
+    unsigned swap_interval;
+};
+
+#endif
diff --git a/src/terralib/drivers/GL/internal/glcore.h b/src/terralib/drivers/GL/internal/glcore.h
new file mode 100644
index 0000000..6967d7a
--- /dev/null
+++ b/src/terralib/drivers/GL/internal/glcore.h
@@ -0,0 +1,499 @@
+/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.7 2001/03/25 05:32:00 tsi Exp $ */
+#ifndef __gl_core_h_
+#define __gl_core_h_
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+** 
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+*/
+
+#ifndef XFree86LOADER
+#include <sys/types.h>
+#endif
+
+#ifdef CAPI
+#undef CAPI
+#endif
+#define CAPI
+
+#define GL_CORE_SGI  1
+#define GL_CORE_MESA 2
+#define GL_CORE_APPLE 4
+#define GL_CORE_WINDOWS 8
+
+typedef struct __GLcontextRec __GLcontext;
+typedef struct __GLinterfaceRec __GLinterface;
+
+/*
+** This file defines the interface between the GL core and the surrounding
+** "operating system" that supports it (currently the GLX or WGL extensions).
+**
+** Members (data and function pointers) are documented as imported or
+** exported according to how they are used by the core rendering functions.
+** Imported members are initialized by the "operating system" and used by
+** the core functions.  Exported members are initialized by the core functions
+** and used by the "operating system".
+*/
+
+/*
+** Mode and limit information for a context.  This information is
+** kept around in the context so that values can be used during
+** command execution, and for returning information about the
+** context to the application.
+*/
+typedef struct __GLcontextModesRec {
+    struct __GLcontextModesRec * next;
+
+    GLboolean rgbMode;
+    GLboolean floatMode;
+    GLboolean colorIndexMode;
+    GLuint doubleBufferMode;
+    GLuint stereoMode;
+
+    GLboolean haveAccumBuffer;
+    GLboolean haveDepthBuffer;
+    GLboolean haveStencilBuffer;
+
+    GLint redBits, greenBits, blueBits, alphaBits;	/* bits per comp */
+    GLuint redMask, greenMask, blueMask, alphaMask;
+    GLint rgbBits;		/* total bits for rgb */
+    GLint indexBits;		/* total bits for colorindex */
+
+    GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
+    GLint depthBits;
+    GLint stencilBits;
+
+    GLint numAuxBuffers;
+
+    GLint level;
+
+    GLint pixmapMode;
+
+    /* GLX */
+    GLint visualID;
+    GLint visualType;     /**< One of the GLX X visual types. (i.e., 
+			   * \c GLX_TRUE_COLOR, etc.)
+			   */
+
+    /* EXT_visual_rating / GLX 1.2 */
+    GLint visualRating;
+
+    /* EXT_visual_info / GLX 1.2 */
+    GLint transparentPixel;
+				/*    colors are floats scaled to ints */
+    GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
+    GLint transparentIndex;
+
+    /* ARB_multisample / SGIS_multisample */
+    GLint sampleBuffers;
+    GLint samples;
+
+    /* SGIX_fbconfig / GLX 1.3 */
+    GLint drawableType;
+    GLint renderType;
+    GLint xRenderable;
+    GLint fbconfigID;
+
+    /* SGIX_pbuffer / GLX 1.3 */
+    GLint maxPbufferWidth;
+    GLint maxPbufferHeight;
+    GLint maxPbufferPixels;
+    GLint optimalPbufferWidth;   /* Only for SGIX_pbuffer. */
+    GLint optimalPbufferHeight;  /* Only for SGIX_pbuffer. */
+
+    /* SGIX_visual_select_group */
+    GLint visualSelectGroup;
+
+    /* OML_swap_method */
+    GLint swapMethod;
+
+    GLint screen;
+} __GLcontextModes;
+
+/* Several fields of __GLcontextModes can take these as values.  Since
+ * GLX header files may not be available everywhere they need to be used,
+ * redefine them here.
+ */
+#define GLX_NONE                           0x8000
+#define GLX_SLOW_CONFIG                    0x8001
+#define GLX_TRUE_COLOR                     0x8002
+#define GLX_DIRECT_COLOR                   0x8003
+#define GLX_PSEUDO_COLOR                   0x8004
+#define GLX_STATIC_COLOR                   0x8005
+#define GLX_GRAY_SCALE                     0x8006
+#define GLX_STATIC_GRAY                    0x8007
+#define GLX_TRANSPARENT_RGB                0x8008
+#define GLX_TRANSPARENT_INDEX              0x8009
+#define GLX_NON_CONFORMANT_CONFIG          0x800D
+#define GLX_SWAP_EXCHANGE_OML              0x8061
+#define GLX_SWAP_COPY_OML                  0x8062
+#define GLX_SWAP_UNDEFINED_OML             0x8063
+
+#define GLX_DONT_CARE                      0xFFFFFFFF
+
+#define GLX_RGBA_BIT                       0x00000001
+#define GLX_COLOR_INDEX_BIT                0x00000002
+#define GLX_WINDOW_BIT                     0x00000001
+#define GLX_PIXMAP_BIT                     0x00000002
+#define GLX_PBUFFER_BIT                    0x00000004
+
+/************************************************************************/
+
+/*
+** Structure used for allocating and freeing drawable private memory.
+** (like software buffers, for example).
+**
+** The memory allocation routines are provided by the surrounding
+** "operating system" code, and they are to be used for allocating
+** software buffers and things which are associated with the drawable,
+** and used by any context which draws to that drawable.  There are
+** separate memory allocation functions for drawables and contexts
+** since drawables and contexts can be created and destroyed independently
+** of one another, and the "operating system" may want to use separate
+** allocation arenas for each.
+**
+** The freePrivate function is filled in by the core routines when they
+** allocates software buffers, and stick them in "private".  The freePrivate
+** function will destroy anything allocated to this drawable (to be called
+** when the drawable is destroyed).
+*/
+typedef struct __GLdrawableRegionRec __GLdrawableRegion;
+typedef struct __GLdrawableBufferRec __GLdrawableBuffer;
+typedef struct __GLdrawablePrivateRec __GLdrawablePrivate;
+
+typedef struct __GLregionRectRec {
+    /* lower left (inside the rectangle) */
+    GLint x0, y0;
+    /* upper right (outside the rectangle) */
+    GLint x1, y1;
+} __GLregionRect;
+
+struct __GLdrawableRegionRec {
+    GLint numRects;
+    __GLregionRect *rects;
+    __GLregionRect boundingRect;
+};
+
+/************************************************************************/
+
+/* masks for the buffers */
+#define __GL_FRONT_BUFFER_MASK		0x00000001
+#define	__GL_FRONT_LEFT_BUFFER_MASK	0x00000001
+#define	__GL_FRONT_RIGHT_BUFFER_MASK	0x00000002
+#define	__GL_BACK_BUFFER_MASK		0x00000004
+#define __GL_BACK_LEFT_BUFFER_MASK	0x00000004
+#define __GL_BACK_RIGHT_BUFFER_MASK	0x00000008
+#define	__GL_ACCUM_BUFFER_MASK		0x00000010
+#define	__GL_DEPTH_BUFFER_MASK		0x00000020
+#define	__GL_STENCIL_BUFFER_MASK	0x00000040
+#define	__GL_AUX_BUFFER_MASK(i)		(0x0000080 << (i))
+
+#define __GL_ALL_BUFFER_MASK		0xffffffff
+
+/* what Resize routines return if resize resorted to fallback case */
+#define __GL_BUFFER_FALLBACK	0x10
+
+typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf, 
+				      __GLdrawablePrivate *glPriv, GLint bits);
+typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf, 
+				  __GLdrawablePrivate *glPriv, GLint bits,
+				  __GLbufFallbackInitFn back);
+
+/*
+** A drawable buffer
+**
+** This data structure describes the context side of a drawable.  
+**
+** According to the spec there could be multiple contexts bound to the same
+** drawable at the same time (from different threads).  In order to avoid
+** multiple-access conflicts, locks are used to serialize access.  When a
+** thread needs to access (read or write) a member of the drawable, it takes
+** a lock first.  Some of the entries in the drawable are treated "mostly
+** constant", so we take the freedom of allowing access to them without
+** taking a lock (for optimization reasons).
+**
+** For more details regarding locking, see buffers.h in the GL core
+*/
+struct __GLdrawableBufferRec {
+    /*
+    ** Buffer dimensions
+    */
+    GLint width, height, depth;
+
+    /*
+    ** Framebuffer base address
+    */
+    void *base;
+
+    /*
+    ** Framebuffer size (in bytes)
+    */
+    GLuint size;
+
+    /*
+    ** Size (in bytes) of each element in the framebuffer
+    */
+    GLuint elementSize;
+    GLuint elementSizeLog2;
+
+    /*
+    ** Element skip from one scanline to the next.
+    ** If the buffer is part of another buffer (for example, fullscreen
+    ** front buffer), outerWidth is the width of that buffer.
+    */
+    GLint outerWidth;
+
+    /*
+    ** outerWidth * elementSize
+    */
+    GLint byteWidth;
+
+    /*
+    ** Allocation/deallocation is done based on this handle.  A handle
+    ** is conceptually different from the framebuffer 'base'.
+    */
+    void *handle;
+
+    /* imported */
+    GLboolean (*resize)(__GLdrawableBuffer *buf,
+			GLint x, GLint y, GLuint width, GLuint height, 
+			__GLdrawablePrivate *glPriv, GLuint bufferMask);
+    void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
+    void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
+    void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
+    		GLuint val, GLint x, GLint y, GLint w, GLint h);
+    void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
+
+    /* exported */
+    void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
+#ifdef __cplusplus
+    void *privatePtr;
+#else
+    void *private;
+#endif
+
+    /* private */
+    void *other;	/* implementation private data */
+    __GLbufMainInitFn mainInit;
+    __GLbufFallbackInitFn fallbackInit;
+};
+
+/*
+** The context side of the drawable private
+*/
+struct __GLdrawablePrivateRec {
+    /*
+    ** Drawable Modes
+    */
+    __GLcontextModes *modes;
+
+    /*
+    ** Drawable size
+    */
+    GLuint width, height;
+
+    /*
+    ** Origin in screen coordinates of the drawable
+    */
+    GLint xOrigin, yOrigin;
+#ifdef __GL_ALIGNED_BUFFERS
+    /*
+    ** Drawable offset from screen origin
+    */
+    GLint xOffset, yOffset;
+
+    /*
+    ** Alignment restriction
+    */
+    GLint xAlignment, yAlignment;
+#endif
+    /*
+    ** Should we invert the y axis?
+    */
+    GLint yInverted;
+
+    /*
+    ** Mask specifying which buffers are renderable by the hw
+    */
+    GLuint accelBufferMask;
+
+    /*
+    ** the buffers themselves
+    */
+    __GLdrawableBuffer frontBuffer;
+    __GLdrawableBuffer backBuffer;
+    __GLdrawableBuffer accumBuffer;
+    __GLdrawableBuffer depthBuffer;
+    __GLdrawableBuffer stencilBuffer;
+#if defined(__GL_NUMBER_OF_AUX_BUFFERS) && (__GL_NUMBER_OF_AUX_BUFFERS > 0)
+    __GLdrawableBuffer *auxBuffer;
+#endif
+
+    __GLdrawableRegion ownershipRegion;
+
+    /*
+    ** Lock for the drawable private structure
+    */
+    void *lock;
+#ifdef DEBUG
+    /* lock debugging info */
+    int lockRefCount;
+    int lockLine[10];
+    char *lockFile[10];
+#endif
+
+    /* imported */
+    void *(*malloc)(size_t size);
+    void *(*calloc)(size_t numElem, size_t elemSize);
+    void *(*realloc)(void *oldAddr, size_t newSize);
+    void (*free)(void *addr);
+
+    GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv, 
+			     GLint x, GLint y, GLsizei width, GLsizei height);
+    void (*setClipRect)(__GLdrawablePrivate *glPriv, 
+			GLint x, GLint y, GLsizei width, GLsizei height);
+    void (*updateClipRegion)(__GLdrawablePrivate *glPriv);
+    GLboolean (*resize)(__GLdrawablePrivate *glPriv);
+    void (*getDrawableSize)(__GLdrawablePrivate *glPriv, 
+			    GLint *x, GLint *y, GLuint *width, GLuint *height);
+
+    void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc);
+    void (*unlockDP)(__GLdrawablePrivate *glPriv);
+
+    /* exported */
+#ifdef __cplusplus
+    void *privatePtr;
+#else
+    void *private;
+#endif
+    void (*freePrivate)(__GLdrawablePrivate *);
+
+    /* client data */
+    void *other;
+};
+
+/*
+** Macros to lock/unlock the drawable private
+*/
+#if defined(DEBUG)
+#define __GL_LOCK_DP(glPriv,gc) \
+    (*(glPriv)->lockDP)(glPriv,gc); \
+    (glPriv)->lockLine[(glPriv)->lockRefCount] = __LINE__; \
+    (glPriv)->lockFile[(glPriv)->lockRefCount] = __FILE__; \
+    (glPriv)->lockRefCount++
+#define __GL_UNLOCK_DP(glPriv) \
+    (glPriv)->lockRefCount--; \
+    (glPriv)->lockLine[(glPriv)->lockRefCount] = 0; \
+    (glPriv)->lockFile[(glPriv)->lockRefCount] = NULL; \
+    (*(glPriv)->unlockDP)(glPriv)
+#else /* DEBUG */
+#define __GL_LOCK_DP(glPriv,gc)		(*(glPriv)->lockDP)(glPriv,gc)
+#define	__GL_UNLOCK_DP(glPriv)		(*(glPriv)->unlockDP)(glPriv)
+#endif /* DEBUG */
+
+
+/*
+** Procedures which are imported by the GL from the surrounding
+** "operating system".  Math functions are not considered part of the
+** "operating system".
+*/
+typedef struct __GLimportsRec {
+    /* Memory management */
+    void * (*malloc)(__GLcontext *gc, size_t size);
+    void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize);
+    void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize);
+    void (*free)(__GLcontext *gc, void *addr);
+
+    /* Error handling */
+    void (*warning)(__GLcontext *gc, char *fmt);
+    void (*fatal)(__GLcontext *gc, char *fmt);
+
+    /* other system calls */
+    char *(CAPI *getenv)(__GLcontext *gc, const char *var);
+    int (CAPI *atoi)(__GLcontext *gc, const char *str);
+    int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...);
+    void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode);
+    int (CAPI *fclose)(__GLcontext *gc, void *stream);
+    int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...);
+
+    /* Drawing surface management */
+    __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc);
+    __GLdrawablePrivate *(*getReadablePrivate)(__GLcontext *gc);
+
+    /* Operating system dependent data goes here */
+    void *other;
+} __GLimports;
+
+/************************************************************************/
+
+/*
+** Procedures which are exported by the GL to the surrounding "operating
+** system" so that it can manage multiple GL context's.
+*/
+typedef struct __GLexportsRec {
+    /* Context management (return GL_FALSE on failure) */
+    GLboolean (*destroyContext)(__GLcontext *gc);
+    GLboolean (*loseCurrent)(__GLcontext *gc);
+    /* oldglPriv isn't used anymore, kept for backwards compatibility */
+    GLboolean (*makeCurrent)(__GLcontext *gc);
+    GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare);
+    GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask);
+    GLboolean (*forceCurrent)(__GLcontext *gc);
+
+    /* Drawing surface notification callbacks */
+    GLboolean (*notifyResize)(__GLcontext *gc);
+    void (*notifyDestroy)(__GLcontext *gc);
+    void (*notifySwapBuffers)(__GLcontext *gc);
+
+    /* Dispatch table override control for external agents like libGLS */
+    struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc);
+    void (*beginDispatchOverride)(__GLcontext *gc);
+    void (*endDispatchOverride)(__GLcontext *gc);
+} __GLexports;
+
+/************************************************************************/
+
+/*
+** This must be the first member of a __GLcontext structure.  This is the
+** only part of a context that is exposed to the outside world; everything
+** else is opaque.
+*/
+struct __GLinterfaceRec {
+    __GLimports imports;
+    __GLexports exports;
+};
+
+extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *);
+extern void __glCoreNopDispatch(void);
+
+#endif /* __gl_core_h_ */
diff --git a/src/terralib/drivers/GL/mesa_wgl.h b/src/terralib/drivers/GL/mesa_wgl.h
new file mode 100644
index 0000000..29f2fc0
--- /dev/null
+++ b/src/terralib/drivers/GL/mesa_wgl.h
@@ -0,0 +1,132 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  3.1
+ *
+ * Copyright (C) 1999  Brian Paul   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/* prototypes for the Mesa WGL functions */
+/* relocated here so that I could make GLUT get them properly */
+
+#define _mesa_wgl_h_
+
+#ifndef _mesa_wgl_h_
+#define _mesa_wgl_h_
+
+
+#include <GL/gl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
+#  if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+#    define GLAPI __declspec(dllexport)
+#    define WGLAPI __declspec(dllexport)
+#  elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+#    define GLAPI __declspec(dllimport)
+#    define WGLAPI __declspec(dllimport)
+#  else /* for use with static link lib build of Win32 edition only */
+#    define GLAPI extern
+#    define WGLAPI __declspec(dllimport)
+#  endif /* _STATIC_MESA support */
+#  define GLAPIENTRY __stdcall
+#else
+/* non-Windows compilation */
+#  define GLAPI extern
+#  define GLAPIENTRY
+#endif /* WIN32 / CYGWIN32 bracket */
+
+
+#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
+#ifndef _GNU_H_WINDOWS32_FUNCTIONS
+#	ifdef UNICODE
+#		define wglUseFontBitmaps  wglUseFontBitmapsW
+#		define wglUseFontOutlines  wglUseFontOutlinesW
+#	else
+#		define wglUseFontBitmaps  wglUseFontBitmapsA
+#		define wglUseFontOutlines  wglUseFontOutlinesA
+#	endif /* !UNICODE */
+#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
+typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
+typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
+typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
+#endif
+
+
+#ifdef _MSC_VER
+#  pragma warning( disable : 4615 ) /* pragma warning : unknown user warning type*/
+#  pragma warning( push )
+#  pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
+#endif
+
+WGLAPI int   GLAPIENTRY wglDeleteContext(HGLRC);
+WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
+WGLAPI int   GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
+WGLAPI int   GLAPIENTRY wglSwapBuffers(HDC hdc);
+WGLAPI HDC   GLAPIENTRY wglGetCurrentDC(void);
+WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
+WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
+WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
+WGLAPI PROC  GLAPIENTRY wglGetProcAddress(const char*);
+WGLAPI int   GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
+WGLAPI int   GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
+WGLAPI int   GLAPIENTRY wglDeleteContext(HGLRC);
+WGLAPI int   GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
+WGLAPI int   GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
+WGLAPI int   GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
+WGLAPI int   GLAPIENTRY wglGetPixelFormat(HDC hdc);
+WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
+WGLAPI int   GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
+WGLAPI int   GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
+WGLAPI int   GLAPIENTRY wglShareLists(HGLRC, HGLRC);
+WGLAPI int   GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
+WGLAPI int   GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
+WGLAPI int   GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
+WGLAPI int   GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
+WGLAPI int   GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
+WGLAPI int   GLAPIENTRY SwapBuffers(HDC);
+WGLAPI int   GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
+WGLAPI int   GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
+WGLAPI int   GLAPIENTRY GetPixelFormat(HDC);
+WGLAPI int   GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
+
+
+#ifndef WGL_ARB_extensions_string
+#define WGL_ARB_extensions_string 1
+
+WGLAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc);
+
+#endif /* WGL_ARB_extensions_string */
+
+
+#ifdef _MSC_VER
+#  pragma warning( pop )
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _mesa_wgl_h_ */
diff --git a/src/terralib/drivers/GL/mglmesa.h b/src/terralib/drivers/GL/mglmesa.h
new file mode 100644
index 0000000..d9ba61c
--- /dev/null
+++ b/src/terralib/drivers/GL/mglmesa.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+*
+*                      Mesa bindings for SciTech MGL
+*
+*                   Copyright (C) 1996 SciTech Software.
+*                           All rights reserved.
+*
+* Filename:     mglmesa.h
+* Version:      Revision: 1.1.1.1
+*
+* Language:     ANSI C
+* Environment:  Any
+*
+* Description:  Header file for the Mesa/OpenGL interface bindings for the
+*               SciTech MGL graphics library. Uses the MGL internal
+*               device context structures to get direct access to the
+*               high performance MGL rasterization functions for maximum
+*               performance. Utilizes the VESA VBE/AF Accelerator Functions
+*               via the MGL's accelerated device driver functions, as well
+*               as basic DirectDraw accelerated functions provided by the
+*               MGL.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Library General Public
+* License as published by the Free Software Foundation; either
+* version 2 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Library General Public License for more details.
+*
+* You should have received a copy of the GNU Library General Public
+* License along with this library; if not, write to the Free
+* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*
+*
+****************************************************************************/
+
+#ifndef __MGLMESA_H
+#define __MGLMESA_H
+
+#include "mgraph.h"
+
+/*------------------------- Function Prototypes ---------------------------*/
+
+#ifdef  __cplusplus
+extern "C" {            /* Use "C" linkage when in C++ mode */
+#endif
+
+#ifndef __WINDOWS__
+#define GLAPIENTRY
+#endif
+
+#ifdef  __WINDOWS__
+bool    GLAPIENTRY MGLMesaInitDLL(MGLCallbacks *cb,char *version);
+#endif
+void    GLAPIENTRY MGLMesaChooseVisual(MGLDC *dc,MGLVisual *visual);
+bool    GLAPIENTRY MGLMesaSetVisual(MGLDC *dc,MGLVisual *visual);
+bool    GLAPIENTRY MGLMesaCreateContext(MGLDC *dc,bool forceMemDC);
+void    GLAPIENTRY MGLMesaDestroyContext(MGLDC *dc);
+void    GLAPIENTRY MGLMesaMakeCurrent(MGLDC *dc);
+void    GLAPIENTRY MGLMesaSwapBuffers(MGLDC *dc,bool waitVRT);
+
+/* Palette manipulation support. The reason we provide palette manipulation
+ * routines is so that when rendering in double buffered modes with a
+ * software backbuffer, the palette for the backbuffer is kept consistent
+ * with the hardware front buffer.
+ */
+
+void    GLAPIENTRY MGLMesaSetPaletteEntry(MGLDC *dc,int entry,uchar red,uchar green,uchar blue);
+void    GLAPIENTRY MGLMesaSetPalette(MGLDC *dc,palette_t *pal,int numColors,int startIndex);
+void    GLAPIENTRY MGLMesaRealizePalette(MGLDC *dc,int numColors,int startIndex,int waitVRT);
+
+#ifdef  __cplusplus
+}                       /* End of "C" linkage for C++   */
+#endif  /* __cplusplus */
+
+#endif  /* __MGLMESA_H */
diff --git a/src/terralib/drivers/GL/osmesa.h b/src/terralib/drivers/GL/osmesa.h
new file mode 100644
index 0000000..402ccd9
--- /dev/null
+++ b/src/terralib/drivers/GL/osmesa.h
@@ -0,0 +1,289 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  6.5
+ * 
+ * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/*
+ * Mesa Off-Screen rendering interface.
+ *
+ * This is an operating system and window system independent interface to
+ * Mesa which allows one to render images into a client-supplied buffer in
+ * main memory.  Such images may manipulated or saved in whatever way the
+ * client wants.
+ *
+ * These are the API functions:
+ *   OSMesaCreateContext - create a new Off-Screen Mesa rendering context
+ *   OSMesaMakeCurrent - bind an OSMesaContext to a client's image buffer
+ *                       and make the specified context the current one.
+ *   OSMesaDestroyContext - destroy an OSMesaContext
+ *   OSMesaGetCurrentContext - return thread's current context ID
+ *   OSMesaPixelStore - controls how pixels are stored in image buffer
+ *   OSMesaGetIntegerv - return OSMesa state parameters
+ *
+ *
+ * The limits on the width and height of an image buffer are MAX_WIDTH and
+ * MAX_HEIGHT as defined in Mesa/src/config.h.  Defaults are 1280 and 1024.
+ * You can increase them as needed but beware that many temporary arrays in
+ * Mesa are dimensioned by MAX_WIDTH or MAX_HEIGHT.
+ */
+
+
+#ifndef OSMESA_H
+#define OSMESA_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <GL/gl.h>
+
+
+#define OSMESA_MAJOR_VERSION 6
+#define OSMESA_MINOR_VERSION 5
+#define OSMESA_PATCH_VERSION 0
+
+
+
+/*
+ * Values for the format parameter of OSMesaCreateContext()
+ * New in version 2.0.
+ */
+#define OSMESA_COLOR_INDEX	GL_COLOR_INDEX
+#define OSMESA_RGBA		GL_RGBA
+#define OSMESA_BGRA		0x1
+#define OSMESA_ARGB		0x2
+#define OSMESA_RGB		GL_RGB
+#define OSMESA_BGR		0x4
+#define OSMESA_RGB_565		0x5
+
+
+/*
+ * OSMesaPixelStore() parameters:
+ * New in version 2.0.
+ */
+#define OSMESA_ROW_LENGTH	0x10
+#define OSMESA_Y_UP		0x11
+
+
+/*
+ * Accepted by OSMesaGetIntegerv:
+ */
+#define OSMESA_WIDTH		0x20
+#define OSMESA_HEIGHT		0x21
+#define OSMESA_FORMAT		0x22
+#define OSMESA_TYPE		0x23
+#define OSMESA_MAX_WIDTH	0x24  /* new in 4.0 */
+#define OSMESA_MAX_HEIGHT	0x25  /* new in 4.0 */
+
+
+typedef struct osmesa_context *OSMesaContext;
+
+
+#if defined(__BEOS__) || defined(__QUICKDRAW__)
+#pragma export on
+#endif
+
+
+/*
+ * Create an Off-Screen Mesa rendering context.  The only attribute needed is
+ * an RGBA vs Color-Index mode flag.
+ *
+ * Input:  format - one of OSMESA_COLOR_INDEX, OSMESA_RGBA, OSMESA_BGRA,
+ *                  OSMESA_ARGB, OSMESA_RGB, or OSMESA_BGR.
+ *         sharelist - specifies another OSMesaContext with which to share
+ *                     display lists.  NULL indicates no sharing.
+ * Return:  an OSMesaContext or 0 if error
+ */
+GLAPI OSMesaContext GLAPIENTRY
+OSMesaCreateContext( GLenum format, OSMesaContext sharelist );
+
+
+
+/*
+ * Create an Off-Screen Mesa rendering context and specify desired
+ * size of depth buffer, stencil buffer and accumulation buffer.
+ * If you specify zero for depthBits, stencilBits, accumBits you
+ * can save some memory.
+ *
+ * New in Mesa 3.5
+ */
+GLAPI OSMesaContext GLAPIENTRY
+OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
+                        GLint accumBits, OSMesaContext sharelist);
+
+
+/*
+ * Destroy an Off-Screen Mesa rendering context.
+ *
+ * Input:  ctx - the context to destroy
+ */
+GLAPI void GLAPIENTRY
+OSMesaDestroyContext( OSMesaContext ctx );
+
+
+
+/*
+ * Bind an OSMesaContext to an image buffer.  The image buffer is just a
+ * block of memory which the client provides.  Its size must be at least
+ * as large as width*height*sizeof(type).  Its address should be a multiple
+ * of 4 if using RGBA mode.
+ *
+ * Image data is stored in the order of glDrawPixels:  row-major order
+ * with the lower-left image pixel stored in the first array position
+ * (ie. bottom-to-top).
+ *
+ * Since the only type initially supported is GL_UNSIGNED_BYTE, if the
+ * context is in RGBA mode, each pixel will be stored as a 4-byte RGBA
+ * value.  If the context is in color indexed mode, each pixel will be
+ * stored as a 1-byte value.
+ *
+ * If the context's viewport hasn't been initialized yet, it will now be
+ * initialized to (0,0,width,height).
+ *
+ * Input:  ctx - the rendering context
+ *         buffer - the image buffer memory
+ *         type - data type for pixel components, only GL_UNSIGNED_BYTE
+ *                supported now
+ *         width, height - size of image buffer in pixels, at least 1
+ * Return:  GL_TRUE if success, GL_FALSE if error because of invalid ctx,
+ *          invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1,
+ *          width>internal limit or height>internal limit.
+ */
+GLAPI GLboolean GLAPIENTRY
+OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type,
+                   GLsizei width, GLsizei height );
+
+
+
+
+/*
+ * Return the current Off-Screen Mesa rendering context handle.
+ */
+GLAPI OSMesaContext GLAPIENTRY
+OSMesaGetCurrentContext( void );
+
+
+
+/*
+ * Set pixel store/packing parameters for the current context.
+ * This is similar to glPixelStore.
+ * Input:  pname - OSMESA_ROW_LENGTH
+ *                    specify actual pixels per row in image buffer
+ *                    0 = same as image width (default)
+ *                 OSMESA_Y_UP
+ *                    zero = Y coordinates increase downward
+ *                    non-zero = Y coordinates increase upward (default)
+ *         value - the value for the parameter pname
+ *
+ * New in version 2.0.
+ */
+GLAPI void GLAPIENTRY
+OSMesaPixelStore( GLint pname, GLint value );
+
+
+
+/*
+ * Return an integer value like glGetIntegerv.
+ * Input:  pname -
+ *                 OSMESA_WIDTH  return current image width
+ *                 OSMESA_HEIGHT  return current image height
+ *                 OSMESA_FORMAT  return image format
+ *                 OSMESA_TYPE  return color component data type
+ *                 OSMESA_ROW_LENGTH return row length in pixels
+ *                 OSMESA_Y_UP returns 1 or 0 to indicate Y axis direction
+ *         value - pointer to integer in which to return result.
+ */
+GLAPI void GLAPIENTRY
+OSMesaGetIntegerv( GLint pname, GLint *value );
+
+
+
+/*
+ * Return the depth buffer associated with an OSMesa context.
+ * Input:  c - the OSMesa context
+ * Output:  width, height - size of buffer in pixels
+ *          bytesPerValue - bytes per depth value (2 or 4)
+ *          buffer - pointer to depth buffer values
+ * Return:  GL_TRUE or GL_FALSE to indicate success or failure.
+ *
+ * New in Mesa 2.4.
+ */
+GLAPI GLboolean GLAPIENTRY
+OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height,
+                      GLint *bytesPerValue, void **buffer );
+
+
+
+/*
+ * Return the color buffer associated with an OSMesa context.
+ * Input:  c - the OSMesa context
+ * Output:  width, height - size of buffer in pixels
+ *          format - buffer format (OSMESA_FORMAT)
+ *          buffer - pointer to depth buffer values
+ * Return:  GL_TRUE or GL_FALSE to indicate success or failure.
+ *
+ * New in Mesa 3.3.
+ */
+GLAPI GLboolean GLAPIENTRY
+OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height,
+                      GLint *format, void **buffer );
+
+
+
+/**
+ * This typedef is new in Mesa 6.3.
+ */
+typedef void (*OSMESAproc)();
+
+
+/*
+ * Return pointer to the named function.
+ * New in Mesa 4.1
+ * Return OSMESAproc in 6.3.
+ */
+GLAPI OSMESAproc GLAPIENTRY
+OSMesaGetProcAddress( const char *funcName );
+
+
+
+/**
+ * Enable/disable color clamping, off by default.
+ * New in Mesa 6.4.2
+ */
+GLAPI void GLAPIENTRY
+OSMesaColorClamp(GLboolean enable);
+
+
+#if defined(__BEOS__) || defined(__QUICKDRAW__)
+#pragma export off
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/src/terralib/drivers/GL/svgamesa.h b/src/terralib/drivers/GL/svgamesa.h
new file mode 100644
index 0000000..9ca8554
--- /dev/null
+++ b/src/terralib/drivers/GL/svgamesa.h
@@ -0,0 +1,97 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  4.0
+ * Copyright (C) 1995-2001  Brian Paul
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+/*
+ * SVGA/Mesa interface for Linux.
+ */
+
+
+/*
+ * Intro to using the VGA/Mesa interface
+ *
+ * 1. #include the <vga.h> file
+ * 2. Call vga_init() to initialize the SVGA library.
+ * 3. Call vga_setmode() to specify the screen size and color depth.
+ * 4. Call SVGAMesaCreateContext() to setup a Mesa context.  If using 8-bit
+ *    color Mesa assumes color index mode, if using 16-bit or deeper color
+ *    Mesa assumes RGB mode.
+ * 5. Call SVGAMesaMakeCurrent() to activate the Mesa context.
+ * 6. You can now use the Mesa API functions.
+ * 7. Before exiting, call SVGAMesaDestroyContext() then vga_setmode(TEXT)
+ *    to restore the original text screen.
+ *
+ * Notes
+ * 1. You must run your executable as root (or use the set UID-bit) because
+ *    the SVGA library requires it.
+ * 2. The SVGA driver is not fully implemented yet.  See svgamesa.c for what
+ *    has to be done yet.
+ */
+
+
+#ifndef SVGAMESA_H
+#define SVGAMESA_H
+
+
+#define SVGAMESA_MAJOR_VERSION 4
+#define SVGAMESA_MINOR_VERSION 0
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "GL/gl.h"
+
+
+
+/*
+ * This is the SVGAMesa context 'handle':
+ */
+typedef struct svgamesa_context *SVGAMesaContext;
+
+
+
+/*
+ * doubleBuffer flag new in version 2.4
+ */
+extern int SVGAMesaInit( int GraphMode );
+
+extern int SVGAMesaClose( void );
+
+extern SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer );
+
+extern void SVGAMesaDestroyContext( SVGAMesaContext ctx );
+
+extern void SVGAMesaMakeCurrent( SVGAMesaContext ctx );
+
+extern void SVGAMesaSwapBuffers( void );
+
+extern void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue);
+
+extern SVGAMesaContext SVGAMesaGetCurrentContext( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/src/terralib/drivers/GL/uglglutshapes.h b/src/terralib/drivers/GL/uglglutshapes.h
new file mode 100644
index 0000000..cbf0572
--- /dev/null
+++ b/src/terralib/drivers/GL/uglglutshapes.h
@@ -0,0 +1,45 @@
+/* uglglutshapes.h - Public header GLUT Shapes */
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
+
+/* This program is freely distributable without licensing fees  and is
+   provided without guarantee or warrantee expressed or  implied. This
+   program is -not- in the public domain. */
+
+#ifndef GLUTSHAPES_H
+#define GLUTSHAPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <GL/gl.h>  
+
+void glutWireSphere (GLdouble radius, GLint slices, GLint stacks);
+void glutSolidSphere (GLdouble radius, GLint slices, GLint stacks);
+void glutWireCone (GLdouble base, GLdouble height,
+		   GLint slices, GLint stacks);
+void glutSolidCone (GLdouble base, GLdouble height,
+		    GLint slices, GLint stacks);
+void glutWireCube (GLdouble size);
+void glutSolidCube (GLdouble size);
+void glutWireTorus (GLdouble innerRadius, GLdouble outerRadius,
+		    GLint sides, GLint rings);
+void glutSolidTorus (GLdouble innerRadius, GLdouble outerRadius,
+		     GLint sides, GLint rings);
+void glutWireDodecahedron (void);
+void glutSolidDodecahedron (void);
+void glutWireOctahedron (void);
+void glutSolidOctahedron (void);
+void glutWireTetrahedron (void);
+void glutSolidTetrahedron (void);
+void glutWireIcosahedron (void);
+void glutSolidIcosahedron (void);
+void glutWireTeapot (GLdouble size);
+void glutSolidTeapot (GLdouble size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/terralib/drivers/GL/uglmesa.h b/src/terralib/drivers/GL/uglmesa.h
new file mode 100644
index 0000000..fb6d368
--- /dev/null
+++ b/src/terralib/drivers/GL/uglmesa.h
@@ -0,0 +1,155 @@
+/* uglmesa.h - Public header UGL/Mesa */
+
+/* Copyright (C) 2001 by Wind River Systems, Inc */
+
+/*
+ * Mesa 3-D graphics library
+ * Version:  4.0
+ *
+ * The MIT License
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Author:
+ * Stephane Raimbault <stephane.raimbault at windriver.com> 
+ */
+
+#ifndef UGLMESA_H
+#define UGLMESA_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define UGL_MESA_MAJOR_VERSION 4
+#define UGL_MESA_MINOR_VERSION 0
+
+#include <GL/gl.h>
+#include <ugl/ugl.h>
+
+/*
+ * Values for display mode of uglMesaCreateContext ()
+ */
+
+/*
+ * With these mask values, it's possible to test double buffer mode
+ * with UGL_MESA_DOUBLE mask
+ *
+ * SINGLE  0000 0001
+ * DOUBLE  0000 0110
+ * -  SOFT 0000 0010
+ * -  HARD 0000 0100
+ * WINDML  0001 0000
+ *
+ * 
+ */
+#define UGL_MESA_SINGLE            0x01
+#define UGL_MESA_DOUBLE            0x06
+#define UGL_MESA_DOUBLE_SOFTWARE   0x02
+#define UGL_MESA_DOUBLE_HARDWARE   0x04
+    
+#define UGL_MESA_WINDML_EXCLUSIVE  0x10
+
+#define UGL_MESA_FULLSCREEN_WIDTH  0x0
+#define UGL_MESA_FULLSCREEN_HEIGHT 0x0
+
+/*
+ * uglMesaPixelStore() parameters:
+ */
+    
+#define UGL_MESA_ROW_LENGTH	   0x20
+#define UGL_MESA_Y_UP              0x21
+
+/* 
+ * Accepted by uglMesaGetIntegerv:
+ */
+
+#define UGL_MESA_LEFT_X		        0x01
+#define UGL_MESA_TOP_Y		        0x02    
+#define UGL_MESA_WIDTH		        0x03
+#define UGL_MESA_HEIGHT		        0x04
+#define UGL_MESA_DISPLAY_WIDTH          0x05
+#define UGL_MESA_DISPLAY_HEIGHT         0x06
+#define UGL_MESA_COLOR_FORMAT	        0x07
+#define UGL_MESA_COLOR_MODEL            0x08
+#define UGL_MESA_PIXEL_FORMAT           0x09
+#define UGL_MESA_TYPE		        0x0A
+#define UGL_MESA_RGB		        0x0B
+#define UGL_MESA_COLOR_INDEXED          0x0C
+#define UGL_MESA_SINGLE_BUFFER          0x0D
+#define UGL_MESA_DOUBLE_BUFFER          0x0E
+#define UGL_MESA_DOUBLE_BUFFER_SOFTWARE 0x0F
+#define UGL_MESA_DOUBLE_BUFFER_HARDWARE 0x10
+    
+/*
+ * typedefs
+ */
+
+typedef struct uglMesaContext * UGL_MESA_CONTEXT;
+    
+UGL_MESA_CONTEXT uglMesaCreateNewContext (GLenum mode,
+					  UGL_MESA_CONTEXT share_list);
+
+UGL_MESA_CONTEXT  uglMesaCreateNewContextExt (GLenum mode,
+					      GLint depth_bits,
+					      GLint stencil_bits,
+					      GLint accum_red_bits,
+					      GLint accum_green_bits,
+					      GLint accum_blue_bits,
+					      GLint accum_alpha_bits,
+					      UGL_MESA_CONTEXT share_list);
+
+GLboolean uglMesaMakeCurrentContext (UGL_MESA_CONTEXT umc,
+				     GLsizei left, GLsizei top,
+				     GLsizei width, GLsizei height);
+
+GLboolean uglMesaMoveWindow (GLsizei dx, GLsizei dy);
+
+GLboolean uglMesaMoveToWindow (GLsizei left, GLsizei top);
+
+GLboolean uglMesaResizeWindow (GLsizei dw, GLsizei dh);
+
+GLboolean uglMesaResizeToWindow (GLsizei width, GLsizei height);
+
+void uglMesaDestroyContext (void);
+
+UGL_MESA_CONTEXT uglMesaGetCurrentContext (void);
+
+void uglMesaSwapBuffers (void);
+
+void uglMesaPixelStore (GLint pname, GLint value);
+
+void uglMesaGetIntegerv (GLint pname, GLint *value);
+
+GLboolean uglMesaGetDepthBuffer (GLint *width, GLint *height,
+				 GLint *bytesPerValue, void **buffer);
+
+GLboolean uglMesaGetColorBuffer (GLint *width, GLint *height,
+				 GLint *format, void **buffer);
+
+GLboolean uglMesaSetColor (GLubyte index, GLfloat red,
+			   GLfloat green, GLfloat blue);
+  
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/src/terralib/drivers/GL/vms_x_fix.h b/src/terralib/drivers/GL/vms_x_fix.h
new file mode 100644
index 0000000..7f1a7ef
--- /dev/null
+++ b/src/terralib/drivers/GL/vms_x_fix.h
@@ -0,0 +1,880 @@
+/***************************************************************************
+ *                                                                         *
+ * Repair definitions of Xlib when compileing with /name=(as_is) on VMS    *
+ *                                                                         *
+ * Author : Jouk Jansen (joukj at hrem.stm.tudelft.nl)                        *
+ *                                                                         *
+ * Last revision : 22 August 2000                                          *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef VMS_X_FIX
+#define VMS_X_FIX
+
+#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE 
+#define XAllocClassHint XALLOCCLASSHINT
+#define XAllocColor XALLOCCOLOR
+#define XAllocColorCells XALLOCCOLORCELLS
+#define XAllocSizeHints XALLOCSIZEHINTS
+#define XAllocWMHints XALLOCWMHINTS
+#define XAutoRepeatOff XAUTOREPEATOFF
+#define XAutoRepeatOn XAUTOREPEATON
+#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET
+#define XBell XBELL
+#define XBitmapPad XBITMAPPAD
+#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB
+#define XChangeGC XCHANGEGC
+#define XChangeProperty XCHANGEPROPERTY
+#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES
+#define XCheckIfEvent XCHECKIFEVENT
+#define XCheckMaskEvent XCHECKMASKEVENT
+#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT
+#define XCheckWindowEvent XCHECKWINDOWEVENT
+#define XClearArea XCLEARAREA
+#define XClearWindow XCLEARWINDOW
+#define XClipBox XCLIPBOX
+#define XCloseDisplay XCLOSEDISPLAY
+#define XCloseIM XCLOSEIM
+#define XConfigureWindow XCONFIGUREWINDOW
+#define XConvertSelection XCONVERTSELECTION
+#define XCopyArea XCOPYAREA
+#define XCopyGC XCOPYGC
+#define XCopyPlane XCOPYPLANE
+#define XCreateBitmapFromData XCREATEBITMAPFROMDATA
+#define XCreateColormap XCREATECOLORMAP
+#define XCreateFontCursor XCREATEFONTCURSOR
+#define XCreateFontSet XCREATEFONTSET
+#define XCreateGC XCREATEGC
+#define XCreateIC XCREATEIC
+#define XCreateImage XCREATEIMAGE
+#define XCreatePixmap XCREATEPIXMAP
+#define XCreatePixmapCursor XCREATEPIXMAPCURSOR
+#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA
+#define XCreateRegion XCREATEREGION
+#define XCreateSimpleWindow XCREATESIMPLEWINDOW
+#define XCreateWindow XCREATEWINDOW
+#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY
+#define XDefineCursor XDEFINECURSOR
+#define XDeleteProperty XDELETEPROPERTY
+#define XDestroyIC XDESTROYIC
+#define XDestroyRegion XDESTROYREGION
+#define XDestroyWindow XDESTROYWINDOW
+#define XDisplayName XDISPLAYNAME
+#define XDisplayOfScreen XDISPLAYOFSCREEN
+#define XDrawArc XDRAWARC
+#define XDrawImageString XDRAWIMAGESTRING
+#define XDrawImageString16 XDRAWIMAGESTRING16
+#define XDrawLine XDRAWLINE
+#define XDrawLines XDRAWLINES
+#define XDrawPoint XDRAWPOINT
+#define XDrawPoints XDRAWPOINTS
+#define XDrawRectangle XDRAWRECTANGLE
+#define XDrawSegments XDRAWSEGMENTS
+#define XDrawString XDRAWSTRING
+#define XDrawString16 XDRAWSTRING16
+#define XEmptyRegion XEMPTYREGION
+#define XEqualRegion XEQUALREGION
+#define XEventsQueued XEVENTSQUEUED
+#define XExtentsOfFontSet XEXTENTSOFFONTSET
+#define XFillArc XFILLARC
+#define XFillPolygon XFILLPOLYGON
+#define XFillRectangle XFILLRECTANGLE
+#define XFillRectangles XFILLRECTANGLES
+#define XFilterEvent XFILTEREVENT
+#define XFlush XFLUSH
+#define XFontsOfFontSet XFONTSOFFONTSET
+#define XFree XFREE
+#define XFreeColormap XFREECOLORMAP
+#define XFreeColors XFREECOLORS
+#define XFreeCursor XFREECURSOR
+#define XFreeFont XFREEFONT
+#define XFreeFontInfo XFREEFONTINFO
+#define XFreeFontNames XFREEFONTNAMES
+#define XFreeFontSet XFREEFONTSET
+#define XFreeGC XFREEGC
+#define XFreeModifiermap XFREEMODIFIERMAP
+#define XFreePixmap XFREEPIXMAP
+#define XFreeStringList XFREESTRINGLIST
+#define XGetAtomName XGETATOMNAME
+#define XGetDefault XGETDEFAULT
+#define XGetErrorDatabaseText XGETERRORDATABASETEXT
+#define XGetErrorText XGETERRORTEXT
+#define XGetFontProperty XGETFONTPROPERTY
+#define XGetGCValues XGETGCVALUES
+#define XGetGeometry XGETGEOMETRY
+#define XGetICValues XGETICVALUES
+#define XGetIMValues XGETIMVALUES
+#define XGetImage XGETIMAGE
+#define XGetKeyboardControl XGETKEYBOARDCONTROL
+#define XGetModifierMapping XGETMODIFIERMAPPING
+#define XGetMotionEvents XGETMOTIONEVENTS
+#define XGetNormalHints XGETNORMALHINTS
+#define XGetSelectionOwner XGETSELECTIONOWNER
+#define XGetSubImage XGETSUBIMAGE
+#define XGetVisualInfo XGETVISUALINFO
+#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS
+#define XGetWMHints XGETWMHINTS
+#define XGetWMName XGETWMNAME
+#define XGetWMNormalHints XGETWMNORMALHINTS
+#define XGetWindowAttributes XGETWINDOWATTRIBUTES
+#define XGetWindowProperty XGETWINDOWPROPERTY
+#define XGrabKeyboard XGRABKEYBOARD
+#define XGrabPointer XGRABPOINTER
+#define XGrabServer XGRABSERVER
+#define XHeightOfScreen XHEIGHTOFSCREEN
+#define XIfEvent XIFEVENT
+#define XInternAtom XINTERNATOM
+#define XIntersectRegion XINTERSECTREGION
+#define XKeycodeToKeysym XKEYCODETOKEYSYM
+#define XKeysymToKeycode XKEYSYMTOKEYCODE
+#define XKeysymToString XKEYSYMTOSTRING
+#define XListFonts XLISTFONTS
+#define XListFontsWithInfo XLISTFONTSWITHINFO
+#define XListPixmapFormats XLISTPIXMAPFORMATS
+#define XListProperties XLISTPROPERTIES
+#define XLoadQueryFont XLOADQUERYFONT
+#define XLookupString XLOOKUPSTRING
+#define XLowerWindow XLOWERWINDOW
+#define XMapRaised XMAPRAISED
+#define XMapWindow XMAPWINDOW
+#define XMatchVisualInfo XMATCHVISUALINFO
+#define XMoveResizeWindow XMOVERESIZEWINDOW
+#define XMoveWindow XMOVEWINDOW
+#define XNextEvent XNEXTEVENT
+#define XOffsetRegion XOFFSETREGION
+#define XOpenDisplay XOPENDISPLAY
+#define XOpenIM XOPENIM
+#define XParseColor XPARSECOLOR
+#define XParseGeometry XPARSEGEOMETRY
+#define XPeekEvent XPEEKEVENT
+#define XPending XPENDING
+#define XPointInRegion XPOINTINREGION
+#define XPolygonRegion XPOLYGONREGION
+#define XPutBackEvent XPUTBACKEVENT
+#define XPutImage XPUTIMAGE
+#define XQueryColor XQUERYCOLOR
+#define XQueryColors XQUERYCOLORS
+#define XQueryExtension XQUERYEXTENSION
+#define XQueryPointer XQUERYPOINTER
+#define XQueryTree XQUERYTREE
+#define XRaiseWindow XRAISEWINDOW
+#define XReconfigureWMWindow XRECONFIGUREWMWINDOW
+#define XRectInRegion XRECTINREGION
+#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING
+#define XReparentWindow XREPARENTWINDOW
+#define XResizeWindow XRESIZEWINDOW
+#define XRestackWindows XRESTACKWINDOWS
+#define XRootWindowOfScreen XROOTWINDOWOFSCREEN
+#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN
+#define XSelectAsyncEvent XSELECTASYNCEVENT
+#define XSelectAsyncInput XSELECTASYNCINPUT
+#define XSelectInput XSELECTINPUT
+#define XSendEvent XSENDEVENT
+#define XServerVendor XSERVERVENDOR
+#define XSetBackground XSETBACKGROUND
+#define XSetClassHint XSETCLASSHINT
+#define XSetClipMask XSETCLIPMASK
+#define XSetClipOrigin XSETCLIPORIGIN
+#define XSetClipRectangles XSETCLIPRECTANGLES
+#define XSetCloseDownMode XSETCLOSEDOWNMODE
+#define XSetCommand XSETCOMMAND
+#define XSetDashes XSETDASHES
+#define XSetErrorHandler XSETERRORHANDLER
+#define XSetFillStyle XSETFILLSTYLE
+#define XSetFont XSETFONT
+#define XSetForeground XSETFOREGROUND
+#define XSetFunction XSETFUNCTION
+#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES
+#define XSetICFocus XSETICFOCUS
+#define XSetICValues XSETICVALUES
+#define XSetIOErrorHandler XSETIOERRORHANDLER
+#define XSetInputFocus XSETINPUTFOCUS
+#define XSetLineAttributes XSETLINEATTRIBUTES
+#define XSetLocaleModifiers XSETLOCALEMODIFIERS
+#define XSetNormalHints XSETNORMALHINTS
+#define XSetRegion XSETREGION
+#define XSetSelectionOwner XSETSELECTIONOWNER
+#define XSetStipple XSETSTIPPLE
+#define XSetSubwindowMode XSETSUBWINDOWMODE
+#define XSetTSOrigin XSETTSORIGIN
+#define XSetTile XSETTILE
+#define XSetTransientForHint XSETTRANSIENTFORHINT
+#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS
+#define XSetWMHints XSETWMHINTS
+#define XSetWMIconName XSETWMICONNAME
+#define XSetWMName XSETWMNAME
+#define XSetWMNormalHints XSETWMNORMALHINTS
+#define XSetWMProperties XSETWMPROPERTIES
+#define XSetWMProtocols XSETWMPROTOCOLS
+#define XSetWindowBackground XSETWINDOWBACKGROUND
+#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP
+#define XSetWindowColormap XSETWINDOWCOLORMAP
+#define XShapeCombineMask XSHAPECOMBINEMASK
+#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES
+#define XShapeGetRectangles XSHAPEGETRECTANGLES
+#define XShrinkRegion XSHRINKREGION
+#define XStoreColor XSTORECOLOR
+#define XStoreColors XSTORECOLORS
+#define XStoreName XSTORENAME
+#define XStringToKeysym XSTRINGTOKEYSYM
+#define XSubtractRegion XSUBTRACTREGION
+#define XSupportsLocale XSUPPORTSLOCALE
+#define XSync XSYNC
+#define XSynchronize XSYNCHRONIZE
+#define XTextExtents XTEXTEXTENTS
+#define XTextExtents16 XTEXTEXTENTS16
+#define XTextWidth XTEXTWIDTH
+#define XTextWidth16 XTEXTWIDTH16
+#define XTranslateCoordinates XTRANSLATECOORDINATES
+#define XUndefineCursor XUNDEFINECURSOR
+#define XUngrabKeyboard XUNGRABKEYBOARD
+#define XUngrabPointer XUNGRABPOINTER
+#define XUngrabServer XUNGRABSERVER
+#define XUnionRectWithRegion XUNIONRECTWITHREGION
+#define XUnionRegion XUNIONREGION
+#define XUnmapWindow XUNMAPWINDOW
+#define _XUnregisterFilter _XUNREGISTERFILTER
+#define XUnsetICFocus XUNSETICFOCUS
+#define XVaCreateNestedList XVACREATENESTEDLIST
+#define XVisualIDFromVisual XVISUALIDFROMVISUAL
+#define XWidthOfScreen XWIDTHOFSCREEN
+#define XWindowEvent XWINDOWEVENT
+#define XWithdrawWindow XWITHDRAWWINDOW
+#define XXorRegion XXORREGION
+#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK
+#define XmAddProtocols XMADDPROTOCOLS
+#define XmChangeColor XMCHANGECOLOR
+#define XmClipboardCopy XMCLIPBOARDCOPY
+#define XmClipboardEndCopy XMCLIPBOARDENDCOPY
+#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH
+#define XmClipboardLock XMCLIPBOARDLOCK
+#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE
+#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY
+#define XmClipboardUnlock XMCLIPBOARDUNLOCK
+#define XmCreateArrowButton XMCREATEARROWBUTTON
+#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET
+#define XmCreateCascadeButton XMCREATECASCADEBUTTON
+#define XmCreateDialogShell XMCREATEDIALOGSHELL
+#define XmCreateDragIcon XMCREATEDRAGICON
+#define XmCreateDrawingArea XMCREATEDRAWINGAREA
+#define XmCreateDrawnButton XMCREATEDRAWNBUTTON
+#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX
+#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG
+#define XmCreateForm XMCREATEFORM
+#define XmCreateFormDialog XMCREATEFORMDIALOG
+#define XmCreateFrame XMCREATEFRAME
+#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG
+#define XmCreateLabelGadget XMCREATELABELGADGET
+#define XmCreateMainWindow XMCREATEMAINWINDOW
+#define XmCreateMenuBar XMCREATEMENUBAR
+#define XmCreateMessageBox XMCREATEMESSAGEBOX
+#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG
+#define XmCreateOptionMenu XMCREATEOPTIONMENU
+#define XmCreatePanedWindow XMCREATEPANEDWINDOW
+#define XmCreatePopupMenu XMCREATEPOPUPMENU
+#define XmCreatePromptDialog XMCREATEPROMPTDIALOG
+#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU
+#define XmCreatePushButton XMCREATEPUSHBUTTON
+#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET
+#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG
+#define XmCreateRadioBox XMCREATERADIOBOX
+#define XmCreateRowColumn XMCREATEROWCOLUMN
+#define XmCreateScale XMCREATESCALE
+#define XmCreateScrollBar XMCREATESCROLLBAR
+#define XmCreateScrolledList XMCREATESCROLLEDLIST
+#define XmCreateScrolledText XMCREATESCROLLEDTEXT
+#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW
+#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG
+#define XmCreateSeparator XMCREATESEPARATOR
+#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET
+#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG
+#define XmCreateText XMCREATETEXT
+#define XmCreateTextField XMCREATETEXTFIELD
+#define XmCreateToggleButton XMCREATETOGGLEBUTTON
+#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET
+#define XmDragStart XMDRAGSTART
+#define XmDropSiteRegister XMDROPSITEREGISTER
+#define XmDropSiteUnregister XMDROPSITEUNREGISTER
+#define XmDropSiteUpdate XMDROPSITEUPDATE
+#define XmDropTransferStart XMDROPTRANSFERSTART
+#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD
+#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH
+#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY
+#define XmFontListCopy XMFONTLISTCOPY
+#define XmFontListCreate XMFONTLISTCREATE
+#define XmFontListEntryCreate XMFONTLISTENTRYCREATE
+#define XmFontListEntryFree XMFONTLISTENTRYFREE
+#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT
+#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG
+#define XmFontListEntryLoad XMFONTLISTENTRYLOAD
+#define XmFontListFree XMFONTLISTFREE
+#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT
+#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT
+#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT
+#define XmFontListNextEntry XMFONTLISTNEXTENTRY
+#define XmGetColors XMGETCOLORS
+#define XmGetFocusWidget XMGETFOCUSWIDGET
+#define XmGetMenuCursor XMGETMENUCURSOR
+#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH
+#define XmGetTearOffControl XMGETTEAROFFCONTROL
+#define XmGetXmDisplay XMGETXMDISPLAY
+#define XmImMbLookupString XMIMMBLOOKUPSTRING
+#define XmImRegister XMIMREGISTER
+#define XmImSetFocusValues XMIMSETFOCUSVALUES
+#define XmImSetValues XMIMSETVALUES
+#define XmImUnregister XMIMUNREGISTER
+#define XmImUnsetFocus XMIMUNSETFOCUS
+#define XmInternAtom XMINTERNATOM
+#define XmIsMotifWMRunning XMISMOTIFWMRUNNING
+#define XmListAddItem XMLISTADDITEM
+#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED
+#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED
+#define XmListDeleteAllItems XMLISTDELETEALLITEMS
+#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS
+#define XmListDeletePos XMLISTDELETEPOS
+#define XmListDeselectAllItems XMLISTDESELECTALLITEMS
+#define XmListDeselectPos XMLISTDESELECTPOS
+#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS
+#define XmListGetMatchPos XMLISTGETMATCHPOS
+#define XmListGetSelectedPos XMLISTGETSELECTEDPOS
+#define XmListPosSelected XMLISTPOSSELECTED
+#define XmListSelectItem XMLISTSELECTITEM
+#define XmListSelectPos XMLISTSELECTPOS
+#define XmListSetBottomPos XMLISTSETBOTTOMPOS
+#define XmListSetItem XMLISTSETITEM
+#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS
+#define XmListSetPos XMLISTSETPOS
+#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS
+#define XmMenuPosition XMMENUPOSITION
+#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD
+#define XmOptionButtonGadget XMOPTIONBUTTONGADGET
+#define XmOptionLabelGadget XMOPTIONLABELGADGET
+#define XmProcessTraversal XMPROCESSTRAVERSAL
+#define XmQmotif XMQMOTIF
+#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK
+#define XmRepTypeGetId XMREPTYPEGETID
+#define XmRepTypeGetRecord XMREPTYPEGETRECORD
+#define XmRepTypeRegister XMREPTYPEREGISTER
+#define XmRepTypeValidValue XMREPTYPEVALIDVALUE
+#define XmScrollBarSetValues XMSCROLLBARSETVALUES
+#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS
+#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD
+#define XmStringByteCompare XMSTRINGBYTECOMPARE
+#define XmStringCompare XMSTRINGCOMPARE
+#define XmStringConcat XMSTRINGCONCAT
+#define XmStringCopy XMSTRINGCOPY
+#define XmStringCreate XMSTRINGCREATE
+#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED
+#define XmStringCreateLtoR XMSTRINGCREATELTOR
+#define XmStringCreateSimple XMSTRINGCREATESIMPLE
+#define XmStringDraw XMSTRINGDRAW
+#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE
+#define XmStringExtent XMSTRINGEXTENT
+#define XmStringFree XMSTRINGFREE
+#define XmStringFreeContext XMSTRINGFREECONTEXT
+#define XmStringGetLtoR XMSTRINGGETLTOR
+#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT
+#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT
+#define XmStringInitContext XMSTRINGINITCONTEXT
+#define XmStringLength XMSTRINGLENGTH
+#define XmStringLtoRCreate XMSTRINGLTORCREATE
+#define XmStringNConcat XMSTRINGNCONCAT
+#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE
+#define XmStringWidth XMSTRINGWIDTH
+#define XmTextClearSelection XMTEXTCLEARSELECTION
+#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE
+#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION
+#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION
+#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION
+#define XmTextFieldGetString XMTEXTFIELDGETSTRING
+#define XmTextFieldInsert XMTEXTFIELDINSERT
+#define XmTextFieldRemove XMTEXTFIELDREMOVE
+#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION
+#define XmTextFieldSetString XMTEXTFIELDSETSTRING
+#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION
+#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION
+#define XmTextGetLastPosition XMTEXTGETLASTPOSITION
+#define XmTextGetMaxLength XMTEXTGETMAXLENGTH
+#define XmTextGetSelection XMTEXTGETSELECTION
+#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION
+#define XmTextGetString XMTEXTGETSTRING
+#define XmTextInsert XMTEXTINSERT
+#define XmTextRemove XMTEXTREMOVE
+#define XmTextReplace XMTEXTREPLACE
+#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION
+#define XmTextSetHighlight XMTEXTSETHIGHLIGHT
+#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION
+#define XmTextSetSelection XMTEXTSETSELECTION
+#define XmTextSetString XMTEXTSETSTRING
+#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE
+#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE
+#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE
+#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE
+#define XmUpdateDisplay XMUPDATEDISPLAY
+#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX
+#define XmbDrawString XMBDRAWSTRING
+#define XmbLookupString XMBLOOKUPSTRING
+#define XmbResetIC XMBRESETIC
+#define XmbSetWMProperties XMBSETWMPROPERTIES
+#define XmbTextEscapement XMBTEXTESCAPEMENT
+#define XmbTextExtents XMBTEXTEXTENTS
+#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY
+#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST
+#define XmuClientWindow XMUCLIENTWINDOW
+#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE
+#define XrmGetDatabase XRMGETDATABASE
+#define XrmGetResource XRMGETRESOURCE
+#define XrmPutStringResource XRMPUTSTRINGRESOURCE
+#define XrmQuarkToString XRMQUARKTOSTRING
+#define XrmStringToQuark XRMSTRINGTOQUARK
+#define XtAddCallback XTADDCALLBACK
+#define XtAddCallbacks XTADDCALLBACKS
+#define XtAddEventHandler XTADDEVENTHANDLER
+#define XtAddGrab XTADDGRAB
+#define XtAllocateGC XTALLOCATEGC
+#define XtAppAddActions XTAPPADDACTIONS
+#define XtAppAddInput XTAPPADDINPUT
+#define XtAppAddTimeOut XTAPPADDTIMEOUT
+#define XtAppCreateShell XTAPPCREATESHELL
+#define XtAppInitialize XTAPPINITIALIZE
+#define XtAppNextEvent XTAPPNEXTEVENT
+#define XtAppPeekEvent XTAPPPEEKEVENT
+#define XtAppPending XTAPPPENDING
+#define XtAppProcessEvent XTAPPPROCESSEVENT
+#define XtAppSetErrorHandler XTAPPSETERRORHANDLER
+#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES
+#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER
+#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER
+#define XtAppWarning XTAPPWARNING
+#define XtCallActionProc XTCALLACTIONPROC
+#define XtCallCallbackList XTCALLCALLBACKLIST
+#define XtCallCallbacks XTCALLCALLBACKS
+#define XtConfigureWidget XTCONFIGUREWIDGET
+#define XtConvertAndStore XTCONVERTANDSTORE
+#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT
+#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET
+#define XtCreatePopupShell XTCREATEPOPUPSHELL
+#define XtCreateWidget XTCREATEWIDGET
+#define XtDatabase XTDATABASE
+#define XtDestroyWidget XTDESTROYWIDGET
+#define XtDisownSelection XTDISOWNSELECTION
+#define XtDispatchEvent XTDISPATCHEVENT
+#define XtDisplayOfObject XTDISPLAYOFOBJECT
+#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING
+#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT
+#define XtAppAddWorkProc XTAPPADDWORKPROC
+#define XtRemoveWorkProc XTREMOVEWORKPROC
+#define XtFree XTFREE
+#define XtGetActionKeysym XTGETACTIONKEYSYM
+#define XtGetActionList XTGETACTIONLIST
+#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS
+#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES
+#define XtGetGC XTGETGC
+#define XtGetMultiClickTime XTGETMULTICLICKTIME
+#define XtGetSelectionValue XTGETSELECTIONVALUE
+#define XtGetSelectionValues XTGETSELECTIONVALUES
+#define XtGetSubresources XTGETSUBRESOURCES
+#define XtGetValues XTGETVALUES
+#define XtGrabKeyboard XTGRABKEYBOARD
+#define XtGrabPointer XTGRABPOINTER
+#define XtHasCallbacks XTHASCALLBACKS
+#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS
+#define XtInsertEventHandler XTINSERTEVENTHANDLER
+#define XtIsManaged XTISMANAGED
+#define XtIsObject XTISOBJECT
+#define XtIsSensitive XTISSENSITIVE
+#define XtIsSubclass XTISSUBCLASS
+#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED
+#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST
+#define XtMakeResizeRequest XTMAKERESIZEREQUEST
+#define XtMalloc XTMALLOC
+#define XtManageChild XTMANAGECHILD
+#define XtManageChildren XTMANAGECHILDREN
+#define XtMergeArgLists XTMERGEARGLISTS
+#define XtMoveWidget XTMOVEWIDGET
+#define XtName XTNAME
+#define XtNameToWidget XTNAMETOWIDGET
+#define XtOpenDisplay XTOPENDISPLAY
+#define XtOverrideTranslations XTOVERRIDETRANSLATIONS
+#define XtOwnSelection XTOWNSELECTION
+#define XtParseTranslationTable XTPARSETRANSLATIONTABLE
+#define XtPopdown XTPOPDOWN
+#define XtPopup XTPOPUP
+#define XtQueryGeometry XTQUERYGEOMETRY
+#define XtRealizeWidget XTREALIZEWIDGET
+#define XtRealloc XTREALLOC
+#define XtReleaseGC XTRELEASEGC
+#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS
+#define XtRemoveCallback XTREMOVECALLBACK
+#define XtRemoveEventHandler XTREMOVEEVENTHANDLER
+#define XtRemoveGrab XTREMOVEGRAB
+#define XtRemoveInput XTREMOVEINPUT
+#define XtRemoveTimeOut XTREMOVETIMEOUT
+#define XtResizeWidget XTRESIZEWIDGET
+#define XtResolvePathname XTRESOLVEPATHNAME
+#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS
+#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED
+#define XtSetSensitive XTSETSENSITIVE
+#define XtSetTypeConverter XTSETTYPECONVERTER
+#define XtSetValues XTSETVALUES
+#define XtShellStrings XTSHELLSTRINGS
+#define XtStrings XTSTRINGS
+#define XtToolkitInitialize XTTOOLKITINITIALIZE
+#define XtTranslateCoords XTTRANSLATECOORDS
+#define XtTranslateKeycode XTTRANSLATEKEYCODE
+#define XtUngrabKeyboard XTUNGRABKEYBOARD
+#define XtUngrabPointer XTUNGRABPOINTER
+#define XtUnmanageChild XTUNMANAGECHILD
+#define XtUnmanageChildren XTUNMANAGECHILDREN
+#define XtUnrealizeWidget XTUNREALIZEWIDGET
+#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET
+#define XtVaCreateWidget XTVACREATEWIDGET
+#define XtVaGetValues XTVAGETVALUES
+#define XtVaSetValues XTVASETVALUES
+#define XtWarning XTWARNING
+#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT
+#define XtWindowOfObject XTWINDOWOFOBJECT
+#define XtWindowToWidget XTWINDOWTOWIDGET
+#define XwcDrawString XWCDRAWSTRING
+#define XwcFreeStringList XWCFREESTRINGLIST
+#define XwcTextEscapement XWCTEXTESCAPEMENT
+#define XwcTextExtents XWCTEXTEXTENTS
+#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY
+#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST
+#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT
+#define _XmClearBorder _XMCLEARBORDER
+#define _XmConfigureObject _XMCONFIGUREOBJECT
+#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK
+#define _XmDrawArrow _XMDRAWARROW
+#define _XmDrawShadows _XMDRAWSHADOWS
+#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT
+#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS
+#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS
+#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR
+#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST
+#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON
+#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA
+#define _XmGrabKeyboard _XMGRABKEYBOARD
+#define _XmGrabPointer _XMGRABPOINTER
+#define _XmInheritClass _XMINHERITCLASS
+#define _XmInputInGadget _XMINPUTINGADGET
+#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST
+#define _XmMenuPopDown _XMMENUPOPDOWN
+#define _XmMoveObject _XMMOVEOBJECT
+#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED
+#define _XmOSBuildFileList _XMOSBUILDFILELIST
+#define _XmOSFileCompare _XMOSFILECOMPARE
+#define _XmOSFindPatternPart _XMOSFINDPATTERNPART
+#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC
+#define _XmPostPopupMenu _XMPOSTPOPUPMENU
+#define _XmPrimitiveEnter _XMPRIMITIVEENTER
+#define _XmPrimitiveLeave _XMPRIMITIVELEAVE
+#define _XmRedisplayGadgets _XMREDISPLAYGADGETS
+#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE
+#define _XmStringDraw _XMSTRINGDRAW
+#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT
+#define _XmStrings _XMSTRINGS
+#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS
+#define _XmToVerticalPixels _XMTOVERTICALPIXELS
+#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT
+#define _Xm_fastPtr _XM_FASTPTR
+#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG
+#define _XtInherit _XTINHERIT
+#define _XtInheritTranslations _XTINHERITTRANSLATIONS
+#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS
+#define compositeWidgetClass COMPOSITEWIDGETCLASS
+#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS
+#define shellWidgetClass SHELLWIDGETCLASS
+#define topLevelShellClassRec TOPLEVELSHELLCLASSREC
+#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS
+#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS
+#define vendorShellClassRec VENDORSHELLCLASSREC
+#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS
+#define wmShellWidgetClass WMSHELLWIDGETCLASS
+#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS
+#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC
+#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS
+#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS
+#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS
+#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS
+#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS
+#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS
+#define xmFormWidgetClass XMFORMWIDGETCLASS
+#define xmFrameWidgetClass XMFRAMEWIDGETCLASS
+#define xmGadgetClass XMGADGETCLASS
+#define xmLabelGadgetClass XMLABELGADGETCLASS
+#define xmLabelWidgetClass XMLABELWIDGETCLASS
+#define xmListWidgetClass XMLISTWIDGETCLASS
+#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS
+#define xmManagerClassRec XMMANAGERCLASSREC
+#define xmManagerWidgetClass XMMANAGERWIDGETCLASS
+#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS
+#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS
+#define xmPrimitiveClassRec XMPRIMITIVECLASSREC
+#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS
+#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC
+#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS
+#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS
+#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS
+#define xmSashWidgetClass XMSASHWIDGETCLASS
+#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS
+#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC
+#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS
+#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS
+#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS
+#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS
+#define xmTextWidgetClass XMTEXTWIDGETCLASS
+#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS
+#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS
+#define XtRegisterDrawable _XTREGISTERWINDOW
+#define XtUnregisterDrawable _XTUNREGISTERWINDOW
+#define XQueryFont XQUERYFONT
+#define XSetPlaneMask XSETPLANEMASK
+#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL
+#define XDestroySubwindows XDESTROYSUBWINDOWS
+#define XFreeDeviceList XFREEDEVICELIST
+#define XFreeDeviceState XFREEDEVICESTATE
+#define XGetExtensionVersion XGETEXTENSIONVERSION
+#define XGetRGBColormaps XGETRGBCOLORMAPS
+#define XIconifyWindow XICONIFYWINDOW
+#define XInstallColormap XINSTALLCOLORMAP
+#define XListInputDevices XLISTINPUTDEVICES
+#define XLookupKeysym XLOOKUPKEYSYM
+#define XOpenDevice XOPENDEVICE
+#define XQueryDeviceState XQUERYDEVICESTATE
+#define XSelectExtensionEvent XSELECTEXTENSIONEVENT
+#define XWarpPointer XWARPPOINTER
+#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP
+#define XAllocNamedColor XALLOCNAMEDCOLOR
+#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN
+#define XDefaultColormap XDEFAULTCOLORMAP
+#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN
+#define XDefaultDepth XDEFAULTDEPTH
+#define XDefaultScreen XDEFAULTSCREEN
+#define XDefaultVisual XDEFAULTVISUAL
+#define XSetIconName XSETICONNAME
+#define XtInitialize XTINITIALIZE
+#define XtMainLoop XTMAINLOOP
+#define DtSaverGetWindows DTSAVERGETWINDOWS
+#define XAddHosts XADDHOSTS
+#define XDisableAccessControl XDISABLEACCESSCONTROL
+#define XEnableAccessControl XENABLEACCESSCONTROL
+#define XFillArcs XFILLARCS
+#define XForceScreenSaver XFORCESCREENSAVER
+#define XGetScreenSaver XGETSCREENSAVER
+#define XListHosts XLISTHOSTS
+#define XReadBitmapFile XREADBITMAPFILE
+#define XRemoveHosts XREMOVEHOSTS
+#define XResetScreenSaver XRESETSCREENSAVER
+#define XResourceManagerString XRESOURCEMANAGERSTRING
+#define XSetScreenSaver XSETSCREENSAVER
+#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY
+#define XrmDestroyDatabase XRMDESTROYDATABASE
+#define XrmGetFileDatabase XRMGETFILEDATABASE
+#define XrmGetStringDatabase XRMGETSTRINGDATABASE
+#define XrmInitialize XRMINITIALIZE
+#define XrmMergeDatabases XRMMERGEDATABASES
+#define XrmParseCommand XRMPARSECOMMAND
+#define XrmPutLineResource XRMPUTLINERESOURCE
+#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE
+#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST
+#define XrmStringToQuark XRMSTRINGTOQUARK
+#define XmCreateLabel XMCREATELABEL
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void XtFree(char*);
+#ifdef __cplusplus
+}
+#endif
+
+#define pthread_attr_create PTHREAD_ATTR_CREATE
+#define pthread_attr_delete PTHREAD_ATTR_DELETE
+#define pthread_attr_destroy PTHREAD_ATTR_DESTROY
+#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP
+#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP
+#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED
+#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO
+#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED
+#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM
+#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE
+#define pthread_attr_init PTHREAD_ATTR_INIT
+#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP
+#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE
+#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP
+#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED
+#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO
+#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED
+#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM
+#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY
+#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE
+#define pthread_cancel PTHREAD_CANCEL
+#define pthread_cancel_e PTHREAD_CANCEL_E
+#define pthread_cond_broadcast PTHREAD_COND_BROADCAST
+#define pthread_cond_destroy PTHREAD_COND_DESTROY
+#define pthread_cond_init PTHREAD_COND_INIT
+#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP
+#define pthread_cond_signal PTHREAD_COND_SIGNAL
+#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP
+#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT
+#define pthread_cond_wait PTHREAD_COND_WAIT
+#define pthread_condattr_create PTHREAD_CONDATTR_CREATE
+#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE
+#define pthread_condattr_init PTHREAD_CONDATTR_INIT
+#define pthread_create PTHREAD_CREATE
+#define pthread_delay_np PTHREAD_DELAY_NP
+#define pthread_detach PTHREAD_DETACH
+#define pthread_equal PTHREAD_EQUAL
+#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP
+#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP
+#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP
+#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP
+#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP
+#define pthread_exit PTHREAD_EXIT
+#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP
+#define pthread_getprio PTHREAD_GETPRIO
+#define pthread_getschedparam PTHREAD_GETSCHEDPARAM
+#define pthread_getscheduler PTHREAD_GETSCHEDULER
+#define pthread_getspecific PTHREAD_GETSPECIFIC
+#define pthread_getunique_np PTHREAD_GETUNIQUE_NP
+#define pthread_join PTHREAD_JOIN
+#define pthread_join32 PTHREAD_JOIN32
+#define pthread_keycreate PTHREAD_KEYCREATE
+#define pthread_key_create PTHREAD_KEY_CREATE
+#define pthread_kill PTHREAD_KILL
+#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP
+#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY
+#define pthread_mutex_init PTHREAD_MUTEX_INIT
+#define pthread_mutex_lock PTHREAD_MUTEX_LOCK
+#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK
+#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK
+#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE
+#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE
+#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY
+#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP
+#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT
+#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP
+#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP
+#define pthread_once PTHREAD_ONCE
+#define pthread_resume_np PTHREAD_RESUME_NP
+#define pthread_self PTHREAD_SELF
+#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL
+#define pthread_setcancel PTHREAD_SETCANCEL
+#define pthread_setcancelstate PTHREAD_SETCANCELSTATE
+#define pthread_setprio PTHREAD_SETPRIO
+#define pthread_setschedparam PTHREAD_SETSCHEDPARAM
+#define pthread_setscheduler PTHREAD_SETSCHEDULER
+#define pthread_setspecific PTHREAD_SETSPECIFIC
+#define pthread_suspend_np PTHREAD_SUSPEND_NP
+#define pthread_testcancel PTHREAD_TESTCANCEL
+#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP
+#define pthread_yield PTHREAD_YIELD
+#define pthread_yield_np PTHREAD_YIELD_NP
+#define XDefaultRootWindow XDEFAULTROOTWINDOW
+#define XDisplayCells XDISPLAYCELLS
+#define XMaxRequestSize XMAXREQUESTSIZE
+#define XScreenOfDisplay XSCREENOFDISPLAY
+#define XSetFillRule XSETFILLRULE
+#define XmActivateProtocol XMACTIVATEPROTOCOL
+#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG
+#define XmCreateErrorDialog XMCREATEERRORDIALOG
+#define XmCreateWarningDialog XMCREATEWARNINGDIALOG
+#define XmCvtCTToXmString XMCVTCTTOXMSTRING
+#define XmDestroyPixmap XMDESTROYPIXMAP
+#define XmGetPixmap XMGETPIXMAP
+#define XmInstallImage XMINSTALLIMAGE
+#define XmListAddItems XMLISTADDITEMS
+#define XmListDeleteItem XMLISTDELETEITEM
+#define XmListItemExists XMLISTITEMEXISTS
+#define XmListItemPos XMLISTITEMPOS
+#define XmListReplaceItems XMLISTREPLACEITEMS
+#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS
+#define XmRemoveProtocols XMREMOVEPROTOCOLS
+#define XmRemoveTabGroup XMREMOVETABGROUP
+#define XmSetColorCalculation XMSETCOLORCALCULATION
+#define XmTextCopy XMTEXTCOPY
+#define XmTextCut XMTEXTCUT
+#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION
+#define XmTextFieldCopy XMTEXTFIELDCOPY
+#define XmTextFieldCut XMTEXTFIELDCUT
+#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH
+#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION
+#define XmTextFieldPaste XMTEXTFIELDPASTE
+#define XmTextFieldReplace XMTEXTFIELDREPLACE
+#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE
+#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT
+#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION
+#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH
+#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION
+#define XmTextGetEditable XMTEXTGETEDITABLE
+#define XmTextPaste XMTEXTPASTE
+#define XmTextPosToXY XMTEXTPOSTOXY
+#define XmTextSetEditable XMTEXTSETEDITABLE
+#define XmTextShowPosition XMTEXTSHOWPOSITION
+#define XmUninstallImage XMUNINSTALLIMAGE
+#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP
+#define XrmPutFileDatabase XRMPUTFILEDATABASE
+#define XtAddConverter XTADDCONVERTER
+#define XtError XTERROR
+#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL
+#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY
+#define pthread_key_delete PTHREAD_KEY_DELETE
+#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS
+#define xmScaleWidgetClass XMSCALEWIDGETCLASS
+#define XtDisplay XTDISPLAY
+#define XtScreen XTSCREEN
+#define XAllocIconSize XALLOCICONSIZE
+#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP
+#define XAllowEvents XALLOWEVENTS
+#define XBlackPixel XBLACKPIXEL
+#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE
+#define XDefaultGC XDEFAULTGC
+#define XDisplayHeight XDISPLAYHEIGHT
+#define XDisplayWidth XDISPLAYWIDTH
+#define XGetCommand XGETCOMMAND
+#define XGetIconSizes XGETICONSIZES
+#define XKillClient XKILLCLIENT
+#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS
+#define XRootWindow XROOTWINDOW
+#define XWMGeometry XWMGEOMETRY
+#define XWhitePixel XWHITEPIXEL
+#define XrmCombineDatabase XRMCOMBINEDATABASE
+#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE
+#define XSetStandardProperties XSETSTANDARDPROPERTIES
+#define XSetState XSETSTATE
+#define XDrawRectangles XDRAWRECTANGLES
+#define XGrabButton XGRABBUTTON
+#define XLookupColor XLOOKUPCOLOR
+#define XMapSubwindows XMAPSUBWINDOWS
+#define XRecolorCursor XRECOLORCURSOR
+#define XStoreBytes XSTOREBYTES
+#define XUngrabButton XUNGRABBUTTON
+#define XUninstallColormap XUNINSTALLCOLORMAP
+#define lib$wait LIB$WAIT
+#define lib$find_file LIB$FIND_FILE
+#define lib$find_file_end LIB$FIND_FILE_END
+#define lib$set_symbol LIB$SET_SYMBOL
+#define lib$sfree1_dd LIB$SFREE1_DD
+#define lib$spawn LIB$SPAWN
+#define sys$assign SYS$ASSIGN
+#define sys$crembx SYS$CREMBX
+#define sys$dassgn SYS$DASSGN
+#define sys$dclexh SYS$DCLEXH
+#define sys$getdviw SYS$GETDVIW
+#define sys$getsyiw SYS$GETSYIW
+#define sys$qio SYS$QIO
+#define sys$qiow SYS$QIOW
+#define sys$setef SYS$SETEF
+#define sys$synch SYS$SYNCH
+#define XDrawText XDRAWTEXT
+#define XtCloseDisplay XTCLOSEDISPLAY
+#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT
+#define lib$ediv LIB$EDIV
+#define lib$subx LIB$SUBX
+#define sys$bintim SYS$BINTIM
+#define sys$gettim SYS$GETTIM
+#define XFetchName XFETCHNAME
+#define XPeekIfEvent XPEEKIFEVENT
+#define XQueryKeymap XQUERYKEYMAP
+#endif
diff --git a/src/terralib/drivers/GL/wmesa.h b/src/terralib/drivers/GL/wmesa.h
new file mode 100644
index 0000000..f164e5d
--- /dev/null
+++ b/src/terralib/drivers/GL/wmesa.h
@@ -0,0 +1,141 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  3.0
+ * Copyright (C) 1995-1998  Brian Paul
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+
+/*
+ * Windows driver by: Mark E. Peterson (markp at ic.mankato.mn.us)
+ * Updated by Li Wei (liwei at aiar.xjtu.edu.cn)
+ *
+ *
+ ***************************************************************
+ *                     WMesa                                   *
+ *                     version 2.3                             *	
+ *                                                             *
+ *                        By                                   *
+ *                      Li Wei                                 *
+ *       Institute of Artificial Intelligence & Robotics       *
+ *       Xi'an Jiaotong University                             *
+ *       Email: liwei at aiar.xjtu.edu.cn                         * 
+ *       Web page: http://sun.aiar.xjtu.edu.cn                 *
+ *                                                             *
+ *	       July 7th, 1997				       *
+ ***************************************************************
+ */
+
+
+#ifndef WMESA_H
+#define WMESA_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "GL/gl.h"
+
+#if defined(_MSV_VER) && !defined(__GNUC__)
+#  pragma warning (disable:4273)
+#  pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
+#  pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
+#  pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
+#  pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */
+#  pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
+#  pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */
+#  if (MESA_WARNQUIET>1)
+#    pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
+#  endif
+#endif
+
+/*
+ * This is the WMesa context 'handle':
+ */
+typedef struct wmesa_context *WMesaContext;
+
+
+
+/*
+ * Create a new WMesaContext for rendering into a window.  You must
+ * have already created the window of correct visual type and with an
+ * appropriate colormap.
+ *
+ * Input:
+ *         hDC - Windows device or memory context
+ *         Pal  - Palette to use
+ *         rgb_flag - GL_TRUE = RGB mode,
+ *                    GL_FALSE = color index mode
+ *         db_flag - GL_TRUE = double-buffered,
+ *                   GL_FALSE = single buffered
+ *         alpha_flag - GL_TRUE = create software alpha buffer,
+ *                      GL_FALSE = no software alpha buffer
+ *
+ * Note: Indexed mode requires double buffering under Windows.
+ *
+ * Return:  a WMesa_context or NULL if error.
+ */
+extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
+                                       GLboolean rgb_flag,
+                                       GLboolean db_flag,
+                                       GLboolean alpha_flag);
+
+
+/*
+ * Destroy a rendering context as returned by WMesaCreateContext()
+ */
+extern void WMesaDestroyContext( WMesaContext ctx );
+
+
+
+/*
+ * Make the specified context the current one.
+ */
+extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc );
+
+
+/*
+ * Return a handle to the current context.
+ */
+extern WMesaContext WMesaGetCurrentContext( void );
+
+
+/*
+ * Swap the front and back buffers for the current context.  No action
+ * taken if the context is not double buffered.
+ */
+extern void WMesaSwapBuffers(HDC hdc);
+
+
+/*
+ * In indexed color mode we need to know when the palette changes.
+ */
+extern void WMesaPaletteChange(HPALETTE Pal);
+
+extern void WMesaMove(void);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
+
diff --git a/src/terralib/drivers/GL/xmesa.h b/src/terralib/drivers/GL/xmesa.h
new file mode 100644
index 0000000..7057f15
--- /dev/null
+++ b/src/terralib/drivers/GL/xmesa.h
@@ -0,0 +1,390 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  4.1
+ * 
+ * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/*
+ * Mesa/X11 interface.  This header file serves as the documentation for
+ * the Mesa/X11 interface functions.
+ *
+ * Note: this interface isn't intended for user programs.  It's primarily
+ * just for implementing the pseudo-GLX interface.
+ */
+
+
+/* Sample Usage:
+
+In addition to the usual X calls to select a visual, create a colormap
+and create a window, you must do the following to use the X/Mesa interface:
+
+1. Call XMesaCreateVisual() to make an XMesaVisual from an XVisualInfo.
+
+2. Call XMesaCreateContext() to create an X/Mesa rendering context, given
+   the XMesaVisual.
+
+3. Call XMesaCreateWindowBuffer() to create an XMesaBuffer from an X window
+   and XMesaVisual.
+
+4. Call XMesaMakeCurrent() to bind the XMesaBuffer to an XMesaContext and
+   to make the context the current one.
+
+5. Make gl* calls to render your graphics.
+
+6. Use XMesaSwapBuffers() when double buffering to swap front/back buffers.
+
+7. Before the X window is destroyed, call XMesaDestroyBuffer().
+
+8. Before exiting, call XMesaDestroyVisual and XMesaDestroyContext.
+
+*/
+
+
+
+
+#ifndef XMESA_H
+#define XMESA_H
+
+#ifdef __VMS
+#include <GL/vms_x_fix.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef XFree86Server
+#include "xmesa_xf86.h"
+#else
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include "xmesa_x.h"
+#endif
+#include "GL/gl.h"
+
+#ifdef AMIWIN
+#include <pragmas/xlib_pragmas.h>
+extern struct Library *XLibBase;
+#endif
+
+
+#define XMESA_MAJOR_VERSION 6
+#define XMESA_MINOR_VERSION 3
+
+
+
+/*
+ * Values passed to XMesaGetString:
+ */
+#define XMESA_VERSION 1
+#define XMESA_EXTENSIONS 2
+
+
+/*
+ * Values passed to XMesaSetFXmode:
+ */
+#define XMESA_FX_WINDOW       1
+#define XMESA_FX_FULLSCREEN   2
+
+
+
+typedef struct xmesa_context *XMesaContext;
+
+typedef struct xmesa_visual *XMesaVisual;
+
+typedef struct xmesa_buffer *XMesaBuffer;
+
+
+
+/*
+ * Create a new X/Mesa visual.
+ * Input:  display - X11 display
+ *         visinfo - an XVisualInfo pointer
+ *         rgb_flag - GL_TRUE = RGB mode,
+ *                    GL_FALSE = color index mode
+ *         alpha_flag - alpha buffer requested?
+ *         db_flag - GL_TRUE = double-buffered,
+ *                   GL_FALSE = single buffered
+ *         stereo_flag - stereo visual?
+ *         ximage_flag - GL_TRUE = use an XImage for back buffer,
+ *                       GL_FALSE = use an off-screen pixmap for back buffer
+ *         depth_size - requested bits/depth values, or zero
+ *         stencil_size - requested bits/stencil values, or zero
+ *         accum_red_size - requested bits/red accum values, or zero
+ *         accum_green_size - requested bits/green accum values, or zero
+ *         accum_blue_size - requested bits/blue accum values, or zero
+ *         accum_alpha_size - requested bits/alpha accum values, or zero
+ *         num_samples - number of samples/pixel if multisampling, or zero
+ *         level - visual level, usually 0
+ *         visualCaveat - ala the GLX extension, usually GLX_NONE_EXT
+ * Return;  a new XMesaVisual or 0 if error.
+ */
+extern XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
+                                      XMesaVisualInfo visinfo,
+                                      GLboolean rgb_flag,
+                                      GLboolean alpha_flag,
+                                      GLboolean db_flag,
+                                      GLboolean stereo_flag,
+                                      GLboolean ximage_flag,
+                                      GLint depth_size,
+                                      GLint stencil_size,
+                                      GLint accum_red_size,
+                                      GLint accum_green_size,
+                                      GLint accum_blue_size,
+                                      GLint accum_alpha_size,
+                                      GLint num_samples,
+                                      GLint level,
+                                      GLint visualCaveat );
+
+/*
+ * Destroy an XMesaVisual, but not the associated XVisualInfo.
+ */
+extern void XMesaDestroyVisual( XMesaVisual v );
+
+
+
+/*
+ * Create a new XMesaContext for rendering into an X11 window.
+ *
+ * Input:  visual - an XMesaVisual
+ *         share_list - another XMesaContext with which to share display
+ *                      lists or NULL if no sharing is wanted.
+ * Return:  an XMesaContext or NULL if error.
+ */
+extern XMesaContext XMesaCreateContext( XMesaVisual v,
+					XMesaContext share_list );
+
+
+/*
+ * Destroy a rendering context as returned by XMesaCreateContext()
+ */
+extern void XMesaDestroyContext( XMesaContext c );
+
+
+/*
+ * Create an XMesaBuffer from an X window.
+ */
+extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, XMesaWindow w );
+
+
+/*
+ * Create an XMesaBuffer from an X pixmap.
+ */
+extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
+					    XMesaPixmap p,
+					    XMesaColormap cmap );
+
+
+/*
+ * Destroy an XMesaBuffer, but not the corresponding window or pixmap.
+ */
+extern void XMesaDestroyBuffer( XMesaBuffer b );
+
+
+/*
+ * Return the XMesaBuffer handle which corresponds to an X drawable, if any.
+ *
+ * New in Mesa 2.3.
+ */
+extern XMesaBuffer XMesaFindBuffer( XMesaDisplay *dpy,
+				    XMesaDrawable d );
+
+
+
+/*
+ * Bind a buffer to a context and make the context the current one.
+ */
+extern GLboolean XMesaMakeCurrent( XMesaContext c,
+				   XMesaBuffer b );
+
+
+/*
+ * Bind two buffers (read and draw) to a context and make the
+ * context the current one.
+ * New in Mesa 3.3
+ */
+extern GLboolean XMesaMakeCurrent2( XMesaContext c,
+                                    XMesaBuffer drawBuffer,
+                                    XMesaBuffer readBuffer );
+
+
+/*
+ * Unbind the current context from its buffer.
+ */
+extern GLboolean XMesaUnbindContext( XMesaContext c );
+
+
+/*
+ * Return a handle to the current context.
+ */
+extern XMesaContext XMesaGetCurrentContext( void );
+
+
+/*
+ * Return handle to the current (draw) buffer.
+ */
+extern XMesaBuffer XMesaGetCurrentBuffer( void );
+
+
+/*
+ * Return handle to the current read buffer.
+ * New in Mesa 3.3
+ */
+extern XMesaBuffer XMesaGetCurrentReadBuffer( void );
+
+
+/*
+ * Swap the front and back buffers for the given buffer.  No action is
+ * taken if the buffer is not double buffered.
+ */
+extern void XMesaSwapBuffers( XMesaBuffer b );
+
+
+/*
+ * Copy a sub-region of the back buffer to the front buffer.
+ *
+ * New in Mesa 2.6
+ */
+extern void XMesaCopySubBuffer( XMesaBuffer b,
+				int x,
+				int y,
+				int width,
+				int height );
+
+
+/*
+ * Return a pointer to the the Pixmap or XImage being used as the back
+ * color buffer of an XMesaBuffer.  This function is a way to get "under
+ * the hood" of X/Mesa so one can manipulate the back buffer directly.
+ * Input:  b - the XMesaBuffer
+ * Output:  pixmap - pointer to back buffer's Pixmap, or 0
+ *          ximage - pointer to back buffer's XImage, or NULL
+ * Return:  GL_TRUE = context is double buffered
+ *          GL_FALSE = context is single buffered
+ */
+extern GLboolean XMesaGetBackBuffer( XMesaBuffer b,
+				     XMesaPixmap *pixmap,
+				     XMesaImage **ximage );
+
+
+
+/*
+ * Return the depth buffer associated with an XMesaBuffer.
+ * Input:  b - the XMesa buffer handle
+ * Output:  width, height - size of buffer in pixels
+ *          bytesPerValue - bytes per depth value (2 or 4)
+ *          buffer - pointer to depth buffer values
+ * Return:  GL_TRUE or GL_FALSE to indicate success or failure.
+ *
+ * New in Mesa 2.4.
+ */
+extern GLboolean XMesaGetDepthBuffer( XMesaBuffer b,
+				      GLint *width,
+				      GLint *height,
+				      GLint *bytesPerValue,
+				      void **buffer );
+
+
+
+/*
+ * Flush/sync a context
+ */
+extern void XMesaFlush( XMesaContext c );
+
+
+
+/*
+ * Get an X/Mesa-specific string.
+ * Input:  name - either XMESA_VERSION or XMESA_EXTENSIONS
+ */
+extern const char *XMesaGetString( XMesaContext c, int name );
+
+
+
+/*
+ * Scan for XMesaBuffers whose window/pixmap has been destroyed, then free
+ * any memory used by that buffer.
+ *
+ * New in Mesa 2.3.
+ */
+extern void XMesaGarbageCollect( void );
+
+
+
+/*
+ * Return a dithered pixel value.
+ * Input:  c - XMesaContext
+ *         x, y - window coordinate
+ *         red, green, blue, alpha - color components in [0,1]
+ * Return:  pixel value
+ *
+ * New in Mesa 2.3.
+ */
+extern unsigned long XMesaDitherColor( XMesaContext xmesa,
+				       GLint x,
+				       GLint y,
+				       GLfloat red,
+				       GLfloat green,
+				       GLfloat blue,
+				       GLfloat alpha );
+
+
+
+/*
+ * 3Dfx Glide driver only!
+ * Set 3Dfx/Glide full-screen or window rendering mode.
+ * Input:  mode - either XMESA_FX_WINDOW (window rendering mode) or
+ *                XMESA_FX_FULLSCREEN (full-screen rendering mode)
+ * Return:  GL_TRUE if success
+ *          GL_FALSE if invalid mode or if not using 3Dfx driver
+ *
+ * New in Mesa 2.6.
+ */
+extern GLboolean XMesaSetFXmode( GLint mode );
+
+
+
+/*
+ * Reallocate the back/depth/stencil/accum/etc/ buffers associated with
+ * buffer <b> if its size has changed.
+ *
+ * New in Mesa 4.0.2
+ */
+extern void XMesaResizeBuffers( XMesaBuffer b );
+
+
+
+/*
+ * Create a pbuffer.
+ * New in Mesa 4.1
+ */
+extern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap,
+                                      unsigned int width, unsigned int height);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/src/terralib/drivers/GL/xmesa_x.h b/src/terralib/drivers/GL/xmesa_x.h
new file mode 100644
index 0000000..1631fa2
--- /dev/null
+++ b/src/terralib/drivers/GL/xmesa_x.h
@@ -0,0 +1,85 @@
+
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ *   Kevin E. Martin <kevin at precisioninsight.com>
+ *
+ * When we're building the XMesa driver for stand-alone Mesa we
+ * include this file when building the xm_*.c files.
+ * We need to define some types and macros differently when building
+ * in the Xserver vs. stand-alone Mesa.
+ */
+
+#ifndef _XMESA_X_H_
+#define _XMESA_X_H_
+
+typedef Display      XMesaDisplay;
+typedef Pixmap       XMesaPixmap;
+typedef Colormap     XMesaColormap;
+typedef Drawable     XMesaDrawable;
+typedef Window       XMesaWindow;
+typedef GC           XMesaGC;
+typedef XVisualInfo *XMesaVisualInfo;
+typedef XImage       XMesaImage;
+typedef XPoint       XMesaPoint;
+typedef XColor       XMesaColor;
+
+#define XMesaDestroyImage      XDestroyImage
+
+#define XMesaPutPixel          XPutPixel
+#define XMesaGetPixel          XGetPixel
+
+#define XMesaSetForeground     XSetForeground
+#define XMesaSetBackground     XSetBackground
+#define XMesaSetPlaneMask      XSetPlaneMask
+#define XMesaSetFunction       XSetFunction
+#define XMesaSetFillStyle      XSetFillStyle
+#define XMesaSetTile           XSetTile
+
+#define XMesaDrawPoint         XDrawPoint
+#define XMesaDrawPoints        XDrawPoints
+#define XMesaDrawLine          XDrawLine
+#define XMesaFillRectangle     XFillRectangle
+#define XMesaPutImage          XPutImage
+#define XMesaCopyArea          XCopyArea
+
+#define XMesaCreatePixmap      XCreatePixmap
+#define XMesaFreePixmap        XFreePixmap
+#define XMesaFreeGC            XFreeGC
+
+#define GET_COLORMAP_SIZE(__v)  __v->visinfo->colormap_size
+#define GET_REDMASK(__v)        __v->mesa_visual.redMask
+#define GET_GREENMASK(__v)      __v->mesa_visual.greenMask
+#define GET_BLUEMASK(__v)       __v->mesa_visual.blueMask
+#define GET_VISUAL_DEPTH(__v)   __v->visinfo->depth
+#define GET_BLACK_PIXEL(__v)    BlackPixel(__v->display, __v->mesa_visual.screen)
+#define CHECK_BYTE_ORDER(__v)   host_byte_order()==ImageByteOrder(__v->display)
+#define CHECK_FOR_HPCR(__v)     XInternAtom(__v->display, "_HP_RGB_SMOOTH_MAP_LIST", True)
+
+#endif
diff --git a/src/terralib/drivers/GL/xmesa_xf86.h b/src/terralib/drivers/GL/xmesa_xf86.h
new file mode 100644
index 0000000..c81e9a3
--- /dev/null
+++ b/src/terralib/drivers/GL/xmesa_xf86.h
@@ -0,0 +1,165 @@
+
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ *   Kevin E. Martin <kevin at precisioninsight.com>
+ *
+ * When we're building the XMesa driver for use in the X server (as the
+ * indirect render) we include this file when building the xm_*.c files.
+ * We need to define some types and macros differently when building
+ * in the Xserver vs. stand-alone Mesa.
+ */
+
+#ifndef _XMESA_XF86_H_
+#define _XMESA_XF86_H_
+
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+
+typedef struct _XMesaImageRec XMesaImage;
+
+typedef ScreenRec   XMesaDisplay;
+typedef PixmapPtr   XMesaPixmap;
+typedef ColormapPtr XMesaColormap;
+typedef DrawablePtr XMesaDrawable;
+typedef WindowPtr   XMesaWindow;
+typedef GCPtr       XMesaGC;
+typedef VisualPtr   XMesaVisualInfo;
+typedef DDXPointRec XMesaPoint;
+typedef xColorItem  XMesaColor;
+
+#define XMesaSetGeneric(__d,__gc,__val,__mask) \
+do { \
+    CARD32 __v[1]; \
+    (void) __d; \
+    __v[0] = __val; \
+    dixChangeGC(NullClient, __gc, __mask, __v, NULL); \
+} while (0)
+
+#define XMesaSetGenericPtr(__d,__gc,__pval,__mask) \
+do { \
+    ChangeGCVal __v[1]; \
+    (void) __d; \
+    __v[0].ptr = __pval; \
+    dixChangeGC(NullClient, __gc, __mask, NULL, __v); \
+} while (0)
+
+#define XMesaSetForeground(d,gc,v) XMesaSetGeneric(d,gc,v,GCForeground)
+#define XMesaSetBackground(d,gc,v) XMesaSetGeneric(d,gc,v,GCBackground)
+#define XMesaSetPlaneMask(d,gc,v)  XMesaSetGeneric(d,gc,v,GCPlaneMask)
+#define XMesaSetFunction(d,gc,v)   XMesaSetGeneric(d,gc,v,GCFunction)
+#define XMesaSetFillStyle(d,gc,v)  XMesaSetGeneric(d,gc,v,GCFillStyle)
+
+#define XMesaSetTile(d,gc,v)       XMesaSetGenericPtr(d,gc,v,GCTile)
+
+#define XMesaDrawPoint(__d,__b,__gc,__x,__y) \
+do { \
+    XMesaPoint __p[1]; \
+    (void) __d; \
+    __p[0].x = __x; \
+    __p[0].y = __y; \
+    ValidateGC(__b, __gc); \
+    (*gc->ops->PolyPoint)(__b, __gc, CoordModeOrigin, 1, __p); \
+} while (0)
+
+#define XMesaDrawPoints(__d,__b,__gc,__p,__n,__m) \
+do { \
+    (void) __d; \
+    ValidateGC(__b, __gc); \
+    (*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \
+} while (0)
+
+#define XMesaDrawLine(__d, __b, __gc, __x0, __y0, __x1, __y1) \
+do { \
+    XMesaPoint __p[2]; \
+    (void) __d; \
+    __p[0].x = __x0; \
+    __p[0].y = __y0; \
+    __p[1].x = __x1; \
+    __p[1].y = __y1; \
+    ValidateGC(__b, __gc); \
+    (*gc->ops->PolyLines)(__b, __gc, CoordModeOrigin, 2, __p); \
+} while (0)
+
+#define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \
+do { \
+    xRectangle __r[1]; \
+    (void) __d; \
+    ValidateGC((DrawablePtr)__b, __gc); \
+    __r[0].x = __x; \
+    __r[0].y = __y; \
+    __r[0].width = __w; \
+    __r[0].height = __h; \
+    (*__gc->ops->PolyFillRect)((DrawablePtr)__b, __gc, 1, __r); \
+} while (0)
+
+#define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \
+do { \
+    /* Assumes: Images are always in ZPixmap format */ \
+    (void) __d; \
+    if (__sx || __sy) /* The non-trivial case */ \
+	XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \
+    ValidateGC(__b, __gc); \
+    (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \
+			   __x, __y, __w, __h, 0, ZPixmap, \
+			   ((XMesaImage *)(__i))->data); \
+} while (0)
+
+#define XMesaCopyArea(__d,__sb,__db,__gc,__sx,__sy,__w,__h,__x,__y) \
+do { \
+    (void) __d; \
+    ValidateGC(__db, __gc); \
+    (*__gc->ops->CopyArea)((DrawablePtr)__sb, __db, __gc, \
+			   __sx, __sy, __w, __h, __x, __y); \
+} while (0)
+
+
+/* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */
+#define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \
+    (*__d->CreatePixmap)(__d, __w, __h, __depth)
+
+#define XMesaFreePixmap(__d,__b) \
+    (*__d->DestroyPixmap)(__b)
+
+#define XMesaFreeGC(__d,__gc) \
+do { \
+    (void) __d; \
+    FreeScratchGC(__gc); \
+} while (0)
+
+#define GET_COLORMAP_SIZE(__v)  __v->ColormapEntries
+#define GET_REDMASK(__v)        __v->mesa_visual.redMask
+#define GET_GREENMASK(__v)      __v->mesa_visual.greenMask
+#define GET_BLUEMASK(__v)       __v->mesa_visual.blueMask
+#define GET_VISUAL_DEPTH(__v)   __v->nplanes
+#define GET_BLACK_PIXEL(__v)    __v->display->blackPixel
+#define CHECK_BYTE_ORDER(__v)   GL_TRUE
+#define CHECK_FOR_HPCR(__v)     GL_FALSE
+
+#endif
diff --git a/src/terralib/drivers/GTM/TeGTM.cpp b/src/terralib/drivers/GTM/TeGTM.cpp
new file mode 100644
index 0000000..609bc10
--- /dev/null
+++ b/src/terralib/drivers/GTM/TeGTM.cpp
@@ -0,0 +1,2026 @@
+#include <TeGTM.h>
+#include <TeException.h>
+#include <TeImportRaster.h>
+#include <TeDecoderJPEG.h>
+#include <TeInitRasterDecoders.h>
+
+#include <stdio.h>
+#include <time.h>
+
+//Classe principal, eh ela que le de fato o arquivo
+TeGTM::TeGTM(FILE* file)
+{
+	this->file_ = file;
+
+	//Treta muito louca !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+	char *icon_number[] = {"", "Airport", "Ball Park", "Bank", "Bar", "Boat Ramp", "Campground", "Car",
+	"City (Large)", "City (Medium)", "City (Small)", "Dam", "Danger Area",
+	"Drinking Water", "Fishing Area", "Gas Station", "Glider Area", "Golf Course",
+	"Heliport", "Hotel", "Animals", "Information", "Man Overboard", "Marina",
+	"Mine", "Medical Facility", "Parachute Area", "Park", "Parking Area",
+	"Picnic Area", "Private Field", "Residence", "Restaurant", "Restroom",
+	"Scenic Area", "School", "Seaplane Base", "Shipwreck", "Shopping Center",
+	"Short Tower", "Policy Station", "Ski Resort", "Soft Field", "Swimming Area",
+	"Tall Tower", "Telephone", "Tracback Point", "Ultralight Area", "Waypoint",
+	"Boat", "Exit", "Flag", "Duck", "Buoy", "Back Track", "Beach", "Bridge",
+	"Building", "Car Repair", "Cemetery", "Church", "Civil", "Convenience Store",
+	"Crossing", "Fast Food", "Forest", "Ghost Town", "Levee", "Military",
+	"Oil Field", "Post Office", "Rv Park", "Scales", "Summit", "Toll Booth",
+	"Trail Head", "Truck Stop", "Tunnel", "Highway", "Gate", "Fall", "Fence",
+	"Mata-Burro", "Fitness Center", "Movie Theater", "Live Theater", "Zoo", "Horn",
+	"Bowling", "Car Rental", "City (Capitol)", "Controlled Area", "Stadium",
+	"Museum", "Amusement Park", "Skull", "Department Store", "Pharmacy", "Pizza",
+	"Diver Down Flag 1", "Light", "Pin", "", "Pigsty", "Tree", "Bamboo",
+	"Banana Plant", "Arrow-Down", "Bifurcation", "Cavern", "River", "Rock",
+	"Arrow-Up", "Trunk", "Soccer Field", "Sporting Court", "Flag, Green", "Trench",
+	"Ship-Yellow", "Green Sign", "Swamp", "Lake", "Stop!",
+	"Fishing Hot Spot Facility", "Speed Reducer", "Stairway", "Cactus", "Ship-Red",
+	"Letter - S", "Letter - D", "Letter - N",
+	"Crossing", "Cross", "Flag, Red", "Curve1", "Curve2", "Curve3", "Curve4",
+	"Letter - W", "Letter - L", "Letter - R", "Radio Beacon", "Road Sign",
+	"Geocache", "Geocache Found", "Traffic Light", "Bus Station", "Train Station",
+	"School", "Mile Marker", "Conservation Area", "Waypoint", "Box", "Aerial",
+	"Auto Repair", "Boat", "Exit Ramp", "Fixed Nav Aid", "Floating Buoy", "Garden",
+	"Fish Farm", "Lighthouse", "Truck Service", "Resort", "Scuba", "Shooting",
+	"Sight Seeing", "Sounding", "Winery", "Navaid, Amber", "Navaid, Black",
+	"Navaid, Blue", "Navaid, Green", "Navaid, Green/Red", "Navaid, Green/White",
+	"Navaid, Orange", "Navaid, Red", "Navaid, Red/Green", "Navaid, Red/White",
+	"Navaid, Violet", "Navaid, White", "Navaid, White/Green", "Navaid, White/Red",
+	"Buoy, White", "Dot, White", "Red Square", "Red Diamond", "Green Square",
+	"Green Diamond", "Restricted Area", "Navaid (unlit)", "Dot (Small)", "Libraries", "Waypoint", "Waypoint1",
+	"Waypoint2", "Mark (1)", "Mark (2)", "Mark (3)", "Cross (Red)", "Store",
+	"Exclamation", "Flag (EUA)", "Flag (CAN)", "Flag (BRA)", "Man", "Animals",
+	"Deer Tracks", "Tree Stand", "Bridge", "Fence", "Intersection",
+	"Non Direct Beacon", "VHF Omni Range", "Vor/Tacan", "Vor-Dme",
+	"1st Approach Fix", "Localizer Outer", "Missed Appr. Pt", "Tacan",
+	"CheckPoint", NULL};
+
+	std::vector<char*> aux(icon_number, icon_number + sizeof(icon_number)/sizeof(char*));
+	icon_descr = aux;
+	//**************************************************************************************
+}
+
+TeGTM::~TeGTM()
+{
+	fclose(file_);
+	for(unsigned int i = 0; i < informationimages_.size(); i++)
+	{
+		delete informationimages_.at(i);
+	}
+	informationimages_.clear();
+	for(unsigned int i = 0; i < waypoints_.size(); i++)
+	{
+		delete waypoints_.at(i);
+	}
+	waypoints_.clear();
+	for(unsigned int i = 0; i < waypointsstyles_.size(); i++)
+	{
+		delete waypointsstyles_.at(i);
+	}
+	waypointsstyles_.clear();
+	for(unsigned int i = 0; i < tracklogs_.size(); i++)
+	{
+		delete tracklogs_.at(i);
+	}
+	tracklogs_.clear();
+	for(unsigned int i = 0; i < tracklogstyles_.size(); i++)
+	{
+		delete tracklogstyles_.at(i);
+	}
+	tracklogstyles_.clear();
+	for(unsigned int i = 0; i < routes_.size(); i++)
+	{
+		delete routes_.at(i);
+	}
+	routes_.clear();
+	/*for(unsigned int i = 0; i < layers_.size(); i++)
+	{
+		delete layers_.at(i);
+	}
+	layers_.clear();
+	for(unsigned int i = 0; i < usericons_.size(); i++)
+	{
+		delete usericons_.at(i);
+	}
+	usericons_.clear();*/
+}
+
+std::string TeGTM::getDate(long date)
+{
+	//Data a partir de um long passado
+	time_t data = date;
+	time_t origem;
+
+	//Criando um struct tm com a data base
+	time_t aux;
+	time(&aux);
+	struct tm *origemInfo = localtime(&aux);
+
+	//Subtracoes feitas pois o padrao no time.h
+	//eh o ano de 1900 e o mes fica no intervalo [0-11]
+	origemInfo->tm_year = 1989 - 1900;
+	origemInfo->tm_mon = 12 - 1;
+	origemInfo->tm_mday = 31;
+	origemInfo->tm_hour = 0;
+	origemInfo->tm_min = 0;
+	origemInfo->tm_sec = 0;
+
+	//Redefinindo o origemInfo para antender o padrao GTM
+	origem = mktime(origemInfo);
+
+	//Somando as datas
+	time_t result = data + origem;
+	struct tm *resultInfo = localtime(&result);
+
+	//retorna a data em string
+	char buffer [80];
+	strftime (buffer,80,"%c",resultInfo);
+	return buffer;
+}
+
+void TeGTM::readGTM()
+{
+	//Lendo cabecalho
+	header_.readGTMHeader(file_);
+	//Lendo Grid e Datum
+	griddatum_.readGTMGridDatum(file_);
+	//Lendo images information
+	for(unsigned int i = 0; i < header_.getN_maps(); i++)
+	{
+		TeGTMInformationImages* pt = new TeGTMInformationImages();
+		pt->readGTMInformationImages(file_);
+		informationimages_.push_back(pt);
+	}
+	//Lendo waypoints
+	for(unsigned int i = 0; i < header_.getNwpts(); i++)
+	{
+		TeGTMWaypoints* pt = new TeGTMWaypoints();
+		pt->readGTMWaypoints(file_);
+		waypoints_.push_back(pt);
+	}
+	//Lendo waypoints styles
+	for(unsigned int i = 0; i < header_.getNwptstyles(); i++)
+	{
+		TeGTMWaypointsStyles* pt = new TeGTMWaypointsStyles();
+		pt->readGTMWaypointsStyles(file_);
+		waypointsstyles_.push_back(pt);
+	}
+	//Lendo tracklogs
+	for(unsigned int i = 0; i < header_.getNtracks(); i++)
+	{
+		TeGTMTrackLogs* pt = new TeGTMTrackLogs();
+		pt->readGTMTrackLogs(file_);
+		tracklogs_.push_back(pt);
+	}
+	//Lendo tracklog styles
+	for(unsigned int i = 0; i < header_.getN_tk(); i++)
+	{
+		TeGTMTrackLogStyles* pt = new TeGTMTrackLogStyles();
+		pt->readGTMTrackLogStyles(file_);
+		tracklogstyles_.push_back(pt);
+	}
+	//Lendo routes
+	for(unsigned int i = 0; i < header_.getNrtes(); i++)
+	{
+		TeGTMRoutes* pt = new TeGTMRoutes();
+		pt->readGTMRoutes(file_);
+		routes_.push_back(pt);
+	}
+	//Lendo user layers (Nao implementado ainda na versao 211, mas jah esta pronto aqui)
+	/*for(unsigned int i = 0; i < header_.getLayers(); i++)
+	{
+		TeGTMLayers* pt = new TeGTMLayers();
+		pt->readGTMLayers(file_);
+		layers_.push_back(pt);
+	}*/
+	//Lendo user icons (Nao implementado ainda na versao 211, mas jah esta pronto aqui)
+	/*for(unsigned int i = 0; i < header_.getIconnum(); i++)
+	{
+		TeGTMUserIcons* pt = new TeGTMUserIcons();
+		pt->readGTMUserIcons(file_);
+		usericons_.push_back(pt);
+	}*/
+	//Lendo as imagens anexadas no final do arquivo
+	//e guardando elas no atributo blob_ da classe TeGTMInformationImages
+	for(unsigned int i = 0; i < header_.getN_maps(); i++)
+	{
+		char* blob;
+		long len = (informationimages_[i])->getImagelen();
+		blob = new char[len+1];
+		fread(blob, (size_t)len, 1, file_);
+		blob[len] = '\0';
+		(informationimages_[i])->setBlob(blob);
+	}
+}
+
+void TeGTM::waypointAttributeList(TeAttributeList& attList)
+{
+	std::vector<std::string> names;
+
+	names.push_back("NOME");
+	names.push_back("COMENTARIOS");
+	names.push_back("ENTIDADE");
+	names.push_back("DISPLAY");
+	names.push_back("DATA");
+	names.push_back("ROTACAO");
+	names.push_back("ALTITUDE");
+	names.push_back("LAYER");
+
+	for( unsigned int i = 0; i< names.size();i++)
+    {
+		TeAttribute attribute;
+		attribute.rep_.type_ = TeSTRING;
+		attribute.rep_.numChar_ = 255;		
+		attribute.rep_.name_ = names[i];
+		attribute.rep_.isPrimaryKey_ = false;
+		attList.push_back(attribute);
+	}
+}
+
+void TeGTM::tracklogAttributeList(TeAttributeList& attList)
+{
+	std::vector<std::string> names;
+
+	names.push_back("DATA");
+	names.push_back("TIPO");
+	names.push_back("ALTITUDE");
+	
+	for( unsigned int i = 0; i< names.size();i++)
+    {
+		TeAttribute attribute;
+		attribute.rep_.type_ = TeSTRING;
+		attribute.rep_.numChar_ = 255;		
+		attribute.rep_.name_ = names[i];
+		attribute.rep_.isPrimaryKey_ = false;
+		attList.push_back(attribute);
+	}
+}
+
+void TeGTM::routeAttributeList(TeAttributeList& attList)
+{
+	std::vector<std::string> names;
+
+	names.push_back("NOME");
+	names.push_back("COMENTARIOS");
+	names.push_back("ROTA");
+	names.push_back("ENTIDADE");
+	names.push_back("DISPLAY");
+	names.push_back("TIPO");
+	names.push_back("DATA");
+	names.push_back("ROTACAO");
+	names.push_back("ALTITUDE");
+	names.push_back("LAYER");
+
+	for( unsigned int i = 0; i< names.size();i++)
+    {
+		TeAttribute attribute;
+		attribute.rep_.type_ = TeSTRING;
+		attribute.rep_.numChar_ = 255;		
+		attribute.rep_.name_ = names[i];
+		attribute.rep_.isPrimaryKey_ = false;
+		attList.push_back(attribute);
+	}
+}
+
+bool TeGTM::importWaypoints(TeLayer* layer, string attrTableName,string objectIdAtt,int unsigned chunkSize )
+{
+	double oldPrec = TePrecision::instance().precision();
+
+	if(layer)
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
+	}
+	else
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(0));
+	}
+
+	if (!layer->database()->beginTransaction())
+		return false;
+
+	int linkCol = -1;
+    unsigned int j = 0;
+
+	//Recuperando lista de atributos
+	TeAttributeList attList;
+	waypointAttributeList(attList);
+
+	bool attributeTableCreated = createAttributeTable(layer, attList, attrTableName, objectIdAtt, oldPrec, linkCol);
+	if(attributeTableCreated == false)
+		return false;
+
+	string objid, value;
+	TePointSet points;
+	TeTableRow row;
+	TeAttrTableVector attTables;
+
+	int nEntities = header_.getNwpts();
+    if(TeProgress::instance())
+    {
+        TeProgress::instance()->reset();
+    }
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nEntities);
+		TeProgress::instance()->setProgress(j+1);
+	}
+
+	for (j = 0; j < nEntities; j++)
+	{
+		//Preenchendo a linha da tabela de atributos
+		row.clear();
+		row.push_back(waypoints_[j]->getName());
+		row.push_back(waypoints_[j]->getWname());
+		row.push_back(icon_descr[waypoints_[j]->getIco()]);
+		row.push_back(string(1,waypoints_[j]->getDspl()));
+		//row.push_back(Te2String(waypoints_[j]->getWdate()));
+		row.push_back(getDate(waypoints_[j]->getWdate()));
+		row.push_back(Te2String(waypoints_[j]->getWrot()));
+		row.push_back(Te2String(waypoints_[j]->getWalt()));
+		row.push_back(Te2String(waypoints_[j]->getWlayer()));
+
+		//Criando indice automatico
+		row.push_back(Te2String(j));
+
+		if (row[linkCol].empty())
+			row[linkCol] = "te_nulo";
+		objid = row[linkCol];
+
+		//Pegando a tabela de atributos criada pelo metodo createAttributeTable
+		layer->getAttrTables(attTables, TeAttrStatic);
+		attTables[0].add(row);
+
+		//Criando o TePoint
+		TePoint point(waypoints_[j]->getLongitude(), waypoints_[j]->getLatitude());
+		point.objectId(objid);
+		points.add(point);
+
+		if ((j%chunkSize) == 0)
+		{
+			if(!layer->addPoints(points))
+				return false;
+			points.clear();
+			if(!layer->saveAttributeTable(attTables[0]))
+				return false;
+			attTables[0].clear();
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+			else
+				TeProgress::instance()->setProgress(j+1);
+			}
+		}
+	}
+	if (points.size() > 0)
+	{
+		if(!layer->addPoints(points))
+			return false;
+		points.clear();
+	}
+	if (attTables[0].size() > 0)
+	{
+		if(!layer->saveAttributeTable(attTables[0]))
+			return false;
+		attTables[0].clear();
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->cancel();
+
+	if (!layer->database()->commitTransaction())
+		return false;
+
+	// Create the spatial indexes
+	int rep = layer->geomRep();
+	if (rep & TePOINTS)
+	{
+		if(!layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box()))
+			return false;
+		if(!layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE))
+			return false;
+	}
+
+	TePrecision::instance().setPrecision(oldPrec);
+
+	return true;
+}
+
+bool TeGTM::importTracklogs(TeLayer* layer, string attrTableName,string objectIdAtt,int unsigned chunkSize)
+{
+	double oldPrec = TePrecision::instance().precision();
+
+	if(layer)
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
+	}
+	else
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(0));
+	}
+
+	if (!layer->database()->beginTransaction())
+		return false;
+
+	int linkCol = -1;
+    unsigned int j = 0;
+
+	//Recuperando lista de atributos
+	TeAttributeList attList;
+	tracklogAttributeList(attList);
+
+	bool attributeTableCreated = createAttributeTable(layer, attList, attrTableName, objectIdAtt, oldPrec, linkCol);
+	if(attributeTableCreated == false)
+		return false;
+
+	string objid, value;
+	TePointSet points;
+	TeTableRow row;
+	TeAttrTableVector attTables;
+
+	int nEntities = header_.getNtracks();
+    if(TeProgress::instance())
+    {
+        TeProgress::instance()->reset();
+    }
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nEntities);
+		TeProgress::instance()->setProgress(j+1);
+	}
+
+	for (j = 0; j < nEntities; j++)
+	{
+		//Preenchendo a linha da tabela de atributos
+		row.clear();
+		row.push_back(getDate(tracklogs_[j]->getTdate()));
+		row.push_back(string(1,tracklogs_[j]->getTnum()));
+		row.push_back(Te2String(tracklogs_[j]->getTalt()));
+
+		//Criando indice automatico
+		row.push_back(Te2String(j));
+
+		if (row[linkCol].empty())
+			row[linkCol] = "te_nulo";
+		objid = row[linkCol];
+
+		//Pegando a tabela de atributos criada pelo metodo createAttributeTable
+		layer->getAttrTables(attTables, TeAttrStatic);
+		attTables[0].add(row);
+
+		//Criando o TePoint
+		TePoint point(tracklogs_[j]->getLongitude(), tracklogs_[j]->getLatitude());
+		point.objectId(objid);
+		points.add(point);
+
+		if ((j%chunkSize) == 0)
+		{
+			if(!layer->addPoints(points))
+				return false;
+			points.clear();
+			if(!layer->saveAttributeTable(attTables[0]))
+				return false;
+			attTables[0].clear();
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+			else
+				TeProgress::instance()->setProgress(j+1);
+			}
+		}
+	}
+	if (points.size() > 0)
+	{
+		if(!layer->addPoints(points))
+			return false;
+		points.clear();
+	}
+	if (attTables[0].size() > 0)
+	{
+		if(!layer->saveAttributeTable(attTables[0]))
+			return false;
+		attTables[0].clear();
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->cancel();
+
+	if (!layer->database()->commitTransaction())
+		return false;
+
+	// Create the spatial indexes
+	int rep = layer->geomRep();
+	if (rep & TePOINTS)
+	{
+		if(!layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box()))
+			return false;
+		if(!layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE))
+			return false;
+	}
+
+	TePrecision::instance().setPrecision(oldPrec);
+
+	return true;
+}
+
+bool TeGTM::importTracklogs2(TeLayer* layer, string attrTableName,string objectIdAtt,int unsigned chunkSize)
+{
+	double oldPrec = TePrecision::instance().precision();
+
+	if(layer)
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
+	}
+	else
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(0));
+	}
+
+	if (!layer->database()->beginTransaction())
+		return false;
+
+	int linkCol = -1;
+    unsigned int j = 0;
+
+	//Recuperando lista de atributos
+	TeAttributeList attList;
+	TeAttribute attribute;
+	attribute.rep_.type_ = TeSTRING;
+	attribute.rep_.numChar_ = 255;		
+	attribute.rep_.name_ = "NOME";
+	attribute.rep_.isPrimaryKey_ = false;
+	attList.push_back(attribute);
+
+	bool attributeTableCreated = createAttributeTable(layer, attList, attrTableName, objectIdAtt, oldPrec, linkCol);
+	if(attributeTableCreated == false)
+		return false;
+
+	string objid, value;
+	TeLineSet lines;
+	TeTableRow row;
+	TeAttrTableVector attTables;
+
+	int nEntities = header_.getNtracks();
+    if(TeProgress::instance())
+    {
+        TeProgress::instance()->reset();
+    }
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nEntities);
+		TeProgress::instance()->setProgress(j+1);
+	}
+
+	//contador de tracklogs
+	int count = 0;
+	//tracklog lines
+	TeLine2D line = TeLine2D();
+	for (j = 0; j < nEntities; j++)
+	{
+		//Criando as linhas dos tracklogs*********************************************
+		TeCoord2D coord(tracklogs_[j]->getLongitude(), tracklogs_[j]->getLatitude());
+		int tnum = tracklogs_[j]->getTnum();
+		if((tnum == 1) || (j == nEntities - 1))
+		{
+			if(line.size() > 0)
+			{
+				//Preenchendo a linha da tabela de atributos
+				row.clear();
+				row.push_back(tracklogstyles_[count]->getTname());
+
+				//Criando indice automatico
+				row.push_back(Te2String(count));
+
+				if (row[linkCol].empty())
+					row[linkCol] = "te_nulo";
+				objid = row[linkCol];
+
+				//Pegando a tabela de atributos criada pelo metodo createAttributeTable
+				layer->getAttrTables(attTables, TeAttrStatic);
+				attTables[0].add(row);
+
+				line.objectId(objid);
+				lines.add(line);
+
+				if ((count%chunkSize) == 0)
+				{
+					if(!layer->addLines(lines))
+						return false;
+					lines.clear();
+					if(!layer->saveAttributeTable(attTables[0]))
+						return false;
+					attTables[0].clear();
+					if(TeProgress::instance())
+					{
+						if (TeProgress::instance()->wasCancelled())
+							break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+					}
+				}
+				count++;
+			}
+			line = TeLine2D();
+		}
+		line.add(coord);
+		//***********************************************************************************
+	}
+	if (lines.size() > 0)
+	{
+		if(!layer->addLines(lines))
+			return false;
+		lines.clear();
+	}
+	if (attTables[0].size() > 0)
+	{
+		if(!layer->saveAttributeTable(attTables[0]))
+			return false;
+		attTables[0].clear();
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->cancel();
+
+	if (!layer->database()->commitTransaction())
+		return false;
+
+	// Create the spatial indexes
+	int rep = layer->geomRep();
+	if (rep & TeLINES)
+	{
+		if(!layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box()))
+			return false;
+		if(!layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE))
+			return false;
+	}
+
+	TePrecision::instance().setPrecision(oldPrec);
+
+	return true;
+}
+
+bool TeGTM::importRoutes(TeLayer* layer, string attrTableName,string objectIdAtt,int unsigned chunkSize)
+{
+	double oldPrec = TePrecision::instance().precision();
+
+	if(layer)
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
+	}
+	else
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(0));
+	}
+
+	if (!layer->database()->beginTransaction())
+		return false;
+
+	int linkCol = -1;
+    unsigned int j = 0;
+
+	//Recuperando lista de atributos
+	TeAttributeList attList;
+	routeAttributeList(attList);
+
+	bool attributeTableCreated = createAttributeTable(layer, attList, attrTableName, objectIdAtt, oldPrec, linkCol);
+	if(attributeTableCreated == false)
+		return false;
+
+	string objid, value;
+	TePointSet points;
+	TeTableRow row;
+	TeAttrTableVector attTables;
+
+	int nEntities = header_.getNrtes();
+    if(TeProgress::instance())
+    {
+        TeProgress::instance()->reset();
+    }
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nEntities);
+		TeProgress::instance()->setProgress(j+1);
+	}
+
+	for (j = 0; j < nEntities; j++)
+	{
+		//Preenchendo a linha da tabela de atributos
+		row.clear();
+		row.push_back(routes_[j]->getWname());
+		row.push_back(routes_[j]->getWcomment());
+		row.push_back(routes_[j]->getRname());
+		row.push_back(icon_descr[routes_[j]->getIco()]);
+		row.push_back(string(1,routes_[j]->getDspl()));
+		row.push_back(string(1,routes_[j]->getTnum()));
+		row.push_back(getDate(routes_[j]->getTdate()));
+		row.push_back(Te2String(routes_[j]->getWrot()));
+		row.push_back(Te2String(routes_[j]->getWalt()));
+		row.push_back(Te2String(routes_[j]->getWlayer()));
+
+		//Criando indice automatico
+		row.push_back(Te2String(j));
+
+		if (row[linkCol].empty())
+			row[linkCol] = "te_nulo";
+		objid = row[linkCol];
+
+		//Pegando a tabela de atributos criada pelo metodo createAttributeTable
+		layer->getAttrTables(attTables, TeAttrStatic);
+		attTables[0].add(row);
+
+		//Criando o TePoint
+		TePoint point(routes_[j]->getLongitude(), routes_[j]->getLatitude());
+		point.objectId(objid);
+		points.add(point);
+
+		if ((j%chunkSize) == 0)
+		{
+			if(!layer->addPoints(points))
+				return false;
+			points.clear();
+			if(!layer->saveAttributeTable(attTables[0]))
+				return false;
+			attTables[0].clear();
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+			else
+				TeProgress::instance()->setProgress(j+1);
+			}
+		}
+	}
+	if (points.size() > 0)
+	{
+		if(!layer->addPoints(points))
+			return false;
+		points.clear();
+	}
+	if (attTables[0].size() > 0)
+	{
+		if(!layer->saveAttributeTable(attTables[0]))
+			return false;
+		attTables[0].clear();
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->cancel();
+
+	if (!layer->database()->commitTransaction())
+		return false;
+
+	// Create the spatial indexes
+	int rep = layer->geomRep();
+	if (rep & TePOINTS)
+	{
+		if(!layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box()))
+			return false;
+		if(!layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE))
+			return false;
+	}
+
+	TePrecision::instance().setPrecision(oldPrec);
+
+	return true;
+}
+
+bool TeGTM::importRoutes2(TeLayer* layer, string attrTableName,string objectIdAtt,int unsigned chunkSize)
+{
+	double oldPrec = TePrecision::instance().precision();
+
+	if(layer)
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
+	}
+	else
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(0));
+	}
+
+	if (!layer->database()->beginTransaction())
+		return false;
+
+	int linkCol = -1;
+    unsigned int j = 0;
+
+	//Recuperando lista de atributos
+	TeAttributeList attList;
+	TeAttribute attribute;
+	attribute.rep_.type_ = TeSTRING;
+	attribute.rep_.numChar_ = 255;		
+	attribute.rep_.name_ = "NOME";
+	attribute.rep_.isPrimaryKey_ = false;
+	attList.push_back(attribute);
+
+	bool attributeTableCreated = createAttributeTable(layer, attList, attrTableName, objectIdAtt, oldPrec, linkCol);
+	if(attributeTableCreated == false)
+		return false;
+
+	string objid, value;
+	TeLineSet lines;
+	TeTableRow row;
+	TeAttrTableVector attTables;
+
+	int nEntities = header_.getNrtes();
+    if(TeProgress::instance())
+    {
+        TeProgress::instance()->reset();
+    }
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nEntities);
+		TeProgress::instance()->setProgress(j+1);
+	}
+
+	//contador de routes
+	int count = 0;
+	//route lines
+	TeLine2D line = TeLine2D();
+	for (j = 0; j < nEntities; j++)
+	{
+		//Criando as linhas das rotas************************************************
+		TeCoord2D coord(routes_[j]->getLongitude(), routes_[j]->getLatitude());
+		int tnum = routes_[j]->getTnum();
+		if((tnum == 1) || (j == nEntities - 1))
+		{
+			if(line.size() > 0)
+			{
+				//Preenchendo a linha da tabela de atributos
+				row.clear();
+				row.push_back(routes_[j]->getRname());
+
+				//Criando indice automatico
+				row.push_back(Te2String(count));
+
+				if (row[linkCol].empty())
+					row[linkCol] = "te_nulo";
+				objid = row[linkCol];
+
+				//Pegando a tabela de atributos criada pelo metodo createAttributeTable
+				layer->getAttrTables(attTables, TeAttrStatic);
+				attTables[0].add(row);
+
+				line.objectId(objid);
+				lines.add(line);
+
+				if ((count%chunkSize) == 0)
+				{
+					if(!layer->addLines(lines))
+						return false;
+					lines.clear();
+					if(!layer->saveAttributeTable(attTables[0]))
+						return false;
+					attTables[0].clear();
+					if(TeProgress::instance())
+					{
+						if (TeProgress::instance()->wasCancelled())
+							break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+					}
+				}
+				count++;
+			}
+			line = TeLine2D();
+		}
+		line.add(coord);
+		//**************************************************************************************
+	}
+	if (lines.size() > 0)
+	{
+		if(!layer->addLines(lines))
+			return false;
+		lines.clear();
+	}
+	if (attTables[0].size() > 0)
+	{
+		if(!layer->saveAttributeTable(attTables[0]))
+			return false;
+		attTables[0].clear();
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->cancel();
+
+	if (!layer->database()->commitTransaction())
+		return false;
+
+	// Create the spatial indexes
+	int rep = layer->geomRep();
+	if (rep & TeLINES)
+	{
+		if(!layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box()))
+			return false;
+		if(!layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE))
+			return false;
+	}
+
+	TePrecision::instance().setPrecision(oldPrec);
+
+	return true;
+}
+
+int TeGTM::importImages(TeLayer* layer)
+{
+	int count = 0;
+	for(unsigned int i = 0; i < informationimages_.size(); i++)
+	{
+		//Criando a imagem temporariamente em arquivo
+		std::string nome = "./";
+		nome += informationimages_[i]->getName_map();
+		std::string base = TeGetExtension(nome.c_str());
+		if(base == "")
+			continue;
+		FILE* temp = fopen(nome.c_str(), "wb");
+		fwrite(informationimages_[i]->getBlob(),informationimages_[i]->getImagelen(),1,temp);
+		fclose(temp);
+
+		// Acess input image
+		TeInitRasterDecoders();
+		TeRaster image(nome.c_str());
+		if(image.init())
+		{
+			TeRasterParams& par = image.params();
+			par.boundingBoxLinesColumns(informationimages_[i]->getGposx(),informationimages_[i]->getGposy()-informationimages_[i]->getGheight(),
+				informationimages_[i]->getGposx()+informationimages_[i]->getGwidth(),informationimages_[i]->getGposy(),
+				par.nlines_, par.ncols_);
+			par.projection(getProjection());
+			if(!TeImportRaster(layer,&image,512,512,TeRasterParams::TeNoCompression,Te2String(i),255,true,TeRasterParams::TeNoExpansible))
+				continue;
+			count++;
+		}
+		//removendo o arquivo temporario
+		remove(nome.c_str());
+	}
+	return count;
+}
+
+bool TeGTM::createAttributeTable(TeLayer* layer, TeAttributeList attList, std::string attrTableName, std::string objectIdAtt, 
+								 double oldPrec, int& linkCol)
+{
+	unsigned int j = 0;
+	int count = 0;
+
+	// Como nao existem indices no GTM, vamos criar um padrao
+	objectIdAtt = "object_id_" + Te2String(layer->id());
+	string s2 = TeConvertToUpperCase(objectIdAtt);
+	while (true)
+	{
+		for (j = 0; j < attList.size(); j++)
+		{
+			string s0 = attList[j].rep_.name_;
+			string s1 = TeConvertToUpperCase(s0);
+			if ( s1 == s2)
+				break;
+		}
+		if (j < attList.size())
+		{
+			++count;
+			objectIdAtt = "object_id_" + Te2String(count);
+		}
+		else
+			break;
+	}
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.numChar_ = 16;
+	at.rep_.name_ = objectIdAtt;
+	at.rep_.isPrimaryKey_ = true;
+	attList.push_back(at);
+	linkCol = attList.size()-1;
+
+	TeTable attTable (attrTableName,attList,objectIdAtt,objectIdAtt,TeAttrStatic);
+	//Criando a tabela no banco
+	if (!layer->createAttributeTable(attTable))
+	{
+		layer->database()->rollbackTransaction();
+		TePrecision::instance().setPrecision(oldPrec);
+		return false;
+	}
+	return true;
+}
+
+void TeGTM::exportGTM(TeTheme *theme, std::string fileName, FILE* file)
+{
+	waypoints_.clear();
+	waypointsstyles_.clear();
+	tracklogs_.clear();
+	tracklogstyles_.clear();
+	//Capturando banco e tipo de representacao
+	TeDatabase *db = theme->layer()->database();
+	int rep = theme->layer()->geomRep();
+
+	//Convertendo o mbr do tema para projecao LatLong
+	TeProjection* proj = theme->layer()->projection();
+	TeBox box = theme->layer()->box();
+	TeBox mbr = TeBox();
+	if(proj->name() != "LatLong")
+	{
+		mbr.lowerLeft() = proj->PC2LL(box.lowerLeft());
+		mbr.upperRight() = proj->PC2LL(box.upperRight());
+	}
+	else
+	{
+		mbr = TeBox(box);
+	}
+
+	TePointSet pointSet;
+	TeLineSet lineSet;
+	//Populando os objetos GTM
+	std::string fontName = "Times New Roman";
+	std::string code = "TrackMaker";
+	std::string vazio = "";
+	if(rep & TePOINTS)
+	{
+		theme->layer()->getPoints(pointSet);
+		for(unsigned int i = 0; i < pointSet.size(); i++)
+		{
+			//Convertendo o pointSet do tema para projecao LatLong
+			TeCoord2D coord;
+			if(proj->name() != "LatLong")
+				coord = proj->PC2LL(pointSet[i].location());
+			else
+				coord = pointSet[i].location();
+			TeGTMWaypoints* pt = new TeGTMWaypoints();
+			pt->setLatitude(coord.y());
+			pt->setLongitude(coord.x());
+			pt->setDspl(1);
+			pt->setIco(48);
+			//*****************************
+			std::string valor = "         ";
+			char* nome = new char[10];
+			strcpy(nome, valor.c_str());
+			pt->setName(nome);
+			//*****************************
+			pt->setWalt(0.);
+			pt->setWdate(0.);
+			pt->setWlayer(0);
+			pt->setWname((char*)vazio.c_str());
+			pt->setWrot(0);
+			waypoints_.push_back(pt);
+		}
+			//Precisam ser gravado no minimo 4 estilos
+			//Estilo 1
+			TeGTMWaypointsStyles* pt1 = new TeGTMWaypointsStyles();
+			pt1->setAlignment(0);
+			pt1->setBackcolor(0);
+			pt1->setBackground(false);
+			pt1->setBorder(0);
+			pt1->setColor(0);
+			pt1->setDspl(0);
+			pt1->setFacename((char*)fontName.c_str());
+			pt1->setHeight(-11);
+			pt1->setItalic(0);
+			pt1->setScale1(0);
+			pt1->setStrikeout(0);
+			pt1->setunderline(0);
+			pt1->setWeight(400);
+			waypointsstyles_.push_back(pt1);
+			//Estilo 2
+			TeGTMWaypointsStyles* pt2 = new TeGTMWaypointsStyles();
+			pt2->setAlignment(0);
+			pt2->setBackcolor(0);
+			pt2->setBackground(false);
+			pt2->setBorder(0);
+			pt2->setColor(0);
+			pt2->setDspl(1);
+			pt2->setFacename((char*)fontName.c_str());
+			pt2->setHeight(-11);
+			pt2->setItalic(0);
+			pt2->setScale1(0);
+			pt2->setStrikeout(0);
+			pt2->setunderline(0);
+			pt2->setWeight(400);
+			waypointsstyles_.push_back(pt2);
+			//Estilo 3
+			TeGTMWaypointsStyles* pt3 = new TeGTMWaypointsStyles();
+			pt3->setAlignment(0);
+			pt3->setBackcolor(0);
+			pt3->setBackground(false);
+			pt3->setBorder(0);
+			pt3->setColor(0);
+			pt3->setDspl(2);
+			pt3->setFacename((char*)fontName.c_str());
+			pt3->setHeight(-11);
+			pt3->setItalic(0);
+			pt3->setScale1(0);
+			pt3->setStrikeout(0);
+			pt3->setunderline(0);
+			pt3->setWeight(400);
+			waypointsstyles_.push_back(pt3);
+			//Estilo 4
+			TeGTMWaypointsStyles* pt4 = new TeGTMWaypointsStyles();
+			pt4->setAlignment(1);
+			pt4->setBackcolor(65535);
+			pt4->setBackground(true);
+			pt4->setBorder(139);
+			pt4->setColor(0);
+			pt4->setDspl(3);
+			pt4->setFacename((char*)fontName.c_str());
+			pt4->setHeight(-11);
+			pt4->setItalic(0);
+			pt4->setScale1(0);
+			pt4->setStrikeout(0);
+			pt4->setunderline(0);
+			pt4->setWeight(400);
+			waypointsstyles_.push_back(pt4);
+	}
+	if(rep & TeLINES)
+	{
+		theme->layer()->getLines(lineSet);
+		for(unsigned int i = 0; i < lineSet.size(); i++)
+		{
+			TeLine2D line = lineSet[i];
+			for(unsigned int j = 0; j < line.size(); j++)
+			{
+				//Convertendo o lineSet do tema para projecao LatLong
+				TeCoord2D coord;
+				if(proj->name() != "LatLong")
+					coord = proj->PC2LL(line[j]);
+				else
+					coord = line[j];
+				TeGTMTrackLogs* pt = new TeGTMTrackLogs();
+				pt->setLatitude(coord.y());
+				pt->setLongitude(coord.x());
+				pt->setTalt(0.);
+				pt->setTdate(0);
+				if(j == 0)
+				{
+					pt->setTnum(1);
+
+					TeGTMTrackLogStyles* pt1 = new TeGTMTrackLogStyles();
+					pt1->setTcolor(0);
+					pt1->setTlabel(0);
+					pt1->setTlayer(0);
+					pt1->setTname((char*)vazio.c_str());
+					pt1->setTscale(0);
+					pt1->setTtype(1);
+					tracklogstyles_.push_back(pt1);
+				}
+				else
+					pt->setTnum(0);
+				tracklogs_.push_back(pt);
+			}
+		}
+	}
+
+	//Populando dados do cabe�alho
+	header_.setBcolor(16777215);
+	header_.setCode((char*)code.c_str());
+	header_.setCoriml(0);
+	header_.setGradcolor(0);
+	header_.setGradfont((char*)fontName.c_str());
+	header_.setGradnum(8);
+	header_.setIconnum(0);
+	header_.setLabelcolor(0);
+	header_.setlabelFont((char*)fontName.c_str());
+	header_.setLabelsize(10);
+	header_.setLayers(0);
+	header_.setMap(false);
+	if(mbr.lowerLeft().y() > mbr.upperRight().y())
+	{
+		header_.setMaxlat(mbr.lowerLeft().y());
+		header_.setMinlat(mbr.upperRight().y());
+	}
+	else
+	{
+		header_.setMaxlat(mbr.upperRight().y());
+		header_.setMinlat(mbr.lowerLeft().y());
+	}
+	header_.setMaxlon(mbr.upperRight().x());
+	header_.setMinlon(mbr.lowerLeft().x());
+	header_.setN_maps(0);
+	header_.setN_tk(tracklogstyles_.size());
+	header_.setNdatum(0);
+	header_.setNewdatum((char*)vazio.c_str());
+	header_.setNrtes(routes_.size());
+	header_.setNtracks(tracklogs_.size());
+	header_.setNwpts(waypoints_.size());
+	header_.setNwptstyles(waypointsstyles_.size());
+	header_.setRectangular(false);
+	header_.setTruegrid(false);
+	header_.setUsercolor(0);
+	header_.setUserfont((char*)vazio.c_str());
+	header_.setUseritalic(false);
+	header_.setUsernegrit(false);
+	header_.setUsernum(0);
+	header_.setUsersublin(false);
+	header_.setUsertachado(false);
+	header_.setVersion(211);
+	header_.setVwt(0);
+	header_.setWli(0);
+	header_.setWptnum(0);
+	//Escrevendo no arquivo
+	header_.writeGTMHeader(file);
+	header_.setCode(0);
+	header_.setGradfont(0);
+	header_.setlabelFont(0);
+	header_.setNewdatum(0);
+	header_.setUserfont(0);
+
+	//Populando dados de grid e datum
+	griddatum_.setAxis(proj->datum().radius());
+	griddatum_.setDx(0);
+	griddatum_.setDy(0);
+	griddatum_.setDz(0);
+	griddatum_.setFalseeast(0);
+	griddatum_.setFalsenorthing(0);
+	griddatum_.setFlattening(proj->datum().flattening());
+	griddatum_.setNdatum(setDatum(proj->datum()));
+	griddatum_.setNgrid(0);
+	griddatum_.setOrigin(0);
+	griddatum_.setScale1(0);
+	//Escrevendo no arquivo
+	griddatum_.writeGTMGridDatum(file);
+
+	//Escrevendo waypoints e waypointsStyles
+	for(unsigned int i = 0; i < waypoints_.size(); i++)
+	{
+		waypoints_.at(i)->writeGTMWaypoints(file);
+		waypoints_.at(i)->setWname(0);
+	}
+	for(unsigned int i = 0; i < waypointsstyles_.size(); i++)
+	{
+		waypointsstyles_.at(i)->writeGTMWaypointsStyles(file);
+		waypointsstyles_.at(i)->setFacename(0);
+	}
+	//Escrevendo tracklogs e tracklogStyles
+	for(unsigned int i = 0; i < tracklogs_.size(); i++)
+	{
+		tracklogs_.at(i)->writeGTMTrackLogs(file);
+	}
+	for(unsigned int i = 0; i < tracklogstyles_.size(); i++)
+	{
+		tracklogstyles_.at(i)->writeGTMTrackLogStyles(file);
+		tracklogstyles_.at(i)->setTname(0);
+	}
+	fclose(file);
+}
+
+std::vector<TeLayer*> TeGTM::importGTM(TeDatabase *db, std::string fileName)
+{
+	std::vector<TeLayer*> layers;
+
+	if(header_.getN_maps() > 0)
+	{
+		if(!db->layerExist(fileName+"_Images"))
+		{
+			TeBox box = TeBox(header_.getMinlon(), header_.getMinlat(), header_.getMaxlon(), header_.getMaxlat()); 
+			TeLayer* layer = new TeLayer(fileName+"_Images", db, box, getProjection());
+			int count = importImages(layer);
+			if(count > 0)
+				layers.push_back(layer);
+			else
+				db->deleteLayer(layer->id());
+		}
+		else
+			throw TeException(UNKNOWN_ERROR_TYPE, "Layer "+fileName+"_Images already exists!");
+	}
+	if(header_.getNwpts() > 0)
+	{
+		if(!db->layerExist(fileName+"_Waypoints"))
+		{
+			TeLayer* layer = new TeLayer(fileName+"_Waypoints", db, getProjection());
+			bool ok = importWaypoints(layer, layer->name(),"",100);
+			if(ok)
+				layers.push_back(layer);
+			else
+				db->deleteLayer(layer->id());
+		}
+		else
+			throw TeException(UNKNOWN_ERROR_TYPE, "Layer "+fileName+"_Waypoints already exists!");
+	}
+	if(header_.getNtracks() > 0)
+	{
+		if(!db->layerExist(fileName+"_TrackLogs_P"))
+		{
+			TeLayer* layer = new TeLayer(fileName+"_TrackLogs_P", db, getProjection());
+			bool ok = importTracklogs(layer, layer->name(),"",100);
+			if(ok)
+				layers.push_back(layer);
+			else
+				db->deleteLayer(layer->id());
+		}
+		else
+			throw TeException(UNKNOWN_ERROR_TYPE, "Layer "+fileName+"_TrackLogs_P already exists!");
+
+		if(!db->layerExist(fileName+"_TrackLogs_L"))
+		{
+			TeLayer* layer = new TeLayer(fileName+"_TrackLogs_L", db, getProjection());
+			bool ok = importTracklogs2(layer, layer->name(),"",100);
+			if(ok)
+				layers.push_back(layer);
+			else
+				db->deleteLayer(layer->id());
+		}
+		else
+			throw TeException(UNKNOWN_ERROR_TYPE, "Layer "+fileName+"_TrackLogs_L already exists!");
+	}
+	if(header_.getNrtes() > 0)
+	{
+		if(!db->layerExist(fileName+"_Routes_P"))
+		{
+			TeLayer* layer = new TeLayer(fileName+"_Routes_P", db, getProjection());
+			bool ok = importRoutes(layer, layer->name(),"",100);
+			if(ok)
+				layers.push_back(layer);
+			else
+				db->deleteLayer(layer->id());
+		}
+		else
+			throw TeException(UNKNOWN_ERROR_TYPE, "Layer "+fileName+"_Routes_P already exists!");
+
+		if(!db->layerExist(fileName+"_Routes_L"))
+		{
+			TeLayer* layer = new TeLayer(fileName+"_Routes_L", db, getProjection());
+			bool ok = importRoutes2(layer, layer->name(),"",100);
+			if(ok)
+				layers.push_back(layer);
+			else
+				db->deleteLayer(layer->id());
+		}
+		else
+			throw TeException(UNKNOWN_ERROR_TYPE, "Layer "+fileName+"_Routes_L already exists!");
+	}
+	return layers;
+}
+
+std::string TeGTM::getLayerNames(std::string fileName)
+{
+	layersNames_ = "";
+	if(header_.getN_maps() > 0)
+	{
+		layersNames_ += fileName+"_Images,";
+	}
+	if(header_.getNwpts() > 0)
+	{
+		layersNames_ += fileName+"_Waypoints,";
+	}
+	if(header_.getNtracks() > 0)
+	{
+		layersNames_ += fileName+"_TrackLogs,";
+	}
+	if(header_.getNrtes() > 0)
+	{
+		layersNames_ += fileName+"_Routes,";
+	}
+
+	return layersNames_;
+}
+
+TeProjection* TeGTM::getProjection()
+{
+	TeProjectionParams par;
+	par.name = "LatLong";
+	par.units = "DecimalDegrees";
+	par.datum = getDatum();
+	return TeProjectionFactory::make(par);
+}
+
+TeDatum TeGTM::getDatum()
+{
+	string name;
+	short ndatum = griddatum_.getNdatum();
+
+												//Datum suportado pela Terralib
+	if (ndatum == 46)							{ name = "Astro-Chua";}
+	else if (ndatum == 47)						{ name = "CorregoAlegre";}
+	else if (ndatum == 88)						{ name = "Indian";}
+	else if (ndatum == 123)						{ name = "NAD27";}
+	else if (ndatum == 139)						{ name = "NAD83";}
+	else if (ndatum == 196 || ndatum == 231)	{ name = "SAD69";}
+	else if (ndatum == 217)						{ name = "WGS84";}
+	else										{ name = "";}
+
+	if(!name.empty())
+		return TeDatumFactory::make(name);
+	else
+		throw TeException(DATUM_ERROR, "Datum not supported!");
+}
+
+TeProjection* TeGTM::setProjection(TeProjection* proj)
+{
+	TeProjectionParams par;
+	par.name = "LatLong";
+	par.units = "DecimalDegrees";
+	par.datum = proj->datum();
+	return TeProjectionFactory::make(par);
+}
+
+short TeGTM::setDatum(TeDatum datum)
+{
+	short ndatum;
+
+	if		(datum.name() == "Astro-Chua")					{ ndatum = 46;}
+	else if (datum.name() == "CorregoAlegre")				{ ndatum = 47;}
+	else if (datum.name() == "Indian")						{ ndatum = 88;}
+	else if (datum.name() == "NAD27")						{ ndatum = 123;}
+	else if (datum.name() == "NAD83")						{ ndatum = 139;}
+	else if (datum.name() == "SAD69")						{ ndatum = 196;}
+	else if (datum.name() == "WGS84")						{ ndatum = 217;}
+	else													{ ndatum = 217;}
+
+	return ndatum;
+}
+
+//Cabecalho do arquivo
+TeGTMHeader::TeGTMHeader()
+{
+	code_ = NULL;
+	gradfont_ = NULL;
+	labelfont_ = NULL;
+	userfont_ = NULL;
+	newdatum_ = NULL;
+}
+
+TeGTMHeader::~TeGTMHeader()
+{
+	if(code_ != NULL)
+		delete code_;
+	if(gradfont_ != NULL)
+		delete gradfont_;
+	if(labelfont_ != NULL)
+		delete labelfont_;
+	if(userfont_ != NULL)
+		delete userfont_;
+	if(newdatum_ != NULL)
+		delete newdatum_;
+}
+
+void TeGTMHeader::readGTMHeader(FILE* file)
+{
+	if(file != NULL)
+		rewind(file);
+	fread(&version_, 2, 1, file);
+
+	if(version_ != 211)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Version not supported!");
+
+	code_ = new char[11];
+	fread(code_, 10, 1, file);
+	code_[10] = '\0';
+
+	fread(&wli_, 1, 1, file);
+	fread(&vwt_, 1, 1, file);
+	fread(&gradnum_, 1, 1, file);
+	fread(&wptnum_, 1, 1, file);
+	fread(&usernum_, 1, 1, file);
+	fread(&coriml_, 1, 1, file);
+	fread(&ndatum_, 1, 1, file);
+
+	fread(&gradcolor_, 4, 1, file);
+	fread(&bcolor_, 4, 1, file);
+	fread(&nwptstyles_, 4, 1, file);
+	fread(&usercolor_, 4, 1, file);
+	fread(&nwpts_, 4, 1, file);
+	fread(&ntrcks_, 4, 1, file);
+	fread(&nrtes_, 4, 1, file);
+
+	fread(&maxlon_, 4, 1, file);
+	fread(&minlon_, 4, 1, file);
+	fread(&maxlat_, 4, 1, file);
+	fread(&minlat_, 4, 1, file);
+
+	fread(&n_maps_, 4, 1, file);
+	fread(&n_tk_, 4, 1, file);
+
+	fread(&layers_, 4, 1, file);
+	fread(&iconnum_, 4, 1, file);
+
+	fread(&rectangular_, 2, 1, file);
+	fread(&truegrid_, 2, 1, file);
+
+	fread(&labelcolor_, 4, 1, file);
+
+	fread(&usernegrit_, 2, 1, file);
+	fread(&useritalic_, 2, 1, file);
+	fread(&usersublin_, 2, 1, file);
+	fread(&usertachado_, 2, 1, file);
+	fread(&map_, 2, 1, file);
+
+	fread(&labelsize_, 2, 1, file);
+
+	short aux;
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	gradfont_ = new char[aux+1];
+	fread(gradfont_, (size_t)aux, 1, file);
+	gradfont_[aux] = '\0';
+
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	labelfont_ = new char[aux+1];
+	fread(labelfont_, (size_t)aux, 1, file);
+	labelfont_[aux] = '\0';
+
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	userfont_ = new char[aux+1];
+	fread(userfont_, (size_t)aux, 1, file);
+	userfont_[aux] = '\0';
+
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	newdatum_ = new char[aux+1];
+	fread(newdatum_, (size_t)aux, 1, file);
+	newdatum_[aux] = '\0';
+}
+
+void TeGTMHeader::writeGTMHeader(FILE* file)
+{
+	if(file != NULL)
+		rewind(file);
+	fwrite(&version_, 2, 1, file);
+
+	fwrite(code_, 10, 1, file);
+
+	fwrite(&wli_, 1, 1, file);
+	fwrite(&vwt_, 1, 1, file);
+	fwrite(&gradnum_, 1, 1, file);
+	fwrite(&wptnum_, 1, 1, file);
+	fwrite(&usernum_, 1, 1, file);
+	fwrite(&coriml_, 1, 1, file);
+	fwrite(&ndatum_, 1, 1, file);
+
+	fwrite(&gradcolor_, 4, 1, file);
+	fwrite(&bcolor_, 4, 1, file);
+	fwrite(&nwptstyles_, 4, 1, file);
+	fwrite(&usercolor_, 4, 1, file);
+	fwrite(&nwpts_, 4, 1, file);
+	fwrite(&ntrcks_, 4, 1, file);
+	fwrite(&nrtes_, 4, 1, file);
+
+	fwrite(&maxlon_, 4, 1, file);
+	fwrite(&minlon_, 4, 1, file);
+	fwrite(&maxlat_, 4, 1, file);
+	fwrite(&minlat_, 4, 1, file);
+
+	fwrite(&n_maps_, 4, 1, file);
+	fwrite(&n_tk_, 4, 1, file);
+
+	fwrite(&layers_, 4, 1, file);
+	fwrite(&iconnum_, 4, 1, file);
+
+	fwrite(&rectangular_, 2, 1, file);
+	fwrite(&truegrid_, 2, 1, file);
+
+	fwrite(&labelcolor_, 4, 1, file);
+
+	fwrite(&usernegrit_, 2, 1, file);
+	fwrite(&useritalic_, 2, 1, file);
+	fwrite(&usersublin_, 2, 1, file);
+	fwrite(&usertachado_, 2, 1, file);
+	fwrite(&map_, 2, 1, file);
+
+	fwrite(&labelsize_, 2, 1, file);
+
+	int i = strlen(gradfont_);
+	fwrite(&i, 2, 1, file);
+	fwrite(gradfont_, i, 1, file);
+
+	i = strlen(labelfont_);
+	fwrite(&i, 2, 1, file);
+	fwrite(labelfont_, i, 1, file);
+
+	i = strlen(userfont_);
+	fwrite(&i, 2, 1, file);
+	fwrite(userfont_, i, 1, file);
+
+	i = strlen(newdatum_);
+	fwrite(&i, 2, 1, file);
+	fwrite(newdatum_, i, 1, file);
+}
+
+//Classe com informacoes do datum utilizado
+TeGTMGridDatum::TeGTMGridDatum()
+{
+}
+
+TeGTMGridDatum::~TeGTMGridDatum()
+{
+}
+
+void TeGTMGridDatum::readGTMGridDatum(FILE* file)
+{
+	fread(&ngrid_, 2, 1, file);
+
+	fread(&origin_, 8, 1, file);
+	fread(&falseeast_, 8, 1, file);
+	fread(&scale1_, 8, 1, file);
+	fread(&falsenorthing_, 8, 1, file);
+
+	fread(&ndatum_, 2, 1, file);
+
+	fread(&axis_, 8, 1, file);
+	fread(&flattening_, 8, 1, file);
+
+	fread(&dx_, 2, 1, file);
+	fread(&dy_, 2, 1, file);
+	fread(&dz_, 2, 1, file);
+}
+
+void TeGTMGridDatum::writeGTMGridDatum(FILE* file)
+{
+	fwrite(&ngrid_, 2, 1, file);
+
+	fwrite(&origin_, 8, 1, file);
+	fwrite(&falseeast_, 8, 1, file);
+	fwrite(&scale1_, 8, 1, file);
+	fwrite(&falsenorthing_, 8, 1, file);
+
+	fwrite(&ndatum_, 2, 1, file);
+
+	fwrite(&axis_, 8, 1, file);
+	fwrite(&flattening_, 8, 1, file);
+
+	fwrite(&dx_, 2, 1, file);
+	fwrite(&dy_, 2, 1, file);
+	fwrite(&dz_, 2, 1, file);
+}
+
+//Classe com informacoes das imagens existentes no arquivo
+TeGTMInformationImages::TeGTMInformationImages()
+{
+	name_map_ = NULL;
+	comments_ = NULL;
+	blob_ = NULL;
+}
+
+TeGTMInformationImages::~TeGTMInformationImages()
+{
+	if(name_map_ != NULL)
+		delete name_map_;
+	if(comments_ != NULL)
+		delete comments_;
+	if(blob_ != NULL)
+		delete blob_;
+}
+
+void TeGTMInformationImages::readGTMInformationImages(FILE* file)
+{
+	short aux;
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	name_map_ = new char[aux+1];
+	fread(name_map_, (size_t)aux, 1, file);
+	name_map_[aux] = '\0';
+
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	comments_ = new char[aux+1];
+	fread(comments_, (size_t)aux, 1, file);
+	comments_[aux] = '\0';
+
+	fread(&gposx_, 4, 1, file);
+	fread(&gposy_, 4, 1, file);
+	fread(&gwidth_, 4, 1, file);
+	fread(&gheight_, 4, 1, file);
+
+	fread(&imagelen_, 4, 1, file);
+
+	fread(&metax_, 4, 1, file);
+	fread(&metay_, 4, 1, file);
+
+	fread(&metamapa_, 1, 1, file);
+	fread(&tnum_, 1, 1, file);
+}
+
+//Classe de waypoints
+TeGTMWaypoints::TeGTMWaypoints()
+{
+	name_ = NULL;
+	wname_ = NULL;
+}
+
+TeGTMWaypoints::~TeGTMWaypoints()
+{
+	if(name_ != NULL)
+		delete name_;
+	if(wname_ != NULL)
+		delete wname_;
+}
+
+void TeGTMWaypoints::readGTMWaypoints(FILE* file)
+{
+	fread(&latitude_, 8, 1, file);
+	fread(&longitude_, 8, 1, file);
+
+	name_ = new char[11];
+	fread(name_, 10, 1, file);
+	name_[10] = '\0';
+
+	short aux;
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	wname_ = new char[aux+1];
+	fread(wname_, (size_t)aux, 1, file);
+	wname_[aux] = '\0';
+
+	fread(&ico_, 2, 1, file);
+
+	fread(&dspl_, 1, 1, file);
+
+	fread(&wdate_, 4, 1, file);
+
+	fread(&wrot_, 2, 1, file);
+
+	fread(&walt_, 4, 1, file);
+
+	fread(&wlayer_, 2, 1, file);
+}
+
+void TeGTMWaypoints::writeGTMWaypoints(FILE* file)
+{
+	fwrite(&latitude_, 8, 1, file);
+	fwrite(&longitude_, 8, 1, file);
+
+	fwrite(name_, 10, 1, file);
+
+	int i = strlen(wname_);
+	fwrite(&i, 2, 1, file);
+	fwrite(wname_, i, 1, file);
+
+	fwrite(&ico_, 2, 1, file);
+
+	fwrite(&dspl_, 1, 1, file);
+
+	fwrite(&wdate_, 4, 1, file);
+
+	fwrite(&wrot_, 2, 1, file);
+
+	fwrite(&walt_, 4, 1, file);
+
+	fwrite(&wlayer_, 2, 1, file);
+}
+
+//Classe de waypoints
+TeGTMWaypointsStyles::TeGTMWaypointsStyles()
+{
+	facename_ = NULL;
+}
+
+TeGTMWaypointsStyles::~TeGTMWaypointsStyles()
+{
+	if(facename_ != NULL)
+		delete facename_;
+}
+
+void TeGTMWaypointsStyles::readGTMWaypointsStyles(FILE* file)
+{
+	fread(&height_, 4, 1, file);
+
+	short aux;
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	facename_ = new char[aux+1];
+	fread(facename_, (size_t)aux, 1, file);
+	facename_[aux] = '\0';
+
+	fread(&dspl_, 1, 1, file);
+
+	fread(&color_, 4, 1, file);
+	fread(&weight_, 4, 1, file);
+
+	fread(&scale1_, 4, 1, file);
+
+	fread(&border_, 1, 1, file);
+
+	fread(&background_, 2, 1, file);
+
+	fread(&backcolor_, 4, 1, file);
+
+	fread(&italic_, 1, 1, file);
+	fread(&underline_, 1, 1, file);
+	fread(&strikeout_, 1, 1, file);
+	fread(&alignment_, 1, 1, file);
+}
+
+void TeGTMWaypointsStyles::writeGTMWaypointsStyles(FILE* file)
+{
+	fwrite(&height_, 4, 1, file);
+
+	int i = strlen(facename_);
+	fwrite(&i, 2, 1, file);
+	fwrite(facename_, i, 1, file);
+
+	fwrite(&dspl_, 1, 1, file);
+
+	fwrite(&color_, 4, 1, file);
+	fwrite(&weight_, 4, 1, file);
+
+	fwrite(&scale1_, 4, 1, file);
+
+	fwrite(&border_, 1, 1, file);
+
+	fwrite(&background_, 2, 1, file);
+
+	fwrite(&backcolor_, 4, 1, file);
+
+	fwrite(&italic_, 1, 1, file);
+	fwrite(&underline_, 1, 1, file);
+	fwrite(&strikeout_, 1, 1, file);
+	fwrite(&alignment_, 1, 1, file);
+}
+
+//Classe de waypoints
+TeGTMTrackLogs::TeGTMTrackLogs()
+{
+}
+
+TeGTMTrackLogs::~TeGTMTrackLogs()
+{
+}
+
+void TeGTMTrackLogs::readGTMTrackLogs(FILE* file)
+{
+	fread(&latitude_, 8, 1, file);
+	fread(&longitude_, 8, 1, file);
+
+	fread(&tdate_, 4, 1, file);
+
+	fread(&tnum_, 1, 1, file);
+
+	fread(&talt_, 4, 1, file);
+}
+
+void TeGTMTrackLogs::writeGTMTrackLogs(FILE* file)
+{
+	fwrite(&latitude_, 8, 1, file);
+	fwrite(&longitude_, 8, 1, file);
+
+	fwrite(&tdate_, 4, 1, file);
+
+	fwrite(&tnum_, 1, 1, file);
+
+	fwrite(&talt_, 4, 1, file);
+}
+
+//Classe de waypoints styles
+TeGTMTrackLogStyles::TeGTMTrackLogStyles()
+{
+	tname_ = NULL;
+}
+
+TeGTMTrackLogStyles::~TeGTMTrackLogStyles()
+{
+	if(tname_ != NULL)
+		delete tname_;
+}
+
+void TeGTMTrackLogStyles::readGTMTrackLogStyles(FILE *file)
+{
+	short aux;
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	tname_ = new char[aux+1];
+	fread(tname_, (size_t)aux, 1, file);
+	tname_[aux] = '\0';
+
+	fread(&ttype_, 1, 1, file);
+
+	fread(&tcolor_, 4, 1, file);
+
+	fread(&tscale_, 4, 1, file);
+
+	fread(&tlabel_, 1, 1, file);
+
+	fread(&tlayer_, 2, 1, file);
+}
+
+void TeGTMTrackLogStyles::writeGTMTrackLogStyles(FILE *file)
+{
+	int i = strlen(tname_);
+	fwrite(&i, 2, 1, file);
+	fwrite(tname_, i, 1, file);
+
+	fwrite(&ttype_, 1, 1, file);
+
+	fwrite(&tcolor_, 4, 1, file);
+
+	fwrite(&tscale_, 4, 1, file);
+
+	fwrite(&tlabel_, 1, 1, file);
+
+	fwrite(&tlayer_, 2, 1, file);
+}
+
+//Classe de routes
+TeGTMRoutes::TeGTMRoutes()
+{
+	wname_ = NULL;
+	wcomment_ = NULL;
+	rname_ = NULL;
+}
+
+TeGTMRoutes::~TeGTMRoutes()
+{
+	if(wname_ = NULL)
+		delete wname_;
+	if(wcomment_ = NULL)
+		delete wcomment_;
+	if(rname_ = NULL)
+		delete rname_;
+}
+
+void TeGTMRoutes::readGTMRoutes(FILE *file)
+{
+	fread(&latitude_, 8, 1, file);
+	fread(&longitude_, 8, 1, file);
+
+	wname_ = new char[11];
+	fread(wname_, 10, 1, file);
+	wname_[10] = '\0';
+
+	short aux;
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	wcomment_ = new char[aux+1];
+	fread(wcomment_, (size_t)aux, 1, file);
+	wcomment_[aux] = '\0';
+
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	rname_ = new char[aux+1];
+	fread(rname_, (size_t)aux, 1, file);
+	rname_[aux] = '\0';
+
+	fread(&ico_, 2, 1, file);
+
+	fread(&dspl_, 1, 1, file);
+	fread(&tnum_, 1, 1, file);
+
+	fread(&tdate_, 4, 1, file);
+
+	fread(&wrot_, 2, 1, file);
+
+	fread(&walt_, 4, 1, file);
+
+	fread(&wlayer_, 2, 1, file);
+}
+
+//Classe de layers
+TeGTMLayers::TeGTMLayers()
+{
+	name_ = NULL;
+}
+
+TeGTMLayers::~TeGTMLayers()
+{
+	if(name_ != NULL)
+		delete name_;
+}
+
+void TeGTMLayers::readGTMLayers(FILE *file)
+{
+	fread(&index_, 2, 1, file);
+
+	short aux;
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	name_ = new char[aux+1];
+	fread(name_, (size_t)aux, 1, file);
+	name_[aux] = '\0';
+
+	fread(&color_, 4, 1, file);
+
+	fread(&lock_, 1, 1, file);
+	fread(&view_, 1, 1, file);
+	fread(&reserva1_, 1, 1, file);
+
+	fread(&reserva2_, 2, 1, file);
+}
+
+//Classe de user icons
+TeGTMUserIcons::TeGTMUserIcons()
+{
+	name_ = NULL;
+}
+
+TeGTMUserIcons::~TeGTMUserIcons()
+{
+	if(name_ != NULL)
+		delete name_;
+}
+
+void TeGTMUserIcons::readGTMUserIcons(FILE *file)
+{
+	short aux;
+	fread(&aux, 2, 1, file);
+	if(aux < 0)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Error while reading the file");
+	name_ = new char[aux+1];
+	fread(name_, (size_t)aux, 1, file);
+	name_[aux] = '\0';
+
+	fread(&number_, 1, 1, file);
+
+	fread(&size_, 4, 1, file);
+}
diff --git a/src/terralib/drivers/GTM/TeGTM.h b/src/terralib/drivers/GTM/TeGTM.h
new file mode 100644
index 0000000..e02e2db
--- /dev/null
+++ b/src/terralib/drivers/GTM/TeGTM.h
@@ -0,0 +1,1688 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGTM.h
+    \brief This file contains classes for .gtm support in TerraLib develop by the Exercito Brasileiro
+*/
+#ifndef  __TERRALIB_INTERNAL_GTMDRIVER_H
+#define  __TERRALIB_INTERNAL_GTMDRIVER_H
+
+#include <cstdio>
+#include <vector>
+#include <TeProjection.h>
+#include <TeDatum.h>
+#include <TeLayer.h>
+#include <TeDatabase.h>
+#include <TeAttribute.h>
+
+#include <tdkebdgnimport.h>
+
+using namespace std;
+
+//! TeGTMHeader .gtm files header.
+/*!
+	This class contains the access methods for the .gtm header attributes.
+	Attributes used in this class:
+	version - Integer Version of GTM file – Place 211
+	code - String*10 Fixed-length String – Place TrackMaker
+	wli - Byte Draws thick lines on Maps – Set to 0
+	vwt - Byte Reservation – Set to 0
+	gradnum - Byte Font size of the Grid Lines – Default = 8
+	wptnum - Byte Reservation – Set to 0
+	usernum - Byte Reservation – Set to 0
+	coriml - Byte Icon color
+	ndatum - Byte Reservation – Set to 0
+	gradcolor - Long Grid color – RGB – Default = 0 (Black)
+	bcolor - Long Background color– RGB – Default = 16777215 (White)
+	nwptstyles - Long Number of Waypoint Styles	Defines the number of times that the stylefont1 sequence will be repeated.
+	usercolor - Long Text Color of default Waypoint – RGB – Default = 0 (Black)
+	nwpts - Long Number of Waypoints
+	Defines - the number of times that the Wpts1 sequence will be repeated
+	ntrcks - Long Number of Trackpoints	Defines the number of times that the trcks1 sequence will be repeated
+	nrtes - Long Number of RoutePoints	Defines the number of times that the rtes1 sequence will be repeated
+
+	maxlon -
+	minlon - 	Single Bounding Box that stores the actual extent of the data in the file. Represents the minimum-bounding
+	maxlat -	rectangle orthogonal to the X and Y axes that contains all shapes. Basically used by the Catalog of Images.
+	minlat -
+
+	n_maps - Long Number of Map images
+	n_tk - Long Number of Tracklog Styles
+	rectangular - Boolean Activates Rectangular coordinates when GTM file is opened – Default = false
+	truegrid - Boolean Activates True Grid Mode when GTM file is opened – Default = False
+	LabelColor - Boolean Text Color of Tracklog Labels
+	wpttachado - Boolean Reservation – Set to False
+	usernegrit - Boolean Reservation – Set to False
+	useritalic - Boolean Reservation – Set to False
+	usersublin - Boolean Reservation – Set to False
+	usertachado - Boolean Reservation – Set to False
+	map - Boolean Set to TRUE if there are maps
+	LabelSize - Boolean Font Size of Tracklog Labels
+	gradfont - String Font Name of the Grid Text – Default = Times New Roman
+	LabelFont - String Font Name of Tracklogs Labels – Default = Times New Roman
+	userfont - String Reservation – No Text
+	newdatum - String Reservation – No Text
+    \author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTMHeader
+{
+private:
+	short version_, labelsize_;
+	char* code_;//code deve ser char[10]
+	unsigned char wli_, vwt_, gradnum_, wptnum_, usernum_, coriml_, ndatum_;
+	long gradcolor_, bcolor_, nwptstyles_, usercolor_, nwpts_, ntrcks_, nrtes_, n_maps_, n_tk_, labelcolor_;
+	float maxlon_, minlon_, maxlat_, minlat_, layers_, iconnum_;
+	char *gradfont_, *labelfont_, *userfont_, *newdatum_;
+	bool rectangular_, truegrid_, usernegrit_, useritalic_, usersublin_, usertachado_, map_;
+public:
+	//! Constructor
+	TeGTMHeader();
+
+	//! Destructor
+	~TeGTMHeader();
+
+	//! Header reader
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void readGTMHeader(FILE* file);
+
+	//! Header writer
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be exported.
+    */
+	void writeGTMHeader(FILE* file);
+
+	//! version_ attribute Getter
+	short getVersion(){return version_;};
+
+	//! version_ attribute Setter
+    /*!
+      \param GTM file version to be set.
+    */
+	void setVersion(short version){version_ = version;};
+
+	//! labelsize_ attribute Getter
+	short getLabelsize(){return labelsize_;};
+
+	//! labelsize_ attribute Setter
+    /*!
+      \param GTM file labelsize to be set.
+    */
+	void setLabelsize(short labelsize){labelsize_ = labelsize;};
+
+	//! code_ attribute Getter
+	char* getCode(){return code_;};
+
+	//! code_ attribute Setter
+    /*!
+      \param GTM file code to be set, place Trackmaker.
+    */
+	void setCode(char* code){code_ = code;};
+
+	//! gradfont_ attribute Getter
+	char* getGradfont(){return gradfont_;};
+
+	//! gradfont_ attribute Setter
+    /*!
+      \param GTM file grad font to be set, Default = Times New Roman.
+    */
+	void setGradfont(char* gradfont){gradfont_ = gradfont;};
+
+	//! userfont_ attribute Getter
+	char* getlabelFont(){return labelfont_;};
+
+	//! userfont_ attribute Setter
+    /*!
+      \param GTM file label font to be set, Default = Times New Roman.
+    */
+	void setlabelFont(char* labelfont){labelfont_ = labelfont;};
+
+	//! attribute Getter
+	char* getUserfont(){return userfont_;};
+
+	//! attribute Setter
+    /*!
+      \param GTM file user font to be set, String Reservation – No Text.
+    */
+	void setUserfont(char* userfont){userfont_ = userfont;};
+
+	//! newdatum_attribute Getter
+	char* getNewdatum(){return newdatum_;};
+
+	//! newdatum_attribute Setter
+    /*!
+      \param GTM file new datum to be set, String Reservation – No Text.
+    */
+	void setNewdatum(char* newdatum){newdatum_ = newdatum;};
+
+	//! wli_ attribute Getter
+	unsigned char getWli(){return wli_;};
+
+	//! wli_ attribute Setter
+    /*!
+      \param GTM file wli to be set, Set to 0.
+    */
+	void setWli(unsigned char wli){wli_ = wli;};
+
+	//! vwt_ attribute Getter
+	unsigned char getVwt(){return vwt_;};
+
+	//! vwt_ attribute Setter
+    /*!
+      \param GTM file vwt to be set, Set to 0.
+    */
+	void setVwt(unsigned char vwt){vwt_ = vwt;};
+
+	//! gradnum_ attribute Getter
+	unsigned char getGradnum(){return gradnum_;};
+
+	//! gradnum_ attribute Setter
+    /*!
+      \param GTM file gradnum to be set, Default = 8.
+    */
+	void setGradnum(unsigned char gradnum){gradnum_ = gradnum;};
+
+	//! wptnum_ attribute Getter
+	unsigned char getWptnum(){return wptnum_;};
+
+	//! wptnum_ attribute Setter
+    /*!
+      \param GTM file wptnum to be set, Set to 0.
+    */
+	void setWptnum(unsigned char wptnum){wptnum_ = wptnum;};
+
+	//! usernum_ attribute Getter
+	unsigned char getUsernum(){return usernum_;};
+
+	//! usernum_ attribute Setter
+    /*!
+      \param GTM file usernum to be set, Set to 0.
+    */
+	void setUsernum(unsigned char usernum){usernum_ = usernum;};
+
+	//! coriml_ attribute Getter
+	unsigned char getCoriml(){return coriml_;};
+
+	//! coriml_ attribute Setter
+    /*!
+      \param GTM file coriml to be set, Byte Icon color.
+    */
+	void setCoriml(unsigned char coriml){coriml_ = coriml;};
+
+	//! ndatum_ attribute Getter
+	unsigned char getNdatum(){return ndatum_;};
+
+	//! ndatum_ attribute Setter
+    /*!
+      \param GTM file ndatum to be set, Set to 0.
+    */
+	void setNdatum(unsigned char ndatum){ndatum_ = ndatum;};
+
+	//! gradcolor_ attribute Getter
+	long getGradcolor(){return gradcolor_;};
+
+	//! gradcolor_ attribute Setter
+    /*!
+      \param GTM file gradcolor to be set, Default = 0.
+    */
+	void setGradcolor(long gradcolor){gradcolor_ = gradcolor;};
+
+	//! bcolor_ attribute Getter
+	long getBcolor(){return bcolor_;};
+
+	//! bcolor_ attribute Setter
+    /*!
+      \param GTM file bcolor to be set, Default = 16777215.
+    */
+	void setBcolor(long bcolor){bcolor_ = bcolor;};
+
+	//! usercolor_ attribute Getter
+	long getNwptstyles(){return nwptstyles_;};
+
+	//! usercolor_ attribute Setter
+    /*!
+      \param GTM file nwptstyles to be set.
+    */
+	void setNwptstyles(long nwptstyles){nwptstyles_ = nwptstyles;};
+
+	//! attribute Getter
+	long getUsercolor(){return usercolor_;};
+
+	//! attribute Setter
+    /*!
+      \param GTM file usercolor to be set, Default = 0.
+    */
+	void setUsercolor(long usercolor){usercolor_ = usercolor;};
+
+	//! nwpts_ attribute Getter
+	long getNwpts(){return nwpts_;};
+
+	//! nwpts_ attribute Setter
+    /*!
+      \param GTM file nwpts to be set.
+    */
+	void setNwpts(long nwpts){nwpts_ = nwpts;};
+
+	//! ntrcks_ attribute Getter
+	long getNtracks(){return ntrcks_;};
+
+	//! ntrcks_ attribute Setter
+    /*!
+      \param GTM file ndatum to be set.
+    */
+	void setNtracks(long ntrcks){ntrcks_ = ntrcks;};
+
+	//! nrtes_ attribute Getter
+	long getNrtes(){return nrtes_;};
+
+	//! nrtes_ attribute Setter
+    /*!
+      \param GTM file nrtes to be set.
+    */
+	void setNrtes(long nrtes){nrtes_ = nrtes;};
+
+	//! n_maps_ attribute Getter
+	long getN_maps(){return n_maps_;};
+
+	//! n_maps_ attribute Setter
+    /*!
+      \param GTM file n_maps_ to be set.
+    */
+	void setN_maps(long n_maps){n_maps_ = n_maps;};
+
+	//! n_tk_ attribute Getter
+	long getN_tk(){return n_tk_;};
+	//! n_tk_ attribute Setter
+    /*!
+      \param GTM file n_tk to be set.
+    */
+	void setN_tk(long n_tk){n_tk_ = n_tk;};
+
+	//! labelcolor_ attribute Getter
+	long getLabelcolor(){return labelcolor_;};
+	//! labelcolor_ attribute Setter
+    /*!
+      \param GTM file labelcolor to be set.
+    */
+	void setLabelcolor(long labelcolor){labelcolor_ = labelcolor;};
+
+	//! maxlon_ attribute Getter
+	float getMaxlon(){return maxlon_;};
+
+	//! maxlon_ attribute Setter
+    /*!
+      \param GTM file maxlon to be set.
+    */
+	void setMaxlon(float maxlon){maxlon_ = maxlon;};
+
+	//! minlon_ attribute Getter
+	float getMinlon(){return minlon_;};
+
+	//! minlon_ attribute Setter
+    /*!
+      \param GTM file minlon to be set.
+    */
+	void setMinlon(float minlon){minlon_ = minlon;};
+
+	//! maxlat_ attribute Getter
+	float getMaxlat(){return maxlat_;};
+
+	//! maxlat_ attribute Setter
+    /*!
+      \param GTM file maxlat to be set.
+    */
+	void setMaxlat(float maxlat){maxlat_ = maxlat;};
+
+	//! minlat_ attribute Getter
+	float getMinlat(){return minlat_;};
+
+	//! minlat_ attribute Setter
+    /*!
+      \param GTM file minlat to be set.
+    */
+	void setMinlat(float minlat){minlat_ = minlat;};
+
+	//! layers_ attribute Getter
+	float getLayers(){return layers_;};
+
+	//! layers_ attribute Setter
+    /*!
+      \param GTM file layers to be set.
+    */
+	void setLayers(float layers){layers_ = layers;};
+
+	//! iconnum_ attribute Getter
+	float getIconnum(){return iconnum_;};
+
+	//! iconnum_ attribute Setter
+    /*!
+      \param GTM file iconnum to be set.
+    */
+	void setIconnum(float iconnum){iconnum_ = iconnum;};
+
+	//! rectangular_ attribute Getter
+	bool getRectangular(){return rectangular_;};
+
+	//! rectangular_ attribute Setter
+    /*!
+      \param GTM file rectangular to be set.
+    */
+	void setRectangular(bool rectangular){rectangular_ = rectangular;};
+
+	//! truegrid_ attribute Getter
+	bool getTruegrid(){return truegrid_;};
+
+	//! truegrid_ attribute Setter
+    /*!
+      \param GTM file truegrid to be set.
+    */
+	void setTruegrid(bool truegrid){truegrid_ = truegrid;};
+
+	//! usernegrit_ attribute Getter
+	bool getUsernegrit(){return usernegrit_;};
+
+	//! usernegrit_ attribute Setter
+    /*!
+      \param GTM file usernegrit to be set.
+    */
+	void setUsernegrit(bool usernegrit){usernegrit_ = usernegrit;};
+
+	//! useritalic_ attribute Getter
+	bool getUseritalic(){return useritalic_;};
+
+	//! useritalic_ attribute Setter
+    /*!
+      \param GTM file useritalic to be set.
+    */
+	void setUseritalic(bool useritalic){useritalic_ = useritalic;};
+
+	//! usersublin_ attribute Getter
+	bool getUsersublin(){return usersublin_;};
+
+	//! usersublin_ attribute Setter
+    /*!
+      \param GTM file usersublin to be set.
+    */
+	void setUsersublin(bool usersublin){usersublin_ = usersublin;};
+
+	//! usertachado_ attribute Getter
+	bool getUsertachado(){return usertachado_;};
+
+	//! usertachado_ attribute Setter
+    /*!
+      \param GTM file usertachado to be set.
+    */
+	void setUsertachado(bool usertachado){usertachado_ = usertachado;};
+
+	//! map_ attribute Getter
+	bool getMap(){return map_;};
+
+	//! map_ attribute Setter
+    /*!
+      \param GTM file map to be set.
+    */
+	void setMap(bool map){map_ = map;};
+};
+
+
+//! TeGTMGridDatum class with projection/datum informations.
+/*!
+	Attributes used
+	Ngrid - Integer Number of the predefined grid. See the table below.
+	Origin - Double User Grid - Longitude of origin
+	falseeast - Double User Grid – False Easting
+	scale1 - Double User Grid – Scale Factor
+	falsenorthing - Double User Grid – False Northing (Set to 0)
+	ndatum - Integer Number of Predefined Datum, which the data were stored in GTM File.
+	axis - Double User Datum – Major Semi-Axe of the Earth (Set to 0)
+	flattenig - Double User Datum – Flattening of the Earth (Set to 0)
+	dx - Integer User Datum – Delta X (Set to 0)
+	dy - Integer User Datum – Delta Y (Set to 0)
+	dz - Integer User Datum – Delta Z (Set to 0)    
+	\author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTMGridDatum
+{
+private:
+	short ngrid_, ndatum_, dx_, dy_, dz_;
+	double origin_, falseeast_, scale1_, falsenorthing_, axis_, flattening_;
+public:
+	//! Constructor
+	TeGTMGridDatum();
+
+	//! Destructor
+	~TeGTMGridDatum();
+
+	//! GridDatum reader
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void readGTMGridDatum(FILE* file);
+
+	//! GridDatum writer
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be exported.
+    */
+	void writeGTMGridDatum(FILE* file);
+
+	//! ngrid_ attribute Getter
+	short getNgrid(){return ngrid_;};
+
+	//! ngrid_ attribute Setter
+    /*!
+      \param ngrid - Integer Number of the predefined grid.
+    */
+	void setNgrid(short ngrid){ngrid_ = ngrid;};
+
+	//! ndatum_ attribute Getter
+	short getNdatum(){return ndatum_;};
+
+	//! ndatum_ attribute Setter
+    /*!
+      \param ndatum - Integer Number of Predefined Datum.
+    */
+	void setNdatum(short ndatum){ndatum_ = ndatum;};
+
+	//! dx_ attribute Getter
+	short getDx(){return dx_;};
+
+	//! dx_ attribute Setter
+    /*!
+      \param dz.
+    */
+	void setDx(short dx){dx_ = dx;};
+
+	//! dy_ attribute Getter
+	short getDy(){return dy_;};
+
+	//! dy_ attribute Setter
+    /*!
+      \param dy.
+    */
+	void setDy(short dy){dy_ = dy;};
+
+	//! dz_ attribute Getter
+	short getDz(){return dz_;};
+
+	//! dz_ attribute Setter
+    /*!
+      \param dz.
+    */
+	void setDz(short dz){dz_ = dz;};
+
+	//! origin_ attribute Getter
+	double getOrigin(){return origin_;};
+
+	//! origin_ attribute Setter
+    /*!
+      \param origin.
+    */
+	void setOrigin(double origin){origin_ = origin;};
+
+	//! falseeast_ attribute Getter
+	double getFalseeast(){return falseeast_;};
+
+	//! falseeast_ attribute Setter
+    /*!
+      \param falseeast.
+    */
+	void setFalseeast(double falseeast){falseeast_ = falseeast;};
+
+	//! scale1_ attribute Getter
+	double getScale1(){return scale1_;};
+
+	//! scale1_ attribute Setter
+    /*!
+      \param scale1.
+    */
+	void setScale1(double scale1){scale1_ = scale1;};
+
+	//! falsenorthing_ attribute Getter
+	double getFalsenorthing(){return falsenorthing_;};
+
+	//! falsenorthing_ attribute Setter
+    /*!
+      \param falsenorthing.
+    */
+	void setFalsenorthing(double falsenorthing){falsenorthing_ = falsenorthing;};
+
+	//! axis_ attribute Getter
+	double getAxis(){return axis_;};
+
+	//! axis_ attribute Setter
+    /*!
+      \param axis.
+    */
+	void setAxis(double axis){axis_ = axis;};
+
+	//! flattening_ attribute Getter
+	double getFlattening(){return flattening_;};
+
+	//! flattening_ attribute Setter
+    /*!
+      \param flattening.
+    */
+	void setFlattening(double flattening){flattening_ = flattening;};
+};
+
+//! TeGTMInformationImages class with images informations.
+/*!
+	Attributes used
+	name_map - string Image name
+	comments - string Image comments
+	Gposx - single upper-left corner in degrees
+	Gposy - single upper-left corner in degrees
+	Gwidth - single Image width in degrees
+	Gheight - single Image Height in degrees
+	imagelen - long File image length
+	Metax - single Reservation – Set to 0
+	Metay - single Reservation – Set to 0
+	metamapa - byte Reservation – Set to 0
+	Tnum - byte Reservation – Set to 1
+	\author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTMInformationImages
+{
+private:
+	char *name_map_, *comments_, *blob_;//blob -> usado para guardar a imagem em si
+	float gposx_, gposy_, gwidth_, gheight_, metax_, metay_;
+	long imagelen_;
+	unsigned char metamapa_, tnum_;
+public:
+	//! Constructor
+	TeGTMInformationImages();
+	
+	//! Destructor
+	~TeGTMInformationImages();
+
+	//! Images information reader
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void readGTMInformationImages(FILE* file);
+
+	//! Images information writer
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be exported.
+    */
+	void writeGTMInformationImages(FILE* file);
+
+	//! name_map_ attribute Getter
+	char* getName_map(){return name_map_;};
+
+	//! name_map_ attribute Setter
+    /*!
+      \param name_map.
+    */
+	void setName_map(char* name_map){name_map_ = name_map;};
+
+	//! comments_ attribute Getter
+	char* getComments(){return comments_;};
+
+	//! comments_ attribute Setter
+    /*!
+      \param comments.
+    */
+	void setComments(char* comments){comments_ = comments;};
+
+	//! gposx_ attribute Getter
+	float getGposx(){return gposx_;};
+
+	//! gposx_ attribute Setter
+    /*!
+      \param gposx.
+    */
+	void setGposx(float gposx){gposx_ = gposx;};
+
+	//! gposy_ attribute Getter
+	float getGposy(){return gposy_;};
+
+	//! gposy_ attribute Setter
+    /*!
+      \param gposy.
+    */
+	void setGposy(float gposy){gposy_ = gposy;};
+
+	//! gwidth_ attribute Getter
+	float getGwidth(){return gwidth_;};
+
+	//! gwidth_ attribute Setter
+    /*!
+      \param gwidth.
+    */
+	void setGwidth(float gwidth){gwidth_ = gwidth;};
+
+	//! gheight_ attribute Getter
+	float getGheight(){return gheight_;};
+
+	//! gheight_ attribute Setter
+    /*!
+      \param gheight.
+    */
+	void setGheight(float gheight){gheight_ = gheight;};
+
+	//! metax_ attribute Getter
+	float getMetax(){return metax_;};
+
+	//! metax_ attribute Setter
+    /*!
+      \param metax.
+    */
+	void setMetax(float metax){metax_ = metax;};
+
+	//! metay_ attribute Getter
+	float getMetay(){return metay_;};
+
+	//! metay_ attribute Setter
+    /*!
+      \param metay.
+    */
+	void setMetay(float metay){metay_ = metay;};
+
+	//! imagelen_ attribute Getter
+	long getImagelen(){return imagelen_;};
+
+	//! imagelen_ attribute Setter
+    /*!
+      \param imagelen.
+    */
+	void setImagelen(long imagelen){imagelen_ = imagelen;};
+
+	//! metamapa_ attribute Getter
+	unsigned char getMetamap(){return metamapa_;};
+
+	//! metamapa_ attribute Setter
+    /*!
+      \param metamapa.
+    */
+	void setMetamap(unsigned char metamapa){metamapa_ = metamapa;};
+
+	//! tnum_ attribute Getter
+	unsigned char getTnum(){return tnum_;};
+
+	//! tnum_ attribute Setter
+    /*!
+      \param tnum.
+    */
+	void setTnum(unsigned char tnum){tnum_ = tnum;};
+
+	//! blob_ attribute Setter
+	void setBlob(char* blob){blob_ = blob;};
+
+	//! blob_ attribute Getter (used to store de image in memory)
+	char* getBlob(){return blob_;};
+};
+
+//! TeGTMWaypoints class with images informations.
+/*!
+	Attributes used
+	latitude - double Latitude in degrees with 13 decimal places
+	longitude - double Longitude in degrees with 13 decimal places
+	name - String*10 Waypoint Name
+	wname - string Waypoint comments
+	ico - integer Icon number. See the table below. (Default = 48)
+	dslp - byte Display number. See the table below.
+	wdate - long Waypoint date - Number of seconds since 31-Dec-1989. See the examples below.
+	wrot - integer Angle of Rotation x10 – Example: 1800 = 180 degrees
+	walt - single Altitude in meters
+	wlayer - integer Reserved – Set to 0
+	\author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTMWaypoints
+{
+private:
+	double latitude_, longitude_;
+	char *name_, *wname_;//name deve ser char[10]
+	short ico_, wrot_, wlayer_;
+	unsigned char dspl_;
+	long wdate_;
+	float walt_;
+public:
+	//! Constructor
+	TeGTMWaypoints();
+
+	//! Destructor
+	~TeGTMWaypoints();
+
+	//! Images information reader
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void readGTMWaypoints(FILE* file);
+
+	//! Images information writer
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be exported.
+    */
+	void writeGTMWaypoints(FILE* file);
+
+	//! latitude_ attribute Getter
+	double getLatitude(){return latitude_;};
+
+	//! latitude_ attribute Setter
+    /*!
+      \param latitude.
+    */
+	void setLatitude(double latitude){latitude_ = latitude;};
+
+	//! longitude_ attribute Getter
+	double getLongitude(){return longitude_;};
+
+	//! longitude_ attribute Setter
+    /*!
+      \param longitude.
+    */
+	void setLongitude(double longitude){longitude_ = longitude;};
+
+	//! name_ attribute Getter
+	char* getName(){return name_;};
+
+	//! name_ attribute Setter
+    /*!
+      \param name.
+    */
+	void setName(char* name){name_ = name;};
+
+	//! wname_ attribute Getter
+	char* getWname(){return wname_;};
+
+	//! wname_ attribute Setter
+    /*!
+      \param wname.
+    */
+	void setWname(char* wname){wname_ = wname;};
+
+	//! ico_ attribute Getter
+	short getIco(){return ico_;};
+
+	//! ico_ attribute Setter
+    /*!
+      \param ico.
+    */
+	void setIco(short ico){ico_ = ico;};
+
+	//! wrot_ attribute Getter
+	short getWrot(){return wrot_;};
+
+	//! wrot_ attribute Setter
+    /*!
+      \param wrot.
+    */
+	void setWrot(short wrot){wrot_ = wrot;};
+
+	//! wlayer_ attribute Getter
+	short getWlayer(){return wlayer_;};
+
+	//! wlayer_ attribute Setter
+    /*!
+      \param wlayer.
+    */
+	void setWlayer(short wlayer){wlayer_ = wlayer;};
+
+	//! wdate_ attribute Getter
+	long getWdate(){return wdate_;};
+
+	//! wdate_ attribute Setter
+    /*!
+      \param wdate.
+    */
+	void setWdate(long wdate){wdate_ = wdate;};
+
+	//! walt_ attribute Getter
+	float getWalt(){return walt_;};
+
+	//! walt_ attribute Setter
+    /*!
+      \param walt.
+    */
+	void setWalt(float walt){walt_ = walt;};
+
+	//! dspl_ attribute Getter
+	unsigned char getDspl(){return dspl_;};
+
+	//! dspl_ attribute Setter
+    /*!
+      \param dspl.
+    */
+	void setDspl(unsigned char dspl){dspl_ = dspl;};
+};
+
+//! TeGTMWaypoints class with images informations.
+/*!
+	Attributes used
+	height - Long Font Size x –1.333333. Example: If font size is 8, height will be -11
+	facename - String Font name – Default = “Times New Roman”
+	dspl - Byte Display mode. See the table below.
+	color - Long Text color (RGB)
+	weight - Long Normal = 400 / Bold = 700
+	scale1 - Single Maximum scale in Kilometers that the Waypoint appears on screen (Default = 0)
+	border - Byte Border of the background box. See the table below.
+	background - Boolean Background box – Used by Text Box Style
+	backcolor - Long Color of the Background Box (RGB)
+	italic - Byte Normal = 0 / Italic = 1
+	underline - Byte Normal = 0 / Underline = 1
+	strikeout - Byte Normal = 0 / Strikeout = 1
+	alignment - Byte Text alignment in Text Box. See the table below.
+	\author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTMWaypointsStyles
+{
+private:
+	long height_, color_, weight_, backcolor_;
+	char *facename_;
+	unsigned char dspl_, border_, italic_, underline_, strikeout_, alignment_;
+	float scale1_;
+	bool background_;
+public:
+	//! Constructor
+	TeGTMWaypointsStyles();
+
+	//! Destructor
+	~TeGTMWaypointsStyles();
+
+	//! Waypoints Styles reader
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void readGTMWaypointsStyles(FILE* file);
+
+	//! Waypoints Styles writer
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be exported.
+    */
+	void writeGTMWaypointsStyles(FILE* file);
+
+	//! height_ attribute Getter
+	long getHeight(){return height_;};
+
+	//! height_ attribute Setter
+    /*!
+      \param height.
+    */
+	void setHeight(long height){height_ = height;};
+
+	//! color_ attribute Getter
+	long getColor(){return color_;};
+
+	//! color_ attribute Setter
+    /*!
+      \param color.
+    */
+	void setColor(long color){color_ = color;};
+
+	//! weight_ attribute Getter
+	long getWeight(){return weight_;};
+
+	//! weight_ attribute Setter
+    /*!
+      \param weight.
+    */
+	void setWeight(long weight){weight_ = weight;};
+
+	//! backcolor_ attribute Getter
+	long getBackcolor(){return backcolor_;};
+
+	//! backcolor_ attribute Setter
+    /*!
+      \param backcolor.
+    */
+	void setBackcolor(long backcolor){backcolor_ = backcolor;};
+
+	//! facename_ attribute Getter
+	char* getFacename(){return facename_;};
+
+	//! facename_ attribute Setter
+    /*!
+      \param facename.
+    */
+	void setFacename(char* facename){facename_ = facename;};
+
+	//! dspl_ attribute Getter
+	unsigned char getDspl(){return dspl_;};
+
+	//! dspl_ attribute Setter
+    /*!
+      \param dspl.
+    */
+	void setDspl(unsigned char dspl){dspl_ = dspl;};
+
+	//! border_ attribute Getter
+	unsigned char getBorder(){return border_;};
+
+	//! border_ attribute Setter
+    /*!
+      \param border.
+    */
+	void setBorder(unsigned char border){border_ = border;};
+
+	//! italic_ attribute Getter
+	unsigned char getItalic(){return italic_;};
+
+	//! italic_ attribute Setter
+    /*!
+      \param italic.
+    */
+	void setItalic(unsigned char italic){italic_ = italic;};
+
+	//! underline_ attribute Getter
+	unsigned char getunderline(){return underline_;};
+
+	//! underline_ attribute Setter
+    /*!
+      \param underline.
+    */
+	void setunderline(unsigned char underline){underline_ = underline;};
+
+	//! strikeout_ attribute Getter
+	unsigned char getStrikeout(){return strikeout_;};
+
+	//! strikeout_ attribute Setter
+    /*!
+      \param strikeout.
+    */
+	void setStrikeout(unsigned char strikeout){strikeout_ = strikeout;};
+
+	//! alignment_ attribute Getter
+	unsigned char getAlignment(){return alignment_;};
+
+	//! alignment_ attribute Setter
+    /*!
+      \param alignment.
+    */
+	void setAlignment(unsigned char alignment){alignment_ = alignment;};
+
+	//! scale1_ attribute Getter
+	float getScale1(){return scale1_;};
+
+	//! scale1_ attribute Setter
+    /*!
+      \param scale1.
+    */
+	void setScale1(float scale1){scale1_ = scale1;};
+	
+	//! background_ attribute Getter
+	bool getBackground(){return background_;};
+
+	//! background_ attribute Setter
+    /*!
+      \param background.
+    */
+	void setBackground(bool background){background_ = background;};
+};
+
+//! TeGTMTrackLogs class with images informations.
+/*!
+	Attributes used
+	latitude - Double Latitude in degrees with 13 decimal places
+	longitude - Double Longitude in degrees with 13 decimal places
+	tdate - Long Trackpoint date - Number of seconds since 31-Dec-1989. See the example below.
+	tnum - Byte Tracklog flag : 1 = Start a new Tracklog / 0 = continue the tracklog
+	talt - Single Altitude in meters
+	\author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTMTrackLogs
+{
+private:
+	double latitude_, longitude_;
+	long tdate_;
+	unsigned char tnum_;
+	float talt_;
+public:
+	//! Constructor
+	TeGTMTrackLogs();
+
+	//! Destructor
+	~TeGTMTrackLogs();
+
+	//! TrackLogs reader
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void readGTMTrackLogs(FILE* file);
+
+	//! TrackLogs writer
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void writeGTMTrackLogs(FILE* file);
+
+	//! latitude_ attribute Getter
+	double getLatitude(){return latitude_;};
+
+	//! latitude_ attribute Setter
+    /*!
+      \param latitude.
+    */
+	void setLatitude(double latitude){latitude_ = latitude;};
+
+	//! longitude_ attribute Getter
+	double getLongitude(){return longitude_;};
+
+	//! longitude_ attribute Setter
+    /*!
+      \param longitude.
+    */
+	void setLongitude(double longitude){longitude_ = longitude;};
+
+	//! tdate_ attribute Getter
+	long getTdate(){return tdate_;};
+
+	//! tdate_ attribute Setter
+    /*!
+      \param tdate.
+    */
+	void setTdate(long tdate){tdate_ = tdate;};
+
+	//! tnum_ attribute Getter
+	unsigned char getTnum(){return tnum_;};
+
+	//! tnum_ attribute Setter
+	/*!
+      \param tnum.
+    */
+	void setTnum(unsigned char tnum){tnum_ = tnum;};
+
+	//! talt_ attribute Getter
+	float getTalt(){return talt_;};
+
+	//! talt_ attribute Setter
+    /*!
+      \param talt.
+    */
+	void setTalt(float talt){talt_ = talt;};
+};
+
+//! TeGTMTrackLogs class with images informations.
+/*!
+	Attributes used
+	tname - String Tracklog name
+	ttype - Byte Tracklog type. See the table below.
+	tcolor - Long Tracklog color (RGB)
+	tscale - Single Maximum scale in Kilometers that the Tracklog appears on screen (Default = 0)
+	tlabel - Byte Reservation – Set to 0
+	tlayer - Integer Reservation – Set to 0
+	\author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTMTrackLogStyles
+{
+private:
+	char* tname_;
+	long tcolor_;
+	unsigned char ttype_, tlabel_;
+	float tscale_;
+	short tlayer_;
+public:
+	//! Constructor
+	TeGTMTrackLogStyles();
+
+	//! Destructor
+	~TeGTMTrackLogStyles();
+
+	//! TrackLogs Styles reader
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void readGTMTrackLogStyles(FILE* file);
+
+	//! TrackLogs Styles writer
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be exported.
+    */
+	void writeGTMTrackLogStyles(FILE* file);
+
+	//! tname_ attribute Getter
+	char* getTname(){return tname_;};
+
+	//! tname_ attribute Setter
+    /*!
+      \param tname.
+    */
+	void setTname(char* tname){tname_ = tname;};
+
+	//! tcolor_ attribute Getter
+	long getTcolor(){return tcolor_;};
+
+	//! tcolor_ attribute Setter
+    /*!
+      \param tcolor.
+    */
+	void setTcolor(long tcolor){tcolor_ = tcolor;};
+
+	//! ttype_ attribute Getter
+	unsigned char getTtype(){return ttype_;};
+
+	//! ttype_ attribute Setter
+    /*!
+      \param ttype.
+    */
+	void setTtype(unsigned char ttype){ttype_ = ttype;};
+
+	//! tlabel_ attribute Getter
+	unsigned char getTlabel(){return tlabel_;};
+
+	//! tlabel_ attribute Setter
+    /*!
+      \param tlabel.
+    */
+	void setTlabel(unsigned char tlabel){tlabel_ = tlabel;};
+
+	//! tscale_ attribute Getter
+	float getTscale(){return tscale_;};
+
+	//! tscale_ attribute Setter
+    /*!
+      \param tscale.
+    */
+	void setTscale(float tscale){tscale_ = tscale;};
+
+	//! tlayer_ attribute Getter
+	short getTlayer(){return tlayer_;};
+
+	//! tlayer_ attribute Setter
+    /*!
+      \param tlayer.
+    */
+	void setTlayer(short tlayer){tlayer_ = tlayer;};
+};
+
+//! TeGTMRoutes class with images informations.
+/*!
+	Attributes used
+	latitude - Double Latitude in degrees with 13 decimal places
+	longitude - Double Longitude in degrees with 13 decimal places
+	wname - String *10 Routepoint Name
+	wcomment - String Routepoint Comments
+	rname - String Route name
+	ico - Integer Icon number . See the table of Icons. (Default = 48)
+	dspl - Byte Display number. See the table of dspl.
+	tnum - Byte Route flag : 1 = Start a new Route / 0 = continue the route
+	tdate - Long Reservation – Set to 0
+	wrot - Integer Reservation – Set to 0
+	walt - Single Altitude in meters
+	wlayer - Integer Reservation – Set to 0
+	\author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTMRoutes
+{
+private:
+	double latitude_, longitude_;
+	char* wname_, *wcomment_, *rname_;//wname deve ser char[10]
+	short ico_, wrot_, wlayer_;
+	unsigned char dspl_, tnum_;
+	long tdate_;
+	float walt_;
+public:
+	//! Constructor
+	TeGTMRoutes();
+
+	//! Destructor
+	~TeGTMRoutes();
+
+	//! TrackLogs Styles reader
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void readGTMRoutes(FILE* file);
+
+	//! TrackLogs Styles writer
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be exported.
+    */
+	void writeGTMRoutes(FILE* file);
+
+	//! latitude_ attribute Getter
+	double getLatitude(){return latitude_;};
+
+	//! latitude_ attribute Setter
+    /*!
+      \param latitude.
+    */
+	void setLatitude(double latitude){latitude_ = latitude;};
+
+	//! longitude_ attribute Getter
+	double getLongitude(){return longitude_;};
+
+	//! longitude_ attribute Setter
+    /*!
+      \param longitude.
+    */
+	void setLongitude(double longitude){longitude_ = longitude;};
+
+	//! wname_ attribute Getter
+	char* getWname(){return wname_;};
+
+	//! wname_ attribute Setter
+    /*!
+      \param wname.
+    */
+	void setWname(char* wname){wname_ = wname;};
+
+	//! wcomment_ attribute Getter
+	char* getWcomment(){return wcomment_;};
+
+	//! wcomment_ attribute Setter
+    /*!
+      \param wcomment.
+    */
+	void setWcomment(char* wcomment){wcomment_ = wcomment;};
+
+	//! rname_ attribute Getter
+	char* getRname(){return rname_;};
+
+	//! rname_ attribute Setter
+    /*!
+      \param rname.
+    */
+	void setRname(char* rname){rname_ = rname;};
+
+	//! ico_ attribute Getter
+	short getIco(){return ico_;};
+
+	//! ico_ attribute Setter
+    /*!
+      \param ico.
+    */
+	void setIco(short ico){ico_ = ico;};
+
+	//! wrot_ attribute Getter
+	short getWrot(){return wrot_;};
+
+	//! wrot_ attribute Setter
+    /*!
+      \param wrot.
+    */
+	void setWrot(short wrot){wrot_ = wrot;};
+
+	//! wlayer_ attribute Getter
+	short getWlayer(){return wlayer_;};
+
+	//! wlayer_ attribute Setter
+    /*!
+      \param wlayer.
+    */
+	void setWlayer(short wlayer){wlayer_ = wlayer;};
+
+	//! dspl_ attribute Getter
+	unsigned char getDspl(){return dspl_;};
+
+	//! dspl_ attribute Setter
+    /*!
+      \param dspl.
+    */
+	void setDspl(unsigned char dspl){dspl_ = dspl;};
+
+	//! tnum_ attribute Getter
+	unsigned char getTnum(){return tnum_;};
+
+	//! tnum_ attribute Setter
+    /*!
+      \param tnum.
+    */
+	void setTnum(unsigned char tnum){tnum_ = tnum;};
+
+	//! tdate_ attribute Getter
+	long getTdate(){return tdate_;};
+
+	//! tdate_ attribute Setter
+    /*!
+      \param tdate.
+    */
+	void setTdate(long tdate){tdate_ = tdate;};
+
+	//! walt_ attribute Getter
+	float getWalt(){return walt_;};
+
+	//! walt_ attribute Setter
+    /*!
+      \param walt.
+    */
+	void setWalt(float walt){walt_ = walt;};
+};
+
+//! TeGTMLayers class with images informations.
+/*!
+	Not implemented yet
+	Attributes used
+	index - Integer Layer index
+	name - String Layer name
+	color - Long Layer color
+	lock - Byte Flag – Layer lock
+	view - Byte Flag – layer visible
+	reserva1 - Byte Reservation
+	reserva2 - Integer Reservation
+	\author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTMLayers
+{
+private:
+	short index_, reserva2_;
+	char* name_;
+	long color_;
+	unsigned char lock_, view_, reserva1_;
+public:
+	//! Constructor
+	TeGTMLayers();
+
+	//! Destructor
+	~TeGTMLayers();
+
+	//! Layers reader
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void readGTMLayers(FILE* file);
+	//! Layers writer
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be exported.
+    */
+	void writerGTMLayers(FILE* file);
+
+	//! index_ attribute Getter
+	short getIndex(){return index_;};
+	//! index_ attribute Setter
+    /*!
+      \param index.
+    */
+	void setIndex(short index){index_ = index;};
+
+	//! reserva2_ attribute Getter
+	short getReserva2(){return reserva2_;};
+	//! reserva2_ attribute Setter
+    /*!
+      \param reserva2.
+    */
+	void setReserva2(short reserva2){reserva2_ = reserva2;};
+
+	//! name_ attribute Getter
+	char* getName(){return name_;};
+	//! name_ attribute Setter
+    /*!
+      \param name.
+    */
+	void setName(char* name){name_ = name;};
+
+	//! color_ attribute Getter
+	long getColor(){return color_;};
+	//! color_ attribute Setter
+    /*!
+      \param color.
+    */
+	void setColor(long color){color_ = color;};
+
+	//! lock_ attribute Getter
+	unsigned char getLock(){return lock_;};
+	//! lock_ attribute Setter
+    /*!
+      \param lock.
+    */
+	void setLock(unsigned char lock){lock_ = lock;};
+	
+	//! view_ attribute Getter
+	unsigned char getView(){return view_;};
+	//! view_ attribute Setter
+    /*!
+      \param view.
+    */
+	void setView(unsigned char view){view_ = view;};
+
+	//! reserva1_ attribute Getter
+	unsigned char getReserva1(){return reserva1_;};
+	//! reserva1_ attribute Setter
+    /*!
+      \param reserva1.
+    */
+	void setReserva1(unsigned char reserva1){reserva1_ = reserva1;};
+};
+
+//! TeGTMUserIcons class with images informations.
+/*!
+	Not implemented yet
+	Attributes used
+	name - Double Name of user icor
+	number - Double Number of user icon
+	size - String *10 Size of the image of icon
+	\author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTMUserIcons
+{
+private:
+	char* name_;
+	unsigned char number_;
+	long size_;
+public:
+	//! Constructor
+	TeGTMUserIcons();
+
+	//! Destructor
+	~TeGTMUserIcons();
+
+	//! User icons reader
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be imported.
+    */
+	void readGTMUserIcons(FILE* file);
+
+	//! User icons writer
+    /*!
+      \param file pointer to a FILE* with the .gtm file to be exported.
+    */
+	void writeGTMUserIcons(FILE* file);
+
+	//! name_ attribute Getter
+	char* getName(){return name_;};
+
+	//! name_ attribute Setter
+    /*!
+      \param name.
+    */
+	void setName(char* name){name_ = name;};
+
+	//! number_ attribute Getter
+	unsigned char getNumber(){return number_;};
+
+	//! number_ attribute Setter
+    /*!
+      \param number.
+    */
+	void setNumber(unsigned char number){number_ = number;};
+
+	//! size_ attribute Getter
+	long getSize(){return size_;};
+
+	//! size_ attribute Setter
+    /*!
+      \param size.
+    */
+	void setSize(long size){size_ = size;};
+};
+
+//! TeGTM .gtm files driver class.
+/*!
+	This class contains the implementation of common methods for TerraLib access .gtm files.   
+    For further information about the GTM file format access http://www.gpstm.com/download/GTM211_format.pdf
+    \author Luiz Claudio Oliveira de Andrade <lcoandrade at gmail.com>    
+ */	
+class TDKEB_DGNIMPORT_API TeGTM
+{
+private:
+	TeGTMHeader header_;
+	TeGTMGridDatum griddatum_;
+	vector<TeGTMInformationImages*> informationimages_;
+	vector<TeGTMWaypoints*> waypoints_;
+	vector<TeGTMWaypointsStyles*> waypointsstyles_;
+	vector<TeGTMTrackLogs*> tracklogs_;
+	vector<TeGTMTrackLogStyles*> tracklogstyles_;
+	vector<TeGTMRoutes*> routes_;
+	vector<TeGTMUserIcons*> usericons_;
+	vector<TeGTMLayers*> layers_;
+	std::string layersNames_;
+
+	std::map<std::string, std::vector<TePoint> > waypointsLayer;
+	std::map<std::string, std::vector<TePoint> > tracklogsLayer;
+	std::map<std::string, std::vector<TePoint> > routesLayer;
+	std::map<std::string, std::vector<char*> > imagesLayer;
+
+	TeTable waypointTable_;
+	TeTable tracklogTable_;
+	TeTable routeTable_;
+
+	FILE* file_;
+
+	std::vector<char*> icon_descr;
+
+public:
+	//! Constructor
+	TeGTM(FILE* file);
+
+	//! Destructor
+	~TeGTM();
+
+	//! GTM file reader
+	void readGTM();
+
+	//! GTM file writer
+	void writeGTM();
+
+	//! TeProjection attribute Getter
+	TeProjection* getProjection();
+
+	//! TeProjection attribute Setter
+    /*!
+      \param proj - projection to be set.
+    */
+	TeProjection* setProjection(TeProjection* proj);
+
+	//! TeDatum attribute Getter
+	TeDatum getDatum();
+
+	//! TeDatum attribute Setter
+    /*!
+      \param datum.
+    */
+	short setDatum(TeDatum datum);
+
+	//! Layer names Getter
+	std::string getLayerNames(std::string fileName);
+
+	//! Returns the date string calculated with the date(Number of seconds since 31-Dec-1989).
+	std::string getDate(long date);
+
+	//! GTM importer,  converts de GTM loaded in memory to TeDatabase
+    /*!
+      \param db - Database used
+	  \param fileName - GTM file name
+    */
+	std::vector<TeLayer*> importGTM(TeDatabase *db, std::string fileName);
+
+	//! GTM exporter,  converts TeTheme into a GTM file
+    /*!
+      \param theme - TeTheme to be exported
+    */
+	void exportGTM(TeTheme *theme, std::string fileName, FILE* file);
+
+	//! Creates the attribute list used by the waypoints
+    /*!
+      \param attList - List of columns attributes
+    */
+	void waypointAttributeList(TeAttributeList& attList);
+
+	//! Creates the attribute list used by the waypoints
+    /*!
+      \param attList - List of columns attributes
+    */
+	void tracklogAttributeList(TeAttributeList& attList);
+
+	//! Creates the attribute list used by the waypoints
+    /*!
+      \param attList - List of columns attributes
+    */
+	void routeAttributeList(TeAttributeList& attList);
+
+	//! Waypoint importer
+    /*!
+      \param layer - Layer created to receive the data
+	  \param attrTableName - Name of the attribute table
+	  \param objectIdAtt - colum used as link
+	  \param chunkSize - Size used to save transactions(set to 100)
+    */
+	bool importWaypoints(TeLayer* layer, string attrTableName,string objectIdAtt,int unsigned chunkSize );
+
+	//! Tracklog importer (TePOINTS)
+    /*!
+      \param layer - Layer created to receive the data
+	  \param attrTableName - Name of the attribute table
+	  \param objectIdAtt - colum used as link
+	  \param chunkSize - Size used to save transactions(set to 100)
+    */
+	bool importTracklogs(TeLayer* layer, string attrTableName,string objectIdAtt,int unsigned chunkSize );
+
+	//! Tracklog importer (TeLINES)
+    /*!
+      \param layer - Layer created to receive the data
+	  \param attrTableName - Name of the attribute table
+	  \param objectIdAtt - colum used as link
+	  \param chunkSize - Size used to save transactions(set to 100)
+    */
+	bool importTracklogs2(TeLayer* layer, string attrTableName,string objectIdAtt,int unsigned chunkSize );
+
+	//! Routes importer (TePOINTS)
+    /*!
+      \param layer - Layer created to receive the data
+	  \param attrTableName - Name of the attribute table
+	  \param objectIdAtt - colum used as link
+	  \param chunkSize - Size used to save transactions(set to 100)
+    */
+	bool importRoutes(TeLayer* layer, string attrTableName,string objectIdAtt,int unsigned chunkSize );
+
+	//! Routes importer (TeLINES)
+    /*!
+      \param layer - Layer created to receive the data
+	  \param attrTableName - Name of the attribute table
+	  \param objectIdAtt - colum used as link
+	  \param chunkSize - Size used to save transactions(set to 100)
+    */
+	bool importRoutes2(TeLayer* layer, string attrTableName,string objectIdAtt,int unsigned chunkSize );
+
+	//! Images importer
+    /*!
+      \param layer - Layer created to receive the data
+	  \param attrTableName - Name of the attribute table
+	  \param objectIdAtt - colum used as link
+	  \param chunkSize - Size used to save transactions(set to 100)
+    */
+	int importImages(TeLayer* layer);
+
+	//! Create the attribute table used by the importGTM method
+    /*!
+      \param layer - Layer created to receive the data
+	  \param attList - List of columns attributes
+	  \param attrTableName - Name of the attribute table
+	  \param objectIdAtt - colum used as link
+	  \param oldPrec - layer precision
+	  \param linkCol - colum id used as link
+    */
+	bool createAttributeTable(TeLayer* layer, TeAttributeList attList, std::string attrTableName, std::string objectIdAtt, 
+								double oldPrec, int& linkCol);
+};
+
+#endif
\ No newline at end of file
diff --git a/src/terralib/drivers/MrSID/TeDecoderMrSID.cpp b/src/terralib/drivers/MrSID/TeDecoderMrSID.cpp
old mode 100755
new mode 100644
index 1ca448f..b600195
--- a/src/terralib/drivers/MrSID/TeDecoderMrSID.cpp
+++ b/src/terralib/drivers/MrSID/TeDecoderMrSID.cpp
@@ -1,263 +1,263 @@
-#include "TeDecoderMrSID.h"
-#include "TeMrSID.h"
-#include "TeDecoderMemory.h"
-#include "TeVectorRemap.h"
-#include "TeAsciiFile.h"
-#include "TeGeometryAlgorithms.h"
-
-
-
-TeDecoderMrSID::TeDecoderMrSID(const TeRasterParams& par) :
-	TeDecoder(par),
-	mrsid_(0),
-	nSelectedBlocks_(0)
-{
-	params_ = par; 
-	params_.decoderIdentifier_= "MrSID";
-	params_.mode_ = 'r';
-	mrsid_ = new TeMrSIDReader(par.fileName_.c_str());
-	if (mrsid_)
-	{
-		params_.nBands(mrsid_->nBands());
-		unsigned int w, h;
-		mrsid_->getDimensions(w,h);
-		params_.ncols_=w; params_.nlines_=h;
-		vector<double> vv;
-		mrsid_->getNavigationParameters(vv);
-		params_.setNavigationParameters(vv);
-		params_.projection(readProjection());
-		params_.setDataType(TeUNSIGNEDCHAR);
-		if(mrsid_->getColorModel() == TeMrSIDReader::ColorModelRGB)
-			params_.setPhotometric(TeRasterParams::TeRGB);
-		else
-			params_.setPhotometric(TeRasterParams::TeMultiBand);
-	    readMetadataInformation();
-	}
-}
-
-TeDecoderMrSID::TeDecoderMrSID(const std::string& fname):
-	mrsid_(0),
-	nSelectedBlocks_(0)
-{
-	params_.fileName_ = fname;
-	params_.mode_ = 'r';
-	params_.decoderIdentifier_= "MrSID";
-	mrsid_ = new TeMrSIDReader(fname.c_str());
-	if (mrsid_)
-	{
-		params_.nBands(mrsid_->nBands());
-		unsigned int w, h;
-		mrsid_->getDimensions(w,h);
-		params_.ncols_=w; params_.nlines_=h;
-		vector<double> vv;
-		mrsid_->getNavigationParameters(vv);
-		params_.setNavigationParameters(vv);
-		params_.setDataType(TeUNSIGNEDCHAR);
-		if(mrsid_->getColorModel() == TeMrSIDReader::ColorModelRGB)
-			params_.setPhotometric(TeRasterParams::TeRGB);
-		else
-			params_.setPhotometric(TeRasterParams::TeMultiBand);
-	    readMetadataInformation();
-	}
-}
-
-TeDecoderMrSID::~TeDecoderMrSID()
-{
-	clear();
-	if (mrsid_)
-	{
-		delete mrsid_;
-		mrsid_ = 0;
-	}
-}
-
-void TeDecoderMrSID::init()
-{
-	clear();
-	params_.status_= TeRasterParams::TeNotReady;
-
-	if (params_.mode_ == 'r') // only use of this decoder....	
-	{
-		params_.status_ = TeRasterParams::TeReadyToRead;
-		if (mrsid_)
-		{
-			if (mrsid_->fileName().empty() || mrsid_->fileName() != params_.fileName_)
-			{
-				delete mrsid_;
-				mrsid_ = 0;
-			}
-		}
-		if (!mrsid_)
-		{
-			try
-			{
-				params_.nBands(mrsid_->nBands());
-				unsigned int w, h;
-				mrsid_->getDimensions(w,h);
-				params_.ncols_=w; params_.nlines_=h;
-				vector<double> vv;
-				mrsid_->getNavigationParameters(vv);
-				params_.setNavigationParameters(vv);
-				params_.setDataType(TeUNSIGNEDCHAR);
-				if(mrsid_->getColorModel() == TeMrSIDReader::ColorModelRGB)
-					params_.setPhotometric(TeRasterParams::TeRGB);
-				else
-					params_.setPhotometric(TeRasterParams::TeMultiBand);
-				readMetadataInformation();
-			}
-			catch(...)
-			{
-				return;
-			}
-		}
-		params_.status_= TeRasterParams::TeReadyToRead;
-	}
-	return;
-}
-
-void
-TeDecoderMrSID::readMetadataInformation()
-{
-	if (!mrsid_)
-		return;
-
-	int i=0;
-	vector<double> aux;
-	if (mrsid_->getNoDataPixel(aux))
-	{
-		for (i=0; i<params_.nBands(); ++i)
-			params_.setDummy(aux[i],i);
-	}
-	if (mrsid_->getMaxValues(aux))
-	{
-		for (i=0; i<params_.nBands(); ++i)
-			params_.vmax_[i] = aux[i];
-	}
-	if (mrsid_->getMinValues(aux))
-	{
-		for (i=0; i<params_.nBands(); ++i)
-			params_.vmin_[i] = aux[i];
-	}
-}
-
-TeProjection* 
-TeDecoderMrSID::readProjection()
-{
-	TeProjection* proj = 0;
-	try
-	{
-		string projFile = TeGetName(params_.fileName_.c_str()) + ".prj";
-		TeAsciiFile	pFile (projFile);
-		string name;
-		string pname, dname;
-		int zone;
-		TeProjectionParams projPar;
-		while (pFile.isNotAtEOF())
-		{
-			name = pFile.readString();
-			if (name == "Projection")
-			{
-				pname = pFile.readString();
-			}	
-			else if (name == "Datum")
-			{
-				name = pFile.readString();
-				if (name == "SOUTH_AMERICAN_1969")
-					dname = "SAD69";
-				if (name == "WGS84")
-					dname = "WGS84";
-
-			}
-			else if (name == "Zone")
-			{
-				zone = pFile.readInt();
-			}
-		}
-		if (pname == "UTM" && (dname == "SAD69" || "WGS84"))
-		{
-			TeDatum d = TeDatumFactory::make(dname);
-			proj = new TeUtm(d,zone*TeCDR);
-		}
-	}
-	catch(...)
-	{
-	}
-	if (!proj)
-		proj = new TeNoProjection();
-	return proj;
-}
-
-bool 
-TeDecoderMrSID::clear()
-{
-	nSelectedBlocks_ = 0;
-	params_.status_= TeRasterParams::TeNotReady;
-	return true;
-}
-
-int 
-TeDecoderMrSID::bestResolution(double res)
-{
-	return mrsid_->bestResolution(res);
-}
-
-
-int 
-TeDecoderMrSID::bestResolution(TeBox& bb, int ncols, int nlines, TeProjection* proj)
-{
-	TeBox box = bb;
-	if (proj)
-		box = TeRemapBox(bb, proj, params_.projection());
-	return (mrsid_->getWorstResolutionLevel(ncols, nlines, bb.x1(), bb.y2(), bb.x2(), bb.y1()));
-}
-
-
-bool TeDecoderMrSID::selectBlocks(TeBox& bbox, int resLevel, TeRasterParams& parBlock) 
-{
-	// check if desired resolution level is between the range of available levels
-	if (resLevel < 0 || resLevel >= mrsid_->getNumLevels())
-		return false;
-
-	nSelectedBlocks_ = 0;
-	// calculates width and height of the selected area
-
-	double x1 = bbox.x1_;
-	double y1 = bbox.y1_;
-	double x2 = bbox.x2_;
-	double y2 = bbox.y2_;
-
-	if (!mrsid_->selectArea(resLevel,x1,y1,x2,y2))
-		return false;
-
-	params_.blockWidth_ = mrsid_->getSelectedAreaWidth();
-	params_.blockHeight_ = mrsid_->getSelectedAreaHeight();
-
-	// defines parameters of the selected block
-	nSelectedBlocks_ = 1;			// always select only one block
-	parBlock = params_;
-	parBlock.boundingBoxLinesColumns(x1,y1,x2,y2,params_.blockHeight_,params_.blockWidth_);
-	parBlock.interleaving_ = TeRasterParams::TePerBand;
-	return true;
-}
-
-bool TeDecoderMrSID::getSelectedRasterBlock(TeDecoderMemory* memDec) 
-{
-  if (!mrsid_ || nSelectedBlocks_ <= 0)
-	  return false;
-  unsigned char* data = (unsigned char*) memDec->data(0);
-  bool res = mrsid_->getSelectedAreaData(data);
-  nSelectedBlocks_--;
-  return res;
-}
-
-void 
-TeDecoderMrSID::clearBlockSelection()
-{	
-	nSelectedBlocks_ = 0;	
-}
-
-TeDecoderMrSIDFactory::TeDecoderMrSIDFactory(const string& name): 
-	TeDecoderFactory(name) 
-{
-	TeDecoderFactory::instanceName2Dec()["SID"]  = "MrSID";	
+#include "TeDecoderMrSID.h"
+#include "TeMrSID.h"
+#include "TeDecoderMemory.h"
+#include "TeVectorRemap.h"
+#include "TeAsciiFile.h"
+#include "TeGeometryAlgorithms.h"
+
+
+
+TeDecoderMrSID::TeDecoderMrSID(const TeRasterParams& par) :
+	TeDecoder(par),
+	mrsid_(0),
+	nSelectedBlocks_(0)
+{
+	params_ = par; 
+	params_.decoderIdentifier_= "MrSID";
+	params_.mode_ = 'r';
+	mrsid_ = new TeMrSIDReader(par.fileName_.c_str());
+	if (mrsid_)
+	{
+		params_.nBands(mrsid_->nBands());
+		unsigned int w, h;
+		mrsid_->getDimensions(w,h);
+		params_.ncols_=w; params_.nlines_=h;
+		vector<double> vv;
+		mrsid_->getNavigationParameters(vv);
+		params_.setNavigationParameters(vv);
+		params_.projection(readProjection());
+		params_.setDataType(TeUNSIGNEDCHAR);
+		if(mrsid_->getColorModel() == TeMrSIDReader::ColorModelRGB)
+			params_.setPhotometric(TeRasterParams::TeRGB);
+		else
+			params_.setPhotometric(TeRasterParams::TeMultiBand);
+	    readMetadataInformation();
+	}
+}
+
+TeDecoderMrSID::TeDecoderMrSID(const std::string& fname):
+	mrsid_(0),
+	nSelectedBlocks_(0)
+{
+	params_.fileName_ = fname;
+	params_.mode_ = 'r';
+	params_.decoderIdentifier_= "MrSID";
+	mrsid_ = new TeMrSIDReader(fname.c_str());
+	if (mrsid_)
+	{
+		params_.nBands(mrsid_->nBands());
+		unsigned int w, h;
+		mrsid_->getDimensions(w,h);
+		params_.ncols_=w; params_.nlines_=h;
+		vector<double> vv;
+		mrsid_->getNavigationParameters(vv);
+		params_.setNavigationParameters(vv);
+		params_.setDataType(TeUNSIGNEDCHAR);
+		if(mrsid_->getColorModel() == TeMrSIDReader::ColorModelRGB)
+			params_.setPhotometric(TeRasterParams::TeRGB);
+		else
+			params_.setPhotometric(TeRasterParams::TeMultiBand);
+	    readMetadataInformation();
+	}
+}
+
+TeDecoderMrSID::~TeDecoderMrSID()
+{
+	clear();
+	if (mrsid_)
+	{
+		delete mrsid_;
+		mrsid_ = 0;
+	}
+}
+
+void TeDecoderMrSID::init()
+{
+	clear();
+	params_.status_= TeRasterParams::TeNotReady;
+
+	if (params_.mode_ == 'r') // only use of this decoder....	
+	{
+		params_.status_ = TeRasterParams::TeReadyToRead;
+		if (mrsid_)
+		{
+			if (mrsid_->fileName().empty() || mrsid_->fileName() != params_.fileName_)
+			{
+				delete mrsid_;
+				mrsid_ = 0;
+			}
+		}
+		if (!mrsid_)
+		{
+			try
+			{
+				params_.nBands(mrsid_->nBands());
+				unsigned int w, h;
+				mrsid_->getDimensions(w,h);
+				params_.ncols_=w; params_.nlines_=h;
+				vector<double> vv;
+				mrsid_->getNavigationParameters(vv);
+				params_.setNavigationParameters(vv);
+				params_.setDataType(TeUNSIGNEDCHAR);
+				if(mrsid_->getColorModel() == TeMrSIDReader::ColorModelRGB)
+					params_.setPhotometric(TeRasterParams::TeRGB);
+				else
+					params_.setPhotometric(TeRasterParams::TeMultiBand);
+				readMetadataInformation();
+			}
+			catch(...)
+			{
+				return;
+			}
+		}
+		params_.status_= TeRasterParams::TeReadyToRead;
+	}
+	return;
+}
+
+void
+TeDecoderMrSID::readMetadataInformation()
+{
+	if (!mrsid_)
+		return;
+
+	int i=0;
+	vector<double> aux;
+	if (mrsid_->getNoDataPixel(aux))
+	{
+		for (i=0; i<params_.nBands(); ++i)
+			params_.setDummy(aux[i],i);
+	}
+	if (mrsid_->getMaxValues(aux))
+	{
+		for (i=0; i<params_.nBands(); ++i)
+			params_.vmax_[i] = aux[i];
+	}
+	if (mrsid_->getMinValues(aux))
+	{
+		for (i=0; i<params_.nBands(); ++i)
+			params_.vmin_[i] = aux[i];
+	}
+}
+
+TeProjection* 
+TeDecoderMrSID::readProjection()
+{
+	TeProjection* proj = 0;
+	try
+	{
+		string projFile = TeGetName(params_.fileName_.c_str()) + ".prj";
+		TeAsciiFile	pFile (projFile);
+		string name;
+		string pname, dname;
+		int zone;
+		TeProjectionParams projPar;
+		while (pFile.isNotAtEOF())
+		{
+			name = pFile.readString();
+			if (name == "Projection")
+			{
+				pname = pFile.readString();
+			}	
+			else if (name == "Datum")
+			{
+				name = pFile.readString();
+				if (name == "SOUTH_AMERICAN_1969")
+					dname = "SAD69";
+				if (name == "WGS84")
+					dname = "WGS84";
+
+			}
+			else if (name == "Zone")
+			{
+				zone = pFile.readInt();
+			}
+		}
+		if (pname == "UTM" && (dname == "SAD69" || "WGS84"))
+		{
+			TeDatum d = TeDatumFactory::make(dname);
+			proj = new TeUtm(d,zone*TeCDR);
+		}
+	}
+	catch(...)
+	{
+	}
+	if (!proj)
+		proj = new TeNoProjection();
+	return proj;
+}
+
+bool 
+TeDecoderMrSID::clear()
+{
+	nSelectedBlocks_ = 0;
+	params_.status_= TeRasterParams::TeNotReady;
+	return true;
+}
+
+int 
+TeDecoderMrSID::bestResolution(double res)
+{
+	return mrsid_->bestResolution(res);
+}
+
+
+int 
+TeDecoderMrSID::bestResolution(TeBox& bb, int ncols, int nlines, TeProjection* proj)
+{
+	TeBox box = bb;
+	if (proj)
+		box = TeRemapBox(bb, proj, params_.projection());
+	return (mrsid_->getWorstResolutionLevel(ncols, nlines, bb.x1(), bb.y2(), bb.x2(), bb.y1()));
+}
+
+
+bool TeDecoderMrSID::selectBlocks(TeBox& bbox, int resLevel, TeRasterParams& parBlock) 
+{
+	// check if desired resolution level is between the range of available levels
+	if (resLevel < 0 || resLevel >= mrsid_->getNumLevels())
+		return false;
+
+	nSelectedBlocks_ = 0;
+	// calculates width and height of the selected area
+
+	double x1 = bbox.x1_;
+	double y1 = bbox.y1_;
+	double x2 = bbox.x2_;
+	double y2 = bbox.y2_;
+
+	if (!mrsid_->selectArea(resLevel,x1,y1,x2,y2))
+		return false;
+
+	params_.blockWidth_ = mrsid_->getSelectedAreaWidth();
+	params_.blockHeight_ = mrsid_->getSelectedAreaHeight();
+
+	// defines parameters of the selected block
+	nSelectedBlocks_ = 1;			// always select only one block
+	parBlock = params_;
+	parBlock.boundingBoxLinesColumns(x1,y1,x2,y2,params_.blockHeight_,params_.blockWidth_);
+	parBlock.interleaving_ = TeRasterParams::TePerBand;
+	return true;
+}
+
+bool TeDecoderMrSID::getSelectedRasterBlock(TeDecoderMemory* memDec) 
+{
+  if (!mrsid_ || nSelectedBlocks_ <= 0)
+	  return false;
+  unsigned char* data = (unsigned char*) memDec->data(0);
+  bool res = mrsid_->getSelectedAreaData(data);
+  nSelectedBlocks_--;
+  return res;
+}
+
+void 
+TeDecoderMrSID::clearBlockSelection()
+{	
+	nSelectedBlocks_ = 0;	
+}
+
+TeDecoderMrSIDFactory::TeDecoderMrSIDFactory(const string& name): 
+	TeDecoderFactory(name) 
+{
+	TeDecoderFactory::instanceName2Dec()["SID"]  = "MrSID";	
 }
\ No newline at end of file
diff --git a/src/terralib/drivers/MrSID/TeDecoderMrSID.h b/src/terralib/drivers/MrSID/TeDecoderMrSID.h
old mode 100755
new mode 100644
index e9033f9..1732415
--- a/src/terralib/drivers/MrSID/TeDecoderMrSID.h
+++ b/src/terralib/drivers/MrSID/TeDecoderMrSID.h
@@ -1,145 +1,145 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderMrSID.h
-    This file deals with decoding of images in MrSID Format
-*/
-#ifndef  __TERRALIB_INTERNAL_DECODERMRSID_H
-#define  __TERRALIB_INTERNAL_DECODERMRSID_H
-
-#include "TeDecoder.h"
-#include "TeMrSID.h"
-
-//! The TeMrSID decoder is a driver to decode images on the MrSID format.
-/*	
-	This class depends on the SDK provided by LizardTech, available at the
-	website <www.lizardtech.com.br>. You should include this file in your
-	final application and link it against the SDK libraries. \par
-	This decoder provides only decoding capacities. It is not possible
-	to codifiy images in MrSID format. \par
-	The default file extension associated to this decoder is ".sid".
-*/
-class TeDecoderMrSID : public TeDecoder
-{
-public:
-
-	//! Constructor from parameters
-	TeDecoderMrSID(const TeRasterParams& par);
-
-	//! Constructor from file name
-	TeDecoderMrSID(const std::string& fname);
-
-	//! Destructor
-	~TeDecoderMrSID();
-
-	//! Initalizes internal structures to make decoder able to read MrSID images
-	void init();
-
-	//! Releases internal structures and invalidates MrSID decoder
-	bool clear();
-
-	//! Provided for compatibility reasons only, this decoder can not encode data
-	bool setElement(int /*col*/, int /*lin*/, double /*val*/, int /*band=0*/) 
-	{ return false; }
-
-	//! Gets the value of an specific element (col, lin, band) of a raster data
-	/*!
-		\param col pixel column identifier
-		\param lin pixel line identifier
-		\param val pixel value being retrieved
-		\param band pixel band identifier
-	*/
-	bool getElement(int /*col*/, int /*lin*/, double& /*val*/, int /*band=0*/)
-	{ return false; }
-
-	//! Returns the best resolution level in a MrSID image to cover a paricular area
-	/* 
-		\param bb bounding box geographical coordinates of the area to be covered
-		\param ncols number of columns of the area
-		\param nlines number of lines of the area
-		\param proj projection of the geographical coordinates
-		\returns A resolution level available in the MrSID files
-		\note Resolution level in decoder MrSid is a level in a multi-resolution pyramid
-		stored in the format. Original resolution has value 0 and following higher
-		levels assume integer values (1,2,3,4...)
-	*/	
-	int bestResolution(TeBox& bb, int ncols, int nlines, TeProjection* proj);
-
-	//! Selects a portion of a MrSID image in a certain resolution level 
-	/*
-		\param bb bounding box (in geographical coordinates) of that area to be selected 
-		\param the resolution level desired
-		\param parBlock returns the parameters of the portion selected
-		\returns TRUE if could select the portion and FALSE otherwise
-		\note MrSID navigator will be bounded to the given resolution level
-	*/
-	bool selectBlocks(TeBox& bbox, int resLevel, TeRasterParams& parBlock);
-
-	//! Returns the contents of a portion of image previously selected
-	/*
-		\param memDec a pointer to a decoder to a raster in memory. This decoder
-		should be previously initialized
-	*/
-	bool getSelectedRasterBlock(TeDecoderMemory* memDec);
-
-	//! Returns the number of blocks selected by the latest selection
-	int numberOfSelectedBlocks() 
-	{	return nSelectedBlocks_; }
-
-	//! Reset block selection. Returns navigator to the original resolution level
-	void clearBlockSelection();
-
-	//! Returns the raster resolution level available that is more similiar to a given desired resolution
-	int bestResolution(double res);
-
-
-private:
-	// Methods
-	TeDecoderMrSID();  
-	TeProjection* readProjection();
-	void readMetadataInformation();
-
-
-	// Members
-	TeMrSIDReader* mrsid_;
-	int nSelectedBlocks_;
-};
-
-//! Implements a factory to build MrSID decoders
-class TeDecoderMrSIDFactory : public TeDecoderFactory
-{
-public:
-	//! Factory constructor
-	TeDecoderMrSIDFactory(const string& name);
-
-	//! Builds the object
-	TeDecoder* build (const TeRasterParams& arg)
-	{  return new TeDecoderMrSID(arg); }
-};
-
-//! Creates a static factory to build MrSID decoders 
-namespace 
-{
-	//! A static factory to build MrSID decoders 
-	static TeDecoderMrSIDFactory theDecoderMrSIDFactory("MrSID");
-};
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderMrSID.h
+    This file deals with decoding of images in MrSID Format
+*/
+#ifndef  __TERRALIB_INTERNAL_DECODERMRSID_H
+#define  __TERRALIB_INTERNAL_DECODERMRSID_H
+
+#include "TeDecoder.h"
+#include "TeMrSID.h"
+
+//! The TeMrSID decoder is a driver to decode images on the MrSID format.
+/*	
+	This class depends on the SDK provided by LizardTech, available at the
+	website <www.lizardtech.com.br>. You should include this file in your
+	final application and link it against the SDK libraries. \par
+	This decoder provides only decoding capacities. It is not possible
+	to codifiy images in MrSID format. \par
+	The default file extension associated to this decoder is ".sid".
+*/
+class TeDecoderMrSID : public TeDecoder
+{
+public:
+
+	//! Constructor from parameters
+	TeDecoderMrSID(const TeRasterParams& par);
+
+	//! Constructor from file name
+	TeDecoderMrSID(const std::string& fname);
+
+	//! Destructor
+	~TeDecoderMrSID();
+
+	//! Initalizes internal structures to make decoder able to read MrSID images
+	void init();
+
+	//! Releases internal structures and invalidates MrSID decoder
+	bool clear();
+
+	//! Provided for compatibility reasons only, this decoder can not encode data
+	bool setElement(int /*col*/, int /*lin*/, double /*val*/, int /*band=0*/) 
+	{ return false; }
+
+	//! Gets the value of an specific element (col, lin, band) of a raster data
+	/*!
+		\param col pixel column identifier
+		\param lin pixel line identifier
+		\param val pixel value being retrieved
+		\param band pixel band identifier
+	*/
+	bool getElement(int /*col*/, int /*lin*/, double& /*val*/, int /*band=0*/)
+	{ return false; }
+
+	//! Returns the best resolution level in a MrSID image to cover a paricular area
+	/* 
+		\param bb bounding box geographical coordinates of the area to be covered
+		\param ncols number of columns of the area
+		\param nlines number of lines of the area
+		\param proj projection of the geographical coordinates
+		\returns A resolution level available in the MrSID files
+		\note Resolution level in decoder MrSid is a level in a multi-resolution pyramid
+		stored in the format. Original resolution has value 0 and following higher
+		levels assume integer values (1,2,3,4...)
+	*/	
+	int bestResolution(TeBox& bb, int ncols, int nlines, TeProjection* proj);
+
+	//! Selects a portion of a MrSID image in a certain resolution level 
+	/*
+		\param bb bounding box (in geographical coordinates) of that area to be selected 
+		\param the resolution level desired
+		\param parBlock returns the parameters of the portion selected
+		\returns TRUE if could select the portion and FALSE otherwise
+		\note MrSID navigator will be bounded to the given resolution level
+	*/
+	bool selectBlocks(TeBox& bbox, int resLevel, TeRasterParams& parBlock);
+
+	//! Returns the contents of a portion of image previously selected
+	/*
+		\param memDec a pointer to a decoder to a raster in memory. This decoder
+		should be previously initialized
+	*/
+	bool getSelectedRasterBlock(TeDecoderMemory* memDec);
+
+	//! Returns the number of blocks selected by the latest selection
+	int numberOfSelectedBlocks() 
+	{	return nSelectedBlocks_; }
+
+	//! Reset block selection. Returns navigator to the original resolution level
+	void clearBlockSelection();
+
+	//! Returns the raster resolution level available that is more similiar to a given desired resolution
+	int bestResolution(double res);
+
+
+private:
+	// Methods
+	TeDecoderMrSID();  
+	TeProjection* readProjection();
+	void readMetadataInformation();
+
+
+	// Members
+	TeMrSIDReader* mrsid_;
+	int nSelectedBlocks_;
+};
+
+//! Implements a factory to build MrSID decoders
+class TeDecoderMrSIDFactory : public TeDecoderFactory
+{
+public:
+	//! Factory constructor
+	TeDecoderMrSIDFactory(const string& name);
+
+	//! Builds the object
+	TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeDecoderMrSID(arg); }
+};
+
+//! Creates a static factory to build MrSID decoders 
+namespace 
+{
+	//! A static factory to build MrSID decoders 
+	static TeDecoderMrSIDFactory theDecoderMrSIDFactory("MrSID");
+};
+#endif
diff --git a/src/terralib/drivers/MrSID/TeMrSID.cpp b/src/terralib/drivers/MrSID/TeMrSID.cpp
old mode 100755
new mode 100644
index 79a8558..507d78a
--- a/src/terralib/drivers/MrSID/TeMrSID.cpp
+++ b/src/terralib/drivers/MrSID/TeMrSID.cpp
@@ -1,560 +1,560 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2006 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include "TeMrSID.h"
-
-#include <lt_fileSpec.h>
-#include <MrSIDImageReader.h>
-#include <lti_navigator.h>
-#include <lti_sceneBuffer.h>
-#include <lti_pixel.h>
-#include <lti_utils.h>
-
-#include <locale.h>
-#include <math.h>
-#include <stdio.h>
-
-LT_USE_NAMESPACE(LizardTech)
-
-// Static variables initialization:
-
-bool TeMrSIDReader::mrsid_initialized = false;
-
-/*
-** ---------------------------------------------------------------
-** Methods Implementation:
-*/
-
-TeMrSIDReader::TeMrSIDReader(const std::string& fname):
-	fileName_(fname)
-{
-	LT_STATUS sts = LT_STS_Uninit;
-
-	if(!mrsid_initialized)
-	{
-		setlocale(LC_ALL,"English");
-		//ATENCAO - Verificar se isso funciona quando a configuracao do Windows for em Portugues.
-		//    XTrans::initialize();      
-		mrsid_initialized = true;
-	}
-	const LTFileSpec filespec(fname.c_str());
-	sidImageFile_ = new MrSIDImageReader(filespec);
-	sts = sidImageFile_->initialize();
-	if(!LT_SUCCESS(sts))
-		throw "Erro lendo MrSID";
-	sidNav_ = new LTINavigator(*sidImageFile_);
-};
-
-TeMrSIDReader::~TeMrSIDReader()
-{
-//	if(sidImageFile_) delete sidImageFile_;
-	if(sidNav_) delete sidNav_;
-}
-
-int TeMrSIDReader::nBands() const
-{
-	return sidImageFile_->getNumBands();
-}
-
-unsigned int TeMrSIDReader::bitsPerPixel() const
-{
-	return sidImageFile_->getPixelProps ().getNumBytes() * 8;
-}
-
-TeMrSIDReader::ColorModel TeMrSIDReader::getColorModel()
-{
-	LTIColorSpace color_space = sidImageFile_->getColorSpace();
-
-	if(color_space == LTI_COLORSPACE_RGB)
-		return ColorModelRGB;
-	else if(color_space == LTI_COLORSPACE_GRAYSCALE)
-		return ColorModelGray;
-	else
-		return ColorModelUnknown;
-}
-
-unsigned int TeMrSIDReader::getWidth()
-{
-	return sidImageFile_->getWidth();
-}
-
-unsigned int TeMrSIDReader::getHeight()
-{
-	return sidImageFile_->getHeight();
-}
-
-bool TeMrSIDReader::hasWorldInfo()
-{
-	return !(sidImageFile_->isGeoCoordImplicit());
-}
-
-double TeMrSIDReader::originX()
-{
-	return sidImageFile_->getGeoCoord().getX(); 
-}
-
-double TeMrSIDReader::originY()
-{
-	return sidImageFile_->getGeoCoord().getY();
-}
-
-double TeMrSIDReader::resX()
-{
-  return sidImageFile_->getGeoCoord().getXRes();
-}
-
-double TeMrSIDReader::resY()
-{
-	return sidImageFile_->getGeoCoord().getYRes();
-}
-
-void TeMrSIDReader::getWorld(double& x0, double& y0, double& x1, double& y1)
-{
-	unsigned int w, h;
-	getOrigin(x0, y0);
-	getDimensions(w, h);
-	sidImageFile_->getGeoCoord().pixelToGeo(w - 1, h - 1, 1.0, x1, y1);
-}
-
-void TeMrSIDReader::getNavigationParameters(std::vector<double>& nwf)
-{
-	const LTIGeoCoord& geo = sidImageFile_->getGeoCoord();
-	double xUL, yUL, xRes, yRes, xRot, yRot;
-	geo.get(xUL,yUL,xRes,yRes,xRot,yRot);
-	nwf.clear();
-	nwf.push_back(xRes);
-	nwf.push_back(xRot);
-	nwf.push_back(yRot);
-	nwf.push_back(yRes);
-	nwf.push_back(xUL);
-	nwf.push_back(yUL);
-	return;
-}
-
-void TeMrSIDReader::getBoundingBox(double& xmin, double& ymin, double& xmax, double& ymax)
-{
-	double sx, sy;
-	unsigned int w, h;
-	double x0, y0, x1, y1;
-
-	sx = resX();
-	sy = resY();
-
-	getOrigin(x0, y0);
-	x0-= sx * 0.5;
-	y0-= sy * 0.5;
-
-	getDimensions(w, h);
-
-	x1 = x0 + w * sx;
-	y1 = y0 + h * sy;
-
-	if(x0 < x1)
-	{
-		xmin = x0;
-		xmax = x1;
-	}
-	else
-	{
-		xmin = x1;
-		xmax = x0;
-	}
-
-	if(y0 < y1)
-	{
-		ymin = y0;
-		ymax = y1;
-	}
-	else
-	{
-		ymin = y1;
-		ymax = y0;
-	}
-}
-
-void TeMrSIDReader::world2Pixel(double wx, double wy, int& ix, int& iy)
-{
-	double px, py;
-
-	sidImageFile_->getGeoCoord().geoToPixel(wx, wy, 1.0, px, py);
-
-	ix = (int)(px + 0.5);
-	iy = (int)(py + 0.5);
-}
-
-void TeMrSIDReader::pixel2World(int ix, int iy, double& wx, double& wy)
-{
-	sidImageFile_->getGeoCoord().pixelToGeo(ix, iy, 1.0, wx, wy);
-}
-
-
-LTISceneBuffer* 
-TeMrSIDReader::getImageBuffer(unsigned int width, unsigned int height, 
-							  unsigned int nbands, unsigned char* data)
-{
-	if(data == NULL)
-		return NULL;
-
-	unsigned int size = width * height;
-	void** bands_data = (void**)calloc(nbands, sizeof(void*));
-	for(unsigned int i = 0;i < nbands;i++)
-		bands_data[i] = data + i * size;
-	return new LTISceneBuffer(sidImageFile_->getPixelProps(), width, height, bands_data);
-}
-
-int
-TeMrSIDReader::bestResolution(double res)
-{
-	double magx, magy, mag;
-
-	//compute Magnification
-	magx = fabs(1/res);
-	magy = fabs(1/res);
-
-	if(magx > magy)
-		mag = magx;
-	else
-		mag = magy;
-
-	if(mag <= sidImageFile_->getMinMagnification())
-		mag = sidImageFile_->getMinMagnification();
-	else if(mag >= sidImageFile_->getMaxMagnification())
-		mag = sidImageFile_->getMaxMagnification();
-	else if(mag < 1)
-	{
-		int imag = (int)(1.0/mag) >> 1;
-		int i;
-
-		for(i = 1;i <= imag;i = i << 1);
-		mag = 1.0/i;
-	}
-	else 
-	{
-		int imag = (int)ceil(mag);
-		int i;
-		for(i = 1;i < imag;i = i << 1);
-			mag = i;
-	}
-	return LTIUtils::magToLevel(mag);
-}
-
-int 
-TeMrSIDReader::getBestResolutionLevel(unsigned int w, unsigned int h, 
-									  double x0, double y0, double x1, double y1)
-{
-	double magx, magy, mag;
-
-	//compute Magnification
-	magx = fabs((double)w/(x1 - x0) * resX());
-	magy = fabs((double)h/(y1 - y0) * resY());
-
-	if(magx > magy)
-		mag = magx;
-	else
-		mag = magy;
-
-	if(mag <= sidImageFile_->getMinMagnification())
-		mag = sidImageFile_->getMinMagnification();
-	else if(mag >= sidImageFile_->getMaxMagnification())
-		mag = sidImageFile_->getMaxMagnification();
-	else if(mag < 1)
-	{
-		int imag = (int)(1.0/mag) >> 1;
-		int i;
-
-		for(i = 1;i <= imag;i = i << 1);
-		mag = 1.0/i;
-	}
-	else 
-	{
-		int imag = (int)ceil(mag);
-		int i;
-		for(i = 1;i < imag;i = i << 1);
-			mag = i;
-	}
-	return LTIUtils::magToLevel(mag);
-}
-
-int 
-TeMrSIDReader::getWorstResolutionLevel(unsigned int w, unsigned int h, 
-									   double x0, double y0, double x1, double y1)
-{
-	double magx, magy, mag;
-
-	//compute Magnification
-	magx = fabs((double)w/(x1 - x0) * resX());
-	magy = fabs((double)h/(y1 - y0) * resY());
-
-	if(magx < magy)
-		mag = magx;
-	else
-		mag = magy;
-
-	if(mag <= sidImageFile_->getMinMagnification())
-		mag = sidImageFile_->getMinMagnification();
-	else if(mag >= sidImageFile_->getMaxMagnification())
-		mag = sidImageFile_->getMaxMagnification();
-	else if(mag < 1)
-	{
-		int imag = (int)ceil(1.0/mag);
-		int i;
-		for(i = 1;i < imag;i = i << 1);
-			mag = 1.0/i;
-	}
-	else 
-	{
-		int imag = (int)mag >> 1;
-		int i;
-		for(i = 1;i <= imag;i = i << 1);
-		mag = i;
-	}
-	return LTIUtils::magToLevel(mag);
-}
-
-int 
-TeMrSIDReader::getProxResolutionLevel(unsigned int w, unsigned int h, 
-                                      double x0, double y0, double x1, double y1)
-{
-	double magx, magy, mag;
-
-	//compute Magnification
-	magx = fabs((double)w/(x1 - x0) * resX());
-	magy = fabs((double)h/(y1 - y0) * resY());
-
-	if(magx > magy)
-		mag = magx;
-	else
-		mag = magy;
-
-	if(mag <= sidImageFile_->getMinMagnification())
-		mag = sidImageFile_->getMinMagnification();
-	else if(mag >= sidImageFile_->getMaxMagnification())
-		mag = sidImageFile_->getMaxMagnification();
-	else if(mag < 1)
-	{
-		//    int imag = (int)(1.0/mag) >> 1;
-		int imag = (int)(1.0/mag + 0.5);
-		int i;
-		for(i = 1;i < imag;i = i << 1);
-			mag = 1.0/i;
-	}
-	else 
-	{
-		int imag = (int)ceil(mag);
-		int i;
-		for(i = 1;i < imag;i = i << 1);
-			mag = i;
-	}
-	return LTIUtils::magToLevel(mag);
-}
-
-bool 
-TeMrSIDReader::selectArea(int lev, double& x0, double& y0, double& x1, double& y1)
-{ 
-	double mag;
-	LT_STATUS sts = LT_STS_Uninit;
-	mag = LTIUtils::levelToMag(lev);
-
-	if(mag < sidImageFile_->getMinMagnification())
-		mag = sidImageFile_->getMinMagnification();
-	else if(mag > sidImageFile_->getMaxMagnification())
-		mag = sidImageFile_->getMaxMagnification();
-
-	sts = sidNav_->setSceneAsGeoULLR(x0, y1, x1, y0, mag);
-	if(!LT_SUCCESS(sts))
-		return false;
-
-	if(!sidNav_->clipToImage())
-		return false;
-
-	sidNav_->roundScene();
-	const LTIGeoCoord& geo_coord = sidImageFile_->getGeoCoord();
-	geo_coord.pixelToGeo(sidNav_->getUpperLeftCol() - 0.5, sidNav_->getUpperLeftRow() - 0.5, 
-						 mag, x0, y1);
-	geo_coord.pixelToGeo(sidNav_->getLowerRightCol() - 0.5, sidNav_->getLowerRightRow() - 0.5, 
-						 mag, x1, y0);
-	return sidNav_->isSceneValid();
-}
-
-int 
-TeMrSIDReader::getSelectedAreaWidth()
-{
-	return sidNav_->getNumCols();
-}
-
-int 
-TeMrSIDReader::getSelectedAreaHeight()
-{
-	return sidNav_->getNumRows();
-}
-
-/* Loads the image selected by the navigator rectangle into memory.
-   Expects that the pointer to unsiged char was already allocated */
-bool 
-TeMrSIDReader::getSelectedAreaData(unsigned char*& data)
-{
-	if(!sidImageFile_)
-		return false;
-	if(!sidNav_)
-		return false;
-	if(!data)
-		return false;
-
-	// generate a memory buffer
-	unsigned int size = sidNav_->getNumCols() * sidNav_->getNumRows();
-	void** bands_data = (void**)calloc(nBands(), sizeof(void*));
-	for(int i=0;i<nBands();++i)
-		bands_data[i] = data + i * size;
-	LTISceneBuffer* sidBuffer = new LTISceneBuffer(sidImageFile_->getPixelProps(), sidNav_->getNumCols(), 
-		                           sidNav_->getNumRows(), bands_data);
-	if(sidBuffer == NULL)
-		return false;
-
-	LT_STATUS sts = LT_STS_Uninit;
-	sts = sidImageFile_->read(sidNav_->getScene(), *sidBuffer);
-
-	if(!LT_SUCCESS(sts))
-		return false;
-	delete sidBuffer;
-	return true;
-}
-
-bool 
-TeMrSIDReader::getMinValues(std::vector<double>& minvalues)
-{
-	const LTIPixel minv = sidImageFile_->getMinDynamicRange(); 
-	LTIDataType dt = minv.getDataType();
-	if (dt == LTI_DATATYPE_INVALID)
-		return false;
-	
-	minvalues.clear();
-	int i;
-	switch (dt)
-	{
-	case LTI_DATATYPE_UINT8:
-		for (i=0; i<minv.getNumBands(); ++i)
-			minvalues.push_back(minv.getSampleValueUint8(i));
-		break;
-	case LTI_DATATYPE_SINT8:
-		for (i=0; i<minv.getNumBands(); ++i)
-			minvalues.push_back(minv.getSampleValueSint8(i));
-		break;
-	case LTI_DATATYPE_UINT16:
-		for (i=0; i<minv.getNumBands(); ++i)
-			minvalues.push_back(minv.getSampleValueUint16(i));
-		break;
-	case LTI_DATATYPE_SINT16:
-		for (i=0; i<minv.getNumBands(); ++i)
-			minvalues.push_back(minv.getSampleValueSint16(i));
-		break;
-	default:
-		for (i=0; i<minv.getNumBands(); ++i)
-			minvalues.push_back(minv.getSampleValueFloat32(i));
-	}
-	return true;	
-}
-
-bool 
-TeMrSIDReader::getMaxValues(std::vector<double>& maxvalues)
-{
-	const LTIPixel maxv = sidImageFile_->getMaxDynamicRange(); 
-	LTIDataType dt = maxv.getDataType();
-	if (dt == LTI_DATATYPE_INVALID)
-		return false;
-	
-	maxvalues.clear();
-	int i;
-	switch (dt)
-	{
-	case LTI_DATATYPE_UINT8:
-		for (i=0; i<maxv.getNumBands(); ++i)
-			maxvalues.push_back(maxv.getSampleValueUint8(i));
-		break;
-	case LTI_DATATYPE_SINT8:
-		for (i=0; i<maxv.getNumBands(); ++i)
-			maxvalues.push_back(maxv.getSampleValueSint8(i));
-		break;
-	case LTI_DATATYPE_UINT16:
-		for (i=0; i<maxv.getNumBands(); ++i)
-			maxvalues.push_back(maxv.getSampleValueUint16(i));
-		break;
-	case LTI_DATATYPE_SINT16:
-		for (i=0; i<maxv.getNumBands(); ++i)
-			maxvalues.push_back(maxv.getSampleValueSint16(i));
-		break;
-	default:
-		for (i=0; i<maxv.getNumBands(); ++i)
-			maxvalues.push_back(maxv.getSampleValueFloat32(i));
-	}
-	return true;
-}
-//! Returns true if there is a specification for a no data value
-bool 
-TeMrSIDReader::getNoDataPixel(std::vector<double>& nodata)
-{
-	const LTIPixel* nd = sidImageFile_->getNoDataPixel();
-    	if(nd == NULL)
-		return false;
-	LTIDataType dt = nd->getDataType();
-	if (dt == LTI_DATATYPE_INVALID)
-		return false;
-
-	nodata.clear();
-	int i;
-	switch (dt)
-	{
-	case LTI_DATATYPE_UINT8:
-		for (i=0; i<nd->getNumBands(); ++i)
-			nodata.push_back(nd->getSampleValueUint8(i));
-		break;
-	case LTI_DATATYPE_SINT8:
-		for (i=0; i<nd->getNumBands(); ++i)
-			nodata.push_back(nd->getSampleValueSint8(i));
-		break;
-	case LTI_DATATYPE_UINT16:
-		for (i=0; i<nd->getNumBands(); ++i)
-			nodata.push_back(nd->getSampleValueUint16(i));
-		break;
-	case LTI_DATATYPE_SINT16:
-		for (i=0; i<nd->getNumBands(); ++i)
-			nodata.push_back(nd->getSampleValueSint16(i));
-		break;
-	default:
-		for (i=0; i<nd->getNumBands(); ++i)
-			nodata.push_back(nd->getSampleValueFloat32(i));
-	}
-	return true;
-}
-
-int 
-TeMrSIDReader::getNumLevels()
-{
-	return sidImageFile_->getNumLevels();
-}
-
-bool 
-TeMrSIDReader::zoomTo(int level)
-{
-	double mag = LTIUtils::levelToMag(level);
-	return LT_SUCCESS(sidNav_->zoomTo(mag,LTINavigator::STYLE_STRICT));
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2006 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include "TeMrSID.h"
+
+#include <lt_fileSpec.h>
+#include <MrSIDImageReader.h>
+#include <lti_navigator.h>
+#include <lti_sceneBuffer.h>
+#include <lti_pixel.h>
+#include <lti_utils.h>
+
+#include <locale.h>
+#include <math.h>
+#include <stdio.h>
+
+LT_USE_NAMESPACE(LizardTech)
+
+// Static variables initialization:
+
+bool TeMrSIDReader::mrsid_initialized = false;
+
+/*
+** ---------------------------------------------------------------
+** Methods Implementation:
+*/
+
+TeMrSIDReader::TeMrSIDReader(const std::string& fname):
+	fileName_(fname)
+{
+	LT_STATUS sts = LT_STS_Uninit;
+
+	if(!mrsid_initialized)
+	{
+		setlocale(LC_ALL,"English");
+		//ATENCAO - Verificar se isso funciona quando a configuracao do Windows for em Portugues.
+		//    XTrans::initialize();      
+		mrsid_initialized = true;
+	}
+	const LTFileSpec filespec(fname.c_str());
+	sidImageFile_ = new MrSIDImageReader(filespec);
+	sts = sidImageFile_->initialize();
+	if(!LT_SUCCESS(sts))
+		throw "Erro lendo MrSID";
+	sidNav_ = new LTINavigator(*sidImageFile_);
+};
+
+TeMrSIDReader::~TeMrSIDReader()
+{
+//	if(sidImageFile_) delete sidImageFile_;
+	if(sidNav_) delete sidNav_;
+}
+
+int TeMrSIDReader::nBands() const
+{
+	return sidImageFile_->getNumBands();
+}
+
+unsigned int TeMrSIDReader::bitsPerPixel() const
+{
+	return sidImageFile_->getPixelProps ().getNumBytes() * 8;
+}
+
+TeMrSIDReader::ColorModel TeMrSIDReader::getColorModel()
+{
+	LTIColorSpace color_space = sidImageFile_->getColorSpace();
+
+	if(color_space == LTI_COLORSPACE_RGB)
+		return ColorModelRGB;
+	else if(color_space == LTI_COLORSPACE_GRAYSCALE)
+		return ColorModelGray;
+	else
+		return ColorModelUnknown;
+}
+
+unsigned int TeMrSIDReader::getWidth()
+{
+	return sidImageFile_->getWidth();
+}
+
+unsigned int TeMrSIDReader::getHeight()
+{
+	return sidImageFile_->getHeight();
+}
+
+bool TeMrSIDReader::hasWorldInfo()
+{
+	return !(sidImageFile_->isGeoCoordImplicit());
+}
+
+double TeMrSIDReader::originX()
+{
+	return sidImageFile_->getGeoCoord().getX(); 
+}
+
+double TeMrSIDReader::originY()
+{
+	return sidImageFile_->getGeoCoord().getY();
+}
+
+double TeMrSIDReader::resX()
+{
+  return sidImageFile_->getGeoCoord().getXRes();
+}
+
+double TeMrSIDReader::resY()
+{
+	return sidImageFile_->getGeoCoord().getYRes();
+}
+
+void TeMrSIDReader::getWorld(double& x0, double& y0, double& x1, double& y1)
+{
+	unsigned int w, h;
+	getOrigin(x0, y0);
+	getDimensions(w, h);
+	sidImageFile_->getGeoCoord().pixelToGeo(w - 1, h - 1, 1.0, x1, y1);
+}
+
+void TeMrSIDReader::getNavigationParameters(std::vector<double>& nwf)
+{
+	const LTIGeoCoord& geo = sidImageFile_->getGeoCoord();
+	double xUL, yUL, xRes, yRes, xRot, yRot;
+	geo.get(xUL,yUL,xRes,yRes,xRot,yRot);
+	nwf.clear();
+	nwf.push_back(xRes);
+	nwf.push_back(xRot);
+	nwf.push_back(yRot);
+	nwf.push_back(yRes);
+	nwf.push_back(xUL);
+	nwf.push_back(yUL);
+	return;
+}
+
+void TeMrSIDReader::getBoundingBox(double& xmin, double& ymin, double& xmax, double& ymax)
+{
+	double sx, sy;
+	unsigned int w, h;
+	double x0, y0, x1, y1;
+
+	sx = resX();
+	sy = resY();
+
+	getOrigin(x0, y0);
+	x0-= sx * 0.5;
+	y0-= sy * 0.5;
+
+	getDimensions(w, h);
+
+	x1 = x0 + w * sx;
+	y1 = y0 + h * sy;
+
+	if(x0 < x1)
+	{
+		xmin = x0;
+		xmax = x1;
+	}
+	else
+	{
+		xmin = x1;
+		xmax = x0;
+	}
+
+	if(y0 < y1)
+	{
+		ymin = y0;
+		ymax = y1;
+	}
+	else
+	{
+		ymin = y1;
+		ymax = y0;
+	}
+}
+
+void TeMrSIDReader::world2Pixel(double wx, double wy, int& ix, int& iy)
+{
+	double px, py;
+
+	sidImageFile_->getGeoCoord().geoToPixel(wx, wy, 1.0, px, py);
+
+	ix = (int)(px + 0.5);
+	iy = (int)(py + 0.5);
+}
+
+void TeMrSIDReader::pixel2World(int ix, int iy, double& wx, double& wy)
+{
+	sidImageFile_->getGeoCoord().pixelToGeo(ix, iy, 1.0, wx, wy);
+}
+
+
+LTISceneBuffer* 
+TeMrSIDReader::getImageBuffer(unsigned int width, unsigned int height, 
+							  unsigned int nbands, unsigned char* data)
+{
+	if(data == NULL)
+		return NULL;
+
+	unsigned int size = width * height;
+	void** bands_data = (void**)calloc(nbands, sizeof(void*));
+	for(unsigned int i = 0;i < nbands;i++)
+		bands_data[i] = data + i * size;
+	return new LTISceneBuffer(sidImageFile_->getPixelProps(), width, height, bands_data);
+}
+
+int
+TeMrSIDReader::bestResolution(double res)
+{
+	double magx, magy, mag;
+
+	//compute Magnification
+	magx = fabs(1/res);
+	magy = fabs(1/res);
+
+	if(magx > magy)
+		mag = magx;
+	else
+		mag = magy;
+
+	if(mag <= sidImageFile_->getMinMagnification())
+		mag = sidImageFile_->getMinMagnification();
+	else if(mag >= sidImageFile_->getMaxMagnification())
+		mag = sidImageFile_->getMaxMagnification();
+	else if(mag < 1)
+	{
+		int imag = (int)(1.0/mag) >> 1;
+		int i;
+
+		for(i = 1;i <= imag;i = i << 1);
+		mag = 1.0/i;
+	}
+	else 
+	{
+		int imag = (int)ceil(mag);
+		int i;
+		for(i = 1;i < imag;i = i << 1);
+			mag = i;
+	}
+	return LTIUtils::magToLevel(mag);
+}
+
+int 
+TeMrSIDReader::getBestResolutionLevel(unsigned int w, unsigned int h, 
+									  double x0, double y0, double x1, double y1)
+{
+	double magx, magy, mag;
+
+	//compute Magnification
+	magx = fabs((double)w/(x1 - x0) * resX());
+	magy = fabs((double)h/(y1 - y0) * resY());
+
+	if(magx > magy)
+		mag = magx;
+	else
+		mag = magy;
+
+	if(mag <= sidImageFile_->getMinMagnification())
+		mag = sidImageFile_->getMinMagnification();
+	else if(mag >= sidImageFile_->getMaxMagnification())
+		mag = sidImageFile_->getMaxMagnification();
+	else if(mag < 1)
+	{
+		int imag = (int)(1.0/mag) >> 1;
+		int i;
+
+		for(i = 1;i <= imag;i = i << 1);
+		mag = 1.0/i;
+	}
+	else 
+	{
+		int imag = (int)ceil(mag);
+		int i;
+		for(i = 1;i < imag;i = i << 1);
+			mag = i;
+	}
+	return LTIUtils::magToLevel(mag);
+}
+
+int 
+TeMrSIDReader::getWorstResolutionLevel(unsigned int w, unsigned int h, 
+									   double x0, double y0, double x1, double y1)
+{
+	double magx, magy, mag;
+
+	//compute Magnification
+	magx = fabs((double)w/(x1 - x0) * resX());
+	magy = fabs((double)h/(y1 - y0) * resY());
+
+	if(magx < magy)
+		mag = magx;
+	else
+		mag = magy;
+
+	if(mag <= sidImageFile_->getMinMagnification())
+		mag = sidImageFile_->getMinMagnification();
+	else if(mag >= sidImageFile_->getMaxMagnification())
+		mag = sidImageFile_->getMaxMagnification();
+	else if(mag < 1)
+	{
+		int imag = (int)ceil(1.0/mag);
+		int i;
+		for(i = 1;i < imag;i = i << 1);
+			mag = 1.0/i;
+	}
+	else 
+	{
+		int imag = (int)mag >> 1;
+		int i;
+		for(i = 1;i <= imag;i = i << 1);
+		mag = i;
+	}
+	return LTIUtils::magToLevel(mag);
+}
+
+int 
+TeMrSIDReader::getProxResolutionLevel(unsigned int w, unsigned int h, 
+                                      double x0, double y0, double x1, double y1)
+{
+	double magx, magy, mag;
+
+	//compute Magnification
+	magx = fabs((double)w/(x1 - x0) * resX());
+	magy = fabs((double)h/(y1 - y0) * resY());
+
+	if(magx > magy)
+		mag = magx;
+	else
+		mag = magy;
+
+	if(mag <= sidImageFile_->getMinMagnification())
+		mag = sidImageFile_->getMinMagnification();
+	else if(mag >= sidImageFile_->getMaxMagnification())
+		mag = sidImageFile_->getMaxMagnification();
+	else if(mag < 1)
+	{
+		//    int imag = (int)(1.0/mag) >> 1;
+		int imag = (int)(1.0/mag + 0.5);
+		int i;
+		for(i = 1;i < imag;i = i << 1);
+			mag = 1.0/i;
+	}
+	else 
+	{
+		int imag = (int)ceil(mag);
+		int i;
+		for(i = 1;i < imag;i = i << 1);
+			mag = i;
+	}
+	return LTIUtils::magToLevel(mag);
+}
+
+bool 
+TeMrSIDReader::selectArea(int lev, double& x0, double& y0, double& x1, double& y1)
+{ 
+	double mag;
+	LT_STATUS sts = LT_STS_Uninit;
+	mag = LTIUtils::levelToMag(lev);
+
+	if(mag < sidImageFile_->getMinMagnification())
+		mag = sidImageFile_->getMinMagnification();
+	else if(mag > sidImageFile_->getMaxMagnification())
+		mag = sidImageFile_->getMaxMagnification();
+
+	sts = sidNav_->setSceneAsGeoULLR(x0, y1, x1, y0, mag);
+	if(!LT_SUCCESS(sts))
+		return false;
+
+	if(!sidNav_->clipToImage())
+		return false;
+
+	sidNav_->roundScene();
+	const LTIGeoCoord& geo_coord = sidImageFile_->getGeoCoord();
+	geo_coord.pixelToGeo(sidNav_->getUpperLeftCol() - 0.5, sidNav_->getUpperLeftRow() - 0.5, 
+						 mag, x0, y1);
+	geo_coord.pixelToGeo(sidNav_->getLowerRightCol() - 0.5, sidNav_->getLowerRightRow() - 0.5, 
+						 mag, x1, y0);
+	return sidNav_->isSceneValid();
+}
+
+int 
+TeMrSIDReader::getSelectedAreaWidth()
+{
+	return sidNav_->getNumCols();
+}
+
+int 
+TeMrSIDReader::getSelectedAreaHeight()
+{
+	return sidNav_->getNumRows();
+}
+
+/* Loads the image selected by the navigator rectangle into memory.
+   Expects that the pointer to unsiged char was already allocated */
+bool 
+TeMrSIDReader::getSelectedAreaData(unsigned char*& data)
+{
+	if(!sidImageFile_)
+		return false;
+	if(!sidNav_)
+		return false;
+	if(!data)
+		return false;
+
+	// generate a memory buffer
+	unsigned int size = sidNav_->getNumCols() * sidNav_->getNumRows();
+	void** bands_data = (void**)calloc(nBands(), sizeof(void*));
+	for(int i=0;i<nBands();++i)
+		bands_data[i] = data + i * size;
+	LTISceneBuffer* sidBuffer = new LTISceneBuffer(sidImageFile_->getPixelProps(), sidNav_->getNumCols(), 
+		                           sidNav_->getNumRows(), bands_data);
+	if(sidBuffer == NULL)
+		return false;
+
+	LT_STATUS sts = LT_STS_Uninit;
+	sts = sidImageFile_->read(sidNav_->getScene(), *sidBuffer);
+
+	if(!LT_SUCCESS(sts))
+		return false;
+	delete sidBuffer;
+	return true;
+}
+
+bool 
+TeMrSIDReader::getMinValues(std::vector<double>& minvalues)
+{
+	const LTIPixel minv = sidImageFile_->getMinDynamicRange(); 
+	LTIDataType dt = minv.getDataType();
+	if (dt == LTI_DATATYPE_INVALID)
+		return false;
+	
+	minvalues.clear();
+	int i;
+	switch (dt)
+	{
+	case LTI_DATATYPE_UINT8:
+		for (i=0; i<minv.getNumBands(); ++i)
+			minvalues.push_back(minv.getSampleValueUint8(i));
+		break;
+	case LTI_DATATYPE_SINT8:
+		for (i=0; i<minv.getNumBands(); ++i)
+			minvalues.push_back(minv.getSampleValueSint8(i));
+		break;
+	case LTI_DATATYPE_UINT16:
+		for (i=0; i<minv.getNumBands(); ++i)
+			minvalues.push_back(minv.getSampleValueUint16(i));
+		break;
+	case LTI_DATATYPE_SINT16:
+		for (i=0; i<minv.getNumBands(); ++i)
+			minvalues.push_back(minv.getSampleValueSint16(i));
+		break;
+	default:
+		for (i=0; i<minv.getNumBands(); ++i)
+			minvalues.push_back(minv.getSampleValueFloat32(i));
+	}
+	return true;	
+}
+
+bool 
+TeMrSIDReader::getMaxValues(std::vector<double>& maxvalues)
+{
+	const LTIPixel maxv = sidImageFile_->getMaxDynamicRange(); 
+	LTIDataType dt = maxv.getDataType();
+	if (dt == LTI_DATATYPE_INVALID)
+		return false;
+	
+	maxvalues.clear();
+	int i;
+	switch (dt)
+	{
+	case LTI_DATATYPE_UINT8:
+		for (i=0; i<maxv.getNumBands(); ++i)
+			maxvalues.push_back(maxv.getSampleValueUint8(i));
+		break;
+	case LTI_DATATYPE_SINT8:
+		for (i=0; i<maxv.getNumBands(); ++i)
+			maxvalues.push_back(maxv.getSampleValueSint8(i));
+		break;
+	case LTI_DATATYPE_UINT16:
+		for (i=0; i<maxv.getNumBands(); ++i)
+			maxvalues.push_back(maxv.getSampleValueUint16(i));
+		break;
+	case LTI_DATATYPE_SINT16:
+		for (i=0; i<maxv.getNumBands(); ++i)
+			maxvalues.push_back(maxv.getSampleValueSint16(i));
+		break;
+	default:
+		for (i=0; i<maxv.getNumBands(); ++i)
+			maxvalues.push_back(maxv.getSampleValueFloat32(i));
+	}
+	return true;
+}
+//! Returns true if there is a specification for a no data value
+bool 
+TeMrSIDReader::getNoDataPixel(std::vector<double>& nodata)
+{
+	const LTIPixel* nd = sidImageFile_->getNoDataPixel();
+    	if(nd == NULL)
+		return false;
+	LTIDataType dt = nd->getDataType();
+	if (dt == LTI_DATATYPE_INVALID)
+		return false;
+
+	nodata.clear();
+	int i;
+	switch (dt)
+	{
+	case LTI_DATATYPE_UINT8:
+		for (i=0; i<nd->getNumBands(); ++i)
+			nodata.push_back(nd->getSampleValueUint8(i));
+		break;
+	case LTI_DATATYPE_SINT8:
+		for (i=0; i<nd->getNumBands(); ++i)
+			nodata.push_back(nd->getSampleValueSint8(i));
+		break;
+	case LTI_DATATYPE_UINT16:
+		for (i=0; i<nd->getNumBands(); ++i)
+			nodata.push_back(nd->getSampleValueUint16(i));
+		break;
+	case LTI_DATATYPE_SINT16:
+		for (i=0; i<nd->getNumBands(); ++i)
+			nodata.push_back(nd->getSampleValueSint16(i));
+		break;
+	default:
+		for (i=0; i<nd->getNumBands(); ++i)
+			nodata.push_back(nd->getSampleValueFloat32(i));
+	}
+	return true;
+}
+
+int 
+TeMrSIDReader::getNumLevels()
+{
+	return sidImageFile_->getNumLevels();
+}
+
+bool 
+TeMrSIDReader::zoomTo(int level)
+{
+	double mag = LTIUtils::levelToMag(level);
+	return LT_SUCCESS(sidNav_->zoomTo(mag,LTINavigator::STYLE_STRICT));
+}
+
diff --git a/src/terralib/drivers/MrSID/TeMrSID.h b/src/terralib/drivers/MrSID/TeMrSID.h
old mode 100755
new mode 100644
index 8e995db..7cbb854
--- a/src/terralib/drivers/MrSID/TeMrSID.h
+++ b/src/terralib/drivers/MrSID/TeMrSID.h
@@ -1,210 +1,210 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2006 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMrSID.h
-    This file contains functions that provide a wrapper around the SDK provided by LizardTech to decode MrSID images.
-*/
-#ifndef  __TERRALIB_INTERNAL_MRSID_H
-#define  __TERRALIB_INTERNAL_MRSID_H
-
-//Internal classes from LizardTech namespace
-namespace LizardTech
-{
-class MrSIDImageReader;
-class LTINavigator;
-class LTISceneBuffer;
-}
-
-#include <string>
-#include <vector>
-
-
-//! A reader to a MrSID image
-/*!
-	This class uses the SDK provided by LizardTech to built a MrSID image reader support.
-	This class is used by TeDecoderMrSID and shouldn't be used directly.
-	\sa TeDecoderMrSID
-*/
-class TeMrSIDReader
-{
-	static bool mrsid_initialized; // indicates if MrSID has already been initialized
-	LizardTech::LTINavigator*		sidNav_;
-	LizardTech::MrSIDImageReader*	sidImageFile_;
-	std::string						fileName_;
-
-	//!Returns an ImageBuffer for loading an image from MrSIDNavigator.
-	/**
-		\param size(in) size of the image buffer
-		\param nbands(in) number of output bands
-		\param bands(in) output bands vector indicating the desired output bands and its order
-		\param data(out) bands image buffer vector
-	*/
-	LizardTech::LTISceneBuffer*		getImageBuffer(unsigned int width, unsigned int height,
-												unsigned int nbands, unsigned char* data);
-public:
-	//! Constructor
-	TeMrSIDReader(const std::string& fname);
-
-	//! Destructor
-	~TeMrSIDReader();
-
-	//! Returns the  image filename associated to this reader
-	std::string fileName() const
-	{	return fileName_; }
-
-	//! Color models from MrSID encoding system
-	typedef enum { 
-		ColorModelUnknown,  //!< unknown color model
-		ColorModelGray,     //!< gray scale, composed by one 8 bit channel 
-		ColorModelMap,      //!< indexed , composed by one 8 bit channel and a palette
-		ColorModelRGB,      //!< composed by three 8 bit channels
-		ColorModelRGBA      //!< composed by four 8 bit channels
-	} ColorModel;
-
-	//! Returns the color model of the image
-	ColorModel getColorModel();
-
-	//! Returns the number of bands in the image   
-	int nBands() const;  
-
-	//! Returns the number of bits per pixel of the image   
-	unsigned int bitsPerPixel() const; 
-
-	//! Returns the width of the image in pixels  
-	unsigned int getWidth();
-
-	//! Returns the height of the image in pixels 
-	unsigned int getHeight();
-
-	//! Returns the dimensions of the image
-	void getDimensions(unsigned int& width, unsigned int& height);
-
-	//! Checks if the imagem has world navigation information
-	bool hasWorldInfo();
-
-	//! Gets the upper-left X position
-	double originX();
-
- 	//! Gets the upper-left Y position
-	double originY();
-
-	//! Gets the (X,Y) coordinate of the upper-left position
-	void getOrigin(double& x, double& y);
-
-	//! Returns the X resolution
-	double resX();
-
-	//! Returns the Y resolution
-	double resY();
-
-	//! Returns the X and Y resolutions
-	void getResolution(double& rx, double& ry);
-
-	//! Gets the box of the image 
-	void getWorld(double& x0, double& y0, double& x1, double& y1);
-
-	//! Gets the bounding box of the image 
-	void getBoundingBox(double& xmin, double& ymin, double& xmax, double& ymax);
-
-	//! Gets all the coordinate information
-	void getNavigationParameters(std::vector<double>& nwf);
-
-	//! Converts a geo coordinate to pixel coordinate 
-	void world2Pixel(double wx, double wy, int& ix, int& iy);
-	
-	//! Converts a pixel coordinate to geo coordinate 
-	void pixel2World(int ix, int iy, double& wx, double& wy);
-
-	/** Returns the level that corresponds to a resolution >= than 
-		the resolution defined by a given box an a dimension
-    */
-	int getBestResolutionLevel(unsigned int w, unsigned int h, 
-							   double x0, double y0, double x1, double y1);
-
-	/** 
-		Returns the level that corresponds to a resolution <= than 
-		the resolution defined by a given box an a dimension
-    */
-	int getWorstResolutionLevel(unsigned int w, unsigned int h, 
-								double x0, double y0, double x1, double y1);
-
-	/** 
-		Returns the level that corresponds to the closest resolution to 
-		the resolution defined by a given box an a dimension
-    */
-	int getProxResolutionLevel(unsigned int w, unsigned int h, 
-								double x0, double y0, double x1, double y1);
-
-	/** 
-		Returns the level that corresponds to the closest resolution to 
-		the resolution given
-    */
-	int bestResolution(double res);
-
-	//! Selects an area in a given level of the image
-	bool selectArea(int lev, double& x0, double& y0, double& x1, double& y1);
-
-	//! Returns the width in pixels, of the area selected
-	int getSelectedAreaWidth();
-
-	//! Returns the height in pixels, of the area selected
-	int getSelectedAreaHeight();
-
-	//! Returns the selected area in a buffer of char
-	bool getSelectedAreaData(unsigned char*& data);
-
-	//! Returns true, and the values, if there is a specification for a no data value
-	bool getNoDataPixel(std::vector<double>& nodata);
-
-	//! Returns the number of levels in the image
-	int getNumLevels();
-
-	//! Zoom the image to a given level
-	bool zoomTo(int level);
-
-	//! Returns true, and the values, if there is a specification for a max value
-	bool getMaxValues(std::vector<double>& maxvalues);
-
-	//! Returns true, and the values, if there is a specification for a min value
-	bool getMinValues(std::vector<double>& minvalues);
-
-};
-
-//! Inline Methods
-inline void TeMrSIDReader::getDimensions(unsigned int& w, unsigned int& h)
-{
-  w = getWidth();
-  h = getHeight();
-}
-
-inline void TeMrSIDReader::getResolution(double& rx, double& ry)
-{
-  rx = resX();
-  ry = resY();
-}
-
-inline void TeMrSIDReader::getOrigin(double& x, double& y)
-{
-  x = originX();
-  y = originY();
-}
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2006 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMrSID.h
+    This file contains functions that provide a wrapper around the SDK provided by LizardTech to decode MrSID images.
+*/
+#ifndef  __TERRALIB_INTERNAL_MRSID_H
+#define  __TERRALIB_INTERNAL_MRSID_H
+
+//Internal classes from LizardTech namespace
+namespace LizardTech
+{
+class MrSIDImageReader;
+class LTINavigator;
+class LTISceneBuffer;
+}
+
+#include <string>
+#include <vector>
+
+
+//! A reader to a MrSID image
+/*!
+	This class uses the SDK provided by LizardTech to built a MrSID image reader support.
+	This class is used by TeDecoderMrSID and shouldn't be used directly.
+	\sa TeDecoderMrSID
+*/
+class TeMrSIDReader
+{
+	static bool mrsid_initialized; // indicates if MrSID has already been initialized
+	LizardTech::LTINavigator*		sidNav_;
+	LizardTech::MrSIDImageReader*	sidImageFile_;
+	std::string						fileName_;
+
+	//!Returns an ImageBuffer for loading an image from MrSIDNavigator.
+	/**
+		\param size(in) size of the image buffer
+		\param nbands(in) number of output bands
+		\param bands(in) output bands vector indicating the desired output bands and its order
+		\param data(out) bands image buffer vector
+	*/
+	LizardTech::LTISceneBuffer*		getImageBuffer(unsigned int width, unsigned int height,
+												unsigned int nbands, unsigned char* data);
+public:
+	//! Constructor
+	TeMrSIDReader(const std::string& fname);
+
+	//! Destructor
+	~TeMrSIDReader();
+
+	//! Returns the  image filename associated to this reader
+	std::string fileName() const
+	{	return fileName_; }
+
+	//! Color models from MrSID encoding system
+	typedef enum { 
+		ColorModelUnknown,  //!< unknown color model
+		ColorModelGray,     //!< gray scale, composed by one 8 bit channel 
+		ColorModelMap,      //!< indexed , composed by one 8 bit channel and a palette
+		ColorModelRGB,      //!< composed by three 8 bit channels
+		ColorModelRGBA      //!< composed by four 8 bit channels
+	} ColorModel;
+
+	//! Returns the color model of the image
+	ColorModel getColorModel();
+
+	//! Returns the number of bands in the image   
+	int nBands() const;  
+
+	//! Returns the number of bits per pixel of the image   
+	unsigned int bitsPerPixel() const; 
+
+	//! Returns the width of the image in pixels  
+	unsigned int getWidth();
+
+	//! Returns the height of the image in pixels 
+	unsigned int getHeight();
+
+	//! Returns the dimensions of the image
+	void getDimensions(unsigned int& width, unsigned int& height);
+
+	//! Checks if the imagem has world navigation information
+	bool hasWorldInfo();
+
+	//! Gets the upper-left X position
+	double originX();
+
+ 	//! Gets the upper-left Y position
+	double originY();
+
+	//! Gets the (X,Y) coordinate of the upper-left position
+	void getOrigin(double& x, double& y);
+
+	//! Returns the X resolution
+	double resX();
+
+	//! Returns the Y resolution
+	double resY();
+
+	//! Returns the X and Y resolutions
+	void getResolution(double& rx, double& ry);
+
+	//! Gets the box of the image 
+	void getWorld(double& x0, double& y0, double& x1, double& y1);
+
+	//! Gets the bounding box of the image 
+	void getBoundingBox(double& xmin, double& ymin, double& xmax, double& ymax);
+
+	//! Gets all the coordinate information
+	void getNavigationParameters(std::vector<double>& nwf);
+
+	//! Converts a geo coordinate to pixel coordinate 
+	void world2Pixel(double wx, double wy, int& ix, int& iy);
+	
+	//! Converts a pixel coordinate to geo coordinate 
+	void pixel2World(int ix, int iy, double& wx, double& wy);
+
+	/** Returns the level that corresponds to a resolution >= than 
+		the resolution defined by a given box an a dimension
+    */
+	int getBestResolutionLevel(unsigned int w, unsigned int h, 
+							   double x0, double y0, double x1, double y1);
+
+	/** 
+		Returns the level that corresponds to a resolution <= than 
+		the resolution defined by a given box an a dimension
+    */
+	int getWorstResolutionLevel(unsigned int w, unsigned int h, 
+								double x0, double y0, double x1, double y1);
+
+	/** 
+		Returns the level that corresponds to the closest resolution to 
+		the resolution defined by a given box an a dimension
+    */
+	int getProxResolutionLevel(unsigned int w, unsigned int h, 
+								double x0, double y0, double x1, double y1);
+
+	/** 
+		Returns the level that corresponds to the closest resolution to 
+		the resolution given
+    */
+	int bestResolution(double res);
+
+	//! Selects an area in a given level of the image
+	bool selectArea(int lev, double& x0, double& y0, double& x1, double& y1);
+
+	//! Returns the width in pixels, of the area selected
+	int getSelectedAreaWidth();
+
+	//! Returns the height in pixels, of the area selected
+	int getSelectedAreaHeight();
+
+	//! Returns the selected area in a buffer of char
+	bool getSelectedAreaData(unsigned char*& data);
+
+	//! Returns true, and the values, if there is a specification for a no data value
+	bool getNoDataPixel(std::vector<double>& nodata);
+
+	//! Returns the number of levels in the image
+	int getNumLevels();
+
+	//! Zoom the image to a given level
+	bool zoomTo(int level);
+
+	//! Returns true, and the values, if there is a specification for a max value
+	bool getMaxValues(std::vector<double>& maxvalues);
+
+	//! Returns true, and the values, if there is a specification for a min value
+	bool getMinValues(std::vector<double>& minvalues);
+
+};
+
+//! Inline Methods
+inline void TeMrSIDReader::getDimensions(unsigned int& w, unsigned int& h)
+{
+  w = getWidth();
+  h = getHeight();
+}
+
+inline void TeMrSIDReader::getResolution(double& rx, double& ry)
+{
+  rx = resX();
+  ry = resY();
+}
+
+inline void TeMrSIDReader::getOrigin(double& x, double& y)
+{
+  x = originX();
+  y = originY();
+}
+#endif
diff --git a/src/terralib/drivers/MySQL/TeMySQL.cpp b/src/terralib/drivers/MySQL/TeMySQL.cpp
old mode 100755
new mode 100644
index ddb7e01..00a6d9c
--- a/src/terralib/drivers/MySQL/TeMySQL.cpp
+++ b/src/terralib/drivers/MySQL/TeMySQL.cpp
@@ -1,2752 +1,3004 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeMySQL.h"
-#include <stdio.h>
-#include <sys/types.h>
-#include <TeProject.h>
-#include <cstring>
-
-extern "C" {
-extern char *strxmov(char* dest, const char* src, ...);
-}
-
-#ifndef MAX
-  #define MAX(a,b) ((a>b)?a:b)
-#endif
-#ifndef MIN
-  #define MIN(a,b) ((a<b)?a:b)
-#endif
-
-
-double swappd(double din)
-{
-	char  stri[8],stro[8];
-	double dout;
-
-	memcpy (stri,&din,8);
-	stro[0] = stri[7];
-	stro[1] = stri[6];
-	stro[2] = stri[5];
-	stro[3] = stri[4];
-	stro[4] = stri[3];
-	stro[5] = stri[2];
-	stro[6] = stri[1];
-	stro[7] = stri[0];
-	memcpy (&dout,stro,8);
-	return (dout);
-}
-
-
-TeMySQL::TeMySQL()
-{
-	isConnected_ = false;
-	dbmsName_ = "MySQL";
-	bufferBlob_ = 0;
-	bufferBlobSize_ = 0;
-	mysql_init (&mysql_);
-}
-
-
-TeMySQL::~TeMySQL()
-{
-	if (bufferBlob_)
-		delete []bufferBlob_;
-	if (isConnected_)
-		close ();
-}
-
-void
-TeMySQL::close()
-{
-	if (bufferBlob_)
-		delete []bufferBlob_;
-	bufferBlob_ = 0;
-	bufferBlobSize_ = 0;
-
-	mysql_close(&mysql_);
-    isConnected_ = false;
-}
-
-bool TeMySQL::beginTransaction()
-{
-	return this->execute("START TRANSACTION;");
-}
-
-bool TeMySQL::commitTransaction()
-{
-	return this->execute("COMMIT;");
-}
-
-bool TeMySQL::rollbackTransaction()
-{
-	return this->execute("ROLLBACK;");
-}
-
-
-bool 
-TeMySQL::newDatabase(const string& database, const string& user, const string& password, const string& host, const int & port, bool terralibModel)
-{
-	int portToConnect = port;
-	if(portToConnect < 0)
-	{
-		portToConnect = 0;
-	}
-
-	if (mysql_real_connect(&mysql_,host.c_str(),user.c_str(),password.c_str(),"",portToConnect,NULL,0) == NULL)
-	{
-		isConnected_ = false;
-		return false;
-	}
-
-	string create = "CREATE DATABASE " + database;
-	if (mysql_query(&mysql_,create.c_str()) != 0)
-//	if (mysql_create_db(&mysql_,database.c_str()) != 0)
-	{
-		isConnected_ = false;
-		return false;
-	}
-
-	if (mysql_select_db(&mysql_,database.c_str()) != 0)
-	{
-		isConnected_ = false;
-		return false;
-	}
-
-	if(terralibModel)
-	{
-		//create conceptual model
-		if(!this->createConceptualModel())
-			return false;
-	}
-	isConnected_ = true;
-	user_ = user;
-	host_ = host;
-	password_ = password;
-	database_ = database;
-	portNumber_ = portToConnect;
-	return true;
-}
-
-
-bool 
-TeMySQL::connect (const string& host, const string& user, const string& password, const string& database, int port)
-{
-	if(port<0)
-		port = 0;
-
-	if (mysql_real_connect(&mysql_,host.c_str(),user.c_str(),password.c_str(),database.c_str(),port,NULL,0) == NULL)
-	{
-		isConnected_ = false;
-		return false;
-	}
-
-	isConnected_ = true;
-	user_ = user;
-	host_ = host;
-	password_ = password;
-	database_ = database;
-	portNumber_ = port;
-	return true;
-}
-
-
-bool 
-TeMySQL::showDatabases (const string& host, const string& user, const string& password, vector<string>& dbNames, int port)
-{
-	unsigned long i;
-	MYSQL_ROW row;
-
-	if(port<0)
-		port = 0;
-
-	if (mysql_real_connect(&mysql_,host.c_str(),user.c_str(),password.c_str(),0,port,NULL,0) == NULL)
-	{
-		errorMessage_= string(mysql_error(&mysql_));
-		return false;
-	}
-
-	MYSQL_RES *result = mysql_list_dbs(&mysql_, "%");
-
-	unsigned int numRows = (unsigned int)mysql_num_rows(result);
-
-	for (i = 0; i < numRows; ++i)
-	{
-		row = mysql_fetch_row(result);
-		dbNames.push_back(row[0]);
-	}
-
-	close();
-
-	return true;
-}
-
-
-bool 
-TeMySQL::execute (const string &q)
-{
-	if (mysql_real_query(&mysql_, q.c_str(), q.size()) != 0)
-	{
-		errorMessage_= string(mysql_error(&mysql_));
-		errorNumber_= mysql_errno(&mysql_);
-		return false;
-	}
-    return true;
-}
-
-bool 
-TeMySQL::createTable(const string& table, TeAttributeList &attr)
-{
-	string createStr = " CREATE TABLE " + table + " (";
-	string type;
-	string pkeys;
-	bool first = true;	
-
-	TeAttributeList::iterator it = attr.begin();
-
-	while(it != attr.end())
-	{
-		string name = (*it).rep_.name_;
-		
-		switch((*it).rep_.type_)
-		{
-			case TeSTRING:
-							if((*it).rep_.numChar_ > 0)
-							{
-								type = "VARCHAR(" + Te2String((*it).rep_.numChar_) + ") ";
-							}
-							else
-							{
-								type = "LONGTEXT";
-							}
-							break;
-			case TeREAL:
-							if((*it).rep_.decimals_ > 0)
-								type = "DECIMAL(53, " + Te2String((*it).rep_.decimals_) + ") ";
-							else
-								type = "DECIMAL(53, 15) ";
-							break;
-			case TeINT:
-							type = "INT ";							
-							break;
-
-			case TeUNSIGNEDINT:
-							type = "INT UNSIGNED ";							
-							break;
-
-			case TeCHARACTER:
-							type = "CHAR ";							
-							break;
-			case TeDATETIME:
-							type = "DATETIME ";  //time							
-							break;
-			case TeBLOB:
-							type = "BLOB ";
-							break;
-
-			case TePOINTTYPE:
-			case TePOINTSETTYPE:
-							if(!first)
-								createStr += ", ";
-							else
-								first = false;
-
-							createStr += "x				DOUBLE(53,15) DEFAULT '0.0'";
-							createStr += ", y			DOUBLE(53,15) DEFAULT '0.0'";
-							++it;
-							continue;
-
-			case TeLINE2DTYPE:
-			case TeLINESETTYPE:
-							if(!first)
-								createStr += ", ";
-							else
-								first = false;
-
-							createStr += "num_coords INT UNSIGNED not null ,";
-							createStr += "lower_x double(53,15) not null ,";
-							createStr += "lower_y double(53,15) not null ,";
-							createStr += "upper_x double(53,15) not null ,";
-							createStr += "upper_y double(53,15) not null ,";
-							createStr += "ext_max double(53,15) not null, ";
-							createStr += "spatial_data LONGBLOB not null ";
-							++it;
-							continue;
-
-			case TePOLYGONTYPE:
-			case TePOLYGONSETTYPE:
-							if(!first)
-								createStr += ", ";
-							else
-								first = false;
-
-							createStr += "num_coords INT UNSIGNED not null ,";
-							createStr += "num_holes INT UNSIGNED not null ,";
-							createStr += "parent_id INT UNSIGNED not null ,";
-							createStr += "lower_x double(53,15) not null ,";
-							createStr += "lower_y double(53,15) not null ,";
-							createStr += "upper_x double(53,15) not null ,";
-							createStr += "upper_y double(53,15) not null ,";
-							createStr += "ext_max double(53,15) not null ,";
-							createStr += "spatial_data LONGBLOB not null ";
-							++it;
-							continue;
-
-			case TeCELLTYPE:
-			case TeCELLSETTYPE:
-							if(!first)
-								createStr += ", ";
-							else
-								first = false;
-
-							createStr += "lower_x		double(53,15) NOT NULL ,";
-							createStr += "lower_y		double(53,15) NOT NULL ,";
-							createStr += "upper_x		double(53,15) NOT NULL ,";
-							createStr += "upper_y		double(53,15) NOT NULL ,";
-							createStr += "col_number	INT(10) NOT NULL ,";
-							createStr += "row_number	INT(10) NOT NULL ";
-							++it;
-							continue;					
-
-			case TeRASTERTYPE:
-							if(!first)
-								createStr += ", ";
-							else
-								first = false;
-
-							createStr += "lower_x double(53,15) not null, ";
-							createStr += "lower_y double(53,15) not null, ";
-							createStr += "upper_x double(53,15) not null, ";
-							createStr += "upper_y double(53,15) not null, ";
-							createStr += "band_id int(10) unsigned not null, ";
-							createStr += "resolution_factor int(10) unsigned , ";
-							createStr += "subband int(10) unsigned,";
-							createStr += "spatial_data LONGBLOB NOT NULL, ";
-							createStr += "block_size int(10) unsigned not null ";
-							++it;
-							continue;
-
-			case TeNODETYPE:
-			case TeNODESETTYPE:
-							if(!first)
-								createStr += ", ";
-							else
-								first = false;
-
-							createStr += "x				DOUBLE(53,15) DEFAULT '0.0'";
-							createStr += ", y			DOUBLE(53,15) DEFAULT '0.0'";
-							++it;
-							continue;
-
-			case TeTEXTTYPE:
-			case TeTEXTSETTYPE:
-
-			default:
-							type = "VARCHAR(" + Te2String((*it).rep_.numChar_) + ") ";
-							break;
-		}
-
-		if(!((*it).rep_.defaultValue_.empty()))
-			type += " DEFAULT '" + (*it).rep_.defaultValue_ + "' ";
-
-		if(!((*it).rep_.null_))
-			type += " NOT NULL ";
-
-		if((*it).rep_.isAutoNumber_)
-			type += " AUTO_INCREMENT ";
-				
-		if(!first)
-			createStr += ", ";
-		else
-			first = false;
-		
-		createStr += name + " " + type;
-
-		// check if column is part of primary key
-		if(((*it).rep_.isPrimaryKey_) && ((*it).rep_.type_ != TeBLOB))
-		{
-			if(!pkeys.empty())
-				pkeys += ", ";
-
-			pkeys += (*it).rep_.name_;
-		}
-		
-		++it;
-	}
-
-	if(!pkeys.empty())
-		createStr += ", PRIMARY KEY (" + pkeys + ") ";
-
-	createStr += ")";
-
-	return execute(createStr);
-}
-
-
-bool 
-TeMySQL::tableExist(const string& table)
-{
-	//if (table.empty())
-	//	return false;
-
-	//string q ="SHOW TABLES LIKE '"+ table + "'";
-	////string q ="DESC "+ table;
-
-	//if (mysql_real_query(&mysql_, q.c_str(), q.size()) != 0)
-	//{
-	//	errorMessage_ = string(mysql_error(&mysql_));
-	//}
-
-	//MYSQL_RES*	res_ = mysql_use_result(&mysql_);
-
-	//if (res_)
-	//{
-	//	mysql_free_result(res_);
-	//	return true;
-	//}
-	//else
-	//	return false;
-	if (table.empty())
-		return false;
-
-	MYSQL_RES* myres;
-
-    myres = mysql_list_tables(&mysql_, table.c_str());
-	if(myres == 0)
-	{
-		errorMessage_ = string(mysql_error(&mysql_));
-		return false;
-	}
-	else
-	{
-		bool ret = false;
-		MYSQL_ROW myrow;
-		while ((myrow = mysql_fetch_row(myres)))
-		{
-			string s = myrow[0];
-			string S = TeConvertToUpperCase(s);
-			string SS = TeConvertToUpperCase(table);
-			if(S == SS)
-			{
-				ret = true;
-				break;
-			}
-		}
-		mysql_free_result(myres);
-		return ret;
-	}
-}
-
-bool 
-TeMySQL::columnExist(const string& table, const string&  column ,TeAttribute& attr)
-{
-	string q = "SHOW COLUMNS FROM " + table + " LIKE \'" + column + "\'";
-	if (mysql_query(&mysql_, q.c_str()) != 0)
-	{
-		return false;
-	}
-	MYSQL_RES* fieldsres = mysql_use_result(&mysql_);
-	if (!fieldsres)
-		return false;
-	MYSQL_ROW row = mysql_fetch_row(fieldsres);
-	if (!row)
-		return false;
-	attr.rep_.name_ = column;
-	
-	string ftype(row[1]);
-	string fpk(row[3]);
-	if (ftype.find("char") != string::npos)
-		attr.rep_.type_ = TeSTRING;
-	else if (ftype.find("int") != string::npos)
-		attr.rep_.type_ = TeINT;
-	else if (ftype.find("double") != string::npos)
-		attr.rep_.type_ = TeREAL;
-	else if (ftype.find("blob") != string::npos)
-		attr.rep_.type_ = TeBLOB;
-	else if (ftype.find("longtext") != string::npos)
-		attr.rep_.type_ = TeSTRING;
-	else if ((ftype.find("date") != string::npos) || (ftype.find("time") != string::npos))
-		attr.rep_.type_ = TeDATETIME;
-
-	unsigned int p1 = ftype.find("(");
-	unsigned int p2 = ftype.find(")");
-	if (p1 != string::npos && p2 != string::npos)
-		attr.rep_.numChar_ = atoi(ftype.substr(p1+1,p2-1).c_str());
-
-	if (fpk.find("PRI") != string::npos)
-		attr.rep_.isPrimaryKey_ = true;
-
-	mysql_free_result(fieldsres);
-	return true;
-}
-
-bool TeMySQL::addColumn (const string& table, TeAttributeRep &rep)
-{
-	string q ="ALTER TABLE " + table +" ADD ";
-	string type;
-	char	size[8];
-
-	string field = TeGetExtension(rep.name_.c_str());
-	if(field.empty())
-		field = rep.name_;
-
-	switch (rep.type_)
-	{
-		case TeSTRING:
-			if(rep.numChar_ > 0)
-			{
-				type = " VARCHAR(" + Te2String(rep.numChar_) + ")";
-			}
-			else
-			{
-				type = " LONGTEXT";
-			}
-			break;
-		case TeREAL:
-			type = " DECIMAL(53, " + Te2String(rep.decimals_) + ") ";
-			break;
-		case TeINT:
-			type = " INT";
-			break;
-		case TeCHARACTER:
-			type = " CHAR";
-			break;
-		case TeDATETIME:
-			type = " DATETIME";
-			break;
-		case TeBLOB:
-			type = " LONGBLOB";
-			break; 
-		default:
-		type = " VARCHAR ";
-		sprintf (size,"(%d)",rep.numChar_);
-		type += string (size);
-		break;
-	}
-	q += field;
-	q += type;
-	bool res = execute(q);
-	if (res)
-		alterTableInfoInMemory(table);
-	return res;
-}
-
-bool 
-TeMySQL::alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName)
-{
-	if(!tableExist(tableName))
-		return false;
-
-	string tab;
-
-	if(oldColName.empty())
-	{
-		tab = " ALTER TABLE " + tableName + " MODIFY ";
-		tab += rep.name_ +"  ";
-	}
-	else
-	{
-		tab = " ALTER TABLE " + tableName + " CHANGE ";
-		tab += oldColName +" "+ rep.name_ +"  ";
-	}
-
-	switch (rep.type_)
-	{
-		case TeSTRING:
-			if(rep.numChar_ > 0)
-			{
-				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
-			}
-			else
-			{
-				tab += "LONGTEXT";
-			}
-			break;
-			
-		case TeREAL:
-			tab += "DOUBLE(24, 15)";	
-			break;
-			
-		case TeINT:
-			tab += "INT";
-			break;
-
-		case TeDATETIME:
-			tab += "DATETIME";
-			break;
-
-		case TeCHARACTER:
-			tab += "CHAR";
-			break;
-
-		case TeBLOB:
-			tab += "LONGBLOB";
-			break; 
-		
-		default:
-			tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
-			break;
-	}
-
-	tab += " NULL ";
-
-	if(!execute(tab))
-	{
-		if(errorMessage_.empty())
-			errorMessage_ = "Error alter table " + tableName + " !";
-		return false;
-	}
-
-	string tableId;
-	TeDatabasePortal* portal = getPortal();
-	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + tableName + "'";
-	if(portal->query(sql) && portal->fetchRow())
-		tableId = portal->getData(0);
-
-	delete portal;
-
-	if(tableId.empty() == false)
-	{
-		if(oldColName.empty() == false) // column name changed
-		{
-			 // update relation
-			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
-			sql += " WHERE related_table_id = " + tableId;
-			sql += " AND related_attr = '" + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-
-			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
-			sql += " WHERE external_table_name = '" + tableName + "'";
-			sql += " AND external_attr = '" + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-
-			 // update grouping
-			sql = "UPDATE te_grouping SET grouping_attr = '" + tableName + "." + rep.name_ + "'";
-			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-		}
-		else // column type changed
-		{
-			// delete relation
-			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
-			sql += " AND related_attr = '" + rep.name_ + "')";
-			sql += " OR (external_table_name = '" + tableName + "'";
-			sql += " AND external_attr = '" + rep.name_ + "')";
-			if(execute(sql) == false)
-				return false;
-
-			// delete grouping
-			TeDatabasePortal* portal = getPortal();
-			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
-			if(portal->query(sql) && portal->fetchRow())
-			{
-				string themeId = portal->getData(0);
-
-				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
-				if(execute(sql) == false)
-				{
-					delete portal;
-					return false;
-				}
-			}
-			delete portal;
-
-			sql = "DELETE FROM te_grouping";
-			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-		}
-	}
-
-	alterTableInfoInMemory(tableName);
-	return true;
-}
-
-
-TeDatabasePortal*  
-TeMySQL::getPortal ()
-{
-	TeMySQLPortal* portal = new TeMySQLPortal (this);
-	return portal;
-}
-
-bool
-TeMySQL::defineIntegrity(void)
-{
-	return true;		// mysql doesn't have referencial integrity
-						// there is nothing to be done
-}
-
-
-string TeMySQL::getConcatFieldsExpression(const vector<string>& fNamesVec)
-{
-	if (fNamesVec.empty() == true)
-		return "";
-
-	string concatExp = "CONCAT(";
-	for (unsigned int i = 0; i < fNamesVec.size(); ++i)
-	{
-		if (i != 0)
-			concatExp += ", ";
-		concatExp += fNamesVec[i];
-	}
-	concatExp += ")";
-
-	return concatExp;
-}
-
-
-
-
-TeMySQLPortal::TeMySQLPortal ( TeMySQL  *m)
-{
-	mysql_ = m->getMySQL();
-	numRows_ = 0;
-	numFields_ = 0;
-	result_ = 0;
-	row_ = 0;
-	db_ = m;
-}
-
-
-TeMySQLPortal::TeMySQLPortal ( const TeMySQLPortal& p) : TeDatabasePortal()
-{
-	mysql_ = p.mysql_;
-	numRows_ = 0;
-	numFields_ = 0;
-	result_ = 0;
-	row_ = 0;
-}
-
-
-TeMySQLPortal::~TeMySQLPortal ()
-{
-	freeResult ();
-}
-
-
-string 
-TeMySQL::escapeSequence(const string& from)
-{
-	string ret = "";
-	if (!from.empty())
-	{
-		char	*to = new char[from.size()*2+1];
-		mysql_real_escape_string(&mysql_,to,from.c_str(),from.size());
-		ret = to;
-		delete  []to;
-	}
-
-	return ret;
-}
-
-bool TeMySQLPortal::query (const string &q, TeCursorLocation /* l */, TeCursorType /* t */, TeCursorEditType /* e */, TeCursorDataType /*dt*/)
-{
-	if (result_)
-		freeResult();
-	attList_.clear ();
-
-	if (mysql_real_query(mysql_, q.c_str(), q.size()) != 0)
-	{
-		string erro = string(mysql_error(mysql_));
-		return false;
-	}
-
-	result_ = mysql_store_result(mysql_);
-	numRows_ = (int)mysql_num_rows(result_);
-	if (result_)  // there are rows
-	{
-		numFields_ = mysql_num_fields(result_);
-
-		MYSQL_FIELD *fields = mysql_fetch_fields(result_);
-		
-		int i;
-		for(i = 0; i < numFields_; i++)
-		{
-			TeAttribute attribute;
-			switch (fields[i].type)
-			{
-			case FIELD_TYPE_DECIMAL:
-			case FIELD_TYPE_TINY:
-			case FIELD_TYPE_SHORT:
-			case FIELD_TYPE_LONG:
-			case FIELD_TYPE_INT24:
-				attribute.rep_.type_ = TeINT;
-				attribute.rep_.numChar_ = fields[i].length;
-				break;
-
-			case FIELD_TYPE_FLOAT:
-			case FIELD_TYPE_DOUBLE:
-			case FIELD_TYPE_LONGLONG:
-			case FIELD_TYPE_NEWDECIMAL:
-				attribute.rep_.type_ = TeREAL;
-				attribute.rep_.numChar_ = fields[i].length;
-				attribute.rep_.decimals_ = fields[i].decimals;
-				break;
-
-			case FIELD_TYPE_DATE:
-			case FIELD_TYPE_TIME:
-			case FIELD_TYPE_DATETIME:
-			case FIELD_TYPE_YEAR:
-			case FIELD_TYPE_NEWDATE:
-				attribute.rep_.type_ = TeDATETIME;
-				attribute.dateTimeFormat_ = "YYYYsMMsDDsHHsmmsSS24";
-				attribute.dateChronon_ = TeSECOND;
-				break;
-
-			case FIELD_TYPE_TINY_BLOB:
-			case FIELD_TYPE_MEDIUM_BLOB:
-			case FIELD_TYPE_LONG_BLOB:
-			case FIELD_TYPE_BLOB:
-				if (fields[i].flags & BINARY_FLAG)
-				{
-					attribute.rep_.type_ = TeBLOB;
-				}
-				else
-				{
-					attribute.rep_.type_ = TeSTRING; //como tipo TEXT
-				}
-				break;
-
-			case FIELD_TYPE_VAR_STRING:
-			case FIELD_TYPE_STRING:
-				attribute.rep_.type_ = TeSTRING;
-				attribute.rep_.numChar_ = fields[i].length;
-				break;
-
-			case FIELD_TYPE_ENUM:
-			case FIELD_TYPE_SET:
-			default :
-				attribute.rep_.type_ = TeUNKNOWN;
-				break;
-			}
-			if (fields[i].flags & PRI_KEY_FLAG)
-				attribute.rep_.isPrimaryKey_ = true;
-
-			if (fields[i].flags & AUTO_INCREMENT_FLAG)
-				attribute.rep_.isAutoNumber_ = true;
-
-			attribute.rep_.name_ = fields[i].name;
-			attList_.push_back ( attribute );
-		}
-    }
-    else  // mysql_store_result() returned nothing; should it have?
-    {
-        if(mysql_field_count(mysql_) == 0)
-        {
-	        // query does not return data
-            // (it was not a SELECT)
-			numFields_ = 0;
-            numRows_ = (int)mysql_affected_rows(mysql_);
-        }
-        else // mysql_store_result() should have returned data
-        {
-            return false;
-        }
-    }
-	return true;
-}
-
-
-bool 
-TeMySQLPortal::fetchRow ()
-{
-	if ((row_ = mysql_fetch_row(result_)))
-		return true;
-	else
-		return false;
-}
-
-
-bool 
-TeMySQLPortal::fetchRow (int i)
-{
-	if (i >= 0 && i < numRows_)
-	{
-		mysql_data_seek (result_, i);
-		return fetchRow ();
-	}
-	else
-		return false;
-}
-
-
-void TeMySQLPortal::freeResult ()
-{
-	if (result_)
-	{
-		mysql_free_result(result_);
-		result_ = 0;
-	}
-}
-
-
-int 
-TeMySQLPortal::insertId ()
-{
-	return (int)mysql_insert_id(mysql_);
-}
-
-
-int 
-TeMySQL::insertId ()
-{
-	return (int)mysql_insert_id(&mysql_);
-}
-
-
-
-bool 
-TeMySQL::insertProjection (TeProjection *proj)
-{
-	char q[512];
-	sprintf (q,"INSERT INTO te_projection VALUES(0,'%s',%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,'%s',%.15f,%d,'%s',%.15f,%.15f,%.15f,%.15f,%.15f)",
-	proj->name().c_str(),
-		proj->params().lon0*TeCRD,
-		proj->params().lat0*TeCRD,
-		proj->params().offx,
-		proj->params().offy,
-		proj->params().stlat1*TeCRD,
-		proj->params().stlat2*TeCRD,
-		proj->params().units.c_str(),
-		proj->params().scale,
-		proj->params().hemisphere,
-		proj->datum().name().c_str(),
-		proj->datum().radius(),
-		proj->datum().flattening(),
-		proj->datum().xShift(),
-		proj->datum().yShift(),
-		proj->datum().zShift());
-
-	if (!execute(q))
-		return false;
-
-	proj->id(insertId());
-
-	return true;
-}
-
-
-bool 
-TeMySQL::insertView (TeView *view)
-{
-	TeProjection* proj = view->projection();
-	// save its projection
-	if (!proj || !insertProjection(proj))
-	{
-		errorMessage_ = "Error inserting projection";
-		return false;
-	}
-
-	char q[512];
-	if(view->getCurrentTheme() > 0)
-	{
-		sprintf (q,"INSERT INTO te_view VALUES(0,%d,'%s','%s',%d,%E,%E,%E,%E,%d)",
-				proj->id(),view->name().c_str(),view->user().c_str(),view->isVisible(),
-				view->getCurrentBox().lowerLeft().x(),view->getCurrentBox().lowerLeft().y(),
-				view->getCurrentBox().upperRight().x(),view->getCurrentBox().upperRight().y(),
-				view->getCurrentTheme());
-	}
-	else
-	{
-		sprintf (q,"INSERT INTO te_view VALUES(0,%d,'%s','%s',%d,%E,%E,%E,%E,NULL)",
-				proj->id(),view->name().c_str(),view->user().c_str(),view->isVisible(),
-				view->getCurrentBox().lowerLeft().x(),view->getCurrentBox().lowerLeft().y(),
-				view->getCurrentBox().upperRight().x(),view->getCurrentBox().upperRight().y());
-	}
-
-	if (!execute(q))
-		return false;
-
-	view->id(insertId());
-
-	for (unsigned int th=0; th<view->size(); th++)
-	{
-		TeViewNode* node = view->get (th);
-		if (node->type() == TeTHEME)
-		{
-			TeTheme *theme = (TeTheme*) node;
-			insertTheme (theme);
-		}
-		else
-		{
-			TeViewTree* tree = (TeViewTree*)node;
-			insertViewTree (tree);
-		}
-	}
-
-	viewMap()[view->id()] = view;
-	return true;
-}
-
-
-bool 
-TeMySQL::insertViewTree (TeViewTree *tree)
-{
-	string save;
-	save = "INSERT INTO te_theme (name, layer_id, node_type, view_id, priority) VALUES('','";
-	save += tree->name() +  "," + Te2String(tree->parentId()) + "," + Te2String((int)tree->type());
-	save += "," + Te2String(tree->view()) + "," + Te2String(tree->priority()) + ")";
-	if (!execute(save))
-		return false;
-	tree->id(insertId());
-	return true;
-}
-
-
-bool 
-TeMySQL::insertTheme (TeAbstractTheme *tem)
-{
-	string save;
-	save = "INSERT INTO te_theme ";
-	save += "(layer_id, view_id, name, parent_id, priority, node_type, min_scale, max_scale, ";
-	save += "generate_attribute_where, generate_spatial_where, generate_temporal_where, ";
-	save += "collection_table, visible_rep, enable_visibility, lower_x, lower_y, upper_x, upper_y, creation_time) ";
-	save += " VALUES(";
-	
-	if(tem->type()==TeTHEME)
-		save += Te2String(static_cast<TeTheme*>(tem)->layerId()) +", " ;
-	else
-		save += " NULL, ";
-
-	save += Te2String(tem->view()) +", ";
-	save += "'" + escapeSequence(tem->name()) + "', ";
-	save += Te2String(tem->parentId()) +", ";
-	save += Te2String(tem->priority()) +", ";
-	save += Te2String(tem->type()) +", ";
-	save += Te2String(tem->minScale(), 15) +", ";
-	save += Te2String(tem->maxScale(), 15) +", ";
-	save += "'" + escapeSequence(tem->attributeRest()) + "', ";
-	save += "'" + escapeSequence(tem->spatialRest()) + "', ";
-	save += "'" + escapeSequence(tem->temporalRest()) + "', ";
-
-	if(tem->type()==TeTHEME)
-		save += " '" + escapeSequence(static_cast<TeTheme*>(tem)->collectionTable()) + "', ";
-	else
-		save += " '', ";
-
-	save += Te2String(tem->visibleRep()) +", ";
-	save += Te2String(tem->visibility()) +", ";
-	save += Te2String(tem->box().x1()) +", ";
-	save += Te2String(tem->box().y1()) +", ";
-	save += Te2String(tem->box().x2()) +", ";
-	save += Te2String(tem->box().y2()) +",  ";
-	TeTime creationTime = tem->getCreationTime();
-	save += getSQLTime(creationTime);
-	save += " ) ";
-
-	if (!this->execute(save))
-		return false;
-
-	tem->id(this->insertId());
-
-	if((tem->type()==TeTHEME || tem->type()==TeEXTERNALTHEME)&& static_cast<TeTheme*>(tem)->collectionTable().empty())
-	{
-		string colTab = "te_collection_" + Te2String(tem->id());
-		static_cast<TeTheme*>(tem)->collectionTable(colTab);
-		save = "UPDATE te_theme SET collection_table='" + colTab + "' WHERE theme_id=" ;
-		save += Te2String(tem->id());
-		this->execute(save);
-	}
-
-	bool status;
-
-	// insert grouping
-	int numSlices = 0;
-	if(tem->grouping().groupMode_ != TeNoGrouping)
-	{
-		if(!insertGrouping (tem->id(), tem->grouping()))
-			return false;
-		numSlices = tem->grouping().groupNumSlices_;
-	}
-		
-	tem->outOfCollectionLegend().group(-1); 
-	tem->outOfCollectionLegend().theme(tem->id()); 
-	status = insertLegend (&(tem->outOfCollectionLegend())); 
-	if (!status)
-		return status;
-
-	tem->withoutDataConnectionLegend().group(-2); 
-	tem->withoutDataConnectionLegend().theme(tem->id()); 
-	status = insertLegend (&(tem->withoutDataConnectionLegend())); 
-	if (!status)
-		return status;
-
-	tem->defaultLegend().group(-3); 
-	tem->defaultLegend().theme(tem->id()); 
-	status = insertLegend (&(tem->defaultLegend())); 
-	if (!status)
-		return status;
-
-	tem->pointingLegend().group(-4); 
-	tem->pointingLegend().theme(tem->id()); 
-	status = insertLegend (&(tem->pointingLegend())); 
-	if (!status)
-		return status;
-
-	tem->queryLegend().group(-5); 
-	tem->queryLegend().theme(tem->id()); 
-	status = insertLegend (&(tem->queryLegend())); 
-	if (!status)
-		return status;
-
-	tem->queryAndPointingLegend().group(-6); 
-	tem->queryAndPointingLegend().theme(tem->id()); 
-	status = insertLegend (&(tem->queryAndPointingLegend())); 
-	if (!status)
-		return status;
-
-	for (int i = 0; i < numSlices; i++)
-	{
-		tem->legend()[i].group(i);
-		tem->legend()[i].theme(tem->id());
-		status = insertLegend (&(tem->legend()[i]));
-		if (!status)
-			return status;
-	}
-	if (!status)
-		return status;
-
-	//insert metadata theme
-	if(!tem->saveMetadata(this))
-		return false;
-
-	themeMap()[tem->id()] = tem;
-
-	if(tem->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(tem)))
-		return false;
-
-	return true;
-}
-
-bool 
-TeMySQL::insertThemeGroup (TeViewTree* tree)
-{
-	string save;
-	save = "INSERT INTO te_theme ";
-	save += "(name,parent_id,node_type,view_id,priority) ";
-	save += " VALUES ('" + tree->name() + "',1,1, ";
-	save += Te2String(tree->view()) +", ";
-	save += Te2String(tree->priority()) +") ";
-	if (!this->execute(save))
-		return false;
-	tree->id(this->insertId());
-	return true;
-}
-
-
-bool 
-TeMySQL::generateLabelPositions (TeTheme *theme, const std::string& objectId)
-{
-	string	geomTable, query;
-	string	collTable = theme->collectionTable();
-
-	if((collTable.empty()) || (!tableExist(collTable)))
-		return false;
-
-	if (theme->layer()->hasGeometry(TeLINES))
-	{	
-		geomTable = theme->layer()->tableName(TeLINES);
-				
-		string extMax = "CREATE TEMPORARY TABLE maxTable";
-		extMax += " SELECT object_id, lower_x, lower_y, upper_x, upper_y";
-		extMax += " FROM " + geomTable; 
-		if(!objectId.empty())
-			extMax += " WHERE object_id = '"+ objectId +"'";
-		extMax += " ORDER BY object_id, ext_max DESC ";
-		
-		if(!execute(extMax))
-			return false;
-
-		query = "UPDATE " + collTable + ",maxTable SET label_x = (lower_x + upper_x)/2,";
-		query += "label_y = (lower_y + upper_y)/2 WHERE c_object_id = object_id";
-
-		if (execute(query) == false)
-		{
-			execute("DROP TABLE maxTable");
-			return false;
-		}
-
-		execute("DROP TABLE maxTable");
-	}
-
-	if (theme->layer()->hasGeometry(TePOINTS))
-	{
-		geomTable = theme->layer()->tableName(TePOINTS);
-
-		query = "UPDATE " + collTable + "," + geomTable + " SET label_x = x,";
-		query += "label_y = y WHERE c_object_id = object_id";
-
-		if(!objectId.empty())
-			query += " AND c_object_id = '"+ objectId +"'";
-
-		if(execute(query) == false)
-			return false;
-	}
-	
-	if (theme->layer()->hasGeometry(TePOLYGONS))
-	{	
-		geomTable = theme->layer()->tableName(TePOLYGONS);
-				
-		string extMax = "CREATE TEMPORARY TABLE maxTable";
-		extMax += " SELECT object_id, lower_x, lower_y, upper_x, upper_y";
-		extMax += " FROM " + geomTable; 
-		if(!objectId.empty())
-			extMax += " WHERE object_id = '"+ objectId +"'";
-		extMax += " ORDER BY object_id, ext_max DESC ";
-
-		if(!execute(extMax))
-			return false;
-
-		query = "UPDATE " + collTable + ",maxTable SET label_x = (lower_x + upper_x)/2,";
-		query += "label_y = (lower_y + upper_y)/2 WHERE c_object_id = object_id";
-		if(!objectId.empty())
-			query += " AND c_object_id = '"+ objectId +"'";
-
-		if (execute(query) == false)
-		{
-			execute("DROP TABLE maxTable");
-			return false;
-		}
-		
-		execute("DROP TABLE maxTable");
-	}
-	
-	if(theme->layer()->hasGeometry(TeCELLS))
-	{
-		geomTable = theme->layer()->tableName(TeCELLS);
-
-		query = "UPDATE " + collTable + "," + geomTable + " SET label_x = (lower_x + upper_x)/2,";
-		query += "label_y = (lower_y + upper_y)/2 WHERE c_object_id = object_id";
-		if(!objectId.empty())
-			query += " AND c_object_id = '"+ objectId +"'";
-
-		if (execute(query) == false)
-			return false;	
-	}
-	return true;
-}
-
-
-bool
-TeMySQL::insertLayer (TeLayer* layer)
-{
-	TeProjection* proj = layer->projection();
-	if (!proj || !insertProjection(proj))
-	{
-		errorMessage_ = "Error inserting projection";
-		return false;
-	}
-	int pid = proj->id();
-	string save = "INSERT INTO te_layer (layer_id,projection_id,name,lower_x,lower_y,upper_x,upper_y,edition_time) VALUES(0,";
-	save += Te2String(pid);
-	save += ",'" + layer->name() + "', ";
-	save += Te2String(layer->box().x1_, 15) + ", ";
-	save += Te2String(layer->box().y1_, 15) + ", ";
-	save += Te2String(layer->box().x2_, 15) + ", ";
-	save += Te2String(layer->box().y2_, 15) + ", ";
-	TeTime editionTime = layer->getEditionTime();
-	save += getSQLTime(editionTime) + ")";
-
-	// if layer insertion fails remove projection
-	if (!this->execute (save))
-	{
-		string sql = "DELETE FROM te_projection WHERE  projection_id = " + Te2String(pid);
-		this->execute(sql);	
-		return false;
-	}
-
-	layer->id(this->insertId());
-	layerMap()[layer->id()] = layer;
-
-	return true;
-}
-
-bool
-TeMySQL::insertProject (TeProject* project)
-{
-	if (!project)
-		return false;
-
-	string save = "INSERT INTO te_project (project_id, name, description, current_view) VALUES(0,";
-	save += "'" + project->name() + "', ";
-	save += "'" + project->description() + "', ";
-	save += Te2String(project->getCurrentViewId())+ ")";
-
-	// if layer insertion fails remove projection
-	if (!this->execute (save))
-		return false;
-	
-	project->setId(this->insertId());
-	projectMap()[project->id()] = project;
-	for (unsigned int i=0; i<project->getViewVector().size(); i++)
-		insertProjectViewRel(project->id(), project->getViewVector()[i]);
-	return true;
-}
-
-bool TeMySQL::insertLegend (TeLegendEntry *legend)
-{
-	char q[1024];
-	string save;
-	sprintf (q,"INSERT INTO te_legend VALUES(0,%d,%d,%d,'%s','%s','%s')",
-	legend->theme(),
-	legend->group(),
-	legend->count(),
-	escapeSequence(legend->from()).c_str(),
-	escapeSequence(legend->to()).c_str(),
-	escapeSequence(legend->label()).c_str());
-	save = q;
-
-	if (!this->execute(save))
-		return false;
-
-	int legId = insertId();
-	legend->id(legId);
-	legendMap()[legend->id()] = legend;
-	return insertVisual(legend);
-}
-
-
-bool
-TeMySQL::insertRepresentation (int layerId, TeRepresentation& rep)
-{
-	if (layerId <= 0)
-		return false;
-	
-	string sql;
-	sql = "INSERT INTO te_representation (layer_id, geom_type, geom_table, description,";
-	sql += "lower_x, lower_y, upper_x, upper_y, res_x, res_y, num_cols, num_rows) VALUES( ";
-	sql += Te2String(layerId) + ", ";
-	sql += Te2String(static_cast<int>(rep.geomRep_)) + ", ";
-	sql += "'" + rep.tableName_ + "', ";
-	sql += "'" + rep.description_ + "',";
-	sql += Te2String(rep.box_.x1_,15) + ", ";
-	sql += Te2String(rep.box_.y1_,15) + ", ";
-	sql += Te2String(rep.box_.x2_,15) + ", ";
-	sql += Te2String(rep.box_.y2_,15) + ", ";
-	sql += Te2String(rep.resX_) + ", ";
-	sql += Te2String(rep.resY_) + ", ";
-	sql += Te2String(rep.nCols_) + ", ";
-	sql += Te2String(rep.nLins_) + ") ";
-	if (execute(sql))
-	{
-		rep.id_ = (this->insertId());
-		return true;
-	}
-	return false;
-}
-
-bool 
-TeMySQL::insertRelationInfo(const int tableId, const string& tField,
-						    const string& eTable, const string& eField, int& relId)
-{
-	// check if relation already exists
-	TeMySQLPortal* portal = (TeMySQLPortal*) this->getPortal();
-	if (!portal)
-		return false;
-
-	relId = -1;
-	string sel = "SELECT relation_id FROM te_tables_relation WHERE";
-	sel += " related_table_id = " + Te2String(tableId);
-	sel += " AND related_attr = '" + tField + "'";
-	sel += " AND external_table_name = '" + eTable + "'";
-	sel += " AND external_attr = '" + eField + "'";
-	if (!portal->query(sel))
-	{
-		delete portal;
-		return false;
-	}
-
-	if (portal->fetchRow())
-	{
-		relId = atoi(portal->getData(0));
-		delete portal;
-		return true;
-	}
-	delete portal;
-
-	string sql = "INSERT INTO te_tables_relation(related_table_id, related_attr, external_table_name, external_attr) ";
-	sql += " VALUES( ";
-	sql += Te2String(tableId);
-	sql += ",'" + tField + "'";
-	sql += ",'" + eTable + "'";
-	sql += ",'" + eField + "')";
-	if (!this->execute(sql))
-		return false;
-	relId = this->insertId(); 
-	return true;
-}
-
-bool 
-TeMySQL::insertTable(TeTable &table)
-{
-	string tableName = table.name();
-	int size = table.size();
-	TeAttributeList att = table.attributeList();
-	TeAttributeList::iterator it = att.begin();
-	TeAttributeList::iterator itEnd = att.end();
-	TeTableRow row;
-	
-	if (!beginTransaction())
-		return false;
-
-	int i;
-	unsigned int j;
-	for ( i = 0; i < size; i++ )	
-	{
-		row = table[i];
-		it = att.begin();
-		string attrs;
-		string values;
-		j = 1;
-		unsigned int jj = 0;
-		while ( it != itEnd )
-		{
-			if ((jj>=row.size()) || row[jj].empty() || (*it).rep_.isAutoNumber_)
-			{
-				++it;
-				j++;
-				jj++;
-				continue;
-			}
-			
-			if (!values.empty())
-			{
-				attrs += ", ";
-				values += ", ";
-			}			
-			attrs += (*it).rep_.name_;			
-			switch ((*it).rep_.type_)
-			{
-			case TeSTRING:
-				values += "'"+ escapeSequence( row[jj] ) +"'";
-				break;
-			case TeREAL:
-				{
-				std::string strValue = row[jj];
-				replace(strValue.begin(), strValue.end(), ',', '.');
-				values += strValue;
-				}
-				break;
-			case TeINT:
-				values += row[jj];
-				break;
-			case TeDATETIME:
-				{
-					const string temp_dt = string(row[jj].c_str());
-					TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
-					values += this->getSQLTime(t);
-				}
-				break;
-			case TeCHARACTER:
-				values += "'" + escapeSequence(row[jj]) + "'";
-				break;
-			case TeBLOB:
-				values += "'" + escapeSequence(row[jj]) + "'";
-			default:
-				values += "'"+ escapeSequence(row[jj]) +"'";
-				break;
-			}
-			++it;
-			j++;
-			jj++;
-		}
-
-		if (values.empty()) 
-			continue;
-
-		string q = "INSERT INTO "+tableName + " ("+ attrs+") " + " VALUES ("+values+") ";
-		if (!execute(q)) 
-			continue;
-	}
-
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool
-TeMySQL::updateTable(TeTable &table)
-{
-	TeAttributeList& att = table.attributeList();
-	unsigned int i;
-	string uniqueVal;
-	bool isUniqueValString = false;
-	
-	if (!beginTransaction())
-		return false;
-
-	string uniqueName = table.uniqueName(); // primary key explicitly defined or 
-	if (table.uniqueName().empty())			// check in the attribute list
-	{								
-		for (i=0; i<att.size(); ++i)
-			if (att[i].rep_.isPrimaryKey_)
-			{
-				uniqueName = att[i].rep_.name_;
-				table.setUniqueName(uniqueName);
-				break;
-			}
-	}
-
-	TeAttributeList::iterator it;
-	TeTableRow row;
-	unsigned int j;
-	bool useComma = false;
-	for (i = 0; i < table.size(); i++  )
-	{
-		row = table[i];
-		it = att.begin();
-		string q;
-		j = 1;
-		int jj = 0;
-		while ( it != att.end() )
-		{
-			if (uniqueName != (*it).rep_.name_)
-			{
-				if ((*it).rep_.isAutoNumber_)
-				{
-					++it;
-					j++;
-					jj++;
-					continue;
-				}			
-				if(useComma == true)
-				{
-					q += ", ";
-				}
-				else
-				{
-					useComma = true;
-				}
-				q += (*it).rep_.name_ + " = ";
-				  				
-				if(row[jj].empty())
-				{
-					q += " null";
-
-					++it;
-					j++;
-					jj++;
-					continue;
-				}
-
-  				switch ((*it).rep_.type_)
-  				{
-  					case TeSTRING:
-						q += "'"+escapeSequence(row[jj])+"'";
-  					break;
-  					case TeREAL:
-					{
-						std::string value = row[jj];
-						replace(value.begin(), value.end(), ',', '.');
-						q += value;
-					}
-  					break;
-  					case TeINT:
-						q += row[jj];
-  					break;
-					case TeDATETIME:
-					{
-						const string temp_dt = string(row[jj].c_str());
-						TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
-						q += this->getSQLTime(t);
-					}
-  					break;
-					case TeCHARACTER:
-						q += "'" + escapeSequence(row[jj]) + "'";
-  					break;
-					case TeBLOB:
-						q += "'" + escapeSequence(row[jj]) + "'";
-					break;
-  					default:
-						q += "'"+escapeSequence(row[jj])+"'";
-  					break;
-  				}
-			}
-			else
-			{
-				uniqueVal = row[jj];
-				isUniqueValString = ((*it).rep_.type_ == TeSTRING);
-			}
-			++it;
-			j++;
-			jj++;
-		}
-		if (q.empty())
-			continue;
-		
-		if (!uniqueName.empty() && !uniqueVal.empty())  
-		{
-			if(isUniqueValString)
-				q += " WHERE " + uniqueName + " = '" + uniqueVal +"'";
-			else
-				q += " WHERE " + uniqueName + " = " + uniqueVal;
-		}
-		string sql = "UPDATE "+ table.name() + " SET " + q;
-		if (!execute(sql))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeMySQL::insertTableInfo (int layerId, TeTable &table, const string& user)
-{
-	string sql;
-
-	sql = "INSERT INTO te_layer_table (unique_id, attr_link,attr_initial_time, attr_final_time, attr_time_unit,attr_table_type, ";
-	sql += " user_name, attr_table ";
-	if (layerId > 0)
-		sql += ",layer_id";
-	sql += ") VALUES( ";
-	sql += "'" + table.uniqueName() + "', ";
-	sql += "'" + table.linkName() + "', ";
-	sql += "'" + table.attInitialTime() + "', ";
-	sql += "'" + table.attFinalTime() + "', ";
-	sql += "" + Te2String(table.attTimeUnit()) + ", ";
-	sql += ""+ Te2String(table.tableType()) + ", ";
-	sql += "'" + user + "','" + table.name() +"'";
-	if (layerId > 0)
-		sql += ", " + Te2String(layerId) ;
-	sql += ")";
-
-	if (!this->execute(sql))
-		return false;
-
-	int id = (this->insertId());
-	table.setId(id);
-	return true;
-}
-
-bool 
-TeMySQL::insertThemeTable (int themeId, int tableId, int relationId, int tableOrder)
-{
-	string relId;
-	if (relationId > 0)
-		relId = Te2String(relationId);
-	else
-		relId = "NULL";
-
-	string sql = "INSERT INTO te_theme_table VALUES (0,";
-	sql += Te2String(themeId) + "," + Te2String(tableId) + ",";
-	sql += relId + "," + Te2String(tableOrder) + ")";
-
-
-	if (!execute(sql))
-		return false;
-
-	return true;
-}
-
-bool
-TeMySQL::insertPolygonSet(const string& table, TePolygonSet &ps)
-{
-	double		ext_max;
-	unsigned int	i, ni, size, npts=100;
-	unsigned int k;
-	double		*points	= new double[2*sizeof(double)*100];
-	char		buf[256], *query, *end;
-	int			parentId = 0;
-	unsigned int querySize = 100*4*sizeof(double)+256+4;
-	query = new char[querySize];
-	npts = 0;
-	this->beginTransaction();
-	for (unsigned int p = 0; p < ps.size(); ++p)
-	{
-		TePolygon& poly = ps [p];
-		parentId = 0;
-		for (k=0; k<poly.size(); ++k)
-		{
-			TeLinearRing& ring(poly[k]);
-			TeBox b = ring.box();
-			size = ring.size();
-			ni = 0;
-			ext_max = MAX(b.width(),b.height());
-			if (k==0)
-				ni = poly.size()-1;
-			else
-				ni = 0;
-
-			// Create and save the BLOB
-			if (points && size > npts)
-			{
-				delete [] points;
-				points = new double[2*sizeof(double)*size];
-				npts = size;
-			}
-			int iac = 0;
-			for (i=0;i<size;++i)
-			{
-				points[iac++]=swappd(ring[i].x());
-				points[iac++]=swappd(ring[i].y());
-			}
-
-			sprintf (buf,"INSERT INTO %s values(0,'%s',%d,%d,%d,%.15f,%.15f,%.15f,%.15f,%.15f,",
-				table.c_str(),escapeSequence(poly.objectId()).c_str(),size,ni,parentId,b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
-
-			if (query && (size*4*sizeof(double)+strlen(buf)+4) > querySize)
-			{
-				delete [] query;
-				querySize = size*4*sizeof(double)+strlen(buf)+4;
-				query = new char[querySize];
-			}
-			end = strxmov(query,buf,(char*)0);
-			*end++ = '\'';
-			end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
-			*end++ = '\'';
-			*end++ = ')';
-
-			if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
-			{
-				errorMessage_ = string(mysql_error(&mysql_));
-				delete []query;
-				break;
-			}
-			ring.geomId (insertId());
-			if (k==0)
-			{
-				parentId = ring.geomId();
-				ps[p].geomId(parentId);
-			}
-		}
-		sprintf(buf,"UPDATE %s SET parent_id=%d WHERE geom_id=%d",table.c_str(),parentId,parentId);
-		if (mysql_real_query(&mysql_,buf,(unsigned int)strlen(buf)) != 0)
-		{
-			errorMessage_ = string(mysql_error(&mysql_));
-			delete []query;
-			break;
-		}	
-	}
-	if (points)
-		delete []points;
-	if (query)
-		delete []query;
-	this->commitTransaction();
-	return true;
-}
-
-bool 
-TeMySQL::insertPolygon (const string& table, TePolygon &poly )
-{
-	double	ext_max;
-
-	int	i,
-		ni,
-		size;
-	unsigned int k;
-	double	*points	= NULL;
-	char	buf[256], *query, *end;
-
-
-	int parentId = 0;
-	for ( k = 0; k < poly.size(); k++ )
-	{
-		TeLinearRing ring ( poly[k] );
-		TeBox b = ring.box();
-		size = ring.size();
-		ni = 0;
-		ext_max = MAX(b.width(),b.height());
-		if (k==0)
-			ni = poly.size()-1;
-		else
-			ni = 0;
-
-		// Create and save the BLOB
-		points = new double[2*sizeof(double)*size];
-
-		int iac = 0;
-		for (i=0;i<size;i++)
-		{
-			points[iac++]=swappd(ring[i].x());
-			points[iac++]=swappd(ring[i].y());
-		}
-
-		sprintf (buf,"INSERT INTO %s values(0,'%s',%d,%d,%d,%.15f,%.15f,%.15f,%.15f,%.15f,",
-			table.c_str(),escapeSequence(poly.objectId()).c_str(),size,ni,parentId,b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
-
-		query = new char[size*4*sizeof(double)+strlen(buf)+4];
-		end = strxmov(query,buf,(char*)0);
-		*end++ = '\'';
-		end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
-		*end++ = '\'';
-		*end++ = ')';
-		delete []points;
-
-		if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
-		{
-			errorMessage_ = string(mysql_error(&mysql_));
-			delete []query;
-			return false;
-		}
-		delete []query;
-		query = 0;
-		ring.geomId (insertId());
-		if (k==0)
-		{
-			parentId = ring.geomId();
-			poly.geomId(parentId);
-		}
-	}
-	sprintf(buf,"UPDATE %s SET parent_id=%d WHERE geom_id=%d",table.c_str(),parentId,parentId);
-	if (mysql_real_query(&mysql_,buf,(unsigned int)strlen(buf)) != 0)
-	{
-		errorMessage_ = string(mysql_error(&mysql_));
-		delete []query;
-		return false;
-	}	
-	return true;
-}
-
-bool 
-TeMySQL::updatePolygon (const string& table, TePolygon &poly )
-{
-	double	ext_max;
-	int ni;
-	unsigned int i,k,size,parentId;
-	double	*points	= NULL;
-	char	buf[256], message[256], *query, *end;
-	TeBox b = poly.box();
-
-	std::string objectId = poly.objectId();
-	for ( k = 0; k < poly.size(); k++ )
-	{
-		TeLinearRing ring ( poly[k] );
-		size = ring.size();
-		ni = 0;
-		if (k==0)
-		{
-			ext_max = MAX(b.width(),b.height());
-			ni = poly.size()-1;
-			parentId = ring.geomId();
-		}
-		else
-			ni = 0;
-
-// Create and save the BLOB
-		points = new double[2*sizeof(double)*size];
-		int iac = 0;
-		for (i=0;i<size;i++)
-		{
-			points[iac++]=swappd(ring[i].x());
-			points[iac++]=swappd(ring[i].y());
-		}
-
-		sprintf (buf,"UPDATE %s SET object_id=%s, num_coords=%d, num_holes=%d, parent_id=%d, lower_x=%.15f, lower_y=%.15f, upper_x=%.15f, upper_y=%.15f, ext_max=%.15f, spatial_data=",
-			table.c_str(),escapeSequence(objectId).c_str(),size,ni,parentId,b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
-		query = new char[size*4*sizeof(double)+strlen(buf)+50];
-		end = strxmov(query,buf,(char*)0);
-		*end++ = '\'';
-		end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
-		*end++ = '\'';
-		sprintf (message," WHERE geom_id=%d",ring.geomId());
-		end = strxmov(end,message,0);
-		delete []points;
-
-		if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
-		{
-			errorMessage_ = string(mysql_error(&mysql_));
-			delete []query;
-			return false;
-		}
-		delete []query;
-		query = 0;
-	}
-	return true;
-}
-
-
-bool 
-TeMySQLPortal::fetchGeometry (TePolygon& poly)
-{
-	int ni,j;
-	TeLinearRing ring = this->getLinearRing(ni);
-	poly.objectId ( ring.objectId() );
-	poly.geomId ( ring.geomId() );
-	poly.add ( ring );
-	int parentId = poly.geomId();
-	while (fetchRow())
-	{
-		if (atoi(this->getData("parent_id")) == parentId)
-		{
-			TeLinearRing ring = getLinearRing(j);
-			poly.add ( ring );
-		}
-		else
-			return true;
-	}
-	return false;
-}
-
-bool 
-TeMySQLPortal::fetchGeometry (TePolygon& poly, const unsigned int& initIndex)
-{
-	int np, ni,k;
-	double x,y,*data;
-	
-	TeLine2D line;
-	line.geomId(atoi(getData(initIndex)));
-	line.objectId(getData(initIndex+1));
-	np = atoi (getData(initIndex+2));
-	ni = atoi (getData(initIndex+3));
-	data = (double*)getData(initIndex+10);
-	for (k=0;k<np;k++)
-	{
-		x = swappd(*data++);
-		y = swappd(*data++);
-		TeCoord2D pt(x,y);
-		line.add(pt);
-	}
-
-	TeLinearRing ring(line); 
-	poly.objectId ( ring.objectId() );
-	poly.geomId ( ring.geomId() );
-	poly.add ( ring );
-	int parentId = poly.geomId();
-	while (fetchRow())
-	{
-		if (atoi(this->getData(initIndex+4)) == parentId)
-		{
-			TeLine2D hole;
-			hole.geomId(atoi(getData(initIndex)));
-			hole.objectId(getData(initIndex+1));
-			np = atoi (getData(initIndex+2));
-			data = (double*)getData(initIndex+10);
-			for (k=0;k<np;k++)
-			{
-				x = swappd(*data++);
-				y = swappd(*data++);
-				TeCoord2D pt(x,y);
-				line.add(pt);
-			}
-
-			TeLinearRing ring(line); 
-			poly.add ( ring );
-		}
-		else
-			return true;
-	}
-	return false;
-}
-
-
-TeLinearRing 
-TeMySQLPortal::getLinearRing (int &ni)
-{
-	int index = atoi(getData("geom_id"));
-	string object_id = getData("object_id");
-	int np = atoi (getData("num_coords"));
-	ni = atoi (getData("num_holes"));
-	TeBox b (getDouble("lower_x"),getDouble("lower_y"),getDouble("upper_x"),getDouble("upper_y"));
-	int k;
-	TeLine2D line;
-	double x,y,*data = (double*)getData("spatial_data");
-
-	for (k=0;k<np;k++)
-	{
-		x = swappd(*data++);
-		y = swappd(*data++);
-		TeCoord2D pt(x,y);
-		line.add(pt);
-	}
-
-	TeLinearRing ring ( line );
-	ring.objectId (object_id);
-	ring.geomId (index);
-	ring.setBox (b);
-	return ring;
-}
-
-bool 
-TeMySQL::insertLineSet(const string& table, TeLineSet &ls)
-{
-	char	buf[256],
-			*query,
-			*end;
-	unsigned int npts = 100, size;
-	double	*points	= new double[2*sizeof(double)*npts],
-			ext_max;
-	int		iac;
-	TeBox	b;
-	unsigned int querySize = 100*4*sizeof(double)+256+4;
-	query = new char[querySize];
-
-	unsigned int nl, i;
-	this->beginTransaction();
-	for ( nl = 0; nl < ls.size(); ++nl)
-	{
-		TeLine2D& l = ls[nl];
-		b=l.box();
-		ext_max = MAX(b.width(),b.height());
-
-		size = l.size();
-		if (size > npts)
-		{
-			delete []points;
-			points = new double[2*sizeof(double)*size];
-			npts = size;
-		}
-		iac = 0;
-		for (i=0;i<size;i++)
-		{
-			points[iac++]=l[i].x();
-			points[iac++]=l[i].y();
-		}
-
-		sprintf (buf,"INSERT INTO %s values(0,'%s',%d,%.15f,%.15f,%.15f,%.15f,%.15f,",
-		table.c_str(),
-		escapeSequence(l.objectId()).c_str(),
-		size,
-		b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
-
-		if ((size*4*sizeof(double)+strlen(buf)+4) > querySize)
-		{
-			delete []query;
-			querySize = size*4*sizeof(double)+strlen(buf)+4;
-			query = new char[querySize];
-		}
-		end = strxmov(query,buf,0);
-		*end++ = '\'';
-		end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
-		*end++ = '\'';
-		*end++ = ')';
-
-		if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
-		{
-			errorMessage_ = string(mysql_error(&mysql_));
-			break;
-		}
-
-		l.geomId (insertId());
-	}
-	this->commitTransaction();
-	delete []points;
-	delete []query;
-	return true;
-}
-
-bool 
-TeMySQL::insertLine (const string& table, TeLine2D &l)
-{
-	char	buf[256],
-			*query,
-			*end;
-	double	*points	= NULL,
-			ext_max;
-	int		size=l.size(),
-			i,
-			iac;
-	TeBox	b=l.box();
-
-	ext_max = MAX(b.width(),b.height());
-	points = new double[2*sizeof(double)*size];
-	iac = 0;
-
-	for (i=0;i<size;i++)
-	{
-		points[iac++]=l[i].x();
-		points[iac++]=l[i].y();
-	}
-
-	sprintf (buf,"INSERT INTO %s values(0,'%s',%d,%.15f,%.15f,%.15f,%.15f,%.15f,",
-	table.c_str(),
-	escapeSequence(l.objectId()).c_str(),
-	size,
-	b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
-
-	query = new char[size*4*sizeof(double)+strlen(buf)+4];
-
-	end = strxmov(query,buf,0);
-	*end++ = '\'';
-	end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
-	*end++ = '\'';
-	*end++ = ')';
-	delete []points;
-
-	if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
-	{
-		errorMessage_ = string(mysql_error(&mysql_));
-		delete [] query;
-		return false;
-	}
-
-	l.geomId (insertId());
-	delete [] query;
-	return true;
-}
-
-
-bool 
-TeMySQL::updateLine (const string& table, TeLine2D &l)
-{
-	char	buf[256],
-			message[256],
-			*query,
-			*end;
-	double	*points	= NULL,
-			ext_max;
-	int		size=l.size(),
-			i,
-			iac;
-	TeBox	b=l.box();
-
-	ext_max = MAX(b.width(),b.height());
-	points = new double[2*sizeof(double)*size];
-	iac = 0;
-
-	for (i=0;i<size;i++)
-	{
-		points[iac++]=l[i].x();
-		points[iac++]=l[i].y();
-	}
-
-	sprintf (buf,"UPDATE %s SET num_coords=%d, lower_x=%.15f, lower_y=%.15f, upper_x=%.15f, upper_y=%.15f, ext_max=%.15f, spatial_data=",
-	table.c_str(),size,b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
-	query = new char[size*4*sizeof(double)+strlen(buf)+50];
-	end = strxmov(query,buf,(char*)0);
-	*end++ = '\'';
-	end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
-	*end++ = '\'';
-	delete []points;
-
-	sprintf (message," WHERE geom_id=%d",l.geomId());
-	end = strxmov(end,message,(char*)0);
-
-	if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
-	{
-		errorMessage_ = string(mysql_error(&mysql_));
-		delete []query;
-		return false;
-	}
-	delete []query;
-	return true;
-}
-
-
-
-bool
-TeMySQLPortal::fetchGeometry(TeLine2D& line)
-{
-	int index = atoi (getData ("geom_id"));
-	string object_id = getData ("object_id");
-	int np = atoi (getData("num_coords"));
-	TeBox b (atof(getData("lower_x")),atof(getData("lower_y")),atof(getData("upper_x")),atof(getData("upper_y")));
-	int k;
-	double x,y,*data = (double*)getData("spatial_data");
-
-	for (k=0;k<np;k++)
-	{
-		x = *data++;
-		y = *data++;
-		TeCoord2D pt(x,y);
-		line.add(pt);
-	}
-	line.objectId (object_id);
-	line.geomId (index);
-	line.setBox (b);
-	return (fetchRow());
-}
-
-bool
-TeMySQLPortal::fetchGeometry(TeLine2D& line, const unsigned int& initIndex)
-{
-	int index = atoi (getData (initIndex));
-	string object_id = getData (initIndex+1);
-	int np = atoi (getData(initIndex+2));
-	int k;
-	double x,y,*data = (double*)getData(initIndex+8);
-
-	for (k=0;k<np;k++)
-	{
-		x = *data++;
-		y = *data++;
-		TeCoord2D pt(x,y);
-		line.add(pt);
-	}
-	line.objectId (object_id);
-	line.geomId (index);
-	return (fetchRow());
-}
-
-
-bool 
-TeMySQL::insertPoint(const string& table,TePoint &p)
-{
-	string q = "INSERT INTO " + table + " VALUES(0,";
-	q += "'" + escapeSequence(p.objectId()) + "',";
-	q += Te2String(p.location().x_,15) + ",";
-	q += Te2String(p.location().y_,15) + ")";
-	
-	if (!this->execute(string(q)))
-		return false;
-	p.geomId(this->insertId());
-	return true;
-}
-
-
-bool 
-TeMySQLPortal::fetchGeometry(TePoint& p)
-{
-	TeCoord2D c(atof (getData("x")), atof (getData("y")));
-	p.geomId( atoi(getData("geom_id")));
-	p.objectId( string(getData("object_id")));
-	p.add(c);
-	return (fetchRow());
-}
-
-bool 
-TeMySQLPortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
-{
-	TeCoord2D c(atof (getData(initIndex+2)), atof (getData(initIndex+3)));
-	p.geomId( atoi(getData(initIndex)));
-	p.objectId( string(getData(initIndex+1)));
-	p.add(c);
-	return (fetchRow());
-}
-
-
-bool 
-TeMySQL::insertText(const string& table, TeText &t)
-{
-	char q[256];
-	sprintf (q,"INSERT INTO %s values(0,'%s',%.15f,%.15f,'%s',%.15f, %.15f, %.15f, %.15f)",
-		table.c_str(), escapeSequence(t.objectId()).c_str(),
-		t.location().x_, t.location().y_,
-		t.textValue().c_str(), t.angle(), t.height(),t.alignmentVert(),t.alignmentHoriz());
-	if (!this->execute(string(q)))
-		return false;
-	t.geomId(this->insertId());
-
-	return true;
-}
-
-
-bool 
-TeMySQL::insertArc(const string& table, TeArc &arc)
-{
-	char q[256];
-	sprintf (q,"INSERT INTO %s values(0,'%s',%d,%d)",
-		table.c_str(),escapeSequence(arc.objectId()).c_str(),arc.fromNode().geomId(),arc.toNode().geomId());
-	if (!this->execute(string(q)))
-		return false;
-	arc.geomId(this->insertId());
-	return true;
-}
-
-
-bool
-TeMySQL::insertNode(const string& table, TeNode &node)
-{
-	char q[256];
-	sprintf (q,"INSERT INTO %s values(0,'%s',%.15f,%.15f)",table.c_str(),node.objectId().c_str(),node.location().x(),node.location().y());
-	if (!this->execute(string(q)))
-		return false;
-	node.geomId(this->insertId());
-	return true;
-}
-
-bool 
-TeMySQL::insertBlob (const string& tableName, const string& columnBlob , const string& whereClause, unsigned char* data, int size)
-{
-	if (whereClause.empty())
-		return false;
-
-	TeMySQLPortal* portal = (TeMySQLPortal*)this->getPortal();
-	if (!portal)
-		return false;
-
-	string q = "SELECT * FROM "+ tableName +" WHERE "+ whereClause;
-	if ((!portal->query(q)) || (!portal->fetchRow()))
-	{
-		delete portal;
-		return false;
-	}
-	delete portal;
-
-	char	message[256],
-			*query,
-			*end;
-	sprintf (message,"UPDATE %s SET %s = ",tableName.c_str(), columnBlob.c_str());
-
-	query = new char[2*size+strlen(message)+4];
-	end = strxmov(query,message,0);
-	*end++ = '\'';
-	end += mysql_real_escape_string(&mysql_,end,(char*)data,size);
-	*end++ = '\'';
-
-	sprintf (message," WHERE %s",whereClause.c_str());
-
-	end = strxmov(end,message,0);
-
-	if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)))
-	{
-		errorMessage_ = string(mysql_error(&mysql_));
-		delete []query;
-		return false;
-	}
-	delete []query;	
-	return true;
-}
-
-bool
-TeMySQL::insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, 
-						   unsigned char *buf,unsigned long size, int band, unsigned int res, unsigned int subband)
-{
-	if (blockId.empty()) // no block identifier provided
-	{
-		errorMessage_ = "bloco sem identificador";
-		return false;
-	}
-
-	TeMySQLPortal* portal = (TeMySQLPortal*) this->getPortal();
-	if (!portal)
-		return false;
-
-	bool update = false;
-	string q ="SELECT * FROM " + table; 
-	q += " WHERE block_id='" + blockId + "'";
-
-	if (!portal->query (q))
-	{
-		delete portal;
-		return false;
-	}
-		// check if this block is alread in the database
-	if (portal->fetchRow())
-		update = true;
-	delete portal;
-
-	char	message[256],
-			*end;
-	if (!update)
-	{
-		sprintf (message,"INSERT INTO %s values('%s',%.15f,%.15f,%.15f,%.15f,%d,%d,%d,",
-			table.c_str(),blockId.c_str(),ll.x(),ll.y(),ur.x(),ur.y(),band,res,subband);
-	}
-	else
-	{
-		sprintf (message,"UPDATE %s SET spatial_data=",table.c_str());
-	}
-
-	if (bufferBlobSize_ < (long)(2*size+strlen(message)+20))
-	{
-		if (bufferBlob_)
-			delete []bufferBlob_;
-		bufferBlobSize_ = 2*size+strlen(message)+20;
-		bufferBlob_ = new char[bufferBlobSize_];
-	}
-	end = strxmov(bufferBlob_,message,0);
-	*end++ = '\'';
-	end += mysql_real_escape_string(&mysql_,end,(char*)buf,size);
-	*end++ = '\'';
-
-	if (update)
-	{
-		sprintf (message,", block_size=%ld WHERE block_id='%s'",size,blockId.c_str());
-		end = strxmov(end,message,0);
-	}
-	else
-	{
-		sprintf (message,",%ld)",size);
-		end = strxmov(end,message,0);
-	}
-
-	if (mysql_real_query(&mysql_,bufferBlob_,(unsigned int) (end - bufferBlob_)))
-	{
-		errorMessage_ = string(mysql_error(&mysql_));
-		delete []bufferBlob_;
-		bufferBlobSize_ = 0;
-		bufferBlob_ = 0;
-		return false;
-	}
-	return true;
-}
-
-bool
-TeMySQLPortal::fetchGeometry(TeNode& n)
-{
-	TeCoord2D c(atof (getData("x")), atof (getData("y")));
-	n.geomId( atoi(getData("geom_id")));
-	n.objectId( string(getData("object_id")));
-	n.add(c);
-	return (fetchRow());
-}
-
-bool
-TeMySQLPortal::fetchGeometry(TeNode& n, const unsigned int& initIndex)
-{
-	TeCoord2D c(atof (getData(initIndex+2)), atof (getData(initIndex+3)));
-	n.geomId( atoi(getData(initIndex)));
-	n.objectId( string(getData(initIndex+1)));
-	n.add(c);
-	return (fetchRow());
-}
-
-bool
-TeMySQL::insertCell(const string& table, TeCell &c)
-{
-	TeBox	b=c.box();
-	char	q[256];
-	sprintf (q,"INSERT INTO %s values(0,'%s',%.15f,%.15f,%.15f,%.15f,%d,%d)",
-		table.c_str(),c.objectId().c_str(),
-		b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),
-		c.column(),c.line());
-
-	if (!this->execute (string(q)))
-		return false;
-	c.geomId(this->insertId());
-	return true;
-}
-
-
-TeTime
-TeMySQLPortal::getDate (int i)
-{ 
-	string s = getData(i);
-	TeTime t(s, TeSECOND, "YYYYsMMsDDsHHsmmsSS","-"); 
-	return t; 
-}
-
-TeTime
-TeMySQLPortal::getDate (const string& s)
-{ 
-	string sv = getData(s);
-	TeTime t(sv, TeSECOND, "YYYYsMMsDDsHHsmmsSS","-"); 
-	return t; 
-}
-
-string 
-TeMySQLPortal::getDateAsString(const string& s)
-{
-	TeTime t = this->getDate(s);
-	if (t.isValid())
-	{		
-		string tval = "\'"+t.getDateTime("YYYYsMMsDDsHHsmmsSS", "-")+"\'";
-		return tval;
-	}
-	else
-		return "";
-}
-
-string 
-
-TeMySQLPortal::getDateAsString(int i)
-{
-	TeTime t = this->getDate(i);
-	if (t.isValid())
-	{		
-		string tval = "\'"+t.getDateTime("YYYYsMMsDDsHHsmmsSS", "-")+"\'";
-		return tval;
-	}
-	else
-		return "";
-}
-
-double 
-TeMySQLPortal::getDouble (const string& s)
-{
-	return atof(getData(s));
-}
-
-
-double 
-TeMySQLPortal::getDouble (int i)
-{
-	if (row_ == 0)
-		return 0.;
-
-	if (row_[i])
-		return atof(row_[i]);
-	else
-		return 0.;
-}
-
-int 
-TeMySQLPortal::getInt (const string& s)
-{
-	return atoi(getData(s));
-}
-
-
-int 
-TeMySQLPortal::getInt (int i)
-{
-	if (row_ == 0)
-		return 0;
-
-	if (row_[i])
-		return atoi(row_[i]);
-	else
-		return 0;
-}
-
-
-char* 
-TeMySQLPortal::getData (int i)
-{
-	if (row_ == 0)
-		return "";
-
-	if (row_[i])
-		return row_[i];
-	else
-		return "";
-}
-
-
-char* 
-TeMySQLPortal::getData (const string& s)
-{
-	string fieldName;
-//	size_t pos = s.find(".", string::npos,1);
-	size_t pos = s.find(".", 0, 1);
-	if (pos != string::npos)
-		fieldName = s.substr(pos+1);
-	else
-		fieldName = s;
-
-	if (row_ == 0)
-		return "";
-
-	TeAttributeList::iterator it = attList_.begin();
-
-	int j = 0;
-	while ( it != attList_.end() )
-	{
-		if ((TeConvertToUpperCase(fieldName) == TeConvertToUpperCase((*it).rep_.name_)) ||
-		    (TeConvertToUpperCase(s) == TeConvertToUpperCase((*it).rep_.name_)))
-		{
-			if (row_[j])
-				return row_[j];
-			else
-				return "";
-		}
-		++it;
-		j++;
-	}
-	return "";
-}
-
-bool
-TeMySQLPortal::getBlob (const string& s, unsigned char* &data, long& size)
-{
-	string fieldName;
-//	size_t pos = s.find(".", string::npos,1);
-	size_t pos = s.find(".", 0, 1);
-	if (pos != string::npos)
-		fieldName = s.substr(pos+1);
-	else
-		fieldName = s;
-
-	TeAttributeList::iterator it = attList_.begin();
-	int j = 0, i=-1;
-	while ( it != attList_.end() )
-	{
-		if (fieldName == (*it).rep_.name_)
-		{
-			i=j;
-			break;
-		}
-		++it;
-		j++;
-	}
-	if (i<0)
-		return false;
-
-	unsigned long *lengths;
-	lengths = mysql_fetch_lengths(result_);
-	size = lengths[i];
-	if (row_[i])
-	{
-//		data = (unsigned char*) row_[i];
-		data = new unsigned char[size];
-		memcpy(data, (unsigned char*) row_[i], size * sizeof(char));
-		return true;
-	}
-	else
-	{
-		data = 0;
-		return false;
-	}
-}
-
-
-bool 
-TeMySQLPortal::getBool (const string& s)
-{
-	int val = atoi(getData(s));
-	return val ? true : false;
-}
-
-
-bool 
-TeMySQLPortal::getBool (int i)
-{
-	if (row_ == 0)
-		return false;
-	int val = atoi(getData(i));
-	return val ? true : false;
-}
-
-bool 
-TeMySQLPortal::getRasterBlock(unsigned long& size, unsigned char* ptData)
-{
-	
-	// get the actual length of the compressed data
-	size = atoi(getData("block_size"));
-	if ( (size>0) && row_[8])
-	{
-		memcpy((void*)ptData,(void*)(row_[8]),size);
-		return true;
-	}
-	else
-	{
-		ptData = 0;
-		return false;
-	}
-}
-
-bool
-TeMySQL::inClauseValues(const string& query, const string& attribute, vector<string>& inClauseVector)
-{
-	int i = 0, numRows = 0, count = 0, chunk = 200;
-	string id, inClause = "(", plic = "'";
-
-	TeDatabasePortal *pt = getPortal();
-	if(pt->query(query) == false)
-	{
-		delete pt;
-		return false;
-	}
-
-	while (numRows < pt->numRows())
-	{
-		if(count < chunk && pt->fetchRow())
-		{
-			id = pt->getData(attribute);
-			inClause = inClause + plic + id + "',";
-			++count;
-			++numRows;
-		}
-		else
-		{
-			inClause = inClause.substr(0, inClause.size()-1);
-			inClause += ")";
-			inClauseVector.push_back(inClause);
-			count = 0;
-			++i;
-			inClause = "(";
-		}
-	}
-	if (numRows == 0)
-	{
-		delete pt;
-		return true;
-	}
-	else
-	{
-		inClause = inClause.substr(0, inClause.size()-1);
-		inClause += ")";
-		inClauseVector.push_back(inClause);
-	}
-
-	delete pt;
-	return true;
-}
-
-string 
-TeMySQL::getSQLTime(TeTime& time)
-{
-	string result = "'"+ time.getDateTime("YYYYsMMsDDsHHsmmsSS", "-", ":") +"'";
-	return result;
-}
-
-string
-TeMySQL::getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, 
-						   const string& initialTime, const string& finalTime)
-{
-	
-	//In MySQL the first day of the week is monday with index 0
-	if(chr==TeDAYOFWEEK)
-	{
-		time1 = time1-1;
-		if(time1<0)
-			time1=6;
-		time2 = time2-1;
-		if(time2<0)
-			time2=6;
-	}
-
-	return(TeDatabase::getSQLTemporalWhere(time1, time2, chr, rel, initialTime, finalTime));
-}
-		
-
-string TeMySQL::concatValues(vector<string>& values, const string& unionString)
-{
-	string concat = "CONCAT(";
-	
-	for(unsigned int i = 0; i < values.size(); ++i)
-	{
-		if(i != 0)
-		{
-			concat += ", ";
-
-			if(!unionString.empty())
-			{
-				concat += "'";
-				concat += unionString;
-				concat += "'";
-				concat += ", ";
-			}
-		}
-
-		concat += values[i];
-	}
-
-	concat += ")";
-
-	return concat;
-}
-
-string TeMySQL::toUpper(const string& value)
-{
-	string result  = "upper(";
-	       result += value;
-		   result += ")";
-
-	return result;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeMySQL.h"
+#include <stdio.h>
+#include <sys/types.h>
+#include <TeProject.h>
+#include <cstring>
+
+extern "C" {
+extern char *strxmov(char* dest, const char* src, ...);
+}
+
+#ifndef MAX
+  #define MAX(a,b) ((a>b)?a:b)
+#endif
+#ifndef MIN
+  #define MIN(a,b) ((a<b)?a:b)
+#endif
+
+
+double swappd(double din)
+{
+	char  stri[8],stro[8];
+	double dout;
+
+	memcpy (stri,&din,8);
+	stro[0] = stri[7];
+	stro[1] = stri[6];
+	stro[2] = stri[5];
+	stro[3] = stri[4];
+	stro[4] = stri[3];
+	stro[5] = stri[2];
+	stro[6] = stri[1];
+	stro[7] = stri[0];
+	memcpy (&dout,stro,8);
+	return (dout);
+}
+
+
+TeMySQL::TeMySQL()
+{
+	isConnected_ = false;
+	dbmsName_ = "MySQL";
+	bufferBlob_ = 0;
+	bufferBlobSize_ = 0;
+	mysql_init (&mysql_);
+}
+
+
+TeMySQL::~TeMySQL()
+{
+  if(isConnected_) close();
+}
+
+void
+TeMySQL::close()
+{
+	if (bufferBlob_)
+  { 
+		delete []bufferBlob_;
+	  bufferBlob_ = 0;
+	  bufferBlobSize_ = 0;
+  }
+
+  if(isConnected_)
+  {
+	  mysql_close(&mysql_);
+    isConnected_ = false;
+  }
+}
+
+bool TeMySQL::beginTransaction()
+{
+	return this->execute("START TRANSACTION;");
+}
+
+bool TeMySQL::commitTransaction()
+{
+	return this->execute("COMMIT;");
+}
+
+bool TeMySQL::rollbackTransaction()
+{
+	return this->execute("ROLLBACK;");
+}
+
+
+std::string TeMySQL::getClientEncoding()
+{
+	std::string clientEncoding = "";
+
+	std::string sql = "SHOW VARIABLES LIKE 'character_set_client'";
+
+	TeDatabasePortal* portal = getPortal();
+
+	if(portal->query(sql) && portal->fetchRow())
+	{
+		clientEncoding = portal->getData(0);
+	}
+
+	delete portal;
+	portal =  NULL;
+
+	return clientEncoding;
+}
+
+bool TeMySQL::setClientEncoding(const std::string& characterSet)
+{
+	std::string sql = "SET character_set_client = " + characterSet;
+	return execute(sql);
+}
+
+bool TeMySQL::getEncodingList(std::vector<std::string>& vecEncodingList)
+{
+	std::string query = " SHOW CHARACTER SET";
+	if (mysql_real_query(&mysql_, query.c_str(), query.size()) != 0)
+	{
+		return false;
+	}
+
+	MYSQL_RES* result = mysql_store_result(&mysql_);
+	unsigned int numRows = (int)mysql_num_rows(result);
+
+	for(unsigned int i = 0; i < numRows; ++i)
+	{
+		MYSQL_ROW row = mysql_fetch_row(result);
+		vecEncodingList.push_back(row[0]);
+	}
+
+	sort(vecEncodingList.begin(), vecEncodingList.end());
+
+	if (result != NULL)
+	{
+		mysql_free_result(result);
+		result = 0;
+	}
+	return true;
+}
+	 
+bool TeMySQL::getEncodingList(const std::string& host, const std::string& user, const std::string& password, const int& port, std::vector<std::string>& vecEncodingList)
+{
+	int portToConnect = port;
+	if(portToConnect < 0)
+	{
+		portToConnect = 0;
+	}
+
+	if (mysql_real_connect(&mysql_,host.c_str(),user.c_str(),password.c_str(),"",portToConnect,NULL,0) == NULL)
+	{
+		return false;
+	}
+
+	std::string query = " SHOW CHARACTER SET";
+	if (mysql_real_query(&mysql_, query.c_str(), query.size()) != 0)
+	{
+		return false;
+	}
+
+	MYSQL_RES* result = mysql_store_result(&mysql_);
+	unsigned int numRows = (int)mysql_num_rows(result);
+
+	for (unsigned int i = 0; i < numRows; ++i)
+	{
+		MYSQL_ROW row = mysql_fetch_row(result);
+		vecEncodingList.push_back(row[0]);
+	}
+
+	if (result != NULL)
+	{
+		mysql_free_result(result);
+		result = 0;
+	}
+
+	close();
+
+	return true;
+}
+
+
+bool 
+TeMySQL::newDatabase(const string& database, const string& user, const string& password, const string& host, const int & port, bool terralibModel, const std::string& characterSet)
+{
+	int portToConnect = port;
+	if(portToConnect < 0)
+	{
+		portToConnect = 0;
+	}
+
+	if (mysql_real_connect(&mysql_,host.c_str(),user.c_str(),password.c_str(),"",portToConnect,NULL,0) == NULL)
+	{
+		isConnected_ = false;
+		return false;
+	}
+
+	std::string create = "CREATE DATABASE " + database;
+	if(!characterSet.empty())
+	{
+		create += " CHARACTER SET = " + characterSet;
+	}
+
+	if (mysql_query(&mysql_,create.c_str()) != 0)
+//	if (mysql_create_db(&mysql_,database.c_str()) != 0)
+	{
+		isConnected_ = false;
+		return false;
+	}
+
+	if (mysql_select_db(&mysql_,database.c_str()) != 0)
+	{
+		isConnected_ = false;
+		return false;
+	}
+
+	if(terralibModel)
+	{
+		//create conceptual model
+		if(!this->createConceptualModel())
+			return false;
+	}
+	isConnected_ = true;
+	user_ = user;
+	host_ = host;
+	password_ = password;
+	database_ = database;
+	portNumber_ = portToConnect;
+	return true;
+}
+
+
+bool 
+TeMySQL::connect (const string& host, const string& user, const string& password, const string& database, int port)
+{
+	if(port<0)
+		port = 0;
+
+	if (mysql_real_connect(&mysql_,host.c_str(),user.c_str(),password.c_str(),database.c_str(),port,NULL,0) == NULL)
+	{
+		isConnected_ = false;
+		return false;
+	}
+
+	isConnected_ = true;
+	user_ = user;
+	host_ = host;
+	password_ = password;
+	database_ = database;
+	portNumber_ = port;
+	return true;
+}
+
+
+bool 
+TeMySQL::showDatabases (const string& host, const string& user, const string& password, vector<string>& dbNames, int port)
+{
+	unsigned long i;
+	MYSQL_ROW row;
+
+	if(port<0)
+		port = 0;
+
+	if (mysql_real_connect(&mysql_,host.c_str(),user.c_str(),password.c_str(),0,port,NULL,0) == NULL)
+	{
+		errorMessage_= string(mysql_error(&mysql_));
+		return false;
+	}
+
+	MYSQL_RES *result = mysql_list_dbs(&mysql_, "%");
+  
+  if( result )
+  {
+    unsigned int numRows = (unsigned int)mysql_num_rows(result);
+  
+    for (i = 0; i < numRows; ++i)
+    {
+      row = mysql_fetch_row(result);
+      dbNames.push_back(row[0]);
+    }  
+    
+    mysql_free_result( result );
+    
+    mysql_close( &mysql_ );
+    
+    return true;
+  }
+  else
+  {
+    mysql_close( &mysql_ );
+    
+    return false;
+  }
+}
+
+
+bool 
+TeMySQL::execute (const string &q)
+{
+	if (mysql_real_query(&mysql_, q.c_str(), q.size()) != 0)
+	{
+		errorMessage_= string(mysql_error(&mysql_));
+		errorNumber_= mysql_errno(&mysql_);
+		return false;
+	}
+    return true;
+}
+
+bool 
+TeMySQL::createTable(const string& table, TeAttributeList &attr)
+{
+	string createStr = " CREATE TABLE " + table + " (";
+	string type;
+	string pkeys;
+	bool first = true;	
+
+	TeAttributeList::iterator it = attr.begin();
+
+	while(it != attr.end())
+	{
+		string name = (*it).rep_.name_;
+		
+		switch((*it).rep_.type_)
+		{
+			case TeSTRING:
+							if((*it).rep_.numChar_ > 0)
+							{
+								type = "VARCHAR(" + Te2String((*it).rep_.numChar_) + ") ";
+							}
+							else
+							{
+								type = "LONGTEXT";
+							}
+							break;
+			case TeREAL:
+							if((*it).rep_.decimals_ > 0)
+								type = "DECIMAL(53, " + Te2String((*it).rep_.decimals_) + ") ";
+							else
+								type = "DECIMAL(53, 15) ";
+							break;
+			case TeINT:
+							type = "INT ";							
+							break;
+
+			case TeUNSIGNEDINT:
+							type = "INT UNSIGNED ";							
+							break;
+
+			case TeCHARACTER:
+							type = "CHAR ";							
+							break;
+			
+			case TeBOOLEAN:
+							type = "BOOLEAN ";							
+							break;
+
+			case TeDATETIME:
+							type = "DATETIME ";  //time							
+							break;
+			case TeBLOB:
+							type = "BLOB ";
+							break;
+
+			case TePOINTTYPE:
+			case TePOINTSETTYPE:
+							if(!first)
+								createStr += ", ";
+							else
+								first = false;
+
+							createStr += "x				DOUBLE(53,15) DEFAULT '0.0'";
+							createStr += ", y			DOUBLE(53,15) DEFAULT '0.0'";
+							++it;
+							continue;
+
+			case TeLINE2DTYPE:
+			case TeLINESETTYPE:
+							if(!first)
+								createStr += ", ";
+							else
+								first = false;
+
+							createStr += "num_coords INT UNSIGNED not null ,";
+							createStr += "lower_x double(53,15) not null ,";
+							createStr += "lower_y double(53,15) not null ,";
+							createStr += "upper_x double(53,15) not null ,";
+							createStr += "upper_y double(53,15) not null ,";
+							createStr += "ext_max double(53,15) not null, ";
+							createStr += "spatial_data LONGBLOB not null ";
+							++it;
+							continue;
+
+			case TePOLYGONTYPE:
+			case TePOLYGONSETTYPE:
+							if(!first)
+								createStr += ", ";
+							else
+								first = false;
+
+							createStr += "num_coords INT UNSIGNED not null ,";
+							createStr += "num_holes INT UNSIGNED not null ,";
+							createStr += "parent_id INT UNSIGNED not null ,";
+							createStr += "lower_x double(53,15) not null ,";
+							createStr += "lower_y double(53,15) not null ,";
+							createStr += "upper_x double(53,15) not null ,";
+							createStr += "upper_y double(53,15) not null ,";
+							createStr += "ext_max double(53,15) not null ,";
+							createStr += "spatial_data LONGBLOB not null ";
+							++it;
+							continue;
+
+			case TeCELLTYPE:
+			case TeCELLSETTYPE:
+							if(!first)
+								createStr += ", ";
+							else
+								first = false;
+
+							createStr += "lower_x		double(53,15) NOT NULL ,";
+							createStr += "lower_y		double(53,15) NOT NULL ,";
+							createStr += "upper_x		double(53,15) NOT NULL ,";
+							createStr += "upper_y		double(53,15) NOT NULL ,";
+							createStr += "col_number	INT(10) NOT NULL ,";
+							createStr += "row_number	INT(10) NOT NULL ";
+							++it;
+							continue;					
+
+			case TeRASTERTYPE:
+							if(!first)
+								createStr += ", ";
+							else
+								first = false;
+
+							createStr += "lower_x double(53,15) not null, ";
+							createStr += "lower_y double(53,15) not null, ";
+							createStr += "upper_x double(53,15) not null, ";
+							createStr += "upper_y double(53,15) not null, ";
+							createStr += "band_id int(10) unsigned not null, ";
+							createStr += "resolution_factor int(10) unsigned , ";
+							createStr += "subband int(10) unsigned,";
+							createStr += "spatial_data LONGBLOB NOT NULL, ";
+							createStr += "block_size int(10) unsigned not null ";
+							++it;
+							continue;
+
+			case TeNODETYPE:
+			case TeNODESETTYPE:
+							if(!first)
+								createStr += ", ";
+							else
+								first = false;
+
+							createStr += "x				DOUBLE(53,15) DEFAULT '0.0'";
+							createStr += ", y			DOUBLE(53,15) DEFAULT '0.0'";
+							++it;
+							continue;
+
+			case TeTEXTTYPE:
+			case TeTEXTSETTYPE:
+
+			default:
+							type = "VARCHAR(" + Te2String((*it).rep_.numChar_) + ") ";
+							break;
+		}
+
+		if(!((*it).rep_.defaultValue_.empty()))
+			type += " DEFAULT '" + (*it).rep_.defaultValue_ + "' ";
+
+		if(!((*it).rep_.null_))
+			type += " NOT NULL ";
+
+		if((*it).rep_.isAutoNumber_)
+			type += " AUTO_INCREMENT ";
+				
+		if(!first)
+			createStr += ", ";
+		else
+			first = false;
+		
+		createStr += name + " " + type;
+
+		// check if column is part of primary key
+		if(((*it).rep_.isPrimaryKey_) && ((*it).rep_.type_ != TeBLOB))
+		{
+			if(!pkeys.empty())
+				pkeys += ", ";
+
+			pkeys += (*it).rep_.name_;
+		}
+		
+		++it;
+	}
+
+	if(!pkeys.empty())
+		createStr += ", PRIMARY KEY (" + pkeys + ") ";
+
+	createStr += ")";
+
+	return execute(createStr);
+}
+
+
+bool 
+TeMySQL::tableExist(const string& table)
+{
+	//if (table.empty())
+	//	return false;
+
+	//string q ="SHOW TABLES LIKE '"+ table + "'";
+	////string q ="DESC "+ table;
+
+	//if (mysql_real_query(&mysql_, q.c_str(), q.size()) != 0)
+	//{
+	//	errorMessage_ = string(mysql_error(&mysql_));
+	//}
+
+	//MYSQL_RES*	res_ = mysql_use_result(&mysql_);
+
+	//if (res_)
+	//{
+	//	mysql_free_result(res_);
+	//	return true;
+	//}
+	//else
+	//	return false;
+	if (table.empty())
+		return false;
+
+	MYSQL_RES* myres;
+
+    myres = mysql_list_tables(&mysql_, table.c_str());
+	if(myres == 0)
+	{
+		errorMessage_ = string(mysql_error(&mysql_));
+		return false;
+	}
+	else
+	{
+		bool ret = false;
+		MYSQL_ROW myrow;
+		while ((myrow = mysql_fetch_row(myres)))
+		{
+			string s = myrow[0];
+			string S = TeConvertToUpperCase(s);
+			string SS = TeConvertToUpperCase(table);
+			if(S == SS)
+			{
+				ret = true;
+				break;
+			}
+		}
+		mysql_free_result(myres);
+		return ret;
+	}
+}
+
+bool 
+TeMySQL::columnExist(const string& table, const string&  column ,TeAttribute& attr)
+{
+	string q = "SHOW COLUMNS FROM " + table + " LIKE \'" + column + "\'";
+	if (mysql_query(&mysql_, q.c_str()) != 0)
+	{
+		return false;
+	}
+	MYSQL_RES* fieldsres = mysql_use_result(&mysql_);
+	if (!fieldsres)
+		return false;
+	MYSQL_ROW row = mysql_fetch_row(fieldsres);
+	if (!row)
+		return false;
+	attr.rep_.name_ = column;
+	
+	string ftype(row[1]);
+	string fpk(row[3]);
+	if (ftype.find("char") != string::npos)
+		attr.rep_.type_ = TeSTRING;
+	else if (ftype.find("int") != string::npos)
+		attr.rep_.type_ = TeINT;
+	else if (ftype.find("double") != string::npos)
+		attr.rep_.type_ = TeREAL;
+	else if (ftype.find("blob") != string::npos)
+		attr.rep_.type_ = TeBLOB;
+	else if (ftype.find("longtext") != string::npos)
+		attr.rep_.type_ = TeSTRING;
+	else if ((ftype.find("date") != string::npos) || (ftype.find("time") != string::npos))
+		attr.rep_.type_ = TeDATETIME;
+
+	unsigned int p1 = ftype.find("(");
+	unsigned int p2 = ftype.find(")");
+	if (p1 != string::npos && p2 != string::npos)
+		attr.rep_.numChar_ = atoi(ftype.substr(p1+1,p2-1).c_str());
+
+	if (fpk.find("PRI") != string::npos)
+		attr.rep_.isPrimaryKey_ = true;
+
+	mysql_free_result(fieldsres);
+	return true;
+}
+
+bool TeMySQL::addColumn (const string& table, TeAttributeRep &rep)
+{
+	string q ="ALTER TABLE " + table +" ADD ";
+	string type;
+	char	size[8];
+
+	string field = TeGetExtension(rep.name_.c_str());
+	if(field.empty())
+		field = rep.name_;
+
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if(rep.numChar_ > 0)
+			{
+				type = " VARCHAR(" + Te2String(rep.numChar_) + ")";
+			}
+			else
+			{
+				type = " LONGTEXT";
+			}
+			break;
+		case TeREAL:
+			type = " DECIMAL(53, " + Te2String(rep.decimals_) + ") ";
+			break;
+		case TeINT:
+			type = " INT";
+			break;
+		case TeCHARACTER:
+			type = " CHAR";
+			break;
+		case TeBOOLEAN:
+			type = " BOOLEAN";
+			break;
+		case TeDATETIME:
+			type = " DATETIME";
+			break;
+		case TeBLOB:
+			type = " LONGBLOB";
+			break; 
+		default:
+		type = " VARCHAR ";
+		sprintf (size,"(%d)",rep.numChar_);
+		type += string (size);
+		break;
+	}
+	q += field;
+	q += type;
+	bool res = execute(q);
+	if (res)
+		alterTableInfoInMemory(table);
+	return res;
+}
+
+
+bool
+TeMySQL::deleteIndex(const string& tableName, const string& indexName)
+{	
+
+	string query = "drop index "+indexName+" on "+tableName;
+
+	if(!this->execute(query))
+	{		
+		return false;
+	}
+
+	return true;
+
+}
+
+bool
+TeMySQL::getIndexesFromTable(const string& tableName, std::vector<TeDatabaseIndex>& vecIndexes)
+{
+
+	std::vector<TeDatabaseIndex> indexes;
+
+	string dbName = this->databaseName();
+
+	string query1 = "select INDEX_NAME, COLUMN_NAME from information_schema.STATISTICS ";
+		query1 += "where table_name = \""+ tableName +"\" and TABLE_SCHEMA =\""+ dbName +"\" and index_name != \"PRIMARY\"";
+
+	TeDatabasePortal* portal = getPortal();
+
+	std::vector<std::string> names;
+	std::vector<std::string> cols;
+
+	std::set<std::string> idxNames;
+
+	std::multimap<std::string, std::string> idxAttrs;
+	
+	if(portal->query(query1))
+	{
+		while(portal->fetchRow())
+		{
+			std::string idxName = portal->getData("INDEX_NAME");
+			std::string attrName = portal->getData("COLUMN_NAME");
+
+			idxAttrs.insert(std::pair<std::string, std::string>(idxName, attrName));
+			
+			idxNames.insert(idxName);
+		}		
+
+	}else
+	{
+		delete portal;
+		return false;
+	}
+
+	portal->freeResult();
+
+	delete portal;
+	portal =  NULL;
+
+	std::set<std::string>::iterator it = idxNames.begin();
+	while(it != idxNames.end())
+	{
+		std::string idxName = *it;
+
+		TeDatabaseIndex idxx;
+		idxx.setIndexName(idxName);
+		idxx.setIsPrimaryKey(false);
+		
+		std::vector<string> attNames;
+		std::pair<std::multimap<std::string, std::string>::iterator, std::multimap<std::string, std::string>::iterator> itAttrs = idxAttrs.equal_range(idxName);
+		std::multimap<std::string, std::string>::iterator itA;
+		for (itA=itAttrs.first; itA!=itAttrs.second; ++itA)
+		{
+			std::string attrName = itA->second;
+			attNames.push_back(attrName);
+		}
+
+		idxx.setColumns(attNames);
+
+		indexes.push_back(idxx);
+
+		++it;
+	}	
+
+	vecIndexes = indexes;	
+
+	return true;
+
+}
+
+
+
+
+bool 
+TeMySQL::alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName)
+{
+	if(!tableExist(tableName))
+		return false;
+
+	string tab;
+
+	if(oldColName.empty())
+	{
+		tab = " ALTER TABLE " + tableName + " MODIFY ";
+		tab += rep.name_ +"  ";
+	}
+	else
+	{
+		tab = " ALTER TABLE " + tableName + " CHANGE ";
+		tab += oldColName +" "+ rep.name_ +"  ";
+	}
+
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if(rep.numChar_ > 0)
+			{
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			}
+			else
+			{
+				tab += "LONGTEXT";
+			}
+			break;
+			
+		case TeREAL:
+			tab += "DOUBLE(24, 15)";	
+			break;
+			
+		case TeINT:
+			tab += "INT";
+			break;
+
+		case TeDATETIME:
+			tab += "DATETIME";
+			break;
+
+		case TeCHARACTER:
+			tab += "CHAR";
+			break;
+
+		case TeBOOLEAN:
+			tab += "BOOLEAN";
+			break;
+
+		case TeBLOB:
+			tab += "LONGBLOB";
+			break; 
+		
+		default:
+			tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+
+	tab += " NULL ";
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error alter table " + tableName + " !";
+		return false;
+	}
+
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + tableName + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+
+	if(tableId.empty() == false)
+	{
+		if(oldColName.empty() == false) // column name changed
+		{
+			 // update relation
+			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
+			sql += " WHERE related_table_id = " + tableId;
+			sql += " AND related_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
+			sql += " WHERE external_table_name = '" + tableName + "'";
+			sql += " AND external_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			 // update grouping
+			sql = "UPDATE te_grouping SET grouping_attr = '" + tableName + "." + rep.name_ + "'";
+			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+		else // column type changed
+		{
+			// delete relation
+			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+			sql += " AND related_attr = '" + rep.name_ + "')";
+			sql += " OR (external_table_name = '" + tableName + "'";
+			sql += " AND external_attr = '" + rep.name_ + "')";
+			if(execute(sql) == false)
+				return false;
+
+			// delete grouping
+			TeDatabasePortal* portal = getPortal();
+			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(portal->query(sql) && portal->fetchRow())
+			{
+				string themeId = portal->getData(0);
+
+				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
+				if(execute(sql) == false)
+				{
+					delete portal;
+					return false;
+				}
+			}
+			delete portal;
+
+			sql = "DELETE FROM te_grouping";
+			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+	}
+
+	alterTableInfoInMemory(tableName);
+	return true;
+}
+
+
+TeDatabasePortal*  
+TeMySQL::getPortal ()
+{
+	TeMySQLPortal* portal = new TeMySQLPortal (this);
+	return portal;
+}
+
+bool
+TeMySQL::defineIntegrity(void)
+{
+	return true;		// mysql doesn't have referencial integrity
+						// there is nothing to be done
+}
+
+
+string TeMySQL::getConcatFieldsExpression(const vector<string>& fNamesVec)
+{
+	if (fNamesVec.empty() == true)
+		return "";
+
+	string concatExp = "CONCAT(";
+	for (unsigned int i = 0; i < fNamesVec.size(); ++i)
+	{
+		if (i != 0)
+			concatExp += ", ";
+		concatExp += fNamesVec[i];
+	}
+	concatExp += ")";
+
+	return concatExp;
+}
+
+
+
+
+TeMySQLPortal::TeMySQLPortal ( TeMySQL  *m)
+{
+	mysql_ = m->getMySQL();
+	numRows_ = 0;
+	numFields_ = 0;
+	result_ = 0;
+	row_ = 0;
+	db_ = m;
+}
+
+
+TeMySQLPortal::TeMySQLPortal ( const TeMySQLPortal& p) : TeDatabasePortal()
+{
+	mysql_ = p.mysql_;
+	numRows_ = 0;
+	numFields_ = 0;
+	result_ = 0;
+	row_ = 0;
+}
+
+
+TeMySQLPortal::~TeMySQLPortal ()
+{
+	freeResult ();
+}
+
+
+string 
+TeMySQL::escapeSequence(const string& from)
+{
+	string ret = "";
+	if (!from.empty())
+	{
+		char	*to = new char[from.size()*2+1];
+		mysql_real_escape_string(&mysql_,to,from.c_str(),from.size());
+		ret = to;
+		delete  []to;
+	}
+
+	return ret;
+}
+
+bool TeMySQLPortal::query (const string &q, TeCursorLocation /* l */, TeCursorType /* t */, TeCursorEditType /* e */, TeCursorDataType /*dt*/)
+{
+	if (result_)
+		freeResult();
+	attList_.clear ();
+
+	if (mysql_real_query(mysql_, q.c_str(), q.size()) != 0)
+	{
+		string erro = string(mysql_error(mysql_));
+		return false;
+	}
+
+	result_ = mysql_store_result(mysql_);
+	numRows_ = (int)mysql_num_rows(result_);
+	if (result_)  // there are rows
+	{
+		numFields_ = mysql_num_fields(result_);
+
+		MYSQL_FIELD *fields = mysql_fetch_fields(result_);
+		
+		int i;
+		for(i = 0; i < numFields_; i++)
+		{
+			TeAttribute attribute;
+			switch (fields[i].type)
+			{
+			case FIELD_TYPE_TINY:
+				attribute.rep_.type_ = TeBOOLEAN;
+				break;
+
+			case FIELD_TYPE_DECIMAL:
+			case FIELD_TYPE_SHORT:
+			case FIELD_TYPE_LONG:
+			case FIELD_TYPE_INT24:
+				attribute.rep_.type_ = TeINT;
+				attribute.rep_.numChar_ = fields[i].length;
+				break;
+
+			case FIELD_TYPE_FLOAT:
+			case FIELD_TYPE_DOUBLE:
+			case FIELD_TYPE_LONGLONG:
+			case FIELD_TYPE_NEWDECIMAL:
+				attribute.rep_.type_ = TeREAL;
+				attribute.rep_.numChar_ = fields[i].length;
+				attribute.rep_.decimals_ = fields[i].decimals;
+				break;
+
+			case FIELD_TYPE_DATE:
+			case FIELD_TYPE_TIME:
+			case FIELD_TYPE_DATETIME:
+			case FIELD_TYPE_YEAR:
+			case FIELD_TYPE_NEWDATE:
+				attribute.rep_.type_ = TeDATETIME;
+				attribute.dateTimeFormat_ = "YYYYsMMsDDsHHsmmsSS24";
+				attribute.dateChronon_ = TeSECOND;
+				break;
+
+			case FIELD_TYPE_TINY_BLOB:
+			case FIELD_TYPE_MEDIUM_BLOB:
+			case FIELD_TYPE_LONG_BLOB:
+			case FIELD_TYPE_BLOB:
+				if (fields[i].flags & BINARY_FLAG)
+				{
+					attribute.rep_.type_ = TeBLOB;
+				}
+				else
+				{
+					attribute.rep_.type_ = TeSTRING; //como tipo TEXT
+				}
+				break;
+
+			case FIELD_TYPE_VAR_STRING:
+			case FIELD_TYPE_STRING:
+				attribute.rep_.type_ = TeSTRING;
+				attribute.rep_.numChar_ = fields[i].length;
+				break;
+
+			case FIELD_TYPE_ENUM:
+			case FIELD_TYPE_SET:
+			default :
+				attribute.rep_.type_ = TeUNKNOWN;
+				break;
+			}
+			if (fields[i].flags & PRI_KEY_FLAG)
+				attribute.rep_.isPrimaryKey_ = true;
+
+			if (fields[i].flags & AUTO_INCREMENT_FLAG)
+				attribute.rep_.isAutoNumber_ = true;
+
+			attribute.rep_.name_ = fields[i].name;
+			attList_.push_back ( attribute );
+		}
+    }
+    else  // mysql_store_result() returned nothing; should it have?
+    {
+        if(mysql_field_count(mysql_) == 0)
+        {
+	        // query does not return data
+            // (it was not a SELECT)
+			numFields_ = 0;
+            numRows_ = (int)mysql_affected_rows(mysql_);
+        }
+        else // mysql_store_result() should have returned data
+        {
+            return false;
+        }
+    }
+	return true;
+}
+
+
+bool 
+TeMySQLPortal::fetchRow ()
+{
+	if(result_ == NULL)
+	{
+		return false;
+	}
+	if ((row_ = mysql_fetch_row(result_)))
+		return true;
+	else
+		return false;
+}
+
+
+bool 
+TeMySQLPortal::fetchRow (int i)
+{
+	if(result_ == NULL)
+	{
+		return false;
+
+	}
+	if (i >= 0 && i < numRows_)
+	{
+		mysql_data_seek (result_, i);
+		return fetchRow ();
+	}
+	else
+		return false;
+}
+
+
+void TeMySQLPortal::freeResult ()
+{
+	if (result_)
+	{
+		mysql_free_result(result_);
+		result_ = 0;
+	}
+}
+
+
+int 
+TeMySQLPortal::insertId ()
+{
+	return (int)mysql_insert_id(mysql_);
+}
+
+
+int 
+TeMySQL::insertId ()
+{
+	return (int)mysql_insert_id(&mysql_);
+}
+
+
+
+bool 
+TeMySQL::insertProjection (TeProjection *proj)
+{
+	char q[512];
+	sprintf (q,"INSERT INTO te_projection VALUES(0,'%s',%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,'%s',%.15f,%d,'%s',%.15f,%.15f,%.15f,%.15f,%.15f)",
+	proj->name().c_str(),
+		proj->params().lon0*TeCRD,
+		proj->params().lat0*TeCRD,
+		proj->params().offx,
+		proj->params().offy,
+		proj->params().stlat1*TeCRD,
+		proj->params().stlat2*TeCRD,
+		proj->params().units.c_str(),
+		proj->params().scale,
+		proj->params().hemisphere,
+		proj->datum().name().c_str(),
+		proj->datum().radius(),
+		proj->datum().flattening(),
+		proj->datum().xShift(),
+		proj->datum().yShift(),
+		proj->datum().zShift());
+
+	if (!execute(q))
+		return false;
+
+	proj->id(insertId());
+
+	return true;
+}
+
+
+bool 
+TeMySQL::insertView (TeView *view)
+{
+	TeProjection* proj = view->projection();
+	// save its projection
+	if (!proj || !insertProjection(proj))
+	{
+		errorMessage_ = "Error inserting projection";
+		return false;
+	}
+
+	char q[512];
+	if(view->getCurrentTheme() > 0)
+	{
+		sprintf (q,"INSERT INTO te_view VALUES(0,%d,'%s','%s',%d,%E,%E,%E,%E,%d)",
+				proj->id(),view->name().c_str(),view->user().c_str(),view->isVisible(),
+				view->getCurrentBox().lowerLeft().x(),view->getCurrentBox().lowerLeft().y(),
+				view->getCurrentBox().upperRight().x(),view->getCurrentBox().upperRight().y(),
+				view->getCurrentTheme());
+	}
+	else
+	{
+		sprintf (q,"INSERT INTO te_view VALUES(0,%d,'%s','%s',%d,%E,%E,%E,%E,NULL)",
+				proj->id(),view->name().c_str(),view->user().c_str(),view->isVisible(),
+				view->getCurrentBox().lowerLeft().x(),view->getCurrentBox().lowerLeft().y(),
+				view->getCurrentBox().upperRight().x(),view->getCurrentBox().upperRight().y());
+	}
+
+	if (!execute(q))
+		return false;
+
+	view->id(insertId());
+
+	for (unsigned int th=0; th<view->size(); th++)
+	{
+		TeViewNode* node = view->get (th);
+		if (node->type() == TeTHEME)
+		{
+			TeTheme *theme = (TeTheme*) node;
+			insertTheme (theme);
+		}
+		else
+		{
+			TeViewTree* tree = (TeViewTree*)node;
+			insertViewTree (tree);
+		}
+	}
+
+	viewMap()[view->id()] = view;
+	return true;
+}
+
+
+bool 
+TeMySQL::insertViewTree (TeViewTree *tree)
+{
+	string save;
+	save = "INSERT INTO te_theme (name, layer_id, node_type, view_id, priority) VALUES('','";
+	save += tree->name() +  "," + Te2String(tree->parentId()) + "," + Te2String((int)tree->type());
+	save += "," + Te2String(tree->view()) + "," + Te2String(tree->priority()) + ")";
+	if (!execute(save))
+		return false;
+	tree->id(insertId());
+	return true;
+}
+
+
+bool 
+TeMySQL::insertTheme (TeAbstractTheme *tem)
+{
+	string save;
+	save = "INSERT INTO te_theme ";
+	save += "(layer_id, view_id, name, parent_id, priority, node_type, min_scale, max_scale, ";
+	save += "generate_attribute_where, generate_spatial_where, generate_temporal_where, ";
+	save += "collection_table, visible_rep, enable_visibility, lower_x, lower_y, upper_x, upper_y, creation_time) ";
+	save += " VALUES(";
+	
+	if(tem->type()==TeTHEME)
+		save += Te2String(static_cast<TeTheme*>(tem)->layerId()) +", " ;
+	else
+		save += " NULL, ";
+
+	save += Te2String(tem->view()) +", ";
+	save += "'" + escapeSequence(tem->name()) + "', ";
+	save += Te2String(tem->parentId()) +", ";
+	save += Te2String(tem->priority()) +", ";
+	save += Te2String(tem->type()) +", ";
+	save += Te2String(tem->minScale(), 15) +", ";
+	save += Te2String(tem->maxScale(), 15) +", ";
+	save += "'" + escapeSequence(tem->attributeRest()) + "', ";
+	save += "'" + escapeSequence(tem->spatialRest()) + "', ";
+	save += "'" + escapeSequence(tem->temporalRest()) + "', ";
+
+	if(tem->type()==TeTHEME)
+		save += " '" + escapeSequence(static_cast<TeTheme*>(tem)->collectionTable()) + "', ";
+	else
+		save += " '', ";
+
+	save += Te2String(tem->visibleRep()) +", ";
+	save += Te2String(tem->visibility()) +", ";
+	save += Te2String(tem->box().x1()) +", ";
+	save += Te2String(tem->box().y1()) +", ";
+	save += Te2String(tem->box().x2()) +", ";
+	save += Te2String(tem->box().y2()) +",  ";
+	TeTime creationTime = tem->getCreationTime();
+	save += getSQLTime(creationTime);
+	save += " ) ";
+
+	if (!this->execute(save))
+		return false;
+
+	tem->id(this->insertId());
+
+	if((tem->type()==TeTHEME || tem->type()==TeEXTERNALTHEME)&& static_cast<TeTheme*>(tem)->collectionTable().empty())
+	{
+		string colTab = "te_collection_" + Te2String(tem->id());
+		static_cast<TeTheme*>(tem)->collectionTable(colTab);
+		save = "UPDATE te_theme SET collection_table='" + colTab + "' WHERE theme_id=" ;
+		save += Te2String(tem->id());
+		this->execute(save);
+	}
+	if(tem->parentId() == 0)
+	{
+		std::string sql = "UPDATE te_theme SET";
+		sql += "  parent_id = " + Te2String(tem->id());
+		sql += " WHERE theme_id = ";
+		sql += Te2String(tem->id());
+
+		tem->parentId(tem->id());
+
+		if(!this->execute(sql))
+			return false;
+	}
+
+	bool status;
+
+	// insert grouping
+	int numSlices = 0;
+	if(tem->grouping().groupMode_ != TeNoGrouping)
+	{
+		if(!insertGrouping (tem->id(), tem->grouping()))
+			return false;
+		numSlices = tem->grouping().groupNumSlices_;
+	}
+		
+	tem->outOfCollectionLegend().group(-1); 
+	tem->outOfCollectionLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->outOfCollectionLegend())); 
+	if (!status)
+		return status;
+
+	tem->withoutDataConnectionLegend().group(-2); 
+	tem->withoutDataConnectionLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->withoutDataConnectionLegend())); 
+	if (!status)
+		return status;
+
+	tem->defaultLegend().group(-3); 
+	tem->defaultLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->defaultLegend())); 
+	if (!status)
+		return status;
+
+	tem->pointingLegend().group(-4); 
+	tem->pointingLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->pointingLegend())); 
+	if (!status)
+		return status;
+
+	tem->queryLegend().group(-5); 
+	tem->queryLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->queryLegend())); 
+	if (!status)
+		return status;
+
+	tem->queryAndPointingLegend().group(-6); 
+	tem->queryAndPointingLegend().theme(tem->id()); 
+	status = insertLegend (&(tem->queryAndPointingLegend())); 
+	if (!status)
+		return status;
+
+	for (int i = 0; i < numSlices; i++)
+	{
+		tem->legend()[i].group(i);
+		tem->legend()[i].theme(tem->id());
+		status = insertLegend (&(tem->legend()[i]));
+		if (!status)
+			return status;
+	}
+	if (!status)
+		return status;
+
+	//insert metadata theme
+	if(!tem->saveMetadata(this))
+		return false;
+
+	themeMap()[tem->id()] = tem;
+
+	if(tem->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(tem)))
+		return false;
+
+	return true;
+}
+
+bool 
+TeMySQL::insertThemeGroup (TeViewTree* tree)
+{
+	string save;
+	save = "INSERT INTO te_theme ";
+	save += "(name,parent_id,node_type,view_id,priority) ";
+	save += " VALUES ('" + tree->name() + "',1,1, ";
+	save += Te2String(tree->view()) +", ";
+	save += Te2String(tree->priority()) +") ";
+	if (!this->execute(save))
+		return false;
+	tree->id(this->insertId());
+	return true;
+}
+
+
+bool 
+TeMySQL::generateLabelPositions (TeTheme *theme, const std::string& objectId)
+{
+	string	geomTable, query;
+	string	collTable = theme->collectionTable();
+
+	if((collTable.empty()) || (!tableExist(collTable)))
+		return false;
+
+	if (theme->layer()->hasGeometry(TeLINES))
+	{	
+		geomTable = theme->layer()->tableName(TeLINES);
+				
+		string extMax = "CREATE TEMPORARY TABLE maxTable";
+		extMax += " SELECT object_id, lower_x, lower_y, upper_x, upper_y";
+		extMax += " FROM " + geomTable; 
+		if(!objectId.empty())
+			extMax += " WHERE object_id = '"+ objectId +"'";
+		extMax += " ORDER BY object_id, ext_max DESC ";
+		
+		if(!execute(extMax))
+			return false;
+
+		query = "UPDATE " + collTable + ",maxTable SET label_x = (lower_x + upper_x)/2,";
+		query += "label_y = (lower_y + upper_y)/2 WHERE c_object_id = object_id";
+
+		if (execute(query) == false)
+		{
+			execute("DROP TABLE maxTable");
+			return false;
+		}
+
+		execute("DROP TABLE maxTable");
+	}
+
+	if (theme->layer()->hasGeometry(TePOINTS))
+	{
+		geomTable = theme->layer()->tableName(TePOINTS);
+
+		query = "UPDATE " + collTable + "," + geomTable + " SET label_x = x,";
+		query += "label_y = y WHERE c_object_id = object_id";
+
+		if(!objectId.empty())
+			query += " AND c_object_id = '"+ objectId +"'";
+
+		if(execute(query) == false)
+			return false;
+	}
+	
+	if (theme->layer()->hasGeometry(TePOLYGONS))
+	{	
+		geomTable = theme->layer()->tableName(TePOLYGONS);
+				
+		string extMax = "CREATE TEMPORARY TABLE maxTable";
+		extMax += " SELECT object_id, lower_x, lower_y, upper_x, upper_y";
+		extMax += " FROM " + geomTable; 
+		if(!objectId.empty())
+			extMax += " WHERE object_id = '"+ objectId +"'";
+		extMax += " ORDER BY object_id, ext_max DESC ";
+
+		if(!execute(extMax))
+			return false;
+
+		query = "UPDATE " + collTable + ",maxTable SET label_x = (lower_x + upper_x)/2,";
+		query += "label_y = (lower_y + upper_y)/2 WHERE c_object_id = object_id";
+		if(!objectId.empty())
+			query += " AND c_object_id = '"+ objectId +"'";
+
+		if (execute(query) == false)
+		{
+			execute("DROP TABLE maxTable");
+			return false;
+		}
+		
+		execute("DROP TABLE maxTable");
+	}
+	
+	if(theme->layer()->hasGeometry(TeCELLS))
+	{
+		geomTable = theme->layer()->tableName(TeCELLS);
+
+		query = "UPDATE " + collTable + "," + geomTable + " SET label_x = (lower_x + upper_x)/2,";
+		query += "label_y = (lower_y + upper_y)/2 WHERE c_object_id = object_id";
+		if(!objectId.empty())
+			query += " AND c_object_id = '"+ objectId +"'";
+
+		if (execute(query) == false)
+			return false;	
+	}
+	return true;
+}
+
+
+bool
+TeMySQL::insertLayer (TeLayer* layer)
+{
+	TeProjection* proj = layer->projection();
+	if (!proj || !insertProjection(proj))
+	{
+		errorMessage_ = "Error inserting projection";
+		return false;
+	}
+	int pid = proj->id();
+	string save = "INSERT INTO te_layer (layer_id,projection_id,name,lower_x,lower_y,upper_x,upper_y,edition_time) VALUES(0,";
+	save += Te2String(pid);
+	save += ",'" + layer->name() + "', ";
+	save += Te2String(layer->box().x1_, 15) + ", ";
+	save += Te2String(layer->box().y1_, 15) + ", ";
+	save += Te2String(layer->box().x2_, 15) + ", ";
+	save += Te2String(layer->box().y2_, 15) + ", ";
+	TeTime editionTime = layer->getEditionTime();
+	save += getSQLTime(editionTime) + ")";
+
+	// if layer insertion fails remove projection
+	if (!this->execute (save))
+	{
+		string sql = "DELETE FROM te_projection WHERE  projection_id = " + Te2String(pid);
+		this->execute(sql);	
+		return false;
+	}
+
+	layer->id(this->insertId());
+	layerMap()[layer->id()] = layer;
+
+	return true;
+}
+
+bool
+TeMySQL::insertProject (TeProject* project)
+{
+	if (!project)
+		return false;
+
+	string save = "INSERT INTO te_project (project_id, name, description, current_view) VALUES(0,";
+	save += "'" + project->name() + "', ";
+	save += "'" + project->description() + "', ";
+	save += Te2String(project->getCurrentViewId())+ ")";
+
+	// if layer insertion fails remove projection
+	if (!this->execute (save))
+		return false;
+	
+	project->setId(this->insertId());
+	projectMap()[project->id()] = project;
+	for (unsigned int i=0; i<project->getViewVector().size(); i++)
+		insertProjectViewRel(project->id(), project->getViewVector()[i]);
+	return true;
+}
+
+bool TeMySQL::insertLegend (TeLegendEntry *legend)
+{
+	char q[1024];
+	string save;
+	sprintf (q,"INSERT INTO te_legend VALUES(0,%d,%d,%d,'%s','%s','%s')",
+	legend->theme(),
+	legend->group(),
+	legend->count(),
+	escapeSequence(legend->from()).c_str(),
+	escapeSequence(legend->to()).c_str(),
+	escapeSequence(legend->label()).c_str());
+	save = q;
+
+	if (!this->execute(save))
+		return false;
+
+	int legId = insertId();
+	legend->id(legId);
+	legendMap()[legend->id()] = legend;
+	return insertVisual(legend);
+}
+
+
+bool
+TeMySQL::insertRepresentation (int layerId, TeRepresentation& rep)
+{
+	if (layerId <= 0)
+		return false;
+	
+	string sql;
+	sql = "INSERT INTO te_representation (layer_id, geom_type, geom_table, description,";
+	sql += "lower_x, lower_y, upper_x, upper_y, res_x, res_y, num_cols, num_rows) VALUES( ";
+	sql += Te2String(layerId) + ", ";
+	sql += Te2String(static_cast<int>(rep.geomRep_)) + ", ";
+	sql += "'" + rep.tableName_ + "', ";
+	sql += "'" + rep.description_ + "',";
+	sql += Te2String(rep.box_.x1_,15) + ", ";
+	sql += Te2String(rep.box_.y1_,15) + ", ";
+	sql += Te2String(rep.box_.x2_,15) + ", ";
+	sql += Te2String(rep.box_.y2_,15) + ", ";
+	sql += Te2String(rep.resX_) + ", ";
+	sql += Te2String(rep.resY_) + ", ";
+	sql += Te2String(rep.nCols_) + ", ";
+	sql += Te2String(rep.nLins_) + ") ";
+	if (execute(sql))
+	{
+		rep.id_ = (this->insertId());
+		return true;
+	}
+	return false;
+}
+
+bool 
+TeMySQL::insertRelationInfo(const int tableId, const string& tField,
+						    const string& eTable, const string& eField, int& relId)
+{
+	// check if relation already exists
+	TeMySQLPortal* portal = (TeMySQLPortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	relId = -1;
+	string sel = "SELECT relation_id FROM te_tables_relation WHERE";
+	sel += " related_table_id = " + Te2String(tableId);
+	sel += " AND related_attr = '" + tField + "'";
+	sel += " AND external_table_name = '" + eTable + "'";
+	sel += " AND external_attr = '" + eField + "'";
+	if (!portal->query(sel))
+	{
+		delete portal;
+		return false;
+	}
+
+	if (portal->fetchRow())
+	{
+		relId = atoi(portal->getData(0));
+		delete portal;
+		return true;
+	}
+	delete portal;
+
+	string sql = "INSERT INTO te_tables_relation(related_table_id, related_attr, external_table_name, external_attr) ";
+	sql += " VALUES( ";
+	sql += Te2String(tableId);
+	sql += ",'" + tField + "'";
+	sql += ",'" + eTable + "'";
+	sql += ",'" + eField + "')";
+	if (!this->execute(sql))
+		return false;
+	relId = this->insertId(); 
+	return true;
+}
+
+bool 
+TeMySQL::insertTable(TeTable &table)
+{
+	string tableName = table.name();
+	int size = table.size();
+	TeAttributeList att = table.attributeList();
+	TeAttributeList::iterator it = att.begin();
+	TeAttributeList::iterator itEnd = att.end();
+	TeTableRow row;
+	
+	if (!beginTransaction())
+		return false;
+
+	int i;
+	unsigned int j;
+	for ( i = 0; i < size; i++ )	
+	{
+		row = table[i];
+		it = att.begin();
+		string attrs;
+		string values;
+		j = 1;
+		unsigned int jj = 0;
+		while ( it != itEnd )
+		{
+			if ((jj>=row.size()) || row[jj].empty() || (*it).rep_.isAutoNumber_)
+			{
+				++it;
+				j++;
+				jj++;
+				continue;
+			}
+			
+			if (!values.empty())
+			{
+				attrs += ", ";
+				values += ", ";
+			}			
+			attrs += (*it).rep_.name_;			
+			switch ((*it).rep_.type_)
+			{
+			case TeSTRING:
+				values += "'"+ escapeSequence( row[jj] ) +"'";
+				break;
+			case TeREAL:
+				{
+				std::string strValue = row[jj];
+				replace(strValue.begin(), strValue.end(), ',', '.');
+				values += strValue;
+				}
+				break;
+			case TeINT:
+				values += row[jj];
+				break;
+			case TeDATETIME:
+				{
+					const string temp_dt = string(row[jj].c_str());
+					TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
+					values += this->getSQLTime(t);
+				}
+				break;
+			case TeCHARACTER:
+				values += "'" + escapeSequence(row[jj]) + "'";
+				break;
+			case TeBOOLEAN:
+				{
+					std::string value = "0";
+					if(row[jj] == "1" || TeConvertToLowerCase(row[jj]) == "t" || TeConvertToLowerCase(row[jj]) == "true")
+					{
+						value = "1";
+					}
+					values += value;
+				}
+				break;
+			case TeBLOB:
+				values += "'" + escapeSequence(row[jj]) + "'";
+			default:
+				values += "'"+ escapeSequence(row[jj]) +"'";
+				break;
+			}
+			++it;
+			j++;
+			jj++;
+		}
+
+		if (values.empty()) 
+			continue;
+
+		string q = "INSERT INTO "+tableName + " ("+ attrs+") " + " VALUES ("+values+") ";
+		if(!execute(q))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool
+TeMySQL::updateTable(TeTable &table)
+{
+	TeAttributeList& att = table.attributeList();
+	unsigned int i;
+	string uniqueVal;
+	bool isUniqueValString = false;
+	
+	if (!beginTransaction())
+		return false;
+
+	string uniqueName = table.uniqueName(); // primary key explicitly defined or 
+	if (table.uniqueName().empty())			// check in the attribute list
+	{								
+		for (i=0; i<att.size(); ++i)
+			if (att[i].rep_.isPrimaryKey_)
+			{
+				uniqueName = att[i].rep_.name_;
+				table.setUniqueName(uniqueName);
+				break;
+			}
+	}
+
+	TeAttributeList::iterator it;
+	TeTableRow row;
+	unsigned int j;
+	for (i = 0; i < table.size(); i++  )
+	{
+		bool useComma = false;
+		row = table[i];
+		it = att.begin();
+		string q;
+		j = 1;
+		int jj = 0;
+		while ( it != att.end() )
+		{
+			if (uniqueName != (*it).rep_.name_)
+			{
+				if ((*it).rep_.isAutoNumber_)
+				{
+					++it;
+					j++;
+					jj++;
+					continue;
+				}			
+				if(useComma == true)
+				{
+					q += ", ";
+				}
+				else
+				{
+					useComma = true;
+				}
+				q += (*it).rep_.name_ + " = ";
+				  				
+				if(row[jj].empty())
+				{
+					q += " null";
+
+					++it;
+					j++;
+					jj++;
+					continue;
+				}
+
+  				switch ((*it).rep_.type_)
+  				{
+  					case TeSTRING:
+						q += "'"+escapeSequence(row[jj])+"'";
+  					break;
+  					case TeREAL:
+					{
+						std::string value = row[jj];
+						replace(value.begin(), value.end(), ',', '.');
+						q += value;
+					}
+  					break;
+  					case TeINT:
+						q += row[jj];
+  					break;
+					case TeDATETIME:
+					{
+						const string temp_dt = string(row[jj].c_str());
+						TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
+						q += this->getSQLTime(t);
+					}
+  					break;
+					case TeCHARACTER:
+						q += "'" + escapeSequence(row[jj]) + "'";
+  					break;
+					case TeBLOB:
+						q += "'" + escapeSequence(row[jj]) + "'";
+					break;
+  					default:
+						q += "'"+escapeSequence(row[jj])+"'";
+  					break;
+  				}
+			}
+			else
+			{
+				uniqueVal = row[jj];
+				isUniqueValString = ((*it).rep_.type_ == TeSTRING);
+			}
+			++it;
+			j++;
+			jj++;
+		}
+		if (q.empty())
+			continue;
+		
+		if (!uniqueName.empty() && !uniqueVal.empty())  
+		{
+			if(isUniqueValString)
+				q += " WHERE " + uniqueName + " = '" + uniqueVal +"'";
+			else
+				q += " WHERE " + uniqueName + " = " + uniqueVal;
+		}
+		string sql = "UPDATE "+ table.name() + " SET " + q;
+		if (!execute(sql))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeMySQL::insertTableInfo (int layerId, TeTable &table, const string& user)
+{
+	string sql;
+
+	sql = "INSERT INTO te_layer_table (unique_id, attr_link,attr_initial_time, attr_final_time, attr_time_unit,attr_table_type, ";
+	sql += " user_name, attr_table ";
+	if (layerId > 0)
+		sql += ",layer_id";
+	sql += ") VALUES( ";
+	sql += "'" + table.uniqueName() + "', ";
+	sql += "'" + table.linkName() + "', ";
+	sql += "'" + table.attInitialTime() + "', ";
+	sql += "'" + table.attFinalTime() + "', ";
+	sql += "" + Te2String(table.attTimeUnit()) + ", ";
+	sql += ""+ Te2String(table.tableType()) + ", ";
+	sql += "'" + user + "','" + table.name() +"'";
+	if (layerId > 0)
+		sql += ", " + Te2String(layerId) ;
+	sql += ")";
+
+	if (!this->execute(sql))
+		return false;
+
+	int id = (this->insertId());
+	table.setId(id);
+	return true;
+}
+
+bool 
+TeMySQL::insertThemeTable (int themeId, int tableId, int relationId, int tableOrder)
+{
+	string relId;
+	if (relationId > 0)
+		relId = Te2String(relationId);
+	else
+		relId = "NULL";
+
+	string sql = "INSERT INTO te_theme_table VALUES (0,";
+	sql += Te2String(themeId) + "," + Te2String(tableId) + ",";
+	sql += relId + "," + Te2String(tableOrder) + ")";
+
+
+	if (!execute(sql))
+		return false;
+
+	return true;
+}
+
+bool
+TeMySQL::insertPolygonSet(const string& table, TePolygonSet &ps)
+{
+	double		ext_max;
+	unsigned int	i, ni, size, npts=100;
+	unsigned int k;
+	double		*points	= new double[2*sizeof(double)*100];
+	char		buf[256], *query, *end;
+	int			parentId = 0;
+	unsigned int querySize = 100*4*sizeof(double)+256+4;
+	query = new char[querySize];
+	npts = 0;
+	this->beginTransaction();
+	for (unsigned int p = 0; p < ps.size(); ++p)
+	{
+		TePolygon& poly = ps [p];
+		parentId = 0;
+		for (k=0; k<poly.size(); ++k)
+		{
+			TeLinearRing& ring(poly[k]);
+			TeBox b = ring.box();
+			size = ring.size();
+			ni = 0;
+			ext_max = MAX(b.width(),b.height());
+			if (k==0)
+				ni = poly.size()-1;
+			else
+				ni = 0;
+
+			// Create and save the BLOB
+			if (points && size > npts)
+			{
+				delete [] points;
+				points = new double[2*sizeof(double)*size];
+				npts = size;
+			}
+			int iac = 0;
+			for (i=0;i<size;++i)
+			{
+				points[iac++]=swappd(ring[i].x());
+				points[iac++]=swappd(ring[i].y());
+			}
+
+			sprintf (buf,"INSERT INTO %s values(0,'%s',%d,%d,%d,%.15f,%.15f,%.15f,%.15f,%.15f,",
+				table.c_str(),escapeSequence(poly.objectId()).c_str(),size,ni,parentId,b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
+
+			if (query && (size*4*sizeof(double)+strlen(buf)+4) > querySize)
+			{
+				delete [] query;
+				querySize = size*4*sizeof(double)+strlen(buf)+4;
+				query = new char[querySize];
+			}
+			end = strxmov(query,buf,(char*)0);
+			*end++ = '\'';
+			end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
+			*end++ = '\'';
+			*end++ = ')';
+
+			if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
+			{
+				errorMessage_ = string(mysql_error(&mysql_));
+				delete []query;
+				break;
+			}
+			ring.geomId (insertId());
+			if (k==0)
+			{
+				parentId = ring.geomId();
+				ps[p].geomId(parentId);
+			}
+		}
+		sprintf(buf,"UPDATE %s SET parent_id=%d WHERE geom_id=%d",table.c_str(),parentId,parentId);
+		if (mysql_real_query(&mysql_,buf,(unsigned int)strlen(buf)) != 0)
+		{
+			errorMessage_ = string(mysql_error(&mysql_));
+			delete []query;
+			break;
+		}	
+	}
+	if (points)
+		delete []points;
+	if (query)
+		delete []query;
+	this->commitTransaction();
+	return true;
+}
+
+bool 
+TeMySQL::insertPolygon (const string& table, TePolygon &poly )
+{
+	double	ext_max;
+
+	int	i,
+		ni,
+		size;
+	unsigned int k;
+	double	*points	= NULL;
+	char	buf[256], *query, *end;
+
+
+	int parentId = 0;
+	for ( k = 0; k < poly.size(); k++ )
+	{
+		TeLinearRing ring ( poly[k] );
+		TeBox b = ring.box();
+		size = ring.size();
+		ni = 0;
+		ext_max = MAX(b.width(),b.height());
+		if (k==0)
+			ni = poly.size()-1;
+		else
+			ni = 0;
+
+		// Create and save the BLOB
+		points = new double[2*sizeof(double)*size];
+
+		int iac = 0;
+		for (i=0;i<size;i++)
+		{
+			points[iac++]=swappd(ring[i].x());
+			points[iac++]=swappd(ring[i].y());
+		}
+
+		sprintf (buf,"INSERT INTO %s values(0,'%s',%d,%d,%d,%.15f,%.15f,%.15f,%.15f,%.15f,",
+			table.c_str(),escapeSequence(poly.objectId()).c_str(),size,ni,parentId,b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
+
+		query = new char[size*4*sizeof(double)+strlen(buf)+4];
+		end = strxmov(query,buf,(char*)0);
+		*end++ = '\'';
+		end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
+		*end++ = '\'';
+		*end++ = ')';
+		delete []points;
+
+		if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
+		{
+			errorMessage_ = string(mysql_error(&mysql_));
+			delete []query;
+			return false;
+		}
+		delete []query;
+		query = 0;
+		ring.geomId (insertId());
+		if (k==0)
+		{
+			parentId = ring.geomId();
+			poly.geomId(parentId);
+		}
+	}
+	sprintf(buf,"UPDATE %s SET parent_id=%d WHERE geom_id=%d",table.c_str(),parentId,parentId);
+	if (mysql_real_query(&mysql_,buf,(unsigned int)strlen(buf)) != 0)
+	{
+		errorMessage_ = string(mysql_error(&mysql_));
+		delete []query;
+		return false;
+	}	
+	return true;
+}
+
+bool 
+TeMySQL::updatePolygon (const string& table, TePolygon &poly )
+{
+	double	ext_max;
+	int ni;
+	unsigned int i,k,size,parentId;
+	double	*points	= NULL;
+	char	buf[256], message[256], *query, *end;
+	TeBox b = poly.box();
+
+	std::string objectId = poly.objectId();
+	for ( k = 0; k < poly.size(); k++ )
+	{
+		TeLinearRing ring ( poly[k] );
+		size = ring.size();
+		ni = 0;
+		if (k==0)
+		{
+			ext_max = MAX(b.width(),b.height());
+			ni = poly.size()-1;
+			parentId = ring.geomId();
+		}
+		else
+			ni = 0;
+
+// Create and save the BLOB
+		points = new double[2*sizeof(double)*size];
+		int iac = 0;
+		for (i=0;i<size;i++)
+		{
+			points[iac++]=swappd(ring[i].x());
+			points[iac++]=swappd(ring[i].y());
+		}
+
+		sprintf (buf,"UPDATE %s SET object_id=%s, num_coords=%d, num_holes=%d, parent_id=%d, lower_x=%.15f, lower_y=%.15f, upper_x=%.15f, upper_y=%.15f, ext_max=%.15f, spatial_data=",
+			table.c_str(),escapeSequence(objectId).c_str(),size,ni,parentId,b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
+		query = new char[size*4*sizeof(double)+strlen(buf)+50];
+		end = strxmov(query,buf,(char*)0);
+		*end++ = '\'';
+		end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
+		*end++ = '\'';
+		sprintf (message," WHERE geom_id=%d",ring.geomId());
+		end = strxmov(end,message,0);
+		delete []points;
+
+		if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
+		{
+			errorMessage_ = string(mysql_error(&mysql_));
+			delete []query;
+			return false;
+		}
+		delete []query;
+		query = 0;
+	}
+	return true;
+}
+
+
+bool 
+TeMySQLPortal::fetchGeometry (TePolygon& poly)
+{
+	int ni,j;
+	TeLinearRing ring = this->getLinearRing(ni);
+	poly.objectId ( ring.objectId() );
+	poly.geomId ( ring.geomId() );
+	poly.add ( ring );
+	int parentId = poly.geomId();
+	while (fetchRow())
+	{
+		if (atoi(this->getData("parent_id")) == parentId)
+		{
+			TeLinearRing ring = getLinearRing(j);
+			poly.add ( ring );
+		}
+		else
+			return true;
+	}
+	return false;
+}
+
+bool 
+TeMySQLPortal::fetchGeometry (TePolygon& poly, const unsigned int& initIndex)
+{
+	int np, ni,k;
+	double x,y,*data;
+	
+	TeLine2D line;
+	line.geomId(atoi(getData(initIndex)));
+	line.objectId(getData(initIndex+1));
+	np = atoi (getData(initIndex+2));
+	ni = atoi (getData(initIndex+3));
+	data = (double*)getData(initIndex+10);
+	for (k=0;k<np;k++)
+	{
+		x = swappd(*data++);
+		y = swappd(*data++);
+		TeCoord2D pt(x,y);
+		line.add(pt);
+	}
+
+	TeLinearRing ring(line); 
+	poly.objectId ( ring.objectId() );
+	poly.geomId ( ring.geomId() );
+	poly.add ( ring );
+	int parentId = poly.geomId();
+	while (fetchRow())
+	{
+		if (atoi(this->getData(initIndex+4)) == parentId)
+		{
+			TeLine2D hole;
+			hole.geomId(atoi(getData(initIndex)));
+			hole.objectId(getData(initIndex+1));
+			np = atoi (getData(initIndex+2));
+			data = (double*)getData(initIndex+10);
+			for (k=0;k<np;k++)
+			{
+				x = swappd(*data++);
+				y = swappd(*data++);
+				TeCoord2D pt(x,y);
+				hole.add(pt);
+			}
+
+			TeLinearRing ring(hole); 
+			poly.add ( ring );
+		}
+		else
+			return true;
+	}
+	return false;
+}
+
+
+TeLinearRing 
+TeMySQLPortal::getLinearRing (int &ni)
+{
+	int index = atoi(getData("geom_id"));
+	string object_id = getData("object_id");
+	int np = atoi (getData("num_coords"));
+	ni = atoi (getData("num_holes"));
+	TeBox b (getDouble("lower_x"),getDouble("lower_y"),getDouble("upper_x"),getDouble("upper_y"));
+	int k;
+	TeLine2D line;
+	double x,y,*data = (double*)getData("spatial_data");
+
+	for (k=0;k<np;k++)
+	{
+		x = swappd(*data++);
+		y = swappd(*data++);
+		TeCoord2D pt(x,y);
+		line.add(pt);
+	}
+
+	TeLinearRing ring ( line );
+	ring.objectId (object_id);
+	ring.geomId (index);
+	ring.setBox (b);
+	return ring;
+}
+
+bool 
+TeMySQL::insertLineSet(const string& table, TeLineSet &ls)
+{
+	char	buf[256],
+			*query,
+			*end;
+	unsigned int npts = 100, size;
+	double	*points	= new double[2*sizeof(double)*npts],
+			ext_max;
+	int		iac;
+	TeBox	b;
+	unsigned int querySize = 100*4*sizeof(double)+256+4;
+	query = new char[querySize];
+
+	unsigned int nl, i;
+	this->beginTransaction();
+	for ( nl = 0; nl < ls.size(); ++nl)
+	{
+		TeLine2D& l = ls[nl];
+		b=l.box();
+		ext_max = MAX(b.width(),b.height());
+
+		size = l.size();
+		if (size > npts)
+		{
+			delete []points;
+			points = new double[2*sizeof(double)*size];
+			npts = size;
+		}
+		iac = 0;
+		for (i=0;i<size;i++)
+		{
+			points[iac++]=l[i].x();
+			points[iac++]=l[i].y();
+		}
+
+		sprintf (buf,"INSERT INTO %s values(0,'%s',%d,%.15f,%.15f,%.15f,%.15f,%.15f,",
+		table.c_str(),
+		escapeSequence(l.objectId()).c_str(),
+		size,
+		b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
+
+		if ((size*4*sizeof(double)+strlen(buf)+4) > querySize)
+		{
+			delete []query;
+			querySize = size*4*sizeof(double)+strlen(buf)+4;
+			query = new char[querySize];
+		}
+		end = strxmov(query,buf,0);
+		*end++ = '\'';
+		end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
+		*end++ = '\'';
+		*end++ = ')';
+
+		if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
+		{
+			errorMessage_ = string(mysql_error(&mysql_));
+			break;
+		}
+
+		l.geomId (insertId());
+	}
+	this->commitTransaction();
+	delete []points;
+	delete []query;
+	return true;
+}
+
+bool 
+TeMySQL::insertLine (const string& table, TeLine2D &l)
+{
+	char	buf[256],
+			*query,
+			*end;
+	double	*points	= NULL,
+			ext_max;
+	int		size=l.size(),
+			i,
+			iac;
+	TeBox	b=l.box();
+
+	ext_max = MAX(b.width(),b.height());
+	points = new double[2*sizeof(double)*size];
+	iac = 0;
+
+	for (i=0;i<size;i++)
+	{
+		points[iac++]=l[i].x();
+		points[iac++]=l[i].y();
+	}
+
+	sprintf (buf,"INSERT INTO %s values(0,'%s',%d,%.15f,%.15f,%.15f,%.15f,%.15f,",
+	table.c_str(),
+	escapeSequence(l.objectId()).c_str(),
+	size,
+	b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
+
+	query = new char[size*4*sizeof(double)+strlen(buf)+4];
+
+	end = strxmov(query,buf,0);
+	*end++ = '\'';
+	end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
+	*end++ = '\'';
+	*end++ = ')';
+	delete []points;
+
+	if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
+	{
+		errorMessage_ = string(mysql_error(&mysql_));
+		delete [] query;
+		return false;
+	}
+
+	l.geomId (insertId());
+	delete [] query;
+	return true;
+}
+
+
+bool 
+TeMySQL::updateLine (const string& table, TeLine2D &l)
+{
+	char	buf[256],
+			message[256],
+			*query,
+			*end;
+	double	*points	= NULL,
+			ext_max;
+	int		size=l.size(),
+			i,
+			iac;
+	TeBox	b=l.box();
+
+	ext_max = MAX(b.width(),b.height());
+	points = new double[2*sizeof(double)*size];
+	iac = 0;
+
+	for (i=0;i<size;i++)
+	{
+		points[iac++]=l[i].x();
+		points[iac++]=l[i].y();
+	}
+
+	sprintf (buf,"UPDATE %s SET num_coords=%d, lower_x=%.15f, lower_y=%.15f, upper_x=%.15f, upper_y=%.15f, ext_max=%.15f, spatial_data=",
+	table.c_str(),size,b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),ext_max);
+	query = new char[size*4*sizeof(double)+strlen(buf)+50];
+	end = strxmov(query,buf,(char*)0);
+	*end++ = '\'';
+	end += mysql_real_escape_string(&mysql_,end,(char*)points,size*2*sizeof(double));
+	*end++ = '\'';
+	delete []points;
+
+	sprintf (message," WHERE geom_id=%d",l.geomId());
+	end = strxmov(end,message,(char*)0);
+
+	if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)) != 0)
+	{
+		errorMessage_ = string(mysql_error(&mysql_));
+		delete []query;
+		return false;
+	}
+	delete []query;
+	return true;
+}
+
+
+
+bool
+TeMySQLPortal::fetchGeometry(TeLine2D& line)
+{
+	int index = atoi (getData ("geom_id"));
+	string object_id = getData ("object_id");
+	int np = atoi (getData("num_coords"));
+	TeBox b (atof(getData("lower_x")),atof(getData("lower_y")),atof(getData("upper_x")),atof(getData("upper_y")));
+	int k;
+	double x,y,*data = (double*)getData("spatial_data");
+
+	for (k=0;k<np;k++)
+	{
+		x = *data++;
+		y = *data++;
+		TeCoord2D pt(x,y);
+		line.add(pt);
+	}
+	line.objectId (object_id);
+	line.geomId (index);
+	line.setBox (b);
+	return (fetchRow());
+}
+
+bool
+TeMySQLPortal::fetchGeometry(TeLine2D& line, const unsigned int& initIndex)
+{
+	int index = atoi (getData (initIndex));
+	string object_id = getData (initIndex+1);
+	int np = atoi (getData(initIndex+2));
+	int k;
+	double x,y,*data = (double*)getData(initIndex+8);
+
+	for (k=0;k<np;k++)
+	{
+		x = *data++;
+		y = *data++;
+		TeCoord2D pt(x,y);
+		line.add(pt);
+	}
+	line.objectId (object_id);
+	line.geomId (index);
+	return (fetchRow());
+}
+
+
+bool 
+TeMySQL::insertPoint(const string& table,TePoint &p)
+{
+	string q = "INSERT INTO " + table + " VALUES(0,";
+	q += "'" + escapeSequence(p.objectId()) + "',";
+	q += Te2String(p.location().x_,15) + ",";
+	q += Te2String(p.location().y_,15) + ")";
+	
+	if (!this->execute(string(q)))
+		return false;
+	p.geomId(this->insertId());
+	return true;
+}
+
+
+bool 
+TeMySQLPortal::fetchGeometry(TePoint& p)
+{
+	TeCoord2D c(atof (getData("x")), atof (getData("y")));
+	p.geomId( atoi(getData("geom_id")));
+	p.objectId( string(getData("object_id")));
+	p.add(c);
+	return (fetchRow());
+}
+
+bool 
+TeMySQLPortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
+{
+	TeCoord2D c(atof (getData(initIndex+2)), atof (getData(initIndex+3)));
+	p.geomId( atoi(getData(initIndex)));
+	p.objectId( string(getData(initIndex+1)));
+	p.add(c);
+	return (fetchRow());
+}
+
+
+bool 
+TeMySQL::insertText(const string& table, TeText &t)
+{
+	char q[256];
+	sprintf (q,"INSERT INTO %s values(0,'%s',%.15f,%.15f,'%s',%.15f, %.15f, %.15f, %.15f)",
+		table.c_str(), escapeSequence(t.objectId()).c_str(),
+		t.location().x_, t.location().y_,
+		t.textValue().c_str(), t.angle(), t.height(),t.alignmentVert(),t.alignmentHoriz());
+	if (!this->execute(string(q)))
+		return false;
+	t.geomId(this->insertId());
+
+	return true;
+}
+
+
+bool 
+TeMySQL::insertArc(const string& table, TeArc &arc)
+{
+	char q[256];
+	sprintf (q,"INSERT INTO %s values(0,'%s',%d,%d)",
+		table.c_str(),escapeSequence(arc.objectId()).c_str(),arc.fromNode().geomId(),arc.toNode().geomId());
+	if (!this->execute(string(q)))
+		return false;
+	arc.geomId(this->insertId());
+	return true;
+}
+
+
+bool
+TeMySQL::insertNode(const string& table, TeNode &node)
+{
+	char q[256];
+	sprintf (q,"INSERT INTO %s values(0,'%s',%.15f,%.15f)",table.c_str(),node.objectId().c_str(),node.location().x(),node.location().y());
+	if (!this->execute(string(q)))
+		return false;
+	node.geomId(this->insertId());
+	return true;
+}
+
+bool 
+TeMySQL::insertBlob (const string& tableName, const string& columnBlob , const string& whereClause, unsigned char* data, int size)
+{
+	if (whereClause.empty())
+		return false;
+
+	TeMySQLPortal* portal = (TeMySQLPortal*)this->getPortal();
+	if (!portal)
+		return false;
+
+	string q = "SELECT * FROM "+ tableName +" WHERE "+ whereClause;
+	if ((!portal->query(q)) || (!portal->fetchRow()))
+	{
+		delete portal;
+		return false;
+	}
+	delete portal;
+
+	char	message[256],
+			*query,
+			*end;
+	sprintf (message,"UPDATE %s SET %s = ",tableName.c_str(), columnBlob.c_str());
+
+	query = new char[2*size+strlen(message)+4];
+	end = strxmov(query,message,0);
+	*end++ = '\'';
+	end += mysql_real_escape_string(&mysql_,end,(char*)data,size);
+	*end++ = '\'';
+
+	sprintf (message," WHERE %s",whereClause.c_str());
+
+	end = strxmov(end,message,0);
+
+	if (mysql_real_query(&mysql_,query,(unsigned int) (end - query)))
+	{
+		errorMessage_ = string(mysql_error(&mysql_));
+		delete []query;
+		return false;
+	}
+	delete []query;	
+	return true;
+}
+
+bool
+TeMySQL::insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, 
+						   unsigned char *buf,unsigned long size, int band, unsigned int res, unsigned int subband)
+{
+	if (blockId.empty()) // no block identifier provided
+	{
+		errorMessage_ = "bloco sem identificador";
+		return false;
+	}
+
+	TeMySQLPortal* portal = (TeMySQLPortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	bool update = false;
+	string q ="SELECT * FROM " + table; 
+	q += " WHERE block_id='" + blockId + "'";
+
+	if (!portal->query (q))
+	{
+		delete portal;
+		return false;
+	}
+		// check if this block is alread in the database
+	if (portal->fetchRow())
+		update = true;
+	delete portal;
+
+	char	message[256],
+			*end;
+	if (!update)
+	{
+		sprintf (message,"INSERT INTO %s values('%s',%.15f,%.15f,%.15f,%.15f,%d,%d,%d,",
+			table.c_str(),blockId.c_str(),ll.x(),ll.y(),ur.x(),ur.y(),band,res,subband);
+	}
+	else
+	{
+		sprintf (message,"UPDATE %s SET spatial_data=",table.c_str());
+	}
+
+	if (bufferBlobSize_ < (long)(2*size+strlen(message)+20))
+	{
+		if (bufferBlob_)
+			delete []bufferBlob_;
+		bufferBlobSize_ = 2*size+strlen(message)+20;
+		bufferBlob_ = new char[bufferBlobSize_];
+	}
+	end = strxmov(bufferBlob_,message,0);
+	*end++ = '\'';
+	end += mysql_real_escape_string(&mysql_,end,(char*)buf,size);
+	*end++ = '\'';
+
+	if (update)
+	{
+		sprintf (message,", block_size=%ld WHERE block_id='%s'",size,blockId.c_str());
+		end = strxmov(end,message,0);
+	}
+	else
+	{
+		sprintf (message,",%ld)",size);
+		end = strxmov(end,message,0);
+	}
+
+	if (mysql_real_query(&mysql_,bufferBlob_,(unsigned int) (end - bufferBlob_)))
+	{
+		errorMessage_ = string(mysql_error(&mysql_));
+		delete []bufferBlob_;
+		bufferBlobSize_ = 0;
+		bufferBlob_ = 0;
+		return false;
+	}
+	return true;
+}
+
+bool
+TeMySQLPortal::fetchGeometry(TeNode& n)
+{
+	TeCoord2D c(atof (getData("x")), atof (getData("y")));
+	n.geomId( atoi(getData("geom_id")));
+	n.objectId( string(getData("object_id")));
+	n.add(c);
+	return (fetchRow());
+}
+
+bool
+TeMySQLPortal::fetchGeometry(TeNode& n, const unsigned int& initIndex)
+{
+	TeCoord2D c(atof (getData(initIndex+2)), atof (getData(initIndex+3)));
+	n.geomId( atoi(getData(initIndex)));
+	n.objectId( string(getData(initIndex+1)));
+	n.add(c);
+	return (fetchRow());
+}
+
+bool
+TeMySQL::insertCell(const string& table, TeCell &c)
+{
+	TeBox	b=c.box();
+	char	q[256];
+	sprintf (q,"INSERT INTO %s values(0,'%s',%.15f,%.15f,%.15f,%.15f,%d,%d)",
+		table.c_str(),c.objectId().c_str(),
+		b.lowerLeft().x(),b.lowerLeft().y(),b.upperRight().x(),b.upperRight().y(),
+		c.column(),c.line());
+
+	if (!this->execute (string(q)))
+		return false;
+	c.geomId(this->insertId());
+	return true;
+}
+
+
+TeTime
+TeMySQLPortal::getDate (int i)
+{ 
+	string s = getData(i);
+	TeTime t(s, TeSECOND, "YYYYsMMsDDsHHsmmsSS","-"); 
+	return t; 
+}
+
+TeTime
+TeMySQLPortal::getDate (const string& s)
+{ 
+	string sv = getData(s);
+	TeTime t(sv, TeSECOND, "YYYYsMMsDDsHHsmmsSS","-"); 
+	return t; 
+}
+
+string 
+TeMySQLPortal::getDateAsString(const string& s)
+{
+	TeTime t = this->getDate(s);
+	if (t.isValid())
+	{		
+		string tval = "\'"+t.getDateTime("YYYYsMMsDDsHHsmmsSS", "-")+"\'";
+		return tval;
+	}
+	else
+		return "";
+}
+
+string 
+
+TeMySQLPortal::getDateAsString(int i)
+{
+	TeTime t = this->getDate(i);
+	if (t.isValid())
+	{		
+		string tval = "\'"+t.getDateTime("YYYYsMMsDDsHHsmmsSS", "-")+"\'";
+		return tval;
+	}
+	else
+		return "";
+}
+
+double 
+TeMySQLPortal::getDouble (const string& s)
+{
+	return atof(getData(s));
+}
+
+
+double 
+TeMySQLPortal::getDouble (int i)
+{
+	if (row_ == 0)
+		return 0.;
+
+	if (row_[i])
+		return atof(row_[i]);
+	else
+		return 0.;
+}
+
+int 
+TeMySQLPortal::getInt (const string& s)
+{
+	return atoi(getData(s));
+}
+
+
+int 
+TeMySQLPortal::getInt (int i)
+{
+	if (row_ == 0)
+		return 0;
+
+	if (row_[i])
+		return atoi(row_[i]);
+	else
+		return 0;
+}
+
+
+char* 
+TeMySQLPortal::getData (int i)
+{
+	if (row_ == 0)
+		return "";
+
+	if (row_[i])
+		return row_[i];
+	else
+		return "";
+}
+
+
+char* 
+TeMySQLPortal::getData (const string& s)
+{
+	string fieldName;
+//	size_t pos = s.find(".", string::npos,1);
+	size_t pos = s.find(".", 0, 1);
+	if (pos != string::npos)
+		fieldName = s.substr(pos+1);
+	else
+		fieldName = s;
+
+	if (row_ == 0)
+		return "";
+
+	TeAttributeList::iterator it = attList_.begin();
+
+	int j = 0;
+	while ( it != attList_.end() )
+	{
+		if ((TeConvertToUpperCase(fieldName) == TeConvertToUpperCase((*it).rep_.name_)) ||
+		    (TeConvertToUpperCase(s) == TeConvertToUpperCase((*it).rep_.name_)))
+		{
+			if (row_[j])
+				return row_[j];
+			else
+				return "";
+		}
+		++it;
+		j++;
+	}
+	return "";
+}
+
+bool
+TeMySQLPortal::getBlob (const string& s, unsigned char* &data, long& size)
+{
+	string fieldName;
+//	size_t pos = s.find(".", string::npos,1);
+	size_t pos = s.find(".", 0, 1);
+	if (pos != string::npos)
+		fieldName = s.substr(pos+1);
+	else
+		fieldName = s;
+
+	TeAttributeList::iterator it = attList_.begin();
+	int j = 0, i=-1;
+	while ( it != attList_.end() )
+	{
+		if (fieldName == (*it).rep_.name_)
+		{
+			i=j;
+			break;
+		}
+		++it;
+		j++;
+	}
+	if (i<0)
+		return false;
+
+	unsigned long *lengths;
+	lengths = mysql_fetch_lengths(result_);
+	size = lengths[i];
+	if (row_[i])
+	{
+//		data = (unsigned char*) row_[i];
+		data = new unsigned char[size];
+		memcpy(data, (unsigned char*) row_[i], size * sizeof(char));
+		return true;
+	}
+	else
+	{
+		data = 0;
+		return false;
+	}
+}
+
+
+bool 
+TeMySQLPortal::getBool (const string& s)
+{
+	int val = atoi(getData(s));
+	return val ? true : false;
+}
+
+
+bool 
+TeMySQLPortal::getBool (int i)
+{
+	if (row_ == 0)
+		return false;
+	int val = atoi(getData(i));
+	return val ? true : false;
+}
+
+bool 
+TeMySQLPortal::getRasterBlock(unsigned long& size, unsigned char* ptData)
+{
+	
+	// get the actual length of the compressed data
+	size = atoi(getData("block_size"));
+	if ( (size>0) && row_[8])
+	{
+		memcpy((void*)ptData,(void*)(row_[8]),size);
+		return true;
+	}
+	else
+	{
+		ptData = 0;
+		return false;
+	}
+}
+
+bool
+TeMySQL::inClauseValues(const string& query, const string& attribute, vector<string>& inClauseVector)
+{
+	int i = 0, numRows = 0, count = 0, chunk = 200;
+	string id, inClause = "(", plic = "'";
+
+	TeDatabasePortal *pt = getPortal();
+	if(pt->query(query) == false)
+	{
+		delete pt;
+		return false;
+	}
+
+	while (numRows < pt->numRows())
+	{
+		if(count < chunk && pt->fetchRow())
+		{
+			id = pt->getData(attribute);
+			inClause = inClause + plic + id + "',";
+			++count;
+			++numRows;
+		}
+		else
+		{
+			inClause = inClause.substr(0, inClause.size()-1);
+			inClause += ")";
+			inClauseVector.push_back(inClause);
+			count = 0;
+			++i;
+			inClause = "(";
+		}
+	}
+	if (numRows == 0)
+	{
+		delete pt;
+		return true;
+	}
+	else
+	{
+		inClause = inClause.substr(0, inClause.size()-1);
+		inClause += ")";
+		inClauseVector.push_back(inClause);
+	}
+
+	delete pt;
+	return true;
+}
+
+string 
+TeMySQL::getSQLTime(const TeTime& time) const
+{
+	string result = "'"+ time.getDateTime("YYYYsMMsDDsHHsmmsSS", "-", ":") +"'";
+	return result;
+}
+
+string
+TeMySQL::getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, 
+						   const string& initialTime, const string& finalTime)
+{
+	
+	//In MySQL the first day of the week is monday with index 0
+	if(chr==TeDAYOFWEEK)
+	{
+		time1 = time1-1;
+		if(time1<0)
+			time1=6;
+		time2 = time2-1;
+		if(time2<0)
+			time2=6;
+	}
+
+	return(TeDatabase::getSQLTemporalWhere(time1, time2, chr, rel, initialTime, finalTime));
+}
+		
+
+string TeMySQL::concatValues(vector<string>& values, const string& unionString)
+{
+	string concat = "CONCAT(";
+	
+	for(unsigned int i = 0; i < values.size(); ++i)
+	{
+		if(i != 0)
+		{
+			concat += ", ";
+
+			if(!unionString.empty())
+			{
+				concat += "'";
+				concat += unionString;
+				concat += "'";
+				concat += ", ";
+			}
+		}
+
+		concat += values[i];
+	}
+
+	concat += ")";
+
+	return concat;
+}
+
+string TeMySQL::toUpper(const string& value)
+{
+	string result  = "upper(";
+	       result += value;
+		   result += ")";
+
+	return result;
+}
+
diff --git a/src/terralib/drivers/MySQL/TeMySQL.h b/src/terralib/drivers/MySQL/TeMySQL.h
old mode 100755
new mode 100644
index 9bb9794..9e02950
--- a/src/terralib/drivers/MySQL/TeMySQL.h
+++ b/src/terralib/drivers/MySQL/TeMySQL.h
@@ -1,281 +1,303 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMySQL.h
-    \brief This file contains the particularities of a MySQL driver
-*/
-#ifndef  __TERRALIB_INTERNAL_MYSQL_H
-#define  __TERRALIB_INTERNAL_MYSQL_H
-
-#ifdef WIN32
-#include <winsock.h>
-#endif
-
-#include <mysql.h>
-
-#include <TeTable.h>
-#include <TeDatabase.h>
-#include <TeDatabaseFactory.h>
-
-
-//! A concrete implementation of a driver to the MySQL SGDB
-class TeMySQL : public TeDatabase
-{
-friend class TeMySQLPortal;
-
-public: 
-
-	TeMySQL();
-
-	~TeMySQL();
-
-	MYSQL*	getMySQL () 
-	{	return &mysql_;	}	
-
-	string  escapeSequence(const string& from);
-
-	bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int &port=-1, bool terralibModel=true);
-
-	bool connect (const string& host, const string& user, const string& password, const string& database, int port=-1);
-
-	bool showDatabases (const string& host, const string& user, const string& password, vector<string>& dbNames, int port=-1);
-
-	void close();
-
-	bool tableExist(const string& table);
-
-	bool columnExist(const string& table, const string& column, TeAttribute& attr);
-
-	bool addColumn (const string& table,TeAttributeRep &rep);
-
-	//! Alter a property of a table 
-	virtual bool alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName="");
-
-	bool defineIntegrity(void);
-
-	bool createRelation (const string& /* relName */, const string& /* table */, const string& /* fieldName */,
-						const string& /* relatedTable */, const string& /* relatedField */, bool /* cascadeDeletion */)
-	{ return true; }
-
-	TeDBRelationType existRelation(const string& /* tableName */, const string& /* relName */)
-
-	{	return TeNoRelation; }
-
-	bool execute ( const string &q);
-
-	bool createTable(const string& table, TeAttributeList &attr);
-
-	TeDatabasePortal* getPortal ();
-
-	string	errorMessage () 
-	{	return string(mysql_error(&mysql_));	} 
-
-	int	errorNum () 
-	{	return mysql_errno(&mysql_);	}
-	
-// specific TerraLib database access methods
-
-	bool insertProjection (TeProjection *proj);
-	bool insertLayer(TeLayer* layer);
-	bool insertProject(TeProject* project);
-	bool insertRepresentation(int layerId, TeRepresentation& rep);	
-	bool insertTable(TeTable &table);
-	bool updateTable	(TeTable &table);
-	bool insertTableInfo (int layerId, TeTable &table, const string& user="");
-	bool insertRelationInfo(const int tableId, const string& tField,
-						    const string& eTable, const string& eField, int& relId);
-	bool insertView (TeView *view);
-	bool insertViewTree (TeViewTree *tree);	
-	bool insertTheme(TeAbstractTheme *theme);
-	bool insertThemeGroup (TeViewTree* tree);
-	bool generateLabelPositions (TeTheme *theme, const std::string& objectId = "");
-	bool insertThemeTable (int themeId, int tableId, int relationId, int tableOrder);
-	bool insertLegend (TeLegendEntry *legend);
-	bool insertPolygon	(const string& table, TePolygon &p);
-	bool insertPolygonSet(const string& table, TePolygonSet &ps);
-	bool updatePolygon	(const string& table, TePolygon &p);
-	bool insertLineSet	(const string& table, TeLineSet &ls);	
-	bool insertLine (const string&  table, TeLine2D &l);
-	bool updateLine (const string& table, TeLine2D &l);
-	bool insertPoint (const string& table, TePoint &p);
-	bool insertText (const string& table, TeText &t);
-	bool insertArc (const string& table,TeArc &arc);
-	bool insertNode	(const string& table, TeNode &node);	
-	bool insertCell	(const string& table, TeCell &c);
-	int  insertId();
-	
-
-	bool insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char *buf,unsigned long size, int band=0, unsigned int res=1, unsigned int subband=0);
-
-	string getSQLTime(TeTime& time);
-	string getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, 
-						   const string& initialTime, const string& finalTime);
-
-	bool inClauseValues(const string& query, const string& attribute, vector<string>& inClauseVector);
-
-	bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size);
-	
-	//! Concat values in a vector using unionString as the join between each value
-	string concatValues(vector<string>& values, const string& unionString);
-
-	//! Returns the SQL function for upper case
-	string toUpper(const string& value);
-
-	string getConcatFieldsExpression(const vector<string>& fNamesVec);
-
-	bool beginTransaction();
-    bool commitTransaction();
-    bool rollbackTransaction();
-
-private :
-
-	MYSQL	mysql_;
-	char*   bufferBlob_;	 // internal buffer used to write blob data
-	long	bufferBlobSize_; // size of the data already allocated
-
-};
-
-//! A concrete implementation of a portal to a MySQL database
-class TeMySQLPortal  : public TeDatabasePortal
-{
-private:
-
-	MYSQL			*mysql_;
-	MYSQL_RES*		result_;
-	MYSQL_ROW		row_;
-
-public :
-
-// Constructor / Destructor
-
-	TeMySQLPortal ( TeMySQL *m);
-
-	TeMySQLPortal ( const TeMySQLPortal& p);
-
-	~TeMySQLPortal ();
-
-// Basic database methods
-
-	int  insertId();
-
-	bool query (const string &qry, TeCursorLocation l = TeSERVERSIDE, TeCursorType t = TeUNIDIRECTIONAL, TeCursorEditType e = TeREADONLY, TeCursorDataType dt = TeTEXTCURSOR );
-
-	bool fetchRow ();
-
-	bool fetchRow (int i);
-
-	void freeResult ();
-
-	string	errorMessage () 
-
-	{ return string(mysql_error(mysql_));} //: last error message()
-
-	int	errorNum () 
-
-	{ return mysql_errno(mysql_);}
-
-// specific SQL SELECT command methods
-
-	char*		getData (int i);
-	char*		getData (const string& s);
-	double		getDouble (int i);
-	double		getDouble (const string& s);
-	int			getInt (int i);
-	int			getInt (const string& s);
-	bool		getBool (const string& s);
-	bool		getBool (int i);
-
-	bool fetchGeometry(TePolygon& pol);
-	bool fetchGeometry(TeLine2D& line);
-	bool fetchGeometry(TeNode& n);
-	bool fetchGeometry(TePoint& p);
-	bool fetchGeometry(TePolygon& pol, const unsigned int& initIndex);
-	bool fetchGeometry(TeLine2D& line, const unsigned int& initIndex);
-	bool fetchGeometry(TeNode& n, const unsigned int& initIndex);
-	bool fetchGeometry(TePoint& p, const unsigned int& initIndex);
-	
-	bool setData (int /* field */, string /* val */)
-	{return true; }
-	MYSQL_RES* result()
-	{return result_; }
-
-	bool getBlob (const string& s, unsigned char* &data, long& size);
-	bool getRasterBlock(unsigned long& size, unsigned char* ptData);
-
-	TeTime getDate (int i);
-	TeTime getDate (const string& s);
-
-	string getDateAsString(int i);
-	string getDateAsString(const string& s);
-
-protected:
-	TeLinearRing getLinearRing (int &ni);
-};
-
-
-/**
- * @brief This is the class for TeMySQL driver factory.
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- * @ingroup DatabaseUtils
- */
-class TeMySQLFactory : public TeDatabaseFactory
-{
-  public :
-      
-    /**
-     * Default constructor
-     */
-    TeMySQLFactory() : TeDatabaseFactory( std::string( "MySQL" ) ) {};      
-      
-    /**
-     * Default Destructor
-     */
-    ~TeMySQLFactory() {};
-      
-  protected :  
-  
-    /**
-     * Implementation for the abstract TeFactory::build.
-     *
-     * @param arg A const reference to the parameters used by the
-     * database.
-     * @return A pointer to the new generated database instance.
-     */
-    TeDatabase* build( const TeDatabaseFactoryParams& arg )
-    {
-      TeMySQL* instance_ptr = new TeMySQL();
-      
-      if( arg.host_ != "" ) {
-        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
-          arg.database_, arg.port_ );
-      }
-  
-      return (TeDatabase*)instance_ptr;
-    }
-};
-
-namespace {
-  static TeMySQLFactory TeMySQLFactory_instance;
-}; 
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMySQL.h
+    \brief This file contains the particularities of a MySQL driver
+*/
+#ifndef  __TERRALIB_INTERNAL_MYSQL_H
+#define  __TERRALIB_INTERNAL_MYSQL_H
+
+#ifdef WIN32
+#include <winsock.h>
+#endif
+
+#include <mysql.h>
+
+#include <TeTable.h>
+#include <TeDatabase.h>
+#include <TeDatabaseFactory.h>
+
+#include <TeDatabaseIndex.h>
+
+#include "TeMySQLDefines.h"
+
+
+//! A concrete implementation of a driver to the MySQL SGDB
+class TLMYSQL_DLL TeMySQL : public TeDatabase
+{
+friend class TeMySQLPortal;
+
+public: 
+
+	TeMySQL();
+
+	~TeMySQL();
+
+	MYSQL*	getMySQL () 
+	{	return &mysql_;	}	
+
+	string  escapeSequence(const string& from);
+
+	bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int &port=-1, bool terralibModel=true, const std::string& characterSet = "");
+
+	bool connect (const string& host, const string& user, const string& password, const string& database, int port=-1);
+
+	bool showDatabases (const string& host, const string& user, const string& password, vector<string>& dbNames, int port=-1);
+
+	void close();
+
+	bool tableExist(const string& table);
+
+	bool columnExist(const string& table, const string& column, TeAttribute& attr);
+
+	bool addColumn (const string& table,TeAttributeRep &rep);
+
+	//! Delete the index from tables in the conceptual model
+	virtual bool deleteIndex(const string& tableName, const string& indexName);
+
+	//! Return a TeDatabaseIndex vector from a table
+	virtual bool getIndexesFromTable(const string& tableName, std::vector<TeDatabaseIndex>& vecIndexes);
+
+	//! Alter a property of a table 
+	virtual bool alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName="");
+
+	bool defineIntegrity(void);
+
+	bool createRelation (const string& /* relName */, const string& /* table */, const string& /* fieldName */,
+						const string& /* relatedTable */, const string& /* relatedField */, bool /* cascadeDeletion */)
+	{ return true; }
+
+	TeDBRelationType existRelation(const string& /* tableName */, const string& /* relName */)
+
+	{	return TeNoRelation; }
+
+	bool execute ( const string &q);
+
+	bool createTable(const string& table, TeAttributeList &attr);
+
+	TeDatabasePortal* getPortal ();
+
+	string	errorMessage () 
+	{	return string(mysql_error(&mysql_));	} 
+
+	int	errorNum () 
+	{	return mysql_errno(&mysql_);	}
+	
+// specific TerraLib database access methods
+
+	bool insertProjection (TeProjection *proj);
+	bool insertLayer(TeLayer* layer);
+	bool insertProject(TeProject* project);
+	bool insertRepresentation(int layerId, TeRepresentation& rep);	
+	bool insertTable(TeTable &table);
+	bool updateTable	(TeTable &table);
+	bool insertTableInfo (int layerId, TeTable &table, const string& user="");
+	bool insertRelationInfo(const int tableId, const string& tField,
+						    const string& eTable, const string& eField, int& relId);
+	bool insertView (TeView *view);
+	bool insertViewTree (TeViewTree *tree);	
+	bool insertTheme(TeAbstractTheme *theme);
+	bool insertThemeGroup (TeViewTree* tree);
+	bool generateLabelPositions (TeTheme *theme, const std::string& objectId = "");
+	bool insertThemeTable (int themeId, int tableId, int relationId, int tableOrder);
+	bool insertLegend (TeLegendEntry *legend);
+	bool insertPolygon	(const string& table, TePolygon &p);
+	bool insertPolygonSet(const string& table, TePolygonSet &ps);
+	bool updatePolygon	(const string& table, TePolygon &p);
+	bool insertLineSet	(const string& table, TeLineSet &ls);	
+	bool insertLine (const string&  table, TeLine2D &l);
+	bool updateLine (const string& table, TeLine2D &l);
+	bool insertPoint (const string& table, TePoint &p);
+	bool insertText (const string& table, TeText &t);
+	bool insertArc (const string& table,TeArc &arc);
+	bool insertNode	(const string& table, TeNode &node);	
+	bool insertCell	(const string& table, TeCell &c);
+	int  insertId();
+	
+
+	bool insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char *buf,unsigned long size, int band=0, unsigned int res=1, unsigned int subband=0);
+
+	string getSQLTime(const TeTime& time) const;
+	string getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, 
+						   const string& initialTime, const string& finalTime);
+
+	bool inClauseValues(const string& query, const string& attribute, vector<string>& inClauseVector);
+
+	bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size);
+	
+	//! Concat values in a vector using unionString as the join between each value
+	string concatValues(vector<string>& values, const string& unionString);
+
+	//! Returns the SQL function for upper case
+	string toUpper(const string& value);
+
+	string getConcatFieldsExpression(const vector<string>& fNamesVec);
+
+	bool beginTransaction();
+    bool commitTransaction();
+    bool rollbackTransaction();
+
+	//! Gets the client encoding
+	virtual std::string getClientEncoding();
+
+	//! Sets the client encoding
+	virtual bool setClientEncoding(const std::string& characterSet);
+
+	//! Retrives the list of available character sets
+	virtual bool getEncodingList(std::vector<std::string>& vecEncodingList);
+	 
+	//! Retrives the list of available character sets
+	virtual bool getEncodingList(const std::string& host, const std::string& user, const std::string& password, const int& port, std::vector<std::string>& vecEncodingList);
+
+private :
+
+	MYSQL	mysql_;
+	char*   bufferBlob_;	 // internal buffer used to write blob data
+	long	bufferBlobSize_; // size of the data already allocated
+
+};
+
+//! A concrete implementation of a portal to a MySQL database
+class TLMYSQL_DLL TeMySQLPortal  : public TeDatabasePortal
+{
+private:
+
+	MYSQL			*mysql_;
+	MYSQL_RES*		result_;
+	MYSQL_ROW		row_;
+
+public :
+
+// Constructor / Destructor
+
+	TeMySQLPortal ( TeMySQL *m);
+
+	TeMySQLPortal ( const TeMySQLPortal& p);
+
+	~TeMySQLPortal ();
+
+// Basic database methods
+
+	int  insertId();
+
+	bool query (const string &qry, TeCursorLocation l = TeSERVERSIDE, TeCursorType t = TeUNIDIRECTIONAL, TeCursorEditType e = TeREADONLY, TeCursorDataType dt = TeTEXTCURSOR );
+
+	bool fetchRow ();
+
+	bool fetchRow (int i);
+
+	void freeResult ();
+
+	string	errorMessage () 
+
+	{ return string(mysql_error(mysql_));} //: last error message()
+
+	int	errorNum () 
+
+	{ return mysql_errno(mysql_);}
+
+// specific SQL SELECT command methods
+
+	char*		getData (int i);
+	char*		getData (const string& s);
+	double		getDouble (int i);
+	double		getDouble (const string& s);
+	int			getInt (int i);
+	int			getInt (const string& s);
+	bool		getBool (const string& s);
+	bool		getBool (int i);
+
+	bool fetchGeometry(TePolygon& pol);
+	bool fetchGeometry(TeLine2D& line);
+	bool fetchGeometry(TeNode& n);
+	bool fetchGeometry(TePoint& p);
+	bool fetchGeometry(TePolygon& pol, const unsigned int& initIndex);
+	bool fetchGeometry(TeLine2D& line, const unsigned int& initIndex);
+	bool fetchGeometry(TeNode& n, const unsigned int& initIndex);
+	bool fetchGeometry(TePoint& p, const unsigned int& initIndex);
+	
+	bool setData (int /* field */, string /* val */)
+	{return true; }
+	MYSQL_RES* result()
+	{return result_; }
+
+	bool getBlob (const string& s, unsigned char* &data, long& size);
+	bool getRasterBlock(unsigned long& size, unsigned char* ptData);
+
+	TeTime getDate (int i);
+	TeTime getDate (const string& s);
+
+	string getDateAsString(int i);
+	string getDateAsString(const string& s);
+
+protected:
+	TeLinearRing getLinearRing (int &ni);
+};
+
+
+/**
+ * @brief This is the class for TeMySQL driver factory.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup DatabaseUtils
+ */
+class TLMYSQL_DLL TeMySQLFactory : public TeDatabaseFactory
+{
+  public :
+      
+    /**
+     * Default constructor
+     */
+    TeMySQLFactory() : TeDatabaseFactory( std::string( "MySQL" ) ) {};      
+      
+    /**
+     * Default Destructor
+     */
+    ~TeMySQLFactory() {};
+      
+  protected :  
+  
+    /**
+     * Implementation for the abstract TeFactory::build.
+     *
+     * @param arg A const reference to the parameters used by the
+     * database.
+     * @return A pointer to the new generated database instance.
+     */
+    TeDatabase* build( const TeDatabaseFactoryParams& arg )
+    {
+      TeMySQL* instance_ptr = new TeMySQL();
+      
+      if( arg.host_ != "" ) {
+        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
+          arg.database_, arg.port_ );
+      }
+  
+      return (TeDatabase*)instance_ptr;
+    }
+};
+
+namespace {
+  static TeMySQLFactory TeMySQLFactory_instance;
+}; 
+
+#endif
+
diff --git a/src/terralib/drivers/MySQL/TeMySQLDefines.h b/src/terralib/drivers/MySQL/TeMySQLDefines.h
new file mode 100644
index 0000000..f69d295
--- /dev/null
+++ b/src/terralib/drivers/MySQL/TeMySQLDefines.h
@@ -0,0 +1,49 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMySQLDefines.h
+    \brief Provides a set of general definitions used by te_mysql project.
+*/
+#ifndef  __TERRALIB_INTERNAL_MYSQLDEFINES_H
+#define  __TERRALIB_INTERNAL_MYSQLDEFINES_H
+
+/** @defgroup TeMYSQL_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLMYSQL_AS_DLL
+#define TLMYSQL_DLL __declspec(dllexport)
+#else
+#define TLMYSQL_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TLMYSQL_DLL
+#endif
+/** @} */ 
+
+#endif //__TERRALIB_INTERNAL_MYSQLDEFINES_H
diff --git a/src/terralib/drivers/MySQL/include/config-netware.h b/src/terralib/drivers/MySQL/include/config-netware.h
new file mode 100644
index 0000000..2729661
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/config-netware.h
@@ -0,0 +1,137 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/* Header for NetWare compatible with MySQL */
+
+#ifndef _config_netware_h
+#define _config_netware_h
+
+/* required headers */
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <screen.h>
+#include <limits.h>
+#include <signal.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <time.h>
+#include <sys/time.h>
+#include <pthread.h>
+#include <termios.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* required adjustments */
+#undef HAVE_READDIR_R
+#undef HAVE_RWLOCK_INIT
+#undef HAVE_SCHED_H
+#undef HAVE_SYS_MMAN_H
+#undef HAVE_SYNCH_H
+#undef HAVE_MMAP
+#undef HAVE_RINT
+
+#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
+#define HAVE_PTHREAD_SIGMASK 1
+#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
+#define HAVE_BROKEN_REALPATH 1
+
+/* changes made to make use of LibC-June-2004 for building purpose */
+#undef HAVE_POSIX_SIGNALS
+#undef HAVE_PTHREAD_ATTR_SETSCOPE
+#undef HAVE_ALLOC_A
+#undef HAVE_FINITE
+#undef HAVE_GETPWNAM
+#undef HAVE_GETPWUID
+#undef HAVE_PTHREAD_SETSCHEDPARAM
+#undef HAVE_READLINK
+#undef HAVE_STPCPY
+/* changes  end  */
+
+/* no libc crypt() function */
+#ifdef HAVE_OPENSSL
+  #define HAVE_CRYPT 1
+#else
+  #undef HAVE_CRYPT
+#endif /* HAVE_OPENSSL */
+
+/* Configure can't detect this because it uses AC_TRY_RUN */
+#undef HAVE_COMPRESS
+#define HAVE_COMPRESS
+
+/* include the old function apis */
+#define USE_OLD_FUNCTIONS 1
+
+/* no case sensitivity */
+#define FN_NO_CASE_SENCE 1
+
+/* the thread alarm is not used */
+#define DONT_USE_THR_ALARM 1
+
+/* signals do not interrupt sockets */
+#define SIGNALS_DONT_BREAK_READ 1
+
+/* signal by closing the sockets */
+#define SIGNAL_WITH_VIO_CLOSE 1
+
+/* On NetWare, stack grows towards lower address*/
+#define STACK_DIRECTION -1
+
+/* On NetWare, to fix the problem with the deletion of open files */
+#define CANT_DELETE_OPEN_FILES 1
+
+/* default directory information */
+#define	DEFAULT_MYSQL_HOME    "sys:/mysql"
+#define PACKAGE               "mysql"
+#define DEFAULT_BASEDIR       "sys:/"
+#define SHAREDIR              "share/"
+#define DEFAULT_CHARSET_HOME  "sys:/mysql/"
+#define DATADIR               "data/"
+
+/* 64-bit file system calls */
+#define SIZEOF_OFF_T          8
+#define off_t                 off64_t
+#define chsize                chsize64
+#define ftruncate             ftruncate64
+#define lseek                 lseek64
+#define pread                 pread64
+#define pwrite                pwrite64
+#define tell                  tell64
+
+/* do not use the extended time in LibC sys\stat.h */
+#define _POSIX_SOURCE
+
+/* Kernel call on NetWare that will only yield if our time slice is up */
+void kYieldIfTimeSliceUp(void);
+
+/* Some macros for portability */
+
+#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; }
+
+/* extra protection against CPU Hogs on NetWare */
+#define NETWARE_YIELD kYieldIfTimeSliceUp()
+/* Screen mode for help texts */
+#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _config_netware_h */
diff --git a/src/terralib/drivers/MySQL/include/config-os2.h b/src/terralib/drivers/MySQL/include/config-os2.h
new file mode 100644
index 0000000..0eef36d
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/config-os2.h
@@ -0,0 +1,835 @@
+/* Copyright (C) 2000 MySQL AB & Yuri Dario
+   All the above parties has a full, independent copyright to
+   the following code, including the right to use the code in
+   any manner without any demands from the other parties.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with this library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA */
+
+/* Defines for OS2 to make it compatible for MySQL */
+
+#ifndef __CONFIG_OS2_H__
+#define __CONFIG_OS2_H__
+
+#include <os2.h>
+#include <math.h>
+#include <io.h>
+#include <types.h>
+
+/* Define to name of system eg solaris*/
+#define SYSTEM_TYPE "IBM OS/2 Warp"
+/* Define to machine type name eg sun10 */
+#define MACHINE_TYPE "i686"
+/* Name of package */
+#define PACKAGE "mysql"
+/* Version number of package */
+#define VERSION MYSQL_SERVER_VERSION
+/* Default socket */
+#define MYSQL_UNIX_ADDR "\\socket\\MySQL"
+
+#define FN_LIBCHAR		 '\\'
+#define FN_ROOTDIR		 "\\"
+#define MY_NFILE		1024  /* This is only used to save filenames */
+
+#define HAVE_ACCESS
+
+#define DEFAULT_MYSQL_HOME	"c:\\mysql"
+#define DEFAULT_BASEDIR		"C:\\"
+#define SHAREDIR		"share"
+#define DEFAULT_CHARSET_HOME	"C:/mysql/"
+#define _POSIX_PATH_MAX		255
+#define DWORD			ULONG
+
+#define O_SHARE		0x1000		/* Open file in sharing mode */
+#define FILE_BINARY	O_BINARY	/* my_fopen in binary mode */
+#define S_IROTH		S_IREAD		/* for my_lib */
+
+#define CANT_DELETE_OPEN_FILES		/* saves open files in a list, for delayed delete */
+
+#define O_NONBLOCK	0x10
+
+#define NO_OPEN_3			/* For my_create() */
+#define SIGQUIT		SIGTERM		/* No SIGQUIT */
+#define SIGALRM		14		/* Alarm */
+
+#define NO_FCNTL_NONBLOCK
+
+#define EFBIG			   E2BIG
+/*#define ENFILE		  EMFILE    */
+/*#define ENAMETOOLONG		(EOS2ERR+2) */
+/*#define ETIMEDOUT		  145       */
+/*#define EPIPE			  146       */
+#define EROFS			147
+
+#define sleep(A)	DosSleep((A)*1000)
+#define closesocket(A)	soclose(A)
+
+#define F_OK		0
+#define W_OK		2
+
+#define bzero(x,y)	memset((x),'\0',(y))
+#define bcopy(x,y,z)	memcpy((y),(x),(z))
+#define bcmp(x,y,z)	memcmp((y),(x),(z))
+
+#define F_RDLCK		4	    /* Read lock.  */
+#define F_WRLCK		2	    /* Write lock.  */
+#define F_UNLCK		0	    /* Remove lock.  */
+
+#define S_IFMT		0x17000	    /* Mask for file type */
+#define F_TO_EOF	0L	    /* Param to lockf() to lock rest of file */
+
+#define HUGE_PTR
+
+#ifdef __cplusplus
+extern "C"
+#endif
+double _cdecl rint( double nr);
+
+DWORD	 TlsAlloc( void);
+BOOL	 TlsFree( DWORD);
+PVOID	 TlsGetValue( DWORD);
+BOOL	 TlsSetValue( DWORD, PVOID);
+
+/* support for > 2GB file size */
+#define SIZEOF_OFF_T	8
+#define lseek(A,B,C)	_lseek64( A, B, C)
+#define tell(A)		_lseek64( A, 0, SEEK_CUR)
+
+void* dlopen( char* path, int flag);
+char* dlerror( void);
+void* dlsym( void* hmod, char* fn);
+void  dlclose( void* hmod);
+
+/* Some typedefs */
+typedef unsigned long long os_off_t;
+
+/* config.h.  Generated automatically by configure.  */
+/* config.h.in.  Generated automatically from configure.in by autoheader.  */
+
+/* Define if using alloca.c.  */
+/* #undef C_ALLOCA */
+
+/* Define to empty if the keyword does not work.  */
+/* #undef const */
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+   This function is required for alloca.c support on those systems.  */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define if you have alloca, as a function or macro.  */
+#define HAVE_ALLOCA 1
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
+/* #define HAVE_ALLOCA_H 1 */
+
+/* Define if you don't have vprintf but do have _doprnt.  */
+/* #undef HAVE_DOPRNT */
+
+/* Define if you have a working `mmap' system call.  */
+/* #undef HAVE_MMAP */
+
+/* Define if system calls automatically restart after interruption
+   by a signal.  */
+/* #undef HAVE_RESTARTABLE_SYSCALLS */
+
+/* Define if your struct stat has st_rdev.  */
+#define HAVE_ST_RDEV 1
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible.	*/
+/* #define HAVE_SYS_WAIT_H 1 */
+
+/* Define if you don't have tm_zone but do have the external array
+   tzname.  */
+#define HAVE_TZNAME 1
+
+/* Define if utime(file, NULL) sets file's timestamp to the present.  */
+#define HAVE_UTIME_NULL 1
+
+/* Define if you have the vprintf function.  */
+#define HAVE_VPRINTF 1
+
+/* Define as __inline if that's what the C compiler calls it.  */
+/* #undef inline */
+
+/* Define to `long' if <sys/types.h> doesn't define.  */
+/* #undef off_t */
+
+/* Define as the return type of signal handlers (int or void).	*/
+#define RETSIGTYPE void
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+/* #undef size_t */
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#define STACK_DIRECTION -1
+
+/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly.  */
+/* #undef STAT_MACROS_BROKEN */
+
+/* Define if you have the ANSI C header files.	*/
+#define STDC_HEADERS 1
+
+/* Define if you can safely include both <sys/time.h> and <time.h>.  */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define if your <sys/time.h> declares struct tm.  */
+/* #undef TM_IN_SYS_TIME */
+
+/* Define if your processor stores words with the most significant
+   byte first (like Motorola and SPARC, unlike Intel and VAX).	*/
+/* #undef WORDS_BIGENDIAN */
+
+/* Version of .frm files */
+#define DOT_FRM_VERSION 6
+
+/* READLINE: */
+#define FIONREAD_IN_SYS_IOCTL 1
+
+/* READLINE: Define if your system defines TIOCGWINSZ in sys/ioctl.h.  */
+/* #undef GWINSZ_IN_SYS_IOCTL */
+
+/* Do we have FIONREAD */
+#define FIONREAD_IN_SYS_IOCTL 1
+
+/* atomic_add() from <asm/atomic.h> (Linux only) */
+/* #undef HAVE_ATOMIC_ADD */
+
+/* atomic_sub() from <asm/atomic.h> (Linux only) */
+/* #undef HAVE_ATOMIC_SUB */
+
+/* bool is not defined by all C++ compilators */
+#define HAVE_BOOL 1
+
+/* Have berkeley db installed */
+/* #define HAVE_BERKELEY_DB 1 */
+
+/* DSB style signals ? */
+/* #undef HAVE_BSD_SIGNALS */
+
+/* Can netinet be included */
+/* #undef HAVE_BROKEN_NETINET_INCLUDES */
+
+/* READLINE: */
+/* #undef HAVE_BSD_SIGNALS */
+
+/* ZLIB and compress: */
+#define HAVE_COMPRESS 1
+
+/* Define if we are using OSF1 DEC threads */
+/* #undef HAVE_DEC_THREADS */
+
+/* Define if we are using OSF1 DEC threads on 3.2 */
+/* #undef HAVE_DEC_3_2_THREADS */
+
+/* fp_except from ieeefp.h */
+/* #undef HAVE_FP_EXCEPT */
+
+/* READLINE: */
+/* #undef HAVE_GETPW_DECLS */
+
+/* Solaris define gethostbyname_r with 5 arguments. glibc2 defines
+   this with 6 arguments */
+/* #undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE */
+
+/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */
+/* #undef HAVE_GETHOSTBYNAME_R_RETURN_INT */
+
+/* Define if int8, int16 and int32 types exist */
+/* #undef HAVE_INT_8_16_32 */
+
+/* Define if have -lwrap */
+/* #undef HAVE_LIBWRAP */
+
+/* Define if we are using Xavier Leroy's LinuxThreads */
+/* #undef HAVE_LINUXTHREADS */
+
+/* Do we use user level threads */
+/* #undef HAVE_mit_thread */
+
+/* For some non posix threads */
+/* #undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC */
+
+/* For some non posix threads */
+/* #undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */
+
+/* READLINE: */
+#define HAVE_POSIX_SIGNALS 0
+
+/* sigwait with one argument */
+/* #undef HAVE_NONPOSIX_SIGWAIT */
+
+/* pthread_attr_setscope */
+#define HAVE_PTHREAD_ATTR_SETSCOPE 1
+
+/* POSIX readdir_r */
+/* #undef HAVE_READDIR_R */
+
+/* POSIX sigwait */
+/* #undef HAVE_SIGWAIT */
+
+/* crypt */
+#define HAVE_CRYPT 1
+
+/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines
+   this with 8 arguments */
+/* #undef HAVE_SOLARIS_STYLE_GETHOST */
+
+/* Timespec has a ts_sec instead of tv_sev  */
+#define HAVE_TIMESPEC_TS_SEC 1
+
+/* Have the tzname variable */
+#define HAVE_TZNAME 1
+
+/* Define if the system files define uchar */
+/* #undef HAVE_UCHAR */
+
+/* Define if the system files define uint */
+/* #undef HAVE_UINT */
+
+/* Define if the system files define ulong */
+/* #undef HAVE_ULONG */
+
+/* UNIXWARE7 threads are not posix */
+/* #undef HAVE_UNIXWARE7_THREADS */
+
+/* new UNIXWARE7 threads that are not yet posix */
+/* #undef HAVE_UNIXWARE7_POSIX */
+
+/* READLINE: */
+/* #undef HAVE_USG_SIGHOLD */
+
+/* Define if want -lwrap */
+/* #undef LIBWRAP */
+
+/* mysql client protocoll version */
+#define PROTOCOL_VERSION 10
+
+/* Define if qsort returns void */
+#define QSORT_TYPE_IS_VOID 1
+
+/* Define as the return type of qsort (int or void). */
+#define RETQSORTTYPE void
+
+/* Define as the base type of the last arg to accept */
+#define SOCKET_SIZE_TYPE int
+
+/* Last argument to get/setsockopt */
+/* #undef SOCKOPT_OPTLEN_TYPE */
+
+/* #undef SPEED_T_IN_SYS_TYPES */
+/* #undef SPRINTF_RETURNS_PTR */
+#define SPRINTF_RETURNS_INT 1
+/* #undef SPRINTF_RETURNS_GARBAGE */
+
+/* #undef STRUCT_DIRENT_HAS_D_FILENO */
+#define STRUCT_DIRENT_HAS_D_INO 1
+
+/* Define if you want to have threaded code. This may be undef on client code */
+#define THREAD 1
+
+/* Should be client be thread safe */
+/* #undef THREAD_SAFE_CLIENT */
+
+/* READLINE: */
+/* #undef TIOCSTAT_IN_SYS_IOCTL */
+
+/* Use multi-byte character routines */
+/* #undef USE_MB */
+/* #undef USE_MB_IDENT */
+
+/* Use MySQL RAID */
+/* #undef USE_RAID */
+
+/* Use strcoll() functions when comparing and sorting. */
+/* #undef USE_STRCOLL */
+
+/* READLINE: */
+#define VOID_SIGHANDLER 1
+
+/* The number of bytes in a char.  */
+#define SIZEOF_CHAR 1
+
+/* The number of bytes in a int.  */
+#define SIZEOF_INT 4
+
+/* The number of bytes in a long.  */
+#define SIZEOF_LONG 4
+
+/* The number of bytes in a long long.	*/
+#define SIZEOF_LONG_LONG 8
+
+/* Define if you have the alarm function.  */
+#define HAVE_ALARM 1
+
+/* Define if you have the atod function.  */
+/* #undef HAVE_ATOD */
+
+/* Define if you have the bcmp function.  */
+#define HAVE_BCMP 1
+
+/* Define if you have the bfill function.  */
+/* #undef HAVE_BFILL */
+
+/* Define if you have the bmove function.  */
+/* #undef HAVE_BMOVE */
+
+/* Define if you have the bzero function.  */
+#define HAVE_BZERO 1
+
+/* Define if you have the chsize function.  */
+#define HAVE_CHSIZE 1
+
+/* Define if you have the cuserid function.  */
+/* #define HAVE_CUSERID 1 */
+
+/* Define if you have the dlerror function.  */
+#define HAVE_DLERROR 1
+
+/* Define if you have the dlopen function.  */
+#define HAVE_DLOPEN 1
+
+/* Define if you have the fchmod function.  */
+/* #undef HAVE_FCHMOD */
+
+/* Define if you have the fcntl function.  */
+/* #define HAVE_FCNTL 1 */
+
+/* Define if you have the fconvert function.  */
+/* #undef HAVE_FCONVERT */
+
+/* Define if you have the finite function.  */
+/* #undef HAVE_FINITE */
+
+/* Define if you have the fpresetsticky function.  */
+/* #undef HAVE_FPRESETSTICKY */
+
+/* Define if you have the fpsetmask function.  */
+/* #undef HAVE_FPSETMASK */
+
+/* Define if you have the fseeko function.  */
+/* #undef HAVE_FSEEKO */
+
+/* Define if you have the ftruncate function.  */
+/* #define HAVE_FTRUNCATE 1 */
+
+/* Define if you have the getcwd function.  */
+#define HAVE_GETCWD 1
+
+/* Define if you have the gethostbyaddr_r function.  */
+/* #undef HAVE_GETHOSTBYADDR_R */
+
+/* Define if you have the gethostbyname_r function.  */
+/* #undef HAVE_GETHOSTBYNAME_R */
+
+/* Define if you have the getpagesize function.  */
+#define HAVE_GETPAGESIZE 1
+
+/* Define if you have the getpass function.  */
+/*#define HAVE_GETPASS 1 */
+
+/* Define if you have the getpassphrase function.  */
+/* #undef HAVE_GETPASSPHRASE */
+
+/* Define if you have the getpwnam function.  */
+/* #define HAVE_GETPWNAM 1 */
+
+/* Define if you have the getpwuid function.  */
+/* #define HAVE_GETPWUID 1 */
+
+/* Define if you have the getrlimit function.  */
+/* #undef HAVE_GETRLIMIT */
+
+/* Define if you have the getrusage function.  */
+/* #undef HAVE_GETRUSAGE */
+
+/* Define if you have the getwd function.  */
+#define HAVE_GETWD 1
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#define HAVE_GMTIME_R 1
+
+/* Define if you have the index function.  */
+#define HAVE_INDEX 1
+
+/* Define if you have the initgroups function.	*/
+/* #undef HAVE_INITGROUPS */
+
+/* Define if you have the localtime_r function.  */
+#define HAVE_LOCALTIME_R 1
+
+/* Define if you have the locking function.  */
+/* #undef HAVE_LOCKING */
+
+/* Define if you have the longjmp function.  */
+#define HAVE_LONGJMP 1
+
+/* Define if you have the lrand48 function.  */
+/* #undef HAVE_LRAND48 */
+
+/* Define if you have the lstat function.  */
+/* #undef HAVE_LSTAT */
+
+/* Define if you have the madvise function.  */
+/* #undef HAVE_MADVISE */
+
+/* Define if you have the memcpy function.  */
+#define HAVE_MEMCPY 1
+
+/* Define if you have the memmove function.  */
+#define HAVE_MEMMOVE 1
+
+/* Define if you have the mkstemp function.  */
+/* #define HAVE_MKSTEMP 1 */
+
+/* Define if you have the mlockall function.  */
+/* #undef HAVE_MLOCKALL */
+
+/* Define if you have the perror function.  */
+#define HAVE_PERROR 1
+
+/* Define if you have the poll function.  */
+/* #undef HAVE_POLL */
+
+/* Define if you have the pread function.  */
+/* #undef HAVE_PREAD */
+
+/* Define if you have the pthread_attr_create function.  */
+/* #undef HAVE_PTHREAD_ATTR_CREATE */
+
+/* Define if you have the pthread_attr_setprio function.  */
+#define HAVE_PTHREAD_ATTR_SETPRIO 1
+
+/* Define if you have the pthread_attr_setschedparam function.	*/
+/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */
+
+/* Define if you have the pthread_attr_setstacksize function.  */
+#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
+
+/* Define if you have the pthread_condattr_create function.  */
+/* #undef HAVE_PTHREAD_CONDATTR_CREATE */
+
+/* Define if you have the pthread_getsequence_np function.  */
+/* #undef HAVE_PTHREAD_GETSEQUENCE_NP */
+
+/* Define if you have the pthread_init function.  */
+/* #undef HAVE_PTHREAD_INIT */
+
+/* Define if you have the pthread_rwlock_rdlock function.  */
+/* #undef HAVE_PTHREAD_RWLOCK_RDLOCK */
+
+/* Define if you have the pthread_setprio function.  */
+#define HAVE_PTHREAD_SETPRIO 1
+
+/* Define if you have the pthread_setprio_np function.	*/
+/* #undef HAVE_PTHREAD_SETPRIO_NP */
+
+/* Define if you have the pthread_setschedparam function.  */
+/* #undef HAVE_PTHREAD_SETSCHEDPARAM */
+
+/* Define if you have the pthread_sigmask function.  */
+#define HAVE_PTHREAD_SIGMASK 1
+
+/* Define if you have the putenv function.  */
+#define HAVE_PUTENV 1
+
+/* Define if you have the readlink function.  */
+/* #undef HAVE_READLINK */
+
+/* Define if you have the realpath function.  */
+/* #undef HAVE_REALPATH */
+
+/* Define if you have the rename function.  */
+#define HAVE_RENAME 1
+
+/* Define if you have the rint function.  */
+#define HAVE_RINT 1
+
+/* Define if you have the rwlock_init function.  */
+/* #undef HAVE_RWLOCK_INIT */
+
+/* Define if you have the select function.  */
+#define HAVE_SELECT 1
+
+/* Define if you have the setenv function.  */
+/* #undef HAVE_SETENV */
+
+/* Define if you have the setlocale function.  */
+#define HAVE_SETLOCALE 1
+
+/* Define if you have the setupterm function.  */
+/* #undef HAVE_SETUPTERM */
+
+/* Define if you have the sighold function.  */
+/* #undef HAVE_SIGHOLD */
+
+/* Define if you have the sigset function.  */
+/* #undef HAVE_SIGSET */
+
+/* Define if you have the sigthreadmask function.  */
+/* #undef HAVE_SIGTHREADMASK */
+
+/* Define if you have the snprintf function.  */
+/* #define HAVE_SNPRINTF 1 */
+
+/* Define if you have the socket function.  */
+#define HAVE_SOCKET 1
+
+/* Define if you have the stpcpy function.  */
+/* #undef HAVE_STPCPY */
+
+/* Define if you have the strcasecmp function.	*/
+/* #undef HAVE_STRCASECMP */
+
+/* Define if you have the strcoll function.  */
+#define HAVE_STRCOLL 1
+
+/* Define if you have the strerror function.  */
+#define HAVE_STRERROR 1
+
+/* Define if you have the strnlen function.  */
+/* #undef HAVE_STRNLEN */
+
+/* Define if you have the strpbrk function.  */
+#define HAVE_STRPBRK 1
+
+/* Define if you have the strstr function.  */
+#define HAVE_STRSTR 1
+
+/* Define if you have the strtok_r function.  */
+/* #undef HAVE_STRTOK_R */
+
+/* Define if you have the strtol function.  */
+#define HAVE_STRTOL 1
+
+/* Define if you have the strtoul function.  */
+#define HAVE_STRTOUL 1
+
+/* Define if you have the strtoull function.  */
+/* #undef HAVE_STRTOULL */
+
+/* Define if you have the tcgetattr function.  */
+#define HAVE_TCGETATTR 1
+
+/* Define if you have the tell function.  */
+#define HAVE_TELL 1
+
+/* Define if you have the tempnam function.  */
+#define HAVE_TEMPNAM 1
+
+/* Define if you have the thr_setconcurrency function.	*/
+/* #undef HAVE_THR_SETCONCURRENCY */
+
+/* Define if you have the vidattr function.  */
+/* #undef HAVE_VIDATTR */
+
+/* Define if you have the <alloca.h> header file.  */
+/* #define HAVE_ALLOCA_H 1 */
+
+/* Define if you have the <arpa/inet.h> header file.  */
+#define HAVE_ARPA_INET_H 1
+
+/* Define if you have the <asm/termbits.h> header file.  */
+/* #undef HAVE_ASM_TERMBITS_H */
+
+/* Define if you have the <crypt.h> header file.  */
+#define HAVE_CRYPT_H 1
+
+/* Define if you have the <curses.h> header file.  */
+/* #define HAVE_CURSES_H 1 */
+
+/* Define if you have the <dirent.h> header file.  */
+/* #define HAVE_DIRENT_H 1 */
+
+/* Define if you have the <fcntl.h> header file.  */
+#define HAVE_FCNTL_H 1
+
+/* Define if you have the <float.h> header file.  */
+#define HAVE_FLOAT_H 1
+
+/* Define if you have the <floatingpoint.h> header file.  */
+/* #undef HAVE_FLOATINGPOINT_H */
+
+/* Define if you have the <grp.h> header file.	*/
+/* #define HAVE_GRP_H 1 */
+
+/* Define if you have the <ieeefp.h> header file.  */
+/* #undef HAVE_IEEEFP_H */
+
+/* Define if you have the <limits.h> header file.  */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <locale.h> header file.  */
+#define HAVE_LOCALE_H 1
+
+/* Define if you have the <memory.h> header file.  */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the <ndir.h> header file.  */
+/* #undef HAVE_NDIR_H */
+
+/* Define if you have the <netinet/in.h> header file.  */
+#define HAVE_NETINET_IN_H 1
+
+/* Define if you have the <paths.h> header file.  */
+/* #undef HAVE_PATHS_H */
+
+/* Define if you have the <pwd.h> header file.	*/
+/* #define HAVE_PWD_H 1 */
+
+/* Define if you have the <sched.h> header file.  */
+/* #undef HAVE_SCHED_H */
+
+/* Define if you have the <select.h> header file.  */
+/* #undef HAVE_SELECT_H */
+
+/* Define if you have the <stdarg.h> header file.  */
+#define HAVE_STDARG_H 1
+
+/* Define if you have the <stddef.h> header file.  */
+#define HAVE_STDDEF_H 1
+
+/* Define if you have the <stdlib.h> header file.  */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the <string.h> header file.  */
+#define HAVE_STRING_H 1
+
+/* Define if you have the <strings.h> header file.  */
+/* #define HAVE_STRINGS_H 1 */
+
+/* Define if you have the <synch.h> header file.  */
+/* #undef HAVE_SYNCH_H */
+
+/* Define if you have the <sys/dir.h> header file.  */
+/* #define HAVE_SYS_DIR_H 1 */
+
+/* Define if you have the <sys/file.h> header file.  */
+/* #define HAVE_SYS_FILE_H 1 */
+
+/* Define if you have the <sys/ioctl.h> header file.  */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define if you have the <sys/mman.h> header file.  */
+/* #undef HAVE_SYS_MMAN_H */
+
+/* Define if you have the <sys/ndir.h> header file.  */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define if you have the <sys/pte.h> header file.  */
+/* #undef HAVE_SYS_PTE_H */
+
+/* Define if you have the <sys/ptem.h> header file.  */
+/* #undef HAVE_SYS_PTEM_H */
+
+/* Define if you have the <sys/select.h> header file.  */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define if you have the <sys/socket.h> header file.  */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define if you have the <sys/stream.h> header file.  */
+/* #undef HAVE_SYS_STREAM_H */
+
+/* Define if you have the <sys/timeb.h> header file.  */
+#define HAVE_SYS_TIMEB_H 1
+
+/* Define if you have the <sys/types.h> header file.  */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define if you have the <sys/un.h> header file.  */
+#define HAVE_SYS_UN_H 1
+
+/* Define if you have the <sys/utime.h> header file.  */
+#define HAVE_SYS_UTIME_H 1
+
+/* Define if you have the <sys/vadvise.h> header file.	*/
+/* #undef HAVE_SYS_VADVISE_H */
+
+/* Define if you have the <sys/wait.h> header file.  */
+/* #define HAVE_SYS_WAIT_H 1 */
+
+/* Define if you have the <term.h> header file.  */
+/* #undef HAVE_TERM_H */
+
+/* Define if you have the <termbits.h> header file.  */
+/* #undef HAVE_TERMBITS_H */
+
+/* Define if you have the <termcap.h> header file.  */
+/* #define HAVE_TERMCAP_H 1 */
+
+/* Define if you have the <termio.h> header file.  */
+/* /#define HAVE_TERMIO_H 1 */
+
+/* Define if you have the <termios.h> header file.  */
+/* #define HAVE_TERMIOS_H 1 */
+
+/* Define if you have the <unistd.h> header file.  */
+#define HAVE_UNISTD_H 1
+
+/* Define if you have the <utime.h> header file.  */
+#define HAVE_UTIME_H 1
+
+/* Define if you have the <varargs.h> header file.  */
+#define HAVE_VARARGS_H 1
+
+/* Define if you have the bind library (-lbind).  */
+/* #undef HAVE_LIBBIND */
+
+/* Define if you have the c_r library (-lc_r).	*/
+/* #undef HAVE_LIBC_R */
+
+/* Define if you have the compat library (-lcompat).  */
+/* #undef HAVE_LIBCOMPAT */
+
+/* Define if you have the crypt library (-lcrypt).  */
+#define HAVE_LIBCRYPT 1
+
+/* Define if you have the dl library (-ldl).  */
+#define HAVE_LIBDL 1
+
+/* Define if you have the gen library (-lgen).	*/
+/* #undef HAVE_LIBGEN */
+
+/* Define if you have the m library (-lm).  */
+#define HAVE_LIBM 1
+
+/* Define if you have the nsl library (-lnsl).	*/
+/* #undef HAVE_LIBNSL */
+
+/* Define if you have the nsl_r library (-lnsl_r).  */
+/* #undef HAVE_LIBNSL_R */
+
+/* Define if you have the pthread library (-lpthread).	*/
+/* #undef HAVE_LIBPTHREAD */
+
+/* Define if you have the socket library (-lsocket).  */
+/* #undef HAVE_LIBSOCKET */
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define to make fseeko etc. visible, on some hosts. */
+/* #undef _LARGEFILE_SOURCE */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+#endif /* __CONFIG_OS2_H__ */
diff --git a/src/terralib/drivers/MySQL/include/config-win.h b/src/terralib/drivers/MySQL/include/config-win.h
new file mode 100644
index 0000000..8b7a528
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/config-win.h
@@ -0,0 +1,436 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/* Defines for Win32 to make it compatible for MySQL */
+
+#ifdef __WIN2000__
+/* We have to do this define before including windows.h to get the AWE API
+functions */
+#define _WIN32_WINNT     0x0500
+#endif
+
+#include <sys/locking.h>
+#include <windows.h>
+#include <math.h>			/* Because of rint() */
+#include <fcntl.h>
+#include <io.h>
+#include <malloc.h>
+
+#define HAVE_SMEM 1
+
+#if defined(_WIN64) || defined(WIN64) 
+#define SYSTEM_TYPE	"Win64" 
+#elif defined(_WIN32) || defined(WIN32) 
+#define SYSTEM_TYPE	"Win32" 
+#else
+#define SYSTEM_TYPE	"Windows"
+#endif
+
+#if defined(_M_IA64) 
+#define MACHINE_TYPE	"ia64" 
+#elif defined(_M_IX86) 
+#define MACHINE_TYPE	"ia32" 
+#elif defined(_M_ALPHA) 
+#define MACHINE_TYPE	"axp" 
+#else
+#define MACHINE_TYPE	"unknown"	/* Define to machine type name */
+#endif 
+ 
+#if !(defined(_WIN64) || defined(WIN64)) 
+#ifndef _WIN32
+#define _WIN32				/* Compatible with old source */
+#endif
+#ifndef __WIN32__
+#define __WIN32__
+#endif
+#endif /* _WIN64 */
+#ifndef __WIN__
+#define __WIN__			      /* To make it easier in VC++ */
+#endif
+
+/* File and lock constants */
+#define O_SHARE		0x1000		/* Open file in sharing mode */
+#ifdef __BORLANDC__
+#define F_RDLCK		LK_NBLCK	/* read lock */
+#define F_WRLCK		LK_NBRLCK	/* write lock */
+#define F_UNLCK		LK_UNLCK	/* remove lock(s) */
+#else
+#define F_RDLCK		_LK_NBLCK	/* read lock */
+#define F_WRLCK		_LK_NBRLCK	/* write lock */
+#define F_UNLCK		_LK_UNLCK	/* remove lock(s) */
+#endif
+
+#define F_EXCLUSIVE	1		/* We have only exclusive locking */
+#define F_TO_EOF	(INT_MAX32/2)	/* size for lock of all file */
+#define F_OK		0		/* parameter to access() */
+#define W_OK		2
+
+#define S_IROTH		S_IREAD		/* for my_lib */
+
+#ifdef __BORLANDC__
+#define FILE_BINARY	O_BINARY	/* my_fopen in binary mode */
+#define O_TEMPORARY	0
+#define O_SHORT_LIVED	0
+#define SH_DENYNO	_SH_DENYNO
+#else
+#define O_BINARY	_O_BINARY	/* compability with MSDOS */
+#define FILE_BINARY	_O_BINARY	/* my_fopen in binary mode */
+#define O_TEMPORARY	_O_TEMPORARY
+#define O_SHORT_LIVED	_O_SHORT_LIVED
+#define SH_DENYNO	_SH_DENYNO
+#endif
+#define NO_OPEN_3			/* For my_create() */
+
+#define SIGQUIT		SIGTERM		/* No SIGQUIT */
+
+#undef _REENTRANT			/* Crashes something for win32 */
+#undef SAFE_MUTEX			/* Can't be used on windows */
+
+#define LONGLONG_MIN	((__int64) 0x8000000000000000)
+#define LONGLONG_MAX	((__int64) 0x7FFFFFFFFFFFFFFF)
+#define ULONGLONG_MAX	((unsigned __int64) 0xFFFFFFFFFFFFFFFF)
+#define LL(A)		((__int64) A)
+#define ULL(A)		((unsigned __int64) A)
+
+/* Type information */
+
+#if defined(__EMX__) || !defined(HAVE_UINT)
+#undef HAVE_UINT
+#define HAVE_UINT
+typedef unsigned short	ushort;
+typedef unsigned int	uint;
+#endif /* defined(__EMX__) || !defined(HAVE_UINT) */
+
+typedef unsigned __int64 ulonglong;	/* Microsofts 64 bit types */
+typedef __int64 longlong;
+#ifndef HAVE_SIGSET_T
+typedef int sigset_t;
+#endif
+#define longlong_defined
+/*
+  off_t should not be __int64 because of conflicts in header files;
+  Use my_off_t or os_off_t instead
+*/
+#ifndef HAVE_OFF_T
+typedef long off_t;
+#endif
+typedef __int64 os_off_t;
+#ifdef _WIN64
+typedef UINT_PTR rf_SetTimer;
+#else
+#ifndef HAVE_SIZE_T
+typedef unsigned int size_t;
+#endif
+typedef uint rf_SetTimer;
+#endif
+
+#define Socket_defined
+#define my_socket SOCKET
+#define bool BOOL
+#define SIGPIPE SIGINT
+#define RETQSORTTYPE void
+#define QSORT_TYPE_IS_VOID
+#define RETSIGTYPE void
+#define SOCKET_SIZE_TYPE int
+#define my_socket_defined
+#define bool_defined
+#define byte_defined
+#define HUGE_PTR
+#define STDCALL __stdcall	    /* Used by libmysql.dll */
+#define isnan(X) _isnan(X)
+#define finite(X) _finite(X)
+
+#ifndef UNDEF_THREAD_HACK
+#define THREAD
+#endif
+#define VOID_SIGHANDLER
+#define SIZEOF_CHAR		1
+#define SIZEOF_LONG		4
+#define SIZEOF_LONG_LONG	8
+#define SIZEOF_OFF_T		8
+#ifdef _WIN64
+#define SIZEOF_CHARP		8
+#else
+#define SIZEOF_CHARP		4
+#endif
+#define HAVE_BROKEN_NETINET_INCLUDES
+#ifdef __NT__
+#define HAVE_NAMED_PIPE			/* We can only create pipes on NT */
+#endif
+
+/* ERROR is defined in wingdi.h */
+#undef ERROR
+
+/* We need to close files to break connections on shutdown */
+#ifndef SIGNAL_WITH_VIO_CLOSE
+#define SIGNAL_WITH_VIO_CLOSE
+#endif
+
+/* Use all character sets in MySQL */
+#define USE_MB 1
+#define USE_MB_IDENT 1
+#define USE_STRCOLL 1
+
+/* All windows servers should support .sym files */
+#undef USE_SYMDIR
+#define USE_SYMDIR
+
+/* If LOAD DATA LOCAL INFILE should be enabled by default */
+#define ENABLED_LOCAL_INFILE 1
+
+/* Convert some simple functions to Posix */
+
+#define my_sigset(A,B) signal((A),(B))
+#define finite(A) _finite(A)
+#define sleep(A)  Sleep((A)*1000)
+#define popen(A) popen(A,B) _popen((A),(B))
+#define pclose(A) _pclose(A)
+
+#ifndef __BORLANDC__
+#define access(A,B) _access(A,B)
+#endif
+
+#if !defined(__cplusplus)
+#define inline __inline
+#endif /* __cplusplus */
+
+inline double rint(double nr)
+{
+  double f = floor(nr);
+  double c = ceil(nr);
+  return (((c-nr) >= (nr-f)) ? f :c);
+}
+
+#ifdef _WIN64
+#define ulonglong2double(A) ((double) (ulonglong) (A))
+#define my_off_t2double(A)  ((double) (my_off_t) (A))
+
+#else
+inline double ulonglong2double(ulonglong value)
+{
+  longlong nr=(longlong) value;
+  if (nr >= 0)
+    return (double) nr;
+  return (18446744073709551616.0 + (double) nr);
+}
+#define my_off_t2double(A) ulonglong2double(A)
+#endif /* _WIN64 */
+
+#if SIZEOF_OFF_T > 4
+#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
+#define tell(A) _telli64(A)
+#endif
+
+#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; }
+
+#define STACK_DIRECTION -1
+
+/* Optimized store functions for Intel x86 */
+
+#ifndef _WIN64
+#define sint2korr(A)	(*((int16 *) (A)))
+#define sint3korr(A)	((int32) ((((uchar) (A)[2]) & 128) ? \
+				  (((uint32) 255L << 24) | \
+				   (((uint32) (uchar) (A)[2]) << 16) |\
+				   (((uint32) (uchar) (A)[1]) << 8) | \
+				   ((uint32) (uchar) (A)[0])) : \
+				  (((uint32) (uchar) (A)[2]) << 16) |\
+				  (((uint32) (uchar) (A)[1]) << 8) | \
+				  ((uint32) (uchar) (A)[0])))
+#define sint4korr(A)	(*((long *) (A)))
+#define uint2korr(A)	(*((uint16 *) (A)))
+/*
+   ATTENTION !
+   
+    Please, note, uint3korr reads 4 bytes (not 3) !
+    It means, that you have to provide enough allocated space !
+*/
+#define uint3korr(A)	(long) (*((unsigned int *) (A)) & 0xFFFFFF)
+#define uint4korr(A)	(*((unsigned long *) (A)))
+#define uint5korr(A)	((ulonglong)(((uint32) ((uchar) (A)[0])) +\
+				    (((uint32) ((uchar) (A)[1])) << 8) +\
+				    (((uint32) ((uchar) (A)[2])) << 16) +\
+				    (((uint32) ((uchar) (A)[3])) << 24)) +\
+				    (((ulonglong) ((uchar) (A)[4])) << 32))
+#define uint8korr(A)	(*((ulonglong *) (A)))
+#define sint8korr(A)	(*((longlong *) (A)))
+#define int2store(T,A)	*((uint16*) (T))= (uint16) (A)
+#define int3store(T,A)		{ *(T)=  (uchar) ((A));\
+				  *(T+1)=(uchar) (((uint) (A) >> 8));\
+				  *(T+2)=(uchar) (((A) >> 16)); }
+#define int4store(T,A)	*((long *) (T))= (long) (A)
+#define int5store(T,A)	{ *(T)= (uchar)((A));\
+			  *((T)+1)=(uchar) (((A) >> 8));\
+			  *((T)+2)=(uchar) (((A) >> 16));\
+			  *((T)+3)=(uchar) (((A) >> 24)); \
+			  *((T)+4)=(uchar) (((A) >> 32)); }
+#define int8store(T,A)	*((ulonglong *) (T))= (ulonglong) (A)
+
+#define doubleget(V,M)	{ *((long *) &V) = *((long*) M); \
+			  *(((long *) &V)+1) = *(((long*) M)+1); }
+#define doublestore(T,V) { *((long *) T) = *((long*) &V); \
+			   *(((long *) T)+1) = *(((long*) &V)+1); }
+#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
+#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float))
+#define floatget(V,M)   memcpy((byte*)(&V), (byte*)(M), sizeof(float))
+#define float8get(V,M) doubleget((V),(M))
+#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
+#define float8store(V,M) doublestore((V),(M))
+#endif /* _WIN64 */
+
+#define HAVE_PERROR
+#define HAVE_VFPRINT
+#define HAVE_RENAME		/* Have rename() as function */
+#define HAVE_BINARY_STREAMS	/* Have "b" flag in streams */
+#define HAVE_LONG_JMP		/* Have long jump function */
+#define HAVE_LOCKING		/* have locking() call */
+#define HAVE_ERRNO_AS_DEFINE	/* errno is a define */
+#define HAVE_STDLIB		/* everything is include in this file */
+#define HAVE_MEMCPY
+#define HAVE_MEMMOVE
+#define HAVE_GETCWD
+#define HAVE_TELL
+#define HAVE_TZNAME
+#define HAVE_PUTENV
+#define HAVE_SELECT
+#define HAVE_SETLOCALE
+#define HAVE_SOCKET		/* Giangi */
+#define HAVE_FLOAT_H
+#define HAVE_LIMITS_H
+#define HAVE_STDDEF_H
+#define HAVE_RINT		/* defined in this file */
+#define NO_FCNTL_NONBLOCK	/* No FCNTL */
+#define HAVE_ALLOCA
+#define HAVE_STRPBRK
+#define HAVE_STRSTR
+#define HAVE_COMPRESS
+#define HAVE_CREATESEMAPHORE
+#define HAVE_ISNAN
+#define HAVE_FINITE
+#define HAVE_QUERY_CACHE
+#define SPRINTF_RETURNS_INT
+#define HAVE_SETFILEPOINTER
+#define HAVE_VIO_READ_BUFF
+
+#ifdef NOT_USED
+#define HAVE_SNPRINTF		/* Gave link error */
+#define _snprintf snprintf
+#endif
+
+#ifdef _MSC_VER
+#define HAVE_LDIV		/* The optimizer breaks in zortech for ldiv */
+#define HAVE_ANSI_INCLUDE
+#define HAVE_SYS_UTIME_H
+#define HAVE_STRTOUL
+#endif
+#define my_reinterpret_cast(A) reinterpret_cast <A>
+#define my_const_cast(A) const_cast<A>
+
+
+/* MYSQL OPTIONS */
+
+#ifdef _CUSTOMCONFIG_
+#include <custom_conf.h>
+#else
+#define DEFAULT_MYSQL_HOME	"c:\\mysql"
+#define PACKAGE			"mysql"
+#define DEFAULT_BASEDIR		"C:\\"
+#define SHAREDIR		"share"
+#define DEFAULT_CHARSET_HOME	"C:/mysql/"
+#endif
+#ifndef DEFAULT_HOME_ENV
+#define DEFAULT_HOME_ENV MYSQL_HOME
+#endif
+#ifndef DEFAULT_GROUP_SUFFIX_ENV
+#define DEFAULT_GROUP_SUFFIX_ENV MYSQL_GROUP_SUFFIX
+#endif
+
+/* File name handling */
+
+#define FN_LIBCHAR	'\\'
+#define FN_ROOTDIR	"\\"
+#define FN_NETWORK_DRIVES	/* Uses \\ to indicate network drives */
+#define FN_NO_CASE_SENCE	/* Files are not case-sensitive */
+#define OS_FILE_LIMIT	2048
+
+#define DO_NOT_REMOVE_THREAD_WRAPPERS
+#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
+#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
+/* The following is only used for statistics, so it should be good enough */
+#ifdef __NT__  /* This should also work on Win98 but .. */
+#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
+#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
+#define statistic_add(V,C,L) thread_safe_add((V),(C),(L))
+#else
+#define thread_safe_add(V,C,L) \
+	pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L));
+#define thread_safe_sub(V,C,L) \
+	pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L));
+#define statistic_add(V,C,L)	 (V)+=(C)
+#endif
+#define statistic_increment(V,L) thread_safe_increment((V),(L))
+#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
+
+#define shared_memory_buffer_length 16000
+#define default_shared_memory_base_name "MYSQL"
+#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
+#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
+
+#define HAVE_SPATIAL 1
+#define HAVE_RTREE_KEYS 1
+
+/*
+#define HAVE_OPENSSL 1
+#define HAVE_YASSL 1
+*/
+
+/* Define charsets you want */
+/* #undef HAVE_CHARSET_armscii8 */
+/* #undef HAVE_CHARSET_ascii */
+#define HAVE_CHARSET_big5 1
+#define HAVE_CHARSET_cp1250 1
+/* #undef HAVE_CHARSET_cp1251 */
+/* #undef HAVE_CHARSET_cp1256 */
+/* #undef HAVE_CHARSET_cp1257 */
+/* #undef HAVE_CHARSET_cp850 */
+/* #undef HAVE_CHARSET_cp852 */
+/* #undef HAVE_CHARSET_cp866 */
+#define HAVE_CHARSET_cp932 1
+/* #undef HAVE_CHARSET_dec8 */
+#define HAVE_CHARSET_eucjpms 1
+#define HAVE_CHARSET_euckr 1
+#define HAVE_CHARSET_gb2312 1
+#define HAVE_CHARSET_gbk 1
+/* #undef HAVE_CHARSET_greek */
+/* #undef HAVE_CHARSET_hebrew */
+/* #undef HAVE_CHARSET_hp8 */
+/* #undef HAVE_CHARSET_keybcs2 */
+/* #undef HAVE_CHARSET_koi8r */
+/* #undef HAVE_CHARSET_koi8u */
+#define HAVE_CHARSET_latin1 1
+#define HAVE_CHARSET_latin2 1
+/* #undef HAVE_CHARSET_latin5 */
+/* #undef HAVE_CHARSET_latin7 */
+/* #undef HAVE_CHARSET_macce */
+/* #undef HAVE_CHARSET_macroman */
+#define HAVE_CHARSET_sjis 1
+/* #undef HAVE_CHARSET_swe7 */
+#define HAVE_CHARSET_tis620 1
+#define HAVE_CHARSET_ucs2 1
+#define HAVE_CHARSET_ujis 1
+#define HAVE_CHARSET_utf8 1
+#define HAVE_UCA_COLLATIONS 1
+
diff --git a/src/terralib/drivers/MySQL/include/errmsg.h b/src/terralib/drivers/MySQL/include/errmsg.h
new file mode 100644
index 0000000..d007db2
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/errmsg.h
@@ -0,0 +1,102 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/* Error messages for MySQL clients */
+/* (Error messages for the daemon are in share/language/errmsg.sys) */
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+void	init_client_errs(void);
+void	finish_client_errs(void);
+extern const char *client_errors[];	/* Error messages */
+#ifdef	__cplusplus
+}
+#endif
+
+#define CR_MIN_ERROR		2000	/* For easier client code */
+#define CR_MAX_ERROR		2999
+#if defined(OS2) && defined(MYSQL_SERVER)
+#define CER(X) client_errors[(X)-CR_MIN_ERROR]
+#elif !defined(ER)
+#define ER(X) client_errors[(X)-CR_MIN_ERROR]
+#endif
+#define CLIENT_ERRMAP		2	/* Errormap used by my_error() */
+
+/* Do not add error numbers before CR_ERROR_FIRST. */
+/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
+#define CR_ERROR_FIRST  	2000 /*Copy first error nr.*/
+#define CR_UNKNOWN_ERROR	2000
+#define CR_SOCKET_CREATE_ERROR	2001
+#define CR_CONNECTION_ERROR	2002
+#define CR_CONN_HOST_ERROR	2003
+#define CR_IPSOCK_ERROR		2004
+#define CR_UNKNOWN_HOST		2005
+#define CR_SERVER_GONE_ERROR	2006
+#define CR_VERSION_ERROR	2007
+#define CR_OUT_OF_MEMORY	2008
+#define CR_WRONG_HOST_INFO	2009
+#define CR_LOCALHOST_CONNECTION 2010
+#define CR_TCP_CONNECTION	2011
+#define CR_SERVER_HANDSHAKE_ERR 2012
+#define CR_SERVER_LOST		2013
+#define CR_COMMANDS_OUT_OF_SYNC 2014
+#define CR_NAMEDPIPE_CONNECTION 2015
+#define CR_NAMEDPIPEWAIT_ERROR  2016
+#define CR_NAMEDPIPEOPEN_ERROR  2017
+#define CR_NAMEDPIPESETSTATE_ERROR 2018
+#define CR_CANT_READ_CHARSET	2019
+#define CR_NET_PACKET_TOO_LARGE 2020
+#define CR_EMBEDDED_CONNECTION	2021
+#define CR_PROBE_SLAVE_STATUS   2022
+#define CR_PROBE_SLAVE_HOSTS    2023
+#define CR_PROBE_SLAVE_CONNECT  2024
+#define CR_PROBE_MASTER_CONNECT 2025
+#define CR_SSL_CONNECTION_ERROR 2026
+#define CR_MALFORMED_PACKET     2027
+#define CR_WRONG_LICENSE	2028
+
+/* new 4.1 error codes */
+#define CR_NULL_POINTER		2029
+#define CR_NO_PREPARE_STMT	2030
+#define CR_PARAMS_NOT_BOUND	2031
+#define CR_DATA_TRUNCATED	2032
+#define CR_NO_PARAMETERS_EXISTS 2033
+#define CR_INVALID_PARAMETER_NO 2034
+#define CR_INVALID_BUFFER_USE	2035
+#define CR_UNSUPPORTED_PARAM_TYPE 2036
+
+#define CR_SHARED_MEMORY_CONNECTION             2037
+#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR  2038
+#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR   2039
+#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
+#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR      2041
+#define CR_SHARED_MEMORY_FILE_MAP_ERROR         2042
+#define CR_SHARED_MEMORY_MAP_ERROR              2043
+#define CR_SHARED_MEMORY_EVENT_ERROR     	2044
+#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
+#define CR_SHARED_MEMORY_CONNECT_SET_ERROR      2046
+#define CR_CONN_UNKNOW_PROTOCOL 		2047
+#define CR_INVALID_CONN_HANDLE			2048
+#define CR_SECURE_AUTH                          2049
+#define CR_FETCH_CANCELED                       2050
+#define CR_NO_DATA                              2051
+#define CR_NO_STMT_METADATA                     2052
+#define CR_NO_RESULT_SET                        2053
+#define CR_NOT_IMPLEMENTED                      2054
+#define CR_ERROR_LAST  /*Copy last error nr:*/  2054
+/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
+
diff --git a/src/terralib/drivers/MySQL/include/libmysql.def b/src/terralib/drivers/MySQL/include/libmysql.def
new file mode 100644
index 0000000..9e1adcf
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/libmysql.def
@@ -0,0 +1,154 @@
+LIBRARY		LIBMYSQL
+DESCRIPTION	'MySQL 5.0 Client Library'
+VERSION		6.0
+EXPORTS
+	_dig_vec_lower
+	_dig_vec_upper
+	bmove_upp
+	delete_dynamic
+	free_defaults
+	getopt_compare_strings
+	getopt_ull_limit_value
+	handle_options
+	init_dynamic_array
+	insert_dynamic
+	int2str
+	is_prefix
+	list_add
+	list_delete
+	load_defaults
+	my_end
+	my_getopt_print_errors
+	my_init
+	my_malloc
+	my_memdup
+	my_no_flags_free
+	my_path
+	mysql_get_parameters
+	my_print_help
+	my_print_variables
+	my_realloc
+	my_strdup
+	mysql_thread_end
+	mysql_thread_init
+	myodbc_remove_escape
+	mysql_affected_rows
+	mysql_autocommit
+	mysql_stmt_bind_param
+	mysql_stmt_bind_result
+	mysql_change_user
+	mysql_character_set_name
+	mysql_close
+	mysql_commit
+	mysql_data_seek
+	mysql_debug
+	mysql_dump_debug_info
+	mysql_eof
+	mysql_errno
+	mysql_error
+	mysql_escape_string
+	mysql_hex_string
+	mysql_stmt_execute
+	mysql_stmt_fetch
+	mysql_stmt_fetch_column
+	mysql_fetch_field
+	mysql_fetch_field_direct
+	mysql_fetch_fields
+	mysql_fetch_lengths
+	mysql_fetch_row
+	mysql_field_count
+	mysql_field_seek
+	mysql_field_tell
+	mysql_free_result
+	mysql_get_client_info
+	mysql_get_host_info
+	mysql_get_proto_info
+	mysql_get_server_info
+	mysql_get_client_version
+	mysql_info
+	mysql_init
+	mysql_insert_id
+	mysql_kill
+	mysql_set_server_option
+	mysql_list_dbs
+	mysql_list_fields
+	mysql_list_processes
+	mysql_list_tables
+	mysql_more_results
+	mysql_next_result
+	mysql_num_fields
+	mysql_num_rows
+	mysql_odbc_escape_string
+	mysql_options
+	mysql_stmt_param_count
+	mysql_stmt_param_metadata
+	mysql_ping
+	mysql_stmt_result_metadata
+	mysql_query
+	mysql_read_query_result
+	mysql_real_connect
+	mysql_real_escape_string
+	mysql_real_query
+	mysql_refresh
+	mysql_rollback
+	mysql_row_seek
+	mysql_row_tell
+	mysql_select_db
+	mysql_stmt_send_long_data
+	mysql_send_query
+	mysql_shutdown
+	mysql_ssl_set
+	mysql_stat
+	mysql_stmt_affected_rows
+	mysql_stmt_close
+	mysql_stmt_reset
+	mysql_stmt_data_seek
+	mysql_stmt_errno
+	mysql_stmt_error
+	mysql_stmt_free_result
+	mysql_stmt_num_rows
+	mysql_stmt_row_seek
+	mysql_stmt_row_tell
+	mysql_stmt_store_result
+	mysql_store_result
+	mysql_thread_id
+	mysql_thread_safe
+	mysql_use_result
+	mysql_warning_count
+	mysql_stmt_sqlstate
+	mysql_sqlstate
+	mysql_get_server_version
+	set_dynamic
+	strcend
+	strcont
+	strdup_root
+	strfill
+	strinstr
+	strmake
+	strmov
+	strxmov
+	mysql_stmt_prepare
+	mysql_stmt_init
+	mysql_stmt_insert_id
+	mysql_stmt_attr_get
+	mysql_stmt_attr_set
+	mysql_stmt_field_count
+	client_errors
+	mysql_set_local_infile_default
+	mysql_set_local_infile_handler
+	mysql_disable_reads_from_master
+	mysql_disable_rpl_parse
+	mysql_enable_reads_from_master
+	mysql_enable_rpl_parse
+	mysql_master_query
+	mysql_rpl_parse_enabled
+	mysql_rpl_probe
+	mysql_rpl_query_type
+	mysql_slave_query
+	mysql_embedded
+	mysql_server_init
+	mysql_server_end
+	mysql_set_character_set
+	mysql_get_character_set_info
+	get_defaults_options
+	modify_defaults_file
diff --git a/src/terralib/drivers/MySQL/include/libmysqld.def b/src/terralib/drivers/MySQL/include/libmysqld.def
new file mode 100644
index 0000000..494db08
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/libmysqld.def
@@ -0,0 +1,159 @@
+LIBRARY		LIBMYSQLD
+DESCRIPTION	'MySQL 4.1 Embedded Server Library'
+VERSION		4.1
+EXPORTS
+	_dig_vec_upper
+	_dig_vec_lower
+	bmove_upp
+	delete_dynamic
+	free_defaults
+	getopt_compare_strings
+	getopt_ull_limit_value
+	handle_options
+	init_dynamic_array
+	insert_dynamic
+	int2str
+	is_prefix
+	list_add
+	list_delete
+	load_defaults
+	max_allowed_packet
+	my_end
+	my_getopt_print_errors
+	my_init
+	my_malloc
+	my_memdup
+	my_no_flags_free
+	my_path
+	my_print_help
+	my_print_variables
+	my_realloc
+	my_strdup
+	my_thread_end
+	my_thread_init
+	myodbc_remove_escape
+	mysql_affected_rows
+	mysql_autocommit
+	mysql_change_user
+	mysql_character_set_name
+	mysql_close
+	mysql_commit
+	mysql_data_seek
+	mysql_debug
+	mysql_dump_debug_info
+	mysql_eof
+	mysql_errno
+	mysql_error
+	mysql_escape_string
+	mysql_fetch_field
+	mysql_fetch_field_direct
+	mysql_fetch_fields
+	mysql_fetch_lengths
+	mysql_fetch_row
+	mysql_field_count
+	mysql_field_seek
+	mysql_field_tell
+	mysql_free_result
+	mysql_get_client_info
+	mysql_get_host_info
+	mysql_get_proto_info
+	mysql_get_server_info
+	mysql_info
+	mysql_init
+	mysql_insert_id
+	mysql_kill
+	mysql_list_dbs
+	mysql_list_fields
+	mysql_list_processes
+	mysql_list_tables
+	mysql_more_results
+	mysql_next_result
+	mysql_num_fields
+	mysql_num_rows
+	mysql_odbc_escape_string
+	mysql_options
+	mysql_ping
+	mysql_query
+	mysql_read_query_result
+	mysql_real_connect
+	mysql_real_escape_string
+	mysql_real_query
+	mysql_refresh
+	mysql_rollback
+	mysql_row_seek
+	mysql_row_tell
+	mysql_select_db
+	mysql_send_query
+	mysql_shutdown
+	mysql_ssl_set
+	mysql_stat
+	mysql_store_result
+	mysql_sqlstate
+	mysql_thread_id
+	mysql_thread_safe
+	mysql_use_result
+	mysql_warning_count
+	set_dynamic
+	strcend
+	strcont
+	strdup_root
+	strfill
+	strinstr
+	strmake
+	strmov
+	strxmov
+	mysql_server_end
+	mysql_server_init
+	get_tty_password
+	sql_protocol_typelib
+	mysql_get_server_version
+	mysql_sqlstate
+	charsets_dir
+	disabled_my_option
+	my_charset_latin1
+	init_alloc_root
+	my_progname
+	get_charset_by_csname
+	print_defaults
+	find_type
+	strxnmov
+	strend
+	my_fopen
+	my_fclose
+	unpack_filename
+	str2int
+	int10_to_str
+	longlong10_to_str
+	my_snprintf_8bit
+	alloc_root
+	free_root
+	my_read
+	llstr
+	mysql_get_parameters
+	mysql_stmt_bind_param
+	mysql_stmt_bind_result
+	mysql_stmt_execute
+	mysql_stmt_fetch
+	mysql_stmt_fetch_column
+	mysql_stmt_param_count
+	mysql_stmt_param_metadata
+	mysql_stmt_result_metadata
+	mysql_stmt_send_long_data
+	mysql_stmt_affected_rows
+	mysql_stmt_close
+	mysql_stmt_reset
+	mysql_stmt_data_seek
+	mysql_stmt_errno
+	mysql_stmt_error
+	mysql_stmt_free_result
+	mysql_stmt_num_rows
+	mysql_stmt_row_seek
+	mysql_stmt_row_tell
+	mysql_stmt_store_result
+	mysql_stmt_sqlstate
+	mysql_stmt_prepare
+	mysql_stmt_init
+	mysql_stmt_insert_id
+	mysql_stmt_attr_get
+	mysql_stmt_attr_set
+	mysql_stmt_field_count
diff --git a/src/terralib/drivers/MySQL/include/m_ctype.h b/src/terralib/drivers/MySQL/include/m_ctype.h
new file mode 100644
index 0000000..87a35f7
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/m_ctype.h
@@ -0,0 +1,478 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/*
+  A better inplementation of the UNIX ctype(3) library.
+  Notes:   my_global.h should be included before ctype.h
+*/
+
+#ifndef _m_ctype_h
+#define _m_ctype_h
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+#define MY_CS_NAME_SIZE			32
+#define MY_CS_CTYPE_TABLE_SIZE		257
+#define MY_CS_TO_LOWER_TABLE_SIZE	256
+#define MY_CS_TO_UPPER_TABLE_SIZE	256
+#define MY_CS_SORT_ORDER_TABLE_SIZE	256
+#define MY_CS_TO_UNI_TABLE_SIZE		256
+
+#define CHARSET_DIR	"charsets/"
+
+#define my_wc_t ulong
+
+typedef struct unicase_info_st
+{
+  uint16 toupper;
+  uint16 tolower;
+  uint16 sort;
+} MY_UNICASE_INFO;
+
+extern MY_UNICASE_INFO *my_unicase_default[256];
+extern MY_UNICASE_INFO *my_unicase_turkish[256];
+
+#define MY_CS_ILSEQ	0
+#define MY_CS_ILUNI	0
+#define MY_CS_TOOSMALL	-1
+#define MY_CS_TOOFEW(n)	(-1-(n))
+
+#define MY_SEQ_INTTAIL	1
+#define MY_SEQ_SPACES	2
+
+        /* My charsets_list flags */
+#define MY_CS_COMPILED  1      /* compiled-in sets               */
+#define MY_CS_CONFIG    2      /* sets that have a *.conf file   */
+#define MY_CS_INDEX     4      /* sets listed in the Index file  */
+#define MY_CS_LOADED    8      /* sets that are currently loaded */
+#define MY_CS_BINSORT	16     /* if binary sort order           */
+#define MY_CS_PRIMARY	32     /* if primary collation           */
+#define MY_CS_STRNXFRM	64     /* if strnxfrm is used for sort   */
+#define MY_CS_UNICODE	128    /* is a charset is full unicode   */
+#define MY_CS_READY	256    /* if a charset is initialized    */
+#define MY_CS_AVAILABLE	512    /* If either compiled-in or loaded*/
+#define MY_CS_CSSORT	1024   /* if case sensitive sort order   */	
+#define MY_CHARSET_UNDEFINED 0
+
+
+typedef struct my_uni_idx_st
+{
+  uint16 from;
+  uint16 to;
+  uchar  *tab;
+} MY_UNI_IDX;
+
+typedef struct
+{
+  uint beg;
+  uint end;
+  uint mblen;
+} my_match_t;
+
+enum my_lex_states
+{
+  MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT, 
+  MY_LEX_IDENT_SEP, MY_LEX_IDENT_START,
+  MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER,
+  MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END,
+  MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL,
+  MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE, 
+  MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON, 
+  MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, 
+  MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
+  MY_LEX_IDENT_OR_KEYWORD,
+  MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
+  MY_LEX_STRING_OR_DELIMITER
+};
+
+struct charset_info_st;
+
+typedef struct my_collation_handler_st
+{
+  my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
+  /* Collation routines */
+  int     (*strnncoll)(struct charset_info_st *,
+		       const uchar *, uint, const uchar *, uint, my_bool);
+  int     (*strnncollsp)(struct charset_info_st *,
+                         const uchar *, uint, const uchar *, uint,
+                         my_bool diff_if_only_endspace_difference);
+  int     (*strnxfrm)(struct charset_info_st *,
+		      uchar *, uint, const uchar *, uint);
+  uint    (*strnxfrmlen)(struct charset_info_st *, uint); 
+  my_bool (*like_range)(struct charset_info_st *,
+			const char *s, uint s_length,
+			pchar w_prefix, pchar w_one, pchar w_many, 
+			uint res_length,
+			char *min_str, char *max_str,
+			uint *min_len, uint *max_len);
+  int     (*wildcmp)(struct charset_info_st *,
+  		     const char *str,const char *str_end,
+                     const char *wildstr,const char *wildend,
+                     int escape,int w_one, int w_many);
+
+  int  (*strcasecmp)(struct charset_info_st *, const char *, const char *);
+  
+  uint (*instr)(struct charset_info_st *,
+                const char *b, uint b_length,
+                const char *s, uint s_length,
+                my_match_t *match, uint nmatch);
+  
+  /* Hash calculation */
+  void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
+		    ulong *nr1, ulong *nr2); 
+  my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint len);
+} MY_COLLATION_HANDLER;
+
+extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
+extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
+extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
+extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
+
+
+typedef struct my_charset_handler_st
+{
+  my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
+  /* Multibyte routines */
+  int     (*ismbchar)(struct charset_info_st *, const char *, const char *);
+  int     (*mbcharlen)(struct charset_info_st *, uint);
+  uint    (*numchars)(struct charset_info_st *, const char *b, const char *e);
+  uint    (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
+  uint    (*well_formed_len)(struct charset_info_st *,
+                             const char *b,const char *e,
+                             uint nchars, int *error);
+  uint    (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
+  uint    (*numcells)(struct charset_info_st *, const char *b, const char *e);
+  
+  /* Unicode convertion */
+  int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
+	       const unsigned char *s,const unsigned char *e);
+  int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
+	       unsigned char *s,unsigned char *e);
+  
+  /* Functions for case and sort convertion */
+  void    (*caseup_str)(struct charset_info_st *, char *);
+  void    (*casedn_str)(struct charset_info_st *, char *);
+  uint    (*caseup)(struct charset_info_st *, char *src, uint srclen,
+                                              char *dst, uint dstlen);
+  uint    (*casedn)(struct charset_info_st *, char *src, uint srclen,
+                                              char *dst, uint dstlen);
+  
+  /* Charset dependant snprintf() */
+  int  (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
+		   ...);
+  int  (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix,
+			long int val);
+  int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n,
+			   int radix, longlong val);
+  
+  void (*fill)(struct charset_info_st *, char *to, uint len, int fill);
+  
+  /* String-to-number convertion routines */
+  long        (*strntol)(struct charset_info_st *, const char *s, uint l,
+			 int base, char **e, int *err);
+  ulong      (*strntoul)(struct charset_info_st *, const char *s, uint l,
+			 int base, char **e, int *err);
+  longlong   (*strntoll)(struct charset_info_st *, const char *s, uint l,
+			 int base, char **e, int *err);
+  ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l,
+			 int base, char **e, int *err);
+  double      (*strntod)(struct charset_info_st *, char *s, uint l, char **e,
+			 int *err);
+  longlong    (*strtoll10)(struct charset_info_st *cs,
+                           const char *nptr, char **endptr, int *error);
+  ulong        (*scan)(struct charset_info_st *, const char *b, const char *e,
+		       int sq);
+} MY_CHARSET_HANDLER;
+
+extern MY_CHARSET_HANDLER my_charset_8bit_handler;
+extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
+
+
+typedef struct charset_info_st
+{
+  uint      number;
+  uint      primary_number;
+  uint      binary_number;
+  uint      state;
+  const char *csname;
+  const char *name;
+  const char *comment;
+  const char *tailoring;
+  uchar    *ctype;
+  uchar    *to_lower;
+  uchar    *to_upper;
+  uchar    *sort_order;
+  uint16   *contractions;
+  uint16   **sort_order_big;
+  uint16      *tab_to_uni;
+  MY_UNI_IDX  *tab_from_uni;
+  MY_UNICASE_INFO **caseinfo;
+  uchar     *state_map;
+  uchar     *ident_map;
+  uint      strxfrm_multiply;
+  uchar     caseup_multiply;
+  uchar     casedn_multiply;
+  uint      mbminlen;
+  uint      mbmaxlen;
+  uint16    min_sort_char;
+  uint16    max_sort_char; /* For LIKE optimization */
+  uchar     pad_char;
+  my_bool   escape_with_backslash_is_dangerous;
+  
+  MY_CHARSET_HANDLER *cset;
+  MY_COLLATION_HANDLER *coll;
+  
+} CHARSET_INFO;
+
+
+extern CHARSET_INFO my_charset_bin;
+extern CHARSET_INFO my_charset_big5_chinese_ci;
+extern CHARSET_INFO my_charset_big5_bin;
+extern CHARSET_INFO my_charset_cp932_japanese_ci;
+extern CHARSET_INFO my_charset_cp932_bin;
+extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
+extern CHARSET_INFO my_charset_eucjpms_bin;
+extern CHARSET_INFO my_charset_euckr_korean_ci;
+extern CHARSET_INFO my_charset_euckr_bin;
+extern CHARSET_INFO my_charset_gb2312_chinese_ci;
+extern CHARSET_INFO my_charset_gb2312_bin;
+extern CHARSET_INFO my_charset_gbk_chinese_ci;
+extern CHARSET_INFO my_charset_gbk_bin;
+extern CHARSET_INFO my_charset_latin1;
+extern CHARSET_INFO my_charset_latin1_german2_ci;
+extern CHARSET_INFO my_charset_latin1_bin;
+extern CHARSET_INFO my_charset_latin2_czech_ci;
+extern CHARSET_INFO my_charset_sjis_japanese_ci;
+extern CHARSET_INFO my_charset_sjis_bin;
+extern CHARSET_INFO my_charset_tis620_thai_ci;
+extern CHARSET_INFO my_charset_tis620_bin;
+extern CHARSET_INFO my_charset_ucs2_general_ci;
+extern CHARSET_INFO my_charset_ucs2_bin;
+extern CHARSET_INFO my_charset_ucs2_general_uca;
+extern CHARSET_INFO my_charset_ujis_japanese_ci;
+extern CHARSET_INFO my_charset_ujis_bin;
+extern CHARSET_INFO my_charset_utf8_general_ci;
+extern CHARSET_INFO my_charset_utf8_bin;
+extern CHARSET_INFO my_charset_cp1250_czech_ci;
+
+/* declarations for simple charsets */
+extern int  my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
+                               uint); 
+uint  my_strnxfrmlen_simple(CHARSET_INFO *, uint); 
+extern int  my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
+				const uchar *, uint, my_bool);
+
+extern int  my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
+                                  const uchar *, uint,
+                                  my_bool diff_if_only_endspace_difference);
+
+extern void my_hash_sort_simple(CHARSET_INFO *cs,
+				const uchar *key, uint len,
+				ulong *nr1, ulong *nr2); 
+
+extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length);
+
+extern uint my_instr_simple(struct charset_info_st *,
+                            const char *b, uint b_length,
+                            const char *s, uint s_length,
+                            my_match_t *match, uint nmatch);
+
+
+/* Functions for 8bit */
+extern void my_caseup_str_8bit(CHARSET_INFO *, char *);
+extern void my_casedn_str_8bit(CHARSET_INFO *, char *);
+extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen,
+                                           char *dst, uint dstlen);
+extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen,
+                                           char *dst, uint dstlen);
+
+extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
+
+int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
+int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
+
+ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
+
+int my_snprintf_8bit(struct charset_info_st *, char *to, uint n,
+		     const char *fmt, ...);
+
+long        my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+			    char **e, int *err);
+ulong      my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+			    char **e, int *err);
+longlong   my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+			    char **e, int *err);
+ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+			    char **e, int *err);
+double      my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
+			    int *err);
+int  my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
+			   long int val);
+int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
+			      longlong val);
+
+longlong my_strtoll10_8bit(CHARSET_INFO *cs,
+                           const char *nptr, char **endptr, int *error);
+longlong my_strtoll10_ucs2(CHARSET_INFO *cs, 
+                           const char *nptr, char **endptr, int *error);
+
+void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill);
+
+my_bool  my_like_range_simple(CHARSET_INFO *cs,
+			      const char *ptr, uint ptr_length,
+			      pbool escape, pbool w_one, pbool w_many,
+			      uint res_length,
+			      char *min_str, char *max_str,
+			      uint *min_length, uint *max_length);
+
+my_bool  my_like_range_mb(CHARSET_INFO *cs,
+			  const char *ptr, uint ptr_length,
+			  pbool escape, pbool w_one, pbool w_many,
+			  uint res_length,
+			  char *min_str, char *max_str,
+			  uint *min_length, uint *max_length);
+
+my_bool  my_like_range_ucs2(CHARSET_INFO *cs,
+			    const char *ptr, uint ptr_length,
+			    pbool escape, pbool w_one, pbool w_many,
+			    uint res_length,
+			    char *min_str, char *max_str,
+			    uint *min_length, uint *max_length);
+
+
+int my_wildcmp_8bit(CHARSET_INFO *,
+		    const char *str,const char *str_end,
+		    const char *wildstr,const char *wildend,
+		    int escape, int w_one, int w_many);
+
+uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
+uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
+uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
+uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
+                             uint pos, int *error);
+int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
+
+
+/* Functions for multibyte charsets */
+extern void my_caseup_str_mb(CHARSET_INFO *, char *);
+extern void my_casedn_str_mb(CHARSET_INFO *, char *);
+extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen,
+                                         char *dst, uint dstlen);
+extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen,
+                                         char *dst, uint dstlen);
+extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
+
+int my_wildcmp_mb(CHARSET_INFO *,
+		  const char *str,const char *str_end,
+		  const char *wildstr,const char *wildend,
+		  int escape, int w_one, int w_many);
+uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
+uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
+uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
+uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
+                           uint pos, int *error);
+uint my_instr_mb(struct charset_info_st *,
+                 const char *b, uint b_length,
+                 const char *s, uint s_length,
+                 my_match_t *match, uint nmatch);
+
+int my_wildcmp_unicode(CHARSET_INFO *cs,
+                       const char *str, const char *str_end,
+                       const char *wildstr, const char *wildend,
+                       int escape, int w_one, int w_many,
+                       MY_UNICASE_INFO **weights);
+
+extern my_bool my_parse_charset_xml(const char *bug, uint len,
+				    int (*add)(CHARSET_INFO *cs));
+
+my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, uint len);
+my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len);
+
+
+#define	_MY_U	01	/* Upper case */
+#define	_MY_L	02	/* Lower case */
+#define	_MY_NMR	04	/* Numeral (digit) */
+#define	_MY_SPC	010	/* Spacing character */
+#define	_MY_PNT	020	/* Punctuation */
+#define	_MY_CTR	040	/* Control character */
+#define	_MY_B	0100	/* Blank */
+#define	_MY_X	0200	/* heXadecimal digit */
+
+
+#define	my_isascii(c)	(!((c) & ~0177))
+#define	my_toascii(c)	((c) & 0177)
+#define my_tocntrl(c)	((c) & 31)
+#define my_toprint(c)	((c) | 64)
+#define my_toupper(s,c)	(char) ((s)->to_upper[(uchar) (c)])
+#define my_tolower(s,c)	(char) ((s)->to_lower[(uchar) (c)])
+#define	my_isalpha(s, c)  (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L))
+#define	my_isupper(s, c)  (((s)->ctype+1)[(uchar) (c)] & _MY_U)
+#define	my_islower(s, c)  (((s)->ctype+1)[(uchar) (c)] & _MY_L)
+#define	my_isdigit(s, c)  (((s)->ctype+1)[(uchar) (c)] & _MY_NMR)
+#define	my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_X)
+#define	my_isalnum(s, c)  (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR))
+#define	my_isspace(s, c)  (((s)->ctype+1)[(uchar) (c)] & _MY_SPC)
+#define	my_ispunct(s, c)  (((s)->ctype+1)[(uchar) (c)] & _MY_PNT)
+#define	my_isprint(s, c)  (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B))
+#define	my_isgraph(s, c)  (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR))
+#define	my_iscntrl(s, c)  (((s)->ctype+1)[(uchar) (c)] & _MY_CTR)
+
+/* Some macros that should be cleaned up a little */
+#define my_isvar(s,c)                 (my_isalnum(s,c) || (c) == '_')
+#define my_isvar_start(s,c)           (my_isalpha(s,c) || (c) == '_')
+
+#define my_binary_compare(s)	      ((s)->state  & MY_CS_BINSORT)
+#define use_strnxfrm(s)               ((s)->state  & MY_CS_STRNXFRM)
+#define my_strnxfrm(s, a, b, c, d)    ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
+#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
+#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
+   ((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
+#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
+#define my_strcasecmp(s, a, b)        ((s)->coll->strcasecmp((s), (a), (b)))
+#define my_charpos(cs, b, e, num)     (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num))
+
+
+#define use_mb(s)                     ((s)->cset->ismbchar != NULL)
+#define my_ismbchar(s, a, b)          ((s)->cset->ismbchar((s), (a), (b)))
+#ifdef USE_MB
+#define my_mbcharlen(s, a)            ((s)->cset->mbcharlen((s),(a)))
+#else
+#define my_mbcharlen(s, a)            1
+#endif
+
+#define my_caseup_str(s, a)           ((s)->cset->caseup_str((s), (a)))
+#define my_casedn_str(s, a)           ((s)->cset->casedn_str((s), (a)))
+#define my_strntol(s, a, b, c, d, e)  ((s)->cset->strntol((s),(a),(b),(c),(d),(e)))
+#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e)))
+#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e)))
+#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e)))
+#define my_strntod(s, a, b, c, d)     ((s)->cset->strntod((s),(a),(b),(c),(d)))
+
+
+/* XXX: still need to take care of this one */
+#ifdef MY_CHARSET_TIS620
+#error The TIS620 charset is broken at the moment.  Tell tim to fix it.
+#define USE_TIS620
+#include "t_ctype.h"
+#endif
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif /* _m_ctype_h */
diff --git a/src/terralib/drivers/MySQL/include/m_string.h b/src/terralib/drivers/MySQL/include/m_string.h
new file mode 100644
index 0000000..0ebc48b
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/m_string.h
@@ -0,0 +1,262 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/* There may be prolems include all of theese. Try to test in
+   configure with ones are needed? */
+
+/*  This is needed for the definitions of strchr... on solaris */
+
+#ifndef _m_string_h
+#define _m_string_h
+#ifndef __USE_GNU
+#define __USE_GNU				/* We want to use stpcpy */
+#endif
+#if defined(HAVE_STRINGS_H)
+#include <strings.h>
+#endif
+#if defined(HAVE_STRING_H)
+#include <string.h>
+#endif
+
+/* need by my_vsnprintf */
+#include <stdarg.h> 
+
+/* Correct some things for UNIXWARE7 */
+#ifdef HAVE_UNIXWARE7_THREADS
+#undef HAVE_STRINGS_H
+#undef HAVE_MEMORY_H
+#define HAVE_MEMCPY
+#ifndef HAVE_MEMMOVE
+#define HAVE_MEMMOVE
+#endif
+#undef HAVE_BCMP
+#undef bcopy
+#undef bcmp
+#undef bzero
+#endif /* HAVE_UNIXWARE7_THREADS */
+#ifdef _AIX
+#undef HAVE_BCMP
+#endif
+
+/*  This is needed for the definitions of bzero... on solaris */
+#if defined(HAVE_STRINGS_H) && !defined(HAVE_mit_thread)
+#include <strings.h>
+#endif
+
+/*  This is needed for the definitions of memcpy... on solaris */
+#if defined(HAVE_MEMORY_H) && !defined(__cplusplus)
+#include <memory.h>
+#endif
+
+#if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE)
+# define memcpy(d, s, n)	bcopy ((s), (d), (n))
+# define memset(A,C,B)		bfill((A),(B),(C))
+# define memmove(d, s, n)	bmove ((d), (s), (n))
+#elif defined(HAVE_MEMMOVE)
+# define bmove(d, s, n)		memmove((d), (s), (n))
+#else
+# define memmove(d, s, n)	bmove((d), (s), (n)) /* our bmove */
+#endif
+
+/* Unixware 7 */
+#if !defined(HAVE_BFILL)
+# define bfill(A,B,C)           memset((A),(C),(B))
+# define bmove_align(A,B,C)    memcpy((A),(B),(C))
+#endif
+
+#if !defined(HAVE_BCMP)
+# define bcopy(s, d, n)		memcpy((d), (s), (n))
+# define bcmp(A,B,C)		memcmp((A),(B),(C))
+# define bzero(A,B)		memset((A),0,(B))
+# define bmove_align(A,B,C)    memcpy((A),(B),(C))
+#endif
+
+#if defined(__cplusplus) && !defined(OS2)
+extern "C" {
+#endif
+
+/*
+  my_str_malloc() and my_str_free() are assigned to implementations in
+  strings/alloc.c, but can be overridden in the calling program.
+ */
+extern void *(*my_str_malloc)(size_t);
+extern void (*my_str_free)(void *);
+
+#if defined(HAVE_STPCPY) && !defined(HAVE_mit_thread)
+#define strmov(A,B) stpcpy((A),(B))
+#ifndef stpcpy
+extern char *stpcpy(char *, const char *);	/* For AIX with gcc 2.95.3 */
+#endif
+#endif
+
+/* Declared in int2str() */
+extern char NEAR _dig_vec_upper[];
+extern char NEAR _dig_vec_lower[];
+
+#ifdef BAD_STRING_COMPILER
+#define strmov(A,B)  (memccpy(A,B,0,INT_MAX)-1)
+#else
+#define strmov_overlapp(A,B) strmov(A,B)
+#define strmake_overlapp(A,B,C) strmake(A,B,C)
+#endif
+
+#ifdef BAD_MEMCPY			/* Problem with gcc on Alpha */
+#define memcpy_fixed(A,B,C) bmove((A),(B),(C))
+#else
+#define memcpy_fixed(A,B,C) memcpy((A),(B),(C))
+#endif
+
+#ifdef MSDOS
+#undef bmove_align
+#define bmove512(A,B,C) bmove_align(A,B,C)
+extern	void bmove_align(gptr dst,const gptr src,uint len);
+#endif
+
+#if (!defined(USE_BMOVE512) || defined(HAVE_purify)) && !defined(bmove512)
+#define bmove512(A,B,C) memcpy(A,B,C)
+#endif
+
+	/* Prototypes for string functions */
+
+#if !defined(bfill) && !defined(HAVE_BFILL)
+extern	void bfill(gptr dst,uint len,pchar fill);
+#endif
+
+#if !defined(bzero) && !defined(HAVE_BZERO)
+extern	void bzero(gptr dst,uint len);
+#endif
+
+#if !defined(bcmp) && !defined(HAVE_BCMP)
+extern	int bcmp(const char *s1,const char *s2,uint len);
+#endif
+#ifdef HAVE_purify
+extern	int my_bcmp(const char *s1,const char *s2,uint len);
+#undef bcmp
+#define bcmp(A,B,C) my_bcmp((A),(B),(C))
+#endif
+
+#ifndef bmove512
+extern	void bmove512(gptr dst,const gptr src,uint len);
+#endif
+
+#if !defined(HAVE_BMOVE) && !defined(bmove)
+extern	void bmove(char *dst, const char *src,uint len);
+#endif
+
+extern	void bmove_upp(char *dst,const char *src,uint len);
+extern	void bchange(char *dst,uint old_len,const char *src,
+		     uint new_len,uint tot_len);
+extern	void strappend(char *s,uint len,pchar fill);
+extern	char *strend(const char *s);
+extern  char *strcend(const char *, pchar);
+extern	char *strfield(char *src,int fields,int chars,int blanks,
+			   int tabch);
+extern	char *strfill(my_string s,uint len,pchar fill);
+extern	uint strinstr(const char *str,const char *search);
+extern  uint r_strinstr(reg1 my_string str,int from, reg4 my_string search);
+extern	char *strkey(char *dst,char *head,char *tail,char *flags);
+extern	char *strmake(char *dst,const char *src,uint length);
+#ifndef strmake_overlapp
+extern	char *strmake_overlapp(char *dst,const char *src, uint length);
+#endif
+
+#ifndef strmov
+extern	char *strmov(char *dst,const char *src);
+#endif
+extern	char *strnmov(char *dst,const char *src,uint n);
+extern	char *strsuff(const char *src,const char *suffix);
+extern	char *strcont(const char *src,const char *set);
+extern	char *strxcat _VARARGS((char *dst,const char *src, ...));
+extern	char *strxmov _VARARGS((char *dst,const char *src, ...));
+extern	char *strxcpy _VARARGS((char *dst,const char *src, ...));
+extern	char *strxncat _VARARGS((char *dst,uint len, const char *src, ...));
+extern	char *strxnmov _VARARGS((char *dst,uint len, const char *src, ...));
+extern	char *strxncpy _VARARGS((char *dst,uint len, const char *src, ...));
+
+/* Prototypes of normal stringfunctions (with may ours) */
+
+#ifdef WANT_STRING_PROTOTYPES
+extern char *strcat(char *, const char *);
+extern char *strchr(const char *, pchar);
+extern char *strrchr(const char *, pchar);
+extern char *strcpy(char *, const char *);
+extern int strcmp(const char *, const char *);
+#ifndef __GNUC__
+extern size_t strlen(const char *);
+#endif
+#endif
+#ifndef HAVE_STRNLEN
+extern uint strnlen(const char *s, uint n);
+#endif
+
+#if !defined(__cplusplus)
+#ifndef HAVE_STRPBRK
+extern char *strpbrk(const char *, const char *);
+#endif
+#ifndef HAVE_STRSTR
+extern char *strstr(const char *, const char *);
+#endif
+#endif
+extern int is_prefix(const char *, const char *);
+
+/* Conversion routines */
+double my_strtod(const char *str, char **end, int *error);
+double my_atof(const char *nptr);
+
+extern char *llstr(longlong value,char *buff);
+#ifndef HAVE_STRTOUL
+extern long strtol(const char *str, char **ptr, int base);
+extern ulong strtoul(const char *str, char **ptr, int base);
+#endif
+
+extern char *int2str(long val, char *dst, int radix, int upcase);
+extern char *int10_to_str(long val,char *dst,int radix);
+extern char *str2int(const char *src,int radix,long lower,long upper,
+			 long *val);
+longlong my_strtoll10(const char *nptr, char **endptr, int *error);
+#if SIZEOF_LONG == SIZEOF_LONG_LONG
+#define longlong2str(A,B,C) int2str((A),(B),(C),1)
+#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
+#undef strtoll
+#define strtoll(A,B,C) strtol((A),(B),(C))
+#define strtoull(A,B,C) strtoul((A),(B),(C))
+#ifndef HAVE_STRTOULL
+#define HAVE_STRTOULL
+#endif
+#ifndef HAVE_STRTOLL
+#define HAVE_STRTOLL
+#endif
+#else
+#ifdef HAVE_LONG_LONG
+extern char *longlong2str(longlong val,char *dst,int radix);
+extern char *longlong10_to_str(longlong val,char *dst,int radix);
+#if (!defined(HAVE_STRTOULL) || defined(HAVE_mit_thread)) || defined(NO_STRTOLL_PROTO)
+extern longlong strtoll(const char *str, char **ptr, int base);
+extern ulonglong strtoull(const char *str, char **ptr, int base);
+#endif
+#endif
+#endif
+
+/* my_vsnprintf.c */
+
+extern int my_vsnprintf( char *str, size_t n,
+                                const char *format, va_list ap );
+extern int my_snprintf(char* to, size_t n, const char* fmt, ...);
+
+#if defined(__cplusplus) && !defined(OS2)
+}
+#endif
+#endif
diff --git a/src/terralib/drivers/MySQL/include/my_alloc.h b/src/terralib/drivers/MySQL/include/my_alloc.h
new file mode 100644
index 0000000..d328b38
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/my_alloc.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/* 
+   Data structures for mysys/my_alloc.c (root memory allocator)
+*/
+
+#ifndef _my_alloc_h
+#define _my_alloc_h
+
+#define ALLOC_MAX_BLOCK_TO_DROP			4096
+#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP	10
+
+typedef struct st_used_mem
+{				   /* struct for once_alloc (block) */
+  struct st_used_mem *next;	   /* Next block in use */
+  unsigned int	left;		   /* memory left in block  */
+  unsigned int	size;		   /* size of block */
+} USED_MEM;
+
+
+typedef struct st_mem_root
+{
+  USED_MEM *free;                  /* blocks with free memory in it */
+  USED_MEM *used;                  /* blocks almost without free memory */
+  USED_MEM *pre_alloc;             /* preallocated block */
+  /* if block have less memory it will be put in 'used' list */
+  unsigned int min_malloc;
+  unsigned int block_size;         /* initial block size */
+  unsigned int block_num;          /* allocated blocks counter */
+  /* 
+     first free block in queue test counter (if it exceed 
+     MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
+  */
+  unsigned int first_block_usage;
+
+  void (*error_handler)(void);
+} MEM_ROOT;
+#endif
diff --git a/src/terralib/drivers/MySQL/include/my_dbug.h b/src/terralib/drivers/MySQL/include/my_dbug.h
new file mode 100644
index 0000000..bc9b0e3
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/my_dbug.h
@@ -0,0 +1,101 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef _dbug_h
+#define _dbug_h
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+#if !defined(DBUG_OFF) && !defined(_lint)
+extern	int _db_on_,_no_db_;
+extern	FILE *_db_fp_;
+extern	char *_db_process_;
+extern	int _db_keyword_(const char *keyword);
+extern  int _db_strict_keyword_(const char *keyword);
+extern	void _db_setjmp_(void);
+extern	void _db_longjmp_(void);
+extern	void _db_push_(const char *control);
+extern	void _db_pop_(void);
+extern	void _db_enter_(const char *_func_,const char *_file_,uint _line_,
+			const char **_sfunc_,const char **_sfile_,
+			uint *_slevel_, char ***);
+extern	void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
+			 uint *_slevel_);
+extern	void _db_pargs_(uint _line_,const char *keyword);
+extern	void _db_doprnt_ _VARARGS((const char *format,...));
+extern	void _db_dump_(uint _line_,const char *keyword,const char *memory,
+		       uint length);
+extern	void _db_output_(uint flag);
+extern	void _db_lock_file(void);
+extern	void _db_unlock_file(void);
+
+#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
+	char **_db_framep_; \
+	_db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
+		    &_db_framep_)
+#define DBUG_LEAVE \
+	(_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
+#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}
+#define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
+#define DBUG_EXECUTE(keyword,a1) \
+	{if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}}
+#define DBUG_PRINT(keyword,arglist) \
+	{if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}}
+#define DBUG_PUSH(a1) _db_push_ (a1)
+#define DBUG_POP() _db_pop_ ()
+#define DBUG_PROCESS(a1) (_db_process_ = a1)
+#define DBUG_FILE (_db_fp_)
+#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
+#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
+#define DBUG_DUMP(keyword,a1,a2)\
+	{if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}}
+#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr)
+#define DEBUGGER_OFF _no_db_=1;_db_on_=0;
+#define DEBUGGER_ON  _no_db_=0
+#define DBUG_LOCK_FILE { _db_lock_file(); }
+#define DBUG_UNLOCK_FILE { _db_unlock_file(); }
+#define DBUG_OUTPUT(A) { _db_output_(A); }
+#define DBUG_ASSERT(A) assert(A)
+#define DBUG_EXECUTE_IF(keyword,a1) \
+        {if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}}
+#else						/* No debugger */
+
+#define DBUG_ENTER(a1)
+#define DBUG_RETURN(a1) return(a1)
+#define DBUG_VOID_RETURN return
+#define DBUG_EXECUTE(keyword,a1) {}
+#define DBUG_EXECUTE_IF(keyword,a1) {}
+#define DBUG_PRINT(keyword,arglist) {}
+#define DBUG_PUSH(a1) {}
+#define DBUG_POP() {}
+#define DBUG_PROCESS(a1) {}
+#define DBUG_FILE (stderr)
+#define DBUG_SETJMP setjmp
+#define DBUG_LONGJMP longjmp
+#define DBUG_DUMP(keyword,a1,a2) {}
+#define DBUG_IN_USE 0
+#define DEBUGGER_OFF
+#define DEBUGGER_ON
+#define DBUG_LOCK_FILE
+#define DBUG_UNLOCK_FILE
+#define DBUG_OUTPUT(A)
+#define DBUG_ASSERT(A) {}
+#endif
+#ifdef	__cplusplus
+}
+#endif
+#endif
diff --git a/src/terralib/drivers/MySQL/include/my_getopt.h b/src/terralib/drivers/MySQL/include/my_getopt.h
new file mode 100644
index 0000000..e2f1ebf
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/my_getopt.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef _my_getopt_h
+#define _my_getopt_h
+
+C_MODE_START
+
+#define GET_NO_ARG     1
+#define GET_BOOL       2
+#define GET_INT        3
+#define GET_UINT       4
+#define GET_LONG       5
+#define GET_ULONG      6
+#define GET_LL         7
+#define GET_ULL        8
+#define GET_STR        9
+#define GET_STR_ALLOC 10
+#define GET_DISABLED  11
+
+#define GET_ASK_ADDR	 128
+#define GET_TYPE_MASK	 127
+
+enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
+
+struct my_option
+{
+  const char *name;                     /* Name of the option */
+  int        id;                        /* unique id or short option */
+  const char *comment;                  /* option comment, for autom. --help */
+  gptr       *value;                    /* The variable value */
+  gptr       *u_max_value;              /* The user def. max variable value */
+  const char **str_values;              /* Pointer to possible values */
+  ulong     var_type;
+  enum get_opt_arg_type arg_type;
+  longlong   def_value;                 /* Default value */
+  longlong   min_value;                 /* Min allowed value */
+  longlong   max_value;                 /* Max allowed value */
+  longlong   sub_size;                  /* Subtract this from given value */
+  long       block_size;                /* Value should be a mult. of this */
+  int        app_type;                  /* To be used by an application */
+};
+
+typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
+typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
+
+extern char *disabled_my_option;
+extern my_bool my_getopt_print_errors;
+extern my_error_reporter my_getopt_error_reporter;
+
+extern int handle_options (int *argc, char ***argv, 
+			   const struct my_option *longopts, my_get_one_option);
+extern void my_print_help(const struct my_option *options);
+extern void my_print_variables(const struct my_option *options);
+extern void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint,
+							   const struct my_option *));
+
+ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp);
+my_bool getopt_compare_strings(const char *s, const char *t, uint length);
+
+C_MODE_END
+
+#endif /* _my_getopt_h */
+
diff --git a/src/terralib/drivers/MySQL/include/my_global.h b/src/terralib/drivers/MySQL/include/my_global.h
new file mode 100644
index 0000000..60f5790
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/my_global.h
@@ -0,0 +1,1276 @@
+/* Copyright (C) 2000-2003 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/* This is the include file that should be included 'first' in every C file. */
+
+#ifndef _global_h
+#define _global_h
+
+#ifndef EMBEDDED_LIBRARY
+#define HAVE_REPLICATION
+#define HAVE_EXTERNAL_CLIENT
+#endif
+
+#if defined( __EMX__) && !defined( MYSQL_SERVER)
+/* moved here to use below VOID macro redefinition */
+#define INCL_BASE
+#define INCL_NOPMAPI
+#include <os2.h>
+#endif /* __EMX__ */
+
+#ifdef __CYGWIN__
+/* We use a Unix API, so pretend it's not Windows */
+#undef WIN
+#undef WIN32
+#undef _WIN
+#undef _WIN32
+#undef _WIN64
+#undef __WIN__
+#undef __WIN32__
+#define HAVE_ERRNO_AS_DEFINE
+#endif /* __CYGWIN__ */
+
+/* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */
+#ifdef USE_PRAGMA_IMPLEMENTATION
+#define USE_PRAGMA_INTERFACE
+#endif
+
+#if defined(i386) && !defined(__i386__)
+#define __i386__
+#endif
+
+/* Macros to make switching between C and C++ mode easier */
+#ifdef __cplusplus
+#define C_MODE_START    extern "C" {
+#define C_MODE_END	}
+#else
+#define C_MODE_START
+#define C_MODE_END
+#endif
+
+#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
+#include <config-win.h>
+#elif defined(OS2)
+#include <config-os2.h>
+#elif defined(__NETWARE__)
+#include <my_config.h>
+#include <config-netware.h>
+#if defined(__cplusplus) && defined(inline)
+#undef inline				/* fix configure problem */
+#endif
+#else
+#include <my_config.h>
+#if defined(__cplusplus) && defined(inline)
+#undef inline				/* fix configure problem */
+#endif
+#endif /* _WIN32... */
+
+/* Some defines to avoid ifdefs in the code */
+#ifndef NETWARE_YIELD
+#define NETWARE_YIELD
+#define NETWARE_SET_SCREEN_MODE(A)
+#endif
+
+/*
+  The macros below are borrowed from include/linux/compiler.h in the
+  Linux kernel. Use them to indicate the likelyhood of the truthfulness
+  of a condition. This serves two purposes - newer versions of gcc will be
+  able to optimize for branch predication, which could yield siginficant
+  performance gains in frequently executed sections of the code, and the
+  other reason to use them is for documentation
+*/
+
+#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
+#define __builtin_expect(x, expected_value) (x)
+#endif
+
+#define likely(x)	__builtin_expect((x),1)
+#define unlikely(x)	__builtin_expect((x),0)
+
+
+/* Fix problem with S_ISLNK() on Linux */
+#if defined(TARGET_OS_LINUX)
+#undef  _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+
+/*
+  Temporary solution to solve bug#7156. Include "sys/types.h" before
+  the thread headers, else the function madvise() will not be defined
+*/
+#if defined(HAVE_SYS_TYPES_H) && ( defined(sun) || defined(__sun) )
+#include <sys/types.h>
+#endif
+
+/* The client defines this to avoid all thread code */
+#if defined(UNDEF_THREADS_HACK)
+#undef THREAD
+#undef HAVE_mit_thread
+#undef HAVE_LINUXTHREADS
+#undef HAVE_NPTL
+#undef HAVE_UNIXWARE7_THREADS
+#endif
+
+#ifdef HAVE_THREADS_WITHOUT_SOCKETS
+/* MIT pthreads does not work with unix sockets */
+#undef HAVE_SYS_UN_H
+#endif
+
+#define __EXTENSIONS__ 1	/* We want some extension */
+#ifndef __STDC_EXT__
+#define __STDC_EXT__ 1          /* To get large file support on hpux */
+#endif
+
+/*
+  Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
+
+    System Interfaces and Headers, Issue 5
+
+  saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
+  but apparently other systems (namely FreeBSD) don't agree.
+
+  On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
+  Furthermore, it tests that if a program requires older standard
+  (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
+  run on a new compiler (that defines _STDC_C99) and issues an #error.
+  It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
+  or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
+
+  To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
+  C++ compiler does not!
+
+  So, in a desperate attempt to get correct prototypes for both
+  C and C++ code, we define either _XOPEN_SOURCE=600 or _XOPEN_SOURCE=500
+  depending on the compiler's announced C standard support.
+
+  Cleaner solutions are welcome.
+*/
+#ifdef __sun
+#if __STDC_VERSION__ - 0 >= 199901L
+#define _XOPEN_SOURCE 600
+#else
+#define _XOPEN_SOURCE 500
+#endif
+#endif
+
+#if defined(THREAD) && !defined(__WIN__) && !defined(OS2)
+#ifndef _POSIX_PTHREAD_SEMANTICS
+#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
+#endif
+
+#if !defined(SCO)
+#define _REENTRANT	1	/* Some thread libraries require this */
+#endif
+#if !defined(_THREAD_SAFE) && !defined(_AIX)
+#define _THREAD_SAFE            /* Required for OSF1 */
+#endif
+#ifndef HAVE_mit_thread
+#ifdef HAVE_UNIXWARE7_THREADS
+#include <thread.h>
+#else
+#if defined(HPUX10) || defined(HPUX11)
+C_MODE_START			/* HPUX needs this, signal.h bug */
+#include <pthread.h>
+C_MODE_END
+#else
+#include <pthread.h>		/* AIX must have this included first */
+#endif
+#endif /* HAVE_UNIXWARE7_THREADS */
+#endif /* HAVE_mit_thread */
+#if !defined(SCO) && !defined(_REENTRANT)
+#define _REENTRANT	1	/* Threads requires reentrant code */
+#endif
+#endif /* THREAD */
+
+/* Go around some bugs in different OS and compilers */
+#ifdef _AIX			/* By soren at t.dk */
+#define _H_STRINGS
+#define _SYS_STREAM_H
+/* #define _AIX32_CURSES */	/* XXX: this breaks AIX 4.3.3 (others?). */
+#define ulonglong2double(A) my_ulonglong2double(A)
+#define my_off_t2double(A)  my_ulonglong2double(A)
+C_MODE_START
+double my_ulonglong2double(unsigned long long A);
+C_MODE_END
+#endif /* _AIX */
+
+#ifdef HAVE_BROKEN_SNPRINTF	/* HPUX 10.20 don't have this defined */
+#undef HAVE_SNPRINTF
+#endif
+#ifdef HAVE_BROKEN_PREAD
+/*
+  pread()/pwrite() are not 64 bit safe on HP-UX 11.0 without
+  installing the kernel patch PHKL_20349 or greater
+*/
+#undef HAVE_PREAD
+#undef HAVE_PWRITE
+#endif
+#if defined(HAVE_BROKEN_INLINE) && !defined(__cplusplus)
+#undef inline
+#define inline
+#endif
+
+#ifdef UNDEF_HAVE_GETHOSTBYNAME_R		/* For OSF4.x */
+#undef HAVE_GETHOSTBYNAME_R
+#endif
+#ifdef UNDEF_HAVE_INITGROUPS			/* For AIX 4.3 */
+#undef HAVE_INITGROUPS
+#endif
+
+/* gcc/egcs issues */
+
+#if defined(__GNUC) && defined(__EXCEPTIONS)
+#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
+#endif
+
+
+/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */
+#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) && (__GNUC__ == 2 && __GNUC_MINOR__ == 8)
+#undef __LONG_MAX__             /* Is a longlong value in gcc 2.8.0 ??? */
+#define __LONG_MAX__ 2147483647
+#endif
+
+/* egcs 1.1.2 has a problem with memcpy on Alpha */
+#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 &&  __GNUC_MINOR__ >= 95))
+#define BAD_MEMCPY
+#endif
+
+#if defined(_lint) && !defined(lint)
+#define lint
+#endif
+#if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG)
+#define _LONG_LONG 1		/* For AIX string library */
+#endif
+
+#ifndef stdin
+#include <stdio.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+
+#include <math.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_FLOAT_H
+#include <float.h>
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_SYS_TIMEB_H
+#include <sys/timeb.h>				/* Avoid warnings on SCO */
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif /* TIME_WITH_SYS_TIME */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if defined(__cplusplus) && defined(NO_CPLUSPLUS_ALLOCA)
+#undef HAVE_ALLOCA
+#undef HAVE_ALLOCA_H
+#endif
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#ifdef HAVE_ATOMIC_ADD
+#define new my_arg_new
+#define need_to_restore_new 1
+C_MODE_START
+#include <asm/atomic.h>
+C_MODE_END
+#ifdef need_to_restore_new /* probably safer than #ifdef new */
+#undef new
+#undef need_to_restore_new
+#endif
+#endif
+#include <errno.h>				/* Recommended by debian */
+/* We need the following to go around a problem with openssl on solaris */
+#if defined(HAVE_CRYPT_H)
+#include <crypt.h>
+#endif
+
+/*
+  A lot of our programs uses asserts, so better to always include it
+  This also fixes a problem when people uses DBUG_ASSERT without including
+  assert.h
+*/
+#include <assert.h>
+
+/* Go around some bugs in different OS and compilers */
+#if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H)
+#include <sys/stream.h>		/* HPUX 10.20 defines ulong here. UGLY !!! */
+#define HAVE_ULONG
+#endif
+#ifdef DONT_USE_FINITE		/* HPUX 11.x has is_finite() */
+#undef HAVE_FINITE
+#endif
+#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD)
+/* Fix bug in setrlimit */
+#undef setrlimit
+#define setrlimit cma_setrlimit64
+#endif
+/* Declare madvise where it is not declared for C++, like Solaris */
+#if HAVE_MADVISE && !HAVE_DECL_MADVISE && defined(__cplusplus)
+extern "C" int madvise(void *addr, size_t len, int behav);
+#endif
+
+#ifdef __QNXNTO__
+/* This has to be after include limits.h */
+#define HAVE_ERRNO_AS_DEFINE
+#define HAVE_FCNTL_LOCK
+#undef  HAVE_FINITE
+#undef  LONGLONG_MIN            /* These get wrongly defined in QNX 6.2 */
+#undef  LONGLONG_MAX            /* standard system library 'limits.h' */
+#ifdef __cplusplus
+#ifndef HAVE_RINT
+#define HAVE_RINT
+#endif                          /* rint() and isnan() functions are not */
+#define rint(a) std::rint(a)    /* visible in C++ scope due to an error */
+#define isnan(a) std::isnan(a)  /* in the usr/include/math.h on QNX     */
+#endif
+#endif
+
+/* We can not live without the following defines */
+
+#define USE_MYFUNC 1		/* Must use syscall indirection */
+#define MASTER 1		/* Compile without unireg */
+#define ENGLISH 1		/* Messages in English */
+#define POSIX_MISTAKE 1		/* regexp: Fix stupid spec error */
+#define USE_REGEX 1		/* We want the use the regex library */
+/* Do not define for ultra sparcs */
+#ifndef OS2
+#define USE_BMOVE512 1		/* Use this unless system bmove is faster */
+#endif
+
+#define QUOTE_ARG(x)		#x	/* Quote argument (before cpp) */
+#define STRINGIFY_ARG(x) QUOTE_ARG(x)	/* Quote argument, after cpp */
+
+/* Paranoid settings. Define I_AM_PARANOID if you are paranoid */
+#ifdef I_AM_PARANOID
+#define DONT_ALLOW_USER_CHANGE 1
+#define DONT_USE_MYSQL_PWD 1
+#endif
+
+/* Does the system remember a signal handler after a signal ? */
+#ifndef HAVE_BSD_SIGNALS
+#define DONT_REMEMBER_SIGNAL
+#endif
+
+/* Define void to stop lint from generating "null effekt" comments */
+#ifndef DONT_DEFINE_VOID
+#ifdef _lint
+int	__void__;
+#define VOID(X)		(__void__ = (int) (X))
+#else
+#undef VOID
+#define VOID(X)		(X)
+#endif
+#endif /* DONT_DEFINE_VOID */
+
+#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
+#define LINT_INIT(var)	var=0			/* No uninitialize-warning */
+#else
+#define LINT_INIT(var)
+#endif
+
+#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_purify)
+#define PURIFY_OR_LINT_INIT(var) var=0
+#else
+#define PURIFY_OR_LINT_INIT(var)
+#endif
+
+/* Define some useful general macros */
+#if !defined(max)
+#define max(a, b)	((a) > (b) ? (a) : (b))
+#define min(a, b)	((a) < (b) ? (a) : (b))
+#endif
+
+#if defined(__EMX__) || !defined(HAVE_UINT)
+#undef HAVE_UINT
+#define HAVE_UINT
+typedef unsigned int uint;
+typedef unsigned short ushort;
+#endif
+
+#define CMP_NUM(a,b)    (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
+#define sgn(a)		(((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
+#define swap_variables(t, a, b) { register t dummy; dummy= a; a= b; b= dummy; }
+#define test(a)		((a) ? 1 : 0)
+#define set_if_bigger(a,b)  do { if ((a) < (b)) (a)=(b); } while(0)
+#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
+#define test_all_bits(a,b) (((a) & (b)) == (b))
+#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
+#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
+#ifndef HAVE_RINT
+#define rint(A) floor((A)+(((A) < 0)? -0.5 : 0.5))
+#endif
+
+/* Define some general constants */
+#ifndef TRUE
+#define TRUE		(1)	/* Logical true */
+#define FALSE		(0)	/* Logical false */
+#endif
+
+#if defined(__GNUC__)
+#define function_volatile	volatile
+#define my_reinterpret_cast(A) reinterpret_cast<A>
+#define my_const_cast(A) const_cast<A>
+#elif !defined(my_reinterpret_cast)
+#define my_reinterpret_cast(A) (A)
+#define my_const_cast(A) (A)
+#endif
+#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__)  || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
+#define __attribute__(A)
+#endif
+
+/* From old s-system.h */
+
+/*
+  Support macros for non ansi & other old compilers. Since such
+  things are no longer supported we do nothing. We keep then since
+  some of our code may still be needed to upgrade old customers.
+*/
+#define _VARARGS(X) X
+#define _STATIC_VARARGS(X) X
+#define _PC(X)	X
+
+#if defined(DBUG_ON) && defined(DBUG_OFF)
+#undef DBUG_OFF
+#endif
+
+#if defined(_lint) && !defined(DBUG_OFF)
+#define DBUG_OFF
+#endif
+
+#include <my_dbug.h>
+
+#define MIN_ARRAY_SIZE	0	/* Zero or One. Gcc allows zero*/
+#define ASCII_BITS_USED 8	/* Bit char used */
+#define NEAR_F			/* No near function handling */
+
+/* Some types that is different between systems */
+
+typedef int	File;		/* File descriptor */
+#ifndef Socket_defined
+typedef int	my_socket;	/* File descriptor for sockets */
+#define INVALID_SOCKET -1
+#endif
+/* Type for fuctions that handles signals */
+#define sig_handler RETSIGTYPE
+C_MODE_START
+typedef void	(*sig_return)();/* Returns type from signal */
+C_MODE_END
+#if defined(__GNUC__) && !defined(_lint)
+typedef char	pchar;		/* Mixed prototypes can take char */
+typedef char	puchar;		/* Mixed prototypes can take char */
+typedef char	pbool;		/* Mixed prototypes can take char */
+typedef short	pshort;		/* Mixed prototypes can take short int */
+typedef float	pfloat;		/* Mixed prototypes can take float */
+#else
+typedef int	pchar;		/* Mixed prototypes can't take char */
+typedef uint	puchar;		/* Mixed prototypes can't take char */
+typedef int	pbool;		/* Mixed prototypes can't take char */
+typedef int	pshort;		/* Mixed prototypes can't take short int */
+typedef double	pfloat;		/* Mixed prototypes can't take float */
+#endif
+C_MODE_START
+typedef int	(*qsort_cmp)(const void *,const void *);
+typedef int	(*qsort_cmp2)(void*, const void *,const void *);
+C_MODE_END
+#ifdef HAVE_mit_thread
+#define qsort_t void
+#undef QSORT_TYPE_IS_VOID
+#define QSORT_TYPE_IS_VOID
+#else
+#define qsort_t RETQSORTTYPE	/* Broken GCC cant handle typedef !!!! */
+#endif
+#ifdef HAVE_mit_thread
+#define size_socket socklen_t	/* Type of last arg to accept */
+#else
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+typedef SOCKET_SIZE_TYPE size_socket;
+#endif
+
+#ifndef SOCKOPT_OPTLEN_TYPE
+#define SOCKOPT_OPTLEN_TYPE size_socket
+#endif
+
+/* file create flags */
+
+#ifndef O_SHARE			/* Probably not windows */
+#define O_SHARE		0	/* Flag to my_open for shared files */
+#ifndef O_BINARY
+#define O_BINARY	0	/* Flag to my_open for binary files */
+#endif
+#ifndef FILE_BINARY
+#define FILE_BINARY	O_BINARY /* Flag to my_fopen for binary streams */
+#endif
+#ifdef HAVE_FCNTL
+#define HAVE_FCNTL_LOCK
+#define F_TO_EOF	0L	/* Param to lockf() to lock rest of file */
+#endif
+#endif /* O_SHARE */
+
+#ifndef O_TEMPORARY
+#define O_TEMPORARY	0
+#endif
+#ifndef O_SHORT_LIVED
+#define O_SHORT_LIVED	0
+#endif
+#ifndef O_NOFOLLOW
+#define O_NOFOLLOW      0
+#endif
+
+/* #define USE_RECORD_LOCK	*/
+
+	/* Unsigned types supported by the compiler */
+#define UNSINT8			/* unsigned int8 (char) */
+#define UNSINT16		/* unsigned int16 */
+#define UNSINT32		/* unsigned int32 */
+
+	/* General constants */
+#define SC_MAXWIDTH	256	/* Max width of screen (for error messages) */
+#define FN_LEN		256	/* Max file name len */
+#define FN_HEADLEN	253	/* Max length of filepart of file name */
+#define FN_EXTLEN	20	/* Max length of extension (part of FN_LEN) */
+#ifdef PATH_MAX
+#define FN_REFLEN       PATH_MAX/* Max length of full path-name */
+#else
+#define FN_REFLEN	512	/* Max length of full path-name */
+#endif
+#define FN_EXTCHAR	'.'
+#define FN_HOMELIB	'~'	/* ~/ is used as abbrev for home dir */
+#define FN_CURLIB	'.'	/* ./ is used as abbrev for current dir */
+#define FN_PARENTDIR	".."	/* Parent directory; Must be a string */
+#define FN_DEVCHAR	':'
+
+#ifndef FN_LIBCHAR
+#ifdef __EMX__
+#define FN_LIBCHAR	'\\'
+#define FN_ROOTDIR	"\\"
+#else
+#define FN_LIBCHAR	'/'
+#define FN_ROOTDIR	"/"
+#endif
+#endif
+#define MY_NFILE	64	/* This is only used to save filenames */
+#ifndef OS_FILE_LIMIT
+#define OS_FILE_LIMIT	65535
+#endif
+
+/* #define EXT_IN_LIBNAME     */
+/* #define FN_NO_CASE_SENCE   */
+/* #define FN_UPPER_CASE TRUE */
+
+/*
+  Io buffer size; Must be a power of 2 and a multiple of 512. May be
+  smaller what the disk page size. This influences the speed of the
+  isam btree library. eg to big to slow.
+*/
+#define IO_SIZE			4096
+/*
+  How much overhead does malloc have. The code often allocates
+  something like 1024-MALLOC_OVERHEAD bytes
+*/
+#ifdef SAFEMALLOC
+#define MALLOC_OVERHEAD (8+24+4)
+#else
+#define MALLOC_OVERHEAD 8
+#endif
+	/* get memory in huncs */
+#define ONCE_ALLOC_INIT		(uint) (4096-MALLOC_OVERHEAD)
+	/* Typical record cash */
+#define RECORD_CACHE_SIZE	(uint) (64*1024-MALLOC_OVERHEAD)
+	/* Typical key cash */
+#define KEY_CACHE_SIZE		(uint) (8*1024*1024-MALLOC_OVERHEAD)
+	/* Default size of a key cache block  */
+#define KEY_CACHE_BLOCK_SIZE	(uint) 1024
+
+
+	/* Some things that this system doesn't have */
+
+#define NO_HASH			/* Not needed anymore */
+#ifdef __WIN__
+#define NO_DIR_LIBRARY		/* Not standar dir-library */
+#define USE_MY_STAT_STRUCT	/* For my_lib */
+#endif
+
+/* Some defines of functions for portability */
+
+#undef remove		/* Crashes MySQL on SCO 5.0.0 */
+#ifndef __WIN__
+#ifdef OS2
+#define closesocket(A)	soclose(A)
+#else
+#define closesocket(A)	close(A)
+#endif
+#ifndef ulonglong2double
+#define ulonglong2double(A) ((double) (ulonglong) (A))
+#define my_off_t2double(A)  ((double) (my_off_t) (A))
+#endif
+#endif
+
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+#define ulong_to_double(X) ((double) (ulong) (X))
+#define SET_STACK_SIZE(X)	/* Not needed on real machines */
+
+#if !defined(HAVE_mit_thread) && !defined(HAVE_STRTOK_R)
+#define strtok_r(A,B,C) strtok((A),(B))
+#endif
+
+/* Remove some things that mit_thread break or doesn't support */
+#if defined(HAVE_mit_thread) && defined(THREAD)
+#undef HAVE_PREAD
+#undef HAVE_REALPATH
+#undef HAVE_MLOCK
+#undef HAVE_TEMPNAM				/* Use ours */
+#undef HAVE_PTHREAD_SETPRIO
+#undef HAVE_FTRUNCATE
+#undef HAVE_READLINK
+#endif
+
+/* This is from the old m-machine.h file */
+
+#if SIZEOF_LONG_LONG > 4
+#define HAVE_LONG_LONG 1
+#endif
+
+/*
+  Some pre-ANSI-C99 systems like AIX 5.1 and Linux/GCC 2.95 define
+  ULONGLONG_MAX, LONGLONG_MIN, LONGLONG_MAX; we use them if they're defined.
+  Also on Windows we define these constants by hand in config-win.h.
+*/
+
+#if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN)
+#define LONGLONG_MIN	((long long) 0x8000000000000000LL)
+#define LONGLONG_MAX	((long long) 0x7FFFFFFFFFFFFFFFLL)
+#endif
+
+#if defined(HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)
+/* First check for ANSI C99 definition: */
+#ifdef ULLONG_MAX
+#define ULONGLONG_MAX  ULLONG_MAX
+#else
+#define ULONGLONG_MAX ((unsigned long long)(~0ULL))
+#endif
+#endif /* defined (HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)*/
+
+#define INT_MIN32       (~0x7FFFFFFFL)
+#define INT_MAX32       0x7FFFFFFFL
+#define UINT_MAX32      0xFFFFFFFFL
+#define INT_MIN24       (~0x007FFFFF)
+#define INT_MAX24       0x007FFFFF
+#define UINT_MAX24      0x00FFFFFF
+#define INT_MIN16       (~0x7FFF)
+#define INT_MAX16       0x7FFF
+#define UINT_MAX16      0xFFFF
+#define INT_MIN8        (~0x7F)
+#define INT_MAX8        0x7F
+#define UINT_MAX8       0xFF
+
+/* From limits.h instead */
+#ifndef DBL_MIN
+#define DBL_MIN		4.94065645841246544e-324
+#define FLT_MIN		((float)1.40129846432481707e-45)
+#endif
+#ifndef DBL_MAX
+#define DBL_MAX		1.79769313486231470e+308
+#define FLT_MAX		((float)3.40282346638528860e+38)
+#endif
+
+#if !defined(HAVE_ISINF) && !defined(isinf)
+#define isinf(X)    0
+#endif
+
+/* Define missing math constants. */
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+#ifndef M_E
+#define M_E 2.7182818284590452354
+#endif
+#ifndef M_LN2
+#define M_LN2 0.69314718055994530942
+#endif
+
+/*
+  Max size that must be added to a so that we know Size to make
+  adressable obj.
+*/
+#if SIZEOF_CHARP == 4
+typedef long		my_ptrdiff_t;
+#else
+typedef long long	my_ptrdiff_t;
+#endif
+
+#define MY_ALIGN(A,L)	(((A) + (L) - 1) & ~((L) - 1))
+#define ALIGN_SIZE(A)	MY_ALIGN((A),sizeof(double))
+/* Size to make adressable obj. */
+#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t)))
+			 /* Offset of field f in structure t */
+#define OFFSET(t, f)	((size_t)(char *)&((t *)0)->f)
+#define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size)
+#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B))
+
+#define NullS		(char *) 0
+/* Nowdays we do not support MessyDos */
+#ifndef NEAR
+#define NEAR				/* Who needs segments ? */
+#define FAR				/* On a good machine */
+#ifndef HUGE_PTR
+#define HUGE_PTR
+#endif
+#endif
+#if defined(__IBMC__) || defined(__IBMCPP__)
+/* This was  _System _Export but caused a lot of warnings on _AIX43 */
+#define STDCALL
+#elif !defined( STDCALL)
+#define STDCALL
+#endif
+
+/* Typdefs for easyier portability */
+
+#if defined(VOIDTYPE)
+typedef void	*gptr;		/* Generic pointer */
+#else
+typedef char	*gptr;		/* Generic pointer */
+#endif
+#ifndef HAVE_INT_8_16_32
+typedef signed char int8;       /* Signed integer >= 8  bits */
+typedef short	int16;		/* Signed integer >= 16 bits */
+#endif
+#ifndef HAVE_UCHAR
+typedef unsigned char	uchar;	/* Short for unsigned char */
+#endif
+typedef unsigned char	uint8;	/* Short for unsigned integer >= 8  bits */
+typedef unsigned short	uint16; /* Short for unsigned integer >= 16 bits */
+
+#if SIZEOF_INT == 4
+#ifndef HAVE_INT_8_16_32
+typedef int		int32;
+#endif
+typedef unsigned int	uint32; /* Short for unsigned integer >= 32 bits */
+#elif SIZEOF_LONG == 4
+#ifndef HAVE_INT_8_16_32
+typedef long		int32;
+#endif
+typedef unsigned long	uint32; /* Short for unsigned integer >= 32 bits */
+#else
+#error "Neither int or long is of 4 bytes width"
+#endif
+
+#if !defined(HAVE_ULONG) && !defined(TARGET_OS_LINUX) && !defined(__USE_MISC)
+typedef unsigned long	ulong;		  /* Short for unsigned long */
+#endif
+#ifndef longlong_defined
+#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8
+typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
+typedef long long int	longlong;
+#else
+typedef unsigned long	ulonglong;	  /* ulong or unsigned long long */
+typedef long		longlong;
+#endif
+#endif
+
+#if defined(NO_CLIENT_LONG_LONG)
+typedef unsigned long my_ulonglong;
+#elif defined (__WIN__)
+typedef unsigned __int64 my_ulonglong;
+#else
+typedef unsigned long long my_ulonglong;
+#endif
+
+#ifdef USE_RAID
+/*
+  The following is done with a if to not get problems with pre-processors
+  with late define evaluation
+*/
+#if SIZEOF_OFF_T == 4
+#define SYSTEM_SIZEOF_OFF_T 4
+#else
+#define SYSTEM_SIZEOF_OFF_T 8
+#endif
+#undef  SIZEOF_OFF_T
+#define SIZEOF_OFF_T	    8
+#else
+#define SYSTEM_SIZEOF_OFF_T SIZEOF_OFF_T
+#endif /* USE_RAID */
+
+#if SIZEOF_OFF_T > 4
+typedef ulonglong my_off_t;
+#else
+typedef unsigned long my_off_t;
+#endif
+#define MY_FILEPOS_ERROR	(~(my_off_t) 0)
+#if !defined(__WIN__) && !defined(OS2)
+typedef off_t os_off_t;
+#endif
+
+#if defined(__WIN__)
+#define socket_errno	WSAGetLastError()
+#define SOCKET_EINTR	WSAEINTR
+#define SOCKET_EAGAIN	WSAEINPROGRESS
+#define SOCKET_ETIMEDOUT WSAETIMEDOUT
+#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
+#define SOCKET_ENFILE	ENFILE
+#define SOCKET_EMFILE	EMFILE
+#elif defined(OS2)
+#define socket_errno	sock_errno()
+#define SOCKET_EINTR	SOCEINTR
+#define SOCKET_EAGAIN	SOCEINPROGRESS
+#define SOCKET_ETIMEDOUT SOCKET_EINTR
+#define SOCKET_EWOULDBLOCK SOCEWOULDBLOCK
+#define SOCKET_ENFILE	SOCENFILE
+#define SOCKET_EMFILE	SOCEMFILE
+#define closesocket(A)	soclose(A)
+#else /* Unix */
+#define socket_errno	errno
+#define closesocket(A)	close(A)
+#define SOCKET_EINTR	EINTR
+#define SOCKET_EAGAIN	EAGAIN
+#define SOCKET_ETIMEDOUT SOCKET_EINTR
+#define SOCKET_EWOULDBLOCK EWOULDBLOCK
+#define SOCKET_ENFILE	ENFILE
+#define SOCKET_EMFILE	EMFILE
+#endif
+
+typedef uint8		int7;	/* Most effective integer 0 <= x <= 127 */
+typedef short		int15;	/* Most effective integer 0 <= x <= 32767 */
+typedef char		*my_string; /* String of characters */
+typedef unsigned long	size_s; /* Size of strings (In string-funcs) */
+typedef int		myf;	/* Type of MyFlags in my_funcs */
+#ifndef byte_defined
+typedef char		byte;	/* Smallest addressable unit */
+#endif
+typedef char		my_bool; /* Small bool */
+#if !defined(bool) && !defined(bool_defined) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
+typedef char		bool;	/* Ordinary boolean values 0 1 */
+#endif
+	/* Macros for converting *constants* to the right type */
+#define INT8(v)		(int8) (v)
+#define INT16(v)	(int16) (v)
+#define INT32(v)	(int32) (v)
+#define MYF(v)		(myf) (v)
+
+#ifndef LL
+#ifdef HAVE_LONG_LONG
+#define LL(A) A ## LL
+#else
+#define LL(A) A ## L
+#endif
+#endif
+
+#ifndef ULL
+#ifdef HAVE_LONG_LONG
+#define ULL(A) A ## ULL
+#else
+#define ULL(A) A ## UL
+#endif
+#endif
+
+/*
+  Defines to make it possible to prioritize register assignments. No
+  longer that important with modern compilers.
+*/
+#ifndef USING_X
+#define reg1 register
+#define reg2 register
+#define reg3 register
+#define reg4 register
+#define reg5 register
+#define reg6 register
+#define reg7 register
+#define reg8 register
+#define reg9 register
+#define reg10 register
+#define reg11 register
+#define reg12 register
+#define reg13 register
+#define reg14 register
+#define reg15 register
+#define reg16 register
+#endif
+
+/*
+  Sometimes we want to make sure that the variable is not put into
+  a register in debugging mode so we can see its value in the core
+*/
+
+#ifndef DBUG_OFF
+#define dbug_volatile volatile
+#else
+#define dbug_volatile
+#endif
+
+/* Defines for time function */
+#define SCALE_SEC	100
+#define SCALE_USEC	10000
+#define MY_HOW_OFTEN_TO_ALARM	2	/* How often we want info on screen */
+#define MY_HOW_OFTEN_TO_WRITE	1000	/* How often we want info on screen */
+
+#ifdef HAVE_TIMESPEC_TS_SEC
+#ifndef set_timespec
+#define set_timespec(ABSTIME,SEC) \
+{ \
+  (ABSTIME).ts_sec=time(0) + (time_t) (SEC); \
+  (ABSTIME).ts_nsec=0; \
+}
+#endif /* !set_timespec */
+#ifndef set_timespec_nsec
+#define set_timespec_nsec(ABSTIME,NSEC) \
+{ \
+  ulonglong now= my_getsystime() + (NSEC/100); \
+  (ABSTIME).ts_sec=  (now / ULL(10000000)); \
+  (ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
+}
+#endif /* !set_timespec_nsec */
+#else
+#ifndef set_timespec
+#define set_timespec(ABSTIME,SEC) \
+{\
+  struct timeval tv;\
+  gettimeofday(&tv,0);\
+  (ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\
+  (ABSTIME).tv_nsec=tv.tv_usec*1000;\
+}
+#endif /* !set_timespec */
+#ifndef set_timespec_nsec
+#define set_timespec_nsec(ABSTIME,NSEC) \
+{\
+  ulonglong now= my_getsystime() + (NSEC/100); \
+  (ABSTIME).tv_sec=  (now / ULL(10000000)); \
+  (ABSTIME).tv_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100));    \
+}
+#endif /* !set_timespec_nsec */
+#endif /* HAVE_TIMESPEC_TS_SEC */
+
+/*
+  Define-funktions for reading and storing in machine independent format
+  (low byte first)
+*/
+
+/* Optimized store functions for Intel x86 */
+#if defined(__i386__) && !defined(_WIN64)
+#define sint2korr(A)	(*((int16 *) (A)))
+#define sint3korr(A)	((int32) ((((uchar) (A)[2]) & 128) ? \
+				  (((uint32) 255L << 24) | \
+				   (((uint32) (uchar) (A)[2]) << 16) |\
+				   (((uint32) (uchar) (A)[1]) << 8) | \
+				   ((uint32) (uchar) (A)[0])) : \
+				  (((uint32) (uchar) (A)[2]) << 16) |\
+				  (((uint32) (uchar) (A)[1]) << 8) | \
+				  ((uint32) (uchar) (A)[0])))
+#define sint4korr(A)	(*((long *) (A)))
+#define uint2korr(A)	(*((uint16 *) (A)))
+#ifdef HAVE_purify
+#define uint3korr(A)	(uint32) (((uint32) ((uchar) (A)[0])) +\
+				  (((uint32) ((uchar) (A)[1])) << 8) +\
+				  (((uint32) ((uchar) (A)[2])) << 16))
+#else
+/*
+   ATTENTION !
+   
+    Please, note, uint3korr reads 4 bytes (not 3) !
+    It means, that you have to provide enough allocated space !
+*/
+#define uint3korr(A)	(long) (*((unsigned int *) (A)) & 0xFFFFFF)
+#endif
+#define uint4korr(A)	(*((unsigned long *) (A)))
+#define uint5korr(A)	((ulonglong)(((uint32) ((uchar) (A)[0])) +\
+				    (((uint32) ((uchar) (A)[1])) << 8) +\
+				    (((uint32) ((uchar) (A)[2])) << 16) +\
+				    (((uint32) ((uchar) (A)[3])) << 24)) +\
+				    (((ulonglong) ((uchar) (A)[4])) << 32))
+#define uint8korr(A)	(*((ulonglong *) (A)))
+#define sint8korr(A)	(*((longlong *) (A)))
+#define int2store(T,A)	*((uint16*) (T))= (uint16) (A)
+#define int3store(T,A)  do { *(T)=  (uchar) ((A));\
+                            *(T+1)=(uchar) (((uint) (A) >> 8));\
+                            *(T+2)=(uchar) (((A) >> 16)); } while (0)
+#define int4store(T,A)	*((long *) (T))= (long) (A)
+#define int5store(T,A)  do { *(T)= (uchar)((A));\
+                             *((T)+1)=(uchar) (((A) >> 8));\
+                             *((T)+2)=(uchar) (((A) >> 16));\
+                             *((T)+3)=(uchar) (((A) >> 24)); \
+                             *((T)+4)=(uchar) (((A) >> 32)); } while(0)
+#define int8store(T,A)	*((ulonglong *) (T))= (ulonglong) (A)
+
+typedef union {
+  double v;
+  long m[2];
+} doubleget_union;
+#define doubleget(V,M)	\
+do { doubleget_union _tmp; \
+     _tmp.m[0] = *((long*)(M)); \
+     _tmp.m[1] = *(((long*) (M))+1); \
+     (V) = _tmp.v; } while(0)
+#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \
+			     *(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \
+                         } while (0)
+#define float4get(V,M) do { *((long *) &(V)) = *((long*) (M)); } while(0)
+#define float8get(V,M) doubleget((V),(M))
+#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
+#define floatstore(T,V)  memcpy((byte*)(T), (byte*)(&V),sizeof(float))
+#define floatget(V,M)    memcpy((byte*) &V,(byte*) (M),sizeof(float))
+#define float8store(V,M) doublestore((V),(M))
+#endif /* __i386__ */
+
+#ifndef sint2korr
+/*
+  We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines
+  were done before)
+*/
+#define sint2korr(A)	(int16) (((int16) ((uchar) (A)[0])) +\
+				 ((int16) ((int16) (A)[1]) << 8))
+#define sint3korr(A)	((int32) ((((uchar) (A)[2]) & 128) ? \
+				  (((uint32) 255L << 24) | \
+				   (((uint32) (uchar) (A)[2]) << 16) |\
+				   (((uint32) (uchar) (A)[1]) << 8) | \
+				   ((uint32) (uchar) (A)[0])) : \
+				  (((uint32) (uchar) (A)[2]) << 16) |\
+				  (((uint32) (uchar) (A)[1]) << 8) | \
+				  ((uint32) (uchar) (A)[0])))
+#define sint4korr(A)	(int32) (((int32) ((uchar) (A)[0])) +\
+				(((int32) ((uchar) (A)[1]) << 8)) +\
+				(((int32) ((uchar) (A)[2]) << 16)) +\
+				(((int32) ((int16) (A)[3]) << 24)))
+#define sint8korr(A)	(longlong) uint8korr(A)
+#define uint2korr(A)	(uint16) (((uint16) ((uchar) (A)[0])) +\
+				  ((uint16) ((uchar) (A)[1]) << 8))
+#define uint3korr(A)	(uint32) (((uint32) ((uchar) (A)[0])) +\
+				  (((uint32) ((uchar) (A)[1])) << 8) +\
+				  (((uint32) ((uchar) (A)[2])) << 16))
+#define uint4korr(A)	(uint32) (((uint32) ((uchar) (A)[0])) +\
+				  (((uint32) ((uchar) (A)[1])) << 8) +\
+				  (((uint32) ((uchar) (A)[2])) << 16) +\
+				  (((uint32) ((uchar) (A)[3])) << 24))
+#define uint5korr(A)	((ulonglong)(((uint32) ((uchar) (A)[0])) +\
+				    (((uint32) ((uchar) (A)[1])) << 8) +\
+				    (((uint32) ((uchar) (A)[2])) << 16) +\
+				    (((uint32) ((uchar) (A)[3])) << 24)) +\
+				    (((ulonglong) ((uchar) (A)[4])) << 32))
+#define uint8korr(A)	((ulonglong)(((uint32) ((uchar) (A)[0])) +\
+				    (((uint32) ((uchar) (A)[1])) << 8) +\
+				    (((uint32) ((uchar) (A)[2])) << 16) +\
+				    (((uint32) ((uchar) (A)[3])) << 24)) +\
+			(((ulonglong) (((uint32) ((uchar) (A)[4])) +\
+				    (((uint32) ((uchar) (A)[5])) << 8) +\
+				    (((uint32) ((uchar) (A)[6])) << 16) +\
+				    (((uint32) ((uchar) (A)[7])) << 24))) <<\
+				    32))
+#define int2store(T,A)       do { uint def_temp= (uint) (A) ;\
+                                  *((uchar*) (T))=  (uchar)(def_temp); \
+                                   *((uchar*) (T)+1)=(uchar)((def_temp >> 8)); \
+                             } while(0)
+#define int3store(T,A)       do { /*lint -save -e734 */\
+                                  *((uchar*)(T))=(uchar) ((A));\
+                                  *((uchar*) (T)+1)=(uchar) (((A) >> 8));\
+                                  *((uchar*)(T)+2)=(uchar) (((A) >> 16)); \
+                                  /*lint -restore */} while(0)
+#define int4store(T,A)       do { *((char *)(T))=(char) ((A));\
+                                  *(((char *)(T))+1)=(char) (((A) >> 8));\
+                                  *(((char *)(T))+2)=(char) (((A) >> 16));\
+                                  *(((char *)(T))+3)=(char) (((A) >> 24)); } while(0)
+#define int5store(T,A)       do { *((char *)(T))=((A));\
+                                  *(((char *)(T))+1)=(((A) >> 8));\
+                                  *(((char *)(T))+2)=(((A) >> 16));\
+                                  *(((char *)(T))+3)=(((A) >> 24)); \
+                                  *(((char *)(T))+4)=(((A) >> 32)); } while(0)
+#define int8store(T,A)       do { uint def_temp= (uint) (A), def_temp2= (uint) ((A) >> 32); \
+                                  int4store((T),def_temp); \
+                                  int4store((T+4),def_temp2); } while(0)
+#ifdef WORDS_BIGENDIAN
+#define float4store(T,A) do { *(T)= ((byte *) &A)[3];\
+                              *((T)+1)=(char) ((byte *) &A)[2];\
+                              *((T)+2)=(char) ((byte *) &A)[1];\
+                              *((T)+3)=(char) ((byte *) &A)[0]; } while(0)
+
+#define float4get(V,M)   do { float def_temp;\
+                              ((byte*) &def_temp)[0]=(M)[3];\
+                              ((byte*) &def_temp)[1]=(M)[2];\
+                              ((byte*) &def_temp)[2]=(M)[1];\
+                              ((byte*) &def_temp)[3]=(M)[0];\
+                              (V)=def_temp; } while(0)
+#define float8store(T,V) do { *(T)= ((byte *) &V)[7];\
+                              *((T)+1)=(char) ((byte *) &V)[6];\
+                              *((T)+2)=(char) ((byte *) &V)[5];\
+                              *((T)+3)=(char) ((byte *) &V)[4];\
+                              *((T)+4)=(char) ((byte *) &V)[3];\
+                              *((T)+5)=(char) ((byte *) &V)[2];\
+                              *((T)+6)=(char) ((byte *) &V)[1];\
+                              *((T)+7)=(char) ((byte *) &V)[0]; } while(0)
+
+#define float8get(V,M)   do { double def_temp;\
+                              ((byte*) &def_temp)[0]=(M)[7];\
+                              ((byte*) &def_temp)[1]=(M)[6];\
+                              ((byte*) &def_temp)[2]=(M)[5];\
+                              ((byte*) &def_temp)[3]=(M)[4];\
+                              ((byte*) &def_temp)[4]=(M)[3];\
+                              ((byte*) &def_temp)[5]=(M)[2];\
+                              ((byte*) &def_temp)[6]=(M)[1];\
+                              ((byte*) &def_temp)[7]=(M)[0];\
+                              (V) = def_temp; } while(0)
+#else
+#define float4get(V,M)   memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float))
+#define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float))
+
+#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
+#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((byte *) &V)[4];\
+                              *(((char*)T)+1)=(char) ((byte *) &V)[5];\
+                              *(((char*)T)+2)=(char) ((byte *) &V)[6];\
+                              *(((char*)T)+3)=(char) ((byte *) &V)[7];\
+                              *(((char*)T)+4)=(char) ((byte *) &V)[0];\
+                              *(((char*)T)+5)=(char) ((byte *) &V)[1];\
+                              *(((char*)T)+6)=(char) ((byte *) &V)[2];\
+                              *(((char*)T)+7)=(char) ((byte *) &V)[3]; }\
+                         while(0)
+#define doubleget(V,M)   do { double def_temp;\
+                              ((byte*) &def_temp)[0]=(M)[4];\
+                              ((byte*) &def_temp)[1]=(M)[5];\
+                              ((byte*) &def_temp)[2]=(M)[6];\
+                              ((byte*) &def_temp)[3]=(M)[7];\
+                              ((byte*) &def_temp)[4]=(M)[0];\
+                              ((byte*) &def_temp)[5]=(M)[1];\
+                              ((byte*) &def_temp)[6]=(M)[2];\
+                              ((byte*) &def_temp)[7]=(M)[3];\
+                              (V) = def_temp; } while(0)
+#endif /* __FLOAT_WORD_ORDER */
+
+#define float8get(V,M)   doubleget((V),(M))
+#define float8store(V,M) doublestore((V),(M))
+#endif /* WORDS_BIGENDIAN */
+
+#endif /* sint2korr */
+
+/*
+  Macro for reading 32-bit integer from network byte order (big-endian)
+  from unaligned memory location.
+*/
+#define int4net(A)        (int32) (((uint32) ((uchar) (A)[3]))        |\
+				  (((uint32) ((uchar) (A)[2])) << 8)  |\
+				  (((uint32) ((uchar) (A)[1])) << 16) |\
+				  (((uint32) ((uchar) (A)[0])) << 24))
+/*
+  Define-funktions for reading and storing in machine format from/to
+  short/long to/from some place in memory V should be a (not
+  register) variable, M is a pointer to byte
+*/
+
+#ifdef WORDS_BIGENDIAN
+
+#define ushortget(V,M)  do { V = (uint16) (((uint16) ((uchar) (M)[1]))+\
+                                 ((uint16) ((uint16) (M)[0]) << 8)); } while(0)
+#define shortget(V,M)   do { V = (short) (((short) ((uchar) (M)[1]))+\
+                                 ((short) ((short) (M)[0]) << 8)); } while(0)
+#define longget(V,M)    do { int32 def_temp;\
+                             ((byte*) &def_temp)[0]=(M)[0];\
+                             ((byte*) &def_temp)[1]=(M)[1];\
+                             ((byte*) &def_temp)[2]=(M)[2];\
+                             ((byte*) &def_temp)[3]=(M)[3];\
+                             (V)=def_temp; } while(0)
+#define ulongget(V,M)   do { uint32 def_temp;\
+                            ((byte*) &def_temp)[0]=(M)[0];\
+                            ((byte*) &def_temp)[1]=(M)[1];\
+                            ((byte*) &def_temp)[2]=(M)[2];\
+                            ((byte*) &def_temp)[3]=(M)[3];\
+                            (V)=def_temp; } while(0)
+#define shortstore(T,A) do { uint def_temp=(uint) (A) ;\
+                             *(((char*)T)+1)=(char)(def_temp); \
+                             *(((char*)T)+0)=(char)(def_temp >> 8); } while(0)
+#define longstore(T,A)  do { *(((char*)T)+3)=((A));\
+                             *(((char*)T)+2)=(((A) >> 8));\
+                             *(((char*)T)+1)=(((A) >> 16));\
+                             *(((char*)T)+0)=(((A) >> 24)); } while(0)
+
+#define floatget(V,M)    memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float))
+#define floatstore(T,V)  memcpy_fixed((byte*) (T),(byte*)(&V),sizeof(float))
+#define doubleget(V,M)	 memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double))
+#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double))
+#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong))
+#define longlongstore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(ulonglong))
+
+#else
+
+#define ushortget(V,M)	do { V = uint2korr(M); } while(0)
+#define shortget(V,M)	do { V = sint2korr(M); } while(0)
+#define longget(V,M)	do { V = sint4korr(M); } while(0)
+#define ulongget(V,M)   do { V = uint4korr(M); } while(0)
+#define shortstore(T,V) int2store(T,V)
+#define longstore(T,V)	int4store(T,V)
+#ifndef floatstore
+#define floatstore(T,V)  memcpy_fixed((byte*) (T),(byte*) (&V),sizeof(float))
+#define floatget(V,M)    memcpy_fixed((byte*) &V, (byte*) (M), sizeof(float))
+#endif
+#ifndef doubleget
+#define doubleget(V,M)	 memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double))
+#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double))
+#endif /* doubleget */
+#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong))
+#define longlongstore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(ulonglong))
+
+#endif /* WORDS_BIGENDIAN */
+
+/* sprintf does not always return the number of bytes :- */
+#ifdef SPRINTF_RETURNS_INT
+#define my_sprintf(buff,args) sprintf args
+#else
+#ifdef SPRINTF_RETURNS_PTR
+#define my_sprintf(buff,args) ((int)(sprintf args - buff))
+#else
+#define my_sprintf(buff,args) ((ulong) sprintf args, (ulong) strlen(buff))
+#endif
+#endif
+
+#ifndef THREAD
+#define thread_safe_increment(V,L) (V)++
+#define thread_safe_add(V,C,L)     (V)+=(C)
+#define thread_safe_sub(V,C,L)     (V)-=(C)
+#define statistic_increment(V,L)   (V)++
+#define statistic_add(V,C,L)       (V)+=(C)
+#endif
+
+#ifdef HAVE_CHARSET_utf8
+#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8"
+#else
+#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
+#endif
+
+#if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL)
+#define NO_EMBEDDED_ACCESS_CHECKS
+#endif
+
+#endif /* my_global_h */
diff --git a/src/terralib/drivers/MySQL/include/my_list.h b/src/terralib/drivers/MySQL/include/my_list.h
new file mode 100644
index 0000000..20824e9
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/my_list.h
@@ -0,0 +1,46 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef _list_h_
+#define _list_h_
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+typedef struct st_list {
+  struct st_list *prev,*next;
+  void *data;
+} LIST;
+
+typedef int (*list_walk_action)(void *,void *);
+
+extern LIST *list_add(LIST *root,LIST *element);
+extern LIST *list_delete(LIST *root,LIST *element);
+extern LIST *list_cons(void *data,LIST *root);
+extern LIST *list_reverse(LIST *root);
+extern void list_free(LIST *root,unsigned int free_data);
+extern unsigned int list_length(LIST *);
+extern int list_walk(LIST *,list_walk_action action,gptr argument);
+
+#define list_rest(a) ((a)->next)
+#define list_push(a,b) (a)=list_cons((b),(a))
+#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); }
+
+#ifdef	__cplusplus
+}
+#endif
+#endif
diff --git a/src/terralib/drivers/MySQL/include/my_pthread.h b/src/terralib/drivers/MySQL/include/my_pthread.h
new file mode 100644
index 0000000..15d0651
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/my_pthread.h
@@ -0,0 +1,711 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/* Defines to make different thread packages compatible */
+
+#ifndef _my_pthread_h
+#define _my_pthread_h
+
+#include <errno.h>
+#ifndef ETIME
+#define ETIME ETIMEDOUT				/* For FreeBSD */
+#endif
+
+#ifdef  __cplusplus
+#define EXTERN_C extern "C"
+extern "C" {
+#else
+#define EXTERN_C
+#endif /* __cplusplus */ 
+
+#if defined(__WIN__) || defined(OS2)
+
+#ifdef OS2
+typedef ULONG     HANDLE;
+typedef ULONG     DWORD;
+typedef int sigset_t;
+#endif
+
+#ifdef OS2
+typedef HMTX             pthread_mutex_t;
+#else
+typedef CRITICAL_SECTION pthread_mutex_t;
+#endif
+typedef HANDLE		 pthread_t;
+typedef struct thread_attr {
+    DWORD dwStackSize ;
+    DWORD dwCreatingFlag ;
+    int priority ;
+} pthread_attr_t ;
+
+typedef struct { int dummy; } pthread_condattr_t;
+
+/* Implementation of posix conditions */
+
+typedef struct st_pthread_link {
+  DWORD thread_id;
+  struct st_pthread_link *next;
+} pthread_link;
+
+typedef struct {
+  uint32 waiting;
+#ifdef OS2
+  HEV    semaphore;
+#else
+  HANDLE semaphore;
+#endif
+} pthread_cond_t;
+
+
+#ifndef OS2
+struct timespec {		/* For pthread_cond_timedwait() */
+    time_t tv_sec;
+    long tv_nsec;
+};
+#endif
+
+typedef int pthread_mutexattr_t;
+#define win_pthread_self my_thread_var->pthread_self
+#ifdef OS2
+#define pthread_handler_t EXTERN_C void * _Optlink
+typedef void * (_Optlink *pthread_handler)(void *);
+#else
+#define pthread_handler_t EXTERN_C void * __cdecl
+typedef void * (__cdecl *pthread_handler)(void *);
+#endif
+
+void win_pthread_init(void);
+int win_pthread_setspecific(void *A,void *B,uint length);
+int pthread_create(pthread_t *,pthread_attr_t *,pthread_handler,void *);
+int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr);
+int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
+int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
+			   struct timespec *abstime);
+int pthread_cond_signal(pthread_cond_t *cond);
+int pthread_cond_broadcast(pthread_cond_t *cond);
+int pthread_cond_destroy(pthread_cond_t *cond);
+int pthread_attr_init(pthread_attr_t *connect_att);
+int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack);
+int pthread_attr_setprio(pthread_attr_t *connect_att,int priority);
+int pthread_attr_destroy(pthread_attr_t *connect_att);
+struct tm *localtime_r(const time_t *timep,struct tm *tmp);
+struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
+
+
+void pthread_exit(void *a);	 /* was #define pthread_exit(A) ExitThread(A)*/
+
+#ifndef OS2
+#define ETIMEDOUT 145		    /* Win32 doesn't have this */
+#define getpid() GetCurrentThreadId()
+#endif
+#define pthread_self() win_pthread_self
+#define HAVE_LOCALTIME_R		1
+#define _REENTRANT			1
+#define HAVE_PTHREAD_ATTR_SETSTACKSIZE	1
+
+#ifdef USE_TLS					/* For LIBMYSQL.DLL */
+#undef SAFE_MUTEX				/* This will cause conflicts */
+#define pthread_key(T,V)  DWORD V
+#define pthread_key_create(A,B) ((*A=TlsAlloc())==0xFFFFFFFF)
+#define pthread_key_delete(A) TlsFree(A)
+#define pthread_getspecific(A) (TlsGetValue(A))
+#define my_pthread_getspecific(T,A) ((T) TlsGetValue(A))
+#define my_pthread_getspecific_ptr(T,V) ((T) TlsGetValue(V))
+#define my_pthread_setspecific_ptr(T,V) (!TlsSetValue((T),(V)))
+#define pthread_setspecific(A,B) (!TlsSetValue((A),(B)))
+#else
+#define pthread_key(T,V) __declspec(thread) T V
+#define pthread_key_create(A,B) pthread_dummy(0)
+#define pthread_key_delete(A) pthread_dummy(0)
+#define pthread_getspecific(A) (&(A))
+#define my_pthread_getspecific(T,A) (&(A))
+#define my_pthread_getspecific_ptr(T,V) (V)
+#define my_pthread_setspecific_ptr(T,V) ((T)=(V),0)
+#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A))
+#endif /* USE_TLS */
+
+#define pthread_equal(A,B) ((A) == (B))
+#ifdef OS2
+extern int pthread_mutex_init (pthread_mutex_t *, const pthread_mutexattr_t *);
+extern int pthread_mutex_lock (pthread_mutex_t *);
+extern int pthread_mutex_unlock (pthread_mutex_t *);
+extern int pthread_mutex_destroy (pthread_mutex_t *);
+#define my_pthread_setprio(A,B)  DosSetPriority(PRTYS_THREAD,PRTYC_NOCHANGE, B, A)
+#define pthread_kill(A,B) raise(B)
+#define pthread_exit(A) pthread_dummy()
+#else
+#define pthread_mutex_init(A,B)  (InitializeCriticalSection(A),0)
+#define pthread_mutex_lock(A)	 (EnterCriticalSection(A),0)
+#define pthread_mutex_trylock(A) (WaitForSingleObject((A), 0) == WAIT_TIMEOUT)
+#define pthread_mutex_unlock(A)  LeaveCriticalSection(A)
+#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
+#define my_pthread_setprio(A,B)  SetThreadPriority(GetCurrentThread(), (B))
+#define pthread_kill(A,B) pthread_dummy(0)
+#endif /* OS2 */
+
+/* Dummy defines for easier code */
+#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
+#define my_pthread_attr_setprio(A,B) pthread_attr_setprio(A,B)
+#define pthread_attr_setscope(A,B)
+#define pthread_detach_this_thread()
+#define pthread_condattr_init(A)
+#define pthread_condattr_destroy(A)
+
+/*Irena: compiler does not like this: */
+/*#define my_pthread_getprio(pthread_t thread_id) pthread_dummy(0) */
+#define my_pthread_getprio(thread_id) pthread_dummy(0)
+
+#elif defined(HAVE_UNIXWARE7_THREADS)
+
+#include <thread.h>
+#include <synch.h>
+
+#ifndef _REENTRANT
+#define _REENTRANT
+#endif
+
+#define HAVE_NONPOSIX_SIGWAIT
+#define pthread_t thread_t
+#define pthread_cond_t cond_t
+#define pthread_mutex_t mutex_t
+#define pthread_key_t thread_key_t
+typedef int pthread_attr_t;			/* Needed by Unixware 7.0.0 */
+
+#define pthread_key_create(A,B) thr_keycreate((A),(B))
+#define pthread_key_delete(A) thr_keydelete(A)
+
+#define pthread_handler_t EXTERN_C void *
+#define pthread_key(T,V) pthread_key_t V
+
+void *	my_pthread_getspecific_imp(pthread_key_t key);
+#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
+#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,V)
+
+#define pthread_setspecific(A,B) thr_setspecific(A,B)
+#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,V)
+
+#define pthread_create(A,B,C,D) thr_create(NULL,65536L,(C),(D),THR_DETACHED,(A))
+#define pthread_cond_init(a,b) cond_init((a),USYNC_THREAD,NULL)
+#define pthread_cond_destroy(a) cond_destroy(a)
+#define pthread_cond_signal(a) cond_signal(a)
+#define pthread_cond_wait(a,b) cond_wait((a),(b))
+#define pthread_cond_timedwait(a,b,c) cond_timedwait((a),(b),(c))
+#define pthread_cond_broadcast(a) cond_broadcast(a)
+
+#define pthread_mutex_init(a,b) mutex_init((a),USYNC_THREAD,NULL)
+#define pthread_mutex_lock(a) mutex_lock(a)
+#define pthread_mutex_unlock(a) mutex_unlock(a)
+#define pthread_mutex_destroy(a) mutex_destroy(a)
+
+#define pthread_self() thr_self()
+#define pthread_exit(A) thr_exit(A)
+#define pthread_equal(A,B) (((A) == (B)) ? 1 : 0)
+#define pthread_kill(A,B) thr_kill((A),(B))
+#define HAVE_PTHREAD_KILL
+
+#define pthread_sigmask(A,B,C) thr_sigsetmask((A),(B),(C))
+
+extern int my_sigwait(const sigset_t *set,int *sig);
+
+#define pthread_detach_this_thread() pthread_dummy(0)
+
+#define pthread_attr_init(A) pthread_dummy(0)
+#define pthread_attr_destroy(A) pthread_dummy(0)
+#define pthread_attr_setscope(A,B) pthread_dummy(0)
+#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
+#define my_pthread_setprio(A,B) pthread_dummy (0)
+#define my_pthread_getprio(A) pthread_dummy (0)
+#define my_pthread_attr_setprio(A,B) pthread_dummy(0)
+
+#else /* Normal threads */
+
+#ifdef HAVE_rts_threads
+#define sigwait org_sigwait
+#include <signal.h>
+#undef sigwait
+#endif
+#include <pthread.h>
+#ifndef _REENTRANT
+#define _REENTRANT
+#endif
+#ifdef HAVE_THR_SETCONCURRENCY
+#include <thread.h>			/* Probably solaris */
+#endif
+#ifdef HAVE_SCHED_H
+#include <sched.h>
+#endif
+#ifdef HAVE_SYNCH_H
+#include <synch.h>
+#endif
+#if defined(__EMX__) && (!defined(EMX_PTHREAD_REV) || (EMX_PTHREAD_REV < 2))
+#error Requires at least rev 2 of EMX pthreads library.
+#endif
+
+#ifdef __NETWARE__
+void my_pthread_exit(void *status);
+#define pthread_exit(A) my_pthread_exit(A)
+#endif
+
+extern int my_pthread_getprio(pthread_t thread_id);
+
+#define pthread_key(T,V) pthread_key_t V
+#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
+#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
+#define pthread_detach_this_thread()
+#define pthread_handler_t EXTERN_C void *
+typedef void *(* pthread_handler)(void *);
+
+/* Test first for RTS or FSU threads */
+
+#if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM)
+#define HAVE_rts_threads
+extern int my_pthread_create_detached;
+#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
+#define PTHREAD_CREATE_DETACHED &my_pthread_create_detached
+#define PTHREAD_SCOPE_SYSTEM  PTHREAD_SCOPE_GLOBAL
+#define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_LOCAL
+#define USE_ALARM_THREAD
+#elif defined(HAVE_mit_thread)
+#define USE_ALARM_THREAD
+#undef	HAVE_LOCALTIME_R
+#define HAVE_LOCALTIME_R
+#undef	HAVE_GMTIME_R
+#define HAVE_GMTIME_R
+#undef	HAVE_PTHREAD_ATTR_SETSCOPE
+#define HAVE_PTHREAD_ATTR_SETSCOPE
+#undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE	/* If we are running linux */
+#undef HAVE_RWLOCK_T
+#undef HAVE_RWLOCK_INIT
+#undef HAVE_PTHREAD_RWLOCK_RDLOCK
+#undef HAVE_SNPRINTF
+
+#define my_pthread_attr_setprio(A,B)
+#endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */
+
+#if defined(_BSDI_VERSION) && _BSDI_VERSION < 199910
+int sigwait(sigset_t *set, int *sig);
+#endif
+
+#ifndef HAVE_NONPOSIX_SIGWAIT
+#define my_sigwait(A,B) sigwait((A),(B))
+#else
+int my_sigwait(const sigset_t *set,int *sig);
+#endif
+
+#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT
+#ifndef SAFE_MUTEX
+#define pthread_mutex_init(a,b) my_pthread_mutex_init((a),(b))
+extern int my_pthread_mutex_init(pthread_mutex_t *mp,
+				 const pthread_mutexattr_t *attr);
+#endif /* SAFE_MUTEX */
+#define pthread_cond_init(a,b) my_pthread_cond_init((a),(b))
+extern int my_pthread_cond_init(pthread_cond_t *mp,
+				const pthread_condattr_t *attr);
+#endif /* HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */
+
+#if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK)
+#define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C))
+#endif
+
+#if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX)
+int sigwait(sigset_t *setp, int *sigp);		/* Use our implemention */
+#endif
+
+
+/*
+  We define my_sigset() and use that instead of the system sigset() so that
+  we can favor an implementation based on sigaction(). On some systems, such
+  as Mac OS X, sigset() results in flags such as SA_RESTART being set, and
+  we want to make sure that no such flags are set.
+*/
+#if defined(HAVE_SIGACTION) && !defined(my_sigset)
+#define my_sigset(A,B) do { struct sigaction s; sigset_t set;              \
+                            sigemptyset(&set);                             \
+                            s.sa_handler = (B);                            \
+                            s.sa_mask    = set;                            \
+                            s.sa_flags   = 0;                              \
+                            sigaction((A), &s, (struct sigaction *) NULL); \
+                          } while (0)
+#elif defined(HAVE_SIGSET) && !defined(my_sigset)
+#define my_sigset(A,B) sigset((A),(B))
+#elif !defined(my_sigset)
+#define my_sigset(A,B) signal((A),(B))
+#endif
+
+#ifndef my_pthread_setprio
+#if defined(HAVE_PTHREAD_SETPRIO_NP)		/* FSU threads */
+#define my_pthread_setprio(A,B) pthread_setprio_np((A),(B))
+#elif defined(HAVE_PTHREAD_SETPRIO)
+#define my_pthread_setprio(A,B) pthread_setprio((A),(B))
+#else
+extern void my_pthread_setprio(pthread_t thread_id,int prior);
+#endif
+#endif
+
+#ifndef my_pthread_attr_setprio
+#ifdef HAVE_PTHREAD_ATTR_SETPRIO
+#define my_pthread_attr_setprio(A,B) pthread_attr_setprio((A),(B))
+#else
+extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority);
+#endif
+#endif
+
+#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS)
+#define pthread_attr_setscope(A,B)
+#undef	HAVE_GETHOSTBYADDR_R			/* No definition */
+#endif
+
+#if defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) && !defined(SAFE_MUTEX)
+extern int my_pthread_cond_timedwait(pthread_cond_t *cond,
+				     pthread_mutex_t *mutex,
+				     struct timespec *abstime);
+#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C))
+#endif
+
+#if defined(OS2)
+#define my_pthread_getspecific(T,A) ((T) &(A))
+#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A))
+#elif !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
+#define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B))
+#else
+#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
+void *my_pthread_getspecific_imp(pthread_key_t key);
+#endif /* OS2 */
+
+#ifndef HAVE_LOCALTIME_R
+struct tm *localtime_r(const time_t *clock, struct tm *res);
+#endif
+
+#ifndef HAVE_GMTIME_R
+struct tm *gmtime_r(const time_t *clock, struct tm *res);
+#endif
+
+#ifdef HAVE_PTHREAD_CONDATTR_CREATE
+/* DCE threads on HPUX 10.20 */
+#define pthread_condattr_init pthread_condattr_create
+#define pthread_condattr_destroy pthread_condattr_delete
+#endif
+
+/* FSU THREADS */
+#if !defined(HAVE_PTHREAD_KEY_DELETE) && !defined(pthread_key_delete)
+#define pthread_key_delete(A) pthread_dummy(0)
+#endif
+
+#ifdef HAVE_CTHREADS_WRAPPER			/* For MacOSX */
+#define pthread_cond_destroy(A) pthread_dummy(0)
+#define pthread_mutex_destroy(A) pthread_dummy(0)
+#define pthread_attr_delete(A) pthread_dummy(0)
+#define pthread_condattr_delete(A) pthread_dummy(0)
+#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
+#define pthread_equal(A,B) ((A) == (B))
+#define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b))
+#define pthread_attr_init(A) pthread_attr_create(A)
+#define pthread_attr_destroy(A) pthread_attr_delete(A)
+#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
+#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
+#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
+#define pthread_kill(A,B) pthread_dummy(0)
+#undef	pthread_detach_this_thread
+#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
+#endif
+
+#ifdef HAVE_DARWIN5_THREADS
+#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
+#define pthread_kill(A,B) pthread_dummy(0)
+#define pthread_condattr_init(A) pthread_dummy(0)
+#define pthread_condattr_destroy(A) pthread_dummy(0)
+#undef	pthread_detach_this_thread
+#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
+#endif
+
+#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER)
+/* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */
+#define pthread_key_create(A,B) \
+		pthread_keycreate(A,(B) ?\
+				  (pthread_destructor_t) (B) :\
+				  (pthread_destructor_t) pthread_dummy)
+#define pthread_attr_init(A) pthread_attr_create(A)
+#define pthread_attr_destroy(A) pthread_attr_delete(A)
+#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
+#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
+#ifndef pthread_sigmask
+#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
+#endif
+#define pthread_kill(A,B) pthread_dummy(0)
+#undef	pthread_detach_this_thread
+#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
+#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
+#define HAVE_PTHREAD_KILL
+#endif
+
+#endif /* defined(__WIN__) */
+
+#if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
+#undef pthread_cond_timedwait
+#define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c))
+int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
+			      struct timespec *abstime);
+#endif
+
+#if defined(HPUX10)
+#define pthread_attr_getstacksize(A,B) my_pthread_attr_getstacksize(A,B)
+void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
+#endif
+
+#if defined(HAVE_POSIX1003_4a_MUTEX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
+#undef pthread_mutex_trylock
+#define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a))
+int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
+#endif
+
+	/* safe_mutex adds checking to mutex for easier debugging */
+
+#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY)
+#define SAFE_MUTEX_DETECT_DESTROY
+#endif
+
+typedef struct st_safe_mutex_t
+{
+  pthread_mutex_t global,mutex;
+  const char *file;
+  uint line,count;
+  pthread_t thread;
+#ifdef SAFE_MUTEX_DETECT_DESTROY
+  struct st_safe_mutex_info_t *info;	/* to track destroying of mutexes */
+#endif
+} safe_mutex_t;
+
+#ifdef SAFE_MUTEX_DETECT_DESTROY
+/*
+  Used to track the destroying of mutexes. This needs to be a seperate
+  structure because the safe_mutex_t structure could be freed before
+  the mutexes are destroyed.
+*/
+
+typedef struct st_safe_mutex_info_t
+{
+  struct st_safe_mutex_info_t *next;
+  struct st_safe_mutex_info_t *prev;
+  const char *init_file;
+  uint32 init_line;
+} safe_mutex_info_t;
+#endif /* SAFE_MUTEX_DETECT_DESTROY */
+
+int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr,
+                    const char *file, uint line);
+int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line);
+int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line);
+int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line);
+int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file,
+		   uint line);
+int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
+			struct timespec *abstime, const char *file, uint line);
+void safe_mutex_global_init(void);
+void safe_mutex_end(FILE *file);
+
+	/* Wrappers if safe mutex is actually used */
+#ifdef SAFE_MUTEX
+#undef pthread_mutex_init
+#undef pthread_mutex_lock
+#undef pthread_mutex_unlock
+#undef pthread_mutex_destroy
+#undef pthread_mutex_wait
+#undef pthread_mutex_timedwait
+#undef pthread_mutex_t
+#undef pthread_cond_wait
+#undef pthread_cond_timedwait
+#undef pthread_mutex_trylock
+#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__)
+#define pthread_mutex_lock(A) safe_mutex_lock((A),__FILE__,__LINE__)
+#define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__)
+#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__)
+#define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__)
+#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
+#define pthread_mutex_trylock(A) pthread_mutex_lock(A)
+#define pthread_mutex_t safe_mutex_t
+#define safe_mutex_assert_owner(mp) DBUG_ASSERT((mp)->count > 0 && pthread_equal(pthread_self(),(mp)->thread))
+#else
+#define safe_mutex_assert_owner(mp)
+#endif /* SAFE_MUTEX */
+
+	/* READ-WRITE thread locking */
+
+#ifdef HAVE_BROKEN_RWLOCK			/* For OpenUnix */
+#undef HAVE_PTHREAD_RWLOCK_RDLOCK
+#undef HAVE_RWLOCK_INIT
+#undef HAVE_RWLOCK_T
+#endif
+
+#if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS)
+/* use these defs for simple mutex locking */
+#define rw_lock_t pthread_mutex_t
+#define my_rwlock_init(A,B) pthread_mutex_init((A),(B))
+#define rw_rdlock(A) pthread_mutex_lock((A))
+#define rw_wrlock(A) pthread_mutex_lock((A))
+#define rw_tryrdlock(A) pthread_mutex_trylock((A))
+#define rw_trywrlock(A) pthread_mutex_trylock((A))
+#define rw_unlock(A) pthread_mutex_unlock((A))
+#define rwlock_destroy(A) pthread_mutex_destroy((A))
+#elif defined(HAVE_PTHREAD_RWLOCK_RDLOCK)
+#define rw_lock_t pthread_rwlock_t
+#define my_rwlock_init(A,B) pthread_rwlock_init((A),(B))
+#define rw_rdlock(A) pthread_rwlock_rdlock(A)
+#define rw_wrlock(A) pthread_rwlock_wrlock(A)
+#define rw_tryrdlock(A) pthread_rwlock_tryrdlock((A))
+#define rw_trywrlock(A) pthread_rwlock_trywrlock((A))
+#define rw_unlock(A) pthread_rwlock_unlock(A)
+#define rwlock_destroy(A) pthread_rwlock_destroy(A)
+#elif defined(HAVE_RWLOCK_INIT)
+#ifdef HAVE_RWLOCK_T				/* For example Solaris 2.6-> */
+#define rw_lock_t rwlock_t
+#endif
+#define my_rwlock_init(A,B) rwlock_init((A),USYNC_THREAD,0)
+#else
+/* Use our own version of read/write locks */
+typedef struct _my_rw_lock_t {
+	pthread_mutex_t lock;		/* lock for structure		*/
+	pthread_cond_t	readers;	/* waiting readers		*/
+	pthread_cond_t	writers;	/* waiting writers		*/
+	int		state;		/* -1:writer,0:free,>0:readers	*/
+	int		waiters;	/* number of waiting writers	*/
+} my_rw_lock_t;
+
+#define rw_lock_t my_rw_lock_t
+#define rw_rdlock(A) my_rw_rdlock((A))
+#define rw_wrlock(A) my_rw_wrlock((A))
+#define rw_tryrdlock(A) my_rw_tryrdlock((A))
+#define rw_trywrlock(A) my_rw_trywrlock((A))
+#define rw_unlock(A) my_rw_unlock((A))
+#define rwlock_destroy(A) my_rwlock_destroy((A))
+
+extern int my_rwlock_init(my_rw_lock_t *, void *);
+extern int my_rwlock_destroy(my_rw_lock_t *);
+extern int my_rw_rdlock(my_rw_lock_t *);
+extern int my_rw_wrlock(my_rw_lock_t *);
+extern int my_rw_unlock(my_rw_lock_t *);
+extern int my_rw_tryrdlock(my_rw_lock_t *);
+extern int my_rw_trywrlock(my_rw_lock_t *);
+#endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */
+
+#define GETHOSTBYADDR_BUFF_SIZE 2048
+
+#ifndef HAVE_THR_SETCONCURRENCY
+#define thr_setconcurrency(A) pthread_dummy(0)
+#endif
+#if !defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && ! defined(pthread_attr_setstacksize)
+#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
+#endif
+
+/* Define mutex types, see my_thr_init.c */
+#define MY_MUTEX_INIT_SLOW   NULL
+#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+extern pthread_mutexattr_t my_fast_mutexattr;
+#define MY_MUTEX_INIT_FAST &my_fast_mutexattr
+#else
+#define MY_MUTEX_INIT_FAST   NULL
+#endif
+#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+extern pthread_mutexattr_t my_errorcheck_mutexattr;
+#define MY_MUTEX_INIT_ERRCHK &my_errorcheck_mutexattr
+#else
+#define MY_MUTEX_INIT_ERRCHK   NULL
+#endif
+
+extern my_bool my_thread_global_init(void);
+extern void my_thread_global_end(void);
+extern my_bool my_thread_init(void);
+extern void my_thread_end(void);
+extern const char *my_thread_name(void);
+extern long my_thread_id(void);
+extern int pthread_no_free(void *);
+extern int pthread_dummy(int);
+
+/* All thread specific variables are in the following struct */
+
+#define THREAD_NAME_SIZE 10
+#ifndef DEFAULT_THREAD_STACK
+#if defined(__ia64__)
+/*
+  MySQL can survive with 32K, but some glibc libraries require > 128K stack
+  To resolve hostnames
+*/
+#define DEFAULT_THREAD_STACK	(256*1024L)
+#else
+#define DEFAULT_THREAD_STACK	(192*1024)
+#endif
+#endif
+
+struct st_my_thread_var
+{
+  int thr_errno;
+  pthread_cond_t suspend;
+  pthread_mutex_t mutex;
+  pthread_mutex_t * volatile current_mutex;
+  pthread_cond_t * volatile current_cond;
+  pthread_t pthread_self;
+  long id;
+  int cmp_length;
+  int volatile abort;
+  my_bool init;
+  struct st_my_thread_var *next,**prev;
+  void *opt_info;
+#ifndef DBUG_OFF
+  gptr dbug;
+  char name[THREAD_NAME_SIZE+1];
+#endif
+};
+
+extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const));
+#define my_thread_var (_my_thread_var())
+#define my_errno my_thread_var->thr_errno
+/*
+  Keep track of shutdown,signal, and main threads so that my_end() will not
+  report errors with them
+*/
+extern pthread_t shutdown_th, main_th, signal_th;
+
+	/* statistics_xxx functions are for not essential statistic */
+
+#ifndef thread_safe_increment
+#ifdef HAVE_ATOMIC_ADD
+#define thread_safe_increment(V,L) atomic_inc((atomic_t*) &V)
+#define thread_safe_decrement(V,L) atomic_dec((atomic_t*) &V)
+#define thread_safe_add(V,C,L)     atomic_add((C),(atomic_t*) &V)
+#define thread_safe_sub(V,C,L)     atomic_sub((C),(atomic_t*) &V)
+#else
+#define thread_safe_increment(V,L) \
+        (pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L)))
+#define thread_safe_decrement(V,L) \
+        (pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L)))
+#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L)))
+#define thread_safe_sub(V,C,L) \
+        (pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
+#endif /* HAVE_ATOMIC_ADD */
+#ifdef SAFE_STATISTICS
+#define statistic_increment(V,L)   thread_safe_increment((V),(L))
+#define statistic_decrement(V,L)   thread_safe_decrement((V),(L))
+#define statistic_add(V,C,L)       thread_safe_add((V),(C),(L))
+#else
+#define statistic_decrement(V,L) (V)--
+#define statistic_increment(V,L) (V)++
+#define statistic_add(V,C,L)     (V)+=(C)
+#endif /* SAFE_STATISTICS */
+#endif /* thread_safe_increment */
+
+#ifdef  __cplusplus
+}
+#endif
+#endif /* _my_ptread_h */
diff --git a/src/terralib/drivers/MySQL/include/my_sys.h b/src/terralib/drivers/MySQL/include/my_sys.h
new file mode 100644
index 0000000..505c9d0
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/my_sys.h
@@ -0,0 +1,903 @@
+/* Copyright (C) 2000-2003 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef _my_sys_h
+#define _my_sys_h
+C_MODE_START
+
+#ifdef HAVE_AIOWAIT
+#include <sys/asynch.h>			/* Used by record-cache */
+typedef struct my_aio_result {
+  aio_result_t result;
+  int	       pending;
+} my_aio_result;
+#endif
+
+#ifndef THREAD
+extern int NEAR my_errno;		/* Last error in mysys */
+#else
+#include <my_pthread.h>
+#endif
+
+#ifndef _m_ctype_h
+#include <m_ctype.h>                    /* for CHARSET_INFO */
+#endif
+
+#include <stdarg.h>
+#include <typelib.h>
+
+#define MYSYS_PROGRAM_USES_CURSES()  { error_handler_hook = my_message_curses;	mysys_uses_curses=1; }
+#define MYSYS_PROGRAM_DONT_USE_CURSES()  { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
+#define MY_INIT(name);		{ my_progname= name; my_init(); }
+
+#define ERRMSGSIZE	(SC_MAXWIDTH)	/* Max length of a error message */
+#define NRERRBUFFS	(2)	/* Buffers for parameters */
+#define MY_FILE_ERROR	((uint) ~0)
+
+	/* General bitmaps for my_func's */
+#define MY_FFNF		1	/* Fatal if file not found */
+#define MY_FNABP	2	/* Fatal if not all bytes read/writen */
+#define MY_NABP		4	/* Error if not all bytes read/writen */
+#define MY_FAE		8	/* Fatal if any error */
+#define MY_WME		16	/* Write message on error */
+#define MY_WAIT_IF_FULL 32	/* Wait and try again if disk full error */
+#define MY_IGNORE_BADFD 32      /* my_sync: ignore 'bad descriptor' errors */
+#define MY_RAID         64      /* Support for RAID */
+#define MY_FULL_IO     512      /* For my_read - loop intil I/O is complete */
+#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
+#define MY_LINK_WARNING 32	/* my_redel() gives warning if links */
+#define MY_COPYTIME	64	/* my_redel() copys time */
+#define MY_DELETE_OLD	256	/* my_create_with_symlink() */
+#define MY_RESOLVE_LINK 128	/* my_realpath(); Only resolve links */
+#define MY_HOLD_ORIGINAL_MODES 128  /* my_copy() holds to file modes */
+#define MY_REDEL_MAKE_BACKUP 256
+#define MY_SEEK_NOT_DONE 32	/* my_lock may have to do a seek */
+#define MY_DONT_WAIT	64	/* my_lock() don't wait if can't lock */
+#define MY_ZEROFILL	32	/* my_malloc(), fill array with zero */
+#define MY_ALLOW_ZERO_PTR 64	/* my_realloc() ; zero ptr -> malloc */
+#define MY_FREE_ON_ERROR 128	/* my_realloc() ; Free old ptr on error */
+#define MY_HOLD_ON_ERROR 256	/* my_realloc() ; Return old ptr on error */
+#define MY_THREADSAFE	128	/* pread/pwrite:  Don't allow interrupts */
+#define MY_DONT_OVERWRITE_FILE 1024	/* my_copy: Don't overwrite file */
+
+#define MY_CHECK_ERROR	1	/* Params to my_end; Check open-close */
+#define MY_GIVE_INFO	2	/* Give time info about process*/
+
+#define ME_HIGHBYTE	8	/* Shift for colours */
+#define ME_NOCUR	1	/* Don't use curses message */
+#define ME_OLDWIN	2	/* Use old window */
+#define ME_BELL		4	/* Ring bell then printing message */
+#define ME_HOLDTANG	8	/* Don't delete last keys */
+#define ME_WAITTOT	16	/* Wait for errtime secs of for a action */
+#define ME_WAITTANG	32	/* Wait for a user action  */
+#define ME_NOREFRESH	64	/* Dont refresh screen */
+#define ME_NOINPUT	128	/* Dont use the input libary */
+#define ME_COLOUR1	((1 << ME_HIGHBYTE))	/* Possibly error-colours */
+#define ME_COLOUR2	((2 << ME_HIGHBYTE))
+#define ME_COLOUR3	((3 << ME_HIGHBYTE))
+
+	/* Bits in last argument to fn_format */
+#define MY_REPLACE_DIR		1	/* replace dir in name with 'dir' */
+#define MY_REPLACE_EXT		2	/* replace extension with 'ext' */
+#define MY_UNPACK_FILENAME	4	/* Unpack name (~ -> home) */
+#define MY_PACK_FILENAME	8	/* Pack name (home -> ~) */
+#define MY_RESOLVE_SYMLINKS	16	/* Resolve all symbolic links */
+#define MY_RETURN_REAL_PATH	32	/* return full path for file */
+#define MY_SAFE_PATH		64	/* Return NULL if too long path */
+#define MY_RELATIVE_PATH	128	/* name is relative to 'dir' */
+
+	/* My seek flags */
+#define MY_SEEK_SET	0
+#define MY_SEEK_CUR	1
+#define MY_SEEK_END	2
+
+	/* Some constants */
+#define MY_WAIT_FOR_USER_TO_FIX_PANIC	60	/* in seconds */
+#define MY_WAIT_GIVE_USER_A_MESSAGE	10	/* Every 10 times of prev */
+#define MIN_COMPRESS_LENGTH		50	/* Don't compress small bl. */
+#define DFLT_INIT_HITS  3
+
+	/* root_alloc flags */
+#define MY_KEEP_PREALLOC	1
+#define MY_MARK_BLOCKS_FREE     2  /* move used to free list and reuse them */
+
+	/* Internal error numbers (for assembler functions) */
+#define MY_ERRNO_EDOM		33
+#define MY_ERRNO_ERANGE		34
+
+	/* Bits for get_date timeflag */
+#define GETDATE_DATE_TIME	1
+#define GETDATE_SHORT_DATE	2
+#define GETDATE_HHMMSSTIME	4
+#define GETDATE_GMT		8
+#define GETDATE_FIXEDLENGTH	16
+
+	/* defines when allocating data */
+#ifdef SAFEMALLOC
+#define my_malloc(SZ,FLAG) _mymalloc((SZ), __FILE__, __LINE__, FLAG )
+#define my_malloc_ci(SZ,FLAG) _mymalloc((SZ), sFile, uLine, FLAG )
+#define my_realloc(PTR,SZ,FLAG) _myrealloc((PTR), (SZ), __FILE__, __LINE__, FLAG )
+#define my_checkmalloc() _sanity( __FILE__, __LINE__ )
+#define my_free(PTR,FLAG) _myfree((PTR), __FILE__, __LINE__,FLAG)
+#define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C)
+#define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C)
+#define my_strdup_with_length(A,B,C) _my_strdup_with_length((A),(B),__FILE__,__LINE__,C)
+#define TRASH(A,B) bfill(A, B, 0x8F)
+#define QUICK_SAFEMALLOC sf_malloc_quick=1
+#define NORMAL_SAFEMALLOC sf_malloc_quick=0
+extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick;
+extern ulonglong sf_malloc_mem_limit;
+
+#define CALLER_INFO_PROTO   , const char *sFile, uint uLine
+#define CALLER_INFO         , __FILE__, __LINE__
+#define ORIG_CALLER_INFO    , sFile, uLine
+#else
+#define my_checkmalloc()
+#undef TERMINATE
+#define TERMINATE(A) {}
+#define QUICK_SAFEMALLOC
+#define NORMAL_SAFEMALLOC
+extern gptr my_malloc(uint Size,myf MyFlags);
+#define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG )
+extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags);
+extern void my_no_flags_free(gptr ptr);
+extern gptr my_memdup(const byte *from,uint length,myf MyFlags);
+extern char *my_strdup(const char *from,myf MyFlags);
+extern char *my_strdup_with_length(const byte *from, uint length,
+				   myf MyFlags);
+/* we do use FG (as a no-op) in below so that a typo on FG is caught */
+#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR))
+#define CALLER_INFO_PROTO   /* nothing */
+#define CALLER_INFO         /* nothing */
+#define ORIG_CALLER_INFO    /* nothing */
+#define TRASH(A,B) /* nothing */
+#endif
+
+#ifdef HAVE_LARGE_PAGES
+extern uint my_get_large_page_size(void);
+extern gptr my_large_malloc(uint size, myf my_flags);
+extern void my_large_free(gptr ptr, myf my_flags);
+#else
+#define my_get_large_page_size() (0)
+#define my_large_malloc(A,B) my_malloc_lock((A),(B))
+#define my_large_free(A,B) my_free_lock((A),(B))
+#endif /* HAVE_LARGE_PAGES */
+
+#ifdef HAVE_ALLOCA
+#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
+#pragma alloca
+#endif /* _AIX */
+#if defined(__MWERKS__)
+#undef alloca
+#define alloca _alloca
+#endif /* __MWERKS__ */
+#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca)
+#define alloca __builtin_alloca
+#endif /* GNUC */
+#define my_alloca(SZ) alloca((size_t) (SZ))
+#define my_afree(PTR) {}
+#else
+#define my_alloca(SZ) my_malloc(SZ,MYF(0))
+#define my_afree(PTR) my_free(PTR,MYF(MY_WME))
+#endif /* HAVE_ALLOCA */
+
+#ifdef MSDOS
+#ifdef __ZTC__
+void * __CDECL halloc(long count,size_t length);
+void   __CDECL hfree(void *ptr);
+#endif
+#if defined(USE_HALLOC)
+#if defined(_VCM_) || defined(M_IC80386)
+#undef USE_HALLOC
+#endif
+#endif
+#ifdef USE_HALLOC
+#define malloc(a) halloc((long) (a),1)
+#define free(a) hfree(a)
+#endif
+#endif /* MSDOS */
+
+#ifndef errno				/* did we already get it? */
+#ifdef HAVE_ERRNO_AS_DEFINE
+#include <errno.h>			/* errno is a define */
+#else
+extern int errno;			/* declare errno */
+#endif
+#endif					/* #ifndef errno */
+extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
+extern char *home_dir;			/* Home directory for user */
+extern const char *my_progname;		/* program-name (printed in errors) */
+extern char NEAR curr_dir[];		/* Current directory for user */
+extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
+extern int (*fatal_error_handler_hook)(uint my_err, const char *str,
+				       myf MyFlags);
+extern uint my_file_limit;
+
+#ifdef HAVE_LARGE_PAGES
+extern my_bool my_use_large_pages;
+extern uint    my_large_page_size;
+#endif
+
+/* charsets */
+extern CHARSET_INFO *default_charset_info;
+extern CHARSET_INFO *all_charsets[256];
+extern CHARSET_INFO compiled_charsets[];
+
+/* statistics */
+extern ulong	my_file_opened,my_stream_opened, my_tmp_file_created;
+extern uint	mysys_usage_id;
+extern my_bool	my_init_done;
+
+					/* Point to current my_message() */
+extern void (*my_sigtstp_cleanup)(void),
+					/* Executed before jump to shell */
+	    (*my_sigtstp_restart)(void),
+	    (*my_abort_hook)(int);
+					/* Executed when comming from shell */
+extern int NEAR my_umask,		/* Default creation mask  */
+	   NEAR my_umask_dir,
+	   NEAR my_recived_signals,	/* Signals we have got */
+	   NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
+	   NEAR my_dont_interrupt;	/* call remember_intr when set */
+extern my_bool NEAR mysys_uses_curses, my_use_symdir;
+extern ulong sf_malloc_cur_memory, sf_malloc_max_memory;
+
+extern ulong	my_default_record_cache_size;
+extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io,
+               NEAR my_disable_flush_key_blocks, NEAR my_disable_symlinks;
+extern char	wild_many,wild_one,wild_prefix;
+extern const char *charsets_dir;
+extern char *defaults_extra_file;
+extern const char *defaults_group_suffix;
+extern const char *defaults_file;
+
+extern my_bool timed_mutexes;
+
+typedef struct wild_file_pack	/* Struct to hold info when selecting files */
+{
+  uint		wilds;		/* How many wildcards */
+  uint		not_pos;	/* Start of not-theese-files */
+  my_string	*wild;		/* Pointer to wildcards */
+} WF_PACK;
+
+enum loglevel {
+   ERROR_LEVEL,
+   WARNING_LEVEL,
+   INFORMATION_LEVEL
+};
+
+enum cache_type
+{
+  TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE,
+  SEQ_READ_APPEND		/* sequential read or append */,
+  READ_FIFO, READ_NET,WRITE_NET};
+
+enum flush_type
+{
+  FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE
+};
+
+typedef struct st_record_cache	/* Used when cacheing records */
+{
+  File file;
+  int	rc_seek,error,inited;
+  uint	rc_length,read_length,reclength;
+  my_off_t rc_record_pos,end_of_file;
+  byte	*rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos;
+#ifdef HAVE_AIOWAIT
+  int	use_async_io;
+  my_aio_result aio_result;
+#endif
+  enum cache_type type;
+} RECORD_CACHE;
+
+enum file_type
+{
+  UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN,
+  FILE_BY_MKSTEMP, FILE_BY_DUP
+};
+
+struct st_my_file_info
+{
+  my_string		name;
+  enum file_type	type;
+#if defined(THREAD) && !defined(HAVE_PREAD)
+  pthread_mutex_t	mutex;
+#endif
+};
+
+extern struct st_my_file_info *my_file_info;
+
+typedef struct st_my_tmpdir
+{
+  char **list;
+  uint cur, max;
+#ifdef THREAD
+  pthread_mutex_t mutex;
+#endif
+} MY_TMPDIR;
+
+typedef struct st_dynamic_array
+{
+  char *buffer;
+  uint elements,max_element;
+  uint alloc_increment;
+  uint size_of_element;
+} DYNAMIC_ARRAY;
+
+typedef struct st_dynamic_string
+{
+  char *str;
+  uint length,max_length,alloc_increment;
+} DYNAMIC_STRING;
+
+struct st_io_cache;
+typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
+
+#ifdef THREAD
+typedef struct st_io_cache_share
+{
+  /* to sync on reads into buffer */
+  pthread_mutex_t mutex;
+  pthread_cond_t  cond;
+  int             count, total;
+  /* actual IO_CACHE that filled the buffer */
+  struct st_io_cache *active;
+#ifdef NOT_YET_IMPLEMENTED
+  /* whether the structure should be free'd */
+  my_bool alloced;
+#endif
+} IO_CACHE_SHARE;
+#endif
+
+typedef struct st_io_cache		/* Used when cacheing files */
+{
+  /* Offset in file corresponding to the first byte of byte* buffer. */
+  my_off_t pos_in_file;
+  /*
+    The offset of end of file for READ_CACHE and WRITE_CACHE.
+    For SEQ_READ_APPEND it the maximum of the actual end of file and
+    the position represented by read_end.
+  */
+  my_off_t end_of_file;
+  /* Points to current read position in the buffer */
+  byte	*read_pos;
+  /* the non-inclusive boundary in the buffer for the currently valid read */
+  byte  *read_end;
+  byte  *buffer;				/* The read buffer */
+  /* Used in ASYNC_IO */
+  byte  *request_pos;
+
+  /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */
+  byte  *write_buffer;
+  /*
+    Only used in SEQ_READ_APPEND, and points to the current read position
+    in the write buffer. Note that reads in SEQ_READ_APPEND caches can
+    happen from both read buffer (byte* buffer) and write buffer
+    (byte* write_buffer).
+  */
+  byte *append_read_pos;
+  /* Points to current write position in the write buffer */
+  byte *write_pos;
+  /* The non-inclusive boundary of the valid write area */
+  byte *write_end;
+
+  /*
+    Current_pos and current_end are convenience variables used by
+    my_b_tell() and other routines that need to know the current offset
+    current_pos points to &write_pos, and current_end to &write_end in a
+    WRITE_CACHE, and &read_pos and &read_end respectively otherwise
+  */
+  byte  **current_pos, **current_end;
+#ifdef THREAD
+  /*
+    The lock is for append buffer used in SEQ_READ_APPEND cache
+    need mutex copying from append buffer to read buffer.
+  */
+  pthread_mutex_t append_buffer_lock;
+  /*
+    The following is used when several threads are reading the
+    same file in parallel. They are synchronized on disk
+    accesses reading the cached part of the file asynchronously.
+    It should be set to NULL to disable the feature.  Only
+    READ_CACHE mode is supported.
+  */
+  IO_CACHE_SHARE *share;
+#endif
+  /*
+    A caller will use my_b_read() macro to read from the cache
+    if the data is already in cache, it will be simply copied with
+    memcpy() and internal variables will be accordinging updated with
+    no functions invoked. However, if the data is not fully in the cache,
+    my_b_read() will call read_function to fetch the data. read_function
+    must never be invoked directly.
+  */
+  int (*read_function)(struct st_io_cache *,byte *,uint);
+  /*
+    Same idea as in the case of read_function, except my_b_write() needs to
+    be replaced with my_b_append() for a SEQ_READ_APPEND cache
+  */
+  int (*write_function)(struct st_io_cache *,const byte *,uint);
+  /*
+    Specifies the type of the cache. Depending on the type of the cache
+    certain operations might not be available and yield unpredicatable
+    results. Details to be documented later
+  */
+  enum cache_type type;
+  /*
+    Callbacks when the actual read I/O happens. These were added and
+    are currently used for binary logging of LOAD DATA INFILE - when a
+    block is read from the file, we create a block create/append event, and
+    when IO_CACHE is closed, we create an end event. These functions could,
+    of course be used for other things
+  */
+  IO_CACHE_CALLBACK pre_read;
+  IO_CACHE_CALLBACK post_read;
+  IO_CACHE_CALLBACK pre_close;
+  /*
+    Counts the number of times, when we were forced to use disk. We use it to
+    increase the binlog_cache_disk_use status variable.
+  */
+  ulong disk_writes;
+  void* arg;				/* for use by pre/post_read */
+  char *file_name;			/* if used with 'open_cached_file' */
+  char *dir,*prefix;
+  File file; /* file descriptor */
+  /*
+    seek_not_done is set by my_b_seek() to inform the upcoming read/write
+    operation that a seek needs to be preformed prior to the actual I/O
+    error is 0 if the cache operation was successful, -1 if there was a
+    "hard" error, and the actual number of I/O-ed bytes if the read/write was
+    partial.
+  */
+  int	seek_not_done,error;
+  /* buffer_length is memory size allocated for buffer or write_buffer */
+  uint	buffer_length;
+  /* read_length is the same as buffer_length except when we use async io */
+  uint  read_length;
+  myf	myflags;			/* Flags used to my_read/my_write */
+  /*
+    alloced_buffer is 1 if the buffer was allocated by init_io_cache() and
+    0 if it was supplied by the user.
+    Currently READ_NET is the only one that will use a buffer allocated
+    somewhere else
+  */
+  my_bool alloced_buffer;
+#ifdef HAVE_AIOWAIT
+  /*
+    As inidicated by ifdef, this is for async I/O, which is not currently
+    used (because it's not reliable on all systems)
+  */
+  uint inited;
+  my_off_t aio_read_pos;
+  my_aio_result aio_result;
+#endif
+} IO_CACHE;
+
+typedef int (*qsort2_cmp)(const void *, const void *, const void *);
+
+	/* defines for mf_iocache */
+
+	/* Test if buffer is inited */
+#define my_b_clear(info) (info)->buffer=0
+#define my_b_inited(info) (info)->buffer
+#define my_b_EOF INT_MIN
+
+#define my_b_read(info,Buffer,Count) \
+  ((info)->read_pos + (Count) <= (info)->read_end ?\
+   (memcpy(Buffer,(info)->read_pos,(size_t) (Count)), \
+    ((info)->read_pos+=(Count)),0) :\
+   (*(info)->read_function)((info),Buffer,Count))
+
+#define my_b_write(info,Buffer,Count) \
+ ((info)->write_pos + (Count) <=(info)->write_end ?\
+  (memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\
+   ((info)->write_pos+=(Count)),0) : \
+   (*(info)->write_function)((info),(Buffer),(Count)))
+
+#define my_b_get(info) \
+  ((info)->read_pos != (info)->read_end ?\
+   ((info)->read_pos++, (int) (uchar) (info)->read_pos[-1]) :\
+   _my_b_get(info))
+
+	/* my_b_write_byte dosn't have any err-check */
+#define my_b_write_byte(info,chr) \
+  (((info)->write_pos < (info)->write_end) ?\
+   ((*(info)->write_pos++)=(chr)) :\
+   (_my_b_write(info,0,0) , ((*(info)->write_pos++)=(chr))))
+
+#define my_b_fill_cache(info) \
+  (((info)->read_end=(info)->read_pos),(*(info)->read_function)(info,0,0))
+
+#define my_b_tell(info) ((info)->pos_in_file + \
+			 (uint) (*(info)->current_pos - (info)->request_pos))
+
+/* tell write offset in the SEQ_APPEND cache */
+my_off_t my_b_append_tell(IO_CACHE* info);
+my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */
+
+#define my_b_bytes_in_cache(info) (uint) (*(info)->current_end - \
+					  *(info)->current_pos)
+
+typedef uint32 ha_checksum;
+
+/* Define the type of function to be passed to process_default_option_files */
+typedef int (*Process_option_func)(void *ctx, const char *group_name,
+                                   const char *option);
+
+#include <my_alloc.h>
+
+	/* Prototypes for mysys and my_func functions */
+
+extern int my_copy(const char *from,const char *to,myf MyFlags);
+extern int my_append(const char *from,const char *to,myf MyFlags);
+extern int my_delete(const char *name,myf MyFlags);
+extern int my_getwd(my_string buf,uint size,myf MyFlags);
+extern int my_setwd(const char *dir,myf MyFlags);
+extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags);
+extern gptr my_once_alloc(uint Size,myf MyFlags);
+extern void my_once_free(void);
+extern char *my_once_strdup(const char *src,myf myflags);
+extern char *my_once_memdup(const char *src, uint len, myf myflags);
+extern File my_open(const char *FileName,int Flags,myf MyFlags);
+extern File my_register_filename(File fd, const char *FileName,
+				 enum file_type type_of_file,
+				 uint error_message_number, myf MyFlags);
+extern File my_create(const char *FileName,int CreateFlags,
+		      int AccsesFlags, myf MyFlags);
+extern int my_close(File Filedes,myf MyFlags);
+extern File my_dup(File file, myf MyFlags);
+extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
+extern int my_readlink(char *to, const char *filename, myf MyFlags);
+extern int my_realpath(char *to, const char *filename, myf MyFlags);
+extern File my_create_with_symlink(const char *linkname, const char *filename,
+				   int createflags, int access_flags,
+				   myf MyFlags);
+extern int my_delete_with_symlink(const char *name, myf MyFlags);
+extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags);
+extern int my_symlink(const char *content, const char *linkname, myf MyFlags);
+extern uint my_read(File Filedes,byte *Buffer,uint Count,myf MyFlags);
+extern uint my_pread(File Filedes,byte *Buffer,uint Count,my_off_t offset,
+		     myf MyFlags);
+extern int my_rename(const char *from,const char *to,myf MyFlags);
+extern my_off_t my_seek(File fd,my_off_t pos,int whence,myf MyFlags);
+extern my_off_t my_tell(File fd,myf MyFlags);
+extern uint my_write(File Filedes,const byte *Buffer,uint Count,
+		     myf MyFlags);
+extern uint my_pwrite(File Filedes,const byte *Buffer,uint Count,
+		      my_off_t offset,myf MyFlags);
+extern uint my_fread(FILE *stream,byte *Buffer,uint Count,myf MyFlags);
+extern uint my_fwrite(FILE *stream,const byte *Buffer,uint Count,
+		      myf MyFlags);
+extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags);
+extern my_off_t my_ftell(FILE *stream,myf MyFlags);
+extern gptr _mymalloc(uint uSize,const char *sFile,
+		      uint uLine, myf MyFlag);
+extern gptr _myrealloc(gptr pPtr,uint uSize,const char *sFile,
+		       uint uLine, myf MyFlag);
+extern gptr my_multi_malloc _VARARGS((myf MyFlags, ...));
+extern void _myfree(gptr pPtr,const char *sFile,uint uLine, myf MyFlag);
+extern int _sanity(const char *sFile,unsigned int uLine);
+extern gptr _my_memdup(const byte *from,uint length,
+		       const char *sFile, uint uLine,myf MyFlag);
+extern my_string _my_strdup(const char *from, const char *sFile, uint uLine,
+			    myf MyFlag);
+extern char *_my_strdup_with_length(const byte *from, uint length,
+				    const char *sFile, uint uLine,
+				    myf MyFlag);
+
+#ifdef __WIN__
+extern int my_access(const char *path, int amode);
+#else
+#define my_access access
+#endif
+extern int check_if_legal_filename(const char *path);
+
+#ifndef TERMINATE
+extern void TERMINATE(FILE *file);
+#endif
+extern void init_glob_errs(void);
+extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
+extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
+extern int my_fclose(FILE *fd,myf MyFlags);
+extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
+extern int my_sync(File fd, myf my_flags);
+extern int my_error _VARARGS((int nr,myf MyFlags, ...));
+extern int my_printf_error _VARARGS((uint my_err, const char *format,
+				     myf MyFlags, ...)
+				    __attribute__ ((format (printf, 2, 4))));
+extern int my_error_register(const char **errmsgs, int first, int last);
+extern const char **my_error_unregister(int first, int last);
+extern int my_message(uint my_err, const char *str,myf MyFlags);
+extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags);
+extern int my_message_curses(uint my_err, const char *str,myf MyFlags);
+extern my_bool my_init(void);
+extern void my_end(int infoflag);
+extern int my_redel(const char *from, const char *to, int MyFlags);
+extern int my_copystat(const char *from, const char *to, int MyFlags);
+extern my_string my_filename(File fd);
+
+#ifndef THREAD
+extern void dont_break(void);
+extern void allow_break(void);
+#else
+#define dont_break()
+#define allow_break()
+#endif
+
+extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist);
+extern char *my_tmpdir(MY_TMPDIR *tmpdir);
+extern void free_tmpdir(MY_TMPDIR *tmpdir);
+
+extern void my_remember_signal(int signal_number,sig_handler (*func)(int));
+extern uint dirname_part(my_string to,const char *name);
+extern uint dirname_length(const char *name);
+#define base_name(A) (A+dirname_length(A))
+extern int test_if_hard_path(const char *dir_name);
+extern my_bool has_path(const char *name);
+extern char *convert_dirname(char *to, const char *from, const char *from_end);
+extern void to_unix_path(my_string name);
+extern my_string fn_ext(const char *name);
+extern my_string fn_same(my_string toname,const char *name,int flag);
+extern my_string fn_format(my_string to,const char *name,const char *dir,
+			   const char *form, uint flag);
+extern size_s strlength(const char *str);
+extern void pack_dirname(my_string to,const char *from);
+extern uint unpack_dirname(my_string to,const char *from);
+extern uint cleanup_dirname(my_string to,const char *from);
+extern uint system_filename(my_string to,const char *from);
+extern uint unpack_filename(my_string to,const char *from);
+extern my_string intern_filename(my_string to,const char *from);
+extern my_string directory_file_name(my_string dst, const char *src);
+extern int pack_filename(my_string to, const char *name, size_s max_length);
+extern my_string my_path(my_string to,const char *progname,
+			 const char *own_pathname_part);
+extern my_string my_load_path(my_string to, const char *path,
+			      const char *own_path_prefix);
+extern int wild_compare(const char *str,const char *wildstr,pbool str_is_pattern);
+extern WF_PACK *wf_comp(my_string str);
+extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
+extern void wf_end(struct wild_file_pack *buffer);
+extern size_s strip_sp(my_string str);
+extern void get_date(my_string to,int timeflag,time_t use_time);
+extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,pbool remove_garbage);
+extern int init_record_cache(RECORD_CACHE *info,uint cachesize,File file,
+			     uint reclength,enum cache_type type,
+			     pbool use_async_io);
+extern int read_cache_record(RECORD_CACHE *info,byte *to);
+extern int end_record_cache(RECORD_CACHE *info);
+extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos,
+			      const byte *record,uint length);
+extern int flush_write_cache(RECORD_CACHE *info);
+extern long my_clock(void);
+extern sig_handler sigtstp_handler(int signal_number);
+extern void handle_recived_signals(void);
+
+extern sig_handler my_set_alarm_variable(int signo);
+extern void my_string_ptr_sort(void *base,uint items,size_s size);
+extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
+				  size_s size_of_element,uchar *buffer[]);
+extern qsort_t qsort2(void *base_ptr, size_t total_elems, size_t size,
+		      qsort2_cmp cmp, void *cmp_argument);
+extern qsort2_cmp get_ptr_compare(uint);
+void my_store_ptr(byte *buff, uint pack_length, my_off_t pos);
+my_off_t my_get_ptr(byte *ptr, uint pack_length);
+extern int init_io_cache(IO_CACHE *info,File file,uint cachesize,
+			 enum cache_type type,my_off_t seek_offset,
+			 pbool use_async_io, myf cache_myflags);
+extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
+			       my_off_t seek_offset,pbool use_async_io,
+			       pbool clear_cache);
+extern void setup_io_cache(IO_CACHE* info);
+extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count);
+#ifdef THREAD
+extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count);
+extern void init_io_cache_share(IO_CACHE *info,
+				IO_CACHE_SHARE *s, uint num_threads);
+extern void remove_io_thread(IO_CACHE *info);
+#endif
+extern int _my_b_seq_read(IO_CACHE *info,byte *Buffer,uint Count);
+extern int _my_b_net_read(IO_CACHE *info,byte *Buffer,uint Count);
+extern int _my_b_get(IO_CACHE *info);
+extern int _my_b_async_read(IO_CACHE *info,byte *Buffer,uint Count);
+extern int _my_b_write(IO_CACHE *info,const byte *Buffer,uint Count);
+extern int my_b_append(IO_CACHE *info,const byte *Buffer,uint Count);
+extern int my_b_safe_write(IO_CACHE *info,const byte *Buffer,uint Count);
+
+extern int my_block_write(IO_CACHE *info, const byte *Buffer,
+			  uint Count, my_off_t pos);
+extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock);
+
+#define flush_io_cache(info) my_b_flush_io_cache((info),1)
+
+extern int end_io_cache(IO_CACHE *info);
+extern uint my_b_fill(IO_CACHE *info);
+extern void my_b_seek(IO_CACHE *info,my_off_t pos);
+extern uint my_b_gets(IO_CACHE *info, char *to, uint max_length);
+extern my_off_t my_b_filelength(IO_CACHE *info);
+extern uint my_b_printf(IO_CACHE *info, const char* fmt, ...);
+extern uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
+extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
+				 const char *prefix, uint cache_size,
+				 myf cache_myflags);
+extern my_bool real_open_cached_file(IO_CACHE *cache);
+extern void close_cached_file(IO_CACHE *cache);
+File create_temp_file(char *to, const char *dir, const char *pfx,
+		      int mode, myf MyFlags);
+#define my_init_dynamic_array(A,B,C,D) init_dynamic_array(A,B,C,D CALLER_INFO)
+#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array(A,B,C,D ORIG_CALLER_INFO)
+extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size,
+                                  uint init_alloc,uint alloc_increment
+                                  CALLER_INFO_PROTO);
+extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element);
+extern byte *alloc_dynamic(DYNAMIC_ARRAY *array);
+extern byte *pop_dynamic(DYNAMIC_ARRAY*);
+extern my_bool set_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index);
+extern void get_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index);
+extern void delete_dynamic(DYNAMIC_ARRAY *array);
+extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index);
+extern void freeze_size(DYNAMIC_ARRAY *array);
+#define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element)
+#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index))
+#define push_dynamic(A,B) insert_dynamic(A,B)
+#define reset_dynamic(array) ((array)->elements= 0)
+
+extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
+				   uint init_alloc,uint alloc_increment);
+extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append);
+my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
+			  uint length);
+extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
+extern my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size);
+extern void dynstr_free(DYNAMIC_STRING *str);
+#ifdef HAVE_MLOCK
+extern byte *my_malloc_lock(uint length,myf flags);
+extern void my_free_lock(byte *ptr,myf flags);
+#else
+#define my_malloc_lock(A,B) my_malloc((A),(B))
+#define my_free_lock(A,B) my_free((A),(B))
+#endif
+#define alloc_root_inited(A) ((A)->min_malloc != 0)
+#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
+#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0)
+extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
+			    uint pre_alloc_size);
+extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size);
+extern gptr multi_alloc_root(MEM_ROOT *mem_root, ...);
+extern void free_root(MEM_ROOT *root, myf MyFLAGS);
+extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
+extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
+                                uint prealloc_size);
+extern char *strdup_root(MEM_ROOT *root,const char *str);
+extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
+extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
+extern int get_defaults_options(int argc, char **argv,
+                                char **defaults, char **extra_defaults,
+                                char **group_suffix);
+extern int load_defaults(const char *conf_file, const char **groups,
+			 int *argc, char ***argv);
+extern int modify_defaults_file(const char *file_location, const char *option,
+                                const char *option_value,
+                                const char *section_name, int remove_option);
+extern int my_search_option_files(const char *conf_file, int *argc,
+                                  char ***argv, uint *args_used,
+                                  Process_option_func func, void *func_ctx);
+extern void free_defaults(char **argv);
+extern void my_print_default_files(const char *conf_file);
+extern void print_defaults(const char *conf_file, const char **groups);
+extern my_bool my_compress(byte *, ulong *, ulong *);
+extern my_bool my_uncompress(byte *, ulong *, ulong *);
+extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen);
+extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count);
+extern uint my_bit_log2(ulong value);
+extern uint my_count_bits(ulonglong v);
+extern uint my_count_bits_ushort(ushort v);
+extern void my_sleep(ulong m_seconds);
+extern ulong crc32(ulong crc, const uchar *buf, uint len);
+extern uint my_set_max_open_files(uint files);
+void my_free_open_file_info(void);
+
+ulonglong my_getsystime(void);
+my_bool my_gethwaddr(uchar *to);
+
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+
+#ifndef MAP_NOSYNC
+#define MAP_NOSYNC      0
+#endif
+
+#define my_mmap(a,b,c,d,e,f)    mmap(a,b,c,d,e,f)
+#ifdef HAVE_GETPAGESIZE
+#define my_getpagesize()        getpagesize()
+#else
+/* qnx ? */
+#define my_getpagesize()        8192
+#endif
+#define my_munmap(a,b)          munmap((a),(b))
+
+#else
+/* not a complete set of mmap() flags, but only those that nesessary */
+#define PROT_READ        1
+#define PROT_WRITE       2
+#define MAP_SHARED       0x0001
+#define MAP_NOSYNC       0x0800
+#define MAP_FAILED       ((void *)-1)
+#define MS_SYNC          0x0000
+
+#ifndef __NETWARE__
+#define HAVE_MMAP
+#endif
+
+int my_getpagesize(void);
+void *my_mmap(void *, size_t, int, int, int, my_off_t);
+int my_munmap(void *, size_t);
+#endif
+
+int my_msync(int, void *, size_t, int);
+
+/* character sets */
+extern uint get_charset_number(const char *cs_name, uint cs_flags);
+extern uint get_collation_number(const char *name);
+extern const char *get_charset_name(uint cs_number);
+
+extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
+extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
+extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
+					   uint cs_flags, myf my_flags);
+extern void free_charsets(void);
+extern char *get_charsets_dir(char *buf);
+extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
+extern my_bool init_compiled_charsets(myf flags);
+extern void add_compiled_collation(CHARSET_INFO *cs);
+extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info,
+                                     char *to, ulong to_length,
+                                     const char *from, ulong length);
+#ifdef __WIN__
+#define BACKSLASH_MBTAIL
+/* File system character set */
+extern CHARSET_INFO *fs_character_set(void);
+#endif
+extern ulong escape_quotes_for_mysql(CHARSET_INFO *charset_info,
+                                     char *to, ulong to_length,
+                                     const char *from, ulong length);
+
+extern void thd_increment_bytes_sent(ulong length);
+extern void thd_increment_bytes_received(ulong length);
+extern void thd_increment_net_big_packet_count(ulong length);
+
+#ifdef __WIN__
+extern my_bool have_tcpip;		/* Is set if tcpip is used */
+
+/* implemented in my_windac.c */
+
+int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror,
+                            DWORD owner_rights, DWORD everybody_rights);
+
+void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
+
+/* implemented in my_conio.c */
+char* my_cgets(char *string, unsigned long clen, unsigned long* plen);
+
+#endif
+#ifdef __NETWARE__
+void netware_reg_user(const char *ip, const char *user,
+		      const char *application);
+#endif
+
+C_MODE_END
+#include "raid.h"
+#endif /* _my_sys_h */
diff --git a/src/terralib/drivers/MySQL/include/mysql.h b/src/terralib/drivers/MySQL/include/mysql.h
new file mode 100644
index 0000000..9ceb186
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/mysql.h
@@ -0,0 +1,839 @@
+/* Copyright (C) 2000-2003 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef _mysql_h
+#define _mysql_h
+
+#ifdef __CYGWIN__     /* CYGWIN implements a UNIX API */
+#undef WIN
+#undef _WIN
+#undef _WIN32
+#undef _WIN64
+#undef __WIN__
+#endif
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+#ifndef _global_h				/* If not standard header */
+#include <sys/types.h>
+#ifdef __LCC__
+#include <winsock.h>				/* For windows */
+#endif
+typedef char my_bool;
+#if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__)
+#define __WIN__
+#endif
+#if !defined(__WIN__)
+#define STDCALL
+#else
+#define STDCALL __stdcall
+#endif
+typedef char * gptr;
+
+#ifndef my_socket_defined
+#ifdef __WIN__
+#define my_socket SOCKET
+#else
+typedef int my_socket;
+#endif /* __WIN__ */
+#endif /* my_socket_defined */
+#endif /* _global_h */
+
+#include "mysql_com.h"
+#include "mysql_time.h"
+#include "mysql_version.h"
+#include "typelib.h"
+
+#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
+
+extern unsigned int mysql_port;
+extern char *mysql_unix_port;
+
+#define CLIENT_NET_READ_TIMEOUT		365*24*3600	/* Timeout on read */
+#define CLIENT_NET_WRITE_TIMEOUT	365*24*3600	/* Timeout on write */
+
+#ifdef __NETWARE__
+#pragma pack(push, 8)		/* 8 byte alignment */
+#endif
+
+#define IS_PRI_KEY(n)	((n) & PRI_KEY_FLAG)
+#define IS_NOT_NULL(n)	((n) & NOT_NULL_FLAG)
+#define IS_BLOB(n)	((n) & BLOB_FLAG)
+#define IS_NUM(t)	((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR || (t) == FIELD_TYPE_NEWDECIMAL)
+#define IS_NUM_FIELD(f)	 ((f)->flags & NUM_FLAG)
+#define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && ((f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == FIELD_TYPE_YEAR)
+
+
+typedef struct st_mysql_field {
+  char *name;                 /* Name of column */
+  char *org_name;             /* Original column name, if an alias */
+  char *table;                /* Table of column if column was a field */
+  char *org_table;            /* Org table name, if table was an alias */
+  char *db;                   /* Database for table */
+  char *catalog;	      /* Catalog for table */
+  char *def;                  /* Default value (set by mysql_list_fields) */
+  unsigned long length;       /* Width of column (create length) */
+  unsigned long max_length;   /* Max width for selected set */
+  unsigned int name_length;
+  unsigned int org_name_length;
+  unsigned int table_length;
+  unsigned int org_table_length;
+  unsigned int db_length;
+  unsigned int catalog_length;
+  unsigned int def_length;
+  unsigned int flags;         /* Div flags */
+  unsigned int decimals;      /* Number of decimals in field */
+  unsigned int charsetnr;     /* Character set */
+  enum enum_field_types type; /* Type of field. See mysql_com.h for types */
+} MYSQL_FIELD;
+
+typedef char **MYSQL_ROW;		/* return data as array of strings */
+typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */
+
+#ifndef _global_h
+#if defined(NO_CLIENT_LONG_LONG)
+typedef unsigned long my_ulonglong;
+#elif defined (__WIN__)
+typedef unsigned __int64 my_ulonglong;
+#else
+typedef unsigned long long my_ulonglong;
+#endif
+#endif
+
+#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0)
+
+typedef struct st_mysql_rows {
+  struct st_mysql_rows *next;		/* list of rows */
+  MYSQL_ROW data;
+  unsigned long length;
+} MYSQL_ROWS;
+
+typedef MYSQL_ROWS *MYSQL_ROW_OFFSET;	/* offset to current row */
+
+#include "my_alloc.h"
+
+typedef struct st_mysql_data {
+  my_ulonglong rows;
+  unsigned int fields;
+  MYSQL_ROWS *data;
+  MEM_ROOT alloc;
+#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
+  MYSQL_ROWS **prev_ptr;
+#endif
+} MYSQL_DATA;
+
+enum mysql_option 
+{
+  MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
+  MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
+  MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
+  MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
+  MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
+  MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
+  MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
+  MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT
+};
+
+struct st_mysql_options {
+  unsigned int connect_timeout, read_timeout, write_timeout;
+  unsigned int port, protocol;
+  unsigned long client_flag;
+  char *host,*user,*password,*unix_socket,*db;
+  struct st_dynamic_array *init_commands;
+  char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
+  char *ssl_key;				/* PEM key file */
+  char *ssl_cert;				/* PEM cert file */
+  char *ssl_ca;					/* PEM CA file */
+  char *ssl_capath;				/* PEM directory of CA-s? */
+  char *ssl_cipher;				/* cipher to use */
+  char *shared_memory_base_name;
+  unsigned long max_allowed_packet;
+  my_bool use_ssl;				/* if to use SSL or not */
+  my_bool compress,named_pipe;
+ /*
+   On connect, find out the replication role of the server, and
+   establish connections to all the peers
+ */
+  my_bool rpl_probe;
+ /*
+   Each call to mysql_real_query() will parse it to tell if it is a read
+   or a write, and direct it to the slave or the master
+ */
+  my_bool rpl_parse;
+ /*
+   If set, never read from a master, only from slave, when doing
+   a read that is replication-aware
+ */
+  my_bool no_master_reads;
+#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
+  my_bool separate_thread;
+#endif
+  enum mysql_option methods_to_use;
+  char *client_ip;
+  /* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */
+  my_bool secure_auth;
+  /* 0 - never report, 1 - always report (default) */
+  my_bool report_data_truncation;
+
+  /* function pointers for local infile support */
+  int (*local_infile_init)(void **, const char *, void *);
+  int (*local_infile_read)(void *, char *, unsigned int);
+  void (*local_infile_end)(void *);
+  int (*local_infile_error)(void *, char *, unsigned int);
+  void *local_infile_userdata;
+};
+
+enum mysql_status 
+{
+  MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT
+};
+
+enum mysql_protocol_type 
+{
+  MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
+  MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
+};
+/*
+  There are three types of queries - the ones that have to go to
+  the master, the ones that go to a slave, and the adminstrative
+  type which must happen on the pivot connectioin
+*/
+enum mysql_rpl_type 
+{
+  MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
+};
+
+typedef struct character_set
+{
+  unsigned int      number;     /* character set number              */
+  unsigned int      state;      /* character set state               */
+  const char        *csname;    /* collation name                    */
+  const char        *name;      /* character set name                */
+  const char        *comment;   /* comment                           */
+  const char        *dir;       /* character set directory           */
+  unsigned int      mbminlen;   /* min. length for multibyte strings */
+  unsigned int      mbmaxlen;   /* max. length for multibyte strings */
+} MY_CHARSET_INFO;
+
+struct st_mysql_methods;
+
+typedef struct st_mysql
+{
+  NET		net;			/* Communication parameters */
+  gptr		connector_fd;		/* ConnectorFd for SSL */
+  char		*host,*user,*passwd,*unix_socket,*server_version,*host_info,*info;
+  char          *db;
+  struct charset_info_st *charset;
+  MYSQL_FIELD	*fields;
+  MEM_ROOT	field_alloc;
+  my_ulonglong affected_rows;
+  my_ulonglong insert_id;		/* id if insert on table with NEXTNR */
+  my_ulonglong extra_info;		/* Not used */
+  unsigned long thread_id;		/* Id for connection in server */
+  unsigned long packet_length;
+  unsigned int	port;
+  unsigned long client_flag,server_capabilities;
+  unsigned int	protocol_version;
+  unsigned int	field_count;
+  unsigned int 	server_status;
+  unsigned int  server_language;
+  unsigned int	warning_count;
+  struct st_mysql_options options;
+  enum mysql_status status;
+  my_bool	free_me;		/* If free in mysql_close */
+  my_bool	reconnect;		/* set to 1 if automatic reconnect */
+
+  /* session-wide random string */
+  char	        scramble[SCRAMBLE_LENGTH+1];
+
+ /*
+   Set if this is the original connection, not a master or a slave we have
+   added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave()
+ */
+  my_bool rpl_pivot;
+  /*
+    Pointers to the master, and the next slave connections, points to
+    itself if lone connection.
+  */
+  struct st_mysql* master, *next_slave;
+
+  struct st_mysql* last_used_slave; /* needed for round-robin slave pick */
+ /* needed for send/read/store/use result to work correctly with replication */
+  struct st_mysql* last_used_con;
+
+  LIST  *stmts;                     /* list of all statements */
+  const struct st_mysql_methods *methods;
+  void *thd;
+  /*
+    Points to boolean flag in MYSQL_RES  or MYSQL_STMT. We set this flag 
+    from mysql_stmt_close if close had to cancel result set of this object.
+  */
+  my_bool *unbuffered_fetch_owner;
+} MYSQL;
+
+typedef struct st_mysql_res {
+  my_ulonglong row_count;
+  MYSQL_FIELD	*fields;
+  MYSQL_DATA	*data;
+  MYSQL_ROWS	*data_cursor;
+  unsigned long *lengths;		/* column lengths of current row */
+  MYSQL		*handle;		/* for unbuffered reads */
+  MEM_ROOT	field_alloc;
+  unsigned int	field_count, current_field;
+  MYSQL_ROW	row;			/* If unbuffered read */
+  MYSQL_ROW	current_row;		/* buffer to current row */
+  my_bool	eof;			/* Used by mysql_fetch_row */
+  /* mysql_stmt_close() had to cancel this result */
+  my_bool       unbuffered_fetch_cancelled;  
+  const struct st_mysql_methods *methods;
+} MYSQL_RES;
+
+#define MAX_MYSQL_MANAGER_ERR 256  
+#define MAX_MYSQL_MANAGER_MSG 256
+
+#define MANAGER_OK           200
+#define MANAGER_INFO         250
+#define MANAGER_ACCESS       401
+#define MANAGER_CLIENT_ERR   450
+#define MANAGER_INTERNAL_ERR 500
+
+#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT)
+#define MYSQL_CLIENT
+#endif
+
+
+typedef struct st_mysql_manager
+{
+  NET net;
+  char *host,*user,*passwd;
+  unsigned int port;
+  my_bool free_me;
+  my_bool eof;
+  int cmd_status;
+  int last_errno;
+  char* net_buf,*net_buf_pos,*net_data_end;
+  int net_buf_size;
+  char last_error[MAX_MYSQL_MANAGER_ERR];
+} MYSQL_MANAGER;
+
+typedef struct st_mysql_parameters
+{
+  unsigned long *p_max_allowed_packet;
+  unsigned long *p_net_buffer_length;
+} MYSQL_PARAMETERS;
+
+#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
+#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet)
+#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length)
+#endif
+
+/*
+  Set up and bring down the server; to ensure that applications will
+  work when linked against either the standard client library or the
+  embedded server library, these functions should be called.
+*/
+int STDCALL mysql_server_init(int argc, char **argv, char **groups);
+void STDCALL mysql_server_end(void);
+/*
+  mysql_server_init/end need to be called when using libmysqld or
+  libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
+  you don't need to call it explicitely; but you need to call
+  mysql_server_end() to free memory). The names are a bit misleading
+  (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general
+  names which suit well whether you're using libmysqld or libmysqlclient. We
+  intend to promote these aliases over the mysql_server* ones.
+*/
+#define mysql_library_init mysql_server_init
+#define mysql_library_end mysql_server_end
+
+MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void);
+
+/*
+  Set up and bring down a thread; these function should be called
+  for each thread in an application which opens at least one MySQL
+  connection.  All uses of the connection(s) should be between these
+  function calls.
+*/
+my_bool STDCALL mysql_thread_init(void);
+void STDCALL mysql_thread_end(void);
+
+/*
+  Functions to get information from the MYSQL and MYSQL_RES structures
+  Should definitely be used if one uses shared libraries.
+*/
+
+my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res);
+unsigned int STDCALL mysql_num_fields(MYSQL_RES *res);
+my_bool STDCALL mysql_eof(MYSQL_RES *res);
+MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res,
+					      unsigned int fieldnr);
+MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res);
+MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res);
+MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res);
+
+unsigned int STDCALL mysql_field_count(MYSQL *mysql);
+my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql);
+my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql);
+unsigned int STDCALL mysql_errno(MYSQL *mysql);
+const char * STDCALL mysql_error(MYSQL *mysql);
+const char *STDCALL mysql_sqlstate(MYSQL *mysql);
+unsigned int STDCALL mysql_warning_count(MYSQL *mysql);
+const char * STDCALL mysql_info(MYSQL *mysql);
+unsigned long STDCALL mysql_thread_id(MYSQL *mysql);
+const char * STDCALL mysql_character_set_name(MYSQL *mysql);
+int          STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname);
+
+MYSQL *		STDCALL mysql_init(MYSQL *mysql);
+my_bool		STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
+				      const char *cert, const char *ca,
+				      const char *capath, const char *cipher);
+my_bool		STDCALL mysql_change_user(MYSQL *mysql, const char *user, 
+					  const char *passwd, const char *db);
+MYSQL *		STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
+					   const char *user,
+					   const char *passwd,
+					   const char *db,
+					   unsigned int port,
+					   const char *unix_socket,
+					   unsigned long clientflag);
+int		STDCALL mysql_select_db(MYSQL *mysql, const char *db);
+int		STDCALL mysql_query(MYSQL *mysql, const char *q);
+int		STDCALL mysql_send_query(MYSQL *mysql, const char *q,
+					 unsigned long length);
+int		STDCALL mysql_real_query(MYSQL *mysql, const char *q,
+					unsigned long length);
+MYSQL_RES *     STDCALL mysql_store_result(MYSQL *mysql);
+MYSQL_RES *     STDCALL mysql_use_result(MYSQL *mysql);
+
+/* perform query on master */
+my_bool		STDCALL mysql_master_query(MYSQL *mysql, const char *q,
+					   unsigned long length);
+my_bool		STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
+						unsigned long length);
+/* perform query on slave */  
+my_bool		STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
+					  unsigned long length);
+my_bool		STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
+					       unsigned long length);
+void        STDCALL mysql_get_character_set_info(MYSQL *mysql,
+                           MY_CHARSET_INFO *charset);
+
+/* local infile support */
+
+#define LOCAL_INFILE_ERROR_LEN 512
+
+void
+mysql_set_local_infile_handler(MYSQL *mysql,
+                               int (*local_infile_init)(void **, const char *,
+                            void *),
+                               int (*local_infile_read)(void *, char *,
+							unsigned int),
+                               void (*local_infile_end)(void *),
+                               int (*local_infile_error)(void *, char*,
+							 unsigned int),
+                               void *);
+
+void
+mysql_set_local_infile_default(MYSQL *mysql);
+
+
+/*
+  enable/disable parsing of all queries to decide if they go on master or
+  slave
+*/
+void            STDCALL mysql_enable_rpl_parse(MYSQL* mysql);
+void            STDCALL mysql_disable_rpl_parse(MYSQL* mysql);
+/* get the value of the parse flag */  
+int             STDCALL mysql_rpl_parse_enabled(MYSQL* mysql);
+
+/*  enable/disable reads from master */
+void            STDCALL mysql_enable_reads_from_master(MYSQL* mysql);
+void            STDCALL mysql_disable_reads_from_master(MYSQL* mysql);
+/* get the value of the master read flag */  
+my_bool		STDCALL mysql_reads_from_master_enabled(MYSQL* mysql);
+
+enum mysql_rpl_type     STDCALL mysql_rpl_query_type(const char* q, int len);  
+
+/* discover the master and its slaves */  
+my_bool		STDCALL mysql_rpl_probe(MYSQL* mysql);
+
+/* set the master, close/free the old one, if it is not a pivot */
+int             STDCALL mysql_set_master(MYSQL* mysql, const char* host,
+					 unsigned int port,
+					 const char* user,
+					 const char* passwd);
+int             STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
+					unsigned int port,
+					const char* user,
+					const char* passwd);
+
+int		STDCALL mysql_shutdown(MYSQL *mysql,
+                                       enum mysql_enum_shutdown_level
+                                       shutdown_level);
+int		STDCALL mysql_dump_debug_info(MYSQL *mysql);
+int		STDCALL mysql_refresh(MYSQL *mysql,
+				     unsigned int refresh_options);
+int		STDCALL mysql_kill(MYSQL *mysql,unsigned long pid);
+int		STDCALL mysql_set_server_option(MYSQL *mysql,
+						enum enum_mysql_set_option
+						option);
+int		STDCALL mysql_ping(MYSQL *mysql);
+const char *	STDCALL mysql_stat(MYSQL *mysql);
+const char *	STDCALL mysql_get_server_info(MYSQL *mysql);
+const char *	STDCALL mysql_get_client_info(void);
+unsigned long	STDCALL mysql_get_client_version(void);
+const char *	STDCALL mysql_get_host_info(MYSQL *mysql);
+unsigned long	STDCALL mysql_get_server_version(MYSQL *mysql);
+unsigned int	STDCALL mysql_get_proto_info(MYSQL *mysql);
+MYSQL_RES *	STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
+MYSQL_RES *	STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
+MYSQL_RES *	STDCALL mysql_list_processes(MYSQL *mysql);
+int		STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
+				      const char *arg);
+void		STDCALL mysql_free_result(MYSQL_RES *result);
+void		STDCALL mysql_data_seek(MYSQL_RES *result,
+					my_ulonglong offset);
+MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result,
+						MYSQL_ROW_OFFSET offset);
+MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result,
+					   MYSQL_FIELD_OFFSET offset);
+MYSQL_ROW	STDCALL mysql_fetch_row(MYSQL_RES *result);
+unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
+MYSQL_FIELD *	STDCALL mysql_fetch_field(MYSQL_RES *result);
+MYSQL_RES *     STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
+					  const char *wild);
+unsigned long	STDCALL mysql_escape_string(char *to,const char *from,
+					    unsigned long from_length);
+unsigned long	STDCALL mysql_hex_string(char *to,const char *from,
+                                         unsigned long from_length);
+unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
+					       char *to,const char *from,
+					       unsigned long length);
+void		STDCALL mysql_debug(const char *debug);
+char *		STDCALL mysql_odbc_escape_string(MYSQL *mysql,
+						 char *to,
+						 unsigned long to_length,
+						 const char *from,
+						 unsigned long from_length,
+						 void *param,
+						 char *
+						 (*extend_buffer)
+						 (void *, char *to,
+						  unsigned long *length));
+void 		STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
+unsigned int	STDCALL mysql_thread_safe(void);
+my_bool		STDCALL mysql_embedded(void);
+MYSQL_MANAGER*  STDCALL mysql_manager_init(MYSQL_MANAGER* con);  
+MYSQL_MANAGER*  STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
+					      const char* host,
+					      const char* user,
+					      const char* passwd,
+					      unsigned int port);
+void            STDCALL mysql_manager_close(MYSQL_MANAGER* con);
+int             STDCALL mysql_manager_command(MYSQL_MANAGER* con,
+						const char* cmd, int cmd_len);
+int             STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con,
+						  char* res_buf,
+						 int res_buf_size);
+my_bool         STDCALL mysql_read_query_result(MYSQL *mysql);
+
+
+/*
+  The following definitions are added for the enhanced 
+  client-server protocol
+*/
+
+/* statement state */
+enum enum_mysql_stmt_state
+{
+  MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE,
+  MYSQL_STMT_FETCH_DONE
+};
+
+
+/*
+  This structure is used to define bind information, and
+  internally by the client library.
+  Public members with their descriptions are listed below
+  (conventionally `On input' refers to the binds given to
+  mysql_stmt_bind_param, `On output' refers to the binds given
+  to mysql_stmt_bind_result):
+
+  buffer_type    - One of the MYSQL_* types, used to describe
+                   the host language type of buffer.
+                   On output: if column type is different from
+                   buffer_type, column value is automatically converted
+                   to buffer_type before it is stored in the buffer.
+  buffer         - On input: points to the buffer with input data.
+                   On output: points to the buffer capable to store
+                   output data.
+                   The type of memory pointed by buffer must correspond
+                   to buffer_type. See the correspondence table in
+                   the comment to mysql_stmt_bind_param.
+
+  The two above members are mandatory for any kind of bind.
+
+  buffer_length  - the length of the buffer. You don't have to set
+                   it for any fixed length buffer: float, double,
+                   int, etc. It must be set however for variable-length
+                   types, such as BLOBs or STRINGs.
+
+  length         - On input: in case when lengths of input values
+                   are different for each execute, you can set this to
+                   point at a variable containining value length. This
+                   way the value length can be different in each execute.
+                   If length is not NULL, buffer_length is not used.
+                   Note, length can even point at buffer_length if
+                   you keep bind structures around while fetching:
+                   this way you can change buffer_length before
+                   each execution, everything will work ok.
+                   On output: if length is set, mysql_stmt_fetch will
+                   write column length into it.
+
+  is_null        - On input: points to a boolean variable that should
+                   be set to TRUE for NULL values.
+                   This member is useful only if your data may be
+                   NULL in some but not all cases.
+                   If your data is never NULL, is_null should be set to 0.
+                   If your data is always NULL, set buffer_type
+                   to MYSQL_TYPE_NULL, and is_null will not be used.
+
+  is_unsigned    - On input: used to signify that values provided for one
+                   of numeric types are unsigned.
+                   On output describes signedness of the output buffer.
+                   If, taking into account is_unsigned flag, column data
+                   is out of range of the output buffer, data for this column
+                   is regarded truncated. Note that this has no correspondence
+                   to the sign of result set column, if you need to find it out
+                   use mysql_stmt_result_metadata.
+  error          - where to write a truncation error if it is present.
+                   possible error value is:
+                   0  no truncation
+                   1  value is out of range or buffer is too small
+
+  Please note that MYSQL_BIND also has internals members.
+*/
+
+typedef struct st_mysql_bind
+{
+  unsigned long	*length;          /* output length pointer */
+  my_bool       *is_null;	  /* Pointer to null indicator */
+  void		*buffer;	  /* buffer to get/put data */
+  /* set this if you want to track data truncations happened during fetch */
+  my_bool       *error;
+  enum enum_field_types buffer_type;	/* buffer type */
+  /* output buffer length, must be set when fetching str/binary */
+  unsigned long buffer_length;
+  unsigned char *row_ptr;         /* for the current data position */
+  unsigned long offset;           /* offset position for char/binary fetch */
+  unsigned long	length_value;     /* Used if length is 0 */
+  unsigned int	param_number;	  /* For null count and error messages */
+  unsigned int  pack_length;	  /* Internal length for packed data */
+  my_bool       error_value;      /* used if error is 0 */
+  my_bool       is_unsigned;      /* set if integer type is unsigned */
+  my_bool	long_data_used;	  /* If used with mysql_send_long_data */
+  my_bool	is_null_value;    /* Used if is_null is 0 */
+  void (*store_param_func)(NET *net, struct st_mysql_bind *param);
+  void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
+                       unsigned char **row);
+  void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
+		      unsigned char **row);
+} MYSQL_BIND;
+
+
+/* statement handler */
+typedef struct st_mysql_stmt
+{
+  MEM_ROOT       mem_root;             /* root allocations */
+  LIST           list;                 /* list to keep track of all stmts */
+  MYSQL          *mysql;               /* connection handle */
+  MYSQL_BIND     *params;              /* input parameters */
+  MYSQL_BIND     *bind;                /* output parameters */
+  MYSQL_FIELD    *fields;              /* result set metadata */
+  MYSQL_DATA     result;               /* cached result set */
+  MYSQL_ROWS     *data_cursor;         /* current row in cached result */
+  /* copy of mysql->affected_rows after statement execution */
+  my_ulonglong   affected_rows;
+  my_ulonglong   insert_id;            /* copy of mysql->insert_id */
+  /*
+    mysql_stmt_fetch() calls this function to fetch one row (it's different
+    for buffered, unbuffered and cursor fetch).
+  */
+  int            (*read_row_func)(struct st_mysql_stmt *stmt, 
+                                  unsigned char **row);
+  unsigned long	 stmt_id;	       /* Id for prepared statement */
+  unsigned long  flags;                /* i.e. type of cursor to open */
+  unsigned long  prefetch_rows;        /* number of rows per one COM_FETCH */
+  /*
+    Copied from mysql->server_status after execute/fetch to know
+    server-side cursor status for this statement.
+  */
+  unsigned int   server_status;
+  unsigned int	 last_errno;	       /* error code */
+  unsigned int   param_count;          /* input parameter count */
+  unsigned int   field_count;          /* number of columns in result set */
+  enum enum_mysql_stmt_state state;    /* statement state */
+  char		 last_error[MYSQL_ERRMSG_SIZE]; /* error message */
+  char		 sqlstate[SQLSTATE_LENGTH+1];
+  /* Types of input parameters should be sent to server */
+  my_bool        send_types_to_server;
+  my_bool        bind_param_done;      /* input buffers were supplied */
+  unsigned char  bind_result_done;     /* output buffers were supplied */
+  /* mysql_stmt_close() had to cancel this result */
+  my_bool       unbuffered_fetch_cancelled;  
+  /*
+    Is set to true if we need to calculate field->max_length for 
+    metadata fields when doing mysql_stmt_store_result.
+  */
+  my_bool       update_max_length;     
+} MYSQL_STMT;
+
+enum enum_stmt_attr_type
+{
+  /*
+    When doing mysql_stmt_store_result calculate max_length attribute
+    of statement metadata. This is to be consistent with the old API, 
+    where this was done automatically.
+    In the new API we do that only by request because it slows down
+    mysql_stmt_store_result sufficiently.
+  */
+  STMT_ATTR_UPDATE_MAX_LENGTH,
+  /*
+    unsigned long with combination of cursor flags (read only, for update,
+    etc)
+  */
+  STMT_ATTR_CURSOR_TYPE,
+  /*
+    Amount of rows to retrieve from server per one fetch if using cursors.
+    Accepts unsigned long attribute in the range 1 - ulong_max
+  */
+  STMT_ATTR_PREFETCH_ROWS
+};
+
+
+typedef struct st_mysql_methods
+{
+  my_bool (*read_query_result)(MYSQL *mysql);
+  my_bool (*advanced_command)(MYSQL *mysql,
+			      enum enum_server_command command,
+			      const char *header,
+			      unsigned long header_length,
+			      const char *arg,
+			      unsigned long arg_length,
+			      my_bool skip_check);
+  MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
+			   unsigned int fields);
+  MYSQL_RES * (*use_result)(MYSQL *mysql);
+  void (*fetch_lengths)(unsigned long *to, 
+			MYSQL_ROW column, unsigned int field_count);
+  void (*flush_use_result)(MYSQL *mysql);
+#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
+  MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
+  my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
+  int (*stmt_execute)(MYSQL_STMT *stmt);
+  int (*read_binary_rows)(MYSQL_STMT *stmt);
+  int (*unbuffered_fetch)(MYSQL *mysql, char **row);
+  void (*free_embedded_thd)(MYSQL *mysql);
+  const char *(*read_statistics)(MYSQL *mysql);
+  my_bool (*next_result)(MYSQL *mysql);
+  int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd);
+#endif
+} MYSQL_METHODS;
+
+
+MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
+int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
+                               unsigned long length);
+int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt);
+int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt);
+int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind, 
+                                    unsigned int column,
+                                    unsigned long offset);
+int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
+unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt);
+my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt,
+                                    enum enum_stmt_attr_type attr_type,
+                                    const void *attr);
+my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
+                                    enum enum_stmt_attr_type attr_type,
+                                    void *attr);
+my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
+my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
+my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt);
+my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt);
+my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt);
+my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, 
+                                          unsigned int param_number,
+                                          const char *data, 
+                                          unsigned long length);
+MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt);
+MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt);
+unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt);
+const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt);
+const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt);
+MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt, 
+                                             MYSQL_ROW_OFFSET offset);
+MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt);
+void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset);
+my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt);
+my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt);
+my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt);
+unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt);
+
+my_bool STDCALL mysql_commit(MYSQL * mysql);
+my_bool STDCALL mysql_rollback(MYSQL * mysql);
+my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
+my_bool STDCALL mysql_more_results(MYSQL *mysql);
+int STDCALL mysql_next_result(MYSQL *mysql);
+void STDCALL mysql_close(MYSQL *sock);
+
+
+/* status return codes */
+#define MYSQL_NO_DATA        100
+#define MYSQL_DATA_TRUNCATED 101
+
+#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
+
+#ifdef USE_OLD_FUNCTIONS
+MYSQL *		STDCALL mysql_connect(MYSQL *mysql, const char *host,
+				      const char *user, const char *passwd);
+int		STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
+int		STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
+#define	 mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
+#endif
+#define HAVE_MYSQL_REAL_CONNECT
+
+/*
+  The following functions are mainly exported because of mysqlbinlog;
+  They are not for general usage
+*/
+
+#define simple_command(mysql, command, arg, length, skip_check) \
+  (*(mysql)->methods->advanced_command)(mysql, command,         \
+					NullS, 0, arg, length, skip_check)
+unsigned long net_safe_read(MYSQL* mysql);
+
+#ifdef __NETWARE__
+#pragma pack(pop)		/* restore alignment */
+#endif
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif /* _mysql_h */
diff --git a/src/terralib/drivers/MySQL/include/mysql_com.h b/src/terralib/drivers/MySQL/include/mysql_com.h
new file mode 100644
index 0000000..02a95d6
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/mysql_com.h
@@ -0,0 +1,444 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/*
+** Common definition between mysql server & client
+*/
+
+#ifndef _mysql_com_h
+#define _mysql_com_h
+
+#define NAME_LEN	64		/* Field/table name length */
+#define HOSTNAME_LENGTH 60
+#define USERNAME_LENGTH 16
+#define SERVER_VERSION_LENGTH 60
+#define SQLSTATE_LENGTH 5
+
+#define LOCAL_HOST	"localhost"
+#define LOCAL_HOST_NAMEDPIPE "."
+
+
+#if defined(__WIN__) && !defined( _CUSTOMCONFIG_)
+#define MYSQL_NAMEDPIPE "MySQL"
+#define MYSQL_SERVICENAME "MySQL"
+#endif /* __WIN__ */
+
+/*
+  You should add new commands to the end of this list, otherwise old
+  servers won't be able to handle them as 'unsupported'.
+*/
+
+enum enum_server_command
+{
+  COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
+  COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS,
+  COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING,
+  COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
+  COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
+  COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
+  COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH,
+  /* don't forget to update const char *command_name[] in sql_parse.cc */
+
+  /* Must be last */
+  COM_END
+};
+
+
+/*
+  Length of random string sent by server on handshake; this is also length of
+  obfuscated password, recieved from client
+*/
+#define SCRAMBLE_LENGTH 20
+#define SCRAMBLE_LENGTH_323 8
+/* length of password stored in the db: new passwords are preceeded with '*' */
+#define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1)
+#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2)
+
+
+#define NOT_NULL_FLAG	1		/* Field can't be NULL */
+#define PRI_KEY_FLAG	2		/* Field is part of a primary key */
+#define UNIQUE_KEY_FLAG 4		/* Field is part of a unique key */
+#define MULTIPLE_KEY_FLAG 8		/* Field is part of a key */
+#define BLOB_FLAG	16		/* Field is a blob */
+#define UNSIGNED_FLAG	32		/* Field is unsigned */
+#define ZEROFILL_FLAG	64		/* Field is zerofill */
+#define BINARY_FLAG	128		/* Field is binary   */
+
+/* The following are only sent to new clients */
+#define ENUM_FLAG	256		/* field is an enum */
+#define AUTO_INCREMENT_FLAG 512		/* field is a autoincrement field */
+#define TIMESTAMP_FLAG	1024		/* Field is a timestamp */
+#define SET_FLAG	2048		/* field is a set */
+#define NO_DEFAULT_VALUE_FLAG 4096	/* Field doesn't have default value */
+#define NUM_FLAG	32768		/* Field is num (for clients) */
+#define PART_KEY_FLAG	16384		/* Intern; Part of some key */
+#define GROUP_FLAG	32768		/* Intern: Group field */
+#define UNIQUE_FLAG	65536		/* Intern: Used by sql_yacc */
+#define BINCMP_FLAG	131072		/* Intern: Used by sql_yacc */
+
+#define REFRESH_GRANT		1	/* Refresh grant tables */
+#define REFRESH_LOG		2	/* Start on new log file */
+#define REFRESH_TABLES		4	/* close all tables */
+#define REFRESH_HOSTS		8	/* Flush host cache */
+#define REFRESH_STATUS		16	/* Flush status variables */
+#define REFRESH_THREADS		32	/* Flush thread cache */
+#define REFRESH_SLAVE           64      /* Reset master info and restart slave
+					   thread */
+#define REFRESH_MASTER          128     /* Remove all bin logs in the index
+					   and truncate the index */
+
+/* The following can't be set with mysql_refresh() */
+#define REFRESH_READ_LOCK	16384	/* Lock tables for read */
+#define REFRESH_FAST		32768	/* Intern flag */
+
+/* RESET (remove all queries) from query cache */
+#define REFRESH_QUERY_CACHE	65536
+#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */
+#define REFRESH_DES_KEY_FILE	0x40000L
+#define REFRESH_USER_RESOURCES	0x80000L
+
+#define CLIENT_LONG_PASSWORD	1	/* new more secure passwords */
+#define CLIENT_FOUND_ROWS	2	/* Found instead of affected rows */
+#define CLIENT_LONG_FLAG	4	/* Get all column flags */
+#define CLIENT_CONNECT_WITH_DB	8	/* One can specify db on connect */
+#define CLIENT_NO_SCHEMA	16	/* Don't allow database.table.column */
+#define CLIENT_COMPRESS		32	/* Can use compression protocol */
+#define CLIENT_ODBC		64	/* Odbc client */
+#define CLIENT_LOCAL_FILES	128	/* Can use LOAD DATA LOCAL */
+#define CLIENT_IGNORE_SPACE	256	/* Ignore spaces before '(' */
+#define CLIENT_PROTOCOL_41	512	/* New 4.1 protocol */
+#define CLIENT_INTERACTIVE	1024	/* This is an interactive client */
+#define CLIENT_SSL              2048	/* Switch to SSL after handshake */
+#define CLIENT_IGNORE_SIGPIPE   4096    /* IGNORE sigpipes */
+#define CLIENT_TRANSACTIONS	8192	/* Client knows about transactions */
+#define CLIENT_RESERVED         16384   /* Old flag for 4.1 protocol  */
+#define CLIENT_SECURE_CONNECTION 32768  /* New 4.1 authentication */
+#define CLIENT_MULTI_STATEMENTS 65536   /* Enable/disable multi-stmt support */
+#define CLIENT_MULTI_RESULTS    131072  /* Enable/disable multi-results */
+#define CLIENT_REMEMBER_OPTIONS	(((ulong) 1) << 31)
+
+#define SERVER_STATUS_IN_TRANS     1	/* Transaction has started */
+#define SERVER_STATUS_AUTOCOMMIT   2	/* Server in auto_commit mode */
+#define SERVER_STATUS_MORE_RESULTS 4	/* More results on server */
+#define SERVER_MORE_RESULTS_EXISTS 8    /* Multi query - next query exists */
+#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
+#define SERVER_QUERY_NO_INDEX_USED      32
+/*
+  The server was able to fulfill the clients request and opened a
+  read-only non-scrollable cursor for a query. This flag comes
+  in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
+*/
+#define SERVER_STATUS_CURSOR_EXISTS 64
+/*
+  This flag is sent when a read-only cursor is exhausted, in reply to
+  COM_STMT_FETCH command.
+*/
+#define SERVER_STATUS_LAST_ROW_SENT 128
+#define SERVER_STATUS_DB_DROPPED        256 /* A database was dropped */
+#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
+
+#define MYSQL_ERRMSG_SIZE	512
+#define NET_READ_TIMEOUT	30		/* Timeout on read */
+#define NET_WRITE_TIMEOUT	60		/* Timeout on write */
+#define NET_WAIT_TIMEOUT	8*60*60		/* Wait for new query */
+
+#define ONLY_KILL_QUERY         1
+
+struct st_vio;					/* Only C */
+typedef struct st_vio Vio;
+
+#define MAX_TINYINT_WIDTH       3       /* Max width for a TINY w.o. sign */
+#define MAX_SMALLINT_WIDTH      5       /* Max width for a SHORT w.o. sign */
+#define MAX_MEDIUMINT_WIDTH     8       /* Max width for a INT24 w.o. sign */
+#define MAX_INT_WIDTH           10      /* Max width for a LONG w.o. sign */
+#define MAX_BIGINT_WIDTH        20      /* Max width for a LONGLONG */
+#define MAX_CHAR_WIDTH		255	/* Max length for a CHAR colum */
+#define MAX_BLOB_WIDTH		8192	/* Default width for blob */
+
+typedef struct st_net {
+#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
+  Vio* vio;
+  unsigned char *buff,*buff_end,*write_pos,*read_pos;
+  my_socket fd;					/* For Perl DBI/dbd */
+  unsigned long max_packet,max_packet_size;
+  unsigned int pkt_nr,compress_pkt_nr;
+  unsigned int write_timeout, read_timeout, retry_count;
+  int fcntl;
+  my_bool compress;
+  /*
+    The following variable is set if we are doing several queries in one
+    command ( as in LOAD TABLE ... FROM MASTER ),
+    and do not want to confuse the client with OK at the wrong time
+  */
+  unsigned long remain_in_buf,length, buf_length, where_b;
+  unsigned int *return_status;
+  unsigned char reading_or_writing;
+  char save_char;
+  my_bool no_send_ok;  /* For SPs and other things that do multiple stmts */
+  my_bool no_send_eof; /* For SPs' first version read-only cursors */
+  /*
+    Set if OK packet is already sent, and we do not need to send error
+    messages
+  */
+  my_bool no_send_error;
+  /*
+    Pointer to query object in query cache, do not equal NULL (0) for
+    queries in cache that have not stored its results yet
+  */
+#endif
+  char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
+  unsigned int last_errno;
+  unsigned char error;
+  gptr query_cache_query;
+  my_bool report_error; /* We should report error (we have unreported error) */
+  my_bool return_errno;
+} NET;
+
+#define packet_error (~(unsigned long) 0)
+
+enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
+			MYSQL_TYPE_SHORT,  MYSQL_TYPE_LONG,
+			MYSQL_TYPE_FLOAT,  MYSQL_TYPE_DOUBLE,
+			MYSQL_TYPE_NULL,   MYSQL_TYPE_TIMESTAMP,
+			MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
+			MYSQL_TYPE_DATE,   MYSQL_TYPE_TIME,
+			MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
+			MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
+			MYSQL_TYPE_BIT,
+                        MYSQL_TYPE_NEWDECIMAL=246,
+			MYSQL_TYPE_ENUM=247,
+			MYSQL_TYPE_SET=248,
+			MYSQL_TYPE_TINY_BLOB=249,
+			MYSQL_TYPE_MEDIUM_BLOB=250,
+			MYSQL_TYPE_LONG_BLOB=251,
+			MYSQL_TYPE_BLOB=252,
+			MYSQL_TYPE_VAR_STRING=253,
+			MYSQL_TYPE_STRING=254,
+			MYSQL_TYPE_GEOMETRY=255
+
+};
+
+/* For backward compatibility */
+#define CLIENT_MULTI_QUERIES    CLIENT_MULTI_STATEMENTS    
+#define FIELD_TYPE_DECIMAL     MYSQL_TYPE_DECIMAL
+#define FIELD_TYPE_NEWDECIMAL  MYSQL_TYPE_NEWDECIMAL
+#define FIELD_TYPE_TINY        MYSQL_TYPE_TINY
+#define FIELD_TYPE_SHORT       MYSQL_TYPE_SHORT
+#define FIELD_TYPE_LONG        MYSQL_TYPE_LONG
+#define FIELD_TYPE_FLOAT       MYSQL_TYPE_FLOAT
+#define FIELD_TYPE_DOUBLE      MYSQL_TYPE_DOUBLE
+#define FIELD_TYPE_NULL        MYSQL_TYPE_NULL
+#define FIELD_TYPE_TIMESTAMP   MYSQL_TYPE_TIMESTAMP
+#define FIELD_TYPE_LONGLONG    MYSQL_TYPE_LONGLONG
+#define FIELD_TYPE_INT24       MYSQL_TYPE_INT24
+#define FIELD_TYPE_DATE        MYSQL_TYPE_DATE
+#define FIELD_TYPE_TIME        MYSQL_TYPE_TIME
+#define FIELD_TYPE_DATETIME    MYSQL_TYPE_DATETIME
+#define FIELD_TYPE_YEAR        MYSQL_TYPE_YEAR
+#define FIELD_TYPE_NEWDATE     MYSQL_TYPE_NEWDATE
+#define FIELD_TYPE_ENUM        MYSQL_TYPE_ENUM
+#define FIELD_TYPE_SET         MYSQL_TYPE_SET
+#define FIELD_TYPE_TINY_BLOB   MYSQL_TYPE_TINY_BLOB
+#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB
+#define FIELD_TYPE_LONG_BLOB   MYSQL_TYPE_LONG_BLOB
+#define FIELD_TYPE_BLOB        MYSQL_TYPE_BLOB
+#define FIELD_TYPE_VAR_STRING  MYSQL_TYPE_VAR_STRING
+#define FIELD_TYPE_STRING      MYSQL_TYPE_STRING
+#define FIELD_TYPE_CHAR        MYSQL_TYPE_TINY
+#define FIELD_TYPE_INTERVAL    MYSQL_TYPE_ENUM
+#define FIELD_TYPE_GEOMETRY    MYSQL_TYPE_GEOMETRY
+#define FIELD_TYPE_BIT         MYSQL_TYPE_BIT
+
+
+/* Shutdown/kill enums and constants */ 
+
+/* Bits for THD::killable. */
+#define MYSQL_SHUTDOWN_KILLABLE_CONNECT    (unsigned char)(1 << 0)
+#define MYSQL_SHUTDOWN_KILLABLE_TRANS      (unsigned char)(1 << 1)
+#define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2)
+#define MYSQL_SHUTDOWN_KILLABLE_UPDATE     (unsigned char)(1 << 3)
+
+enum mysql_enum_shutdown_level {
+  /*
+    We want levels to be in growing order of hardness (because we use number
+    comparisons). Note that DEFAULT does not respect the growing property, but
+    it's ok.
+  */
+  SHUTDOWN_DEFAULT = 0,
+  /* wait for existing connections to finish */
+  SHUTDOWN_WAIT_CONNECTIONS= MYSQL_SHUTDOWN_KILLABLE_CONNECT,
+  /* wait for existing trans to finish */
+  SHUTDOWN_WAIT_TRANSACTIONS= MYSQL_SHUTDOWN_KILLABLE_TRANS,
+  /* wait for existing updates to finish (=> no partial MyISAM update) */
+  SHUTDOWN_WAIT_UPDATES= MYSQL_SHUTDOWN_KILLABLE_UPDATE,
+  /* flush InnoDB buffers and other storage engines' buffers*/
+  SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1),
+  /* don't flush InnoDB buffers, flush other storage engines' buffers*/
+  SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1,
+  /* Now the 2 levels of the KILL command */
+#if MYSQL_VERSION_ID >= 50000
+  KILL_QUERY= 254,
+#endif
+  KILL_CONNECTION= 255
+};
+
+
+enum enum_cursor_type
+{
+  CURSOR_TYPE_NO_CURSOR= 0,
+  CURSOR_TYPE_READ_ONLY= 1,
+  CURSOR_TYPE_FOR_UPDATE= 2,
+  CURSOR_TYPE_SCROLLABLE= 4
+};
+
+
+/* options for mysql_set_option */
+enum enum_mysql_set_option
+{
+  MYSQL_OPTION_MULTI_STATEMENTS_ON,
+  MYSQL_OPTION_MULTI_STATEMENTS_OFF
+};
+
+#define net_new_transaction(net) ((net)->pkt_nr=0)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+my_bool	my_net_init(NET *net, Vio* vio);
+void	my_net_local_init(NET *net);
+void	net_end(NET *net);
+void	net_clear(NET *net);
+my_bool net_realloc(NET *net, unsigned long length);
+my_bool	net_flush(NET *net);
+my_bool	my_net_write(NET *net,const char *packet,unsigned long len);
+my_bool	net_write_command(NET *net,unsigned char command,
+			  const char *header, unsigned long head_len,
+			  const char *packet, unsigned long len);
+int	net_real_write(NET *net,const char *packet,unsigned long len);
+unsigned long my_net_read(NET *net);
+
+/*
+  The following function is not meant for normal usage
+  Currently it's used internally by manager.c
+*/
+struct sockaddr;
+int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
+	       unsigned int timeout);
+
+struct rand_struct {
+  unsigned long seed1,seed2,max_value;
+  double max_value_dbl;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+  /* The following is for user defined functions */
+
+enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT,
+                  DECIMAL_RESULT};
+
+typedef struct st_udf_args
+{
+  unsigned int arg_count;		/* Number of arguments */
+  enum Item_result *arg_type;		/* Pointer to item_results */
+  char **args;				/* Pointer to argument */
+  unsigned long *lengths;		/* Length of string arguments */
+  char *maybe_null;			/* Set to 1 for all maybe_null args */
+  char **attributes;                    /* Pointer to attribute name */
+  unsigned long *attribute_lengths;     /* Length of attribute arguments */
+} UDF_ARGS;
+
+  /* This holds information about the result */
+
+typedef struct st_udf_init
+{
+  my_bool maybe_null;			/* 1 if function can return NULL */
+  unsigned int decimals;		/* for real functions */
+  unsigned long max_length;		/* For string functions */
+  char	  *ptr;				/* free pointer for function data */
+  my_bool const_item;			/* 0 if result is independent of arguments */
+} UDF_INIT;
+
+  /* Constants when using compression */
+#define NET_HEADER_SIZE 4		/* standard header size */
+#define COMP_HEADER_SIZE 3		/* compression header extra size */
+
+  /* Prototypes to password functions */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+  These functions are used for authentication by client and server and
+  implemented in sql/password.c
+*/
+
+void randominit(struct rand_struct *, unsigned long seed1,
+                unsigned long seed2);
+double my_rnd(struct rand_struct *);
+void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
+
+void hash_password(unsigned long *to, const char *password, unsigned int password_len);
+void make_scrambled_password_323(char *to, const char *password);
+void scramble_323(char *to, const char *message, const char *password);
+my_bool check_scramble_323(const char *, const char *message,
+                           unsigned long *salt);
+void get_salt_from_password_323(unsigned long *res, const char *password);
+void make_password_from_salt_323(char *to, const unsigned long *salt);
+
+void make_scrambled_password(char *to, const char *password);
+void scramble(char *to, const char *message, const char *password);
+my_bool check_scramble(const char *reply, const char *message,
+                       const unsigned char *hash_stage2);
+void get_salt_from_password(unsigned char *res, const char *password);
+void make_password_from_salt(char *to, const unsigned char *hash_stage2);
+char *octet2hex(char *to, const char *str, unsigned int len);
+
+/* end of password.c */
+
+char *get_tty_password(char *opt_message);
+const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
+
+/* Some other useful functions */
+
+my_bool my_init(void);
+extern int modify_defaults_file(const char *file_location, const char *option,
+                                const char *option_value,
+                                const char *section_name, int remove_option);
+int load_defaults(const char *conf_file, const char **groups,
+		  int *argc, char ***argv);
+my_bool my_thread_init(void);
+void my_thread_end(void);
+
+#ifdef _global_h
+ulong STDCALL net_field_length(uchar **packet);
+my_ulonglong net_field_length_ll(uchar **packet);
+char *net_store_length(char *pkg, ulonglong length);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
+#define MYSQL_STMT_HEADER       4
+#define MYSQL_LONG_DATA_HEADER  6
+
+#endif
diff --git a/src/terralib/drivers/MySQL/include/mysql_embed.h b/src/terralib/drivers/MySQL/include/mysql_embed.h
new file mode 100644
index 0000000..1b6e852
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/mysql_embed.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/* Defines that are unique to the embedded version of MySQL */
+
+#ifdef EMBEDDED_LIBRARY
+
+/* Things we don't need in the embedded version of MySQL */
+/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
+
+#undef HAVE_PSTACK				/* No stacktrace */
+#undef HAVE_DLOPEN				/* No udf functions */
+#undef HAVE_OPENSSL
+#undef HAVE_SMEM				/* No shared memory */
+#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
+
+#define DONT_USE_RAID
+
+#endif /* EMBEDDED_LIBRARY */
diff --git a/src/terralib/drivers/MySQL/include/mysql_time.h b/src/terralib/drivers/MySQL/include/mysql_time.h
new file mode 100644
index 0000000..75683d3
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/mysql_time.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef _mysql_time_h_
+#define _mysql_time_h_
+
+/*
+  Time declarations shared between the server and client API:
+  you should not add anything to this header unless it's used
+  (and hence should be visible) in mysql.h.
+  If you're looking for a place to add new time-related declaration,
+  it's most likely my_time.h. See also "C API Handling of Date
+  and Time Values" chapter in documentation.
+*/
+
+enum enum_mysql_timestamp_type
+{
+  MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
+  MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
+};
+
+
+/*
+  Structure which is used to represent datetime values inside MySQL.
+
+  We assume that values in this structure are normalized, i.e. year <= 9999,
+  month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions
+  in server such as my_system_gmt_sec() or make_time() family of functions
+  rely on this (actually now usage of make_*() family relies on a bit weaker
+  restriction). Also functions that produce MYSQL_TIME as result ensure this.
+  There is one exception to this rule though if this structure holds time
+  value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold
+  bigger values.
+*/
+typedef struct st_mysql_time
+{
+  unsigned int  year, month, day, hour, minute, second;
+  unsigned long second_part;
+  my_bool       neg;
+  enum enum_mysql_timestamp_type time_type;
+} MYSQL_TIME;
+
+#endif /* _mysql_time_h_ */
diff --git a/src/terralib/drivers/MySQL/include/mysql_version.h b/src/terralib/drivers/MySQL/include/mysql_version.h
new file mode 100644
index 0000000..87ee55b
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/mysql_version.h
@@ -0,0 +1,29 @@
+/* Copyright Abandoned 1996, 1999, 2001 MySQL AB
+   This file is public domain and comes with NO WARRANTY of any kind */
+
+/* Version numbers for protocol & mysqld */
+
+#ifndef _mysql_version_h
+#define _mysql_version_h
+#ifdef _CUSTOMCONFIG_
+#include <custom_conf.h>
+#else
+#define PROTOCOL_VERSION		10
+#define MYSQL_SERVER_VERSION		"5.0.15"
+#define MYSQL_BASE_VERSION		"mysqld-5.0"
+#define MYSQL_SERVER_SUFFIX_DEF	""
+#define FRM_VER				6
+#define MYSQL_VERSION_ID		50015
+#define MYSQL_PORT			3306
+#define MYSQL_UNIX_ADDR			"/tmp/mysql.sock"
+#define MYSQL_CONFIG_NAME		"my"
+#define MYSQL_COMPILATION_COMMENT	"Official MySQL binary"
+
+/* mysqld compile time options */
+#endif /* _CUSTOMCONFIG_ */
+
+#ifndef LICENSE
+#define LICENSE				GPL
+#endif /* LICENSE */
+
+#endif /* _mysql_version_h */
diff --git a/src/terralib/drivers/MySQL/include/mysqld_ername.h b/src/terralib/drivers/MySQL/include/mysqld_ername.h
new file mode 100644
index 0000000..828ebb4
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/mysqld_ername.h
@@ -0,0 +1,456 @@
+/* Autogenerated file, please don't edit */
+
+{ "ER_HASHCHK", 1000 },
+{ "ER_NISAMCHK", 1001 },
+{ "ER_NO", 1002 },
+{ "ER_YES", 1003 },
+{ "ER_CANT_CREATE_FILE", 1004 },
+{ "ER_CANT_CREATE_TABLE", 1005 },
+{ "ER_CANT_CREATE_DB", 1006 },
+{ "ER_DB_CREATE_EXISTS", 1007 },
+{ "ER_DB_DROP_EXISTS", 1008 },
+{ "ER_DB_DROP_DELETE", 1009 },
+{ "ER_DB_DROP_RMDIR", 1010 },
+{ "ER_CANT_DELETE_FILE", 1011 },
+{ "ER_CANT_FIND_SYSTEM_REC", 1012 },
+{ "ER_CANT_GET_STAT", 1013 },
+{ "ER_CANT_GET_WD", 1014 },
+{ "ER_CANT_LOCK", 1015 },
+{ "ER_CANT_OPEN_FILE", 1016 },
+{ "ER_FILE_NOT_FOUND", 1017 },
+{ "ER_CANT_READ_DIR", 1018 },
+{ "ER_CANT_SET_WD", 1019 },
+{ "ER_CHECKREAD", 1020 },
+{ "ER_DISK_FULL", 1021 },
+{ "ER_DUP_KEY", 1022 },
+{ "ER_ERROR_ON_CLOSE", 1023 },
+{ "ER_ERROR_ON_READ", 1024 },
+{ "ER_ERROR_ON_RENAME", 1025 },
+{ "ER_ERROR_ON_WRITE", 1026 },
+{ "ER_FILE_USED", 1027 },
+{ "ER_FILSORT_ABORT", 1028 },
+{ "ER_FORM_NOT_FOUND", 1029 },
+{ "ER_GET_ERRNO", 1030 },
+{ "ER_ILLEGAL_HA", 1031 },
+{ "ER_KEY_NOT_FOUND", 1032 },
+{ "ER_NOT_FORM_FILE", 1033 },
+{ "ER_NOT_KEYFILE", 1034 },
+{ "ER_OLD_KEYFILE", 1035 },
+{ "ER_OPEN_AS_READONLY", 1036 },
+{ "ER_OUTOFMEMORY", 1037 },
+{ "ER_OUT_OF_SORTMEMORY", 1038 },
+{ "ER_UNEXPECTED_EOF", 1039 },
+{ "ER_CON_COUNT_ERROR", 1040 },
+{ "ER_OUT_OF_RESOURCES", 1041 },
+{ "ER_BAD_HOST_ERROR", 1042 },
+{ "ER_HANDSHAKE_ERROR", 1043 },
+{ "ER_DBACCESS_DENIED_ERROR", 1044 },
+{ "ER_ACCESS_DENIED_ERROR", 1045 },
+{ "ER_NO_DB_ERROR", 1046 },
+{ "ER_UNKNOWN_COM_ERROR", 1047 },
+{ "ER_BAD_NULL_ERROR", 1048 },
+{ "ER_BAD_DB_ERROR", 1049 },
+{ "ER_TABLE_EXISTS_ERROR", 1050 },
+{ "ER_BAD_TABLE_ERROR", 1051 },
+{ "ER_NON_UNIQ_ERROR", 1052 },
+{ "ER_SERVER_SHUTDOWN", 1053 },
+{ "ER_BAD_FIELD_ERROR", 1054 },
+{ "ER_WRONG_FIELD_WITH_GROUP", 1055 },
+{ "ER_WRONG_GROUP_FIELD", 1056 },
+{ "ER_WRONG_SUM_SELECT", 1057 },
+{ "ER_WRONG_VALUE_COUNT", 1058 },
+{ "ER_TOO_LONG_IDENT", 1059 },
+{ "ER_DUP_FIELDNAME", 1060 },
+{ "ER_DUP_KEYNAME", 1061 },
+{ "ER_DUP_ENTRY", 1062 },
+{ "ER_WRONG_FIELD_SPEC", 1063 },
+{ "ER_PARSE_ERROR", 1064 },
+{ "ER_EMPTY_QUERY", 1065 },
+{ "ER_NONUNIQ_TABLE", 1066 },
+{ "ER_INVALID_DEFAULT", 1067 },
+{ "ER_MULTIPLE_PRI_KEY", 1068 },
+{ "ER_TOO_MANY_KEYS", 1069 },
+{ "ER_TOO_MANY_KEY_PARTS", 1070 },
+{ "ER_TOO_LONG_KEY", 1071 },
+{ "ER_KEY_COLUMN_DOES_NOT_EXITS", 1072 },
+{ "ER_BLOB_USED_AS_KEY", 1073 },
+{ "ER_TOO_BIG_FIELDLENGTH", 1074 },
+{ "ER_WRONG_AUTO_KEY", 1075 },
+{ "ER_READY", 1076 },
+{ "ER_NORMAL_SHUTDOWN", 1077 },
+{ "ER_GOT_SIGNAL", 1078 },
+{ "ER_SHUTDOWN_COMPLETE", 1079 },
+{ "ER_FORCING_CLOSE", 1080 },
+{ "ER_IPSOCK_ERROR", 1081 },
+{ "ER_NO_SUCH_INDEX", 1082 },
+{ "ER_WRONG_FIELD_TERMINATORS", 1083 },
+{ "ER_BLOBS_AND_NO_TERMINATED", 1084 },
+{ "ER_TEXTFILE_NOT_READABLE", 1085 },
+{ "ER_FILE_EXISTS_ERROR", 1086 },
+{ "ER_LOAD_INFO", 1087 },
+{ "ER_ALTER_INFO", 1088 },
+{ "ER_WRONG_SUB_KEY", 1089 },
+{ "ER_CANT_REMOVE_ALL_FIELDS", 1090 },
+{ "ER_CANT_DROP_FIELD_OR_KEY", 1091 },
+{ "ER_INSERT_INFO", 1092 },
+{ "ER_UPDATE_TABLE_USED", 1093 },
+{ "ER_NO_SUCH_THREAD", 1094 },
+{ "ER_KILL_DENIED_ERROR", 1095 },
+{ "ER_NO_TABLES_USED", 1096 },
+{ "ER_TOO_BIG_SET", 1097 },
+{ "ER_NO_UNIQUE_LOGFILE", 1098 },
+{ "ER_TABLE_NOT_LOCKED_FOR_WRITE", 1099 },
+{ "ER_TABLE_NOT_LOCKED", 1100 },
+{ "ER_BLOB_CANT_HAVE_DEFAULT", 1101 },
+{ "ER_WRONG_DB_NAME", 1102 },
+{ "ER_WRONG_TABLE_NAME", 1103 },
+{ "ER_TOO_BIG_SELECT", 1104 },
+{ "ER_UNKNOWN_ERROR", 1105 },
+{ "ER_UNKNOWN_PROCEDURE", 1106 },
+{ "ER_WRONG_PARAMCOUNT_TO_PROCEDURE", 1107 },
+{ "ER_WRONG_PARAMETERS_TO_PROCEDURE", 1108 },
+{ "ER_UNKNOWN_TABLE", 1109 },
+{ "ER_FIELD_SPECIFIED_TWICE", 1110 },
+{ "ER_INVALID_GROUP_FUNC_USE", 1111 },
+{ "ER_UNSUPPORTED_EXTENSION", 1112 },
+{ "ER_TABLE_MUST_HAVE_COLUMNS", 1113 },
+{ "ER_RECORD_FILE_FULL", 1114 },
+{ "ER_UNKNOWN_CHARACTER_SET", 1115 },
+{ "ER_TOO_MANY_TABLES", 1116 },
+{ "ER_TOO_MANY_FIELDS", 1117 },
+{ "ER_TOO_BIG_ROWSIZE", 1118 },
+{ "ER_STACK_OVERRUN", 1119 },
+{ "ER_WRONG_OUTER_JOIN", 1120 },
+{ "ER_NULL_COLUMN_IN_INDEX", 1121 },
+{ "ER_CANT_FIND_UDF", 1122 },
+{ "ER_CANT_INITIALIZE_UDF", 1123 },
+{ "ER_UDF_NO_PATHS", 1124 },
+{ "ER_UDF_EXISTS", 1125 },
+{ "ER_CANT_OPEN_LIBRARY", 1126 },
+{ "ER_CANT_FIND_DL_ENTRY", 1127 },
+{ "ER_FUNCTION_NOT_DEFINED", 1128 },
+{ "ER_HOST_IS_BLOCKED", 1129 },
+{ "ER_HOST_NOT_PRIVILEGED", 1130 },
+{ "ER_PASSWORD_ANONYMOUS_USER", 1131 },
+{ "ER_PASSWORD_NOT_ALLOWED", 1132 },
+{ "ER_PASSWORD_NO_MATCH", 1133 },
+{ "ER_UPDATE_INFO", 1134 },
+{ "ER_CANT_CREATE_THREAD", 1135 },
+{ "ER_WRONG_VALUE_COUNT_ON_ROW", 1136 },
+{ "ER_CANT_REOPEN_TABLE", 1137 },
+{ "ER_INVALID_USE_OF_NULL", 1138 },
+{ "ER_REGEXP_ERROR", 1139 },
+{ "ER_MIX_OF_GROUP_FUNC_AND_FIELDS", 1140 },
+{ "ER_NONEXISTING_GRANT", 1141 },
+{ "ER_TABLEACCESS_DENIED_ERROR", 1142 },
+{ "ER_COLUMNACCESS_DENIED_ERROR", 1143 },
+{ "ER_ILLEGAL_GRANT_FOR_TABLE", 1144 },
+{ "ER_GRANT_WRONG_HOST_OR_USER", 1145 },
+{ "ER_NO_SUCH_TABLE", 1146 },
+{ "ER_NONEXISTING_TABLE_GRANT", 1147 },
+{ "ER_NOT_ALLOWED_COMMAND", 1148 },
+{ "ER_SYNTAX_ERROR", 1149 },
+{ "ER_DELAYED_CANT_CHANGE_LOCK", 1150 },
+{ "ER_TOO_MANY_DELAYED_THREADS", 1151 },
+{ "ER_ABORTING_CONNECTION", 1152 },
+{ "ER_NET_PACKET_TOO_LARGE", 1153 },
+{ "ER_NET_READ_ERROR_FROM_PIPE", 1154 },
+{ "ER_NET_FCNTL_ERROR", 1155 },
+{ "ER_NET_PACKETS_OUT_OF_ORDER", 1156 },
+{ "ER_NET_UNCOMPRESS_ERROR", 1157 },
+{ "ER_NET_READ_ERROR", 1158 },
+{ "ER_NET_READ_INTERRUPTED", 1159 },
+{ "ER_NET_ERROR_ON_WRITE", 1160 },
+{ "ER_NET_WRITE_INTERRUPTED", 1161 },
+{ "ER_TOO_LONG_STRING", 1162 },
+{ "ER_TABLE_CANT_HANDLE_BLOB", 1163 },
+{ "ER_TABLE_CANT_HANDLE_AUTO_INCREMENT", 1164 },
+{ "ER_DELAYED_INSERT_TABLE_LOCKED", 1165 },
+{ "ER_WRONG_COLUMN_NAME", 1166 },
+{ "ER_WRONG_KEY_COLUMN", 1167 },
+{ "ER_WRONG_MRG_TABLE", 1168 },
+{ "ER_DUP_UNIQUE", 1169 },
+{ "ER_BLOB_KEY_WITHOUT_LENGTH", 1170 },
+{ "ER_PRIMARY_CANT_HAVE_NULL", 1171 },
+{ "ER_TOO_MANY_ROWS", 1172 },
+{ "ER_REQUIRES_PRIMARY_KEY", 1173 },
+{ "ER_NO_RAID_COMPILED", 1174 },
+{ "ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE", 1175 },
+{ "ER_KEY_DOES_NOT_EXITS", 1176 },
+{ "ER_CHECK_NO_SUCH_TABLE", 1177 },
+{ "ER_CHECK_NOT_IMPLEMENTED", 1178 },
+{ "ER_CANT_DO_THIS_DURING_AN_TRANSACTION", 1179 },
+{ "ER_ERROR_DURING_COMMIT", 1180 },
+{ "ER_ERROR_DURING_ROLLBACK", 1181 },
+{ "ER_ERROR_DURING_FLUSH_LOGS", 1182 },
+{ "ER_ERROR_DURING_CHECKPOINT", 1183 },
+{ "ER_NEW_ABORTING_CONNECTION", 1184 },
+{ "ER_DUMP_NOT_IMPLEMENTED", 1185 },
+{ "ER_FLUSH_MASTER_BINLOG_CLOSED", 1186 },
+{ "ER_INDEX_REBUILD", 1187 },
+{ "ER_MASTER", 1188 },
+{ "ER_MASTER_NET_READ", 1189 },
+{ "ER_MASTER_NET_WRITE", 1190 },
+{ "ER_FT_MATCHING_KEY_NOT_FOUND", 1191 },
+{ "ER_LOCK_OR_ACTIVE_TRANSACTION", 1192 },
+{ "ER_UNKNOWN_SYSTEM_VARIABLE", 1193 },
+{ "ER_CRASHED_ON_USAGE", 1194 },
+{ "ER_CRASHED_ON_REPAIR", 1195 },
+{ "ER_WARNING_NOT_COMPLETE_ROLLBACK", 1196 },
+{ "ER_TRANS_CACHE_FULL", 1197 },
+{ "ER_SLAVE_MUST_STOP", 1198 },
+{ "ER_SLAVE_NOT_RUNNING", 1199 },
+{ "ER_BAD_SLAVE", 1200 },
+{ "ER_MASTER_INFO", 1201 },
+{ "ER_SLAVE_THREAD", 1202 },
+{ "ER_TOO_MANY_USER_CONNECTIONS", 1203 },
+{ "ER_SET_CONSTANTS_ONLY", 1204 },
+{ "ER_LOCK_WAIT_TIMEOUT", 1205 },
+{ "ER_LOCK_TABLE_FULL", 1206 },
+{ "ER_READ_ONLY_TRANSACTION", 1207 },
+{ "ER_DROP_DB_WITH_READ_LOCK", 1208 },
+{ "ER_CREATE_DB_WITH_READ_LOCK", 1209 },
+{ "ER_WRONG_ARGUMENTS", 1210 },
+{ "ER_NO_PERMISSION_TO_CREATE_USER", 1211 },
+{ "ER_UNION_TABLES_IN_DIFFERENT_DIR", 1212 },
+{ "ER_LOCK_DEADLOCK", 1213 },
+{ "ER_TABLE_CANT_HANDLE_FT", 1214 },
+{ "ER_CANNOT_ADD_FOREIGN", 1215 },
+{ "ER_NO_REFERENCED_ROW", 1216 },
+{ "ER_ROW_IS_REFERENCED", 1217 },
+{ "ER_CONNECT_TO_MASTER", 1218 },
+{ "ER_QUERY_ON_MASTER", 1219 },
+{ "ER_ERROR_WHEN_EXECUTING_COMMAND", 1220 },
+{ "ER_WRONG_USAGE", 1221 },
+{ "ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT", 1222 },
+{ "ER_CANT_UPDATE_WITH_READLOCK", 1223 },
+{ "ER_MIXING_NOT_ALLOWED", 1224 },
+{ "ER_DUP_ARGUMENT", 1225 },
+{ "ER_USER_LIMIT_REACHED", 1226 },
+{ "ER_SPECIFIC_ACCESS_DENIED_ERROR", 1227 },
+{ "ER_LOCAL_VARIABLE", 1228 },
+{ "ER_GLOBAL_VARIABLE", 1229 },
+{ "ER_NO_DEFAULT", 1230 },
+{ "ER_WRONG_VALUE_FOR_VAR", 1231 },
+{ "ER_WRONG_TYPE_FOR_VAR", 1232 },
+{ "ER_VAR_CANT_BE_READ", 1233 },
+{ "ER_CANT_USE_OPTION_HERE", 1234 },
+{ "ER_NOT_SUPPORTED_YET", 1235 },
+{ "ER_MASTER_FATAL_ERROR_READING_BINLOG", 1236 },
+{ "ER_SLAVE_IGNORED_TABLE", 1237 },
+{ "ER_INCORRECT_GLOBAL_LOCAL_VAR", 1238 },
+{ "ER_WRONG_FK_DEF", 1239 },
+{ "ER_KEY_REF_DO_NOT_MATCH_TABLE_REF", 1240 },
+{ "ER_OPERAND_COLUMNS", 1241 },
+{ "ER_SUBQUERY_NO_1_ROW", 1242 },
+{ "ER_UNKNOWN_STMT_HANDLER", 1243 },
+{ "ER_CORRUPT_HELP_DB", 1244 },
+{ "ER_CYCLIC_REFERENCE", 1245 },
+{ "ER_AUTO_CONVERT", 1246 },
+{ "ER_ILLEGAL_REFERENCE", 1247 },
+{ "ER_DERIVED_MUST_HAVE_ALIAS", 1248 },
+{ "ER_SELECT_REDUCED", 1249 },
+{ "ER_TABLENAME_NOT_ALLOWED_HERE", 1250 },
+{ "ER_NOT_SUPPORTED_AUTH_MODE", 1251 },
+{ "ER_SPATIAL_CANT_HAVE_NULL", 1252 },
+{ "ER_COLLATION_CHARSET_MISMATCH", 1253 },
+{ "ER_SLAVE_WAS_RUNNING", 1254 },
+{ "ER_SLAVE_WAS_NOT_RUNNING", 1255 },
+{ "ER_TOO_BIG_FOR_UNCOMPRESS", 1256 },
+{ "ER_ZLIB_Z_MEM_ERROR", 1257 },
+{ "ER_ZLIB_Z_BUF_ERROR", 1258 },
+{ "ER_ZLIB_Z_DATA_ERROR", 1259 },
+{ "ER_CUT_VALUE_GROUP_CONCAT", 1260 },
+{ "ER_WARN_TOO_FEW_RECORDS", 1261 },
+{ "ER_WARN_TOO_MANY_RECORDS", 1262 },
+{ "ER_WARN_NULL_TO_NOTNULL", 1263 },
+{ "ER_WARN_DATA_OUT_OF_RANGE", 1264 },
+{ "WARN_DATA_TRUNCATED", 1265 },
+{ "ER_WARN_USING_OTHER_HANDLER", 1266 },
+{ "ER_CANT_AGGREGATE_2COLLATIONS", 1267 },
+{ "ER_DROP_USER", 1268 },
+{ "ER_REVOKE_GRANTS", 1269 },
+{ "ER_CANT_AGGREGATE_3COLLATIONS", 1270 },
+{ "ER_CANT_AGGREGATE_NCOLLATIONS", 1271 },
+{ "ER_VARIABLE_IS_NOT_STRUCT", 1272 },
+{ "ER_UNKNOWN_COLLATION", 1273 },
+{ "ER_SLAVE_IGNORED_SSL_PARAMS", 1274 },
+{ "ER_SERVER_IS_IN_SECURE_AUTH_MODE", 1275 },
+{ "ER_WARN_FIELD_RESOLVED", 1276 },
+{ "ER_BAD_SLAVE_UNTIL_COND", 1277 },
+{ "ER_MISSING_SKIP_SLAVE", 1278 },
+{ "ER_UNTIL_COND_IGNORED", 1279 },
+{ "ER_WRONG_NAME_FOR_INDEX", 1280 },
+{ "ER_WRONG_NAME_FOR_CATALOG", 1281 },
+{ "ER_WARN_QC_RESIZE", 1282 },
+{ "ER_BAD_FT_COLUMN", 1283 },
+{ "ER_UNKNOWN_KEY_CACHE", 1284 },
+{ "ER_WARN_HOSTNAME_WONT_WORK", 1285 },
+{ "ER_UNKNOWN_STORAGE_ENGINE", 1286 },
+{ "ER_WARN_DEPRECATED_SYNTAX", 1287 },
+{ "ER_NON_UPDATABLE_TABLE", 1288 },
+{ "ER_FEATURE_DISABLED", 1289 },
+{ "ER_OPTION_PREVENTS_STATEMENT", 1290 },
+{ "ER_DUPLICATED_VALUE_IN_TYPE", 1291 },
+{ "ER_TRUNCATED_WRONG_VALUE", 1292 },
+{ "ER_TOO_MUCH_AUTO_TIMESTAMP_COLS", 1293 },
+{ "ER_INVALID_ON_UPDATE", 1294 },
+{ "ER_UNSUPPORTED_PS", 1295 },
+{ "ER_GET_ERRMSG", 1296 },
+{ "ER_GET_TEMPORARY_ERRMSG", 1297 },
+{ "ER_UNKNOWN_TIME_ZONE", 1298 },
+{ "ER_WARN_INVALID_TIMESTAMP", 1299 },
+{ "ER_INVALID_CHARACTER_STRING", 1300 },
+{ "ER_WARN_ALLOWED_PACKET_OVERFLOWED", 1301 },
+{ "ER_CONFLICTING_DECLARATIONS", 1302 },
+{ "ER_SP_NO_RECURSIVE_CREATE", 1303 },
+{ "ER_SP_ALREADY_EXISTS", 1304 },
+{ "ER_SP_DOES_NOT_EXIST", 1305 },
+{ "ER_SP_DROP_FAILED", 1306 },
+{ "ER_SP_STORE_FAILED", 1307 },
+{ "ER_SP_LILABEL_MISMATCH", 1308 },
+{ "ER_SP_LABEL_REDEFINE", 1309 },
+{ "ER_SP_LABEL_MISMATCH", 1310 },
+{ "ER_SP_UNINIT_VAR", 1311 },
+{ "ER_SP_BADSELECT", 1312 },
+{ "ER_SP_BADRETURN", 1313 },
+{ "ER_SP_BADSTATEMENT", 1314 },
+{ "ER_UPDATE_LOG_DEPRECATED_IGNORED", 1315 },
+{ "ER_UPDATE_LOG_DEPRECATED_TRANSLATED", 1316 },
+{ "ER_QUERY_INTERRUPTED", 1317 },
+{ "ER_SP_WRONG_NO_OF_ARGS", 1318 },
+{ "ER_SP_COND_MISMATCH", 1319 },
+{ "ER_SP_NORETURN", 1320 },
+{ "ER_SP_NORETURNEND", 1321 },
+{ "ER_SP_BAD_CURSOR_QUERY", 1322 },
+{ "ER_SP_BAD_CURSOR_SELECT", 1323 },
+{ "ER_SP_CURSOR_MISMATCH", 1324 },
+{ "ER_SP_CURSOR_ALREADY_OPEN", 1325 },
+{ "ER_SP_CURSOR_NOT_OPEN", 1326 },
+{ "ER_SP_UNDECLARED_VAR", 1327 },
+{ "ER_SP_WRONG_NO_OF_FETCH_ARGS", 1328 },
+{ "ER_SP_FETCH_NO_DATA", 1329 },
+{ "ER_SP_DUP_PARAM", 1330 },
+{ "ER_SP_DUP_VAR", 1331 },
+{ "ER_SP_DUP_COND", 1332 },
+{ "ER_SP_DUP_CURS", 1333 },
+{ "ER_SP_CANT_ALTER", 1334 },
+{ "ER_SP_SUBSELECT_NYI", 1335 },
+{ "ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG", 1336 },
+{ "ER_SP_VARCOND_AFTER_CURSHNDLR", 1337 },
+{ "ER_SP_CURSOR_AFTER_HANDLER", 1338 },
+{ "ER_SP_CASE_NOT_FOUND", 1339 },
+{ "ER_FPARSER_TOO_BIG_FILE", 1340 },
+{ "ER_FPARSER_BAD_HEADER", 1341 },
+{ "ER_FPARSER_EOF_IN_COMMENT", 1342 },
+{ "ER_FPARSER_ERROR_IN_PARAMETER", 1343 },
+{ "ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER", 1344 },
+{ "ER_VIEW_NO_EXPLAIN", 1345 },
+{ "ER_FRM_UNKNOWN_TYPE", 1346 },
+{ "ER_WRONG_OBJECT", 1347 },
+{ "ER_NONUPDATEABLE_COLUMN", 1348 },
+{ "ER_VIEW_SELECT_DERIVED", 1349 },
+{ "ER_VIEW_SELECT_CLAUSE", 1350 },
+{ "ER_VIEW_SELECT_VARIABLE", 1351 },
+{ "ER_VIEW_SELECT_TMPTABLE", 1352 },
+{ "ER_VIEW_WRONG_LIST", 1353 },
+{ "ER_WARN_VIEW_MERGE", 1354 },
+{ "ER_WARN_VIEW_WITHOUT_KEY", 1355 },
+{ "ER_VIEW_INVALID", 1356 },
+{ "ER_SP_NO_DROP_SP", 1357 },
+{ "ER_SP_GOTO_IN_HNDLR", 1358 },
+{ "ER_TRG_ALREADY_EXISTS", 1359 },
+{ "ER_TRG_DOES_NOT_EXIST", 1360 },
+{ "ER_TRG_ON_VIEW_OR_TEMP_TABLE", 1361 },
+{ "ER_TRG_CANT_CHANGE_ROW", 1362 },
+{ "ER_TRG_NO_SUCH_ROW_IN_TRG", 1363 },
+{ "ER_NO_DEFAULT_FOR_FIELD", 1364 },
+{ "ER_DIVISION_BY_ZERO", 1365 },
+{ "ER_TRUNCATED_WRONG_VALUE_FOR_FIELD", 1366 },
+{ "ER_ILLEGAL_VALUE_FOR_TYPE", 1367 },
+{ "ER_VIEW_NONUPD_CHECK", 1368 },
+{ "ER_VIEW_CHECK_FAILED", 1369 },
+{ "ER_PROCACCESS_DENIED_ERROR", 1370 },
+{ "ER_RELAY_LOG_FAIL", 1371 },
+{ "ER_PASSWD_LENGTH", 1372 },
+{ "ER_UNKNOWN_TARGET_BINLOG", 1373 },
+{ "ER_IO_ERR_LOG_INDEX_READ", 1374 },
+{ "ER_BINLOG_PURGE_PROHIBITED", 1375 },
+{ "ER_FSEEK_FAIL", 1376 },
+{ "ER_BINLOG_PURGE_FATAL_ERR", 1377 },
+{ "ER_LOG_IN_USE", 1378 },
+{ "ER_LOG_PURGE_UNKNOWN_ERR", 1379 },
+{ "ER_RELAY_LOG_INIT", 1380 },
+{ "ER_NO_BINARY_LOGGING", 1381 },
+{ "ER_RESERVED_SYNTAX", 1382 },
+{ "ER_WSAS_FAILED", 1383 },
+{ "ER_DIFF_GROUPS_PROC", 1384 },
+{ "ER_NO_GROUP_FOR_PROC", 1385 },
+{ "ER_ORDER_WITH_PROC", 1386 },
+{ "ER_LOGGING_PROHIBIT_CHANGING_OF", 1387 },
+{ "ER_NO_FILE_MAPPING", 1388 },
+{ "ER_WRONG_MAGIC", 1389 },
+{ "ER_PS_MANY_PARAM", 1390 },
+{ "ER_KEY_PART_0", 1391 },
+{ "ER_VIEW_CHECKSUM", 1392 },
+{ "ER_VIEW_MULTIUPDATE", 1393 },
+{ "ER_VIEW_NO_INSERT_FIELD_LIST", 1394 },
+{ "ER_VIEW_DELETE_MERGE_VIEW", 1395 },
+{ "ER_CANNOT_USER", 1396 },
+{ "ER_XAER_NOTA", 1397 },
+{ "ER_XAER_INVAL", 1398 },
+{ "ER_XAER_RMFAIL", 1399 },
+{ "ER_XAER_OUTSIDE", 1400 },
+{ "ER_XAER_RMERR", 1401 },
+{ "ER_XA_RBROLLBACK", 1402 },
+{ "ER_NONEXISTING_PROC_GRANT", 1403 },
+{ "ER_PROC_AUTO_GRANT_FAIL", 1404 },
+{ "ER_PROC_AUTO_REVOKE_FAIL", 1405 },
+{ "ER_DATA_TOO_LONG", 1406 },
+{ "ER_SP_BAD_SQLSTATE", 1407 },
+{ "ER_STARTUP", 1408 },
+{ "ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR", 1409 },
+{ "ER_CANT_CREATE_USER_WITH_GRANT", 1410 },
+{ "ER_WRONG_VALUE_FOR_TYPE", 1411 },
+{ "ER_TABLE_DEF_CHANGED", 1412 },
+{ "ER_SP_DUP_HANDLER", 1413 },
+{ "ER_SP_NOT_VAR_ARG", 1414 },
+{ "ER_SP_NO_RETSET", 1415 },
+{ "ER_CANT_CREATE_GEOMETRY_OBJECT", 1416 },
+{ "ER_FAILED_ROUTINE_BREAK_BINLOG", 1417 },
+{ "ER_BINLOG_UNSAFE_ROUTINE", 1418 },
+{ "ER_BINLOG_CREATE_ROUTINE_NEED_SUPER", 1419 },
+{ "ER_EXEC_STMT_WITH_OPEN_CURSOR", 1420 },
+{ "ER_STMT_HAS_NO_OPEN_CURSOR", 1421 },
+{ "ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG", 1422 },
+{ "ER_NO_DEFAULT_FOR_VIEW_FIELD", 1423 },
+{ "ER_SP_NO_RECURSION", 1424 },
+{ "ER_TOO_BIG_SCALE", 1425 },
+{ "ER_TOO_BIG_PRECISION", 1426 },
+{ "ER_M_BIGGER_THAN_D", 1427 },
+{ "ER_WRONG_LOCK_OF_SYSTEM_TABLE", 1428 },
+{ "ER_CONNECT_TO_FOREIGN_DATA_SOURCE", 1429 },
+{ "ER_QUERY_ON_FOREIGN_DATA_SOURCE", 1430 },
+{ "ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST", 1431 },
+{ "ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE", 1432 },
+{ "ER_FOREIGN_DATA_STRING_INVALID", 1433 },
+{ "ER_CANT_CREATE_FEDERATED_TABLE", 1434 },
+{ "ER_TRG_IN_WRONG_SCHEMA", 1435 },
+{ "ER_STACK_OVERRUN_NEED_MORE", 1436 },
+{ "ER_TOO_LONG_BODY", 1437 },
+{ "ER_WARN_CANT_DROP_DEFAULT_KEYCACHE", 1438 },
+{ "ER_TOO_BIG_DISPLAYWIDTH", 1439 },
+{ "ER_XAER_DUPID", 1440 },
+{ "ER_DATETIME_FUNCTION_OVERFLOW", 1441 },
+{ "ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG", 1442 },
+{ "ER_VIEW_PREVENT_UPDATE", 1443 },
+{ "ER_PS_NO_RECURSION", 1444 },
+{ "ER_SP_CANT_SET_AUTOCOMMIT", 1445 },
+{ "ER_NO_VIEW_USER", 1446 },
+{ "ER_VIEW_FRM_NO_USER", 1447 },
+{ "ER_VIEW_OTHER_USER", 1448 },
+{ "ER_NO_SUCH_USER", 1449 },
+{ "ER_FORBID_SCHEMA_CHANGE", 1450 },
+{ "ER_ROW_IS_REFERENCED_2", 1451 },
+{ "ER_NO_REFERENCED_ROW_2", 1452 },
+{ "ER_SP_BAD_VAR_SHADOW", 1453 },
diff --git a/src/terralib/drivers/MySQL/include/mysqld_error.h b/src/terralib/drivers/MySQL/include/mysqld_error.h
new file mode 100644
index 0000000..556bcad
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/mysqld_error.h
@@ -0,0 +1,458 @@
+/* Autogenerated file, please don't edit */
+
+#define ER_ERROR_FIRST 1000
+#define ER_HASHCHK 1000
+#define ER_NISAMCHK 1001
+#define ER_NO 1002
+#define ER_YES 1003
+#define ER_CANT_CREATE_FILE 1004
+#define ER_CANT_CREATE_TABLE 1005
+#define ER_CANT_CREATE_DB 1006
+#define ER_DB_CREATE_EXISTS 1007
+#define ER_DB_DROP_EXISTS 1008
+#define ER_DB_DROP_DELETE 1009
+#define ER_DB_DROP_RMDIR 1010
+#define ER_CANT_DELETE_FILE 1011
+#define ER_CANT_FIND_SYSTEM_REC 1012
+#define ER_CANT_GET_STAT 1013
+#define ER_CANT_GET_WD 1014
+#define ER_CANT_LOCK 1015
+#define ER_CANT_OPEN_FILE 1016
+#define ER_FILE_NOT_FOUND 1017
+#define ER_CANT_READ_DIR 1018
+#define ER_CANT_SET_WD 1019
+#define ER_CHECKREAD 1020
+#define ER_DISK_FULL 1021
+#define ER_DUP_KEY 1022
+#define ER_ERROR_ON_CLOSE 1023
+#define ER_ERROR_ON_READ 1024
+#define ER_ERROR_ON_RENAME 1025
+#define ER_ERROR_ON_WRITE 1026
+#define ER_FILE_USED 1027
+#define ER_FILSORT_ABORT 1028
+#define ER_FORM_NOT_FOUND 1029
+#define ER_GET_ERRNO 1030
+#define ER_ILLEGAL_HA 1031
+#define ER_KEY_NOT_FOUND 1032
+#define ER_NOT_FORM_FILE 1033
+#define ER_NOT_KEYFILE 1034
+#define ER_OLD_KEYFILE 1035
+#define ER_OPEN_AS_READONLY 1036
+#define ER_OUTOFMEMORY 1037
+#define ER_OUT_OF_SORTMEMORY 1038
+#define ER_UNEXPECTED_EOF 1039
+#define ER_CON_COUNT_ERROR 1040
+#define ER_OUT_OF_RESOURCES 1041
+#define ER_BAD_HOST_ERROR 1042
+#define ER_HANDSHAKE_ERROR 1043
+#define ER_DBACCESS_DENIED_ERROR 1044
+#define ER_ACCESS_DENIED_ERROR 1045
+#define ER_NO_DB_ERROR 1046
+#define ER_UNKNOWN_COM_ERROR 1047
+#define ER_BAD_NULL_ERROR 1048
+#define ER_BAD_DB_ERROR 1049
+#define ER_TABLE_EXISTS_ERROR 1050
+#define ER_BAD_TABLE_ERROR 1051
+#define ER_NON_UNIQ_ERROR 1052
+#define ER_SERVER_SHUTDOWN 1053
+#define ER_BAD_FIELD_ERROR 1054
+#define ER_WRONG_FIELD_WITH_GROUP 1055
+#define ER_WRONG_GROUP_FIELD 1056
+#define ER_WRONG_SUM_SELECT 1057
+#define ER_WRONG_VALUE_COUNT 1058
+#define ER_TOO_LONG_IDENT 1059
+#define ER_DUP_FIELDNAME 1060
+#define ER_DUP_KEYNAME 1061
+#define ER_DUP_ENTRY 1062
+#define ER_WRONG_FIELD_SPEC 1063
+#define ER_PARSE_ERROR 1064
+#define ER_EMPTY_QUERY 1065
+#define ER_NONUNIQ_TABLE 1066
+#define ER_INVALID_DEFAULT 1067
+#define ER_MULTIPLE_PRI_KEY 1068
+#define ER_TOO_MANY_KEYS 1069
+#define ER_TOO_MANY_KEY_PARTS 1070
+#define ER_TOO_LONG_KEY 1071
+#define ER_KEY_COLUMN_DOES_NOT_EXITS 1072
+#define ER_BLOB_USED_AS_KEY 1073
+#define ER_TOO_BIG_FIELDLENGTH 1074
+#define ER_WRONG_AUTO_KEY 1075
+#define ER_READY 1076
+#define ER_NORMAL_SHUTDOWN 1077
+#define ER_GOT_SIGNAL 1078
+#define ER_SHUTDOWN_COMPLETE 1079
+#define ER_FORCING_CLOSE 1080
+#define ER_IPSOCK_ERROR 1081
+#define ER_NO_SUCH_INDEX 1082
+#define ER_WRONG_FIELD_TERMINATORS 1083
+#define ER_BLOBS_AND_NO_TERMINATED 1084
+#define ER_TEXTFILE_NOT_READABLE 1085
+#define ER_FILE_EXISTS_ERROR 1086
+#define ER_LOAD_INFO 1087
+#define ER_ALTER_INFO 1088
+#define ER_WRONG_SUB_KEY 1089
+#define ER_CANT_REMOVE_ALL_FIELDS 1090
+#define ER_CANT_DROP_FIELD_OR_KEY 1091
+#define ER_INSERT_INFO 1092
+#define ER_UPDATE_TABLE_USED 1093
+#define ER_NO_SUCH_THREAD 1094
+#define ER_KILL_DENIED_ERROR 1095
+#define ER_NO_TABLES_USED 1096
+#define ER_TOO_BIG_SET 1097
+#define ER_NO_UNIQUE_LOGFILE 1098
+#define ER_TABLE_NOT_LOCKED_FOR_WRITE 1099
+#define ER_TABLE_NOT_LOCKED 1100
+#define ER_BLOB_CANT_HAVE_DEFAULT 1101
+#define ER_WRONG_DB_NAME 1102
+#define ER_WRONG_TABLE_NAME 1103
+#define ER_TOO_BIG_SELECT 1104
+#define ER_UNKNOWN_ERROR 1105
+#define ER_UNKNOWN_PROCEDURE 1106
+#define ER_WRONG_PARAMCOUNT_TO_PROCEDURE 1107
+#define ER_WRONG_PARAMETERS_TO_PROCEDURE 1108
+#define ER_UNKNOWN_TABLE 1109
+#define ER_FIELD_SPECIFIED_TWICE 1110
+#define ER_INVALID_GROUP_FUNC_USE 1111
+#define ER_UNSUPPORTED_EXTENSION 1112
+#define ER_TABLE_MUST_HAVE_COLUMNS 1113
+#define ER_RECORD_FILE_FULL 1114
+#define ER_UNKNOWN_CHARACTER_SET 1115
+#define ER_TOO_MANY_TABLES 1116
+#define ER_TOO_MANY_FIELDS 1117
+#define ER_TOO_BIG_ROWSIZE 1118
+#define ER_STACK_OVERRUN 1119
+#define ER_WRONG_OUTER_JOIN 1120
+#define ER_NULL_COLUMN_IN_INDEX 1121
+#define ER_CANT_FIND_UDF 1122
+#define ER_CANT_INITIALIZE_UDF 1123
+#define ER_UDF_NO_PATHS 1124
+#define ER_UDF_EXISTS 1125
+#define ER_CANT_OPEN_LIBRARY 1126
+#define ER_CANT_FIND_DL_ENTRY 1127
+#define ER_FUNCTION_NOT_DEFINED 1128
+#define ER_HOST_IS_BLOCKED 1129
+#define ER_HOST_NOT_PRIVILEGED 1130
+#define ER_PASSWORD_ANONYMOUS_USER 1131
+#define ER_PASSWORD_NOT_ALLOWED 1132
+#define ER_PASSWORD_NO_MATCH 1133
+#define ER_UPDATE_INFO 1134
+#define ER_CANT_CREATE_THREAD 1135
+#define ER_WRONG_VALUE_COUNT_ON_ROW 1136
+#define ER_CANT_REOPEN_TABLE 1137
+#define ER_INVALID_USE_OF_NULL 1138
+#define ER_REGEXP_ERROR 1139
+#define ER_MIX_OF_GROUP_FUNC_AND_FIELDS 1140
+#define ER_NONEXISTING_GRANT 1141
+#define ER_TABLEACCESS_DENIED_ERROR 1142
+#define ER_COLUMNACCESS_DENIED_ERROR 1143
+#define ER_ILLEGAL_GRANT_FOR_TABLE 1144
+#define ER_GRANT_WRONG_HOST_OR_USER 1145
+#define ER_NO_SUCH_TABLE 1146
+#define ER_NONEXISTING_TABLE_GRANT 1147
+#define ER_NOT_ALLOWED_COMMAND 1148
+#define ER_SYNTAX_ERROR 1149
+#define ER_DELAYED_CANT_CHANGE_LOCK 1150
+#define ER_TOO_MANY_DELAYED_THREADS 1151
+#define ER_ABORTING_CONNECTION 1152
+#define ER_NET_PACKET_TOO_LARGE 1153
+#define ER_NET_READ_ERROR_FROM_PIPE 1154
+#define ER_NET_FCNTL_ERROR 1155
+#define ER_NET_PACKETS_OUT_OF_ORDER 1156
+#define ER_NET_UNCOMPRESS_ERROR 1157
+#define ER_NET_READ_ERROR 1158
+#define ER_NET_READ_INTERRUPTED 1159
+#define ER_NET_ERROR_ON_WRITE 1160
+#define ER_NET_WRITE_INTERRUPTED 1161
+#define ER_TOO_LONG_STRING 1162
+#define ER_TABLE_CANT_HANDLE_BLOB 1163
+#define ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 1164
+#define ER_DELAYED_INSERT_TABLE_LOCKED 1165
+#define ER_WRONG_COLUMN_NAME 1166
+#define ER_WRONG_KEY_COLUMN 1167
+#define ER_WRONG_MRG_TABLE 1168
+#define ER_DUP_UNIQUE 1169
+#define ER_BLOB_KEY_WITHOUT_LENGTH 1170
+#define ER_PRIMARY_CANT_HAVE_NULL 1171
+#define ER_TOO_MANY_ROWS 1172
+#define ER_REQUIRES_PRIMARY_KEY 1173
+#define ER_NO_RAID_COMPILED 1174
+#define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 1175
+#define ER_KEY_DOES_NOT_EXITS 1176
+#define ER_CHECK_NO_SUCH_TABLE 1177
+#define ER_CHECK_NOT_IMPLEMENTED 1178
+#define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 1179
+#define ER_ERROR_DURING_COMMIT 1180
+#define ER_ERROR_DURING_ROLLBACK 1181
+#define ER_ERROR_DURING_FLUSH_LOGS 1182
+#define ER_ERROR_DURING_CHECKPOINT 1183
+#define ER_NEW_ABORTING_CONNECTION 1184
+#define ER_DUMP_NOT_IMPLEMENTED 1185
+#define ER_FLUSH_MASTER_BINLOG_CLOSED 1186
+#define ER_INDEX_REBUILD 1187
+#define ER_MASTER 1188
+#define ER_MASTER_NET_READ 1189
+#define ER_MASTER_NET_WRITE 1190
+#define ER_FT_MATCHING_KEY_NOT_FOUND 1191
+#define ER_LOCK_OR_ACTIVE_TRANSACTION 1192
+#define ER_UNKNOWN_SYSTEM_VARIABLE 1193
+#define ER_CRASHED_ON_USAGE 1194
+#define ER_CRASHED_ON_REPAIR 1195
+#define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196
+#define ER_TRANS_CACHE_FULL 1197
+#define ER_SLAVE_MUST_STOP 1198
+#define ER_SLAVE_NOT_RUNNING 1199
+#define ER_BAD_SLAVE 1200
+#define ER_MASTER_INFO 1201
+#define ER_SLAVE_THREAD 1202
+#define ER_TOO_MANY_USER_CONNECTIONS 1203
+#define ER_SET_CONSTANTS_ONLY 1204
+#define ER_LOCK_WAIT_TIMEOUT 1205
+#define ER_LOCK_TABLE_FULL 1206
+#define ER_READ_ONLY_TRANSACTION 1207
+#define ER_DROP_DB_WITH_READ_LOCK 1208
+#define ER_CREATE_DB_WITH_READ_LOCK 1209
+#define ER_WRONG_ARGUMENTS 1210
+#define ER_NO_PERMISSION_TO_CREATE_USER 1211
+#define ER_UNION_TABLES_IN_DIFFERENT_DIR 1212
+#define ER_LOCK_DEADLOCK 1213
+#define ER_TABLE_CANT_HANDLE_FT 1214
+#define ER_CANNOT_ADD_FOREIGN 1215
+#define ER_NO_REFERENCED_ROW 1216
+#define ER_ROW_IS_REFERENCED 1217
+#define ER_CONNECT_TO_MASTER 1218
+#define ER_QUERY_ON_MASTER 1219
+#define ER_ERROR_WHEN_EXECUTING_COMMAND 1220
+#define ER_WRONG_USAGE 1221
+#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1222
+#define ER_CANT_UPDATE_WITH_READLOCK 1223
+#define ER_MIXING_NOT_ALLOWED 1224
+#define ER_DUP_ARGUMENT 1225
+#define ER_USER_LIMIT_REACHED 1226
+#define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227
+#define ER_LOCAL_VARIABLE 1228
+#define ER_GLOBAL_VARIABLE 1229
+#define ER_NO_DEFAULT 1230
+#define ER_WRONG_VALUE_FOR_VAR 1231
+#define ER_WRONG_TYPE_FOR_VAR 1232
+#define ER_VAR_CANT_BE_READ 1233
+#define ER_CANT_USE_OPTION_HERE 1234
+#define ER_NOT_SUPPORTED_YET 1235
+#define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
+#define ER_SLAVE_IGNORED_TABLE 1237
+#define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238
+#define ER_WRONG_FK_DEF 1239
+#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240
+#define ER_OPERAND_COLUMNS 1241
+#define ER_SUBQUERY_NO_1_ROW 1242
+#define ER_UNKNOWN_STMT_HANDLER 1243
+#define ER_CORRUPT_HELP_DB 1244
+#define ER_CYCLIC_REFERENCE 1245
+#define ER_AUTO_CONVERT 1246
+#define ER_ILLEGAL_REFERENCE 1247
+#define ER_DERIVED_MUST_HAVE_ALIAS 1248
+#define ER_SELECT_REDUCED 1249
+#define ER_TABLENAME_NOT_ALLOWED_HERE 1250
+#define ER_NOT_SUPPORTED_AUTH_MODE 1251
+#define ER_SPATIAL_CANT_HAVE_NULL 1252
+#define ER_COLLATION_CHARSET_MISMATCH 1253
+#define ER_SLAVE_WAS_RUNNING 1254
+#define ER_SLAVE_WAS_NOT_RUNNING 1255
+#define ER_TOO_BIG_FOR_UNCOMPRESS 1256
+#define ER_ZLIB_Z_MEM_ERROR 1257
+#define ER_ZLIB_Z_BUF_ERROR 1258
+#define ER_ZLIB_Z_DATA_ERROR 1259
+#define ER_CUT_VALUE_GROUP_CONCAT 1260
+#define ER_WARN_TOO_FEW_RECORDS 1261
+#define ER_WARN_TOO_MANY_RECORDS 1262
+#define ER_WARN_NULL_TO_NOTNULL 1263
+#define ER_WARN_DATA_OUT_OF_RANGE 1264
+#define WARN_DATA_TRUNCATED 1265
+#define ER_WARN_USING_OTHER_HANDLER 1266
+#define ER_CANT_AGGREGATE_2COLLATIONS 1267
+#define ER_DROP_USER 1268
+#define ER_REVOKE_GRANTS 1269
+#define ER_CANT_AGGREGATE_3COLLATIONS 1270
+#define ER_CANT_AGGREGATE_NCOLLATIONS 1271
+#define ER_VARIABLE_IS_NOT_STRUCT 1272
+#define ER_UNKNOWN_COLLATION 1273
+#define ER_SLAVE_IGNORED_SSL_PARAMS 1274
+#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275
+#define ER_WARN_FIELD_RESOLVED 1276
+#define ER_BAD_SLAVE_UNTIL_COND 1277
+#define ER_MISSING_SKIP_SLAVE 1278
+#define ER_UNTIL_COND_IGNORED 1279
+#define ER_WRONG_NAME_FOR_INDEX 1280
+#define ER_WRONG_NAME_FOR_CATALOG 1281
+#define ER_WARN_QC_RESIZE 1282
+#define ER_BAD_FT_COLUMN 1283
+#define ER_UNKNOWN_KEY_CACHE 1284
+#define ER_WARN_HOSTNAME_WONT_WORK 1285
+#define ER_UNKNOWN_STORAGE_ENGINE 1286
+#define ER_WARN_DEPRECATED_SYNTAX 1287
+#define ER_NON_UPDATABLE_TABLE 1288
+#define ER_FEATURE_DISABLED 1289
+#define ER_OPTION_PREVENTS_STATEMENT 1290
+#define ER_DUPLICATED_VALUE_IN_TYPE 1291
+#define ER_TRUNCATED_WRONG_VALUE 1292
+#define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293
+#define ER_INVALID_ON_UPDATE 1294
+#define ER_UNSUPPORTED_PS 1295
+#define ER_GET_ERRMSG 1296
+#define ER_GET_TEMPORARY_ERRMSG 1297
+#define ER_UNKNOWN_TIME_ZONE 1298
+#define ER_WARN_INVALID_TIMESTAMP 1299
+#define ER_INVALID_CHARACTER_STRING 1300
+#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301
+#define ER_CONFLICTING_DECLARATIONS 1302
+#define ER_SP_NO_RECURSIVE_CREATE 1303
+#define ER_SP_ALREADY_EXISTS 1304
+#define ER_SP_DOES_NOT_EXIST 1305
+#define ER_SP_DROP_FAILED 1306
+#define ER_SP_STORE_FAILED 1307
+#define ER_SP_LILABEL_MISMATCH 1308
+#define ER_SP_LABEL_REDEFINE 1309
+#define ER_SP_LABEL_MISMATCH 1310
+#define ER_SP_UNINIT_VAR 1311
+#define ER_SP_BADSELECT 1312
+#define ER_SP_BADRETURN 1313
+#define ER_SP_BADSTATEMENT 1314
+#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1315
+#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1316
+#define ER_QUERY_INTERRUPTED 1317
+#define ER_SP_WRONG_NO_OF_ARGS 1318
+#define ER_SP_COND_MISMATCH 1319
+#define ER_SP_NORETURN 1320
+#define ER_SP_NORETURNEND 1321
+#define ER_SP_BAD_CURSOR_QUERY 1322
+#define ER_SP_BAD_CURSOR_SELECT 1323
+#define ER_SP_CURSOR_MISMATCH 1324
+#define ER_SP_CURSOR_ALREADY_OPEN 1325
+#define ER_SP_CURSOR_NOT_OPEN 1326
+#define ER_SP_UNDECLARED_VAR 1327
+#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1328
+#define ER_SP_FETCH_NO_DATA 1329
+#define ER_SP_DUP_PARAM 1330
+#define ER_SP_DUP_VAR 1331
+#define ER_SP_DUP_COND 1332
+#define ER_SP_DUP_CURS 1333
+#define ER_SP_CANT_ALTER 1334
+#define ER_SP_SUBSELECT_NYI 1335
+#define ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG 1336
+#define ER_SP_VARCOND_AFTER_CURSHNDLR 1337
+#define ER_SP_CURSOR_AFTER_HANDLER 1338
+#define ER_SP_CASE_NOT_FOUND 1339
+#define ER_FPARSER_TOO_BIG_FILE 1340
+#define ER_FPARSER_BAD_HEADER 1341
+#define ER_FPARSER_EOF_IN_COMMENT 1342
+#define ER_FPARSER_ERROR_IN_PARAMETER 1343
+#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1344
+#define ER_VIEW_NO_EXPLAIN 1345
+#define ER_FRM_UNKNOWN_TYPE 1346
+#define ER_WRONG_OBJECT 1347
+#define ER_NONUPDATEABLE_COLUMN 1348
+#define ER_VIEW_SELECT_DERIVED 1349
+#define ER_VIEW_SELECT_CLAUSE 1350
+#define ER_VIEW_SELECT_VARIABLE 1351
+#define ER_VIEW_SELECT_TMPTABLE 1352
+#define ER_VIEW_WRONG_LIST 1353
+#define ER_WARN_VIEW_MERGE 1354
+#define ER_WARN_VIEW_WITHOUT_KEY 1355
+#define ER_VIEW_INVALID 1356
+#define ER_SP_NO_DROP_SP 1357
+#define ER_SP_GOTO_IN_HNDLR 1358
+#define ER_TRG_ALREADY_EXISTS 1359
+#define ER_TRG_DOES_NOT_EXIST 1360
+#define ER_TRG_ON_VIEW_OR_TEMP_TABLE 1361
+#define ER_TRG_CANT_CHANGE_ROW 1362
+#define ER_TRG_NO_SUCH_ROW_IN_TRG 1363
+#define ER_NO_DEFAULT_FOR_FIELD 1364
+#define ER_DIVISION_BY_ZERO 1365
+#define ER_TRUNCATED_WRONG_VALUE_FOR_FIELD 1366
+#define ER_ILLEGAL_VALUE_FOR_TYPE 1367
+#define ER_VIEW_NONUPD_CHECK 1368
+#define ER_VIEW_CHECK_FAILED 1369
+#define ER_PROCACCESS_DENIED_ERROR 1370
+#define ER_RELAY_LOG_FAIL 1371
+#define ER_PASSWD_LENGTH 1372
+#define ER_UNKNOWN_TARGET_BINLOG 1373
+#define ER_IO_ERR_LOG_INDEX_READ 1374
+#define ER_BINLOG_PURGE_PROHIBITED 1375
+#define ER_FSEEK_FAIL 1376
+#define ER_BINLOG_PURGE_FATAL_ERR 1377
+#define ER_LOG_IN_USE 1378
+#define ER_LOG_PURGE_UNKNOWN_ERR 1379
+#define ER_RELAY_LOG_INIT 1380
+#define ER_NO_BINARY_LOGGING 1381
+#define ER_RESERVED_SYNTAX 1382
+#define ER_WSAS_FAILED 1383
+#define ER_DIFF_GROUPS_PROC 1384
+#define ER_NO_GROUP_FOR_PROC 1385
+#define ER_ORDER_WITH_PROC 1386
+#define ER_LOGGING_PROHIBIT_CHANGING_OF 1387
+#define ER_NO_FILE_MAPPING 1388
+#define ER_WRONG_MAGIC 1389
+#define ER_PS_MANY_PARAM 1390
+#define ER_KEY_PART_0 1391
+#define ER_VIEW_CHECKSUM 1392
+#define ER_VIEW_MULTIUPDATE 1393
+#define ER_VIEW_NO_INSERT_FIELD_LIST 1394
+#define ER_VIEW_DELETE_MERGE_VIEW 1395
+#define ER_CANNOT_USER 1396
+#define ER_XAER_NOTA 1397
+#define ER_XAER_INVAL 1398
+#define ER_XAER_RMFAIL 1399
+#define ER_XAER_OUTSIDE 1400
+#define ER_XAER_RMERR 1401
+#define ER_XA_RBROLLBACK 1402
+#define ER_NONEXISTING_PROC_GRANT 1403
+#define ER_PROC_AUTO_GRANT_FAIL 1404
+#define ER_PROC_AUTO_REVOKE_FAIL 1405
+#define ER_DATA_TOO_LONG 1406
+#define ER_SP_BAD_SQLSTATE 1407
+#define ER_STARTUP 1408
+#define ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR 1409
+#define ER_CANT_CREATE_USER_WITH_GRANT 1410
+#define ER_WRONG_VALUE_FOR_TYPE 1411
+#define ER_TABLE_DEF_CHANGED 1412
+#define ER_SP_DUP_HANDLER 1413
+#define ER_SP_NOT_VAR_ARG 1414
+#define ER_SP_NO_RETSET 1415
+#define ER_CANT_CREATE_GEOMETRY_OBJECT 1416
+#define ER_FAILED_ROUTINE_BREAK_BINLOG 1417
+#define ER_BINLOG_UNSAFE_ROUTINE 1418
+#define ER_BINLOG_CREATE_ROUTINE_NEED_SUPER 1419
+#define ER_EXEC_STMT_WITH_OPEN_CURSOR 1420
+#define ER_STMT_HAS_NO_OPEN_CURSOR 1421
+#define ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG 1422
+#define ER_NO_DEFAULT_FOR_VIEW_FIELD 1423
+#define ER_SP_NO_RECURSION 1424
+#define ER_TOO_BIG_SCALE 1425
+#define ER_TOO_BIG_PRECISION 1426
+#define ER_M_BIGGER_THAN_D 1427
+#define ER_WRONG_LOCK_OF_SYSTEM_TABLE 1428
+#define ER_CONNECT_TO_FOREIGN_DATA_SOURCE 1429
+#define ER_QUERY_ON_FOREIGN_DATA_SOURCE 1430
+#define ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST 1431
+#define ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE 1432
+#define ER_FOREIGN_DATA_STRING_INVALID 1433
+#define ER_CANT_CREATE_FEDERATED_TABLE 1434
+#define ER_TRG_IN_WRONG_SCHEMA 1435
+#define ER_STACK_OVERRUN_NEED_MORE 1436
+#define ER_TOO_LONG_BODY 1437
+#define ER_WARN_CANT_DROP_DEFAULT_KEYCACHE 1438
+#define ER_TOO_BIG_DISPLAYWIDTH 1439
+#define ER_XAER_DUPID 1440
+#define ER_DATETIME_FUNCTION_OVERFLOW 1441
+#define ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG 1442
+#define ER_VIEW_PREVENT_UPDATE 1443
+#define ER_PS_NO_RECURSION 1444
+#define ER_SP_CANT_SET_AUTOCOMMIT 1445
+#define ER_NO_VIEW_USER 1446
+#define ER_VIEW_FRM_NO_USER 1447
+#define ER_VIEW_OTHER_USER 1448
+#define ER_NO_SUCH_USER 1449
+#define ER_FORBID_SCHEMA_CHANGE 1450
+#define ER_ROW_IS_REFERENCED_2 1451
+#define ER_NO_REFERENCED_ROW_2 1452
+#define ER_SP_BAD_VAR_SHADOW 1453
+#define ER_ERROR_LAST 1453
diff --git a/src/terralib/drivers/MySQL/include/raid.h b/src/terralib/drivers/MySQL/include/raid.h
new file mode 100644
index 0000000..519ba9e
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/raid.h
@@ -0,0 +1,159 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/* Parser needs these defines  always, even if USE_RAID is not defined */
+#define RAID_TYPE_0 1       /* Striping */
+#define RAID_TYPE_x 2       /* Some new modes */
+#define RAID_TYPE_y 3
+
+#define RAID_DEFAULT_CHUNKS 4
+#define RAID_DEFAULT_CHUNKSIZE 256*1024 /* 256kB */
+
+C_MODE_START
+#define my_raid_type(raid_type)  raid_type_string[(int)(raid_type)]
+extern const char *raid_type_string[];
+C_MODE_END
+
+#ifdef DONT_USE_RAID
+#undef USE_RAID
+#endif
+#if defined(USE_RAID)
+
+#include "my_dir.h"
+
+/* Trap all occurences of my_...() in source and use our wrapper around this function */
+
+#ifdef MAP_TO_USE_RAID
+#define my_read(A,B,C,D)     my_raid_read(A,B,C,D)
+#define my_write(A,B,C,D)    my_raid_write(A,B,C,D)
+#define my_pwrite(A,B,C,D,E) my_raid_pwrite(A,B,C,D,E)
+#define my_pread(A,B,C,D,E)  my_raid_pread(A,B,C,D,E)
+#define my_chsize(A,B,C,D)   my_raid_chsize(A,B,C,D)
+#define my_close(A,B)        my_raid_close(A,B)
+#define my_tell(A,B)         my_raid_tell(A,B)
+#define my_seek(A,B,C,D)     my_raid_seek(A,B,C,D)
+#define my_lock(A,B,C,D,E)     my_raid_lock(A,B,C,D,E)
+#define my_fstat(A,B,C)     my_raid_fstat(A,B,C)
+#endif /* MAP_TO_USE_RAID */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  void init_raid(void);
+  void end_raid(void);
+
+  bool is_raid(File fd);
+  File my_raid_create(const char *FileName, int CreateFlags, int access_flags,
+		      uint raid_type, uint raid_chunks, ulong raid_chunksize,
+		      myf MyFlags);
+  File my_raid_open(const char *FileName, int Flags,
+		    uint raid_type, uint raid_chunks, ulong raid_chunksize,
+		    myf MyFlags);
+  int my_raid_rename(const char *from, const char *to, uint raid_chunks,
+		     myf MyFlags);
+  int my_raid_delete(const char *from, uint raid_chunks, myf MyFlags);
+  int my_raid_redel(const char *old_name, const char *new_name,
+		    uint raid_chunks, myf MyFlags);
+
+  my_off_t my_raid_seek(File fd, my_off_t pos, int whence, myf MyFlags);
+  my_off_t my_raid_tell(File fd, myf MyFlags);
+
+  uint my_raid_write(File,const byte *Buffer, uint Count, myf MyFlags);
+  uint my_raid_read(File Filedes, byte *Buffer, uint Count, myf MyFlags);
+
+  uint my_raid_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
+		     myf MyFlags);
+  uint my_raid_pwrite(int Filedes, const byte *Buffer, uint Count,
+		      my_off_t offset, myf MyFlags);
+
+  int my_raid_lock(File,int locktype, my_off_t start, my_off_t length,
+		   myf MyFlags);
+  int my_raid_chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
+  int my_raid_close(File, myf MyFlags);
+  int my_raid_fstat(int Filedes, struct stat *buf,  myf MyFlags);
+
+#ifdef __cplusplus
+}
+
+#ifdef USE_PRAGMA_INTERFACE
+#pragma interface			/* gcc class implementation */
+#endif
+
+class RaidName {
+  public:
+    RaidName(const char *FileName);
+    ~RaidName();
+    bool IsRaid();
+    int Rename(const char * from, const char * to, myf MyFlags);
+  private:
+    uint _raid_type;       /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
+    uint _raid_chunks;     /* 1..n */
+    ulong _raid_chunksize; /* 1..n in bytes */
+};
+
+class RaidFd {
+  public:
+    RaidFd(uint raid_type, uint raid_chunks , ulong raid_chunksize);
+    ~RaidFd();
+    File Create(const char *FileName, int CreateFlags, int access_flags,
+		myf MyFlags);
+    File Open(const char *FileName, int Flags, myf MyFlags);
+    my_off_t Seek(my_off_t pos,int whence,myf MyFlags);
+    my_off_t Tell(myf MyFlags);
+    int Write(const byte *Buffer, uint Count, myf MyFlags);
+    int Read(const byte *Buffer, uint Count, myf MyFlags);
+    int Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags);
+    int Chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
+    int Fstat(int fd, MY_STAT *stat_area, myf MyFlags );
+    int Close(myf MyFlags);
+    static bool IsRaid(File fd);
+    static DYNAMIC_ARRAY _raid_map;		/* Map of RaidFD* */
+  private:
+
+    uint _raid_type;       /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
+    uint _raid_chunks;     /* 1..n */
+    ulong _raid_chunksize; /* 1..n in bytes */
+
+    ulong _total_block;    /* We are operating with block no x (can be 0..many). */
+    uint _this_block;      /* can be 0.._raid_chunks */
+    uint _remaining_bytes; /* Maximum bytes that can be written in this block */
+
+    my_off_t _position;
+    my_off_t _size;        /* Cached file size for faster seek(SEEK_END) */
+    File _fd;
+    File *_fd_vector;		/* Array of File */
+    off_t *_seek_vector;	/* Array of cached seek positions */
+
+    inline void Calculate()
+    {
+      DBUG_ENTER("RaidFd::_Calculate");
+      DBUG_PRINT("info",("_position: %lu _raid_chunksize: %d, _size: %lu",
+			 (ulong) _position, _raid_chunksize, (ulong) _size));
+
+      _total_block = (ulong) (_position / _raid_chunksize);
+      _this_block = _total_block % _raid_chunks;    /* can be 0.._raid_chunks */
+      _remaining_bytes = (uint) (_raid_chunksize -
+				 (_position - _total_block * _raid_chunksize));
+      DBUG_PRINT("info",
+		 ("_total_block: %d  this_block: %d  _remaining_bytes:%d",
+		  _total_block, _this_block, _remaining_bytes));
+      DBUG_VOID_RETURN;
+    }
+};
+
+#endif /* __cplusplus */
+#endif /* USE_RAID */
diff --git a/src/terralib/drivers/MySQL/include/typelib.h b/src/terralib/drivers/MySQL/include/typelib.h
new file mode 100644
index 0000000..4280bab
--- /dev/null
+++ b/src/terralib/drivers/MySQL/include/typelib.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+
+#ifndef _typelib_h
+#define _typelib_h
+
+typedef struct st_typelib {	/* Different types saved here */
+  unsigned int count;		/* How many types */
+  const char *name;		/* Name of typelib */
+  const char **type_names;
+  unsigned int *type_lengths;
+} TYPELIB;
+
+extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name);
+extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
+extern const char *get_type(TYPELIB *typelib,unsigned int nr);
+
+extern TYPELIB sql_protocol_typelib;
+
+#endif /* _typelib_h */
diff --git a/src/terralib/drivers/Oracle/OCI/include/cdemodp0.h b/src/terralib/drivers/Oracle/OCI/include/cdemodp0.h
new file mode 100644
index 0000000..85afa1c
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/cdemodp0.h
@@ -0,0 +1,109 @@
+/*
+ * $Header$
+ */
+
+/* Copyright (c) 1998, 1999, Oracle Corporation.  All rights reserved.
+*/
+
+/*
+   NAME
+     cdemodp0.h - C Demo program for Direct Path api
+
+   DESCRIPTION
+     - Internal data structs, macros, & defines for cdemodp driver.
+
+   NOTES
+     Structures, macros, constants used only by cdemodp.c.
+
+   MODIFIED   (MM/DD/YY)
+   mjaeger     07/14/99 - bug 808870: OCCS: convert tabs, no long lines
+   abrumm      12/22/98 - lint
+   cmlim       11/17/98 - take away hardcoded MAX_RECLEN; now a session parm
+   cmlim       10/06/98 - correct typo
+   cmlim       10/02/98 - added externref
+   cmlim       09/16/98 - internal data structs, macros, & defines for cdemodp
+   cmlim       09/16/98 - Creation (abrumm 04/07/98)
+
+*/
+
+
+#ifndef cdemodp0_ORACLE
+# define cdemodp0_ORACLE
+
+# include <oratypes.h>
+# include <oci.h>
+
+/* partial field context structure, maintained by field setting function */
+struct pctx
+{
+  ub1   valid_pctx;                              /* partial context is valid */
+  ub4   pieceCnt_pctx;                            /* count of partial pieces */
+  ub4   row_pctx;                               /* which row in column array */
+  ub4   col_pctx;                            /* which column in column array */
+  ub4   len_pctx;                            /* length of this column so far */
+  int   fd_pctx;                 /* open file descriptor data is coming from */
+  char *fnm_pctx;                                /* filename for data source */
+};
+
+/* CLEAR_PCTX(struct pctx pctx)
+ *   Macro to clear the partial context state
+ */
+#define CLEAR_PCTX(pctx) \
+  ((pctx).valid_pctx = FALSE,   (pctx).pieceCnt_pctx = 0,    \
+   (pctx).row_pctx = UB4MAXVAL, (pctx).col_pctx = UB4MAXVAL, \
+   (pctx).len_pctx = 0,         (pctx).fd_pctx  = -1,        \
+   (pctx).fnm_pctx = (char *)0)
+
+#define SET_PCTX(pctx, rowoff, coloff, clen, fd, fnm) \
+  ((pctx).valid_pctx = TRUE,   (pctx).pieceCnt_pctx++,     \
+   (pctx).row_pctx = (rowoff), (pctx).col_pctx = (coloff), \
+   (pctx).len_pctx += (ub4)(clen), (pctx).fd_pctx = (fd),  \
+   (pctx).fnm_pctx = (fnm))
+
+#define LEN_PCTX(pctx) ((pctx).len_pctx)
+
+/* Does the input record correspond to the first piece of a row?
+ * Note that a row which is not pieced is a first piece too.
+ */
+#define FIRST_PIECE(pctx)       \
+( (pctx).valid_pctx == FALSE || \
+ ((pctx).valid_pctx == TRUE  && ((pctx).pieceCnt_pctx == 1)))
+
+/* return values from field_set() */
+#define FIELD_SET_COMPLETE   0
+#define FIELD_SET_ERROR      1
+#define FIELD_SET_BUF        2
+#define FIELD_SET_PARTIAL    3
+
+/* return values from do_convert() */
+#define CONVERT_SUCCESS      0
+#define CONVERT_ERROR        1
+#define CONVERT_NEED_DATA    2
+#define CONVERT_CONTINUE     3
+
+/* return values from do_load() */
+#define LOAD_SUCCESS     0
+#define LOAD_ERROR       1
+#define LOAD_NEED_DATA   2
+#define LOAD_NO_DATA     3
+
+/* state values for simple_load() */
+#define RESET             1 /* initial state, reset data structures to empty */
+#define GET_RECORD        2                             /* get input records */
+#define FIELD_SET         3     /* assign fields of input records to columns */
+#define DO_CONVERT        4   /* convert column array input to stream format */
+#define DO_LOAD           5                        /* load the direct stream */
+#define END_OF_INPUT      6                            /* no more input data */
+
+/* Secondary buffer sizes for OUTOFLINE fields; no science here, just a WAG */
+#define SECONDARY_BUF_SIZE (1024*1024)           /* size of secondary buffer */
+#define SECONDARY_BUF_SLOP (8*1024)  /* get another field if this much avail */
+
+#define STATICF
+
+#ifndef externref
+# define externref extern
+#endif
+
+
+#endif                                              /* cdemodp0_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/kusapi.h b/src/terralib/drivers/Oracle/OCI/include/kusapi.h
new file mode 100644
index 0000000..ba962b8
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/kusapi.h
@@ -0,0 +1,775 @@
+/*
+ * $Header$
+ */
+
+/* Copyright (c) Oracle Corporation 1996, 1997. All Rights Reserved. */ 
+ 
+/* NOTE:  See 'header_template.doc' in the 'doc' dve under the 'forms' 
+      directory for the header file template that includes instructions. 
+*/
+ 
+/* 
+   NAME 
+     kusapi.h - Kernel Utility Statistics Application Programming Interface
+
+   DESCRIPTION 
+     Declarations of types and functions of the API used to retrieve 
+     statistics from the SGA
+
+   PUBLIC FUNCTION(S) 
+     kusdb_connect - connect to a database
+     kuscx_allocate - allocate continuation context
+     kuscx_free - free continuation context
+     kuscx_init - initialize continuation context
+     kusdb_get_info - retrieve database information
+     kusdb_get_memory - copy SGA contents into user-allocated memory
+     kusdb_disconnect - disconnect from database
+     kusdb_error_text - format message for last error
+     kustv_allocate_handle - allocate a TLV handle
+     kustv_dump - dump a TLV buffer
+     kustv_free_handle - free a TLV handle
+     kustv_get - get next entry in a TLV buffer
+     kustv_offset - return offset for current entry in TLV buffer
+     kussys_get_info - retrieve non-db-related info (noop for Oracle)
+     kussys_error_text - format message for last error (noop for Oracle)
+     kustvp1_put_one_byte - put TLV entry with 1 byte value into TLV buffer
+     kustvp2_put_two_bytes - put TLV entry with 2 byte value into TLV buffer
+     kustvp4_put_four_bytes - put TLV entry with 4 byte value into TLV buffer
+     kustv_put - put TLV entry into TLV buffer
+     kustvptg_put_tag - put TLV entry with empty value into TLV buffer
+     kustv_reinit_handle - reset offset for a TLV handle
+     kustv_buffer_state - return termination state for tlv buffer
+
+   NOTES
+     This interface is subject to change without notice
+
+   MODIFIED   (MM/DD/YY)
+   pabingha    03/14/97 - Add get_tagname argument
+   jstenois    11/05/96 - "Make kustv_dump() header CONST"
+   jstenois    11/01/96 - Use oratypes instead of sx.h
+   jstenois    08/15/96 - SGAAPI public include file
+   jstenois    08/15/96 - Creation
+
+*/
+
+ 
+#ifndef KUSAPI
+# define KUSAPI
+
+# ifndef ORATYPES
+#  include <oratypes.h>
+# endif
+
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+/* values for status code returned by API calls */
+
+typedef enum kusst
+  {
+
+    KUSSTOK =		1,	/* Success                              */
+    KUSSTEOB =		2,	/* Cursor at end of buffer.	        */
+    KUSSTNWR =		3,	/* Attempt to write to TLV when no      */
+				/*    length specified at init time	*/
+    KUSSTILN =		4,	/* Invalid length specified when	*/
+				/*    passing by value			*/
+    KUSSTTRNC =		5,	/* buffer was truncated			*/
+    KUSSTCONT =		6,	/* buffer is continued			*/
+    KUSSTALLC =		7,	/* unable to allocate memory		*/
+    KUSSTUNKC =		8,	/* unknown class tag specified		*/
+    KUSSTICH =		9,	/* Invalid context handle		*/
+    KUSSTIDH =		10,	/* Invalid database handle		*/
+    KUSSTITH =		11,	/* Invalid TLV handle			*/
+    KUSSTDIS =		12,	/* Stats collection disabled for database */
+    KUSSTERR =		13,	/* Unexpected error encountered		*/
+    KUSSTBINF =		14,	/* Input buffer contained a bad tag	*/
+    KUSSTBDKY =         15,     /* Bad index value for class tag	*/
+    KUSSTBFSML =	16,	/* Buffer is too small for data		*/
+    KUSSTIBE =		17,	/* Information buffer is empty          */
+    KUSSTDBDOWN =       18,     /* Database is unavaliable              */
+    KUSSTFILACC =       19,     /* File cannot be accessed              */
+    KUSSTINVDB =        20,     /* File is not a db root file (Rdb only)*/
+    KUSSTNODB =         21,     /* Db root file doesn't exist (Rdb only)*/
+    KUSSTBADVER =       22,     /* Db root file wrong version (Rdb only)*/
+    KUSSTCIU =          23,     /* Context is already in use            */
+    KUSSTDMPOP =        24,     /* Unable to open dump output file      */
+    KUSSTDMPCL =        25      /* Unable to close dump output file     */
+  } kusst;
+
+
+/* values returned by kustvstate */ 
+
+typedef enum kustvs
+  {
+    KUSTVS_CONT =	1,	/* tlv buffer terminated with KUSSTCONT	*/
+    KUSTVS_END =	2,	/* tlv buffer terminated with KUSSTBEND	*/
+    KUSTVS_TRUNC =	3,	/* tlv buffer terminated with KUSSTTRNC	*/
+    KUSTVS_UNK =	4	/* handle specified has not been used	*/
+                                /* to read or write a termination tag   */
+  } kustvs;
+
+
+/* Type Definitions for handles */
+
+typedef dvoid *kusdb_handle;	/* handle for connected database */
+typedef dvoid *kuscx_handle;	/* handle for continuation context */
+typedef dvoid *kustv_handle;	/* handle for TLV context */
+
+/* Data structure for use by kusdb_get_memory */
+
+typedef struct kusmem
+  {
+    ub1 *sga_address_kusmem;    /* SGA memory address */
+    ub4 length_kusmem;          /* Number of bytes to copy */
+    ub1 *dest_address_kusmem;   /* User-allocated destination for SGA data */
+  } kusmem;
+
+
+/*---------------------------------------------------------------------------
+                           PUBLIC FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+/* ---------------------------- kuscx_allocate ----------------------------- */
+/*
+  NAME
+    kuscx_allocate -  allocate continuation context
+  DESCRIPTION
+    Allocate space to track information about continuation context for a 
+    kusdb_get_info call.
+  PARAMETERS
+    context_handle - handle for the continuation context (in/out)
+  RETURN VALUE
+    status of call
+  NOTES
+    kuscx_init can be used to reinitilize a context that has been allocated 
+    and is no longer used for a TLV buffer
+*/
+
+kusst kuscx_allocate (/*_ kuscx_handle *context_handle _*/);
+
+
+
+
+/* ------------------------------ kuscx_free_handle ------------------------ */
+/*
+  NAME
+    kuscx_free_handle -  free continuation context
+  DESCRIPTION
+    free space used to track information about continuation context for a 
+    kusdb_get_info call.
+  PARAMETERS
+    context_handle - handle for the continuation context (in/out)
+  RETURN VALUE
+    status of call
+  NOTES
+    kuscx_init can be used to reinitilize a context that has been allocated
+    and is no longer used for a TLV buffer
+*/
+
+kusst kuscx_free_handle (/*_ kuscx_handle *context_handle _*/);
+
+
+
+
+/* ------------------------------ kuscx_init ------------------------------- */
+/*
+  NAME
+    kuscx_init -  initialize continuation context
+  DESCRIPTION
+    Reinitialize a context handle that has been previously allocated and used.
+  PARAMETERS
+    context_handle - handle for the continuation context (in/out)
+  RETURN VALUE
+    status of call
+  NOTES
+    kuscx_init is the semantic equivalent of freeing a context handle and then
+    allocating a new one.
+*/
+
+kusst kuscx_init (/*_ kuscx_handle *context_handle _*/);
+
+
+
+/* ----------------------------- kusdb_allocate ---------------------------- */
+/*
+  NAME
+    kusdb_allocate - allocate a database handle
+  DESCRIPTION
+    allocate resources for a database handle
+  PARAMETERS
+    db_handle - handle for the database context (in/out)
+  RETURN VALUE
+    kusst - status of attempt to allocate
+*/
+
+kusst kusdb_allocate (/*_ kusdb_handle *db_handle _*/);
+
+
+
+
+/* ----------------------------- kusdb_connect ----------------------------- */
+/*
+  NAME
+    kusdb_connect - connect to a database
+  DESCRIPTION
+    Connects to a database so that statistics for that database can be
+    retrieved.
+  PARAMETERS
+    db_handle - handle for the database context (in/out)
+    database_name_length - number of bytes in database_name parameter
+    database name - name of database
+    security_info_length - number of bytes in security_info parameter
+    security_info - security information used to attach to database
+  RETURN VALUE
+    status of attempt to connect
+  NOTES
+    If the status is not successful, call kusdb_error_text to get more 
+    information about the failure.
+    Refer to the documentation for the format of information in the
+    database_name and security_info parameters.
+*/
+
+kusst kusdb_connect (/*_
+	kusdb_handle db_handle,
+	ub4 database_name_length,
+	char *database_name,
+	ub4 security_info_length,
+	char *security_info
+	_*/);
+
+
+
+
+/* ---------------------------- kusdb_disconnect --------------------------- */
+/*
+  NAME
+    kusdb_disconnect - disconnect from a database
+  DESCRIPTION
+    Disconnect from the current database
+  PARAMETERS
+    db_handle - handle for the database (in/out)
+  RETURN VALUE
+    status of call
+  NOTES
+*/
+
+kusst kusdb_disconnect (/*_ kusdb_handle db_handle _*/);
+
+
+
+
+/* ------------------------------- kusdb_free ------------------------------ */
+/*
+  NAME
+    kusdb_free - free a database handle
+  DESCRIPTION
+    free resources for a database handle
+  PARAMETERS
+    db_handle - handle for the database context (in/out)
+  RETURN VALUE
+    kusst - status of attempt to free the handle
+*/
+
+kusst kusdb_free (/*_ kusdb_handle *db_handle _*/);
+
+
+
+
+/* ----------------------------- kusdb_get_info ---------------------------- */
+/*
+  NAME
+    kusdb_get_info - retrieve statistics for a database
+  DESCRIPTION
+    Retrieve requested statistics for the current database
+  PARAMETERS
+    db_handle - handle for the database (in)
+    context_handle - handle for the continuation context (in/out)
+    info_buf - TLV buffer indicating data to be returned (in)
+    info_buf_len - number of bytes in info_buffer (in)
+    result_buf - allocated TLV buffer to hold data returned (in/out)
+    result_buf_len - number of bytes in result_buf (in/out)
+    buffer_termination_status - indicates how buffer was terminated (normally,
+      truncated, or continued) (out)
+  RETURN VALUE
+    status of call
+  NOTES
+    If the status is not successful, call kusdb_error_text to get more 
+    information about the failure.
+    Refer to documentation for information on the format of the information
+    buffer and the result buffer
+*/
+
+kusst kusdb_get_info (/*_
+	kusdb_handle db_handle,
+	kuscx_handle ctx_handle,
+	ub1 *info_buffer,
+	ub4 info_buffer_length,
+	ub1 *result_buffer,
+	ub4 *result_buffer_length,
+	kustvs *buffer_termination_status
+	_*/);
+
+
+
+/* ----------------------------- kusdb_get_memory -------------------------- */
+/*
+  NAME
+    kusdb_get_memory - copy SGA contents into user-allocated memory
+  DESCRIPTION
+    Copy SGA memory into user-allocated memory regions. User provides
+    an array of kusmem structures. Each kusmem structure in the array
+    describes a distinct copy to be done by this routine.
+  PARAMETERS
+    db_handle - handle for the database (in)
+    mem_array_length - number of elements in mem_array (in)
+    mem_array - address of an array of kusmem structures (in/out)
+  RETURN VALUE
+    status of call:
+        KUSSTOK - call succeeded, all requested data copied
+        KUSSTIDH - invalid database handle
+        KUSSTDBDOWN - database is down
+        KUSSTERR - unexpected error
+  NOTES
+     User should prepare each kusmem structure in array by filling in
+     values for sga_address_kusmem, length_kusmem and dest_address_kusmem
+     prior to making this call. 
+
+     User is reponsible for allocating and deallocating the memory used
+     by mem_array and each region that a dest_address_kusmem points to.
+*/
+
+kusst kusdb_get_memory (/*_
+	kusdb_handle db_handle,
+        ub4 mem_array_length,
+        kusmem *mem_array
+	_*/);
+
+
+
+
+/* ---------------------------- kusdb_error_text --------------------------- */
+/*
+  NAME
+    kusdb_error_text - error text
+  DESCRIPTION
+    Display information about status of last kusdb call
+  PARAMETERS
+    db_ctx - context whose errors are to be returned (in)
+    text_buf - buffer to hold error message (in/out)
+    text_buf_len - number of bytes in text buffer (in)
+    text_len_out - number of bytes written into text_buf
+  RETURN VALUE
+    status of call
+  NOTES
+*/
+
+kusst kusdb_error_text (/*_ kusdb_handle db_ctx, char *text_buf,
+			  ub4 text_buf_len, ub4 *text_len_out _*/);
+
+
+
+
+/* ------------------------ kustv_allocate_handle -------------------------- */
+/*
+  NAME
+    kustv_allocate_handle - allocate a handle for a TLV buffer
+  DESCRIPTION
+    allocates and initializes information for a TLV handle
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in/out)
+    tlv_buffer - address of the TLV buffer for this handle (in)
+    buf_size - number of bytes in tlv_buffer (in)
+  RETURN VALUE
+    KUSSTALL	Unable to allocate memory
+  NOTES
+    kustv_reinit can be used to reinitialize a TLV handle that is no longer
+    needed.
+*/
+
+kusst kustv_allocate_handle (/*_
+	kustv_handle *tlv_handle,
+	ub1 *tlv_buffer,
+	ub4 buf_size
+	_*/);
+
+
+#ifndef _WINDOWS
+
+
+/* ------------------------------- kustv_dump -------------------------------*/
+/*
+  NAME
+    kustv_dump - dump tlv buffer
+  DESCRIPTION
+    Formats the content of a TLV buffer into the file specified by the caller
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer to be dumped (in)
+    header - ASCIZ string to be displayed before dumping the buffer (in)
+    data_flg - flag to indicate if the contents of the value fueld in the TLV
+	should be displayed (in)
+    append_flg - flag to indicate if an existing instance of the output
+        file should be appended to (or replaced)
+    get_tagname - routine to get text associated with tags
+    directory - ASCIZ string containing a directory specification for the
+        output file (if absent, current default directory is used)
+    file_name - ASCIZ string containing a file name for the output file.
+        If absent, stderr is used and append_flg and directory are ignored.
+        If specified without an extension, the Oracle extension for an output
+        file on the given platform is used.
+  RETURN VALUE
+    KUSSTOK	Success
+    KUSSTITH	invalid tlv handle
+    KUSSTDMPOP  can't open dump file
+    KUSSTDMPCL  can't close dump file
+  NOTES
+*/
+
+kusst kustv_dump (/*_
+	kustv_handle tlv_handle,
+	CONST char *header,
+	int data_flg,
+        int append_flg,
+        CONST char *(*get_tagname)(ub2),
+        CONST char *directory,
+        CONST char *file_name
+	_*/);
+
+#endif
+
+
+/* ------------------------- kustv_free_handle ----------------------------- */
+/*
+  NAME
+    kustv_free_handle - free a handle for a TLV buffer
+  DESCRIPTION
+    Free a TLV handle that has already been created
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in/out)
+  RETURN VALUE
+    status of call
+  NOTES
+    kustv_reinit_handle can be used to reinitialize a handle that is no 
+    longer needed.
+*/
+
+kusst kustv_free_handle (/*_ kustv_handle *tlv_handle _*/);
+
+/* ----------------------------- kussys_get_info --------------------------- */
+/*
+  NAME
+    kussys_get_info - retrieve non database specific data
+  DESCRIPTION
+    Retrieve non database specific information
+  PARAMETERS
+    context_handle - handle for the continuation context (in/out)
+    info_buf - TLV buffer indicating data to be returned (in)
+    info_buf_len - number of bytes in info_buffer (in)
+    result_buf - allocated TLV buffer to hold data returned (in/out)
+    result_buf_len - number of bytes in result_buf (in/out)
+    buffer_termination_status - indicates how buffer was terminated (normally,
+      truncated, or continued) (out)
+  RETURN VALUE
+    status of call
+  NOTES
+    This function is a noop for Oracle. It is included for compatability
+    with Rdb only.
+*/
+
+kusst kussys_get_info (/*_
+	kuscx_handle ctx_handle,
+	ub1 *info_buffer,
+	ub4 info_buffer_length,
+	ub1 *result_buffer,
+	ub4 *result_buffer_length,
+	kustvs *buffer_termination_status
+	_*/);
+
+
+
+
+
+/* ---------------------------- kussys_error_text -------------------------- */
+/*
+  NAME
+    kussys_error_text - error text
+  DESCRIPTION
+    Display information about status of last kustv call
+  PARAMETERS
+    text_buf - buffer to hold error message (in/out)
+    text_buf_len - number of bytes in text buffer (in)
+    text_len_out - number of bytes written into text_buf
+  RETURN VALUE
+    status of call
+  NOTES
+    This function is a noop for Oracle. It is included for compatability
+    with Rdb only.
+*/
+
+kusst kussys_error_text (/*_ char *text_buf,
+			  ub4 text_buf_len, ub4 *text_len_out _*/);
+
+
+
+
+/* ------------------------------ kustv_get -------------------------------- */
+/*
+  NAME
+    kustv_get - get next entry in tlv buffer
+  DESCRIPTION
+    Retrieves information about next entry in the tlv buffer and advances
+    pointer into the TLV buffer to the following entry.
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in)
+    tag - tag for the next entry (out)
+    length - number of bytes in the value for the TLV entry (out)
+    value - pointer to value field for the TLV entry (out)
+  RETURN VALUE
+    KUSSTOK	Success
+    KUSSTITH	Invalid TLV handle
+  NOTES
+*/
+
+kusst kustv_get (/*_
+	kustv_handle tlv_handle,
+	ub2 *tag,
+	ub2 *length,
+	ub1 **value
+	_*/);
+
+
+
+
+
+/* ------------------------ kustv_reinit_handle ---------------------------- */
+/*
+  NAME
+    kustv_reinit_handle - reinitialize a TLV handle
+  DESCRIPTION
+    Reimitializes a TLV handle so that it can be used to read or write a new
+    TLV buffer.
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in/out)
+    buffer - address of the TLV buffer
+    buffer_size - number of bytes in the TLV buffer
+  RETURN VALUE
+    KUSSTOK	Success
+    KUSSTITH	Invalid TLV handle
+  NOTES
+*/
+
+kusst kustv_reinit_handle (/*_ 
+	kustv_handle tlv_handle,
+	ub1 *buffer,
+	ub4 buffer_length
+	_*/);
+
+
+
+
+
+/* --------------------------- kustv_length -------------------------------- */
+
+/*
+  NAME
+    kustv_length - return length of a TLV buffer
+  DESCRIPTION
+    return the length of a TLV buffer associated with a TLV handle
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in)
+    buffer_length - number of bytes in the buffer (out)
+  RETURN VALUE
+    KUSSTOK	Success
+    KUSSTITL	Invalid TLV handle
+  NOTES
+*/
+
+kusst kustv_length (/*_ 
+	kustv_handle tlv_handle,
+	ub4 buffer_length
+	_*/);
+
+
+
+
+/* ---------------------------- kustv_offset ------------------------------- */
+
+/*
+  NAME
+    kustv_offset - return offset of a TLV buffer
+  DESCRIPTION
+    return the current offset of a TLV buffer associated with a TLV handle
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in)
+    offset - current offset for TLV buffer (out)
+  RETURN VALUE
+    KUSSTOK - success
+    KUSSTITH - invalid TLV handle
+  NOTES
+*/
+
+kusst kustv_offset (/*_ 
+	kustv_handle tlv_handle, 
+	ub4 *offset 
+	_*/);
+
+
+
+
+/* ------------------------ kustvp1_put_one_byte --------------------------- */
+
+/*
+  NAME
+    kustvp1_put_one_byte - Insert a TLV entry with a value field of 1 byte
+  DESCRIPTION
+    Adds a new TLV entry to the end of the current TLV buffer.  This entry
+    contains 1 byte.
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in/out)
+    tag - tag for the new entry (in)
+    value - value for the new entry (in)
+  RETURN VALUE
+    status of the operation
+  NOTES
+*/
+
+kusst kustvp1_put_one_byte (/*_
+	kustv_handle tlv_handle,
+	ub2 tag,
+	ub1 value
+	_*/);
+
+
+
+
+/* ------------------------- kustvp2_put_two_bytes ------------------------- */
+
+/*
+  NAME
+    kustvp2_put_two_bytes - Insert a TLV entry with a value field of 2 byte
+  DESCRIPTION
+    Adds a new TLV entry to the end of the current TLV buffer.  This entry
+    contains 2 bytes.
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in/out)
+    tag - tag for the new entry (in)
+    value - value for the new entry (in)
+  RETURN VALUE
+    status of the operation
+  NOTES
+*/
+
+kusst kustvp2_put_two_bytes (/*_
+	kustv_handle tlv_handle,
+	ub2 tag,
+	ub2 value
+	_*/);
+
+
+
+
+/* ----------------------- kustvp4_put_four_bytes -------------------------- */
+
+/*
+  NAME
+    kustvp4_put_four_bytes - Insert a TLV entry with a value field of 4 byte
+  DESCRIPTION
+    Adds a new TLV entry to the end of the current TLV buffer.  This entry
+    contains 4 bytes.
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in/out)
+    tag - tag for the new entry (in)
+    value - value for the new entry (in)
+  RETURN VALUE
+    status of the operation
+  NOTES
+*/
+
+kusst kustvp4_put_four_bytes (/*_
+	kustv_handle tlv_handle,
+	ub2 tag,
+	ub4 value
+	_*/);
+
+
+
+
+/* ----------------------------- kustv_put --------------------------------- */
+
+/*
+  NAME
+    kustv_put - Insert a TLV entry
+  DESCRIPTION
+    Adds a new TLV entry to the end of the current TLV buffer.
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in/out)
+    tag - tag for the new entry (in)
+    length - number of bytes in the new entry (in)
+    value - value for the new entry (in)
+  RETURN VALUE
+    status of the operation
+  NOTES
+*/
+
+kusst kustv_put (/*_
+	kustv_handle tlv_handle,
+	ub2 tag,
+	ub2 length,
+	dvoid *value
+	_*/);
+
+
+
+
+/* -------------------------- kustvptg_put_tag ----------------------------- */
+
+/*
+  NAME
+    kustvptg_put_tag - Insert a TLV entry with no value field
+  DESCRIPTION
+    Adds a new TLV entry to the end of the current TLV buffer.  the entry
+    contains a 0-length value field.
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in/out)
+    tag - tag for the new entry (in)
+  RETURN VALUE
+    status of the operation
+  NOTES
+*/
+
+kusst kustvptg_put_tag (/*_
+	kustv_handle tlv_handle,
+	ub2 tag
+	_*/);
+
+
+
+
+
+/* -------------------------- kustv_buffer_state --------------------------- */
+
+/*
+  NAME
+    kustv_buffer_state - return termination state of TLV buffer
+  DESCRIPTION
+    Returns informationon how a TLV buffer was terminated.  This call returns
+    useful information only if a TLV handle was used to read or write the
+    termination tag.  The termination information is preserved 
+  PARAMETERS
+    tlv_handle - handle of the TLV buffer (in)
+    state - termination state for the TLV (out)
+  RETURN VALUE
+    status of the operation
+  NOTES
+*/
+
+kusst kustv_buffer_state (/*_
+	kustv_handle tlv_handle,
+	kustvs *state
+	_*/);
+
+
+#endif                                              /* kusapi */
diff --git a/src/terralib/drivers/Oracle/OCI/include/kustags.h b/src/terralib/drivers/Oracle/OCI/include/kustags.h
new file mode 100644
index 0000000..aad8fd1
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/kustags.h
@@ -0,0 +1,1034 @@
+/* copyright (c) Oracle Corporation 1995.  All Rights Reserved. */
+
+/*
+  NAME
+    kustags.h - definition of tags for statistics API
+  DESCRIPTION
+    Definitions of tags used for Oracle's statistics API.
+  PUBLIC FUNCTIONS
+    none
+  PRIVATE FUNCTIONS
+    none
+  NOTES
+    This file is a generated and should NOT BE EDITTED
+*/
+
+#ifndef ORATYPES
+#include <oratypes.h>
+#endif
+
+#ifndef KUSTAGS
+#define KUSTAGS
+
+/* DISABLE check_macro_naming */
+/* Lint exception approved 9/24/96 by BCCHANG and JMULLER */
+
+/* PUBLIC TYPES AND CONSTANTS */
+#define RMUST_T_ACCESS_MODE 15
+#define RMUST_T_ACTIVE_FLG 16
+#define RMUST_T_AIJ_COMMIT_FLG 17
+#define RMUST_T_AIJ_ENABLED_FLG 18
+#define RMUST_T_AIJ_STATUS 19
+#define RMUST_T_ALARM_ENABLED_FLG 20
+#define RMUST_T_ALLOCATION 21
+#define RMUST_T_ALS_MODE_FLG 22
+#define RMUST_T_ARPMS 23
+#define RMUST_T_ASCII_DEADLOCK 24
+#define RMUST_T_ASCII_STALL 25
+#define RMUST_T_ASCII_TIMEOUT 26
+#define RMUST_T_AUDIT_ENABLED_FLG 27
+#define RMUST_T_AUDIT_FIRST_FLG 28
+#define RMUST_T_AUDIT_FLUSH_FLG 29
+#define RMUST_T_AUTO_BKUP_FLG 30
+#define RMUST_T_FILID_SLOTNUM 31
+#define RMUST_T_BACKUP_DATE_ADT 32
+#define RMUST_T_BACKUP_DATE_FDT 33
+#define RMUST_T_BACKUP_DATE_TDT 34
+#define RMUST_T_BIOCNT 35
+#define RMUST_T_BKUP_ACTIVE_FLG 36
+#define RMUST_T_BKUP_VNO 37
+#define RMUST_T_CACHE_FILENAME 38
+#define RMUST_T_CALC_PNO 39
+#define RMUST_T_CKPT_BLOCKS 40
+#define RMUST_T_CKPT_TIME 41
+#define RMUST_T_CORRUPT_FLG 42
+#define RMUST_T_CPUTIM_RT 43
+#define RMUST_T_CREATE_DATE_ADT 44
+#define RMUST_T_CREATE_DATE_FDT 45
+#define RMUST_T_CREATE_DATE_TDT 46
+#define RMUST_T_CUR_ACTIVE_AIJ 47
+#define RMUST_T_CUR_AIJ_FILENAME 48
+#define RMUST_T_CUR_BKUP_FILENAME 49
+#define RMUST_T_CUR_BKUP_VNO 50
+#define RMUST_T_CUR_RCVR_VNO 51
+#define RMUST_T_DATA_CMIT_FLG 52
+#define RMUST_T_DBID 53
+#define RMUST_T_DBR_ACTIVITY 54
+#define RMUST_T_DBR_BUF_CNT 55
+#define RMUST_T_LSS_LAG_FDT 56
+#define RMUST_T_DB_BKUP_VNO 57
+#define RMUST_T_DEADLOCK_SEQ 58
+#define RMUST_T_DEADLOCK_SINCE_ADT 59
+#define RMUST_T_DEADLOCK_SINCE_TT 60
+#define RMUST_T_DEADLOCK_SINCE_RT 61
+#define RMUST_T_DEFERRED_SNAP_FLG 62
+#define RMUST_T_DEF_AIJ_FILENAME 63
+#define RMUST_T_DEF_ALLOCATION 64
+#define RMUST_T_DEF_BKUP_FILENAME 65
+#define RMUST_T_DEF_BUF_CNT 66
+#define RMUST_T_DEF_EXTENSION 67
+#define RMUST_T_DIOCNT 68
+#define RMUST_T_ENQCNT 69
+#define RMUST_T_EXTENSION 70
+#define RMUST_T_EXT_COUNT 71
+#define RMUST_T_EXT_ENABLED_FLG 72
+#define RMUST_T_EXT_PERCENT 73
+#define RMUST_T_FAST_COMMIT_FLG 74
+#define RMUST_T_FILENAME 75
+#define RMUST_T_FULL_BACKUP_TSN 76
+#define RMUST_T_GB_CNT 77
+#define RMUST_T_GB_ENABLED_FLG 78
+#define RMUST_T_HARD_DATA_LOSS_FLG 79
+#define RMUST_T_IMAGENAME 80
+#define RMUST_T_INCONSISTENT_FLG 81
+#define RMUST_T_INC_RES_DATE_ADT 82
+#define RMUST_T_INC_RES_DATE_FDT 83
+#define RMUST_T_INC_RES_DATE_TDT 84
+#define RMUST_T_INIT_ACTIVE_FLG 85
+#define RMUST_T_IS_STALLED 86
+#define RMUST_T_JOURNAL_CNT 87
+#define RMUST_T_JOURNAL_NAME 88
+#define RMUST_T_JOURNAL_STATUS 89
+#define RMUST_T_LAST_BKUP_VNO 90
+#define RMUST_T_LCKOPT_ENABLED_FLG 91
+#define RMUST_T_LINKAGE_DBID 92
+#define RMUST_T_LKID 93
+#define RMUST_T_LOCK_TIMEOUT 94
+#define RMUST_T_MAX_EXT_PAGCNT 95
+#define RMUST_T_MAX_GB_PER_USER 96
+#define RMUST_T_MAX_NODE_CNT 97
+#define RMUST_T_MAX_PNO 98
+#define RMUST_T_MAX_USER_CNT 99
+#define RMUST_T_MIN_EXT_PAGCNT 100
+#define RMUST_T_MIXED_FMT_FLG 101
+#define RMUST_T_MODIFIED_FLG 102
+#define RMUST_T_NEW_VERSION_FLG 104
+#define RMUST_T_NUMBIO 105
+#define RMUST_T_NUMDIO 106
+#define RMUST_T_OPEN_MODE_FLG 107
+#define RMUST_T_OPER_CLASS 108
+#define RMUST_T_OVERWRITE_FLG 109
+#define RMUST_T_OVERWRITTEN_FLG 110
+#define RMUST_T_PAG_BLKCNT 111
+#define RMUST_T_PGFCNT 112
+#define RMUST_T_PGFLTS 113
+#define RMUST_T_PID 114
+#define RMUST_T_PROCNAME 115
+#define RMUST_T_PSTATE 116
+#define RMUST_T_RESTORED_FLG 117
+#define RMUST_T_RTPMS 118
+#define RMUST_T_SFDB_FLG 119
+#define RMUST_T_SHUTDOWN_TIME 120
+#define RMUST_T_SNAPSHOT_FLG 121
+#define RMUST_T_SNAPS_ALLOWED_FLG 122
+#define RMUST_T_SNAPS_ENABLED_FLG 123
+#define RMUST_T_SOFT_DATA_LOSS_FLG 124
+#define RMUST_T_SPAMS_ENABLED_FLG 125
+#define RMUST_T_SPAMS_FLG 126
+#define RMUST_T_STALL_SINCE_ADT 127
+#define RMUST_T_STALL_SINCE_TT 128
+#define RMUST_T_STALL_SINCE_RT 129
+#define RMUST_T_STALL_THRESHOLD_RT 130
+#define RMUST_T_STAREA_NAME 131
+#define RMUST_T_STATS_ENABLED_FLG 132
+#define RMUST_T_STID 133
+#define RMUST_T_TIMEOUT_SEQ 134
+#define RMUST_T_TIMEOUT_SINCE_ADT 135
+#define RMUST_T_TIMEOUT_SINCE_TT 136
+#define RMUST_T_TIMEOUT_SINCE_RT 137
+#define RMUST_T_TSN_INTERVAL 138
+#define RMUST_T_USERNAME 139
+#define RMUST_T_VBN 140
+#define RMUST_T_VMSIZE 141
+#define RMUST_T_WSSIZE 142
+#define RMUST_T_THRESHOLD 143
+#define RMUST_T_BUF_BLOCK_CNT 144
+#define RMUST_T_FILID_CNT 145
+#define RMUST_T_STALL_INDEX 146
+#define RMUST_T_AIJ_LEOF 147
+#define RMUST_T_AIJ_PEOF 148
+#define RMUST_T_ALS_ACTIVE 149
+#define RMUST_T_CACHE_STATUS 150
+#define RMUST_T_AIJ_SHUTDOWN 151
+#define RMUST_T_RELATION_NAME 152
+#define RMUST_T_ISA_VIEW 153
+#define RMUST_T_FIELD_NAMES 154
+#define RMUST_T_INDEX_NAME 155
+#define RMUST_T_INDEX_UNIQUE 156
+#define RMUST_T_INDEX_TYPE 157
+#define RMUST_T_LSS_AIJ_VNO 158
+#define RMUST_T_LSS_AIJ_VBN 159
+#define RMUST_T_DELTA_HSEC 160
+#define RMUST_T_PLATFORM 161
+#define RMUST_T_LSS_STATE 162
+#define RMUST_T_AIJ_AUTO_SYNC 163
+#define RMUST_T_AIJ_DATA_SYNC 164
+#define RMUST_T_AIJ_VNO 165
+#define RMUST_T_AIJ_SRV_NAME 166
+#define RMUST_T_STBY_RT_FILNAM 167
+#define RMUST_T_AIJ_CUR_MSN 168
+#define RMUST_T_AIJ_STALLED_MSN 169
+#define RMUST_T_LCS_ACTIVE 170
+#define RMUST_T_LRS_STATE 171
+#define RMUST_T_LRS_ACTIVE 172
+#define RMUST_T_LSS_ACTIVE 173
+#define RMUST_T_GOVERNOR_ENABLED 174
+#define RMUST_T_LSS_REF_COUNT 175
+#define RMUST_T_AIJFB_INDEX 176
+#define RMUST_T_PROC_INDEX 177
+#define RMUST_T_DBR_INDEX 178
+#define RMUST_T_SAMPLE_INTERVAL 179
+#define RMUST_T_DBMSROOT 180
+#define RMUST_T_MAJ_VER 181
+#define RMUST_T_MIN_VER 182
+#define RMUST_T_CHECKSUM 183
+#define RMUST_T_VERSION_ADT 184
+#define RMUST_T_VERSION_FDT 185
+#define RMUST_T_VERSION_TDT 186
+#define RMUST_T_LADB_FLG 187
+#define RMUST_T_RUJ_CORRUPT_FLG 188
+#define RMUST_T_ROOT_CORRUPT_FLG 189
+#define RMUST_T_FIB_ENABLED_FLG 190
+#define RMUST_T_APF_ENABLED_FLG 191
+#define RMUST_T_ABW_ENABLED_FLG 192
+#define RMUST_T_PLT_ENABLED_FLG 193
+#define RMUST_T_OPT_ENABLED_FLG 194
+#define RMUST_T_STBY_READ_ONLY_FLG 195
+#define RMUST_T_DAPF_ENABLED_FLG 196
+#define RMUST_T_RCVR_QUIET_POINT_FLG 197
+#define RMUST_T_SSB_ENABLED_FLG 198
+#define RMUST_T_DB_MODIFIED_FLG 199
+#define RMUST_T_ACTIVE_VBN 200
+#define RMUST_T_AIJDB_VBN 201
+#define RMUST_T_AIJFB_VBN 202
+#define RMUST_T_CLIENT_VBN 203
+#define RMUST_T_COSI_VBN 204
+#define RMUST_T_CPT_VBN 205
+#define RMUST_T_FILID_VBN 206
+#define RMUST_T_MEMBIT_VBN 207
+#define RMUST_T_RTUPB_VBN 208
+#define RMUST_T_RUJBLK_VBN 209
+#define RMUST_T_SEQBLK_VBN 210
+#define RMUST_T_TSNBLK_VBN 211
+#define RMUST_T_AIJFB_CNT 212
+#define RMUST_T_RTUPB_BLKCNT 213
+#define RMUST_T_TSNBLK_CNT 214
+#define RMUST_T_ALG_COUNT 215
+#define RMUST_T_ALG_FACTORS 216
+#define RMUST_T_AUDIT_FLAGS 217
+#define RMUST_T_ALARM_NAME 218
+#define RMUST_T_MIN_PAG_BLKCNT 219
+#define RMUST_T_MAX_PAG_BLKCNT 220
+#define RMUST_T_MAX_PIB_COUNT 221
+#define RMUST_T_SEQBLK_CNT 222
+#define RMUST_T_APF_DEPTH 223
+#define RMUST_T_ABW_CLEAN_BUF_CNT 224
+#define RMUST_T_ABW_BATCH_MAX 225
+#define RMUST_T_CLIENT_BLKCNT 226
+#define RMUST_T_COSI_BLKCNT 227
+#define RMUST_T_RMU_CLIENT_VBN 228
+#define RMUST_T_RMU_CLIENT_BLKCNT 229
+#define RMUST_T_CLOSE_MODE 230
+#define RMUST_T_CLOSE_INTERVAL 231
+#define RMUST_T_RCACHE_VBN 232
+#define RMUST_T_RCACHE_CNT 233
+#define RMUST_T_DAPF_DEPTH 234
+#define RMUST_T_DAPF_THRESHOLD 235
+#define RMUST_T_TXN_MODE_FLAGS 236
+#define RMUST_T_RCS_SWEEP_INTERVAL 237
+#define RMUST_T_ACTIVE_BACKUP_TSN 238
+#define RMUST_T_BOOTSTRAP_DBK 239
+#define RMUST_T_HRL_FLG 241
+#define RMUST_T_WRL_FLG 242
+#define RMUST_T_RESTRICT_ACCESS_FLG 243
+#define RMUST_T_ALTER_CNT 244
+#define RMUST_T_ALTER_TAD_ADT 245
+#define RMUST_T_ALTER_TAD_FDT 246
+#define RMUST_T_ALTER_TAD_TDT 247
+#define RMUST_T_INC_RES_TAD_ADT 248
+#define RMUST_T_INC_RES_TAD_FDT 249
+#define RMUST_T_INC_RES_TAD_TDT 250
+#define RMUST_T_FULL_BCK_TAD_ADT 251
+#define RMUST_T_FULL_BCK_TAD_FDT 252
+#define RMUST_T_FULL_BCK_TAD_TDT 253
+#define RMUST_T_LAST_BACKUP_TSN 254
+#define RMUST_T_LAST_BACKUP_CSN 255
+#define RMUST_T_LAST_FULL_BACKUP_TSN 256
+#define RMUST_T_FULL_VER_TAD_ADT 257
+#define RMUST_T_FULL_VER_TAD_FDT 258
+#define RMUST_T_FULL_VER_TAD_TDT 259
+#define RMUST_T_INC_VER_TAD_ADT 260
+#define RMUST_T_INC_VER_TAD_FDT 261
+#define RMUST_T_INC_VER_TAD_TDT 262
+#define RMUST_T_FULL_RES_TAD_ADT 263
+#define RMUST_T_FULL_RES_TAD_FDT 264
+#define RMUST_T_FULL_RES_TAD_TDT 265
+#define RMUST_T_ALT_BOOTSTRAP_DBK 266
+#define RMUST_T_RESTORE_ROOT_TAD_ADT 267
+#define RMUST_T_RESTORE_ROOT_TAD_FDT 268
+#define RMUST_T_RESTORE_ROOT_TAD_TDT 269
+#define RMUST_T_PAG_DBID 271
+#define RMUST_T_RELATED_FLG 272
+#define RMUST_T_COUPLED_FLG 274
+#define RMUST_T_CSM_FLG 275
+#define RMUST_T_SPREAD_FLG 276
+#define RMUST_T_RESTRUCTURED_FLG 277
+#define RMUST_T_WORM_DEVFULL_FLG 278
+#define RMUST_T_2PPL_ENABLED_FLG 279
+#define RMUST_T_WORM_AIJ_ENABLED_FLG 280
+#define RMUST_T_WORM_CORRUPT_FLG 281
+#define RMUST_T_RCACHE_ENABLED_FLG 282
+#define RMUST_T_WORM_LEOF 285
+#define RMUST_T_P0_VBN 286
+#define RMUST_T_CLUMP_PAGCNT 287
+#define RMUST_T_PAGES_PER_SPAM 288
+#define RMUST_T_AIJ_RCVR_VNO 289
+#define RMUST_T_PAG_LEN 290
+#define RMUST_T_PPSP1 291
+#define RMUST_T_SPAM_T1 292
+#define RMUST_T_SPAM_T2 293
+#define RMUST_T_SPAM_T3 294
+#define RMUST_T_SPAMVEC_LEN 295
+#define RMUST_T_PAG_PAD_LEN 296
+#define RMUST_T_MAX_FREE_LEN 297
+#define RMUST_T_MAX_NEW_SEG_LEN 298
+#define RMUST_T_MAX_SEG_LEN 299
+#define RMUST_T_BACKUP_STATS 300
+#define RMUST_T_RCACHE_DBID 301
+#define RMUST_T_SNAPS_ENABLED_TSN 302
+#define RMUST_T_COMMIT_TSN 303
+#define RMUST_T_BACKUP_TSN 304
+#define RMUST_T_INCR_BACKUP_TSN 305
+#define RMUST_T_ABS_QUIET_POINT_FLG 306
+#define RMUST_T_LSS_ACTIVE_FLG 307
+#define RMUST_T_LRS_ACTIVE_FLG 308
+#define RMUST_T_MASTER_DB_FLG 309
+#define RMUST_T_LSS_ONLINE_FLG 310
+#define RMUST_T_LSS_QUIET_POINT_FLG 311
+#define RMUST_T_CUR_RCVR_VBN 312
+#define RMUST_T_LSS_CKPT_INTRVL 313
+#define RMUST_T_LSS_WAIT_INTRVL 314
+#define RMUST_T_LSS_TIMEOUT_INTRVL 315
+#define RMUST_T_LSS_BUFFER_CNT 316
+#define RMUST_T_LSS_ACCESS_MODE 317
+#define RMUST_T_LSS_RESOLVE_2PC 318
+#define RMUST_T_LSS_STARTUP_TAD_ADT 319
+#define RMUST_T_LSS_STARTUP_TAD_FDT 320
+#define RMUST_T_LSS_STARTUP_TAD_TDT 321
+#define RMUST_T_BKUP_EDITNAM 322
+#define RMUST_T_REMOTE_NODENAM 323
+#define RMUST_T_SERVER_NAME 324
+#define RMUST_T_BKUP_FAILED_FLG 325
+#define RMUST_T_EMERGENCY_FLG 326
+#define RMUST_T_ACTIVATE_TAD_ADT 327
+#define RMUST_T_ACTIVATE_TAD_FDT 328
+#define RMUST_T_ACTIVATE_TAD_TDT 329
+#define RMUST_T_RDB_CHECKSUM 330
+#define RMUST_T_MONID 332
+#define RMUST_T_TID 333
+#define RMUST_T_TSNBLK_INDEX 334
+#define RMUST_T_TSNBLK_SLOT 335
+#define RMUST_T_REMOTE_FLG 336
+#define RMUST_T_ALS_FLG 337
+#define RMUST_T_DBR_FLG 338
+#define RMUST_T_SERVER_FLG 339
+#define RMUST_T_UTILITY_FLG 340
+#define RMUST_T_LCS_FLG 341
+#define RMUST_T_LRS_FLG 342
+#define RMUST_T_RCS_FLG 343
+#define RMUST_T_LSS_FLG 344
+#define RMUST_T_CKPT_VNO 345
+#define RMUST_T_CKPT_VBN 346
+#define RMUST_T_QUIET_VNO 347
+#define RMUST_T_VLM_ENABLED_FLG 352
+#define RMUST_T_REPLACE_ENABLED_FLG 353
+#define RMUST_T_SLOT_LEN 354
+#define RMUST_T_SLOT_COUNT 355
+#define RMUST_T_MAX_WS_COUNT 356
+#define RMUST_T_NAME 357
+#define RMUST_T_HASHED_INDEX_FLG 358
+#define RMUST_T_LAPMS_INDEX 359
+#define RMUST_T_VLM_WINDOW_COUNT 360
+#define RMUST_T_CKPT_SEQ 361
+#define RMUST_T_DEVDIR 362
+#define RMUST_T_HASH_LDBID_PRIME 363
+#define RMUST_T_HASH_PNO_PRIME 364
+#define RMUST_T_SWEEP_THRESH_HIGH 365
+#define RMUST_T_SWEEP_THRESH_LOW 366
+#define RMUST_T_SWEEP_FREE_PCT 367
+#define RMUST_T_SWEEP_BATCH_COUNT 368
+#define RMUST_T_MAX_RESERVE_COUNT 369
+#define RMUST_T_ALLOC_BLKCNT 370
+#define RMUST_T_EXTEND_BLKCNT 371
+#define RMUST_T_LIMBO_FLG 373
+#define RMUST_T_PREPARED_FLG 374
+#define RMUST_T_XATM_FLG 375
+#define RMUST_T_RESOLVE_FLG 376
+#define RMUST_T_RESOLUTION_FLG 377
+#define RMUST_T_RUJ_FILNAM 378
+#define RMUST_T_TM_LOG_ID 381
+#define RMUST_T_RM_LOG_ID 382
+#define RMUST_T_RM_NAME 383
+#define RMUST_T_NODE_NAME 384
+#define RMUST_T_PARENT_NODE_NAME 385
+#define RMUST_T_WIPMAP 388
+#define RMUST_T_SIPMAP 389
+#define RMUST_T_OLDEST_TSN 390
+#define RMUST_T_COMMIT_CSN 392
+#define RMUST_T_TSN_VEC 393
+#define RMUST_T_COMMIT_TSN_VEC 394
+#define RMUST_T_NEXT_SEQ 396
+#define RMUST_T_GROUP_SIZE 397
+#define RMUST_T_IGNORE_FLG 399
+#define RMUST_T_RECOVER_FLG 400
+#define RMUST_T_UPTO_AREA_FLG 401
+#define RMUST_T_LAST_COMMIT_TSN 403
+#define RMUST_T_PNO 404
+#define RMUST_T_PDBID 405
+#define RMUST_T_ABM_PNO 406
+#define RMUST_T_LAREA_DBID 407
+#define RMUST_T_PAREA_DBID 408
+#define RMUST_T_LAREA_NAME 409
+#define RMUST_T_REC_LEN 411
+#define RMUST_T_LAREA_EXT_CNT 412
+#define RMUST_T_MODULO_HASH_FLG 414
+#define RMUST_T_DELETED_TID 415
+#define RMUST_T_MOD_HASH_KEY_OFFSET 417
+#define RMUST_T_BITMAP 419
+#define RMUST_T_XID_FORMAT_ID 422
+#define RMUST_T_XID_GTRID_LENGTH 423
+#define RMUST_T_XID_BQUAL_LENGTH 424
+#define RMUST_T_XID_DATA 425
+#define RMUST_T_ACE_SIZE 426
+#define RMUST_T_ACE_TYPE 427
+#define RMUST_T_DEFAULT_FLG 428
+#define RMUST_T_PROTECTED_FLG 429
+#define RMUST_T_HIDDEN_FLG 430
+#define RMUST_T_NOPROPAGATE_FLG 431
+#define RMUST_T_READ_PRV_FLG 432
+#define RMUST_T_WRITE_PRV_FLG 433
+#define RMUST_T_EXECUTE_PRV_FLG 434
+#define RMUST_T_DELETE_PRV_FLG 435
+#define RMUST_T_CONTROL_PRV_FLG 436
+#define RMUST_T_DB_VERSION 437
+#define RMUST_T_NODE 438
+#define RMUST_T_CURRENT_TAD_ADT 439
+#define RMUST_T_CURRENT_TAD_FDT 440
+#define RMUST_T_CURRENT_TAD_TDT 441
+#define RMUST_T_NODE_DATABASES 442
+#define RMUST_T_DATABASE 443
+#define RMUST_T_ACTIVE_USERS 444
+#define RMUST_T_MONITOR_LOG 445
+#define RMUST_T_MONITOR_BUFFERS 446
+#define RMUST_T_USER_ID 448
+#define RMUST_T_USER_STATUS 449
+#define RMUST_T_DEVICE_NAME 450
+#define RMUST_T_DEVICE_STATUS 451
+#define RMUST_T_DEVICE_ERROR_CNT 452
+#define RMUST_T_LABEL 453
+#define RMUST_T_FREE_BLOCKS 454
+#define RMUST_T_TRANSFER_CNT 455
+#define RMUST_T_MOUNT_CNT 456
+#define RMUST_T_DEVICE_TYPE 457
+#define RMUST_T_DEVICE_CHAR 458
+#define RMUST_T_TABLE_NAME 459
+#define RMUST_T_LOGICAL_AREA_ID 460
+#define RMUST_T_TABLE_ID 461
+#define RMUST_T_INDEX_ID 462
+#define RMUST_T_LAPMS 463
+#define RMUST_T_LOGICAL_AREA_COUNT 464
+#define RMUST_T_ALL_LOGICAL_AREA_IDS 465
+#define RMUST_T_ALL_LAPMS 466
+#define RMUST_T_AIJ_MAX_IO_BLKS 468
+#define RMUST_T_AIJ_MIN_IO_BLKS 469
+#define RMUST_T_AIJ_STALL 470
+#define RMUST_T_COMMIT_STALL 471
+#define RMUST_T_DAPF_DEPTH_BUF_CNT 475
+#define RMUST_T_DAPF_START_BUF_CNT 476
+#define RMUST_T_LIVE_BW_MAX 477
+#define RMUST_T_MAX_DBR_CNT 478
+#define RMUST_T_ABS_PRIORITY 479
+#define RMUST_T_ALS_PRIORITY 480
+#define RMUST_T_DBR_PRIORITY 481
+#define RMUST_T_LCS_PRIORITY 482
+#define RMUST_T_LRS_PRIORITY 483
+#define RMUST_T_RCS_PRIORITY 484
+#define RMUST_T_CKPT_TRANS_INTERVAL 487
+#define RMUST_T_CTJ_TSN_INTERVAL 488
+#define RMUST_T_APF_ENABLED 489
+#define RMUST_T_ABW_ENABLED 490
+#define RMUST_T_DAPF_ENABLED 491
+#define RMUST_T_ABS_QUIET_POINT 492
+#define RMUST_T_RCACHE_RCRL_COUNT 493
+#define RMUST_T_RCS_BATCH_COUNT 494
+#define RMUST_T_RCS_CHECKPOINT 495
+#define RMUST_T_HOT_NETWORK_TIMEOUT 496
+#define RMUST_T_RCS_SWP_INT 497
+#define RMUST_T_RCS_COLD_LOW 498
+#define RMUST_T_RCS_COLD_HIGH 499
+#define RMUST_T_RCS_COLD_RECORDS 500
+#define RMUST_T_DBR_BUFFER_CNT 501
+#define RMUST_T_SNAP_QUIET_POINT 502
+#define RMUST_T_LOCK_TIMEOUT_INTERVAL 503
+#define RMUST_T_HRL_ENABLED 504
+#define RMUST_T_CBL_ENABLED 505
+#define RMUST_T_RUJ_EXTEND_BLKCNT 506
+#define RMUST_T_RCACHE_INSERT_ENABLED 507
+#define RMUST_T_RCS_ABORT_SWEEP 508
+#define RMUST_T_AIJ_ARB_COUNT 509
+#define RMUST_T_RCACHE_LATCH_SPIN_COUNT 510
+#define RMUST_T_RCWS_UNMARK_THRESHO 511
+#define RMUST_T_RUJ_ALLOC_BLKCNT 512
+#define RMUST_T_HOT_DATA_SYNC_MODE 513
+#define RMUST_T_HOT_CHECKPOINT 514
+#define RMUST_T_LCS_CONNECT_TIMEOUT 515
+#define RMUST_T_LRS_GAP_TIMEOUT 516
+#define RMUST_T_LRS_GOVERNOR_ENABLED 517
+#define RMUST_T_AIJ_SWITCH_GBL_CKPT 518
+#define RMUST_T_AIJ_CHK_CONTROL_RECS 519
+#define RMUST_T_READY_AREA_SERIALLY 520
+#define RMUST_T_ABS_OVRWRT_ALLOWED 521
+#define RMUST_T_ABS_OVRWRT_IMMEDIATE 522
+#define RMUST_T_ALS_CREATE_AIJ 523
+#define RMUST_T_VNO 524
+#define RMUST_T_AIJ_MAX_IO_BYTES 525
+#define RMUST_T_AIJ_MIN_IO_BYTES 526
+#define RMUST_T_HOT_ABS_SUSPEND 527
+#define RMUST_T_BUF_CNT 529
+#define RMUST_T_RCS_CKPT_BUFFER_CNT 530
+#define RMUST_T_UDASH_INDEX 531
+#define RMUST_T_RCACHE_INDEX 532
+#define RMUST_T_RUJ_INDEX 533
+#define RMUST_T_TSN_INDEX 534
+#define RMUST_T_SEQ_INDEX 535
+#define RMUST_T_CPT_INDEX 536
+#define RMUST_T_CRL_ENABLED 546
+#define RMUST_T_RCWS_UNMARK_THRESHOLD 551
+#define RMUST_T_VOLUME_NAME 555
+#define RMUST_T_MAX_BLOCKS 556
+#define RMUST_T_ACE_FLAGS 557
+#define RMUST_T_ACE_ACCESS 558
+#define RMUST_T_ALTER_PRV_FLG 559
+#define RMUST_T_ANALYSE_PRV_FLG 560
+#define RMUST_T_BACKUP_PRV_FLG 561
+#define RMUST_T_CONVERT_PRV_FLG 562
+#define RMUST_T_COPY_PRV_FLG 563
+#define RMUST_T_DUMP_PRV_FLG 564
+#define RMUST_T_LOAD_PRV_FLG 565
+#define RMUST_T_MOVE_PRV_FLG 566
+#define RMUST_T_OPEN_PRV_FLG 567
+#define RMUST_T_RESTORE_PRV_FLG 568
+#define RMUST_T_SECURITY_PRV_FLG 569
+#define RMUST_T_SHOW_PRV_FLG 570
+#define RMUST_T_UNLOAD_PRV_FLG 571
+#define RMUST_T_VERIFY_PRV_FLG 572
+#define RMUST_T_IDENTIFIER 573
+#define RMUST_T_ACE_TEXT 574
+#define RMUST_T_MONITOR_UP_FLG 575
+#define RMUST_K_TAG_LAST_TAG 575
+#define KUSGTBEND 1000
+#define KUSGTBOG 1001
+#define KUSGTEOG 1002
+#define KUSGTBTRN 1003
+#define KUSGTBCNT 1004
+#define KUSGTBDTG 1005
+#define KUSGTBKEY 1006
+#define KUSGTWCLS 1007
+#define KUSGTUNST 1008
+#define KUSGTMD 1009
+#define KUSGTNP 1010
+#define RMUST_MRT_STAREA_MAPS 2000
+#define RMUST_MRT_RELINFO 2001
+#define RMUST_MRT_IDXINFO 2002
+#define RMUST_CT_AIJINFO 2100
+#define RMUST_CT_AIJJNLS 2101
+#define RMUST_CT_ARPMS_STATS 2102
+#define RMUST_CT_DBINFO 2103
+#define RMUST_CT_DBR 2104
+#define RMUST_CT_FILE 2105
+#define RMUST_CT_PROCESS 2106
+#define RMUST_CT_STALL 2107
+#define RMUST_CT_STALL_ACT 2108
+#define RMUST_CT_RTPMS_STATS 2109
+#define RMUST_CT_FILE_NODUP 2110
+#define RMUST_CT_REC_CACHE 2111
+#define RMUST_CT_RUJINFO 2112
+#define RMUST_CT_TSNINFO 2113
+#define RMUST_CT_SEQINFO 2114
+#define RMUST_CT_CPTINFO 2115
+#define RMUST_CT_AIPINFO 2116
+#define RMUST_CT_ACTIVE 2117
+#define RMUST_CT_CLUSTER 2118
+#define RMUST_CT_RMUACL 2119
+#define RMUST_CT_USERS 2120
+#define RMUST_CT_DATABASES 2121
+#define RMUST_CT_TAPE_DEVICES 2122
+#define RMUST_CT_DISK_DEVICES 2123
+#define RMUST_CT_DASH 2124
+#define RMUST_CT_USER_DASH 2125
+#define RMUST_CT_DB_MONITOR 2126
+#define RMUST_CT_LAPMS_TABLE 2127
+#define RMUST_CT_LAPMS_INDEX 2128
+#define RMUST_CT_LAPMS_TABLE_STATS 2129
+#define RMUST_CT_LAPMS_INDEX_STATS 2130
+#define RMUST_CT_LAPMS_STATS 2131
+#define KUSC2_FILE_ENTRY 2501
+#define KUSC3_FILE_STATS 2502
+#define KUSC4_LIBRARY_CACHE 2503
+#define KUSC5_PARAMETERS 2504
+#define KUSC6_FILE_HEADER 2505
+#define KUSC7_PROCESS 2506
+#define KUSC8_SQL_AREA 2507
+#define KUSC9_SESSIONS 2508
+#define KUSC10_SGA 2509
+#define KUSC11_SQL_TEXT 2510
+#define KUSC12_SESSTAT 2511
+#define KUSC13_SESSIONS_STAT 2512
+#define KUSC14_SYSSTAT 2513
+#define KUSC15_EVENT_DESCRIPTIONS 2514
+#define KUSC16_SESSION_WAIT 2515
+#define KUSC17_OPEN_CURSOR 2516
+#define KUSC18_LATCH_WHERE 2517
+#define KUSC19_LATCH_MISSES 2518
+#define KUSC20_LATCH_HOLDER 2519
+#define KUSC21_LATCH 2520
+#define KUSC23_RESOURCE 2522
+#define KUSC24_LOCKS_1 2523
+#define KUSC25_LOCKS_2 2524
+#define KUSC26_LOCKS_3 2525
+#define KUSC27_LOCKS_4 2526
+#define KUSC28_LOCKS_5 2527
+#define KUSC29_LOCK1_STAT 2528
+#define KUSC30_LOCK2_STAT 2529
+#define KUSC31_LOCK3_STAT 2530
+#define KUSC32_LOCK4_STAT 2531
+#define KUS1_FILE_NUMBER 3000
+#define KUS2_FILE_NAME 3001
+#define KUS4_FILE_STATUS 3003
+#define KUS5_FILE_BLOCK_SIZE 3004
+#define KUS6_FILE_CREATE_BLOCKS 3005
+#define KUS7_SERVER_TYPE 3006
+#define KUS8_CHECKPOINT_CHANGE_NUMBER 3007
+#define KUS9_PHYRDS 3008
+#define KUS10_PHYWRTS 3009
+#define KUS11_READTIM 3010
+#define KUS12_WRITETIM 3011
+#define KUS13_PHYBLKRD 3012
+#define KUS14_PHYBLKWRT 3013
+#define KUS15_LIBRARYCACHE_NDX 3014
+#define KUS16_GETS 3015
+#define KUS17_GETHITS 3016
+#define KUS18_PINS 3017
+#define KUS19_PINHITS 3018
+#define KUS20_RELOADS 3019
+#define KUS21_INVALIDATIONS 3020
+#define KUS22_DLM_LOCK_REQUESTS 3021
+#define KUS23_DLM_PIN_REQUESTS 3022
+#define KUS24_DLM_PIN_RELEASES 3023
+#define KUS25_DLM_INVALIDATION_REQUESTS 3024
+#define KUS26_DLM_INVALIDATIONS 3025
+#define KUS27_PARAM_NUM 3026
+#define KUS28_PARAM_NAME 3027
+#define KUS29_PARAM_TYPE 3028
+#define KUS30_PARAM_VALUE 3029
+#define KUS31_PARAM_IS_DEFAULT 3030
+#define KUS32_PARAM_IS_SESS_MODIFIABLE 3031
+#define KUS33_PARAM_IS_SYS_MODIFIABLE 3032
+#define KUS34_PROC_ADDR 3033
+#define KUS35_PID 3034
+#define KUS36_SPID 3035
+#define KUS37_USERNAME 3036
+#define KUS38_SERIAL_NUMBER 3037
+#define KUS39_TERMINAL 3038
+#define KUS40_PROGRAM 3039
+#define KUS41_PROCESS_BACKGROUND 3040
+#define KUS42_LATCHWAIT 3041
+#define KUS43_LATCHSPIN 3042
+#define KUS44_PROCESS_ACTIVE 3043
+#define KUS45_SQL_TEXT 3044
+#define KUS46_SHARABLE_MEM 3045
+#define KUS47_PERSISTENT_MEM 3046
+#define KUS48_RUNTIME_MEM 3047
+#define KUS49_CURS_SORTS 3048
+#define KUS50_VERSION_COUNT 3049
+#define KUS51_LOADED_VERSIONS 3050
+#define KUS52_OPEN_VERSIONS 3051
+#define KUS53_USERS_OPENING 3052
+#define KUS54_EXECUTIONS 3053
+#define KUS55_USERS_EXECUTING 3054
+#define KUS56_LOADS 3055
+#define KUS57_FIRST_LOAD_TIME 3056
+#define KUS58_INVALIDATIONS 3057
+#define KUS59_PARSE_CALLS 3058
+#define KUS60_DISK_READS 3059
+#define KUS61_BUFFER_GETS 3060
+#define KUS62_COMMAND_TYPE 3061
+#define KUS63_ROWS_PROCESSED 3062
+#define KUS64_OPTIMIZER_MODE 3063
+#define KUS65_PARSING_USER_ID 3064
+#define KUS66_PARSING_SCHEMA_ID 3065
+#define KUS67_KEPT_VERSIONS 3066
+#define KUS68_PARENT_ADDRESS 3067
+#define KUS69_OBJECT_HASH 3068
+#define KUS70_MODULE 3069
+#define KUS71_MODULE_HASH 3070
+#define KUS72_ACTION 3071
+#define KUS73_ACTION_HASH 3072
+#define KUS74_SESSION_ADDR 3073
+#define KUS75_SID 3074
+#define KUS76_SERIAL_NUM 3075
+#define KUS77_AUDSID 3076
+#define KUS78_PADDR 3077
+#define KUS79_USER_NUM 3078
+#define KUS80_USERNAME 3079
+#define KUS81_COMMAND 3080
+#define KUS82_TADDR 3081
+#define KUS83_LOCKWAIT 3082
+#define KUS84_STATUS 3083
+#define KUS85_SERIALIZABLE_ABORTS 3084
+#define KUS86_SCHEMA_NUM 3085
+#define KUS87_SCHEMA_NAME 3086
+#define KUS88_OSUSER 3087
+#define KUS89_PROCESS 3088
+#define KUS90_MACHINE 3089
+#define KUS91_TERMINAL 3090
+#define KUS92_PROGRAM 3091
+#define KUS93_SESSION_TYPE 3092
+#define KUS94_SQL_ADDRESS 3093
+#define KUS95_SQL_HASH_VALUE 3094
+#define KUS96_PREV_SQL_ADDR 3095
+#define KUS97_PREV_HASH_VALUE 3096
+#define KUS98_MODULE 3097
+#define KUS99_MODULE_HASH 3098
+#define KUS100_ACTION 3099
+#define KUS101_ACTION_HASH 3100
+#define KUS102_CLIENT_INFO 3101
+#define KUS103_FIXED_TABLE_SEQUENCE 3102
+#define KUS104_ROW_WAIT_OBJECT 3103
+#define KUS105_ROW_WAIT_FILE 3104
+#define KUS106_ROW_WAIT_BLOCK 3105
+#define KUS107_ROW_WAIT_ROW 3106
+#define KUS108_LOGON_TIME 3107
+#define KUS109_LAST_CALL_ELAPSE_TIME 3108
+#define KUS110_OBJECT_STATE 3109
+#define KUS111_SESSION_FLAGS 3110
+#define KUS112_SGA_NAME 3111
+#define KUS113_SGA_SIZE 3112
+#define KUS114_SQL_TEXT_ADDR 3113
+#define KUS115_HASH_VALUE 3114
+#define KUS116_SQL_TEXT_PIECE 3115
+#define KUS117_SQL_TEXT 3116
+#define KUS118_SESSION_STATS_ARRAY 3117
+#define KUS119_SYS_STATISTIC_NUM 3118
+#define KUS121_SYS_STATISTIC_NAME 3120
+#define KUS122_SYS_STATISTIC_CLASS 3121
+#define KUS123_SYS_STATISTIC_VALUE 3122
+#define KUS124_EVENT_NUMBER 3123
+#define KUS125_EVENT_NAME 3124
+#define KUS126_PARAM_1_TEXT 3125
+#define KUS127_PARAM_2_TEXT 3126
+#define KUS128_PARAM_3_TEXT 3127
+#define KUS129_SESSION_SEQ_NUM 3128
+#define KUS130_P1 3129
+#define KUS131_P1_RAW 3130
+#define KUS132_P2 3131
+#define KUS133_P2_RAW 3132
+#define KUS134_P3 3133
+#define KUS135_P3_RAW 3134
+#define KUS136_WAIT_TIME 3135
+#define KUS137_SECONDS_IN_WAIT 3136
+#define KUS138_OBJECT_STATE_FLAGS 3137
+#define KUS139_LATCH_ADDRESS 3138
+#define KUS140_USER_NAME 3139
+#define KUS141_CURSOR_ADDRESS 3140
+#define KUS142_CURSOR_HASH_VALUE 3141
+#define KUS143_CURSOR_SQL_TEXT 3142
+#define KUS144_CURSOR_OBJ_NAME_SPACE 3143
+#define KUS145_CURSOR_OBJ_HANDLE 3144
+#define KUS146_LATCH_NUMBER 3145
+#define KUS147_LATCH_WHERE 3146
+#define KUS148_LATCH_PARENT_NAME 3147
+#define KUS149_LATCH_NO_WAIT_FAIL_COUNT 3148
+#define KUS150_LATCH_NAME 3149
+#define KUS151_LATCH_LEVEL_NUMBER 3150
+#define KUS152_LATCH_GETS 3151
+#define KUS153_LATCH_MISSES 3152
+#define KUS154_SLEEPS 3153
+#define KUS155_IMMEDIATE_GETS 3154
+#define KUS156_IMMEDIATE_MISSES 3155
+#define KUS157_WAITERS_WOKEN 3156
+#define KUS158_WAITS_HOLDING_LATCH 3157
+#define KUS159_SPIN_GETS 3158
+#define KUS160_SLEEP1 3159
+#define KUS161_SLEEP2 3160
+#define KUS162_SLEEP3 3161
+#define KUS163_SLEEP4 3162
+#define KUS164_SLEEP5 3163
+#define KUS165_SLEEP6 3164
+#define KUS166_SLEEP7 3165
+#define KUS167_SLEEP8 3166
+#define KUS168_SLEEP9 3167
+#define KUS169_SLEEP10 3168
+#define KUS170_SLEEP11 3169
+#define KUS171_SLEEP12 3170
+#define KUS172_SLEEP13 3171
+#define KUS173_RESOURCE_ADDR 3172
+#define KUS174_RESOURCE_TYPE 3173
+#define KUS175_RESOURCE_ID_1 3174
+#define KUS176_RESOURCE_ID_2 3175
+#define KUS177_RESOURCE_FLAG 3176
+#define KUS178_LOCK_STATE_ADDRESS 3177
+#define KUS179_LOCK_ADDRESS 3178
+#define KUS180_LOCK_MODE_HELD 3179
+#define KUS181_LOCK_MODE_REQUESTED 3180
+#define KUS182_LOCK_HELD_TIME 3181
+#define KUS183_BLOCKING 3182
+#define KUS184_LATCH_SLEEP_COUNT 3183
+#define KUS185_CURRENT_FILE_BLOCKS 3184
+#define KUS203_FILE_ENABLED 3202
+#define KUS204_CACHE_NAMESPACE 3203
+#define KUS205_PARAM_IS_MODIFIED 3204
+#define KUS206_PARAM_IS_ADJUSTED 3205
+#define KUS207_PARAM_DESCRIPTION 3206
+#define KUSST1 5000
+#define KUSST2 5001
+#define KUSST3 5002
+#define KUSST4 5003
+#define KUSST5 5004
+#define KUSST6 5005
+#define KUSST7 5006
+#define KUSST8 5007
+#define KUSST9 5008
+#define KUSST10 5009
+#define KUSST11 5010
+#define KUSST12 5011
+#define KUSST13 5012
+#define KUSST14 5013
+#define KUSST15 5014
+#define KUSST16 5015
+#define KUSST17 5016
+#define KUSST18 5017
+#define KUSST19 5018
+#define KUSST20 5019
+#define KUSST21 5020
+#define KUSST22 5021
+#define KUSST23 5022
+#define KUSST24 5023
+#define KUSST25 5024
+#define KUSST26 5025
+#define KUSST27 5026
+#define KUSST28 5027
+#define KUSST29 5028
+#define KUSST30 5029
+#define KUSST31 5030
+#define KUSST32 5031
+#define KUSST33 5032
+#define KUSST34 5033
+#define KUSST35 5034
+#define KUSST36 5035
+#define KUSST37 5036
+#define KUSST38 5037
+#define KUSST39 5038
+#define KUSST40 5039
+#define KUSST41 5040
+#define KUSST42 5041
+#define KUSST43 5042
+#define KUSST44 5043
+#define KUSST45 5044
+#define KUSST46 5045
+#define KUSST47 5046
+#define KUSST48 5047
+#define KUSST49 5048
+#define KUSST50 5049
+#define KUSST51 5050
+#define KUSST52 5051
+#define KUSST53 5052
+#define KUSST54 5053
+#define KUSST55 5054
+#define KUSST56 5055
+#define KUSST57 5056
+#define KUSST58 5057
+#define KUSST59 5058
+#define KUSST60 5059
+#define KUSST61 5060
+#define KUSST62 5061
+#define KUSST63 5062
+#define KUSST64 5063
+#define KUSST65 5064
+#define KUSST66 5065
+#define KUSST67 5066
+#define KUSST68 5067
+#define KUSST69 5068
+#define KUSST70 5069
+#define KUSST71 5070
+#define KUSST72 5071
+#define KUSST73 5072
+#define KUSST74 5073
+#define KUSST75 5074
+#define KUSST76 5075
+#define KUSST77 5076
+#define KUSST78 5077
+#define KUSST79 5078
+#define KUSST80 5079
+#define KUSST81 5080
+#define KUSST82 5081
+#define KUSST83 5082
+#define KUSST84 5083
+#define KUSST85 5084
+#define KUSST86 5085
+#define KUSST87 5086
+#define KUSST88 5087
+#define KUSST89 5088
+#define KUSST90 5089
+#define KUSST91 5090
+#define KUSST92 5091
+#define KUSST93 5092
+#define KUSST94 5093
+#define KUSST95 5094
+#define KUSST96 5095
+#define KUSST97 5096
+#define KUSST98 5097
+#define KUSST99 5098
+#define KUSST100 5099
+#define KUSST101 5100
+#define KUSST102 5101
+#define KUSST103 5102
+#define KUSST104 5103
+#define KUSST105 5104
+#define KUSST106 5105
+#define KUSST107 5106
+#define KUSST108 5107
+#define KUSST109 5108
+#define KUSST110 5109
+#define KUSST111 5110
+#define KUSST112 5111
+#define KUSST113 5112
+#define KUSST114 5113
+#define KUSST115 5114
+#define KUSST116 5115
+#define KUSST117 5116
+#define KUSST118 5117
+#define KUSST119 5118
+#define KUSST120 5119
+#define KUSST121 5120
+#define KUSST122 5121
+#define KUSST123 5122
+#define KUSST124 5123
+#define KUSST125 5124
+#define KUSST126 5125
+#define KUSST127 5126
+#define KUSST128 5127
+#define KUSST129 5128
+#define KUSST130 5129
+#define KUSST131 5130
+#define KUSST132 5131
+#define KUSST133 5132
+#define KUSST134 5133
+#define KUSST135 5134
+#define KUSST136 5135
+#define KUSST137 5136
+#define KUSST138 5137
+#define KUSST139 5138
+#define KUSST140 5139
+#define KUSST141 5140
+#define KUSST142 5141
+#define KUSST143 5142
+#define KUSST144 5143
+#define KUSST145 5144
+#define KUSST146 5145
+#define KUSST147 5146
+#define KUSST148 5147
+#define KUSST149 5148
+#define KUSST150 5149
+#define KUSST151 5150
+#define KUSST152 5151
+#define KUSST153 5152
+#define KUSST154 5153
+#define KUSST155 5154
+#define KUSST156 5155
+#define KUSST157 5156
+#define KUSST158 5157
+#define KUSST159 5158
+#define KUSST160 5159
+#define KUSST161 5160
+#define KUSST162 5161
+#define KUSST163 5162
+#define KUSST164 5163
+#define KUSST165 5164
+#define KUSST166 5165
+#define KUSST167 5166
+#define KUSST168 5167
+#define KUSST169 5168
+#define KUSST170 5169
+#define KUSST171 5170
+#define KUSST172 5171
+#define KUSST173 5172
+#define KUSST174 5173
+#define KUSST175 5174
+#define KUSST176 5175
+#define KUSST177 5176
+#define KUSST178 5177
+#define KUSST179 5178
+#define KUSST180 5179
+#define KUSST181 5180
+#define KUSST182 5181
+#define KUSST183 5182
+#define KUSST184 5183
+#define KUSST185 5184
+#define KUSST186 5185
+#define KUSST187 5186
+#define KUSST188 5187
+#define KUSST189 5188
+#define KUSST190 5189
+#define KUSST191 5190
+#define KUSST192 5191
+#define KUSST193 5192
+#define KUSST194 5193
+#define KUSST195 5194
+#define KUSST196 5195
+#define KUSST197 5196
+#define KUSST198 5197
+#define KUSST199 5198
+
+/* 0-based count of tags */
+
+#define KUSTAGCOUNT 975
+
+/* Oracle Rdb tags (0-999)*/
+
+#define KUSRTAGSTART 0
+#define KUSRTAGEND 999
+
+/* global tags (1000 - 1999) */
+
+#define KUSGTTAGSTART 1000
+#define KUSGTTAGEND 1999
+
+/* Oracle Rdb class tags */
+
+#define KUSRCTAGSTART 2000
+#define KUSRCTAGEND 2499
+
+/* Oracle class tags */
+
+#define KUSOCTAGSTART 2500
+#define KUSOCTAGEND 2999
+
+/* oracle tags (3000 - 9999) */
+
+#define KUSOTAGSTART 3000
+#define KUSOTAGMAX 9999
+
+/* ENABLE check_macro_naming */
+
+#endif
diff --git a/src/terralib/drivers/Oracle/OCI/include/nzerror.h b/src/terralib/drivers/Oracle/OCI/include/nzerror.h
new file mode 100644
index 0000000..5490c65
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/nzerror.h
@@ -0,0 +1,644 @@
+/* DISABLE check_long_lines  */
+
+/*
+ * $Header$
+ *
+ * Copyright (c) 1995, 2003, Oracle Corporation.  All rights reserved.  
+ */
+
+/* ENABLE check_long_lines  */
+/*
+  NAME
+     nzerror.h - error numbers for the Oracle Security Server
+  DESCRIPTION
+     None.
+  PUBLIC FUNCTION(S)
+     None.
+  PRIVATE FUNCTION(S)
+     None.
+  NOTES
+     A pragma is used to silence olint about the enum value names not being
+     unique within 7 characters. This limit is being changed to 30.
+  MODIFIED
+     rchahal    10/15/03 - bug 2513821 
+     rchahal    08/14/03 - new error range (43000 - 43499) 
+     skalyana   08/25/03 - Error changes 
+     rchahal    06/27/03 - RSA errors
+     rchahal    05/27/03 - convert wallet
+     skalyana   03/07/03 - Move FIPS errors
+     rchahal    02/28/03 - bug 2648177
+     rchahal    01/20/03 - use sltsky
+     rchahal    11/11/02 - pkcs11 support
+     skalyana   11/29/02 - Add mutex errors
+     akoyfman   11/01/02 - adding crl cache
+     rchahal    10/23/02 - crldp error
+     rchahal    10/15/02 - fetch crl from ldap
+     rchahal    10/07/02 - crl support
+     akoyfman   10/16/02 - Update with SSL PLus 4.2 errors
+     skalyana   10/04/02 - Certicom SSL Plus 4.2 Upgrade changes
+     akoyfman   08/06/02 - adding sso wallet errors
+     akoyfman   07/12/02 - adding secret store errors
+     skalyana   07/07/02 - Add more errors for FIPS self tests
+     skalyana   07/01/02 - Add more errors
+     skalyana   06/03/02 - Add NZ error for self test failure.
+     ajacobs    02/22/01 - Add some entrust errors
+     vle        02/09/01 - add error mesg
+     lkethana   08/11/00 - Extension Errors
+     lkethana   07/30/00 - add pkcs12 errors
+     lkethana   06/17/00 - mult cert errors
+     lkethana   06/11/00 - multiple cert support
+     rturlapa   03/29/00 - Add error meesage for Entrust Login failure.
+     rwessman   07/07/99 - Deleted include of sslerrs.h. It caused the RDBMS bu
+     rwessman   07/02/99 - fixed merge errors
+     rwessman   07/01/99 - moved NZOS errors to nzerror to make them visible
+     supriya    12/16/98 - add new error for cert chain.
+     arswamin   12/04/98 - add NZERROR_NO_MATCHING_PRIVATE_KEY
+     qdinh      11/12/98 - add NZERROR_VALIDITY_EXPIRED.
+     arswamin   06/17/98 - add INIT_FAILED
+     sdange     06/10/98 - change wrong password to bad password
+     amthakur   06/09/98 - adding error messages
+     wliau      03/10/97 - Add new error message for snzdfo.c.
+     rwessman   03/14/97 - Consolidated PL/SQL toolkit errors into generic erro
+     rwessman   02/26/97 - Added NZERROR_UNSUPPORTED. Corrected values of
+                           errors outside the valid range.
+     asriniva   03/02/97 - Fix olint warning
+     rwessman   02/26/97 - Added NZERROR_UNSUPPORTED
+     rwessman   01/02/97 - Changed PLSQL package errors to be TK_PLSQL to
+                           separate them from the errors generated by the
+                           Oracle interface.
+     rwessman   12/30/96 - Merged in PL/SQL toolkit errors
+     sdange     11/14/96 - (Added NZERROR_DECRYPT_FAILED to the enum list)
+     rwessman   12/02/96 -
+     rwessman   11/25/96 - Added error messages for PL/SQL functions.
+     asriniva   10/31/96 - Include oratypes.h
+     asriniva   10/29/96 - Fix numbering.
+     asriniva   10/29/96 - Fix error numbers
+     asriniva   10/29/96 - Correct type-o
+     asriniva   10/28/96 - Add more TK errors
+     asriniva   10/28/96 - Convert OKAPI errors to TK errors.
+     rwessman   10/17/96 - still more OSS TK errors
+     asriniva   10/16/96 - OKAPI errors
+     asriniva   10/15/96 - OSSTK errors
+     rwessman   10/15/96 - Added more OSS TK errors
+     asriniva   10/09/96 - Add OSSTK errors.
+     rwessman   09/05/96 - Added errors for PL/SQL functions.
+     wliau      09/05/96 - correct error numbers.
+     $Log$
+ * Revision 1.26  1996/07/15  23:07:23  wliau
+ * Added NZERROR_AUTH_SHARED_MEMORY
+ *
+ * Revision 1.25  1996/07/01  20:40:15  asriniva
+ * Finished RSA verify/sign.
+ *
+ * Revision 1.24  1996/06/27  20:39:41  rwessman
+ * Added more errors.
+ *
+ * Revision 1.23  1996/05/31  17:33:40  rwessman
+ * Updated nzerror.h to contain bug # for olint enum bug.
+ *
+ * Revision 1.22  1996/05/31  17:12:30  rwessman
+ * Assigned values to the various errors.
+ *
+ * Revision 1.21  1996/05/13  20:46:58  ggilchri
+ * Added more attribute related error conditions
+ *
+*/
+
+#ifndef NZERROR_ORACLE
+# define NZERROR_ORACLE
+
+#ifndef ORATYPES
+# include <oratypes.h>
+#endif /* ORATYPES */
+
+/*
+** Errors - when an error is added here, a message corresponding to the
+** error number must be added to the message file.
+** New errors must be assigned numbers, otherwise the compiler can assign any
+** value that it wants, which may lead to invalid error numbers being
+** generated.
+** The number range currently assigned to the OSS is 28750 - 29249
+** New number range 43000 - 43499
+*/
+
+typedef enum nzerror
+{
+  NZERROR_OK = 0,
+  NZERROR_GENERIC = 28750,                          /* A catchall for errors */
+  NZERROR_NO_MEMORY = 28751,                               /* No more memory */
+  NZERROR_DATA_SOURCE_INIT_FAILED = 28752,     /* Failed to init data source */
+  NZERROR_DATA_SOURCE_TERM_FAILED = 28753,/* Failed to terminate data source */
+  NZERROR_OBJECT_STORE_FAILED = 28754, /* Store object in data source failed */
+  NZERROR_OBJECT_GET_FAILED = 28755,
+                                 /* Failed to obtain object from data source */
+  NZERROR_MEMORY_ALLOC_FAILED = 28756,
+                                       /* Callback failed to allocate memory */
+  NZERROR_MEMORY_ALLOC_0_BYTES = 28757,
+                                   /* Attempted to ask for 0 bytes of memory */
+  NZERROR_MEMORY_FREE_FAILED = 28758,
+                                           /* Callback failed to free memory */
+  NZERROR_FILE_OPEN_FAILED = 28759,
+                                                      /* Open of file failed */
+  NZERROR_LIST_CREATION_FAILED = 28760,
+                                                  /* Creation of list failed */
+  NZERROR_NO_ELEMENT = 28761,
+                                                    /* No list element found */
+  NZERROR_ELEMENT_ADD_FAILED = 28762,
+                                          /* Addition of list element failed */
+  NZERROR_PARAMETER_BAD_TYPE = 28763,
+                                   /* Retrieval of an unknown parameter type */
+  NZERROR_PARAMETER_RETRIEVAL = 28764,      /* Retrieval of parameter failed */
+                             
+  NZERROR_NO_LIST = 28765,                /* Data method list does not exist */
+  NZERROR_TERMINATE_FAIL = 28766,                     /* Failed to terminate */
+  NZERROR_BAD_VERSION_NUMBER = 28767,                  /* Bad version number */
+  NZERROR_BAD_MAGIC_NUMBER = 28768,                      /* Bad magic number */
+  NZERROR_METHOD_NOT_FOUND = 28769,
+                           /* Data retrieval method specified does not exist */
+  NZERROR_ALREADY_INITIALIZED = 28770,
+                                    /*The data source is already initialized */
+  NZERROR_NOT_INITIALIZED = 28771,     /* The data source is not initialized */
+  NZERROR_BAD_FILE_ID = 28772,                             /* File ID is bad */
+  NZERROR_WRITE_MAGIC_VERSION = 28773,  /* Failed to write magic and version */
+  NZERROR_FILE_WRITE_FAILED = 28774,              /* Failed to write to file */
+  NZERROR_FILE_CLOSE_FAILED = 28775,                 /* Failed to close file */
+  NZERROR_OUTPUT_BUFFER_TOO_SMALL = 28776,
+                           /* The buffer supplied by the caller is too small */
+  NZERROR_BINDING_CREATION_FAILED = 28777,/* NL failed in creating a binding */
+  NZERROR_PARAMETER_MALFORMED = 28778,    /* A parameter was in a bad format */
+  NZERROR_PARAMETER_NO_METHOD = 28779,
+                                  /* No method was specified for a data type */
+  NZERROR_BAD_PARAMETER_METHOD = 28780,      /* Illegal method for data type */
+  NZERROR_PARAMETER_NO_DATA = 28781,    /* No method specified when required */
+  NZERROR_NOT_ALLOCATED = 28782,             /* Data source is not allocated */
+  NZERROR_INVALID_PARAMETER = 28783,               /* Invalid parameter name */
+  NZERROR_FILE_NAME_TRANSLATION = 28784,/* Could not translate OSD file name */
+  NZERROR_NO_SUCH_PARAMETER = 28785,   /* Selected parameter is non-existent */
+
+  NZERROR_DECRYPT_FAILED = 28786,  
+                                 /* Encrypted private key decryption failure */ 
+  NZERROR_ENCRYPT_FAILED = 28787,     /* Private key encryption failed */
+ 
+  NZERROR_INVALID_INPUT = 28788,     /* Incorrect input or unknown error */ 
+
+  NZERROR_NAME_TYPE_NOT_FOUND = 28789,
+                                  /* Type of name requested is not available */
+  NZERROR_NLS_STRING_OPEN_FAILED = 28790,
+                                        /* Failure to generate an NLS string */
+  NZERROR_CERTIFICATE_VERIFY = 28791,      /* Failed to verify a certificate */
+  NZERROR_OCI_PLSQL_FAILED = 28792,
+                                 /* an OCI call to process some plsql failed */
+  NZERROR_OCI_BIND_FAILED = 28793,
+                              /* an OCI call to bind an internal var. failed */
+  NZERROR_ATTRIBUTE_INIT = 28794,           /* failed to init role retrieval */
+  NZERROR_ATTRIBUTE_FINISH_FAILED = 28795,/* Did not complete role retrieval */
+  NZERROR_UNSUPPORTED_METHOD = 28796, /* Data method specified not supported */
+  NZERROR_INVALID_KEY_DATA_TYPE = 28797,
+                                      /* Invalid data type specified for key */
+  NZEROR_BIND_SUBKEY_COUNT = 28798,
+       /* Number of sub-keys to bind does not match count in initialized key */
+  NZERROR_AUTH_SHARED_MEMORY = 28799,
+    /* Failed to retreieve authentication information from the shared memory */
+  NZERROR_RIO_OPEN = 28800,                               /* RIO Open Failed */
+  NZERROR_RIO_OBJECT_TYPE = 28801,                /* RIO object type invalid */
+  NZERROR_RIO_MODE = 28802,                              /* RIO mode invalid */
+  NZERROR_RIO_IO = 28803,                     /* RIO io set or numberinvalid */
+  NZERROR_RIO_CLOSE = 28804,                             /* RIO close failed */
+  NZERROR_RIO_RETRIEVE = 28805,                       /* RIO retrieve failed */
+  NZERROR_RIO_STORE = 28806,                             /* RIO store failed */
+  NZERROR_RIO_UPDATE = 28807,                           /* RIO update failed */
+  NZERROR_RIO_INFO = 28808,                               /* RIO info failed */
+  NZERROR_RIO_DELETE = 28809,                           /* RIO delete failed */
+  NZERROR_KD_CREATE = 28810,                 /* Key descriptor create failed */
+  NZERROR_RIO_ACCESS_DESCRIPTOR = 28811,        /* access descriptor invalid */
+  NZERROR_RIO_RECORD = 28812,                              /* record invalid */
+  NZERROR_RIO_RECORD_TYPE = 28813,    /* record type and AD type not matched */
+  NZERROR_PLSQL_ORACLE_TO_REAL = 28814,
+          /* A number passed to PL/SQL could not be converted to real format */
+  NZERROR_PLSQL_REAL_TO_ORACLE = 28815,
+       /* A number in machine format could not be converted to Oracle format */
+  NZERROR_TK_PLSQL_NO_PASSWORD = 28816,
+                         /* A password was not provided to a PL/SQL function */
+  NZERROR_TK_PLSQL_GENERIC = 28817,
+                                      /* A PL/SQL function returned an error */
+  NZERROR_TK_PLSQL_NO_CONTEXT = 28818,
+               /* The package context was not specified to a PL/SQL function */
+  NZERROR_TK_PLSQL_NO_DIST_NAME = 28819,
+      /* The user's distinguished name was not provided to a PL/SQL function */
+  NZERROR_TK_PLSQL_NO_STATE = 28820,
+/* The state of either a signature or decryption/encryption was not provided */
+  NZERROR_TK_PLSQL_NO_INPUT = 28821,
+                       /* An input buffer was specified to a PL/SQL function */
+  NZERROR_TK_PLSQL_NO_SEED = 28822,
+         /* No seed was specified to the PL/SQL seed initialization function */
+  NZERROR_TK_PLSQL_NO_BYTES = 28823,
+  /* Number of bytes was not specified to the PL/SQL random number generator */
+  NZERROR_TK_INVALID_STATE = 28824,
+                     /* Invalid encryption/decryption/signature state passed */
+  NZERROR_TK_PLSQL_NO_ENG_FUNC = 28825,
+                                  /* No crypto engine function was passed in */
+  NZERROR_TK_INV_ENG_FUNC = 28826,
+                          /* An invalid crypto engine function was passed in */
+  NZERROR_TK_INV_CIPHR_TYPE = 28827,
+                                     /* An invalid cipher type was passed in */
+  NZERROR_TK_INV_IDENT_TYPE = 28828,
+                                   /* An invalid identity type was specified */
+  NZERROR_TK_PLSQL_NO_CIPHER_TYPE = 28829,
+                                             /* No cipher type was specified */
+  NZERROR_TK_PLSQL_NO_IDENT_TYPE = 28830,
+                                           /* No identity type was specified */
+  NZERROR_TK_PLSQL_NO_DATA_FMT = 28831,
+                                        /* No data unit format was specified */
+  NZERROR_TK_INV_DATA_FMT = 28832,
+                        /* Invalid data unit format was provided to function */
+  NZERROR_TK_PLSQL_INSUFF_INFO = 28833,
+       /* Not enough info (usually parameters) provided to a PL/SQL function */
+  NZERROR_TK_PLSQL_BUF_TOO_SMALL = 28834,
+           /* Buffer provided by PL/SQL is too small for data to be returned */
+  NZERROR_TK_PLSQL_INV_IDENT_DESC = 28835,
+                             /* Identity descriptor not present or too small */
+  NZERROR_TK_PLSQL_WALLET_NOTOPEN = 28836,
+                                           /* Wallet has not been opened yet */
+  NZERROR_TK_PLSQL_NO_WALLET = 28837,
+                        /* No wallet descriptor specified to PL/SQL function */
+  NZERROR_TK_PLSQL_NO_IDENTITY = 28838,
+                      /* No identity descriptor specified to PL/SQL function */
+  NZERROR_TK_PLSQL_NO_PERSONA = 28839,
+                   /* No persona descriptor was specified to PL/SQL function */
+  NZERROR_TK_PLSQL_WALLET_OPEN = 28840,
+                                                /* Wallet was already opened */
+  NZERROR_UNSUPPORTED = 28841,                 /* Operation is not supported */
+  NZERROR_FILE_BAD_PERMISSION = 28842,      /* Bad file permission specified */
+  NZERROR_FILE_OSD_ERROR = 28843,             /* OSD error when opening file */
+  NZERROR_NO_WALLET  = 28844,  /* cert + privkey + tp files do not exist */
+  NZERROR_NO_CERTIFICATE_ALERT    = 28845,  /* no certificate */
+  NZERROR_NO_PRIVATE_KEY          = 28846,  /* no private-key */
+  NZERROR_NO_CLEAR_PRIVATE_KEY_FILE   = 28847,   /* no clear key-file */
+  NZERROR_NO_ENCRYPTED_PRIVATE_KEY_FILE = 28848,  /* no encrypted priv key */
+  NZERROR_NO_TRUSTPOINTS     = 28849,       /* no trustpoints */
+  NZERROR_NO_CLEAR_TRUSTPOINT_FILE    = 28850,   /* no clear trustpoints */
+  NZERROR_NO_ENCRYPTED_TRUSTPOINT_FILE = 28851,   /* no encrypted trustpoints */
+  NZERROR_BAD_PASSWORD    = 28852,   /* bad password */
+  NZERROR_INITIALIZATION_FAILED   =  28853, /* init failed or 
+					       module loading failed */
+  /******************************* SSL ERRORS ********************************/
+  /*
+   * In order to allow SSL errors to be mapped to Oracle errors, space is
+   * provided here. One Oracle error is provided for each SSL error to make
+   * error handling easier. A macro is provided to do the conversion.
+   * NOTE: ANY CHANGE IN SSL ERRORS MUST BE REFLECTED HERE.
+   * To add an SSL error, use the following formula to calculate the Oracle
+   * error:
+   * new_oracle_error = (new_ssl_error - SSLMemoryError) + NZERROR_SSLMemoryErr
+   * or numerically:
+   * new_oracle_error = (new_ssl_error - -7000) + 28854
+   */
+  NZERROR_SSLMemoryErr = 28854,
+  NZERROR_SSLUnsupportedErr = 28855,
+  NZERROR_SSLOverflowErr = 28856,
+  NZERROR_SSLUnknownErr = 28857,
+  NZERROR_SSLProtocolErr = 28858,
+  NZERROR_SSLNegotiationErr = 28859,
+  NZERROR_SSLFatalAlert = 28860,
+  NZERROR_SSLWouldBlockErr = 28861,
+  NZERROR_SSLIOErr = 28862,
+  NZERROR_SSLSessionNotFoundErr = 28863,
+  NZERROR_SSLConnectionClosedGraceful = 28864,
+  NZERROR_SSLConnectionClosedError = 28865,
+  NZERROR_ASNBadEncodingErr = 28866,
+  NZERROR_ASNIntegerTooBigErr = 28867,
+  NZERROR_X509CertChainInvalidErr = 28868,
+  NZERROR_X509CertExpiredErr = 28869,
+  NZERROR_X509NamesNotEqualErr = 28870,
+  NZERROR_X509CertChainIncompleteErr = 28871,
+  NZERROR_X509DataNotFoundErr = 28872,
+  NZERROR_SSLBadParameterErr = 28873,
+  NZERROR_SSLIOClosedOverrideGoodbyeKiss = 28874,
+  NZERROR_X509MozillaSGCErr  =  28875,
+  NZERROR_X509IESGCErr       =  28876,
+  NZERROR_ImproperServerCredentials = 28877,
+  NZERROR_ImproperClientCredentials = 28878,
+  NZERROR_NoProtocolSideSet = 28879,
+  NZERROR_setPersonaFailed = 28880,
+  NZERROR_setCertFailed = 28881,
+  NZERROR_setVKeyFailed = 28882,
+  NZERROR_setTPFailed = 28883,
+  NZERROR_BadCipherSuite = 28884,
+  NZERROR_NoKeyPairForKeyUsage = 28885,
+
+/* ============>>>  ENTRUST ERRORS */
+  NZERROR_EntrustLoginFailed = 28890,
+  NZERROR_EntrustGetInfoFailed = 28891,
+  NZERROR_EntrustLoadCertificateFailed = 28892,
+  NZERROR_EntrustGetNameFailed = 28893,
+
+/* ============>>> NZERRORS CONTINUED */
+  NZERROR_CertNotInstalled = 29000,
+  NZERROR_ServerDNMisMatched = 29002,
+  NZERROR_ServerDNMisConfigured = 29003,
+
+/* ============>>> PKI VENDORS ERRORS 29050 - 29099 */
+
+/* ============>>> SSL Errors CONTINUED */
+  NZERROR_CIC_ERR_SSL_ALERT_CB_FAILURE = 29004,
+  NZERROR_CIC_ERR_SSL_BAD_CERTIFICATE = 29005,
+  NZERROR_CIC_ERR_SSL_BAD_CERTIFICATE_REQUEST = 29006,
+  NZERROR_CIC_ERR_SSL_BAD_CLEAR_KEY_LEN = 29007,
+  NZERROR_CIC_ERR_SSL_BAD_DHPARAM_KEY_LENGTH = 29008,
+  NZERROR_CIC_ERR_SSL_BAD_ENCRYPTED_KEY_LEN = 29009,
+  NZERROR_CIC_ERR_SSL_BAD_EXPORT_KEY_LENGTH = 29010,
+  NZERROR_CIC_ERR_SSL_BAD_FINISHED_MESSAGE = 29011,
+  NZERROR_CIC_ERR_SSL_BAD_KEY_ARG_LEN = 29012,
+  NZERROR_CIC_ERR_SSL_BAD_MAC = 29013,
+  NZERROR_CIC_ERR_SSL_BAD_MAX_FRAGMENT_LENGTH_EXTENSION = 29014,
+  NZERROR_CIC_ERR_SSL_BAD_MESSAGE_LENGTH = 29015,
+  NZERROR_CIC_ERR_SSL_BAD_PKCS1_PADDING = 29016,
+  NZERROR_CIC_ERR_SSL_BAD_PREMASTER_SECRET_LENGTH = 29017,
+  NZERROR_CIC_ERR_SSL_BAD_PREMASTER_SECRET_VERSION = 29018,
+  NZERROR_CIC_ERR_SSL_BAD_PROTOCOL_VERSION = 29019,
+  NZERROR_CIC_ERR_SSL_BAD_RECORD_LENGTH = 29020,
+  NZERROR_CIC_ERR_SSL_BAD_SECRET_KEY_LEN = 29021,
+  NZERROR_CIC_ERR_SSL_BAD_SIDE = 29022,
+  NZERROR_CIC_ERR_SSL_BUFFERS_NOT_EMPTY = 29023,
+  NZERROR_CIC_ERR_SSL_CERTIFICATE_VALIDATE_FAILED = 29024,
+  NZERROR_CIC_ERR_SSL_CERT_CHECK_CALLBACK = 29025,
+  NZERROR_CIC_ERR_SSL_DECRYPT_FAILED = 29026,
+  NZERROR_CIC_ERR_SSL_ENTROPY_COLLECTION = 29027,
+  NZERROR_CIC_ERR_SSL_FAIL_SERVER_VERIFY = 29028,
+  NZERROR_CIC_ERR_SSL_HANDSHAKE_ALREADY_COMPLETED = 29029,
+  NZERROR_CIC_ERR_SSL_HANDSHAKE_REQUESTED = 29030,
+  NZERROR_CIC_ERR_SSL_HANDSHAKE_REQUIRED = 29031,
+  NZERROR_CIC_ERR_SSL_INCOMPLETE_IDENTITY = 29032,
+  NZERROR_CIC_ERR_SSL_INVALID_PFX = 29033,
+  NZERROR_CIC_ERR_SSL_NEEDS_CIPHER_OR_CLIENTAUTH = 29034,
+  NZERROR_CIC_ERR_SSL_NEEDS_PRNG = 29035,
+  NZERROR_CIC_ERR_SSL_NOT_SUPPORTED = 29036,
+  NZERROR_CIC_ERR_SSL_NO_CERTIFICATE = 29037,
+  NZERROR_CIC_ERR_SSL_NO_MATCHING_CERTIFICATES = 29038,
+  NZERROR_CIC_ERR_SSL_NO_MATCHING_CIPHER_SUITES = 29039,
+  NZERROR_CIC_ERR_SSL_NO_SUPPORTED_CIPHER_SUITES = 29040,
+  NZERROR_CIC_ERR_SSL_NULL_CB = 29041,
+  NZERROR_CIC_ERR_SSL_READ_BUFFER_NOT_EMPTY = 29042,
+  NZERROR_CIC_ERR_SSL_READ_REQUIRED = 29043,
+  NZERROR_CIC_ERR_SSL_RENEGOTIATION_ALREADY_REQUESTED = 29044,
+  NZERROR_CIC_ERR_SSL_RENEGOTIATION_REFUSED = 29045,
+  NZERROR_CIC_ERR_SSL_RESUMABLE_SESSION = 29046,
+  NZERROR_CIC_ERR_SSL_TLS_EXTENSION_MISMATCH = 29047,
+  NZERROR_CIC_ERR_SSL_UNEXPECTED_MSG = 29048,
+  NZERROR_CIC_ERR_SSL_UNKNOWN_RECORD = 29049,
+  NZERROR_CIC_ERR_SSL_UNSUPPORTED_CLIENT_AUTH_MODE = 29050,
+  NZERROR_CIC_ERR_SSL_UNSUPPORTED_PUBKEY_TYPE = 29051,
+  NZERROR_CIC_ERR_SSL_WRITE_BUFFER_NOT_EMPTY = 29052,
+  NZERROR_CIC_ERR_PKCS12_MISSING_ALG = 29053,
+  NZERROR_CIC_ERR_PKCS_AUTH_FAILED = 29054,
+  NZERROR_CIC_ERR_PKCS_BAD_CONTENT_TYPE = 29055,
+  NZERROR_CIC_ERR_PKCS_BAD_INPUT = 29056,
+  NZERROR_CIC_ERR_PKCS_BAD_PADDING = 29057,
+  NZERROR_CIC_ERR_PKCS_BAD_SN = 29058,
+  NZERROR_CIC_ERR_PKCS_BAD_SN_LENGTH = 29059,
+  NZERROR_CIC_ERR_PKCS_BAD_VERSION = 29060,
+  NZERROR_CIC_ERR_PKCS_BASE = 29061,
+  NZERROR_CIC_ERR_PKCS_FIELD_NOT_PRESENT = 29062,
+  NZERROR_CIC_ERR_PKCS_NEED_CERTVAL = 29063,
+  NZERROR_CIC_ERR_PKCS_NEED_PASSWORD = 29064,
+  NZERROR_CIC_ERR_PKCS_NEED_PKC = 29065,
+  NZERROR_CIC_ERR_PKCS_NEED_PRV_KEY = 29066,
+  NZERROR_CIC_ERR_PKCS_NEED_TRUSTED = 29067,
+  NZERROR_CIC_ERR_PKCS_UNSUPPORTED_CERT_FORMAT = 29068,
+  NZERROR_CIC_ERR_PKCS_UNSUP_PRVKEY_TYPE = 29069,
+  NZERROR_CIC_ERR_CODING_BAD_PEM = 29070,
+  NZERROR_CIC_ERR_CODING_BASE = 29071, 
+  NZERROR_CIC_ERR_DER_BAD_ENCODING = 29072,
+  NZERROR_CIC_ERR_DER_BAD_ENCODING_LENGTH = 29073,
+  NZERROR_CIC_ERR_DER_BASE = 29074,
+  NZERROR_CIC_ERR_DER_ELEMENT_TOO_LONG = 29075,
+  NZERROR_CIC_ERR_DER_INDEFINITE_LENGTH = 29076,
+  NZERROR_CIC_ERR_DER_NO_MORE_ELEMENTS = 29077,
+  NZERROR_CIC_ERR_DER_OBJECT_TOO_LONG = 29078,
+  NZERROR_CIC_ERR_DER_TAG_SIZE = 29079,
+  NZERROR_CIC_ERR_DER_TIME_OUT_OF_RANGE = 29080,
+  NZERROR_CIC_ERR_DER_UNUSED_BITS_IN_BIT_STR = 29081,
+  NZERROR_CIC_ERR_GENERAL_BASE = 29082,
+  NZERROR_CIC_ERR_HASH_BASE = 29083,
+  NZERROR_CIC_ERR_ILLEGAL_PARAM = 29084,
+  NZERROR_CIC_ERR_MEM_NOT_OURS = 29085,
+  NZERROR_CIC_ERR_MEM_OVERRUN = 29086,
+  NZERROR_CIC_ERR_MEM_UNDERRUN = 29087,
+  NZERROR_CIC_ERR_MEM_WAS_FREED = 29088,
+  NZERROR_CIC_ERR_NOT_FOUND = 29090,
+  NZERROR_CIC_ERR_NO_PTR = 29091,
+  NZERROR_CIC_ERR_TIMEOUT = 29092,
+  NZERROR_CIC_ERR_UNIT_MASK = 29093,
+  NZERROR_CIC_ERR_BAD_CTX = 29094,
+  NZERROR_CIC_ERR_BAD_INDEX = 29095,
+  NZERROR_CIC_ERR_BAD_LENGTH = 29096,
+  NZERROR_CIC_ERR_CODING_BAD_ENCODING = 29097,
+
+  /* ============>>> PKCS12 error 29100 - 29149  */
+  
+  NZERROR_LOCKEYID_CREATE_FAILED = 29100,
+  NZERROR_P12_ADD_PVTKEY_FAILED = 29101,
+  NZERROR_P12_ADD_CERT_FAILED = 29102,
+  NZERROR_P12_WLT_CREATE_FAILED = 29103,
+  NZERROR_P12_ADD_CERTREQ_FAILED = 29104,
+  NZERROR_P12_WLT_EXP_FAILED = 29105,
+  NZERROR_P12_WLT_IMP_FAILED = 29106,
+  NZERROR_P12_CREATE_FAILED = 29107,
+  NZERROR_P12_DEST_FAILED = 29107,
+  NZERROR_P12_RAND_ERROR = 29108, 
+  NZERROR_P12_PVTKEY_CRT_FAILED = 29109,
+  NZERROR_P12_INVALID_BAG = 29110,
+  NZERROR_P12_INVALID_INDEX = 29111,
+  NZERROR_P12_GET_CERT_FAILED = 29112,
+  NZERROR_P12_GET_PVTKEY_FAILED = 29113,
+  NZERROR_P12_IMP_PVTKEY_FAILED = 29114,
+  NZERROR_P12_EXP_PVTKEY_FAILED = 29115,
+  NZERROR_P12_GET_ATTRIB_FAILED = 29116,
+  NZERROR_P12_ADD_ATTRIB_FAILED = 29117,
+  NZERROR_P12_CRT_ATTRIB_FAILED = 29118,
+  NZERROR_P12_IMP_CERT_FAILED = 29119,
+  NZERROR_P12_EXP_CERT_FAILED = 29120,
+  NZERROR_P12_ADD_SECRET_FAILED = 29121,
+  NZERROR_P12_ADD_PKCS11INFO_FAILED = 29122,
+  NZERROR_P12_GET_PKCS11INFO_FAILED = 29123,
+  NZERROR_P12_MULTIPLE_PKCS11_LIBNAME = 29124,
+  NZERROR_P12_MULTIPLE_PKCS11_TOKENLABEL = 29125,
+  NZERROR_P12_MULTIPLE_PKCS11_TOKENPASSPHRASE = 29126,
+  NZERROR_P12_UNKNOWN_PKCS11INFO = 29127,
+  NZERROR_P12_PKCS11_LIBNAME_NOT_SET = 29128,
+  NZERROR_P12_PKCS11_TOKENLABEL_NOT_SET = 29129,
+  NZERROR_P12_PKCS11_TOKENPASSPHRASE_NOT_SET = 29130,
+
+/* ===========>>> SSL Errors CONTINUED 29135 - 29139 */
+  NZERROR_CIC_ERR_RANDOM = 29135,
+  NZERROR_CIC_ERR_SMALL_BUFFER = 29136,
+  NZERROR_CIC_ERR_SSL_BAD_CONTEXT = 29137,
+
+/* ==========>>> Mutex Errors 29138 - 29139 */
+  NZERROR_MUTEX_INITIALIZE_FAILED = 29138,
+  NZERROR_MUTEX_DESTROY_FAILED = 29139,
+
+
+/* ============>>> EXTENSIONS Errors 29140 - 29149 */
+  NZERROR_BS_CERTOBJ_CREAT_FAILED = 29140,
+  NZERROR_BS_DER_IMP_FAILED = 29141,
+
+
+/* ============>>> FIPS ERRORS 29150 - 29175 */
+  NZERROR_DES_SELF_TEST_FAILED = 29150,
+  NZERROR_3DES_SELF_TEST_FAILED = 29151,
+  NZERROR_SHA_SELF_TEST_FAILED = 29152,
+  NZERROR_RSA_SELF_TEST_FAILED = 29153,
+  NZERROR_DRNG_SELF_TEST_FAILED = 29154,
+  NZERROR_CKEYPAIR_SELF_TEST_FAILED = 29155,
+  NZERROR_CRNG_SELF_TEST_FAILED = 29156,
+  NZERROR_FIPS_PATHNAME_ERROR = 29157,
+  NZERROR_FIPS_LIB_OPEN_FAILED = 29158,
+  NZERROR_FIPS_LIB_READ_ERROR = 29159,
+  NZERROR_FIPS_LIB_DIFFERS = 29160,
+  NZERROR_DAC_SELF_TEST_FAILED = 29161,
+  NZERROR_NONFIPS_CIPHERSUITE = 29162,
+  NZERROR_VENDOR_NOT_SUPPORTED_FIPS_MODE = 29163,
+  NZERROR_EXTERNAL_PKCS12_NOT_SUPPORTED_FIPS_MODE = 29164,
+
+/* ============>>> CRL ERRORS 29176 - 29200 */
+  NZERROR_CRL_SIG_VERIFY_FAILED = 29176, /*CRL signature verification failed*/ 
+  NZERROR_CERT_NOT_IN_CRL = 29177, 
+                                 /*Cert is not in CRL - cert is not revoked*/ 
+  NZERROR_CERT_IN_CRL = 29178,           /*Cert is in CRL - cert is revoked*/ 
+  NZERROR_CERT_IN_CRL_CHECK_FAILED = 29179, /*Cert revocation check failed */ 
+  NZERROR_INVALID_CERT_STATUS_PROTOCOL = 29180, 
+  NZERROR_LDAP_OPEN_FAILED = 29181,  /* ldap_open failed */
+  NZERROR_LDAP_BIND_FAILED = 29182,  /* ldap_bind failed */
+  NZERROR_LDAP_SEARCH_FAILED = 29183,  /* ldap_search failed */
+  NZERROR_LDAP_RESULT_FAILED = 29184,  /* ldap_result failed */
+  NZERROR_LDAP_FIRSTATTR_FAILED = 29185,  /* ldap_first_attribute failed */
+  NZERROR_LDAP_GETVALUESLEN_FAILED = 29186,  /* ldap_get_values_len failed */
+  NZERROR_LDAP_UNSUPPORTED_VALMEC = 29187, 
+                                       /* unsupported validation mechanism */
+  NZERROR_LDAP_COUNT_ENTRIES_FAILED = 29188,/* ldap_count_entries failed */
+  NZERROR_LDAP_NO_ENTRY_FOUND = 29189, /* No entry found in OID */
+  NZERROR_LDAP_MULTIPLE_ENTRIES_FOUND = 29190, /* Multiple entries in OID*/
+  NZERROR_OID_INFO_NOT_SET = 29191, 
+  NZERROR_LDAP_VALMEC_NOT_SET = 29192,  
+                                     /* Validation mechanism not set in OID*/
+  NZERROR_CRLDP_NO_CRL_FOUND = 29193,  
+                                     /* No CRL found using CRLDP mechanism */
+  NZERROR_CRL_NOT_IN_CACHE = 29194,  /* No CRL found in the cache*/
+  NZERROR_CRL_EXPIRED = 29195,       /* CRL nextUpdate time is in the past */
+
+/* ============>>>  ADD ERRORS HERE -- NOTE DECREASING numbers */
+  NZERROR_DN_MATCH  =            29222,  /* for nztCompareDN */
+  NZERROR_CERT_CHAIN_CREATION  = 29223,  /* unable to create a cert chain
+					  * with the existing TPs for the 
+					  * cert to be installed. 
+					  */
+  NZERROR_NO_MATCHING_CERT_REQ = 29224,  /* No matching cert_req was 
+					  * found the corresponding to
+					  * the privatekey which
+					  * matches the cert to be
+					  * installed */
+  NZERROR_CERT_ALREADY_INSTALLED = 29225, /* we are attempting to
+					   * install a cert again into
+					   * a persona which already 
+					   * has it installed.
+					   */
+  NZERROR_NO_MATCHING_PRIVATE_KEY = 29226, /* could not find a matching 
+					    * persona-private(privatekey) in
+					    * the Persona, for the given
+					    * cert(public key). 
+					    */
+  NZERROR_VALIDITY_EXPIRED = 29227, /* certificate validity date expired */
+  NZERROR_TK_BYTES_NEEDED = 29228,   /* Couldn't determine # of bytes needed */
+  NZERROR_TK_BAD_MAGIC_NUMBER = 29229,
+                     /* Magic number found in header does not match expected */
+  NZERROR_TK_BAD_HEADER_LENGTH = 29230,
+                /* Header length passed in not sufficient for message header */
+  NZERROR_TK_CE_INIT = 29231,          /* Crypto engine failed to initialize */
+  NZERROR_TK_CE_KEYINIT = 29232,  /* Crypto engine key initialization failed */
+  NZERROR_TK_CE_ENCODE_KEY = 29233,           /* Count not encode key object */
+  NZERROR_TK_CE_DECODE_KEY = 29234,      /* Could not decode key into object */
+  NZERROR_TK_CE_GEYKEYINFO = 29235,  /* Crypto engine failed to get key info */
+  NZERROR_TK_SEED_RANDOM = 29236,   /* Couldn't seed random number generator */
+  NZERROR_TK_CE_ALGFINISH = 29237,              /* Couldn't finish algorithm */
+  NZERROR_TK_CE_ALGAPPLY = 29238,        /* Couldn't apply algorithm to data */
+  NZERROR_TK_CE_ALGINIT = 29239,           /* Couldn't init CE for algorithm */
+  NZERROR_TK_ALGORITHM = 29240,      /* Have no idea what algorithm you want */
+  NZERROR_TK_CANNOT_GROW = 29241,         /* Cannot grow output buffer block */
+  NZERROR_TK_KEYSIZE = 29242,               /* Key not large enough for data */
+  NZERROR_TK_KEYTYPE = 29243,                           /* Unknown key type. */
+
+  NZERROR_TK_PLSQL_NO_WRL = 29244,
+                 /* Wallet resource locator not specified to PL/SQL function */
+
+  NZERROR_TK_CE_FUNC = 29245,              /* Unknown crypto engine function */
+  NZERROR_TK_TDU_FORMAT = 29246,                       /* Unknown TDU format */
+  NZERROR_TK_NOTOPEN = 29247,                         /* Object must be open */
+  NZERROR_TK_WRLTYPE = 29248,                                /* Bad WRL type */
+  NZERROR_TK_CE_STATE = 29249,  /* Bad state specified for the crypto engine */
+
+  /* After 29249, use error numbers in block 43000 - 43499 */
+  NZERROR_PKCS11_LIBRARY_NOT_FOUND = 43000, /* PKCS #11 library not found */
+  NZERROR_PKCS11_TOKEN_NOT_FOUND = 43001, 
+                                         /* can't find token with given label*/
+  NZERROR_PKCS11_BAD_PASSPHRASE = 43002,  /* passphrase is incorrect/expired */
+  NZERROR_PKCS11_GET_FUNC_LIST = 43003,  /* C_GetFunctionList returned error */
+  NZERROR_PKCS11_INITIALIZE = 43004,     /* C_Initialize returned error */
+  NZERROR_PKCS11_NO_TOKENS_PRESENT = 43005, /* No tokens present */
+  NZERROR_PKCS11_GET_SLOT_LIST = 43006,  /* C_GetSlotList returned error */
+
+  NZERROR_PKCS11_GET_TOKEN_INFO = 43008,  /* C_GetTokenInfo returned error */
+  NZERROR_PKCS11_SYMBOL_NOT_FOUND = 43009, /* Symbol not found in PKCS11 lib */
+
+  NZERROR_PKCS11_TOKEN_LOGIN_FAILED = 43011, /* Token login failed */
+
+  NZERROR_PKCS11_CHANGE_PROVIDERS_ERROR = 43013, /* Change providers error */
+  NZERROR_PKCS11_GET_PRIVATE_KEY_ERROR = 43014, 
+                              /* Error trying to find private key on token */
+  NZERROR_PKCS11_CREATE_KEYPAIR_ERROR = 43015, /* Key pair gen error */
+  NZERROR_PKCS11_WALLET_CONTAINS_P11_INFO = 43016, /* Wallet already contains
+                                                      pkcs11 info */
+
+  /* RSA ERRORS 43050 - 43059 */
+  NZERROR_BIND_SERVICE_ERROR = 43050,    /* C_BindService returned error */
+  NZERROR_CREATE_KEY_OBJ_ERROR = 43051,  /* B_CreateKeyObject returned error */
+  NZERROR_GET_CERT_FIELDS = 43052,       /* C_GetCertFields returned error */
+  NZERROR_CREATE_PKCS10_OBJECT = 43053,  
+                                      /* C_CreatePKCS10Object returned error */
+  NZERROR_SET_PKCS10_FIELDS = 43054,     /* C_SetPKCS10Fields returned error */
+  NZERROR_SIGN_CERT_REQUEST = 43055,     /* C_SignCertRequest returned error */
+  NZERROR_GET_PKCS10_DER = 43056,        /* C_GetPKCS10DER returned error */
+  NZERROR_INITIALIZE_CERTC = 43057,      /* C_InitializeCertC returned error */
+  NZERROR_INSERT_PRIVATE_KEY = 43058,   /* C_InsertPrivateKey returned error */
+  /* slts ERRORS 43060 - 43069 */
+  NZERROR_SLTSCTX_INIT_FAILED = 43060,    /* sltsini() returned error */
+  NZERROR_SLTSKYC_FAILED = 43061,         /* sltskyc() returned error */
+  NZERROR_SLTSCTX_TERM_FAILED = 43062,    /* sltster() returned error */
+  NZERROR_SLTSKYS_FAILED = 43063,         /* sltskys() returned error */
+
+  NZERROR_INVALID_HEADER_LENGTH = 43070,       /* bad sso header length */
+
+  NZERROR_LAST_ERROR = 43499,                        /* Last available error */
+                                            /* MAXIMUM ERROR NUMBER IS 43499 */
+
+  /*
+   * DO NOT JUST INSERT NEW ERRORS IN ANY OLD PLACE.  New errors should be
+   * added such the current error retains their integer values. Duplicate
+   * values will cause compiler errors.
+   */
+  NZERROR_THIS_MUST_BE_LAST
+
+} nzerror;
+
+/*
+ * Macro to convert SSL errors to Oracle errors. As SSL errors are negative
+ * and Oracle numbers are positive, the following needs to be done.
+ * 1. The base error number, which is the highest, is added to the
+ *    SSL error to get the index into the number range.
+ * 2. The result is added to the base Oracle number to get the Oracle error.
+ */
+#define NZERROR_SSL_TO_ORACLE(ssl_error_) \
+  ((ssl_error_ == SSLNoErr) \
+   ? NZERROR_OK \
+   : (nzerror) ((ssl_error_ - SSLMemoryErr) + (uword) NZERROR_SSLMemoryErr))
+#endif /* NZERROR_ORACLE */ 
diff --git a/src/terralib/drivers/Oracle/OCI/include/nzt.h b/src/terralib/drivers/Oracle/OCI/include/nzt.h
new file mode 100644
index 0000000..251d9c7
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/nzt.h
@@ -0,0 +1,2750 @@
+/* DISABLE check_long_lines */
+
+/* Copyright (c) 1996, 2003, Oracle Corporation.  All rights reserved.  */
+/* Copyright (c) 1996, 2003, Oracle Corporation.  All rights reserved.  */
+
+/*
+ * $Header$ 
+ */
+
+/* 
+ * NAME
+ *    nzt.h
+ * 
+ * DESCRIPTION
+ *    Toolkit public declarations.
+ *    
+ * PUBLIC FUNCTIONS
+ *    nztwOpenWallet           - Open a wallet based on a WRL and pwd.
+ *    nztwCloseWallet          - Close a wallet.
+ * +  nztwCreateWallet         - Create a new wallet.
+ * +  nztwDestroyWallet        - Destroy an existing wallet.
+ *    nztwRetrievePersonaCopy  - Retieve a copy of a particular persona.
+ * +  nzteStorePersona         - Store a persona in the wallet.
+ *    nzteOpenPersona          - Open a persona.
+ *    nzteClosePersona         - Close a persona.
+ * +  nzteRemovePersona        - Remove a persona from a wallet.
+ * +  nzteCreatePersona        - Create a persona.
+ *    nzteDestroyPersona       - Destroy a persona.
+ *    nztiStoreTrustedIdentity - Store an identity with associated trust.
+ *    nzteRetrieveTrustedIdentCopy - Retrieves a trusted identity from persona
+ * +  nzteSetProtection        - Modify the protection set in a persona.
+ * +  nzteGetProtection        - Get the protection set in a persona
+ *    nztePriKey               - Get the Private Key (X509 Only)
+ *    nzteMyCert               - Get the Certificate (X509 only)
+ *    nzteX509CreatePersona    - Create a persona given an X509 Certificate.
+ * +  nztiRemoveIdentity       - Remove an identity from a persona.
+ *    nztiCreateIdentity       - Create an identity.
+ *    nztiDuplicateIdentity    - Create a complete copy of an identity.
+ *    nztiAbortIdentity        - Discard an unstored identity.
+ *    nztidGetIdentityDesc     - Gets Identity Description from Identity.
+ *    nztidFreeIdentityDesc    - Frees memory for Identity Desc object.
+ *    nztSign                  - Generate an attached signature.
+ * +  nztxSignExpansion        - Determine size of signature.
+ *    nztVerify                - Verify an attached signature.               
+ *    nztValidate              - Validate an identity.                       
+ *    nztsd_SignDetached       - Generate a detached signature.
+ * +  nztxsd_SignDetachedExpansion - Determine size of detached signature.
+ *    nztved_VerifyDetached    - Verify a detached signature.                 
+ * +  nztEncrypt               - Symmetric key encryption.   
+ * +  nztxEncryptExpansion     - Determine the tdu length for encryption.
+ * +  nztDecrypt               - Symmetric key decryption.                   
+ * +  nztEnvelope              - Sign then encrypt data for recipient(s).    
+ * +  nztDeEnvelope            - Reverse nztEnvelope.                        
+ * +  nztKeyedHash             - Generate keyed hash.                        
+ * +  nztxKeyedHashExpansion   - Determine size of TDU for keyed hash.
+ *    nztHash                  - Generate hash.   
+ * +  nztxHashExpansion        - Determine the size of the TDU for a hash.
+ *    nztSeedRandom            - See the random number generator.
+ *    nztrb_RandomBytes        - Generate a series of random bytes.          
+ *    nztrn_RandomNumber       - Generate a random number.                   
+ *    nztbbInitBlock           - Initialize a buffer block.                  
+ *    nztbbReuseBlock          - Reuse a buffer block.           
+ *    nztbbSizeBlock           - Find the size of the buffer block.
+ *    nztbbGrowBlock           - Grow initialized buffer block by 'inc' bytes.
+ *    nztbbPurgeBlock          - Purge the memory used within a buffer block.
+ *    nztbbSetBlock            - Set block to known state.
+ *    nztkec_PKEncrypt         - Encrypt data then encrypt key for recipient.
+ *    nztkdc_PKDecrypt         - Decrypt PKEncrypt'ed data.                  
+ *    nztific_FreeIdentityContent - Free the contents of an identity.
+ *    nztifdn                  - Create an identity from a distinguished name
+ *    nztcts_CipherSpecToStr   - Converts the Cipher Spec Code To String
+ *    nztiae_IsAuthEnabled     - Checks to see if Authentication is Enabled
+ *                               in the current Cipher Spec.
+ *    nztiae_IsEncrEnabled     - Checks to see if Encryption is Enabled
+ *                               in the current Cipher Spec.
+ *    nztiae_IsHashEnabled     - Checks to see if Hashing is Enabled
+ *                               in the current Cipher Spec.
+ *    nztwGetCertInfo          - Get peer certificate info
+ *
+ * NOTE: the '+' indicates that these functions are UNSUPPORTED at this time.
+ * 
+ * NOTES
+ *    
+ * MODIFIED
+ *    srtata     11/10/03 - fix nztSetAppDefaultLocation header 
+ *    rchahal    10/15/03 - bug 2513821 
+ *    rchahal    11/11/02 - pkcs11 support
+ *    akoyfman   07/05/02 - adding secret store to persona
+ *    supriya    10/11/01 - Fix for bug # 2015732
+ *    ajacobs    04/04/01 - make NZT_REGISTRY_WRL always available
+ *    ajacobs    03/06/01 - olint fix
+ *    ajacobs    03/02/01 - Add GetCertInfo
+ *    supriya    02/23/01 - Move nzttKPUsage from nzt0.h
+ *    rchahal    01/26/01 - olint fixes
+ *    supriya    12/07/00 - Change fn name
+ *    supriya    12/01/00 - Certificate API's needed for iAS
+ *    supriya    06/19/00 - Adding definitions for MCS and ENTR
+ *    lkethana   05/31/00 - multiple cert support
+ *    skanjila   06/25/99 - Remove nztcts_CipherSpecToStr() to NZOS.
+ *    skanjila   06/23/99 - Change API of nztcts_CipherSpecToStr.
+ *    lkethana   06/18/99 - rem nztIPrivateAlloc, etc
+ *    lkethana   06/10/99 - changing size_t to ub4
+ *    lkethana   06/02/99 - add api for getting auth/encry/hash capability of c
+ *    arswamin   12/28/98 - add NZT_MAX_MD5.
+ *    arswamin   12/21/98 - change signature of compareDN
+ *    qdinh      12/21/98 - change size_t to ub4.
+ *    inetwork   11/22/98 - Removing NZDEPRECATED definition
+ *    amthakur   09/14/98 - deprecating and updating the c-structures.
+ *    arswamin   09/24/98 - adding NZTTWRL_NULL for SSO support.
+ *    amthakur   07/30/98 - changing the prototype of nztGetCertChain.
+ *    qdinh      05/01/98 - add NZTTIDENTTYPE_INVALID_TYPE
+ *    qdinh      04/17/98 - add NZTTWRL_ORACLE.
+ *    ascott     10/08/97 - implement nztiStoreTrustedIdentity
+ *    ascott     10/07/97 - add nztiGetIdentityDesc
+ *    ascott     09/28/97 - clarify prototype comments and error codes
+ *    ascott     09/05/97 - update identity: create, destroy, duplicate
+ *    ascott     08/21/97 - add GetCert and GetPriKey
+ *    ascott     08/07/97 - add other WRL settings
+ *    asriniva   03/25/97 - Add ANSI prototypes
+ *    rwessman   03/19/97 - Added prototypes for nztific_FreeIdentityContent()
+ *    asriniva   03/11/97 - Fix olint errors
+ *    sdange     02/28/97 - Removed inclusion of nz0decl.h
+ *    sdange     02/18/97 - Moved nzt specific declarations from nz0decl.h
+ *    asriniva   01/21/97 - Remove prototypes.
+ *    asriniva   10/31/96 - Include oratypes.h
+ *    asriniva   10/15/96 - Declare buffer block helper functions
+ *    asriniva   10/08/96 - First pass at wallet open/close
+ *    asriniva   10/04/96 - Add random number seed function
+ *    asriniva   10/03/96 - Reorder parameters in nztbbSetBlock
+ *    asriniva   10/03/96 - Keep editing.
+ *    asriniva   10/03/96 - Continued edits.
+ *    asriniva   10/02/96 - Continue editing.
+ *    asriniva   09/26/96 -
+ */
+   
+/* ENABLE check_long_lines */
+
+#ifndef NZT_ORACLE
+#define NZT_ORACLE
+
+#ifndef ORATYPES
+# include <oratypes.h>
+#endif /* ORATYPES */
+
+#ifndef NZERROR_ORACLE
+# include <nzerror.h>         /* NZ error type */
+#endif /* NZERROR_ORACLE */
+
+
+#define NZT_MAX_SHA1 20
+#define NZT_MAX_MD5  16
+
+/***************************************/
+/* PUBLIC CONSTANTS, MACROS, AND TYPES */
+/***************************************/
+
+/*
+ * Wallet Resource Locator Type Strings
+ *
+ * WRL TYPE        PARAMETERS      BEHAVIOR
+ * ========        ==========      =====================================
+ * default:          <none>        Uses directory defined by the parameter
+ *                                 SNZD_DEFAULT_FILE_DIRECTORY which in 
+ *                                 unix is "$HOME/oracle/oss"
+ * 
+ * file:            file path      Find the Oracle wallet in this directory.
+ *                                 example: file:<dir-path>
+ * 
+ * sqlnet:           <none>        In this case, the directory path will be 
+ *                                 retrieved from the sqlnet.ora file under
+ *                                 the oss.source.my_wallet parameter.
+ *
+ * mcs:              <none>        Microsoft WRL.
+ *
+ * entr:             dir path      Entrust WRL. eg: ENTR:<dir-path>   
+ * 
+ */
+/* Note that there is no NZT_NULL_WRL.  Instead look in snzd.h for DEFAULT_WRP
+ * which is used in our new defaulting mechanism.  The NZT_DEFAULT_WRL
+ * should be deprecated.
+ */
+#define NZT_DEFAULT_WRL    ((text *)"default:")
+#define NZT_SQLNET_WRL     ((text *)"sqlnet:")
+#define NZT_FILE_WRL       ((text *)"file:")
+#define NZT_ENTR_WRL       ((text *)"entr:")
+#define NZT_MCS_WRL        ((text *)"mcs:")
+#define NZT_ORACLE_WRL	   ((text *)"oracle:")
+#define NZT_REGISTRY_WRL   ((text *)"reg:")
+          
+enum nzttwrl 
+{
+   NZTTWRL_DEFAULT = 1,    /* Default, use SNZD_DEFAULT_FILE_DIRECTORY */
+   NZTTWRL_SQLNET,         /* Use oss.source.my_wallet in sqlnet.ora file */
+   NZTTWRL_FILE,           /* Find the oracle wallet in this directory */
+   NZTTWRL_ENTR,           /* Find the entrust profile in this directory */
+   NZTTWRL_MCS,            /* WRL for Microsoft */
+   NZTTWRL_ORACLE,	   /* Get the wallet from OSS db */
+   NZTTWRL_NULL,           /* New SSO defaulting mechanism */
+   NZTTWRL_REGISTRY        /* Find the wallet in Windows Registry */
+};
+typedef enum nzttwrl nzttwrl;
+
+#ifndef NZ0DECL_ORACLE
+   /*
+    * With the elimination of nz0decl.h from public, we need this
+    * redundant typedef.
+    */
+   typedef struct nzctx nzctx;
+   typedef struct nzstrc nzstrc;
+   typedef struct nzosContext nzosContext;
+#endif /* NZ0DECL_ORACLE */
+
+/* Moved from nz0decl.h */
+
+typedef struct nzttIdentity nzttIdentity;
+typedef struct nzttIdentityPrivate nzttIdentityPrivate;
+typedef struct nzttPersona nzttPersona;
+typedef struct nzttPersonaPrivate nzttPersonaPrivate;
+typedef struct nzttWallet nzttWallet;
+typedef struct nzttWalletPrivate nzttWalletPrivate;
+typedef struct nzttWalletObj nzttWalletObj; /* For wallet object */
+typedef struct nzssEntry nzssEntry; /* For secretstore */
+typedef struct nzpkcs11_Info nzpkcs11_Info;
+
+/*
+ * Crypto Engine State
+ *
+ * Once the crypto engine (CE) has been initialized for a particular
+ * cipher, it is either at the initial state, or it is continuing to
+ * use the cipher.  NZTCES_END is used to change the state back to
+ * initialized and flush any remaining output.  NZTTCES_RESET can be
+ * used to change the state back to initialized and throw away any
+ * remaining output.
+ */
+enum nzttces 
+{
+   NZTTCES_CONTINUE = 1,    /* Continue processing input */
+   NZTTCES_END,             /* End processing input */
+   NZTTCES_RESET            /* Reset processing and skip generating output */
+};
+typedef enum nzttces nzttces;
+
+/*
+ * Crypto Engine Functions
+ *
+ * List of crypto engine categories; used to index into protection
+ * vector.
+ */
+enum nzttcef
+{
+   NZTTCEF_DETACHEDSIGNATURE = 1,   /* Signature, detached from content */
+   NZTTCEF_SIGNATURE,               /* Signature combined with content */
+   NZTTCEF_ENVELOPING,              /* Signature and encryption with content */
+   NZTTCEF_PKENCRYPTION,            /* Encryption for one or more recipients */
+   NZTTCEF_ENCRYPTION,              /* Symmetric encryption */
+   NZTTCEF_KEYEDHASH,               /* Keyed hash/checkusm */
+   NZTTCEF_HASH,                    /* Hash/checsum */
+   NZTTCEF_RANDOM,                  /* Random byte generation */
+
+   NZTTCEF_LAST                     /* Used for array size */
+};
+typedef enum nzttcef nzttcef;
+
+/*
+ * State of the persona.
+ */
+enum nzttState
+{
+   NZTTSTATE_EMPTY = 0,     /* is not in any state(senseless???) */
+   NZTTSTATE_REQUESTED,     /* cert-request */
+   NZTTSTATE_READY,         /* certificate */
+   NZTTSTATE_INVALID,         /* certificate */
+   NZTTSTATE_RENEWAL        /* renewal-requested */
+};
+typedef enum nzttState nzttState;
+
+/*
+ * Cert-version types
+ * 
+ * This is used to quickly look-up the cert-type
+ */
+enum nzttVersion
+{
+   NZTTVERSION_X509v1 = 1,        /* X.509v1 */
+   NZTTVERSION_X509v3,            /* X.509v3 */
+#ifdef NZDEPRECATED
+   NZTTVERSION_SYMMETRIC,         /* Symmetric */
+#endif
+   NZTTVERSION_INVALID_TYPE       /* For Initialization */
+};
+typedef enum nzttVersion nzttVersion;
+
+/*
+ * Cipher Types
+ *
+ * List of all cryptographic algorithms, some of which may not be
+ * available.
+ */
+enum nzttCipherType 
+{
+   NZTTCIPHERTYPE_RSA = 1,          /* RSA public key */
+   NZTTCIPHERTYPE_DES,              /* DES */
+   NZTTCIPHERTYPE_RC4,              /* RC4 */
+   NZTTCIPHERTYPE_MD5DES,           /* DES encrypted MD5 with salt (PBE) */
+   NZTTCIPHERTYPE_MD5RC2,           /* RC2 encrypted MD5 with salt (PBE) */
+   NZTTCIPHERTYPE_MD5,              /* MD5 */
+   NZTTCIPHERTYPE_SHA               /* SHA */
+};
+typedef enum nzttCipherType nzttCipherType;
+
+/*
+ * TDU Formats
+ *
+ * List of possible toolkit data unit (TDU) formats.  Depending on the
+ * function and cipher used some may be not be available.
+ */
+enum nztttdufmt
+{
+   NZTTTDUFMT_PKCS7 = 1,            /* PKCS7 format */
+   NZTTTDUFMT_RSAPAD,               /* RSA padded format */
+   NZTTTDUFMT_ORACLEv1,             /* Oracle v1 format */
+   NZTTTDUFMT_LAST                  /* Used for array size */
+};
+typedef enum nztttdufmt nztttdufmt;
+
+/*
+ * Validate State
+ *
+ * Possible validation states an identity can be in.
+ */
+enum nzttValState
+{
+   NZTTVALSTATE_NONE = 1,        /* Needs to be validated */
+   NZTTVALSTATE_GOOD,            /* Validated */
+   NZTTVALSTATE_REVOKED          /* Failed to validate */
+};
+typedef enum nzttValState nzttValState;
+
+/*
+ * Policy Fields <----NEW (09/14/98)
+ *
+ * Policies enforced
+ */
+enum nzttPolicy
+{
+   NZTTPOLICY_NONE = 0,
+   NZTTPOLICY_RETRY_1, /* number of retries for decryption = 1 */
+   NZTTPOLICY_RETRY_2, /* number of retries for decryption = 2 */
+   NZTTPOLICY_RETRY_3  /* number of retries for decryption = 3 */
+};
+typedef enum nzttPolicy nzttPolicy;
+
+/*
+ * Persona Usage <----NEW (09/14/98)
+ *
+ * what a persona will be used for?
+ */
+
+#ifdef NZDEPRECATED_MULTIPLECERTS
+enum nzttUsage
+{
+   NZTTUSAGE_NONE = 0,
+   NZTTUSAGE_SSL  /* persona for SSL usage */
+};
+typedef enum nzttUsage nzttUsage;
+#endif
+
+/*
+ * Personas and identities have unique id's that are represented with
+ * 128 bits.
+ */
+typedef ub1 nzttID[16];
+
+/*
+ * Identity Types
+ *
+ * List of all Identity types..
+ */
+enum nzttIdentType 
+{
+   NZTTIDENTITYTYPE_INVALID_TYPE = 0,  
+   NZTTIDENTITYTYPE_CERTIFICTAE,      
+   NZTTIDENTITYTYPE_CERT_REQ,      
+   NZTTIDENTITYTYPE_RENEW_CERT_REQ,      
+   NZTTIDENTITYTYPE_CLEAR_ETP,      
+   NZTTIDENTITYTYPE_CLEAR_UTP,      
+   NZTTIDENTITYTYPE_CLEAR_PTP       
+};
+typedef enum nzttIdentType nzttIdentType;
+
+typedef ub4 nzttKPUsage;
+/* IF new types are added nztiMUS should be changed */
+#define NZTTKPUSAGE_NONE 0
+#define NZTTKPUSAGE_SSL 1
+#define NZTTKPUSAGE_SMIME_ENCR 2
+#define NZTTKPUSAGE_SMIME_SIGN 4
+#define NZTTKPUSAGE_CODE_SIGN 8
+#define NZTTKPUSAGE_CERT_SIGN 16
+#define NZTTKPUSAGE_INVALID_USE 0xffff
+
+
+/*
+ * Timestamp as 32 bit quantity in UTC.
+ */
+typedef ub1 nzttTStamp[4];
+
+/*
+ * Buffer Block
+ *
+ * A function that needs to fill (and possibly grow) an output buffer
+ * uses an output parameter block to describe each buffer.
+ *
+ * The flags_nzttBufferBlock member tells the function whether the
+ * buffer can be grown or not.  If flags_nzttBufferBlock is 0, then
+ * the buffer will be realloc'ed automatically.  
+ *
+ * The buflen_nzttBufferBLock member is set to the length of the
+ * buffer before the function is called and will be the length of the
+ * buffer when the function is finished.  If buflen_nzttBufferBlock is
+ * 0, then the initial pointer stored in pobj_nzttBufferBlock is
+ * ignored.
+ *
+ * The objlen_nzttBufferBlock member is set to the length of the
+ * object stored in the buffer when the function is finished.  If the
+ * initial buffer had a non-0 length, then it is possible that the
+ * object length is shorter than the buffer length.
+ *
+ * The pobj_nzttBufferBlock member is a pointer to the output object.
+ */
+struct nzttBufferBlock
+{
+# define NZT_NO_AUTO_REALLOC     0x1
+
+   uword flags_nzttBufferBlock;     /* Flags */
+   ub4 buflen_nzttBufferBlock;   /* Total length of buffer */
+   ub4 usedlen_nzttBufferBlock;  /* Length of used buffer part */
+   ub1 *buffer_nzttBufferBlock;     /* Pointer to buffer */
+};
+typedef struct nzttBufferBlock nzttBufferBlock;
+
+/*
+ * Wallet.
+ */
+struct nzttWallet
+{
+   ub1 *ldapName_nzttWallet;              /* user's LDAP Name */
+   ub4  ldapNamelen_nzttWallet;           /* len of user's LDAP Name */
+   nzttPolicy securePolicy_nzttWallet;    /* secured-policy of the wallet */
+   nzttPolicy openPolicy_nzttWallet;      /* open-policy of the wallet */
+   nzttPersona *persona_nzttWallet;       /* List of personas in wallet */
+   nzttWalletPrivate *private_nzttWallet; /* Private wallet information */
+#ifdef NZDEPRECATED
+   ub4 npersona_nzttWallet;            /* Number of personas */
+#endif
+};
+
+/*
+ * The wallet contains, one or more personas.  A persona always
+ * contains its private key and its identity.  It may also contain
+ * other 3rd party identites.  All identities qualified with trust
+ * where the qualifier can indicate anything from untrusted to trusted
+ * for specific operations.
+ */
+
+/*
+ * Persona
+ *
+ * Structure containing information about a persona.
+ */
+struct nzttPersona
+{
+   ub1 *genericName_nzttPersona;              /* user-friendly persona name  */
+   ub4  genericNamelen_nzttPersona;           /* persona-name length */
+   nzttPersonaPrivate *private_nzttPersona;   /* Opaque part of persona */
+   nzttIdentity *mycertreqs_nzttPersona;      /* My cert-requests */
+   nzttIdentity *mycerts_nzttPersona;         /* My certificates */
+   nzttIdentity *mytps_nzttPersona;           /* List of trusted identities */
+   nzssEntry *mystore_nzttPersona;            /* List of secrets */
+   nzpkcs11_Info *mypkcs11Info_nzttPersona;   /* PKCS11 token info */
+   struct nzttPersona *next_nzttPersona;      /* Next persona */
+#ifdef NZDEPRECATED_MULTIPLECERTS
+  /* As Persona has multiple certs for different
+     usages, Persona Usage does not mean anything. Similarly
+     each key pair has its own state and Persona state itself
+     does not mean anything. - lk 5/31/00
+  */
+   nzttUsage usage_nzttPersona;               /* persona usage; SSL/SET/.. */
+   nzttState state_nzttPersona;               /* persona state-requested/ready */
+   ub4 ntps_nzttPersona;                   /* Num of trusted identities */
+#endif
+};
+
+/*
+ * Identity
+ *
+ * Structure containing information about an identity.
+ *
+ * NOTE
+ *  -- the next_trustpoint field only applies to trusted identities and
+ *     has no meaning (i.e. is NULL) for self identities.
+ */
+struct nzttIdentity
+{
+   text *dn_nzttIdentity;                      /* Alias */
+   ub4 dnlen_nzttIdentity;                  /* Length of alias */
+   text *comment_nzttIdentity;                 /* Comment  */
+   ub4 commentlen_nzttIdentity;             /* Length of comment */
+   nzttIdentityPrivate *private_nzttIdentity;  /* Opaque part of identity */
+   nzttIdentity *next_nzttIdentity;            /* next identity in list */
+};
+
+struct nzttB64Cert
+{
+   ub1 *b64Cert_nzttB64Cert;
+   ub4  b64Certlen_nzttB64Cert;
+   struct nzttB64Cert *next_nzttB64Cert;
+};
+typedef struct nzttB64Cert nzttB64Cert;
+
+
+struct nzttPKCS7ProtInfo
+{
+   nzttCipherType mictype_nzttPKCS7ProtInfo;    /* Hash cipher */
+   nzttCipherType symmtype_nzttPKCS7ProtInfo;   /* Symmetric cipher */
+   ub4 keylen_nzttPKCS7ProtInfo;             /* Length of key to use */
+};
+typedef struct nzttPKCS7ProtInfo nzttPKCS7ProtInfo;
+
+/*
+ * Protection Information.
+ *
+ * Information specific to a type of protection.
+ */
+union nzttProtInfo
+{
+   nzttPKCS7ProtInfo pkcs7_nzttProtInfo;
+};
+typedef union nzttProtInfo nzttProtInfo;
+
+/*
+ * A description of a persona so that the toolkit can create one.  A
+ * persona can be symmetric or asymmetric and both contain an
+ * identity.  The identity for an asymmetric persona will be the
+ * certificate and the identity for the symmetric persona will be
+ * descriptive information about the persona.  In either case, an
+ * identity will have been created before the persona is created.
+ *
+ * A persona can be stored separately from the wallet that references
+ * it.  By default, a persona is stored with the wallet (it inherits
+ * with WRL used to open the wallet).  If a WRL is specified, then it
+ * is used to store the actuall persona and the wallet will have a
+ * reference to it.
+ */
+struct nzttPersonaDesc
+{
+   ub4 privlen_nzttPersonaDesc;        /* Length of private info (key)*/
+   ub1 *priv_nzttPersonaDesc;             /* Private information */
+   ub4 prllen_nzttPersonaDesc;         /* Length of PRL */
+   text *prl_nzttPersonaDesc;             /* PRL for storage */
+   ub4 aliaslen_nzttPersonaDesc;       /* Length of alias */
+   text *alias_nzttPersonaDesc;           /* Alias */
+   ub4 longlen_nzttPersonaDesc;        /* Length of longer description*/
+   text *long_nzttPersonaDesc;            /* Longer persona description */
+};
+typedef struct nzttPersonaDesc nzttPersonaDesc;
+
+/*
+ * A description of an identity so that the toolkit can create one.
+ * Since an identity can be symmetric or asymmetric, the asymmetric
+ * identity information will not be used when a symmetric identity is
+ * created.  This means the publen_nzttIdentityDesc and
+ * pub_nzttIdentityDesc members will not be used when creating a
+ * symmetric identity.
+ */
+struct nzttIdentityDesc
+{
+   ub4 publen_nzttIdentityDesc;        /* Length of identity */
+   ub1 *pub_nzttIdentityDesc;             /* Type specific identity */
+   ub4 dnlen_nzttIdentityDesc;         /* Length of alias */
+   text *dn_nzttIdentityDesc;             /* Alias */
+   ub4 longlen_nzttIdentityDesc;       /* Length of longer description */
+   text *long_nzttIdentityDesc;           /* Longer description */
+   ub4 quallen_nzttIdentityDesc;       /* Length of trust qualifier */
+   text *trustqual_nzttIdentityDesc;      /* Trust qualifier */
+};
+typedef struct nzttIdentityDesc nzttIdentityDesc;
+
+/********************************/
+/* PUBLIC FUNCTION DECLARATIONS */
+/********************************/
+
+/*---------------------- nztwOpenWallet ----------------------*/
+
+/*
+ * NAME
+ *    nztwOpenWallet - Open a wallet based on a wallet Resource Locator (WRL).
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context. 
+ *    wrllen   {IN}     Length of WRL.
+ *    wrl      {IN}     WRL.
+ *    pwdlen   {IN}     Length of password.
+ *    pwd      {IN}     Password.
+ *    wallet   {IN/OUT} Initialized wallet structure.   
+ * 
+ * NOTES
+ *    The syntax for a WRL is <Wallet Type>:<Wallet Type Parameters>.
+ *
+ *    Wallet Type       Wallet Type Parameters.
+ *    -----------       ----------------------
+ *    File              Pathname (e.g. "file:/home/asriniva")
+ *    Oracle            Connect string (e.g. "oracle:scott/tiger at oss")
+ *
+ *    There are also defaults.  If the WRL is NZT_DEFAULT_WRL, then
+ *    the platform specific WRL default is used.  If only the wallet
+ *    type is specified, then the WRL type specific default is used
+ *    (e.g. "oracle:")
+ *
+ *    There is an implication with Oracle that should be stated: An
+ *    Oracle based wallet can be implemented in a user's private space
+ *    or in world readable space.
+ *
+ *    When the wallet is opened, the password is verified by hashing
+ *    it and comparing against the password hash stored with the
+ *    wallet.  The list of personas (and their associated identities)
+ *    is built and stored into the wallet structure.
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_RIO_OPEN     RIO could not open wallet (see network trace file).
+ *    NZERROR_TK_PASSWORD  Password verification failed.
+ *    NZERROR_TK_WRLTYPE   WRL type is not known.
+ *    NZERROR_TK_WRLPARM   WRL parm does not match type.
+ */
+#ifdef __STDC__
+nzerror nztwOpenWallet(nzctx *, ub4, text *, ub4, text *, 
+                           nzttWallet *);
+#else
+nzerror nztwOpenWallet(/*_ nzctx *, ub4, text *, ub4, text *, 
+                           nzttWallet * _*/);
+#endif /* __STDC __*/
+
+
+/*---------------------- nztwCloseWallet ----------------------*/
+
+/*
+ * NAME
+ *    nztwCloseWallet - Close a wallet
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    wallet   {IN/OUT} Wallet.
+ * 
+ * NOTES
+ *    Closing a wallet also closes all personas associated with that
+ *    wallet.  It does not cause a persona to automatically be saved
+ *    if it has changed.  The implication is that a persona can be
+ *    modified by an application but if it is not explicitly saved it
+ *    reverts back to what was in the wallet.
+ *
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_RIO_CLOSE    RIO could not close wallet (see network trace file).
+ */
+#ifdef __STDC__
+nzerror nztwCloseWallet(nzctx *, nzttWallet *);
+#else
+nzerror nztwCloseWallet(/*_ nzctx *, nzttWallet * _*/);
+#endif /* __STDC__ */
+
+/*--------------------nztwGetCertInfo----------------------------*/
+/****NOTE: This function is a temporary hack.****/
+/****DO NOT CALL.  It will soon disappear.****/
+nzerror nztwGetCertInfo(/*_ nzctx *nz_context,
+                            nzosContext *nzosCtx,
+                            nzttWallet *walletRef,
+                            void *peerCert _*/);
+
+
+/*------------------------ nztwConstructWallet -----------------------*/
+/*
+ * 
+ * nzerror nztwConstructWallet( nzctx *oss_context, 	
+ *				  nzttPolicy openPolicy,
+ *				  nzttPolicy securePolicy,
+ *				  ub1 *ldapName,
+ *				  ub4 ldapNamelen,
+ *				  nzstrc *wrl,
+ *				  nzttPersona *personas,
+ *				  nzttWallet **wallet );
+ */
+
+/*---------------------- nztwRetrievePersonaCopy ----------------------*/
+
+/*
+ * NAME
+ *    nztwRetrievePersonaCopy - Retrieves a persona based from wallet
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context. 
+ *    wallet   {IN}     Wallet.
+ *    index    {IN}     Which wallet index to remove (first persona is zero).
+ *    persona  {OUT}    Persona found.
+ * 
+ * NOTES
+ *    Retrieves a persona from the wallet based on the index number passed
+ *    in.  This persona is a COPY of the one stored in the wallet, therefore
+ *    it is perfectly fine for the wallet to be closed after this call is 
+ *    made.
+ *
+ *    The caller is responsible for disposing of the persona when completed.
+ *
+ * RETURNS
+ *    NZERROR_OK           Success.
+ */
+#ifdef __STDC__
+nzerror nztwRetrievePersonaCopy(nzctx *, nzttWallet *, ub4, nzttPersona **);
+#else
+nzerror nztwRetrievePersonaCopy(/*_ nzctx *, nzttWallet *, ub4, 
+                           nzttPersona ** _*/);
+#endif /* __STDC __*/
+
+
+/*---------------------- nztwRetrievePersonaCopyByName ----------------------*/
+
+/*
+ * NAME
+ *    nztwRetrievePersonaCopyByName - Retrieves a persona based on its name.
+ *
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    wallet   {IN}     Wallet.
+ *    name    {IN}     Name of the persona 
+ *    persona  {OUT}    Persona found.
+ *
+ * NOTES
+ *    Retrieves a persona from the wallet based on the name of the persona. 
+ *    This persona is a COPY of the one stored in the wallet, therefore
+ *    it is perfectly fine for the wallet to be closed after this call is
+ *    made.
+ *
+ *    The caller is responsible for disposing of the persona when completed.
+ *
+ * RETURNS
+ *    NZERROR_OK           Success.
+ */
+#ifdef __STDC__
+nzerror nztwRetrievePersonaCopyByName(nzctx *, nzttWallet *, 
+                                      char *, nzttPersona **);
+#else
+nzerror nztwRetrievePersonaCopyByName(/*_ nzctx *, nzttWallet *, char *,
+                           nzttPersona ** _*/);
+#endif /* __STDC __*/
+
+/*---------------------- nzteOpenPersona ----------------------*/
+
+/*
+ * NAME
+ *    nzteOpenPersona - Open a persona.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context. 
+ *    persona  {IN/OUT} Persona.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_PASSWORD  Password failed to decrypt persona.
+ *    NZERROR_TK_BADPRL    Persona resource locator did not work.
+ *    NZERROR_RIO_OPEN     Could not open persona (see network trace file).
+ */
+#ifdef __STDC__
+nzerror nzteOpenPersona(nzctx *, nzttPersona *);
+#else
+nzerror nzteOpenPersona(/*_ nzctx *, nzttPersona * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nzteClosePersona ---------------------*/
+
+/*
+ * NAME
+ *    nzteClosePersona - Close a persona.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN/OUT} Persona.
+ * 
+ * NOTES
+ *    Closing a persona does not store the persona, it simply releases
+ *    the memory associated with the crypto engine.
+ *    
+ * RETURNS
+ *    NZERROR_OK        Success.
+ */
+#ifdef __STDC__
+nzerror nzteClosePersona(nzctx *, nzttPersona *);
+#else
+nzerror nzteClosePersona(/*_ nzctx *, nzttPersona * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nzteDestroyPersona ---------------------*/
+
+/*
+ * NAME
+ *    nzteDestroyPersona - Destroy a persona.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}        OSS context.
+ *    persona  {IN/OUT}    Persona.
+ * 
+ * NOTES
+ *    The persona is destroyd in the open state, but it will
+ *    not be associated with a wallet.
+ *    
+ *    The persona parameter is doubly indirect so that at the
+ *    conclusion of the function, the pointer can be set to NULL.
+ *
+ *
+ * RETURNS
+ *    NZERROR_OK        Success.
+ *    NZERROR_TK_TYPE   Unsupported itype/ctype combination.
+ *    NZERROR_TK_PARMS  Error in persona description.
+ */
+#ifdef __STDC__
+nzerror nzteDestroyPersona(nzctx *,  nzttPersona **);
+#else
+nzerror nzteDestroyPersona(/*_ nzctx *, nzttPersona ** _*/);
+#endif /* __STDC __*/
+
+/*---------------------- nzteRetrieveTrustedIdentCopy ----------------------*/
+
+/*
+ * NAME
+ *    nzteRetrieveTrustedIdentCopy - Retrieves a trusted identity from persona
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context. 
+ *    persona  {IN}     Persona.
+ *    index    {IN}     Which wallet index to remove (first element is zero).
+ *    identity {OUT}    Trusted Identity from this persona.
+ * 
+ * NOTES
+ *    Retrieves a trusted identity from the persona based on the index 
+ *    number passed in.  This identity is a COPY of the one stored in 
+ *    the persona, therefore it is perfectly fine to close the persona
+ *    after this call is made.
+ *
+ *    The caller is responsible for freeing the memory of this object 
+ *    by calling nztiAbortIdentity it is no longer needed
+ *
+ * RETURNS
+ *    NZERROR_OK           Success.
+ */
+#ifdef __STDC__
+nzerror nzteRetrieveTrustedIdentCopy(nzctx *, nzttPersona *, ub4, 
+				     nzttIdentity **);
+#else
+nzerror nzteRetrieveTrustedIdentCopy(/*_ nzctx *, nzttPersona *, ub4, 
+                           nzttIdentity ** _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nztePriKey ---------------------*/
+
+/*
+ * NAME
+ *    nztePriKey - Get the decrypted Private Key for the Persona
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    vkey     {OUT}    Private Key [B_KEY_OBJ]
+ *    vkey_len {OUT}    Private Key Length
+ * 
+ * NOTES
+ *    This funiction will only work for X.509 based persona which contain
+ *    a private key.  
+ *    A copy of the private key is returned to the caller so that they do not 
+ *    have to worry about the key changeing "underneath them".
+ *    Memory will be allocated for the vkey and therefore, the CALLER
+ *    will be responsible for freeing this memory.
+ *
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_NO_MEMORY    ossctx is null.
+ *    NZERROR_TK_BADPRL    Persona resource locator did not work.
+ */
+#ifdef __STDC__
+nzerror nztePriKey(nzctx *, nzttPersona *, ub1 **, ub4 *);
+#else
+nzerror nztePriKey(/*_ nzctx *, nzttPersona *, ub1 **, ub4 * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nzteMyCert ---------------------*/
+
+/*
+ * NAME
+ *    nzteMyCert - Get the X.509 Certificate for a persona
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    cert     {OUT}    X.509 Certificate [BER encoded]
+ *    cert_len {OUT}    Certificate length
+ * 
+ * NOTES
+ *    This funiction will only work for X.509 based persona which contain
+ *    a certificate for the self identity. 
+ *    A copy of the certificate is returned to the caller so that they do not 
+ *    have to worry about the certificate changeing "underneath them".
+ *    Memory will be allocated for the cert and therefore, the CALLER
+ *    will be responsible for freeing this memory.
+ *
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_NO_MEMORY    ossctx is null.
+ */
+#ifdef __STDC__
+nzerror nzteMyCert(nzctx *, nzttPersona *, ub1 **, ub4 *);
+#else
+nzerror nzteMyCert(/*_ nzctx *, nzttPersona *, ub1 **, ub4 * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nzteX509CreatePersona ---------------------*/
+
+/*
+ * NAME
+ *    nzteX509CreatePersona - Given a BER X.509 cert, create a persona
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    cert     {IN}     X.509 Certificate [BER encoded]
+ *    cert_len {IN}     Certificate length
+ *    persona  {OUT}    Persona.
+ * 
+ * NOTES
+ *    Memory will be allocated for the persona and therefore, the CALLER
+ *    will be responsible for freeing this memory.
+ *
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_NO_MEMORY    ossctx is null.
+ */
+#ifdef __STDC__
+nzerror nzteX509CreatePersona(nzctx *, ub1 *, ub4, nzttPersona **);
+#else
+nzerror nzteX509CreatePersona(/*_ nzctx *, ub1 *, ub4, nzttPersona ** _*/);
+#endif /* __STDC __*/
+
+/*-------------------- nztiCreateIdentity --------------------*/
+
+/*
+ * NAME
+ *    nztiCreateIdentity - Create an identity.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    itype    {IN}     Identity type.
+ *    desc     {IN}     Description of identity.
+ *    identity {IN/OUT} Identity.
+ * 
+ * NOTES
+ *    Memory is only allocated for the identity structure.  The elements in
+ *    the description struct are not copied.  Rather their pointers are copied
+ *    into the identity structure.  Therefore, the caller should not free
+ *    the elements referenced by the desc.  These elements will be freed
+ *    when the nztiDestroyIdentity is called.
+ *    
+ * RETURNS
+ *    NZERROR_OK        Success.
+ *    NZERROR_PARMS     Error in description.
+ */
+#ifdef __STDC__
+nzerror nztiCreateIdentity(nzctx *, nzttVersion, nzttIdentityDesc *,
+                               nzttIdentity **);
+#else
+nzerror nztiCreateIdentity(/*_ nzctx *, nzttVersion, nzttIdentityDesc *,
+                               nzttIdentity ** _*/);
+#endif /* __STDC __*/
+
+#ifdef NZ_OLD_TOOLS
+/*-------------------- nztiDuplicateIdentity --------------------*/
+
+/*
+ * NAME
+ *    nztiDuplicateIdentity - Duplicate an identity.
+ * 
+ * PARAMETERS
+ *    osscntxt     {IN}     OSS context.
+ *    identity     {IN}     Target Identity.
+ *    new_identity {IN}     New Identity.
+ * 
+ * NOTES
+ *    Memory for the identity is allocated inside the function, and all
+ *    internal identity elements as well.
+ *    
+ * RETURNS
+ *    NZERROR_OK        Success.
+ *    NZERROR_TK_NOTFOUND  Identity not found.
+ *    NZERROR_PARMS     Error in description.
+ */
+#ifdef __STDC__
+nzerror nztiDuplicateIdentity(nzctx *, nzttIdentity *, 
+                              nzttIdentity **);
+#else
+nzerror nztiDuplicateIdentity(/*_ nzctx *, nzttIdentity *, 
+                              nzttIdentity ** _*/);
+#endif /* __STDC __*/
+#endif /* NZ_OLD_TOOLS */
+
+/*--------------------- nztiAbortIdentity ---------------------*/
+
+/*
+ * NAME
+ *    nztiAbortIdentity - Abort an unassociated identity.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    identity {IN/OUT} Identity.
+ * 
+ * NOTES
+ *    It is an error to try to abort an identity that can be
+ *    referenced through a persona.
+ *    
+ *    The identity pointer is set to NULL at the conclusion.
+ * 
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_CANTABORT    Identity is associated with persona.
+ */
+#ifdef __STDC__
+nzerror nztiAbortIdentity(nzctx *, nzttIdentity **);
+#else
+nzerror nztiAbortIdentity(/*_ nzctx *, nzttIdentity ** _*/);
+#endif /* __STDC __*/
+
+#ifdef NZ_OLD_TOOLS
+/*----------------- nztidGetIdentityDesc -----------------*/
+
+/*
+ * NAME
+ *    nztidGetIdentityDesc - Gets an Identity Description from the identity
+ * 
+ * PARAMETERS
+ *    osscntxt    {IN}     Success.
+ *    identity    {IN}     Identity.
+ *    description {IN/OUT} Identity Description.
+ * 
+ * NOTES
+ *    Memory is allocated for the Identity Description. It
+ *    is the callers responsibility to free this memory by calling 
+ *    nztiFreeIdentityDesc.
+ *
+ * RETURNS
+ *    NZERROR_OK     Success.
+ */
+#ifdef __STDC__
+nzerror nztidGetIdentityDesc(nzctx *, nzttIdentity *, 
+                             nzttIdentityDesc **);
+#else
+nzerror nztidGetIdentityDesc(/*_ nzctx *, nzttIdentity *,
+                                     nzttIdentityDesc ** _*/);
+#endif /* __STDC __*/
+
+/*----------------- nztidFreeIdentityDesc -----------------*/
+
+/*
+ * NAME
+ *    nztidFreeIdentityDesc - Frees memory for Identity Desc object.
+ * 
+ * PARAMETERS
+ *    osscntxt    {IN}     oss context.
+ *    description {IN/OUT} Identity Description.
+ * 
+ * NOTES
+ *    Memory is freed for all Identity description elements.  Pointer is 
+ *    then set to null.
+ *
+ * RETURNS
+ *    NZERROR_OK     Success.
+ */
+#ifdef __STDC__
+nzerror nztidFreeIdentityDesc(nzctx *, nzttIdentityDesc **);
+#else
+nzerror nztidFreeIdentityDesc(/*_ nzctx *, nzttIdentityDesc ** _*/);
+#endif /* __STDC __*/
+#endif /* NZ_OLD_TOOLS */
+
+/*---------------- nztific_FreeIdentityContent ----------------*/
+
+/*
+ * NAME
+ *     nztific_FreeIdentityContent - free the contents of an identity.
+ * 
+ * PARAMETERS
+ *    osscntxt         {IN}     OSS context.
+ *    identity         {IN/OUT} freed identity
+ * 
+ * NOTES
+ *    Free a created identity.
+ *
+ * RETURNS
+ *    NZERROR_OK     Success.
+ */
+/*
+ * Free the identity content.
+ */
+#ifdef __STDC__
+nzerror nztific_FreeIdentityContent(nzctx *ossctx,
+                                        nzttIdentity *identity);
+#else
+nzerror nztific_FreeIdentityContent(/*_ nzctx *ossctx,
+                                        nzttIdentity *identity _*/);
+#endif /* __STDC __*/
+
+
+/*-------------------------- nztSign --------------------------*/
+
+/*
+ * NAME
+ *    nztSign - Create an attached signature.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Open persona acting as signer.
+ *    state    {IN}     State of signature.
+ *    inlen    {IN}     Length of this input part.
+ *    in       {IN}     This input part.
+ *    tdubuf   {IN/OUT} TDU buffer.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztSign(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                    nzttBufferBlock *);
+#else
+nzerror nztSign(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                    nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*------------------------- nztVerify -------------------------*/
+
+/*
+ * NAME
+ *    nztVerify - Verify an attached signature.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    state    {IN}     State of verification.
+ *    intdulen {IN}     TDU length.
+ *    intdu    {IN}     TDU.
+ *    out      {IN/OUT} Extracted message.
+ *    verified {OUT}    TRUE if signature verified.
+ *    validated{OUT}    TRUE if signing identity validated.
+ *    identity {OUT} Identity of signing party.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow outptu buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztVerify(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                      nzttBufferBlock *, boolean *, boolean *,
+                      nzttIdentity **);
+#else
+nzerror nztVerify(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                      nzttBufferBlock *, boolean *, boolean *,
+                      nzttIdentity ** _*/);
+#endif /* __STDC __*/
+
+/*------------------------ nztValidate ------------------------*/
+
+/*
+ * NAME
+ *    nztValidate - Validate an identity.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}  OSS context.
+ *    persona  {IN}  Persona.
+ *    identity {IN}  Identity.
+ *    validated{OUT} TRUE if identity was validated.  
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztValidate(nzctx *, nzttPersona *, nzttIdentity *, boolean *);
+#else
+nzerror nztValidate(/*_ nzctx *, nzttPersona *, nzttIdentity *, boolean * _*/);
+#endif /* __STDC __*/
+
+/*-------------------- nztsd_SignDetached --------------------*/
+
+/*
+ * NAME
+ *    nztsd_SignDetached - Generate a detached signature.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    state    {IN}     State of signature.
+ *    inlen    {IN}     Length of this input part.
+ *    in       {IN}     This input part.
+ *    tdubuf   {IN/OUT} TDU buffer.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztsd_SignDetached(nzctx *, nzttPersona *, nzttces, ub4, ub1 *, 
+                               nzttBufferBlock *);
+#else
+nzerror nztsd_SignDetached(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *, 
+                               nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*------------------- nztved_VerifyDetached -------------------*/
+
+/*
+ * NAME
+ *    nztved_VerifyDetached - Verify a detached signature.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    state    {IN}     State of verification.
+ *    inlen    {IN}     Length of data.
+ *    in       {IN}     Data.
+ *    intdulen {IN}     Input TDU length.
+ *    tdu      {IN}     Input TDU.
+ *    verified {OUT}    TRUE if signature verified.
+ *    validated{OUT}    TRUE if signing identity validated.
+ *    identity {OUT} Identity of signing party.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztved_VerifyDetached(nzctx *, nzttPersona *, nzttces, ub4, 
+                                  ub1 *, ub4, ub1 *, boolean *, boolean *, 
+                                  nzttIdentity **);
+#else
+nzerror nztved_VerifyDetached(/*_ nzctx *, nzttPersona *, nzttces, ub4, 
+                                  ub1 *, ub4, ub1 *, boolean *, boolean *, 
+                                  nzttIdentity ** _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nztkec_PKEncrypt ---------------------*/
+
+/*
+ * NAME
+ *    nztkec_PKEncrypt - Encrypt data symmetrically, encrypt key asymmetrically
+ * 
+ * PARAMETERS
+ *    osscntxt    {IN}     OSS context.
+ *    persona     {IN}     Persona.
+ *    nrecipients {IN}     Number of recipients for this encryption.
+ *    recipients  {IN}     List of recipients.
+ *    state       {IN}     State of encryption.
+ *    inlen       {IN}     Length of this input part.
+ *    in          {IN}     This input part.
+ *    tdubuf      {IN/OUT} TDU buffer.
+ * 
+ * NOTES
+ *    There is a limitation of 1 recipient (nrecipients = 1) at this
+ *    time.
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztkec_PKEncrypt(nzctx *, nzttPersona *, ub4, nzttIdentity *, 
+                             nzttces, ub4, ub1 *, nzttBufferBlock *);
+#else
+nzerror nztkec_PKEncrypt(/*_ nzctx *, nzttPersona *, ub4, nzttIdentity *, 
+                             nzttces, ub4, ub1 *, nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*---------------- nztxkec_PKEncryptExpansion ----------------*/
+
+/*
+ * NAME
+ *    nztxkec_PKEncryptExpansion - Determine the buffer needed for PKEncrypt
+ * 
+ * PARAMETERS
+ *    osscntxt    {IN}     OSS context. 
+ *    persona     {IN}     Persona.
+ *    nrecipients {IN}     Number of recipients.
+ *    inlen       {IN}     Length of input.
+ *    tdulen      {out}    Length of buffer need.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztxkec_PKEncryptExpansion(nzctx *, nzttPersona *, ub4, ub4,
+                                       ub4 *);
+#else
+nzerror nztxkec_PKEncryptExpansion(/*_ nzctx *, nzttPersona *, ub4, ub4,
+                                       ub4 * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nztkdc_PKDecrypt ---------------------*/
+
+/*
+ * NAME
+ *    nztkdc_PKDecrypt - Decrypt a PKEncrypted message.
+ * 
+ * PARAMETERS
+ *    osscntxt    {IN}     OSS context.
+ *    persona     {IN}     Persona.
+ *    state       {IN}     State of encryption.
+ *    inlen       {IN}     Length of this input part.
+ *    in          {IN}     This input part.
+ *    tdubuf      {IN/OUT} TDU buffer.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztkdc_PKDecrypt(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                             nzttBufferBlock *);
+#else
+nzerror nztkdc_PKDecrypt(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                             nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*-------------------------- nztHash --------------------------*/
+
+/*
+ * NAME
+ *    nztHash - Generate a hash.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    state    {IN}     State of hash.
+ *    inlen    {IN}     Length of this input.
+ *    in       {IN}     This input.
+ *    tdu      {IN/OUT} Output tdu.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztHash(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                    nzttBufferBlock *);
+#else
+nzerror nztHash(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                    nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*----------------------- nztSeedRandom -----------------------*/
+
+/*
+ * NAME
+ *    nztSeedRandom - Seed the random function
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}  OSS context.
+ *    persona  {IN}  Persona.
+ *    seedlen  {IN}  Length of seed.
+ *    seed     {IN}  Seed.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztSeedRandom(nzctx *, nzttPersona *, ub4, ub1 *);
+#else
+nzerror nztSeedRandom(/*_ nzctx *, nzttPersona *, ub4, ub1 * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nztrb_RandomBytes ---------------------*/
+
+/*
+ * NAME
+ *    nztrb_RandomBytes - Generate a buffer random bytes.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    nbytes   {IN}     Number of bytes desired.
+ *    out      {IN/OUT} Buffer block for bytes.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztrb_RandomBytes(nzctx *, nzttPersona *, ub4, 
+                              nzttBufferBlock *);
+#else
+nzerror nztrb_RandomBytes(/*_ nzctx *, nzttPersona *, ub4, 
+                              nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*-------------------- nztrn_RandomNumber --------------------*/
+
+/*
+ * NAME
+ *    nztrn_RandomNumber - Generate a random number
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    num      {OUT}    Number.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztrn_RandomNumber(nzctx *, nzttPersona *, uword *);
+#else
+nzerror nztrn_RandomNumber(/*_ nzctx *, nzttPersona *, uword * _*/);
+#endif /* __STDC __*/
+
+/*---------------------- nztbbInitBlock ----------------------*/
+
+/*
+ * NAME
+ *    nztbbInitBlock - Initialize a buffer block.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    block    {IN/OUT} Buffer block.
+ * 
+ * NOTES
+ *    The buffer block is initialized to be empty (all members are set
+ *    to 0/NULL).  Such a block will be allocated memory as needed.
+ *    
+ * RETURNS
+ *    NZERROR_OK        Success.
+ */
+#ifdef __STDC__
+nzerror nztbbInitBlock(nzctx *, nzttBufferBlock *);
+#else
+nzerror nztbbInitBlock(/*_ nzctx *, nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*---------------------- nztbbReuseBlock ----------------------*/
+
+/*
+ * NAME
+ *    nztbbReuseBlock - Reuse an already initialized and possibly used block.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    block    {IN/OUT} Buffer block.
+ * 
+ * NOTES
+ *    This function simply sets the used length member of the buffer
+ *    block to 0.  If the block already has memory allocated to it,
+ *    this will cause it to be reused.
+ *    
+ * RETURNS
+ *    NZERROR_OK        Success.
+ */
+#ifdef __STDC__
+nzerror nztbbReuseBlock(nzctx *, nzttBufferBlock *);
+#else
+nzerror nztbbReuseBlock(/*_ nzctx *, nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*---------------------- nztbbSizeBlock ----------------------*/
+
+/*
+ * NAME
+ *    nztbbSizeBlock - Size an initialized block to a particular size.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    len      {IN}     Minimum number of unused bytes desired.
+ *    block    {IN/OUT} Buffer block.
+ *
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK        Success.
+ */
+#ifdef __STDC__
+nzerror nztbbSizeBlock(nzctx *, ub4, nzttBufferBlock *);
+#else
+nzerror nztbbSizeBlock(/*_ nzctx *, ub4, nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*----------------------- nztbbGrowBlock -----------------------*/
+
+/*
+ * NAME
+ *    nzbbGrowBlock - Increase the size of the buffer block.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    inc      {IN}     Number of bytes to increase.
+ *    block    {IN/OUT} Buffer block.
+ *
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK        Success.
+ */
+#ifdef __STDC__
+nzerror nztbbGrowBlock(nzctx *, ub4, nzttBufferBlock *);
+#else
+nzerror nztbbGrowBlock(/*_ nzctx *, ub4, nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*---------------------- nztbbPurgeBlock ----------------------*/
+
+/*
+ * NAME
+ *    nztbbPurgeBlock - Purge a buffer block of its memory.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    block    {IN/OUT} Buffer block.
+ * 
+ * NOTES
+ *    The memory used by the buffer block as the buffer is released.
+ *    The buffer block itself is not affected.
+ *    
+ * RETURNS
+ *    NZERROR_OK        Success.
+ */
+#ifdef __STDC__
+nzerror nztbbPurgeBlock(nzctx *, nzttBufferBlock *);
+#else
+nzerror nztbbPurgeBlock(/*_ nzctx *, nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*----------------------- nztbbSetBlock -----------------------*/
+
+/*
+ * NAME
+ *    nztbbSetBlock - Set a buffer block to a known state.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    flags    {IN}     Flags to set.
+ *    buflen   {IN}     Length of buffer.
+ *    usedlen  {IN}     Used length.
+ *    buffer   {IN}     Buffer.
+ *    block    {IN/OUT} Buffer block
+ * 
+ * NOTES
+ *    If buflen > 0, objlen == 0, and obj == NULL, then buflen bytes
+ *    of memory is allocated and a pointer is stored in the buffer
+ *    block.
+ *
+ *    The buffer parameter remains unchanged.
+ *    
+ * RETURNS
+ *    NZERROR_OK        Success.
+ */
+#ifdef __STDC__
+nzerror nztbbSetBlock(nzctx *,  uword, ub4, ub4, ub1 *, 
+                          nzttBufferBlock *);
+#else
+nzerror nztbbSetBlock(/*_ nzctx *,  uword, ub4, ub4, ub1 *, 
+                          nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+
+/*--------------------- nztiGetSecInfo ---------------------*/
+
+/*
+ * NAME
+ * 	nztiGetSecInfo - Get some security information for SSL
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *    	persona  {IN}		persona
+ *    	dname    {OUT}    	distinguished name of the certificate
+ *    	dnamelen {OUT}    	length of the distinguished name 
+ *    	issuername {OUT}  	issuer name of the certificate
+ *    	certhash {OUT}		SHA1 hash of the certificate
+ *	certhashlen{OUT}	length of the hash
+ * NOTES
+ * 	This function allocate memories for issuername, certhash, and dname.
+ *	To deallocate memory for those params, you should call nztdbuf_DestroyBuf.
+ * RETURNS
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztiGetSecInfo(nzctx *, nzttPersona *, text **, ub4 *,
+			 text **, ub4 *, ub1 **, ub4 *);
+#else
+nzerror nztiGetSecInfo(/*_ nzctx *, nzttPersona *, text **, ub4 *,
+			   text **, ub4 *, ub1 **, ub4 * _*/);
+#endif	/* __STDC__ */
+
+
+/*---------------------- nztiGetDName ----------------------*/
+
+/*
+ * NAME
+ * 	nztiGetDName - Get the distinguished name for the given identity
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *	identity {IN}		identity need to get dname from
+ *	dn	{OUT}		distinguished name
+ *	dnlen	{OUT}		length of the dname
+ *
+ * NOTES
+ * 	
+ * RETURNS
+ * 	
+ */
+
+#ifdef __STDC__
+nzerror nztiGetDName(nzctx *, nzttIdentity *,
+		     text **, ub4 *);
+#else
+nzerror nztiGetDName(/*_ nzctx *, nzttIdentity *,
+			     text **, ub4 * _*/);
+#endif /* __STDC__ */
+
+/*------------------- nztiGetIssuerName -------------------*/
+
+/*
+ * NAME
+ * 	nztiGetIssuerName -  Get IssuerName for the given identity 
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *	identity {IN}		identity need to get issuername from
+ *	issuername {OUT}       	issuer's name
+ *	issuernamelen {OUT}	length of the issuer's name
+ * 
+ * NOTES
+ * 	
+ * RETURNS
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztiGetIssuerName(nzctx *, nzttIdentity *,
+			     text **, ub4 *);
+#else
+nzerror nztiGetIssuerName(/*_ nzctx *, nzttIdentity *,
+			      text **, ub4 * _*/);
+#endif /* __STDC__ */
+
+
+/*-------------------- nztgch_GetCertHash --------------------*/
+
+/*
+ * NAME
+ * 	nztgch_GetCertHash -  Get SHA1 hash for the certificate of the identity 
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *	identity {IN}		identity need to get issuername from
+ *	certHash {OUT}          certHash buffer 
+ *	hashLen {OUT}		length of the certHash 
+ * 
+ * NOTES
+ * 	Need to call nztdbuf_DestroyBuf to deallocate memory for certHash.	
+ * RETURNS
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztgch_GetCertHash(nzctx *, nzttIdentity *,
+			     ub1 **, ub4 *);
+#else
+nzerror nztgch_GetCertHash(/*_ nzctx *, nzttIdentity *,
+			     ub1 **, ub4 * _*/);
+#endif /* __STDC__ */
+
+/*-------------------- nztdbuf_DestroyBuf --------------------*/
+
+/*
+ * NAME
+ * 	nztdbuf_DestroyBuf - Deallocation funtions for ub1 and text buffer 
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *	buf      {IN}		Allocated buffer to be destroyed.
+ * 
+ * NOTES
+ * 	
+ * RETURNS
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztdbuf_DestroyBuf( nzctx *, dvoid **);
+#else
+nzerror nztdbuf_DestroyBuf(/*_ nzctx *, dvoid ** _*/);
+#endif /* __STDC__ */
+
+
+/*----------------------- nztGetCertChain -----------------------*/
+
+/*
+ * NAME
+ * 	nztGetCertChain - 
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ * 
+ * NOTES
+ * 	
+ * RETURNS
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztGetCertChain(nzctx *, nzttWallet * );
+#else
+nzerror nztGetCertChain(/*_ nzctx *, nzttWallet _*/);
+#endif /* __STDC__ */
+
+/*----------------------- nztCompareDN -----------------------*/
+
+/*
+ * NAME
+ * 	nztCompareDN - 
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *	dn1	{IN}		distinguished name 1
+ *	dn2     {IN}		distinguished name 2
+ * 
+ * NOTES
+ * 	
+ * RETURNS
+ * 	NZERROR_OK	 	succeeded
+ *	others			failed
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztCompareDN(nzctx *, ub1 *, ub4,  ub1 *, ub4, boolean * );
+#else
+nzerror nztCompareDN(/*_ nzctx *, ub1 *,ub4 ,  ub1 *, ub4, boolean * _*/);
+#endif/* __STDC__ */
+
+
+#ifdef NZ_OLD_TOOLS
+/*--------------------- nztIdentityAlloc ---------------------*/
+
+/*
+ * NAME
+ * 	nztIdentityAlloc - Allocate memory for nzttIdentity context
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *	identity {OUT}		nzttIdentity context
+ * 
+ * NOTES
+ * 	
+ * RETURNS
+ * 	NZERROR_OK	 	succeeded
+ *	others			failed
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztIdentityAlloc(nzctx *, nzttIdentity **);
+#else
+nzerror nztIdentityAlloc(/*_ nzctx *, nzttIdentity ** _*/);
+#endif/* __STDC__ */
+
+/*--------------------- nztIPrivateAlloc ---------------------*/
+
+/*
+ * NAME
+ * 	nztIPrivateAlloc - Allocate memory for nzttIdentityPrivate
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ * 
+ *    	osscntxt {IN}     	OSS context.
+ *	ipriv	{OUT}		identityPrivate structure
+ * NOTES
+ * 	
+ * RETURNS
+ * 	NZERROR_OK	 	succeeded
+ *	others			failed
+ * 	
+ */
+
+#ifdef __STDC__
+nzerror nztIPrivateAlloc( nzctx *, nzttIdentityPrivate **);
+#else
+nzerror nztIPrivateAlloc( nzctx *, nzttIdentityPrivate **);
+#endif /* __STDC__ */
+
+
+/*---------------------- nztIDupContent ----------------------*/
+
+/*
+ * NAME
+ * 	nztIDupContent - 
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ * 	targetIdentity{OUT}	target identity
+ *	sourceIdentity {IN}	source identity
+ * NOTES
+ * 	
+ * RETURNS
+ * 	NZERROR_OK	 	succeeded
+ *	others			failed
+ * 	
+ */
+
+#ifdef __STDC__
+nzerror nztIDupContent( nzctx *, nzttIdentity *, nzttIdentity *);
+#else
+nzerror nztIDupContent(/*_ nzctx *, nzttIdentity *, nzttIdentity * _*/);
+#endif
+/*---------------------- nztIPDuplicate ----------------------*/
+
+/*
+ * NAME
+ * 	nztIPDuplicate - 
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *	target_ipriv {OUT}	target identityPrivate
+ *	source_ipriv {IN}	source identityPrivate
+ * 
+ * NOTES
+ * 	
+ * RETURNS
+ * 	NZERROR_OK	 	succeeded
+ *	others			failed
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztIPDuplicate( nzctx *, nzttIdentityPrivate **,
+			nzttIdentityPrivate *);
+#else
+nzerror nztIPDuplicate(/*_ nzctx *, nzttIdentityPrivate **,
+			 nzttIdentityPrivate * _*/);
+#endif /* __STDC__ */
+
+/*--------------------- nztiDupIdentList ---------------------*/
+
+/*
+ * NAME
+ * 	nztiDupIdentList - 
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *	source_identities {IN}	source identity list
+ *	numIdent {OUT}		number of identity in the list
+ *	ppidentity {OUT}	Target of identity	
+ *	
+ * NOTES
+ * 	
+ * RETURNS
+ * 	NZERROR_OK	 	succeeded
+ *	others			failed
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztiDupIdentList( nzctx *, nzttIdentity  *, ub4 *, 
+                          nzttIdentity **);
+#else
+
+nzerror nztiDupIdentList(/*_ nzctx *, nzttIdentity  *, ub4 *, 
+                             nzttIdentity ** _*/);
+#endif
+
+/*--------------------- nztFreeIdentList ---------------------*/
+
+/*
+ * NAME
+ * 	nztFreeIdentList - Free memory for a list of Identities
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *	identity {IN}		identity context
+ *
+ * NOTES
+ * 	
+ * RETURNS
+ * 	NZERROR_OK	 	succeeded
+ *	others			failed
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztFreeIdentList( nzctx *, nzttIdentity **);
+#else
+nzerror nztFreeIdentList(/*_ nzctx *, nzttIdentity ** _*/);
+#endif
+#endif /* NZ_OLD_TOOLS */
+
+/*--------------------- nztCheckVaLidity ---------------------*/
+
+/*
+ * NAME
+ * 	nztCheckVaLidity -  Check the validity of certificate
+ * 
+ * PARAMETERS
+ * 	Name	{IN/OUT}	Description
+ *    	osscntxt {IN}     	OSS context.
+ *	start_time		Start time of the certificate
+ *	end_time		End time of the certificate
+ * 
+ * NOTES
+ * 	
+ * RETURNS
+ * 	NZERROR_OK	 	succeeded
+ *	others			failed
+ * 	
+ */
+#ifdef __STDC__
+nzerror nztCheckValidity( nzctx *, ub4 , ub4 );
+#else
+nzerror nztCheckValidity(/*_ nzctx *, ub4 , ub4 _*/);
+#endif
+
+/*--------------------- nztwCreateWallet ---------------------*/
+
+/*
+ * NAME
+ *    nztwCreateWallet - Create a new wallet.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    wrllen   {IN}     Length of wallet resource locator.
+ *    wrl      {IN}     WRL.
+ *    pwdlen   {IN}     Length of password (see notes below).
+ *    pwd      {IN}     Password.
+ *    wallet   {IN/OUT} Wallet. 
+ * 
+ * NOTES
+ *    It is an error to try to create a wallet that already exists.
+ *    The previously existing wallet must be destroyed first.
+ *
+ *    The wallet itself is not encrypted.  Rather, all the personas in
+ *    the wallet are encrypted under the same password.  A hash of the
+ *    password is stored in the wallet.
+ *
+ *    Upon success, an empty open wallet is stored in the wallet
+ *    parameter.
+ *    
+ * RETURNS
+ *    NZERROR_OK                 Sucess.
+ *    NZERROR_TK_WALLET_EXISTS   Wallet already exists.
+ *    NZERROR_RIO_OPEN           RIO could not create wallet (see trace file).
+ */
+#ifdef __STDC__
+nzerror nztwCreateWallet(nzctx *, ub4, text *, ub4, text *, 
+                             nzttWallet *);
+#else
+nzerror nztwCreateWallet(/*_ nzctx *, ub4, text *, ub4, text *, 
+                             nzttWallet * _*/);
+#endif /* __STDC__ */
+
+
+/*--------------------- nztwDestroyWallet ---------------------*/
+
+/*
+ * NAME
+ *    nztwDestroyWallet - Destroy an existing wallet.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    wrllen   {IN}     Length of wallet resource locator.
+ *    wrl      {IN}     WRL.
+ *    pwdlen   {IN}     Length of password.
+ *    pwd      {IN}     Password.
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_PASSWORD  Password verification failed.
+ *    NZERROR_RIO_OPEN     RIO could not open wallet (see trace file).
+ *    NZERROR_RIO_DELETE   Delete failed (see trace file).
+ */
+#ifdef __STDC__
+nzerror nztwDestroyWallet(nzctx *, ub4, text *, ub4, text *);
+#else
+nzerror nztwDestroyWallet(/*_ nzctx *, ub4, text *, ub4, text * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nzteStorePersona ---------------------*/
+
+/*
+ * NAME
+ *    nzteStorePersona - Store an open persona in a wallet.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context. 
+ *    persona  {IN/OUT} Persona.
+ *    wallet   {IN/OUT} Wallet.
+ * 
+ * NOTES
+ *    If the open persona is not associated with any wallet (it was
+ *    created via the nzteClosePersona function), then storing the
+ *    persona creates that association.  The wallet will also have an
+ *    updated persona list that reflects this association.
+ *
+ *    If the open persona was associated with wallet 'A' (it was
+ *    opened via the nztwOpenWallet function), and is stored back into
+ *    wallet 'A', then then the old persona is overwritten by the new
+ *    persona if the password can be verified.  Recall that all
+ *    personas have a unique identity id.  If that id changes then
+ *    storing the persona will put a new persona in the wallet.
+ *
+ *    If the open persona was associated with wallet 'A' and is stored
+ *    into wallet 'B', and if wallet 'B' does not contain a persona
+ *    with that unique identity id, then the persona will be copied
+ *    into wallet 'B', wallet 'B''s persona list will be updated, and
+ *    the persona structure will be updated to be associated with
+ *    wallet 'B'.  If wallet 'B' already contained the persona, it
+ *    would be overwritten by the new persona.
+ *
+ *    The persona parameter is doubly indirect so that at the
+ *    conclusion of the function call, the pointer can be directed to
+ *    the persona in the wallet.
+ *
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_PASSWORD  Password verification failed.
+ *    NZERROR_RIO_STORE    Store failed (see network trace file).
+ */
+#ifdef __STDC__
+nzerror nzteStorePersona(nzctx *, nzttPersona **, nzttWallet *);
+#else
+nzerror nzteStorePersona(/*_ nzctx *, nzttPersona **, nzttWallet * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nzteRemovePersona ---------------------*/
+
+/*
+ * NAME
+ *    nzteRemovePersona - Remove a persona from the wallet.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN/OUT} Persona.
+ * 
+ * NOTES
+ *    The password is verified before trying to remove the persona.
+ *    
+ *    If the persona is open, it is closed.  The persona is removed
+ *    from the wallet list and the persona pointer is set to NULL.
+ *    
+ *    A double indirect pointer to the persona is required so that the
+ *    persona pointer can be set to NULL upon completion.
+ *
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_PASSWORD  Password verification failed.
+ *    NZERROR_RIO_DELETE   Delete failed.
+ */
+#ifdef __STDC__
+nzerror nzteRemovePersona(nzctx *, nzttPersona **);
+#else
+nzerror nzteRemovePersona(/*_ nzctx *, nzttPersona ** _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nzteCreatePersona ---------------------*/
+
+/*
+ * NAME
+ *    nzteCreatePersona - Create a persona.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    itype    {IN}     Identity type.
+ *    ctype    {IN}     Cipher type.
+ *    desc     {IN}     Persona description.
+ *    persona  {OUT}    Persona.
+ * 
+ * NOTES
+ *    The resulting persona is created in the open state, but it will
+ *    not be associated with a wallet.
+ *    
+ *    The memory for the persona is allocated by the function.
+ *
+ * RETURNS
+ *    NZERROR_OK        Success.
+ *    NZERROR_TK_TYPE   Unsupported itype/ctype combination.
+ *    NZERROR_TK_PARMS  Error in persona description.
+ */
+#ifdef __STDC__
+nzerror nzteCreatePersona(nzctx *, nzttVersion, nzttCipherType, 
+			  nzttPersonaDesc *, nzttPersona **);
+#else
+nzerror nzteCreatePersona(/*_ nzctx *, nzttVersion, nzttCipherType, 
+                              nzttPersonaDesc *, nzttPersona ** _*/);
+#endif /* __STDC __*/
+
+
+/*----------------- nztiStoreTrustedIdentity -----------------*/
+
+/*
+ * NAME
+ *    nztiStoreTrustedIdentity - Store an identity into a persona.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     Success.
+ *    identity {IN/OUT} Trusted Identity.
+ *    persona  {IN/OUT} Persona.    
+ * 
+ * NOTES
+ *    The identity is not saved with the persona in the wallet until
+ *    the persona is stored.
+ *    
+ *    The identity parameter is double indirect so that it can point
+ *    into the persona at the conclusion of the call.
+ *
+ * RETURNS
+ *    NZERROR_OK     Success.
+ */
+#ifdef __STDC__
+nzerror nztiStoreTrustedIdentity(nzctx *, nzttIdentity **,
+                                     nzttPersona *);
+#else
+nzerror nztiStoreTrustedIdentity(/*_ nzctx *, nzttIdentity **,
+                                     nzttPersona * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nzteSetProtection ---------------------*/
+
+/*
+ * NAME
+ *    nzteSetProtection - Set the protection type for a CE function.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN/OUT} Persona.
+ *    func     {IN}     CE function.
+ *    tdufmt   {IN}     TDU Format.
+ *    protinfo {IN}     Protection information specific to this format.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK              Success.
+ *    NZERROR_TK_PROTECTION   Unsupported protection.
+ *    NZERROR_TK_PARMS        Error in protection info.
+ */
+#ifdef __STDC__
+nzerror nzteSetProtection(nzctx *, nzttPersona *, nzttcef, nztttdufmt,
+                              nzttProtInfo *);
+#else
+nzerror nzteSetProtection(/*_ nzctx *, nzttPersona *, nzttcef, nztttdufmt,
+                              nzttProtInfo * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nzteGetProtection ---------------------*/
+
+/*
+ * NAME
+ *    nzteGetProtection - Get the protection type for a CE function.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    func     {IN}     CE function.
+ *    tdufmt   {OUT}    TDU format.
+ *    protinfo {OUT}    Protection information.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK        Success.
+ */
+#ifdef __STDC__
+nzerror nzteGetProtection(nzctx *, nzttPersona *, nzttcef, nztttdufmt *,
+                              nzttProtInfo *);
+#else
+nzerror nzteGetProtection(/*_ nzctx *, nzttPersona *, nzttcef, nztttdufmt *,
+                              nzttProtInfo * _*/);
+#endif /* __STDC __*/
+
+/*-------------------- nztiRemoveIdentity --------------------*/
+
+/*
+ * NAME
+ *    nztiRemoveIdentity - Remove an identity from an open persona.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context. 
+ *    identity {IN/OUT}     Identity.
+ * 
+ * NOTES
+ *    If the persona is not stored, this identity will still be in the
+ *    persona stored in the wallet.
+ *    
+ *    The identity parameter is doubly indirect so that at the
+ *    conclusion of the function, the pointer can be set to NULL.
+ *
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTFOUND  Identity not found.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ */
+#ifdef __STDC__
+nzerror nztiRemoveIdentity(nzctx *, nzttIdentity **);
+#else
+nzerror nztiRemoveIdentity(/*_ nzctx *, nzttIdentity ** _*/);
+#endif /* __STDC __*/
+
+/*----------------- nztifdn -----------------*/
+
+/*
+ * NAME
+ *    nztifdn - create an Identity From a Distinguished Name
+ * 
+ * PARAMETERS
+ *    osscntxt           {IN}  OSS context.
+ *    length             {IN}  Length of the distinguished name
+ *    distinguished_name {IN}  distinguished name string
+ *    ppidentity         {OUT} created identity
+ * 
+ * NOTES
+ *    Given a distinguished name, return the identity that corresponds to it.
+ *
+ * RETURNS
+ *    NZERROR_OK     Success.
+ */
+#ifdef __STDC__
+nzerror nztifdn(nzctx         *ossctx,
+                    ub4         length,
+                    text          *distinguished_name,
+                    nzttIdentity **ppidentity);
+#else
+nzerror nztifdn(/*_ nzctx         *ossctx,
+                    ub4         length,
+                    text          *distinguished_name,
+                    nzttIdentity **ppidentity _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nztxSignExpansion ---------------------*/
+
+/*
+ * NAME
+ *    nztxSignExpansion - Determine the size of the attached signature buffer.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}  OSS context.
+ *    persona  {IN}  Persona.
+ *    inlen    {IN}  Length of input.
+ *    tdulen   {OUT} Buffer needed for signature.
+ *
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztxSignExpansion(nzctx *, nzttPersona *, ub4, ub4 *);
+#else
+nzerror nztxSignExpansion(/*_ nzctx *, nzttPersona *, ub4, ub4 * _*/);
+#endif /* __STDC __*/
+
+/*--------------- nztxsd_SignDetachedExpansion ---------------*/
+
+/*
+ * NAME
+ *    nztxsd_SignDetachedExpansion - Determine the size of buffer needed.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}  OSS context.
+ *    persona  {IN}  Persona.
+ *    inlen    {IN}  Length of input.
+ *    tdulen   {OUT} Buffer needed for signature.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztxsd_SignDetachedExpansion(nzctx *, nzttPersona *, ub4,
+                                         ub4 *);
+#else
+nzerror nztxsd_SignDetachedExpansion(/*_ nzctx *, nzttPersona *, ub4,
+                                         ub4 * _*/);
+#endif /* __STDC __*/
+
+/*------------------------ nztEncrypt ------------------------*/
+
+/*
+ * NAME
+ *    nztEncrypt - Symmetrically encrypt
+ * 
+ * PARAMETERS
+ *    osscntxt    {IN}     OSS context.
+ *    persona     {IN}     Persona.
+ *    inlen       {IN}     Length of this input part.
+ *    in          {IN}     This input part.
+ *    tdubuf      {IN/OUT} TDU buffer.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztEncrypt(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                       nzttBufferBlock *);
+#else
+nzerror nztEncrypt(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                       nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*------------------- nztxEncryptExpansion -------------------*/
+
+/*
+ * NAME
+ *    nztxEncryptExpansion - Determine the size of the TDU to encrypt.
+ * 
+ * PARAMETERS
+ *    osscntxt    {IN}  OSS context.
+ *    persona     {IN}  Persona.
+ *    inlen       {IN}  Length of this input part.
+ *    tdulen      {OUT} Length of TDU.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztxEncryptExpansion(nzctx *, nzttPersona *, ub4, ub4 *);
+#else
+nzerror nztxEncryptExpansion(/*_ nzctx *, nzttPersona *, ub4, ub4 * _*/);
+#endif /* __STDC __*/
+
+/*------------------------ nztDecrypt ------------------------*/
+
+/*
+ * NAME
+ *    nztDecrypt - Decrypt an Encrypted message.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    state    {IN}     State of decryption.
+ *    inlen    {IN}     Length of this input part.
+ *    in       {IN}     This input part.
+ *    out      {IN/OUT} Cleartext message.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztDecrypt(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                       nzttBufferBlock *);
+#else
+nzerror nztDecrypt(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                       nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*------------------------ nztEnvelope ------------------------*/
+
+/*
+ * NAME
+ *    nztEnvelope - Sign and PKEncrypt a message.
+ * 
+ * PARAMETERS
+ *    osscntxt    {IN}     OSS context.
+ *    persona     {IN}     Persona.
+ *    nrecipients {IN}     Number of recipients for this encryption.
+ *    recipients  {IN}     List of recipients.
+ *    state       {IN}     State of encryption.
+ *    inlen       {IN}     Length of this input part.
+ *    in          {IN}     This input part.
+ *    tdubuf      {IN/OUT} TDU buffer.
+ *
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztEnvelope(nzctx *, nzttPersona *, ub4, nzttIdentity *,
+                        nzttces, ub4, ub1 *, nzttBufferBlock *);
+#else
+nzerror nztEnvelope(/*_ nzctx *, nzttPersona *, ub4, nzttIdentity *,
+                        nzttces, ub4, ub1 *, nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*----------------------- nztDeEnvelope -----------------------*/
+
+/*
+ * NAME
+ *    nztDeEnvelope - PKDecrypt and verify a message.
+ * 
+ * PARAMETERS
+ *    osscntxt    {IN}     OSS context.
+ *    persona     {IN}     Persona.
+ *    state       {IN}     State of encryption.
+ *    inlen       {IN}     Length of this input part.
+ *    in          {IN}     This input part.
+ *    out         {OUT}    Message from TDU.
+ *    verified    {OUT}    TRUE if verified.
+ *    validated   {OUT}    TRUE if validated.
+ *    sender      {OUT}    Identity of sender.
+ *
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztDeEnvelope(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                          nzttBufferBlock *, boolean *, boolean *,
+                          nzttIdentity **);
+#else
+nzerror nztDeEnvelope(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                          nzttBufferBlock *, boolean *, boolean *,
+                          nzttIdentity ** _*/);
+#endif /* __STDC __*/
+
+/*----------------------- nztKeyedHash -----------------------*/
+
+/*
+ * NAME
+ *    nztKeyedHash - Generate a keyed hash.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}     OSS context.
+ *    persona  {IN}     Persona.
+ *    state    {IN}     State of hash.
+ *    inlen    {IN}     Length of this input.
+ *    in       {IN}     This input.
+ *    tdu      {IN/OUT} Output tdu.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztKeyedHash(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                         nzttBufferBlock *);
+#else
+nzerror nztKeyedHash(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
+                         nzttBufferBlock * _*/);
+#endif /* __STDC __*/
+
+/*------------------ nztxKeyedHashExpansion ------------------*/
+
+/*
+ * NAME
+ *    nztxKeyedHashExpansion - Determine the space needed for a keyed hash.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}  OSS context.
+ *    persona  {IN}  Persona.
+ *    inlen    {IN}  Length of this input.
+ *    tdulen   {OUT} TDU length.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztxKeyedHashExpansion(nzctx *, nzttPersona *, ub4, 
+                                   ub4 *);
+#else
+nzerror nztxKeyedHashExpansion(/*_ nzctx *, nzttPersona *, ub4, 
+                                   ub4 * _*/);
+#endif /* __STDC __*/
+
+/*--------------------- nztxHashExpansion ---------------------*/
+
+/*
+ * NAME
+ *    nztxHashExpansion - Determine the size of the TDU for a hash.
+ * 
+ * PARAMETERS
+ *    osscntxt {IN}  OSS context.
+ *    persona  {IN}  Persona.
+ *    inlen    {IN}  Length of this input.
+ *    tdulen   {OUT} TDU length.
+ * 
+ * NOTES
+ *    
+ * RETURNS
+ *    NZERROR_OK           Success.
+ *    NZERROR_TK_NOTOPEN   Persona is not open.
+ *    NZERROR_TK_NOTSUPP   Function not supported with persona.
+ */
+#ifdef __STDC__
+nzerror nztxHashExpansion(nzctx *, nzttPersona *, ub4, ub4 *);
+#else
+nzerror nztxHashExpansion(/*_ nzctx *, nzttPersona *, ub4, ub4 * _*/);
+#endif /* __STDC __*/
+
+/*---------------- nztiae_IsAuthEnabled ----------------*/
+
+/*
+ * NAME
+ * 	nztiae_IsAuthEnabled -  Checks to see if Authentication is Enabled
+ *                               in the current Cipher Spec.
+ * 
+ * PARAMETERS
+ * 	ctx	{IN}	Oracle SSL Context
+ *      ncipher {IN}    CipherSuite
+ *      authEnabled {OUT} Boolean for is Auth Enabled?
+ * 
+ * NOTES
+ * 	
+ * RETURNS
+ *      NZERROR_OK on success.
+ *      NZERROR_TK_INV_CIPHR_TYPE if Cipher Spec is not Recognized.
+ */
+
+#ifdef __STDC__
+nzerror nztiae_IsAuthEnabled( nzctx *, ub2, boolean *);
+#else
+nzerror nztiae_IsAuthEnabled(/*_ nzctx *ctx, 
+                                  ub2 ncipher, 
+                                  boolean *authEnabled _*/);
+#endif
+
+/*---------------- nztiee_IsEncrEnabled ----------------*/
+/*
+ * NAME
+ * 	nztiee_IsEncrEnabled -  Checks to see if Encryption is Enabled
+ *                               in the current Cipher Spec.
+ * 
+ * PARAMETERS
+ * 	ctx	{IN}	Oracle SSL Context
+ *      ncipher {IN}    CipherSuite
+ *      EncrEnabled {OUT} Boolean for is Auth Enabled?
+ * 
+ * NOTES
+ * 	
+ * RETURNS
+ *      NZERROR_OK on success.
+ *      NZERROR_TK_INV_CIPHR_TYPE if Cipher Spec is not Recognized.
+ */
+
+#ifdef __STDC__
+nzerror nztiee_IsEncrEnabled( nzctx *, ub2, boolean *);
+#else
+nzerror nztiee_IsEncrEnabled(/*_ nzctx *ctx, 
+                                  ub2 ncipher, 
+                                  boolean *EncrEnabled _*/);
+#endif
+/*---------------- nztihe_IsHashEnabled ----------------*/
+/*
+ * NAME
+ * 	nztihe_IsHashEnabled -  Checks to see if HAshing is Enabled
+ *                               in the current Cipher Spec.
+ * 
+ * PARAMETERS
+ * 	ctx	{IN}	Oracle SSL Context
+ *      ncipher {IN}    CipherSuite
+ *      hashEnabled {OUT} Boolean for is Auth Enabled?
+ * 
+ * NOTES
+ * 	
+ * RETURNS
+ *      NZERROR_OK on success.
+ *      NZERROR_TK_INV_CIPHR_TYPE if Cipher Spec is not Recognized.
+ */
+
+#ifdef __STDC__
+nzerror nztihe_IsHashEnabled( nzctx *, ub2, boolean *);
+#else
+nzerror nztihe_IsHashEnabled(/*_ nzctx *ctx, 
+                                  ub2 ncipher, 
+                                  boolean *hashEnabled _*/);
+#endif
+
+/*
+ *
+ */
+
+#ifdef _STDC_
+nzerror nztGetIssuerName(nzctx *, nzttIdentity *, ub1 **, ub4 *);
+#else
+nzerror nztGetIssuerName(/*_ nzctx *ctx,
+                             nzttIdentity *identity,
+                             ub1  **issuername,
+                             ub4   *issuernamelen _*/);
+#endif
+
+#ifdef _STDC_
+nzerror nztGetSubjectName(nzctx *, nzttIdentity *, ub1 **, ub4 *);
+#else
+nzerror nztGetSubjectName(/*_ nzctx *ctx,
+                              nzttIdentity *identity,
+                              ub1  **subjectname,
+                              ub4   *subjectnamelen _*/);
+#endif
+
+
+#ifdef _STDC_
+nzerror nztGetBase64Cert(nzctx *, nzttIdentity *, ub1 **, ub4 *);
+#else
+nzerror nztGetBase64Cert(/*_ nzctx *ctx,
+                              nzttIdentity *identity,
+                              ub1  **b64cert,
+                              ub4   *b64certlen _*/);
+#endif
+
+#ifdef _STDC_
+nzerror nztGetSerialNumber(nzctx *, nzttIdentity *, ub1 **, ub4 *);
+#else
+nzerror nztGetSerialNumber(/*_ nzctx *ctx,
+                              nzttIdentity *identity,
+                              ub1   **serialnum,
+                              ub4    *serialnumlen _*/);
+#endif
+
+#ifdef _STDC_
+nzerror nztGetValidDate(nzctx *, nzttIdentity *, ub4 *, ub4 *);
+#else
+nzerror nztGetValidDate(/*_ nzctx *ctx,
+                            nzttIdentity *identity,
+                            ub4  *startdate, 
+                            ub4  *enddate  _*/);
+#endif
+
+#ifdef _STDC_
+nzerror nztGetVersion(nzctx *, nzttIdentity *, nzstrc *); 
+#else
+nzerror nztGetVersion(/*_ nzctx *ctx,
+                          nzttIdentity *identity,
+                          nzstrc *pVerStr  _*/);
+#endif
+
+#ifdef _STDC_
+nzerror nztGetPublicKey(nzctx *, nzttIdentity *, ub1 **, ub4 *);
+#else
+nzerror nztGetPublicKey(/*_ nzctx *ctx,
+                            nzttIdentity *identity,
+                            ub1  **pubKey,
+                            ub4   *pubKeylen _*/);
+#endif
+
+
+#ifdef _STDC_
+nzerror nztGenericDestroy(nzctx *, ub1 **);
+#else
+nzerror nztGenericDestroy(/*_ nzctx *ctx,
+                              ub1  **var _*/);
+#endif
+
+#ifdef _STDC_
+nzerror nztSetAppDefaultLocation(nzctx *, text *, size_t);
+#else
+nzerror nztSetAppDefaultLocation(/*_ nzctx *ctx,
+                                     text *,
+                                     size_t _*/);
+#endif
+
+#ifdef _STDC_
+nzerror nztSearchNZDefault(nzctx *, boolean *);
+#else
+nzerror nztSearchNZDefault(/*_ nzctx *ctx,
+                               boolean *search _*/);
+#endif
+
+
+#endif /* NZT_ORACLE */
+
diff --git a/src/terralib/drivers/Oracle/OCI/include/occi.h b/src/terralib/drivers/Oracle/OCI/include/occi.h
new file mode 100644
index 0000000..e593341
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/occi.h
@@ -0,0 +1,78 @@
+/* Copyright (c) 2000, 2002, Oracle Corporation.  All rights reserved.  */
+ 
+/* 
+   NAME 
+     occi.h - Oracle C++ Interface header files.
+
+   DESCRIPTION 
+     <short description of facility this file declares/defines> 
+
+   RELATED DOCUMENTS 
+     <note any documents related to this facility>
+ 
+   EXPORT FUNCTION(S) 
+     <external functions declared for use outside package - one-line 
+      descriptions>
+
+   INTERNAL FUNCTION(S)
+     <other external functions declared - one-line descriptions>
+
+   EXAMPLES
+
+   NOTES
+     <other useful comments, qualifications, etc.>
+
+   MODIFIED   (MM/DD/YY)
+   vvinay      08/19/02 - 
+   aahluwal    06/03/02 - bug 2360115
+   gayyappa    01/03/01 - removed inclusions before occiCommon.h
+   kmohan      04/11/00 - include oci.h and occiCommon.h also
+   rkasamse    04/03/00 - header file for all the OCCI classes
+   rkasamse    04/03/00 - Creation
+
+*/
+
+#ifndef OCCI_ORACLE
+# define OCCI_ORACLE
+
+#ifndef OCCICOMMON_ORACLE
+#include <occiCommon.h>
+#endif
+
+#ifndef OCCIDATA_ORACLE
+#include <occiData.h>
+#endif
+
+#ifndef OCCICONTROL_ORACLE
+#include <occiControl.h>
+#endif
+
+#ifndef OCCIOBJECTS_ORACLE
+#include <occiObjects.h>
+#endif
+
+#ifndef OCCIAQ_ORACLE
+#include <occiAQ.h>
+#endif
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                     PRIVATE TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                           EXPORT FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                          INTERNAL FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+#endif                                              /* OCCI_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/occiAQ.h b/src/terralib/drivers/Oracle/OCI/include/occiAQ.h
new file mode 100644
index 0000000..6613235
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/occiAQ.h
@@ -0,0 +1,374 @@
+/* Copyright (c) 2002, 2003, Oracle Corporation.  All rights reserved.  */
+ 
+/* 
+   NAME 
+     occiAQ.h - Header file for occi AQ classes
+
+   DESCRIPTION 
+     Class declarations for Producer, Consumer, Message, Agent
+     Listener, Subscription
+
+   RELATED DOCUMENTS 
+     <note any documents related to this facility>
+ 
+   EXPORT FUNCTION(S) 
+     <external functions declared for use outside package - one-line 
+     descriptions>
+
+   INTERNAL FUNCTION(S)
+     <other external functions declared - one-line descriptions>
+
+   EXAMPLES
+
+   NOTES
+     <other useful comments, qualifications, etc.>
+
+   MODIFIED   (MM/DD/YY)
+   cparampa    10/12/02 - creation
+
+*/
+
+#ifndef _olint   /* disable olint check */
+
+#ifndef OCCIAQ_ORACLE
+# define OCCIAQ_ORACLE
+
+#ifndef OCCICOMMON_ORACLE
+#include <occiCommon.h>
+#endif
+
+namespace oracle {
+namespace occi {
+namespace aq{
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+class Message
+{
+  public:
+
+     enum MessageState
+     {
+        MSG_READY = OCI_MSG_READY,
+        MSG_WAITING = OCI_MSG_WAITING,
+        MSG_PROCESSED = OCI_MSG_PROCESSED,
+        MSG_EXPIRED = OCI_MSG_EXPIRED
+     };
+     enum PayloadType
+     {
+        RAW,
+        ANYDATA,
+        OBJECT
+     };
+
+     Message( const Environment *env );
+     Message( const Message& rhs);
+     ~Message();
+     
+     void operator=(const Message& rhs);
+     int getAttemptsToDequeue() const ;
+     void setCorrelationId( const OCCI_STD_NAMESPACE::string& corr_id ) ;
+     OCCI_STD_NAMESPACE::string getCorrelationId() const ;
+     void setDelay( int delay ) ;
+     int getDelay() const ;
+     Date getMessageEnqueuedTime() const ;
+     void setExceptionQueueName( const OCCI_STD_NAMESPACE::string& queue ) ;
+     OCCI_STD_NAMESPACE::string getExceptionQueueName() const ;
+     void setExpiration( int exp ) ;
+     int getExpiration() const ;
+     MessageState getMessageState() const ;
+     void setPriority( int priority ) ;
+     int getPriority() const ;
+     void setRecipientList( OCCI_STD_NAMESPACE::vector<Agent>& ag_list ) ;
+     void setSenderId( const Agent& sender ) ;
+     Agent getSenderId() const ;
+     void setOriginalMessageId( const Bytes& queue ) ;
+     Bytes getOriginalMessageId() const ;
+     void setNull();
+     bool isNull() const;
+
+     void setBytes( const Bytes& bytes); 
+     void setObject( PObject* pobj);
+     void setAnyData( const AnyData& any);
+
+     Bytes getBytes() const ;
+     PObject *getObject() ;
+     AnyData getAnyData() const ;
+
+     PayloadType getPayloadType( ) const;
+
+   private:
+     Ptr<MessageImpl> ptr;
+     OCIAQMsgProperties* getOCIMsgProperties() const;
+     Message( const Environment *env, const Connection *con, 
+          OCIAQMsgProperties *msgprop, void *data, unsigned int dataLen, 
+          PayloadType pType);
+     friend class ConsumerImpl;
+     friend class ProducerImpl;
+     friend class NotifyResult;
+};
+
+class Producer
+{
+   public:
+
+     enum EnqueueSequence
+     {
+       ENQ_BEFORE = OCI_ENQ_BEFORE,
+       ENQ_TOP    = OCI_ENQ_TOP
+     };
+     enum Visibility
+     {
+       ENQ_IMMEDIATE = OCI_ENQ_IMMEDIATE,
+       ENQ_ON_COMMIT = OCI_ENQ_ON_COMMIT
+     };
+     
+     Producer( const Connection *conn ); 
+     Producer( const Connection *conn, 
+               const OCCI_STD_NAMESPACE::string& queue ); 
+     Producer( const Producer& rhs);
+     ~Producer();
+
+     void operator=(const Producer& prod);
+     void setRelativeMessageId( const Bytes& msgid );
+     Bytes getRelativeMessageId() const;
+     void setSequenceDeviation( EnqueueSequence option );
+     EnqueueSequence getSequenceDeviation() const;
+     void setVisibility( Visibility option );
+     Visibility getVisibility() const;
+     void setQueueName( const OCCI_STD_NAMESPACE::string& queue );
+     OCCI_STD_NAMESPACE::string getQueueName() const;
+     void setTransformation( const OCCI_STD_NAMESPACE::string& fName);
+     OCCI_STD_NAMESPACE::string getTransformation() const;
+     Bytes send( Message& msg, const OCCI_STD_NAMESPACE::string& queue );
+     Bytes send( Message& msg );
+     void setNull();
+     bool isNull() const;
+
+  private:
+     Ptr<ProducerImpl> ptr; 
+};
+
+class Consumer
+{
+   public:
+
+     enum DequeueMode
+     {
+       DEQ_BROWSE  = OCI_DEQ_BROWSE,
+       DEQ_LOCKED  = OCI_DEQ_LOCKED,
+       DEQ_REMOVE  = OCI_DEQ_REMOVE,
+       DEQ_REMOVE_NODATA = OCI_DEQ_REMOVE_NODATA
+     };
+     enum Navigation
+     {
+       DEQ_FIRST_MSG        = OCI_DEQ_FIRST_MSG,
+       DEQ_NEXT_TRANSACTION = OCI_DEQ_NEXT_TRANSACTION,
+       DEQ_NEXT_MSG         = OCI_DEQ_NEXT_MSG
+     };
+     enum Visibility
+     {
+       DEQ_IMMEDIATE = OCI_DEQ_IMMEDIATE,
+       DEQ_ON_COMMIT = OCI_DEQ_ON_COMMIT
+     };
+     enum
+     {
+       DEQ_WAIT_FOREVER = OCI_DEQ_WAIT_FOREVER,
+       DEQ_NO_WAIT      = OCI_DEQ_NO_WAIT
+     };
+     
+     Consumer( const Connection *conn ); 
+     Consumer( const Connection * conn, const Agent& agent); 
+     Consumer( const Connection *conn,
+               const OCCI_STD_NAMESPACE::string& queue ); 
+     Consumer(const Consumer& con);
+     ~Consumer();
+    
+     void operator=(const Consumer& con);
+     void setAgent(const Agent& agent);
+     void setConsumerName( const OCCI_STD_NAMESPACE::string& name );
+     OCCI_STD_NAMESPACE::string getConsumerName() const;
+     void setCorrelationId( const OCCI_STD_NAMESPACE::string& cor_id );
+     OCCI_STD_NAMESPACE::string getCorrelationId() const;
+     void setDequeueMode( DequeueMode mode );
+     DequeueMode getDequeueMode() const;
+     void setMessageIdToDequeue( const Bytes& msgid );
+     Bytes getMessageIdToDequeue() const;
+     void setPositionOfMessage( Navigation pos );
+     Navigation getPositionOfMessage() const;
+     void setVisibility( Visibility option );
+     Visibility getVisibility() const;
+     void setWaitTime( unsigned int wait );
+     unsigned int getWaitTime() const;
+     void setQueueName( const OCCI_STD_NAMESPACE::string& queue );
+     OCCI_STD_NAMESPACE::string getQueueName() const;
+     void setTransformation( const OCCI_STD_NAMESPACE::string& fName);
+     OCCI_STD_NAMESPACE::string getTransformation() const;
+     Message receive( Message::PayloadType pType,
+                      const OCCI_STD_NAMESPACE::string& type="",
+                      const OCCI_STD_NAMESPACE::string& schema="");
+     void setNull();
+     bool isNull() const;
+
+   private:
+     Ptr<ConsumerImpl> ptr; 
+};
+
+class Agent
+{
+   public:
+     Agent( const Environment *env ); 
+     Agent( const Environment *env, 
+            const OCCI_STD_NAMESPACE::string& name, 
+            const OCCI_STD_NAMESPACE::string& address, 
+            unsigned int protocol=0 ) ; 
+     Agent(const Agent& a);
+     ~Agent() ;
+ 
+     void operator=(const Agent& a);
+     void setName( const OCCI_STD_NAMESPACE::string& name );
+     OCCI_STD_NAMESPACE::string getName() const;
+     void setAddress( const OCCI_STD_NAMESPACE::string& addr );
+     OCCI_STD_NAMESPACE::string getAddress() const;
+     void setProtocol(unsigned int protocol = 0);
+     unsigned int getProtocol() const; 
+     void setNull(); 
+     bool isNull() const;
+     OCIAQAgent* getOCIAQAgent() const;
+
+   private:
+     Ptr<AgentImpl> ptr;
+     Agent( const Environment *env, OCIAQAgent *rhs, bool toFree = false );
+     friend class Listener;
+     friend class MessageImpl;
+};
+
+class Listener
+{
+   public:
+     Listener( const Connection *conn ); 
+     Listener( const Connection *conn, 
+               OCCI_STD_NAMESPACE::vector<Agent> &agList, 
+               int waitTime=0 );
+     ~Listener();
+     
+     Agent listen();
+     void setAgentList(OCCI_STD_NAMESPACE::vector<Agent> &agList);
+     void setTimeOutForListen(int waitTime);
+     OCCI_STD_NAMESPACE::vector<Agent> getAgentList() const;
+     int getTimeOutForListen() const; 
+
+   private:
+     const ConnectionImpl *conn; 
+     OCIAQAgent** agentList; 
+     unsigned int numAgents;
+     int timeOut;
+     void *listenerExt;
+};
+
+
+class Subscription
+{
+  public:
+    enum Presentation
+    {
+       PRES_DEFAULT = OCI_SUBSCR_PRES_DEFAULT,
+       PRES_XML = OCI_SUBSCR_PRES_XML
+    };
+    enum Protocol
+    {
+       PROTO_CBK = OCI_SUBSCR_PROTO_OCI,
+       PROTO_MAIL = OCI_SUBSCR_PROTO_MAIL,
+       PROTO_SERVER = OCI_SUBSCR_PROTO_SERVER,
+       PROTO_HTTP = OCI_SUBSCR_PROTO_HTTP
+    };
+    enum Namespace
+    {
+       NS_ANONYMOUS = OCI_SUBSCR_NAMESPACE_ANONYMOUS,
+       NS_AQ = OCI_SUBSCR_NAMESPACE_AQ
+    }; 
+    
+    Subscription(const Environment* env);
+    Subscription(const Environment* env, OCISubscription* sub);
+    Subscription(const Subscription& sub);
+    ~Subscription();
+    
+    void operator=(const Subscription& sub);
+    unsigned int getDatabaseServersCount() const;
+    void setDatabaseServerNames(
+        const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string>& dbsrv);
+    OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string>
+                      getDatabaseServerNames() const ;
+    void setNotifyCallback(unsigned int (*callback)(Subscription& sub, 
+                                                    NotifyResult *nr));
+    unsigned int  (*getNotifyCallback() const)(Subscription& sub, 
+                                               NotifyResult *nr); 
+    void setCallbackContext(void* ctx);
+    void* getCallbackContext() const;
+    void setSubscriptionName(const OCCI_STD_NAMESPACE::string& name);
+    OCCI_STD_NAMESPACE::string getSubscriptionName() const ;
+    void setSubscriptionNamespace(Namespace nameSpace);
+    Namespace getSubscriptionNamespace() const ;
+    void setPayload(const Bytes& payload);
+    Bytes getPayload() const ;
+    void setRecipientName( const OCCI_STD_NAMESPACE::string& name);
+    OCCI_STD_NAMESPACE::string getRecipientName() const;
+    void setPresentation( Presentation pres) ;
+    Presentation getPresentation() const ;
+    void setProtocol( Protocol prot) ;
+    Protocol getProtocol() const ;
+    OCISubscription* getOCISubscription() const;
+    void setNull();
+    bool isNull() const;
+    Environment* getEnvironment() const;
+
+  private:
+    Ptr<SubscriptionImpl> ptr;
+};
+
+class NotifyResult
+{
+   public:
+     Bytes getPayload() const;
+     Message getMessage() const;
+     Bytes getMessageId() const;
+     OCCI_STD_NAMESPACE::string getConsumerName() const;
+     OCCI_STD_NAMESPACE::string getQueueName() const;
+
+  private:
+     const EnvironmentImpl *env;
+     void *payload;
+     unsigned int payloadLen;
+     dvoid *desc;
+     ub4 mode;
+     void *notifyResultExt;
+
+     //private constructor
+     NotifyResult(const Environment *env, void *payload, ub4 payloadLen, 
+                  void *pdescriptor, ub4 mode);
+
+     friend class SubscriptionImpl;
+};
+      
+/*---------------------------------------------------------------------------
+                     PRIVATE TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                           EXPORT FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                          INTERNAL FUNCTIONS
+  ---------------------------------------------------------------------------*/
+} /* end of namespace aq */
+} /* end of namespace occi */
+} /* end of namespace oracle */
+
+#endif                                              /* OCCIAQ_ORACLE */
+
+#endif                                              /* _olint */
diff --git a/src/terralib/drivers/Oracle/OCI/include/occiCommon.h b/src/terralib/drivers/Oracle/OCI/include/occiCommon.h
new file mode 100644
index 0000000..0813cf8
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/occiCommon.h
@@ -0,0 +1,872 @@
+/* Copyright (c) 2000, 2003, Oracle Corporation.  All rights reserved.  */
+ 
+/* 
+   NAME 
+     occiCommon.h - header file for doing forward references
+
+   DESCRIPTION 
+     Just declare all the classes
+
+   RELATED DOCUMENTS 
+     <note any documents related to this facility>
+ 
+   EXPORT FUNCTION(S) 
+     <external functions declared for use outside package - one-line 
+      descriptions>
+
+   INTERNAL FUNCTION(S)
+     <other external functions declared - one-line descriptions>
+
+   EXAMPLES
+
+   NOTES
+     <other useful comments, qualifications, etc.>
+
+   MODIFIED   (MM/DD/YY)
+   cparampa    09/03/03 - Added NotifyResult
+   rvallam     02/12/03 - modified BFloat/BDouble interface - BFloat/BDouble
+                          type is now a struct  
+   shiyer      01/02/03 - add setVector(vector<UString>,string schema/type)
+   rvallam     11/19/02 - added objects support for interval classes
+   cparampa    12/11/02 - removed declaration for Payload
+   srseshad    11/14/02 - Add OCCIIBFLOAT/OCCIIBDOUBLE
+   cparampa    10/17/02 - prototypes for getVectorOf BDouble and BFloat taking
+                          anydata.
+   cparampa    10/09/02 - Declarations for AQ classes
+   rvallam     10/12/02 - added new method for array pin - pinVectorOfRefs
+   rvallam     10/10/02 - objects performance enhancement - modified
+                          getObject and getVector<T *> to take the
+                          schName and typeName of the object
+   rvallam     10/11/02 - added native float/double API - get(set)vector
+                          methods, added the enum values for BFLOAT and
+                          BDOUBLE and typecodes for the same
+   shiyer      07/31/02 - 10iR1, OCCI Globalization support
+   cparampa    08/27/02 - Added forward reference for StatelessConnnectionPool
+                          and StatelessConnectionPoolImpl  
+   vvinay      06/25/02 - fix #2415021:const of string changed
+   aahluwal    06/03/02 - bug 2360115
+   gayyappa    12/27/01 - fix bug 2073482 - remove include <map> 
+   gayyappa    10/29/01 - removed CharSet - bug 1853748 
+   gayyappa    09/21/01 - #include <map>
+   rratnam     06/18/01 - fixed bug1777042 -- HP support for "std"
+   rvallam     06/11/01 - fixed NT porting problem with template functions-
+                          added generic method get(set)VectorOfRefs
+   rratnam     04/25/01 - fixed NT porting bug1673780
+   rvallam     04/12/01 - added dummy parameter in getVector of AnyData
+                          for PObject *
+   rratnam     04/10/01 - removed references to wstring
+   rvallam     04/02/01 - fixed linux porting bug 1654670
+   gayyappa    03/29/01 - remove get/set vector methods for int/float/double/
+                          unsigned int for anydata.
+   rvallam     03/20/01 - added dummy parameter for Type in getVector for
+                          void * in statement and ResultSet
+                          added setVector of Ref<T> and Number prototype
+                          for statement
+   gayyappa    03/15/01 - added parameter to getvector on anydata with void*.
+   rratnam     03/13/01 - added virtual destructor to RefCounted
+   rkasamse    03/15/01 - add an arg, Type, to getVector of void*
+   rratnam     03/06/01 - removed references() from RefCounted
+   slari       02/15/01 - suppress lint warnings
+   rratnam     02/12/01 - removed #include <iostream.h>
+   rvallam     02/07/01 - added enum OCCI_MAX_PREFETCH_DEPTH
+   gayyappa    01/15/01 - change ub4 to unsigned int for
+                          get/set vector methods..
+   gayyappa    01/03/01 - put "using namespace std" in a ifndef
+   gayyappa    12/14/00 - add forward declaration for ResultSetImpl 
+                          and StatementImpl.
+                          Remove commented #defines
+   gayyappa    11/17/00 - change Session to Connection
+   gayyappa    09/12/00 - remove OCCI_SQLT_INT, OCCI_SQLT_FLT 
+                          remove OCCIUNSIGNED_CHAR, OCCISHORT, 
+                          OCCIUNSIGNED_SHORT, OCCILONG ,OCCI_LONGDOUBLE,
+                          OCCI_UNSIGNEDLONG  from enum Type.
+   gayyappa    08/25/00 - add const to get/set vector mthds of anydata.
+   rvallam     08/10/00 - updated Type enum
+   slari       08/04/00 - add OCCIROWID and OCCICURSOR
+   rkasamse    08/04/00 - add setVector methods
+   slari       07/24/00 - add BytesImpl
+   rratnam     07/25/00 - Added forward declarations for LobStreamImpl,
+                          ConnectionPool[Impl], removed those for
+                          Connection[Impl]
+   rkasamse    07/28/00 - add getVector(ResultSet*...) methods
+   rratnam     06/14/00 - Added forward declaration for RefImpl,
+                          added DefaultCharSet to the CharSet 
+                          enum
+   rratnam     06/13/00 - Added DefaultCharSet to the CharSet enum
+   kmohan      05/31/00 - RefCounted no more templated
+   rratnam     22/05/00 - Added forward declaration of ConnectionImpl, and the
+                         LobOpenMode enum
+   kmohan      05/05/00 - Added global routine prototypes
+   rkasamse    05/23/00 -
+   slari       04/28/00 - add forward declaration of SQLExceptionImpl
+   kmohan      04/19/00 - Added enums Type,CharSet,CharSetForm
+   gayyappa    04/18/00 - removed checkStatus. added checkOCICall and 
+                          createSQLEXception functions 
+   kmohan      04/11/00 - Creation
+
+*/
+
+
+#ifndef OCCICOMMON_ORACLE
+# define OCCICOMMON_ORACLE
+
+#ifndef _olint
+
+#ifndef OCI_ORACLE
+#include <oci.h>
+#endif
+
+#ifndef ORASTRINGSTL
+#define ORASTRINGSTL
+#include <string>
+#endif
+
+#ifndef ORAVECTORSTL
+#include <vector>
+#define ORAVECTORSTL
+#endif
+
+#ifndef ORALISTSTL
+#include <list>
+#define ORALISTSTL
+#endif
+
+#define OCCI_STD_NAMESPACE std
+#define OCCI_HAVE_STD_NAMESPACE 1
+
+namespace oracle {
+namespace occi {
+
+//UString is the class for UTF16 characterset
+typedef OCCI_STD_NAMESPACE::basic_string<utext> UString;
+
+class Environment;
+class EnvironmentImpl;
+class Connection;
+class ConnectionImpl;
+class ConnectionPool;
+class ConnectionPoolImpl;
+class StatelessConnectionPool;
+class StatelessConnectionPoolImpl;
+class Statement;
+class StatementImpl;
+class ResultSet;
+class ResultSetImpl;
+class SQLException;
+class SQLExceptionImpl;
+class Stream;
+class PObject;
+class Number;
+class Bytes;
+class BytesImpl;
+class Date;
+class Timestamp;
+
+class MetaData;
+class MetaDataImpl;
+template <class T> class Ref;
+class RefImpl;
+class RefAny;
+class Blob;
+class Bfile;
+class Clob;
+class LobStreamImpl;
+class AnyData;
+class AnyDataImpl;
+class Map;
+class IntervalDS;
+class IntervalYM;
+
+namespace aq {
+class Message;
+class MessageImpl;
+class Agent;
+class AgentImpl;
+class Producer;
+class ProducerImpl;
+class Consumer;
+class ConsumerImpl;
+class Listener;
+class Subscription;
+class SubscriptionImpl;
+class NotifyResult;
+}
+
+typedef struct BFloat BFloat;
+typedef struct BDouble BDouble;
+
+/*---------------------------------------------------------------------------
+                           ENUMERATORS
+  ---------------------------------------------------------------------------*/
+enum Type
+{
+ OCCI_SQLT_CHR=SQLT_CHR,
+ OCCI_SQLT_NUM=SQLT_NUM,
+ OCCIINT = SQLT_INT,
+ OCCIFLOAT = SQLT_FLT,
+ OCCIBFLOAT = SQLT_BFLOAT,
+ OCCIBDOUBLE = SQLT_BDOUBLE,
+ OCCIIBFLOAT = SQLT_IBFLOAT,
+ OCCIIBDOUBLE = SQLT_IBDOUBLE,
+ OCCI_SQLT_STR=SQLT_STR,
+ OCCI_SQLT_VNU=SQLT_VNU,
+ OCCI_SQLT_PDN=SQLT_PDN,
+ OCCI_SQLT_LNG=SQLT_LNG,
+ OCCI_SQLT_VCS=SQLT_VCS,
+ OCCI_SQLT_NON=SQLT_NON,
+ OCCI_SQLT_RID=SQLT_RID,
+ OCCI_SQLT_DAT=SQLT_DAT,
+ OCCI_SQLT_VBI=SQLT_VBI,
+ OCCI_SQLT_BIN=SQLT_BIN,
+ OCCI_SQLT_LBI=SQLT_LBI,
+ OCCIUNSIGNED_INT = SQLT_UIN,
+ OCCI_SQLT_SLS=SQLT_SLS,
+ OCCI_SQLT_LVC=SQLT_LVC,
+ OCCI_SQLT_LVB=SQLT_LVB,
+ OCCI_SQLT_AFC=SQLT_AFC,
+ OCCI_SQLT_AVC=SQLT_AVC,
+ OCCI_SQLT_CUR=SQLT_CUR,
+ OCCI_SQLT_RDD=SQLT_RDD,
+ OCCI_SQLT_LAB=SQLT_LAB,
+ OCCI_SQLT_OSL=SQLT_OSL,
+ OCCI_SQLT_NTY=SQLT_NTY,
+ OCCI_SQLT_REF=SQLT_REF,
+ OCCI_SQLT_CLOB=SQLT_CLOB,
+ OCCI_SQLT_BLOB=SQLT_BLOB,
+ OCCI_SQLT_BFILEE=SQLT_BFILEE,
+ OCCI_SQLT_CFILEE=SQLT_CFILEE,
+ OCCI_SQLT_RSET=SQLT_RSET,
+ OCCI_SQLT_NCO=SQLT_NCO,
+ OCCI_SQLT_VST=SQLT_VST,
+ OCCI_SQLT_ODT=SQLT_ODT,
+ OCCI_SQLT_DATE=SQLT_DATE,
+ OCCI_SQLT_TIME=SQLT_TIME,
+ OCCI_SQLT_TIME_TZ=SQLT_TIME_TZ,
+ OCCI_SQLT_TIMESTAMP=SQLT_TIMESTAMP,
+ OCCI_SQLT_TIMESTAMP_TZ=SQLT_TIMESTAMP_TZ,
+ OCCI_SQLT_INTERVAL_YM=SQLT_INTERVAL_YM,
+ OCCI_SQLT_INTERVAL_DS=SQLT_INTERVAL_DS,
+ OCCI_SQLT_TIMESTAMP_LTZ=SQLT_TIMESTAMP_LTZ,
+ OCCI_SQLT_FILE=SQLT_FILE,
+ OCCI_SQLT_CFILE=SQLT_CFILE,
+ OCCI_SQLT_BFILE=SQLT_BFILE,
+ 
+ OCCICHAR = 32 *1024,
+ OCCIDOUBLE,
+ OCCIBOOL,
+ OCCIANYDATA ,
+ OCCINUMBER,
+ OCCIBLOB,
+ OCCIBFILE,
+ OCCIBYTES,
+ OCCICLOB ,
+ OCCIVECTOR,
+ OCCIMETADATA,
+ OCCIPOBJECT,
+ OCCIREF ,
+ OCCIREFANY,
+ OCCISTRING  ,
+ OCCISTREAM  ,
+ OCCIDATE  ,
+ OCCIINTERVALDS  ,
+ OCCIINTERVALYM  ,
+ OCCITIMESTAMP,
+ OCCIROWID,
+ OCCICURSOR
+
+
+};
+
+enum LockOptions {OCCI_LOCK_NONE = OCI_LOCK_NONE,
+                      OCCI_LOCK_X = OCI_LOCK_X, 
+                      OCCI_LOCK_X_NOWAIT = OCI_LOCK_X_NOWAIT
+                     };
+
+enum {OCCI_MAX_PREFETCH_DEPTH = UB4MAXVAL};
+
+enum TypeCode
+{
+
+OCCI_TYPECODE_REF = OCI_TYPECODE_REF,
+OCCI_TYPECODE_DATE = OCI_TYPECODE_DATE,
+OCCI_TYPECODE_REAL = OCI_TYPECODE_REAL,
+OCCI_TYPECODE_DOUBLE = OCI_TYPECODE_DOUBLE,
+OCCI_TYPECODE_BDOUBLE = OCI_TYPECODE_BDOUBLE,
+OCCI_TYPECODE_FLOAT = OCI_TYPECODE_FLOAT,
+OCCI_TYPECODE_BFLOAT = OCI_TYPECODE_BFLOAT,
+OCCI_TYPECODE_NUMBER = OCI_TYPECODE_NUMBER,
+OCCI_TYPECODE_DECIMAL = OCI_TYPECODE_DECIMAL,
+OCCI_TYPECODE_OCTET = OCI_TYPECODE_OCTET,
+OCCI_TYPECODE_INTEGER = OCI_TYPECODE_INTEGER,
+OCCI_TYPECODE_SMALLINT= OCI_TYPECODE_SMALLINT,
+OCCI_TYPECODE_RAW = OCI_TYPECODE_RAW,
+OCCI_TYPECODE_VARCHAR2 = OCI_TYPECODE_VARCHAR2,
+OCCI_TYPECODE_VARCHAR = OCI_TYPECODE_VARCHAR,
+OCCI_TYPECODE_CHAR = OCI_TYPECODE_CHAR,
+OCCI_TYPECODE_VARRAY= OCI_TYPECODE_VARRAY,
+OCCI_TYPECODE_TABLE = OCI_TYPECODE_TABLE,
+OCCI_TYPECODE_CLOB = OCI_TYPECODE_CLOB,
+OCCI_TYPECODE_BLOB = OCI_TYPECODE_BLOB,
+OCCI_TYPECODE_BFILE = OCI_TYPECODE_BFILE,
+OCCI_TYPECODE_OBJECT = OCI_TYPECODE_OBJECT,
+OCCI_TYPECODE_NAMEDCOLLECTION = OCI_TYPECODE_NAMEDCOLLECTION
+};
+
+enum CharSetForm
+{
+  OCCI_SQLCS_IMPLICIT = SQLCS_IMPLICIT // use local db char set
+ ,OCCI_SQLCS_NCHAR = SQLCS_NCHAR // use local db nchar set
+ ,OCCI_SQLCS_EXPLICIT = SQLCS_EXPLICIT // char set explicitly specified
+ ,OCCI_SQLCS_FLEXIBLE = SQLCS_FLEXIBLE // pl/sql flexible parameter
+};
+
+enum LobOpenMode
+{ OCCI_LOB_READONLY = OCI_LOB_READONLY
+ ,OCCI_LOB_READWRITE = OCI_LOB_READWRITE
+};
+
+class RefCounted {
+public:
+    RefCounted();
+    virtual ~RefCounted(){} 
+    const RefCounted * newRef() const;
+    void deleteRef() const;
+
+private:
+
+    void onZeroReferences();
+    unsigned long references_;
+  };
+
+template <class T> 
+class ConstPtr
+{
+
+public:
+
+ConstPtr( const T* ptr = 0 );
+ConstPtr( const ConstPtr<T>& mp );
+~ConstPtr();
+const T * operator->() const;
+const T* rawPtr() const;
+
+#ifdef MEMBER_TEMPLATE
+template<class OtherType> operator ConstPtr<OtherType>();
+#endif
+
+protected:
+
+void operator=( const ConstPtr<T>& mp );
+const T* rawPtr_;
+
+};
+
+template <class T>
+class Ptr : public ConstPtr<T> {
+
+public:
+
+Ptr( T* ptr = 0 );
+Ptr( const Ptr<T>& mp );
+void operator=( const Ptr<T>& mp );
+const T * operator->() const;
+T * operator->();
+T* rawPtr() ;
+const T* rawPtr() const;
+
+
+
+#ifdef MEMBER_TEMPLATE
+  template<class OtherType>
+  operator Ptr<OtherType>();
+#endif
+
+};
+
+/*---------------------------------------------------------------------------
+                           EXPORT FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+  void getVector(const AnyData &any, 
+  OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect);
+  void getVector(const AnyData &any,
+  OCCI_STD_NAMESPACE::vector<UString> &vect);
+  void getVector( const AnyData &any,
+  OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
+  void getVector( const AnyData &any,
+  OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
+  void getVector( const AnyData &any, 
+  OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
+  void getVector( const AnyData &any, 
+  OCCI_STD_NAMESPACE::vector<Number> &vect) ;
+  void getVector( const AnyData &any,
+  OCCI_STD_NAMESPACE::vector<BFloat> &vect);
+  void getVector(const AnyData &any,
+  OCCI_STD_NAMESPACE::vector<BDouble> &vect);
+  void getVector( const AnyData &any, 
+  OCCI_STD_NAMESPACE::vector<Bytes> &vect) ;
+  void getVector( const AnyData &any, 
+  OCCI_STD_NAMESPACE::vector<Date> &vect) ;
+  void getVector( const AnyData &any, 
+  OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
+  void getVector( const AnyData &any,
+  OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
+  void getVector( const AnyData &any,
+  OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
+  template <class T>
+  void getVectorOfRefs( const AnyData &any, 
+  OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
+  #ifndef WIN32COMMON
+  template <class T>
+  void getVector(const AnyData &any,
+  OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
+  #endif
+  #ifdef WIN32COMMON
+  template <class T>
+  void getVector(const AnyData &any,
+  OCCI_STD_NAMESPACE::vector<T> &vect,
+  void *(*rSQL)(void *));
+  #else
+  template <class T>
+  void getVector(const AnyData &any,
+  OCCI_STD_NAMESPACE::vector<T *> &vect,
+  void *(*rSQL)(void *));
+  #endif
+
+  void setVector( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect) ;
+  void setVector( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector<UString> &vect) ;
+  void setVector( AnyData &any,
+  const OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
+  void setVector( AnyData &any,
+  const OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
+  void setVector( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
+  void setVector( AnyData &any,
+  const OCCI_STD_NAMESPACE::vector<BFloat> &vect) ;
+  void setVector( AnyData &any,
+  const OCCI_STD_NAMESPACE::vector<BDouble> &vect) ;
+  void setVector( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector<Number> &vect) ;
+  void setVector( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector<Bytes> &vect) ;
+  void setVector( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector<Date> &vect) ;
+  void setVector( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
+  void setVector( AnyData &any,
+  const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
+  void setVector( AnyData &any,
+  const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
+  template <class T>
+  void setVectorOfRefs( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
+  #ifndef WIN32COMMON
+  template <class T>
+  void setVector( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
+  #endif
+  #ifdef WIN32COMMON
+  template <class T>
+  void setVector( AnyData &any,
+  const OCCI_STD_NAMESPACE::vector< T > &vect) ;
+  #else
+  template <class T>
+  void setVector( AnyData &any,
+  const OCCI_STD_NAMESPACE::vector< T* > &vect) ;
+  #endif
+
+  void getVector( ResultSet *rs, unsigned int index, 
+  OCCI_STD_NAMESPACE::vector<int> &vect) ;
+  void getVector( ResultSet *rs, unsigned int index, 
+  OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect) ;
+  void getVector( ResultSet *rs, unsigned int index, 
+  OCCI_STD_NAMESPACE::vector<UString> &vect) ;//UTF16 support
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<unsigned int> &vect) ;
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<float> &vect); 
+  void getVector(ResultSet  *rs, unsigned int,
+  OCCI_STD_NAMESPACE::vector<BFloat> &vect);
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<double> &vect);
+  void getVector(ResultSet  *rs, unsigned int,
+  OCCI_STD_NAMESPACE::vector<BDouble> &vect);
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Date> &vect) ;
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Number> &vect) ;
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
+  void getVector(ResultSet  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
+  template <class T>
+  void getVectorOfRefs(ResultSet  *rs, unsigned int,
+  OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
+  #ifndef WIN32COMMON
+  template <class T>
+  void getVector(ResultSet  *rs, unsigned int,
+  OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
+  #endif
+  #ifdef WIN32COMMON
+  template <class T>
+  void getVector( ResultSet *rs, unsigned int index,
+  OCCI_STD_NAMESPACE::vector< T > &vect) ;
+  #else
+  template <class T>
+  void getVector( ResultSet *rs, unsigned int index,
+  OCCI_STD_NAMESPACE::vector< T* > &vect) ;
+  #endif
+
+
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Number> &vect) ;
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
+  void getVector( Statement *rs, unsigned int index, 
+  OCCI_STD_NAMESPACE::vector<int> &vect) ;
+  void getVector( Statement *rs, unsigned int index,
+  OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect) ;
+  void getVector( Statement *rs, unsigned int index,
+  OCCI_STD_NAMESPACE::vector<UString> &vect) ;//UTF16 support
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<unsigned int> &vect) ;
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<float> &vect) ;
+  void getVector(Statement  *rs, unsigned int,
+  OCCI_STD_NAMESPACE::vector<BFloat> &vect) ;
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<double> &vect) ;
+  void getVector(Statement  *rs, unsigned int,
+  OCCI_STD_NAMESPACE::vector<BDouble> &vect) ;
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Date> &vect) ;
+  void getVector(Statement  *rs, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
+  template <class T>
+  void getVectorOfRefs(Statement  *rs, unsigned int,
+  OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
+  #ifndef WIN32COMMON
+  template <class T>
+  void getVector(Statement  *rs, unsigned int,
+  OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
+  #endif
+  #ifdef WIN32COMMON
+  template <class T>
+  void getVector( Statement *rs, unsigned int index,
+  OCCI_STD_NAMESPACE::vector< T > &vect) ;
+  #else
+  template <class T>
+  void getVector( Statement *rs, unsigned int index,
+  OCCI_STD_NAMESPACE::vector< T* > &vect) ;
+  #endif
+
+
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<int> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<unsigned int> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<double> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex,
+                 const OCCI_STD_NAMESPACE::vector<BDouble> &vect,
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<float> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex,
+                 const OCCI_STD_NAMESPACE::vector<BFloat> &vect,
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex,
+                 const OCCI_STD_NAMESPACE::vector<Number> &vect,
+                 const OCCI_STD_NAMESPACE::string &sqltype);
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+         const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect,
+         const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<RefAny> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Blob> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Clob> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Bfile> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Timestamp> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Date> &vect, 
+                 const OCCI_STD_NAMESPACE::string &sqltype) ;
+  template  <class T>
+  void setVectorOfRefs(Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
+  const OCCI_STD_NAMESPACE::string &sqltype) ;
+  #ifndef WIN32COMMON
+  template  <class T>
+  void setVector(Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
+  const OCCI_STD_NAMESPACE::string &sqltype) ;
+  #endif
+  #ifdef WIN32COMMON
+  template <class T>
+  void setVector( Statement *stmt, unsigned int paramIndex, 
+                  const OCCI_STD_NAMESPACE::vector< T > &vect, 
+                  const OCCI_STD_NAMESPACE::string   &sqltype) ;
+  #else
+  template <class T>
+  void setVector( Statement *stmt, unsigned int paramIndex,
+                  const OCCI_STD_NAMESPACE::vector<T* > &vect, 
+                  const OCCI_STD_NAMESPACE::string &sqltype) ;
+  #endif
+
+/* -----------------------------------------------------------------------------------
+   Statement setVector functions, schema & type separate arguments - multibyte support
+   -----------------------------------------------------------------------------------
+*/
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<int> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<unsigned int> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<double> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex,
+                 const OCCI_STD_NAMESPACE::vector<BDouble> &vect,
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<float> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex,
+                 const OCCI_STD_NAMESPACE::vector<BFloat> &vect,
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex,
+                 const OCCI_STD_NAMESPACE::vector<Number> &vect,
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName);
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+         const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect,
+         const OCCI_STD_NAMESPACE::string &schemaName,
+         const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<RefAny> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Blob> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Clob> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Bfile> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Timestamp> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Date> &vect, 
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  template  <class T>
+  void setVectorOfRefs(Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
+  const OCCI_STD_NAMESPACE::string &schemaName,
+  const OCCI_STD_NAMESPACE::string &typeName) ;
+
+  #ifndef WIN32COMMON
+  template  <class T>
+  void setVector(Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
+  const OCCI_STD_NAMESPACE::string &schemaName,
+  const OCCI_STD_NAMESPACE::string &typeName) ;
+  #endif
+
+  #ifdef WIN32COMMON
+  template <class T>
+  void setVector( Statement *stmt, unsigned int paramIndex, 
+                  const OCCI_STD_NAMESPACE::vector< T > &vect, 
+                  const OCCI_STD_NAMESPACE::string &schemaName,
+                  const OCCI_STD_NAMESPACE::string &typeName) ;
+  #else
+  template <class T>
+  void setVector( Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<T* > &vect, const OCCI_STD_NAMESPACE::string
+  &schemaName, const OCCI_STD_NAMESPACE::string &typeName) ;
+  #endif
+
+/*-------------------------------------------------------------------------
+  Statement setVector function - UTF16 support
+  -------------------------------------------------------------------------
+*/
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<int> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<unsigned int> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<double> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex,
+                 const OCCI_STD_NAMESPACE::vector<BDouble> &vect,
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<float> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex,
+                 const OCCI_STD_NAMESPACE::vector<BFloat> &vect,
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex,
+                 const OCCI_STD_NAMESPACE::vector<Number> &vect,
+                 const UString &schemaName,
+                 const UString &typeName);
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<UString> &vect,
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<UString> &vect,
+                 const OCCI_STD_NAMESPACE::string &schemaName,
+                 const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<RefAny> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Blob> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Clob> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Bfile> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Timestamp> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  void setVector(Statement *stmt, unsigned int paramIndex, 
+                 const OCCI_STD_NAMESPACE::vector<Date> &vect, 
+                 const UString &schemaName,
+                 const UString &typeName) ;
+  template  <class T>
+  void setVectorOfRefs(Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
+  const UString &schemaName,
+  const UString &typeName) ;
+
+  #ifndef WIN32COMMON
+  template  <class T>
+  void setVector(Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
+  const UString &schemaName,
+  const UString &typeName) ;
+  #endif
+
+  #ifdef WIN32COMMON
+  template <class T>
+  void setVector( Statement *stmt, unsigned int paramIndex, 
+                  const OCCI_STD_NAMESPACE::vector< T > &vect, 
+                  const UString &schemaName,
+                  const UString &typeName) ;
+  #else
+  template <class T>
+  void setVector( Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<T* > &vect, const UString
+  &schemaName, const UString &typeName) ;
+  #endif
+
+
+/* Global method for array pins */
+template <class T>
+void pinVectorOfRefs( const Connection *conn,
+OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
+OCCI_STD_NAMESPACE::vector<T* > &vectObj, 
+LockOptions lockOpt = OCCI_LOCK_NONE );
+
+template <class T>
+void pinVectorOfRefs( const Connection *conn,
+OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
+LockOptions lockOpt = OCCI_LOCK_NONE );
+
+/*---------------------------------------------------------------------------
+                          INTERNAL FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+} /* end of namespace occi */
+} /* end of namespace oracle */
+#endif /* _olint */
+
+#endif                                              /* OCCICOMMON_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/occiControl.h b/src/terralib/drivers/Oracle/OCI/include/occiControl.h
new file mode 100644
index 0000000..433b9b3
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/occiControl.h
@@ -0,0 +1,2060 @@
+/* Copyright  Oracle Corporation 2000, 2001. All Rights Reserved. */ 
+ 
+/* 
+   NAME 
+     occiControl.h - header file for OCCI control classes
+
+   DESCRIPTION 
+     Class definitions for MetaData,SQLException,Environment,
+     Connection,Statement, ConnectionPool, StatelessConnectionPool
+
+   RELATED DOCUMENTS 
+     <note any documents related to this facility>
+ 
+   EXPORT FUNCTION(S) 
+     <external functions declared for use outside package - one-line 
+     descriptions>
+
+   INTERNAL FUNCTION(S)
+     <other external functions declared - one-line descriptions>
+
+   EXAMPLES
+
+   NOTES
+     <other useful comments, qualifications, etc.>
+
+   MODIFIED   (MM/DD/YY)
+   rvadraha    09/30/03 - New Binary/CharacterStreamMode for Statement class
+   rvallam     02/12/03 - modify BFloat/BDouble interface to use the new 
+                          BFloat/BDouble type 
+   shiyer      01/21/03 - add getPoolNameUString to ConnectionPool
+   shiyer      12/19/02 - Add cache sorted flush get/set to Environment
+   shiyer      12/31/02 - added OCI_ATTR_CHAR_SIZE to typeattr attrs
+   shiyer      12/09/02 - ensure new virtual interfaces are in order
+   cparampa    10/12/02 - AQ Additions
+   rvallam     10/12/02 - added  new methods for array pin 
+   shiyer      10/09/02 - Statement caching, Stateless Connection
+                          Pooling - UTF16 support. Added NLS versions
+                          of getErrorMessage in SQLException
+   rvallam     10/11/02 - added native float/double API - get(set) methods
+                          for Statement and ResultSet class
+   cparampa    09/23/02 - added methods for statement caching
+   shiyer      10/01/02 - setVector versions for Windows
+   shiyer      07/31/02 - 10iR1, OCCI Globalization support
+   cparampa    09/23/02 - added methods for statement caching 
+   praghuna    09/23/02 - 2333038:Fwd merge to 10i/MAIN 
+   cparampa    08/26/02 - added class StatelessConnectionPool
+                          added create/terminateStatelessConnnectionPool in Env 
+   vvinay      08/06/02 - XA additions
+   vvinay      06/25/02 - fix #2415021: math moved to occiHeapAlloc.h
+   aahluwal    06/04/02 - bug 2360115
+   vvinay      02/21/02 - operator= added for SQLException
+   gayyappa    12/27/01 - add set/getDatabaseNCharParam 
+   gayyappa    11/22/01 - modify interface to use strings for CharSet
+   gayyappa    10/01/01 - call reserve() on vector in set/getVector 
+   rkasamse    07/30/01 - 
+   rkasamse    07/26/01 - add env handle attrs - cache max/opt size
+   rvallam     07/23/01 - bug 1891228 - added throw() in destructor
+                          of SQLException
+   rvallam     06/14/01 - replace call to get(set)VectorOfRefs in 
+                          get(set)Vector for Ref<T> with code in 
+                          get(set)VectorOfRefs
+   rvallam     11/06/01 - renamed internal methods in get/setVector to
+                          get(set)VectorOfPObjects/get(set)VectorOfOCIRefs
+                          as part of NT porting fix
+                          added destructors to SQLException and MetaData
+   rvallam     05/03/01 - added const to the vector parameter in setVector
+                          of Statement for Ref<T>
+   rratnam     04/10/01 - removed references to wstring
+   kmohan      04/04/01 - include math.h for WIN32COMMON
+   rvallam     04/02/01 - fixed linux porting bug 1654670
+   gayyappa    03/27/01 - add code for templated getVector on stmt for objects.
+   rvallam     03/20/01 - passed dummy parameter for Type in getVector for
+                          void * in statement and ResultSet
+   rratnam     03/15/01 - fixed set and getRef / get and setVector for NULL 
+                          Refs
+   rkasamse    03/19/01 - 1676579: HP compilation errors
+   rratnam     03/07/01 - derived SQLException from exception, added what()
+   chliang     03/05/01 - disable olint
+   rvallam     02/23/01 - made getReadSQL/getWriteSQL methods const
+   rratnam     01/29/01 - add closeStream() to Statement/ResultSet 
+   rvallam     01/30/01 - added private method getListType() to
+                          MetaData
+   rratnam     01/03/01 - removed preTruncationLength() and isTruncated(),
+                          added setBinary/CharacterStreamMode()
+   rratnam     01/03/01 - added new method setErrorOnBusy in ConnectionPool 
+   rratnam     12/29/00 - added a createProxyConnection without roles
+   gayyappa    12/14/00 - add virtual functions getStatement/getConnection
+                          to resultset and statement (fix bug# 1529888)
+   gayyappa    12/13/00 - remove setErrorOnTruncate from Statement/resultset.
+   rvallam     11/30/00 - removed #define NEVER
+   gayyappa    11/17/00 - split get method in Map to getReadSQL
+                          and getWriteSQL    
+   rvallam     10/20/00 - modify cacheflush() to flushCache()
+                          added enums to MetaData
+   rvallam     09/14/00 - uncomment result set getMetaData method
+                          rename it to getColumnListMetaData.
+                          add get/set interval methods to stmt.
+                          add getinterval methods to resultset.
+   gayyappa    08/30/00 - added virtual destructor to occiconnection.
+                          add default values to registerOutParam in
+                          occistatement.
+                          removed get/set vector and anydata in statement.
+                          removed Stream header in ifdef directive.
+   rvallam     08/10/00 - uncomment gets(), update occiConnection, update
+                          Stream
+   slari       08/06/00 - add statement stream methods
+   slari       08/04/00 - add Statement::getXXX methods
+   slari       08/02/00 - add Stream
+   rratnam     08/04/00 - put in connection-cloning, proxy connections
+   rvallam     08/04/00 - changed metadata header - method signatures
+   rkasamse    08/04/00 - add setObject,setRef methods on Statement
+   slari       07/27/00 - add Statement::setNull
+   slari       07/26/00 - disable getBytes
+   slari       07/25/00 - enable getBytes and getRowid
+   rratnam     07/25/00 - Conn Pooling changes - added ConnectionPool,
+                          Connection, removed Session
+                          modified Environment (made getOCIEnvironment(),
+                          getMap() and getMode() const,
+                          added create/terminateConnectionPool(),
+                          added userName and password to createConnection() )
+   rkasamse    07/26/00 - uncomment getObject methods
+   slari       07/10/00 - enable getString
+   slari       07/05/00 - add result set methods
+   rkasamse    07/17/00 - add get function to Map
+   rratnam     06/16/00 - updated Session::getMetaData() to take the
+                          parameter type
+   rvallam     06/13/00 - updated MetaData
+   rratnam     06/13/00 - added getRef() to Statement
+                           and ResultSet,
+                           made getOCIError(), getOCIEnvironment()
+                           and getOCIServiceContext() in
+                           Connection const
+   kmohan      05/31/00 - Datamember Session * changed to 
+                          SessionImpl *
+                          in the class MetaData
+                          change ORASTRINGSTL to ORASTRING
+   slari       05/26/00 - change ORAVECTOR to ORAVECTORSTL
+   slari       05/22/00 - add initial Statement class methods
+   slari       05/10/00 - enable Connection and Session methods
+   slari       04/21/00 - provide trivial implementation for 
+                          ~Connection
+   slari       04/17/00 - make Environment methods abstract
+   slari       04/13/00 - add Environment
+   gayyappa    04/18/00 - changed defn of SQLException
+   kmohan      04/11/00 - added class definitions
+   rkasamse    04/03/00 - header (interface) files for OCCI 
+                          control classes.
+   rkasamse    04/03/00 - Creation
+
+*/
+
+#ifndef _olint   /* disable olint check */
+
+#ifndef OCCICONTROL_ORACLE
+# define OCCICONTROL_ORACLE
+
+#ifndef OCCICOMMON_ORACLE
+#include <occiCommon.h>
+#endif
+
+#ifndef ORAEXCEPTION
+#define ORAEXCEPTION
+#include <exception>
+#endif
+
+namespace oracle {
+namespace occi {
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+class MetaData
+{
+  public :
+    
+      enum AttrId 
+      {ATTR_PTYPE = OCI_ATTR_PTYPE,
+      ATTR_TIMESTAMP = OCI_ATTR_TIMESTAMP, 
+      ATTR_OBJ_ID = OCI_ATTR_OBJ_ID,
+      ATTR_OBJ_NAME = OCI_ATTR_OBJ_NAME, 
+      ATTR_OBJ_SCHEMA = OCI_ATTR_OBJ_SCHEMA,
+      ATTR_OBJID = OCI_ATTR_OBJID,
+      ATTR_NUM_COLS = OCI_ATTR_NUM_COLS,
+      ATTR_LIST_COLUMNS = OCI_ATTR_LIST_COLUMNS,
+      ATTR_REF_TDO = OCI_ATTR_REF_TDO,
+      ATTR_IS_TEMPORARY = OCI_ATTR_IS_TEMPORARY,
+      ATTR_IS_TYPED = OCI_ATTR_IS_TYPED,
+      ATTR_DURATION = OCI_ATTR_DURATION,
+      ATTR_COLLECTION_ELEMENT = OCI_ATTR_COLLECTION_ELEMENT,
+      ATTR_RDBA = OCI_ATTR_RDBA,
+      ATTR_TABLESPACE = OCI_ATTR_TABLESPACE,
+      ATTR_CLUSTERED = OCI_ATTR_CLUSTERED,
+      ATTR_PARTITIONED = OCI_ATTR_PARTITIONED,
+      ATTR_INDEX_ONLY = OCI_ATTR_INDEX_ONLY,
+      ATTR_LIST_ARGUMENTS = OCI_ATTR_LIST_ARGUMENTS,
+      ATTR_IS_INVOKER_RIGHTS = OCI_ATTR_IS_INVOKER_RIGHTS,
+      ATTR_LIST_SUBPROGRAMS = OCI_ATTR_LIST_SUBPROGRAMS,
+      ATTR_NAME = OCI_ATTR_NAME,
+      ATTR_OVERLOAD_ID = OCI_ATTR_OVERLOAD_ID,
+      ATTR_TYPECODE = OCI_ATTR_TYPECODE,
+      ATTR_COLLECTION_TYPECODE = OCI_ATTR_COLLECTION_TYPECODE,
+      ATTR_VERSION = OCI_ATTR_VERSION,
+      ATTR_IS_INCOMPLETE_TYPE = OCI_ATTR_IS_INCOMPLETE_TYPE,
+      ATTR_IS_SYSTEM_TYPE = OCI_ATTR_IS_SYSTEM_TYPE,
+      ATTR_IS_PREDEFINED_TYPE = OCI_ATTR_IS_PREDEFINED_TYPE,
+      ATTR_IS_TRANSIENT_TYPE = OCI_ATTR_IS_TRANSIENT_TYPE,
+      ATTR_IS_SYSTEM_GENERATED_TYPE = 
+              OCI_ATTR_IS_SYSTEM_GENERATED_TYPE,
+      ATTR_HAS_NESTED_TABLE = OCI_ATTR_HAS_NESTED_TABLE,
+      ATTR_HAS_LOB = OCI_ATTR_HAS_LOB,
+      ATTR_HAS_FILE = OCI_ATTR_HAS_FILE,
+      ATTR_NUM_TYPE_ATTRS = OCI_ATTR_NUM_TYPE_ATTRS,
+      ATTR_LIST_TYPE_ATTRS = OCI_ATTR_LIST_TYPE_ATTRS,
+      ATTR_NUM_TYPE_METHODS = OCI_ATTR_NUM_TYPE_METHODS, 
+      ATTR_LIST_TYPE_METHODS = OCI_ATTR_LIST_TYPE_METHODS,
+      ATTR_MAP_METHOD = OCI_ATTR_MAP_METHOD,
+      ATTR_ORDER_METHOD = OCI_ATTR_ORDER_METHOD,
+      ATTR_DATA_SIZE = OCI_ATTR_DATA_SIZE,
+      ATTR_DATA_TYPE = OCI_ATTR_DATA_TYPE,
+      ATTR_PRECISION = OCI_ATTR_PRECISION,
+      ATTR_SCALE = OCI_ATTR_SCALE,
+      ATTR_TYPE_NAME = OCI_ATTR_TYPE_NAME,
+      ATTR_SCHEMA_NAME = OCI_ATTR_SCHEMA_NAME,
+      ATTR_CHARSET_ID = OCI_ATTR_CHARSET_ID,
+      ATTR_CHARSET_FORM = OCI_ATTR_CHARSET_FORM,
+      ATTR_ENCAPSULATION = OCI_ATTR_ENCAPSULATION,
+      ATTR_IS_CONSTRUCTOR = OCI_ATTR_IS_CONSTRUCTOR,
+      ATTR_IS_DESTRUCTOR = OCI_ATTR_IS_DESTRUCTOR,
+      ATTR_IS_OPERATOR = OCI_ATTR_IS_OPERATOR,
+      ATTR_IS_SELFISH = OCI_ATTR_IS_SELFISH,
+      ATTR_IS_MAP = OCI_ATTR_IS_MAP,
+      ATTR_IS_ORDER = OCI_ATTR_IS_ORDER,
+      ATTR_IS_RNDS = OCI_ATTR_IS_RNDS,
+      ATTR_IS_RNPS = OCI_ATTR_IS_RNPS,
+      ATTR_IS_WNDS = OCI_ATTR_IS_WNDS,
+      ATTR_IS_WNPS = OCI_ATTR_IS_WNPS,
+      ATTR_NUM_ELEMS = OCI_ATTR_NUM_ELEMS,
+      ATTR_LINK = OCI_ATTR_LINK,
+      ATTR_MIN = OCI_ATTR_MIN,
+      ATTR_MAX = OCI_ATTR_MAX,
+      ATTR_INCR = OCI_ATTR_INCR,
+      ATTR_CACHE = OCI_ATTR_CACHE,
+      ATTR_ORDER = OCI_ATTR_ORDER,
+      ATTR_HW_MARK  = OCI_ATTR_HW_MARK,
+      ATTR_IS_NULL = OCI_ATTR_IS_NULL,
+      ATTR_POSITION = OCI_ATTR_POSITION,
+      ATTR_HAS_DEFAULT =  OCI_ATTR_HAS_DEFAULT,
+      ATTR_LEVEL = OCI_ATTR_LEVEL,
+      ATTR_IOMODE = OCI_ATTR_IOMODE,
+      ATTR_RADIX = OCI_ATTR_RADIX,
+      ATTR_SUB_NAME = OCI_ATTR_SUB_NAME,
+      ATTR_LIST_OBJECTS = OCI_ATTR_LIST_OBJECTS,
+      ATTR_NCHARSET_ID = OCI_ATTR_NCHARSET_ID,
+      ATTR_LIST_SCHEMAS = OCI_ATTR_LIST_SCHEMAS,
+      ATTR_MAX_PROC_LEN = OCI_ATTR_MAX_PROC_LEN,
+      ATTR_MAX_COLUMN_LEN = OCI_ATTR_MAX_COLUMN_LEN,
+      ATTR_CURSOR_COMMIT_BEHAVIOR = 
+          OCI_ATTR_CURSOR_COMMIT_BEHAVIOR,
+      ATTR_MAX_CATALOG_NAMELEN = OCI_ATTR_MAX_CATALOG_NAMELEN,
+      ATTR_CATALOG_LOCATION = OCI_ATTR_CATALOG_LOCATION,
+      ATTR_SAVEPOINT_SUPPORT =  OCI_ATTR_SAVEPOINT_SUPPORT,
+      ATTR_NOWAIT_SUPPORT =  OCI_ATTR_NOWAIT_SUPPORT,
+      ATTR_AUTOCOMMIT_DDL =  OCI_ATTR_AUTOCOMMIT_DDL,
+      ATTR_LOCKING_MODE =  OCI_ATTR_LOCKING_MODE,
+      ATTR_IS_FINAL_TYPE = OCI_ATTR_IS_FINAL_TYPE,
+      ATTR_IS_INSTANTIABLE_TYPE = OCI_ATTR_IS_INSTANTIABLE_TYPE,
+      ATTR_IS_SUBTYPE = OCI_ATTR_IS_SUBTYPE,
+      ATTR_SUPERTYPE_SCHEMA_NAME = OCI_ATTR_SUPERTYPE_SCHEMA_NAME,
+      ATTR_SUPERTYPE_NAME = OCI_ATTR_SUPERTYPE_NAME,
+      ATTR_FSPRECISION = OCI_ATTR_FSPRECISION,
+      ATTR_LFPRECISION = OCI_ATTR_LFPRECISION,
+      ATTR_IS_FINAL_METHOD = OCI_ATTR_IS_FINAL_METHOD,
+      ATTR_IS_INSTANTIABLE_METHOD = OCI_ATTR_IS_INSTANTIABLE_METHOD,
+      ATTR_IS_OVERRIDING_METHOD = OCI_ATTR_IS_OVERRIDING_METHOD,
+      ATTR_CHAR_USED = OCI_ATTR_CHAR_USED,
+      ATTR_CHAR_SIZE = OCI_ATTR_CHAR_SIZE
+     };
+
+     enum ParamType
+         { 
+           PTYPE_TABLE = OCI_PTYPE_TABLE
+          ,PTYPE_VIEW = OCI_PTYPE_VIEW
+          ,PTYPE_PROC = OCI_PTYPE_PROC
+          ,PTYPE_FUNC = OCI_PTYPE_FUNC
+          ,PTYPE_PKG = OCI_PTYPE_PKG
+          ,PTYPE_TYPE = OCI_PTYPE_TYPE
+          ,PTYPE_TYPE_ATTR = OCI_PTYPE_TYPE_ATTR
+          ,PTYPE_TYPE_COLL = OCI_PTYPE_TYPE_COLL
+          ,PTYPE_TYPE_METHOD = OCI_PTYPE_TYPE_METHOD
+          ,PTYPE_SYN = OCI_PTYPE_SYN
+          ,PTYPE_SEQ = OCI_PTYPE_SEQ
+          ,PTYPE_COL = OCI_PTYPE_COL
+          ,PTYPE_ARG = OCI_PTYPE_ARG
+          ,PTYPE_TYPE_ARG = OCI_PTYPE_TYPE_ARG
+          ,PTYPE_TYPE_RESULT = OCI_PTYPE_TYPE_RESULT
+          ,PTYPE_SCHEMA = OCI_PTYPE_SCHEMA
+          ,PTYPE_DATABASE = OCI_PTYPE_DATABASE
+          ,PTYPE_UNK = OCI_PTYPE_UNK
+         };
+
+
+     enum { DURATION_SESSION = OCI_DURATION_SESSION
+          ,DURATION_TRANS = OCI_DURATION_TRANS
+          ,DURATION_NULL = OCI_DURATION_NULL
+          ,TYPEENCAP_PRIVATE = OCI_TYPEENCAP_PRIVATE
+          ,TYPEENCAP_PUBLIC = OCI_TYPEENCAP_PUBLIC
+          ,TYPEPARAM_IN = OCI_TYPEPARAM_IN
+          ,TYPEPARAM_OUT = OCI_TYPEPARAM_OUT
+          ,TYPEPARAM_INOUT = OCI_TYPEPARAM_INOUT
+          ,CURSOR_OPEN = OCI_CURSOR_OPEN
+          ,CURSOR_CLOSED = OCI_CURSOR_CLOSED
+          ,CL_START = OCI_CL_START
+          ,CL_END = OCI_CL_END
+          ,SP_SUPPORTED = OCI_SP_SUPPORTED
+          ,SP_UNSUPPORTED = OCI_SP_UNSUPPORTED
+          ,NW_SUPPORTED = OCI_NW_SUPPORTED
+          ,NW_UNSUPPORTED = OCI_NW_UNSUPPORTED
+          ,AC_DDL = OCI_AC_DDL
+          ,NO_AC_DDL = OCI_NO_AC_DDL
+          ,LOCK_IMMEDIATE = OCI_LOCK_IMMEDIATE
+          ,LOCK_DELAYED = OCI_LOCK_DELAYED  
+         }; 
+
+      MetaData(const MetaData &omd);
+      unsigned int getAttributeCount() const 
+      ;
+      AttrId getAttributeId(unsigned int attributenum) const 
+      ;
+      Type getAttributeType(unsigned int attributenum) const 
+      ;
+      int getInt(MetaData::AttrId attrid) const 
+      ;
+      bool getBoolean(MetaData::AttrId attrid) const 
+      ;
+      unsigned int getUInt(MetaData::AttrId attrid) const 
+      ;
+      OCCI_STD_NAMESPACE::string getString(MetaData::AttrId attrid) const 
+      ;
+      UString getUString(MetaData::AttrId attrid) const 
+      ;
+      Number getNumber(MetaData::AttrId attrid) const
+      ;
+      RefAny getRef(MetaData::AttrId attrid) const 
+      ;
+      Timestamp getTimestamp(MetaData::AttrId attrid) const 
+      ;
+      MetaData getMetaData(MetaData::AttrId attrid) const
+      ;
+      OCCI_STD_NAMESPACE::vector<MetaData> getVector(MetaData::AttrId attrid)
+      const ;
+      void  operator  =(const MetaData &omd);
+
+      ~MetaData();  
+     
+   private:
+
+  enum ociAttrType { OCI_UB1, 
+                         OCI_UB2, 
+                         OCI_UB4,
+                         OCI_SB1, 
+                         OCI_WORD,
+                         OCI_UB1_BOOL,     
+                         OCI_UB1PTR_TIMESTAMP,
+                         OCI_UB1PTR_NUMBER,
+                         OCI_TEXTPTR,
+                         OCI_DVOIDPTR_PARAM,
+                         OCI_DVOIDPTR_PARAMLIST,
+                         OCI_OCIREFPTR,
+                         OCI_OCIDURATION,
+                         OCI_OCITYPECODE,
+                         OCI_OCITYPEENCAP,
+                         OCI_OCITYPEPARAMMODE,
+                         OCI_OCIPRECISION
+                      };
+
+  enum AttrCount {COMMON_ATTR_COUNT = 5,
+        TABLE_ATTR_COUNT = 12,
+        VIEW_ATTR_COUNT = 7, 
+        FUNCPROC_ATTR_COUNT = 4,
+        PKG_ATTR_COUNT = 2,
+        TYP_ATTR_COUNT = 27, 
+        TYPEATTR_ATTR_COUNT = 14,
+        TYPEMTHD_ATTR_COUNT = 16,
+        COLL_ATTR_COUNT = 12,
+        SYN_ATTR_COUNT = 4,
+        SEQ_ATTR_COUNT = 7,
+        COL_ATTR_COUNT = 13,
+        ARG_TYPARG_TYPRES_ATTR_COUNT = 20, 
+        SCHEMA_ATTR_COUNT = 1,
+        DATABASE_ATTR_COUNT = 13,
+        UNK_ATTR_COUNT = 0
+        };
+
+  static const AttrId commonAttrId[COMMON_ATTR_COUNT];
+  static const ociAttrType commonAttrType[COMMON_ATTR_COUNT];
+  static const AttrId tableAttrId[TABLE_ATTR_COUNT];
+  static const ociAttrType tableAttrType[TABLE_ATTR_COUNT];
+  static const AttrId viewAttrId[VIEW_ATTR_COUNT];
+  static const ociAttrType viewAttrType[VIEW_ATTR_COUNT];
+  static const AttrId funcprocAttrId[FUNCPROC_ATTR_COUNT];
+  static const ociAttrType funcprocAttrType[FUNCPROC_ATTR_COUNT];
+  static const AttrId pkgAttrId[PKG_ATTR_COUNT];
+  static const ociAttrType pkgAttrType[PKG_ATTR_COUNT];
+  static const AttrId typAttrId[TYP_ATTR_COUNT];
+  static const ociAttrType typAttrType[TYP_ATTR_COUNT];
+  static const AttrId typeattrAttrId[TYPEATTR_ATTR_COUNT];
+  static const ociAttrType typeattrAttrType[TYPEATTR_ATTR_COUNT];
+  static const AttrId typmethdAttrId[TYPEMTHD_ATTR_COUNT];
+  static const ociAttrType typemthdAttrType[TYPEMTHD_ATTR_COUNT];
+  static const AttrId collAttrId[COLL_ATTR_COUNT];
+  static const ociAttrType collAttrType[COLL_ATTR_COUNT];
+  static const AttrId synAttrId[SYN_ATTR_COUNT];
+  static const ociAttrType synAttrType[SYN_ATTR_COUNT];
+  static const AttrId seqAttrId[SEQ_ATTR_COUNT];
+  static const ociAttrType seqAttrType[SEQ_ATTR_COUNT];
+  static const AttrId colAttrId[COL_ATTR_COUNT];
+  static const ociAttrType colAttrType[COL_ATTR_COUNT];
+  static const AttrId argtargtresAttrId[ARG_TYPARG_TYPRES_ATTR_COUNT];
+  static const ociAttrType argtargtresAttrType[
+                   ARG_TYPARG_TYPRES_ATTR_COUNT];
+  static const AttrId schemaAttrId[SCHEMA_ATTR_COUNT];
+  static const ociAttrType schemaAttrType[SCHEMA_ATTR_COUNT];
+  static const AttrId databaseAttrId[DATABASE_ATTR_COUNT];
+  static const ociAttrType databaseAttrType[DATABASE_ATTR_COUNT];
+
+  Ptr<MetaDataImpl> metaDataImplPtr;
+  const OCIParam* paramhp;
+  const ConnectionImpl* sesn;
+  const AttrId* attrIdArray;
+  const ociAttrType* attrTypeArray;
+  AttrCount attrCount;
+  
+  MetaData(const Connection *sessp, const OCCI_STD_NAMESPACE::string& objName,
+  ParamType prmtyp ) ;
+  MetaData(const Connection *sessp, const UString& objName,
+  ParamType prmtyp ) ;
+  MetaData(const Connection *sessp, 
+  const RefAny& ref) ;
+  MetaData(const Connection *sessp, MetaDataImpl *implPtr,
+  OCIParam* parm) ;
+  MetaData(const Connection *sessp, MetaDataImpl *implPtr,
+  OCIParam *parm, ub1 parmTyp) ;
+  ub1 getParamType(OCIParam* prm) const ;
+  const AttrId* getAttrIdArrayAddr(ub1 prmTyp) const;
+  const ociAttrType* getAttrTypeArrayAddr(ub1 prmTyp) const;
+  AttrCount getAttrCount(ub1 prmTyp) const; 
+  Type getType(ociAttrType typ) const;
+  bool isListTypeAttribute(AttrId attrid,ub1 ptyp) const;
+  boolean isInvalidAttrId(AttrId attrid,sb4* pos, 
+            boolean* isTypeSpecificAttrPtr) const;
+  ociAttrType getValidAttrType(sb4 index, boolean isTypeSpecificAttr)
+  const;
+
+  int getListType (const OCIParam *plist) const;
+  unsigned int getLowerBound(int ltype) const;
+  unsigned int getUpperBound(unsigned int ltype, 
+    unsigned int paramnum) const;
+  friend class ConnectionImpl;
+  friend class ResultSetImpl;
+
+};
+
+class Connection
+{
+   public :
+
+      // specifies the type of proxy to be created,
+      // used for future enhancements
+      enum ProxyType
+      {PROXY_DEFAULT
+      };
+
+      virtual ~Connection() { }
+      virtual Statement* createStatement(
+        const OCCI_STD_NAMESPACE::string  &sql = "") 
+         =0; 
+      virtual void terminateStatement(Statement *statement) =0;
+      virtual void commit()  =0; 
+      virtual void rollback()  =0;
+      virtual MetaData getMetaData(const OCCI_STD_NAMESPACE::string &object, 
+        MetaData::ParamType prmtyp 
+        = MetaData::PTYPE_UNK) const 
+         =0; 
+      virtual MetaData getMetaData(const RefAny &ref) const
+         =0; 
+      virtual OCCI_STD_NAMESPACE::string getClientCharSet() const 
+         =0; 
+      virtual OCCI_STD_NAMESPACE::string getClientNCHARCharSet() const 
+         =0; 
+      virtual void changePassword(const OCCI_STD_NAMESPACE::string &user,
+        const OCCI_STD_NAMESPACE::string &oldPassword,
+        const OCCI_STD_NAMESPACE::string &newPassword) 
+         =0; 
+      virtual void flushCache()  =0; 
+
+      virtual OCIServer*  getOCIServer() const =0;
+      virtual OCISvcCtx*  getOCIServiceContext() const =0;
+      virtual OCISession* getOCISession() const =0;
+
+      //new interfaces
+
+      virtual Statement* createStatement(const UString &sql) = 0;
+      virtual MetaData getMetaData(const UString &object, 
+        MetaData::ParamType prmtyp 
+        = MetaData::PTYPE_UNK) const 
+         =0; 
+      virtual UString getClientCharSetUString() const 
+         =0; 
+      virtual UString getClientNCHARCharSetUString() const 
+         =0; 
+      virtual void changePassword(const UString &user,
+        const UString &oldPassword,
+        const UString &newPassword) 
+         =0; 
+      virtual OCCI_STD_NAMESPACE::string getTag() const =0;
+      virtual void setStmtCacheSize(unsigned int cacheSize) = 0;
+      virtual unsigned int getStmtCacheSize() const =0;
+      virtual Statement* createStatement(const OCCI_STD_NAMESPACE::string &sql,
+                    const OCCI_STD_NAMESPACE::string &tag) = 0;
+      virtual void terminateStatement(Statement* stmt, 
+                    const OCCI_STD_NAMESPACE::string &tag) = 0;
+      virtual bool isCached(const OCCI_STD_NAMESPACE::string &sql,
+                    const OCCI_STD_NAMESPACE::string &tag = "") = 0;
+      virtual void registerSubscriptions(
+       const OCCI_STD_NAMESPACE::vector<aq::Subscription>& sub) =0;
+      virtual void unregisterSubscription(const aq::Subscription& sub) =0;
+      virtual void postToSubscriptions(
+       const OCCI_STD_NAMESPACE::vector<aq::Subscription>& sub) =0;
+      virtual Statement* createStatement(const UString &sql,
+                    const UString &tag) = 0;
+      virtual void terminateStatement(Statement* stmt, 
+                    const UString &tag) = 0;
+      virtual bool isCached(const UString &sql,
+                    const UString &tag) = 0;
+};
+
+class StatelessConnectionPool
+{
+  public :
+
+    enum PoolType
+    {
+      HETEROGENEOUS = OCI_DEFAULT,
+      HOMOGENEOUS = OCI_SPC_HOMOGENEOUS
+    };
+
+    enum BusyOption
+    {
+       WAIT = OCI_SPOOL_ATTRVAL_WAIT,
+       NOWAIT = OCI_SPOOL_ATTRVAL_NOWAIT,
+       FORCEGET = OCI_SPOOL_ATTRVAL_FORCEGET
+    };
+
+    enum DestroyMode
+    {
+       DEFAULT = OCI_DEFAULT,
+       SPD_FORCE = OCI_SPD_FORCE
+    };
+
+    virtual ~StatelessConnectionPool() {}
+    virtual unsigned int getBusyConnections() const =0;
+    virtual unsigned int getOpenConnections() const =0;
+    virtual unsigned int getMinConnections() const =0;
+    virtual unsigned int getMaxConnections() const =0;
+    virtual unsigned int getIncrConnections() const =0;
+    virtual OCCI_STD_NAMESPACE::string getPoolName() const =0;
+    virtual unsigned int getTimeOut() const =0;
+    virtual void setBusyOption(BusyOption busyOption) =0;
+    virtual BusyOption getBusyOption() const =0;
+    virtual void setTimeOut(unsigned int connTimeOut =0) =0;
+    virtual void setPoolSize(unsigned int maxConn =1,
+      unsigned int minConn =0, unsigned int incrConn =1) =0;
+    virtual Connection* getConnection( 
+      const OCCI_STD_NAMESPACE::string &tag ="") =0;
+    virtual Connection* getConnection(
+      const OCCI_STD_NAMESPACE::string &userName,
+      const OCCI_STD_NAMESPACE::string &password,
+      const OCCI_STD_NAMESPACE::string &tag = "") =0;
+    virtual Connection* getAnyTaggedConnection(
+      const OCCI_STD_NAMESPACE::string &tag = "") =0;
+    virtual Connection* getAnyTaggedConnection(
+      const OCCI_STD_NAMESPACE::string &userName,
+      const OCCI_STD_NAMESPACE::string &Password,
+      const OCCI_STD_NAMESPACE::string &tag = "") =0;
+    virtual Connection* getProxyConnection(
+      const OCCI_STD_NAMESPACE::string &name,
+      OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
+      const OCCI_STD_NAMESPACE::string &tag = "",
+      Connection::ProxyType proxyType = Connection::PROXY_DEFAULT) =0;
+    virtual Connection* getProxyConnection(
+      const OCCI_STD_NAMESPACE::string &name,
+      const OCCI_STD_NAMESPACE::string &tag = "" ,
+      Connection::ProxyType proxyType = Connection::PROXY_DEFAULT) =0;
+    virtual Connection* getAnyTaggedProxyConnection(
+      const OCCI_STD_NAMESPACE::string &name,
+      OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
+      const OCCI_STD_NAMESPACE::string &tag = "",
+      Connection::ProxyType proxyType = Connection::PROXY_DEFAULT) =0;
+    virtual Connection* getAnyTaggedProxyConnection(
+      const OCCI_STD_NAMESPACE::string &name,
+      const OCCI_STD_NAMESPACE::string &tag="",
+      Connection::ProxyType proxyType = Connection::PROXY_DEFAULT ) =0;
+    virtual void releaseConnection (Connection *connection,
+      const OCCI_STD_NAMESPACE::string &tag = "") =0;
+    virtual void terminateConnection (Connection *connection) =0;
+    virtual void setStmtCacheSize(unsigned int cacheSize) =0;
+    virtual unsigned int getStmtCacheSize() const =0;
+
+    virtual Connection* getConnection(const UString &tag)=0;
+    virtual Connection* getConnection(const UString &userName,
+      const UString &password,
+      const UString &tag)=0;
+    virtual Connection* getAnyTaggedConnection(const UString &tag)=0;
+    virtual Connection* getAnyTaggedConnection( const UString &userName,
+      const UString &Password, const UString &tag)=0 ;
+    virtual Connection* getProxyConnection(const UString &name,
+      OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
+      const UString &tag,
+      Connection::ProxyType proxyType = Connection::PROXY_DEFAULT)=0;
+    virtual Connection* getProxyConnection(const UString &name,
+      const UString &tag, Connection::ProxyType
+      proxyType = Connection::PROXY_DEFAULT)=0;
+    virtual Connection* getAnyTaggedProxyConnection(const UString &name,
+      OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
+      const UString &tag,
+      Connection::ProxyType proxyType = Connection::PROXY_DEFAULT)=0;
+    virtual Connection* getAnyTaggedProxyConnection(const UString &name,
+      const UString &tag,
+      Connection::ProxyType proxyType = Connection::PROXY_DEFAULT )=0;
+    virtual void releaseConnection(Connection *connection,
+      const UString  &tag)=0;
+
+};
+
+
+class ConnectionPool
+{
+  public :
+
+    virtual ~ConnectionPool() {}
+    virtual unsigned int getBusyConnections() const 
+       =0; 
+    virtual unsigned int getOpenConnections() const 
+       =0; 
+    virtual unsigned int getMinConnections() const 
+       =0; 
+    virtual unsigned int getMaxConnections() const 
+       =0; 
+    virtual unsigned int getIncrConnections() const 
+       =0; 
+    virtual OCCI_STD_NAMESPACE::string getPoolName() const 
+       =0; 
+    virtual unsigned int getTimeOut() const 
+       =0; 
+    virtual void setErrorOnBusy() 
+       =0; 
+    virtual void setTimeOut(unsigned int connTimeOut =0) 
+       =0; 
+    virtual void setPoolSize(unsigned int minConn =0,
+      unsigned int maxConn =1, unsigned int incrConn =1) 
+       =0; 
+    virtual Connection* createConnection(
+      const OCCI_STD_NAMESPACE::string &userName,
+      const OCCI_STD_NAMESPACE::string &password)  =0; 
+
+    virtual Connection* createProxyConnection(
+      const OCCI_STD_NAMESPACE::string &name,
+      OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
+      Connection::ProxyType proxyType = 
+      Connection::PROXY_DEFAULT)  =0; 
+
+    virtual Connection* createProxyConnection(
+      const OCCI_STD_NAMESPACE::string &name,
+      Connection::ProxyType proxyType =
+      Connection::PROXY_DEFAULT)  =0;
+
+    virtual void terminateConnection
+      (Connection *connection) =0;
+
+    //new interfaces
+
+    virtual Connection* createConnection(
+      const UString &userName,
+      const UString &password)  =0; 
+    
+    virtual Connection* createProxyConnection(const UString &name,
+      OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
+      Connection::ProxyType proxyType = 
+      Connection::PROXY_DEFAULT)  =0; 
+    
+    virtual Connection* createProxyConnection(const UString &name,
+      Connection::ProxyType proxyType =
+      Connection::PROXY_DEFAULT)  =0;
+    
+    virtual void setStmtCacheSize(unsigned int cacheSize) =0;
+    virtual unsigned int getStmtCacheSize() const =0;
+
+    virtual UString getPoolNameUString() const 
+       =0; 
+};
+
+class   Environment     
+{
+ public:
+                    // class constants
+
+  enum Mode
+  {
+    DEFAULT = OCI_DEFAULT,
+    OBJECT = OCI_OBJECT,
+    SHARED = OCI_SHARED,
+    NO_USERCALLBACKS = OCI_NO_UCB,
+    THREADED_MUTEXED = OCI_THREADED,
+    THREADED_UNMUTEXED = OCI_THREADED | OCI_ENV_NO_MUTEX,
+    EVENTS = OCI_EVENTS,
+    USE_LDAP = OCI_USE_LDAP
+  };
+
+  virtual ~Environment(){}
+
+                    // public methods
+
+  static Environment * createEnvironment(
+                              Mode mode = DEFAULT,
+                              void *ctxp = 0,
+                              void *(*malocfp)(void *ctxp, size_t size) = 0,
+                              void *(*ralocfp)(void *ctxp, void *memptr,
+                                               size_t newsize) = 0,
+                              void (*mfreefp)(void *ctxp, void *memptr) = 0);
+  
+  static Environment * createEnvironment(
+                              const OCCI_STD_NAMESPACE::string &charset,
+                              const OCCI_STD_NAMESPACE::string &ncharset,
+                              Mode mode = DEFAULT,
+                              void *ctxp = 0,
+                              void *(*malocfp)(void *ctxp, size_t size) = 0,
+                              void *(*ralocfp)(void *ctxp, void *memptr,
+                                               size_t newsize) = 0,
+                              void (*mfreefp)(void *ctxp, void *memptr) = 0);
+
+  static void terminateEnvironment(Environment *env);
+  
+  static Environment* getXAEnvironment(const 
+                           OCCI_STD_NAMESPACE::string& dbname);
+
+  static void releaseXAEnvironment(Environment *env);
+  
+  virtual Connection * createConnection(
+    const OCCI_STD_NAMESPACE::string &userName,
+    const OCCI_STD_NAMESPACE::string &password, 
+    const OCCI_STD_NAMESPACE::string &connectString = "") = 0;
+
+  virtual void terminateConnection(Connection *connection) = 0;
+
+  virtual ConnectionPool* createConnectionPool(
+    const OCCI_STD_NAMESPACE::string &poolUserName,
+    const OCCI_STD_NAMESPACE::string &poolPassword, 
+    const OCCI_STD_NAMESPACE::string &connectString ="", 
+    unsigned int minConn =0,
+    unsigned int maxConn =1, unsigned int incrConn =1) = 0;
+
+  virtual void terminateConnectionPool(ConnectionPool *poolp) = 0;
+
+  virtual unsigned int getCurrentHeapSize() const = 0;
+
+  virtual OCIEnv * getOCIEnvironment() const = 0;
+
+  virtual Map *getMap() const = 0;
+ 
+  virtual void setCacheMaxSize(unsigned int maxSize) = 0; 
+  
+  virtual unsigned int getCacheMaxSize() const = 0; 
+  
+  virtual void setCacheOptSize(unsigned int OptSize) = 0; 
+  
+  virtual unsigned int getCacheOptSize() const = 0; 
+
+
+  //new interfaces
+
+  virtual Connection * createConnection(const UString &userName,
+    const UString &password, const UString &connectString) = 0;
+  
+  virtual ConnectionPool* createConnectionPool(
+    const UString &poolUserName,
+    const UString &poolPassword, const UString &connectString, 
+    unsigned int minConn =0,
+    unsigned int maxConn =1, unsigned int incrConn =1) = 0;
+
+  virtual Connection* getXAConnection(const 
+                           OCCI_STD_NAMESPACE::string& dbname) = 0;
+
+  virtual void releaseXAConnection(Connection* conn) =0;
+  
+  virtual StatelessConnectionPool* createStatelessConnectionPool(
+    const OCCI_STD_NAMESPACE::string &poolUserName,
+    const OCCI_STD_NAMESPACE::string &poolPassword,
+    const OCCI_STD_NAMESPACE::string &connectString = "",
+    unsigned int maxConn = 1, unsigned int minConn = 0,
+    unsigned int incrConn = 1,
+    StatelessConnectionPool::PoolType pType 
+                                 = StatelessConnectionPool::HETEROGENEOUS) = 0;
+  
+  virtual StatelessConnectionPool* createStatelessConnectionPool(
+    const UString &poolUserName,
+    const UString &poolPassword,
+    const UString &connectString,
+    unsigned int maxConn = 1, unsigned int minConn = 0,
+    unsigned int incrConn = 1,
+    StatelessConnectionPool::PoolType pType 
+                                 = StatelessConnectionPool::HETEROGENEOUS) = 0;
+
+  virtual void terminateStatelessConnectionPool(StatelessConnectionPool *poolp,
+  StatelessConnectionPool::DestroyMode mode = StatelessConnectionPool::DEFAULT)
+      = 0;
+  virtual void setLDAPAuthentication(unsigned int mode) =0;
+
+  virtual unsigned int getLDAPAuthentication() const =0;
+  
+  virtual void setLDAPLoginNameAndPassword(
+     const OCCI_STD_NAMESPACE::string &login,
+     const OCCI_STD_NAMESPACE::string &passwd) =0;
+
+  virtual void setLDAPAdminContext(const OCCI_STD_NAMESPACE::string &ctx)=0;
+
+  virtual OCCI_STD_NAMESPACE::string getLDAPAdminContext() const =0;
+
+  virtual void setLDAPHostAndPort(const OCCI_STD_NAMESPACE::string &host,
+     unsigned int port) =0;
+
+  virtual OCCI_STD_NAMESPACE::string getLDAPHost() const =0;
+
+  virtual unsigned int getLDAPPort() const =0;  
+ 
+  virtual void registerSubscriptions(
+     const OCCI_STD_NAMESPACE::vector<aq::Subscription>& sub) =0;
+
+  virtual void unregisterSubscription(const aq::Subscription& sub) =0; 
+ 
+  virtual void enableSubscription(const aq::Subscription& sub) =0;
+  
+  virtual void disableSubscription(const aq::Subscription& sub) =0;
+  
+  virtual bool getCacheSortedFlush() const = 0;
+
+  virtual void setCacheSortedFlush(bool flag) = 0;
+
+  private:
+
+};
+
+
+
+class Map
+{
+ public:
+
+  virtual ~Map(){}
+  virtual void put(const OCCI_STD_NAMESPACE::string&, void *(*)(void *), 
+                void (*)(void *, void *)) = 0;
+  virtual void getReadSQL(
+    void *, unsigned int, void *, unsigned int, void **) const = 0;
+  virtual void getWriteSQL(
+    void *, unsigned int, void *, unsigned int, void **) const = 0;
+  virtual void put(const OCCI_STD_NAMESPACE::string&, 
+                const OCCI_STD_NAMESPACE::string&, void *(*)(void *), 
+                void (*)(void *, void *)) = 0;
+  virtual void putUTF16(const OCCI_STD_NAMESPACE::string&, 
+                const OCCI_STD_NAMESPACE::string&, void *(*)(void *), 
+                void (*)(void *, void *)) = 0;
+
+ private:
+};
+
+
+   
+class SQLException : public OCCI_STD_NAMESPACE::exception
+{
+ public:
+
+  virtual int getErrorCode() const;
+  
+  virtual OCCI_STD_NAMESPACE::string getMessage() const;
+
+  const char *what() const throw();
+
+  virtual void setErrorCtx(void *ctx);
+  
+  SQLException();
+
+  SQLException(const SQLException &e);
+
+  void operator=(const SQLException &other);
+
+  virtual ~SQLException() throw();
+
+  virtual int getXAErrorCode(const OCCI_STD_NAMESPACE::string& dbname) const;
+  
+  virtual UString getUStringMessage() const;
+
+  virtual OCCI_STD_NAMESPACE::string getNLSMessage(Environment *env) const;
+  
+  virtual UString getNLSUStringMessage(Environment *env) const;
+
+ private:
+
+  Ptr<SQLExceptionImpl> ptr_;
+  SQLException(SQLExceptionImpl *ptr);
+  friend SQLException SQLExceptionCreate(int errorCode);
+  friend SQLException SQLExceptionCreate(dvoid *handle,
+  int handleType);
+
+};
+
+
+class Statement 
+{
+ public:
+                                // class constants
+
+  virtual ~Statement() {}
+  
+  enum Status                                   
+  {
+    UNPREPARED,
+    PREPARED,
+    RESULT_SET_AVAILABLE,
+    UPDATE_COUNT_AVAILABLE,
+    NEEDS_STREAM_DATA,
+    STREAM_DATA_AVAILABLE
+  };
+  
+                                // common methods
+  
+  virtual void setSQL(const OCCI_STD_NAMESPACE::string &sql) = 0; 
+
+  virtual OCCI_STD_NAMESPACE::string getSQL() const = 0;
+
+  virtual Status execute(const OCCI_STD_NAMESPACE::string &sql = "") = 0;
+  
+  virtual ResultSet * getResultSet() = 0;
+  
+  virtual unsigned int getUpdateCount() const = 0; 
+  
+  virtual ResultSet * executeQuery(
+    const OCCI_STD_NAMESPACE::string &sql = "") = 0;
+  
+  virtual unsigned int executeUpdate(
+    const OCCI_STD_NAMESPACE::string &sql = "") = 0; 
+  
+  virtual Status status() const = 0;  
+                                        
+  virtual void closeResultSet(ResultSet *resultSet) = 0;
+  
+  virtual void setPrefetchRowCount(unsigned int rowCount) = 0; 
+  
+  virtual void setPrefetchMemorySize(unsigned int bytes) = 0;
+  
+  virtual void setAutoCommit(bool autoCommit) = 0;
+  
+  virtual bool getAutoCommit() const = 0;
+  
+  virtual OCIStmt * getOCIStatement() const = 0;
+
+
+                    // methods for prepared statements with IN
+                    // parameters  
+
+  virtual void setMaxParamSize(unsigned int paramIndex,unsigned int maxSize)=0;
+  
+  virtual unsigned int getMaxParamSize(unsigned int paramIndex) const = 0;
+
+  virtual void setNull(unsigned int paramIndex, Type type) = 0;
+ 
+  virtual void setInt(unsigned int paramIndex, int x) = 0; 
+  
+  virtual void setUInt(unsigned int paramIndex, unsigned int x) = 0; 
+  
+  virtual void setFloat(unsigned int paramIndex, float x) = 0; 
+
+  virtual void setDouble(unsigned int paramIndex, double x) = 0; 
+
+  virtual void setNumber(unsigned int paramIndex, const Number &x) = 0; 
+  
+  virtual void setString(unsigned int paramIndex, 
+    const OCCI_STD_NAMESPACE::string &x) = 0; 
+
+  virtual void setBytes(unsigned int paramIndex, const Bytes &x) = 0; 
+
+  virtual void setDate(unsigned int paramIndex, const Date &x) = 0; 
+  
+  virtual void setTimestamp(unsigned int paramIndex, const Timestamp &x) = 0; 
+
+  virtual void setBlob(unsigned int paramIndex, const Blob &x) = 0;
+
+  virtual void setClob(unsigned int paramIndex, const Clob &x) = 0;
+
+  virtual void setBfile(unsigned int paramIndex, const Bfile &x) = 0;
+
+  virtual void setIntervalYM(unsigned int paramIndex, const IntervalYM &x) = 0;
+ 
+  virtual void setIntervalDS(unsigned int paramIndex, const IntervalDS &x) = 0;
+ 
+  virtual void setRowid(unsigned int paramIndex, const Bytes &x) = 0; 
+  
+  virtual void setRef(unsigned int paramIndex, const RefAny &x) = 0; 
+
+  virtual void setObject(unsigned int paramIndex, PObject * x) = 0; 
+  
+  virtual void setDataBuffer(unsigned int paramIndex, void *buffer, 
+                             Type type,
+                             sb4 size, ub2 *length, sb2 *ind = NULL,
+                             ub2 *rc = NULL) = 0; 
+
+  virtual void setDataBufferArray(unsigned int paramIndex, void *buffer, 
+                                  Type type,
+                                  ub4 arraySize, ub4 *arrayLength,
+                                  sb4 elementSize,
+                                  ub2 *elementLength, sb2 *ind = NULL,
+                                  ub2 *rc = NULL) = 0;
+
+  virtual void setCharSet(unsigned int paramIndex, 
+  const OCCI_STD_NAMESPACE::string & charSet) = 0; 
+  
+  virtual OCCI_STD_NAMESPACE::string getCharSet(unsigned int paramIndex) 
+  const = 0; 
+  
+  virtual void setDatabaseNCHARParam(
+    unsigned int paramIndex, bool isNCHAR) = 0;
+                                         
+  virtual bool getDatabaseNCHARParam(unsigned int paramIndex) const = 0;       
+
+  virtual void closeStream(Stream *stream) =0;
+
+  virtual Stream * getStream(unsigned int paramIndex) = 0; 
+  
+  virtual unsigned int getCurrentStreamParam() const = 0; 
+  
+  virtual unsigned int getCurrentStreamIteration() const = 0;
+
+  virtual void setBinaryStreamMode(unsigned int colIndex, 
+    unsigned int size) =0;
+
+  virtual void setCharacterStreamMode(unsigned int colIndex, 
+    unsigned int size) =0;
+  
+  virtual void setMaxIterations(unsigned int maxIterations) = 0;
+  
+  virtual unsigned int getMaxIterations() const = 0; 
+
+  virtual void addIteration() = 0; 
+  
+  virtual unsigned int getCurrentIteration() const = 0; 
+
+  virtual Status executeArrayUpdate(unsigned int arrayLength) = 0;
+  
+
+                    // methods for Callable Statements
+
+  virtual void registerOutParam(unsigned int paramIndex, Type type, 
+  unsigned int maxSize=0, const OCCI_STD_NAMESPACE::string &sqltype="") = 0;
+  
+  virtual bool isNull(unsigned int paramIndex) const = 0;
+
+  virtual bool isTruncated(unsigned int paramIndex) const
+   =0;
+
+  
+  virtual void setErrorOnNull(unsigned int paramIndex, 
+    bool causeException) = 0;
+                               
+  virtual void setErrorOnTruncate(unsigned int paramIndex,
+  bool causeException)  = 0;
+
+  virtual int preTruncationLength(unsigned int paramIndex) const
+   =0;
+
+
+  virtual int getInt(unsigned int paramIndex)  = 0; 
+  
+  virtual unsigned int getUInt(unsigned int paramIndex)  = 0; 
+  
+  virtual float getFloat(unsigned int paramIndex)  = 0; 
+
+  virtual double getDouble(unsigned int paramIndex)  = 0; 
+  
+  virtual Number getNumber(unsigned int paramIndex)  = 0; 
+  
+  virtual OCCI_STD_NAMESPACE::string getString(unsigned int paramIndex)  = 0; 
+  
+  virtual Bytes getBytes(unsigned int paramIndex)  = 0; 
+
+  virtual Date getDate(unsigned int paramIndex)  = 0; 
+  
+  virtual Timestamp getTimestamp(unsigned int paramIndex)  = 0; 
+
+  virtual Bytes getRowid(unsigned int paramIndex)  = 0; 
+  
+  virtual PObject * getObject(unsigned int paramIndex)  = 0; 
+  
+  virtual Blob getBlob(unsigned int paramIndex)  = 0; 
+  
+  virtual Clob getClob(unsigned int paramIndex)  = 0; 
+  
+  virtual Bfile getBfile(unsigned int paramIndex)  = 0; 
+
+  virtual IntervalYM getIntervalYM(unsigned int paramIndex)  = 0; 
+ 
+  virtual IntervalDS getIntervalDS(unsigned int paramIndex)  = 0; 
+
+  virtual RefAny getRef(unsigned int paramIndex)  = 0;  
+
+  virtual ResultSet * getCursor(unsigned int paramIndex)   = 0;
+
+  virtual Connection* getConnection() const =0; 
+
+  //new interfaces
+
+  virtual void setRef(unsigned int paramIndex, const RefAny &x, 
+                      const OCCI_STD_NAMESPACE::string &typName, 
+                      const OCCI_STD_NAMESPACE::string &schName = "") = 0; 
+  
+  virtual void setSQLUString(const UString &sql) = 0;
+  
+  virtual UString getSQLUString() const = 0;
+  
+  virtual Status execute(const UString &sql) = 0;
+                                
+  virtual ResultSet * executeQuery(
+    const UString &sql) = 0;
+  
+  virtual unsigned int executeUpdate(
+    const UString &sql) = 0; 
+  
+  virtual void setBFloat(unsigned int paramIndex, const BFloat &fval) = 0;
+  
+  virtual void setBDouble(unsigned int paramIndex, const BDouble &dval) = 0;
+  
+  virtual void setUString(unsigned int paramIndex,
+    const UString &x) = 0;
+  
+  virtual void setCharSetUString(unsigned int paramIndex, 
+  const UString & charSet) = 0; 
+  
+  virtual UString getCharSetUString(unsigned int paramIndex) 
+  const = 0; 
+  
+  virtual void registerOutParam(unsigned int paramIndex, Type type, 
+  unsigned int maxSize, const OCCI_STD_NAMESPACE::string &typName,
+  const OCCI_STD_NAMESPACE::string &schName) = 0;
+  
+  virtual void registerOutParam(unsigned int paramIndex, Type type, 
+  unsigned int maxSize, const UString &typName, 
+  const UString &schName) = 0;
+  
+  virtual BFloat getBFloat(unsigned int paramIndex)  = 0;
+  
+  virtual BDouble getBDouble(unsigned int paramIndex)  = 0;
+
+  virtual UString getUString(unsigned int paramIndex)  = 0; 
+  
+  virtual void disableCaching() =0;
+  
+  virtual void setRef(unsigned int paramIndex, const RefAny &x, 
+                      const UString &typName, 
+                      const UString &schName) = 0; 
+
+  virtual void setBinaryStreamMode(unsigned int colIndex, 
+    unsigned int size, bool INArg) =0;
+
+  virtual void setCharacterStreamMode(unsigned int colIndex, 
+    unsigned int size, bool INArg) =0;
+
+};
+
+
+
+class ResultSet 
+{
+ public:
+                                // class constants
+  
+  enum Status                                   
+  {
+    END_OF_FETCH = 0,
+    DATA_AVAILABLE,
+    STREAM_DATA_AVAILABLE
+  };
+  virtual ~ResultSet(){}
+ 
+                                // public methods
+
+  virtual Status next(unsigned int numRows = 1) = 0;
+  
+  virtual Status status() const = 0;            
+  
+  virtual unsigned int getNumArrayRows()  const = 0;
+  
+  virtual void cancel() = 0;
+
+  virtual void setMaxColumnSize(unsigned int colIndex, unsigned int max) = 0;
+  
+  virtual unsigned int getMaxColumnSize(unsigned int colIndex) const = 0;
+  
+  virtual bool isNull(unsigned int colIndex) const = 0;
+  
+  virtual bool isTruncated(unsigned int paramIndex) const
+   =0;
+
+  virtual void setErrorOnNull(unsigned int colIndex, bool causeException) = 0;
+  virtual void setErrorOnTruncate(unsigned int paramIndex,
+  bool causeException)   =0;
+
+  virtual int preTruncationLength(unsigned int paramIndex) const
+   =0;
+
+  virtual int getInt(unsigned int colIndex)   = 0; 
+  
+  virtual unsigned int getUInt(unsigned int colIndex)   = 0; 
+  
+  virtual float getFloat(unsigned int colIndex)  = 0; 
+
+  virtual double getDouble(unsigned int colIndex)  = 0; 
+
+  virtual Number getNumber(unsigned int colIndex)  = 0; 
+  
+  virtual OCCI_STD_NAMESPACE::string getString(unsigned int colIndex)  = 0; 
+  
+  virtual Bytes getBytes(unsigned int colIndex)  = 0; 
+
+  virtual Date getDate(unsigned int colIndex)  = 0; 
+  
+  virtual Timestamp getTimestamp(unsigned int colIndex)  = 0; 
+  
+  virtual Bytes getRowid(unsigned int colIndex)  = 0; 
+  
+  virtual PObject * getObject(unsigned int colIndex)  = 0; 
+  
+  virtual Blob getBlob(unsigned int colIndex)  = 0; 
+  
+  virtual Clob getClob(unsigned int colIndex)  =0; 
+  
+  virtual Bfile getBfile(unsigned int colIndex)  = 0; 
+
+  virtual  IntervalYM getIntervalYM(unsigned int colIndex)  =0;
+   
+  virtual  IntervalDS getIntervalDS(unsigned int colIndex)  =0;
+   
+  virtual RefAny getRef(unsigned int colIndex)  = 0; 
+
+  virtual Bytes getRowPosition() const = 0; 
+
+  virtual ResultSet * getCursor(unsigned int colIndex)  = 0; 
+  
+  virtual void setDataBuffer(unsigned int colIndex, void *buffer, Type type,
+                             sb4 size = 0, ub2 *length = NULL,
+                             sb2 *ind = NULL, ub2 *rc = NULL) = 0;
+
+  virtual void setCharSet(unsigned int colIndex, 
+  const OCCI_STD_NAMESPACE::string & charSet) = 0; 
+  
+  virtual OCCI_STD_NAMESPACE::string getCharSet(unsigned int colIndex) 
+  const = 0; 
+  
+  virtual void setBinaryStreamMode(unsigned int colIndex, unsigned int size)
+    = 0;
+
+  virtual void setCharacterStreamMode(unsigned int colIndex, unsigned int size)
+    = 0;
+  
+  virtual void setDatabaseNCHARParam(unsigned int paramIndex, 
+    bool isNCHAR) = 0;
+  
+  virtual bool getDatabaseNCHARParam(unsigned int paramIndex) const = 0;       
+                                         
+  virtual Stream * getStream(unsigned int colIndex)  = 0; 
+
+  virtual void closeStream(Stream *stream) =0;
+  
+  virtual unsigned int getCurrentStreamColumn() const= 0; 
+  
+  virtual unsigned int getCurrentStreamRow() const= 0;       
+  
+  virtual OCCI_STD_NAMESPACE::vector<MetaData> getColumnListMetaData() const 
+    = 0;
+
+  virtual Statement* getStatement() const=0;
+
+  //new interfaces
+
+  virtual BFloat getBFloat(unsigned int colIndex)  = 0;
+  
+  virtual BDouble getBDouble(unsigned int colIndex)  = 0;
+  
+  virtual UString getUString(unsigned int colIndex)  = 0; 
+  
+  virtual void setCharSetUString(unsigned int colIndex, 
+  const UString & charSet) = 0; 
+  
+  virtual UString getCharSetUString(unsigned int colIndex) 
+  const = 0; 
+
+};
+
+
+class Stream
+{
+  public : 
+
+    enum Status {READY_FOR_READ, READY_FOR_WRITE, INACTIVE};
+
+    virtual ~Stream(){}
+    virtual int readBuffer(char *buffer, unsigned int size)
+       =0;
+    virtual int readLastBuffer(char *buffer, unsigned int size)
+       =0;
+    virtual void writeBuffer(char *buffer, unsigned int size)
+       =0;
+    virtual void writeLastBuffer(char *buffer, unsigned int size)
+       =0;
+    virtual Status status() const  =0;
+
+};
+
+/*---------------------------------------------------------------------------
+                PROTOTYPES USED BY FUNCTION TEMPLATES
+ -------------------------------------------------------------------------*/
+  void getVectorOfPObjects( ResultSet *rs, unsigned int index,
+  OCCI_STD_NAMESPACE::vector<PObject *> &vect) ;
+  void getVectorOfOCIRefs(ResultSet  *rs, unsigned int index,
+  OCCI_STD_NAMESPACE::vector<void *> &vect) ;
+  void getVectorOfPObjects( Statement *rs, unsigned int index,
+  OCCI_STD_NAMESPACE::vector<PObject *> &vect) ;
+  void getVectorOfOCIRefs(Statement  *rs, unsigned int index,
+  OCCI_STD_NAMESPACE::vector<void *> &vect) ;
+  void setVectorOfPObjects( Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<PObject *> &vect, 
+  const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVectorOfPObjects( Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<PObject *> &vect, 
+  const OCCI_STD_NAMESPACE::string &schemaName,
+  const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVectorOfPObjects( Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<PObject *> &vect, 
+  const UString &schemaName,
+  const UString &typeName) ;
+  void setVectorOfOCIRefs(Statement *stmt, unsigned int paramIndex,
+  const  OCCI_STD_NAMESPACE::vector<void *> &vect,
+  const OCCI_STD_NAMESPACE::vector<OCIInd> &vecind,
+  const OCCI_STD_NAMESPACE::string &sqltype) ;
+  void setVectorOfOCIRefs(Statement *stmt, unsigned int paramIndex,
+  const  OCCI_STD_NAMESPACE::vector<void *> &vect,
+  const OCCI_STD_NAMESPACE::vector<OCIInd> &vecind,
+  const OCCI_STD_NAMESPACE::string &schemaName,
+  const OCCI_STD_NAMESPACE::string &typeName) ;
+  void setVectorOfOCIRefs(Statement *stmt, unsigned int paramIndex,
+  const  OCCI_STD_NAMESPACE::vector<void *> &vect,
+  const OCCI_STD_NAMESPACE::vector<OCIInd> &vecind,
+  const UString &schemaName,
+  const UString &typeName) ;
+  void pinVectorOfOCIRefs(const Connection *conn, 
+  OCCI_STD_NAMESPACE::vector<void *> & vecRef,
+  OCCI_STD_NAMESPACE::vector<void *> & vecCor,
+  OCCI_STD_NAMESPACE::vector<PObject *> &vecPObj,LockOptions &lockOpt );
+
+
+/*---------------------------------------------------------------------------
+                           EXPORT FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+/*------------------------ getVector for objects ---------------------------*/
+/*
+   NAME
+      getVector - overloaded function. Retrieves the attribute in the current
+position as a vector of objects
+
+   PARAMETERS
+      rs - ResultSet
+      vect- reference to vector of objects(OUT parameter).
+
+   DESCRIPTION
+     Retrieves the column in the specified position as a vector of RefAny.
+   The attribute at the current position should be a collection type (varray or
+   nested table). The SQL type of the elements in the collection should be
+   compatible with objects.
+
+   RETURNS
+     nothing
+
+   NOTES
+        compatible SQL types : NTY
+
+        will call getVector(..., vector<PObject*>)
+*/
+#ifdef WIN32COMMON
+// and other platforms that do not support
+// partial function template specialization
+
+template <class T>
+void getVector( ResultSet *rs, unsigned int index,OCCI_STD_NAMESPACE::vector<T>
+& vect) 
+{
+  OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
+  getVectorOfPObjects(rs, index, vec_pobj);
+
+  vect.clear();
+  unsigned int size = vec_pobj.size();
+  vect.reserve( size );
+  for ( unsigned int i=0; i< size; i++)
+    vect.push_back((T)vec_pobj[i]);
+}
+
+#else
+template <class T>
+void getVector( ResultSet *rs, unsigned int index, OCCI_STD_NAMESPACE::vector<T
+ *> &vect)
+{
+  OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
+  getVectorOfPObjects(rs, index, vec_pobj);
+
+  vect.clear();
+  unsigned int size = vec_pobj.size();
+  vect.reserve( size );
+  for (unsigned int i=0; i< size; i++)
+    vect.push_back((T *)vec_pobj[i]);
+}
+#endif
+
+/*------------------------ getVector for objects ---------------------------*/
+/*
+   NAME
+      getVector - overloaded function. Retrieves the attribute in the current
+position as a vector of objects
+
+   PARAMETERS
+      stmt - Statement
+      vect- reference to vector of objects(OUT parameter).
+
+   DESCRIPTION
+     Retrieves the column in the specified position as a vector of RefAny.
+   The attribute at the current position should be a collection type (varray or
+   nested table). The SQL type of the elements in the collection should be
+   compatible with objects.
+
+   RETURNS
+     nothing
+
+   NOTES
+        compatible SQL types : NTY
+
+        will call getVector(..., vector<PObject*>)
+*/
+#ifdef WIN32COMMON
+// and other platforms that do not support
+// partial function template specialization
+
+template <class T>
+void getVector( Statement *stmt, unsigned int index, 
+OCCI_STD_NAMESPACE::vector<T> &vect) 
+{
+  OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
+  getVectorOfPObjects(stmt, index, vec_pobj);
+  vect.clear();
+  unsigned int size = vec_pobj.size();
+  vect.reserve( size );
+  for (unsigned int i=0; i< size; i++)
+    vect.push_back((T)vec_pobj[i]);
+}
+#else
+template <class T>
+void getVector( Statement *stmt, unsigned int index,
+OCCI_STD_NAMESPACE::vector<T *> &vect)
+{
+  OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
+  getVectorOfPObjects(stmt, index, vec_pobj);
+  vect.clear();
+  unsigned int size = vec_pobj.size();
+  vect.reserve( size );
+  for (unsigned int i=0; i< size; i++)
+    vect.push_back((T *)vec_pobj[i]);
+}
+#endif
+
+/*------------------------ getVector for Ref<T> ---------------------------*/
+/*
+   NAME
+      getVector - overloaded function. Retrieves the attribute in the current
+position as a vector of Ref<T>
+
+   PARAMETERS
+      rs - ResultSet
+      vect- reference to vector of Ref<T>(OUT parameter).
+
+   DESCRIPTION
+     Retrieves the column in the specified position as a vector of Ref<T>.
+   The attribute at the current position should be a collection type (varray or
+   nested table). The SQL type of the elements in the collection should be
+   compatible with Ref<T>.
+
+   RETURNS
+     nothing
+
+   NOTES
+        compatible SQL types : REF
+*/
+#ifndef WIN32COMMON
+template <class T>
+void getVector( ResultSet *rs, unsigned int index, 
+                OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) 
+{
+  OCCI_STD_NAMESPACE::vector<void *> vec_ref;
+  getVectorOfOCIRefs(rs, index, vec_ref);
+
+  const Connection *sess = rs->getStatement()->getConnection();
+
+  vect.clear();
+  unsigned int size = vec_ref.size();
+  vect.reserve( size );
+  for (unsigned int i=0; i< size; i++)
+  {
+    if (vec_ref[i] == (OCIRef *)0)
+       vect.push_back(Ref<T>());     // pushing a default-constructed Ref
+     else
+       vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE));
+  }
+}
+#endif
+
+/*------------------------ setVector for PObject*---------------------------*/
+/*
+   NAME
+      SetVector - overloaded function. Binds the attribute in the current
+      position with a vector of objects.
+
+   PARAMETERS
+      rs - ResultSet
+      vect- reference to vector of objects(OUT parameter).
+
+   DESCRIPTION
+     Binds the column in the specified position with a vector of signed int .
+   The column at the current position should be a collection type (varray or
+   nested table). The SQL type of the elements in the collection should be
+   compatible with objects .
+
+   RETURNS
+     nothing
+
+   NOTES
+     compatible SQL types : SQLT_NTY
+ 
+     This will be calling setVector(..., vector<PObject*>,..)
+
+*/
+#ifdef WIN32COMMON
+// and other platforms that do not support
+// partial function template specialization
+
+template <class T>
+void setVector( Statement *stmt, unsigned int index, 
+                const OCCI_STD_NAMESPACE::vector<T> &vect, 
+                const OCCI_STD_NAMESPACE::string &sqltype) 
+{
+  OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
+  unsigned int size = vect.size();
+  vec_pobj.reserve( size );
+  
+  for (unsigned int i = 0; i < size; i++)
+    vec_pobj.push_back((PObject *)vect[i]);
+
+  setVectorOfPObjects(stmt, index, vec_pobj, sqltype);
+}
+
+template <class T>
+void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::
+vector<T> &vect, const OCCI_STD_NAMESPACE::string &schemaName,
+const OCCI_STD_NAMESPACE::string &typeName)
+{
+  OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
+  unsigned int size = vect.size();
+  vec_pobj.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+    vec_pobj.push_back((PObject *)vect[i]);
+
+  setVectorOfPObjects(stmt, index, vec_pobj, schemaName, typeName);
+}
+
+template <class T>
+void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::
+vector<T> &vect, const UString &schemaName,
+const UString &typeName)
+{
+  OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
+  unsigned int size = vect.size();
+  vec_pobj.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+    vec_pobj.push_back((PObject *)vect[i]);
+
+  setVectorOfPObjects(stmt, index, vec_pobj, schemaName, typeName);
+}
+#else
+template <class T>
+void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::
+vector<T *> &vect, const OCCI_STD_NAMESPACE::string &sqltype)
+{
+  OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
+  unsigned int size = vect.size();
+  vec_pobj.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+    vec_pobj.push_back((PObject *)vect[i]);
+
+  setVectorOfPObjects(stmt, index, vec_pobj, sqltype);
+}
+
+template <class T>
+void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::
+vector<T *> &vect, const OCCI_STD_NAMESPACE::string &schemaName,
+const OCCI_STD_NAMESPACE::string &typeName)
+{
+  OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
+  unsigned int size = vect.size();
+  vec_pobj.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+    vec_pobj.push_back((PObject *)vect[i]);
+
+  setVectorOfPObjects(stmt, index, vec_pobj, schemaName, typeName);
+}
+
+template <class T>
+void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::
+vector<T *> &vect, const UString &schemaName,
+const UString &typeName)
+{
+  OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
+  unsigned int size = vect.size();
+  vec_pobj.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+    vec_pobj.push_back((PObject *)vect[i]);
+
+  setVectorOfPObjects(stmt, index, vec_pobj, schemaName, typeName);
+}
+#endif
+
+/*------------------------ setVector for Ref<T>---------------------------*/
+/*
+   NAME
+      setVector - overloaded function. Binds the attribute in the current
+      position with a vector of Ref<T>.
+
+   PARAMETERS
+      rs - ResultSet
+      vect- reference to vector of REF
+
+   DESCRIPTION
+     Binds the column in the specified position with a vector of signed int .
+   The column at the current position should be a collection type (varray or
+   nested table). The SQL type of the elements in the collection should be
+   compatible with OCIRef* .
+
+   RETURNS
+     nothing
+
+   NOTES
+     compatible SQL types : REF 
+
+     This will just call setVector(..., vector<OCIRef*>,..)
+
+
+*/
+#ifndef WIN32COMMON
+template <class T>
+void setVector( Statement *stmt, unsigned int index, 
+                const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect, 
+                const OCCI_STD_NAMESPACE::string &sqltype)
+{
+  OCCI_STD_NAMESPACE::vector<void *> vec_ref;
+  OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
+  unsigned int size = vect.size();
+  vec_ref.reserve( size );
+  vec_ind.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+  {
+    vec_ref.push_back((void *)vect[i].getRef());
+    vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
+  }
+
+  setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, sqltype);
+}
+
+template <class T>
+void setVector( Statement *stmt, unsigned int index, 
+                const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect, 
+                const OCCI_STD_NAMESPACE::string &schemaName,
+                const OCCI_STD_NAMESPACE::string &typeName)
+{
+  OCCI_STD_NAMESPACE::vector<void *> vec_ref;
+  OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
+  unsigned int size = vect.size();
+  vec_ref.reserve( size );
+  vec_ind.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+  {
+    vec_ref.push_back((void *)vect[i].getRef());
+    vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
+  }
+
+  setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, schemaName, typeName);
+}
+
+template <class T>
+void setVector( Statement *stmt, unsigned int index, 
+                const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect, 
+                const UString &schemaName,
+                const UString &typeName)
+{
+  OCCI_STD_NAMESPACE::vector<void *> vec_ref;
+  OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
+  unsigned int size = vect.size();
+  vec_ref.reserve( size );
+  vec_ind.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+  {
+    vec_ref.push_back((void *)vect[i].getRef());
+    vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
+  }
+
+  setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, schemaName, typeName);
+}
+#endif
+
+/*------------------------ getVector for Ref<T> ---------------------------*/
+/*
+   NAME
+      getVector - overloaded function. Retrieves the attribute in the current
+position as a vector of Ref<T>
+
+   PARAMETERS
+      stmt - Statement
+      vect- reference to vector of Ref<T>(OUT parameter).
+
+   DESCRIPTION
+     Retrieves the column in the specified position as a vector of Ref<T>.
+   The attribute at the current position should be a collection type (varray or
+   nested table). The SQL type of the elements in the collection should be
+   compatible with Ref<T>.
+
+   RETURNS
+     nothing
+
+   NOTES
+        compatible SQL types : REF
+*/
+#ifndef WIN32COMMON
+template <class T>
+void getVector( Statement *stmt, unsigned int index, 
+                OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) 
+{
+  OCCI_STD_NAMESPACE::vector<void *> vec_ref;
+  getVectorOfOCIRefs(stmt, index, vec_ref);
+
+  const Connection *sess = stmt->getConnection();
+
+  vect.clear();
+  unsigned int size = vec_ref.size();
+  vect.reserve( size );
+  for (unsigned int i=0; i< size; i++)
+  {
+    if (vec_ref[i] == (OCIRef *)0)
+       vect.push_back(Ref <T>());     // pushing a default-constructed Ref
+     else
+       vect.push_back(Ref<T> (sess, (OCIRef *)vec_ref[i], FALSE));
+  }
+ 
+}
+#endif
+
+// Platform independent get/setVectorOfRefs method added
+// get(set)Vector of Ref<T> and get(set)VectorOfRefs are identical 
+// in functionality. 
+
+/*------------------------ getVectorOfRefs for Ref<T> ----------------------*/
+/*
+   NAME
+      getVectorOfRefs - overloaded function. Retrieves the attribute in the
+      current position as a vector of Ref<T>
+
+   PARAMETERS
+      rs - ResultSet
+      vect- reference to vector of Ref<T>(OUT parameter).
+
+   DESCRIPTION
+     Retrieves the column in the specified position as a vector of Ref<T>.
+   The attribute at the current position should be a collection type (varray or
+   nested table). The SQL type of the elements in the collection should be
+   compatible with Ref<T>.
+
+   RETURNS
+     nothing
+
+   NOTES
+        compatible SQL types : REF
+*/
+
+template <class T>
+void getVectorOfRefs( ResultSet *rs, unsigned int index, 
+OCCI_STD_NAMESPACE::vector<Ref<T> > &vect)
+{
+  OCCI_STD_NAMESPACE::vector<void *> vec_ref;
+  getVectorOfOCIRefs(rs, index, vec_ref);
+
+  const Connection *sess = rs->getStatement()->getConnection();
+
+  vect.clear();
+  unsigned int size = vec_ref.size();
+  vect.reserve( size );
+  for (unsigned int i=0; i< size; i++)
+  {
+    if (vec_ref[i] == (OCIRef *)0)
+       vect.push_back(Ref<T>());     // pushing a default-constructed Ref
+     else
+       vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE));
+  }
+}
+
+/*------------------------ setVectorOfRefs for Ref<T>-----------------------*/
+/*
+   NAME
+      setVectorOfRefs - overloaded function. Binds the attribute in the current
+      position with a vector of Ref<T>.
+
+   PARAMETERS
+      rs - ResultSet
+      vect- reference to vector of REF
+
+   DESCRIPTION
+     Binds the column in the specified position with a vector of signed int .
+   The column at the current position should be a collection type (varray or
+   nested table). The SQL type of the elements in the collection should be
+   compatible with OCIRef* .
+
+   RETURNS
+     nothing
+
+   NOTES
+     compatible SQL types : REF
+
+     This will just call setVector(..., vector<OCIRef*>,..)
+
+
+*/
+
+template <class T>
+void setVectorOfRefs( Statement *stmt, unsigned int index, 
+const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect, 
+const OCCI_STD_NAMESPACE::string &sqltype)
+{
+  OCCI_STD_NAMESPACE::vector<void *> vec_ref;
+  OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
+  unsigned int size = vect.size();
+  vec_ref.reserve( size );
+  vec_ind.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+  {
+    vec_ref.push_back((void *)vect[i].getRef());
+    vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
+  }
+
+  setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, sqltype);
+}
+
+template <class T>
+void setVectorOfRefs( Statement *stmt, unsigned int index, 
+const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect, 
+const OCCI_STD_NAMESPACE::string &schemaName,
+const OCCI_STD_NAMESPACE::string &typeName)
+{
+  OCCI_STD_NAMESPACE::vector<void *> vec_ref;
+  OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
+  unsigned int size = vect.size();
+  vec_ref.reserve( size );
+  vec_ind.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+  {
+    vec_ref.push_back((void *)vect[i].getRef());
+    vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
+  }
+
+  setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, schemaName, typeName);
+}
+
+template <class T>
+void setVectorOfRefs( Statement *stmt, unsigned int index, 
+const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect, 
+const UString &schemaName,
+const UString &typeName)
+{
+  OCCI_STD_NAMESPACE::vector<void *> vec_ref;
+  OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
+  unsigned int size = vect.size();
+  vec_ref.reserve( size );
+  vec_ind.reserve( size );
+
+  for (unsigned int i = 0; i < size; i++)
+  {
+    vec_ref.push_back((void *)vect[i].getRef());
+    vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
+  }
+
+  setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, schemaName, typeName);
+}
+
+/*------------------------ getVectorOfRefs for Ref<T> ----------------------*/
+/*
+   NAME
+      getVectorOfRefs - overloaded function. Retrieves the attribute in the
+      current position as a vector of Ref<T>
+
+   PARAMETERS
+      stmt - Statement
+      vect- reference to vector of Ref<T>(OUT parameter).
+
+   DESCRIPTION
+     Retrieves the column in the specified position as a vector of Ref<T>.
+   The attribute at the current position should be a collection type (varray or
+   nested table). The SQL type of the elements in the collection should be
+   compatible with Ref<T>.
+
+   RETURNS
+     nothing
+
+   NOTES
+        compatible SQL types : REF
+*/
+
+template <class T>
+void getVectorOfRefs( Statement *stmt, unsigned int index, 
+OCCI_STD_NAMESPACE::vector <Ref<T> > &vect)
+{
+  OCCI_STD_NAMESPACE::vector<void *> vec_ref;
+  getVectorOfOCIRefs(stmt, index, vec_ref);
+
+  const Connection *sess = stmt->getConnection();
+
+  vect.clear();
+  unsigned int size = vec_ref.size();
+  vect.reserve( size );
+  for (unsigned int i=0; i< size; i++)
+  {
+    if (vec_ref[i] == (OCIRef *)0)
+       vect.push_back(Ref <T>());     // pushing a default-constructed Ref
+     else
+       vect.push_back(Ref<T> (sess, (OCIRef *)vec_ref[i], FALSE));
+  }
+}
+/*----------------------------- pinVectorOfRefs---------------------*/
+/*
+   NAME
+    pinVectorOfRefs - array pin implementation
+
+   PARAMETERS
+     conn- Connection object
+     vecRef - vector of OCIRefs *
+     vecCor - vector of OCIComplexObject *
+     vecPOBj - vector of PObject * ( OUT )
+
+   DESCRIPTION
+    implements the array pin of refs passed and returns the corresponding
+    PObject s
+
+   RETURNS
+
+   NOTES
+*/
+template <class T>
+void pinVectorOfRefs( const Connection *conn,
+OCCI_STD_NAMESPACE::vector<Ref<T> > &vect, 
+OCCI_STD_NAMESPACE::vector<T* > &vectObj, LockOptions lockOpt) 
+{
+   
+ OCCI_STD_NAMESPACE::vector<void *> vecRef;
+ OCCI_STD_NAMESPACE::vector<void *> vecCor;
+ OCCI_STD_NAMESPACE::vector<PObject *> vecPObj;
+ unsigned int sz = vect.size();
+ vecRef.reserve( sz );
+ vecCor.reserve( sz );
+
+ for ( unsigned int  i=0; i < sz; i++)
+ {
+   vecRef.push_back((void *)vect[i].getRef());
+   vecCor.push_back((void *)vect[i].getCor());
+ }
+ pinVectorOfOCIRefs(conn, vecRef, vecCor, vecPObj, lockOpt);
+ for ( unsigned int  k=0; k < sz; k++)
+ {
+   vectObj.push_back((T *)vecPObj[k]);
+   vect[k].setPinnedObject(vecPObj[k]);
+ }
+}
+
+/*----------------------------- pinVectorOfRefs---------------------*/
+/*
+   NAME
+    pinVectorOfRefs - array pin implementation
+
+   PARAMETERS
+     conn- Connection object
+     vecRef - vector of OCIRefs *
+     vecCor - vector of OCIComplexObject *
+
+   DESCRIPTION
+    implements the array pin of refs passed 
+
+   RETURNS
+
+   NOTES
+*/
+template <class T>
+void pinVectorOfRefs( const Connection *conn,
+OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
+LockOptions lockOpt)
+{
+  
+ OCCI_STD_NAMESPACE::vector<void *> vecRef;
+ OCCI_STD_NAMESPACE::vector<void *> vecCor;
+ OCCI_STD_NAMESPACE::vector<PObject *> vecPObj;
+ unsigned int sz = vect.size();
+ vecRef.reserve( sz );
+ vecCor.reserve( sz );
+
+ for ( unsigned int  i=0; i < sz; i++)
+ {
+   vecRef.push_back((void *)vect[i].getRef());
+   vecCor.push_back((void *)vect[i].getCor());
+ }
+ pinVectorOfOCIRefs(conn, vecRef, vecCor,vecPObj, lockOpt);
+ for ( unsigned int  k=0; k < sz; k++)
+   vect[k].setPinnedObject(vecPObj[k]);
+}
+
+
+
+/*---------------------------------------------------------------------------
+                          INTERNAL FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+} /* end of namespace occi */
+} /* end of namespace oracle */
+#endif                                              /* OCCICONTROL_ORACLE */
+
+#endif                                              /* _olint */
diff --git a/src/terralib/drivers/Oracle/OCI/include/occiData.h b/src/terralib/drivers/Oracle/OCI/include/occiData.h
new file mode 100644
index 0000000..50b8d64
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/occiData.h
@@ -0,0 +1,936 @@
+/* Copyright (c) 2000, 2003, Oracle Corporation.  All rights reserved.  */
+   
+/* 
+   NAME 
+     occiData.h - header file for OCCI data classes
+
+   DESCRIPTION 
+     Class definitions for Stream, Blob, Clob ,Bfile,
+     Number, Date, IntervalYM, IntervalDS, Time,
+     Timestamp
+
+   RELATED DOCUMENTS 
+     <note any documents related to this facility>
+ 
+   EXPORT FUNCTION(S) 
+   <external functions declared for use outside package - one-line descriptions>
+
+   INTERNAL FUNCTION(S)
+     <other external functions declared - one-line descriptions>
+
+   EXAMPLES
+
+   NOTES
+     <other useful comments, qualifications, etc.>
+
+   MODIFIED   (MM/DD/YY)
+   shiyer      10/31/03 - Timestamp constructors issue 
+   rvallam     10/07/03 - bug 3089939 - add private method in Date to compute 
+                          hour and min component in daysBetween to be passed 
+                          to set method of IntervalDS.
+   cparampa    08/21/03 - added toCopy to IntervalDS and IntervalYM
+   cparampa    07/14/03 - make SubscriptionImpl friend of Bytes class. 
+   rvallam     02/12/03 - modified BFloat/BDouble interface - BFloat/BDouble
+                          type is now a struct
+   cparampa    01/20/03 - made ProducerImpl friend of Bytes class
+   rvallam     11/19/02 - objects support for interval class
+   shiyer      11/15/02 - Add UTF16 support to IntervalYM & IntervalDS
+   cparampa    12/11/02 - removed references to class Payload
+   cparampa    10/12/02 - AQ additions
+   shiyer      10/12/02 - Added UTF16 version of get/set CharsetId in Clob
+   shiyer      09/06/02 - OCCI globalization support
+   aahluwal    06/04/02 - bug 2360115
+   vvinay      02/21/02 - operator= added for Bytes
+   gayyappa    10/23/01 - fix bug 2073327 , use string instead of enum CharSet  
+   vvinay      12/21/01 - signed char constructor and cast operator
+                          (bug 2073334)
+                          binary operator methods not friends any more
+   gayyappa    15/10/01 - add parameter toCopy to Lob/Timestamp private 
+                          constructors 
+   rvallam     04/09/01 - change private constructor in Number to pass
+                          parameter by reference and made it const
+   chliang     03/05/01 - disable olint
+   rvallam     01/27/02 - remove #include <ostream>
+   gayyappa    01/17/01 - add methods/operators to Interval and
+                          timestamp classes..
+   gayyappa    12/15/00 - interface changes in set methods
+   rvallam     11/29/00 - change method signature in Bytes
+                          added 3 new methods in Number  
+   rvallam     10/20/00  - change method signatures in Date
+   rvallam     09/15/00 - make StmtImpl/ResultSetImpl friend to 
+                          interval classes 
+   gayyappa    08/21/00 - modified timestamp, interval headers.
+                          add OCIEnv to constructor of Bytes.,
+                          removed getOCIRaw from Bytes.
+                          add const to setVector mthds of anydata.
+                          add dvoid* data member to Timestamp/Interval.
+   rvallam     08/10/00 - modified CORE class headers to add friends , 
+                          added private constructor in Bytes
+   slari       08/02/00 - comment out Stream
+   rratnam     08/04/00 - updated the LOB stream interface
+   rkasamse    08/07/00 - make getVector friend of Time
+   slari       07/31/00 - add const to Bytes methods
+   slari       07/25/00 - disable Bytes(Bytes *)
+   slari       07/23/00 - add Bytes
+   gayyappa    07/26/00 - update Timestamp, IntervalYM, IntervalDS.
+   gayyappa    07/04/00 - for fixing a problem in occiNumber
+   rratnam     06/13/00 - Updated LOB class headers
+   kmohan      05/31/00 - Change Environment to Environment * in 
+			  Date constructor
+   kmohan      05/29/00 - No string
+   rkasamse    04/25/00 - Added string class header
+   etucker     04/19/00 - Added CORE class headers
+   kmohan      04/11/00 - Creation
+
+*/
+
+#ifndef _olint   /* disable olint check */
+
+#ifndef OCCIDATA_ORACLE
+# define OCCIDATA_ORACLE
+
+#ifndef OCCICOMMON_ORACLE
+#include <occiCommon.h>
+#endif
+
+#ifndef OCCICONTROL_ORACLE
+#include <occiControl.h>
+#endif
+
+namespace oracle {
+namespace occi {
+class Bytes
+{
+ 
+ public:
+ 
+  Bytes(const Environment *env = NULL);      // default constructor
+ 
+  Bytes(unsigned char *value, unsigned int count, 
+            unsigned int offset = 0, const Environment *env = NULL); 
+
+  Bytes(const Bytes &e); // copy constructor
+
+ 
+                    // public methods
+ 
+  void getBytes(unsigned char *dst, unsigned int count, 
+                        unsigned int srcBegin = 0,
+                        unsigned int dstBegin = 0) const; 
+ 
+  unsigned int length() const;
+ 
+  unsigned char byteAt(unsigned int index) const;
+
+  bool isNull() const;
+ 
+  void setNull();
+
+  void operator=(const Bytes &other);
+ 
+  ~Bytes();
+
+private:
+                                // private data members
+  Bytes(OCIEnv *,OCIRaw *) ;
+  Bytes(Ptr<BytesImpl> bytesPtr) ;
+  Ptr<BytesImpl> ptr_;
+  friend class AnyDataImpl;
+  friend class aq::MessageImpl;
+  friend class aq::ProducerImpl;
+  friend class aq::SubscriptionImpl;
+  friend  void getVector(const AnyData &any, 
+                         OCCI_STD_NAMESPACE::vector<Bytes> &vect) ;
+  friend  void setVector(AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector<Bytes> &vect) ;
+
+};
+ 
+class Bfile
+{
+  public :
+
+    Bfile();
+    Bfile(const Connection *connectionp) ;
+    Bfile(const Bfile &srcBfile) ;
+    ~Bfile();
+    unsigned int length() const ;
+    OCCI_STD_NAMESPACE::string getDirAlias() const ;
+    UString getUStringDirAlias() const ;
+    OCCI_STD_NAMESPACE::string getFileName() const ;
+    UString getUStringFileName() const ;
+    void setName(const OCCI_STD_NAMESPACE::string &dirAlias, 
+                 const OCCI_STD_NAMESPACE::string &fileName) ;
+    void setName(const UString &dirAlias, const UString &fileName) ;
+    bool fileExists() const ; 
+    Bfile& operator =(const Bfile &srcBfile) ;
+    bool operator ==(const Bfile &srcBfile) const ;
+    bool operator !=(const Bfile &srcBfile) const ;
+    void setNull() ;
+    bool isNull() const ;
+    bool isInitialized() const;
+    void open() ;
+    void close() ;
+    bool isOpen() const ;
+    unsigned int read(unsigned int  amt, unsigned char *buffer,
+      unsigned int  bufsize, unsigned int offset = 1) const ;
+    Stream* getStream(unsigned int offset = 1,
+      unsigned int amount =0)  ;
+    void closeStream(Stream *stream);
+
+  private:
+
+    //Data Members:
+
+    // pointer to the FILE locator
+    OCIBFileLocator *filep; 
+
+    // pointer to the ConnectionImpl instance
+    const ConnectionImpl *connp; 
+
+    // pointer to the LobStreamImpl instance obtained from this FILE
+    LobStreamImpl *streamp;
+
+    void *bfileExt;
+
+    //Enumerations:
+    enum {MAXDIRNAMELEN = 32, MAXFILENAMELEN = 256};
+
+    //Constructor: 
+    Bfile(const Connection *connectionp, 
+    OCIBFileLocator *locatorp, bool toCopy = true) ;
+  
+    //Methods:
+    OCIBFileLocator* getLocator() const;
+    void do_getDirAlias( void * dirAlias, ub2 * dirAliasLen) const ;
+    void do_getFileName( void * fileName, ub2 * fileNameLen) const ;
+    void do_setName( void * alias, ub2 aliasLen,
+                     void *fileName, ub2 fileNameLen);   
+  // Friends
+  friend class AnyDataImpl;
+  friend class StatementImpl;
+  friend class ResultSetImpl;
+  friend class Blob;
+  friend class Clob;
+  friend class aq::MessageImpl;
+
+  friend void getVector(const AnyData&, OCCI_STD_NAMESPACE::vector<Bfile>&) ;
+  friend void getVector(Statement*, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Bfile>&) ;
+  friend void getVector(ResultSet*, unsigned int , 
+  OCCI_STD_NAMESPACE::vector<Bfile>&) ;
+  friend void setVector(AnyData&, const OCCI_STD_NAMESPACE::vector<Bfile>&) ;
+  friend void do_setVectorOfBfile(Statement*, unsigned int, 
+  const OCCI_STD_NAMESPACE::vector<Bfile>&, void *, unsigned int, void *, unsigned int ) ;
+};
+
+class Blob
+{
+  public:
+
+    Blob();
+    Blob(const Connection *connectionp) ;
+    Blob(const Blob &srcBlob) ;
+    ~Blob();
+    unsigned int getChunkSize() const ;
+    unsigned int length() const ;
+    Blob& operator =(const Blob &srcBlob) ;
+    bool operator ==(const Blob &srcBlob) const ;
+    bool operator !=(const Blob &srcBlob) const ;
+    void setNull() ;
+    bool isNull() const ;
+    void setEmpty() ;
+    void setEmpty(const Connection *connectionp) ;
+    bool isInitialized() const;
+    void open(LobOpenMode mode=OCCI_LOB_READWRITE) ;
+    void close() ;
+    bool isOpen() const ;
+    void copy(const Blob &srcBlob, unsigned int numBytes,
+      unsigned int  dstOffset =1, unsigned int srcOffset =1) ;
+    void copy(const Bfile &srcBfile, unsigned int numBytes,
+      unsigned int  dstOffset =1, unsigned int srcOffset =1) ;
+    void append(const Blob &srcBlob) ;
+    unsigned int read(unsigned int  amt, unsigned char *buffer,
+      unsigned int  bufsize, unsigned int offset = 1) const ;
+    unsigned int write(unsigned int amt, unsigned char *buffer,
+      unsigned int bufsize, unsigned int offset = 1) ;
+    unsigned int writeChunk(unsigned int amt, unsigned char *buffer,
+      unsigned int bufsize, unsigned int offset = 1) ;
+    void trim(unsigned int newlen) ;
+    Stream* getStream(unsigned int offset = 1,
+      unsigned int amount =0)  ;
+    void closeStream(Stream *stream);
+
+  private:
+
+    //Data Members:
+
+    // pointer to the BLOB locator
+    OCIBlobLocator *lobp; 
+
+    // pointer to the ConnectionImpl instance
+    const ConnectionImpl *connp; 
+
+    // pointer to the LobStreamImpl instance obtained from this LOB
+    LobStreamImpl *streamp; 
+
+    //for future use !
+    void *blobExt;
+
+    //Constructor: 
+    Blob(const Connection *connectionp, 
+    OCIBlobLocator *locatorp, bool toCopy=true) ;
+
+    //Methods:
+    OCIBlobLocator* getLocator() const;
+
+  // Friends
+  friend class AnyDataImpl;
+  friend class StatementImpl;
+  friend class ResultSetImpl;
+
+  friend void getVector(const AnyData&, OCCI_STD_NAMESPACE::vector<Blob>&) ;
+  friend void getVector(Statement*, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Blob>&) ;
+  friend void getVector(ResultSet*, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Blob>&) ;
+  friend void setVector(AnyData&, const OCCI_STD_NAMESPACE::vector<Blob>&) ;
+  friend void do_setVectorOfBlob(Statement*, unsigned int, 
+  const OCCI_STD_NAMESPACE::vector<Blob>&, void *, unsigned int, void *, unsigned int ) ;
+};
+
+class Clob
+{
+  public:
+
+    Clob();
+    Clob(const Connection *connectionp) ;
+    Clob(const Clob &srcClob) ;
+    ~Clob();
+    unsigned int getChunkSize() const ;
+    unsigned int length() const ;
+    OCCI_STD_NAMESPACE::string getCharSetId() const;
+    CharSetForm getCharSetForm() const;
+    void setCharSetId( const OCCI_STD_NAMESPACE::string &charset) ;
+    void setCharSetForm( CharSetForm csfrm) ;
+    Clob& operator =(const Clob &srcClob) ;
+    bool operator ==(const Clob &srcClob) const ;
+    bool operator !=(const Clob &srcClob) const ;
+    void setNull() ;
+    bool isNull() const ;
+    void setEmpty() ;
+    void setEmpty(const Connection *connectionp) ;
+    bool isInitialized() const;
+    void open(LobOpenMode mode=OCCI_LOB_READWRITE) ;
+    void close() ;
+    bool isOpen() const ;
+    void copy(const Clob &srcClob, unsigned int numBytes,
+              unsigned int  dstOffset = 1, unsigned int srcOffset = 1) ;
+    void copy(const Bfile &srcBfile, unsigned int numBytes,
+              unsigned int  dstOffset = 1, unsigned int srcOffset = 1) ;
+    void append(const Clob &srcClob) ;
+    unsigned int read(unsigned int  amt, unsigned char *buffer,
+                      unsigned int  bufsize,  unsigned int offset = 1) const;
+    unsigned int read(unsigned int  amt, utext *buffer,
+                      unsigned int  bufsize,  unsigned int offset = 1) const;
+    unsigned int write(unsigned int amt, unsigned char *buffer,
+                       unsigned int bufsize,  unsigned int offset = 1 );
+    unsigned int write(unsigned int amt, utext *buffer,
+                       unsigned int bufsize,  unsigned int offset = 1 );
+    unsigned int writeChunk(unsigned int amt, unsigned char *buffer,
+                            unsigned int bufsize, unsigned int offset = 1 );
+    unsigned int writeChunk(unsigned int amt, utext *buffer,
+                            unsigned int bufsize, unsigned int offset = 1 );
+    void trim(unsigned int newlen) ;
+    Stream* getStream(unsigned int offset = 1,
+      unsigned int amount =0 );
+    void closeStream(Stream *stream);
+    
+    UString getCharSetIdUString() const;
+    void setCharSetIdUString( const UString &charset) ;
+
+  private:
+
+    //Data Members:
+
+    // pointer to the CLOB locator
+    OCIClobLocator *lobp; 
+
+    // pointer to the ConnectionImpl instance
+    const ConnectionImpl *connp; 
+
+    // pointer to the LobStreamImpl instance obtained from this LOB
+    LobStreamImpl *streamp; 
+
+    //charset id
+    ub2 charsetId;
+
+    //charset form
+    CharSetForm charsetForm;
+
+    //for future use !
+    void *clobExt;
+
+    //Constructor: 
+    Clob(const Connection *connectionp, 
+    OCIClobLocator *locatorp, bool toCopy =true ) ;
+
+    //Methods:
+    OCIClobLocator* getLocator() const;
+    unsigned int do_read( unsigned int amt, void *buffer, 
+    unsigned int bufsize, unsigned int offset) const;
+    unsigned int do_write( unsigned int amt, void *buffer, 
+    unsigned int bufsize, unsigned int offset) ;
+    unsigned int do_writeChunk( unsigned int amt, void *buffer, 
+    unsigned int bufsize, unsigned int offset) ;
+   
+  // Friends
+  friend class AnyDataImpl;
+  friend class StatementImpl;
+  friend class ResultSetImpl;
+
+  friend void getVector(const AnyData&, OCCI_STD_NAMESPACE::vector<Clob>&) ;
+  friend void getVector(Statement*, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Clob>&) ;
+  friend void getVector(ResultSet*, unsigned int, 
+  OCCI_STD_NAMESPACE::vector<Clob>&) ;
+  friend void setVector(AnyData&, const OCCI_STD_NAMESPACE::vector<Clob>&) ;
+  friend void do_setVectorOfClob(Statement*, unsigned int, 
+  const OCCI_STD_NAMESPACE::vector<Clob>&, void *, unsigned int, void *, unsigned int ) ;
+};
+
+class Number
+{
+ 
+ public:
+
+ // Constructors
+  /* default constructor added  */
+  Number();
+  Number(const Number &srcNum);
+  Number(long double val) ;
+  Number(double val) ;
+  Number(float val) ;
+  Number(long val) ;
+  Number(int val) ;
+  Number(short val) ;
+  Number(char val) ;
+  Number(signed char val);
+  Number(unsigned long val) ;
+  Number(unsigned int val) ;
+  Number(unsigned short val) ;
+  Number(unsigned char val) ;
+
+  ~Number();
+  // Methods
+  const Number abs() const ;
+  // unary negate
+  const Number operator-() ;
+  // unary increment
+  Number& operator++() ;
+  const Number operator++(int) ;
+  // unary decrement
+  Number& operator--() ;
+  const Number operator--(int) ;
+  // assigment operator
+  Number& operator=(const Number &a);
+  // add and assign
+  Number& operator+=(const Number &a) ;
+  // subtract and assign
+  Number& operator-=(const Number &a) ;
+  // Mulitply an assign
+  Number& operator*=(const Number &a) ;
+   // divide and assign
+  Number& operator/=(const Number &a) ;
+  // Modulo and assign
+  Number& operator%=(const Number &a) ;
+  // casting operators
+  operator long() const;
+  operator int() const;
+  operator short() const;
+  operator char() const;
+  operator signed char() const;
+  operator unsigned long() const;
+  operator unsigned int() const;
+  operator unsigned short() const;
+  operator unsigned char() const;
+  operator long double() const;
+  operator double() const;
+  operator float() const;
+  // Decimal shift
+  const Number shift(int val) const ;
+  // Integer Power
+  const Number intPower(int val) const ;
+  const Number ceil() const ;
+  const Number floor() const ;
+  const Number squareroot() const ;
+  const int sign() const ;
+  // conversion routines
+  //  Format Number and return as a OCCI_STD_NAMESPACE::string
+  OCCI_STD_NAMESPACE::string toText(const Environment *envp,
+                const OCCI_STD_NAMESPACE::string &fmt,const OCCI_STD_NAMESPACE::string &nlsParam="") const
+                ;
+  UString toText(const Environment *envp,
+                const UString &fmt,const UString &nlsParam) const
+                ;
+  // Create an Number from formatted text
+  void fromText(const Environment *envp,const OCCI_STD_NAMESPACE::string &number,
+                const OCCI_STD_NAMESPACE::string &fmt, const OCCI_STD_NAMESPACE::string &nlsParam = "")
+               ;
+  void fromText(const Environment *envp,
+  const UString &number, 
+  const UString &fmt, const UString &nlsParam);
+  void fromBytes(const Bytes &s) ;
+  Bytes toBytes() const;
+  // truncate digits
+  const Number trunc(int decplace) const ;
+   // round to the decplace place.
+  const Number round(int decplace) const ;
+  // returns an Number with digits decimal digits
+  const Number prec(int digits) const ;
+  const Number sin() const ;
+  const Number cos() const ;
+  const Number tan() const ;
+  const Number hypSin() const ;
+  const Number hypCos() const ;
+  const Number hypTan() const ;
+  const Number arcSin() const ;
+  const Number arcCos() const ;
+  const Number arcTan() const ;
+  const Number arcTan2(const Number &val) const;
+  const Number power(const Number &val) const;
+  const Number exp() const ;
+  const Number ln() const ;
+  const Number log(const Number &val) const;
+  bool isNull() const;
+  void setNull();
+ private:
+  /* Private constructor for constructing number from methods inside  */
+  Number(const OCINumber &result);
+  OCINumber getOCINumber() const;
+
+  OCINumber data;
+  /* a flag to indicate if the  Number  is null */
+  bool numberIsNull;
+  void *numberExt;
+
+  // a >= b
+  friend bool operator>=(const Number &a, const Number &b);
+  // a < = b
+  friend bool operator<=(const Number &a, const Number &b);
+  // a > b
+  friend bool operator>(const Number &a, const Number &b);
+  // a < b
+  friend bool operator<(const Number &a, const Number &b);
+
+  friend class IntervalDS;
+  friend class IntervalYM;
+  friend const IntervalYM operator*(const IntervalYM &a,
+  const Number& factor) ;
+  friend const IntervalDS operator*(const IntervalDS &a,
+  const Number& factor) ;
+  friend const IntervalYM operator/(const IntervalYM &a,
+  const Number &factor) ;
+  friend const IntervalDS operator/(const IntervalDS &a,
+  const Number &factor) ;
+  friend class ResultSetImpl;
+  friend class StatementImpl;
+  friend class AnyDataImpl;
+  friend void getVector(const AnyData &any, 
+  OCCI_STD_NAMESPACE::vector<Number> &vect);
+  friend void setVector(AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector<Number> &vect) ;
+  friend Number MetaData::getNumber(MetaData::AttrId attrid)          const ;
+  friend void getVector(Statement  *stmt, unsigned int paramIndex,
+  OCCI_STD_NAMESPACE::vector<Number> &vect) ;
+  friend void do_setVectorOfNumber(Statement *stmt, unsigned int paramIndex,
+  const OCCI_STD_NAMESPACE::vector<Number> &vect, void *schemaName, unsigned int schemaNameLen,
+  void *typeName, unsigned int typeNameLen);
+  friend void getVector(ResultSet  *rs, unsigned int colIndex,
+  OCCI_STD_NAMESPACE::vector<Number> &vect);
+
+};
+
+class Date
+{
+ public:
+
+  // Constructors
+  Date();
+  Date(const Date &a);
+  Date(const Environment *envp,int year = 1,unsigned int month = 1,
+           unsigned int day = 1,unsigned  int hour = 0,
+           unsigned int minute = 0, unsigned int seconds = 0);
+  ~Date();
+  // Methods
+
+  void setDate(int year = 1,unsigned int month = 1,unsigned int day = 1,
+               unsigned int hour = 0,unsigned int minute = 0,
+               unsigned int seconds = 0);
+  void getDate(int &year,unsigned int &month,unsigned int &day,
+           unsigned int &hour ,unsigned int &min ,unsigned int &sec) const;
+  Bytes toBytes() const ;
+  void fromBytes(const Bytes &byteStream, 
+  const Environment *envp = NULL);
+  OCCI_STD_NAMESPACE::string toText(
+                 const OCCI_STD_NAMESPACE::string &fmt = "",
+                 const OCCI_STD_NAMESPACE::string &nlsParam = "") const;
+  UString toText(
+                 const UString &fmt ,
+                 const UString &nlsParam ) const;
+  void fromText(const OCCI_STD_NAMESPACE::string &datestr,
+                const OCCI_STD_NAMESPACE::string &fmt = "",
+                const OCCI_STD_NAMESPACE::string &nlsParam = "",
+                const Environment *envp = NULL);
+  void fromText(const UString &datestr,
+                const UString &fmt , const UString &nlsParam ,
+                const Environment *envp = NULL);
+  Date toZone(const OCCI_STD_NAMESPACE::string &zone1, const OCCI_STD_NAMESPACE::string &zone2) const;
+  Date& operator=(const Date &d);
+  Date addMonths(int i) const;
+  Date addDays(int i) const ;
+  Date lastDay() const ;
+  IntervalDS daysBetween(const Date &d) const;
+  Date nextDay(const OCCI_STD_NAMESPACE::string &dow) const;
+  Date nextDay(const UString &dow) const;
+  bool isNull() const;
+  void setNull();
+  static Date getSystemDate(const Environment *envp) ;
+
+ private:
+  OCIDate date;
+  OCIEnv *envhp;
+  bool dateIsNull;
+  void *dateExt;
+
+  /* private constructor */
+  Date(OCIEnv *envp,OCIDate dateval);
+  OCIDate getOCIDate() const;
+  void do_toText( void * fmt, ub1 fmtLen, void * nlsParam, 
+                  ub4 nlsParamLen, void * buf, ub4 * bufLen, 
+                  bool isUTF16) const;
+  void do_fromText( void * datestr, ub4 datestrLen,
+                  void * fmt, ub1 fmtLen,
+                  void * nlsParam, ub4 nlsParamLen,
+                  const Environment * envp,
+                  bool isUTF16);
+  Date do_nextDay( void * dow, size_t dowLen, bool isUTF16) const;
+  void constructHourAndMinute(sb4 &seconds, sb4 &hours, sb4 &minutes) const;
+  friend bool operator==(const Date &a,const Date &b);
+  friend bool operator>(const Date &a,const Date &b);
+  friend bool operator<(const Date &a,const Date &b);
+  friend bool operator!=(const Date &a,const Date &b);
+  friend bool operator>=(const Date &a,const Date &b);
+  friend bool operator<=(const Date &a,const Date &b);
+  friend class ResultSetImpl;
+  friend class StatementImpl;
+  friend class AnyDataImpl;
+  friend class aq::MessageImpl;
+  friend void getVector(const AnyData &any, 
+                        OCCI_STD_NAMESPACE::vector<Date> &vect) ;
+  friend void setVector(AnyData &any, 
+                        const OCCI_STD_NAMESPACE::vector<Date> &vect);
+  friend void getVector(Statement  *stmt, unsigned int paramIndex,
+   OCCI_STD_NAMESPACE::vector<Date> &vect)  ;
+  friend void do_setVectorOfDate(Statement *stmt, unsigned int paramIndex, 
+   const OCCI_STD_NAMESPACE::vector<Date> &vect, void *schemaName, unsigned int schemaNameLen,
+   void *typeName, unsigned int typeNameLen) ;
+  friend void getVector(ResultSet  *rs, unsigned int colIndex, 
+  OCCI_STD_NAMESPACE::vector<Date> &vect) ;
+
+}; //class Date
+
+class Timestamp
+{
+  public:
+  Timestamp() ;
+
+  Timestamp( const Environment *env, int year=1,
+             unsigned int month=1, unsigned int day=1, unsigned int hour=0,
+             unsigned int min=0 ,unsigned int sec=0, unsigned int fs=0, 
+             int tzhour=0, int tzmin=0) ;
+  Timestamp( const Environment *env, int year,
+             unsigned int month, unsigned int day, unsigned int hour,
+             unsigned int min ,unsigned int sec, unsigned int fs, 
+             const OCCI_STD_NAMESPACE::string &timezone);
+  Timestamp( const Environment *env, int year,
+             unsigned int month, unsigned int day, unsigned int hour,
+             unsigned int min ,unsigned int sec, unsigned int fs, 
+             const UString &timezone);
+  Timestamp( const Timestamp &src) ;
+  ~Timestamp();
+
+  void getTimeZoneOffset( int &hour, int &minute) const ;
+  void getTime( unsigned int &hour, unsigned int &minute,
+  unsigned int &second, unsigned int &fs) const ;
+  void getDate( int &year, unsigned int &month, unsigned int &day )const ;
+  OCCI_STD_NAMESPACE::string toText(const OCCI_STD_NAMESPACE::string &fmt, 
+                     unsigned int fsprec, 
+                     const OCCI_STD_NAMESPACE::string &nlsParam ="") const   ;
+  UString toText(const UString &fmt, 
+                 unsigned int fsprec, const UString &nlsParam ) const   ;
+  void setTimeZoneOffset( int hour,  int minute)  ;
+  void setTime( unsigned int hour, unsigned int minute,
+  unsigned int second, unsigned int fs)  ;
+  void setDate( int year, unsigned int month, unsigned int day ) ;
+  void setNull() ;
+  void fromText( const OCCI_STD_NAMESPACE::string &timestmpStr, 
+                 const OCCI_STD_NAMESPACE::string &fmt ,
+                 const OCCI_STD_NAMESPACE::string &nlsParam= "", 
+                 const Environment *env =NULL);
+  void fromText( const UString &timestmpStr, 
+                 const UString &fmt , const UString &nlsParam, 
+                 const Environment *env =NULL);
+  bool isNull() const;
+  Timestamp & operator =( const Timestamp &src) ;
+  const IntervalYM subYM(const Timestamp& val) const ;
+  const IntervalDS subDS(const Timestamp& val) const ;
+  const Timestamp intervalAdd(const IntervalDS& val) const ;
+  const Timestamp intervalSub(const IntervalDS& val) const ;
+  const Timestamp intervalAdd(const IntervalYM& val) const ;
+  const Timestamp intervalSub(const IntervalYM& val) const ;
+
+  friend bool operator==(const Timestamp &a,const Timestamp &b);
+  friend bool operator>(const Timestamp &a,const Timestamp &b);
+  friend bool operator<(const Timestamp &a,const Timestamp &b);
+  friend bool operator !=(const Timestamp &a,const Timestamp &b);
+  friend bool operator >=(const Timestamp &a,const Timestamp &b);
+  friend bool operator <=(const Timestamp &a,const Timestamp &b);
+
+  friend class ResultSetImpl;
+  friend class StatementImpl;
+  friend class AnyDataImpl;
+
+  private:
+   OCIDateTime *ocidatetime;
+   OCIEnv *ocienv;
+   void *timestampExt;
+
+   OCIDateTime *getOCIDateTime() const;
+   Timestamp( OCIEnv *env, OCIDateTime *dt, bool toCopy = true) ;
+   void allocateDataMembers( OCIEnv *env) ;
+   void do_TimestampConstruct( const Environment *env, int year, 
+   unsigned int month, unsigned int day, unsigned int hour, unsigned int min, 
+   unsigned int sec, unsigned int fs, void *tzinter);
+
+   friend  void getVector(const AnyData &any,
+   OCCI_STD_NAMESPACE::vector<Timestamp> &vect);
+   friend  void setVector(AnyData &any, 
+   const OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
+   friend Timestamp MetaData::getTimestamp(
+   MetaData::AttrId attrid) const ;
+   friend void getVector(ResultSet  *rs, unsigned int,
+   OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
+   friend void getVector(Statement  *rs, unsigned int,
+   OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
+   friend void do_setVectorOfTimestamp(Statement *stmt, unsigned int paramIndex,
+   const OCCI_STD_NAMESPACE::vector<Timestamp> &vect, void *schemaName, unsigned int schemaNameLen,
+   void *typeName, unsigned int typeNameLen) ;
+}; // class Timestamp
+
+class IntervalDS
+{
+
+  public:
+  IntervalDS() ;
+  IntervalDS( const Environment *env,int day=0, 
+  int hour=0, int minute=0, int second=0, 
+  int fs=0) ;
+  IntervalDS( const IntervalDS &src) ;
+
+  ~IntervalDS();
+
+  int getDay () const ;
+  int getHour () const ;
+  int getMinute () const ;
+  int getSecond() const ;
+  int getFracSec () const ;
+  void set( int day, int hour, int minute, int second, int fracsec) ;
+  void setNull() ;
+  void fromText( const OCCI_STD_NAMESPACE::string &inpstr, const OCCI_STD_NAMESPACE::string &nlsParam ="",
+  const Environment *env=NULL)  ;
+  OCCI_STD_NAMESPACE::string toText( unsigned int lfprec, unsigned int fsprec,
+  const OCCI_STD_NAMESPACE::string &nlsParam="") const ;
+  bool isNull() const;
+  IntervalDS& operator =( const IntervalDS &src) ;
+  IntervalDS& operator +=( const IntervalDS &a);
+  IntervalDS& operator -=( const IntervalDS &a);
+  IntervalDS& operator *=( const Number &factor);
+  IntervalDS& operator /=( const Number &factor);
+
+  friend bool operator>(const IntervalDS &a,
+  const IntervalDS &b) ;
+  friend bool operator<(const IntervalDS &a,
+  const IntervalDS &b) ;
+  friend bool operator >=( const IntervalDS &a, 
+  const IntervalDS &b);
+  friend bool operator <=( const IntervalDS &a, 
+  const IntervalDS &b);
+  
+  //UTF16 support
+  void fromUText( const UString &inpstr, const Environment *env=NULL );
+  UString toUText( unsigned int lfprec, unsigned int fsprec) const;
+
+  private:
+   OCIInterval *ociinter;
+   OCIEnv *ocienv;
+   void *intervalDSExt;
+
+   IntervalDS( OCIEnv *env, OCIInterval *inter, bool toCopy = true) ;
+   OCIInterval * getOCIInterval() const;
+
+   void allocateDataMembers( OCIEnv *env) ;
+   friend const IntervalDS Timestamp::subDS(
+   const Timestamp& val) const ;
+   friend const Timestamp Timestamp::intervalAdd(
+   const IntervalDS& val) const ;
+   friend const Timestamp Timestamp::intervalSub(
+   const IntervalDS& val) const ;
+   friend class Date;
+   friend void getVector(ResultSet  *rs, unsigned int,
+   OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
+   friend void getVector(Statement  *rs, unsigned int,
+   OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
+   friend void do_setVectorOfIntervalDS(Statement *stmt, unsigned int paramIndex,
+   const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect, void *schemaName, unsigned int schemaNameLen,
+   void *typeName, unsigned int typeNameLen) ;
+   friend class StatementImpl;
+   friend class ResultSetImpl;
+   friend class AnyDataImpl;
+   friend  void getVector(const AnyData &any,
+   OCCI_STD_NAMESPACE::vector<IntervalDS> &vect);
+   friend  void setVector(AnyData &any,
+   const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
+
+ 
+};  //class IntervalDS
+
+class IntervalYM
+{
+
+  public:
+  IntervalYM() ;
+  IntervalYM( const Environment *env,int year=0, int month=0) ;
+  IntervalYM( const IntervalYM &src) ;
+  ~IntervalYM();
+
+  int getYear() const ;
+  int getMonth() const ;
+
+  void set( int year, int month) ;
+  void setNull() ;
+  void fromText( const OCCI_STD_NAMESPACE::string &inpstr, const OCCI_STD_NAMESPACE::string &nlsParam="",
+  const Environment *env=NULL) ;
+  OCCI_STD_NAMESPACE::string toText( unsigned int lfprec, const OCCI_STD_NAMESPACE::string &nlsParam="") const;
+  bool isNull() const;
+  IntervalYM & operator =( const IntervalYM &src) ;
+  IntervalYM& operator +=( const IntervalYM &a);
+  IntervalYM& operator -=( const IntervalYM &a);
+  IntervalYM& operator *=( const Number &factor);
+  IntervalYM& operator /=( const Number &factor);
+
+  friend bool operator>(const IntervalYM &a, const IntervalYM &b) ;
+  friend bool operator<( const IntervalYM &a, const IntervalYM &b) ;
+  friend bool operator >=(const IntervalYM &a, const IntervalYM &b);
+  friend bool operator <=(const IntervalYM &a, const IntervalYM &b);
+  
+  //UTF16 support
+  void fromUText( const UString &inpstr, const Environment *env=NULL );
+  UString toUText( unsigned int lfprec ) const;
+
+  private:
+   OCIInterval *ociinter;
+   OCIEnv *ocienv;
+   void *intervalYMExt;
+
+   IntervalYM( OCIEnv *env, OCIInterval *inter, bool toCopy = true) ;
+   OCIInterval *getOCIInterval() const;
+   void allocateDataMembers( OCIEnv *env) ;
+   friend const IntervalYM Timestamp :: subYM(
+   const Timestamp& val) const ;
+   friend const Timestamp Timestamp::intervalAdd(
+   const IntervalYM &val) const ;
+   friend const Timestamp Timestamp::intervalSub(
+   const IntervalYM &val) const ;
+
+   friend void getVector(ResultSet  *rs, unsigned int,
+   OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
+   friend void getVector(Statement  *rs, unsigned int,
+   OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
+   friend void do_setVectorOfIntervalYM(Statement *stmt, unsigned int paramIndex,
+   const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect, void *schemaName, unsigned int schemaNameLen,
+   void *typeName, unsigned int typeNameLen) ;
+
+   friend class StatementImpl;
+   friend class ResultSetImpl;
+   friend class AnyDataImpl;
+   friend  void getVector(const AnyData &any,
+   OCCI_STD_NAMESPACE::vector<IntervalYM> &vect);
+   friend  void setVector(AnyData &any,
+   const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
+
+}; //class IntervalYM
+
+
+Number operator+(const Number &a, const Number &b) ;
+Number operator/(const Number &dividend, const Number &divisor) ;
+Number operator*(const Number &a, const Number &b) ;
+Number operator%(const Number &a, const Number &b) ;
+Number operator-(const Number &subtrahend, const Number &subtractor) ;
+bool operator==(const Number &a, const Number &b);
+bool operator!=(const Number &a, const Number &b);
+
+const IntervalYM operator+(const IntervalYM &a, const IntervalYM &b) ;
+const IntervalYM operator-(const IntervalYM &a, const IntervalYM &b) ;
+const IntervalYM operator*(const IntervalYM &a, const Number& factor);
+const IntervalYM operator/(const IntervalYM &a, const Number &factor);
+bool operator==(const IntervalYM &a, const IntervalYM &b) ;
+bool operator!=(const IntervalYM &a, const IntervalYM &b) ;
+
+const IntervalDS operator+(const IntervalDS &a, const IntervalDS &b) ;
+const IntervalDS operator-(const IntervalDS &a, const IntervalDS &b) ;
+const IntervalDS operator*(const IntervalDS &a, const Number& factor);
+const IntervalDS operator/(const IntervalDS &a, const Number &factor);
+bool operator==(const IntervalDS &a, const IntervalDS &b) ;
+bool operator!=(const IntervalDS &a, const IntervalDS &b) ;
+
+
+typedef struct BFloat
+{
+ float value;
+ bool  isNull;
+
+ BFloat()
+ {
+   isNull = false;
+   value = 0.;
+ }
+} BFloat;
+
+typedef struct BDouble
+{
+ double value;
+ bool   isNull;
+
+ BDouble()
+ {
+   isNull = false;
+   value = 0.;
+ }
+} BDouble;
+
+/*---------------------------------------------------------------------------
+                           EXPORT FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                          INTERNAL FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+} /* end of namespace occi */
+} /* end of namespace oracle */
+#endif                                              /* OCCIDATA_ORACLE */
+
+#endif                                              /* _olint */
diff --git a/src/terralib/drivers/Oracle/OCI/include/occiObjects.h b/src/terralib/drivers/Oracle/OCI/include/occiObjects.h
new file mode 100644
index 0000000..f582b4f
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/occiObjects.h
@@ -0,0 +1,990 @@
+/* Copyright (c) 2000, 2003, Oracle Corporation.  All rights reserved.  */
+
+/* 
+   NAME 
+     occiObjects.h - header file for OCCI object classes
+
+   DESCRIPTION 
+     Class definitions for Ref, RefAny, AnyData
+
+   RELATED DOCUMENTS 
+     <note any documents related to this facility>
+ 
+   EXPORT FUNCTION(S) 
+     <external functions declared for use outside package - one-line 
+     descriptions>
+
+   INTERNAL FUNCTION(S)
+     <other external functions declared - one-line descriptions>
+
+   EXAMPLES
+
+   NOTES
+     <other useful comments, qualifications, etc.>
+
+   MODIFIED   (MM/DD/YY)
+   cparampa    10/28/03 - add PObject::getSQLTypeName
+   shiyer      01/01/03 - add PObject::refresh
+   cparampa    02/19/03 - bug2732941-setFromRef takes schema and typename
+   rvallam     02/12/03 - modify Bfloat/Bdouble interface to use the new
+                          Bfloat/Bdouble type
+   rvallam     11/19/02 - objects support for interval classes
+   cparampa    12/26/02 - Added getType for AnyData,
+                          removed getAs/setFrom methods for Blob/Clob
+   cparampa    10/12/02 - making AnyData a public type
+   rvallam     10/12/02 - added method getCor to get the COR handle and the 
+                          setPinnedObject method - arrayPin 
+   rvallam     10/10/02 - objects performance enhancement - modified
+                          getObject and getVector<T *> to take the
+                          schName and typeName of the object
+   rvallam     10/11/02 - added native float/double API - get(set) methods
+                          for AnyData class
+   shiyer      09/17/02 - Refs performance improvement
+   shiyer      08/14/02 - 10iR1, OCCI Globalization support
+   aahluwal    06/04/02 - bug 2360115
+   vvinay      12/24/01 - declarations for setNull() and isClear() in RefImpl
+   rvallam     11/17/01 - implemented transactional consistency of refs
+   gayyappa    10/01/01 - reserve memory for vectors in set/getVector 
+   rkasamse    07/31/01 - add PObject::new(size_t, void*)
+   gayyappa    07/17/01 - use C style comment in end of #ifdef WIN32COMMON.
+   gayyappa    06/20/01 - fix linux porting bug 1801312.
+   rvallam     06/14/01 - replace call to get(set)VectorOfRefs in 
+                          get(set)Vector for Ref<T> with code in 
+                          get(set)VectorOfRefs
+   rvallam     11/06/01 - renamed internal methods in get/setVector to 
+                          get(set)VectorOfPObjects/get(set)VectorOfOCIRefs
+                          as part of NT porting fix
+                          added destructor to AnyData
+   rratnam     06/07/01 - fixed bug 1816387.
+   rvallam     06/07/01 - fixed bug 1811749 :replaced .data() to .c_str()
+                          for string to char* conversion.
+   rvallam     04/30/01 - modified const methods in Ref (->, *, ptr)
+   rvallam     04/12/01 - passed dummy argument OCCIPOBJECT in getVector
+                          of AnyData for PObject *
+   rvallam     04/09/01 - fixed bug 1721365- call RefAny default constructor
+                          for a NULL Ref in operator RefAny
+   gayyappa    03/29/01 - remove methods for get/set int/float/double/unsigned 
+                          int , wasLastAttrNull, setAttrNull , geSQLTypeName
+                          from AnyData 
+                          as OTT does not use them.
+   gayyappa    03/15/01 - add OCCItype parameter to getVector for OCCIRef.
+   rratnam     03/15/01 - fixed set and getRef / get and setVector for NULL 
+                          Refs, fixed NT compilation errors
+   rratnam     03/13/01 - changed AnyData constructor to take a freeImg flag,
+   rkasamse    03/15/01 - pass OCCI_SQLT_REF to getVector
+   chliang     03/05/01 - disable olint.
+   rvallam     03/01/01 - changed getSessionPtr() to getConnection()
+                          added const methods for dereferencing in Ref
+   gayyappa    02/23/01 - correct template code for setVector
+   gayyappa    12/13/00 - remove allocator from list member for PObject.
+                          bug#1529973
+                          nullify object pointer in clear method of Ref
+   rvallam     11/08/00 - make RefAny constructor public
+   gayyappa    08/21/00 - replace objPtr by objptr.
+                          move templated get/set vector code of anydata 
+                          to header.
+   rkasamse    08/07/00 - make getVector friend of RefAny
+   rkasamse    07/11/00 - take void* instead of AnyDataCtx*
+   rkasamse    07/26/00 - make ResultSetImp friend of RefAny
+   rratnam     06/19/00 - added getConnection in PObject 
+   rvallam     06/13/00 - added Ref<T> and occiRefImpl code
+   rvallam     06/05/00 - to add the Ref<T> code
+   kmohan      06/02/00 -
+   kmohan      05/31/00 - Datamember Connection * changed to ConnectionImpl * 
+                          in class RefAny
+   kmohan      04/11/00 - Ref, RefAny, AnyData class definitions
+                          added
+   rkasamse    04/03/00 - header (interface) files for OCCI Objects clases
+   rkasamse    04/03/00 - Creation
+
+*/
+
+#ifndef _olint   /* disable olint check */
+
+#ifndef OCCIOBJECTS_ORACLE
+# define OCCIOBJECTS_ORACLE
+
+#ifndef OCCICOMMON_ORACLE
+#include <occiCommon.h>
+#endif
+
+namespace oracle {
+namespace occi {
+struct AnyDataCtx {
+   ConnectionImpl *occiSession;
+   OCIAnyData *anyData;
+   dvoid *objHeader;
+   ub4 errNum;
+};
+typedef struct AnyDataCtx AnyDataCtx;
+
+class PObject
+{
+  public:
+        enum LockOption {OCCI_LOCK_WAIT, OCCI_LOCK_NOWAIT};
+        enum UnpinOption {OCCI_PINCOUNT_DECR, OCCI_PINCOUNT_RESET};
+        static void destroy(void *);
+        static void refresh(void *); 
+        PObject();
+        PObject(const void *ctx);
+        PObject(const PObject& obj);
+        virtual ~PObject();
+        PObject& operator=(const PObject& obj);
+        void *operator new(size_t size);
+        void *operator new(size_t size, const Connection *x,
+                           const OCCI_STD_NAMESPACE::string& tablename, 
+                           const char *typeName);
+        void *operator new(size_t size, const Connection *sess,
+               const OCCI_STD_NAMESPACE::string& tablename,
+               const OCCI_STD_NAMESPACE::string& typName ,
+               const OCCI_STD_NAMESPACE::string& schTabName="",
+               const OCCI_STD_NAMESPACE::string& schTypName = "");
+        void *operator new(size_t size, const Connection *sess,
+               const UString& tablename, const UString &typName,
+               const UString& schTabName, const UString& schTypName);
+        void *operator new(size_t size, void *adctx);
+        void operator delete(void *obj, size_t size);
+        RefAny getRef() const;
+        bool isLocked() const;
+        void unpin(UnpinOption mode=OCCI_PINCOUNT_DECR);
+        void pin();
+        void lock(PObject::LockOption lock_option);
+        void unmark();
+        void flush();
+        void markDelete();
+        void markModified();
+        bool isNull() const;
+        void setNull();
+        const Connection *getConnection() const;
+        virtual OCCI_STD_NAMESPACE::string getSQLTypeName() const = 0;
+        virtual void getSQLTypeName(Environment *env, void **schName,
+                     unsigned int &schNameLen, void **typeName,
+                     unsigned int &typeNameLen) const = 0;
+        void getSQLTypeName(Environment *env, void *(*rSQL)(void *),
+                            void **schname, unsigned int &schnamelen,
+                            void **typname, unsigned int &typnamelen) const;
+        virtual void writeSQL(AnyData& stream) = 0;
+        virtual void readSQL(AnyData& stream) = 0;
+  private:
+       static void initialise( void * obj, const Connection * sess,
+              void *schTabName, unsigned int schTabLen,
+              void *tableName, unsigned int tabLen,
+              void *schTypName, unsigned int schTypLen,
+              void *typeName, unsigned int typLen);
+
+        ConnectionImpl  *occiSession_;
+        dvoid *objHeader_;
+        ub2 customNewed_;
+        enum {CUSTOM_NEWED = 0x5cde};
+        ub2 flags_;
+        enum {NULL_INFO = 0x0001, GARBAGE_COLLECTED = 0x0002,
+              REFRESH_OBJECT = 0x0004};
+        // for future use 
+        void *pobjectExt;
+        friend class RefImpl;
+};
+
+class AnyData
+{
+    public:
+    ~AnyData();
+    AnyData(void *any) ;
+    AnyData(const Connection *sessp);
+    AnyData(const Connection *sessp, OCIAnyData *any, bool freeImg = true) ; 
+ 
+    AnyData(const AnyData &src);
+    AnyData& operator = (const AnyData &src);
+
+    OCIAnyData* getOCIAnyData() const;
+    const Connection* getConnection() const;
+
+
+    bool isNull() const ;
+    void setNull() ;
+    OCCI_STD_NAMESPACE::string getString() const ;
+    UString getUString() const ;
+    Blob getBlob() const ;
+    Clob getClob() const ;
+    Bfile getBfile() const ;
+    BFloat  getBFloat() const ;
+    BDouble getBDouble() const ;
+    Number getNumber() const ;
+    Bytes getBytes() const ;
+    Date getDate() const ;
+    Timestamp getTimestamp() const ;
+    IntervalYM getIntervalYM() const ;
+    IntervalDS getIntervalDS() const ;
+    PObject *getObject(void *(*rSQL)(void *)) const ;
+    RefAny getRef() const ;
+
+    void setString(const OCCI_STD_NAMESPACE::string &str)  ;
+    void setUString(const UString &str)  ;
+    void setBlob(const Blob &blob) ;
+    void setClob(const Clob &clob) ;
+    void setBfile(const Bfile &bfile) ;
+    void setBFloat(const BFloat &n) ;
+    void setBDouble(const BDouble &n) ;
+    void setNumber(const Number &n) ;
+    void setBytes(const Bytes &bytes) ;
+    void setDate(const Date &date) ;
+    void setTimestamp(const Timestamp &timestamp)  ;
+    void setIntervalYM(const IntervalYM &intervalym)  ;
+    void setIntervalDS(const IntervalDS &intervalds)  ;
+    void setObject(const PObject *objptr) ;
+    void setRef(const RefAny &ref) ;
+
+    void setFromString(const OCCI_STD_NAMESPACE::string &str)  ;
+    void setFromBfile(const Bfile &bfile) ;
+    void setFromBFloat(const BFloat &n) ;
+    void setFromBDouble(const BDouble &n) ;
+    void setFromNumber(const Number &n) ;
+    void setFromBytes(const Bytes &bytes) ;
+    void setFromDate(const Date &date) ;
+    void setFromTimestamp(const Timestamp &timestamp)  ;
+    void setFromIntervalYM(const IntervalYM &intervalym)  ;
+    void setFromIntervalDS(const IntervalDS &intervalds)  ;
+    void setFromObject(const PObject *objptr) ;
+    void setFromRef(const RefAny &ref,
+                    const OCCI_STD_NAMESPACE::string &typname,
+                    const OCCI_STD_NAMESPACE::string &schname) ;
+
+    OCCI_STD_NAMESPACE::string getAsString() const ;
+    Bfile getAsBfile() const ;
+    BFloat  getAsBFloat() const ;
+    BDouble getAsBDouble() const ;
+    Number getAsNumber() const ;
+    Bytes getAsBytes() const ;
+    Date getAsDate() const ;
+    Timestamp getAsTimestamp() const ;
+    IntervalYM getAsIntervalYM() const ;
+    IntervalDS getAsIntervalDS() const ;
+    PObject *getAsObject() const ;
+    RefAny getAsRef() const ;
+
+    TypeCode getType() const;
+    
+    private:
+
+                                 
+    // private data members
+    Ptr<AnyDataImpl> anyDataImplPtr;              
+   
+
+};
+
+template <class T>
+class Ref
+{
+  public:
+
+  Ref();
+  Ref(const T *obj) ;
+  Ref(const RefAny &refAny) ;
+  Ref(const Ref<T> &src) ;
+  Ref(const Connection *sessp, OCIRef *tref, bool copy=TRUE) 
+  ;
+ ~Ref();
+  Ref<T>& operator=(const Ref<T> &src) 
+  ;
+  Ref<T>& operator=(const T *obj) ;
+  Ref<T>& operator=(const RefAny &src);
+  T * operator->() ;
+  T * ptr() ;
+  T & operator *() ;
+  const T * operator->() const;
+  const T * ptr()  const;
+  const T & operator *() const ;
+  void markDelete() ;
+  void unmarkDelete() ;
+  void setNull();
+  bool isNull() const;
+  void clear() ;
+  bool isClear() const;
+  void setPrefetch(const OCCI_STD_NAMESPACE::string &typeName, 
+                   unsigned int depth);
+  void setPrefetch(const OCCI_STD_NAMESPACE::string &schName,
+                   const OCCI_STD_NAMESPACE::string &typeName,
+                   unsigned int depth);
+  void setPrefetch(const UString &schName,
+                   const UString &typeName,
+                   unsigned int depth);
+  void setPrefetch(unsigned int depth) ;
+  void setLock(LockOptions );
+  operator RefAny() const;
+  OCIRef *getRef() const;
+  const Connection *getConnection() const;
+  bool operator == (const Ref<T> &ref) const;
+  bool operator != (const Ref<T> &ref) const;
+  bool operator == (const RefAny &refAnyR) const ;
+  bool operator != (const RefAny &refAnyR) const ;
+  OCIComplexObject *getCor() const;
+  void destroy();
+  void setPinnedObject(PObject *objPtr); 
+ private:
+
+  RefImpl  *rimplPtr;
+};
+
+
+class RefImpl
+{
+  public:
+
+  RefImpl();
+  RefImpl(PObject *obj) ;
+  RefImpl(const RefAny &refAny) ;
+  RefImpl(const RefImpl &src) ;
+  RefImpl(const Connection *sessp, OCIRef *tref, 
+  bool copy=TRUE) ;
+  ~RefImpl();
+  bool isNull() const ;
+  void setNull() ;
+  void markDelete() ;
+  void unmarkDelete() ;
+  void clear() ;
+  bool isClear() const ;
+  void setPrefetch(const OCCI_STD_NAMESPACE::string &typeName, 
+                   unsigned int depth) ;
+  void setPrefetch(const OCCI_STD_NAMESPACE::string &schName,
+                   const OCCI_STD_NAMESPACE::string &typeName,
+                   unsigned int depth);
+  void setPrefetch(const UString &schName,
+                   const UString &typeName,
+                   unsigned int depth);
+  void setPrefetch(unsigned int depth) ;
+  void setLock(LockOptions lckOption) ;
+  PObject *pin() ;
+  void unpin(PObject *obj) ;
+  void setRefFromObjPtr(const PObject *obj) ;
+  OCIRef* getRef() const;
+  void setRefImpl(RefImpl *rptr);
+  const Connection * getConnection() const;
+  bool operator == (const RefImpl &refI) const ;
+  bool operator == (const RefAny &refAnyR) const ;
+  void assignObj(PObject *newObjPtr) ;
+  void assignRefAny(const RefAny &src) ;
+  // added following methods
+  bool isEqual(PObject *obj);
+  void operator = ( const RefImpl &src);
+  void destroy();
+  OCIComplexObject *getCor() const;
+  void setPinnedObject( PObject *objPtr);
+ private:
+
+  OCIRef *ref;
+  const ConnectionImpl *sessp;
+  OCIComplexObject *corhp;
+  OCCI_STD_NAMESPACE::list<void *> descriptorList;
+  LockOptions lockOption;
+  // added data member for object header
+  dvoid *objHeader;
+  //common implementation function for setPrefetch
+  void do_setPrefetch(void *schName, unsigned int schNameLen,
+                      void *typeName, unsigned int typeNameLen,
+                      unsigned int depth);
+};
+
+
+class RefAny
+{
+  public:
+
+  RefAny();
+  RefAny (const Connection *sessptr, const OCIRef *ref);
+  RefAny (const Connection *sessptr, const OCIRef *ref, bool isowner);
+  ~RefAny() ;
+  RefAny(const RefAny& src) ;
+  RefAny& operator=(const RefAny& src) ;
+  void markDelete() ;
+  void unmarkDelete() ;
+  void clear() ;
+  bool isNull() const;
+  OCIRef * getRef() const;
+  const Connection * getConnection() const;
+  bool operator == (const RefAny &refAnyR) const;
+  bool operator != (const RefAny &refAnyR) const;
+  bool isOwner() const;
+
+  private:
+
+  OCIRef *ref;
+  const ConnectionImpl *sessp;
+  // for future use
+  void *refanyExt;
+  bool owner;
+
+  friend RefAny MetaData::getRef(MetaData::AttrId) const;
+  friend RefAny PObject::getRef() const;
+  friend class AnyDataImpl;
+  friend class ResultSetImpl;
+  friend class StatementImpl;
+  friend void getVector(const ResultSet  *rs,
+                        unsigned int colIndex,
+                        OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
+  friend void getVector(const Statement  *stmt,
+                        unsigned int colIndex,
+                        OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
+};
+
+template <class T>
+Ref<T>::Ref()
+{
+   rimplPtr = new RefImpl();
+}
+
+template <class T>
+Ref<T>::Ref(const T *obj)
+{
+   rimplPtr = new RefImpl((PObject *)obj);
+}
+
+template <class T>
+Ref<T>::Ref(const RefAny &refAny)
+
+{
+  rimplPtr = new RefImpl(refAny);
+}
+
+template <class T>
+Ref<T>::Ref(const Ref<T>& src)
+
+{
+    rimplPtr = new RefImpl(*(src.rimplPtr));
+}
+
+template <class T>
+Ref<T>::Ref(const Connection *sessp, OCIRef *tref, bool copy)
+
+{
+   rimplPtr = new RefImpl(sessp, tref, copy);
+}
+
+template <class T>
+Ref<T>::~Ref()
+{
+  delete rimplPtr;
+}
+
+
+template <class T>
+Ref<T>& Ref<T>::operator=(const Ref<T> &src)
+{
+   if (&src == this)
+     return *this;
+   *rimplPtr = *(src.rimplPtr);
+   return *this;
+}
+
+template <class T>
+Ref<T>& Ref<T>::operator=(const T *obj)
+{
+  if (rimplPtr->isEqual((PObject *)obj))
+    return *this;
+  rimplPtr->assignObj((PObject *)obj);
+  return *this;
+}
+
+template <class T>
+Ref<T>& Ref<T>::operator=(const RefAny &src)
+{
+  rimplPtr->assignRefAny(src);
+  return *this;
+}
+
+template <class T>
+T* Ref<T>::operator->()
+{
+  return ((T *)rimplPtr->pin());
+}
+
+template <class T>
+T* Ref<T>::ptr()
+{
+  return ((T *)rimplPtr->pin());
+}
+
+template <class T>
+T& Ref<T>::operator * ()
+{
+  return ((T &)(*(rimplPtr->pin())));
+}
+
+template <class T>
+const T* Ref<T>::operator->() const
+{
+  return ((const T *)rimplPtr->pin());
+}
+
+template <class T>
+const T* Ref<T>::ptr() const
+{
+  return ((const T *)rimplPtr->pin());
+}
+
+template <class T>
+const T& Ref<T>::operator * () const
+{
+  return ((const T &)(*(rimplPtr->pin())));
+}
+
+template <class T>
+void Ref<T>::markDelete ()
+{
+   rimplPtr->markDelete();
+}
+
+template <class T>
+void Ref<T>::unmarkDelete ()
+{
+   rimplPtr->unmarkDelete();
+}
+
+template <class T>
+void Ref<T>::setNull()
+{
+   rimplPtr->setNull();
+}
+
+template <class T>
+bool Ref<T>::isNull() const
+{
+  return rimplPtr->isNull();
+}
+
+template <class T>
+void Ref<T>::clear ()
+{
+   rimplPtr->clear();
+}
+
+template <class T>
+bool Ref<T>::isClear() const
+{
+   return rimplPtr->isClear();
+}
+
+template <class T>
+void Ref<T>::setPrefetch (const OCCI_STD_NAMESPACE::string &typeName,
+unsigned int depth)
+
+{
+  rimplPtr->setPrefetch(typeName,depth);
+}
+
+template <class T>
+void Ref<T>::setPrefetch (const OCCI_STD_NAMESPACE::string &schemaName,
+const OCCI_STD_NAMESPACE::string &typeName,
+unsigned int depth)
+
+{
+  rimplPtr->setPrefetch(schemaName,typeName,depth);
+}
+
+template <class T>
+void Ref<T>::setPrefetch (const UString &schemaName,
+const UString &typeName,
+unsigned int depth)
+
+{
+  rimplPtr->setPrefetch(schemaName,typeName,depth);
+}
+
+template <class T>
+void Ref<T>::setPrefetch (unsigned int depth)
+
+{
+  rimplPtr->setPrefetch(depth);
+}
+
+template <class T>
+void Ref<T>::setLock (LockOptions lckOption)
+{
+  rimplPtr->setLock(lckOption);
+}
+
+template <class T>
+OCIRef* Ref<T>::getRef() const
+{
+  return (rimplPtr->getRef());
+}
+
+template<class T>
+const Connection* Ref<T>::getConnection () const
+{
+  return (rimplPtr->getConnection());
+}
+
+template <class T>
+Ref<T>::operator RefAny () const
+{
+  if (isNull())
+    return  RefAny();
+  return (RefAny(rimplPtr->getConnection(), rimplPtr->getRef()));
+}
+
+template <class T>
+bool Ref<T>::operator ==(const Ref<T> &ref) const
+
+{
+  return ( (*rimplPtr) == (*(ref.rimplPtr)) );
+}
+
+template <class T>
+bool Ref<T>::operator !=(const Ref<T> &ref) const
+
+{
+  return ( !((*rimplPtr) == (*(ref.rimplPtr))) );
+}
+
+template <class T>
+bool Ref<T>::operator == (const RefAny & refAnyR) const
+
+{
+  return ( (*rimplPtr) == refAnyR );
+}
+
+template <class T>
+bool Ref<T>::operator != (const RefAny & refAnyR) const
+
+{
+  return ( !((*rimplPtr) == refAnyR ));
+}
+
+template <class T>
+void Ref<T>::destroy()
+{
+   rimplPtr->destroy();
+}
+
+template <class T>
+OCIComplexObject * Ref<T>::getCor() const
+{
+  return (rimplPtr->getCor());
+}
+
+template < class T>
+void Ref<T>::setPinnedObject( PObject *objPtr)
+{
+   rimplPtr->setPinnedObject(objPtr);
+}
+
+/*---------------------------------------------------------------------------
+                PROTOTYPES USED BY FUNCTION TEMPLATES
+ ---------------------------------------------------------------------------*/
+  void getVectorOfOCIRefs( const AnyData &any, 
+  OCCI_STD_NAMESPACE::vector<void *> &vect);
+  void getVectorOfPObjects( const AnyData &any,
+  OCCI_STD_NAMESPACE::vector< PObject* > &vect,
+  void *(*rSQL)(void *))  ;
+  void setVectorOfOCIRefs( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector<void *> &vect,
+  const OCCI_STD_NAMESPACE::vector< OCIInd> &vec_ind) ;
+  void setVectorOfPObjects( AnyData &any, 
+  const OCCI_STD_NAMESPACE::vector< PObject* > &vect) ;
+
+/*---------------------------------------------------------------------------
+                           EXPORT FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+/*------------------- getVector for POBject----------------------------*/
+/*
+   NAME
+      getVector - overloaded function. Retrieves the attribute in the
+   current position as a vector of PObject
+
+   PARAMETERS
+      any - AnyData
+      vect- reference to vector of PObject (OUT parameter).
+
+   DESCRIPTION
+   Retrieves the attribute in the current position as a vector
+   of PObject
+   The attribute at the current position should be a collection
+   type (varray or nested table). The SQL type of the elements in
+   the collection should be compatible with PObject
+
+   RETURNS
+     nothing
+
+   NOTES
+     compatible SQL types : user defined types (SQLT_NTY) etc.
+*/
+
+#ifdef WIN32COMMON
+// and other platforms that do not support
+// partial function template specialization
+ template <class T>
+ void getVector(const AnyData &any, OCCI_STD_NAMESPACE::vector<T> &vect,
+ void *(*rSQL)(void *))
+ {
+   OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
+   getVectorOfPObjects( any, vec_pobj, rSQL);
+
+   vect.clear();
+   unsigned int size= vec_pobj.size();
+   vect.reserve( size );
+   for( unsigned int i=0; i< size; i++)
+      vect.push_back( (T)vec_pobj[i] );
+ }
+#else
+ template <class T>
+ void getVector(const AnyData &any, OCCI_STD_NAMESPACE::vector<T*> &vect,
+ void *(*rSQL)(void *)) 
+ {
+   OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
+   getVectorOfPObjects( any, vec_pobj, rSQL);
+
+   vect.clear();
+   unsigned int size= vec_pobj.size();
+   vect.reserve( size );
+   for( unsigned int i=0; i< size; i++)
+      vect.push_back( (T*)vec_pobj[i] );
+ }
+#endif /* end of #ifdef WIN32COMMON */
+
+ /*------------------- getVector for Ref<T>----------------------------*/
+/*
+   NAME
+      getVector - overloaded function. Retrieves the attribute in the
+   current position as a vector of PObject
+
+   PARAMETERS
+      any - AnyData
+      vect- reference to vector of PObject (OUT parameter).
+
+   DESCRIPTION
+   Retrieves the attribute in the current position as a vector
+   of PObject
+   The attribute at the current position should be a collection
+   type (varray or nested table). The SQL type of the elements in
+   the collection should be compatible with PObject
+
+   RETURNS
+     nothing
+
+   NOTES
+     compatible SQL types : user defined types (SQLT_NTY) etc.
+*/
+#ifndef WIN32COMMON
+ template <class T>
+ void getVector(const AnyData &any,OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) 
+ {
+   OCCI_STD_NAMESPACE::vector< void *> vec_ref;
+   getVectorOfOCIRefs( any, vec_ref);
+
+   vect.clear();
+   unsigned int size = vec_ref.size();
+   vect.reserve( size );
+   const Connection *sess = any.getConnection();
+
+   for (unsigned int i=0; i< size; i++)
+   {
+     if (vec_ref[i] == (OCIRef *)0)
+       vect.push_back(Ref<T>());     // pushing a default-constructed Ref
+     else
+       vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE));
+   }
+ }
+#endif /* end of #ifndef WIN32COMMON  */
+ 
+/*-----------------------setVector for PObject--------------------------*/
+/*
+   NAME
+     setVector - overloaded function. sets the attribute in the current
+   position of anydata with the vector elements.
+
+   PARAMETERS
+      none.
+
+   DESCRIPTION
+      sets the attribute in the current position in anydata with the
+   vector elements.
+  The attribute in the current position of anydata should be a
+  collection type. If the collection type is a varray, the input vector
+  size should be equal to the size of the varray. Also the SQL type of
+  the collection's elements should be compatible with PObject.
+
+   RETURNS
+     nothing.
+
+   NOTES
+     compatible SQL types : SQLT_NTY  (user defined types).
+*/
+#ifdef WIN32COMMON
+// and other platforms that do not support
+// partial function template specialization
+
+ template <class T>
+ void setVector(AnyData &any, const OCCI_STD_NAMESPACE::vector<T> &vect) 
+ {
+   OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
+   unsigned int size= vect.size();
+   vec_pobj.reserve( size );
+   for( unsigned int i=0; i< size; i++)
+      vec_pobj.push_back( vect[i] );
+   setVectorOfPObjects( any, vec_pobj);
+
+ }
+ 
+#else
+
+ template <class T>
+ void setVector(AnyData &any, const OCCI_STD_NAMESPACE::vector<T*> &vect)
+ {
+   OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
+   unsigned int size= vect.size();
+   vec_pobj.reserve( size );
+   for( unsigned int i=0; i< size; i++)
+      vec_pobj.push_back( vect[i] );
+   setVectorOfPObjects( any, vec_pobj);
+
+ }
+#endif /* end of #ifdef WIN32COMMON */
+
+/*-----------------------setVector for Ref<T>--------------------------*/
+/*
+   NAME
+     setVector - overloaded function. sets the attribute in the current
+   position of anydata with the vector elements.
+
+   PARAMETERS
+      none.
+
+   DESCRIPTION
+      sets the attribute in the current position in anydata with the
+   vector elements.
+  The attribute in the current position of anydata should be a
+  collection type. If the collection type is a varray, the input vector
+  size should be equal to the size of the varray. Also the SQL type of
+  the collection's elements should be compatible with PObject.
+
+   RETURNS
+     nothing.
+
+   NOTES
+     compatible SQL types : SQLT_NTY  (user defined types).
+*/
+#ifndef WIN32COMMON
+ template <class T>
+ void setVector(AnyData &any, const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
+ {
+   OCCI_STD_NAMESPACE::vector< void *> vec_ref;
+   OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
+
+   unsigned int size= vect.size();
+   vec_ref.reserve( size );
+   vec_ind.reserve( size );
+   for( unsigned int i=0; i< size; i++)
+   {
+      vec_ref.push_back( vect[i].getRef() );
+      vec_ind.push_back(vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
+   }
+   setVectorOfOCIRefs( any, vec_ref, vec_ind);
+
+ }
+#endif  /* end of #ifndef WIN32COMMON */
+ 
+// Platform independent get/setVectorOfRefs method added 
+// get(set)Vector of Ref<T> and get(set)VectorOfRefs are identical
+// in functionality.
+
+ /*------------------- getVectorOfRefs for Ref<T>----------------------------*/
+/*
+   NAME
+      getVectorOfRefs - overloaded function. Retrieves the attribute in the
+   current position as a vector of PObject
+
+   PARAMETERS
+      any - AnyData
+      vect- reference to vector of PObject (OUT parameter).
+
+   DESCRIPTION
+   Retrieves the attribute in the current position as a vector
+   of PObject
+   The attribute at the current position should be a collection
+   type (varray or nested table). The SQL type of the elements in
+   the collection should be compatible with PObject
+
+   RETURNS
+     nothing
+
+   NOTES
+     compatible SQL types : user defined types (SQLT_NTY) etc.
+*/
+
+ template <class T>
+ void getVectorOfRefs(const AnyData &any,
+                      OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
+ {
+   OCCI_STD_NAMESPACE::vector< void *> vec_ref;
+   getVectorOfOCIRefs( any, vec_ref);
+
+   vect.clear();
+   unsigned int size = vec_ref.size();
+   vect.reserve( size );
+   const Connection *sess = any.getConnection();
+
+   for (unsigned int i=0; i< size; i++)
+   {
+     if (vec_ref[i] == (OCIRef *)0)
+       vect.push_back(Ref<T>());     // pushing a default-constructed Ref
+     else
+       vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE));
+   }
+ }
+
+/*-----------------------setVectorOfRefs for Ref<T>--------------------------*/
+/*
+   NAME
+     setVectorOfRefs - overloaded function. sets the attribute in the current
+   position of anydata with the vector elements.
+
+   PARAMETERS
+      none.
+
+   DESCRIPTION
+      sets the attribute in the current position in anydata with the
+   vector elements.
+  The attribute in the current position of anydata should be a
+  collection type. If the collection type is a varray, the input vector
+  size should be equal to the size of the varray. Also the SQL type of
+  the collection's elements should be compatible with PObject.
+
+   RETURNS
+     nothing.
+
+   NOTES
+     compatible SQL types : SQLT_NTY  (user defined types).
+*/
+
+ template <class T>
+ void setVectorOfRefs(AnyData &any, 
+                      const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
+
+ {
+   OCCI_STD_NAMESPACE::vector< void *> vec_ref;
+   OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
+
+   unsigned int size= vect.size();
+   vec_ref.reserve( size );
+   vec_ind.reserve( size );
+   for( unsigned int i=0; i< size; i++)
+   {
+      vec_ref.push_back( vect[i].getRef() );
+      vec_ind.push_back(vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
+   }
+   setVectorOfOCIRefs( any, vec_ref, vec_ind);
+
+ }
+
+
+/*---------------------------------------------------------------------------
+                          INTERNAL FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+} /* end of namespace occi */
+} /* end of namespace oracle */
+#endif                                              /* OCCIOBJECTS_ORACLE */
+
+#endif                                              /* _olint */
diff --git a/src/terralib/drivers/Oracle/OCI/include/oci.h b/src/terralib/drivers/Oracle/OCI/include/oci.h
new file mode 100644
index 0000000..466b7a2
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/oci.h
@@ -0,0 +1,2366 @@
+/*
+ * $Header$
+ */
+
+/* Copyright (c) 1995, 2003, Oracle Corporation.  All rights reserved.  */
+ 
+/* 
+   NAME 
+     oci.h - V8 Oracle Call Interface public definitions
+
+   DESCRIPTION 
+     This file defines all the constants and structures required by a V8
+     OCI programmer.
+
+   RELATED DOCUMENTS 
+     V8 OCI Functional Specification 
+     Oracle Call Interface Programmer's Guide Vol 1 and 2
+ 
+   INSPECTION STATUS 
+     Inspection date: 
+     Inspection status: 
+     Estimated increasing cost defects per page: 
+     Rule sets: 
+ 
+   ACCEPTANCE REVIEW STATUS 
+     Review date: 
+     Review status: 
+     Reviewers: 
+ 
+   PUBLIC FUNCTION(S) 
+     None
+
+   PRIVATE FUNCTION(S) 
+     None
+ 
+   EXAMPLES 
+ 
+   NOTES 
+
+
+   MODIFIED   (MM/DD/YY)
+   chliang     11/26/03 - add OCI_ATTR_RESERVED_19 
+   preilly     10/23/03 - Make OCI_ATTR_DIRPATH_METADATA_BUF private 
+   chliang     08/07/03 - add OCI_ATTR_SKIP_BUFFER
+   srseshad    03/12/03 - convert public oci api to ansi
+   weiwang     05/14/03 - remove iot creation for rule sets
+   rkoti       04/15/03 - [2746515] add fntcodes for Unlimited size LOB 6003
+   tcruanes    05/13/03 - add slave SQL OCI execution mode
+   rkoti       02/21/03 - [2761455] add OCI_FNCODE_AQENQARRAY,
+                          OCI_FNCODE_AQDEQARRAY and update OCI_FNCODE_MAXFCN
+   tkeefe      01/29/03 - bug-2773794: Add new interface for setting Kerb attrs
+   aahluwal    02/06/03 - add OCI_ATTR_TRANSFORMATION_NO
+   weiwang     12/05/02 - add OCI_ATTR_USER_PROPERTY
+   ataracha    01/03/03 - include ocixmldb.h
+   preilly     12/05/02 - Add wait attribute for locking when using dir path
+   tkeefe      01/03/03 - bug-2623771: Added OCI_ATTR_KERBEROS_KEY
+   lchidamb    12/13/02 - end-to-end tracing attributes
+   msakayed    10/28/02 - Bug #2643907: add OCI_ATTR_DIRPATH_SKIPINDEX_METHOD
+   rphillip    11/13/02 - Add OCIP_ATTR_DIRPATH_INDEX
+   sagrawal    10/13/02 - liniting
+   sagrawal    10/03/02 - PL/SQL Compiler warnings
+   jstenois    11/07/02 - remove ocixad.h
+   chliang     10/21/02 - add OCI_ATTR_RESERVED_16,17
+   hsbedi      10/30/02 - grabtrans 'jstenois_fix_xt_convert'
+   aahluwal    10/12/02 - add OCI_ATTR_AQ_NUM_E_ERRORS/OCI_ATTR_AQ_ERROR_INDEX
+   bdagevil    10/21/02 - add SQL analyze internal exec mode
+   csteinba    10/11/02 - add OCI_ATTR_RESERVED_16
+   chliang     10/12/02 - add bind row callback attributes
+   preilly     10/25/02 - Add new reserved parameters
+   tkeefe      10/31/02 - bug-2623771: Added OCI_ATTR_AUDIT_SESSION_ID
+   csteinba    10/04/02 - Add OCI_ATTR_RESERVED_15
+   mhho        10/11/02 - add new credential constant
+   thoang      09/25/02 - Add OCI_XMLTYPE_CREATE_CLOB
+   skaluska    10/07/02 - describe rules objects
+   csteinba    09/16/02 - Remove OCI_CACHE
+   gtarora     10/03/02 - OCI_ATTR_COL_SUBS => OCI_ATTR_OBJ_SUBS
+   msakayed    09/09/02 - Bug #2482469: add OCI_ATTR_DIRPATH_RESERVED_[3-6]
+   aahluwal    08/30/02 - adding dequeue across txn group
+   srseshad    04/24/02 - Add attribute OCI_ATTR_SPOOL_STMTCACHESIZE.
+   ebatbout    07/22/02 - Remove OCI_ATTR_RESERVED_11.
+   abande      01/17/02 - Bug 1788921; Add external attribute.
+   aahluwal    06/04/02 - bug 2360115
+   pbagal      05/24/02 - Incorporate review comments
+   pbagal      05/22/02 - Introduce instance type attribute.
+   whe         07/01/02 - add OCI_BIND_DEFINE_SOFT flags
+   gtarora     07/01/02 - Add OCI_ATTR_COL_SUBS
+   tkeefe      05/30/02 - Add support for new proxy authentication credentials
+   dgprice     12/18/01 - bug 2102779 add reserved force describe
+   schandir    11/19/01 - add/modify modes.
+   schandir    11/15/01 - add OCI_SPC_STMTCACHE.
+   schandir    12/06/01 - change mode value of OCI_SPOOL.
+   msakayed    11/02/01 - Bug #2094292: add OCI_ATTR_DIRPATH_INPUT
+   dsaha       11/09/01 - add OCI_DTYPE_RESERVED1
+   skabraha    11/05/01 - new method flag
+   skabraha    10/25/01 - another flag for XML
+   skabraha    10/11/01 - describe flags for subtypes
+   nbhatt      09/18/01 - new reserved AQ flags
+   celsbern    10/19/01 - merge LOG to MAIN
+   ksurlake    10/12/01 - add OCI_ATTR_RESERVED_13
+   ksurlake    08/13/01 - add OCI_ATTR_RESERVED_12
+   schandir    09/24/01 - Adding stmt caching
+   abande      09/04/01 - Adding session pooling
+   sagrawal    10/23/01 - add new bit for OCIPHandleFree
+   preilly     10/25/01 - Add support for specifying metadata on DirPathCtx
+   skabraha    09/24/01 - describe flags for XML type
+   schandir    09/24/01 - Adding stmt caching
+   abande      09/04/01 - Adding session pooling
+   stakeda     09/17/01 - add OCI_NLS_CHARSET_ID
+   whe         09/19/01 - add OCIXMLType create options
+   rpingte     09/11/01 - add OCI_MUTEX_ENV_ONLY and OCI_NO_MUTEX_STMT
+   cmlim       08/28/01 - mod datecache attrs to use same naming as dpapi attrs
+   wzhang      08/24/01 - Add new keywords for OCINlsNameMap.
+   rphillip    05/02/01 - Add date cache attributes
+   rphillip    08/22/01 - Add new stream version
+   ebatbout    04/13/01 - add definition, OCI_ATTR_RESERVED_11
+   chliang     04/12/01 - add shortnames for newer oci funcation
+   wzhang      04/11/01 - Add new OCI NLS constants.
+   cmlim       04/13/01 - remove attrs not used by dpapi (151 & 152 avail)
+   rkambo      03/23/01 - bugfix 1421793
+   cmlim       04/02/01 - remove OCI_ATTR_DIRPATH_{NESTED_TBL, SUBST_OBJ_TBL}
+                        - note: attribute #s 186 & 205 available
+   whe         03/28/01 - add OCI_AFC_PAD_ON/OFF mode
+   preilly     03/05/01 - Add stream versioning support to DirPath context
+   schandir    12/18/00 - remove attr CONN_INCR_DELAY.
+   schandir    12/12/00 - change mode from OCI_POOL to OCI_CPOOL.
+   cbarclay    01/12/01 - add atribute for OCIP_ATTR_TMZ
+   whe         01/07/01 - add attributes related to UTF16 env mode
+   slari       12/29/00 - add blank line
+   slari       12/28/00 - OCI_ATTR_RESERVED_10
+   whe         12/19/00 - add OCI_ENVCR_RESERVED3
+   rpang       11/29/00 - Added OCI_ATTR_ORA_DEBUG_JDWP attribute
+   cmlim       11/28/00 - support substitutable object tables in dpapi
+   akatti      10/09/00 - [198379]:add OCIRowidToChar
+   sgollapu    10/11/00 - Add OCI_PREP_RESERVED_1
+   sgollapu    08/27/00 - add attribute to get erroneous column
+   sgollapu    07/29/00 - Add snapshot attributes
+   kmohan      09/18/00 - add OCI_FNCODE_LOGON2
+   abrumm      10/08/00 - include ocixad.h
+   mbastawa    10/04/00 - add OCI_ATTR_ROWS_FETCHED
+   nbhatt      08/24/00 - add transformation attribute
+   dmwong      08/22/00 - OCI_ATTR_CID_VALUE -> OCI_ATTR_CLIENT_IDENTIFIER.
+   cmlim       08/30/00 - add OCI_ATTR_DIRPATH_SID
+   dsaha       08/18/00 - add OCI_ATTR_RESERVED_5
+   amangal     08/17/00 - Merge into 8.2 : 1194361
+   slari       08/03/00 - add OCI_ATTR_HANDLE_POSITION
+   dsaha       07/20/00 - 2rt exec
+   sgollapu    07/04/00 - Add virtual session flag
+   cmlim       07/07/00 - add OCI_ATTR_DIRPATH_OID, OCI_ATTR_DIRPATH_NESTED_TBL
+   etucker     07/28/00 - add OCIIntervalFromTZ
+   rwessman    06/26/00 - N-tier: added new credential attributes
+   whe         07/27/00 - add OCI_UTF16 mode
+   vjayaram    07/18/00 - add connection pooling changes
+   etucker     07/12/00 - add dls apis
+   cmlim       07/07/00 - add OCI_ATTR_DIRPATH_OID, OCI_ATTR_DIRPATH_NESTED_TBL
+   sgollapu    07/04/00 - Add virtual session flag
+   najain      05/01/00 - AQ Signature support
+   sgollapu    06/14/00 - Add reserved OCI mode
+   rkambo      06/08/00 - notification presentation support
+   sagrawal    06/04/00 - ref cursor to c
+   ksurlake    06/07/00 - define OCI_POOL
+   mbastawa    06/05/00 - added scrollable cursor attributes
+   weiwang     03/31/00 - add LDAP support
+   whe         05/30/00 - add OCI_ATTR_MAXCHAR_SIZE
+   whe         05/23/00 - validate OCI_NO_CACHE mode
+   dsaha       02/02/00 - Add no-cache attr in statement handle
+   whe         05/23/00 - add OCIP_ICACHE
+   allee       05/17/00 - describe support for JAVA implmented TYPE
+   preilly     05/30/00 - Continue adding support for objects in direct path lo
+   cmlim       05/16/00 - 8.2 dpapi support of ADTs
+   rxgovind    05/04/00 - OCIAnyDataSet changes
+   rkasamse    05/25/00 - add OCIAnyDataCtx
+   rmurthy     04/26/00 - describe support for inheritance
+   ksurlake    04/18/00 - Add credential type
+   whe         05/24/00 - add OCI_ATTR_CHAR_ attrs
+   rkambo      04/19/00 - subscription enhancement
+   rmurthy     04/26/00 - describe support for inheritance
+   delson      03/28/00 - add OCI_ATTR_RESERVED_2
+   abrumm      03/31/00 - external table support
+   rkasamse    03/13/00 - add declarations for OCIAnyData
+   najain      02/24/00 - support for dequeue as select
+   dsaha       03/10/00 - Add OCI_ALWAYS_BLOCKING
+   esoyleme    04/25/00 - separated transactions
+   sgollapu    12/23/99 - OCIServerAttach extensions
+   slari       08/23/99 - add OCI_DTYPE_UCB
+   slari       08/20/99 - add OCI_UCBTYPE_REPLACE
+   hsbedi      08/31/99 - Memory Stats .
+   sgollapu    08/02/99 - oci sql routing
+   slari       08/06/99 - rename values for OCI_SERVER_STATUS
+   slari       08/02/99 - add OCI_ATTR_SERVER_STATUS
+   tnbui       07/28/99 - Remove OCI_DTYPE_TIMESTAMP_ITZ                       
+   amangal     07/19/99 - Merge into 8.1.6 : bug 785797
+   tnbui       07/07/99 - Change ADJUSTMENT modes                              
+   dsaha       07/07/99 - OCI_SAHRED_EXT
+   dmwong      06/08/99 - add OCI_ATTR_APPCTX_*
+   vyanaman    06/23/99 -
+   vyanaman    06/21/99 - Add new OCI Datetime and Interval descriptors
+   esoyleme    06/29/99 - expose MTS performance enhancements                  
+   rshaikh     04/23/99 - add OCI_SQL_VERSION_*
+   tnbui       05/24/99 - Remove OCIAdjStr                                     
+   dsaha       05/21/99 - Add OCI_ADJUST_UNK
+   mluong      05/17/99 - fix merge
+   tnbui       04/05/99 - ADJUSTMENT values
+   abrumm      04/16/99 - dpapi: more attributes
+   dsaha       02/24/99 - Add OCI_SHOW_DML_WARNINGS
+   jiyang      12/07/98 - Add OCI_NLS_DUAL_CURRENCY
+   slari       12/07/98 - change OCI_NOMUTEX to OCI_NO_MUTEX
+   aroy        11/30/98 - change OCI_NOCALLBACK to OCI_NO_UCB
+   aroy        11/13/98 - add env modes to process modes
+   slari       09/08/98 - add OCI_FNCODE_SVC2HST and _SVCRH
+   aroy        09/04/98 - Add OCI_ATTR_MIGSESSION
+   skray       08/14/98 - server groups for session switching
+   mluong      08/11/98 - add back OCI_HTYPE_LAST.
+   aroy        05/25/98 - add process handle type                              
+   aroy        04/06/98 - add shared mode                                      
+   slari       07/13/98 -  merge forward to 8.1.4
+   slari       07/09/98 -  add OCI_BIND_RESERVED_2
+   slari       07/08/98 -  add OCI_EXACT_FETCH_RESERVED_1
+   dsaha       07/07/98 -  Add OCI_PARSE_ONLY
+   dsaha       06/29/98 -  Add OCI_PARSE_ONLY
+   slari       07/01/98 -  add OCI_BIND_RESERVED_2
+   sgollapu    06/25/98 -  Fix bug 683565
+   slari       06/17/98 -  remove OC_FETCH_RESERVED_2
+   slari       06/11/98 -  add OCI_FETCH_RESERVED_1 and 2
+   jhasenbe    05/27/98 -  Remove definitions for U-Calls (Unicode)
+   jiyang      05/18/98 - remove OCI_ATTR_CARTLANG
+   nbhatt      05/20/98 -  OCI_DEQ_REMOVE_NODATA
+   nbhatt      05/19/98 - correct AQ opcode
+   skmishra    05/06/98 - Add precision attribute to Attributes list
+   aroy        04/20/98 - merge forward 8.0.5 -> 8.1.3
+   schandra    05/01/98 - OCI sender id
+   sgollapu    02/19/98 - enhanced array DML
+   nbhatt      05/15/98 -  AQ listen call
+   sgollapu    04/27/98 - more attributes
+   skaluska    04/06/98 - Add OCI_PTYPE_SCHEMA, OCI_PTYPE_DATABASE
+   slari       04/28/98 - add OCI_ATTR_PDPRC
+   lchidamb    05/05/98 - change OCI_NAMESPACE_AQ to 1
+   nbhatt      04/27/98 - AQ Notification Descriptor
+   abrumm      06/24/98 - more direct path attributes
+   abrumm      05/27/98 - OCI direct path interface support
+   abrumm      05/08/98 - OCI direct path interface support
+   lchidamb    03/02/98 - client notification additions
+   kkarun      04/17/98 - Add more Interval functions
+   vyanaman    04/16/98 - Add get/set TZ
+   kkarun      04/14/98 - Add OCI Datetime shortnames
+   vyanaman    04/13/98 - Add OCI DateTime and Interval check error codes
+   kkarun      04/07/98 - Add OCI_DTYPE_DATETIME and OCI_DTYPE_INTERVAL
+   esoyleme    12/15/97 - support failover callback retry
+   esoyleme    04/22/98 - merge support for failover callback retry
+   mluong      04/16/98 - add OCI_FNCODE_LOBLOCATORASSIGN
+   rkasamse    04/17/98 - add short names for OCIPickler(Memory/Ctx) cart servi
+   slari       04/10/98 - add OCI_FNCODE_SVCCTXTOLDA
+   slari       04/09/98 - add OCI_FNCODE_RESET
+   slari       04/07/98 - add OCI_FNCODE_LOBFILEISOPEN
+   slari       04/06/98 - add OCI_FNCODE_LOBOPEN
+   slari       03/20/98 - change OCI_CBTYPE_xxx to OCI_UCBTYPE_xxx
+   slari       03/18/98 - add OCI_FNCODE_MAXFCN
+   slari       02/12/98 - add OCI_ENV_NO_USRCB
+   skabraha    04/09/98 - adding shortnames for OCIFile
+   rhwu        04/03/98 - Add short names for the OCIThread package
+   tanguyen    04/03/98 - add OCI_ATTR_xxxx for type inheritance
+   rkasamse    04/02/98 - add OCI_ATTR_UCI_REFRESH
+   nramakri    04/01/98 - Add short names for the OCIExtract package
+   ewaugh      03/31/98 - Add short names for the OCIFormat package.
+   jhasenbe    04/06/98 - Add definitions for U-Calls (Unicode)
+                          (OCI_TEXT, OCI_UTEXT, OCI_UTEXT4)
+   skmishra    03/03/98 - Add OCI_ATTR_PARSE_ERROR_OFFSET
+   rwessman    03/11/98 - Added OCI_CRED_PROXY for proxy authentication
+   abrumm      03/31/98 - OCI direct path interface support
+   nmallava    03/03/98 - add constants for temp lob apis
+   skotsovo    03/05/98 - resolve merge conflicts
+   skotsovo    02/24/98 - add OCI_DTYPE_LOC
+   skaluska    01/21/98 - Add OCI_ATTR_LTYPE
+   rkasamse    01/06/98 - add OCI_ATTR* for obj cache enhancements
+   dchatter    01/08/98 - more comments
+   skabraha    12/02/97 - moved oci1.h to the front of include files.
+   jiyang      12/18/97 - Add OCI_NLS_MAX_BUFSZ
+   rhwu        12/02/97 - move oci1.h up
+   ewaugh      12/15/97 - Add short names for the OCIFormat package.
+   rkasamse    12/02/97 - Add a constant for memory cartridge services -- OCI_M
+   nmallava    12/31/97 - open/close for internal lobs
+   khnguyen    11/27/97 - add OCI_ATTR_LFPRECISION, OCI_ATTR_FSPRECISION
+   rkasamse    11/03/97 - add types for pickler cartridge services
+   mluong      11/20/97 - changed ubig_ora to ub4 per skotsovo
+   ssamu       11/14/97 - add oci1.h
+   jiyang      11/13/97 - Add NLS service for cartridge
+   esoyleme    12/15/97 - support failover callback retry
+   jwijaya     10/21/97 - change OCILobOffset/Length from ubig_ora to ub4
+   cxcheng     07/28/97 - fix compile with SLSHORTNAME
+   schandra    06/25/97 - AQ OCI interface
+   sgollapu    07/25/97 - Add OCI_ATTR_DESC_PUBLIC
+   cxcheng     06/16/97 - add OCI_ATTR_TDO
+   skotsovo    06/05/97 - add fntcodes for lob buffering subsystem
+   esoyleme    05/13/97 - move failover callback prototype
+   skmishra    05/06/97 - stdc compiler fixes
+   skmishra    04/22/97 - Provide C++ compatibility
+   lchidamb    04/19/97 - add OCI_ATTR_SESSLANG
+   ramkrish    04/15/97 - Add OCI_LOB_BUFFER_(NO)FREE
+   sgollapu    04/18/97 - Add OCI_ATTR_TABLESPACE
+   skaluska    04/17/97 - Add OCI_ATTR_SUB_NAME
+   schandra    04/10/97 - Use long OCI names
+   aroy        03/27/97 - add OCI_DTYPE_FILE
+   sgollapu    03/26/97 - Add OCI_OTYPEs
+   skmishra    04/09/97 - Added constant OCI_ROWID_LEN
+   dchatter    03/21/97 - add attr OCI_ATTR_IN_V8_MODE
+   lchidamb    03/21/97 - add OCI_COMMIT_ON_SUCCESS execution mode
+   skmishra    03/20/97 - Added OCI_ATTR_LOBEMPTY
+   sgollapu    03/19/97 - Add OCI_ATTR_OVRLD_ID
+   aroy        03/17/97 - add postprocessing callback
+   sgollapu    03/15/97 - Add OCI_ATTR_PARAM
+   cxcheng     02/07/97 - change OCI_PTYPE codes for type method for consistenc
+   cxcheng     02/05/97 - add OCI_PTYPE_TYPE_RESULT
+   cxcheng     02/04/97 - rename OCI_PTYPE constants to be more consistent
+   cxcheng     02/03/97 - add OCI_ATTR, OCI_PTYPE contants for describe type
+   esoyleme    01/23/97 - merge neerja callback
+   sgollapu    12/30/96 - Remove OCI_DTYPE_SECURITY
+   asurpur     12/26/96 - CHanging OCI_NO_AUTH to OCI_AUTH
+   sgollapu    12/23/96 - Add more attrs to COL, ARG, and SEQ
+   sgollapu    12/12/96 - Add OCI_DESCRIBE_ONLY
+   slari       12/11/96 - change prototype of OCICallbackInBind
+   nbhatt      12/05/96 - "callback"
+   lchidamb    11/19/96 - handle subclassing
+   sgollapu    11/09/96 - OCI_PATTR_*
+   dchatter    11/04/96 - add attr OCI_ATTR_CHRCNT
+   mluong      11/01/96 - test
+   cxcheng     10/31/96 - add #defines for OCILobLength etc
+   dchatter    10/31/96 - add lob read write call back fp defs
+   dchatter    10/30/96 - more changes
+   rhari       10/30/96 - Include ociextp.h at the very end
+   lchidamb    10/22/96 - add fdo attribute for bind/server handle
+   dchatter    10/22/96 - change attr defn for prefetch parameters & lobs/file
+                          calls
+   slari       10/21/96 - add OCI_ENV_NO_MUTEX
+   rhari       10/25/96 - Include ociextp.h
+   rxgovind    10/25/96 - add OCI_LOBMAXSIZE, remove OCI_FILE_READWRITE
+   sgollapu    10/24/96 - Correct OCILogon and OCILogoff
+   sgollapu    10/24/96 - Correct to OCILogon and OCILogoff
+   sgollapu    10/21/96 - Add ocilon and ociloff
+   skaluska    10/31/96 - Add OCI_PTYPE values
+   sgollapu    10/17/96 - correct OCI_ATTR_SVCCTX to OCI_ATTR_SERVER
+   rwessman    10/16/96 - Added security functions and fixed olint errors.
+   sthakur     10/14/96 - add more COR attributes
+   cxcheng     10/14/96 - re-enable LOB functions
+   sgollapu    10/10/96 - Add ocibdp and ocibdn
+   slari       10/07/96 - add back OCIRowid
+   aroy        10/08/96 -  add typedef ocibfill for PRO*C
+   mluong      10/11/96 - replace OCI_ATTR_CHARSET* with OCI_ATTR_CHARSET_*
+   cxcheng     10/10/96 - temporarily take out #define for lob functions
+   sgollapu    10/02/96 - Rename OCI functions and datatypes
+   skotsovo    10/01/96 - move orl lob fnts to oci
+   aroy        09/10/96 - fix merge errors
+   aroy        08/19/96 - NCHAR support
+   jboonleu    09/05/96 - add OCI attributes for object cache
+   dchatter    08/20/96 - HTYPE ranges from 1-50; DTYPE from 50-255
+   slari       08/06/96 - define OCI_DTYPE_ROWID
+   sthakur     08/14/96 - complex object support
+   schandra    06/17/96 - Convert XA to use new OCI
+   abrik       08/15/96 - OCI_ATTR_HEAPALLOC added
+   aroy        07/17/96 - terminology change: ocilobd => ocilobl
+   aroy        07/03/96 - add lob typedefs for Pro*C
+   slari       06/28/96 - add OCI_ATTR_STMT_TYPE
+   lchidamb    06/26/96 - reorg #ifndef
+   schandra    05/31/96 - attribute types for internal and external client name
+   asurpur     05/30/96 - Changing the value of mode
+   schandra    05/18/96 - OCI_TRANS_TWOPHASE -> 0x00000001 to 0x00100000
+   slari       05/30/96 - add callback function prototypes
+   jbellemo    05/23/96 - remove ociisc
+   schandra    04/23/96 - loosely-coupled branches
+   asurpur     05/15/96 - New mode for ocicpw
+   aroy        04/24/96 - making ocihandles opaque
+   slari       04/18/96 - add missing defines
+   schandra    03/27/96 - V8OCI - add transaction related calls
+   dchatter    04/01/96 - add OCI_FILE options
+   dchatter    03/21/96 - add oci2lda conversion routines
+   dchatter    03/07/96 - add OCI piece definition
+   slari       03/12/96 - add describe attributes
+   slari       03/12/96 - add OCI_OTYPE_QUERY
+   aroy        02/28/96 - Add column attributes
+   slari       02/09/96 - add OCI_OBJECT
+   slari       02/07/96 - add OCI_HYTPE_DSC
+   aroy        01/10/96 - adding function code defines...
+   dchatter    01/03/96 - define OCI_NON_BLOCKING
+   dchatter    01/02/96 - Add Any descriptor
+   dchatter    01/02/96 - Add Select List descriptor
+   dchatter    12/29/95 - V8 OCI definitions
+   dchatter    12/29/95 - Creation
+
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef ORATYPES 
+#include <oratypes.h> 
+#endif
+ 
+#ifndef OCIDFN
+#include <ocidfn.h>
+#endif
+
+#ifndef OCI_ORACLE
+# define OCI_ORACLE
+
+ 
+/*--------------------------------------------------------------------------- 
+ Short names provided for platforms which do not allow extended symbolic names 
+  ---------------------------------------------------------------------------*/
+
+#ifdef SLSHORTNAME
+/* Translation of the long function/type names to short names for IBM only */
+/* maybe lint will use this too */
+#define OCISessionEnd              ocitac
+#define OCIResultSetToStmt         ocirs2sh
+#define OCISessionBegin            ociauth
+#define OCIServerAttach            ociatch
+#define OCIDescriptorAlloc         ocigdesc
+#define OCIServerDetach            ocidtch
+#define OCIDescriptorFree          ocifdesc
+#define OCIServerVersion           ocivers
+#define OCIDescribeAny             ocidsca
+#define OCIBindDynamic             ocibda
+#define OCIBindByName              ocibdn
+#define OCIBindByPos               ocibdp
+#define OCIErrorGet                ocigdr
+#define OCIBindArrayOfStruct       ocibsa
+#define OCIEnvInit                 ociinit
+#define OCIBindObject              ocibndt
+#define OCIHandleAlloc             ocighndl
+#define OCIHandleFree              ocifhndl
+#define OCIRowidToChar             ociri2c
+#ifdef NEVER
+#define OCIStmtBindByPos           ocibndp
+#define OCIStmtBindByName          ocibndn
+#endif
+#define OCIAttrGet                 ocigattr
+#define OCIDefineByPos             ocidfne
+#define OCIAttrSet                 ocisattr
+#define OCIDefineDynamic           ociddf
+#define OCILdaToSvcCtx             ocild2sv
+#define OCIDefineArrayOfStruct     ocidarr
+#define OCIInitialize              ocipi
+#define OCIDefineObject            ocidndt
+#define OCIStmtExecute             ociexec
+#define OCILobAppend               ocilfap
+#define OCILobOpenFile             ocifopn
+#define OCILobCloseFile            ocifcls
+#define OCILobLocator              ocilobd
+#define OCILobCopy                 ocilfcp
+#define OCILobFileCreate           ocifcrt
+#define OCILobFileDelete           ocifdel
+#define OCILobGetLength            ocilfln
+#define OCILobWrite                ocilfwr
+#define OCILobRead                 ocilfrd
+#define OCILobErase                ocilfer
+#define OCILobTrim                 ocilftr
+
+#define OCIStmtFetch               ocifch
+#define OCIStmtGetBindInfo         ocigbp
+#define OCIStmtGetPieceInfo        ocigpi
+#define OCIStmtPrepare             ocireq
+#define OCIStmtSetPieceInfo        ocispi
+#define OCISvcCtxToLda             ocisv2ld
+#define OCITransCommit             ocitxcm
+#define OCITransDetach             ocitxdt
+#define OCITransForget             ocitxfgt
+#define OCITransPrepare            ocitxpre
+#define OCITransRollback           ocitxrl
+#define OCIPasswordChange          ocicpw
+#define OCITransStart              ocitxst
+#define OCITransMultiPrepare       ocitxmp
+
+#define OCIBreak                   ocibreak
+#define OCIParamGet                ocigparm
+#define OCIParamSet                ocisparm
+
+#define OCISecurityOpenWallet           ocizwOpenWallet
+#define OCISecurityCloseWallet          ocizwCloseWallet
+#define OCISecurityCreateWallet         ocizwCreateWallet
+#define OCISecurityDestroyWallet        ocizwDestroyWallet
+#define OCISecurityStorePersona         ocizeStorePersona
+#define OCISecurityOpenPersona          ocizeOpenPersona
+#define OCISecurityClosePersona         ocizeClosePersona
+#define OCISecurityRemovePersona        ocizeRemovePersona
+#define OCISecurityCreatePersona        ocizeCreatePersona
+#define OCISecuritySetProtection        ocizeSetProtection
+#define OCISecurityGetProtection        ocizeGetProtection
+#define OCISecurityRemoveIdentity       ociziRemoveIdentity
+#define OCISecurityCreateIdentity       ociziCreateIdentity
+#define OCISecurityAbortIdentity        ociziAbortIdentity
+#define OCISecurityFreeIdentity         ociziFreeIdentity
+#define OCISecurityStoreTrustedIdentity ociziStoreTrustedIdentity
+#define OCISecuritySign                 ocizSign
+#define OCISecuritySignExpansion        ocizxSignExpansion
+#define OCISecurityVerify               ocizVerify
+#define OCISecurityValidate             ocizValidate
+#define OCISecuritySignDetached         ocizsd_SignDetached
+#define OCISecuritySignDetExpansion     ocizxsd_SignDetachedExpansion
+#define OCISecurityVerifyDetached       ocizved_VerifyDetached
+#define OCISecurity_PKEncrypt           ocizkec_PKEncrypt
+#define OCISecurityPKEncryptExpansion   ocizxkec_PKEncryptExpansion
+#define OCISecurityPKDecrypt            ocizkdc_PKDecrypt
+#define OCISecurityEncrypt              ocizEncrypt
+#define OCISecurityEncryptExpansion     ocizxEncryptExpansion
+#define OCISecurityDecrypt              ocizDecrypt
+#define OCISecurityEnvelope             ocizEnvelope
+#define OCISecurityDeEnvelope           ocizDeEnvelope
+#define OCISecurityKeyedHash            ocizKeyedHash
+#define OCISecurityKeyedHashExpansion   ocizxKeyedHashExpansion
+#define OCISecurityHash                 ocizHash
+#define OCISecurityHashExpansion        ocizxHashExpansion
+#define OCISecuritySeedRandom           ocizSeedRandom
+#define OCISecurityRandomBytes          ocizrb_RandomBytes
+#define OCISecurityRandomNumber         ocizrn_RandomNumber
+#define OCISecurityInitBlock            ocizibInitBlock
+#define OCISecurityReuseBlock           ocizrbReuseBlock
+#define OCISecurityPurgeBlock           ocizpbPurgeBlock
+#define OCISecuritySetBlock             ocizsbSetBlock
+#define OCISecurityGetIdentity          ocizgi_GetIdentity
+
+#define OCIExtractInit             ocixeini
+#define OCIExtractTerm             ocixetrm
+#define OCIExtractReset            ocixerst
+#define OCIExtractSetNumKeys       ocixesnk
+#define OCIExtractSetKey           ocixesk
+#define OCIExtractFromFile         ocixeff
+#define OCIExtractFromStr          ocixefs
+#define OCIExtractToInt            ocixeti
+#define OCIExtractToBool           ocixetb
+#define OCIExtractToStr            ocixets
+#define OCIExtractToOCINum         ocixeton
+#define OCIExtractToList           ocixetl
+#define OCIExtractFromList         ocixefl
+
+#define OCIDateTimeGetTime         ocidt01_GetTime
+#define OCIDateTimeGetDate         ocidt02_GetDate
+#define OCIDateTimeGetTimeZoneOffset     ocidt03_GetTZ
+#define OCIDateTimeSysTimeStamp    ocidt07_SysTS
+#define OCIDateTimeAssign          ocidt08_Assign 
+#define OCIDateTimeToText          ocidt09_ToText
+#define OCIDateTimeFromText        ocidt10_FromText
+#define OCIDateTimeCompare         ocidt11_Compare
+#define OCIDateTimeCheck           ocidt12_Check
+#define OCIDateTimeConvert         ocidt13_Convert
+#define OCIDateTimeSubtract        ocidt14_Subtract
+#define OCIDateTimeIntervalAdd     ocidt15_IntervalAdd
+#define OCIDateTimeIntervalSub     ocidt16_IntervalSub
+#define OCIDateTimeGetTimeZoneName ocidt17_Gettzname
+#define OCIDateTimeToArray         ocidt18_ToArray  
+#define OCIDateTimeFromArray       ocidt19_FromArray
+
+#define OCIIntervalSubtract        ociint01_Subtract  
+#define OCIIntervalAdd             ociint02_Add  
+#define OCIIntervalMultiply        ociint03_Multiply  
+#define OCIIntervalDivide          ociint04_Divide  
+#define OCIIntervalCompare         ociint05_Compare  
+#define OCIIntervalFromText        ociint06_FromText  
+#define OCIIntervalToText          ociint07_ToText  
+#define OCIIntervalToNumber        ociint08_ToNumber  
+#define OCIIntervalCheck           ociint09_Check  
+#define OCIIntervalAssign          ociint10_Assign  
+#define OCIIntervalGetYearMonth    ociint11_GetYearMonth
+#define OCIIntervalSetYearMonth    ociint12_SetYearMonth
+#define OCIIntervalGetDaySecond    ociint13_GetDaySecond
+#define OCIIntervalSetDaySecond    ociint14_SetDaySecond
+#define OCIIntervalFromNumber      ociint15_FromNumber
+#define OCIIntervalFromTZ          ociint16_FromTZ 
+
+#define OCIFormatInit              ocixs01_Init
+#define OCIFormatString            ocixs02_Format
+#define OCIFormatTerm              ocixs03_Term
+#define OCIFormatTUb1              ocixs04_TUb1
+#define OCIFormatTUb2              ocixs05_TUb2
+#define OCIFormatTUb4              ocixs06_TUb4
+#define OCIFormatTUword            ocixs07_TUword
+#define OCIFormatTUbig_ora         ocixs08_TUbig_ora
+#define OCIFormatTSb1              ocixs09_TSb1
+#define OCIFormatTSb2              ocixs10_TSb2
+#define OCIFormatTSb4              ocixs11_TSb4
+#define OCIFormatTSword            ocixs12_TSword
+#define OCIFormatTSbig_ora         ocixs13_TSbig_ora
+#define OCIFormatTEb1              ocixs14_TEb1
+#define OCIFormatTEb2              ocixs15_TEb2
+#define OCIFormatTEb4              ocixs16_TEb4
+#define OCIFormatTEword            ocixs17_TEword
+#define OCIFormatTChar             ocixs18_TChar
+#define OCIFormatTText             ocixs19_TText
+#define OCIFormatTDouble           ocixs20_TDouble
+#define OCIFormatTDvoid            ocixs21_TDvoid
+#define OCIFormatTEnd              ocixs22_TEnd
+
+#define OCIFileInit                ocifinit
+#define OCIFileTerm                ocifterm
+#define OCIFileOpen                ocifopen
+#define OCIFileClose               ocifclose
+#define OCIFileRead                ocifread
+#define OCIFileWrite               ocifwrite
+#define OCIFileSeek                ocifseek
+#define OCIFileExists              ocifexists
+#define OCIFileGetLength           ocifglen
+#define OCIFileFlush               ocifflush
+
+
+/* OCIThread short name */
+#define OCIThreadProcessInit       ocitt01_ProcessInit
+#define OCIThreadInit              ocitt02_Init
+#define OCIThreadTerm              ocitt03_Term
+#define OCIThreadIsMulti           ocitt04_IsMulti
+#define OCIThreadMutexInit         ocitt05_MutexInit
+#define OCIThreadMutexDestroy      ocitt06_MutexDestroy
+#define OCIThreadMutexAcquire      ocitt07_MutexAcquire
+#define OCIThreadMutexRelease      ocitt08_MutexRelease
+#define OCIThreadKeyInit           ocitt09_KeyInit
+#define OCIThreadKeyDestroy        ocitt10_KeyDestroy
+#define OCIThreadKeyGet            ocitt11_KeyGet
+#define OCIThreadKeySet            ocitt12_KeySet
+#define OCIThreadIdInit            ocitt13_IdInit
+#define OCIThreadIdDestroy         ocitt14_IdDestroy
+#define OCIThreadIdSet             ocitt15_IdSet
+#define OCIThreadIdSetNull         ocitt16_IdSetNull
+#define OCIThreadIdGet             ocitt17_IdGet
+#define OCIThreadIdSame            ocitt18_IdSame
+#define OCIThreadIdNull            ocitt19_IdNull
+#define OCIThreadHndInit           ocitt20_HndInit
+#define OCIThreadHndDestroy        ocitt21_HndDestroy
+#define OCIThreadCreate            ocitt22_Create
+#define OCIThreadJoin              ocitt23_Join
+#define OCIThreadClose             ocitt24_Close
+#define OCIThreadHandleGet         ocitt25_HandleGet
+
+/* Translation between the old and new datatypes */
+
+#define OCISession                 ociusrh
+#define OCIBind                    ocibndh
+#define OCIDescribe                ocidsch
+#define OCIDefine                  ocidfnh
+#define OCIEnv                     ocienvh
+#define OCIError                   ocierrh
+
+#define OCICPool                   ocicpool
+
+#define OCISPool                   ocispool
+#define OCIAuthInfo                ociauthinfo
+
+
+#define OCILob                     ocilobd
+#define OCILobLength               ocillen
+#define OCILobMode                 ocilmo
+#define OCILobOffset               ociloff
+
+#define OCILobLocator              ocilobd
+#define OCIBlobLocator             ociblobl
+#define OCIClobLocator             ociclobl
+#define OCIBFileLocator            ocibfilel
+
+#define OCIParam                   ocipard
+#define OCIResult                  ocirstd
+#define OCISnapshot                ocisnad
+#define OCIServer                  ocisrvh
+#define OCIStmt                    ocistmh
+#define OCISvcCtx                  ocisvch
+#define OCITrans                   ocitxnh
+#define OCICallbackInBind          ocibicfp
+#define OCICallbackOutBind         ocibocfp
+#define OCICallbackDefine          ocidcfp
+#define OCICallbackLobRead         ocilrfp
+#define OCICallbackLobWrite        ocilwfp
+#define OCISecurity                ociossh
+#define OCIComplexObject           ocicorh
+#define OCIComplexObjectComp       ocicord
+#define OCIRowid                   ociridd
+
+#define OCIAQDeq                   ociaqdeq                  
+#define OCIAQEnq                   ociaqenq
+#define OCIConnectionPoolCreate    ociconpc
+#define OCIConnectionPoolDestroy   ociconpd
+#define OCIEnvCreate               ocienvct
+#define OCILobAssign               ociloass
+#define OCILobCharSetForm          ocilocfm
+#define OCILobCharSetId            ocilocid
+#define OCILobDisableBuffering     ocilodbf
+#define OCILobEnableBuffering      ociloebf
+#define OCILobFileClose            ocilofcl
+#define OCILobFileCloseAll         ocilofca
+#define OCILobFileExists           ocilofex
+#define OCILobFileGetName          ocilofgn
+#define OCILobFileIsOpen           ocifiopn
+#define OCILobFileOpen             ocilofop
+#define OCILobFileSetName          ocilofsn
+#define OCILobFlushBuffer          ocilofbf
+#define OCILobIsEqual              ociloieq
+#define OCILobLoadFromFile         ocilolff
+#define OCILobLocatorIsInit        ocilolii
+#define OCILobLocatorAssign        ocilolas
+#define OCILogon                   ocilogon
+#define OCILogon2                  ocilgon2
+#define OCILogoff                  ocilgoff
+#endif /* ifdef SLSHORTNAME */
+
+/*--------------------------------------------------------------------------- 
+                     PUBLIC TYPES AND CONSTANTS 
+  ---------------------------------------------------------------------------*/
+
+/*-----------------------------Handle Types----------------------------------*/
+                                           /* handle types range from 1 - 49 */
+#define OCI_HTYPE_FIRST          1             /* start value of handle type */
+#define OCI_HTYPE_ENV            1                     /* environment handle */
+#define OCI_HTYPE_ERROR          2                           /* error handle */
+#define OCI_HTYPE_SVCCTX         3                         /* service handle */
+#define OCI_HTYPE_STMT           4                       /* statement handle */
+#define OCI_HTYPE_BIND           5                            /* bind handle */
+#define OCI_HTYPE_DEFINE         6                          /* define handle */
+#define OCI_HTYPE_DESCRIBE       7                        /* describe handle */
+#define OCI_HTYPE_SERVER         8                          /* server handle */
+#define OCI_HTYPE_SESSION        9                  /* authentication handle */
+#define OCI_HTYPE_AUTHINFO      OCI_HTYPE_SESSION  /* SessionGet auth handle */
+#define OCI_HTYPE_TRANS         10                     /* transaction handle */
+#define OCI_HTYPE_COMPLEXOBJECT 11        /* complex object retrieval handle */
+#define OCI_HTYPE_SECURITY      12                        /* security handle */
+#define OCI_HTYPE_SUBSCRIPTION  13                    /* subscription handle */
+#define OCI_HTYPE_DIRPATH_CTX   14                    /* direct path context */
+#define OCI_HTYPE_DIRPATH_COLUMN_ARRAY 15        /* direct path column array */
+#define OCI_HTYPE_DIRPATH_STREAM       16              /* direct path stream */
+#define OCI_HTYPE_PROC                 17                  /* process handle */
+#define OCI_HTYPE_DIRPATH_FN_CTX       18    /* direct path function context */
+#define OCI_HTYPE_DIRPATH_FN_COL_ARRAY 19          /* dp object column array */
+#define OCI_HTYPE_XADSESSION    20                  /* access driver session */
+#define OCI_HTYPE_XADTABLE      21                    /* access driver table */
+#define OCI_HTYPE_XADFIELD      22                    /* access driver field */
+#define OCI_HTYPE_XADGRANULE    23                  /* access driver granule */
+#define OCI_HTYPE_XADRECORD     24                   /* access driver record */
+#define OCI_HTYPE_XADIO         25                      /* access driver I/O */
+#define OCI_HTYPE_CPOOL         26                 /* connection pool handle */
+#define OCI_HTYPE_SPOOL         27                    /* session pool handle */
+
+#define OCI_HTYPE_LAST          27            /* last value of a handle type */
+
+/*---------------------------------------------------------------------------*/
+
+
+/*-------------------------Descriptor Types----------------------------------*/
+                                    /* descriptor values range from 50 - 255 */
+#define OCI_DTYPE_FIRST 50                 /* start value of descriptor type */
+#define OCI_DTYPE_LOB 50                                     /* lob  locator */
+#define OCI_DTYPE_SNAP 51                             /* snapshot descriptor */
+#define OCI_DTYPE_RSET 52                           /* result set descriptor */
+#define OCI_DTYPE_PARAM 53  /* a parameter descriptor obtained from ocigparm */
+#define OCI_DTYPE_ROWID  54                              /* rowid descriptor */
+#define OCI_DTYPE_COMPLEXOBJECTCOMP  55
+                                      /* complex object retrieval descriptor */
+#define OCI_DTYPE_FILE 56                                /* File Lob locator */
+#define OCI_DTYPE_AQENQ_OPTIONS 57                        /* enqueue options */
+#define OCI_DTYPE_AQDEQ_OPTIONS 58                        /* dequeue options */
+#define OCI_DTYPE_AQMSG_PROPERTIES 59                  /* message properties */
+#define OCI_DTYPE_AQAGENT 60                                     /* aq agent */
+#define OCI_DTYPE_LOCATOR 61                                  /* LOB locator */
+#define OCI_DTYPE_INTERVAL_YM 62                      /* Interval year month */
+#define OCI_DTYPE_INTERVAL_DS 63                      /* Interval day second */
+#define OCI_DTYPE_AQNFY_DESCRIPTOR  64               /* AQ notify descriptor */
+#define OCI_DTYPE_DATE 65                            /* Date */
+#define OCI_DTYPE_TIME 66                            /* Time */
+#define OCI_DTYPE_TIME_TZ 67                         /* Time with timezone */
+#define OCI_DTYPE_TIMESTAMP 68                       /* Timestamp */
+#define OCI_DTYPE_TIMESTAMP_TZ 69                /* Timestamp with timezone */
+#define OCI_DTYPE_TIMESTAMP_LTZ 70             /* Timestamp with local tz */
+#define OCI_DTYPE_UCB           71               /* user callback descriptor */
+#define OCI_DTYPE_SRVDN         72              /* server DN list descriptor */
+#define OCI_DTYPE_SIGNATURE     73                              /* signature */
+#define OCI_DTYPE_RESERVED_1    74              /* reserved for internal use */
+#define OCI_DTYPE_LAST          74        /* last value of a descriptor type */
+
+/*---------------------------------------------------------------------------*/
+
+/*--------------------------------LOB types ---------------------------------*/
+#define OCI_TEMP_BLOB 1                /* LOB type - BLOB ------------------ */
+#define OCI_TEMP_CLOB 2                /* LOB type - CLOB ------------------ */
+/*---------------------------------------------------------------------------*/
+
+/*-------------------------Object Ptr Types----------------------------------*/
+#define OCI_OTYPE_NAME 1                                      /* object name */
+#define OCI_OTYPE_REF  2                                       /* REF to TDO */
+#define OCI_OTYPE_PTR  3                                       /* PTR to TDO */
+/*---------------------------------------------------------------------------*/
+
+/*=============================Attribute Types===============================*/
+/* 
+   Note: All attributes are global.  New attibutes should be added to the end
+   of the list. Before you add an attribute see if an existing one can be 
+   used for your handle. 
+
+   If you see any holes please use the holes first. 
+ 
+*/
+/*===========================================================================*/
+
+
+#define OCI_ATTR_FNCODE  1                          /* the OCI function code */
+#define OCI_ATTR_OBJECT   2 /* is the environment initialized in object mode */
+#define OCI_ATTR_NONBLOCKING_MODE  3                    /* non blocking mode */
+#define OCI_ATTR_SQLCODE  4                                  /* the SQL verb */
+#define OCI_ATTR_ENV  5                            /* the environment handle */
+#define OCI_ATTR_SERVER 6                               /* the server handle */
+#define OCI_ATTR_SESSION 7                        /* the user session handle */
+#define OCI_ATTR_TRANS   8                         /* the transaction handle */
+#define OCI_ATTR_ROW_COUNT   9                  /* the rows processed so far */
+#define OCI_ATTR_SQLFNCODE 10               /* the SQL verb of the statement */
+#define OCI_ATTR_PREFETCH_ROWS  11    /* sets the number of rows to prefetch */
+#define OCI_ATTR_NESTED_PREFETCH_ROWS 12 /* the prefetch rows of nested table*/
+#define OCI_ATTR_PREFETCH_MEMORY 13         /* memory limit for rows fetched */
+#define OCI_ATTR_NESTED_PREFETCH_MEMORY 14   /* memory limit for nested rows */
+#define OCI_ATTR_CHAR_COUNT  15 
+                    /* this specifies the bind and define size in characters */
+#define OCI_ATTR_PDSCL   16                          /* packed decimal scale */
+#define OCI_ATTR_FSPRECISION OCI_ATTR_PDSCL   
+                                          /* fs prec for datetime data types */
+#define OCI_ATTR_PDPRC   17                         /* packed decimal format */
+#define OCI_ATTR_LFPRECISION OCI_ATTR_PDPRC 
+                                          /* fs prec for datetime data types */
+#define OCI_ATTR_PARAM_COUNT 18       /* number of column in the select list */
+#define OCI_ATTR_ROWID   19                                     /* the rowid */
+#define OCI_ATTR_CHARSET  20                      /* the character set value */
+#define OCI_ATTR_NCHAR   21                                    /* NCHAR type */
+#define OCI_ATTR_USERNAME 22                           /* username attribute */
+#define OCI_ATTR_PASSWORD 23                           /* password attribute */
+#define OCI_ATTR_STMT_TYPE   24                            /* statement type */
+#define OCI_ATTR_INTERNAL_NAME   25             /* user friendly global name */
+#define OCI_ATTR_EXTERNAL_NAME   26      /* the internal name for global txn */
+#define OCI_ATTR_XID     27           /* XOPEN defined global transaction id */
+#define OCI_ATTR_TRANS_LOCK 28                                            /* */
+#define OCI_ATTR_TRANS_NAME 29    /* string to identify a global transaction */
+#define OCI_ATTR_HEAPALLOC 30                /* memory allocated on the heap */
+#define OCI_ATTR_CHARSET_ID 31                           /* Character Set ID */
+#define OCI_ATTR_CHARSET_FORM 32                       /* Character Set Form */
+#define OCI_ATTR_MAXDATA_SIZE 33       /* Maximumsize of data on the server  */
+#define OCI_ATTR_CACHE_OPT_SIZE 34              /* object cache optimal size */
+#define OCI_ATTR_CACHE_MAX_SIZE 35   /* object cache maximum size percentage */
+#define OCI_ATTR_PINOPTION 36             /* object cache default pin option */
+#define OCI_ATTR_ALLOC_DURATION 37
+                                 /* object cache default allocation duration */
+#define OCI_ATTR_PIN_DURATION 38        /* object cache default pin duration */
+#define OCI_ATTR_FDO          39       /* Format Descriptor object attribute */
+#define OCI_ATTR_POSTPROCESSING_CALLBACK 40
+                                         /* Callback to process outbind data */
+#define OCI_ATTR_POSTPROCESSING_CONTEXT 41
+                                 /* Callback context to process outbind data */
+#define OCI_ATTR_ROWS_RETURNED 42
+               /* Number of rows returned in current iter - for Bind handles */
+#define OCI_ATTR_FOCBK        43              /* Failover Callback attribute */
+#define OCI_ATTR_IN_V8_MODE   44 /* is the server/service context in V8 mode */
+#define OCI_ATTR_LOBEMPTY     45                              /* empty lob ? */
+#define OCI_ATTR_SESSLANG     46                  /* session language handle */
+
+#define OCI_ATTR_VISIBILITY             47                     /* visibility */
+#define OCI_ATTR_RELATIVE_MSGID         48            /* relative message id */
+#define OCI_ATTR_SEQUENCE_DEVIATION     49             /* sequence deviation */
+
+#define OCI_ATTR_CONSUMER_NAME          50                  /* consumer name */
+#define OCI_ATTR_DEQ_MODE               51                   /* dequeue mode */
+#define OCI_ATTR_NAVIGATION             52                     /* navigation */
+#define OCI_ATTR_WAIT                   53                           /* wait */
+#define OCI_ATTR_DEQ_MSGID              54             /* dequeue message id */
+
+#define OCI_ATTR_PRIORITY               55                       /* priority */
+#define OCI_ATTR_DELAY                  56                          /* delay */
+#define OCI_ATTR_EXPIRATION             57                     /* expiration */
+#define OCI_ATTR_CORRELATION            58                 /* correlation id */
+#define OCI_ATTR_ATTEMPTS               59                  /* # of attempts */
+#define OCI_ATTR_RECIPIENT_LIST         60                 /* recipient list */
+#define OCI_ATTR_EXCEPTION_QUEUE        61           /* exception queue name */
+#define OCI_ATTR_ENQ_TIME               62 /* enqueue time (only OCIAttrGet) */
+#define OCI_ATTR_MSG_STATE              63/* message state (only OCIAttrGet) */
+                                                   /* NOTE: 64-66 used below */
+#define OCI_ATTR_AGENT_NAME             64                     /* agent name */
+#define OCI_ATTR_AGENT_ADDRESS          65                  /* agent address */
+#define OCI_ATTR_AGENT_PROTOCOL         66                 /* agent protocol */
+#define OCI_ATTR_USER_PROPERTY          67                  /* user property */
+#define OCI_ATTR_SENDER_ID              68                      /* sender id */
+#define OCI_ATTR_ORIGINAL_MSGID         69            /* original message id */
+
+#define OCI_ATTR_QUEUE_NAME             70                     /* queue name */
+#define OCI_ATTR_NFY_MSGID              71                     /* message id */
+#define OCI_ATTR_MSG_PROP               72             /* message properties */
+
+#define OCI_ATTR_NUM_DML_ERRORS         73       /* num of errs in array DML */
+#define OCI_ATTR_DML_ROW_OFFSET         74        /* row offset in the array */
+
+              /* AQ array error handling uses DML method of accessing errors */
+#define OCI_ATTR_AQ_NUM_ERRORS          OCI_ATTR_NUM_DML_ERRORS
+#define OCI_ATTR_AQ_ERROR_INDEX         OCI_ATTR_DML_ROW_OFFSET
+
+#define OCI_ATTR_DATEFORMAT             75     /* default date format string */
+#define OCI_ATTR_BUF_ADDR               76                 /* buffer address */
+#define OCI_ATTR_BUF_SIZE               77                    /* buffer size */
+#define OCI_ATTR_DIRPATH_MODE           78  /* mode of direct path operation */
+#define OCI_ATTR_DIRPATH_NOLOG          79               /* nologging option */
+#define OCI_ATTR_DIRPATH_PARALLEL       80     /* parallel (temp seg) option */
+#define OCI_ATTR_NUM_ROWS               81 /* number of rows in column array */
+                                  /* NOTE that OCI_ATTR_NUM_COLS is a column
+                                   * array attribute too.
+                                   */
+#define OCI_ATTR_COL_COUNT              82        /* columns of column array
+                                                     processed so far.       */
+#define OCI_ATTR_STREAM_OFFSET          83  /* str off of last row processed */
+#define OCI_ATTR_SHARED_HEAPALLOC       84    /* Shared Heap Allocation Size */
+
+#define OCI_ATTR_SERVER_GROUP           85              /* server group name */
+
+#define OCI_ATTR_MIGSESSION             86   /* migratable session attribute */
+
+#define OCI_ATTR_NOCACHE                87                 /* Temporary LOBs */
+
+#define OCI_ATTR_MEMPOOL_SIZE           88                      /* Pool Size */
+#define OCI_ATTR_MEMPOOL_INSTNAME       89                  /* Instance name */
+#define OCI_ATTR_MEMPOOL_APPNAME        90               /* Application name */
+#define OCI_ATTR_MEMPOOL_HOMENAME       91            /* Home Directory name */
+#define OCI_ATTR_MEMPOOL_MODEL          92     /* Pool Model (proc,thrd,both)*/
+#define OCI_ATTR_MODES                  93                          /* Modes */
+
+#define OCI_ATTR_SUBSCR_NAME            94           /* name of subscription */
+#define OCI_ATTR_SUBSCR_CALLBACK        95            /* associated callback */
+#define OCI_ATTR_SUBSCR_CTX             96    /* associated callback context */
+#define OCI_ATTR_SUBSCR_PAYLOAD         97             /* associated payload */
+#define OCI_ATTR_SUBSCR_NAMESPACE       98           /* associated namespace */
+
+#define OCI_ATTR_PROXY_CREDENTIALS      99         /* Proxy user credentials */
+#define OCI_ATTR_INITIAL_CLIENT_ROLES  100       /* Initial client role list */
+
+#define OCI_ATTR_UNK              101                   /* unknown attribute */
+#define OCI_ATTR_NUM_COLS         102                   /* number of columns */
+#define OCI_ATTR_LIST_COLUMNS     103        /* parameter of the column list */
+#define OCI_ATTR_RDBA             104           /* DBA of the segment header */
+#define OCI_ATTR_CLUSTERED        105      /* whether the table is clustered */
+#define OCI_ATTR_PARTITIONED      106    /* whether the table is partitioned */
+#define OCI_ATTR_INDEX_ONLY       107     /* whether the table is index only */
+#define OCI_ATTR_LIST_ARGUMENTS   108      /* parameter of the argument list */
+#define OCI_ATTR_LIST_SUBPROGRAMS 109    /* parameter of the subprogram list */
+#define OCI_ATTR_REF_TDO          110          /* REF to the type descriptor */
+#define OCI_ATTR_LINK             111              /* the database link name */
+#define OCI_ATTR_MIN              112                       /* minimum value */
+#define OCI_ATTR_MAX              113                       /* maximum value */
+#define OCI_ATTR_INCR             114                     /* increment value */
+#define OCI_ATTR_CACHE            115   /* number of sequence numbers cached */
+#define OCI_ATTR_ORDER            116     /* whether the sequence is ordered */
+#define OCI_ATTR_HW_MARK          117                     /* high-water mark */
+#define OCI_ATTR_TYPE_SCHEMA      118                  /* type's schema name */
+#define OCI_ATTR_TIMESTAMP        119             /* timestamp of the object */
+#define OCI_ATTR_NUM_ATTRS        120                /* number of sttributes */
+#define OCI_ATTR_NUM_PARAMS       121                /* number of parameters */
+#define OCI_ATTR_OBJID            122       /* object id for a table or view */
+#define OCI_ATTR_PTYPE            123           /* type of info described by */
+#define OCI_ATTR_PARAM            124                /* parameter descriptor */
+#define OCI_ATTR_OVERLOAD_ID      125     /* overload ID for funcs and procs */
+#define OCI_ATTR_TABLESPACE       126                    /* table name space */
+#define OCI_ATTR_TDO              127                       /* TDO of a type */
+#define OCI_ATTR_LTYPE            128                           /* list type */
+#define OCI_ATTR_PARSE_ERROR_OFFSET 129                /* Parse Error offset */
+#define OCI_ATTR_IS_TEMPORARY     130          /* whether table is temporary */
+#define OCI_ATTR_IS_TYPED         131              /* whether table is typed */
+#define OCI_ATTR_DURATION         132         /* duration of temporary table */
+#define OCI_ATTR_IS_INVOKER_RIGHTS 133                  /* is invoker rights */
+#define OCI_ATTR_OBJ_NAME         134           /* top level schema obj name */
+#define OCI_ATTR_OBJ_SCHEMA       135                         /* schema name */
+#define OCI_ATTR_OBJ_ID           136          /* top level schema object id */
+
+#define OCI_ATTR_DIRPATH_SORTED_INDEX    137 /* index that data is sorted on */
+
+            /* direct path index maint method (see oci8dp.h) */
+#define OCI_ATTR_DIRPATH_INDEX_MAINT_METHOD 138
+
+    /* parallel load: db file, initial and next extent sizes */
+
+#define OCI_ATTR_DIRPATH_FILE               139      /* DB file to load into */
+#define OCI_ATTR_DIRPATH_STORAGE_INITIAL    140       /* initial extent size */
+#define OCI_ATTR_DIRPATH_STORAGE_NEXT       141          /* next extent size */
+
+
+#define OCI_ATTR_TRANS_TIMEOUT              142       /* transaction timeout */
+#define OCI_ATTR_SERVER_STATUS              143/* state of the server handle */
+#define OCI_ATTR_STATEMENT                  144 /* statement txt in stmt hdl */
+
+            /* direct path index maint method (see oci8dp.h) */
+#define OCI_ATTR_DIRPATH_SKIPINDEX_METHOD   145
+
+#define OCI_ATTR_DEQCOND                    146         /* dequeue condition */
+#define OCI_ATTR_RESERVED_2                 147                  /* reserved */
+
+  
+#define OCI_ATTR_SUBSCR_RECPT               148 /* recepient of subscription */
+#define OCI_ATTR_SUBSCR_RECPTPROTO          149    /* protocol for recepient */
+
+    /* 8.2 dpapi support of ADTs */
+#define OCI_ATTR_DIRPATH_EXPR_TYPE  150        /* expr type of OCI_ATTR_NAME */
+
+#define OCI_ATTR_DIRPATH_INPUT      151    /* input in text or stream format */
+#define OCI_DIRPATH_INPUT_TEXT     0x01
+#define OCI_DIRPATH_INPUT_STREAM   0x02
+#define OCI_DIRPATH_INPUT_UNKNOWN  0x04
+
+#define OCI_ATTR_LDAP_HOST       153              /* LDAP host to connect to */
+#define OCI_ATTR_LDAP_PORT       154              /* LDAP port to connect to */
+#define OCI_ATTR_BIND_DN         155                              /* bind DN */
+#define OCI_ATTR_LDAP_CRED       156       /* credentials to connect to LDAP */
+#define OCI_ATTR_WALL_LOC        157               /* client wallet location */
+#define OCI_ATTR_LDAP_AUTH       158           /* LDAP authentication method */
+#define OCI_ATTR_LDAP_CTX        159        /* LDAP adminstration context DN */
+#define OCI_ATTR_SERVER_DNS      160      /* list of registration server DNs */
+
+#define OCI_ATTR_DN_COUNT        161             /* the number of server DNs */
+#define OCI_ATTR_SERVER_DN       162                  /* server DN attribute */
+
+#define OCI_ATTR_MAXCHAR_SIZE               163     /* max char size of data */
+
+#define OCI_ATTR_CURRENT_POSITION           164 /* for scrollable result sets*/
+
+/* Added to get attributes for ref cursor to statement handle */
+#define OCI_ATTR_RESERVED_3                 165                  /* reserved */
+#define OCI_ATTR_RESERVED_4                 166                  /* reserved */
+#define OCI_ATTR_DIRPATH_FN_CTX             167  /* fn ctx ADT attrs or args */
+#define OCI_ATTR_DIGEST_ALGO                168          /* digest algorithm */
+#define OCI_ATTR_CERTIFICATE                169               /* certificate */
+#define OCI_ATTR_SIGNATURE_ALGO             170       /* signature algorithm */
+#define OCI_ATTR_CANONICAL_ALGO             171    /* canonicalization algo. */
+#define OCI_ATTR_PRIVATE_KEY                172               /* private key */
+#define OCI_ATTR_DIGEST_VALUE               173              /* digest value */
+#define OCI_ATTR_SIGNATURE_VAL              174           /* signature value */
+#define OCI_ATTR_SIGNATURE                  175                 /* signature */
+
+/* attributes for setting OCI stmt caching specifics in svchp */
+#define OCI_ATTR_STMTCACHESIZE              176     /* size of the stm cache */
+
+/* --------------------------- Connection Pool Attributes ------------------ */
+#define OCI_ATTR_CONN_NOWAIT               178
+#define OCI_ATTR_CONN_BUSY_COUNT            179
+#define OCI_ATTR_CONN_OPEN_COUNT            180
+#define OCI_ATTR_CONN_TIMEOUT               181
+#define OCI_ATTR_STMT_STATE                 182
+#define OCI_ATTR_CONN_MIN                   183
+#define OCI_ATTR_CONN_MAX                   184
+#define OCI_ATTR_CONN_INCR                  185
+
+#define OCI_ATTR_DIRPATH_OID                187   /* loading into an OID col */
+
+#define OCI_ATTR_NUM_OPEN_STMTS             188     /* open stmts in session */
+#define OCI_ATTR_DESCRIBE_NATIVE            189  /* get native info via desc */
+
+#define OCI_ATTR_BIND_COUNT                 190   /* number of bind postions */
+#define OCI_ATTR_HANDLE_POSITION            191 /* pos of bind/define handle */
+#define OCI_ATTR_RESERVED_5                 192                 /* reserverd */
+#define OCI_ATTR_SERVER_BUSY                193 /* call in progress on server*/
+
+#define OCI_ATTR_DIRPATH_SID                194   /* loading into an SID col */
+/* notification presentation for recipient */
+#define OCI_ATTR_SUBSCR_RECPTPRES           195
+#define OCI_ATTR_TRANSFORMATION             196 /* AQ message transformation */
+
+#define OCI_ATTR_ROWS_FETCHED               197 /* rows fetched in last call */
+
+/* --------------------------- Snapshot attributes ------------------------- */
+#define OCI_ATTR_SCN_BASE                   198             /* snapshot base */
+#define OCI_ATTR_SCN_WRAP                   199             /* snapshot wrap */
+
+/* --------------------------- Miscellanous attributes --------------------- */
+#define OCI_ATTR_RESERVED_6                 200                  /* reserved */
+#define OCI_ATTR_READONLY_TXN               201           /* txn is readonly */
+#define OCI_ATTR_RESERVED_7                 202                  /* reserved */
+#define OCI_ATTR_ERRONEOUS_COLUMN           203 /* position of erroneous col */
+#define OCI_ATTR_RESERVED_8                 204                  /* reserved */
+
+/* -------------------- 8.2 dpapi support of ADTs continued ---------------- */
+#define OCI_ATTR_DIRPATH_OBJ_CONSTR         206 /* obj type of subst obj tbl */
+#define OCI_ATTR_INST_TYPE                  207      /* oracle instance type */
+/******USED attribute 208 for  OCI_ATTR_SPOOL_STMTCACHESIZE*******************/
+
+#define OCI_ATTR_ENV_UTF16                  209     /* is env in utf16 mode? */
+#define OCI_ATTR_RESERVED_9                 210          /* reserved for TMZ */
+#define OCI_ATTR_RESERVED_10                211                  /* reserved */
+
+/* Attr to allow setting of the stream version PRIOR to calling Prepare */
+#define OCI_ATTR_DIRPATH_STREAM_VERSION     212      /* version of the stream*/
+
+#define OCIP_ATTR_DIRPATH_VARRAY_INDEX      213       /* varray index column */
+
+#define OCI_ATTR_RESERVED_12                214                  /* reserved */
+#define OCI_ATTR_RESERVED_13                215                  /* reserved */
+#define OCI_ATTR_IS_EXTERNAL                216 /* whether table is external */
+
+
+/* -------------------------- Statement Handle Attributes ------------------ */
+
+#define OCI_ATTR_RESERVED_15                217                  /* reserved */
+#define OCI_ATTR_STMT_IS_RETURNING          218 /* stmt has returning clause */
+#define OCI_ATTR_RESERVED_16                219                  /* reserved */
+#define OCI_ATTR_RESERVED_17                220                  /* reserved */
+#define OCI_ATTR_RESERVED_18                221                  /* reserved */
+
+/* --------------------------- session attributes ---------------------------*/
+#define OCI_ATTR_RESERVED_19                222                  /* reserved */
+
+/*------------- Supported Values for Direct Path Stream Version -------------*/
+#define OCI_DIRPATH_STREAM_VERSION_1        100
+#define OCI_DIRPATH_STREAM_VERSION_2        200
+#define OCI_DIRPATH_STREAM_VERSION_3        300                   /* default */
+
+/* ----------------------- row callback attributes ------------------------- */
+#define OCI_ATTR_BIND_ROWCBK                301         /* bind row callback */
+#define OCI_ATTR_BIND_ROWCTX                302 /* ctx for bind row callback */
+#define OCI_ATTR_SKIP_BUFFER                303  /* skip buffer in array ops */
+
+/* -------- client side character and national character set ids ----------- */
+#define OCI_ATTR_ENV_CHARSET_ID   OCI_ATTR_CHARSET_ID   /* charset id in env */
+#define OCI_ATTR_ENV_NCHARSET_ID  OCI_ATTR_NCHARSET_ID /* ncharset id in env */
+
+
+/*------------- Supported Values for protocol for recepient -----------------*/
+#define OCI_SUBSCR_PROTO_OCI                0                         /* oci */
+#define OCI_SUBSCR_PROTO_MAIL               1                        /* mail */
+#define OCI_SUBSCR_PROTO_SERVER             2                      /* server */
+#define OCI_SUBSCR_PROTO_HTTP               3                        /* http */
+#define OCI_SUBSCR_PROTO_MAX                4       /* max current protocols */
+
+/*------------- Supported Values for presentation for recepient -------------*/
+#define OCI_SUBSCR_PRES_DEFAULT             0                     /* default */
+#define OCI_SUBSCR_PRES_XML                 1                         /* xml */
+#define OCI_SUBSCR_PRES_MAX                 2   /* max current presentations */
+                                                   
+
+/* ----- Temporary attribute value for UCS2/UTF16 character set ID -------- */ 
+#define OCI_UCS2ID            1000                        /* UCS2 charset ID */
+#define OCI_UTF16ID           1000                       /* UTF16 charset ID */
+
+/*============================== End OCI Attribute Types ====================*/
+
+/*---------------- Server Handle Attribute Values ---------------------------*/
+
+/* OCI_ATTR_SERVER_STATUS */
+#define OCI_SERVER_NOT_CONNECTED        0x0 
+#define OCI_SERVER_NORMAL               0x1 
+
+/*---------------------------------------------------------------------------*/
+
+/*------------------------- Supported Namespaces  ---------------------------*/
+#define OCI_SUBSCR_NAMESPACE_ANONYMOUS   0            /* Anonymous Namespace */
+#define OCI_SUBSCR_NAMESPACE_AQ          1                /* Advanced Queues */
+#define OCI_SUBSCR_NAMESPACE_MAX         2          /* Max Name Space Number */
+
+
+/*-------------------------Credential Types----------------------------------*/
+#define OCI_CRED_RDBMS      1                  /* database username/password */
+#define OCI_CRED_EXT        2             /* externally provided credentials */
+#define OCI_CRED_PROXY      3                        /* proxy authentication */
+#define OCI_CRED_RESERVED_1 4                                    /* reserved */
+#define OCI_CRED_RESERVED_2 5                                    /* reserved */
+/*---------------------------------------------------------------------------*/
+
+/*------------------------Error Return Values--------------------------------*/
+#define OCI_SUCCESS 0                      /* maps to SQL_SUCCESS of SAG CLI */
+#define OCI_SUCCESS_WITH_INFO 1             /* maps to SQL_SUCCESS_WITH_INFO */
+#define OCI_RESERVED_FOR_INT_USE 200                            /* reserved */ 
+#define OCI_NO_DATA 100                               /* maps to SQL_NO_DATA */
+#define OCI_ERROR -1                                    /* maps to SQL_ERROR */
+#define OCI_INVALID_HANDLE -2                  /* maps to SQL_INVALID_HANDLE */
+#define OCI_NEED_DATA 99                            /* maps to SQL_NEED_DATA */
+#define OCI_STILL_EXECUTING -3123                   /* OCI would block error */
+/*---------------------------------------------------------------------------*/
+
+/*--------------------- User Callback Return Values -------------------------*/
+#define OCI_CONTINUE -24200    /* Continue with the body of the OCI function */
+#define OCI_ROWCBK_DONE   -24201              /* done with user row callback */
+/*---------------------------------------------------------------------------*/
+
+/*------------------DateTime and Interval check Error codes------------------*/
+
+/* DateTime Error Codes used by OCIDateTimeCheck() */
+#define   OCI_DT_INVALID_DAY         0x1                          /* Bad day */
+#define   OCI_DT_DAY_BELOW_VALID     0x2      /* Bad DAy Low/high bit (1=low)*/
+#define   OCI_DT_INVALID_MONTH       0x4                       /*  Bad MOnth */
+#define   OCI_DT_MONTH_BELOW_VALID   0x8   /* Bad MOnth Low/high bit (1=low) */
+#define   OCI_DT_INVALID_YEAR        0x10                        /* Bad YeaR */
+#define   OCI_DT_YEAR_BELOW_VALID    0x20  /*  Bad YeaR Low/high bit (1=low) */
+#define   OCI_DT_INVALID_HOUR        0x40                       /*  Bad HouR */
+#define   OCI_DT_HOUR_BELOW_VALID    0x80   /* Bad HouR Low/high bit (1=low) */
+#define   OCI_DT_INVALID_MINUTE      0x100                     /* Bad MiNute */
+#define   OCI_DT_MINUTE_BELOW_VALID  0x200 /*Bad MiNute Low/high bit (1=low) */
+#define   OCI_DT_INVALID_SECOND      0x400                    /*  Bad SeCond */
+#define   OCI_DT_SECOND_BELOW_VALID  0x800  /*bad second Low/high bit (1=low)*/
+#define   OCI_DT_DAY_MISSING_FROM_1582 0x1000     
+                                 /*  Day is one of those "missing" from 1582 */
+#define   OCI_DT_YEAR_ZERO           0x2000       /* Year may not equal zero */
+#define   OCI_DT_INVALID_TIMEZONE    0x4000                 /*  Bad Timezone */
+#define   OCI_DT_INVALID_FORMAT      0x8000         /* Bad date format input */
+
+
+/* Interval Error Codes used by OCIInterCheck() */
+#define   OCI_INTER_INVALID_DAY         0x1                       /* Bad day */
+#define   OCI_INTER_DAY_BELOW_VALID     0x2  /* Bad DAy Low/high bit (1=low) */
+#define   OCI_INTER_INVALID_MONTH       0x4                     /* Bad MOnth */
+#define   OCI_INTER_MONTH_BELOW_VALID   0x8 /*Bad MOnth Low/high bit (1=low) */
+#define   OCI_INTER_INVALID_YEAR        0x10                     /* Bad YeaR */
+#define   OCI_INTER_YEAR_BELOW_VALID    0x20 /*Bad YeaR Low/high bit (1=low) */
+#define   OCI_INTER_INVALID_HOUR        0x40                     /* Bad HouR */
+#define   OCI_INTER_HOUR_BELOW_VALID    0x80 /*Bad HouR Low/high bit (1=low) */
+#define   OCI_INTER_INVALID_MINUTE      0x100                  /* Bad MiNute */
+#define   OCI_INTER_MINUTE_BELOW_VALID  0x200 
+                                            /*Bad MiNute Low/high bit(1=low) */
+#define   OCI_INTER_INVALID_SECOND      0x400                  /* Bad SeCond */
+#define   OCI_INTER_SECOND_BELOW_VALID  0x800   
+                                            /*bad second Low/high bit(1=low) */
+#define   OCI_INTER_INVALID_FRACSEC     0x1000      /* Bad Fractional second */
+#define   OCI_INTER_FRACSEC_BELOW_VALID 0x2000  
+                                           /* Bad fractional second Low/High */
+
+
+/*------------------------Parsing Syntax Types-------------------------------*/
+#define OCI_V7_SYNTAX 2       /* V815 language - for backwards compatibility */
+#define OCI_V8_SYNTAX 3       /* V815 language - for backwards compatibility */
+#define OCI_NTV_SYNTAX 1    /* Use what so ever is the native lang of server */
+                     /* these values must match the values defined in kpul.h */
+/*---------------------------------------------------------------------------*/
+
+/*------------------------Scrollable Cursor Fetch Options------------------- 
+ * For non-scrollable cursor, the only valid (and default) orientation is 
+ * OCI_FETCH_NEXT
+ */
+#define OCI_FETCH_CURRENT 0x01               /* refetching current position  */
+#define OCI_FETCH_NEXT 0x02                                      /* next row */
+#define OCI_FETCH_FIRST 0x04                  /* first row of the result set */
+#define OCI_FETCH_LAST 0x08                /* the last row of the result set */
+#define OCI_FETCH_PRIOR 0x10         /* the previous row relative to current */
+#define OCI_FETCH_ABSOLUTE 0x20                /* absolute offset from first */
+#define OCI_FETCH_RELATIVE 0x40                /* offset relative to current */
+#define OCI_FETCH_RESERVED_1 0x80                                /* reserved */
+
+/*---------------------------------------------------------------------------*/
+
+/*------------------------Bind and Define Options----------------------------*/
+#define OCI_SB2_IND_PTR       0x00000001                           /* unused */
+#define OCI_DATA_AT_EXEC      0x00000002             /* data at execute time */
+#define OCI_DYNAMIC_FETCH     0x00000002                /* fetch dynamically */
+#define OCI_PIECEWISE         0x00000004          /* piecewise DMLs or fetch */
+#define OCI_DEFINE_RESERVED_1 0x00000008                         /* reserved */
+#define OCI_BIND_RESERVED_2   0x00000010                         /* reserved */
+#define OCI_DEFINE_RESERVED_2 0x00000020                         /* reserved */
+#define OCI_BIND_SOFT         0x00000040              /* soft bind or define */
+#define OCI_DEFINE_SOFT       0x00000080              /* soft bind or define */
+/*---------------------------------------------------------------------------*/
+
+/*-----------------------------  Various Modes ------------------------------*/
+#define OCI_DEFAULT         0x00000000 
+                          /* the default value for parameters and attributes */
+/*-------------OCIInitialize Modes / OCICreateEnvironment Modes -------------*/
+#define OCI_THREADED        0x00000001      /* appl. in threaded environment */
+#define OCI_OBJECT          0x00000002  /* application in object environment */
+#define OCI_EVENTS          0x00000004  /* application is enabled for events */
+#define OCI_RESERVED1       0x00000008                           /* reserved */
+#define OCI_SHARED          0x00000010  /* the application is in shared mode */
+#define OCI_RESERVED2       0x00000020                           /* reserved */
+/* The following *TWO* are only valid for OCICreateEnvironment call */
+#define OCI_NO_UCB          0x00000040 /* No user callback called during ini */
+#define OCI_NO_MUTEX        0x00000080 /* the environment handle will not be */
+                                         /*  protected by a mutex internally */
+#define OCI_SHARED_EXT      0x00000100              /* Used for shared forms */
+/************************** 0x00000200 free **********************************/
+#define OCI_ALWAYS_BLOCKING 0x00000400    /* all connections always blocking */
+/************************** 0x00000800 free **********************************/
+#define OCI_USE_LDAP        0x00001000            /* allow  LDAP connections */
+#define OCI_REG_LDAPONLY    0x00002000              /* only register to LDAP */
+#define OCI_UTF16           0x00004000        /* mode for all UTF16 metadata */
+#define OCI_AFC_PAD_ON      0x00008000 
+                             /* turn on AFC blank padding when rlenp present */
+#define OCI_ENVCR_RESERVED3 0x00010000                           /* reserved */
+#define OCI_NEW_LENGTH_SEMANTICS  0x00020000   /* adopt new length semantics */
+       /* the new length semantics, always bytes, is used by OCIEnvNlsCreate */
+#define OCI_NO_MUTEX_STMT   0x00040000           /* Do not mutex stmt handle */
+#define OCI_MUTEX_ENV_ONLY  0x00080000  /* Mutex only the environment handle */
+#define OCI_STM_RESERVED4   0x00100000                           /* reserved */
+
+/*---------------------------------------------------------------------------*/
+/*------------------------OCIConnectionpoolCreate Modes----------------------*/
+
+#define OCI_CPOOL_REINITIALIZE 0x111
+
+/*---------------------------------------------------------------------------*/
+/*--------------------------------- OCILogon2 Modes -------------------------*/
+
+#define OCI_LOGON2_SPOOL       0x0001     /* Use session pool */
+#define OCI_LOGON2_CPOOL       OCI_CPOOL  /* Use connection pool */
+#define OCI_LOGON2_STMTCACHE   0x0004     /* Use Stmt Caching */
+#define OCI_LOGON2_PROXY       0x0008     /* Proxy authentiaction */
+
+/*---------------------------------------------------------------------------*/
+/*------------------------- OCISessionPoolCreate Modes ----------------------*/
+
+#define OCI_SPC_REINITIALIZE 0x0001   /* Reinitialize the session pool */
+#define OCI_SPC_HOMOGENEOUS  0x0002   /* Session pool is homogeneneous */
+#define OCI_SPC_STMTCACHE    0x0004   /* Session pool has stmt cache */
+
+/*---------------------------------------------------------------------------*/
+/*--------------------------- OCISessionGet Modes ---------------------------*/
+
+#define OCI_SESSGET_SPOOL      0x0001     /* SessionGet called in SPOOL mode */
+#define OCI_SESSGET_CPOOL      OCI_CPOOL  /* SessionGet called in CPOOL mode */
+#define OCI_SESSGET_STMTCACHE  0x0004                 /* Use statement cache */
+#define OCI_SESSGET_CREDPROXY  0x0008     /* SessionGet called in proxy mode */
+#define OCI_SESSGET_CREDEXT    0x0010     
+#define OCI_SESSGET_SPOOL_MATCHANY 0x0020
+/*---------------------------------------------------------------------------*/
+/*------------------------ATTR Values for Session Pool-----------------------*/
+/* Attribute values for OCI_ATTR_SPOOL_GETMODE */
+#define OCI_SPOOL_ATTRVAL_WAIT     0         /* block till you get a session */
+#define OCI_SPOOL_ATTRVAL_NOWAIT   1    /* error out if no session avaliable */
+#define OCI_SPOOL_ATTRVAL_FORCEGET 2  /* get session even if max is exceeded */
+
+/*---------------------------------------------------------------------------*/
+/*--------------------------- OCISessionRelease Modes -----------------------*/
+
+#define OCI_SESSRLS_DROPSESS 0x0001                    /* Drop the Session */
+#define OCI_SESSRLS_RETAG    0x0002                   /* Retag the session */
+
+/*---------------------------------------------------------------------------*/
+/*----------------------- OCISessionPoolDestroy Modes -----------------------*/
+
+#define OCI_SPD_FORCE        0x0001       /* Force the sessions to terminate. 
+                                             Even if there are some busy 
+                                             sessions close them */
+ 
+/*---------------------------------------------------------------------------*/
+/*----------------------------- Statement States ----------------------------*/
+
+#define OCI_STMT_STATE_INITIALIZED  0x0001
+#define OCI_STMT_STATE_EXECUTED     0x0002
+#define OCI_STMT_STATE_END_OF_FETCH 0x0003
+
+/*---------------------------------------------------------------------------*/
+
+/*----------------------------- OCIMemStats Modes ---------------------------*/
+#define OCI_MEM_INIT        0x01 
+#define OCI_MEM_CLN         0x02 
+#define OCI_MEM_FLUSH       0x04 
+#define OCI_DUMP_HEAP       0x80
+
+#define OCI_CLIENT_STATS    0x10 
+#define OCI_SERVER_STATS    0x20 
+
+/*----------------------------- OCIEnvInit Modes ----------------------------*/
+/* NOTE: NO NEW MODES SHOULD BE ADDED HERE BECAUSE THE RECOMMENDED METHOD 
+ * IS TO USE THE NEW OCICreateEnvironment MODES.
+ */
+#define OCI_ENV_NO_UCB 0x01         /* A user callback will not be called in
+                                       OCIEnvInit() */
+#define OCI_ENV_NO_MUTEX 0x08 /* the environment handle will not be protected
+                                 by a mutex internally */
+
+/*---------------------------------------------------------------------------*/
+
+/*------------------------ Prepare Modes ------------------------------------*/
+#define OCI_NO_SHARING        0x01      /* turn off statement handle sharing */
+#define OCI_PREP_RESERVED_1   0x02                               /* reserved */
+#define OCI_PREP_AFC_PAD_ON   0x04          /* turn on blank padding for AFC */
+#define OCI_PREP_AFC_PAD_OFF  0x08         /* turn off blank padding for AFC */
+/*---------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------*/
+
+/*----------------------- Execution Modes -----------------------------------*/
+#define OCI_BATCH_MODE        0x01  /* batch the oci statement for execution */
+#define OCI_EXACT_FETCH       0x02         /* fetch the exact rows specified */
+#define OCI_KEEP_FETCH_STATE  0x04                                 /* unused */
+#define OCI_STMT_SCROLLABLE_READONLY 0x08     /* if result set is scrollable */
+#define OCI_DESCRIBE_ONLY     0x10            /* only describe the statement */
+#define OCI_COMMIT_ON_SUCCESS 0x20        /* commit, if successful execution */
+#define OCI_NON_BLOCKING      0x40                           /* non-blocking */
+#define OCI_BATCH_ERRORS      0x80             /* batch errors in array dmls */
+#define OCI_PARSE_ONLY        0x100              /* only parse the statement */
+#define OCI_EXACT_FETCH_RESERVED_1 0x200                         /* reserved */
+#define OCI_SHOW_DML_WARNINGS 0x400   
+         /* return OCI_SUCCESS_WITH_INFO for delete/update w/no where clause */
+#define OCI_EXEC_RESERVED_2   0x800                              /* reserved */
+#define OCI_DESC_RESERVED_1   0x1000                             /* reserved */
+#define OCI_EXEC_RESERVED_3   0x2000                             /* reserved */
+#define OCI_EXEC_RESERVED_4   0x4000                             /* reserved */  
+
+/*---------------------------------------------------------------------------*/
+
+/*------------------------Authentication Modes-------------------------------*/
+#define OCI_MIGRATE         0x0001                /* migratable auth context */
+#define OCI_SYSDBA          0x0002               /* for SYSDBA authorization */
+#define OCI_SYSOPER         0x0004              /* for SYSOPER authorization */
+#define OCI_PRELIM_AUTH     0x0008          /* for preliminary authorization */
+#define OCIP_ICACHE         0x0010 /* Private OCI cache mode to notify cache */
+#define OCI_AUTH_RESERVED_1 0x0020                               /* reserved */
+#define OCI_STMT_CACHE      0x0040                /* enable OCI Stmt Caching */
+
+/*---------------------------------------------------------------------------*/
+
+/*------------------------Session End Modes----------------------------------*/
+#define OCI_SESSEND_RESERVED_1 0x0001                            /* reserved */
+/*---------------------------------------------------------------------------*/
+
+/*------------------------Attach Modes---------------------------------------*/
+
+/* The following attach modes are the same as the UPI modes defined in 
+ * UPIDEF.H.  Do not use these values externally.
+ */
+
+#define OCI_FASTPATH         0x0010              /* Attach in fast path mode */
+#define OCI_ATCH_RESERVED_1  0x0020                              /* reserved */
+#define OCI_ATCH_RESERVED_2  0x0080                              /* reserved */
+#define OCI_ATCH_RESERVED_3  0x0100                              /* reserved */
+#define OCI_CPOOL            0x0200  /* Attach using server handle from pool */
+#define OCI_ATCH_RESERVED_4  0x0400                              /* reserved */
+
+/*---------------------OCIStmtPrepare2 Modes---------------------------------*/
+#define OCI_PREP2_CACHE_SEARCHONLY    0x0010                  /* ONly Search */
+#define OCI_PREP2_GET_PLSQL_WARNINGS  0x0020         /* Get PL/SQL warnings  */
+
+/*---------------------OCIStmtRelease Modes----------------------------------*/
+#define OCI_STRLS_CACHE_DELETE      0x0010              /* Delete from Cache */
+
+/*-----------------------------End Various Modes ----------------------------*/
+
+/*------------------------Piece Information----------------------------------*/
+#define OCI_PARAM_IN 0x01                                    /* in parameter */
+#define OCI_PARAM_OUT 0x02                                  /* out parameter */
+/*---------------------------------------------------------------------------*/
+
+/*------------------------ Transaction Start Flags --------------------------*/
+/* NOTE: OCI_TRANS_JOIN and OCI_TRANS_NOMIGRATE not supported in 8.0.X       */
+#define OCI_TRANS_NEW          0x00000001 /* starts a new transaction branch */
+#define OCI_TRANS_JOIN         0x00000002    /* join an existing transaction */
+#define OCI_TRANS_RESUME       0x00000004         /* resume this transaction */
+#define OCI_TRANS_STARTMASK    0x000000ff
+
+#define OCI_TRANS_READONLY     0x00000100   /* starts a readonly transaction */
+#define OCI_TRANS_READWRITE    0x00000200 /* starts a read-write transaction */
+#define OCI_TRANS_SERIALIZABLE 0x00000400
+                                        /* starts a serializable transaction */
+#define OCI_TRANS_ISOLMASK     0x0000ff00
+
+#define OCI_TRANS_LOOSE        0x00010000        /* a loosely coupled branch */
+#define OCI_TRANS_TIGHT        0x00020000        /* a tightly coupled branch */
+#define OCI_TRANS_TYPEMASK     0x000f0000
+
+#define OCI_TRANS_NOMIGRATE    0x00100000      /* non migratable transaction */
+#define OCI_TRANS_SEPARABLE    0x00200000  /* separable transaction (8.1.6+) */
+
+
+/*---------------------------------------------------------------------------*/
+
+/*------------------------ Transaction End Flags ----------------------------*/
+#define OCI_TRANS_TWOPHASE      0x01000000           /* use two phase commit */
+/*---------------------------------------------------------------------------*/
+
+/*------------------------- AQ Constants ------------------------------------
+ * NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
+ * The following constants must match the PL/SQL dbms_aq constants
+ * NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
+ */
+/* ------------------------- Visibility flags -------------------------------*/
+#define OCI_ENQ_IMMEDIATE       1   /* enqueue is an independent transaction */
+#define OCI_ENQ_ON_COMMIT       2  /* enqueue is part of current transaction */
+
+/* ----------------------- Dequeue mode flags -------------------------------*/
+#define OCI_DEQ_BROWSE          1   /* read message without acquiring a lock */
+#define OCI_DEQ_LOCKED          2   /* read and obtain write lock on message */
+#define OCI_DEQ_REMOVE          3          /* read the message and delete it */
+#define OCI_DEQ_REMOVE_NODATA   4    /* delete message w'o returning payload */
+#define OCI_DEQ_GETSIG          5                      /* get signature only */
+
+/* ----------------- Dequeue navigation flags -------------------------------*/
+#define OCI_DEQ_FIRST_MSG        1     /* get first message at head of queue */
+#define OCI_DEQ_NEXT_MSG         3         /* next message that is available */
+#define OCI_DEQ_NEXT_TRANSACTION 2    /* get first message of next txn group */
+#define OCI_DEQ_MULT_TRANSACTION 5        /* array dequeue across txn groups */
+
+/* ----------------- Dequeue Option Reserved flags ------------------------- */
+#define OCI_DEQ_RESERVED_1      0x000001
+
+/* --------------------- Message states -------------------------------------*/
+#define OCI_MSG_WAITING         1 /* the message delay has not yet completed */
+#define OCI_MSG_READY           0    /* the message is ready to be processed */
+#define OCI_MSG_PROCESSED       2          /* the message has been processed */
+#define OCI_MSG_EXPIRED         3    /* message has moved to exception queue */
+
+/* --------------------- Sequence deviation ---------------------------------*/
+#define OCI_ENQ_BEFORE          2  /* enqueue message before another message */
+#define OCI_ENQ_TOP             3     /* enqueue message before all messages */
+
+/* ------------------------- Visibility flags -------------------------------*/
+#define OCI_DEQ_IMMEDIATE       1   /* dequeue is an independent transaction */
+#define OCI_DEQ_ON_COMMIT       2  /* dequeue is part of current transaction */
+
+/* ------------------------ Wait --------------------------------------------*/
+#define OCI_DEQ_WAIT_FOREVER    -1   /* wait forever if no message available */
+#define OCI_DEQ_NO_WAIT         0  /* do not wait if no message is available */
+
+/* ------------------------ Delay -------------------------------------------*/
+#define OCI_MSG_NO_DELAY        0        /* message is available immediately */
+
+/* ------------------------- Expiration -------------------------------------*/
+#define OCI_MSG_NO_EXPIRATION -1                /* message will never expire */
+
+/* ------------------------- Reserved ---------------------------------------*/
+#define OCI_AQ_RESERVED_1      0x0002
+#define OCI_AQ_RESERVED_2      0x0004
+#define OCI_AQ_RESERVED_3      0x0008
+
+/* -------------------------- END AQ Constants ----------------------------- */
+
+/* --------------------END DateTime and Interval Constants ------------------*/
+
+/*-----------------------Object Types----------------------------------------*/
+/*-----------Object Types **** Not to be Used **** --------------------------*/
+/* Deprecated */
+#define OCI_OTYPE_UNK           0
+#define OCI_OTYPE_TABLE         1
+#define OCI_OTYPE_VIEW          2
+#define OCI_OTYPE_SYN           3
+#define OCI_OTYPE_PROC          4
+#define OCI_OTYPE_FUNC          5
+#define OCI_OTYPE_PKG           6
+#define OCI_OTYPE_STMT          7
+/*---------------------------------------------------------------------------*/
+
+/*=======================Describe Handle Parameter Attributes ===============*/
+/* 
+   These attributes are orthogonal to the other set of attributes defined 
+   above.  These attrubutes are tobe used only for the desscribe handle 
+*/
+/*===========================================================================*/
+/* Attributes common to Columns and Stored Procs */
+#define OCI_ATTR_DATA_SIZE      1                /* maximum size of the data */
+#define OCI_ATTR_DATA_TYPE      2     /* the SQL type of the column/argument */
+#define OCI_ATTR_DISP_SIZE      3                        /* the display size */
+#define OCI_ATTR_NAME           4         /* the name of the column/argument */
+#define OCI_ATTR_PRECISION      5                /* precision if number type */
+#define OCI_ATTR_SCALE          6                    /* scale if number type */
+#define OCI_ATTR_IS_NULL        7                            /* is it null ? */
+#define OCI_ATTR_TYPE_NAME      8
+  /* name of the named data type or a package name for package private types */
+#define OCI_ATTR_SCHEMA_NAME    9             /* the schema name */
+#define OCI_ATTR_SUB_NAME       10      /* type name if package private type */
+#define OCI_ATTR_POSITION       11
+                    /* relative position of col/arg in the list of cols/args */
+/* complex object retrieval parameter attributes */
+#define OCI_ATTR_COMPLEXOBJECTCOMP_TYPE         50 
+#define OCI_ATTR_COMPLEXOBJECTCOMP_TYPE_LEVEL   51
+#define OCI_ATTR_COMPLEXOBJECT_LEVEL            52
+#define OCI_ATTR_COMPLEXOBJECT_COLL_OUTOFLINE   53
+
+/* Only Columns */
+#define OCI_ATTR_DISP_NAME      100                      /* the display name */
+
+/*Only Stored Procs */
+#define OCI_ATTR_OVERLOAD       210           /* is this position overloaded */
+#define OCI_ATTR_LEVEL          211            /* level for structured types */
+#define OCI_ATTR_HAS_DEFAULT    212                   /* has a default value */
+#define OCI_ATTR_IOMODE         213                         /* in, out inout */
+#define OCI_ATTR_RADIX          214                       /* returns a radix */
+#define OCI_ATTR_NUM_ARGS       215             /* total number of arguments */
+
+/* only named type attributes */
+#define OCI_ATTR_TYPECODE                  216       /* object or collection */
+#define OCI_ATTR_COLLECTION_TYPECODE       217     /* varray or nested table */
+#define OCI_ATTR_VERSION                   218      /* user assigned version */
+#define OCI_ATTR_IS_INCOMPLETE_TYPE        219 /* is this an incomplete type */
+#define OCI_ATTR_IS_SYSTEM_TYPE            220              /* a system type */
+#define OCI_ATTR_IS_PREDEFINED_TYPE        221          /* a predefined type */
+#define OCI_ATTR_IS_TRANSIENT_TYPE         222           /* a transient type */
+#define OCI_ATTR_IS_SYSTEM_GENERATED_TYPE  223      /* system generated type */
+#define OCI_ATTR_HAS_NESTED_TABLE          224 /* contains nested table attr */
+#define OCI_ATTR_HAS_LOB                   225        /* has a lob attribute */
+#define OCI_ATTR_HAS_FILE                  226       /* has a file attribute */
+#define OCI_ATTR_COLLECTION_ELEMENT        227 /* has a collection attribute */
+#define OCI_ATTR_NUM_TYPE_ATTRS            228  /* number of attribute types */
+#define OCI_ATTR_LIST_TYPE_ATTRS           229    /* list of type attributes */
+#define OCI_ATTR_NUM_TYPE_METHODS          230     /* number of type methods */
+#define OCI_ATTR_LIST_TYPE_METHODS         231       /* list of type methods */
+#define OCI_ATTR_MAP_METHOD                232         /* map method of type */
+#define OCI_ATTR_ORDER_METHOD              233       /* order method of type */
+
+/* only collection element */
+#define OCI_ATTR_NUM_ELEMS                 234         /* number of elements */
+
+/* only type methods */
+#define OCI_ATTR_ENCAPSULATION             235        /* encapsulation level */
+#define OCI_ATTR_IS_SELFISH                236             /* method selfish */
+#define OCI_ATTR_IS_VIRTUAL                237                    /* virtual */
+#define OCI_ATTR_IS_INLINE                 238                     /* inline */
+#define OCI_ATTR_IS_CONSTANT               239                   /* constant */
+#define OCI_ATTR_HAS_RESULT                240                 /* has result */
+#define OCI_ATTR_IS_CONSTRUCTOR            241                /* constructor */
+#define OCI_ATTR_IS_DESTRUCTOR             242                 /* destructor */
+#define OCI_ATTR_IS_OPERATOR               243                   /* operator */
+#define OCI_ATTR_IS_MAP                    244               /* a map method */
+#define OCI_ATTR_IS_ORDER                  245               /* order method */
+#define OCI_ATTR_IS_RNDS                   246  /* read no data state method */
+#define OCI_ATTR_IS_RNPS                   247      /* read no process state */
+#define OCI_ATTR_IS_WNDS                   248 /* write no data state method */
+#define OCI_ATTR_IS_WNPS                   249     /* write no process state */
+
+#define OCI_ATTR_DESC_PUBLIC               250              /* public object */
+
+/* Object Cache Enhancements : attributes for User Constructed Instances     */
+#define OCI_ATTR_CACHE_CLIENT_CONTEXT      251
+#define OCI_ATTR_UCI_CONSTRUCT             252
+#define OCI_ATTR_UCI_DESTRUCT              253
+#define OCI_ATTR_UCI_COPY                  254
+#define OCI_ATTR_UCI_PICKLE                255
+#define OCI_ATTR_UCI_UNPICKLE              256
+#define OCI_ATTR_UCI_REFRESH               257
+
+/* for type inheritance */
+#define OCI_ATTR_IS_SUBTYPE                258
+#define OCI_ATTR_SUPERTYPE_SCHEMA_NAME     259
+#define OCI_ATTR_SUPERTYPE_NAME            260
+
+/* for schemas */
+#define OCI_ATTR_LIST_OBJECTS              261  /* list of objects in schema */
+
+/* for database */
+#define OCI_ATTR_NCHARSET_ID               262                /* char set id */
+#define OCI_ATTR_LIST_SCHEMAS              263            /* list of schemas */
+#define OCI_ATTR_MAX_PROC_LEN              264       /* max procedure length */
+#define OCI_ATTR_MAX_COLUMN_LEN            265     /* max column name length */
+#define OCI_ATTR_CURSOR_COMMIT_BEHAVIOR    266     /* cursor commit behavior */
+#define OCI_ATTR_MAX_CATALOG_NAMELEN       267         /* catalog namelength */
+#define OCI_ATTR_CATALOG_LOCATION          268           /* catalog location */
+#define OCI_ATTR_SAVEPOINT_SUPPORT         269          /* savepoint support */
+#define OCI_ATTR_NOWAIT_SUPPORT            270             /* nowait support */
+#define OCI_ATTR_AUTOCOMMIT_DDL            271             /* autocommit DDL */
+#define OCI_ATTR_LOCKING_MODE              272               /* locking mode */
+
+/* for externally initialized context */
+#define OCI_ATTR_APPCTX_SIZE               273 /* count of context to be init*/
+#define OCI_ATTR_APPCTX_LIST               274 /* count of context to be init*/
+#define OCI_ATTR_APPCTX_NAME               275 /* name  of context to be init*/
+#define OCI_ATTR_APPCTX_ATTR               276 /* attr  of context to be init*/
+#define OCI_ATTR_APPCTX_VALUE              277 /* value of context to be init*/
+
+/* for client id propagation */
+#define OCI_ATTR_CLIENT_IDENTIFIER         278   /* value of client id to set*/
+
+/* for inheritance - part 2 */
+#define OCI_ATTR_IS_FINAL_TYPE             279            /* is final type ? */
+#define OCI_ATTR_IS_INSTANTIABLE_TYPE      280     /* is instantiable type ? */
+#define OCI_ATTR_IS_FINAL_METHOD           281          /* is final method ? */
+#define OCI_ATTR_IS_INSTANTIABLE_METHOD    282   /* is instantiable method ? */
+#define OCI_ATTR_IS_OVERRIDING_METHOD      283     /* is overriding method ? */
+
+/* slot 284 available */
+
+#define OCI_ATTR_CHAR_USED                 285      /* char length semantics */
+#define OCI_ATTR_CHAR_SIZE                 286                /* char length */
+
+/* SQLJ support */
+#define OCI_ATTR_IS_JAVA_TYPE              287 /* is java implemented type ? */
+
+/* N-Tier support */
+#define OCI_ATTR_DISTINGUISHED_NAME        300        /* use DN as user name */
+#define OCI_ATTR_KERBEROS_TICKET           301   /* Kerberos ticket as cred. */
+ 
+/* for multilanguage debugging */
+#define OCI_ATTR_ORA_DEBUG_JDWP            302   /* ORA_DEBUG_JDWP attribute */
+
+#define OCI_ATTR_RESERVED_14               303                   /* reserved */
+
+
+/*---------------------------End Describe Handle Attributes -----------------*/
+
+/*------------- Supported Values for Direct Path Date cache -----------------*/
+#define OCI_ATTR_DIRPATH_DCACHE_NUM        303         /* date cache entries */
+#define OCI_ATTR_DIRPATH_DCACHE_SIZE       304           /* date cache limit */
+#define OCI_ATTR_DIRPATH_DCACHE_MISSES     305          /* date cache misses */
+#define OCI_ATTR_DIRPATH_DCACHE_HITS       306            /* date cache hits */
+#define OCI_ATTR_DIRPATH_DCACHE_DISABLE    307 /* on set: disable datecache 
+                                                * on overflow.
+                                                * on get: datecache disabled? 
+                                                * could be due to overflow
+                                                * or others                  */
+
+/* ----------------------- Session Pool Attributes ------------------------- */
+#define OCI_ATTR_SPOOL_TIMEOUT              308           /* session timeout */
+#define OCI_ATTR_SPOOL_GETMODE              309          /* session get mode */
+#define OCI_ATTR_SPOOL_BUSY_COUNT           310        /* busy session count */
+#define OCI_ATTR_SPOOL_OPEN_COUNT           311        /* open session count */
+#define OCI_ATTR_SPOOL_MIN                  312         /* min session count */
+#define OCI_ATTR_SPOOL_MAX                  313         /* max session count */
+#define OCI_ATTR_SPOOL_INCR                 314   /* session increment count */
+#define OCI_ATTR_SPOOL_STMTCACHESIZE        208   /*Stmt cache size of pool  */
+/*------------------------------End Session Pool Attributes -----------------*/
+/*---------------------------- For XML Types ------------------------------- */
+/* For table, view and column */
+#define OCI_ATTR_IS_XMLTYPE          315         /* Is the type an XML type? */
+#define OCI_ATTR_XMLSCHEMA_NAME      316               /* Name of XML Schema */
+#define OCI_ATTR_XMLELEMENT_NAME     317              /* Name of XML Element */
+#define OCI_ATTR_XMLSQLTYPSCH_NAME   318    /* SQL type's schema for XML Ele */
+#define OCI_ATTR_XMLSQLTYPE_NAME     319     /* Name of SQL type for XML Ele */
+#define OCI_ATTR_XMLTYPE_STORED_OBJ  320       /* XML type stored as object? */
+
+/*---------------------------- For Subtypes ------------------------------- */
+/* For type */
+#define OCI_ATTR_HAS_SUBTYPES        321                    /* Has subtypes? */
+#define OCI_ATTR_NUM_SUBTYPES        322               /* Number of subtypes */
+#define OCI_ATTR_LIST_SUBTYPES       323                 /* List of subtypes */
+
+/* XML flag */
+#define OCI_ATTR_XML_HRCHY_ENABLED   324               /* hierarchy enabled? */
+
+/* Method flag */
+#define OCI_ATTR_IS_OVERRIDDEN_METHOD 325           /* Method is overridden? */
+
+/*------------- Attributes for 10i Updates to the DirPath API ---------------*/
+#define OCI_ATTR_DIRPATH_RESERVED_7         326                 /* reserved */
+#define OCI_ATTR_DIRPATH_RESERVED_8         327                 /* reserved */
+#define OCI_ATTR_DIRPATH_CONVERT            328 /* stream conversion needed? */
+#define OCI_ATTR_DIRPATH_BADROW             329        /* info about bad row */
+#define OCI_ATTR_DIRPATH_BADROW_LENGTH      330    /* length of bad row info */
+#define OCI_ATTR_DIRPATH_WRITE_ORDER        331         /* column fill order */
+#define OCI_ATTR_DIRPATH_GRANULE_SIZE       332   /* granule size for unload */
+#define OCI_ATTR_DIRPATH_GRANULE_OFFSET     333    /* offset to last granule */
+#define OCI_ATTR_DIRPATH_RESERVED_1         334                  /* reserved */
+#define OCI_ATTR_DIRPATH_RESERVED_2         335                  /* reserved */
+
+/*------------- Attributes for 10i Distributed Objects ----------------------*/
+#define OCI_ATTR_OBJ_SUBS                   336 /* obj col/tab substitutable */
+
+/*------ Attributes for 10i DirPathAPI conversion (NLS lang, terr, cs) ------*/
+#define OCI_ATTR_DIRPATH_RESERVED_3         337                  /* reserved */
+#define OCI_ATTR_DIRPATH_RESERVED_4         338                  /* reserved */
+
+
+/*---------- Attributes for 10i XADFIELD (NLS language, territory -----------*/
+#define OCI_ATTR_XADFIELD_RESERVED_1        339                  /* reserved */
+#define OCI_ATTR_XADFIELD_RESERVED_2        340                  /* reserved */
+/*------------- Kerberos Secure Client Identifier ---------------------------*/
+#define OCI_ATTR_KERBEROS_CID               341 /* Kerberos db service ticket*/
+
+
+/*------------------------ Attributes for Rules objects ---------------------*/
+#define OCI_ATTR_CONDITION                  342            /* rule condition */
+#define OCI_ATTR_COMMENT                    343                   /* comment */
+#define OCI_ATTR_VALUE                      344             /* Anydata value */
+#define OCI_ATTR_EVAL_CONTEXT_OWNER         345        /* eval context owner */
+#define OCI_ATTR_EVAL_CONTEXT_NAME          346         /* eval context name */
+#define OCI_ATTR_EVALUATION_FUNCTION        347        /* eval function name */
+#define OCI_ATTR_VAR_TYPE                   348             /* variable type */
+#define OCI_ATTR_VAR_VALUE_FUNCTION         349   /* variable value function */
+#define OCI_ATTR_VAR_METHOD_FUNCTION        350  /* variable method function */
+#define OCI_ATTR_ACTION_CONTEXT             351            /* action context */
+#define OCI_ATTR_LIST_TABLE_ALIASES         352     /* list of table aliases */
+#define OCI_ATTR_LIST_VARIABLE_TYPES        353    /* list of variable types */
+#define OCI_ATTR_TABLE_NAME                 356                /* table name */
+
+#define OCI_ATTR_DIRPATH_RESERVED_5         357                  /* reserved */
+#define OCI_ATTR_DIRPATH_RESERVED_6         358                  /* reserved */
+
+#define OCI_ATTR_DIRPATH_LOCK_WAIT          359    /* wait for lock in dpapi */
+
+#define OCI_ATTR_MESSAGE_CSCN               360              /* message cscn */
+#define OCI_ATTR_MESSAGE_DSCN               361              /* message dscn */
+
+/*--------------------- Audit Session ID ------------------------------------*/
+#define OCI_ATTR_AUDIT_SESSION_ID           362          /* Audit session ID */
+
+/*--------------------- Kerberos TGT Keys -----------------------------------*/
+#define OCI_ATTR_KERBEROS_KEY               363  /* n-tier Kerberos cred key */
+#define OCI_ATTR_KERBEROS_CID_KEY           364    /* SCID Kerberos cred key */
+
+
+#define OCI_ATTR_TRANSACTION_NO             365         /* AQ enq txn number */
+
+/*----------------------- Attributes for End To End Tracing -----------------*/
+#define OCI_ATTR_MODULE                     366        /* module for tracing */
+#define OCI_ATTR_ACTION                     367        /* action for tracing */
+#define OCI_ATTR_CLIENT_INFO                368               /* client info */
+#define OCI_ATTR_COLLECT_CALL_TIME          369         /* collect call time */
+#define OCI_ATTR_CALL_TIME                  370         /* extract call time */
+#define OCI_ATTR_ECONTEXT_ID                371      /* execution-id context */
+#define OCI_ATTR_ECONTEXT_SEQ               372  /*execution-id sequence num */
+
+
+/*---------------- Describe Handle Parameter Attribute Values ---------------*/
+
+/* OCI_ATTR_CURSOR_COMMIT_BEHAVIOR */
+#define OCI_CURSOR_OPEN   0 
+#define OCI_CURSOR_CLOSED 1
+
+/* OCI_ATTR_CATALOG_LOCATION */
+#define OCI_CL_START 0
+#define OCI_CL_END   1
+
+/* OCI_ATTR_SAVEPOINT_SUPPORT */
+#define OCI_SP_SUPPORTED   0
+#define OCI_SP_UNSUPPORTED 1
+
+/* OCI_ATTR_NOWAIT_SUPPORT */
+#define OCI_NW_SUPPORTED   0
+#define OCI_NW_UNSUPPORTED 1
+
+/* OCI_ATTR_AUTOCOMMIT_DDL */
+#define OCI_AC_DDL    0
+#define OCI_NO_AC_DDL 1
+
+/* OCI_ATTR_LOCKING_MODE */
+#define OCI_LOCK_IMMEDIATE 0
+#define OCI_LOCK_DELAYED   1
+
+/* ------------------- Instance type attribute values -----------------------*/
+#define OCI_INSTANCE_TYPE_UNKNOWN  0
+#define OCI_INSTANCE_TYPE_RDBMS    1
+#define OCI_INSTANCE_TYPE_OSM      2
+
+/*---------------------------------------------------------------------------*/
+
+/*---------------------------OCIPasswordChange-------------------------------*/
+#define OCI_AUTH         0x08        /* Change the password but do not login */
+
+
+/*------------------------Other Constants------------------------------------*/
+#define OCI_MAX_FNS   100                     /* max number of OCI Functions */
+#define OCI_SQLSTATE_SIZE 5  
+#define OCI_ERROR_MAXMSG_SIZE   1024         /* max size of an error message */
+#define OCI_LOBMAXSIZE MINUB4MAXVAL                 /* maximum lob data size */
+#define OCI_ROWID_LEN             23 
+/*---------------------------------------------------------------------------*/
+
+/*------------------------ Fail Over Events ---------------------------------*/
+#define OCI_FO_END          0x00000001
+#define OCI_FO_ABORT        0x00000002   
+#define OCI_FO_REAUTH       0x00000004
+#define OCI_FO_BEGIN        0x00000008 
+#define OCI_FO_ERROR        0x00000010
+/*---------------------------------------------------------------------------*/
+
+/*------------------------ Fail Over Callback Return Codes ------------------*/
+#define OCI_FO_RETRY        25410
+/*---------------------------------------------------------------------------*/
+
+/*------------------------- Fail Over Types ---------------------------------*/
+#define OCI_FO_NONE           0x00000001
+#define OCI_FO_SESSION        0x00000002
+#define OCI_FO_SELECT         0x00000004
+#define OCI_FO_TXNAL          0x00000008
+/*---------------------------------------------------------------------------*/
+
+/*-----------------------Function Codes--------------------------------------*/
+#define OCI_FNCODE_INITIALIZE     1                         /* OCIInitialize */
+#define OCI_FNCODE_HANDLEALLOC  2                          /* OCIHandleAlloc */
+#define OCI_FNCODE_HANDLEFREE  3                            /* OCIHandleFree */
+#define OCI_FNCODE_DESCRIPTORALLOC  4                  /* OCIDescriptorAlloc */
+#define OCI_FNCODE_DESCRIPTORFREE  5                    /* OCIDescriptorFree */
+#define OCI_FNCODE_ENVINIT   6                                 /* OCIEnvInit */
+#define OCI_FNCODE_SERVERATTACH   7                       /* OCIServerAttach */
+#define OCI_FNCODE_SERVERDETACH   8                       /* OCIServerDetach */
+/* unused         9 */ 
+#define OCI_FNCODE_SESSIONBEGIN  10                       /* OCISessionBegin */
+#define OCI_FNCODE_SESSIONEND   11                          /* OCISessionEnd */
+#define OCI_FNCODE_PASSWORDCHANGE   12                  /* OCIPasswordChange */
+#define OCI_FNCODE_STMTPREPARE   13                        /* OCIStmtPrepare */
+                                                      /* unused       14- 16 */
+#define OCI_FNCODE_BINDDYNAMIC   17                        /* OCIBindDynamic */
+#define OCI_FNCODE_BINDOBJECT  18                           /* OCIBindObject */
+                                                                /* 19 unused */
+#define OCI_FNCODE_BINDARRAYOFSTRUCT   20            /* OCIBindArrayOfStruct */
+#define OCI_FNCODE_STMTEXECUTE  21                         /* OCIStmtExecute */
+                                                             /* unused 22-24 */
+#define OCI_FNCODE_DEFINEOBJECT  25                       /* OCIDefineObject */
+#define OCI_FNCODE_DEFINEDYNAMIC   26                    /* OCIDefineDynamic */
+#define OCI_FNCODE_DEFINEARRAYOFSTRUCT  27         /* OCIDefineArrayOfStruct */
+#define OCI_FNCODE_STMTFETCH   28                            /* OCIStmtFetch */
+#define OCI_FNCODE_STMTGETBIND   29                    /* OCIStmtGetBindInfo */
+                                                            /* 30, 31 unused */
+#define OCI_FNCODE_DESCRIBEANY  32                         /* OCIDescribeAny */
+#define OCI_FNCODE_TRANSSTART  33                           /* OCITransStart */
+#define OCI_FNCODE_TRANSDETACH  34                         /* OCITransDetach */
+#define OCI_FNCODE_TRANSCOMMIT  35                         /* OCITransCommit */
+                                                                /* 36 unused */
+#define OCI_FNCODE_ERRORGET   37                              /* OCIErrorGet */
+#define OCI_FNCODE_LOBOPENFILE  38                         /* OCILobFileOpen */
+#define OCI_FNCODE_LOBCLOSEFILE  39                       /* OCILobFileClose */
+                                             /* 40 was LOBCREATEFILE, unused */
+                                         /* 41 was OCILobFileDelete, unused  */
+#define OCI_FNCODE_LOBCOPY  42                                 /* OCILobCopy */
+#define OCI_FNCODE_LOBAPPEND  43                             /* OCILobAppend */
+#define OCI_FNCODE_LOBERASE  44                               /* OCILobErase */
+#define OCI_FNCODE_LOBLENGTH  45                          /* OCILobGetLength */
+#define OCI_FNCODE_LOBTRIM  46                                 /* OCILobTrim */
+#define OCI_FNCODE_LOBREAD  47                                 /* OCILobRead */
+#define OCI_FNCODE_LOBWRITE  48                               /* OCILobWrite */
+                                                                /* 49 unused */
+#define OCI_FNCODE_SVCCTXBREAK 50                                /* OCIBreak */
+#define OCI_FNCODE_SERVERVERSION  51                     /* OCIServerVersion */
+
+#define OCI_FNCODE_KERBATTRSET 52                          /* OCIKerbAttrSet */
+
+/* unused 53 */
+
+#define OCI_FNCODE_ATTRGET 54                                  /* OCIAttrGet */
+#define OCI_FNCODE_ATTRSET 55                                  /* OCIAttrSet */
+#define OCI_FNCODE_PARAMSET 56                                /* OCIParamSet */
+#define OCI_FNCODE_PARAMGET 57                                /* OCIParamGet */
+#define OCI_FNCODE_STMTGETPIECEINFO   58              /* OCIStmtGetPieceInfo */
+#define OCI_FNCODE_LDATOSVCCTX 59                          /* OCILdaToSvcCtx */
+                                                                /* 60 unused */
+#define OCI_FNCODE_STMTSETPIECEINFO   61              /* OCIStmtSetPieceInfo */
+#define OCI_FNCODE_TRANSFORGET 62                          /* OCITransForget */
+#define OCI_FNCODE_TRANSPREPARE 63                        /* OCITransPrepare */
+#define OCI_FNCODE_TRANSROLLBACK  64                     /* OCITransRollback */
+#define OCI_FNCODE_DEFINEBYPOS 65                          /* OCIDefineByPos */
+#define OCI_FNCODE_BINDBYPOS 66                              /* OCIBindByPos */
+#define OCI_FNCODE_BINDBYNAME 67                            /* OCIBindByName */
+#define OCI_FNCODE_LOBASSIGN  68                             /* OCILobAssign */
+#define OCI_FNCODE_LOBISEQUAL  69                           /* OCILobIsEqual */
+#define OCI_FNCODE_LOBISINIT  70                      /* OCILobLocatorIsInit */
+
+#define OCI_FNCODE_LOBENABLEBUFFERING  71           /* OCILobEnableBuffering */
+#define OCI_FNCODE_LOBCHARSETID  72                       /* OCILobCharSetID */
+#define OCI_FNCODE_LOBCHARSETFORM  73                   /* OCILobCharSetForm */
+#define OCI_FNCODE_LOBFILESETNAME  74                   /* OCILobFileSetName */
+#define OCI_FNCODE_LOBFILEGETNAME  75                   /* OCILobFileGetName */
+#define OCI_FNCODE_LOGON 76                                      /* OCILogon */
+#define OCI_FNCODE_LOGOFF 77                                    /* OCILogoff */
+#define OCI_FNCODE_LOBDISABLEBUFFERING 78          /* OCILobDisableBuffering */
+#define OCI_FNCODE_LOBFLUSHBUFFER 79                    /* OCILobFlushBuffer */
+#define OCI_FNCODE_LOBLOADFROMFILE 80                  /* OCILobLoadFromFile */
+
+#define OCI_FNCODE_LOBOPEN  81                                 /* OCILobOpen */
+#define OCI_FNCODE_LOBCLOSE  82                               /* OCILobClose */
+#define OCI_FNCODE_LOBISOPEN  83                             /* OCILobIsOpen */
+#define OCI_FNCODE_LOBFILEISOPEN  84                     /* OCILobFileIsOpen */
+#define OCI_FNCODE_LOBFILEEXISTS  85                     /* OCILobFileExists */
+#define OCI_FNCODE_LOBFILECLOSEALL  86                 /* OCILobFileCloseAll */
+#define OCI_FNCODE_LOBCREATETEMP  87                /* OCILobCreateTemporary */
+#define OCI_FNCODE_LOBFREETEMP  88                    /* OCILobFreeTemporary */
+#define OCI_FNCODE_LOBISTEMP  89                        /* OCILobIsTemporary */
+
+#define OCI_FNCODE_AQENQ  90                                     /* OCIAQEnq */
+#define OCI_FNCODE_AQDEQ  91                                     /* OCIAQDeq */
+#define OCI_FNCODE_RESET  92                                     /* OCIReset */
+#define OCI_FNCODE_SVCCTXTOLDA  93                         /* OCISvcCtxToLda */
+#define OCI_FNCODE_LOBLOCATORASSIGN 94                /* OCILobLocatorAssign */
+
+#define OCI_FNCODE_UBINDBYNAME 95
+
+#define OCI_FNCODE_AQLISTEN  96                               /* OCIAQListen */
+
+#define OCI_FNCODE_SVC2HST 97                                    /* reserved */
+#define OCI_FNCODE_SVCRH   98                                    /* reserved */
+                           /* 97 and 98 are reserved for Oracle internal use */
+
+#define OCI_FNCODE_TRANSMULTIPREPARE   99            /* OCITransMultiPrepare */
+
+#define OCI_FNCODE_CPOOLCREATE  100               /* OCIConnectionPoolCreate */
+#define OCI_FNCODE_CPOOLDESTROY 101              /* OCIConnectionPoolDestroy */
+#define OCI_FNCODE_LOGON2 102                                   /* OCILogon2 */
+#define OCI_FNCODE_ROWIDTOCHAR  103                        /* OCIRowidToChar */
+
+#define OCI_FNCODE_SPOOLCREATE  104                  /* OCISessionPoolCreate */
+#define OCI_FNCODE_SPOOLDESTROY 105                 /* OCISessionPoolDestroy */
+#define OCI_FNCODE_SESSIONGET   106                         /* OCISessionGet */
+#define OCI_FNCODE_SESSIONRELEASE 107                   /* OCISessionRelease */
+#define OCI_FNCODE_STMTPREPARE2 108                       /* OCIStmtPrepare2 */
+#define OCI_FNCODE_STMTRELEASE 109                         /* OCIStmtRelease */
+#define OCI_FNCODE_AQENQARRAY  110                          /* OCIAQEnqArray */
+#define OCI_FNCODE_AQDEQARRAY  111                          /* OCIAQDeqArray */
+#define OCI_FNCODE_LOBCOPY2    112                            /* OCILobCopy2 */
+#define OCI_FNCODE_LOBERASE2   113                           /* OCILobErase2 */
+#define OCI_FNCODE_LOBLENGTH2  114                       /* OCILobGetLength2 */
+#define OCI_FNCODE_LOBLOADFROMFILE2  115              /* OCILobLoadFromFile2 */
+#define OCI_FNCODE_LOBREAD2    116                            /* OCILobRead2 */
+#define OCI_FNCODE_LOBTRIM2    117                            /* OCILobTrim2 */
+#define OCI_FNCODE_LOBWRITE2   118                           /* OCILobWrite2 */
+#define OCI_FNCODE_LOBGETSTORAGELIMIT 119           /* OCILobGetStorageLimit */
+
+#define OCI_FNCODE_MAXFCN 119                   /* maximum OCI function code */
+
+
+/*---------------------------------------------------------------------------*/
+
+/*-----------------------Handle Definitions----------------------------------*/
+typedef struct OCIEnv           OCIEnv;            /* OCI environment handle */
+typedef struct OCIError         OCIError;                /* OCI error handle */
+typedef struct OCISvcCtx        OCISvcCtx;             /* OCI service handle */
+typedef struct OCIStmt          OCIStmt;             /* OCI statement handle */
+typedef struct OCIBind          OCIBind;                  /* OCI bind handle */
+typedef struct OCIDefine        OCIDefine;              /* OCI Define handle */
+typedef struct OCIDescribe      OCIDescribe;          /* OCI Describe handle */
+typedef struct OCIServer        OCIServer;              /* OCI Server handle */
+typedef struct OCISession       OCISession;     /* OCI Authentication handle */
+typedef struct OCIComplexObject OCIComplexObject;          /* OCI COR handle */
+typedef struct OCITrans         OCITrans;          /* OCI Transaction handle */
+typedef struct OCISecurity      OCISecurity;          /* OCI Security handle */
+typedef struct OCISubscription  OCISubscription;      /* subscription handle */
+
+typedef struct OCICPool         OCICPool;          /* connection pool handle */
+typedef struct OCISPool         OCISPool;             /* session pool handle */
+typedef struct OCIAuthInfo      OCIAuthInfo;                  /* auth handle */
+
+/*-----------------------Descriptor Definitions------------------------------*/
+typedef struct OCISnapshot      OCISnapshot;      /* OCI snapshot descriptor */
+typedef struct OCIResult        OCIResult;      /* OCI Result Set Descriptor */
+typedef struct OCILobLocator    OCILobLocator; /* OCI Lob Locator descriptor */
+typedef struct OCIParam         OCIParam;        /* OCI PARameter descriptor */
+typedef struct OCIComplexObjectComp OCIComplexObjectComp;
+                                                       /* OCI COR descriptor */
+typedef struct OCIRowid OCIRowid;                    /* OCI ROWID descriptor */
+
+typedef struct OCIDateTime OCIDateTime;           /* OCI DateTime descriptor */
+typedef struct OCIInterval OCIInterval;           /* OCI Interval descriptor */
+
+typedef struct OCIUcb           OCIUcb;      /* OCI User Callback descriptor */
+typedef struct OCIServerDNs     OCIServerDNs;    /* OCI server DN descriptor */
+
+/*-------------------------- AQ Descriptors ---------------------------------*/
+typedef struct OCIAQEnqOptions    OCIAQEnqOptions; /* AQ Enqueue Options hdl */
+typedef struct OCIAQDeqOptions    OCIAQDeqOptions; /* AQ Dequeue Options hdl */
+typedef struct OCIAQMsgProperties OCIAQMsgProperties;  /* AQ Mesg Properties */
+typedef struct OCIAQAgent         OCIAQAgent;         /* AQ Agent descriptor */
+typedef struct OCIAQNfyDescriptor OCIAQNfyDescriptor;   /* AQ Nfy descriptor */
+typedef struct OCIAQSignature     OCIAQSignature;            /* AQ Siganture */
+/*---------------------------------------------------------------------------*/
+ 
+/* Lob typedefs for Pro*C */
+typedef struct OCILobLocator OCIClobLocator;    /* OCI Character LOB Locator */
+typedef struct OCILobLocator OCIBlobLocator;       /* OCI Binary LOB Locator */
+typedef struct OCILobLocator OCIBFileLocator; /* OCI Binary LOB File Locator */
+/*---------------------------------------------------------------------------*/
+
+/* Undefined value for tz in interval types*/
+#define OCI_INTHR_UNK 24
+
+  /* These defined adjustment values */
+#define OCI_ADJUST_UNK            10
+#define OCI_ORACLE_DATE           0
+#define OCI_ANSI_DATE             1
+
+/*------------------------ Lob-specific Definitions -------------------------*/
+
+/*
+ * ociloff - OCI Lob OFFset
+ *
+ * The offset in the lob data.  The offset is specified in terms of bytes for
+ * BLOBs and BFILes.  Character offsets are used for CLOBs, NCLOBs.
+ * The maximum size of internal lob data is 4 gigabytes.  FILE LOB 
+ * size is limited by the operating system.
+ */
+typedef ub4 OCILobOffset;
+
+/*
+ * ocillen - OCI Lob LENgth (of lob data)
+ *
+ * Specifies the length of lob data in bytes for BLOBs and BFILes and in 
+ * characters for CLOBs, NCLOBs.  The maximum length of internal lob
+ * data is 4 gigabytes.  The length of FILE LOBs is limited only by the
+ * operating system.
+ */
+typedef ub4 OCILobLength;
+/*
+ * ocilmo - OCI Lob open MOdes
+ *
+ * The mode specifies the planned operations that will be performed on the
+ * FILE lob data.  The FILE lob can be opened in read-only mode only.
+ * 
+ * In the future, we may include read/write, append and truncate modes.  Append
+ * is equivalent to read/write mode except that the FILE is positioned for
+ * writing to the end.  Truncate is equivalent to read/write mode except that
+ * the FILE LOB data is first truncated to a length of 0 before use.
+ */
+enum OCILobMode
+{
+  OCI_LOBMODE_READONLY = 1,                                     /* read-only */
+  OCI_LOBMODE_READWRITE = 2             /* read_write for internal lobs only */
+};
+typedef enum OCILobMode OCILobMode;
+
+/*---------------------------------------------------------------------------*/
+
+
+/*----------------------------Piece Definitions------------------------------*/
+
+/* if ocidef.h is being included in the app, ocidef.h should precede oci.h */
+
+/* 
+ * since clients may  use oci.h, ocidef.h and ocidfn.h the following defines
+ * need to be guarded, usually internal clients
+ */
+
+#ifndef OCI_FLAGS
+#define OCI_FLAGS
+#define OCI_ONE_PIECE 0                                         /* one piece */
+#define OCI_FIRST_PIECE 1                                 /* the first piece */
+#define OCI_NEXT_PIECE 2                          /* the next of many pieces */
+#define OCI_LAST_PIECE 3                                   /* the last piece */
+#endif
+/*---------------------------------------------------------------------------*/
+
+/*--------------------------- FILE open modes -------------------------------*/
+#define OCI_FILE_READONLY 1             /* readonly mode open for FILE types */
+/*---------------------------------------------------------------------------*/
+/*--------------------------- LOB open modes --------------------------------*/
+#define OCI_LOB_READONLY 1              /* readonly mode open for ILOB types */
+#define OCI_LOB_READWRITE 2                /* read write mode open for ILOBs */
+
+/*----------------------- LOB Buffering Flush Flags -------------------------*/
+#define OCI_LOB_BUFFER_FREE   1 
+#define OCI_LOB_BUFFER_NOFREE 2
+/*---------------------------------------------------------------------------*/
+
+/*--------------------------- OCI Statement Types ---------------------------*/
+
+#define  OCI_STMT_SELECT  1                              /* select statement */
+#define  OCI_STMT_UPDATE  2                              /* update statement */
+#define  OCI_STMT_DELETE  3                              /* delete statement */
+#define  OCI_STMT_INSERT  4                              /* Insert Statement */
+#define  OCI_STMT_CREATE  5                              /* create statement */
+#define  OCI_STMT_DROP    6                                /* drop statement */
+#define  OCI_STMT_ALTER   7                               /* alter statement */
+#define  OCI_STMT_BEGIN   8                   /* begin ... (pl/sql statement)*/
+#define  OCI_STMT_DECLARE 9                /* declare .. (pl/sql statement ) */
+/*---------------------------------------------------------------------------*/
+
+/*--------------------------- OCI Parameter Types ---------------------------*/
+#define OCI_PTYPE_UNK                 0                         /* unknown   */
+#define OCI_PTYPE_TABLE               1                         /* table     */
+#define OCI_PTYPE_VIEW                2                         /* view      */
+#define OCI_PTYPE_PROC                3                         /* procedure */
+#define OCI_PTYPE_FUNC                4                         /* function  */
+#define OCI_PTYPE_PKG                 5                         /* package   */
+#define OCI_PTYPE_TYPE                6                 /* user-defined type */
+#define OCI_PTYPE_SYN                 7                         /* synonym   */
+#define OCI_PTYPE_SEQ                 8                         /* sequence  */
+#define OCI_PTYPE_COL                 9                         /* column    */
+#define OCI_PTYPE_ARG                 10                        /* argument  */
+#define OCI_PTYPE_LIST                11                        /* list      */
+#define OCI_PTYPE_TYPE_ATTR           12    /* user-defined type's attribute */
+#define OCI_PTYPE_TYPE_COLL           13        /* collection type's element */
+#define OCI_PTYPE_TYPE_METHOD         14       /* user-defined type's method */
+#define OCI_PTYPE_TYPE_ARG            15   /* user-defined type method's arg */
+#define OCI_PTYPE_TYPE_RESULT         16/* user-defined type method's result */
+#define OCI_PTYPE_SCHEMA              17                           /* schema */
+#define OCI_PTYPE_DATABASE            18                         /* database */
+#define OCI_PTYPE_RULE                19                             /* rule */
+#define OCI_PTYPE_RULE_SET            20                         /* rule set */
+#define OCI_PTYPE_EVALUATION_CONTEXT  21               /* evaluation context */
+#define OCI_PTYPE_TABLE_ALIAS         22                      /* table alias */
+#define OCI_PTYPE_VARIABLE_TYPE       23                    /* variable type */
+#define OCI_PTYPE_NAME_VALUE          24                  /* name value pair */
+
+/*---------------------------------------------------------------------------*/
+
+/*----------------------------- OCI List Types ------------------------------*/
+#define OCI_LTYPE_UNK           0                               /* unknown   */
+#define OCI_LTYPE_COLUMN        1                             /* column list */
+#define OCI_LTYPE_ARG_PROC      2                 /* procedure argument list */
+#define OCI_LTYPE_ARG_FUNC      3                  /* function argument list */
+#define OCI_LTYPE_SUBPRG        4                         /* subprogram list */
+#define OCI_LTYPE_TYPE_ATTR     5                          /* type attribute */
+#define OCI_LTYPE_TYPE_METHOD   6                             /* type method */
+#define OCI_LTYPE_TYPE_ARG_PROC 7    /* type method w/o result argument list */
+#define OCI_LTYPE_TYPE_ARG_FUNC 8      /* type method w/result argument list */
+#define OCI_LTYPE_SCH_OBJ       9                      /* schema object list */
+#define OCI_LTYPE_DB_SCH        10                   /* database schema list */
+#define OCI_LTYPE_TYPE_SUBTYPE  11                           /* subtype list */
+#define OCI_LTYPE_TABLE_ALIAS   12                       /* table alias list */
+#define OCI_LTYPE_VARIABLE_TYPE 13                     /* variable type list */
+#define OCI_LTYPE_NAME_VALUE    14                        /* name value list */
+
+/*---------------------------------------------------------------------------*/
+
+/*-------------------------- Memory Cartridge Services ---------------------*/
+#define OCI_MEMORY_CLEARED  1
+
+/*-------------------------- Pickler Cartridge Services ---------------------*/
+typedef struct OCIPicklerTdsCtx OCIPicklerTdsCtx;
+typedef struct OCIPicklerTds OCIPicklerTds;
+typedef struct OCIPicklerImage OCIPicklerImage;
+typedef struct OCIPicklerFdo OCIPicklerFdo;
+typedef ub4 OCIPicklerTdsElement;
+
+typedef struct OCIAnyData OCIAnyData;
+
+typedef struct OCIAnyDataSet OCIAnyDataSet;
+typedef struct OCIAnyDataCtx OCIAnyDataCtx;
+
+/*---------------------------------------------------------------------------*/
+
+/*--------------------------- User Callback Constants -----------------------*/
+#define OCI_UCBTYPE_ENTRY       1                          /* entry callback */
+#define OCI_UCBTYPE_EXIT        2                           /* exit callback */
+#define OCI_UCBTYPE_REPLACE     3                    /* replacement callback */
+
+/*---------------------------------------------------------------------------*/
+
+/*--------------------- NLS service type and constance ----------------------*/
+#define OCI_NLS_DAYNAME1      1                    /* Native name for Monday */
+#define OCI_NLS_DAYNAME2      2                   /* Native name for Tuesday */
+#define OCI_NLS_DAYNAME3      3                 /* Native name for Wednesday */
+#define OCI_NLS_DAYNAME4      4                  /* Native name for Thursday */
+#define OCI_NLS_DAYNAME5      5                    /* Native name for Friday */
+#define OCI_NLS_DAYNAME6      6              /* Native name for for Saturday */
+#define OCI_NLS_DAYNAME7      7                /* Native name for for Sunday */
+#define OCI_NLS_ABDAYNAME1    8        /* Native abbreviated name for Monday */
+#define OCI_NLS_ABDAYNAME2    9       /* Native abbreviated name for Tuesday */
+#define OCI_NLS_ABDAYNAME3    10    /* Native abbreviated name for Wednesday */
+#define OCI_NLS_ABDAYNAME4    11     /* Native abbreviated name for Thursday */
+#define OCI_NLS_ABDAYNAME5    12       /* Native abbreviated name for Friday */
+#define OCI_NLS_ABDAYNAME6    13 /* Native abbreviated name for for Saturday */
+#define OCI_NLS_ABDAYNAME7    14   /* Native abbreviated name for for Sunday */
+#define OCI_NLS_MONTHNAME1    15                  /* Native name for January */
+#define OCI_NLS_MONTHNAME2    16                 /* Native name for February */
+#define OCI_NLS_MONTHNAME3    17                    /* Native name for March */
+#define OCI_NLS_MONTHNAME4    18                    /* Native name for April */
+#define OCI_NLS_MONTHNAME5    19                      /* Native name for May */
+#define OCI_NLS_MONTHNAME6    20                     /* Native name for June */
+#define OCI_NLS_MONTHNAME7    21                     /* Native name for July */
+#define OCI_NLS_MONTHNAME8    22                   /* Native name for August */
+#define OCI_NLS_MONTHNAME9    23                /* Native name for September */
+#define OCI_NLS_MONTHNAME10   24                  /* Native name for October */
+#define OCI_NLS_MONTHNAME11   25                 /* Native name for November */
+#define OCI_NLS_MONTHNAME12   26                 /* Native name for December */
+#define OCI_NLS_ABMONTHNAME1  27      /* Native abbreviated name for January */
+#define OCI_NLS_ABMONTHNAME2  28     /* Native abbreviated name for February */
+#define OCI_NLS_ABMONTHNAME3  29        /* Native abbreviated name for March */
+#define OCI_NLS_ABMONTHNAME4  30        /* Native abbreviated name for April */
+#define OCI_NLS_ABMONTHNAME5  31          /* Native abbreviated name for May */
+#define OCI_NLS_ABMONTHNAME6  32         /* Native abbreviated name for June */
+#define OCI_NLS_ABMONTHNAME7  33         /* Native abbreviated name for July */
+#define OCI_NLS_ABMONTHNAME8  34       /* Native abbreviated name for August */
+#define OCI_NLS_ABMONTHNAME9  35    /* Native abbreviated name for September */
+#define OCI_NLS_ABMONTHNAME10 36      /* Native abbreviated name for October */
+#define OCI_NLS_ABMONTHNAME11 37     /* Native abbreviated name for November */
+#define OCI_NLS_ABMONTHNAME12 38     /* Native abbreviated name for December */
+#define OCI_NLS_YES           39   /* Native string for affirmative response */
+#define OCI_NLS_NO            40                 /* Native negative response */
+#define OCI_NLS_AM            41           /* Native equivalent string of AM */
+#define OCI_NLS_PM            42           /* Native equivalent string of PM */
+#define OCI_NLS_AD            43           /* Native equivalent string of AD */
+#define OCI_NLS_BC            44           /* Native equivalent string of BC */
+#define OCI_NLS_DECIMAL       45                        /* decimal character */
+#define OCI_NLS_GROUP         46                          /* group separator */
+#define OCI_NLS_DEBIT         47                   /* Native symbol of debit */
+#define OCI_NLS_CREDIT        48                  /* Native sumbol of credit */
+#define OCI_NLS_DATEFORMAT    49                       /* Oracle date format */
+#define OCI_NLS_INT_CURRENCY  50            /* International currency symbol */
+#define OCI_NLS_LOC_CURRENCY  51                   /* Locale currency symbol */
+#define OCI_NLS_LANGUAGE      52                            /* Language name */
+#define OCI_NLS_ABLANGUAGE    53           /* Abbreviation for language name */
+#define OCI_NLS_TERRITORY     54                           /* Territory name */
+#define OCI_NLS_CHARACTER_SET 55                       /* Character set name */
+#define OCI_NLS_LINGUISTIC_NAME    56                     /* Linguistic name */
+#define OCI_NLS_CALENDAR      57                            /* Calendar name */
+#define OCI_NLS_DUAL_CURRENCY 78                     /* Dual currency symbol */
+#define OCI_NLS_WRITINGDIR    79               /* Language writing direction */
+#define OCI_NLS_ABTERRITORY   80                   /* Territory Abbreviation */
+#define OCI_NLS_DDATEFORMAT   81               /* Oracle default date format */
+#define OCI_NLS_DTIMEFORMAT   82               /* Oracle default time format */
+#define OCI_NLS_SFDATEFORMAT  83       /* Local string formatted date format */
+#define OCI_NLS_SFTIMEFORMAT  84       /* Local string formatted time format */
+#define OCI_NLS_NUMGROUPING   85                   /* Number grouping fields */
+#define OCI_NLS_LISTSEP       86                           /* List separator */
+#define OCI_NLS_MONDECIMAL    87               /* Monetary decimal character */
+#define OCI_NLS_MONGROUP      88                 /* Monetary group separator */
+#define OCI_NLS_MONGROUPING   89                 /* Monetary grouping fields */
+#define OCI_NLS_INT_CURRENCYSEP 90       /* International currency separator */
+#define OCI_NLS_CHARSET_MAXBYTESZ 91     /* Maximum character byte size      */
+#define OCI_NLS_CHARSET_FIXEDWIDTH 92    /* Fixed-width charset byte size    */
+#define OCI_NLS_CHARSET_ID    93                         /* Character set id */
+#define OCI_NLS_NCHARSET_ID   94                        /* NCharacter set id */
+
+#define OCI_NLS_MAXBUFSZ   100 /* Max buffer size may need for OCINlsGetInfo */
+
+#define OCI_NLS_BINARY            0x1           /* for the binary comparison */
+#define OCI_NLS_LINGUISTIC        0x2           /* for linguistic comparison */
+#define OCI_NLS_CASE_INSENSITIVE  0x10    /* for case-insensitive comparison */
+
+#define OCI_NLS_UPPERCASE         0x20               /* convert to uppercase */
+#define OCI_NLS_LOWERCASE         0x40               /* convert to lowercase */
+
+#define OCI_NLS_CS_IANA_TO_ORA   0   /* Map charset name from IANA to Oracle */
+#define OCI_NLS_CS_ORA_TO_IANA   1   /* Map charset name from Oracle to IANA */
+#define OCI_NLS_LANG_ISO_TO_ORA  2   /* Map language name from ISO to Oracle */
+#define OCI_NLS_LANG_ORA_TO_ISO  3   /* Map language name from Oracle to ISO */
+#define OCI_NLS_TERR_ISO_TO_ORA  4   /* Map territory name from ISO to Oracle*/
+#define OCI_NLS_TERR_ORA_TO_ISO  5   /* Map territory name from Oracle to ISO*/
+#define OCI_NLS_TERR_ISO3_TO_ORA 6   /* Map territory name from 3-letter ISO */
+                                     /* abbreviation to Oracle               */
+#define OCI_NLS_TERR_ORA_TO_ISO3 7   /* Map territory name from Oracle to    */
+                                     /* 3-letter ISO abbreviation            */
+
+typedef struct OCIMsg  OCIMsg;
+typedef ub4            OCIWchar;
+
+#define OCI_XMLTYPE_CREATE_OCISTRING 1
+#define OCI_XMLTYPE_CREATE_CLOB      2
+#define OCI_XMLTYPE_CREATE_BLOB      3
+
+/*------------------------- Kerber Authentication Modes ---------------------*/
+#define OCI_KERBCRED_PROXY               1 /* Apply Kerberos Creds for Proxy */
+#define OCI_KERBCRED_CLIENT_IDENTIFIER   2/*Apply Creds for Secure Client ID */
+
+/*--------------------------------------------------------------------------- 
+                     PRIVATE TYPES AND CONSTANTS 
+  ---------------------------------------------------------------------------*/
+ 
+/* None */
+
+/*--------------------------------------------------------------------------- 
+                           PUBLIC FUNCTIONS 
+  ---------------------------------------------------------------------------*/
+
+/* see ociap.h or ocikp.h */
+ 
+/*--------------------------------------------------------------------------- 
+                          PRIVATE FUNCTIONS 
+  ---------------------------------------------------------------------------*/
+
+/* None */
+
+ 
+#endif                                              /* OCI_ORACLE */
+
+
+/* more includes */
+
+#ifndef OCI1_ORACLE
+#include <oci1.h>
+#endif
+
+#ifndef ORO_ORACLE
+#include <oro.h>
+#endif
+
+#ifndef ORI_ORACLE
+#include <ori.h>
+#endif
+
+#ifndef ORL_ORACLE
+#include <orl.h>
+#endif
+
+#ifndef ORT_ORACLE
+#include <ort.h>
+#endif
+
+#ifndef OCIEXTP_ORACLE
+#include <ociextp.h>
+#endif
+
+#include <ociapr.h>
+#include <ociap.h>
+
+#ifndef OCIXMLDB_ORACLE
+#include <ocixmldb.h>
+#endif
+
+#ifndef OCI8DP_ORACLE
+#include <oci8dp.h>         /* interface definitions for the direct path api */
+#endif
+
+#ifndef OCIEXTP_ORACLE
+#include <ociextp.h>
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
diff --git a/src/terralib/drivers/Oracle/OCI/include/oci1.h b/src/terralib/drivers/Oracle/OCI/include/oci1.h
new file mode 100644
index 0000000..7341caf
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/oci1.h
@@ -0,0 +1,183 @@
+/*
+ * $Header$
+ */
+
+/* Copyright (c) Oracle Corporation 1997, 1998. All Rights Reserved. */ 
+ 
+/* NOTE:  See 'header_template.doc' in the 'doc' dve under the 'forms' 
+      directory for the header file template that includes instructions. 
+*/
+ 
+/* 
+   NAME 
+     oci1.h - Cartridge Service definitions
+
+   DESCRIPTION 
+     <short description of component this file declares/defines> 
+
+   RELATED DOCUMENTS 
+ 
+   INSPECTION STATUS 
+     Inspection date: 
+     Inspection status: 
+     Estimated increasing cost defects per page: 
+     Rule sets: 
+ 
+   ACCEPTANCE REVIEW STATUS 
+     Review date: 
+     Review status: 
+     Reviewers: 
+ 
+   PUBLIC FUNCTION(S) 
+     <list of external functions declared/defined - with one-line descriptions>
+
+   PRIVATE FUNCTION(S)
+     <list of static functions defined in .c file - with one-line descriptions>
+
+   EXAMPLES
+
+   NOTES
+     <other useful comments, qualifications, etc.>
+
+   MODIFIED   (MM/DD/YY)
+   nramakri    01/16/98 - remove #ifdef NEVER clause
+   ewaugh      12/18/97 - Turn type wrappers into functions.
+   skabraha    12/02/97 - Adding data structures & constants for OCIFile
+   rhwu        12/02/97 - OCI Thread
+   nramakri    12/15/97 - move to core4
+   ewaugh      12/11/97 - add OCIFormat package constants
+   ssamu       12/10/97 - do not include s.h
+   nramakri    11/19/97 - add OCIExtract definitions
+   ssamu       11/14/97 - creation
+
+*/
+
+
+#ifndef OCI1_ORACLE
+# define OCI1_ORACLE
+
+# ifndef ORATYPES
+#  include <oratypes.h>
+# endif
+
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+/* Constants required by the OCIFormat package. */
+
+#define OCIFormatUb1(variable)      OCIFormatTUb1(),      &(variable)
+#define OCIFormatUb2(variable)      OCIFormatTUb2(),      &(variable)
+#define OCIFormatUb4(variable)      OCIFormatTUb4(),      &(variable)
+#define OCIFormatUword(variable)    OCIFormatTUword(),    &(variable)
+#define OCIFormatUbig_ora(variable) OCIFormatTUbig_ora(), &(variable)
+#define OCIFormatSb1(variable)      OCIFormatTSb1(),      &(variable)
+#define OCIFormatSb2(variable)      OCIFormatTSb2(),      &(variable)
+#define OCIFormatSb4(variable)      OCIFormatTSb4(),      &(variable)
+#define OCIFormatSword(variable)    OCIFormatTSword(),    &(variable)
+#define OCIFormatSbig_ora(variable) OCIFormatTSbig_ora(), &(variable)
+#define OCIFormatEb1(variable)      OCIFormatTEb1(),      &(variable)
+#define OCIFormatEb2(variable)      OCIFormatTEb2(),      &(variable)
+#define OCIFormatEb4(variable)      OCIFormatTEb4(),      &(variable)
+#define OCIFormatEword(variable)    OCIFormatTEword(),    &(variable)
+#define OCIFormatChar(variable)     OCIFormatTChar(),     &(variable)
+#define OCIFormatText(variable)     OCIFormatTText(),      (variable)
+#define OCIFormatDouble(variable)   OCIFormatTDouble(),   &(variable)
+#define OCIFormatDvoid(variable)    OCIFormatTDvoid(),     (variable)
+#define OCIFormatEnd                OCIFormatTEnd()
+
+#define OCIFormatDP 6
+
+
+/*----------------- Public Constants for OCIFile -------------------------*/
+
+/* flags for open.*/
+/* flags for mode */
+#define OCI_FILE_READ_ONLY         1   /* open for read only */
+#define OCI_FILE_WRITE_ONLY        2   /* open for write only */
+#define OCI_FILE_READ_WRITE        3   /* open for read & write */
+/* flags for create */
+#define OCI_FILE_EXIST             0   /* the file should exist */
+#define OCI_FILE_CREATE            1   /* create if the file doesn't exist */
+#define OCI_FILE_EXCL              2   /* the file should not exist */
+#define OCI_FILE_TRUNCATE          4   /* create if the file doesn't exist, 
+                                          else truncate file the file to 0 */
+#define OCI_FILE_APPEND            8   /* open the file in append mode */
+
+/* flags for seek */
+#define OCI_FILE_SEEK_BEGINNING    1  /* seek from the beginning of the file */
+#define OCI_FILE_SEEK_CURRENT      2  /* seek from the current position */
+#define OCI_FILE_SEEK_END          3  /* seek from the end of the file */
+
+#define OCI_FILE_FORWARD     1     /* seek forward		*/
+#define OCI_FILE_BACKWARD    2     /* seek backward		*/
+
+/* file type */
+#define   OCI_FILE_BIN      0    /* binary file */
+#define   OCI_FILE_TEXT     1    /* text file */
+#define   OCI_FILE_STDIN    2    /* standard i/p */
+#define   OCI_FILE_STDOUT   3    /* standard o/p */
+#define   OCI_FILE_STDERR   4    /* standard error */
+
+/* Represents an open file */
+typedef struct OCIFileObject OCIFileObject;
+
+
+/*--------------------- OCI Thread Object Definitions------------------------*/
+
+/* OCIThread Context */
+typedef struct OCIThreadContext OCIThreadContext;
+
+/* OCIThread Mutual Exclusion Lock */
+typedef struct OCIThreadMutex   OCIThreadMutex; 
+
+/* OCIThread Key for Thread-Specific Data */
+typedef struct OCIThreadKey     OCIThreadKey;  
+
+/* OCIThread Thread ID */
+typedef struct OCIThreadId      OCIThreadId;  
+
+/* OCIThread Thread Handle */
+typedef struct OCIThreadHandle  OCIThreadHandle;  
+
+
+/*-------------------- OCI Thread Callback Function Pointers ----------------*/
+
+/* OCIThread Key Destructor Function Type */
+typedef void (*OCIThreadKeyDestFunc)(/*_ dvoid * _*/);
+
+
+/* Flags passed into OCIExtractFromXXX routines to direct processing         */
+#define OCI_EXTRACT_CASE_SENSITIVE     0x1 /* matching is case sensitive     */
+#define OCI_EXTRACT_UNIQUE_ABBREVS     0x2 /* unique abbreviations for keys
+                                              are allowed                    */
+#define OCI_EXTRACT_APPEND_VALUES      0x4 /* if multiple values for a key
+                                              exist, this determines if the 
+                                              new value should be appended 
+                                              to (or replace) the current 
+                                              list of values                 */
+
+/* Constants passed into OCIExtractSetKey routine */
+#define OCI_EXTRACT_MULTIPLE           0x8 /* key can accept multiple values */
+#define OCI_EXTRACT_TYPE_BOOLEAN         1 /* key type is boolean            */
+#define OCI_EXTRACT_TYPE_STRING          2 /* key type is string             */
+#define OCI_EXTRACT_TYPE_INTEGER         3 /* key type is integer            */
+#define OCI_EXTRACT_TYPE_OCINUM          4 /* key type is ocinum             */
+
+/*---------------------------------------------------------------------------
+                     PRIVATE TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                           PUBLIC FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                          PRIVATE FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+#endif                                              /* OCI1_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/oci8dp.h b/src/terralib/drivers/Oracle/OCI/include/oci8dp.h
new file mode 100644
index 0000000..c698a56
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/oci8dp.h
@@ -0,0 +1,315 @@
+/*
+ * $Header$
+ */
+
+/* Copyright (c) 1998, 2003, Oracle Corporation.  All rights reserved.  */
+ 
+/* 
+   NAME 
+     oci8dp.h - OCI: Direct Path API interface prototypes.
+
+   DESCRIPTION 
+     Public types, constants, and interfaces to the direct path API.
+
+   RELATED DOCUMENTS 
+ 
+   NOTES
+     This file is not directly included by the application, this file
+     is included by "oci.h", which the application should include.
+
+   MODIFIED   (MM/DD/YY)
+   srseshad    03/12/03 - convert oci public api to ansi
+   msakayed    10/28/02 - Bug #2643907: add OCI_ATTR_DIRPATH_SKIPINDEX_METHOD
+   cmlim       04/13/01 - remove OCIDirPathStreamToStream - not used by dpapi
+   cmlim       04/02/01 - OCI_DIRPATH_EXPR_OPQ_SQL_FN to OCI_DIRPATH_EXPR_SQL
+   ebatbout    01/22/01 - PARTIAL value for OCIDirPathDataSave action parameter
+   cmlim       07/20/00 - support opaques/sql strings in 8.2 dpapi
+   cmlim       08/14/00 - support refs in 8.2 dpapi
+   cmlim       04/17/00 - add defines for OCIDirPathFuncCtx handle & OCI_ATTR_D
+   whe         09/01/99 - 976457:check __cplusplus for C++ code
+   abrumm      04/16/99 - dpapi: more attributes
+   abrumm      02/26/99 - add defines for DataSave action
+   abrumm      10/04/98 - clen must be a ub4
+   abrumm      05/27/98 - add column array flag values
+   abrumm      05/12/98 - direct path api support
+   abrumm      03/31/98 - OCI direct path interface support
+   abrumm      03/18/98 - Creation
+
+*/
+
+#ifndef OCI8DP_ORACLE
+# define OCI8DP_ORACLE
+
+#ifndef ORATYPES
+#include <oratypes.h>
+#endif
+
+#ifndef OCIDFN
+#include <ocidfn.h>
+#endif
+
+#ifndef OCI_ORACLE
+#include <oci.h>
+#endif
+
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+/*----- Handles and descriptors for direct path operations (OCIDirPath*) ----*/
+
+typedef struct OCIDirPathCtx      OCIDirPathCtx;                  /* context */
+typedef struct OCIDirPathFuncCtx  OCIDirPathFuncCtx;     /* function context */
+typedef struct OCIDirPathColArray OCIDirPathColArray;        /* column array */
+typedef struct OCIDirPathStream   OCIDirPathStream;                /* stream */
+typedef struct OCIDirPathDesc     OCIDirPathDesc;  /* direct path descriptor */
+
+                 /*----- Defines for Direct Path Options -----*/
+
+                 /* values for OCI_ATTR_DIRPATH_MODE attribute */
+#define OCI_DIRPATH_LOAD         1             /* direct path load operation */
+#define OCI_DIRPATH_UNLOAD       2           /* direct path unload operation */
+#define OCI_DIRPATH_CONVERT      3     /* direct path convert only operation */
+
+    /*----- values for OCI_ATTR_DIRPATH_INDEX_MAINT_METHOD attribute -----*/
+#define OCI_DIRPATH_INDEX_MAINT_SINGLE_ROW     1
+
+/* Note that there are two attributes dealing with index maintenance -
+ * OCI_ATTR_DIRPATH_INDEX_MAINT_METHOD and OCI_ATTR_DIRPATH_SKIPINDEX_METHOD.
+ * OCI_ATTR_DIRPATH_SKIPINDEX_METHOD exists to isolate the behavior for
+ * skipping index maintenance since maintenance of unusable indexes is 
+ * orthogonal to that of single row insertion.
+ * For backwards compatibility we still allow users to specify skip
+ * methods in OCI_ATTR_DIRPATH_INDEX_MAINT_METHOD so make sure the
+ * enumerations for the two attributes are distinct.
+ */
+    /*----- values for OCI_ATTR_DIRPATH_SKIPINDEX_METHOD attribute -----*/
+#define OCI_DIRPATH_INDEX_MAINT_SKIP_UNUSABLE       2
+#define OCI_DIRPATH_INDEX_MAINT_DONT_SKIP_UNUSABLE  3
+#define OCI_DIRPATH_INDEX_MAINT_SKIP_ALL            4
+
+           /* values for OCI_ATTR_STATE attribute of OCIDirPathCtx */
+#define OCI_DIRPATH_NORMAL       1     /* can accept rows, last row complete */
+#define OCI_DIRPATH_PARTIAL      2                   /* last row was partial */
+#define OCI_DIRPATH_NOT_PREPARED 3    /* direct path context is not prepared */
+
+     /*----- values for cflg argument to OCIDirpathColArrayEntrySet -----*/
+#define OCI_DIRPATH_COL_COMPLETE 0                /* column data is complete */
+#define OCI_DIRPATH_COL_NULL     1                         /* column is null */
+#define OCI_DIRPATH_COL_PARTIAL  2                 /* column data is partial */
+
+          /*----- values for action parameter to OCIDirPathDataSave -----*/
+#define OCI_DIRPATH_DATASAVE_SAVEONLY 0              /* data save point only */
+#define OCI_DIRPATH_DATASAVE_FINISH   1           /* execute finishing logic */
+/* save portion of input data (before space error occurred) and finish */
+#define OCI_DIRPATH_DATASAVE_PARTIAL  2       
+
+  /*- OCI_ATTR_DIRPATH_EXPR_TYPE values (describes OCI_ATTR_NAME expr type) -*/
+#define OCI_DIRPATH_EXPR_OBJ_CONSTR  1      /* NAME is an object constructor */
+#define OCI_DIRPATH_EXPR_SQL         2  /* NAME is an opaque or sql function */
+#define OCI_DIRPATH_EXPR_REF_TBLNAME 3 /* NAME is table name if ref is scoped*/
+
+
+/*---------------------------------------------------------------------------
+                           PUBLIC FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+/*------------------------ OCIDirPathCtx Operations -------------------------*/
+
+/*
+  NAME
+    OCIDirPathAbort - OCI: Abort a direct path operation.
+
+  DESCRIPTION
+    Aborts a direct path operation.  Upon successful completion
+    the direct path context is no longer valid.
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathAbort( OCIDirPathCtx *dpctx, OCIError *errhp );
+
+/*
+  NAME
+    OCIDirPathDataSave - OCI: Execute a data save point.
+
+  DESCRIPTION
+    Successful return of this function indicates that a data save
+    point has been executed.
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathDataSave( OCIDirPathCtx *dpctx, OCIError *errhp, ub4 action );
+
+/*
+  NAME
+    OCIDirPathFinish - OCI: Finish a direct path operation.
+
+  DESCRIPTION
+    Finishes a direct path operation.
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathFinish( OCIDirPathCtx *dpctx, OCIError  *errhp );
+
+/*
+  NAME
+    OCIDirPathFlushRow - OCI: Flush a partial row from the server.
+
+  DESCRIPTION
+    Flushes a partially loaded row from the server.
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathFlushRow( OCIDirPathCtx *dpctx, OCIError  *errhp );
+
+/*
+  NAME
+    OCIDirPathPrepare - OCI: Prepare a direct path operation.
+
+  DESCRIPTION
+    Prepares a table/partition for a direct path operation.
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathPrepare( OCIDirPathCtx *dpctx, OCISvcCtx *svchp,
+                      OCIError  *errhp );
+
+/*
+  NAME
+    OCIDirPathLoadStream - OCI: Load a direct path stream.
+
+  DESCRIPTION
+    Load a direct path stream to the object associated with
+    the direct path context.
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathLoadStream( OCIDirPathCtx *dpctx, OCIDirPathStream *dpstr,
+                         OCIError      *errhp );
+
+
+/*---------------------- OCIDirPathColArray Operations ----------------------*/
+
+/*
+  NAME
+    OCIDirPathColArrayEntryGet - OCI:  Get column array entry.
+
+  DESCRIPTION
+    Column array function which is used to get a specified entry in
+    a column array.
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathColArrayEntryGet( OCIDirPathColArray *dpca, OCIError *errhp,
+                              ub4 rownum, ub2 colIdx, ub1 **cvalpp, ub4 *clenp,
+                              ub1 *cflgp );
+
+/*
+  NAME
+    OCIDirPathColArrayEntrySet - OCI:  Set column array entry.
+
+  DESCRIPTION
+    Column array function which is used to set a specified entry in
+    a column array.
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathColArrayEntrySet( OCIDirPathColArray *dpca, OCIError *errhp,
+                               ub4 rownum, ub2 colIdx, ub1 *cvalp, ub4 clen,
+                               ub1 cflg );
+
+/*
+  NAME
+    OCIDirPathColArrayRowGet - OCI:  Get column array row pointers.
+
+  DESCRIPTION
+    Column array function which is used to get the base row pointers
+    for a specified row in a column array.
+    To be used in lieu of OCIDirPathColArrayEntryGet() and
+    OCIDirPathColArrayEntrySet().
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathColArrayRowGet( OCIDirPathColArray *dpca, OCIError *errhp,
+                         ub4 rownum, ub1 ***cvalppp, ub4 **clenpp,
+                         ub1 **cflgpp );
+
+/*
+  NAME
+    OCIDirPathColArrayReset - OCI: Reset Column Array State
+
+  DESCRIPTION
+    Function which resets the column array state.
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+    Resetting the column array state is necessary when piecing in a large
+    column and an error occurs in the middle of loading the column.
+ */
+sword
+OCIDirPathColArrayReset( OCIDirPathColArray *dpca, OCIError *errhp );
+
+/*
+  NAME
+    OCIDirPathColArrayToStream - OCI: Convert Column Array to Stream Format.
+
+  DESCRIPTION
+    Convert from column array format to stream format which is suitable
+    for loading via OCIDirPathLoadStream().
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathColArrayToStream( OCIDirPathColArray *dpca,  OCIDirPathCtx *dpctx,
+                               OCIDirPathStream   *dpstr, OCIError      *errhp,
+                               ub4 rowcnt, ub4 rowoff );
+
+
+
+/*----------------------- OCIDirPathStream Operations -----------------------*/
+
+/*
+  NAME
+    OCIDirPathStreamReset - OCI:
+
+  DESCRIPTION
+
+  RETURNS
+    An OCI error code, Oracle errors are returned via the error handle.
+  NOTES
+ */
+sword
+OCIDirPathStreamReset( OCIDirPathStream *dpstr, OCIError *errhp );
+
+#endif                                              /* OCI8DP_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/ociap.h b/src/terralib/drivers/Oracle/OCI/include/ociap.h
new file mode 100644
index 0000000..226a68e
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ociap.h
@@ -0,0 +1,10240 @@
+/*
+ * $Header$
+ */
+
+/* Copyright (c) 1996, 2003, Oracle Corporation.  All rights reserved.  */
+ 
+/* NOTE:  See 'header_template.doc' in the 'doc' dve under the 'forms' 
+      directory for the header file template that includes instructions. 
+*/
+ 
+/* 
+   NAME 
+     ociap.h - Oracle Call Interface - Ansi Prototypes
+
+   DESCRIPTION 
+     <short description of component this file declares/defines> 
+
+   RELATED DOCUMENTS 
+ 
+   INSPECTION STATUS 
+     Inspection date: 
+     Inspection status: 
+     Estimated increasing cost defects per page: 
+     Rule sets: 
+ 
+   ACCEPTANCE REVIEW STATUS 
+     Review date: 
+     Review status: 
+     Reviewers: 
+ 
+   PUBLIC FUNCTION(S) 
+     <list of external functions declared/defined - with one-line descriptions>
+
+   PRIVATE FUNCTION(S)
+     <list of static functions defined in .c file - with one-line descriptions>
+
+   EXAMPLES
+
+   NOTES
+     <other useful comments, qualifications, etc.>
+
+   MODIFIED   (MM/DD/YY)
+   debanerj    08/26/03 - 6003: Lob interface changes
+   sgollapu    06/23/03 - Add OCIPing
+   debanerj    01/16/03 - Bug 2753018: Lob Locator parameter for 
+                          OCILobGetStorageLimit
+   tkeefe      02/17/03 - bug-2773794: Add new interface for setting Kerb attrs
+   ataracha    01/03/03 - Move OCIXMLType functions to ocixml.h
+   akatti      11/28/02 - [2521361]:add OCIRowidToChar prototype
+   chliang     10/23/02 - add OCIFetchRowCallback
+   cparampa    10/13/02 - Fix the prototype of OCIAQListen(ansi prototype)
+   chliang     10/12/02 - add OCIBindRowCallback
+   debanerj    09/30/02 - Unlimited size LOB 6003
+   thoang      09/25/02 - Add csid to XMLType create functions
+   thoang      04/19/02 - Add OCIXMLTypeGetNS
+   aahluwal    08/09/02 - adding OCIAQDeqArray
+   aahluwal    06/03/02 - bug 2360115
+   skabraha    04/16/02 - fix compiler warnings
+   sichandr    02/12/02 - fix OCIXMLTypeExists
+   gayyappa    02/01/02 - fix 2210776 : change Dom to DOM 
+   sichandr    10/24/01 - OCISvcCtx for XMLType create routines
+   schandir    09/14/01 - Add prototypes for Stmt Caching
+   abande      09/04/01 - Add Prototypes for Session Pooling Methods
+   stakeda     09/12/01 - add OCINlsCharSetConvert
+   whe         08/28/01 - add OCIEnvNlsCreate
+   wzhang      08/22/01 - Add OCINlsCharSetNameToId.
+   whe         10/05/01 - add prototype for OCIXMLType functions
+   mdmehta     04/06/01 - Bug 1683763, OCIDateTimeToText: buf_size to ub4*
+   schandir    12/12/00 - modify the ociconnectionpoolcreate() interface.
+   porangas    12/04/00 - Forward merge bug#974710 to 9i
+   rpingte     11/29/00 - Fix bug# 1485795.
+   gtarora     11/30/00 - fix comment for OCILobIsTemporary
+   akatti      11/07/00 - [1198379]:add OCIRowidToChar
+   bpalaval    10/15/00 - Forward merge 892654.
+   kmohan      09/18/00 - add OCILogon2
+   etucker     07/28/00 - add OCIIntervalFromTZ
+   vjayaram    07/18/00 - add connection pooling changes
+   etucker     07/13/00 - add dls apis for oci
+   hmasaki     07/05/00 - fix 1230846: forward merge into 8.2
+   mbastawa    06/05/00 - add OCIStmtFetch2
+   rxgovind    06/07/00 - update OCIAnyData interfaces
+   rxgovind    05/04/00 - add OCIAnyDataSet interfaces
+   rkasamse    05/01/00 - remove attrno from OCIAnyDataAttrGet
+   rkasamse    03/13/00 - add prototype s for OCCIAnyData
+   slari       09/01/99 - remove OCIEnvCallback
+   slari       08/23/99 - add OCIUcb in user callback functions
+   dsaha       07/07/99 - Add OCIFEnvCreate for forms
+   vyanaman    06/21/99 - Change OCI DateTime/Interval APIs.
+   esoyleme    07/01/99 - expose MTS performance enhancements                  
+   whe         06/14/99 - bug727872:add CONST to match definitions
+   kkarun      02/23/99 - Fix OCIDateTime APIs
+   jiyang      12/07/98 - Add comments for OCI_NLS_DUAL_CURRENCY
+   aroy        12/01/98 - add OCIEnvCreate
+   slari       11/23/98 - use ORASTDARG
+   slari       11/21/98 - replace ellipsis by arglist in OCIUserCallback
+   thchang     10/20/98 - correct comment on OCILobCreateTemporary
+   slari       09/08/98 - allow envh to receive error info also in CallbackReg/
+   kkarun      09/02/98 - Change const to CONST
+   aroy        08/04/98 - add OCITerminate calls                               
+   nramakri    06/25/98 - remove CONST from some OCIPickler APIs
+   jiyang      06/22/98 - Fix a lint error
+   nmallava    06/08/98 - ociistemporary -> envhp
+   jhasenbe    05/27/98 - Remove definitions for U-Calls (Unicode)
+   nmallava    05/18/98 - add comments
+   sgollapu    05/19/98 - Change text to OraText
+   aroy        04/20/98 - merge forward 8.0.5 -> 8.1.3
+   nbhatt      05/14/98 -  aq listen call
+   lchidamb    03/02/98 - Client Notification prototypes
+   vyanaman    04/19/98 - System Timestamp
+   kkarun      04/17/98 - Add more Interval functions
+   vyanaman    04/17/98 - Fix min (proc error)
+   vyanaman    04/16/98 - Add get/set TZ
+   kkarun      04/13/98 - Add Datetime prototypes
+   rkasamse    04/13/98 - change OCIEnv* to dvoid* for context/memory cart serv
+   rkasamse    04/15/98 - chage pickler cart interface
+   slari       03/20/98 - change proto of OCIUserCallback
+   slari       02/17/98 - add OCIUserCallback
+   jiyang      04/02/98 - Accept both env and user handles for NLS
+   rkasamse    03/20/98 - remove prototypes for OCIMemoryDuration* functions.
+   tsaulys     03/20/98 - use environment or session handle
+   nmallava    04/09/98 - OCILobLocatorAssign
+   nmallava    04/07/98 - lobgetchunksize and writeappend apis
+   jhasenbe    04/06/98 - Add new interfaces for Unicode support
+   nmallava    03/17/98 - add interfaces
+   nmallava    03/16/98 - add open/close apis
+   nmallava    03/10/98 - add temporary lobs apis
+   sgollapu    07/10/97 - Add OCIReset
+   sgollapu    02/09/98 - OCI non-blocking
+   nramakri    01/16/98 - remove #ifdef NEVER clause for OCIExtract
+   rmurthy     01/08/98 - OCIContextGenerateKey: change ub1 to ub4
+   ewaugh      12/18/97 - Turn type wrappers into functions.
+   skabraha    12/02/97 - adding OCIFile functions
+   rhwu        12/02/97 - add OCI Thread
+   nramakri    12/15/97 - move to core4
+   nramakri    12/11/97 - modify OCIExtract prototype
+   ewaugh      12/10/97 - add OCIFormat prototypes
+   nmallava    12/17/97 - Add ilob open and close apis
+   rkasamse    12/03/97 - Change some of the function names for pickler cartrid
+   nramakri    11/12/97 - add OCIExtract prototypes
+   rkasamse    11/21/97 - add prototypes for memory cartridge services and cont
+   rkasamse    11/03/97 - Add pickler cartridge interfaces.
+   jiyang      11/11/97 - Add NLS service for cartridge
+   tanguyen    08/19/97 -
+   cxcheng     07/30/97 - replace OCISvcCtx with OCISvcCtx
+   schandra    06/25/97 - AQ OCI interface
+   bnainani    07/21/97 - add prototypes for Oracle XA extensions
+   esoyleme    05/13/97 - move failover callback prototype
+   skmishra    05/06/97 - stdc compiler fixes
+   skmishra    04/24/97 - C++ Compatibility changes
+   skotsovo    04/21/97 - make lob parameter names consistent
+   rwhitman    04/16/97 - Fix LOB prototypes - Olint OCI 8.0.3
+   ramkrish    04/15/97 - Add free flag to OCILobFlushBuffer
+   dchatter    04/10/97 - add nzt.h inclusion
+   cxcheng     04/09/97 - change objnamp from CONST text* to dvoid*
+   cxcheng     04/08/97 - fix prototype of OCIDescribeAny()
+   skotsovo    03/31/97 - remove OCILobLocatorSize
+   skotsovo    03/27/97 - add OCILobLoadFromFile
+   bcchang     02/18/97 - Fix syntax error
+   dchatter    01/13/97 - fix comments on LOB calls
+   aroy        01/10/97 - remove ocilobfilecreate delete
+   sgollapu    12/27/96 - Correct OCILogon prototype
+   dchatter    01/04/97 - comments to describe the functions
+   sgollapu    11/25/96 - Change OCILobFileIsExistent
+   schandra    11/18/96 - Remove xa.h include
+   sgollapu    11/09/96 - Change prototype of OCIDescribeAny
+   dchatter    10/31/96 - delete CONST from lob write cb fn
+   dchatter    10/30/96 - more changes
+   dchatter    10/26/96 - lob/file long name corrections
+   slari       10/16/96 - delete unused calls
+   rwessman    10/29/96 - Fixed OCISecurityGetIdentity prototype
+   bcchang     10/25/96 - Fix syntax error
+   sgollapu    10/22/96 - Add OCILogon and OCILogoff
+   rwessman    10/16/96 - Added cryptographic and digital signature functions
+   sgollapu    10/10/96 - Add ocibdp and ocibdn
+   rxgovind    10/07/96 - add oci file calls
+   skotsovo    10/01/96 - move orl lob fnts to oci
+   skotsovo    09/20/96 - in OCILobGetLength(), remove the 'isnull' parameter.
+   aroy        08/29/96 - change prototype for Nchar Lob support
+   dchatter    08/21/96 - OCIResultSetToStmt prototype change
+   sthakur     08/14/96 - add OCIParamSet
+   schandra    07/26/96 - TX OCI return values - sb4->sword
+   aroy        07/17/96 - terminology change: OCILobLocator => OCILobLocator
+   dchatter    07/01/96 - create ANSI prototypes
+   dchatter    07/01/96 - Creation
+
+*/
+
+ 
+#ifndef OCIAP_ORACLE
+# define OCIAP_ORACLE
+
+# ifndef ORATYPES 
+#  include <oratypes.h> 
+# endif 
+ 
+#ifndef ORASTDARG
+#include <stdarg.h>
+#define ORASTDARG
+#endif
+
+#ifndef OCIDFN
+#include <ocidfn.h>
+#endif
+
+#ifndef NZT_ORACLE
+#include <nzt.h>
+#endif /* NZT_ORACLE */
+ 
+#ifndef OCI_ORACLE
+#include <oci.h>
+#endif
+
+#ifndef ORT_ORACLE
+#include <ort.h>
+#endif
+
+
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                     PRIVATE TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                           PUBLIC FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+/*****************************************************************************
+                              DESCRIPTION
+******************************************************************************
+Note: the descriptions of the functions are alphabetically arranged. Please 
+maintain the arrangement when adding a new function description. The actual 
+prototypes are below this comment section and donot follow any alphabetical 
+ordering. 
+
+
+--------------------------------OCIAttrGet------------------------------------
+
+OCIAttrGet()
+Name
+OCI Attribute Get
+Purpose
+This call is used to get a particular attribute of a handle. 
+Syntax
+sword OCIAttrGet ( CONST dvoid    *trgthndlp,
+                 ub4            trghndltyp,
+                 dvoid          *attributep,
+                 ub4            *sizep,
+                 ub4            attrtype,
+                 OCIError       *errhp );
+Comments
+This call is used to get a particular attribute of a handle.
+See Appendix B,  "Handle Attributes",  for a list of handle types and their 
+readable attributes.
+Parameters
+trgthndlp (IN) - is the pointer to a handle type. 
+trghndltyp (IN) - is the handle type. 
+attributep (OUT) - is a pointer to the storage for an attribute value. The 
+attribute value is filled in. 
+sizep (OUT) - is the size of the attribute value. 
+This can be passed in as NULL for most parameters as the size is well known. 
+For text* parameters, a pointer to a ub4 must be passed in to get the length 
+of the string. 
+attrtype (IN) - is the type of attribute.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+Related Functions
+OCIAttrSet()
+
+--------------------------------OCIAttrSet------------------------------------
+
+
+OCIAttrSet()
+Name
+OCI Attribute Set
+Purpose
+This call is used to set a particular attribute of a handle or a descriptor. 
+Syntax
+sword OCIAttrSet ( dvoid       *trgthndlp,
+                 ub4         trghndltyp,
+                 dvoid       *attributep,
+                 ub4         size,
+                 ub4         attrtype,
+                 OCIError    *errhp );
+Comments
+This call is used to set a particular attribute of a handle or a descriptor. 
+See Appendix B for a list of handle types and their writeable attributes.
+Parameters
+trghndlp (IN/OUT) - the pointer to a handle type whose attribute gets 
+modified. 
+trghndltyp (IN/OUT) - is the handle type. 
+attributep (IN) - a pointer to an attribute value. 
+The attribute value is copied into the target handle. If the attribute value 
+is a pointer, then only the pointer is copied, not the contents of the pointer.
+size (IN) - is the size of an attribute value. This can be passed in as 0 for 
+most attributes as the size is already known by the OCI library. For text*
+attributes, a ub4 must be passed in set to the length of the string. 
+attrtype (IN) - the type of attribute being set.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+Related Functions
+OCIAttrGet()
+
+
+
+--------------------------------OCIBindArrayOfStruct--------------------------
+
+
+
+OCIBindArrayOfStruct()
+Name
+OCI Bind for Array of Structures
+Purpose
+This call sets up the skip parameters for a static array bind.
+Syntax
+sword OCIBindArrayOfStruct ( OCIBind     *bindp,
+                           OCIError    *errhp,
+                           ub4         pvskip, 
+                           ub4         indskip, 
+                           ub4         alskip, 
+                           ub4         rcskip );
+Comments
+This call sets up the skip parameters necessary for a static array bind.
+This call follows a call to OCIBindByName() or OCIBindByPos(). The bind 
+handle returned by that initial bind call is used as a parameter for the 
+OCIBindArrayOfStruct() call.
+For information about skip parameters, see the section "Arrays of Structures" 
+on page 4-16.
+Parameters
+bindp (IN) - the handle to a bind structure. 
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+pvskip (IN) - skip parameter for the next data value. 
+indskip (IN) - skip parameter for the next indicator value or structure. 
+alskip (IN) - skip parameter for the next actual length value. 
+rcskip (IN) - skip parameter for the next column-level return code value. 
+Related Functions
+OCIAttrGet()
+
+
+--------------------------------OCIBindByName---------------------------------
+
+OCIBindByName()
+Name
+OCI Bind by Name
+Purpose
+Creates an association between a program variable and a placeholder in a SQL 
+statement or PL/SQL block.
+Syntax
+sword OCIBindByName (
+              OCIStmt       *stmtp, 
+              OCIBind       **bindp,
+              OCIError      *errhp,
+              CONST OraText    *placeholder,
+              sb4           placeh_len,
+              dvoid         *valuep,
+              sb4           value_sz,
+              ub2           dty,
+              dvoid         *indp,
+              ub2           *alenp,
+              ub2           *rcodep,
+              ub4           maxarr_len,
+              ub4           *curelep, 
+              ub4           mode ); 
+Description
+This call is used to perform a basic bind operation. The bind creates an 
+association between the address of a program variable and a placeholder in a 
+SQL statement or PL/SQL block. The bind call also specifies the type of data 
+which is being bound, and may also indicate the method by which data will be 
+provided at runtime.
+This function also implicitly allocates the bind handle indicated by the bindp 
+parameter.
+Data in an OCI application can be bound to placeholders statically or 
+dynamically. Binding is static when all the IN bind data and the OUT bind 
+buffers are well-defined just before the execute. Binding is dynamic when the 
+IN bind data and the OUT bind buffers are provided by the application on 
+demand at execute time to the client library. Dynamic binding is indicated by 
+setting the mode parameter of this call to OCI_DATA_AT_EXEC.
+Related Functions: For more information about dynamic binding, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16.
+Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle, 
+which is implicitly allocated by the bind call A separate bind handle is 
+allocated for each placeholder the application is binding.
+Additional bind calls may be required to specify particular attributes 
+necessary when binding certain data types or handling input data in certain 
+ways:
+If arrays of structures are being utilized, OCIBindArrayOfStruct() must 
+be called to set up the necessary skip parameters.
+If data is being provided dynamically at runtime, and the application 
+will be using user-defined callback functions, OCIBindDynamic() must 
+be called to register the callbacks.
+If a named data type is being bound, OCIBindObject() must be called to 
+specify additional necessary information.
+Parameters
+stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement 
+being processed.
+bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly 
+allocated by this call.  The bind handle  maintains all the bind information 
+for this particular input value. The handle is feed implicitly when the 
+statement handle is deallocated.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+placeholder (IN) - the placeholder attributes are specified by name if 
+ocibindn() is being called.
+placeh_len (IN) - the length of the placeholder name specified in placeholder.
+valuep (IN/OUT) - a pointer to a data value or an array of data values of the 
+type specified in the dty parameter. An array of data values can be specified 
+for mapping into a PL/SQL table or for providing data for SQL multiple-row 
+operations. When an array of bind values is provided, this is called an array 
+bind in OCI terms. Additional attributes of the array bind (not bind to a 
+column of ARRAY type) are set up in OCIBindArrayOfStruct() call. 
+For a REF, named data type  bind, the valuep parameter is used only for IN 
+bind data. The pointers to OUT buffers are set in the pgvpp parameter 
+initialized by OCIBindObject(). For named data type and REF binds, the bind 
+values are unpickled into the Object Cache. The OCI object navigational calls 
+can then be used to navigate the objects and the refs in the Object Cache.
+If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep 
+is ignored for all data types. OCIBindArrayOfStruct() cannot be used and 
+OCIBindDynamic() must be invoked to provide callback functions if desired. 
+value_sz (IN) - the size of a data value. In the case of an array bind, this is
+the maximum size of any element possible with the actual sizes being specified 
+in the alenp parameter. 
+If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum 
+size of the data that can be ever provided at runtime for data types other than
+named data types or REFs. 
+dty (IN) - the data type of the value(s) being bound. Named data types 
+(SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been 
+initialized in object mode. For named data types, or REFs, additional calls 
+must be made with the bind handle to set up the datatype-specific attributes.
+indp (IN/OUT) - pointer to an indicator variable or array. For scalar data 
+types, this is a pointer to sb2 or an array of sb2s. For named data types, 
+this pointer is ignored and the actual pointer to the indicator structure or 
+an array of indicator structures is initialized by OCIBindObject(). 
+Ignored for dynamic binds.
+See the section "Indicator Variables" on page 2-43 for more information about 
+indicator variables.
+alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each 
+element in alenp is the length of the data in the corresponding element in the 
+bind value array before and after the execute. This parameter is ignored for 
+dynamic binds.
+rcodep (OUT) - pointer to array of column level return codes. This parameter 
+is ignored for dynamic binds.
+maxarr_len (IN) - the maximum possible number of elements of type dty in a 
+PL/SQL binds. This parameter is not required for non-PL/SQL binds. If 
+maxarr_len is non-zero, then either OCIBindDynamic() or 
+OCIBindArrayOfStruct() can be invoked to set up additional bind attributes. 
+curelep(IN/OUT) - a pointer to the actual number of elements. This parameter 
+is only required for PL/SQL binds.
+mode (IN) - the valid modes for this parameter are:
+OCI_DEFAULT. This is default mode.
+OCI_DATA_AT_EXEC. When this mode is selected, the value_sz 
+parameter defines the maximum size of the data that can be ever 
+provided at runtime. The application must be ready to provide the OCI 
+library runtime IN data buffers at any time and any number of times. 
+Runtime data is provided in one of the two ways:
+callbacks using a user-defined function which must be registered 
+with a subsequent call to OCIBindDynamic(). 
+a polling mechanism using calls supplied by the OCI. This mode 
+is assumed if no callbacks are defined.
+For more information about using the OCI_DATA_AT_EXEC mode, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16.
+When the allocated buffers are not required any more, they should be 
+freed by the client. 
+Related Functions
+OCIBindDynamic(), OCIBindObject(), OCIBindArrayOfStruct(), OCIAttrGet()
+
+
+
+-------------------------------OCIBindByPos-----------------------------------
+
+
+OCIBindByPos()
+Name
+OCI Bind by Position
+Purpose
+Creates an association between a program variable and a placeholder in a SQL 
+statement or PL/SQL block.
+Syntax
+sword OCIBindByPos ( 
+              OCIStmt      *stmtp, 
+              OCIBind      **bindp,
+              OCIError     *errhp,
+              ub4          position,
+              dvoid        *valuep,
+              sb4          value_sz,
+              ub2          dty,
+              dvoid        *indp,
+              ub2          *alenp,
+              ub2          *rcodep,
+              ub4          maxarr_len,
+              ub4          *curelep, 
+              ub4          mode);
+
+Description
+This call is used to perform a basic bind operation. The bind creates an 
+association between the address of a program variable and a placeholder in a 
+SQL statement or PL/SQL block. The bind call also specifies the type of data 
+which is being bound, and may also indicate the method by which data will be 
+provided at runtime.
+This function also implicitly allocates the bind handle indicated by the bindp 
+parameter.
+Data in an OCI application can be bound to placeholders statically or 
+dynamically. Binding is static when all the IN bind data and the OUT bind 
+buffers are well-defined just before the execute. Binding is dynamic when the 
+IN bind data and the OUT bind buffers are provided by the application on 
+demand at execute time to the client library. Dynamic binding is indicated by 
+setting the mode parameter of this call to OCI_DATA_AT_EXEC.
+Related Functions: For more information about dynamic binding, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16
+Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle, 
+which is implicitly allocated by the bind call A separate bind handle is 
+allocated for each placeholder the application is binding.
+Additional bind calls may be required to specify particular attributes 
+necessary when binding certain data types or handling input data in certain 
+ways:
+If arrays of structures are being utilized, OCIBindArrayOfStruct() must 
+be called to set up the necessary skip parameters.
+If data is being provided dynamically at runtime, and the application 
+will be using user-defined callback functions, OCIBindDynamic() must 
+be called to register the callbacks.
+If a named data type is being bound, OCIBindObject() must be called to 
+specify additional necessary information.
+Parameters
+stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement 
+being processed.
+bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly 
+allocated by this call.  The bind handle  maintains all the bind information 
+for this particular input value. The handle is feed implicitly when the 
+statement handle is deallocated.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+position (IN) - the placeholder attributes are specified by position if 
+ocibindp() is being called.
+valuep (IN/OUT) - a pointer to a data value or an array of data values of the 
+type specified in the dty parameter. An array of data values can be specified 
+for mapping into a PL/SQL table or for providing data for SQL multiple-row 
+operations. When an array of bind values is provided, this is called an array 
+bind in OCI terms. Additional attributes of the array bind (not bind to a 
+column of ARRAY type) are set up in OCIBindArrayOfStruct() call. 
+For a REF, named data type  bind, the valuep parameter is used only for IN 
+bind data. The pointers to OUT buffers are set in the pgvpp parameter 
+initialized by OCIBindObject(). For named data type and REF binds, the bind 
+values are unpickled into the Object Cache. The OCI object navigational calls 
+can then be used to navigate the objects and the refs in the Object Cache.
+If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep 
+is ignored for all data types. OCIBindArrayOfStruct() cannot be used and 
+OCIBindDynamic() must be invoked to provide callback functions if desired. 
+value_sz (IN) - the size of a data value. In the case of an array bind, this is
+the maximum size of any element possible with the actual sizes being specified
+in the alenp parameter. 
+If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum 
+size of the data that can be ever provided at runtime for data types other than
+named data types or REFs. 
+dty (IN) - the data type of the value(s) being bound. Named data types 
+(SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been 
+initialized in object mode. For named data types, or REFs, additional calls 
+must be made with the bind handle to set up the datatype-specific attributes.
+indp (IN/OUT) - pointer to an indicator variable or array. For scalar data 
+types, this is a pointer to sb2 or an array of sb2s. For named data types, 
+this pointer is ignored and the actual pointer to the indicator structure or 
+an array of indicator structures is initialized by OCIBindObject(). Ignored 
+for dynamic binds.
+See the section "Indicator Variables" on page 2-43 for more information about 
+indicator variables.
+alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each 
+element in alenp is the length of the data in the corresponding element in the 
+bind value array before and after the execute. This parameter is ignored for 
+dynamic binds.
+rcodep (OUT) - pointer to array of column level return codes. This parameter 
+is ignored for dynamic binds.
+maxarr_len (IN) - the maximum possible number of elements of type dty in a 
+PL/SQL binds. This parameter is not required for non-PL/SQL binds. If 
+maxarr_len is non-zero, then either OCIBindDynamic() or 
+OCIBindArrayOfStruct() can be invoked to set up additional bind attributes. 
+curelep(IN/OUT) - a pointer to the actual number of elements. This parameter 
+is only required for PL/SQL binds.
+mode (IN) - the valid modes for this parameter are:
+OCI_DEFAULT. This is default mode.
+OCI_DATA_AT_EXEC. When this mode is selected, the value_sz 
+parameter defines the maximum size of the data that can be ever 
+provided at runtime. The application must be ready to provide the OCI 
+library runtime IN data buffers at any time and any number of times. 
+Runtime data is provided in one of the two ways:
+callbacks using a user-defined function which must be registered 
+with a subsequent call to OCIBindDynamic() . 
+a polling mechanism using calls supplied by the OCI. This mode 
+is assumed if no callbacks are defined.
+For more information about using the OCI_DATA_AT_EXEC mode, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16.
+When the allocated buffers are not required any more, they should be 
+freed by the client. 
+Related Functions
+OCIBindDynamic(), OCIBindObject(), OCIBindArrayOfStruct(), OCIAttrGet()
+
+
+
+-------------------------------OCIBindDynamic---------------------------------
+
+OCIBindDynamic()
+Name
+OCI Bind Dynamic Attributes
+Purpose
+This call is used to register user callbacks for dynamic data allocation. 
+Syntax
+sword OCIBindDynamic( OCIBind     *bindp,
+                    OCIError    *errhp,
+                    dvoid       *ictxp, 
+                    OCICallbackInBind         (icbfp)(
+                                dvoid            *ictxp,
+                                OCIBind          *bindp,
+                                ub4              iter, 
+                                ub4              index, 
+                                dvoid            **bufpp,
+                                ub4              *alenp,
+                                ub1              *piecep, 
+                                dvoid            **indp ),
+                    dvoid       *octxp,
+                    OCICallbackOutBind         (ocbfp)(
+                                dvoid            *octxp,
+                                OCIBind          *bindp,
+                                ub4              iter, 
+                                ub4              index, 
+                                dvoid            **bufp, 
+                                ub4              **alenpp,
+                                ub1              *piecep,
+                                dvoid            **indpp, 
+                                ub2              **rcodepp)   );
+Comments
+This call is used to register user-defined callback functions for providing 
+data for an UPDATE or INSERT if OCI_DATA_AT_EXEC mode was specified in a 
+previous call to OCIBindByName() or OCIBindByPos(). 
+The callback function pointers must return OCI_CONTINUE if it the call is 
+successful. Any return code other than OCI_CONTINUE signals that the client 
+wishes to abort processing immediately.
+For more information about the OCI_DATA_AT_EXEC mode, see the section 
+"Runtime Data Allocation and Piecewise Operations" on page 5-16.
+Parameters
+bindp (IN/OUT) - a bind handle returned by a call to OCIBindByName() or 
+OCIBindByPos(). 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+ictxp (IN) - the context pointer required by the call back function icbfp. 
+icbfp (IN) - the callback function which returns a pointer to the IN bind 
+value or piece at run time. The callback takes in the following parameters. 
+ictxp (IN/OUT) - the context pointer for this callback function. 
+bindp (IN) - the bind handle passed in to uniquely identify this bind 
+variable. 
+iter (IN) - 1-based execute iteration value. 
+index (IN) - index of the current array, for an array bind. 1 based not 
+greater than curele parameter of the bind call. 
+index (IN) - index of the current array, for an array bind. This parameter 
+is 1-based, and may not be greater than curele parameter of the bind call. 
+bufpp (OUT) - the pointer to the buffer. 
+piecep (OUT) - which piece of the bind value. This can be one of the 
+following values - OCI_ONE_PIECE, OCI_FIRST_PIECE, 
+OCI_NEXT_PIECE and OCI_LAST_PIECE.
+indp (OUT) - contains the indicator value. This is apointer to either an 
+sb2 value or a pointer to an indicator structure for binding named data 
+types. 
+indszp (OUT) - contains the indicator value size. A pointer containing 
+the size of either an sb2 or an indicator structure pointer. 
+octxp (IN) - the context pointer required by the callback function ocbfp. 
+ocbfp (IN) - the callback function which returns a pointer to the OUT bind 
+value or piece at run time. The callback takes in the following parameters. 
+octxp (IN/OUT) - the context pointer for this call back function. 
+bindp (IN) - the bind handle passed in to uniquely identify this bind 
+variable. 
+iter (IN) - 1-based execute iteration value. 
+index (IN) - index of the current array, for an array bind. This parameter 
+is 1-based, and must not be greater than curele parameter of the bind call. 
+bufpp (OUT) - a pointer to a buffer to write the bind value/piece. 
+buflp (OUT) - returns the buffer size. 
+alenpp (OUT) - a pointer to a storage for OCI to fill in the size of the bind 
+value/piece after it has been read. 
+piecep (IN/OUT) - which piece of the bind value. It will be set by the 
+library to be one of the following values - OCI_ONE_PIECE or 
+OCI_NEXT_PIECE. The callback function can leave it unchanged or set 
+it to OCI_FIRST_PIECE or OCI_LAST_PIECE. By default - 
+OCI_ONE_PIECE. 
+indpp (OUT) - returns a pointer to contain the indicator value which 
+either an sb2 value or a pointer to an indicator structure for named data 
+types. 
+indszpp (OUT) - returns a pointer to return the size of the indicator 
+value which is either size of an sb2 or size of an indicator structure. 
+rcodepp (OUT) - returns a pointer to contains the return code. 
+Related Functions
+OCIAttrGet()
+
+
+---------------------------------OCIBindObject--------------------------------
+
+
+OCIBindObject()
+Name
+OCI Bind Object
+Purpose
+This function sets up additional attributes which are required for a named 
+data type (object)  bind.
+Syntax
+sword OCIBindObject ( OCIBind          *bindp,
+                    OCIError         *errhp, 
+                    CONST OCIType    *type,
+                    dvoid            **pgvpp, 
+                    ub4              *pvszsp, 
+                    dvoid            **indpp, 
+                    ub4              *indszp, );
+Comments
+This function sets up additional attributes which binding a named data type 
+or a REF. An error will be returned if this function is called when the OCI 
+environment has been initialized in non-object mode. 
+This call takes as a paramter a type descriptor object (TDO) of datatype 
+OCIType for the named data type being defined.  The TDO can be retrieved 
+with a call to OCITypeByName().
+If the OCI_DATA_AT_EXEC mode was specified in ocibindn() or ocibindp(), the 
+pointers to the IN buffers are obtained either using the callback icbfp 
+registered in the OCIBindDynamic() call or by the OCIStmtSetPieceInfo() call. 
+The buffers are dynamically allocated for the OUT data and the pointers to 
+these buffers are returned either by calling ocbfp() registered by the 
+OCIBindDynamic() or by setting the pointer to the buffer in the buffer passed 
+in by OCIStmtSetPieceInfo() called when OCIStmtExecute() returned 
+OCI_NEED_DATA. The memory of these client library- allocated buffers must be 
+freed when not in use anymore by using the OCIObjectFreee() call.
+Parameters
+bindp ( IN/OUT) - the bind handle returned by the call to OCIBindByName() 
+or OCIBindByPos(). 
+errhp ( IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+type ( IN) - points to the TDO which describes the type of the program 
+variable being bound. Retrieved by calling OCITypeByName().
+pgvpp ( IN/OUT) - points to a pointer to the program variable buffer. For an 
+array, pgvpp points to an array of pointers. When the bind variable is also an 
+OUT variable, the OUT Named Data Type value or REF is allocated 
+(unpickled) in the Object Cache, and a pointer to the value or REF is returned,
+At the end of execute, when all OUT values have been received, pgvpp points 
+to an array of pointer(s) to these newly allocated named data types in the 
+object cache. 
+pgvpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the Named 
+Data Type buffers are requested at runtime. For static array binds, skip 
+factors may be specified using the OCIBindArrayOfStruct() call. The skip 
+factors are used to compute the address of the next pointer to the value, the 
+indicator structure and their sizes.
+pvszsp ( IN/OUT) - points to the size of the program variable. The size of the 
+named data type is not required on input. For an array, pvszsp is an array of 
+ub4s. On return, for OUT bind variables, this points to size(s) of the Named 
+Data Types and REFs received. pvszsp is ignored if the OCI_DATA_AT_EXEC 
+mode is set. Then the size of the buffer is taken at runtime.
+indpp ( IN/OUT) - points to a pointer to the program variable buffer 
+containing the parallel indicator structure. For an array, points to an array 
+of pointers. When the bind variable is also an OUT bind variable, memory is 
+allocated in the object cache, to store the unpickled OUT indicator values. At 
+the end of the execute when all OUT values have been received, indpp points 
+to the pointer(s) to these newly allocated indicator structure(s). 
+indpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator 
+is requested at runtime.
+indszp ( IN/OUT) - points to the size of the IN indicator structure program 
+variable. For an array, it is an array of sb2s. On return for OUT bind 
+variables, this points to size(s) of the received OUT indicator structures.
+indszp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator 
+size is requested at runtime.
+Related Functions
+OCIAttrGet()
+
+
+
+----------------------------------OCIBreak------------------------------------
+
+
+OCIBreak()
+Name
+OCI Break
+Purpose
+This call performs an immediate (asynchronous) abort of any currently 
+executing OCI function that is associated with a server .
+Syntax
+sword OCIBreak ( dvoid      *hndlp,
+                 OCIError   *errhp);
+Comments
+This call performs an immediate (asynchronous) abort of any currently 
+executing OCI function that is associated with a server. It is normally used 
+to stop a long-running OCI call being processed on the server.
+This call can take either the service context handle or the server context 
+handle as a parameter to identify the function to be aborted.
+Parameters
+hndlp (IN) - the service context handle or the server context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+Related Functions
+
+-----------------------------OCIConnectionPoolCreate --------------------------
+Name:
+OCIConnectionPoolCreate
+
+Purpose:
+Creates the connections in the pool
+
+Syntax:
+OCIConnectionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCICPool *poolhp,
+                         OraText **poolName, sb4 *poolNameLen, 
+                         CONST Oratext *dblink, sb4 dblinkLen,
+                         ub4 connMin, ub4 connMax, ub4 connIncr,
+                         CONST OraText *poolUsername, sb4 poolUserLen,
+                         CONST OraText *poolPassword, sb4 poolPassLen, 
+                         ub4 mode)
+Comments:
+This call is used to create a connection pool. conn_min connections
+to the database are started on calling OCIConnectionPoolCreate.
+
+Parameters:
+envhp (IN/OUT)  - A pointer to the environment where the Conencton Pool
+                  is to be created
+errhp (IN/OUT)  - An error handle which can be passed to OCIErrorGet().
+poolhp (IN/OUT) - An uninitialiazed pool handle.
+poolName (OUT) - The connection pool name. 
+poolNameLen (OUT) - The length of the connection pool name 
+dblink (IN/OUT) - Specifies the database(server) to connect. This will also
+                  be used as the default pool name.
+dblinkLen (IN)  - The length of the string pointed to by dblink.
+connMin (IN)    - Specifies the minimum number of connections in the
+                  Connection Pool at any instant.
+                  connMin number of connections are started when
+                  OCIConnectionPoolCreate() is called.
+connMax (IN)    - Specifies the maximum number of connections that can be
+                  opened to the database. Once this value is reached, no
+                  more connections are opened.
+connIncr (IN)   - Allows application to set the next increment for
+                  connections to be opened to the database if the current
+                  number of connections are less than conn_max.
+poolUsername (IN/OUT) - Connection pooling requires an implicit proxy
+                         session and this attribute provides a username
+                         for that session.
+poolUserLen (IN) - This represents the length of pool_username.
+poolPassword (IN/OUT) - The password for the parameter pool_username passed
+                        above.
+poolPassLen (IN) - This represents the length of pool_password.
+
+mode (IN) - The modes supported are OCI_DEFAULT and 
+OCI_CPOOL_REINITIALIZE 
+
+Related Functions
+OCIConnectionPoolDestroy()
+
+---------------------------------------------------------------------------
+
+----------------------------OCIConnectionPoolDestroy-------------------------
+Name:
+OCIConnectionPoolDestroy
+
+Purpose:
+Terminates the connections in the pool
+
+Syntax:
+OCIConnectionPoolDestroy (OCICPool *poolhp, OCIError *errhp, ub4 mode)
+
+Comments:
+On calling OCIConnectionPoolDestroy, all the open connections in the pool
+are closed and the pool is destroyed.
+
+Parameters:
+poolhp (IN/OUT) - An initialiazed pool handle.
+errhp (IN/OUT)  - An error handle which can be passed to OCIErrorGet().
+mode (IN)       - Currently, OCIConnectionPoolDestroy() will support only
+                  the OCI_DEFAULT mode.
+
+Related Functions:
+OCIConnectionPoolCreate()
+
+-----------------------------------------------------------------------------
+----------------------------OCISessionPoolCreate-----------------------------
+Name: 
+OCISessionPoolCreate
+
+Purpose:
+Creates the sessions in the session pool.
+
+Syntax:
+sword OCISessionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCISpool *spoolhp, 
+                      OraText **poolName, ub4 *poolNameLen, 
+                      CONST OraText *connStr, ub4 connStrLen,
+                      ub4 sessMin, ub4 sessMax, ub4 sessIncr,
+                      OraText *userid,  ub4 useridLen,
+                      OraText *password, ub4 passwordLen,
+                      ub4 mode)
+
+Comments:
+When OCISessionPoolCreate is called, a session pool is initialized for
+the associated environment and the database specified by the
+connStr parameter. This pool is named uniquely and the name
+is returned to the user in the poolname parameter.
+
+Parameters:
+envhp (IN/OUT) - A pointer to the environment handle in which the session
+                 pool needs to be created.
+errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet().
+spoolhp (IN/OUT) - A pointer to the session pool handle that is created.
+poolName (OUT) - Session pool name returned to the user.
+poolNameLen (OUT) - Length of the PoolName
+connStr (IN) - The TNS alias of the database to connect to.
+connStrLen (IN) - Length of the connStr.
+sessMin (IN) - Specifies the minimum number of sessions in the Session Pool.
+               These are the number of sessions opened in the beginning, if
+               in Homogeneous mode. Else, the parameter is ignored.
+sessMax (IN) - Specifies the maximum number of sessions in the Session Pool.
+               Once this value is reached, no more sessions are opened,
+               unless the OCI_ATTR_SPOOL_FORCEGET is set.
+userid (IN) - Specifies the userid with which to start up the sessions.
+useridLen (IN) - Length of userid.
+password (IN) - Specifies the password for the corresponding userid.
+passwordLen (IN) - Specifies the length of the password
+mode(IN) - May be OCI_DEFAULT, OCI_SPC_SPOOL_REINITIALIZE, or
+           OCI_SPC_SPOOL_HOMOGENEOUS.
+
+Returns:
+SUCCESS - If pool could be allocated and created successfully.
+ERROR - If above conditions could not be met.
+
+Related Functions:
+OCISessionPoolDestroy()
+-----------------------------------------------------------------------------
+-----------------------------OCISessionPoolDestroy---------------------------
+Name:
+OCISessionPoolDestroy
+
+Purpose:
+Terminates all the sessions in the session pool.
+
+Syntax:
+sword OCISessionPoolDestroy (OCISPool *spoolhp, OCIError *errhp, ub4 mode)
+
+Comments:
+spoolhp (IN/OUT) - The pool handle of the session pool to be destroyed.
+errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet().
+mode (IN) - Currently only OCI_DEFAULT mode is supported.
+
+Returns:
+SUCCESS - All the sessions could be closed.
+ERROR - If the above condition is not met.
+
+Related Functions:
+OCISessionPoolCreate()
+-----------------------------------------------------------------------------
+-------------------------------OCISessionGet---------------------------------
+Name:
+OCISessionGet
+
+Purpose:
+Get a session. This could be from a session pool, connection pool or
+a new standalone session.
+
+Syntax:
+sword OCISessionGet(OCIenv *envhp, OCIError *errhp, OCISvcCtx **svchp,
+                    OCIAuthInfo *authhp,
+                    OraText *poolName, ub4 poolName_len,
+                    CONST OraText *tagInfo, ub4 tagInfo_len,
+                    OraText **retTagInfo, ub4 *retTagInfo_len,
+                    boolean *found,
+                    ub4 mode)
+
+Comments:
+envhp (IN/OUT) - OCI environment handle.
+errhp (IN/OUT) - OCI error handle to be passed to OCIErrorGet().
+svchp (IN/OUT) - Address of an OCI service context pointer. This will be
+                 filled with a server and session handle, attached to the
+                 pool.
+authhp (IN/OUT) - OCI Authentication Information handle.
+poolName (IN) - This indicates the session/connection pool to get the
+                session/connection from in the OCI_SPOOL/OCI_CPOOL mode.
+                In the OCI_DEFAULT mode it refers to the connect string.
+poolName_len (IN) - length of poolName.
+tagInfo (IN) - indicates the tag of the session that the user wants. If the
+                   user wants a default session, he must specify a NULL here.
+                   Only used for Session Pooling.
+tagInfo_len (IN) - the length of tagInfo.
+retTagInfo (OUT) - This indicates the type of session that is returned to
+                   the user. Only used for Session Pooling.
+retTagInfo_len (OUT) - the length of retTagInfo.
+found (OUT) - set to true if the user gets a session he had requested, else
+              set to false. Only used for Session Pooling.
+mode (IN) - The supported modes are OCI_DEFAULT, OCI_CRED_PROXY and
+            OCI_GET_SPOOL_MATCHANY, OCI_SPOOL and OCI_CPOOL. OCI_SPOOL and
+            OCI_CPOOL are mutually exclusive.
+
+Returns:
+SUCCESS -  if a session was successfully returned into svchp.
+SUCCESS_WITH_INFO - if a session was successfully returned into svchp and the
+                    total number of sessions > maxsessions. Only valid for
+                    Session Pooling.
+ERROR - If a session could not be retrieved.
+
+Related Functions:
+OCISessionRelease()
+-----------------------------------------------------------------------------
+---------------------------OCISessionRelease---------------------------------
+Name:
+OCISessionRelease
+
+Purpose:
+Release the session.
+
+Syntax:
+sword OCISessionRelease ( OCISvcCtx *svchp, OCIError *errhp,
+                          OraText *tag, ub4 tag_len,
+                          ub4 mode);
+
+Comments:
+svchp (IN/OUT) - The service context associated with the session/connection.
+errhp (IN/OUT) - OCI error handle to be passed to OCIErrorGet().
+tag (IN) - Only used for Session Pooling.
+           This parameter will be ignored unless mode OCI_RLS_SPOOL_RETAG is
+           specified. In this case, the session is labelled with this tag and
+           returned to the pool. If this is NULL, then the session is untagged.
+tag_len (IN) - Length of the tag. This is ignored unless mode 
+               OCI_RLS_SPOOL_RETAG is set.
+mode (IN) - The supported modes are OCI_DEFAULT, OCI_RLS_SPOOL_DROPSESS,
+            OCI_RLS_SPOOL_RETAG. The last 2 are only valid for Session Pooling.
+            When OCI_RLS_SPOOL_DROPSESS is specified, the session
+            will be removed from the session pool. If OCI_RLS_SPOOL_RETAG 
+            is set, the tag on the session will be altered. If this mode is 
+            not set, the tag and tag_len parameters will be ignored.
+
+Returns:
+ERROR - If the session could not be released successfully.
+SUCCESS - In all other cases.
+
+Related Functions:
+OCISessionGet().
+-----------------------------------------------------------------------------
+------------------------------OCIDateTimeAssign --------------------------
+sword OCIDateTimeAssign(dvoid *hndl, OCIError *err, CONST OCIDateTime *from, 
+                        OCIDateTime *to);
+NAME: OCIDateTimeAssign - OCIDateTime Assignment
+PARAMETERS:
+hndl (IN) - Session/Env handle.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+from (IN) - datetime to be assigned
+to (OUT) - lhs of assignment
+DESCRIPTION:
+        Performs date assignment. The type of the output will be same as that
+        of input
+
+------------------------------OCIDateTimeCheck----------------------------
+sword OCIDateTimeCheck(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 
+                 ub4 *valid );
+NAME: OCIDateTimeCheck - OCIDateTime CHecK if the given date is valid
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date (IN) - date to be checked
+valid (OUT) -  returns zero for a valid date, otherwise 
+                the ORed combination of all error bits specified below:
+   Macro name                   Bit number      Error
+   ----------                   ----------      -----
+   OCI_DATE_INVALID_DAY         0x1             Bad day
+   OCI_DATE_DAY_BELOW_VALID     0x2             Bad DAy Low/high bit (1=low)
+   OCI_DATE_INVALID_MONTH       0x4             Bad MOnth
+   OCI_DATE_MONTH_BELOW_VALID   0x8             Bad MOnth Low/high bit (1=low)
+   OCI_DATE_INVALID_YEAR        0x10            Bad YeaR
+   OCI_DATE_YEAR_BELOW_VALID    0x20            Bad YeaR Low/high bit (1=low)
+   OCI_DATE_INVALID_HOUR        0x40            Bad HouR
+   OCI_DATE_HOUR_BELOW_VALID    0x80            Bad HouR Low/high bit (1=low)
+   OCI_DATE_INVALID_MINUTE      0x100           Bad MiNute
+   OCI_DATE_MINUTE_BELOW_VALID  0x200           Bad MiNute Low/high bit (1=low)
+   OCI_DATE_INVALID_SECOND      0x400           Bad SeCond
+   OCI_DATE_SECOND_BELOW_VALID  0x800           bad second Low/high bit (1=low)
+   OCI_DATE_DAY_MISSING_FROM_1582 0x1000        Day is one of those "missing"
+                                                from 1582
+   OCI_DATE_YEAR_ZERO           0x2000          Year may not equal zero
+   OCI_DATE_INVALID_TIMEZONE    0x4000          Bad Timezone
+   OCI_DATE_INVALID_FORMAT      0x8000          Bad date format input
+
+   So, for example, if the date passed in was 2/0/1990 25:61:10 in
+   (month/day/year hours:minutes:seconds format), the error returned
+   would be OCI_DATE_INVALID_DAY | OCI_DATE_DAY_BELOW_VALID |
+   OCI_DATE_INVALID_HOUR | OCI_DATE_INVALID_MINUTE
+
+DESCRIPTION:
+        Check if the given date is valid.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          'date' and 'valid' pointers are NULL pointers
+
+------------------------------- OCIDateTimeCompare----------------------------
+sword OCIDateTimeCompare(dvoid *hndl, OCIError *err, CONST OCIDateTime *date1, 
+                     CONST OCIDateTime *date2,  sword *result );
+NAME: OCIDateTimeCompare - OCIDateTime CoMPare dates
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date1, date2 (IN) - dates to be compared
+result (OUT) - comparison result, 0 if equal, -1 if date1 < date2, 
+                1 if date1 > date2
+DESCRIPTION:
+The function OCIDateCompare compares two dates. It returns -1 if 
+date1 is smaller than date2, 0 if they are equal, and 1 if date1 is 
+greater than date2.
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          invalid date
+          input dates are not mutually comparable
+
+------------------------------OCIDateTimeConvert----------------------
+sword OCIDateTimeConvert(dvoid *hndl, OCIError *err, OCIDateTime *indate, 
+                                OCIDateTime *outdate);
+NAME: OCIDateTimeConvert - Conversion between different DATETIME types
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+indate (IN) - pointer to input date
+outdate (OUT) - pointer to output datetime 
+DESCRIPTION: Converts one datetime type to another. The result type is
+       the type of the 'outdate' descriptor.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+            conversion not possible.
+   
+---------------------------- OCIDateTimeFromText-----------------------
+sword OCIDateTimeFromText(dvoid *hndl, OCIError *err, CONST OraText *date_str, 
+             size_t d_str_length, CONST OraText *fmt, ub1 fmt_length,
+             CONST OraText *lang_name, size_t lang_length, OCIDateTime *date );
+NAME: OCIDateTimeFromText - OCIDateTime convert String FROM Date
+PARAMETERS:
+hndl (IN) - Session/Env handle. If Session Handle is passed, the 
+                    conversion takes place in session NLS_LANGUAGE and
+                    session NLS_CALENDAR, otherwise the default is used.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date_str (IN) - input string to be converted to Oracle date
+d_str_length (IN) - size of the input string, if the length is -1
+                then 'date_str' is treated as a null terminated  string
+fmt (IN) - conversion format; if 'fmt' is a null pointer, then
+                the string is expected to be in the default format for
+                the datetime type.
+fmt_length (IN) - length of the 'fmt' parameter
+lang_name (IN) - language in which the names and abbreviations of
+                days and months are specified, if null i.e. (OraText *)0,
+                the default language of session is used, 
+lang_length (IN) - length of the 'lang_name' parameter
+date (OUT) - given string converted to date
+DESCRIPTION:
+        Converts the given string to Oracle datetime type set in the 
+        OCIDateTime descriptor according to the specified format. Refer to 
+        "TO_DATE" conversion function described in "Oracle SQL Language 
+        Reference Manual" for a description of format.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          invalid format
+          unknown language
+          invalid input string
+
+--------------------------- OCIDateTimeGetDate-------------------------
+sword OCIDateTimeGetDate(dvoid *hndl, OCIError *err,  CONST OCIDateTime *date, 
+                           sb2 *year, ub1 *month, ub1 *day );
+NAME: OCIDateTimeGetDate - OCIDateTime Get Date (year, month, day)  
+                                portion of DATETIME. 
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - Pointer to OCIDateTime 
+year      (OUT) - year value
+month     (OUT) - month value
+day       (OUT) - day value
+
+--------------------------- OCIDateTimeGetTime ------------------------
+sword OCIDateTimeGetTime(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+                 ub1 *hour, ub1 *minute, ub1 *sec, ub4 *fsec);
+NAME: OCIDateTimeGetTime - OCIDateTime Get Time (hour, min, second, 
+                        fractional second)  of DATETIME. 
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - Pointer to OCIDateTime 
+hour      (OUT) - hour value
+minute       (OUT) - minute value
+sec       (OUT) - second value
+fsec      (OUT) - Fractional Second value
+
+--------------------------- OCIDateTimeGetTimeZoneOffset ----------------------
+sword OCIDateTimeGetTimeZoneOffset(dvoid *hndl,OCIError *err,CONST 
+              OCIDateTime *datetime,sb1 *hour,sb1  *minute);
+
+NAME: OCIDateTimeGetTimeZoneOffset - OCIDateTime Get TimeZone (hour, minute)  
+                         portion of DATETIME. 
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - Pointer to OCIDateTime 
+hour      (OUT) - TimeZone Hour value
+minute     (OUT) - TimeZone Minute value
+
+--------------------------- OCIDateTimeSysTimeStamp---------------------
+sword OCIDateTimeSysTimeStamp(dvoid *hndl, OCIError *err, 
+              OCIDateTime *sys_date );
+ 
+NAME: OCIDateTimeSysTimeStamp - Returns system date/time as a TimeStamp with 
+                      timezone
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+sys_date (OUT) - Pointer to output timestamp
+ 
+DESCRIPTION: 
+        Gets the system current date and time as a timestamp with timezone
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+------------------------------OCIDateTimeIntervalAdd----------------------
+sword OCIDateTimeIntervalAdd(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+         OCIInterval *inter, OCIDateTime *outdatetime);
+NAME: OCIDateTimeIntervalAdd - Adds an interval to datetime
+PARAMETERS:
+hndl (IN) - Session/Env handle.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - pointer to input datetime
+inter    (IN) - pointer to interval 
+outdatetime (IN) - pointer to output datetime. The output datetime 
+                                will be of same type as input datetime
+DESCRIPTION: 
+        Adds an interval to a datetime to produce a resulting datetime
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if:
+                resulting date is before Jan 1, -4713
+                resulting date is after Dec 31, 9999
+
+------------------------------OCIDateTimeIntervalSub----------------------
+sword OCIDateTimeIntervalSub(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+              OCIInterval *inter, OCIDateTime *outdatetime);
+NAME: OCIDateTimeIntervalSub - Subtracts an interval from a datetime
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - pointer to input datetime
+inter    (IN) - pointer to interval 
+outdatetime (IN) - pointer to output datetime. The output datetime 
+                                will be of same type as input datetime
+DESCRIPTION: 
+        Subtracts an interval from a datetime and stores the result in a
+        datetime
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if:
+                resulting date is before Jan 1, -4713
+                resulting date is after Dec 31, 9999
+
+--------------------------- OCIDateTimeConstruct-------------------------
+sword OCIDateTimeConstruct(dvoid  *hndl,OCIError *err,OCIDateTime *datetime,
+               sb2 year,ub1 month,ub1 day,ub1 hour,ub1 min,ub1 sec,ub4 fsec,
+               OraText  *timezone,size_t timezone_length);
+
+NAME: OCIDateTimeConstruct - Construct an OCIDateTime. Only the relevant
+       fields for the OCIDateTime descriptor types are used.
+PARAMETERS:
+        hndl (IN) - Session/Env handle. 
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        datetime (IN) - Pointer to OCIDateTime 
+        year      (IN) - year value
+        month     (IN) - month value
+        day       (IN) - day value        
+        hour      (IN) - hour value
+        min       (IN) - minute value
+        sec       (IN) - second value
+        fsec      (IN) - Fractional Second value
+        timezone  (IN) - Timezone string
+        timezone_length(IN) - Length of timezone string
+
+DESCRIPTION:
+       Constructs a DateTime descriptor. The type of the datetime is the
+       type of the OCIDateTime descriptor. Only the relevant fields based
+       on the type are used. For Types with timezone, the date and time
+       fields are assumed to be in the local time of the specified timezone.
+       If timezone is not specified, then session default timezone is
+       assumed.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_ERROR if datetime is not valid.
+
+------------------------------OCIDateTimeSubtract-----------------------
+sword OCIDateTimeSubtract(dvoid *hndl, OCIError *err, OCIDateTime *indate1, 
+                OCIDateTime *indate2, OCIInterval *inter);
+NAME: OCIDateTimeSubtract - subtracts two datetimes to return an interval
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+indate1(IN) - pointer to subtrahend
+indate2(IN) - pointer to minuend
+inter  (OUT) - pointer to output interval
+DESCRIPTION: 
+        Takes two datetimes as input and stores their difference in an 
+        interval. The type of the interval is the type of the 'inter'
+        descriptor.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+           datetimes are not comparable.
+
+--------------------------- OCIDateTimeToText--------------------------
+sword OCIDateTimeToText(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 
+                        CONST OraText *fmt, ub1 fmt_length, ub1 fsprec, 
+                        CONST OraText *lang_name, size_t lang_length, 
+                        ub4 *buf_size, OraText *buf );
+NAME: OCIDateTimeToText - OCIDateTime convert date TO String 
+PARAMETERS:
+hndl (IN) - Session/Env handle. If Session Handle is passed, the 
+                    conversion takes place in session NLS_LANGUAGE and
+                    session NLS_CALENDAR, otherwise the default is used.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date (IN) - Oracle datetime to be converted
+fmt (IN) - conversion format, if null string pointer (OraText*)0, then
+                the date is converted to a character string in the
+                default format for that type.
+fmt_length (IN) - length of the 'fmt' parameter
+fsprec (IN) - specifies the fractional second precision in which the
+               fractional seconds is returned.
+lang_name (IN) - specifies the language in which the names and 
+                abbreviations of months and days are returned;
+                default language of session is used if 'lang_name' 
+                is null i.e. (OraText *)0
+lang_length (IN) - length of the 'nls_params' parameter
+buf_size (IN/OUT) - size of the buffer; size of the resulting string
+                is returned via this parameter
+buf (OUT) - buffer into which the converted string is placed
+DESCRIPTION:
+        Converts the given date to a string according to the specified format.
+        Refer to "TO_DATE" conversion function described in
+        "Oracle SQL Language Reference Manual" for a description of format
+        and NLS arguments. The converted null-terminated date string is
+        stored in the buffer 'buf'.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          buffer too small
+          invalid format
+          unknown language
+          overflow error
+
+----------------------------OCIDateTimeGetTimeZoneName------------------------
+sword OCIDateTimeGetTimeZoneName(dvoid *hndl, 
+                                 OCIError *err,
+                                 CONST OCIDateTime *datetime,
+                                 ub1 *buf,
+                                 ub4 *buflen);
+NAME OCIDateTimeGetTimeZoneName - OCI DateTime Get the Time Zone Name
+PARAMETERS:
+hndl (IN)      - Session/Env handle.
+err (IN/OUT)   - error handle. If there is an error, it is
+                 recorded in 'err' and this function returns OCI_ERROR.
+                 The error recorded in 'err' can be retrieved by calling
+                 OCIErrorGet().
+datetime (IN)   - Pointer to an OCIDateTime.
+buf (OUT)       - User allocated storage for name string.
+buflen (IN/OUT) - length of buf on input, length of name on out
+DESCRIPTION:
+        Returns either the timezone region name or the absolute hour and minute
+        offset. If the DateTime was created with a region id then the region 
+        name will be returned in the buf.  If the region id is zero, then the 
+        hour and minute offset is returned as "[-]HH:MM".
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+       OCI_INVALID_HANDLE if 'err' is NULL.
+       OCI_ERROR if
+         buffer too small
+         error retrieving timezone data
+         invalid region 
+         invalid LdiDateTime type
+
+---------------------------------OCIDateTimeToArray----------------------------
+sword OCIDateTimeToArray(dvoid *hndl, 
+                         OCIError *err,
+                         CONST OCIDateTime *datetime,
+                         CONST OCIInterval *reftz,
+                         ub1 *outarray,
+                         ub4 *len
+                         ub1 *fsprec);
+NAME OCIDateTimeToArray - OCI DateTime convert To Array format
+PARAMETERS:
+hndl (IN)      - Session/Env handle.
+err (IN/OUT)   - error handle. If there is an error, it is
+                 recorded in 'err' and this function returns OCI_ERROR.
+                 The error recorded in 'err' can be retrieved by calling
+                 OCIErrorGet().
+datetime (IN)   - Pointer to OCIDateTime to be converted.
+outarray (OUT)  - Result array storage
+len (OUT)        - pointer to  length of outarray.
+fsprec (IN)     - Number of fractional seconds digits.
+DESCRIPTION:
+        Returns an array representing the input DateTime descriptor.
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+       OCI_INVALID_HANDLE if 'err' is NULL.
+       OCI_ERROR if
+         buffer too small
+         error retrieving timezone data
+         invalid region 
+         invalid LdiDateTime type
+
+--------------------------------OCIDateTimeFromArray---------------------------
+sword OCIDateTimeFromArray(dvoid *hndl, 
+                         OCIError *err,
+                         ub1 *inarray,
+                         ub4 len
+                         ub1 type
+                         OCIDateTime *datetime,
+                         OCIInterval *reftz,
+                         ub1 fsprec);
+NAME OCIDateTimeFromArray - OCI DateTime convert From Array format
+PARAMETERS:
+hndl (IN)      - Session/Env handle.
+err (IN/OUT)   - error handle. If there is an error, it is
+                 recorded in 'err' and this function returns OCI_ERROR.
+                 The error recorded in 'err' can be retrieved by calling
+                 OCIErrorGet().
+inarray (IN)   - Pointer to input array representtion of DateTime
+len (IN)       - len of inarray.
+type (IN)      - One of SQLT_DATE, SQLT_TIME, SQLT_TIME_TZ, SQLT_TIMESTAMP,
+                 SQLT_TIMESTAMP_TZ, or SQLT_TIMESTAMP_LTZ.
+datetime (OUT) - Pointer to the result OCIDateTime.
+reftz (IN)     - timezone interval used with SQLT_TIMESTAMP_LTZ.
+fsprec (IN)    - fractionl seconds digits of precision (0-9).
+DESCRIPTION:
+        Returns a pointer to an OCIDateTime of type type converted from 
+        the inarray.
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+       OCI_INVALID_HANDLE if 'err' is NULL.
+       OCI_ERROR if
+         buffer too small
+         error retrieving timezone data
+         invalid region 
+         invalid LdiDateTime type
+
+----------------------------------OCIRowidToChar-----------------------------
+Name
+OCIRowidToChar
+
+Purpose
+Converts physical/logical (universal) ROWID to chracter extended (Base 64) 
+representation into user provided buffer outbfp of length outbflp. After 
+execution outbflp contains amount of bytes converted.In case of truncation 
+error, outbflp contains required size to make this conversion successful
+and returns ORA-1405.
+
+Syntax
+sword OCIRowidToChar( OCIRowid *rowidDesc, 
+                      OraText *outbfp, 
+                      ub2 *outbflp, 
+                      OCIError *errhp)
+
+Comments
+After this conversion, ROWID in character format can be bound using
+OCIBindByPos or OCIBindByName call and used to query a row at a
+desired ROWID. 
+
+Parameters
+rowidDesc (IN)   - rowid DESCriptor which is allocated from OCIDescritorAlloc
+                   and populated by a prior SQL statement execution
+outbfp (OUT)     - pointer to the buffer where converted rowid in character 
+                   representation is stored after successful execution.
+outbflp (IN/OUT) - pointer to output buffer length variable.
+                   Before execution (IN mode) *outbflp contains the size of
+                   outbfp, after execution (OUT mode) *outbflp contains amount
+                   of bytes converted. In an event of truncation during 
+                   conversion *outbflp contains the required length to make
+                   conversion successful.
+errhp (IN/OUT)   - an error handle which can be passed to OCIErrorGet() for
+                   diagnostic information in the event of an error.
+
+------------------------------OCIDefineArrayOfStruct--------------------------
+
+
+OCIDefineArrayOfStruct()
+Name
+OCI Define for Array of Structures
+Purpose
+This call specifies additional attributes necessary for a static array define.
+Syntax
+sword OCIDefineArrayOfStruct ( OCIDefine   *defnp,
+                             OCIError    *errhp,
+                             ub4         pvskip, 
+                             ub4         indskip, 
+                             ub4         rlskip,
+                             ub4         rcskip );
+Comments
+This call specifies additional attributes necessary for an array define, 
+used in an array of structures (multi-row, multi-column) fetch.
+For more information about skip parameters, see the section "Skip Parameters" 
+on page 4-17.
+Parameters
+defnp (IN) - the handle to the define structure which was returned by a call 
+to OCIDefineByPos().
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+pvskip (IN) - skip parameter for the next data value.
+indskip (IN) - skip parameter for the next indicator location. 
+rlskip (IN) - skip parameter for the next return length value.
+rcskip (IN) - skip parameter for the next return code.
+Related Functions
+OCIAttrGet()
+
+
+
+
+
+OCIDefineByPos()
+Name
+OCI Define By Position
+Purpose
+Associates an item in a select-list with the type and output data buffer. 
+Syntax
+sb4 OCIDefineByPos ( 
+              OCIStmt     *stmtp, 
+              OCIDefine   **defnp,
+              OCIError    *errhp,
+              ub4         position,
+              dvoid       *valuep,
+              sb4         value_sz,
+              ub2         dty,
+              dvoid       *indp,
+              ub2         *rlenp,
+              ub2         *rcodep,
+              ub4         mode );
+Comments
+This call defines an output buffer which will receive data retreived from 
+Oracle. The define is a local step which is necessary when a SELECT statement 
+returns data to your OCI application.
+This call also implicitly allocates the define handle for the select-list item.
+Defining attributes of a column for a fetch is done in one or more calls. The 
+first call is to OCIDefineByPos(), which defines the minimal attributes 
+required to specify the fetch. 
+This call takes as a parameter a define handle, which must have been 
+previously allocated with a call to OCIHandleAlloc().
+Following the call to OCIDefineByPos() additional define calls may be 
+necessary for certain data types or fetch modes:
+A call to OCIDefineArrayOfStruct() is necessary to set up skip parameters 
+for an array fetch of multiple columns.
+A call to OCIDefineObject() is necessary to set up the appropriate 
+attributes of a named data type fetch. In this case the data buffer pointer 
+in ocidefn() is ignored.
+Both OCIDefineArrayOfStruct() and OCIDefineObject() must be called 
+after ocidefn() in order to fetch multiple rows with a column of named 
+data types.
+For a LOB define, the buffer pointer must be a lob locator of type 
+OCILobLocator , allocated by the OCIDescAlloc() call. LOB locators, and not 
+LOB values, are always returned for a LOB column. LOB values can then be 
+fetched using OCI LOB calls on the fetched locator.
+For NCHAR (fixed and varying length), the buffer pointer must point to an 
+array of bytes sufficient for holding the required NCHAR characters. 
+Nested table columns are defined and fetched like any other named data type. 
+If the mode parameter is this call is set to OCI_DYNAMIC_FETCH, the client 
+application can fetch data dynamically at runtime.
+Runtime data can be provided in one of two ways:
+callbacks using a user-defined function which must be registered with a 
+subsequent call to OCIDefineDynamic(). When the client library needs a 
+buffer to return the fetched data, the callback will be invoked and the 
+runtime buffers provided will return a piece or the whole data. 
+a polling mechanism using calls supplied by the OCI. This mode is 
+assumed if no callbacks are defined. In this case, the fetch call returns the 
+OCI_NEED_DATA error code, and a piecewise polling method is used 
+to provide the data.
+Related Functions: For more information about using the 
+OCI_DYNAMIC_FETCH mode, see the section "Runtime Data 
+Allocation and Piecewise Operations" on page 5-16 of Volume 1..
+For more information about the define step, see the section "Defining" 
+on page 2-30.
+Parameters
+stmtp (IN) - a handle to the requested SQL query operation.
+defnp (IN/OUT) - a pointer to a pointer to a define handle which is implicitly 
+allocated by this call.  This handle is used to  store the define information 
+for this column.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+position (IN) - the position of this value in the select list. Positions are 
+1-based and are numbered from left to right. For example, in the SELECT 
+statement
+SELECT empno, ssn, mgrno FROM employees;
+empno is at position 1, ssn is at position 2, and mgrno is at position 3.
+valuep (IN/OUT) - a pointer to a buffer or an array of buffers of the type 
+specified in the dty parameter. A number of buffers can be specified when 
+results for more than one row are desired in a single fetch call.
+value_sz (IN) - the size of each valuep buffer in bytes. If the data is stored 
+internally in VARCHAR2 format, the number of characters desired, if different 
+from the buffer size in bytes, may be additionally specified by the using 
+OCIAttrSet(). 
+In an NLS conversion environment, a truncation error will be generated if the 
+number of bytes specified is insufficient to handle the number of characters 
+desired.
+dty (IN) - the data type. Named data type (SQLT_NTY) and REF (SQLT_REF) 
+are valid only if the environment has been intialized with in object mode. 
+indp - pointer to an indicator variable or array. For scalar data types, 
+pointer to sb2 or an array of sb2s. Ignored for named data types. For named 
+data types, a pointer to a named data type indicator structure or an array of 
+named data type indicator structures is associated by a subsequent 
+OCIDefineObject() call. 
+See the section "Indicator Variables" on page 2-43 for more information about 
+indicator variables.
+rlenp (IN/OUT) - pointer to array of length of data fetched. Each element in 
+rlenp is the length of the data in the corresponding element in the row after 
+the fetch. 
+rcodep (OUT) - pointer to array of column-level return codes
+mode (IN) - the valid modes are:
+OCI_DEFAULT. This is the default mode.
+OCI_DYNAMIC_FETCH. For applications requiring dynamically 
+allocated data at the time of fetch, this mode must be used. The user may 
+additionally call OCIDefineDynamic() to set up a callback function that 
+will be invoked to receive the dynamically allocated buffers and to set 
+up the memory allocate/free callbacks and the context for the callbacks. 
+valuep and value_sz are ignored in this mode. 
+Related Functions
+OCIDefineArrayOfStruct(), OCIDefineDynamic(), OCIDefineObject()
+
+
+
+
+OCIDefineDynamic()
+Name
+OCI Define Dynamic Fetch Attributes
+Purpose
+This call is used to set the additional attributes required if the 
+OCI_DYNAMIC_FETCH mode was selected in OCIDefineByPos(). 
+Syntax
+sword OCIDefineDynamic( OCIDefine   *defnp,
+                      OCIError    *errhp,
+                      dvoid       *octxp, 
+                      OCICallbackDefine (ocbfp)(
+                                  dvoid             *octxp,
+                                  OCIDefine         *defnp,
+                                  ub4               iter, 
+                                  dvoid             **bufpp,
+                                  ub4               **alenpp,
+                                  ub1               *piecep,
+                                  dvoid             **indpp,
+                                  ub2               **rcodep)  );
+Comments
+This call is used to set the additional attributes required if the 
+OCI_DYNAMIC_FETCH mode has been selected in a call to 
+OCIDefineByPos(). 
+When the OCI_DYNAMIC_FETCH mode is selected, buffers will be 
+dynamically allocated for REF, and named data type, values to receive the 
+data. The pointers to these buffers will be returned. 
+If OCI_DYNAMIC_FETCH mode was selected, and the call to 
+OCIDefineDynamic() is skipped, then the application can fetch data piecewise 
+using OCI calls.
+For more information about OCI_DYNAMIC_FETCH mode, see the section 
+"Runtime Data Allocation and Piecewise Operations" on page 5-16.
+Parameters
+defnp (IN/OUT) - the handle to a define structure returned by a call to 
+OCIDefineByPos().
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+octxp (IN) - points to a context for the callback function. 
+ocbfp (IN) - points to a callback function. This is invoked at runtime to get 
+a pointer to the buffer into which the fetched data or a piece of it will be 
+retreived. The callback also specifies the indicator, the return code and the 
+lengths of the data piece and indicator. The callback has the following 
+parameters:
+octxp (IN) - a context pointer passed as an argument to all the callback 
+functions.
+defnp (IN) - the define handle.
+iter (IN) - which row of this current fetch.
+bufpp (OUT) - returns a pointer to a buffer to store the column value, ie. 
+*bufp points to some appropriate storage for the column value.
+alenpp (OUT) - returns a pointer to the length of the buffer. *alenpp 
+contains the size of the buffer after return from callback. Gets set to 
+actual data size after fetch.
+piecep (IN/OUT) - returns a piece value, as follows:
+The IN value can be OCI_ONE_PIECE, OCI_FIRST_PIECE or 
+OCI_NEXT_PIECE.
+The OUT value can be OCI_ONE_PIECE if the IN value was 
+OCI_ONE_PIECE.
+The OUT value can be OCI_ONE_PIECE or OCI_FIRST_PIECE if 
+the IN value was OCI_FIRST_PIECE.
+The OUT value can only be OCI_NEXT_PIECE or 
+OCI_LAST_PIECE if the IN value was OCI_NEXT_PIECE. 
+indpp (IN) - indicator variable pointer
+rcodep (IN) - return code variable pointer
+Related Functions
+OCIAttrGet()
+OCIDefineObject()
+
+
+
+
+OCIDefineObject()
+Name
+OCI Define Named Data Type attributes
+Purpose
+Sets up additional attributes necessary for a Named Data Type define.
+Syntax
+sword OCIDefineObject ( OCIDefine       *defnp,
+                      OCIError        *errhp,
+                      CONST OCIType   *type,
+                      dvoid           **pgvpp, 
+                      ub4             *pvszsp, 
+                      dvoid           **indpp, 
+                      ub4             *indszp );
+Comments
+This call sets up additional attributes necessary for a Named Data Type define.
+An error will be returned if this function is called when the OCI environment 
+has been initialized in non-Object mode.
+This call takes as a paramter a type descriptor object (TDO) of datatype 
+OCIType for the named data type being defined.  The TDO can be retrieved 
+with a call to OCITypeByName().
+See the description of OCIInitialize() on page 13 - 43 for more information 
+about initializing the OCI process environment.
+Parameters
+defnp (IN/OUT) - a define handle previously allocated in a call to 
+OCIDefineByPos(). 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+type (IN, optional) - points to the Type Descriptor Object (TDO) which 
+describes the type of the program variable. Only used for program variables 
+of type SQLT_NTY. This parameter is optional, and may be passed as NULL 
+if it is not being used.
+pgvpp (IN/OUT) - points to a pointer to a program variable buffer. For an 
+array, pgvpp points to an array of pointers. Memory for the fetched named data 
+type instance(s) is dynamically allocated in the object cache. At the end of 
+the fetch when all the values have been received, pgvpp points to the 
+pointer(s) to these newly allocated named data type instance(s). The 
+application must call OCIObjectMarkDel() to deallocate the named data type 
+instance(s) when they are no longer needed. 
+pvszsp (IN/OUT) - points to the size of the program variable. For an array, it 
+is an array of ub4s. On return points to the size(s) of unpickled fetched 
+values.
+indpp (IN/OUT) - points to a pointer to the program variable buffer 
+containing the parallel indicator structure. For an array, points to an array 
+of pointers. Memory is allocated to store the indicator structures in the 
+object cache. At the end of the fetch when all values have been received, 
+indpp points to the pointer(s) to these newly allocated indicator structure(s).
+indszp (IN/OUT) - points to the size(s) of the indicator structure program 
+variable. For an array, it is an array of ub4s. On return points to the size(s)
+of the unpickled fetched indicator values.
+Related Functions
+OCIAttrGet()
+
+
+
+OCIDescAlloc()
+Name
+OCI Get DESCriptor or lob locator
+Purpose
+Allocates storage to hold certain data types. The descriptors can be used as 
+bind or define variables.
+Syntax
+sword OCIDescAlloc ( CONST dvoid   *parenth,
+                   dvoid         **descpp, 
+                   ub4           type,
+                   size_t        xtramem_sz,
+                   dvoid         **usrmempp);
+Comments
+Returns a pointer to an allocated and initialized structure, corresponding to 
+the type specified in type. A non-NULL descriptor or LOB locator is returned 
+on success. No diagnostics are available on error.
+This call returns OCI_SUCCESS if successful, or OCI_INVALID_HANDLE if 
+an out-of-memory error occurs. 
+Parameters
+parenth (IN) - an environment handle. 
+descpp (OUT) - returns a descriptor or LOB locator of desired type. 
+type (IN) - specifies the type of descriptor or LOB locator to be allocated. 
+The specific types are:
+OCI_DTYPE_SNAP - specifies generation of snapshot descriptor of C 
+type - OCISnapshot
+OCI_DTYPE_LOB - specifies generation of a LOB data type locator of C 
+type - OCILobLocator
+OCI_DTYPE_RSET - specifies generation of a descriptor of C type 
+OCIResult that references a result set (a number of rows as a result of a 
+query). This descriptor is bound to a bind variable of data type 
+SQLT_RSET (result set). The descriptor has to be converted into a 
+statement handle using a function - OCIResultSetToStmt() - which can 
+then be passed to OCIDefineByPos() and OCIStmtFetch() to retrieve the 
+rows of the result set.
+OCI_DTYPE_ROWID - specifies generation of a ROWID descriptor of C 
+type OCIRowid.
+OCI_DTYPE_COMPLEXOBJECTCOMP - specifies generation of a 
+complex object retrieval descriptor of C type 
+OCIComplexObjectComp.
+xtramemsz (IN) - specifies an amount of user memory to be allocated for use 
+by the application. 
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user. 
+Related Functions
+OCIDescFree()
+
+
+
+
+OCIDescFree()
+Name
+OCI Free DESCriptor
+Purpose
+Deallocates a previously allocated descriptor.
+Syntax
+sword OCIDescFree ( dvoid    *descp,
+                  ub4      type);
+Comments
+This call frees up storage associated with the descriptor, corresponding to the
+type specified in type. Returns OCI_SUCCESS or OCI_INVALID_HANDLE. 
+All descriptors must be explicitly deallocated. OCI will not deallocate a 
+descriptor if the environment handle is deallocated.
+Parameters
+descp (IN) - an allocated descriptor. 
+type (IN) - specifies the type of storage to be freed. The specific types are: 
+OCI_DTYPE_SNAP - snapshot descriptor
+OCI_DTYPE_LOB - a LOB data type descriptor
+OCI_DTYPE_RSET - a descriptor that references a result set (a number 
+of rows as a result of a query).
+OCI_DTYPE_ROWID - a ROWID descriptor
+OCI_DTYPE_COMPLEXOBJECTCOMP - a complex object retrieval 
+descriptor
+Related Functions
+OCIDescAlloc()
+
+
+
+OCIDescribeAny()
+Name
+OCI DeSCribe Any
+Purpose
+Describes existing schema objects.
+Syntax
+sword OCIDescribeAny ( OCISvcCtx     *svchp,
+                     OCIError      *errhp,
+                     dvoid         *objptr,
+                     ub4           objnm_len,
+                     ub1           objptr_typ,
+                     ub1           info_level,
+                     ub1           objtype,
+                     OCIDesc       *dschp );
+Comments
+This is a generic describe call that describes existing schema objects: tables,
+views, synonyms, procedures, functions, packages, sequences, and types. As a 
+result of this call, the describe handle is populated with the object-specific 
+attributes which can be obtained through an OCIAttrGet() call.
+An OCIParamGet() on the describe handle returns a parameter descriptor for a 
+specified position. Parameter positions begin with 1. Calling OCIAttrGet() on 
+the parameter descriptor returns the specific attributes of a stored procedure 
+or function parameter or a table column descriptor as the case may be. 
+These subsequent calls do not need an extra round trip to the server because 
+the entire schema object description cached on the client side by 
+OCIDescribeAny(). Calling OCIAttrGet() on the describe handle can also return 
+the total number of positions.
+See the section "Describing" on page 2-33 for more information about describe 
+operations.
+Parameters
+TO BE UPDATED
+svchp (IN/OUT) - a service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+objptr (IN) - the name of the object (a null-terminated string) to be 
+described. Only procedure or function names are valid when connected to an 
+Oracle7 Server.
+objptr_len (IN) - the length of the string. Must be non-zero.
+objptr_typ (IN) - Must be OCI_OTYPE_NAME, OCI_OTYPE_REF, or OCI_OTYPE_PTR.
+info_level (IN) - reserved for future extensions. Pass OCI_DEFAULT.
+objtype (IN/OUT) - object type.
+dschp (IN/OUT) - a describe handle that is populated with describe 
+information about the object after the call.
+Related Functions
+OCIAttrGet()
+
+
+
+OCIEnvCreate()
+Name
+OCI ENVironment CREATE
+Purpose
+This function creates and initializes an environment for the rest of
+the OCI functions to work under.  This call is a replacement for both
+the OCIInitialize and OCIEnvInit calls.
+Syntax
+sword OCIEnvCreate  ( OCIEnv        **envhpp, 
+                      ub4           mode, 
+                      CONST dvoid   *ctxp, 
+                      CONST dvoid   *(*malocfp) 
+                                    (dvoid *ctxp, 
+                                        size_t size), 
+                      CONST dvoid   *(*ralocfp) 
+                                    (dvoid *ctxp, 
+                                       dvoid *memptr, 
+                                       size_t newsize), 
+                      CONST void    (*mfreefp) 
+                                    ( dvoid *ctxp, 
+                                       dvoid *memptr))
+                      size_t    xtramemsz,
+                      dvoid     **usrmempp );
+ 
+Comments
+This call creates an environment for all the OCI calls using the modes
+specified by the user. This call can be used instead of the two calls
+OCIInitialize and OCIEnvInit. This function returns an environment handle
+which is then used by the remaining OCI functions. There can be multiple
+environments in OCI each with its own environment modes.  This function 
+also performs any process level initialization if required by any mode.
+For example if the user wants to initialize an environment as OCI_THREADED,
+then all libraries that are used by OCI are also initialized in the
+threaded mode. 
+
+This call should be invoked before anny other OCI call and should be used
+instead of the OCIInitialize and OCIEnvInit calls. This is the recommended
+call, although OCIInitialize and OCIEnvInit calls will still be supported
+for backward compatibility. 
+ 
+envpp (OUT) - a pointer to a handle to the environment. 
+mode (IN) - specifies initialization of the mode. The valid modes are:
+OCI_DEFAULT - default mode.
+OCI_THREADED - threaded environment. In this mode, internal data 
+structures are protected from concurrent accesses by multiple threads. 
+OCI_OBJECT - will use navigational object interface. 
+ctxp (IN) - user defined context for the memory call back routines. 
+malocfp (IN) - user-defined memory allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory allocation function.
+size - size of memory to be allocated by the user-defined memory 
+allocation function
+ralocfp (IN) - user-defined memory re-allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory reallocation 
+function.
+memp - pointer to memory block
+newsize - new size of memory to be allocated
+mfreefp (IN) - user-defined memory free function. If mode is 
+OCI_THREADED, this memory free routine must be thread safe.
+ctxp - context pointer for the user-defined memory free function.
+memptr - pointer to memory to be freed
+xtramemsz (IN) - specifies the amount of user memory to be allocated. 
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user.
+
+Example
+
+Related Functions
+OCIInitialize, OCIEnvInit
+
+OCIEnvNlsCreate()
+Name
+OCI ENVironment CREATE with NLS info
+Purpose
+This function does almost everything OCIEnvCreate does, plus enabling setting
+of charset and ncharset programmatically, except OCI_UTF16 mode.
+Syntax
+sword OCIEnvNlsCreate(OCIEnv        **envhpp,
+                      ub4           mode,
+                      dvoid         *ctxp,
+                      dvoid         *(*malocfp)
+                                    (dvoid *ctxp,
+                                        size_t size),
+                      dvoid         *(*ralocfp)
+                                    (dvoid *ctxp,
+                                       dvoid *memptr,
+                                       size_t newsize),
+                      void          (*mfreefp)
+                                    (dvoid *ctxp,
+                                       dvoid *memptr),
+                      size_t        xtramemsz,
+                      dvoid         **usrmempp,
+                      ub2           charset,
+                      ub2           ncharset)
+Comments
+The charset and ncharset must be both zero or non-zero.
+The parameters have the same meaning as the ones in OCIEnvCreate().
+When charset or ncharset is non-zero, the corresponding character set will
+be used to replace the ones specified in NLS_LANG or NLS_NCHAR. Moreover,
+OCI_UTF16ID is allowed to be set as charset and ncharset.
+On the other hand, OCI_UTF16 mode is deprecated with this function. 
+Applications can achieve the same effects by setting 
+both charset and ncharset as OCI_UTF16ID.
+
+
+OCIEnvInit()
+Name
+OCI INITialize environment
+Purpose
+This call initializes the OCI environment handle.
+Syntax
+sword OCIEnvInit ( OCIEnv    **envp,
+                 ub4       mode,
+                 size_t    xtramemsz,
+                 dvoid     **usrmempp );
+Comments
+Initializes the OCI environment handle. No changes are done on an initialized 
+handle. If OCI_ERROR or OCI_SUCCESS_WITH_INFO is returned, the 
+environment handle can be used to obtain ORACLE specific errors and 
+diagnostics.
+This call is processed locally, without a server round-trip.
+Parameters
+envpp (OUT) - a pointer to a handle to the environment. 
+mode (IN) - specifies initialization of an environment mode. The only valid 
+mode is OCI_DEFAULT for default mode
+xtramemsz (IN) - specifies the amount of user memory to be allocated. 
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user.
+Example
+See the description of OCISessionBegin() on page 13-84 for an example showing 
+the use of OCIEnvInit(). 
+Related Functions
+
+
+
+
+OCIErrorGet()
+Name
+OCI Get Diagnostic Record
+Purpose
+Returns an error message in the buffer provided and an ORACLE error.
+Syntax
+sword OCIErrorGet ( dvoid      *hndlp, 
+                  ub4        recordno,
+                  OraText       *sqlstate,
+                  ub4        *errcodep, 
+                  OraText       *bufp,
+                  ub4        bufsiz,
+                  ub4        type );
+Comments
+Returns an error message in the buffer provided and an ORACLE error. 
+Currently does not support SQL state. This call can be called a multiple 
+number of times if there are more than one diagnostic record for an error.
+The error handle is originally allocated with a call to OCIHandleAlloc().
+Parameters
+hndlp (IN) - the error handle, in most cases, or the environment handle (for 
+errors on OCIEnvInit(), OCIHandleAlloc()).
+recordno (IN) - indicates the status record from which the application seeks 
+info. Starts from 1. 
+sqlstate (OUT) - Not supported in Version 8.0.
+errcodep (OUT) - an ORACLE Error is returned.
+bufp (OUT) - the error message text is returned.
+bufsiz (IN) - the size of the buffer provide to get the error message.
+type (IN) - the type of the handle.
+Related Functions
+OCIHandleAlloc()
+
+OCIExtractInit
+Name
+OCI Extract Initialize 
+Purpose
+This function initializes the parameter manager. 
+Syntax
+sword OCIExtractInit(dvoid *hndl, OCIError *err);
+Comments
+It must be called before calling any other parameter manager routine. The NLS 
+information is stored inside the parameter manager context and used in 
+subsequent calls to OCIExtract routines.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+Related Functions
+OCIExtractTerm()
+
+OCIExtractTerm
+Name
+OCI Extract Terminate
+Purpose
+This function releases all dynamically allocated storage and may perform 
+other internal bookkeeping functions.
+Syntax
+sword OCIExtractTerm(dvoid *hndl, OCIError *err);
+Comments
+It must be called when the parameter manager is no longer being used.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+Related Functions
+OCIExtractInit()
+
+OCIExtractReset
+Name
+OCI Extract Reset
+Purpose
+The memory currently used for parameter storage, key definition storage, and 
+parameter value lists is freed and the structure is reinitialized.
+Syntax
+sword OCIExtractReset(dvoid *hndl, OCIError *err);
+Comments
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+Related Functions
+
+OCIExtractSetNumKeys
+Name
+OCI Extract Set Number of Keys
+Purpose
+Informs the parameter manager of the number of keys that will be registered.
+Syntax
+sword OCIExtractSetNumKeys(dvoid *hndl, OCIError *err, uword numkeys);
+Comments
+This routine must be called prior to the first call of OCIExtractSetKey().  
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+numkeys (IN) - The number of keys that will be registered with 
+               OCIExtractSetKey().
+Related Functions
+OCIExtractSetKey()
+
+OCIExtractSetKey
+Name
+OCI Extract Set Key definition
+Purpose
+Registers information about a key with the parameter manager.
+Syntax
+sword OCIExtractSetKey(dvoid *hndl, OCIError *err, CONST OraText *name, 
+                       ub1 type, ub4 flag, CONST dvoid *defval,
+                       CONST sb4 *intrange, CONST OraText *CONST *strlist);
+Comments
+This routine must be called after calling OCIExtractSetKey() and before 
+calling OCIExtractFromFile() or OCIExtractFromStr().  
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+name (IN) - The name of the key.
+type (IN) - The type of the key (OCI_EXTRACT_TYPE_INTEGER, 
+            OCI_EXTRACT_TYPE_OCINUM, OCI_EXTRACT_TYPE_STRING, or 
+            OCI_EXTRACT_TYPE_BOOLEAN).
+flag (IN) - Set to OCI_EXTRACT_MULTIPLE if the key can take multiple values 
+            or 0 otherwise.
+defval (IN) - Set to the default value for the key.  May be NULL if there is 
+               no default.  A string default must be a (text*) type, an 
+               integer default must be an (sb4*) type, and a boolean default 
+               must be a (ub1*) type.
+intrange (IN) - Starting and ending values for the allowable range of integer 
+                values.  May be NULL if the key is not an integer type or if 
+                all integer values are acceptable.
+strlist (IN) - List of all acceptable text strings for the key.  May be NULL 
+               if the key is not a string type or if all text values are 
+               acceptable.
+Related Functions
+OCIExtractSetNumKeys()
+
+OCIExtractFromFile
+Name
+OCI Extract parameters From File
+Purpose
+The keys and their values in the given file are processed. 
+Syntax
+sword OCIExtractFromFile(dvoid *hndl, OCIError *err, ub4 flag, 
+                         OraText *filename);
+Comments
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+flag (IN) - Zero or has one or more of the following bits set: 
+           OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or 
+           OCI_EXTRACT_APPEND_VALUES. 
+filename (IN) - Null-terminated filename string.
+Related Functions
+
+OCIExtractFromStr
+Name
+OCI Extract parameters From String
+Purpose
+The keys and their values in the given string are processed. 
+Syntax
+sword OCIExtractFromStr(dvoid *hndl, OCIError *err, ub4 flag, OraText *input);
+Comments
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+flag (IN) - Zero or has one or more of the following bits set: 
+           OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or 
+           OCI_EXTRACT_APPEND_VALUES. 
+input (IN) - Null-terminated input string.
+Related Functions
+
+OCIExtractToInt
+Name
+OCI Extract To Integer
+Purpose
+Gets the integer value for the specified key.
+Syntax
+sword OCIExtractToInt(dvoid *hndl, OCIError *err, OraText *keyname, 
+                      uword valno, sb4 *retval);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual integer value.
+Related Functions
+
+OCIExtractToBool
+Name
+OCI Extract To Boolean
+Purpose
+Gets the boolean value for the specified key. 
+Syntax
+sword OCIExtractToBool(dvoid *hndl, OCIError *err, OraText *keyname, 
+                       uword valno, ub1 *retval);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual boolean value.
+Related Functions
+
+OCIExtractToStr
+Name
+OCI Extract To String
+Purpose
+Gets the string value for the specified key.
+Syntax
+sword OCIExtractToStr(dvoid *hndl, OCIError *err, OraText *keyname, 
+                      uword valno, OraText *retval, uword buflen);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual null-terminated string value.
+buflen (IN) - The length of the buffer for retval.
+Related Functions
+
+Note: The following OCIExtract functions are unavailable in this release
+
+OCIExtractToOCINum
+Name
+OCI Extract To OCI Number
+Purpose
+Gets the OCINumber value for the specified key.
+Syntax
+sword OCIExtractToOCINum(dvoid *hndl, OCIError *err, OraText *keyname, 
+                         uword valno, OCINumber *retval);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual OCINumber value.
+Related Functions
+
+OCIExtractToList
+Name
+OCI Extract To parameter List
+Purpose
+Generates a list of parameters from the parameter structures that are stored 
+in memory. 
+Syntax
+sword OCIExtractToList(dvoid *hndl, OCIError *err, uword *numkeys);
+Comments
+Must be called before OCIExtractValues() is called.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+numkeys (OUT) - Number of distinct keys stored in memory.
+Related Functions
+OCIExtractFromList()
+
+OCIExtractFromList
+Name
+OCI Extract From parameter List
+Purpose
+Generates a list of values for the a parameter in the parameter list.
+Syntax
+sword OCIExtractFromList(dvoid *hndl, OCIError *err, uword index, 
+                         OraText *name, ub1 *type, uword *numvals, 
+                         dvoid ***values);
+Comments
+Parameters are specified by an index. OCIExtractToList() must be called prior 
+to calling this routine to generate the parameter list from the parameter 
+structures that are stored in memory. 
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+name (OUT) - Name of the key for the current parameter.
+type (OUT) - Type of the current parameter (OCI_EXTRACT_TYPE_STRING, 
+             OCI_EXTRACT_TYPE_INTEGER, OCI_EXTRACT_TYPE_OCINUM, or 
+             OCI_EXTRACT_TYPE_BOOLEAN)
+numvals (OUT) - Number of values for this parameter.
+values (OUT) - The values for this parameter.
+Related Functions
+OCIExtractToList()
+
+
+************************  OCIFileClose() ***********************************
+ 
+Name
+ OCIFileClose - Oracle Call Interface FILE i/o CLOSE
+
+Purpose
+ Close a previously opened file.
+
+Syntax
+ sword OCIFileClose ( dvoid             *hndl, 
+                      OCIError          *err,
+                      OCIFileObject     *filep )
+
+Comments
+ This function will close a previously opened file. If the function succeeds
+ then OCI_SUCCESS will be returned, else OCI_ERROR. 
+ 
+Parameters
+ hndl  (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle
+ filep (IN) - the OCIFile file object
+
+Related Functions
+ OCIFileOpen.  
+
+
+
+********************* OCIFileExists() **************************************
+
+Name
+ OCIFileExists - Oracle Call Interface FILE i/o EXIST
+
+Purpose
+ Check to see if the file exists.
+
+Syntax
+ sword OCIFileExists ( dvoid           *hndl, 
+                      OCIError         *err, 
+                      OraText          *filename,
+                      OraText          *path,
+                      ub1              *flag )
+
+Comments
+ This function will set the flag to TRUE if the file exists else it will
+ be set to FALSE.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR. 
+
+Parameters
+ hndl(IN) - OCI environment or session handle
+ err(OUT) - OCI error handle
+ filename(IN) - filename
+ path(IN) - path of the file
+ flag(OUT) - whether the file exists or not
+
+Related Functions.
+ None.
+     
+
+ **************************** OCIFileFlush() ******************************
+
+
+Name
+ OCIFileFlush - Oracle Call Interface File i/o FLUSH
+
+Purpose
+ Flush the buffers associated with the file to the disk.
+
+Syntax
+ sword OCIFileFlush ( dvoid             *hndl, 
+                      OCIError          *err,
+                      OCIFileObject     *filep )
+
+Comments
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters 
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle
+ filep (IN) - the OCIFile file object
+
+Related Functions
+ OCIFileOpen, OCIFileWrite
+
+
+
+ *************************** OCIFileGetLength() ****************************
+
+Name
+ OCIFileGetLength - Oracle Call Interface FILE i/o GET file LENGTH
+
+Purpose
+ Get the length of a file.
+
+Syntax
+ OCIFileGetLength(dvoid           *hndl, 
+                  OCIError        *err,
+                  OraText         *filename,
+                  OraText         *path,
+                  ubig_ora        *lenp )
+
+Comments
+ The length of the file will be returned in lenp.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+ 
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filename (IN) - file name.
+ path (IN) - path of the file.
+ lenp (OUT) - On output, it is the length of the file in bytes.
+ is the number of bytes in the file.
+
+Related Functions
+ None.
+
+
+
+******************************** OCIFileInit() *****************************
+   
+Name
+ OCIFileInit - Oracle Call Interface FILE i/o INITialize
+
+Purpose
+ Initialize the OCI File I/O package and create the OCIFile context.
+
+Syntax
+ sword OCIFileInit ( dvoid *hndl, 
+                     OCIError *err)
+
+Comments
+ This function should be called before any of the OCIFile functions are
+ used.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+ 
+Parameters
+ hndl(IN) - OCI environment or session handle.
+ err(OUT) - OCI error structure.
+
+Related Functions
+ OCIFileTerm
+     
+
+
+********************************* OCIFileOpen() *****************************
+
+Name
+ OCIFileOpen - Oracle Call Interface File i/o OPEN
+
+Purpose
+     Open a file.
+
+Syntax
+ sword OCIFileOpen ( dvoid               *hndl, 
+                     OCIError            *err,
+                     OCIFileObject      **filep,
+                     OraText             *filename,
+                     OraText             *path,
+                     ub4                  mode,
+                     ub4                  create, 
+                     ub4                  type )
+
+Comments
+ OCIFileOpen returns a handle to the open file in filep if the file is
+ successfully opened. 
+ If one wants to use the standard file objects (stdin, stdout & stderr)
+ then OCIFileOpen whould be called with the type filed containing the 
+ appropriate type (see the parameter type). If any of the standard files 
+ are specified then filename, path, mode and create are ignored.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (OUT) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (OUT) - the file object to be returned.
+ filename (IN) - file name (NULL terminated string).
+ path (IN) - path of the file (NULL terminated string).
+ mode - mode in which to open the file (valid modes are OCI_FILE_READONLY,
+ OCI_FILE_WRITEONLY, OCI_FILE_READ_WRITE).
+ create - should the file be created if it does not exist. Valid values
+ are: 
+     OCI_FILE_TRUNCATE - create a file regardless of whether or not it exists. 
+                        If the file already exists overwrite it.
+     OCI_FILE_EXIST - open it if it exists, else fail.
+     OCI_FILE_EXCL - fail if the file exists, else create.
+     OCI_FILE_CREATE - open the file if it exists, and create it if it doesn't.
+     OCI_FILE_APPEND - set the file pointer to the end of the file prior to 
+                      writing(this flag can be OR'ed with OCI_FILE_EXIST or
+                      OCI_FILE_CREATE).
+type - file type. Valid values are OCI_FILE_TEXT, OCI_FILE_BIN, 
+       OCI_FILE_STDIN, OCI_FILE_STDOUT and OCI_FILE_STDERR.
+       If any of the standard files are specified then filename, path, mode
+       and create are ignored.
+
+Related Functions.
+ OCIFileClose
+
+
+
+************************** OCIFileRead() ************************************
+   
+Name
+ OCIFileRead - Oracle Call Interface FILE i/o READ
+
+Purpose
+ Read from a file into a buffer.
+
+Syntax
+ sword OCIFileRead ( dvoid            *hndl, 
+                     OCIError         *err,
+                     OCIFileObject    *filep,
+                     dvoid            *bufp,
+                     ub4               bufl,
+                     ub4              *bytesread )
+
+Comments
+ Upto bufl bytes from the file will be read into bufp. The user should
+ allocate memory for the buffer.
+ The number of bytes read would be in bytesread.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (IN/OUT) - a File Object that uniquely references the file.
+ bufp (IN) - the pointer to a buffer into which the data will be read. The 
+ length of the allocated memory is assumed to be bufl. 
+ bufl - the length of the buffer in bytes. 
+ bytesread (OUT) - the number of bytes read.
+
+Related Functions
+ OCIFileOpen, OCIFileSeek, OCIFileWrite
+
+
+
+****************************** OCIFileSeek() ******************************
+
+Name
+ OCIFileSeek - Oracle Call Interface FILE i/o SEEK
+
+Purpose
+ Perfom a seek to a byte position.
+
+Syntax
+ sword OCIFileSeek ( dvoid           *hndl, 
+                     OCIError        *err,  
+                     OCIFileObject   *filep,
+                     uword            origin,
+                     ubig_ora         offset,
+                     sb1              dir)
+
+Comments
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (IN/OUT) - a file handle that uniquely references the file.
+ origin - The starting point we want to seek from. NOTE: The starting 
+ point may be OCI_FILE_SEEK_BEGINNING (beginning), OCI_FILE_SEEK_CURRENT 
+ (current position), or OCI_FILE_SEEK_END (end of file). 
+ offset - The number of bytes from the origin we want to start reading from. 
+ dir - The direction we want to go from the origin. NOTE: The direction 
+ can be either OCI_FILE_FORWARD or OCI_FILE_BACKWARD. 
+ 
+Related Function
+ OCIFileOpen, OCIFileRead, OCIFileWrite
+
+
+
+*************************** OCIFileTerm() **********************************
+
+Name
+ OCIFileTerm - Oracle Call Interface FILE i/o TERMinate
+
+Purpose
+ Terminate the OCI File I/O package and destroy the OCI File context.
+
+Syntax
+ sword OCIFileTerm ( dvoid *hndl, 
+                     OCIError *err )
+
+Comments
+ After this function has been called no OCIFile function should be used.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+ 
+Parameters
+ hndl(IN) - OCI environment or session handle.
+ err(OUT) - OCI error structure. 
+  
+Related Functions 
+ OCIFileInit   
+ 
+
+********************************* OCIFileWrite() **************************** 
+
+Name 
+ OCIFileWrite - Oracle Call Interface FILE i/o WRITE
+
+Purpose
+  Write data from buffer into a file.
+
+Syntax
+ sword OCIFileWrite ( dvoid            *hndl, 
+                      OCIError         *err,  
+                      OCIFileObject    *filep,
+                      dvoid            *bufp, 
+                      ub4               buflen
+                      ub4              *byteswritten )
+
+Comments
+ The number of bytes written will be in *byteswritten.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (IN/OUT) - a file handle that uniquely references the file.
+ bufp (IN) - the pointer to a buffer from which the data will be written. 
+ The length of the allocated memory is assumed to be the value passed
+ in bufl. 
+ bufl - the length of the buffer in bytes.
+ byteswritten (OUT) - the number of bytes written.
+ 
+Related Functions
+ OCIFileOpen, OCIFileSeek, OCIFileRead 
+
+
+
+
+
+OCIHandleAlloc() 
+Name
+OCI Get HaNDLe
+Purpose
+This call returns a pointer to an allocated and initialized handle.
+Syntax
+sword OCIHandleAlloc ( CONST dvoid   *parenth,
+                     dvoid         **hndlpp, 
+                     ub4           type, 
+                     size_t        xtramem_sz,
+                     dvoid         **usrmempp);
+Comments
+Returns a pointer to an allocated and initialized structure, corresponding to 
+the type specified in type. A non-NULL handle is returned on success. Bind 
+handle and define handles are allocated with respect to a statement handle. All
+other handles are allocated with respect to an environment handle which is 
+passed in as a parent handle.
+No diagnostics are available on error. This call returns OCI_SUCCESS if 
+successful, or OCI_INVALID_HANDLE if an out-of-memory error occurs.
+Handles must be allocated using OCIHandleAlloc() before they can be passed 
+into an OCI call.
+Parameters
+parenth (IN) - an environment or a statement handle. 
+hndlpp (OUT) - returns a handle to a handle type. 
+type (IN) - specifies the type of handle to be allocated. The specific types 
+are: 
+OCI_HTYPE_ERROR - specifies generation of an error report handle of 
+C type OCIError
+OCI_HTYPE_SVCCTX - specifies generation of a service context handle 
+of C type OCISvcCtx
+OCI_HTYPE_STMT - specifies generation of a statement (application 
+request) handle of C type OCIStmt
+OCI_HTYPE_BIND - specifies generation of a bind information handle 
+of C type OCIBind
+OCI_HTYPE_DEFINE - specifies generation of a column definition 
+handle of C type OCIDefine
+OCI_HTYPE_DESCRIBE  - specifies generation of a select list 
+description handle of C type OCIDesc
+OCI_HTYPE_SERVER - specifies generation of a server context handle 
+of C type OCIServer
+OCI_HTYPE_SESSION - specifies generation of an authentication 
+context handle of C type OCISession
+OCI_HTYPE_TRANS - specifies generation of a transaction context
+handle of C type OCITrans
+OCI_HTYPE_COMPLEXOBJECT - specifies generation of a complex 
+object retrieval handle of C type OCIComplexObject
+OCI_HTYPE_SECURITY - specifies generation of a security handle of C 
+type OCISecurity
+xtramem_sz (IN) - specifies an amount of user memory to be allocated.
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user. 
+Related Functions
+OCIHandleFree()
+
+
+
+OCIHandleFree()
+Name
+OCI Free HaNDLe
+Purpose
+This call explicitly deallocates a handle.
+Syntax
+sword OCIHandleFree ( dvoid     *hndlp,
+                    ub4       type);
+Comments
+This call frees up storage associated with a handle, corresponding to the type 
+specified in the type parameter.
+This call returns either OCI_SUCCESS or OCI_INVALID_HANDLE.
+All handles must be explicitly deallocated. OCI will not deallocate a child 
+handle if the parent is deallocated.
+Parameters
+hndlp (IN) - an opaque pointer to some storage.
+type (IN) - specifies the type of storage to be allocated. The specific types 
+are:
+OCI_HTYPE_ENV - an environment handle
+OCI_HTYPE_ERROR - an error report handle
+OCI_HTYPE_SVCCTX - a service context handle
+OCI_HTYPE_STMT - a statement (application request) handle
+OCI_HTYPE_BIND - a bind information handle
+OCI_HTYPE_DEFINE - a column definition handle
+OCI_HTYPE_DESCRIBE  - a select list description handle
+OCI_HTYPE_SERVER - a server handle
+OCI_HTYPE_SESSION - a user authentication handle
+OCI_HTYPE_TRANS - a transaction handle
+OCI_HTYPE_COMPLEXOBJECT - a complex object retrieval handle
+OCI_HTYPE_SECURITY - a security handle
+Related Functions
+OCIHandleAlloc()
+
+
+
+
+OCIInitialize()
+Name
+OCI Process Initialize
+Purpose
+Initializes the OCI process environment.
+Syntax
+sword OCIInitialize ( ub4           mode,
+                    CONST dvoid   *ctxp, 
+                    CONST dvoid   *(*malocfp) 
+                                  ( dvoid *ctxp,
+                                    size_t size ),
+                    CONST dvoid   *(*ralocfp)
+                                  ( dvoid *ctxp,
+                                    dvoid *memp,
+                                    size_t newsize ),
+                    CONST void    (*mfreefp)
+                                  ( dvoid *ctxp,
+                                    dvoid *memptr ));
+Comments
+This call initializes the OCI process environment.
+OCIInitialize() must be invoked before any other OCI call. 
+Parameters
+mode (IN) - specifies initialization of the mode. The valid modes are:
+OCI_DEFAULT - default mode.
+OCI_THREADED - threaded environment. In this mode, internal data 
+structures are protected from concurrent accesses by multiple threads. 
+OCI_OBJECT - will use navigational object interface. 
+ctxp (IN) - user defined context for the memory call back routines. 
+malocfp (IN) - user-defined memory allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory allocation function.
+size - size of memory to be allocated by the user-defined memory 
+allocation function
+ralocfp (IN) - user-defined memory re-allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory reallocation 
+function.
+memp - pointer to memory block
+newsize - new size of memory to be allocated
+mfreefp (IN) - user-defined memory free function. If mode is 
+OCI_THREADED, this memory free routine must be thread safe.
+ctxp - context pointer for the user-defined memory free function.
+memptr - pointer to memory to be freed
+Example
+See the description of OCIStmtPrepare() on page 13-96 for an example showing 
+the use of OCIInitialize().
+Related Functions
+
+-------------------------------OCITerminate------------------------------------
+
+OCITerminate()
+Name
+OCI process Terminate
+Purpose
+Do cleanup before process termination
+Syntax
+sword OCITerminate (ub4 mode);
+
+Comments
+This call performs  OCI related clean up before the OCI process terminates.
+If the process is running in shared mode then the OCI process is disconnected
+from the shared memory subsystem.
+
+OCITerminate() should be the last OCI call in any process.
+
+Parameters
+mode (IN) - specifies different termination modes.
+
+OCI_DEFAULT - default mode.
+
+Example
+
+Related Functions
+OCIInitialize()
+
+---------------------- OCIIntervalAssign --------------------------------- 
+sword OCIIntervalAssign(dvoid *hndl, OCIError *err, 
+                    CONST OCIInterval *inpinter, OCIInterval *outinter );
+
+  DESCRIPTION
+    Copies one interval to another to create a replica
+  PARAMETERS
+     hndl (IN) - Session/Env handle.
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  inpinter - Input Interval 
+    (OUT) outinter - Output Interval 
+  RETURNS
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_SUCCESS otherwise
+
+ ---------------------- OCIIntervalCheck ------------------------------------ 
+sword OCIIntervalCheck(dvoid *hndl, OCIError *err, CONST OCIInterval *interval,
+                         ub4 *valid );
+
+  DESCRIPTION
+    Checks the validity of an interval
+  PARAMETERS
+     hndl (IN) - Session/Env handle.
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  interval - Interval to be checked 
+    (OUT) valid     - Zero if the interval is valid, else returns an Ored
+        combination of the following codes.
+
+   Macro name                   Bit number      Error
+   ----------                   ----------      -----
+   OCI_INTER_INVALID_DAY         0x1           Bad day
+   OCI_INTER_DAY_BELOW_VALID     0x2           Bad DAy Low/high bit (1=low)
+   OCI_INTER_INVALID_MONTH       0x4           Bad MOnth
+   OCI_INTER_MONTH_BELOW_VALID   0x8           Bad MOnth Low/high bit (1=low)
+   OCI_INTER_INVALID_YEAR        0x10          Bad YeaR
+   OCI_INTER_YEAR_BELOW_VALID    0x20          Bad YeaR Low/high bit (1=low)
+   OCI_INTER_INVALID_HOUR        0x40          Bad HouR
+   OCI_INTER_HOUR_BELOW_VALID    0x80          Bad HouR Low/high bit (1=low)
+   OCI_INTER_INVALID_MINUTE      0x100         Bad MiNute
+   OCI_INTER_MINUTE_BELOW_VALID  0x200         Bad MiNute Low/high bit(1=low)
+   OCI_INTER_INVALID_SECOND      0x400         Bad SeCond
+   OCI_INTER_SECOND_BELOW_VALID  0x800         bad second Low/high bit(1=low)
+   OCI_INTER_INVALID_FRACSEC     0x1000        Bad Fractional second
+   OCI_INTER_FRACSEC_BELOW_VALID 0x2000        Bad fractional second Low/High
+
+        
+  RETURNS
+    OCI_SUCCESS if interval is okay
+    OCI_INVALID_HANDLE if 'err' is NULL.
+
+ ---------------------- OCIIntervalCompare ----------------------------------- 
+sword OCIIntervalCompare(dvoid *hndl, OCIError *err, OCIInterval *inter1, 
+                        OCIInterval *inter2, sword *result );
+
+  DESCRIPTION
+        Compares two intervals, returns 0 if equal, -1 if inter1 < inter2, 
+        1 if inter1 > inter2
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+     inter1  (IN)   - Interval to be compared 
+     inter2  (IN)   - Interval to be compared 
+     result  (OUT)  -   comparison result, 0 if equal, -1 if inter1 < inter2, 
+                        1 if inter1 > inter2
+
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_ERROR if 
+        the two input datetimes are not mutually comparable.
+
+---------------------- OCIIntervalDivide ------------------------------------ 
+sword OCIIntervalDivide(dvoid *hndl, OCIError *err, OCIInterval *dividend, 
+                OCINumber *divisor, OCIInterval *result );
+ 
+  DESCRIPTION
+     Divides an interval by an Oracle Number to produce an interval
+  PARAMETERS
+        hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+     dividend  (IN)   - Interval to be divided 
+     divisor   (IN)   - Oracle Number dividing `dividend' 
+     result    (OUT)  - resulting interval (dividend / divisor) 
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+
+ ---------------------- OCIIntervalFromNumber -------------------- 
+sword OCIIntervalFromNumber(dvoid *hndl, OCIError *err, 
+               OCIInterval *inter, OCINumber *number);
+  DESCRIPTION
+    Converts an interval to an Oracle Number
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (OUT)  interval - Interval to be converted 
+    (IN) number - Oracle number result  (in years for YEARMONTH interval
+                     and in days for DAYSECOND)
+  RETURNS
+    OCI_SUCCESS on success 
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_ERROR on error.
+  NOTES
+    Fractional portions of the date (for instance, minutes and seconds if
+    the unit chosen is hours) will be included in the Oracle number produced.
+    Excess precision will be truncated.
+ 
+ ---------------------- OCIIntervalFromText --------------------------------- 
+sword OCIIntervalFromText( dvoid *hndl, OCIError *err, CONST OraText *inpstr, 
+                size_t str_len, OCIInterval *result );
+
+  DESCRIPTION
+    Given an interval string produce the interval represented by the string.
+    The type of the interval is the type of the 'result' descriptor.
+  PARAMETERS
+
+     hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  inpstr - Input string 
+    (IN)  str_len - Length of input string 
+    (OUT) result - Resultant interval 
+  RETURNS
+    OCI_SUCCESS on success
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_ERROR if
+        there are too many fields in the literal string
+        the year is out of range (-4713 to 9999)
+        if the month is out of range (1 to 12)
+        if the day of month is out of range (1 to 28...31)
+        if hour is not in range (0 to 23)
+        if hour is not in range (0 to 11)
+        if minute is not in range (0 to 59)
+        if seconds in minute not in range (0 to 59)
+        if seconds in day not in range (0 to 86399)
+        if the interval is invalid
+
+
+ ---------------------- OCIIntervalGetDaySecond -------------------- 
+
+  DESCRIPTION
+     Gets values of day second interval
+  PARAMETERS
+        hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+        day     (OUT) - number of days
+        hour    (OUT) - number of hours
+        min     (OUT) - number of mins
+        sec     (OUT) - number of secs
+        fsec    (OUT) - number of fractional seconds
+        result     (IN)  - resulting interval 
+  RETURNS
+        OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+ ---------------------- OCIIntervalGetYearMonth -------------------- 
+
+  DESCRIPTION
+     Gets year month from an interval
+  PARAMETERS
+        hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+        year    (OUT)   - year value
+        month   (OUT)   - month value
+        result     (IN)  - resulting interval 
+  RETURNS
+        OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+
+-------------------------- OCIIntervalAdd ------------------------------
+sword OCIIntervalAdd(dvoid *hndl, OCIError *err, OCIInterval *addend1, 
+                        OCIInterval *addend2, OCIInterval *result );
+NAME OCIIntervalAdd - Adds two intervals 
+PARAMETERS
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+addend1  (IN)   - Interval to be added 
+addend2  (IN)   - Interval to be added 
+result   (OUT)  - resulting interval (addend1 + addend2) 
+DESCRIPTION
+     Adds two intervals to produce a resulting interval
+RETURNS
+     OCI_SUCCESS on success
+     OCI_ERROR if:
+        the two input intervals are not mutually comparable.
+        the resulting year would go above SB4MAXVAL
+        the resulting year would go below SB4MINVAL
+     OCI_INVALID_HANDLE if 'err' is NULL.
+NOTES
+     The two input intervals must be mutually comparable
+
+ ---------------------- OCIIntervalSubtract ------------------------------- 
+sword OCIIntervalSubtract(dvoid *hndl, OCIError *err, OCIInterval *minuend, 
+                            OCIInterval *subtrahend, OCIInterval *result );
+NAME - OCIIntervalSubtract - subtracts two intervals
+PARAMETERS
+hndl (IN) - Session/Env handle.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+minuend    (IN)   - interval to be subtracted from 
+subtrahend (IN)   - interval subtracted from minuend 
+result     (OUT)  - resulting interval (minuend - subtrahend) 
+DESCRIPTION
+     Subtracts two intervals and stores the result in an interval
+RETURNS
+        OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if:
+           the two input intervals are not mutually comparable.
+           the resulting leading field would go below SB4MINVAL 
+           the resulting leading field would go above SB4MAXVAL
+
+---------------------- OCIIntervalMultiply --------------------------------- 
+sword OCIIntervalMultiply(dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+                        OCINumber *nfactor, OCIInterval *result );
+
+  DESCRIPTION
+     Multiplies an interval by an Oracle Number to produce an interval
+  PARAMETERS
+        hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+     inter  (IN)   - Interval to be multiplied 
+     nfactor  (IN)   - Oracle Number to be multiplied 
+     result   (OUT)  - resulting interval (ifactor * nfactor) 
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_ERROR if:
+        the resulting year would go above SB4MAXVAL
+        the resulting year would go below SB4MINVAL
+
+
+ ---------------------- OCIIntervalSetDaySecond -------------------- 
+
+  DESCRIPTION
+     Sets day second interval
+  PARAMETERS
+        hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+        day     (IN) - number of days
+        hour    (IN) - number of hours
+        min     (IN) - number of mins
+        sec     (IN) - number of secs
+        fsec    (IN) - number of fractional seconds
+        result     (OUT)  - resulting interval 
+  RETURNS
+        OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+ ---------------------- OCIIntervalSetYearMonth -------------------- 
+
+  DESCRIPTION
+     Sets year month interval
+  PARAMETERS
+        hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+        year    (IN)   - year value
+        month   (IN)   - month value
+        result     (OUT)  - resulting interval 
+  RETURNS
+        OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+----------------------- OCIIntervalToNumber ---------------------------------
+sword OCIIntervalToNumber(dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+                          OCINumber *number);
+
+  DESCRIPTION
+    Converts an interval to an Oracle Number
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  inter - Interval to be converted 
+    (OUT) number - Oracle number result  (in years for YEARMONTH interval
+                     and in days for DAYSECOND)
+  RETURNS
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_SUCCESS on success 
+  NOTES
+    Fractional portions of the date (for instance, minutes and seconds if
+    the unit chosen is hours) will be included in the Oracle number produced.
+    Excess precision will be truncated.
+ 
+------------------------------- OCIIntervalToText -------------------------
+sword OCIIntervalToText( dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+                        ub1 lfprec, ub1 fsprec, OraText *buffer, 
+                        size_t buflen, size_t *resultlen );
+
+  DESCRIPTION
+    Given an interval, produces a string representing the interval.
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  inter - Interval to be converted 
+    (IN)  lfprec  - Leading field precision. Number of digits used to
+                represent the leading field.
+    (IN)  fsprec  - Fractional second precision of the interval. Number of
+                digits used to represent the fractional seconds.
+    (OUT) buffer - buffer to hold result 
+    (IN)  buflen - length of above buffer 
+    (OUT) resultlen - length of result placed into buffer 
+ 
+  RETURNS
+    OCI_SUCCESS on success
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_ERROR 
+        if the buffer is not large enough to hold the result
+  NOTES
+    The interval literal will be output as `year' or `[year-]month' for
+    YEAR-MONTH intervals and as `seconds' or `minutes[:seconds]' or
+    `hours[:minutes[:seconds]]' or `days[ hours[:minutes[:seconds]]]' for
+    DAY-TIME intervals (where optional fields are surrounded by brackets).
+
+ ---------------------- OCIIntervalFromTZ -------------------- 
+sword OCIIntervalFromTZ(dvoid *hndl, OCIError *err, CONST oratext *inpstring,
+                        size_t str_len, OCIInterval *result);
+
+  DESCRIPTION
+    Retuns an OCI_DTYPE_INTERVAL_DS OCIInterval with the region id (if
+    the region is specified in the input string) set and the current
+    absolute offset or an absolut offset with the region id set to 0.
+  PARAMETERS
+    hndl (IN) - Session/Env handle.
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    inpstring (IN) - pointer to the input string
+    str_len (IN) - inpstring length
+    result - Output Interval 
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_ERROR on error
+        Bad interval type
+        Timezone errors
+  NOTES
+     The input string must be of the form [+/-]TZH:TZM or 'TZR [TZD]'
+
+ ----------------------- OCIKerbAttrSet ---------------------
+sword OCIKerbAttrSet(OCISession *trgthndlp, ub4 auth_mode, 
+                     ub1 *ftgt_ticket, ub4 ftgt_ticket_len, 
+                     ub1 *ftgt_sesskey, ub4 ftgt_sesskey_len, 
+                     ub2 ftgt_keytype, ub4 ftgt_ticket_flags, 
+                     sb4 ftgt_auth_time, sb4 ftgt_start_time, 
+                     sb4 ftgt_end_time, sb4 ftgt_renew_time, 
+                     text *ftgt_principal, ub4 ftgt_principal_len,
+                     text *ftgt_realm, ub4 ftgt_realm_len, 
+                     OCIError *errhp);
+
+  DESCRIPTION
+    This call sets the attributes required for Kerberos authentication
+    on the user handle.
+
+  PARAMETERS
+    trgthndlp (IN) - The pointer to a user handle.
+    auth_mode (IN) - Indicates what type of Kerberos credentials should
+                    be set. Options are:
+
+                    OCI_KERBCRED_PROXY 
+                                         - Set Kerberos credentials for use with
+                                           proxy authentication.
+                    OCI_KERBCRED_CLIENT_IDENTIFIER 
+                                         - Set Kerberos credentials for use
+                                           with secure client identifier.
+
+    ftgt_ticket (IN) - Forwardable Ticket Granting Ticket (FTGT).
+    ftgt_ticket_len (IN) - Length of FTGT.
+    ftgt_sesskey(IN) - Session Key associated with FTGT.
+    ftgt_sesskey_len (IN) - Length of session key.
+    ftgt_keytype (IN) -  Type of encryption key used to encrypt FTGT.
+    ftgt_ticket_flags (IN) - Flags associated with  encryption of FTGT.
+    ftgt_auth_time (IN) - Authentication time compatible with that in FTGT.
+    ftgt_start_time (IN) - Start time compatible with that indicated in FTGT.
+    ftgt_end_time (IN) - End time compatible with that indicated in FTGT.
+    ftgt_renew_time (IN) - Renew time compatible with that indicated in FTGT.
+    ftgt_principal (IN) - Client principal name from FTGT.
+    ftgt_principal_len (IN) - Length of client principal name.
+    ftgt_realm (IN) - Client realm name from FTGT.
+    ftgt_realm_len (IN) - Client realm name length.
+    errhp (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_ERROR on error
+  NOTES
+
+OCILdaToSvcCtx()
+Name
+OCI toggle version 7 Lda_Def to SerVice context handle
+Purpose
+Converts a V7 Lda_Def to a V8 service context handle.
+Syntax
+sword OCILdaToSvcCtx ( OCISvcCtx  **svchpp,
+                     OCIError   *errhp,
+                     Lda_Def    *ldap );
+Comments
+Converts a V7 Lda_Def to a V8 service context handle. The action of this call 
+can be reversed by passing the resulting service context handle to the 
+OCISvcCtxToLda() function.
+Parameters
+svchpp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+ldap (IN/OUT) - the V7 logon data area returned by OCISvcCtxToLda() from 
+this service context.
+Related Functions
+OCISvcCtxToLda()
+
+
+
+
+OCILobAppend()
+
+Name
+OCI Lob APpend
+
+Purpose
+Appends a LOB value at the end of another LOB. 
+
+Syntax
+sword OCILobAppend ( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *dst_locp,
+                   OCILobLocator    *src_locp );
+Comments
+Appends a LOB value at the end of LOB. The data is 
+copied from the source to the destination at the end of the destination. The 
+source and the destination must already exist. The destination LOB is 
+extended to accommodate the newly written data.
+
+It is an error to extend the destination LOB beyond the maximum length 
+allowed or to try to copy from a NULL LOB. 
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB. 
+src_locp (IN/OUT) - a locator uniquely referencing the source LOB. 
+
+Related Functions
+OCILobTrim()
+OCIErrorGet()
+OCILobWrite()
+OCILobCopy()
+
+
+
+OCILobAssign()
+
+Name
+OCI Lob ASsiGn
+
+Purpose
+Assigns one LOB/FILE locator to another.
+
+Syntax
+sword OCILobAssign ( OCIEnv                *envhp, 
+                     OCIError              *errhp, 
+                     CONST OCILobLocator   *src_locp, 
+                     OCILobLocator         **dst_locpp );
+
+Comments
+Assign source locator to destination locator.  After the assignment, both 
+locators refer to the same LOB data.  For internal LOBs, the source locator's 
+LOB data gets copied to the destination locator's LOB data only when the 
+destination locator gets stored in the table.  Therefore, issuing a flush of 
+the object containing the destination locator will copy the LOB data. For 
+FILEs only the locator that refers to the OS file is copied to the table. The
+OS file is not copied.
+Note: The only difference between this and OCILobLocatorAssign is that this
+takes an environment handle whereas OCILobLocatorAssign takes an OCI service
+handle
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 
+in errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+src_locp (IN) - LOB locator to copy from.
+dst_locpp (IN/OUT) - LOB locator to copy to.  The caller must allocate space 
+for the OCILobLocator by calling OCIDescriptorAlloc().
+
+See also
+OCIErrorGet()
+OCILobIsEqual()
+OCILobLocatorIsInit()
+OCILobLocatorAssign()
+
+
+OCILobCharSetForm()
+
+Name
+OCI Lob Get Character Set Form
+
+Purpose
+Gets the LOB locator's character set fpr,, if any.
+
+Syntax
+sword OCILobCharSetForm ( OCIEnv                    *envhp, 
+                          OCIError                  *errhp, 
+                          CONST OCILobLocator       *locp, 
+                          ub1                       *csfrm );
+
+Comments
+Returns the character set form of the input LOB locator in the csfrm output 
+parameter. 
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+locp (IN) - LOB locator for which to get the character set form.
+csfrm(OUT) - character set form of the input LOB locator.  If the input 
+locator is for a BLOB or a BFILE, csfrm is set to 0 since there is no concept 
+of a character set for binary LOBs/FILEs.  The caller must allocate space for 
+the csfrm (ub1) and not write into the space.
+See also
+OCIErrorGet(), OCILobCharSetId(), OCILobLocatorIsInit
+
+
+
+OCILobCharSetId()
+
+Name
+OCI Lob get Character Set IDentifier
+
+Purpose
+Gets the LOB locator's character set ID, if any.
+
+Syntax
+sword OCILobCharSetId ( OCIEnv                    *envhp, 
+                        OCIError                  *errhp, 
+                        CONST OCILobLocator       *locp, 
+                        ub2                       *csid );
+
+Comments
+Returns the character set ID of the input LOB locator in the cid output 
+parameter. 
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+locp (IN) - LOB locator for which to get the character set ID.
+csid (OUT) - character set ID of the input LOB locator.  If the input locator 
+is for a BLOB or a BFILE, csid is set to 0 since there is no concept of a 
+character set for binary LOBs/FILEs.  The caller must allocate space for the 
+character set id of type ub2 and not write into the space.
+
+See also
+OCIErrorGet(), OCILobCharSetForm(), OCILobLocatorIsInit()
+
+
+
+OCILobCopy()
+
+Name
+OCI Lob Copy
+
+Purpose
+Copies a portion of a LOB value into another LOB value.
+
+Syntax
+sword OCILobCopy ( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *dst_locp,
+                   OCILobLocator    *src_locp,
+                   ub4              amount,
+                   ub4              dst_offset,
+                   ub4              src_offset );
+
+Comments
+Copies a portion of a LOB value into another LOB as specified. The data 
+is copied from the source to the destination. The source (src_locp) and the 
+destination (dlopb) LOBs must already exist.
+If the data already exists at the destination's start position, it is 
+overwritten with the source data. If the destination's start position is 
+beyond the end of the current data, a hole is created from the end of the data
+to the beginning of the newly written data from the source. The destination 
+LOB is extended to accommodate the newly written data if it extends 
+beyond the current length of the destination LOB. 
+It is an error to extend the destination LOB beyond the maximum length 
+allowed or to try to copy from a NULL LOB.
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB. 
+src_locp (IN/OUT) - a locator uniquely referencing the source LOB. 
+amount (IN) - the number of character or bytes, as appropriate, to be copied.
+dst_offset (IN) - this is the absolute offset for the destination LOB. 
+For character LOBs it is the number of characters from the beginning of the 
+LOB at which to begin writing. For binary LOBs it is the number of bytes from 
+the beginning of the lob from which to begin reading. The offset starts at 1.
+src_offset (IN) - this is the absolute offset for the source LOB. 
+For character LOBs it is the number of characters from the beginning of the 
+LOB, for binary LOBs it is the number of bytes. Starts at 1.
+
+See Also 
+OCIErrorGet(), OCILobAppend(), OCILobWrite(), OCILobTrim()
+
+OCILobCreateTemporary()
+
+Name
+OCI Lob Create Temporary
+
+Purpose
+Create a Temporary Lob
+
+Syntax
+sword OCILobCreateTemporary(OCISvcCtx          *svchp,
+                            OCIError           *errhp,
+                            OCILobLocator      *locp,
+                            ub2                 csid,
+                            ub1                 csfrm,
+                            ub1                 lobtype,
+                            boolean             cache,
+                            OCIDuration         duration);
+
+
+Comments
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator which points to the temporary Lob
+csid (IN) - the character set id
+csfrm(IN) - the character set form
+lobtype (IN) - the lob type - one of the three constants OCI_TEMP_BLOB, 
+               OCI_TEMP_CLOB and OCI_TEMP_NCLOB
+cache(IN)-  TRUE if the temporary LOB goes through the cache; FALSE, if not.
+duration(IN)- duration of the temporary LOB; Can be a valid duration id or one 
+              of the values: OCI_DURATION_SESSION, OCI_DURATION_CALL
+              Note: OCI_DURATION_TRANSACTION is NOT supported in 8.1
+Related functions
+OCILobFreeTemporary()
+OCILobIsTemporary()
+
+OCILobDisableBuffering()
+
+Name
+OCI Lob Disable Buffering
+
+Purpose
+Disable lob buffering for the input locator.
+
+
+Syntax
+sword OCILobDisableBuffering ( OCISvcCtx      *svchp,
+                               OCIError       *errhp,
+                               OCILobLocator  *locp);
+
+Comments
+
+Disable lob buffering for the input locator.  The next time data is
+read/written from/to the lob through the input locator, the lob
+buffering subsystem is *not* used.  Note that this call does *not*
+implicitly flush the changes made in the buffering subsystem.  The 
+user must explicitly call OCILobFlushBuffer() to do this.
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB. 
+
+Related Functions
+OCILobEnableBuffering()
+OCIErrorGet()
+OCILobFlushBuffer()
+
+
+
+
+OCILobEnableBuffering()
+
+Name
+OCI Lob Enable Buffering
+
+Purpose
+Enable lob buffering for the input locator.
+
+
+Syntax
+sword OCILobEnableBuffering ( OCISvcCtx      *svchp,
+                              OCIError       *errhp,
+                              OCILobLocator  *locp);
+
+Comments
+
+Enable lob buffering for the input locator.  The next time data is
+read/written from/to the lob through the input locator, the lob
+buffering subsystem is used.  
+
+Once lob buffering is enabled for a locator, if that locator is passed to 
+one of the following routines, an error is returned:
+        OCILobCopy, OCILobAppend, OCILobErase, OCILobGetLength, OCILobTrim
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB. 
+
+Related Functions
+OCILobDisableBuffering()
+OCIErrorGet()
+OCILobWrite()
+OCILobRead()
+OCILobFlushBuffer()
+
+
+
+
+OCILobErase()
+
+Name
+OCI Lob ERase
+
+Purpose
+Erases a specified portion of the LOB data starting at a specified offset.
+
+Syntax
+sword OCILobErase ( OCISvcCtx       *svchp,
+                  OCIError        *errhp,
+                  OCILobLocator   *locp,
+                  ub4             *amount,
+                  ub4             offset );
+
+Comments
+Erases a specified portion of the LOB data starting at a specified offset.
+The actual number of characters/bytes erased is returned. The actual number 
+of characters/bytes and the requested number of characters/bytes will differ 
+if the end of the LOB data is reached before erasing the requested number of 
+characters/bytes.
+If a section of data from the middle of the LOB data is erased, a hole is 
+created. When data from that hole is read, 0's are returned. If the LOB is
+NULL, this routine will indicate that 0 characters/bytes were erased.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - the LOB for which to erase a section of data.
+amount (IN/OUT) - On IN, the number of characters/bytes to erase. On OUT, 
+the actual number of characters/bytes erased.
+offset (IN) - absolute offset from the beginning of the LOB data from which 
+to start erasing data. Starts at 1.
+
+See Also
+OCIErrorGet(), OCILobRead(), OCILobWrite()
+
+OCILobOpen()
+
+Name
+OCI Lob Open
+
+Purpose
+Opens an internal or external Lob.
+
+Syntax
+sword OCILobOpen( OCISvcCtx        *svchp,
+                  OCIError         *errhp,
+                  OCILobLocator    *locp,
+                  ub1               mode );
+
+Comments
+It is an error if the same lob is opened more than once in
+the same transaction. Lobs are opened implicitly if they are
+not opened before using them. A LOB has to be closed before
+the transaction commits else the transaction is rolled back.
+Open locators are closed if the transaction aborts. Multiple 
+users can open the same lob on different locators.
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - locator points to the LOB to be opened
+mode (IN) - mode in which to open the lob. The valid modes are
+read-only - OCI_FILE_READONLY, read-write - OCI_FILE_READWRITE 
+
+OCILobClose()
+
+Name
+OCI Lob Close
+
+Purpose
+Closes an open internal or external Lob.
+
+Syntax
+sword OCILobClose( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *locp );
+
+
+Comments
+It is an error if the lob is not open at this time. All LOBs
+that have been opened in a transaction have to be closed 
+before the transaction commits, else the transaction gets
+rolled back.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp  (IN)  - A locator that was opened using OCILobOpen()
+
+
+OCILobFileClose()
+
+Name
+OCI Lob File CLoSe
+
+Purpose
+Closes a previously opened FILE.
+
+Syntax
+sword OCILobFileClose ( OCISvcCtx            *svchp,
+                        OCIError             *errhp,
+                        OCILobLocator        *filep );
+
+Comments
+Closes a previously opened FILE. It is an error if this function is called for
+an internal LOB. No error is returned if the FILE exists but is not opened.
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+filep (IN/OUT) - a pointer to a FILE locator to be closed.
+
+See Also
+OCIErrorGet(), OCILobFileOpen(), OCILobFileCloseAll(), OCILobFileIsOpen(),
+OCILobFileExists(), CREATE DIRECTORY DDL
+
+
+
+
+OCILobFileCloseAll()
+
+Name
+OCI LOB FILE Close All
+
+Purpose
+Closes all open FILEs on a given service context.
+
+Syntax
+sword OCILobFileCLoseAll ( OCISvcCtx *svchp, 
+                           OCIError  *errhp );
+
+Comments
+Closes all open FILEs on a given service context.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+
+See also
+OCILobFileClose(),
+OCIErrorGet(), OCILobFileOpen(), OCILobFileIsOpen(),
+OCILobFileExists(), CREATE DIRECTORY DDL
+
+
+
+
+OCILobFileExists()
+
+Name
+OCI LOB FILE exists
+
+Purpose
+Tests to see if the FILE exists on the server
+
+Syntax
+sword OCILobFileExists ( OCISvcCtx     *svchp,
+                         OCIError      *errhp,
+                         OCILobLocator *filep,
+                         boolean       *flag );
+
+Comments
+Checks to see if a FILE exists for on the server.
+
+Parameters
+svchp (IN) - the OCI service context handle.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, 
+it is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+filep (IN) - pointer to the FILE locator that refers to the file.
+flag (OUT) - returns TRUE if the FILE exists; FALSE if it does not.
+
+See also
+OCIErrorGet, CREATE DIRECTORY (DDL)
+
+
+
+
+OCILobFileGetName()
+
+Name
+OCI LOB FILE Get file Name
+
+Purpose
+Gets the FILE locator's directory alias and file name.
+
+Syntax
+sword OCILobFileGetName ( OCIEnv                   *envhp,
+                          OCIError                 *errhp, 
+                          CONST OCILobLocator      *filep, 
+                          OraText                     *dir_alias,
+                          ub2                      *d_length, 
+                          OraText                     *filename, 
+                          ub2                      *f_length );
+
+Comments
+Returns the directory alias and file name associated with this file locator.  
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) -The OCI error handle. If there is an error, it is recorded in 
+errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+filep (IN) - FILE locator for which to get the directory alias and file name.
+dir_alias (OUT) - buffer into which the directory alias name is placed. The 
+caller must allocate enough space for the directory alias name and must not 
+write into the space.
+d_length (IN/OUT)                 
+        - IN: length of the input dir_alias string;
+        - OUT: length of the returned dir_alias string.
+filename (OUT) - buffer into which the file name is placed. The caller must 
+allocate enough space for the file name and must not write into the space.
+f_length (IN/OUT) 
+        - IN: length of the input filename string;
+         - OUT: lenght of the returned filename string.
+
+See also
+OCILobFileSetName(), OCIErrorGet()
+
+
+
+
+OCILobFileIsOpen()
+
+Name
+OCI LOB FILE Is Open?
+
+Purpose
+Tests to see if the FILE is open
+
+Syntax
+sword OCILobFileIsOpen ( OCISvcCtx *svchp,
+                         OCIError  *errhp,
+                         OCILobLocator *filep,
+                         boolean       *flag );
+
+Comments
+Checks to see if the FILE on the server is open for a given LobLocator.
+
+Parameters
+svchp (IN) - the OCI service context handle.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+filep (IN) - pointer to the FILE locator being examined. If the input file 
+locator was never passed to OCILobFileOpen(), the file is considered not to 
+be opened by this locator. However, a different locator may have opened the 
+file. More than one file opens can be performed on the same file using 
+different locators.
+flag (OUT) - returns TRUE if the FILE is opened using this locator; FALSE if 
+it is not. 
+
+See also
+OCIErrorGet, OCILobFileOpen, OCILobFileClose, OCILobFileCloseAll, CREATE 
+DIRECTORY SQL command
+
+
+OCILobFileOpen()
+
+Name
+OCI LOB FILE open
+
+Purpose
+Opens a FILE for read-only access
+
+Syntax
+sword OCILobFileOpen ( OCISvcCtx            *svchp,
+                     OCIError             *errhp,
+                     OCILobLocator        *filep,
+                     ub1                  mode );
+
+Comments
+Opens a FILE. The FILE can be opened for read-only access only. FILEs may not 
+be written to throough ORACLE.
+
+Parameters 
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+filep (IN/OUT) - the FILE to open. Error if the locator does not refer to a 
+FILE. 
+mode (IN) - mode in which to open the file. The only valid mode is 
+read-only - OCI_FILE_READONLY. 
+
+See Also
+OCILobFileClose, OCIErrorGet, OCILobFileCloseAll, OCILobFileIsOpen, 
+OCILobFileSetName, CREATE DIRECTORY 
+
+
+
+
+OCILobFileSetName()
+
+Name
+OCI Lob File Set NaMe
+
+Purpose
+Sets directory alias and file name in the FILE locator.
+
+Syntax
+sword OCILobFileSetName ( OCIEnv             *envhp,
+                          OCIError           *errhp,
+                          OCILobLocator      **filepp,
+                          OraText               *dir_alias,
+                          ub2                d_length, 
+                          OraText               *filename, 
+                          ub2                f_length );
+Comments
+Sets the directory alias and file name in the LOB file locator.  
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 
+in errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+filepp (IN/OUT) - FILE locator for which to set the directory alias name.
+The caller must have already allocated space for the locator by calling
+OCIDescriptorAlloc().
+dir_alias (IN) - buffer that contains the directory alias name to set in the 
+locator.
+d_length (IN) - length of the input dir_alias parameter.
+filename (IN) - buffer that contains the file name is placed.
+f_length (IN) - length of the input filename parameter.
+See also
+OCILobFileGetName, OCIErrorGet, CREATE DIRECTORY
+
+
+
+
+OCILobFlushBuffer()
+
+Name
+OCI Lob Flush all Buffers for this lob.
+
+Purpose
+Flush/write all buffers for this lob to the server.
+
+
+Syntax
+sword OCILobFlushBuffer ( OCISvcCtx       *svchp,
+                          OCIError        *errhp,
+                          OCILobLocator   *locp,
+                          ub4              flag);
+
+Comments
+
+Flushes to the server, changes made to the buffering subsystem that 
+are associated with the lob referenced by the input locator.  This 
+routine will actually write the data in the buffer to the lob in 
+the database.  Lob buffering must have already been enabled for the 
+input lob locator.
+
+This routine, by default, does not free the buffer resources for
+reallocation to another buffered LOB operation. However, if you
+want to free the buffer explicitly, you can set the flag parameter
+to OCI_LOB_BUFFER_FREE.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB. 
+flag    (IN)     - to indicate if the buffer resources need to be freed
+                   after a flush. Default value is OCI_LOB_BUFFER_NOFREE.
+                   Set it to OCI_LOB_BUFFER_FREE if you want the buffer
+                   resources to be freed.
+Related Functions
+OCILobEnableBuffering()
+OCILobDisableBuffering()
+OCIErrorGet()
+OCILobWrite()
+OCILobRead()
+
+
+OCILobFreeTemporary()
+
+Name
+OCI Lob Free Temporary
+
+Purpose
+Free a temporary LOB
+
+Syntax
+sword OCILobFreeTemporary(OCISvcCtx          *svchp,
+                          OCIError           *errhp,
+                          OCILobLocator      *locp);
+
+Comments
+  Frees the contents of the temporary Lob this locator is pointing to. Note
+  that the locator itself is not freed until a OCIDescriptorFree is done.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB
+
+Related functions
+OCILobCreateTemporary()
+OCILobIsTemporary()
+
+
+Name
+OCI Lob/File Get Chunk Size
+
+Purpose
+When creating the table, the user can specify the chunking factor, which can
+be a multiple of Oracle blocks. This corresponds to the chunk size used by the
+LOB data layer when accessing/modifying the LOB value. Part of the chunk is
+used to store system-related information and the rest stores the LOB value.
+This function returns the amount of space used in the LOB chunk to store 
+the LOB value.
+
+Syntax
+sword OCILobGetChunkSize ( OCISvcCtx      *svchp,
+                           OCIError       *errhp,
+                           OCILobLocator  *locp,
+                           ub4            *chunksizep );
+
+Comments
+ Performance will be improved if the user issues read/write
+requests using a multiple of this chunk size. For writes, there is an added 
+benefit since LOB chunks are versioned and, if all writes are done on chunk
+basis, no extra/excess versioning is done nor duplicated. Users could batch 
+up the write until they have enough for a chunk instead of issuing several
+write calls for the same chunk.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - a LOB locator that uniquely references the LOB. For internal
+LOBs, this locator must be a locator that was obtained from the server 
+specified by svchp. For FILEs, this locator can be initialized by a Select or
+OCILobFileSetName.
+chunksizep (OUT) - On output, it is the length of the LOB if not NULL - for 
+character LOBs it is the number of characters, for binary LOBs it is the 
+number of bytes in the LOB.
+
+Related Functions
+
+OCILobGetLength()
+
+Name
+OCI Lob/File Length
+
+Purpose
+Gets the length of a LOB/FILE. 
+
+Syntax
+sword OCILobGetLength ( OCISvcCtx      *svchp,
+                        OCIError       *errhp,
+                        OCILobLocator  *locp,
+                        ub4            *lenp );
+
+Comments
+Gets the length of a LOB/FILE. If the LOB/FILE is NULL, the length is 
+undefined.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - a LOB locator that uniquely references the LOB. For internal
+LOBs, this locator must be a locator that was obtained from the server 
+specified by svchp. For FILEs, this locator can be initialized by a Select or
+OCILobFileSetName.
+lenp (OUT) - On output, it is the length of the LOB if not NULL - for 
+character LOBs it is the number of characters, for binary LOBs it is the 
+number of bytes in the LOB.
+
+Related Functions
+OCIErrorGet, OCIFileSetName
+
+
+
+OCILobIsEqual()
+
+Name
+
+OCI Lob Is Equal
+
+Purpose
+Compares two LOB locators for equality.
+
+Syntax
+sword OCILobIsEqual ( OCIEnv                  *envhp,
+                      CONST OCILobLocator     *x,
+                      CONST OCILobLocator     *y,
+                      boolean                 *is_equal );
+
+Comments
+Compares the given LOB locators for equality.  Two LOB locators are equal if 
+and only if they both refer to the same LOB data.
+Two NULL locators are considered not equal by this function.
+Parameters
+envhp (IN) - the OCI environment handle.
+x (IN) - LOB locator to compare.
+y (IN) - LOB locator to compare.
+is_equal (OUT) - TRUE, if the LOB locators are equal; FALSE if they are not.
+
+See also
+OCILobAssign, OCILobLocatorIsInit
+OCILobLocatorAssign,
+OCILobIsOpen()
+
+Name
+
+OCI Lob Is Open
+sword OCILobIsOpen(svchp, errhp, locp, flag)
+OCISvcCtx     *svchp;
+OCIError      *errhp;
+OCILobLocator *locp;
+boolean       *flag;
+
+Comments
+   Checks if the LOB locator was opened before. flag is set to TRUE
+   if opened; FALSE otherwise 
+
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN) - the locator to test for temporary LOB
+flag(OUT) - TRUE, if the LOB locator points to is open
+                    FALSE, if not.
+
+OCILobIsTemporary()
+
+Name
+
+OCI Lob Is Temporary
+
+Purpose
+  Tests if this locator points to a temporary LOB
+
+Syntax
+sword OCILobIsTemporary(OCIEnv            *envhp,
+                        OCIError          *errhp,
+                        OCILobLocator     *locp,
+                        boolean           *is_temporary);
+
+Comments
+Tests the locator to determine if it points to a temporary LOB.
+If so, is_temporary is set to TRUE. If not, is_temporary is set
+to FALSE.
+
+Parameters
+envhp (IN) - the environment handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN) - the locator to test for temporary LOB
+is_temporary(OUT) - TRUE, if the LOB locator points to a temporary LOB;
+                    FALSE, if not.
+
+See Also
+OCILobCreateTemporary, OCILobFreeTemporary
+
+
+OCILobLoadFromFile()
+
+Name
+OCI Lob Load From File
+
+Purpose
+Load/copy all or a portion of the file into an internal LOB.
+
+Syntax
+sword OCILobLoadFromFile ( OCISvcCtx        *svchp,
+                           OCIError         *errhp,
+                           OCILobLocator    *dst_locp,
+                           OCILobLocator    *src_filep,
+                           ub4              amount,
+                           ub4              dst_offset,
+                           ub4              src_offset );
+
+Comments
+Loads/copies a portion or all of a file value into an internal LOB as 
+specified.  The data is copied from the source file to the destination 
+internal LOB (BLOB/CLOB).  No character set conversions are performed 
+when copying the bfile data to a clob/nclob.  The bfile data must already
+be in the same character set as the clob/nclob in the database.  No
+error checking is performed to verify this.
+The source (src_filep) and the destination (dst_locp) LOBs must already exist.
+If the data already exists at the destination's start position, it is 
+overwritten with the source data. If the destination's start position is 
+beyond the end of the current data, a hole is created from the end of the data
+to the beginning of the newly written data from the source. The destination 
+LOB is extended to accommodate the newly written data if it extends 
+beyond the current length of the destination LOB. 
+It is an error to extend the destination LOB beyond the maximum length 
+allowed or to try to copy from a NULL LOB.
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+dst_locp (IN/OUT) - a locator uniquely referencing the destination internal 
+LOB which may be of type blob, clob, or nclob. 
+src_filep (IN/OUT) - a locator uniquely referencing the source BFILE. 
+amount (IN) - the number of bytes to be copied.
+dst_offset (IN) - this is the absolute offset for the destination LOB. 
+For character LOBs it is the number of characters from the beginning of the 
+LOB at which to begin writing. For binary LOBs it is the number of bytes from 
+the beginning of the lob from which to begin reading. The offset starts at 1.
+src_offset (IN) - this is the absolute offset for the source BFILE.  It is 
+the number of bytes from the beginning of the LOB.  The offset starts at 1.
+
+See Also 
+OCIErrorGet(), OCILobAppend(), OCILobWrite(), OCILobTrim(), OCILobCopy()
+
+OCILobLocatorAssign()
+
+Name
+OCI Lob LOCATOR ASsiGn
+
+Purpose
+Assigns one LOB/FILE locator to another.
+
+Syntax
+sword OCILobLocatorAssign ( OCISvcCtx             *svchp, 
+                            OCIError              *errhp, 
+                            CONST OCILobLocator   *src_locp, 
+                            OCILobLocator         **dst_locpp );
+
+Comments
+Assign source locator to destination locator.  After the assignment, both 
+locators refer to the same LOB data.  For internal LOBs, the source locator's 
+LOB data gets copied to the destination locator's LOB data only when the 
+destination locator gets stored in the table.  Therefore, issuing a flush of 
+the object containing the destination locator will copy the LOB data. For 
+FILEs only the locator that refers to the OS file is copied to the table. The
+OS file is not copied.
+Note : the only difference between this and OCILobAssign is that this takes
+a OCI service handle pointer instead of a OCI environment handle pointer
+
+Parameters
+svchp (IN/OUT) - OCI service handle initialized in object mode.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 
+in errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+src_locp (IN) - LOB locator to copy from.
+dst_locpp (IN/OUT) - LOB locator to copy to.  The caller must allocate space 
+for the OCILobLocator by calling OCIDescriptorAlloc().
+
+See also
+OCIErrorGet()
+OCILobIsEqual()
+OCILobLocatorIsInit()
+OCILobAssign()
+
+
+
+
+OCILobLocatorIsInit()
+
+Name
+OCI LOB locator is initialized?
+
+Purpose
+Tests to see if a given LOB locator is initialized.
+
+Syntax
+sword OCILobLocatorIsInit ( OCIEnv   *envhp,
+                            OCIError *errhp,
+                            CONST OCILobLocator *locp,
+                            boolean *is_initialized );
+
+Comments
+Tests to see if a given LOB locator is initialized.
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+locp (IN) - the LOB locator being tested
+is_initialized (OUT) - returns TRUE if the given LOB locator is initialized; 
+FALSE if it is not.
+
+See also
+OCIErrorGet, OCILobIsEqual
+
+
+
+
+OCILobRead()
+
+Name
+OCI Lob/File ReaD
+
+Purpose
+Reads a portion of a LOB/FILE as specified by the call into a buffer. 
+
+Syntax
+sword OCILobRead ( OCISvcCtx       *svchp,
+                   OCIError        *errhp,
+                   OCILobLocator   *locp,
+                   ub4             offset,
+                   ub4             *amtp,
+                   dvoid           *bufp,
+                   ub4             bufl,
+                   dvoid           *ctxp,  
+                   OCICallbackLobRead cbfp,
+                   ub2             csid,
+                   ub1             csfrm );
+
+Comments
+Reads a portion of a LOB/FILE as specified by the call into a buffer. Data 
+read from a hole is returned as 0s. It is an error to try to read from a NULL
+LOB/FILE. The OS FILE must already exist on the server and must have been 
+opened using the input locator. Oracle must hav epermission to read the OS 
+file and user must have read permission on the directory object.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+offset (IN) - On input, it is the absolute offset, for character LOBs in the 
+number of characters from the beginning of the LOB, for binary LOBs it is the 
+number of bytes. Starts from 1.
+amtp (IN/OUT) - On input, the number of character or bytes to be read. On 
+output, the actual number of bytes or characters read. 
+If the amount of bytes to be read is larger than the buffer length it is 
+assumed that the LOB is being read in a streamed mode. On input if this value 
+is 0, then the data shall be read in streamed mode from the LOB until the end 
+of LOB. If the data is read in pieces, *amtp always contains the length of 
+the last piece read.  If a callback function is defined, then this callback 
+function will be invoked each time bufl bytes are read off the pipe. Each 
+piece will be written into bufp.
+If the callback function is not defined, then OCI_NEED_DATA error code will 
+be returned. The application must invoke the LOB read over and over again to 
+read more pieces of the LOB until the OCI_NEED_DATA error code is not 
+returned. The buffer pointer and the length can be different in each call 
+if the pieces are being read into different sizes and location. 
+bufp (IN) - the pointer to a buffer into which the piece will be read. The 
+length of the allocated memory is assumed to be bufl. 
+bufl (IN) - the length of the buffer in octets. 
+ctxp (IN) - the context for the call back function. Can be NULL.
+cbfp (IN) - a callback that may be registered to be called for each piece. If 
+this is NULL, then OCI_NEED_DATA will be returned for each piece. 
+The callback function must return OCI_CONTINUE for the read to continue. 
+If any other error code is returned, the LOB read is aborted. 
+  ctxp (IN) - the context for the call back function. Can be NULL.
+  bufp (IN) - a buffer pointer for the piece.
+  len (IN) - the length of length of current piece in bufp.
+  piece (IN) - which piece - OCI_FIRST_PIECE, OCI_NEXT_PIECE or 
+  OCI_LAST_PIECE.
+csid - the character set ID of the buffer data
+csfrm - the character set form of the buffer data
+
+Related Functions
+OCIErrorGet, OCILobWrite, OCILobFileOpen, OCILobFileSetName, CREATE DIRECTORY
+
+
+
+
+OCILobTrim()
+
+Name
+
+OCI Lob  Trim
+
+Purpose
+Trims the lob value to a shorter length
+
+Syntax
+sword OCILobTrim ( OCISvcCtx       *svchp,
+                 OCIError        *errhp,
+                 OCILobLocator   *locp,
+                 ub4             newlen );
+
+Comments
+Truncates LOB data to a specified shorter length. 
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a LOB locator that uniquely references the LOB. This locator 
+must be a locator that was obtained from the server specified by svchp. 
+newlen (IN) - the new length of the LOB data, which must be less than or equal
+to the current length. 
+
+Related Functions
+OCIErrorGet, OCILobWrite, OCiLobErase, OCILobAppend, OCILobCopy
+
+
+
+
+
+OCILobWrite()
+
+Name
+OCI Lob Write
+
+Purpose
+Writes a buffer into a LOB
+
+Syntax
+sword OCILobWrite ( OCISvcCtx       *svchp,
+                    OCIError        *errhp,
+                    OCILobLocator   *locp,
+                    ub4             offset,
+                    ub4             *amtp,
+                    dvoid           *bufp, 
+                    ub4             buflen,
+                    ub1             piece,
+                    dvoid           *ctxp,  
+                    OCICallbackLobWrite   (cbfp)
+                                    (
+                                    dvoid    *ctxp,
+                                    dvoid    *bufp,
+                                    ub4      *lenp,
+                                    ub1      *piecep ) 
+                    ub2             csid
+                    ub1             csfrm );
+
+
+Comments
+Writes a buffer into a LOB as specified. If LOB data already exists 
+it is overwritten with the data stored in the buffer.
+The buffer can be written to the LOB in a single piece with this call, or
+it can be provided piecewise using callbacks or a standard polling method.
+If this value of the piece parameter is OCI_FIRST_PIECE, data must be 
+provided through callbacks or polling.
+If a callback function is defined in the cbfp parameter, then this callback 
+function will be invoked to get the next piece after a piece is written to 
+the pipe. Each piece will be written from bufp.
+If no callback function is defined, then OCILobWrite() returns the 
+OCI_NEED_DATA error code. The application must all OCILobWrite() again 
+to write more pieces of the LOB. In this mode, the buffer pointer and the 
+length can be different in each call if the pieces are of different sizes and 
+from different locations. A piece value of OCI_LAST_PIECE terminates the 
+piecewise write. 
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+offset (IN) - On input, it is the absolute offset, for character LOBs in 
+the number of characters from the beginning of the LOB, for binary LOBs it 
+is the number of bytes. Starts at 1.
+bufp (IN) - the pointer to a buffer from which the piece will be written. The 
+length of the allocated memory is assumed to be the value passed in bufl. 
+Even if the data is being written in pieces, bufp must contain the first 
+piece of the LOB when this call is invoked.
+bufl (IN) - the length of the buffer in bytes.
+Note: This parameter assumes an 8-bit byte. If your platform uses a 
+longer byte, the value of bufl must be adjusted accordingly.
+piece (IN) - which piece of the buffer is being written. The default value for
+this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a 
+single piece.
+The following other values are also possible for piecewise or callback mode: 
+OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE.
+amtp (IN/OUT) - On input, takes the number of character or bytes to be 
+written. On output, returns the actual number of bytes or characters written. 
+If the data is written in pieces, *amtp will contain the total length of the 
+pieces written at the end of the call (last piece written) and is undefined in
+between. 
+(Note it is different from the piecewise read case)
+ctxp (IN) - the context for the call back function. Can be NULL.
+cbfp (IN) - a callback that may be registered to be called for each piece in 
+a piecewise write. If this is NULL, the standard polling method will be used.
+The callback function must return OCI_CONTINUE for the write to continue. 
+If any other error code is returned, the LOB write is aborted. The 
+callback takes the following parameters:
+  ctxp (IN) - the context for the call back function. Can be NULL.
+  bufp (IN/OUT) - a buffer pointer for the piece.
+  lenp (IN/OUT) - the length of the buffer (in octets) and the length of 
+  current piece in bufp (out octets).
+  piecep (OUT) - which piece - OCI_NEXT_PIECE or OCI_LAST_PIECE.
+csid - the character set ID of the buffer data
+csfrm - the character set form of the buffer data
+Related Functions
+
+OCILobWriteAppend()
+
+Name
+OCI Lob Write Append
+
+Purpose
+Writes data to the end of a LOB value. This call provides the ability
+to get the length of the data and append it to the end of the LOB in
+a single round trip to the server.
+
+Syntax
+sword OCILobWriteAppend ( OCISvcCtx       *svchp,
+                    OCIError        *errhp,
+                    OCILobLocator   *locp,
+                    ub4             *amtp,
+                    dvoid           *bufp, 
+                    ub4             buflen,
+                    ub1             piece,
+                    dvoid           *ctxp,  
+                    OCICallbackLobWrite   (cbfp)
+                                    (
+                                    dvoid    *ctxp,
+                                    dvoid    *bufp,
+                                    ub4      *lenp,
+                                    ub1      *piecep ) 
+                    ub2             csid
+                    ub1             csfrm );
+
+
+Comments
+Writes a buffer to the end of a LOB as specified. If LOB data already exists 
+it is overwritten with the data stored in the buffer.
+The buffer can be written to the LOB in a single piece with this call, or
+it can be provided piecewise using callbacks or a standard polling method.
+If this value of the piece parameter is OCI_FIRST_PIECE, data must be 
+provided through callbacks or polling.
+If a callback function is defined in the cbfp parameter, then this callback 
+function will be invoked to get the next piece after a piece is written to the 
+pipe. Each piece will be written from bufp.
+If no callback function is defined, then OCILobWriteAppend() returns the 
+OCI_NEED_DATA error code. The application must all OCILobWriteAppend() again 
+to write more pieces of the LOB. In this mode, the buffer pointer and the 
+length can be different in each call if the pieces are of different sizes and 
+from different locations. A piece value of OCI_LAST_PIECE terminates the 
+piecewise write. 
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+bufp (IN) - the pointer to a buffer from which the piece will be written. The 
+length of the allocated memory is assumed to be the value passed in bufl. Even 
+if the data is being written in pieces, bufp must contain the first piece of 
+the LOB when this call is invoked.
+bufl (IN) - the length of the buffer in bytes.
+Note: This parameter assumes an 8-bit byte. If your platform uses a 
+longer byte, the value of bufl must be adjusted accordingly.
+piece (IN) - which piece of the buffer is being written. The default value for
+this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a 
+single piece.
+The following other values are also possible for piecewise or callback mode: 
+OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE.
+amtp (IN/OUT) - On input, takes the number of character or bytes to be 
+written. On output, returns the actual number of bytes or characters written. 
+If the data is written in pieces, *amtp will contain the total length of the 
+pieces written at the end of the call (last piece written) and is undefined in
+between. 
+(Note it is different from the piecewise read case)
+ctxp (IN) - the context for the call back function. Can be NULL.
+cbfp (IN) - a callback that may be registered to be called for each piece in a 
+piecewise write. If this is NULL, the standard polling method will be used.
+The callback function must return OCI_CONTINUE for the write to continue. 
+If any other error code is returned, the LOB write is aborted. The 
+callback takes the following parameters:
+  ctxp (IN) - the context for the call back function. Can be NULL.
+  bufp (IN/OUT) - a buffer pointer for the piece.
+  lenp (IN/OUT) - the length of the buffer (in octets) and the length of 
+  current piece in bufp (out octets).
+  piecep (OUT) - which piece - OCI_NEXT_PIECE or OCI_LAST_PIECE.
+csid - the character set ID of the buffer data
+csfrm - the character set form of the buffer data
+Related Functions
+
+
+
+
+OCILobGetStorageLimit()
+
+Name
+OCI Lob Get Storage Limit
+
+Purpose
+To get the maximum Length of a LOB in bytes that can be stored in the database.
+
+Syntax
+sword OCILobGetStorageLimit ( OCISvcCtx       *svchp,
+                    OCIError        *errhp,
+                    OCILobLocator   *locp,
+                    oraub8          *limitp);
+
+
+Comments
+With unlimited size LOB support the limit for a LOB is no longer restricted to 4GB.
+This interface should be used to get the actual limit for storing data for a specific
+LOB locator. Note that if the compatibality is set to 9.2 or older the limit would still 
+be 4GB.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+limitp (OUT)  - The storage limit for a LOB in bytes.
+Related Functions
+
+
+
+
+OCILogoff()
+Name
+OCI simplified Logoff
+Purpose
+This function is used to terminate a session created with OCILogon() or
+OCILogon2().
+Syntax
+sword OCILogoff ( OCISvcCtx      *svchp
+                   OCIError       *errhp );
+Comments
+This call is used to terminate a session which was created with OCILogon() or
+OCILogon2().  
+This call implicitly deallocates the server, authentication, and service 
+context handles.
+Note: For more information on logging on and off in an application, 
+refer to the section "Application Initialization, Connection, and 
+Authorization" on page 2-16.
+Parameters
+svchp (IN) - the service context handle which was used in the call to 
+OCILogon() or OCILogon2().
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+See Also
+OCILogon(), OCILogon2().
+
+
+
+
+
+
+OCILogon()
+Name
+OCI Service Context Logon
+Purpose
+This function is used to create a simple logon session.
+Syntax
+sword OCILogon ( OCIEnv          *envhp,
+                       OCIError        *errhp,
+                       OCISvcCtx       *svchp,
+                       CONST OraText      *username,
+                       ub4             uname_len,
+                       CONST OraText      *password,
+                       ub4             passwd_len,
+                       CONST OraText      *dbname,
+                       ub4             dbname_len );
+Comments
+This function is used to create a simple logon session for an application. 
+Note: Users requiring more complex session (e.g., TP monitor 
+applications) should refer to the section "Application Initialization, 
+Connection, and Authorization" on page 2-16.
+This call allocates the error and service context handles which are passed to 
+it. This call also implicitly allocates server and authentication handles 
+associated with the session.  These handles can be retrieved by calling 
+OCIAttrGet() on the service context handle.
+Parameters
+envhp (IN) - the OCI environment handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+svchp (OUT) - the service context pointer.
+username (IN) - the username.
+uname_len (IN) - the length of username.
+password (IN) - the user's password.
+passwd_len (IN) - the length of password.
+dbname (IN) - the name of the database to connect to.
+dbname_len (IN) - the length of dbname.
+See Also
+OCILogoff()
+
+
+
+
+
+OCILogon2()
+Name
+OCI Service Context Logon
+Purpose
+This function is used to create a logon session in connection pooling mode.
+Syntax
+sword OCILogon2 ( OCIEnv          *envhp,
+                       OCIError        *errhp,
+                       OCISvcCtx       **svchp,
+                       CONST OraText      *username,
+                       ub4             uname_len,
+                       CONST OraText      *password,
+                       ub4             passwd_len,
+                       CONST OraText      *dbname,
+                       ub4             dbname_len,
+                       ub4             mode);
+Comments
+This function is used to create a simple logon session for an application in
+Connection Pooling mode. The valid values for mode are currently OCI_POOL and
+OCI_DEFAULT. Call to this function with OCI_DEFAULT mode is equivalent to 
+OCILogon() call.
+This call allocates the error and service context handles which are passed to 
+it. This call also implicitly allocates server and authentication handles 
+associated with the session.  These handles can be retrieved by calling 
+OCIAttrGet() on the service context handle. This call assumes that 
+OCIConnectionPoolCreate() has already been called for the same dbname.
+Parameters
+envhp (IN) - the OCI environment handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+svchp (OUT) - the service context pointer.
+username (IN) - the username.
+uname_len (IN) - the length of username.
+password (IN) - the user's password. If this is null, it is assumed that a
+                proxy session has to be created and the required grants on 
+                the database are already done.
+passwd_len (IN) - the length of password.
+dbname (IN) - the name of the database to connect to.
+dbname_len (IN) - the length of dbname.
+mode (IN) - the mode for doing the server attach. Should be OCI_POOL for
+            using Connection Pooling.
+
+
+See Also
+OCILogoff()
+
+
+
+
+
+OCIMemoryFree()
+Name
+OCI FREE Memory
+Purpose
+Frees up storage associated with the pointer.
+Syntax
+void OCIMemoryFree ( CONST OCIStmt   *stmhp,
+                     dvoid           *memptr);
+Comments
+Frees up dynamically allocated data pointers associated with the pointer using 
+either the default memory free function or the registered memory free 
+function, as the case may be.
+A user-defined memory free function can be registered during the initial call 
+to OCIInitialize(). 
+This call is always successful. 
+Parameters
+stmhp (IN) - statement handle which returned this data buffer.
+memptr (IN) - pointer to data allocated by the client library. 
+Related Functions
+OCIInitialize()
+
+
+
+
+
+OCIParamGet()
+Name
+OCI Get PARaMeter
+Purpose
+Returns a descriptor of a parameter specified by position in the describe 
+handle or statement handle.
+Syntax
+sword OCIParamGet ( CONST dvoid       *hndlp,
+                  ub4         htype,
+                  OCIError    *errhp,
+                  dvoid    **parmdpp,
+                  ub4         pos );
+Comments
+This call returns a descriptor of a parameter specified by position in the 
+describe handle or statement handle. Parameter descriptors are always 
+allocated internally by the OCI library. They are read-only.
+OCI_NO_DATA may be returned if there are no parameter descriptors for this 
+position. 
+See Appendix B for more detailed information about parameter descriptor 
+attributes.
+Parameters
+hndlp (IN) - a statement handle or describe handle. The OCIParamGet() 
+function will return a parameter descriptor for this handle. 
+htype (IN) - the type of the handle passed in the handle parameter. Valid 
+types are OCI_HTYPE_DESCRIBE, for a describe handle OCI_HTYPE_STMT, for a 
+statement handle
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+parmdpp (OUT) - a descriptor of the parameter at the position given in the pos 
+parameter.
+pos (IN) - position number in the statement handle or describe handle. A 
+parameter descriptor will be returned for this position.
+Note: OCI_NO_DATA may be returned if there are no parameter 
+descriptors for this position. 
+Related Functions
+OCIAttrGet(), OCIAttrSet()
+
+
+
+
+
+OCIParamSet()
+Name
+OCI Parameter Set in handle
+Purpose
+Used to set a complex object retrieval descriptor into a complex object 
+retrieval handle.
+Syntax
+sword   OCIParamGet ( dvoid *hndlp,
+                       ub4 htyp,
+                      OCIError *errhp,
+                      CONST dvoid *dscp,
+                      ub4 dtyp,
+                      ub4 pos );
+Comments
+This call sets a given complex object retrieval descriptor into a complex 
+object retrieval handle.
+The handle must have been previously allocated using OCIHandleAlloc(), and 
+the descriptor must have been previously allocated using OCIDescAlloc(). 
+Attributes of the descriptor are set using OCIAttrSet().
+Parameters
+hndlp (IN/OUT) - handle pointer.
+htype (IN) - handle type.
+errhp (IN/OUT) - error handle.
+dscp (IN) - complex object retrieval descriptor pointer.
+dtyp (IN) - 
+pos (IN) - position number.
+See Also
+
+
+
+
+
+OCIPasswordChange()
+Name
+OCI Change PassWord
+Purpose
+This call allows the password of an account to be changed.
+Syntax
+sword OCIPasswordChange ( OCISvcCtx     *svchp,
+                        OCIError      *errhp,
+                        CONST OraText    *user_name,
+                        ub4           usernm_len,
+                        CONST OraText    *opasswd,
+                        ub4           opasswd_len,
+                        CONST OraText    *npasswd,
+                        sb4           npasswd_len,
+                        ub4           mode);
+Comments
+This call allows the password of an account to be changed. This call is 
+similar to OCISessionBegin() with the following differences:
+If the user authentication is already established, it authenticates 
+the account using the old password and then changes the 
+password to the new password
+If the user authentication is not established, it establishes a user 
+authentication and authenticates the account using the old 
+password, then changes the password to the new password.
+This call is useful when the password of an account is expired and 
+OCISessionBegin() returns an error or warning which indicates that the 
+password has expired. 
+Parameters
+svchp (IN/OUT) - a handle to a service context. The service context handle 
+must be initialized and have a server context handle associated with it.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+user_name (IN) - specifies the user name. It points to a character string, 
+whose length is specified in usernm_len. This parameter must be NULL if the 
+service context has been initialized with an authentication handle.
+usernm_len (IN) - the length of the user name string specified in user_name. 
+For a valid user name string, usernm_len must be non-zero.
+opasswd (IN) - specifies the user's old password. It points to a character 
+string, whose length is specified in opasswd_len .
+opasswd_len (IN) - the length of the old password string specified in opasswd. 
+For a valid password string, opasswd_len must be non-zero.
+npasswd (IN) - specifies the user's new password. It points to a character 
+string, whose length is specified in npasswd_len which must be non-zero for a 
+valid password string. If the password complexity verification routine is 
+specified in the user's profile to verify the new password's complexity, the 
+new password must meet the complexity requirements of the verification 
+function.
+npasswd_len (IN)  - then length of the new password string specified in 
+npasswd. For a valid password string, npasswd_len must be non-zero.
+mode - pass as OCI_DEFAULT.
+Related Functions
+OCISessionBegin()
+
+
+----------------------------------OCIReset------------------------------------
+
+
+OCIReset()
+Name
+OCI Reset
+Purpose
+Resets the interrupted asynchronous operation and protocol. Must be called
+if a OCIBreak call had been issued while a non-blocking operation was in
+progress.
+Syntax
+sword OCIReset ( dvoid      *hndlp,
+                 OCIError   *errhp);
+Comments
+This call is called in non-blocking mode ONLY. Resets the interrupted
+asynchronous operation and protocol. Must be called if a OCIBreak call 
+had been issued while a non-blocking operation was in progress. 
+Parameters
+hndlp (IN) - the service context handle or the server context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+Related Functions
+
+
+OCIResultSetToStmt()
+Name
+OCI convert Result Set to Statement Handle
+Purpose
+Converts a descriptor to statement handle for fetching rows.
+Syntax
+sword OCIResultSetToStmt ( OCIResult     *rsetdp,
+                         OCIError      *errhp );
+Comments
+Converts a descriptor to statement handle for fetching rows.
+A result set descriptor can be allocated with a call to OCIDescAlloc().
+Parameters
+rsetdp (IN/OUT) - a result set descriptor pointer. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+Related Functions
+OCIDescAlloc()
+
+
+
+
+OCIServerAttach()
+Name
+OCI ATtaCH to server
+Purpose
+Creates an access path to a data source for OCI operations.
+Syntax
+sword OCIServerAttach ( OCIServer    *srvhp,
+                      OCIError     *errhp,
+                      CONST OraText   *dblink,
+                      sb4          dblink_len,
+                      ub4          mode);
+Comments
+This call is used to create an association between an OCI application and a 
+particular server. 
+This call initializes a server context handle, which must have been previously 
+allocated with a call to OCIHandleAlloc().
+The server context handle initialized by this call can be associated with a 
+service context through a call to OCIAttrSet(). Once that association has been 
+made, OCI operations can be performed against the server.
+If an application is operating against multiple servers, multiple server 
+context handles can be maintained. OCI operations are performed against 
+whichever server context is currently associated with the service context.
+Parameters
+srvhp (IN/OUT) - an uninitialized server context handle, which gets 
+initialized by this call. Passing in an initialized server handle causes an 
+error. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+dblink (IN) - specifies the database (server) to use. This parameter points to
+a character string which specifies a connect string or a service point. If the 
+connect string is NULL, then this call attaches to the default host. The length
+of connstr is specified in connstr_len. The connstr pointer may be freed by the
+caller on return.
+dblink_len (IN) - the length of the string pointed to by connstr. For a valid 
+connect string name or alias, connstr_len must be non-zero.
+mode (IN) - specifies the various modes of operation.  For release 8.0, pass as
+OCI_DEFAULT - in this mode, calls made to the server on this server context 
+are made in blocking mode. 
+Example
+See the description of OCIStmtPrepare() on page 13-96 for an example showing 
+the use of OCIServerAttach().
+Related Functions
+OCIServerDetach()
+
+
+
+OCIServerDetach()
+Name
+OCI DeTaCH server
+Purpose
+Deletes an access to a data source for OCI operations.
+Syntax
+sword OCIServerDetach ( OCIServer   *svrhp,
+                      OCIError    *errhp,
+                      ub4         mode); 
+Comments
+This call deletes an access to data source for OCI operations, which was 
+established by a call to OCIServerAttach(). 
+Parameters
+srvhp (IN) - a handle to an initialized server context, which gets reset to 
+uninitialized state. The handle is not de-allocated. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+mode (IN) - specifies the various modes of operation. The only valid mode is 
+OCI_DEFAULT for the default mode. 
+Related Functions
+OCIServerAttach()
+
+
+
+OCIServerVersion()
+Name
+OCI VERSion
+Purpose
+Returns the version string of the Oracle server.
+Syntax
+sword OCIServerVersion ( dvoid        *hndlp, 
+                       OCIError     *errhp, 
+                       OraText         *bufp,
+                       ub4          bufsz
+                       ub1          hndltype );
+Comments
+This call returns the version string of the Oracle server. 
+For example, the following might be returned as the version string if your 
+application is running against a 7.3.2 server:
+Oracle7 Server Release 7.3.2.0.0 - Production Release
+PL/SQL Release 2.3.2.0.0 - Production
+CORE Version 3.5.2.0.0 - Production
+TNS for SEQUENT DYNIX/ptx: Version 2.3.2.0.0 - Production
+NLSRTL Version 3.2.2.0.0 - Production
+
+Parameters
+hndlp (IN) - the service context handle or the server context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+bufp (IN) - the buffer in which the version information is returned.
+bufsz (IN) - the length of the buffer.
+hndltype (IN) - the type of handle passed to the function.
+Related Functions
+
+
+
+
+
+OCISessionBegin()
+Name
+OCI Session Begin and authenticate user
+Purpose
+Creates a user authentication and begins a user session for a given server.
+Syntax
+sword OCISessionBegin ( OCISvcCtx     *svchp,
+                      OCIError      *errhp,
+                      OCISession    *usrhp,
+                      ub4           credt,
+                      ub4           mode);
+
+Comments
+For Oracle8, OCISessionBegin() must be called for any given server handle 
+before requests can be made against it. Also, OCISessionBegin() only supports 
+authenticating the user for access to the Oracle server specified by the 
+server handle in the service context. In other words, after OCIServerAttach() 
+is called to initialize a server handle, OCISessionBegin() must be called to 
+authenticate the user for that given server. 
+When OCISessionBegin() is called for the first time for the given server 
+handle, the initialized authentication handle is called a primary 
+authentication context. A primary authentication context may not be created 
+with the OCI_MIGRATE mode. Also, only one primary authentication context can 
+be created for a given server handle and the primary authentication context c
+an only ever be used with that server handle. If the primary authentication 
+context is set in a service handle with a different server handle, then an 
+error will result.
+After OCISessionBegin() has been called for the server handle, and the primary 
+authentication context is set in the service handle, OCISessionBegin() may be 
+called again to initialize another authentication handle with different (or 
+the same) credentials. When OCISessionBegin() is called with a service handle 
+set with a primary authentication context, the returned authentication context
+in authp is called a user authentication context. As many user authentication 
+contexts may be initialized as desired.
+User authentication contexts may be created with the OCI_MIGRATE mode. 
+If the OCI_MIGRATE mode is not specified, then the user authentication 
+context can only ever be used with the same server handle set in svchp. If 
+OCI_MIGRATE mode is specified, then the user authentication may be set 
+with different server handles. However, the user authentication context is 
+restricted to use with only server handles which resolve to the same database 
+instance and that have equivalent primary authentication contexts. Equivalent 
+authentication contexts are those which were authenticated as the same 
+database user.
+OCI_SYSDBA, OCI_SYSOPER, and OCI_PRELIM_AUTH may only be used 
+with a primary authentication context.
+To provide credentials for a call to OCISessionBegin(), one of two methods are 
+supported. The first is to provide a valid username and password pair for 
+database authentication in the user authentication handle passed to 
+OCISessionBegin(). This involves using OCIAttrSet() to set the 
+OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD attributes on the 
+authentication handle. Then OCISessionBegin() is called with 
+OCI_CRED_RDBMS.
+Note: When the authentication handle is terminated using 
+OCISessionEnd(), the username and password attributes remain 
+unchanged and thus can be re-used in a future call to OCISessionBegin(). 
+Otherwise, they must be reset to new values before the next 
+OCISessionBegin() call.
+The second type of credentials supported are external credentials. No 
+attributes need to be set on the authentication handle before calling 
+OCISessionBegin(). The credential type is OCI_CRED_EXT. This is equivalent 
+to the Oracle7 `connect /' syntax. If values have been set for 
+OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD, then these are 
+ignored if OCI_CRED_EXT is used.
+Parameters
+svchp (IN) - a handle to a service context. There must be a valid server 
+handle set in svchp.
+errhp (IN) - an error handle to the retrieve diagnostic information.
+usrhp (IN/OUT) - a handle to an authentication context, which is initialized 
+by this call.
+credt (IN) - specifies the type of credentials to use for authentication. 
+Valid values for credt are:
+OCI_CRED_RDBMS - authenticate using a database username and 
+password pair as credentials. The attributes OCI_ATTR_USERNAME 
+and OCI_ATTR_PASSWORD should be set on the authentication 
+context before this call.
+OCI_CRED_EXT - authenticate using external credentials. No username 
+or password is provided.
+mode (IN) - specifies the various modes of operation. Valid modes are:
+OCI_DEFAULT - in this mode, the authentication context returned may 
+only ever be set with the same server context specified in svchp. This 
+establishes the primary authentication context.
+OCI_MIGRATE - in this mode, the new authentication context may be 
+set in a service handle with a different server handle. This mode 
+establishes the user authentication context. 
+OCI_SYSDBA - in this mode, the user is authenticated for SYSDBA 
+access.
+OCI_SYSOPER - in this mode, the user is authenticated for SYSOPER 
+access.
+OCI_PRELIM_AUTH - this mode may only be used with OCI_SYSDBA 
+or OCI_SYSOPER to authenticate for certain administration tasks.
+Related Functions
+OCISessionEnd()
+
+
+
+
+
+
+OCISessionEnd()
+Name
+OCI Terminate user Authentication Context
+Purpose
+Terminates a user authentication context created by OCISessionBegin()
+Syntax
+sword OCISessionEnd ( OCISvcCtx       *svchp,
+                    OCIError        *errhp,
+                    OCISession      *usrhp,
+                    ub4             mode);
+
+Comments
+The user security context associated with the service context is invalidated 
+by this call. Storage for the authentication context is not freed. The 
+transaction specified by the service context is implicitly committed. The 
+transaction handle, if explicitly allocated, may be freed if not being used.
+Resources allocated on the server for this user are freed.
+The authentication handle may be reused in a new call to OCISessionBegin().
+Parameters
+svchp (IN/OUT) - the service context handle. There must be a valid server 
+handle and user authentication handle associated with svchp.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+usrhp (IN) - de-authenticate this user. If this parameter is passed as NULL, 
+the user in the service context handle is de-authenticated.
+mode (IN) - the only valid mode is OCI_DEFAULT.
+Example
+In this example, an authentication context is destroyed.
+Related Functions
+OCISessionBegin()
+
+
+
+
+OCIStmtExecute()
+Name
+OCI EXECute
+Purpose
+This call associates an application request with a server.
+Syntax
+sword OCIStmtExecute ( OCISvcCtx           *svchp,
+                     OCIStmt             *stmtp,
+                     OCIError            *errhp,
+                     ub4                 iters,
+                     ub4                 rowoff,
+                     CONST OCISnapshot   *snap_in,
+                     OCISnapshot         *snap_out,
+                     ub4                 mode );
+Comments
+This function  is used to execute a prepared SQL statement.
+Using an execute call, the application associates a request with a server. On 
+success, OCI_SUCCESS is returned.
+If a SELECT statement is executed, the description of the select list follows 
+implicitly as a response. This description is buffered on the client side for 
+describes, fetches and define type conversions. Hence it is optimal to 
+describe a select list only after an execute. 
+Also for SELECT statements, some results are available implicitly. Rows will 
+be received and buffered at the end of the execute. For queries with small row 
+count, a prefetch causes memory to be released in the server if the end of 
+fetch is reached, an optimization that may result in memory usage reduction. 
+Set attribute call has been defined to set the number of rows to be prefetched
+per result set.
+For SELECT statements, at the end of the execute, the statement handle 
+implicitly maintains a reference to the service context on which it is 
+executed. It is the user's responsibility to maintain the integrity of the 
+service context. If the attributes of a service context is changed for 
+executing some operations on this service context, the service context must 
+be restored to have the same attributes, that a statement was executed with, 
+prior to a fetch on the statement handle. The implicit reference is maintained 
+until the statement handle is freed or the fetch is cancelled or an end of 
+fetch condition is reached.
+Note: If output variables are defined for a SELECT statement before a 
+call to OCIStmtExecute(), the number of rows specified by iters will be 
+fetched directly into the defined output buffers and additional rows 
+equivalent to the prefetch count will be prefetched. If there are no 
+additional rows, then the fetch is complete without calling 
+OCIStmtFetch().
+The execute call will return errors if the statement has bind data types that 
+are not supported in an Oracle7 server.
+Parameters
+svchp (IN/OUT) - service context handle. 
+stmtp (IN/OUT) - an statement handle - defines the statement and the 
+associated data to be executed at the server. It is invalid to pass in a 
+statement handle that has bind of data types only supported in release 8.0 
+when srvchp points to an Oracle7 server. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. If the statement is being 
+batched and it is successful, then this handle will contain this particular 
+statement execution specific errors returned from the server when the batch is 
+flushed.
+iters (IN) - the number of times this statement is executed for non-Select 
+statements. For Select statements, if iters is non-zero, then defines must 
+have been done for the statement handle. The execution fetches iters rows into 
+these predefined buffers and prefetches more rows depending upon the prefetch 
+row count. This function returns an error if iters=0 for non-SELECT 
+statements.
+rowoff (IN) - the index from which the data in an array bind is relevant for 
+this multiple row execution. 
+snap_in (IN) - this parameter is optional. if supplied, must point to a 
+snapshot descriptor of type OCI_DTYPE_SNAP.  The contents of this descriptor 
+must be obtained from the snap_out parameter of a previous call.  The 
+descriptor is ignored if the SQL is not a SELECT.  This facility allows 
+multiple service contexts to ORACLE to see the same consistent snapshot of the 
+database's committed data.  However, uncommitted data in one context is not 
+visible to another context even using the same snapshot.
+snap_out (OUT) - this parameter optional. if supplied, must point to a 
+descriptor of type OCI_DTYPE_SNAP. This descriptor is filled in with an 
+opaque representation which is the current ORACLE "system change 
+number" suitable as a snap_in input to a subsequent call to OCIStmtExecute().  
+This descriptor should not be used any longer than necessary in order to avoid 
+"snapshot too old" errors. 
+mode (IN) - The modes are:
+If OCI_DEFAULT_MODE, the default mode, is selected, the request is 
+immediately executed. Error handle contains diagnostics on error if any. 
+OCI_EXACT_FETCH - if the statement is a SQL SELECT, this mode is 
+only valid if the application has set the prefetch row count prior to this 
+call. In this mode, the OCI library will get up to the number of rows 
+specified (i.e., prefetch row count plus iters). If the number of rows 
+returned by the query is greater than this value, OCI_ERROR will be 
+returned with ORA-01422 as the implementation specific error in a 
+diagnostic record. If the number of rows returned by the query is 
+smaller than the prefetch row count, OCI_SUCCESS_WITH_INFO will 
+be returned with ORA-01403 as the implementation specific error. The 
+prefetch buffer size is ignored and the OCI library tries to allocate all the 
+space required to contain the prefetched rows. The exact fetch semantics 
+apply to only the top level rows. No more rows can be fetched for this 
+query at the end of the call. 
+OCI_KEEP_FETCH_STATE - the result set rows (not yet fetched) of this 
+statement executed in this transaction will be maintained when the 
+transaction is detached for migration. By default, a query is cancelled 
+when a transaction is detached for migration. This mode is the default 
+mode when connected to a V7 server. 
+Related Functions
+OCIStmtPrepare()
+
+
+
+
+
+OCIStmtFetch()
+Name
+OCI FetCH
+Purpose
+Fetches rows from a query.
+Syntax
+sword OCIStmtFetch ( OCIStmt     *stmtp,
+                   OCIError    *errhp, 
+                   ub4         nrows,
+                   ub2         orientation,
+                   ub4         mode);
+Comments
+The fetch call is a local call, if prefetched rows suffice. However, this is 
+transparent to the application. If LOB columns are being read, LOB locators 
+are fetched for subsequent LOB operations to be performed on these locators. 
+Prefetching is turned off if LONG columns are involved. 
+A fetch with nrows set to 0 rows effectively cancels the fetch for this 
+statement.
+Parameters
+stmtp (IN) - a statement (application request) handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+nrows (IN) - number of rows to be fetched from the current position.
+orientation (IN) - for release 8.0, the only acceptable value is 
+OCI_FETCH_NEXT, which is also the default value. 
+mode (IN) - for release 8.0, beta-1, the following mode is defined.
+OCI_DEFAULT - default mode
+OCI_EOF_FETCH - indicates that it is the last fetch from the result set. 
+If nrows is non-zero, setting this mode effectively cancels fetching after 
+retrieving nrows, otherwise it cancels fetching immediately. 
+Related Functions
+OCIAttrGet()
+
+OCIStmtFetch2()
+Name
+OCI FetCH2
+Purpose
+Fetches rows from a query.
+Syntax
+sword OCIStmtFetch2 ( OCIStmt     *stmtp,
+                   OCIError    *errhp, 
+                   ub4         nrows,
+                   ub2         orientation,
+                   ub4         scrollOffset,
+                   ub4         mode);
+Comments
+The fetch call works similar to the OCIStmtFetch call with the 
+addition of the fetchOffset parameter. It can be used on any 
+statement handle, whether it is scrollable or not. For a 
+non-scrollable statement handle, the only acceptable value 
+will be OCI_FETCH_NEXT, and the fetchOffset parameter will be 
+ignored. Applications are encouraged to use this new call. 
+
+A fetchOffset with OCI_FETCH_RELATIVE is equivalent to 
+OCI_FETCH_CURRENT with a value of 0, is equivalent to 
+OCI_FETCH_NEXT with a value of 1, and equivalent to 
+OCI_FETCH_PRIOR with a value of -1. Note that the range of 
+accessible rows is [1,OCI_ATTR_ROW_COUNT] beyond which an 
+error could be raised if sufficient rows do not exist in 
+
+The fetch call is a local call, if prefetched rows suffice. However, this is 
+transparent to the application. If LOB columns are being read, LOB locators 
+are fetched for subsequent LOB operations to be performed on these locators. 
+Prefetching is turned off if LONG columns are involved. 
+A fetch with nrows set to 0 rows effectively cancels the fetch for this 
+statement.
+Parameters
+stmtp (IN) - a statement (application request) handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+nrows (IN) - number of rows to be fetched from the current position.
+It defaults to 1 for orientation OCI_FETCH_LAST.
+orientation (IN) -  The acceptable values are as follows, with 
+OCI_FETCH_NEXT being the default value.
+OCI_FETCH_CURRENT gets the current row, 
+OCI_FETCH_NEXT gets the next row from the current position,
+OCI_FETCH_FIRST gets the first row in the result set,
+OCI_FETCH_LAST gets the last row in the result set, 
+OCI_FETCH_PRIOR gets the previous row from the current row in the result set, 
+OCI_FETCH_ABSOLUTE will fetch the row number (specified by fetchOffset 
+parameter) in the result set using absolute positioning,
+OCI_FETCH_RELATIVE will fetch the row number (specified by fetchOffset 
+parameter) in the result set using relative positioning.
+scrollOffset(IN) - offset used with the OCI_FETCH_ABSOLUTE and 
+OCI_FETCH_RELATIVE orientation parameters only. It specify
+the new current position for scrollable result set. It is 
+ignored for non-scrollable result sets. 
+mode (IN) - for release 8.0, beta-1, the following mode is defined.
+OCI_DEFAULT - default mode
+OCI_EOF_FETCH - indicates that it is the last fetch from the result set. 
+If nrows is non-zero, setting this mode effectively cancels fetching after 
+retrieving nrows, otherwise it cancels fetching immediately. 
+Related Functions
+OCIAttrGet()
+
+
+
+OCIStmtGetPieceInfo()
+Name
+OCI Get Piece Information
+Purpose
+Returns piece information for a piecewise operation.
+Syntax
+sword OCIStmtGetPieceInfo( CONST OCIStmt  *stmtp,
+                         OCIError       *errhp,
+                         dvoid          **hndlpp,
+                         ub4            *typep,
+                         ub1            *in_outp,
+                         ub4            *iterp, 
+                         ub4            *idxp,
+                         ub1            *piecep );
+
+Comments
+When an execute/fetch call returns OCI_NEED_DATA to get/return a 
+dynamic bind/define value or piece, OCIStmtGetPieceInfo() returns the 
+relevant information: bind/define handle, iteration or index number and 
+which piece.
+See the section "Runtime Data Allocation and Piecewise Operations" on page 
+5-16 for more information about using OCIStmtGetPieceInfo().
+Parameters
+stmtp (IN) - the statement when executed returned OCI_NEED_DATA. 
+errhp (OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+hndlpp (OUT) - returns a pointer to the bind or define handle of the bind or 
+define whose runtime data is required or is being provided.
+typep (OUT) - the type of the handle pointed to by hndlpp: OCI_HTYPE_BIND 
+(for a bind handle) or OCI_HTYPE_DEFINE (for a define handle).
+in_outp (OUT) - returns OCI_PARAM_IN if the data is required for an IN bind 
+value. Returns OCI_PARAM_OUT if the data is available as an OUT bind 
+variable or a define position value.
+iterp (OUT) - returns the row number of a multiple row operation.
+idxp (OUT) - the index of an array element of a PL/SQL array bind operation.
+piecep (OUT) - returns one of the following defined values - 
+OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE and 
+OCI_LAST_PIECE. The default value is always OCI_ONE_PIECE. 
+Related Functions
+OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(), 
+OCIStmtSetPieceInfo()
+
+
+
+
+OCIStmtPrepare()
+Name
+OCI Statement REQuest
+Purpose
+This call defines the SQL/PLSQL statement to be executed.
+Syntax
+sword OCIStmtPrepare ( OCIStmt      *stmtp,
+                     OCIError     *errhp,
+                     CONST OraText   *stmt, 
+                     ub4          stmt_len,
+                     ub4          language,
+                     ub4          mode);
+Comments
+This call is used to prepare a SQL or PL/SQL statement for execution. The 
+OCIStmtPrepare() call defines an application request. 
+This is a purely local call. Data values for this statement initialized in 
+subsequent bind calls will be stored in a bind handle which will hang off this 
+statement handle.
+This call does not create an association between this statement handle and any 
+particular server.
+See the section "Preparing Statements" on page 2-21 for more information 
+about using this call.
+Parameters
+stmtp (IN) - a statement handle.
+errhp (IN) - an error handle to retrieve diagnostic information.
+stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null-terminated 
+string. The pointer to the OraText of the statement must be available as long 
+as the statement is executed.
+stmt_len (IN) - length of the statement. Must not be zero.
+language (IN) - V7, V8, or native syntax. Possible values are:
+OCI_V7_SYNTAX - V7 ORACLE parsing syntax
+OCI_V8_SYNTAX - V8 ORACLE parsing syntax
+OCI_NTV_SYNTAX - syntax depending upon the version of the server. 
+mode (IN) - the only defined mode is OCI_DEFAULT for default mode. 
+Example
+This example demonstrates the use of OCIStmtPrepare(), as well as the OCI 
+application initialization calls.
+Related Functions
+OCIAttrGet(), OCIStmtExecute()
+
+
+OCIStmtPrepare2()
+Name
+OCI Statement REQuest with (a) early binding to svchp and/or
+(b) stmt caching
+Purpose
+This call defines the SQL/PLSQL statement to be executed.
+Syntax
+sword OCIStmtPrepare2 ( OCISvcCtx *svchp,
+                     OCIStmt      **stmtp,
+                     OCIError     *errhp,
+                     CONST OraText   *stmt,
+                     ub4          stmt_len,
+                     CONST OraText *key,
+                     ub4          key_len,
+                     ub4          language,
+                     ub4          mode);
+Comments
+This call is used to prepare a SQL or PL/SQL statement for execution. The
+OCIStmtPrepare() call defines an application request.
+This is a purely local call. Data values for this statement initialized in
+subsequent bind calls will be stored in a bind handle which will hang off this
+statement handle.
+This call creates an association between the statement handle and a service
+context. It differs from OCIStmtPrepare in that respect.It also supports
+stmt caching. The stmt will automatically be cached if the authp of the stmt
+has enabled stmt caching.
+Parameters
+svchp (IN) - the service context handle that contains the session that
+             this stmt handle belongs to.
+stmtp (OUT) - an unallocated stmt handle must be pased in. An allocated
+              and prepared  statement handle will be returned.
+errhp (IN) - an error handle to retrieve diagnostic information.
+stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null-
+            terminated string. The pointer to the OraText of the statement 
+            must be available as long as the statement is executed.
+stmt_len (IN) - length of the statement. Must not be zero.
+key (IN) - This is only Valid for OCI Stmt Caching. It indicates the
+           key to search with. It thus optimizes the search in the cache.
+key_len (IN) - the length of the key. This, too, is onlly valid for stmt
+               caching.
+language (IN) - V7, V8, or native syntax. Possible values are:
+OCI_V7_SYNTAX - V7 ORACLE parsing syntax
+OCI_V8_SYNTAX - V8 ORACLE parsing syntax
+OCI_NTV_SYNTAX - syntax depending upon the version of the server.
+mode (IN) - the defined modes are OCI_DEFAULT and OCI_PREP2_CACHE_SEARCHONLY.
+Example
+Related Functions
+OCIStmtExecute(), OCIStmtRelease()
+
+
+OCIStmtRelease()
+Name
+OCI Statement Release. This call is used to relesae the stmt that
+was retreived using OCIStmtPrepare2(). If the stmt is release
+using this call, OCIHandleFree() must not be called on the stmt
+handle.
+Purpose
+This call releases the statement obtained by OCIStmtPrepare2
+Syntax
+sword OCIStmtRelease ( OCIStmt      *stmtp,
+                     OCIError     *errhp,
+                     cONST OraText *key,
+                     ub4          key_len,
+                     ub4          mode);
+Comments
+This call is used to release a handle obtained via OCIStmtPrepare2().
+It also frees the memory associated with the handle.
+This is a purely local call.
+Parameters
+stmtp (IN/OUT) - The statement handle to be released/freed.
+errhp (IN) - an error handle to retrieve diagnostic information.
+key (IN) - This is only Valid for OCI Stmt Caching. It indicates the
+           key to tag the stmt with.
+key_len (IN) - the length of the key. This, too, is only valid for stmt
+               caching.
+mode (IN) - the defined modes are OCI_DEFAULT for default mode and
+            OCI_STRLS_CACHE_DELETE (only used for Stmt Caching).
+Example
+Related Functions
+OCIStmtExecute(), OCIStmtPrepare2()
+
+
+OCIStmtSetPieceInfo()
+Name
+OCI Set Piece Information
+Purpose
+Sets piece information for a piecewise operation.
+Syntax
+sword OCIStmtSetPieceInfo ( dvoid             *hndlp,
+                          ub4               type,
+                          OCIError          *errhp,
+                          CONST dvoid       *bufp,
+                          ub4               *alenp, 
+                          ub1               piece,
+                          CONST dvoid       *indp, 
+                          ub2               *rcodep ); 
+Comments
+When an execute call returns OCI_NEED_DATA to get a dynamic IN/OUT 
+bind value or piece, OCIStmtSetPieceInfo() sets the piece information: the 
+buffer, the length, the indicator and which piece is currently being processed.
+For more information about using OCIStmtSetPieceInfo() see the section 
+"Runtime Data Allocation and Piecewise Operations" on page 5-16.
+Parameters
+hndlp (IN/OUT) - the bind/define handle.
+type (IN) - type of the handle. 
+errhp (OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+bufp (IN/OUT) - bufp is a pointer to a storage containing the data value or 
+the piece when it is an IN bind variable, otherwise bufp is a pointer to 
+storage for getting a piece or a value for OUT binds and define variables. For
+named data types or REFs, a pointer to the object or REF is returned.
+alenp (IN/OUT) - the length of the piece or the value. 
+piece (IN) - the piece parameter. The following are valid values: 
+OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE, or 
+OCI_LAST_PIECE. 
+The default value is OCI_ONE_PIECE. This parameter is used for IN bind 
+variables only.
+indp (IN/OUT) - indicator. A pointer to a sb2 value or pointer to an indicator 
+structure for named data types (SQLT_NTY) and REFs (SQLT_REF), i.e., *indp 
+is either an sb2 or a dvoid * depending upon the data type.
+rcodep (IN/OUT) - return code. 
+Related Functions
+OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(), 
+OCIStmtGetPieceInfo()
+
+
+OCIFormatInit
+Name
+OCIFormat Package Initialize
+Purpose
+Initializes the OCIFormat package.
+Syntax
+sword OCIFormatInit(dvoid *hndl, OCIError *err);
+Comments
+This routine must be called before calling any other OCIFormat routine.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - OCI environment or session handle
+err (IN/OUT) - OCI error handle
+Related Functions
+OCIFormatTerm()
+
+
+OCIFormatString
+Name
+OCIFormat Package Format String
+Purpose
+Writes a text string into the supplied text buffer using the argument
+list submitted to it and in accordance with the format string given.
+Syntax
+sword OCIFormatString(dvoid *hndl, OCIError *err, OraText *buffer,
+                      sbig_ora bufferLength, sbig_ora *returnLength,
+                      CONST OraText *formatString, ...);
+Comments
+The first call to this routine must be preceded by a call to the
+OCIFormatInit routine that initializes the OCIFormat package
+for use.  When this routine is no longer needed then terminate
+the OCIFormat package by a call to the OCIFormatTerm routine.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl         (IN/OUT) - OCI environment or session handle
+err          (IN/OUT) - OCI error handle
+buffer       (OUT)    - text buffer for the string
+bufferLength (IN)     - length of the text buffer
+returnLength (OUT)    - length of the formatted string
+formatString (IN)     - format specification string
+...          (IN)     - variable argument list
+Related Functions
+
+
+OCIFormatTerm 
+Name
+OCIFormat Package Terminate
+Purpose
+Terminates the OCIFormat package.
+Syntax
+sword OCIFormatTerm(dvoid *hndl, OCIError *err);
+Comments
+It must be called after the OCIFormat package is no longer being used.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - OCI environment or session handle
+err (IN/OUT) - OCI error handle
+Related Functions
+OCIFormatInit()
+
+
+OCIFormatTUb1
+Name
+OCIFormat Package ub1 Type
+Purpose
+Return the type value for the ub1 type.
+Syntax
+sword OCIFormatTUb1(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUb2
+Name
+OCIFormat Package ub2 Type
+Purpose
+Return the type value for the ub2 type.
+Syntax
+sword OCIFormatTUb2(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUb4
+Name
+OCIFormat Package ub4 Type
+Purpose
+Return the type value for the ub4 type.
+Syntax
+sword OCIFormatTUb4(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUword
+Name
+OCIFormat Package uword Type
+Purpose
+Return the type value for the uword type.
+Syntax
+sword OCIFormatTUword(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUbig_ora
+Name
+OCIFormat Package ubig_ora Type
+Purpose
+Return the type value for the ubig_ora type.
+Syntax
+sword OCIFormatTUbig_ora(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSb1
+Name
+OCIFormat Package sb1 Type
+Purpose
+Return the type value for the sb1 type.
+Syntax
+sword OCIFormatTSb1(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSb2
+Name
+OCIFormat Package sb2 Type
+Purpose
+Return the type value for the sb2 type.
+Syntax
+sword OCIFormatTSb2(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSb4
+Name
+OCIFormat Package sb4 Type
+Purpose
+Return the type value for the sb4 type.
+Syntax
+sword OCIFormatTSb4(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSword
+Name
+OCIFormat Package sword Type
+Purpose
+Return the type value for the sword type.
+Syntax
+sword OCIFormatTSword(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSbig_ora
+Name
+OCIFormat Package sbig_ora Type
+Purpose
+Return the type value for the sbig_ora type.
+Syntax
+sword OCIFormatTSbig_ora(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEb1
+Name
+OCIFormat Package eb1 Type
+Purpose
+Return the type value for the eb1 type.
+Syntax
+sword OCIFormatTEb1(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEb2
+Name
+OCIFormat Package eb2 Type
+Purpose
+Return the type value for the eb2 type.
+Syntax
+sword OCIFormatTEb2(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEb4
+Name
+OCIFormat Package eb4 Type
+Purpose
+Return the type value for the eb4 type.
+Syntax
+sword OCIFormatTEb4(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEword
+Name
+OCIFormat Package eword Type
+Purpose
+Return the type value for the eword type.
+Syntax
+sword OCIFormatTEword(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTChar
+Name
+OCIFormat Package text Type
+Purpose
+Return the type value for the text type.
+Syntax
+sword OCIFormatTChar(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTText
+Name
+OCIFormat Package *text Type
+Purpose
+Return the type value for the *text type.
+Syntax
+sword OCIFormatTText(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTDouble
+Name
+OCIFormat Package double Type
+Purpose
+Return the type value for the double type.
+Syntax
+sword OCIFormatTDouble(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatDvoid
+Name
+OCIFormat Package dvoid Type
+Purpose
+Return the type value for the dvoid type.
+Syntax
+sword OCIFormatTDvoid(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEnd
+Name
+OCIFormat Package end Type
+Purpose
+Return the list terminator's "type".
+Syntax
+sword OCIFormatTEnd(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCISvcCtxToLda()
+Name
+OCI toggle SerVice context handle to Version 7 Lda_Def
+Purpose
+Toggles between a V8 service context handle and a V7 Lda_Def.
+Syntax
+sword OCISvcCtxToLda ( OCISvcCtx    *srvhp,
+                     OCIError     *errhp,
+                     Lda_Def      *ldap );
+Comments
+Toggles between an Oracle8 service context handle and an Oracle7 Lda_Def.
+This function can only be called after a service context has been properly 
+initialized.
+Once the service context has been translated to an Lda_Def, it can be used in 
+release 7.x OCI calls (e.g., obindps(), ofen()).
+Note: If there are multiple service contexts which share the same server 
+handle, only one can be in V7 mode at any time.
+The action of this call can be reversed by passing the resulting Lda_Def to 
+the OCILdaToSvcCtx() function.
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+ldap (IN/OUT) - a Logon Data Area for V7-style OCI calls which is initialized 
+by this call. 
+Related Functions
+OCILdaToSvcCtx()
+
+
+
+
+OCITransCommit()
+Name
+OCI TX (transaction) CoMmit
+Purpose
+Commits the transaction associated with a specified service context.
+Syntax
+sword OCITransCommit ( OCISvcCtx    *srvcp,
+                     OCIError     *errhp,
+                     ub4          flags );
+Comments
+The transaction currently associated with the service context is committed. If 
+it is a distributed transaction that the server cannot commit, this call 
+additionally retrieves the state of the transaction from the database to be 
+returned to the user in the error handle.
+If the application has defined multiple transactions, this function operates 
+on the transaction currently associated with the service context. If the 
+application is working with only the implicit local transaction created when 
+database changes are made, that implicit transaction is committed.
+If the application is running in the object mode, then the modified or updated 
+objects in the object cache for this transaction are also committed.
+The flags parameter is used for one-phase commit optimization in distributed 
+transactions. If the transaction is non-distributed, the flags parameter is 
+ignored, and OCI_DEFAULT can be passed as its value. OCI applications 
+managing global transactions should pass a value of 
+OCI_TRANS_TWOPHASE to the flags parameter for a two-phase commit. The 
+default is one-phase commit.
+Under normal circumstances, OCITransCommit() returns with a status 
+indicating that the transaction has either been committed or rolled back. With 
+distributed transactions, it is possible that the transaction is now in-doubt 
+(i.e., neither committed nor aborted). In this case, OCITransCommit() 
+attempts to retrieve the status of the transaction from the server. 
+The status is returned.
+Parameters
+srvcp (IN) - the service context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags -see the "Comments" section above.
+Related Functions
+OCITransRollback()
+
+
+
+
+OCITransDetach()
+Name
+OCI TX (transaction) DeTach
+Purpose
+Detaches a transaction.
+Syntax
+sword OCITransDetach ( OCISvcCtx    *srvcp,
+                     OCIError     *errhp,
+                     ub4          flags);
+Comments
+Detaches a global transaction from the service context handle. The transaction 
+currently attached to the service context handle becomes inactive at the end 
+of this call. The transaction may be resumed later by calling OCITransStart(), 
+specifying  a flags value of OCI_TRANS_RESUME.
+When a transaction is detached, the value which was specified in the timeout 
+parameter of OCITransStart() when the transaction was started is used to 
+determine the amount of time the branch can remain inactive before being 
+deleted by the server's PMON process.
+Note: The transaction can be resumed by a different process than the one 
+that detached it, provided that the transaction has the same 
+authorization.
+Parameters
+srvcp (IN) - the service context handle. 
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags (IN) - you must pass a value of OCI_DEFAULT for this parameter.
+Related Functions
+OCITransStart()
+
+
+
+OCITransForget()
+Name
+OCI TX (transaction) ForGeT
+Purpose
+Causes the server to forget a heuristically completed global transaction.
+Syntax
+sword OCITransForget ( OCISvcCtx     *svchp, 
+                     OCIError      *errhp,
+                     ub4           flags);
+
+Comments
+
+Forgets a heuristically completed global transaction. The server deletes the 
+status of the transaction from the system's pending transaction table.
+The XID of the transaction to be forgotten is set as an attribute of the 
+transaction handle (OCI_ATTR_XID).
+Parameters
+srvcp (IN) - the service context handle - the transaction is rolled back.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags (IN) - you must pass OCI_DEFAULT for this parameter.
+Related Functions
+OCITransCommit(), OCITransRollback()
+
+
+OCITransMultiPrepare() 
+Name
+OCI Trans(action) Multi-Branch Prepare
+Purpose
+Prepares a transaction with multiple branches in a single call.
+Syntax
+sword OCITransMultiPrepare ( OCISvcCtx    *svchp,
+                             ub4           numBranches,
+                             OCITrans     **txns,
+                             OCIError     **errhp);
+
+Comments
+
+Prepares the specified global transaction for commit.
+This call is valid only for distributed transactions.
+This call is an advanced performance feature intended for use only in
+situations where the caller is responsible for preparing all the branches
+in a transaction. 
+Parameters
+srvcp (IN) - the service context handle. 
+numBranches (IN) - This is the number of branches expected. It is also the
+array size for the next two parameters.
+txns (IN) - This is the array of transaction handles for the branches to
+prepare. They should all have the OCI_ATTR_XID set. The global transaction
+ID should be the same.
+errhp (IN) - This is the array of error handles. If OCI_SUCCESS is not
+returned, then these will indicate which branches received which errors.
+Related Functions
+OCITransPrepare()
+
+
+OCITransPrepare()
+Name
+OCI TX (transaction) PREpare
+Purpose
+Prepares a transaction for commit.
+Syntax
+sword OCITransPrepare ( OCISvcCtx    *svchp, 
+                      OCIError     *errhp,
+                      ub4          flags);
+
+Comments
+
+Prepares the specified global transaction for commit.
+This call is valid only for distributed transactions.
+The call returns OCI_SUCCESS_WITH_INFO if the transaction has not made 
+any changes. The error handle will indicate that the transaction is read-only. 
+The flag parameter is not currently used. 
+Parameters
+srvcp (IN) - the service context handle. 
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags (IN) - you must pass OCI_DEFAULT for this parameter.
+Related Functions
+OCITransCommit(), OCITransForget()
+
+
+
+
+OCITransRollback()
+Name
+OCI TX (transaction) RoLlback
+Purpose
+Rolls back the current transaction.
+Syntax
+sword OCITransRollback ( dvoid        *svchp, 
+                       OCIError     *errhp,
+                       ub4          flags );
+Comments
+The current transaction- defined as the set of statements executed since the 
+last OCITransCommit() or since OCISessionBegin()-is rolled back.
+If the application is running under object mode then the modified or updated 
+objects in the object cache for this transaction are also rolled back.
+An error is returned if an attempt is made to roll back a global transaction 
+that is not currently active.
+Parameters
+svchp (IN) - a service context handle. The transaction currently set in the 
+service context handle is rolled back.
+errhp -(IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags - you must pass a value of OCI_DEFAULT for this parameter.
+Related Functions
+OCITransCommit()
+
+
+
+
+OCITransStart()
+Name
+OCI TX (transaction) STart
+Purpose
+Sets the beginning of a transaction.
+Syntax
+sword OCITransStart ( OCISvcCtx    *svchp, 
+                    OCIError     *errhp, 
+                    uword        timeout,
+                    ub4          flags);
+
+Comments
+This function sets the beginning of a global or serializable transaction. The 
+transaction context currently associated with the service context handle is 
+initialized at the end of the call if the flags parameter specifies that a new 
+transaction should be started.
+The XID of the transaction is set as an attribute of the transaction handle 
+(OCI_ATTR_XID)
+Parameters
+svchp (IN/OUT) - the service context handle. The transaction context in the 
+service context handle is initialized at the end of the call if the flag 
+specified a new transaction to be started.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+err and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+timeout (IN) - the time, in seconds, to wait for a transaction to become 
+available for resumption when OCI_TRANS_RESUME is specified. When 
+OCI_TRANS_NEW is specified, this value is stored and may be used later by 
+OCITransDetach().
+flags (IN) - specifies whether a new transaction is being started or an 
+existing transaction is being resumed. Also specifies serializiability or 
+read-only status. More than a single value can be specified. By default, 
+a read/write transaction is started. The flag values are:
+OCI_TRANS_NEW - starts a new transaction branch. By default starts a 
+tightly coupled and migratable branch.
+OCI_TRANS_TIGHT - explicitly specifies a tightly coupled branch
+OCI_TRANS_LOOSE - specifies a loosely coupled branch
+OCI_TRANS_RESUME - resumes an existing transaction branch. 
+OCI_TRANS_READONLY - start a readonly transaction
+OCI_TRANS_SERIALIZABLE - start a serializable transaction
+Related Functions
+OCITransDetach()
+
+
+
+
+
+******************************************************************************/
+/*-----------------------Dynamic Callback Function Pointers------------------*/
+ 
+ 
+typedef sb4 (*OCICallbackInBind)(dvoid *ictxp, OCIBind *bindp, ub4 iter,
+                                  ub4 index, dvoid **bufpp, ub4 *alenp,
+                                  ub1 *piecep, dvoid **indp);
+ 
+typedef sb4 (*OCICallbackOutBind)(dvoid *octxp, OCIBind *bindp, ub4 iter,
+                                 ub4 index, dvoid **bufpp, ub4 **alenp,
+                                 ub1 *piecep, dvoid **indp,
+                                 ub2 **rcodep);
+ 
+typedef sb4 (*OCICallbackDefine)(dvoid *octxp, OCIDefine *defnp, ub4 iter,
+                                 dvoid **bufpp, ub4 **alenp, ub1 *piecep,
+                                 dvoid **indp, ub2 **rcodep);
+
+typedef sword (*OCIUserCallback)(dvoid *ctxp, dvoid *hndlp, ub4 type,
+                                 ub4 fcode, ub4 when, sword returnCode,
+                                 sb4 *errnop, va_list arglist);
+
+typedef sword (*OCIEnvCallbackType)(OCIEnv *env, ub4 mode,
+                                   size_t xtramem_sz, dvoid *usrmemp,
+                                   OCIUcb *ucbDesc); 
+
+typedef sb4 (*OCICallbackLobRead)(dvoid *ctxp, CONST dvoid *bufp,
+                                             ub4 len, ub1 piece);
+
+typedef sb4 (*OCICallbackLobWrite)(dvoid *ctxp, dvoid *bufp, 
+                                          ub4 *lenp, ub1 *piece);
+
+#ifdef ORAXB8_DEFINED
+
+typedef sb4 (*OCICallbackLobRead2)(dvoid *ctxp, CONST dvoid *bufp, oraub8 len,
+                                   ub1 piece, dvoid **changed_bufpp,
+                                   oraub8 *changed_lenp);
+
+typedef sb4 (*OCICallbackLobWrite2)(dvoid *ctxp, dvoid *bufp, oraub8 *lenp,
+                                    ub1 *piece, dvoid **changed_bufpp,
+                                    oraub8 *changed_lenp);
+#endif
+
+typedef sb4 (*OCICallbackAQEnq)(dvoid *ctxp, dvoid **payload, 
+                                dvoid **payload_ind);
+
+typedef sb4 (*OCICallbackAQDeq)(dvoid *ctxp, dvoid **payload, 
+                                dvoid **payload_ind);
+
+/*--------------------------Failover Callback Structure ---------------------*/
+typedef sb4 (*OCICallbackFailover)(dvoid *svcctx, dvoid *envctx,
+                                   dvoid *fo_ctx, ub4 fo_type,
+                                   ub4 fo_event);
+
+typedef struct
+{
+  OCICallbackFailover callback_function;
+  dvoid *fo_ctx;
+} 
+OCIFocbkStruct;
+
+/*****************************************************************************
+                         ACTUAL PROTOTYPE DECLARATIONS
+******************************************************************************/
+
+sword   OCIInitialize   (ub4 mode, dvoid *ctxp, 
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr) );
+
+sword   OCITerminate( ub4 mode);
+
+sword   OCIEnvCreate (OCIEnv **envp, ub4 mode, dvoid *ctxp,
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+                 size_t xtramem_sz, dvoid **usrmempp);
+
+sword   OCIEnvNlsCreate (OCIEnv **envp, ub4 mode, dvoid *ctxp,
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+                 size_t xtramem_sz, dvoid **usrmempp,
+                 ub2 charset, ub2 ncharset);
+
+sword   OCIFEnvCreate (OCIEnv **envp, ub4 mode, dvoid *ctxp,
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+                 size_t xtramem_sz, dvoid **usrmempp, dvoid *fupg);
+
+sword   OCIHandleAlloc(CONST dvoid *parenth, dvoid **hndlpp, CONST ub4 type, 
+                       CONST size_t xtramem_sz, dvoid **usrmempp);
+
+sword   OCIHandleFree(dvoid *hndlp, CONST ub4 type);
+
+
+sword   OCIDescriptorAlloc(CONST dvoid *parenth, dvoid **descpp, 
+                           CONST ub4 type, CONST size_t xtramem_sz, 
+                           dvoid **usrmempp);
+
+sword   OCIDescriptorFree(dvoid *descp, CONST ub4 type);
+
+sword   OCIEnvInit (OCIEnv **envp, ub4 mode, 
+                    size_t xtramem_sz, dvoid **usrmempp);
+
+sword   OCIServerAttach  (OCIServer *srvhp, OCIError *errhp,
+                          CONST OraText *dblink, sb4 dblink_len, ub4 mode);
+
+sword   OCIServerDetach  (OCIServer *srvhp, OCIError *errhp, ub4 mode);
+
+sword   OCISessionBegin  (OCISvcCtx *svchp, OCIError *errhp, OCISession *usrhp,
+                          ub4 credt, ub4 mode);
+
+sword   OCISessionEnd   (OCISvcCtx *svchp, OCIError *errhp, OCISession *usrhp, 
+                         ub4 mode);
+
+sword   OCILogon (OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp, 
+                  CONST OraText *username, ub4 uname_len, 
+                  CONST OraText *password, ub4 passwd_len, 
+                  CONST OraText *dbname, ub4 dbname_len);
+
+sword   OCILogon2 (OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp,
+                  CONST OraText *username, ub4 uname_len,
+                  CONST OraText *password, ub4 passwd_len,
+                  CONST OraText *dbname, ub4 dbname_len,
+                  ub4 mode);
+
+sword   OCILogoff (OCISvcCtx *svchp, OCIError *errhp);
+
+
+sword   OCIPasswordChange   (OCISvcCtx *svchp, OCIError *errhp, 
+                             CONST OraText *user_name, ub4 usernm_len, 
+                             CONST OraText *opasswd, ub4 opasswd_len, 
+                             CONST OraText *npasswd, ub4 npasswd_len, 
+                             ub4 mode);
+
+sword   OCIStmtPrepare   (OCIStmt *stmtp, OCIError *errhp, CONST OraText *stmt,
+                          ub4 stmt_len, ub4 language, ub4 mode);
+
+sword OCIStmtPrepare2 ( OCISvcCtx *svchp, OCIStmt **stmtp, OCIError *errhp,
+                     CONST OraText *stmt, ub4 stmt_len, CONST OraText *key,
+                     ub4 key_len, ub4 language, ub4 mode);
+
+sword OCIStmtRelease ( OCIStmt *stmtp, OCIError *errhp, CONST OraText *key,
+                       ub4 key_len, ub4 mode);
+
+sword   OCIBindByPos  (OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
+                       ub4 position, dvoid *valuep, sb4 value_sz,
+                       ub2 dty, dvoid *indp, ub2 *alenp, ub2 *rcodep,
+                       ub4 maxarr_len, ub4 *curelep, ub4 mode);
+
+sword   OCIBindByName   (OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
+                         CONST OraText *placeholder, sb4 placeh_len, 
+                         dvoid *valuep, sb4 value_sz, ub2 dty, 
+                         dvoid *indp, ub2 *alenp, ub2 *rcodep, 
+                         ub4 maxarr_len, ub4 *curelep, ub4 mode);
+
+sword   OCIBindObject  (OCIBind *bindp, OCIError *errhp, CONST OCIType *type, 
+                        dvoid **pgvpp, ub4 *pvszsp, dvoid **indpp, 
+                        ub4 *indszp);
+
+sword   OCIBindDynamic   (OCIBind *bindp, OCIError *errhp, dvoid *ictxp,
+                          OCICallbackInBind icbfp, dvoid *octxp,
+                          OCICallbackOutBind ocbfp);
+
+sword   OCIBindArrayOfStruct   (OCIBind *bindp, OCIError *errhp, 
+                                ub4 pvskip, ub4 indskip,
+                                ub4 alskip, ub4 rcskip);
+
+sword   OCIStmtGetPieceInfo   (OCIStmt *stmtp, OCIError *errhp, 
+                               dvoid **hndlpp, ub4 *typep,
+                               ub1 *in_outp, ub4 *iterp, ub4 *idxp, 
+                               ub1 *piecep);
+
+sword   OCIStmtSetPieceInfo   (dvoid *hndlp, ub4 type, OCIError *errhp, 
+                               CONST dvoid *bufp, ub4 *alenp, ub1 piece, 
+                               CONST dvoid *indp, ub2 *rcodep);
+
+sword   OCIStmtExecute  (OCISvcCtx *svchp, OCIStmt *stmtp, OCIError *errhp, 
+                         ub4 iters, ub4 rowoff, CONST OCISnapshot *snap_in, 
+                         OCISnapshot *snap_out, ub4 mode);
+
+sword   OCIDefineByPos  (OCIStmt *stmtp, OCIDefine **defnp, OCIError *errhp,
+                         ub4 position, dvoid *valuep, sb4 value_sz, ub2 dty,
+                         dvoid *indp, ub2 *rlenp, ub2 *rcodep, ub4 mode);
+
+sword   OCIDefineObject  (OCIDefine *defnp, OCIError *errhp, 
+                          CONST OCIType *type, dvoid **pgvpp, 
+                          ub4 *pvszsp, dvoid **indpp, ub4 *indszp);
+
+sword   OCIDefineDynamic   (OCIDefine *defnp, OCIError *errhp, dvoid *octxp,
+                            OCICallbackDefine ocbfp);
+
+sword   OCIRowidToChar  (OCIRowid *rowidDesc, OraText *outbfp, ub2 *outbflp,
+                         OCIError *errhp);
+
+sword   OCIDefineArrayOfStruct  (OCIDefine *defnp, OCIError *errhp, ub4 pvskip,
+                                 ub4 indskip, ub4 rlskip, ub4 rcskip);
+
+sword   OCIStmtFetch   (OCIStmt *stmtp, OCIError *errhp, ub4 nrows, 
+                        ub2 orientation, ub4 mode);
+
+sword   OCIStmtFetch2   (OCIStmt *stmtp, OCIError *errhp, ub4 nrows, 
+                        ub2 orientation, sb4 scrollOffset, ub4 mode);
+
+sword   OCIStmtGetBindInfo   (OCIStmt *stmtp, OCIError *errhp, ub4 size, 
+                              ub4 startloc,
+                              sb4 *found, OraText *bvnp[], ub1 bvnl[],
+                              OraText *invp[], ub1 inpl[], ub1 dupl[],
+                              OCIBind **hndl);
+
+sword   OCIDescribeAny  (OCISvcCtx *svchp, OCIError *errhp, 
+                         dvoid *objptr, 
+                         ub4 objnm_len, ub1 objptr_typ, ub1 info_level,
+                         ub1 objtyp, OCIDescribe *dschp);
+
+sword   OCIParamGet (CONST dvoid *hndlp, ub4 htype, OCIError *errhp, 
+                     dvoid **parmdpp, ub4 pos);
+
+sword   OCIParamSet(dvoid *hdlp, ub4 htyp, OCIError *errhp, CONST dvoid *dscp,
+                    ub4 dtyp, ub4 pos);
+
+sword   OCITransStart  (OCISvcCtx *svchp, OCIError *errhp, 
+                        uword timeout, ub4 flags );
+
+sword   OCITransDetach  (OCISvcCtx *svchp, OCIError *errhp, ub4 flags );
+
+sword   OCITransCommit  (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+sword   OCITransRollback  (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+sword   OCITransPrepare (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+sword   OCITransMultiPrepare (OCISvcCtx *svchp, ub4 numBranches, 
+                              OCITrans **txns, OCIError **errhp);
+
+sword   OCITransForget (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+sword   OCIErrorGet   (dvoid *hndlp, ub4 recordno, OraText *sqlstate,
+                       sb4 *errcodep, OraText *bufp, ub4 bufsiz, ub4 type);
+
+sword   OCILobAppend  (OCISvcCtx *svchp, OCIError *errhp, 
+                       OCILobLocator *dst_locp,
+                       OCILobLocator *src_locp);
+
+sword   OCILobAssign (OCIEnv *envhp, OCIError *errhp, 
+                      CONST OCILobLocator *src_locp, 
+                      OCILobLocator **dst_locpp);
+
+sword   OCILobCharSetForm (OCIEnv *envhp, OCIError *errhp, 
+                           CONST OCILobLocator *locp, ub1 *csfrm);
+
+sword   OCILobCharSetId (OCIEnv *envhp, OCIError *errhp, 
+                         CONST OCILobLocator *locp, ub2 *csid);
+
+sword   OCILobCopy (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *dst_locp,
+                    OCILobLocator *src_locp, ub4 amount, ub4 dst_offset, 
+                    ub4 src_offset);
+
+sword OCILobCreateTemporary(OCISvcCtx          *svchp,
+                            OCIError           *errhp,
+                            OCILobLocator      *locp,
+                            ub2                 csid,
+                            ub1                 csfrm,
+                            ub1                 lobtype,
+                            boolean             cache,
+                            OCIDuration         duration);
+
+
+sword OCILobClose( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *locp );
+
+
+sword   OCILobDisableBuffering (OCISvcCtx      *svchp,
+                                OCIError       *errhp,
+                                OCILobLocator  *locp);
+
+sword   OCILobEnableBuffering (OCISvcCtx      *svchp,
+                               OCIError       *errhp,
+                               OCILobLocator  *locp);
+
+sword   OCILobErase (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                      ub4 *amount, ub4 offset);
+
+sword   OCILobFileClose (OCISvcCtx *svchp, OCIError *errhp, 
+                         OCILobLocator *filep);
+
+sword   OCILobFileCloseAll (OCISvcCtx *svchp, OCIError *errhp);
+
+sword   OCILobFileExists (OCISvcCtx *svchp, OCIError *errhp, 
+                          OCILobLocator *filep,
+                          boolean *flag);
+
+sword   OCILobFileGetName (OCIEnv *envhp, OCIError *errhp, 
+                           CONST OCILobLocator *filep, 
+                           OraText *dir_alias, ub2 *d_length, 
+                           OraText *filename, ub2 *f_length);
+
+sword   OCILobFileIsOpen (OCISvcCtx *svchp, OCIError *errhp, 
+                          OCILobLocator *filep,
+                          boolean *flag);
+
+sword   OCILobFileOpen (OCISvcCtx *svchp, OCIError *errhp, 
+                        OCILobLocator *filep,
+                        ub1 mode);
+
+sword   OCILobFileSetName (OCIEnv *envhp, OCIError *errhp, 
+                           OCILobLocator **filepp, 
+                           CONST OraText *dir_alias, ub2 d_length, 
+                           CONST OraText *filename, ub2 f_length);
+
+sword   OCILobFlushBuffer (OCISvcCtx       *svchp,
+                           OCIError        *errhp,
+                           OCILobLocator   *locp,
+                           ub4              flag);
+
+sword OCILobFreeTemporary(OCISvcCtx          *svchp,
+                          OCIError           *errhp,
+                          OCILobLocator      *locp);
+
+sword OCILobGetChunkSize(OCISvcCtx         *svchp,
+                         OCIError          *errhp,
+                         OCILobLocator     *locp,
+                         ub4               *chunksizep);
+
+sword   OCILobGetLength  (OCISvcCtx *svchp, OCIError *errhp, 
+                          OCILobLocator *locp,
+                          ub4 *lenp);
+
+sword   OCILobIsEqual  (OCIEnv *envhp, CONST OCILobLocator *x, 
+                        CONST OCILobLocator *y, 
+                        boolean *is_equal);
+
+sword OCILobIsOpen( OCISvcCtx     *svchp,
+                    OCIError      *errhp,
+                    OCILobLocator *locp,
+                    boolean       *flag);
+
+sword OCILobIsTemporary(OCIEnv            *envp,
+                        OCIError          *errhp,
+                        OCILobLocator     *locp,
+                        boolean           *is_temporary);
+
+sword   OCILobLoadFromFile (OCISvcCtx *svchp, OCIError *errhp, 
+                            OCILobLocator *dst_locp,
+                            OCILobLocator *src_filep, 
+                            ub4 amount, ub4 dst_offset, 
+                            ub4 src_offset);
+
+sword   OCILobLocatorAssign  (OCISvcCtx *svchp, OCIError *errhp, 
+                            CONST OCILobLocator *src_locp, 
+                            OCILobLocator **dst_locpp);
+
+
+sword   OCILobLocatorIsInit (OCIEnv *envhp, OCIError *errhp, 
+                             CONST OCILobLocator *locp, 
+                             boolean *is_initialized);
+
+sword   OCILobOpen( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *locp,
+                   ub1               mode );
+ 
+sword   OCILobRead  (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                     ub4 *amtp, ub4 offset, dvoid *bufp, ub4 bufl, dvoid *ctxp,
+                     OCICallbackLobRead cbfp, ub2 csid, ub1 csfrm);
+
+sword   OCILobTrim  (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                     ub4 newlen);
+
+sword   OCILobWrite  (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                      ub4 *amtp, ub4 offset, dvoid *bufp, ub4 buflen, ub1 piece,
+                      dvoid *ctxp, OCICallbackLobWrite cbfp, ub2 csid,
+                      ub1 csfrm);
+
+sword OCILobWriteAppend(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *lobp,
+                        ub4 *amtp, dvoid *bufp, ub4 bufl, ub1 piece, dvoid *ctxp,
+                        OCICallbackLobWrite cbfp, ub2 csid, ub1 csfrm);
+
+sword   OCIBreak (dvoid *hndlp, OCIError *errhp);
+
+sword   OCIReset (dvoid *hndlp, OCIError *errhp);
+
+sword   OCIServerVersion  (dvoid *hndlp, OCIError *errhp, OraText *bufp, 
+                           ub4 bufsz,
+                           ub1 hndltype);
+
+sword   OCIServerRelease  (dvoid *hndlp, OCIError *errhp, OraText *bufp,
+                           ub4 bufsz,
+                           ub1 hndltype, ub4 *version);
+
+sword   OCIAttrGet (CONST dvoid *trgthndlp, ub4 trghndltyp, 
+                    dvoid *attributep, ub4 *sizep, ub4 attrtype, 
+                    OCIError *errhp);
+
+sword   OCIAttrSet (dvoid *trgthndlp, ub4 trghndltyp, dvoid *attributep,
+                    ub4 size, ub4 attrtype, OCIError *errhp);
+
+sword   OCISvcCtxToLda (OCISvcCtx *svchp, OCIError *errhp, Lda_Def *ldap);
+
+sword   OCILdaToSvcCtx (OCISvcCtx **svchpp, OCIError *errhp, Lda_Def *ldap);
+
+sword   OCIResultSetToStmt (OCIResult *rsetdp, OCIError *errhp);
+
+sword OCIFileClose ( dvoid  *hndl, OCIError *err, OCIFileObject *filep );
+
+sword   OCIUserCallbackRegister(dvoid *hndlp, ub4 type, dvoid *ehndlp,
+                                    OCIUserCallback callback, dvoid *ctxp,
+                                    ub4 fcode, ub4 when, OCIUcb *ucbDesc);
+
+sword   OCIUserCallbackGet(dvoid *hndlp, ub4 type, dvoid *ehndlp,
+                               ub4 fcode, ub4 when, OCIUserCallback *callbackp,
+                               dvoid **ctxpp, OCIUcb *ucbDesc);
+
+sword   OCISharedLibInit(dvoid *metaCtx, dvoid *libCtx, ub4 argfmt, sword argc,
+                         dvoid **argv, OCIEnvCallbackType envCallback);
+
+sword OCIFileExists ( dvoid  *hndl, OCIError *err, OraText *filename,
+                     OraText *path, ub1 *flag  );
+
+sword OCIFileFlush( dvoid *hndl, OCIError *err, OCIFileObject *filep  );
+
+
+sword OCIFileGetLength( dvoid *hndl, OCIError *err, OraText *filename,
+                        OraText *path, ubig_ora *lenp  );
+
+sword OCIFileInit ( dvoid *hndl, OCIError *err );
+
+sword OCIFileOpen ( dvoid *hndl, OCIError *err, OCIFileObject **filep,
+                    OraText *filename, OraText *path, ub4 mode, ub4 create, 
+                    ub4 type );
+
+sword OCIFileRead ( dvoid *hndl, OCIError *err, OCIFileObject *filep,
+                    dvoid *bufp, ub4 bufl, ub4 *bytesread );
+
+sword OCIFileSeek ( dvoid *hndl, OCIError *err, OCIFileObject *filep,
+                     uword origin, ubig_ora offset, sb1 dir );
+
+sword OCIFileTerm ( dvoid *hndl, OCIError *err );
+
+
+sword OCIFileWrite ( dvoid *hndl, OCIError *err, OCIFileObject   *filep,
+                     dvoid *bufp, ub4 buflen, ub4 *byteswritten );
+
+
+#ifdef ORAXB8_DEFINED
+
+sword   OCILobCopy2 (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *dst_locp,
+                     OCILobLocator *src_locp, oraub8 amount, oraub8 dst_offset, 
+                     oraub8 src_offset);
+
+sword   OCILobErase2 (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                      oraub8 *amount, oraub8 offset);
+
+sword   OCILobGetLength2 (OCISvcCtx *svchp, OCIError *errhp, 
+                          OCILobLocator *locp, oraub8 *lenp);
+
+sword   OCILobLoadFromFile2 (OCISvcCtx *svchp, OCIError *errhp, 
+                             OCILobLocator *dst_locp,
+                             OCILobLocator *src_filep, 
+                             oraub8 amount, oraub8 dst_offset, 
+                             oraub8 src_offset);
+
+sword   OCILobRead2 (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                     oraub8 *byte_amtp, oraub8 *char_amtp, oraub8 offset,
+                     dvoid *bufp, oraub8 bufl, ub1 piece, dvoid *ctxp,
+                     OCICallbackLobRead2 cbfp, ub2 csid, ub1 csfrm);
+
+sword   OCILobTrim2 (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                     oraub8 newlen);
+
+sword   OCILobWrite2 (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                      oraub8 *byte_amtp, oraub8 *char_amtp, oraub8 offset,
+                      dvoid *bufp, oraub8 buflen, ub1 piece, dvoid *ctxp, 
+                      OCICallbackLobWrite2 cbfp, ub2 csid, ub1 csfrm);
+
+sword OCILobWriteAppend2 (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *lobp,
+                          oraub8 *byte_amtp, oraub8 *char_amtp, dvoid *bufp,
+                          oraub8 bufl, ub1 piece, dvoid *ctxp,
+                          OCICallbackLobWrite2 cbfp, ub2 csid, ub1 csfrm);
+
+sword OCILobGetStorageLimit (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *lobp, oraub8 *limitp);
+
+#endif
+
+/*
+ ** Initialize the security package
+ */
+sword   OCISecurityInitialize (OCISecurity *sechandle, OCIError *error_handle);
+
+sword   OCISecurityTerminate (OCISecurity *sechandle, OCIError *error_handle);
+
+sword OCISecurityOpenWallet(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            size_t wrllen,
+                            OraText *wallet_resource_locator,
+                            size_t pwdlen,
+                            OraText *password,
+                            nzttWallet *wallet);
+
+sword OCISecurityCloseWallet(OCISecurity *osshandle,
+                             OCIError *error_handle,
+                             nzttWallet *wallet);
+
+sword OCISecurityCreateWallet(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              size_t wrllen,
+                              OraText *wallet_resource_locator,
+                              size_t pwdlen,
+                              OraText *password,
+                              nzttWallet *wallet);
+
+sword OCISecurityDestroyWallet(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               size_t wrllen,
+                               OraText *wallet_resource_locator,
+                               size_t pwdlen,
+                               OraText *password);
+
+sword OCISecurityStorePersona(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              nzttPersona **persona,
+                              nzttWallet *wallet);
+
+sword OCISecurityOpenPersona(OCISecurity *osshandle,
+                             OCIError *error_handle,
+                             nzttPersona *persona);
+
+sword OCISecurityClosePersona(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              nzttPersona *persona);
+
+sword OCISecurityRemovePersona(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttPersona **persona);
+
+sword OCISecurityCreatePersona(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttIdentType identity_type,
+                               nzttCipherType cipher_type,
+                               nzttPersonaDesc *desc,
+                               nzttPersona **persona);
+
+sword OCISecuritySetProtection(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttPersona *persona,
+                               nzttcef crypto_engine_function,
+                               nztttdufmt data_unit_format,
+                               nzttProtInfo *protection_info);
+
+sword OCISecurityGetProtection(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttPersona *persona,
+                               nzttcef crypto_engine_function,
+                               nztttdufmt * data_unit_format_ptr,
+                               nzttProtInfo *protection_info);
+
+sword OCISecurityRemoveIdentity(OCISecurity *osshandle,
+                                OCIError *error_handle,
+                                nzttIdentity **identity_ptr);
+
+sword OCISecurityCreateIdentity(OCISecurity *osshandle,
+                                OCIError *error_handle,
+                                nzttIdentType type,
+                                nzttIdentityDesc *desc,
+                                nzttIdentity **identity_ptr);
+
+sword OCISecurityAbortIdentity(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttIdentity **identity_ptr);
+
+sword OCISecurityFreeIdentity(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              nzttIdentity **identity_ptr);
+
+
+sword OCISecurityStoreTrustedIdentity(OCISecurity *osshandle,
+                                      OCIError *error_handle,
+                                      nzttIdentity **identity_ptr,
+                                      nzttPersona *persona);
+
+sword OCISecuritySign(OCISecurity *osshandle,
+                      OCIError *error_handle,
+                      nzttPersona *persona,
+                      nzttces signature_state,
+                      size_t input_length,
+                      ub1 *input,
+                      nzttBufferBlock *buffer_block);
+
+sword OCISecuritySignExpansion(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttPersona *persona,
+                               size_t inputlen,
+                               size_t *signature_length);
+
+sword OCISecurityVerify(OCISecurity *osshandle,
+                        OCIError *error_handle,
+                        nzttPersona *persona,
+                        nzttces signature_state,
+                        size_t siglen,
+                        ub1 *signature,
+                        nzttBufferBlock *extracted_message,
+                        boolean *verified,
+                        boolean *validated,
+                        nzttIdentity **signing_party_identity);
+
+sword OCISecurityValidate(OCISecurity *osshandle,
+                          OCIError *error_handle,
+                          nzttPersona *persona,
+                          nzttIdentity *identity,
+                          boolean *validated);
+
+sword OCISecuritySignDetached(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              nzttPersona *persona,
+                              nzttces signature_state,
+                              size_t input_length,
+                              ub1 * input,
+                              nzttBufferBlock *signature);
+
+sword OCISecuritySignDetExpansion(OCISecurity *osshandle,
+                                  OCIError *error_handle,
+                                  nzttPersona *persona,
+                                  size_t input_length,
+                                  size_t *required_buffer_length);
+
+sword OCISecurityVerifyDetached(OCISecurity *osshandle,
+                                OCIError *error_handle,
+                                nzttPersona *persona,
+                                nzttces signature_state,
+                                size_t data_length,
+                                ub1 *data,
+                                size_t siglen,
+                                ub1 *signature,
+                                boolean *verified,
+                                boolean *validated,
+                                nzttIdentity **signing_party_identity);
+
+sword OCISecurity_PKEncrypt(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            nzttPersona *persona,
+                            size_t number_of_recipients,
+                            nzttIdentity *recipient_list,
+                            nzttces encryption_state,
+                            size_t input_length,
+                            ub1 *input,
+                            nzttBufferBlock *encrypted_data);
+
+sword OCISecurityPKEncryptExpansion(OCISecurity *osshandle,
+                                    OCIError *error_handle,
+                                    nzttPersona *persona,
+                                    size_t number_recipients,
+                                    size_t input_length,
+                                    size_t *buffer_length_required);
+
+sword OCISecurityPKDecrypt(OCISecurity *osshandle,
+                           OCIError *error_handle,
+                           nzttPersona *persona,
+                           nzttces encryption_state,
+                           size_t input_length,
+                           ub1 *input,
+                           nzttBufferBlock *encrypted_data);
+
+sword OCISecurityEncrypt(OCISecurity *osshandle,
+                         OCIError *error_handle,
+                         nzttPersona *persona,
+                         nzttces encryption_state,
+                         size_t input_length,
+                         ub1 *input,
+                         nzttBufferBlock *encrypted_data);
+
+sword OCISecurityEncryptExpansion(OCISecurity *osshandle,
+                                  OCIError *error_handle,
+                                  nzttPersona *persona,
+                                  size_t input_length,
+                                  size_t *encrypted_data_length);
+
+sword OCISecurityDecrypt(OCISecurity *osshandle,
+                         OCIError *error_handle,
+                         nzttPersona *persona,
+                         nzttces decryption_state,
+                         size_t input_length,
+                         ub1 *input,
+                         nzttBufferBlock *decrypted_data);
+
+sword OCISecurityEnvelope(OCISecurity *osshandle,
+                          OCIError *error_handle,
+                          nzttPersona *persona,
+                          size_t number_of_recipients,
+                          nzttIdentity *identity,
+                          nzttces encryption_state,
+                          size_t input_length,
+                          ub1 *input,
+                          nzttBufferBlock *enveloped_data);
+
+sword OCISecurityDeEnvelope(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            nzttPersona *persona,
+                            nzttces decryption_state,
+                            size_t input_length,
+                            ub1 *input,
+                            nzttBufferBlock *output_message,
+                            boolean *verified,
+                            boolean *validated,
+                            nzttIdentity **sender_identity);
+
+sword OCISecurityKeyedHash(OCISecurity *osshandle,
+                           OCIError *error_handle,
+                           nzttPersona *persona,
+                           nzttces hash_state,
+                           size_t input_length,
+                           ub1 *input,
+                           nzttBufferBlock *keyed_hash);
+
+sword OCISecurityKeyedHashExpansion(OCISecurity *osshandle,
+                                    OCIError *error_handle,
+                                    nzttPersona *persona,
+                                    size_t input_length,
+                                    size_t *required_buffer_length);
+
+sword OCISecurityHash(OCISecurity *osshandle,
+                      OCIError *error_handle,
+                      nzttPersona *persona,
+                      nzttces hash_state,
+                      size_t input,
+                      ub1 *input_length,
+                      nzttBufferBlock *hash);
+
+sword OCISecurityHashExpansion(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttPersona *persona,
+                               size_t input_length,
+                               size_t *required_buffer_length);
+
+sword OCISecuritySeedRandom(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            nzttPersona *persona,
+                            size_t seed_length,
+                            ub1 *seed);
+
+sword OCISecurityRandomBytes(OCISecurity *osshandle,
+                             OCIError *error_handle,
+                             nzttPersona *persona,
+                             size_t number_of_bytes_desired,
+                             nzttBufferBlock *random_bytes);
+
+sword OCISecurityRandomNumber(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              nzttPersona *persona,
+                              uword *random_number_ptr);
+
+sword OCISecurityInitBlock(OCISecurity *osshandle,
+                           OCIError *error_handle,
+                           nzttBufferBlock *buffer_block);
+
+sword OCISecurityReuseBlock(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            nzttBufferBlock *buffer_block);
+
+sword OCISecurityPurgeBlock(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            nzttBufferBlock *buffer_block);
+
+sword OCISecuritySetBlock(OCISecurity *osshandle,
+                          OCIError *error_handle,
+                          uword flags_to_set,
+                          size_t buffer_length,
+                          size_t used_buffer_length,
+                          ub1 *buffer,
+                          nzttBufferBlock *buffer_block);
+
+sword OCISecurityGetIdentity(OCISecurity   *osshandle,
+                             OCIError      *error_handle,
+                             size_t         namelen,
+                             OraText          *distinguished_name,
+                             nzttIdentity **identity);
+
+sword OCIAQEnq(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
+                 OCIAQEnqOptions *enqopt, OCIAQMsgProperties *msgprop,
+                 OCIType *payload_tdo, dvoid **payload, dvoid **payload_ind, 
+                 OCIRaw **msgid, ub4 flags); 
+
+sword OCIAQDeq(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
+                 OCIAQDeqOptions *deqopt, OCIAQMsgProperties *msgprop,
+                 OCIType *payload_tdo, dvoid **payload, dvoid **payload_ind, 
+                 OCIRaw **msgid, ub4 flags); 
+
+sword OCIAQEnqArray(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
+                    OCIAQEnqOptions *enqopt, ub4 *iters,
+                    OCIAQMsgProperties **msgprop, OCIType *payload_tdo,
+                    dvoid **payload, dvoid **payload_ind, OCIRaw **msgid,
+                    dvoid *ctxp, OCICallbackAQEnq enqcbfp, ub4 flags);
+
+sword OCIAQDeqArray(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
+                    OCIAQDeqOptions *deqopt, ub4 *iters,
+                    OCIAQMsgProperties **msgprop, OCIType *payload_tdo,
+                    dvoid **payload, dvoid **payload_ind, OCIRaw **msgid,
+                    dvoid *ctxp, OCICallbackAQDeq deqcbfp, ub4 flags);
+
+sword OCIAQListen(OCISvcCtx *svchp, OCIError *errhp, 
+                      OCIAQAgent **agent_list, ub4 num_agents,
+                      sb4 wait, OCIAQAgent **agent,
+                      ub4 flags);
+
+sword OCIExtractInit(dvoid *hndl, OCIError *err);
+
+sword OCIExtractTerm(dvoid *hndl, OCIError *err);
+
+sword OCIExtractReset(dvoid *hndl, OCIError *err);
+
+sword OCIExtractSetNumKeys(dvoid *hndl, OCIError *err, uword numkeys);
+
+sword OCIExtractSetKey(dvoid *hndl, OCIError *err, CONST OraText *name, 
+                       ub1 type, ub4 flag, CONST dvoid *defval, 
+                       CONST sb4 *intrange, CONST OraText *CONST *strlist);
+
+sword OCIExtractFromFile(dvoid *hndl, OCIError *err, ub4 flag, 
+                         OraText *filename);
+
+sword OCIExtractFromStr(dvoid *hndl, OCIError *err, ub4 flag, OraText *input);
+
+sword OCIExtractToInt(dvoid *hndl, OCIError *err, OraText *keyname, 
+                      uword valno, sb4 *retval);
+
+sword OCIExtractToBool(dvoid *hndl, OCIError *err, OraText *keyname, 
+                       uword valno, ub1 *retval);
+
+sword OCIExtractToStr(dvoid *hndl, OCIError *err, OraText *keyname, 
+                      uword valno, OraText *retval, uword buflen);
+
+sword OCIExtractToOCINum(dvoid *hndl, OCIError *err, OraText *keyname, 
+                         uword valno, OCINumber *retval);
+
+sword OCIExtractToList(dvoid *hndl, OCIError *err, uword *numkeys);
+
+sword OCIExtractFromList(dvoid *hndl, OCIError *err, uword index, 
+                         OraText **name, 
+                         ub1 *type, uword *numvals, dvoid ***values);
+
+/* Memory Related Service Interfaces */
+
+sword OCIMemoryAlloc(dvoid *hdl, OCIError *err, dvoid **mem,
+        OCIDuration dur, ub4 size, ub4 flags);
+
+sword OCIMemoryResize(dvoid *hdl, OCIError *err, dvoid **mem,
+                        ub4 newsize, ub4 flags);
+                        
+sword OCIMemoryFree(dvoid *hdl, OCIError *err, dvoid *mem);
+
+sword OCIContextSetValue(dvoid *hdl, OCIError *err, OCIDuration duration,
+                        ub1 *key, ub1 keylen, dvoid *ctx_value);
+
+sword OCIContextGetValue(dvoid *hdl, OCIError *err, ub1 *key,
+                        ub1 keylen, dvoid **ctx_value);
+
+sword OCIContextClearValue(dvoid *hdl, OCIError *err, ub1 *key, 
+                        ub1 keylen);
+
+sword OCIContextGenerateKey(dvoid *hdl, OCIError *err, ub4 *key);
+
+sword OCIMemorySetCurrentIDs(dvoid *hdl, OCIError *err, 
+                             ub4 curr_session_id, ub4 curr_trans_id, 
+                             ub4 curr_stmt_id);
+
+sword OCIPicklerTdsCtxInit(OCIEnv *env, OCIError *err, 
+                           OCIPicklerTdsCtx **tdsc);
+
+sword OCIPicklerTdsCtxFree(OCIEnv *env, OCIError *err, OCIPicklerTdsCtx *tdsc);
+
+sword OCIPicklerTdsInit(OCIEnv *env, OCIError *err, OCIPicklerTdsCtx *tdsc, 
+                                        OCIPicklerTds **tdsh);
+
+sword OCIPicklerTdsFree(OCIEnv *env, OCIError *err, OCIPicklerTds *tdsh);
+
+sword OCIPicklerTdsCreateElementNumber(OCIEnv *env, OCIError *err, 
+                                        OCIPicklerTds *tdsh, ub1 prec, 
+                                        sb1 scale, OCIPicklerTdsElement *elt);
+
+sword OCIPicklerTdsCreateElementChar(OCIEnv *env, OCIError *err, 
+                                     OCIPicklerTds *tdsh, ub2 len, 
+                                     OCIPicklerTdsElement *elt);
+
+sword OCIPicklerTdsCreateElementVarchar(OCIEnv *env, OCIError *err, 
+                                        OCIPicklerTds *tdsh, ub2 len, 
+                                        OCIPicklerTdsElement *elt);
+
+sword OCIPicklerTdsCreateElementRaw(OCIEnv *env, OCIError *err, 
+                                    OCIPicklerTds *tdsh, ub2 len, 
+                                    OCIPicklerTdsElement *elt);
+
+sword OCIPicklerTdsCreateElement(OCIEnv *env, OCIError *err, 
+                                 OCIPicklerTds *tdsh, OCITypeCode dty, 
+                                 OCIPicklerTdsElement *elt);
+
+sword OCIPicklerTdsAddAttr(OCIEnv *env, OCIError *err, 
+                           OCIPicklerTds *tdsh, OCIPicklerTdsElement elt);
+
+sword OCIPicklerTdsGenerate(OCIEnv *env, OCIError *err, 
+                                OCIPicklerTds *tdsh);
+
+sword OCIPicklerTdsGetAttr(OCIEnv *env, OCIError *err, 
+                                CONST OCIPicklerTds *tdsh, ub1  attrno,
+                                OCITypeCode *typ, ub2  *len);
+
+sword OCIPicklerFdoInit(OCIEnv *env, OCIError *err, 
+                                OCIPicklerFdo **fdoh);
+
+sword OCIPicklerFdoFree(OCIEnv *env, OCIError *err, 
+                                OCIPicklerFdo *fdoh);
+
+sword OCIPicklerImageInit(OCIEnv *env, OCIError *err, 
+                          OCIPicklerFdo *fdoh, 
+                          OCIPicklerTds *tdsh,
+                          OCIPicklerImage **imgh);
+
+sword OCIPicklerImageFree(OCIEnv *env, OCIError *err, 
+                                OCIPicklerImage *imgh);
+ 
+sword OCIPicklerImageAddScalar(OCIEnv *env, OCIError *err,  
+                               OCIPicklerImage *imgh, 
+                               dvoid *scalar, ub4  len);
+ 
+sword OCIPicklerImageAddNullScalar(OCIEnv *env, OCIError *err, 
+                                OCIPicklerImage *imgh);
+ 
+sword OCIPicklerImageGenerate(OCIEnv *env, OCIError *err, 
+                                OCIPicklerImage *imgh);
+ 
+sword OCIPicklerImageGetScalarSize(OCIEnv *env, OCIError *err, 
+                                OCIPicklerImage *imgh, 
+                                ub4  attrno, ub4  *size);
+ 
+sword OCIPicklerImageGetScalar(OCIEnv *env, OCIError *err, 
+                                OCIPicklerImage *imgh, ub4  attrno, 
+                                dvoid *buf, ub4  *len, OCIInd *ind);
+
+sword OCIPicklerImageCollBegin(OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh, CONST OCIPicklerTds *colltdsh);
+ 
+sword OCIPicklerImageCollAddScalar( OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh, dvoid *scalar,
+                ub4 buflen, OCIInd ind);
+ 
+sword OCIPicklerImageCollEnd(OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh);
+ 
+/* should take svcctx for locator stuff */
+sword OCIPicklerImageCollBeginScan(OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh, CONST OCIPicklerTds *coll_tdsh,
+                ub4 attrnum, ub4 startidx, OCIInd *ind);
+ 
+sword OCIPicklerImageCollGetScalarSize(OCIEnv *env, OCIError *err,
+                CONST OCIPicklerTds *coll_tdsh, ub4 *size);
+ 
+sword OCIPicklerImageCollGetScalar(OCIEnv *env, OCIError *err,
+                                   OCIPicklerImage *imgh, dvoid *buf,
+                                   ub4 *buflen, OCIInd *ind);
+
+sword OCIAnyDataGetType(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        OCITypeCode *tc, OCIType **type);
+
+sword OCIAnyDataIsNull(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        boolean *isnull);
+
+sword OCIAnyDataConvert(OCISvcCtx *svchp, OCIError *errhp, OCITypeCode tc,
+        OCIType *type, OCIDuration dur, dvoid *ind, dvoid *data_val,
+        ub4 len, OCIAnyData **sdata);
+
+sword OCIAnyDataBeginCreate(OCISvcCtx *svchp, OCIError *errhp, OCITypeCode tc,
+        OCIType *type, OCIDuration dur, OCIAnyData **sdata);
+
+sword OCIAnyDataDestroy(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata);
+
+sword OCIAnyDataAttrSet(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        OCITypeCode tc, OCIType *type, dvoid *ind, dvoid *attr_val,
+        ub4 length, boolean is_any);
+
+sword OCIAnyDataCollAddElem(OCISvcCtx *svchp, OCIError *errhp,
+        OCIAnyData *sdata, OCITypeCode tc, OCIType *type, dvoid *ind,
+        dvoid *attr_val, ub4 length, boolean is_any, boolean last_elem);
+
+sword OCIAnyDataEndCreate(OCISvcCtx *svchp, OCIError *errhp,
+                          OCIAnyData *sdata);
+
+sword OCIAnyDataAccess(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        OCITypeCode tc, OCIType *type, dvoid *ind, dvoid *attr_val,
+        ub4 *length);
+
+sword OCIAnyDataGetCurrAttrNum(OCISvcCtx *svchp, OCIError *errhp, 
+                               OCIAnyData *sdata, ub4 *attrnum);
+
+sword OCIAnyDataAttrGet(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+  OCITypeCode tc, OCIType *type, dvoid *ind, dvoid *attr_val,
+        ub4 *length, boolean is_any);
+
+sword OCIAnyDataCollGetElem(OCISvcCtx *svchp, OCIError *errhp,
+  OCIAnyData *sdata,
+  OCITypeCode tc, OCIType *type, dvoid *ind, dvoid *celem_val,
+  ub4 *length, boolean is_any);
+
+
+/*------------------------ OCIAnyDataSet interfaces -------------------------*/
+
+/*
+   NAME
+     OCIAnyDataSetBeginCreate - OCIAnyDataSet Begin Creation
+   PARAMETERS
+     svchp (IN/OUT) - The OCI service context.
+     errhp (IN/OUT) - The OCI error handle. If there is an error, it is
+                      recorded in errhp and this function returns OCI_ERROR.
+                      Diagnostic information can be obtained by calling
+                      OCIErrorGet().
+     typecode       - typecode corresponding to the OCIAnyDataSet.
+     type (IN)      - type corresponding to the OCIAnyDataSet. If the typecode
+                      corresponds to a built-in type (OCI_TYPECODE_NUMBER etc.)
+                      , this parameter can be NULL. It should be non NULL for
+                      user defined types (OCI_TYPECODE_OBJECT,
+                      OCI_TYPECODE_REF, collection types etc.)
+     dur (IN)       - duration for which OCIAnyDataSet is allocated.
+     data_set (OUT) - Initialized OCIAnyDataSet.
+     RETURNS        - error code
+   NOTES
+     This call allocates an OCIAnyDataSet for the duration of dur and
+     initializes it with the type information. The OCIAnyDataSet can hold
+     multiple instances of the given type. For performance reasons, the 
+     OCIAnyDataSet will end up pointing to the passed in OCIType parameter.
+     It is the responsibility of the caller to ensure that the OCIType is
+     longer lived (has allocation duration >= the duration of the OCIAnyData
+     if the OCIType is a transient one, allocation/pin duration >= duration of
+     the OCIAnyData if the OCIType is a persistent one).
+
+*/
+sword OCIAnyDataSetBeginCreate(OCISvcCtx *svchp, OCIError *errhp,
+     OCITypeCode typecode, CONST OCIType *type, OCIDuration dur,
+     OCIAnyDataSet ** data_set);
+
+/*
+   NAME
+     OCIAnyDataSetDestroy  - OCIAnyDataSet Destroy
+   DESCRIPTION
+     This call frees the OCIAnyDataSet allocated using
+     OCIAnyDataSetBeginCreate().
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)    - The OCI service context.
+     errhp (IN/OUT)    - The OCI Error handle.
+     data_set (IN/OUT) - OCIAnyDataSet to be freed.
+*/
+sword OCIAnyDataSetDestroy(OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set);
+
+
+/*
+   NAME
+     OCIAnyDataSetAddInstance - OCIAnyDataSet Add an instance
+   DESCRIPTION
+     This call adds a new skeleton instance to the OCIAnyDataSet and all the
+     attributes of the instance are set to NULL. It returns this skeleton
+     instance through the OCIAnyData parameter which can be constructed
+     subsequently by invoking the OCIAnyData API.
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)      - The OCI service context.
+     errhp (IN/OUT)      - The OCI Error handle.
+     data_set (IN/OUT)   - OCIAnyDataSet to which a new instance is added.
+     data (IN/OUT)       - OCIAnyData corresponding to the newly added
+                           instance. If (*data) is NULL, a new OCIAnyData will
+                           be allocated for same duration as the OCIAnyDataSet.
+                           If (*data) is not NULL, it will get reused. This
+                           OCIAnyData can be subseqently constructed using the
+                           OCIAnyDataConvert() call or it can be constructed
+                           piece-wise using the OCIAnyDataAttrSet and
+                           OCIAnyDataCollAddElem calls.
+   NOTES
+     No Destruction of the old value is done here. It is the responsibility of
+     the caller to destroy the old value pointed to by (*data) and set (*data)
+     to a null pointer before beginning to make a sequence of this call. No
+     deep copying (of OCIType information nor the data part.) is done in the
+     returned OCIAnyData. This OCIAnyData cannot be used beyond the allocation
+     duration of the OCIAnyDataSet (it is like a reference into the
+     OCIAnyDataSet). The returned OCIAnyData can be reused on subsequent calls
+     to this function, to sequentially add new data instances to the
+     OCIAnyDataSet.
+*/
+sword OCIAnyDataSetAddInstance(OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, OCIAnyData **data);
+
+/*
+   NAME
+     OCIAnyDataSetEndCreate - OCIAnyDataSet End Creation process.
+   DESCRIPTION
+     This call marks the end of OCIAnyDataSet creation. It should be called
+     after constructing all of its instance(s).
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)        - The OCI service context.
+     errhp (IN/OUT)        - The OCI error handle. If there is an error, it is
+                             recorded in errhp and this function returns
+                             OCI_ERROR. Diagnostic information can be obtained
+                             by calling OCIErrorGet().
+     data_set (IN/OUT)     - OCIAnyDataSet that has been fully constructed.
+*/
+sword OCIAnyDataSetEndCreate(OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set);
+
+/*
+   NAME
+     OCIAnyDataSetGetType - OCIAnyDataSet Get Type of an OCIAnyDataSet
+   DESCRIPTION
+     Gets the Type corresponding to an OCIAnyDataSet. It returns the actual
+     pointer to the type maintained inside an OCIAnyDataSet. No copying is
+     done for performance reasons. The client is responsible for not using
+     this type once the OCIAnyDataSet is freed (or its duration ends).
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)      - The OCI service context.
+     errhp (IN/OUT)      - The OCI Error handle.
+     data_set (IN)       - Initialized OCIAnyDataSet.
+     tc (OUT)            - The typecode of the type.
+     type (OUT)          - The type corresponding to the OCIAnyDataSet. This
+                           could be null if the OCIAnyData corresponds to a
+                           built-in type.
+*/
+sword OCIAnyDataSetGetType (OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, OCITypeCode *tc, OCIType **type);
+
+/*
+  NAME
+    OCIAnyDataSetGetCount - OCIAnyDataSet Get Count of instances.
+  DESCRIPTION
+    This call gets the number of instances in the OCIAnyDataSet.
+  RETURNS
+    error code.
+  PARAMETERS
+    svchp (IN/OUT)      - OCI Service Context
+    errhp (IN/OUT)      - OCI Error handle
+    data_set (IN)       - Well formed OCIAnyDataSet.
+    count (OUT)         - number of instances in OCIAnyDataSet
+*/
+sword OCIAnyDataSetGetCount(OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, ub4 *count);
+
+/*
+  NAME
+    OCIAnyDataSetGetInstance - OCIAnyDataSet Get next instance.
+  DESCRIPTION
+    Only sequential access to the instances in an OCIAnyDataSet is allowed.
+    This call returns the OCIAnyData corresponding to an instance at the
+    current position and updates the current position. Subsequently, the
+    OCIAnyData access routines may be used to access the instance.
+  RETURNS
+    error code. Returns OCI_NO_DATA if the current position is at the end of
+    the set, OCI_SUCCESS otherwise.
+  PARAMETERS
+    svchp (IN/OUT)      - OCI Service Context
+    errhp (IN/OUT)      - OCI Error handle
+    data_set (IN)       - Well formed OCIAnyDataSet
+    data (IN/OUT)       - OCIAnyData corresponding to the instance. If (*data)
+                          is NULL, a new OCIAnyData will be allocated for same
+                          duration as the OCIAnyDataSet. If (*data) is not NULL
+                          , it will get reused. This OCIAnyData can be
+                          subsequently accessed using the OCIAnyDataAccess()
+                          call or piece-wise by using the OCIAnyDataAttrGet()
+                          call.
+  NOTE
+    No Destruction of the old value is done here. It is the responsibility of
+    the caller to destroy the old value pointed to by (*data) and set (*data)
+    to a null pointer before beginning to make a sequence of this call. No deep
+    copying (of OCIType information nor the data part.) is done in the returned
+    OCIAnyData. This OCIAnyData cannot be used beyond the allocation duration
+    of the OCIAnyDataSet (it is like a reference into the OCIAnyDataSet). The
+    returned OCIAnyData can be reused on subsequent calls to this function to
+    sequentially access the OCIAnyDataSet.
+*/
+sword OCIAnyDataSetGetInstance(OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, OCIAnyData **data);
+
+/*--------------------- End of OCIAnyDataSet interfaces ---------------------*/
+
+sword OCIFormatInit(dvoid *hndl, OCIError *err);
+
+sword OCIFormatString(dvoid *hndl, OCIError *err, OraText *buffer,
+                      sbig_ora bufferLength, sbig_ora *returnLength,
+                      CONST OraText *formatString, ...);
+
+sword OCIFormatTerm(dvoid *hndl, OCIError *err);
+
+sword OCIFormatTUb1(void);
+sword OCIFormatTUb2(void);
+sword OCIFormatTUb4(void);
+sword OCIFormatTUword(void);
+sword OCIFormatTUbig_ora(void);
+sword OCIFormatTSb1(void);
+sword OCIFormatTSb2(void);
+sword OCIFormatTSb4(void);
+sword OCIFormatTSword(void);
+sword OCIFormatTSbig_ora(void);
+sword OCIFormatTEb1(void);
+sword OCIFormatTEb2(void);
+sword OCIFormatTEb4(void);
+sword OCIFormatTEword(void);
+sword OCIFormatTChar(void);
+sword OCIFormatTText(void);
+sword OCIFormatTDouble(void);
+sword OCIFormatTDvoid(void);
+sword OCIFormatTEnd(void);
+
+/*-------------------------- Extensions to XA interface ---------------------*/
+/* ------------------------- xaosvch ----------------------------------------*/
+/*
+   NAME
+     xaosvch  -  XA Oracle get SerViCe Handle
+   DESCRIPTION
+     Given a database name return the service handle that is used by the
+     XA library
+   NOTE
+     This macro has been provided for backward compatibilty with 8.0.2
+*/
+OCISvcCtx *xaosvch(OraText *dbname);
+
+/* ------------------------- xaoSvcCtx --------------------------------------*/
+/*
+   NAME
+     xaoSvcCtx  -  XA Oracle get SerViCe ConTeXt
+   DESCRIPTION
+     Given a database name return the service handle that is used by the
+     XA library
+   NOTE
+     This routine has been provided for APs to get access to the service
+     handle that XA library uses. Without this routine APs must use SQLLIB
+     routine sqlld2 to get access to the Logon data area registered by the
+     XA library
+*/
+OCISvcCtx *xaoSvcCtx(OraText *dbname);
+
+/* ------------------------- xaoEnv -----------------------------------------*/
+/*
+   NAME
+     xaoEnv  -  XA Oracle get ENvironment Handle
+   DESCRIPTION
+     Given a database name return the environment handle that is used by the
+     XA library
+   NOTE
+     This routine has been provided for APs to get access to the environment
+     handle that XA library uses. Without this routine APs must use SQLLIB
+     routine sqlld2 to get access to the Logon data area registered by the
+     XA library
+*/
+OCIEnv *xaoEnv(OraText *dbname);
+
+/* ------------------------- xaosterr ---------------------------------------*/
+/*
+   NAME
+     xaosterr  -  XA Oracle get xa STart ERRor code
+   DESCRIPTION
+     Given an oracle error code return the XA error code
+ */
+int xaosterr(OCISvcCtx *svch, sb4 error);
+/*-------------------------- End Extensions ---------------------------------*/
+/*---------------------- Extensions to NLS cartridge service ----------------*/
+/* ----------------------- OCINlsGetInfo ------------------------------------*/
+/*
+   NAME
+     OCINlsGetInfo - Get NLS info from OCI environment handle
+   REMARKS
+     This function generates language information specified by item from OCI 
+     environment handle envhp into an array pointed to by buf within size 
+     limitation as buflen.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR on wrong item.
+   envhp(IN/OUT)
+     OCI environment handle.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and 
+     this function returns a NULL pointer. Diagnostic information can be 
+     obtained by calling OCIErrorGet().
+   buf(OUT)
+     Pointer to the destination buffer.
+   buflen(IN)
+     The size of destination buffer. The maximum length for each information
+     is 32 bytes.
+   item(IN)
+     It specifies to get which item in OCI environment handle and can be one
+     of following values:
+       OCI_NLS_DAYNAME1 : Native name for Monday.
+       OCI_NLS_DAYNAME2 : Native name for Tuesday.
+       OCI_NLS_DAYNAME3 : Native name for Wednesday.
+       OCI_NLS_DAYNAME4 : Native name for Thursday.
+       OCI_NLS_DAYNAME5 : Native name for Friday.
+       OCI_NLS_DAYNAME6 : Native name for for Saturday.
+       OCI_NLS_DAYNAME7 : Native name for for Sunday.
+       OCI_NLS_ABDAYNAME1 : Native abbreviated name for Monday.
+       OCI_NLS_ABDAYNAME2 : Native abbreviated name for Tuesday.
+       OCI_NLS_ABDAYNAME3 : Native abbreviated name for Wednesday.
+       OCI_NLS_ABDAYNAME4 : Native abbreviated name for Thursday.
+       OCI_NLS_ABDAYNAME5 : Native abbreviated name for Friday.
+       OCI_NLS_ABDAYNAME6 : Native abbreviated name for for Saturday.
+       OCI_NLS_ABDAYNAME7 : Native abbreviated name for for Sunday.
+       OCI_NLS_MONTHNAME1 : Native name for January.
+       OCI_NLS_MONTHNAME2 : Native name for February.
+       OCI_NLS_MONTHNAME3 : Native name for March.
+       OCI_NLS_MONTHNAME4 : Native name for April.
+       OCI_NLS_MONTHNAME5 : Native name for May.
+       OCI_NLS_MONTHNAME6 : Native name for June.
+       OCI_NLS_MONTHNAME7 : Native name for July.
+       OCI_NLS_MONTHNAME8 : Native name for August.
+       OCI_NLS_MONTHNAME9 : Native name for September.
+       OCI_NLS_MONTHNAME10 : Native name for October.
+       OCI_NLS_MONTHNAME11 : Native name for November.
+       OCI_NLS_MONTHNAME12 : Native name for December.
+       OCI_NLS_ABMONTHNAME1 : Native abbreviated name for January.
+       OCI_NLS_ABMONTHNAME2 : Native abbreviated name for February.
+       OCI_NLS_ABMONTHNAME3 : Native abbreviated name for March.
+       OCI_NLS_ABMONTHNAME4 : Native abbreviated name for April.
+       OCI_NLS_ABMONTHNAME5 : Native abbreviated name for May.
+       OCI_NLS_ABMONTHNAME6 : Native abbreviated name for June.
+       OCI_NLS_ABMONTHNAME7 : Native abbreviated name for July.
+       OCI_NLS_ABMONTHNAME8 : Native abbreviated name for August.
+       OCI_NLS_ABMONTHNAME9 : Native abbreviated name for September.
+       OCI_NLS_ABMONTHNAME10 : Native abbreviated name for October.
+       OCI_NLS_ABMONTHNAME11 : Native abbreviated name for November.
+       OCI_NLS_ABMONTHNAME12 : Native abbreviated name for December.
+       OCI_NLS_YES : Native string for affirmative response.
+       OCI_NLS_NO : Native negative response. 
+       OCI_NLS_AM : Native equivalent string of AM.
+       OCI_NLS_PM : Native equivalent string of PM.
+       OCI_NLS_AD : Native equivalent string of AD.
+       OCI_NLS_BC : Native equivalent string of BC.
+       OCI_NLS_DECIMAL : decimal character.
+       OCI_NLS_GROUP : group separator.
+       OCI_NLS_DEBIT : Native symbol of debit.
+       OCI_NLS_CREDIT : Native sumbol of credit.
+       OCI_NLS_DATEFORMAT : Oracle date format.
+       OCI_NLS_INT_CURRENCY: International currency symbol.
+       OCI_NLS_LOC_CURRENCY : Locale currency symbol.
+       OCI_NLS_LANGUAGE : Language name.
+       OCI_NLS_ABLANGUAGE : Abbreviation for language name.
+       OCI_NLS_TERRITORY : Territory name.
+       OCI_NLS_CHARACTER_SET : Character set name.
+       OCI_NLS_LINGUISTIC : Linguistic name.
+       OCI_NLS_CALENDAR : Calendar name.
+       OCI_NLS_DUAL_CURRENCY : Dual currency symbol.
+*/
+sword OCINlsGetInfo(dvoid *envhp, OCIError *errhp, OraText *buf,
+                    size_t buflen, ub2 item);
+
+/* ----------------------- OCINlsNumericInfoGet -----------------------------*/
+/*
+   NAME
+     OCINlsNumericInfoGet - Get NLS numeric info from OCI environment handle
+   REMARKS
+     This function generates numeric language information specified by item 
+     from OCI environment handle envhp into an output number variable.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR on wrong item.
+   envhp(IN/OUT)
+     OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and 
+     this function returns a NULL pointer. Diagnostic information can be 
+     obtained by calling OCIErrorGet().
+   val(OUT)
+     Pointer to the output number variable. On OCI_SUCCESS return, it will
+     contain the requested NLS numeric info.
+   item(IN)
+     It specifies to get which item in OCI environment handle and can be one
+     of following values:
+       OCI_NLS_CHARSET_MAXBYTESZ : Maximum character byte size for OCI
+                                   environment or session handle charset
+       OCI_NLS_CHARSET_FIXEDWIDTH: Character byte size for fixed-width charset;
+                                   0 for variable-width charset 
+*/
+sword OCINlsNumericInfoGet(dvoid *envhp, OCIError *errhp, sb4 *val, ub2 item);
+
+/* ----------------------- OCINlsCharSetNameToId ----------------------------*/
+/*
+   NAME
+     OCINlsCharSetNameToId - Get Oracle charset id given Oracle charset name
+   REMARKS
+     This function will get the Oracle character set id corresponding to
+     the given Oracle character set name.
+   RETURNS
+     Oracle character set id for the given Oracle character set name if
+     character set name and OCI handle are valid; otherwise returns 0.
+   envhp(IN/OUT)
+     OCI environment handle.
+   name(IN)
+     Pointer to a null-terminated Oracle character set name whose id 
+     will be returned.
+*/
+ub2 OCINlsCharSetNameToId(dvoid *envhp, const oratext *name);
+
+/* ----------------------- OCINlsCharSetIdToName ----------------------------*/
+/*
+   NAME
+     OCINlsCharSetIdToName - Get Oracle charset name given Oracle charset id
+   REMARKS
+     This function will get the Oracle character set name corresponding to
+     the given Oracle character set id.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
+   buf(OUT)
+     Pointer to the destination buffer. On OCI_SUCCESS return, it will contain
+     the null-terminated string for character set name.
+   buflen(IN)
+     Size of destination buffer. Recommended size is OCI_NLS_MAXBUFSZ for
+     guarantee to store an Oracle character set name. If it's smaller than
+     the length of the character set name, the function will return OCI_ERROR.
+   id(IN)
+     Oracle character set id.
+*/
+sword OCINlsCharSetIdToName(dvoid *envhp, oratext *buf, size_t buflen, ub2 id);
+
+/* ----------------------- OCINlsNameMap ------------------------------------*/
+/*
+   NAME
+     OCINlsNameMap - Map NLS naming from Oracle to other standards and vice 
+                     versa
+   REMARKS
+     This function will map NLS naming from Oracle to other standards (such
+     as ISO, IANA) and vice versa.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
+   buf(OUT)
+     Pointer to the destination buffer. On OCI_SUCCESS return, it will 
+     contain null-terminated string for requested mapped name.
+   buflen(IN)
+     The size of destination buffer. Recommended size is OCI_NLS_MAXBUFSZ
+     for guarantee to store an NLS name. If it is smaller than the length
+     of the name, the function will return OCI_ERROR.
+   srcbuf(IN)
+     Pointer to null-terminated NLS name. If it is not a valid name in its
+     define scope, the function will return OCI_ERROR.
+   flag(IN)
+     It specifies name mapping direction and can take the following values:
+       OCI_NLS_CS_IANA_TO_ORA : Map character set name from IANA to Oracle
+       OCI_NLS_CS_ORA_TO_IANA : Map character set name from Oracle to IANA
+       OCI_NLS_LANG_ISO_TO_ORA : Map language name from ISO to Oracle
+       OCI_NLS_LANG_ORA_TO_ISO : Map language name from Oracle to ISO
+       OCI_NLS_TERR_ISO_TO_ORA : Map territory name from ISO to Oracle
+       OCI_NLS_TERR_ORA_TO_ISO : Map territory name from Oracle to ISO
+       OCI_NLS_TERR_ISO3_TO_ORA : Map territory name from 3-letter ISO
+                                  abbreviation to Oracle
+       OCI_NLS_TERR_ORA_TO_ISO3 : Map territory name from Oracle to 3-letter
+                                  ISO abbreviation
+*/
+sword OCINlsNameMap(dvoid *envhp, oratext *buf, size_t buflen,
+                    const oratext *srcbuf, ub4 flag);
+
+/* -------------------- OCIMultiByteToWideChar ------------------------------*/
+/*
+   NAME
+     OCIMultiByteToWideChar - Convert a null terminated multibyte string into 
+                              wchar
+   REMARKS
+     This routine converts an entire null-terminated string into the wchar 
+     format. The wchar output buffer will be null-terminated.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Destination buffer for wchar.
+   src (IN)
+     Source string to be converted.
+   rsize (OUT)
+     Number of characters converted including null-terminator.
+     If it is a NULL pointer, no number return
+*/
+sword OCIMultiByteToWideChar(dvoid *envhp, OCIWchar *dst, CONST OraText *src,
+                             size_t *rsize);
+
+
+/* --------------------- OCIMultiByteInSizeToWideChar -----------------------*/
+/*
+   NAME
+     OCIMultiByteInSizeToWideChar - Convert a mulitbyte string in length into
+                                    wchar
+   REMARKS
+     This routine converts part of string into the wchar format. It will
+     convert as many complete characters as it can until it reaches output
+     buffer size or input buffer size or it reaches a null-terminator in
+     source string. The output buffer will be null-terminated if space permits.
+     If dstsz is zero, this function will only return number of characters not
+     including ending null terminator for converted string.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Pointer to a destination buffer for wchar. It can be NULL pointer when
+     dstsz is zero.
+   dstsz(IN)
+     Destination buffer size in character. If it is zero, this function just
+     returns number of characters will be need for the conversion.
+   src (IN)
+     Source string to be converted.
+   srcsz(IN)
+     Length of source string in byte.
+   rsize(OUT)
+     Number of characters written into destination buffer, or number of
+     characters for converted string is dstsz is zero.
+     If it is NULL pointer, nothing to return.
+*/
+sword OCIMultiByteInSizeToWideChar(dvoid *envhp, OCIWchar *dst,
+                                  size_t dstsz, CONST OraText *src, 
+                                  size_t srcsz, size_t *rsize);
+
+
+/* ---------------------- OCIWideCharToMultiByte ----------------------------*/
+/*
+   NAME
+     OCIWideCharToMultiByte - Convert a null terminated wchar string into
+                              multibyte
+   REMARKS
+     This routine converts an entire null-terminated wide character string into
+     multi-byte string. The output buffer will be null-terminated.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Destination buffer for multi-byte string.
+   src (IN)
+     Source wchar string to be converted.
+   rsize (OUT)
+     Number of bytes written into the destination buffer.
+     If it is NULL pointer, nothing to return.
+*/
+sword OCIWideCharToMultiByte(dvoid *envhp, OraText *dst, CONST OCIWchar *src,
+                             size_t *rsize);
+
+
+/* ---------------------- OCIWideCharInSizeToMultiByte ----------------------*/
+/*
+   NAME
+     OCIWideCharInSizeToMultiByte - Convert a wchar string in length into 
+                                    mulitbyte
+   REMARKS
+     This routine converts part of wchar string into the multi-byte format.
+     It will convert as many complete characters as it can until it reaches
+     output buffer size or input buffer size or it reaches a null-terminator
+     in source string. The output buffer will be null-terminated if space
+     permits. If dstsz is zero, the function just returns the size of byte not 
+     including ending null-terminator need to store the converted string.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Destination buffer for multi-byte. It can be NULL pointer if dstsz is
+     zero.
+   dstsz(IN)
+     Destination buffer size in byte. If it is zero, it just returns the size
+     of bytes need for converted string.
+   src (IN)
+     Source wchar string to be converted.
+   srcsz(IN)
+     Length of source string in character.
+   rsize(OUT)
+     Number of bytes written into destination buffer, or number of bytes need
+     to store the converted string if dstsz is zero.
+     If it is NULL pointer, nothing to return.
+*/
+sword OCIWideCharInSizeToMultiByte(dvoid *envhp, OraText *dst,
+                                    size_t dstsz, CONST OCIWchar *src,
+                                    size_t srcsz, size_t *rsize);
+
+
+
+/* ----------------------- OCIWideCharIsAlnum -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsAlnum - test whether wc is a letter or decimal digit
+   REMARKS
+     It tests whether wc is a letter or decimal digit.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsAlnum(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsAlpha -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsAlpha - test whether wc is an alphabetic letter
+   REMARKS
+     It tests whether wc is an alphabetic letter
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsAlpha(dvoid *envhp, OCIWchar wc);
+
+
+/* --------------------- OCIWideCharIsCntrl ---------------------------------*/
+/*
+   NAME
+     OCIWideCharIsCntrl - test whether wc is a control character
+   REMARKS
+     It tests whether wc is a control character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsCntrl(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsDigit -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsDigit - test whether wc is a decimal digit character
+   REMARKS
+     It tests whether wc is a decimal digit character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsDigit(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsGraph -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsGraph - test whether wc is a graph character
+   REMARKS
+     It tests whether wc is a graph character. A graph character is character
+     with a visible representation and normally includes alphabetic letter,
+     decimal digit, and punctuation.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsGraph(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsLower -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsLower - test whether wc is a lowercase letter
+   REMARKS
+     It tests whether wc is a lowercase letter.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsLower(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsPrint -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsPrint - test whether wc is a printable character
+   REMARKS
+     It tests whether wc is a printable character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsPrint(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsPunct -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsPunct - test whether wc is a punctuation character
+   REMARKS
+     It tests whether wc is a punctuation character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsPunct(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsSpace -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsSpace - test whether wc is a space character
+   REMARKS
+     It tests whether wc is a space character. A space character only causes
+     white space in displayed text(for example, space, tab, carriage return,
+     newline, vertical tab or form feed).
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsSpace(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsUpper -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsUpper - test whether wc is a uppercase letter
+   REMARKS
+     It tests whether wc is a uppercase letter.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsUpper(dvoid *envhp, OCIWchar wc);
+
+
+/*----------------------- OCIWideCharIsXdigit -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsXdigit - test whether wc is a hexadecimal digit
+   REMARKS
+     It tests whether wc is a hexadecimal digit ( 0-9, A-F, a-f ).
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsXdigit(dvoid *envhp, OCIWchar wc);
+
+
+/* --------------------- OCIWideCharIsSingleByte ----------------------------*/
+/*
+   NAME
+     OCIWideCharIsSingleByte - test whether wc is a single-byte character
+   REMARKS
+     It tests whether wc is a single-byte character when converted into
+     multi-byte.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsSingleByte(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharToLower -------------------------------*/
+/*
+   NAME
+     OCIWideCharToLower - Convert a wchar into the lowercase
+   REMARKS
+     If there is a lower-case character mapping for wc in the specified locale,
+     it will return the lower-case in wchar, else return wc itself.
+   RETURNS
+     A wchar
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for lowercase mapping.
+*/
+OCIWchar OCIWideCharToLower(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharToUpper -------------------------------*/
+/*
+   NAME
+     OCIWideCharToUpper - Convert a wchar into the uppercase
+   REMARKS
+     If there is a upper-case character mapping for wc in the specified locale,
+     it will return the upper-case in wchar, else return wc itself.
+   RETURNS
+     A wchar
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for uppercase mapping.
+*/
+OCIWchar OCIWideCharToUpper(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharStrcmp --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrcmp - compare two null terminated wchar string
+   REMARKS
+     It compares two wchar string in binary ( based on wchar encoding value ),
+     linguistic, or case-insensitive.
+   RETURNS
+     0, if wstr1 == wstr2.
+     Positive, if wstr1 > wstr2.
+     Negative, if wstr1 < wstr2.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set.
+   wstr1(IN)
+     Pointer to a null-terminated wchar string.
+   wstr2(IN)
+     Pointer to a null-terminated wchar string.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY : for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC : for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive
+     comparison.
+*/
+int OCIWideCharStrcmp(dvoid *envhp, CONST OCIWchar *wstr1, 
+                CONST OCIWchar *wstr2, int flag);
+
+
+/* ----------------------- OCIWideCharStrncmp -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrncmp - compare twe wchar string in length
+   REMARKS
+     This function is similar to OCIWideCharStrcmp(), except that at most len1
+     characters from wstr1 and len2 characters from wstr1 are compared. The
+     null-terminator will be taken into the comparison.
+   RETURNS
+     0, if wstr1 = wstr2
+     Positive, if wstr1 > wstr2
+     Negative, if wstr1 < wstr2
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr1(IN)
+     Pointer to the first wchar string
+   len1(IN)
+     The length for the first string for comparison
+   wstr2(IN)
+     Pointer to the second wchar string
+   len2(IN)
+     The length for the second string for comparison.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY : for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC : for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 
+     comparison.
+*/
+int OCIWideCharStrncmp(dvoid *envhp, CONST OCIWchar *wstr1, size_t len1,
+                 CONST OCIWchar *wstr2, size_t len2, int flag);
+
+
+/* ----------------------- OCIWideCharStrcat --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrcat - concatenate two wchar strings
+   REMARKS
+     This function appends a copy of the wchar string pointed to by wsrcstr,
+     including the null-terminator to the end of wchar string pointed to by
+     wdststr. It returns the number of character in the result string not
+     including the ending null-terminator.
+   RETURNS
+     number of characters in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(IN/OUT)
+     Pointer to the destination wchar string for appending.
+   wsrcstr(IN)
+     Pointer to the source wchar string to append.
+*/
+size_t OCIWideCharStrcat(dvoid *envhp, OCIWchar *wdststr,
+                         CONST OCIWchar *wsrcstr);
+
+
+/* ----------------------- OCIWideCharStrchr --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrchr - Search the first occurrence of wchar in a wchar string
+   REMARKS
+     This function searchs for the first occurrence of wc in the wchar string
+     pointed to by wstr. It returns a pointer to the whcar if successful, or
+     a null pointer.
+   RETURNS
+     wchar pointer if successful, otherwise a null pointer.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr(IN)
+     Pointer to the wchar string to search
+   wc(IN)
+     Wchar to search for.
+*/
+OCIWchar *OCIWideCharStrchr(dvoid *envhp, CONST OCIWchar *wstr,
+                            OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharStrcpy --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrcpy - copy a wchar string
+   REMARKS
+     This function copies the wchar string pointed to by wsrcstr, including the
+     null-terminator, into the array pointed to by wdststr. It returns the
+     number of character copied not including the ending null-terminator.
+   RETURNS
+     number of characters copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(OUT)
+     Pointer to the destination wchar buffer.
+   wsrcstr(IN)
+     Pointer to the source wchar string.
+*/
+size_t OCIWideCharStrcpy(dvoid *envhp, OCIWchar *wdststr,
+                         CONST OCIWchar *wsrcstr);
+
+
+/* ----------------------- OCIWideCharStrlen --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrlen - Return number of character in a wchar string
+   REMARKS
+     This function computes the number of characters in the wchar string
+     pointed to by wstr, not including the null-terminator, and returns
+    this number. 
+   RETURNS
+     number of characters not including ending null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr(IN)
+     Pointer to the source wchar string.
+*/
+size_t OCIWideCharStrlen(dvoid *envhp, CONST OCIWchar *wstr);
+
+
+/* ----------------------- OCIWideCharStrncat -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrncat - Concatenate wchar string in length
+   REMARKS
+     This function is similar to OCIWideCharStrcat(), except that at most n
+     characters from wsrcstr are appended to wdststr. Note that the
+     null-terminator in wsrcstr will stop appending. wdststr will be
+     null-terminated.. 
+   RETURNS
+     Number of characters in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(IN/OUT)
+     Pointer to the destination wchar string for appending.
+   wsrcstr(IN)
+     Pointer to the source wchar string to append.
+   n(IN)
+     Number of characters from wsrcstr to append.
+*/
+size_t OCIWideCharStrncat(dvoid *envhp, OCIWchar *wdststr,
+                          CONST OCIWchar *wsrcstr, size_t n);
+
+
+/* ----------------------- OCIWideCharStrncpy -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrncpy - Copy wchar string in length
+   REMARKS
+     This function is similar to OCIWideCharStrcpy(), except that at most n
+     characters are copied from the array pointed to by wsrcstr to the array
+     pointed to by wdststr. Note that the null-terminator in wdststr will
+     stop coping and result string will be null-terminated.
+   RETURNS
+     number of characters copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(OUT)
+     Pointer to the destination wchar buffer.
+   wsrcstr(IN)
+     Pointer to the source wchar string.
+   n(IN)
+     Number of characters from wsrcstr to copy.
+*/
+size_t OCIWideCharStrncpy(dvoid *envhp, OCIWchar *wdststr,
+                          CONST OCIWchar *wsrcstr, size_t n);
+
+
+/* ----------------------- OCIWideCharStrrchr -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrrchr - search the last occurrence of a wchar in wchar string
+   REMARKS
+     This function searchs for the last occurrence of wc in the wchar string
+     pointed to by wstr. It returns a pointer to the whcar if successful, or
+     a null pointer.
+   RETURNS
+     wchar pointer if successful, otherwise a null pointer.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr(IN)
+     Pointer to the wchar string to search
+   wc(IN)
+     Wchar to search for.
+*/
+OCIWchar *OCIWideCharStrrchr(dvoid *envhp, CONST OCIWchar *wstr,
+                             OCIWchar wc);
+
+
+/* --------------------- OCIWideCharStrCaseConversion -----------------------*/
+/*
+   NAME
+     OCIWideCharStrCaseConversion - convert a wchar string into lowercase or
+                                    uppercase
+   REMARKS
+     This function convert the wide char string pointed to by wsrcstr into the
+     uppercase or lowercase specified by flag and copies the result into the
+     array pointed to by wdststr. The result string will be null-terminated.
+   RETURNS
+     number of characters for result string not including null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle.
+   wdststr(OUT)
+     Pointer to destination array.
+   wsrcstr(IN)
+     Pointer to source string.
+   flag(IN)
+     Specify the case to convert:
+       OCI_NLS_UPPERCASE : convert to uppercase.
+       OCI_NLS_LOWERCASE: convert to lowercase.
+     This flag can be ORed with OCI_NLS_LINGUISTIC to specify that the
+     linguistic setting in the locale will be used for case conversion.
+*/
+size_t OCIWideCharStrCaseConversion(dvoid *envhp, OCIWchar *wdststr,
+                                    CONST OCIWchar *wsrcstr, ub4 flag);
+
+
+/*---------------------- OCIWideCharDisplayLength ---------------------------*/
+/*
+   NAME
+     OCIWideCharDisplayLength - Calculate the display length for a wchar
+   REMARKS
+     This function determines the number of column positions required for wc
+     in display. It returns number of column positions, or 0 if wc is 
+     null-terminator.
+   RETURNS
+     Number of display positions.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar character.
+*/
+size_t OCIWideCharDisplayLength(dvoid *envhp, OCIWchar wc );
+
+
+/*---------------------- OCIWideCharMultiByteLength -------------------------*/
+/*
+   NAME
+     OCIWideCharMultiByteLength - Determine byte size in multi-byte encoding
+   REMARKS
+     This function determines the number of byte required for wc in multi-byte
+     encoding. It returns number of bytes in multi-byte for wc.
+   RETURNS
+     Number of bytes.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar character.
+*/
+size_t OCIWideCharMultiByteLength(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIMultiByteStrcmp -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrcmp - Compare two multi-byte strings
+   REMARKS
+     It compares two multi-byte strings in binary ( based on encoding value ),
+     linguistic, or case-insensitive.
+   RETURNS
+     0, if str1 == str2.
+     Positive, if str1 > str2.
+     Negative, if str1 < str2.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set.
+   str1(IN)
+     Pointer to a null-terminated string.
+   str2(IN)
+     Pointer to a null-terminated string.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY: for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC: for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 
+     comparison.
+*/
+int OCIMultiByteStrcmp(dvoid *envhp, CONST OraText *str1,
+                       CONST OraText *str2, int flag);
+
+
+/*----------------------- OCIMultiByteStrncmp -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrncmp - compare two strings in length
+   REMARKS
+     This function is similar to OCIMultiBytestrcmp(), except that at most
+     len1 bytes from str1 and len2 bytes from str2 are compared. The
+     null-terminator will be taken into the comparison.
+   RETURNS
+     0, if str1 = str2
+     Positive, if str1 > str2
+     Negative, if str1 < str2
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set.
+   str1(IN)
+     Pointer to the first string
+   len1(IN)
+     The length for the first string for comparison
+   str2(IN)
+     Pointer to the second string
+   len2(IN)
+     The length for the second string for comparison.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY: for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC: for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 
+     comparison.
+*/
+int OCIMultiByteStrncmp(dvoid *envhp, CONST OraText *str1, size_t len1,
+                        OraText *str2, size_t len2, int flag);
+
+
+/*----------------------- OCIMultiByteStrcat --------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrcat - concatenate multibyte strings
+   REMARKS
+     This function appends a copy of the multi-byte string pointed to by
+     srcstr, including the null-terminator to the end of string pointed to by
+     dststr. It returns the number of bytes in the result string not including
+     the ending null-terminator.
+   RETURNS
+     number of bytes in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     Pointer to OCI environment handle
+   dststr(IN/OUT)
+     Pointer to the destination multi-byte string for appending.
+   srcstr(IN)
+     Pointer to the source string to append.
+*/
+size_t OCIMultiByteStrcat(dvoid *envhp, OraText *dststr,
+                          CONST OraText *srcstr);
+
+
+/*------------------------- OCIMultiByteStrcpy ------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrcpy - copy multibyte string
+   REMARKS
+     This function copies the multi-byte string pointed to by srcstr,
+     including the null-terminator, into the array pointed to by dststr. It
+     returns the number of bytes copied not including the ending 
+     null-terminator.
+   RETURNS
+     number of bytes copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     Pointer to the OCI environment handle.
+   srcstr(OUT)
+     Pointer to the destination buffer.
+   dststr(IN)
+     Pointer to the source multi-byte string.
+*/
+size_t OCIMultiByteStrcpy(dvoid *envhp, OraText *dststr,
+                          CONST OraText *srcstr);
+
+
+/*----------------------- OCIMultiByteStrlen --------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrlen - Calculate multibyte string length
+   REMARKS
+     This function computes the number of bytes in the multi-byte string
+     pointed to by str, not including the null-terminator, and returns this
+     number. 
+   RETURNS
+     number of bytes not including ending null-terminator.
+   str(IN)
+     Pointer to the source multi-byte string.
+*/
+size_t OCIMultiByteStrlen(dvoid *envhp, CONST OraText *str);
+
+
+/*----------------------- OCIMultiByteStrncat -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrncat - concatenate string in length
+   REMARKS
+     This function is similar to OCIMultiBytestrcat(), except that at most n
+     bytes from srcstr are appended to dststr. Note that the null-terminator in
+     srcstr will stop appending and the function will append as many character
+     as possible within n bytes. dststr will be null-terminated. 
+   RETURNS
+     Number of bytes in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     Pointer to OCI environment handle.
+   srcstr(IN/OUT)
+     Pointer to the destination multi-byte string for appending.
+   dststr(IN)
+     Pointer to the source multi-byte string to append.
+   n(IN)
+     Number of bytes from srcstr to append.
+*/
+size_t OCIMultiByteStrncat(dvoid *envhp, OraText *dststr,
+                           CONST OraText *srcstr, size_t n);
+
+
+/*----------------------- OCIMultiByteStrncpy -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrncpy - copy multibyte string in length
+   REMARKS
+     This function is similar to OCIMultiBytestrcpy(), except that at most n
+     bytes are copied from the array pointed to by srcstr to the array pointed
+     to by dststr. Note that the null-terminator in srcstr will stop coping and
+     the function will copy as many character as possible within n bytes. The 
+     result string will be null-terminated.
+   RETURNS
+     number of bytes copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     Pointer to a OCI environment handle.
+   dststr(IN)
+     Pointer to the source multi-byte string.
+   srcstr(OUT)
+     Pointer to the destination buffer.
+   n(IN)
+     Number of bytes from srcstr to copy.
+*/
+size_t OCIMultiByteStrncpy(dvoid *envhp, OraText *dststr,
+                           CONST OraText *srcstr, size_t n);
+
+
+/*----------------------- OCIMultiByteStrnDisplayLength ---------------------*/
+/*
+   NAME
+     OCIMultiByteStrnDisplayLength - calculate the display length for a
+                                     multibyt string
+   REMARKS
+     This function returns the number of display positions occupied by the 
+     complete characters within the range of n bytes.
+   RETURNS
+     number of display positions.
+   envhp(IN/OUT)
+     OCI environment handle.
+   str(IN)
+     Pointer to a multi-byte string.
+   n(IN)
+     Number of bytes to examine.
+*/
+size_t OCIMultiByteStrnDisplayLength(dvoid *envhp, CONST OraText *str1,
+                                     size_t n);
+
+
+/*---------------------- OCIMultiByteStrCaseConversion  ---------------------*/
+/*
+   NAME
+     OCIMultiByteStrCaseConversion
+   REMARKS
+     This function convert the multi-byte string pointed to by srcstr into the
+     uppercase or lowercase specified by flag and copies the result into the
+     array pointed to by dststr. The result string will be null-terminated.
+   RETURNS
+     number of bytes for result string not including null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle.
+   dststr(OUT)
+     Pointer to destination array.
+   srcstr(IN)
+     Pointer to source string.
+   flag(IN)
+     Specify the case to convert:
+       OCI_NLS_UPPERCASE: convert to uppercase.
+       OCI_NLS_LOWERCASE: convert to lowercase.
+     This flag can be ORed with OCI_NLS_LINGUISTIC to specify that the 
+     linguistic setting in the locale will be used for case conversion.
+*/
+size_t OCIMultiByteStrCaseConversion(dvoid *envhp, OraText *dststr,
+                                     CONST OraText *srcstr, ub4 flag);
+
+
+/*------------------------- OCICharSetToUnicode -----------------------------*/
+/*
+   NAME
+     OCICharSetToUnicode - convert multibyte string into Unicode as UCS2
+   REMARKS
+     This function converts a multi-byte string pointed to by src to Unicode 
+     into the array pointed to by dst. The conversion will stop when it reach
+     to the source limitation or destination limitation. 
+     The function will return number of characters converted into Unicode.
+     If dstlen is zero, it will just return the number of characters for the
+     result without real conversion.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     Pointer to an OCI environment handle
+   dst(OUT)
+     Pointer to a destination buffer
+   dstlen(IN)
+     Size of destination buffer in character
+   src(IN)
+     Pointer to multi-byte source string.
+   srclen(IN)
+     Size of source string in bytes.
+   rsize(OUT)
+     Number of characters converted.
+     If it is a NULL pointer, nothing to return.
+*/
+sword OCICharSetToUnicode(dvoid *envhp, ub2 *dst, size_t dstlen,
+                          CONST OraText *src, size_t  srclen, size_t *rsize);
+
+
+/*------------------------- OCIUnicodeToCharSet -----------------------------*/
+/*
+   NAME
+     OCIUnicodeToCharSet - convert Unicode into multibyte
+   REMARKS
+     This function converts a Unicode string pointed to by src to multi-byte
+     into the array pointed to by dst. The conversion will stop when it reach
+     to the source limitation or destination limitation. The function will
+     return number of bytes converted into multi-byte. If dstlen is zero, it
+     will just return the number of bytes for the result without real 
+     conversion. If a Unicode character is not convertible for the character
+     set specified in OCI environment handle, a replacement character will be
+     used for it. In this case, OCICharSetConversionIsReplacementUsed() will
+     return ture.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     Pointer to an OCI environment handle.
+   dst(OUT)
+     Pointer to a destination buffer.
+   dstlen(IN)
+     Size of destination buffer in byte.
+   src(IN)
+     Pointer to a Unicode string.
+   srclen(IN)
+     Size of source string in characters.
+   rsize(OUT)
+     Number of bytes converted.
+     If it is a NULL pointer, nothing to return.
+*/
+sword OCIUnicodeToCharSet(dvoid *envhp, OraText *dst, size_t dstlen, 
+                           CONST ub2 *src, size_t srclen, size_t *rsize);
+
+/*----------------------- OCINlsCharSetConvert ------------------------------*/
+/*
+   NAME
+     OCINlsCharSetConvert - convert between any two character set.
+   REMARKS
+     This function converts a string pointed to by src in the character set
+     specified with srcid to the array pointed to by dst in the character set
+     specified with dstid. The conversion will stop when it reaches the source
+     limitation or destination limitation. The function will return the number
+     of bytes converted into the destination buffer. Even though either source
+     or destination character set id is OCI_UTF16ID, given and return data
+     length will be represented with the byte length as this function is
+     intended for generic purpose. Note the conversion will not stop at null
+     data.
+     To get character set id from name, OCINlsCharSetNameToId can be used.
+     To check if derived data in the destination buffer contains any
+     replacement character resulting from conversion failure,
+     OCICharSetConversionIsReplacementUsed can be used to get the status.
+     Data alignment should be guaranteed by a caller. For example, UTF-16 data
+     should be aligned to ub2 type.
+
+   RETURNS
+     OCI_SUCCESS or OCI_ERROR.
+   errhp(IN/OUT)
+     OCI error handle. If there is an error, it is recorded in errhp and this
+     function returns a NULL pointer. Diagnostic information can be obtained
+     by calling OCIErrorGet().
+   dstid(IN)
+     Character set id for the destination buffer.
+   dstp(OUT)
+     Pointer to the destination buffer.
+   dstlen(IN)
+     The maximum byte size of destination buffer.
+   srcid(IN)
+     Character set id for the source buffer.
+   srcp(IN)
+     Pointer to the source buffer.
+   srclen(IN)
+     The length byte size of source buffer.
+   rsize(OUT)
+     The number of characters converted. If it is a NULL pointer, nothing to
+     return.
+*/
+sword OCINlsCharSetConvert(dvoid *envhp, OCIError *errhp, 
+                        ub2 dstid, dvoid *dstp, size_t dstlen,
+                        ub2 srcid, CONST dvoid *srcp, size_t srclen,
+                        size_t *rsize);
+
+
+/* ------------------- OCICharsetConversionIsReplacementUsed ----------------*/
+/*
+   NAME
+     OCICharsetConversionIsReplacementUsed - chech if replacement is used in 
+                                             conversion
+   REMARKS
+     This function indicates whether or not the replacement character was used
+     for nonconvertible characters in character set conversion in last invoke
+     of OCICharsetUcs2ToMb().
+   RETURNS
+     TRUE is the replacement character was used in last OCICharsetUcs2ToMb()
+     invoking, else FALSE.
+   envhp(IN/OUT)
+     OCI environment handle. This should be the first handle passed to 
+     OCICharsetUcs2ToMb().
+*/
+boolean OCICharSetConversionIsReplacementUsed(dvoid *envhp);
+
+/*------------------- OCINlsEnvironmentVariableGet -----------------*/
+/*
+   NAME
+     OCINlsEnvironmentVariableGet - get a value of NLS environment variable.
+
+   DESCRIPTION
+     This function retrieves a value of NLS environment variable to the buffer
+     pointed to by val. Data type is determined by the parameter specified by
+     item. Either numeric data or string data can be retrieved.
+
+   RETURNS
+     OCI_SUCCESS or OCI_ERROR.
+
+   PARAMETERS
+   valp(OUT) -
+     Pointer to the buffer.
+   size(IN) -
+     Size of the buffer. This argument is only applicable to string data type,
+     but not to numerical data, in such case, it is ignored.
+   item(IN) -
+     NLS item value, which can be one of following values:
+       OCI_NLS_CHARSET_ID  - NLS_LANG character set id in ub2 data type.
+       OCI_NLS_NCHARSET_ID - NLS_NCHAR character set id in ub2 data type.
+   charset(IN) -
+     Character set id for retrieved string data. If it is 0, NLS_LANG will be
+     used. OCI_UTF16ID is a valid id. In case of numeric data, this argument
+     is ignored.
+   rsize(OUT) -
+     Size of return value.
+
+   NOTE
+     This functions is mainly used for retrieving character set id from either
+     NLS_LANG or NLS_NCHAR environment variables. If NLS_LANG is not set,
+     the default character set id is returned.
+     For future extension, the buffer is capable for storing other data types.
+*/
+sword OCINlsEnvironmentVariableGet(dvoid  *valp, size_t size, ub2 item,
+                                   ub2 charset, size_t *rsize);
+
+
+/*------------------------- OCIMessageOpen ----------------------------------*/
+/*
+   NAME
+     OCIMessageOpen - open a locale message file
+   REMARKS
+     This function opens a message handle for facility of product in a language
+     pointed to by envhp. It first try to open the message file corresponding
+     to envhp for the facility. If it successes, it will use that file to
+     initialize a message handle, else it will use the default message file
+     which is for American language for the facility. The function return a
+     pointer pointed to a message handle into msghp parameter.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     A pointer to OCI environment handle for message language.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and this
+     function returns a NULL pointer. Diagnostic information can be obtained by
+     calling OCIErrorGet().
+   msghp(OUT)
+     a message handle for return
+   product(IN)
+     A pointer to a product name. Product name is used to locate the directory
+     for message in a system dependent way. For example, in Solaris, the
+     directory of message files for the product `rdbms' is
+     `${ORACLE_HOME}/rdbms'.
+   facility(IN)
+     A pointer to a facility name in the product. It is used to construct a
+     message file name. A message file name follows the conversion with 
+     facility as prefix. For example, the message file name for facility
+     `img' in American language will be `imgus.msb' where `us' is the 
+     abbreviation of American language and `msb' as message binary file 
+     extension.
+   dur(IN)
+     Duration for memory allocation for the return message handle. It can be
+     the following values:
+        OCI_DURATION_CALL
+        OCI_DURATION_STATEMENT
+        OCI_DURATION_SESSION
+        OCI_DURATION_TRANSACTION
+     For the detail description, please refer to Memory Related Service
+     Interfaces section.
+*/
+sword OCIMessageOpen(dvoid *envhp, OCIError *errhp, OCIMsg **msghp,
+                      CONST OraText *product, CONST OraText *facility, 
+                      OCIDuration dur);
+ 
+
+/*------------------------- OCIMessageGet -----------------------------------*/
+/*
+   NAME
+     OCIMessageGet - get a locale message from a message handle
+   REMARKS
+     This function will get message with message number identified by msgno and
+     if buflen is not zero, the function will copy the message into the buffer
+     pointed to by msgbuf. If buflen is zero, the message will be copied into
+     a message buffer inside the message handle pointed to by msgh. For both
+     cases. it will return the pointer to the null-terminated message string.
+     If it cannot get the message required, it will return a NULL pointer.
+   RETURNS
+     A pointer to a null-terminated message string on success, otherwise a NULL
+     pointer.
+   msgh(IN/OUT)
+     Pointer to a message handle which was previously opened by
+     OCIMessageOpen().
+   msgno(IN)
+     The message number for getting message.
+   msgbuf(OUT)
+     Pointer to a destination buffer to the message retrieved. If buflen is
+     zero, it can be NULL pointer.
+   buflen(IN)
+     The size of the above destination buffer.
+*/
+OraText *OCIMessageGet(OCIMsg *msgh, ub4 msgno, OraText *msgbuf,
+                       size_t buflen);
+
+/*------------------------- OCIMessageClose ---------------------------------*/
+/*
+   NAME
+     OCIMessageClose - close a message handle
+   REMARKS
+     This function closes a message handle pointed to by msgh and frees any
+     memory associated with this handle.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     A pointer to OCI environment handle for message language.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and this
+     function returns a NULL pointer. Diagnostic information can be obtained by
+     calling OCIErrorGet().
+   msghp(IN/OUT)
+     A pointer to a message handle which was previously opened by
+     OCIMessageOpen().
+*/
+sword OCIMessageClose(dvoid *envhp, OCIError *errhp, OCIMsg *msghp);
+
+/*--------------- End of Extensions to NLS cartridge service ----------------*/
+
+
+/*----------------- Extensions to OCI Thread interface ---------------------*/
+/*****************************************************************************
+                              DESCRIPTION
+******************************************************************************
+1 Threads Interface
+
+The OCIThread package provides a number of commonly used threading
+primitives for use by Oracle customers.  It offers a portable interface to
+threading capabilities native to various platforms.  It does not implement
+threading on platforms which do not have native threading capability.
+
+OCIThread does not provide a portable implementation of multithreaded 
+facilities.  It only serves as a set of portable covers for native 
+multithreaded facilities.  Therefore, platforms that do not have native 
+support for multi-threading will only be able to support a limited 
+implementation of OCIThread.  As a result, products that rely on all of 
+OCIThread's functionality will not port to all platforms.  Products that must 
+port to all platforms must use only a subset of OCIThread's functionality.  
+This issue is discussed further in later sections of this document.
+
+The OCIThread API is split into four main parts.  Each part is described
+briefly here.  The following subsections describe each in greater detail.
+
+ 1. Initialization and Termination Calls
+
+     These calls deal with the initialization and termination of OCIThread.
+     Initialization of OCIThread initializes the OCIThread context which is
+     a member of the OCI environment or session handle.  This context is 
+     required for other OCIThread calls.
+
+ 2. Passive Threading Primitives
+
+     The passive threading primitives include primitives to manipulate mutual
+     exclusion (mutex) locks, thread ID's, and thread-specific data keys.
+
+     The reason that these primitives are described as 'passive' is that while
+     their specifications allow for the existence of multiple threads, they do
+     not require it.  This means that it is possible for these primitives to
+     be implemented according to specification in both single-threaded and
+     multi-threaded environments.
+
+     As a result, OCIThread clients that use only these primitives will not
+     require the existence of multiple threads in order to work correctly,
+     i.e., they will be able to work in single-threaded environments without 
+     branching code.
+
+ 3. Active Threading Primitives
+
+     Active threading primitives include primitives dealing with the creation,
+     termination, and other manipulation of threads.
+
+     The reason that these primitives are described as 'active' is that they
+     can only be used in true multi-threaded environments.  Their
+     specifications explicitly require that it be possible to have multiple
+     threads.  If you need to determine at runtime whether or not you are in a
+     multi-threaded environment, call OCIThreadIsMulti() before calling an
+     OCIThread active primitive.
+
+
+1.1 Initialization & Termination
+==================================
+
+The types and functions described in this section are associated with the
+initialization and termination of the OCIThread package.  OCIThread must
+be properly initialized before any of its functionality can be used.
+OCIThread's process initialization function, 'OCIThreadProcessInit()',
+must be called with care; see below.
+
+The observed behavior of the initialization and termination functions is the
+same regardless of whether OCIThread is in single-threaded or multi-threaded
+environment.  It is OK to call the initialization functions from both generic
+and operating system specific (OSD) code.
+
+1.1.1 Types
+
+  OCIThreadContext - OCIThread Context
+  -------------------------------------
+
+    Most calls to OCIThread functions take the OCI environment or session 
+    handle as a parameter.  The OCIThread context is part of the OCI 
+    environment or session handle and it must be initialized by calling 
+    'OCIThreadInit()'.  Termination of the OCIThread context occurs by calling
+    'OCIThreadTerm()'.
+
+    The OCIThread context is a private data structure.  Clients must NEVER
+    attempt to examine the contents of the context.
+
+1.1.2  OCIThreadProcessInit
+
+  OCIThreadProcessInit - OCIThread Process INITialization
+  --------------------------------------------------------
+
+    Description
+
+      This function should be called to perform OCIThread process
+      initialization.
+
+    Prototype
+
+      void OCIThreadProcessInit();
+
+    Returns
+
+      Nothing.
+
+    Notes
+
+      Whether or not this function needs to be called depends on how OCI
+      Thread is going to be used.
+
+        * In a single-threaded application, calling this function is optional.
+          If it is called at all, the first call to it must occur before calls
+          to any other OCIThread functions.  Subsequent calls can be made
+          without restriction; they will not have any effect.
+
+        * In a multi-threaded application, this function MUST be called.  The
+          first call to it MUST occur 'strictly before' any other OCIThread
+          calls; i.e., no other calls to OCIThread functions (including other
+          calls to this one) can be concurrent with the first call.
+          Subsequent calls to this function can be made without restriction;
+          they will not have any effect.
+
+
+1.1.3 OCIThreadInit
+
+  OCIThreadInit - OCIThread INITialize
+  -------------------------------------
+
+    Description
+
+      This initializes OCIThread context.
+
+    Prototype
+
+      sword OCIThreadInit(dvoid *hndl, OCIError *err);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal for OCIThread clients to try an examine the memory
+      pointed to by the returned pointer.
+
+      It is safe to make concurrent calls to 'OCIThreadInit()'.  Unlike
+      'OCIThreadProcessInit()',  there is no need to have a first call
+      that occurs before all the others.
+
+      The first time 'OCIThreadInit()' is called, it initilaizes the OCI
+      Thread context.  It also saves a pointer to the context in some system
+      dependent manner.  Subsequent calls to 'OCIThreadInit()' will return
+      the same context.
+
+      Each call to 'OCIThreadInit()' must eventually be matched by a call to
+      'OCIThreadTerm()'.
+
+  OCIThreadTerm - OCIThread TERMinate
+  ------------------------------------
+
+    Description
+
+      This should be called to release the OCIThread context.  It should be
+      called exactly once for each call made to 'OCIThreadInit()'.
+
+    Prototype
+
+      sword OCIThreadTerm(dvoid *hndl, OCIError *err);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is safe to make concurrent calls to 'OCIThreadTerm()'.
+
+      'OCIThreadTerm()' will not do anything until it has been called as
+      many times as 'OCIThreadInit()' has been called.  When that happens,
+      it terminates the OCIThread layer and frees the memory allocated for
+      the context.  Once this happens, the context should not be re-used.
+      It will be necessary to obtain a new one by calling 'OCIThreadInit()'.
+
+
+  OCIThreadIsMulti - OCIThread Is Multi-Threaded?
+  ------------------------------------------------
+
+    Description
+
+      This tells the caller whether the application is running in a
+      multi-threaded environment or a single-threaded environment.
+
+    Prototype
+      boolean OCIThreadIsMulti(void);
+
+    Returns
+
+      TRUE if the environment is multi-threaded;
+      FALSE if the environment is single-threaded.
+
+
+1.2 Passive Threading Primitives
+==================================
+
+1.2.1 Types
+
+The passive threading primitives deal with the manipulation of mutex, 
+thread ID's, and thread-specific data.  Since the specifications of these 
+primitives do not require the existence of multiple threads, they can be 
+used both on multithreaded and single-threaded platforms.
+
+1.2.1.1  OCIThreadMutex - OCIThread Mutual Exclusion Lock
+-----------------------------------------------------------
+
+  The type 'OCIThreadMutex' is used to represent a mutual exclusion lock
+  (mutex).  A mutex is typically used for one of two purposes: (i) to
+  ensure that only one thread accesses a given set of data at a time, or
+  (ii) to ensure that only one thread executes a given critical section of
+  code at a time.
+
+  Mutexes pointer can be declared as parts of client structures or as 
+  stand-alone variables.  Before they can be used, they must be initialized 
+  using 'OCIThreadMutexInit()'.  Once they are no longer needed, they must be
+  destroyed using 'OCIThreadMutexDestroy()'.  A mutex pointer must NOT be 
+  used after it is destroyed.
+
+  A thread can acquire a mutex by using either 'OCIThreadMutexAcquire()' or
+  'OCIThreadMutexTry()'.  They both ensure that only one thread at a time is
+  allowed to hold a given mutex.  A thread that holds a mutex can release it
+  by calling 'OCIThreadMutexRelease()'.
+
+
+1.2.1.2  OCIThreadKey - OCIThread Key for Thread-Specific Data
+----------------------------------------------------------------
+
+  A key can be thought of as a process-wide variable that has a
+  thread-specific value.  What this means is that all the threads in a
+  process can use any given key.  However, each thread can examine or modify
+  that key independently of the other threads.  The value that a thread sees
+  when it examines the key will always be the same as the value that it last
+  set for the key.  It will not see any values set for the key by the other
+  threads.
+
+  The type of the value held by a key is a 'dvoid *' generic pointer.
+
+  Keys can be created using 'OCIThreadKeyInit()'.  When a key is created, its
+  value is initialized to 'NULL' for all threads.
+
+  A thread can set a key's value using 'OCIThreadKeySet()'.  A thread can
+  get a key's value using 'OCIThreadKeyGet()'.
+
+  The OCIThread key functions will save and retrieve data SPECIFIC TO THE
+  THREAD.  When clients maintain a pool of threads and assign the threads to
+  different tasks, it *may not* be appropriate for a task to use OCIThread
+  key functions to save data associated with it.  Here is a scenario of how
+  things can fail: A thread is assigned to execute the initialization of a
+  task.  During the initialization, the task stored some data related to it
+  in the thread using OCIThread key functions.  After the initialization,
+  the thread is returned back to the threads pool.  Later, the threads pool
+  manager assigned another thread to perform some operations on the task,
+  and the task needs to retrieve those data it stored earlier in
+  initialization.  Since the task is running in another thread, it will not
+  be able to retrieve the same data back!  Applications that use thread
+  pools should be aware of this and be cautious when using OCIThread key
+  functions.
+
+
+1.2.1.3  OCIThreadKeyDestFunc - OCIThread Key Destructor Function Type
+------------------------------------------------------------------------
+
+  This is the type of a pointer to a key's destructor routine.  Keys can be
+  associated with a destructor routine when they are created (see
+  'OCIThreadKeyInit()').
+
+  A key's destructor routine will be called whenever a thread that has a
+  non-NULL value for the key terminates.
+
+  The destructor routine returns nothing and takes one parameter.  The
+  parameter will be the value that was set for key when the thread
+  terminated.
+
+  The destructor routine is guaranteed to be called on a thread's value
+  in the key after the termination of the thread and before process
+  termination.  No more precise guarantee can be made about the timing
+  of the destructor routine call; thus no code in the process may assume
+  any post-condition of the destructor routine.  In particular, the
+  destructor is not guaranteed to execute before a join call on the
+  terminated thread returns.
+
+
+1.2.1.4  OCIThreadId - OCIThread Thread ID
+--------------------------------------------
+
+  Type 'OCIThreadId' is the type that will be used to identify a thread.
+  At any given time, no two threads will ever have the same 'OCIThreadId'.
+  However, 'OCIThreadId' values can be recycled; i.e., once a thread dies,
+  a new thread may be created that has the same 'OCIThreadId' as the one
+  that died.  In particular, the thread ID must uniquely identify a thread
+  T within a process, and it must be consistent and valid in all threads U
+  of the process for which it can be guaranteed that T is running
+  concurrently with U.  The thread ID for a thread T must be retrievable
+  within thread T.  This will be done via OCIThreadIdGet().
+
+  The 'OCIThreadId' type supports the concept of a NULL thread ID: the NULL
+  thread ID will never be the same as the ID of an actual thread.
+
+
+
+1.2.2 Function prototypes for passive primitives
+--------------------------------------------------
+
+1.2.2.1 Mutex functions
+-------------------------
+
+  OCIThreadMutexInit - OCIThread MuteX Initialize
+  -----------------------------------------------
+
+    Description
+
+      This allocate and initializes a mutex.  All mutexes must be 
+      initialized prior to use.
+
+    Prototype
+
+      sword OCIThreadMutexInit(dvoid *hndl, OCIError *err, 
+                               OCIThreadMutex **mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        mutex(OUT):  The mutex to initialize.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      Multiple threads must not initialize the same mutex simultaneously.
+      Also, a mutex must not be reinitialized until it has been destroyed (see
+      'OCIThreadMutexDestroy()').
+
+  OCIThreadMutexDestroy - OCIThread MuteX Destroy
+  -----------------------------------------------
+
+    Description
+
+      This destroys and deallocate a mutex.  Each mutex must be destroyed 
+      once it is no longer needed.
+
+    Prototype
+
+      sword OCIThreadMutexDestroy(dvoid *hndl, OCIError *err,
+                                  OCIThreadMutex **mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        mutex(IN/OUT):   The mutex to destroy.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is not legal to destroy a mutex that is uninitialized or is currently
+      held by a thread.  The destruction of a mutex must not occur concurrently
+      with any other operations on the mutex.  A mutex must not be used after
+      it has been destroyed.
+
+
+  OCIThreadMutexAcquire - OCIThread MuteX Acquire
+  -----------------------------------------------
+
+    Description
+
+      This acquires a mutex for the thread in which it is called.  If the mutex
+      is held by another thread, the calling thread is blocked until it can
+      acquire the mutex.
+
+    Prototype
+
+     sword OCIThreadMutexAcquire(dvoid *hndl, OCIError *err,
+                                 OCIThreadMutex *mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error, it is 
+                     recorded in err and this function returns OCI_ERROR.  
+                     Diagnostic information can be obtained by calling 
+                     OCIErrorGet().
+
+        mutex(IN/OUT):   The mutex to acquire.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to attempt to acquire an uninitialized mutex.
+
+      This function's behavior is undefined if it is used by a thread to
+      acquire a mutex that is already held by that thread.
+
+
+
+  OCIThreadMutexRelease - OCIThread MuteX Release
+  -----------------------------------------------
+
+    Description
+
+      This releases a mutex.  If there are any threads blocked on the mutex,
+      one of them will acquire it and become unblocked.
+
+    Prototype
+
+      sword OCIThreadMutexRelease(dvoid *hndl, OCIError *err,
+                                  OCIThreadMutex *mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        mutex(IN/OUT):   The mutex to release.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to attempt to release an uninitialized mutex.  It is also
+      illegal for a thread to release a mutex that it does not hold.
+
+
+  OCIThreadKeyInit - OCIThread KeY Initialize
+  -------------------------------------------
+
+    Description
+
+      This creates a key.  Each call to this routine allocate and generates 
+      a new key that is distinct from all other keys.
+
+    Prototype
+
+      sword OCIThreadKeyInit(dvoid *hndl, OCIError *err, OCIThreadKey **key,
+                             OCIThreadKeyDestFunc destFn);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(OUT):    The 'OCIThreadKey' in which to create the new key.
+
+        destFn(IN):  The destructor for the key.  NULL is permitted.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      Once this function executes successfully, a pointer to an allocated and 
+      initialized key is return.  That key can be used with 'OCIThreadKeyGet()'
+      and 'OCIThreadKeySet()'.  The initial value of the key will be 'NULL' for
+      all threads.
+
+      It is illegal for this function to be called more than once to create the
+      same key (i.e., to be called more than once with the same value for the
+      'key' parameter).
+
+      If the 'destFn' parameter is not NULL, the routine pointed to by 'destFn'
+      will be called whenever a thread that has a non-NULL value for the key
+      terminates.  The routine will be called with one parameter.  The
+      parameter will be the key's value for the thread at the time at which the
+      thread terminated.
+      If the key does not need a destructor function, pass NULL for 'destFn'.
+
+
+  OCIThreadKeyDestroy - OCIThread KeY DESTROY
+  -------------------------------------------
+
+   Description
+
+     Destroy and deallocate the key pointed to by 'key'.
+
+    Prototype
+
+      sword OCIThreadKeyDestroy(dvoid *hndl, OCIError *err, 
+                                OCIThreadKey **key);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(IN/OUT):  The 'OCIThreadKey' in which to destroy the key.
+ 
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      This is different from the destructor function callback passed to the
+      key create routine.  This new destroy function 'OCIThreadKeyDestroy' is 
+      used to terminate any resources OCI THREAD acquired when it created 
+      'key'.  [The 'OCIThreadKeyDestFunc' callback type is a key VALUE 
+      destructor; it does in no way operate on the key itself.]
+
+      This must be called once the user has finished using the key.  Not
+      calling the key destroy function may result in memory leaks.
+
+
+
+
+1.2.2.2 Thread Key operations
+-------------------------------
+
+  OCIThreadKeyGet - OCIThread KeY Get value
+  -----------------------------------------
+
+    Description
+
+      This gets the calling thread's current value for a key.
+
+    Prototype
+
+      sword OCIThreadKeyGet(dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                            dvoid **pValue);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(IN):          The key.
+
+        pValue(IN/OUT):   The location in which to place the thread-specific
+                          key value.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to use this function on a key that has not been created
+      using 'OCIThreadKeyInit()'.
+
+      If the calling thread has not yet assigned a value to the key, 'NULL' is
+      placed in the location pointed to by 'pValue'.
+
+
+  OCIThreadKeySet - OCIThread KeY Set value
+  -----------------------------------------
+
+    Description
+
+      This sets the calling thread's value for a key.
+
+    Prototype
+
+      sword OCIThreadKeySet(dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                            dvoid *value);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(IN/OUT): The key.
+
+        value(IN):   The thread-specific value to set in the key.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to use this function on a key that has not been created
+      using 'OCIThreadKeyInit()'.
+
+1.2.2.3  Thread Id
+--------------------
+
+  OCIThreadIdInit - OCIThread Thread Id INITialize
+  --------------------------------------------------
+
+    Description
+
+      Allocate and initialize the thread id 'tid'.
+
+    Prototype
+
+      sword OCIThreadIdInit(dvoid *hndl, OCIError *err, OCIThreadId **tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid (OUT):   Pointer to the thread ID to initialize.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+
+  OCIThreadIdDestroy - OCIThread Thread Id DESTROY
+  --------------------------------------------------
+
+    Description
+
+      Destroy and deallocate the thread id 'tid'.
+
+    Prototype
+
+      sword OCIThreadIdDestroy(dvoid *hndl, OCIError *err, OCIThreadId **tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid(IN/OUT):        Pointer to the thread ID to destroy.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Note
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdSet - OCIThread Thread Id Set
+  -----------------------------------------
+
+    Description
+
+      This sets one 'OCIThreadId' to another.
+
+    Prototype
+
+      sword OCIThreadIdSet(dvoid *hndl, OCIError *err, 
+                           OCIThreadId *tidDest,
+                           OCIThreadId *tidSrc);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tidDest(OUT):   This should point to the location of the 'OCIThreadId'
+                        to be set to.
+
+        tidSrc(IN):     This should point to the 'OCIThreadId' to set from.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdSetNull - OCIThread Thread Id Set Null
+  ---------------------------------------------------------
+
+    Description
+
+      This sets the NULL thread ID to a given 'OCIThreadId'.
+
+    Prototype
+
+      sword OCIThreadIdSetNull(dvoid *hndl, OCIError *err,
+                               OCIThreadId *tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error, it is 
+                     recorded in err and this function returns OCI_ERROR.  
+                     Diagnostic information can be obtained by calling 
+                     OCIErrorGet().
+
+        tid(OUT):    This should point to the 'OCIThreadId' in which to put
+                     the NULL thread ID.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdGet - OCIThread Thread Id Get
+  ------------------------------------------
+
+    Description
+
+      This retrieves the 'OCIThreadId' of the thread in which it is called.
+
+    Prototype
+
+      sword OCIThreadIdGet(dvoid *hndl, OCIError *err,
+                           OCIThreadId *tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid(OUT):    This should point to the location in which to place the
+                     ID of the calling thread.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+      When OCIThread is used in a single-threaded environment,
+      OCIThreadIdGet() will always place the same value in the location
+      pointed to by 'tid'.  The exact value itself is not important.  The
+      important thing is that it is not the same as the NULL thread ID and
+      that it is always the same value.
+
+
+  OCIThreadIdSame - OCIThread Thread Ids Same?
+  ----------------------------------------------
+
+    Description
+
+      This determines whether or not two 'OCIThreadId's represent the same
+      thread.
+
+    Prototype
+
+      sword OCIThreadIdSame(dvoid *hndl, OCIError *err,
+                            OCIThreadId *tid1, OCIThreadId *tid2,
+                            boolean *result);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid1(IN):   Pointer to the first 'OCIThreadId'.
+
+        tid2(IN):   Pointer to the second 'OCIThreadId'.
+        
+        result(IN/OUT): Pointer to the result.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      If 'tid1' and 'tid2' represent the same thread, 'result' is set to TRUE.
+      Otherwise, 'result' is set to FALSE.
+
+      'result' is set to TRUE if both 'tid1' and 'tid2' are the NULL thread ID.
+
+      'ti1d' and 'tid2' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdNull - OCIThread Thread Id NULL?
+  ---------------------------------------------
+
+    Description
+
+      This determines whether or not a given 'OCIThreadId' is the NULL thread
+      ID.
+
+    Prototype
+
+      sword OCIThreadIdNull(dvoid *hndl, OCIError *err,
+                            OCIThreadId *tid,
+                            boolean *result);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid(IN):    Pointer to the 'OCIThreadId' to check.
+
+        result(IN/OUT): Pointer to the result.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      If 'tid' is the NULL thread ID, 'result' is set to TRUE.  Otherwise, 
+      'result' is set to FALSE.
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+1.3 Active Threading Primitives
+=================================
+
+The active threading primitives deal with the manipulation of actual
+threads.  Because the specifications of most of these primitives require
+that it be possible to have multiple threads, they work correctly only in
+the enabled OCIThread; In the disabled OCIThread, they always return
+failure.  The exception is OCIThreadHandleGet(); it may be called in a 
+single-threaded environment, in which case it will have no effect.
+
+Active primitives should only be called by code running in a multi-threaded
+environment.  You can call OCIThreadIsMulti() to determine whether the 
+environment is multi-threaded or single-threaded.
+
+
+1.3.1  Types
+--------------
+
+1.3.1.1    OCIThreadHandle - OCIThread Thread Handle
+------------------------------------------------------
+
+  Type 'OCIThreadHandle' is used to manipulate a thread in the active
+  primitives:  OCIThreadJoin()and OCIThreadClose().  A thread handle opened by
+  OCIThreadCreate() must be closed in a matching call to
+  OCIThreadClose().  A thread handle is invalid after the call to
+  OCIThreadClose().
+
+  The distinction between a thread ID and a thread handle in OCIThread usage
+  follows the distinction between the thread ID and the thread handle on
+  Windows NT.  On many platforms, the underlying native types are the same.
+
+
+1.3.2  Functions
+------------------
+
+  OCIThreadHndInit - OCIThread HaNDle Initialize
+  ----------------------------------------------
+
+    Description
+
+      Allocate and initialize the thread handle.
+
+    Prototype
+
+      sword OCIThreadHndInit(dvoid *hndl, OCIError *err, 
+                             OCIThreadHandle **thnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        thnd(OUT):   The address of pointer to the thread handle to initialize.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+
+  OCIThreadHndDestroy - OCIThread HaNDle Destroy
+  ----------------------------------------------
+
+    Description
+
+      Destroy and deallocate the thread handle.
+
+    Prototype
+
+      sword OCIThreadHndDestroy(dvoid *hndl, OCIError *err, 
+                                OCIThreadHandle **thnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        thnd(IN/OUT):  The address of pointer to the thread handle to destroy.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+
+  OCIThreadCreate - OCIThread Thread Create
+  -----------------------------------------
+
+    Description
+
+      This creates a new thread.
+
+    Prototype
+
+      sword OCIThreadCreate(dvoid *hndl, OCIError *err,
+                            void (*start)(dvoid *), dvoid *arg,
+                            OCIThreadId *tid, OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        start(IN):    The function in which the new thread should begin
+                      execution.
+
+        arg(IN):      The argument to give the function pointed to by 'start'.
+
+        tid(IN/OUT):  If not NULL, gets the ID for the new thread.
+
+        tHnd(IN/OUT): If not NULL, gets the handle for the new thread.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      The new thread will start by executing a call to the function pointed
+      to by 'start' with the argument given by 'arg'.  When that function
+      returns, the new thread will terminate.  The function should not
+      return a value and should accept one parameter, a 'dvoid *'.
+
+      The call to OCIThreadCreate() must be matched by a call to
+      OCIThreadClose() if and only if tHnd is non-NULL.
+
+      If tHnd is NULL, a thread ID placed in *tid will not be valid in the
+      calling thread because the timing of the spawned thread's termination
+      is unknown.
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+
+
+  OCIThreadJoin - OCIThread Thread Join
+  -------------------------------------
+
+    Description
+
+      This function allows the calling thread to 'join' with another thread.
+      It blocks the caller until the specified thread terminates.
+
+    Prototype
+
+      sword OCIThreadJoin(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tHnd(IN):    The 'OCIThreadHandle' of the thread to join with.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+      The result of multiple threads all trying to join with the same thread is
+      undefined.
+
+
+  OCIThreadClose - OCIThread Thread Close
+  ---------------------------------------
+
+   Description
+
+     This function should be called to close a thread handle.
+
+   Prototype
+
+     sword OCIThreadClose(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tHnd(IN/OUT):    The OCIThread thread handle to close.
+
+   Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+   Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+      Both thread handle and the thread ID that was returned by the same call
+      to OCIThreadCreate() are invalid after the call to OCIThreadClose().
+
+
+
+  OCIThreadHandleGet - OCIThread Thread Get Handle
+  ------------------------------------------------
+
+    Description
+
+      Retrieve the 'OCIThreadHandle' of the thread in which it is called.
+
+    Prototype
+
+      sword OCIThreadHandleGet(dvoid *hndl, OCIError *err,
+                               OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tHnd(IN/OUT):      If not NULL, the location to place the thread
+                           handle for the thread.
+
+     Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().   
+
+      The thread handle 'tHnd' retrieved by this function must be closed 
+      with OCIThreadClose() and destroyed by OCIThreadHndDestroy() after it
+      is used.
+
+
+
+
+1.4 Using OCIThread
+=====================
+
+This section summarizes some of the more important details relating to the use
+of OCIThread.
+
+  * Process initialization
+
+    OCIThread only requires that the process initialization function
+    ('OCIThreadProcessInit()') be called when OCIThread is being used in a
+    multi-threaded application.  Failing to call 'OCIThreadProcessInit()' in
+    a single-threaded application is not an error.
+
+  * OCIThread initialization
+
+    Separate calls to 'OCIThreadInit()' will all return the same OCIThread
+    context.
+
+    Also, remember that each call to 'OCIThreadInit()' must eventually be
+    matched by a call to 'OCIThreadTerm()'.
+
+  * Active vs. Passive Threading primitives
+
+    OCIThread client code written without using any active primitives can be
+    compiled and used without change on both single-threaded and
+    multi-threaded platforms.
+
+    OCIThread client code written using active primitives will only work
+    correctly on multi-threaded platforms.  In order to write a version of the
+    same application to run on single-threaded platform, it is necessary to 
+    branch the your code, whether by branching versions of the source file or 
+    by branching at runtime with the OCIThreadIsMulti() call.
+
+******************************************************************************/
+
+/*****************************************************************************
+                         ACTUAL PROTOTYPE DECLARATIONS
+******************************************************************************/
+
+void OCIThreadProcessInit();
+
+sword OCIThreadInit(dvoid *hndl, OCIError *err);
+
+sword OCIThreadTerm(dvoid *hndl, OCIError *err);
+
+boolean OCIThreadIsMulti();
+
+sword OCIThreadMutexInit(dvoid *hndl, OCIError *err,  
+                         OCIThreadMutex **mutex); 
+
+sword OCIThreadMutexDestroy(dvoid *hndl, OCIError *err, 
+                            OCIThreadMutex **mutex);
+
+sword OCIThreadMutexAcquire(dvoid *hndl, OCIError *err,
+                            OCIThreadMutex *mutex);
+
+sword OCIThreadMutexRelease(dvoid *hndl, OCIError *err,
+                            OCIThreadMutex *mutex);
+
+sword OCIThreadKeyInit(dvoid *hndl, OCIError *err, OCIThreadKey **key,
+                       OCIThreadKeyDestFunc destFn);
+
+sword OCIThreadKeyDestroy(dvoid *hndl, OCIError *err, 
+                          OCIThreadKey **key);
+
+sword OCIThreadKeyGet(dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                      dvoid **pValue);
+
+sword OCIThreadKeySet(dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                      dvoid *value);
+
+sword OCIThreadIdInit(dvoid *hndl, OCIError *err, OCIThreadId **tid);
+
+sword OCIThreadIdDestroy(dvoid *hndl, OCIError *err, OCIThreadId **tid);
+
+sword OCIThreadIdSet(dvoid *hndl, OCIError *err, 
+                     OCIThreadId *tidDest, OCIThreadId *tidSrc);
+
+sword OCIThreadIdSetNull(dvoid *hndl, OCIError *err, OCIThreadId *tid);
+
+sword OCIThreadIdGet(dvoid *hndl, OCIError *err, OCIThreadId *tid);
+
+sword OCIThreadIdSame(dvoid *hndl, OCIError *err,
+                      OCIThreadId *tid1, OCIThreadId *tid2,
+                      boolean *result);
+
+sword OCIThreadIdNull(dvoid *hndl, OCIError *err,
+                      OCIThreadId *tid, boolean *result);
+
+sword OCIThreadHndInit(dvoid *hndl, OCIError *err, OCIThreadHandle **thnd);
+
+sword OCIThreadHndDestroy(dvoid *hndl, OCIError *err, OCIThreadHandle **thnd);
+
+sword OCIThreadCreate(dvoid *hndl, OCIError *err,
+                      void (*start)(dvoid *), dvoid *arg,
+                      OCIThreadId *tid, OCIThreadHandle *tHnd);
+
+sword OCIThreadJoin(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+
+sword OCIThreadClose(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+
+sword OCIThreadHandleGet(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+/*----------------- End OCI Thread interface Extensions ---------------------*/
+
+/*------------------ Begin OCI Row Callback Interfaces ----------------------*/
+
+typedef sword (*OCIBindRowCallback)(dvoid *ctx);
+typedef sword (*OCIFetchRowCallback)(dvoid *ctx);
+
+/*------------------ Begin OCI Row Callback Interfaces ----------------------*/
+
+/*--------------- Begin OCI Client Notification Interfaces ------------------*/
+
+typedef ub4 (*OCISubscriptionNotify)(dvoid *ctx, OCISubscription *subscrhp, 
+                                     dvoid *pay, ub4 payl, 
+                                     dvoid *desc, ub4 mode);
+
+sword OCISubscriptionRegister(OCISvcCtx *svchp, OCISubscription **subscrhpp, 
+                              ub2 count, OCIError *errhp, ub4 mode);
+
+
+sword OCISubscriptionPost(OCISvcCtx *svchp, OCISubscription **subscrhpp, 
+                              ub2 count, OCIError *errhp, ub4 mode);
+
+sword OCISubscriptionUnRegister(OCISvcCtx *svchp, OCISubscription *subscrhp, 
+                              OCIError *errhp, ub4 mode);
+
+sword OCISubscriptionDisable(OCISubscription *subscrhp, 
+                           OCIError *errhp, ub4 mode);
+
+sword OCISubscriptionEnable(OCISubscription *subscrhp, 
+                          OCIError *errhp, ub4 mode);
+
+/*------------------- End OCI Publish/Subscribe Interfaces ------------------*/
+
+/*----------------- Extensions to Datetime interfaces -----------------------*/
+/*--------------------- Actual Prototypes -----------------------------------*/
+sword OCIDateTimeGetTime(dvoid *hndl, OCIError *err, OCIDateTime *datetime, 
+                         ub1 *hr, ub1 *mm, ub1 *ss, ub4 *fsec);
+
+sword OCIDateTimeGetDate(dvoid *hndl, OCIError *err,  CONST OCIDateTime *date, 
+                 sb2 *yr, ub1 *mnth, ub1 *dy );
+
+sword OCIDateTimeGetTimeZoneOffset(dvoid *hndl,OCIError *err,
+                                   CONST OCIDateTime *datetime,
+                                   sb1 *hr,sb1 *mm);
+
+sword OCIDateTimeConstruct(dvoid  *hndl,OCIError *err,OCIDateTime *datetime,
+               sb2 yr,ub1 mnth,ub1 dy,ub1 hr,ub1 mm,ub1 ss,ub4 fsec,
+               OraText  *timezone,size_t timezone_length);
+
+sword OCIDateTimeSysTimeStamp(dvoid *hndl, OCIError *err, 
+                              OCIDateTime *sys_date );
+
+sword OCIDateTimeAssign(dvoid *hndl, OCIError *err, CONST OCIDateTime *from, 
+                       OCIDateTime *to);
+
+sword OCIDateTimeToText(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 
+                        CONST OraText *fmt, ub1 fmt_length, ub1 fsprec, 
+                        CONST OraText *lang_name, size_t lang_length, 
+                        ub4 *buf_size, OraText *buf );
+
+sword OCIDateTimeFromText(dvoid *hndl, OCIError *err, CONST OraText *date_str, 
+             size_t dstr_length, CONST OraText *fmt, ub1 fmt_length,
+             CONST OraText *lang_name, size_t lang_length, OCIDateTime *date );
+
+sword OCIDateTimeCompare(dvoid *hndl, OCIError *err, CONST OCIDateTime *date1, 
+                     CONST OCIDateTime *date2,  sword *result );
+
+sword OCIDateTimeCheck(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 
+                 ub4 *valid );
+
+sword OCIDateTimeConvert(dvoid *hndl, OCIError *err, OCIDateTime *indate,
+                                OCIDateTime *outdate);
+
+sword OCIDateTimeSubtract(dvoid *hndl, OCIError *err, OCIDateTime *indate1, 
+                OCIDateTime *indate2,    OCIInterval *inter);
+
+sword OCIDateTimeIntervalAdd(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+         OCIInterval *inter, OCIDateTime *outdatetime);
+
+sword OCIDateTimeIntervalSub(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+         OCIInterval *inter, OCIDateTime *outdatetime);
+
+sword OCIIntervalSubtract(dvoid *hndl, OCIError *err, OCIInterval *minuend, 
+                            OCIInterval *subtrahend, OCIInterval *result );
+
+sword OCIIntervalAdd(dvoid *hndl, OCIError *err, OCIInterval *addend1, 
+                        OCIInterval *addend2, OCIInterval *result );
+
+sword OCIIntervalMultiply(dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+                        OCINumber *nfactor, OCIInterval *result );
+
+sword OCIIntervalDivide(dvoid *hndl, OCIError *err, OCIInterval *dividend, 
+                OCINumber *divisor, OCIInterval *result );
+
+sword OCIIntervalCompare(dvoid *hndl, OCIError *err, OCIInterval *inter1, 
+                        OCIInterval *inter2, sword *result );
+
+sword OCIIntervalFromNumber(dvoid *hndl, OCIError *err, OCIInterval *inter, 
+                        OCINumber *number);
+
+sword OCIIntervalFromText( dvoid *hndl, OCIError *err, CONST OraText *inpstr, 
+                size_t str_len, OCIInterval *result );
+
+sword OCIIntervalToText( dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+                         ub1 lfprec, ub1 fsprec, 
+                        OraText *buffer, size_t buflen, size_t *resultlen );
+
+sword OCIIntervalToNumber(dvoid *hndl, OCIError *err,CONST OCIInterval *inter, 
+                        OCINumber *number);
+
+sword OCIIntervalCheck(dvoid *hndl, OCIError *err, CONST OCIInterval *interval,
+                         ub4 *valid );
+
+sword OCIIntervalAssign(dvoid *hndl, OCIError *err, CONST OCIInterval *ininter,
+                        OCIInterval *outinter );
+
+sword OCIIntervalSetYearMonth(dvoid *hndl, OCIError *err, sb4 yr, sb4 mnth,
+                        OCIInterval *result );
+
+sword OCIIntervalGetYearMonth(dvoid *hndl, OCIError *err, sb4 *yr, sb4 *mnth,
+                        CONST OCIInterval *result );
+
+sword OCIIntervalSetDaySecond(dvoid *hndl, OCIError *err, sb4 dy, sb4 hr,
+                        sb4 mm, sb4 ss, sb4 fsec, OCIInterval *result );
+
+sword OCIIntervalGetDaySecond(dvoid *hndl, OCIError *err, sb4 *dy, sb4 *hr,
+                     sb4 *mm, sb4 *ss, sb4 *fsec, CONST OCIInterval *result );
+
+sword OCIDateTimeToArray(dvoid *hndl, OCIError *err,
+                         CONST OCIDateTime *datetime, CONST OCIInterval *reftz,
+                         ub1 *outarray, ub4 *len, ub1 fsprec);
+
+sword OCIDateTimeFromArray(dvoid *hndl, OCIError *err, ub1 *inarray, ub4 len,
+                           ub1 type, OCIDateTime *datetime,
+                           CONST OCIInterval *reftz, ub1 fsprec);
+
+sword OCIDateTimeGetTimeZoneName(dvoid *hndl, OCIError *err,
+                                 CONST OCIDateTime *datetime, 
+                                 ub1 *buf, ub4 *buflen);
+
+sword OCIIntervalFromTZ(dvoid *hndl, OCIError *err, CONST oratext *inpstring,
+                        size_t str_len, OCIInterval *result);
+
+/*----------------- End Datetime interface Extensions -----------------------*/
+
+/*----------------- Connection Pooling prototypes ---------------------------*/
+sword OCIConnectionPoolCreate(OCIEnv *envhp, OCIError *errhp, OCICPool *poolhp,
+                              OraText **poolName, sb4 *poolNameLen,  
+                              CONST OraText *dblink, sb4 dblinkLen,
+                              ub4 connMin, ub4 connMax, ub4 connIncr,
+                              CONST OraText *poolUserName, sb4 poolUserLen,
+                              CONST OraText *poolPassword, sb4 poolPassLen,
+                              ub4 mode);
+
+sword OCIConnectionPoolDestroy(OCICPool *poolhp,
+                               OCIError *errhp, ub4 mode);
+
+/*----------------- End Connection Pooling prototypes -----------------------*/
+
+/*-------------------- Session Pooling prototypes ---------------------------*/
+
+sword OCISessionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCISPool *spoolhp, 
+                            OraText **poolName, ub4 *poolNameLen, 
+                            CONST OraText *connStr, ub4 connStrLen,
+                            ub4 sessMin, ub4 sessMax, ub4 sessIncr,
+                            OraText *userid, ub4 useridLen,
+                            OraText *password, ub4 passwordLen,
+                            ub4 mode);
+                                                  
+sword OCISessionPoolDestroy (OCISPool *spoolhp,
+                             OCIError *errhp,
+                             ub4 mode);
+                             
+sword OCISessionGet (OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp,
+                     OCIAuthInfo *authhp,
+                     OraText *poolName, ub4 poolName_len, 
+                     CONST OraText *tagInfo, ub4 tagInfo_len,
+                     OraText **retTagInfo, ub4 *retTagInfo_len,
+                     boolean *found, ub4 mode);
+
+sword OCISessionRelease (OCISvcCtx *svchp, OCIError *errhp,
+                         OraText *tag, ub4 tag_len,
+                         ub4 mode);
+
+/*-------------------- End Session Pooling prototypes -----------------------*/
+
+/*-------------------------------- OCIPing ----------------------------------*/
+sword OCIPing (OCISvcCtx *svchp, OCIError *errhp);
+
+
+/*----------------- Kerberos Authentication prototypes ----------------------*/
+
+sword OCIKerbAttrSet(OCISession *trgthndlp, ub4 cred_use, ub1 *ftgt_ticket, 
+                     ub4 ticket_len, ub1 *session_key, ub4 skey_len, 
+                     ub2 ftgt_keytype, ub4 ftgt_ticket_flags, 
+                     sb4 ftgt_auth_time, sb4 ftgt_start_time, 
+                     sb4 ftgt_end_time, sb4 ftgt_renew_time, 
+                     text *ftgt_client_principal, 
+                     ub4 ftgt_client_principal_len, text *ftgt_client_realm,
+                     ub4 ftgt_client_realm_len, OCIError *errhp);
+
+/*------------------- End Kerberos Authentication prototypes ----------------*/
+
+/*---------------------------------------------------------------------------
+                          PRIVATE FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+            /* the following functions are depracated and should not be used */
+#ifdef NEVER
+sword   OCIStmtBindByPos  (OCIStmt *stmtp, OCIBind *bindp, OCIError *errhp,
+                  ub4 position, dvoid *valuep, sb4 value_sz,
+                  ub2 dty, dvoid *indp, ub2 *alenp, ub2 *rcodep,
+                  ub4 maxarr_len, ub4 *curelep, ub4 mode);
+
+
+sword   OCIStmtBindByName  (OCIStmt *stmtp, OCIBind *bindp, OCIError *errhp,
+                  CONST OraText *placeholder, sb4 placeh_len, dvoid *valuep, 
+                  sb4 value_sz, ub2 dty, dvoid *indp, ub2 *alenp, 
+                  ub2 *rcodep, ub4 maxarr_len, ub4 *curelep, ub4 mode);
+
+sword   ocidefn  (OCIStmt *stmtp, OCIDefine *defnp, OCIError *errhp,
+                  ub4 position, dvoid *valuep, sb4 value_sz, ub2 dty,
+                  dvoid *indp, ub2 *rlenp, ub2 *rcodep, ub4 mode);
+#endif /* NEVER */
+
+#endif                                                       /* OCIAP_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/ociapr.h b/src/terralib/drivers/Oracle/OCI/include/ociapr.h
new file mode 100644
index 0000000..147f4dc
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ociapr.h
@@ -0,0 +1,157 @@
+/*
+ * $Header$ 
+ */
+
+/* Copyright (c) 1991, 1996, 1998, 2000 by Oracle Corporation */
+/*
+   NAME
+     ociapr.h
+   MODIFIED   (MM/DD/YY)
+    dsaha      05/19/00 -  Fix lint
+    sgollapu   05/19/98 -  Change text to OraText
+    dchatter   11/10/95 -  add ognfd() - get native fd
+    lchidamb   04/06/95 -  drop maxdsz from obindps/odefinps
+    slari      04/07/95 -  add opinit
+    dchatter   03/08/95 -  osetpi and ogetpi
+    lchidamb   12/09/94 -  add obindps() and odefinps()
+    dchatter   03/06/95 -  merge changes from branch 1.1.720.2
+    dchatter   11/14/94 -  merge changes from branch 1.1.720.1
+    dchatter   02/08/95 -  olog call; drop onblon
+    dchatter   10/31/94 -  new functions for non-blocking oci
+    rkooi2     11/27/92 -  Changing datatypes to agree with ocidef.h 
+    rkooi2     10/26/92 -  More portability mods 
+    rkooi2     10/18/92 -  Changed to agree with oci.c 
+    sjain      03/16/92 -  Creation 
+*/
+/*
+ *  Declare the OCI functions.
+ *  Prototype information is included.
+ *  Use this header for ANSI C compilers.
+ */
+
+#ifndef OCIAPR
+#define OCIAPR
+
+#ifndef ORATYPES
+#include <oratypes.h>
+#endif 
+
+#ifndef OCIDFN
+#include <ocidfn.h>
+#endif 
+
+/*
+ * Oci BIND (Piecewise or with Skips) 
+ */
+sword  obindps(struct cda_def *cursor, ub1 opcode, OraText *sqlvar, 
+	       sb4 sqlvl, ub1 *pvctx, sb4 progvl, 
+	       sword ftype, sword scale,
+	       sb2 *indp, ub2 *alen, ub2 *arcode, 
+	       sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip,
+	       ub4 maxsiz, ub4 *cursiz,
+	       OraText *fmt, sb4 fmtl, sword fmtt);
+sword  obreak(struct cda_def *lda);
+sword  ocan  (struct cda_def *cursor);
+sword  oclose(struct cda_def *cursor);
+sword  ocof  (struct cda_def *lda);
+sword  ocom  (struct cda_def *lda);
+sword  ocon  (struct cda_def *lda);
+
+
+/*
+ * Oci DEFINe (Piecewise or with Skips) 
+ */
+sword  odefinps(struct cda_def *cursor, ub1 opcode, sword pos,ub1 *bufctx,
+		sb4 bufl, sword ftype, sword scale, 
+		sb2 *indp, OraText *fmt, sb4 fmtl, sword fmtt, 
+		ub2 *rlen, ub2 *rcode,
+		sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip);
+sword  odessp(struct cda_def *cursor, OraText *objnam, size_t onlen,
+              ub1 *rsv1, size_t rsv1ln, ub1 *rsv2, size_t rsv2ln,
+              ub2 *ovrld, ub2 *pos, ub2 *level, OraText **argnam,
+              ub2 *arnlen, ub2 *dtype, ub1 *defsup, ub1* mode,
+              ub4 *dtsiz, sb2 *prec, sb2 *scale, ub1 *radix,
+              ub4 *spare, ub4 *arrsiz);
+sword  odescr(struct cda_def *cursor, sword pos, sb4 *dbsize,
+                 sb2 *dbtype, sb1 *cbuf, sb4 *cbufl, sb4 *dsize,
+                 sb2 *prec, sb2 *scale, sb2 *nullok);
+sword  oerhms   (struct cda_def *lda, sb2 rcode, OraText *buf,
+                 sword bufsiz);
+sword  oermsg   (sb2 rcode, OraText *buf);
+sword  oexec    (struct cda_def *cursor);
+sword  oexfet   (struct cda_def *cursor, ub4 nrows,
+                 sword cancel, sword exact);
+sword  oexn     (struct cda_def *cursor, sword iters, sword rowoff);
+sword  ofen     (struct cda_def *cursor, sword nrows);
+sword  ofetch   (struct cda_def *cursor);
+sword  oflng    (struct cda_def *cursor, sword pos, ub1 *buf,
+                 sb4 bufl, sword dtype, ub4 *retl, sb4 offset);
+sword  ogetpi   (struct cda_def *cursor, ub1 *piecep, dvoid **ctxpp, 
+                 ub4 *iterp, ub4 *indexp);
+sword  oopt     (struct cda_def *cursor, sword rbopt, sword waitopt);
+sword  opinit   (ub4 mode);
+sword  olog     (struct cda_def *lda, ub1* hda,
+                 OraText *uid, sword uidl,
+                 OraText *pswd, sword pswdl, 
+                 OraText *conn, sword connl, 
+                 ub4 mode);
+sword  ologof   (struct cda_def *lda);
+sword  oopen    (struct cda_def *cursor, struct cda_def *lda,
+                 OraText *dbn, sword dbnl, sword arsize,
+                 OraText *uid, sword uidl);
+sword  oparse   (struct cda_def *cursor, OraText *sqlstm, sb4 sqllen,
+                 sword defflg, ub4 lngflg);
+sword  orol     (struct cda_def *lda);
+sword  osetpi   (struct cda_def *cursor, ub1 piece, dvoid *bufp, ub4 *lenp);
+
+void sqlld2     (struct cda_def *lda, OraText *cname, sb4 *cnlen);
+void sqllda     (struct cda_def *lda);
+
+/* non-blocking functions */
+sword onbset    (struct cda_def *lda ); 
+sword onbtst    (struct cda_def *lda ); 
+sword onbclr    (struct cda_def *lda ); 
+sword ognfd     (struct cda_def *lda, dvoid *fdp);
+
+
+/* 
+ * OBSOLETE CALLS 
+ */
+
+/* 
+ * OBSOLETE BIND CALLS
+ */
+sword  obndra(struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
+                 ub1 *progv, sword progvl, sword ftype, sword scale,
+                 sb2 *indp, ub2 *alen, ub2 *arcode, ub4 maxsiz,
+                 ub4 *cursiz, OraText *fmt, sword fmtl, sword fmtt);
+sword  obndrn(struct cda_def *cursor, sword sqlvn, ub1 *progv,
+                 sword progvl, sword ftype, sword scale, sb2 *indp,
+                 OraText *fmt, sword fmtl, sword fmtt);
+sword  obndrv(struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
+                 ub1 *progv, sword progvl, sword ftype, sword scale,
+                 sb2 *indp, OraText *fmt, sword fmtl, sword fmtt);
+
+/*
+ * OBSOLETE DEFINE CALLS
+ */
+sword  odefin(struct cda_def *cursor, sword pos, ub1 *buf,
+	      sword bufl, sword ftype, sword scale, sb2 *indp,
+	      OraText *fmt, sword fmtl, sword fmtt, ub2 *rlen, ub2 *rcode);
+
+/* older calls ; preferred equivalent calls above */
+
+sword  oname    (struct cda_def *cursor, sword pos, sb1 *tbuf,
+                 sb2 *tbufl, sb1 *buf, sb2 *bufl);
+sword  orlon    (struct cda_def *lda, ub1 *hda, 
+                 OraText *uid, sword uidl, 
+                 OraText *pswd, sword pswdl, 
+                 sword audit);
+sword  olon     (struct cda_def *lda, OraText *uid, sword uidl,
+                 OraText *pswd, sword pswdl, sword audit);
+sword  osql3    (struct cda_def *cda, OraText *sqlstm, sword sqllen);
+sword  odsc     (struct cda_def *cursor, sword pos, sb2 *dbsize,
+                 sb2 *fsize, sb2 *rcode, sb2 *dtype, sb1 *buf,
+                 sb2 *bufl, sb2 *dsize);
+
+#endif /* OCIAPR */
diff --git a/src/terralib/drivers/Oracle/OCI/include/ocidef.h b/src/terralib/drivers/Oracle/OCI/include/ocidef.h
new file mode 100644
index 0000000..ac467ed
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ocidef.h
@@ -0,0 +1,888 @@
+/*
+ * $Header$ ocidef.h 
+ */
+
+/* Copyright (c) 1981, 2003, Oracle Corporation.  All rights reserved.  */
+/* Copyright (c) 1984, 2003, Oracle Corporation.  All rights reserved.  */
+ 
+/*
+NAME
+  ocidef
+CONTENTS
+  Oracle Call Interface cursor area and LDA definitions
+NOTES
+  none
+OWNER
+  Oates
+DATE
+  09/07/82
+MODIFIED
+    srseshad   03/25/03  - convert oci public api to ansi
+    csteinba   11/05/02  - bug 2521931: redefine OTYACL
+    aahluwal   06/03/02  - bug 2360115
+    bpalaval   02/08/01  - Change text to oratext.
+    chliang    02/01/01  - fix olint error.
+    bpalaval   11/16/00  - Bug 1244685 : Fix ALTER CLUSTER issue..
+    slari      11/08/00  - remove functions duplicated in ociapr.h
+    whe        09/01/99 -  976457:check __cplusplus for C++ code
+    skmishra   04/23/97 -  Provide C++ compatibility
+    lchidamb   06/26/96 -  put upidef.h, riddef.h within #ifndef
+    slari      06/12/96 -  add ocigft_getFcnType
+    dchatter   11/10/95 -  ocignfd - oci get native file descriptor
+    slari      05/11/95 -  change OCIEVDEF/OCIEVTSF to UPIEVDEF/UPIEVTSF
+    dchatter   04/06/95 -  add ifdef flags around OCI_flags
+    lchidamb   04/06/95 -  drop maxdsz from ocibndps/ocidfnps
+    slari      04/07/95 -  rename opinit to ocipin
+    slari      03/13/95 -  thread safety changes
+    dchatter   03/08/95 -  piece definitions OCI_*_PIECE
+    lchidamb   12/06/94 -  add support for binding/defining with skips
+    dchatter   03/06/95 -  merge changes from branch 1.12.720.1
+    dchatter   02/06/95 -  add defines for login mode parameters
+    dchatter   07/06/94 -  Deleting CRSCHK, with refcursor, no way to set this
+    dchatter   06/13/94 -  add a new LDA flag LDANBL
+    rkooi      11/18/92 -  update ocidpr interface 
+    mmoore     10/31/92 -  add ocidpr 
+    gpongrac   11/17/92 -  fix oexfet prototype 
+    sjain      01/03/92 -  Add ocibra 
+    rjenkins   11/04/91 -  adding prototypes for oparse and oexfet 
+    sjain      04/15/91 -         Change ocistf proto 
+    sjain      04/01/91 -         Rearrange oty codes. Add new ones 
+    Jain       12/03/90 - Add #define for new describe call
+    Jain       11/29/90 - Add new function code for the new oci calls
+    Mendels    01/20/89 - fix 19170: make ocitbl CONST_DATA
+    Kabcene    01/27/88 - change interfaces to match V5
+    Navab      12/09/87 - add a parameter to ocierr call
+    Navab      11/30/87 - add ocierr, rename ocioer
+    Navab      10/08/87 - add prototypes for procedure declarations
+    Howard     09/07/87 - endif blah
+    Howard     05/11/87 - Add OTY types
+    Howard     04/27/87 - move ocldef defines here
+    Oates      10/15/85 - Add OCANCEL
+    Oates      09/30/85 - Implement ORA*Net
+    Oates      06/27/85 - Make datatype compatible with upidef.h
+    Andy       05/07/85 - delete CSRFBPIC
+*/
+
+#ifndef UPIDEF 
+#include <upidef.h>
+#endif
+
+#ifndef RIDDEF
+#include <riddef.h>
+#endif
+
+#include <ociapr.h>
+
+#ifndef OCIDEF
+#define OCIDEF
+ 
+ 
+#define CSRCHECK 172                                   /* csrdef is a cursor */
+#define LDACHECK 202                          /* csrdef is a login data area */
+struct csrdef
+{
+   b2      csrrc;                /* return code: v2 codes, v4 codes negative */
+   ub2     csrft;                                           /* function type */
+   ub4     csrrpc;                                   /* rows processed count */
+   ub2     csrpeo;                                     /* parse error offset */
+   ub1     csrfc;                                           /* function code */
+   ub1     csrlfl;                     /* lda flag to indicate type of login */
+   ub2     csrarc;                        /* actual untranslated return code */
+   ub1     csrwrn;                                          /* warning flags */
+   ub1     csrflg;                                           /* error action */
+   word    csrcn;                                           /* cursor number */
+   riddef  csrrid;                                        /* rowid structure */
+   word    csrose;                                /* os dependent error code */
+   ub1     csrchk;                      /* check byte = CSRCHECK - in cursor */
+                                        /* check byte = LDACHECK - in    LDA */
+   struct hstdef *csrhst;                              /* pointer to the hst */
+};
+typedef struct csrdef csrdef;
+typedef struct csrdef ldadef;                    /* lda is the same as a csr */
+ 
+ 
+/* values for csrlfl */
+#define LDAFLG 1                                            /* ...via ologon */
+#define LDAFLO 2                                     /* ...via olon or orlon */
+#define LDANBL 3                                  /* ...nb logon in progress */
+ 
+/* valuses for crsfc */
+#define csrfpa 2                                                  /* ...OSQL */
+#define csrfex 4                                                 /* ...OEXEC */
+#define csrfbi 6                                                 /* ...OBIND */
+#define csrfdb 8                                                /* ...ODFINN */
+#define csrfdi 10                                               /* ...ODSRBN */
+#define csrffe 12                                               /* ...OFETCH */
+#define csrfop 14                                                /* ...OOPEN */
+#define csrfcl 16                                               /* ...OCLOSE */
+#define csrfds 22                                                 /* ...ODSC */
+#define csrfnm 24                                                /* ...ONAME */
+#define csrfp3 26                                                /* ...OSQL3 */
+#define csrfbr 28                                               /* ...OBNDRV */
+#define csrfbx 30                                               /* ...OBNDRN */
+/*#defe csrfdf 32*/                                                  /* ???? */
+#define csrfso 34                                                 /* ...OOPT */
+#define csrfre 36                                               /* ...ORESUM */
+#define csrfbn 50                                               /* ...OBINDN */
+#define csrfca 52                                               /* ..OCANCEL */
+#define csrfsd 54                                                 /* ..OSQLD */
+#define csrfef 56                                                /* ..OEXFEN */
+#define csrfln 58                                                 /* ..OFLNG */
+#define csrfdp 60                                                /* ..ODSCSP */
+#define csrfba 62                                                /* ..OBNDRA */
+#define csrfbps 63                                               /*..OBINDPS */
+#define csrfdps 64                                              /*..ODEFINPS */
+#define csrfgpi 65                                              /* ...OGETPI */
+#define csrfspi 66                                              /* ...OSETPI */
+
+/* values for csrwrn */
+#define CSRWANY  0x01                         /* there is a warning flag set */
+#define CSRWTRUN 0x02                           /* a data item was truncated */
+#define CSRWNVIC 0x04      /* NULL values were used in an aggregate function */
+#define CSRWITCE 0x08           /* column count not equal to into list count */
+#define CSRWUDNW 0x10               /* update or delete without where clause */
+#define CSRWRSV0 0x20
+#define CSRWROLL 0x40                                   /* rollback required */
+#define CSRWRCHG 0x80       /* change after query start on select for update */
+ 
+/* values fro csrflg */
+#define CSRFSPND 0x01                         /* current operation suspended */
+#define CSRFATAL 0x02            /* fatal operation: transaction rolled back */
+#define CSRFBROW 0x04                              /* current row backed out */
+#define CSRFREFC 0x08     /* ref cursor type CRSCHK disabled for this cursor */
+#define CSRFNOAR 0x10     /* ref cursor type binds, so no array bind/execute */
+ 
+/* define function codes; in order of octdef.h */
+#define OTYCTB 1                                             /* CREATE TABLE */
+#define OTYSER 2                                                 /* set role */
+#define OTYINS 3                                                   /* INSERT */
+#define OTYSEL 4                                                   /* SELECT */
+#define OTYUPD 5                                                   /* UPDATE */
+#define OTYDRO 6                                                /* drop role */
+#define OTYDVW 7                                                /* DROP VIEW */
+                                                  /* once was validate index */
+                                                /* once was create partition */
+                                                 /* once was alter partition */
+#define OTYDTB 8                                               /* DROP TABLE */
+                                                     /* once was alter space */
+                                                      /* once was drop space */
+#define OTYDEL 9                                                   /* DELETE */
+#define OTYCVW 10                                             /* create view */
+#define OTYDUS 11                                               /* drop user */
+#define OTYCRO 12                                             /* create role */
+#define OTYCSQ 13                                         /* create sequence */
+#define OTYASQ 14                                          /* alter sequence */
+#define OTYACL 15                                           /* alter cluster */
+#define OTYDSQ 16                                           /* drop sequence */
+#define OTYCSC 17                                           /* create schema */
+#define OTYCCL 18                                          /* CREATE CLUSTER */
+                                                   /* once was alter cluster */
+#define OTYCUS 19                                             /* create user */
+#define OTYCIX 20                                            /* CREATE INDEX */
+#define OTYDIX 21                                              /* DROP INDEX */
+#define OTYDCL 22                                            /* DROP CLUSTER */
+#define OTYVIX 23                                          /* validate index */
+#define OTYCPR 24                                        /* create procedure */
+#define OTYAPR 25                                         /* alter procedure */
+#define OTYATB 26                                             /* alter table */
+                                                        /* once was evaluate */
+#define OTYXPL 27                                                 /* explain */
+#define OTYGRA 28                                                   /* grant */
+#define OTYREV 29                                                  /* revoke */
+#define OTYCSY 30                                          /* create synonym */
+#define OTYDSY 31                                            /* drop synonym */
+#define OTYASY 32                                 /* alter system switch log */
+#define OTYSET 33                                         /* set transaction */
+#define OTYPLS 34                                          /* pl/sql execute */
+#define OTYLTB 35                                                    /* lock */
+#define OTYNOP 36                                                    /* noop */
+#define OTYRNM 37                                                  /* rename */
+#define OTYCMT 38                                                 /* comment */
+#define OTYAUD 39                                                   /* audit */
+#define OTYNOA 40                                                /* no audit */
+#define OTYAIX 41                                             /* ALTER INDEX */
+#define OTYCED 42                                /* create external database */
+#define OTYDED 43                                  /* drop external database */
+#define OTYCDB 44                                         /* create database */
+#define OTYADB 45                                          /* alter database */
+#define OTYCRS 46                                 /* create rollback segment */
+#define OTYARS 47                                  /* alter rollback segment */
+#define OTYDRS 48                                   /* drop rollback segment */
+#define OTYCTS 49                                       /* create tablespace */
+#define OTYATS 50                                        /* alter tablespace */
+#define OTYDTS 51                                         /* drop tablespace */
+#define OTYASE 52                                           /* alter session */
+#define OTYAUR 53                                              /* alter user */
+#define OTYCWK 54                                           /* commit (work) */
+#define OTYROL 55                                                /* rollback */
+#define OTYSPT 56                                               /* savepoint */
+ 
+/* For number greater than 56 the the type is the same as defined in 
+** octdef.h for that number. So for completion look at octdef.h 
+*/
+
+#define OTYDEV OTYCVW                       /* old DEFINE VIEW = create view */
+ 
+/* FUNCTION CODES */
+#define OCLFPA  2                                            /* parse - OSQL */
+#define OCLFEX  4                                         /* execute - OEXEC */
+#define OCLFBI  6                                    /* BIND by name - OBIND */
+#define OCLFDB  8                                 /* define buffer -  ODEFIN */
+#define OCLFDI  10                                   /* describe item - ODSC */
+#define OCLFFE  12                                         /* fetch - OFETCH */
+#define OCLFOC  14                                    /* open cursor - OOPEN */
+#       define OCLFLI  OCLFOC            /* old name for open cursor - OOPEN */
+#define OCLFCC  16                                  /* close cursor - OCLOSE */
+#       define OCLFLO  OCLFCC          /* old name for close cursor - OCLOSE */
+#define OCLFDS  22                                        /* describe - ODSC */
+#define OCLFON  24                     /* get table and column names - ONAME */
+#define OCLFP3  26                                          /* parse - OSQL3 */
+#define OCLFBR  28                        /* bind reference by name - OBNDRV */
+#define OCLFBX  30                        /* bind referecne numeric - OBNDRN */
+#define OCLFSO  34                                /* special function - OOPT */
+#define OCLFRE  36                                        /* resume - ORESUM */
+#define OCLFBN  50                                                  /* bindn */
+#define OCLFMX  52                                /* maximum function number */
+
+#ifdef NEVER                                                 /* unused codes */
+# define OCLFLK  18                           /* open  for kernel operations */
+# define OCLFEK  20                             /* execute kernel operations */
+# define OCLFOK  22                                          /* kernel close */
+# define OCLFIN  28                                       /* logon to oracle */
+# define OCLFOF  30                                    /* logoff from oracle */
+# define OCLFAX  32                               /* allocate a context area */
+# define OCLFPI  34                                  /* page in context area */
+# define OCLFIS  36                                  /* special system logon */
+# define OCLFCO  38                          /* cancel the current operation */
+# define OCLFGI  40                                       /* get database id */
+# define OCLFJN  42                                     /* journal operation */
+# define OCLFCL  44                       /* cleanup prior execute operation */
+# define OCLFMC  46                                     /* map a cursor area */
+# define OCLFUC  48                  /* unmap cursor and restore user maping */
+#endif /*NEVER                                           *//* obsolete codes */
+ 
+
+/* values for ocimode in ocipin call */
+
+#define OCIEVDEF UPIEVDEF           /* default : non-thread safe enivronment */
+#define OCIEVTSF UPIEVTSF                         /* thread-safe environment */
+
+
+/* OCIL* flags used to determine the mode of login, using ocilog().
+** Currently defined only for non-blocking and thread-safe logins.
+*/
+
+#define OCILMDEF        UPILMDEF                   /* default, regular login */
+#define OCILMNBL        UPILMNBL                       /* non-blocking logon */
+#define OCILMESY        UPILMESY            /* thread safe but external sync */
+#define OCILMISY        UPILMISY                  /* internal sync, we do it */
+#define OCILMTRY        UPILMTRY        /* try to, but do not block on mutex */
+
+
+/* 
+ * since sqllib uses both ocidef and ocidfn the following defines
+ * need to be guarded
+ */
+#ifndef OCI_FLAGS 
+#define OCI_FLAGS
+
+/* OCI_*_PIECE defines the piece types that are returned or set
+*/
+
+#define OCI_ONE_PIECE   UPI_ONE_PIECE     /* there or this is the only piece */
+#define OCI_FIRST_PIECE UPI_FIRST_PIECE          /* the first of many pieces */
+#define OCI_NEXT_PIECE  UPI_NEXT_PIECE            /* the next of many pieces */
+#define OCI_LAST_PIECE  UPI_LAST_PIECE      /* the last piece of this column */
+#endif
+
+/*
+**  OCITAB: define return code pairs for version 2 to 3 conversions
+*/
+struct  ocitab
+{
+   b2   ocitv3;                                   /* Version 3/4 return code */
+   b2   ocitv2;                          /* Version 2 equivalent return code */
+};
+typedef struct ocitab ocitab;
+ 
+externref CONST_DATA ocitab ocitbl[];
+ 
+/* macros to check cursors and LDA's.  */
+/* macros to set error codes           */
+
+# define CRSCHK(c)     if ((c->csrchk != CSRCHECK)\
+                            && !bit(c->csrflg, CSRFREFC))\
+                          return(ocir32(c, OER(1001)))
+# define ldaerr(l, e)  ( l->csrrc = (b2)(-( l->csrarc = (ub2)(e)) ) )
+# define LDACHK(l)     if (l->csrchk != LDACHECK) \
+                          return(ldaerr(l, OER(1001)))
+ 
+
+/************************************************/
+/*         OCI PROCEDURE DECLARATIONS           */
+/************************************************/ 
+
+
+
+
+/*****************************/
+/*  Database logon/logout    */
+/*****************************/
+sword ocilog( /*_ ldadef *lda, struct hstdef *hst, oratext *uid, sword uidl, 
+                  oratext *psw, sword pswl, oratext* conn, sword connl,
+                  ub4 mode _*/);
+sword ocilon( /*_ ldadef *lda, oratext *uid, word uidl, oratext *psw, 
+                  word pswl, word audit _*/);
+sword  ocilgi( /*_ ldadef *lda, b2 areacount _*/ );
+sword ocirlo( /*_ ldadef *lda, struct hstdef *hst, oratext *uid, word uidl,
+            oratext *psw, word pswl, word audit _*/ );
+     /* ocilon - logon to oracle
+     ** ocilgi - version 2 compatible ORACLE logon call.
+     **          no login to ORACLE is performed: the LDA is initialized
+     ** ocirlo - version 5 compatible ORACLE Remote Login call,
+     **          oracle login is executed.
+     **   lda     - pointer to ldadef
+     **   uid     - user id [USER[/PASSWORD]]
+     **   uidl    - length of uid, if -1 strlen(uid) is used
+     **   psw     - password string; ignored if specified in uid
+     **   pswl    - length of psw, if -1 strlen(psw) is used
+     **   audit   - is not supported; the only permissible value is 0
+     **   areacount - unused
+     */
+
+sword ocilof( /*_ ldadef *lda _*/ );
+     /*
+     ** ocilof - disconnect from ORACLE
+     **   lda     - pointer to ldadef
+     */
+
+
+/*********************/
+/*   Error Messages  */
+/*********************/
+sword ocierr( /*_ ldadef *lda, b2 rcode, oratext *buffer, word bufl _*/ );
+sword ocidhe( /*_ b2 rcode, oratext *buffer _*/ );
+    /* 
+    ** Move the text explanation for an ORACLE error to a user defined buffer
+    **  ocierr - will return the message associated with the hstdef stored 
+    **           in the lda.
+    **  ocidhe - will return the message associated with the default host.
+    **    lda    - lda associated with the login session
+    **    rcode  - error code as returned by V3 call interface
+    **    buffer - address of a user buffer of at least 132 characters
+    */
+
+
+/***********************/
+/*  Cursor Open/Close  */
+/***********************/
+sword ociope( /*_ struct csrdef *cursor, ldadef *lda, oratext *dbn, word dbnl, 
+                 word areasize, oratext *uid, word uidl _*/ );
+
+sword ociclo( /*_ struct csrdef *cursor _*/ );
+   /* 
+   ** open or close a cursor.
+   **   cursor - pointer to csrdef
+   **   ldadef - pointer to ldadef
+   **   dbn    - unused
+   **   dbnl   - unused
+   **   areasize - if (areasize == -1)  areasize <- system default initial size
+   **              else if (areasize IN [1..256]) areasize <- areasize * 1024;
+   **              most applications should use the default size since context
+   **              areas are extended as needed until memory is exhausted.
+   **   uid    - user id
+   **   uidl   - userid length
+   */
+
+/***********************************/
+/*      CONTROL AND OPTIONS        */
+/***********************************/
+sword ocibre( /*_ ldadef *lda _*/ );
+   /*
+   **  ocibrk - Oracle Call Interface send BReaK Sends a break to
+   **  oracle.  If oracle is  active,  the  current  operation  is
+   **  cancelled.  May be called  asynchronously.   DOES  NOT  SET
+   **  OERRCD in the hst.  This is because ocibrk  may  be  called
+   **  asynchronously.  Callers must test the return code.
+   **    lda  - pointer to a ldadef 
+   */
+
+sword ocican( /*_ struct csrdef *cursor _*/ );
+   /*
+   **  cancel the operation on the cursor, no additional OFETCH calls
+   **  will be issued for the existing cursor without an intervening 
+   **  OEXEC call.
+   **   cursor  - pointer to csrdef
+   */
+
+sword ocisfe( /*_ struct csrdef *cursor, word erropt, word waitopt _*/ );
+   /* 
+   ** ocisfe - user interface set error options
+   ** set the error and cursor options.
+   ** allows user to set the options for dealing with fatal dml errors
+   ** and other cursor related options
+   ** see oerdef for valid settings
+   **   cursor  - pointer to csrdef
+   **   erropt  - error optionsn
+   **   waitopr - wait options
+   */
+
+
+/***************************************/
+/* COMMIT/ROLLBACK/AUTOCOMMIT          */
+/***************************************/
+sword   ocicom( /*_ ldadef *lda _*/ );
+sword   ocirol( /*_ ldadef *lda _*/ );
+   /*
+   ** ocicom - commit the current transaction
+   ** ocirol - roll back the current transaction
+   */
+ 
+sword   ocicon( /*_ ldadef *lda _*/ );
+sword   ocicof( /*_ ldadef *lda _*/ );
+   /*
+   ** ocicon - auto Commit ON
+   ** ocicof - auto Commit OFf
+   */
+
+
+ 
+/************************/
+/*     parsing          */
+/************************/
+sword    ocisq3( /*_ struct csrdef *cursor, oratext *sqlstm, word sqllen _*/ );
+   /*
+   ** ocisq3 - user interface parse sql statement
+   **   cursor - pointer to csrdef
+   **   sqlstm - pointer to SQL statement
+   **   sqllen - length of SQL statement.  if -1, strlen(sqlstm) is used
+   */
+
+
+
+/***************************/
+/*      BINDING            */
+/***************************/
+/* these are for the opcode in ocibndps, ocidfnps */
+#define OCI_PCWS 0
+#define OCI_SKIP 1
+
+sword ocibin( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl, 
+                  ub1 *progv, word progvl, word ftype, word scale, 
+                  oratext *fmt, word fmtl, word fmtt _*/ );
+sword  ocibrv( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl, 
+                   ub1 *progv, word progvl, word ftype, word scale, b2 *indp,
+                   oratext *fmt, word fmtl, word fmtt _*/ );
+sword  ocibra( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl, 
+                   ub1 *progv, word progvl, word ftype, word scale, 
+                   b2 *indp, ub2 *aln, ub2 *rcp, ub4 mal, ub4 *cal, 
+                   oratext *fmt, word fmtl, word fmtt _*/ );
+sword  ocibndps( /*_ struct csrdef *cursor, ub1 opcode, oratext *sqlvar, 
+                     sb4 sqlvl, ub1 *progv, sb4 progvl, word ftype, 
+                     word scale, b2 *indp, ub2 *aln, ub2 *rcp, sb4 pv_skip, 
+                     sb4 ind_skip, sb4 len_skip, sb4 rc_skip, ub4 mal, 
+                     ub4 *cal, oratext *fmt, sb4 fmtl, word fmtt _*/ );
+sword ocibnn ( /*_ struct csrdef *cursor, ub2 sqlvn, ub1 *progv, word progvl,
+                   word ftype, word scale, oratext *fmt, word fmtl, 
+                   word fmtt _*/ );
+sword  ocibrn( /*_ struct csrdef *cursor, word sqlvn, ub1 *progv, word progvl,
+                  word ftype, word scale, b2 *indp, oratext *fmt, word fmtl, 
+                  word fmtt _*/ );
+    /*
+    ** ocibin - bind by value by name
+    ** ocibrv - bind by reference by name
+    ** ocibra - bind by reference by name (array)
+    ** ocibndps - bind by reference by name (array) piecewise or with skips
+    ** ocibnn - bind by value numeric
+    ** ocibrn - bind by reference numeric
+    **
+    ** the contents of storage specified in bind-by-value calls are
+    ** evaluated immediately.
+    ** the addresses of storage specified in bind-by-reference calls are
+    ** remembered, and the contents are examined at every execute.
+    **
+    **  cursor  - pointer to csrdef
+    **  sqlvn   - the number represented by the name of the bind variables
+    **            for variables of the form :n or &n for n in [1..256)
+    **            (i.e. &1, :234).  unnecessarily using larger numbers
+    **            in the range wastes space.
+    **  sqlvar  - the name of the bind variable (:name or &name)
+    **  sqlval  - the length of the name;
+    **            in bindif -1, strlen(bvname) is used
+    **  progv   - pointer to the object to bind.
+    **  progvl  - length of object to bind.
+    **            in bind-by-value if specified as -1 then strlen(bfa) is
+    **              used (really only makes sends with character types)
+    **            in bind-by-value, if specified as -1 then UB2MAXVAL
+    **              is used.  Again this really makes sense only with
+    **              SQLT_STR.
+    **  ftype   - datatype of object
+    **  indp    - pointer to indicator variable.
+    **              -1     means to ignore bfa/bfl and bind NULL;
+    **              not -1 means to bind the contents of bfa/bfl
+    **              bind the contents pointed to by bfa
+    **  aln     - Alternate length pointer
+    **  rcp     - Return code pointer
+    **  mal     - Maximum array length
+    **  cal     - Current array length pointer
+    **  fmt     - format string
+    **  fmtl    - length of format string; if -1, strlen(fmt) is used
+    **  fmtt    - desired output type after applying forat mask. Not
+    **            really yet implemented
+    **  scale   - number of decimal digits in a cobol packed decimal (type 7)
+    **
+    ** Note that the length of bfa when bound as SQLT_STR is reduced
+    ** to strlen(bfa).
+    ** Note that trailing blanks are stripped of storage of SQLT_STR.
+    */
+    
+/***************************/
+/*        DESCRIBING       */
+/***************************/
+sword ocidsc ( /*_ struct csrdef *cursor, word pos, b2 *dbsize, b2 *fsize,
+             b2 *rcode, b2 *dtype, b1 *buf, b2 *bufl, b2 *dsize _*/ );
+sword ocidsr( /*_ struct csrdef *cursor, word pos, b2 *dbsize, b2 *dtype, 
+            b2 *fsize _*/ );
+sword   ocinam( /*_ struct csrdef *cursor, word pos, b1 *tbuf, b2 *tbufl,
+                b1 *buf, b2 *bufl _*/);
+    /*
+    **  ocidsc, ocidsr: Obtain information about a column
+    **  ocinam : get the name of a column
+    **   cursor  - pointer to csrdef
+    **   pos     - position in select list from [1..N]
+    **   dbsize  - place to store the database size
+    **   fsize   - place to store the fetched size
+    **   rcode   - place to store the fetched column returned code
+    **   dtype   - place to store the data type
+    **   buf     - array to store the column name
+    **   bufl    - place to store the column name length
+    **   dsize   - maximum display size
+    **   tbuf    - place to store the table name
+    **   tbufl   - place to store the table name length
+    */
+
+sword ocidsp ( /*_ struct csrdef *cursor, word pos, sb4 *dbsize, sb2 *dbtype,
+                   sb1 *cbuf, sb4 *cbufl, sb4 *dsize, sb2 *pre, sb2 *scl,
+                   sb2 *nul _*/);
+
+sword ocidpr(/*_ ldadef *lda, oratext *object_name, size_t object_length,
+                ptr_t reserved1, size_t reserved1_length, ptr_t reserved2,
+                size_t reserved2_length, ub2 *overload, ub2 *position,
+                ub2 *level, oratext **argument_name, ub2 *argument_length, 
+                ub2 *datatype, ub1 *default_supplied, ub1 *in_out, 
+                ub4 *length, sb2 *precision, sb2 *scale, ub1 *radix, 
+                ub4 *spare, ub4 *total_elements _*/);
+   /*
+   ** OCIDPR - User Program Interface: Describe Stored Procedure
+   **
+   ** This routine is used to obtain information about the calling
+   ** arguments of a stored procedure.  The client provides the 
+   ** name of the procedure using "object_name" and "database_name"
+   ** (database name is optional).  The client also supplies the 
+   ** arrays for OCIDPR to return the values and indicates the 
+   ** length of array via the "total_elements" parameter.  Upon return
+   ** the number of elements used in the arrays is returned in the 
+   ** "total_elements" parameter.  If the array is too small then 
+   ** an error will be returned and the contents of the return arrays 
+   ** are invalid.
+   **
+   **
+   **   EXAMPLE :
+   **
+   **   Client provides -
+   **
+   **   object_name    - SCOTT.ACCOUNT_UPDATE at BOSTON
+   **   total_elements - 100
+   **   
+   **
+   **   ACCOUNT_UPDATE is an overloaded function with specification :
+   **
+   **     type number_table is table of number index by binary_integer;
+   **     table account (account_no number, person_id number,
+   **                    balance number(7,2))
+   **     table person  (person_id number(4), person_nm varchar2(10))
+   **
+   **      function ACCOUNT_UPDATE (account number, 
+   **         person person%rowtype, amounts number_table,
+   **         trans_date date) return accounts.balance%type;
+   **
+   **      function ACCOUNT_UPDATE (account number, 
+   **         person person%rowtype, amounts number_table,
+   **         trans_no number) return accounts.balance%type;
+   **
+   **
+   **   Values returned -
+   **
+   **   overload position   argument  level  datatype length prec scale rad
+   **   -------------------------------------------------------------------
+   **          0        0                0   NUMBER     22    7     2   10
+   **          0        1   ACCOUNT      0   NUMBER     22    0     0    0
+   **          0        2   PERSON       0   RECORD      0    0     0    0
+   **          0        2     PERSON_ID  1   NUMBER     22    4     0   10
+   **          0        2     PERSON_NM  1   VARCHAR2   10    0     0    0
+   **          0        3   AMOUNTS      0   TABLE       0    0     0    0
+   **          0        3                1   NUMBER     22    0     0    0
+   **          0        4   TRANS_NO     0   NUMBER     22    0     0    0
+   **
+   **          1        0                0   NUMBER     22    7     2   10
+   **          1        1   ACCOUNT      0   NUMBER     22    0     0    0
+   **          1        2   PERSON       0   RECORD      0    0     0    0
+   **          1        2    PERSON_ID   1   NUMBER     22    4     0   10
+   **          1        2    PERSON_NM   1   VARCHAR2   10    0     0    0
+   **          1        3   AMOUNTS      0   TABLE       0    0     0    0
+   **          1        3                1   NUMBER     22    0     0    0
+   **          1        4   TRANS_DATE   0   NUMBER     22    0     0    0
+   **
+   **
+   **  OCIDPR Argument Descriptions -
+   **
+   **  ldadef           - pointer to ldadef
+   **  object_name      - object name, synonyms are also accepted and will 
+   **                     be translate, currently only procedure and function
+   **                     names are accepted, also NLS names are accepted.
+   **                     Currently, the accepted format of a name is 
+   **                     [[part1.]part2.]part3[@dblink] (required)
+   **  object_length    - object name length (required)
+   **  reserved1        - reserved for future use
+   **  reserved1_length - reserved for future use
+   **  reserved2        - reserved for future use
+   **  reserved2_length - reserved for future use
+   **  overload         - array indicating overloaded procedure # (returned)
+   **  position         - array of argument positions, position 0 is a 
+   **                     function return argument (returned)
+   **  level            - array of argument type levels, used to describe
+   **                     sub-datatypes of data structures like records
+   **                     and arrays (returned)
+   **  argument_name    - array of argument names, only returns first 
+   **                     30 characters of argument names, note storage
+   **                     for 30 characters is allocated by client (returned)
+   **  argument_length  - array of argument name lengths (returned)
+   **  datatype         - array of oracle datatypes (returned)
+   **  default_supplied - array indicating parameter has default (returned)
+   **                     0 = no default, 1 = default supplied
+   **  in_out           - array indicating if argument is IN or OUT (returned
+   **                     0 = IN param, 1 = OUT param, 2 = IN/OUT param
+   **  length           - array of argument lengths (returned)
+   **  precision        - array of precisions (if number type)(returned)
+   **  scale            - array of scales (if number type)(returned)
+   **  radix            - array of radix (if number type)(returned)
+   **  spare            - array of spares.
+   **  total_elements   - size of arrays supplied by client (required),
+   **                     total number of elements filled (returned)
+   */
+
+/*************************************/
+/* DEFINING                          */
+/*************************************/
+sword ocidfi( /*_ struct csrdef *cursor, word pos, ub1 *buf, word bufl,
+                  word ftype, b2 *rc, word scale _*/ );
+sword ocidfn( /*_ struct csrdef *cursor, word pos, ub1 *buf, word bufl,
+                 word ftype, word scale, b2 *indp, oratext *fmt, word fmtl,
+                 word fmtt, ub2 *rl, ub2 *rc _*/ );
+sword ocidfnps( /*_ struct csrdef *cursor, ub1 opcode, word pos, ub1 *buf, 
+                    sb4 bufl, word ftype, word scale,  
+                    b2 *indp, oratext *fmt, sb4 fmtl,
+                    word fmtt, ub2 *rl, ub2 *rc,
+                    sb4 pv_skip, sb4 ind_skip, sb4 len_skip, 
+                    sb4 rc_skip _*/ );
+
+
+   /*  Define a user data buffer using upidfn
+   **   cursor  - pointer to csrdef
+   **   pos     - position of a field or exp in the select list of a query
+   **   bfa/bfl - address and length of client-supplied storage
+                  to receive data
+   **   ftype   - user datatype
+   **   scale   - number of fractional digits for cobol packed decimals
+   **   indp    - place to store the length of the returned value. If returned
+   **             value is:
+   **             negative, the field fetched was NULL
+   **             zero    , the field fetched was same length or shorter than
+   **               the buffer provided
+   **             positive, the field fetched was truncated
+   **   fmt    - format string
+   **   fmtl   - length of format string, if -1 strlent(fmt) used
+   **   rl     - place to store column length after each fetch
+   **   rc     - place to store column error code after each fetch
+   **   fmtt   - fomat type
+   */
+ 
+/********************************/
+/*    PIECE INFORMATION GET/SET */
+/********************************/
+sword           ocigetpi( /*_ struct csrdef *cursor, ub1 *piecep,
+                              dvoid **ctxpp, ub4 *iterp, ub4 *indexp _*/ );
+sword           ocisetpi( /*_ struct csrdef *cursor, ub1 piece,
+                              dvoid *bufp, ub4 *lenp _*/ );
+
+
+/********************************/
+/*   EXECUTE                    */
+/********************************/
+sword ociexe( /*_ struct csrdef *cursor _*/ );
+sword ociexn( /*_ struct csrdef *cursor, word iters, word roff _*/ );
+sword ociefn( /*_ struct csrdef *cursor, ub4 nrows, word can, word exact _*/);
+    /* 
+    ** ociexe  - execute a cursor
+    ** ociexn  - execute a cursosr N times
+    **  cursor   - pointer to a csrdef
+    **  iters    - number of times to execute cursor
+    **  roff     - offset within the bind variable array at which to begin 
+    **             operations.
+    */
+
+
+/*********************************/
+/*     FETCHING                  */
+/*********************************/
+sword ocifet( /*_ struct csrdef *cursor _*/ );
+sword ocifen( /*_ struct csrdef *cursor, word nrows _*/ );
+    /* ocifet - fetch the next row
+    ** ocifen - fetch n rows 
+    ** cursor   - pointer to csrdef
+    ** nrows    - number of rows to be fetched
+    */
+
+sword ocilng(/*_ struct csrdef *cursor, word posit, ub1 *bfa, sb4 bfl,
+                 word dty, ub4 *rln, sb4 off _*/);
+
+/*********************************/
+/*         CONVERSION            */
+/*********************************/
+sword ocic32( /*_ struct csrdef *cursor _*/ );
+    /*
+    **   Convert selected version 3 return codes to the equivalent
+    **   version 2 code.
+    **   csrdef->csrrc is set to the converted code
+    **   csrdef->csrft is set to v2 oracle statment type
+    **   csrdef->csrrpc is set to the rows processed count
+    **   csrdef->csrpeo is set to error postion
+    ** 
+    **     cursor - pointer to csrdef
+    */
+
+
+sword ocir32( /*_ struct csrdef *cursor, word retcode _*/ );
+   /*   
+   ** Convert selected version 3 return codes to the equivalent version 2 
+   ** code.
+   **
+   **    cursor - pointer to csrdef
+   **    retcode - place to store the return code
+   */
+
+
+VOID ociscn( /*_ word **arglst, char *mask_addr, word **newlst _*/ );
+   /*
+   ** Convert call-by-ref to call-by-value:
+   ** takes an arg list and a mask address, determines which args need 
+   ** conversion to a value, and creates a new list begging at the address
+   ** of newlst.
+   **
+   **    arglst    - list of arguments
+   **    mast_addr _ mask address determines args needing conversion
+   **    newlst    - new list of args
+   */
+
+word     ocistf ( /*_ word typ, word bufl, word rdig, oratext *fmt, 
+                      struct csrdef *cursor, sword *err _*/ );
+/*  Convert a packed  decimal buffer  length  (bytes) and scale to a format
+**  string of the form mm.+/-nn, where  mm is the number of packed 
+**  decimal digits, and nn is the scaling factor.   A positive scale name 
+**  nn digits to the rights of the decimal; a negative scale means nn zeros 
+**  should be supplied to the left of the decimal.
+**     bufl   - length of the packed decimal buffer
+**     rdig   - number of fractional digits
+**     fmt    - pointer to a string holding the conversion format
+**     cursor - pointer to csrdef 
+**     err    - pointer to word storing error code
+*/ 
+
+
+/******************************************/
+/*         Non-blocking operations        */
+/******************************************/
+sword ocinbs( /*_ ldadef *lda _*/ );  /* set a connection to non-blocking   */
+sword ocinbt( /*_ ldadef *lda _*/ );  /* test if connection is non-blocking */
+sword ocinbc( /*_ ldadef *lda _*/ );  /* clear a connection to blocking     */
+sword ocinlo( /*_ ldadef *lda, struct hstdef *hst, oratext *conn,
+                  sword connl, oratext *uid, sword uidl,
+                  oratext *psw, sword pswl, sword audit _*/ );  
+              /* logon in non-blocking fashion */
+/* ocinlo allows an application to logon in non-blocking fashion.
+**   lda     - pointer to ldadef
+**   hst     - pointer to a 256 byte area, must be cleared to zero before call
+**   conn    - the database link (if specified @LINK in uid will be ignored)
+**   connl   - length of conn; if -1 strlen(conn) is used   
+**   uid     - user id [USER[/PASSWORD][@LINK]]
+**   uidl    - length of uid, if -1 strlen(uid) is used
+**   psw     - password string; ignored if specified in uid
+**   pswl    - length of psw, if -1 strlen(psw) is used
+**   audit   - is not supported; the only permissible value is 0
+*/
+
+/***************************************************/
+/*         Procedure Declaration for Pro*C         */
+/***************************************************/
+/* Note: The following routines are used in Pro*C and have the
+   same interface as their couterpart in OCI. 
+   Althought the interface follows for more details please refer 
+   to the above routines */
+
+/******************************************/
+/*         initialization/logon/logof     */
+/******************************************/
+sword ocipin( /*_ ub4 mode _*/ );
+
+sword ologin( /*_ ldadef *lda, b2 areacount _*/ );
+sword ologon( /*_ ldadef *lda, b2 areacount _*/ );
+
+/*****************************************/
+/*        Open/Close/Parse Cursor        */
+/*****************************************/
+
+/* 
+** ocisqd - oci delayed parse (Should be used only with deferred upi/oci)
+** FUNCTION: Call upidpr to delay the parse of the sql statement till the
+**           time that a call needs to be made to the kernel (execution or
+**           describe time )
+** RETURNS: Oracle return code.
+*/ 
+sword ocisq7(/*_ struct csrdef *cursor, oratext *sqlstm, sb4 sqllen,
+                 word defflg, ub4 sqlt _*/);
+
+/*****************************************/
+/*            Bind                       */
+/*****************************************/
+sword obind( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl, 
+                 ub1 *progv, word progvl, word ftype, word scale, 
+                 oratext *fmt, word fmtl, word fmtt _*/ );
+sword obindn( /*_ struct csrdef *cursor, ub2 sqlvn, ub1 *progv, word progvl,
+                  word ftype, word scale, oratext *fmt, word fmtl, 
+                  word fmtt _*/ );
+
+/**********************************************/
+/*                 Define                     */
+/**********************************************/
+sword odfinn( /*_ struct csrdef *cursor, word pos, ub1 *buf, word bufl,
+                  word ftype, b2 *rc, word scale _*/ );
+
+/**********************************************/
+/*                 Describe                   */
+/**********************************************/
+sword odsrbn( /*_ struct csrdef *cursor, word pos, b2 *dbsize, b2 *dtype, 
+            b2 *fsize _*/ );
+
+
+/******************************************/
+/*         Non-blocking operations        */
+/******************************************/
+sword onblon( /*_ ldadef *lda, struct hstdef *hst, oratext *conn,
+                  sword connl, oratext *uid, sword uidl,
+                  oratext *psw, sword pswl, sword audit _*/ );  
+              /* logon in non-blocking fashion */
+sword ocignfd( /*_ ldadef *lda, dvoid *nfdp _*/);           /* get native fd */
+
+ub2   ocigft_getFcnType( /*_ ub2 oertyp _*/ );      /* get sql function code */
+
+#endif
diff --git a/src/terralib/drivers/Oracle/OCI/include/ocidem.h b/src/terralib/drivers/Oracle/OCI/include/ocidem.h
new file mode 100644
index 0000000..9122360
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ocidem.h
@@ -0,0 +1,112 @@
+/*
+ * $Header$ 
+ */
+
+/* Copyright (c) 1991, 1996, 1997, 1999 by Oracle Corporation */
+/* Copyright (c) 1991, 1997, 1999 by Oracle Corporation */
+/*
+   NAME
+     ocidem.h - OCI demo header
+   MODIFIED   (MM/DD/YY)
+    whe        04/07/99 -  bug#810071
+    whe        03/19/99 -  lrg 32079 etc.: putting static back for oci_func_tab
+    nmacnaug   02/02/99 -  static declarations should not be in header files
+    mygopala   09/22/97 -  Fix for bug 550351
+    surman     03/14/97 -  Merge 413362 to 8.0.3
+    surman     11/08/96 -  413362: Add SS_64BIT_SERVER macro
+    emendez    04/07/94 -  merge changes from branch 1.6.710.1
+    emendez    02/02/94 -  Fix for bug 157576
+    jnlee      01/05/93 -  include oratypes.h once, make oci_func_tab static
+    rkooi2     10/26/92 -  More portability mods 
+    rkooi2     10/22/92 -  Change text back to char to avoid casts 
+    rkooi2     10/20/92 -  Changes to make it portable 
+    sjain      03/16/92 -  Creation 
+*/
+
+/*
+ *  ocidem.h
+ *
+ *  Declares additional functions and data structures
+ *  used in the OCI C sample programs.
+ */
+
+
+#ifndef ORATYPES
+#include <oratypes.h>
+#endif /* ORATYPES */
+
+#ifndef OCIDFN
+#include <ocidfn.h>
+#endif /* OCIDFN */
+
+#ifndef OCIDEM
+#define OCIDEM
+
+
+/*  internal/external datatype codes */
+#define VARCHAR2_TYPE            1
+#define NUMBER_TYPE              2
+#define INT_TYPE		 3
+#define FLOAT_TYPE               4
+#define STRING_TYPE              5
+#define ROWID_TYPE              11
+#define DATE_TYPE               12
+
+/*  ORACLE error codes used in demonstration programs */
+#define VAR_NOT_IN_LIST       1007
+#ifndef NO_DATA_FOUND
+#  define NO_DATA_FOUND         1403
+#endif
+#define NULL_VALUE_RETURNED   1405
+
+/*  some SQL and OCI function codes */
+#define FT_INSERT                3
+#define FT_SELECT                4
+#define FT_UPDATE                5
+#define FT_DELETE                9
+
+#define FC_OOPEN                14
+
+/*
+ *  OCI function code labels,
+ *  corresponding to the fc numbers
+ *  in the cursor data area.
+ */
+static CONST text  *oci_func_tab[] =  {(text *) "not used",
+/* 1-2 */       (text *) "not used", (text *) "OSQL",
+/* 3-4 */       (text *) "not used", (text *) "OEXEC, OEXN",
+/* 5-6 */       (text *) "not used", (text *) "OBIND",
+/* 7-8 */       (text *) "not used", (text *) "ODEFIN",
+/* 9-10 */      (text *) "not used", (text *) "ODSRBN",
+/* 11-12 */     (text *) "not used", (text *) "OFETCH, OFEN",
+/* 13-14 */     (text *) "not used", (text *) "OOPEN",
+/* 15-16 */     (text *) "not used", (text *) "OCLOSE",
+/* 17-18 */     (text *) "not used", (text *) "not used",
+/* 19-20 */     (text *) "not used", (text *) "not used",
+/* 21-22 */     (text *) "not used", (text *) "ODSC",
+/* 23-24 */     (text *) "not used", (text *) "ONAME",
+/* 25-26 */     (text *) "not used", (text *) "OSQL3",
+/* 27-28 */     (text *) "not used", (text *) "OBNDRV",
+/* 29-30 */     (text *) "not used", (text *) "OBNDRN",
+/* 31-32 */     (text *) "not used", (text *) "not used",
+/* 33-34 */     (text *) "not used", (text *) "OOPT",
+/* 35-36 */     (text *) "not used", (text *) "not used",
+/* 37-38 */     (text *) "not used", (text *) "not used",
+/* 39-40 */     (text *) "not used", (text *) "not used",
+/* 41-42 */     (text *) "not used", (text *) "not used",
+/* 43-44 */     (text *) "not used", (text *) "not used",
+/* 45-46 */     (text *) "not used", (text *) "not used",
+/* 47-48 */     (text *) "not used", (text *) "not used",
+/* 49-50 */     (text *) "not used", (text *) "not used",
+/* 51-52 */     (text *) "not used", (text *) "OCAN",
+/* 53-54 */     (text *) "not used", (text *) "OPARSE",
+/* 55-56 */     (text *) "not used", (text *) "OEXFET",
+/* 57-58 */     (text *) "not used", (text *) "OFLNG",
+/* 59-60 */     (text *) "not used", (text *) "ODESCR",
+/* 61-62 */     (text *) "not used", (text *) "OBNDRA",
+/* 63-64 */     (text *) "OBINDPS",  (text *) "ODEFINPS",
+/* 65-66 */     (text *) "OGETPI",   (text *) "OSETPI"
+};
+
+#endif      /* OCIDEM */
+
diff --git a/src/terralib/drivers/Oracle/OCI/include/ocidfn.h b/src/terralib/drivers/Oracle/OCI/include/ocidfn.h
new file mode 100644
index 0000000..8ccb3f5
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ocidfn.h
@@ -0,0 +1,253 @@
+/*
+ * $Header$ 
+ */
+
+/* Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.  */
+/* Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.  */
+/*
+   NAME
+     ocidfn.h - OCI Definations
+   NOTES
+     Shipped to users.
+   MODIFIED   (MM/DD/YY)
+    srseshad   11/25/02 - change binary float/double codes
+    srseshad   11/14/02 - Add SQLT_IBFLOAT, SQLT_IBDOUBLE
+    mxyang     09/17/02 - grabtrans 'mmorsi_obj_float'
+    srseshad   09/06/02 - Add binary float/double
+    aahluwal   06/04/02 - bug 2360115
+    kmuthukk   05/02/00 - add SQLT_PNTY
+    amangal    07/30/99 - Merge into 8.1.6 : Bug 879031
+    tnbui      07/28/99 - Remove SQLT_TIMESTAMP_ITZ                            
+    tnbui      07/21/99 - SQLT_TIMESTAMP_LTZ                                   
+    tnbui      06/16/99 - TIMESTAMP WITH IMPLICIT TIME ZONE                    
+    whe        04/07/99 - bug#810075
+    whe        03/19/99 - lrg 32079 etc.: move HDA def from ocidem.h to ocidfn.
+    skmishra   05/10/98 -
+    vyanaman   04/16/98 - update sql92 datatypes
+    khnguyen   01/16/98 -
+    khnguyen   12/23/97 - SQLT* for datetimes and intervals
+    tanguyen   08/19/97 -
+    dchatter   03/18/97 -  porting exception 390897
+    dchatter   05/02/97 -   merge porting exception
+    dalpern    12/04/96 -   SQLCS_LIT_NULL added
+    cxcheng    11/14/96 -   add SQLT_BFILE/SQLT_CFILE to fix compile prob
+    cxcheng    11/12/96 -   add SQLT_NCO for named collection
+    lchidamb   10/17/96 -   add SQLT_VST and SQLT_ODT
+    sgollapu   10/14/96 -   Mutual exclusion of ocidfn and sqldef
+    sgollapu   10/07/96 -   OCI Simplification
+    aroy       09/09/96 -   add SQLCS* definitions
+    slari      08/07/96 -  add SQLT_RDD, rowid descriptor
+    slari      06/12/96 -  remove SQLT_TTBL
+    dchatter   04/21/96 -  prepare for merge into main
+    slari      08/24/95 -  b299432, define CDA_SIZE
+    zwalcott   02/28/96 -  add SQLT_BFILEE and SQLT_CFILEE.
+    lchidamb   02/22/96 -  make dtys consistent with dtydef.h
+    lchidamb   02/16/96 -  add SQLT_BFILEE and SQLT_CFILEE
+    lchidamb   01/30/96 -  rename new datatypes for v8
+    lchidamb   09/06/95 -  add new datatypes
+    slari      05/11/95 -  add OCI_EV_DEF and OCI_EV_TSF
+    dchatter   04/06/95 -  add ifdef flags around OCI_flags
+    dchatter   03/08/95 -  piece values
+    dchatter   03/06/95 -  merge changes from branch 1.2.720.3
+    jfbrown    02/17/95 -  merge changes from branch 1.2.720.2
+    dchatter   02/08/95 -  olog call modes
+    jfbrown    02/03/95 -  remove non-printable characters
+    lchidamb   12/06/94 -  merge changes from branch 1.2.720.1
+    lchidamb   10/04/94 -  added field chk to cda_head, cda_def
+    dchatter   07/05/94 -  SQLT_CUR added
+    rkooi2     11/27/92 -  Changing e* datatypes to s* 
+    rkooi2     10/26/92 -  More portability mods 
+    rkooi2     10/22/92 -  Added #ifndef ORATYPES ... 
+    rkooi2     10/18/92 -  Changes to make it portable. 
+    sjain      03/16/92 -  Creation 
+*/
+
+/*
+ *  ocidfn.h
+ *
+ *  Common header file for OCI C sample programs.
+ *  This header declares the cursor and logon data area structure.
+ *  The types used are defined in <oratypes.h>.
+ *
+ */
+ 
+#ifndef OCIDFN
+#define OCIDFN
+
+#ifndef ORATYPES 
+#include <oratypes.h>
+#endif
+
+/* The cda_head struct is strictly PRIVATE.  It is used
+   internally only. Do not use this struct in OCI programs. */
+
+struct cda_head {
+    sb2          v2_rc;
+    ub2          ft;
+    ub4          rpc;
+    ub2          peo;
+    ub1          fc;
+    ub1          rcs1;
+    ub2          rc;
+    ub1          wrn;
+    ub1          rcs2;
+    sword        rcs3;
+    struct {
+        struct {
+           ub4    rcs4;
+           ub2    rcs5;
+           ub1    rcs6;
+        } rd;
+        ub4    rcs7;
+        ub2    rcs8;
+    } rid;
+    sword        ose;
+    ub1           chk;
+    dvoid        *rcsp;
+};
+
+/*
+** Size of HDA area:
+** 512 for 64 bit arquitectures
+** 256 for 32 bit arquitectures
+*/
+
+#if defined(SS_64BIT_SERVER) || defined(__64BIT__)
+# define HDA_SIZE 512
+#else
+# define HDA_SIZE 256
+#endif
+
+#if defined(SS_64BIT_SERVER) || defined(__64BIT__)
+#define CDA_SIZE 88
+#else
+# define CDA_SIZE 64
+#endif
+
+/* the real CDA, padded to CDA_SIZE bytes in size */
+struct cda_def {
+    sb2          v2_rc;                                    /* V2 return code */
+    ub2          ft;                                    /* SQL function type */
+    ub4          rpc;                                /* rows processed count */
+    ub2          peo;                                  /* parse error offset */
+    ub1          fc;                                    /* OCI function code */
+    ub1          rcs1;                                        /* filler area */
+    ub2          rc;                                       /* V7 return code */
+    ub1          wrn;                                       /* warning flags */
+    ub1          rcs2;                                           /* reserved */
+    sword        rcs3;                                           /* reserved */
+    struct {                                              /* rowid structure */
+        struct {
+           ub4    rcs4;
+           ub2    rcs5;
+           ub1    rcs6;
+        } rd;
+        ub4    rcs7;
+        ub2    rcs8;
+    } rid;
+    sword        ose;                                 /* OSD dependent error */
+    ub1           chk;
+    dvoid        *rcsp;                          /* pointer to reserved area */
+    ub1          rcs9[CDA_SIZE - sizeof (struct cda_head)];        /* filler */
+};
+
+typedef struct cda_def Cda_Def;
+
+/* the logon data area (LDA)
+   is the same shape as the CDA */
+typedef struct cda_def Lda_Def;
+
+/* OCI Environment Modes for opinit call */
+#define OCI_EV_DEF 0                  /* default single-threaded environment */
+#define OCI_EV_TSF 1                              /* thread-safe environment */
+
+/* OCI Logon Modes for olog call */
+#define OCI_LM_DEF 0                                        /* default login */
+#define OCI_LM_NBL 1                                   /* non-blocking logon */
+
+/* 
+ * since sqllib uses both ocidef and ocidfn the following defines
+ * need to be guarded
+ */
+#ifndef OCI_FLAGS 
+#define OCI_FLAGS
+
+/* OCI_*_PIECE defines the piece types that are returned or set
+*/
+#define OCI_ONE_PIECE   0                 /* there or this is the only piece */
+#define OCI_FIRST_PIECE 1                        /* the first of many pieces */
+#define OCI_NEXT_PIECE  2                         /* the next of many pieces */
+#define OCI_LAST_PIECE  3                   /* the last piece of this column */
+#endif
+
+#ifndef SQLDEF 
+
+/* input data types */
+#define SQLT_CHR  1                        /* (ORANET TYPE) character string */
+#define SQLT_NUM  2                          /* (ORANET TYPE) oracle numeric */
+#define SQLT_INT  3                                 /* (ORANET TYPE) integer */
+#define SQLT_FLT  4                   /* (ORANET TYPE) Floating point number */
+#define SQLT_STR  5                                /* zero terminated string */
+#define SQLT_VNU  6                        /* NUM with preceding length byte */
+#define SQLT_PDN  7                  /* (ORANET TYPE) Packed Decimal Numeric */
+#define SQLT_LNG  8                                                  /* long */
+#define SQLT_VCS  9                             /* Variable character string */
+#define SQLT_NON  10                      /* Null/empty PCC Descriptor entry */
+#define SQLT_RID  11                                                /* rowid */
+#define SQLT_DAT  12                                /* date in oracle format */
+#define SQLT_VBI  15                                 /* binary in VCS format */
+#define SQLT_BFLOAT 21                                /* Native Binary float*/
+#define SQLT_BDOUBLE 22                             /* NAtive binary double */
+#define SQLT_BIN  23                                  /* binary data(DTYBIN) */
+#define SQLT_LBI  24                                          /* long binary */
+#define SQLT_UIN  68                                     /* unsigned integer */
+#define SQLT_SLS  91                        /* Display sign leading separate */
+#define SQLT_LVC  94                                  /* Longer longs (char) */
+#define SQLT_LVB  95                                   /* Longer long binary */
+#define SQLT_AFC  96                                      /* Ansi fixed char */
+#define SQLT_AVC  97                                        /* Ansi Var char */
+#define SQLT_IBFLOAT  100                           /* binary float canonical */
+#define SQLT_IBDOUBLE 101                          /* binary double canonical */
+#define SQLT_CUR  102                                        /* cursor  type */
+#define SQLT_RDD  104                                    /* rowid descriptor */
+#define SQLT_LAB  105                                          /* label type */
+#define SQLT_OSL  106                                        /* oslabel type */
+
+#define SQLT_NTY  108                                   /* named object type */
+#define SQLT_REF  110                                            /* ref type */
+#define SQLT_CLOB 112                                       /* character lob */
+#define SQLT_BLOB 113                                          /* binary lob */
+#define SQLT_BFILEE 114                                   /* binary file lob */
+#define SQLT_CFILEE 115                                /* character file lob */
+#define SQLT_RSET 116                                     /* result set type */
+#define SQLT_NCO  122      /* named collection type (varray or nested table) */
+#define SQLT_VST  155                                      /* OCIString type */
+#define SQLT_ODT  156                                        /* OCIDate type */
+
+/* datetimes and intervals */
+#define SQLT_DATE                      184                      /* ANSI Date */
+#define SQLT_TIME                      185                           /* TIME */
+#define SQLT_TIME_TZ                   186            /* TIME WITH TIME ZONE */
+#define SQLT_TIMESTAMP                 187                      /* TIMESTAMP */
+#define SQLT_TIMESTAMP_TZ              188       /* TIMESTAMP WITH TIME ZONE */
+#define SQLT_INTERVAL_YM               189         /* INTERVAL YEAR TO MONTH */
+#define SQLT_INTERVAL_DS               190         /* INTERVAL DAY TO SECOND */
+#define SQLT_TIMESTAMP_LTZ             232        /* TIMESTAMP WITH LOCAL TZ */
+
+#define SQLT_PNTY   241              /* pl/sql representation of named types */
+
+/* cxcheng: this has been added for backward compatibility -
+   it needs to be here because ocidfn.h can get included ahead of sqldef.h */
+#define SQLT_FILE SQLT_BFILEE                             /* binary file lob */
+#define SQLT_CFILE SQLT_CFILEE
+#define SQLT_BFILE SQLT_BFILEE
+ 
+/* CHAR/NCHAR/VARCHAR2/NVARCHAR2/CLOB/NCLOB char set "form" information */
+#define SQLCS_IMPLICIT 1     /* for CHAR, VARCHAR2, CLOB w/o a specified set */
+#define SQLCS_NCHAR    2                  /* for NCHAR, NCHAR VARYING, NCLOB */
+#define SQLCS_EXPLICIT 3   /* for CHAR, etc, with "CHARACTER SET ..." syntax */
+#define SQLCS_FLEXIBLE 4                 /* for PL/SQL "flexible" parameters */
+#define SQLCS_LIT_NULL 5      /* for typecheck of NULL and empty_clob() lits */
+
+#endif  /* SQLDEF */
+#endif  /* OCIDFN */
diff --git a/src/terralib/drivers/Oracle/OCI/include/ociextp.h b/src/terralib/drivers/Oracle/OCI/include/ociextp.h
new file mode 100644
index 0000000..eab9684
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ociextp.h
@@ -0,0 +1,281 @@
+/*
+ * $Header$
+ */
+
+/* Copyright (c) 1996, 2003, Oracle Corporation.  All rights reserved.  */
+ 
+/* 
+   NAME 
+     ociextp.h - Interface Definitions for PL/SQL External Procedures
+
+   DESCRIPTION 
+     This header file contains C language callable interface from 
+     PL/SQL External Procedures.
+
+   PUBLIC FUNCTION(S) 
+     OCIExtProcAllocCallMemory  - Allocate Call memory
+     OCIExtProcRaiseExcp        - Raise Exception
+     OCIExtProcRaiseExcpWithMsg - Raise Exception with message
+     OCIExtProcGetEnv           - Get OCI Environment
+
+   PRIVATE FUNCTION(S)
+     <list of static functions defined in .c file - with one-line descriptions>
+
+   EXAMPLES
+
+   NOTES
+     <other useful comments, qualifications, etc.>
+
+   MODIFIED   (MM/DD/YY)
+   srseshad    03/12/03 - convert oci public api to ansi
+   rdecker     01/10/02 - change 32k to MAX_OEN for error numbers
+   sagrawal    07/20/01 - Statement Handle to safe cal outs
+   abrumm      04/19/01 - move include of oci.h after defines/typedef
+   rdecker     02/22/01 - lint fix
+   bpalaval    02/08/01 - Change text to oratext.
+   sagrawal    06/16/00 - ref cursor in callouts
+   whe         09/01/99 - 976457:check __cplusplus for C++ code
+   asethi      04/15/99 - Created (by moving ociextp.h from /vobs/plsql/public)
+   rhari       03/25/97 - Use ifndef
+   rhari       12/18/96 - Include oratypes.h
+   rhari       12/11/96 - #416977, Flip values of return codes
+   rhari       12/02/96 - Define Return Code Macros
+   rhari       11/18/96 - Error number is int
+   rhari       10/30/96 - Fix OCIExtProcRaiseExcpWithMsg
+   rhari       10/30/96 - Get rid of warnings
+   rhari       10/04/96 - Fix OCIExtProcRaiseExcpWithMsg
+   rhari       09/23/96 - Creation
+
+*/
+
+ 
+#ifndef OCIEXTP_ORACLE
+# define OCIEXTP_ORACLE
+
+# ifndef ORATYPES 
+#  include <oratypes.h> 
+# endif
+
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/* ----------------------------- Return Codes ----------------------------- */
+/* Success and Error return codes for certain external procedure interface 
+ * functions. If a particular interface function returns OCIEXTPROC_SUCCESS
+ * or OCIEXTPROC_ERROR, then applications must use these macros to check
+ * for return values.
+ *
+ *     OCIEXTPROC_SUCCESS  -- External Procedure Success Return Code 
+ *     OCIEXTPROC_ERROR    -- External Procedure Failure Return Code 
+ */
+#define OCIEXTPROC_SUCCESS 0
+#define OCIEXTPROC_ERROR   1
+
+
+/* --------------------------- With-Context Type --------------------------- */
+/*
+ * The C callable interface to PL/SQL External Procedures require the 
+ * With-Context parameter to be passed. The type of this structure is 
+ * OCIExtProcContext is is opaque to the user.
+ *
+ * The user can declare the With-Context parameter in the application as
+ *
+ *    OCIExtProcContext *with_context;
+ */
+typedef struct OCIExtProcContext OCIExtProcContext;
+
+/* NOTE: OCIExtProcContext must be visible prior to including <oci.h> */
+
+# ifndef OCI_ORACLE
+#  include <oci.h>
+# endif
+
+
+/* ----------------------- OCIExtProcAllocCallMemory ----------------------- */
+/* OCIExtProcAllocCallMemory
+ *    Allocate N bytes of memory for the duration of the External Procedure.
+ *
+ *    Memory thus allocated will be freed by PL/SQL upon return from the
+ *    External Procedure. You must not use any kind of 'free' function on 
+ *    memory allocated by OCIExtProcAllocCallMemory.
+ *    Use this function to allocate memory for function returns.
+ * 
+ * PARAMETERS
+ * Input : 
+ *    with_context - The with_context pointer that is passed to the C 
+ *                   External Procedure.
+ *                  Type of with_context : OCIExtProcContext *
+ *    amount       - The number of bytes to allocate.
+ *                   Type of amount : size_t
+ *
+ * Output :
+ *    Nothing
+ *
+ * Return :
+ *    An untyped (opaque) Pointer to the allocated memory. 
+ *
+ * Errors :
+ *    A 0 return value should be treated as an error
+ *
+ * EXAMPLE 
+ *  text *ptr = (text *)OCIExtProcAllocCallMemory(wctx, 1024)
+ *
+ */
+#define OCIExtProcAllocCallMemory(with_context, amount) \
+ociepacm(with_context, (size_t)amount)
+
+
+
+
+/* -------------------------- OCIExtProcRaiseExcp -------------------------- */
+/* OCIExtProcRaiseExcp
+ *    Raise an Exception to PL/SQL.
+ *
+ *  Calling this function signalls an exception back to PL/SQL. After a
+ *  successful return from this function, the External Procedure must start 
+ *  its exit handling and return back to PL/SQL. Once an exception is 
+ *  signalled to PL/SQL, INOUT and OUT arguments, if any, are not processed 
+ *  at all.
+ * 
+ * PARAMETERS
+ * Input :
+ *   with_context - The with_context pointer that is passed to the C
+ *                  External Procedure. 
+ *                  Type of with_context : OCIExtProcContext *
+ *   errnum       - Oracle Error number to signal to PL/SQL. errnum
+ *                  must be a positive number and in the range 1 to MAX_OEN
+ *                  Type of errnum : int
+ * Output :
+ *   Nothing
+ *
+ * Return :
+ *   OCIEXTPROC_SUCCESS - If the call was successful.
+ *   OCIEXTPROC_ERROR   - If the call failed.
+ *
+ */
+#define OCIExtProcRaiseExcp(with_context, errnum) \
+ocieperr(with_context, (int)errnum)
+
+
+
+
+
+/* ---------------------- OCIExtProcRaiseExcpWithMsg ---------------------- */
+/* OCIExtProcRaiseExcpWithMsg
+ *    Raise an exception to PL/SQL. In addition, substitute the
+ *    following error message string within the standard Oracle error 
+ *    message string. See note for OCIExtProcRaiseExcp
+ * 
+ * PARAMETERS
+ * Input :
+ *   with_context  - The with_context pointer that is passed to the C
+ *                   External Procedure.
+ *                   Type of with_context : OCIExtProcContext *
+ *   errnum        - Oracle Error number to signal to PL/SQL. errnum
+ *                   must be a positive number and in the range 1 to MAX_OEN
+ *                   Type of errnum : int
+ *   errmsg        - The error message associated with the errnum.
+ *                   Type of errmsg : char *
+ *   len           - The length of the error message. 0 if errmsg is
+ *                   null terminated string.
+ *                   Type of len : size_t
+ * Output :
+ *   Nothing
+ *
+ * Return :
+ *  OCIEXTPROC_SUCCESS - If the call was successful.
+ *  OCIEXTPROC_ERROR   - If the call failed.
+ *
+ */
+#define OCIExtProcRaiseExcpWithMsg(with_context, errnum, errmsg, msglen) \
+ociepmsg(with_context, (int)errnum, errmsg, (size_t)msglen)
+
+
+
+/* --------------------------- OCIExtProcGetEnv --------------------------- */
+/* OCIExtProcGetEnv
+ *    Get OCI Environment
+ * 
+ * PARAMETERS
+ * Input :
+ *    with_context - The with_context pointer that is passed to the C
+ *                   External Procedure.
+ *
+ * Output :
+ *    envh - The OCI Environment handle.
+ *    svch - The OCI Service handle.
+ *    errh - The OCI Error handle.
+ *
+ * Return :
+ *  OCI_SUCCESS - Successful completion of the function.
+ *  OCI_ERROR   - Error.
+ *
+ */
+#define OCIExtProcGetEnv(with_context, envh, svch, errh) \
+ociepgoe(with_context, envh, svch, errh)
+
+
+
+/* ------------------------ OCIInitializeStatementHandle ------------------- */
+/* OCIreateStatementHandle
+ *    Initialize Statement Handle
+ * 
+ * PARAMETERS
+ * Input :
+ *    wctx     - The 
+ *    cursorno - The cursor number for which we need to initialize
+ *               the statement handle
+ *    svch     - The OCI Service handle.
+ *
+ * Output :
+ *    stmthp - The OCI Statement handle.
+ *    errh   - The OCI Error handle.
+ *
+ * Return :
+ *  OCI_SUCCESS - Successful completion of the function.
+ *  OCI_ERROR   - Error.
+ *
+ */
+#define OCIInitializeStatementHandle(wctx, cursorno,  svch, stmthp, errh) \
+ociepish(wctx, cursor, svch, stmthp, errh)
+
+
+
+
+/*---------------------------------------------------------------------------
+                     PRIVATE TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                           PUBLIC FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                          PRIVATE FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+
+dvoid *ociepacm(OCIExtProcContext *with_context, size_t amount);
+
+
+
+size_t ocieperr(OCIExtProcContext *with_context, int error_number);
+
+
+
+size_t ociepmsg(OCIExtProcContext *with_context, int error_number,
+                oratext *error_message, size_t len );
+
+
+
+sword ociepgoe(OCIExtProcContext *with_context, OCIEnv **envh, 
+               OCISvcCtx **svch, OCIError **errh);
+
+
+#endif                                                     /* OCIEXTP_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/ocikp.h b/src/terralib/drivers/Oracle/OCI/include/ocikp.h
new file mode 100644
index 0000000..1c9f851
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ocikp.h
@@ -0,0 +1,10223 @@
+/*
+ * $Header$
+ */
+/* Copyright (c) 1996, 2002, Oracle Corporation.  All rights reserved.  */
+ 
+/* NOTE:  See 'header_template.doc' in the 'doc' dve under the 'forms' 
+      directory for the header file template that includes instructions. 
+*/
+ 
+/* 
+   NAME 
+     ocikp.h - Prototypes of V8 OCI functions in K&R style
+
+   DESCRIPTION 
+     defines the prototypes of V8 OCI functions in K&R style
+
+   RELATED DOCUMENTS 
+ 
+   INSPECTION STATUS 
+     Inspection date: 
+     Inspection status: 
+     Estimated increasing cost defects per page: 
+     Rule sets: 
+ 
+   ACCEPTANCE REVIEW STATUS 
+     Review date: 
+     Review status: 
+     Reviewers: 
+ 
+   PUBLIC FUNCTION(S) 
+     <list of external functions declared/defined - with one-line descriptions>
+
+   PRIVATE FUNCTION(S) 
+     <list of static functions defined in .c file - with one-line descriptions>
+ 
+   EXAMPLES 
+ 
+   NOTES 
+     <other useful comments, qualifications, etc.> 
+
+   MODIFIED   (MM/DD/YY)
+   sichandr    02/12/02 - fix OCIXMLTypeExists
+   gayyappa    02/01/02 - fix 2210776 : change Dom to DOM 
+   sichandr    10/24/01 - OCISvcCtx for XMLType create routines
+   schandir    09/24/01 - Add prototypes for Stmt Caching
+   abande      09/04/01 - Add Prototypes for Session Pooling Methods
+   stakeda     09/24/01 - add OCINlsCharSetConvert and 
+                          OCINlsEnvironmentVariableGet.
+   whe         08/28/01 - add OCIEnvNlsCreate
+   wzhang      08/22/01 - Add OCINlsCharSetNameToId.
+   whe         10/05/01 - add prototype for OCIXMLType functions
+   mdmehta     04/06/01 - Bug 1683763, OCIDateTimeToText: buf_size to ub4*
+   schandir    12/12/00 - modify the ociconnectionpoolcreate() interface.
+   porangas    12/04/00 - Forward merge bug#974710 to 9i
+   gtarora     11/30/00 - fix comment for OCILobIsTemporary
+   akatti      11/07/00 - [1198379]:add OCIRowidToChar
+   bpalaval    10/15/00 - Forward merge 892654.
+   kmohan      09/18/00 - add OCILogon2
+   etucker     07/28/00 - add OCIIntervalFromTZ
+   vjayaram    07/18/00 - add connection pooling changes
+   etucker     07/13/00 - add dls apis for oci
+   hmasaki     07/05/00 - fix 1230846: forward merge into 8.2
+   mbastawa    06/05/00 - add OCIStmtFetch2
+   rxgovind    06/07/00 - update OCIAnyData interfaces
+   rxgovind    05/04/00 - add OCIAnyDataSet interfaces
+   rkasamse    05/01/00 - add ocianydata i/f
+   slari       09/01/99 - remove OCIEnvCallback
+   slari       08/23/99 - add OCIUcb in user callback functions
+   whe         09/01/99 - 976457:check __cplusplus for C++ code
+   dsaha       07/07/99 - Add OCIFEnvCreate for forms
+  vyanaman    06/21/99 - Change OCI DateTime/Interval APIs.
+   esoyleme    07/01/99 - expose MTS performance enhancements                  
+   whe         06/14/99 - bug727872:add CONST to match definitions
+   kkarun      02/23/99 - Fix OCIDateTime APIs
+   jiyang      12/07/98 - Add comments for OCI_NLS_DUAL_CURRENCY
+   aroy        12/01/98 - add OCIEnvCreate
+   slari       11/23/98 - use ORASTDARG
+   slari       11/22/98 - use arglist in OCIUserCallback
+   slari       11/21/98 - replace ellipsis by arglist in OCIUserCallback
+   thchang     10/20/98 - correct comment on OCILobCreateTemporary
+   sgollapu    09/30/98 - Fix bug 725473
+   slari       09/08/98 - allow envh to receive error info also in CallbackReg/
+   lchidamb    07/07/98 - change comments
+   aroy        08/04/98 - add OCITerminate calls                               
+   sgollapu    06/30/98 - Add OCISubscription* prototypes
+   nramakri    06/25/98 - remove CONST from some OCIPickler APIs
+   jiyang      06/22/98 - Fix a lint error
+   nmallava    06/08/98 - ociistemporary -> envhp
+   jhasenbe    05/27/98 - Remove definitions for U-Calls (Unicode)
+   nmallava    05/18/98 - correct comment
+   sgollapu    05/19/98 - Change text to OraText
+   aroy        04/20/98 - merge forward 8.0.5 -> 8.1.3
+   nbhatt      05/14/98 - aq listen call
+   vyanaman    04/19/98 - system timestamp
+   kkarun      04/17/98 - Add more Interval functions
+   vyanaman    04/16/98 - Add get/set TZ
+   kkarun      04/13/98 - add datetime prototypes
+   rkasamse    04/13/98 - change OCIEnv* to dvoid* for context/memory cart serv
+   rkasamse    04/15/98 - chage pickler cart interface
+   slari       03/20/98 - change proto of OCIUserCallback
+   slari       02/17/98 - add OCIEnvCallback
+   jiyang      04/02/98 - Accept both env and user handles for NLS
+   nmallava    04/09/98 - OCILobLocatorAssign
+   nmallava    04/07/98 - fix compiler warnings
+   jhasenbe    04/06/98 - Add new interfaces for Unicode support
+   skabraha    03/24/98 - fixing prototype mismatch
+   tsaulys     03/20/98 - use environment or session handle
+   rkasamse    03/20/98 - remove prototypes for OCIMemoryDuration* functions
+   nmallava    03/17/98 - add interfaces
+   nmallava    03/16/98 - add open/close apis
+   nmallava    03/10/98 - add temporary lobs apis
+   sgollapu    07/10/97 - Add OCIReset
+   sgollapu    02/09/98 - OCI non-blocking
+   nramakri    01/16/98 - remove #ifdef NEVER clause for OCIExtract
+   rmurthy     01/08/98 - OCIContextGenerateKey: change ub1 to ub4
+   ewaugh      01/02/98 - remove VAFP from OCIFormatString prototype
+   ewaugh      12/18/97 - Turn type wrappers into functions.
+   rtaranto    12/17/97 - Resolve merge conflicts
+   jiyang      11/13/97 - Add NLS service for cartridge
+   rhwu        12/02/97 - add OCI Thread
+   nramakri    12/15/97 - move to core4
+   nramakri    12/11/97 - modify OCIExtract prototype
+   ewaugh      12/10/97 - add OCIFormat prototypes
+   skabraha    12/02/97 - adding OCIFile functions
+   nramakri    11/12/97 - add OCIExtract prototypes
+   rkasamse    11/21/97 - add prototypes for memory cartridge services and cont
+   rkasamse    11/03/97 - Add pickler cartridge service interfaces
+   tanguyen    08/19/97 -
+   schandra    06/25/97 - AQ OCI interface
+   bnainani    07/21/97 - add prototypes for Oracle XA extensions
+   rtaranto    05/20/97 - remove OCILobLocatorSize (again)
+   esoyleme    05/13/97 - move failover callback prototype
+   skmishra    05/06/97 - stdc compiler fixes
+   skmishra    04/23/97 - Provide C++ compatibility
+   skotsovo    04/21/97 - make lob parameter names consistent
+   rwhitman    04/16/97 - Fix LOB prototypes - Olint OCI 8.0.3
+   ramkrish    04/15/97 - Add free flag to OCILobFlushBuffer
+   cxcheng     04/09/97 - change objnamp from CONST text* to dvoid*
+   cxcheng     04/08/97 - fix prototype for OCIDescribeAny
+   skotsovo    03/31/97 - remove OCILobLocatorSize
+   skotsovo    03/27/97 - add OCILobLoadFromFile
+   sgollapu    03/26/97 - Change OCIDescribeAny prototype
+   skotsovo    03/26/97 - add svchp to ocienablebuffering
+   skotsovo    03/26/97 - change OCILobFlushBuffers to OCILobFlushBuffer
+   skotsovo    03/18/97 - add interface for lob buffering.
+   dchatter    01/13/97 - fix comments on LOB calls
+   aroy        01/10/97 - remove ocilobfilecreate delete
+   sgollapu    12/27/96 - Correct OCILogon prototype
+   dchatter    01/04/97 - comments to describe the functions
+   sgollapu    11/25/96 - Change OCILobFileIsExistent
+   schandra    11/18/96 - Remove xa.h include
+   sgollapu    11/09/96 - Change prototype of OCIDescribeAny
+   dchatter    11/01/96 - lint error
+   dchatter    10/31/96 - delete CONST from lob write cb fn
+   dchatter    10/30/96 - more changes
+   dchatter    10/26/96 - lob/file long name corrections
+   slari       10/16/96 - delete unused calls
+   rwessman    10/29/96 - Fixed OCISecurityGetIdentity prototype
+   sgollapu    10/22/96 - Add OCILogon and OCILogoff prototypes
+   rwessman    10/16/96 - Added cryptographic and digital signature functions
+   rxgovind    10/07/96 - add oci file calls
+   skotsovo    09/20/96 - in OCILobGetLength(), remove the 'isnull' parameter.
+   skotsovo    10/01/96 - move orl lob fnts to oci
+   skotsovo    09/20/96 - in OCILobGetLength(), remove the 'isnull' parameter.
+   aroy        08/29/96 - change prototype for Nchar Lob support
+   dchatter    08/21/96 - OCIResultSetToStmt prototype change
+   sthakur     08/14/96 - add OCIParamSet
+   schandra    06/17/96 - Convert XA to use new OCI
+   aroy        07/17/96 - terminology change: OCILobLocator => OCILobLocator
+   dchatter    07/01/96 - drop prototypes not in beta1
+   dchatter    06/29/96 - OCIParamGet prototype change
+   dchatter    06/19/96 - add OCISvcCtxBreak, OCILdaToSvcCtx
+   slari       06/12/96 - inlcude oratypes.h instead of s.h
+   schandra    05/31/96 - remove client DBID parameters from OCITransStart
+   asurpur     06/05/96 - Changing the prototype for OCIPasswordChange
+   dchatter    05/30/96 - change OCIStmtGetBind prototype
+   schandra    05/29/96 - Add timeout parameter to OCITransDetach
+   slari       05/30/96 - add OCIBindDynamic/OCIDefineDynamic
+   slari       05/28/96 - fix gpi/spi protos
+   slari       05/28/96 - change proto for OCIParamGet
+   jbellemo    05/23/96 - remove ociisc
+   schandra    05/15/96 - Remove ocitgti type
+   schandra    04/18/96 - OCITransCommitt -> OCITransCommit
+   schandra    03/27/96 - V8OCI - add transaction related calls
+   dchatter    04/01/96 - change return types to sword to be compatible with oo
+   dchatter    03/21/96 - add oci2lda conversion routines
+   aroy        03/12/96 - change parameter order for lob functions
+   dchatter    03/08/96 - minor parameter renaming for lob calls
+   slari       03/14/96 - change proto of OCITransRollback
+   slari       03/12/96 - remove ocidqry
+   slari       03/01/96 - change proto for OCIInitialize
+   slari       02/07/96 - update prototypes
+   slari       02/06/96 - add OCITransCommit()
+   slari       02/02/96 - ociisc: rm dblink info
+   dchatter    01/08/96 - V8 OCI K&R prototype file
+   dchatter    01/08/96 - Creation
+
+*/
+ 
+#ifndef OCIKP_ORACLE
+# define OCIKP_ORACLE
+ 
+# ifndef ORATYPES 
+#  include <oratypes.h> 
+# endif 
+ 
+#ifndef ORASTDARG
+#include <stdarg.h>
+#define ORASTDARG
+#endif
+ 
+#ifndef OCIDFN
+#include <ocidfn.h>
+#endif
+
+#ifndef NZT_ORACLE
+#include <nzt.h>
+#endif /* NZT_ORACLE */
+
+#ifndef OCI_ORACLE
+#include <oci.h>
+#endif
+
+#ifndef ORT_ORACLE
+#include <ort.h>
+#endif 
+
+/*--------------------------------------------------------------------------- 
+                     PUBLIC TYPES AND CONSTANTS 
+  ---------------------------------------------------------------------------*/
+
+/*--------------------------------------------------------------------------- 
+                     PRIVATE TYPES AND CONSTANTS 
+  ---------------------------------------------------------------------------*/
+ 
+ 
+/*--------------------------------------------------------------------------- 
+                           PUBLIC FUNCTIONS 
+  ---------------------------------------------------------------------------*/
+
+/*------------------Oracle Version 8 Call Interface--------------------------*/
+
+
+/*****************************************************************************
+                              DESCRIPTION
+******************************************************************************
+Note: the descriptions of the functions are alphabetically arranged. Please 
+maintain the arrangement when adding a new function description. The actual 
+prototypes are below this comment section and donot follow any alphabetical 
+ordering. 
+
+
+--------------------------------OCIAttrGet------------------------------------
+
+OCIAttrGet()
+Name
+OCI Attribute Get
+Purpose
+This call is used to get a particular attribute of a handle. 
+Syntax
+sword OCIAttrGet ( CONST dvoid    *trgthndlp,
+                 ub4            trghndltyp,
+                 dvoid          *attributep,
+                 ub4            *sizep,
+                 ub4            attrtype,
+                 OCIError       *errhp );
+Comments
+This call is used to get a particular attribute of a handle.
+See Appendix B,  "Handle Attributes",  for a list of handle types and their 
+readable attributes.
+Parameters
+trgthndlp (IN) - is the pointer to a handle type. 
+trghndltyp (IN) - is the handle type. 
+attributep (OUT) - is a pointer to the storage for an attribute value. The 
+attribute value is filled in. 
+sizep (OUT) - is the size of the attribute value. 
+This can be passed in as NULL for most parameters as the size is well known. 
+For OraText* parameters, a pointer to a ub4 must be passed in to get the length 
+of the string. 
+attrtype (IN) - is the type of attribute.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+Related Functions
+OCIAttrSet()
+
+--------------------------------OCIAttrSet------------------------------------
+
+
+OCIAttrSet()
+Name
+OCI Attribute Set
+Purpose
+This call is used to set a particular attribute of a handle or a descriptor. 
+Syntax
+sword OCIAttrSet ( dvoid       *trgthndlp,
+                 ub4         trghndltyp,
+                 dvoid       *attributep,
+                 ub4         size,
+                 ub4         attrtype,
+                 OCIError    *errhp );
+Comments
+This call is used to set a particular attribute of a handle or a descriptor. 
+See Appendix B for a list of handle types and their writeable attributes.
+Parameters
+trghndlp (IN/OUT) - the pointer to a handle type whose attribute gets 
+modified. 
+trghndltyp (IN/OUT) - is the handle type. 
+attributep (IN) - a pointer to an attribute value. 
+The attribute value is copied into the target handle. If the attribute value 
+is a pointer, then only the pointer is copied, not the contents of the pointer.
+size (IN) - is the size of an attribute value. This can be passed in as 0 for 
+most attributes as the size is already known by the OCI library. For OraText*
+attributes, a ub4 must be passed in set to the length of the string. 
+attrtype (IN) - the type of attribute being set.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+Related Functions
+OCIAttrGet()
+
+
+
+--------------------------------OCIBindArrayOfStruct--------------------------
+
+
+
+OCIBindArrayOfStruct()
+Name
+OCI Bind for Array of Structures
+Purpose
+This call sets up the skip parameters for a static array bind.
+Syntax
+sword OCIBindArrayOfStruct ( OCIBind     *bindp,
+                           OCIError    *errhp,
+                           ub4         pvskip, 
+                           ub4         indskip, 
+                           ub4         alskip, 
+                           ub4         rcskip );
+Comments
+This call sets up the skip parameters necessary for a static array bind.
+This call follows a call to OCIBindByName() or OCIBindByPos(). The bind 
+handle returned by that initial bind call is used as a parameter for the 
+OCIBindArrayOfStruct() call.
+For information about skip parameters, see the section "Arrays of Structures" 
+on page 4-16.
+Parameters
+bindp (IN) - the handle to a bind structure. 
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+pvskip (IN) - skip parameter for the next data value. 
+indskip (IN) - skip parameter for the next indicator value or structure. 
+alskip (IN) - skip parameter for the next actual length value. 
+rcskip (IN) - skip parameter for the next column-level return code value. 
+Related Functions
+OCIAttrGet()
+
+
+--------------------------------OCIBindByName---------------------------------
+
+
+OCIBindByName()
+Name
+OCI Bind by Name
+Purpose
+Creates an association between a program variable and a placeholder in a SQL 
+statement or PL/SQL block.
+Syntax
+sword OCIBindByName (
+              OCIStmt       *stmtp, 
+              OCIBind       **bindp,
+              OCIError      *errhp,
+              CONST OraText    *placeholder,
+              sb4           placeh_len,
+              dvoid         *valuep,
+              sb4           value_sz,
+              ub2           dty,
+              dvoid         *indp,
+              ub2           *alenp,
+              ub2           *rcodep,
+              ub4           maxarr_len,
+              ub4           *curelep, 
+              ub4           mode ); 
+Description
+This call is used to perform a basic bind operation. The bind creates an 
+association between the address of a program variable and a placeholder in a 
+SQL statement or PL/SQL block. The bind call also specifies the type of data 
+which is being bound, and may also indicate the method by which data will be 
+provided at runtime.
+This function also implicitly allocates the bind handle indicated by the bindp 
+parameter.
+Data in an OCI application can be bound to placeholders statically or 
+dynamically. Binding is static when all the IN bind data and the OUT bind 
+buffers are well-defined just before the execute. Binding is dynamic when the 
+IN bind data and the OUT bind buffers are provided by the application on 
+demand at execute time to the client library. Dynamic binding is indicated by 
+setting the mode parameter of this call to OCI_DATA_AT_EXEC.
+Related Functions: For more information about dynamic binding, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16.
+Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle, 
+which is implicitly allocated by the bind call A separate bind handle is 
+allocated for each placeholder the application is binding.
+Additional bind calls may be required to specify particular attributes 
+necessary when binding certain data types or handling input data in certain 
+ways:
+If arrays of structures are being utilized, OCIBindArrayOfStruct() must 
+be called to set up the necessary skip parameters.
+If data is being provided dynamically at runtime, and the application 
+will be using user-defined callback functions, OCIBindDynamic() must 
+be called to register the callbacks.
+If a named data type is being bound, OCIBindObject() must be called to 
+specify additional necessary information.
+Parameters
+stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement 
+being processed.
+bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly 
+allocated by this call.  The bind handle  maintains all the bind information for 
+this particular input value. The handle is feed implicitly when the statement 
+handle is deallocated.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+placeholder (IN) - the placeholder attributes are specified by name if ocibindn() 
+is being called.
+placeh_len (IN) - the length of the placeholder name specified in placeholder.
+valuep (IN/OUT) - a pointer to a data value or an array of data values of the 
+type specified in the dty parameter. An array of data values can be specified 
+for mapping into a PL/SQL table or for providing data for SQL multiple-row 
+operations. When an array of bind values is provided, this is called an array 
+bind in OCI terms. Additional attributes of the array bind (not bind to a 
+column of ARRAY type) are set up in OCIBindArrayOfStruct() call. 
+For a REF, named data type  bind, the valuep parameter is used only for IN 
+bind data. The pointers to OUT buffers are set in the pgvpp parameter 
+initialized by OCIBindObject(). For named data type and REF binds, the bind 
+values are unpickled into the Object Cache. The OCI object navigational calls 
+can then be used to navigate the objects and the refs in the Object Cache.
+If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep 
+is ignored for all data types. OCIBindArrayOfStruct() cannot be used and 
+OCIBindDynamic() must be invoked to provide callback functions if desired. 
+value_sz (IN) - the size of a data value. In the case of an array bind, this is the 
+maximum size of any element possible with the actual sizes being specified in 
+the alenp parameter. 
+If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum 
+size of the data that can be ever provided at runtime for data types other than 
+named data types or REFs. 
+dty (IN) - the data type of the value(s) being bound. Named data types 
+(SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been 
+initialized in object mode. For named data types, or REFs, additional calls 
+must be made with the bind handle to set up the datatype-specific attributes.
+indp (IN/OUT) - pointer to an indicator variable or array. For scalar data 
+types, this is a pointer to sb2 or an array of sb2s. For named data types, 
+this pointer is ignored and the actual pointer to the indicator structure or 
+an array of indicator structures is initialized by OCIBindObject(). 
+Ignored for dynamic binds.
+See the section "Indicator Variables" on page 2-43 for more information about 
+indicator variables.
+alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each 
+element in alenp is the length of the data in the corresponding element in the 
+bind value array before and after the execute. This parameter is ignored for 
+dynamic binds.
+rcodep (OUT) - pointer to array of column level return codes. This parameter 
+is ignored for dynamic binds.
+maxarr_len (IN) - the maximum possible number of elements of type dty in a 
+PL/SQL binds. This parameter is not required for non-PL/SQL binds. If 
+maxarr_len is non-zero, then either OCIBindDynamic() or 
+OCIBindArrayOfStruct() can be invoked to set up additional bind attributes. 
+curelep(IN/OUT) - a pointer to the actual number of elements. This parameter 
+is only required for PL/SQL binds.
+mode (IN) - the valid modes for this parameter are:
+OCI_DEFAULT. This is default mode.
+OCI_DATA_AT_EXEC. When this mode is selected, the value_sz 
+parameter defines the maximum size of the data that can be ever 
+provided at runtime. The application must be ready to provide the OCI 
+library runtime IN data buffers at any time and any number of times. 
+Runtime data is provided in one of the two ways:
+callbacks using a user-defined function which must be registered 
+with a subsequent call to OCIBindDynamic(). 
+a polling mechanism using calls supplied by the OCI. This mode 
+is assumed if no callbacks are defined.
+For more information about using the OCI_DATA_AT_EXEC mode, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16.
+When the allocated buffers are not required any more, they should be 
+freed by the client. 
+Related Functions
+OCIBindDynamic(), OCIBindObject(), OCIBindArrayOfStruct(), OCIAttrGet()
+
+
+-------------------------------OCIBindByPos----------------------------------
+
+
+OCIBindByPos()
+Name
+OCI Bind by Position
+Purpose
+Creates an association between a program variable and a placeholder in a SQL 
+statement or PL/SQL block.
+Syntax
+sword OCIBindByPos ( 
+              OCIStmt      *stmtp, 
+              OCIBind      **bindp,
+              OCIError     *errhp,
+              ub4          position,
+              dvoid        *valuep,
+              sb4          value_sz,
+              ub2          dty,
+              dvoid        *indp,
+              ub2          *alenp,
+              ub2          *rcodep,
+              ub4          maxarr_len,
+              ub4          *curelep, 
+              ub4          mode);
+
+Description
+This call is used to perform a basic bind operation. The bind creates an 
+association between the address of a program variable and a placeholder in a 
+SQL statement or PL/SQL block. The bind call also specifies the type of data 
+which is being bound, and may also indicate the method by which data will be 
+provided at runtime.
+This function also implicitly allocates the bind handle indicated by the bindp 
+parameter.
+Data in an OCI application can be bound to placeholders statically or 
+dynamically. Binding is static when all the IN bind data and the OUT bind 
+buffers are well-defined just before the execute. Binding is dynamic when the 
+IN bind data and the OUT bind buffers are provided by the application on 
+demand at execute time to the client library. Dynamic binding is indicated by 
+setting the mode parameter of this call to OCI_DATA_AT_EXEC.
+Related Functions: For more information about dynamic binding, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16
+Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle, 
+which is implicitly allocated by the bind call A separate bind handle is 
+allocated for each placeholder the application is binding.
+Additional bind calls may be required to specify particular attributes 
+necessary when binding certain data types or handling input data in certain 
+ways:
+If arrays of structures are being utilized, OCIBindArrayOfStruct() must 
+be called to set up the necessary skip parameters.
+If data is being provided dynamically at runtime, and the application 
+will be using user-defined callback functions, OCIBindDynamic() must 
+be called to register the callbacks.
+If a named data type is being bound, OCIBindObject() must be called to 
+specify additional necessary information.
+Parameters
+stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement 
+being processed.
+bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly 
+allocated by this call.  The bind handle  maintains all the bind information for 
+this particular input value. The handle is feed implicitly when the statement 
+handle is deallocated.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+position (IN) - the placeholder attributes are specified by position if ocibindp() 
+is being called.
+valuep (IN/OUT) - a pointer to a data value or an array of data values of the 
+type specified in the dty parameter. An array of data values can be specified 
+for mapping into a PL/SQL table or for providing data for SQL multiple-row 
+operations. When an array of bind values is provided, this is called an array 
+bind in OCI terms. Additional attributes of the array bind (not bind to a 
+column of ARRAY type) are set up in OCIBindArrayOfStruct() call. 
+For a REF, named data type  bind, the valuep parameter is used only for IN 
+bind data. The pointers to OUT buffers are set in the pgvpp parameter 
+initialized by OCIBindObject(). For named data type and REF binds, the bind 
+values are unpickled into the Object Cache. The OCI object navigational calls 
+can then be used to navigate the objects and the refs in the Object Cache.
+If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep 
+is ignored for all data types. OCIBindArrayOfStruct() cannot be used and 
+OCIBindDynamic() must be invoked to provide callback functions if desired. 
+value_sz (IN) - the size of a data value. In the case of an array bind, this is the 
+maximum size of any element possible with the actual sizes being specified in 
+the alenp parameter. 
+If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum 
+size of the data that can be ever provided at runtime for data types other than 
+named data types or REFs. 
+dty (IN) - the data type of the value(s) being bound. Named data types 
+(SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been 
+initialized in object mode. For named data types, or REFs, additional calls 
+must be made with the bind handle to set up the datatype-specific attributes.
+indp (IN/OUT) - pointer to an indicator variable or array. For scalar data 
+types, this is a pointer to sb2 or an array of sb2s. For named data types, 
+this pointer is ignored and the actual pointer to the indicator structure or 
+an array of indicator structures is initialized by OCIBindObject(). Ignored 
+for dynamic binds.
+See the section "Indicator Variables" on page 2-43 for more information about 
+indicator variables.
+alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each 
+element in alenp is the length of the data in the corresponding element in the 
+bind value array before and after the execute. This parameter is ignored for 
+dynamic binds.
+rcodep (OUT) - pointer to array of column level return codes. This parameter 
+is ignored for dynamic binds.
+maxarr_len (IN) - the maximum possible number of elements of type dty in a 
+PL/SQL binds. This parameter is not required for non-PL/SQL binds. If 
+maxarr_len is non-zero, then either OCIBindDynamic() or 
+OCIBindArrayOfStruct() can be invoked to set up additional bind attributes. 
+curelep(IN/OUT) - a pointer to the actual number of elements. This parameter 
+is only required for PL/SQL binds.
+mode (IN) - the valid modes for this parameter are:
+OCI_DEFAULT. This is default mode.
+OCI_DATA_AT_EXEC. When this mode is selected, the value_sz 
+parameter defines the maximum size of the data that can be ever 
+provided at runtime. The application must be ready to provide the OCI 
+library runtime IN data buffers at any time and any number of times. 
+Runtime data is provided in one of the two ways:
+callbacks using a user-defined function which must be registered 
+with a subsequent call to OCIBindDynamic() . 
+a polling mechanism using calls supplied by the OCI. This mode 
+is assumed if no callbacks are defined.
+For more information about using the OCI_DATA_AT_EXEC mode, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16.
+When the allocated buffers are not required any more, they should be 
+freed by the client. 
+Related Functions
+OCIBindDynamic(), OCIBindObject(), OCIBindArrayOfStruct(), OCIAttrGet()
+
+
+
+-------------------------------OCIBindDynamic---------------------------------
+
+
+OCIBindDynamic()
+Name
+OCI Bind Dynamic Attributes
+Purpose
+This call is used to register user callbacks for dynamic data allocation. 
+Syntax
+sword OCIBindDynamic( OCIBind     *bindp,
+                    OCIError    *errhp,
+                    dvoid       *ictxp, 
+                    OCICallbackInBind         (icbfp)(
+                                dvoid            *ictxp,
+                                OCIBind          *bindp,
+                                ub4              iter, 
+                                ub4              index, 
+                                dvoid            **bufpp,
+                                ub4              *alenp,
+                                ub1              *piecep, 
+                                dvoid            **indp ),
+                    dvoid       *octxp,
+                    OCICallbackOutBind         (ocbfp)(
+                                dvoid            *octxp,
+                                OCIBind          *bindp,
+                                ub4              iter, 
+                                ub4              index, 
+                                dvoid            **bufp, 
+                                ub4              **alenpp,
+                                ub1              *piecep,
+                                dvoid            **indpp, 
+                                ub2              **rcodepp)   );
+Comments
+This call is used to register user-defined callback functions for providing data 
+for an UPDATE or INSERT if OCI_DATA_AT_EXEC mode was specified in a 
+previous call to OCIBindByName() or OCIBindByPos(). 
+The callback function pointers must return OCI_CONTINUE if it the call is 
+successful. Any return code other than OCI_CONTINUE signals that the client 
+wishes to abort processing immediately.
+For more information about the OCI_DATA_AT_EXEC mode, see the section 
+"Runtime Data Allocation and Piecewise Operations" on page 5-16.
+Parameters
+bindp (IN/OUT) - a bind handle returned by a call to OCIBindByName() or 
+OCIBindByPos(). 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+ictxp (IN) - the context pointer required by the call back function icbfp. 
+icbfp (IN) - the callback function which returns a pointer to the IN bind 
+value or piece at run time. The callback takes in the following parameters. 
+ictxp (IN/OUT) - the context pointer for this callback function. 
+bindp (IN) - the bind handle passed in to uniquely identify this bind 
+variable. 
+iter (IN) - 1-based execute iteration value. 
+index (IN) - index of the current array, for an array bind. 1 based not 
+greater than curele parameter of the bind call. 
+index (IN) - index of the current array, for an array bind. This parameter 
+is 1-based, and may not be greater than curele parameter of the bind call. 
+bufpp (OUT) - the pointer to the buffer. 
+piecep (OUT) - which piece of the bind value. This can be one of the 
+following values - OCI_ONE_PIECE, OCI_FIRST_PIECE, 
+OCI_NEXT_PIECE and OCI_LAST_PIECE.
+indp (OUT) - contains the indicator value. This is apointer to either an 
+sb2 value or a pointer to an indicator structure for binding named data 
+types. 
+indszp (OUT) - contains the indicator value size. A pointer containing 
+the size of either an sb2 or an indicator structure pointer. 
+octxp (IN) - the context pointer required by the callback function ocbfp. 
+ocbfp (IN) - the callback function which returns a pointer to the OUT bind 
+value or piece at run time. The callback takes in the following parameters. 
+octxp (IN/OUT) - the context pointer for this call back function. 
+bindp (IN) - the bind handle passed in to uniquely identify this bind 
+variable. 
+iter (IN) - 1-based execute iteration value. 
+index (IN) - index of the current array, for an array bind. This parameter 
+is 1-based, and must not be greater than curele parameter of the bind call. 
+bufpp (OUT) - a pointer to a buffer to write the bind value/piece. 
+buflp (OUT) - returns the buffer size. 
+alenpp (OUT) - a pointer to a storage for OCI to fill in the size of the bind 
+value/piece after it has been read. 
+piecep (IN/OUT) - which piece of the bind value. It will be set by the 
+library to be one of the following values - OCI_ONE_PIECE or 
+OCI_NEXT_PIECE. The callback function can leave it unchanged or set 
+it to OCI_FIRST_PIECE or OCI_LAST_PIECE. By default - 
+OCI_ONE_PIECE. 
+indpp (OUT) - returns a pointer to contain the indicator value which 
+either an sb2 value or a pointer to an indicator structure for named data 
+types. 
+indszpp (OUT) - returns a pointer to return the size of the indicator 
+value which is either size of an sb2 or size of an indicator structure. 
+rcodepp (OUT) - returns a pointer to contains the return code. 
+Related Functions
+OCIAttrGet()
+
+
+
+---------------------------------OCIBindObject--------------------------------
+
+
+OCIBindObject()
+Name
+OCI Bind Object
+Purpose
+This function sets up additional attributes which are required for a named 
+data type (object)  bind.
+Syntax
+sword OCIBindObject ( OCIBind          *bindp,
+                    OCIError         *errhp, 
+                    CONST OCIType    *type,
+                    dvoid            **pgvpp, 
+                    ub4              *pvszsp, 
+                    dvoid            **indpp, 
+                    ub4              *indszp, );
+Comments
+This function sets up additional attributes which binding a named data type 
+or a REF. An error will be returned if this function is called when the OCI 
+environment has been initialized in non-object mode. 
+This call takes as a paramter a type descriptor object (TDO) of datatype 
+OCIType for the named data type being defined.  The TDO can be retrieved 
+with a call to OCITypeByName().
+If the OCI_DATA_AT_EXEC mode was specified in ocibindn() or ocibindp(), the 
+pointers to the IN buffers are obtained either using the callback icbfp 
+registered in the OCIBindDynamic() call or by the OCIStmtSetPieceInfo() call. 
+The buffers are dynamically allocated for the OUT data and the pointers to 
+these buffers are returned either by calling ocbfp() registered by the 
+OCIBindDynamic() or by setting the pointer to the buffer in the buffer passed 
+in by OCIStmtSetPieceInfo() called when OCIStmtExecute() returned 
+OCI_NEED_DATA. The memory of these client library- allocated buffers must be 
+freed when not in use anymore by using the OCIObjectFreee() call.
+Parameters
+bindp ( IN/OUT) - the bind handle returned by the call to OCIBindByName() 
+or OCIBindByPos(). 
+errhp ( IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+type ( IN) - points to the TDO which describes the type of the program 
+variable being bound. Retrieved by calling OCITypeByName().
+pgvpp ( IN/OUT) - points to a pointer to the program variable buffer. For an 
+array, pgvpp points to an array of pointers. When the bind variable is also an 
+OUT variable, the OUT Named Data Type value or REF is allocated 
+(unpickled) in the Object Cache, and a pointer to the value or REF is returned,
+At the end of execute, when all OUT values have been received, pgvpp points 
+to an array of pointer(s) to these newly allocated named data types in the 
+object cache. 
+pgvpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the Named 
+Data Type buffers are requested at runtime. For static array binds, skip 
+factors may be specified using the OCIBindArrayOfStruct() call. The skip 
+factors are used to compute the address of the next pointer to the value, the 
+indicator structure and their sizes.
+pvszsp ( IN/OUT) - points to the size of the program variable. The size of the 
+named data type is not required on input. For an array, pvszsp is an array of 
+ub4s. On return, for OUT bind variables, this points to size(s) of the Named 
+Data Types and REFs received. pvszsp is ignored if the OCI_DATA_AT_EXEC 
+mode is set. Then the size of the buffer is taken at runtime.
+indpp ( IN/OUT) - points to a pointer to the program variable buffer 
+containing the parallel indicator structure. For an array, points to an array of 
+pointers. When the bind variable is also an OUT bind variable, memory is 
+allocated in the object cache, to store the unpickled OUT indicator values. At 
+the end of the execute when all OUT values have been received, indpp points 
+to the pointer(s) to these newly allocated indicator structure(s). 
+indpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator 
+is requested at runtime.
+indszp ( IN/OUT) - points to the size of the IN indicator structure program 
+variable. For an array, it is an array of sb2s. On return for OUT bind variables, 
+this points to size(s) of the received OUT indicator structures.
+indszp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator 
+size is requested at runtime.
+Related Functions
+OCIAttrGet()
+
+
+
+----------------------------------OCIBreak------------------------------------
+
+
+
+OCIBreak()
+Name
+OCI Break
+Purpose
+This call performs an immediate (asynchronous) abort of any currently 
+executing OCI function that is associated with a server .
+Syntax
+sword OCIBreak ( dvoid      *hndlp,
+                 OCIError   *errhp);
+Comments
+This call performs an immediate (asynchronous) abort of any currently 
+executing OCI function that is associated with a server. It is normally used 
+to stop a long-running OCI call being processed on the server.
+This call can take either the service context handle or the server context 
+handle as a parameter to identify the function to be aborted.
+Parameters
+hndlp (IN) - the service context handle or the server context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+Related Functions
+
+-----------------------------OCIConnectionPoolCreate --------------------------
+Name:
+OCIConnectionPoolCreate
+
+Purpose:
+Initializes the Connection Pool
+
+Syntax:
+OCIConnectionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCICPool *poolhp,
+                         OraText **poolName, sb4 *poolNameLen,
+                         CONST Oratext *dblink, sb4 dblinkLen,
+                         ub4 connMin, ub4 connMax, ub4 connIncr,
+                         CONST OraText *poolUsername, sb4 poolUserLen,
+                         CONST OraText *poolPassword, sb4 poolPassLen, ub4 mode)
+Comments:
+This call is used to create a connection pool. conn_min connections
+to the database are started on calling OCIConnectionPoolCreate.
+
+Parameters:
+envhp (IN/OUT)  - A pointer to the environment where the Conencton Pool
+                  is to be created
+errhp (IN/OUT)  - An error handle which can be passed to OCIErrorGet().
+poolhp (IN/OUT) - An uninitialiazed pool handle.
+poolName (OUT) - The connection pool name. 
+poolNameLen (OUT) - The length of the connection pool name 
+dblink (IN/OUT) - Specifies the database(server) to connect. This will also
+                  be used as the default pool name.
+dblinkLen (IN)  - The length of the string pointed to by dblink.
+connMin (IN)    - Specifies the minimum number of connections in the
+                  Connection Pool at any instant.
+                  connMin number of connections are started when
+                  OCIConnectionPoolCreate() is called.
+connMax (IN)    - Specifies the maximum number of connections that can be
+                  opened to the database. Once this value is reached, no
+                  more connections are opened.
+connIncr (IN)   - Allows application to set the next increment for
+                  connections to be opened to the database if the current
+                  number of connections are less than conn_max.
+poolUsername (IN/OUT) - Connection pooling requires an implicit proxy
+                         session and this attribute provides a username
+                         for that session.
+poolUserLen (IN) - This represents the length of pool_username.
+poolPassword (IN/OUT) - The password for the parameter pool_username passed
+                        above.
+poolPassLen (IN) - This represents the length of pool_password.
+
+mode (IN) - The modes supported are OCI_DEFAULT and OCI_REINITIALIZE
+
+Related Functions
+OCIConnectionPoolDestroy()
+---------------------------------------------------------------------------
+
+----------------------------OCIConnectionPoolDestroy-------------------------
+Name:
+OCIConnectionPoolDestroy
+
+Purpose:
+Destroys the Connection Pool.
+
+Syntax:
+OCIConnectionPoolDestroy (OCICPool *poolhp, OCIError *errhp, ub4 mode)
+
+Comments:
+On calling OCIConnectionPoolDestroy, all the open connections in the pool
+are closed and the pool is destroyed.
+
+Parameters:
+poolhp (IN/OUT) - An uninitialiazed pool handle.
+errhp (IN/OUT)  - An error handle which can be passed to OCIErrorGet().
+mode (IN)       - Currently, OCIConnectionPoolDestroy() will support only
+                  the OCI_DEFAULT mode.
+
+Related Functions:
+OCIConnectionPoolCreate()
+
+-----------------------------------------------------------------------------
+----------------------------OCISessionPoolCreate-----------------------------
+Name:
+OCISessionPoolCreate
+
+Purpose:
+Creates the sessions in the session pool.
+
+Syntax:
+sword OCISessionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCISpool *spoolhp,
+                      OraText **poolName, ub4 *poolNameLen,
+                      CONST OraText *connStr, ub4 connStrLen,
+                      ub4 sessMin, ub4 sessMax, ub4 sessIncr,
+                      OraText *userid,  ub4 useridLen,
+                      OraText *password, ub4 passwordLen,
+                      ub4 mode)
+
+Comments:
+When OCISessionPoolCreate is called, a session pool is initialized for
+the associated environment and the database specified by the
+connStr parameter. This pool is named uniquely and the name
+is returned to the user in the poolname parameter.
+
+Parameters:
+envhp (IN/OUT) - A pointer to the environment handle in which the session
+                 pool needs to be created.
+errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet().
+spoolhp (IN/OUT) - A pointer to the session pool handle that is created.
+poolName (OUT) - Session pool name returned to the user.
+poolNameLen (OUT) - Length of the PoolName
+connStr (IN) - The TNS alias of the database to connect to.
+connStrLen (IN) - Length of the connStr.
+sessMin (IN) - Specifies the minimum number of sessions in the Session Pool.
+               These are the number of sessions opened in the beginning, if
+               in Homogeneous mode. Else, the parameter is ignored.
+sessMax (IN) - Specifies the maximum number of sessions in the Session Pool.
+               Once this value is reached, no more sessions are opened,
+               unless the OCI_ATTR_SPOOL_FORCEGET is set.
+userid (IN) - Specifies the userid with which to start up the sessions.
+useridLen (IN) - Length of userid.
+password (IN) - Specifies the password for the corresponding userid.
+passwordLen (IN) - Specifies the length of the password
+mode(IN) - May be OCI_DEFAULT, OCI_SPC_SPOOL_REINITIALIZE, or
+           OCI_SPC_SPOOL_HOMOGENEOUS.
+
+Returns:
+SUCCESS - If pool could be allocated and created successfully.
+ERROR - If above conditions could not be met.
+
+Related Functions:
+OCISessionPoolDestroy()
+-----------------------------------------------------------------------------
+-----------------------------OCISessionPoolDestroy---------------------------
+Name:
+OCISessionPoolDestroy
+
+Purpose:
+Terminates all the sessions in the session pool.
+
+Syntax:
+sword OCISessionPoolDestroy (OCISPool *spoolhp, OCIError *errhp, ub4 mode)
+
+Comments:
+spoolhp (IN/OUT) - The pool handle of the session pool to be destroyed.
+errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet().
+mode (IN) - Currently only OCI_DEFAULT mode is supported.
+
+Returns:
+SUCCESS - All the sessions could be closed.
+ERROR - If the above condition is not met.
+
+Related Functions:
+OCISessionPoolCreate()
+-----------------------------------------------------------------------------
+-------------------------------OCISessionGet---------------------------------
+Name:
+OCISessionGet
+
+Purpose:
+Get a session. This could be from a session pool, connection pool or
+a new standalone session.
+
+Syntax:
+sword OCISessionGet(OCIenv *envhp, OCIError *errhp, OCISvcCtx **svchp,
+                    OCIAuthInfo *authhp,
+                    OraText *poolName, ub4 poolName_len,
+                    CONST OraText *tagInfo, ub4 tagInfo_len,
+                    OraText **retTagInfo, ub4 *retTagInfo_len,
+                    boolean *found,
+                    ub4 mode)
+
+Comments:
+envhp (IN/OUT) - OCI environment handle.
+errhp (IN/OUT) - OCI error handle to be passed to OCIErrorGet().
+svchp (IN/OUT) - Address of an OCI service context pointer. This will be
+                 filled with a server and session handle, attached to the
+                 pool.
+authhp (IN/OUT) - OCI Authentication Information handle.
+poolName (IN) - This indicates the session/connection pool to get the
+                session/connection from in the OCI_SPOOL/OCI_CPOOL mode.
+                In the OCI_DEFAULT mode it refers to the connect string.
+poolName_len (IN) - length of poolName.
+tagInfo (IN) - indicates the tag of the session that the user wants. If the
+                   user wants a default session, he must specify a NULL here.
+                   Only used for Session Pooling.
+tagInfo_len (IN) - the length of tagInfo.
+retTagInfo (OUT) - This indicates the type of session that is returned to
+                   the user. Only used for Session Pooling.
+retTagInfo_len (OUT) - the length of retTagInfo.
+found (OUT) - set to true if the user gets a session he had requested, else
+              set to false. Only used for Session Pooling.
+mode (IN) - The supported modes are OCI_DEFAULT, OCI_CRED_PROXY and
+            OCI_GET_SPOOL_MATCHANY, OCI_SPOOL and OCI_CPOOL. OCI_SPOOL and
+            OCI_CPOOL are mutually exclusive.
+
+Returns:
+SUCCESS -  if a session was successfully returned into svchp.
+SUCCESS_WITH_INFO - if a session was successfully returned into svchp and the
+                    total number of sessions > maxsessions. Only valid for
+                    Session Pooling.
+ERROR - If a session could not be retrieved.
+
+Related Functions:
+OCISessionRelease()
+-----------------------------------------------------------------------------
+---------------------------OCISessionRelease---------------------------------
+Name:
+OCISessionRelease
+
+Purpose:
+Release the session.
+
+Syntax:
+sword OCISessionRelease ( OCISvcCtx *svchp, OCIError *errhp,
+                          OraText *tag, ub4 tag_len,
+                          ub4 mode);
+
+Comments:
+svchp (IN/OUT) - The service context associated with the session/connection.
+errhp (IN/OUT) - OCI error handle to be passed to OCIErrorGet().
+tag (IN) - Only used for Session Pooling.
+           This parameter will be ignored unless mode OCI_RLS_SPOOL_RETAG is
+           specified. In this case, the session is labelled with this tag and
+           returned to the pool. If this is NULL, then the session is untagged.
+tag_len (IN) - Length of the tag. This is ignored unless mode 
+               OCI_RLS_SPOOL_RETAG is set.
+mode (IN) - The supported modes are OCI_DEFAULT, OCI_RLS_SPOOL_DROPSESS,
+            OCI_RLS_SPOOL_RETAG. The last 2 are only valid for Session Pooling.
+            When OCI_RLS_SPOOL_DROPSESS is specified, the session
+            will be removed from the session pool. If OCI_RLS_SPOOL_RETAG is 
+            set, the tag on the session will be altered. If this mode is not 
+            set, the tag and tag_len parameters will be ignored.
+
+Returns:
+ERROR - If the session could not be released successfully.
+SUCCESS - In all other cases.
+
+Related Functions:
+OCISessionGet().
+
+-----------------------------------------------------------------------------
+------------------------------OCIDateTimeAssign --------------------------
+sword OCIDateTimeAssign(dvoid *hndl, OCIError *err, CONST OCIDateTime *from, 
+			 OCIDateTime *to);
+NAME: OCIDateTimeAssign - OCIDateTime Assignment
+PARAMETERS:
+hndl (IN) - Session/Env handle.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+from (IN) - datetime to be assigned
+to (OUT) - lhs of assignment
+DESCRIPTION:
+        Performs date assignment. The type of the output will be same as that
+	of input
+
+------------------------------OCIDateTimeCheck--------------------
+sword OCIDateTimeCheck(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 
+		 ub4 *valid );
+NAME: OCIDateTimeCheck - OCIDateTime CHecK if the given date is valid
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date (IN) - date to be checked
+type (IN) - type of the input datetime(OCI_DATE, OCI_TIME, 
+				OCI_TIMESTAMP,	OCI_TZTIMESTAMP, OCI_TZTIME)
+valid (OUT) -  returns zero for a valid date, otherwise 
+  		the ORed combination of all error bits specified below:
+   Macro name                   Bit number      Error
+   ----------                   ----------      -----
+   OCI_DATE_INVALID_DAY         0x1             Bad day
+   OCI_DATE_DAY_BELOW_VALID     0x2             Bad DAy Low/high bit (1=low)
+   OCI_DATE_INVALID_MONTH       0x4             Bad MOnth
+   OCI_DATE_MONTH_BELOW_VALID   0x8             Bad MOnth Low/high bit (1=low)
+   OCI_DATE_INVALID_YEAR        0x10            Bad YeaR
+   OCI_DATE_YEAR_BELOW_VALID    0x20            Bad YeaR Low/high bit (1=low)
+   OCI_DATE_INVALID_HOUR        0x40            Bad HouR
+   OCI_DATE_HOUR_BELOW_VALID    0x80            Bad HouR Low/high bit (1=low)
+   OCI_DATE_INVALID_MINUTE      0x100           Bad MiNute
+   OCI_DATE_MINUTE_BELOW_VALID	0x200           Bad MiNute Low/high bit (1=low)
+   OCI_DATE_INVALID_SECOND      0x400           Bad SeCond
+   OCI_DATE_SECOND_BELOW_VALID  0x800           bad second Low/high bit (1=low)
+   OCI_DATE_DAY_MISSING_FROM_1582 0x1000        Day is one of those "missing"
+                                                from 1582
+   OCI_DATE_YEAR_ZERO           0x2000          Year may not equal zero
+   OCI_DATE_INVALID_TIMEZONE    0x4000          Bad Timezone
+   OCI_DATE_INVALID_FORMAT      0x8000          Bad date format input
+
+   So, for example, if the date passed in was 2/0/1990 25:61:10 in
+   (month/day/year hours:minutes:seconds format), the error returned
+   would be OCI_DATE_INVALID_DAY | OCI_DATE_DAY_BELOW_VALID |
+   OCI_DATE_INVALID_HOUR | OCI_DATE_INVALID_MINUTE
+
+DESCRIPTION:
+  	Check if the given date is valid.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+  	  'date' and 'valid' pointers are NULL pointers
+
+------------------------------- OCIDateTimeCompare-------------------------
+sword OCIDateTimeCompare(dvoid *hndl, OCIError *err, CONST OCIDateTime *date1, 
+                     CONST OCIDateTime *date2,  sword *result );
+NAME: OCIDateTimeCompare - OCIDateTime CoMPare dates
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date1, date2 (IN) - dates to be compared
+type (IN)  - Type of datetime to be compared. Both input datetimes
+			should be of same type.(OCI_DATE, OCI_TIME, 
+				OCI_TIMESTAMP, OCI_TZTIMESTAMP, OCI_TZTIME)
+result (OUT) - comparison result, 0 if equal, -1 if date1 < date2, 
+  		1 if date1 > date2
+DESCRIPTION:
+The function OCIDateCompare compares two dates. It returns -1 if 
+date1 is smaller than date2, 0 if they are equal, and 1 if date1 is 
+greater than date2.
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+  	  invalid date
+	  input dates are not mutually comparable
+
+------------------------------OCIDateTimeConvert----------------------
+sword OCIDateTimeConvert(dvoid *hndl, OCIError *err, OCIDateTime *indate, 
+				OCIDateTime *outdate);
+NAME: OCIDateTimeConvert - Conversion between different DATETIME types
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+indate (IN) - pointer to input date
+outdate (OUT) - pointer to output datetime 
+DESCRIPTION: Converts one datetime type to another. The result type is
+       the type of the 'outdate' descriptor.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+	OCI_ERROR if
+	    conversion not possible.
+   
+---------------------------- OCIDateTimeFromText-----------------------
+sword OCIDateTimeFromText(dvoid *hndl, OCIError *err, CONST OraText *date_str, 
+                     size_t d_str_length, CONST OraText *fmt, ub1 fmt_length, 
+                     CONST OraText *lang_name, size_t lang_length, 
+                     OCIDateTime *date );
+NAME: OCIDateTimeFromText - OCIDateTime convert String FROM Date
+PARAMETERS:
+hndl (IN) - Session/Env handle. If Session Handle is passed, the 
+		    conversion takes place in session NLS_LANGUAGE and
+		    session NLS_CALENDAR, otherwise the default is used.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date_str (IN) - input string to be converted to Oracle date
+d_str_length (IN) - size of the input string, if the length is -1
+  		then 'date_str' is treated as a null terminated  string
+fmt (IN) - conversion format; if 'fmt' is a null pointer, then
+                the string is expected to be in the default format for
+		the datetime type.
+fmt_length (IN) - length of the 'fmt' parameter
+lang_name (IN) - language in which the names and abbreviations of
+  	        days and months are specified, if null i.e. (OraText *)0,
+  		the default language of session is used, 
+lang_length (IN) - length of the 'lang_name' parameter
+date (OUT) - given string converted to date
+DESCRIPTION:
+  	Converts the given string to Oracle datetime type set in the 
+        OCIDateTime descriptor according to the specified format. Refer to 
+        "TO_DATE" conversion function described in "Oracle SQL Language 
+        Reference Manual" for a description of format.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+  	  invalid format
+  	  unknown language
+  	  invalid input string
+
+--------------------------- OCIDateTimeGetDate-------------------------
+void OCIDateTimeGetDate(dvoid *hndl, OCIError *err,  CONST OCIDateTime *date, 
+		 sb2 *year, ub1 *month, ub1 *day );
+NAME: OCIDateTimeGetDate - OCIDateTime Get Date (year, month, day)  
+				portion of DATETIME. 
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - Pointer to OCIDateTime 
+year      (OUT) - year value
+month     (OUT) - month value
+day       (OUT) - day value
+
+--------------------------- OCIDateTimeGetTime ------------------------
+void OCIDateTimeGetTime(dvoid *hndl, OCIError *err, OCIDateTime *datetime, 
+		 ub1 *hour, ub1 *min, ub1 *sec, ub4 *fsec);
+NAME: OCIDateTimeGetTime - OCIDateTime Get Time (hour, min, second, 
+			fractional second)  of DATETIME. 
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - Pointer to OCIDateTime 
+hour      (OUT) - hour value
+min       (OUT) - minute value
+sec       (OUT) - second value
+fsec      (OUT) - Fractional Second value
+
+--------------------------- OCIDateTimeGetTimeZoneOffset ----------------------
+sword OCIDateTimeGetTimeZoneOffset(dvoid *hndl,OCIError *err,CONST 
+              OCIDateTime *datetime,sb1 *hour,sb1  *minute);
+ 
+NAME: OCIDateTimeGetTimeZoneOffset - OCIDateTime Get TimeZone (hour, minute)  
+                         portion of DATETIME. 
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - Pointer to OCIDateTime 
+hour      (OUT) - TimeZone Hour value
+minute     (OUT) - TimeZone Minute value
+ 
+
+------------------------------OCIDateTimeIntervalAdd----------------------
+sword OCIDateTimeIntervalAdd(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+	 OCIInterval *inter, OCIDateTime *outdatetime);
+NAME: OCIDateTimeIntervalAdd - Adds an interval to datetime
+PARAMETERS:
+hndl (IN) - Session/Env handle.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - pointer to input datetime
+inter    (IN) - pointer to interval 
+outdatetime (IN) - pointer to output datetime. The output datetime 
+				will be of same type as input datetime
+DESCRIPTION: 
+	Adds an interval to a datetime to produce a resulting datetime
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+	OCI_ERROR if:
+		resulting date is before Jan 1, -4713
+		resulting date is after Dec 31, 9999
+
+------------------------------OCIDateTimeIntervalSub----------------------
+sword OCIDateTimeIntervalSub(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+	 OCIInterval *inter, OCIDateTime *outdatetime);
+NAME: OCIDateTimeIntervalSub - Subtracts an interval from a datetime
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - pointer to input datetime
+inter    (IN) - pointer to interval 
+outdatetime (IN) - pointer to output datetime. The output datetime 
+				will be of same type as input datetime
+DESCRIPTION: 
+ 	Subtracts an interval from a datetime and stores the result in a
+     	datetime
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+	OCI_ERROR if:
+		resulting date is before Jan 1, -4713
+		resulting date is after Dec 31, 9999
+
+--------------------------- OCIDateTimeConstruct-------------------------
+sword OCIDateTimeConstruct(dvoid  *hndl,OCIError *err,OCIDateTime *datetime,
+               sb2 year,ub1 month,ub1 day,ub1 hour,ub1 min,ub1 sec,ub4 fsec,
+               OraText  *timezone,size_t timezone_length);
+
+   NAME: OCIDateTimeConstruct - Construct an OCIDateTime. Only the relevant
+       fields for the OCIDateTime descriptor types are used.
+   PARAMETERS:
+        hndl (IN) - Session/Env handle. 
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        datetime (IN) - Pointer to OCIDateTime 
+        year      (IN) - year value
+        month     (IN) - month value
+        day       (IN) - day value        
+        hour      (IN) - hour value
+        min       (IN) - minute value
+        sec       (IN) - second value
+        fsec      (IN) - Fractional Second value
+        timezone  (IN) - Timezone string
+        timezone_length(IN) - Length of timezone string
+DESCRIPTION:
+       Constructs a DateTime descriptor. The type of the datetime is the
+       type of the OCIDateTime descriptor. Only the relevant fields based
+       on the type are used. For Types with timezone, the date and time
+       fields are assumed to be in the local time of the specified timezone.
+       If timezone is not specified, then session default timezone is
+       assumed.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_ERROR if datetime is not valid.
+--------------------------- OCIDateTimeSysTimeStamp---------------------
+sword OCIDateTimeSysTimeStamp(dvoid *hndl, OCIError *err, 
+              OCIDateTime *sys_date );
+ 
+NAME: OCIDateTimeSysTimeStamp - Returns system date/time as a TimeStamp with 
+                      timezone
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+sys_date (OUT) - Pointer to output timestamp
+ 
+DESCRIPTION: 
+        Gets the system current date and time as a timestamp with timezone
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+ 
+
+------------------------------OCIDateTimeSubtract-----------------------
+sword OCIDateTimeSubtract(dvoid *hndl, OCIError *err, OCIDateTime *indate1, 
+		OCIDateTime *indate2,	OCIInterval *inter);
+NAME: OCIDateTimeSubtract - subtracts two datetimes to return an interval
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+indate1(IN) - pointer to subtrahend
+indate2(IN) - pointer to minuend
+inter  (OUT) - pointer to output interval
+DESCRIPTION: 
+	Takes two datetimes as input and stores their difference in an 
+        interval. The type of the result interval is the type of the 
+        'inter' descriptor.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+	OCI_ERROR if
+	   datetimes are not comparable.
+
+--------------------------- OCIDateTimeToText--------------------------
+sword OCIDateTimeToText(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 
+                        CONST OraText *fmt, ub1 fmt_length, ub1 fsprec,
+                        CONST OraText *lang_name, size_t lang_length, 
+                        ub4 *buf_size, OraText *buf );
+NAME: OCIDateTimeToText - OCIDateTime convert date TO String 
+PARAMETERS:
+hndl (IN) - Session/Env handle. If Session Handle is passed, the 
+		    conversion takes place in session NLS_LANGUAGE and
+		    session NLS_CALENDAR, otherwise the default is used.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date (IN) - Oracle datetime to be converted
+fmt (IN) - conversion format, if null string pointer (OraText*)0, then
+                the date is converted to a character string in the
+                default format for that type.
+fmt_length (IN) - length of the 'fmt' parameter
+fsprec (IN) - specifies the fractional second precision in which the
+               fractional seconds is returned.
+lang_name (IN) - specifies the language in which the names and 
+  	        abbreviations of months and days are returned;
+  	        default language of session is used if 'lang_name' 
+  		is null i.e. (OraText *)0
+lang_length (IN) - length of the 'nls_params' parameter
+buf_size (IN/OUT) - size of the buffer; size of the resulting string
+                is returned via this parameter
+buf (OUT) - buffer into which the converted string is placed
+DESCRIPTION:
+        Converts the given date to a string according to the specified format.
+        Refer to "TO_DATE" conversion function described in
+        "Oracle SQL Language Reference Manual" for a description of format
+        and NLS arguments. The converted null-terminated date string is
+        stored in the buffer 'buf'.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+  	  buffer too small
+  	  invalid format
+  	  unknown language
+          overflow error
+
+----------------------------OCIDateTimeGetTimeZoneName------------------------
+sword OCIDateTimeGetTimeZoneName(dvoid *hndl, 
+                                 OCIError *err,
+                                 CONST OCIDateTime *datetime,
+                                 ub1 *buf,
+                                 ub4 *buflen);
+NAME OCIDateTimeGetTimeZoneName - OCI DateTime Get the Time Zone Name
+PARAMETERS:
+hndl (IN)      - Session/Env handle.
+err (IN/OUT)   - error handle. If there is an error, it is
+                 recorded in 'err' and this function returns OCI_ERROR.
+                 The error recorded in 'err' can be retrieved by calling
+                 OCIErrorGet().
+datetime (IN)   - Pointer to an OCIDateTime.
+buf (OUT)       - User allocated storage for name string.
+buflen (IN/OUT) - length of buf on input, length of name on out
+DESCRIPTION:
+        Returns either the timezone region name or the absolute hour and minute
+        offset. If the DateTime was created with a region id then the region 
+        name will be returned in the buf.  If the region id is zero, then the 
+        hour and minute offset is returned as "[-]HH:MM".
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+       OCI_INVALID_HANDLE if 'err' is NULL.
+       OCI_ERROR if
+         buffer too small
+         error retrieving timezone data
+         invalid region 
+         invalid LdiDateTime type
+
+----------------------------OCIDateTimeFromArray-------------------------------
+sword OCIDateTimeFromArray(dvoid *hndl, 
+                         OCIError *err,
+                         ub1 *inarray,
+                         ub4 len
+                         ub1 type
+                         OCIDateTime *datetime,
+                         OCIInterval *reftz,
+                         ub1 fsprec);
+NAME OCIDateTimeFromArray - OCI DateTime convert From Array format
+PARAMETERS:
+hndl (IN)      - Session/Env handle.
+err (IN/OUT)   - error handle. If there is an error, it is
+                 recorded in 'err' and this function returns OCI_ERROR.
+                 The error recorded in 'err' can be retrieved by calling
+                 OCIErrorGet().
+inarray (IN)   - Pointer to input array representtion of DateTime
+len (IN)       - len of inarray.
+type (IN)      - One of SQLT_DATE, SQLT_TIME, SQLT_TIME_TZ, SQLT_TIMESTAMP,
+                 SQLT_TIMESTAMP_TZ, or SQLT_TIMESTAMP_LTZ.
+datetime (OUT) - Pointer to the result OCIDateTime.
+reftz (IN)     - timezone interval used with SQLT_TIMESTAMP_LTZ.
+fsprec (IN)    - fractionl seconds digits of precision (0-9).
+DESCRIPTION:
+        Returns a pointer to an OCIDateTime of type type converted from 
+        the inarray.
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+       OCI_INVALID_HANDLE if 'err' is NULL.
+       OCI_ERROR if
+         buffer too small
+         error retrieving timezone data
+         invalid region 
+         invalid LdiDateTime type
+
+-----------------------------OCIDateTimeToArray------------------------------
+sword OCIDateTimeToArray(dvoid *hndl, 
+                         OCIError *err,
+                         CONST OCIDateTime *datetime,
+                         CONST OCIInterval *reftz,
+                         ub1 *outarray,
+                         ub4 len,
+                         ub1 fsprec);
+NAME OCIDateTimeToArray - OCI DateTime convert To Array format
+PARAMETERS:
+hndl (IN)      - Session/Env handle.
+err (IN/OUT)   - error handle. If there is an error, it is
+                 recorded in 'err' and this function returns OCI_ERROR.
+                 The error recorded in 'err' can be retrieved by calling
+                 OCIErrorGet().
+datetime (IN)  - Pointer to the OCIDateTime to convert.
+reftz (IN)     - Interval defining the timezone for SQLT_TIMESTAMP_LTZ.
+outarray (OUT) - result array.
+len (IN)       - length of outarray.
+fsprec (IN)    - number of fractional seconds digits. 
+DESCRIPTION:
+        Returns an array representing the input DateTime descriptor.
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+       OCI_INVALID_HANDLE if 'err' is NULL.
+       OCI_ERROR if
+         buffer too small
+         error retrieving timezone data
+         invalid region 
+         invalid LdiDateTime type
+
+----------------------------------OCIRowidToChar-----------------------------
+Name
+OCIRowidToChar
+
+Purpose
+Converts physical/logical (universal) ROWID to chracter extended (Base 64)
+representation into user provided buffer outbfp of length outbflp. After
+execution outbflp contains amount of bytes converted.In case of truncation
+error, outbflp contains required size to make this conversion successful
+and returns ORA-1405.
+
+Syntax
+sword OCIRowidToChar( OCIRowid *rowidDesc,
+                      OraText *outbfp,
+                      ub2 *outbflp,
+                      OCIError *errhp)
+
+Comments
+After this conversion, ROWID in character format can be bound using
+OCIBindByPos or OCIBindByName call and used to query a row at a
+desired ROWID.
+
+Parameters
+rowidDesc (IN)   - rowid DESCriptor which is allocated from OCIDescritorAlloc
+                   and populated by a prior SQL statement execution
+outbfp (OUT)     - pointer to the buffer where converted rowid in character
+                   representation is stored after successful execution.
+outbflp (IN/OUT) - pointer to output buffer length variable.
+                   Before execution (IN mode) *outbflp contains the size of
+                   outbfp, after execution (OUT mode) *outbflp contains amount
+                   of bytes converted. In an event of truncation during
+                   conversion *outbflp contains the required length to make
+                   conversion successful.
+errhp (IN/OUT)   - an error handle which can be passed to OCIErrorGet() for
+                   diagnostic information in the event of an error.
+
+------------------------------OCIDefineArrayOfStruct--------------------------
+
+
+OCIDefineArrayOfStruct()
+Name
+OCI Define for Array of Structures
+Purpose
+This call specifies additional attributes necessary for a static array define.
+Syntax
+sword OCIDefineArrayOfStruct ( OCIDefine   *defnp,
+                             OCIError    *errhp,
+                             ub4         pvskip, 
+                             ub4         indskip, 
+                             ub4         rlskip,
+                             ub4         rcskip );
+Comments
+This call specifies additional attributes necessary for an array define, used in 
+an array of structures (multi-row, multi-column) fetch.
+For more information about skip parameters, see the section "Skip Parameters" 
+on page 4-17.
+Parameters
+defnp (IN) - the handle to the define structure which was returned by a call 
+to OCIDefineByPos().
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+pvskip (IN) - skip parameter for the next data value.
+indskip (IN) - skip parameter for the next indicator location. 
+rlskip (IN) - skip parameter for the next return length value.
+rcskip (IN) - skip parameter for the next return code.
+Related Functions
+OCIAttrGet()
+
+
+
+
+
+OCIDefineByPos()
+Name
+OCI Define By Position
+Purpose
+Associates an item in a select-list with the type and output data buffer. 
+Syntax
+sb4 OCIDefineByPos ( 
+              OCIStmt     *stmtp, 
+              OCIDefine   **defnp,
+              OCIError    *errhp,
+              ub4         position,
+              dvoid       *valuep,
+              sb4         value_sz,
+              ub2         dty,
+              dvoid       *indp,
+              ub2         *rlenp,
+              ub2         *rcodep,
+              ub4         mode );
+Comments
+This call defines an output buffer which will receive data retreived from 
+Oracle. The define is a local step which is necessary when a SELECT statement 
+returns data to your OCI application.
+This call also implicitly allocates the define handle for the select-list item.
+Defining attributes of a column for a fetch is done in one or more calls. The 
+first call is to OCIDefineByPos(), which defines the minimal attributes 
+required to specify the fetch. 
+This call takes as a parameter a define handle, which must have been 
+previously allocated with a call to OCIHandleAlloc().
+Following the call to OCIDefineByPos() additional define calls may be 
+necessary for certain data types or fetch modes:
+A call to OCIDefineArrayOfStruct() is necessary to set up skip parameters 
+for an array fetch of multiple columns.
+A call to OCIDefineObject() is necessary to set up the appropriate 
+attributes of a named data type fetch. In this case the data buffer pointer 
+in ocidefn() is ignored.
+Both OCIDefineArrayOfStruct() and OCIDefineObject() must be called 
+after ocidefn() in order to fetch multiple rows with a column of named 
+data types.
+For a LOB define, the buffer pointer must be a lob locator of type 
+OCILobLocator , allocated by the OCIDescAlloc() call. LOB locators, and not 
+LOB values, are always returned for a LOB column. LOB values can then be 
+fetched using OCI LOB calls on the fetched locator.
+For NCHAR (fixed and varying length), the buffer pointer must point to an 
+array of bytes sufficient for holding the required NCHAR characters. 
+Nested table columns are defined and fetched like any other named data type. 
+If the mode parameter is this call is set to OCI_DYNAMIC_FETCH, the client 
+application can fetch data dynamically at runtime.
+Runtime data can be provided in one of two ways:
+callbacks using a user-defined function which must be registered with a 
+subsequent call to OCIDefineDynamic(). When the client library needs a 
+buffer to return the fetched data, the callback will be invoked and the 
+runtime buffers provided will return a piece or the whole data. 
+a polling mechanism using calls supplied by the OCI. This mode is 
+assumed if no callbacks are defined. In this case, the fetch call returns the 
+OCI_NEED_DATA error code, and a piecewise polling method is used 
+to provide the data.
+Related Functions: For more information about using the 
+OCI_DYNAMIC_FETCH mode, see the section "Runtime Data 
+Allocation and Piecewise Operations" on page 5-16 of Volume 1..
+For more information about the define step, see the section "Defining" 
+on page 2-30.
+Parameters
+stmtp (IN) - a handle to the requested SQL query operation.
+defnp (IN/OUT) - a pointer to a pointer to a define handle which is implicitly 
+allocated by this call.  This handle is used to  store the define information 
+for this column.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+position (IN) - the position of this value in the select list. Positions are 
+1-based and are numbered from left to right. For example, in the SELECT 
+statement
+SELECT empno, ssn, mgrno FROM employees;
+empno is at position 1, ssn is at position 2, and mgrno is at position 3.
+valuep (IN/OUT) - a pointer to a buffer or an array of buffers of the type 
+specified in the dty parameter. A number of buffers can be specified when 
+results for more than one row are desired in a single fetch call.
+value_sz (IN) - the size of each valuep buffer in bytes. If the data is stored 
+internally in VARCHAR2 format, the number of characters desired, if different 
+from the buffer size in bytes, may be additionally specified by the using 
+OCIAttrSet(). 
+In an NLS conversion environment, a truncation error will be generated if the 
+number of bytes specified is insufficient to handle the number of characters 
+desired.
+dty (IN) - the data type. Named data type (SQLT_NTY) and REF (SQLT_REF) 
+are valid only if the environment has been intialized with in object mode. 
+indp - pointer to an indicator variable or array. For scalar data types, 
+pointer to sb2 or an array of sb2s. Ignored for named data types. For named 
+data types, a pointer to a named data type indicator structure or an array of 
+named data type indicator structures is associated by a subsequent 
+OCIDefineObject() call. 
+See the section "Indicator Variables" on page 2-43 for more information about 
+indicator variables.
+rlenp (IN/OUT) - pointer to array of length of data fetched. Each element in 
+rlenp is the length of the data in the corresponding element in the row after 
+the fetch. 
+rcodep (OUT) - pointer to array of column-level return codes
+mode (IN) - the valid modes are:
+OCI_DEFAULT. This is the default mode.
+OCI_DYNAMIC_FETCH. For applications requiring dynamically 
+allocated data at the time of fetch, this mode must be used. The user may 
+additionally call OCIDefineDynamic() to set up a callback function that 
+will be invoked to receive the dynamically allocated buffers and to set 
+up the memory allocate/free callbacks and the context for the callbacks. 
+valuep and value_sz are ignored in this mode. 
+Related Functions
+OCIDefineArrayOfStruct(), OCIDefineDynamic(), OCIDefineObject()
+
+
+
+
+OCIDefineDynamic()
+Name
+OCI Define Dynamic Fetch Attributes
+Purpose
+This call is used to set the additional attributes required if the 
+OCI_DYNAMIC_FETCH mode was selected in OCIDefineByPos(). 
+Syntax
+sword OCIDefineDynamic( OCIDefine   *defnp,
+                      OCIError    *errhp,
+                      dvoid       *octxp, 
+                      OCICallbackDefine (ocbfp)(
+                                  dvoid             *octxp,
+                                  OCIDefine         *defnp,
+                                  ub4               iter, 
+                                  dvoid             **bufpp,
+                                  ub4               **alenpp,
+                                  ub1               *piecep,
+                                  dvoid             **indpp,
+                                  ub2               **rcodep)  );
+Comments
+This call is used to set the additional attributes required if the 
+OCI_DYNAMIC_FETCH mode has been selected in a call to 
+OCIDefineByPos(). 
+When the OCI_DYNAMIC_FETCH mode is selected, buffers will be 
+dynamically allocated for REF, and named data type, values to receive the 
+data. The pointers to these buffers will be returned. 
+If OCI_DYNAMIC_FETCH mode was selected, and the call to 
+OCIDefineDynamic() is skipped, then the application can fetch data piecewise 
+using OCI calls.
+For more information about OCI_DYNAMIC_FETCH mode, see the section 
+"Runtime Data Allocation and Piecewise Operations" on page 5-16.
+Parameters
+defnp (IN/OUT) - the handle to a define structure returned by a call to 
+OCIDefineByPos().
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+octxp (IN) - points to a context for the callback function. 
+ocbfp (IN) - points to a callback function. This is invoked at runtime to get 
+a pointer to the buffer into which the fetched data or a piece of it will be 
+retreived. The callback also specifies the indicator, the return code and the 
+lengths of the data piece and indicator. The callback has the following 
+parameters:
+octxp (IN) - a context pointer passed as an argument to all the callback 
+functions.
+defnp (IN) - the define handle.
+iter (IN) - which row of this current fetch.
+bufpp (OUT) - returns a pointer to a buffer to store the column value, ie. 
+*bufp points to some appropriate storage for the column value.
+alenpp (OUT) - returns a pointer to the length of the buffer. *alenpp 
+contains the size of the buffer after return from callback. Gets set to 
+actual data size after fetch.
+piecep (IN/OUT) - returns a piece value, as follows:
+The IN value can be OCI_ONE_PIECE, OCI_FIRST_PIECE or 
+OCI_NEXT_PIECE.
+The OUT value can be OCI_ONE_PIECE if the IN value was 
+OCI_ONE_PIECE.
+The OUT value can be OCI_ONE_PIECE or OCI_FIRST_PIECE if 
+the IN value was OCI_FIRST_PIECE.
+The OUT value can only be OCI_NEXT_PIECE or 
+OCI_LAST_PIECE if the IN value was OCI_NEXT_PIECE. 
+indpp (IN) - indicator variable pointer
+rcodep (IN) - return code variable pointer
+Related Functions
+OCIAttrGet()
+OCIDefineObject()
+
+
+
+
+OCIDefineObject()
+Name
+OCI Define Named Data Type attributes
+Purpose
+Sets up additional attributes necessary for a Named Data Type define.
+Syntax
+sword OCIDefineObject ( OCIDefine       *defnp,
+                      OCIError        *errhp,
+                      CONST OCIType   *type,
+                      dvoid           **pgvpp, 
+                      ub4             *pvszsp, 
+                      dvoid           **indpp, 
+                      ub4             *indszp );
+Comments
+This call sets up additional attributes necessary for a Named Data Type define.An error will be returned if this function is called when the OCI environment 
+has been initialized in non-Object mode.
+This call takes as a paramter a type descriptor object (TDO) of datatype 
+OCIType for the named data type being defined.  The TDO can be retrieved 
+with a call to OCITypeByName().
+See the description of OCIInitialize() on page 13 - 43 for more information 
+about initializing the OCI process environment.
+Parameters
+defnp (IN/OUT) - a define handle previously allocated in a call to 
+OCIDefineByPos(). 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+type (IN, optional) - points to the Type Descriptor Object (TDO) which 
+describes the type of the program variable. Only used for program variables 
+of type SQLT_NTY. This parameter is optional, and may be passed as NULL 
+if it is not being used.
+pgvpp (IN/OUT) - points to a pointer to a program variable buffer. For an 
+array, pgvpp points to an array of pointers. Memory for the fetched named data 
+type instance(s) is dynamically allocated in the object cache. At the end of the 
+fetch when all the values have been received, pgvpp points to the pointer(s) to
+these newly allocated named data type instance(s). The application must call 
+OCIObjectMarkDel() to deallocate the named data type instance(s) when they 
+are no longer needed. 
+pvszsp (IN/OUT) - points to the size of the program variable. For an array, it 
+is an array of ub4s. On return points to the size(s) of unpickled fetched 
+values.
+indpp (IN/OUT) - points to a pointer to the program variable buffer 
+containing the parallel indicator structure. For an array, points to an array 
+of pointers. Memory is allocated to store the indicator structures in the 
+object cache. At the end of the fetch when all values have been received, 
+indpp points to the pointer(s) to these newly allocated indicator structure(s).
+indszp (IN/OUT) - points to the size(s) of the indicator structure program 
+variable. For an array, it is an array of ub4s. On return points to the size(s)
+of the unpickled fetched indicator values.
+Related Functions
+OCIAttrGet()
+
+
+
+OCIDescAlloc()
+Name
+OCI Get DESCriptor or lob locator
+Purpose
+Allocates storage to hold certain data types. The descriptors can be used as 
+bind or define variables.
+Syntax
+sword OCIDescAlloc ( CONST dvoid   *parenth,
+                   dvoid         **descpp, 
+                   ub4           type,
+                   size_t        xtramem_sz,
+                   dvoid         **usrmempp);
+Comments
+Returns a pointer to an allocated and initialized structure, corresponding to 
+the type specified in type. A non-NULL descriptor or LOB locator is returned 
+on success. No diagnostics are available on error.
+This call returns OCI_SUCCESS if successful, or OCI_INVALID_HANDLE if 
+an out-of-memory error occurs. 
+Parameters
+parenth (IN) - an environment handle. 
+descpp (OUT) - returns a descriptor or LOB locator of desired type. 
+type (IN) - specifies the type of descriptor or LOB locator to be allocated. 
+The specific types are:
+OCI_DTYPE_SNAP - specifies generation of snapshot descriptor of C 
+type - OCISnapshot
+OCI_DTYPE_LOB - specifies generation of a LOB data type locator of C 
+type - OCILobLocator
+OCI_DTYPE_RSET - specifies generation of a descriptor of C type 
+OCIResult that references a result set (a number of rows as a result of a 
+query). This descriptor is bound to a bind variable of data type 
+SQLT_RSET (result set). The descriptor has to be converted into a 
+statement handle using a function - OCIResultSetToStmt() - which can 
+then be passed to OCIDefineByPos() and OCIStmtFetch() to retrieve the 
+rows of the result set.
+OCI_DTYPE_ROWID - specifies generation of a ROWID descriptor of C 
+type OCIRowid.
+OCI_DTYPE_COMPLEXOBJECTCOMP - specifies generation of a 
+complex object retrieval descriptor of C type 
+OCIComplexObjectComp.
+xtramemsz (IN) - specifies an amount of user memory to be allocated for use 
+by the application. 
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user. 
+Related Functions
+OCIDescFree()
+
+
+
+
+OCIDescFree()
+Name
+OCI Free DESCriptor
+Purpose
+Deallocates a previously allocated descriptor.
+Syntax
+sword OCIDescFree ( dvoid    *descp,
+                  ub4      type);
+Comments
+This call frees up storage associated with the descriptor, corresponding to the
+type specified in type. Returns OCI_SUCCESS or OCI_INVALID_HANDLE. 
+All descriptors must be explicitly deallocated. OCI will not deallocate a 
+descriptor if the environment handle is deallocated.
+Parameters
+descp (IN) - an allocated descriptor. 
+type (IN) - specifies the type of storage to be freed. The specific types are: 
+OCI_DTYPE_SNAP - snapshot descriptor
+OCI_DTYPE_LOB - a LOB data type descriptor
+OCI_DTYPE_RSET - a descriptor that references a result set (a number 
+of rows as a result of a query).
+OCI_DTYPE_ROWID - a ROWID descriptor
+OCI_DTYPE_COMPLEXOBJECTCOMP - a complex object retrieval 
+descriptor
+Related Functions
+OCIDescAlloc()
+
+
+
+OCIDescribeAny()
+Name
+OCI DeSCribe Any
+Purpose
+Describes existing schema objects.
+Syntax
+sword OCIDescribeAny ( OCISvcCtx     *svchp,
+                     OCIError      *errhp,
+                     dvoid         *objptr,
+                     ub4           objptr_len,
+   		     ub1           objptr_typ,
+                     ub1           info_level,
+		     ub1           objtype,
+                     OCIDesc       *dschp );
+Comments
+This is a generic describe call that describes existing schema objects: tables,
+views, synonyms, procedures, functions, packages, sequences, and types. As a 
+result of this call, the describe handle is populated with the object-specific 
+attributes which can be obtained through an OCIAttrGet() call.
+An OCIParamGet() on the describe handle returns a parameter descriptor for a 
+specified position. Parameter positions begin with 1. Calling OCIAttrGet() on 
+the parameter descriptor returns the specific attributes of a stored procedure 
+or function parameter or a table column descriptor as the case may be. 
+These subsequent calls do not need an extra round trip to the server because 
+the entire schema object description cached on the client side by 
+OCIDescribeAny(). Calling OCIAttrGet() on the describe handle can also return 
+the total number of positions.
+See the section "Describing" on page 2-33 for more information about describe 
+operations.
+Parameters
+TO BE UPDATED
+svchp (IN/OUT) - a service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+objptr (IN) - the name of the object (a null-terminated string) to be 
+described. Only procedure or function names are valid when connected to an 
+Oracle7 Server.
+objptr_len (IN) - the length of the string. Must be non-zero.
+objptr_typ (IN) - Must be OCI_OTYPE_NAME, OCI_OTYPE_REF, or OCI_OTYPE_PTR.
+info_level (IN) - reserved for future extensions. Pass OCI_DEFAULT.
+objtype (IN/OUT) - Object type.
+dschp (IN/OUT) - a describe handle that is populated with describe 
+information about the object after the call.
+Related Functions
+OCIAttrGet()
+
+
+
+OCIEnvCreate()
+Name
+OCI ENVironment CREATE
+Purpose
+This function creates and initializes an environment for the rest of
+the OCI functions to work under.  This call is a replacement for both
+the OCIInitialize and OCIEnvInit calls.
+Syntax
+sword OCIEnvCreate  ( OCIEnv        **envhpp, 
+                      ub4           mode, 
+                      dvoid         *ctxp, 
+                      dvoid         *(*malocfp) 
+                                    (dvoid *ctxp, 
+                                        size_t size), 
+                      dvoid         *(*ralocfp) 
+                                    (dvoid *ctxp, 
+                                       dvoid *memptr, 
+                                       size_t newsize), 
+                      void          (*mfreefp) 
+                                    (dvoid *ctxp, 
+                                       dvoid *memptr))
+                      size_t        xtramemsz,
+                      dvoid         **usrmempp );
+ 
+Comments
+This call creates an environment for all the OCI calls using the modes
+specified by the user. This call can be used instead of the two calls
+OCIInitialize and OCIEnvInit. This function returns an environment handle
+which is then used by the remaining OCI functions. There can be multiple
+environments in OCI each with its own environment modes.  This function 
+also performs any process level initialization if required by any mode.
+For example if the user wants to initialize an environment as OCI_THREADED,
+then all libraries that are used by OCI are also initialized in the
+threaded mode. 
+
+This call should be invoked before anny other OCI call and should be used
+instead of the OCIInitialize and OCIEnvInit calls. This is the recommended
+call, although OCIInitialize and OCIEnvInit calls will still be supported
+for backward compatibility. 
+ 
+envpp (OUT) - a pointer to a handle to the environment. 
+mode (IN) - specifies initialization of the mode. The valid modes are:
+OCI_DEFAULT - default mode.
+OCI_THREADED - threaded environment. In this mode, internal data 
+structures are protected from concurrent accesses by multiple threads. 
+OCI_OBJECT - will use navigational object interface. 
+ctxp (IN) - user defined context for the memory call back routines. 
+malocfp (IN) - user-defined memory allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory allocation function.
+size - size of memory to be allocated by the user-defined memory 
+allocation function
+ralocfp (IN) - user-defined memory re-allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory reallocation 
+function.
+memp - pointer to memory block
+newsize - new size of memory to be allocated
+mfreefp (IN) - user-defined memory free function. If mode is 
+OCI_THREADED, this memory free routine must be thread safe.
+ctxp - context pointer for the user-defined memory free function.
+memptr - pointer to memory to be freed
+xtramemsz (IN) - specifies the amount of user memory to be allocated. 
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user.
+
+Example
+
+Related Functions
+OCIInitialize, OCIEnvInit
+
+
+OCIEnvNlsCreate()
+Name
+OCI ENVironment CREATE with NLS info
+Purpose
+This function does almost everything OCIEnvCreate does, plus enabling setting
+of charset and ncharset programmatically, except OCI_UTF16 mode. 
+Syntax
+sword OCIEnvNlsCreate(OCIEnv        **envhpp,
+                      ub4           mode,
+                      dvoid         *ctxp,
+                      dvoid         *(*malocfp)
+                                    (dvoid *ctxp,
+                                        size_t size),
+                      dvoid         *(*ralocfp)
+                                    (dvoid *ctxp,
+                                       dvoid *memptr,
+                                       size_t newsize),
+                      void          (*mfreefp)
+                                    (dvoid *ctxp,
+                                       dvoid *memptr),
+                      size_t        xtramemsz,
+                      dvoid         **usrmempp,
+                      ub2           charset,
+                      ub2           ncharset)
+Comments
+The parameters have the same meaning as the ones in OCIEnvCreate().
+The charset and ncharset must be both zero or non-zero.
+When charset or ncharset is non-zero, the corresponding character set will
+be used to replace the ones specified in NLS_LANG or NLS_NCHAR. Moreover,
+OCI_UTF16ID is allowed to be set as charset and ncharset.
+On the other hand, OCI_UTF16 mode is deprecated with this function. 
+Applications can achieve the same effects by setting 
+both charset and ncharset as OCI_UTF16ID.
+
+
+OCIEnvInit()
+Name
+OCI INITialize environment
+Purpose
+This call initializes the OCI environment handle.
+Syntax
+sword OCIEnvInit ( OCIEnv    **envp,
+                 ub4       mode,
+                 size_t    xtramemsz,
+                 dvoid     **usrmempp );
+Comments
+Initializes the OCI environment handle. No changes are done on an initialized 
+handle. If OCI_ERROR or OCI_SUCCESS_WITH_INFO is returned, the 
+environment handle can be used to obtain ORACLE specific errors and 
+diagnostics.
+This call is processed locally, without a server round-trip.
+Parameters
+envpp (OUT) - a pointer to a handle to the environment. 
+mode (IN) - specifies initialization of an environment mode. The only valid 
+mode is OCI_DEFAULT for default mode
+xtramemsz (IN) - specifies the amount of user memory to be allocated. 
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user.
+Example
+See the description of OCISessionBegin() on page 13-84 for an example showing 
+the use of OCIEnvInit(). 
+Related Functions
+
+
+
+
+OCIErrorGet()
+Name
+OCI Get Diagnostic Record
+Purpose
+Returns an error message in the buffer provided and an ORACLE error.
+Syntax
+sword OCIErrorGet ( dvoid      *hndlp, 
+                  ub4        recordno,
+                  OraText       *sqlstate,
+                  ub4        *errcodep, 
+                  OraText       *bufp,
+                  ub4        bufsiz,
+                  ub4        type );
+Comments
+Returns an error message in the buffer provided and an ORACLE error. 
+Currently does not support SQL state. This call can be called a multiple 
+number of times if there are more than one diagnostic record for an error.
+The error handle is originally allocated with a call to OCIHandleAlloc().
+Parameters
+hndlp (IN) - the error handle, in most cases, or the environment handle (for 
+errors on OCIEnvInit(), OCIHandleAlloc()).
+recordno (IN) - indicates the status record from which the application seeks 
+info. Starts from 1. 
+sqlstate (OUT) - Not supported in Version 8.0.
+errcodep (OUT) - an ORACLE Error is returned.
+bufp (OUT) - the error message text is returned.
+bufsiz (IN) - the size of the buffer provide to get the error message.
+type (IN) - the type of the handle.
+Related Functions
+OCIHandleAlloc()
+
+OCIExtractInit
+Name
+OCI Extract Initialize 
+Purpose
+This function initializes the parameter manager. 
+Syntax
+sword OCIExtractInit(dvoid *hndl, OCIError *err);
+Comments
+It must be called before calling any other parameter manager routine. The NLS 
+information is stored inside the parameter manager context and used in 
+subsequent calls to OCIExtract routines.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+Related Functions
+OCIExtractTerm()
+
+OCIExtractTerm
+Name
+OCI Extract Terminate
+Purpose
+This function releases all dynamically allocated storage and may perform 
+other internal bookkeeping functions.
+Syntax
+sword OCIExtractTerm(dvoid *hndl, OCIError *err);
+Comments
+It must be called when the parameter manager is no longer being used.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+Related Functions
+OCIExtractInit()
+
+OCIExtractReset
+Name
+OCI Extract Reset
+Purpose
+The memory currently used for parameter storage, key definition storage, and 
+parameter value lists is freed and the structure is reinitialized.
+Syntax
+sword OCIExtractReset(dvoid *hndl, OCIError *err);
+Comments
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+Related Functions
+
+OCIExtractSetNumKeys
+Name
+OCI Extract Set Number of Keys
+Purpose
+Informs the parameter manager of the number of keys that will be registered.
+Syntax
+sword OCIExtractSetNumKeys(dvoid *hndl, OCIError *err, uword numkeys);
+Comments
+This routine must be called prior to the first call of OCIExtractSetKey().  
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+numkeys (IN) - The number of keys that will be registered with 
+               OCIExtractSetKey().
+Related Functions
+OCIExtractSetKey()
+
+OCIExtractSetKey
+Name
+OCI Extract Set Key definition
+Purpose
+Registers information about a key with the parameter manager.
+Syntax
+sword OCIExtractSetKey(dvoid *hndl, OCIError *err, CONST OraText *name, ub1 type,
+                       ub4 flag, CONST dvoid *defval, CONST sb4 *intrange, 
+                       CONST OraText *CONST *strlist);
+Comments
+This routine must be called after calling OCIExtractSetKey() and before 
+calling OCIExtractFromFile() or OCIExtractFromStr().  
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+name (IN) - The name of the key.
+type (IN) - The type of the key (OCI_EXTRACT_TYPE_INTEGER, 
+            OCI_EXTRACT_TYPE_OCINUM, OCI_EXTRACT_TYPE_STRING, or 
+            OCI_EXTRACT_TYPE_BOOLEAN).
+flag (IN) - Set to OCI_EXTRACT_MULTIPLE if the key can take multiple values 
+            or 0 otherwise.
+defval (IN) - Set to the default value for the key.  May be NULL if there is 
+               no default.  A string default must be a (text*) type, an 
+               integer default must be an (sb4*) type, and a boolean default 
+               must be a (ub1*) type.
+intrange (IN) - Starting and ending values for the allowable range of integer 
+                values.  May be NULL if the key is not an integer type or if 
+                all integer values are acceptable.
+strlist (IN) - List of all acceptable text strings for the key.  May be NULL 
+               if the key is not a string type or if all text values are 
+               acceptable.
+Related Functions
+OCIExtractSetNumKeys()
+
+OCIExtractFromFile
+Name
+OCI Extract parameters From File
+Purpose
+The keys and their values in the given file are processed. 
+Syntax
+sword OCIExtractFromFile(dvoid *hndl, OCIError *err, ub4 flag, OraText *filename);
+Comments
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+flag (IN) - Zero or has one or more of the following bits set: 
+           OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or 
+           OCI_EXTRACT_APPEND_VALUES. 
+filename (IN) - Null-terminated filename string.
+Related Functions
+
+OCIExtractFromStr
+Name
+OCI Extract parameters From String
+Purpose
+The keys and their values in the given string are processed. 
+Syntax
+sword OCIExtractFromStr(dvoid *hndl, OCIError *err, ub4 flag, OraText *input);
+Comments
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+flag (IN) - Zero or has one or more of the following bits set: 
+           OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or 
+           OCI_EXTRACT_APPEND_VALUES. 
+input (IN) - Null-terminated input string.
+Related Functions
+
+OCIExtractToInt
+Name
+OCI Extract To Integer
+Purpose
+Gets the integer value for the specified key.
+Syntax
+sword OCIExtractToInt(dvoid *hndl, OCIError *err, OraText *keyname, uword valno, 
+                      sb4 *retval);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual integer value.
+Related Functions
+
+OCIExtractToBool
+Name
+OCI Extract To Boolean
+Purpose
+Gets the boolean value for the specified key. 
+Syntax
+sword OCIExtractToBool(dvoid *hndl, OCIError *err, OraText *keyname, uword valno,
+                       ub1 *retval);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual boolean value.
+Related Functions
+
+OCIExtractToStr
+Name
+OCI Extract To String
+Purpose
+Gets the string value for the specified key.
+Syntax
+sword OCIExtractToStr(dvoid *hndl, OCIError *err, OraText *keyname, uword valno, 
+                      OraText *retval, uword buflen);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual null-terminated string value.
+buflen (IN) - The length of the buffer for retval.
+Related Functions
+
+Note: The following OCIExtract functions are unavailable in this release
+
+OCIExtractToOCINum
+Name
+OCI Extract To OCI Number
+Purpose
+Gets the OCINumber value for the specified key.
+Syntax
+sword OCIExtractToOCINum(dvoid *hndl, OCIError *err, OraText *keyname, 
+                         uword valno, OCINumber *retval);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual OCINumber value.
+Related Functions
+
+OCIExtractToList
+Name
+OCI Extract To parameter List
+Purpose
+Generates a list of parameters from the parameter structures that are stored 
+in memory. 
+Syntax
+sword OCIExtractToList(dvoid *hndl, OCIError *err, uword *numkeys);
+Comments
+Must be called before OCIExtractValues() is called.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+numkeys (OUT) - Number of distinct keys stored in memory.
+Related Functions
+OCIExtractFromList()
+
+OCIExtractFromList
+Name
+OCI Extract From parameter List
+Purpose
+Generates a list of values for the a parameter in the parameter list.
+Syntax
+sword OCIExtractFromList(dvoid *hndl, OCIError *err, uword index, OraText *name, 
+                         ub1 *type, uword *numvals, dvoid ***values);
+Comments
+Parameters are specified by an index. OCIExtractToList() must be called prior 
+to calling this routine to generate the parameter list from the parameter 
+structures that are stored in memory. 
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+name (OUT) - Name of the key for the current parameter.
+type (OUT) - Type of the current parameter (OCI_EXTRACT_TYPE_STRING, 
+             OCI_EXTRACT_TYPE_INTEGER, OCI_EXTRACT_TYPE_OCINUM, or 
+             OCI_EXTRACT_TYPE_BOOLEAN)
+numvals (OUT) - Number of values for this parameter.
+values (OUT) - The values for this parameter.
+Related Functions
+OCIExtractToList()
+
+
+************************  OCIFileClose() ***********************************
+ 
+Name
+ OCIFileClose - Oracle Call Interface FILE i/o CLOSE
+
+Purpose
+ Close a previously opened file.
+
+Syntax
+ sword OCIFileClose ( dvoid             *hndl, 
+             	      OCIError          *err,
+                      OCIFileObject     *filep )
+
+Comments
+ This function will close a previously opened file. If the function succeeds
+ then OCI_SUCCESS will be returned, else OCI_ERROR. 
+ 
+Parameters
+ hndl  (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle
+ filep (IN) - the OCIFile file object
+
+Related Functions
+ OCIFileOpen.  
+
+
+
+********************* OCIFileExists() **************************************
+
+Name
+ OCIFileExists - Oracle Call Interface FILE i/o EXIST
+
+Purpose
+ Check to see if the file exists.
+
+Syntax
+ sword OCIFileExists ( dvoid           *hndl, 
+            	      OCIError         *err, 
+                      OraText          *filename,
+                      OraText          *path,
+                      ub1              *flag )
+
+Comments
+ This function will set the flag to TRUE if the file exists else it will
+ be set to FALSE.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR. 
+
+Parameters
+ hndl(IN) - OCI environment or session handleenv
+ err(OUT) - OCI error handle
+ filename(IN) - filename
+ path(IN) - path of the file
+ flag(OUT) - whether the file exists or not
+
+Related Functions.
+ None.
+     
+
+ **************************** OCIFileFlush() ******************************
+
+
+Name
+ OCIFileFlush - Oracle Call Interface File i/o FLUSH
+
+Purpose
+ Flush the buffers associated with the file to the disk.
+
+Syntax
+ sword OCIFileFlush ( dvoid             *hndl, 
+             	      OCIError          *err,
+                      OCIFileObject     *filep )
+
+Comments
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters 
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle
+ filep (IN) - the OCIFile file object
+
+Related Functions
+ OCIFileOpen, OCIFileWrite
+
+
+
+ *************************** OCIFileGetLength() ****************************
+
+Name
+ OCIFileGetLength - Oracle Call Interface FILE i/o GET file LENGTH
+
+Purpose
+ Get the length of a file.
+
+Syntax
+ OCIFileGetLength(dvoid           *hndl, 
+	          OCIError        *err,
+                  OraText         *filename,
+                  OraText         *path,
+                  ubig_ora        *lenp )
+
+Comments
+ The length of the file will be returned in lenp.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+ 
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filename (IN) - file name.
+ path (IN) - path of the file.
+ lenp (OUT) - On output, it is the length of the file in bytes.
+ is the number of bytes in the file.
+
+Related Functions
+ None.
+
+
+
+******************************** OCIFileInit() *****************************
+   
+Name
+ OCIFileInit - Oracle Call Interface FILE i/o INITialize
+
+Purpose
+ Initialize the OCI File I/O package and create the OCIFile context.
+
+Syntax
+ sword OCIFileInit ( dvoid *hndl, 
+                     OCIError *err)
+
+Comments
+ This function should be called before any of the OCIFile functions are
+ used.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+ 
+Parameters
+ hndl(IN) - OCI environment or session handle.
+ err(OUT) - OCI error structure.
+
+Related Functions
+ OCIFileTerm
+     
+
+
+********************************* OCIFileOpen() *****************************
+
+Name
+ OCIFileOpen - Oracle Call Interface File i/o OPEN
+
+Purpose
+     Open a file.
+
+Syntax
+ sword OCIFileOpen ( dvoid               *hndl, 
+	             OCIError            *err,
+                     OCIFileObject      **filep,
+                     OraText             *filename,
+                     OraText             *path,
+                     ub4                  mode,
+                     ub4                  create, 
+                     ub4                  type )
+
+Comments
+ OCIFileOpen returns a handle to the open file in filep if the file is
+ successfully opened. 
+ If one wants to use the standard file objects (stdin, stdout & stderr)
+ then OCIFileOpen whould be called with the type filed containing the 
+ appropriate type (see the parameter type). If any of the standard files 
+ are specified then filename, path, mode and create are ignored.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (OUT) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (OUT) - the file object to be returned.
+ filename (IN) - file name (NULL terminated string).
+ path (IN) - path of the file (NULL terminated string).
+ mode - mode in which to open the file (valid modes are OCI_FILE_READONLY,
+ OCI_FILE_WRITEONLY, OCI_FILE_READ_WRITE).
+ create - should the file be created if it does not exist. Valid values
+ are: 
+     OCI_FILE_TRUNCATE - create a file regardless of whether or not it exists. 
+                        If the file already exists overwrite it.
+     OCI_FILE_EXCL - fail if the file exists, else create.
+     OCI_FILE_EXIST - open it if it exists, else fail.
+     OCI_FILE_CREATE - open the file if it exists, and create it if it doesn't.
+     OCI_FILE_APPEND - set the file pointer to the end of the file prior to 
+                      writing(this flag can be OR'ed with OCI_FILE_EXIST or
+                      OCI_FILE_CREATE).
+type - file type. Valid values are OCI_FILE_TEXT, OCI_FILE_BIN, 
+       OCI_FILE_STDIN, OCI_FILE_STDOUT and OCI_FILE_STDERR.
+       If any of the standard files are specified then filename, path, mode
+       and create are ignored.
+
+Related Functions.
+ OCIFileClose
+
+
+
+************************** OCIFileRead() ************************************
+   
+Name
+ OCIFileRead - Oracle Call Interface FILE i/o READ
+
+Purpose
+ Read from a file into a buffer.
+
+Syntax
+ sword OCIFileRead ( dvoid            *hndl, 
+          	     OCIError         *err,
+                     OCIFileObject    *filep,
+                     dvoid            *bufp,
+                     ub4               bufl,
+                     ub4              *bytesread )
+
+Comments
+ Upto bufl bytes from the file will be read into bufp. The user should
+ allocate memory for the buffer.
+ The number of bytes read would be in bytesread.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (IN/OUT) - a File Object that uniquely references the file.
+ bufp (IN) - the pointer to a buffer into which the data will be read. The 
+ length of the allocated memory is assumed to be bufl. 
+ bufl - the length of the buffer in bytes. 
+ bytesread (OUT) - the number of bytes read.
+
+Related Functions
+ OCIFileOpen, OCIFileSeek, OCIFileWrite
+
+
+
+****************************** OCIFileSeek() ******************************
+
+Name
+ OCIFileSeek - Oracle Call Interface FILE i/o SEEK
+
+Purpose
+ Perfom a seek to a byte position.
+
+Syntax
+ sword OCIFileSeek ( dvoid           *hndl, 
+        	     OCIError        *err,  
+                     OCIFileObject   *filep,
+                     uword            origin,
+                     ubig_ora         offset,
+                     sb1              dir)
+
+Comments
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (IN/OUT) - a file handle that uniquely references the file.
+ origin - The starting point we want to seek from. NOTE: The starting 
+ point may be OCI_FILE_SEEK_BEGINNING (beginning), OCI_FILE_SEEK_CURRENT 
+ (current position), or OCI_FILE_SEEK_END (end of file). 
+ offset - The number of bytes from the origin we want to start reading from. 
+ dir - The direction we want to go from the origin. NOTE: The direction 
+ can be either OCI_FILE_FORWARD or OCI_FILE_BACKWARD. 
+ 
+Related Function
+ OCIFileOpen, OCIFileRead, OCIFileWrite
+
+
+
+*************************** OCIFileTerm() **********************************
+
+Name
+ OCIFileTerm - Oracle Call Interface FILE i/o TERMinate
+
+Purpose
+ Terminate the OCI File I/O package and destroy the OCI File context.
+
+Syntax
+ sword OCIFileTerm ( dvoid *hndl, 
+                     OCIError *err )
+
+Comments
+ After this function has been called no OCIFile function should be used.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+ 
+Parameters
+ hndl(IN) - OCI environment or session handle.
+ err(OUT) - OCI error structure. 
+  
+Related Functions 
+ OCIFileInit   
+ 
+
+********************************* OCIFileWrite() **************************** 
+
+Name 
+ OCIFileWrite - Oracle Call Interface FILE i/o WRITE
+
+Purpose
+  Write data from buffer into a file.
+
+Syntax
+ sword OCIFileWrite ( dvoid            *hndl, 
+            	      OCIError         *err,  
+                      OCIFileObject    *filep,
+                      dvoid            *bufp, 
+                      ub4               buflen
+                      ub4              *byteswritten )
+
+Comments
+ The number of bytes written will be in *byteswritten.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (IN/OUT) - a file handle that uniquely references the file.
+ bufp (IN) - the pointer to a buffer from which the data will be written. 
+ The length of the allocated memory is assumed to be the value passed
+ in bufl. 
+ bufl - the length of the buffer in bytes.
+ byteswritten (OUT) - the number of bytes written.
+ 
+Related Functions
+ OCIFileOpen, OCIFileSeek, OCIFileRead
+
+
+
+OCIHandleAlloc()
+Name
+OCI Get HaNDLe
+Purpose
+This call returns a pointer to an allocated and initialized handle.
+Syntax
+sword OCIHandleAlloc ( CONST dvoid   *parenth,
+                     dvoid         **hndlpp, 
+                     ub4           type, 
+                     size_t        xtramem_sz,
+                     dvoid         **usrmempp);
+Comments
+Returns a pointer to an allocated and initialized structure, corresponding to 
+the type specified in type. A non-NULL handle is returned on success. Bind 
+handle and define handles are allocated with respect to a statement handle. All
+other handles are allocated with respect to an environment handle which is 
+passed in as a parent handle.
+No diagnostics are available on error. This call returns OCI_SUCCESS if 
+successful, or OCI_INVALID_HANDLE if an out-of-memory error occurs.
+Handles must be allocated using OCIHandleAlloc() before they can be passed 
+into an OCI call.
+Parameters
+parenth (IN) - an environment or a statement handle. 
+hndlpp (OUT) - returns a handle to a handle type. 
+type (IN) - specifies the type of handle to be allocated. The specific types 
+are: 
+OCI_HTYPE_ERROR - specifies generation of an error report handle of 
+C type OCIError
+OCI_HTYPE_SVCCTX - specifies generation of a service context handle 
+of C type OCISvcCtx
+OCI_HTYPE_STMT - specifies generation of a statement (application 
+request) handle of C type OCIStmt
+OCI_HTYPE_BIND - specifies generation of a bind information handle 
+of C type OCIBind
+OCI_HTYPE_DEFINE - specifies generation of a column definition 
+handle of C type OCIDefine
+OCI_HTYPE_DESCRIBE  - specifies generation of a select list 
+description handle of C type OCIDesc
+OCI_HTYPE_SERVER - specifies generation of a server context handle 
+of C type OCIServer
+OCI_HTYPE_SESSION - specifies generation of an authentication 
+context handle of C type OCISession
+OCI_HTYPE_TRANS - specifies generation of a transaction context 
+handle of C type OCITrans
+OCI_HTYPE_COMPLEXOBJECT - specifies generation of a complex 
+object retrieval handle of C type OCIComplexObject
+OCI_HTYPE_SECURITY - specifies generation of a security handle of C 
+type OCISecurity
+xtramem_sz (IN) - specifies an amount of user memory to be allocated.
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user. 
+Related Functions
+OCIHandleFree()
+
+
+
+OCIHandleFree()
+Name
+OCI Free HaNDLe
+Purpose
+This call explicitly deallocates a handle.
+Syntax
+sword OCIHandleFree ( dvoid     *hndlp,
+                    ub4       type);
+Comments
+This call frees up storage associated with a handle, corresponding to the type 
+specified in the type parameter.
+This call returns either OCI_SUCCESS or OCI_INVALID_HANDLE.
+All handles must be explicitly deallocated. OCI will not deallocate a child 
+handle if the parent is deallocated.
+Parameters
+hndlp (IN) - an opaque pointer to some storage.
+type (IN) - specifies the type of storage to be allocated. The specific types are:
+OCI_HTYPE_ENV - an environment handle
+OCI_HTYPE_ERROR - an error report handle
+OCI_HTYPE_SVCCTX - a service context handle
+OCI_HTYPE_STMT - a statement (application request) handle
+OCI_HTYPE_BIND - a bind information handle
+OCI_HTYPE_DEFINE - a column definition handle
+OCI_HTYPE_DESCRIBE  - a select list description handle
+OCI_HTYPE_SERVER - a server handle
+OCI_HTYPE_SESSION - a user authentication handle
+OCI_HTYPE_TRANS - a transaction handle
+OCI_HTYPE_COMPLEXOBJECT - a complex object retrieval handle
+OCI_HTYPE_SECURITY - a security handle
+Related Functions
+OCIHandleAlloc()
+
+
+
+
+OCIInitialize()
+Name
+OCI Process Initialize
+Purpose
+Initializes the OCI process environment.
+Syntax
+sword OCIInitialize ( ub4           mode,
+                    CONST dvoid   *ctxp, 
+                    CONST dvoid   *(*malocfp) 
+                                  ( dvoid *ctxp,
+                                    size_t size ),
+                    CONST dvoid   *(*ralocfp)
+                                  ( dvoid *ctxp,
+                                    dvoid *memp,
+                                    size_t newsize ),
+                    CONST void    (*mfreefp)
+                                  ( dvoid *ctxp,
+                                    dvoid *memptr ));
+Comments
+This call initializes the OCI process environment.
+OCIInitialize() must be invoked before any other OCI call. 
+Parameters
+mode (IN) - specifies initialization of the mode. The valid modes are:
+OCI_DEFAULT - default mode.
+OCI_THREADED - threaded environment. In this mode, internal data 
+structures are protected from concurrent accesses by multiple threads. 
+OCI_OBJECT - will use navigational object interface. 
+ctxp (IN) - user defined context for the memory call back routines. 
+malocfp (IN) - user-defined memory allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory allocation function.
+size - size of memory to be allocated by the user-defined memory 
+allocation function
+ralocfp (IN) - user-defined memory re-allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory reallocation 
+function.
+memp - pointer to memory block
+newsize - new size of memory to be allocated
+mfreefp (IN) - user-defined memory free function. If mode is 
+OCI_THREADED, this memory free routine must be thread safe.
+ctxp - context pointer for the user-defined memory free function.
+memptr - pointer to memory to be freed
+Example
+See the description of OCIStmtPrepare() on page 13-96 for an example showing 
+the use of OCIInitialize().
+Related Functions
+
+
+--------------------------------OCITerminate------------------------------------
+
+OCITerminate()
+Name
+OCI process Terminate
+Purpose
+Do cleanup before process termination
+Syntax
+sword OCITerminate ( ub4           mode);
+
+Comments
+This call performs  OCI related clean up before the OCI process terminates.
+If the process is running in shared mode then the OCI process is disconnected
+from the shared memory subsystem.
+
+OCITerminate() should be the last OCI call in any process.
+
+Parameters
+mode (IN) - specifies different termination modes.
+
+OCI_DEFAULT - default mode.
+
+Example
+
+Related Functions
+OCIInitialize()
+
+ ---------------------- OCIIntervalAssign -------------------- 
+void OCIIntervalAssign(dvoid *hndl, OCIError *err, CONST OCIInterval *inpinter,
+			OCIInterval *outinter );
+
+  DESCRIPTION
+    Copies one interval to another to create a replica
+  PARAMETERS
+     hndl (IN) - Session/Env handle.
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  inpinter - Input Interval 
+    (OUT) outinter - Output Interval 
+  RETURNS
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_SUCCESS otherwise
+
+ ---------------------- OCIIntervalCheck -------------------- 
+sword OCIIntervalCheck(dvoid *hndl, OCIError *err, CONST OCIInterval *interval,
+			 ub4 *valid );
+
+  DESCRIPTION
+    Checks the validity of an interval
+  PARAMETERS
+     hndl (IN) - Session/Env handle.
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  interval - Interval to be checked 
+    (OUT) valid     - Zero if the interval is valid, else returns an Ored
+	combination of the following codes.
+
+   Macro name                   Bit number      Error
+   ----------                   ----------      -----
+   OCI_INTER_INVALID_DAY         0x1           Bad day
+   OCI_INTER_DAY_BELOW_VALID     0x2           Bad DAy Low/high bit (1=low)
+   OCI_INTER_INVALID_MONTH       0x4           Bad MOnth
+   OCI_INTER_MONTH_BELOW_VALID   0x8           Bad MOnth Low/high bit (1=low)
+   OCI_INTER_INVALID_YEAR        0x10          Bad YeaR
+   OCI_INTER_YEAR_BELOW_VALID    0x20          Bad YeaR Low/high bit (1=low)
+   OCI_INTER_INVALID_HOUR        0x40          Bad HouR
+   OCI_INTER_HOUR_BELOW_VALID    0x80          Bad HouR Low/high bit (1=low)
+   OCI_INTER_INVALID_MINUTE      0x100         Bad MiNute
+   OCI_INTER_MINUTE_BELOW_VALID	 0x200         Bad MiNute Low/high bit(1=low)
+   OCI_INTER_INVALID_SECOND      0x400         Bad SeCond
+   OCI_INTER_SECOND_BELOW_VALID  0x800         bad second Low/high bit(1=low)
+   OCI_INTER_INVALID_FRACSEC     0x1000        Bad Fractional second
+   OCI_INTER_FRACSEC_BELOW_VALID 0x2000        Bad fractional second Low/High
+
+	
+  RETURNS
+    OCI_SUCCESS if interval is okay
+    OCI_INVALID_HANDLE if 'err' is NULL.
+
+ ---------------------- OCIIntervalCompare -------------------- 
+sword OCIIntervalCompare(dvoid *hndl, OCIError *err, OCIInterval *inter1, 
+			OCIInterval *inter2, sword *result );
+
+  DESCRIPTION
+	Compares two intervals, returns 0 if equal, -1 if inter1 < inter2, 
+      	1 if inter1 > inter2
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+     inter1  (IN)   - Interval to be compared 
+     inter2  (IN)   - Interval to be compared 
+     result  (OUT)  - 	comparison result, 0 if equal, -1 if inter1 < inter2, 
+                	1 if inter1 > inter2
+
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_ERROR if 
+	the two input datetimes are not mutually comparable.
+
+---------------------- OCIIntervalDivide -------------------- 
+sword OCIIntervalDivide(dvoid *hndl, OCIError *err, OCIInterval *dividend, 
+		OCINumber *divisor, OCIInterval *result );
+ 
+  DESCRIPTION
+     Divides an interval by an Oracle Number to produce an interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+     dividend  (IN)   - Interval to be divided 
+     divisor   (IN)   - Oracle Number dividing `dividend' 
+     result    (OUT)  - resulting interval (dividend / divisor) 
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+ 
+ ---------------------- OCIIntervalFromNumber -------------------- 
+sword OCIIntervalFromNumber(dvoid *hndl, OCIError *err, 
+               OCIInterval *inter, OCINumber *number);
+  DESCRIPTION
+    Converts an interval to an Oracle Number
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (OUT)  interval - Interval to be converted 
+    (IN) number - Oracle number result  (in years for YEARMONTH interval
+                     and in days for DAYSECOND)
+  RETURNS
+    OCI_SUCCESS on success 
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_ERROR on error.
+  NOTES
+    Fractional portions of the date (for instance, minutes and seconds if
+    the unit chosen is hours) will be included in the Oracle number produced.
+    Excess precision will be truncated.
+ 
+ ---------------------- OCIIntervalFromText -------------------- 
+sword OCIIntervalFromText(dvoid *hndl, OCIError *err, CONST OraText *inpstring,
+		size_t str_len, OCIInterval *result );
+
+  DESCRIPTION
+    Given an interval string produce the interval represented by the string. 
+    The type of the interval is the type of the 'result' descriptor.
+  PARAMETERS
+
+     hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  inpstring - Input string 
+    (IN)  str_len - Length of input string 
+    (OUT) result - Resultant interval 
+  RETURNS
+    OCI_SUCCESS on success
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_ERROR if
+     	there are too many fields in the literal string
+	the year is out of range (-4713 to 9999)
+  	if the month is out of range (1 to 12)
+ 	if the day of month is out of range (1 to 28...31)
+    	if hour is not in range (0 to 23)
+     	if hour is not in range (0 to 11)
+  	if minute is not in range (0 to 59)
+    	if seconds in minute not in range (0 to 59)
+   	if seconds in day not in range (0 to 86399)
+  	if the interval is invalid
+
+ ---------------------- OCIIntervalGetDaySecond -------------------- 
+
+  DESCRIPTION
+     Gets values of day second interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+        day     (OUT) - number of days
+        hour    (OUT) - number of hours
+        min     (OUT) - number of mins
+        sec     (OUT) - number of secs
+        fsec    (OUT) - number of fractional seconds
+	result     (IN)  - resulting interval 
+  RETURNS
+	OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+ ---------------------- OCIIntervalGetYearMonth -------------------- 
+
+  DESCRIPTION
+     Gets year month from an interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+	year    (OUT)   - year value
+	month   (OUT)   - month value
+	result     (IN)  - resulting interval 
+  RETURNS
+	OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+---------------------- OCIIntervalAdd -------------------- 
+sword OCIIntervalAdd(dvoid *hndl, OCIError *err, OCIInterval *addend1, 
+			OCIInterval *addend2, OCIInterval *result );
+NAME OCIIntervalAdd - Adds two intervals 
+PARAMETERS
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+addend1  (IN)   - Interval to be added 
+addend2  (IN)   - Interval to be added 
+result   (OUT)  - resulting interval (addend1 + addend2) 
+DESCRIPTION
+     Adds two intervals to produce a resulting interval
+RETURNS
+     OCI_SUCCESS on success
+     OCI_ERROR if:
+	the two input intervals are not mutually comparable.
+	the resulting year would go above SB4MAXVAL
+	the resulting year would go below SB4MINVAL
+     OCI_INVALID_HANDLE if 'err' is NULL.
+NOTES
+     The two input intervals must be mutually comparable
+
+ ---------------------- OCIIntervalSubtract -------------------- 
+sword OCIIntervalSubtract(dvoid *hndl, OCIError *err, OCIInterval *minuend, 
+			    OCIInterval *subtrahend, OCIInterval *result );
+NAME - OCIIntervalSubtract - subtracts two intervals
+PARAMETERS
+hndl (IN) - Session/Env handle.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+minuend    (IN)   - interval to be subtracted from 
+subtrahend (IN)   - interval subtracted from minuend 
+result     (OUT)  - resulting interval (minuend - subtrahend) 
+DESCRIPTION
+     Subtracts two intervals and stores the result in an interval
+RETURNS
+	OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+	OCI_ERROR if:
+	   the two input intervals are not mutually comparable.
+	   the resulting leading field would go below SB4MINVAL	
+	   the resulting leading field would go above SB4MAXVAL
+
+---------------------- OCIIntervalMultiply -------------------- 
+sword OCIIntervalMultiply(dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+			OCINumber *nfactor, OCIInterval *result );
+
+  DESCRIPTION
+     Multiplies an interval by an Oracle Number to produce an interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+     ifactor  (IN)   - Interval to be multiplied 
+     nfactor  (IN)   - Oracle Number to be multiplied 
+     result   (OUT)  - resulting interval (ifactor * nfactor) 
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_ERROR if:
+	the resulting year would go above SB4MAXVAL
+	the resulting year would go below SB4MINVAL
+
+
+ ---------------------- OCIIntervalSetDaySecond -------------------- 
+
+  DESCRIPTION
+     Sets day second interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+        day     (IN) - number of days
+        hour    (IN) - number of hours
+        min     (IN) - number of mins
+        sec     (IN) - number of secs
+        fsec    (IN) - number of fractional seconds
+	result     (OUT)  - resulting interval 
+  RETURNS
+	OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+ ---------------------- OCIIntervalSetYearMonth -------------------- 
+
+  DESCRIPTION
+     Sets year month interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+	year    (IN)   - year value
+	month   (IN)   - month value
+	result     (OUT)  - resulting interval 
+  RETURNS
+	OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+ ---------------------- OCIIntervalToNumber -------------------- 
+sword OCIIntervalToNumber(dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+			OCINumber *number, uword units );
+
+  DESCRIPTION
+    Converts an interval to an Oracle Number
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  interval - Interval to be converted 
+    (OUT) number - Oracle number result   (in years for YEARMONTH interval
+                     and in days for DAYSECOND)
+  RETURNS
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_SUCCESS on success 
+  NOTES
+    Fractional portions of the date (for instance, minutes and seconds if
+    the unit chosen is hours) will be included in the Oracle number produced.
+    Excess precision will be truncated.
+ 
+ ---------------------- OCIIntervalToText -------------------- 
+sword OCIIntervalToText( dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+                        ub1 lfprec, ub1 fsprec, OraText *buffer, 
+                        size_t buflen, size_t *resultlen );
+
+  DESCRIPTION
+    Given an interval, produces a string representing the interval.
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  interval - Interval to be converted 
+    (IN)  lfprec  - Leading field precision. Number of digits used to
+                represent the leading field.
+    (IN)  fsprec  - Fractional second precision of the interval. Number of
+                digits used to represent the fractional seconds.
+    (OUT) buffer - buffer to hold result 
+    (IN)  buflen - length of above buffer 
+    (OUT) resultlen - length of result placed into buffer 
+ 
+  RETURNS
+    OCI_SUCCESS on success
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_ERROR 
+    	if the buffer is not large enough to hold the result
+  NOTES
+    The interval literal will be output as `year' or `[year-]month' for
+    YEAR-MONTH intervals and as `seconds' or `minutes[:seconds]' or
+    `hours[:minutes[:seconds]]' or `days[ hours[:minutes[:seconds]]]' for
+    DAY-TIME intervals (where optional fields are surrounded by brackets).
+
+ ----------------------- OCIIntervalFromTZ --------------------- 
+sword OCIIntervalFromTZ(dvoid *hndl, OCIError *err, CONST oratext *inpstring,
+			size_t str_len, OCIInterval *results );
+
+  DESCRIPTION
+    Returns am OCIInmterval of type OCI_DTYPE_INTERVAL_DS with the region id
+    set and the current region offset or an absolute offset with the region id
+    set to 0.
+  PARAMETERS
+    hndl (IN) - Session/Env handle.
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    inpstring (IN) - pointer to the input string
+    str_len (IN) - inpstring length
+    result - Output Interval 
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_ERROR on error
+        Bad interval type
+        Timezone errors
+  NOTES
+     The input string must be of the form [+/-]TZH:TZM or 'TZR [TZD]'
+
+OCILdaToSvcCtx()
+Name
+OCI toggle version 7 Lda_Def to SerVice context handle
+Purpose
+Converts a V7 Lda_Def to a V8 service context handle.
+Syntax
+sword OCILdaToSvcCtx ( OCISvcCtx  **svchpp,
+                     OCIError   *errhp,
+                     Lda_Def    *ldap );
+Comments
+Converts a V7 Lda_Def to a V8 service context handle. The action of this call 
+can be reversed by passing the resulting service context handle to the 
+OCISvcCtxToLda() function.
+Parameters
+svchpp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+ldap (IN/OUT) - the V7 logon data area returned by OCISvcCtxToLda() from 
+this service context.
+Related Functions
+OCISvcCtxToLda()
+
+
+
+
+OCILobAppend()
+
+Name
+OCI Lob APpend
+
+Purpose
+Appends a LOB value at the end of another LOB. 
+
+Syntax
+sword OCILobAppend ( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *dst_locp,
+                   OCILobLocator    *src_locp );
+Comments
+Appends a LOB value at the end of LOB. The data is 
+copied from the source to the destination at the end of the destination. The 
+source and the destination must already exist. The destination LOB is 
+extended to accommodate the newly written data.
+
+It is an error to extend the destination LOB beyond the maximum length 
+allowed or to try to copy from a NULL LOB. 
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB. 
+src_locp (IN/OUT) - a locator uniquely referencing the source LOB. 
+
+Related Functions
+OCILobTrim()
+OCIErrorGet()
+OCILobWrite()
+OCILobCopy()
+
+
+
+
+
+OCILobAssign()
+
+Name
+OCI Lob ASsiGn
+
+Purpose
+Assigns one LOB/FILE locator to another.
+
+Syntax
+sword OCILobAssign ( OCIEnv                *envhp, 
+                     OCIError              *errhp, 
+                     CONST OCILobLocator   *src_locp, 
+                     OCILobLocator         **dst_locpp );
+
+Comments
+Assign source locator to destination locator.  After the assignment, both 
+locators refer to the same LOB data.  For internal LOBs, the source locator's 
+LOB data gets copied to the destination locator's LOB data only when the 
+destination locator gets stored in the table.  Therefore, issuing a flush of 
+the object containing the destination locator will copy the LOB data. For FILEs
+only the locator that refers to the OS file is copied to the table. The OS file
+is not copied.
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+src_locp (IN) - LOB locator to copy from.
+dst_locpp (IN/OUT) - LOB locator to copy to.  The caller must allocate space 
+for the OCILobLocator by calling OCIDescriptorAlloc().
+Note: The only difference between this and OCILobLocatorAssign is that this
+takes an environment handle whereas OCILobLocatorAssign takes an OCI service
+handle
+
+See also
+OCIErrorGet()
+OCILobIsEqual()
+OCILobLocatorIsInit()
+OCILobLocatorAssign()
+
+
+
+OCILobCharSetForm()
+
+Name
+OCI Lob Get Character Set Form
+
+Purpose
+Gets the LOB locator's character set fpr,, if any.
+
+Syntax
+sword OCILobCharSetForm ( OCIEnv                    *envhp, 
+                          OCIError                  *errhp, 
+                          CONST OCILobLocator       *locp, 
+                          ub1                       *csfrm );
+
+Comments
+Returns the character set form of the input LOB locator in the csfrm output 
+parameter. 
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic information 
+can be obtained by calling OCIErrorGet().
+locp (IN) - LOB locator for which to get the character set form.
+csfrm(OUT) - character set form of the input LOB locator.  If the input 
+locator is for a BLOB or a BFILE, csfrm is set to 0 since there is no concept 
+of a character set for binary LOBs/FILEs.  The caller must allocate space for 
+the csfrm (ub1) and not write into the space.
+See also
+OCIErrorGet(), OCILobCharSetId(), OCILobLocatorIsInit
+
+
+
+
+OCILobCharSetId()
+
+Name
+OCI Lob get Character Set IDentifier
+
+Purpose
+Gets the LOB locator's character set ID, if any.
+
+Syntax
+sword OCILobCharSetId ( OCIEnv                    *envhp, 
+                        OCIError                  *errhp, 
+                        CONST OCILobLocator       *locp, 
+                        ub2                       *csid );
+
+Comments
+Returns the character set ID of the input LOB locator in the cid output 
+parameter. 
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic information 
+can be obtained by calling OCIErrorGet().
+locp (IN) - LOB locator for which to get the character set ID.
+csid (OUT) - character set ID of the input LOB locator.  If the input locator 
+is for a BLOB or a BFILE, csid is set to 0 since there is no concept of a 
+character set for binary LOBs/FILEs.  The caller must allocate space for the character set id of type ub2 and not write into the space.
+
+See also
+OCIErrorGet(), OCILobCharSetForm(), OCILobLocatorIsInit()
+
+
+
+
+OCILobCopy()
+
+Name
+OCI Lob Copy
+
+Purpose
+Copies a portion of a LOB value into another LOB value.
+
+Syntax
+sword OCILobCopy ( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *dst_locp,
+                   OCILobLocator    *src_locp,
+                   ub4              amount,
+                   ub4              dst_offset,
+                   ub4              src_offset );
+
+Comments
+Copies a portion of a LOB value into another LOB as specified. The data 
+is copied from the source to the destination. The source (src_locp) and the 
+destination (dlopb) LOBs must already exist.
+If the data already exists at the destination's start position, it is 
+overwritten with the source data. If the destination's start position is 
+beyond the end of the current data, a hole is created from the end of the data
+to the beginning of the newly written data from the source. The destination 
+LOB is extended to accommodate the newly written data if it extends 
+beyond the current length of the destination LOB. 
+It is an error to extend the destination LOB beyond the maximum length 
+allowed or to try to copy from a NULL LOB.
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB. 
+src_locp (IN/OUT) - a locator uniquely referencing the source LOB. 
+amount (IN) - the number of character or bytes, as appropriate, to be copied.
+dst_offset (IN) - this is the absolute offset for the destination LOB. 
+For character LOBs it is the number of characters from the beginning of the 
+LOB at which to begin writing. For binary LOBs it is the number of bytes from 
+the beginning of the lob from which to begin reading. The offset starts at 1.
+src_offset (IN) - this is the absolute offset for the source LOB. 
+For character LOBs it is the number of characters from the beginning of the 
+LOB, for binary LOBs it is the number of bytes. Starts at 1.
+
+See Also 
+OCIErrorGet(), OCILobAppend(), OCILobWrite(), OCILobTrim()
+
+OCILobCreateTemporary()
+
+Name
+OCI Lob Create Temporary
+
+Purpose
+Create a Temporary Lob
+
+Syntax
+sword OCILobCreateTemporary(OCISvcCtx          *svchp,
+                            OCIError           *errhp,
+                            OCILobLocator      *locp,
+                            ub2                 csid,
+                            ub1                 csfrm,
+                            ub1                 lobtype,
+                            boolean             cache,
+                            OCIDuration         duration);
+
+
+Comments
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator which points to the temporary Lob
+csid (IN) - the character set id
+csfrm(IN) - the character set form
+lobtype (IN) - the lob type - one of the three constants OCI_TEMP_BLOB, 
+               OCI_TEMP_CLOB and OCI_TEMP_NCLOB
+cache(IN)-  TRUE if the temporary LOB goes through the cache; FALSE, if not.
+duration(IN)- duration of the temporary LOB; Can be a valid duration id or one 
+              of the values: OCI_DURATION_SESSION, OCI_DURATION_CALL
+	      Note: OCI_DURATION_TRANSACTION is not supported in 8.1. 
+Related functions
+OCILobFreeTemporary()
+OCILobIsTemporary()
+
+OCILobDisableBuffering()
+
+Name
+OCI Lob Disable Buffering
+
+Purpose
+Disable lob buffering for the input locator.
+
+
+Syntax
+sword OCILobDisableBuffering ( OCISvcCtx      *svchp,
+                               OCIError       *errhp,
+                               OCILobLocator  *locp);
+
+Comments
+
+Disable lob buffering for the input locator.  The next time data is
+read/written from/to the lob through the input locator, the lob
+buffering subsystem is *not* used.  
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB. 
+
+Related Functions
+OCILobEnableBuffering()
+OCIErrorGet()
+OCILobFlush()
+
+
+
+
+OCILobEnableBuffering()
+
+Name
+OCI Lob Enable Buffering
+
+Purpose
+Enable lob buffering for the input locator.
+
+
+Syntax
+sword OCILobEnableBuffering ( OCISvcCtx      *svchp,
+                              OCIError       *errhp,
+                              OCILobLocator  *locp);
+
+Comments
+
+Enable lob buffering for the input locator.  The next time data is
+read/written from/to the lob through the input locator, the lob
+buffering subsystem is used.  
+
+Once lob buffering is enabled for a locator, if that locator is passed to 
+one of the following routines, an error is returned:
+        OCILobCopy, OCILobAppend, OCILobErase, OCILobGetLength, OCILobTrim
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB. 
+
+Related Functions
+OCILobDisableBuffering()
+OCIErrorGet()
+OCILobWrite()
+OCILobRead()
+OCILobFlush()
+
+
+
+
+OCILobErase()
+
+Name
+OCI Lob ERase
+
+Purpose
+Erases a specified portion of the LOB data starting at a specified offset.
+
+Syntax
+sword OCILobErase ( OCISvcCtx       *svchp,
+                  OCIError        *errhp,
+                  OCILobLocator   *locp,
+                  ub4             *amount,
+                  ub4             offset );
+
+Comments
+Erases a specified portion of the LOB data starting at a specified offset.
+The actual number of characters/bytes erased is returned. The actual number 
+of characters/bytes and the requested number of characters/bytes will differ 
+if the end of the LOB data is reached before erasing the requested number of 
+characters/bytes.
+If a section of data from the middle of the LOB data is erased, a hole is 
+created. When data from that hole is read, 0's are returned. If the LOB is
+NULL, this routine will indicate that 0 characters/bytes were erased.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - the LOB for which to erase a section of data.
+amount (IN/OUT) - On IN, the number of characters/bytes to erase. On OUT, 
+the actual number of characters/bytes erased.
+offset (IN) - absolute offset from the beginning of the LOB data from which to 
+start erasing data. Starts at 1.
+
+See Also
+OCIErrorGet(), OCILobRead(), OCILobWrite()
+
+
+
+
+OCILobFileClose()
+
+Name
+OCI Lob File CLoSe
+
+Purpose
+Closes a previously opened FILE.
+
+Syntax
+sword OCILobFileClose ( OCISvcCtx            *svchp,
+                        OCIError             *errhp,
+                        OCILobLocator        *filep );
+
+Comments
+Closes a previously opened FILE. It is an error if this function is called for
+an internal LOB. No error is returned if the FILE exists but is not opened.
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+filep (IN/OUT) - a pointer to a FILE locator to be closed.
+
+See Also
+OCIErrorGet(), OCILobFileOpen(), OCILobFileCloseAll(), OCILobFileIsOpen(),
+OCILobFileExists(), CREATE DIRECTORY DDL
+
+
+
+
+
+
+OCILobFileCloseAll()
+
+Name
+OCI LOB FILE Close All
+
+Purpose
+Closes all open FILEs on a given service context.
+
+Syntax
+sword OCILobFileCLoseAll ( OCISvcCtx *svchp, 
+                           OCIError  *errhp );
+
+Comments
+Closes all open FILEs on a given service context.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+
+See also
+OCILobFileClose(),
+OCIErrorGet(), OCILobFileOpen(), OCILobFileIsOpen(),
+OCILobFileExists(), CREATE DIRECTORY DDL
+
+
+
+
+
+
+OCILobFileExists()
+
+Name
+OCI LOB FILE exists
+
+Purpose
+Tests to see if the FILE exists on the server
+
+Syntax
+sword OCILobFileExists ( OCISvcCtx     *svchp,
+                         OCIError      *errhp,
+                         OCILobLocator *filep,
+                         boolean       *flag );
+
+Comments
+Checks to see if a FILE exists for on the server.
+
+Parameters
+svchp (IN) - the OCI service context handle.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, 
+it is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+filep (IN) - pointer to the FILE locator that refers to the file.
+flag (OUT) - returns TRUE if the FILE exists; FALSE if it does not.
+
+See also
+OCIErrorGet, CREATE DIRECTORY (DDL)
+
+
+
+
+OCILobFileGetName()
+
+Name
+OCI LOB FILE Get file Name
+
+Purpose
+Gets the FILE locator's directory alias and file name.
+
+Syntax
+sword OCILobFileGetName ( OCIEnv                   *envhp,
+                          OCIError                 *errhp, 
+                          CONST OCILobLocator      *filep, 
+                          OraText                     *dir_alias,
+                          ub2                      *d_length, 
+                          OraText                     *filename, 
+                          ub2                      *f_length );
+
+Comments
+Returns the directory alias and file name associated with this file locator.  
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) -The OCI error handle. If there is an error, it is recorded in 
+errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+filep (IN) - FILE locator for which to get the directory alias and file name.
+dir_alias (OUT) - buffer into which the directory alias name is placed. The 
+caller must allocate enough space for the directory alias name and must not 
+write into the space.
+d_length (IN/OUT)                 
+        - IN: length of the input dir_alias string;
+        - OUT: length of the returned dir_alias string.
+filename (OUT) - buffer into which the file name is placed. The caller must 
+allocate enough space for the file name and must not write into the space.
+f_length (IN/OUT) 
+        - IN: length of the input filename string;
+         - OUT: lenght of the returned filename string.
+
+See also
+OCILobFileSetName(), OCIErrorGet()
+
+
+
+
+OCILobFileIsOpen()
+
+Name
+OCI LOB FILE Is Open?
+
+Purpose
+Tests to see if the FILE is open
+
+Syntax
+sword OCILobFileIsOpen ( OCISvcCtx *svchp,
+                         OCIError  *errhp,
+                         OCILobLocator *filep,
+                         boolean       *flag );
+
+Comments
+Checks to see if the FILE on the server is open for a given LobLocator.
+
+Parameters
+svchp (IN) - the OCI service context handle.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic information 
+can be obtained by calling OCIErrorGet().
+filep (IN) - pointer to the FILE locator being examined. If the input file 
+locator was never passed to OCILobFileOpen(), the file is considered not to 
+be opened by this locator. However, a different locator may have opened the 
+file. More than one file opens can be performed on the same file using 
+different locators.
+flag (OUT) - returns TRUE if the FILE is opened using this locator; FALSE if 
+it is not. 
+
+See also
+OCIErrorGet, OCILobFileOpen, OCILobFileClose, OCILobFileCloseAll, CREATE 
+DIRECTORY SQL command
+
+
+OCILobFileOpen()
+
+Name
+OCI LOB FILE open
+
+Purpose
+Opens a FILE for read-only access
+
+Syntax
+sword OCILobFileOpen ( OCISvcCtx            *svchp,
+                     OCIError             *errhp,
+                     OCILobLocator        *filep,
+                     ub1                  mode );
+
+Comments
+Opens a FILE. The FILE can be opened for read-only access only. FILEs may not 
+be written to throough ORACLE.
+
+Parameters 
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+filep (IN/OUT) - the FILE to open. Error if the locator does not refer to a 
+FILE. 
+mode (IN) - mode in which to open the file. The only valid mode is read-only - 
+OCI_FILE_READONLY. 
+
+See Also
+OCILobFileClose, OCIErrorGet, OCILobFileCloseAll, OCILobFileIsOpen, 
+OCILobFileSetName, CREATE DIRECTORY 
+
+
+
+
+OCILobFileSetName()
+
+Name
+OCI Lob File Set NaMe
+
+Purpose
+Sets directory alias and file name in the FILE locator.
+
+Syntax
+sword OCILobFileSetName ( OCIEnv             *envhp,
+                          OCIError           *errhp,
+                          OCILobLocator      **filepp,
+                          OraText               *dir_alias,
+                          ub2                d_length, 
+                          OraText               *filename, 
+                          ub2                f_length );
+Comments
+Sets the directory alias and file name in the LOB file locator.  
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+filepp (IN/OUT) - FILE locator for which to set the directory alias name.
+The caller must have already allocated space for the locator by
+calling OCIDescriptorAlloc().
+dir_alias (IN) - buffer that contains the directory alias name to set in the 
+locator.
+d_length (IN) - length of the input dir_alias parameter.
+filename (IN) - buffer that contains the file name is placed.
+f_length (IN) - length of the input filename parameter.
+See also
+OCILobFileGetName, OCIErrorGet, CREATE DIRECTORY
+
+
+
+
+OCILobFlushBuffer()
+
+Name
+OCI Lob Flush all Buffers for this lob.
+
+Purpose
+Flush/write all buffers for this lob to the server.
+
+
+Syntax
+sword OCILobFlushBuffer ( OCISvcCtx       *svchp,
+                          OCIError        *errhp,
+                          OCILobLocator   *locp,
+                          ub4              flag);
+
+Comments
+
+Flushes all buffers, associated with the lob referenced by the input
+locator, to the server.  This routine will actually write the data in
+the buffer to the lob in the database.  Lob buffering must have been
+enabled for the input lob locator.
+
+This routine, by default, does not free the buffer resources for
+reallocation to another buffered LOB operation. However, if you
+want to free the buffer explicitly, you can set the flag parameter
+to OCI_LOB_BUFFER_FREE.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB. 
+flag    (IN)     - to indicate if the buffer resources need to be freed
+                   after a flush. Default value is OCI_LOB_BUFFER_NOFREE.
+                   Set it to OCI_LOB_BUFFER_FREE if you want the buffer
+                   resources to be freed.
+
+Related Functions
+OCILobEnableBuffering()
+OCILobDisableBuffering()
+OCIErrorGet()
+OCILobWrite()
+OCILobRead()
+
+OCILobFreeTemporary()
+
+Name
+OCI Lob Free Temporary
+
+Purpose
+Free a temporary LOB
+
+Syntax
+sword OCILobFreeTemporary(OCISvcCtx          *svchp,
+                          OCIError           *errhp,
+                          OCILobLocator      *locp,
+
+Comments
+  Frees the contents of the temporary Lob this locator is pointing to. Note
+  that the locator itself is not freed until a OCIDescriptorFree is done.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB
+
+Related functions
+OCILobCreateTemporary()
+OCILobIsTemporary()
+
+Name
+OCI Lob/File Get Chunk Size
+
+Purpose
+When creating the table, the user can specify the chunking factor, which can
+be a multiple of Oracle blocks. This corresponds to the chunk size used by the
+LOB data layer when accessing/modifying the LOB value. Part of the chunk is
+used to store system-related information and the rest stores the LOB value.
+This function returns the amount of space used in the LOB chunk to store 
+the LOB value.
+
+Syntax
+sword OCILobGetChunkSize ( OCISvcCtx      *svchp,
+                           OCIError       *errhp,
+                           OCILobLocator  *locp,
+                           ub4            *chunksizep );
+
+Comments
+ Performance will be improved if the user issues read/write
+requests using a multiple of this chunk size. For writes, there is an added 
+benefit since LOB chunks are versioned and, if all writes are done on chunk
+basis, no extra/excess versioning is done nor duplicated. Users could batch 
+up the write until they have enough for a chunk instead of issuing several
+write calls for the same chunk.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - a LOB locator that uniquely references the LOB. For internal
+LOBs, this locator must be a locator that was obtained from the server 
+specified by svchp. For FILEs, this locator can be initialized by a Select or
+OCILobFileSetName.
+chunksizep (OUT) - On output, it is the length of the LOB if not NULL - for 
+character LOBs it is the number of characters, for binary LOBs it is the 
+number of bytes in the LOB.
+
+Related Functions
+
+
+OCILobGetLength()
+
+Name
+OCI Lob/File Length
+
+Purpose
+Gets the length of a LOB/FILE. 
+
+Syntax
+sword OCILobGetLength ( OCISvcCtx      *svchp,
+                        OCIError       *errhp,
+                        OCILobLocator  *locp,
+                        ub4            *lenp );
+
+Comments
+Gets the length of a LOB/FILE. If the LOB/FILE is NULL, the length is 
+undefined.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - a LOB locator that uniquely references the LOB. For internal
+LOBs, this locator must be a locator that was obtained from the server 
+specified by svchp. For FILEs, this locator can be initialized by a Select or
+OCILobFileSetName.
+lenp (OUT) - On output, it is the length of the LOB if not NULL - for 
+character LOBs it is the number of characters, for binary LOBs it is the 
+number of bytes in the LOB.
+
+Related Functions
+OCIErrorGet, OCIFileSetName
+
+
+
+
+OCILobIsEqual()
+
+Name
+
+OCI Lob Is Equal
+
+Purpose
+Compares two LOB locators for equality.
+
+Syntax
+sword OCILobIsEqual ( OCIEnv                  *envhp,
+                      CONST OCILobLocator     *x,
+                      CONST OCILobLocator     *y,
+                      boolean                 *is_equal );
+
+Comments
+Compares the given LOB locators for equality.  Two LOB locators are equal if 
+and only if they both refer to the same LOB data.
+Two NULL locators are considered not equal by this function.
+Parameters
+envhp (IN) - the OCI environment handle.
+x (IN) - LOB locator to compare.
+y (IN) - LOB locator to compare.
+is_equal (OUT) - TRUE, if the LOB locators are equal; FALSE if they are not.
+
+See also
+OCILobAssign, OCILobLocatorIsInit
+OCILobLocatorAssign()
+OCILobIsTemporary()
+
+Name
+
+OCI Lob Is Temporary
+
+Purpose
+  Tests if this locator points to a temporary LOB
+
+Syntax
+sword OCILobIsTemporary(OCIEnv            *envp,
+                        OCIError          *errhp,
+                        OCILobLocator     *locp,
+                        boolean           *is_temporary);
+
+Comments
+Tests the locator to determine if it points to a temporary LOB.
+If so, is_temporary is set to TRUE. If not, is_temporary is set
+to FALSE.
+
+Parameters
+envp (IN) - the environment handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN) - the locator to test for temporary LOB
+is_temporary(OUT) - TRUE, if the LOB locator points to a temporary LOB;
+                    FALSE, if not.
+
+See Also
+OCILobCreateTemporary, OCILobFreeTemporary
+
+
+
+OCILobLoadFromFile()
+
+Name
+OCI Lob Load From File
+
+Purpose
+Load/copy all or a portion of the file into an internal LOB.
+
+Syntax
+sword OCILobLoadFromFile ( OCISvcCtx        *svchp,
+                           OCIError         *errhp,
+                           OCILobLocator    *dst_locp,
+                           OCILobLocator    *src_filep,
+                           ub4              amount,
+                           ub4              dst_offset,
+                           ub4              src_offset );
+
+Comments
+Loads/copies a portion or all of a file value into an internal LOB as 
+specified.  The data is copied from the source file to the destination 
+internal LOB (BLOB/CLOB).  No character set conversions are performed 
+when copying the bfile data to a clob/nclob.  The bfile data must already
+be in the same character set as the clob/nclob in the database.  No
+error checking is performed to verify this.
+The source (src_filep) and the destination (dlopb) LOBs must already exist.
+If the data already exists at the destination's start position, it is 
+overwritten with the source data. If the destination's start position is 
+beyond the end of the current data, a hole is created from the end of the data
+to the beginning of the newly written data from the source. The destination 
+LOB is extended to accommodate the newly written data if it extends 
+beyond the current length of the destination LOB. 
+It is an error to extend the destination LOB beyond the maximum length 
+allowed or to try to copy from a NULL LOB.
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+dst_locp (IN/OUT) - a locator uniquely referencing the destination internal 
+LOB which may be of type blob, clob, or nclob. 
+src_filep (IN/OUT) - a locator uniquely referencing the source BFILE. 
+amount (IN) - the number of bytes to be copied.
+dst_offset (IN) - this is the absolute offset for the destination LOB. 
+For character LOBs it is the number of characters from the beginning of the 
+LOB at which to begin writing. For binary LOBs it is the number of bytes from 
+the beginning of the lob from which to begin reading. The offset starts at 1.
+src_offset (IN) - this is the absolute offset for the source BFILE.  It is the 
+number of bytes from the beginning of the LOB.  The offset starts at 1.
+
+See Also 
+OCIErrorGet(), OCILobAppend(), OCILobWrite(), OCILobTrim(), OCILobCopy()
+
+
+Name
+OCI Lob LOCATOR ASsiGn
+
+Purpose
+Assigns one LOB/FILE locator to another.
+
+Syntax
+sword OCILobLocatorAssign ( OCISvcCtx             *svchp, 
+                            OCIError              *errhp, 
+                            CONST OCILobLocator   *src_locp, 
+                            OCILobLocator         **dst_locpp );
+
+Comments
+Assign source locator to destination locator.  After the assignment, both 
+locators refer to the same LOB data.  For internal LOBs, the source locator's 
+LOB data gets copied to the destination locator's LOB data only when the 
+destination locator gets stored in the table.  Therefore, issuing a flush of 
+the object containing the destination locator will copy the LOB data. For 
+FILEs only the locator that refers to the OS file is copied to the table. The
+OS file is not copied.
+Note : the only difference between this and OCILobAssign is that this takes
+a OCI service handle pointer instead of a OCI environment handle pointer
+
+Parameters
+svchp (IN/OUT) - OCI service handle initialized in object mode.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 
+in errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+src_locp (IN) - LOB locator to copy from.
+dst_locpp (IN/OUT) - LOB locator to copy to.  The caller must allocate space 
+for the OCILobLocator by calling OCIDescriptorAlloc().
+
+See also
+OCIErrorGet()
+OCILobIsEqual()
+OCILobLocatorIsInit()
+OCILobAssign()
+
+
+OCILobLocatorIsInit()
+
+Name
+OCI LOB locator is initialized?
+
+Purpose
+Tests to see if a given LOB locator is initialized.
+
+Syntax
+sword OCILobLocatorIsInit ( OCIEnv   *envhp,
+                            OCIError *errhp,
+                            CONST OCILobLocator *locp,
+                            boolean *is_initialized );
+
+Comments
+Tests to see if a given LOB locator is initialized.
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic information 
+can be obtained by calling OCIErrorGet().
+locp (IN) - the LOB locator being tested
+is_initialized (OUT) - returns TRUE if the given LOB locator is initialized; 
+FALSE if it is not.
+
+See also
+OCIErrorGet, OCILobIsEqual
+
+
+OCILobOpen()
+
+Name
+OCI Lob Open
+Purpose
+ Open an internal LOB or BFILE locator.
+Syntax
+sword OCILobOpen( OCISvcCtx      *svchp,
+                  OCIError       *errhp,
+                  OCILobLocator  *locp,
+                  ub1             mode);
+
+Comments
+Opens an internal LOB or a Bfile. A LOB can be opened only once in a 
+transaction. A LOB opened in a transaction has to be closed before 
+committing the transaction. Otherwise, the transaction is rolled back.
+A LOB cannot be opened in read_write mode without starting a transaction.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+mode(IN) - mode can be OCI_LOB_READONLY, OCI_LOB_READWRITE
+
+Related functions
+OCILobClose(), OCIIsLobOpen()
+
+OCILobRead()
+
+Name
+OCI Lob/File ReaD
+
+Purpose
+Reads a portion of a LOB/FILE as specified by the call into a buffer. 
+
+Syntax
+sword OCILobRead ( OCISvcCtx       *svchp,
+                   OCIError        *errhp,
+                   OCILobLocator   *locp,
+                   ub4             offset,
+                   ub4             *amtp,
+                   dvoid           *bufp,
+                   ub4             bufl,
+                   dvoid           *ctxp,  
+                   OCICallbackLobRead (cbfp)
+                                   (
+                                    dvoid         *ctxp,
+                                    CONST dvoid   *bufp,
+                                    ub4           len,
+                                    ub1           piece )
+                   ub2             csid,
+                   ub1             csfrm );
+
+Comments
+Reads a portion of a LOB/FILE as specified by the call into a buffer. Data read
+from a hole is returned as 0s. It is an error to try to read from a NULL LOB/
+FILE. The OS FILE must already exist on the server and must have been opened
+using the input locator. Oracle must hav epermission to read the OS file and 
+user must have read permission on the directory object.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+offset (IN) - On input, it is the absolute offset, for character LOBs in the 
+number of characters from the beginning of the LOB, for binary LOBs it is the 
+number of bytes. Starts from 1.
+amtp (IN/OUT) - On input, the number of character or bytes to be read. On 
+output, the actual number of bytes or characters read. 
+If the amount of bytes to be read is larger than the buffer length it is 
+assumed that the LOB is being read in a streamed mode. On input if this value 
+is 0, then the data shall be read in streamed mode from the LOB until the end 
+of LOB. If the data is read in pieces, *amtp always contains the length of the last piece read.
+If a callback function is defined, then this callback function will be invoked 
+each time bufl bytes are read off the pipe. Each piece will be written into 
+bufp.
+If the callback function is not defined, then OCI_NEED_DATA error code will 
+be returned. The application must invoke the LOB read over and over again to 
+read more pieces of the LOB until the OCI_NEED_DATA error code is not 
+returned. The buffer pointer and the length can be different in each call 
+if the pieces are being read into different sizes and location. 
+bufp (IN) - the pointer to a buffer into which the piece will be read. The 
+length of the allocated memory is assumed to be bufl. 
+bufl (IN) - the length of the buffer in octets. 
+ctxp (IN) - the context for the call back function. Can be NULL.
+cbfp (IN) - a callback that may be registered to be called for each piece. If 
+this is NULL, then OCI_NEED_DATA will be returned for each piece. 
+The callback function must return OCI_CONTINUE for the read to continue. 
+If any other error code is returned, the LOB read is aborted. 
+  ctxp (IN) - the context for the call back function. Can be NULL.
+  bufp (IN) - a buffer pointer for the piece.
+  len (IN) - the length of length of current piece in bufp.
+  piece (IN) - which piece - OCI_FIRST_PIECE, OCI_NEXT_PIECE or 
+  OCI_LAST_PIECE.
+csid - the character set ID of the buffer data
+csfrm - the character set form of the buffer data
+
+Related Functions
+OCIErrorGet, OCILobWrite, OCILobFileOpen, OCILobFileSetName, CREATE DIRECTORY
+
+
+
+
+OCILobTrim()
+
+Name
+
+OCI Lob  Trim
+
+Purpose
+Trims the lob value to a shorter length
+
+Syntax
+sword OCILobTrim ( OCISvcCtx       *svchp,
+                 OCIError        *errhp,
+                 OCILobLocator   *locp,
+                 ub4             newlen );
+
+Comments
+Truncates LOB data to a specified shorter length. 
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a LOB locator that uniquely references the LOB. This locator 
+must be a locator that was obtained from the server specified by svchp. 
+newlen (IN) - the new length of the LOB data, which must be less than or equal
+to the current length. 
+
+Related Functions
+OCIErrorGet, OCILobWrite, OCiLobErase, OCILobAppend, OCILobCopy
+
+
+
+
+
+OCILobWrite()
+
+Name
+OCI Lob Write
+
+Purpose
+Writes a buffer into a LOB
+
+Syntax
+sword OCILobWrite ( OCISvcCtx       *svchp,
+                    OCIError        *errhp,
+                    OCILobLocator   *locp,
+                    ub4             offset,
+                    ub4             *amtp,
+                    dvoid           *bufp, 
+                    ub4             buflen,
+                    ub1             piece,
+                    dvoid           *ctxp,  
+                    OCICallbackLobWrite   (cbfp)
+                                    (
+                                    dvoid    *ctxp,
+                                    dvoid    *bufp,
+                                    ub4      *lenp,
+                                    ub1      *piecep ) 
+                    ub2             csid
+                    ub1             csfrm );
+
+
+Comments
+Writes a buffer into a LOB as specified. If LOB data already exists 
+it is overwritten with the data stored in the buffer.
+The buffer can be written to the LOB in a single piece with this call, or
+it can be provided piecewise using callbacks or a standard polling method.
+If this value of the piece parameter is OCI_FIRST_PIECE, data must be 
+provided through callbacks or polling.
+If a callback function is defined in the cbfp parameter, then this callback 
+function will be invoked to get the next piece after a piece is written to the 
+pipe. Each piece will be written from bufp.
+If no callback function is defined, then OCILobWrite() returns the 
+OCI_NEED_DATA error code. The application must all OCILobWrite() again 
+to write more pieces of the LOB. In this mode, the buffer pointer and the 
+length can be different in each call if the pieces are of different sizes and 
+from different locations. A piece value of OCI_LAST_PIECE terminates the 
+piecewise write. 
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+offset (IN) - On input, it is the absolute offset, for character LOBs in 
+the number of characters from the beginning of the LOB, for binary LOBs it 
+is the number of bytes. Starts at 1.
+bufp (IN) - the pointer to a buffer from which the piece will be written. The 
+length of the allocated memory is assumed to be the value passed in bufl. Even 
+if the data is being written in pieces, bufp must contain the first piece of 
+the LOB when this call is invoked.
+bufl (IN) - the length of the buffer in bytes.
+Note: This parameter assumes an 8-bit byte. If your platform uses a 
+longer byte, the value of bufl must be adjusted accordingly.
+piece (IN) - which piece of the buffer is being written. The default value for
+this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a 
+single piece.
+The following other values are also possible for piecewise or callback mode: 
+OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE.
+amtp (IN/OUT) - On input, takes the number of character or bytes to be 
+written. On output, returns the actual number of bytes or characters written. 
+If the data is written in pieces, *amtp will contain the total length of the 
+pieces written at the end of the call (last piece written) and is undefined in
+between. 
+(Note it is different from the piecewise read case)
+ctxp (IN) - the context for the call back function. Can be NULL.
+cbfp (IN) - a callback that may be registered to be called for each piece in a 
+piecewise write. If this is NULL, the standard polling method will be used.
+The callback function must return OCI_CONTINUE for the write to continue. 
+If any other error code is returned, the LOB write is aborted. The 
+callback takes the following parameters:
+  ctxp (IN) - the context for the call back function. Can be NULL.
+  bufp (IN/OUT) - a buffer pointer for the piece.
+  lenp (IN/OUT) - the length of the buffer (in octets) and the length of 
+  current piece in bufp (out octets).
+  piecep (OUT) - which piece - OCI_NEXT_PIECE or OCI_LAST_PIECE.
+csid - the character set ID of the buffer data
+csfrm - the character set form of the buffer data
+Related Functions
+
+
+
+
+
+
+OCILobWriteAppend()
+
+Name
+OCI Lob Write Append
+
+Purpose
+Writes data to the end of a LOB value. This call provides the ability
+to get the length of the data and append it to the end of the LOB in
+a single round trip to the server.
+
+
+Syntax
+sword OCILobWriteAppend ( OCISvcCtx       *svchp,
+                    OCIError        *errhp,
+                    OCILobLocator   *locp,
+                    ub4             *amtp,
+                    dvoid           *bufp, 
+                    ub4             buflen,
+                    ub1             piece,
+                    dvoid           *ctxp,  
+                    OCICallbackLobWrite   (cbfp)
+                                    (
+                                    dvoid    *ctxp,
+                                    dvoid    *bufp,
+                                    ub4      *lenp,
+                                    ub1      *piecep ) 
+                    ub2             csid
+                    ub1             csfrm );
+
+
+Comments
+Writes a buffer to the end of a LOB as specified. If LOB data already exists 
+it is overwritten with the data stored in the buffer.
+The buffer can be written to the LOB in a single piece with this call, or
+it can be provided piecewise using callbacks or a standard polling method.
+If this value of the piece parameter is OCI_FIRST_PIECE, data must be 
+provided through callbacks or polling.
+If a callback function is defined in the cbfp parameter, then this callback 
+function will be invoked to get the next piece after a piece is written to the 
+pipe. Each piece will be written from bufp.
+If no callback function is defined, then OCILobWriteAppend() returns the 
+OCI_NEED_DATA error code. The application must all OCILobWriteAppend() again 
+to write more pieces of the LOB. In this mode, the buffer pointer and the 
+length can be different in each call if the pieces are of different sizes and 
+from different locations. A piece value of OCI_LAST_PIECE terminates the 
+piecewise write. 
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+offset (IN) - On input, it is the absolute offset, for character LOBs in 
+the number of characters from the beginning of the LOB, for binary LOBs it 
+is the number of bytes. Starts at 1.
+bufp (IN) - the pointer to a buffer from which the piece will be written. The 
+length of the allocated memory is assumed to be the value passed in bufl. Even 
+if the data is being written in pieces, bufp must contain the first piece of 
+the LOB when this call is invoked.
+bufl (IN) - the length of the buffer in bytes.
+Note: This parameter assumes an 8-bit byte. If your platform uses a 
+longer byte, the value of bufl must be adjusted accordingly.
+piece (IN) - which piece of the buffer is being written. The default value for
+this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a 
+single piece.
+The following other values are also possible for piecewise or callback mode: 
+OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE.
+amtp (IN/OUT) - On input, takes the number of character or bytes to be 
+written. On output, returns the actual number of bytes or characters written. 
+If the data is written in pieces, *amtp will contain the total length of the 
+pieces written at the end of the call (last piece written) and is undefined in
+between. 
+(Note it is different from the piecewise read case)
+ctxp (IN) - the context for the call back function. Can be NULL.
+cbfp (IN) - a callback that may be registered to be called for each piece in a 
+piecewise write. If this is NULL, the standard polling method will be used.
+The callback function must return OCI_CONTINUE for the write to continue. 
+If any other error code is returned, the LOB write is aborted. The 
+callback takes the following parameters:
+  ctxp (IN) - the context for the call back function. Can be NULL.
+  bufp (IN/OUT) - a buffer pointer for the piece.
+  lenp (IN/OUT) - the length of the buffer (in octets) and the length of 
+  current piece in bufp (out octets).
+  piecep (OUT) - which piece - OCI_NEXT_PIECE or OCI_LAST_PIECE.
+csid - the character set ID of the buffer data
+csfrm - the character set form of the buffer data
+Related Functions
+
+
+
+
+
+OCILogoff()
+Name
+OCI simplified Logoff
+Purpose
+This function is used to terminate a session created with OCILogon() or
+OCILogon2().
+Syntax
+sword OCILogoff ( OCISvcCtx      *svchp
+                   OCIError       *errhp );
+Comments
+This call is used to terminate a session which was created with OCILogon() or
+OCILogon2().
+This call implicitly deallocates the server, authentication, and service 
+context handles.
+Note: For more information on logging on and off in an application, 
+refer to the section "Application Initialization, Connection, and 
+Authorization" on page 2-16.
+Parameters
+svchp (IN) - the service context handle which was used in the call to 
+OCILogon() or OCILogon2().
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+See Also
+OCILogon(), OCILogon2().
+
+
+
+
+
+
+OCILogon()
+Name
+OCI Service Context Logon
+Purpose
+This function is used to create a simple logon session.
+Syntax
+sword OCILogon ( OCIEnv          *envhp,
+                       OCIError        *errhp,
+                       OCISvcCtx       *svchp,
+                       CONST OraText      *username,
+                       ub4             uname_len,
+                       CONST OraText      *password,
+                       ub4             passwd_len,
+                       CONST OraText      *dbname,
+                       ub4             dbname_len );
+Comments
+This function is used to create a simple logon session for an application. 
+Note: Users requiring more complex session (e.g., TP monitor 
+applications) should refer to the section "Application Initialization, 
+Connection, and Authorization" on page 2-16.
+This call allocates the error and service context handles which are passed to 
+it. This call also implicitly allocates server and authentication handles 
+associated with the session.  These handles can be retrieved by calling 
+OCIAttrGet() on the service context handle.
+Parameters
+envhp (IN) - the OCI environment handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+svchp (OUT) - the service context pointer.
+username (IN) - the username.
+uname_len (IN) - the length of username.
+password (IN) - the user's password.
+passwd_len (IN) - the length of password.
+dbname (IN) - the name of the database to connect to.
+dbname_len (IN) - the length of dbname.
+See Also
+OCILogoff()
+
+
+
+
+
+OCILogon2()
+Name
+OCI Service Context Logon
+Purpose
+This function is used to create a logon session in connection pooling mode.
+Syntax
+sword OCILogon2 ( OCIEnv          *envhp,
+                       OCIError        *errhp,
+                       OCISvcCtx       **svchp,
+                       CONST OraText      *username,
+                       ub4             uname_len,
+                       CONST OraText      *password,
+                       ub4             passwd_len,
+                       CONST OraText      *dbname,
+                       ub4             dbname_len,
+                       ub4             mode);
+Comments
+This function is used to create a simple logon session for an application in
+Connection Pooling mode. The valid values for mode are currently OCI_POOL and
+OCI_DEFAULT. Call to this function with OCI_DEFAULT mode is equivalent to 
+OCILogon() call.
+This call allocates the error and service context handles which are passed to 
+it. This call also implicitly allocates server and authentication handles 
+associated with the session.  These handles can be retrieved by calling 
+OCIAttrGet() on the service context handle. This call assumes that 
+OCIConnectionPoolCreate() has already been called for the same dbname.
+Parameters
+envhp (IN) - the OCI environment handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+svchp (OUT) - the service context pointer.
+username (IN) - the username.
+uname_len (IN) - the length of username.
+password (IN) - the user's password. If this is null, it is assumed that a
+                proxy session has to be created and the required grants on 
+                the database are already done.
+passwd_len (IN) - the length of password.
+dbname (IN) - the name of the database to connect to.
+dbname_len (IN) - the length of dbname.
+mode (IN) - the mode for doing the server attach. Should be OCI_POOL for
+            using Connection Pooling.
+
+
+See Also
+OCILogoff()
+
+
+
+
+
+OCIMemoryFree()
+Name
+OCI FREE Memory
+Purpose
+Frees up storage associated with the pointer.
+Syntax
+void OCIMemoryFree ( CONST OCIStmt   *stmhp,
+                     dvoid           *memptr);
+Comments
+Frees up dynamically allocated data pointers associated with the pointer using 
+either the default memory free function or the registered memory free 
+function, as the case may be.
+A user-defined memory free function can be registered during the initial call 
+to OCIInitialize(). 
+This call is always successful. 
+Parameters
+stmhp (IN) - statement handle which returned this data buffer.
+memptr (IN) - pointer to data allocated by the client library. 
+Related Functions
+OCIInitialize()
+
+
+
+
+
+OCIParamGet()
+Name
+OCI Get PARaMeter
+Purpose
+Returns a descriptor of a parameter specified by position in the describe 
+handle or statement handle.
+Syntax
+sword OCIParamGet ( CONST dvoid       *hndlp,
+                  ub4         htype,
+                  OCIError    *errhp,
+                  dvoid    **parmdpp,
+                  ub4         pos );
+Comments
+This call returns a descriptor of a parameter specified by position in the 
+describe handle or statement handle. Parameter descriptors are always 
+allocated internally by the OCI library. They are read-only.
+OCI_NO_DATA may be returned if there are no parameter descriptors for this 
+position. 
+See Appendix B for more detailed information about parameter descriptor 
+attributes.
+Parameters
+hndlp (IN) - a statement handle or describe handle. The OCIParamGet() 
+function will return a parameter descriptor for this handle. 
+htype (IN) - the type of the handle passed in the handle parameter. Valid 
+types are OCI_HTYPE_DESCRIBE, for a describe handle OCI_HTYPE_STMT, for a 
+statement handle
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+parmdpp (OUT) - a descriptor of the parameter at the position given in the pos 
+parameter.
+pos (IN) - position number in the statement handle or describe handle. A 
+parameter descriptor will be returned for this position.
+Note: OCI_NO_DATA may be returned if there are no parameter 
+descriptors for this position. 
+Related Functions
+OCIAttrGet(), OCIAttrSet()
+
+
+
+
+
+OCIParamSet()
+Name
+OCI Parameter Set in handle
+Purpose
+Used to set a complex object retrieval descriptor into a complex object 
+retrieval handle.
+Syntax
+sword   OCIParamGet ( dvoid *hndlp,
+                       ub4 htyp,
+                      OCIError *errhp,
+                      CONST dvoid *dscp,
+                      ub4 dtyp,
+                      ub4 pos );
+Comments
+This call sets a given complex object retrieval descriptor into a complex 
+object retrieval handle.
+The handle must have been previously allocated using OCIHandleAlloc(), and 
+the descriptor must have been previously allocated using OCIDescAlloc(). 
+Attributes of the descriptor are set using OCIAttrSet().
+Parameters
+hndlp (IN/OUT) - handle pointer.
+htype (IN) - handle type.
+errhp (IN/OUT) - error handle.
+dscp (IN) - complex object retrieval descriptor pointer.
+dtyp (IN) - 
+pos (IN) - position number.
+See Also
+
+
+
+
+
+OCIPasswordChange()
+Name
+OCI Change PassWord
+Purpose
+This call allows the password of an account to be changed.
+Syntax
+sword OCIPasswordChange ( OCISvcCtx     *svchp,
+                        OCIError      *errhp,
+                        CONST OraText    *user_name,
+                        ub4           usernm_len,
+                        CONST OraText    *opasswd,
+                        ub4           opasswd_len,
+                        CONST OraText    *npasswd,
+                        sb4           npasswd_len,
+                        ub4           mode);
+Comments
+This call allows the password of an account to be changed. This call is 
+similar to OCISessionBegin() with the following differences:
+If the user authentication is already established, it authenticates 
+the account using the old password and then changes the 
+password to the new password
+If the user authentication is not established, it establishes a user 
+authentication and authenticates the account using the old 
+password, then changes the password to the new password.
+This call is useful when the password of an account is expired and 
+OCISessionBegin() returns an error or warning which indicates that the 
+password has expired. 
+Parameters
+svchp (IN/OUT) - a handle to a service context. The service context handle 
+must be initialized and have a server context handle associated with it.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+user_name (IN) - specifies the user name. It points to a character string, 
+whose length is specified in usernm_len. This parameter must be NULL if the 
+service context has been initialized with an authentication handle.
+usernm_len (IN) - the length of the user name string specified in user_name. 
+For a valid user name string, usernm_len must be non-zero.
+opasswd (IN) - specifies the user's old password. It points to a character 
+string, whose length is specified in opasswd_len .
+opasswd_len (IN) - the length of the old password string specified in opasswd. 
+For a valid password string, opasswd_len must be non-zero.
+npasswd (IN) - specifies the user's new password. It points to a character 
+string, whose length is specified in npasswd_len which must be non-zero for a 
+valid password string. If the password complexity verification routine is 
+specified in the user's profile to verify the new password's complexity, the 
+new password must meet the complexity requirements of the verification 
+function.
+npasswd_len (IN)  - then length of the new password string specified in 
+npasswd. For a valid password string, npasswd_len must be non-zero.
+mode - pass as OCI_DEFAULT.
+Related Functions
+OCISessionBegin()
+
+
+----------------------------------OCIReset------------------------------------
+
+
+OCIReset()
+Name
+OCI Reset
+Purpose
+Resets the interrupted asynchronous operation and protocol. Must be called
+if a OCIBreak call had been issued while a non-blocking operation was in
+progress.
+Syntax
+sword OCIReset ( dvoid      *hndlp,
+                 OCIError   *errhp);
+Comments
+This call is called in non-blocking mode ONLY. Resets the interrupted
+asynchronous operation and protocol. Must be called if a OCIBreak call 
+had been issued while a non-blocking operation was in progress. 
+Parameters
+hndlp (IN) - the service context handle or the server context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+Related Functions
+
+
+OCIResultSetToStmt()
+Name
+OCI convert Result Set to Statement Handle
+Purpose
+Converts a descriptor to statement handle for fetching rows.
+Syntax
+sword OCIResultSetToStmt ( OCIResult     *rsetdp,
+                         OCIError      *errhp );
+Comments
+Converts a descriptor to statement handle for fetching rows.
+A result set descriptor can be allocated with a call to OCIDescAlloc().
+Parameters
+rsetdp (IN/OUT) - a result set descriptor pointer. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+Related Functions
+OCIDescAlloc()
+
+
+
+
+OCIServerAttach()
+Name
+OCI ATtaCH to server
+Purpose
+Creates an access path to a data source for OCI operations.
+Syntax
+sword OCIServerAttach ( OCIServer    *srvhp,
+                      OCIError     *errhp,
+                      CONST OraText   *dblink,
+                      sb4          dblink_len,
+                      ub4          mode);
+Comments
+This call is used to create an association between an OCI application and a 
+particular server. 
+This call initializes a server context handle, which must have been previously 
+allocated with a call to OCIHandleAlloc().
+The server context handle initialized by this call can be associated with a 
+service context through a call to OCIAttrSet(). Once that association has been 
+made, OCI operations can be performed against the server.
+If an application is operating against multiple servers, multiple server 
+context handles can be maintained. OCI operations are performed against 
+whichever server context is currently associated with the service context.
+Parameters
+srvhp (IN/OUT) - an uninitialized server context handle, which gets 
+initialized by this call. Passing in an initialized server handle causes an 
+error. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+dblink (IN) - specifies the database (server) to use. This parameter points to
+a character string which specifies a connect string or a service point. If the 
+connect string is NULL, then this call attaches to the default host. The length
+of connstr is specified in connstr_len. The connstr pointer may be freed by the
+caller on return.
+dblink_len (IN) - the length of the string pointed to by connstr. For a valid 
+connect string name or alias, connstr_len must be non-zero.
+mode (IN) - specifies the various modes of operation.  For release 8.0, pass as
+OCI_DEFAULT - in this mode, calls made to the server on this server context 
+are made in blocking mode. 
+Example
+See the description of OCIStmtPrepare() on page 13-96 for an example showing 
+the use of OCIServerAttach().
+Related Functions
+OCIServerDetach()
+
+
+
+OCIServerDetach()
+Name
+OCI DeTaCH server
+Purpose
+Deletes an access to a data source for OCI operations.
+Syntax
+sword OCIServerDetach ( OCIServer   *svrhp,
+                      OCIError    *errhp,
+                      ub4         mode); 
+Comments
+This call deletes an access to data source for OCI operations, which was 
+established by a call to OCIServerAttach(). 
+Parameters
+srvhp (IN) - a handle to an initialized server context, which gets reset to 
+uninitialized state. The handle is not de-allocated. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+mode (IN) - specifies the various modes of operation. The only valid mode is 
+OCI_DEFAULT for the default mode. 
+Related Functions
+OCIServerAttach()
+
+
+
+OCIServerVersion()
+Name
+OCI VERSion
+Purpose
+Returns the version string of the Oracle server.
+Syntax
+sword OCIServerVersion ( dvoid        *hndlp, 
+                       OCIError     *errhp, 
+                       OraText         *bufp,
+                       ub4          bufsz
+                       ub1          hndltype );
+Comments
+This call returns the version string of the Oracle server. 
+For example, the following might be returned as the version string if your 
+application is running against a 7.3.2 server:
+Oracle7 Server Release 7.3.2.0.0 - Production Release
+PL/SQL Release 2.3.2.0.0 - Production
+CORE Version 3.5.2.0.0 - Production
+TNS for SEQUENT DYNIX/ptx: Version 2.3.2.0.0 - Production
+NLSRTL Version 3.2.2.0.0 - Production
+
+Parameters
+hndlp (IN) - the service context handle or the server context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+bufp (IN) - the buffer in which the version information is returned.
+bufsz (IN) - the length of the buffer.
+hndltype (IN) - the type of handle passed to the function.
+Related Functions
+
+
+
+
+
+OCISessionBegin()
+Name
+OCI Session Begin and authenticate user
+Purpose
+Creates a user authentication and begins a user session for a given server.
+Syntax
+sword OCISessionBegin ( OCISvcCtx     *svchp,
+                      OCIError      *errhp,
+                      OCISession    *usrhp,
+                      ub4           credt,
+                      ub4           mode);
+
+Comments
+For Oracle8, OCISessionBegin() must be called for any given server handle 
+before requests can be made against it. Also, OCISessionBegin() only supports 
+authenticating the user for access to the Oracle server specified by the 
+server handle in the service context. In other words, after OCIServerAttach() 
+is called to initialize a server handle, OCISessionBegin() must be called to 
+authenticate the user for that given server. 
+When OCISessionBegin() is called for the first time for the given server 
+handle, the initialized authentication handle is called a primary 
+authentication context. A primary authentication context may not be created 
+with the OCI_MIGRATE mode. Also, only one primary authentication context can 
+be created for a given server handle and the primary authentication context c
+an only ever be used with that server handle. If the primary authentication 
+context is set in a service handle with a different server handle, then an 
+error will result.
+After OCISessionBegin() has been called for the server handle, and the primary 
+authentication context is set in the service handle, OCISessionBegin() may be 
+called again to initialize another authentication handle with different (or 
+the same) credentials. When OCISessionBegin() is called with a service handle 
+set with a primary authentication context, the returned authentication context
+in authp is called a user authentication context. As many user authentication 
+contexts may be initialized as desired.
+User authentication contexts may be created with the OCI_MIGRATE mode. 
+If the OCI_MIGRATE mode is not specified, then the user authentication 
+context can only ever be used with the same server handle set in svchp. If 
+OCI_MIGRATE mode is specified, then the user authentication may be set 
+with different server handles. However, the user authentication context is 
+restricted to use with only server handles which resolve to the same database 
+instance and that have equivalent primary authentication contexts. Equivalent 
+authentication contexts are those which were authenticated as the same 
+database user.
+OCI_SYSDBA, OCI_SYSOPER, and OCI_PRELIM_AUTH may only be used 
+with a primary authentication context.
+To provide credentials for a call to OCISessionBegin(), one of two methods are 
+supported. The first is to provide a valid username and password pair for 
+database authentication in the user authentication handle passed to 
+OCISessionBegin(). This involves using OCIAttrSet() to set the 
+OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD attributes on the 
+authentication handle. Then OCISessionBegin() is called with 
+OCI_CRED_RDBMS.
+Note: When the authentication handle is terminated using 
+OCISessionEnd(), the username and password attributes remain 
+unchanged and thus can be re-used in a future call to OCISessionBegin(). 
+Otherwise, they must be reset to new values before the next 
+OCISessionBegin() call.
+The second type of credentials supported are external credentials. No 
+attributes need to be set on the authentication handle before calling 
+OCISessionBegin(). The credential type is OCI_CRED_EXT. This is equivalent 
+to the Oracle7 `connect /' syntax. If values have been set for 
+OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD, then these are 
+ignored if OCI_CRED_EXT is used.
+Parameters
+svchp (IN) - a handle to a service context. There must be a valid server 
+handle set in svchp.
+errhp (IN) - an error handle to the retrieve diagnostic information.
+usrhp (IN/OUT) - a handle to an authentication context, which is initialized 
+by this call.
+credt (IN) - specifies the type of credentials to use for authentication. 
+Valid values for credt are:
+OCI_CRED_RDBMS - authenticate using a database username and 
+password pair as credentials. The attributes OCI_ATTR_USERNAME 
+and OCI_ATTR_PASSWORD should be set on the authentication 
+context before this call.
+OCI_CRED_EXT - authenticate using external credentials. No username 
+or password is provided.
+mode (IN) - specifies the various modes of operation. Valid modes are:
+OCI_DEFAULT - in this mode, the authentication context returned may 
+only ever be set with the same server context specified in svchp. This 
+establishes the primary authentication context.
+OCI_MIGRATE - in this mode, the new authentication context may be 
+set in a service handle with a different server handle. This mode 
+establishes the user authentication context. 
+OCI_SYSDBA - in this mode, the user is authenticated for SYSDBA 
+access.
+OCI_SYSOPER - in this mode, the user is authenticated for SYSOPER 
+access.
+OCI_PRELIM_AUTH - this mode may only be used with OCI_SYSDBA 
+or OCI_SYSOPER to authenticate for certain administration tasks.
+Related Functions
+OCISessionEnd()
+
+
+
+
+
+
+OCISessionEnd()
+Name
+OCI Terminate user Authentication Context
+Purpose
+Terminates a user authentication context created by OCISessionBegin()
+Syntax
+sword OCISessionEnd ( OCISvcCtx       *svchp,
+                    OCIError        *errhp,
+                    OCISession      *usrhp,
+                    ub4             mode);
+
+Comments
+The user security context associated with the service context is invalidated 
+by this call. Storage for the authentication context is not freed. The 
+transaction specified by the service context is implicitly committed. The 
+transaction handle, if explicitly allocated, may be freed if not being used.
+Resources allocated on the server for this user are freed.
+The authentication handle may be reused in a new call to OCISessionBegin().
+Parameters
+svchp (IN/OUT) - the service context handle. There must be a valid server 
+handle and user authentication handle associated with svchp.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+usrhp (IN) - de-authenticate this user. If this parameter is passed as NULL, the 
+user in the service context handle is de-authenticated.
+mode (IN) - the only valid mode is OCI_DEFAULT.
+Example
+In this example, an authentication context is destroyed.
+Related Functions
+OCISessionBegin()
+
+
+
+
+OCIStmtExecute()
+Name
+OCI EXECute
+Purpose
+This call associates an application request with a server.
+Syntax
+sword OCIStmtExecute ( OCISvcCtx           *svchp,
+                     OCIStmt             *stmtp,
+                     OCIError            *errhp,
+                     ub4                 iters,
+                     ub4                 rowoff,
+                     CONST OCISnapshot   *snap_in,
+                     OCISnapshot         *snap_out,
+                     ub4                 mode );
+Comments
+This function  is used to execute a prepared SQL statement.
+Using an execute call, the application associates a request with a server. On 
+success, OCI_SUCCESS is returned.
+If a SELECT statement is executed, the description of the select list follows 
+implicitly as a response. This description is buffered on the client side for 
+describes, fetches and define type conversions. Hence it is optimal to 
+describe a select list only after an execute. 
+Also for SELECT statements, some results are available implicitly. Rows will 
+be received and buffered at the end of the execute. For queries with small row 
+count, a prefetch causes memory to be released in the server if the end of 
+fetch is reached, an optimization that may result in memory usage reduction. 
+Set attribute call has been defined to set the number of rows to be prefetched
+per result set.
+For SELECT statements, at the end of the execute, the statement handle 
+implicitly maintains a reference to the service context on which it is 
+executed. It is the user's responsibility to maintain the integrity of the 
+service context. If the attributes of a service context is changed for 
+executing some operations on this service context, the service context must 
+be restored to have the same attributes, that a statement was executed with, 
+prior to a fetch on the statement handle. The implicit reference is maintained 
+until the statement handle is freed or the fetch is cancelled or an end of 
+fetch condition is reached.
+Note: If output variables are defined for a SELECT statement before a 
+call to OCIStmtExecute(), the number of rows specified by iters will be 
+fetched directly into the defined output buffers and additional rows 
+equivalent to the prefetch count will be prefetched. If there are no 
+additional rows, then the fetch is complete without calling 
+OCIStmtFetch().
+The execute call will return errors if the statement has bind data types that 
+are not supported in an Oracle7 server.
+Parameters
+svchp (IN/OUT) - service context handle. 
+stmtp (IN/OUT) - an statement handle - defines the statement and the 
+associated data to be executed at the server. It is invalid to pass in a 
+statement handle that has bind of data types only supported in release 8.0 
+when srvchp points to an Oracle7 server. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. If the statement is being 
+batched and it is successful, then this handle will contain this particular 
+statement execution specific errors returned from the server when the batch is 
+flushed.
+iters (IN) - the number of times this statement is executed for non-Select 
+statements. For Select statements, if iters is non-zero, then defines must 
+have been done for the statement handle. The execution fetches iters rows into 
+these predefined buffers and prefetches more rows depending upon the prefetch 
+row count. This function returns an error if iters=0 for non-SELECT 
+statements.
+rowoff (IN) - the index from which the data in an array bind is relevant for 
+this multiple row execution. 
+snap_in (IN) - this parameter is optional. if supplied, must point to a 
+snapshot descriptor of type OCI_DTYPE_SNAP.  The contents of this descriptor 
+must be obtained from the snap_out parameter of a previous call.  The 
+descriptor is ignored if the SQL is not a SELECT.  This facility allows 
+multiple service contexts to ORACLE to see the same consistent snapshot of the 
+database's committed data.  However, uncommitted data in one context is not 
+visible to another context even using the same snapshot.
+snap_out (OUT) - this parameter optional. if supplied, must point to a 
+descriptor of type OCI_DTYPE_SNAP. This descriptor is filled in with an 
+opaque representation which is the current ORACLE "system change 
+number" suitable as a snap_in input to a subsequent call to OCIStmtExecute().  
+This descriptor should not be used any longer than necessary in order to avoid 
+"snapshot too old" errors. 
+mode (IN) - The modes are:
+If OCI_DEFAULT_MODE, the default mode, is selected, the request is 
+immediately executed. Error handle contains diagnostics on error if any. 
+OCI_EXACT_FETCH - if the statement is a SQL SELECT, this mode is 
+only valid if the application has set the prefetch row count prior to this 
+call. In this mode, the OCI library will get up to the number of rows 
+specified (i.e., prefetch row count plus iters). If the number of rows 
+returned by the query is greater than this value, OCI_ERROR will be 
+returned with ORA-01422 as the implementation specific error in a 
+diagnostic record. If the number of rows returned by the query is 
+smaller than the prefetch row count, OCI_SUCCESS_WITH_INFO will 
+be returned with ORA-01403 as the implementation specific error. The 
+prefetch buffer size is ignored and the OCI library tries to allocate all the 
+space required to contain the prefetched rows. The exact fetch semantics 
+apply to only the top level rows. No more rows can be fetched for this 
+query at the end of the call. 
+OCI_KEEP_FETCH_STATE - the result set rows (not yet fetched) of this 
+statement executed in this transaction will be maintained when the 
+transaction is detached for migration. By default, a query is cancelled 
+when a transaction is detached for migration. This mode is the default 
+mode when connected to a V7 server. 
+Related Functions
+OCIStmtPrepare()
+
+
+
+
+
+OCIStmtFetch()
+Name
+OCI FetCH
+Purpose
+Fetches rows from a query.
+Syntax
+sword OCIStmtFetch ( OCIStmt     *stmtp,
+                   OCIError    *errhp, 
+                   ub4         nrows,
+                   ub2         orientation,
+                   ub4         mode);
+Comments
+The fetch call is a local call, if prefetched rows suffice. However, this is 
+transparent to the application. If LOB columns are being read, LOB locators 
+are fetched for subsequent LOB operations to be performed on these locators. 
+Prefetching is turned off if LONG columns are involved. 
+A fetch with nrows set to 0 rows effectively cancels the fetch for this 
+statement.
+Parameters
+stmtp (IN) - a statement (application request) handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+nrows (IN) - number of rows to be fetched from the current position.
+orientation (IN) - for release 8.0, the only acceptable value is 
+OCI_FETCH_NEXT, which is also the default value. 
+mode (IN) - for release 8.0, beta-1, the following mode is defined.
+OCI_DEFAULT - default mode
+OCI_EOF_FETCH - indicates that it is the last fetch from the result set. 
+If nrows is non-zero, setting this mode effectively cancels fetching after 
+retrieving nrows, otherwise it cancels fetching immediately. 
+Related Functions
+OCIAttrGet()
+
+
+OCIStmtFetch2()
+Name
+OCI FetCH2
+Purpose
+Fetches rows from a query.
+Syntax
+sword OCIStmtFetch2 ( OCIStmt     *stmtp,
+                   OCIError    *errhp, 
+                   ub4         nrows,
+                   ub2         orientation,
+                   ub4         scrollOffset,
+                   ub4         mode);
+Comments
+The fetch call works similar to the OCIStmtFetch call with the 
+addition of the fetchOffset parameter. It can be used on any 
+statement handle, whether it is scrollable or not. For a 
+non-scrollable statement handle, the only acceptable value 
+will be OCI_FETCH_NEXT, and the fetchOffset parameter will be 
+ignored. Applications are encouraged to use this new call. 
+
+A fetchOffset with OCI_FETCH_RELATIVE is equivalent to 
+OCI_FETCH_CURRENT with a value of 0, is equivalent to 
+OCI_FETCH_NEXT with a value of 1, and equivalent to 
+OCI_FETCH_PRIOR with a value of -1. Note that the range of 
+accessible rows is [1,OCI_ATTR_ROW_COUNT] beyond which an 
+error could be raised if sufficient rows do not exist in 
+
+The fetch call is a local call, if prefetched rows suffice. However, this is 
+transparent to the application. If LOB columns are being read, LOB locators 
+are fetched for subsequent LOB operations to be performed on these locators. 
+Prefetching is turned off if LONG columns are involved. 
+A fetch with nrows set to 0 rows effectively cancels the fetch for this 
+statement.
+Parameters
+stmtp (IN) - a statement (application request) handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+nrows (IN) - number of rows to be fetched from the current position.
+It defaults to 1 for orientation OCI_FETCH_LAST.
+orientation (IN) -  The acceptable values are as follows, with 
+OCI_FETCH_NEXT being the default value.
+OCI_FETCH_CURRENT gets the current row, 
+OCI_FETCH_NEXT gets the next row from the current position,
+OCI_FETCH_FIRST gets the first row in the result set,
+OCI_FETCH_LAST gets the last row in the result set, 
+OCI_FETCH_PRIOR gets the previous row from the current row in the result set, 
+OCI_FETCH_ABSOLUTE will fetch the row number (specified by fetchOffset 
+parameter) in the result set using absolute positioning,
+OCI_FETCH_RELATIVE will fetch the row number (specified by fetchOffset 
+parameter) in the result set using relative positioning.
+scrollOffset(IN) - offset used with the OCI_FETCH_ABSOLUTE and 
+OCI_FETCH_RELATIVE orientation parameters only. It specify
+the new current position for scrollable result set. It is 
+ignored for non-scrollable result sets. 
+mode (IN) - for release 8.0, beta-1, the following mode is defined.
+OCI_DEFAULT - default mode
+OCI_EOF_FETCH - indicates that it is the last fetch from the result set. 
+If nrows is non-zero, setting this mode effectively cancels fetching after 
+retrieving nrows, otherwise it cancels fetching immediately. 
+Related Functions
+OCIAttrGet()
+
+
+OCIStmtGetBindInfo()
+Name
+OCI Get Bind Parameters
+Purpose
+Gets the bind and indicator variable names.
+Syntax
+sword OCIStmtGetBindInfo ( OCIStmt      *stmtp,
+                     OCIError     *errhp,
+                     ub4          size,
+                     ub4          startloc,
+                     sb4          *found,
+                     OraText         *bvnp[],
+                     ub1          bvnl[],
+                     OraText         *invp[],
+                     ub1          inpl[],
+                     ub1          dupl[],
+                     OCIBind      *hndl[] );
+
+Comments
+Gets the bind and indicator variable names. It returns the information for all 
+the bind variables (even the duplicate ones) and sets the found parameter to 
+the total number of bind variables and not just the number of distinct bind 
+variables.
+The statement must have been prepared with a call to OCIStmtPrepare() prior 
+to this call. 
+This call is processed locally.
+Parameters
+stmtp (IN) - the statement handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+size (IN) - the number of elements in each array.
+startloc (IN) - position of the  bind variable at which to start getting  bind 
+information.
+found (IN) - abs(found) gives the total number of bind variables in the 
+statement irrespective of the start position. Positive value if the number of 
+bind variables returned is less than the size provided, otherwise negative.
+bvnp (OUT) - array of pointers to hold bind variable names.
+bvnl (OUT) - array to hold the length of the each bvnp element.
+invp (OUT) - array of pointers to hold indicator variable names.
+inpl (OUT) - array of pointers to hold the length of the each invp element.
+dupl (OUT) - an array whose element value is 0 or 1 depending on whether the 
+bind position is duplicate of another.
+hndl  (OUT) - an array which returns the bind handle if binds have been done 
+for the bind position. No handle is returned for duplicates.
+Related Functions
+OCIStmtPrepare()
+
+
+
+OCIStmtGetPieceInfo()
+Name
+OCI Get Piece Information
+Purpose
+Returns piece information for a piecewise operation.
+Syntax
+sword OCIStmtGetPieceInfo( CONST OCIStmt  *stmtp,
+                         OCIError       *errhp,
+                         dvoid          **hndlpp,
+                         ub4            *typep,
+                         ub1            *in_outp,
+                         ub4            *iterp, 
+                         ub4            *idxp,
+                         ub1            *piecep );
+
+Comments
+When an execute/fetch call returns OCI_NEED_DATA to get/return a 
+dynamic bind/define value or piece, OCIStmtGetPieceInfo() returns the 
+relevant information: bind/define handle, iteration or index number and 
+which piece.
+See the section "Runtime Data Allocation and Piecewise Operations" on page 
+5-16 for more information about using OCIStmtGetPieceInfo().
+Parameters
+stmtp (IN) - the statement when executed returned OCI_NEED_DATA. 
+errhp (OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+hndlpp (OUT) - returns a pointer to the bind or define handle of the bind or 
+define whose runtime data is required or is being provided.
+typep (OUT) - the type of the handle pointed to by hndlpp: OCI_HTYPE_BIND 
+(for a bind handle) or OCI_HTYPE_DEFINE (for a define handle).
+in_outp (OUT) - returns OCI_PARAM_IN if the data is required for an IN bind 
+value. Returns OCI_PARAM_OUT if the data is available as an OUT bind 
+variable or a define position value.
+iterp (OUT) - returns the row number of a multiple row operation.
+idxp (OUT) - the index of an array element of a PL/SQL array bind operation.
+piecep (OUT) - returns one of the following defined values - 
+OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE and 
+OCI_LAST_PIECE. The default value is always OCI_ONE_PIECE. 
+Related Functions
+OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(), 
+OCIStmtSetPieceInfo()
+
+
+
+
+OCIStmtPrepare()
+Name
+OCI Statement REQuest
+Purpose
+This call defines the SQL/PLSQL statement to be executed.
+Syntax
+sword OCIStmtPrepare ( OCIStmt      *stmtp,
+                     OCIError     *errhp,
+                     CONST OraText   *stmt, 
+                     ub4          stmt_len,
+                     ub4          language,
+                     ub4          mode);
+Comments
+This call is used to prepare a SQL or PL/SQL statement for execution. The 
+OCIStmtPrepare() call defines an application request. 
+This is a purely local call. Data values for this statement initialized in 
+subsequent bind calls will be stored in a bind handle which will hang off this 
+statement handle.
+This call does not create an association between this statement handle and any 
+particular server.
+See the section "Preparing Statements" on page 2-21 for more information 
+about using this call.
+Parameters
+stmtp (IN) - a statement handle.
+errhp (IN) - an error handle to retrieve diagnostic information.
+stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null-
+terminated string. The pointer to the text of the statement must be available 
+as long as the statement is executed.
+stmt_len (IN) - length of the statement. Must not be zero.
+language (IN) - V7, V8, or native syntax. Possible values are:
+OCI_V7_SYNTAX - V7 ORACLE parsing syntax
+OCI_V8_SYNTAX - V8 ORACLE parsing syntax
+OCI_NTV_SYNTAX - syntax depending upon the version of the server. 
+mode (IN) - the only defined mode is OCI_DEFAULT for default mode. 
+Example
+This example demonstrates the use of OCIStmtPrepare(), as well as the OCI 
+application initialization calls.
+Related Functions
+OCIAttrGet(), OCIStmtExecute()
+
+
+OCIStmtPrepare2()
+Name
+OCI Statement REQuest with (a) early binding to svchp and/or
+(b) stmt caching
+Purpose
+This call defines the SQL/PLSQL statement to be executed.
+Syntax
+sword OCIStmtPrepare2 ( OCISvcCtx *svchp,
+                     OCIStmt      **stmtp,
+                     OCIError     *errhp,
+                     CONST OraText   *stmt,
+                     ub4          stmt_len,
+                     CONST OraText *key,
+                     ub4          key_len,
+                     ub4          language,
+                     ub4          mode);
+Comments
+This call is used to prepare a SQL or PL/SQL statement for execution. The
+OCIStmtPrepare() call defines an application request.
+This is a purely local call. Data values for this statement initialized in
+subsequent bind calls will be stored in a bind handle which will hang off this
+statement handle.
+This call creates an association between the statement handle and a service
+context. It differs from OCIStmtPrepare in that respect. It also supports
+stmt caching. The stmt will automatically be cached if the authp of the stmt
+has enabled stmt caching.
+Parameters
+svchp (IN) - the service context handle that contains the session that
+             this stmt handle belongs to.
+stmtp (OUT) - an unallocated stmt handle must be pased in. An allocated
+              and prepared  statement handle will be returned.
+errhp (IN) - an error handle to retrieve diagnostic information.
+stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null-
+            terminated string. The pointer to the OraText of the statement 
+            must be available as long as the statement is executed.
+stmt_len (IN) - length of the statement. Must not be zero.
+key (IN) - This is only Valid for OCI Stmt Caching. It indicates the
+           key to search with. It thus optimizes the search in the cache.
+key_len (IN) - the length of the key. This, too, is onlly valid for stmt
+               caching.
+language (IN) - V7, V8, or native syntax. Possible values are:
+OCI_V7_SYNTAX - V7 ORACLE parsing syntax
+OCI_V8_SYNTAX - V8 ORACLE parsing syntax
+OCI_NTV_SYNTAX - syntax depending upon the version of the server.
+mode (IN) - the defined modes are OCI_DEFAULT and OCI_PREP2_CACHE_SEARCHONLY.
+Example
+Related Functions
+OCIStmtExecute(), OCIStmtRelease()
+
+
+OCIStmtRelease()
+Name
+OCI Statement Release. This call is used to relesae the stmt that
+was retreived using OCIStmtPrepare2(). If the stmt is release
+using this call, OCIHandleFree() must not be called on the stmt
+handle.
+Purpose
+This call releases the statement obtained by OCIStmtPrepare2
+Syntax
+sword OCIStmtRelease ( OCIStmt      *stmtp,
+                     OCIError     *errhp,
+                     cONST OraText *key,
+                     ub4          key_len,
+                     ub4          mode);
+Comments
+This call is used to release a handle obtained via OCIStmtPrepare2().
+It also frees the memory associated with the handle.
+This is a purely local call.
+Parameters
+stmtp (IN/OUT) - The statement handle to be released/freed.
+errhp (IN) - an error handle to retrieve diagnostic information.
+key (IN) - This is only Valid for OCI Stmt Caching. It indicates the
+           key to tag the stmt with.
+key_len (IN) - the length of the key. This, too, is only valid for stmt
+               caching.
+mode (IN) - the defined modes are OCI_DEFAULT for default mode and
+            OCI_STRLS_CACHE_DELETE (only used for Stmt Caching).
+Example
+Related Functions
+OCIStmtExecute(), OCIStmtPrepare2()
+
+
+OCIStmtSetPieceInfo()
+Name
+OCI Set Piece Information
+Purpose
+Sets piece information for a piecewise operation.
+Syntax
+sword OCIStmtSetPieceInfo ( dvoid             *hndlp,
+                          ub4               type,
+                          OCIError          *errhp,
+                          CONST dvoid       *bufp,
+                          ub4               *alenp, 
+                          ub1               piece,
+                          CONST dvoid       *indp, 
+                          ub2               *rcodep ); 
+Comments
+When an execute call returns OCI_NEED_DATA to get a dynamic IN/OUT 
+bind value or piece, OCIStmtSetPieceInfo() sets the piece information: the 
+buffer, the length, the indicator and which piece is currently being processed.
+For more information about using OCIStmtSetPieceInfo() see the section 
+"Runtime Data Allocation and Piecewise Operations" on page 5-16.
+Parameters
+hndlp (IN/OUT) - the bind/define handle.
+type (IN) - type of the handle. 
+errhp (OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+bufp (IN/OUT) - bufp is a pointer to a storage containing the data value or 
+the piece when it is an IN bind variable, otherwise bufp is a pointer to 
+storage for getting a piece or a value for OUT binds and define variables. For
+named data types or REFs, a pointer to the object or REF is returned.
+alenp (IN/OUT) - the length of the piece or the value. 
+piece (IN) - the piece parameter. The following are valid values: 
+OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE, or 
+OCI_LAST_PIECE. 
+The default value is OCI_ONE_PIECE. This parameter is used for IN bind 
+variables only.
+indp (IN/OUT) - indicator. A pointer to a sb2 value or pointer to an indicator 
+structure for named data types (SQLT_NTY) and REFs (SQLT_REF), i.e., *indp 
+is either an sb2 or a dvoid * depending upon the data type.
+rcodep (IN/OUT) - return code. 
+Related Functions
+OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(), 
+OCIStmtGetPieceInfo()
+
+
+OCIFormatInit
+Name
+OCIFormat Package Initialize
+Purpose
+Initializes the OCIFormat package.
+Syntax
+sword OCIFormatInit(dvoid *hndl, OCIError *err);
+Comments
+This routine must be called before calling any other OCIFormat routine.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - OCI environment or session handle
+err (IN/OUT) - OCI error handle
+Related Functions
+OCIFormatTerm()
+
+
+OCIFormatString
+Name
+OCIFormat Package Format String
+Purpose
+Writes a text string into the supplied text buffer using the argument
+list submitted to it and in accordance with the format string given.
+Syntax
+sword OCIFormatString(dvoid *hndl, OCIError *err, text *buffer,
+                      sbig_ora bufferLength, sbig_ora *returnLength,
+                      CONST OraText *formatString, ...);
+Comments
+The first call to this routine must be preceded by a call to the
+OCIFormatInit routine that initializes the OCIFormat package
+for use.  When this routine is no longer needed then terminate
+the OCIFormat package by a call to the OCIFormatTerm routine.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl         (IN/OUT) - OCI environment or session handle
+err          (IN/OUT) - OCI error handle
+buffer       (OUT)    - text buffer for the string
+bufferLength (IN)     - length of the text buffer
+returnLength (OUT)    - length of the formatted string
+formatString (IN)     - format specification string
+...          (IN)     - variable argument list
+Related Functions
+
+
+OCIFormatTerm 
+Name
+OCIFormat Package Terminate
+Purpose
+Terminates the OCIFormat package.
+Syntax
+sword OCIFormatTerm(dvoid *hndl, OCIError *err);
+Comments
+It must be called after the OCIFormat package is no longer being used.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - OCI environment or session handle
+err (IN/OUT) - OCI error handle
+Related Functions
+OCIFormatInit()
+
+
+OCIFormatTUb1
+Name
+OCIFormat Package ub1 Type
+Purpose
+Return the type value for the ub1 type.
+Syntax
+sword OCIFormatTUb1(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUb2
+Name
+OCIFormat Package ub2 Type
+Purpose
+Return the type value for the ub2 type.
+Syntax
+sword OCIFormatTUb2(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUb4
+Name
+OCIFormat Package ub4 Type
+Purpose
+Return the type value for the ub4 type.
+Syntax
+sword OCIFormatTUb4(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUword
+Name
+OCIFormat Package uword Type
+Purpose
+Return the type value for the uword type.
+Syntax
+sword OCIFormatTUword(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUbig_ora
+Name
+OCIFormat Package ubig_ora Type
+Purpose
+Return the type value for the ubig_ora type.
+Syntax
+sword OCIFormatTUbig_ora(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSb1
+Name
+OCIFormat Package sb1 Type
+Purpose
+Return the type value for the sb1 type.
+Syntax
+sword OCIFormatTSb1(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSb2
+Name
+OCIFormat Package sb2 Type
+Purpose
+Return the type value for the sb2 type.
+Syntax
+sword OCIFormatTSb2(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSb4
+Name
+OCIFormat Package sb4 Type
+Purpose
+Return the type value for the sb4 type.
+Syntax
+sword OCIFormatTSb4(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSword
+Name
+OCIFormat Package sword Type
+Purpose
+Return the type value for the sword type.
+Syntax
+sword OCIFormatTSword(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSbig_ora
+Name
+OCIFormat Package sbig_ora Type
+Purpose
+Return the type value for the sbig_ora type.
+Syntax
+sword OCIFormatTSbig_ora(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEb1
+Name
+OCIFormat Package eb1 Type
+Purpose
+Return the type value for the eb1 type.
+Syntax
+sword OCIFormatTEb1(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEb2
+Name
+OCIFormat Package eb2 Type
+Purpose
+Return the type value for the eb2 type.
+Syntax
+sword OCIFormatTEb2(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEb4
+Name
+OCIFormat Package eb4 Type
+Purpose
+Return the type value for the eb4 type.
+Syntax
+sword OCIFormatTEb4(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEword
+Name
+OCIFormat Package eword Type
+Purpose
+Return the type value for the eword type.
+Syntax
+sword OCIFormatTEword(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTChar
+Name
+OCIFormat Package text Type
+Purpose
+Return the type value for the text type.
+Syntax
+sword OCIFormatTChar(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTText
+Name
+OCIFormat Package *text Type
+Purpose
+Return the type value for the *text type.
+Syntax
+sword OCIFormatTText(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTDouble
+Name
+OCIFormat Package double Type
+Purpose
+Return the type value for the double type.
+Syntax
+sword OCIFormatTDouble(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatDvoid
+Name
+OCIFormat Package dvoid Type
+Purpose
+Return the type value for the dvoid type.
+Syntax
+sword OCIFormatTDvoid(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEnd
+Name
+OCIFormat Package end Type
+Purpose
+Return the list terminator's "type".
+Syntax
+sword OCIFormatTEnd(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCISvcCtxToLda()
+Name
+OCI toggle SerVice context handle to Version 7 Lda_Def
+Purpose
+Toggles between a V8 service context handle and a V7 Lda_Def.
+Syntax
+sword OCISvcCtxToLda ( OCISvcCtx    *srvhp,
+                     OCIError     *errhp,
+                     Lda_Def      *ldap );
+Comments
+Toggles between an Oracle8 service context handle and an Oracle7 Lda_Def.
+This function can only be called after a service context has been properly 
+initialized.
+Once the service context has been translated to an Lda_Def, it can be used in 
+release 7.x OCI calls (e.g., obindps(), ofen()).
+Note: If there are multiple service contexts which share the same server 
+handle, only one can be in V7 mode at any time.
+The action of this call can be reversed by passing the resulting Lda_Def to 
+the OCILdaToSvcCtx() function.
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+ldap (IN/OUT) - a Logon Data Area for V7-style OCI calls which is initialized 
+by this call. 
+Related Functions
+OCILdaToSvcCtx()
+
+
+
+
+OCITransCommit()
+Name
+OCI TX (transaction) CoMmit
+Purpose
+Commits the transaction associated with a specified service context.
+Syntax
+sword OCITransCommit ( OCISvcCtx    *srvcp,
+                     OCIError     *errhp,
+                     ub4          flags );
+Comments
+The transaction currently associated with the service context is committed. If 
+it is a distributed transaction that the server cannot commit, this call 
+additionally retrieves the state of the transaction from the database to be 
+returned to the user in the error handle.
+If the application has defined multiple transactions, this function operates 
+on the transaction currently associated with the service context. If the 
+application is working with only the implicit local transaction created when 
+database changes are made, that implicit transaction is committed.
+If the application is running in the object mode, then the modified or updated 
+objects in the object cache for this transaction are also committed.
+The flags parameter is used for one-phase commit optimization in distributed 
+transactions. If the transaction is non-distributed, the flags parameter is 
+ignored, and OCI_DEFAULT can be passed as its value. OCI applications 
+managing global transactions should pass a value of 
+OCI_TRANS_TWOPHASE to the flags parameter for a two-phase commit. The 
+default is one-phase commit.
+Under normal circumstances, OCITransCommit() returns with a status 
+indicating that the transaction has either been committed or rolled back. With 
+distributed transactions, it is possible that the transaction is now in-doubt 
+(i.e., neither committed nor aborted). In this case, OCITransCommit() 
+attempts to retrieve the status of the transaction from the server. 
+The status is returned.
+Parameters
+srvcp (IN) - the service context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags -see the "Comments" section above.
+Related Functions
+OCITransRollback()
+
+
+
+
+OCITransDetach()
+Name
+OCI TX (transaction) DeTach
+Purpose
+Detaches a transaction.
+Syntax
+sword OCITransDetach ( OCISvcCtx    *srvcp,
+                     OCIError     *errhp,
+                     ub4          flags);
+Comments
+Detaches a global transaction from the service context handle. The transaction 
+currently attached to the service context handle becomes inactive at the end 
+of this call. The transaction may be resumed later by calling OCITransStart(), 
+specifying  a flags value of OCI_TRANS_RESUME.
+When a transaction is detached, the value which was specified in the timeout 
+parameter of OCITransStart() when the transaction was started is used to 
+determine the amount of time the branch can remain inactive before being 
+deleted by the server's PMON process.
+Note: The transaction can be resumed by a different process than the one 
+that detached it, provided that the transaction has the same 
+authorization.
+Parameters
+srvcp (IN) - the service context handle. 
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags (IN) - you must pass a value of OCI_DEFAULT for this parameter.
+Related Functions
+OCITransStart()
+
+
+
+OCITransForget()
+Name
+OCI TX (transaction) ForGeT
+Purpose
+Causes the server to forget a heuristically completed global transaction.
+Syntax
+sword OCITransForget ( OCISvcCtx     *svchp, 
+                     OCIError      *errhp,
+                     ub4           flags);
+
+Comments
+
+Forgets a heuristically completed global transaction. The server deletes the 
+status of the transaction from the system's pending transaction table.
+The XID of the transaction to be forgotten is set as an attribute of the 
+transaction handle (OCI_ATTR_XID).
+Parameters
+srvcp (IN) - the service context handle - the transaction is rolled back.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags (IN) - you must pass OCI_DEFAULT for this parameter.
+Related Functions
+OCITransCommit(), OCITransRollback()
+
+
+
+OCITransMultiPrepare() 
+Name
+OCI Trans(action) Multi-Branch Prepare
+Purpose
+Prepares a transaction with multiple branches in a single call.
+Syntax
+sword OCITransMultiPrepare ( OCISvcCtx    *svchp,
+                             ub4           numBranches,
+                             OCITrans     **txns,
+                             OCIError     **errhp);
+
+Comments
+
+Prepares the specified global transaction for commit.
+This call is valid only for distributed transactions.
+This call is an advanced performance feature intended for use only in
+situations where the caller is responsible for preparing all the branches
+in a transaction. 
+Parameters
+srvcp (IN) - the service context handle. 
+numBranches (IN) - This is the number of branches expected. It is also the
+array size for the next two parameters.
+txns (IN) - This is the array of transaction handles for the branches to
+prepare. They should all have the OCI_ATTR_XID set. The global transaction
+ID should be the same.
+errhp (IN) - This is the array of error handles. If OCI_SUCCESS is not
+returned, then these will indicate which branches received which errors.
+Related Functions
+OCITransPrepare()
+
+
+OCITransPrepare()
+Name
+OCI TX (transaction) PREpare
+Purpose
+Prepares a transaction for commit.
+Syntax
+sword OCITransPrepare ( OCISvcCtx    *svchp, 
+                      OCIError     *errhp,
+                      ub4          flags);
+
+Comments
+
+Prepares the specified global transaction for commit.
+This call is valid only for distributed transactions.
+The call returns OCI_SUCCESS_WITH_INFO if the transaction has not made 
+any changes. The error handle will indicate that the transaction is read-only. 
+The flag parameter is not currently used. 
+Parameters
+srvcp (IN) - the service context handle. 
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags (IN) - you must pass OCI_DEFAULT for this parameter.
+Related Functions
+OCITransCommit(), OCITransForget()
+
+
+
+
+OCITransRollback()
+Name
+OCI TX (transaction) RoLlback
+Purpose
+Rolls back the current transaction.
+Syntax
+sword OCITransRollback ( dvoid        *svchp, 
+                       OCIError     *errhp,
+                       ub4          flags );
+Comments
+The current transaction- defined as the set of statements executed since the 
+last OCITransCommit() or since OCISessionBegin()-is rolled back.
+If the application is running under object mode then the modified or updated 
+objects in the object cache for this transaction are also rolled back.
+An error is returned if an attempt is made to roll back a global transaction 
+that is not currently active.
+Parameters
+svchp (IN) - a service context handle. The transaction currently set in the 
+service context handle is rolled back.
+errhp -(IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags - you must pass a value of OCI_DEFAULT for this parameter.
+Related Functions
+OCITransCommit()
+
+
+
+
+OCITransStart()
+Name
+OCI TX (transaction) STart
+Purpose
+Sets the beginning of a transaction.
+Syntax
+sword OCITransStart ( OCISvcCtx    *svchp, 
+                    OCIError     *errhp, 
+                    uword        timeout,
+                    ub4          flags);
+
+Comments
+This function sets the beginning of a global or serializable transaction. The 
+transaction context currently associated with the service context handle is 
+initialized at the end of the call if the flags parameter specifies that a new 
+transaction should be started.
+The XID of the transaction is set as an attribute of the transaction handle 
+(OCI_ATTR_XID)
+Parameters
+svchp (IN/OUT) - the service context handle. The transaction context in the 
+service context handle is initialized at the end of the call if the flag 
+specified a new transaction to be started.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+err and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+timeout (IN) - the time, in seconds, to wait for a transaction to become 
+available for resumption when OCI_TRANS_RESUME is specified. When 
+OCI_TRANS_NEW is specified, this value is stored and may be used later by 
+OCITransDetach().
+flags (IN) - specifies whether a new transaction is being started or an 
+existing transaction is being resumed. Also specifies serializiability or 
+read-only status. More than a single value can be specified. By default, 
+a read/write transaction is started. The flag values are:
+OCI_TRANS_NEW - starts a new transaction branch. By default starts a 
+tightly coupled and migratable branch.
+OCI_TRANS_TIGHT - explicitly specifies a tightly coupled branch
+OCI_TRANS_LOOSE - specifies a loosely coupled branch
+OCI_TRANS_RESUME - resumes an existing transaction branch. 
+OCI_TRANS_READONLY - start a readonly transaction
+OCI_TRANS_SERIALIZABLE - start a serializable transaction
+Related Functions
+OCITransDetach()
+
+
+******************************************************************************/
+
+/*****************************************************************************
+                         ACTUAL PROTOTYPE DECLARATIONS
+******************************************************************************/
+/*-----------------------Dynamic Callback Function Pointers------------------*/
+typedef sb4 (*OCICallbackInBind)(/*_ dvoid *ictxp, OCIBind *bindp, ub4 iter,
+                                   ub4 index, dvoid **bufpp, ub4 *alenp,
+                                   ub1 *piecep, dvoid **indp _*/);
+ 
+typedef sb4 (*OCICallbackOutBind)(/*_ dvoid *octxp, OCIBind *bindp, ub4 iter,
+                                    ub4 index, dvoid **bufpp, ub4 **alenp,
+                                    ub1 *piecep, dvoid **indp,
+                                    ub2 **rcodep _*/);
+ 
+typedef sb4 (*OCICallbackDefine)(/*_ dvoid *octxp, OCIDefine *defnp, ub4 iter,
+                                   dvoid **bufpp, ub4 **alenp, ub1 *piecep,
+                                   dvoid **indp, ub2 **rcodep _*/);
+
+typedef sword (*OCIUserCallback)(/*_ dvoid *ctxp, dvoid *hndlp, ub4 type,
+                                     ub4 fcode, ub4 when, sword returnCode,
+                                     sb4 *errnop, va_list arglist _*/);
+
+typedef sword (*OCIEnvCallbackType)(/*_ OCIEnv *env, ub4 mode,
+                                       size_t xtramem_sz, dvoid *usrmemp,
+                                       OCIUcb *ucbDesc _*/); 
+
+typedef sb4 (*OCICallbackLobRead)(/*_ dvoid *ctxp,
+                                      CONST dvoid *bufp,
+                                      ub4 len,
+                                      ub1 piece _*/);
+
+/*
+ * Called multiple times when the data is being read from the pipe
+ * ctxp (IN) - is the context passed in by the user in OCILobRead call
+ * bufp (IN) - the buffer containing the read data
+ * len  (IN) - the length of the data in the buffer that is relevant
+ * piece (IN) - one of the following, OCI_FIRST_PIECE, OCI_NEXT_PIECE
+ */
+
+typedef sb4 (*OCICallbackLobWrite)(/*_ dvoid *ctxp,
+                                       dvoid *bufp,
+                                       ub4 *lenp,
+                                       ub1 *piece _*/);
+
+/*
+ * Called multiple times when the data is being written to the pipe
+ * ctxp (IN) - is the context passed in by the user in OCILobRead call
+ * bufp (IN/OUT) - the buffer into which the data to be written is copied
+ * lenp  (OUT) - the length of the data in the buffer that is relevant
+ * piece (OUT) - one of the following, OCI_NEXT_PIECE or OCI_LAST_PIECE
+ */
+
+/*--------------------------Failover Callback Structure ---------------------*/
+typedef sb4 (*OCICallbackFailover)(/*_ dvoid *svcctx, dvoid *envctx,
+                                       dvoid *fo_ctx, ub4 fo_type,
+                                       ub4 fo_event _*/);
+/* Called at failover time if client has registered it. */
+typedef struct
+{
+  OCICallbackFailover callback_function;
+  dvoid *fo_ctx;
+} 
+OCIFocbkStruct;
+
+
+
+sword   OCIInitialize(/*_ ub4 mode, dvoid *ctxp,
+                          dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                          dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr,
+                                            size_t newsize),
+                          void (*mfreefp)(dvoid *ctxp, dvoid *memptr) _*/);
+
+sword   OCITerminate(ub4 mode);
+
+sword   OCIEnvCreate (/*_ OCIEnv **envp, ub4 mode, dvoid *ctxp,
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+                 size_t xtramem_sz, dvoid **usrmempp _*/);
+
+sword   OCIEnvNlsCreate (/*_ OCIEnv **envp, ub4 mode, dvoid *ctxp,
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+                 size_t xtramem_sz, dvoid **usrmempp,
+                 ub2 charset, ub2 ncharset _*/);
+
+sword   OCIFEnvCreate (/*_ OCIEnv **envp, ub4 mode, dvoid *ctxp,
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+                 size_t xtramem_sz, dvoid **usrmempp, dvoid *fupg _*/);
+
+sword   OCIHandleAlloc(/*_ CONST dvoid *parenth, dvoid **hndlpp, 
+                           CONST ub4 type, CONST size_t xtramem_sz,
+                           dvoid **usrmempp _*/);
+
+sword   OCIHandleFree(/*_ dvoid *hndlp, CONST ub4 type _*/);
+
+sword   OCIDescriptorAlloc(/*_ CONST dvoid *parenth, dvoid **descpp, 
+                               CONST ub4 type, CONST size_t xtramem_sz, 
+                               dvoid **usrmempp _*/);
+
+sword   OCIDescriptorFree(/*_ dvoid *descp, CONST ub4 type _*/);
+
+sword   OCIEnvInit(/*_ OCIEnv **envp, ub4 mode,
+                       size_t xtramem_sz, dvoid **usrmempp _*/);
+
+sword   OCIServerAttach(/*_ OCIServer *srvhp, OCIError *errhp,
+                            CONST OraText *dblink, sb4 dblink_len, 
+                            ub4 mode _*/);
+
+sword   OCIServerDetach(/*_ OCIServer *srvhp, OCIError *errhp, ub4 mode _*/);
+
+sword   OCISessionBegin(/*_ OCISvcCtx *svchp, OCIError *errhp,
+                            OCISession *usrhp, ub4 credt, ub4 mode _*/);
+
+sword   OCISessionEnd(/*_ OCISvcCtx *svchp, OCIError *errhp,
+                          OCISession *usrhp, ub4 mode _*/);
+
+sword OCILogon       (/*_ OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp, 
+			CONST OraText *username, ub4 uname_len, 
+			CONST OraText *password, ub4 passwd_len, 
+			CONST OraText *dbname, ub4 dbname_len _*/);
+
+sword OCILogon2       (/*_ OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp,
+                        CONST OraText *username, ub4 uname_len,
+                        CONST OraText *password, ub4 passwd_len,
+                        CONST OraText *dbname, ub4 dbname_len,
+                        ub4 mode _*/);
+
+sword OCILogoff      (/*_ OCISvcCtx *svchp, OCIError *errhp _*/);
+
+sword OCIPasswordChange (/*_ OCISvcCtx *svchp, OCIError *errhp,
+                           CONST OraText *user_name, ub4 usernm_len,
+                           CONST OraText *opasswd, ub4 opasswd_len,
+                           CONST OraText *npasswd, ub4 npasswd_len, 
+                            ub4 mode _*/);
+
+sword   OCIStmtPrepare(/*_ OCIStmt *stmtp, OCIError *errhp, CONST OraText *stmt,
+                           ub4 stmt_len, ub4 language, ub4 mode _*/);
+
+sword OCIStmtPrepare2 (/*_ OCISvcCtx *svchp, OCIStmt **stmtp, OCIError *errhp,
+                     CONST OraText *stmt, ub4 stmt_len, CONST OraText *key,
+                     ub4 key_len, ub4 language, ub4 mode _*/);
+
+sword OCIStmtRelease (/*_ OCIStmt *stmtp, OCIError *errhp, CONST OraText *key,
+                       ub4 key_len, ub4 mode _*/);
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword OCIBindByPos   (/*_ OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
+			ub4 position, dvoid *valuep, sb4 value_sz,
+			ub2 dty, dvoid *indp, ub2 *alenp, ub2 *rcodep,
+			ub4 maxarr_len, ub4 *curelep, ub4 mode _*/);
+#endif /* __STDC__ */
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword OCIBindByName  (/*_ OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
+			CONST OraText *placeholder, sb4 placeh_len, 
+                        dvoid *valuep, sb4 value_sz, ub2 dty, 
+                        dvoid *indp, ub2 *alenp, ub2 *rcodep, 
+                        ub4 maxarr_len, ub4 *curelep, ub4 mode _*/);
+#endif /* __STDC__ */
+
+sword   OCIBindObject(/*_ OCIBind *bindp, OCIError *errhp,
+                          CONST OCIType *type, dvoid **pgvpp,
+                          ub4 *pvszsp, dvoid **indpp, ub4 *indszp _*/);
+
+sword   OCIBindDynamic(/*_ OCIBind *bindp, OCIError *errhp,
+                           dvoid *ictxp, OCICallbackInBind icbfp,
+                           dvoid *octxp, OCICallbackOutBind ocbfp _*/);
+
+sword   OCIBindArrayOfStruct(/*_ OCIBind *bindp, OCIError *errhp, ub4 pvskip,
+                                 ub4 indskip, ub4 alskip, ub4 rcskip _*/);
+
+sword   OCIStmtGetPieceInfo(/*_ OCIStmt *stmtp, OCIError *errhp,
+                                dvoid **hndlpp, ub4 *typep, ub1 *in_outp,
+                                ub4 *iterp, ub4 *idxp, ub1 *piecep _*/);
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCIStmtSetPieceInfo(/*_ dvoid *hndlp, ub4 type, OCIError *errhp,
+                                CONST dvoid *bufp, ub4 *alenp, ub1 piece,
+                                CONST dvoid *indp, ub2 *rcodep _*/);
+#endif /* __STDC__ */
+
+sword   OCIStmtExecute(/*_ OCISvcCtx *svchp, OCIStmt *stmtp, OCIError *errhp,
+                           ub4 iters, ub4 rowoff, CONST OCISnapshot *snap_in,
+                           OCISnapshot *snap_out, ub4 mode _*/);
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword OCIDefineByPos (/*_ OCIStmt *stmtp, OCIDefine **defnp, OCIError *errhp,
+			ub4 position, dvoid *valuep, sb4 value_sz, ub2 dty,
+			dvoid *indp, ub2 *rlenp, ub2 *rcodep, ub4 mode _*/);
+#endif /* __STDC__ */
+
+sword   OCIDefineObject(/*_ OCIDefine *defnp, OCIError *errhp,
+                            CONST OCIType *type, dvoid **pgvpp,
+                            ub4 *pvszsp, dvoid **indpp, ub4 *indszp _*/);
+
+sword   OCIDefineDynamic(/*_ OCIDefine *defnp, OCIError *errhp,
+                             dvoid *octxp, OCICallbackDefine ocbfp _*/);
+
+sword   OCIDefineArrayOfStruct(/*_ OCIDefine *defnp, OCIError *errhp, 
+                                 ub4 pvskip, ub4 indskip, ub4 rlskip, 
+                                 ub4 rcskip _*/);
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCIStmtFetch(/*_ OCIStmt *stmtp, OCIError *errhp,
+                         ub4 nrows, ub2 orientation, ub4 mode _*/);
+#endif /* __STDC__ */
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCIStmtFetch2(/*_ OCIStmt *stmtp, OCIError *errhp,
+                         ub4 nrows, ub2 orientation, sb4 scrollOffset, ub4 mode _*/);
+#endif /* __STDC__ */
+
+sword   OCIStmtGetBindInfo(/*_ OCIStmt *stmtp, OCIError *errhp, ub4 size, 
+                               ub4 startloc, sb4 *found, 
+                               OraText *bvnp[], ub1 bvnl[], OraText *invp[],
+                               ub1 inpl[], ub1 dupl[], OCIBind *hndl[] _*/);
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCIDescribeAny(/*_ OCISvcCtx *svchp, OCIError *errhp,
+                           dvoid *objptr, ub4 objnm_len, ub1 objptr_typ,
+                           ub1 info_level, ub1 objtyp, OCIDescribe *dschp _*/);
+#endif /* __STDC__ */
+
+sword   OCIParamGet(/*_ CONST dvoid *hndlp, ub4 htype, OCIError *errhp,
+                        dvoid **parmdpp, ub4 pos _*/);
+
+sword   OCIParamSet(/*_ dvoid *hdlp, ub4 htyp, OCIError *errhp,
+                        CONST dvoid *dscp, ub4 dtyp, ub4 pos _*/);
+
+sword   OCITransStart(/*_ OCISvcCtx *svchp, OCIError *errhp,
+                          uword timeout, ub4 flags _*/);
+
+sword   OCITransDetach(/*_ OCISvcCtx *svchp, OCIError *errhp, ub4 flags _*/);
+
+sword   OCITransCommit(/*_ OCISvcCtx *svchp, OCIError *errhp, ub4 flags _*/);
+
+sword   OCITransRollback(/*_ OCISvcCtx *svchp, OCIError *errhp, ub4 flags _*/);
+
+sword   OCITransPrepare (/*_ OCISvcCtx *svchp, OCIError *errhp, ub4 flags _*/);
+
+sword   OCITransMultiPrepare (/*_ OCISvcCtx *svchp, ub4 numBranches, 
+                                  OCITrans **txns, OCIError **errhp _*/);
+
+sword   OCITransForget ( /*_ OCISvcCtx *svchp, OCIError *errhp, ub4 flags _*/);
+
+sword   OCIErrorGet   ( /*_ dvoid *hndlp, ub4 recordno, OraText *sqlstate,
+			    sb4 *errcodep, OraText *bufp, ub4 bufsiz, 
+			    ub4 type _*/ );
+
+sword   OCILobAppend  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                            OCILobLocator *dst_locp,
+                            OCILobLocator *src_locp _*/ );
+
+sword   OCILobAssign  ( /*_ OCIEnv *envhp, OCIError *errhp, 
+                            CONST OCILobLocator *src_locp, 
+                            OCILobLocator **dst_locpp _*/ );
+
+sword   OCILobCharSetForm  ( /*_ OCIEnv *envhp, OCIError *errhp, 
+                                 CONST OCILobLocator *locp, 
+                                 ub1 *csfrm _*/ );
+
+sword   OCILobCharSetId ( /*_ OCIEnv *envhp, OCIError *errhp, 
+                              CONST OCILobLocator *locp, ub2 *csid _*/ );
+
+sword   OCILobCopy  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                          OCILobLocator *dst_locp,
+		          OCILobLocator *src_locp, 
+                          ub4 amount, ub4 dst_offset, 
+                          ub4 src_offset _*/ );
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword OCILobCreateTemporary(/*_ OCISvcCtx          *svchp,
+                            OCIError           *errhp,
+                            OCILobLocator      *locp,
+                            ub2                 csid,
+                            ub1                 csfrm,
+                            ub1                 lobtype,
+                            boolean             cache,
+                            OCIDuration         duration _*/);
+#endif /* __STDC__ */
+
+sword OCILobClose( /*_ OCISvcCtx        *svchp,
+                       OCIError         *errhp,
+                       OCILobLocator    *locp _*/);
+
+
+sword   OCILobDisableBuffering ( /*_ OCISvcCtx      *svchp,
+                                     OCIError       *errhp,
+                                     OCILobLocator  *locp _*/ );
+
+sword   OCILobEnableBuffering ( /*_ OCISvcCtx      *svchp,
+                                    OCIError       *errhp,
+                                    OCILobLocator  *locp _*/ );
+
+sword   OCILobErase  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                           OCILobLocator *locp,
+                           ub4 *amount, ub4 offset _*/ );
+
+sword   OCILobFileClose  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                               OCILobLocator *filep _*/ );
+
+sword   OCILobFileCloseAll (/*_ OCISvcCtx *svchp, OCIError *errhp _*/);
+
+sword   OCILobFileExists   (/*_ OCISvcCtx *svchp, OCIError *errhp, 
+			      OCILobLocator *filep,
+			      boolean *flag _*/);
+ 
+sword   OCILobFileGetName  ( /*_ OCIEnv *envhp, OCIError *errhp, 
+                                 CONST OCILobLocator *filep,
+                                 OraText *dir_alias, ub2 *d_length, 
+                                 OraText *filename, ub2 *f_length _*/ );
+                            
+sword   OCILobFileIsOpen  (/*_ OCISvcCtx *svchp, OCIError *errhp, 
+                               OCILobLocator *filep,
+                               boolean *flag _*/);
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCILobFileOpen  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                            OCILobLocator *filep, ub1 mode _*/ );
+#endif /* __STDC__ */
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCILobFileSetName  ( /*_ OCIEnv *envhp, OCIError *errhp, 
+                                 OCILobLocator **filepp, 
+                                 CONST OraText *dir_alias, ub2 d_length, 
+                                 CONST OraText *filename, ub2 f_length _*/ );
+#endif /* __STDC__ */
+
+sword   OCILobFlushBuffer ( /*_ OCISvcCtx       *svchp,
+                                OCIError        *errhp,
+                                OCILobLocator   *locp,
+                                ub4              flag _*/ );
+
+sword OCILobFreeTemporary(/*_ OCISvcCtx          *svchp,
+                              OCIError           *errhp,
+                              OCILobLocator      *locp _*/);
+
+
+sword OCILobGetChunkSize(/*_ OCISvcCtx         *svchp,
+                             OCIError          *errhp,
+                             OCILobLocator     *locp,
+                             ub4               *chunksizep _*/);
+
+sword   OCILobGetLength  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                               OCILobLocator *locp,
+		               ub4 *lenp _*/ );
+
+sword   OCILobIsEqual  ( /*_ OCIEnv *envhp, CONST OCILobLocator *x, 
+                             CONST OCILobLocator *y, boolean *is_equal _*/ );
+
+sword OCILobIsOpen(/*_ OCISvcCtx     *svchp,
+                       OCIError      *errhp,
+                       OCILobLocator *locp,
+                       boolean       *flag _*/);
+
+sword OCILobIsTemporary(/*_ OCIEnv            *envp,
+                            OCIError          *errhp,
+                            OCILobLocator     *locp,
+                            boolean           *is_temporary _*/);
+
+sword   OCILobLoadFromFile  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                                  OCILobLocator *dst_locp,
+       	                          OCILobLocator *src_filep, 
+                                  ub4 amount, ub4 dst_offset, 
+                                  ub4 src_offset _*/ );
+
+sword   OCILobLocatorAssign  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                            CONST OCILobLocator *src_locp, 
+                            OCILobLocator **dst_locpp _*/ );
+
+
+sword   OCILobLocatorIsInit ( /*_ OCIEnv *envhp, OCIError *errhp, 
+                                CONST OCILobLocator *locp, 
+                                boolean *is_initialized _*/ );
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCILobOpen(/*_ OCISvcCtx        *svchp,
+                       OCIError         *errhp,
+                       OCILobLocator    *locp,
+                       ub1               mode _*/);
+#endif /* __STDC__ */
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCILobRead  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                          OCILobLocator *locp,
+                          ub4 *amtp, ub4 offset, dvoid *bufp, ub4 bufl, 
+                          dvoid *ctxp, 
+                          sb4 (*cbfp)( dvoid *ctxp, 
+                                       CONST dvoid *bufp, 
+                                       ub4 len, 
+                                       ub1 piece),
+                          ub2 csid, ub1 csfrm _*/ );
+#endif /* __STDC__ */
+
+sword   OCILobTrim  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                          OCILobLocator *locp,
+                          ub4 newlen _*/ );
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCILobWrite  ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                         OCILobLocator *locp,
+                         ub4 *amtp, ub4 offset, dvoid *bufp, ub4 buflen, 
+                         ub1 piece, dvoid *ctxp, 
+                         sb4 (*cbfp)(dvoid *ctxp, 
+                                     dvoid *bufp, 
+                                     ub4 *len, 
+                                     ub1 *piece),
+                         ub2 csid, ub1 csfrm _*/ );
+#endif /* __STDC__ */
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword OCILobWriteAppend(/*_
+OCISvcCtx         *svchp,
+OCIError          *errhp,
+OCILobLocator     *lobp,
+ub4              *amtp,
+dvoid            *bufp,
+ub4               bufl,
+ub1               piece,
+dvoid            *ctxp,
+sb4             (*cbfp)(dvoid  *ctxp,
+                        dvoid  *bufp,
+                        ub4    *len,
+                        ub1    *piece),
+ub2               csid,
+ub1               csfrm _*/);
+#endif /* __STDC__ */
+
+sword   OCIBreak ( /*_ dvoid *hndlp, OCIError *errhp _*/ );
+
+sword   OCIReset ( /*_ dvoid *hndlp, OCIError *errhp _*/ );
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCIServerVersion  ( /*_ dvoid *hndlp, OCIError *errhp, OraText *bufp, 
+                                ub4 bufsz, ub1 hndltype _*/ );
+
+sword   OCIServerRelease  ( /*_ dvoid *hndlp, OCIError *errhp, OraText *bufp,
+                                ub4 bufsz, ub1 hndltype, ub4 *version _*/ );
+
+#endif /* __STDC__ */
+
+sword   OCIAttrGet ( /*_ CONST dvoid *trgthndlp, ub4 trghndltyp, 
+                         dvoid *attributep, ub4 *sizep, ub4 attrtype, 
+                         OCIError *errhp _*/ );
+
+sword   OCIAttrSet ( /*_ dvoid *trgthndlp, ub4 trghndltyp, dvoid *attributep,
+                         ub4 size, ub4 attrtype, OCIError *errhp _*/ );
+
+sword   OCISvcCtxToLda ( /*_ OCISvcCtx *svchp, OCIError *errhp, 
+                             Lda_Def *ldap _*/ );
+
+sword   OCILdaToSvcCtx ( /*_ OCISvcCtx **svchpp, OCIError *errhp, 
+                             Lda_Def *ldap _*/ );
+
+sword   OCIResultSetToStmt ( /*_ OCIResult *rsetdp, OCIError *errhp _*/ );
+
+
+sword	OCIUserCallbackRegister(/*_ dvoid *hndlp, ub4 type, dvoid *ehndlp,
+                                    OCIUserCallback callback, dvoid *ctxp,
+                                    ub4 fcode, ub4 when, OCIUcb *ucbDesc _*/);
+
+sword	OCIUserCallbackGet(/*_ dvoid *hndlp, ub4 type, dvoid *ehndlp,
+                               ub4 fcode, ub4 when, OCIUserCallback *callbackp,
+                               dvoid **ctxpp, OCIUcb *ucbDesc _*/);
+
+sword   OCISharedLibInit(/*_ dvoid *metaCtx, dvoid *libCtx, ub4 argfmt,
+                             sword argc, dvoid *argv[],
+                             OCIEnvCallbackType envCallback _*/);
+
+sword   OCISecurityInitialize (/*_ OCISecurity *osshandle,
+                                 OCIError *error_handle _*/);
+
+sword   OCISecurityTerminate (/*_ OCISecurity *osshandle,
+				OCIError *error_handle _*/);
+
+sword OCISecurityOpenWallet(/*_ OCISecurity *osshandle,
+			      OCIError *error_handle,
+			      size_t wrllen,
+			      OraText *wallet_resource_locator,
+			      size_t pwdlen,
+			      OraText *password,
+			      nzttWallet *wallet _*/);
+
+sword OCISecurityCloseWallet(/*_ OCISecurity *osshandle,
+			       OCIError *error_handle,
+			       nzttWallet *wallet _*/);
+
+sword OCISecurityCreateWallet(/*_ OCISecurity *osshandle,
+				OCIError *error_handle,
+				size_t wrllen,
+				OraText *wallet_resource_locator,
+				size_t pwdlen,
+				OraText *password,
+				nzttWallet *wallet _*/);
+
+sword OCISecurityDestroyWallet(/*_ OCISecurity *osshandle,
+				 OCIError *error_handle,
+				 size_t wrllen,
+				 OraText *wallet_resource_locator,
+				 size_t pwdlen,
+				 OraText *password _*/);
+
+sword OCISecurityStorePersona(/*_ OCISecurity *osshandle,
+				OCIError *error_handle,
+				nzttPersona **persona,
+				nzttWallet *wallet _*/);
+
+sword OCISecurityOpenPersona(/*_ OCISecurity *osshandle,
+			       OCIError *error_handle,
+			       nzttPersona *persona _*/);
+
+sword OCISecurityClosePersona(/*_ OCISecurity *osshandle,
+				OCIError *error_handle,
+				nzttPersona *persona _*/);
+
+sword OCISecurityRemovePersona(/*_ OCISecurity *osshandle,
+				 OCIError *error_handle,
+				 nzttPersona **persona _*/);
+
+sword OCISecurityCreatePersona(/*_ OCISecurity *osshandle,
+				 OCIError *error_handle,
+				 nzttIdentType identity_type,
+				 nzttCipherType cipher_type,
+				 nzttPersonaDesc *desc,
+				 nzttPersona **persona _*/);
+
+sword OCISecuritySetProtection(/*_ OCISecurity *osshandle,
+				 OCIError *error_handle,
+				 nzttPersona *persona,
+				 nzttcef crypto_engine_function,
+				 nztttdufmt data_unit_format,
+				 nzttProtInfo *protection_info _*/);
+
+sword OCISecurityGetProtection(/*_ OCISecurity *osshandle,
+				 OCIError *error_handle,
+				 nzttPersona *persona,
+				 nzttcef crypto_engine_function,
+				 nztttdufmt * data_unit_format_ptr,
+				 nzttProtInfo *protection_info _*/);
+
+sword OCISecurityRemoveIdentity(/*_ OCISecurity *osshandle,
+				  OCIError *error_handle,
+				  nzttIdentity **identity_ptr _*/);
+
+sword OCISecurityCreateIdentity(/*_ OCISecurity *osshandle,
+				  OCIError *error_handle,
+				  nzttIdentType type,
+				  nzttIdentityDesc *desc,
+				  nzttIdentity **identity_ptr _*/);
+
+sword OCISecurityAbortIdentity(/*_ OCISecurity *osshandle,
+				 OCIError *error_handle,
+				 nzttIdentity **identity_ptr _*/);
+
+sword OCISecurityFreeIdentity(/*_ OCISecurity *osshandle,
+			       	  OCIError *error_handle,
+				  nzttIdentity **identity_ptr _*/);
+
+sword OCISecurityStoreTrustedIdentity(/*_ OCISecurity *osshandle,
+					OCIError *error_handle,
+					nzttIdentity **identity_ptr,
+					nzttPersona *persona _*/);
+
+sword OCISecuritySign(/*_ OCISecurity *osshandle,
+			OCIError *error_handle,
+			nzttPersona *persona,
+			nzttces signature_state,
+			size_t input_length,
+			ub1 *input,
+			nzttBufferBlock *buffer_block _*/);
+
+sword OCISecuritySignExpansion(/*_ OCISecurity *osshandle,
+				 OCIError *error_handle,
+				 nzttPersona *persona,
+				 size_t inputlen,
+				 size_t *signature_length _*/);
+
+sword OCISecurityVerify(/*_ OCISecurity *osshandle,
+			  OCIError *error_handle,
+			  nzttPersona *persona,
+			  nzttces signature_state,
+			  size_t siglen,
+			  ub1 *signature,
+			  nzttBufferBlock *extracted_message,
+			  boolean *verified,
+			  boolean *validated,
+			  nzttIdentity **signing_party_identity _*/);
+
+sword OCISecurityValidate(/*_ OCISecurity *osshandle,
+			    OCIError *error_handle,
+			    nzttPersona *persona,
+			    nzttIdentity *identity,
+			    boolean *validated _*/);
+
+sword OCISecuritySignDetached(/*_ OCISecurity *osshandle,
+				OCIError *error_handle,
+				nzttPersona *persona,
+				nzttces signature_state,
+				size_t input_length,
+				ub1 * input,
+				nzttBufferBlock *signature _*/);
+
+sword OCISecuritySignDetExpansion(/*_ OCISecurity *osshandle,
+				    OCIError    *error_handle,
+				    nzttPersona *persona,
+				    size_t       input_length,
+				    size_t *required_buffer_length _*/);
+
+sword OCISecurityVerifyDetached(/*_ OCISecurity *osshandle,
+				  OCIError *error_handle,
+				  nzttPersona *persona,
+				  nzttces signature_state,
+				  size_t data_length,
+				  ub1 *data,
+				  size_t siglen,
+				  ub1 *signature,
+				  boolean *verified,
+				  boolean *validated,
+				  nzttIdentity **signing_party_identity _*/);
+
+sword OCISecurity_PKEncrypt(/*_ OCISecurity *osshandle,
+			      OCIError *error_handle,
+			      nzttPersona *persona,
+			      size_t number_of_recipients,
+			      nzttIdentity *recipient_list,
+			      nzttces encryption_state,
+			      size_t input_length,
+			      ub1 *input,
+			      nzttBufferBlock *encrypted_data _*/);
+
+sword OCISecurityPKEncryptExpansion(/*_ OCISecurity *osshandle,
+				      OCIError *error_handle,
+				      nzttPersona *persona,
+				      size_t number_recipients,
+				      size_t input_length,
+				      size_t *buffer_length_required _*/);
+
+sword OCISecurityPKDecrypt(/*_ OCISecurity *osshandle,
+			     OCIError *error_handle,
+			     nzttPersona *persona,
+			     nzttces encryption_state,
+			     size_t input_length,
+			     ub1 *input,
+			     nzttBufferBlock *encrypted_data _*/);
+
+sword OCISecurityEncrypt(/*_ OCISecurity *osshandle,
+			   OCIError *error_handle,
+			   nzttPersona *persona,
+			   nzttces encryption_state,
+			   size_t input_length,
+			   ub1 *input,
+			   nzttBufferBlock *encrypted_data _*/);
+
+sword OCISecurityEncryptExpansion(/*_ OCISecurity *osshandle,
+				    OCIError *error_handle,
+				    nzttPersona *persona,
+				    size_t input_length,
+				    size_t *encrypted_data_length _*/);
+
+sword OCISecurityDecrypt(/*_ OCISecurity *osshandle,
+			   OCIError *error_handle,
+			   nzttPersona *persona,
+			   nzttces decryption_state,
+			   size_t input_length,
+			   ub1 *input,
+			   nzttBufferBlock *decrypted_data _*/);
+
+sword OCISecurityEnvelope(/*_ OCISecurity *osshandle,
+			    OCIError *error_handle,
+			    nzttPersona *persona,
+			    size_t number_of_recipients,
+			    nzttIdentity *identity,
+			    nzttces encryption_state,
+			    size_t input_length,
+			    ub1 *input,
+			    nzttBufferBlock *enveloped_data _*/);
+
+sword OCISecurityDeEnvelope(/*_ OCISecurity *osshandle,
+                                OCIError *error_handle,
+                                nzttPersona *persona,
+                                nzttces decryption_state,
+                                size_t input_length,
+                                ub1 *input,
+                                nzttBufferBlock *output_message,
+                                boolean *verified,
+                                boolean *validated,
+                                nzttIdentity **sender_identity _*/);
+
+sword OCISecurityKeyedHash(/*_ OCISecurity *osshandle,
+			     OCIError *error_handle,
+			     nzttPersona *persona,
+			     nzttces hash_state,
+			     size_t input_length,
+			     ub1 *input,
+			     nzttBufferBlock *keyed_hash _*/);
+
+sword OCISecurityKeyedHashExpansion(/*_ OCISecurity *osshandle,
+				      OCIError *error_handle,
+				      nzttPersona *persona,
+				      size_t input_length,
+				      size_t *required_buffer_length _*/);
+
+sword OCISecurityHash(/*_ OCISecurity *osshandle,
+			OCIError *error_handle,
+			nzttPersona *persona,
+			nzttces hash_state,
+			size_t input,
+			ub1 *input_length,
+			nzttBufferBlock *hash _*/);
+
+sword OCISecurityHashExpansion(/*_ OCISecurity *osshandle,
+				 OCIError *error_handle,
+				 nzttPersona *persona,
+				 size_t input_length,
+				 size_t *required_buffer_length _*/);
+
+sword OCISecuritySeedRandom(/*_ OCISecurity *osshandle,
+			      OCIError *error_handle,
+			      nzttPersona *persona,
+			      size_t seed_length,
+			      ub1 *seed _*/);
+
+sword OCISecurityRandomBytes(/*_ OCISecurity *osshandle,
+			       OCIError *error_handle,
+			       nzttPersona *persona,
+			       size_t number_of_bytes_desired,
+			       nzttBufferBlock *random_bytes _*/);
+
+sword OCISecurityRandomNumber(/*_ OCISecurity *osshandle,
+				OCIError *error_handle,
+				nzttPersona *persona,
+				uword *random_number_ptr _*/);
+
+sword OCISecurityInitBlock(/*_ OCISecurity *osshandle,
+			     OCIError *error_handle,
+			     nzttBufferBlock *buffer_block _*/);
+
+sword OCISecurityReuseBlock(/*_ OCISecurity *osshandle,
+			      OCIError *error_handle,
+			      nzttBufferBlock *buffer_block _*/);
+
+sword OCISecurityPurgeBlock(/*_ OCISecurity *osshandle,
+			      OCIError *error_handle,
+			      nzttBufferBlock *buffer_block _*/);
+
+sword OCISecuritySetBlock(/*_ OCISecurity *osshandle,
+			    OCIError *error_handle,
+			    uword flags_to_set,
+			    size_t buffer_length,
+			    size_t used_buffer_length,
+			    ub1 *buffer,
+			    nzttBufferBlock *buffer_block _*/);
+
+sword OCISecurityGetIdentity(/*_ OCISecurity  *osshandle,
+			       OCIError       *error_handle,
+			       size_t          namelen,
+			       OraText           *distinguished_name,
+			       nzttIdentity  **identity _*/);
+
+sword OCIAQEnq(/*_ OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
+                     OCIAQEnqOptions *enqopt, OCIAQMsgProperties *msgprop, 
+                     OCIType *payload_tdo,dvoid **payload, dvoid **payload_ind,
+		     OCIRaw **msgid, ub4 flags _*/);
+
+sword OCIAQDeq(/*_ OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
+		     OCIAQDeqOptions *deqopt, OCIAQMsgProperties *msgprop, 
+                     OCIType *payload_tdo,dvoid **payload, dvoid **payload_ind,
+		     OCIRaw **msgid, ub4 flags _*/);
+
+sword OCIAQListen(/*_ OCISvcCtx *svchp, OCIError *errhp, 
+		      OCIAQAgent **agent_list, ub4 num_agents,
+		      sb4 wait, OCIAQAgent **agent,
+		      ub4 flags _*/);
+
+sword OCIExtractInit(/*_ dvoid *hndl, OCIError *err _*/);
+
+sword OCIExtractTerm(/*_ dvoid *hndl, OCIError *err _*/);
+
+sword OCIExtractReset(/*_ dvoid *hndl, OCIError *err _*/);
+
+sword OCIExtractSetNumKeys(/*_ dvoid *hndl, OCIError *err, uword numkeys _*/);
+
+sword OCIExtractSetKey(/*_ dvoid *hndl, OCIError *err, CONST OraText *name, 
+                           ub1 type, ub4 flag, CONST dvoid *defval, 
+                           CONST sb4 *intrange, 
+                           CONST OraText *CONST *strlist _*/);
+
+sword OCIExtractFromFile(/*_ dvoid *hndl, OCIError *err, ub4 flag, 
+                             OraText *filename _*/);
+
+sword OCIExtractFromStr(/*_ dvoid *hndl, OCIError *err, ub4 flag, 
+                               OraText *input _*/);
+
+sword OCIExtractToInt(/*_ dvoid *hndl, OCIError *err, OraText *keyname, 
+                          uword valno, sb4 *retval _*/);
+
+sword OCIExtractToBool(/*_ dvoid *hndl, OCIError *err, OraText *keyname, 
+                           uword valno, ub1 *retval _*/);
+
+sword OCIExtractToStr(/*_ dvoid *hndl, OCIError *err, OraText *keyname, 
+                          uword valno, OraText *retval, uword buflen _*/);
+
+sword OCIExtractToOCINum(/*_ dvoid *hndl, OCIError *err, OraText *keyname, 
+                             uword valno, OCINumber *retval _*/);
+
+sword OCIExtractToList(/*_ dvoid *hndl, OCIError *err, uword *numkeys _*/);
+
+sword OCIExtractFromList(/*_ dvoid *hndl, OCIError *err, uword index, 
+                             OraText **name, ub1 *type, uword *numvals, 
+                             dvoid ***values _*/);
+
+/* Memory Related Service Interfaces */
+
+sword OCIMemoryAlloc(/*_ dvoid *hdl, OCIError *err, dvoid **mem,
+		OCIDuration dur, ub4 size, ub4 flags _*/);
+ 
+sword OCIMemoryResize(/*_ dvoid *hdl, OCIError *err, dvoid **mem,
+                        ub4 newsize, ub4 flags _*/);
+
+sword OCIMemoryFree(/*_ dvoid *hdl, OCIError *err, dvoid *mem _*/);
+
+sword OCIContextSetValue(/*_ dvoid *hdl, OCIError *err, OCIDuration duration,
+                        ub1 *key, ub1 keylen, dvoid *ctx_value _*/);
+ 
+sword OCIContextGetValue(/*_ dvoid *hdl, OCIError *err, ub1 *key,
+                        ub1 keylen, dvoid **ctx_value _*/);
+ 
+sword OCIContextClearValue(/*_ dvoid *hdl, OCIError *err, ub1 *key, 
+                        ub1 keylen _*/);
+ 
+sword OCIContextGenerateKey(/*_ dvoid *hdl, OCIError *err, ub4 *key _*/);
+
+sword OCIMemorySetCurrentIDs(/*_ dvoid *hdl, OCIError *err, 
+        ub4 curr_session_id, ub4 curr_trans_id, ub4 curr_stmt_id _*/);
+ 
+sword OCIPicklerTdsCtxInit(/*_ OCIEnv *env, OCIError *err, 
+			OCIPicklerTdsCtx **tdsc _*/);
+ 
+sword OCIPicklerTdsCtxFree(/*_ OCIEnv *env, OCIError *err, 
+			OCIPicklerTdsCtx *tdsc _*/);
+ 
+sword OCIPicklerTdsInit(/*_ OCIEnv *env, OCIError *err, OCIPicklerTdsCtx *tdsc,
+			OCIPicklerTds **tdsh _*/);
+ 
+sword OCIPicklerTdsFree(/*_ OCIEnv *env, OCIError *err, 
+			OCIPicklerTds *tdsh _*/);
+ 
+sword OCIPicklerTdsCreateElementNumber(/*_ OCIEnv *env, OCIError *err,
+                                           OCIPicklerTds *tdsh, ub1 prec,
+                                           sb1 scale, 
+                                           OCIPicklerTdsElement *elt _*/);
+ 
+sword OCIPicklerTdsCreateElementChar(/*_ OCIEnv *env, OCIError *err,
+                                         OCIPicklerTds *tdsh, ub2 len, 
+                                         OCIPicklerTdsElement *elt _*/);
+ 
+sword OCIPicklerTdsCreateElementVarchar(/*_ OCIEnv *env, OCIError *err,
+                                            OCIPicklerTds *tdsh, ub2 len, 
+                                            OCIPicklerTdsElement *elt _*/);
+
+sword OCIPicklerTdsCreateElementRaw(/*_ OCIEnv *env, OCIError *err,
+                                        OCIPicklerTds *tdsh, ub2 len, 
+                                        OCIPicklerTdsElement *elt _*/);
+ 
+sword OCIPicklerTdsCreateElement(/*_ OCIEnv *env, OCIError *err,
+                                OCIPicklerTds *tdsh, OCITypeCode dty, 
+				OCIPicklerTdsElement *elt _*/);
+ 
+sword OCIPicklerTdsAddAttr(/*_ OCIEnv *env, OCIError *err,
+                               OCIPicklerTds *tdsh, 
+                               OCIPicklerTdsElement elt _*/);
+ 
+sword OCIPicklerTdsGenerate(/*_ OCIEnv *env, OCIError *err,
+                                OCIPicklerTds *tdsh _*/);
+ 
+sword OCIPicklerTdsGetAttr(/*_ OCIEnv *env, OCIError *err,
+                                CONST OCIPicklerTds *tdsh, ub1  attrno,
+                                OCITypeCode *typ, ub2  *len _*/);
+ 
+sword OCIPicklerFdoInit(/*_ OCIEnv *env, OCIError *err,
+                                OCIPicklerFdo **fdoh _*/);
+ 
+sword OCIPicklerFdoFree(/*_ OCIEnv *env, OCIError *err,
+                                OCIPicklerFdo *fdoh _*/);
+ 
+sword OCIPicklerImageInit(/*_ OCIEnv *env, OCIError *err,
+                              OCIPicklerFdo *fdoh, OCIPicklerTds *tdsh,
+                              OCIPicklerImage **imgh _*/);
+ 
+sword OCIPicklerImageFree(/*_ OCIEnv *env, OCIError *err,
+                                OCIPicklerImage *imgh _*/);
+ 
+sword OCIPicklerImageAddScalar(/*_ OCIEnv *env, OCIError *err,
+                                   OCIPicklerImage *imgh, dvoid *scalar, 
+                                   ub4 len _*/);
+ 
+sword OCIPicklerImageAddNullScalar(/*_ OCIEnv *env, OCIError *err,
+                                OCIPicklerImage *imgh _*/);
+ 
+sword OCIPicklerImageGenerate(/*_ OCIEnv *env, OCIError *err,
+                                OCIPicklerImage *imgh _*/);
+ 
+sword OCIPicklerImageGetScalarSize(/*_ OCIEnv *env, OCIError *err,
+                                OCIPicklerImage *imgh, 
+				ub4  attrno, ub4  *size _*/);
+ 
+sword OCIPicklerImageGetScalar(/*_ OCIEnv *env, OCIError *err,
+                                OCIPicklerImage *imgh, ub4  attrno, 
+				dvoid *buf, ub4  *len, OCIInd *ind _*/);
+
+sword OCIPicklerImageCollBegin(/*_ OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh, CONST OCIPicklerTds *colltdsh _*/);
+ 
+sword OCIPicklerImageCollAddScalar(/*_  OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh, dvoid *scalar,
+                ub4 buflen, OCIInd ind _*/);
+ 
+sword OCIPicklerImageCollEnd(/*_ OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh _*/);
+ 
+/* should take svcctx for locator stuff */
+sword OCIPicklerImageCollBeginScan(/*_ OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh, CONST OCIPicklerTds *coll_tdsh,
+                ub4 attrnum, ub4 startidx, OCIInd *ind _*/);
+ 
+sword OCIPicklerImageCollGetScalarSize(/*_ OCIEnv *env, OCIError *err,
+                CONST OCIPicklerTds *coll_tdsh, ub4 *size _*/);
+ 
+sword OCIPicklerImageCollGetScalar(/*_ OCIEnv *env, OCIError *err,
+                                       OCIPicklerImage *imgh, dvoid *buf,
+                                       ub4 *buflen, OCIInd *ind _*/);
+
+sword OCIAnyDataGetType(/*_ OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        OCITypeCode *tc, OCIType **type _*/);
+
+sword OCIAnyDataIsNull(/*_ OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        boolean *isnull _*/);
+
+sword OCIAnyDataConvert(/*_ OCISvcCtx *svchp, OCIError *errhp, OCITypeCode tc,
+        OCIType *type, OCIDuration dur, dvoid *ind, dvoid *data_val,
+        ub4 len, OCIAnyData **sdata _*/);
+
+sword OCIAnyDataBeginCreate(/*_ OCISvcCtx *svchp, OCIError *errhp, OCITypeCode tc,
+        OCIType *type, OCIDuration dur, OCIAnyData **sdata _*/);
+
+sword OCIAnyDataDestroy(/*_ OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata _*/);
+
+sword OCIAnyDataAttrSet(/*_ OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        OCITypeCode tc, OCIType *type, dvoid *ind, dvoid *attr_val,
+        ub4 length, boolean is_any _*/);
+
+sword OCIAnyDataCollAddElem(/*_ OCISvcCtx *svchp, OCIError *errhp,
+        OCIAnyData *sdata, OCITypeCode tc, OCIType *type, dvoid *ind,
+        dvoid *attr_val, ub4 length, boolean is_any, boolean last_elem _*/);
+
+sword OCIAnyDataEndCreate(/*_ OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata _*/);
+
+sword OCIAnyDataAccess(/*_ OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        OCITypeCode tc, OCIType *type, dvoid *ind, dvoid **attr_val,
+        ub4 *length _*/);
+
+sword OCIAnyDataGetCurrAttrNum(/*_ OCISvcCtx *svchp, OCIError *errhp, 
+		OCIAnyData *sdata, ub4 *attrnum _*/);
+
+sword OCIAnyDataAttrGet(/*_ OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+  OCITypeCode tc, OCIType *type, dvoid *ind, dvoid **attr_val,
+        ub4 *length, boolean is_any _*/);
+
+sword OCIAnyDataCollGetElem(/*_ OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+  OCITypeCode tc, OCIType *type, dvoid *ind, dvoid **celem_val,
+        ub4 *length, boolean is_any _*/);
+
+sword OCIFormatInit(/*_ dvoid *hndl, OCIError *err _*/);
+
+sword OCIFormatString(/*_ dvoid *hndl, OCIError *err, OraText *buffer,
+                          sbig_ora bufferLength, sbig_ora *returnLength,
+                          CONST OraText *formatString, ... _*/);
+
+sword OCIFormatTerm(/*_ dvoid *hndl, OCIError *err _*/);
+
+sword OCIFormatTUb1(/*_ void _*/);
+sword OCIFormatTUb2(/*_ void _*/);
+sword OCIFormatTUb4(/*_ void _*/);
+sword OCIFormatTUword(/*_ void _*/);
+sword OCIFormatTUbig_ora(/*_ void _*/);
+sword OCIFormatTSb1(/*_ void _*/);
+sword OCIFormatTSb2(/*_ void _*/);
+sword OCIFormatTSb4(/*_ void _*/);
+sword OCIFormatTSword(/*_ void _*/);
+sword OCIFormatTSbig_ora(/*_ void _*/);
+sword OCIFormatTEb1(/*_ void _*/);
+sword OCIFormatTEb2(/*_ void _*/);
+sword OCIFormatTEb4(/*_ void _*/);
+sword OCIFormatTEword(/*_ void _*/);
+sword OCIFormatTChar(/*_ void _*/);
+sword OCIFormatTText(/*_ void _*/);
+sword OCIFormatTDouble(/*_ void _*/);
+sword OCIFormatTDvoid(/*_ void _*/);
+sword OCIFormatTEnd(/*_ void _*/);
+
+sword OCIFileClose (/*_ dvoid  *hndl, OCIError *err, OCIFileObject *filep _*/);
+
+
+sword OCIFileExists (/*_ dvoid  *hndl, OCIError *err, OraText *filename,
+                     OraText *path, ub1 *flag _*/ );
+
+sword OCIFileFlush(/*_ dvoid *hndl, OCIError *err, OCIFileObject *filep _*/ );
+
+sword OCIFileGetLength(/*_ dvoid *hndl, OCIError *err, OraText *filename,
+                        OraText *path, ubig_ora *lenp _*/ );
+
+sword OCIFileInit (/*_ dvoid *hndl, OCIError *err _*/);
+
+sword OCIFileOpen (/*_ dvoid *hndl, OCIError *err, OCIFileObject **filep,
+                    OraText *filename, OraText *path, ub4 mode, ub4 create, 
+                    ub4 type _*/);
+
+sword OCIFileRead (/*_ dvoid *hndl, OCIError *err, OCIFileObject *filep,
+                    dvoid *bufp, ub4 bufl, ub4 *bytesread _*/);
+
+sword OCIFileSeek (/*_ dvoid *hndl, OCIError *err, OCIFileObject *filep,
+                     uword origin, ubig_ora offset, sb1 dir _*/);
+
+sword OCIFileTerm (/*_ dvoid *hndl, OCIError *err _*/);
+
+sword OCIFileWrite (/*_ dvoid *hndl, OCIError *err, OCIFileObject   *filep,
+                     dvoid *bufp, ub4 buflen, ub4 *byteswritten _*/);
+
+
+/*-------------------------- Extensions to XA interface ---------------------*/
+/* ------------------------- xaosvch ----------------------------------------*/
+/*
+   NAME
+     xaosvch  -  XA Oracle get SerViCe Handle
+   DESCRIPTION
+     Given a database name return the service handle that is used by the
+     XA library
+   NOTE
+     This macro has been provided for backward compatibilty with 8.0.2
+*/
+OCISvcCtx *xaosvch(/*_ OraText *dbname _*/);
+
+/* ------------------------- xaoSvcCtx --------------------------------------*/
+/*
+   NAME
+     xaoSvcCtx  -  XA Oracle get SerViCe ConTeXt
+   DESCRIPTION
+     Given a database name return the service handle that is used by the
+     XA library
+   NOTE
+     This routine has been provided for APs to get access to the service
+     handle that XA library uses. Without this routine APs must use SQLLIB
+     routine sqlld2 to get access to the Logon data area registered by the
+     XA library
+*/
+OCISvcCtx *xaoSvcCtx(/*_ OraText *dbname _*/);
+
+/* ------------------------- xaoEnv -----------------------------------------*/
+/*
+   NAME
+     xaoEnv  -  XA Oracle get ENvironment Handle
+   DESCRIPTION
+     Given a database name return the environment handle that is used by the
+     XA library
+   NOTE
+     This routine has been provided for APs to get access to the environment
+     handle that XA library uses. Without this routine APs must use SQLLIB
+     routine sqlld2 to get access to the Logon data area registered by the
+     XA library
+*/
+OCIEnv *xaoEnv(/*_ OraText *dbname _*/);
+
+/* ------------------------- xaosterr ---------------------------------------*/
+/*
+   NAME
+     xaosterr  -  XA Oracle get xa STart ERRor code
+   DESCRIPTION
+     Given an oracle error code return the XA error code
+ */
+int xaosterr(/*_ OCISvcCtx *svch, sb4 error _*/);
+/*-------------------------- End Extensions ---------------------------------*/
+
+/*---------------------- Extensions to NLS cartridge service ----------------*/
+/* ----------------------- OCINlsGetInfo ------------------------------------*/
+/*
+   NAME
+     OCINlsGetInfo - Get NLS info from OCI environment handle
+   REMARKS
+     This function generates language information specified by item from OCI 
+     environment handle envhp into an array pointed to by buf within size 
+     limitation as buflen.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR on wrong item.
+   envhp(IN/OUT)
+     OCI environment handle.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and 
+     this function returns a NULL pointer. Diagnostic information can be 
+     obtained by calling OCIErrorGet().
+   buf(OUT)
+     Pointer to the destination buffer.
+   buflen(IN)
+     The size of destination buffer. The maximum length for each information
+     is 32 bytes.
+   item(IN)
+     It specifies to get which item in OCI environment handle and can be one
+     of following values:
+       OCI_NLS_DAYNAME1 : Native name for Monday.
+       OCI_NLS_DAYNAME2 : Native name for Tuesday.
+       OCI_NLS_DAYNAME3 : Native name for Wednesday.
+       OCI_NLS_DAYNAME4 : Native name for Thursday.
+       OCI_NLS_DAYNAME5 : Native name for Friday.
+       OCI_NLS_DAYNAME6 : Native name for for Saturday.
+       OCI_NLS_DAYNAME7 : Native name for for Sunday.
+       OCI_NLS_ABDAYNAME1 : Native abbreviated name for Monday.
+       OCI_NLS_ABDAYNAME2 : Native abbreviated name for Tuesday.
+       OCI_NLS_ABDAYNAME3 : Native abbreviated name for Wednesday.
+       OCI_NLS_ABDAYNAME4 : Native abbreviated name for Thursday.
+       OCI_NLS_ABDAYNAME5 : Native abbreviated name for Friday.
+       OCI_NLS_ABDAYNAME6 : Native abbreviated name for for Saturday.
+       OCI_NLS_ABDAYNAME7 : Native abbreviated name for for Sunday.
+       OCI_NLS_MONTHNAME1 : Native name for January.
+       OCI_NLS_MONTHNAME2 : Native name for February.
+       OCI_NLS_MONTHNAME3 : Native name for March.
+       OCI_NLS_MONTHNAME4 : Native name for April.
+       OCI_NLS_MONTHNAME5 : Native name for May.
+       OCI_NLS_MONTHNAME6 : Native name for June.
+       OCI_NLS_MONTHNAME7 : Native name for July.
+       OCI_NLS_MONTHNAME8 : Native name for August.
+       OCI_NLS_MONTHNAME9 : Native name for September.
+       OCI_NLS_MONTHNAME10 : Native name for October.
+       OCI_NLS_MONTHNAME11 : Native name for November.
+       OCI_NLS_MONTHNAME12 : Native name for December.
+       OCI_NLS_ABMONTHNAME1 : Native abbreviated name for January.
+       OCI_NLS_ABMONTHNAME2 : Native abbreviated name for February.
+       OCI_NLS_ABMONTHNAME3 : Native abbreviated name for March.
+       OCI_NLS_ABMONTHNAME4 : Native abbreviated name for April.
+       OCI_NLS_ABMONTHNAME5 : Native abbreviated name for May.
+       OCI_NLS_ABMONTHNAME6 : Native abbreviated name for June.
+       OCI_NLS_ABMONTHNAME7 : Native abbreviated name for July.
+       OCI_NLS_ABMONTHNAME8 : Native abbreviated name for August.
+       OCI_NLS_ABMONTHNAME9 : Native abbreviated name for September.
+       OCI_NLS_ABMONTHNAME10 : Native abbreviated name for October.
+       OCI_NLS_ABMONTHNAME11 : Native abbreviated name for November.
+       OCI_NLS_ABMONTHNAME12 : Native abbreviated name for December.
+       OCI_NLS_YES : Native string for affirmative response.
+       OCI_NLS_NO : Native negative response. 
+       OCI_NLS_AM : Native equivalent string of AM.
+       OCI_NLS_PM : Native equivalent string of PM.
+       OCI_NLS_AD : Native equivalent string of AD.
+       OCI_NLS_BC : Native equivalent string of BC.
+       OCI_NLS_DECIMAL : decimal character.
+       OCI_NLS_GROUP : group separator.
+       OCI_NLS_DEBIT : Native symbol of debit.
+       OCI_NLS_CREDIT : Native sumbol of credit.
+       OCI_NLS_DATEFORMAT : Oracle date format.
+       OCI_NLS_INT_CURRENCY: International currency symbol.
+       OCI_NLS_LOC_CURRENCY : Locale currency symbol.
+       OCI_NLS_LANGUAGE : Language name.
+       OCI_NLS_ABLANGUAGE : Abbreviation for language name.
+       OCI_NLS_TERRITORY : Territory name.
+       OCI_NLS_CHARACTER_SET : Character set name.
+       OCI_NLS_LINGUISTIC : Linguistic name.
+       OCI_NLS_CALENDAR : Calendar name.
+       OCI_NLS_DUAL_CURRENCY : Dual currency symbol.
+*/
+sword OCINlsGetInfo(/*_ dvoid *envhp, OCIError *errhp, OraText *buf,
+                    size_t buflen, ub2 item _*/);
+
+/* ----------------------- OCINlsNumericInfoGet ----------------------------*/
+/*
+   NAME
+     OCINlsNumericInfoGet - Get NLS numeric info from OCI environment handle
+   REMARKS
+     This function generates numeric language information specified by item 
+     from OCI environment handle envhp into an output number variable.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR on wrong item.
+   envhp(IN/OUT)
+     OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and 
+     this function returns a NULL pointer. Diagnostic information can be 
+     obtained by calling OCIErrorGet().
+   val(OUT)
+     Pointer to the output number variable. On OCI_SUCCESS return, it will
+     contain the requested NLS numeric info.
+   item(IN)
+     It specifies to get which item in OCI environment handle and can be one
+     of following values:
+       OCI_NLS_CHARSET_MAXBYTESZ : Maximum character byte size for OCI
+                                   environment or session handle charset
+       OCI_NLS_CHARSET_FIXEDWIDTH: Character byte size for fixed-width charset;
+                                   0 for variable-width charset
+*/
+sword OCINlsNumericInfoGet(/*_ dvoid *envhp, OCIError *errhp, sb4 *val, 
+                           ub2 item _*/);
+
+/* ----------------------- OCINlsCharSetNameToId -----------------------------*/
+/*
+   NAME
+     OCINlsCharSetNameToId - Get Oracle charset id given Oracle charset name
+   REMARKS
+     This function will get the Oracle character set id corresponding to
+     the given Oracle character set name.
+   RETURNS
+     Oracle character set id for the given Oracle character set name if
+     character set name and OCI handle are valid; otherwise returns 0.
+   envhp(IN/OUT)
+     OCI environment handle.
+   name(IN)
+     Pointer to a null-terminated Oracle character set name whose id 
+     will be returned.
+*/
+ub2 OCINlsCharSetNameToId(/*_ dvoid *envhp, const oratext *name _*/);
+
+/* ----------------------- OCINlsCharSetIdToName -----------------------------*/
+/*
+   NAME
+     OCINlsCharSetIdToName - Get Oracle charset name given Oracle charset id
+   REMARKS
+     This function will get the Oracle character set name corresponding to
+     the given Oracle character set id.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
+   buf(OUT)
+     Pointer to the destination buffer. On OCI_SUCCESS return, it will contain
+     the null-terminated string for character set name.
+   buflen(IN)
+     Size of destination buffer. Recommended size is OCI_NLS_MAXBUFSZ for
+     guarantee to store an Oracle character set name. If it's smaller than
+     the length of the character set name, the function will return OCI_ERROR.
+   id(IN)
+     Oracle character set id.
+*/
+sword OCINlsCharSetIdToName(/*_ dvoid *envhp, oratext *buf, size_t buflen, 
+                            ub2 id _*/);
+
+/* ----------------------- OCINlsNameMap ------------------------------------*/
+/*
+   NAME
+     OCINlsNameMap - Map NLS naming from Oracle to other standards and vice 
+                     versa
+   REMARKS
+     This function will map NLS naming from Oracle to other standards (such
+     as ISO, IANA) and vice versa.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
+   buf(OUT)
+     Pointer to the destination buffer. On OCI_SUCCESS return, it will 
+     contain null-terminated string for requested mapped name.
+   buflen(IN)
+     The size of destination buffer. Recommended size is OCI_NLS_MAXBUFSZ
+     for guarantee to store an NLS name. If it is smaller than the length
+     of the name, the function will return OCI_ERROR.
+   srcbuf(IN)
+     Pointer to null-terminated NLS name. If it is not a valid name in its
+     define scope, the function will return OCI_ERROR.
+   flag(IN)
+     It specifies name mapping direction and can take the following values:
+       OCI_NLS_CS_IANA_TO_ORA : Map character set name from IANA to Oracle
+       OCI_NLS_CS_ORA_TO_IANA : Map character set name from Oracle to IANA
+       OCI_NLS_LANG_ISO_TO_ORA : Map language name from ISO to Oracle
+       OCI_NLS_LANG_ORA_TO_ISO : Map language name from Oracle to ISO
+       OCI_NLS_TERR_ISO_TO_ORA : Map territory name from ISO to Oracle
+       OCI_NLS_TERR_ORA_TO_ISO : Map territory name from Oracle to ISO
+       OCI_NLS_TERR_ISO3_TO_ORA : Map territory name from 3-letter ISO
+                                  abbreviation to Oracle
+       OCI_NLS_TERR_ORA_TO_ISO3 : Map territory name from Oracle to 3-letter
+                                  ISO abbreviation
+*/
+sword OCINlsNameMap(/*_ dvoid *envhp, oratext *buf, size_t buflen,
+                    const oratext *srcbuf, ub4 flag _*/);
+
+/* -------------------- OCIMultiByteToWideChar ------------------------------*/
+/*
+   NAME
+     OCIMultiByteToWideChar - Convert a null terminated multibyte string into 
+                              wchar
+   REMARKS
+     This routine converts an entire null-terminated string into the wchar 
+     format. The wchar output buffer will be null-terminated.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Destination buffer for wchar.
+   src (IN)
+     Source string to be converted.
+   rsize (OUT)
+     Number of characters converted including null-terminator.
+     If it is a NULL pointer, no number return
+*/
+sword OCIMultiByteToWideChar(/*_ dvoid *envhp, OCIWchar *dst, 
+                            CONST OraText *src, size_t *rsize _*/);
+
+
+/* --------------------- OCIMultiByteInSizeToWideChar -----------------------*/
+/*
+   NAME
+     OCIMultiByteInSizeToWideChar - Convert a mulitbyte string in length into
+                                    wchar
+   REMARKS
+     This routine converts part of string into the wchar format. It will
+     convert as many complete characters as it can until it reaches output
+     buffer size or input buffer size or it reaches a null-terminator in
+     source string. The output buffer will be null-terminated if space permits.
+     If dstsz is zero, this function will only return number of characters not
+     including ending null terminator for converted string.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Pointer to a destination buffer for wchar. It can be NULL pointer when
+     dstsz is zero.
+   dstsz(IN)
+     Destination buffer size in character. If it is zero, this function just
+     returns number of characters will be need for the conversion.
+   src (IN)
+     Source string to be converted.
+   srcsz(IN)
+     Length of source string in byte.
+   rsize(OUT)
+     Number of characters written into destination buffer, or number of
+     characters for converted string is dstsz is zero.
+     If it is NULL pointer, nothing to return.
+*/
+sword OCIMultiByteInSizeToWideChar(/*_ dvoid *envhp, OCIWchar *dst,
+                                  size_t dstsz, CONST OraText *src, 
+                                  size_t srcsz, size_t *rsize _*/);
+
+
+/* ---------------------- OCIWideCharToMultiByte ----------------------------*/
+/*
+   NAME
+     OCIWideCharToMultiByte - Convert a null terminated wchar string into
+                              multibyte
+   REMARKS
+     This routine converts an entire null-terminated wide character string into
+     multi-byte string. The output buffer will be null-terminated.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Destination buffer for multi-byte string.
+   src (IN)
+     Source wchar string to be converted.
+   rsize (OUT)
+     Number of bytes written into the destination buffer.
+     If it is NULL pointer, nothing to return.
+*/
+sword OCIWideCharToMultiByte(/*_ dvoid *envhp, OraText *dst, 
+                            CONST OCIWchar *src, size_t *rsize _*/);
+
+
+/* ---------------------- OCIWideCharInSizeToMultiByte ----------------------*/
+/*
+   NAME
+     OCIWideCharInSizeToMultiByte - Convert a wchar string in length into 
+                                    mulitbyte
+   REMARKS
+     This routine converts part of wchar string into the multi-byte format.
+     It will convert as many complete characters as it can until it reaches
+     output buffer size or input buffer size or it reaches a null-terminator
+     in source string. The output buffer will be null-terminated if space
+     permits. If dstsz is zero, the function just returns the size of byte not 
+     including ending null-terminator need to store the converted string.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Destination buffer for multi-byte. It can be NULL pointer if dstsz is zero.
+   dstsz(IN)
+     Destination buffer size in byte. If it is zero, it just returns the size
+     of bytes need for converted string.
+   src (IN)
+     Source wchar string to be converted.
+   srcsz(IN)
+     Length of source string in character.
+   rsize(OUT)
+     Number of bytes written into destination buffer, or number of bytes need
+     to store the converted string if dstsz is zero.
+     If it is NULL pointer, nothing to return.
+*/
+sword OCIWideCharInSizeToMultiByte(/*_ dvoid *envhp, OraText *dst,
+                                    size_t dstsz, CONST OCIWchar *src,
+                                    size_t srcsz, size_t *rsize _*/);
+
+
+
+/* ----------------------- OCIWideCharIsAlnum -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsAlnum - test whether wc is a letter or decimal digit
+   REMARKS
+     It tests whether wc is a letter or decimal digit.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsAlnum(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharIsAlpha -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsAlpha - test whether wc is an alphabetic letter
+   REMARKS
+     It tests whether wc is an alphabetic letter
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsAlpha(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* --------------------- OCIWideCharIsCntrl ---------------------------------*/
+/*
+   NAME
+     OCIWideCharIsCntrl - test whether wc is a control character
+   REMARKS
+     It tests whether wc is a control character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsCntrl(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharIsDigit -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsDigit - test whether wc is a decimal digit character
+   REMARKS
+     It tests whether wc is a decimal digit character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsDigit(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharIsGraph -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsGraph - test whether wc is a graph character
+   REMARKS
+     It tests whether wc is a graph character. A graph character is character
+     with a visible representation and normally includes alphabetic letter,
+     decimal digit, and punctuation.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsGraph(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharIsLower -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsLower - test whether wc is a lowercase letter
+   REMARKS
+     It tests whether wc is a lowercase letter.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsLower(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharIsPrint -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsPrint - test whether wc is a printable character
+   REMARKS
+     It tests whether wc is a printable character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsPrint(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharIsPunct -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsPunct - test whether wc is a punctuation character
+   REMARKS
+     It tests whether wc is a punctuation character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsPunct(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharIsSpace -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsSpace - test whether wc is a space character
+   REMARKS
+     It tests whether wc is a space character. A space character only causes
+     white space in displayed text(for example, space, tab, carriage return,
+     newline, vertical tab or form feed).
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsSpace(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharIsUpper -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsUpper - test whether wc is a uppercase letter
+   REMARKS
+     It tests whether wc is a uppercase letter.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsUpper(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/*----------------------- OCIWideCharIsXdigit -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsXdigit - test whether wc is a hexadecimal digit
+   REMARKS
+     It tests whether wc is a hexadecimal digit ( 0-9, A-F, a-f ).
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsXdigit(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* --------------------- OCIWideCharIsSingleByte ----------------------------*/
+/*
+   NAME
+     OCIWideCharIsSingleByte - test whether wc is a single-byte character
+   REMARKS
+     It tests whether wc is a single-byte character when converted into
+     multi-byte.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsSingleByte(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharToLower -------------------------------*/
+/*
+   NAME
+     OCIWideCharToLower - Convert a wchar into the lowercase
+   REMARKS
+     If there is a lower-case character mapping for wc in the specified locale,
+     it will return the lower-case in wchar, else return wc itself.
+   RETURNS
+     A wchar
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for lowercase mapping.
+*/
+OCIWchar OCIWideCharToLower(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharToUpper -------------------------------*/
+/*
+   NAME
+     OCIWideCharToUpper - Convert a wchar into the uppercase
+   REMARKS
+     If there is a upper-case character mapping for wc in the specified locale,
+     it will return the upper-case in wchar, else return wc itself.
+   RETURNS
+     A wchar
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for uppercase mapping.
+*/
+OCIWchar OCIWideCharToUpper(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharStrcmp --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrcmp - compare two null terminated wchar string
+   REMARKS
+     It compares two wchar string in binary ( based on wchar encoding value ),
+     linguistic, or case-insensitive.
+   RETURNS
+     0, if wstr1 == wstr2.
+     Positive, if wstr1 > wstr2.
+     Negative, if wstr1 < wstr2.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set.
+   wstr1(IN)
+     Pointer to a null-terminated wchar string.
+   wstr2(IN)
+     Pointer to a null-terminated wchar string.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY : for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC : for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive
+     comparison.
+*/
+int OCIWideCharStrcmp(/*_ dvoid *envhp, CONST OCIWchar *wstr1, 
+                CONST OCIWchar *wstr2, int flag _*/);
+
+
+/* ----------------------- OCIWideCharStrncmp -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrncmp - compare twe wchar string in length
+   REMARKS
+     This function is similar to OCIWideCharStrcmp(), except that at most len1
+     characters from wstr1 and len2 characters from wstr1 are compared. The
+     null-terminator will be taken into the comparison.
+   RETURNS
+     0, if wstr1 = wstr2
+     Positive, if wstr1 > wstr2
+     Negative, if wstr1 < wstr2
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr1(IN)
+     Pointer to the first wchar string
+   len1(IN)
+     The length for the first string for comparison
+   wstr2(IN)
+     Pointer to the second wchar string
+   len2(IN)
+     The length for the second string for comparison.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY : for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC : for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 
+     comparison.
+*/
+int OCIWideCharStrncmp(/*_ dvoid *envhp, CONST OCIWchar *wstr1, size_t len1,
+                 CONST OCIWchar *wstr2, size_t len2, int flag _*/);
+
+
+/* ----------------------- OCIWideCharStrcat --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrcat - concatenate two wchar strings
+   REMARKS
+     This function appends a copy of the wchar string pointed to by wsrcstr,
+     including the null-terminator to the end of wchar string pointed to by
+     wdststr. It returns the number of character in the result string not
+     including the ending null-terminator.
+   RETURNS
+     number of characters in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(IN/OUT)
+     Pointer to the destination wchar string for appending.
+   wsrcstr(IN)
+     Pointer to the source wchar string to append.
+*/
+size_t OCIWideCharStrcat(/*_ dvoid *envhp, OCIWchar *wdststr,
+                         CONST OCIWchar *wsrcstr _*/);
+
+
+/* ----------------------- OCIWideCharStrchr --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrchr - Search the first occurrence of wchar in a wchar string
+   REMARKS
+     This function searchs for the first occurrence of wc in the wchar string
+     pointed to by wstr. It returns a pointer to the whcar if successful, or
+     a null pointer.
+   RETURNS
+     wchar pointer if successful, otherwise a null pointer.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr(IN)
+     Pointer to the wchar string to search
+   wc(IN)
+     Wchar to search for.
+*/
+OCIWchar *OCIWideCharStrchr(/*_ dvoid *envhp, CONST OCIWchar *wstr,
+                            OCIWchar wc _*/);
+
+
+/* ----------------------- OCIWideCharStrcpy --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrcpy - copy a wchar string
+   REMARKS
+     This function copies the wchar string pointed to by wsrcstr, including the 
+     null-terminator, into the array pointed to by wdststr. It returns the
+     number of character copied not including the ending null-terminator.
+   RETURNS
+     number of characters copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(OUT)
+     Pointer to the destination wchar buffer.
+   wsrcstr(IN)
+     Pointer to the source wchar string.
+*/
+size_t OCIWideCharStrcpy(/*_ dvoid *envhp, OCIWchar *wdststr,
+                         CONST OCIWchar *wsrcstr _*/);
+
+
+/* ----------------------- OCIWideCharStrlen --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrlen - Return number of character in a wchar string
+   REMARKS
+     This function computes the number of characters in the wchar string
+     pointed to by wstr, not including the null-terminator, and returns
+    this number. 
+   RETURNS
+     number of characters not including ending null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr(IN)
+     Pointer to the source wchar string.
+*/
+size_t OCIWideCharStrlen(/*_ dvoid *envhp, CONST OCIWchar *wstr _*/);
+
+
+/* ----------------------- OCIWideCharStrncat -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrncat - Concatenate wchar string in length
+   REMARKS
+     This function is similar to OCIWideCharStrcat(), except that at most n
+     characters from wsrcstr are appended to wdststr. Note that the
+     null-terminator in wsrcstr will stop appending. wdststr will be
+     null-terminated.. 
+   RETURNS
+     Number of characters in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(IN/OUT)
+     Pointer to the destination wchar string for appending.
+   wsrcstr(IN)
+     Pointer to the source wchar string to append.
+   n(IN)
+     Number of characters from wsrcstr to append.
+*/
+size_t OCIWideCharStrncat(/*_ dvoid *envhp, OCIWchar *wdststr,
+                          CONST OCIWchar *wsrcstr, size_t n _*/);
+
+
+/* ----------------------- OCIWideCharStrncpy -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrncpy - Copy wchar string in length
+   REMARKS
+     This function is similar to OCIWideCharStrcpy(), except that at most n
+     characters are copied from the array pointed to by wsrcstr to the array
+     pointed to by wdststr. Note that the null-terminator in wdststr will
+     stop coping and result string will be null-terminated.
+   RETURNS
+     number of characters copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(OUT)
+     Pointer to the destination wchar buffer.
+   wsrcstr(IN)
+     Pointer to the source wchar string.
+   n(IN)
+     Number of characters from wsrcstr to copy.
+*/
+size_t OCIWideCharStrncpy(/*_ dvoid *envhp, OCIWchar *wdststr,
+                          CONST OCIWchar *wsrcstr, size_t n _*/);
+
+
+/* ----------------------- OCIWideCharStrrchr -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrrchr - search the last occurrence of a wchar in wchar string
+   REMARKS
+     This function searchs for the last occurrence of wc in the wchar string
+     pointed to by wstr. It returns a pointer to the whcar if successful, or
+     a null pointer.
+   RETURNS
+     wchar pointer if successful, otherwise a null pointer.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr(IN)
+     Pointer to the wchar string to search
+   wc(IN)
+     Wchar to search for.
+*/
+OCIWchar *OCIWideCharStrrchr(/*_ dvoid *envhp, CONST OCIWchar *wstr,
+                             OCIWchar wc _*/);
+
+
+/* --------------------- OCIWideCharStrCaseConversion -----------------------*/
+/*
+   NAME
+     OCIWideCharStrCaseConversion - convert a wchar string into lowercase or
+                                    uppercase
+   REMARKS
+     This function convert the wide char string pointed to by wsrcstr into the
+     uppercase or lowercase specified by flag and copies the result into the
+     array pointed to by wdststr. The result string will be null-terminated.
+   RETURNS
+     number of characters for result string not including null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle.
+   wdststr(OUT)
+     Pointer to destination array.
+   wsrcstr(IN)
+     Pointer to source string.
+   flag(IN)
+     Specify the case to convert:
+       OCI_NLS_UPPERCASE : convert to uppercase.
+       OCI_NLS_LOWERCASE: convert to lowercase.
+     This flag can be ORed with OCI_NLS_LINGUISTIC to specify that the
+     linguistic setting in the locale will be used for case conversion.
+*/
+size_t OCIWideCharStrCaseConversion(/*_ dvoid *envhp, OCIWchar *wdststr,
+                                    CONST OCIWchar *wsrcstr, ub4 flag _*/);
+
+
+/*---------------------- OCIWideCharDisplayLength ---------------------------*/
+/*
+   NAME
+     OCIWideCharDisplayLength - Calculate the display length for a wchar
+   REMARKS
+     This function determines the number of column positions required for wc
+     in display. It returns number of column positions, or 0 if wc is 
+     null-terminator.
+   RETURNS
+     Number of display positions.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar character.
+*/
+size_t OCIWideCharDisplayLength(/*_ dvoid *envhp, OCIWchar wc  _*/);
+
+
+/*---------------------- OCIWideCharMultiByteLength -------------------------*/
+/*
+   NAME
+     OCIWideCharMultiByteLength - Determine byte size in multi-byte encoding
+   REMARKS
+     This function determines the number of byte required for wc in multi-byte
+     encoding. It returns number of bytes in multi-byte for wc.
+   RETURNS
+     Number of bytes.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar character.
+*/
+size_t OCIWideCharMultiByteLength(/*_ dvoid *envhp, OCIWchar wc _*/);
+
+
+/* ----------------------- OCIMultiByteStrcmp -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrcmp - Compare two multi-byte strings
+   REMARKS
+     It compares two multi-byte strings in binary ( based on encoding value ),
+     linguistic, or case-insensitive.
+   RETURNS
+     0, if str1 == str2.
+     Positive, if str1 > str2.
+     Negative, if str1 < str2.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set.
+   str1(IN)
+     Pointer to a null-terminated string.
+   str2(IN)
+     Pointer to a null-terminated string.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY: for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC: for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 
+     comparison.
+*/
+int OCIMultiByteStrcmp(/*_ dvoid *envhp, CONST OraText *str1,
+                       CONST OraText *str2, int flag _*/);
+
+
+/*----------------------- OCIMultiByteStrncmp -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrncmp - compare two strings in length
+   REMARKS
+     This function is similar to OCIMultiBytestrcmp(), except that at most len1 bytes
+     from str1 and len2 bytes from str2 are compared. The null-terminator will
+     be taken into the comparison.
+   RETURNS
+     0, if str1 = str2
+     Positive, if str1 > str2
+     Negative, if str1 < str2
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set.
+   str1(IN)
+     Pointer to the first string
+   len1(IN)
+     The length for the first string for comparison
+   str2(IN)
+     Pointer to the second string
+   len2(IN)
+     The length for the second string for comparison.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY: for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC: for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 
+     comparison.
+*/
+int OCIMultiByteStrncmp(/*_ dvoid *envhp, CONST OraText *str1, size_t len1,
+                        OraText *str2, size_t len2, int flag _*/);
+
+
+/*----------------------- OCIMultiByteStrcat --------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrcat - concatenate multibyte strings
+   REMARKS
+     This function appends a copy of the multi-byte string pointed to by
+     srcstr, including the null-terminator to the end of string pointed to by
+     dststr. It returns the number of bytes in the result string not including
+     the ending null-terminator.
+   RETURNS
+     number of bytes in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     Pointer to OCI environment handle
+   dststr(IN/OUT)
+     Pointer to the destination multi-byte string for appending.
+   srcstr(IN)
+     Pointer to the source string to append.
+*/
+size_t OCIMultiByteStrcat(/*_ dvoid *envhp, OraText *dststr,
+                          CONST OraText *srcstr _*/);
+
+
+/*------------------------- OCIMultiByteStrcpy ------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrcpy - copy multibyte string
+   REMARKS
+     This function copies the multi-byte string pointed to by srcstr,
+     including the null-terminator, into the array pointed to by dststr. It
+     returns the number of bytes copied not including the ending 
+     null-terminator.
+   RETURNS
+     number of bytes copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     Pointer to the OCI environment handle.
+   srcstr(OUT)
+     Pointer to the destination buffer.
+   dststr(IN)
+     Pointer to the source multi-byte string.
+*/
+size_t OCIMultiByteStrcpy(/*_ dvoid *envhp, OraText *dststr,
+                          CONST OraText *srcstr _*/);
+
+
+/*----------------------- OCIMultiByteStrlen --------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrlen - Calculate multibyte string length
+   REMARKS
+     This function computes the number of bytes in the multi-byte string
+     pointed to by str, not including the null-terminator, and returns this
+     number. 
+   RETURNS
+     number of bytes not including ending null-terminator.
+   str(IN)
+     Pointer to the source multi-byte string.
+*/
+size_t OCIMultiByteStrlen(/*_ dvoid *envhp, CONST OraText *str _*/);
+
+
+/*----------------------- OCIMultiByteStrncat -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrncat - concatenate string in length
+   REMARKS
+     This function is similar to OCIMultiBytestrcat(), except that at most n
+     bytes from srcstr are appended to dststr. Note that the null-terminator in
+     srcstr will stop appending and the function will append as many character
+     as possible within n bytes. dststr will be null-terminated. 
+   RETURNS
+     Number of bytes in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     Pointer to OCI environment handle.
+   srcstr(IN/OUT)
+     Pointer to the destination multi-byte string for appending.
+   dststr(IN)
+     Pointer to the source multi-byte string to append.
+   n(IN)
+     Number of bytes from srcstr to append.
+*/
+size_t OCIMultiByteStrncat(/*_ dvoid *envhp, OraText *dststr,
+                           CONST OraText *srcstr, size_t n _*/);
+
+
+/*----------------------- OCIMultiByteStrncpy -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrncpy - copy multibyte string in length
+   REMARKS
+     This function is similar to OCIMultiBytestrcpy(), except that at most n
+     bytes are copied from the array pointed to by srcstr to the array pointed
+     to by dststr. Note that the null-terminator in srcstr will stop coping and
+     the function will copy as many character as possible within n bytes. The 
+     result string will be null-terminated.
+   RETURNS
+     number of bytes copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     Pointer to a OCI environment handle.
+   dststr(IN)
+     Pointer to the source multi-byte string.
+   srcstr(OUT)
+     Pointer to the destination buffer.
+   n(IN)
+     Number of bytes from srcstr to copy.
+*/
+size_t OCIMultiByteStrncpy(/*_ dvoid *envhp, OraText *dststr,
+                           CONST OraText *srcstr, size_t n _*/);
+
+
+/*----------------------- OCIMultiByteStrnDisplayLength ---------------------*/
+/*
+   NAME
+     OCIMultiByteStrnDisplayLength - calculate the display length for a
+                                     multibyt string
+   REMARKS
+     This function returns the number of display positions occupied by the 
+     complete characters within the range of n bytes.
+   RETURNS
+     number of display positions.
+   envhp(IN/OUT)
+     OCI environment handle.
+   str(IN)
+     Pointer to a multi-byte string.
+   n(IN)
+     Number of bytes to examine.
+*/
+size_t OCIMultiByteStrnDisplayLength(/*_ dvoid *envhp, CONST OraText *str1,
+                                     size_t n _*/);
+
+
+/*---------------------- OCIMultiByteStrCaseConversion  ---------------------*/
+/*
+   NAME
+     OCIMultiByteStrCaseConversion
+   REMARKS
+     This function convert the multi-byte string pointed to by srcstr into the
+     uppercase or lowercase specified by flag and copies the result into the
+     array pointed to by dststr. The result string will be null-terminated.
+   RETURNS
+     number of bytes for result string not including null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle.
+   dststr(OUT)
+     Pointer to destination array.
+   srcstr(IN)
+     Pointer to source string.
+   flag(IN)
+     Specify the case to convert:
+       OCI_NLS_UPPERCASE: convert to uppercase.
+       OCI_NLS_LOWERCASE: convert to lowercase.
+     This flag can be ORed with OCI_NLS_LINGUISTIC to specify that the 
+     linguistic setting in the locale will be used for case conversion.
+*/
+size_t OCIMultiByteStrCaseConversion(/*_ dvoid *envhp, OraText *dststr,
+                                     CONST OraText *srcstr, ub4 flag _*/);
+
+
+/*------------------------- OCICharSetToUnicode -----------------------------*/
+/*
+   NAME
+     OCICharSetToUnicode - convert multibyte string into Unicode as UCS2
+   REMARKS
+     This function converts a multi-byte string pointed to by src to Unicode 
+     into the array pointed to by dst. The conversion will stop when it reach
+     to the source limitation or destination limitation. 
+     The function will return number of characters converted into Unicode.
+     If dstlen is zero, it will just return the number of characters for the
+     result without real conversion.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     Pointer to an OCI environment handle
+   dst(OUT)
+     Pointer to a destination buffer
+   dstlen(IN)
+     Size of destination buffer in character
+   src(IN)
+     Pointer to multi-byte source string.
+   srclen(IN)
+     Size of source string in bytes.
+   rsize(OUT)
+     Number of characters converted.
+     If it is a NULL pointer, nothing to return.
+*/
+sword OCICharSetToUnicode(/*_ dvoid *envhp, ub2 *dst, size_t dstlen,
+                        CONST OraText *src, size_t  srclen, size_t *rsize _*/);
+
+
+/*------------------------- OCIUnicodeToCharSet -----------------------------*/
+/*
+   NAME
+     OCIUnicodeToCharSet - convert Unicode into multibyte
+   REMARKS
+     This function converts a Unicode string pointed to by src to multi-byte
+     into the array pointed to by dst. The conversion will stop when it reach
+     to the source limitation or destination limitation. The function will
+     return number of bytes converted into multi-byte. If dstlen is zero, it
+     will just return the number of bytes for the result without real 
+     conversion. If a Unicode character is not convertible for the character
+     set specified in OCI environment handle, a replacement character will be
+     used for it. In this case, OCICharSetConversionIsReplacementUsed() will
+     return ture.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     Pointer to an OCI environment handle.
+   dst(OUT)
+     Pointer to a destination buffer.
+   dstlen(IN)
+     Size of destination buffer in byte.
+   src(IN)
+     Pointer to a Unicode string.
+   srclen(IN)
+     Size of source string in characters.
+   rsize(OUT)
+     Number of bytes converted.
+     If it is a NULL pointer, nothing to return.
+*/
+sword OCIUnicodeToCharSet(/*_ dvoid *envhp, OraText *dst, size_t dstlen, 
+                           CONST ub2 *src, size_t srclen, size_t *rsize _*/);
+
+
+/*----------------------- OCINlsCharSetConvert ------------------------------*/
+/*
+   NAME
+     OCINlsCharSetConvert - convert between any two character set.
+   REMARKS
+     This function converts a string pointed to by src in the character set
+     specified with srcid to the array pointed to by dst in the character set
+     specified with dstid. The conversion will stop when it reaches the source
+     limitation or destination limitation. The function will return the number
+     of bytes converted into the destination buffer. Even though either source
+     or destination character set id is OCI_UTF16ID, given and return data
+     length will be represented with the byte length as this function is
+     intended for generic purpose. Note the conversion will not stop at null
+     data.
+     To get character set id from name, OCINlsCharSetNameToId can be used.
+     To check if derived data in the destination buffer contains any
+     replacement character resulting from conversion failure,
+     OCICharSetConversionIsReplacementUsed can be used to get the status.
+     Data alignment should be guaranteed by a caller. For example, UTF-16 data
+     should be aligned to ub2 type.
+
+   RETURNS
+     OCI_SUCCESS or OCI_ERROR.
+   errhp(IN/OUT)
+     OCI error handle. If there is an error, it is recorded in errhp and this
+     function returns a NULL pointer. Diagnostic information can be obtained
+     by calling OCIErrorGet().
+   dstid(IN)
+     Character set id for the destination buffer.
+   dstp(OUT)
+     Pointer to the destination buffer.
+   dstlen(IN)
+     The maximum byte size of destination buffer.
+   srcid(IN)
+     Character set id for the source buffer.
+   srcp(IN)
+     Pointer to the source buffer.
+   srclen(IN)
+     The length byte size of source buffer.
+   rsize(OUT)
+     The number of characters converted. If it is a NULL pointer, nothing to
+     return.
+*/
+sword OCINlsCharSetConvert(/*_ dvoid *envhp, OCIError *errhp, 
+                        ub2 dstid, dvoid *dstp, size_t dstlen,
+                        ub2 srcid, CONST dvoid *srcp, size_t srclen,
+                        size_t *rsize _*/);
+
+/* ------------------- OCICharsetConversionIsReplacementUsed ----------------*/
+/*
+   NAME
+     OCICharsetConversionIsReplacementUsed - chech if replacement is used in 
+                                             conversion
+   REMARKS
+     This function indicates whether or not the replacement character was used
+     for nonconvertible characters in character set conversion in last invoke
+     of OCICharsetUcs2ToMb().
+   RETURNS
+     TRUE is the replacement character was used in last OCICharsetUcs2ToMb()
+     invoking, else FALSE.
+   envhp(IN/OUT)
+     OCI environment handle. This should be the first handle passed to 
+     OCICharsetUcs2ToMb().
+*/
+boolean OCICharSetConversionIsReplacementUsed(/*_ dvoid *envhp _*/);
+
+/*------------------- OCINlsEnvironmentVariableGet -----------------*/
+/*
+   NAME
+     OCINlsEnvironmentVariableGet - get a value of NLS environment variable.
+
+   DESCRIPTION
+     This function retrieves a value of NLS environment variable to the buffer
+     pointed to by val. Data type is determined by the parameter specified by
+     item. Either numeric data or string data can be retrieved.
+
+   RETURNS
+     OCI_SUCCESS or OCI_ERROR.
+
+   PARAMETERS
+   valp(OUT) -
+     Pointer to the buffer.
+   size(IN) -
+     Size of the buffer. This argument is only applicable to string data type,
+     but not to numerical data, in such case, it is ignored.
+   item(IN) -
+     NLS item value, which can be one of following values:
+       OCI_NLS_CHARSET_ID  - NLS_LANG character set id in ub2 data type.
+       OCI_NLS_NCHARSET_ID - NLS_NCHAR character set id in ub2 data type.
+   charset(IN) -
+     Character set id for retrieved string data. If it is 0, NLS_LANG will be
+     used. OCI_UTF16ID is a valid id. In case of numeric data, this argument
+     is ignored.
+   rsize(OUT) -
+     Size of return value.
+
+   NOTE
+     This functions is mainly used for retrieving character set id from either
+     NLS_LANG or NLS_NCHAR environment variables. If NLS_LANG is not set,
+     the default character set id is returned.
+     For future extension, the buffer is capable for storing other data types.
+*/
+sword OCINlsEnvironmentVariableGet(/*_ dvoid  *valp, size_t size, ub2 item,
+                                   ub2 charset, size_t *rsize _*/);
+
+
+/*------------------------- OCIMessageOpen ----------------------------------*/
+/*
+   NAME
+     OCIMessageOpen - open a locale message file
+   REMARKS
+     This function opens a message handle for facility of product in a language
+     pointed to by envhp. It first try to open the message file corresponding
+     to envhp for the facility. If it successes, it will use that file to
+     initialize a message handle, else it will use the default message file
+     which is for American language for the facility. The function return a
+     pointer pointed to a message handle into msghp parameter.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     A pointer to OCI environment handle for message language.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and this
+     function returns a NULL pointer. Diagnostic information can be obtained by
+     calling OCIErrorGet().
+   msghp(OUT)
+     a message handle for return
+   product(IN)
+     A pointer to a product name. Product name is used to locate the directory
+     for message in a system dependent way. For example, in Solaris, the
+     directory of message files for the product `rdbms' is
+     `${ORACLE_HOME}/rdbms'.
+   facility(IN)
+     A pointer to a facility name in the product. It is used to construct a
+     message file name. A message file name follows the conversion with 
+     facility as prefix. For example, the message file name for facility
+     `img' in American language will be `imgus.msb' where `us' is the 
+     abbreviation of American language and `msb' as message binary file 
+     extension.
+   dur(IN)
+     Duration for memory allocation for the return message handle. It can be
+     the following values:
+        OCI_DURATION_CALL
+        OCI_DURATION_STATEMENT
+        OCI_DURATION_SESSION
+        OCI_DURATION_TRANSACTION
+     For the detail description, please refer to Memory Related Service
+     Interfaces section.
+*/
+sword OCIMessageOpen(/*_ dvoid *envhp, OCIError *errhp, OCIMsg **msghp,
+                      CONST OraText *product, CONST OraText *facility, 
+                      OCIDuration dur _*/);
+ 
+
+/*------------------------- OCIMessageGet -----------------------------------*/
+/*
+   NAME
+     OCIMessageGet - get a locale message from a message handle
+   REMARKS
+     This function will get message with message number identified by msgno and
+     if buflen is not zero, the function will copy the message into the buffer
+     pointed to by msgbuf. If buflen is zero, the message will be copied into
+     a message buffer inside the message handle pointed to by msgh. For both
+     cases. it will return the pointer to the null-terminated message string.
+     If it cannot get the message required, it will return a NULL pointer.
+   RETURNS
+     A pointer to a null-terminated message string on success, otherwise a NULL
+     pointer.
+   msgh(IN/OUT)
+     Pointer to a message handle which was previously opened by OCIMessageOpen().
+   msgno(IN)
+     The message number for getting message.
+   msgbuf(OUT)
+     Pointer to a destination buffer to the message retrieved. If buflen is
+     zero, it can be NULL pointer.
+   buflen(IN)
+     The size of the above destination buffer.
+*/
+OraText *OCIMessageGet(/*_ OCIMsg *msgh, ub4 msgno, OraText *msgbuf,
+                        size_t buflen _*/);
+
+
+/*------------------------- OCIMessageClose ---------------------------------*/
+/*
+   NAME
+     OCIMessageClose - close a message handle
+   REMARKS
+     This function closes a message handle pointed to by msgh and frees any
+     memory associated with this handle.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     A pointer to OCI environment handle for message language.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and this
+     function returns a NULL pointer. Diagnostic information can be obtained by
+     calling OCIErrorGet().
+   msghp(IN/OUT)
+     A pointer to a message handle which was previously opened by
+     OCIMessageOpen().
+*/
+sword OCIMessageClose(/*_ dvoid *envhp, OCIError *errhp, OCIMsg *msghp _*/);
+
+/*--------------- End of Extensions to NLS cartridge service ----------------*/
+
+/*----------------- Extensions to OCI Thread interface ---------------------*/
+/*****************************************************************************
+                              DESCRIPTION
+******************************************************************************
+1 Threads Interface
+
+The OCIThread package provides a number of commonly used threading
+primitives for use by Oracle customers.  It offers a portable interface to
+threading capabilities native to various platforms.  It does not implement
+threading on platforms which do not have native threading capability.
+
+OCIThread does not provide a portable implementation of multithreaded 
+facilities.  It only serves as a set of portable covers for native 
+multithreaded facilities.  Therefore, platforms that do not have native 
+support for multi-threading will only be able to support a limited 
+implementation of OCIThread.  As a result, products that rely on all of 
+OCIThread's functionality will not port to all platforms.  Products that must 
+port to all platforms must use only a subset of OCIThread's functionality.  
+This issue is discussed further in later sections of this document.
+
+The OCIThread API is split into four main parts.  Each part is described
+briefly here.  The following subsections describe each in greater detail.
+
+ 1. Initialization and Termination Calls
+
+     These calls deal with the initialization and termination of OCIThread.
+     Initialization of OCIThread initializes the OCIThread context which is
+     a member of the OCI environment or session handle.  This context is 
+     required for other OCIThread calls.
+
+ 2. Passive Threading Primitives
+
+     The passive threading primitives include primitives to manipulate mutual
+     exclusion (mutex) locks, thread ID's, and thread-specific data keys.
+
+     The reason that these primitives are described as 'passive' is that while
+     their specifications allow for the existence of multiple threads, they do
+     not require it.  This means that it is possible for these primitives to
+     be implemented according to specification in both single-threaded and
+     multi-threaded environments.
+
+     As a result, OCIThread clients that use only these primitives will not
+     require the existence of multiple threads in order to work correctly,
+     i.e., they will be able to work in single-threaded environments without 
+     branching code.
+
+ 3. Active Threading Primitives
+
+     Active threading primitives include primitives dealing with the creation,
+     termination, and other manipulation of threads.
+
+     The reason that these primitives are described as 'active' is that they
+     can only be used in true multi-threaded environments.  Their
+     specifications explicitly require that it be possible to have multiple
+     threads.  If you need to determine at runtime whether or not you are in a
+     multi-threaded environment, call OCIThreadIsMulti() before calling an
+     OCIThread active primitive.
+
+
+1.1 Initialization & Termination
+==================================
+
+The types and functions described in this section are associated with the
+initialization and termination of the OCIThread package.  OCIThread must
+be properly initialized before any of its functionality can be used.
+OCIThread's process initialization function, 'OCIThreadProcessInit()',
+must be called with care; see below.
+
+The observed behavior of the initialization and termination functions is the
+same regardless of whether OCIThread is in single-threaded or multi-threaded
+environment.  It is OK to call the initialization functions from both generic
+and operating system specific (OSD) code.
+
+1.1.1 Types
+
+  OCIThreadContext - OCIThread Context
+  -------------------------------------
+
+    Most calls to OCIThread functions take the OCI environment or session 
+    handle as a parameter.  The OCIThread context is part of the OCI 
+    environment or session handle and it must be initialized by calling 
+    'OCIThreadInit()'.  Termination of the OCIThread context occurs by calling
+    'OCIThreadTerm()'.
+
+    The OCIThread context is a private data structure.  Clients must NEVER
+    attempt to examine the contents of the context.
+
+1.1.2  OCIThreadProcessInit
+
+  OCIThreadProcessInit - OCIThread Process INITialization
+  --------------------------------------------------------
+
+    Description
+
+      This function should be called to perform OCIThread process
+      initialization.
+
+    Prototype
+
+      void OCIThreadProcessInit();
+
+    Returns
+
+      Nothing.
+
+    Notes
+
+      Whether or not this function needs to be called depends on how OCI
+      Thread is going to be used.
+
+        * In a single-threaded application, calling this function is optional.
+          If it is called at all, the first call to it must occur before calls
+          to any other OCIThread functions.  Subsequent calls can be made
+          without restriction; they will not have any effect.
+
+        * In a multi-threaded application, this function MUST be called.  The
+          first call to it MUST occur 'strictly before' any other OCIThread
+          calls; i.e., no other calls to OCIThread functions (including other
+          calls to this one) can be concurrent with the first call.
+          Subsequent calls to this function can be made without restriction;
+          they will not have any effect.
+
+
+1.1.3 OCIThreadInit
+
+  OCIThreadInit - OCIThread INITialize
+  -------------------------------------
+
+    Description
+
+      This initializes OCIThread context.
+
+    Prototype
+
+      sword OCIThreadInit(dvoid *hndl, OCIError *err);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal for OCIThread clients to try an examine the memory
+      pointed to by the returned pointer.
+
+      It is safe to make concurrent calls to 'OCIThreadInit()'.  Unlike
+      'OCIThreadProcessInit()',  there is no need to have a first call
+      that occurs before all the others.
+
+      The first time 'OCIThreadInit()' is called, it initilaizes the OCI
+      Thread context.  It also saves a pointer to the context in some system
+      dependent manner.  Subsequent calls to 'OCIThreadInit()' will return
+      the same context.
+
+      Each call to 'OCIThreadInit()' must eventually be matched by a call to
+      'OCIThreadTerm()'.
+
+  OCIThreadTerm - OCIThread TERMinate
+  ------------------------------------
+
+    Description
+
+      This should be called to release the OCIThread context.  It should be
+      called exactly once for each call made to 'OCIThreadInit()'.
+
+    Prototype
+
+      sword OCIThreadTerm(dvoid *hndl, OCIError *err);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is safe to make concurrent calls to 'OCIThreadTerm()'.
+
+      'OCIThreadTerm()' will not do anything until it has been called as
+      many times as 'OCIThreadInit()' has been called.  When that happens,
+      it terminates the OCIThread layer and frees the memory allocated for
+      the context.  Once this happens, the context should not be re-used.
+      It will be necessary to obtain a new one by calling 'OCIThreadInit()'.
+
+
+  OCIThreadIsMulti - OCIThread Is Multi-Threaded?
+  ------------------------------------------------
+
+    Description
+
+      This tells the caller whether the application is running in a
+      multi-threaded environment or a single-threaded environment.
+
+    Prototype
+      boolean OCIThreadIsMulti(void);
+
+    Returns
+
+      TRUE if the environment is multi-threaded;
+      FALSE if the environment is single-threaded.
+
+
+1.2 Passive Threading Primitives
+==================================
+
+1.2.1 Types
+
+The passive threading primitives deal with the manipulation of mutex, 
+thread ID's, and thread-specific data.  Since the specifications of these 
+primitives do not require the existence of multiple threads, they can be 
+used both on multithreaded and single-threaded platforms.
+
+1.2.1.1  OCIThreadMutex - OCIThread Mutual Exclusion Lock
+-----------------------------------------------------------
+
+  The type 'OCIThreadMutex' is used to represent a mutual exclusion lock
+  (mutex).  A mutex is typically used for one of two purposes: (i) to
+  ensure that only one thread accesses a given set of data at a time, or
+  (ii) to ensure that only one thread executes a given critical section of
+  code at a time.
+
+  Mutexes pointer can be declared as parts of client structures or as 
+  stand-alone variables.  Before they can be used, they must be initialized 
+  using 'OCIThreadMutexInit()'.  Once they are no longer needed, they must be
+  destroyed using 'OCIThreadMutexDestroy()'.  A mutex pointer must NOT be 
+  used after it is destroyed.
+
+  A thread can acquire a mutex by using either 'OCIThreadMutexAcquire()' or
+  'OCIThreadMutexTry()'.  They both ensure that only one thread at a time is
+  allowed to hold a given mutex.  A thread that holds a mutex can release it
+  by calling 'OCIThreadMutexRelease()'.
+
+
+1.2.1.2  OCIThreadKey - OCIThread Key for Thread-Specific Data
+----------------------------------------------------------------
+
+  A key can be thought of as a process-wide variable that has a
+  thread-specific value.  What this means is that all the threads in a
+  process can use any given key.  However, each thread can examine or modify
+  that key independently of the other threads.  The value that a thread sees
+  when it examines the key will always be the same as the value that it last
+  set for the key.  It will not see any values set for the key by the other
+  threads.
+
+  The type of the value held by a key is a 'dvoid *' generic pointer.
+
+  Keys can be created using 'OCIThreadKeyInit()'.  When a key is created, its
+  value is initialized to 'NULL' for all threads.
+
+  A thread can set a key's value using 'OCIThreadKeySet()'.  A thread can
+  get a key's value using 'OCIThreadKeyGet()'.
+
+  The OCIThread key functions will save and retrieve data SPECIFIC TO THE
+  THREAD.  When clients maintain a pool of threads and assign the threads to
+  different tasks, it *may not* be appropriate for a task to use OCIThread
+  key functions to save data associated with it.  Here is a scenario of how
+  things can fail: A thread is assigned to execute the initialization of a
+  task.  During the initialization, the task stored some data related to it
+  in the thread using OCIThread key functions.  After the initialization,
+  the thread is returned back to the threads pool.  Later, the threads pool
+  manager assigned another thread to perform some operations on the task,
+  and the task needs to retrieve those data it stored earlier in
+  initialization.  Since the task is running in another thread, it will not
+  be able to retrieve the same data back!  Applications that use thread
+  pools should be aware of this and be cautious when using OCIThread key
+  functions.
+
+
+1.2.1.3  OCIThreadKeyDestFunc - OCIThread Key Destructor Function Type
+------------------------------------------------------------------------
+
+  This is the type of a pointer to a key's destructor routine.  Keys can be
+  associated with a destructor routine when they are created (see
+  'OCIThreadKeyInit()').
+
+  A key's destructor routine will be called whenever a thread that has a
+  non-NULL value for the key terminates.
+
+  The destructor routine returns nothing and takes one parameter.  The
+  parameter will be the value that was set for key when the thread
+  terminated.
+
+  The destructor routine is guaranteed to be called on a thread's value
+  in the key after the termination of the thread and before process
+  termination.  No more precise guarantee can be made about the timing
+  of the destructor routine call; thus no code in the process may assume
+  any post-condition of the destructor routine.  In particular, the
+  destructor is not guaranteed to execute before a join call on the
+  terminated thread returns.
+
+
+1.2.1.4  OCIThreadId - OCIThread Thread ID
+--------------------------------------------
+
+  Type 'OCIThreadId' is the type that will be used to identify a thread.
+  At any given time, no two threads will ever have the same 'OCIThreadId'.
+  However, 'OCIThreadId' values can be recycled; i.e., once a thread dies,
+  a new thread may be created that has the same 'OCIThreadId' as the one
+  that died.  In particular, the thread ID must uniquely identify a thread
+  T within a process, and it must be consistent and valid in all threads U
+  of the process for which it can be guaranteed that T is running
+  concurrently with U.  The thread ID for a thread T must be retrievable
+  within thread T.  This will be done via OCIThreadIdGet().
+
+  The 'OCIThreadId' type supports the concept of a NULL thread ID: the NULL
+  thread ID will never be the same as the ID of an actual thread.
+
+
+
+1.2.2 Function prototypes for passive primitives
+--------------------------------------------------
+
+1.2.2.1 Mutex functions
+-------------------------
+
+  OCIThreadMutexInit - OCIThread MuteX Initialize
+  -----------------------------------------------
+
+    Description
+
+      This allocate and initializes a mutex.  All mutexes must be 
+      initialized prior to use.
+
+    Prototype
+
+      sword OCIThreadMutexInit(dvoid *hndl, OCIError *err, 
+                               OCIThreadMutex **mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        mutex(OUT):  The mutex to initialize.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      Multiple threads must not initialize the same mutex simultaneously.
+      Also, a mutex must not be reinitialized until it has been destroyed (see
+      'OCIThreadMutexDestroy()').
+
+  OCIThreadMutexDestroy - OCIThread MuteX Destroy
+  -----------------------------------------------
+
+    Description
+
+      This destroys and deallocate a mutex.  Each mutex must be destroyed 
+      once it is no longer needed.
+
+    Prototype
+
+      sword OCIThreadMutexDestroy(dvoid *hndl, OCIError *err,
+                                  OCIThreadMutex **mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        mutex(IN/OUT):   The mutex to destroy.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is not legal to destroy a mutex that is uninitialized or is currently
+      held by a thread.  The destruction of a mutex must not occur concurrently
+      with any other operations on the mutex.  A mutex must not be used after
+      it has been destroyed.
+
+
+  OCIThreadMutexAcquire - OCIThread MuteX Acquire
+  -----------------------------------------------
+
+    Description
+
+      This acquires a mutex for the thread in which it is called.  If the mutex
+      is held by another thread, the calling thread is blocked until it can
+      acquire the mutex.
+
+    Prototype
+
+     sword OCIThreadMutexAcquire(dvoid *hndl, OCIError *err,
+                                 OCIThreadMutex *mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error, it is 
+                     recorded in err and this function returns OCI_ERROR.  
+                     Diagnostic information can be obtained by calling 
+                     OCIErrorGet().
+
+        mutex(IN/OUT):   The mutex to acquire.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to attempt to acquire an uninitialized mutex.
+
+      This function's behavior is undefined if it is used by a thread to
+      acquire a mutex that is already held by that thread.
+
+
+
+  OCIThreadMutexRelease - OCIThread MuteX Release
+  -----------------------------------------------
+
+    Description
+
+      This releases a mutex.  If there are any threads blocked on the mutex,
+      one of them will acquire it and become unblocked.
+
+    Prototype
+
+      sword OCIThreadMutexRelease(dvoid *hndl, OCIError *err,
+                                  OCIThreadMutex *mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        mutex(IN/OUT):   The mutex to release.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to attempt to release an uninitialized mutex.  It is also
+      illegal for a thread to release a mutex that it does not hold.
+
+
+  OCIThreadKeyInit - OCIThread KeY Initialize
+  -------------------------------------------
+
+    Description
+
+      This creates a key.  Each call to this routine allocate and generates 
+      a new key that is distinct from all other keys.
+
+    Prototype
+
+      sword OCIThreadKeyInit(dvoid *hndl, OCIError *err, OCIThreadKey **key,
+                             OCIThreadKeyDestFunc destFn);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(OUT):    The 'OCIThreadKey' in which to create the new key.
+
+        destFn(IN):  The destructor for the key.  NULL is permitted.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      Once this function executes successfully, a pointer to an allocated and 
+      initialized key is return.  That key can be used with 'OCIThreadKeyGet()'
+      and 'OCIThreadKeySet()'.  The initial value of the key will be 'NULL' for
+      all threads.
+
+      It is illegal for this function to be called more than once to create the
+      same key (i.e., to be called more than once with the same value for the
+      'key' parameter).
+
+      If the 'destFn' parameter is not NULL, the routine pointed to by 'destFn'
+      will be called whenever a thread that has a non-NULL value for the key
+      terminates.  The routine will be called with one parameter.  The
+      parameter will be the key's value for the thread at the time at which the
+      thread terminated.
+      If the key does not need a destructor function, pass NULL for 'destFn'.
+
+
+  OCIThreadKeyDestroy - OCIThread KeY DESTROY
+  -------------------------------------------
+
+   Description
+
+     Destroy and deallocate the key pointed to by 'key'.
+
+    Prototype
+
+      sword OCIThreadKeyDestroy(dvoid *hndl, OCIError *err, 
+                                OCIThreadKey **key);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(IN/OUT):  The 'OCIThreadKey' in which to destroy the key.
+ 
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      This is different from the destructor function callback passed to the
+      key create routine.  This new destroy function 'OCIThreadKeyDestroy' is 
+      used to terminate any resources OCI THREAD acquired when it created 
+      'key'.  [The 'OCIThreadKeyDestFunc' callback type is a key VALUE 
+      destructor; it does in no way operate on the key itself.]
+
+      This must be called once the user has finished using the key.  Not
+      calling the key destroy function may result in memory leaks.
+
+
+
+
+1.2.2.2 Thread Key operations
+-------------------------------
+
+  OCIThreadKeyGet - OCIThread KeY Get value
+  -----------------------------------------
+
+    Description
+
+      This gets the calling thread's current value for a key.
+
+    Prototype
+
+      sword OCIThreadKeyGet(dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                            dvoid **pValue);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(IN):          The key.
+
+        pValue(IN/OUT):   The location in which to place the thread-specific
+                          key value.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to use this function on a key that has not been created
+      using 'OCIThreadKeyInit()'.
+
+      If the calling thread has not yet assigned a value to the key, 'NULL' is
+      placed in the location pointed to by 'pValue'.
+
+
+  OCIThreadKeySet - OCIThread KeY Set value
+  -----------------------------------------
+
+    Description
+
+      This sets the calling thread's value for a key.
+
+    Prototype
+
+      sword OCIThreadKeySet(dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                            dvoid *value);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(IN/OUT): The key.
+
+        value(IN):   The thread-specific value to set in the key.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to use this function on a key that has not been created
+      using 'OCIThreadKeyInit()'.
+
+1.2.2.3  Thread Id
+--------------------
+
+  OCIThreadIdInit - OCIThread Thread Id INITialize
+  --------------------------------------------------
+
+    Description
+
+      Allocate and initialize the thread id 'tid'.
+
+    Prototype
+
+      sword OCIThreadIdInit(dvoid *hndl, OCIError *err, OCIThreadId **tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid (OUT):   Pointer to the thread ID to initialize.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+
+  OCIThreadIdDestroy - OCIThread Thread Id DESTROY
+  --------------------------------------------------
+
+    Description
+
+      Destroy and deallocate the thread id 'tid'.
+
+    Prototype
+
+      sword OCIThreadIdDestroy(dvoid *hndl, OCIError *err, OCIThreadId **tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid(IN/OUT):        Pointer to the thread ID to destroy.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Note
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdSet - OCIThread Thread Id Set
+  -----------------------------------------
+
+    Description
+
+      This sets one 'OCIThreadId' to another.
+
+    Prototype
+
+      sword OCIThreadIdSet(dvoid *hndl, OCIError *err, 
+                           OCIThreadId *tidDest,
+                           OCIThreadId *tidSrc);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tidDest(OUT):   This should point to the location of the 'OCIThreadId'
+                        to be set to.
+
+        tidSrc(IN):     This should point to the 'OCIThreadId' to set from.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdSetNull - OCIThread Thread Id Set Null
+  ---------------------------------------------------------
+
+    Description
+
+      This sets the NULL thread ID to a given 'OCIThreadId'.
+
+    Prototype
+
+      sword OCIThreadIdSetNull(dvoid *hndl, OCIError *err,
+                               OCIThreadId *tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error, it is 
+                     recorded in err and this function returns OCI_ERROR.  
+                     Diagnostic information can be obtained by calling 
+                     OCIErrorGet().
+
+        tid(OUT):    This should point to the 'OCIThreadId' in which to put
+                     the NULL thread ID.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdGet - OCIThread Thread Id Get
+  ------------------------------------------
+
+    Description
+
+      This retrieves the 'OCIThreadId' of the thread in which it is called.
+
+    Prototype
+
+      sword OCIThreadIdGet(dvoid *hndl, OCIError *err,
+                           OCIThreadId *tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid(OUT):    This should point to the location in which to place the
+                     ID of the calling thread.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+      When OCIThread is used in a single-threaded environment,
+      OCIThreadIdGet() will always place the same value in the location
+      pointed to by 'tid'.  The exact value itself is not important.  The
+      important thing is that it is not the same as the NULL thread ID and
+      that it is always the same value.
+
+
+  OCIThreadIdSame - OCIThread Thread Ids Same?
+  ----------------------------------------------
+
+    Description
+
+      This determines whether or not two 'OCIThreadId's represent the same
+      thread.
+
+    Prototype
+
+      sword OCIThreadIdSame(dvoid *hndl, OCIError *err,
+                            OCIThreadId *tid1, OCIThreadId *tid2,
+                            boolean *result);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid1(IN):   Pointer to the first 'OCIThreadId'.
+
+        tid2(IN):   Pointer to the second 'OCIThreadId'.
+	
+	result(IN/OUT): Pointer to the result.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      If 'tid1' and 'tid2' represent the same thread, 'result' is set to TRUE.
+      Otherwise, 'result' is set to FALSE.
+
+      'result' is set to TRUE if both 'tid1' and 'tid2' are the NULL thread ID.
+
+      'ti1d' and 'tid2' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdNull - OCIThread Thread Id NULL?
+  ---------------------------------------------
+
+    Description
+
+      This determines whether or not a given 'OCIThreadId' is the NULL thread
+      ID.
+
+    Prototype
+
+      sword OCIThreadIdNull(dvoid *hndl, OCIError *err,
+                            OCIThreadId *tid,
+                            boolean *result);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid(IN):    Pointer to the 'OCIThreadId' to check.
+
+	result(IN/OUT): Pointer to the result.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      If 'tid' is the NULL thread ID, 'result' is set to TRUE.  Otherwise, 
+      'result' is set to FALSE.
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+1.3 Active Threading Primitives
+=================================
+
+The active threading primitives deal with the manipulation of actual
+threads.  Because the specifications of most of these primitives require
+that it be possible to have multiple threads, they work correctly only in
+the enabled OCIThread; In the disabled OCIThread, they always return
+failure.  The exception is OCIThreadHandleGet(); it may be called in a 
+single-threaded environment, in which case it will have no effect.
+
+Active primitives should only be called by code running in a multi-threaded
+environment.  You can call OCIThreadIsMulti() to determine whether the 
+environment is multi-threaded or single-threaded.
+
+
+1.3.1  Types
+--------------
+
+1.3.1.1    OCIThreadHandle - OCIThread Thread Handle
+------------------------------------------------------
+
+  Type 'OCIThreadHandle' is used to manipulate a thread in the active
+  primitives:  OCIThreadJoin()and OCIThreadClose().  A thread handle opened by
+  OCIThreadCreate() must be closed in a matching call to
+  OCIThreadClose().  A thread handle is invalid after the call to
+  OCIThreadClose().
+
+  The distinction between a thread ID and a thread handle in OCIThread usage
+  follows the distinction between the thread ID and the thread handle on
+  Windows NT.  On many platforms, the underlying native types are the same.
+
+
+1.3.2  Functions
+------------------
+
+  OCIThreadHndInit - OCIThread HaNDle Initialize
+  ----------------------------------------------
+
+    Description
+
+      Allocate and initialize the thread handle.
+
+    Prototype
+
+      sword OCIThreadHndInit(dvoid *hndl, OCIError *err, 
+                             OCIThreadHandle **thnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        thnd(OUT):   The address of pointer to the thread handle to initialize.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+
+  OCIThreadHndDestroy - OCIThread HaNDle Destroy
+  ----------------------------------------------
+
+    Description
+
+      Destroy and deallocate the thread handle.
+
+    Prototype
+
+      sword OCIThreadHndDestroy(dvoid *hndl, OCIError *err, 
+                                OCIThreadHandle **thnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        thnd(IN/OUT):  The address of pointer to the thread handle to destroy.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+
+  OCIThreadCreate - OCIThread Thread Create
+  -----------------------------------------
+
+    Description
+
+      This creates a new thread.
+
+    Prototype
+
+      sword OCIThreadCreate(dvoid *hndl, OCIError *err,
+                            void (*start)(dvoid *), dvoid *arg,
+                            OCIThreadId *tid, OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        start(IN):    The function in which the new thread should begin
+                      execution.
+
+        arg(IN):      The argument to give the function pointed to by 'start'.
+
+        tid(IN/OUT):  If not NULL, gets the ID for the new thread.
+
+        tHnd(IN/OUT): If not NULL, gets the handle for the new thread.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      The new thread will start by executing a call to the function pointed
+      to by 'start' with the argument given by 'arg'.  When that function
+      returns, the new thread will terminate.  The function should not
+      return a value and should accept one parameter, a 'dvoid *'.
+
+      The call to OCIThreadCreate() must be matched by a call to
+      OCIThreadClose() if and only if tHnd is non-NULL.
+
+      If tHnd is NULL, a thread ID placed in *tid will not be valid in the
+      calling thread because the timing of the spawned thread's termination
+      is unknown.
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+
+
+  OCIThreadJoin - OCIThread Thread Join
+  -------------------------------------
+
+    Description
+
+      This function allows the calling thread to 'join' with another thread.
+      It blocks the caller until the specified thread terminates.
+
+    Prototype
+
+      sword OCIThreadJoin(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tHnd(IN):    The 'OCIThreadHandle' of the thread to join with.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+      The result of multiple threads all trying to join with the same thread is
+      undefined.
+
+
+  OCIThreadClose - OCIThread Thread Close
+  ---------------------------------------
+
+   Description
+
+     This function should be called to close a thread handle.
+
+   Prototype
+
+     sword OCIThreadClose(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tHnd(IN/OUT):    The OCIThread thread handle to close.
+
+   Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+   Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+      Both thread handle and the thread ID that was returned by the same call
+      to OCIThreadCreate() are invalid after the call to OCIThreadClose().
+
+
+
+  OCIThreadHandleGet - OCIThread Thread Get Handle
+  ------------------------------------------------
+
+    Description
+
+      Retrieve the 'OCIThreadHandle' of the thread in which it is called.
+
+    Prototype
+
+      sword OCIThreadHandleGet(dvoid *hndl, OCIError *err,
+                               OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tHnd(IN/OUT):      If not NULL, the location to place the thread
+                           handle for the thread.
+
+     Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().   
+
+      The thread handle 'tHnd' retrieved by this function must be closed 
+      with OCIThreadClose() and destroyed by OCIThreadHndDestroy() after it
+      is used.
+
+
+
+
+1.4 Using OCIThread
+=====================
+
+This section summarizes some of the more important details relating to the use
+of OCIThread.
+
+  * Process initialization
+
+    OCIThread only requires that the process initialization function
+    ('OCIThreadProcessInit()') be called when OCIThread is being used in a
+    multi-threaded application.  Failing to call 'OCIThreadProcessInit()' in
+    a single-threaded application is not an error.
+
+  * OCIThread initialization
+
+    Separate calls to 'OCIThreadInit()' will all return the same OCIThread
+    context.
+
+    Also, remember that each call to 'OCIThreadInit()' must eventually be
+    matched by a call to 'OCIThreadTerm()'.
+
+  * Active vs. Passive Threading primitives
+
+    OCIThread client code written without using any active primitives can be
+    compiled and used without change on both single-threaded and
+    multi-threaded platforms.
+
+    OCIThread client code written using active primitives will only work
+    correctly on multi-threaded platforms.  In order to write a version of the
+    same application to run on single-threaded platform, it is necessary to 
+    branch the your code, whether by branching versions of the source file or 
+    by branching at runtime with the OCIThreadIsMulti() call.
+******************************************************************************/
+
+/*****************************************************************************
+                         ACTUAL PROTOTYPE DECLARATIONS
+******************************************************************************/
+
+void OCIThreadProcessInit(/*_ _*/);
+
+sword OCIThreadInit(/*_ dvoid *hndl, OCIError *err _*/);
+
+sword OCIThreadTerm(/*_ dvoid *hndl, OCIError *err _*/);
+
+boolean OCIThreadIsMulti(/*_ void _*/);
+
+sword OCIThreadMutexInit(/*_ dvoid *hndl, OCIError *err, 
+                             OCIThreadMutex **mutex _*/);
+
+sword OCIThreadMutexDestroy(/*_ dvoid *hndl, OCIError *err, 
+                                OCIThreadMutex **mutex _*/);
+
+sword OCIThreadMutexAcquire(/*_ dvoid *hndl, OCIError *err,
+                                OCIThreadMutex *mutex _*/);
+
+sword OCIThreadMutexRelease(/*_ dvoid *hndl, OCIError *err,
+                                OCIThreadMutex *mutex _*/);
+
+sword OCIThreadKeyInit(/*_ dvoid *hndl, OCIError *err, OCIThreadKey **key,
+                           OCIThreadKeyDestFunc destFn _*/);
+
+sword OCIThreadKeyDestroy(/*_ dvoid *hndl, OCIError *err, 
+                              OCIThreadKey **key _*/);
+
+sword OCIThreadKeyGet(/*_ dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                          dvoid **pValue _*/);
+
+sword OCIThreadKeySet(/*_ dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                          dvoid *value _*/);
+
+sword OCIThreadIdInit(/*_ dvoid *hndl, OCIError *err, OCIThreadId **tid _*/);
+
+sword OCIThreadIdDestroy(/*_ dvoid *hndl, OCIError *err, 
+                             OCIThreadId **tid _*/);
+
+sword OCIThreadIdSet(/*_ dvoid *hndl, OCIError *err, 
+                         OCIThreadId *tidDest, OCIThreadId *tidSrc _*/);
+
+sword OCIThreadIdSetNull(/*_ dvoid *hndl, OCIError *err, OCIThreadId *tid _*/);
+
+sword OCIThreadIdGet(/*_ dvoid *hndl, OCIError *err, OCIThreadId *tid _*/);
+
+sword OCIThreadIdSame(/*_ dvoid *hndl, OCIError *err,
+                          OCIThreadId *tid1, OCIThreadId *tid2,
+                          boolean *result _*/);
+
+sword OCIThreadIdNull(/*_ dvoid *hndl, OCIError *err,
+                          OCIThreadId *tid, boolean *result _*/);
+
+sword OCIThreadHndInit(/*_ dvoid *hndl, OCIError *err, 
+                           OCIThreadHandle **thnd _*/);
+
+sword OCIThreadHndDestroy(/*_ dvoid *hndl, OCIError *err, 
+                              OCIThreadHandle **thnd _*/);
+
+sword OCIThreadCreate(/*_ dvoid *hndl, OCIError *err,
+                          void (*start)(dvoid *), dvoid *arg,
+                          OCIThreadId *tid, OCIThreadHandle *tHnd _*/);
+
+sword OCIThreadJoin(/*_ dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd _*/);
+
+sword OCIThreadClose(/*_ dvoid *hndl, OCIError *err, 
+                         OCIThreadHandle *tHnd _*/);
+
+sword OCIThreadHandleGet(/*_ dvoid *hndl, OCIError *err, 
+                             OCIThreadHandle *tHnd _*/);
+/*----------------- End OCI Thread interface Extensions ---------------------*/
+
+/*--------------- Begin OCI Client Notification Interfaces ------------------*/
+
+typedef ub4 (*OCISubscriptionNotify)(/*_ dvoid *ctx, OCISubscription *subscrhp,
+                                         dvoid *pay, ub4 payl,
+                                         dvoid *desc, ub4 mode _*/);
+
+sword OCISubscriptionRegister (/*_ OCISvcCtx *svchp, 
+                              OCISubscription **subscrhpp, ub2 count, 
+                              OCIError *errhp, ub4 mode _*/);
+
+sword OCISubscriptionPost (/*_ OCISvcCtx *svchp, OCISubscription **subscrhpp,
+                               ub2 count, OCIError *errhp, ub4 mode _*/);
+
+sword OCISubscriptionUnRegister (/*_ OCISvcCtx *svchp, 
+                                OCISubscription *subscrhp, OCIError *errhp, 
+                                ub4 mode _*/);
+
+sword OCISubscriptionDisable (/*_ OCISubscription *subscrhp,
+                                  OCIError *errhp, ub4 mode _*/);
+
+sword OCISubscriptionEnable (/*_ OCISubscription *subscrhp,
+                                 OCIError *errhp, ub4 mode _*/);
+
+/*------------------- End OCI Client Notification Interfaces ----------------*/
+
+/*----------------- Extensions to Datetime interfaces -----------------------*/
+
+sword OCIDateTimeGetTime(/*_ dvoid *hndl, OCIError *err, 
+			   OCIDateTime *datetime, ub1 *hour, ub1 *min, 
+			   ub1 *sec, ub4 *fsec_*/);
+
+sword OCIDateTimeGetDate(/*_dvoid *hndl, OCIError *err, 
+			   CONST OCIDateTime *date,
+			   sb2 *year, ub1 *month, ub1 *day _*/);
+
+sword OCIDateTimeGetTimeZoneOffset(/*_ dvoid *hndl,OCIError *err,
+                  CONST OCIDateTime   *datetime,sb1 *hour,sb1 *minute _*/);
+
+sword OCIDateTimeConstruct(/*_ dvoid  *hndl,OCIError *err,
+               OCIDateTime *datetime,
+               sb2 yr,ub1 mnth,ub1 dy,ub1 hr,ub1 mm,ub1 ss,ub4 fsec,
+               OraText  *timezone,size_t timezone_length _*/);
+
+sword OCIDateTimeSysTimeStamp(/*_ dvoid *hndl, OCIError *err, 
+                              OCIDateTime *sys_date _*/);
+
+sword OCIDateTimeAssign(/*_dvoid *hndl, OCIError *err, CONST OCIDateTime *from,
+			 OCIDateTime *to_*/);
+
+sword OCIDateTimeToText(/*_ dvoid *hndl, OCIError *err, 
+                  CONST OCIDateTime *date, CONST OraText *fmt, 
+                  ub1 fmt_length, ub1 fsprec, CONST OraText *lang_name, 
+                  size_t lang_length,
+                  ub4 *buf_size, OraText *buf _*/);
+
+sword OCIDateTimeFromText(/*_ dvoid *hndl, OCIError *err, CONST OraText *dstr,
+                     size_t d_str_length, CONST OraText *fmt, ub1 fmt_length, 
+                     CONST OraText *lang_name, size_t lang_length, 
+                     OCIDateTime *date _*/);
+
+sword OCIDateTimeCompare(/*_ dvoid *hndl, OCIError *err, 
+                     CONST OCIDateTime *date1, CONST OCIDateTime *date2, 
+                     sword *result _*/);
+
+sword OCIDateTimeCheck(/*_ dvoid *hndl, OCIError *err, CONST OCIDateTime *date,
+		 ub4 *valid _*/);
+
+sword OCIDateTimeConvert(/*_ dvoid *hndl, OCIError *err, OCIDateTime *indate, 
+                      OCIDateTime *outdate_*/);
+
+sword OCIDateTimeSubtract(/*_ dvoid *hndl, OCIError *err, OCIDateTime *indate1,
+        OCIDateTime *indate2,	 OCIInterval *inter_*/);
+
+sword OCIDateTimeIntervalAdd(/*_ dvoid *hndl, OCIError *err, 
+                        OCIDateTime *datetime, OCIInterval *inter, 
+                        OCIDateTime *outdatetime_*/);
+
+sword OCIDateTimeIntervalSub(/*_ dvoid *hndl, OCIError *err, 
+                        OCIDateTime *datetime, OCIInterval *inter, 
+                        OCIDateTime *outdatetime_*/);
+
+sword OCIIntervalSubtract(/*_ dvoid *hndl, OCIError *err, 
+       OCIInterval *minuend, OCIInterval *subtrahend, OCIInterval *result _*/);
+
+sword OCIIntervalAdd(/*_ dvoid *hndl, OCIError *err, OCIInterval *addend1, 
+			OCIInterval *addend2, OCIInterval *result _*/);
+
+sword OCIIntervalMultiply(/*_ dvoid *hndl, OCIError *err, 
+                        CONST OCIInterval *ifactor, OCINumber *nfactor, 
+                        OCIInterval *result _*/);
+
+sword OCIIntervalDivide(/*_ dvoid *hndl, OCIError *err, OCIInterval *dividend, 
+		OCINumber *divisor, OCIInterval *result _*/);
+
+sword OCIIntervalCompare(/*_ dvoid *hndl, OCIError *err, OCIInterval *inter1, 
+			OCIInterval *inter2, sword *result _*/);
+
+sword OCIIntervalFromNumber(/*_ dvoid *hndl, OCIError *err, 
+              OCIInterval *interval, OCINumber *number _*/);
+
+sword OCIIntervalFromText(/*_dvoid *hndl, OCIError *err, CONST OraText *inpstr,
+		size_t str_len, OCIInterval *result _*/);
+
+sword OCIIntervalToText(/*_  dvoid *hndl, OCIError *err,
+                     CONST OCIInterval *interval, ub1 lfprec, ub1 fsprec, 
+                     OraText *buffer, size_t buflen, size_t *resultlen _*/);
+
+sword OCIIntervalToNumber(/*_ dvoid *hndl, OCIError *err, 
+              CONST OCIInterval *interval, OCINumber *number _*/);
+
+sword OCIIntervalCheck(/*_dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+			 ub4 *valid _*/);
+
+sword OCIIntervalAssign(/*_ dvoid *hndl, OCIError *err, 
+                  CONST OCIInterval *inpinter, OCIInterval *outinter _*/);
+
+sword OCIIntervalSetYearMonth(/*_dvoid *hndl, OCIError *err, sb4 yr, sb4 mnth,
+                        OCIInterval *result _*/);
+
+sword OCIIntervalGetYearMonth(/*_dvoid *hndl, OCIError *err, sb4 *yr, sb4 *mnt,
+                        CONST OCIInterval *result _*/);
+
+sword OCIIntervalSetDaySecond(/*_dvoid *hndl, OCIError *err, sb4 dy, sb4 hr,
+                        sb4 mm, sb4 ss, sb4 fsec, OCIInterval *result _*/);
+
+sword OCIIntervalGetDaySecond(/*_dvoid *hndl, OCIError *err, sb4 *dy, sb4 *hr,
+                   sb4 *mm, sb4 *ss, sb4 *fsec, CONST OCIInterval *result _*/);
+
+sword OCIDateTimeToArray(/*_dvoid *hndl, OCIError *err,
+                         CONST OCIDateTime *datetime, CONST OCIInterval *reftz,
+                         ub1 *outarray, ub4 len, ub1 fsprec _*/);
+
+sword OCIDateTimeFromArray(/*_dvoid *hndl, OCIError *err, ub1 *inarray,
+                           ub4 len, ub1 type, OCIDateTime *datetime,
+                           CONST OCIInterval *reftz, ub1 fsprec _*/);
+
+sword OCIDateTimeGetTimeZoneName(/*_dvoid *hndl, OCIError *err,
+                                 CONST OCIDateTime *datetime, 
+                                 ub1 *buf, ub4 *buflen _*/);
+
+sword OCIIntervalFromTZ(/*_ dvoid *hndl, OCIError *err,
+                        CONST oratext *inpstring, size_t str_len,
+                        OCIInterval *result _*/);
+
+/*----------------- End Datetime interface Extensions -----------------------*/
+
+/*------------------------ OCIAnyDataSet interfaces -------------------------*/
+
+/*
+   NAME
+     OCIAnyDataSetBeginCreate - OCIAnyDataSet Begin Creation
+   PARAMETERS
+     svchp (IN/OUT) - The OCI service context.
+     errhp (IN/OUT) - The OCI error handle. If there is an error, it is
+                      recorded in errhp and this function returns OCI_ERROR.
+                      Diagnostic information can be obtained by calling
+                      OCIErrorGet().
+     typecode       - typecode corresponding to the OCIAnyDataSet.
+     type (IN)      - type corresponding to the OCIAnyDataSet. If the typecode
+                      corresponds to a built-in type (OCI_TYPECODE_NUMBER etc.)
+                      , this parameter can be NULL. It should be non NULL for
+                      user defined types (OCI_TYPECODE_OBJECT,
+                      OCI_TYPECODE_REF, collection types etc.)
+     dur (IN)       - duration for which OCIAnyDataSet is allocated.
+     data_set (OUT) - Initialized OCIAnyDataSet.
+     RETURNS        - error code
+   NOTES
+     This call allocates an OCIAnyDataSet for the duration of dur and
+     initializes it with the type information. The OCIAnyDataSet can hold
+     multiple instances of the given type. For performance reasons, the 
+     OCIAnyDataSet will end up pointing to the passed in OCIType parameter.
+     It is the responsibility of the caller to ensure that the OCIType is
+     longer lived (has allocation duration >= the duration of the OCIAnyData
+     if the OCIType is a transient one, allocation/pin duration >= duration of
+     the OCIAnyData if the OCIType is a persistent one).
+
+*/
+sword OCIAnyDataSetBeginCreate(/*_ OCISvcCtx *svchp, OCIError *errhp,
+     OCITypeCode typecode, CONST OCIType *type, OCIDuration dur,
+     OCIAnyDataSet ** data_set _*/);
+
+/*
+   NAME
+     OCIAnyDataSetDestroy  - OCIAnyDataSet Destroy
+   DESCRIPTION
+     This call frees the OCIAnyDataSet allocated using
+     OCIAnyDataSetBeginCreate().
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)    - The OCI service context.
+     errhp (IN/OUT)    - The OCI Error handle.
+     data_set (IN/OUT) - OCIAnyDataSet to be freed.
+*/
+sword OCIAnyDataSetDestroy(/*_ OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set _*/);
+
+/*
+   NAME
+     OCIAnyDataSetAddInstance - OCIAnyDataSet Add an instance
+   DESCRIPTION
+     This call adds a new skeleton instance to the OCIAnyDataSet and all the
+     attributes of the instance are set to NULL. It returns this skeleton
+     instance through the OCIAnyData parameter which can be constructed
+     subsequently by invoking the OCIAnyData API.
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)      - The OCI service context.
+     errhp (IN/OUT)      - The OCI Error handle.
+     data_set (IN/OUT)   - OCIAnyDataSet to which a new instance is added.
+     data (IN/OUT)       - OCIAnyData corresponding to the newly added
+                           instance. If (*data) is NULL, a new OCIAnyData will
+                           be allocated for same duration as the OCIAnyDataSet.
+                           If (*data) is not NULL, it will get reused. This
+                           OCIAnyData can be subseqently constructed using the
+                           OCIAnyDataConvert() call or it can be constructed
+                           piece-wise using the OCIAnyDataAttrSet and
+                           OCIAnyDataCollAddElem calls.
+   NOTES
+     No Destruction of the old value is done here. It is the responsibility of
+     the caller to destroy the old value pointed to by (*data) and set (*data)
+     to a null pointer before beginning to make a sequence of this call. No
+     deep copying (of OCIType information nor the data part.) is done in the
+     returned OCIAnyData. This OCIAnyData cannot be used beyond the allocation
+     duration of the OCIAnyDataSet (it is like a reference into the
+     OCIAnyDataSet). The returned OCIAnyData can be reused on subsequent calls
+     to this function, to sequentially add new data instances to the
+     OCIAnyDataSet.
+*/
+sword OCIAnyDataSetAddInstance(/*_ OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, OCIAnyData **data _*/);
+
+/*
+   NAME
+     OCIAnyDataSetEndCreate - OCIAnyDataSet End Creation process.
+   DESCRIPTION
+     This call marks the end of OCIAnyDataSet creation. It should be called
+     after constructing all of its instance(s).
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)        - The OCI service context.
+     errhp (IN/OUT)        - The OCI error handle. If there is an error, it is
+                             recorded in errhp and this function returns
+                             OCI_ERROR. Diagnostic information can be obtained
+                             by calling OCIErrorGet().
+     data_set (IN/OUT)     - OCIAnyDataSet that has been fully constructed.
+*/
+sword OCIAnyDataSetEndCreate(/*_ OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set _*/);
+
+/*
+   NAME
+     OCIAnyDataSetGetType - OCIAnyDataSet Get Type of an OCIAnyDataSet
+   DESCRIPTION
+     Gets the Type corresponding to an OCIAnyDataSet. It returns the actual
+     pointer to the type maintained inside an OCIAnyDataSet. No copying is
+     done for performance reasons. The client is responsible for not using
+     this type once the OCIAnyDataSet is freed (or its duration ends).
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)      - The OCI service context.
+     errhp (IN/OUT)      - The OCI Error handle.
+     data_set (IN)       - Initialized OCIAnyDataSet.
+     tc (OUT)            - The typecode of the type.
+     type (OUT)          - The type corresponding to the OCIAnyDataSet. This
+                           could be null if the OCIAnyData corresponds to a
+                           built-in type.
+*/
+sword OCIAnyDataSetGetType (/*_ OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, OCITypeCode *tc, OCIType **type _*/);
+
+/*
+  NAME
+    OCIAnyDataSetGetCount - OCIAnyDataSet Get Count of instances.
+  DESCRIPTION
+    This call gets the number of instances in the OCIAnyDataSet.
+  RETURNS
+    error code.
+  PARAMETERS
+    svchp (IN/OUT)      - OCI Service Context
+    errhp (IN/OUT)      - OCI Error handle
+    data_set (IN)       - Well formed OCIAnyDataSet.
+    count (OUT)         - number of instances in OCIAnyDataSet
+*/
+sword OCIAnyDataSetGetCount(/*_ OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, ub4 *count _*/);
+
+/*
+  NAME
+    OCIAnyDataSetGetInstance - OCIAnyDataSet Get next instance.
+  DESCRIPTION
+    Only sequential access to the instances in an OCIAnyDataSet is allowed.
+    This call returns the OCIAnyData corresponding to an instance at the
+    current position and updates the current position. Subsequently, the
+    OCIAnyData access routines may be used to access the instance.
+  RETURNS
+    error code. Returns OCI_NO_DATA if the current position is at the end of
+    the set, OCI_SUCCESS otherwise.
+  PARAMETERS
+    svchp (IN/OUT)      - OCI Service Context
+    errhp (IN/OUT)      - OCI Error handle
+    data_set (IN)       - Well formed OCIAnyDataSet
+    data (IN/OUT)       - OCIAnyData corresponding to the instance. If (*data)
+                          is NULL, a new OCIAnyData will be allocated for same
+                          duration as the OCIAnyDataSet. If (*data) is not NULL
+                          , it will get reused. This OCIAnyData can be
+                          subsequently accessed using the OCIAnyDataAccess()
+                          call or piece-wise by using the OCIAnyDataAttrGet()
+                          call.
+  NOTE
+    No Destruction of the old value is done here. It is the responsibility of
+    the caller to destroy the old value pointed to by (*data) and set (*data)
+    to a null pointer before beginning to make a sequence of this call. No deep
+    copying (of OCIType information nor the data part.) is done in the returned
+    OCIAnyData. This OCIAnyData cannot be used beyond the allocation duration
+    of the OCIAnyDataSet (it is like a reference into the OCIAnyDataSet). The
+    returned OCIAnyData can be reused on subsequent calls to this function to
+    sequentially access the OCIAnyDataSet.
+*/
+sword OCIAnyDataSetGetInstance(/*_ OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, OCIAnyData **data _*/);
+
+/*--------------------- End of OCIAnyDataSet interfaces ---------------------*/
+
+/*--------------------- Connection Pooling prototypes -----------------------*/
+sword OCIConnectionPoolCreate(/*_ OCIEnv *envhp, OCIError *errhp,
+                              OCICPool *poolhp,
+                              OraText **poolName, sb4 *poolNameLen,
+                              CONST OraText *dblink, sb4 dblinkLen,
+                              ub4 connMin, ub4 connMax, ub4 connIncr,
+                              CONST OraText *poolUserName, sb4 poolUserLen,
+                              CONST OraText *poolPassword, sb4 poolPassLen,
+                              ub4 mode _*/);
+
+sword OCIConnectionPoolDestroy(/*_ OCICPool *poolhp,
+                               OCIError *errhp, ub4 mode _*/);
+
+/*----------------- End of Connection Pooling prototypes --------------------*/
+
+/*-------------------- Session Pooling prototypes ---------------------------*/
+
+sword OCISessionPoolCreate (/*_ OCIEnv *envhp, OCIError *errhp, 
+                              OCISPool *spoolhp, 
+                              OraText **poolName, ub4 *poolNameLen, 
+                              CONST OraText *connStr, ub4 connStrLen,
+                              ub4 sessMin, ub4 sessMax, ub4 sessIncr,
+                              OraText *userid, ub4 useridLen,
+                              OraText *password, ub4 passwordLen,
+                              ub4 mode _*/);
+                                                  
+sword OCISessionPoolDestroy (/*_ OCISPool *spoolhp,
+                               OCIError *errhp,
+                               ub4 mode _*/);
+                             
+sword OCISessionGet (/*_ OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp,
+                       OCIAuthInfo *authhp,
+                       OraText *poolName, ub4 poolName_len, 
+                       CONST OraText *tagInfo, ub4 tagInfo_len,
+                       OraText **retTagInfo, ub4 *retTagInfo_len,
+                       boolean *found, ub4 mode _*/);
+
+sword OCISessionRelease (/*_ OCISvcCtx *svchp, OCIError *errhp,
+                         OraText *tag, ub4 tag_len,
+                         ub4 mode _*/);
+
+/*-------------------- End Session Pooling prototypes -----------------------*/
+
+sword  OCIXMLTypeNew(/*_ OCISvcCtx *svchp, OCIError *errhp, OCIDuration dur,
+                     OraText *elname, ub4 elname_Len,
+                     OraText *schemaURL, ub4 schemaURL_Len,
+                     OCIXMLType **retInstance _*/);
+
+sword  OCIXMLTypeCreateFromSrc(/*_ OCISvcCtx *svchp, OCIError *errhp,
+                     OCIDuration dur, ub1 src_type, dvoid *src_ptr,
+                     sb4 ind, OCIXMLType **retInstance _*/);
+
+sword OCIXMLTypeExtract(/*_ OCIError *errhp,
+              OCIXMLType *doc, OCIDuration dur,
+              OraText *xpathexpr, ub4 xpathexpr_Len,
+              OraText *nsmap, ub4 nsmap_Len,
+              OCIXMLType **retDoc _*/);
+
+sword OCIXMLTypeTransform(/*_ OCIError *errhp, OCIDuration dur,
+               OCIXMLType *doc, OCIXMLType *xsldoc,
+               OCIXMLType **retDoc _*/);
+
+sword OCIXMLTypeExists(/*_ OCIError *errhp, OCIXMLType *doc,
+                 OraText *xpathexpr, ub4 xpathexpr_Len,
+                 OraText *nsmap, ub4 nsmap_Len,
+                 boolean *retval _*/);
+
+sword OCIXMLTypeIsSchemaBased(/*_ OCIError *errhp,
+                              OCIXMLType *doc, boolean *retval _*/);
+
+sword OCIXMLTypeGetSchema(/*_ OCIError *errhp, OCIXMLType *doc,
+             OCIXMLType **schemadoc,
+             OraText **schemaURL, ub4 *schemaURL_Len,
+             OraText **rootelem, ub4 *rootelem_Len _*/);
+
+sword OCIXMLTypeValidate(/*_ OCIError *errhp, OCIXMLType *doc,
+                   OraText *schemaURL, ub4 schemaURL_Len, boolean *retval _*/);
+
+sword OCIXMLTypeGetDOM(/*_ OCIError *errhp, OCIXMLType *doc, OCIDuration dur,
+                       OCIDOMDocument **retDom _*/);
+
+sword OCIXMLTypeGetFromDOM(/*_ OCIError *errhp, OCIDOMDocument *domdoc,
+                           OCIXMLType **retXMLType _*/);
+
+sword OCIDOMFree(/*_ OCIError *errhp, OCIDOMDocument *domdoc _*/);
+
+/*--------------------------------------------------------------------------- 
+  PRIVATE FUNCTIONS 
+  ---------------------------------------------------------------------------*/
+
+/* these calls are deprecated and should not be used */
+#ifdef NEVER 
+#if !defined(__STDC__) && !defined(__cplusplus)
+sword   OCIStmtBindByPos (/*_ OCIStmt *stmtp, OCIBind *bindp, OCIError *errhp, 
+                     ub4 position, dvoid *valuep, sb4 value_sz, ub2 dty, 
+                     dvoid *indp, ub2 *alenp, ub2 *rcodep, 
+                     ub4 maxarr_len, ub4 *curelep, ub4 mode _*/);
+
+sword   OCIStmtBindByName(/*_ OCIStmt *stmtp, OCIBind *bindp, OCIError *errhp,
+                    CONST OraText *placeholder, sb4 placeh_len, dvoid *valuep,
+                    sb4 value_sz, ub2 dty, dvoid *indp, ub2 *alenp,
+                    ub2 *rcodep, ub4 maxarr_len, ub4 *curelep, ub4 mode _*/);
+
+sword   ocidefn(/*_ OCIStmt *stmtp, OCIDefine *defnp, OCIError *errhp,
+                    ub4 position, dvoid *valuep, sb4 value_sz, ub2 dty,
+                    dvoid *indp, ub2 *rlenp, ub2 *rcodep, ub4 mode _*/);
+
+#endif /* __STDC__ */
+#endif /* NEVER */
+
+#endif                                                              /* ocikp */
diff --git a/src/terralib/drivers/Oracle/OCI/include/ocikpr.h b/src/terralib/drivers/Oracle/OCI/include/ocikpr.h
new file mode 100644
index 0000000..bc24217
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ocikpr.h
@@ -0,0 +1,168 @@
+/*
+ * $Header$ 
+ */
+
+/* Copyright (c) 1991, 1995, 1996, 1998 by Oracle Corporation */
+/*
+   NAME
+     ocikpr.h - header of K & R compilers
+   MODIFIED   (MM/DD/YY)
+    porangas   12/04/00 - Forward merge bug#974710 to 9i
+    sgollapu   05/19/98 - Change text to OraText
+    dchatter   04/21/96 -
+    dchatter   11/10/95 -  add ognfd() - get native fd
+    lchidamb   04/06/95 -  drop maxdsz from obindps/odefinps
+    slari      04/07/95 -  add opinit
+    dchatter   03/08/95 -  osetpi and ogetpi
+    lchidamb   12/09/94 -  add obindps() and odefinps()
+    dchatter   03/06/95 -  merge changes from branch 1.1.720.2
+    dchatter   11/14/94 -  merge changes from branch 1.1.720.1
+    dchatter   02/08/95 -  olog call; drop onblon
+    dchatter   10/31/94 -  new functions for non-blocking oci
+    rkooi2     11/27/92 -  Changing datatypes (in comments) and return types 
+    rkooi2     10/26/92 -  More portability mods 
+    rkooi2     10/18/92 -  Changed to agree with oci.c 
+    sjain      03/16/92 -  Creation 
+*/
+
+/*
+ *  Declare the OCI functions.
+ *  Prototype information is commented out.
+ *  Use this header for non-ANSI C compilers.
+ *  Note that you will need to include ocidfn.h in the .c files
+ *    to get the definition for cda_def.
+ */
+
+#ifndef OCIKPR
+#define OCIKPR
+
+#include <oratypes.h>
+
+/*
+ * Oci BIND (Piecewise or with Skips) 
+ */
+sword  obindps( /*_ struct cda_def *cursor, ub1 opcode, OraText *sqlvar, 
+		  sb4 sqlvl, ub1 *pvctx, sb4 progvl, 
+		  sword ftype, sword scale,
+		  sb2 *indp, ub2 *alen, ub2 *arcode, 
+		  sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip,
+		  ub4 maxsiz, ub4 *cursiz, 
+		  OraText *fmt, sb4 fmtl, sword fmtt _*/ );
+sword  obreak( /*_ struct cda_def *lda _*/ );
+sword  ocan  ( /*_ struct cda_def *cursor _*/ );
+sword  oclose( /*_ struct cda_def *cursor _*/ );
+sword  ocof  ( /*_ struct cda_def *lda _*/ );
+sword  ocom  ( /*_ struct cda_def *lda _*/ );
+sword  ocon  ( /*_ struct cda_def *lda _*/ );
+
+
+/*
+ * Oci DEFINe (Piecewise or with Skips) 
+ */
+sword  odefinps( /*_ struct cda_def *cursor, ub1 opcode, sword pos,ub1 *bufctx,
+		   sb4 bufl, sword ftype, sword scale, 
+		   sb2 *indp, OraText *fmt, sb4 fmtl, sword fmtt, 
+		   ub2 *rlen, ub2 *rcode,
+		   sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip _*/ );
+sword  odescr( /*_ struct cda_def *cursor, sword pos, sb4 *dbsize,
+                   sb2 *dbtype, sb1 *cbuf, sb4 *cbufl, sb4 *dsize,
+                   sb2 *prec, sb2 *scale, sb2 *nullok _*/ );
+sword  odessp( /*_ struct cda_def *cursor, OraText *objnam, size_t onlen,
+                   ub1 *rsv1, size_t rsv1ln, ub1 *rsv2, size_t rsv2ln,
+                   ub2 *ovrld, ub2 *pos, ub2 *level, OraText **argnam,
+                   ub2 *arnlen, ub2 *dtype, ub1 *defsup, ub1* mode,
+                   ub4 *dtsiz, sb2 *prec, sb2 *scale, ub1 *radix,
+                   ub4 *spare, ub4 *arrsiz _*/ );
+sword  oerhms( /*_ struct cda_def *lda, sb2 rcode, OraText *buf,
+                   sword bufsiz _*/ );
+sword  oermsg( /*_ sb2 rcode, OraText *buf _*/ );
+sword  oexec ( /*_ struct cda_def *cursor _*/ );
+sword  oexfet( /*_ struct cda_def *cursor, ub4 nrows,
+                   sword cancel, sword exact _*/ );
+sword  oexn  ( /*_ struct cda_def *cursor, sword iters, sword rowoff _*/ );
+sword  ofen  ( /*_ struct cda_def *cursor, sword nrows _*/ );
+sword  ofetch( /*_ struct cda_def *cursor _*/ );
+sword  oflng ( /*_ struct cda_def *cursor, sword pos, ub1 *buf,
+                   sb4 bufl, sword dtype, ub4 *retl, sb4 offset _*/ );
+sword  ogetpi( /*_ struct cda_def *cursor, ub1 *piecep, dvoid **ctxpp, 
+                   ub4 *iterp, ub4 *indexp _*/ );
+sword  opinit( /*_ ub4 mode _*/ );
+sword  olog  ( /*_ struct cda_def *lda, ub1 *hst, 
+                   OraText *uid, sword uidl,
+                   OraText *psw, sword pswl, 
+                   OraText *conn, sword connl, 
+                   ub4 mode _*/ );
+sword  ologof( /*_ struct cda_def *lda _*/ );
+sword  oopen ( /*_ struct cda_def *cursor, struct cda_def *lda,
+                   OraText *dbn, sword dbnl, sword arsize,
+                   OraText *uid, sword uidl _*/ );
+sword  oopt  ( /*_ struct cda_def *cursor, sword rbopt, sword waitopt _*/ );
+sword  oparse( /*_ struct cda_def *cursor, OraText *sqlstm, sb4 sqllen,
+                   sword defflg, ub4 lngflg _*/ );
+sword  orol  ( /*_ struct cda_def *lda _*/ );
+sword  osetpi( /*_ struct cda_def *cursor, ub1 piece, dvoid *bufp, 
+                   ub4 *lenp _*/ );
+void sqlld2  ( /*_ struct cda_def *lda, OraText *cname, sb4 *cnlen _*/ );
+void sqllda  ( /*_ struct cda_def *lda _*/ );
+
+/* non-blocking functions */
+sword onbset( /*_ struct cda_def *lda _*/ ); 
+sword onbtst( /*_ struct cda_def *lda _*/ ); 
+sword onbclr( /*_ struct cda_def *lda _*/ ); 
+sword ognfd ( /*_ struct cda_def *lda, dvoid *fdp _*/ );
+
+
+
+/* 
+ * OBSOLETE FUNCTIONS 
+ */
+
+/* 
+ * OBSOLETE BIND CALLS-- use obindps() 
+ */
+sword  obndra( /*_ struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
+                 ub1 *progv, sword progvl, sword ftype, sword scale,
+                 sb2 *indp, ub2 *alen, ub2 *arcode, ub4 maxsiz,
+                 ub4 *cursiz, OraText *fmt, sword fmtl, sword fmtt _*/ );
+sword  obndrn( /*_ struct cda_def *cursor, sword sqlvn, ub1 *progv,
+                 sword progvl, sword ftype, sword scale, sb2 *indp,
+                 OraText *fmt, sword fmtl, sword fmtt _*/ );
+sword  obndrv( /*_ struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
+                 ub1 *progv, sword progvl, sword ftype, sword scale,
+                 sb2 *indp, OraText *fmt, sword fmtl, sword fmtt _*/ );
+
+/* 
+ * OBSOLETE DEFINE CALLS-- use odefinps() 
+ */
+sword  odefin( /*_ struct cda_def *cursor, sword pos, ub1 *buf,
+                 sword bufl, sword ftype, sword scale, sb2 *indp,
+                 OraText *fmt, sword fmtl, sword fmtt, ub2 *rlen, 
+                 ub2 *rcode _*/ );
+
+
+/* older calls ; preferred equivalent calls above */
+sword  odsc  ( /*_ struct cda_def *cursor, sword pos, sb2 *dbsize,
+                   sb2 *fsize, sb2 *rcode, sb2 *dtype, sb1 *buf,
+                   sb2 *bufl, sb2 *dsize _*/ );
+sword  oname ( /*_ struct cda_def *cursor, sword pos, sb1 *tbuf,
+                   sb2 *tbufl, sb1 *buf, sb2 *bufl _*/ );
+sword  olon  ( /*_ struct cda_def *lda, OraText *uid, sword uidl,
+                   OraText *pswd, sword pswdl, sword audit _*/ );
+sword  orlon ( /*_ struct cda_def *lda, ub1 *hda, OraText *uid,
+                   sword uidl, OraText *pswd, sword pswdl, sword audit _*/ );
+sword  osql3 ( /*_ struct cda_def *cda, OraText *sqlstm, sword sqllen _*/ );
+
+
+
+
+
+
+
+#endif  /* OCIKPR */
+
+
+
+
+
+
+
diff --git a/src/terralib/drivers/Oracle/OCI/include/ocixad.h b/src/terralib/drivers/Oracle/OCI/include/ocixad.h
new file mode 100644
index 0000000..3b72fd9
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ocixad.h
@@ -0,0 +1,316 @@
+/* Copyright (c) 1999, 2001, Oracle Corporation.  All rights reserved.  */
+ 
+/* 
+   NAME 
+     ocixad.h - OCI eXtensible Access Driver (for external tables)
+
+   DESCRIPTION 
+     Provides handles for XAD support.
+
+   RELATED DOCUMENTS 
+     External Tables Design specification (external_tab_ds.doc)
+ 
+   EXPORT FUNCTION(S) 
+
+   INTERNAL FUNCTION(S)
+
+   EXAMPLES
+
+   NOTES
+     Currently these interfaces are for Oracle internal use only.
+
+   MODIFIED   (MM/DD/YY)
+   cmlim       08/10/01 - date cache: add XADSESSION attrs: DCACHE_SIZE 
+   abrumm      04/18/01 - define interface method signatures in OCIXAD
+   abrumm      02/20/01 - add attributes for ACCESS_PARM_TYPE
+   abrumm      01/18/01 - more OCI_ATTR_XADSESSION attributes
+   abrumm      10/09/00 - use oratypes.h, not s.h
+   abrumm      03/30/00 - external table support
+   abrumm      03/30/00 - Creation
+
+*/
+
+#ifndef OCIXAD_ORACLE
+#define OCIXAD_ORACLE
+
+#ifndef ORATYPES
+#include <oratypes.h>
+#endif
+
+#ifndef OCIDFN
+#include <ocidfn.h>
+#endif
+
+#ifndef OCI_ORACLE
+#include <oci.h>
+#endif
+
+#ifndef OCIEXTP_ORACLE
+#include <ociextp.h>
+#endif
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+/*----- Handles and descriptors for access driver operations (OCIXAD*)  -----*/
+typedef struct OCIXADSession      OCIXADSession;           /* session handle */
+typedef struct OCIXADTable        OCIXADTable;               /* table handle */
+typedef struct OCIXADField        OCIXADField;               /* field handle */
+typedef struct OCIXADGranule      OCIXADGranule;           /* granule handle */
+
+/*---------------- Access Driver method interface signatures ----------------*/
+
+/* Each of the following access driver methods are logically member functions
+ * of the OCIXADSession handle.  As such, the first argument to the method is
+ * the OCIXADSession handle (i.e. "this").
+ *
+ * An access driver writer must provide these entry points at configure
+ * time via the OCIXADMethodEntry structure.
+ */
+
+typedef sword (*OCIXADMethodOpen)(OCIXADSession *xadses,
+                                  OCIExtProcContext *withCtx,
+                                  OCIXADTable *xadtbl,
+                                  OCILobLocator *accessParm);
+
+typedef sword (*OCIXADMethodFetchInit)(OCIXADSession *xadses,
+                                       OCIExtProcContext *withCtx,
+                                       OCIXADTable *xadtbl,
+                                       OCINumber *gnum, ub4 maxRowCnt);
+
+typedef sword (*OCIXADMethodFetch)(OCIXADSession *xadses,
+                                   OCIExtProcContext *withCtx,
+                                   OCIXADTable *xadtbl, void *opaqueCtx,
+                                   ub4 rowCnt, sb4 rejctLmt,
+                                   sb4 *rejctCntp);
+
+typedef void (*OCIXADMethodPopulateInit)(OCIXADSession *xadses,
+                                         OCIExtProcContext *withCtx);
+
+typedef void (*OCIXADMethodPopulate)(OCIXADSession *xadses,
+                                     OCIExtProcContext *withCtx);
+
+typedef void (*OCIXADMethodPopulateTerm)(OCIXADSession *xadses,
+                                         OCIExtProcContext *withCtx);
+
+typedef sword  (*OCIXADMethodClose)(OCIXADSession *xadses,
+                                    OCIExtProcContext *withCtx,
+                                    OCIXADTable *xadtbl);
+
+typedef void (*OCIXADMethodErrorCallback)(OCIXADSession *xadses,
+                                          OCIExtProcContext *withCtx,
+                                          void *opaqueCtx, OCIError *errhp,
+                                          ub4 rowidx, ub2 colIdx);
+
+/* Access Driver Method Entry points provided at "configure" time. */
+struct OCIXADMethodEntry
+{
+  ub4                       Version_OCIXADMethodEntry;
+#define OCIXAD_METHOD_ENTRY_VERSION_1   100
+#define OCIXAD_METHOD_ENTRY_VERSION_CUR OCIXAD_METHOD_ENTRY_VERSION_1
+
+  OCIXADMethodOpen          Open_OCIXADMethodEntry;
+  OCIXADMethodFetchInit     FetchInit_OCIXADMethodEntry;
+  OCIXADMethodFetch         Fetch_OCIXADMethodEntry;
+  OCIXADMethodPopulateInit  PopulateInit_OCIXADMethodEntry;
+  OCIXADMethodPopulate      Populate_OCIXADMethodEntry;
+  OCIXADMethodPopulateTerm  PopulateTerm_OCIXADMethodEntry;
+  OCIXADMethodClose         Close_OCIXADMethodEntry;
+  OCIXADMethodErrorCallback ErrorCallback_OCIXADMethodEntry;
+};
+typedef struct OCIXADMethodEntry OCIXADMethodEntry;
+
+/* Each access driver type (e.g. "ORACLE_LOADER") must provide a
+ * configure function (currently via the kpxdconf[] array).
+ * The configure function must set the
+ * OCI_ATTR_XADSESSION_METHOD_ENTRY_POINTS attribute of the passed in
+ * 'hndl' argument.  The OCI_ATTR_XADSESSION_METHOD_ENTRY_POINTS attribute
+ * is a pointer to an OCIXADMethodEntry structure.
+ */
+typedef sword (*OCIXADConfig)(OraText *driverType,       /* driver type name */
+                              void     *hndl,        /* OCIXADSession handle */
+                              ub4       hndlType,             /* handle type */
+                              OCIError *errhp);          /* OCI error handle */
+
+/* Granule handle client callback prototypes for external tables.
+ * The granulesPerSrc vector is allocated with numsrc_kpxg entries.
+ * The access drivers granule info method (if present) should populate
+ * each entry of the granulesPerSrc vector with the number of granules
+ * for the corresponding source number.
+ */
+typedef void (*OCIXADMethodGranuleInfo)(OCIXADGranule *xadgran,
+                                        OCIExtProcContext *withCtx,
+                                        ub4 *granulesPerSrc);
+
+/*------------------------------ OCIXADSession ------------------------------*/
+               /*----- Defines for OCIXADSession Attributes -----*/
+#define OCI_ATTR_XADSESSION_TABLE                 1
+#define OCI_ATTR_XADSESSION_LOCATIONS             2
+#define OCI_ATTR_XADSESSION_NAMES                 2 /* synonym for locations */
+#define OCI_ATTR_XADSESSION_DIRECTORIES           3
+#define OCI_ATTR_XADSESSION_GRANULE               4
+#define OCI_ATTR_XADSESSION_OPCODE                5
+#define OCI_ATTR_XADSESSION_CALLERID              6
+#define OCI_ATTR_XADSESSION_GRANULESIZE           7
+#define OCI_ATTR_XADSESSION_DATAMODE              8
+#define OCI_ATTR_XADSESSION_AGENT_NUMBER          9
+#define OCI_ATTR_XADSESSION_OPAQUECTX            10
+
+      /*----- OCIXADSession virtual methods (methods as attributes) -----*/
+#define OCI_ATTR_XADSESSION_METHOD_ENTRY_POINTS  11
+                                                        /* type for GET, SET */
+                              /* (OCIXADMethodEntry **, OCIXADMethodEntry *) */
+
+      /* more OCIXADSession Attributes (numbering starts after entry points) */
+                                                        /* type for GET, SET */
+#define OCI_ATTR_XADSESSION_DEFAULT_DIRECTORY    12     /* (text **, text *) */
+#define OCI_ATTR_XADSESSION_DRIVER_TYPE          13     /* (text **, text *) */
+#define OCI_ATTR_XADSESSION_SAMPLE_TYPE          14     /* (ub4 *,   ub4 *)  */
+#define OCI_ATTR_XADSESSION_SAMPLE_PERCENT       15     /* (ub4 *,   ub4 *)  */
+#define OCI_ATTR_XADSESSION_ACCESS_PARM_TYPE     16     /* (ub1 *,   ub1 *)  */
+#define OCI_ATTR_XADSESSION_DCACHE_SIZE          17     /* (ub4 *,   ub4 *)  */
+#define OCI_ATTR_XADSESSION_DCACHE_NUM           18     /* (ub4 *),  n/a  )  */
+#define OCI_ATTR_XADSESSION_DCACHE_DISABLE       19     /* (ub1 *),  n/a  )  */
+#define OCI_ATTR_XADSESSION_DCACHE_HITS          20     /* (ub4 *),  n/a  )  */
+#define OCI_ATTR_XADSESSION_DCACHE_MISSES        21     /* (ub4 *),  n/a  )  */
+
+
+             /*----- Values for OCI_ATTR_XADSESSION_OPCODE -----*/
+#define OCI_XADSESSION_OPCODE_FETCH               1
+#define OCI_XADSESSION_OPCODE_POPULATE            2
+
+            /*----- Values for OCI_ATTR_XADSESSION_CALLERID -----*/
+#define OCI_XADSESSION_CALLERID_QC                1     /* query coordinator */
+#define OCI_XADSESSION_CALLERID_SHADOW            2
+#define OCI_XADSESSION_CALLERID_SLAVE             3
+
+            /*----- Values for OCI_ATTR_XADSESSION_DATAMODE -----*/
+#define OCI_XADSESSION_DATAMODE_STREAM            1
+#define OCI_XADSESSION_DATAMODE_FIELD             2
+
+            /*----- Values for OCI_ATTR_XADSESSION_SAMPLE_TYPE -----*/
+#define OCI_XADSESSION_SAMPLE_NONE                0          /* not sampling */
+#define OCI_XADSESSION_SAMPLE_ROW                 1    /* row level sampling */
+#define OCI_XADSESSION_SAMPLE_BLOCK               2  /* block level sampling */
+
+           /*----- Values for OCI_ATTR_XADSESSION_ACCESS_PARM_TYPE -----*/
+#define OCI_XADSESSION_ACCESS_PARM_TYPE_CLOB      1    /* accessParm is CLOB */
+#define OCI_XADSESSION_ACCESS_PARM_TYPE_BLOB      2    /* accessParm is BLOB */
+
+/*------------------------------- OCIXADTable -------------------------------*/
+                /*----- Defines for OCIXADTable Attributes -----*/
+#define OCI_ATTR_XADTABLE_SESSION                 1
+#define OCI_ATTR_XADTABLE_NAME                    2
+#define OCI_ATTR_XADTABLE_COLUMNS                 3
+#define OCI_ATTR_XADTABLE_REF_COLUMNS             4
+#define OCI_ATTR_XADTABLE_FIELDS                  5
+#define OCI_ATTR_XADTABLE_NUM_FIELDS              6
+#define OCI_ATTR_XADTABLE_OPAQUECTX               7
+#define OCI_ATTR_XADTABLE_NUM_COLS                8
+#define OCI_ATTR_XADTABLE_NUM_REF_COLS            9
+#define OCI_ATTR_XADTABLE_SCHEMA                 10
+
+/*------------------------------- OCIXADField -------------------------------*/
+                /*----- Defines for OCIXADField Attributes -----*/
+#define OCI_ATTR_XADFIELD_COLUMN_NUM              1
+#define OCI_ATTR_XADFIELD_DATA_TYPE               2
+#define OCI_ATTR_XADFIELD_PRECISION               3
+#define OCI_ATTR_XADFIELD_SCALE                   4
+#define OCI_ATTR_XADFIELD_CHARSET_ID              5
+#define OCI_ATTR_XADFIELD_FORMAT_MASK             6
+#define OCI_ATTR_XADFIELD_ADDR                    7
+#define OCI_ATTR_XADFIELD_LENGTH                  8
+#define OCI_ATTR_XADFIELD_ISNULL                  9
+#define OCI_ATTR_XADFIELD_ISPARTIAL              10
+#define OCI_ATTR_XADFIELD_OPAQUECTX              11
+
+/*------------------------------ OCIXADGranule ------------------------------*/
+               /*----- Defines for OCIXADGranule Attributes -----*/
+#define OCI_ATTR_XADGRANULE_NUM_GRANULES          1
+#define OCI_ATTR_XADGRANULE_NUM_SRC               2
+#define OCI_ATTR_XADGRANULE_INTRA_SRC_CONCURRENCY 3
+#define OCI_ATTR_XADGRANULE_OPAQUECTX             4
+
+      /*----- OCIXADGranule virtual methods (methods as attributes) -----*/
+#define OCI_ATTR_XADGRANULE_INFO_METHOD           5
+
+
+/*---------------------------------------------------------------------------
+                     PRIVATE TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+/* NONE */
+
+/*---------------------------------------------------------------------------
+                           EXPORT FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+/*-------------------------- OCIXADSession Methods --------------------------*/
+/* NONE */
+
+/*--------------------------- OCIXADTable Methods ---------------------------*/
+/*
+  NAME
+    OCIXADTableSetRowValues
+
+  DESCRIPTION
+    To set the individual column values for a row by iterating through the
+    OCIXADField handle vector which is attached to the passed in OCIXADTable
+    handle.  The OCIXADTableSetRowValues method is called once for complete
+    rows, multiple times for pieced rows.
+    The column array row index is returned as an OUT parameter (*rowIdxp).
+    
+  RETURNS
+    OCI_SUCCESS:  all column array entries set.
+    OCI_CONTINUE: a partial Field was encountered.
+    OCI_ERROR:    a partial field encountered for a column which
+                  does not allow partial fields (partials are only allowed
+                  for LOB and LONG columns).
+  NOTES
+ */
+sword
+#if defined(__STDC__) || defined(__cplusplus)
+OCIXADTableSetRowValues(OCIXADTable *tblhp, ub4 *rowIdxp,OCIError *errhp);
+#else
+OCIXADTableSetRowValues(/*_ OCIXADTable *tblhp, ub4 *rowIdxp ,
+                            OCIError *errhp _*/);
+#endif
+
+
+/*--------------------------- OCIXADField Methods ---------------------------*/
+/*
+  NAME
+    OCIXADFieldSet
+
+  DESCRIPTION
+    Sets run-time (data dependent) attributes of the OCIXADField handle.
+    
+  RETURNS
+    OCI_SUCCESS:  Field attributes successfully set.
+    OCI_ERROR:    Invalid combination of flags,
+                  or NULL addr value for a non-NULL field,
+                  or length of zero for a non-NULL field,
+  NOTES
+    Basically for convenience and efficiency, so the application does
+    not have to do four OCIAttrSet calls to set these attributes.
+ */
+sword
+#if defined(__STDC__) || defined(__cplusplus)
+OCIXADFieldSet(OCIXADField *fldhp, ub1 *addr, ub4 length, ub1 isnull,
+               ub1 ispartial);
+#else
+OCIXADFieldSet(/*_ OCIXADField *fldhp, ub1 *addr, ub4 length, ub1 isnull,
+                   ub1 ispartial _*/);
+#endif
+
+/*-------------------------- OCIXADGranule Methods --------------------------*/
+/* NONE */
+
+
+/*---------------------------------------------------------------------------
+                          INTERNAL FUNCTIONS
+  ---------------------------------------------------------------------------*/
+/* NONE */
+
+
+#endif                                                      /* OCIXAD_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/ocixmldb.h b/src/terralib/drivers/Oracle/OCI/include/ocixmldb.h
new file mode 100644
index 0000000..1ddc318
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ocixmldb.h
@@ -0,0 +1,139 @@
+/* Copyright (c) 2003, Oracle Corporation.  All rights reserved.  */
+ 
+/* 
+   NAME 
+     ocixmldb.h - XDB public functions
+
+   DESCRIPTION 
+     This file contains XDB specific public functions required for DOM C-API. 
+
+   RELATED DOCUMENTS 
+
+ 
+   EXPORT FUNCTION(S) 
+   struct xmlctx *OCIXmlDbInitXmlCtx(OCIEnv *, OCISvcCtx *, OCIError *,
+                               ocixmldbparam *params, int num_params);
+
+   void    OCIXmlDbFreeXmlCtx(struct xmlctx *xctx);
+
+
+  ------------------------------------------------------------------------
+   EXAMPLES
+   
+   NOTES
+
+   MODIFIED   (MM/DD/YY)
+   ataracha    05/28/03 - change names
+   ataracha    02/18/03 - add oratypes, remove XMLERR_*
+   imacky      02/01/03 - remove xml.h; xdbs fix
+   ataracha    01/24/03 - use "struct xmlctx" instead of xmlctx
+   imacky      01/28/03 - fix XMLERR defs
+   ataracha    01/21/03 - ataracha_uni_capi_cleanup
+   ataracha    01/09/03 - Creation
+
+*/
+
+#ifndef ORATYPES 
+#include <oratypes.h> 
+#endif
+ 
+#ifndef OCI_ORACLE
+# include <oci.h>
+#endif
+
+#ifndef OCIXMLDB_ORACLE
+# define OCIXMLDB_ORACLE
+
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+#ifndef XMLCTX_DEFINED
+# define XMLCTX_DEFINED
+/* DATATYPE xmlctx - XML top-level context
+*/
+struct xmlctx; typedef struct xmlctx xmlctx;
+#endif
+
+typedef enum 
+{
+  XCTXINIT_OCIDUR  = 1,
+  XCTXINIT_ERRHDL  = 2
+} ocixmldbpname;
+
+typedef struct ocixmldbparam
+{
+  ocixmldbpname   name_ocixmldbparam;
+  void           *value_ocixmldbparam;
+} ocixmldbparam;
+
+#define NUM_OCIXMLDBPARAMS 2
+
+/*---------------------------------------------------------------------------
+                     PRIVATE TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                           EXPORT FUNCTIONS
+  ---------------------------------------------------------------------------*/
+/*****************************************************************************
+                              DESCRIPTION
+
+-----------------------------OCIXmlDbInitXmlCtx---------------------------------
+Name
+OCIXmlDbInitXmlCtx
+Purpose
+To get a xmlctx structure initialized with error-handler and XDB callbacks. 
+Syntax
+struct xmlctx *OCIXmlDbInitXmlCtx (OCIEnv           *envhp,
+                                 OCISvcCtx        *svchp, 
+                                 OCIError         *err, 
+                                 params_ocixmldb *params,
+                                 int               num_params);
+Parameters
+envhp (IN) - The OCI environment handle
+svchp (IN) - The OCI service handle
+errhp (IN) - The OCI error handle
+params (IN)- This contains the following optional parameters :
+   (a) OCIDuration dur (IN - The OCI Duration (Default: OCI_DURATION_SESSION)
+   (b) void (*err_handler) (sword, (const oratext *) (IN) - 
+       Pointer to the error handling function (Default: null)
+num_params (IN) - Number of parameters to be read from parameter params.
+                  If the value of num_params exceeds the size of array 
+                  "params", unexpected behavior will result.
+
+Returns
+A pointer to xmlctx structure, with xdb context, error handler and callbacks 
+populated with appropriate values. This is later used for all API calls. NULL
+if no database connection available.
+
+-----------------------------OCIXmlDbFreeXmlCtx----------------------------
+Name
+OCIXmlDbFreeXmlCtx
+Pupose
+To free any allocations done during OCIXmlDbInitXmlCtx.
+Syntax
+void OCIXmlDbFreeXmlCtx (struct xmlctx *xctx)
+Parameters
+xctx (IN) - The xmlctx to terminate
+Returns
+-
+******************************************************************************/
+
+struct xmlctx *OCIXmlDb_CtxInit(OCIEnv *, OCISvcCtx *, OCIError *, 
+                            ocixmldbparam *, int);
+
+void    OCIXmlDb_CtxFree(struct xmlctx *xctx);
+
+struct xmlctx *OCIXmlDbInitXmlCtx(OCIEnv *, OCISvcCtx *, OCIError *, 
+                            ocixmldbparam *, int);
+
+void    OCIXmlDbFreeXmlCtx(struct xmlctx *xctx);
+/*---------------------------------------------------------------------------
+                          INTERNAL FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+#endif                                              /* OCIXMLDB_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/odci.h b/src/terralib/drivers/Oracle/OCI/include/odci.h
new file mode 100644
index 0000000..7a1bb22
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/odci.h
@@ -0,0 +1,657 @@
+/*
+ * $Header$
+ */
+
+/* Copyright (c) 1998, 2003, Oracle Corporation.  All rights reserved.  */
+ 
+/* 
+   NAME 
+     odci.h - Oracle Data Cartridge Interface definitions
+
+   DESCRIPTION 
+     This file contains Oracle Data Cartridge Interface definitions. These
+     include the ODCI Types and Constants.
+
+   RELATED DOCUMENTS 
+ 
+   INSPECTION STATUS 
+     Inspection date: 
+     Inspection status: 
+     Estimated increasing cost defects per page: 
+     Rule sets: 
+ 
+   ACCEPTANCE REVIEW STATUS 
+     Review date: 
+     Review status: 
+     Reviewers: 
+ 
+   PUBLIC FUNCTION(S) 
+     None.
+
+   PRIVATE FUNCTION(S)
+     None.
+
+   EXAMPLES
+
+   NOTES
+     - The constants defined here are replica of the constants defined 
+       in ODCIConst Package defined as part of catodci.sql. If you change
+       these do make the similar change in catodci.sql.
+
+   MODIFIED   (MM/DD/YY)
+   ayoaz       04/21/03 - add CursorNum to ODCIEnv
+   abrumm      12/30/02 - Bug #2223225: add define for
+                          ODCI_ARG_DESC_LIST_MAXSIZE
+   ayoaz       10/14/02 - Add Cardinality to ODCIArgDesc
+   ayoaz       09/11/02 - add ODCIQueryInfo to ODCIIndexCtx
+   yhu         09/19/02 - add ODCI_DEBUGGING_ON for ODCIEnv.EnvFlags
+   hsbedi      10/10/02 - add object number into ODCIExtTableInfo
+   ayoaz       08/30/02 - add ODCITable2 types
+   tchorma     07/29/02 - Add ODCIFuncCallInfo type for WITH COLUMN CONTEXT
+   hsbedi      06/29/02 - External table populate
+   yhu         07/20/01 - add parallel degree in ODCIIndexInfo.
+   abrumm      02/20/01 - ODCIExtTableInfo: add AccessParmBlob attribute
+   abrumm      01/18/01 - ODCIExtTableInfo: add default directory
+   spsundar    08/24/00 - Update attrbiute positions
+   abrumm      08/04/00 - external tables changes: ODCIExtTableInfo, constants
+   tchorma     09/11/00 - Add return code ODCI_FATAL
+   tchorma     08/08/00 - Add Update Block References Option for Alter Index
+   ayoaz       08/01/00 - Add ODCI_AGGREGATE_REUSE_CTX
+   spsundar    06/19/00 - add ODCIEnv type
+   abrumm      06/27/00 - add defines for ODCIExtTable flags
+   abrumm      06/04/00 - external tables: ODCIExtTableInfo change; add ODCIEnv
+   ddas        04/28/00 - extensible optimizer enhancements for 8.2
+   yhu         06/05/00 - add a bit in IndexInfoFlags for trans. tblspc
+   yhu         04/10/00 - add ODCIPartInfo & remove ODCIIndexPartList
+   abrumm      03/29/00 - external table support
+   spsundar    02/14/00 - update odci definitions for 8.2
+   nagarwal    03/07/99 - bug# 838308 - set estimate_stats=1
+   rmurthy     11/09/98 - add blocking flag
+   ddas        10/31/98 - add ODCI_QUERY_SORT_ASC and ODCI_QUERY_SORT_DESC
+   ddas        05/26/98 - fix ODCIPredInfo flag bits
+   rmurthy     06/03/98 - add macro for RegularCall
+   spsundar    05/08/98 - add constants related to ODCIIndexAlter options
+   rmurthy     04/30/98 - remove include s.h
+   rmurthy     04/20/98 - name fixes
+   rmurthy     04/13/98 - add C mappings for odci types
+   alsrivas    04/10/98 - adding defines for ODCI_INDEX1
+   jsriniva    04/04/98 - Creation
+
+*/
+
+#ifndef OCI_ORACLE
+# include <oci.h>
+#endif
+#ifndef ODCI_ORACLE
+# define ODCI_ORACLE
+
+/*---------------------------------------------------------------------------*/
+/*                         SHORT NAMES SUPPORT SECTION                       */
+/*---------------------------------------------------------------------------*/
+
+#ifdef SLSHORTNAME
+
+/* The following are short names that are only supported on IBM mainframes
+ *   with the SLSHORTNAME defined.
+ * With this all subsequent long names will actually be substituted with
+ *  the short names here
+ */
+
+#define ODCIColInfo_ref             odcicir
+#define ODCIColInfoList             odcicil
+#define ODCIColInfoList2            odcicil2
+#define ODCIIndexInfo_ref           odciiir
+#define ODCIPredInfo_ref            odcipir
+#define ODCIRidList                 odcirl
+#define ODCIIndexCtx_ref            odciicr
+#define ODCIObject_ref              odcior
+#define ODCIObjectList              odciol
+#define ODCIQueryInfo_ref           odciqir
+#define ODCIFuncInfo_ref            odcifir
+#define ODCICost_ref                odcicr
+#define ODCIArgDesc_ref             odciadr
+#define ODCIArgDescList             odciadl
+#define ODCIStatsOptions_ref        odcisor
+#define ODCIColInfo                 odcici
+#define ODCIColInfo_ind             odcicii
+#define ODCIIndexInfo               odciii
+#define ODCIIndexInfo_ind           odciiii
+#define ODCIPredInfo                odcipi
+#define ODCIPredInfo_ind            odcipii
+#define ODCIIndexCtx                odciic
+#define ODCIIndexCtx_ind            odciici
+#define ODCIObject                  odcio
+#define ODCIObject_ind              odcioi
+#define ODCIQueryInfo               odciqi
+#define ODCIQueryInfo_ind           odciqii
+#define ODCIFuncInfo                odcifi
+#define ODCIFuncInfo_infd           odcifii
+#define ODCICost                    odcic
+#define ODCICost_ind                odcici
+#define ODCIArgDesc                 odciad
+#define ODCIArgDesc_ind             odciadi
+#define ODCIStatsOptions            odciso
+#define ODCIStatsOptions_ind        odcisoi
+#define ODCIPartInfo                odcipti
+#define ODCIPartInfo_ind            odciptii
+#define ODCIPartInfo_ref            odciptir
+#define ODCIExtTableInfo            odcixt
+#define ODCIExtTableInfo_ind        odcixti
+#define ODCIExtTableInfo_ref        odcixtr
+#define ODCIExtTableQCInfo          odcixq
+#define ODCIExtTableQCInfo_ind      odcixqi
+#define ODCIExtTableQCInfo_ref      odcixqr
+#define ODCIFuncCallInfo            odcifc
+#define ODCIFuncCall_ind            odcifci
+#define ODCIFuncCall_ref            odcifcr
+
+#endif                                                        /* SLSHORTNAME */
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+/* Constants for Return Status */
+#define ODCI_SUCCESS             0
+#define ODCI_ERROR               1
+#define ODCI_WARNING             2
+#define ODCI_ERROR_CONTINUE      3
+#define ODCI_FATAL               4
+
+/* Constants for ODCIPredInfo.Flags */
+#define ODCI_PRED_EXACT_MATCH    0x0001
+#define ODCI_PRED_PREFIX_MATCH   0x0002
+#define ODCI_PRED_INCLUDE_START  0x0004
+#define ODCI_PRED_INCLUDE_STOP   0x0008
+#define ODCI_PRED_OBJECT_FUNC    0x0010
+#define ODCI_PRED_OBJECT_PKG     0x0020
+#define ODCI_PRED_OBJECT_TYPE    0x0040
+#define ODCI_PRED_MULTI_TABLE    0x0080
+
+/* Constants for QueryInfo.Flags */
+#define ODCI_QUERY_FIRST_ROWS    0x01
+#define ODCI_QUERY_ALL_ROWS      0x02
+#define ODCI_QUERY_SORT_ASC      0x04
+#define ODCI_QUERY_SORT_DESC     0x08
+#define ODCI_QUERY_BLOCKING      0x10
+
+/* Constants for ScnFlg(Func /w Index Context) */
+#define ODCI_CLEANUP_CALL        1
+#define ODCI_REGULAR_CALL        2
+
+/* Constants for ODCIFuncInfo.Flags */
+#define ODCI_OBJECT_FUNC         0x01
+#define ODCI_OBJECT_PKG          0x02
+#define ODCI_OBJECT_TYPE         0x04
+
+/* Constants for ODCIArgDesc.ArgType */
+#define ODCI_ARG_OTHER           1
+#define ODCI_ARG_COL             2                                 /* column */
+#define ODCI_ARG_LIT             3                                /* literal */
+#define ODCI_ARG_ATTR            4                       /* object attribute */
+#define ODCI_ARG_NULL            5
+#define ODCI_ARG_CURSOR          6
+
+/* Maximum size of ODCIArgDescList array */
+#define ODCI_ARG_DESC_LIST_MAXSIZE 32767
+
+/* Constants for ODCIStatsOptions.Options */
+#define ODCI_PERCENT_OPTION      1
+#define ODCI_ROW_OPTION          2
+
+/* Constants for ODCIStatsOptions.Flags */
+#define ODCI_ESTIMATE_STATS     0x01
+#define ODCI_COMPUTE_STATS      0x02
+#define ODCI_VALIDATE           0x04
+
+/* Constants for ODCIIndexAlter parameter alter_option */
+#define ODCI_ALTIDX_NONE               0
+#define ODCI_ALTIDX_RENAME             1
+#define ODCI_ALTIDX_REBUILD            2
+#define ODCI_ALTIDX_REBUILD_ONL        3
+#define ODCI_ALTIDX_MODIFY_COL         4
+#define ODCI_ALTIDX_UPDATE_BLOCK_REFS  5
+
+/* Constants for ODCIIndexInfo.IndexInfoFlags */
+#define ODCI_INDEX_LOCAL         0x0001
+#define ODCI_INDEX_RANGE_PARTN   0x0002
+#define ODCI_INDEX_HASH_PARTN    0x0004
+#define ODCI_INDEX_ONLINE        0x0008
+#define ODCI_INDEX_PARALLEL      0x0010
+#define ODCI_INDEX_UNUSABLE      0x0020
+#define ODCI_INDEX_ONIOT         0x0040
+#define ODCI_INDEX_TRANS_TBLSPC  0x0080
+#define ODCI_INDEX_FUNCTION_IDX  0x0100
+
+/* Constants for ODCIIndexInfo.IndexParaDegree */
+#define ODCI_INDEX_DEFAULT_DEGREE 32767
+
+/* Constants for ODCIEnv.EnvFlags */
+#define ODCI_DEBUGGING_ON        0x01
+
+/* Constants for ODCIEnv.CallProperty */
+#define ODCI_CALL_NONE           0
+#define ODCI_CALL_FIRST          1
+#define ODCI_CALL_INTERMEDIATE   2
+#define ODCI_CALL_FINAL          3
+
+/* Constants for ODCIExtTableInfo.OpCode */
+#define ODCI_EXTTABLE_INFO_OPCODE_FETCH           1
+#define ODCI_EXTTABLE_INFO_OPCODE_POPULATE        2
+
+/* Constants (bit definitions) for ODCIExtTableInfo.Flag */
+    /* sampling type: row or block */
+#define ODCI_EXTTABLE_INFO_FLAG_SAMPLE           0x00000001
+#define ODCI_EXTTABLE_INFO_FLAG_SAMPLE_BLOCK     0x00000002
+    /* AccessParmClob, AccessParmBlob discriminator */
+#define ODCI_EXTTABLE_INFO_FLAG_ACCESS_PARM_CLOB 0x00000004
+#define ODCI_EXTTABLE_INFO_FLAG_ACCESS_PARM_BLOB 0x00000008
+
+/* Constants for ODCIExtTableInfo.IntraSourceConcurrency */
+#define ODCI_TRUE  1
+#define ODCI_FALSE 0
+
+/* Constants (bit definitions) for ODCIExtTable{Open,Fetch,Populate,Close}
+ * Flag argument.
+ */
+#define ODCI_EXTTABLE_OPEN_FLAGS_QC     0x00000001  /* caller is Query Coord */
+#define ODCI_EXTTABLE_OPEN_FLAGS_SHADOW 0x00000002  /* caller is shadow proc */
+#define ODCI_EXTTABLE_OPEN_FLAGS_SLAVE  0x00000004  /* caller is slave  proc */
+
+#define ODCI_EXTTABLE_FETCH_FLAGS_EOS   0x00000001 /* end-of-stream on fetch */
+
+/* Constants for Flags argument to ODCIAggregateTerminate */
+#define ODCI_AGGREGATE_REUSE_CTX  1
+
+/*---------------------------------------------------------------------------
+                     ODCI TYPES
+  ---------------------------------------------------------------------------*/
+/*
+ * These are C mappings for the OTS types defined in catodci.sql
+ */
+
+typedef OCIRef   ODCIColInfo_ref;
+typedef OCIArray ODCIColInfoList;
+typedef OCIArray ODCIColInfoList2;
+typedef OCIRef   ODCIIndexInfo_ref;
+typedef OCIRef   ODCIPredInfo_ref;
+typedef OCIArray ODCIRidList;
+typedef OCIRef   ODCIIndexCtx_ref;
+typedef OCIRef   ODCIObject_ref;
+typedef OCIArray ODCIObjectList;
+typedef OCIRef   ODCIQueryInfo_ref;
+typedef OCIRef   ODCIFuncInfo_ref;
+typedef OCIRef   ODCICost_ref;
+typedef OCIRef   ODCIArgDesc_ref;
+typedef OCIArray ODCIArgDescList;
+typedef OCIRef   ODCIStatsOptions_ref;
+typedef OCIRef ODCIPartInfo_ref;
+typedef OCIRef   ODCIEnv_ref;
+typedef OCIRef   ODCIExtTableInfo_ref;             /* external table support */
+typedef OCIArray ODCIGranuleList;                  /* external table support */
+typedef OCIRef   ODCIExtTableQCInfo_ref;           /* external table support */
+typedef OCIRef   ODCIFuncCallInfo_ref;
+typedef OCIArray ODCINumberList;
+ 
+struct ODCIColInfo
+{
+   OCIString* TableSchema;
+   OCIString* TableName;
+   OCIString* ColName;
+   OCIString* ColTypName;
+   OCIString* ColTypSchema;
+   OCIString* TablePartition;
+};
+typedef struct ODCIColInfo ODCIColInfo;
+ 
+struct ODCIColInfo_ind
+{
+   OCIInd atomic;
+   OCIInd TableSchema;
+   OCIInd TableName;
+   OCIInd ColName;
+   OCIInd ColTypName;
+   OCIInd ColTypSchema;
+   OCIInd TablePartition;
+};
+typedef struct ODCIColInfo_ind ODCIColInfo_ind;
+
+struct ODCIFuncCallInfo
+{
+   struct ODCIColInfo ColInfo;
+};
+
+struct ODCIFuncCallInfo_ind
+{
+  struct ODCIColInfo_ind ColInfo;
+};
+ 
+struct ODCIIndexInfo
+{
+   OCIString*       IndexSchema;
+   OCIString*       IndexName;
+   ODCIColInfoList* IndexCols;
+   OCIString*       IndexPartition;
+   OCINumber        IndexInfoFlags;
+   OCINumber        IndexParaDegree;
+};
+typedef struct ODCIIndexInfo ODCIIndexInfo;
+ 
+struct ODCIIndexInfo_ind
+{
+   OCIInd atomic;
+   OCIInd IndexSchema;
+   OCIInd IndexName;
+   OCIInd IndexCols;
+   OCIInd IndexPartition;
+   OCIInd IndexInfoFlags;
+   OCIInd IndexParaDegree;
+};
+typedef struct ODCIIndexInfo_ind ODCIIndexInfo_ind;
+ 
+struct ODCIPredInfo
+{
+   OCIString* ObjectSchema;
+   OCIString* ObjectName;
+   OCIString* MethodName;
+   OCINumber  Flags;
+};
+typedef struct ODCIPredInfo ODCIPredInfo;
+ 
+struct ODCIPredInfo_ind
+{
+   OCIInd atomic;
+   OCIInd ObjectSchema;
+   OCIInd ObjectName;
+   OCIInd MethodName;
+   OCIInd Flags;
+};
+typedef struct ODCIPredInfo_ind ODCIPredInfo_ind;
+ 
+struct ODCIObject
+{
+   OCIString* ObjectSchema;
+   OCIString* ObjectName;
+};
+typedef struct ODCIObject ODCIObject;
+ 
+struct ODCIObject_ind
+{
+   OCIInd atomic;
+   OCIInd ObjectSchema;
+   OCIInd ObjectName;
+};
+typedef struct ODCIObject_ind ODCIObject_ind;
+ 
+struct ODCIQueryInfo
+{
+   OCINumber       Flags;
+   ODCIObjectList* AncOps;
+};
+typedef struct ODCIQueryInfo ODCIQueryInfo;
+
+ 
+struct ODCIQueryInfo_ind
+{
+   OCIInd atomic;
+   OCIInd Flags;
+   OCIInd AncOps;
+};
+typedef struct ODCIQueryInfo_ind ODCIQueryInfo_ind;
+ 
+struct ODCIIndexCtx
+{
+   struct ODCIIndexInfo IndexInfo;
+   OCIString*           Rid;
+   struct ODCIQueryInfo QueryInfo;
+};
+typedef struct ODCIIndexCtx ODCIIndexCtx;
+ 
+struct ODCIIndexCtx_ind
+{
+   OCIInd                   atomic;
+   struct ODCIIndexInfo_ind IndexInfo;
+   OCIInd                   Rid;
+   struct ODCIQueryInfo_ind QueryInfo;
+};
+typedef struct ODCIIndexCtx_ind ODCIIndexCtx_ind;
+ 
+struct ODCIFuncInfo
+{
+   OCIString* ObjectSchema;
+   OCIString* ObjectName;
+   OCIString* MethodName;
+   OCINumber Flags;
+};
+typedef struct ODCIFuncInfo ODCIFuncInfo;
+ 
+struct ODCIFuncInfo_ind
+{
+   OCIInd atomic;
+   OCIInd ObjectSchema;
+   OCIInd ObjectName;
+   OCIInd MethodName;
+   OCIInd Flags;
+};
+typedef struct ODCIFuncInfo_ind ODCIFuncInfo_ind;
+ 
+struct ODCICost
+{
+   OCINumber  CPUcost;
+   OCINumber  IOcost;
+   OCINumber  NetworkCost;
+   OCIString* IndexCostInfo;
+};
+typedef struct ODCICost ODCICost;
+ 
+struct ODCICost_ind
+{
+   OCIInd atomic;
+   OCIInd CPUcost;
+   OCIInd IOcost;
+   OCIInd NetworkCost;
+   OCIInd IndexCostInfo;
+};
+typedef struct ODCICost_ind ODCICost_ind;
+ 
+struct ODCIArgDesc
+{
+   OCINumber  ArgType;
+   OCIString* TableName;
+   OCIString* TableSchema;
+   OCIString* ColName;
+   OCIString* TablePartitionLower;
+   OCIString* TablePartitionUpper;
+   OCINumber  Cardinality;
+};
+typedef struct ODCIArgDesc ODCIArgDesc;
+ 
+struct ODCIArgDesc_ind
+{
+   OCIInd atomic;
+   OCIInd ArgType;
+   OCIInd TableName;
+   OCIInd TableSchema;
+   OCIInd ColName;
+   OCIInd TablePartitionLower;
+   OCIInd TablePartitionUpper;
+   OCIInd Cardinality;
+};
+typedef struct ODCIArgDesc_ind ODCIArgDesc_ind;
+ 
+struct ODCIStatsOptions
+{
+   OCINumber Sample;
+   OCINumber Options;
+   OCINumber Flags;
+};
+typedef struct ODCIStatsOptions ODCIStatsOptions;
+ 
+struct ODCIStatsOptions_ind
+{
+   OCIInd atomic;
+   OCIInd Sample;
+   OCIInd Options;
+   OCIInd Flags;
+};
+typedef struct ODCIStatsOptions_ind ODCIStatsOptions_ind;
+
+struct ODCIEnv
+{
+   OCINumber EnvFlags;
+   OCINumber CallProperty;
+   OCINumber DebugLevel;
+   OCINumber CursorNum;
+};
+typedef struct ODCIEnv ODCIEnv;
+
+struct ODCIEnv_ind
+{
+   OCIInd _atomic;
+   OCIInd EnvFlags;
+   OCIInd CallProperty;
+   OCIInd DebugLevel;
+   OCIInd CursorNum;
+};
+typedef struct ODCIEnv_ind ODCIEnv_ind;
+ 
+struct ODCIPartInfo
+{
+   OCIString* TablePartition;
+   OCIString* IndexPartition;
+};
+typedef struct ODCIPartInfo ODCIPartInfo;
+ 
+struct ODCIPartInfo_ind
+{
+   OCIInd atomic;
+   OCIInd TablePartition;
+   OCIInd IndexPartition;
+};
+typedef struct ODCIPartInfo_ind ODCIPartInfo_ind;
+
+/*---------- External Tables ----------*/
+struct ODCIExtTableInfo
+{
+   OCIString*       TableSchema;
+   OCIString*       TableName;
+   ODCIColInfoList* RefCols;
+   OCIClobLocator*  AccessParmClob;
+   OCIBlobLocator*  AccessParmBlob;
+   ODCIArgDescList* Locations;
+   ODCIArgDescList* Directories;
+   OCIString*       DefaultDirectory;
+   OCIString*       DriverType;
+   OCINumber        OpCode;
+   OCINumber        AgentNum;
+   OCINumber        GranuleSize;
+   OCINumber        Flag;
+   OCINumber        SamplePercent;
+   OCINumber        MaxDoP;
+   OCIRaw*          SharedBuf;
+   OCIString*       MTableName;
+   OCIString*       MTableSchema;
+   OCINumber        TableObjNo;
+};
+typedef struct ODCIExtTableInfo ODCIExtTableInfo;
+
+struct ODCIExtTableInfo_ind
+{
+   OCIInd _atomic;
+   OCIInd TableSchema;
+   OCIInd TableName;
+   OCIInd RefCols;
+   OCIInd AccessParmClob;
+   OCIInd AccessParmBlob;
+   OCIInd Locations;
+   OCIInd Directories;
+   OCIInd DefaultDirectory;
+   OCIInd DriverType;
+   OCIInd OpCode;
+   OCIInd AgentNum;
+   OCIInd GranuleSize;
+   OCIInd Flag;
+   OCIInd SamplePercent;
+   OCIInd MaxDoP;
+   OCIInd SharedBuf;
+   OCIInd MTableName;
+   OCIInd MTableSchema;
+   OCIInd TableObjNo;
+};
+typedef struct ODCIExtTableInfo_ind ODCIExtTableInfo_ind;
+
+struct ODCIExtTableQCInfo
+{
+   OCINumber        NumGranules;
+   OCINumber        NumLocations;
+   ODCIGranuleList* GranuleInfo;
+   OCINumber        IntraSourceConcurrency;
+   OCINumber        MaxDoP;
+   OCIRaw*          SharedBuf;
+};
+typedef struct ODCIExtTableQCInfo ODCIExtTableQCInfo;
+
+struct ODCIExtTableQCInfo_ind
+{
+   OCIInd _atomic;
+   OCIInd NumGranules;
+   OCIInd NumLocations;
+   OCIInd GranuleInfo;
+   OCIInd IntraSourceConcurrency;
+   OCIInd MaxDoP;
+   OCIInd SharedBuf;
+};
+typedef struct ODCIExtTableQCInfo_ind ODCIExtTableQCInfo_ind;
+
+/*********************************************************/
+/* Table Function Info types (used by ODCITablePrepare)  */
+/*********************************************************/
+
+struct ODCITabFuncInfo
+{
+  ODCINumberList*  Attrs;
+  OCIType*         RetType;
+};
+typedef struct ODCITabFuncInfo ODCITabFuncInfo;
+
+struct ODCITabFuncInfo_ind
+{
+  OCIInd _atomic;
+  OCIInd Attrs;
+  OCIInd RetType;
+};
+typedef struct ODCITabFuncInfo_ind ODCITabFuncInfo_ind;
+
+/*********************************************************************/
+/* Table Function Statistics types (used by ODCIStatsTableFunction)  */
+/*********************************************************************/
+
+struct ODCITabFuncStats
+{
+  OCINumber num_rows;
+};
+typedef struct ODCITabFuncStats ODCITabFuncStats;
+
+struct ODCITabFuncStats_ind
+{
+  OCIInd _atomic;
+  OCIInd num_rows;
+};
+typedef struct ODCITabFuncStats_ind ODCITabFuncStats_ind;
+
+/*---------------------------------------------------------------------------
+                     PRIVATE TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                           PUBLIC FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                          PRIVATE FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+
+#endif                                              /* ODCI_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/oratypes.h b/src/terralib/drivers/Oracle/OCI/include/oratypes.h
new file mode 100644
index 0000000..5e86403
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/oratypes.h
@@ -0,0 +1,295 @@
+/*
+  Copyright (c) 1982, 2003, Oracle.  All rights reserved.
+*/
+
+/*
+ * $Header$
+ */
+ 
+
+ 
+#ifndef ORATYPES
+# define ORATYPES
+# define SX_ORACLE
+# define SX3_ORACLE 
+
+#ifndef ORASTDDEF
+# include <stddef.h>
+# define ORASTDDEF
+#endif
+
+#ifndef ORALIMITS
+# include <limits.h>
+# define ORALIMITS
+#endif
+
+#ifndef TRUE
+# define TRUE  1
+# define FALSE 0
+#endif
+
+
+#ifndef lint 
+typedef unsigned char  ub1;                   
+typedef   signed char  sb1;                  
+#else 
+#define ub1 unsigned char 
+#define sb1 signed char 
+#endif 
+ 
+#define UB1MAXVAL ((ub1)UCHAR_MAX) 
+#define UB1MINVAL ((ub1)        0) 
+#define SB1MAXVAL ((sb1)SCHAR_MAX) 
+#define SB1MINVAL ((sb1)SCHAR_MIN) 
+#define MINUB1MAXVAL ((ub1)  255) 
+#define MAXUB1MINVAL ((ub1)    0) 
+#define MINSB1MAXVAL ((sb1)  127) 
+#define MAXSB1MINVAL ((sb1) -127) 
+ 
+ 
+#ifndef lint 
+typedef unsigned short    ub2;                
+typedef   signed short    sb2;   
+typedef	unsigned short	utext;
+#else 
+#define ub2  unsigned short 
+#define sb2  signed short 
+#define utext  unsigned short 
+#endif
+
+#define UB2MAXVAL ((ub2)USHRT_MAX) 
+#define UB2MINVAL ((ub2)        0) 
+#define SB2MAXVAL ((sb2) SHRT_MAX) 
+#define SB2MINVAL ((sb2) SHRT_MIN) 
+#define MINUB2MAXVAL ((ub2) 65535) 
+#define MAXUB2MINVAL ((ub2)     0) 
+#define MINSB2MAXVAL ((sb2) 32767) 
+#define MAXSB2MINVAL ((sb2)-32767) 
+  
+
+#ifndef lint 
+typedef unsigned int  ub4;                   
+typedef   signed int  sb4;                   
+#else 
+#define eb4 int 
+#define ub4 unsigned int 
+#define sb4 signed int 
+#endif 
+ 
+#define UB4MAXVAL ((ub4)UINT_MAX) 
+#define UB4MINVAL ((ub4)        0) 
+#define SB4MAXVAL ((sb4) INT_MAX) 
+#define SB4MINVAL ((sb4) INT_MIN) 
+#define MINUB4MAXVAL ((ub4) 4294967295) 
+#define MAXUB4MINVAL ((ub4)          0) 
+#define MINSB4MAXVAL ((sb4) 2147483647) 
+#define MAXSB4MINVAL ((sb4)-2147483647) 
+
+
+/* --- Signed/Unsigned eight-byte scalar (orasb8/oraub8) --- */
+
+#define ORAXB8_DEFINED
+#ifndef lint
+ typedef unsigned  /*_int64*/ int oraub8;
+ typedef signed /*_int64*/ int orasb8;
+ typedef oraub8 ub8;
+ typedef orasb8 sb8;
+#else
+# define ub8 oraub8
+# define sb8 orasb8
+# define oraub8 unsigned int /*_int64*/
+# define orasb8 signed int /*_int64*/
+#endif /* !lint */
+
+#define ORAUB8MINVAL    ((oraub8)0)
+#define ORAUB8MAXVAL    ((oraub8)18446744073709551615)
+#define ORASB8MINVAL    ((orasb8)-9223372036854775808)
+#define ORASB8MAXVAL    ((orasb8) 9223372036854775807)
+
+#define MAXORAUB8MINVAL ((oraub8)0)
+#define MINORAUB8MAXVAL ((oraub8)18446744073709551615)
+#define MAXORASB8MINVAL ((orasb8)-9223372036854775807)
+#define MINORASB8MAXVAL ((orasb8) 9223372036854775807)
+
+
+#define UB1BITS          CHAR_BIT
+#define UB1MASK          ((1 << ((uword)CHAR_BIT)) - 1)
+
+
+#ifdef lint
+# define oratext unsigned char
+#else
+  typedef  unsigned char oratext;
+#endif
+
+
+#ifndef lint 
+typedef          char     eb1;
+typedef          short    eb2;               
+typedef          int      eb4;               
+#else
+# define         eb1      char
+# define         eb2      short
+# define         eb4      int
+#endif
+
+#define EB1MAXVAL      ((eb1)SCHAR_MAX) 
+#define EB1MINVAL      ((eb1)        0) 
+#define MINEB1MAXVAL   ((eb1)  127) 
+#define MAXEB1MINVAL   ((eb1)    0) 
+#define EB2MAXVAL      ((eb2) SHRT_MAX) 
+#define EB2MINVAL      ((eb2)        0) 
+#define MINEB2MAXVAL   ((eb2) 32767) 
+#define MAXEB2MINVAL   ((eb2)     0) 
+#define EB4MAXVAL      ((eb4) INT_MAX) 
+#define EB4MINVAL      ((eb4)        0) 
+#define MINEB4MAXVAL   ((eb4) 2147483647) 
+#define MAXEB4MINVAL   ((eb4)          0) 
+
+
+
+
+#ifndef lint 
+typedef         sb1  b1;                   
+#else 
+#define         b1 sb1 
+#endif  
+#define  B1MAXVAL  SB1MAXVAL 
+#define  B1MINVAL  SB1MINVAL 
+ 
+#ifndef lint 
+typedef         sb2      b2;              
+#else 
+#define         b2 sb2 
+#endif  
+#define  B2MAXVAL  SB2MAXVAL 
+#define  B2MINVAL  SB2MINVAL 
+ 
+#ifndef lint 
+typedef         sb4    b4;                
+#else 
+#define         b4 sb4 
+#endif  
+# define  B4MAXVAL  SB4MAXVAL 
+# define  B4MINVAL  SB4MINVAL 
+ 
+
+#if !defined(LUSEMFC)
+# ifdef lint
+#  define text unsigned char
+# else
+   typedef oratext text;
+# endif
+#endif
+
+#ifdef lint
+# define OraText unsigned char
+#else
+  typedef oratext OraText;
+#endif
+
+#ifndef lint
+typedef          int eword;                  
+typedef unsigned int uword;                  
+typedef   signed int sword;                  
+#else
+#define eword int
+#define uword unsigned int
+#define sword signed int
+#endif 
+
+#define  EWORDMAXVAL  ((eword) INT_MAX)
+#define  EWORDMINVAL  ((eword)       0)
+#define  UWORDMAXVAL  ((uword)UINT_MAX)
+#define  UWORDMINVAL  ((uword)       0)
+#define  SWORDMAXVAL  ((sword) INT_MAX)
+#define  SWORDMINVAL  ((sword) INT_MIN)
+#define  MINEWORDMAXVAL  ((eword)  2147483647)
+#define  MAXEWORDMINVAL  ((eword)      0)
+#define  MINUWORDMAXVAL  ((uword)  4294967295)
+#define  MAXUWORDMINVAL  ((uword)           0)
+#define  MINSWORDMAXVAL  ((sword)  2147483647)
+#define  MAXSWORDMINVAL  ((sword) -2147483647)
+
+ 
+#ifdef _WIN64
+
+#ifndef lint
+typedef unsigned _int64 ubig_ora;     
+typedef   signed _int64 sbig_ora;     
+#else
+#define ubig_ora unsigned _int64
+#define sbig_ora signed _int64
+#endif 
+
+#define UBIG_ORAMAXVAL ((ubig_ora)_UI64_MAX)
+#define UBIG_ORAMINVAL ((ubig_ora)        0)
+#define SBIG_ORAMAXVAL ((sbig_ora) _I64_MAX)
+#define SBIG_ORAMINVAL ((sbig_ora) _I64_MIN)
+#define MINUBIG_ORAMAXVAL ((ubig_ora) 4294967295)
+#define MAXUBIG_ORAMINVAL ((ubig_ora)          0)
+#define MINSBIG_ORAMAXVAL ((sbig_ora) 2147483647)
+#define MAXSBIG_ORAMINVAL ((sbig_ora)-2147483647)
+
+#else
+
+#ifndef lint
+typedef unsigned long  ubig_ora;             
+typedef   signed long  sbig_ora;             
+#else
+#define ubig_ora unsigned long
+#define sbig_ora signed long
+#endif 
+
+#define UBIG_ORAMAXVAL ((ubig_ora)ULONG_MAX)
+#define UBIG_ORAMINVAL ((ubig_ora)        0)
+#define SBIG_ORAMAXVAL ((sbig_ora) LONG_MAX)
+#define SBIG_ORAMINVAL ((sbig_ora) LONG_MIN)
+#define MINUBIG_ORAMAXVAL ((ubig_ora) 4294967295)
+#define MAXUBIG_ORAMINVAL ((ubig_ora)          0)
+#define MINSBIG_ORAMAXVAL ((sbig_ora) 2147483647)
+#define MAXSBIG_ORAMINVAL ((sbig_ora)-2147483647)
+
+#endif    /* _WIN64 */
+
+#define UBIGORABITS      (UB1BITS * sizeof(ubig_ora))
+
+
+#undef CONST
+#define CONST const
+
+
+#define dvoid void
+
+
+typedef void (*lgenfp_t)( void );
+
+
+#ifndef ORASYS_TYPES
+# include <sys/types.h>
+# define ORASYS_TYPES
+#endif 
+
+/* Define "boolean" as int, not int, per Windows custom. */
+# ifndef __RPCNDR_H__            /* don't conflict if rpcndr.h already read */
+	typedef unsigned char boolean; 
+# endif
+
+#ifdef sparc
+# define SIZE_TMAXVAL SB4MAXVAL               
+#else
+# define SIZE_TMAXVAL UB4MAXVAL              
+#endif 
+
+#define MINSIZE_TMAXVAL (size_t)4294967295
+
+
+#if !defined(MOTIF) && !defined(LISPL)  && !defined(__cplusplus) && !defined(LUSEMFC)
+typedef  oratext *string;        
+#endif 
+
+ 
+#endif  //ORATYPES
+
+
+
diff --git a/src/terralib/drivers/Oracle/OCI/include/ori.h b/src/terralib/drivers/Oracle/OCI/include/ori.h
new file mode 100644
index 0000000..3ec7568
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ori.h
@@ -0,0 +1,2094 @@
+/* Copyright (c) 1994, 2003, Oracle Corporation.  All rights reserved.  */
+
+/*
+  NAME
+    ORI - OCI navigational interface
+
+  DESCRIPTION
+
+    This section is intended to give a brief introduction to the navigational
+    interfaces.  Readers can refer to the documents listed in the section 
+    'RELATED DOCUMENTS' for more information. 
+
+    PURPOSE 
+       The Oracle Call Interface (OCI) supports navigational access of objects.
+       In the navigational paradigm, data is represented as a graph of objects 
+       connected by references.  Objects in the graph are reached by following
+       the references.
+
+    OBJECT ENVIRONMENT
+
+      The object environment is initialized when the OCI environment handle is
+      initialized with the object option.  An object environment contains a
+      heap which buffers type instances in memory.  The object environment also
+      contains an object cache which keeps track of the objects in the object 
+      environment.  Readers can refer to the "Functional Specification for 
+      Programmatic Interface" for more information about the object 
+      environment. 
+
+    INSTANCE, OBJECT AND VALUE
+
+      An OTS instance is an occurence of a type specified by the Oracle Type 
+      System (OTS). This section describes how an OTS instance can be 
+      represented in OCI. In OCI, an OTS instance can be classified based on
+      the type, the lifetime and referencability (see the figure below):
+
+      1) A persistent object is an instance of an object type. A persistent
+         object resides in a row of a table in the server and can exist longer
+         than the duration of a session (connection). Persistent objects can be
+         identified by object references which contain the object identifiers.
+         A persistent object is obtained by pinning its object reference.
+
+      2) A transient object is an instance of an object type. A transient 
+         object cannot exist longer than the duration of a session, and it is 
+         used to contain temporary computing results. Transient objects can 
+         also be identified by references which contain transient object
+         identifiers.
+
+      3) A value is an instance of an user-defined type (object type or 
+         collection type) or any built-in OTS type.  Unlike objects, values of 
+         object types are identified by memory pointers, rather than by 
+         references.  
+
+         A value can be standalone or embbeded.  A standalone value is usually
+         obtained by issuing a select statement.  OCI also allows the client
+         program to select a row of object table into a value by issuing a SQL
+         statement.  Thus, a referenceable object (in the database) can be 
+         represented as a value (which cannot be identified by a reference).
+         A standalone value can also be an out-of-line attribute in an object 
+         (e.g varchar, raw) or an out-of-line element in a collection (e.g.
+         varchar, raw, object).
+      
+         An embedded value is phyiscally included in a containing instance.
+         An embedded value can be an in-line attribute in an object (e.g.
+         number, nested object) or an in-line element in a collection.
+
+         All values are considered to be transient by OCI, e.g. OCI does not
+         support automatic flushing a value to the database, and the client has
+         to explicitly execute a SQL statement to store a value into the 
+         database. For embedded values, they are flushed when their containing
+         instance are flushed.
+
+
+                                OTS instance
+                                 |        |  
+                                 v        v
+                               object    value         (type)
+                               |    |
+                               v    v
+                       persistent  transient           (lifetime)
+                  
+ 
+                     persistent obj   transient obj     value  
+      ---------------------------------------------------------------
+      |              |              |               |  object type, |
+      | type         | object type  |  object type  |  built-in,    |
+      |              |              |               |  collection   |
+      ---------------------------------------------------------------
+      | maximum      | until object |  session      | session       |
+      | lifetime     | is deleted   |               |               | 
+      ---------------------------------------------------------------
+      | referencable |    yes       |     yes       |    no         |    
+      ---------------------------------------------------------------
+      | embeddable   |    no        |     no        |    yes        |    
+      ---------------------------------------------------------------
+
+    REFERENCEABLE OBJECT, STANDALONE OBJECT, EMBEDDED OBJECT
+
+       In the reminding of this include file, the following term will be used:
+       1) The term 'object' can be generally referred to a persistent object,
+          a transient object, a standalone value of object type, or an embedded
+          value of object type.
+       2) The term 'referenceable object' refers to a persistent object or a 
+          transient object.
+       3) The term 'standalone object' refers to a persistent object, a
+          transient object or a standalone value of object type.
+       4) The term 'embedded object' referes to a embbeded value of object 
+          type.
+
+    META ATTRIBUTES 
+
+      There is a set of meta-attributes that are defined for standalone 
+      objects.  A meta-attribute can be transient or persistent. A 
+      transient meta-attribute is applicable to an instance only when it is 
+      in memory. A persistent meta-attribute can be applicable to an instance 
+      that is in the disk. 
+
+      The set of user visible meta-attributes for persistent objects are:
+      1) existent (persistent) : Does the object exist?
+      2) nullness (persistent) : Null information of the instance
+      3) locked   (persistent) : Is the object locked?
+      4) pinned    (transient) : Is the object being accessed by the client?
+      5) dirty     (transient) : Has the object been modified?
+      6) allocation duration (transient) : see below
+      7) pin duration        (transient) : see below
+
+      The set of user visible meta-attributes for transient objects are:
+      1) existent  (transient) : Does the object exist?
+      2) nullness  (transient) : Null information of the instance 
+      3) pinned    (transient) : Is the object being accessed by the client? 
+      4) dirty     (transient) : Has the object been modified?
+      4) allocation duration (transient) : see below
+      5) pin duration        (transient) : see below
+
+      The set of user visible meta-attributes for standalone values of object  
+      type or collections are:
+      1) allocation duration (transient) : see below
+      2) nullness            (transient) : Null information of the instance 
+                                           (of an object type)
+
+    NULLNESS OF AN INSTANCE 
+
+      Each standalone object is associated with a null structure which keeps 
+      the null information about the object.  A null indicates the absence of 
+      data. The null structure itself contains null indicators that represent:
+        1) atomic nullness : a null value that pertains to the whole object 
+        2) null status of the individual attribute in the object 
+
+      The layout of a null structure in memory resembles that of the object,
+      except that the null structure has additional indicators to represent 
+      the atomic nullness for each object. 
+
+      An non-existent object is different than an object that is atomically 
+      null. A atomically null object is an existing object that has no data. 
+
+    MEMORY LAYOUT OF AN OBJECT
+
+      A standalone object in memory is composed of a top level memory chunk, 
+      a null structure and optionally, a number of secondary memory chunks. 
+      For a DEPARTMENT object type,
+
+          OBJECT TYPE department
+          {
+              dep_name      varchar2(20),
+              budget        number,
+              manager       person,              /o person is an object type o/
+              employees     collection of person
+          }
+
+      Each instance of DEPARTMENT will has a top level memory chunk which
+      contains the top level attributes such as dep_name, budget, manager and
+      employees.  The attributes dep_name and employees are themselves pointers
+      to the additional memory (the secondary memory chunks). The secondary
+      memory is for the out-of-line attribute (e.g. varray).
+
+    CONSISTENCY MODEL
+
+      Each pin operation behaves like a distinct SQL select.  Thus, the object 
+      cache does not guarantee consistency for a graph of objects.  In order to
+      retrieve a consistent graph of objects, the user has to explicitly start 
+      a serializable transaction or a read-only transaction. 
+
+    DURATION
+      In OCI, a duration is used to specify 
+
+        1) the length of memory allocation of an instance 
+           When each instance is allocated, it is associate with an allocation
+           duration.  The memory occupied by the object is freed automatically 
+           at the end of its allocation duration. The allocation duration of an
+           instance cannot be changed.  
+
+        2) the length of pinning of an object
+           When each object is pinned, the client has to give a pin duration 
+           which specify the length of time that the object is intended to be
+           used.  It is an user error to specify a pin duration longer than an
+           allocation duration of the object. An object is completely unpinned 
+           at the end of its pin duration (see OCIObjectUnpin()). 
+
+      An OCI program can use the allocation duration and the pin duration to 
+      automatically free the memory of the instances:
+       1) Transient objects and values are freed at the end of the allocation
+          duration.
+       2) Persistent objects ARE freed at the end of the allocation duration.
+          Persistent objects CAN be freed at the end of the pin duration when
+          the objects are completely unpinned. The persistent objects are said
+          to be aged out. See OCIObjectUnpin() for more details.
+
+      There are 3 predefined duration: session, transaction, call.  The time 
+      spans of these durations are defined based on the programming model 
+      presented by OCI. The call duration is mapped to the transaction 
+      duration in the client-side environment. See oro.h for the macros defined
+      for these 3 durations.
+
+      A pin duration can be promoted. For example, if an object is pinned with
+      duration 1, and the object is later pinned with duration 2, the pin 
+      routine will try to find a duration that is longer or equal to the 
+      length of both duration 1 and duration 2.  The pin duration of the object
+      is set to the that duration. The object is automatically unpinned only 
+      after both duration 1 and duration 2 are terminated. 
+
+  RELATED DOCUMENTS
+    "Functional Specification for Oracle Object RDBMS" 
+    "Functional Specification for Programmatic Interfaces" 
+    "Functional Specification for the Oracle Type System (OTS)" 
+
+  INSPECTION STATUS 
+    Inspection date:
+    Inspection status:
+    Estimated increasing cost defects per page:
+    Rule sets:        
+
+  ACCEPTANCE REVIEW STATUS 
+    Review date:   
+    Review status:
+    Reviewers: 
+
+  PUBLIC FUNCTIONS
+    OCIObjectNew - OCI new a standalone instance 
+    OCIObjectPin - OCI pin an object by reference
+    OCIObjectUnpin - OCI unpin a referenceable object
+    OCIObjectPinCountReset - OCI reset the pin count of a referenceable object 
+    OCIObjectLock - OCI lock a persistent object
+    OCIObjectLockNoWait - OCI lock a persistent object
+    OCIObjectMarkUpdate - OCI mark a referenceable object as updated
+    OCIObjectUnmark - OCI unmark a dirtied referenceable object 
+    OCIObjectUnmarkByRef - OCI unmark a dirtied object by reference 
+    OCIObjectFree - OCI free a standalone instance 
+    OCIObjectMarkDelete - OCI mark a referenceable object as deleted 
+    OCIObjectMarkDeleteByRef - OCI mark a referenceable object as deleted by 
+                               giving a reference
+    OCIObjectFlush - OCI flush a persistent object
+    OCIObjectRefresh - OCI refresh a persistent object 
+    OCIObjectCopy - OCI CoPy one object to another
+    OCIObjectGetTypeRef - OCI get the Type Reference of a standalone object 
+    OCIObjectGetObjectRef - OCI get the Object's Reference 
+    OCIObjectGetInd - OCI get Null Structure of an standalone object 
+    OCIObjectExists - OCI get the existence of a referenceable object
+    OCIObjectGetProperty - get object property
+    OCIObjectIsLocked - OCI get the lock status of a referenceable object
+    OCIObjectIsDirty - OCI get the dirty status of a referenceable object
+    OCIObjectPinTable - OCI get Table object 
+    OCIObjectArrayPin - OCI pin array of objects 
+    OCIObjectGetPrimayKeyTypeRef - OCI get the Ref for the primary key OID's 
+                                   type 
+    OCIObjectMakeObjectRef - OCI Create a pk or sys generated REF  
+
+    OCIObjectGetNewOID - OCI Create a new Object ID
+
+    OCICacheFlush - OCI flsuh the modified persistent objects in the cache
+    OCICacheRefresh - OCI refresh persistent objects in the cache 
+    OCICacheUnpin - OCI unpin referenceable objects in the cache
+    OCICacheFree - OCI free all instances in the environment
+    OCICacheUnmark - OCI unmark all dirty referenceable objects in the cache 
+
+  PRIVATE FUNCTIONS
+    None
+
+  EXAMPLES 
+
+    The following types will be used in the examples in this section: 
+
+    OBJECT TYPE professor
+    (
+        varchar2  name;
+        number    department;
+        number    num_of_students; 
+    );
+
+    OBJECT TYPE course 
+    (
+        varchar2   name;
+        number     grade; 
+    );
+
+    OBJECT TYPE student
+    (
+        vstring      name;
+        number       department;
+        ref          advisor;                      /o advisor is a professor o/
+        collection   courses;
+    );
+
+    EXAMPLE 1
+
+      Here is a set of examples to illustrate the usages of some of the
+      orio and oric functions.  
+
+      OCIenv    *env;              /o OCI environment handle o/
+      OCIError  *err;              /o OCI error handle o/
+      OCISvcCtx *svc;              /o OCI service handle o/
+
+      dvoid   *stu_tbl;            /o pointer to the student table o/
+      OCIType *stu_tdo;            /o student type tdo o/
+
+      OCIRef    *stu2_ref;         /o object reference to student object o/
+      student   *stu1;             /o pointer to the student object o/
+      student   *stu2;             /o pointer to the student object o/
+      professor *pro;              /o pointer to the professor object o/
+
+      /o Initialize the OCI environment handle, error handle and service
+         handle and login to the database o/ 
+      ...
+
+      /o CREATE A PERSISTENT OBJECT o/
+
+      /o get the table object of student o/
+      if (OCIObjectPinTable(env, err, svc, "ORACLEU", sizeof("ORACLEU"), 
+          "STUDENT_TABLE", sizeof("STUDENT_TABLE"), (OCIRef *)0, 
+          OCI_DURATION_NULL, &stu_tbl) != OCI_SUCCESS)
+          /o error handling code o/ 
+
+      /o get type object of student o/
+      if (OCITypeByName(env, err, svc, "ORACLEU", sizeof("ORACLEU"), 
+          "STUDENT", sizeof("STUDENT"), OCI_DURATION_NULL, OCI_TYPEGET_HEADER,
+          &stu_tdo) != OCI_SUCCESS)
+          /o error handling code o/ 
+
+      /o create a persistent object 'mark' (of type student) o/ 
+      if (OCIObjectNew(env, err, svc, OCI_TYPECODE_ADT, stu_tdo, stu_tbl, 
+            OCI_DURATION_TRANS, (ub1)FALSE, (dvoid **)&stu1) != OCI_SUCCESS)
+          /o error handling code o/
+
+      /o RETRIEVE OBJECTS IN PERSISTENT STORES o/ 
+
+      /o Use OCI to retrieve a reference to student object 'joe'.
+       o The retrieved reference is bound to the variable stu2_ref.
+       o/ 
+
+      /o pin/retrieve the student "joe" by reference o/ 
+      if (OCIObjectPin(env, err, &stu2_ref, (OCIComplexObject *)0, OCI_PIN_ANY,
+                  OCI_DURATION_TRANS, OCI_LOCK_X, &stu2) != OCI_SUCCESS)
+          /o error handling code o/ 
+
+      /o pin/retrieve the advisor of student "joe" by reference o/ 
+      if (OCIObjectPin(env, err, &stu2->advisor, (OCIComplexObject *)0,
+          OCI_PIN_ANY, OCI_DURATION_TRANS, OCI_LOCK_X, &pro) != OCI_SUCCESS)
+          /o error handling code o/ 
+
+      /o MODIFY OBJECTS o/
+
+      /o initialize the newly created object "mark" o/
+      DISCARD OCIStringAssignText(env, err, "mark", sizeof("mark"), 
+                                    &stu1->name);
+      department = 522;
+      DISCARD OCINumberFromInt(err, &department, sizeof(department), 
+                                    OCI_NUMBER_UNSIGNED, &stu1->department);
+
+      /o assign advisor to student "mark" o/
+      DISCARD OCIRefAssign(env, err, &stu2->advisor, &stu1->advisor);
+
+      /o update student "joe". o/  
+      department = 533;
+      DISCARD OCINumberFromInt(err, &department, sizeof(department), 
+                                    OCI_NUMBER_UNSIGNED, &stu2->department);
+      DISCARD OCIObjectMarkUpdate(env, err, stu2);
+
+      /o UNPIN OBJECTS AFTER FINSIHED PROCESSING THEM o/ 
+
+      /o unpin the student object "mark" o/
+      if (OCIObjectUnpin(env, err, stu1) != OCI_SUCCESS)
+          /o error handling code o/ 
+
+      /o unpin the student object "joe" o/
+      if (OCIObjectUnpin(env, err, stu2) != OCI_SUCCESS)
+          /o error handling code o/ 
+
+      /o unpin the professor object o/
+      if (OCIObjectUnpin(env, err, pro) != OCI_SUCCESS)
+          /o error handling code o/ 
+
+      /o unpin the type object o/
+      if (OCIObjectUnpin(env, err, stu_tdo) != OCI_SUCCESS)
+          /o error handling code o/ 
+
+      /o unpin the table object o/
+      if (OCIObjectUnpin(env, err, stu_tbl) != OCI_SUCCESS)
+          /o error handling code o/ 
+
+      /o FLUSH MODIFIED OBJECTS BACK TO PERSISTENT STORE o/
+
+      if (OCICacheFlush(env, err, svc, (dvoid *)0, ((OCIRef*)(*)())0, 
+                       (OCIRef *)0) != OCI_SUCCESS)
+          /o error handling code o/
+
+      /o commit transaction o/
+
+    END OF EXAMPLE 1
+
+  NOTES
+    This file has been subsetted to contain only the routines that will
+    be in the first release.
+
+  MODIFIED
+    srseshad   03/12/03 - convert oci public api to ansi
+    aahluwal   06/03/02 - bug 2360115
+    bpalaval   02/09/01 - Change text to oratext.
+    rkasamse   06/21/00 - add ociobjectgetnewoid
+    rkasamse   05/24/00 - add OCIObjectSetData
+    whe        09/01/99 - 976457:check __cplusplus for C++ code
+    smuralid   10/29/98 - add comments for OCIObjectMakeObjectRef              
+    mkrishna   08/19/98 - change OCIGetPkTypeRef to OCIObjectGetPrimaryKeyTypeR
+    mkrishna   08/10/98 - add OCIObjectMakeObjectRef & OCIObjectGetPkTypeRef
+    rkasamse   06/22/98 - add comments for OCIDurationBegin(End)
+    pmitra     04/01/98 - OCIObjectLockNoWait added                            
+    pmitra     11/05/97 - [573769] OCIObjectArrayPin pos parameter cannot be NU
+    cxcheng    07/29/97 - fix compile for short names
+    skrishna   07/14/97 - add OCIObjectGetProperty
+    skrishna   04/30/97 - OCIObjectFlushRefresh: remove duplicate declaration
+    skrishna   04/24/97 - flag unsupported functions
+    sthakur    03/20/97 - modify flag argument to OCIObjectFree
+    skrishna   03/18/97 - fix ifdef for supporting ansi and k&r proto-types
+    cxcheng    02/19/97 - remove short names support
+    cxcheng    02/06/97 - take out short name support except with SLSHORTNAME
+    sthakur    12/20/96 - fix a typepo in OCIOBjectArrayPin
+    jboonleu   11/07/96 - modify comments
+    cxcheng    10/28/96 - more beautification changes
+    jboonleu   10/24/96 - add flag to OCIObjectFree
+    jboonleu   10/22/96 - change interface of OCICacheFlush
+    cxcheng    10/18/96 - rename OCIObjectPinArray to OCIObjectArrayPin
+    cxcheng    10/14/96 - more renaming of types
+    jboonleu   10/09/96 - add new interfaces
+    cxcheng    10/09/96 - more lint fixes
+    cxcheng    10/08/96 - more lint fixes
+    jboonleu   09/27/96 - fix lint errors
+    jboonleu   10/07/96 - beautify ori.h after conversion to long names
+    cxcheng    10/04/96 - replace short names with long names
+    sthakur    08/20/96 - add COR context to OCIObjectPin
+    mluong     07/17/96 - add back orioglk, oriogdr, oriogiv, and oriocur.
+    jboonleu   07/17/96 - rename refresh option to conherency option 
+    jboonleu   07/16/96 - change comment for cache consistency
+    jwijaya    07/03/96 - add ANSI prototypes
+    jboonleu   06/12/96 - update comment
+    jboonleu   05/08/96 -  change description of OCIDurationGetParent
+    jboonleu   05/01/96 -  add OROOCOSFN
+    skrishna   04/08/96 -  change ori*() to take OCIEnv* and OCIError* instead
+                           of oroenv*
+    jboonleu   01/04/96 -  interface change
+    jboonleu   10/24/95 -  support of variable ref
+    jboonleu   02/15/95 -  new interface
+    sthakur    01/05/95 -  pass username to origrgc 
+    skotsovo   12/07/94 -  update example 
+    jwijaya    11/15/94 -  rename ORONSPTAB to ORONSPEXT 
+    jwijaya    10/06/94 -  add namespace to oriopnm() 
+    jwijaya    10/02/94 -  connection handle -> connection number 
+    jboonleu   08/16/94 -  fix lint errors 
+    jboonleu   07/20/94 -  change interface of OCICacheFlush 
+    tanguyen   07/18/94 -  add oriocpe, change OCIObjectCopy to oriocps
+    tcheng     07/15/94 -  add init param maximum_sga_heap_size 
+    tcheng     07/13/94 -  change origini to get param string 
+    jboonleu   07/05/94 -  change sccs string from sccid to a comment 
+    jboonleu   07/01/94 -  Add examples to ORIO* and ORIC* functions 
+    tanguyen   06/30/94 -  Fix the ORI_ORACLE ifdef
+    skotsovo   06/27/94 -  include all public functions in public functions 
+                           list at top of header file
+    tcheng     06/27/94 -  modify comments according to new template 
+    tanguyen   06/24/94 -  fix comments for OCIObjectCopy 
+    tcheng     06/24/94 -  fix comments in origrgc()
+    tanguyen   06/21/94 -  fix comments and format 
+    tcheng     06/20/94 -  commenting origini/trm/err/rgc/urg() functions
+    tanguyen   06/16/94 -  fix descriptions of ref operations 
+    tanguyen   06/16/94 -  clarifies refs comparison 
+    tanguyen   05/12/94 -  adds more interfaces (OCIObjectMarkUpdate)
+    jwijaya    05/10/94 -  fix examples, add origurg, change origcon to origrgc
+    tanguyen   05/03/94 -  remove unnecessary 'type' argument from 
+                           'OCIObjectCopy'
+    tanguyen   03/08/94 -  clarifies comments
+    jwijaya    02/16/94 -  more questions
+    jwijaya    02/11/94 -  more comments
+    jwijaya    02/10/94 -  identify optional arguments
+    jwijaya    02/07/94 -  Creation
+*/
+
+
+#ifndef ORATYPES
+#include <oratypes.h>
+#endif
+#ifndef ORO_ORACLE
+#include <oro.h>
+#endif
+#ifndef OCI_ORACLE
+#include <oci.h>
+#endif
+#ifndef ORT_ORACLE
+#include <ort.h>
+#endif
+
+#ifndef ORI_ORACLE
+#define ORI_ORACLE
+
+/*---------------------------------------------------------------------------*/
+/*                         SHORT NAMES SUPPORT SECTION                       */
+/*---------------------------------------------------------------------------*/
+
+#ifdef SLSHORTNAME
+
+/* the following are short names that are only supported on IBM mainframes
+   with the SLSHORTNAME defined.
+   With this all subsequent long names will actually be substituted with
+   the short names here */
+
+#define OCIDurationBegin                 origbgu
+#define OCIDurationEnd                   origedu
+#define OCIDurationGetParent             origpdr
+#define OCICacheFlushRefresh             oricfrh
+#define OCICacheUnpin                    oricunp
+#define OCICacheFree                     oricfre
+#define OCICacheUnmark                   oricumk
+#define OCICacheGetObjects               oricgpr
+#define OCICacheRegister                 oricscb
+#define OCIObjectUnpin                   oriounp
+#define OCIObjectPinCountReset           orioupz
+#define OCIObjectLock                    oriolck
+#define OCIObjectLockNoWait              oriolnw
+#define OCIObjectMarkUpdate              orioupd
+#define OCIObjectUnmark                  orioumk
+#define OCIObjectUnmarkByRef             orioumr
+#define OCIObjectAlwaysLatest            oriomkl
+#define OCIObjectNotAlwaysLatest         oriouml
+#define OCIObjectMarkDeleteByRef         oriordl
+#define OCIObjectMarkDelete              oriopdl
+#define OCIObjectFlush                   oriofls
+#define OCIObjectFlushRefresh            oriofrh
+#define OCIObjectCopy                    oriocpy
+#define OCIObjectGetTypeRef              oriogtr
+#define OCIObjectGetObjectRef            oriogor
+#define OCIObjectGetInd                  oriogns
+#define OCIObjectExists                  oriogex
+#define OCIObjectGetProperty             oriogpr
+#define OCIObjectRefresh                 oriorfs
+#define OCIObjectPinTable                oriogtb
+#define OCIObjectGetPrimaryKeyTypeRef    oriogpf
+#define OCIObjectMakeObjectRef           oriomrf
+
+#define OCIObjectNew                     orionew
+#define OCIObjectPin                     oriopin
+#define OCIObjectFree                    oriofre
+#define OCIObjectArrayPin                orioapn
+#define OCIObjectIsDirty                 oriodrt
+#define OCIObjectIsDirtied               oriodrd
+#define OCIObjectIsLoaded                orioldd
+#define OCICacheFlush                    oricfls
+#define OCICacheRefresh                  oricrfs
+
+#endif                                                        /* SLSHORTNAME */
+
+/*---------------------------------------------------------------------------*/
+/*                       PUBLIC TYPES AND CONSTANTS                          */
+/*---------------------------------------------------------------------------*/
+
+/* Also see oro.h. */
+
+/*---------------------------------------------------------------------------*/
+/*                           PUBLIC FUNCTIONS                                */
+/*---------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
+/*                       OBJECT/INSTANCE OPERATIONS                          */
+/*---------------------------------------------------------------------------*/
+
+/*--------------------------- OCIObjectNew ----------------------------------*/
+sword OCIObjectNew(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+                       OCITypeCode typecode, OCIType *tdo, dvoid *table, 
+                       OCIDuration duration, boolean value, 
+                       dvoid **instance    );
+/*
+   NAME: OCIObjectNew - OCI new (create) a standalone instance
+   PARAMETERS:
+        env  (IN/OUT) - OCI environment handle initialized in object mode
+        err  (IN/OUT) - error handle. If there is an error, it is
+                        recorded in 'err' and this function returns OCI_ERROR.
+                        The error recorded in 'err' can be retrieved by calling
+                        OCIErrorGet().
+        svc      (IN) - OCI service handle.  
+        typecode (IN) - the typecode of the type of the instance. 
+        tdo      (IN, optional) - pointer to the type descriptor object. The 
+                        TDO describes the type of the instance that is to be 
+                        created. Refer to OCITypeByName() for obtaining a TDO. 
+                        The TDO is required for creating a named type (e.g. an
+                        object or a collection).
+        table (IN, optional) - pointer to a table object which specifies a 
+                        table in the server.  This parameter can be set to NULL
+                        if no table is given. See the description below to find
+                        out how the table object and the TDO are used together
+                        to determine the kind of instances (persistent, 
+                        transient, value) to be created. Also see 
+                        OCIObjectPinTable() for retrieving a table object.
+        duration (IN) - this is an overloaded parameter. The use of this
+                        parameter is based on the kind of the instance that is 
+                        to be created.
+                        a) persistent object. This parameter specifies the
+                           pin duration.
+                        b) transient object. This parameter specififes the 
+                           allocation duration and pin duration. 
+                        c) value. This parameter specifies the allocation
+                           duration. 
+        value    (IN)  - specifies whether the created object is a value.
+                         If TRUE, then a value is created. Otherwise, a 
+                         referenceable object is created.  If the instance is 
+                         not an object, then this parameter is ignored.
+        instance (OUT) - address of the newly created instance
+                  
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+   DESCRIPTION:
+        This function creates a new instance of the type specified by the 
+        typecode or the TDO. Based on the parameters 'typecode' (or 'tdo'), 
+        'value' and 'table', different kinds of instances can be created:
+            
+                                     The parameter 'table' is not NULL?
+
+                                               yes              no
+             ----------------------------------------------------------------
+             | object type (value=TRUE)   |   value         |   value       |
+             ----------------------------------------------------------------
+             | object type (value=FALSE)  | persistent obj  | transient obj |
+       type  ----------------------------------------------------------------
+             | built-in type              |   value         |   value       |
+             ----------------------------------------------------------------
+             | collection type            |   value         |   value       |
+             ----------------------------------------------------------------
+
+        This function allocates the top level memory chunk of an OTS instance.
+        The attributes in the top level memory are initialized (e.g. an 
+        attribute of varchar2 is initialized to a vstring of 0 length). 
+
+        If the instance is an object, the object is marked existed but is 
+        atomically null. 
+
+        FOR PERSISTENT OBJECTS:
+        The object is marked dirty and existed.  The allocation duration for 
+        the object is session. The object is pinned and the pin duration is 
+        specified by the given parameter 'duration'.
+
+        FOR TRANSIENT OBJECTS:
+        The object is pinned. The allocation duration and the pin duration are 
+        specified by the given parameter 'duration'.
+
+        FOR VALUES:
+        The allocation duration is specified by the given parameter 'duration'.
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*--------------------------- OCIObjectPin ----------------------------------*/
+sword OCIObjectPin(    OCIEnv *env, OCIError *err, OCIRef *object_ref, 
+                       OCIComplexObject *corhdl, OCIPinOpt pin_option, 
+                       OCIDuration pin_duration, 
+                       OCILockOpt lock_option, dvoid **object    );
+/*
+   NAME: OCIObjectPin - OCI pin a referenceable object
+   PARAMETERS:
+        env        (IN/OUT) - OCI environment handle initialized in object mode
+        err        (IN/OUT) - error handle. If there is an error, it is
+                              recorded in 'err' and this function returns 
+                              OCI_ERROR. The error recorded in 'err' can be 
+                              retrieved by calling OCIErrorGet().
+        object_ref     (IN) - the reference to the object. 
+        corhdl         (IN) - handle for complex object retrieval. 
+        pin_option     (IN) - See description below.
+        pin_duration   (IN) - The duration of which the object is being accesed
+                              by a client. The object is implicitly unpinned at
+                              the end of the pin duration. 
+                              If OCI_DURATION_NULL is passed, there is no pin 
+                              promotion if the object is already loaded into 
+                              the cache. If the object is not yet loaded, then 
+                              the pin duration is set to OCI_DURATION_DEFAULT. 
+        lock_option    (IN) - lock option (e.g., exclusive). If a lock option
+                              is specified, the object is locked in the server.
+                              See 'oro.h' for description about lock option. 
+        object        (OUT) - the pointer to the pinned object.
+
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+   DESCRIPTION:
+
+        This function pins a referenceable object instance given the object
+        reference. The process of pinning serves three purposes:
+
+        1) locate an object given its reference. This is done by the object
+           cache which keeps track of the objects in the object heap.  
+
+        2) notify the object cache that an object is being in use. An object 
+           can be pinned many times. A pinned object will remain in memory 
+           until it is completely unpinned (see OCIObjectUnpin()). 
+
+        3) notify the object cache that a persistent object is being in use 
+           such that the persistent object cannot be aged out.  Since a 
+           persistent object can be loaded from the server whenever is needed, 
+           the memory utilization can be increased if a completely unpinned 
+           persistent object can be freed (aged out), even before the 
+           allocation duration is expired.  
+
+        Also see OCIObjectUnpin() for more information about unpinning.
+
+        FOR PERSISTENT OBJECTS:
+
+        When pinning a persistent object, if it is not in the cache, the object
+        will be fetched from the persistent store. The allocation duration of
+        the object is session. If the object is already in the cache, it is
+        returned to the client.  The object will be locked in the server if a 
+        lock option is specified. 
+
+        This function will return an error for a non-existent object.  
+
+        A pin option is used to specify the copy of the object that is to be 
+        retrieved: 
+
+        1) If option is OCI_PIN_ANY (pin any), if the object is already 
+           in the environment heap, return this object. Otherwise, the object 
+           is retrieved from the database.  This option is useful when the 
+           client knows that he has the exclusive access to the data in a 
+           session.
+
+        2) If option is OCI_PIN_LATEST (pin latest), if the object is 
+           not cached, it is retrieved from the database.  If the object is 
+           cached, it is refreshed with the latest version. See 
+           OCIObjectRefresh() for more information about refreshing.
+
+        3) If option is OCI_PIN_RECENT (pin recent), if the object is loaded
+           into the cache in the current transaction, the object is returned.
+           If the object is not loaded in the current transaction, the object
+           is refreshed from the server.
+
+        FOR TRANSIENT OBJECTS:
+
+        This function will return an error if the transient object has already 
+        been freed. This function does not return an error if an exclusive 
+        lock is specified in the lock option. 
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*------------------------------ OCIObjectUnpin -----------------------------*/
+sword OCIObjectUnpin(    OCIEnv *env, OCIError *err, dvoid *object    );
+/*
+   NAME: OCIObjectUnpin - OCI unpin a referenceable object
+   PARAMETERS:
+        env   (IN/OUT) - OCI environment handle initialized in object mode
+        err   (IN/OUT) - error handle. If there is an error, it is
+                         recorded in 'err' and this function returns OCI_ERROR.
+                         The error recorded in 'err' can be retrieved by 
+                         calling OCIErrorGet().
+        object    (IN) - pointer to an object
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified object must be pinned.
+   DESCRIPTION:
+        This function unpins an object.  An object is completely unpinned when 
+          1) the object was unpinned N times after it has been pinned N times
+             (by calling OCIObjectPin()).
+          2) it is the end of the pin duration
+          3) the function OCIObjectPinCountReset() is called 
+
+        There is a pin count associated with each object which is incremented
+        whenever an object is pinned. When the pin count of the object is zero,
+        the object is said to be completely unpinned. An unpinned object can
+        be freed without error.
+
+        FOR PERSISTENT OBJECTS:
+        When a persistent object is completely unpinned, it becomes a candidate
+        for aging. The memory of an object is freed when it is aged out. Aging
+        is used to maximize the utilization of memory.  An dirty object cannot 
+        be aged out unless it is flushed.
+
+        FOR TRANSIENT OBJECTS:
+        The pin count of the object is decremented. A transient can be freed
+        only at the end of its allocation duration or when it is explicitly
+        deleted by calling OCIObjectFree().
+
+        FOR VALUE:
+        This function will return an error for value.
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*---------------------------- OCIObjectPinCountReset -----------------------*/
+sword OCIObjectPinCountReset(    OCIEnv *env, OCIError *err, dvoid *object   );
+/*
+   NAME: OCIObjectPinCountReset - OCI resets the pin count of a referenceable
+                                  object
+   PARAMETERS:
+        env   (IN/OUT) - OCI environment handle initialized in object mode
+        err   (IN/OUT) - error handle. If there is an error, it is
+                         recorded in 'err' and this function returns OCI_ERROR.
+                         The error recorded in 'err' can be retrieved by
+                         calling OCIErrorGet().
+        object    (IN) - pointer to an object
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified object must be pinned.
+   DESCRIPTION:
+        This function completely unpins an object.  When an object is 
+        completely unpinned, it can be freed without error.  
+
+        FOR PERSISTENT OBJECTS:
+        When a persistent object is completely unpinned, it becomes a candidate
+        for aging. The memory of an object is freed when it is aged out. Aging
+        is used to maximize the utilization of memory.  An dirty object cannot 
+        be aged out unless it is flushed.
+
+        FOR TRANSIENT OBJECTS:
+        The pin count of the object is decremented. A transient can be freed
+        only at the end of its allocation duration or when it is explicitly
+        freed by calling OCIObjectFree().
+
+        FOR VALUE:
+        This function will return an error for value.
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*--------------------------- OCIObjectLock ---------------------------------*/
+sword OCIObjectLock(    OCIEnv *env, OCIError *err, dvoid *object    );
+/*
+   NAME: OCIObjectLock - OCI lock a persistent object
+   PARAMETERS:
+        env   (IN/OUT) - OCI environment handle initialized in object mode
+        err   (IN/OUT) - error handle. If there is an error, it is
+                         recorded in 'err' and this function returns OCI_ERROR.
+                         The error recorded in 'err' can be retrieved by
+                         calling OCIErrorGet().
+        object    (IN) - pointer to the persistent object 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified object must be pinned.
+   DESCRIPTION:
+        This function locks a persistent object at the server. Unlike
+        OCIObjectLockNoWait() this function waits if another user currently
+        holds a lock on the desired object. This function
+        returns an error if:
+          1) the object is non-existent.
+
+        This function will return an error for transient objects and values.
+        The lock of an object is released at the end of a transaction.
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+*/
+
+/*------------------------ OCIObjectLockNoWait ------------------------------*/
+sword OCIObjectLockNoWait(    OCIEnv *env, OCIError *err, dvoid *object    );
+/*
+   NAME: OCIObjectLockNoWait - OCI lock a persistent object, do not wait for
+                               the lock, return error if lock not available
+   PARAMETERS:
+        env   (IN/OUT) - OCI environment handle initialized in object mode
+        err   (IN/OUT) - error handle. If there is an error, it is
+                         recorded in 'err' and this function returns OCI_ERROR.
+                         The error recorded in 'err' can be retrieved by
+                         calling OCIErrorGet().
+        object    (IN) - pointer to the persistent object 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified object must be pinned.
+   DESCRIPTION:
+        This function locks a persistent object at the server. Unlike
+        OCIObjectLock() this function will not wait if another user holds
+        the lock on the desired object. This function returns an error if:
+          1) the object is non-existent.
+          2) the object is currently locked by another user in which
+             case this function returns with an error.
+
+        This function will return an error for transient objects and values.
+        The lock of an object is released at the end of a transaction.
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+*/
+
+/*--------------------------- OCIObjectMarkUpdate ---------------------------*/
+sword OCIObjectMarkUpdate(    OCIEnv *env, OCIError *err, dvoid *object    );
+/*
+   NAME: OCIObjectMarkUpdate - OCI marks an object as updated
+   PARAMETERS:
+        env   (IN/OUT) - OCI environment handle initialized in object mode
+        err   (IN/OUT) - error handle. If there is an error, it is
+                         recorded in 'err' and this function returns OCI_ERROR.
+                         The error recorded in 'err' can be retrieved by
+                         calling OCIErrorGet().
+        object    (IN) - pointer to the persistent object 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified object must be pinned.
+   DESCRIPTION:
+        FOR PERSISTENT OBJECTS:
+        This function marks the specified persistent object as updated. The
+        persistent objects will be written to the server when the object cache
+        is flushed.  The object is not locked or flushed by this function. It
+        is an error to update a deleted object.  
+
+        After an object is marked updated and flushed, this function must be
+        called again to mark the object as updated if it has been dirtied
+        after it is being flushed.
+
+        FOR TRANSIENT OBJECTS:
+        This function marks the specified transient object as updated. The
+        transient objects will NOT be written to the server. It is an error
+        to update a deleted object.
+
+        FOR VALUES:
+        It is an no-op for values.
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*----------------------------- OCIObjectUnmark -----------------------------*/
+sword OCIObjectUnmark(    OCIEnv *env, OCIError *err, dvoid *object    );
+/*
+   NAME: OCIObjectUnmark - OCI unmarks an object 
+   PARAMETERS:
+        env   (IN/OUT) - OCI environment handle initialized in object mode
+        err   (IN/OUT) - error handle. If there is an error, it is
+                         recorded in 'err' and this function returns OCI_ERROR.
+                         The error recorded in 'err' can be retrieved by
+                         calling OCIErrorGet().
+        object    (IN) - pointer to the persistent object
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified object must be pinned.
+   DESCRIPTION:
+        FOR PERSISTENT OBJECTS AND TRANSIENT OBJECTS:
+        This function unmarks the specified persistent object as dirty. Changes
+        that are made to the object will not be written to the server. If the
+        object is marked locked, it remains marked locked.  The changes that
+        have already made to the object will not be undone implicitly. 
+ 
+        FOR VALUES:
+        It is an no-op for values.
+ 
+   RETURNS:
+        if environment handle or error handle is null, return
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS.
+        if operation fails, return OCI_ERROR.
+ */
+
+/*----------------------------- OCIObjectUnmarkByRef ------------------------*/
+sword OCIObjectUnmarkByRef(    OCIEnv *env, OCIError *err, OCIRef *ref    );
+/*
+   NAME: OCIObjectUnmarkByRef - OCI unmarks an object by Ref
+   PARAMETERS:
+        env   (IN/OUT) - OCI environment handle initialized in object mode
+        err   (IN/OUT) - error handle. If there is an error, it is
+                         recorded in 'err' and this function returns OCI_ERROR.
+                         The error recorded in 'err' can be retrieved by
+                         calling OCIErrorGet().
+        ref   (IN) - reference of the object
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified object must be pinned.
+   DESCRIPTION:
+        FOR PERSISTENT OBJECTS AND TRANSIENT OBJECTS:
+        This function unmarks the specified persistent object as dirty. Changes
+        that are made to the object will not be written to the server. If the
+        object is marked locked, it remains marked locked.  The changes that
+        have already made to the object will not be undone implicitly.
+ 
+        FOR VALUES:
+        It is an no-op for values.
+ 
+   RETURNS:
+        if environment handle or error handle is null, return
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS.
+        if operation fails, return OCI_ERROR.
+ */
+
+/*--------------------------- OCIObjectFree ---------------------------------*/
+sword OCIObjectFree(    OCIEnv *env, OCIError *err, dvoid *instance, 
+                        ub2 flags   );
+/*
+   NAME: OCIObjectFree - OCI free (and unpin) an standalone instance 
+   PARAMETERS:
+        env    (IN/OUT) - OCI environment handle initialized in object mode
+        err    (IN/OUT) - error handle. If there is an error, it is
+                          recorded in 'err' and this function returns 
+                          OCI_ERROR.  The error recorded in 'err' can be 
+                          retrieved by calling OCIErrorGet().
+        instance   (IN) - pointer to a standalone instance.
+        flags      (IN) - If OCI_OBJECT_FREE_FORCE is set, free the object
+                          even if it is pinned or dirty.
+                          If OCI_OBJECT_FREE_NONULL is set, the null
+                          structure will not be freed. 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The instance to be freed must be standalone.
+        - If the instance is a referenceable object, the object must be pinned.
+   DESCRIPTION:
+        This function deallocates all the memory allocated for an OTS instance,
+        including the null structure.
+
+        FOR PERSISTENT OBJECTS:
+        This function will return an error if the client is attempting to free 
+        a dirty persistent object that has not been flushed. The client should 
+        either flush the persistent object or set the parameter 'flag' to  
+        OCI_OBJECT_FREE_FORCE.
+
+        This function will call OCIObjectUnpin() once to check if the object 
+        can be completely unpin. If it succeeds, the rest of the function will 
+        proceed to free the object.  If it fails, then an error is returned 
+        unless the parameter 'flag' is set to OCI_OBJECT_FREE_FORCE.
+ 
+        Freeing a persistent object in memory will not change the persistent 
+        state of that object at the server.  For example, the object will 
+        remain locked after the object is freed.
+
+        FOR TRANSIENT OBJECTS:
+
+        This function will call OCIObjectUnpin() once to check if the object 
+        can be completely unpin. If it succeeds, the rest of the function will 
+        proceed to free the object.  If it fails, then an error is returned 
+        unless the parameter 'flag' is set to OCI_OBJECT_FREE_FORCE. 
+
+        FOR VALUES:
+        The memory of the object is freed immediately. 
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+*/
+
+/*----------------------- OCIObjectMarkDeleteByRef --------------------------*/
+sword OCIObjectMarkDeleteByRef(    OCIEnv *env, OCIError *err, 
+                                   OCIRef *object_ref);
+/*
+   NAME: OCIObjectMarkDeleteByRef - OCI "delete" (and unpin) an object given
+                                    a reference
+   PARAMETERS:
+        env     (IN/OUT) - OCI environment handle initialized in object mode
+        err     (IN/OUT) - error handle. If there is an error, it is
+                           recorded in 'err' and this function returns 
+                           OCI_ERROR.  The error recorded in 'err' can be 
+                           retrieved by calling OCIErrorGet().
+        object_ref  (IN) - ref of the object to be deleted
+
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+   DESCRIPTION:
+        This function marks the object designated by 'object_ref' as deleted.
+
+        FOR PERSISTENT OBJECTS:
+        If the object is not loaded, then a temporary object is created and is 
+        marked deleted. Otherwise, the object is marked deleted.  
+
+        The object is deleted in the server when the object is flushed.
+
+        FOR TRANSIENT OBJECTS:
+        The object is marked deleted.  The object is not freed until it is
+        unpinned.
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*--------------------------- OCIObjectMarkDelete ---------------------------*/
+sword OCIObjectMarkDelete(    OCIEnv *env, OCIError *err, dvoid *instance    );
+/*
+   NAME: OCIObjectMarkDelete - OCI "delete" an instance given a Pointer 
+   PARAMETERS:
+        env    (IN/OUT) - OCI environment handle initialized in object mode
+        err    (IN/OUT) - error handle. If there is an error, it is
+                          recorded in 'err' and this function returns 
+                          OCI_ERROR.  The error recorded in 'err' can be 
+                          retrieved by calling OCIErrorGet().
+        instance   (IN) - pointer to the instance 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The instance must be standalone.
+        - If the instance is a referenceable object, then it must be pinned.
+   DESCRIPTION:
+
+        FOR PERSISTENT OBJECTS:
+        The object is marked deleted.  The memory of the object is not freed.
+        The object is deleted in the server when the object is flushed.
+
+        FOR TRANSIENT OBJECTS:
+        The object is marked deleted.  The memory of the object is not freed.
+
+        FOR VALUES: 
+        This function frees a value immediately. 
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*---------------------------- OCIObjectFlush -------------------------------*/
+sword OCIObjectFlush(    OCIEnv *env, OCIError *err, dvoid *object    );
+/*
+   NAME: OCIObjectFlush - OCI flush a persistent object
+   PARAMETERS:
+        env    (IN/OUT) - OCI environment handle initialized in object mode
+        err    (IN/OUT) - error handle. If there is an error, it is
+                          recorded in 'err' and this function returns 
+                          OCI_ERROR.  The error recorded in 'err' can be 
+                          retrieved by calling OCIErrorGet().
+        object     (IN) - pointer to the persistent object 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified object must be pinned.
+   DESCRIPTION:
+        This function flushes a modified persistent object to the server.
+        An exclusive lock is obtained implicitly for the object when flushed.
+
+        When the object is written to the server, triggers may be fired.
+        Objects can be modified by the triggers at the server.  To keep the  
+        objects in the object cache being coherent with the database, the
+        clients can free or refresh the objects in the cache. 
+
+        This function will return an error for transient objects and values.
+        
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*------------------------ OCIObjectRefresh ---------------------------------*/
+sword OCIObjectRefresh(    OCIEnv *env, OCIError *err, dvoid *object    );
+/*
+   NAME: OCIObjectRefresh - OCI refresh a persistent object
+   PARAMETERS:
+        env    (IN/OUT) - OCI environment handle initialized in object mode
+        err    (IN/OUT) - error handle. If there is an error, it is
+                          recorded in 'err' and this function returns 
+                          OCI_ERROR.  The error recorded in 'err' can be 
+                          retrieved by calling OCIErrorGet().
+        object     (IN) - pointer to the persistent object 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified object must be pinned.
+   DESCRIPTION:
+        This function refreshes an unmarked object with data retrieved from the
+        latest snapshot in the server. An object should be refreshed when the 
+        objects in the cache are inconsistent with the objects at 
+        the server:
+        1) When an object is flushed to the server, triggers can be fired to
+           modify more objects in the server.  The same objects (modified by 
+           the triggers) in the object cache become obsolete.
+        2) When the user issues a SQL or executes a PL/SQL procedure to modify
+           any object in the server, the same object in the cache becomes
+           obsolete.
+
+        The object that is refreshed will be 'replaced-in-place'. When an
+        object is 'replaced-in-place', the top level memory of the object will 
+        be reused so that new data can be loaded into the same memory address. 
+        The top level memory of the null structre is also reused. Unlike the
+        top level memory chunk, the secondary memory chunks may be resized and
+        reallocated.  The client should be careful when holding onto a pointer 
+        to the secondary memory chunk (e.g. assigning the address of a 
+        secondary memory to a local variable), since this pointer can become 
+        invalid after the object is refreshed.
+
+        The object state will be modified as followed after being refreshed: 
+          - existent : set to appropriate value
+          - pinned   : unchanged 
+          - allocation duration : unchanged 
+          - pin duration : unchanged 
+        
+        This function is an no-op for transient objects or values.
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*---------------------------- OCIObjectCopy --------------------------------*/
+sword OCIObjectCopy(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+                        dvoid *source, dvoid *null_source,
+                        dvoid *target, dvoid *null_target, OCIType *tdo, 
+                        OCIDuration duration, ub1 option    );
+/*
+   NAME: OCIObjectCopy - OCI copy one instance to another
+   PARAMETERS:
+        env     (IN/OUT) - OCI environment handle initialized in object mode
+        err     (IN/OUT) - error handle. If there is an error, it is
+                           recorded in 'err' and this function returns 
+                           OCI_ERROR.  The error recorded in 'err' can be 
+                           retrieved by calling OCIErrorGet().
+        svc         (IN) - OCI service context handle
+        source      (IN) - pointer to the source instance 
+        null_source (IN) - pointer to the null structure of the source
+        target      (IN) - pointer to the target instance
+        null_target (IN) - pointer to the null structure of the target 
+        tdo         (IN) - the TDO for both source and target
+        duration    (IN) - allocation duration of the target memory
+        option      (IN) - specify the copy option:
+                        OROOCOSFN - Set Reference to Null. All references
+                        in the source will not be copied to the target. The
+                        references in the target are set to null. 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - If source or target is referenceable, it must be pinned.
+        - The target or the containing instance of the target must be already
+          be instantiated (e.g. created by OCIObjectNew()).
+        - The source and target instances must be of the same type. If the
+          source and target are located in a different databases, then the
+          same type must exist in both databases.
+   DESCRIPTION:
+        This function copies the contents of the 'source' instance to the
+        'target' instance. This function performs a deep-copy such that the 
+        data that is copied/duplicated include:
+        a) all the top level attributes (see the exceptions below)
+        b) all the secondary memory (of the source) that is reachable from the
+           top level attributes.
+        c) the null structure of the instance
+
+        Memory is allocated with the specified allocation duration. 
+
+        Certain data items are not copied: 
+        a) If the option OCI_OBJECTCOPY_NOREF is specified, then all references
+           in the source are not copied. Instead, the references in the target
+           are set to null.
+        b) If the attribute is a LOB, then it is set to null.
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*---------------------------- OCIObjectGetTypeRef --------------------------*/
+sword OCIObjectGetTypeRef(    OCIEnv *env, OCIError *err, dvoid *instance, 
+                              OCIRef *type_ref    );
+/*
+   NAME: OCIObjectGetTypeRef - get the type reference of a standalone object
+   PARAMETERS:
+        env   (IN/OUT) - OCI environment handle initialized in object mode
+        err   (IN/OUT) - error handle. If there is an error, it is
+                         recorded in 'err' and this function returns 
+                         OCI_ERROR.  The error recorded in 'err' can be 
+                         retrieved by calling OCIErrorGet().
+        instance  (IN) - pointer to an standalone instance 
+        type_ref (OUT) - reference to the type of the object.  The reference 
+                         must already be allocated.
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The instance must be standalone.
+        - If the object is referenceable, the specified object must be pinned.
+        - The reference must already be allocated.
+   DESCRIPTION:
+        This function returns a reference to the TDO of a standalone instance. 
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*--------------------------- OCIObjectGetObjectRef -------------------------*/
+sword OCIObjectGetObjectRef(    OCIEnv *env, OCIError *err, dvoid *object, 
+                                OCIRef *object_ref    );
+/*
+   NAME: OCIObjectGetObjectRef - OCI get the object reference of an 
+                                 referenceable object
+   PARAMETERS:
+        env     (IN/OUT) - OCI environment handle initialized in object mode
+        err     (IN/OUT) - error handle. If there is an error, it is
+                           recorded in 'err' and this function returns 
+                           OCI_ERROR.  The error recorded in 'err' can be 
+                           retrieved by calling OCIErrorGet().
+        object      (IN) - pointer to a persistent object
+        object_ref (OUT) - reference of the given object. The reference must 
+                           already be allocated.
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified object must be pinned.
+        - The reference must already be allocated.
+   DESCRIPTION:
+        This function returns a reference to the given object.  It returns an 
+        error for values. 
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*--------------------------- OCIObjectMakeObjectRef -----------------------*/
+sword OCIObjectMakeObjectRef(    OCIEnv *env, OCIError *err, 
+                                 CONST OCISvcCtx *svc, dvoid * table,
+                                 dvoid **values, ub4 array_len, 
+                                 OCIRef *object_ref    );
+/*
+   NAME: OCIObjectMakeObjectRef - OCI Create an object reference to a 
+                                 referenceable object.
+   PARAMETERS:
+        env     (IN/OUT) - OCI environment handle initialized in object mode
+        err     (IN/OUT) - error handle. If there is an error, it is
+                           recorded in 'err' and this function returns 
+                           OCI_ERROR.  The error recorded in 'err' can be 
+                           retrieved by calling OCIErrorGet().
+        svc         (IN) - the service context
+        table       (IN) - A pointer to the table object (must be pinned)
+        attrlist    (IN) - A list of values (OCI type values) from which
+                           the ref is to be created.
+        attrcnt     (IN)  - The length of the attrlist array. 
+        object_ref (OUT) - reference of the given object. The reference must 
+                           already be allocated. 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified table object must be pinned.
+        - The reference must already be allocated.
+   DESCRIPTION:
+        This function creates a reference given the values that make up the 
+        reference and also a pointer to the table object. 
+        Based on the table's OID property, whether it is a pk based OID or
+        a system generated OID, the function creates a sys-generated REF or
+        a pk based REF.
+        In case of system generated REFs pass in a OCIRaw which is 16 bytes
+        long contatining the sys generated OID.
+        In case of PK refs pass in the OCI equivalent for numbers, chars etc..
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*--------------------------- OCIObjectGetPrimaryKeyTypeRef --------------- */ 
+sword OCIObjectGetPrimaryKeyTypeRef( OCIEnv *env, OCIError *err,
+                                     CONST OCISvcCtx *svc, dvoid *table, 
+                                     OCIRef *type_ref );
+/*
+   NAME: OCIObjectGetPrimaryKeyTypeRef - OCI get the REF to the pk OID type 
+   PARAMETERS:
+        env     (IN/OUT) - OCI environment handle initialized in object mode
+        err     (IN/OUT) - error handle. If there is an error, it is
+                           recorded in 'err' and this function returns 
+                           OCI_ERROR.  The error recorded in 'err' can be 
+                           retrieved by calling OCIErrorGet().
+        svc     (IN)     - the service context 
+        table   (IN)     - pointer to the table object
+        type_ref   (OUT) - reference of the pk type. The reference must 
+                           already be allocated.
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The specified table object must be pinned.
+        - The reference must already be allocated.
+   DESCRIPTION:
+        This function returns a reference to the pk type.  It returns an 
+        error for values.  If the table is not a Pk oid table/view, then
+        it returns error.
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*-------------------------- OCIObjectGetInd --------------------------------*/
+sword OCIObjectGetInd(    OCIEnv *env, OCIError *err, dvoid *instance, 
+                          dvoid **null_struct    );
+/*
+   NAME: OCIObjectGetInd - OCI get the null structure of a standalone object  
+   PARAMETERS:
+        env     (IN/OUT) - OCI environment handle initialized in object mode
+        err     (IN/OUT) - error handle. If there is an error, it is
+                           recorded in 'err' and this function returns 
+                           OCI_ERROR.  The error recorded in 'err' can be 
+                           retrieved by calling OCIErrorGet().
+        instance      (IN) - pointer to the instance 
+        null_struct (OUT) - null structure 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The object must be standalone.
+        - If the object is referenceable, the specified object must be pinned.
+   DESCRIPTION:
+        This function returns the null structure of an instance. This function
+        will allocate the top level memory of the null structure if it is not
+        already allocated. If an null structure cannot be allocated for the 
+        instance, then an error is returned. This function only works for 
+        ADT or row type instance. 
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*------------------------- OCIObjectExists --------------------------------*/
+sword OCIObjectExists(OCIEnv *env, OCIError *err, dvoid *ins, boolean *exist); 
+/*
+   NAME: OCIObjectExist - OCI checks if the object exists 
+   PARAMETERS:
+        env       (IN/OUT) - OCI environment handle initialized in object mode
+        err       (IN/OUT) - error handle. If there is an error, it is
+                             recorded in 'err' and this function returns 
+                             OCI_ERROR.  The error recorded in 'err' can be 
+                             retrieved by calling OCIErrorGet().
+        ins           (IN) - pointer to an instance 
+        exist        (OUT) - return TRUE if the object exists
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The object must be standalone.
+        - if object is a referenceable, it must be pinned.
+   DESCRIPTION:
+        This function returns the existence of an instance. If the instance
+        is a value, this function always returns TRUE.
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*------------------------- OCIObjectGetProperty ---------------------------*/
+sword OCIObjectGetProperty(OCIEnv *envh, OCIError *errh, CONST dvoid *obj, 
+                           OCIObjectPropId propertyId,
+                           dvoid *property, ub4 *size );
+/*
+   NAME: OCIObjectGetProperty - OCIObject Get Property of given object
+   PARAMETERS:
+        env       (IN/OUT) - OCI environment handle initialized in object mode
+        err       (IN/OUT) - error handle. If there is an error, it is
+                             recorded in 'err' and this function returns
+                             OCI_ERROR.  The error recorded in 'err' can be
+                             retrieved by calling OCIErrorGet().
+        obj           (IN) - object whose property is returned
+        propertyId    (IN) - id which identifies the desired property
+        property     (OUT) - buffer into which the desired property is
+                             copied
+        size      (IN/OUT) - on input specifies the size of the property buffer
+                             passed by caller, on output will contain the 
+                             size in bytes of the property returned.
+                             This parameter is required for string type 
+                             properties only (e.g OCI_OBJECTPROP_SCHEMA,
+                             OCI_OBJECTPROP_TABLE). For non-string
+                             properties this parameter is ignored since
+                             the size is fixed.
+   DESCRIPTION:
+        This function returns the specified property of the object.
+        The desired property is identified by 'propertyId'. The property
+        value is copied into 'property' and for string typed properties
+        the string size is returned via 'size'. 
+        
+        Objects are classified as persistent, transient and value
+        depending upon the lifetime and referenceability of the object.
+        Some of the properties are applicable only to persistent
+        objects and some others only apply to persistent and 
+        transient objects. An error is returned if the user tries to 
+        get a property which in not applicable to the given object. 
+        To avoid such an error, the user should first check whether
+        the object is persistent or transient or value 
+        (OCI_OBJECTPROP_LIFETIME property) and then appropriately
+        query for other properties.
+
+        The different property ids and the corresponding type of 
+        'property' argument is given below.
+
+          OCI_OBJECTPROP_LIFETIME 
+            This identifies whether the given object is a persistent
+            object (OCI_OBJECT_PERSISTENT) or a 
+            transient object (OCI_OBJECT_TRANSIENT) or a
+            value instance (OCI_OBJECT_VALUE).
+            'property' argument must be a pointer to a variable of 
+            type OCIObjectLifetime.
+            
+          OCI_OBJECTPROP_SCHEMA
+            This returns the schema name of the table in which the 
+            object exists. An error is returned if the given object 
+            points to a transient instance or a value. If the input 
+            buffer is not big enough to hold the schema name an error 
+            is returned, the error message will communicate the 
+            required size. Upon success, the size of the returned 
+            schema name in bytes is returned via 'size'.
+            'property' argument must be an array of type text and 'size'
+            should be set to size of array in bytes by the caller.
+
+          OCI_OBJECTPROP_TABLE
+            This returns the table name in which the object exists. An 
+            error is returned if the given object points to a 
+            transient instance or a value. If the input buffer is not 
+            big enough to hold the table name an error is returned, 
+            the error message will communicate the required size. Upon 
+            success, the size of the returned table name in bytes is 
+            returned via 'size'. 'property' argument must be an array 
+            of type text and 'size' should be set to size of array in 
+            bytes by the caller.
+            
+          OCI_OBJECTPROP_PIN_DURATION
+            This returns the pin duration of the object.
+            An error is returned if the given object points to a value 
+            instance. Valid pin durations are: OCI_DURATION_SESSION and
+            OCI_DURATION_TRANS.
+            'property' argument must be a pointer to a variable of type 
+            OCIDuration.
+            
+          OCI_OBJECTPROP_ALLOC_DURATION
+            This returns the allocation duration of the object.
+            Valid allocation durations are: OCI_DURATION_SESSION and
+            OCI_DURATION_TRANS.
+            'property' argument must be a pointer to a variable of type 
+            OCIDuration.
+            
+          OCI_OBJECTPROP_LOCK
+            This returns the lock status of the 
+            object. The possible lock status is enumerated by OCILockOpt.
+            An error is returned if the given object points to a transient
+            or value instance.
+            'property' argument must be a pointer to a variable of 
+            type OCILockOpt.
+            Note, the lock status of an object can also be retrieved by
+            calling OCIObjectIsLocked().
+
+          OCI_OBJECTPROP_MARKSTATUS
+            This returns the status flag which indicates whether the
+            object is a new object, updated object and/or deleted object.
+            The following macros can be used to test the mark status
+            flag:
+
+              OCI_OBJECT_IS_UPDATED(flag)
+              OCI_OBJECT_IS_DELETED(flag)
+              OCI_OBJECT_IS_NEW(flag)
+              OCI_OBJECT_IS_DIRTY(flag)
+
+            An object is dirty if it is a new object or marked deleted or 
+            marked updated.
+            An error is returned if the given object points to a transient
+            or value instance. 'property' argument must be of type 
+            OCIObjectMarkStatus.
+            
+          OCI_OBJECTPROP_VIEW
+            This identifies whether the specified object is a view object
+            or not. If property value returned is TRUE, it indicates the
+            object is a view otherwise it is not.
+            'property' argument must be of type boolean.
+
+   RETURNS:
+        if environment handle or error handle is null, return
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS.
+        if operation fails, return OCI_ERROR. Possible errors are TBD
+ */
+
+/*---------------------------- OCIObjectIsLocked --------------------------*/
+sword OCIObjectIsLocked(    OCIEnv *env, OCIError *err, dvoid *ins,
+                              boolean *lock);
+/*
+   NAME: OCIObjectIsLocked - OCI get the lock status of a standalone object
+   PARAMETERS:
+        env       (IN/OUT) - OCI environment handle initialized in object mode
+        err       (IN/OUT) - error handle. If there is an error, it is
+                             recorded in 'err' and this function returns
+                             OCI_ERROR.  The error recorded in 'err' can be
+                             retrieved by calling OCIErrorGet().
+        ins           (IN) - pointer to an instance
+        lock         (OUT) - return value for the lock status.
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The instance must be standalone.
+        - If the object is referenceable, the specified object must be pinned.
+   DESCRIPTION:
+        This function returns the lock status of an instance. If the instance
+        is a value, this function always returns FALSE.
+   RETURNS:
+        if environment handle or error handle is null, return
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS.
+        if operation fails, return OCI_ERROR.
+ */
+
+/*------------------------- OCIObjectIsDirty ------------------------------*/
+sword OCIObjectIsDirty(    OCIEnv *env, OCIError *err, dvoid *ins,
+                           boolean *dirty);
+/*
+   NAME: OCIObjectIsDirty - OCI get the dirty status of a standalone object
+   PARAMETERS:
+        env       (IN/OUT) - OCI environment handle initialized in object mode
+        err       (IN/OUT) - error handle. If there is an error, it is
+                             recorded in 'err' and this function returns
+                             OCI_ERROR.  The error recorded in 'err' can be
+                             retrieved by calling OCIErrorGet().
+        ins           (IN) - pointer to an instance
+        dirty        (OUT) - return value for the dirty status.
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+        - The instance must be standalone.
+        - if instance is an object, the instance must be pinned.
+   DESCRIPTION:
+        This function returns the dirty status of an instance. If the instance
+        is a value, this function always returns FALSE.
+   RETURNS:
+        if environment handle or error handle is null, return
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS.
+        if operation fails, return OCI_ERROR.
+ */
+
+/*--------------------------- OCIObjectPinTable -----------------------------*/
+sword OCIObjectPinTable(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+                  CONST oratext *schema_name, 
+                  ub4 s_n_length, CONST oratext *object_name, ub4 o_n_length, 
+                  CONST OCIRef *scope_obj_ref, OCIDuration pin_duration, 
+                  dvoid** object    );
+/*
+   NAME: OCIObjectPinTable - OCI get table object 
+   PARAMETERS:
+        env       (IN/OUT) - OCI environment handle initialized in object mode
+        err       (IN/OUT) - error handle. If there is an error, it is
+                             recorded in 'err' and this function returns 
+                             OCI_ERROR.  The error recorded in 'err' can be 
+                             retrieved by calling OCIErrorGet().
+        svc                     (IN) - OCI service context handle
+        schema_name   (IN, optional) - schema name of the table 
+        s_n_length    (IN, optional) - length of the schema name
+        object_name   (IN) - name of the table 
+        o_n_length    (IN) - length of the table name
+        scope_obj_ref (IN, optional) - reference of the scoping object
+        pin_duration  (IN) - pin duration. See description in OCIObjectPin(). 
+        object       (OUT) - the pinned table object
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+   DESCRIPTION:
+        This function pin a table object with the specified pin duration. 
+        The client can unpin the object by calling OCIObjectUnpin(). See 
+        OCIObjectPin() and OCIObjectUnpin() for more information about pinning
+        and unpinning. 
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*------------------------- OCIObjectArrayPin -------------------------------*/
+sword OCIObjectArrayPin(OCIEnv *env, OCIError *err, OCIRef **ref_array, 
+                  ub4 array_size, OCIComplexObject **cor_array,
+                  ub4 cor_array_size, OCIPinOpt pin_option, 
+                  OCIDuration pin_duration, OCILockOpt lock, 
+                  dvoid **obj_array, ub4 *pos    );
+/*
+   NAME: OCIObjectArrayPin - ORIO array pin 
+   PARAMETERS:
+        env       (IN/OUT) - OCI environment handle initialized in object mode
+        err       (IN/OUT) - error handle. If there is an error, it is
+                             recorded in 'err' and this function returns 
+                             OCI_ERROR.  The error recorded in 'err' can be 
+                             retrieved by calling OCIErrorGet().
+        ref_array     (IN) - array of references to be pinned 
+        array_size    (IN) - number of elements in the array of references 
+        pin_option    (IN) - pin option. See OCIObjectPin().
+        pin_duration  (IN) - pin duration. See OCIObjectPin(). 
+        lock_option   (IN) - lock option. See OCIObjectPin().
+        obj_array    (OUT) - If this argument is not NULL, the pinned objects 
+                             will be returned in the array. The user must 
+                             allocate this array with element type being 
+                             'dvoid *'. The size of this array is identical to
+                             'array'. 
+        pos          (OUT) - If there is an error, this argument will contain
+                             the element that is causing the error.  Note that
+                             this argument is set to 1 for the first element in
+                             the ref_array. 
+   REQUIRE:
+        - a valid OCI environment handle must be given.
+        - If 'obj_array' is not NULL, then it must already be allocated and
+             the size of 'obj_array' is 'array_size'. 
+   DESCRIPTION:
+        This function pin an array of references.  All the pinned objects are 
+        retrieved from the database in one network roundtrip.  If the user 
+        specifies an output array ('obj_array'), then the address of the 
+        pinned objects will be assigned to the elements in the array. See
+        OCIObjectPin() for more information about pinning.
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*---------------------------------------------------------------------------*/
+/*                           HEAP/CACHE OPERATIONS                           */
+/*---------------------------------------------------------------------------*/
+
+/*--------------------------- OCICacheFlush ---------------------------------*/
+sword OCICacheFlush(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+                  dvoid *context, OCIRef *(*get)(dvoid *context, ub1 *last),
+                  OCIRef **ref  );
+/*
+   NAME: OCICacheFlush - OCI flush persistent objects 
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                      recorded in 'err' and this function returns 
+                      OCI_ERROR.  The error recorded in 'err' can be 
+                      retrieved by calling OCIErrorGet().
+        svc      (IN) [optional] - OCI service context.  If null pointer is
+                      specified, then the dirty objects in all connections
+                      will be flushed.
+        context  (IN) [optional] - specifies an user context that is an 
+                      argument to the client callback function 'get'. This 
+                      parameter is set to NULL if there is no user context.
+        get      (IN) [optional] - an client-defined function which acts an 
+                      iterator to retrieve a batch of dirty objects that need 
+                      to be flushed. If the function is not NULL, this function
+                      will be called to get a reference of a dirty object.  
+                      This is repeated until a null reference is returned by 
+                      the client function or the parameter 'last' is set to 
+                      TRUE. The parameter 'context' is passed to get() 
+                      for each invocation of the client function.  This 
+                      parameter should be NULL if user callback is not given.
+                      If the object that is returned by the client function is
+                      not a dirtied persistent object, the object is ignored.
+                      All the objects that are returned from the client
+                      function must be from newed or pinned the same service 
+                      context, otherwise, an error is signalled. Note that the 
+                      returned objects are flushed in the order in which they
+                      are marked dirty.
+        ref     (OUT) [optional] - if there is an error in flushing the 
+                      objects, (*ref) will point to the object that
+                      is causing the error.  If 'ref' is NULL, then the object 
+                      will not be returned.  If '*ref' is NULL, then a 
+                      reference will be allocated and set to point to the 
+                      object.  If '*ref' is not NULL, then the reference of
+                      the object is copied into the given space. If the
+                      error is not caused by any of the dirtied object,
+                      the given ref is initalized to be a NULL reference
+                      (OCIRefIsNull(*ref) is TRUE).
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+   DESCRIPTION:
+        This function flushes the modified persistent objects from the 
+        environment heap to the server. The objects are flushed in the order 
+        that they are marked updated or deleted. 
+
+        See OCIObjectFlush() for more information about flushing.
+
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*--------------------------- OCICacheRefresh -------------------------------*/
+sword OCICacheRefresh(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+                  OCIRefreshOpt option, dvoid *context,
+                  OCIRef *(*get)(dvoid *context), OCIRef **ref);
+/*
+   NAME: OCICacheRefresh - OCI ReFreSh persistent objects 
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                       recorded in 'err' and this function returns 
+                       OCI_ERROR.  The error recorded in 'err' can be 
+                       retrieved by calling OCIErrorGet().
+        svc     (IN) [optional] - OCI service context.  If null pointer is
+                      specified, then the persistent objects in all connections
+                      will be refreshed. 
+        option   (IN) [optional] - if OCI_REFRESH_LOAD is specified, all
+                      objects that is loaded within the transaction are
+                      refreshed. If the option is OCI_REFERSH_LOAD and the
+                      parameter 'get' is not NULL, this function will ignore
+                      the parameter. 
+        context  (IN) [optional] - specifies an user context that is an 
+                      argument to the client callback function 'get'. This 
+                      parameter is set to NULL if there is no user context.
+        get      (IN) [optional] - an client-defined function which acts an 
+                      iterator to retrieve a batch of objects that need to be
+                      refreshed. If the function is not NULL, this function
+                      will be called to get a reference of an object.  If 
+                      the reference is not NULL, then the object will be 
+                      refreshed.  These steps are repeated until a null 
+                      reference is returned by this function.  The parameter
+                      'context' is passed to get() for each invocation of the
+                      client function.  This parameter should be NULL if user 
+                      callback is not given.
+        ref     (OUT) [optional] - if there is an error in refreshing the
+                      objects, (*ref) will point to the object that
+                      is causing the error.  If 'ref' is NULL, then the object
+                      will not be returned.  If '*ref' is NULL, then a
+                      reference will be allocated and set to point to the
+                      object.  If '*ref' is not NULL, then the reference of
+                      the object is copied into the given space. If the
+                      error is not caused by any of the object,
+                      the given ref is initalized to be a NULL reference
+                      (OCIRefIsNull(*ref) is TRUE).
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+   DESCRIPTION:
+        This function refreshes all pinned persistent objects. All unpinned 
+        persistent objects are freed.  See OCIObjectRefresh() for more 
+        information about refreshing.
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*---------------------------- OCICacheUnpin --------------------------------*/
+sword OCICacheUnpin(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc    );
+/*
+   NAME: OCICacheUnpin - OCI UNPin objects 
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                       recorded in 'err' and this function returns 
+                       OCI_ERROR.  The error recorded in 'err' can be 
+                       retrieved by calling OCIErrorGet().
+        svc     (IN) [optional] - OCI service context. If null pointer is
+                       specified, then the objects in all connections
+                       will be unpinned.
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+   DESCRIPTION:
+        If a connection is specified, this function completely unpins the 
+        persistent objects in that connection. Otherwise, all persistent 
+        objects in the heap are completely unpinned. All transient objects in 
+        the heap are also completely unpinned. See OCIObjectUnpin() for more 
+        information about unpinning.
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+ */
+
+/*----------------------------- OCICacheFree --------------------------------*/
+sword OCICacheFree(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc    ); 
+/*
+   NAME: OCICacheFree - OCI FREe instances 
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                       recorded in 'err' and this function returns 
+                       OCI_ERROR.  The error recorded in 'err' can be 
+                       retrieved by calling OCIErrorGet().
+        svc     (IN) [optional] - OCI service context. If null pointer is
+                       specified, then the objects in all connections
+                       will be freed.
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+   DESCRIPTION:
+        If a connection is specified, this function frees the persistent 
+        objects, transient objects and values allocated for that connection.  
+        Otherwise, all persistent objects, transient objects and values in the 
+        heap are freed. Objects are freed regardless of their pin count.  See 
+        OCIObjectFree() for more information about freeing an instance.
+   RETURNS:
+        if environment handle or error handle is null, return 
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS. 
+        if operation fails, return OCI_ERROR. 
+*/
+
+/*---------------------------- OCICacheUnmark -------------------------------*/
+sword OCICacheUnmark(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc    );
+/*
+   NAME: OCICacheUnmark - OCI Unmark all dirty objects
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                       recorded in 'err' and this function returns
+                       OCI_ERROR.  The error recorded in 'err' can be
+                       retrieved by calling OCIErrorGet().
+        svc     (IN) [optional] - OCI service context. If null pointer is
+                       specified, then the objects in all connections
+                       will be unmarked. 
+   REQUIRES:
+        - a valid OCI environment handle must be given.
+   DESCRIPTION:
+        If a connection is specified, this function unmarks all dirty objects 
+        in that connection.  Otherwise, all dirty objects in the cache are
+        unmarked. See OCIObjectUnmark() for more information about unmarking
+        an object.
+   RETURNS:
+        if environment handle or error handle is null, return
+        OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS.
+        if operation fails, return OCI_ERROR.
+ */
+
+
+sword OCIDurationBegin(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+                           OCIDuration parent, OCIDuration *dur    );
+/*
+   NAME: OCIDurationBegin - OCI DURATION BEGIN
+   PARAMETERS:
+        env  (IN/OUT) - OCI environment handle initialized in object mode
+                        This should be passed NULL, when cartridge services
+                        are to be used.
+        err  (IN/OUT) - error handle. If there is an error, it is
+                        recorded in 'err' and this function returns OCI_ERROR.
+                        The error recorded in 'err' can be retrieved by calling
+                       OCIErrorGet().
+        svc  (IN/OUT) - OCI service handle.  
+        parent   (IN) - parent for the duration to be started.
+        dur     (OUT) - newly created user duration 
+   REQUIRES:
+        - a valid OCI environment handle must be given for non-cartridge
+          services.
+        - For cartridge services, NULL should be given for environment handle
+        - A valid service handle must be given in all cases.
+   DESCRIPTION:
+        This function starts a new user duration.  A user can have multiple
+        active user durations simultaneously. The user durations do not have
+        to be nested.
+ 
+        The object subsystem predefines 3 durations :
+          1) session     - memory allocated with session duration comes from
+                           the UGA heap (OCI_DURATION_SESSION). A session 
+                           duration terminates at the end of the user session.
+          2) transaction - memory allocated with transaction duration comes
+                           from the UGA heap (OCI_DURATION_TRANS). A trans-
+                           action duration terminates at the end of the user
+                           transaction.
+          3) call        - memory allocated with call duration comes from PGA
+                           heap (OCI_DURATION_CALL). A call duration terminates
+                           at the end of the user call.
+ 
+        Each user duration has a parent duration.  A parent duration can be a
+        predefined duration or another user duration.  The relationship between
+        a user duration and its parent duration (child duration) are:
+ 
+         1) An user duration is nested within the parent duration. When its
+             parent duration terminates, the user duration will also terminate.
+         2) The memory allocated with an user duration comes from the heap of
+             its parent duration. For example, if the parent duration of an
+             user duration is call, then the memory allocated with the user
+             duration will also come from the PGA heap.
+
+        This function can be used as both part of cartridge services as well 
+        as without cartridge services.
+        The difference in the function in the case of cartridge and 
+        non-cartridge services is:
+                In case of cartridge services, as descibed above a new user
+        duration is created as a child of the "parent" duration.
+                But when used for non-cartridge purposes, when a pre-defined
+        duration is passed in as parent, it is mapped to the cache duration
+        for that connection (which is created if not already present) and 
+        the new user duration will be child of the cache duration.
+
+   RETURNS:
+        if environment handle and service handle is null or if error 
+        handle is null return OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS.
+        if operation fails, return OCI_ERROR.
+ */
+
+
+sword OCIDurationEnd(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+                         OCIDuration duration    );
+/*
+   NAME: OCIDurationEnd - OCI DURATION END
+   PARAMETERS:
+        env  (IN/OUT) - OCI environment handle initialized in object mode
+                        This should be passed NULL, when cartridge services
+                        are to be used.
+        err  (IN/OUT) - error handle. If there is an error, it is
+                        recorded in 'err' and this function returns OCI_ERROR.
+                        The error recorded in 'err' can be retrieved by calling
+                       OCIErrorGet().
+        svc  (IN/OUT) - OCI service handle.  
+        dur     (OUT) - a previously created user duration using 
+                        OCIDurationBegin()
+   REQUIRES:
+        - a valid OCI environment handle must be given for non-cartridge
+          services.
+        - For cartridge services, NULL should be given for environment handle
+        - A valid service handle must be given in all cases.
+   DESCRIPTION:
+        This function terminates a user duration.  All memory allocated for
+        this duration is freed.
+
+        This function can be used as both part of cartridge services as well 
+        as without cartridge services.  In both cased, the heap duration
+        is freed and all the allocated memory for that duration is freed.
+        The difference in the function in the case of cartridge and 
+        non-cartridge services is:
+                In case of non-cartridge services, if the duration is pre-
+        defined, the associated cache duration (see OCIDurationBegin())
+        is also terminated and the following is done.
+          1) The child durations are terminated.
+          2) All objects pinned for this duration are unpinned.
+          3) All instances allocated for this duration are freed.
+
+                In case of cartridge services, only the heap duration is
+        freed.  All the context entries allocated for that duration are 
+        freed from the context hash table..
+
+   RETURNS:
+        if environment handle and service handle is null or if error 
+        handle is null return OCI_INVALID_HANDLE.
+        if operation suceeds, return OCI_SUCCESS.
+        if operation fails, return OCI_ERROR.
+ */
+
+/******************************************************************************
+**          DO  NOT  USE  THE  FUNCTIONS  BELOW!                             **
+**          UNSUPPORTED INTERFACE                                            **
+**          WILL BE REMOVED/CHANGED IN A FUTURE RELEASE                      **
+******************************************************************************/
+
+sword OCIDurationGetParent(    OCIEnv *env, OCIError *err, 
+                               OCIDuration duration, OCIDuration *parent    );
+
+sword OCIObjectAlwaysLatest(    OCIEnv *env, OCIError *err, dvoid *object    );
+
+sword OCIObjectNotAlwaysLatest(    OCIEnv *env, OCIError *err, 
+                                   dvoid *object    );
+
+sword OCIObjectFlushRefresh(    OCIEnv *env, OCIError *err, dvoid *object);
+
+sword OCIObjectIsLoaded(    OCIEnv *env, OCIError *err, dvoid *ins, 
+                              boolean *load);
+
+sword OCIObjectIsDirtied(    OCIEnv *env, OCIError *err, dvoid *ins,
+                              boolean *dirty);
+
+sword OCICacheGetObjects(       OCIEnv *env, OCIError *err,
+                                CONST OCISvcCtx *svc,
+                                OCIObjectProperty property,
+                                dvoid *client_context,
+                                void (*client_callback)(
+                                    dvoid *client_context,
+                                    dvoid *object  ));
+
+sword OCICacheRegister(      OCIEnv *env, OCIError *err,
+                             OCIObjectEvent event,
+                             dvoid *client_context,
+                             void (*client_callback)(
+                                    dvoid *client_context,
+                                    OCIObjectEvent event,
+                                    dvoid *object));
+
+sword OCICacheFlushRefresh(    OCIEnv *env, OCIError *err, 
+                               CONST OCISvcCtx *svc, dvoid *context,
+                               OCIRef *(*get)(dvoid *context, ub1 *last),
+                               OCIRef **ref    );
+
+sword OCIObjectSetData(OCIEnv *env, OCIError *err, dvoid *obj_hdr, 
+        dvoid *data);
+
+sword OCIObjectGetNewOID(OCIEnv *env, OCIError *err, OCISvcCtx *svc, 
+        ub1 *oid);
+
+
+#endif /* ORI_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/orid.h b/src/terralib/drivers/Oracle/OCI/include/orid.h
new file mode 100644
index 0000000..2c915ff
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/orid.h
@@ -0,0 +1,372 @@
+/* Copyright (c) 1994, 2003, Oracle Corporation.  All rights reserved.  */
+
+/*
+  Author:             Tin Nguyen
+  Date:               02/07/94
+  Source documents:   "Functional Specification for C Object Interface, Object
+                       Management Subsystem", "Oracle C Coding Standards
+                       version 2.2", and the header file template
+  Rule sets:          the generic and .h file rule sets
+  Quality status:     not exited
+  Identification tag: [ one or more letters to identify the .h file ] 
+  Revision code:      [ date of the last revision of the .h file ]
+
+  Note to the user of this header file:
+
+    Anything in this header file that is marked private is not supported and
+    must not be used.  Private sections are included in the header file to 
+    improve internal maintenance.
+
+  NAME
+
+    ORID - Oracle Object Interface for Dynamic Data Access
+
+  DESCRIPTION
+
+    This file contains declarations for C object interface functions including
+    the dynamic object data access operations that allow callers to dynamically
+    access and manipulate objects; these operations include getting and setting
+    attributes of an object.  These dynamic object operations are for accessing
+    and manipulation objects whose types are not known at compile-time.
+
+  RELATED DOCUMENTS
+  
+     Functional Specification for C Object Interface / Object Management System
+
+  PUBLIC FUNCTIONS
+
+    OCIObjectSetAttr - ORID SET attribute value
+    OCIObjectGetAttr - ORID GET attribute value
+
+  PRIVATE FUNCTIONS
+
+    None
+
+  EXAMPLES 
+
+    EXAMPLE 1
+
+    /o
+     o This example illustrates how an interative program can use the dynamic
+     o attribute access to display and modify attributes of an ADT instance.
+     o The interactive program does not know the type of the object at 
+     o compile time.
+     o/
+
+    void display(adt_ref, object, null_struct, names, names_count, 
+                          names_length, indexes, indexes_count)
+    {
+      /o Pin the ADT o/
+      if (OCIObjectPin(env, &adt_ref, OROOPOCUR, OROOPDTRA, OROOLMNON, &adt) 
+            != OROSTASUC)
+         /o error handling code o/ 
+
+      /o 
+       o Call the type manager to obtain all the attributes in the object.
+       o Display the content of each attribute in the ADT instance. If the 
+       o attribute is an array, display each element of the array. If the
+       o attribute is an ADT instance, recursively call this routine to
+       o display the embedded ADT instance.
+       o/ 
+      numAttrs = OCITypeAttrs(env, adt);
+      for (i= 1; i <= numAttrs; i++)
+      {
+         /o get attribute descriptor o/
+         if (ortgabp(env, adt, i, &ado_ref, &ado) != OROSTASUC)
+           /o error handling code o/ 
+
+         /o get attribute name o/
+         names[names_count] = OCITypeElemName(env, ado, 
+                   &names_length[names_count]);
+      
+         /o dynamically get the attr o/
+         if (OCIObjectGetAttr(env, object, null_struct, 0, adt_ref, names, 
+                     names_length, names_count+1, indexes, indexes_count, 0, 
+                     &null, &null_info, &attr) != OROSTASUC)
+            /o error handling code o/  
+
+         /o check if attribute is null o/
+         if (null) continue;
+
+         /o get typecode of attribute o/
+         typecode = OCITypeElemTypeCode(env, ado);
+
+         /o if attribute is a varray, display each element in varray o/
+         if (typecode == OCI_TYPECODE_VARRAY)
+         {
+            /o get the reference to the type of the element of the array o/ 
+            if (OCITypeElemParameterizedTyper(env, ado, &attr_type_ref) 
+               != OROSTASUC)
+               /o error handling code o/ 
+
+            /o get the size of array o/
+            if (orlasiz(env, &attr_type_ref, (orlva *)attr,  
+                         &numElm) != OROSTASUC)
+               /o error handling code o/  
+
+            /o get the typecode of the element of the array o/
+            if (ortty2r(env, attr_type_ref, &typecode) != OROSTASUC)
+               /o error handling code o/  
+
+            /o iterate the array o/
+            for (j=0; j < numElm; j++)
+            {
+              /o get an element in the array o/
+              if (OCIObjectGetAttr(env, attr, null_info, j+1, attr_type_ref,
+                  names, names_length, 0, indexes, 0, 0, &null, &null_info, 
+                  &element) != OROSTASUC)
+                  /o error handling code o/  
+
+              /o check if element is null o/
+              if (null) continue;
+
+              /o if attr is an ADT instance, recursively call this routine o/
+              if (typecode == OCI_TYPECODE_ADT || typecode == 
+                  OCI_TYPECODE_UNNAMEDADT) 
+              {
+                /o display the element as an adt o/
+                display(attr_type_ref, element, null_info, names, lengths, 
+                   0, indexes, 0);
+              }
+      
+              /o if attribute is scalar, print the value to the screen o/
+              else output_to_screen(element, typecode);
+            }
+         }
+
+         /o if attribute is an ADT instance, recursively call this routine o/
+         else if (typecode == OCI_TYPECODE_ADT || typecode == 
+              OCI_TYPECODE_UNNAMEDADT)
+         {
+            /o get the type ref of the attribute o/
+            if (ortgarf(env, ado, &attr_type_ref) != OROSTASUC)
+               /o error handling code o/ 
+
+             display(attr_type_ref, attr, null_info, 0, names, 0, names_length,
+                      indexes, 0);
+         }
+
+         /o if attribute is scalar, print the value to the screen o/
+         else output_to_screen(attr, typecode);
+      }
+    }
+
+    /o ******** main routine *********** o/
+    .... 
+
+    /o 
+     o Allocate the arrays for storing the path expression 
+     o/
+
+    /o get the tdo of type 'long' o/
+    if (orttypget(&env, con, "SYS", sizeof("SYS"), "SINT32", sizeof("SINT32"), 
+          OROOPDSES, &long_ref, &long_tdo) != OROSTASUC)
+          /o error handling code o/
+
+    /o get the tdo of type 'varchar' o/
+    if (orttypget(&env, con, "SYS", sizeof("SYS"), "SQL_VARCHAR2", 
+          sizeof("SQL_VARCHAR2"), OROOPDSES, &vchar_ref, &vchar_tdo) 
+          != OROSTASUC)
+          /o error handling code o/
+
+    /o allocate the varrays for the path expression o/ 
+    if (orlalloc(env, &vchar_ref, MAX_ARR_SIZE, &attr_names) != OROSTASUC)
+       /o error handling code o/ 
+
+    if (orlalloc(env, &long_ref, MAX_ARR_SIZE, &attr_name_lengths) 
+                != OROSTASUC)
+       /o error handling code o/ 
+
+    if (orlalloc(env, &long_ref, MAX_ARR_SIZE, &attr_name_indexes) 
+                != OROSTASUC)
+       /o error handling code o/ 
+
+    /o 
+     o Get an ADT instance. The ref to the ADT instance can be obtained
+     o by through ORI or OSCI. 
+     o/
+    if (OCIObjectPin(env, &obj_ref, OROOPOCUR, OROOPDTRA, OROOLMUPD, &object) 
+          != OROSTASUC)
+       /o error handling code o/ 
+
+    /o get the null structure of the ADT instance o/
+    if (OCIObjectGetInd(gp, object, &null_struct) != OROSTASUC)
+       /o error handling code o/ 
+
+    /o 
+     o Get the type of the ADT instance
+     o/
+
+    /o find out the type of the ADT instance o/
+    if (oriogto(env, object, &adt_ref) != OROSTASUC)
+       /o error handling code o/ 
+
+    /o display the object o/
+    display(adt_ref, object, null_struct, attr_names, 0, attr_names_lengths,
+                     attr_names_indexes, 0);
+
+    /o After the object is displayed, the program waits for the user to 
+     o respond.  The user modifies the values of an attribute and the
+     o program generates a path expression for the attribute and calls 
+     o OCIObjectSetAttr() to set the value. 
+     o/
+
+    if (OCIObjectSetAttr(env, object, null_struct, adt_ref, 
+                (text **)attr_names, (ub4 *)attr_name_lengths, 
+                attr_names_count, (ub4 *)attr_array_indexes, 
+                attr_array_indexes_count, 
+                (dvoid *)0, FALSE, (dvoid *)value) != OROSTASUC)
+       /o error handling code o/ 
+
+    END OF EXAMPLE 1
+
+  NOTES
+
+    This file has been subsetted to contain only the routines that will
+    be in the first release.
+
+  MODIFIED
+    srseshad   03/12/03  - convert oci public api to ansi
+    aahluwal   06/03/02  - bug 2360115
+    bpalaval   02/09/01  - Change text to oratext.
+    whe        09/01/99 -  976457:check __cplusplus for C++ code
+    sthakur    09/18/97 -  collection indexing not supported
+    cxcheng    08/05/97 -  fix compile with short names
+    skrishna   03/18/97 -  fix ifdef for supporting ansi and k&r proto-types
+    cxcheng    02/06/97 -  take out short name support except with SLSHORTNAME
+    cxcheng    10/17/96 -  final renaming of functions
+    jboonleu   10/07/96 -  beautify with OCI long names
+    cxcheng    10/07/96 -  change short names to long names for readability
+    jboonleu   09/27/96 -  fix lint
+    jwijaya    07/03/96 -  add ANSI prototypes
+    jboonleu   04/13/95 -  new interface
+    jwijaya    10/11/94 -  fix the sccs header and add namespace
+    tanguyen   08/22/94 -  fix example 
+    tanguyen   08/09/94 -  remove Sccsid declaration 
+    tanguyen   07/20/94 -  fix OCIObjectSetAttr and OCIObjectGetAttr to 
+                           use position descriptor 
+    tanguyen   07/18/94 -  change 'object' type to become ptr to object 
+    tanguyen   06/30/94 -  Fix the ORID_ORACLE ifdef 
+    tanguyen   06/27/94 -  update to template format 
+    skotsovo   05/12/94 -  replace ado with attribute position 
+    jweisz     05/11/94 -  test new checkin facility 
+    jwijaya    05/05/94 - orienv/ref/typ -> oroenv/ref/typ
+    jwijaya    02/07/94 - Creation
+
+*/
+
+#ifndef ORATYPES
+#include <oratypes.h>
+#endif
+#ifndef ORO_ORACLE
+#include <oro.h>
+#endif
+#ifndef OCI_ORACLE
+#include <oci.h>
+#endif
+
+#ifndef ORID_ORACLE
+#define ORID_ORACLE
+
+#ifdef SLSHORTNAME
+
+#define OCIObjectSetAttr oridset
+#define OCIObjectGetAttr oridget
+
+#endif /* SLSHORTNAME */
+
+/*---------------------------------------------------------------------------*/
+/*                           PUBLIC FUNCTIONS                                */
+/*---------------------------------------------------------------------------*/
+
+/*-------------------------- OCIObjectSetAttr ----------------------------*/
+sword OCIObjectSetAttr(    OCIEnv *env, OCIError *err, dvoid *instance, 
+                  dvoid *null_struct, struct OCIType *tdo, 
+                  CONST oratext **names, CONST ub4 *lengths, 
+                  CONST ub4 name_count, CONST ub4 *indexes, 
+                  CONST ub4 index_count, CONST OCIInd null_status, 
+                  CONST dvoid *attr_null_struct, CONST dvoid *attr_value    );
+/*
+   NAME: OCIObjectSetAttr - ORID SET value
+   PARAMETERS:
+        env  (IN) - OCI environment handle initialized in object mode
+        err  (IN) - error handle. If there is an error, it is
+                        recorded in 'err' and this function returns OCI_ERROR.
+                        The error recorded in 'err' can be retrieved by calling
+                        OCIErrorGet().
+        instance    (IN) - pointer to an ADT instance
+        null_struct (IN) - the null structure of the ADT instance or array
+        tdo         (IN) - pointer to the TDO
+        names       (IN) - array of attribute names. This is used to specify
+                           the names of the attributes in the path expression.
+        lengths     (IN) - array of lengths of attribute names.
+        name_count  (IN) - number of element in the array 'names'.
+        indexes     (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4 *)0.
+        index_count (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4)0.
+        attr_null_status (IN) - the null status of the attribute if the type of
+                                 attribute is primitive.
+        attr_null_struct (IN) - the null structure of an ADT or collection
+                                 attribute.
+        attr_value       (IN) - pointer to the attribute value.
+   REQUIRES:
+   DESCRIPTION:
+        This function set the attribute of the given object with the given 
+        value.  The position of the attribute is specified as a path 
+        expression which is an array of names and an array of indexes. 
+   RETURNS:
+        one of OROSTA*
+   EXAMPLES:
+        For path expression stanford.cs.stu[5].addr, the arrays will look like
+          names = {"stanford", "cs", "stu", "addr"} 
+          lengths = {8, 2, 3, 4}
+          indexes = {5}
+        
+        Also see the above example.
+ */
+
+/*-------------------------- OCIObjectGetAttr ----------------------------*/
+sword OCIObjectGetAttr(    OCIEnv *env, OCIError *err, dvoid *instance, 
+                  dvoid *null_struct, struct OCIType *tdo, 
+                  CONST oratext **names, CONST ub4 *lengths, 
+                  CONST ub4 name_count, CONST ub4 *indexes, 
+                  CONST ub4 index_count, OCIInd *attr_null_status, 
+                  dvoid **attr_null_struct, dvoid **attr_value, 
+                  struct OCIType **attr_tdo    );
+/*
+   NAME: OCIObjectGetAttr - ORID GET value
+   PARAMETERS:
+        env  (IN) - OCI environment handle initialized in object mode
+        err  (IN) - error handle. If there is an error, it is
+                        recorded in 'err' and this function returns OCI_ERROR.
+                        The error recorded in 'err' can be retrieved by calling
+                        OCIErrorGet().
+        instance    (IN) - pointer to an ADT instance 
+        null_struct (IN) - the null structure of the ADT instance or array
+        tdo         (IN) - pointer to the TDO 
+        names       (IN) - array of attribute names. This is used to specify
+                           the names of the attributes in the path expression.
+        lengths     (IN) - array of lengths of attribute names. 
+        name_count  (IN) - number of element in the array 'names'.
+        indexes     (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4 *)0.
+        index_count (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4)0.
+        attr_null_status (OUT) - the null status of the attribute if the type 
+                                 of attribute is primitive. 
+        attr_null_struct (OUT) - the null structure of an ADT or collection
+                                 attribute.
+        attr_value       (OUT) - pointer to the attribute value.
+        attr_tdo         (OUT) - pointer to the TDO of the attribute.
+   REQUIRES:
+      - a valid OCI environment handle must be given.
+   DESCRIPTION:
+        This function gets a value from an ADT instance or from an array.
+        If the parameter 'instance' points to an ADT instance, then the path
+        expression specifies the location of the attribute in the ADT. 
+        It is assumed that the object is pinned and that the value returned 
+        is valid until the object is unpinned.
+   RETURNS:
+        one of OROSTA*
+   EXAMPLES:
+        See example in OCIObjectSetAttr(). Also see the above example.
+ */
+
+#endif /* ORID_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/orl.h b/src/terralib/drivers/Oracle/OCI/include/orl.h
new file mode 100644
index 0000000..c442bd2
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/orl.h
@@ -0,0 +1,3628 @@
+/* Copyright (c) 1993, 2003, Oracle Corporation.  All rights reserved.  */
+
+/*
+  Author:             Srinath Krishnaswamy
+  Date:               11/24/93
+  Source documents:   "Functional Specification for C Language Mapping of
+                      OTS Types, Object Management Subsystem", "Oracle C
+                      Coding Standards version 2.2", and the header file
+                      template
+  Rule sets:          the generic and .h file rule sets
+  Quality status:     not exited
+  Identification tag: [ one or more letters to identify the .h file ]
+  Revision code:      11/24/93
+ 
+  NAME
+
+    ORL - ORacle's external C Language interface to primitive OTS types
+ 
+  DESCRIPTION
+
+    This header file contains C langauge interface to the OTS primitive
+    types. The interface includes C mapping of OTS primitive types and
+    the prototype of the pre-defined operations on the primitive types.
+ 
+    ***********************************************************************
+    *** NOTE: The OCI functions for objects requires the                ***
+    ***       application to be running in OBJECT mode. That is, during ***
+    ***       process initialization OCIInitialize(), the mode          ***
+    ***       specified should be OBJECT mode.                          ***
+    **                OCIInitialize(OCI_OBJECT, ..);                    ***
+    ***********************************************************************
+
+  RELATED DOCUMENTS
+
+    [1] Krishnaswamy, Srinath and Nguyen, Tin A., "Functional Specification
+        for C Language Mapping of OTS Types, Object Management Subsystem",
+        March 1994.
+    [2] Nguyen, Tin A., "The Open Type System", Oracle Corporation,
+        February 1994.
+    [3] Klein, Jonathan D., "Large Field Management", Oracle Corporation,
+        October 1993.
+ 
+  PUBLIC FUNCTIONS
+ 
+    OCI - OCI functions to manipulate Oracle Number, float and decimal
+      ARITHMETIC
+        OCINumberInc - OCINumber INCrement (optimized)
+        OCINumberDec - OCINumber DECrement (optimized)
+        OCINumberAdd - OCINumber ADD numbers
+        OCINumberSub - OCINumber SUBtract numbers
+        OCINumberMul - OCINumber MULtiply numbers
+        OCINumberDiv - OCINumber DIVide numbers
+        OCINumberMod - OCINumber MODulo division
+        OCINumberIntPower - OCINumber integer PoWeR
+        OCINumberShift - OCINumber decimal ShiFT number
+        OCINumberNeg - OCINumber NEGate number
+        OCINumberAbs - OCINumber ABSolute value
+        OCINumberCeil - OCINumber CEiling of number
+        OCINumberFloor - OCINumber FLooR of number
+        OCINumberSqrt - OCINumber SQuare Root of number
+        OCINumberSign - OCINumber get SIGN of number
+      NATIVE TYPE CONVERSION
+        OCINumberToInt  - OCINumber convert number TO machine-format Integer
+        OCINumberFromInt - OCINumber convert machine-format Integer TO Number
+        OCINumberToReal  - OCINumber convert number TO machine-format Real
+        OCINumberToRealArray  - OCINumber convert array of numbers TO
+                                machine-format Real
+        OCINumberFromReal - OCINumber convert machine-format Real TO Number
+      TEXT STRING CONVERSION
+        OCINumberToText  - OCINumber convert number TO String
+        OCINumberFromText - OCINumber convert String TO Number
+      COMPARISON
+        OCINumberCmp - OCINumber CoMPare numbers
+        OCINumberIsZero - OCINumber comparison with ZERo
+        OCINumberIsInt - OCINumber Is an Integer
+      ASSIGNMENT
+        OCINumberAssign - OCINumber ASsiGn number
+        OCINumberSetZero - OCINumber Set number to Zero value
+        OCINumberSetPi - OCINumber Set number to Pi
+      ROUNDING
+        OCINumberTrunc - OCINumber TRUncate an Oracle number
+        OCINumberRound - OCINumber ROUnd number
+        OCINumberPrec - OCINumber round to Precision digits
+      TRANSCENDENTAL
+        OCINumberSin - OCINumber SINe
+        OCINumberArcSin - OCINumber Arc SINe
+        OCINumberHypSin - OCINumber SiNe Hyperbolic
+        OCINumberCos - OCINumber COSine
+        OCINumberArcCos - OCINumber Arc COSine
+        OCINumberHypCos - OCINumber CoSine Hyperbolic
+        OCINumberTan - OCINumber TANgent
+        OCINumberArcTan - OCINumber Arc TANgent
+        OCINumberArcTan2 - OCINumber Arc TaNgent 2
+        OCINumberHypTan - OCINumber TaNgent Hyperbolic
+        OCINumberPower - OCINumber arbitrary Base EXponentiation
+        OCINumberExp - OCINumber EXPonentiation to base e
+        OCINumberLn  - OCINumber Logarithm Natural
+        OCINumberLog - OCINumber LOGarithm to arbitrary base
+
+    OCIDate - OCI functions to manipulate OCI Date
+      OCIDateToExternal - OCIDate convert date to external form
+      OCIDateFromExternal - OCIDate convert external form of date into OCIDate
+      OCIDateAssign - OCIDate Assignment
+      OCIDateToText  - OCIDate convert date TO String
+      OCIDateFromText - OCIDate convert String TO Date
+      OCIDateZoneToZone - OCIDate convert date from one time 
+                        Zone TO another Zone
+      OCIDateCompare - OCIDate CoMPare dates
+      OCIDateAddMonths - OCIDate ADd or subtract Months
+      OCIDateAddDays - OCIDate ADd or subtract Days
+      OCIDateLastDay - OCIDate get date of LaST day of month
+      OCIDateDaysBetween - OCIDate get number of days BeTWeen two dates
+      OCIDateNextDay - OCIDate get date of Next DaY
+      OCIDateCheck - OCIDate CHecK if the given date is valid
+      OCIDateSysDate - OCIDate get current SYStem date and time
+
+    OCIString - OCI String functions to manipulate Variable-length string
+      OCIStringAssign - OCIString Assign string to string
+      OCIStringAssignText - OCIString Assign Text string to string
+      OCIStringResize - OCIString ReSiZe string
+      OCIStringSize - OCIString get String Size
+      OCIStringPtr - OCIString get String PoinTeR
+      OCIStringAllocSize - OCIString get Allocated SiZe
+ 
+    OCIRaw - OCI Raw functions to manipulate variable-length raW
+      OCIRawAssignRaw - OCIRaw Assign Raw (of type OCIRaw*) to raw
+                        (of type OCIRaw*)
+      OCIRawResize - OCIRaw Resize raw
+      OCIRawSize - OCIRaw get Raw Size
+      OCIRawPtr  - OCIRaw get Raw data Pointer
+      OCIRawAllocSize - OCIRaw get Allocated Size
+
+    OCIColl - OCI Collection generic functions. These functions can be 
+                used to manipulate both variable-length array (varray) and 
+                nested table.
+      OCICollSize  - OCIColl return current SIZe of the given collection
+                (in number of elements)
+      OCICollMax  - OCIColl return the MAXimum number of elements in the
+                collection (i.e. upper-bound)
+      OCICollGetElem  - OCIColl GET pointer to the element at the given 
+                position
+      OCICollAssignElem  - OCIColl assign to element at given index
+      OCICollAssign  - OCIColl ASsiGn collection; perform deep-copy of source 
+                collection to target collection
+      OCICollAppend  - OCIColl aPPend the given element to the end of the
+                collection
+      OCICollTrim  - OCIColl trim (delete) the given number of elements 
+                from the end of the collection
+      OCICollIsLocator - OCIColl indicates whether a collection is locator
+                         based or not.
+      OCIIterCreate  - OCIColl Create an ITerator to scan the collection 
+                elements
+      OCIIterDelete  - OCIColl Delete ITerator
+      OCIIterInit  - OCIColl Initialize ITerator to scan the given collection
+      OCIIterGetCurrent - OCIColl Iterator based, get CURrent 
+                collection element
+      OCIIterNext - OCIColl Iterator based, get NeXT collection element
+      OCIIterPrev - OCIColl Iterator based, get PReVious collection element
+ 
+      OCITable - OCI functions to manipulate nested Table. The OCIColl*() and 
+                OCITable*() functions can be used to manipulate nested table
+      OCITableDelete(i) - OCITable if element(i) exists then the element is 
+                marked as deleted else the function returns false. So 
+                delete's create "holes".
+      OCITableExists(i) - OCITable return true iff an element at
+                position i EXIsts
+      OCITableFirst  - OCITable return the smallest value of i for which
+                exists(i) is true.
+      OCITableLast  - OCITable return the largest value of i for which 
+                exists(i) is true.
+      OCITableNext(i) - OCITable return pointer to the smallest position j, 
+                greater than i, such that OCITableExists(j) is true
+      OCITablePrev(i) - OCITable return pointer to the largest position j,
+                less than i, such that OCITableExists(j) is true
+      OCITableSize - OCITable return current SIZe of the given nested table not
+                including deleted elements
+
+    OCIRef - OCI functions to manipulate object Reference
+      OCIRefClear  - OCIRef CLeaR or nullify a ref
+      OCIRefAssign  - OCIRef ASsiGn a ref to another
+      OCIRefIsEqual  - OCIRef compare two refs for EQUality
+      OCIRefIsNull  - OCIRef test if a ref is NULl 
+      OCIRefFromHex  - OCIRef convert a Hexadecimal string TO a Ref
+      OCIRefToHex   - OCIRef convert a ref to a Hexadecimal string
+      OCIRefHexSize  - OCIRef get size of buffer in bytes to store hexadecimal
+                string
+
+  OBSOLETE: to be replaced by functions from oci.h:
+
+    ORLL - ORL functions to manipulate lob Locators
+      orllasg   - ORLL AsiGn one locator to another
+      orllequ   - ORLL compare two locators for EQUality
+      orlliini  - ORLL Is the locator INItialized?
+      orllgsz   - ORLL Get locator SiZe
+      orllgcid  - ORLL Get Character set ID
+
+      NOTE: The following are specific to FILE lobs:
+
+      orllsnm - ORLL Set directory alias and file NaMe in the locator
+      orllgnm - ORLL Get directory alias and file NaMe from the locator
+ 
+  EXAMPLES
+
+    Examples are given in the description of each function where
+    relevant.
+ 
+  NOTES
+
+    This file has been subsetted to contain ONLY the routines that will
+    be in the first release.
+ 
+  QUESTIONS
+     
+  MODIFIED
+    srseshad   03/12/03 - convert oci public api to ansi
+    rpingte    11/21/02 - Add OCICollGetElemArray and OCINumberToRealArray
+    aahluwal   06/03/02 - bug 2360115
+    gayyappa   02/01/02 - fix 2210776 : change Dom to DOM 
+    whe        09/25/01 - add OCIXMLType & OCIDomDocument opaque types
+    bpalaval   02/09/01   - Change text to oratext.
+    rkasamse   09/20/99 -   lint changes
+    whe        09/01/99 -   976457:check __cplusplus for C++ code
+    hsbedi     08/11/99 -   Add macro
+    rxgovind   10/14/98 -  make non exposed calls (OCIRowType etc) private
+    rxgovind   06/09/98 -  update OCIRowTypeCreate
+    nmantrav   05/11/98 -  add OCIRowTypeGetCount
+    rxgovind   03/29/98 -  add OCIRowType and OCIRowData interfaces
+    jwijaya    05/06/98  - add OCICollIsLocator                                
+    rxgovind   03/18/98 -  opaque types: move to kolo.h
+    etucker    02/02/98 -  add comments for Dec and Inc
+    etucker    01/29/98 -  Finish core5 integration
+    rxgovind   11/11/97 -  opaque types
+    etucker    10/28/97 -  add ORLN functions for SDK
+    cxcheng    07/28/97 -  remove OCILobLocator #define
+    skmishra   05/13/97 -  stdcc compatibility changes
+    skrishna   04/25/97 -  rename OCINumber*(): Exp Power TanHyp Zero Init
+                           TanToArc Sqr Truncate and Compare 
+    skotsovo   03/31/97 -  remove OCILobLocatorSize
+    skrishna   03/25/97 -  remove orld2i and orldi2d
+    skrishna   03/18/97 -  fix ifdef for supporting ansi and k&r proto-types
+    cxcheng    02/06/97 -  take out short name support except with SLSHORTNAME
+    skrishna   01/06/97 -  update OCITableSize() comments
+    skrishna   12/27/96 -  fix OCIDateGet/OCIDateSet
+    skrishna   12/12/96 -  update OCICollGelElem comments
+    skrishna   11/07/96 -  OCICollGetElem: interface change
+    skrishna   11/05/96 -  add OCIDate Get/Set and OCIDateAssign
+    cxcheng    10/31/96 -  change OCINumberTanHyp to OCINumberHypTan
+    cxcheng    10/30/96 -  #define orll short names to long names
+    dchatter   10/26/96 -  fix some OCI file long names
+    cxcheng    10/24/96 -  remove unnecessary comment in front
+    cxcheng    10/14/96 -  disable long name mapping for LOB functions
+    skrishna   10/13/96 -  continue beautification
+    skotsovo   10/16/96 -  update ocilob names
+    cxcheng    10/09/96 -  add structure members in #define for date/time
+    cxcheng    10/09/96 -  more lint fixes
+    skrishna   10/09/96 -  continue beautification
+    cxcheng    10/09/96 -  more fixes
+    skrishna   10/09/96 -  change fixed-char rep. to orlvstr*
+    jwijaya    10/08/96 -  continue beautification
+    jwijaya    10/07/96 -  beautify
+    cxcheng    10/07/96 -  more changes
+    cxcheng    10/04/96 -  replace short names with long names
+    skrishna   10/01/96 -  orlcsiz, orltsiz: change prototype to take errhdl
+    skrishna   09/23/96 -  fix lint errors
+    skotsovo   09/23/96 -  remove orllmkcur().
+    jwijaya    09/17/96 -  comments on null ref
+    skrishna   09/19/96 -  change orlraw format
+    skotsovo   09/19/96 -  add orlliini and remove orllnul
+    skrishna   08/14/96 -  orlvstr: change format to ub4 followed by text
+    jboonleu   08/06/96 -  update comment
+    skotsovo   08/08/96 -  revert to locators instead of descriptors as input t
+    jboonleu   07/23/96 -  remove orlrcur
+    skrishna   07/06/96 -  add orltsiz
+    skrishna   07/05/96 -  add orld2i and orldi2d
+    jwijaya    07/03/96 -  add ANSI prototypes
+    skrishna   06/27/96 -  document default string format in orlds2d & orld2s
+    skrishna   06/25/96 -  change max date value
+    skrishna   06/18/96 -  modify orld2s() comments
+    skotsovo   06/13/96 -  orll functions take lob descriptors instead of locat
+    rxgovind   06/05/96 -  change prototype of orlrcur to take ocienvh
+    skrishna   05/30/96 -  support collection trimming
+    skrishna   05/30/96 -  remove orlralo/fre and orllalo/fre instead use 
+                           orionew/fre
+    skrishna   05/28/96 -  add orlt*() and modify orla*()
+    skotsovo   05/23/96 -  add orlbl typedefs for pro*c
+    jboonleu   05/14/96 -  add orlrcur
+    rxgovind   05/08/96 -  changes for 3gl callbacks
+    skotsovo   05/01/96 -  in orllasg, no need to alloc orlbl*
+    skrishna   04/21/96 -  merge changes from 960418 object branch into big
+    skrishna   04/17/96 -  rename orlrcpy to orlrasg
+    skrishna   04/12/96 -  add orlr2h and orlrh2r functions
+    skotsovo   04/15/96 -  add fnt to make the lob locator current
+    skrishna   04/08/96 -  change orl*() to take ocienvh* and ocierrh* instead
+                           of oroenv*
+    skotsovo   03/22/96 -  add locator functions
+    skotsovo   03/22/96 -  add locator functions
+    skrishna   02/27/96 -  remove mlslabel interface
+    skotsovo   02/20/96 -  remove orlbty and use dty type instead.
+    skotsovo   02/14/96 -  add text file lobs.
+    skrishna   01/31/96 -  update comments of orln2r, orldchk, orlds2d & orld2s
+    skrishna   01/31/96 -  change orld2s() and orln2s() to return string length
+    skrishna   01/21/96 -  remove old raw interface 
+    skrishna   12/14/95 -  add raw interface
+    skotsovo   01/03/96 -  change LOB offsets and lengths from ub4 to ubig_ora
+                           to support 64 bit machines.
+    skotsovo   10/30/95 -  add orlblsiz() to get lob locator size
+    skrishna   10/24/95 -  move ref functions from ori and update the ref
+                           functions to support variable-length ref
+    cxcheng    10/20/95 -  add more comments on number versions
+    cxcheng    10/13/95 -  add more number functions
+    cxcheng    08/29/95 -  Support for segmented varrays
+    cxcheng    08/18/95 -  modifiy orlmls structure
+    skrishna   06/06/95 -  rename orln, orld, orlvs and orlva to orlnum,
+                           orldat, orlvstr and orlvary respectively 
+    skrishna   11/15/94 -  remove orlnget() function 
+    skrishna   09/20/94 -  modify orldbtw() to return number of days only 
+    skrishna   08/24/94 -  change format string length type from ub4 to ub1 
+    skrishna   07/19/94 -  Rename orln2c & orlnc2n to orln2s & orlns2n 
+    skrishna   06/29/94 -  Add blob interface; add examples 
+    skrishna   06/23/94 -  Update comments and format 
+    skrishna   05/19/94 -  update varray append comments 
+    skrishna    05/05/94 -  Subsetting 
+    skrishna    11/24/93 -  Creation
+*/
+
+#ifndef ORATYPES
+#include <oratypes.h>
+#endif
+
+#ifndef ORO_ORACLE
+#include <oro.h>
+#endif
+
+#ifndef ORT_ORACLE
+#include <ort.h>
+#endif
+
+#ifndef OCI_ORACLE
+#include <oci.h>
+#endif
+
+#ifndef ORL_ORACLE
+#define ORL_ORACLE
+
+/*---------------------------------------------------------------------------*/
+/*                         SHORT NAMES SUPPORT SECTION                       */
+/*---------------------------------------------------------------------------*/
+
+#ifdef SLSHORTNAME
+
+/* the following are short names that are only supported on IBM mainframes
+   with the SLSHORTNAME defined.
+   With this all subsequent long names will actually be substituted with
+   the short names here */
+
+#define OCIArray                        orlvary
+#define OCIColl                         orlcol
+#define OCICollAppend                   orlcapp
+#define OCICollAssign                   orlcasg
+#define OCICollAssignElem               orlcase
+#define OCICollGetElem                  orlcget
+#define OCICollGetElemArray             orlcgeta
+#define OCICollMax                      orlcmax
+#define OCICollSize                     orlcsiz
+#define OCICollTrim                     orlctrm
+#define OCICollIsLocator                orlcilc
+#define OCIDate                         orldat
+#define OCIDateAddDays                  orldadd
+#define OCIDateAddMonths                orldadm
+#define OCIDateCheck                    orldchk
+#define OCIDateCompare                  orldcmp
+#define OCIDateDD                       day_orldat
+#define OCIDateDaysBetween              orldbtw
+#define OCIDateFromText                 orlds2d
+#define OCIDateLastDay                  orldlst
+#define OCIDateMM                       mon_orldat
+#define OCIDateNextDay                  orldndy
+#define OCIDateSysDate                  orldsys
+#define OCIDateTime                     time_orldat
+#define OCIDateYYYY                     gye_orldat
+#define OCIDateZoneToZone               orldz2z
+#define OCIIter                         orlcitr
+#define OCIIterCreate                   orlccit
+#define OCIIterDelete                   orlcdit
+#define OCIIterGetCurrent               orlcicur
+#define OCIIterInit                     orlciit
+#define OCIIterNext                     orlcinxt
+#define OCIIterPrev                     orlciprv
+#define OCINumber                       orlnum
+#define OCINumberAbs                    orlnabs
+#define OCINumberAdd                    orlnadd
+#define OCINumberArcCos                 orlnacos
+#define OCINumberArcSin                 orlnasin
+#define OCINumberArcTan                 orlnatan
+#define OCINumberAssign                 orlnasg
+#define OCINumberCeil                   orlncel
+#define OCINumberCos                    orlncos
+#define OCINumberDiv                    orlndiv
+#define OCINumberPower                  orlnbex
+#define OCINumberFloor                  orlnflr
+#define OCINumberFromInt                orlni2n
+#define OCINumberFromReal               orlnr2n
+#define OCINumberFromText               orlns2n
+#define OCINumberHypCos                 orlncsh
+#define OCINumberHypSin                 orlnsnh
+#define OCINumberSetZero                orlnini
+#define OCINumberSetPi                  orlnspi
+#define OCINumberInc                    orlninc
+#define OCINumberDec                    orlndec
+#define OCINumberIntPower               orlnpwr
+#define OCINumberLn                     orlnln
+#define OCINumberLog                    orlnlog
+#define OCINumberMod                    orlnmod
+#define OCINumberMul                    orlnmul
+#define OCINumberNeg                    orlnneg
+#define OCINumberPart                   orlnpart
+#define OCINumberExp                    orlnexp
+#define OCINumberRound                  orlnrou
+#define OCINumberPrec                   orlnpre
+#define OCINumberShift                  orlnsft
+#define OCINumberSign                   orlnsgn
+#define OCINumberSin                    orlnsin
+#define OCINumberSqrt                   orlnsqr
+#define OCINumberSub                    orlnsub
+#define OCINumberTan                    orlntan
+#define OCINumberHypTan                 orlntnh
+#define OCINumberArcTan2                orlnatn2
+#define OCINumberToInt                  orln2i
+#define OCINumberToReal                 orln2r
+#define OCINumberToRealArray            orln2ra
+#define OCINumberToText                 orln2s
+#define OCINumberTrunc                  orlntru
+#define OCINumberCmp                    orlncmp
+#define OCINumberIsZero                 orlnzer
+#define OCINumberIsInt                  orlnint
+#define OCIRaw                          orlraw
+#define OCIRawAllocSize                 orlwasz
+#define OCIRawAssignBytes               orlwabr
+#define OCIRawAssignRaw                 orlwarr
+#define OCIRawPtr                       orlwgrp
+#define OCIRawResize                    orlwrsz
+#define OCIRawSize                      orlwgsz
+#define OCIRefAssign                    orlrasg
+#define OCIRefClear                     orlrclr
+#define OCIRefFromHex                   orlrh2r
+#define OCIRefHexSize                   orlrhsz
+#define OCIRefIsEqual                   orlrequ
+#define OCIRefIsNull                    orlrnul
+#define OCIRefToHex                     orlr2h
+#define OCIString                       orlvstr
+#define OCIStringAllocSize              orlvasz
+#define OCIStringAssign                 orlvass
+#define OCIStringAssignText             orlvats
+#define OCIStringPtr                    orlvgsp
+#define OCIStringResize                 orlvrsz
+#define OCIStringSize                   orlvgsz
+#define OCITable                        orltbl
+#define OCITableDelete                  orltdel
+#define OCITableExists                  orltexi
+#define OCITableFirst                   orltfst
+#define OCITableLast                    orltlst
+#define OCITableNext                    orltnxt
+#define OCITablePrev                    orltprv
+#define OCITableSize                    orltsiz
+#define OCITime                         orldtm
+#define OCITimeHH                       orldtmhh
+#define OCITimeMI                       orldtmmm
+#define OCITimeSS                       orldtmss
+#define OCI_LOBMODE_READONLY            ORLBMORO
+#define OCI_LOBMODE_READWRITE           ORLBMORW
+
+#endif                                                        /* SLSHORTNAME */
+
+/*****************************************************************************/
+/*                         NUMBER/FLOAT/DECIMAL TYPE                         */
+/*****************************************************************************/
+
+#define OCI_NUMBER_SIZE 22
+struct OCINumber
+{
+  ub1 OCINumberPart[OCI_NUMBER_SIZE];
+};
+typedef struct OCINumber OCINumber;
+
+/* 
+ * OCINumber - OCI Number mapping in c
+ *
+ * The OTS types: NUMBER, NUMERIC, INT, SHORTINT, REAL, DOUBLE PRECISION,
+ * FLOAT and DECIMAL are represented by OCINumber.
+ * The contents of OCINumber is opaque to clients. 
+ *
+ * For binding variables of type OCINumber in OCI calls (OCIBindByName(),
+ * OCIBindByPos(), and OCIDefineByPos()) use the type code SQLT_VNU.
+ */
+
+/*
+   EXAMPLE 
+
+   The following example shows how to manipulate an attribute of type 
+   oracle number.
+  
+     struct person
+     {
+       OCINumber sal;
+     };
+     typedef struct person person;
+
+     OCIError *err;
+     person* joe;
+     person* tom;
+     person* debbie;
+     OCINumber  *joesal;
+     OCINumber  *tomsal;
+     OCINumber *debsal;
+     sword   status;
+     int     inum;
+     double  dnum;
+     OCINumber ornum;
+     char    buffer[21];
+     ub4     buflen;
+     sword   result;
+     
+     /o See oci.h for an example of how to initialize OCIError.
+      o For this example, assume the OCIEnv and OCIError has been
+      o initialized.
+      o/
+
+     /o Pin joe, tom and debbie person objects in the object cache. See ori.h
+      o for an example on pinning objects. For this example, assume that
+      o joe, tom and debbie are pointing to pinned objects.
+      o/
+     joesal = &joe->sal;
+     tomsal = &tom->sal;
+     debsal = &debbie->sal;
+
+     /o initialize joe's salary to be $12,000 o/
+     inum = 12000;
+     status = OCINumberFromInt(err, &inum, sizeof(inum), OCI_NUMBER_SIGNED,
+                               joesal);
+     if (status != OCI_SUCCESS)
+                              /o goto to handle error from OCINumberFromInt o/;
+
+     /o initialize tom's salary to be same as joe o/
+     OCINumberAssign(err, joesal, tomsal);
+
+     /o initialize debbie's salary to be 20% more than joe's o/
+     dnum = 1.2;
+     status = OCINumberFromReal(err, &dnum, sizeof(double), &ornum);
+     if (status != OCI_SUCCESS)
+                            /o goto to handle error from OCINumberFromReal o/;
+     status = OCINumberMul(err, joesal, &ornum, debsal);
+     if (status != OCI_SUCCESS)  /o goto to handle error from OCINumberMul o/;
+
+     /o give tom a 50% raise o/
+     dnum = 1.5;
+     status = OCINumberFromReal(err, &dnum, sizeof(double), &ornum);
+     if (status != OCI_SUCCESS)
+                            /o goto to handle error from OCINumberFromReal o/;
+     status = OCINumberMul(err, tomsal, &ornum, tomsal);
+     if (status != OCI_SUCCESS)  /o goto to handle error from OCINumberMul o/;
+
+     /o double joe's salary o/
+     status = OCINumberAdd(err, joesal, joesal, joesal);
+     if (status != OCI_SUCCESS)  /o goto to handle error from OCINumberAdd o/;
+
+     /o get joe's salary in integer o/
+     status = OCINumberToInt(err, joesal, sizeof(inum), OCI_NUMBER_SIGNED,
+                             &inum);
+     if (status != OCI_SUCCESS)/o goto to handle error from OCINumberToInt o/;
+     /o inum is set to 24000 o/
+
+     /o get debbie's salary in double o/
+     status = OCINumberToReal(err, debsal, sizeof(dnum), &dnum);
+     if (status != OCI_SUCCESS)/o goto to handle error from OCINumberToReal o/;
+     /o dnum is set to 14400 o/
+
+     /o print tom's salary as DEM0001`8000.00 o/
+     buflen = sizeof(buffer);
+     status = OCINumberToText(err, tomsal, "C0999G9999D99", 13, 
+                 "NLS_NUMERIC_CHARACTERS='.`' NLS_ISO_CURRENCY='Germany'", 54,
+                 &buflen, buffer);
+     if (status != OCI_SUCCESS)/o goto to handle error from OCINumberToText o/;
+     printf("tom's salary = %s\n", buffer);
+
+     /o compare joe and tom's salary o/
+     status = OCINumberCmp(err, joesal, tomsal, &result);
+     if (status != OCI_SUCCESS)  /o goto to handle error from OCINumberCmp o/;
+     /o result is positive o/
+
+     /o read debbie's new salary from string o/
+     status = OCINumberFromText(err, "48`000.00", 9, "99G999D99", 9,
+                      "NLS_NUMERIC_CHARACTERS='.`'", 27, debsal);
+     if (status != OCI_SUCCESS)
+                            /o goto to handle error from OCINumberFromText o/;
+     /o debbie's salary is now 48000.00 o/
+
+*/
+
+/*----------------------------- OCINumberInc --------------------------------*/
+
+sword OCINumberInc(    OCIError *err, OCINumber *number    );
+/*
+   NAME: OCINumberInc - OCINumber INCrement numbers
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN/OUT) a positive Oracle number to be incremented
+   DESCRIPTION:
+        Increment Oracle number in place. It is assumed that the input is
+        an integer between 0 and 100^21-2. If the is input too large, it will
+        be treated as 0 - the result will be an Oracle number 1. If the input
+        is not a positive integer, the result will be unpredictable.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*----------------------------- OCINumberDec --------------------------------*/
+
+sword OCINumberDec(    OCIError *err, OCINumber *number    );
+/*
+   NAME: OCINumberDec - OCINumber DECrement numbers
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN/OUT) - a positive Oracle number to be decremented
+   DESCRIPTION:
+        Decrement Oracle number in place. It is assumed that the input is an
+        integer between 1 and 100^21-2. If the input is too large, it will be
+        treated as 1 - the result will be an Oracle number 0. If the input is
+        not a positive integer, the result will be unpredictable.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*-------------------------- OCINumberSetZero -------------------------------*/
+
+void OCINumberSetZero(    OCIError *err, OCINumber *num    );
+/*
+   NAME: OCINumberSetZero - OCINumber Set number to Zero value
+   PARAMETERS:
+        err (IN/OUT) - pointer to OCI error handle
+        num (OUT) - set to zero value
+   DESCRIPTION:
+        Initialize the given number to value 0.
+ */
+
+/*--------------------------- OCINumberSetPi --------------------------------*/
+
+void OCINumberSetPi(    OCIError *err, OCINumber *num    );
+/*
+   NAME: OCINumberSetPi - OCINumber Set number to Pi
+        err (IN/OUT) - pointer to OCI error handle
+        num (OUT) - set to zero value
+   DESCRIPTION:
+        Initialize the given number to value Pi.
+ */
+
+/*----------------------------- OCINumberAdd --------------------------------*/
+
+sword OCINumberAdd(    OCIError *err, CONST OCINumber *number1, 
+                       CONST OCINumber *number2, OCINumber *result    );
+/*
+   NAME: OCINumberAdd - OCINumber ADD numbers
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number1, number2 (IN) - numbers to be added
+        result (OUT) - result of adding 'number1' with 'number2'
+   DESCRIPTION:
+        Add 'number1' with 'number2' and return result in 'result'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*----------------------------- OCINumberSub --------------------------------*/
+
+sword OCINumberSub(    OCIError *err, CONST OCINumber *number1, 
+                       CONST OCINumber *number2, OCINumber *result    );
+/*
+   NAME: OCINumberSub - OCINumber SUBtract numbers
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number1, number2 (IN) - 'number2' subtracted from 'number1'
+        result (OUT) - subtraction result
+   DESCRIPTION:
+        Subtract 'number2' from 'number1' and return result in 'result'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*----------------------------- OCINumberMul --------------------------------*/
+
+sword OCINumberMul(    OCIError *err, CONST OCINumber *number1, 
+                       CONST OCINumber *number2, OCINumber *result    );
+/*
+   NAME: OCINumberMul - OCINumber MULtiply numbers
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number1, number2 (IN) - numbers to be multiplied
+        result (OUT) - multiplication result
+   DESCRIPTION:
+        Multiply 'number1' with 'number2' and return result in 'result'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*----------------------------- OCINumberDiv --------------------------------*/
+
+sword OCINumberDiv(    OCIError *err, CONST OCINumber *number1, 
+                       CONST OCINumber *number2, OCINumber *result    );
+/*
+   NAME: OCINumberDiv - OCINumber DIVide numbers
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number1 (IN) - pointer to the numerator
+        number2 (IN) - pointer to the denominator
+        result (OUT) - division result
+   DESCRIPTION:
+        Divide 'number1' by 'number2' and return result in 'result'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+          underflow errorr
+          overflow errorr
+          divide by zero errorr
+ */
+
+/*----------------------------- OCINumberMod --------------------------------*/
+
+sword OCINumberMod(    OCIError *err, CONST OCINumber *number1, 
+                       CONST OCINumber *number2, OCINumber *result    );
+/*
+   NAME: OCINumberMod - OCINumber MODulous
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number1 (IN) - pointer to the numerator
+        number2 (IN) - pointer to the denominator
+        result (OUT) - remainder of the result
+   DESCRIPTION:
+        Finds the remainder of the division of two Oracle numbers.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+          divide by zero errorr
+ */
+
+/*------------------------ OCINumberIntPower --------------------------------*/
+
+sword OCINumberIntPower(    OCIError *err, CONST OCINumber *base,
+                            CONST sword exp, OCINumber *result    );
+/*
+   NAME: OCINumberIntPower - OCINumber takes an arbitary base to an arbitary
+                             integer PoWeR
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        base (IN) - base of the exponentiation
+        exp (IN) - exponent to which the base is to be raised
+        result (OUT) - output of exponentiation
+   DESCRIPTION:
+        Takes an arbitary base to an arbitary integer power.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*-------------------------- OCINumberShift ---------------------------------*/
+
+sword OCINumberShift(    OCIError *err, CONST OCINumber *number,
+                            CONST sword nDig, OCINumber *result    );
+/*
+   NAME: OCINumberShift - OCINumber multiplies by a power of 10.
+
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - Oracle Number to be shifted.
+        nDig   (IN) - number of decimal places to shift.
+        result (OUT) - shift result.
+   DESCRIPTION:
+        Multiplies number by 10^NDig and sets product to the result.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*----------------------------- OCINumberNeg --------------------------------*/
+
+sword OCINumberNeg(    OCIError *err, CONST OCINumber *number,
+                       OCINumber *result    );
+/*
+   NAME: OCINumberNeg - OCINumber NEGate number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - number to be negated
+        result (OUT) - will contain negated value of 'number'
+   DESCRIPTION:
+        Negates an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*------------------------- OCINumberToText ---------------------------------*/
+
+sword OCINumberToText(    OCIError *err, CONST OCINumber *number, 
+                          CONST oratext *fmt, ub4 fmt_length,
+                          CONST oratext *nls_params, ub4 nls_p_length,
+                          ub4 *buf_size, oratext *buf    );
+/*
+   NAME: OCINumberToText - OCINumber convert number TO String 
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - Oracle number to be converted
+        fmt (IN) - conversion format
+        fmt_length (IN) - length of the 'fmt' parameter
+        nls_params (IN) - nls format specification, if null string 
+                i.e. (oratext *)0, then the default parameters for the 
+                session is used
+        nls_p_length (IN) - length of the 'nls_params' parameter
+        buf_size (IN/OUT) - size of the buffer must be passed as input by
+                the caller, this function will return the length of the 
+                resulting string in bytes via this parameter. The length 
+                does not include the terminating null ('\0').
+        buf (OUT) - buffer into which the converted string is placed. The
+                resulting string is null terminated.
+   DESCRIPTION:
+        Converts the given number to a character string 
+        according to the specified format. Refer to "TO_NUMBER" conversion
+        function described in "Oracle SQL Language Reference Manual" for a
+        description of format and NLS parameters.
+        The converted number string is stored in the buffer 'buf', up to 
+        a max of '*buf_size' bytes. Length of the resulting string is
+        returned via 'buf_size'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          'number' or 'buf' is null
+          buffer too small
+          invalid format
+          invalid nls format
+          number to text translation for the given format causes overflow
+ */
+
+/*-------------------------- OCINumberFromText ------------------------------*/
+
+sword OCINumberFromText(    OCIError *err, CONST oratext *str, 
+                          ub4 str_length, CONST oratext *fmt, ub4 fmt_length, 
+                          CONST oratext *nls_params, ub4 nls_p_length, 
+                          OCINumber *number    );
+/*
+   NAME: OCINumberFromText - OCINumber convert String TO Number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        str (IN) - input string to be converted to Oracle number
+        str_length (IN) - size of the input string
+        fmt (IN) - conversion format
+        fmt_length (IN) - length of the 'fmt' parameter
+        nls_params (IN) - nls format specification, if null string 
+                i.e. (oratext *)0, then the default parameters for the 
+                session is used
+        nls_p_length (IN) - length of the 'nls_params' parameter
+        number (OUT) - given string converted to number
+   DESCRIPTION:
+        Converts the given string to a number
+        according to the specified format. Refer to "TO_NUMBER" conversion
+        function described in "Oracle SQL Language Reference Manual" for a
+        description of format and NLS parameters.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          'number' or 'str' is null
+          'str_length' is 0
+          invalid format
+          invalid nls format
+          invalid input string
+ */
+
+/*-------------------------- OCINumberToInt ---------------------------------*/
+
+#define OCI_NUMBER_UNSIGNED 0                        /* Unsigned type -- ubX */
+#define OCI_NUMBER_SIGNED   2                          /* Signed type -- sbX */
+
+sword OCINumberToInt(    OCIError *err, CONST OCINumber *number,
+                         uword rsl_length, uword rsl_flag, dvoid *rsl    );
+/*
+   NAME: OCINumberToInt - OCINumber convert number TO Integer
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - number to be converted
+        rsl_length (IN) - size of the desired result
+        rsl_s_flag (IN) - flag denoting the desired sign of the output; valid 
+                values are OCI_NUMBER_UNSIGNED, OCI_NUMBER_SIGNED
+        rsl (OUT) - pointer to space for the result
+   DESCRIPTION:
+        Native type conversion function.
+        Converts the given Oracle number into an xbx (e.g. ub2, ub4, sb2 etc.)
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          'number' or 'rsl' is null
+          integer value of 'number' is too big -- overflow
+          integer value of 'number' is too small -- underflow
+          invalid sign flag value ('rsl_s_flag')
+ */
+
+/*--------------------------- OCINumberFromInt ------------------------------*/
+
+sword OCINumberFromInt(    OCIError *err, CONST dvoid *inum, uword inum_length,
+                         uword inum_s_flag, OCINumber *number    );
+/*
+   NAME: OCINumberFromInt - OCINumber convert Integer TO Number 
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        inum (IN) - pointer to the integer to be converted
+        inum_length (IN) - size of the integer
+        inum_s_flag (IN) - flag that designates the sign of the integer; valid 
+                values are OCI_NUMBER_UNSIGNED, OCI_NUMBER_SIGNED
+        number (OUT) - given integer converted to Oracle number
+   DESCRIPTION:
+        Native type conversion function. Converts any Oracle standard
+        machine-native integer type (xbx) to an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          'number' or 'inum' is null
+          integer too BIG -- the number is too large to fit into an Oracle
+                number
+          invalid sign flag value ('inum_s_flag')
+ */
+
+/*------------------------- OCINumberToReal ---------------------------------*/
+
+sword OCINumberToReal(    OCIError *err, CONST OCINumber *number,
+                          uword rsl_length, dvoid *rsl    );
+/*
+   NAME: OCINumberToReal - OCINumber convert number TO Real
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - number to be converted
+        rsl_length (IN) - is the size of the desired result, 
+                sizeof( float | double | long double)
+        rsl (OUT) - pointer to space for storing the result
+   DESCRIPTION:
+        Native type conversion function. Converts an Oracle number into a
+        machine-native real type. This function only converts numbers up to
+        LDBL_DIG, DBL_DIG, or FLT_DIG digits of precision and removes
+        trailing zeroes. The above constants are defined in float.h
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          'number' or 'rsl' is null
+          'rsl_length' is 0
+ */
+
+/*------------------------- OCINumberToRealArray ----------------------------*/
+
+sword OCINumberToRealArray(  OCIError *err, CONST OCINumber **number,
+                             uword elems, uword rsl_length, dvoid *rsl    );
+/*
+   NAME: OCINumberToRealArray - OCINumber convert array of numbers TO Real
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - Pointer to array of number to be converted
+        elems (IN) - Upper bound of number array
+        rsl_length (IN) - is the size of the desired result,
+                                          sizeof( float | double | long double)
+        rsl (OUT) - pointer to array of space for storing the result
+   DESCRIPTION:
+        Native type conversion function. Converts an Oracle number into a
+        machine-native real type. This function only converts numbers up to
+        LDBL_DIG, DBL_DIG, or FLT_DIG digits of precision and removes
+        trailing zeroes. The above constants are defined in float.h
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          'number' or 'rsl' is null
+          'rsl_length' is 0
+ */
+
+/*-------------------------- OCINumberFromReal ------------------------------*/
+
+sword OCINumberFromReal(    OCIError *err, CONST dvoid *rnum,
+                            uword rnum_length, OCINumber *number    );
+/*
+   NAME: OCINumberFromReal - OCINumber convert Real TO Number 
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        rnum (IN) - pointer to the floating point number to be converted
+        rnum_length (IN) - size of the desired result, i.e.
+                sizeof({float | double | long double})
+        number (OUT) - given float converted to Oracle number
+   DESCRIPTION:
+        Native type conversion function. Converts a machine-native floating
+        point type to an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          'number' or 'rnum' is null
+          'rnum_length' is 0
+ */
+
+/*----------------------------- OCINumberCmp --------------------------------*/
+
+sword OCINumberCmp(    OCIError *err, CONST OCINumber *number1, 
+                       CONST OCINumber *number2, sword *result    );
+/*
+   NAME: OCINumberCmp - OCINumber CoMPare numbers 
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number1, number2 (IN) - numbers to be compared
+        result (OUT) - 0 if equal, negative if number1 < number2, 
+                positive if number1 > number2 
+   DESCRIPTION:
+        The function OCINumberCmp compares two numbers.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+            'number1' or 'number2' or 'result' is null 
+ */
+
+/*---------------------------- OCINumberSign --------------------------------*/
+
+sword OCINumberSign(    OCIError *err, CONST OCINumber *number,
+                        sword *result    );
+/*
+   NAME: OCINumberSign - OCINumber obtains SiGN of an Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - number whose sign is returned
+        result (OUT) - 0 if number == 0, -1 if number < 0, 
+                1 if number > 0 
+   DESCRIPTION:
+        Obtains sign of an Oracle number
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+            'number' or 'result' is null
+ */
+
+/*---------------------------- OCINumberIsZero ------------------------------*/
+
+sword OCINumberIsZero(    OCIError *err, CONST OCINumber *number,
+                          boolean *result    );
+/*
+   NAME: OCINumberIsZero - OCINumber comparison with ZERo
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - numbers to be compared
+        result (OUT) - set to TRUE if equal to zero else FALSE
+   DESCRIPTION:
+        Test if the given number is equal to zero.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+            'number' or 'result' is null
+ */
+
+/*---------------------------- OCINumberIsInt -------------------------------*/
+
+sword OCINumberIsInt(    OCIError *err, CONST OCINumber *number,
+                          boolean *result    );
+/*
+   NAME: OCINumberIsInt - OCINumber Is Integer value.
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - number to be tested
+        result (OUT) - set to TRUE if integer value else FALSE
+   DESCRIPTION:
+        Test if the given number is an integer value.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+            'number' or 'result' is null
+ */
+
+/*-------------------------- OCINumberAssign --------------------------------*/
+ 
+sword OCINumberAssign(    OCIError *err, CONST OCINumber *from,
+                          OCINumber *to    );
+/*
+   NAME: OCINumberAssign - OCINumber ASsiGn number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        from (IN) - number to be assigned
+        to (OUT) - number copied into
+   DESCRIPTION:
+        Assign number 'from' to 'to'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          'from' or 'to' is null
+ */
+
+/*----------------------------- OCINumberAbs --------------------------------*/
+
+sword OCINumberAbs(    OCIError *err, CONST OCINumber *number,
+                       OCINumber *result    );
+/*
+   NAME: OCINumberAbs - OCINumber compute ABSolute value
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - input number
+        result (OUT) - output which will contain the absolue value of the
+                input number
+   DESCRIPTION:
+        Computes the absolute value of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*---------------------------- OCINumberCeil --------------------------------*/
+
+sword OCINumberCeil(    OCIError *err, CONST OCINumber *number,
+                        OCINumber *result    );
+/*
+   NAME: OCINumberCeil - OCINumber compute the CEiL value of an Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - input number
+        result (OUT) - output which will contain the ceil value of the
+                input number
+   DESCRIPTION:
+        Computes the ceil value of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*--------------------------- OCINumberFloor --------------------------------*/
+
+sword OCINumberFloor(    OCIError *err, CONST OCINumber *number, 
+                         OCINumber *result    );
+/*
+   NAME: OCINumberFloor - OCINumber compute the FLooR value of an Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - input number
+        result (OUT) - output which will contain the floor value of the
+                input number
+   DESCRIPTION:
+        Computes the floor value of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*----------------------------- OCINumberSqrt -------------------------------*/
+
+sword OCINumberSqrt(    OCIError *err, CONST OCINumber *number, 
+                       OCINumber *result    );
+/*
+   NAME: OCINumberSqrt - OCINumber compute the SQuare Root of an Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - input number
+        result (OUT) - output which will contain the square root of the
+                input number
+   DESCRIPTION:
+        Computes the square root of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+          'number' is negative
+ */
+
+/*--------------------------- OCINumberTrunc --------------------------------*/
+
+sword OCINumberTrunc(    OCIError *err, CONST OCINumber *number, 
+                         sword decplace, OCINumber *result    );
+/*
+   NAME: OCINumberTrunc - OCINumber TRUncate an Oracle number at a 
+                          specified decimal place
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - input number
+        decplace (IN) - number of decimal digits to the right of the 
+                decimal point to truncate at. Negative values are allowed.
+        result (OUT) - output of truncation
+   DESCRIPTION:
+        Truncate an Oracle number at a specified decimal place
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*----------------------------- OCINumberPower ------------------------------*/
+
+sword OCINumberPower(    OCIError *err, CONST OCINumber *base, 
+                         CONST OCINumber *number, OCINumber *result    );
+/*
+   NAME: OCINumberPower - OCINumber takes an arbitary Base to an 
+                          arbitary Power
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        base (IN) - base of the exponentiation
+        number (IN) - exponent to which the base is to be raised
+        result (OUT) - output of exponentiation
+   DESCRIPTION:
+        Takes an arbitary base to an arbitary power.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*--------------------------- OCINumberRound --------------------------------*/
+
+sword OCINumberRound(    OCIError *err, CONST OCINumber *number,
+                         sword decplace, OCINumber *result    );
+/*
+   NAME: OCINumberRound - OCINumber ROUnds an Oracle number to a specified 
+                  decimal place
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - round this number and return result in 'result'
+        decplace (IN) - number of decimal digits to the right of the 
+                decimal point to round to. Negative values are allowed.
+        result (OUT) - output of rounding
+   DESCRIPTION:
+        Rounds an Oracle number to a specified decimal place
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*--------------------------- OCINumberPrec ---------------------------------*/
+
+sword OCINumberPrec(    OCIError *err, CONST OCINumber *number,
+                         eword nDigs, OCINumber *result    );
+/*
+   NAME: OCINumberPrec - Rounds an Oracle number to a specified number of
+                         decimal digits.
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - number for which to set precision.
+        nDig   (IN) - number of decimal digits desired in the result.
+        result (OUT) - result.
+   DESCRIPTION:
+        Performs a floating point round with respect to the number
+        of digits.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*----------------------------- OCINumberSin --------------------------------*/
+
+sword OCINumberSin(    OCIError *err, CONST OCINumber *number,
+                       OCINumber *result    );
+/*
+   NAME: OCINumberSin - OCINumber takes the SINe of an Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - argument of the sine in radians
+        result (OUT) - result of the sine
+   DESCRIPTION:
+        Takes the sine in radians of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*-------------------------- OCINumberArcSin --------------------------------*/
+
+sword OCINumberArcSin(    OCIError *err, CONST OCINumber *number,
+                          OCINumber *result    );
+/*
+   NAME: OCINumberArcSin - OCINumber takes the Arc SINe of an Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - argument of the arc sine
+        result (OUT) - result of the arc sine in radians
+   DESCRIPTION:
+        Takes the arc sine in radians of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+          'number' is < -1 or 'number' is > 1.
+ */
+
+/*-------------------------- OCINumberHypSin --------------------------------*/
+
+sword OCINumberHypSin(    OCIError *err, CONST OCINumber *number, 
+                          OCINumber *result    );
+/*
+   NAME: OCINumberHypSin - OCINumber takes the SiNe Hyperbolic of an 
+                           Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - argument of the sine hyperbolic
+        result (OUT) - result of the sine hyperbolic
+   DESCRIPTION:
+        Takes the hyperbolic sine of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+   NOTES:
+        An Oracle number overflow causes an unpredictable result value.
+ */
+
+/*----------------------------- OCINumberCos --------------------------------*/
+
+sword OCINumberCos(    OCIError *err, CONST OCINumber *number, 
+                       OCINumber *result    );
+/*
+   NAME: OCINumberCos - OCINumber takes the COSine of an Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - argument of the cosine in radians
+        result (OUT) - result of the cosine
+   DESCRIPTION:
+        Takes the cosine in radians of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*-------------------------- OCINumberArcCos --------------------------------*/
+
+sword OCINumberArcCos(    OCIError *err, CONST OCINumber *number, 
+                          OCINumber *result    );
+/*
+   NAME: OCINumberArcCos - OCINumber takes the Arc COSine of an Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - argument of the arc cosine
+        result (OUT) - result of the arc cosine in radians
+   DESCRIPTION:
+        Takes the arc cosine in radians of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+          'number' is < -1 or 'number' is > 1.
+ */
+
+/*-------------------------- OCINumberHypCos --------------------------------*/
+
+sword OCINumberHypCos(    OCIError *err, CONST OCINumber *number, 
+                          OCINumber *result    );
+/*
+   NAME: OCINumberHypCos - OCINumber takes the CoSine Hyperbolic of an 
+                           Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - argument of the cosine hyperbolic
+        result (OUT) - result of the cosine hyperbolic
+   DESCRIPTION:
+        Takes the hyperbolic cosine of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+   NOTES:
+        An Oracle number overflow causes an unpredictable result value.
+ */
+
+/*----------------------------- OCINumberTan --------------------------------*/
+
+sword OCINumberTan(    OCIError *err, CONST OCINumber *number, 
+                       OCINumber *result    );
+/*
+   NAME: OCINumberTan - OCINumber takes the TANgent of an Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - argument of the tangent in radians
+        result (OUT) - result of the tangent
+   DESCRIPTION:
+        Takes the tangent in radians of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*-------------------------- OCINumberArcTan --------------------------------*/
+
+sword OCINumberArcTan(    OCIError *err, CONST OCINumber *number, 
+                          OCINumber *result    );
+/*
+   NAME: OCINumberArcTan - OCINumber takes the Arc TANgent of an Oracle number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - argument of the arc tangent
+        result (OUT) - result of the arc tangent in radians
+   DESCRIPTION:
+        Takes the arc tangent in radians of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*------------------------ OCINumberArcTan2 ---------------------------------*/
+
+sword OCINumberArcTan2(    OCIError *err, CONST OCINumber *number1, 
+                           CONST OCINumber *number2, OCINumber *result    );
+/*
+   NAME: OCINumberArcTan2 - OCINumber takes the ATan2 of 2 Oracle numbers
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number1 (IN) - first argument of atan2(y,x) function which 
+                corresponds to 'y' parameter in the function
+        number2 (IN) - second argument of atan2(y,x) function which 
+                corresponds to 'x' parameter in the function
+        result (OUT) - result of the atan2() in radians
+   DESCRIPTION:
+        Takes the atan2(number1, number2).
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+          'number2' is 0
+ */
+
+/*----------------------------- OCINumberHypTan -----------------------------*/
+
+sword OCINumberHypTan(    OCIError *err, CONST OCINumber *number, 
+                          OCINumber *result    );
+/*
+   NAME: OCINumberHypTan - OCINumber takes the TaNgent Hyperbolic of an Oracle
+                           number
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - argument of the tangent hyperbolic
+        result (OUT) - result of the tangent hyperbolic
+   DESCRIPTION:
+        Takes the hyperbolic tangent of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+   NOTES:
+        An Oracle number overflow causes an unpredictable result value.
+ */
+
+/*--------------------------- OCINumberExp ----------------------------------*/
+
+sword OCINumberExp(    OCIError *err, CONST OCINumber *number, 
+                       OCINumber *result    );
+/*
+   NAME: OCINumberExp - OCINumber EXPonential
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - e raised to this Oracle number power
+        result (OUT) - output of exponentiation
+   DESCRIPTION:
+        Raises e to the specified Oracle number power
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+ */
+
+/*----------------------------- OCINumberLn ---------------------------------*/
+
+sword OCINumberLn(    OCIError *err, CONST OCINumber *number, 
+                      OCINumber *result    );
+/*
+   NAME: OCINumberLn - OCINumber Logarithm Natural
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        number (IN) - logarithm of this number is computed
+        result (OUT) - logarithm result
+   DESCRIPTION:
+        Takes the logarithm of the given Oracle number with respect
+        to the given base.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+          'number' is <= 0
+ */
+
+/*----------------------------- OCINumberLog --------------------------------*/
+
+sword OCINumberLog(    OCIError *err, CONST OCINumber *base, 
+                       CONST OCINumber *number, OCINumber *result    );
+/*
+   NAME: OCINumberLog - OCINumber LOGarithm any base
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        base (IN) - base of the logarithm
+        number (IN) - opearnd
+        result (OUT) - logarithm result
+   DESCRIPTION:
+        Takes the logarithm with the specified base of an Oracle number.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          any of the number arguments is null
+          'number' is <= 0
+          'base' is <= 0
+ */
+
+/*****************************************************************************/
+/*                             ORACLE DATE TYPE                              */
+/*****************************************************************************/
+ 
+struct OCITime
+{
+  ub1 OCITimeHH;                          /* hours; range is 0 <= hours <=23 */
+  ub1 OCITimeMI;                     /* minutes; range is 0 <= minutes <= 59 */
+  ub1 OCITimeSS;                     /* seconds; range is 0 <= seconds <= 59 */
+};
+typedef struct OCITime OCITime;
+
+/* 
+ * OCITime - OCI TiMe portion of date
+ *
+ * This structure should be treated as an opaque structure as the format
+ * of this structure may change. Use OCIDateGetTime/OCIDateSetTime 
+ * to manipulate time portion of OCIDate.
+ */
+
+struct OCIDate
+{
+  sb2 OCIDateYYYY;         /* gregorian year; range is -4712 <= year <= 9999 */
+  ub1 OCIDateMM;                          /* month; range is 1 <= month < 12 */
+  ub1 OCIDateDD;                             /* day; range is 1 <= day <= 31 */
+  OCITime OCIDateTime;                                               /* time */
+};
+typedef struct OCIDate OCIDate;
+
+/* 
+ * OCIDate - OCI oracle Date representation in C
+ *
+ * OCIDate represents the C mapping of Oracle date.
+ *
+ * This structure should be treated as an opaque structure as the format
+ * of this structure may change. Use OCIDateGetDate/OCIDateSetDate
+ * to access/initialize OCIDate.
+ *
+ * For binding variables of type OCIDate in OCI calls (OCIBindByName(),
+ * OCIBindByPos(), and OCIDefineByPos()) use the type code SQLT_ODT.
+ */
+
+/*
+   EXAMPLE 
+
+   The following example shows how to manipulate an attribute of type 
+   oracle date.
+  
+     #define FMT "Month dd, YYYY, HH:MI A.M."
+     #define LANG "American"
+
+     struct person
+     {
+       OCIDate start_date;
+     };
+     typedef struct person person;
+
+     OCIError *err;
+     person *joe;
+     sword status;                                           /o error status o/
+     
+     /o See oci.h for an example of how to initialize OCIError.
+      o For this example, assume the OCIEnv and OCIError has been
+      o initialized.
+      o/
+
+     /o Pin joe person object in the object cache. See ori.h
+      o for an example on pinning objects. For this example, assume that
+      o joe is pointing to the pinned object.
+      o/
+
+     /o set the start date of joe o/
+     OCIDateSetTime(&joe->start_date, 8, 0, 0);
+     OCIDateSetDate(&joe->start_date, 1990, 10, 5); 
+
+     /o check if the date is valid o/
+     uword invalid;
+     if (OCIDateCheck(err, &joe->start_date, &invalid) != OCI_SUCCESS)
+       /o error handling code o/
+     if (invalid)
+       /o error handling code o/
+
+     /o convert date for display purposes o/
+     char str[100];
+     ub4 strlen = sizeof(str);
+     if (OCIDateToText(err, &joe->start_date, FMT, sizeof(FMT)-1, LANG,
+                sizeof(LANG)-1, &strlen, str) != OCI_SUCCESS)
+       /o error handling code o/
+
+ */
+
+/*--------------------------- OCIDateGetTime --------------------------------*/
+/* void OCIDateGetTime(/o_ CONST OCIDate *date, ub1 *hour, ub1 *min, 
+                           ub1 *sec _o/); */
+#define OCIDateGetTime(date, hour, min, sec) \
+  { \
+     *hour = (date)->OCIDateTime.OCITimeHH; \
+     *min = (date)->OCIDateTime.OCITimeMI; \
+     *sec = (date)->OCIDateTime.OCITimeSS; \
+  }
+/*
+   NAME: OCIDateGetTime - OCIDate Get Time portion of date
+   PARAMETERS:
+        date (IN) - Oracle date whose time data is retrieved
+        hour (OUT) - hour value returned
+        min (OUT) - minute value returned
+        sec (OUT) - second value returned
+   DESCRIPTION:
+        Return time inforamtion stored in the given date. The time
+        information returned is: hour, minute and seconds.
+   RETURNS:
+        NONE
+ */
+
+/*--------------------------- OCIDateGetDate --------------------------------*/
+/* void OCIDateGetDate(/o_ CONST OCIDate *date, sb2 *year, ub1 *month, 
+                           ub1 *day _o/); */
+#define OCIDateGetDate(date, year, month, day) \
+  { \
+     *year = (date)->OCIDateYYYY; \
+     *month = (date)->OCIDateMM; \
+     *day = (date)->OCIDateDD; \
+  }
+/*
+   NAME: OCIDateGetDate - OCIDate Get Date (year, month, day) portion of date
+   PARAMETERS:
+        date (IN) - Oracle date whose year, month, day data is retrieved
+        year (OUT) - year value returned
+        month (OUT) - month value returned
+        day (OUT) - day value returned
+   DESCRIPTION:
+        Return year, month, day inforamtion stored in the given date.
+   RETURNS:
+        NONE
+ */
+
+/*--------------------------- OCIDateSetTime --------------------------------*/
+/* void OCIDateSetTime(/o_ OCIDate *date, ub1 hour, ub1 min, 
+                           ub1 sec _o/); */
+#define OCIDateSetTime(date, hour, min, sec) \
+  { \
+     (date)->OCIDateTime.OCITimeHH = hour; \
+     (date)->OCIDateTime.OCITimeMI = min; \
+     (date)->OCIDateTime.OCITimeSS = sec; \
+  }
+/*
+   NAME: OCIDateSetTime - OCIDate Set Time portion of date
+   PARAMETERS:
+        date (OUT) - Oracle date whose time data is set
+        hour (IN) - hour value to be set 
+        min (IN) - minute value to be set
+        sec (IN) - second value to be set
+   DESCRIPTION:
+        Set the date with the given time inforamtion.
+   RETURNS:
+        NONE
+ */
+
+/*--------------------------- OCIDateSetDate --------------------------------*/
+/* void OCIDateSetDate(/o_ OCIDate *date, sb2 year, ub1 month, ub1 day _o/); */
+#define OCIDateSetDate(date, year, month, day) \
+  { \
+     (date)->OCIDateYYYY = year; \
+     (date)->OCIDateMM = month; \
+     (date)->OCIDateDD = day; \
+  }
+/*
+   NAME: OCIDateSetDate - OCIDate Set Date (year, month, day) portion of date
+   PARAMETERS:
+        date (IN) - Oracle date whose year, month, day data is set
+        year (OUT) - year value to be set
+        month (OUT) - month value to be set
+        day (OUT) - day value to be set
+   DESCRIPTION:
+        Set the date with the given year, month, day inforamtion.
+   RETURNS:
+        NONE
+ */
+
+/*--------------------------- OCIDateAssign ---------------------------------*/
+
+sword OCIDateAssign(    OCIError *err, CONST OCIDate *from, 
+                        OCIDate *to    );
+/*
+   NAME: OCIDateAssign - OCIDate Assignment
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        from (IN) - date to be assigned
+        to (OUT) - lhs of assignment
+   DESCRIPTION:
+        Performs date assignment.
+   RETURNS:
+        OCI_SUCCESS
+ */
+
+/*--------------------------- OCIDateToText ---------------------------------*/
+
+sword OCIDateToText(    OCIError *err, CONST OCIDate *date, 
+                        CONST oratext *fmt, ub1 fmt_length, 
+                        CONST oratext *lang_name, ub4 lang_length, 
+                        ub4 *buf_size, oratext *buf    );
+/*
+   NAME: OCIDateToText - OCIDate convert date TO String 
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        date (IN) - Oracle date to be converted
+        fmt (IN) - conversion format, if null string pointer (oratext*)0, then
+                the date is converted to a character string in the
+                date format "DD-MON-YY".
+        fmt_length (IN) - length of the 'fmt' parameter
+        lang_name (IN) - specifies the language in which the names and 
+                abbreviations of months and days are returned;
+                default language of session is used if 'lang_name' 
+                is null i.e. (oratext *)0
+        lang_length (IN) - length of the 'nls_params' parameter
+        buf_size (IN/OUT) - size of the buffer; size of the resulting string
+                is returned via this parameter
+        buf (OUT) - buffer into which the converted string is placed
+   DESCRIPTION:
+        Converts the given date to a string according to the specified format.
+        Refer to "TO_DATE" conversion function described in
+        "Oracle SQL Language Reference Manual" for a description of format
+        and NLS arguments. The converted null-terminated date string is
+        stored in the buffer 'buf'.
+ 
+        An error is reported upon overflow, e.g. trying to convert a number
+        of value 10 using format '9' causes an overflow.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          buffer too small
+          invalid format
+          unknown language
+          overflow error
+ */
+
+/*---------------------------- OCIDateFromText ------------------------------*/
+
+sword OCIDateFromText(    OCIError *err, CONST oratext *date_str, 
+                        ub4 d_str_length, CONST oratext *fmt, ub1 fmt_length, 
+                        CONST oratext *lang_name, ub4 lang_length, 
+                        OCIDate *date    );
+/*
+   NAME: OCIDateFromText - OCIDate convert String TO Date
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        date_str (IN) - input string to be converted to Oracle date
+        d_str_length (IN) - size of the input string, if the length is -1
+                then 'date_str' is treated as a null terminated  string
+        fmt (IN) - conversion format; if 'fmt' is a null pointer, then
+                the string is expected to be in 'DD-MON-YY' format.
+        fmt_length (IN) - length of the 'fmt' parameter
+        lang_name (IN) - language in which the names and abbreviations of
+                days and months are specified, if null i.e. (oratext *)0,
+                the default language of session is used, 
+        lang_length (IN) - length of the 'lang_name' parameter
+        date (OUT) - given string converted to date
+   DESCRIPTION:
+        Converts the given string to Oracle date
+        according to the specified format. Refer to "TO_DATE" conversion
+        function described in "Oracle SQL Language Reference Manual" for a
+        description of format.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          invalid format
+          unknown language
+          invalid input string
+          <to be discovered>
+ */
+
+/*----------------------------- OCIDateCompare ------------------------------*/
+
+sword OCIDateCompare(    OCIError *err, CONST OCIDate *date1, 
+                     CONST OCIDate *date2, sword *result    );
+/*
+   NAME: OCIDateCompare - OCIDate CoMPare dates
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        date1, date2 (IN) - dates to be compared
+        result (OUT) - comparison result, 0 if equal, -1 if date1 < date2, 
+                1 if date1 > date2
+   DESCRIPTION:
+        The function OCIDateCompare compares two dates. It returns -1 if date1 
+        is smaller than date2, 0 if they are equal, and 1 if date1 is greater 
+        than date2.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          invalid date
+          <to be discovered>
+ */
+
+/*------------------------- OCIDateAddMonths --------------------------------*/
+
+sword OCIDateAddMonths(    OCIError *err, CONST OCIDate *date, sb4 num_months,
+                           OCIDate *result    );
+/*
+   NAME: OCIDateAddMonths - OCIDate ADd or subtract Months
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        date (IN) - 'num_months' added or subtracted from 'date'
+        num_months (IN) - number of months to be added or subtracted 
+                (a negative value will be subtracted)
+        result (IN/OUT) - result of adding or subtracting to 'date'
+   DESCRIPTION:
+        The function OCIDateAddDays adds or subtracts num_months from the 
+        date 'date'.
+          If the input 'date' is the last day of a month, then 
+        appropriate adjustments are made to ensure that the output date is 
+        also the last day of the month. For example, Feb. 28 + 1 month =
+        March 31, and November 30 - 3 months = August 31. Otherwise the
+        'result' date has the same day component as 'date'. 
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          invalid date
+          <to be discovered>
+ */
+
+/*--------------------------- OCIDateAddDays --------------------------------*/
+
+sword OCIDateAddDays(    OCIError *err, CONST OCIDate *date, sb4 num_days,
+                         OCIDate *result    );
+/*
+   NAME: OCIDateAddDays - OCIDate ADd or subtract Days
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        date (IN) - 'num_days' added or subtracted from 'date'
+        num_days (IN) - number of days to be added or subtracted 
+                (a negative value will be subtracted)
+        result (IN/OUT) - result of adding or subtracting to 'date'
+   DESCRIPTION:
+        The function OCIDateAddDays adds or subtracts num_days from the 
+        date 'date'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          invalid date
+          <to be discovered>
+ */
+
+/*--------------------------- OCIDateLastDay --------------------------------*/
+
+sword OCIDateLastDay(    OCIError *err, CONST OCIDate *date, 
+                         OCIDate *last_day    );
+/*
+   NAME: OCIDateLastDay - OCIDate get date of the LaST day of the month
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        date (IN) - input date
+        last_day (OUT) - last day of the month in date 'date'
+   DESCRIPTION:
+        The function OCIDateLastDay returns the date of the last day of the
+        month in date 'date'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          invalid date
+          <to be discovered>
+ */
+
+/*----------------------- OCIDateDaysBetween --------------------------------*/
+
+sword OCIDateDaysBetween(    OCIError *err, CONST OCIDate *date1, 
+                             CONST OCIDate *date2, sb4 *num_days    );
+/*
+   NAME: OCIDateDaysBetween - OCIDate get number of days BeTWeen two dates
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        date1, date2 (IN) - input dates
+        num_days (OUT) - number of days between date1 and date2
+   DESCRIPTION:
+        The function OCIDateDaysBetween returns the number of days between 
+        date1 and date2. The time is ignored in this computation.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          invalid date
+          <to be discovered>
+ */
+
+/*------------------------ OCIDateZoneToZone --------------------------------*/
+
+sword OCIDateZoneToZone(    OCIError *err, CONST OCIDate *date1,
+                            CONST oratext *zon1,
+                            ub4 zon1_length, CONST oratext *zon2, 
+                            ub4 zon2_length, OCIDate *date2    );
+/*
+   NAME: OCIDateZoneToZone - OCIDate convert date from one Zone TO another Zone
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        date1 (IN) - date to be converted
+        zon1 (IN) - zone of input date
+        zon1_length (IN) - length in bytes of string 'zon1'
+        zon2 (IN) - zone to be converted to
+        zon2_length (IN) - length in bytes of string 'zon2'
+        date2 (OUT) - converted date (in 'zon2')
+   DESCRIPTION:
+        Converts date from one time zone to another. Given date 'date1' 
+        in time zone 'zon1' returns date 'date2' in time zone 'zon2'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          invlid date
+          invald input time zone
+          invald output time zone
+          <to be discovered>
+ */
+
+/*--------------------------- OCIDateNextDay --------------------------------*/
+
+sword OCIDateNextDay(    OCIError *err, CONST OCIDate *date, 
+                         CONST oratext *day_p, ub4 day_length, 
+                         OCIDate *next_day    );
+/*
+   NAME: OCIDateNextDay - OCIDate get date of Next DaY
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        date (IN) - returned date should be later than this date
+        day (IN) - first day of week named by this is returned
+        day_length (IN) - length in bytes of string 'day'
+        next_day (OUT) - first day of the week named by 'day' later than 'date'
+   DESCRIPTION:
+        Returns the date of the first day of the
+        week named by 'day' that is later than date 'date'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          invalid date
+          invalid day
+          <to be discovered>
+ */
+
+/*----------------------------- OCIDateCheck --------------------------------*/
+
+/* Listing of error bits used by OCIDateCheck() */
+#define OCI_DATE_INVALID_DAY            0x1                       /* Bad DAy */
+#define OCI_DATE_DAY_BELOW_VALID        0x2   /* Bad DAy Low/high bit (1=low)*/
+#define OCI_DATE_INVALID_MONTH          0x4                     /* Bad MOnth */
+#define OCI_DATE_MONTH_BELOW_VALID      0x8 /* Bad MOnth Low/high bit (1=low)*/
+#define OCI_DATE_INVALID_YEAR           0x10                     /* Bad YeaR */
+#define OCI_DATE_YEAR_BELOW_VALID       0x20 /* Bad YeaR Low/high bit (1=low)*/
+#define OCI_DATE_INVALID_HOUR           0x40                     /* Bad HouR */
+#define OCI_DATE_HOUR_BELOW_VALID       0x80 /* Bad HouR Low/high bit (1=low)*/
+#define OCI_DATE_INVALID_MINUTE         0x100                  /* Bad MiNute */
+#define OCI_DATE_MINUTE_BELOW_VALID     0x200
+                                           /* Bad MiNute Low/high bit (1=low)*/
+#define OCI_DATE_INVALID_SECOND         0x400                  /* Bad SeCond */
+#define OCI_DATE_SECOND_BELOW_VALID     0x800
+                                           /* bad second Low/high bit (1=low)*/
+#define OCI_DATE_DAY_MISSING_FROM_1582  0x1000
+                                  /* Day is one of those "missing" from 1582 */
+#define OCI_DATE_YEAR_ZERO              0x2000    /* Year may not equal zero */
+#define OCI_DATE_INVALID_FORMAT         0x8000      /* Bad date format input */
+
+sword OCIDateCheck(    OCIError *err, CONST OCIDate *date, uword *valid    );
+/*
+   NAME: OCIDateCheck - OCIDate CHecK if the given date is valid
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        date (IN) - date to be checked
+        valid (OUT) -  returns zero for a valid date, otherwise 
+                the ORed combination of all error bits specified below:
+  
+   Macro name                   Bit number      Error
+   ----------                   ----------      -----
+   OCI_DATE_INVALID_DAY         0x1             Bad day
+   OCI_DATE_DAY_BELOW_VALID     0x2             Bad DAy Low/high bit (1=low)
+   OCI_DATE_INVALID_MONTH       0x4             Bad MOnth
+   OCI_DATE_MONTH_BELOW_VALID   0x8             Bad MOnth Low/high bit (1=low)
+   OCI_DATE_INVALID_YEAR        0x10            Bad YeaR
+   OCI_DATE_YEAR_BELOW_VALID    0x20            Bad YeaR Low/high bit (1=low)
+   OCI_DATE_INVALID_HOUR        0x40            Bad HouR
+   OCI_DATE_HOUR_BELOW_VALID    0x80            Bad HouR Low/high bit (1=low)
+   OCI_DATE_INVALID_MINUTE      0x100           Bad MiNute
+   OCI_DATE_MINUTE_BELOW_VALID  0x200           Bad MiNute Low/high bit (1=low)
+   OCI_DATE_INVALID_SECOND      0x400           Bad SeCond
+   OCI_DATE_SECOND_BELOW_VALID  0x800           bad second Low/high bit (1=low)
+   OCI_DATE_DAY_MISSING_FROM_1582 0x1000        Day is one of those "missing"
+                                                from 1582
+   OCI_DATE_YEAR_ZERO           0x2000          Year may not equal zero
+   OCI_DATE_INVALID_FORMAT      0x8000          Bad date format input
+  
+   So, for example, if the date passed in was 2/0/1990 25:61:10 in
+   (month/day/year hours:minutes:seconds format), the erroor returned
+   would be OCI_DATE_INVALID_DAY | OCI_DATE_DAY_BELOW_VALID |
+   OCI_DATE_INVALID_HOUR | OCI_DATE_INVALID_MINUTE
+
+   DESCRIPTION:
+        Check if the given date is valid.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          'date' and 'valid' pointers are NULL pointers
+ */
+
+/*--------------------------- OCIDateSysDate --------------------------------*/
+
+sword OCIDateSysDate(    OCIError *err, OCIDate *sys_date    );
+/*
+   NAME: OCIDateSysDate - OCIDate get current SYStem date and time
+   PARAMETERS:
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        sys_date (OUT) - current system date and time
+   DESCRIPTION:
+        Returns the current system date and time.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+          <to be discovered>
+ */
+
+/*****************************************************************************/
+/*                  FIXED-LENGTH STRING - CHAR (N)                           */
+/*****************************************************************************/
+
+/*
+ * An ADT attribute declared as "x CHAR(n)" is mapped to "OCIString *x;".
+ * The representation of OCIString * is shown below.
+ */
+
+/*****************************************************************************/
+/*                  VARIABLE-LENGTH STRING                                   */
+/*****************************************************************************/
+
+/*
+ * The variable-length string is represented in C as a pointer to OCIString
+ * structure. The OCIString structure is opaque to the user. Functions are
+ * provided to allow the user to manipulate a variable-length string.
+ *     
+ * A variable-length string can be declared as:
+ *
+ * OCIString *vstr;
+ *
+ * For binding variables of type OCIString* in OCI calls (OCIBindByName(),
+ * OCIBindByPos() and OCIDefineByPos()) use the external type code SQLT_VST.
+ */
+typedef struct OCIString OCIString;
+
+/*-------------------------- OCIStringAssign --------------------------------*/
+ 
+sword OCIStringAssign(    OCIEnv *env, OCIError *err, CONST OCIString *rhs, 
+                          OCIString **lhs    );
+/*
+   NAME: OCIStringAssign - OCIString Assign String to String
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        rhs (IN) - RHS of the assignment, the type of rhs is also OCIString
+        lhs (IN/OUT) - LHS of the assignment
+   DESCRIPTION:
+        Assign 'rhs' string to 'lhs' string. The 'lhs' string may be
+        resized depending upon the size of the 'rhs'. The assigned string is
+        null-terminated. The 'length' field will not include the extra byte
+        needed for null termination.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          out of space error
+ */
+ 
+/*---------------------- OCIStringAssignText --------------------------------*/
+ 
+sword OCIStringAssignText(    OCIEnv *env, OCIError *err, CONST oratext *rhs, 
+                              ub4 rhs_len, OCIString **lhs    );
+/*
+   NAME: OCIStringAssignText - OCIString Assign Text string to String
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        rhs (IN) - RHS of the assignment, the type of rhs is a text string
+        rhs_len (IN) - length of the 'rhs' string
+        lhs (IN/OUT) - LHS of the assignment
+   DESCRIPTION:
+        Assign 'rhs' string to 'lhs' string. The 'lhs' string may be
+        resized depending upon the size of the 'rhs'. The assigned string is
+        null-terminated. The 'length' field will not include the extra byte
+        needed for null termination.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          out of space error
+ */
+
+/*-------------------------- OCIStringResize --------------------------------*/
+
+sword OCIStringResize(    OCIEnv *env, OCIError *err, ub4 new_size, 
+                          OCIString **str    );
+/*
+   NAME: OCIStringResize - OCIString ReSiZe string memory
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        new_size (IN) - new memory size of the string in bytes
+        str (IN/OUT) - allocated memory for the string is freed from the 
+                OOCI heap
+   DESCRIPTION:
+        This function resizes the memory of the given variable-length string in
+        the object cache. The contents of the string are NOT preserved.
+        This function may allocate the string in a new memory region in
+        which case the original memory occupied by the given string will
+        be freed. If the input string is null (str == NULL), then this
+        function will allocate memory for the string.
+ 
+        If the new_size is 0, then this function frees the memory occupied
+        by 'str' and a null pointer value is returned.
+ 
+        NOTE: The caller must compute 'new_size' taking into account space
+        for the null character ('\0').
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          out of space error
+ */
+
+/*---------------------------- OCIStringSize --------------------------------*/
+
+ub4 OCIStringSize(    OCIEnv *env, CONST OCIString *vs    );
+/*
+   NAME: OCIStringSize - OCIString Get String siZe
+   PARAMETERS:
+        env(IN) - pointer to OCI environment handle
+        vs (IN) - string whose size is returned
+   DESCRIPTION:
+        Return the size of the given string.
+   RETURNS:
+        size of the string in bytes is returned
+ */
+
+/*----------------------------- OCIStringPtr --------------------------------*/
+
+oratext *OCIStringPtr(    OCIEnv *env, CONST OCIString *vs    );
+/*
+   NAME: OCIStringPtr - OCIString Get String Pointer
+   PARAMETERS:
+        env(IN) - pointer to OCI environment handle
+        vs (IN) - pointer to the text of this string is returned
+   DESCRIPTION:
+        Return the pointer to the text of the given string.
+   RETURNS:
+        pointer to the text of the string is returned
+ */
+
+/*----------------------- OCIStringAllocSize --------------------------------*/
+ 
+sword OCIStringAllocSize(    OCIEnv *env, OCIError *err, CONST OCIString *vs, 
+                             ub4 *allocsize    );
+/*
+   NAME: OCIStringAllocSize - OCIString get Allocated SiZe of string memory 
+                              in bytes
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        vs (IN) - string whose allocated size in bytes is returned
+        allocsize (OUT) - allocated size of string memory in bytes is returned
+   DESCRIPTION:
+        Return the allocated size of the string memory in bytes. The
+        allocated size is >= actual string size.
+   REQUIRES:
+        vs is a non-null pointer
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR on error
+ */
+
+/*****************************************************************************/
+/*                       VARIABLE-LENGTH RAW                                 */
+/*****************************************************************************/
+
+/*
+ * The variable-length raw is represented in C as a pointer to OCIRaw
+ * structure. The OCIRaw structure is opaque to the user. Functions are
+ * provided to allow the user to manipulate a variable-length raw.
+ *     
+ * A variable-length raw can be declared as:
+ *
+ * OCIRaw *raw;
+ *
+ * For binding variables of type OCIRaw* in OCI calls (OCIBindByName(),
+ * OCIBindByPos() and OCIDefineByPos()) use the external type code SQLT_LVB.
+ */
+typedef struct OCIRaw OCIRaw;
+
+/*-------------------------- OCIRawAssignRaw --------------------------------*/
+ 
+sword OCIRawAssignRaw(    OCIEnv *env, OCIError *err, CONST OCIRaw *rhs, 
+                          OCIRaw **lhs    );
+/*
+   NAME: OCIRawAssignRaw - OCIRaw Assign Raw (of type OCIRaw*) to
+                   Raw (of type OCIRaw*)
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        rhs (IN) - RHS of the assignment, the type of rhs is also OCIRaw
+        lhs (IN/OUT) - LHS of the assignment
+   DESCRIPTION:
+        Assign 'rhs' raw to 'lhs' raw. The 'lhs' raw may be
+        resized depending upon the size of the 'rhs'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          out of space error
+ */
+ 
+/*------------------------ OCIRawAssignBytes --------------------------------*/
+ 
+sword OCIRawAssignBytes(    OCIEnv *env, OCIError *err, CONST ub1 *rhs, 
+                            ub4 rhs_len, OCIRaw **lhs    );
+/*
+   NAME: OCIRawAssignBytes - OCIRaw Assign raw Bytes (of type ub1*) to Raw 
+                   (of type OCIRaw*)
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        rhs (IN) - RHS of the assignment, the type of rhs is ub1 *
+        rhs_len (IN) - length of the 'rhs' raw
+        lhs (IN/OUT) - LHS of the assignment
+   DESCRIPTION:
+        Assign 'rhs' raw to 'lhs' raw. The 'lhs' raw may be
+        resized depending upon the size of the 'rhs'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          out of space error
+ */
+
+/*---------------------------- OCIRawResize ---------------------------------*/
+ 
+sword OCIRawResize(    OCIEnv *env, OCIError *err, ub4 new_size, 
+                       OCIRaw **raw    );
+/*
+   NAME: OCIRawResize - OCIRaw ReSiZe memory of variable-length raw
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        new_size (IN) - new size of the raw data in bytes
+        raw (IN) - variable-length raw pointer; the raw is
+                resized to 'new_size'
+   DESCRIPTION:
+        This function resizes the memory of the given variable-length raw in
+        the object cache. 
+        The previous contents of the raw are NOT preserved.
+        This function may allocate the raw in a new memory region in
+        which case the original memory occupied by the given raw will
+        be freed. If the input raw is null (raw == NULL), then this
+        function will allocate memory for the raw data.
+ 
+        If the new_size is 0, then this function frees the memory occupied
+        by 'raw' and a null pointer value is returned.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          out of space error
+ */
+
+/*------------------------------- OCIRawSize --------------------------------*/
+
+ub4 OCIRawSize(    OCIEnv * env, CONST OCIRaw *raw    );
+/*
+   NAME: OCIRawSize - OCIRaw Get Raw siZe
+   PARAMETERS:
+        env (IN)  - pointer to OCI environment handle
+        raw (INT) - raw whose size is returned
+   DESCRIPTION:
+        Return the size of the given raw.
+   RETURNS:
+        size of the raw in bytes is returned
+ */
+
+/*--------------------------------- OCIRawPtr -------------------------------*/
+ub1 *OCIRawPtr(    OCIEnv * env, CONST OCIRaw *raw    );
+/*
+   NAME: OCIRawPtr - OCIRaw Get Raw data Pointer
+   PARAMETERS:
+        env (IN) - pointer to OCI environment handle
+        raw (IN) - pointer to the data of this raw is returned
+   DESCRIPTION:
+        Return the pointer to the data of the given raw.
+   RETURNS:
+        pointer to the data of the raw is returned
+ */
+
+/*------------------------------ OCIRawAllocSize ----------------------------*/
+ 
+sword OCIRawAllocSize(    OCIEnv *env, OCIError *err, CONST OCIRaw *raw,
+                          ub4 *allocsize    );
+/*
+   NAME: OCIRawAllocSize - OCIRaw get Allocated SiZe of raw memory in bytes
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        raw (IN) - raw whose allocated size in bytes is returned
+        allocsize (OUT) - allocated size of raw memory in bytes is returned
+   DESCRIPTION:
+        Return the allocated size of the raw memory in bytes. The
+        allocated size is >= actual raw size.
+   REQUIRES:
+        raw is a non-null pointer
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR upon error
+ */
+
+/*****************************************************************************/
+/*                     OBJECT REFERENCE OPERATIONS                           */
+/*****************************************************************************/
+
+/* 
+ * See the definition of OCIRef in oro.h.
+ *
+ * For binding variables of type OCIRef* in OCI calls (OCIBindByName(),
+ * OCIBindByPos() and OCIDefineByPos()) use the code SQLT_REF.
+ * 
+ */
+
+/*---------------------------- OCIRefClear ----------------------------------*/
+void OCIRefClear(    OCIEnv *env, OCIRef *ref    );
+/*
+   NAME: OCIRefClear - OCIRef CLeaR or nullify a ref
+   PARAMETERS:
+        env (IN)     - pointer to OCI environment handle
+        ref (IN/OUT) - ref to clear
+   DESCRIPTION:
+        Clear or nullify the given ref. A ref is considered to be a null ref
+        if it does not contain a valid OID (and thus doesn't point to an
+        object). Logically, a null ref is a dangling ref.
+
+        Note that a null ref is still a valid SQL value and is not SQL-ly null.
+        It can be used as a valid non-null constant ref value for NOT NULL
+        column or attribute of a row in a table.
+        
+        If a null pointer value is passed as a ref,
+        then this function is a no-op.
+ */
+
+/*--------------------------- OCIRefAssign ----------------------------------*/
+sword OCIRefAssign(    OCIEnv *env, OCIError *err, CONST OCIRef *source, 
+                       OCIRef **target    );
+/*
+   NAME: OCIRefAssign - OCIRef CoPY a ref to another
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        source (IN) - ref to copy from
+        target (IN/OUT) - ref to copy to
+   DESCRIPTION:
+        Copy 'source' ref to 'target' ref; both then reference the same
+        object. If the target ref pointer is null (i.e. *target == NULL)
+        then the copy function will allocate memory for the target ref
+        in OOCI heap prior to the copy.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          1) out of memory
+ */
+
+/*-------------------------- OCIRefIsEqual ----------------------------------*/
+boolean OCIRefIsEqual(    OCIEnv *env, CONST OCIRef *x, CONST OCIRef *y    );
+/*
+   NAME: OCIRefIsEqual - OCIRef compare two refs for EQUality
+   PARAMETERS:
+        env (IN) - pointer to OCI environment handle
+        x (IN)   - ref to compare
+        y (IN)   - ref to compare
+   DESCRIPTION:
+        Compare the given refs for equality.
+        Two refs are equal if and only if:
+          - they are both referencing the same persistent object, or
+          - they are both referencing the same transient object.
+
+        NOTE THAT TWO NULL REFS ARE CONSIDERED NOT EQUAL BY THIS FUNCTION.
+   RETURNS:
+        TRUE if the two refs are equal
+        FALSE if the two refs are not equal, or X is NULL, or Y is NULL
+ */
+
+/*--------------------------- OCIRefIsNull ----------------------------------*/
+boolean OCIRefIsNull(    OCIEnv *env, CONST OCIRef *ref    );
+/*
+   NAME: OCIRefIsNull - OCIRef test if a ref is NULl
+   PARAMETERS:
+        env (IN) - pointer to OCI environment handle
+        ref (IN) - ref to test for null
+   DESCRIPTION:
+        Return TRUE if the given ref is null; otherwise, return FALSE.
+        A ref is null if and only if:
+        - it is supposed to be referencing a persistent object, but
+          its OID is null, or
+        - it is supposed to be referencing a transient object, but it is
+          currently not pointing to an object.
+        A ref is a dangling ref if the object that it points to does not
+        exist.
+   RETURNS:
+        TRUE if the given ref is NULL
+        FALSE if the given ref is not NULL
+ */
+
+/*-------------------------- OCIRefHexSize ----------------------------------*/
+ub4 OCIRefHexSize(    OCIEnv *env, CONST OCIRef *ref    );
+/*
+   NAME: OCIRefHexSize - OCIRef Hexadecimal buffer SiZe in bytes
+   PARAMETERS:
+        env (IN) - pointer to OCI environment handle
+        ref (IN) - ref whose size in hexadecimal representation in bytes is
+                returned
+   DESCRIPTION:
+        Return the size of the buffer in bytes required for the hexadecimal
+        representation of the ref. A buffer of at-least this size must be
+        passed to ref-to-hex (OCIRefToHex) conversion function.
+   RETURNS:
+        size of hexadecimal representation of ref
+ */
+
+/*-------------------------- OCIRefFromHex ---------------------------------*/
+sword OCIRefFromHex(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+                        CONST oratext *hex, ub4 length, OCIRef **ref    );
+/*
+   NAME:
+        OCIRefFromHex - OCIRef convert a Hexadecimal string TO a Ref
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by
+                calling OCIErrorGet().
+        svc (IN) - OCI service context handle; if the resulting ref is
+                initialized with this service context
+        hex (IN) - hexadecimal string (that was produced by 'OCIRefToHex()"
+                previously) to be convert into a ref
+        length (IN) - length of the hexadecimal string
+        ref (IN/OUT) - ref is initialized with the given value ('hex').
+                If *ref is null, then space for the ref is allocated in the
+                object cache, otherwise the memory occupied by the given ref
+                is re-used.
+   DESCRIPTION:
+        Convert the given hexadecimal string into a ref. This function
+        ensures that the resulting ref is well formed. It does NOT ensure
+        that the object pointed to by the resulting ref exists or not.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+ */
+
+/*--------------------------- OCIRefToHex -----------------------------------*/
+sword OCIRefToHex(    OCIEnv *env, OCIError *err, CONST OCIRef *ref, 
+                      oratext *hex, ub4 *hex_length    );
+/*
+   NAME:
+        OCIRefToHex - OCIRef convert ref to a Hexadecimal string
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by
+                calling OCIErrorGet().
+        ref (IN) - ref to be converted into a hexadecimal string; if the
+                ref is a null ref (i.e. OCIRefIsNull(ref) == TRUE) then
+                a zero hex_length value is returned
+        hex (OUT) - buffer that is large enough to contain the resulting
+                hexadecimal string; the contents of the string is opaque
+                to the caller
+        hex_length (IN/OUT) - on input specifies the size of the 'hex' buffer,
+                on output specifies the actual size of the hexadecimal
+                string being returned in 'hex'
+   DESCRIPTION:
+        Convert the given ref into a hexadecimal string, and return the length
+        of the string. The resulting string is opaque to the caller.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          the given buffer is not big enough to hold the resulting string
+ */
+
+
+/*****************************************************************************/
+/*                          COLLECTION FUNCTIONS                             */
+/*****************************************************************************/
+
+/* 
+   The generic collection is represented by the type 'OCIColl'. The following
+   operations OCIColl*() are provided on a generic collection:
+     - get current size of collection
+     - get upper bound of collection
+     - get pointer to an element given its index
+     - set element at given index (assign element)
+     - append an element 
+     - trim the given number of elements from the end of the collection
+     - collection assignment
+
+   The following iterator based scanning functions are also provided on a
+   generic collection. These functions make use of an iterator which is
+   defined to be of type OCIIter.
+
+     - create an iterator for scanning collection
+     - destroy iterator
+     - reset iterator to the beginning of collection
+     - get pointer to current element pointed by iterator
+     - get pointer to next element
+     - get pointer to previous element
+
+   The collections variable-length array (varray) and nested table
+   are sub-types of generic collection. This means that the OCIColl*() 
+   functions can also be used to manipulate varray and nested table.
+
+   The varray is represented by OCIArray type and nested table by OCITable.
+   Besides OCIColl*() functions no additional functions are provided for
+   manipulating varrays. The OCIColl*() functions are a complete set of 
+   functions to manipulate varrays.
+
+   Besides OCIColl*() functions, the following functions OCITable*() can be 
+   used to manipulate nested table. The OCITable*() functions operate on 
+   nested tables only and should not be used on a varray.
+
+     - delete an element at index i. Note that the position
+       ordinals of the remaining elements of the table is not changed by the
+       delete operation. So delete creates "holes" in the table.
+     - check if an element exists at the given index i
+     - return the smallest value of i for which exists(i) is true
+     - return the largest value of i for which exists(i) is true
+     - return pointer to the smallest position j, greater than i, such that 
+       OCITableExists(j) is true
+     - return pointer to the largest position j, less than i, such that 
+       OCITableExists(j) is true
+
+   For binding variables of type OCIColl* or OCITable* in OCI calls
+   (OCIBindByName(), OCIBindByPos() and OCIDefineByPos()) use the external
+   type code SQLT_NTY.
+ */
+
+/* OCIColl - generic collection type */
+typedef struct OCIColl OCIColl;
+
+/* OCIArray - varray collection type */
+typedef OCIColl OCIArray;
+
+/* OCITable - nested table collection type */
+typedef OCIColl OCITable;
+
+/* OCIIter - collection iterator */
+typedef struct OCIIter OCIIter;
+
+/*----------------------------- OCICollSize ---------------------------------*/
+
+sword OCICollSize( OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+                   sb4 *size );
+/*
+   NAME: OCICollSize - OCIColl return current SIZe of the given collection
+   PARAMETERS:
+        env(IN) - pointer to OCI environment handle
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        coll (IN) - collection whose number of elements is returned
+        size (OUT) - current number of elements in the collection
+   DESCRIPTION:
+          Returns the current number of elements in the given collection.
+
+          For collections of type nested table wherein 'delete element'
+          operation is allowed, the count returned by OCICollSize() will
+          NOT be decremented upon deleting elements. For example:
+
+            OCICollSize(...); 
+            // assume 'size' returned is equal to 5
+            OCITableDelete(...); // delete one element
+            OCICollSize(...);
+            // 'size' returned will still be 5
+
+          To get the count minus the deleted elements use OCITableSize(). 
+          Continuing the above example,
+
+            OCITableSize(...)
+            // 'size' returned will be equal to 4
+
+          Note, a trim operation (OCICollTrim) will decrement the count 
+          by the number of trimmed elements. Continuing the above example,
+
+            OCICollTrim(..,1..); // trim one element
+            OCICollSize(...);
+            // 'size' returned will be equal to 4
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          error during loading of collection into object cache
+          any of the input parameters is null
+ */
+
+/*------------------------------ OCICollMax ---------------------------------*/
+
+sb4 OCICollMax(    OCIEnv *env, CONST OCIColl *coll    );
+/*
+   NAME: OCICollMax - OCIColl return MAXimum size (upper-bound) of the
+                   given collection (in number of elements)
+   PARAMETERS:
+        env(IN) - pointer to OCI environment handle
+        coll (IN) - collection whose upper-bound in number of elements 
+                is returned
+   DESCRIPTION:
+        Returns the max number of elements that the given collection can hold.
+        A value 0 indicates that the collection has no upper-bound.
+   REQUIRES:
+        coll must point to a valid collection descriptor
+   RETURNS:
+        upper-bound of the given collection
+ */
+
+/*-------------------------- OCICollGetElem ---------------------------------*/
+
+sword OCICollGetElem(    OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+                         sb4 index, boolean *exists, dvoid **elem, 
+                         dvoid **elemind    );
+/*
+   NAME: OCICollGetElem - OCIColl GET pointer to the element at the given index
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        coll (IN) - pointer to the element in this collection is returned
+        index (IN) - index of the element whose pointer is returned
+        exists (OUT) - set to FALSE if element at the specified index does 
+                not exist else TRUE
+        elem (OUT) - address of the desired element is returned
+        elemind (OUT) [optional] - address of the null indicator information 
+                is returned; if (elemind == NULL) then the null indicator
+                information will NOT be returned
+   DESCRIPTION:
+        Get the address of the element at the given position. Optionally
+        this function also returns the address of the element's null indicator
+        information.
+ 
+        The following table describes for each collection element type
+        what the corresponding element pointer type is. The element pointer
+        is returned via the 'elem' parameter of OCICollGetElem().
+ 
+           Element Type                       *elem is set to
+        -----------------------               ---------------
+         Oracle Number (OCINumber)              OCINumber*
+         Date (OCIDate)                         OCIDate*
+         Variable-length string (OCIString*)    OCIString**
+         Variable-length raw (OCIRaw*)          OCIRaw**
+         object reference (OCIRef*)             OCIRef**
+         lob locator (OCILobLocator*)           OCILobLocator**
+         object type (e.g. person)              person*
+ 
+        The element pointer returned by OCICollGetElem() is in a form
+        such that it can not only be used to access the
+        element data but also is in a form that can be used as the target
+        (i.e left-hand-side) of an assignment statement.
+ 
+        For example, assume the user is iterating over the elements of
+        a collection whose element type is object reference (OCIRef*). A call
+        to OCICollGetElem() returns pointer to a reference handle
+        (i.e. OCIRef**). After getting, the pointer to the collection
+        element, the user may wish to modify it by assigning a new reference.
+        This can be accomplished via the ref assignment function shown below:
+ 
+        sword OCIRefAssign( OCIEnv *env, OCIError *err, CONST OCIRef *source,
+                            OCIRef **target );
+ 
+        Note that the 'target' parameter of OCIRefAssign() is of type
+        'OCIRef**'. Hence OCICollGetElem() returns 'OCIRef**'.
+        If '*target == NULL' a new ref will be allocated by OCIRefAssign()
+        and returned via the 'target' parameter.
+ 
+        Similarly, if the collection element was of type string (OCIString*),
+        OCICollGetElem() returns pointer to string handle
+        (i.e. OCIString**). If a new string is assigned, via
+        OCIStringAssign() or OCIStringAssignText() the type of the target
+        must be 'OCIString **'.
+ 
+        If the collection element is of type Oracle number, OCICollGetElem()
+        returns OCINumber*. The prototype of OCINumberAssign() is shown below:
+ 
+        sword OCINumberAssign(OCIError *err, CONST OCINumber *from,
+                              OCINumber *to);
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+ */
+
+/*------------------------- OCICollGetElemArray -----------------------------*/
+
+sword OCICollGetElemArray(  OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+                            sb4 index, boolean *exists, dvoid **elem, 
+                            dvoid **elemind, uword *nelems);
+/*
+   NAME: OCICollGetElemArray - OCIColl GET pointers to elements from given index
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        coll (IN) - pointers to the elements in this collection is returned
+        index (IN) - starting index of the element
+        exists (OUT) - set to FALSE if element at the specified index does 
+                not exist else TRUE
+        elem (OUT) - address of the desired elements is returned
+        elemind (OUT) [optional] - address of the null indicators information 
+                is returned; if (elemind == NULL) then the null indicator
+                information will NOT be returned
+        nelems(IN/OUT) - Upper bound of elem and/or elemind array
+   DESCRIPTION:
+        Get the address of the elements from the given position. Optionally
+        this function also returns the address of the element's null indicator
+        information.
+ 
+        The following table describes for each collection element type
+        what the corresponding element pointer type is. The element pointer
+        is returned via the 'elem' parameter of OCICollGetElem().
+ 
+           Element Type                       *elem is set to
+        -----------------------               ---------------
+         Oracle Number (OCINumber)              OCINumber*
+         Date (OCIDate)                         OCIDate*
+         Variable-length string (OCIString*)    OCIString**
+         Variable-length raw (OCIRaw*)          OCIRaw**
+         object reference (OCIRef*)             OCIRef**
+         lob locator (OCILobLocator*)           OCILobLocator**
+         object type (e.g. person)              person*
+ 
+        The element pointer returned by OCICollGetElem() is in a form
+        such that it can not only be used to access the
+        element data but also is in a form that can be used as the target
+        (i.e left-hand-side) of an assignment statement.
+ 
+        For example, assume the user is iterating over the elements of
+        a collection whose element type is object reference (OCIRef*). A call
+        to OCICollGetElem() returns pointer to a reference handle
+        (i.e. OCIRef**). After getting, the pointer to the collection
+        element, the user may wish to modify it by assigning a new reference.
+        This can be accomplished via the ref assignment function shown below:
+ 
+        sword OCIRefAssign( OCIEnv *env, OCIError *err, CONST OCIRef *source,
+                            OCIRef **target );
+ 
+        Note that the 'target' parameter of OCIRefAssign() is of type
+        'OCIRef**'. Hence OCICollGetElem() returns 'OCIRef**'.
+        If '*target == NULL' a new ref will be allocated by OCIRefAssign()
+        and returned via the 'target' parameter.
+ 
+        Similarly, if the collection element was of type string (OCIString*),
+        OCICollGetElem() returns pointer to string handle
+        (i.e. OCIString**). If a new string is assigned, via
+        OCIStringAssign() or OCIStringAssignText() the type of the target
+        must be 'OCIString **'.
+ 
+        If the collection element is of type Oracle number, OCICollGetElem()
+        returns OCINumber*. The prototype of OCINumberAssign() is shown below:
+ 
+        sword OCINumberAssign(OCIError *err, CONST OCINumber *from,
+                              OCINumber *to);
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+ */
+
+/*----------------------- OCICollAssignElem ---------------------------------*/
+
+sword OCICollAssignElem(    OCIEnv *env, OCIError *err, sb4 index, 
+                            CONST dvoid *elem, 
+                            CONST dvoid *elemind, OCIColl *coll    );
+/*
+   NAME: OCICollAssignElem - OCIColl ASsign Element
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        index (IN) - index of the element whose is assigned to
+        elem (IN) - element which is assigned from (source element)
+        elemind (IN) [optional] - pointer to the element's null indicator 
+                information; if (elemind == NULL) then the null indicator
+                information of the assigned element will be set to non-null.
+        coll (IN/OUT) - collection to be updated
+   DESCRIPTION:
+        Assign the given element value 'elem' to the element at coll[index].
+        If the collection is of type nested table, the element at the given 
+        index may not exist (i.e. may have been deleted). In this case, the 
+        given element is inserted at index 'index'.
+        Otherwise, the element at index 'index' is updated with the value
+        of 'elem'.
+  
+        Note that the given element is deep-copied and 
+        'elem' is strictly an input parameter.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+          out of memory error
+          given index is out of bounds of the given collection
+ */
+
+/*--------------------------- OCICollAssign ---------------------------------*/
+
+sword OCICollAssign(    OCIEnv *env, OCIError *err, CONST OCIColl *rhs, 
+                        OCIColl *lhs    );
+/*
+   NAME: OCICollAssign - OCIColl ASsiGn collection
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        rhs (IN) - collection to be assigned from
+        lhs (OUT) - collection to be assigned to
+   DESCRIPTION:
+        Assign 'rhs' to 'lhs'. The 'lhs' collection may be decreased or 
+        increased depending upon the size of 'rhs'. If the 'lhs' contains 
+        any elements then the elements will be deleted prior to the 
+        assignment. This function performs a deep-copy. The memory for the 
+        elements comes from the object cache.
+ 
+        An error is returned if the element types of the lhs and rhs 
+        collections do not match. Also, an error is returned if the 
+        upper-bound of the lhs collection is less than the current number of 
+        elements in the rhs collection.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+          out of memory error
+          type mis-match of lhs and rhs collections
+          upper-bound of lhs collection is less than the current number of 
+          elements in the rhs collection
+ */
+
+/*--------------------------- OCICollAppend ---------------------------------*/
+
+sword OCICollAppend(    OCIEnv *env, OCIError *err, CONST dvoid *elem, 
+                        CONST dvoid *elemind, OCIColl *coll    );
+/*
+   NAME: OCICollAppend - OCIColl APPend collection
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the element which is appended to the end
+                of the given collection
+        elemind (IN) [optional] - pointer to the element's null indicator 
+                information; if (elemind == NULL) then the null indicator
+                information of the appended element will be set to non-null.
+        coll (IN/OUT) - updated collection
+   DESCRIPTION:
+        Append the given element to the end of the given collection. 
+        Appending an element is equivalent to:
+          - increasing the size of the collection by 1 element
+          - updating (deep-copying) the last element's data with the given 
+            element's data
+  
+        Note that the pointer to the given element 'elem' will not be saved 
+        by this function. So 'elem' is strictly an input parameter.
+        An error is returned if the current size of the collection
+        is equal to the max size (upper-bound) of the collection prior to 
+        appending the element.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+          out of memory error
+          current size of collection == max size of the collection
+ */
+
+/*----------------------------- OCICollTrim ---------------------------------*/
+
+sword OCICollTrim(    OCIEnv *env, OCIError *err, sb4 trim_num, 
+                      OCIColl *coll    );
+/*
+   NAME: OCICollTrim - OCIColl Trim elements from the end of the collection
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        trim_num (IN) - number of elements to trim
+        coll (IN/OUT) - 'trim_num' of elements are removed (freed) from the
+                end of the collection
+   DESCRIPTION:
+        Trim the collection by the given number of elements. The elements are 
+        removed from the end of the collection.
+  
+        An error is returned if the 'trim_num' is greater than the current 
+        size of the collection.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+          'trim_num' is greater than the current size of the collection.
+ */
+
+/*--------------------------- OCICollIsLocator ------------------------------*/
+
+sword OCICollIsLocator(OCIEnv *env, OCIError *err, CONST OCIColl *coll,
+                       boolean *result );
+/*
+Name: OCICollIsLocator - OCIColl indicates whether a collection is locator
+                         based or not.
+Parameters:
+        env(IN) - pointer to OCI environment handle
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        coll (IN) - collection item.
+        result (OUT) - TRUE if the collection item is a locator, FALSE
+                       otherwise
+Description:
+        Returns TRUE in the result OUT parameter if the collection item is a
+        locator, otherwise returns FALSE.
+Returns:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+*/
+
+/*---------------------------- OCIIterCreate --------------------------------*/
+
+sword OCIIterCreate(    OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+                        OCIIter **itr    );
+/*
+   NAME: OCIIterCreate - OCIColl Create an ITerator to scan the collection
+                      elements
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        coll (IN) - collection which will be scanned; the different 
+                collection types are varray and nested table
+        itr (OUT) - address to the allocated collection iterator is
+                returned by this function
+   DESCRIPTION:
+        Create an iterator to scan the elements of the collection. The
+        iterator is created in the object cache. The iterator is initialized
+        to point to the beginning of the collection.
+  
+        If the next function (OCIIterNext) is called immediately 
+        after creating the iterator then the first element of the collection 
+        is returned. 
+        If the previous function (OCIIterPrev) is called immediately after 
+        creating the iterator then "at beginning of collection" error is 
+        returned.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+          out of memory error
+ */
+
+/*----------------------------- OCIIterDelete ------------------------------*/
+
+sword OCIIterDelete(    OCIEnv *env, OCIError *err, OCIIter **itr    );
+/*
+   NAME: OCIIterDelete - OCIColl Delete ITerator
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        itr (IN/OUT) - the allocated collection iterator is destroyed and
+                the 'itr' is set to NULL prior to returning
+   DESCRIPTION:
+        Delete the iterator which was previously created by a call to 
+        OCIIterCreate.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+          to be discovered
+ */
+
+/*----------------------------- OCIIterInit ---------------------------------*/
+
+sword OCIIterInit(    OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+                      OCIIter *itr    );
+/*
+   NAME: OCIIterInit - OCIColl Initialize ITerator to scan the given 
+                   collection
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        coll (IN) - collection which will be scanned; the different 
+                collection types are varray and nested table
+        itr (IN/OUT) - pointer to an allocated  collection iterator
+   DESCRIPTION:
+        Initializes the given iterator to point to the beginning of the 
+        given collection. This function can be used to:
+  
+        a. reset an iterator to point back to the beginning of the collection 
+        b. reuse an allocated iterator to scan a different collection
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+ */
+
+/*------------------------ OCIIterGetCurrent --------------------------------*/
+
+sword OCIIterGetCurrent(    OCIEnv *env, OCIError *err, CONST OCIIter *itr, 
+                            dvoid **elem, dvoid **elemind    );
+/*
+   NAME: OCIIterGetCurrent - OCIColl Iterator based, get CURrent collection
+                    element
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        itr (IN) - iterator which points to the current element
+        elem (OUT) - address of the element pointed by the iterator is returned
+        elemind (OUT) [optional] - address of the element's null indicator 
+                information is returned; if (elemind == NULL) then the null 
+                indicator information will NOT be returned
+   DESCRIPTION:
+        Returns pointer to the current element and its corresponding null
+        information.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+ */
+
+/*------------------------------ OCIIterNext --------------------------------*/
+
+sword OCIIterNext(    OCIEnv *env, OCIError *err, OCIIter *itr, 
+                      dvoid **elem, dvoid **elemind, boolean *eoc    );
+/*
+   NAME: OCIIterNext - OCIColl Iterator based, get NeXT collection element
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        itr (IN/OUT) - iterator is updated to point to the next element
+        elem (OUT) - after updating the iterator to point to the next element,
+                address of the element is returned
+        elemind (OUT) [optional] - address of the element's null indicator 
+                information is returned; if (elemind == NULL) then the null 
+                indicator information will NOT be returned
+        eoc (OUT) - TRUE if iterator is at End Of Collection (i.e. next
+                element does not exist) else FALSE
+   DESCRIPTION:
+        Returns pointer to the next element and its corresponding null
+        information. The iterator is updated to point to the next element.
+  
+        If the iterator is pointing to the last element of the collection
+        prior to executing this function, then calling this function will 
+        set eoc flag to TRUE. The iterator will be left unchanged in this
+        situation.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+ */
+
+/*------------------------------ OCIIterPrev --------------------------------*/
+
+sword OCIIterPrev(    OCIEnv *env, OCIError *err, OCIIter *itr, 
+                      dvoid **elem, dvoid **elemind, boolean *boc    );
+/*
+   NAME: OCIIterPrev - OCIColl Iterator based, get PReVious collection element
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        itr (IN/OUT) - iterator is updated to point to the previous 
+                element
+        elem (OUT) - after updating the iterator to point to the previous 
+                element, address of the element is returned
+        elemind (OUT) [optional] - address of the element's null indicator 
+                information is returned; if (elemind == NULL) then the null 
+                indicator information will NOT be returned
+        boc (OUT) - TRUE if iterator is at Beginning Of Collection (i.e.
+                previous element does not exist) else FALSE.
+   DESCRIPTION:
+        Returns pointer to the previous element and its corresponding null
+        information. The iterator is updated to point to the previous element.
+  
+        If the iterator is pointing to the first element of the collection
+        prior to executing this function, then calling this function will 
+        set 'boc' to TRUE. The iterator will be left unchanged in this 
+        situation.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+ */
+
+/*****************************************************************************/
+/*           FUNCTIONS WHICH OPERATE ONLY ON NESTED TABLE OCITable*()        */
+/*****************************************************************************/
+
+/*---------------------------- OCITableSize ---------------------------------*/
+
+sword OCITableSize( OCIEnv *env, OCIError *err, CONST OCITable *tbl, 
+                    sb4 *size);
+/*
+   NAME: OCITableSize - OCITable return current SIZe of the given 
+                   nested table (not including deleted elements)
+   PARAMETERS:
+        env(IN) - pointer to OCI environment handle
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tbl (IN) - nested table whose number of elements is returned
+        size (OUT) - current number of elements in the nested table. The count
+                does not include deleted elements.
+   DESCRIPTION:
+        Returns the count of elements in the given nested table. 
+
+        The count returned by OCITableSize() will be decremented upon 
+        deleting elements from the nested table. So, this count DOES NOT 
+        includes any "holes" created by deleting elements. 
+        For example:
+
+            OCITableSize(...); 
+            // assume 'size' returned is equal to 5
+            OCITableDelete(...); // delete one element
+            OCITableSize(...);
+            // 'size' returned will be equal to 4
+
+        To get the count plus the count of deleted elements use 
+        OCICollSize(). Continuing the above example,
+
+            OCICollSize(...)
+            // 'size' returned will still be equal to 5
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          error during loading of nested table into object cache
+          any of the input parameters is null
+ */
+
+/*---------------------- OCITableExists ---------------------------------*/
+
+sword OCITableExists(    OCIEnv *env, OCIError *err, CONST OCITable *tbl,
+                             sb4 index, boolean *exists    );
+/*
+   NAME: OCITableExists - OCITable test whether element at the given index
+                    EXIsts
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tbl (IN) - table in which the given index is checked
+        index (IN) - index of the element which is checked for existence
+        exists (OUT) - set to TRUE if element at given 'index' exists
+                else set to FALSE
+   DESCRIPTION:
+        Test whether an element exists at the given 'index'.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+ */
+
+/*--------------------------- OCITableDelete -------------------------------*/
+
+sword OCITableDelete(    OCIEnv *env, OCIError *err, sb4 index, 
+                      OCITable *tbl    );
+/*
+   NAME: OCITableDelete - OCITable DELete element at the specified index
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        index (IN) - index of the element which must be deleted
+        tbl (IN) - table whose element is deleted
+   DESCRIPTION:
+        Delete the element at the given 'index'. Note that the position
+        ordinals of the remaining elements of the table is not changed by the
+        delete operation. So delete creates "holes" in the table.
+
+        An error is returned if the element at the specified 'index' has
+        been previously deleted.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          any of the input parameters is null
+          given index is not valid
+ */
+
+/*--------------------------- OCITableFirst ---------------------------------*/
+
+sword OCITableFirst(    OCIEnv *env, OCIError *err, CONST OCITable *tbl, 
+                        sb4 *index     );
+/*
+   NAME: OCITableFirst - OCITable return FirST index of table
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tbl (IN) - table which is scanned
+        index (OUT) - first index of the element which exists in the given 
+                table is returned
+   DESCRIPTION:
+        Return the first index of the element which exists in the given 
+        table. 
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          table is empty
+ */
+
+/*---------------------------- OCITableLast ---------------------------------*/
+
+sword OCITableLast(    OCIEnv *env, OCIError *err, CONST OCITable *tbl, 
+                       sb4 *index     );
+/*
+   NAME: OCITableFirst - OCITable return LaST index of table
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tbl (IN) - table which is scanned
+        index (OUT) - last index of the element which exists in the given 
+                table is returned
+   DESCRIPTION:
+        Return the last index of the element which exists in the given 
+        table. 
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          table is empty
+ */
+
+/*---------------------------- OCITableNext ---------------------------------*/
+
+sword OCITableNext(    OCIEnv *env, OCIError *err, sb4 index, 
+                       CONST OCITable *tbl, sb4 *next_index,
+                       boolean *exists    );
+/*
+   NAME: OCITableNext - OCITable return NeXT available index of table
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        index (IN) - starting at 'index' the index of the next element
+                which exists is returned
+        tbl (IN) - table which is scanned
+        next_index (OUT) - index of the next element which exists 
+                is returned
+        exists (OUT) - FALSE if no next index available else TRUE
+   DESCRIPTION:
+        Return the smallest position j, greater than 'index', such that 
+        exists(j) is TRUE.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          no next index available
+ */
+
+/*---------------------------- OCITablePrev ---------------------------------*/
+
+sword OCITablePrev(    OCIEnv *env, OCIError *err, sb4 index, 
+                       CONST OCITable *tbl, sb4 *prev_index,
+                       boolean *exists    );
+/*
+   NAME: OCITablePrev - OCITable return PReVious available index of table
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        index (IN) - starting at 'index' the index of the previous element
+                which exists is returned
+        tbl (IN) - table which is scanned
+        prev_index (OUT) - index of the previous element which exists 
+                is returned
+        exists (OUT) - FALSE if no next index available else TRUE
+   DESCRIPTION:
+        Return the largest position j, less than 'index', such that 
+        exists(j) is TRUE.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
+        OCI_ERROR if
+          no previous index available
+ */
+
+/*------------------------ OCINumberToLnx -----------------------------------*/
+/* void OCINumberToLnx(/o_ OCINumber *num _o/); */
+
+#define OCINumberToLnx(num) ((lnxnum_t *)num)
+
+/* 
+   NAME:   OCINumberToLnx
+   PARAMETERS:
+           num (IN) - OCINumber to convert ;
+   DESCRIPTION: 
+           Converts OCINumber to its internal lnx format 
+           This is not to be used in Public interfaces , but
+           has been provided due to special requirements from 
+           SQLPLUS development group as they require to call 
+           Core funtions directly . 
+*/
+
+/* OCI representation of XMLType */
+typedef struct OCIXMLType OCIXMLType;
+
+/* OCI representation of OCIDomDocument */
+typedef struct OCIDOMDocument OCIDOMDocument;
+
+#endif /* ORL_ORACLE */
diff --git a/src/terralib/drivers/Oracle/OCI/include/oro.h b/src/terralib/drivers/Oracle/OCI/include/oro.h
new file mode 100644
index 0000000..bf1e8f8
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/oro.h
@@ -0,0 +1,883 @@
+/* Copyright (c) 1994, 2003, Oracle Corporation.  All rights reserved.  */
+
+/*
+  NAME
+    OCI - Oracle Object Interface for External/Internal/Kernel Clients
+
+  DESCRIPTION
+    This header file contains Oracle object interface definitions which
+    can be included by external user applications, tools, as well as
+    the kernel.  It defines types and constants that are common to all
+    object interface which is being defined in several other header files
+    (e.g., ori.h, ort.h, and orl.h).
+
+  RELATED DOCUMENTS
+    TBD
+
+  INSPECTION STATUS [[ deletable if no inspection ]]
+    Inspection date:    [[ date of the last logging meeting ]]
+    Inspection status:  [[ exited, not exited, or N/A if exit is not a goal ]]
+    Estimated increasing cost defects per page:
+    Rule sets:          [[ rule sets inspected against or planned to be 
+                           inspected against ]]
+
+  ACCEPTANCE REVIEW STATUS [[ deletable if no approval review ]]
+    Review date:    [[ date of the meeting where issues were logged and the 
+                       approval status was decided ]] 
+    Review status:  [[ current status:  accepted, conditionally accepted, 
+                       major revision required, rejected ]]
+    Reviewers:      [[ names of the members on the review team ]]
+
+  PUBLIC FUNCTIONS
+
+  EXAMPLES
+    Examples are given in the description of each function or macro where
+    relevant.
+
+  MODIFIED
+    mnanal     06/09/03 - backout of fix 2836388
+    mnanal     05/14/03 - bug-2836388
+    srseshad   11/27/02 - Change OCI_TYPECODE_BFLOAT/BDOUBLE codes
+    rxgovind   10/09/02 - add OCI_TYPECODE_UROWID
+    mxyang     09/17/02 - grabtrans 'mmorsi_obj_float'
+    srseshad   09/11/02 - 
+    srseshad   09/01/02 - 
+    aahluwal   06/03/02 - bug 2360115
+    celsbern   10/19/01 - merge LOG to MAIN
+    rxgovind   10/16/01 - update typecodes
+    rxgovind   09/19/01 - add typecodes
+    rkasamse   08/15/01 - add OCI_DURATION_USER_CALLBACK
+    jchai      09/24/01 - add type code for PLS_INTEGER
+    porangas   08/22/01 - Fix bug#1776434
+    schatter   04/09/01 - merge 1456235: define OCI_DURATION_INVALID
+    rdani      10/12/00 - 1449943 NOCOPY and PIPELINE
+    ciyer      05/26/00 - short names for abstract, overriding
+    rkasamse   05/25/00 - OCCI enhancements
+    smuralid   05/11/00 - OCITypeMethodFlags - add NOT INSTANTIABLE, OVERRIDING
+    rxgovind   05/09/00 - add OCI_TYPECODE_NONE
+    tnbui      07/28/99 - Remove OCI_TYPECODE_TIMESTAMP_ITZ                    
+    tnbui      07/21/99 - TS LOCAL TZ                                          
+    thoang     06/21/99 - Add OCI_TYPECODE_TIMESTAMP_ITZ
+    thoang     03/04/99 - Add datetime datatypes
+    rkasamse   10/20/98 - add OCI_ATTR_CACHE_ARRAYFLUSH
+    rkasamse   10/29/98 - add OCI_DURATION_CALLOUT
+    rkasamse   04/28/98 - OCI_OBJECT_DETECTCHANGE -> OCI_ATTR_OBJECT_DETECTCHAN
+    rkasamse   04/28/98 - OCI_OBJECT_NEWNOTNULL -> OCI_ATTR_OBJECT_NEWNOTNULL  
+    rkasamse   04/23/98 - add OCI_OBJECT_DETECTCHANGE
+    rkasamse   04/03/98 - add OCI_OBJECT_NEWNOTNULL                            
+    pmitra     04/01/98 - OCI_LOCK_X_NOWAIT added                              
+    rxgovind   02/18/98 - add OCI_TYPECODE_OPAQUE
+    rkasamse   02/13/98 - Add OCI_DURATION_PROCESS
+    cxcheng    07/28/97 - fix compile with SLSHORTNAME
+    skrishna   07/14/97 - add OCIObjectGetProperty
+    cxcheng    04/30/97 - make OCITypeParamMode values consistent with PL/SQL
+    skrishna   04/28/97 - undocument OCIObjectProperty & OCIObjectEvent
+    cxcheng    03/29/97 - remove all remaining short names
+    sthakur    03/20/97 - add casts to constants
+    cxcheng    02/21/97 - temporarily put SLSHORTNAME for PL/SQL
+    cxcheng    02/06/97 - take out short name support except with SLSHORTNAME
+    lchidamb   01/20/97 - update OCIRef comments
+    sgollapu   11/19/96 - Add OCI type codes for BOOL,REC,and TAB
+    cxcheng    11/19/96 - more typecode changes
+    cxcheng    11/13/96 - add #include for ocidfn.h
+    cxcheng    11/13/96 - add OCI_TYPECODE_ADT for compatibility
+    cxcheng    11/12/96 - add SQLT_NCO for named collection
+    cxcheng    11/11/96 - more changes to typecodes
+    cxcheng    11/07/96 - #define OCI_TYPECODE_MLSLABEL to SQLT_LAB
+    cxcheng    11/06/96 - fix #define omission for OROTCNAT
+    cxcheng    10/30/96 - move OCI_TYPECODE_* to ocidfn.h as SQLT_*
+    cxcheng    10/28/96 - more beautification changes
+    jboonleu   10/29/96 - add flags for freeing object
+    dchatter   10/26/96 - delete redef of OCISvcCtx, OCIError, OCIEnv
+    cxcheng    10/15/96 - more changes
+    cxcheng    10/14/96 - more final fixes to constants
+    mluong     10/11/96 -
+    mluong     10/11/96 -  KOCON and KONSP are in lowercase
+    mluong     10/11/96 -  add some define per Calvin
+    cxcheng    10/09/96 -  add #define for OROOCOSFN to OCI_COPY_NOREF
+    jboonleu   10/08/96 -  change OROOCOSFN to OCICopyFlag
+    jboonleu   10/07/96 -  use new OCI names for cache options
+    cxcheng    10/07/96 -  add OROTCS02 for KOTTCBRI and OROTCS03 as spare
+    cxcheng    10/07/96 -  more lint fixes
+    cxcheng    10/02/96 -  move oronsp to ko.h as konsp
+    cxcheng    10/01/96 -  add long names for readability
+    cxcheng    10/01/96 -  remove orotty and orotal
+    rjenkins   09/28/96 -  2k char 4k varchar2
+    jboonleu   09/27/96 -  add macro used only in beta2
+    cxcheng    09/27/96 -  move oroenv to oroenv.h
+    cxcheng    09/24/96 -  remove unnecessary orotyp
+    cxcheng    09/25/96 -  add typecode OROTCS01 as placeholder for lob pointer
+    cxcheng    09/20/96 -  add TDO load option orotgo
+    jboonleu   09/18/96 -  add OROOPOREC
+    jboonleu   09/10/96 -  add OROOPODFL
+    jweisz     08/27/96 -  add SQL internal typecode OROTCS00
+    cxcheng    08/02/96 -  add PLSQL internal typecodes OROTCP..
+    cxcheng    08/01/96 -  add OROTCFAR to fill up space left by OROTCCAR
+    jboonleu   07/16/96 -  new pin option
+    cxcheng    06/18/96 -  add casts to OROTNOPRE and OROTNOSCL
+    cxcheng    05/29/96 -  change OROTCNPT back to OROTCDOM
+    vkrishna   05/27/96 -  add OROTCCAR
+    cxcheng    05/17/96 -  replace OROTCFAR with OROTCCAR
+    cxcheng    05/08/96 -  change orotmf from ub1 to ub2
+    cxcheng    05/07/96 -  fix public defines for method types
+    cxcheng    04/30/96 -  change OROTCDOM to OROTCNPT
+    cxcheng    04/15/96 -  remove obsolete OROTTYICT
+    jboonleu   04/12/96 -  add new pin option
+    sthakur    04/12/96 -  add indicator type and indicator status
+    cxcheng    04/10/96 -  add function parameter codes for ORT/KOT
+    cxcheng    04/03/96 -  replace OROTCFAR as OROTCCAR
+    jwijaya    03/29/96 -  add OROTTCCAR
+    jwijaya    03/27/96 -  better comments for orotc
+    cxcheng    02/23/96 -  add typecodes for SMALLINT and VARCHAR2
+    skrishna   02/22/96 -  add oroind - null indicator type
+    cxcheng    02/21/96 -  change lob character codes to OROTCCLB, OROTCBLB...
+    jboonleu   02/06/96 -  new value for predefined duration
+    cxcheng    01/12/96 -  add OROTCCLO, OROTCBLO, OROTCFIL to orotc
+    cxcheng    12/05/95 -  add OROTCDOM and OROTCAAT to orotc
+    skotsovo   10/30/95 -  reserve space for internal 'oid' type
+    jwijaya    10/20/95 -  support variable-length ref
+    cxcheng    10/03/95 -  add OROTMFOR for ordering function to orotmf
+    cxcheng    10/03/95 -  Adding the ordering function type to orotmf
+    jboonleu   09/28/95 -  set OROODTPRE 
+    jboonleu   09/25/95 -  add oroodt
+    skotsovo   03/10/95 -  update to only include release 1 
+    jboonleu   02/15/95 -  add OROOPOREC, remove orocro, oroolo
+    skotsovo   01/30/95 -  add default max lengths for varrays and vstrings 
+    skotsovo   01/24/95 -  categorize sint32, double, and real as number types 
+                           (with precision and scale) instead of scalar types.
+    skotsovo   12/20/94 -  add release 1 types 
+    skotsovo   12/12/94 -  update according to new ots doc
+    skotsovo   12/01/94 -  add default precision and scale 
+    jwijaya    11/15/94 -  rename ORONSPTAB to ORONSPEXT 
+    jwijaya    10/25/94 -  tint 
+    jwijaya    10/06/94 -  add namespace 
+    jwijaya    10/02/94 -  connection handle -> connection number 
+    skotsovo   09/12/94 -  keep 0 as uninitialized value for ORT consts 
+    skotsovo   08/24/94 -  fix orotec 
+    skotsovo   08/17/94 -  modify type code names 
+    skotsovo   08/12/94 -  fix 141 lint errors 
+    skotsovo   07/25/94 -  modify categorization of complex types (orotc) 
+    skotsovo   07/07/94 -  change typecode enum values & add decimal type
+    skotsovo   07/01/94 -  change order of typecodes 
+    jwijaya    06/15/94 -  review 
+    jboonleu   06/13/94 -  add comments for the object cache options
+    jwijaya    06/13/94 -  adhere to the header file template 
+    skotsovo   06/09/94 -  make ots scalar type names consistent with the ots 
+                           document 
+    jwijaya    06/07/94 -  include oratypes.h instead of s.h 
+    skotsovo   05/24/94 -  change typecodes 
+    jwijaya    05/23/94 -  fix comments of ororef 
+    skotsovo   05/19/94 -  remove type composition 
+    skotsovo   05/09/94 -  modified orotc according to new OTS document
+    jwijaya    05/03/94 -  oroid and ororef
+    jwijaya    01/26/94 -  Creation
+*/
+
+
+#ifndef ORATYPES
+#include <oratypes.h>
+#endif
+
+#ifndef OCIDFN_ORACLE
+#include <ocidfn.h>
+#endif
+
+#ifndef ORO_ORACLE
+#define ORO_ORACLE
+
+/*---------------------------------------------------------------------------*/
+/*                         SHORT NAMES SUPPORT SECTION                       */
+/*---------------------------------------------------------------------------*/
+
+#ifdef SLSHORTNAME
+
+/* the following are short names that are only supported on IBM mainframes
+   with the SLSHORTNAME defined.
+   With this all subsequent long names will actually be substituted with
+   the short names here */
+
+#define OCIDuration                     oroodt
+#define OCIInd                          oroind
+#define OCILockOpt                      oroolm
+#define OCIMarkOpt                      oroomo
+#define OCIObjectEvent                  orocev
+#define OCIObjectProperty               oroopr
+#define OCIPinOpt                       oroopo
+#define OCIRef                          ororef
+#define OCIRefreshOpt                   orooro
+#define OCITypeCode                     orotc
+#define OCITypeEncap                    orotec
+#define OCITypeGetOpt                   orotgo
+#define OCITypeMethodFlag               orotmf
+#define OCITypeParamMode                orotpm
+#define OCIObjectPropId                 oroopi
+#define OCIObjectLifetime               oroolft
+#define OCIObjectMarkstatus             oroomst
+#define OCI_LOCK_NONE                   OROOLMNUL
+#define OCI_LOCK_X                      OROOLMX
+#define OCI_LOCK_X_NOWAIT               OROOLMXNW
+#define OCI_MARK_DEFAULT                OROOMODFL
+#define OCI_MARK_NONE                   OROOMONON
+#define OCI_MARK_UPDATE                 OROOMOUPD
+#define OCI_OBJECTEVENT_AFTER_FLUSH     OROCEVAFL
+#define OCI_OBJECTEVENT_AFTER_REFRESH   OROCEVARF
+#define OCI_OBJECTEVENT_BEFORE_FLUSH    OROCEVBFL
+#define OCI_OBJECTEVENT_BEFORE_REFRESH  OROCEVBRF
+#define OCI_OBJECTEVENT_WHEN_LOCK       OROCEVWLK
+#define OCI_OBJECTEVENT_WHEN_MARK_DELETED OROCEVWDL
+#define OCI_OBJECTEVENT_WHEN_MARK_UPDATED OROCEVWUP
+#define OCI_OBJECTEVENT_WHEN_UNMARK     OROCEVWUM
+#define OCI_OBJECTPROP_DIRTIED          OROOPRDRT
+#define OCI_OBJECTPROP_LOADED           OROOPRLOD
+#define OCI_OBJECTPROP_LOCKED           OROOPRLCK
+#define OCI_PIN_ANY                     OROOPOANY
+#define OCI_PIN_DEFAULT                 OROOPODFL
+#define OCI_PIN_LATEST                  OROOPOLST
+#define OCI_PIN_RECENT                  OROOPOREC
+#define OCI_REFRESH_LOADED              OROOROLOD
+#define OCI_TYPEENCAP_PRIVATE           OROTECPVT
+#define OCI_TYPEENCAP_PUBLIC            OROTECPUB
+#define OCI_TYPEGET_ALL                 OROTGOALL
+#define OCI_TYPEGET_HEADER              OROTGOHDR
+#define OCI_TYPEMETHOD_CONSTANT         OROTMCON
+#define OCI_TYPEMETHOD_CONSTRUCTOR      OROTMCSTR
+#define OCI_TYPEMETHOD_DESTRUCTOR       OROTMDSTR
+#define OCI_TYPEMETHOD_INLINE           OROTMINL
+#define OCI_TYPEMETHOD_MAP              OROTMMAP
+#define OCI_TYPEMETHOD_OPERATOR         OROTMOP
+#define OCI_TYPEMETHOD_ORDER            OROTMOR
+#define OCI_TYPEMETHOD_RNDS             OROTMRDS
+#define OCI_TYPEMETHOD_RNPS             OROTMRPS
+#define OCI_TYPEMETHOD_SELFISH          OROTMSLF
+#define OCI_TYPEMETHOD_VIRTUAL          OROTMVRT
+#define OCI_TYPEMETHOD_WNDS             OROTMWDS
+#define OCI_TYPEMETHOD_WNPS             OROTMWPS
+#define OCI_TYPEMETHOD_ABSTRACT         OROTMABSTRACT
+#define OCI_TYPEMETHOD_OVERRIDING       OROTMOVERRIDING
+#define OCI_TYPEMETHOD_PIPELINED        OROTMPIPELINED
+#define OCI_TYPEPARAM_BYREF             OROTPMREF
+#define OCI_TYPEPARAM_IN                OROTPMIN
+#define OCI_TYPEPARAM_INOUT             OROTPMIO
+#define OCI_TYPEPARAM_OUT               OROTPMOUT
+#define OCI_TYPEPARAM_OUTNCPY           OROTPMOUTNCPY
+#define OCI_TYPEPARAM_INOUTNCPY         OROTPMIONCPY
+
+#endif                                                        /* SLSHORTNAME */
+
+
+/*---------------------------------------------------------------------------*/
+/*                    PUBLIC TYPES, CONSTANTS AND MACROS                     */
+/*---------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------*/
+/*                  GENERAL OBJECT TYPES, CONSTANTS, MACROS                  */
+/*---------------------------------------------------------------------------*/
+
+/*------------------------- OBJECT REFERENCE (REF) --------------------------*/
+
+typedef struct OCIRef OCIRef;
+/*
+ * OCIRef - OCI object REFerence
+ *
+ * In the Oracle object runtime environment, an object is identified by an 
+ * object reference (ref) which contains the object identifier plus other 
+ * runtime information.  The contents of a ref is opaque to clients.  Use
+ * OCIObjectNew() to construct a ref.
+ */
+
+
+/*--------------------------- OBJECT INDICATOR ------------------------------*/
+
+typedef sb2 OCIInd;
+/*
+ * OCIInd -- a variable of this type contains (null) indicator information
+ */
+
+#define OCI_IND_NOTNULL (OCIInd)0                                /* not NULL */
+#define OCI_IND_NULL (OCIInd)(-1)                                    /* NULL */
+#define OCI_IND_BADNULL (OCIInd)(-2)                             /* BAD NULL */
+#define OCI_IND_NOTNULLABLE (OCIInd)(-3)                     /* not NULLable */
+
+/*---------------------------------------------------------------------------*/
+/*                               OBJECT CACHE                                */
+/*---------------------------------------------------------------------------*/
+
+/* To enable object change detection mode, set this to TRUE */
+#define OCI_ATTR_OBJECT_DETECTCHANGE            0x00000020
+
+/* To enable object creation with  non-NULL attributes by default, set the
+   following to TRUE.
+   By default, object is created with NULL attributes
+*/
+#define OCI_ATTR_OBJECT_NEWNOTNULL   0x00000010
+
+/* To enable sorting of the objects that belong to the same table
+   before being flushed through OCICacheFlush.
+   Please note that by enabling this object cache will not be flushing
+   the objects in the same order they were dirtied */
+#define OCI_ATTR_CACHE_ARRAYFLUSH 0x00000040
+
+/*--------------------------- OBJECT PIN OPTION -----------------------------*/
+
+enum OCIPinOpt
+{
+  /* 0 = uninitialized */
+  OCI_PIN_DEFAULT = 1,                                 /* default pin option */
+  OCI_PIN_ANY = 3,                          /* pin any copy of the object */
+  OCI_PIN_RECENT = 4,                    /* pin recent copy of the object */
+  OCI_PIN_LATEST = 5                     /* pin latest copy of the object */
+};
+typedef enum OCIPinOpt OCIPinOpt;
+
+/*
+ * OCIPinOpt - OCI object Pin Option 
+ *
+ * In the Oracle object runtime environment, the program has the option to
+ * specify which copy of the object to pin.  
+ *
+ * OCI_PINOPT_DEFAULT pins an object using the default pin option.  The default
+ * pin option can be set as an attribute of the OCI environment handle 
+ * (OCI_ATTR_PINTOPTION).  The value of the default pin option can be
+ * OCI_PINOPT_ANY, OCI_PINOPT_RECENT, or OCI_PIN_LATEST. The default option
+ * is initialized to OCI_PINOPT_ANY.
+ *
+ * OCI_PIN_ANY pins any copy of the object.  The object is pinned 
+ * using the following criteria:
+ *   If the object copy is not loaded, load it from the persistent store.
+ *   Otherwise, the loaded object copy is returned to the program. 
+ * 
+ * OCI_PIN_RECENT pins the latest copy of an object.  The object is 
+ * pinned using the following criteria:
+ *   If the object is not loaded, load the object from the persistent store
+ *       from the latest version.
+ *   If the object is not loaded in the current transaction and it is not 
+ *       dirtied, the object is refreshed from the latest version.
+ *   Otherwise, the loaded object copy is returned to the program. 
+ *
+ * OCI_PINOPT_LATEST pins the latest copy of an object.  The object copy is 
+ * pinned using the following criteria:
+ *   If the object copy is not loaded, load it from the persistent store.
+ *   If the object copy is loaded and dirtied, it is returned to the program.
+ *   Otherwise, the loaded object copy is refreshed from the persistent store.
+ */
+
+
+
+/*--------------------------- OBJECT LOCK OPTION ----------------------------*/
+
+enum OCILockOpt
+{
+  /* 0 = uninitialized */
+  OCI_LOCK_NONE = 1,                               /* null (same as no lock) */
+  OCI_LOCK_X = 2,                                          /* exclusive lock */
+  OCI_LOCK_X_NOWAIT = 3                      /* exclusive lock, do not wait  */
+};
+typedef enum OCILockOpt OCILockOpt;
+/*
+ * OCILockOpt - OCI object LOCK Option 
+ *
+ * This option is used to specify the locking preferences when an object is
+ * loaded from the server.
+ */
+
+
+/*------------------------- OBJECT MODIFYING OPTION -------------------------*/
+
+enum OCIMarkOpt
+{
+  /* 0 = uninitialized */
+  OCI_MARK_DEFAULT = 1,        /* default (the same as OCI_MARK_NONE) */
+  OCI_MARK_NONE = OCI_MARK_DEFAULT,   /* object has not been modified */
+  OCI_MARK_UPDATE                               /* object is to be updated */
+};
+typedef enum OCIMarkOpt OCIMarkOpt;
+/*
+ * OCIMarkOpt - OCI object Mark option
+ *
+ * When the object is marked updated, the client has to specify how the
+ * object is intended to be changed.  
+ */
+
+/*-------------------------- OBJECT Duration --------------------------------*/
+ 
+typedef ub2 OCIDuration;
+
+#define  OCI_DURATION_INVALID 0xFFFF                     /* Invalid duration */
+#define  OCI_DURATION_BEGIN (OCIDuration)10
+                                           /* beginning sequence of duration */
+#define  OCI_DURATION_NULL (OCIDuration)(OCI_DURATION_BEGIN-1)
+                                                            /* null duration */
+#define  OCI_DURATION_DEFAULT (OCIDuration)(OCI_DURATION_BEGIN-2) /* default */
+#define  OCI_DURATION_USER_CALLBACK (OCIDuration)(OCI_DURATION_BEGIN-3)
+#define  OCI_DURATION_NEXT (OCIDuration)(OCI_DURATION_BEGIN-4)
+                                                    /* next special duration */
+#define  OCI_DURATION_SESSION (OCIDuration)(OCI_DURATION_BEGIN)
+                                                  /* the end of user session */
+#define  OCI_DURATION_TRANS (OCIDuration)(OCI_DURATION_BEGIN+1)
+                                              /* the end of user transaction */
+/******************************************************************************
+**  DO NOT USE OCI_DURATION_CALL. IT  IS UNSUPPORTED                         **
+**  WILL BE REMOVED/CHANGED IN A FUTURE RELEASE                              **
+******************************************************************************/
+#define  OCI_DURATION_CALL (OCIDuration)(OCI_DURATION_BEGIN+2)
+                                       /* the end of user client/server call */
+#define  OCI_DURATION_STATEMENT (OCIDuration)(OCI_DURATION_BEGIN+3)
+
+/* This is to be used only during callouts.  It is similar to that 
+of OCI_DURATION_CALL, but lasts only for the duration of a callout.
+Its heap is from PGA */
+#define  OCI_DURATION_CALLOUT (OCIDuration)(OCI_DURATION_BEGIN+4)
+
+#define  OCI_DURATION_LAST OCI_DURATION_CALLOUT 
+                                             /* last of predefined durations */
+
+/* This is not being treated as other predefined durations such as 
+   SESSION, CALL etc, because this would not have an entry in the duration
+   table and its functionality is primitive such that only allocate, free,
+   resize memory are allowed, but one cannot create subduration out of this
+*/ 
+#define  OCI_DURATION_PROCESS (OCIDuration)(OCI_DURATION_BEGIN-5) 
+ 
+/*
+ * OCIDuration - OCI object duration
+ *
+ * A client can specify the duration of which an object is pinned (pin
+ * duration) and the duration of which the object is in memory (allocation
+ * duration).  If the objects are still pinned at the end of the pin duration,
+ * the object cache manager will automatically unpin the objects for the
+ * client. If the objects still exist at the end of the allocation duration,
+ * the object cache manager will automatically free the objects for the client.
+ *
+ * Objects that are pinned with the option OCI_DURATION_TRANS will get unpinned
+ * automatically at the end of the current transaction.
+ *
+ * Objects that are pinned with the option OCI_DURATION_SESSION will get
+ * unpinned automatically at the end of the current session (connection).
+ *
+ * The option OCI_DURATION_NULL is used when the client does not want to set
+ * the pin duration.  If the object is already loaded into the cache, then the
+ * pin duration will remain the same.  If the object is not yet loaded, the
+ * pin duration of the object will be set to OCI_DURATION_DEFAULT.
+ */
+
+/*----------------------------- OBJECT PROPERTY -----------------------------*/
+ 
+/******************************************************************************
+**  DO NOT USE OCIObjectProperty. IT IS UNSUPPORTED                          **
+**  WILL BE REMOVED/CHANGED IN A FUTURE RELEASE                              **
+******************************************************************************/
+enum OCIObjectProperty
+{
+  /* 0 = uninitialized */
+  OCI_OBJECTPROP_DIRTIED = 1,                               /* dirty objects */
+  OCI_OBJECTPROP_LOADED,                /* objects loaded in the transaction */
+  OCI_OBJECTPROP_LOCKED                                    /* locked objects */
+};
+typedef enum OCIObjectProperty OCIObjectProperty;
+/*
+ * OCIObjectProperty -- OCI Object Property
+ * This specifies the properties of objects in the object cache.
+ */
+
+/*------------------------- CACHE REFRESH OPTION ---------------------------*/
+
+enum OCIRefreshOpt
+{
+  /* 0 = uninitialized */
+  OCI_REFRESH_LOADED = 1        /* refresh objects loaded in the transaction */
+};
+typedef enum OCIRefreshOpt OCIRefreshOpt; 
+/*
+ * OCIRefreshOpt - OCI cache Refresh Option
+ * This option is used to specify the set of objects to be refreshed. 
+ *
+ * OCI_REFRESH_LOAD refreshes the objects that are loaded in the current  
+ * transaction. 
+ */
+
+/*-------------------------------- OBJECT EVENT -----------------------------*/
+
+/******************************************************************************
+**  DO NOT USE OCIObjectEvent. IT IS UNSUPPORTED                             **
+**  WILL BE REMOVED/CHANGED IN A FUTURE RELEASE                              **
+******************************************************************************/
+enum OCIObjectEvent
+{
+   /* 0 = uninitialized */
+   OCI_OBJECTEVENT_BEFORE_FLUSH = 1,            /* before flushing the cache */
+   OCI_OBJECTEVENT_AFTER_FLUSH,                  /* after flushing the cache */
+   OCI_OBJECTEVENT_BEFORE_REFRESH,            /* before refreshing the cache */
+   OCI_OBJECTEVENT_AFTER_REFRESH,              /* after refreshing the cache */
+   OCI_OBJECTEVENT_WHEN_MARK_UPDATED,    /* when an object is marked updated */
+   OCI_OBJECTEVENT_WHEN_MARK_DELETED,    /* when an object is marked deleted */
+   OCI_OBJECTEVENT_WHEN_UNMARK,          /* when an object is being unmarked */
+   OCI_OBJECTEVENT_WHEN_LOCK               /* when an object is being locked */
+};
+typedef enum OCIObjectEvent OCIObjectEvent;
+/*
+ * OCIObjectEvent -- OCI Object Event 
+ * This specifies the kind of event that is supported by the object
+ * cache.  The program can register a callback that is invoked when the  
+ * specified event occurs.
+ */
+
+/*----------------------------- OBJECT COPY OPTION --------------------------*/
+#define OCI_OBJECTCOPY_NOREF (ub1)0x01 
+/*
+ * OCIObjectCopyFlag - Object copy flag
+ *
+ * If OCI_OBJECTCOPY_NOREF is specified when copying an instance, the 
+ * reference and lob will not be copied to the target instance.
+ */
+
+/*----------------------------- OBJECT FREE OPTION --------------------------*/
+#define OCI_OBJECTFREE_FORCE      (ub2)0x0001
+#define OCI_OBJECTFREE_NONULL     (ub2)0x0002
+#define OCI_OBJECTFREE_HEADER     (ub2)0x0004
+/*
+ * OCIObjectFreeFlag - Object free flag
+ *
+ * If OCI_OBJECTCOPY_FORCE is specified when freeing an instance, the instance
+ * is freed regardless it is pinned or diritied.
+ * If OCI_OBJECTCOPY_NONULL is specified when freeing an instance, the null 
+ * structure is not freed.
+ */
+
+/*----------------------- OBJECT PROPERTY ID -------------------------------*/
+
+typedef ub1 OCIObjectPropId;
+#define OCI_OBJECTPROP_LIFETIME 1       /* persistent or transient or value */
+#define OCI_OBJECTPROP_SCHEMA 2   /* schema name of table containing object */
+#define OCI_OBJECTPROP_TABLE 3     /* table name of table containing object */
+#define OCI_OBJECTPROP_PIN_DURATION 4             /* pin duartion of object */
+#define OCI_OBJECTPROP_ALLOC_DURATION 5         /* alloc duartion of object */
+#define OCI_OBJECTPROP_LOCK 6                      /* lock status of object */
+#define OCI_OBJECTPROP_MARKSTATUS 7                /* mark status of object */
+#define OCI_OBJECTPROP_VIEW 8            /* is object a view object or not? */
+
+/*
+ * OCIObjectPropId - OCI Object Property Id
+ * Identifies the different properties of objects.
+ */
+
+/*----------------------- OBJECT LIFETIME ----------------------------------*/
+
+enum OCIObjectLifetime
+{
+   /* 0 = uninitialized */
+   OCI_OBJECT_PERSISTENT = 1,                          /* persistent object */
+   OCI_OBJECT_TRANSIENT,                                /* transient object */
+   OCI_OBJECT_VALUE                                         /* value object */
+};
+typedef enum OCIObjectLifetime OCIObjectLifetime;
+/*
+ * OCIObjectLifetime - OCI Object Lifetime
+ * Classifies objects depending upon the lifetime and referenceability 
+ * of the object.
+ */
+
+/*----------------------- OBJECT MARK STATUS -------------------------------*/
+
+typedef uword OCIObjectMarkStatus;
+#define OCI_OBJECT_NEW     0x0001                             /* new object */
+#define OCI_OBJECT_DELETED 0x0002                  /* object marked deleted */
+#define OCI_OBJECT_UPDATED 0x0004                  /* object marked updated */
+/*
+ * OCIObjectMarkStatus - OCI Object Mark Status
+ * Status of the object - new or updated or deleted
+ */
+
+/* macros to test the object mark status */ 
+#define OCI_OBJECT_IS_UPDATED(flag) bit((flag), OCI_OBJECT_UPDATED)
+#define OCI_OBJECT_IS_DELETED(flag) bit((flag), OCI_OBJECT_DELETED)
+#define OCI_OBJECT_IS_NEW(flag) bit((flag), OCI_OBJECT_NEW)
+#define OCI_OBJECT_IS_DIRTY(flag) \
+  bit((flag), OCI_OBJECT_UPDATED|OCI_OBJECT_NEW|OCI_OBJECT_DELETED)
+
+/*---------------------------------------------------------------------------*/
+/*                               TYPE MANAGER                                */
+/*---------------------------------------------------------------------------*/
+
+/*------------------------------ TYPE CODE ----------------------------------*/
+
+/*
+ * Type manager typecodes
+ *
+ * These are typecodes designed to be used with the type manager;
+ * they also include longer, more readable versions of existing SQLT names.
+ * Those types that are directly related to existing SQLT types are #define'd
+ * to their SQLT equivalents.
+ *
+ * The type manager typecodes are designed to be useable for all OCI calls.
+ * They are in the range from 192 to 320 for typecodes, so as not to conflict
+ * with existing OCI SQLT typecodes (see ocidfn.h).
+ */
+
+#define OCI_TYPECODE_REF         SQLT_REF        /* SQL/OTS OBJECT REFERENCE */
+#define OCI_TYPECODE_DATE        SQLT_DAT              /* SQL DATE  OTS DATE */
+#define OCI_TYPECODE_SIGNED8     27      /* SQL SIGNED INTEGER(8)  OTS SINT8 */
+#define OCI_TYPECODE_SIGNED16    28    /* SQL SIGNED INTEGER(16)  OTS SINT16 */
+#define OCI_TYPECODE_SIGNED32    29    /* SQL SIGNED INTEGER(32)  OTS SINT32 */
+#define OCI_TYPECODE_REAL        21                /* SQL REAL  OTS SQL_REAL */
+#define OCI_TYPECODE_DOUBLE      22  /* SQL DOUBLE PRECISION  OTS SQL_DOUBLE */
+#define OCI_TYPECODE_BFLOAT      SQLT_IBFLOAT       /* Binary float */ 
+#define OCI_TYPECODE_BDOUBLE     SQLT_IBDOUBLE  /* Binary double */
+#define OCI_TYPECODE_FLOAT       SQLT_FLT      /* SQL FLOAT(P)  OTS FLOAT(P) */
+#define OCI_TYPECODE_NUMBER      SQLT_NUM/* SQL NUMBER(P S)  OTS NUMBER(P S) */
+#define OCI_TYPECODE_DECIMAL     SQLT_PDN
+                                       /* SQL DECIMAL(P S)  OTS DECIMAL(P S) */
+#define OCI_TYPECODE_UNSIGNED8   SQLT_BIN
+                                       /* SQL UNSIGNED INTEGER(8)  OTS UINT8 */
+#define OCI_TYPECODE_UNSIGNED16  25  /* SQL UNSIGNED INTEGER(16)  OTS UINT16 */
+#define OCI_TYPECODE_UNSIGNED32  26  /* SQL UNSIGNED INTEGER(32)  OTS UINT32 */
+#define OCI_TYPECODE_OCTET       245                   /* SQL ???  OTS OCTET */
+#define OCI_TYPECODE_SMALLINT    246           /* SQL SMALLINT  OTS SMALLINT */
+#define OCI_TYPECODE_INTEGER     SQLT_INT        /* SQL INTEGER  OTS INTEGER */
+#define OCI_TYPECODE_RAW         SQLT_LVB          /* SQL RAW(N)  OTS RAW(N) */
+#define OCI_TYPECODE_PTR         32              /* SQL POINTER  OTS POINTER */
+#define OCI_TYPECODE_VARCHAR2    SQLT_VCS
+                                     /* SQL VARCHAR2(N)  OTS SQL_VARCHAR2(N) */
+#define OCI_TYPECODE_CHAR        SQLT_AFC    /* SQL CHAR(N)  OTS SQL_CHAR(N) */
+#define OCI_TYPECODE_VARCHAR     SQLT_CHR
+                                       /* SQL VARCHAR(N)  OTS SQL_VARCHAR(N) */
+#define OCI_TYPECODE_MLSLABEL    SQLT_LAB                    /* OTS MLSLABEL */
+#define OCI_TYPECODE_VARRAY      247         /* SQL VARRAY  OTS PAGED VARRAY */
+#define OCI_TYPECODE_TABLE       248              /* SQL TABLE  OTS MULTISET */
+#define OCI_TYPECODE_OBJECT      SQLT_NTY       /* SQL/OTS NAMED OBJECT TYPE */
+#define OCI_TYPECODE_OPAQUE       58                /*  SQL/OTS Opaque Types */
+#define OCI_TYPECODE_NAMEDCOLLECTION  SQLT_NCO
+                                            /* SQL/OTS NAMED COLLECTION TYPE */
+#define OCI_TYPECODE_BLOB        SQLT_BLOB    /* SQL/OTS BINARY LARGE OBJECT */
+#define OCI_TYPECODE_BFILE       SQLT_BFILE    /* SQL/OTS BINARY FILE OBJECT */
+#define OCI_TYPECODE_CLOB        SQLT_CLOB /* SQL/OTS CHARACTER LARGE OBJECT */
+#define OCI_TYPECODE_CFILE       SQLT_CFILE /* SQL/OTS CHARACTER FILE OBJECT */
+
+/* the following are ANSI datetime datatypes added in 8.1 */
+#define OCI_TYPECODE_TIME        SQLT_TIME                   /* SQL/OTS TIME */
+#define OCI_TYPECODE_TIME_TZ     SQLT_TIME_TZ             /* SQL/OTS TIME_TZ */
+#define OCI_TYPECODE_TIMESTAMP   SQLT_TIMESTAMP         /* SQL/OTS TIMESTAMP */
+#define OCI_TYPECODE_TIMESTAMP_TZ  SQLT_TIMESTAMP_TZ /* SQL/OTS TIMESTAMP_TZ */
+
+#define OCI_TYPECODE_TIMESTAMP_LTZ  SQLT_TIMESTAMP_LTZ /* TIMESTAMP_LTZ */
+
+#define OCI_TYPECODE_INTERVAL_YM SQLT_INTERVAL_YM   /* SQL/OTS INTRVL YR-MON */
+#define OCI_TYPECODE_INTERVAL_DS SQLT_INTERVAL_DS  /* SQL/OTS INTRVL DAY-SEC */
+#define OCI_TYPECODE_UROWID      SQLT_RDD                     /* Urowid type */
+
+
+#define OCI_TYPECODE_OTMFIRST    228     /* first Open Type Manager typecode */
+#define OCI_TYPECODE_OTMLAST     320                    /* last OTM typecode */
+#define OCI_TYPECODE_SYSFIRST    228     /* first OTM system type (internal) */
+#define OCI_TYPECODE_SYSLAST     235      /* last OTM system type (internal) */
+#define OCI_TYPECODE_PLS_INTEGER   266     /* type code for PLS_INTEGER */
+
+/* the following are PL/SQL-only internal. They should not be used */
+#define OCI_TYPECODE_ITABLE      SQLT_TAB             /* PLSQL indexed table */
+#define OCI_TYPECODE_RECORD      SQLT_REC                    /* PLSQL record */
+#define OCI_TYPECODE_BOOLEAN     SQLT_BOL                   /* PLSQL boolean */
+
+/* NOTE : The following NCHAR related codes are just short forms for saying
+   OCI_TYPECODE_VARCHAR2 with a charset form of SQLCS_NCHAR. These codes are
+   intended for use in the OCIAnyData API only and nowhere else. */
+#define OCI_TYPECODE_NCHAR       286
+#define OCI_TYPECODE_NVARCHAR2   287
+#define OCI_TYPECODE_NCLOB       288
+
+
+/* To indicate absence of typecode being specified */
+#define OCI_TYPECODE_NONE          0
+/* To indicate error has to be taken from error handle - reserved for
+   sqlplus use */
+#define OCI_TYPECODE_ERRHP         283
+
+/* The OCITypeCode type is interchangeable with the existing SQLT type
+   which is a ub2 */
+typedef ub2 OCITypeCode;
+
+
+/*----------------------- GET OPTIONS FOR TDO  ------------------------------*/
+
+enum OCITypeGetOpt
+{
+  OCI_TYPEGET_HEADER,
+                /* load only the header portion of the TDO when getting type */
+  OCI_TYPEGET_ALL       /* load all attribute and method descriptors as well */
+};
+typedef enum OCITypeGetOpt OCITypeGetOpt;
+
+/*
+ * OCITypeGetOpt
+ *
+ * This is the flag passed to OCIGetTypeArray() to indicate how the TDO is
+ * going to be loaded into the object cache.
+ * OCI_TYPEGET_HEADER implies that only the header portion is to be loaded
+ * initially, with the rest loaded in on a 'lazy' basis. Only the header is
+ * needed for PL/SQL and OCI operations. OCI_TYPEGET_ALL implies that ALL
+ * the attributes and methods belonging to a TDO will be loaded into the
+ * object cache in one round trip. Hence it will take much longer to execute,
+ * but will ensure that no more loading needs to be done when pinning ADOs
+ * etc. This is only needed if your code needs to examine and manipulate
+ * attribute and method information.
+ *
+ * The default is OCI_TYPEGET_HEADER.
+ */
+
+
+/*------------------------ TYPE ENCAPSULTATION LEVEL ------------------------*/
+
+enum OCITypeEncap
+{
+  /* 0 = uninitialized */
+  OCI_TYPEENCAP_PRIVATE,                /* private: only internally visible */
+  OCI_TYPEENCAP_PUBLIC /* public: visible to both internally and externally */
+};
+typedef enum OCITypeEncap OCITypeEncap;
+/*
+ * OCITypeEncap - OCI Encapsulation Level
+ */
+
+
+/*---------------------------- TYPE METHOD FLAGS ----------------------------*/
+
+enum OCITypeMethodFlag
+{
+  OCI_TYPEMETHOD_INLINE = 0x0001,                                  /* inline */
+  OCI_TYPEMETHOD_CONSTANT = 0x0002,                              /* constant */
+  OCI_TYPEMETHOD_VIRTUAL = 0x0004,                                /* virtual */
+  OCI_TYPEMETHOD_CONSTRUCTOR = 0x0008,                        /* constructor */
+  OCI_TYPEMETHOD_DESTRUCTOR = 0x0010,                          /* destructor */
+  OCI_TYPEMETHOD_OPERATOR  = 0x0020,                             /* operator */
+  OCI_TYPEMETHOD_SELFISH = 0x0040,     /* selfish method (generic otherwise) */
+
+  OCI_TYPEMETHOD_MAP = 0x0080,                    /* map (relative ordering) */
+  OCI_TYPEMETHOD_ORDER  = 0x0100,               /* order (relative ordering) */
+  /* OCI_TYPEMETHOD_MAP and OCI_TYPEMETHOD_ORDER are mutually exclusive */
+
+  OCI_TYPEMETHOD_RNDS= 0x0200,               /* Read no Data State (default) */
+  OCI_TYPEMETHOD_WNDS= 0x0400,                        /* Write no Data State */
+  OCI_TYPEMETHOD_RNPS= 0x0800,                      /* Read no Process State */
+  OCI_TYPEMETHOD_WNPS= 0x1000,                     /* Write no Process State */
+  OCI_TYPEMETHOD_ABSTRACT = 0x2000,    /* abstract (not instantiable) method */
+  OCI_TYPEMETHOD_OVERRIDING = 0x4000,                   /* overriding method */
+  OCI_TYPEMETHOD_PIPELINED = 0x8000                   /* method is pipelined */
+};
+typedef enum OCITypeMethodFlag OCITypeMethodFlag;
+
+/* macros to test the type method flags */
+#define OCI_METHOD_IS_INLINE(flag) bit((flag), OCI_TYPEMETHOD_INLINE)
+#define OCI_METHOD_IS_CONSTANT(flag) bit((flag), OCI_TYPEMETHOD_CONSTANT)
+#define OCI_METHOD_IS_VIRTUAL(flag) bit((flag), OCI_TYPEMETHOD_VIRTUAL)
+#define OCI_METHOD_IS_CONSTRUCTOR(flag) bit((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
+#define OCI_METHOD_IS_DESTRUCTOR(flag) bit((flag), OCI_TYPEMETHOD_DESTRUCTOR)
+#define OCI_METHOD_IS_OPERATOR(flag) bit((flag), OCI_TYPEMETHOD_OPERATOR)
+#define OCI_METHOD_IS_SELFISH(flag) bit((flag), OCI_TYPEMETHOD_SELFISH)
+#define OCI_METHOD_IS_MAP(flag) bit((flag), OCI_TYPEMETHOD_MAP)
+#define OCI_METHOD_IS_ORDER(flag) bit((flag), OCI_TYPEMETHOD_ORDER)
+#define OCI_METHOD_IS_RNDS(flag) bit((flag), OCI_TYPEMETHOD_RNDS)
+#define OCI_METHOD_IS_WNDS(flag) bit((flag), OCI_TYPEMETHOD_WNDS)
+#define OCI_METHOD_IS_RNPS(flag) bit((flag), OCI_TYPEMETHOD_RNPS)
+#define OCI_METHOD_IS_WNPS(flag) bit((flag), OCI_TYPEMETHOD_WNPS)
+#define OCI_METHOD_IS_ABSTRACT(flag) bit((flag), OCI_TYPEMETHOD_ABSTRACT)
+#define OCI_METHOD_IS_OVERRIDING(flag) bit((flag), OCI_TYPEMETHOD_OVERRIDING)
+#define OCI_METHOD_IS_PIPELINED(flag) bit((flag), OCI_TYPEMETHOD_PIPELINED)
+
+#define OCI_TYPEMETHOD_IS_INLINE(flag) bit((flag), OCI_TYPEMETHOD_INLINE)
+#define OCI_TYPEMETHOD_IS_CONSTANT(flag) bit((flag), OCI_TYPEMETHOD_CONSTANT)
+#define OCI_TYPEMETHOD_IS_VIRTUAL(flag) bit((flag), OCI_TYPEMETHOD_VIRTUAL)
+#define OCI_TYPEMETHOD_IS_CONSTRUCTOR(flag) \
+  bit((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
+#define OCI_TYPEMETHOD_IS_DESTRUCTOR(flag) \
+  bit((flag), OCI_TYPEMETHOD_DESTRUCTOR)
+#define OCI_TYPEMETHOD_IS_OPERATOR(flag) bit((flag), OCI_TYPEMETHOD_OPERATOR)
+#define OCI_TYPEMETHOD_IS_SELFISH(flag) bit((flag), OCI_TYPEMETHOD_SELFISH)
+#define OCI_TYPEMETHOD_IS_MAP(flag) bit((flag), OCI_TYPEMETHOD_MAP)
+#define OCI_TYPEMETHOD_IS_ORDER(flag) bit((flag), OCI_TYPEMETHOD_ORDER)
+#define OCI_TYPEMETHOD_IS_RNDS(flag) bit((flag), OCI_TYPEMETHOD_RNDS)
+#define OCI_TYPEMETHOD_IS_WNDS(flag) bit((flag), OCI_TYPEMETHOD_WNDS)
+#define OCI_TYPEMETHOD_IS_RNPS(flag) bit((flag), OCI_TYPEMETHOD_RNPS)
+#define OCI_TYPEMETHOD_IS_WNPS(flag) bit((flag), OCI_TYPEMETHOD_WNPS)
+#define OCI_TYPEMETHOD_IS_ABSTRACT(flag) bit((flag), OCI_TYPEMETHOD_ABSTRACT)
+#define OCI_TYPEMETHOD_IS_OVERRIDING(flag) \
+  bit((flag), OCI_TYPEMETHOD_OVERRIDING)
+#define OCI_TYPEMETHOD_IS_PIPELINED(flag) bit((flag), OCI_TYPEMETHOD_PIPELINED)
+
+/* macros to set the type method flags */
+#define OCI_TYPEMETHOD_SET_INLINE(flag) bis((flag), OCI_TYPEMETHOD_INLINE)
+#define OCI_TYPEMETHOD_SET_CONSTANT(flag) bis((flag), OCI_TYPEMETHOD_CONSTANT)
+#define OCI_TYPEMETHOD_SET_VIRTUAL(flag) bis((flag), OCI_TYPEMETHOD_VIRTUAL)
+#define OCI_TYPEMETHOD_SET_CONSTRUCTOR(flag) \
+  bis((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
+#define OCI_TYPEMETHOD_SET_DESTRUCTOR(flag) \
+  bis((flag), OCI_TYPEMETHOD_DESTRUCTOR)
+#define OCI_TYPEMETHOD_SET_OPERATOR(flag) bis((flag), OCI_TYPEMETHOD_OPERATOR)
+#define OCI_TYPEMETHOD_SET_SELFISH(flag) bis((flag), OCI_TYPEMETHOD_SELFISH)
+#define OCI_TYPEMETHOD_SET_MAP(flag) bis((flag), OCI_TYPEMETHOD_MAP)
+#define OCI_TYPEMETHOD_SET_ORDER(flag) bis((flag), OCI_TYPEMETHOD_ORDER)
+#define OCI_TYPEMETHOD_SET_RNDS(flag) bis((flag), OCI_TYPEMETHOD_RNDS)
+#define OCI_TYPEMETHOD_SET_WNDS(flag) bis((flag), OCI_TYPEMETHOD_WNDS)
+#define OCI_TYPEMETHOD_SET_RNPS(flag) bis((flag), OCI_TYPEMETHOD_RNPS)
+#define OCI_TYPEMETHOD_SET_WNPS(flag) bis((flag), OCI_TYPEMETHOD_WNPS)
+
+/* macros to clear the type method flags */
+#define OCI_TYPEMETHOD_CLEAR_INLINE(flag) bic((flag), OCI_TYPEMETHOD_INLINE)
+#define OCI_TYPEMETHOD_CLEAR_CONSTANT(flag) \
+  bic((flag), OCI_TYPEMETHOD_CONSTANT)
+#define OCI_TYPEMETHOD_CLEAR_VIRTUAL(flag) bic((flag), OCI_TYPEMETHOD_VIRTUAL)
+#define OCI_TYPEMETHOD_CLEAR_CONSTRUCTOR(flag) \
+  bic((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
+#define OCI_TYPEMETHOD_CLEAR_DESTRUCTOR(flag) \
+  bic((flag), OCI_TYPEMETHOD_DESTRUCTOR)
+#define OCI_TYPEMETHOD_CLEAR_OPERATOR(flag) \
+  bic((flag), OCI_TYPEMETHOD_OPERATOR)
+#define OCI_TYPEMETHOD_CLEAR_SELFISH(flag) bic((flag), OCI_TYPEMETHOD_SELFISH)
+#define OCI_TYPEMETHOD_CLEAR_MAP(flag) bic((flag), OCI_TYPEMETHOD_MAP)
+#define OCI_TYPEMETHOD_CLEAR_ORDER(flag) bic((flag), OCI_TYPEMETHOD_ORDER)
+#define OCI_TYPEMETHOD_CLEAR_RNDS(flag) bic((flag), OCI_TYPEMETHOD_RNDS)
+#define OCI_TYPEMETHOD_CLEAR_WNDS(flag) bic((flag), OCI_TYPEMETHOD_WNDS)
+#define OCI_TYPEMETHOD_CLEAR_RNPS(flag) bic((flag), OCI_TYPEMETHOD_RNPS)
+#define OCI_TYPEMETHOD_CLEAR_WNPS(flag) bic((flag), OCI_TYPEMETHOD_WNPS)
+
+/*--------------------------- TYPE PARAMETER MODE ---------------------------*/
+
+enum OCITypeParamMode
+{
+  /* PL/SQL starts this from 0 */
+  OCI_TYPEPARAM_IN = 0,                                                /* in */
+  OCI_TYPEPARAM_OUT,                                                  /* out */
+  OCI_TYPEPARAM_INOUT,                                             /* in-out */
+  OCI_TYPEPARAM_BYREF,              /* call by reference (implicitly in-out) */
+  OCI_TYPEPARAM_OUTNCPY,                         /* OUT with NOCOPY modifier */
+  OCI_TYPEPARAM_INOUTNCPY                     /* IN OUT with NOCOPY modifier */
+};
+typedef enum OCITypeParamMode OCITypeParamMode;
+
+
+/*-------------------------------- DEFAULTS ---------------------------------*/
+
+/* default binary and decimal precision and scale */
+
+#define OCI_NUMBER_DEFAULTPREC ((ub1)0)            /* no precision specified */
+#define OCI_NUMBER_DEFAULTSCALE ((sb1)MAXSB1MINVAL)
+                                        /* no binary/decimal scale specified */
+
+/* default maximum length for varrays and vstrings (used in sql.bsq) */
+
+#define OCI_VARRAY_MAXSIZE 4000
+                          /* default maximum number of elements for a varray */
+#define OCI_STRING_MAXLEN  4000     /* default maximum length of a vstring */
+
+/*---------------------------------------------------------------------------*/
+/* This set of macro is used only in beta2. They should be removed as soon as
+ * PLSQL has made the changes of not using these macros.
+ */
+ 
+/* Special duration for allocating memory only. No instance can be allocated
+ * given these durations.
+ */
+#define OCICoherency OCIRefreshOpt
+#define OCI_COHERENCY_NONE   (OCIRefreshOpt)2
+#define OCI_COHERENCY_NULL   (OCIRefreshOpt)4
+#define OCI_COHERENCY_ALWAYS (OCIRefreshOpt)5
+
+#endif /* ORO_ORACLE */
+
diff --git a/src/terralib/drivers/Oracle/OCI/include/ort.h b/src/terralib/drivers/Oracle/OCI/include/ort.h
new file mode 100644
index 0000000..1ddb2a4
--- /dev/null
+++ b/src/terralib/drivers/Oracle/OCI/include/ort.h
@@ -0,0 +1,2593 @@
+/* @(#)ort.h    1.44 95/07/07 */
+
+/* Copyright (c) 1994, 2003, Oracle Corporation.  All rights reserved.  */
+
+/* 
+  NAME
+
+    ORT - ORacle's external open Type interface to the open type manager (OTM)
+
+  DESCRIPTION
+
+    The open type manager interface includes dynamic type operations to
+    create, delete, update, and access types.  See the "Functional
+    Specification for Oracle Object Call Interface (Objects Project),
+    Version 1.0" for a user level description of the OTM.  For a more
+    detailed description, see the "Component Document for the Open Type
+    Manager, Version 1.0".
+
+    NOTE: MOST Of the functions in this header file are being desupported.
+          Please use the OCIDescribeAny interface as described in oci.h
+          instead.
+          The OCIType, OCITypeElem, OCITypeMethod abstract types continue
+          to be supported. The only two functions that remain to be documented
+          are OCITypeArrayByName and OCITypeArrayByRef.
+          All obsolete types/functions are marked accordingly below.
+
+  RELATED DOCUMENTS
+
+    For the functional specification for the OTM, see: 
+        [1] Kotsovolos, Susan, "Functional Specification for Oracle Object
+            Call Interface (Objects Project), Version 1.0", Oracle
+            Corporation, February 1995.
+    For the internal design of the OTM, see the following:
+        [2] Kotsovolos, Susan, "Component Document for the Open Type Manager",
+            Oracle Corporation, November 1994. 
+        [3] Kotsovolos, Susan, "Design for The Open Type Manager, Oracle 
+            Object Management Subsystem Version 1.0", Oracle Corporation, 
+            March 1994.
+        [4] Kotsovolos, Susan and Tin A. Nguyen, "The Open Type Manager",
+            Oracle Corporation, March 1994.
+        [5] Kotsovolos, Susan and Tin A. Nguyen, "Schema Evolution",
+            Oracle Corporation, March 1994.
+    For a description of the types the OTM must support, see:
+        [6] Nguyen, Tin A., "The Open Type System", Oracle Corporation, 
+            February 1994. 
+
+  INSPECTION STATUS 
+
+    Inspection date:    
+    Inspection status: 
+    Estimated increasing cost defects per page:
+    Rule sets:        
+
+  ACCEPTANCE REVIEW STATUS 
+
+    Review date:    
+    Review status:
+    Reviewers:  
+
+
+  **** ALL OBSOLETE FUNCTIONS/TYPES ARE MARKED ACCORDINGLY ***
+
+  EXPORT FUNCTIONS
+
+    None
+
+  PUBLIC DATA STRUCTURES
+
+      OCIType - type descriptor in the object cache
+      OCITypeElem - type element descriptor in the object cache
+            (used for attributes and paramters)
+      OCITypeCode  - Open Type System type code.
+      OCITypeMethod - method descriptor in the object cache
+      OCITypeParamMode - parameter modes (ie. IN, IN-OUT etc)
+
+  PUBLIC FUNCTIONS
+
+    ITERATOR (for OCITypeAttrNext and OCITypeMethodNext)
+
+      OCITypeIterNew  - ** OBSOLETE ** Create new instance of an iteraton.
+      OCITypeIterSet  - ** OBSOLETE ** Initialize iterator.
+      OCITypeIterFree - ** OBSOLETE ** Free instance of iterator.
+
+    TYPE GET
+
+      OCITypeByName      - ** OBSOLETE ** Get a type by name.
+      OCITypeArrayByName - Get an array of types by their names.
+      OCITypeByRef       - ** OBSOLETE ** Get a type by its CREF.
+      OCITypeArrayByRef  - Get an array of types by their CREFs.
+
+    TYPE ACCESSORS
+
+      OCITypeName     - ** OBSOLETE ** OCI Get a type's name.
+      OCITypeSchema   - ** OBSOLETE ** OCI Get a type's schema name.
+      OCITypeTypeCode - ** OBSOLETE ** OCI Get a type's type code.
+      OCITypeVersion  - ** OBSOLETE ** OCI Get a Type's user-readable Version.
+      OCITypeAttrs    - ** OBSOLETE ** OCI Get a Type's Number of Attributes.
+      OCITypeMethods  - ** OBSOLETE ** OCI Get a Type's Number of Methods.
+
+    TYPE ELEMENT ACCESSORS (they represent attributes/parameters/results)
+
+      OCITypeElemName      - ** OBSOLETE ** Get a type element's (only for
+                                attributes) name.
+      OCITypeElemType      - ** OBSOLETE ** Get a type element's type
+                                descriptor.
+      OCITypeElemTypeCode  - ** OBSOLETE ** Get a type element's typecode.
+      OCITypeElemParameterizedType - ** OBSOLETE ** Get a type element's
+                                        parameterized type's type descriptor.
+      OCITypeElemNumPrec   - ** OBSOLETE ** Get a number's precision.
+      OCITypeElemNumScale  - ** OBSOLETE ** Get a decimal or oracle Number's
+                                            Scale
+      OCITypeElemCharSetID - ** OBSOLETE ** Get a fixed or variable length
+                                            string's character set ID.
+      OCITypeElemCharSetForm - ** OBSOLETE ** Get a fixed or variable length
+                                              string's character set form (how
+                                              character set information has
+                                              been specified).
+      OCITypeElemLength    - ** OBSOLETE ** Get a raw, fixed or variable
+                                            length string's length.
+      OCITypeElemParamMode - ** OBSOLETE ** Get element's parameter's mode
+                                            (only valid for parameter).
+      OCITypeElemDefaultValue - ** OBSOLETE ** Get element's Default Value.
+
+    ATTRIBUTE ACCESSORS
+
+      OCITypeAttrByName - ** OBSOLETE ** Get an Attribute by Name.
+      OCITypeAttrNext   - ** OBSOLETE ** Get an Attribute by Iteration.
+
+    COLLECTION ACCESSORS
+
+      OCITypeCollTypeCode - ** OBSOLETE ** Get a named collection's typecode.
+      OCITypeCollElem     - ** OBSOLETE ** Get a named collection's element's
+                               type element information.
+      OCITypeCollSize     - ** OBSOLETE ** Get a named collection's size in
+                               number of elements.
+
+    METHOD ACCESSORS
+
+      OCITypeMethodOverload - ** OBSOLETE ** Get number of overloaded methods
+                                             with the given method name.
+                                             (no direct equivalent for
+                                              OCIDescribe interface)
+      OCITypeMethodByName   - ** OBSOLETE ** Get one or more methods by name.
+      OCITypeMethodNext     - ** OBSOLETE ** Iterate to the next method to
+                                             retrieve.
+      OCITypeMethodName     - ** OBSOLETE ** Get method's name.
+      OCITypeMethodEncap    - ** OBSOLETE ** Get method's encapsulation level. 
+      OCITypeMethodFlags    - ** OBSOLETE ** et method's flags.
+      OCITypeMethodMap      - ** OBSOLETE ** Get type's map function.
+      OCITypeMethodOrder    - ** OBSOLETE ** Get type's order function.
+      OCITypeMethodParams   - ** OBSOLETE ** Get a method's number of
+                                             parameters.
+
+    RESULT ACCESSORS
+
+      OCITypeResult - ** OBSOLETE ** OCI Get a method's Result.
+
+      See also ATTRIBUTE/PARAMETER/RESULT TYPE ACCESSORS.
+
+    PARAMETER ACCESSORS
+
+      OCITypeParamByPos  - ** OBSOLETE ** Get a Parameter in a method By
+                                          Position.
+      OCITypeParamByName - ** OBSOLETE ** Get a Parameter in a method By Name.
+      OCITypeParamPos    - ** OBSOLETE ** Get a Parameter's PoSition in a
+                                          method.
+
+  CALL GRAPHS:
+
+  Only type accessors are supported for 8.0.
+  ** OBSOLETE ** please use OCIDescribe interface
+
+  TYPE ACCESSOR EXAMPLE
+
+      CREATE TYPE CAR
+      (
+        name   vstring,
+        age    number,
+          number   car_age;                           /o Oracle number o/
+          weight   car_weight;                        /o abstract type o/
+
+        PUBLIC: 
+
+          /o methods o/
+          car(orlvs a_name, number an_age, WEIGHT a_weight);
+          ~car();
+          inline number get_age() const;
+          
+          /o relative ordering (map) functions o/
+          number car_map
+      );
+
+      /o the following code accesses the type created above o/
+
+      ub1      meth_flags;
+      ub4      i, j; 
+      ub4      text_len, position;
+      ub4      count;
+      ub4      length;
+      OCITypeCode    typecode;
+      OCIRef  *attr_ref;
+      OCIRef  *param_ref;
+      OCIType  *tdo, new_tdo, final_tdo;
+      OCITypeElem  *elem;
+      OCITypeIter  *iterator_ort;
+      oratext   (*names)[];
+      ub4      lengths[];
+      ub4     *positions;
+      oratext    *name;
+      oratext     name_buffer[M_IDEN];
+
+      /o initialize the references o/
+      DISCARD orlrini(env, err, (dvoid *)&attr_ref);
+      DISCARD orlrini(env, err, (dvoid *)&param_ref);
+
+      /o ----------------- GET INFORMATION ABOUT A TYPE ----------------- o/
+
+      /o start a transaction o/
+      
+      /o Pin the type until the end of the transaction.  Pinning the type is 
+       o required before using any type accessors. 
+       o/
+      if (OCITypeByName(env, err, svc, (oratext *)0, 0, "CAR", strlen("CAR"), 
+                  OCI_DURATION_TRANS, &car_ref, &car_tdo) != OCI_SUCCESS)
+        /o error o/ ;
+
+      /o get the type's name o/
+      if (!memcmp(OCITypeName(env, err, car_tdo, &text_len), "person",
+                              text_len))
+        /o do something o/ ;
+
+      /o get the type's schema name o/
+      if (!memcmp(OCITypeSchema(env, err, car_tdo, &text_len), "john",
+                  text_len))
+        /o do something o/ ;
+
+      /o get the type code of the type o/
+      if (OCITypeTypeCode(env, err, car_tdo) == OCI_TYPECODE_ADT)
+        /o do something o/ ; 
+
+      /o get the type version o/
+      if (!memcmp(OCITypeVersion(env, err, car_tdo, &text_len), "1", text_len))
+         /o do something o/  ;
+
+      /o ------- GET FLATTENED POSITION OF AN ATTRIBUTES IN A TYPE ------- o/
+
+      names = malloc(sizeof(oratext *) * 2);
+      names[0] = malloc(strlen("car_weight"));
+      names[1] = malloc(strlen("ounces"));
+      memcpy(names[0], "car_weight", strlen("car_weight"));
+      memcpy(names[1], "ounces", strlen("ounces"));
+
+      lengths = malloc(sizeof(ub4) * 2);
+      lengths[0] = strlen("car_weight");
+      lengths[1] = strlen("ounces");
+
+      /o ---------- GET IMMEDIATE ATTRIBUTES IN A TYPE ---------- o/
+
+      /o loop through all attributes in the type with iterator o/
+      if (OCITypeIterNew(env, err, car_tdo, &iterator_ort) != OCI_SUCCESS)
+        /o do something o/
+
+      while (OCITypeAttrNext(env, err, iterator_ort, &ado) != OCI_NO_DATA)
+      {
+        /o get the attribute's name o/
+        if (!memcmp(OCITypeElemName(env, err, ado, &text_len),
+                                    "tiger", text_len))
+          /o do something o/  ;
+
+        /o get the attribute's type descriptor o/
+        if (OCITypeElemType(env, err, ado, &tdo) != OCI_SUCCESS)
+          /o error o/ ;
+
+        /o get the attribute's type code o/
+        typecode = OCITypeElemTypeCode(env, err, ado);
+
+        switch (typecode)
+        {
+        /o scalar types o/
+        case OCI_TYPECODE_DATE:                                     /o date o/
+        case OCI_TYPECODE_SIGNED8:                                  /o byte o/
+        case OCI_TYPECODE_SIGNED16:                                /o short o/
+        case OCI_TYPECODE_UNSIGNED8:                       /o unsigned byte o/
+        case OCI_TYPECODE_UNSIGNED16:                     /o unsigned short o/
+        case OCI_TYPECODE_OCTET:                                   /o octet o/
+        case OCI_TYPECODE_TABLE:                            /o nested table o/
+        case OCI_TYPECODE_CLOB:                            /o character lob o/
+        case OCI_TYPECODE_BLOB:                               /o binary lob o/
+        case OCI_TYPECODE_CFILE:                   /o character file object o/
+        case OCI_TYPECODE_BFILE:                      /o binary file object o/
+
+          /o do something o/
+          break;
+
+        /o number types o/
+        case OCI_TYPECODE_NUMBER:                          /o oracle number o/
+        case OCI_TYPECODE_DECIMAL:                               /o decimal o/
+          {
+            /o get the scale of the number o/
+            if (OCITypeElemNumScale(env, err, ado) == 3)
+              /o do something o/ ;
+          }
+          /o fall through to get the precision o/
+
+        case OCI_TYPECODE_FLOAT:                                   /o float o/
+        case OCI_TYPECODE_SIGNED32:                                 /o long o/
+        case OCI_TYPECODE_UNSIGNED32:                      /o unsigned long o/
+        case OCI_TYPECODE_REAL:                                     /o real o/
+        case OCI_TYPECODE_DOUBLE:                                 /o double o/
+          {
+            /o get the precision of the number o/
+            if (OCITypeElemNumPrec(env, err, ado) == 2)
+              /o do something o/ ;
+          }
+          break;
+
+        /o string types o/
+        case OCI_TYPECODE_CHAR:                      /o fixed length string o/
+        case OCI_TYPECODE_VARCHAR2:               /o variable length string o/
+        case OCI_TYPECODE_RAW:                                       /o raw o/
+          {
+            /o get the length of the fixed or variable length string o/
+            if (OCITypeElemLength(env, err, ado) < 100)
+              /o do something o/
+          }
+          break;
+
+        /o parameterized types o/
+        case OCI_TYPECODE_REF:                          /o reference o/
+        case OCI_TYPECODE_PTR:                            /o pointer o/
+          {
+            /o get the type stored in the parameterized type o/
+            if (OCITypeElemParameterizedType(env, err, ado, &tdo)
+                 != OCI_SUCCESS)
+              /o error o/ ;
+
+            /o do something o/
+            if (OCI_TYPEELEM_IS_REF(OCITypeElemFlags(env, err, ado)))...
+          }
+          break;
+
+        /o domain type o/
+        case OCI_TYPECODE_NAMEDCOLLECTION:
+          switch (OCITypeCollTypeCode(env, err, tdo))
+          {
+          case OCI_TYPECODE_VARRAY:                   /o variable array o/
+            ub4   num_elems;
+            OCIType *element_type;
+
+            /o get the number of elements in the farray or the maximum number
+             o of elements in the varray.
+             o/
+            OCITypeCollSize(env, err, tdo, &num_elems);
+
+            /o get the type of the array o/
+            OCITypeElemType(env, err, tdo, &element_type);
+          }
+          break;
+
+          case OCI_TYPECODE_TABLE:                         /o multiset o/
+          {
+            OCIType *table_type;
+
+            /o get the type of the multiset o/
+            OCITypeElemType(env, err, tdo, &table_type);
+
+            /o do something o/
+          }
+        }
+
+        /o abstract type o/
+        case OCI_TYPECODE_ADT:                 /o abstract data type o/
+          {
+            /o get the adt information o/
+            if (OCITypeElemType(env, err, ado, &tdo) != OCI_SUCCESS)
+              /o error o/ ;
+
+            /o do something o/
+          }
+          break;
+
+        default:
+          DISCARD printf("Error:  invalid type code\n");
+
+        } /o end of typecode switch o/
+
+      } /o end of loop through all attributes in a type o/
+
+
+      /o ------------ GET THE IMMEDIATE METHODS OF A TYPE ------------ o/
+
+      /o loop through all methods in the type by reusing iterator o/
+      if (OCITypeIterSet(env, err, car_tdo, iterator_ort) != OCI_SUCCESS)
+        /o do something o/
+
+      while (OCITypeMethodNext(env, err, iterator_ort) != OCI_NO_DATA)
+      {
+        /o get the method's name o/
+        if (!memcmp(OCITypeMethodName(env, err, mdo, &text_len), "car",
+                    text_len))
+          /o do something o/  ;
+
+        /o get the method's encapsulation o/
+        if (OCITypeMethodEncap(env, err, mdo) == OCI_TYPEENCAP_PUBLIC)
+          /o do something o/  ;
+
+        /o get the method's flags o/
+        meth_flags = OCITypeMethodFlags(env, err, mdo);
+        if (meth_flags & OCI_TYPEMETHOD_VIRTUAL)  
+          /o do something o/  ;
+
+
+        /o ------------ GET THE PARAMETERS IN A METHOD ------------ o/
+
+        /o loop through all parameters in the method o/
+        count = OCITypeMethodParams(env, err, mdo);
+        for (j = 1; j <= count; j++)
+        {
+          /o get the parameter information by position o/
+          if (OCITypeParamByPos(env, err, mdo, i, &elem) != OCI_SUCCESS)
+            /o error o/ ;
+
+          /o get the parameter's name o/
+          if (!memcmp(OCITypeElemName(env, err, elem, &text_len), "an_age",
+                      text_len))
+            /o do something o/ ;
+
+          /o get the parameter's mode o/
+          if (OCITypeElemMode(env, err, elem) == OCI_PARAM_OUT)
+            /o do something o/ ;
+   
+          /o get the parameter's required flag o/
+          if (ortgprq(env, err, elem))
+            /o do something o/ ;
+        }
+      }
+
+      /o get a method by name o/
+      if (OCITypeMethodByName(env, err, car_tdo, "car_constructor", 
+                              strlen("car_constructor"), NULLP(OCIRef), &mdo) 
+                              != OCI_SUCCESS)
+        /o error o/ ;
+
+      /o get a parameter in a method by name o/
+      if (OCITypeParamByName(env, err, mdo, "an_age", strlen("an_age"), &elem) 
+                  != OCI_SUCCESS)
+        /o error o/ ;
+
+      /o get a parameter's typecode o/
+      typecode = OCITypeElemTypeCode(env, err, elem);
+   
+      /o get a parameter's type object o/
+      if (OCITypeElemType(env, err, elem, &tdo)) != OCI_SUCCESS)
+        /o error o/ ;
+
+      /o get a parameter's position in a method o/
+      if (ortgpps(env, err, mdo, "an_age", strlen("an_age"), 
+                  &position, NULLP(OCIRef), NULLP(OCITypeElem)) != OCI_SUCCESS)
+        /o error o/ ;
+
+      /o ------------ GET THE METHOD's RESULT ------------ o/
+     
+      /o get a method by name o/
+      if (OCITypeMethodByName(env, err, car_tdo, "get_age", strlen("get_age"),
+                  &mdo) != OCI_SUCCESS)
+        /o error o/ ;
+
+      /o get the typecode of the method's result o/
+      typecode = OCITypeElemTypeCode(env, err, mdo);
+
+
+      /o ----------------- END ---------------- o/
+
+      /o free the references implicitly allocated o/
+      DISCARD orlrfre(env, err, (dvoid *)&attr_ref);
+      DISCARD orlrfre(env, err, (dvoid *)&param_ref);
+
+  NOTES
+
+  MODIFIED
+    srseshad   03/12/03  - convert oci public api to ansi
+    aahluwal   06/03/02  - bug 2360115
+    skabraha   04/16/02  - fix compiler warnings
+    rkasamse   03/02/01  - do not use iterator : keyword in MSVB
+    bpalaval   02/09/01  - Change text to oratext.
+    rxgovind   01/31/00  - add OCIType interfaces for transient types
+    whe        09/01/99 -  976457:check __cplusplus for C++ code
+    cxcheng    05/06/97 -  make OCI_TYPE?? test macros return either 1 or 0
+    cxcheng    04/22/97 -  add comment on desupporting OCIType functions
+    skrishna   03/18/97 -  fix ifdef for supporting ansi and k&r proto-types
+    cxcheng    02/26/97 -  fix lint problem with oro names
+    cxcheng    02/06/97 -  take out short name support except with SLSHORTNAME
+    cxcheng    01/15/97 -  change prototype of OCITypeElemParameterizedType()
+    cxcheng    01/03/97 -  replace bit in OCI_TYPEPARAM_IS_REQUIRED with bitwis
+    cxcheng    12/31/96 -  replace OCI_PARAM_IS_REQUIRED with OCI_TYPEPARAM_IS_
+    cxcheng    12/09/96 -  add prototype for OCITypeElemExtTypeCode and OCIType
+    cxcheng    11/25/96 -  add schema name parameter to OCITypeVTInsert()
+    cxcheng    11/20/96 -  fix prototype for OCITypeByName()
+    cxcheng    11/11/96 -  fix prototype for OCITypeByName()
+    cxcheng    11/05/96 -  remove OCITypeElemExtTypeCode and OCITypeCollExtType
+    dchatter   10/28/96 -  change ortgatyp to be OCITypeArrayByName
+    cxcheng    10/25/96 -  fix problem with ortgatyp at end
+    cxcheng    10/22/96 -  add OCITypeByRef and OCITypeArrayByRef
+    cxcheng    10/20/96 -  remove ortgtyp() from #define section at end
+    cxcheng    10/18/96 -  rename OCITypeGetArray to OCITypeArrayByName
+    cxcheng    10/17/96 -  final change to prototype for OCI_TYPEPARAM_IS_REQUI
+    cxcheng    10/15/96 -  rename OCIEncapLevel and OCIMethodFlag
+    cxcheng    10/14/96 -  change prototype of OCITypeResult
+    mluong     10/11/96 -  fix compile error
+    jwijaya    10/10/96 -  fix bug on OCI_PARAM_IS_REQUIRED
+    cxcheng    10/09/96 -  more lint and link fixes
+    cxcheng    10/08/96 -  more lint fixes
+    cxcheng    10/07/96 -  more changes
+    cxcheng    10/04/96 -  replace short names with long names
+    cxcheng    10/01/96 -  change to long names for readability
+    cxcheng    09/27/96 -  rename ortgatyp() to ortgtya() for lint
+    cxcheng    09/20/96 -  add ortgatyp() for array get type
+    cxcheng    09/18/96 -  add array pin and iterator functions
+    cxcheng    08/09/96 -  add version table calls
+    cxcheng    07/22/96 -  add OCITypeElemType() to top
+    jwijaya    07/03/96 -  add ANSI prototypes
+    cxcheng    06/28/96 -  add OCITypeElemCharSetForm()
+    cxcheng    06/26/96 -  fix comment on OCITypeParamByPos()/ortgpps()
+    cxcheng    06/18/96 -  fix comments on OCITypeResult()
+    cxcheng    06/17/96 -  improve comments
+    skrishna   06/03/96 -  change OCITypeCollElem() prototype
+    vkrishna   05/29/96 -  replace OROTCFAR with OROTCCAR
+    cxcheng    05/28/96 -  fix comments, remove non-beta1 functions
+    cxcheng    05/02/96 -  fix prototype bugs
+    cxcheng    04/29/96 -  rename OCITypeElemm() to ortanct()
+    cxcheng    04/26/96 -  add ortgrbp and ortftyi,
+                           fix comments and examples
+    cxcheng    04/22/96 -  big merge to main branch
+    cxcheng    04/17/96 -  fix syntax
+    cxcheng    04/08/96 -  change prototype to ortaty()
+    skrishna   04/08/96 -  change ort*() to take OCIEnv* and OCIError* instead
+                           of oroenv*
+    cxcheng    03/28/96 -  add ortslob(), change ortsstr() prototype
+    cxcheng    03/13/96 -  change alter type interface
+    cxcheng    03/11/96 -  ORT interface changes
+    cxcheng    02/27/96 -  correct comments
+    jboonleu   02/09/96 -  rename oroopd to OCIDuration
+    cxcheng    01/19/96 -  change ORTCTYVAL to ORTCTYEMB for embedded ADT
+    cxcheng    02/14/96 -  add more comments
+    jboonleu   02/09/96 -  rename oroopd to OCIDuration
+    cxcheng    02/07/96 -  fix comments and examples
+    cxcheng    01/19/96 -  new ORT interface without korfc's
+    cxcheng    01/08/96 -  consolidate collection functions
+    cxcheng    12/14/95 -  remove obsolete ortgcol() and ortrelease()
+    jweisz     12/12/95 -  merge screwup: ortdth twice
+    cxcheng    12/05/95 -  change multiset interface for new standard
+    skotsovo   12/01/95 -  merge from /vobs/rdbms/public/ort.h@@/main/
+                           st_rdbms_big_dev/st_rdbms_obj/
+                           st_rdbms_jwijaya_variable_ref
+    cxcheng    11/13/95 -  add ortaty()/orteaty()
+    cxcheng    11/13/95 -  add new collection type accessors
+    skotsovo   10/30/95 -  add 'oid' type b/c extent type uses it.
+    skotsovo   10/24/95 -  update according to new variable length ref
+    cxcheng    10/05/95 -  add null support, change prototypes to calls
+    cxcheng    10/03/95 -  add OCITypeMethodOrder() to get ORDER method
+    cxcheng    09/28/95 -  add OCITypeElemm() for collection types support
+    skotsovo   06/05/95 -  add adt_type parameter to ortsab() 
+    skotsovo   05/10/95 -  ifdef'd out ortgafp() 
+    skotsovo   03/07/95 -  update interface to only include release 1
+    skotsovo   02/22/95 -  add multiset accessors 
+    skotsovo   02/09/95 -  update according to new ots doc 
+    skotsovo   01/31/95 -  add rest of release 1 types 
+    skotsovo   01/24/95 -  categorize sint32, double, and real as number types 
+                           (with precision and scale) instead of scalar types.
+    skotsovo   01/12/95 -  remove dependency from ortdty interface 
+    skotsovo   01/03/95 -  remove orotyp accessors 
+    skotsovo   12/12/94 -  update comments 
+    skotsovo   12/05/94 -  change OCITypeElemParameterizedTyper interface 
+    skotsovo   10/26/94 -  add type version table 
+    skotsovo   10/17/94 -  fix ortgafp() comments 
+    skotsovo   10/14/94 -  modify ortgafp() parameters 
+    skotsovo   10/14/94 -  add examples 
+    skotsovo   10/13/94 -  add a few new routines 
+    jwijaya    10/07/94 -  add namespace to pin by name 
+    jwijaya    10/02/94 -  connection handle -> connection number 
+    skotsovo   09/13/94 -  modify example to use updated oririni interface 
+    skotsovo   08/25/94 -  change scale to sb1 from sb2 
+    skotsovo   07/28/94 -  add ortbeg() and ortend() 
+    skotsovo   07/14/94 -  add decimal type & call graph
+    skotsovo   06/28/94 -  subset by removing miscellaneous functions 
+    skotsovo   06/28/94 -  consistently put comments before typedefs 
+    skotsovo   06/27/94 -  modify according to new header file template, add
+                           more examples, and change ortcty() to return a
+                           reference to the type
+    skotsovo   06/24/94 -  add functions to get type information from orotyp 
+    skotsovo   06/20/94 -  finish modifying according to header template 
+    skotsovo   06/09/94 -  modify according to header file template 
+    skotsovo   06/08/94 -  replace s.h with oratypes.h 
+    skotsovo   05/24/94 -  modify comments & update example
+    skotsovo   05/23/94 -  modify fnt names for create, alter and drop type 
+    skotsovo   05/18/94 -  remove ortdme() -- delete a method 
+    skotsovo   05/17/94 -  add tdo parameter to all type modifiers 
+    skotsovo   05/11/94 -  return text* instead of including it in arglist 
+    skotsovo   11/16/93 -  creation
+
+*/
+
+#ifndef ORATYPES
+#include <oratypes.h>
+#endif
+#ifndef ORO_ORACLE
+#include <oro.h>
+#endif
+#ifndef OCI_ORACLE
+#include <oci.h>
+#endif
+
+#ifndef ORT_ORACLE
+#define ORT_ORACLE
+
+/*---------------------------------------------------------------------------*/
+/*                         SHORT NAMES SUPPORT SECTION                       */
+/*---------------------------------------------------------------------------*/
+
+#ifdef SLSHORTNAME
+
+/* the following are short names that are only supported on IBM mainframes
+   with the SLSHORTNAME defined.
+   With this all subsequent long names will actually be substituted with
+   the short names here */
+
+#define OCITypeArrayByName              ortgatyp
+#define OCITypeAttrByName               ortgabn
+#define OCITypeAttrNext                 ortgabi
+#define OCITypeAttrs                    ortgtna
+#define OCITypeByRef                    ortgtbrf
+#define OCITypeCollElem                 ortgcel
+#define OCITypeCollExtTypeCode          ortgcsqt
+#define OCITypeCollSize                 ortgcne
+#define OCITypeCollTypeCode             ortgdttc
+#define OCITypeElem                     ortado
+#define OCITypeElemCharSetForm          ortgscform
+#define OCITypeElemCharSetID            ortgscid
+#define OCITypeElemDefaultValue         ortgpdv
+#define OCITypeElemExtTypeCode          ortgasqt
+#define OCITypeElemLength               ortgsl
+#define OCITypeElemName                 ortganm
+#define OCITypeElemNumPrec              ortgnp
+#define OCITypeElemNumScale             ortgns
+#define OCITypeElemParamMode            ortgpmo
+#define OCITypeElemParameterizedType    ortgpa
+#define OCITypeElemType                 ortgaty
+#define OCITypeElemTypeCode             ortgatc
+#define OCITypeIter                     ortitr
+#define OCITypeIterFree                 ortifre
+#define OCITypeIterNew                  ortinew
+#define OCITypeIterSet                  ortiset
+#define OCITypeMethod                   ortmdo
+#define OCITypeMethodByName             ortgmbn
+#define OCITypeMethodEncap              ortgmen
+#define OCITypeMethodFlags              ortgmfl
+#define OCITypeMethodMap                ortgmmap
+#define OCITypeMethodName               ortgmnm
+#define OCITypeMethodNext               ortgmbi
+#define OCITypeMethodOrder              ortgmor
+#define OCITypeMethodOverload           ortgmno
+#define OCITypeMethodParams             ortgmnp
+#define OCITypeMethods                  ortgtnm
+#define OCITypeName                     ortgtme
+#define OCITypeParamByName              ortgpbn
+#define OCITypeParamPos                 ortgpps
+#define OCITypeSchema                   ortgtsch
+#define OCITypeTypeCode                 ortgttc
+#define OCITypeVTInit                   ortvini
+#define OCITypeVTInsert                 ortvins
+#define OCITypeVTSelect                 ortvsel
+#define OCITypeVersion                  ortgtvn
+
+#endif                                                        /* SLSHORTNAME */
+
+
+/*============================*/        
+/* PUBLIC TYPES AND CONSTANTS */
+/*============================*/
+
+/*----------------------------- TYPE DESCRIPTION ----------------------------*/
+
+/*
+ * OCIType - OCI Type Description Object 
+ *
+ * The contents of an 'OCIType' is private/opaque to clients.  Clients just 
+ * need to declare and pass 'OCIType' pointers in to the type manage
+ * functions.
+ * The pointer points to the type in the object cache.  Thus, clients don't
+ * need to allocate space for this type and must NEVER free the pointer to the
+ * 'OCIType'.
+ */
+
+typedef struct OCIType OCIType;
+
+/*------------------------- TYPE ELEMENT DESCRIPTION ------------------------*/
+
+
+/*
+ * OCITypeElem - OCI Type Element object
+ *
+ * The contents of an 'OCITypeElem' is private/opaque to clients. Clients just 
+ * need to declare and pass 'OCITypeElem' pointers in to the type manager 
+ * functions.
+ *
+ * 'OCITypeElem' objects contains type element information such as the numeric
+ * precision for example, for number objects, and the number of elements for
+ * arrays.
+ * They ARE used to describe type attributes, collection elements,
+ * method parameters, and method results. Hence they are pass in or returned
+ * by attribute, collection, and method parameter/result accessors.
+ */
+
+typedef struct OCITypeElem OCITypeElem;
+
+
+/*--------------------------- METHOD DESCRIPTION ---------------------------*/
+
+
+/*
+ * OCITypeMethod - OCI Method Description object 
+ *
+ * The contents of an 'OCITypeMethod' is private/opaque to clients.  Clients
+ * just need to declare and pass 'OCITypeMethod' pointers in to the type
+ * manager functions.
+ * The pointer points to the method in the object cache.  Thus, clients don't
+ * need to allocate space for this type and must NEVER free the pointer to 
+ * the 'OCITypeMethod'.
+ */
+
+typedef struct OCITypeMethod OCITypeMethod;
+
+
+/*--------------------------- TYPE ACCESS ITERATOR --------------------------*/
+
+/*
+ * OCITypeIter- OCI Type Iterator
+ *
+ * The contents of an 'orti' is private/opaque to clients.  Clients just 
+ * need to declare and pass 'orti' pointers in to the type manager functions.
+ * The iterator is used to retreive MDO's and ADO's that belong to the TDO
+ * one at a time. It needs to be allocated by the 'OCITypeIterNew()' function
+ * call and deallocated with the 'OCITypeIterFree()' function call.
+ */
+
+typedef struct OCITypeIter OCITypeIter;
+
+
+/*==================*/
+/* PUBLIC FUNCTIONS */
+/*==================*/
+
+/*--------------------------------------------------------------------------*/
+/*                                  ITERATOR                                */
+/*--------------------------------------------------------------------------*/
+
+/*-----------------------_- OCITypeIterNew ---------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeIterNew(    OCIEnv *env, OCIError *err, OCIType *tdo, 
+                         OCITypeIter **iterator_ort    );
+
+/*
+  NAME: OCITypeIterNew - OCI Iterator NEW
+  PARAMETERS:
+       env (IN/OUT) - OCI environment handle initialized in object mode
+       err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+       tdo (IN) - pointer to the pinned type in the object cache to
+                initialize the iterator with
+       iterator_ort (OUT) - pointer to the pointer to the new iterator created
+  DESCRIPTION:
+       Create a new instance of a method/attribute iterator and initalize
+       it's values.
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+           1) any of the required parameters is null.
+           2) error while allocating space for the iterator.
+*/
+
+/*------------------------ OCITypeIterSet ---------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeIterSet(    OCIEnv *env, OCIError *err, OCIType *tdo, 
+                  OCITypeIter *iterator_ort    );
+
+/*
+  NAME: OCITypeIterSet - OCI Iterator SET
+  PARAMETERS:
+       env (IN/OUT) - OCI environment handle initialized in object mode
+       err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+       tdo (IN) - pointer to the pinned type in the object cache to
+                initialize the iterator with
+       iterator_ort (IN/OUT) - pointer to the iterator to set
+  DESCRIPTION:
+       Initializes the iterator. This is used to reset the state of the
+       iterator.
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+           1) any of the required parameters is null.
+*/
+
+/*------------------------ OCITypeIterFree ---------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeIterFree(    OCIEnv *env, OCIError *err, OCITypeIter
+                          *iterator_ort    );
+
+/*
+  NAME: OCITypeIterFree - OCI Iterator FREe
+  PARAMETERS:
+       env (IN/OUT) - OCI environment handle initialized in object mode
+       err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+       iterator_ort (IN/OUT) - pointer to the iterator to free
+  DESCRIPTION:
+       Free space allocated for the iterator.
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+           1) any of the required parameters is null.
+           2) error while freeing the iterator, probably bad iterator pointer.
+*/
+
+
+/*--------------------------------------------------------------------------*/
+/*                                  TYPE GET                                */
+/*--------------------------------------------------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeByName(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+                        CONST oratext *schema_name, ub4 s_length,
+                        CONST oratext *type_name, ub4 t_length,
+                        CONST oratext *version_name, ub4 v_length,
+                        OCIDuration pin_duration, OCITypeGetOpt get_option,
+                        OCIType **tdo    );
+/*
+  NAME: OCITypeByName - OCI Get the most current version of an existing TYPe
+                  by name.
+  PARAMETERS:
+       env (IN/OUT) - OCI environment handle initialized in object mode
+       err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+       svc (IN) - OCI service handle
+       schema_name (IN, optional) - name of schema associated with the 
+                  type.  By default, the user's schema name is used.
+       s_length (IN) - length of the 'schema_name' parameter
+       type_name (IN) - name of the type to get
+       t_length (IN) - length of the 'type_name' parameter
+       version_name (IN, optional) - user readable version of the type.
+                  Pass (oratext *)0 for the most current version.
+       v_length (IN) - length of version_name in bytes. Should be 0 if
+                  the most current version is to be retrieved.
+       pin_duration (IN) - pin duration (e.g. until the end of current
+                  transaction).  See 'oro.h' for a description of
+                  each option.
+       get_option (IN) - options for loading the types. It can be one of two
+                   values:
+                  OCI_TYPEGET_HEADER for only the header to be loaded, or
+                  OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
+                    loaded.
+       tdo (OUT) - pointer to the pinned type in the object cache
+  DESCRIPTION:
+       Get a pointer to a version of the existing type associated
+       with schema/type name.
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+           1) any of the required parameters is null.
+           2) the adt type associated with schema/type name does not exist.
+  NOTE:
+       Schema and type names are CASE-SENSITIVE. If they have been created
+       via SQL, you need to use uppercase names.
+*/
+
+sword OCITypeArrayByName(    OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+                             ub4 array_len,
+                             CONST oratext *schema_name[], ub4 s_length[],
+                             CONST oratext *type_name[], ub4 t_length[],
+                             CONST oratext *version_name[], ub4 v_length[],
+                             OCIDuration pin_duration,
+                             OCITypeGetOpt get_option, OCIType **tdo    );
+
+/*
+  NAME: OCITypeArrayByName - OCI Get array of TYPes by name.
+  PARAMETERS:
+       env (IN/OUT) - OCI environment handle initialized in object mode
+       err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+       svc (IN) - OCI service handle
+       array_len (IN) - number of schema_name/type_name/version_name entries to
+                  be retrieved.
+       schema_name (IN, optional) - array of schema names associated with the
+                  types to be retrieved.  The array must have array_len
+                  elements if specified.
+                  If 0 is supplied, the default schema is assumed, otherwise
+                  it MUST have array_len number of elements.
+                  0 can be supplied for one or more of the entries to indicate
+                  that the default schema is desired for those entries.
+       s_length (IN) - array of schema_name lengths with each entry
+                  corresponding to the length of the corresponding schema_name
+                  entry in the schema_name array in bytes.
+                  The array must either have array_len number of elements or
+                  it MUST be 0 if schema_name is not specified.
+       type_name (IN) - array of the names of the types to retrieve. This
+                  MUST have array_len number of elements.
+       t_length (IN) - array of the lengths of type names in the type_name
+                  array in bytes.
+       version_name (IN) - array of the version names of the types to retrieve
+                  corresponding. This can be 0 to indicate retrieval of the
+                  most current versions, or it MUST have array_len number of
+                  elements.
+                  If 0 is supplied, the most current version is assumed,
+                  otherwise it MUST have array_len number of elements.
+                  0 can be supplied for one or more of the entries to indicate
+                  that the current version is desired for those entries.
+       v_length (IN) - array of the lengths of version names in the
+                  version_name array in bytes.
+       pin_duration (IN) - pin duration (e.g. until the end of current
+                  transaction) for the types retreieve.  See 'oro.h' for a
+                  description of each option.
+       get_option (IN) - options for loading the types. It can be one of two
+                   values:
+                  OCI_TYPEGET_HEADER for only the header to be loaded, or
+                  OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
+                    loaded.
+       tdo (OUT) - output array for the pointers to each pinned type in the
+                  object cache. It must have space for array_len pointers.
+                  Use OCIObjectGetObjectRef() to obtain the CREF to each
+                  pinned type descriptor.
+  DESCRIPTION:
+       Get pointers to the existing types associated with the schema/type name
+       array. This is similar to OCITypeByName() except that all the TDO's are
+       retreived via a single network roundtrip.
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+           1) any of the required parameters is null.
+           2) one or more adt types associated with a schema/type name entry
+              does not exist.
+*/
+
+sword   OCITypeByRef(    OCIEnv *env, OCIError *err,
+                         CONST OCIRef *type_ref, OCIDuration pin_duration,
+                         OCITypeGetOpt get_option, OCIType **tdo    );
+
+/*
+  NAME: OCITypeArrayByRef - OCI Get array of TYPes by REF.
+  PARAMETERS:
+       env (IN/OUT) - OCI environment handle initialized in object mode
+       err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+       type_ref (IN) - OCIRef * pointing to the particular version of
+                  the type descriptor object to obtain.
+                  The array must have array_len elements if specified.
+       pin_duration (IN) - pin duration (e.g. until the end of current
+                  transaction) for the type to retreieve.  See 'oro.h' for a
+                  description of each option.
+       get_option (IN) - options for loading the type. It can be one of two
+                   values:
+                  OCI_TYPEGET_HEADER for only the header to be loaded, or
+                  OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
+                    loaded.
+       tdo (OUT) - pointer to the pinned type in the object cache
+  DESCRIPTION:
+       Get pointers to the 
+       with the schema/type name array. This is similar to OCITypeByName()
+       except that all the TDO's are retreived via a single network roundtrip.
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+           1) any of the required parameters is null.
+           2) one or more adt types associated with a schema/type name entry
+              does not exist.
+*/
+
+sword   OCITypeArrayByRef(    OCIEnv *env, OCIError *err,
+                              ub4 array_len, CONST OCIRef **type_ref,
+                              OCIDuration pin_duration,
+                              OCITypeGetOpt get_option, OCIType **tdo    );
+
+/*
+  NAME: OCITypeArrayByRef - OCI Get array of TYPes by REF.
+  PARAMETERS:
+       env (IN/OUT) - OCI environment handle initialized in object mode
+       err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+       array_len (IN) - number of schema_name/type_name/version_name entries to
+                  be retrieved.
+       type_ref (IN) - array of OCIRef * pointing to the particular version of
+                  the type descriptor object to obtain.
+                  The array must have array_len elements if specified.
+       pin_duration (IN) - pin duration (e.g. until the end of current
+                  transaction) for the types retreieve.  See 'oro.h' for a
+                  description of each option.
+       get_option (IN) - options for loading the types. It can be one of two
+                   values:
+                  OCI_TYPEGET_HEADER for only the header to be loaded, or
+                  OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
+                    loaded.
+       tdo (OUT) - output array for the pointers to each pinned type in the
+                  object cache. It must have space for array_len pointers.
+                  Use OCIObjectGetObjectRef() to obtain the CREF to each
+                  pinned type descriptor.
+  DESCRIPTION:
+       Get pointers to the 
+       with the schema/type name array. This is similar to OCITypeByName()
+       except that all the TDO's are retreived via a single network roundtrip.
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+           1) any of the required parameters is null.
+           2) one or more adt types associated with a schema/type name entry
+              does not exist.
+*/
+
+
+/*--------------------------------------------------------------------------*/
+/*                              TYPE ACCESSORS                              */
+/*--------------------------------------------------------------------------*/
+
+/*---------------------------- OCITypeName ---------------------------------*/
+
+/* ** OBSOLETE ** */
+oratext* OCITypeName(    OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+                      ub4 *n_length    );
+/*
+   NAME: OCITypeName -  ORT Get a Type's naME.
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+        n_length (OUT) - length (in bytes) of the returned type name.  The
+               caller must allocate space for the ub4 before calling this
+               routine.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling
+           any accessor.
+        2) All input parameters must not be NULL and must be valid.
+        3) 'n_length' must point to an allocated ub4.
+   DESCRIPTION:
+        Get the name of the type.
+   RETURNS:
+        the name of the type
+   NOTES:
+        The type descriptor, 'tdo', must be unpinned when the accessed 
+        information is no longer needed.
+ */
+
+/*------------------------ OCITypeSchema ---------------------------------*/
+
+/* ** OBSOLETE ** */
+oratext* OCITypeSchema(    OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+                   ub4 *n_length    );
+/*
+   NAME: OCITypeSchema -  ORT Get a Type's SCHema name.
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+        n_length (OUT) - length (in bytes) of the returned schema name.  The
+               caller must allocate space for the ub4 before calling this
+               routine.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+        3) 'n_length' must point to an allocated ub4.
+   DESCRIPTION:
+        Get the schema name of the type.
+   RETURNS:
+        the schema name of the type
+   NOTES:
+        The type descriptor, 'tdo', must be unpinned when the accessed 
+        information is no longer needed.
+ */
+
+/*------------------------ OCITypeTypeCode ---------------------------------*/
+
+/* ** OBSOLETE ** */
+OCITypeCode OCITypeTypeCode(    OCIEnv *env, OCIError *err,
+                                CONST OCIType *tdo    );
+/*
+   NAME: OCITypeTypeCode - OCI Get a Type's Type Code.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the type code of the type.
+   RETURNS:
+        The type code of the type.
+   NOTES:
+        The type descriptor, 'tdo', must be unpinned when the accessed 
+        information is no longer needed.
+ */
+
+/*----------------------- OCITypeCollTypeCode -------------------------------*/
+
+/* ** OBSOLETE ** */
+OCITypeCode OCITypeCollTypeCode(    OCIEnv *env, OCIError *err,
+                                    CONST OCIType *tdo    );
+/*
+   NAME: OCITypeCollTypeCode - OCI Get a Domain Type's Type Code.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+        3) 'tdo' MUST point to a named collection type.
+   DESCRIPTION:
+        Get the type code of the named collection type. For V8.0, named
+        collection types can only be variable length arrays and nested tables.
+   RETURNS:
+        OCI_TYPECODE_VARRAY for variable length array, and
+        OCI_TYPECODE_TABLE for nested tables.
+   NOTES:
+        The type descriptor, 'tdo', should be unpinned when the accessed 
+        information is no longer needed.
+ */
+
+/*------------------------- OCITypeVersion ---------------------------------*/
+
+/* ** OBSOLETE ** */
+oratext* OCITypeVersion(    OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+                         ub4 *v_length    );
+/*
+   NAME: OCITypeVersion - OCI Get a Type's user-readable VersioN. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+        v_length (OUT) - length (in bytes) of the returned user-readable 
+               version.  The caller must allocate space for the ub4 before 
+               calling this routine.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+        3) 'v_length' must point to an allocated ub4.
+   DESCRIPTION:
+        Get the user-readable version of the type.
+   RETURNS:
+        The user-readable version of the type
+   NOTES:
+        The type descriptor, 'tdo', must be unpinned when the accessed 
+        information is no longer needed.
+ */
+
+/*--------------------------- OCITypeAttrs ---------------------------------*/
+
+/* ** OBSOLETE ** */
+ub4 OCITypeAttrs(    OCIEnv *env, OCIError *err, CONST OCIType *tdo    );
+/*
+   NAME: OCITypeAttrs - OCI Get a Type's Number of Attributes. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the number of attributes in the type.
+   RETURNS:
+        The number of attributes in the type. 0 for ALL non-ADTs.
+   NOTES:
+        The type descriptor, 'tdo', must be unpinned when the accessed 
+        information is no longer needed.
+ */
+
+/*------------------------- OCITypeMethods ---------------------------------*/
+
+/* ** OBSOLETE ** */
+ub4 OCITypeMethods(    OCIEnv *env, OCIError *err, CONST OCIType *tdo    );
+/*
+   NAME: OCITypeMethods - OCI Get a Type's Number of Methods. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the number of methods in a type.
+   RETURNS:
+        The number of methods in the type
+   NOTES:
+        The type descriptor, 'tdo', must be unpinned when the accessed 
+        information is no longer needed.
+ */
+
+
+/*--------------------------------------------------------------------------*/
+/*                     TYPE ELEMENT INFORMATION ACCESSORS                   */
+/*--------------------------------------------------------------------------*/
+
+/*------------------------ OCITypeElemName ---------------------------------*/
+
+/* ** OBSOLETE ** */
+oratext* OCITypeElemName(    OCIEnv *env, OCIError *err, 
+                           CONST OCITypeElem *elem, ub4 *n_length    );
+/*
+   NAME: OCITypeElemName - OCI Get an Attribute's NaMe. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the type element descriptor in the object cache
+        n_length (OUT) - length (in bytes) of the returned attribute name.  
+               The caller must allocate space for the ub4 before calling this 
+               routine.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+        3) 'n_length' must point to an allocated ub4.
+   DESCRIPTION:
+        Get the name of the attribute.
+   RETURNS:
+        the name of the attribute and the length in n_length
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------ OCITypeElemTypeCode ------------------------------*/
+
+/* ** OBSOLETE ** */
+OCITypeCode OCITypeElemTypeCode(    OCIEnv *env, OCIError *err,
+                                    CONST OCITypeElem *elem    );
+/*
+   NAME: OCITypeElemTypeCode - OCI Get an Attribute's TypeCode. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the type element descriptor in the object cache
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the typecode of an attribute's type.
+   RETURNS:
+        the typecode of the attribute's type.  If this is a scalar type, the 
+        typecode sufficiently describes the scalar type and no further calls 
+        need to be made.  Valid scalar types include: OCI_TYPECODE_SIGNED8,
+        OCI_TYPECODE_UNSIGNED8, OCI_TYPECODE_SIGNED16, OCI_TYPECODE_UNSIGNED16,
+        OCI_TYPECODE_SIGNED32, OCI_TYPECODE_UNSIGNED32, OCI_TYPECODE_REAL,
+        OCI_TYPECODE_DOUBLE, OCI_TYPECODE_DATE,
+        OCI_TYPECODE_MLSLABEL, OROTCOID, OCI_TYPECODE_OCTET, or OROTCLOB.
+        This function converts the CREF (stored in the attribute) into a
+        typecode.
+   NOTES:
+       The type must be unpinned when the accessed information is no 
+       longer needed.
+ */
+
+/*------------------------ OCITypeElemType ---------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeElemType(    OCIEnv *env, OCIError *err, CONST OCITypeElem *elem, 
+                          OCIType **elem_tdo    );
+/*
+  PARAMETERS
+     env (IN/OUT) - OCI environment handle initialized in object mode
+     err (IN/OUT) - error handle. If there is an error, it is
+             recorded in 'err' and this function returns OCI_ERROR.
+             The error recorded in 'err' can be retrieved by calling
+             OCIErrorGet().
+     elem (IN) - pointer to the type element descriptor in the object cache
+     elem_tdo (OUT) - If the function completes successfully, 'elem_tdo'
+            points to the type descriptor (in the object cache) of the type of
+            the element.
+
+  REQUIRES
+     1) All type accessors require that the type be pinned before calling
+        any accessor.  This can be done by calling 'OCITypeByName()'.
+     2) if 'elem' is not null, it must point to a valid type element descriptor
+        in the object cache.
+
+  DESCRIPTION
+     Get the type tdo of the type of this element.
+  RETURNS
+     OCI_SUCCESS if the function completes successfully.
+     OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+     OCI_ERROR if
+         1) any of the parameters is null.
+
+  NOTES
+     The type must be unpinned when the accessed information is no
+     longer needed.  This can be done by calling 'OCIObjectUnpin()'.
+ */
+
+/*------------------------- OCITypeElemFlags -------------------------------*/
+
+/* ** OBSOLETE ** */
+ub4 OCITypeElemFlags(    OCIEnv *env, OCIError *err,
+                         CONST OCITypeElem *elem    );
+/*
+   NAME: OCITypeElemFlags - OCI Get a Elem's FLags
+                              (inline, constant, virtual, constructor,
+                              destructor). 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the type element descriptor in the object cache
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the flags of a type element (attribute, parameter).
+   RETURNS:
+        The flags of the type element.
+   NOTES:
+        The flag bits are not externally documented. Use only the macros
+        in the last section (ie. OCI_TYPEPARAM_IS_REQUIRED, and
+        OCI_TYPEELEM_IS_REF) to test for them only. The type must be unpinned
+        when the accessed information is no longer needed.
+ */
+
+/*------------------------ OCITypeElemNumPrec ------------------------------*/
+
+/* ** OBSOLETE ** */
+ub1 OCITypeElemNumPrec(    OCIEnv *env, OCIError *err,
+                           CONST OCITypeElem *elem    );
+/*
+   NAME: OCITypeElemNumPrec - Get a Number's Precision.  This includes float,
+                              decimal, real, double, and oracle number.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the type element descriptor in the object cache
+   REQUIRES:
+        All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the precision of a float, decimal, long, unsigned long, real, 
+        double, or Oracle number type. 
+   RETURNS:
+        the precision of the float, decimal, long, unsigned long, real, double,
+        or Oracle number 
+ */
+
+/*------------------------- OCITypeElemNumScale -----------------------------*/
+
+/* ** OBSOLETE ** */
+sb1 OCITypeElemNumScale(    OCIEnv *env, OCIError *err,
+                            CONST OCITypeElem *elem    );
+/*
+   NAME: OCITypeElemNumScale - Get a decimal or oracle Number's Scale 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the type element descriptor in the object cache
+   REQUIRES:
+        All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the scale of a decimal, or Oracle number type. 
+   RETURNS:
+        the scale of the decimal, or Oracle number 
+ */
+
+/*------------------------ OCITypeElemLength -------------------------------*/
+
+/* ** OBSOLETE ** */
+ub4 OCITypeElemLength(    OCIEnv *env, OCIError *err,
+                          CONST OCITypeElem *elem    );
+/*
+   NAME: OCITypeElemLength - Get a raw, fixed or variable length String's
+                             length in bytes.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the type element descriptor in the object cache
+   REQUIRES:
+        All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the length of a raw, fixed or variable length string type. 
+   RETURNS:
+        length of the raw, fixed or variable length string
+ */
+
+/*----------------------- OCITypeElemCharSetID -----------------------------*/
+
+/* ** OBSOLETE ** */
+ub2 OCITypeElemCharSetID(    OCIEnv *env, OCIError *err,
+                             CONST OCITypeElem *elem    );
+/*
+   NAME: OCITypeElemCharSetID - Get a fixed or variable length String's
+                                character set ID
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the type element descriptor in the object cache
+   REQUIRES:
+        All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the character set ID of a fixed or variable length string type. 
+   RETURNS:
+        character set ID of the fixed or variable length string
+ */
+
+/*---------------------- OCITypeElemCharSetForm ----------------------------*/
+
+/* ** OBSOLETE ** */
+ub2 OCITypeElemCharSetForm(    OCIEnv *env, OCIError *err,
+                               CONST OCITypeElem *elem    );
+/*
+   NAME: OCITypeElemCharSetForm - Get a fixed or variable length String's
+                                  character set specification form.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the attribute information in the object cache
+   REQUIRES:
+        All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the character form of a fixed or variable length string type.
+        The character form is an enumerated value that can be one of the
+        4 values below:
+               SQLCS_IMPLICIT for CHAR, VARCHAR2, CLOB w/o a specified set
+               SQLCS_NCHAR    for NCHAR, NCHAR VARYING, NCLOB
+               SQLCS_EXPLICIT for CHAR, etc, with "CHARACTER SET ..." syntax
+               SQLCS_FLEXIBLE for PL/SQL "flexible" parameters
+   RETURNS:
+        character form of the fixed or variable string
+ */
+
+/*--------------------- OCITypeElemParameterizedType ------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeElemParameterizedType(    OCIEnv *env, OCIError *err,
+                                       CONST OCITypeElem *elem, 
+                                       OCIType **type_stored    );
+/*
+   NAME: OCITypeElemParameterizedType 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the type element descriptor in the object cache
+        type_stored (OUT) - If the function completes successfully, 
+               and the parameterized type is complex, 'type_stored' is NULL.
+               Otherwise, 'type_stored' points to the type descriptor (in the 
+               object cache) of the type that is stored in the parameterized 
+               type.  The caller must allocate space for the OCIType* 
+               before calling this routine and must not write into the space.
+   REQUIRES:
+        All input parameters must be valid.
+   DESCRIPTION:
+        Get a descriptor to the parameter type of a parameterized type.
+        Parameterized types are types of the form:
+          REF T
+          VARRAY (n) OF T
+        etc, where T is the parameter in the parameterized type.
+        Additionally is_ref is set if the parameter is a PTR or REF.
+        For example, it is set for REF T or VARRAY(n) OF REF T.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the parameters is null.
+            2) 'type_stored' is not NULL but points to NULL data.
+   NOTES:
+        Complex parameterized types will be in a future release (once 
+        typedefs are supported.  When setting the parameterized type 
+        information, the user must typedef the contents if it's a
+        complex parameterized type.  Ex. for varray<varray<car>>, use
+        'typedef varray<car> varcar' and then use varray<varcar>. 
+ */
+
+/*----------------------- OCITypeElemExtTypeCode ----------------------------*/
+ 
+/* ** OBSOLETE ** */
+OCITypeCode OCITypeElemExtTypeCode(    OCIEnv *env, OCIError *err,
+                                       CONST OCITypeElem *elem    );
+/*
+   NAME: OCITypeElemExtTypeCode - OCI Get an element's SQLT constant.
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the type element descriptor in the object cache
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling
+           any accessor.
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the internal Oracle typecode associated with an attribute's type.
+        This is the actual typecode for the attribute when it gets mapped
+        to a column in the Oracle database.
+   RETURNS:
+        The Oracle typecode associated with the attribute's type.
+   NOTES:
+        The type must be unpinned when the accessed information is no
+        longer needed.
+ */
+
+/*--------------------------------------------------------------------------*/
+/*                           ATTRIBUTE ACCESSORS                            */
+/*--------------------------------------------------------------------------*/
+
+/*------------------------ OCITypeAttrByName -------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeAttrByName(    OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+                            CONST oratext *name, ub4 n_length,
+                            OCITypeElem **elem    );
+/*
+   NAME: OCITypeAttrByName - OCI Get an Attribute By Name. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+        name (IN) - the attribute's name 
+        n_length (IN) - length (in bytes) of the 'name' parameter
+        elem (OUT) - If this function completes successfully, 'elem' points to 
+               the selected type element descriptor pertaining to the
+               attributein the object cache.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) if 'tdo' is not null, it must point to a valid type descriptor 
+           in the object cache.
+   DESCRIPTION:
+        Get an attribute given its name.  
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the required parameters is null.
+            2) the type does not contain an attribute with the input 'name'. 
+            3) 'name' is NULL.
+   NOTES:
+        The type descriptor, 'tdo', must be unpinned when the accessed 
+        information is no longer needed.
+        Schema and type names are CASE-SENSITIVE. If they have been created
+        via SQL, you need to use uppercase names.
+ */
+
+/*------------------------ OCITypeAttrNext ---------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeAttrNext(    OCIEnv *env, OCIError *err, 
+                        OCITypeIter *iterator_ort, OCITypeElem **elem    );
+
+/*
+   NAME: OCITypeAttrNext - OCI Get an Attribute By Iteration.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        iterator_ort (IN/OUT) - iterator for retrieving the next attribute;
+               see OCITypeIterNew() to initialize iterator.
+        elem (OUT) - If this function completes successfully, 'elem' points to 
+               the selected type element descriptor pertaining to the
+               attributein the object cache.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+            any accessor. 
+        2) if 'tdo' is not null, it must point to a valid type descriptor 
+           in the object cache.
+   DESCRIPTION:
+        Iterate to the next attribute to retrieve.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_NO_DATA if there are no more attributes to iterate on; use
+            OCITypeIterSet() to reset the iterator if necessary.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the required parameters is null.
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*--------------------------------------------------------------------------*/
+/*                           COLLECTION ACCESSORS                           */
+/*--------------------------------------------------------------------------*/
+
+/*------------------------ OCITypeCollElem ---------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeCollElem(    OCIEnv *env, OCIError *err, CONST OCIType *tdo,
+                          OCITypeElem **element    );
+/*
+   NAME: OCITypeCollElem
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to the type descriptor in the object cache
+        element (IN/OUT) - If the function completes successfully, this
+               points to the descriptor for the collection's element.
+               It is stored in the same format as an ADT attribute's
+               descriptor.
+               If *element is NULL, OCITypeCollElem() implicitly allocates a
+               new instance of OCITypeElem in the object cache. This instance
+               will be
+               automatically freed at the end of the session, and does not have
+               to be freed explicitly.
+               If *element is not NULL, OCITypeCollElem() assumes that it
+               points to a valid OCITypeElem descriptor and will copy the
+               results into it.
+   REQUIRES:
+        All input parameters must be valid.
+   DESCRIPTION:
+        Get a pointer to the descriptor (OCITypeElem) of the element of an
+        array or the rowtype of a nested table.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the parameters is null.
+            2) the type TDO does not point to a valid collection's type.
+   NOTES:
+        Complex parameterized types will be in a future release (once 
+        typedefs are supported.  When setting the parameterized type 
+        information, the user must typedef the contents if it's a
+        complex parameterized type.  Ex. for varray<varray<car>>, use
+        'typedef varray<car> varcar' and then use varray<varcar>. 
+ */
+
+/*------------------------ OCITypeCollSize ---------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeCollSize(    OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+                          ub4 *num_elems    );
+/*
+   NAME: OCITypeCollSize - OCI Get a Collection's Number of Elements.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to the type descriptor in the object cache
+        num_elems (OUT) - number of elements in collection
+   REQUIRES:
+        All input parameters must be valid. tdo points to an array type
+        defined as a domain.
+   DESCRIPTION:
+        Get the number of elements stored in a fixed array or the maximum 
+        number of elements in a variable array.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the parameters is null.
+            2) 'tdo' does not point to a domain with a collection type.
+   NOTES:
+        Complex parameterized types will be in a future release (once 
+        typedefs are supported.  When setting the parameterized type 
+        information, the user must typedef the contents if it's a
+        complex parameterized type.  Ex. for varray<varray<car>>, use
+        'typedef varray<car> varcar' and then use varray<varcar>. 
+ */
+
+/*------------------------ OCITypeCollExtTypeCode ---------------------------*/
+ 
+/* ** OBSOLETE ** */
+sword OCITypeCollExtTypeCode(    OCIEnv *env, OCIError *err,
+                               CONST OCIType *tdo, OCITypeCode *sqt_code    );
+/*
+   NAME: ortcsqt - OCI Get a Collection element's DTY constant.
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to the type descriptor in the object cache
+        sqt_code (OUT) - SQLT code of type element.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling
+           any accessor.
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the SQLT constant associated with an domain's element type.
+        The SQLT codes are defined in <sqldef.h> and are needed for OCI/OOCI
+        use.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null.
+        OCI_ERROR if
+            1) any of the parameters is null.
+            2) 'tdo' does not point to a domain with a collection type.
+   NOTES:
+        The type must be unpinned when the accessed information is no
+        longer needed.
+ */
+ 
+
+/*--------------------------------------------------------------------------*/
+/*                             METHOD ACCESSORS                             */
+/*--------------------------------------------------------------------------*/
+
+/*------------------------- OCITypeMethodOverload --------------------------*/
+
+/* ** OBSOLETE ** */
+ub4 OCITypeMethodOverload(    OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+                              CONST oratext *method_name, ub4 m_length    );
+/*
+   NAME: OCITypeMethodOverload - OCI Get type's Number of Overloaded names
+                                 for the given method name.
+   PARAMETERS:
+        gp (IN/OUT) - pga environment handle.  Any errors are recorded here.
+        tdo (IN) - pointer to to the type descriptor in the object cache
+        method_name (IN) - the method's name
+        m_length (IN) - length (in bytes) of the 'method_name' parameter
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling
+           any accessor.
+        2) if 'tdo' is not null, it must point to a valid type descriptor
+           in the object cache.
+   DESCRIPTION:
+        Overloading of methods implies that more than one method may have the
+        same method name.  This routine returns the number of methods that
+        have the given method name.  If there are no methods with the input
+        method name, 'num_methods' is 0.  The caller uses this information when
+        allocating space for the array of mdo and/or position pointers before
+        calling 'OCITypeMethodByName()' or 'ortgmps()'.
+   RETURNS:
+        The number of methods with the given name. 0 if none contains the
+        name.
+   NOTES:
+        Schema and type names are CASE-SENSITIVE. If they have been created
+        via SQL, you need to use uppercase names.
+ */
+
+/*------------------------ OCITypeMethodByName ------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeMethodByName(    OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+                              CONST oratext *method_name, ub4 m_length,
+                              OCITypeMethod **mdos    );
+/*
+   NAME: OCITypeMethodByName - OCI Get one or more Methods with Name. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+        method_name (IN) - the methods' name  
+        m_length (IN) - length (in bytes) of the 'name' parameter
+        mdos (OUT) - If this function completes successfully, 'mdos' points to
+                the selected methods in the object cache.  The caller must
+                allocate space for the array of OCITypeMethod pointers before
+                calling this routine and must not write into the space.
+                The number of OCITypeMethod pointers that will be returned can
+                be obtained by calling 'OCITypeMethodOverload()'.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) if 'tdo' is not null, it must point to a valid type descriptor 
+           in the object cache.
+   DESCRIPTION:
+        Get one or more methods given the name.  
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the required parameters is null.
+            2) No methods in type has name 'name'.
+            3) 'mdos' is not NULL but points to NULL data.
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+        Schema and type names are CASE-SENSITIVE. If they have been created
+        via SQL, you need to use uppercase names.
+ */
+
+/*------------------------ OCITypeMethodNext --------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeMethodNext(    OCIEnv *env, OCIError *err, 
+                            OCITypeIter *iterator_ort,
+                            OCITypeMethod **mdo   );
+
+/*
+   NAME: OCITypeMethodNext - OCI Get a Method By Iteration.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        iterator_ort (IN/OUT) - iterator for retrieving the next method;
+               see OCITypeIterNew() to set iterator.
+        mdo (OUT) - If this function completes successfully, 'mdo' points to 
+               the selected method descriptor in the object cache.  Positions 
+               start at 1.  The caller must allocate space for the
+               OCITypeMethod* before calling this routine and must not write 
+               nto the space. 
+   REQUIRES:
+         1) All type accessors require that the type be pinned before calling 
+            any accessor. 
+        2) if 'tdo' is not null, it must point to a valid type descriptor 
+           in the object cache.
+   DESCRIPTION:
+        Iterate to the next method to retrieve.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_NO_DATA if there are no more attributes to iterate on; use
+            OCITypeIterSet() to reset the iterator if necessary.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the required parameters is null.
+            2) 'mdo' is not NULL but points to NULL data.
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------ OCITypeMethodName --------------------------------*/
+
+/* ** OBSOLETE ** */
+oratext *OCITypeMethodName(    OCIEnv *env, OCIError *err,
+                            CONST OCITypeMethod *mdo, ub4 *n_length    );
+/*
+   NAME: OCITypeMethodName - OCI Get a Method's NaMe. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        mdo (IN) - pointer to the method descriptor in the object cache
+        n_length (OUT) - length (in bytes) of the 'name' parameter.  The caller
+               must allocate space for the ub4 before calling this routine.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the (non-unique) real name of the method.
+   RETURNS:
+        the non-unique name of the method or NULL if there is an error.
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------ OCITypeMethodEncap -------------------------------*/
+
+/* ** OBSOLETE ** */
+OCITypeEncap OCITypeMethodEncap(    OCIEnv *env, OCIError *err,
+                                    CONST OCITypeMethod *mdo    );
+/*
+   NAME: OCITypeMethodEncap - Get a Method's ENcapsulation (private/public). 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        mdo (IN) - pointer to the method descriptor in the object cache
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the encapsulation (private, or public) of a method.
+   RETURNS:
+        the encapsulation (private, or public) of the method
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------ OCITypeMethodFlags -------------------------------*/
+
+/* ** OBSOLETE ** */
+OCITypeMethodFlag OCITypeMethodFlags(    OCIEnv *env, OCIError *err,
+                                         CONST OCITypeMethod *mdo    );
+/*
+   NAME: OCITypeMethodFlags - OCI Get a Method's FLags
+                              (inline, constant, virtual, constructor,
+                              destructor). 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        mdo (IN) - pointer to the method descriptor in the object cache
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the flags (inline, constant, virutal, constructor, destructor) of
+        a method.
+   RETURNS:
+        the flags (inline, constant, virutal, constructor, destructor) of
+        the method
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------ OCITypeMethodMap ---------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeMethodMap(    OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+                           OCITypeMethod **mdo    );
+/*
+   NAME: OCITypeMethodMap - OCI Get the Method's MAP function.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+        mdo (OUT) - If this function completes successfully, and there is a 
+               map function for this type, 'mdo' points to the selected method 
+               descriptor in the object cache.  Otherwise, 'mdo' is null.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All required input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        A type may have only one map function.  'OCITypeMethodMap()' finds
+        this function, if it exists, and returns a reference and a pointer to
+        the method descriptor in the object cache.  If the type does not have a
+        map (relative ordering) function, then 'mdo_ref' and 'mdo' are set
+        to null and an error is returned.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            the type does not contain a map function.
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------ OCITypeMethodOrder -------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeMethodOrder(    OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+                             OCITypeMethod **mdo    );
+/*
+   NAME: OCITypeMethodOrder - OCI Get the Method's ORder function.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        tdo (IN) - pointer to to the type descriptor in the object cache
+        mdo (OUT) - If this function completes successfully, and there is a 
+               map function for this type, 'mdo' points to the selected method 
+               descriptor in the object cache.  Otherwise, 'mdo' is null.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All required input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        A type may have only one ORder or MAP function. 'OCITypeMethodOrder()'
+        finds this function, if it exists, and returns a ref and a pointer
+        to the method descriptor in the object cache.  If the type does not
+        have a map (relative ordering) function, then 'mdo_ref' and 'mdo' are
+        set to null and an error is returned.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            the type does not contain a map function.
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------ OCITypeMethodParams ------------------------------*/
+
+/* ** OBSOLETE ** */
+ub4 OCITypeMethodParams(    OCIEnv *env, OCIError *err,
+                            CONST OCITypeMethod *mdo    );
+/*
+   NAME: OCITypeMethodParams - OCI Get a Method's Number of Parameters. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        mdo (IN) - pointer to the method descriptor in the object cache
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the number of parameters in a method.
+   RETURNS:
+        the number of parameters in the method
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+
+/*--------------------------------------------------------------------------*/
+/*                             RESULT ACCESSORS                             */
+/*--------------------------------------------------------------------------*/
+
+/*-------------------------- OCITypeResult ---------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeResult(    OCIEnv *env, OCIError *err, CONST OCITypeMethod *mdo,
+                        OCITypeElem **elem    );
+/*
+   NAME: OCITypeResult - OCI Get a method's result type descriptor.
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        mdo (IN) - pointer to the method descriptor in the object cache
+        elem (OUT) - If this function completes successfully, 'rdo' points to 
+               the selected result (parameter) descriptor in the object cache.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor.
+        2) 'elem' MUST be the address of an OCITypeElem pointer.
+   DESCRIPTION:
+        Get the result of a method.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the required parameters is null.
+            2) method returns no results.
+   NOTES:
+        The method must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+
+/*--------------------------------------------------------------------------*/
+/*                           PARAMETER ACCESSORS                            */
+/*--------------------------------------------------------------------------*/
+
+/*------------------------ OCITypeParamByPos -------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeParamByPos(    OCIEnv *env, OCIError *err,
+                            CONST OCITypeMethod *mdo, ub4 position, 
+                            OCITypeElem **elem    );
+/*
+   NAME: OCITypeParamByPos - OCI Get a Parameter in a method By Position. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        mdo (IN) - pointer to the method descriptor in the object cache
+        position (IN) - the parameter's position.  Positions start at 1.
+        elem (OUT) - If this function completes successfully, 'elem' points to 
+               the selected parameter descriptor in the object cache.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+   DESCRIPTION:
+        Get a parameter given its position in the method.  Positions start 
+        at 1.  
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the required parameters is null.
+            2) 'position' is not >= 1 and <= the number of parameters in the
+               method.
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------ OCITypeParamByName -------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeParamByName(    OCIEnv *env, OCIError *err,
+                             CONST OCITypeMethod *mdo, 
+                             CONST oratext *name, ub4 n_length,
+                             OCITypeElem **elem    );
+/*
+   NAME: OCITypeParamByName - OCI Get a Parameter in a method By Name. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        mdo (IN) - pointer to the method descriptor in the object cache
+        name (IN) - the parameter's name
+        n_length (IN) - length (in bytes) of the 'name' parameter
+        elem (OUT) - If this function completes successfully, 'elem' points to 
+               the selected parameter descriptor in the object cache.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) if 'mdo' is not null, it must point to a valid method descriptor 
+           in the object cache.
+   DESCRIPTION:
+        Get a parameter given its name.  
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the required parameters is null.
+            2) the method does not contain a parameter with the input 'name'. 
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------ OCITypeParamPos ---------------------------------*/
+
+/* ** OBSOLETE ** */
+sword OCITypeParamPos(    OCIEnv *env, OCIError *err,
+                          CONST OCITypeMethod *mdo, 
+                          CONST oratext *name, ub4 n_length, ub4 *position, 
+                          OCITypeElem **elem    );
+/*
+   NAME: OCITypeParamPos - OCI Get a parameter's position in a method
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        mdo (IN) - pointer to the method descriptor in the object cache
+        name (IN) - the parameter's name
+        n_length (IN) - length (in bytes) of the 'name' parameter
+        position (OUT) - If this function completes successfully, 'position' 
+               points to the position of the parameter in the method starting 
+               at position 1. position MUST point to space for a ub4.
+        elem (OUT) - If this function completes successfully, and 
+               the input 'elem' is not NULL, 'elem' points to the selected 
+               parameter descriptor in the object cache.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) if 'mdo' is not null, it must point to a valid method descriptor 
+           in the object cache.
+   DESCRIPTION:
+        Get the position of a parameter in a method.  Positions start at 1.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null. 
+        OCI_ERROR if
+            1) any of the parameters is null.
+            2) the method does not contain a parameter with the input 'name'. 
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------ OCITypeParamElemMode -----------------------------*/
+
+/* ** OBSOLETE ** */
+OCITypeParamMode OCITypeElemParamMode(    OCIEnv *env, OCIError *err,
+                                          CONST OCITypeElem *elem    );
+/*
+   NAME: OCITypeElemParamMode - OCI Get a parameter's mode
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the parameter descriptor in the object cache
+                (represented by an OCITypeElem)
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the mode (in, out, or in/out) of the parameter.
+   RETURNS:
+        the mode (in, out, or in/out) of the parameter
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+
+/*------------------------- OCITypeElemDefaultValue -------------------------*/
+
+/* ** OBSOLETE ** */
+oratext* OCITypeElemDefaultValue(    OCIEnv *env, OCIError *err,
+                                  CONST OCITypeElem *elem,
+                                  ub4 *d_v_length    );
+/*
+   NAME: OCITypeElemDefaultValue - OCI Get the element's Default Value. 
+   PARAMETERS: 
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        elem (IN) - pointer to the parameter descriptor in the object cache
+                (represented by an OCITypeElem)
+        d_v_length (OUT) - length (in bytes) of the returned default value.
+               The caller must allocate space for the ub4 before calling this 
+               routine.
+   REQUIRES:
+        1) All type accessors require that the type be pinned before calling 
+           any accessor. 
+        2) All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Get the default value in text form (PL/SQL) of an element. For V8.0,
+        this only makes sense for a method parameter.
+   RETURNS:
+        The default value (text) of the parameter.
+   NOTES:
+        The type must be unpinned when the accessed information is no 
+        longer needed.
+ */
+ 
+
+/*--------------------------------------------------------------------------*/
+/*                           TYPE VERSION TABLE                             */
+/*--------------------------------------------------------------------------*/
+
+/* For V8.0, the type version table is meant to be an internal data structure
+   only for Oracle clients for type version maintanence purposes. A more
+   general version of the API may be made public in subsequent releases. */
+
+
+/*--------------------------- OCITypeVTInit --------------------------------*/
+ 
+/* ** OBSOLETE ** */
+sword OCITypeVTInit(    OCIEnv *env, OCIError *err    );
+/*
+   NAME: OCITypeVTInit - OCI type Version table INItialize
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+   REQUIRES:
+        none
+   DESCRIPTION:
+        Allocate space for and initialize the type version table and the type
+        version table's index.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null.
+        OCI_ERROR if internal errors occurrs during initialization.
+ */
+ 
+/*--------------------------- OCITypeVTInsert -------------------------------*/
+ 
+/* ** OBSOLETE ** */
+sword OCITypeVTInsert(    OCIEnv *env, OCIError *err, 
+                          CONST oratext *schema_name, ub4 s_n_length, 
+                          CONST oratext *type_name, ub4 t_n_length, 
+                          CONST oratext *user_version, ub4 u_v_length    );
+/*
+   NAME: OCITypeVTInsert - OCI type Version table INSert entry.
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        schema_name (IN, optional) - name of schema associated with the 
+                  type.  By default, the user's schema name is used.
+        s_n_length (IN) - length of the 'schema_name' parameter
+        type_name (IN) - type name to insert
+        t_n_length (IN) - length (in bytes) of the 'type_name' parameter
+        user_version (IN) - user readable version of the type
+        u_v_length (IN) - length (in bytes) of the 'user_version' parameter
+   REQUIRES:
+        none
+   DESCRIPTION:
+        Insert an entry into the type version table and the type version
+        table's index.  The entry's type name and user readable version
+        fields are updated with the input values.  All other fields are
+        initialized to null.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null.
+        OCI_ERROR if
+            1) any of the parameters is invalid.
+            2) an entry for 'type_name' has already been registered in the
+               type version table.
+ */
+
+/*------------------------------ OCITypeVTSelect ----------------------------*/
+
+/* OCITypeVTSelect - OCI type VERSion table SELECT entry */
+/* ** OBSOLETE ** */
+sword OCITypeVTSelect(    OCIEnv *env, OCIError *err, 
+                          CONST oratext *schema_name, ub4 s_n_length, 
+                          CONST oratext *type_name, ub4 t_n_length, 
+                          oratext **user_version, ub4 *u_v_length,
+                        ub2 *version );
+/*
+   NAME: OCITypeVTSelect - OCI type Version table SELect entry.
+   PARAMETERS:
+        env (IN/OUT) - OCI environment handle initialized in object mode
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        schema_name (IN, optional) - name of schema associated with the 
+                  type.  By default, the user's schema name is used.
+        s_n_length (IN) - length of the 'schema_name' parameter
+        type_name (IN) - type name to select
+        t_n_length (IN) - length (in bytes) of the 'type_name' parameter
+        user_version (OUT, optional) - pointer to user readable version of the
+                 type
+        u_v_length (OUT, optional) - length (in bytes) of the 'user_version'
+                 parameter
+        version (OUT, optional) - internal type version
+   REQUIRES:
+        All input parameters must not be NULL and must be valid.
+   DESCRIPTION:
+        Select an entry in the type version table by name.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'env' or 'err' is null.
+        OCI_ERROR if
+            1) any of the parameters is invalid.
+            2) an entry with 'type_name' does not exist.
+ */
+
+/* Compatibility function - following function prototype retained for 
+   compatibility only */
+sword ortgcty(    OCIEnv *env, OCIError *err, OCIType *coll_tdo,
+                  OCIType **collelem_tdo    );
+
+/*---------------------------------------------------------------------------*/
+/*               Transient Type Construction functions                       */
+/*---------------------------------------------------------------------------*/
+
+sword OCITypeBeginCreate(OCISvcCtx *svchp, OCIError *errhp, OCITypeCode tc,
+                         OCIDuration dur, OCIType **type);
+/*
+   NAME: OCITypeBeginCreate - OCI Type Begin Creation of a transient type.
+   REMARKS
+       Begins the construction process for a transient type. The type will be
+       anonymous (no name). To create a persistent named type, the CREATE TYPE
+       statement should be used from SQL. Transient types have no identity.
+       They are pure values.
+   PARAMETERS:
+       svchp (IN)       - The OCI Service Context.
+       errhp (IN/OUT)   - The OCI error handle. If there is an error, it is
+                          recorded in errhp and this function returns
+                          OCI_ERROR. Diagnostic information can be obtained by
+                          calling OCIErrorGet().
+       tc               - The TypeCode for the type. The Typecode could
+                          correspond to a User Defined Type or a Built-in type.
+                          Currently, the permissible values for User Defined 
+                          Types are OCI_TYPECODE_OBJECT for an Object Type
+                          (structured), OCI_TYPECODE_VARRAY for a VARRAY
+                          collection type or OCI_TYPECODE_TABLE for a nested
+                          table collection type. For Object types,
+                          OCITypeAddAttr() needs to be called to add each of
+                          the attribute types. For Collection types,
+                          OCITypeSetCollection() needs to be called.
+                          Subsequently, OCITypeEndCreate() needs to be called 
+                          to finish the creation process.
+                          The permissible values for Built-in type codes are
+                          specified in the user manual. Additional information
+                          on built-ins if any (like precision, scale for
+                          numbers, character set info for VARCHAR2s etc.) must
+                          be set with a subsequent call to OCITypeSetBuiltin().
+                          Subsequently OCITypeEndCreate() needs to be called
+                          to finish the creation process.
+       dur              - The allocation duration for the Type. Could be a
+                          predefined or a user defined duration.
+       type(OUT)        - The OCIType (Type Descriptor) that is being
+                          constructed.
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_ERROR on error.
+*/
+
+
+sword OCITypeSetCollection(OCISvcCtx *svchp, OCIError *errhp, OCIType *type,
+                           OCIParam *collelem_info, ub4 coll_count);
+/*
+   NAME: OCITypeSetCollection - OCI Type Set Collection information
+   REMARKS :
+       Set Collection type information. This call can be called only if the
+       OCIType has been constructed with a collection typecode.
+   PARAMETERS:
+       svchp (IN)      -  The OCI Service Context.
+       errhp (IN/OUT)  -  The OCI error handle. If there is an error, it is 
+                          recorded in errhp and this function returns
+                          OCI_ERROR. Diagnostic information can be obtained by
+                          calling OCIErrorGet().
+       type(IN OUT)    -  The OCIType (Type Descriptor) that is being
+                          constructed.
+       collelem_info   -  collelem_info provides information on the collection
+                          element. It is obtained by allocating an OCIParam
+                          (parameter handle) and setting type information in
+                          the OCIParam using OCIAttrSet() calls.
+       coll_count      -  The count of elements in the collection. Pass 0 for
+                          a nested table (unbounded).
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_ERROR on error.
+*/
+
+sword OCITypeSetBuiltin(OCISvcCtx *svchp, OCIError *errhp, OCIType *type,
+                        OCIParam *builtin_info);
+/*
+   NAME: OCITypeSetBuiltin - OCI Type Set Builtin information.
+   REMARKS:
+       Set Built-in type information. This call can be called only if the
+       OCIType has been constructed with a built-in typecode
+       (OCI_TYPECODE_NUMBER etc.).
+   PARAMETERS:
+       svchp (IN)       - The OCI Service Context.
+       errhp (IN/OUT)   - The OCI error handle. If there is an error, it is 
+                          recorded in errhp and this function returns
+                          OCI_ERROR. Diagnostic information can be obtained by
+                          calling OCIErrorGet().
+       type(IN OUT)     - The OCIType (Type Descriptor) that is being
+                          constructed.
+       builtin_info     - builtin_info provides information on the built-in
+                          (like precision, scale, charater set etc.). It is
+                          obtained by allocating an OCIParam (parameter handle)
+                          and setting type information in the OCIParam using
+                           OCIAttrSet() calls.
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_ERROR on error.
+*/
+
+sword OCITypeAddAttr(OCISvcCtx *svchp, OCIError *errhp, OCIType *type,
+                     CONST oratext *a_name, ub4 a_length, 
+                     OCIParam *attr_info);
+/*
+   NAME: OCITypeAddAttr - OCI Type Add Attribute to an Object Type.
+   REMARKS:
+       Adds an attribute to an Object type (that was constructed earlier with
+       typecode OCI_TYPECODE_OBJECT).
+   PARAMETERS:
+       svchp (IN)       - The OCI Service Context
+       errhp (IN/OUT)   - The OCI error handle. If there is an error, it is
+                          recorded in errhp and this function returns
+                          OCI_ERROR. Diagnostic information can be obtained by
+                          calling OCIErrorGet().
+       type (IN/OUT)    - The Type description that is being constructed.
+       a_name(IN)       - Optional. gives the name of the attribute.
+       a_length         - Optional. gives length of attribute name.
+       attr_info        - Information on the attribute. It is obtained by
+                          allocating an OCIParam (parameter handle) and setting
+                          type information in the OCIParam using OCIAttrSet()
+                          calls.
+  RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_ERROR on error.
+*/
+
+sword OCITypeEndCreate(OCISvcCtx *svchp, OCIError *errhp, OCIType *type);
+/*
+   NAME: OCITypeEndCreate - OCI Type End Creation
+   REMARKS:
+       Finishes construction of a type description.Subsequently, only access
+       will be allowed.
+   PARAMETERS:
+       svchp (IN)       - The OCI Service Context
+       errhp (IN/OUT)   - The OCI error handle. If there is an error, it is
+                          recorded in errhp and this function returns
+                          OCI_ERROR. Diagnostic information can be obtained by
+                          calling OCIErrorGet().
+       type (IN/OUT)    - The Type description that is being constructed.
+   RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_ERROR on error.
+*/
+
+/*=========================*/
+/* PUBLIC MACROS AND FLAGS */
+/*=========================*/
+
+/*--------------------------------------------------------------------------*/
+/*                          TYPE ELEMENT FLAGS                              */
+/*--------------------------------------------------------------------------*/
+
+#define OCI_TYPEELEM_REF        0x8000                   /* element is a REF */
+#define OCI_TYPEPARAM_REQUIRED  0x0800              /* parameter is required */
+
+/* macros to test flags */
+#define OCI_TYPEELEM_IS_REF(elem_flag) \
+  (((elem_flag) & OCI_TYPEELEM_REF)!=0)
+#define OCI_TYPEPARAM_IS_REQUIRED(param_flag) \
+  (((param_flag) & OCI_TYPEPARAM_REQUIRED)!=0)
+
+
+#endif /* ORT_ORACLE */
+
diff --git a/src/terralib/drivers/Oracle/TeOCIConnect.cpp b/src/terralib/drivers/Oracle/TeOCIConnect.cpp
new file mode 100644
index 0000000..39506af
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOCIConnect.cpp
@@ -0,0 +1,456 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+
+#include "TeOCIConnect.h"
+#include "TeOCISDO.h"
+#include <cstring>
+
+
+TeOCIConnection::TeOCIConnection() 
+{
+	connected_ = false;
+	useSDO_ = false;
+
+	envhp_ = 0;
+	errhp_ = 0;
+	srvhp_ = 0;
+	svchp_ = 0;
+	usrhp_ = 0;
+	txnhp_ = 0;
+	stmthp_ = 0;
+	tdo_geometry_ = 0;
+	tdo_ordinates_ = 0;
+	ordinates_ = 0;
+	blobValue_ = 0;
+}
+
+
+bool TeOCIConnection::connect(const char* dblink, const char* username, const char* password, const bool& useSDO) 
+{
+	sword status;
+
+	int mode = OCI_THREADED|OCI_OBJECT;
+	
+	//create and initialize the environment
+	status = SDO_OCIEnvCreate(&envhp_, (ub4)mode, (dvoid *)0, 
+				      (dvoid*(*)(dvoid *ctxp, size_t size))0, 
+				      (dvoid*(*)(dvoid *ctxp, dvoid *memptr, size_t newsize))0, 
+				      (void (*)(dvoid *ctxp, dvoid *memptr))0, 
+					  (size_t)0, (dvoid**)0);
+	if(!checkError(errhp_, status))
+		return false;
+
+	// Allocate handles - errhp_(OCIError) and srvhp_ (OCIServer)
+	status = SDO_OCIHandleAlloc((dvoid*)envhp_, (dvoid**)&errhp_, (ub4)OCI_HTYPE_ERROR,
+					   (size_t)0, (dvoid**)0);
+	if(!checkError(errhp_, status))
+		return false;
+
+	status = SDO_OCIHandleAlloc((dvoid*)envhp_, (dvoid**)&srvhp_, (ub4)OCI_HTYPE_SERVER,
+					   (size_t)0, (dvoid**)0);
+	if(!checkError(errhp_, status))
+		return false;
+
+	// Multiple Sessions or Connections
+	status = SDO_OCIServerAttach(srvhp_, errhp_, (text*)dblink, 
+						 (sb4)strlen(dblink), (ub4)OCI_DEFAULT);
+	if(!checkError(errhp_, status))
+		return false;
+
+	// Allocate handles: svchp_(OCISvcCtx)
+	status = SDO_OCIHandleAlloc((dvoid*)envhp_, (dvoid**)&svchp_, (ub4)OCI_HTYPE_SVCCTX, 
+					   (size_t)0, (dvoid**)0);
+	if(!checkError(errhp_, status))
+		return false;
+
+	// Set the server attribute in the service context handle
+	status = SDO_OCIAttrSet((dvoid*)svchp_, (ub4)OCI_HTYPE_SVCCTX, (dvoid*)srvhp_, (ub4)0, 
+				   (ub4)OCI_ATTR_SERVER, errhp_);
+	if(!checkError(errhp_, status))
+		return false;
+
+	/// Allocate a user session handle
+	status = SDO_OCIHandleAlloc((dvoid*)envhp_, (dvoid**)&usrhp_, (ub4)OCI_HTYPE_SESSION, 
+					   (size_t)0, (dvoid**)0);
+	if(!checkError(errhp_, status))
+		return false;
+
+	// set user name attribute in user session handle 
+	status = SDO_OCIAttrSet((dvoid*)usrhp_, (ub4)OCI_HTYPE_SESSION, (dvoid*)username, 
+				   (ub4)strlen(username), (ub4)OCI_ATTR_USERNAME, errhp_);
+	if(!checkError(errhp_, status))
+		return false;
+	
+	// set password attribute in user session handle
+	status = SDO_OCIAttrSet((dvoid*)usrhp_, (ub4)OCI_HTYPE_SESSION, (dvoid*)password, 
+				   (ub4)strlen(password), (ub4)OCI_ATTR_PASSWORD, errhp_);
+	if(!checkError(errhp_, status))
+		return false;
+
+	// Session begins - establishes a session for a user against a particular
+	// server. This call is required for the user to execute operations on the server.
+	status = SDO_OCISessionBegin(svchp_, errhp_, usrhp_, OCI_CRED_RDBMS, 
+								 OCI_DEFAULT);
+	if(!checkError(errhp_, status))
+		return false;
+
+	// set the user session attribute in the service context handle
+	status = SDO_OCIAttrSet((dvoid*)svchp_, (ub4)OCI_HTYPE_SVCCTX, (dvoid*)usrhp_, (ub4)0, 
+				   (ub4)OCI_ATTR_SESSION, errhp_);
+	if(!checkError(errhp_, status))
+		return false;
+
+	// allocate transaction handle 1 and set it in the service handle (OCITrans)
+	status = OCIHandleAlloc((dvoid *)envhp_, (dvoid **)&txnhp_, OCI_HTYPE_TRANS, 0, 0);
+	if(!checkError(errhp_, status))
+		return false;
+
+	status = OCIAttrSet((dvoid *)svchp_, OCI_HTYPE_SVCCTX, (dvoid *)txnhp_, 0,OCI_ATTR_TRANS, errhp_);
+	if(!checkError(errhp_, status))
+		return false;
+
+	// locate stmthp_
+	status = SDO_OCIHandleAlloc((dvoid*)envhp_, (dvoid**)&stmthp_, 
+								  (ub4)OCI_HTYPE_STMT, (size_t)0, (dvoid**)0);
+	if(!checkError(errhp_, status))
+		return false;
+
+	if(useSDO)
+	{
+		//load the tdo type to sdo_geometry (OCIType)
+		status = OCITypeByName(envhp_, errhp_, svchp_, (const text *)
+			"MDSYS", (ub4) strlen((char *)"MDSYS"),
+			(const text *) "SDO_GEOMETRY",	(ub4) strlen((char *)"SDO_GEOMETRY"),
+			(text *)0, 0, OCI_DURATION_SESSION, OCI_TYPEGET_HEADER, &tdo_geometry_);
+		if(!checkError(errhp_, status))
+			return false;
+
+		//load the tdo type to sdo_ordinates (OCIType)
+		status = OCITypeByName(envhp_, errhp_, svchp_, (const text *)
+			"MDSYS", (ub4) strlen((char *)"MDSYS"),
+			(const text *) "SDO_ORDINATE_ARRAY", (ub4) strlen((char *)"SDO_ORDINATE_ARRAY"),
+			(text *)0, 0, OCI_DURATION_SESSION, OCI_TYPEGET_HEADER, &tdo_ordinates_);
+		if(!checkError(errhp_, status))
+			return false;
+	}
+	connected_ = true;
+	useSDO_ = useSDO;
+	return true;
+}
+
+
+void TeOCIConnection::disconnect()  
+{
+	
+	OCIObjectFree(envhp_, errhp_, (dvoid*)ordinates_, (ub4)OCI_OBJECTFREE_FORCE);
+	
+	// Session ends
+	SDO_OCISessionEnd(svchp_, errhp_, usrhp_, (ub4)OCI_DEFAULT);
+	SDO_OCIServerDetach(srvhp_, errhp_, (ub4)OCI_DEFAULT);
+
+
+	SDO_OCIHandleFree((dvoid*)tdo_geometry_, (ub4)OCI_HTYPE_DESCRIBE);
+	SDO_OCIHandleFree((dvoid*)tdo_ordinates_, (ub4)OCI_HTYPE_DESCRIBE);
+
+	// Finalize svchp_, srvhp_, errhp_ and stmthp_
+	SDO_OCIHandleFree((dvoid*)txnhp_, (ub4)OCI_HTYPE_TRANS);
+	SDO_OCIHandleFree((dvoid*)srvhp_, (ub4)OCI_HTYPE_SERVER);
+	SDO_OCIHandleFree((dvoid*)svchp_, (ub4)OCI_HTYPE_SVCCTX);
+	SDO_OCIHandleFree((dvoid*)errhp_, (ub4)OCI_HTYPE_ERROR);
+	SDO_OCIHandleFree((dvoid*)usrhp_, (ub4)OCI_HTYPE_SESSION);
+	SDO_OCIHandleFree((dvoid*)stmthp_, (ub4)OCI_HTYPE_STMT);
+	
+	SDO_OCIHandleFree((dvoid*)envhp_, (ub4)OCI_HTYPE_ENV);
+
+	
+
+	connected_ = false;		
+	envhp_ = 0;
+	errhp_ = 0;
+	srvhp_ = 0;
+	svchp_ = 0;
+	usrhp_ = 0;
+	txnhp_ = 0;
+	tdo_geometry_ = 0;
+	tdo_ordinates_ = 0;
+	ordinates_ = 0;
+	stmthp_ = 0;
+	if(blobValue_)
+		delete [] blobValue_;
+	blobValue_ = 0;
+}
+
+
+bool TeOCIConnection::prepare(const string& stmt)
+{	
+	if (!connected_)
+		return false;
+	
+	ub4 size = stmt.size();
+	sword status = SDO_OCIStmtPrepare(svchp_, (OCIStmt *)stmthp_, errhp_, (text*)stmt.c_str(), (ub4)size,  
+		(text*)0, (ub4)0, (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);
+	if(!checkError(errhp_, status))
+		return false;
+
+	return true;
+}
+
+
+bool TeOCIConnection::bindByPos(int pos, void* value, int size, void* indicator, int type)
+{
+	if (!connected_)
+		return false;
+
+	OCIBind *bindp = NULL;
+
+	sword status = SDO_OCIBindByPos(stmthp_, &bindp, errhp_, pos, (dvoid *)value, 
+								(sb4)size, type, (dvoid *)indicator, (ub2 *)0, 
+								(ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT);
+	if(!checkError(errhp_, status))
+		return false;
+	return true;
+}
+
+bool TeOCIConnection::bindOrdinates()
+{
+	OCIBind		*bnd1p = NULL;
+	
+	/* bind coordinate varray object */
+	sword status = OCIBindByName(stmthp_, &bnd1p, errhp_, 
+	    (text *)":ordinates_", (sb4)-1, (dvoid *)0, (sb4)0, SQLT_NTY, (dvoid *)0, 
+		(ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT);
+	if(!checkError(errhp_, status))
+		return false;
+
+	status = OCIBindObject(bnd1p, errhp_, tdo_ordinates_, (dvoid **)&ordinates_, (ub4 *)0, 
+	    (dvoid **)0, (ub4 *)0);
+	if(!checkError(errhp_, status))
+		return false;
+
+	return true;
+}
+
+int TeOCIConnection::queryType()  
+{	
+	ub2 querytype_;
+		
+	sword status = OCIAttrGet((dvoid *)stmthp_, (ub4)OCI_HTYPE_STMT, (ub2 *)&querytype_,
+	(ub4*)NULL, (ub4)OCI_ATTR_STMT_TYPE, (OCIError *)errhp_);
+	if(!checkError(errhp_, status))
+		return -1;
+	return (querytype_);
+}
+
+
+bool TeOCIConnection::allocateObjectOrdinates()
+{
+	sword status = SDO_OCIObjectNew(envhp_, errhp_, svchp_, OCI_TYPECODE_VARRAY, tdo_ordinates_, (dvoid*)NULL, 
+					OCI_DURATION_SESSION, TRUE, (dvoid**)&ordinates_);
+
+	if(!checkError(errhp_, status))
+		return false;
+
+	return true;
+}
+
+
+bool TeOCIConnection::appendOrdinates(const double& val)
+{
+	
+	OCINumber	oci_number;
+	sword       status;
+	
+	status = OCINumberFromReal(errhp_, (dvoid *)&(val), 
+		(uword)sizeof(double),&oci_number);
+
+	status = OCICollAppend(envhp_, errhp_, 
+		(dvoid *) &oci_number,
+		(dvoid *)0, (OCIColl *)ordinates_);
+
+	if(!checkError(errhp_, status))
+		return false;
+
+	return true;
+}
+
+bool TeOCIConnection::transStart()
+{
+	sword status = OCITransStart (svchp_, errhp_, 60, OCI_TRANS_NEW); 
+	if(!checkError(errhp_, status))
+		return false;
+
+	return true;
+}
+
+bool TeOCIConnection::transRollback()
+{
+	sword status = OCITransRollback(svchp_, errhp_, (ub4) 0);
+	if(!checkError(errhp_, status))
+		return false;
+
+	return true;
+}
+
+bool TeOCIConnection::transCommit()
+{
+	sword status = OCITransCommit(svchp_, errhp_, (ub4) 0);
+	if(!checkError(errhp_, status))
+		return false;
+
+	return true;
+}
+
+bool TeOCIConnection::execute(const string& stm)
+{
+	if(!prepare(stm))
+		return false;
+	
+	if ((queryType()<0) || (queryType()==1))
+		return false;  //return records (query)
+	
+	transStart();
+	sword status = OCIStmtExecute(svchp_, stmthp_, errhp_, (ub4)1, (ub4)0, (OCISnapshot *)NULL, 
+								  (OCISnapshot *)NULL, (ub4)OCI_DEFAULT);
+	
+	if(!checkError(errhp_, status))
+	{
+		transRollback();
+		return false;
+	}
+
+	transCommit();
+	return true; 
+}
+
+
+bool TeOCIConnection::executeSDOSTM(const string& stm)  
+{
+	if(!prepare(stm))
+		return false;
+
+	if(!bindOrdinates())
+		return false;
+
+	if((queryType()<0) || (queryType()==1))
+		return false;  //return records (query)
+		
+	transStart();
+	sword status = OCIStmtExecute(svchp_, stmthp_, errhp_, (ub4)1, (ub4)0, (OCISnapshot *)NULL, 
+								  (OCISnapshot *)NULL, (ub4)OCI_DEFAULT);
+	
+	if(!checkError(errhp_, status))
+	{		
+		OCIObjectFree(envhp_, errhp_, (dvoid *)ordinates_, (ub2)OCI_OBJECTFREE_FORCE);
+		transRollback();
+		return false;
+	}
+
+	transCommit();
+	OCIObjectFree(envhp_, errhp_, (dvoid *)ordinates_, (ub2)OCI_OBJECTFREE_FORCE);
+	return true; 
+}
+
+bool 
+TeOCIConnection::executeBLOBSTM(const string& stm, unsigned char* blobValue, const int& blobLength, const string& name)
+{
+	//prepare the statement
+	if(!prepare(stm))
+		return false;
+	
+	if((queryType()<0) || (queryType()==1))
+		return false;  //return records (query)
+
+	//Bind blob
+	OCIBind		*bnd1p = NULL;
+	sword status = OCIBindByName(stmthp_, &bnd1p, errhp_,
+                (text *) name.c_str(), (sb4) name.size(),
+                (dvoid *) blobValue, (sb4) blobLength, SQLT_LBI,
+                (dvoid *) 0, (ub2 *)0, (ub2 *) 0,
+                (ub4) 0, (ub4 *) 0, (ub4) OCI_DEFAULT);
+	if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		return false;
+
+	status = OCIStmtExecute(svchp_, stmthp_, errhp_, (ub4)1, (ub4)0, (OCISnapshot *)NULL, 
+						  (OCISnapshot *)NULL, (ub4)OCI_DEFAULT);
+	if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		return false;
+
+	return true;
+}
+
+
+
+bool TeOCIConnection::checkError(OCIError* errhp_, int status) 
+{
+	char errbuf[512];
+	sb4 errcode = 0;
+	bool returnedVal = false;
+		
+	if (status == OCI_ERROR)
+	{
+		SDO_OCIErrorGet((dvoid*)errhp_, (ub4)1, (text*)NULL, &errcode, 
+						(text*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
+		errorMess_ = errbuf;
+		return false;
+	}
+
+	switch (status)
+	{ 
+		case OCI_SUCCESS:
+			//errorMess_ = "Success!";
+			returnedVal = true;
+			break;
+
+		case OCI_SUCCESS_WITH_INFO:
+			//errorMess_ = "Success with information!";
+			returnedVal = true;
+			break;
+
+		case OCI_NEED_DATA:
+			errorMess_ = "Need data!";
+			break;
+		
+		case OCI_NO_DATA:
+			errorMess_ = "No data!";
+			break;
+
+		//An invalid handle was passed as a parameter or a user callback is passed an
+		//invalid handle or invalid context. No further diagnostics are available.
+		case OCI_INVALID_HANDLE:
+			errorMess_ = "Invalid handle!";
+			break;
+
+		case OCI_STILL_EXECUTING:
+			errorMess_ = "Still executing!";
+			break;
+
+		case OCI_CONTINUE:
+			errorMess_ = "Continue!";
+			break;
+		default:
+			break;
+	}
+
+	return returnedVal;
+}
diff --git a/src/terralib/drivers/Oracle/TeOCIConnect.h b/src/terralib/drivers/Oracle/TeOCIConnect.h
new file mode 100644
index 0000000..ba47607
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOCIConnect.h
@@ -0,0 +1,136 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file  TeOCIConnect.h
+    \brief This file contains the class OCIConnect that is responsible for the connection to ORACLE DBMS using OCI (Oracle Call Interface) library. 
+*/
+
+#ifndef OCI_CONNECT_H
+#define OCI_CONNECT_H
+
+#include <oci.h>
+#include <string>
+
+#include "TeOracleDefines.h"
+
+using namespace std;
+
+/*! \class TeOCIConnection
+	\brief This class is used to connect to a ORACLE DBMS
+
+	This class is reponsible for the connection to ORACLE DBMS using OCI (Oracle Call Interface) library.
+*/
+class TLORACLE_DLL TeOCIConnection
+{
+protected:
+	bool	     connected_;		//!< indicates if there is a connection opened or not
+	bool		 useSDO_;			//!< indicates if the connected Oracle DBMS uses the SDO_GEOMETRY type 
+	string       errorMess_;		//!< error message returned by the ORACLE DBMS
+
+public:
+	/** @name OCI connection handles
+	*/
+	//@{ 	
+	OCIEnv*			envhp_;		//!< environment OCI handle        
+	OCIError*		errhp_;		//!< error OCI handle
+
+	OCIServer*		srvhp_;		//!< service context OCI handle - represents a connection 
+	OCISvcCtx*		svchp_;		//!< service context OCI handle - defines a service
+	OCISession*		usrhp_;		//!< service context OCI handle - defines the permissions and privileges associated to an user
+	OCITrans*		txnhp_;		//!< service context OCI handle - controls the transactions 
+
+	OCIStmt*		stmthp_;	//!< environment OCI handle - stores SQL statement
+	//@}
+
+	OCIType*		tdo_geometry_; 		//!< describes the SDO_GEOMETRY type 
+	OCIType*		tdo_ordinates_;		//!< describes the SDO_ORDINATES type
+	OCIArray*		ordinates_;			//!< stores the ordinates to insert into database 	
+
+	unsigned char*	blobValue_;			//!< stores the blob value that will be inserted into database  
+
+public:
+	
+	//! Constructor
+	TeOCIConnection();
+
+	//! Destructor
+	~TeOCIConnection() { disconnect(); }
+
+	//! Connects to ORACLE DBMS
+	bool connect(const char* dblink, const char* username, const char* password, const bool& useSDO = false);
+	
+	//! Disconnects to ORACLE DBMS
+	void disconnect();
+
+	//! Prepares the SQL statement to be executed
+	bool prepare(const string& stmt);
+
+	//! Binds objects by position
+	bool bindByPos(int pos, void* value, int size, void* indicator, int type);
+	
+	//! Binds objects by name
+	bool bindByName(char* name, void* value, int size, void* indicator, int type);
+	
+	//! Binds ordinate object
+	bool bindOrdinates();
+
+	//! Appends ordinates to be inserted or updated
+	bool appendOrdinates(const double& val);
+
+	//! Locates memory to the ordinates 
+	bool allocateObjectOrdinates();
+
+	//! Returns the query (statement SQL) type 
+	int	queryType(void);
+
+	//! Starts a transaction 
+	bool transStart();
+
+	//! Rollbacks a transaction
+	bool transRollback();
+
+	//! Commits a transaction
+	bool transCommit();
+	
+	//! Executes only SQL statements that do not return rows (INSERT, UPDATE, DELETE, etc)
+	bool execute(const string& stm);
+	
+	//! Executes only SQL statements that insert or update rows with SDO Objects 
+	bool executeSDOSTM(const string& stm);
+
+	//! Executes only SQL statements that insert or update rows with BLOB
+	bool executeBLOBSTM(const string& stm, unsigned char* blobValue, const int& blobLength, const string& name);
+
+	//! Checks if there is an opened conection
+	bool isConnected() { return connected_; }
+
+	//! Returns if the connected Oracle DBMS uses the SDO_GEOMETRY type
+	bool useSDOType() { return useSDO_; } 
+
+	//! Checks OCI error handle
+	bool checkError(OCIError* errhp, int status);
+
+	//! Gets the error message
+	string getErrorMessage() { return errorMess_; }
+};
+
+#endif
diff --git a/src/terralib/drivers/Oracle/TeOCICursor.cpp b/src/terralib/drivers/Oracle/TeOCICursor.cpp
new file mode 100644
index 0000000..68989f5
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOCICursor.cpp
@@ -0,0 +1,1391 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+
+#include "TeOCICursor.h"
+#include "TeOCISDO.h"
+#include "TeUtils.h"
+
+//C include files
+#include <cstring>
+#include <cstdlib>
+
+
+string getSQLToLoadBlobLength(const string& sql, const vector<string>& blobNames)
+{
+	string sqlSelectAux, sqlFromAux, sqlWhereAux;
+	
+	//Select clause
+	size_t posFrom = sql.find(" FROM ", 0);
+	sqlSelectAux = sql.substr(0, posFrom);
+	
+	//From and Where clause
+	sqlWhereAux = " ";
+	size_t posWhere = sql.find(" WHERE ", 0);
+	if(posWhere != string::npos)
+	{
+		sqlFromAux = sql.substr(posFrom, (posWhere-posFrom)+1);
+		sqlWhereAux = sql.substr(posWhere);
+	}
+	else
+		sqlFromAux = sql.substr(posFrom);
+	 
+	string beforeBlobName="";
+	//Verify if there is  string "SELECT *" 
+	size_t pos =  sqlSelectAux.find (" *", 0);
+	if(pos != string::npos) 
+	{
+		//two option:
+		//1: if there is only 1 table -> include an alias in the FROM clause  
+		//2: if there are more than 1 table -> include SELECT * ... and alias in the FROM clause
+		size_t posJoin = sqlFromAux.find(" JOIN ", 0);
+		size_t posVirg = sqlFromAux.find(",", 0);
+
+		if((posJoin!=string::npos) || (posVirg!=string::npos)) //there are more than 1
+		{
+			string aux = " FROM ( SELECT * "+ sqlFromAux + sqlWhereAux +" ) t ";
+			sqlFromAux = aux;
+			sqlWhereAux = "";
+		}
+		else //there are only 1
+			sqlFromAux += " t ";
+			
+		sqlSelectAux.replace(pos+1, 1, " t.* ");
+		beforeBlobName = "t.";
+	}
+	
+	for(unsigned int i=0; i<blobNames.size(); ++i)
+		sqlSelectAux += " , LENGTH("+ beforeBlobName + blobNames[i] +") ";
+		
+	return (sqlSelectAux+sqlFromAux+sqlWhereAux);
+	
+}
+
+//Given a string, remove all blanks and tabs (rigth)
+char* StrClean(char *name)
+{
+    int j;
+	
+	if ((name == NULL)) /*SGError.Handler(NULLPOINTER,FATAL);*/ 
+		return 0;
+
+	for (j = strlen(name)-1; j>=0; j--)
+	{
+		if ( !((name[j]==' ') || (name[j]=='\t') || (name[j]== '\0')) ) 
+			break;
+	}
+	
+	name[j+1] = '\0';
+
+	return name;
+}
+
+
+TeOCICursor::TeOCICursor(TeOCIConnection* connec, const unsigned long& maxBlobSize, const unsigned long& maxRowNum)
+{
+	if(!connec)
+		return;
+	
+	maxRows_ = MAX_ROWS;
+	maxBuflen_ = MAX_BLOB_LENGTH;
+
+	//size in bytes to each blob
+	if(maxBlobSize>0)
+		maxBuflen_ = maxBlobSize;
+
+	if(maxRowNum>0)
+		maxRows_ = maxRowNum;
+	
+	connection_ = connec;
+	stmthpToQuery_ = NULL;
+	dschp_ = NULL;
+	fieldValue_ = "";
+	ordinates_ = 0;
+	isOpen_ = false;
+	hasBlob_ = false;
+	row_Index_ = -1;
+	rows_Fetched_ = 0;
+	rows_Mem_ = 0;
+	row_Cur_ = -1;
+	last_Row_ = false;
+	errorMessage_ = "";
+	numColls_ = -1;
+	colBlobName_.clear();
+
+	if(connection_->useSDOType())
+	{
+		for(int i=0;i<maxRows_;i++)
+		{
+			global_geom_obj_[i] = NULL;
+			global_geom_ind_[i] = NULL;
+		}
+	}
+}
+
+bool TeOCICursor::open()  
+{
+	if(!connection_)
+		return false;
+
+	sword status;
+	if(isOpen_)
+		this->close();
+	isOpen_ = false;
+
+	// Initialize statement handle 
+	status = SDO_OCIHandleAlloc((dvoid*)connection_->envhp_, (dvoid**)&stmthpToQuery_, 
+								  (ub4)OCI_HTYPE_STMT, (size_t)0, (dvoid**)0);
+	if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		return false;
+	
+	// describe spatial object types (OCIDescribe)
+	status = SDO_OCIHandleAlloc((dvoid*)connection_->envhp_, (dvoid**)&dschp_, 
+								(ub4)OCI_HTYPE_DESCRIBE, (size_t)0, (dvoid **)0);
+	if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+	{
+		//free stmthpToQuery_ located previously
+		SDO_OCIHandleFree((dvoid *)stmthpToQuery_, (ub4)OCI_HTYPE_STMT);
+		return false;
+	}
+
+	if(connection_->useSDOType())
+	{
+		status = SDO_OCIObjectNew(connection_->envhp_, connection_->errhp_, connection_->svchp_, OCI_TYPECODE_VARRAY, 
+					connection_->tdo_ordinates_, (dvoid*)NULL, OCI_DURATION_SESSION, TRUE, 
+					(dvoid**)&ordinates_);
+
+		if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		{
+			//free dschp_ located previously
+			SDO_OCIHandleFree((dvoid*)dschp_, (ub4)OCI_HTYPE_DESCRIBE);
+			//free stmthpToQuery_ located previously
+			SDO_OCIHandleFree((dvoid *)stmthpToQuery_, (ub4)OCI_HTYPE_STMT);
+            return false;
+		}
+	}
+	isOpen_ = true;
+	return true;
+}
+
+
+void TeOCICursor::close()
+{
+	freeResult(); //free all located memory
+	// Finalize stmthpToQuery_ and dschp_
+	if(isOpen_)
+	{
+		SDO_OCIHandleFree((dvoid *)stmthpToQuery_, (ub4)OCI_HTYPE_STMT);
+		SDO_OCIHandleFree((dvoid*)dschp_, (ub4)OCI_HTYPE_DESCRIBE);
+		stmthpToQuery_ = NULL;
+		dschp_ = NULL;
+	}
+	isOpen_ = false;
+	numColls_ = -1;
+}
+
+void TeOCICursor::freeResult()
+{	
+	//vector of buffers to store blob
+	for(unsigned int b=0; b<lobBuffer_.size(); ++b)
+	{
+		if(lobBuffer_[b])
+		{
+			delete [] lobBuffer_[b];
+			lobBuffer_[b] = NULL;
+		}
+	}
+	lobBuffer_.clear();
+	
+	//buffer to store alphanumeric data
+	for(unsigned int i=0; i<buffers_.size();i++)
+	{
+		int coltype = colType_[i];
+		switch (coltype)
+		{
+			case 3: //INTEGER
+				delete [] ((signed int*) buffers_[i]);
+				break;
+			
+			case 2: //NUMBER
+				delete [] ((OCINumber*) buffers_[i]);
+				break;
+			
+			case 4: //FLOAT DOUBLE
+				delete [] ((double*) buffers_[i]);
+				break;
+			
+			case 96: //CHAR
+			case 9: //VARCHAR:
+			case 1: //VARCHAR2:	
+				delete [] ((char *) buffers_[i]);
+				break;
+			
+			case 12: //Date
+					delete [] ((OCIDate *) buffers_[i]);
+					break;
+			default:
+					break;
+			
+		} //switch
+	} //for
+
+	//sdo geometry
+	if(connection_->useSDOType())  
+	{
+		for(int i=0;i<maxRows_;i++) 
+		{
+			/// free the spatial object instance 
+			OCIObjectFree(connection_->envhp_, connection_->errhp_, (dvoid *)global_geom_obj_[i], 
+				   (ub2)OCI_OBJECTFREE_FORCE);
+			
+			global_geom_obj_[i] = NULL;
+			global_geom_ind_[i] = NULL;
+		}
+
+		OCIObjectFree(connection_->envhp_, connection_->errhp_, (dvoid *)ordinates_, (ub2)OCI_OBJECTFREE_FORCE);
+		ordinates_ = 0;
+	}
+
+	buffers_.clear();
+	defines_.clear(); // ver se o freestmtp desaloca os OCIDefines 
+	ind_.clear();
+	colType_.clear();
+	colSize_.clear();
+	colScale_.clear();
+	colName_.clear();
+	numColls_ = -1;
+	hasBlob_ = false;
+	colBlobName_.clear();
+}
+
+
+void TeOCICursor::defineByPos(int pos, void* value, int size, void* indicator, 
+						 int type)
+{
+	OCIDefine *defnp = NULL;
+
+	SDO_OCIDefineByPos(stmthpToQuery_, &defnp, connection_->errhp_, (ub4)pos, 
+								  (dvoid *)value, (sb4)size, type, 
+								  (dvoid *)indicator, (ub2 *)0, (ub2 *)0,
+								  (ub4)OCI_DEFAULT);
+}
+
+
+bool TeOCICursor::fetch(int rows)
+{
+	sword status;
+	status = OCIStmtFetch(stmthpToQuery_, connection_->errhp_, (ub4) rows, (ub4) OCI_FETCH_NEXT,
+                               (ub4) OCI_DEFAULT);
+
+	if (status == OCI_SUCCESS || status == OCI_SUCCESS_WITH_INFO)
+		return true;
+	else
+		return false;
+
+}
+
+bool TeOCICursor::appendOrdinates(const double& val)
+{
+	
+	OCINumber	oci_number;
+	sword       status;
+
+	if(!ordinates_)
+	{
+		status = SDO_OCIObjectNew(connection_->envhp_, connection_->errhp_, connection_->svchp_, OCI_TYPECODE_VARRAY, 
+					connection_->tdo_ordinates_, (dvoid*)NULL, OCI_DURATION_SESSION, TRUE, 
+					(dvoid**)&ordinates_);
+
+		if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+			return false;
+	}
+	
+	status = OCINumberFromReal(connection_->errhp_, (dvoid *)&(val), 
+		(uword)sizeof(double),&oci_number);
+
+	status = OCICollAppend(connection_->envhp_, connection_->errhp_, 
+		(dvoid *) &oci_number,
+		(dvoid *)0, (OCIColl *)ordinates_);
+
+	if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		return false;
+
+	return true;
+}
+
+bool TeOCICursor::bindOrdinates()
+{
+	OCIBind		*bnd1p = NULL;
+	sword		status; 
+
+	if(!ordinates_)
+	{
+		status = SDO_OCIObjectNew(connection_->envhp_, connection_->errhp_, connection_->svchp_, OCI_TYPECODE_VARRAY, 
+					connection_->tdo_ordinates_, (dvoid*)NULL, OCI_DURATION_SESSION, TRUE, 
+					(dvoid**)&ordinates_);
+
+		if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+			return false;
+	}
+	
+	/* bind coordinate varray object */
+	status = OCIBindByName(stmthpToQuery_, &bnd1p, connection_->errhp_, 
+	    (text *)":ordinates_", (sb4)-1, (dvoid *)0, (sb4)0, SQLT_NTY, (dvoid *)0, 
+		(ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT);
+	if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		return false;
+
+	status = OCIBindObject(bnd1p, connection_->errhp_, connection_->tdo_ordinates_, (dvoid **)&ordinates_, (ub4 *)0, 
+	    (dvoid **)0, (ub4 *)0);
+	if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		return false;
+
+	return true;
+}
+
+bool TeOCICursor::moveFirst()
+{		
+	sword status;
+	if(!hasBlob_)
+		// this is for scroolable cursor
+		status = OCIStmtFetch2(stmthpToQuery_, connection_->errhp_, (ub4)maxRows_, OCI_FETCH_FIRST, (sb4) 0, OCI_DEFAULT);
+	else
+		status = OCIStmtFetch2(stmthpToQuery_, connection_->errhp_, (ub4)maxRows_, OCI_FETCH_NEXT, (sb4) 0, OCI_DEFAULT);
+
+	checkError(status);
+	if (status == OCI_SUCCESS || status == OCI_SUCCESS_WITH_INFO  || status == OCI_NO_DATA)
+	{
+		OCIAttrGet((dvoid *)stmthpToQuery_, (ub4)OCI_HTYPE_STMT,
+			     (dvoid *)&rows_Fetched_, (ub4 *)0, 
+			     (ub4)OCI_ATTR_ROW_COUNT, connection_->errhp_);
+
+		if(!rows_Fetched_)  
+			return false;
+
+		if(status == OCI_NO_DATA)
+			last_Row_ = true;
+
+		row_Index_ = 0;
+
+		if(rows_Fetched_ < maxRows_)  
+			rows_Mem_ = rows_Fetched_;
+		else
+			rows_Mem_ = maxRows_;
+
+		row_Cur_ = 0;
+		return true;
+	}
+	return false;
+}
+
+bool TeOCICursor::moveNext()
+{
+	sword status;
+		
+	if((row_Index_+1) >= rows_Mem_) 
+	{
+		if(last_Row_)
+			return false;
+		
+		// this is for scroolable cursor
+		status = OCIStmtFetch2(stmthpToQuery_, connection_->errhp_, (ub4) maxRows_, OCI_FETCH_NEXT, (sb4) 0, OCI_DEFAULT);
+
+		if (status == OCI_SUCCESS || status == OCI_SUCCESS_WITH_INFO || status == OCI_NO_DATA)
+		{
+			OCIAttrGet((dvoid *)stmthpToQuery_, (ub4)OCI_HTYPE_STMT,
+					(dvoid *)&rows_Fetched_, (ub4 *)0, 
+					(ub4)OCI_ATTR_ROWS_FETCHED, connection_->errhp_);
+
+			if(!rows_Fetched_)
+				return false;
+
+			if(status == OCI_NO_DATA)
+			{
+				if(last_Row_)
+					return false;
+				else
+					last_Row_ = true;
+			}
+
+			row_Index_ = 0;
+
+			if(rows_Fetched_ < maxRows_)
+				rows_Mem_ = rows_Fetched_;
+			else
+				rows_Mem_ = maxRows_;
+
+			row_Cur_++;
+			return true;
+		}
+		else
+			return false;
+	}
+	else
+		row_Index_++;
+	
+	row_Cur_++;
+	return true;
+}
+
+bool TeOCICursor::moveLast()  
+{
+	sword status = OCIStmtFetch2(stmthpToQuery_, connection_->errhp_, (ub4) 1, 
+                               OCI_FETCH_LAST, (sb4) 0, OCI_DEFAULT);
+	//podemos pegar informacao da ultima linha
+	if (status == OCI_SUCCESS || status == OCI_SUCCESS_WITH_INFO)
+	{
+		last_Row_ = true;
+		return true;
+	}
+	else
+		return false;
+}
+
+bool TeOCICursor::moveTo(int pos) //begin in 0
+{
+	// It is not possible use scrollable cursor with blob
+	if(hasBlob_) 
+	{
+		// for non-scroolable cursor, needs to query again
+		// if pos is at the end of recordset may be slow
+		int topos;
+		if(pos > 0)
+			topos = pos-1;
+		else
+			topos = row_Cur_ + pos;
+		if(topos < 0)
+			topos = 0;
+
+		if(!moveFirst())
+			return false;
+
+		while(row_Cur_ != topos)
+		{
+			if(!moveNext())
+				return false;
+		}
+		return true;
+	}
+
+	sword status;
+	int auxPos = maxRows_*int(pos/maxRows_);
+
+	// row_Cur_ = absolute current row 
+	// row_Index_ = relative current row - client side
+	if(int(row_Cur_/maxRows_) == int(pos/maxRows_)) 
+	{
+		row_Index_ = pos - (maxRows_*int(pos/maxRows_));
+		row_Cur_ = pos;
+		return true;
+	}
+
+	if(pos<row_Cur_)
+	{
+		if(!moveFirst())
+			return false;
+	}
+
+	status = OCIStmtFetch2(stmthpToQuery_, connection_->errhp_, (ub4) maxRows_, OCI_FETCH_ABSOLUTE, (sb4)auxPos+1, OCI_DEFAULT); 
+	row_Index_ = pos-auxPos;
+	row_Cur_ = pos;
+
+	if (status == OCI_SUCCESS || status == OCI_SUCCESS_WITH_INFO || status == OCI_NO_DATA)
+	{
+		OCIAttrGet((dvoid *)stmthpToQuery_, (ub4)OCI_HTYPE_STMT,
+				 (dvoid *)&rows_Fetched_, (ub4 *)0, 
+				 (ub4)OCI_ATTR_ROWS_FETCHED, connection_->errhp_);
+
+		if(!rows_Fetched_)
+			return false;
+		
+		if(status == OCI_NO_DATA)
+			last_Row_ = true;
+		return true;
+	}
+
+	return false;
+}
+
+// Throw CCursorException if OCI error found
+bool TeOCICursor::checkError(sword status)
+{
+	sb4 errcode = 0;
+	char message[256];
+	bool returnedVal = false;
+
+	if (status == OCI_ERROR)
+	{
+		SDO_OCIErrorGet((dvoid*)connection_->errhp_, (ub4)1, (text*)NULL, &errcode, 
+						(text*)message, (ub4)256, OCI_HTYPE_ERROR);
+
+		errorMessage_ = message;
+		return false;
+	}
+	
+	switch (status)
+	{ 
+		case OCI_SUCCESS:
+			errorMessage_ = "Success!";
+			returnedVal = true;
+			break;
+
+		case OCI_SUCCESS_WITH_INFO:
+			errorMessage_ = "Success with information!";
+			returnedVal = true;
+			break;
+
+		case OCI_NEED_DATA:
+			errorMessage_ = "Need data!";
+			break;
+		
+		case OCI_NO_DATA:
+			errorMessage_ = "No data!";
+			break;
+
+		//An invalid handle was passed as a parameter or a user callback is passed an
+		//invalid handle or invalid context. No further diagnostics are available.
+		case OCI_INVALID_HANDLE:
+			errorMessage_ = "Invalid handle!";
+			break;
+
+		case OCI_STILL_EXECUTING:
+			errorMessage_ = "Still executing!";
+			break;
+
+		case OCI_CONTINUE:
+			errorMessage_ = "Continue!";
+			break;
+		default:
+			break;
+	}
+
+	return returnedVal;
+
+}
+
+
+bool TeOCICursor::prepare(const string& stmt)
+{	
+	ub4 size = stmt.size();
+	sword status = SDO_OCIStmtPrepare(connection_->svchp_, (OCIStmt *)stmthpToQuery_, connection_->errhp_, (text*)stmt.c_str(), (ub4)size,  
+		(text*)0, (ub4)0, (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);
+	if((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		return false;
+
+	return true;
+}
+
+
+int TeOCICursor::queryType()  
+{	
+	ub2 querytype_;
+		
+	sword status = OCIAttrGet((dvoid *)stmthpToQuery_, (ub4)OCI_HTYPE_STMT, (ub2 *)&querytype_,
+	(ub4*)NULL, (ub4)OCI_ATTR_STMT_TYPE, (OCIError *)connection_->errhp_);
+	if((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		return -1;
+	return (querytype_);
+}
+
+bool TeOCICursor::query(const string& query)
+{
+	if (!isOpen_)
+		open();
+			
+	row_Index_ = -1;
+	rows_Fetched_ = 0;
+	rows_Mem_ = 0;
+	row_Cur_ = -1;
+	last_Row_ = false;
+
+	if(!prepare(query))
+		return false;	
+	
+	// query type equal to 1 = OCI_STMT_SELECT
+	if(queryType()!=1) 
+		return false;
+		
+	 //iters equal to zero because the defines_ (OCIDefines) have not located yet 
+	sword status = OCIStmtExecute(connection_->svchp_, stmthpToQuery_, connection_->errhp_, (ub4)0, (ub4)0, (OCISnapshot *)NULL, 
+								  (OCISnapshot *)NULL, OCI_STMT_SCROLLABLE_READONLY);
+	checkError(status);
+	if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		return false;
+
+	loadCollDescription(); // load columns description
+	
+	if(hasBlob_)
+	{
+		vector<string> auxBlobColls;
+		string sql ="";
+		for(unsigned int blobIndex=0; blobIndex<colType_.size(); ++blobIndex)
+		{
+			if(colType_[blobIndex]==113) //blob type
+				auxBlobColls.push_back(colName_[blobIndex]);
+		}
+		
+		if(!auxBlobColls.empty())
+			sql = getSQLToLoadBlobLength(query, auxBlobColls);
+
+		freeResult();
+		colBlobName_ = auxBlobColls;
+
+		maxRows_ = 10; //get only 10 rows from server when there is blob type.
+		
+		if(!prepare(sql))
+			return false;
+		
+		// Is is not possible use the scrollable cursor with blob data type
+		status = OCIStmtExecute(connection_->svchp_, stmthpToQuery_, connection_->errhp_, (ub4)0, (ub4)0, (OCISnapshot *)NULL, 
+								  (OCISnapshot *)NULL, OCI_DEFAULT);
+		if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+			return false;
+
+		loadCollDescription(); // to get the new attribute in SQL
+	}
+
+	if(!allocateCursor())
+		return false;
+	return true; 
+}
+
+
+bool TeOCICursor::querySDO(const string& query)
+{
+	if (!isOpen_)
+		open();
+
+	row_Index_ = -1;
+	rows_Fetched_ = 0;
+	rows_Mem_ = 0;
+	row_Cur_ = -1;
+	last_Row_ = false;
+
+	if(!prepare(query))
+		return false;
+
+	if(!bindOrdinates())
+		return false;	
+
+	// query type equal to 1 = OCI_STMT_SELECT
+	if (queryType() != 1) //must be executed by TeOCIConnect->execute()
+		return false;
+		
+	//iters equal to zero because the defines_ (OCIDefines) have not located yet 
+	sword status = OCIStmtExecute(connection_->svchp_, stmthpToQuery_, connection_->errhp_, (ub4)0, (ub4)0, (OCISnapshot *)NULL, 
+								  (OCISnapshot *)NULL, OCI_STMT_SCROLLABLE_READONLY);
+	
+	if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+		return false;
+	
+	loadCollDescription(); // load columns description
+
+	if(hasBlob_)
+	{
+		vector<string> auxBlobColls;
+		string sql ="";
+		for(unsigned int blobIndex=0; blobIndex<colType_.size(); ++blobIndex)
+		{
+			if(colType_[blobIndex]==113) //blob type
+				auxBlobColls.push_back(colName_[blobIndex]);
+		}
+		
+		if(!auxBlobColls.empty())
+			sql = getSQLToLoadBlobLength(query, auxBlobColls);
+
+		freeResult();
+		colBlobName_ = auxBlobColls;
+
+		maxRows_ = 10; //get only 10 rows from server when there is blob type.
+
+		if(!prepare(sql))
+			return false;
+		
+		// Is is not possible use the scrollable cursor with blob data type
+		status = OCIStmtExecute(connection_->svchp_, stmthpToQuery_, connection_->errhp_, (ub4)0, (ub4)0, (OCISnapshot *)NULL, 
+								  (OCISnapshot *)NULL, OCI_DEFAULT);
+		if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+			return false;
+
+		loadCollDescription(); // to get the new attribute in SQL
+	}
+
+	if(!allocateCursor())
+		return false;
+
+	return true; 
+}
+
+
+int TeOCICursor::numCol()  
+{	
+	if(numColls_>=0)
+		return (numColls_-(colBlobName_.size()));
+	
+	/* Get the number of columns in the query */
+	OCIAttrGet(stmthpToQuery_, OCI_HTYPE_STMT, &numColls_,
+	0, OCI_ATTR_PARAM_COUNT, connection_->errhp_);
+	
+	return (numColls_-(colBlobName_.size()));
+}
+
+
+int TeOCICursor::numRows()
+{
+	int numrows_ = 0;
+	
+	/* Get the number of rows in the query */
+	SDO_OCIAttrGet((dvoid*)stmthpToQuery_, (ub4)OCI_HTYPE_STMT, (dvoid*)&numrows_,
+	(ub4*)0, (ub4)OCI_ATTR_ROW_COUNT, (OCIError*)connection_->errhp_);
+	return (numrows_);
+
+}
+
+
+void TeOCICursor::loadCollDescription() 
+{
+	OCIParam* colhd=NULL;
+	//int		dtype;
+	ub2	dtype = 0;
+	string	colname;
+	//int		colsize;
+	ub2  colsize = (ub2) 0;
+	//int		colscale;
+	sb1  colscale = (sb1) 0;
+	
+	numCol(); // atualize the numColls_ variable
+	hasBlob_ = false;
+
+	int i;
+	for(i=1; i<=numColls_; ++i)
+	{
+		// get parameter for i-th column
+		SDO_OCIParamGet((dvoid*)stmthpToQuery_, (ub4)OCI_HTYPE_STMT, (OCIError *)connection_->errhp_, (dvoid**)&colhd, (ub4)i);
+
+		// get data type 
+		SDO_OCIAttrGet((dvoid *)colhd, (ub4)OCI_DTYPE_PARAM, (dvoid *)&dtype, (ub4*)0, (ub4)OCI_ATTR_DATA_TYPE, (OCIError *)connection_->errhp_);
+
+		// get coll name 
+		text *colname_ = NULL;
+		ub4	colnamesz_;
+				
+		OCIAttrGet((dvoid *)colhd, (ub4)OCI_DTYPE_PARAM, (dvoid **)&colname_, (ub4*)&colnamesz_, (ub4)OCI_ATTR_NAME, (OCIError *)connection_->errhp_ );
+
+		char temp[100];
+		for(int j=0;j<(int)colnamesz_;j++)
+			temp[j] = colname_[j];
+		temp[colnamesz_] = '\0';
+		colname = temp;
+
+		// retrieve the column size attribute
+		SDO_OCIAttrGet((dvoid *)colhd, (ub4)OCI_DTYPE_PARAM, (dvoid *)&colsize, (ub4*)0, (ub4)OCI_ATTR_DATA_SIZE, (OCIError *)connection_->errhp_ );
+
+		// retrieve the column scale attribute
+		SDO_OCIAttrGet((dvoid *)colhd, (ub4)OCI_DTYPE_PARAM, (dvoid *)&colscale, (ub4*)0, (ub4)OCI_ATTR_SCALE, (OCIError *)connection_->errhp_ );
+
+		colName_.push_back(colname);
+		colType_.push_back((int)dtype);
+		colSize_.push_back((int)colsize);
+		colScale_.push_back((int)colscale);
+
+		if(dtype==113)
+			hasBlob_ = true;
+	}
+}
+
+
+int TeOCICursor::colType (int colnumber)   
+{
+	//first coll number is 1
+	if((colnumber==0) || (colnumber>(int)colType_.size()))
+		return 0;
+
+	return colType_[colnumber-1];
+}
+
+
+string TeOCICursor::colName (int colnumber) 
+{	
+	//first coll number is 1
+	if((colnumber==0) || (colnumber>(int)colName_.size()))
+		return "";
+
+	return colName_[colnumber-1];
+}
+
+
+int TeOCICursor::colSize (int colnumber) 
+{
+	//first coll number is 1
+	if((colnumber==0) || (colnumber>(int)colSize_.size()))
+		return 0;
+
+	return colSize_[colnumber-1];
+}
+
+
+int TeOCICursor::colScale (int colnumber) 
+{
+	//first coll number is 1
+	if((colnumber==0) || (colnumber>(int)colScale_.size()))
+		return 0;
+
+	return colScale_[colnumber-1];
+}
+
+
+ bool TeOCICursor::allocateCursor()
+ {
+	int			size;
+	int			coltype=0;
+	int			colsize=0;
+	int			colscale=0;
+	sword		status;
+	
+	try
+	{
+		ind_.resize(numColls_);
+
+		for(int nc=0; nc<numColls_; ++nc)
+		{
+			defines_.push_back (0);
+			buffers_.push_back (0);
+		}
+
+		for(int i=1; i<=numColls_;i++)
+		{
+			coltype = colType_[i-1];
+			colsize = colSize_[i-1];
+			colscale = colScale_[i-1];
+
+			switch (coltype)
+			{
+				case 3: //INTEGER
+					buffers_[i-1] = new signed int[maxRows_];
+					colsize = sizeof(signed int);
+
+					status = OCIDefineByPos(stmthpToQuery_, &(defines_[i-1]), connection_->errhp_, (ub4)i, 
+							(dvoid *)(signed int*)buffers_[i-1], (sb4)colsize, coltype, 
+							(dvoid *)&ind_[i-1], (ub2 *)0, (ub2 *)0,(ub4)OCI_DEFAULT);
+					if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+						return false;
+
+					break;
+
+			
+				case 2: //NUMBER
+										
+					buffers_[i-1] = (OCINumber *) new OCINumber[maxRows_]; //();								
+					status = OCIDefineByPos(stmthpToQuery_, &(defines_[i-1]), connection_->errhp_, (ub4)i, 
+							(dvoid *)buffers_[i-1], sizeof(OCINumber), SQLT_VNU, 
+							(dvoid *)&ind_[i-1], (ub2 *)0, (ub2 *)0,(ub4)OCI_DEFAULT);
+					if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+						return false;
+			
+					break;
+							
+
+				case 4: //FLOAT DOUBLE
+					
+					buffers_[i-1] = new double[maxRows_];
+					colsize = sizeof(double);
+					coltype = 4;
+				
+					status = SDO_OCIDefineByPos(stmthpToQuery_, &(defines_[i-1]), connection_->errhp_, (ub4)i, 
+							(dvoid *)(double*)buffers_[i-1], (sb4)colsize, coltype, 
+							(dvoid *)&ind_[i-1], (ub2 *)0, (ub2 *)0, (ub4)OCI_DEFAULT);
+					if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+						return false;
+				
+				
+					break;
+
+				case 96: //CHAR
+				case 9: //VARCHAR:
+				case 1: //VARCHAR2:
+					buffers_[i-1] = (char *) new char[maxRows_*(colsize+1)];
+			
+					status = SDO_OCIDefineByPos(stmthpToQuery_, &(defines_[i-1]), connection_->errhp_, (ub4)i, 
+							(dvoid *)buffers_[i-1], (sb4)(colsize+1), SQLT_STR, 
+							(dvoid *)&ind_[i-1], (ub2 *)0, (ub2 *)0,(ub4)OCI_DEFAULT);
+						if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+							return false;
+				
+					break;
+
+				case 12: //Date
+					buffers_[i-1] = (OCIDate *) new OCIDate[maxRows_]; //();								
+					status = OCIDefineByPos(stmthpToQuery_, &(defines_[i-1]), connection_->errhp_, (ub4)i, 
+							(dvoid *)buffers_[i-1], sizeof(OCIDate), SQLT_ODT, 
+							(dvoid *)&ind_[i-1], (ub2 *)0, (ub2 *)0,(ub4)OCI_DEFAULT);
+					if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+							return false;
+				
+					break;
+
+
+				case 108: //OBJECT SDO_GEOMETRY
+				
+					status = SDO_OCIObjectNew(connection_->envhp_, connection_->errhp_, connection_->svchp_,
+							OCI_TYPECODE_OBJECT, connection_->tdo_geometry_, (dvoid*)NULL, 
+							OCI_DURATION_SESSION, TRUE, 
+							(dvoid**)global_geom_obj_);
+					if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+							return false;
+					
+					defines_[i-1] = NULL;
+								
+					status = SDO_OCIDefineByPos(stmthpToQuery_, &(defines_[i-1]), connection_->errhp_, (ub4)i, 
+							(dvoid *)0, (sb4)0, SQLT_NTY, (dvoid *)&ind_[i-1],
+							(ub2 *)0, (ub2 *)0, (ub4)OCI_DEFAULT);
+					if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+							return false;
+					
+					status = OCIDefineObject(defines_[i-1], connection_->errhp_, connection_->tdo_geometry_, 
+							(dvoid **)global_geom_obj_, (ub4 *)0, 
+							(dvoid **)global_geom_ind_, (ub4 *)0);
+					if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+							return false;
+
+					break;
+
+				case 113 :	//SQLT_BLOB
+					
+					hasBlob_ = true;
+					lobBuffer_.push_back(NULL);
+					lobBuffer_[lobBuffer_.size()-1] = new unsigned char[maxBuflen_*maxRows_]; 
+					size = sizeof(unsigned char)*maxBuflen_;
+										
+					status = OCIDefineByPos (stmthpToQuery_, &(defines_[i-1]), connection_->errhp_, (ub4)i, 
+						(dvoid *)lobBuffer_[lobBuffer_.size()-1], size, SQLT_LBI, (void *)&ind_[i-1], (ub2 *)0, (ub2 *)0, 
+						(ub4)OCI_DEFAULT); 
+					if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+							return false;
+					
+					status = OCIDefineArrayOfStruct(defines_[i-1], connection_->errhp_, size, 0, 0, 0);
+					if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+						return false;
+					break;
+				default:
+					break;
+			
+			} //switch
+	
+		} //for
+	}//try
+
+	catch(...) 
+	{
+		return false;
+	}
+
+	return true;
+}	
+
+char* TeOCICursor::getFieldValue(int i)  //inicia em 1
+{ 
+	
+	int				tempInt;
+	double			tempDouble;
+	char			str[30];
+	unsigned int	size; 
+	string			tempDate;
+	sword			status;
+		
+	if(i < 1)
+		return (char*)0;
+
+	int coltype = colType_[i-1]; 
+	int colsize = colSize_[i-1]; 
+	
+	//OBS:	When the SQL use grouping functions (MAX, MIN, etc), the returned value always has
+	//		colscale equal to zero, even when it is double
+	int indica = ind_[i-1].sbind[row_Index_];
+
+	std::string format = "DD/MM/YYYY HH24:MI:SS";
+	size = format.size();
+
+	switch (coltype)
+	{
+		case 3: //INTEGER
+			if(indica == -1)
+				return "";
+
+			tempInt = *((int*)buffers_[i-1]+row_Index_);
+			fieldValue_ = Te2String(tempInt);
+			return ((char*)fieldValue_.c_str());
+			break;
+
+		case 2: //NUMBER
+			
+			if(indica == -1)
+				return "";
+			status = OCINumberToReal(connection_->errhp_, ((OCINumber *)buffers_[i-1]+row_Index_), 
+				(uword)sizeof(double), (dvoid *)&tempDouble);
+			if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+				return "";
+			
+			fieldValue_ = Te2String(tempDouble, 10);
+			return ((char*)fieldValue_.c_str());
+			break;
+			
+
+		case 4: //FLOAT DOUBLE
+				
+			if(indica == -1)
+				return "";
+			
+			tempDouble = *((const double*)buffers_[i-1]+row_Index_);
+			fieldValue_ = Te2String(tempDouble, 10);
+			return ((char*)fieldValue_.c_str());
+			break;
+
+		case 96: //CHAR
+		case 9: //VARCHAR:
+		case 1: //VARCHAR2:
+			
+			if(indica == -1)
+				return "";
+
+			fieldValue_ = ((char*)buffers_[i-1]+((colsize+1)*row_Index_));
+			fieldValue_ = StrClean((char*)fieldValue_.c_str());
+			return ((char*)fieldValue_.c_str());
+			break;
+
+		case 12: //Date
+			
+			if(indica == -1)
+				return "";
+
+			fieldValue_ = "";
+			//size = sizeof(OCIDate);
+													
+			status =  OCIDateToText(connection_->errhp_, ((OCIDate *)buffers_[i-1]+row_Index_), 
+				(unsigned char*)format.c_str(), format.size(), NULL, 0, &size, (unsigned char*)tempDate.c_str());
+			if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+				return "";
+			memcpy(str, tempDate.c_str(), size);
+			strncat((char*)fieldValue_.c_str(), str, size);
+
+			return ((char*)fieldValue_.c_str());
+			break;
+
+		case 108: //OBJECT SDO_GEOMETRY
+		default:
+			break;
+							
+	} //switch
+		
+	return (char*)"";
+}
+
+int TeOCICursor::getDimArraySize()
+{
+	int ndim=-1;
+
+	// Get the size of the elem info array
+    OCICollSize(connection_->envhp_, connection_->errhp_, 
+				(OCIColl *)(global_geom_obj_[row_Index_]->sdo_elem_info), &ndim);
+
+	return(ndim);
+}
+
+bool TeOCICursor::getDimElement(int i,int &elem)
+{
+	int				exists;
+	OCINumber		*oci_number;
+	double			el;
+
+
+	OCICollGetElem(connection_->envhp_, connection_->errhp_, 
+	   (OCIColl *)(global_geom_obj_[row_Index_]->sdo_elem_info), 
+	   (sb4)i-1, (boolean *)&exists, 
+	   (dvoid **)&oci_number, (dvoid **)0);
+
+	OCINumberToReal(connection_->errhp_, oci_number, (uword)sizeof(double),
+		(dvoid *)&el);
+	
+	elem = (int)el;
+	return true;
+}
+
+
+int TeOCICursor::getNumberOrdinates()
+{
+	int nOrds=-1;
+
+	/* Get the size of the ordinates_ array */
+    OCICollSize(connection_->envhp_, connection_->errhp_, 
+				(OCIColl *)(global_geom_obj_[row_Index_]->sdo_ordinates), &nOrds);
+
+	return(nOrds);
+}
+
+bool TeOCICursor::getCoordinates(int i, TeCoord2D& coord)
+{
+	int				exists;
+	OCINumber		*oci_number;
+	double			coor_x;
+	double			coor_y;
+
+	int pos = i;
+
+	OCICollGetElem(connection_->envhp_, connection_->errhp_, 
+	   (OCIColl *)(global_geom_obj_[row_Index_]->sdo_ordinates), 
+	   (sb4)(pos-1), (boolean *)&exists, 
+	   (dvoid **)&oci_number, (dvoid **)0);
+
+	OCINumberToReal(connection_->errhp_, oci_number, (uword)sizeof(double),
+		(dvoid *)&coor_x);
+	
+	pos++;
+
+	OCICollGetElem(connection_->envhp_, connection_->errhp_, 
+	   (OCIColl *)(global_geom_obj_[row_Index_]->sdo_ordinates),  
+	   (sb4)(pos-1), (boolean *)&exists, 
+	   (dvoid **)&oci_number, (dvoid **)0);
+
+	OCINumberToReal(connection_->errhp_, oci_number, (uword)sizeof(double),
+		(dvoid *)&coor_y);
+
+	coord.x(coor_x);
+	coord.y(coor_y);
+
+	return true;
+}
+
+
+bool TeOCICursor::getCoordinates(vector<TeCoord2D>& result)
+{
+	
+	OCIIter		*iterator;
+	dvoid		*elem;
+	OCIInd		*elemind ;
+	double		ordinate1, ordinate2; 
+	OCINumber	*aux1;
+	OCINumber	*aux2;
+	//boolean		eoc;
+	int			eoc;
+
+	sword status = OCIIterCreate(connection_->envhp_, connection_->errhp_, 
+		(OCIArray *)(global_geom_obj_[row_Index_]->sdo_ordinates), &iterator);
+	if (status != OCI_SUCCESS)
+		return false;
+	
+	/* Get the first and second element of the clients varray */
+	status = OCIIterNext(connection_->envhp_, connection_->errhp_, iterator, &elem,
+		(dvoid **) &elemind, (boolean *)&eoc);
+	if (eoc || status != OCI_SUCCESS)
+	{
+		OCIIterDelete(connection_->envhp_, connection_->errhp_, &iterator);
+		return false;
+	}
+
+	aux1 = (OCINumber *)elem;
+	OCINumberToReal(connection_->errhp_, (OCINumber *)aux1, (uword)sizeof(double),
+					(dvoid *)&ordinate1);
+
+	status = OCIIterNext(connection_->envhp_, connection_->errhp_, iterator, &elem,
+				(dvoid **)&elemind, (boolean *)&eoc);
+	if (eoc || status != OCI_SUCCESS)
+	{
+		OCIIterDelete(connection_->envhp_, connection_->errhp_, &iterator);
+		return false;
+	}
+
+	aux2 = (OCINumber *)elem;
+	OCINumberToReal(connection_->errhp_, (OCINumber *) aux2, (uword)sizeof(double),
+					(dvoid *)&ordinate2);
+
+	TeCoord2D coord(ordinate1, ordinate2);
+	result.push_back (coord);
+	
+	while (!eoc && status == OCI_SUCCESS)
+	{
+		status = OCIIterNext(connection_->envhp_, connection_->errhp_, iterator, &elem,
+				(dvoid **)&elemind, (boolean *)&eoc);
+		if (status != OCI_SUCCESS)
+		{
+			OCIIterDelete(connection_->envhp_, connection_->errhp_, &iterator);
+			return false;
+		}
+
+		aux1 = (OCINumber *)elem;
+		OCINumberToReal(connection_->errhp_, (OCINumber *)aux1, (uword)sizeof(double),
+					(dvoid *)&ordinate1);
+
+		status = OCIIterNext(connection_->envhp_, connection_->errhp_, iterator, &elem,
+				(dvoid **)&elemind, (boolean *)&eoc);
+		if (status != OCI_SUCCESS)
+		{
+			OCIIterDelete(connection_->envhp_, connection_->errhp_, &iterator);
+			return false;
+		}
+
+		aux2 = (OCINumber *)elem;
+		OCINumberToReal(connection_->errhp_, (OCINumber *) aux2, (uword)sizeof(double),
+					(dvoid *)&ordinate2);
+
+		TeCoord2D coord(ordinate1, ordinate2);
+		result.push_back (coord);
+	}
+
+	/* destroy the iterator */
+	status = OCIIterDelete(connection_->envhp_, connection_->errhp_, &iterator);
+	return true;
+}
+
+
+int
+TeOCICursor::getGeometryType()
+{
+	int gtype=-1;
+
+	OCINumberToInt(connection_->errhp_, &(global_geom_obj_[row_Index_]->sdo_gtype),
+				 (uword)sizeof(int), OCI_NUMBER_SIGNED,
+				 (dvoid *)&gtype);
+
+	return gtype;
+}
+
+int
+TeOCICursor::getSpatialReferenceId()
+{
+	int srid=-1;
+
+	OCINumberToInt(connection_->errhp_, &(global_geom_obj_[row_Index_]->sdo_srid),
+				 (uword)sizeof(int), OCI_NUMBER_SIGNED,
+				 (dvoid *)&srid);
+
+	return srid;
+}
+
+bool
+TeOCICursor::getXYZcoord(double& x, double& y)
+{
+	if (global_geom_ind_[row_Index_]->sdo_point._atomic == OCI_IND_NOTNULL)
+	{
+		if (global_geom_ind_[row_Index_]->sdo_point.x == OCI_IND_NOTNULL)
+		{
+			sword status = OCINumberToReal(connection_->errhp_, &(global_geom_obj_[row_Index_]->sdo_point.x), 
+										 (uword)sizeof(double),(dvoid *)&x);
+
+			if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+				return false;
+		}
+
+		if (global_geom_ind_[row_Index_]->sdo_point.y == OCI_IND_NOTNULL)
+		{
+			sword status = OCINumberToReal(connection_->errhp_, &(global_geom_obj_[row_Index_]->sdo_point.y), 
+										 (uword)sizeof(double),(dvoid *)&y);
+			if ((status != OCI_SUCCESS) && (status!=OCI_SUCCESS_WITH_INFO))
+				return false;
+		}
+		return true;
+	}
+	else
+		return false;
+}
+
+bool
+TeOCICursor::readBlob(unsigned char* buffer, unsigned int& bufsize, unsigned int& blobCol)
+{
+	string blobColS = colName_[blobCol];
+	return(readBlob(buffer, bufsize, blobColS));
+}
+
+bool
+TeOCICursor::readBlob(unsigned char* buffer, unsigned int& bufsize, const string& blobCol)
+{
+	int blobIndex = -1;
+	if(colBlobName_.size()==1)
+		blobIndex=0;
+	else
+	{
+		for(unsigned int j=0; j<colBlobName_.size(); j++)
+		{
+			if(TeStringCompare(blobCol, colBlobName_[j]))
+			{
+				blobIndex = j;
+				break;
+			}
+		}
+	}
+
+	if(blobIndex<0)
+		return false;
+
+	int index = numColls_-(colBlobName_.size()-(blobIndex+1)); 
+	
+	//bufsize em bytes
+	bufsize = atoi(getFieldValue(index))*sizeof(unsigned char);
+	//buffer = new unsigned char[bufsize];
+	memcpy(buffer,&(lobBuffer_[blobIndex][row_Index_*maxBuflen_]),bufsize);
+	return true;
+}
+
+
+bool
+TeOCICursor::readBlob(double *buffer, unsigned int& bufsize)
+{
+	//bufsize em double
+	//size em bytes
+	int size = bufsize*sizeof(double);
+	memcpy(buffer,&(lobBuffer_[0][row_Index_*maxBuflen_]),size);
+	return true;
+}
+
+bool
+TeOCICursor::readBlob(double **buffer)
+{
+	*buffer = (double*)&(lobBuffer_[0][row_Index_*maxBuflen_]);
+	return true;
+}
+
+unsigned int 
+TeOCICursor::getBlobSize(const string& blobCol)
+{
+	int blobIndex = -1;
+	if(colBlobName_.empty())
+		return 0;
+	if(colBlobName_.size()==1)
+		blobIndex=0;
+	else
+	{
+		for(unsigned int j=0; j<colBlobName_.size(); j++)
+		{
+			if(TeStringCompare(blobCol, colBlobName_[j]))
+			{
+				blobIndex = j;
+				break;
+			}
+		}
+	}
+
+	if(blobIndex<0)
+		return 0;
+
+	int index = numColls_-(colBlobName_.size()-(blobIndex+1)); 
+	return (atoi(getFieldValue(index))*sizeof(unsigned char));
+}
+
diff --git a/src/terralib/drivers/Oracle/TeOCICursor.h b/src/terralib/drivers/Oracle/TeOCICursor.h
new file mode 100644
index 0000000..20d798d
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOCICursor.h
@@ -0,0 +1,300 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeOCICursor.h
+	\brief This file contains the class OCICursor that represents a concept of record set to ORACLE DBMS using OCI (Oracle Call Interface) library. 
+*/
+
+#ifndef OCICursor_H
+#define OCICursor_H
+
+#include <TeOCIConnect.h>
+#include <vector>
+#include <TeCoord2D.h>
+
+#include "TeOracleDefines.h"
+
+using namespace std;
+
+#define TYPE_OWNER				"MDSYS"
+#define SDO_ORDINATE_ARRAY      TYPE_OWNER".SDO_ORDINATE_ARRAY"
+#define SDO_ELEM_INFO_ARRAY     TYPE_OWNER".SDO_ELEM_INFO_ARRAY"
+#define SDO_GEOMETRY			TYPE_OWNER".SDO_GEOMETRY"
+
+//! Number of rows to be fetched into memory from database server
+#define MAX_ROWS				500
+
+//! Max size to be allocated in the client side to store blob data (in bytes)
+#define MAX_BLOB_LENGTH			5000000 //5 MegaBytes (the max blob length is 4 Gigabytes)
+
+//! Structure to represent a point as the SDO_POINT type of the Oracle Spatial 
+struct TLORACLE_DLL sdo_point_type
+{
+   OCINumber x;
+   OCINumber y;
+   OCINumber z;
+};
+
+typedef struct sdo_point_type sdo_point_type;
+
+//! Structure to represent a geometry as the SDO_GEOMETRY type of the Oracle Spatial 
+struct TLORACLE_DLL sdo_geometry
+{
+   OCINumber       sdo_gtype;
+   OCINumber       sdo_srid;
+   sdo_point_type  sdo_point;
+   OCIArray        *sdo_elem_info;
+   OCIArray        *sdo_ordinates;
+};
+
+typedef struct sdo_geometry SDO_GEOMETRY_TYPE;
+
+//! Structure to represent a point indicator as the SDO_POINT type of the Oracle Spatial 
+struct TLORACLE_DLL sdo_point_type_ind
+{
+   OCIInd _atomic;
+   OCIInd x;
+   OCIInd y;
+   OCIInd z;
+};
+
+typedef struct sdo_point_type_ind sdo_point_type_ind;
+
+//! Structure to represent a geometry indicator as the SDO_GEOMETRY type of the Oracle Spatial 
+struct TLORACLE_DLL SDO_GEOMETRY_ind
+{
+   OCIInd                    _atomic;
+   OCIInd                    sdo_gtype;
+   OCIInd                    sdo_srid;
+   struct sdo_point_type_ind sdo_point;
+   OCIInd                    sdo_elem_info;
+   OCIInd                    sdo_ordinates;
+};
+
+typedef struct SDO_GEOMETRY_ind SDO_GEOMETRY_ind;
+
+//! Structure to handle OCI data types
+struct TLORACLE_DLL sb2ind
+{
+	sb2		sbind[MAX_ROWS];
+};
+typedef struct sb2ind	indarray;
+
+/*! \class TeOCICursor
+	\brief A class that implements a concept of record set to a ORACLE DBMS.
+
+	This class contains attributes and methods to handle a record set 
+	to ORACLE DBMS using OCI (Oracle Call Interface) library.
+
+	A record set is generated by a query on the data in the database server.
+	The class OCICursor is used by the drivers TeOCIOracle and TeOCIOracleSpatial that
+	are responsible for the link between ORACLE DBMS and TerraLib.
+	\sa 
+	TeOCIConnect
+*/
+class TLORACLE_DLL TeOCICursor
+{
+protected:
+	TeOCIConnection*	connection_;		//!< A pointer to a opened connection
+	OCIStmt*			stmthpToQuery_;		//!< OCI statement handle to query
+	OCIDescribe*		dschp_;				//!< OCI environment describe handle - describes objects
+	bool				isOpen_;			//!< indicates if the cursor is opened or not (if the stmthpToQuery was located)
+	string				errorMessage_;		//!< error message returned by the ORACLE DBMS  
+				
+	/** @name Buffers to store data in memory - client side
+	*/
+	//@{ 	
+	vector<void *>			buffers_;	//!< buffer to store simple data type (varchar, number, date, etc)
+	vector <indarray>		ind_;		//!< buffer to store null indicator
+				
+	SDO_GEOMETRY_TYPE*		global_geom_obj_[MAX_ROWS];	//!< buffer to store spatial object  
+	SDO_GEOMETRY_ind*		global_geom_ind_[MAX_ROWS];	//!< buffer to store spatial object indicator  
+
+	vector<unsigned char*>	lobBuffer_;			//! vector of buffers to store blob
+	bool					hasBlob_;			//! Flag that indicates if the cursor has blob data type
+	unsigned long			maxBuflen_;			//! Max memory the will be allocated to store blob data
+    int						maxRows_;			//! Number of rows to be fetched into memory from database server
+
+	vector<OCIDefine *>		defines_;		//!< OCIDefine objects to link buffers in client side and the statement handle
+	OCIArray*				ordinates_;		//!< store the ordinates to be used in a query (bind)
+	//@}
+
+	string					fieldValue_;	//!< temporary variable 
+
+	/** @name Information to handle the records or rows stored in memory (buffers) 
+	*/
+	//@{ 	
+	short				row_Index_;		//!< relative current row index in the memory buffer
+	int					row_Cur_;		//!< absolute current row index in the memory buffer
+	int					rows_Fetched_;	//!< number of rows fetched from database
+	int					rows_Mem_;		//!< number of rows on memory buffer - client side
+	bool				last_Row_;		//!< if the current row is the last
+	//@}
+	
+	/** @name Information about columns of the record set in memory
+	*/
+	//@{ 	
+	int					numColls_;  //!< number of columns
+	vector<string>		colName_;	//!< name of the columns
+	vector<int>			colType_;	//!< type of the columns
+	vector<int>			colSize_;	//!< size of the columns
+	vector<int>			colScale_;  //!< scale of the columns
+	vector<string>		colBlobName_; //!< name of the BLOB columns only
+	//@}
+
+public:
+	
+	//! Constructor 
+	TeOCICursor(TeOCIConnection* conn, const unsigned long& maxBlobSize=0, const unsigned long& maxRowNum=0 );
+
+	//! Destructor
+	~TeOCICursor() { close(); }
+
+	//! Opens the cursor locating memory and initializing the enviroment 
+	bool open();
+		
+	//! Returns the error message 
+	string	getErrorMessage() { return errorMessage_;}
+
+	//! Checks if the cursor is opened
+	bool isOpen()	{ return isOpen_; }
+
+	//! Returns the connection to the database server  
+	TeOCIConnection*	conn()		{ return connection_; }
+
+	//! Returns the current row index 
+	int	currentRow() { return row_Cur_; }
+
+	//! Closes the cursor
+	void close();
+	
+	//! Defines the OCI handles by position
+	void defineByPos(int pos, void* value, int size, void* indicator, int type);
+
+	//! Executes the SQL statement set previously 
+	bool		execute();
+
+	//! Fetchs a number of rows 
+	bool		fetch(int rows);
+
+	//! Executes a query defined by a SQL statement that returns a record set as result
+	bool		query(const string& query);
+
+	//! Executes a query defined by a SQL statement that uses SDO_GEOMETRY type and returns a record set as result
+	bool		querySDO(const string& query);
+
+	//! Moves to the first row in the record set 
+	bool		moveFirst();
+
+	//! Moves to the next row in the record set
+	bool		moveNext();
+
+	//! Moves to a specific position in the record set
+	bool		moveTo(int pos);
+
+	//! Moves to the last row in the record set
+	bool		moveLast();
+	
+	/** @name Methods to return information about the columns and rows in the record set
+	*/
+	//@{ 
+	//! Returns the column type (SQLT) of a specific column
+	int			colType (int colnumber);
+	//! Returns the column name of a specific column
+	string		colName (int colnumber);
+	//! Returns the column size of a specific column
+	int			colSize (int colnumber);
+	//! Returns the column scale (number of digits after decimal point) of a specific column
+	int			colScale (int colnumber);
+	//! Returns the columns number in the client side
+	int			numCol(void);
+	//! Loads all column descriptions (name, type, size and scale)
+	void		loadCollDescription (); 
+	//! Returns the rows number in the client side
+	int			numRows(void);
+	//@}
+
+	//! Appends the new value to the internal ordinate vector
+	bool		appendOrdinates(const double& val);
+	
+	//! Binds the internal ordinate array with the SQL statement
+	bool		bindOrdinates();
+	
+	//! Sets and prepares the SQL statement to be executed
+	bool		prepare(const string& stmt);
+	
+	//! Returns the query type based on the SQL statement set previously
+	int			queryType(); 
+
+	//! Locates memory to store the record set in the client side
+	bool		allocateCursor(void);
+
+	//! Gets the i-th field value from record set
+	char*		getFieldValue(int i);
+
+	/** @name Methods to deal with SDO_GEOMETRY, SDO_ELEM_INFO and SDO_ORDINATES types of the Oracle Spatial
+	*/
+	//@{ 	
+	//! Gets the size of the SDO_ELEM_INFO array of the record set current row  
+	int			getDimArraySize();
+	//! Gets the i-th element of the SDO_ELEM_INFO array of the record set current row 
+	bool		getDimElement(int i,int &elem);
+	//! Gets the number of ordinates in the SDO_ORDINATES array of the record set current row 
+	int			getNumberOrdinates(void);
+	//! Gets the i-th coordinate of the SDO_ORDINATES array of the record set current row 
+	bool		getCoordinates(int i,TeCoord2D& coord);
+	//! Gets all coordinates of the SDO_ORDINATES array of the record set current row 
+	bool		getCoordinates(vector<TeCoord2D>& result);
+	//! Gets the geometry type of the SDO_GEOMETRY type of the record set current row 
+	int			getGeometryType();
+	//! Gets the spatial reference of the SDO_GEOMETRY type of the record set current row 
+	int			getSpatialReferenceId();
+	//! Gets a coordinate (x and y) of the SDO_POINT type of the record set current row 
+	bool		getXYZcoord (double& x, double& y);
+	//@}
+
+	//! Clears the memory and structures located by the record set
+	void		freeResult(void);
+
+	/** @name Methods to deal with long binary (blob) type
+	*/
+	//@{ 	
+	//! Reads a long binary (blob) column (blobCol) from database server and returns it as a unsigned char vector
+	bool		readBlob(unsigned char* buffer, unsigned int& bufsize, unsigned int& blobCol);
+	//! Reads a long binary (blob) column (blobCol) from database server and returns it as a unsigned char vector
+	bool		readBlob(unsigned char* buffer, unsigned int& bufsize, const string& blobCol);
+	//! Reads a long binary (blob) from database server and returns it as a double vector
+	bool		readBlob(double *buffer, unsigned int& bufsize);
+	//! Gets a pointer to buffer of blob
+	bool		readBlob(double **buffer);
+	//! Returns the size (in unsigend int) of a specific blob column
+	unsigned int	getBlobSize(const string& blobCol);
+	//@}
+
+protected:
+	//! Checks the error associated to error OCI handle
+	bool		checkError(sword status);
+};
+
+#endif 
+
+
diff --git a/src/terralib/drivers/Oracle/TeOCIOracle.cpp b/src/terralib/drivers/Oracle/TeOCIOracle.cpp
new file mode 100644
index 0000000..8903676
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOCIOracle.cpp
@@ -0,0 +1,3589 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeOCIOracle.h"
+#include "TeProject.h"
+
+#include <sys/stat.h>
+
+bool	
+TeOCIOracle::createSequence(const string &tableName)
+{
+	string nameSeq = getNameSequence(tableName);
+	
+	string seq = " CREATE SEQUENCE " + nameSeq;
+	seq += " START WITH 1 INCREMENT BY 1 ORDER ";
+	if (!execute(seq))
+	{	
+		errorMessage_ = "Error creating sequence to table " + tableName + " !";
+		return false;
+	}
+
+	return true;
+}
+
+bool
+TeOCIOracle::createAutoIncrementTrigger(const string &tableName, const string &fieldName)
+{
+	string nameTri = getNameTrigger(tableName);
+	string nameSeq = getNameSequence(tableName);
+
+	string tri;
+	tri = "CREATE TRIGGER " + nameTri; 
+	tri += " BEFORE INSERT ON "+tableName; 
+	tri += " for each row";
+	tri += " begin";
+	tri += " select "+nameSeq+".NEXTVAL";
+	tri += " into :new."+fieldName;
+	tri += " from dual;";
+	tri += " end;";
+
+	if(!execute(tri))
+	{	
+		errorMessage_ = "Error creating trigger to table " + tableName + " !";
+		return false;
+	}
+	return true;
+}
+
+string
+TeOCIOracle::getNameSequence(const string &tableName)
+{
+	string name;
+	if(tableName.size()>21)
+		name = tableName.substr(0,20) + "_seq";
+	else
+		name = tableName + "_seq";
+
+	return name;
+}
+
+string
+TeOCIOracle::getNameTrigger(const string &tableName)
+{
+	string name;
+	if(tableName.size()>21)
+		name = tableName.substr(0,20) + "_tri";
+	else
+		name = tableName + "_tri";
+
+	return name;
+}
+
+string  
+TeOCIOracle::escapeSequence (const string& from)
+{
+	int  fa = 0;
+    string to = from;
+    to.insert(0, " ");
+    string::iterator it = to.begin();
+    while(it != to.end())
+    {
+            int f = to.find("'", fa);
+            if(f > fa)
+            {
+                    to.insert(f, "'");
+                    fa = f + 2;
+            }
+            else
+                    break;
+    }
+    to = to.substr(1, to.size() - 1);
+    return to;
+}
+
+TeOCIOracle::TeOCIOracle() 
+{
+	connection_ = new TeOCIConnection();  
+	dbmsName_ = "OracleOCI";
+	sequenceCont_ = -1;
+	sequenceName_ = "";
+}
+
+TeOCIOracle::~TeOCIOracle() 
+{
+	if (connection_)
+		delete (connection_); //disconnect
+	connection_ = NULL;
+}
+
+bool TeOCIOracle::beginTransaction()
+{
+	if(!connection_)
+		return false;
+	return (connection_->transStart());
+}
+
+bool TeOCIOracle::commitTransaction()
+{
+	if(!connection_)
+		return false;
+	return (connection_->transCommit());
+}
+
+bool TeOCIOracle::rollbackTransaction()
+{
+	if(!connection_)
+		return false;
+	return (connection_->transRollback());
+}
+
+bool 
+TeOCIOracle::newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port, bool terralibModel, const std::string& characterSet) 
+{ 
+	if (!connect(host,user,password,database,port))
+       return false;
+    if (terralibModel)
+    {
+        //create conceptual model
+        if(!this->createConceptualModel())  
+			return false;
+    }
+    return true;
+}
+
+bool
+TeOCIOracle::connect(const string& host, const string& user, const string& password, const string& database, int port)
+{
+	if(connection_ == NULL || connection_->isConnected())
+	{ 
+		delete (connection_);
+		connection_ = new TeOCIConnection();
+	}
+
+	isConnected_ = false;
+	if (connection_->connect(host.c_str(),user.c_str(),password.c_str()))
+	{
+		isConnected_ = true;
+		host_ = host;
+		user_ = user;
+		password_ = password;
+		database_ = database;
+		portNumber_ = port;
+		return true;
+	}
+	else
+	{
+		isConnected_ = false;
+		errorMessage_ = "Error connecting to database server!";
+		delete (connection_); //disconect
+		connection_ = NULL;
+		return false;
+	}
+}
+
+void
+TeOCIOracle::close() 
+{
+	clear();
+	connection_->disconnect();
+	isConnected_ = false;
+}
+
+bool 
+TeOCIOracle::listTables(vector<string>& tableList)
+{
+	tableList.clear();
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string exist = " SELECT table_name FROM all_tables WHERE ";
+	exist += " OWNER = '" + TeConvertToUpperCase(user_) + "'";
+
+	if(!ocip->query(exist))
+	{
+		delete ocip;
+		return false;
+	}
+
+	while(ocip->fetchRow())
+		tableList.push_back (ocip->getData(0));
+			
+	delete ocip;
+	return true;
+}
+
+
+bool 
+TeOCIOracle::tableExist(const string& table)
+{
+	bool	status;
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string exist = " SELECT table_name FROM all_tables WHERE";
+	exist += " TABLE_NAME = '" + TeConvertToUpperCase(table) + "'";
+	exist += " AND OWNER = '" + TeConvertToUpperCase(user_) + "'";
+
+	if(!ocip->query(exist))
+	{
+		delete ocip;
+		return false;
+	}
+
+	if(ocip->fetchRow())
+		status = true;
+	else
+		status = false;
+
+	delete ocip;
+	return (status);
+}
+
+bool 
+TeOCIOracle::viewExist(const string& view)
+{
+	bool	status;
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string exist = " SELECT view_name FROM user_views WHERE";
+	exist += " VIEW_NAME = '" + TeConvertToUpperCase(view) + "'";
+
+	if(!ocip->query(exist))
+	{
+		delete ocip;
+		return false;
+	}
+
+	if(ocip->fetchRow())
+		status = true;
+	else
+		status = false;
+
+	delete ocip;
+	return (status);
+}
+
+bool 
+TeOCIOracle::columnExist(const string& table, const string& column, TeAttribute& attr)
+{
+	bool	status = false;
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string exist = " SELECT DATA_TYPE, DATA_LENGTH, DATA_SCALE FROM ALL_TAB_COLUMNS WHERE";
+	exist += " TABLE_NAME = '" + TeConvertToUpperCase(table) + "'";
+	exist += " AND COLUMN_NAME = '" + TeConvertToUpperCase(column) + "'";
+	exist += " AND OWNER = '" + TeConvertToUpperCase(user_) + "'";
+
+	if(!ocip->query(exist))
+	{
+		delete ocip;
+		return false;
+	}
+	
+	if(ocip->fetchRow())
+	{	
+		attr.rep_.name_ = column;
+		
+		string	dataType = string(ocip->getData(0)); 
+		int		dataLength = atoi(ocip->getData(1)); 
+		int		dataScale = atoi(ocip->getData(2));
+		bool    number = false;
+		
+		if(dataType=="VARCHAR2")
+		{
+			attr.rep_.type_ = TeSTRING;
+			attr.rep_.numChar_ = dataLength;
+		}
+		else if (dataType=="BLOB")
+		{
+			attr.rep_.type_ = TeBLOB;
+			attr.rep_.numChar_ = dataLength;
+		}
+		else if (dataType=="NUMBER")
+		{
+			number = true;
+		}
+		else if (dataType=="SDO_GEOMETRY")
+		{
+			attr.rep_.type_ = TeOBJECT;
+			attr.rep_.numChar_ = dataLength;
+		}
+		else if (dataType== "CHAR")
+		{	
+			attr.rep_.type_ = TeCHARACTER;
+			attr.rep_.numChar_ = dataLength;
+		}
+		else if (dataType=="DATE")
+		{
+			attr.rep_.type_ = TeDATETIME;
+		}
+		else
+		{
+			attr.rep_.type_ = TeSTRING;
+			attr.rep_.numChar_ = dataLength;
+		}
+
+		if(number)
+		{
+			if(dataScale > 0)
+				attr.rep_.type_ = TeREAL;
+			else
+				attr.rep_.type_ = TeINT;
+		}
+		status = true;
+	}
+	
+	delete ocip;
+	return (status);
+}
+
+bool
+TeOCIOracle::createTable(const string& table, TeAttributeList &attr)
+{
+	short	cont=0;
+	string pkeys ="";
+	bool	hasAutoNumber=false;
+	string	fieldName="";
+
+	TeAttributeList::iterator it = attr.begin();
+	string tablec;
+	tablec = "CREATE TABLE " + table +" (";
+	
+	while ( it != attr.end())
+	{
+		if (cont)
+			tablec += ", ";
+			
+		switch ((*it).rep_.type_)
+		{
+			case TeSTRING:
+				if((*it).rep_.numChar_ > 0)
+				{
+					tablec += (*it).rep_.name_ + " VARCHAR2(" + Te2String((*it).rep_.numChar_) + ")";
+				}
+				else
+				{
+					tablec += (*it).rep_.name_ + " VARCHAR2(4000)";
+				}
+			break;
+			
+			case TeREAL:
+				if((*it).rep_.decimals_>0)
+					tablec += (*it).rep_.name_ +" NUMBER(*,"+ Te2String((*it).rep_.decimals_) +") ";
+				else
+					tablec += (*it).rep_.name_ +" NUMBER(*,15) ";
+			break;
+			
+			case TeINT:
+			case TeUNSIGNEDINT:
+				tablec += (*it).rep_.name_ + " NUMBER(32) ";
+			break;
+
+			case TeDATETIME:
+				tablec += (*it).rep_.name_ + " DATE ";
+			break;
+
+			case TeCHARACTER:
+				tablec += (*it).rep_.name_ + " CHAR ";
+			break;
+
+			case TeBOOLEAN:
+				tablec += (*it).rep_.name_ + " NUMBER(1) ";
+			break;
+
+			case TeBLOB:
+				tablec += (*it).rep_.name_ + " BLOB ";
+			break;
+
+			case TePOINTTYPE:
+			case TePOINTSETTYPE:
+			case TeNODETYPE:
+			case TeNODESETTYPE:
+				tablec += " x		NUMBER(*,15), ";
+				tablec += " y		NUMBER(*,15) ";
+				++it;
+				cont++;
+				continue;
+
+			case TeLINE2DTYPE:
+			case TeLINESETTYPE:
+				tablec += " num_coords NUMBER(32) NOT NULL, ";
+				tablec += " lower_x NUMBER(*,15) NOT NULL, ";
+				tablec += " lower_y NUMBER(*,15) NOT NULL, ";
+				tablec += " upper_x NUMBER(*,15) NOT NULL, ";
+				tablec += " upper_y NUMBER(*,15) NOT NULL, ";
+				tablec += " ext_max NUMBER(*,15) NOT NULL, ";
+				tablec += " spatial_data BLOB ";
+				++it;
+				cont++;
+				continue;
+
+			case TePOLYGONTYPE:
+			case TePOLYGONSETTYPE:
+				tablec += " num_coords NUMBER(32) NOT NULL,";
+				tablec += " num_holes  NUMBER(32) NOT NULL,";
+				tablec += " parent_id  NUMBER(32) NOT NULL,";
+				tablec += " lower_x    NUMBER(*,15) NOT NULL,";
+				tablec += " lower_y    NUMBER(*,15) NOT NULL,";
+				tablec += " upper_x    NUMBER(*,15) NOT NULL,";
+				tablec += " upper_y    NUMBER(*,15) NOT NULL,";
+				tablec += " ext_max    NUMBER(*,15) NOT NULL,";
+				tablec += " spatial_data BLOB ";
+				++it;
+				cont++;
+				continue;
+
+			case TeCELLTYPE:
+			case TeCELLSETTYPE:
+				tablec += " col_number	NUMBER(32) NOT NULL,";
+				tablec += " row_number	NUMBER(32) NOT NULL,";
+				tablec += " lower_x		NUMBER(*,15),";
+				tablec += " lower_y		NUMBER(*,15),";
+				tablec += " upper_x		NUMBER(*,15),";
+				tablec += " upper_y		NUMBER(*,15) ";
+				++it;
+				cont++;
+				continue;					
+
+			case TeRASTERTYPE:
+				tablec += " band_id NUMBER(32) NOT NULL, ";
+				tablec += " resolution_factor NUMBER(32), ";
+				tablec += " subband NUMBER(32),";
+				tablec += " lower_x NUMBER(*,15) DEFAULT 0.0, ";
+				tablec += " lower_y NUMBER(*,15) DEFAULT 0.0, ";
+				tablec += " upper_x NUMBER(*,15) DEFAULT 0.0, ";
+				tablec += " upper_y NUMBER(*,15) DEFAULT 0.0, ";							
+				tablec += " block_size NUMBER(32), ";
+				tablec += " spatial_data BLOB ";
+				++it;
+				cont++;
+				continue;
+
+			case TeTEXTTYPE:
+			case TeTEXTSETTYPE:
+			default:
+				tablec += (*it).rep_.name_ + " VARCHAR2(255) ";
+			break;
+		}
+
+		//default values
+		if(!((*it).rep_.defaultValue_.empty()))
+			tablec += " DEFAULT '" + (*it).rep_.defaultValue_ + "' ";
+
+		//not null values
+		if(!((*it).rep_.null_))
+			tablec += " NOT NULL ";
+
+		// auto number
+		if((*it).rep_.isAutoNumber_ && ((*it).rep_.type_==TeINT || (*it).rep_.type_==TeUNSIGNEDINT))
+		{
+			hasAutoNumber=true;
+			fieldName=(*it).rep_.name_;
+		}
+
+		// check if column is part of primary key
+		if ((*it).rep_.isPrimaryKey_ && (*it).rep_.type_ != TeBLOB )
+		{
+			if (!pkeys.empty())
+				pkeys += ", ";
+			pkeys += (*it).rep_.name_;
+		}
+
+		++it;
+		cont++;
+	}
+
+	if(!pkeys.empty())
+		tablec += ", PRIMARY KEY (" + pkeys + ") ";
+
+	tablec += ")";
+
+	if(!execute(tablec))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error creating table " + table;
+
+		return false;
+	}
+
+	if(hasAutoNumber)
+	{
+		string dropSql = " DROP TRIGGER "+ getNameTrigger(table); 
+		execute(dropSql);
+		dropSql = " DROP SEQUENCE "+ getNameSequence(table); 
+		execute(dropSql);
+
+		if(!createSequence(table))
+		{
+			deleteTable(table);
+			return false;
+		}
+		
+		if(!createAutoIncrementTrigger(table,fieldName))
+		{
+			deleteTable(table);
+			string sql= "DROP SEQUENCE "+ getNameSequence(table);
+			execute(sql); 
+			return false;
+		}
+	}
+	return true;
+}
+
+bool 
+TeOCIOracle::addColumn (const string& table, TeAttributeRep &rep)
+{
+	if(!tableExist(table))
+		return false;
+
+	string field = TeGetExtension(rep.name_.c_str());
+	if(field.empty())
+		field = rep.name_;
+
+	string tab;
+	tab = " ALTER TABLE " + table + " ADD ( ";
+	tab += field + "  ";
+	
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if(rep.numChar_ > 0)
+			{
+				tab += "VARCHAR2(" + Te2String(rep.numChar_) + ") ";
+			}
+			else
+			{
+				tab += "VARCHAR2(4000) ";
+			}
+			break;
+			
+		case TeREAL:
+			tab += "NUMBER(*,38)";	
+			break;
+			
+		case TeINT:
+			tab += "NUMBER(32)";
+			break;
+
+		case TeDATETIME:
+			tab += "DATE";
+			break;
+
+		case TeCHARACTER:
+			tab += "CHAR";
+			break;
+
+		case TeBOOLEAN:
+			tab += "NUMBER(1)";
+		break;
+		
+		case TeBLOB:
+			tab += "BLOB";
+			break;
+		
+		default:
+			tab += "VARCHAR2(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+
+	tab += " ) ";
+
+	if(!connection_->execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting a column to table " + table + " !";
+		return false;
+	}
+
+	alterTableInfoInMemory(table);
+	return true;
+}
+
+bool
+TeOCIOracle::deleteTable (const string& table)
+{
+	int f =	table.find ("te_collection");
+
+	if( table=="te_theme" ||
+		table=="te_layer" ||
+		table=="te_representation" ||
+		table=="te_tables_relation" ||
+		table=="te_layer_table" ||
+		table=="te_raster_metadata" ||
+		table=="te_projection" ||
+		table=="te_view" ||
+		table=="te_chart_params" ||
+		table=="te_legend" ||
+		table=="te_visual" ||
+		f == 0)
+	{
+		errorMessage_ = "N�o � poss�vel deletar tabelas do modelo!";
+		return false;
+	}
+	
+	if(tableExist(table))
+	{
+		std::string del = "DROP TABLE " + table;
+		if(!execute(del))
+			return false;
+	}
+	else if(viewExist(table))
+	{
+		std::string delView = "DROP VIEW " + table;
+		if(!execute(delView))
+			return false;
+	}
+
+	string seq = "DROP SEQUENCE " + getNameSequence(table);
+	if(!execute(seq))
+		return false;
+
+	return true;
+}
+
+bool 
+TeOCIOracle::execute (const string &q)
+{
+	bool result = connection_->execute(q);
+	
+	if(!result)
+		errorMessage_ = connection_->getErrorMessage();
+
+	return result;
+}
+
+TeDatabasePortal*  
+TeOCIOracle::getPortal ()
+{
+	TeOCIOraclePortal* ocip = new TeOCIOraclePortal (this);
+	return ocip;
+}
+
+bool 
+TeOCIOracle::insertRelationInfo(const int tableId, const string& tField,
+						    const string& eTable, const string& eField, int& relId)
+{
+	if(tableId < 0)
+	{
+		return false;
+	}
+
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	relId = -1;
+	string sel = "SELECT relation_id FROM te_tables_relation WHERE";
+	sel += " related_table_id = " + Te2String(tableId);
+	sel += " AND related_attr = '" + tField + "'";
+	sel += " AND external_table_name = '" + eTable + "'";
+	sel += " AND external_attr = '" + eField + "'";
+	if (!ocip->query(sel))
+	{
+		delete ocip;
+		return false;
+	}
+
+	if (ocip->fetchRow())
+	{
+		relId = atoi(ocip->getData(0));
+		delete ocip;
+		return true;
+	}
+
+	string seq = getNameSequence("te_tables_relation");	
+	string sql = " INSERT INTO te_tables_relation( ";
+	sql += " relation_id, related_table_id, related_attr, ";
+	sql += " external_table_name, external_attr) ";
+	sql += " VALUES( ";
+	sql += seq +".NEXTVAL "; 
+	sql += ", "+ Te2String(tableId);
+	sql += ",'" + escapeSequence(tField) + "'";
+	sql += ",'" + escapeSequence(eTable) + "'";
+	sql += ",'" + escapeSequence(eField) + "')";
+
+	if(!execute(sql))
+	{
+		errorMessage_ = "Error inserting tables information!";   
+		delete ocip;
+		return false;
+	}
+
+	ocip->freeResult();
+	sql = "SELECT "+ seq +".CURRVAL FROM DUAL";
+	if (!ocip->query(sql))
+	{
+		errorMessage_ = "Error in the sequence te_table_relation_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	relId = atoi((const char*)ocip->getData(0));
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOCIOracle::insertTableInfo (int layerId, TeTable &table, const string& user)
+{
+	string ins, seq;
+
+	seq = getNameSequence("te_layer_table");
+	ins = "INSERT INTO te_layer_table ( "; 
+	ins += " table_id, "; 
+	ins += " layer_id, attr_table, unique_id, attr_link, ";
+	ins += " attr_initial_time, attr_final_time, attr_time_unit, ";
+	ins += " attr_table_type, user_name) VALUES ( ";
+	ins += seq + ".NEXTVAL "; 
+	
+	if(layerId>0)
+		ins += ","+ Te2String(layerId);
+	else
+		ins += ", NULL ";
+	
+	ins += ", '" + escapeSequence(table.name()) + "'";
+	ins += ", '" + escapeSequence(table.uniqueName()) + "'";
+	ins += ", '" + escapeSequence(table.linkName()) + "'";
+	ins += ", '" + escapeSequence(table.attInitialTime()) + "'";
+	ins += ", '" + escapeSequence(table.attFinalTime()) + "'";
+	ins += ",  " + Te2String(table.attTimeUnit());
+	ins += ",  " + Te2String(table.tableType());
+	ins += ", '" +  escapeSequence(user) + "'";
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting tables information!";   
+		return false;
+	}
+
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	ins = "SELECT "+ seq +".CURRVAL FROM DUAL";
+	if (!ocip->query(ins))
+	{
+		errorMessage_ = "Error in the sequence te_layer_table_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0));
+	table.setId(index);
+	delete ocip;
+	return true;
+}
+
+
+TeDBRelationType 
+TeOCIOracle::existRelation(const string& tableName, const string& relName)
+{
+	TeOCIOraclePortal  *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return TeNoRelation;
+	
+	string integ = " SELECT DELETE_RULE  ";
+	integ += " FROM   all_constraints ";
+	integ += " WHERE  CONSTRAINT_TYPE = 'R'"; 
+	integ += " AND    OWNER = '" + TeConvertToUpperCase(user_) + "'";
+	integ += " AND    CONSTRAINT_NAME = '" + TeConvertToUpperCase(relName) + "'";
+	
+	string temp = " AND    TABLE_NAME = '" + TeConvertToUpperCase(tableName) + "' ";   
+	integ += temp;
+	
+	if(!ocip->query(integ))
+	{
+		delete ocip;
+		return TeNoRelation;
+	}
+
+	string cascade;
+	if(ocip->fetchRow())
+	{
+		cascade = string(ocip->getData(0));
+		if(cascade== "CASCADE")
+		{
+			delete ocip;
+			return TeRICascadeDeletion;
+		}
+		
+		delete ocip;
+		return TeRINoCascadeDeletion;
+	}
+
+	delete ocip;
+	return TeNoRelation;	
+}
+
+
+bool 
+TeOCIOracle::createRelation (const string& name, const string& table, const string& fieldName, const string& relatedTable, const string& relatedField, bool cascadeDeletion)
+{
+	string relation = "ALTER TABLE " + table + " ADD ";
+	relation += " CONSTRAINT " + name;
+	relation += " FOREIGN KEY ( " + fieldName + ") "; 
+	relation += " REFERENCES " + relatedTable + "(" + relatedField + ")";
+		
+	if (cascadeDeletion)
+		relation += " ON DELETE CASCADE ";
+
+	if(!execute(relation))
+		return false;
+
+	return true;
+}
+
+string
+TeOCIOracle::getSQLStatistics (TeGroupingAttr& attrs)
+{
+	string sql = "";
+	string virg = "";
+
+	TeGroupingAttr::iterator it = attrs.begin();
+	int count = 0;
+	while(it != attrs.end())
+	{
+		if(count>0)
+			virg = ",";
+
+		switch ((*it).second)
+		{
+			case TeSUM:
+				sql += virg +" SUM( "+ (*it).first.name_ +") AS SUM_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeMAXVALUE:
+				sql += virg +" MAX( "+ (*it).first.name_ +") AS MAX_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeMINVALUE:
+				sql += virg +" MIN( "+ (*it).first.name_ +") AS MIN_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeCOUNT:
+				sql += virg +" COUNT( "+ (*it).first.name_ +") AS COUNT_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeMEAN:
+				sql += virg +" AVG( "+ (*it).first.name_ +") AS AVG_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeSTANDARDDEVIATION:
+				sql += virg +" STDDEV( "+ (*it).first.name_ +") AS STDDEV_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeVARIANCE:
+				sql += virg +" VARIANCE( "+ (*it).first.name_ +") AS VAR_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			default:
+				break;
+		}
+		++it;
+	}
+	return sql;
+}
+
+
+string 
+TeOCIOracle::getSQLAutoNumber(const string& table)
+{
+	return (getNameSequence(table) +".NEXTVAL");
+}
+
+
+bool 
+TeOCIOracle::insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, 
+								   unsigned char *buf,unsigned long size, int band, unsigned int res, unsigned int subband)
+{
+	if (blockId.empty()) // no block identifier provided
+	{
+		errorMessage_ = "bloco sem identificador";
+		return false;
+	}
+
+	TeOCIOraclePortal* portal = (TeOCIOraclePortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	bool update = false;
+	string q =" SELECT * FROM " + table; 
+	q += " WHERE block_id='" + blockId + "'";
+
+	if (!portal->query(q))
+	{
+		delete portal;
+		return false;
+	}
+	// check if this block is alread in the database
+	if (portal->fetchRow())
+		update = true;
+
+	delete portal;
+
+	try
+	{
+		if (!update)
+		{
+			q = "INSERT INTO "+ table +" (block_id, band_id, subband, ";
+			q += " resolution_factor, lower_x, lower_y, upper_x, upper_y, ";
+			q += " block_size, spatial_data) VALUES ( ";
+			q += "'" + blockId + "'";
+			q += ", " + Te2String(band);
+			q += ", " + Te2String(subband);
+			q += ", " + Te2String(res);
+			q += ", " + Te2String(ll.x(), 15);
+			q += ", " + Te2String(ll.y(), 15);
+			q += ", " + Te2String(ur.x(), 15);
+			q += ", " + Te2String(ur.y(), 15);
+			q += ", " + Te2String(size);
+			q += ", :blobValue";
+			q += ")";
+			if (!connection_->executeBLOBSTM(q, buf, size, ":blobValue"))
+				return false;
+		}
+		else
+		{
+			q = " UPDATE "+ table +" SET spatial_data=:blobValue ";
+			q += " WHERE block_id='" + blockId + "'";
+			if (!connection_->executeBLOBSTM(q, buf, size, ":blobValue"))
+				return false;
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error inserting raster block!";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOCIOracle::insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size)
+{
+	TeOCIOraclePortal* portal = (TeOCIOraclePortal*) getPortal();
+	if (!portal)
+		return false;
+
+	try
+	{
+		string q = "SELECT * FROM "+ tableName +" WHERE "+ whereClause;
+		if((!portal->query(q)) || (!portal->fetchRow()))
+		{
+			delete portal;
+			return false;
+		}
+		delete portal;
+
+		q = " UPDATE "+ tableName +" SET "+ columnBlob +" = :blobValue";
+		q += " WHERE "+ whereClause;
+		if (!connection_->executeBLOBSTM(q, data, size, ":blobValue"))
+			return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error!";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOCIOracle::insertTable(TeTable &table)
+{
+	string tableName = table.name();
+	int size = table.size();
+	TeAttributeList att = table.attributeList();
+	TeAttributeList::iterator it = att.begin();
+	TeAttributeList::iterator itEnd = att.end();
+
+	if (!beginTransaction())
+		return false;
+
+	TeTableRow row;
+	int i;
+	unsigned int j;
+	int blobIndex = -1;
+	for ( i = 0; i < size; i++  )
+	{
+		row = table[i];
+		it = att.begin();
+
+		j = 1;
+		int jj = 0;
+
+		std::string columnNames = "";
+		std::string columnValues = "";
+		while ( it != itEnd )
+		{
+			/*if (j != 1)
+				q += ", ";*/
+
+			if(!columnNames.empty())
+			{
+				columnNames += ",";
+				columnValues += ",";
+			}
+
+			columnNames += it->rep_.name_;
+
+			if(row[jj].empty())
+
+			{
+				columnValues += " NULL ";
+				++it;
+				j++;
+				jj++;
+				continue;
+			}
+
+  			string oracleFormat="";
+			string dateTime="";
+			if(((*it).rep_.type_==TeDATETIME) && (!row[jj].empty()))
+			{
+				TeTime t  (row[jj], (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_,
+						   (*it).timeSeparator_, (*it).indicatorPM_);
+				
+				dateTime = t.getDateTime("DDsMMsYYYYsHHsmmsSS");
+				oracleFormat = " TO_DATE('" + dateTime + "', 'DD/MM/YYYY HH24:MI:SS')";
+			}
+			
+			switch ((*it).rep_.type_)
+  			{
+  				case TeSTRING:
+					columnValues += "'"+ escapeSequence(row[jj]) +"'";
+  				break;
+  				case TeREAL:
+					columnValues += row[jj]; 
+  				break;
+  				case TeINT:
+					columnValues += row[jj];
+  				break;
+				case TeDATETIME:
+					columnValues += oracleFormat;
+				break;
+				case TeCHARACTER:
+					columnValues += "'" + escapeSequence(row[jj]) + "'";
+  				break;
+				case TeBOOLEAN:
+				{
+					std::string value = "0";
+					if(row[jj] == "1" || TeConvertToLowerCase(row[jj]) == "t" || TeConvertToLowerCase(row[jj]) == "true")
+					{
+						value = "1";
+					}
+					columnValues += value;
+				}
+				break;
+				case TeBLOB:
+					blobIndex = jj;
+					columnValues += " :blobValue ";
+				break;
+  				default:
+					columnValues += "'"+ escapeSequence(row[jj]) +"'";
+  				break;
+  			}
+			++it;
+			j++;
+			jj++;
+		}
+		std::string q = "INSERT INTO "+tableName+"("+columnNames+") VALUES("+columnValues+")";
+		
+		// Verify if there is blob type
+		if(blobIndex>=0)
+		{
+			if(!connection_->executeBLOBSTM(q, (unsigned char *) row[blobIndex].c_str(), row[blobIndex].size(), ":blobValue"))
+			{
+				rollbackTransaction();
+				return false;
+			}
+		}
+		else 
+		{
+			if(!execute(q))
+			{
+				rollbackTransaction();
+				return false;
+			}
+		}
+	}
+	if (!commitTransaction())
+		return false;
+	return true;
+}
+	
+bool 
+TeOCIOracle::alterTable (const string& table, TeAttributeRep &rep, const string& oldColName)
+{
+	if(!tableExist(table))
+		return false;
+
+	if(!oldColName.empty() && oldColName != rep.name_ ) //rename column
+	{
+		string add = " ALTER TABLE "+ table +" RENAME COLUMN "+ oldColName +" TO "+ rep.name_;
+		if(!execute(add))
+		{
+			if(errorMessage_.empty())
+				errorMessage_ = "Error alter table " + table + " !";
+			return false;
+		}
+	}
+
+	string tab = " ALTER TABLE "+ table +" MODIFY ( ";
+	tab += rep.name_ + "  ";
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if ( rep.numChar_ > 0 )
+				tab  += "VARCHAR2(" + Te2String(rep.numChar_) + ") ";
+			else
+				tab += "VARCHAR2(4000) "; 
+			break;
+
+		case TeREAL:
+			if(rep.decimals_>0)
+				tab += " NUMBER(*,"+ Te2String(rep.decimals_) +") ";
+			else
+				tab += " NUMBER(*,38) ";
+		break;
+		
+		case TeINT:
+			tab += " NUMBER(32) ";
+			break;
+
+		case TeDATETIME:
+			tab += " DATE ";
+			break;
+
+		case TeCHARACTER:
+			tab += " CHAR ";
+			break;
+			
+		case TeBOOLEAN:
+			tab += " NUMBER(1) ";
+			break;
+		
+		default:
+			tab += " VARCHAR2(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+
+	tab += " )";
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error alter table " + table + " !";
+		return false;
+	}
+	
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + table + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+
+	if(tableId.empty() == false)
+	{
+		if(oldColName.empty() == false) // column name changed
+		{
+			 // update relation
+			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
+			sql += " WHERE related_table_id = " + tableId;
+			sql += " AND related_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
+			sql += " WHERE external_table_name = '" + table + "'";
+			sql += " AND external_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			 // update grouping
+			sql = "UPDATE te_grouping SET grouping_attr = '" + table + "." + rep.name_ + "'";
+			sql += " WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+		else // column type changed
+		{
+			// delete relation
+			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+			sql += " AND related_attr = '" + rep.name_ + "')";
+			sql += " OR (external_table_name = '" + table + "'";
+			sql += " AND external_attr = '" + rep.name_ + "')";
+			if(execute(sql) == false)
+				return false;
+
+			// delete grouping
+			TeDatabasePortal* portal = getPortal();
+			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(portal->query(sql) && portal->fetchRow())
+			{
+				string themeId = portal->getData(0);
+
+				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
+				if(execute(sql) == false)
+				{
+					delete portal;
+					return false;
+				}
+			}
+			delete portal;
+
+			sql = "DELETE FROM te_grouping";
+			sql += " WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+	}
+	alterTableInfoInMemory(table);
+	return true;
+}
+
+bool 
+TeOCIOracle::alterTable(const string& oldTableName, const string& newTableName)
+{
+	string sql = " ALTER TABLE "+ oldTableName +" RENAME TO "+ newTableName;
+	if(!this->execute(sql))
+		return false;
+
+	//update te_layer_table
+	sql = " UPDATE te_layer_table ";
+	sql += " SET attr_table = '"+ newTableName +"'";
+	sql += " WHERE attr_table = '"+ oldTableName +"'";
+	execute(sql);
+
+	//update te_tables_relation
+	sql = " UPDATE te_tables_relation ";
+	sql += " SET external_table_name = '"+ newTableName +"'";
+	sql += " WHERE external_table_name = '"+ oldTableName +"'";
+	execute(sql);
+	
+	alterTableInfoInMemory(newTableName, oldTableName);
+	return true;
+}
+
+
+bool
+TeOCIOracle::updateTable (TeTable &table)
+{
+	string tableName = table.name();
+	TeAttributeList att = table.attributeList();
+	TeAttributeList::iterator it = att.begin();
+	
+	int blobIndex = -1;
+	TeTableRow row;
+	unsigned int i;
+	unsigned int j;
+	string uniqueName = table.uniqueName();
+	string uniqueVal;
+
+	if (!beginTransaction())
+		return false;
+
+	for ( i = 0; i < table.size(); i++  )
+	{
+		row = table[i];
+		it = att.begin();
+		string q = 	"UPDATE "+tableName+" SET ";
+		j = 1;
+		int jj = 0;
+		while ( it != att.end() )
+		{
+			string oracleFormat;
+			string dateTime; 
+			if((*it).rep_.type_==TeDATETIME)
+			{
+				TeTime t  (row[jj], (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_,
+						   (*it).timeSeparator_, (*it).indicatorPM_);
+				
+				dateTime = t.getDateTime();
+				oracleFormat = "DD/MM/YYYY HH24:MI:SS"; 
+			}
+			
+			if (uniqueName != (*it).rep_.name_)
+			{
+				q += (*it).rep_.name_ + "=";
+  				switch ((*it).rep_.type_)
+  				{
+  					case TeSTRING:
+						q += "'"+escapeSequence(row[jj])+"'";
+  					break;
+  					case TeREAL:
+						q += row[jj];
+  					break;
+  					case TeINT:
+						q += row[jj];
+  					break;
+					case TeDATETIME:
+						q += " TO_DATE('" + dateTime + "', '"+ oracleFormat +"')";
+  					break;
+					case TeCHARACTER:
+						q += "'" + escapeSequence(row[jj]) + "'";
+  					break;
+					case TeBLOB:
+						blobIndex = jj;
+						q += " :blobValue ";
+					break;
+  					default:
+						q += "'"+escapeSequence(row[jj])+"'";
+  					break;
+  				}
+				if (j<att.size())
+					q+= ",";
+			}
+			else
+				uniqueVal = row[jj];
+
+			++it;
+			j++;
+			jj++;
+		}
+		q += " WHERE " + uniqueName + " = " + uniqueVal;
+		
+		// Verify if there is blob type
+		if(blobIndex>=0)
+		{
+			if (!connection_->executeBLOBSTM(q, (unsigned char *) row[blobIndex].c_str(), 
+				row[blobIndex].size(), ":blobValue"))
+				continue;
+		}
+		else 
+		{
+			if (!execute(q))
+				continue;
+		}
+	}
+	if (!commitTransaction())
+		return false;
+	return true;
+}
+	
+
+bool 
+TeOCIOracle::insertProjection (TeProjection *proj)
+{
+	string insert = "INSERT INTO te_projection (";
+	insert += " projection_id, "; 
+	insert += " name, long0, lat0,";
+	insert += " offx, offy, stlat1, stlat2, unit, scale, hemis, datum, ";
+	insert += " radius, flattening, dx , dy, dz ) VALUES ( ";
+	insert += " te_projection_seq.NEXTVAL ";
+	insert += ", '" + escapeSequence(proj->name()) + "'";
+	insert += ", " + Te2String(proj->params().lon0*TeCRD,15);
+	insert += ", " + Te2String(proj->params().lat0*TeCRD,15);
+	insert += ", " + Te2String(proj->params().offx,15);
+	insert += ", " + Te2String(proj->params().offy,15);
+	insert += ", " + Te2String(proj->params().stlat1*TeCRD,15);
+	insert += ", " + Te2String(proj->params().stlat2*TeCRD,15);
+	insert += ", '" + escapeSequence(proj->params().units) + "'";
+	insert += ", " + Te2String(proj->params().scale,15);
+	insert += ", " + Te2String(proj->params().hemisphere, 15);
+	insert += ", '" + escapeSequence(proj->params().datum.name()) + "'";
+	insert += ", " + Te2String(proj->params().datum.radius(),15);
+	insert += ", " + Te2String(proj->params().datum.flattening(),15);
+	insert += ", " + Te2String(proj->params().datum.xShift(),15);
+	insert += ", " + Te2String(proj->params().datum.yShift(),15);
+	insert += ", " + Te2String(proj->params().datum.zShift(),15);
+	insert += ")";
+
+	if(!execute(insert))
+	{
+		errorMessage_ = "Error inserting in the table te_projection!";   
+		return false;
+	}
+
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*) getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT te_projection_seq.CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		errorMessage_ = "Error in the sequence te_projection_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	proj->id(atoi((const char*)ocip->getData(0))); 
+	delete ocip;
+	return true;
+}
+
+
+bool
+TeOCIOracle::insertRepresentation (int layerId, TeRepresentation& rep)
+{
+	if (layerId <= 0)
+		return false;
+	
+	string ins;
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*) getPortal();
+	if(!ocip)
+		return false;
+
+	ins = " INSERT INTO te_representation ( ";
+	ins += " repres_id, ";
+	ins += " layer_id, geom_type, geom_table, ";
+	ins += " description, lower_x, lower_y, upper_x, upper_y, res_x, res_y, num_cols, ";
+	ins += " num_rows) VALUES (";
+	ins += " te_representation_seq.NEXTVAL ";
+	ins += ", " + Te2String(layerId);
+	ins += ", " + Te2String(static_cast<int>(rep.geomRep_));
+	ins += ", '" + escapeSequence(rep.tableName_) + "'";
+	ins += ", '" + escapeSequence(rep.description_) + "'";
+	ins += ", " + Te2String(rep.box_.x1(),15);
+	ins += ", " + Te2String(rep.box_.y1(),15);
+	ins += ", " + Te2String(rep.box_.x2(),15);
+	ins += ", " + Te2String(rep.box_.y2(),15);
+	ins += ", " + Te2String(rep.resX_,15);
+	ins += ", " + Te2String(rep.resY_,15);
+	ins += ", " + Te2String(rep.nCols_);
+	ins += ", " + Te2String(rep.nLins_);
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting in the table te_representation!";  
+		delete ocip;
+		return false;
+	}
+	
+	string seq = "SELECT te_representation_seq.CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		errorMessage_ = "Error in the sequence te_representation_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int id = atoi((const char*)ocip->getData(0)); 
+	rep.id_ = id;
+	delete ocip;
+	return true;
+}
+
+
+bool
+TeOCIOracle::insertLegend (TeLegendEntry* leg)
+{
+	TeOCIOraclePortal  *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string ins = "INSERT INTO te_legend ( ";
+	ins += " legend_id, ";
+	ins += " theme_id, group_id, ";
+	ins += " num_objs, lower_value, upper_value, label) VALUES ( ";
+	ins += "te_legend_seq.NEXTVAL";
+	ins += ", " + Te2String(leg->theme());
+	ins += ", " + Te2String(leg->group());
+	ins += ", " + Te2String(leg->count());
+	ins += ", '" + escapeSequence(leg->from()) + "'";
+	ins += ", '" + escapeSequence(leg->to()) + "'";
+	ins += ", '" + escapeSequence(leg->label()) + "'";
+	ins += ")";
+		
+	if (!execute(ins))
+	{
+		errorMessage_ = "Error inserting in the table te_legend!"; 
+		delete ocip;
+		return false;
+	}
+
+	string seq = "SELECT te_legend_seq.CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		errorMessage_ = "Error in the sequence te_theme_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";;
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0)); 
+	leg->id(index);
+	
+	delete ocip;
+	legendMap()[leg->id()] = leg;
+	return insertVisual(leg);
+}
+
+bool
+TeOCIOracle::insertPolygonSet(const string& table, TePolygonSet &ps)
+{
+	if(!getValueSequence(table))
+		return false;
+
+	for (unsigned int i = 0; i < ps.size(); i++ )
+	{
+		TePolygon& poly = ps [i];
+		if (!insertPolygon (table,poly))		
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeOCIOracle::insertPolygon (const string& table, TePolygon &poly)
+{
+	double	extmax;
+	unsigned int i, k, ni, size;
+	double	*points	= 0;
+	try
+	{
+		long parentId = 0;
+
+		for ( k = 0; k < poly.size(); k++ )
+		{
+			TeLinearRing ring (poly[k]);
+			TeBox b = ring.box();
+			size = ring.size(); 
+			ni = 0;
+			
+			// max extent 
+			extmax = MAX(b.width(),b.height());
+		
+			// number of holes
+			if (k==0)
+				ni = poly.size()-1;
+			else
+				ni = 0;
+			
+			++sequenceCont_;
+			if(k==0)
+				parentId=sequenceCont_;
+
+			// insert data
+			string ins = "INSERT INTO " + table + " ( ";
+			ins += " geom_id, ";
+			ins += " object_id, num_coords, num_holes, ";
+			ins += " parent_id, lower_x, lower_y, upper_x, upper_y, "; 
+			ins += " ext_max, spatial_data) VALUES ( ";
+			ins +=  getNameSequence(table) +".NEXTVAL";
+			ins += ", '" + escapeSequence(poly.objectId()) + "'";
+			ins += ","+ Te2String(size);
+			ins += ","+ Te2String(ni);
+			ins += ","+ Te2String((long)parentId);
+			ins += ","+ Te2String(b.lowerLeft().x(), 15);
+			ins += ","+ Te2String(b.lowerLeft().y(), 15);
+			ins += ","+ Te2String(b.upperRight().x(), 15);
+			ins += ","+ Te2String(b.upperRight().y(), 15);
+			ins += ","+ Te2String(extmax);
+			ins += ", :blobValue ";
+			ins += ")";
+
+			//get coord
+			points = new double[2*ring.size()];  //2*sizeof(double)*size
+			int iac = 0;
+			for (i=0;i<ring.size();i++)
+			{
+				points[iac++]=ring[i].x();
+				points[iac++]=ring[i].y();
+			}
+			unsigned long bLen = 2*(ring.size())*sizeof(double)*sizeof(unsigned char);
+
+			if (!connection_->executeBLOBSTM(ins, (unsigned char*)points, bLen, ":blobValue"))
+			{
+				errorMessage_ = "Error inserting in the table " + table + "!";  
+				delete[] points;
+				return false;
+			}
+
+			poly.geomId(sequenceCont_);
+			if(points)
+				delete[] points;
+			points=NULL;
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error inserting polygon!";
+		if(points)
+			delete[] points;
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeOCIOracle::updatePolygon (const string& table, TePolygon &poly)
+{
+	double	extmax;
+	unsigned int k, ni, size, i;
+	double	*points	= NULL;
+
+	try
+	{
+		TeBox b = poly[0].box();
+		for ( k = 0; k < poly.size(); k++ )
+		{
+			//Gets each ring
+			TeLinearRing ring ( poly[k] );
+			size = ring.size();
+			ni = 0;
+			if (k==0)
+			{
+				extmax = MAX(b.width(),b.height());
+				ni = poly.size()-1;
+			}
+			else
+				ni = 0;
+
+			//update information about each ring
+			string sql;
+			sql =  " UPDATE " + table + " SET ";
+			sql += ", object_id = '" + poly.objectId() + "'";
+			sql += ", num_coords = " + Te2String(size);
+			sql += ", num_holes = " + Te2String(ni);
+			sql += ", parent_id = " + ((long)poly[0].geomId());
+			sql += ", lower_x = " + Te2String(b.lowerLeft().x(), 15);
+			sql += ", lower_y = " + Te2String(b.lowerLeft().y(), 15);
+			sql += ", upper_x = " + Te2String(b.upperRight().x(), 15);
+			sql += ", upper_y = " + Te2String(b.upperRight().y(), 15);
+			sql += ", ext_max = " + Te2String(extmax);
+			sql += ", spatial_data = :blobValue ";
+			sql += " WHERE geom_id = "+ Te2String(ring.geomId());
+
+			//get coord
+			points = new double[2*ring.size()];  //2*sizeof(double)*size
+			int iac = 0;
+			for (i=0;i<ring.size();i++)
+			{
+				points[iac++]=ring[i].x();
+				points[iac++]=ring[i].y();
+			}
+
+			int bLen = 2*(ring.size())*sizeof(double)*sizeof(unsigned char);
+
+			if (!connection_->executeBLOBSTM(sql, (unsigned char*)points, bLen, ":blobValue"))
+			{
+				errorMessage_ = "Error inserting in the table " + table + "!";  
+				delete[] points;
+				return false;
+			}
+
+			if(points)
+				delete[] points;
+			points=NULL;
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error updating polygons!";
+		if(points)
+			delete[] points;
+		return false;
+	}
+	return true;
+}
+
+bool
+TeOCIOracle::getValueSequence(const string& table)
+{
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	if (getNameSequence(table) != sequenceName_)
+	{
+		string seq = "SELECT "+ getNameSequence(table) +".NEXTVAL FROM DUAL";
+		
+		if(!ocip->query(seq) || !ocip->fetchRow())
+		{
+			errorMessage_ = "Error in the sequence " + table + "_seq!"; 
+			sequenceName_ = "";
+			delete ocip;
+			return false;
+		}
+
+		sequenceName_ = getNameSequence(table);
+		sequenceCont_ = atoi(ocip->getData(0));
+	}
+
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOCIOracle::insertLineSet(const string& table, TeLineSet &ls)
+{
+	if(!getValueSequence(table))
+		return false;
+
+	for (unsigned int i = 0; i < ls.size(); i++ )
+	{
+		TeLine2D& line = ls [i];
+		if (!insertLine (table,line))
+			return false;
+	}
+	return true;
+}
+
+bool
+TeOCIOracle::insertLine (const string& table, TeLine2D &line)
+{
+	double	extmax;
+	unsigned int i, size;
+	double	*points	= 0;
+	
+	try
+	{
+		TeBox b = line.box();
+		size = line.size(); 
+		// max extent 
+		extmax = MAX(b.width(),b.height());
+		
+		// insert data
+		string ins = "INSERT INTO " + table + " ( ";
+		ins += " geom_id, ";
+		ins += " object_id, num_coords, ";
+		ins += " lower_x, lower_y, upper_x, upper_y, "; 
+		ins += " ext_max, spatial_data) VALUES ( ";
+		ins +=  getNameSequence(table) +".NEXTVAL";
+		ins += ", '" + escapeSequence(line.objectId()) + "'";
+		ins += ","+ Te2String(size);
+		ins += ","+ Te2String(b.lowerLeft().x(), 15);
+		ins += ","+ Te2String(b.lowerLeft().y(), 15);
+		ins += ","+ Te2String(b.upperRight().x(), 15);
+		ins += ","+ Te2String(b.upperRight().y(), 15);
+		ins += ","+ Te2String(extmax);
+		ins += ", :blobValue";
+		ins += ")";
+
+		//get coord
+		points = new double[2*line.size()];  //2*sizeof(double)*size
+		int iac = 0;
+		for (i=0;i<line.size();i++)
+		{
+			points[iac++]=line[i].x();
+			points[iac++]=line[i].y();
+		}
+		unsigned long bLen = 2*(line.size())*sizeof(double)*sizeof(unsigned char);
+
+		if (!connection_->executeBLOBSTM(ins, (unsigned char*)points, bLen, ":blobValue"))
+		{
+			errorMessage_ = "Error inserting in the table " + table + "!";  
+			delete[] points;
+			return false;
+		}
+		++sequenceCont_;
+		line.geomId(sequenceCont_);
+		if(points)
+			delete[] points;
+		points=NULL;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error inserting line!";
+		if(points)
+			delete[] points;
+		return false;
+	}
+
+	return true;
+}
+
+
+bool 
+TeOCIOracle::updateLine(const string& table, TeLine2D &line)
+{
+	double	extmax;
+	unsigned int size, i;
+	double	*points	= NULL;
+
+	try
+	{
+		TeBox b = line.box();
+		size = line.size();
+		extmax = MAX(b.width(),b.height());
+		
+		//update information about each line
+		string sql =  "UPDATE " + table + " SET ";
+		sql += "  object_id= '" + line.objectId() + "'";
+		sql += ", num_coords= " + ((long)size);
+		sql += ", lower_x= " + Te2String(b.lowerLeft().x(), 15);
+		sql += ", lower_y= " + Te2String(b.lowerLeft().y(), 15);
+		sql += ", upper_x= " + Te2String(b.upperRight().x(), 15);
+		sql += ", upper_y= " + Te2String(b.upperRight().y(), 15);
+		sql += ", ext_max= " + Te2String(extmax);
+		sql += ", spatial_data = :blobValue ";
+		sql += " WHERE geom_id = "+ Te2String(line.geomId());
+
+		//get coord
+		points = new double[2*line.size()];  //2*sizeof(double)*size
+		int iac = 0;
+		for (i=0;i<line.size();i++)
+		{
+			points[iac++]=line[i].x();
+			points[iac++]=line[i].y();
+		}
+		int bLen = 2*(line.size())*sizeof(double)*sizeof(unsigned char);
+
+		if (!connection_->executeBLOBSTM(sql, (unsigned char*)points, bLen, ":blobValue"))
+		{
+			errorMessage_ = "Error inserting in the table " + table + "!";  
+			delete[] points;
+			return false;
+		}
+		
+		if(points)
+			delete[] points;
+		points = NULL;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error updating lines!";
+		if(points)
+			delete[] points;
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOCIOracle::insertPoint(const string& table, TePoint &point)
+{
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, ";
+	ins += " object_id, x, y) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(point.objectId()) + "'";
+	ins += ",  " + Te2String(point.location().x(), 15);
+	ins += ",  " + Te2String(point.location().y(), 15);
+	ins += " ) ";
+
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting points!"; 
+		return false;
+	}
+	return true;
+}
+
+
+bool 
+TeOCIOracle::insertText	(const string& table, TeText &text)
+{
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, ";
+	ins += " object_id, x, y, text_value, angle, height, alignment_vert, ";
+	ins += " alignment_horiz) VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(text.objectId()) + "'";
+	ins += ",  " + Te2String(text.location().x(),15);
+	ins += ",  " + Te2String(text.location().y(),15);
+	ins += ", '" + escapeSequence(text.textValue()) + "'";
+	ins += ",  " + Te2String(text.angle(),15);
+	ins += ",  " + Te2String(text.height(),15);
+	ins += ",  " + Te2String(text.alignmentVert(),15);
+	ins += ",  " + Te2String(text.alignmentHoriz(),15);
+	ins += " )";
+	
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting texts!"; 
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOCIOracle::insertArc (const string& table, TeArc &arc)
+{
+	string ins = "INSERT INTO " + table + " (";
+	ins += " geom_id, ";
+	ins += " object_id, from_node, to_node ) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(arc.objectId()) + "'";
+	ins += ",  " + Te2String(arc.fromNode().geomId());
+	ins += ",  " + Te2String(arc.toNode().geomId());
+	ins += " )";
+	
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting arc!"; 
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOCIOracle::insertNode (const string& table, TeNode &node)
+{	
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, "; 
+	ins += " object_id, x, y) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(node.objectId()) + "'";
+	ins += ",  " + Te2String(node.location().x(), 15);
+	ins += ",  " + Te2String(node.location().y(), 15);
+	ins += " ) ";
+
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting nodes!"; 
+		return false;
+	}
+	return true;
+}
+	
+bool 
+TeOCIOracle::insertCell (const string& table, TeCell &cell )
+{
+	TeBox b = cell.box();
+	
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, ";
+	ins += " object_id, col_number, row_number, lower_x, ";
+	ins += " lower_y, upper_x, upper_y ) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(cell.objectId ()) + "'";
+	ins += ",  " + Te2String(cell.column());
+	ins += ",  " + Te2String(cell.line());
+	ins += ",  " + Te2String(b.lowerLeft().x(), 15);
+	ins += ",  " + Te2String(b.lowerLeft().y(), 15);
+	ins += ",  " + Te2String(b.upperRight().x(), 15);
+	ins += ",  " + Te2String(b.upperRight().y(), 15);
+	ins += " )";
+		
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting cells!"; 
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOCIOracle::insertLayer(TeLayer* layer)
+{	
+	int index;
+	TeProjection* proj = layer->projection();
+	if (!proj || !insertProjection(proj))
+	{
+		errorMessage_ = "N�o � poss�vel inserir layer sem proje��o";
+		return false;
+	}
+	string ins = "INSERT INTO te_layer (";
+	ins += " layer_id, ";
+	ins += " projection_id, name ";
+	ins += ", lower_x, lower_y, upper_x, upper_y, edition_time) ";
+	ins += " VALUES ( ";
+	ins += "te_layer_seq.NEXTVAL";
+	ins += ", "+ Te2String(proj->id());
+	ins += ", '" + escapeSequence(layer->name()) + "'";
+	ins += ", " + Te2String(layer->box().x1(),15);
+	ins += ", " + Te2String(layer->box().y1(),15);
+	ins += ", " + Te2String(layer->box().x2(),15);
+	ins += ", " + Te2String(layer->box().y2(),15);
+	TeTime editionTime = layer->getEditionTime();
+	ins += ", " + getSQLTime(editionTime);
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting in the table te_layer!";   
+		return false;
+	}
+
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	ins = "SELECT te_layer_seq.CURRVAL FROM DUAL";
+	if (!ocip->query(ins))
+	{
+		errorMessage_ = "Error in the sequence te_layer_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	index = atoi((const char*)ocip->getData(0));
+	layer->id(index);
+	delete ocip;
+	layerMap()[layer->id()] = layer;
+	return true;
+}
+
+bool 
+TeOCIOracle::insertProject(TeProject* project)
+{	
+	if (!project)
+		return false;
+
+	string ins = "INSERT INTO te_project (";
+	ins += " project_id, ";
+	ins += " name, description, current_view) ";
+	ins += " VALUES ( ";
+	ins += "te_project_seq.NEXTVAL";
+	ins += ", '" + escapeSequence(project->name()) + "'";
+	ins += ", '" + escapeSequence(project->description()) + "'";
+	ins += ", " + Te2String(project->getCurrentViewId());
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting in the table te_project!";   
+		return false;
+	}
+
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	ins = "SELECT te_project_seq.CURRVAL FROM DUAL";
+	if (!ocip->query(ins))
+	{
+		errorMessage_ = "Error in the sequence te_project_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0));
+	project->setId(index);
+	projectMap()[project->id()] = project;
+	for (unsigned int i=0; i<project->getViewVector().size(); i++)
+		insertProjectViewRel(project->id(), project->getViewVector()[i]);
+	delete ocip;
+	return true;
+}
+
+bool
+TeOCIOracle::deleteLayer(int layerId)
+{
+	//Delete attributes tables
+	if(!deleteLayerTable(layerId))
+		return false;
+
+	TeOCIOraclePortal* portal = (TeOCIOraclePortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	string geomTable;
+	string sql = "SELECT projection_id FROM te_layer WHERE layer_id = ";
+	sql += Te2String(layerId);
+
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	string projId = portal->getData("projection_id");
+	portal->freeResult();
+
+	// Get all representations that are associated to this layer
+	sql = "SELECT * FROM te_representation WHERE layer_id = "+ Te2String(layerId);
+	if (!portal->query (sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	while (portal->fetchRow())
+	{	// Delete the geometry tables
+		geomTable = portal->getData("geom_table");
+	
+		// Delete lut table
+		TeGeomRep rep = TeGeomRep(atoi(portal->getData("geom_type")));
+		if (rep == TeRASTER || rep == TeRASTERFILE)
+		{
+			TeOCIOraclePortal* portal2 = (TeOCIOraclePortal*)this->getPortal();
+			sql = "SELECT lut_table, raster_table FROM " + geomTable;
+			string tabName;
+			if (!portal2->query (sql))
+			{
+				delete portal2;
+				continue;
+			}
+
+			while (portal2->fetchRow())
+			{
+				// remove lut table
+				tabName = portal2->getData(0);
+				if (!tabName.empty() && this->tableExist(tabName))
+				{
+					sql = "DROP TABLE " + tabName;
+					this->execute(sql);
+
+					sql= "DROP SEQUENCE "+ getNameSequence(tabName);
+					this->execute(sql); 
+				}
+				// remove raster table
+				tabName = portal2->getData(1);
+				if (!tabName.empty() && this->tableExist(tabName))
+				{
+					sql = "DROP TABLE " + tabName;
+					this->execute(sql);
+
+					sql= "DROP SEQUENCE "+ getNameSequence(tabName);
+					this->execute(sql); 
+				}
+			}
+			delete portal2;
+			// remove raster metadata table
+			tabName = geomTable + "_metadata";
+			if (!tabName.empty() && this->tableExist(tabName))
+			{
+				sql = "DROP TABLE " + tabName;
+				this->execute(sql);
+
+				sql= "DROP SEQUENCE "+ getNameSequence(tabName);
+				this->execute(sql); 
+
+			}
+
+		}
+		if (this->tableExist(geomTable))
+		{
+			sql = "DROP TABLE " + geomTable;
+			if(tableExist(geomTable))
+			{
+				if (!this->execute(sql) )
+				{
+					delete portal;
+					return false;
+				}
+			}
+			
+			sql= "DROP SEQUENCE "+ getNameSequence(geomTable);
+			this->execute(sql);
+		}
+	}
+
+	portal->freeResult();
+	if (existRelation("te_representation","fk_rep_layer_id") != TeRICascadeDeletion)
+	{
+		// Delete entries into representations table
+		sql = "DELETE FROM te_representation WHERE layer_id = " +Te2String(layerId);
+		if (!this->execute(sql) )
+		{
+			delete portal;
+			return false;
+		}
+	}
+
+	// delete layer themes
+	sql = "SELECT theme_id FROM te_theme WHERE layer_id=" + Te2String(layerId);
+	if (!portal->query (sql))
+	{
+		delete portal;
+		return false;
+	}
+	
+	int themeId;
+	while (portal->fetchRow())
+	{	
+		themeId = atoi(portal->getData("theme_id"));
+		this->deleteTheme(themeId);
+	}
+	
+	sql = "DELETE FROM te_layer WHERE layer_id=" + Te2String(layerId);
+	if (!this->execute(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	// delete layer projection
+	sql = "DELETE FROM te_projection WHERE projection_id = "+ projId;
+	if (!this->execute(sql))
+	{	
+		delete portal;
+		return false;
+	}
+
+	// remove all the items� themes associated to the layer to be removed
+	TeThemeMap::iterator it;
+	for (it = themeMap().begin(); it != themeMap().end(); ++it)
+	{
+		TeTheme *theme = (TeTheme*)it->second;
+		if (theme->layer()->id() == layerId)
+		{
+			themeMap().erase(theme->id());
+			delete theme;
+		}
+	}
+
+	// Delete layer and its entry in the layer map
+	TeLayer* layer = layerMap()[layerId];
+	layerMap().erase(layerId);
+	delete layer;
+
+	delete portal;
+	return true;
+}
+
+bool
+TeOCIOracle::insertTheme (TeAbstractTheme *theme)
+{
+	double maxScale = theme->maxScale ();
+	if(maxScale==TeMAXFLOAT)
+		maxScale = 0.;
+
+	string ins = "INSERT INTO te_theme (";
+	ins += " theme_id, ";
+	ins += " layer_id, view_id, name, ";
+	ins += " parent_id, priority, node_type, min_scale, max_scale, ";
+	ins += " generate_attribute_where, generate_spatial_where, generate_temporal_where, ";
+	ins += " collection_table, visible_rep, enable_visibility, lower_x, lower_y, upper_x, upper_y, creation_time) ";
+	ins += " VALUES (";
+	ins += "te_theme_seq.NEXTVAL";
+	
+	if(theme->type()==TeTHEME)
+		ins += ", " + Te2String(static_cast<TeTheme*>(theme)->layerId());
+	else
+		ins += ", NULL ";
+	
+	ins += ", " + Te2String(theme->view());
+	ins += ", '" + escapeSequence(theme->name()) + "'";
+	ins += ", " + Te2String(theme->parentId ());
+	ins += ", " + Te2String(theme->priority());
+	ins += ", " + Te2String(theme->type ());
+	ins += ", " + Te2String (theme->minScale(),15);
+	ins += ", " + Te2String (maxScale,15);
+	ins += ", '" + escapeSequence(theme->attributeRest()) + "'";
+	ins += ", '" + escapeSequence(theme->spatialRest()) + "'";
+	ins += ", '" + escapeSequence(theme->temporalRest()) + "'";
+	
+	if(theme->type()==TeTHEME)
+		ins += ", '" + escapeSequence(static_cast<TeTheme*>(theme)->collectionTable()) + "'";
+	else
+		ins += ", NULL ";
+
+	ins += ", " + Te2String(theme->visibleRep());
+	ins += ", " + Te2String(theme->visibility());
+	ins += ", " + Te2String (theme->box().x1(),15);
+	ins += ", " + Te2String (theme->box().y1(),15);
+	ins += ", " + Te2String (theme->box().x2(),15);
+	ins += ", " + Te2String (theme->box().y2(),15);
+	TeTime creationTime = theme->getCreationTime();
+	ins += ", " + getSQLTime(creationTime);
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting in the table te_theme!";   
+		return false;
+	}
+
+	TeOCIOraclePortal  *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT te_theme_seq.CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		errorMessage_ = "Error in the sequence te_theme_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0)); 
+	theme->id(index);
+	delete ocip;	
+
+	//insert collection name
+	if((theme->type() == TeTHEME || theme->type()==TeEXTERNALTHEME)&& static_cast<TeTheme*>(theme)->collectionTable().empty())
+	{
+		string colName = "te_collection_" + Te2String(index);
+		static_cast<TeTheme*>(theme)->collectionTable(colName);	
+		
+		ins = "UPDATE te_theme SET ";
+		ins += " collection_table = '" + escapeSequence(colName) + "'";
+		ins += " WHERE theme_id = " + Te2String (index);
+		
+		if(!execute(ins))
+		{
+			errorMessage_ = "Error inserting in the table te_theme!";   
+			return false;
+		}
+	}
+
+	if(theme->parentId() == 0)
+	{
+		std::string sql = "UPDATE te_theme SET";
+		sql += "  parent_id = " + Te2String(theme->id());
+		sql += " WHERE theme_id = ";
+		sql += Te2String(theme->id());
+
+		theme->parentId(theme->id());
+
+		if(!this->execute(sql))
+			return false;
+	}
+	
+	bool status;
+
+	// insert grouping
+	int numSlices = 0;
+	if(theme->grouping().groupMode_ != TeNoGrouping)
+	{
+		if(!insertGrouping (theme->id(), theme->grouping()))
+			return false;
+		numSlices = theme->grouping().groupNumSlices_;
+	}
+
+	// insert legend
+	theme->outOfCollectionLegend().group(-1); 
+	theme->outOfCollectionLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->outOfCollectionLegend())); 
+	if (!status)
+		return status;
+
+	theme->withoutDataConnectionLegend().group(-2); 
+	theme->withoutDataConnectionLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->withoutDataConnectionLegend())); 
+	if (!status)
+		return status;
+
+	theme->defaultLegend().group(-3); 
+	theme->defaultLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->defaultLegend())); 
+	if (!status)
+		return status;
+
+	theme->pointingLegend().group(-4); 
+	theme->pointingLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->pointingLegend())); 
+	if (!status)
+		return status;
+
+	theme->queryLegend().group(-5); 
+	theme->queryLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->queryLegend())); 
+	if (!status)
+		return status;
+
+	theme->queryAndPointingLegend().group(-6); 
+	theme->queryAndPointingLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->queryAndPointingLegend())); 
+	if (!status)
+		return status;
+
+	for (int i = 0; i < numSlices; i++)
+	{
+		theme->legend()[i].group(i);
+		theme->legend()[i].theme(theme->id());
+		status = insertLegend (&(theme->legend()[i]));
+		if (!status)
+			return status;
+	}
+	if (!status)
+		return status;
+
+	//insert metadata theme
+	if(!theme->saveMetadata(this))
+		return false;
+
+	themeMap()[theme->id()] = theme;
+	
+	if(theme->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(theme)))
+		return false;
+
+	return true;
+}
+
+
+bool 
+TeOCIOracle::insertThemeTable (int themeId, int tableId, int relationId, int tableOrder)
+{
+	string ins = "INSERT INTO te_theme_table ( ";
+	ins += " theme_table_id, ";
+	ins += " theme_id, table_id, relation_id, table_order)";
+	ins += " VALUES ( ";
+	ins += getNameSequence("te_theme_table") +".NEXTVAL ";
+	ins += ", "+ Te2String(themeId);
+	ins += ", "+ Te2String(tableId);
+	
+	if(relationId>0)
+		ins += ", "+ Te2String(relationId);
+	else
+		ins += ", null ";
+
+	ins += ", "+ Te2String(tableOrder);
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		errorMessage_ = "Error inserting in the table te_theme_table!";   
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeOCIOracle::insertThemeGroup(TeViewTree* tree)
+{
+	string ins = "INSERT INTO te_theme (theme_id, view_id, name, ";
+	ins += " parent_id, priority, node_type ) VALUES (";
+	ins += "te_theme_seq.NEXTVAL";
+	ins += ", " + Te2String(tree->view());
+	ins += ", '" + escapeSequence(tree->name()) + "'";
+	ins += ", " + Te2String(tree->parentId ());
+	ins += ", " + Te2String(tree->priority());
+	ins += ", " + Te2String(1);
+	ins += ")";
+
+	TeOCIOraclePortal  *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+	
+	try
+	{
+		if(!execute(ins))
+		{
+			errorMessage_ = "Error inserting in the table te_theme!";   
+			delete ocip;
+			return false;
+		}
+
+		string seq = "SELECT te_theme_seq.CURRVAL FROM DUAL";
+		if(!ocip->query(seq))
+		{
+			errorMessage_ = "Error in the sequence te_theme_seq!";  
+			delete ocip;
+			return false;
+		}
+
+		if(!ocip->fetchRow())
+		{
+			errorMessage_ = "Sequence value not found!";
+			delete ocip;
+			return false;
+		}
+
+		int index = atoi((const char*)ocip->getData(0)); 
+		tree->id(index);
+		
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error inserting in the table te_theme!";
+		if(ocip)
+			delete ocip;
+		return false;
+	}
+
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOCIOracle::generateLabelPositions (TeTheme *theme, const std::string& objectId)
+{
+	string	geomTable, upd;
+	string	collTable = theme->collectionTable();
+	
+	if((collTable.empty()) || (!tableExist(collTable)))
+		return false;
+
+	if( theme->layer()->hasGeometry(TeCELLS)    || 
+		theme->layer()->hasGeometry(TePOLYGONS) ||
+		theme->layer()->hasGeometry(TeLINES) )
+	{
+		geomTable = theme->layer()->tableName(TeCELLS);
+		
+		if(geomTable.empty())
+		{
+			geomTable = theme->layer()->tableName(TePOLYGONS);
+			if(geomTable.empty())
+				geomTable = theme->layer()->tableName(TeLINES);
+		}
+
+		upd= "UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(lower_x + (upper_x - lower_x)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(lower_y + (upper_y - lower_y)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+	else if(theme->layer()->hasGeometry(TePOINTS))
+	{
+		geomTable = theme->layer()->tableName(TePOINTS);
+		
+		upd= " UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(x) ";
+		upd += " FROM " + geomTable + " p WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(y) ";
+		upd += " FROM " + geomTable + " p WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+
+	if (!upd.empty())
+	{
+		if (!objectId.empty())
+		{
+			upd += " AND c_object_id='"+objectId+"'";
+		}
+		if(!execute(upd))
+			return false;
+	}
+
+	return true;
+}
+
+bool 
+TeOCIOracle::insertView(TeView *view)
+{
+	// save it�s projection
+	TeProjection* proj = view->projection();
+	if ( !proj || !insertProjection(proj))
+	{
+		errorMessage_ = "N�o � poss�vel inserir vista sem proje��o";
+		return false;
+	}
+
+	string ins = "INSERT INTO te_view (view_id, projection_id, name, user_name, visibility, lower_x, lower_y, upper_x, upper_y, current_theme)";
+	ins += " VALUES (";
+	ins += "te_view_seq.NEXTVAL";
+	ins += ", " + Te2String(proj->id());
+	ins += ", '" + escapeSequence(view->name ()) + "'";
+	ins += ", '" + escapeSequence(view->user ()) + "'";
+	ins += ", " + Te2String((int)view->isVisible());
+	ins += ", " + Te2String(view->getCurrentBox().lowerLeft().x(),15);
+	ins += ", " + Te2String(view->getCurrentBox().lowerLeft().y(),15);
+	ins += ", " + Te2String(view->getCurrentBox().upperRight().x(),15);
+	ins += ", " + Te2String(view->getCurrentBox().upperRight().y(),15);
+	if(view->getCurrentTheme() == -1)
+		ins += ", null";
+	else	
+	ins += ", " + Te2String(view->getCurrentTheme());
+	ins += " )";
+	
+	if(!execute (ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_view!";   
+		return false;
+	}
+
+	TeOCIOraclePortal *ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	ins = "SELECT te_view_seq.CURRVAL FROM DUAL";
+	if (!ocip->query(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence te_view_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0));
+	view->id(index);
+	delete ocip;
+
+	int size = view->size();
+
+	for (int th=0; th<size; th++)
+	{
+		TeViewNode* node = view->get(th);
+		if (node->type() == TeTHEME)
+		{
+			TeTheme *theme = (TeTheme*) node;
+			insertTheme (theme);
+		}
+		else
+		{
+			TeViewTree* tree = (TeViewTree*)node;
+			insertViewTree (tree);
+		}
+	}
+
+	// Insert view in the view map
+	viewMap()[view->id()] = view;
+	return true;
+}
+
+bool
+TeOCIOracle::insertViewTree (TeViewTree *tree)
+{
+	
+	string ins = "INSERT INTO te_theme (theme_id, view_id, name, ";
+	ins += " parent_id, node_type, priority) VALUES (";
+	ins += " te_theme_seq.NEXTVAL";
+	ins += ", " + Te2String(tree->view());
+	ins += ", '" + escapeSequence(tree->name()) + "'";
+	ins += ", " + Te2String(tree->parentId());
+	ins += ", " + Te2String(tree->type());
+	ins += ", " + Te2String(tree->priority());
+	ins += ")";
+	
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_theme!";
+		return false;
+	}
+
+	TeOCIOraclePortal	*ocip = (TeOCIOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT te_theme_seq.CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		errorMessage_ = "Error in the sequence te_theme_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0)); 
+	tree->id(index);
+	delete ocip;
+	
+	return true;
+}
+
+string TeOCIOracle::concatValues(vector<string>& values, const string& unionString)
+{
+	string concat = "";
+	
+	for(unsigned int i = 0; i < values.size(); ++i)
+	{
+		if(i != 0)
+		{
+			concat += " || ";
+
+			if(!unionString.empty())
+			{
+				concat += "'";
+				concat += unionString;
+				concat += "'";
+				concat += " || ";
+			}
+		}
+
+		concat += values[i];
+	}
+
+	return concat;
+}
+
+bool TeOCIOracle::getAttributeList(const string& tableName,TeAttributeList& attList)
+{
+	string sql = " SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_SCALE ";
+	sql += " FROM USER_TAB_COLUMNS WHERE TABLE_NAME = '";
+	sql += TeConvertToUpperCase(tableName) +"'";
+	
+	attList.clear();
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	
+	while(portal->fetchRow())
+	{
+		TeAttribute at;
+		at.rep_.name_ = portal->getData(0);
+		string type = TeConvertToUpperCase(portal->getData(1));
+		int scale = portal->getInt(3);
+		if((type=="NUMBER" && scale>0) || (type=="FLOAT"))
+	        at.rep_.type_ = TeREAL;
+		else if(type=="NUMBER")
+			at.rep_.type_ = TeINT;
+		else if(type=="VARCHAR2")
+		{
+			at.rep_.type_ = TeSTRING;
+			at.rep_.numChar_=portal->getInt(2);
+		}
+		else if(type=="BLOB")
+			at.rep_.type_ = TeBLOB;
+		else if(type=="CHAR")
+			at.rep_.type_ = TeCHARACTER;
+		else if(type=="DATE")
+			at.rep_.type_ = TeDATETIME;
+		else 
+		{
+			at.rep_.type_ = TeSTRING;
+			at.rep_.numChar_=portal->getInt(2);
+		}
+		attList.push_back(at);
+	}
+	delete portal;
+	return true;
+}
+
+string TeOCIOracle::toUpper(const string& value)
+{
+	string result  = "upper(";
+	       result += value;
+		   result += ")";
+
+	return result;
+}
+
+string  
+TeOCIOracle::getSQLTime(const TeTime& time) const
+{
+	string dateTime = time.getDateTime();	
+	string result;
+	result = "TO_DATE('";
+	result += dateTime;
+	result += "  ";
+	result += "','DD/MM/YYYY HH24:MI:SS')"; 
+	return result;
+}
+
+
+bool
+TeOCIOracle::getIndexesFromTable(const string& tableName, std::vector<TeDatabaseIndex>& vecIndexes)
+{
+	std::vector<TeDatabaseIndex> indexes;
+
+	string query = "select index_name, column_name from ALL_IND_COLUMNS  where table_name = '"+tableName+"' ";
+	query += "and index_name not like ( select constraint_name from ALL_CONSTRAINTS "; 
+	query += "where table_name = '"+tableName+"' and constraint_type = 'P') order by index_name";
+		
+	TeDatabasePortal* portal = getPortal();
+
+	std::vector<std::string> names;
+	std::vector<std::string> cols;
+
+	std::set<std::string> idxNames;
+
+	std::multimap<std::string, std::string> idxAttrs;
+	
+	if(portal->query(query))
+	{
+		while(portal->fetchRow())
+		{
+			std::string idxName = portal->getData("index_name");
+			std::string attrName = portal->getData("column_name");
+
+			idxAttrs.insert(std::pair<std::string, std::string>(idxName, attrName));
+			
+			idxNames.insert(idxName);
+		}		
+
+	}else
+	{
+		delete portal;
+		return false;
+	}
+
+	portal->freeResult();
+
+	delete portal;
+	portal =  NULL;
+
+	std::set<std::string>::iterator it = idxNames.begin();
+	while(it != idxNames.end())
+	{
+		std::string idxName = *it;
+
+		TeDatabaseIndex idxx;
+		idxx.setIndexName(idxName);
+		idxx.setIsPrimaryKey(false);
+		
+		std::vector<string> attNames;
+		std::pair<std::multimap<std::string, std::string>::iterator, std::multimap<std::string, std::string>::iterator> itAttrs = idxAttrs.equal_range(idxName);
+		std::multimap<std::string, std::string>::iterator itA;
+		for (itA=itAttrs.first; itA!=itAttrs.second; ++itA)
+		{
+			std::string attrName = itA->second;
+			attNames.push_back(attrName);
+		}
+
+		idxx.setColumns(attNames);
+
+		indexes.push_back(idxx);
+
+		++it;
+	}	
+
+	vecIndexes = indexes;	
+
+	return true;
+}
+
+
+//---------------------------------- Oracle portal
+
+TeOCIOraclePortal::TeOCIOraclePortal(TeOCIOracle *pDatabase) 
+{
+	cursor_ = new TeOCICursor(pDatabase->connection_);
+	db_ = pDatabase;
+	numRows_ = 0;
+	numFields_ = 0;
+	curRow_ = 0;
+}
+
+
+TeOCIOraclePortal::~TeOCIOraclePortal () 
+{
+	if(cursor_)
+		delete cursor_;
+	cursor_ = NULL;
+}
+
+
+bool TeOCIOraclePortal::isConnected()
+{
+	return (cursor_->conn()->isConnected());
+}
+
+
+bool TeOCIOraclePortal::isEOF() 
+{
+	if (!isConnected())
+		return true;
+
+	return false;
+}
+
+bool
+TeOCIOraclePortal::getLinearRing (TeLine2D& line)
+{
+
+	double	*points	= NULL;
+	try
+	{
+		int index = atoi (getData ("geom_id"));
+		TeBox b (getDouble("lower_x"),getDouble("lower_y"),getDouble("upper_x"),getDouble("upper_y"));
+		line.objectId (string (getData ("object_id")));
+		line.geomId (index);
+		line.setBox (b);
+
+		unsigned int ncoords = getInt("num_coords");
+		unsigned int nords = ncoords*2;
+			
+		if (!cursor_->readBlob(&points))
+			return false;
+		
+		line.clear();
+
+		for (unsigned int i=0;i<nords;++i) 
+		{
+			double x = points[i];
+			++i;
+			double y = points[i];
+			
+			TeCoord2D c = TeCoord2D(x,y);
+			line.add(c);
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error getting media!";
+		return false;
+	}
+	return true;
+}
+
+bool
+TeOCIOraclePortal::getLinearRing (TeLine2D& line, const unsigned int& initIndex)
+{
+	double	*points	= NULL;
+	try
+	{
+		line.objectId (string (getData (initIndex+1)));
+		line.geomId (atoi (getData(initIndex)));
+		
+		unsigned int ncoords = getInt(initIndex+2);
+		unsigned int nords = ncoords*2;
+			
+		if (!cursor_->readBlob(&points))
+			return false;
+		
+		line.clear();
+
+		for (unsigned int i=0;i<nords;++i) 
+		{
+			double x = points[i];
+			++i;
+			double y = points[i];
+			
+			TeCoord2D c = TeCoord2D(x,y);
+			line.add(c);
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error getting media!";
+		return false;
+	}
+	return true;
+}
+
+
+bool
+TeOCIOraclePortal::moveFirst() 
+{
+	if (cursor_->moveFirst())
+		return true;
+	else
+		return false;
+}
+
+
+bool 
+TeOCIOraclePortal::moveNext() 
+{
+	if(cursor_->moveNext())
+		return true;
+	return false;
+}
+
+bool TeOCIOraclePortal::query (const string &q,TeCursorLocation /* l */ , TeCursorType /* t */, TeCursorEditType /* e */, TeCursorDataType /* dt */)  //Ok
+{
+	errorMessage_.clear ();
+
+	if (!cursor_->isOpen())
+	{
+		if(!cursor_->open())
+		{
+			numRows_ = 0;
+			return false;
+		}
+	}
+
+	if (!cursor_->query(q))
+	{
+		this->errorMessage_ = cursor_->getErrorMessage();
+		numRows_ = 0;
+		return false;
+	}
+	
+	numFields_= this->cursor_->numCol();
+
+	attList_.clear ();
+	int i;
+	for(i = 1; i <= numFields_ ; i++)
+	{
+		TeAttribute attribute;
+
+		switch (cursor_->colType(i))
+		{
+			case 3: //INTEGER
+				attribute.rep_.type_ = TeINT;
+			break;
+
+			case 2:  //NUMBER
+			case 4: //FLOAT DOUBLE
+				attribute.rep_.type_ = TeREAL;
+			break;
+
+			case 12: //Date
+			attribute.rep_.type_ = TeDATETIME;
+			attribute.dateChronon_ = TeSECOND;
+			attribute.dateTimeFormat_ = "DD/MM/YYYY HH24:MI:SS";
+			break;
+
+			case 113: //Blob
+			attribute.rep_.type_ = TeBLOB;
+			break;
+
+			case 96: //CHAR
+			case 9: //VARCHAR:
+			case 1: //VARCHAR2:
+			attribute.rep_.type_ = TeSTRING;
+			break;
+
+			case 108: //OBJECT: // SDO_GEOMETRY
+			attribute.rep_.type_ = TeOBJECT;
+			break;
+			default :
+			attribute.rep_.type_ = TeUNKNOWN;
+			break;
+		} 
+		
+		//attribute.rep_.name_ = TeConvertToLowerCase(cursor_->ColName(i)); 
+		attribute.rep_.name_ = cursor_->colName(i); 
+		attribute.rep_.numChar_ = cursor_->colSize(i);
+		attList_.push_back ( attribute );
+	}
+	curRow_=-1;
+	return true;
+}
+
+
+void TeOCIOraclePortal::freeResult () 
+{
+	cursor_->freeResult();
+}
+
+
+bool TeOCIOraclePortal::fetchRow () 
+{
+	try
+	{	
+		if( !isConnected() )
+			return false;
+		if( numFields_ == 0)
+			return false;
+		
+		if (curRow_ == -1)
+		{
+			if(moveFirst())
+				curRow_++;
+			else
+				return false;
+		}
+		else
+		
+		if (moveNext())
+		{
+			curRow_++;
+			return true;
+		}
+		else
+			return false;
+	}
+	
+	catch(...) //_com_error &e)
+	{
+		return false;
+	}
+
+	return true;
+}
+
+bool TeOCIOraclePortal ::fetchRow (int i)
+{
+	try
+	{	
+		if( !isConnected() || (numFields_ == 0))
+			return false;
+		
+		if (curRow_ == -1)
+		{
+			if(moveFirst())
+				curRow_++;
+			else
+				return false;
+		}
+
+		if(curRow_ == i)
+			return true;
+
+		if (cursor_->moveTo(i))
+		{
+			curRow_ = cursor_->currentRow();
+			return true;
+		}
+		return false;
+	}
+	catch(...)
+	{
+		return false;
+	}
+}
+
+char* TeOCIOraclePortal::getData (int i) 
+{
+	char* result;
+	if (i > numFields_ || i < 0)
+		return "";
+	
+	try
+	{
+		result = cursor_->getFieldValue(i+1);
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error!";
+		return "";
+	}
+	return result;
+	
+}
+
+char* TeOCIOraclePortal::getData (const string &s)
+{
+	char* result;
+
+	string fieldName;
+	size_t pos = s.find(".", 0, 1);
+	if (pos != string::npos)
+		fieldName = s.substr(pos+1);
+	else
+		fieldName = s;
+
+	int index = getColumnIndex (fieldName);
+	if(index == -1)
+		return "";
+	else
+		result = getData(index);
+
+	return result;
+}
+
+
+int TeOCIOraclePortal::getInt (int i) 
+{
+	int value = atoi(getData(i));
+	return value;
+}
+
+int  
+TeOCIOraclePortal::getInt (const string& s)
+{
+	int value = atoi(getData(s));
+	return value;
+}
+
+double TeOCIOraclePortal ::getDouble (int i) 
+{
+	string strValue=getData(i);
+	size_t find;
+	find = strValue.find(",");
+	if(find<strValue.size())
+		strValue.replace(find, 1, ".");
+		
+	return atof(strValue.c_str());
+}
+
+double  
+TeOCIOraclePortal::getDouble (const string& s)
+{
+	string strValue=getData(s);
+	size_t find;
+	find = strValue.find(",");
+	if(find<strValue.size())
+		strValue.replace(find, 1, ".");
+	
+	return atof(strValue.c_str());
+}
+
+
+bool
+TeOCIOraclePortal::getBool(int i)
+{
+	char* fieldChar=0;
+	
+	fieldChar = cursor_->getFieldValue(i+1);
+	if(fieldChar == 0)
+		return false;
+	
+	return true;
+}
+
+
+bool    
+TeOCIOraclePortal::getBool (const string& s)
+{
+	string fieldName;
+	size_t pos = s.find(".", 0, 1);
+	if (pos != string::npos)
+		fieldName = s.substr(pos+1);
+	else
+		fieldName = s;
+
+	int index = getColumnIndex (fieldName);
+	if(index == -1)
+		return false;
+	return (getBool(index));
+}
+
+bool		
+TeOCIOraclePortal::getBlob(const string& s, unsigned char* &data, long& size)
+{
+	try
+	{
+		unsigned int len = cursor_->getBlobSize(s);
+		data = new unsigned char[len];
+		if(!cursor_->readBlob(data, len, s))
+			return false;
+		size = len;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error getting media!";
+		return false;
+	}
+	return false;
+}
+
+TeTime 
+TeOCIOraclePortal::getDate (int i) 
+{ 
+	TeTime temp;
+	string result;
+
+	if (i > numFields_ || i < 0)
+		return temp;
+	
+	try
+	{
+		result = cursor_->getFieldValue(i+1);
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error!";
+		return temp;
+	}
+		
+	TeTime t(result, TeSECOND, "DDsMMsYYYYsHHsmmsSS");
+	return t;
+}
+	
+
+TeTime 
+TeOCIOraclePortal::getDate (const string& s) 
+{ 
+	string  result;
+	TeTime temp;
+
+	string fieldName;
+	size_t pos = s.find(".", 0, 1);
+	if (pos != string::npos)
+		fieldName = s.substr(pos+1);
+	else
+		fieldName = s;
+
+	int index = getColumnIndex (fieldName);
+	if(index == -1)
+		return temp;
+	else
+		result = getData(index);
+
+	TeTime t(result, TeSECOND, "DDsMMsYYYYsHHsmmsSS") ;
+	return t;
+}
+
+string
+TeOCIOraclePortal::getDateAsString(int i)
+{
+	TeTime t = this->getDate(i);
+	string date = t.getDateTime ();
+
+	if (!date.empty())
+	{		string tval = " TO_DATE ('"+ date +"','DDsMMsYYYYsHHsmmsSS') ";
+		return tval;
+	}
+	else
+		return "";
+}
+
+string 
+TeOCIOraclePortal::getDateAsString(const string& s)
+{
+	TeTime t = this->getDate(s);
+	string date = t.getDateTime ();
+
+	if (!date.empty())
+	{		string tval = " TO_DATE ('"+ date +"','DDsMMsYYYYsHHsmmsSS') ";
+		return tval;
+	}
+	else
+		return "";
+}
+
+
+bool
+TeOCIOraclePortal::fetchGeometry (TePolygon& poly)
+{
+	try 
+	{
+		TeLine2D line;
+		int numHoles = atoi(this->getData("num_holes"));
+		bool flag = this->fetchGeometry(line);
+
+		TeLinearRing ring(line);
+		poly.objectId ( ring.objectId());
+		poly.geomId ( ring.geomId() );
+		poly.add ( ring );
+		int parentId = poly.geomId();
+
+		while (flag && numHoles>0 && (atoi(this->getData("parent_id")) == parentId)) // get holes
+		{
+			TeLine2D aux;
+			this->getLinearRing(aux);
+			TeLinearRing hole(aux);
+			poly.add (hole);
+			flag = this->fetchRow();
+		}
+		return flag;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+}
+
+bool
+TeOCIOraclePortal::fetchGeometry (TePolygon& poly, const unsigned int& initIndex)
+{
+	try 
+	{
+		TeLine2D line;
+		int numHoles = atoi(this->getData(initIndex+3));
+		getLinearRing(line, initIndex);
+		bool flag = this->fetchRow();
+		
+		TeLinearRing ring(line);
+		poly.objectId ( ring.objectId());
+		poly.geomId ( ring.geomId() );
+		poly.add ( ring );
+		int parentId = poly.geomId();
+
+		while (flag && numHoles>0 && (atoi(this->getData(initIndex+4)) == parentId)) // get holes
+		{
+			TeLine2D aux;
+			this->getLinearRing(aux, initIndex);
+			TeLinearRing hole(aux);
+			poly.add (hole);
+			flag = this->fetchRow();
+		}
+		return flag;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+}
+
+bool 
+TeOCIOraclePortal::fetchGeometry (TeLine2D& line)
+{	
+	try
+	{
+		getLinearRing(line);
+		return (this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool 
+TeOCIOraclePortal::fetchGeometry (TeLine2D& line, const unsigned int& initIndex)
+{	
+	try
+	{
+		getLinearRing(line, initIndex);
+		return (this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+
+bool 
+TeOCIOraclePortal::fetchGeometry(TePoint& p)
+{
+
+	try 
+	{
+		p.geomId( atoi(getData("geom_id")));
+		p.objectId( string(getData("object_id")));
+		double x = getDouble("x");
+		double y = getDouble("y");
+		TeCoord2D c(x, y);
+		p.add(c);
+		return(this->fetchRow());
+	} 
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+}
+
+bool 
+TeOCIOraclePortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
+{
+	try 
+	{
+		p.geomId( atoi(getData(initIndex)));
+		p.objectId( string(getData(initIndex+1)));
+		double x = getDouble(initIndex+2);
+		double y = getDouble(initIndex+3);
+		TeCoord2D c(x, y);
+		p.add(c);
+		return(this->fetchRow());
+	} 
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+}
+
+bool 
+TeOCIOraclePortal::fetchGeometry(TeNode& n)
+{
+	try 
+	{
+		TeCoord2D c(getDouble("x"), getDouble("y"));
+		n.geomId( atol(getData("geom_id")));
+		n.objectId( string(getData("object_id")));
+		n.add(c);
+		return(this->fetchRow());
+	} 
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOCIOraclePortal::fetchGeometry(TeNode& n, const unsigned int& initIndex)
+{
+	try 
+	{
+		TeCoord2D c(getDouble(initIndex+2), getDouble(initIndex+3));
+		n.geomId( atol(getData(initIndex)));
+		n.objectId( string(getData(initIndex+1)));
+		n.add(c);
+		return(this->fetchRow());
+	} 
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+	return true;
+}
+
+bool
+TeOCIOraclePortal::getRasterBlock(unsigned long& size, unsigned char* ptData)
+{
+	// gets the spatial data
+	// expects that the data size will be a block of double maximum
+	try
+	{
+		unsigned int len = 0;
+		if(!getCursor()->readBlob(ptData, len, "spatial_data"))
+			return false;
+		size = len;
+	}
+	catch(...)
+	{
+		size = 0;
+		errorMessage_ = "ERRO!";
+		return false;
+	}
+	return true;
+}
+
+
+
+
diff --git a/src/terralib/drivers/Oracle/TeOCIOracle.h b/src/terralib/drivers/Oracle/TeOCIOracle.h
new file mode 100644
index 0000000..aa6f98e
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOCIOracle.h
@@ -0,0 +1,352 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright ? 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeOCIOracle.h
+    \brief This file contains two classes that represent a driver of interface between TerraLib and ORACLE DBMS, using OCI (Oracle Call Interface) library.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_ORACLEOCI_H
+#define  __TERRALIB_INTERNAL_ORACLEOCI_H
+
+#include "TeOCIConnect.h"
+#include "TeOCICursor.h"
+#include <TeDatabase.h>
+#include <TeDatabaseFactory.h>
+
+#include <TeDatabaseIndex.h>
+
+#include "TeOracleDefines.h"
+
+#ifdef AFX_DLL
+#define EXPORT_WIN __declspec( dllexport )
+#else
+#define EXPORT_WIN
+#endif
+
+/*! \class TeOCIOracle
+	\brief A concrete implementation of a interface driver to the ORACLE DBMS
+
+	This class contains attributes and methods to implement a driver of interface 
+	between TerraLib and ORACLE DBMS using OCI (Oracle Call Interface) library.
+	The class TeOCIOracle implements the abstract interface defined by the class
+	TeDatabase.
+
+	\sa 
+	TeDatabase TeOCIConnect
+*/
+class TLORACLE_DLL TeOCIOracle : public TeDatabase
+{
+
+friend class TeOCIOraclePortal;
+
+protected:
+
+	TeOCIConnection*	connection_;	//!< pointer to a opened connection to ORACLE database server  
+	long				sequenceCont_;	//!< sequential number used to improve the data insertion
+	string				sequenceName_;  //!< sequence name used to improve the data insertion
+
+	//! Creates a internal sequence structure in the Oracle DBMS 
+	bool	createSequence(const string &seqName);
+
+	//! Creates a internal trigger structure in the Oracle DBMS
+	bool	createAutoIncrementTrigger(const string &tableName, const string &fieldName);
+	
+	//! Returns the sequence name created to a specific table 
+	string	getNameSequence(const string &tableName);
+
+	//! Returns the trigger name created to a specific table 
+	string  getNameTrigger(const string &tableName);
+
+public:
+	
+	//! Constructor
+	TeOCIOracle();
+
+	//! Destructor
+	~TeOCIOracle();
+
+	//! Escapes special characters in a string to be used in a SQL statement
+	string  escapeSequence(const string& from); 
+
+	//! Begins a transaction
+	bool beginTransaction(); 
+
+	//! Commits a transaction
+	bool commitTransaction();
+
+	//! Rollbacks a transaction
+	bool rollbackTransaction();
+	  
+	//! Connects to a Oracle DBMS and creates the TerraLib conceptual data model
+	virtual bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port=0, bool terralibModel=true, const std::string& characterSet = ""); 
+
+	//! Connects to a Oracle DBMS
+	virtual bool connect (const string& host, const string& user, const string& password, const string& database, int port = 0);
+	
+	//! Lists all tables in the database
+	bool listTables(vector<string>& tableList);
+
+	//! Closes the connection to a Oracle DBMS
+	void  close();
+
+	//! Verify if there is a specific table in the database
+	bool tableExist(const string& table);
+
+	//! Verify if there is a specific view in the database
+	bool viewExist(const string& view);
+
+	//! Verify if there is a specific column in a table 
+	bool columnExist(const string& table, const string& column, TeAttribute& attr);
+
+	//! Creates a new table
+	virtual bool createTable (const string& table, TeAttributeList &attr);
+
+	//! Adds a new column in a table
+	bool addColumn (const string& table,TeAttributeRep &rep);
+
+	//! Deletes a specific table
+	bool deleteTable (const string& table);
+
+	//! Executes a SQL statement that does not return rows (INSERT, UPDATE, CREATE, etc.)
+	bool execute (const string &sql);
+	
+	//! Gets a cursor or record set using the opened connection 
+	virtual TeDatabasePortal* getPortal();
+
+	//! Verify if there is a relation associated to a specific table
+	TeDBRelationType existRelation(const string& tableName, const string& relName);
+
+	//! Creates a new relation between two tables
+	bool createRelation (const string& name, const string& table, const string& fieldName, const string& relatedTable, const string& relatedField, bool cascadeDeletion);
+		
+	//! Return a TeDatabaseIndex vector from a table
+	virtual bool getIndexesFromTable(const string& tableName, std::vector<TeDatabaseIndex>& vecIndexes);
+
+
+	/** @name Inserts, updates and deletes geometries from the tables
+	*/
+	//@{ 	
+	bool insertTableInfo (int layerId, TeTable &table, const string& user="");
+	bool insertRelationInfo(const int tableId, const string& tField, const string& rName, const string& rField, int& relId);
+	bool alterTable (const string& table, TeAttributeRep &rep, const string& oldColName);
+	bool alterTable (const string& oldTableName, const string& newTablename);
+	bool insertTable	(TeTable &table);
+	bool updateTable	(TeTable &table);
+	bool insertProjection (TeProjection *proj);
+	bool insertRepresentation (int layerId, TeRepresentation& rep);
+	bool insertLegend	(TeLegendEntry *legend);	
+	bool insertView		(TeView *view);	
+	bool insertViewTree (TeViewTree *tree);	
+	bool insertTheme		(TeAbstractTheme *theme);
+	bool insertThemeTable	(int themeId, int tableId, int relationId, int tableOrder);
+	bool insertThemeGroup	(TeViewTree* tree);
+	bool insertLayer	(TeLayer *layer);	
+	bool insertProject	(TeProject *project);	
+	bool deleteLayer	(int layerId);
+	//@}
+
+	//! Generates label positions to each object of a theme
+	virtual bool generateLabelPositions	(TeTheme *theme, const std::string& objectId = ""); 
+
+	/** @name Inserts, updates and deletes geometry tables
+	*/
+	//@{ 	
+	bool getValueSequence(const string& table);
+	virtual bool insertPolygonSet(const string& table, TePolygonSet &ps);
+	virtual bool insertPolygon		(const string& table, TePolygon &p);	
+	virtual bool updatePolygon		(const string& table, TePolygon &p);
+	virtual bool insertLineSet(const string& table, TeLineSet &ls);
+	virtual bool insertLine (const string& table, TeLine2D &l);	
+	virtual bool updateLine		(const string& table, TeLine2D &l);
+	virtual bool insertPoint	(const string& table, TePoint &p);	
+	virtual bool insertText		(const string& table, TeText &t);
+	virtual bool insertArc	(const string& table,TeArc &arc);
+	virtual bool insertNode		(const string& table, TeNode &node);	
+	virtual bool insertCell		(const string& table, TeCell &c);
+	virtual bool insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char *buf,unsigned long size, int band=0, unsigned int res=1, unsigned int subband=0);
+	//@}
+
+	/** @name Methods to deal with large binary objects (BLOB)
+	*/
+	//@{ 	 
+	bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size);
+	//@}
+
+	/** @name Methods that return specific SQL statement according to each DBMS
+	*/
+	//@{ 
+	string getSQLStatistics (TeGroupingAttr& attrs);
+	string  getSQLAutoNumber(const string& table);
+	string  getSQLTime(const TeTime& time) const;
+	string toUpper(const string& value);
+	//@}
+
+	//! Concats values in a vector using unionString as the join between each value
+	string concatValues(vector<string>& values, const string& unionString);
+
+	//! Gets the list of attributes of a table
+	virtual bool getAttributeList(const string& tableName,TeAttributeList& attList);
+};
+
+
+/*!	\class TeOCIOraclePortal
+	\brief A class that implements a concept of record set to a ORACLE DBMS
+
+	This class is part of the driver of interface 
+	between TerraLib and ORACLE DBMS. It was developed using OCI (Oracle Call Interface) library.
+	The class TeOCIOraclePortal implements the abstract interface defined by the class
+	TeDatabasePortal.
+
+	\sa 
+	TeDatabasePortal TeOCICursor
+*/
+class TLORACLE_DLL TeOCIOraclePortal : public TeDatabasePortal
+{
+protected:
+	TeOCICursor		*cursor_;	//!< pointer to a record set  
+	long			curRow_;	//!< current row index in the record set
+
+    //! Verify if there is a connection associated to this cursor
+	bool isConnected();		
+    
+	//! Verify if the current row is the last of the record set
+	bool isEOF();
+
+	//! Gets a linear ring from blob type
+	bool getLinearRing (TeLine2D& line);
+	//! Gets a linear ring that begins in the i-th portal position from blob type
+	bool getLinearRing (TeLine2D& line, const unsigned int& i);
+
+public:
+
+	//! Constructor
+	TeOCIOraclePortal(TeOCIOracle *pDatabase);
+	
+	//! Destructor
+	virtual ~TeOCIOraclePortal();
+
+	//! Returns a pointer to the record set
+	TeOCICursor* getCursor() { return cursor_; }
+
+    //! Moves to the first row in the record set
+	bool moveFirst();
+
+	//! Moves to the next row in the record set
+    bool moveNext();
+
+	//! Executes a SQL statement that return rows or records (SELECT ...)
+	bool query ( const string &q,TeCursorLocation l = TeSERVERSIDE, TeCursorType t = TeUNIDIRECTIONAL, TeCursorEditType e = TeREADONLY, TeCursorDataType dt = TeTEXTCURSOR );
+
+	//! Fetchs to next row
+	bool fetchRow ();
+
+	//! Fetchs to i-th row
+	bool fetchRow (int i);
+
+	//! Clear all memory located by the record set
+	void freeResult();
+
+	/** @name Methods that get values from record set
+	*/
+	//@{ 
+	char* getData (int i);
+	char* getData (const string& s);
+	double getDouble (int i);
+	double getDouble (const string& s);
+	int	getInt (int i);
+	int	getInt (const string& s);
+	bool getBool (const string& s);
+	bool getBool (int i);
+	bool getBlob(const string& s, unsigned char* &data, long& size);
+	TeTime getDate (int i);
+	TeTime getDate (const string& s);
+	string getDateAsString(int i);
+	string getDateAsString(const string& s);
+	//@}
+
+	/** @name Methods that return a geometry from the record set current row and fetch to next row
+	*/
+	//@{ 
+	virtual bool fetchGeometry (TePolygon& poly);
+	virtual bool fetchGeometry (TeLine2D& line);
+	virtual bool fetchGeometry (TePoint& p);
+    virtual bool fetchGeometry (TeNode& n);
+	virtual bool fetchGeometry (TePolygon& poly, const unsigned int& initIndex);
+	virtual bool fetchGeometry (TeLine2D& line, const unsigned int& initIndex);
+	virtual bool fetchGeometry (TePoint& p, const unsigned int& initIndex);
+    virtual bool fetchGeometry (TeNode& n, const unsigned int& initIndex);
+	//@}
+
+	//! Gets a raster geometry block 
+	bool getRasterBlock(unsigned long& size, unsigned char*);
+};
+
+
+/**
+ * @brief This is the class for TeOCIOracle driver factory.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup DatabaseUtils
+ */
+class TLORACLE_DLL TeOCIOracleFactory : public TeDatabaseFactory
+{
+  public :
+      
+    /**
+     * Default constructor
+     */
+    TeOCIOracleFactory() : TeDatabaseFactory( std::string( "OracleOCI" ) ) {};      
+      
+    /**
+     * Default Destructor
+     */
+    ~TeOCIOracleFactory() {};
+      
+  protected :  
+  
+    /**
+     * Implementation for the abstract TeFactory::build.
+     *
+     * @param arg A const reference to the parameters used by the
+     * database.
+     * @return A pointer to the new generated database instance.
+     */
+    TeDatabase* build( const TeDatabaseFactoryParams& arg )
+    {
+      TeOCIOracle* instance_ptr = new TeOCIOracle();
+      
+      if( arg.host_ != "" ) {
+        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
+          arg.database_, arg.port_ );
+      }
+  
+      return (TeDatabase*)instance_ptr;
+    }
+};
+
+namespace {
+  static TeOCIOracleFactory TeOCIOracleFactory_instance;
+}; 
+
+#endif 
+
+
+
diff --git a/src/terralib/drivers/Oracle/TeOCISDO.cpp b/src/terralib/drivers/Oracle/TeOCISDO.cpp
new file mode 100644
index 0000000..0aa8bdb
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOCISDO.cpp
@@ -0,0 +1,3097 @@
+/*	Delegate OCI calls -- Ran Wei, Oracle SDO, 9/10/1998
+	Copyright 1998, Oracle Corp. */
+
+
+
+#include <oci.h>
+#include <TeOCISDO.h>
+
+//extern "C"
+//{
+//	#include <oci.h>
+//	#include "sdo_oci.h"
+//}
+
+
+
+
+
+/********************************************************************************/
+
+/* Part I -- OCI fundamental interfaces                                         */
+
+/********************************************************************************/
+
+/*
+Note: OCIEnvCreate() should be used instead of the
+OCIInitialize() and OCIEnvInit() calls.
+OCIInitialize() and OCIEnvInit() calls will be supported
+for backward compatibility.
+*/
+
+sword SDO_OCIEnvCreate(OCIEnv **envhpp, ub4 mode, dvoid *ctxp, 
+
+						 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+
+						dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+
+						void (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+						
+						size_t xtramensz, dvoid **usrmempp)
+
+{
+
+	return OCIEnvCreate (envhpp, mode, ctxp, malocfp, ralocfp,  mfreefp, xtramensz, usrmempp);
+}
+
+
+
+sword SDO_OCIInitialize(ub4 mode, dvoid *ctxp, 
+
+						dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+
+						dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+
+						void (*mfreefp)(dvoid *ctxp, dvoid *memptr))
+
+{
+
+	return OCIInitialize(mode, ctxp, malocfp, ralocfp, mfreefp);
+
+}
+
+
+
+sword SDO_OCIHandleAlloc(CONST dvoid *parenth, dvoid **hndlpp, ub4 type, 
+
+						 size_t xtramem_sz, dvoid **usrmempp)
+
+{
+
+	//aloca todas as handles do ambiente passado como parametro
+	return OCIHandleAlloc(parenth, hndlpp, type, xtramem_sz, usrmempp);
+
+}
+
+
+
+sword SDO_OCIHandleFree(dvoid *hndlp, ub4 type)
+
+{
+
+	return OCIHandleFree(hndlp, type);
+
+}
+
+
+
+sword SDO_OCIDescriptorAlloc(CONST dvoid *parenth, dvoid **descpp, ub4 type,
+
+							 size_t xtramem_sz, dvoid **usrmempp)
+
+{
+
+	return OCIDescriptorAlloc(parenth, descpp, type, xtramem_sz, usrmempp);
+
+}
+
+
+
+sword SDO_OCIDescriptorFree(dvoid *descp, ub4 type)
+
+{
+
+	return OCIDescriptorFree(descp, type);
+
+}
+
+
+
+sword SDO_OCIEnvInit(OCIEnv **envp, ub4 mode, size_t xtramem_sz, 
+
+					 dvoid **usrmempp)
+
+{
+
+	return OCIEnvInit(envp, mode, xtramem_sz, usrmempp);
+
+}
+
+
+
+sword SDO_OCIServerAttach(OCIServer *srvhp, OCIError *errhp,
+
+						  CONST text *dblink, sb4 dblink_len, ub4 mode)
+
+{
+
+	return OCIServerAttach(srvhp, errhp, dblink, dblink_len, mode);
+
+}
+
+
+
+sword SDO_OCIServerDetach(OCIServer *srvhp, OCIError *errhp, ub4 mode)
+
+{
+
+	return OCIServerDetach(srvhp, errhp, mode);
+
+}
+
+
+
+sword SDO_OCISessionBegin(OCISvcCtx *svchp, OCIError *errhp, 
+
+						  OCISession *usrhp, ub4 credt, ub4 mode)
+
+{
+
+	return OCISessionBegin(svchp, errhp, usrhp, credt, mode);
+
+}
+
+
+
+sword SDO_OCISessionEnd(OCISvcCtx *svchp, OCIError *errhp, 
+
+						OCISession *usrhp, ub4 mode)
+
+{
+
+	return OCISessionEnd(svchp, errhp, usrhp, mode);
+
+}
+
+
+
+sword SDO_OCILogon(OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp, 
+
+				   CONST text *username, ub4 uname_len, CONST text *password, 
+
+				   ub4 passwd_len, CONST text *dbname, ub4 dbname_len)
+
+{
+
+	return OCILogon(envhp, errhp, svchp, username, uname_len, password, 
+
+				    passwd_len, dbname, dbname_len);
+
+}
+
+
+
+sword SDO_OCILogoff(OCISvcCtx *svchp, OCIError *errhp)
+
+{
+
+	return OCILogoff(svchp, errhp);
+
+}
+
+
+
+sword SDO_OCIPasswordChange(OCISvcCtx *svchp, OCIError *errhp, 
+
+							CONST text *user_name, ub4 usernm_len, 
+
+							CONST text *opasswd, ub4 opasswd_len, 
+
+							CONST text *npasswd, ub4 npasswd_len, ub4 mode)
+
+{
+
+	return OCIPasswordChange(svchp, errhp, user_name, usernm_len, 
+
+							 opasswd, opasswd_len, npasswd, npasswd_len, mode);
+
+}
+
+
+
+sword SDO_OCIStmtPrepare(OCISvcCtx * /* svchp */, OCIStmt *stmtp, OCIError *errhp, CONST OraText *stmt,
+
+						 ub4 stmt_len, CONST OraText * /* key */, ub4 /* keylen */, ub4 language, ub4 mode)
+
+{
+	//return OCIStmtPrepare2 (svchp, stmtp, errhp, stmt, stmt_len, key, keylen, language, mode );
+	
+	return OCIStmtPrepare(stmtp, errhp, stmt, stmt_len, language, mode);
+}
+
+
+
+sword SDO_OCIBindByPos(OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
+
+					   ub4 position, dvoid *valuep, sb4 value_sz,
+
+					   ub2 dty, dvoid *indp, ub2 *alenp, ub2 *rcodep,
+
+					   ub4 maxarr_len, ub4 *curelep, ub4 mode)
+
+{
+
+	return OCIBindByPos(stmtp, bindp, errhp, position, valuep, value_sz,
+
+					    dty, indp, alenp, rcodep, maxarr_len, curelep, mode);
+
+}
+
+
+
+sword SDO_OCIBindByName(OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
+
+						CONST text *placeholder, sb4 placeh_len, 
+
+						dvoid *valuep, sb4 value_sz, ub2 dty, 
+
+						dvoid *indp, ub2 *alenp, ub2 *rcodep, 
+
+						ub4 maxarr_len, ub4 *curelep, ub4 mode)
+
+{
+
+	return OCIBindByName(stmtp, bindp, errhp, placeholder, placeh_len, 
+
+						 valuep, value_sz, dty, indp, alenp, rcodep, 
+
+						 maxarr_len, curelep, mode);
+
+}
+
+
+
+sword SDO_OCIBindObject(OCIBind *bindp, OCIError *errhp, CONST OCIType *type, 
+
+						dvoid **pgvpp, ub4 *pvszsp, dvoid **indpp, ub4 *indszp)
+
+{
+
+	return OCIBindObject(bindp, errhp, type, pgvpp, pvszsp, indpp, indszp);
+
+}
+
+
+
+sword SDO_OCIBindDynamic(OCIBind *bindp, OCIError *errhp, dvoid *ictxp,
+
+						 OCICallbackInBind icbfp, dvoid *octxp,
+
+						 OCICallbackOutBind ocbfp)
+
+{
+
+	return OCIBindDynamic(bindp, errhp, ictxp, icbfp, octxp, ocbfp);
+
+}
+
+
+
+sword SDO_OCIBindArrayOfStruct(OCIBind *bindp, OCIError *errhp, 
+
+                               ub4 pvskip, ub4 indskip, ub4 alskip, ub4 rcskip)
+
+{
+
+	return OCIBindArrayOfStruct(bindp, errhp, pvskip, indskip, alskip, rcskip);
+
+}
+
+
+
+sword SDO_OCIStmtGetPieceInfo(OCIStmt *stmtp, OCIError *errhp, 
+
+                              dvoid **hndlpp, ub4 *typep, ub1 *in_outp, 
+
+							  ub4 *iterp, ub4 *idxp, ub1 *piecep)
+
+{
+
+	return OCIStmtGetPieceInfo(stmtp, errhp, hndlpp, typep, in_outp, iterp, 
+
+							   idxp, piecep);
+
+}
+
+
+
+sword SDO_OCIStmtSetPieceInfo(dvoid *hndlp, ub4 type, OCIError *errhp, 
+
+                              CONST dvoid *bufp, ub4 *alenp, ub1 piece, 
+
+                              CONST dvoid *indp, ub2 *rcodep)
+
+{
+
+	return OCIStmtSetPieceInfo(hndlp, type, errhp, bufp, alenp, piece, 
+
+							   indp, rcodep);
+
+}
+
+
+
+sword SDO_OCIStmtExecute(OCISvcCtx *svchp, OCIStmt *stmtp, OCIError *errhp, 
+
+						 ub4 iters, ub4 rowoff, CONST OCISnapshot *snap_in, 
+
+						 OCISnapshot *snap_out, ub4 mode)
+
+{
+
+	return OCIStmtExecute(svchp, stmtp, errhp, iters, rowoff, snap_in, 
+
+						  snap_out, mode);
+
+}
+
+
+
+sword SDO_OCIDefineByPos(OCIStmt *stmtp, OCIDefine **defnp, OCIError *errhp,
+
+						 ub4 position, dvoid *valuep, sb4 value_sz, ub2 dty,
+
+						 dvoid *indp, ub2 *rlenp, ub2 *rcodep, ub4 mode)
+
+{
+
+	return OCIDefineByPos(stmtp, defnp, errhp, position, valuep, value_sz, dty,
+
+						  indp, rlenp, rcodep, mode);
+
+}
+
+
+
+sword SDO_OCIDefineObject(OCIDefine *defnp, OCIError *errhp, 
+
+                          CONST OCIType *type, dvoid **pgvpp, 
+
+                          ub4 *pvszsp, dvoid **indpp, ub4 *indszp)
+
+{	
+
+	return OCIDefineObject(defnp, errhp, type, pgvpp, pvszsp, indpp, indszp);
+
+}
+
+
+
+sword SDO_OCIDefineDynamic(OCIDefine *defnp, OCIError *errhp, dvoid *octxp,
+
+                           OCICallbackDefine ocbfp)
+
+{
+
+	return OCIDefineDynamic(defnp, errhp, octxp, ocbfp);
+
+}
+
+
+
+sword SDO_OCIDefineArrayOfStruct(OCIDefine *defnp, OCIError *errhp, ub4 pvskip,
+
+                                 ub4 indskip, ub4 rlskip, ub4 rcskip)
+
+{
+
+	return OCIDefineArrayOfStruct(defnp, errhp, pvskip, indskip, rlskip, rcskip);
+
+}
+
+
+
+sword SDO_OCIStmtFetch(OCIStmt *stmtp, OCIError *errhp, ub4 nrows, 
+
+                       ub2 orientation, ub4 mode)
+
+{
+
+	return OCIStmtFetch(stmtp, errhp, nrows, orientation, mode);
+
+}
+
+
+
+sword SDO_OCIStmtGetBindInfo(OCIStmt *stmtp, OCIError *errhp, ub4 size, 
+
+                             ub4 startloc, sb4 *found, text *bvnp[], ub1 bvnl[],
+
+                             text *invp[], ub1 inpl[], ub1 dupl[], OCIBind *hndl[])
+
+{
+
+	return OCIStmtGetBindInfo(stmtp, errhp, size, startloc, found, bvnp, bvnl,
+
+                              invp, inpl, dupl, hndl);
+
+}
+
+
+
+sword SDO_OCIDescribeAny(OCISvcCtx *svchp, OCIError *errhp, dvoid *objptr, 
+
+                         ub4 objnm_len, ub1 objptr_typ, ub1 info_level,
+
+						 ub1 objtyp, OCIDescribe *dschp)
+
+{
+
+	return OCIDescribeAny(svchp, errhp, objptr, objnm_len, objptr_typ, info_level,
+
+						  objtyp, dschp);
+
+}
+
+
+
+sword SDO_OCIParamGet(CONST dvoid *hndlp, ub4 htype, OCIError *errhp, 
+
+                      dvoid **parmdpp, ub4 pos)
+
+{
+
+	return OCIParamGet(hndlp, htype, errhp, parmdpp, pos);
+
+}
+
+
+
+sword SDO_OCIParamSet(dvoid *hdlp, ub4 htyp, OCIError *errhp, CONST dvoid *dscp,
+
+                      ub4 dtyp, ub4 pos)
+
+{
+
+	return OCIParamSet(hdlp, htyp, errhp, dscp, dtyp, pos);
+
+}
+
+
+
+sword SDO_OCITransStart(OCISvcCtx *svchp, OCIError *errhp, uword timeout, ub4 flags)
+
+{
+
+	return OCITransStart(svchp, errhp, timeout, flags);
+
+}
+
+
+
+sword SDO_OCITransDetach(OCISvcCtx *svchp, OCIError *errhp, ub4 flags)
+
+{
+
+	return OCITransDetach(svchp, errhp, flags);
+
+}
+
+
+
+sword SDO_OCITransCommit(OCISvcCtx *svchp, OCIError *errhp, ub4 flags)
+
+{
+
+	return OCITransCommit(svchp, errhp, flags);
+
+}
+
+
+
+sword SDO_OCITransRollback(OCISvcCtx *svchp, OCIError *errhp, ub4 flags)
+
+{
+
+	return OCITransRollback(svchp, errhp, flags);
+
+}
+
+
+
+sword SDO_OCITransPrepare(OCISvcCtx *svchp, OCIError *errhp, ub4 flags)
+
+{
+
+	return OCITransPrepare(svchp, errhp, flags);
+
+}
+
+
+
+sword SDO_OCITransForget(OCISvcCtx *svchp, OCIError *errhp, ub4 flags)
+
+{
+
+	return OCITransForget(svchp, errhp, flags);
+
+}
+
+
+
+sword SDO_OCIErrorGet(dvoid *hndlp, ub4 recordno, text *sqlstate,
+
+                      sb4 *errcodep, text *bufp, ub4 bufsiz, ub4 type)
+
+{
+
+	return OCIErrorGet(hndlp, recordno, sqlstate, errcodep, bufp, bufsiz, type);
+
+}
+
+
+
+sword SDO_OCILobAppend(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *dst_locp,
+
+                       OCILobLocator *src_locp)
+
+{
+
+	return OCILobAppend(svchp, errhp, dst_locp, src_locp);
+
+}
+
+
+
+sword SDO_OCILobAssign(OCIEnv *envhp, OCIError *errhp, CONST OCILobLocator *src_locp, 
+
+                       OCILobLocator **dst_locpp)
+
+{
+
+	return OCILobAssign(envhp, errhp, src_locp, dst_locpp);
+
+}
+
+
+
+sword SDO_OCILobCharSetForm(OCIEnv *envhp, OCIError *errhp, 
+
+							CONST OCILobLocator *locp, ub1 *csfrm)
+
+{
+
+	return OCILobCharSetForm(envhp, errhp, locp, csfrm);
+
+}
+
+
+
+sword SDO_OCILobCharSetId(OCIEnv *envhp, OCIError *errhp, 
+
+						  CONST OCILobLocator *locp, ub2 *csid)
+
+{
+
+	return OCILobCharSetId(envhp, errhp, locp, csid);
+
+}
+
+
+
+sword SDO_OCILobCopy(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *dst_locp,
+
+                     OCILobLocator *src_locp, ub4 amount, ub4 dst_offset, 
+
+                     ub4 src_offset)
+
+{
+
+	return OCILobCopy(svchp, errhp, dst_locp, src_locp, amount, dst_offset, 
+
+                      src_offset);
+
+}
+
+
+
+sword SDO_OCILobDisableBuffering(OCISvcCtx *svchp, OCIError *errhp,
+
+								 OCILobLocator *locp)
+
+{
+
+	return OCILobDisableBuffering(svchp, errhp, locp);
+
+}
+
+
+
+sword SDO_OCILobEnableBuffering(OCISvcCtx *svchp, OCIError *errhp,
+
+								OCILobLocator *locp)
+
+{
+
+	return OCILobEnableBuffering(svchp, errhp, locp);
+
+}
+
+
+
+sword SDO_OCILobErase(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+
+                      ub4 *amount, ub4 offset)
+
+{
+
+	return OCILobErase(svchp, errhp, locp, amount, offset);
+
+}
+
+
+
+sword SDO_OCILobFileClose(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *filep)
+
+{
+
+	return OCILobFileClose(svchp, errhp, filep);
+
+}
+
+
+
+sword SDO_OCILobFileCloseAll(OCISvcCtx *svchp, OCIError *errhp)
+
+{
+
+	return OCILobFileCloseAll(svchp, errhp);
+
+}
+
+
+
+sword SDO_OCILobFileExists(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *filep,
+
+						   boolean *flag)
+
+{
+
+	return OCILobFileExists(svchp, errhp, filep, flag);
+
+}
+
+
+
+sword SDO_OCILobFileGetName(OCIEnv *envhp, OCIError *errhp, 
+
+							CONST OCILobLocator *filep, text *dir_alias, 
+
+							ub2 *d_length, text *filename, ub2 *f_length)
+
+{
+
+	return OCILobFileGetName(envhp, errhp, filep, dir_alias, d_length, 
+
+							 filename, f_length);
+
+}
+
+
+
+sword SDO_OCILobFileIsOpen(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *filep,
+
+                           boolean *flag)
+
+{
+
+	return OCILobFileIsOpen(svchp, errhp, filep, flag);
+
+}
+
+
+
+sword SDO_OCILobFileOpen(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *filep,
+
+                         ub1 mode)
+
+{
+
+	return OCILobFileOpen(svchp, errhp, filep, mode);
+
+}
+
+
+
+sword SDO_OCILobFileSetName(OCIEnv *envhp, OCIError *errhp, OCILobLocator **filepp, 
+
+                            CONST text *dir_alias, ub2 d_length, 
+
+                            CONST text *filename, ub2 f_length)
+
+{
+
+	return OCILobFileSetName(envhp, errhp, filepp, dir_alias, d_length, 
+
+                             filename, f_length);
+
+}
+
+
+
+sword SDO_OCILobFlushBuffer(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+
+                            ub4 flag)
+
+{
+
+	return OCILobFlushBuffer(svchp, errhp, locp, flag);
+
+}
+
+
+
+sword SDO_OCILobGetLength(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+
+                          ub4 *lenp)
+
+{
+
+	return OCILobGetLength(svchp, errhp, locp, lenp);
+
+}
+
+
+
+sword SDO_OCILobIsEqual(OCIEnv *envhp, CONST OCILobLocator *x, 
+
+						CONST OCILobLocator *y, boolean *is_equal)
+
+{
+
+	return OCILobIsEqual(envhp, x, y, is_equal);
+
+}
+
+
+
+sword SDO_OCILobLoadFromFile(OCISvcCtx *svchp, OCIError *errhp, 
+
+							 OCILobLocator *dst_locp, OCILobLocator *src_filep, 
+
+                             ub4 amount, ub4 dst_offset, ub4 src_offset)
+
+{
+
+	return OCILobLoadFromFile(svchp, errhp, dst_locp, src_filep, amount, 
+
+							  dst_offset, src_offset);
+
+}
+
+
+
+sword SDO_OCILobLocatorIsInit(OCIEnv *envhp, OCIError *errhp, 
+
+							  CONST OCILobLocator *locp, boolean *is_initialized)
+
+{
+
+	return OCILobLocatorIsInit(envhp, errhp, locp, is_initialized);
+
+}
+
+
+
+sword SDO_OCILobRead(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+
+                     ub4 *amtp, ub4 offset, dvoid *bufp, ub4 bufl, 
+
+                     dvoid *ctxp, sb4 (*cbfp)(dvoid *ctxp, CONST dvoid *bufp, 
+
+					 ub4 len, ub1 piece), ub2 csid, ub1 csfrm)
+
+{
+
+	return OCILobRead(svchp, errhp, locp, amtp, offset, bufp, bufl, 
+
+                      ctxp, cbfp, csid, csfrm);
+
+}
+
+
+
+sword SDO_OCILobTrim(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+
+                     ub4 newlen)
+
+{
+
+	return OCILobTrim(svchp, errhp, locp, newlen);
+
+}
+
+
+
+sword SDO_OCILobWrite(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+
+                      ub4 *amtp, ub4 offset, dvoid *bufp, ub4 buflen, ub1 piece, 
+
+					  dvoid *ctxp, sb4 (*cbfp)(dvoid *ctxp, dvoid *bufp, ub4 *len, 
+
+					  ub1 *piece), ub2 csid, ub1 csfrm)
+
+{
+
+	return OCILobWrite(svchp, errhp, locp, amtp, offset, bufp, buflen, piece, 
+
+					   ctxp, cbfp, csid, csfrm);
+
+}
+
+
+
+sword SDO_OCIBreak(dvoid *hndlp, OCIError *errhp)
+
+{
+
+	return OCIBreak(hndlp, errhp);
+
+}
+
+
+
+sword SDO_OCIServerVersion(dvoid *hndlp, OCIError *errhp, text *bufp, ub4 bufsz,
+
+                           ub1 hndltype)
+
+{
+
+	return OCIServerVersion(hndlp, errhp, bufp, bufsz, hndltype);
+
+}
+
+
+
+sword SDO_OCIAttrGet(CONST dvoid *trgthndlp, ub4 trghndltyp, dvoid *attributep, 
+
+					 ub4 *sizep, ub4 attrtype, OCIError *errhp)
+
+{
+
+	return OCIAttrGet(trgthndlp, trghndltyp, attributep, sizep, attrtype, errhp);
+
+}
+
+
+
+sword SDO_OCIAttrSet(dvoid *trgthndlp, ub4 trghndltyp, dvoid *attributep,
+
+					 ub4 size, ub4 attrtype, OCIError *errhp)
+
+{
+
+	return OCIAttrSet(trgthndlp, trghndltyp, attributep, size, attrtype, errhp);
+
+}
+
+
+
+sword SDO_OCISvcCtxToLda(OCISvcCtx *svchp, OCIError *errhp, Lda_Def *ldap)
+
+{
+
+	return OCISvcCtxToLda(svchp, errhp, ldap);
+
+}
+
+
+
+sword SDO_OCILdaToSvcCtx(OCISvcCtx **svchpp, OCIError *errhp, Lda_Def *ldap)
+
+{
+
+	return OCILdaToSvcCtx(svchpp, errhp, ldap);
+
+}
+
+
+
+sword SDO_OCIResultSetToStmt(OCIResult *rsetdp, OCIError *errhp)
+
+{
+
+	return OCIResultSetToStmt(rsetdp, errhp);
+
+}
+
+
+
+
+
+/********************************************************************************/
+
+/* Part II -- OCI navigational interfaces                                       */
+
+/********************************************************************************/
+
+sword SDO_OCIObjectNew(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+
+					   OCITypeCode typecode, OCIType *tdo, dvoid *table, 
+
+					   OCIDuration duration, boolean value, dvoid **instance)
+
+{
+
+	return OCIObjectNew(env, err, svc, typecode, tdo, table, duration, 
+
+						value, instance);
+
+}
+
+
+
+sword SDO_OCIObjectPin(OCIEnv *env, OCIError *err, OCIRef *object_ref, 
+
+					   OCIComplexObject *corhdl, OCIPinOpt pin_option, 
+
+					   OCIDuration pin_duration, OCILockOpt lock_option, 
+
+					   dvoid **object)
+
+{
+
+	return OCIObjectPin(env, err, object_ref, corhdl, pin_option, 
+
+					    pin_duration, lock_option, object);
+
+}
+
+
+
+sword SDO_OCIObjectUnpin(OCIEnv *env, OCIError *err, dvoid *object)
+
+{
+
+	return OCIObjectUnpin(env, err, object);
+
+}
+
+
+
+sword SDO_OCIObjectPinCountReset(OCIEnv *env, OCIError *err, dvoid *object)
+
+{
+
+	return OCIObjectPinCountReset(env, err, object);
+
+}
+
+
+
+sword SDO_OCIObjectLock(OCIEnv *env, OCIError *err, dvoid *object)
+
+{
+
+	return OCIObjectLock(env, err, object);
+
+}
+
+
+
+sword SDO_OCIObjectMarkUpdate(OCIEnv *env, OCIError *err, dvoid *object)
+
+{
+
+	return OCIObjectMarkUpdate(env, err, object);
+
+}
+
+
+
+sword SDO_OCIObjectUnmark(OCIEnv *env, OCIError *err, dvoid *object)
+
+{
+
+	return OCIObjectUnmark(env, err, object);
+
+}
+
+
+
+sword SDO_OCIObjectUnmarkByRef(OCIEnv *env, OCIError *err, OCIRef *ref)
+
+{
+
+	return OCIObjectUnmarkByRef(env, err, ref);
+
+}
+
+
+
+sword SDO_OCIObjectFree(OCIEnv *env, OCIError *err, dvoid *instance, 
+
+                        ub2 flags)
+
+{
+
+	return OCIObjectFree(env, err, instance, flags);
+
+}
+
+
+
+sword SDO_OCIObjectMarkDeleteByRef(OCIEnv *env, OCIError *err, OCIRef *object_ref)
+
+{
+
+	return OCIObjectMarkDeleteByRef(env, err, object_ref);
+
+}
+
+
+
+sword SDO_OCIObjectMarkDelete(OCIEnv *env, OCIError *err, dvoid *instance)
+
+{
+
+	return OCIObjectMarkDelete(env, err, instance);
+
+}
+
+
+
+sword SDO_OCIObjectFlush(OCIEnv *env, OCIError *err, dvoid *object)
+
+{
+
+	return OCIObjectFlush(env, err, object);
+
+}
+
+
+
+sword SDO_OCIObjectRefresh(OCIEnv *env, OCIError *err, dvoid *object)
+
+{
+
+	return OCIObjectRefresh(env, err, object);
+
+}
+
+
+
+sword SDO_OCIObjectCopy(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+                        dvoid *source, dvoid *null_source, dvoid *target, 
+
+						dvoid *null_target, OCIType *tdo, OCIDuration duration, 
+
+						ub1 option)
+
+{
+
+	return OCIObjectCopy(env, err, svc, source, null_source, target, 
+
+						 null_target, tdo, duration, option);
+
+}
+
+
+
+sword SDO_OCIObjectGetTypeRef(OCIEnv *env, OCIError *err, dvoid *instance, 
+
+                              OCIRef *type_ref)
+
+{
+
+	return OCIObjectGetTypeRef(env, err, instance, type_ref);
+
+}
+
+
+
+sword SDO_OCIObjectGetObjectRef(OCIEnv *env, OCIError *err, dvoid *object, 
+
+                                OCIRef *object_ref)
+
+{
+
+	return OCIObjectGetObjectRef(env, err, object, object_ref);
+
+}
+
+
+
+sword SDO_OCIObjectGetInd(OCIEnv *env, OCIError *err, dvoid *instance, 
+
+                          dvoid **null_struct)
+
+{
+
+	return OCIObjectGetInd(env, err, instance, null_struct);
+
+}
+
+
+
+sword SDO_OCIObjectExists(OCIEnv *env, OCIError *err, dvoid *ins, boolean *exist)
+
+{
+
+	return OCIObjectExists(env, err, ins, exist);
+
+}
+
+
+
+sword SDO_OCIObjectGetProperty(OCIEnv *envh, OCIError *errh, CONST dvoid *obj, 
+
+							   OCIObjectPropId propertyId, dvoid *property, 
+
+							   ub4 *size)
+
+{
+
+	return OCIObjectGetProperty(envh, errh, obj, propertyId, property, size);
+
+}
+
+
+
+sword SDO_OCIObjectIsLocked(OCIEnv *env, OCIError *err, dvoid *ins, boolean *lock)
+
+{
+
+	return OCIObjectIsLocked(env, err, ins, lock);
+
+}
+
+
+
+sword SDO_OCIObjectIsDirty(OCIEnv *env, OCIError *err, dvoid *ins, boolean *dirty)
+
+{
+
+	return OCIObjectIsDirty(env, err, ins, dirty);
+
+}
+
+
+
+sword SDO_OCIObjectPinTable(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+							CONST text *schema_name, ub4 s_n_length, 
+
+							CONST text *object_name, ub4 o_n_length, 
+
+							CONST OCIRef *scope_obj_ref, OCIDuration pin_duration, 
+
+							dvoid** object)
+
+{
+
+	return OCIObjectPinTable(env, err, svc, schema_name, s_n_length, 
+
+							 object_name, o_n_length, scope_obj_ref, pin_duration, 
+
+							 object);
+
+}
+
+
+
+sword SDO_OCIObjectArrayPin(OCIEnv *env, OCIError *err, OCIRef **ref_array, 
+
+							ub4 array_size, OCIComplexObject **cor_array,
+
+							ub4 cor_array_size, OCIPinOpt pin_option, 
+
+							OCIDuration pin_duration, OCILockOpt lock, 
+
+							dvoid **obj_array, ub4 *pos)
+
+{
+
+	return OCIObjectArrayPin(env, err, ref_array, array_size, cor_array,
+
+							 cor_array_size, pin_option, pin_duration, lock, 
+
+							 obj_array, pos);
+
+}
+
+
+
+sword SDO_OCICacheFlush(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+						dvoid *context, OCIRef *(*get)(dvoid *context, ub1 *last),
+
+						OCIRef **ref)
+
+{
+
+	return OCICacheFlush(env, err, svc, context, get, ref);
+
+}
+
+
+
+sword SDO_OCICacheRefresh(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+
+						  OCIRefreshOpt option, dvoid *context,
+
+						  OCIRef *(*get)(dvoid *context), OCIRef **ref)
+
+{
+
+	return OCICacheRefresh(env, err, svc, option, context, get, ref);
+
+}
+
+
+
+sword SDO_OCICacheUnpin(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc)
+
+{
+
+	return OCICacheUnpin(env, err, svc);
+
+}
+
+
+
+sword SDO_OCICacheFree(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc)
+
+{
+
+	return OCICacheFree(env, err, svc);
+
+} 
+
+
+
+sword SDO_OCICacheUnmark(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc)
+
+{
+
+	return OCICacheUnmark(env, err, svc);
+
+}
+
+
+
+sword SDO_OCIDurationBegin(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+                           OCIDuration parent, OCIDuration *dur)
+
+{
+
+	return OCIDurationBegin(env, err, svc, parent, dur);
+
+}
+
+
+
+sword SDO_OCIDurationEnd(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+                         OCIDuration duration)
+
+{
+
+	return OCIDurationEnd(env, err, svc, duration);
+
+}
+
+
+
+sword SDO_OCIDurationGetParent(OCIEnv *env, OCIError *err, 
+
+                               OCIDuration duration, OCIDuration *parent)
+
+{
+
+	return OCIDurationGetParent(env, err, duration, parent);
+
+}
+
+
+
+sword SDO_OCIObjectAlwaysLatest(OCIEnv *env, OCIError *err, dvoid *object)
+
+{
+
+	return OCIObjectAlwaysLatest(env, err, object);
+
+}
+
+
+
+sword SDO_OCIObjectNotAlwaysLatest(OCIEnv *env, OCIError *err, dvoid *object)
+
+{
+
+	return OCIObjectNotAlwaysLatest(env, err, object);
+
+}
+
+
+
+sword SDO_OCIObjectFlushRefresh(OCIEnv *env, OCIError *err, dvoid *object)
+
+{
+
+	return OCIObjectFlushRefresh(env, err, object);
+
+}
+
+
+
+sword SDO_OCIObjectIsLoaded(OCIEnv *env, OCIError *err, dvoid *ins, 
+
+							boolean *load)
+
+{
+
+	return OCIObjectIsLoaded(env, err, ins, load);
+
+}
+
+
+
+sword SDO_OCIObjectIsDirtied(OCIEnv *env, OCIError *err, dvoid *ins,
+
+							 boolean *dirty)
+
+{
+
+	return OCIObjectIsDirtied(env, err, ins, dirty);
+
+}
+
+
+
+sword SDO_OCICacheGetObjects(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+
+							 OCIObjectProperty property, dvoid *client_context,
+
+							 void (*client_callback)(dvoid *client_context,
+
+							 dvoid *object))
+
+{
+
+	return OCICacheGetObjects(env, err, svc, property, client_context,
+
+							  client_callback);
+
+}
+
+
+
+sword SDO_OCICacheRegister(OCIEnv *env, OCIError *err, OCIObjectEvent event,
+
+						   dvoid *client_context, void (*client_callback)(
+
+						   dvoid *client_context, OCIObjectEvent event,
+
+						   dvoid *object))
+
+{
+
+	return OCICacheRegister(env, err, event, client_context, client_callback);
+
+}
+
+
+
+sword SDO_OCICacheFlushRefresh(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+							   dvoid *context, OCIRef *(*get)(dvoid *context, 
+
+							   ub1 *last), OCIRef **ref)
+
+{
+
+	return OCICacheFlushRefresh(env, err, svc, context, get, ref);
+
+}
+
+
+
+
+
+/********************************************************************************/
+
+/* Part III -- OCI primitive OTS interfaces                                     */
+
+/********************************************************************************/
+
+void SDO_OCINumberSetZero(OCIError *err, OCINumber *num)
+
+{
+
+	OCINumberSetZero(err, num);
+
+}
+
+
+
+sword SDO_OCINumberAdd(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, OCINumber *result)
+
+{
+
+	return OCINumberAdd(err, number1, number2, result);
+
+}
+
+
+
+sword SDO_OCINumberSub(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, OCINumber *result)
+
+{
+
+	return OCINumberSub(err, number1, number2, result);
+
+}
+
+
+
+sword SDO_OCINumberMul(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, OCINumber *result)
+
+{
+
+	return OCINumberMul(err, number1, number2, result);
+
+}
+
+
+
+sword SDO_OCINumberDiv(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, OCINumber *result)
+
+{
+
+	return OCINumberDiv(err, number1, number2, result);
+
+}
+
+
+
+sword SDO_OCINumberMod(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, OCINumber *result)
+
+{
+
+	return OCINumberMod(err, number1, number2, result);
+
+}
+
+
+
+sword SDO_OCINumberIntPower(OCIError *err, CONST OCINumber *base,
+
+                            CONST sword exp, OCINumber *result)
+
+{
+
+	return OCINumberIntPower(err, base, exp, result);
+
+}
+
+
+
+sword SDO_OCINumberNeg(OCIError *err, CONST OCINumber *number,
+
+                       OCINumber *result)
+
+{
+
+	return OCINumberNeg(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberToText(OCIError *err, CONST OCINumber *number, 
+
+                          CONST text *fmt, ub4 fmt_length,
+
+                          CONST text *nls_params, ub4 nls_p_length,
+
+                          ub4 *buf_size, text *buf)
+
+{
+
+	return OCINumberToText(err, number, fmt, fmt_length, nls_params, 
+
+						   nls_p_length, buf_size, buf);
+
+}
+
+
+
+sword SDO_OCINumberFromText(OCIError *err, CONST text *str, ub4 str_length, 
+
+							CONST text *fmt, ub4 fmt_length, 
+
+							CONST text *nls_params, ub4 nls_p_length, 
+
+							OCINumber *number)
+
+{
+
+	return OCINumberFromText(err, str, str_length, fmt, fmt_length, 
+
+							 nls_params, nls_p_length, number);
+
+}
+
+
+
+sword SDO_OCINumberToInt(OCIError *err, CONST OCINumber *number,
+
+                         uword rsl_length, uword rsl_flag, dvoid *rsl)
+
+{
+
+	return OCINumberToInt(err, number, rsl_length, rsl_flag, rsl);
+
+}
+
+
+
+sword SDO_OCINumberFromInt(OCIError *err, CONST dvoid *inum, uword inum_length,
+
+						   uword inum_s_flag, OCINumber *number)
+
+{
+
+	return OCINumberFromInt(err, inum, inum_length, inum_s_flag, number);
+
+}
+
+
+
+sword SDO_OCINumberToReal(OCIError *err, CONST OCINumber *number,
+
+                          uword rsl_length, dvoid *rsl)
+
+{
+
+	return OCINumberToReal(err, number, rsl_length, rsl);
+
+}
+
+
+
+sword SDO_OCINumberFromReal(OCIError *err, CONST dvoid *rnum,
+
+                            uword rnum_length, OCINumber *number)
+
+{
+
+	return OCINumberFromReal(err, rnum, rnum_length, number);
+
+}
+
+
+
+sword SDO_OCINumberCmp(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, sword *result)
+
+{
+
+	return OCINumberCmp(err, number1, number2, result);
+
+}
+
+
+
+sword SDO_OCINumberSign(OCIError *err, CONST OCINumber *number,
+
+                        sword *result)
+
+{
+
+	return OCINumberSign(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberIsZero(OCIError *err, CONST OCINumber *number,
+
+                          boolean *result)
+
+{
+
+	return OCINumberIsZero(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberAssign(OCIError *err, CONST OCINumber *from,
+
+                          OCINumber *to)
+
+{
+
+	return OCINumberAssign(err, from, to);
+
+}
+
+
+
+sword SDO_OCINumberAbs(OCIError *err, CONST OCINumber *number,
+
+                       OCINumber *result)
+
+{
+
+	return OCINumberAbs(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberCeil(OCIError *err, CONST OCINumber *number,
+
+                        OCINumber *result)
+
+{
+
+	return OCINumberCeil(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberFloor(OCIError *err, CONST OCINumber *number, 
+
+                         OCINumber *result)
+
+{
+
+	return OCINumberFloor(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberSqrt(OCIError *err, CONST OCINumber *number, 
+
+                        OCINumber *result)
+
+{
+
+	return OCINumberSqrt(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberTrunc(OCIError *err, CONST OCINumber *number, 
+
+                         sword decplace, OCINumber *result)
+
+{
+
+	return OCINumberTrunc(err, number, decplace, result);
+
+}
+
+
+
+sword SDO_OCINumberPower(OCIError *err, CONST OCINumber *base, 
+
+                         CONST OCINumber *number, OCINumber *result)
+
+{
+
+	return OCINumberPower(err, base, number, result);
+
+}
+
+
+
+sword SDO_OCINumberRound(OCIError *err, CONST OCINumber *number,
+
+                         sword decplace, OCINumber *result)
+
+{
+
+	return OCINumberRound(err, number, decplace, result);
+
+}
+
+
+
+sword SDO_OCINumberSin(OCIError *err, CONST OCINumber *number,
+
+                       OCINumber *result)
+
+{
+
+	return OCINumberSin(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberArcSin(OCIError *err, CONST OCINumber *number,
+
+                          OCINumber *result)
+
+{
+
+	return OCINumberArcSin(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberHypSin(OCIError *err, CONST OCINumber *number, 
+
+                          OCINumber *result)
+
+{
+
+	return OCINumberHypSin(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberCos(OCIError *err, CONST OCINumber *number, 
+
+                       OCINumber *result)
+
+{
+
+	return OCINumberCos(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberArcCos(OCIError *err, CONST OCINumber *number, 
+
+                          OCINumber *result)
+
+{
+
+	return OCINumberArcCos(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberHypCos(OCIError *err, CONST OCINumber *number, 
+
+                          OCINumber *result)
+
+{
+
+	return OCINumberHypCos(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberTan(OCIError *err, CONST OCINumber *number, 
+
+                       OCINumber *result)
+
+{
+
+	return OCINumberTan(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberArcTan(OCIError *err, CONST OCINumber *number, 
+
+                          OCINumber *result)
+
+{
+
+	return OCINumberArcTan(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberArcTan2(OCIError *err, CONST OCINumber *number1, 
+
+                           CONST OCINumber *number2, OCINumber *result)
+
+{
+
+	return OCINumberArcTan2(err, number1, number2, result);
+
+}
+
+
+
+sword SDO_OCINumberHypTan(OCIError *err, CONST OCINumber *number, 
+
+                          OCINumber *result)
+
+{
+
+	return OCINumberHypTan(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberExp(OCIError *err, CONST OCINumber *number, 
+
+                       OCINumber *result)
+
+{
+
+	return OCINumberExp(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberLn(OCIError *err, CONST OCINumber *number, 
+
+                      OCINumber *result)
+
+{
+
+	return OCINumberLn(err, number, result);
+
+}
+
+
+
+sword SDO_OCINumberLog(OCIError *err, CONST OCINumber *base, 
+
+                       CONST OCINumber *number, OCINumber *result)
+
+{
+
+	return OCINumberLog(err, base, number, result);
+
+}
+
+
+
+sword SDO_OCIDateAssign(OCIError *err, CONST OCIDate *from, OCIDate *to)
+
+{
+
+	return OCIDateAssign(err, from, to);
+
+}
+
+
+
+sword SDO_OCIDateToText(OCIError *err, CONST OCIDate *date, 
+
+                        CONST text *fmt, ub1 fmt_length, 
+
+                        CONST text *lang_name, ub4 lang_length, 
+
+                        ub4 *buf_size, text *buf)
+
+{
+
+	return OCIDateToText(err, date, fmt, fmt_length, lang_name, lang_length, 
+
+						 buf_size, buf);
+
+}
+
+
+
+sword SDO_OCIDateFromText(OCIError *err, CONST text *date_str, 
+
+						  ub4 d_str_length, CONST text *fmt, ub1 fmt_length, 
+
+						  CONST text *lang_name, ub4 lang_length, 
+
+						  OCIDate *date)
+
+{
+
+	return OCIDateFromText(err, date_str, d_str_length, fmt, fmt_length, 
+
+						   lang_name, lang_length, date);
+
+}
+
+
+
+sword SDO_OCIDateCompare(OCIError *err, CONST OCIDate *date1, 
+
+						 CONST OCIDate *date2, sword *result)
+
+{
+
+	return OCIDateCompare(err, date1, date2, result);
+
+}
+
+
+
+sword SDO_OCIDateAddMonths(OCIError *err, CONST OCIDate *date, sb4 num_months,
+
+                           OCIDate *result)
+
+{
+
+	return OCIDateAddMonths(err, date, num_months, result);
+
+}
+
+
+
+sword SDO_OCIDateAddDays(OCIError *err, CONST OCIDate *date, sb4 num_days,
+
+                         OCIDate *result)
+
+{
+
+	return OCIDateAddDays(err, date, num_days, result);
+
+}
+
+
+
+sword SDO_OCIDateLastDay(OCIError *err, CONST OCIDate *date, 
+
+                         OCIDate *last_day)
+
+{
+
+	return OCIDateLastDay(err, date, last_day);
+
+}
+
+
+
+sword SDO_OCIDateDaysBetween(OCIError *err, CONST OCIDate *date1, 
+
+                             CONST OCIDate *date2, sb4 *num_days)
+
+{
+
+	return OCIDateDaysBetween(err, date1, date2, num_days);
+
+}
+
+
+
+sword SDO_OCIDateZoneToZone(OCIError *err, CONST OCIDate *date1,
+
+                            CONST text *zon1, ub4 zon1_length, 
+
+							CONST text *zon2, ub4 zon2_length, OCIDate *date2)
+
+{
+
+	return OCIDateZoneToZone(err, date1, zon1, zon1_length, zon2, 
+
+							 zon2_length, date2);
+
+}
+
+
+
+sword SDO_OCIDateNextDay(OCIError *err, CONST OCIDate *date, CONST text *day_p, 
+
+                         ub4 day_length, OCIDate *next_day)
+
+{
+
+	return OCIDateNextDay(err, date, day_p, day_length, next_day);
+
+}
+
+
+
+
+
+sword SDO_OCIDateCheck(OCIError *err, CONST OCIDate *date, uword *valid)
+
+{
+
+	return OCIDateCheck(err, date, valid);
+
+}
+
+
+
+sword SDO_OCIDateSysDate(OCIError *err, OCIDate *sys_date)
+
+{
+
+	return OCIDateSysDate(err, sys_date);
+
+}
+
+
+
+sword SDO_OCIStringAssign(OCIEnv *env, OCIError *err, CONST OCIString *rhs, 
+
+                          OCIString **lhs)
+
+{
+
+	return OCIStringAssign(env, err, rhs, lhs);
+
+}
+
+
+
+sword SDO_OCIStringAssignText(OCIEnv *env, OCIError *err, CONST text *rhs, 
+
+                              ub4 rhs_len, OCIString **lhs)
+
+{
+
+	return OCIStringAssignText(env, err, rhs, rhs_len, lhs);
+
+}
+
+
+
+sword SDO_OCIStringResize(OCIEnv *env, OCIError *err, ub4 new_size, 
+
+                          OCIString **str)
+
+{
+
+	return OCIStringResize(env, err, new_size, str);
+
+}
+
+
+
+ub4 SDO_OCIStringSize(OCIEnv *env, CONST OCIString *vs)
+
+{
+
+	return OCIStringSize(env, vs);
+
+}
+
+
+
+text *SDO_OCIStringPtr(OCIEnv *env, CONST OCIString *vs)
+
+{
+
+	return OCIStringPtr(env, vs);
+
+}
+
+
+
+sword SDO_OCIStringAllocSize(OCIEnv *env, OCIError *err, CONST OCIString *vs, 
+
+                             ub4 *allocsize)
+
+{
+
+	return OCIStringAllocSize(env, err, vs, allocsize);
+
+}
+
+
+
+sword SDO_OCIRawAssignRaw(OCIEnv *env, OCIError *err, CONST OCIRaw *rhs, 
+
+                          OCIRaw **lhs)
+
+{
+
+	return OCIRawAssignRaw(env, err, rhs, lhs);
+
+}
+
+
+
+sword SDO_OCIRawAssignBytes(OCIEnv *env, OCIError *err, CONST ub1 *rhs, 
+
+                            ub4 rhs_len, OCIRaw **lhs)
+
+{
+
+	return OCIRawAssignBytes(env, err, rhs, rhs_len, lhs);
+
+}
+
+
+
+sword SDO_OCIRawResize(OCIEnv *env, OCIError *err, ub4 new_size, OCIRaw **raw)
+
+{
+
+	return OCIRawResize(env, err, new_size, raw);
+
+}
+
+
+
+ub4 SDO_OCIRawSize(OCIEnv *env, CONST OCIRaw *raw)
+
+{
+
+	return OCIRawSize(env, raw);
+
+}
+
+
+
+ub1 *SDO_OCIRawPtr(OCIEnv *env, CONST OCIRaw *raw)
+
+{
+
+	return OCIRawPtr(env, raw);
+
+}
+
+
+
+sword SDO_OCIRawAllocSize(OCIEnv *env, OCIError *err, CONST OCIRaw *raw,
+
+						  ub4 *allocsize)
+
+{
+
+	return OCIRawAllocSize(env, err, raw, allocsize);
+
+}
+
+
+
+void SDO_OCIRefClear(OCIEnv *env, OCIRef *ref)
+
+{
+
+	OCIRefClear(env, ref);
+
+}
+
+
+
+sword SDO_OCIRefAssign(OCIEnv *env, OCIError *err, CONST OCIRef *source, 
+
+                       OCIRef **target)
+
+{
+
+	return OCIRefAssign(env, err, source, target);
+
+}
+
+
+
+boolean SDO_OCIRefIsEqual(OCIEnv *env, CONST OCIRef *x, CONST OCIRef *y)
+
+{
+
+	return OCIRefIsEqual(env, x, y);
+
+}
+
+
+
+boolean SDO_OCIRefIsNull(OCIEnv *env, CONST OCIRef *ref)
+
+{
+
+	return OCIRefIsNull(env, ref);
+
+}
+
+
+
+ub4 SDO_OCIRefHexSize(OCIEnv *env, CONST OCIRef *ref)
+
+{
+
+	return OCIRefHexSize(env, ref);
+
+}
+
+
+
+sword SDO_OCIRefFromHex(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+                        CONST text *hex, ub4 length, OCIRef **ref)
+
+{
+
+	return OCIRefFromHex(env, err, svc, hex, length, ref);
+
+}
+
+
+
+sword SDO_OCIRefToHex(OCIEnv *env, OCIError *err, CONST OCIRef *ref, 
+
+                      text *hex, ub4 *hex_length)
+
+{
+
+	return OCIRefToHex(env, err, ref, hex, hex_length);
+
+}
+
+
+
+sword SDO_OCICollSize(OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+
+					  sb4 *size)
+
+{
+
+	return OCICollSize(env, err, coll, size);
+
+}
+
+
+
+sb4 SDO_OCICollMax(OCIEnv *env, CONST OCIColl *coll)
+
+{
+
+	return OCICollMax(env, coll);
+
+}
+
+
+
+sword SDO_OCICollGetElem(OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+
+                         sb4 index, boolean *exists, dvoid **elem, 
+
+                         dvoid **elemind)
+
+{
+
+	return OCICollGetElem(env, err, coll, index, exists, elem, elemind);
+
+}
+
+
+
+sword SDO_OCICollAssignElem(OCIEnv *env, OCIError *err, sb4 index, 
+
+                            CONST dvoid *elem, 
+
+                            CONST dvoid *elemind, OCIColl *coll)
+
+{
+
+	return OCICollAssignElem(env, err, index, elem, elemind, coll);
+
+}
+
+
+
+sword SDO_OCICollAssign(OCIEnv *env, OCIError *err, CONST OCIColl *rhs, 
+
+                        OCIColl *lhs)
+
+{
+
+	return OCICollAssign(env, err, rhs, lhs);
+
+}
+
+
+
+sword SDO_OCICollAppend(OCIEnv *env, OCIError *err, CONST dvoid *elem, 
+
+                        CONST dvoid *elemind, OCIColl *coll)
+
+{
+
+	return OCICollAppend(env, err, elem, elemind, coll);
+
+}
+
+
+
+sword SDO_OCICollTrim(OCIEnv *env, OCIError *err, sb4 trim_num, 
+
+                      OCIColl *coll)
+
+{
+
+	return OCICollTrim(env, err, trim_num, coll);
+
+}
+
+
+
+sword SDO_OCIIterCreate(OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+
+                        OCIIter **itr)
+
+{
+
+	return OCIIterCreate(env, err, coll, itr);
+
+}
+
+
+
+sword SDO_OCIIterDelete(OCIEnv *env, OCIError *err, OCIIter **itr)
+
+{
+
+	return OCIIterDelete(env, err, itr);
+
+}
+
+
+
+sword SDO_OCIIterInit(OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+
+                      OCIIter *itr)
+
+{
+
+	return OCIIterInit(env, err, coll, itr);
+
+}
+
+
+
+sword SDO_OCIIterGetCurrent(OCIEnv *env, OCIError *err, CONST OCIIter *itr, 
+
+                            dvoid **elem, dvoid **elemind)
+
+{
+
+	return OCIIterGetCurrent(env, err, itr, elem, elemind);
+
+}
+
+
+
+sword SDO_OCIIterNext(OCIEnv *env, OCIError *err, OCIIter *itr, 
+
+                      dvoid **elem, dvoid **elemind, boolean *eoc)
+
+{
+
+	return OCIIterNext(env, err, itr, elem, elemind, eoc);
+
+}
+
+
+
+sword SDO_OCIIterPrev(OCIEnv *env, OCIError *err, OCIIter *itr, 
+
+                      dvoid **elem, dvoid **elemind, boolean *boc)
+
+{
+
+	return OCIIterPrev(env, err, itr, elem, elemind, boc);
+
+}
+
+
+
+sword SDO_OCITableSize(OCIEnv *env, OCIError *err, CONST OCITable *tbl, 
+
+					   sb4 *size)
+
+{
+
+	return OCITableSize(env, err, tbl, size);
+
+}
+
+
+
+sword SDO_OCITableExists(OCIEnv *env, OCIError *err, CONST OCITable *tbl,
+
+						 sb4 index, boolean *exists)
+
+{
+
+	return OCITableExists(env, err, tbl, index, exists);
+
+}
+
+
+
+sword SDO_OCITableDelete(OCIEnv *env, OCIError *err, sb4 index, OCITable *tbl)
+
+{
+
+	return OCITableDelete(env, err, index, tbl);
+
+}
+
+
+
+sword SDO_OCITableFirst(OCIEnv *env, OCIError *err, CONST OCITable *tbl, 
+
+                        sb4 *index)
+
+{
+
+	return OCITableFirst(env, err, tbl, index);
+
+}
+
+
+
+sword SDO_OCITableLast(OCIEnv *env, OCIError *err, CONST OCITable *tbl, 
+
+                       sb4 *index)
+
+{
+
+	return OCITableLast(env, err, tbl, index);
+
+}
+
+
+
+sword SDO_OCITableNext(OCIEnv *env, OCIError *err, sb4 index, 
+
+					   CONST OCITable *tbl, sb4 *next_index, boolean *exists)
+
+{
+
+	return OCITableNext(env, err, index, tbl, next_index, exists);
+
+}
+
+
+
+sword SDO_OCITablePrev(OCIEnv *env, OCIError *err, sb4 index, 
+
+                       CONST OCITable *tbl, sb4 *prev_index, boolean *exists)
+
+{
+
+	return OCITablePrev(env, err, index, tbl, prev_index, exists);
+
+}
+
+
+
+
+
+/********************************************************************************/
+
+/* Part IV -- OCI open type manager interfaces                                  */
+
+/********************************************************************************/
+
+sword SDO_OCITypeIterNew(OCIEnv *env, OCIError *err, OCIType *tdo, 
+
+                         OCITypeIter **iteratorOCI)
+
+{
+
+	return OCITypeIterNew(env, err, tdo, iteratorOCI);
+
+}
+
+
+
+sword SDO_OCITypeIterSet(OCIEnv *env, OCIError *err, OCIType *tdo, 
+
+						 OCITypeIter *iteratorOCI)
+
+{
+
+	return OCITypeIterSet(env, err, tdo, iteratorOCI);
+
+}
+
+
+
+sword SDO_OCITypeIterFree(OCIEnv *env, OCIError *err, OCITypeIter *iteratorOCI)
+
+{
+
+	return OCITypeIterFree(env, err, iteratorOCI);
+
+}
+
+
+
+sword SDO_OCITypeByName(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+                        CONST text *schema_name, ub4 s_length,
+
+                        CONST text *type_name, ub4 t_length,
+
+                        CONST text *version_name, ub4 v_length,
+
+                        OCIDuration pin_duration, OCITypeGetOpt get_option,
+
+                        OCIType **tdo)
+
+{
+
+	return OCITypeByName(env, err, svc, schema_name, s_length, type_name, 
+
+						 t_length, version_name, v_length, pin_duration, 
+
+						 get_option, tdo);
+
+}
+
+
+
+sword SDO_OCITypeArrayByName(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+
+                             ub4 array_len, CONST text *schema_name[], 
+
+							 ub4 s_length[], CONST text *type_name[], 
+
+							 ub4 t_length[], CONST text *version_name[], 
+
+							 ub4 v_length[], OCIDuration pin_duration,
+
+                             OCITypeGetOpt get_option, OCIType *tdo[])
+
+{
+
+	return OCITypeArrayByName(env, err, svc, array_len, schema_name, s_length, 
+
+							  type_name, t_length, version_name, v_length, 
+
+							  pin_duration, get_option, tdo);
+
+}
+
+
+
+sword SDO_OCITypeByRef(OCIEnv *env, OCIError *err, CONST OCIRef *type_ref, 
+
+					   OCIDuration pin_duration,OCITypeGetOpt get_option, 
+
+					   OCIType **tdo)
+
+{
+
+	return OCITypeByRef(env, err, type_ref, pin_duration, get_option, tdo);
+
+}
+
+
+
+sword SDO_OCITypeArrayByRef(OCIEnv *env, OCIError *err, ub4 array_len, 
+
+							CONST OCIRef *type_ref[], OCIDuration pin_duration,
+
+							OCITypeGetOpt get_option, OCIType *tdo[])
+
+{
+
+	return OCITypeArrayByRef(env, err, array_len, type_ref, pin_duration,
+
+							 get_option, tdo);
+
+}
+
+
+
+text* SDO_OCITypeName(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                      ub4 *n_length)
+
+{
+
+	return OCITypeName(env, err, tdo, n_length);
+
+}
+
+
+
+text* SDO_OCITypeSchema(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+						ub4 *n_length)
+
+{
+
+	return OCITypeSchema(env, err, tdo, n_length);
+
+}
+
+
+
+OCITypeCode SDO_OCITypeTypeCode(OCIEnv *env, OCIError *err, CONST OCIType *tdo)
+
+{
+
+	return OCITypeTypeCode(env, err, tdo);
+
+}
+
+
+
+OCITypeCode SDO_OCITypeCollTypeCode(OCIEnv *env, OCIError *err, 
+
+									CONST OCIType *tdo)
+
+{
+
+	return OCITypeCollTypeCode(env, err, tdo);
+
+}
+
+
+
+text* SDO_OCITypeVersion(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                         ub4 *v_length)
+
+{
+
+	return OCITypeVersion(env, err, tdo, v_length);
+
+}
+
+
+
+ub4 SDO_OCITypeAttrs(OCIEnv *env, OCIError *err, CONST OCIType *tdo)
+
+{
+
+	return OCITypeAttrs(env, err, tdo);
+
+}
+
+
+
+ub4 SDO_OCITypeMethods(OCIEnv *env, OCIError *err, CONST OCIType *tdo)
+
+{
+
+	return OCITypeMethods(env, err, tdo);
+
+}
+
+
+
+text* SDO_OCITypeElemName(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem, 
+
+                          ub4 *n_length)
+
+{
+
+	return OCITypeElemName(env, err, elem, n_length);
+
+}
+
+
+
+OCITypeCode SDO_OCITypeElemTypeCode(OCIEnv *env, OCIError *err,
+
+                                    CONST OCITypeElem *elem)
+
+{
+
+	return OCITypeElemTypeCode(env, err, elem);
+
+}
+
+
+
+sword SDO_OCITypeElemType(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem, 
+
+                          OCIType **elem_tdo)
+
+{
+
+	return OCITypeElemType(env, err, elem, elem_tdo);
+
+}
+
+
+
+ub4 SDO_OCITypeElemFlags(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem)
+
+{
+
+	return OCITypeElemFlags(env, err, elem);
+
+}
+
+
+
+ub1 SDO_OCITypeElemNumPrec(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem)
+
+{
+
+	return OCITypeElemNumPrec(env, err, elem);
+
+}
+
+
+
+sb1 SDO_OCITypeElemNumScale(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem)
+
+{
+
+	return OCITypeElemNumScale(env, err, elem);
+
+}
+
+
+
+ub4 SDO_OCITypeElemLength(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem)
+
+{
+
+	return OCITypeElemLength(env, err, elem);
+
+}
+
+
+
+ub2 SDO_OCITypeElemCharSetID(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem)
+
+{
+
+	return OCITypeElemCharSetID(env, err, elem);
+
+}
+
+
+
+ub2 SDO_OCITypeElemCharSetForm(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem)
+
+{
+
+	return OCITypeElemCharSetForm(env, err, elem);
+
+}
+
+
+
+sword SDO_OCITypeElemParameterizedType(OCIEnv *env, OCIError *err,
+
+                                       CONST OCITypeElem *elem, 
+
+									   OCIType **type_stored)
+
+{
+
+	return OCITypeElemParameterizedType(env, err, elem, type_stored);
+
+}
+
+
+
+OCITypeCode SDO_OCITypeElemExtTypeCode(OCIEnv *env, OCIError *err,
+
+                                       CONST OCITypeElem *elem)
+
+{
+
+	return OCITypeElemExtTypeCode(env, err, elem);
+
+}
+
+
+
+sword SDO_OCITypeAttrByName(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                            CONST text *name, ub4 n_length, OCITypeElem **elem)
+
+{
+
+	return OCITypeAttrByName(env, err, tdo, name, n_length, elem);
+
+}
+
+
+
+sword SDO_OCITypeAttrNext(OCIEnv *env, OCIError *err, OCITypeIter *iteratorOCI,
+
+                          OCITypeElem **elem)
+
+{
+
+	return OCITypeAttrNext(env, err, iteratorOCI, elem);
+
+}
+
+
+
+sword SDO_OCITypeCollElem(OCIEnv *env, OCIError *err, CONST OCIType *tdo,
+
+                          OCITypeElem **element)
+
+{
+
+	return OCITypeCollElem(env, err, tdo, element);
+
+}
+
+
+
+sword SDO_OCITypeCollSize(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                          ub4 *num_elems)
+
+{
+
+	return OCITypeCollSize(env, err, tdo, num_elems);
+
+}
+
+
+
+sword SDO_OCITypeCollExtTypeCode(OCIEnv *env, OCIError *err,
+
+                                 CONST OCIType *tdo, OCITypeCode *sqt_code)
+
+{
+
+	return OCITypeCollExtTypeCode(env, err, tdo, sqt_code);
+
+}
+
+
+
+ub4 SDO_OCITypeMethodOverload(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                              CONST text *method_name, ub4 m_length)
+
+{
+
+	return OCITypeMethodOverload(env, err, tdo, method_name, m_length);
+
+}
+
+
+
+sword SDO_OCITypeMethodByName(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                              CONST text *method_name, ub4 m_length,
+
+                              OCITypeMethod **mdos)
+
+{
+
+	return OCITypeMethodByName(env, err, tdo, method_name, m_length, mdos);
+
+}
+
+
+
+sword SDO_OCITypeMethodNext(OCIEnv *env, OCIError *err, OCITypeIter *iteratorOCI,
+
+                            OCITypeMethod **mdo)
+
+{
+
+	return OCITypeMethodNext(env, err, iteratorOCI, mdo);
+
+}
+
+
+
+text *SDO_OCITypeMethodName(OCIEnv *env, OCIError *err,
+
+                            CONST OCITypeMethod *mdo, ub4 *n_length)
+
+{
+
+	return OCITypeMethodName(env, err, mdo, n_length);
+
+}
+
+
+
+OCITypeEncap SDO_OCITypeMethodEncap(OCIEnv *env, OCIError *err,
+
+                                    CONST OCITypeMethod *mdo)
+
+{
+
+	return OCITypeMethodEncap(env, err, mdo);
+
+}
+
+
+
+OCITypeMethodFlag SDO_OCITypeMethodFlags(OCIEnv *env, OCIError *err,
+
+                                         CONST OCITypeMethod *mdo)
+
+{
+
+	return OCITypeMethodFlags(env, err, mdo);
+
+}
+
+
+
+sword SDO_OCITypeMethodMap(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                           OCITypeMethod **mdo)
+
+{
+
+	return OCITypeMethodMap(env, err, tdo, mdo);
+
+}
+
+
+
+sword SDO_OCITypeMethodOrder(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                             OCITypeMethod **mdo)
+
+{
+
+	return OCITypeMethodOrder(env, err, tdo, mdo);
+
+}
+
+
+
+ub4 SDO_OCITypeMethodParams(OCIEnv *env, OCIError *err,
+
+                            CONST OCITypeMethod *mdo)
+
+{
+
+	return OCITypeMethodParams(env, err, mdo);
+
+}
+
+
+
+sword SDO_OCITypeResult(OCIEnv *env, OCIError *err, CONST OCITypeMethod *mdo,
+
+                        OCITypeElem **elem)
+
+{
+
+	return OCITypeResult(env, err, mdo, elem);
+
+}
+
+
+
+sword SDO_OCITypeParamByPos(OCIEnv *env, OCIError *err, CONST OCITypeMethod *mdo, 
+
+							ub4 position, OCITypeElem **elem)
+
+{
+
+	return OCITypeParamByPos(env, err, mdo, position, elem);
+
+}
+
+
+
+sword SDO_OCITypeParamByName(OCIEnv *env, OCIError *err, CONST OCITypeMethod *mdo, 
+
+                             CONST text *name, ub4 n_length, OCITypeElem **elem)
+
+{
+
+	return OCITypeParamByName(env, err, mdo, name, n_length, elem);
+
+}
+
+
+
+sword SDO_OCITypeParamPos(OCIEnv *env, OCIError *err, CONST OCITypeMethod *mdo, 
+
+                          CONST text *name, ub4 n_length, ub4 *position, 
+
+                          OCITypeElem **elem)
+
+{
+
+	return OCITypeParamPos(env, err, mdo, name, n_length, position, elem);
+
+}
+
+
+
+OCITypeParamMode SDO_OCITypeElemParamMode(OCIEnv *env, OCIError *err,
+
+                                          CONST OCITypeElem *elem)
+
+{
+
+	return OCITypeElemParamMode(env, err, elem);
+
+}
+
+
+
+text* SDO_OCITypeElemDefaultValue(OCIEnv *env, OCIError *err,
+
+                                  CONST OCITypeElem *elem, ub4 *d_v_length)
+
+{
+
+	return OCITypeElemDefaultValue(env, err, elem, d_v_length);
+
+}
+
+
+
+sword SDO_OCITypeVTInit(OCIEnv *env, OCIError *err)
+
+{
+
+	return OCITypeVTInit(env, err);
+
+}
+
+ 
+
+sword SDO_OCITypeVTInsert(OCIEnv *env, OCIError *err, CONST text *schema_name,
+
+						  ub4 s_n_length, CONST text *type_name, ub4 t_n_length, 
+
+						  CONST text *user_version, ub4 u_v_length)
+
+{
+
+	return OCITypeVTInsert(env, err, schema_name, s_n_length, type_name, 
+
+						   t_n_length, user_version, u_v_length);
+
+}
+
+
+
+sword SDO_OCITypeVTSelect(OCIEnv *env, OCIError *err, CONST text *schema_name,
+
+						  ub4 s_n_length, CONST text *type_name, ub4 t_n_length, 
+
+						  text **user_version, ub4 *u_v_length, ub2 *version)
+
+{
+
+	return OCITypeVTSelect(env, err, schema_name, s_n_length, type_name, 
+
+						   t_n_length, user_version, u_v_length, version);
+
+}
+
+
+
+
+
diff --git a/src/terralib/drivers/Oracle/TeOCISDO.h b/src/terralib/drivers/Oracle/TeOCISDO.h
new file mode 100644
index 0000000..c17218a
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOCISDO.h
@@ -0,0 +1,1310 @@
+
+/*! \file TeOCISDO.h
+    
+	This file was created by Oracle Corporation and contains functions to 
+	works with the Oracle Call Interface (OCI) Library.
+	Copyright 1998, Oracle SDO.  
+*/
+
+#ifndef SDO_OCI_H
+
+#define SDO_OCI_H
+
+#include "TeOracleDefines.h"
+
+/** @name Part I -- OCI fundamental interfaces
+*/
+//@{
+TLORACLE_DLL sword SDO_OCIEnvCreate(OCIEnv **envhpp, ub4 mode, dvoid *ctxp, 
+						dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+						dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+						void (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+						size_t xtramensz, dvoid **usrmempp); 
+
+TLORACLE_DLL sword SDO_OCIInitialize(ub4 mode, dvoid *ctxp, 
+						dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+						dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+						void (*mfreefp)(dvoid *ctxp, dvoid *memptr));
+
+TLORACLE_DLL sword SDO_OCIHandleAlloc(CONST dvoid *parenth, dvoid **hndlpp, ub4 type, 
+						 size_t xtramem_sz, dvoid **usrmempp);
+
+TLORACLE_DLL sword SDO_OCIHandleFree(dvoid *hndlp, ub4 type);
+
+TLORACLE_DLL sword SDO_OCIDescriptorAlloc(CONST dvoid *parenth, dvoid **descpp, ub4 type,
+							 size_t xtramem_sz, dvoid **usrmempp);
+
+TLORACLE_DLL sword SDO_OCIDescriptorFree(dvoid *descp, ub4 type);
+
+TLORACLE_DLL sword SDO_OCIEnvInit(OCIEnv **envp, ub4 mode, size_t xtramem_sz, 
+					 dvoid **usrmempp);
+
+TLORACLE_DLL sword SDO_OCIServerAttach(OCIServer *srvhp, OCIError *errhp,
+						  CONST text *dblink, sb4 dblink_len, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCIServerDetach(OCIServer *srvhp, OCIError *errhp, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCISessionBegin(OCISvcCtx *svchp, OCIError *errhp, 
+						  OCISession *usrhp, ub4 credt, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCISessionEnd(OCISvcCtx *svchp, OCIError *errhp, 
+						OCISession *usrhp, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCILogon(OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp, 
+				   CONST text *username, ub4 uname_len, CONST text *password, 
+				   ub4 passwd_len, CONST text *dbname, ub4 dbname_len);
+
+TLORACLE_DLL sword SDO_OCILogoff(OCISvcCtx *svchp, OCIError *errhp);
+
+TLORACLE_DLL sword SDO_OCIPasswordChange(OCISvcCtx *svchp, OCIError *errhp, 
+							CONST text *user_name, ub4 usernm_len, 
+							CONST text *opasswd, ub4 opasswd_len, 
+							CONST text *npasswd, ub4 npasswd_len, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCIStmtPrepare(OCISvcCtx *svchp, OCIStmt *stmtp, OCIError *errhp, CONST OraText *stmt,
+						 ub4 stmt_len, CONST OraText *key, ub4 keylen, ub4 language, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCIBindByPos(OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
+					   ub4 position, dvoid *valuep, sb4 value_sz,
+					   ub2 dty, dvoid *indp, ub2 *alenp, ub2 *rcodep,
+					   ub4 maxarr_len, ub4 *curelep, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCIBindByName(OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
+						CONST text *placeholder, sb4 placeh_len, 
+						dvoid *valuep, sb4 value_sz, ub2 dty, 
+						dvoid *indp, ub2 *alenp, ub2 *rcodep, 
+						ub4 maxarr_len, ub4 *curelep, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCIBindObject(OCIBind *bindp, OCIError *errhp, CONST OCIType *type, 
+						dvoid **pgvpp, ub4 *pvszsp, dvoid **indpp, ub4 *indszp);
+
+TLORACLE_DLL sword SDO_OCIBindDynamic(OCIBind *bindp, OCIError *errhp, dvoid *ictxp,
+						 OCICallbackInBind icbfp, dvoid *octxp,
+						 OCICallbackOutBind ocbfp);
+
+TLORACLE_DLL sword SDO_OCIBindArrayOfStruct(OCIBind *bindp, OCIError *errhp, 
+                               ub4 pvskip, ub4 indskip, ub4 alskip, ub4 rcskip);
+
+TLORACLE_DLL sword SDO_OCIStmtGetPieceInfo(OCIStmt *stmtp, OCIError *errhp, 
+                              dvoid **hndlpp, ub4 *typep, ub1 *in_outp, 
+							  ub4 *iterp, ub4 *idxp, ub1 *piecep);
+
+TLORACLE_DLL sword SDO_OCIStmtSetPieceInfo(dvoid *hndlp, ub4 type, OCIError *errhp, 
+                              CONST dvoid *bufp, ub4 *alenp, ub1 piece, 
+                              CONST dvoid *indp, ub2 *rcodep);
+
+TLORACLE_DLL sword SDO_OCIStmtExecute(OCISvcCtx *svchp, OCIStmt *stmtp, OCIError *errhp, 
+						 ub4 iters, ub4 rowoff, CONST OCISnapshot *snap_in, 
+						 OCISnapshot *snap_out, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCIDefineByPos(OCIStmt *stmtp, OCIDefine **defnp, OCIError *errhp,
+						 ub4 position, dvoid *valuep, sb4 value_sz, ub2 dty,
+						 dvoid *indp, ub2 *rlenp, ub2 *rcodep, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCIDefineObject(OCIDefine *defnp, OCIError *errhp, 
+                          CONST OCIType *type, dvoid **pgvpp, 
+                          ub4 *pvszsp, dvoid **indpp, ub4 *indszp);
+
+TLORACLE_DLL sword SDO_OCIDefineDynamic(OCIDefine *defnp, OCIError *errhp, dvoid *octxp,
+                           OCICallbackDefine ocbfp);
+
+TLORACLE_DLL sword SDO_OCIDefineArrayOfStruct(OCIDefine *defnp, OCIError *errhp, ub4 pvskip,
+                                 ub4 indskip, ub4 rlskip, ub4 rcskip);
+
+TLORACLE_DLL sword SDO_OCIStmtFetch(OCIStmt *stmtp, OCIError *errhp, ub4 nrows, 
+                       ub2 orientation, ub4 mode);
+
+TLORACLE_DLL sword SDO_OCIStmtGetBindInfo(OCIStmt *stmtp, OCIError *errhp, ub4 size, 
+                             ub4 startloc, sb4 *found, text *bvnp[], ub1 bvnl[],
+                             text *invp[], ub1 inpl[], ub1 dupl[], OCIBind *hndl[]);
+
+TLORACLE_DLL sword SDO_OCIDescribeAny(OCISvcCtx *svchp, OCIError *errhp, dvoid *objptr, 
+                         ub4 objnm_len, ub1 objptr_typ, ub1 info_level,
+						 ub1 objtyp, OCIDescribe *dschp);
+
+TLORACLE_DLL sword SDO_OCIParamGet(CONST dvoid *hndlp, ub4 htype, OCIError *errhp, 
+                      dvoid **parmdpp, ub4 pos);
+
+TLORACLE_DLL sword SDO_OCIParamSet(dvoid *hdlp, ub4 htyp, OCIError *errhp, CONST dvoid *dscp,
+                      ub4 dtyp, ub4 pos);
+
+TLORACLE_DLL sword SDO_OCITransStart(OCISvcCtx *svchp, OCIError *errhp, uword timeout, ub4 flags);
+
+TLORACLE_DLL sword SDO_OCITransDetach(OCISvcCtx *svchp, OCIError *errhp, ub4 flags );
+
+TLORACLE_DLL sword SDO_OCITransCommit(OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+TLORACLE_DLL sword SDO_OCITransRollback(OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+TLORACLE_DLL sword SDO_OCITransPrepare(OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+TLORACLE_DLL sword SDO_OCITransForget(OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+TLORACLE_DLL sword SDO_OCIErrorGet(dvoid *hndlp, ub4 recordno, text *sqlstate,
+                      sb4 *errcodep, text *bufp, ub4 bufsiz, ub4 type);
+
+TLORACLE_DLL sword SDO_OCILobAppend(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *dst_locp,
+                       OCILobLocator *src_locp);
+
+TLORACLE_DLL sword SDO_OCILobAssign(OCIEnv *envhp, OCIError *errhp, CONST OCILobLocator *src_locp, 
+                       OCILobLocator **dst_locpp);
+
+TLORACLE_DLL sword SDO_OCILobCharSetForm(OCIEnv *envhp, OCIError *errhp, 
+							CONST OCILobLocator *locp, ub1 *csfrm);
+
+TLORACLE_DLL sword SDO_OCILobCharSetId(OCIEnv *envhp, OCIError *errhp, 
+						  CONST OCILobLocator *locp, ub2 *csid);
+
+TLORACLE_DLL sword SDO_OCILobCopy(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *dst_locp,
+                     OCILobLocator *src_locp, ub4 amount, ub4 dst_offset, 
+                     ub4 src_offset);
+
+TLORACLE_DLL sword SDO_OCILobDisableBuffering(OCISvcCtx *svchp, OCIError *errhp,
+								 OCILobLocator *locp);
+
+TLORACLE_DLL sword SDO_OCILobEnableBuffering(OCISvcCtx *svchp, OCIError *errhp,
+								OCILobLocator *locp);
+
+TLORACLE_DLL sword SDO_OCILobErase(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                      ub4 *amount, ub4 offset);
+
+TLORACLE_DLL sword SDO_OCILobFileClose(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *filep);
+
+TLORACLE_DLL sword SDO_OCILobFileCloseAll(OCISvcCtx *svchp, OCIError *errhp);
+
+TLORACLE_DLL sword SDO_OCILobFileExists(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *filep,
+						   boolean *flag);
+
+TLORACLE_DLL sword SDO_OCILobFileGetName(OCIEnv *envhp, OCIError *errhp, 
+							CONST OCILobLocator *filep, text *dir_alias, 
+							ub2 *d_length, text *filename, ub2 *f_length);
+
+TLORACLE_DLL sword SDO_OCILobFileIsOpen(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *filep,
+                           boolean *flag);
+
+TLORACLE_DLL sword SDO_OCILobFileOpen(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *filep,
+                         ub1 mode);
+
+TLORACLE_DLL sword SDO_OCILobFileSetName(OCIEnv *envhp, OCIError *errhp, OCILobLocator **filepp, 
+                            CONST text *dir_alias, ub2 d_length, 
+                            CONST text *filename, ub2 f_length);
+
+TLORACLE_DLL sword SDO_OCILobFlushBuffer(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                            ub4 flag);
+
+TLORACLE_DLL sword SDO_OCILobGetLength(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                          ub4 *lenp);
+
+TLORACLE_DLL sword SDO_OCILobIsEqual(OCIEnv *envhp, CONST OCILobLocator *x, 
+						CONST OCILobLocator *y, boolean *is_equal);
+
+TLORACLE_DLL sword SDO_OCILobLoadFromFile(OCISvcCtx *svchp, OCIError *errhp, 
+							 OCILobLocator *dst_locp, OCILobLocator *src_filep, 
+                             ub4 amount, ub4 dst_offset, ub4 src_offset);
+
+TLORACLE_DLL sword SDO_OCILobLocatorIsInit(OCIEnv *envhp, OCIError *errhp, 
+							  CONST OCILobLocator *locp, boolean *is_initialized);
+
+TLORACLE_DLL sword SDO_OCILobRead(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                     ub4 *amtp, ub4 offset, dvoid *bufp, ub4 bufl, 
+                     dvoid *ctxp, sb4 (*cbfp)(dvoid *ctxp, CONST dvoid *bufp, 
+					 ub4 len, ub1 piece), ub2 csid, ub1 csfrm);
+
+TLORACLE_DLL sword SDO_OCILobTrim(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                     ub4 newlen);
+
+TLORACLE_DLL sword SDO_OCILobWrite(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                      ub4 *amtp, ub4 offset, dvoid *bufp, ub4 buflen, ub1 piece, 
+					  dvoid *ctxp, sb4 (*cbfp)(dvoid *ctxp, dvoid *bufp, ub4 *len, 
+					  ub1 *piece), ub2 csid, ub1 csfrm);
+
+TLORACLE_DLL sword SDO_OCIBreak(dvoid *hndlp, OCIError *errhp);
+
+
+TLORACLE_DLL sword SDO_OCIServerVersion(dvoid *hndlp, OCIError *errhp, text *bufp, ub4 bufsz,
+                           ub1 hndltype);
+
+TLORACLE_DLL sword SDO_OCIAttrGet(CONST dvoid *trgthndlp, ub4 trghndltyp, dvoid *attributep, 
+					 ub4 *sizep, ub4 attrtype, OCIError *errhp);
+
+
+TLORACLE_DLL sword SDO_OCIAttrSet(dvoid *trgthndlp, ub4 trghndltyp, dvoid *attributep,
+					 ub4 size, ub4 attrtype, OCIError *errhp);
+
+TLORACLE_DLL sword SDO_OCISvcCtxToLda(OCISvcCtx *svchp, OCIError *errhp, Lda_Def *ldap);
+
+TLORACLE_DLL sword SDO_OCILdaToSvcCtx(OCISvcCtx **svchpp, OCIError *errhp, Lda_Def *ldap);
+
+TLORACLE_DLL sword SDO_OCIResultSetToStmt(OCIResult *rsetdp, OCIError *errhp);
+//@}  
+
+
+/** @name Part II -- OCI navigational interfaces
+*/
+//@{
+TLORACLE_DLL sword SDO_OCIObjectNew(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+
+					   OCITypeCode typecode, OCIType *tdo, dvoid *table, 
+
+					   OCIDuration duration, boolean value, dvoid **instance);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectPin(OCIEnv *env, OCIError *err, OCIRef *object_ref, 
+
+					   OCIComplexObject *corhdl, OCIPinOpt pin_option, 
+
+					   OCIDuration pin_duration, OCILockOpt lock_option, 
+
+					   dvoid **object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectUnpin(OCIEnv *env, OCIError *err, dvoid *object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectPinCountReset(OCIEnv *env, OCIError *err, dvoid *object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectLock(OCIEnv *env, OCIError *err, dvoid *object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectMarkUpdate(OCIEnv *env, OCIError *err, dvoid *object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectUnmark(OCIEnv *env, OCIError *err, dvoid *object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectUnmarkByRef(OCIEnv *env, OCIError *err, OCIRef *ref);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectFree(OCIEnv *env, OCIError *err, dvoid *instance, 
+
+                        ub2 flags);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectMarkDeleteByRef(OCIEnv *env, OCIError *err, OCIRef *object_ref);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectMarkDelete(OCIEnv *env, OCIError *err, dvoid *instance);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectFlush(OCIEnv *env, OCIError *err, dvoid *object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectRefresh(OCIEnv *env, OCIError *err, dvoid *object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectCopy(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+                        dvoid *source, dvoid *null_source, dvoid *target, 
+
+						dvoid *null_target, OCIType *tdo, OCIDuration duration, 
+
+						ub1 option);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectGetTypeRef(OCIEnv *env, OCIError *err, dvoid *instance, 
+
+                              OCIRef *type_ref);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectGetObjectRef(OCIEnv *env, OCIError *err, dvoid *object, 
+
+                                OCIRef *object_ref);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectGetInd(OCIEnv *env, OCIError *err, dvoid *instance, 
+
+                          dvoid **null_struct);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectExists(OCIEnv *env, OCIError *err, dvoid *ins, boolean *exist);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectGetProperty(OCIEnv *envh, OCIError *errh, CONST dvoid *obj, 
+
+							   OCIObjectPropId propertyId, dvoid *property, 
+
+							   ub4 *size);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectIsLocked(OCIEnv *env, OCIError *err, dvoid *ins, boolean *lock);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectIsDirty(OCIEnv *env, OCIError *err, dvoid *ins, boolean *dirty);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectPinTable(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+							CONST text *schema_name, ub4 s_n_length, 
+
+							CONST text *object_name, ub4 o_n_length, 
+
+							CONST OCIRef *scope_obj_ref, OCIDuration pin_duration, 
+
+							dvoid** object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectArrayPin(OCIEnv *env, OCIError *err, OCIRef **ref_array, 
+
+							ub4 array_size, OCIComplexObject **cor_array,
+
+							ub4 cor_array_size, OCIPinOpt pin_option, 
+
+							OCIDuration pin_duration, OCILockOpt lock, 
+
+							dvoid **obj_array, ub4 *pos);
+
+
+
+TLORACLE_DLL sword SDO_OCICacheFlush(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+						dvoid *context, OCIRef *(*get)(dvoid *context, ub1 *last),
+
+						OCIRef **ref);
+
+
+
+TLORACLE_DLL sword SDO_OCICacheRefresh(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+
+						  OCIRefreshOpt option, dvoid *context,
+
+						  OCIRef *(*get)(dvoid *context), OCIRef **ref);
+
+
+
+TLORACLE_DLL sword SDO_OCICacheUnpin(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc);
+
+
+
+TLORACLE_DLL sword SDO_OCICacheFree(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc); 
+
+
+
+TLORACLE_DLL sword SDO_OCICacheUnmark(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc);
+
+
+
+TLORACLE_DLL sword SDO_OCIDurationBegin(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+                           OCIDuration parent, OCIDuration *dur);
+
+
+
+TLORACLE_DLL sword SDO_OCIDurationEnd(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+                         OCIDuration duration);
+
+
+
+TLORACLE_DLL sword SDO_OCIDurationGetParent(OCIEnv *env, OCIError *err, 
+
+                               OCIDuration duration, OCIDuration *parent);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectAlwaysLatest(OCIEnv *env, OCIError *err, dvoid *object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectNotAlwaysLatest(OCIEnv *env, OCIError *err, dvoid *object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectFlushRefresh(OCIEnv *env, OCIError *err, dvoid *object);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectIsLoaded(OCIEnv *env, OCIError *err, dvoid *ins, 
+
+							boolean *load);
+
+
+
+TLORACLE_DLL sword SDO_OCIObjectIsDirtied(OCIEnv *env, OCIError *err, dvoid *ins,
+
+							 boolean *dirty);
+
+
+
+TLORACLE_DLL sword SDO_OCICacheGetObjects(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+
+							 OCIObjectProperty property, dvoid *client_context,
+
+							 void (*client_callback)(dvoid *client_context,
+
+							 dvoid *object));
+
+
+
+TLORACLE_DLL sword SDO_OCICacheRegister(OCIEnv *env, OCIError *err, OCIObjectEvent event,
+
+						   dvoid *client_context, void (*client_callback)(
+
+						   dvoid *client_context, OCIObjectEvent event,
+
+						   dvoid *object));
+
+
+
+TLORACLE_DLL sword SDO_OCICacheFlushRefresh(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+							   dvoid *context, OCIRef *(*get)(dvoid *context, 
+
+							   ub1 *last), OCIRef **ref);
+
+//@}
+
+
+/** @name Part III -- OCI primitive OTS interfaces  
+*/
+//@{
+TLORACLE_DLL void SDO_OCINumberSetZero(OCIError *err, OCINumber *num);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberAdd(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberSub(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberMul(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberDiv(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberMod(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberIntPower(OCIError *err, CONST OCINumber *base,
+
+                            CONST sword exp, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberNeg(OCIError *err, CONST OCINumber *number,
+
+                       OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberToText(OCIError *err, CONST OCINumber *number, 
+
+                          CONST text *fmt, ub4 fmt_length,
+
+                          CONST text *nls_params, ub4 nls_p_length,
+
+                          ub4 *buf_size, text *buf);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberFromText(OCIError *err, CONST text *str, ub4 str_length, 
+
+							CONST text *fmt, ub4 fmt_length, 
+
+							CONST text *nls_params, ub4 nls_p_length, 
+
+							OCINumber *number);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberToInt(OCIError *err, CONST OCINumber *number,
+
+                         uword rsl_length, uword rsl_flag, dvoid *rsl);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberFromInt(OCIError *err, CONST dvoid *inum, uword inum_length,
+
+						   uword inum_s_flag, OCINumber *number);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberToReal(OCIError *err, CONST OCINumber *number,
+
+                          uword rsl_length, dvoid *rsl);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberFromReal(OCIError *err, CONST dvoid *rnum,
+
+                            uword rnum_length, OCINumber *number);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberCmp(OCIError *err, CONST OCINumber *number1, 
+
+                       CONST OCINumber *number2, sword *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberSign(OCIError *err, CONST OCINumber *number,
+
+                        sword *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberIsZero(OCIError *err, CONST OCINumber *number,
+
+                          boolean *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberAssign(OCIError *err, CONST OCINumber *from,
+
+                          OCINumber *to);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberAbs(OCIError *err, CONST OCINumber *number,
+
+                       OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberCeil(OCIError *err, CONST OCINumber *number,
+
+                        OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberFloor(OCIError *err, CONST OCINumber *number, 
+
+                         OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberSqrt(OCIError *err, CONST OCINumber *number, 
+
+                        OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberTrunc(OCIError *err, CONST OCINumber *number, 
+
+                         sword decplace, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberPower(OCIError *err, CONST OCINumber *base, 
+
+                         CONST OCINumber *number, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberRound(OCIError *err, CONST OCINumber *number,
+
+                         sword decplace, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberSin(OCIError *err, CONST OCINumber *number,
+
+                       OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberArcSin(OCIError *err, CONST OCINumber *number,
+
+                          OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberHypSin(OCIError *err, CONST OCINumber *number, 
+
+                          OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberCos(OCIError *err, CONST OCINumber *number, 
+
+                       OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberArcCos(OCIError *err, CONST OCINumber *number, 
+
+                          OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberHypCos(OCIError *err, CONST OCINumber *number, 
+
+                          OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberTan(OCIError *err, CONST OCINumber *number, 
+
+                       OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberArcTan(OCIError *err, CONST OCINumber *number, 
+
+                          OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberArcTan2(OCIError *err, CONST OCINumber *number1, 
+
+                           CONST OCINumber *number2, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberHypTan(OCIError *err, CONST OCINumber *number, 
+
+                          OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberExp(OCIError *err, CONST OCINumber *number, 
+
+                       OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberLn(OCIError *err, CONST OCINumber *number, 
+
+                      OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCINumberLog(OCIError *err, CONST OCINumber *base, 
+
+                       CONST OCINumber *number, OCINumber *result);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateAssign(OCIError *err, CONST OCIDate *from, OCIDate *to);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateToText(OCIError *err, CONST OCIDate *date, 
+
+                        CONST text *fmt, ub1 fmt_length, 
+
+                        CONST text *lang_name, ub4 lang_length, 
+
+                        ub4 *buf_size, text *buf);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateFromText(OCIError *err, CONST text *date_str, 
+
+						  ub4 d_str_length, CONST text *fmt, ub1 fmt_length, 
+
+						  CONST text *lang_name, ub4 lang_length, 
+
+						  OCIDate *date);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateCompare(OCIError *err, CONST OCIDate *date1, 
+
+						 CONST OCIDate *date2, sword *result);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateAddMonths(OCIError *err, CONST OCIDate *date, sb4 num_months,
+
+                           OCIDate *result);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateAddDays(OCIError *err, CONST OCIDate *date, sb4 num_days,
+
+                         OCIDate *result);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateLastDay(OCIError *err, CONST OCIDate *date, 
+
+                         OCIDate *last_day);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateDaysBetween(OCIError *err, CONST OCIDate *date1, 
+
+                             CONST OCIDate *date2, sb4 *num_days);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateZoneToZone(OCIError *err, CONST OCIDate *date1,
+
+                            CONST text *zon1, ub4 zon1_length, 
+
+							CONST text *zon2, ub4 zon2_length, OCIDate *date2);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateNextDay(OCIError *err, CONST OCIDate *date, CONST text *day_p, 
+
+                         ub4 day_length, OCIDate *next_day);
+
+
+
+
+
+TLORACLE_DLL sword SDO_OCIDateCheck(OCIError *err, CONST OCIDate *date, uword *valid);
+
+
+
+TLORACLE_DLL sword SDO_OCIDateSysDate(OCIError *err, OCIDate *sys_date);
+
+
+
+TLORACLE_DLL sword SDO_OCIStringAssign(OCIEnv *env, OCIError *err, CONST OCIString *rhs, 
+
+                          OCIString **lhs);
+
+
+
+TLORACLE_DLL sword SDO_OCIStringAssignText(OCIEnv *env, OCIError *err, CONST text *rhs, 
+
+                              ub4 rhs_len, OCIString **lhs);
+
+
+
+TLORACLE_DLL sword SDO_OCIStringResize(OCIEnv *env, OCIError *err, ub4 new_size, 
+
+                          OCIString **str);
+
+
+
+TLORACLE_DLL ub4 SDO_OCIStringSize(OCIEnv *env, CONST OCIString *vs);
+
+
+
+TLORACLE_DLL text *SDO_OCIStringPtr(OCIEnv *env, CONST OCIString *vs);
+
+
+
+TLORACLE_DLL sword SDO_OCIStringAllocSize(OCIEnv *env, OCIError *err, CONST OCIString *vs, 
+
+                             ub4 *allocsize);
+
+
+
+TLORACLE_DLL sword SDO_OCIRawAssignRaw(OCIEnv *env, OCIError *err, CONST OCIRaw *rhs, 
+
+                          OCIRaw **lhs);
+
+
+
+TLORACLE_DLL sword SDO_OCIRawAssignBytes(OCIEnv *env, OCIError *err, CONST ub1 *rhs, 
+
+                            ub4 rhs_len, OCIRaw **lhs);
+
+
+
+TLORACLE_DLL sword SDO_OCIRawResize(OCIEnv *env, OCIError *err, ub4 new_size, OCIRaw **raw);
+
+
+
+TLORACLE_DLL ub4 SDO_OCIRawSize(OCIEnv *env, CONST OCIRaw *raw);
+
+
+
+TLORACLE_DLL ub1 *SDO_OCIRawPtr(OCIEnv *env, CONST OCIRaw *raw);
+
+
+
+TLORACLE_DLL sword SDO_OCIRawAllocSize(OCIEnv *env, OCIError *err, CONST OCIRaw *raw,
+
+						  ub4 *allocsize);
+
+
+
+TLORACLE_DLL void SDO_OCIRefClear(OCIEnv *env, OCIRef *ref);
+
+
+
+TLORACLE_DLL sword SDO_OCIRefAssign(OCIEnv *env, OCIError *err, CONST OCIRef *source, 
+
+                       OCIRef **target);
+
+
+
+TLORACLE_DLL boolean SDO_OCIRefIsEqual(OCIEnv *env, CONST OCIRef *x, CONST OCIRef *y);
+
+
+
+TLORACLE_DLL boolean SDO_OCIRefIsNull(OCIEnv *env, CONST OCIRef *ref);
+
+
+
+TLORACLE_DLL ub4 SDO_OCIRefHexSize(OCIEnv *env, CONST OCIRef *ref);
+
+
+
+TLORACLE_DLL sword SDO_OCIRefFromHex(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+                        CONST text *hex, ub4 length, OCIRef **ref);
+
+
+
+TLORACLE_DLL sword SDO_OCIRefToHex(OCIEnv *env, OCIError *err, CONST OCIRef *ref, 
+
+                      text *hex, ub4 *hex_length);
+
+
+
+TLORACLE_DLL sword SDO_OCICollSize(OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+
+					  sb4 *size);
+
+
+
+TLORACLE_DLL sb4 SDO_OCICollMax(OCIEnv *env, CONST OCIColl *coll);
+
+
+
+TLORACLE_DLL sword SDO_OCICollGetElem(OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+
+                         sb4 index, boolean *exists, dvoid **elem, 
+
+                         dvoid **elemind);
+
+
+
+TLORACLE_DLL sword SDO_OCICollAssignElem(OCIEnv *env, OCIError *err, sb4 index, 
+
+                            CONST dvoid *elem, 
+
+                            CONST dvoid *elemind, OCIColl *coll);
+
+
+
+TLORACLE_DLL sword SDO_OCICollAssign(OCIEnv *env, OCIError *err, CONST OCIColl *rhs, 
+
+                        OCIColl *lhs);
+
+
+
+TLORACLE_DLL sword SDO_OCICollAppend(OCIEnv *env, OCIError *err, CONST dvoid *elem, 
+
+                        CONST dvoid *elemind, OCIColl *coll);
+
+
+
+TLORACLE_DLL sword SDO_OCICollTrim(OCIEnv *env, OCIError *err, sb4 trim_num, 
+
+                      OCIColl *coll);
+
+
+
+TLORACLE_DLL sword SDO_OCIIterCreate(OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+
+                        OCIIter **itr);
+
+
+
+TLORACLE_DLL sword SDO_OCIIterDelete(OCIEnv *env, OCIError *err, OCIIter **itr);
+
+
+
+TLORACLE_DLL sword SDO_OCIIterInit(OCIEnv *env, OCIError *err, CONST OCIColl *coll, 
+
+                      OCIIter *itr);
+
+
+
+TLORACLE_DLL sword SDO_OCIIterGetCurrent(OCIEnv *env, OCIError *err, CONST OCIIter *itr, 
+
+                            dvoid **elem, dvoid **elemind);
+
+
+
+TLORACLE_DLL sword SDO_OCIIterNext(OCIEnv *env, OCIError *err, OCIIter *itr, 
+
+                      dvoid **elem, dvoid **elemind, boolean *eoc);
+
+
+
+TLORACLE_DLL sword SDO_OCIIterPrev(OCIEnv *env, OCIError *err, OCIIter *itr, 
+
+                      dvoid **elem, dvoid **elemind, boolean *boc);
+
+
+
+TLORACLE_DLL sword SDO_OCITableSize(OCIEnv *env, OCIError *err, CONST OCITable *tbl, 
+
+					   sb4 *size);
+
+
+
+TLORACLE_DLL sword SDO_OCITableExists(OCIEnv *env, OCIError *err, CONST OCITable *tbl,
+
+						 sb4 index, boolean *exists);
+
+
+
+TLORACLE_DLL sword SDO_OCITableDelete(OCIEnv *env, OCIError *err, sb4 index, OCITable *tbl);
+
+
+
+TLORACLE_DLL sword SDO_OCITableFirst(OCIEnv *env, OCIError *err, CONST OCITable *tbl, 
+
+                        sb4 *index);
+
+
+
+TLORACLE_DLL sword SDO_OCITableLast(OCIEnv *env, OCIError *err, CONST OCITable *tbl, 
+
+                       sb4 *index);
+
+
+
+TLORACLE_DLL sword SDO_OCITableNext(OCIEnv *env, OCIError *err, sb4 index, 
+
+					   CONST OCITable *tbl, sb4 *next_index, boolean *exists);
+
+
+
+TLORACLE_DLL sword SDO_OCITablePrev(OCIEnv *env, OCIError *err, sb4 index, 
+
+                       CONST OCITable *tbl, sb4 *prev_index, boolean *exists);
+//@}
+
+/** @name Part IV -- OCI open type manager interfaces
+*/
+//@{
+TLORACLE_DLL sword SDO_OCITypeIterNew(OCIEnv *env, OCIError *err, OCIType *tdo, 
+
+                         OCITypeIter **iteratorOCI);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeIterSet(OCIEnv *env, OCIError *err, OCIType *tdo, 
+
+						 OCITypeIter *iteratorOCI);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeIterFree(OCIEnv *env, OCIError *err, OCITypeIter *iteratorOCI);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeByName(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, 
+
+                        CONST text *schema_name, ub4 s_length,
+
+                        CONST text *type_name, ub4 t_length,
+
+                        CONST text *version_name, ub4 v_length,
+
+                        OCIDuration pin_duration, OCITypeGetOpt get_option,
+
+                        OCIType **tdo);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeArrayByName(OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc,
+
+                             ub4 array_len, CONST text *schema_name[], 
+
+							 ub4 s_length[], CONST text *type_name[], 
+
+							 ub4 t_length[], CONST text *version_name[], 
+
+							 ub4 v_length[], OCIDuration pin_duration,
+
+                             OCITypeGetOpt get_option, OCIType *tdo[]);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeByRef(OCIEnv *env, OCIError *err, CONST OCIRef *type_ref, 
+
+					   OCIDuration pin_duration,OCITypeGetOpt get_option, 
+
+					   OCIType **tdo);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeArrayByRef(OCIEnv *env, OCIError *err, ub4 array_len, 
+
+							CONST OCIRef *type_ref[], OCIDuration pin_duration,
+
+							OCITypeGetOpt get_option, OCIType *tdo[]);
+
+
+
+TLORACLE_DLL text* SDO_OCITypeName(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                      ub4 *n_length);
+
+
+
+TLORACLE_DLL text* SDO_OCITypeSchema(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+						ub4 *n_length);
+
+
+
+TLORACLE_DLL OCITypeCode SDO_OCITypeTypeCode(OCIEnv *env, OCIError *err, CONST OCIType *tdo);
+
+
+
+TLORACLE_DLL OCITypeCode SDO_OCITypeCollTypeCode(OCIEnv *env, OCIError *err, 
+
+									CONST OCIType *tdo);
+
+
+
+TLORACLE_DLL text* SDO_OCITypeVersion(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                         ub4 *v_length);
+
+
+
+TLORACLE_DLL ub4 SDO_OCITypeAttrs(OCIEnv *env, OCIError *err, CONST OCIType *tdo);
+
+
+
+TLORACLE_DLL ub4 SDO_OCITypeMethods(OCIEnv *env, OCIError *err, CONST OCIType *tdo);
+
+
+
+TLORACLE_DLL text* SDO_OCITypeElemName(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem, 
+
+                          ub4 *n_length);
+
+
+
+TLORACLE_DLL OCITypeCode SDO_OCITypeElemTypeCode(OCIEnv *env, OCIError *err,
+
+                                    CONST OCITypeElem *elem);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeElemType(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem, 
+
+                          OCIType **elem_tdo);
+
+
+
+TLORACLE_DLL ub4 SDO_OCITypeElemFlags(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem);
+
+
+
+TLORACLE_DLL ub1 SDO_OCITypeElemNumPrec(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem);
+
+
+
+TLORACLE_DLL sb1 SDO_OCITypeElemNumScale(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem);
+
+
+
+TLORACLE_DLL ub4 SDO_OCITypeElemLength(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem);
+
+
+
+TLORACLE_DLL ub2 SDO_OCITypeElemCharSetID(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem);
+
+
+
+TLORACLE_DLL ub2 SDO_OCITypeElemCharSetForm(OCIEnv *env, OCIError *err, CONST OCITypeElem *elem);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeElemParameterizedType(OCIEnv *env, OCIError *err,
+
+                                       CONST OCITypeElem *elem, 
+
+									   OCIType **type_stored);
+
+
+
+TLORACLE_DLL OCITypeCode SDO_OCITypeElemExtTypeCode(OCIEnv *env, OCIError *err,
+
+                                       CONST OCITypeElem *elem);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeAttrByName(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                            CONST text *name, ub4 n_length, OCITypeElem **elem);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeAttrNext(OCIEnv *env, OCIError *err, OCITypeIter *iteratorOCI,
+
+                          OCITypeElem **elem);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeCollElem(OCIEnv *env, OCIError *err, CONST OCIType *tdo,
+
+                          OCITypeElem **element);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeCollSize(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                          ub4 *num_elems);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeCollExtTypeCode(OCIEnv *env, OCIError *err,
+
+                                 CONST OCIType *tdo, OCITypeCode *sqt_code);
+
+
+
+TLORACLE_DLL ub4 SDO_OCITypeMethodOverload(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                              CONST text *method_name, ub4 m_length);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeMethodByName(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                              CONST text *method_name, ub4 m_length,
+
+                              OCITypeMethod **mdos);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeMethodNext(OCIEnv *env, OCIError *err, OCITypeIter *iteratorOCI,
+
+                            OCITypeMethod **mdo);
+
+
+
+TLORACLE_DLL text *SDO_OCITypeMethodName(OCIEnv *env, OCIError *err,
+
+                            CONST OCITypeMethod *mdo, ub4 *n_length);
+
+
+
+TLORACLE_DLL OCITypeEncap SDO_OCITypeMethodEncap(OCIEnv *env, OCIError *err,
+
+                                    CONST OCITypeMethod *mdo);
+
+
+
+TLORACLE_DLL OCITypeMethodFlag SDO_OCITypeMethodFlags(OCIEnv *env, OCIError *err,
+
+                                         CONST OCITypeMethod *mdo);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeMethodMap(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                           OCITypeMethod **mdo);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeMethodOrder(OCIEnv *env, OCIError *err, CONST OCIType *tdo, 
+
+                             OCITypeMethod **mdo);
+
+
+
+TLORACLE_DLL ub4 SDO_OCITypeMethodParams(OCIEnv *env, OCIError *err,
+
+                            CONST OCITypeMethod *mdo);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeResult(OCIEnv *env, OCIError *err, CONST OCITypeMethod *mdo,
+
+                        OCITypeElem **elem);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeParamByPos(OCIEnv *env, OCIError *err, CONST OCITypeMethod *mdo, 
+
+							ub4 position, OCITypeElem **elem);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeParamByName(OCIEnv *env, OCIError *err, CONST OCITypeMethod *mdo, 
+
+                             CONST text *name, ub4 n_length, OCITypeElem **elem);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeParamPos(OCIEnv *env, OCIError *err, CONST OCITypeMethod *mdo, 
+
+                          CONST text *name, ub4 n_length, ub4 *position, 
+
+                          OCITypeElem **elem);
+
+
+
+TLORACLE_DLL OCITypeParamMode SDO_OCITypeElemParamMode(OCIEnv *env, OCIError *err,
+
+                                          CONST OCITypeElem *elem);
+
+
+
+TLORACLE_DLL text* SDO_OCITypeElemDefaultValue(OCIEnv *env, OCIError *err,
+
+                                  CONST OCITypeElem *elem, ub4 *d_v_length);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeVTInit(OCIEnv *env, OCIError *err);
+
+ 
+
+TLORACLE_DLL sword SDO_OCITypeVTInsert(OCIEnv *env, OCIError *err, CONST text *schema_name,
+
+						  ub4 s_n_length, CONST text *type_name, ub4 t_n_length, 
+
+						  CONST text *user_version, ub4 u_v_length);
+
+
+
+TLORACLE_DLL sword SDO_OCITypeVTSelect(OCIEnv *env, OCIError *err, CONST text *schema_name,
+
+						  ub4 s_n_length, CONST text *type_name, ub4 t_n_length, 
+
+						  text **user_version, ub4 *u_v_length, ub2 *version);
+//@}
+
+#endif 
+
+
+
+
diff --git a/src/terralib/drivers/Oracle/TeOracleDefines.h b/src/terralib/drivers/Oracle/TeOracleDefines.h
new file mode 100644
index 0000000..a1ab2a1
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOracleDefines.h
@@ -0,0 +1,49 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeOracleDefines.h
+    \brief Provides a set of general definitions used by te_oracle project.
+*/
+#ifndef  __TERRALIB_INTERNAL_ORACLEDEFINES_H
+#define  __TERRALIB_INTERNAL_ORACLEDEFINES_H
+
+/** @defgroup TerraLib_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLORACLE_AS_DLL
+#define TLORACLE_DLL __declspec(dllexport)
+#else
+#define TLORACLE_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TLORACLE_DLL
+#endif
+/** @} */ 
+
+#endif //__TERRALIB_INTERNAL_ORACLEDEFINES_H
diff --git a/src/terralib/drivers/Oracle/TeOracleSpatial.cpp b/src/terralib/drivers/Oracle/TeOracleSpatial.cpp
new file mode 100644
index 0000000..436c70b
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOracleSpatial.cpp
@@ -0,0 +1,3588 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeOracleSpatial.h"
+
+#include <sys/stat.h>
+#include "TeSpatialOperations.h"
+#include "TeGeometryAlgorithms.h"
+
+string 
+getOracleSpatialRelation(int relation)
+{
+	string spatialRel="";
+	switch (relation)
+	{
+		case TeDISJOINT:
+		case TeINTERSECTS:
+			spatialRel = "ANYINTERACT";	
+		break;
+
+		case TeTOUCHES:
+			spatialRel = "TOUCH";
+		break;
+
+		case TeOVERLAPS:
+			spatialRel = "OVERLAPBDYINTERSECT";
+		break;
+
+		case TeCOVERS:
+			spatialRel = "COVERS"; 
+		break;
+
+		case TeCOVEREDBY:
+			spatialRel = "COVEREDBY";
+		break;
+		
+		case TeCONTAINS:
+			spatialRel = "CONTAINS";
+		break;
+		
+		case TeWITHIN:
+			spatialRel = "INSIDE";
+		break;
+		
+		case TeEQUALS:
+			spatialRel = "EQUAL";
+		break;
+		
+		case TeCROSSES:
+			spatialRel = "OVERLAPBDYDISJOINT";
+		break;
+		default:
+			spatialRel = "";
+		break;
+	}
+	
+	return spatialRel;
+}
+
+
+TeOracleSpatial::TeOracleSpatial() : TeOCIOracle()  
+{
+	dbmsName_ = "OracleSpatial";
+}
+
+
+bool
+TeOracleSpatial::createSpatialIndex(const string &table, const string &column,TeSpatialIndexType type, short level, short tile)
+{
+	TeOracleSpatialPortal  *ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string name;
+	if(table.size()>21)
+		name = TeConvertToUpperCase(table.substr(0,20)) + "_IDX";
+	else
+		name = TeConvertToUpperCase(table) + "_IDX";
+	
+	string index = "SELECT * FROM USER_SDO_INDEX_INFO";
+	index += " WHERE table_name = '" + TeConvertToUpperCase(table) + "'";
+	if(!ocip->query(index))
+	{
+		delete ocip;
+		return false;
+	}
+	
+	if(ocip->fetchRow())
+	{
+		errorMessage_ = "Spatial Index table already exist!";
+		delete ocip;
+		return false;
+	}
+		
+	delete ocip;
+
+	index = " CREATE INDEX " + name;
+	index += " ON " + table + "(" + column + ")";
+	index += " INDEXTYPE IS MDSYS.SPATIAL_INDEX ";
+	
+	if(type == TeQUADTREE)
+	{
+		if(level==0)
+			return false;
+
+		index += " PARAMETERS ('";
+		index += "SDO_LEVEL = " + Te2String(level);
+		index += " SDO_NUMTILES = " + Te2String(tile) + "'";
+	}
+
+	if(!execute(index))
+		return false;
+	
+	return true;
+}
+
+bool
+TeOracleSpatial::insertMetadata(const string &table, const string &column, double tolx,double toly,TeBox &box,short /* srid */)
+{	
+	TeOracleSpatialPortal	*ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string check = "SELECT * FROM USER_SDO_GEOM_METADATA ";
+	check += " WHERE TABLE_NAME = '" + TeConvertToUpperCase(table);
+	check += "' AND COLUMN_NAME = '" + TeConvertToUpperCase(column) + "'";
+	if(!ocip->query(check))
+	{
+		delete ocip;
+		return false;
+	}
+
+	if(ocip->fetchRow())
+	{
+		delete ocip;
+		return false;
+	}
+			
+	delete ocip;
+	
+	double xmin = box.x1();
+	double ymin = box.y1();
+	double xmax = box.x2();
+	double ymax = box.y2();
+
+	string inser = "INSERT INTO USER_SDO_GEOM_METADATA VALUES ( ";
+	inser += "'" + TeConvertToUpperCase(table) + "' ," ;
+	inser += "'" + TeConvertToUpperCase(column) + "' ," ; 
+	inser += " MDSYS.SDO_DIM_ARRAY(";
+	inser += " MDSYS.SDO_DIM_ELEMENT('X',";
+	inser += Te2String(xmin,15) + "," + Te2String(xmax,15) + "," + Te2String(tolx,15) + "), ";
+	inser += " MDSYS.SDO_DIM_ELEMENT('Y',";
+	inser += Te2String(ymin,15) + "," + Te2String(ymax,15) + "," + Te2String(toly,15) + ")), ";
+	inser += " NULL ) ";
+
+	if(!(execute(inser.c_str()))) 
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table USER_SDO_GEOM_METADATA! "; 
+		return false;
+	}
+
+	return true;
+}
+
+string 
+TeOracleSpatial::getSpatialIdxColumn(TeGeomRep rep)
+{
+	if (rep == TeRASTER)
+		return "block_box";
+
+	return "spatial_data";
+}
+
+
+bool
+TeOracleSpatial::connect(const string& host, const string& user, const string& password, const string& database, int port)
+{
+	if(connection_ == NULL)
+	{
+		connection_ = new TeOCIConnection();
+	}
+	else if (connection_->isConnected())
+	{ 
+		delete (connection_);
+		connection_ = new TeOCIConnection();
+	}
+
+	isConnected_ = false;
+	if (connection_->connect(host.c_str(),user.c_str(),password.c_str(), true))
+	{
+		isConnected_ = true;
+		host_ = host;
+		user_ = user;
+		password_ = password;
+		database_ = database;
+		portNumber_ = port;
+		return true;
+	}
+	else
+	{
+		isConnected_ = false;
+		errorMessage_ = "Error connecting to database server!";
+		delete (connection_); //disconect
+		connection_=NULL;
+		return false;
+	}
+}
+
+bool
+TeOracleSpatial::createTable(const string& table, TeAttributeList &attr)
+{
+	short	cont=0;
+	string pkeys ="";
+	bool	hasAutoNumber=false;
+	string	fieldName="";
+
+	if(tableExist(table))
+	{
+		errorMessage_= "Table already exist!";
+		return false;
+	}
+
+	TeAttributeList::iterator it = attr.begin();
+	string tablec;
+	tablec = "CREATE TABLE " + table +" (";
+	
+	while ( it != attr.end())
+	{
+		if (cont)
+			tablec += ", ";
+			
+		switch ((*it).rep_.type_)
+		{
+			case TeSTRING:
+				if((*it).rep_.numChar_ > 0)
+				{
+					tablec += (*it).rep_.name_ + " VARCHAR2(" + Te2String((*it).rep_.numChar_) + ")";
+				}
+				else
+				{
+					tablec += (*it).rep_.name_ + " VARCHAR2(4000)";
+				}
+				if(!((*it).rep_.defaultValue_.empty()))
+					tablec += " DEFAULT '" + (*it).rep_.defaultValue_ + "' ";
+
+				if(!((*it).rep_.null_))
+					tablec += " NOT NULL ";
+			break;
+			
+			case TeREAL:
+				if((*it).rep_.decimals_>0)
+					tablec += (*it).rep_.name_ +" NUMBER(*,"+ Te2String((*it).rep_.decimals_) +") ";
+				else
+					tablec += (*it).rep_.name_ +" NUMBER(*,38) ";
+
+				if(!((*it).rep_.defaultValue_.empty()))
+					tablec += " DEFAULT " + (*it).rep_.defaultValue_ + " ";
+
+				if(!((*it).rep_.null_))
+					tablec += " NOT NULL ";
+			break;
+			
+			case TeINT:
+			case TeUNSIGNEDINT:
+				tablec += (*it).rep_.name_ + " NUMBER(32) ";
+				if((*it).rep_.isAutoNumber_)
+				{
+					hasAutoNumber=true;
+					fieldName=(*it).rep_.name_;
+				}
+
+				if(!((*it).rep_.defaultValue_.empty()))
+					tablec += " DEFAULT " + (*it).rep_.defaultValue_ + " ";
+
+				if(!((*it).rep_.null_))
+					tablec += " NOT NULL ";
+
+			break;
+
+			case TeDATETIME:
+				tablec += (*it).rep_.name_ + " DATE ";
+				if(!((*it).rep_.defaultValue_.empty()))
+					tablec += " DEFAULT " + (*it).rep_.defaultValue_ + " ";
+
+				if(!((*it).rep_.null_))
+					tablec += " NOT NULL ";
+			break;
+
+			case TeCHARACTER:
+				tablec += (*it).rep_.name_ + " CHAR ";
+				if(!((*it).rep_.defaultValue_.empty()))
+					tablec += " DEFAULT " + (*it).rep_.defaultValue_ + " ";
+
+				if(!((*it).rep_.null_))
+					tablec += " NOT NULL ";
+			break;
+
+			case TeBOOLEAN:
+				tablec += (*it).rep_.name_ + " NUMBER(1) ";
+				if(!((*it).rep_.defaultValue_.empty()))
+					tablec += " DEFAULT " + (*it).rep_.defaultValue_ + " ";
+
+				if(!((*it).rep_.null_))
+					tablec += " NOT NULL ";
+			break;
+
+			case TeBLOB:
+				tablec += (*it).rep_.name_ + " BLOB ";
+			break;
+
+			case TePOINTTYPE:
+			case TePOINTSETTYPE:
+							tablec += "spatial_data	MDSYS.SDO_GEOMETRY ";
+							++it;
+							cont++;
+							continue;
+
+			case TeLINE2DTYPE:
+			case TeLINESETTYPE:
+							tablec += "spatial_data	MDSYS.SDO_GEOMETRY ";
+							++it;
+							cont++;
+							continue;
+
+			case TePOLYGONTYPE:
+			case TePOLYGONSETTYPE:
+							tablec += "spatial_data	MDSYS.SDO_GEOMETRY ";
+							++it;
+							cont++;
+							continue;
+
+			case TeCELLTYPE:
+			case TeCELLSETTYPE:
+							tablec += "col_number	NUMBER(32) NOT NULL,";
+							tablec += "row_number	NUMBER(32) NOT NULL,";
+							tablec += "spatial_data	MDSYS.SDO_GEOMETRY ";
+
+							++it;
+							cont++;
+							continue;					
+
+			case TeRASTERTYPE:
+							tablec += "band_id NUMBER(32) NOT NULL, ";
+							tablec += "resolution_factor NUMBER(32), ";
+							tablec += "subband NUMBER(32),";
+							tablec += "block_box  MDSYS.SDO_GEOMETRY, ";
+							tablec += "block_size NUMBER(32), ";
+							tablec += "spatial_data BLOB ";
+							
+							++it;
+							cont++;
+							continue;
+
+			case TeNODETYPE:
+			case TeNODESETTYPE:
+							tablec += "spatial_data	MDSYS.SDO_GEOMETRY ";
+
+							++it;
+							cont++;
+							continue;
+
+			case TeTEXTTYPE:
+			case TeTEXTSETTYPE:
+
+			default:
+				tablec += (*it).rep_.name_ + " VARCHAR2(255) ";
+				if(!((*it).rep_.defaultValue_.empty()))
+					tablec += " DEFAULT " + (*it).rep_.defaultValue_ + " ";
+
+				if(!((*it).rep_.null_))
+					tablec += " NOT NULL ";
+			break;
+		}
+
+		// check if column is part of primary key
+		if ((*it).rep_.isPrimaryKey_ && (*it).rep_.type_ != TeBLOB )
+		{
+			if (!pkeys.empty())
+				pkeys += ", ";
+			pkeys += (*it).rep_.name_;
+		}
+
+		++it;
+		cont++;
+	}
+
+	if(!pkeys.empty())
+		tablec += ", PRIMARY KEY (" + pkeys + ") ";
+
+	tablec += ")";
+
+	if(!execute(tablec))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error creating table " + table;
+
+		return false;
+	}
+
+	if(hasAutoNumber)
+	{
+		string dropSql = " DROP TRIGGER "+ getNameTrigger(table); 
+		execute(dropSql);
+		dropSql = " DROP SEQUENCE "+ getNameSequence(table); 
+		execute(dropSql);
+
+		if(!createSequence(table))
+		{
+			deleteTable(table);
+			return false;
+		}
+		
+		if(!createAutoIncrementTrigger(table,fieldName))
+		{
+			deleteTable(table);
+			string sql= "DROP SEQUENCE "+ getNameSequence(table);
+			execute(sql); 
+			return false;
+		}
+	}
+	return true;
+}
+
+TeDatabasePortal*  
+TeOracleSpatial::getPortal ()
+{
+	TeOracleSpatialPortal* ocip = new TeOracleSpatialPortal (this);
+	return ocip;
+}
+
+std::string TeOracleSpatial::getSQLOrderBy(const TeGeomRep& rep) const
+{
+	std::string orderBy = "object_id ASC";
+	return orderBy;
+}
+
+string 
+TeOracleSpatial::getSQLBoxWhere (const TeBox& box, const TeGeomRep rep, const std::string& tableName)
+{
+	string wherebox;
+	string colname = "spatial_data";
+
+	if(rep == TeRASTER)
+		colname = "block_box";
+
+	if(rep == TeTEXT)
+	{
+		wherebox = TeDatabase::getSQLBoxWhere (box, rep, tableName);
+		return wherebox;
+	}
+
+	std::string strProj = "null";
+	if(!tableName.empty())
+	{
+		strProj = "(select SRID from user_sdo_geom_metadata where " + toUpper("table_name") + " = " + toUpper("'" + tableName + "'") + ")";
+	}
+
+	wherebox = "mdsys.sdo_filter (" + colname +",";
+	wherebox += "mdsys.sdo_geometry(2003," + strProj + ",null,";
+	wherebox += "mdsys.sdo_elem_info_array(1,1003,3),";
+	wherebox += "mdsys.sdo_ordinate_array(";
+	wherebox += Te2String(box.x1(),15) + ", " + Te2String(box.y1(),15);
+	wherebox += ", " + Te2String(box.x2(),15) + ", " + Te2String(box.y2(),15) + ")),";
+	wherebox += "'mask=anyinteract querytype = window') = 'TRUE'";
+
+	return wherebox;
+}
+
+
+string 
+TeOracleSpatial::getSQLBoxWhere (const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1)
+{
+	string wherebox;
+	string colname1, colname2; 
+	colname1 = colname2 = "spatial_data";
+	
+	if(rep1 == TeRASTER) 
+		colname1 = "block_box";
+
+	if(rep2 == TeRASTER)
+		colname2 = "block_box";
+		
+	wherebox =  "MDSYS.SDO_FILTER ("+ table1 +"."+ colname1 +",";
+	wherebox += table2 +"."+ colname2 +", 'querytype = window') = 'TRUE'";  
+
+	return wherebox;
+}
+
+
+string 
+TeOracleSpatial::getSQLBoxSelect (const string& tableName, TeGeomRep rep)
+{
+	
+	string select;
+	string colname = "spatial_data";
+
+	if(rep == TeRASTER)
+		colname = "block_box";
+
+	select =  tableName +".* , ";
+	select += " SDO_GEOM.SDO_MIN_MBR_ORDINATE("+ tableName +"."+ colname +", 1) as lower_x,";
+	select += " SDO_GEOM.SDO_MIN_MBR_ORDINATE("+ tableName +"."+ colname +", 2) as lower_y,";
+	select += " SDO_GEOM.SDO_MAX_MBR_ORDINATE("+ tableName +"."+ colname +", 1) as upper_x,"; 
+	select += " SDO_GEOM.SDO_MAX_MBR_ORDINATE("+ tableName +"."+ colname +", 2) as upper_y ";
+	return select;
+}
+
+bool 
+TeOracleSpatial::getMBRSelectedObjects(string /* geomTable */,string colGeom, string fromClause, string whereClause, string /* afterWhereClause */, TeGeomRep /* repType */,TeBox &bout, const double& tol)
+{
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	if (!portal)
+		return false;
+
+	string sql = "SELECT SDO_AGGR_MBR(" + colGeom + ") ";
+	sql += " FROM " + fromClause;
+	
+	if(!whereClause.empty())
+		sql += " WHERE " + whereClause;  
+	
+	if(!portal->query(sql)) 
+	{
+		delete portal;
+		return false;
+	}
+
+	if(!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	try
+	{
+		TeCoord2D coord1,coord2;
+		portal->getCoordinates (1, coord1);
+		portal->getCoordinates (2, coord2);
+		TeBox b(coord1.x()-tol, coord1.y()-tol, coord2.x()+tol, coord2.y()+tol);
+		bout = b;
+	}
+	
+	catch(...)
+	{
+		delete portal;
+		return false;
+	}
+	
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom)
+{
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	if (!portal)
+		return false;
+
+	string sql = "SELECT SDO_GEOM.SDO_MBR(" + tableGeom + "." + colGeom + ") ";
+	sql += " FROM " + tableGeom;
+	sql += " WHERE object_id = '" + object_id + "'";
+
+	if((!portal->query(sql)) || (!portal->fetchRow()))
+	{
+		delete portal;
+		return false;
+	}
+	
+	TeCoord2D coord1,coord2;
+	portal->getCoordinates (1, coord1);
+	portal->getCoordinates (2, coord2);
+	TeBox b(coord1.x(), coord1.y(), coord2.x(), coord2.y());
+	box = b;
+	
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, 
+								   unsigned char *buf,unsigned long size, int band, unsigned int res, unsigned int subband)
+{
+	if (blockId.empty()) // no block identifier provided
+	{
+		errorMessage_ = "bloco sem identificador";
+		return false;
+	}
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	bool update = false;
+	string q =" SELECT * FROM " + table; 
+	q += " WHERE block_id='" + blockId + "'";
+
+	if (!portal->query(q))
+	{
+		delete portal;
+		return false;
+	}
+	// check if this block is alread in the database
+	if (portal->fetchRow())
+		update = true;
+	delete portal;
+
+	string sdo_geom = " MDSYS.SDO_GEOMETRY(2003, NULL, NULL";
+	sdo_geom += ", MDSYS.SDO_ELEM_INFO_ARRAY( 1, 1003, 3 )";
+	sdo_geom += ", MDSYS.SDO_ORDINATE_ARRAY( " ;
+	sdo_geom += Te2String(ll.x(),15);
+	sdo_geom += ", " + Te2String(ll.y(),15);
+	sdo_geom += ", " + Te2String(ur.x(),15);
+	sdo_geom += ", " + Te2String(ur.y(),15);
+	sdo_geom += ")) ";
+
+	try
+	{
+		if (!update)
+		{
+			q = "INSERT INTO "+ table +" (block_id, band_id, subband, ";
+			q += " resolution_factor, block_box, block_size, spatial_data) VALUES ( ";
+			q += "'" + blockId + "'";
+			q += ", " + Te2String(band);
+			q += ", " + Te2String(subband);
+			q += ", " + Te2String(res);
+			q += ", " + sdo_geom;
+			q += ", " + Te2String(size);
+			q += ", :blobValue";
+			q += ")";
+			
+			if (!connection_->executeBLOBSTM(q, buf, size, ":blobValue"))
+				return false;
+		}
+		else
+		{
+			q = " UPDATE "+ table +" SET spatial_data=:blobValue ";
+			q += " WHERE block_id='" + blockId + "'";
+			if (!connection_->executeBLOBSTM(q, buf, size, ":blobValue"))
+				return false;
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error inserting raster block!";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOracleSpatial::allocateOrdinatesObject(TePolygon &poly, string& elInfo, TeOCICursor* cursor_)
+{
+	int		totalsize, ni, size;
+	double	xult, yult;
+	short	orient;
+
+	ni = poly.size () - 1;
+
+	xult = -9999.99;
+	yult = -9999.99;
+
+	totalsize = 0;
+
+	try
+	{
+		//OCI: create the ordinates array
+		if(!cursor_)
+			connection_->allocateObjectOrdinates();
+		
+		for (int k = 0; k <= ni; k++ )
+		{
+			TeLinearRing ring ( poly[k] );
+			totalsize += ring.size();
+			size = ring.size();
+			orient = TeOrientation(ring);
+			
+			if (k==0)  //external polygon: UNCLOCKWISE
+			{
+				elInfo = "1, 1003, 1";
+				if(orient == TeCOUNTERCLOCKWISE)   
+				{
+					for (int i=0;i<size;i++)
+					{
+						if(xult != ring[i].x() || yult != ring[i].y())
+						{
+							if(cursor_)
+							{
+								cursor_->appendOrdinates(ring[i].x());
+								cursor_->appendOrdinates (ring[i].y());	
+							}
+							else
+							{
+								connection_->appendOrdinates(ring[i].x());
+								connection_->appendOrdinates (ring[i].y());	
+							}
+						
+							xult = ring[i].x();
+							yult = ring[i].y();
+						}
+					}
+				}
+				//keep UNCLOCKWISE ring 
+				else
+				{
+					for (int i=0;i<size;i++)
+					{
+						if(xult != ring[size-1-i].x() || yult != ring[size-1-i].y())
+						{
+							if(cursor_)
+							{
+								cursor_->appendOrdinates(ring[size-1-i].x());
+								cursor_->appendOrdinates (ring[size-1-i].y());
+							}
+							else
+							{
+								connection_->appendOrdinates(ring[size-1-i].x());
+								connection_->appendOrdinates (ring[size-1-i].y());
+							}
+							
+							xult = ring[size-1-i].x();
+							yult = ring[size-1-i].y();
+						}
+					}
+				}
+			}
+
+			else  //internal polygon: CLOCKWISE
+			{
+				int pos = ((totalsize - size) * 2) + 1; 
+				elInfo += ", " + Te2String(pos) + ", 2003, 1";
+						
+				if(orient == TeCLOCKWISE)   
+				{
+					for (int i=0;i<size;i++)
+					{
+						if(xult != ring[i].x() || yult != ring[i].y())
+						{
+							if(cursor_)
+							{
+								cursor_->appendOrdinates(ring[i].x());
+								cursor_->appendOrdinates (ring[i].y());
+							}
+							else
+							{
+								connection_->appendOrdinates(ring[i].x());
+								connection_->appendOrdinates (ring[i].y());
+							}
+
+							xult = ring[i].x();
+							yult = ring[i].y();
+						}
+					}
+				}
+				//keep CLOCKWISE ring
+				else
+				{
+					for (int i=0;i<size;i++)
+					{
+						if(xult != ring[size-1-i].x() || yult != ring[size-1-i].y())
+						{
+							connection_->appendOrdinates(ring[size-1-i].x());
+							connection_->appendOrdinates (ring[size-1-i].y());
+							
+							xult = ring[size-1-i].x();
+							yult = ring[size-1-i].y();
+						}
+					}
+				}
+			}
+		}//for all rings
+	}
+	catch(...)
+	{
+		return false;
+	}
+	
+	return true;	
+}
+
+bool 
+TeOracleSpatial::allocateOrdinatesObject(TeLine2D &line, TeOCICursor* cursor_)
+{
+	int size = line.size();
+	double	xult, yult;
+	xult = -9999.99;
+	yult = -9999.99;
+
+	try
+	{
+		//OCI: create the ordinates array
+		if(!cursor_)
+			connection_->allocateObjectOrdinates ();
+
+		for (int i=0;i<size;i++)
+		{		
+			if(xult != line[i].x() || yult != line[i].y())
+			{
+				if(cursor_)
+				{
+					cursor_->appendOrdinates(line[i].x());
+					cursor_->appendOrdinates(line[i].y());
+				}
+				else
+				{
+					connection_->appendOrdinates(line[i].x());
+					connection_->appendOrdinates(line[i].y());
+				}
+				xult = line[i].x();
+				yult = line[i].y();
+			}
+		}
+	}
+	catch(...)
+	{
+		return false;
+	}
+
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::insertPolygon (const string& table, TePolygon &poly)
+{
+	string	elinfo;
+	
+	if(!allocateOrdinatesObject(poly, elinfo))
+		return false;
+	
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, object_id, spatial_data) VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(poly.objectId()) + "'";
+	ins += ", MDSYS.SDO_GEOMETRY(2003, NULL, NULL";
+	ins += ", MDSYS.SDO_ELEM_INFO_ARRAY( " + elinfo + " )";
+	ins += ", :ordinates_) ";
+	ins += " )";
+
+	if(!connection_->executeSDOSTM(ins))
+	{
+		errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOracleSpatial::updatePolygon (const string& table, TePolygon &poly)
+{
+	if(!tableExist(table))
+	{	
+		errorMessage_ = "Table not exist!";
+		return false;
+	}
+	
+	string elinfo;
+
+	if(!allocateOrdinatesObject(poly, elinfo))
+		return false;
+		
+	string sql;
+	sql =  "UPDATE " + table + " SET ";
+	sql += ", object_id = '" + poly.objectId() + "'";
+	sql += ", spatial_data = ";
+	sql += " MDSYS.SDO_GEOMETRY(2003, NULL, NULL";
+	sql += ", MDSYS.SDO_ELEM_INFO_ARRAY( " + elinfo + " )";
+	sql += ", :ordinates_) ";
+	sql += " WHERE geom_id = " + poly.geomId();
+
+	//OCI
+	if(!connection_->executeSDOSTM(sql))
+	{
+		errorMessage_ = "Error updating in the table " + table + "!"; 
+		return false;
+	}
+	
+	return true;
+}
+
+bool 
+TeOracleSpatial::selectPolygonSet (const string& table, const string& criteria, TePolygonSet &ps)
+{
+	TeOracleSpatialPortal *ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string sql ="SELECT * FROM " + table;
+	if (!criteria.empty())
+		sql += " WHERE " + criteria;
+	sql += " ORDER BY object_id ASC ";
+	 
+	if (!ocip->query(sql) || !ocip->fetchRow())
+	{
+		delete ocip;
+		return false;
+	}
+	
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = ocip->fetchGeometry(poly);
+		ps.add(poly);
+	}
+	while (flag);
+
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOracleSpatial::loadPolygonSet (const string& table, const string& geoid, TePolygonSet &ps)
+{
+	TeOracleSpatialPortal *ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string q ="SELECT * FROM " + table;
+
+	if (geoid != "")
+		q += " WHERE object_id = '" + geoid +"'";
+	
+	if (!ocip->query(q) || !ocip->fetchRow())
+	{	
+		delete ocip;
+		return false;
+	}
+
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = ocip->fetchGeometry(poly);
+		ps.add(poly);
+	}
+	while (flag);
+	delete ocip;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::loadPolygonSet (const string& table, TeBox &box, TePolygonSet &ps)
+{
+	TeOracleSpatialPortal *ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string q = "SELECT * FROM " + table;
+	q += this->getSQLBoxWhere (box, TePOLYGONS, table);
+	q += " ORDER BY object_id ";
+
+	if (!ocip->query(q) || !ocip->fetchRow())
+	{	
+		delete ocip;
+		return false;
+	}
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = ocip->fetchGeometry(poly);
+		ps.add(poly);
+	}
+	while (flag);
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOracleSpatial::loadPolygonSet(TeTheme* theme, TePolygonSet &ps)
+{
+	string collTable = theme->collectionTable();
+	if (collTable.empty())
+		return false;
+
+	TeLayer* themeLayer = theme->layer();
+	if (!themeLayer->hasGeometry(TePOLYGONS))
+		return false;
+	
+	string polygonTable = themeLayer->tableName(TePOLYGONS);
+	if (polygonTable.empty())
+		return false;
+
+	string sql = "SELECT * FROM (" + polygonTable + " RIGHT JOIN " + collTable;
+	sql += " ON " + polygonTable + ".object_id = " + collTable + ".c_object_id)";
+	
+	TeOracleSpatialPortal *ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	if (!ocip->query(sql) || !ocip->fetchRow())
+	{
+		delete ocip;
+		return false;
+	}
+
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = ocip->fetchGeometry(poly);
+		ps.add ( poly );
+	}
+	while (flag);		
+	delete ocip;
+	return true;
+}
+
+TeDatabasePortal* 
+TeOracleSpatial::loadPolygonSet(const string& table, TeBox &box)
+{
+	TeOracleSpatialPortal *portal = (TeOracleSpatialPortal*)this->getPortal();
+	if (!portal)
+		return 0;
+
+	string q;
+	q = "SELECT * FROM " + table + " WHERE ";
+	q += this->getSQLBoxWhere (box, TePOLYGONS, table);
+	q += " ORDER BY object_id ";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return 0;
+	}
+	else 
+		return portal;
+}
+
+
+//Spatial query
+//retornam um portal
+bool 
+TeOracleSpatial::spatialRelation(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& actIdsIn, TeDatabasePortal *portal, int relate, const string& actCollTable)
+{
+	string Ids = getStringIds(actIdsIn);
+	string actGeomColl = "spatial_data";
+	
+	string spatialRel = getOracleSpatialRelation(relate);
+	
+	//Montar a sql para passar para o Oracle
+	string sql = "SELECT geomTable1.* ";
+	sql += " FROM "+ actGeomTable +" geomTable1,";
+	sql += actGeomTable + " geomTable2 ";
+	
+	if(!actCollTable.empty())
+	{
+		sql += ", "+ actCollTable +" collTable ";
+		sql += " WHERE geomTable1.object_id = collTable.c_object_id AND ";
+	}
+	else
+		sql += " WHERE ";
+	
+	sql += " geomTable2.object_id IN (" + Ids + ") AND ";
+
+	if(relate==TeEQUALS)
+		sql += " geomTable1.object_id NOT IN (" + Ids + ") AND ";  
+	
+	if(relate==TeDISJOINT)
+		sql += " NOT ";  // NOT ANYINTERACT
+
+	sql += " SDO_RELATE(geomTable1."+ actGeomColl +", geomTable2."+ actGeomColl +", 'mask= "; 
+	sql += spatialRel + " querytype=WINDOW') = 'TRUE'";
+
+	portal->freeResult();
+	if(!((TeOracleSpatialPortal*)portal)->querySDO (sql)) 
+		return false;
+
+	return (portal->fetchRow());
+}
+
+bool 
+TeOracleSpatial::spatialRelation(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& actIdsIn, const string& visGeomTable, TeGeomRep /* visRep */, TeDatabasePortal *portal, int relate, const string& visCollTable)
+{
+	string Ids = getStringIds(actIdsIn);
+	string spatialRel = getOracleSpatialRelation(relate);
+	string actGeomColl = "spatial_data";
+	string visGeomColl = "spatial_data";
+	
+	//Montar a sql para passar para o Oracle
+	string sql = "SELECT geomTable1.* ";
+	sql += " FROM "+ visGeomTable +" geomTable1,";
+	sql += actGeomTable + " geomTable2 ";
+	
+	if(!visCollTable.empty())
+	{
+		sql += ", "+ visCollTable +" collTable";
+		sql += " WHERE geomTable1.object_id = collTable.c_object_id AND ";
+	}
+	else
+		sql += " WHERE ";
+	
+	sql += " geomTable2.object_id IN (" + Ids + ") AND ";
+
+	if(relate==TeDISJOINT)
+		sql += " NOT ";  // NOT ANYINTERACT
+
+	sql += " SDO_RELATE(geomTable1."+ visGeomColl +", geomTable2."+ actGeomColl +", 'mask= "; 
+	sql += spatialRel + " querytype=WINDOW') = 'TRUE'";
+
+	portal->freeResult();
+	if(!((TeOracleSpatialPortal*)portal)->querySDO(sql))
+		return false;
+	
+	return (portal->fetchRow());
+		
+}
+
+bool 
+TeOracleSpatial::spatialRelation(const string& actGeomTable, TeGeomRep /* actRep */, TeGeometry* geom, TeDatabasePortal *portal, int relate, const string& actCollTable) 
+{
+	portal->freeResult();
+	string elinfo, sdo;
+	
+	TeOCICursor	*cursor_ = ((TeOracleSpatialPortal*)portal)->getCursor();	
+	string spatialRel = getOracleSpatialRelation(relate);
+	string actGeomColl = "spatial_data";
+
+	if(geom->elemType()==TePOLYGONS)
+	{
+		TePolygon poly, *pPoly;
+		pPoly = new TePolygon();
+		pPoly = (TePolygon*)geom;
+		poly = *pPoly;
+
+		if(!allocateOrdinatesObject(poly, elinfo, cursor_))
+		{
+			delete cursor_;
+			return false;
+		}
+
+		sdo = " MDSYS.SDO_GEOMETRY(2003, NULL, NULL, ";
+		sdo += " MDSYS.SDO_ELEM_INFO_ARRAY(" + elinfo + "), ";
+		sdo += " :ordinates_)";
+
+		//delete pPoly;  //delete tamb�m o geom, talvez deixar para aplicacao
+	}
+	
+	else if (geom->elemType()==TeLINES)
+	{
+		TeLine2D line, *pLine;
+		pLine = new TeLine2D();
+		pLine = (TeLine2D*)geom;
+		line = *pLine;
+
+		if(!allocateOrdinatesObject(line, cursor_))
+		{
+			delete cursor_;
+			return false;
+		}
+
+		elinfo = "1, 2, 1";
+
+		sdo = " MDSYS.SDO_GEOMETRY(2002, NULL, NULL, ";
+		sdo += " MDSYS.SDO_ELEM_INFO_ARRAY(" + elinfo + "), ";
+		sdo += " :ordinates_)";
+
+		//delete pLine;  //delete tamb�m o geom
+	}
+	
+	else if (geom->elemType()==TePOINTS)
+	{
+		TePoint point, *pPoint;
+		pPoint = new TePoint();
+		pPoint = (TePoint*)geom;
+		point = *pPoint;
+		
+		sdo = " MDSYS.SDO_GEOMETRY(2001, NULL, ";
+		sdo += " MDSYS.SDO_POINT_TYPE( ";
+		sdo += Te2String(point.location().x(),15);
+		sdo += ", " + Te2String(point.location().y(),15);
+		sdo += ", NULL )";
+		sdo += ", NULL, NULL))";
+		
+		//delete pPoint;
+	}
+
+	else if (geom->elemType()==TeCELLS)
+	{
+		TeCell cell, *pCell;
+		pCell = new TeCell();
+		pCell = (TeCell*)geom;
+		cell = *pCell;
+
+		TeBox b = cell.box();
+		
+		sdo = " MDSYS.SDO_GEOMETRY(2003, NULL, NULL ";
+		sdo += ", MDSYS.SDO_ELEM_INFO_ARRAY( 1, 1003, 3 )";
+		sdo += ", MDSYS.SDO_ORDINATE_ARRAY( " ;
+		sdo += Te2String(b.lowerLeft().x(),15);
+		sdo += ", " + Te2String(b.lowerLeft().y(),15);
+		sdo += ", " + Te2String(b.upperRight().x(),15);
+		sdo += ", " + Te2String(b.upperRight().y(),15);
+		sdo += ")) ";
+
+		//delete pCell;
+	}
+	
+	//Montar a sql para passar para o Oracle
+	string sql = "SELECT geomTable.* ";
+	sql += " FROM " + actGeomTable + " geomTable ";
+
+	if(!actCollTable.empty())
+	{
+		sql += ", "+ actCollTable +" collTable ";
+		sql += " WHERE geomTable.object_id = collTable.c_object_id AND ";
+	}
+	else
+		sql += " WHERE ";
+	
+	
+	if(relate==TeDISJOINT)
+		sql += " NOT ";  // NOT ANYINTERACT
+
+	sql += " MDSYS.SDO_RELATE(geomTable."+ actGeomColl +", "+ sdo +", 'mask= "; 
+	sql += spatialRel + " querytype=WINDOW') = 'TRUE'";
+
+	if(!((TeOracleSpatialPortal*)portal)->querySDO(sql))
+		return false;
+
+	return (portal->fetchRow());
+}
+
+
+//retornam um vetor de object_ids resultantes da consulta
+bool 
+TeOracleSpatial::spatialRelation(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& actIdsIn, TeKeys& actIdsOut, int relate, const string& actCollTable)
+{
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*) getPortal(); 
+		
+	string Ids = getStringIds(actIdsIn);
+	string spatialRel = getOracleSpatialRelation(relate);
+	string actGeomColl = "spatial_data";
+
+	//Montar a sql para passar para o Oracle
+	string sql = "SELECT geomTable1.object_id ";
+	sql += " FROM "+ actGeomTable +" geomTable1,";
+	sql += actGeomTable + " geomTable2 ";
+	
+	if(!actCollTable.empty())
+	{
+		sql += ", "+ actCollTable +" collTable ";
+		sql += " WHERE geomTable1.object_id = collTable.c_object_id AND ";
+	}
+	else
+		sql += " WHERE ";
+	
+	sql += " geomTable2.object_id IN (" + Ids + ") AND ";
+
+	if(relate==TeEQUALS)
+		sql += " geomTable1.object_id NOT IN (" + Ids + ") AND ";  
+	
+	if(relate==TeDISJOINT)
+		sql += " NOT ";  // NOT ANYINTERACT
+
+	sql += " SDO_RELATE(geomTable1."+ actGeomColl +", geomTable2."+ actGeomColl +", 'mask= "; 
+	sql += spatialRel + " querytype=WINDOW') = 'TRUE'";
+
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	
+	actIdsOut.clear();
+	while(portal->fetchRow())
+	{
+		string objId = portal->getData (0);
+		actIdsOut.push_back(objId);
+	}
+
+	sort(actIdsOut.begin(), actIdsOut.end());
+	unique(actIdsOut.begin(), actIdsOut.end());
+
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::spatialRelation(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& actIdsIn, const string& visGeomTable, TeGeomRep /* visRep */, TeKeys& visIdsOut, int relate, const string& visCollTable)
+{
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*) getPortal(); 
+	
+	string Ids = getStringIds(actIdsIn);
+	string spatialRel = getOracleSpatialRelation(relate);
+	string actGeomColl = "spatial_data";
+	string visGeomColl = "spatial_data";
+	
+	//Montar a sql para passar para o Oracle
+	string sql = "SELECT geomTable1.object_id ";
+	sql += " FROM "+ visGeomTable +" geomTable1,";
+	sql += actGeomTable + " geomTable2 ";
+	
+	if(!visCollTable.empty())
+	{
+		sql += ", "+ visCollTable +" collTable";
+		sql += " WHERE geomTable1.object_id = collTable.c_object_id AND ";
+	}
+	else
+		sql += " WHERE ";
+	
+	sql += " geomTable2.object_id IN (" + Ids + ") AND ";
+
+	if(relate==TeDISJOINT)
+		sql += " NOT ";  // NOT ANYINTERACT
+
+	sql += " SDO_RELATE(geomTable1."+ visGeomColl +", geomTable2."+ actGeomColl +", 'mask= "; 
+	sql += spatialRel + " querytype=WINDOW') = 'TRUE'";
+
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	
+	visIdsOut.clear();
+	while(portal->fetchRow())
+	{
+		string objId = portal->getData (0);
+		visIdsOut.push_back(objId);
+	}
+
+	sort(visIdsOut.begin(), visIdsOut.end());
+	unique(visIdsOut.begin(), visIdsOut.end());
+
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, TeKeys& actIdsOut, int relate, const string& actCollTable)
+{
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*) getPortal(); 
+		
+	if(!spatialRelation(actGeomTable, actRep, geom, portal, relate, actCollTable))
+	{
+		delete portal;
+		return false;
+	}
+		
+	actIdsOut.clear();
+	do
+	{
+		string objId = portal->getData ("object_id");
+		actIdsOut.push_back(objId);
+	}while(portal->fetchRow());
+
+	sort(actIdsOut.begin(), actIdsOut.end());
+	unique(actIdsOut.begin(), actIdsOut.end());
+
+	delete portal;
+	return true;
+}
+
+// metric functions
+bool
+TeOracleSpatial::calculateArea(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& actIdsIn, double &area)
+{
+	string Ids = getStringIds(actIdsIn);
+	string actGeomColl = "spatial_data";
+	
+	string sql = "SELECT SUM(SDO_GEOM.SDO_AREA(g."+ actGeomColl +", m.diminfo))";
+	sql += " FROM "+ actGeomTable +" g, USER_SDO_GEOM_METADATA m";
+	sql += " WHERE m.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND object_id IN ("+ Ids +")";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	area = portal->getDouble(0);
+	delete portal;
+	return true;
+}
+
+bool
+TeOracleSpatial::calculateLength(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& actIdsIn, double &length)
+{
+	string Ids = getStringIds(actIdsIn);
+	string actGeomColl = "spatial_data";
+	
+	string sql = "SELECT SUM(SDO_GEOM.SDO_LENGTH(g."+ actGeomColl +", m.diminfo))";
+	sql += " FROM "+ actGeomTable +" g, USER_SDO_GEOM_METADATA m";
+	sql += " WHERE m.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND object_id IN ("+ Ids +")";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	length = portal->getDouble(0);
+	delete portal;
+	return true;
+}
+
+
+//distancia entre objetos de um mesma tabela
+bool
+TeOracleSpatial::calculateDistance(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& Ids, double& distance)
+{
+	string Id1 = Ids[0];
+	string Id2 = Ids[1];
+	string actGeomColl = "spatial_data";
+
+	string sql = "SELECT MIN(SDO_GEOM.SDO_DISTANCE(g1."+ actGeomColl +", m.diminfo, ";
+	sql += " g2."+ actGeomColl +", m.diminfo))";
+	sql += " FROM "+ actGeomTable +" g1,"+ actGeomTable +" g2, USER_SDO_GEOM_METADATA m";
+	sql += " WHERE m.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND g1.object_id = '"+ Id1 +"'"; 
+	sql += " AND g2.object_id = '"+ Id2 +"'";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	distance = portal->getDouble(0);
+	delete portal;
+	return true;
+}
+
+
+//distancia entre objetos de duas tabelas distintas
+bool
+TeOracleSpatial::calculateDistance(const string& actGeomTable, TeGeomRep /* actRep */, const string& objId1, const string& visGeomTable, TeGeomRep /* visRep */, const string& objId2, double& distance)
+{
+	string actGeomColl = "spatial_data";
+	string visGeomColl = "spatial_data";
+	
+	string sql = "SELECT MIN(SDO_GEOM.SDO_DISTANCE(g1."+ actGeomColl +", m1.diminfo, ";
+	sql += " g2."+ visGeomColl +", m2.diminfo))";
+	sql += " FROM "+ actGeomTable +" g1,"+ visGeomTable +" g2, ";
+	sql += " USER_SDO_GEOM_METADATA m1, USER_SDO_GEOM_METADATA m2 ";
+	sql += " WHERE m1.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m1.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND m2.table_name = '"+ TeConvertToUpperCase(visGeomTable) +"'";
+	sql += " AND m2.column_name = '"+ TeConvertToUpperCase(visGeomColl) +"'";
+	sql += " AND g1.object_id = '"+ objId1 +"'"; 
+	sql += " AND g2.object_id = '"+ objId2 +"'";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	distance = portal->getDouble(0);
+	delete portal;
+	return true;
+}
+
+
+
+// functions that return a new geometry
+
+//Euclidean distance value: dist
+bool
+TeOracleSpatial::buffer(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& actIds, TePolygonSet& bufferSet, double dist)
+{
+	string Ids = getStringIds(actIds);
+	string actGeomColl = "spatial_data";
+
+	string sql = "SELECT g.geom_id, g.object_id,";
+	sql += " SDO_GEOM.SDO_BUFFER(g."+ actGeomColl +", m.diminfo, "+ Te2String(dist, 15) +")";
+	sql += " FROM "+ actGeomTable +" g, USER_SDO_GEOM_METADATA m";
+	sql += " WHERE m.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND object_id IN ("+ Ids +")";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		TePolygonSet polySet;
+		flag = portal->fetchGeometry(polySet);
+		//teste c/ buffer com filhos
+		for(unsigned int i=0; i<polySet.size(); i++)
+			bufferSet.add(polySet[i]);
+
+	}while(flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeOracleSpatial::convexHull(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& actIds, TePolygonSet& convexHullSet)
+{
+	string Ids = getStringIds(actIds);
+	string actGeomColl = "spatial_data";
+	
+	string sql = "SELECT g.geom_id, g.object_id,";
+	sql += " SDO_GEOM.SDO_CONVEXHULL(g."+ actGeomColl +", m.diminfo )";
+	sql += " FROM "+ actGeomTable +" g, USER_SDO_GEOM_METADATA m";
+	sql += " WHERE m.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND object_id IN ("+ Ids +")";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+	do 
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		convexHullSet.add(poly);
+	}while(flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeOracleSpatial::centroid(const string&  actGeomTable , TeGeomRep /* actRep */, TePointSet& centroidSet, TeKeys actIds, const string& /* actCollTable */)
+{
+	string Ids = getStringIds(actIds);
+	string actGeomColl = "spatial_data";
+	
+	string sql = "SELECT g.geom_id, g.object_id,";
+	sql += " SDO_GEOM.SDO_CENTROID(g."+ actGeomColl +", m.diminfo )";
+	sql += " FROM "+ actGeomTable +" g, USER_SDO_GEOM_METADATA m";
+	sql += " WHERE m.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	
+	//if empty it calculates the centroids to all geometries 
+	if(!Ids.empty())
+		sql += " AND object_id IN ("+ Ids +")";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		TePoint point;
+		flag = portal->fetchGeometry(point);
+		centroidSet.add(point);
+	}while(flag);
+
+	delete portal;
+	return true;
+	
+}
+
+bool 
+TeOracleSpatial::nearestNeighbors(const string& actGeomTable, const string& actCollTable, TeGeomRep actRep, const string& objId1, TeKeys& actIdsOut, int numRes)
+{
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*) getPortal(); 
+	
+	if(!nearestNeighbors(actGeomTable, actCollTable, actRep, objId1, portal, numRes))
+	{
+		delete portal;
+		return false;
+	}
+		
+	actIdsOut.clear();
+	while(portal->fetchRow())
+	{
+		string objId = portal->getData ("object_id");
+		actIdsOut.push_back(objId);
+	}
+
+	sort(actIdsOut.begin(), actIdsOut.end());
+	unique(actIdsOut.begin(), actIdsOut.end());
+
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::nearestNeighbors(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& visGeomTable, const string& visCollTable, TeGeomRep visRep, TeKeys& visIdsOut, int numRes)
+{
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*) getPortal(); 
+	
+	if(!nearestNeighbors(actGeomTable, actRep, objId1, visGeomTable, visCollTable, visRep, portal, numRes))
+	{
+		delete portal;
+		return false;
+	}
+		
+	visIdsOut.clear();
+	while(portal->fetchRow())
+	{
+		string objId = portal->getData ("object_id");
+		visIdsOut.push_back(objId);
+	}
+
+	sort(visIdsOut.begin(), visIdsOut.end());
+	unique(visIdsOut.begin(), visIdsOut.end());
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeOracleSpatial::nearestNeighbors(const string& actGeomTable, const string& actCollTable, TeGeomRep /* actRep */, const string& objId1, TeDatabasePortal* portal, int numRes)
+{
+	string actGeomColl = "spatial_data";
+
+	//select the spatial index
+	string index = " SELECT INDEX_NAME FROM USER_SDO_INDEX_INFO";
+	index += " WHERE TABLE_NAME = '"+ TeConvertToUpperCase(actGeomTable) +"'"; 
+
+	portal->freeResult();
+	if(!portal->query(index) || !portal->fetchRow())
+        return false;
+
+	string indexName = string(portal->getData(0));
+	string perf = "/*+ INDEX("+ TeConvertToUpperCase(actGeomTable) +" "+ indexName +") */ ";
+	
+	string sql = "SELECT "+ perf +"  geomTable1.* ";
+	sql += " FROM "+ actGeomTable +" geomTable1,";
+	sql += actGeomTable + " geomTable2 ";
+	
+	if(!actCollTable.empty())
+	{
+		sql += ", "+ actCollTable +" collTable ";
+		sql += " WHERE ";
+		sql += " geomTable1.object_id = collTable.c_object_id AND ";
+	}
+	else
+		sql += " WHERE ";
+		
+	sql += " SDO_NN(geomTable1."+ actGeomColl +", geomTable2."+ actGeomColl +", 'sdo_batch_size=10')='TRUE' AND ";
+	sql += " geomTable2.object_id = '" + objId1 + "' AND ";
+	sql += " geomTable1.object_id <> '"+ objId1 +"' AND ";
+	sql += " ROWNUM <= "+ Te2String(numRes);
+
+	portal->freeResult();
+	if(!((TeOracleSpatialPortal*)portal)->querySDO(sql))
+		return false;
+	
+	return true;
+}
+	
+bool 
+TeOracleSpatial::nearestNeighbors(const string& actGeomTable, TeGeomRep /* actRep */, const string& objId1, const string& visGeomTable, const string& visCollTable, TeGeomRep /* visRep */, TeDatabasePortal* portal, int numRes)
+{
+	string actGeomColl = "spatial_data";
+	string visGeomColl = "spatial_data";
+
+	//select the spatial index
+	string index = " SELECT INDEX_NAME FROM USER_SDO_INDEX_INFO";
+	index += " WHERE TABLE_NAME = '"+ TeConvertToUpperCase(visGeomTable) +"'"; 
+
+	portal->freeResult();
+	if(!portal->query(index) || !portal->fetchRow())
+		return false;
+
+	string indexName = string(portal->getData(0));
+	string perf = "/*+ INDEX("+ TeConvertToUpperCase(visGeomTable) +" "+ indexName +") */ ";
+	string nres = " ROWNUM <= "+ numRes;
+	
+	string sql = "SELECT "+ perf +"  geomTable1.* ";
+	sql += " FROM "+ visGeomTable +" geomTable1,";
+	sql += actGeomTable + " geomTable2 ";
+	
+	if(!visCollTable.empty())
+	{
+		sql += ", "+ visCollTable +" collTable";
+		sql += " WHERE ";
+		sql += " geomTable1.object_id = collTable.c_object_id AND ";
+	}
+	else
+		sql += " WHERE ";
+		
+	sql += " SDO_NN(geomTable1."+ actGeomColl +", geomTable2."+ actGeomColl;
+	sql += ", 'sdo_batch_size=10') = 'TRUE' AND ";
+	sql += " geomTable2.object_id = '" + objId1 + "' AND ";
+	sql += " ROWNUM <= "+ Te2String(numRes);
+	
+	portal->freeResult();
+	if(!((TeOracleSpatialPortal*)portal)->querySDO(sql))
+		return false;
+	
+	return true;
+}
+
+
+//Intersection entre dois objetos geogr�ficos de uma mesma tabela
+
+
+bool 
+TeOracleSpatial::geomIntersection(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& actIds, TeGeometryVect& geomVect)
+{
+	string actGeomColl = "spatial_data";
+	string Ids = getStringIds(actIds);
+
+	string sql = "SELECT SDO_GEOM.SDO_INTERSECTION(g1."+ actGeomColl +", m.diminfo, ";
+	sql += " g2."+ actGeomColl +", m.diminfo)";
+	sql += " FROM "+ actGeomTable +" g1,"+ actGeomTable +" g2, USER_SDO_GEOM_METADATA m";
+	sql += " WHERE m.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND object_id IN ("+ Ids +")";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if((!portal->query(sql))||(!portal->fetchRow()))
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		bool result=false;
+		TeGeometry* geom = new TeGeometry(); 
+		TeGeometry* geom2 = geom;
+		flag = portal->getGeometry(&geom, result);
+		if(result)
+			geomVect.push_back (geom);
+		delete geom2;
+	}while(flag);
+		
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::geomIntersection(const string& actGeomTable, TeGeomRep /* actRep */, const string& objId1, const string& visGeomTable, TeGeomRep /* visRep */, const string& objId2, TeGeometryVect& geomVect)
+{
+	string actGeomColl = "spatial_data";
+	string visGeomColl = "spatial_data";
+	
+	string sql = "SELECT SDO_GEOM.SDO_INTERSECTION(g1."+ actGeomColl +", m1.diminfo, ";
+	sql += " g2."+ visGeomColl +", m2.diminfo)";
+	sql += " FROM "+ actGeomTable +" g1,"+ visGeomTable +" g2, ";
+	sql += " USER_SDO_GEOM_METADATA m1, USER_SDO_GEOM_METADATA m2 ";
+	sql += " WHERE m1.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m1.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND m2.table_name = '"+ TeConvertToUpperCase(visGeomTable) +"'";
+	sql += " AND m2.column_name = '"+ TeConvertToUpperCase(visGeomColl) +"'"; 
+	sql += " AND g1.object_id = '"+ objId1 +"'"; 
+	sql += " AND g2.object_id = '"+ objId2 +"'";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false; 
+	}
+
+	bool flag = true;
+	do 
+	{
+		bool result=false;
+		TeGeometry* geom = new TeGeometry(); 
+		TeGeometry* geom2 = geom;
+		flag = portal->getGeometry(&geom, result);
+		if(result)
+			geomVect.push_back (geom);
+		delete geom2;
+	}while(flag);
+		
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::geomDifference(const string& actGeomTable, TeGeomRep /* actRep */, const string& objId1, const string& visGeomTable, TeGeomRep /* visRep */, const string& objId2, TeGeometryVect& geomVect)
+{
+	string actGeomColl = "spatial_data";
+	string visGeomColl = "spatial_data";
+
+	string sql = "SELECT SDO_GEOM.SDO_DIFFERENCE(g1."+ actGeomColl +", m1.diminfo, ";
+	sql += " g2."+ visGeomColl +", m2.diminfo)";
+	sql += " FROM "+ actGeomTable +" g1,"+ visGeomTable +" g2, ";
+	sql += " USER_SDO_GEOM_METADATA m1, USER_SDO_GEOM_METADATA m2 ";
+	sql += " WHERE m1.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m1.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND m2.table_name = '"+ TeConvertToUpperCase(visGeomTable) +"'";
+	sql += " AND m2.column_name = '"+ TeConvertToUpperCase(visGeomColl) +"'"; 
+	sql += " AND g1.object_id = '"+ objId1 +"'"; 
+	sql += " AND g2.object_id = '"+ objId2 +"'";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		bool result=false;
+		TeGeometry* geom = new TeGeometry(); 
+		TeGeometry* geom2 = geom;
+		flag = portal->getGeometry(&geom, result);
+		if(result)
+			geomVect.push_back (geom);
+		delete geom2;
+	}while(flag);
+		
+	delete portal;
+	return true;
+}
+
+bool 
+TeOracleSpatial::geomDifference(const string& actGeomTable, TeGeomRep /* actRep */, const string& objId1, const string& objId2, TeGeometryVect& geomVect)
+{
+	string actGeomColl = "spatial_data";
+
+	string sql = "SELECT SDO_GEOM.SDO_DIFFERENCE(g1."+ actGeomColl +", m.diminfo, ";
+	sql += " g2."+ actGeomColl +", m.diminfo)";
+	sql += " FROM "+ actGeomTable +" g1,"+ actGeomTable +" g2, USER_SDO_GEOM_METADATA m";
+	sql += " WHERE m.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND g1.object_id = '"+ objId1 +"'"; 
+	sql += " AND g2.object_id = '"+ objId2 +"'";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		bool result=false;
+		TeGeometry* geom = new TeGeometry(); 
+		TeGeometry* geom2 = geom;
+		flag = portal->getGeometry(&geom, result);
+		if(result)
+			geomVect.push_back (geom);
+		delete geom2;
+	}while(flag);
+		
+	delete portal;
+	return true;
+}
+
+bool 
+TeOracleSpatial::geomXOr(const string& actGeomTable, TeGeomRep /* actRep */, const string& objId1, const string& objId2, TeGeometryVect& geomVect)
+{
+	string actGeomColl = "spatial_data";
+
+	string sql = "SELECT SDO_GEOM.SDO_XOR(g1."+ actGeomColl +", m.diminfo, ";
+	sql += " g2."+ actGeomColl +", m.diminfo)";
+	sql += " FROM "+ actGeomTable +" g1,"+ actGeomTable +" g2, USER_SDO_GEOM_METADATA m";
+	sql += " WHERE m.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND g1.object_id = '"+ objId1 +"'"; 
+	sql += " AND g2.object_id = '"+ objId2 +"'";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		bool result=false;
+		TeGeometry* geom = new TeGeometry(); 
+		TeGeometry* geom2 = geom;
+		flag = portal->getGeometry(&geom, result);
+		if(result)
+			geomVect.push_back (geom);
+		delete geom2;
+	}while(flag);
+
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::geomXOr(const string& actGeomTable, TeGeomRep /* actRep */, const string& objId1, const string& visGeomTable, TeGeomRep /* visRep */, const string& objId2, TeGeometryVect& geomVect)
+{
+	string actGeomColl = "spatial_data";
+	string visGeomColl = "spatial_data";
+
+	string sql = "SELECT SDO_GEOM.SDO_XOR(g1."+ actGeomColl +", m1.diminfo, ";
+	sql += " g2."+ visGeomColl +", m2.diminfo)";
+	sql += " FROM "+ actGeomTable +" g1,"+ visGeomTable +" g2, ";
+	sql += " USER_SDO_GEOM_METADATA m1, USER_SDO_GEOM_METADATA m2 ";
+	sql += " WHERE m1.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m1.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND m2.table_name = '"+ TeConvertToUpperCase(visGeomTable) +"'";
+	sql += " AND m2.column_name = '"+ TeConvertToUpperCase(visGeomColl) +"'"; 
+	sql += " AND g1.object_id = '"+ objId1 +"'"; 
+	sql += " AND g2.object_id = '"+ objId2 +"'";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		bool result=false;
+		TeGeometry* geom = new TeGeometry(); 
+		TeGeometry* geom2 = geom;
+		flag = portal->getGeometry(&geom, result);
+		if(result)
+			geomVect.push_back (geom);
+		delete geom2;
+	}while(flag);
+		
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::geomUnion(const string& actGeomTable, TeGeomRep /* actRep */, TeKeys& actIds, TeGeometryVect& geomVect)
+{
+	string actGeomColl = "spatial_data";
+	string Ids = getStringIds(actIds);
+
+	string sql = "SELECT SDO_GEOM.SDO_UNION(g1."+ actGeomColl +", m.diminfo, ";
+	sql += " g2."+ actGeomColl +", m.diminfo)";
+	sql += " FROM "+ actGeomTable +" g1,"+ actGeomTable +" g2, USER_SDO_GEOM_METADATA m";
+	sql += " WHERE m.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND object_id IN ("+ Ids +")";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		bool result=false;
+		TeGeometry* geom = new TeGeometry(); 
+		TeGeometry* geom2 = geom;
+		flag = portal->getGeometry(&geom, result);
+		if(result)
+			geomVect.push_back (geom);
+		delete geom2;
+	}while(flag);
+			
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::geomUnion(const string& actGeomTable, TeGeomRep /* actRep */, const string& objId1, const string& visGeomTable, TeGeomRep /* visRep */, const string& objId2, TeGeometryVect& geomVect)
+{
+	string actGeomColl = "spatial_data";
+	string visGeomColl = "spatial_data";
+
+	string sql = "SELECT SDO_GEOM.SDO_UNION(g1."+ actGeomColl +", m1.diminfo, ";
+	sql += " g2."+ visGeomColl +", m2.diminfo)";
+	sql += " FROM "+ actGeomTable +" g1,"+ visGeomTable +" g2, ";
+	sql += " USER_SDO_GEOM_METADATA m1, USER_SDO_GEOM_METADATA m2 ";
+	sql += " WHERE m1.table_name = '"+ TeConvertToUpperCase(actGeomTable) +"'";
+	sql += " AND m1.column_name = '"+ TeConvertToUpperCase(actGeomColl) +"'"; 
+	sql += " AND m2.table_name = '"+ TeConvertToUpperCase(visGeomTable) +"'";
+	sql += " AND m2.column_name = '"+ TeConvertToUpperCase(visGeomColl) +"'"; 
+	sql += " AND g1.object_id = '"+ objId1 +"'"; 
+	sql += " AND g2.object_id = '"+ objId2 +"'";
+
+	TeOracleSpatialPortal* portal = (TeOracleSpatialPortal*)getPortal();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		bool result=false;
+		TeGeometry* geom = new TeGeometry(); 
+		TeGeometry* geom2 = geom;
+		flag = portal->getGeometry(&geom, result);
+		if(result)
+			geomVect.push_back (geom);
+		delete geom2;
+	}while(flag);
+		
+	delete portal;
+	return true;
+}
+
+
+//End Spatial Query
+
+bool
+TeOracleSpatial::insertLine (const string& table, TeLine2D &line)
+{
+	
+	string	elinfo = "1, 2, 1";
+	
+	if(!allocateOrdinatesObject(line))
+		return false;
+
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, object_id, spatial_data) VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(line.objectId()) + "'";
+	ins += ", MDSYS.SDO_GEOMETRY(2002, NULL, NULL";
+	ins += ", MDSYS.SDO_ELEM_INFO_ARRAY( " + elinfo + " )";
+	ins += ", :ordinates_) ";
+	ins += " )";
+
+	//OCI
+	if(!connection_->executeSDOSTM(ins))
+	{
+		errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::updateLine(const string& table, TeLine2D &line)
+{
+	string	elinfo = "1, 2, 1";
+	
+	if(!allocateOrdinatesObject(line))
+		return false;
+	
+	string sql;
+	sql =  "UPDATE " + table + " SET ";
+	sql += "  object_id= '" + line.objectId() + "'";
+	sql += ", spatial_data = ";
+	sql += " MDSYS.SDO_GEOMETRY(2002, NULL, NULL";
+	sql += ", MDSYS.SDO_ELEM_INFO_ARRAY( " + elinfo + " )";
+	sql += ", :ordinates_) ";
+	sql += " WHERE geom_id = " +  line.geomId ();
+
+	//OCI
+	if(!connection_->executeSDOSTM(sql))
+	{
+		errorMessage_ = "Error updating in the table " + table + "!"; 
+		return false;
+	}
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::loadLineSet (const string& table, const string& geoid, TeLineSet &ls)
+{
+	
+	TeOracleSpatialPortal *ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string q ="SELECT * FROM " + table;
+	if (geoid != "")
+		q += " WHERE object_id = '" + geoid +"'";
+	
+	if (!ocip->query(q) || !ocip->fetchRow())
+	{	
+		delete ocip;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		TeLine2D line;
+		flag = ocip->fetchGeometry(line);
+		ls.add ( line );
+	}while(flag);
+
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOracleSpatial::loadLineSet (const string& table, TeBox &bb, TeLineSet &linSet)
+{
+	TeOracleSpatialPortal *portal = (TeOracleSpatialPortal*)getPortal();
+	if (!portal)
+		return false;
+
+	string q;
+	q = "SELECT * FROM " + table + " WHERE ";
+	q += this->getSQLBoxWhere (bb, TeLINES, table);
+	q += " ORDER BY object_id";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	bool flag = true;
+	do
+	{
+		TeLine2D lin;
+		flag = portal->fetchGeometry(lin);
+		linSet.add(lin);
+	}
+	while (flag);
+	delete portal;
+	return true;
+}
+
+TeDatabasePortal* 
+TeOracleSpatial::loadLineSet (const string& table, TeBox &box)
+{
+	TeOracleSpatialPortal *portal = (TeOracleSpatialPortal*) getPortal();
+	if (!portal)
+		return 0;
+
+	string q;
+	q = "SELECT * FROM " + table + " WHERE ";
+	q += this->getSQLBoxWhere (box, TeLINES, table);
+	q += " ORDER BY object_id";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return 0;
+	}
+	return portal;
+}
+
+bool 
+TeOracleSpatial::insertPoint(const string& table, TePoint &point)
+{
+	
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, object_id, spatial_data) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(point.objectId()) + "'";
+	ins += ", MDSYS.SDO_GEOMETRY(2001, NULL, ";
+	ins += "MDSYS.SDO_POINT_TYPE( ";
+	ins += Te2String(point.location().x(),15);
+	ins += ", " + Te2String(point.location().y(),15);
+	ins += ", NULL )";
+	ins += ", NULL, NULL)";
+	ins += " ) ";
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::updatePoint (const string& table, TePoint &point)
+{
+	string sql;
+	sql =  "UPDATE " + table + " SET ";
+	sql += "object_id = '" + point.objectId() + "'";
+	sql += ", spatial_data = ";
+	sql += " MDSYS.SDO_GEOMETRY(2001, NULL";
+	sql += ", MDSYS.SDO_POINT_TYPE( ";
+	sql += Te2String(point.location ().x(),15);
+	sql += ", " + Te2String(point.location ().y(),15);
+	sql += ", NULL )";
+	sql += ", NULL, NULL)";
+	sql += " WHERE geom_id = " + Te2String(point.geomId());
+
+	if(!execute(sql))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error updating in the table " + table + "!"; 
+		return false;
+	}
+
+	return true;
+}
+	
+bool 
+TeOracleSpatial::insertText	(const string& table, TeText &text)
+{
+	string ins = "INSERT INTO " + table + " (geom_id, ";
+	ins += " object_id, x, y, text_value, angle, height, alignment_vert, ";
+	ins += " alignment_horiz) VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(text.objectId()) + "'";
+	ins += ",  " + Te2String(text.location().x(),15);
+	ins += ",  " + Te2String(text.location().y(),15);
+	ins += ", '" + escapeSequence(text.textValue()) + "'";
+	ins += ",  " + Te2String(text.angle(),15);
+	ins += ",  " + Te2String(text.height(),15);
+	ins += ",  " + Te2String(text.alignmentVert(),15);
+	ins += ",  " + Te2String(text.alignmentHoriz(),15);
+	ins += " )";
+	
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::insertArc (const string& table, TeArc &arc)
+{
+	
+	string ins = "INSERT INTO " + table + " (geom_id, ";
+	ins += " object_id, from_node, to_node ) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(arc.objectId()) + "'";
+	ins += ",  " + Te2String(arc.fromNode().geomId());
+	ins += ",  " + Te2String(arc.toNode().geomId());
+	ins += " )";
+	
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeOracleSpatial::insertNode (const string& table, TeNode &node)
+{	
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, object_id, spatial_data) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(node.objectId()) + "'";
+	ins += ", MDSYS.SDO_GEOMETRY(2001, NULL, ";
+	ins += "MDSYS.SDO_POINT_TYPE( ";
+	ins += Te2String(node.location().x(),15);
+	ins += ", " + Te2String(node.location ().y(),15);
+	ins += ", NULL )";
+	ins += ", NULL, NULL)";
+	ins += " ) ";
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+	return true;
+}
+	
+
+bool
+TeOracleSpatial::updateNode (const string& table, TeNode &node)
+{	
+	string sql;
+	sql =  "UPDATE " + table + " SET ";
+	sql += " object_id = '" + node.objectId() + "'";
+	sql += ", spatial_data = ";
+	sql += " MDSYS.SDO_GEOMETRY(2001, NULL";
+	sql += ", MDSYS.SDO_POINT_TYPE( ";
+	sql += Te2String(node.location ().x(),15);
+	sql += ", " + Te2String(node.location ().y(),15);
+	sql += ", NULL )";
+	sql += ", NULL, NULL)";
+	sql += " WHERE geom_id = " + Te2String(node.geomId());
+	
+	if(!execute(sql))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error updating in the table " + table + "!"; 
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOracleSpatial::insertCell (const string& table, TeCell &cell )
+{
+	
+	TeBox b = cell.box();
+
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, object_id, col_number, row_number, spatial_data) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(cell.objectId ()) + "'";
+	ins += ",  " + Te2String(cell.column ());
+	ins += ",  " + Te2String(cell.line ());
+	ins += ", MDSYS.SDO_GEOMETRY(2003, NULL, NULL";
+	ins += ", MDSYS.SDO_ELEM_INFO_ARRAY( 1, 1003, 3 )";
+	ins += ", MDSYS.SDO_ORDINATE_ARRAY( " ;
+	ins += Te2String(b.lowerLeft().x(), 15);
+	ins += ", " + Te2String(b.lowerLeft().y(),15);
+	ins += ", " + Te2String(b.upperRight().x(),15);
+	ins += ", " + Te2String(b.upperRight().y(),15);
+	ins += ")) ";
+	ins += " )";
+		
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+	return true;
+}
+
+
+bool 
+TeOracleSpatial::updateCell(const string& table, TeCell &cell)
+{
+	TeBox b = cell.box ();
+	
+	string sql;
+	sql =  "UPDATE " + table + " SET ";
+	sql += " object_id= '" + cell.objectId() + "'";
+	sql += " col_number= " + Te2String(cell.column ());
+	sql += " row_number= " + Te2String(cell.line ());
+	sql += " spatial_data= ";
+	sql += " MDSYS.SDO_GEOMETRY(2003, NULL, NULL";
+	sql += ", MDSYS.SDO_ELEM_INFO_ARRAY( 1, 1003, 3 )";
+	sql += ", MDSYS.SDO_ORDINATE_ARRAY( " ;
+	sql += Te2String(b.lowerLeft().x(), 15);
+	sql += ", " + Te2String(b.lowerLeft().y(),15);
+	sql += ", " + Te2String(b.upperRight().x(),15);
+	sql += ", " + Te2String(b.upperRight().y(),15);
+	sql += ")) ";
+	sql += " WHERE geom_id = " +  cell.geomId ();
+	
+	if(!execute(sql))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error updating in the table " + table + "!"; 
+		return false;
+	}
+	
+	return true;
+}
+
+bool
+TeOracleSpatial::deleteMetadata(const string &table, const string &column)
+{
+	string del = "DELETE FROM USER_SDO_GEOM_METADATA ";
+	del += " WHERE TABLE_NAME = '" + TeConvertToUpperCase(table);
+	del += "' AND COLUMN_NAME = '" + TeConvertToUpperCase(column) + "'";
+	if(!(execute(del.c_str ())))
+		return false;
+	return true;
+}
+
+
+bool
+TeOracleSpatial::rebuildSpatialIndex(const string &table)
+{
+	TeOracleSpatialPortal *ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string tabIndex;
+
+	string ind = "SELECT index_name FROM USER_SDO_INDEX_INFO";
+	ind += " WHERE table_name = '" + TeConvertToUpperCase(table) + "'";
+	if (!ocip->query(ind))
+	{
+		delete ocip;
+		return false;
+	}
+	
+	if(!ocip->fetchRow())
+	{
+		delete ocip;
+		return false;
+	}
+
+	tabIndex = string(ocip->getData(0));
+	delete ocip;
+		
+	string reb = "ALTER INDEX ";
+	reb += tabIndex + " REBUILD";
+	if(!execute(reb))
+		return false;
+
+	return true;
+}
+
+bool
+TeOracleSpatial::deleteSpatialIndex(const string &table)
+{
+	TeOracleSpatialPortal	*ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string tabIndex;
+
+	string ind = "SELECT index_name FROM USER_SDO_INDEX_INFO";
+	ind += " WHERE table_name = '"+ TeConvertToUpperCase(table) +"'";
+	if (!ocip->query(ind))
+	{
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		delete ocip;
+		return false;
+	}
+
+	tabIndex = string(ocip->getData(0));
+	ocip->freeResult();
+	delete ocip;
+
+	string drop = "DROP INDEX "+ tabIndex;
+	if (!(execute(drop.c_str ())))
+		return false;
+	return true;
+}
+
+bool 
+TeOracleSpatial::generateLabelPositions	(TeTheme *theme, const std::string& objectId)
+{
+	
+	string	geomTable, upd;
+	string	collTable = theme->collectionTable();
+	
+	if((collTable.empty()) || (!tableExist(collTable)))
+		return false;
+
+	if( theme->layer()->hasGeometry(TeCELLS)    || 
+		theme->layer()->hasGeometry(TePOLYGONS) ||
+		theme->layer()->hasGeometry(TeLINES) )
+	{
+		geomTable = theme->layer()->tableName(TeCELLS);
+		
+		if(geomTable.empty())
+		{
+			geomTable = theme->layer()->tableName(TePOLYGONS);
+			if(geomTable.empty())
+				geomTable = theme->layer()->tableName(TeLINES);
+		}
+		
+		upd= " UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(SDO_GEOM.SDO_MIN_MBR_ORDINATE( ";
+		upd += geomTable + ".spatial_data, 1) + (SDO_GEOM.SDO_MAX_MBR_ORDINATE( ";
+		upd += geomTable + ".spatial_data, 1) -  SDO_GEOM.SDO_MIN_MBR_ORDINATE( ";
+		upd += geomTable + ".spatial_data, 1))/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(SDO_GEOM.SDO_MIN_MBR_ORDINATE( ";
+		upd += geomTable + ".spatial_data, 2) + (SDO_GEOM.SDO_MAX_MBR_ORDINATE( ";
+		upd += geomTable + ".spatial_data, 2) -  SDO_GEOM.SDO_MIN_MBR_ORDINATE( ";
+		upd += geomTable + ".spatial_data, 2))/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+
+	}
+	
+	else if (theme->layer()->hasGeometry(TePOINTS))
+	{
+		geomTable = theme->layer()->tableName(TePOINTS);
+		
+		upd= " UPDATE "+ collTable +" SET ";
+		upd += " label_x = (SELECT MAX(p.spatial_data.SDO_POINT.X) ";
+		upd += " FROM " + geomTable + " p WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(p.spatial_data.SDO_POINT.Y) ";
+		upd += " FROM " + geomTable + " p WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+
+	if (!objectId.empty())
+		upd += " AND c_object_id='"+objectId+"'";
+		
+	return execute(upd);
+}
+
+bool 
+TeOracleSpatial::locatePolygon (const string& table, TeCoord2D &pt, TePolygon& polygon, const double& /* tol */)
+{
+	TeOracleSpatialPortal  *ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string q = "SELECT * FROM " + table;
+	q += " WHERE MDSYS.SDO_RELATE (spatial_data,";
+	q += "MDSYS.SDO_GEOMETRY(2001,NULL, MDSYS.SDO_POINT_TYPE(";
+	q += Te2String(pt.x(),15) + ", " + Te2String(pt.y(), 15);
+	q += ", NULL), NULL, NULL), ";
+	q += " 'mask=contains querytype = window') = 'TRUE'";
+
+	if (!ocip->query(q) || !ocip->fetchRow())
+	{	
+		delete ocip;
+		return false;
+	}
+
+	ocip->fetchGeometry(polygon);
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOracleSpatial::locateLine (const string& table, TeCoord2D &pt, TeLine2D& line, const double& tol)
+{
+
+	TeOracleSpatialPortal	*ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	
+	string sdoGeom = "mdsys.sdo_geometry(2003,null,null,";
+	sdoGeom += "mdsys.sdo_elem_info_array(1,1003,3),";
+	sdoGeom += "mdsys.sdo_ordinate_array(";
+	sdoGeom += Te2String(box.x1(),15) + ", " + Te2String(box.y1(),15);
+	sdoGeom += ", " + Te2String(box.x2(),15) + ", " + Te2String(box.y2(),15) + "))";
+		
+	string q = "SELECT * FROM " + table;
+	q += " WHERE MDSYS.SDO_RELATE (spatial_data,";
+	q += sdoGeom +","; 
+	q += "'mask=anyinteract querytype = window') = 'TRUE'";
+
+	if (!ocip->query(q) || !ocip->fetchRow())
+	{
+		delete ocip;
+		return false;
+	}
+
+	ocip->fetchGeometry(line);
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOracleSpatial::locatePoint (const string& table, TeCoord2D &pt, TePoint& point, const double& tol)
+{
+	TeOracleSpatialPortal	*ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	
+	string sdoGeom = "mdsys.sdo_geometry(2003,null,null,";
+	sdoGeom += "mdsys.sdo_elem_info_array(1,1003,3),";
+	sdoGeom += "mdsys.sdo_ordinate_array(";
+	sdoGeom += Te2String(box.x1(),15) + ", " + Te2String(box.y1(),15);
+	sdoGeom += ", " + Te2String(box.x2(),15) + ", " + Te2String(box.y2(),15) + "))";
+		
+	string q = "SELECT * FROM " + table;
+	q += " WHERE MDSYS.SDO_RELATE (spatial_data,";
+	q += sdoGeom +","; 
+	q += "'mask=anyinteract querytype = window') = 'TRUE'";
+	
+	if (!ocip->query(q) || !ocip->fetchRow())
+	{
+		delete ocip;
+		return false;
+	}
+
+	ocip->fetchGeometry(point);
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOracleSpatial::locateCell(const string& table, TeCoord2D &pt, TeCell& cell, const double& /* tol */)
+{
+	TeOracleSpatialPortal  *ocip = (TeOracleSpatialPortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string q = "SELECT * FROM " + table;
+	q += " WHERE MDSYS.SDO_RELATE (spatial_data,";
+	q += "MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(";
+	q += Te2String(pt.x(),15) + ", " + Te2String(pt.y(), 15);
+	q += ", NULL), NULL, NULL), ";
+	q += " 'mask=contains querytype = window') = 'TRUE'";
+
+	if (!ocip->query(q) || !ocip->fetchRow())
+	{	
+		delete ocip;
+		return false;
+	}
+	
+	ocip->fetchGeometry(cell);
+	delete ocip;
+	return true;
+}
+
+bool TeOracleSpatial::removeGeometry(const string& tableName, const TeGeomRep& rep, const int& geomId)
+{
+	if(tableName.empty())
+	{
+		return false;
+	}
+
+	std::string remove = "DELETE FROM " + tableName;
+	remove += " WHERE geom_id = " + geomId;
+
+	return this->execute(remove);
+}
+
+//---------------- TeOracleSpatialPortal
+
+int 
+TeOracleSpatialPortal::getDimArraySize()
+{
+	if(!cursor_)
+		return 0;
+
+	return(cursor_->getDimArraySize());
+}
+
+bool 
+TeOracleSpatialPortal::getDimElement(int i,int &elem)
+{
+	if(!cursor_)
+		return false;
+
+	return (cursor_->getDimElement(i,elem));
+}
+
+int 
+TeOracleSpatialPortal::numberOfOrdinates()
+{
+	if(!cursor_)
+		return 0;
+
+	return(cursor_->getNumberOrdinates());
+}
+
+bool
+TeOracleSpatialPortal::getCoordinates(int i,TeCoord2D& coord)
+{
+	if(!cursor_)
+		return false;
+
+	return (cursor_->getCoordinates((i*2)-1,coord));
+}
+
+bool
+TeOracleSpatialPortal::getGeometryType(TeSDOGType& gType)
+{
+	if(!cursor_)
+		return false;
+
+	int type = cursor_->getGeometryType(); 
+	
+	switch(type)
+	{ 
+		case 2000:
+			gType=TeSDOUNKNOWN;
+			break;
+
+		case 2001:
+			gType=TeSDOPOINT;
+			break;
+
+		case 2002:
+			gType=TeSDOLINE;
+			break;
+
+		case 2003:
+			gType=TeSDOPOLYGON;
+			break;
+
+		case 2004:
+			gType=TeSDOCOLLECTION;
+			break;
+
+		case 2005:
+			gType=TeSDOMULTIPOINT;
+			break;
+
+		case 2006:
+			gType=TeSDOMULTILINE;
+			break;
+		
+		case 2007:
+			gType=TeSDOMULTIPOLYGON;
+			break;
+		default:
+			return false;
+	};
+	return true;
+}
+
+int
+TeOracleSpatialPortal::getSpatialReferenceId()
+{
+	if(!cursor_)
+		return -1;
+
+	return (cursor_->getSpatialReferenceId());
+}
+
+bool
+TeOracleSpatialPortal::getPointXYZ (double& x,double& y)
+{
+	if(!cursor_)
+		return false;
+
+	return (cursor_->getXYZcoord(x,y));
+}
+
+bool TeOracleSpatialPortal::querySDO (const string &q)  
+{
+	errorMessage_.clear ();
+
+	if (!cursor_->isOpen())
+	{
+		if(!cursor_->open())
+		{
+			numRows_ = 0;
+			return false;
+		}
+	}
+
+	if (!cursor_->querySDO(q))
+	{
+		this->errorMessage_ = cursor_->getErrorMessage();
+		numRows_ = 0;
+		return false;
+	}
+	
+	numFields_= this->cursor_->numCol();
+	
+	attList_.clear ();
+	int i;
+	for(i = 1; i <= numFields_ ; i++)
+	{
+		TeAttribute attribute;
+
+		switch (cursor_->colType(i))
+		{
+			case 3: //INTEGER
+			attribute.rep_.type_ = TeINT;
+			break;
+
+			case 2:  //NUMBER
+			case 4: //FLOAT DOUBLE
+			attribute.rep_.type_ = TeREAL;
+			break;
+
+			case 12: //Date
+			attribute.rep_.type_ = TeDATETIME;
+			break;
+
+			case 113: //Blob
+			attribute.rep_.type_ = TeBLOB;
+			break;
+
+			case 96: //CHAR
+			case 9: //VARCHAR:
+			case 1: //VARCHAR2:
+			attribute.rep_.type_ = TeSTRING;
+			break;
+
+			case 108: //OBJECT: // SDO_GEOMETRY
+			attribute.rep_.type_ = TeOBJECT;
+			break;
+			default :
+			attribute.rep_.type_ = TeUNKNOWN;
+			break;
+		} 
+		
+		attribute.rep_.name_ = cursor_->colName(i); 
+		attribute.rep_.numChar_ = cursor_->colSize(i);
+		attList_.push_back ( attribute );
+	}
+
+	curRow_=-1;
+	return true;
+}
+
+bool
+TeOracleSpatialPortal::fetchGeometry (TePolygon& poly)
+{
+	int			elem,elemnext,i,k,elemType, sdoInterp;
+
+	try
+	{
+		int ndim = getDimArraySize();
+
+		if(ndim==0)
+			return false;
+
+		vector<TeCoord2D> coordinates;
+		if(!cursor_->getCoordinates (coordinates))
+			return false;
+
+		//number of the oordinates in the SDO_GEOMETRY
+		int noords = numberOfOrdinates();
+	
+		//Indicates the type of the SDO_GEOMETRY
+		int sdoEType;  
+		getDimElement(2,sdoEType);
+	
+		int geomId = atoi(getData("geom_id"));
+		string objId = string(getData("object_id"));
+		
+		// 1005: compound polygon: Compound polygon with some vertices connected by straight
+		//line segments and some by circular arcs.
+		if((sdoEType==1005) || (sdoEType==2005))  
+		{					   
+			TeLine2D	lin;   
+			//nelem: number of elemnts
+			int nelem; 
+			getDimElement(3,nelem);  
+			
+			//posinit is initial position in the vector 
+			int posinit=0; //1;
+			//ipoxmax: second element position in the ordinates array
+			int iposmax=7;			
+			
+			int posmax;
+			bool thisElemArc = false; 
+
+			//keep the last point of the element
+			//TePoint lastPoint;
+			
+			//for each element
+			for(elem=1; elem<=nelem; elem++)  
+			{
+				//to catch the last position of the element: iposmax
+				if(elem==nelem)
+					posmax = noords+1;
+				else
+					getDimElement(iposmax, posmax);
+
+				//verify if the element is a arc 
+				getDimElement((iposmax-1), elemType);
+				if(elemType == 2)
+					thisElemArc = true;   
+				else 
+					thisElemArc = false;
+
+				//ptSet: ordinates of the element
+				TePointSet ptSet;
+
+				//to catch all coords of the element
+				int pos=0;
+									
+				for(pos=posinit; pos<((posmax-1)/2);++pos)
+				{
+					TePoint pt(coordinates[pos]);
+					ptSet.add(pt);
+				}
+
+				if(thisElemArc) 
+				{
+					//pegar o pr�ximo
+					if(elem!=nelem)
+					{
+						TePoint pt(coordinates[pos]);
+						ptSet.add(pt);
+					}
+
+					int size = ptSet.size();
+					for(int s=1; (s+1)<size; s=s+2)
+					{
+						TeLine2D arc;
+						TeGenerateArc (ptSet[s-1], ptSet[s], ptSet[s+1], arc, 10);
+
+						int sz = arc.size();
+						for(int i=0; i<sz; i++)
+							lin.add(arc[i]);
+					}
+				}
+
+				else //line segment
+				{
+					int size = ptSet.size();
+					for(int s=0; s<size; s++)
+						lin.add(ptSet[s].location());
+				}
+
+				iposmax+=3;
+				posinit=pos;  //skip first coordinate: equal last point of previous element 
+			
+			} //for each element
+
+			TeLinearRing rg(lin);
+			rg.objectId(objId);
+			rg.geomId(geomId);
+			poly.add(rg);
+		}
+
+		else if((sdoEType==1003)||(sdoEType==2003))  //no complex
+		{
+			for(i=1;i<=ndim;i+=3)
+			{
+				TeLine2D	line;
+				getDimElement(i,elem);	// oordinate position
+				if((i+3) > ndim)
+					elemnext = noords+1;
+				else
+					getDimElement(i+3,elemnext);
+
+				getDimElement(i+2,sdoInterp);	// sdo interpretation 
+				// sdoInterp = 3: Rectangle type
+				// sdoInterp = 2: Polygon made up of a connected sequence of circular arcs 
+
+				if(sdoInterp==2)
+				{
+					//para gerar o arco
+					TePoint pt1;
+					TePoint pt2;
+					TePoint pt3;
+										
+					int cont=0;
+					int k = elem/2;
+					while (k<(elemnext/2))
+					{
+						for(int i=0; i<3; i++)
+						{
+							TeCoord2D pt = coordinates[k];
+						
+							if(i==0)
+							{
+								if(!cont)
+									pt1.add(pt);
+								else
+								{
+									pt1.add(pt3.location());
+									pt2.add(pt);
+									++i;
+								}
+							}
+							else if (i==1)
+								pt2.add(pt);
+							else if (i==2)
+								pt3.add(pt);
+
+							++cont;
+							++k;
+						}
+
+						TeLine2D arc;
+						TeGenerateArc (pt1, pt2, pt3, arc, 20);
+						
+						int s = arc.size();
+						for(int j=0; j<s; j++)
+							line.add(arc[j]);
+					}
+				}
+				else
+				{
+					// ler os pontos
+					for(k=(elem/2);k<(elemnext/2);k++)
+					{
+						TeCoord2D pt = coordinates[k];
+						line.add(pt);
+					}
+
+					if(sdoInterp==3) // rectangle
+					{
+						double xmin,ymin, xmax, ymax;
+						xmin = line.box().x1();
+						ymin = line.box().y1();
+						xmax = line.box().x2();
+						ymax = line.box().y2();
+
+						line.clear();
+						TeCoord2D pt1(xmin,ymin);
+						line.add(pt1);
+						TeCoord2D pt2(xmin,ymax);
+						line.add(pt2);
+						TeCoord2D pt3(xmax,ymax);
+						line.add(pt3);
+						TeCoord2D pt4(xmax,ymin);
+						line.add(pt4);
+						line.add(pt1);
+					}
+				}
+
+				TeLinearRing ring(line);
+				ring.objectId (objId);
+				ring.geomId(geomId);
+				poly.add(ring);
+			}
+		}
+		poly.objectId(objId);
+		poly.geomId(geomId);
+		return(this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool
+TeOracleSpatialPortal::fetchGeometry (TePolygon& poly, const unsigned int&)
+{
+	return this->fetchGeometry(poly);
+}
+
+
+bool
+TeOracleSpatialPortal::getGeometry (TeGeometry** geom, bool& result)
+{
+	TeSDOGType gType;
+	bool flag=true;	
+	
+	try
+	{
+		this->getGeometryType(gType);
+			
+		if(gType==TeSDOPOLYGON)
+		{
+			TePolygon   poly, *pol;
+			flag = this->fetchGeometry(poly); 
+			pol = new TePolygon();
+			*pol = poly;
+			*geom = pol;
+			result = true;
+			return flag;
+		}
+		else if(gType==TeSDOLINE)
+		{
+			TeLine2D	line, *lin;
+			flag = this->fetchGeometry(line); 
+			lin = new TeLine2D();
+			*lin = line;
+			*geom = lin;
+			result = true;
+			return flag;
+		}
+		else if(gType==TeSDOPOINT)
+		{
+			TePoint		point, *pnt;
+			flag = this->fetchGeometry(point); 
+			pnt = new TePoint();
+			*pnt = point;
+			*geom = pnt;
+			result = true;
+			return flag;
+		}
+
+		else if(gType==TeSDOMULTIPOLYGON)
+		{
+			TePolygonSet   polySet, *polSet;
+			flag = this->fetchGeometry(polySet); 
+			polSet = new TePolygonSet();
+			*polSet = polySet;
+			*geom = polSet;
+			result = true;
+			return flag;
+		}
+		else if(gType==TeSDOMULTILINE)
+		{
+			TeLineSet	lineSet, *linSet;
+			flag = this->fetchGeometry(lineSet); 
+			linSet = new TeLineSet();
+			*linSet = lineSet;
+			*geom = linSet;
+			result = true;
+			return flag;
+		}
+		else if(gType==TeSDOMULTIPOINT)
+		{
+			TePointSet		pointSet, *pntSet;
+			flag = this->fetchGeometry(pointSet); 
+			pntSet = new TePointSet();
+			*pntSet = pointSet;
+			*geom = pntSet;
+			result = true;
+			return flag;
+		}
+		
+	}
+	catch(...)
+	{
+		result = false;
+		return false;
+	}
+		
+	result = false;
+	return (this->fetchRow());
+}
+
+
+bool
+TeOracleSpatialPortal::fetchGeometry (TePolygonSet& polySet)
+{
+	int					elem,elemnext,i,k,sdoInterp;
+	vector<TeCoord2D>	coordinates;
+	
+	try
+	{
+		int ndim = getDimArraySize();
+		if(ndim==0)
+			return false;
+		
+		TePolygonSet polyHoles;
+		TeSDOGType gType;
+		
+		getGeometryType(gType);
+
+		if(gType==TeSDOPOLYGON)  
+		{
+			TePolygon poly;
+			bool res = fetchGeometry(poly);
+			polySet.add(poly);
+			return res;
+		}
+
+		if(!cursor_->getCoordinates(coordinates))
+			return false;
+
+		int noords = numberOfOrdinates();
+	
+		int geomId = atoi(getData("geom_id"));
+		string objId = string(getData("object_id"));
+		
+		bool hasHole = false;
+
+		for(i=1;i<=ndim;i+=3)
+		{
+			int			eType;
+			TeLine2D	line;
+			TePolygon	poly;
+			getDimElement(i,elem);	// oordinate position
+			if((i+3) > ndim)
+				elemnext = noords+1;
+			else
+				getDimElement(i+3,elemnext);
+
+			getDimElement(i+1, eType);		// sdo_etype do proximo elemento
+			getDimElement(i+2,sdoInterp);	// sdo_interpretation
+			
+			if(eType==2003)
+				poly = polyHoles.last();
+
+			// ler os pontos
+			for(k=(elem/2);k<(elemnext/2);k++)
+			{
+				TeCoord2D pt(coordinates[k]);
+				line.add(pt);
+			}
+
+			if(sdoInterp == 3) // rectangle
+			{
+				
+				double xmin,ymin, xmax, ymax;
+				xmin = line.box().x1();
+				ymin = line.box().y1();
+				xmax = line.box().x2();
+				ymax = line.box().y2();
+
+				line.clear();
+				TeCoord2D pt1(xmin,ymin);
+				line.add(pt1);
+				TeCoord2D pt2(xmin,ymax);
+				line.add(pt2);
+				TeCoord2D pt3(xmax,ymax);
+				line.add(pt3);
+				TeCoord2D pt4(xmax,ymin);
+				line.add(pt4);
+				line.add(pt1);
+			}
+			TeLinearRing ring(line);
+			ring.objectId (objId);
+			ring.geomId(geomId);
+			
+			poly.add(ring);
+	
+			//verificar se o proximo � hole
+			hasHole=false;
+			if(i+4<ndim)
+			{
+				getDimElement(i+4, eType);		// sdo_etype do proximo elemento
+				if(eType == 2003)
+					hasHole = true;
+			}
+			poly.objectId(objId);
+			poly.geomId(geomId);
+			
+			if(!hasHole)
+				polySet.add(poly);
+			else	
+				polyHoles.add(poly);
+		} //for
+
+		polySet.objectId(objId);
+		polySet.geomId(geomId);
+
+		return(this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool 
+TeOracleSpatialPortal::fetchGeometry (TeLine2D& line)
+{
+	int					i;
+	vector<TeCoord2D>	coordinates;
+
+	try
+	{
+		if(!cursor_->getCoordinates(coordinates))
+			return false;
+		
+		int noords = numberOfOrdinates();
+		if(noords==0)
+			return false;
+
+		for(i=0;i<noords/2;i++)
+			line.add(coordinates[i]);
+			
+		line.geomId (atoi(getData("geom_id")));
+		line.objectId(string(getData("object_id")));
+		return (this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool 
+TeOracleSpatialPortal::fetchGeometry (TeLine2D& line, const unsigned int& initIndex)
+{
+	int					i;
+	vector<TeCoord2D>	coordinates;
+
+	try
+	{
+		if(!cursor_->getCoordinates(coordinates))
+			return false;
+		
+		int noords = numberOfOrdinates();
+		if(noords==0)
+			return false;
+
+		for(i=0;i<noords/2;i++)
+			line.add(coordinates[i]);
+			
+		line.geomId (atoi(getData(initIndex)));
+		line.objectId(string(getData(initIndex+1)));
+		return (this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+
+bool 
+TeOracleSpatialPortal::fetchGeometry (TeLineSet& lineSet)
+{
+	vector<TeCoord2D>	coordinates;
+	int					elem,elemnext,i,k;
+
+	try
+	{
+		int ndim = getDimArraySize();
+		if(ndim==0)
+			return false;
+		
+		int noords = numberOfOrdinates();
+		int geomId = atoi(getData("geom_id"));
+		string objId = string(getData("object_id"));
+		
+		TeSDOGType gType;
+		getGeometryType(gType);
+
+		if(gType==TeSDOLINE)  
+		{
+			TeLine2D line;
+			fetchGeometry(line);
+			lineSet.add(line);
+			return true;
+		}
+
+		if(!cursor_->getCoordinates(coordinates))
+			return false;
+
+		for(i=1;i<=ndim;i+=3)
+		{
+			TeLine2D	line;
+			getDimElement(i,elem);		// oordinate position
+			if((i+3) > ndim)
+				elemnext = noords+1;
+			else
+				getDimElement(i+3,elemnext);
+			
+			// ler os pontos
+			for(k=(elem/2);k<(elemnext/2);k++)
+			{
+				TeCoord2D pt(coordinates[k]);
+				line.add(pt);
+			}
+			line.objectId (objId);
+			line.geomId(geomId);
+			lineSet.add(line);
+		}
+
+		lineSet.objectId(objId);
+		lineSet.geomId(geomId);
+		
+		return (this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool 
+TeOracleSpatialPortal::fetchGeometry(TePoint& p)
+{
+	double		x,y;
+	
+	try
+	{
+		if(!getPointXYZ(x,y))
+			return false;		//point in SDO_POINT
+
+		TeCoord2D c(x,y);
+		p.add(c);
+		p.objectId(string(getData("object_id")));
+		p.geomId(atoi(getData("geom_id")));
+		return(this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool 
+TeOracleSpatialPortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
+{
+	double		x,y;
+	
+	try
+	{
+		if(!getPointXYZ(x,y))
+			return false;		//point in SDO_POINT
+
+		TeCoord2D c(x,y);
+		p.add(c);
+		p.objectId(string(getData(initIndex+1)));
+		p.geomId(atoi(getData(initIndex)));
+		return(this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool 
+TeOracleSpatialPortal::fetchGeometry(TePointSet& pointSet)
+{
+	double		x,y;
+	vector<TeCoord2D> coordinates;
+
+	x=y=-99999.;
+	try
+	{
+		int noords = numberOfOrdinates();
+		if(noords==0)
+			return false;
+
+		TeSDOGType gType;
+		getGeometryType(gType);
+
+		if(gType==TeSDOPOINT)  
+		{
+			TePoint point;
+			fetchGeometry(point);
+			pointSet.add(point);
+			return true;
+		}
+
+		if(!cursor_->getCoordinates(coordinates))
+			return false;
+
+		int geomId = atoi(getData("geom_id"));
+		string objId = string(getData("object_id"));
+		
+		for(int i=1;i<=noords/2;i++)
+		{
+			TePoint pt(coordinates[i-1]);
+			pt.geomId (geomId);
+			pt.objectId (objId);
+			pointSet.add(pt);
+		}
+		
+		pointSet.objectId(objId);
+		pointSet.geomId(geomId);
+		
+		return(this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool 
+TeOracleSpatialPortal::fetchGeometry(TeNode& n)
+{
+	double	x,y;
+	x=y=-99999.;
+	try
+	{
+		if(!getPointXYZ(x,y))
+			return false;
+
+		TeCoord2D point(x,y);
+		n.add(point);
+		n.geomId(atoi(getData("geom_id")));
+		n.objectId(string(getData("object_id")));
+		return(this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool 
+TeOracleSpatialPortal::fetchGeometry(TeNode& n, const unsigned int& initIndex)
+{
+	double	x,y;
+	x=y=-99999.;
+	try
+	{
+		if(!getPointXYZ(x,y))
+			return false;
+
+		TeCoord2D point(x,y);
+		n.add(point);
+		n.geomId(atoi(getData(initIndex)));
+		n.objectId(string(getData(initIndex+1)));
+		return(this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool	
+TeOracleSpatialPortal::fetchGeometry (TeCell& cell)
+{
+	TeCoord2D coord1,coord2;
+	try
+	{
+		getCoordinates (1, coord1);
+		getCoordinates (2, coord2);
+		TeBox b(coord1.x(), coord1.y(), coord2.x(), coord2.y());
+		
+		cell.setBox (b);
+		cell.geomId(atoi(getData("geom_id")));
+		cell.objectId (string(getData("object_id")));
+		cell.column(atoi(getData("col_number")));
+		cell.line(atoi(getData("row_number")));
+		return(this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+bool	
+TeOracleSpatialPortal::fetchGeometry (TeCell& cell, const unsigned int& initIndex)
+{
+	TeCoord2D coord1,coord2;
+	try
+	{
+		getCoordinates (1, coord1);
+		getCoordinates (2, coord2);
+		TeBox b(coord1.x(), coord1.y(), coord2.x(), coord2.y());
+		
+		cell.setBox (b);
+		cell.geomId(atoi(getData(initIndex)));
+		cell.objectId (string(getData(initIndex+1)));
+		cell.column(atoi(getData(initIndex+2)));
+		cell.line(atoi(getData(initIndex+3)));
+		return(this->fetchRow());
+	}
+	catch(...)
+	{
+		errorMessage_ = cursor_->getErrorMessage();
+		return false;
+	}
+}
+
+
+
diff --git a/src/terralib/drivers/Oracle/TeOracleSpatial.h b/src/terralib/drivers/Oracle/TeOracleSpatial.h
new file mode 100644
index 0000000..46117b0
--- /dev/null
+++ b/src/terralib/drivers/Oracle/TeOracleSpatial.h
@@ -0,0 +1,325 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeOracleSpatial.h
+	\brief This file contains two classes that implement a driver of interface between TerraLib and ORACLE SPATIAL DBMS, using OCI (Oracle Call Interface) library.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_ORACLESPATIAL_H
+#define  __TERRALIB_INTERNAL_ORACLESPATIAL_H
+
+#include "TeOCIOracle.h"
+
+#include <TeDatabaseFactory.h>
+
+#include "TeOracleDefines.h"
+
+#ifdef AFX_DLL
+#define EXPORT_WIN __declspec( dllexport )
+#else
+#define EXPORT_WIN
+#endif
+
+/*! \enum TeSDOGType
+	\brief Types of geometries in the ORACLE SPATIAL 
+*/
+enum TeSDOGType  
+{ TeSDOUNKNOWN, TeSDOPOINT, TeSDOLINE, TeSDOPOLYGON,TeSDOCOLLECTION, 
+  TeSDOMULTIPOINT, TeSDOMULTILINE, TeSDOMULTIPOLYGON};
+
+/*! \class TeOracleSpatial
+	\brief A concrete implementation of a interface driver to the ORACLE SPATIAL DBMS
+	
+	This class contains attributes and methods to implement a driver of interface 
+	between TerraLib and ORACLE SPATIAL DBMS using OCI (Oracle Call Interface) library.
+	
+	\sa 
+	TeOCIOracle TeOCIConnect
+*/
+class TLORACLE_DLL TeOracleSpatial : public TeOCIOracle
+{
+
+friend class TeOracleSpatialPortal;
+
+private:
+
+	//! Deletes the metadata information associated to a geometric table in the USER_SDO_GEOM_METADATA table  
+	bool	deleteMetadata(const string &table, const string &column);
+	
+	//! Rebuilds a specific spatial index created to a geometric table
+	bool	rebuildSpatialIndex(const string &table);
+
+	//! Deletes a specific spatial index created to a geometric table
+	bool	deleteSpatialIndex(const string &table);
+
+public:
+	
+	//! Constructor
+	TeOracleSpatial();
+
+	//! Destructor
+	~TeOracleSpatial()
+	{}
+
+	//! Connects to Oracle Spatial DBMS
+	bool connect (const string& host, const string& user, const string& password, const string& database, int port = -1);
+
+	//! Creates a new table
+    bool createTable (const string& table, TeAttributeList &attr);
+
+	//! Creates a spatial index to a specific geometry table
+	bool createSpatialIndex(const string &table, const string &column,TeSpatialIndexType type= TeRTREE,short level=0,short tile=0);
+
+	//! Inserts the metadata information associated to a specific geometric table in the the USER_SDO_GEOM_METADATA table
+	bool insertMetadata(const string &table, const string &column, double tolx,double toly,TeBox &box,short srid=0);
+
+	//! Returns the name of the column that will be spatially indexed, for a given type of geometry table 
+	string getSpatialIdxColumn(TeGeomRep rep);
+	
+	//! Gets a cursor using the opened connection 
+	TeDatabasePortal* getPortal ();
+
+	//! Generates label positions to each object of a theme
+	bool generateLabelPositions	(TeTheme *theme, const std::string& objectId = ""); 
+	
+	/** @name Inserts, updates and deletes geometries from the tables
+	*/
+	//@{ 
+	bool insertPolygon		(const string& table, TePolygon &p);	
+	bool updatePolygon		(const string& table, TePolygon &p);
+	bool locatePolygon		(const string& table, TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0);
+	bool selectPolygonSet	(const string& table, const string& criteria, TePolygonSet &ps); 
+	bool loadPolygonSet		(const string& table, const string& geoid, TePolygonSet &ps);  
+	bool loadPolygonSet		(const string& table, TeBox &box, TePolygonSet &ps); 
+	bool loadPolygonSet		(TeTheme* theme, TePolygonSet &ps); 
+	TeDatabasePortal*		loadPolygonSet(const string& table, TeBox &box); 
+	bool allocateOrdinatesObject(TePolygon &poly, string& elInfo, TeOCICursor* cursor=0);
+	
+	bool insertLine		(const string& table, TeLine2D &l);		
+	bool updateLine		(const string& table, TeLine2D &l);
+	bool locateLine		(const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
+	bool loadLineSet	(const string& table, const string& geoid, TeLineSet &ls); 
+	bool loadLineSet	(const string& table, TeBox &box, TeLineSet &linSet); 
+	TeDatabasePortal*   loadLineSet (const string& table, TeBox &box);
+	bool allocateOrdinatesObject(TeLine2D &line, TeOCICursor* cursor=0);
+			
+    bool insertPoint	(const string& table, TePoint &p);	
+	bool updatePoint	(const string& table, TePoint &p);
+	bool locatePoint	(const string& table, TeCoord2D &pt, TePoint &point, const double& tol = 0.0);
+    
+	bool insertText		(const string& table, TeText &t);	
+
+	bool insertArc		(const string& table,TeArc &arc);
+	bool insertNode		(const string& table, TeNode &node);	
+	bool updateNode		(const string& table, TeNode &node);	
+
+	bool insertCell		(const string& table, TeCell &c);
+	bool updateCell		(const string& table, TeCell &c);
+	bool locateCell		(const string& table, TeCoord2D &pt, TeCell &cell, const double& tol = 0.0);
+
+	//! Removes a geometry from the given tableName
+	virtual bool removeGeometry(const string& tableName, const TeGeomRep& rep, const int& geomId);
+	
+	bool insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char *buf,unsigned long size, int band=0, unsigned int res=1, unsigned int subband=0);
+	//@}
+
+	/** @name Methods that return specific SQL statement according to each DBMS
+	*/
+	//@{ 
+	
+	//!< Returns a string SQL to be used in the ORDER BY clause when querying geometries.
+	virtual std::string getSQLOrderBy(const TeGeomRep& rep) const;
+
+	string getSQLBoxWhere (const TeBox& box, const TeGeomRep rep, const std::string& tableName); 
+	string getSQLBoxWhere (const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1); 
+	string getSQLBoxSelect (const string& tableName, TeGeomRep rep); 
+	//@}
+	
+	bool getMBRSelectedObjects(string geomTable,string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType,TeBox &bout, const double& tol = 0.0);
+	bool getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom);
+
+	/** @name Spatial query
+	*/
+	//@{ 
+	bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabasePortal *portal, int relate, const string& actCollTable="");
+	bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, const string& visGeomTable, TeGeomRep visRep, TeDatabasePortal *portal, int relate, const string& visCollTable=""); 
+	bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, TeDatabasePortal *portal, int relate, const string& actCollTable=""); 
+	bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeKeys& actIdsOut, int relate, const string& actCollTable="");
+	bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, const string& visGeomTable, TeGeomRep visRep, TeKeys& visIdsOut, int relate, const string& visCollTable=""); 
+	bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, TeKeys& actIdsOut, int relate, const string& actCollTable=""); 
+	//@}
+
+	/** @name Metric functions
+	*/
+	//@{ 
+	bool calculateArea(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsOut, double &area);
+	bool calculateLength(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, double &length);
+	bool calculateDistance(const string& actGeomTable, TeGeomRep actRep, TeKeys& Ids, double& distance);
+	bool calculateDistance(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& visGeomTable, TeGeomRep visRep, const string& objId2, double& distance);
+	//@}
+
+	/** @name Functions that generate new geometry
+	*/
+	//@{  
+	bool buffer(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TePolygonSet& bufferSet, double dist);
+	bool convexHull(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TePolygonSet& convexHullSet);
+	bool centroid(const string&  actGeomTable , TeGeomRep actRep, TePointSet& centroidSet, TeKeys actIds = vector<string>(), const string& actCollTable = "");
+	//@}
+
+	/** @name Functions that return the nearest neighbors 
+	*/
+	//@{  
+	bool nearestNeighbors(const string& actGeomTable, const string& actCollTable, TeGeomRep actRep, const string& objId1, TeKeys& actIdsOut, int numRes=1);
+	bool nearestNeighbors(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& visGeomTable, const string& visCollTable, TeGeomRep visRep, TeKeys& visIdsOut, int numRes=1); 
+	bool nearestNeighbors(const string& actGeomTable, const string& actCollTable, TeGeomRep actRep, const string& objId1, TeDatabasePortal* portal, int numRes=1);
+	bool nearestNeighbors(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& visGeomTable, const string& visCollTable, TeGeomRep visRep, TeDatabasePortal* portal, int numRes=1); 
+	//@}
+
+	/** @name Set functions
+	*/
+	//@{  
+	bool geomIntersection(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeGeometryVect& geomVect);
+	bool geomIntersection(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);
+	bool geomDifference(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& objId2, TeGeometryVect& geomVect);
+	bool geomDifference(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);
+	bool geomUnion(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeGeometryVect& geomVect);
+	bool geomUnion(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);
+	bool geomXOr(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& objId2, TeGeometryVect& geomVect);
+	bool geomXOr(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);	
+	//@}
+};
+
+/*! \class TeOracleSpatialPortal
+	\brief A class that implements a concept of record set to a ORACLE SPATIAL DBMS
+	
+	This class is part of the driver of interface 
+	between TerraLib and ORACLE SPATIAL DBMS. 
+	It was developed using OCI (Oracle Call Interface) library.
+	
+	\sa 
+	TeOCIOraclePortal TeOCICursor
+*/
+class TLORACLE_DLL TeOracleSpatialPortal : public TeOCIOraclePortal
+{
+
+	friend class TeOracleSpatial;
+	
+protected:
+	//! Gets the size of the element information array (SDO_ELEM_INFO type) of the record set current row 
+	int			getDimArraySize();
+	//! Gets the i-th element element information array (SDO_ELEM_INFO type) of the record set current row
+	bool		getDimElement(int i,int &elem);
+	//! Gets the number of ordinates of the coordinate array (SDO_ORDINATES type) of the record set current row
+	int			numberOfOrdinates();
+	//! Gets the i-th coordinate from the coordinates array (SDO_ORDINATES type) of the record set current row
+	bool		getCoordinates(int i,TeCoord2D& coord);
+	//! Gets the geometry type of the record set current row
+	bool		getGeometryType(TeSDOGType& gType);
+	//! Gets the spatial reference associated to the SDO_GEOMETRY type of the record set current row
+	int			getSpatialReferenceId();
+	//! Gets the point (x and y) associated to the SDO_POINT type of the record set current row
+	bool		getPointXYZ (double& x,double& y);
+
+public:
+
+	//! Constructor
+	TeOracleSpatialPortal(TeOracleSpatial* pDatabase) : TeOCIOraclePortal(pDatabase) 
+	{}
+
+	//! Destructor
+	virtual ~TeOracleSpatialPortal()
+	{}
+    
+	//! Executes a SQL statement that uses operators and functions of the ORACLE SPATIAL
+	bool querySDO (const string &q);
+	
+	/** @name Methods that return the geometry of the record set current row and fetch to the next row
+	*/
+	//@{ 
+	bool getGeometry (TeGeometry** geom, bool& result);
+	bool fetchGeometry (TePolygon& poly);
+	bool fetchGeometry (TePolygon& poly, const unsigned int& initIndex);
+	bool fetchGeometry (TePolygonSet& polySet);
+	bool fetchGeometry (TeLine2D& line);
+	bool fetchGeometry (TeLine2D& line, const unsigned int& initIndex);
+	bool fetchGeometry (TeLineSet& lineSet);
+	bool fetchGeometry (TeNode& n);
+	bool fetchGeometry (TeNode& n, const unsigned int& initIndex);
+	bool fetchGeometry (TePoint& p);
+	bool fetchGeometry (TePoint& p, const unsigned int& initIndex);
+	bool fetchGeometry (TePointSet& pointSet);
+	bool fetchGeometry (TeCell& cell);
+	bool fetchGeometry (TeCell& cell, const unsigned int& initIndex);
+	//@}
+};
+
+
+/**
+ * @brief This is the class for TeOracleSpatial driver factory.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup DatabaseUtils
+ */
+class TLORACLE_DLL TeOracleSpatialFactory : public TeDatabaseFactory
+{
+  public :
+      
+    /**
+     * Default constructor
+     */
+    TeOracleSpatialFactory() : TeDatabaseFactory( 
+      std::string( "OracleSpatial" ) ) {};      
+      
+    /**
+     * Default Destructor
+     */
+    ~TeOracleSpatialFactory() {};
+      
+  protected :  
+  
+    /**
+     * Implementation for the abstract TeFactory::build.
+     *
+     * @param arg A const reference to the parameters used by the
+     * database.
+     * @return A pointer to the new generated database instance.
+     */
+    TeDatabase* build( const TeDatabaseFactoryParams& arg )
+    {
+      TeOracleSpatial* instance_ptr = new TeOracleSpatial();
+      
+      if( arg.host_ != "" ) {
+        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
+          arg.database_, arg.port_ );
+      }
+  
+      return (TeDatabase*)instance_ptr;
+    }
+};
+
+namespace {
+  static TeOracleSpatialFactory TeOracleSpatialFactory_instance;
+}; 
+
+#endif 
+
+
+
diff --git a/src/terralib/drivers/Oracle/ociap.h b/src/terralib/drivers/Oracle/ociap.h
new file mode 100644
index 0000000..1616570
--- /dev/null
+++ b/src/terralib/drivers/Oracle/ociap.h
@@ -0,0 +1,10093 @@
+/* Copyright (c) 1996, 2002, Oracle Corporation.  All rights reserved.  */
+ 
+/* NOTE:  See 'header_template.doc' in the 'doc' dve under the 'forms' 
+      directory for the header file template that includes instructions. 
+*/
+ 
+/* 
+   NAME 
+     ociap.h - Oracle Call Interface - Ansi Prototypes
+
+   DESCRIPTION 
+     <short description of component this file declares/defines> 
+
+   RELATED DOCUMENTS 
+ 
+   INSPECTION STATUS 
+     Inspection date: 
+     Inspection status: 
+     Estimated increasing cost defects per page: 
+     Rule sets: 
+ 
+   ACCEPTANCE REVIEW STATUS 
+     Review date: 
+     Review status: 
+     Reviewers: 
+ 
+   PUBLIC FUNCTION(S) 
+     <list of external functions declared/defined - with one-line descriptions>
+
+   PRIVATE FUNCTION(S)
+     <list of static functions defined in .c file - with one-line descriptions>
+
+   EXAMPLES
+
+   NOTES
+     <other useful comments, qualifications, etc.>
+
+   MODIFIED   (MM/DD/YY)
+   sichandr    02/12/02 - fix OCIXMLTypeExists
+   gayyappa    02/01/02 - fix 2210776 : change Dom to DOM 
+   sichandr    10/24/01 - OCISvcCtx for XMLType create routines
+   schandir    09/14/01 - Add prototypes for Stmt Caching
+   abande      09/04/01 - Add Prototypes for Session Pooling Methods
+   stakeda     09/12/01 - add OCINlsCharSetConvert
+   whe         08/28/01 - add OCIEnvNlsCreate
+   wzhang      08/22/01 - Add OCINlsCharSetNameToId.
+   whe         10/05/01 - add prototype for OCIXMLType functions
+   mdmehta     04/06/01 - Bug 1683763, OCIDateTimeToText: buf_size to ub4*
+   schandir    12/12/00 - modify the ociconnectionpoolcreate() interface.
+   porangas    12/04/00 - Forward merge bug#974710 to 9i
+   rpingte     11/29/00 - Fix bug# 1485795.
+   gtarora     11/30/00 - fix comment for OCILobIsTemporary
+   akatti      11/07/00 - [1198379]:add OCIRowidToChar
+   bpalaval    10/15/00 - Forward merge 892654.
+   kmohan      09/18/00 - add OCILogon2
+   etucker     07/28/00 - add OCIIntervalFromTZ
+   vjayaram    07/18/00 - add connection pooling changes
+   etucker     07/13/00 - add dls apis for oci
+   hmasaki     07/05/00 - fix 1230846: forward merge into 8.2
+   mbastawa    06/05/00 - add OCIStmtFetch2
+   rxgovind    06/07/00 - update OCIAnyData interfaces
+   rxgovind    05/04/00 - add OCIAnyDataSet interfaces
+   rkasamse    05/01/00 - remove attrno from OCIAnyDataAttrGet
+   rkasamse    03/13/00 - add prototype s for OCCIAnyData
+   slari       09/01/99 - remove OCIEnvCallback
+   slari       08/23/99 - add OCIUcb in user callback functions
+   dsaha       07/07/99 - Add OCIFEnvCreate for forms
+   vyanaman    06/21/99 - Change OCI DateTime/Interval APIs.
+   esoyleme    07/01/99 - expose MTS performance enhancements                  
+   whe         06/14/99 - bug727872:add CONST to match definitions
+   kkarun      02/23/99 - Fix OCIDateTime APIs
+   jiyang      12/07/98 - Add comments for OCI_NLS_DUAL_CURRENCY
+   aroy        12/01/98 - add OCIEnvCreate
+   slari       11/23/98 - use ORASTDARG
+   slari       11/21/98 - replace ellipsis by arglist in OCIUserCallback
+   thchang     10/20/98 - correct comment on OCILobCreateTemporary
+   slari       09/08/98 - allow envh to receive error info also in CallbackReg/
+   kkarun      09/02/98 - Change const to CONST
+   aroy        08/04/98 - add OCITerminate calls                               
+   nramakri    06/25/98 - remove CONST from some OCIPickler APIs
+   jiyang      06/22/98 - Fix a lint error
+   nmallava    06/08/98 - ociistemporary -> envhp
+   jhasenbe    05/27/98 - Remove definitions for U-Calls (Unicode)
+   nmallava    05/18/98 - add comments
+   sgollapu    05/19/98 - Change text to OraText
+   aroy        04/20/98 - merge forward 8.0.5 -> 8.1.3
+   nbhatt      05/14/98 -  aq listen call
+   lchidamb    03/02/98 - Client Notification prototypes
+   vyanaman    04/19/98 - System Timestamp
+   kkarun      04/17/98 - Add more Interval functions
+   vyanaman    04/17/98 - Fix min (proc error)
+   vyanaman    04/16/98 - Add get/set TZ
+   kkarun      04/13/98 - Add Datetime prototypes
+   rkasamse    04/13/98 - change OCIEnv* to dvoid* for context/memory cart serv
+   rkasamse    04/15/98 - chage pickler cart interface
+   slari       03/20/98 - change proto of OCIUserCallback
+   slari       02/17/98 - add OCIUserCallback
+   jiyang      04/02/98 - Accept both env and user handles for NLS
+   rkasamse    03/20/98 - remove prototypes for OCIMemoryDuration* functions.
+   tsaulys     03/20/98 - use environment or session handle
+   nmallava    04/09/98 - OCILobLocatorAssign
+   nmallava    04/07/98 - lobgetchunksize and writeappend apis
+   jhasenbe    04/06/98 - Add new interfaces for Unicode support
+   nmallava    03/17/98 - add interfaces
+   nmallava    03/16/98 - add open/close apis
+   nmallava    03/10/98 - add temporary lobs apis
+   sgollapu    07/10/97 - Add OCIReset
+   sgollapu    02/09/98 - OCI non-blocking
+   nramakri    01/16/98 - remove #ifdef NEVER clause for OCIExtract
+   rmurthy     01/08/98 - OCIContextGenerateKey: change ub1 to ub4
+   ewaugh      12/18/97 - Turn type wrappers into functions.
+   skabraha    12/02/97 - adding OCIFile functions
+   rhwu        12/02/97 - add OCI Thread
+   nramakri    12/15/97 - move to core4
+   nramakri    12/11/97 - modify OCIExtract prototype
+   ewaugh      12/10/97 - add OCIFormat prototypes
+   nmallava    12/17/97 - Add ilob open and close apis
+   rkasamse    12/03/97 - Change some of the function names for pickler cartrid
+   nramakri    11/12/97 - add OCIExtract prototypes
+   rkasamse    11/21/97 - add prototypes for memory cartridge services and cont
+   rkasamse    11/03/97 - Add pickler cartridge interfaces.
+   jiyang      11/11/97 - Add NLS service for cartridge
+   tanguyen    08/19/97 -
+   cxcheng     07/30/97 - replace OCISvcCtx with OCISvcCtx
+   schandra    06/25/97 - AQ OCI interface
+   bnainani    07/21/97 - add prototypes for Oracle XA extensions
+   esoyleme    05/13/97 - move failover callback prototype
+   skmishra    05/06/97 - stdc compiler fixes
+   skmishra    04/24/97 - C++ Compatibility changes
+   skotsovo    04/21/97 - make lob parameter names consistent
+   rwhitman    04/16/97 - Fix LOB prototypes - Olint OCI 8.0.3
+   ramkrish    04/15/97 - Add free flag to OCILobFlushBuffer
+   dchatter    04/10/97 - add nzt.h inclusion
+   cxcheng     04/09/97 - change objnamp from CONST text* to dvoid*
+   cxcheng     04/08/97 - fix prototype of OCIDescribeAny()
+   skotsovo    03/31/97 - remove OCILobLocatorSize
+   skotsovo    03/27/97 - add OCILobLoadFromFile
+   bcchang     02/18/97 - Fix syntax error
+   dchatter    01/13/97 - fix comments on LOB calls
+   aroy        01/10/97 - remove ocilobfilecreate delete
+   sgollapu    12/27/96 - Correct OCILogon prototype
+   dchatter    01/04/97 - comments to describe the functions
+   sgollapu    11/25/96 - Change OCILobFileIsExistent
+   schandra    11/18/96 - Remove xa.h include
+   sgollapu    11/09/96 - Change prototype of OCIDescribeAny
+   dchatter    10/31/96 - delete CONST from lob write cb fn
+   dchatter    10/30/96 - more changes
+   dchatter    10/26/96 - lob/file long name corrections
+   slari       10/16/96 - delete unused calls
+   rwessman    10/29/96 - Fixed OCISecurityGetIdentity prototype
+   bcchang     10/25/96 - Fix syntax error
+   sgollapu    10/22/96 - Add OCILogon and OCILogoff
+   rwessman    10/16/96 - Added cryptographic and digital signature functions
+   sgollapu    10/10/96 - Add ocibdp and ocibdn
+   rxgovind    10/07/96 - add oci file calls
+   skotsovo    10/01/96 - move orl lob fnts to oci
+   skotsovo    09/20/96 - in OCILobGetLength(), remove the 'isnull' parameter.
+   aroy        08/29/96 - change prototype for Nchar Lob support
+   dchatter    08/21/96 - OCIResultSetToStmt prototype change
+   sthakur     08/14/96 - add OCIParamSet
+   schandra    07/26/96 - TX OCI return values - sb4->sword
+   aroy        07/17/96 - terminology change: OCILobLocator => OCILobLocator
+   dchatter    07/01/96 - create ANSI prototypes
+   dchatter    07/01/96 - Creation
+
+*/
+
+ 
+#ifndef OCIAP_ORACLE
+# define OCIAP_ORACLE
+
+# ifndef ORATYPES 
+#  include <oratypes.h> 
+# endif 
+ 
+#ifndef ORASTDARG
+#include <stdarg.h>
+#define ORASTDARG
+#endif
+
+//#ifndef OCIDFN
+//#include <ocidfn.h>
+//#endif
+
+#ifndef NZT_ORACLE
+#include <nzt.h>
+#endif /* NZT_ORACLE */
+ 
+//#ifndef OCI_ORACLE
+//#include <oci.h>
+//#endif
+
+#ifndef ORT_ORACLE
+#include <ort.h>
+#endif
+
+
+
+/*---------------------------------------------------------------------------
+                     PUBLIC TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                     PRIVATE TYPES AND CONSTANTS
+  ---------------------------------------------------------------------------*/
+
+
+/*---------------------------------------------------------------------------
+                           PUBLIC FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+/*****************************************************************************
+                              DESCRIPTION
+******************************************************************************
+Note: the descriptions of the functions are alphabetically arranged. Please 
+maintain the arrangement when adding a new function description. The actual 
+prototypes are below this comment section and donot follow any alphabetical 
+ordering. 
+
+
+--------------------------------OCIAttrGet------------------------------------
+
+OCIAttrGet()
+Name
+OCI Attribute Get
+Purpose
+This call is used to get a particular attribute of a handle. 
+Syntax
+sword OCIAttrGet ( CONST dvoid    *trgthndlp,
+                 ub4            trghndltyp,
+                 dvoid          *attributep,
+                 ub4            *sizep,
+                 ub4            attrtype,
+                 OCIError       *errhp );
+Comments
+This call is used to get a particular attribute of a handle.
+See Appendix B,  "Handle Attributes",  for a list of handle types and their 
+readable attributes.
+Parameters
+trgthndlp (IN) - is the pointer to a handle type. 
+trghndltyp (IN) - is the handle type. 
+attributep (OUT) - is a pointer to the storage for an attribute value. The 
+attribute value is filled in. 
+sizep (OUT) - is the size of the attribute value. 
+This can be passed in as NULL for most parameters as the size is well known. 
+For text* parameters, a pointer to a ub4 must be passed in to get the length 
+of the string. 
+attrtype (IN) - is the type of attribute.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+Related Functions
+OCIAttrSet()
+
+--------------------------------OCIAttrSet------------------------------------
+
+
+OCIAttrSet()
+Name
+OCI Attribute Set
+Purpose
+This call is used to set a particular attribute of a handle or a descriptor. 
+Syntax
+sword OCIAttrSet ( dvoid       *trgthndlp,
+                 ub4         trghndltyp,
+                 dvoid       *attributep,
+                 ub4         size,
+                 ub4         attrtype,
+                 OCIError    *errhp );
+Comments
+This call is used to set a particular attribute of a handle or a descriptor. 
+See Appendix B for a list of handle types and their writeable attributes.
+Parameters
+trghndlp (IN/OUT) - the pointer to a handle type whose attribute gets 
+modified. 
+trghndltyp (IN/OUT) - is the handle type. 
+attributep (IN) - a pointer to an attribute value. 
+The attribute value is copied into the target handle. If the attribute value 
+is a pointer, then only the pointer is copied, not the contents of the pointer.
+size (IN) - is the size of an attribute value. This can be passed in as 0 for 
+most attributes as the size is already known by the OCI library. For text*
+attributes, a ub4 must be passed in set to the length of the string. 
+attrtype (IN) - the type of attribute being set.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+Related Functions
+OCIAttrGet()
+
+
+
+--------------------------------OCIBindArrayOfStruct--------------------------
+
+
+
+OCIBindArrayOfStruct()
+Name
+OCI Bind for Array of Structures
+Purpose
+This call sets up the skip parameters for a static array bind.
+Syntax
+sword OCIBindArrayOfStruct ( OCIBind     *bindp,
+                           OCIError    *errhp,
+                           ub4         pvskip, 
+                           ub4         indskip, 
+                           ub4         alskip, 
+                           ub4         rcskip );
+Comments
+This call sets up the skip parameters necessary for a static array bind.
+This call follows a call to OCIBindByName() or OCIBindByPos(). The bind 
+handle returned by that initial bind call is used as a parameter for the 
+OCIBindArrayOfStruct() call.
+For information about skip parameters, see the section "Arrays of Structures" 
+on page 4-16.
+Parameters
+bindp (IN) - the handle to a bind structure. 
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+pvskip (IN) - skip parameter for the next data value. 
+indskip (IN) - skip parameter for the next indicator value or structure. 
+alskip (IN) - skip parameter for the next actual length value. 
+rcskip (IN) - skip parameter for the next column-level return code value. 
+Related Functions
+OCIAttrGet()
+
+
+--------------------------------OCIBindByName---------------------------------
+
+OCIBindByName()
+Name
+OCI Bind by Name
+Purpose
+Creates an association between a program variable and a placeholder in a SQL 
+statement or PL/SQL block.
+Syntax
+sword OCIBindByName (
+              OCIStmt       *stmtp, 
+              OCIBind       **bindp,
+              OCIError      *errhp,
+              CONST OraText    *placeholder,
+              sb4           placeh_len,
+              dvoid         *valuep,
+              sb4           value_sz,
+              ub2           dty,
+              dvoid         *indp,
+              ub2           *alenp,
+              ub2           *rcodep,
+              ub4           maxarr_len,
+              ub4           *curelep, 
+              ub4           mode ); 
+Description
+This call is used to perform a basic bind operation. The bind creates an 
+association between the address of a program variable and a placeholder in a 
+SQL statement or PL/SQL block. The bind call also specifies the type of data 
+which is being bound, and may also indicate the method by which data will be 
+provided at runtime.
+This function also implicitly allocates the bind handle indicated by the bindp 
+parameter.
+Data in an OCI application can be bound to placeholders statically or 
+dynamically. Binding is static when all the IN bind data and the OUT bind 
+buffers are well-defined just before the execute. Binding is dynamic when the 
+IN bind data and the OUT bind buffers are provided by the application on 
+demand at execute time to the client library. Dynamic binding is indicated by 
+setting the mode parameter of this call to OCI_DATA_AT_EXEC.
+Related Functions: For more information about dynamic binding, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16.
+Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle, 
+which is implicitly allocated by the bind call A separate bind handle is 
+allocated for each placeholder the application is binding.
+Additional bind calls may be required to specify particular attributes 
+necessary when binding certain data types or handling input data in certain 
+ways:
+If arrays of structures are being utilized, OCIBindArrayOfStruct() must 
+be called to set up the necessary skip parameters.
+If data is being provided dynamically at runtime, and the application 
+will be using user-defined callback functions, OCIBindDynamic() must 
+be called to register the callbacks.
+If a named data type is being bound, OCIBindObject() must be called to 
+specify additional necessary information.
+Parameters
+stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement 
+being processed.
+bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly 
+allocated by this call.  The bind handle  maintains all the bind information for 
+this particular input value. The handle is feed implicitly when the statement 
+handle is deallocated.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+placeholder (IN) - the placeholder attributes are specified by name if ocibindn() 
+is being called.
+placeh_len (IN) - the length of the placeholder name specified in placeholder.
+valuep (IN/OUT) - a pointer to a data value or an array of data values of the 
+type specified in the dty parameter. An array of data values can be specified 
+for mapping into a PL/SQL table or for providing data for SQL multiple-row 
+operations. When an array of bind values is provided, this is called an array 
+bind in OCI terms. Additional attributes of the array bind (not bind to a 
+column of ARRAY type) are set up in OCIBindArrayOfStruct() call. 
+For a REF, named data type  bind, the valuep parameter is used only for IN 
+bind data. The pointers to OUT buffers are set in the pgvpp parameter 
+initialized by OCIBindObject(). For named data type and REF binds, the bind 
+values are unpickled into the Object Cache. The OCI object navigational calls 
+can then be used to navigate the objects and the refs in the Object Cache.
+If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep 
+is ignored for all data types. OCIBindArrayOfStruct() cannot be used and 
+OCIBindDynamic() must be invoked to provide callback functions if desired. 
+value_sz (IN) - the size of a data value. In the case of an array bind, this is the 
+maximum size of any element possible with the actual sizes being specified in 
+the alenp parameter. 
+If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum 
+size of the data that can be ever provided at runtime for data types other than 
+named data types or REFs. 
+dty (IN) - the data type of the value(s) being bound. Named data types 
+(SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been 
+initialized in object mode. For named data types, or REFs, additional calls 
+must be made with the bind handle to set up the datatype-specific attributes.
+indp (IN/OUT) - pointer to an indicator variable or array. For scalar data 
+types, this is a pointer to sb2 or an array of sb2s. For named data types, 
+this pointer is ignored and the actual pointer to the indicator structure or 
+an array of indicator structures is initialized by OCIBindObject(). 
+Ignored for dynamic binds.
+See the section "Indicator Variables" on page 2-43 for more information about 
+indicator variables.
+alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each 
+element in alenp is the length of the data in the corresponding element in the 
+bind value array before and after the execute. This parameter is ignored for 
+dynamic binds.
+rcodep (OUT) - pointer to array of column level return codes. This parameter 
+is ignored for dynamic binds.
+maxarr_len (IN) - the maximum possible number of elements of type dty in a 
+PL/SQL binds. This parameter is not required for non-PL/SQL binds. If 
+maxarr_len is non-zero, then either OCIBindDynamic() or 
+OCIBindArrayOfStruct() can be invoked to set up additional bind attributes. 
+curelep(IN/OUT) - a pointer to the actual number of elements. This parameter 
+is only required for PL/SQL binds.
+mode (IN) - the valid modes for this parameter are:
+OCI_DEFAULT. This is default mode.
+OCI_DATA_AT_EXEC. When this mode is selected, the value_sz 
+parameter defines the maximum size of the data that can be ever 
+provided at runtime. The application must be ready to provide the OCI 
+library runtime IN data buffers at any time and any number of times. 
+Runtime data is provided in one of the two ways:
+callbacks using a user-defined function which must be registered 
+with a subsequent call to OCIBindDynamic(). 
+a polling mechanism using calls supplied by the OCI. This mode 
+is assumed if no callbacks are defined.
+For more information about using the OCI_DATA_AT_EXEC mode, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16.
+When the allocated buffers are not required any more, they should be 
+freed by the client. 
+Related Functions
+OCIBindDynamic(), OCIBindObject(), OCIBindArrayOfStruct(), OCIAttrGet()
+
+
+
+-------------------------------OCIBindByPos-----------------------------------
+
+
+OCIBindByPos()
+Name
+OCI Bind by Position
+Purpose
+Creates an association between a program variable and a placeholder in a SQL 
+statement or PL/SQL block.
+Syntax
+sword OCIBindByPos ( 
+              OCIStmt      *stmtp, 
+              OCIBind      **bindp,
+              OCIError     *errhp,
+              ub4          position,
+              dvoid        *valuep,
+              sb4          value_sz,
+              ub2          dty,
+              dvoid        *indp,
+              ub2          *alenp,
+              ub2          *rcodep,
+              ub4          maxarr_len,
+              ub4          *curelep, 
+              ub4          mode);
+
+Description
+This call is used to perform a basic bind operation. The bind creates an 
+association between the address of a program variable and a placeholder in a 
+SQL statement or PL/SQL block. The bind call also specifies the type of data 
+which is being bound, and may also indicate the method by which data will be 
+provided at runtime.
+This function also implicitly allocates the bind handle indicated by the bindp 
+parameter.
+Data in an OCI application can be bound to placeholders statically or 
+dynamically. Binding is static when all the IN bind data and the OUT bind 
+buffers are well-defined just before the execute. Binding is dynamic when the 
+IN bind data and the OUT bind buffers are provided by the application on 
+demand at execute time to the client library. Dynamic binding is indicated by 
+setting the mode parameter of this call to OCI_DATA_AT_EXEC.
+Related Functions: For more information about dynamic binding, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16
+Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle, 
+which is implicitly allocated by the bind call A separate bind handle is 
+allocated for each placeholder the application is binding.
+Additional bind calls may be required to specify particular attributes 
+necessary when binding certain data types or handling input data in certain 
+ways:
+If arrays of structures are being utilized, OCIBindArrayOfStruct() must 
+be called to set up the necessary skip parameters.
+If data is being provided dynamically at runtime, and the application 
+will be using user-defined callback functions, OCIBindDynamic() must 
+be called to register the callbacks.
+If a named data type is being bound, OCIBindObject() must be called to 
+specify additional necessary information.
+Parameters
+stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement 
+being processed.
+bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly 
+allocated by this call.  The bind handle  maintains all the bind information for 
+this particular input value. The handle is feed implicitly when the statement 
+handle is deallocated.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+position (IN) - the placeholder attributes are specified by position if ocibindp() 
+is being called.
+valuep (IN/OUT) - a pointer to a data value or an array of data values of the 
+type specified in the dty parameter. An array of data values can be specified 
+for mapping into a PL/SQL table or for providing data for SQL multiple-row 
+operations. When an array of bind values is provided, this is called an array 
+bind in OCI terms. Additional attributes of the array bind (not bind to a 
+column of ARRAY type) are set up in OCIBindArrayOfStruct() call. 
+For a REF, named data type  bind, the valuep parameter is used only for IN 
+bind data. The pointers to OUT buffers are set in the pgvpp parameter 
+initialized by OCIBindObject(). For named data type and REF binds, the bind 
+values are unpickled into the Object Cache. The OCI object navigational calls 
+can then be used to navigate the objects and the refs in the Object Cache.
+If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep 
+is ignored for all data types. OCIBindArrayOfStruct() cannot be used and 
+OCIBindDynamic() must be invoked to provide callback functions if desired. 
+value_sz (IN) - the size of a data value. In the case of an array bind, this is the 
+maximum size of any element possible with the actual sizes being specified in 
+the alenp parameter. 
+If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum 
+size of the data that can be ever provided at runtime for data types other than 
+named data types or REFs. 
+dty (IN) - the data type of the value(s) being bound. Named data types 
+(SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been 
+initialized in object mode. For named data types, or REFs, additional calls 
+must be made with the bind handle to set up the datatype-specific attributes.
+indp (IN/OUT) - pointer to an indicator variable or array. For scalar data 
+types, this is a pointer to sb2 or an array of sb2s. For named data types, 
+this pointer is ignored and the actual pointer to the indicator structure or 
+an array of indicator structures is initialized by OCIBindObject(). Ignored 
+for dynamic binds.
+See the section "Indicator Variables" on page 2-43 for more information about 
+indicator variables.
+alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each 
+element in alenp is the length of the data in the corresponding element in the 
+bind value array before and after the execute. This parameter is ignored for 
+dynamic binds.
+rcodep (OUT) - pointer to array of column level return codes. This parameter 
+is ignored for dynamic binds.
+maxarr_len (IN) - the maximum possible number of elements of type dty in a 
+PL/SQL binds. This parameter is not required for non-PL/SQL binds. If 
+maxarr_len is non-zero, then either OCIBindDynamic() or 
+OCIBindArrayOfStruct() can be invoked to set up additional bind attributes. 
+curelep(IN/OUT) - a pointer to the actual number of elements. This parameter 
+is only required for PL/SQL binds.
+mode (IN) - the valid modes for this parameter are:
+OCI_DEFAULT. This is default mode.
+OCI_DATA_AT_EXEC. When this mode is selected, the value_sz 
+parameter defines the maximum size of the data that can be ever 
+provided at runtime. The application must be ready to provide the OCI 
+library runtime IN data buffers at any time and any number of times. 
+Runtime data is provided in one of the two ways:
+callbacks using a user-defined function which must be registered 
+with a subsequent call to OCIBindDynamic() . 
+a polling mechanism using calls supplied by the OCI. This mode 
+is assumed if no callbacks are defined.
+For more information about using the OCI_DATA_AT_EXEC mode, see 
+the section "Runtime Data Allocation and Piecewise Operations" on 
+page 5-16.
+When the allocated buffers are not required any more, they should be 
+freed by the client. 
+Related Functions
+OCIBindDynamic(), OCIBindObject(), OCIBindArrayOfStruct(), OCIAttrGet()
+
+
+
+-------------------------------OCIBindDynamic---------------------------------
+
+OCIBindDynamic()
+Name
+OCI Bind Dynamic Attributes
+Purpose
+This call is used to register user callbacks for dynamic data allocation. 
+Syntax
+sword OCIBindDynamic( OCIBind     *bindp,
+                    OCIError    *errhp,
+                    dvoid       *ictxp, 
+                    OCICallbackInBind         (icbfp)(
+                                dvoid            *ictxp,
+                                OCIBind          *bindp,
+                                ub4              iter, 
+                                ub4              index, 
+                                dvoid            **bufpp,
+                                ub4              *alenp,
+                                ub1              *piecep, 
+                                dvoid            **indp ),
+                    dvoid       *octxp,
+                    OCICallbackOutBind         (ocbfp)(
+                                dvoid            *octxp,
+                                OCIBind          *bindp,
+                                ub4              iter, 
+                                ub4              index, 
+                                dvoid            **bufp, 
+                                ub4              **alenpp,
+                                ub1              *piecep,
+                                dvoid            **indpp, 
+                                ub2              **rcodepp)   );
+Comments
+This call is used to register user-defined callback functions for providing 
+data for an UPDATE or INSERT if OCI_DATA_AT_EXEC mode was specified in a 
+previous call to OCIBindByName() or OCIBindByPos(). 
+The callback function pointers must return OCI_CONTINUE if it the call is 
+successful. Any return code other than OCI_CONTINUE signals that the client 
+wishes to abort processing immediately.
+For more information about the OCI_DATA_AT_EXEC mode, see the section 
+"Runtime Data Allocation and Piecewise Operations" on page 5-16.
+Parameters
+bindp (IN/OUT) - a bind handle returned by a call to OCIBindByName() or 
+OCIBindByPos(). 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+ictxp (IN) - the context pointer required by the call back function icbfp. 
+icbfp (IN) - the callback function which returns a pointer to the IN bind 
+value or piece at run time. The callback takes in the following parameters. 
+ictxp (IN/OUT) - the context pointer for this callback function. 
+bindp (IN) - the bind handle passed in to uniquely identify this bind 
+variable. 
+iter (IN) - 1-based execute iteration value. 
+index (IN) - index of the current array, for an array bind. 1 based not 
+greater than curele parameter of the bind call. 
+index (IN) - index of the current array, for an array bind. This parameter 
+is 1-based, and may not be greater than curele parameter of the bind call. 
+bufpp (OUT) - the pointer to the buffer. 
+piecep (OUT) - which piece of the bind value. This can be one of the 
+following values - OCI_ONE_PIECE, OCI_FIRST_PIECE, 
+OCI_NEXT_PIECE and OCI_LAST_PIECE.
+indp (OUT) - contains the indicator value. This is apointer to either an 
+sb2 value or a pointer to an indicator structure for binding named data 
+types. 
+indszp (OUT) - contains the indicator value size. A pointer containing 
+the size of either an sb2 or an indicator structure pointer. 
+octxp (IN) - the context pointer required by the callback function ocbfp. 
+ocbfp (IN) - the callback function which returns a pointer to the OUT bind 
+value or piece at run time. The callback takes in the following parameters. 
+octxp (IN/OUT) - the context pointer for this call back function. 
+bindp (IN) - the bind handle passed in to uniquely identify this bind 
+variable. 
+iter (IN) - 1-based execute iteration value. 
+index (IN) - index of the current array, for an array bind. This parameter 
+is 1-based, and must not be greater than curele parameter of the bind call. 
+bufpp (OUT) - a pointer to a buffer to write the bind value/piece. 
+buflp (OUT) - returns the buffer size. 
+alenpp (OUT) - a pointer to a storage for OCI to fill in the size of the bind 
+value/piece after it has been read. 
+piecep (IN/OUT) - which piece of the bind value. It will be set by the 
+library to be one of the following values - OCI_ONE_PIECE or 
+OCI_NEXT_PIECE. The callback function can leave it unchanged or set 
+it to OCI_FIRST_PIECE or OCI_LAST_PIECE. By default - 
+OCI_ONE_PIECE. 
+indpp (OUT) - returns a pointer to contain the indicator value which 
+either an sb2 value or a pointer to an indicator structure for named data 
+types. 
+indszpp (OUT) - returns a pointer to return the size of the indicator 
+value which is either size of an sb2 or size of an indicator structure. 
+rcodepp (OUT) - returns a pointer to contains the return code. 
+Related Functions
+OCIAttrGet()
+
+
+---------------------------------OCIBindObject--------------------------------
+
+
+OCIBindObject()
+Name
+OCI Bind Object
+Purpose
+This function sets up additional attributes which are required for a named 
+data type (object)  bind.
+Syntax
+sword OCIBindObject ( OCIBind          *bindp,
+                    OCIError         *errhp, 
+                    CONST OCIType    *type,
+                    dvoid            **pgvpp, 
+                    ub4              *pvszsp, 
+                    dvoid            **indpp, 
+                    ub4              *indszp, );
+Comments
+This function sets up additional attributes which binding a named data type 
+or a REF. An error will be returned if this function is called when the OCI 
+environment has been initialized in non-object mode. 
+This call takes as a paramter a type descriptor object (TDO) of datatype 
+OCIType for the named data type being defined.  The TDO can be retrieved 
+with a call to OCITypeByName().
+If the OCI_DATA_AT_EXEC mode was specified in ocibindn() or ocibindp(), the 
+pointers to the IN buffers are obtained either using the callback icbfp 
+registered in the OCIBindDynamic() call or by the OCIStmtSetPieceInfo() call. 
+The buffers are dynamically allocated for the OUT data and the pointers to 
+these buffers are returned either by calling ocbfp() registered by the 
+OCIBindDynamic() or by setting the pointer to the buffer in the buffer passed 
+in by OCIStmtSetPieceInfo() called when OCIStmtExecute() returned 
+OCI_NEED_DATA. The memory of these client library- allocated buffers must be 
+freed when not in use anymore by using the OCIObjectFreee() call.
+Parameters
+bindp ( IN/OUT) - the bind handle returned by the call to OCIBindByName() 
+or OCIBindByPos(). 
+errhp ( IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+type ( IN) - points to the TDO which describes the type of the program 
+variable being bound. Retrieved by calling OCITypeByName().
+pgvpp ( IN/OUT) - points to a pointer to the program variable buffer. For an 
+array, pgvpp points to an array of pointers. When the bind variable is also an 
+OUT variable, the OUT Named Data Type value or REF is allocated 
+(unpickled) in the Object Cache, and a pointer to the value or REF is returned,
+At the end of execute, when all OUT values have been received, pgvpp points 
+to an array of pointer(s) to these newly allocated named data types in the 
+object cache. 
+pgvpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the Named 
+Data Type buffers are requested at runtime. For static array binds, skip 
+factors may be specified using the OCIBindArrayOfStruct() call. The skip 
+factors are used to compute the address of the next pointer to the value, the 
+indicator structure and their sizes.
+pvszsp ( IN/OUT) - points to the size of the program variable. The size of the 
+named data type is not required on input. For an array, pvszsp is an array of 
+ub4s. On return, for OUT bind variables, this points to size(s) of the Named 
+Data Types and REFs received. pvszsp is ignored if the OCI_DATA_AT_EXEC 
+mode is set. Then the size of the buffer is taken at runtime.
+indpp ( IN/OUT) - points to a pointer to the program variable buffer 
+containing the parallel indicator structure. For an array, points to an array of 
+pointers. When the bind variable is also an OUT bind variable, memory is 
+allocated in the object cache, to store the unpickled OUT indicator values. At 
+the end of the execute when all OUT values have been received, indpp points 
+to the pointer(s) to these newly allocated indicator structure(s). 
+indpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator 
+is requested at runtime.
+indszp ( IN/OUT) - points to the size of the IN indicator structure program 
+variable. For an array, it is an array of sb2s. On return for OUT bind variables, 
+this points to size(s) of the received OUT indicator structures.
+indszp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator 
+size is requested at runtime.
+Related Functions
+OCIAttrGet()
+
+
+
+----------------------------------OCIBreak------------------------------------
+
+
+OCIBreak()
+Name
+OCI Break
+Purpose
+This call performs an immediate (asynchronous) abort of any currently 
+executing OCI function that is associated with a server .
+Syntax
+sword OCIBreak ( dvoid      *hndlp,
+                 OCIError   *errhp);
+Comments
+This call performs an immediate (asynchronous) abort of any currently 
+executing OCI function that is associated with a server. It is normally used 
+to stop a long-running OCI call being processed on the server.
+This call can take either the service context handle or the server context 
+handle as a parameter to identify the function to be aborted.
+Parameters
+hndlp (IN) - the service context handle or the server context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+Related Functions
+
+-----------------------------OCIConnectionPoolCreate --------------------------
+Name:
+OCIConnectionPoolCreate
+
+Purpose:
+Creates the connections in the pool
+
+Syntax:
+OCIConnectionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCICPool *poolhp,
+                         OraText **poolName, sb4 *poolNameLen, 
+                         CONST Oratext *dblink, sb4 dblinkLen,
+                         ub4 connMin, ub4 connMax, ub4 connIncr,
+                         CONST OraText *poolUsername, sb4 poolUserLen,
+                         CONST OraText *poolPassword, sb4 poolPassLen, ub4 mode)
+Comments:
+This call is used to create a connection pool. conn_min connections
+to the database are started on calling OCIConnectionPoolCreate.
+
+Parameters:
+envhp (IN/OUT)  - A pointer to the environment where the Conencton Pool
+                  is to be created
+errhp (IN/OUT)  - An error handle which can be passed to OCIErrorGet().
+poolhp (IN/OUT) - An uninitialiazed pool handle.
+poolName (OUT) - The connection pool name. 
+poolNameLen (OUT) - The length of the connection pool name 
+dblink (IN/OUT) - Specifies the database(server) to connect. This will also
+                  be used as the default pool name.
+dblinkLen (IN)  - The length of the string pointed to by dblink.
+connMin (IN)    - Specifies the minimum number of connections in the
+                  Connection Pool at any instant.
+                  connMin number of connections are started when
+                  OCIConnectionPoolCreate() is called.
+connMax (IN)    - Specifies the maximum number of connections that can be
+                  opened to the database. Once this value is reached, no
+                  more connections are opened.
+connIncr (IN)   - Allows application to set the next increment for
+                  connections to be opened to the database if the current
+                  number of connections are less than conn_max.
+poolUsername (IN/OUT) - Connection pooling requires an implicit proxy
+                         session and this attribute provides a username
+                         for that session.
+poolUserLen (IN) - This represents the length of pool_username.
+poolPassword (IN/OUT) - The password for the parameter pool_username passed
+                        above.
+poolPassLen (IN) - This represents the length of pool_password.
+
+mode (IN) - The modes supported are OCI_DEFAULT and 
+OCI_CPOOL_REINITIALIZE 
+
+Related Functions
+OCIConnectionPoolDestroy()
+
+---------------------------------------------------------------------------
+
+----------------------------OCIConnectionPoolDestroy-------------------------
+Name:
+OCIConnectionPoolDestroy
+
+Purpose:
+Terminates the connections in the pool
+
+Syntax:
+OCIConnectionPoolDestroy (OCICPool *poolhp, OCIError *errhp, ub4 mode)
+
+Comments:
+On calling OCIConnectionPoolDestroy, all the open connections in the pool
+are closed and the pool is destroyed.
+
+Parameters:
+poolhp (IN/OUT) - An initialiazed pool handle.
+errhp (IN/OUT)  - An error handle which can be passed to OCIErrorGet().
+mode (IN)       - Currently, OCIConnectionPoolDestroy() will support only
+                  the OCI_DEFAULT mode.
+
+Related Functions:
+OCIConnectionPoolCreate()
+
+-----------------------------------------------------------------------------
+----------------------------OCISessionPoolCreate-----------------------------
+Name: 
+OCISessionPoolCreate
+
+Purpose:
+Creates the sessions in the session pool.
+
+Syntax:
+sword OCISessionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCISpool *spoolhp, 
+                      OraText **poolName, ub4 *poolNameLen, 
+                      CONST OraText *connStr, ub4 connStrLen,
+                      ub4 sessMin, ub4 sessMax, ub4 sessIncr,
+                      OraText *userid, 	ub4 useridLen,
+                      OraText *password, ub4 passwordLen,
+                      ub4 mode)
+
+Comments:
+When OCISessionPoolCreate is called, a session pool is initialized for
+the associated environment and the database specified by the
+connStr parameter. This pool is named uniquely and the name
+is returned to the user in the poolname parameter.
+
+Parameters:
+envhp (IN/OUT) - A pointer to the environment handle in which the session
+                 pool needs to be created.
+errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet().
+spoolhp (IN/OUT) - A pointer to the session pool handle that is created.
+poolName (OUT) - Session pool name returned to the user.
+poolNameLen (OUT) - Length of the PoolName
+connStr (IN) - The TNS alias of the database to connect to.
+connStrLen (IN) - Length of the connStr.
+sessMin (IN) - Specifies the minimum number of sessions in the Session Pool.
+               These are the number of sessions opened in the beginning, if
+               in Homogeneous mode. Else, the parameter is ignored.
+sessMax (IN) - Specifies the maximum number of sessions in the Session Pool.
+               Once this value is reached, no more sessions are opened,
+               unless the OCI_ATTR_SPOOL_FORCEGET is set.
+userid (IN) - Specifies the userid with which to start up the sessions.
+useridLen (IN) - Length of userid.
+password (IN) - Specifies the password for the corresponding userid.
+passwordLen (IN) - Specifies the length of the password
+mode(IN) - May be OCI_DEFAULT, OCI_SPC_SPOOL_REINITIALIZE, or
+           OCI_SPC_SPOOL_HOMOGENEOUS.
+
+Returns:
+SUCCESS - If pool could be allocated and created successfully.
+ERROR - If above conditions could not be met.
+
+Related Functions:
+OCISessionPoolDestroy()
+-----------------------------------------------------------------------------
+-----------------------------OCISessionPoolDestroy---------------------------
+Name:
+OCISessionPoolDestroy
+
+Purpose:
+Terminates all the sessions in the session pool.
+
+Syntax:
+sword OCISessionPoolDestroy (OCISPool *spoolhp, OCIError *errhp, ub4 mode)
+
+Comments:
+spoolhp (IN/OUT) - The pool handle of the session pool to be destroyed.
+errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet().
+mode (IN) - Currently only OCI_DEFAULT mode is supported.
+
+Returns:
+SUCCESS - All the sessions could be closed.
+ERROR - If the above condition is not met.
+
+Related Functions:
+OCISessionPoolCreate()
+-----------------------------------------------------------------------------
+-------------------------------OCISessionGet---------------------------------
+Name:
+OCISessionGet
+
+Purpose:
+Get a session. This could be from a session pool, connection pool or
+a new standalone session.
+
+Syntax:
+sword OCISessionGet(OCIenv *envhp, OCIError *errhp, OCISvcCtx **svchp,
+                    OCIAuthInfo *authhp,
+                    OraText *poolName, ub4 poolName_len,
+                    CONST OraText *tagInfo, ub4 tagInfo_len,
+                    OraText **retTagInfo, ub4 *retTagInfo_len,
+                    boolean *found,
+                    ub4 mode)
+
+Comments:
+envhp (IN/OUT) - OCI environment handle.
+errhp (IN/OUT) - OCI error handle to be passed to OCIErrorGet().
+svchp (IN/OUT) - Address of an OCI service context pointer. This will be
+                 filled with a server and session handle, attached to the
+                 pool.
+authhp (IN/OUT) - OCI Authentication Information handle.
+poolName (IN) - This indicates the session/connection pool to get the
+                session/connection from in the OCI_SPOOL/OCI_CPOOL mode.
+                In the OCI_DEFAULT mode it refers to the connect string.
+poolName_len (IN) - length of poolName.
+tagInfo (IN) - indicates the tag of the session that the user wants. If the
+                   user wants a default session, he must specify a NULL here.
+                   Only used for Session Pooling.
+tagInfo_len (IN) - the length of tagInfo.
+retTagInfo (OUT) - This indicates the type of session that is returned to
+                   the user. Only used for Session Pooling.
+retTagInfo_len (OUT) - the length of retTagInfo.
+found (OUT) - set to true if the user gets a session he had requested, else
+              set to false. Only used for Session Pooling.
+mode (IN) - The supported modes are OCI_DEFAULT, OCI_CRED_PROXY and
+            OCI_GET_SPOOL_MATCHANY, OCI_SPOOL and OCI_CPOOL. OCI_SPOOL and
+            OCI_CPOOL are mutually exclusive.
+
+Returns:
+SUCCESS -  if a session was successfully returned into svchp.
+SUCCESS_WITH_INFO - if a session was successfully returned into svchp and the
+                    total number of sessions > maxsessions. Only valid for
+                    Session Pooling.
+ERROR - If a session could not be retrieved.
+
+Related Functions:
+OCISessionRelease()
+-----------------------------------------------------------------------------
+---------------------------OCISessionRelease---------------------------------
+Name:
+OCISessionRelease
+
+Purpose:
+Release the session.
+
+Syntax:
+sword OCISessionRelease ( OCISvcCtx *svchp, OCIError *errhp,
+                          OraText *tag, ub4 tag_len,
+                          ub4 mode);
+
+Comments:
+svchp (IN/OUT) - The service context associated with the session/connection.
+errhp (IN/OUT) - OCI error handle to be passed to OCIErrorGet().
+tag (IN) - Only used for Session Pooling.
+           This parameter will be ignored unless mode OCI_RLS_SPOOL_RETAG is
+           specified. In this case, the session is labelled with this tag and
+           returned to the pool. If this is NULL, then the session is untagged.
+tag_len (IN) - Length of the tag. This is ignored unless mode 
+               OCI_RLS_SPOOL_RETAG is set.
+mode (IN) - The supported modes are OCI_DEFAULT, OCI_RLS_SPOOL_DROPSESS,
+            OCI_RLS_SPOOL_RETAG. The last 2 are only valid for Session Pooling.
+            When OCI_RLS_SPOOL_DROPSESS is specified, the session
+            will be removed from the session pool. If OCI_RLS_SPOOL_RETAG 
+            is set, the tag on the session will be altered. If this mode is 
+            not set, the tag and tag_len parameters will be ignored.
+
+Returns:
+ERROR - If the session could not be released successfully.
+SUCCESS - In all other cases.
+
+Related Functions:
+OCISessionGet().
+-----------------------------------------------------------------------------
+------------------------------OCIDateTimeAssign --------------------------
+sword OCIDateTimeAssign(dvoid *hndl, OCIError *err, CONST OCIDateTime *from, 
+		        OCIDateTime *to);
+NAME: OCIDateTimeAssign - OCIDateTime Assignment
+PARAMETERS:
+hndl (IN) - Session/Env handle.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+from (IN) - datetime to be assigned
+to (OUT) - lhs of assignment
+DESCRIPTION:
+        Performs date assignment. The type of the output will be same as that
+	of input
+
+------------------------------OCIDateTimeCheck----------------------------
+sword OCIDateTimeCheck(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 
+		 ub4 *valid );
+NAME: OCIDateTimeCheck - OCIDateTime CHecK if the given date is valid
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date (IN) - date to be checked
+valid (OUT) -  returns zero for a valid date, otherwise 
+  		the ORed combination of all error bits specified below:
+   Macro name                   Bit number      Error
+   ----------                   ----------      -----
+   OCI_DATE_INVALID_DAY         0x1             Bad day
+   OCI_DATE_DAY_BELOW_VALID     0x2             Bad DAy Low/high bit (1=low)
+   OCI_DATE_INVALID_MONTH       0x4             Bad MOnth
+   OCI_DATE_MONTH_BELOW_VALID   0x8             Bad MOnth Low/high bit (1=low)
+   OCI_DATE_INVALID_YEAR        0x10            Bad YeaR
+   OCI_DATE_YEAR_BELOW_VALID    0x20            Bad YeaR Low/high bit (1=low)
+   OCI_DATE_INVALID_HOUR        0x40            Bad HouR
+   OCI_DATE_HOUR_BELOW_VALID    0x80            Bad HouR Low/high bit (1=low)
+   OCI_DATE_INVALID_MINUTE      0x100           Bad MiNute
+   OCI_DATE_MINUTE_BELOW_VALID	0x200           Bad MiNute Low/high bit (1=low)
+   OCI_DATE_INVALID_SECOND      0x400           Bad SeCond
+   OCI_DATE_SECOND_BELOW_VALID  0x800           bad second Low/high bit (1=low)
+   OCI_DATE_DAY_MISSING_FROM_1582 0x1000        Day is one of those "missing"
+                                                from 1582
+   OCI_DATE_YEAR_ZERO           0x2000          Year may not equal zero
+   OCI_DATE_INVALID_TIMEZONE    0x4000          Bad Timezone
+   OCI_DATE_INVALID_FORMAT      0x8000          Bad date format input
+
+   So, for example, if the date passed in was 2/0/1990 25:61:10 in
+   (month/day/year hours:minutes:seconds format), the error returned
+   would be OCI_DATE_INVALID_DAY | OCI_DATE_DAY_BELOW_VALID |
+   OCI_DATE_INVALID_HOUR | OCI_DATE_INVALID_MINUTE
+
+DESCRIPTION:
+  	Check if the given date is valid.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+  	  'date' and 'valid' pointers are NULL pointers
+
+------------------------------- OCIDateTimeCompare----------------------------
+sword OCIDateTimeCompare(dvoid *hndl, OCIError *err, CONST OCIDateTime *date1, 
+                     CONST OCIDateTime *date2,  sword *result );
+NAME: OCIDateTimeCompare - OCIDateTime CoMPare dates
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date1, date2 (IN) - dates to be compared
+result (OUT) - comparison result, 0 if equal, -1 if date1 < date2, 
+  		1 if date1 > date2
+DESCRIPTION:
+The function OCIDateCompare compares two dates. It returns -1 if 
+date1 is smaller than date2, 0 if they are equal, and 1 if date1 is 
+greater than date2.
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+  	  invalid date
+	  input dates are not mutually comparable
+
+------------------------------OCIDateTimeConvert----------------------
+sword OCIDateTimeConvert(dvoid *hndl, OCIError *err, OCIDateTime *indate, 
+				OCIDateTime *outdate);
+NAME: OCIDateTimeConvert - Conversion between different DATETIME types
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+indate (IN) - pointer to input date
+outdate (OUT) - pointer to output datetime 
+DESCRIPTION: Converts one datetime type to another. The result type is
+       the type of the 'outdate' descriptor.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+	OCI_ERROR if
+	    conversion not possible.
+   
+---------------------------- OCIDateTimeFromText-----------------------
+sword OCIDateTimeFromText(dvoid *hndl, OCIError *err, CONST OraText *date_str, 
+             size_t d_str_length, CONST OraText *fmt, ub1 fmt_length,
+             CONST OraText *lang_name, size_t lang_length, OCIDateTime *date );
+NAME: OCIDateTimeFromText - OCIDateTime convert String FROM Date
+PARAMETERS:
+hndl (IN) - Session/Env handle. If Session Handle is passed, the 
+		    conversion takes place in session NLS_LANGUAGE and
+		    session NLS_CALENDAR, otherwise the default is used.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date_str (IN) - input string to be converted to Oracle date
+d_str_length (IN) - size of the input string, if the length is -1
+  		then 'date_str' is treated as a null terminated  string
+fmt (IN) - conversion format; if 'fmt' is a null pointer, then
+                the string is expected to be in the default format for
+		the datetime type.
+fmt_length (IN) - length of the 'fmt' parameter
+lang_name (IN) - language in which the names and abbreviations of
+  	        days and months are specified, if null i.e. (OraText *)0,
+  		the default language of session is used, 
+lang_length (IN) - length of the 'lang_name' parameter
+date (OUT) - given string converted to date
+DESCRIPTION:
+  	Converts the given string to Oracle datetime type set in the 
+        OCIDateTime descriptor according to the specified format. Refer to 
+        "TO_DATE" conversion function described in "Oracle SQL Language 
+        Reference Manual" for a description of format.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+  	  invalid format
+  	  unknown language
+  	  invalid input string
+
+--------------------------- OCIDateTimeGetDate-------------------------
+sword OCIDateTimeGetDate(dvoid *hndl, OCIError *err,  CONST OCIDateTime *date, 
+	                   sb2 *year, ub1 *month, ub1 *day );
+NAME: OCIDateTimeGetDate - OCIDateTime Get Date (year, month, day)  
+				portion of DATETIME. 
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - Pointer to OCIDateTime 
+year      (OUT) - year value
+month     (OUT) - month value
+day       (OUT) - day value
+
+--------------------------- OCIDateTimeGetTime ------------------------
+sword OCIDateTimeGetTime(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+		 ub1 *hour, ub1 *minute, ub1 *sec, ub4 *fsec);
+NAME: OCIDateTimeGetTime - OCIDateTime Get Time (hour, min, second, 
+			fractional second)  of DATETIME. 
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - Pointer to OCIDateTime 
+hour      (OUT) - hour value
+minute       (OUT) - minute value
+sec       (OUT) - second value
+fsec      (OUT) - Fractional Second value
+
+--------------------------- OCIDateTimeGetTimeZoneOffset ----------------------
+sword OCIDateTimeGetTimeZoneOffset(dvoid *hndl,OCIError *err,CONST 
+              OCIDateTime *datetime,sb1 *hour,sb1  *minute);
+
+NAME: OCIDateTimeGetTimeZoneOffset - OCIDateTime Get TimeZone (hour, minute)  
+                         portion of DATETIME. 
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - Pointer to OCIDateTime 
+hour      (OUT) - TimeZone Hour value
+minute     (OUT) - TimeZone Minute value
+
+--------------------------- OCIDateTimeSysTimeStamp---------------------
+sword OCIDateTimeSysTimeStamp(dvoid *hndl, OCIError *err, 
+              OCIDateTime *sys_date );
+ 
+NAME: OCIDateTimeSysTimeStamp - Returns system date/time as a TimeStamp with 
+                      timezone
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+sys_date (OUT) - Pointer to output timestamp
+ 
+DESCRIPTION: 
+        Gets the system current date and time as a timestamp with timezone
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+------------------------------OCIDateTimeIntervalAdd----------------------
+sword OCIDateTimeIntervalAdd(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+	 OCIInterval *inter, OCIDateTime *outdatetime);
+NAME: OCIDateTimeIntervalAdd - Adds an interval to datetime
+PARAMETERS:
+hndl (IN) - Session/Env handle.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - pointer to input datetime
+inter    (IN) - pointer to interval 
+outdatetime (IN) - pointer to output datetime. The output datetime 
+				will be of same type as input datetime
+DESCRIPTION: 
+	Adds an interval to a datetime to produce a resulting datetime
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+	OCI_ERROR if:
+		resulting date is before Jan 1, -4713
+		resulting date is after Dec 31, 9999
+
+------------------------------OCIDateTimeIntervalSub----------------------
+sword OCIDateTimeIntervalSub(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+              OCIInterval *inter, OCIDateTime *outdatetime);
+NAME: OCIDateTimeIntervalSub - Subtracts an interval from a datetime
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+datetime (IN) - pointer to input datetime
+inter    (IN) - pointer to interval 
+outdatetime (IN) - pointer to output datetime. The output datetime 
+				will be of same type as input datetime
+DESCRIPTION: 
+ 	Subtracts an interval from a datetime and stores the result in a
+     	datetime
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+	OCI_ERROR if:
+		resulting date is before Jan 1, -4713
+		resulting date is after Dec 31, 9999
+
+--------------------------- OCIDateTimeConstruct-------------------------
+sword OCIDateTimeConstruct(dvoid  *hndl,OCIError *err,OCIDateTime *datetime,
+               sb2 year,ub1 month,ub1 day,ub1 hour,ub1 min,ub1 sec,ub4 fsec,
+               OraText  *timezone,size_t timezone_length);
+
+NAME: OCIDateTimeConstruct - Construct an OCIDateTime. Only the relevant
+       fields for the OCIDateTime descriptor types are used.
+PARAMETERS:
+        hndl (IN) - Session/Env handle. 
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+        datetime (IN) - Pointer to OCIDateTime 
+        year      (IN) - year value
+        month     (IN) - month value
+        day       (IN) - day value        
+        hour      (IN) - hour value
+        min       (IN) - minute value
+        sec       (IN) - second value
+        fsec      (IN) - Fractional Second value
+        timezone  (IN) - Timezone string
+        timezone_length(IN) - Length of timezone string
+
+DESCRIPTION:
+       Constructs a DateTime descriptor. The type of the datetime is the
+       type of the OCIDateTime descriptor. Only the relevant fields based
+       on the type are used. For Types with timezone, the date and time
+       fields are assumed to be in the local time of the specified timezone.
+       If timezone is not specified, then session default timezone is
+       assumed.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_ERROR if datetime is not valid.
+
+------------------------------OCIDateTimeSubtract-----------------------
+sword OCIDateTimeSubtract(dvoid *hndl, OCIError *err, OCIDateTime *indate1, 
+		OCIDateTime *indate2, OCIInterval *inter);
+NAME: OCIDateTimeSubtract - subtracts two datetimes to return an interval
+PARAMETERS:
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+indate1(IN) - pointer to subtrahend
+indate2(IN) - pointer to minuend
+inter  (OUT) - pointer to output interval
+DESCRIPTION: 
+	Takes two datetimes as input and stores their difference in an 
+        interval. The type of the interval is the type of the 'inter'
+        descriptor.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+	OCI_ERROR if
+	   datetimes are not comparable.
+
+--------------------------- OCIDateTimeToText--------------------------
+sword OCIDateTimeToText(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 
+                        CONST OraText *fmt, ub1 fmt_length, ub1 fsprec, 
+                        CONST OraText *lang_name, size_t lang_length, 
+                        ub4 *buf_size, OraText *buf );
+NAME: OCIDateTimeToText - OCIDateTime convert date TO String 
+PARAMETERS:
+hndl (IN) - Session/Env handle. If Session Handle is passed, the 
+		    conversion takes place in session NLS_LANGUAGE and
+		    session NLS_CALENDAR, otherwise the default is used.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+date (IN) - Oracle datetime to be converted
+fmt (IN) - conversion format, if null string pointer (OraText*)0, then
+                the date is converted to a character string in the
+                default format for that type.
+fmt_length (IN) - length of the 'fmt' parameter
+fsprec (IN) - specifies the fractional second precision in which the
+               fractional seconds is returned.
+lang_name (IN) - specifies the language in which the names and 
+  	        abbreviations of months and days are returned;
+  	        default language of session is used if 'lang_name' 
+  		is null i.e. (OraText *)0
+lang_length (IN) - length of the 'nls_params' parameter
+buf_size (IN/OUT) - size of the buffer; size of the resulting string
+                is returned via this parameter
+buf (OUT) - buffer into which the converted string is placed
+DESCRIPTION:
+        Converts the given date to a string according to the specified format.
+        Refer to "TO_DATE" conversion function described in
+        "Oracle SQL Language Reference Manual" for a description of format
+        and NLS arguments. The converted null-terminated date string is
+        stored in the buffer 'buf'.
+RETURNS:
+        OCI_SUCCESS if the function completes successfully.
+        OCI_INVALID_HANDLE if 'err' is NULL.
+        OCI_ERROR if
+  	  buffer too small
+  	  invalid format
+  	  unknown language
+          overflow error
+
+----------------------------OCIDateTimeGetTimeZoneName------------------------
+sword OCIDateTimeGetTimeZoneName(dvoid *hndl, 
+                                 OCIError *err,
+                                 CONST OCIDateTime *datetime,
+                                 ub1 *buf,
+                                 ub4 *buflen);
+NAME OCIDateTimeGetTimeZoneName - OCI DateTime Get the Time Zone Name
+PARAMETERS:
+hndl (IN)      - Session/Env handle.
+err (IN/OUT)   - error handle. If there is an error, it is
+                 recorded in 'err' and this function returns OCI_ERROR.
+                 The error recorded in 'err' can be retrieved by calling
+                 OCIErrorGet().
+datetime (IN)   - Pointer to an OCIDateTime.
+buf (OUT)       - User allocated storage for name string.
+buflen (IN/OUT) - length of buf on input, length of name on out
+DESCRIPTION:
+        Returns either the timezone region name or the absolute hour and minute
+        offset. If the DateTime was created with a region id then the region 
+        name will be returned in the buf.  If the region id is zero, then the 
+        hour and minute offset is returned as "[-]HH:MM".
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+       OCI_INVALID_HANDLE if 'err' is NULL.
+       OCI_ERROR if
+         buffer too small
+         error retrieving timezone data
+         invalid region 
+         invalid LdiDateTime type
+
+---------------------------------OCIDateTimeToArray----------------------------
+sword OCIDateTimeToArray(dvoid *hndl, 
+                         OCIError *err,
+                         CONST OCIDateTime *datetime,
+                         CONST OCIInterval *reftz,
+                         ub1 *outarray,
+                         ub4 *len
+                         ub1 *fsprec);
+NAME OCIDateTimeToArray - OCI DateTime convert To Array format
+PARAMETERS:
+hndl (IN)      - Session/Env handle.
+err (IN/OUT)   - error handle. If there is an error, it is
+                 recorded in 'err' and this function returns OCI_ERROR.
+                 The error recorded in 'err' can be retrieved by calling
+                 OCIErrorGet().
+datetime (IN)   - Pointer to OCIDateTime to be converted.
+outarray (OUT)  - Result array storage
+len (OUT)        - pointer to  length of outarray.
+fsprec (IN)     - Number of fractional seconds digits.
+DESCRIPTION:
+        Returns an array representing the input DateTime descriptor.
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+       OCI_INVALID_HANDLE if 'err' is NULL.
+       OCI_ERROR if
+         buffer too small
+         error retrieving timezone data
+         invalid region 
+         invalid LdiDateTime type
+
+--------------------------------OCIDateTimeFromArray---------------------------
+sword OCIDateTimeFromArray(dvoid *hndl, 
+                         OCIError *err,
+                         ub1 *inarray,
+                         ub4 len
+                         ub1 type
+                         OCIDateTime *datetime,
+                         OCIInterval *reftz,
+                         ub1 fsprec);
+NAME OCIDateTimeFromArray - OCI DateTime convert From Array format
+PARAMETERS:
+hndl (IN)      - Session/Env handle.
+err (IN/OUT)   - error handle. If there is an error, it is
+                 recorded in 'err' and this function returns OCI_ERROR.
+                 The error recorded in 'err' can be retrieved by calling
+                 OCIErrorGet().
+inarray (IN)   - Pointer to input array representtion of DateTime
+len (IN)       - len of inarray.
+type (IN)      - One of SQLT_DATE, SQLT_TIME, SQLT_TIME_TZ, SQLT_TIMESTAMP,
+                 SQLT_TIMESTAMP_TZ, or SQLT_TIMESTAMP_LTZ.
+datetime (OUT) - Pointer to the result OCIDateTime.
+reftz (IN)     - timezone interval used with SQLT_TIMESTAMP_LTZ.
+fsprec (IN)    - fractionl seconds digits of precision (0-9).
+DESCRIPTION:
+        Returns a pointer to an OCIDateTime of type type converted from 
+        the inarray.
+RETURNS:
+       OCI_SUCCESS if the function completes successfully.
+       OCI_INVALID_HANDLE if 'err' is NULL.
+       OCI_ERROR if
+         buffer too small
+         error retrieving timezone data
+         invalid region 
+         invalid LdiDateTime type
+
+----------------------------------OCIRowidToChar-----------------------------
+Name
+OCIRowidToChar
+
+Purpose
+Converts physical/logical (universal) ROWID to chracter extended (Base 64) 
+representation into user provided buffer outbfp of length outbflp. After 
+execution outbflp contains amount of bytes converted.In case of truncation 
+error, outbflp contains required size to make this conversion successful
+and returns ORA-1405.
+
+Syntax
+sword OCIRowidToChar( OCIRowid *rowidDesc, 
+                      OraText *outbfp, 
+                      ub2 *outbflp, 
+                      OCIError *errhp)
+
+Comments
+After this conversion, ROWID in character format can be bound using
+OCIBindByPos or OCIBindByName call and used to query a row at a
+desired ROWID. 
+
+Parameters
+rowidDesc (IN)   - rowid DESCriptor which is allocated from OCIDescritorAlloc
+                   and populated by a prior SQL statement execution
+outbfp (OUT)     - pointer to the buffer where converted rowid in character 
+                   representation is stored after successful execution.
+outbflp (IN/OUT) - pointer to output buffer length variable.
+                   Before execution (IN mode) *outbflp contains the size of
+                   outbfp, after execution (OUT mode) *outbflp contains amount
+                   of bytes converted. In an event of truncation during 
+                   conversion *outbflp contains the required length to make
+                   conversion successful.
+errhp (IN/OUT)   - an error handle which can be passed to OCIErrorGet() for
+                   diagnostic information in the event of an error.
+
+------------------------------OCIDefineArrayOfStruct--------------------------
+
+
+OCIDefineArrayOfStruct()
+Name
+OCI Define for Array of Structures
+Purpose
+This call specifies additional attributes necessary for a static array define.
+Syntax
+sword OCIDefineArrayOfStruct ( OCIDefine   *defnp,
+                             OCIError    *errhp,
+                             ub4         pvskip, 
+                             ub4         indskip, 
+                             ub4         rlskip,
+                             ub4         rcskip );
+Comments
+This call specifies additional attributes necessary for an array define, used in 
+an array of structures (multi-row, multi-column) fetch.
+For more information about skip parameters, see the section "Skip Parameters" 
+on page 4-17.
+Parameters
+defnp (IN) - the handle to the define structure which was returned by a call 
+to OCIDefineByPos().
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+pvskip (IN) - skip parameter for the next data value.
+indskip (IN) - skip parameter for the next indicator location. 
+rlskip (IN) - skip parameter for the next return length value.
+rcskip (IN) - skip parameter for the next return code.
+Related Functions
+OCIAttrGet()
+
+
+
+
+
+OCIDefineByPos()
+Name
+OCI Define By Position
+Purpose
+Associates an item in a select-list with the type and output data buffer. 
+Syntax
+sb4 OCIDefineByPos ( 
+              OCIStmt     *stmtp, 
+              OCIDefine   **defnp,
+              OCIError    *errhp,
+              ub4         position,
+              dvoid       *valuep,
+              sb4         value_sz,
+              ub2         dty,
+              dvoid       *indp,
+              ub2         *rlenp,
+              ub2         *rcodep,
+              ub4         mode );
+Comments
+This call defines an output buffer which will receive data retreived from 
+Oracle. The define is a local step which is necessary when a SELECT statement 
+returns data to your OCI application.
+This call also implicitly allocates the define handle for the select-list item.
+Defining attributes of a column for a fetch is done in one or more calls. The 
+first call is to OCIDefineByPos(), which defines the minimal attributes 
+required to specify the fetch. 
+This call takes as a parameter a define handle, which must have been 
+previously allocated with a call to OCIHandleAlloc().
+Following the call to OCIDefineByPos() additional define calls may be 
+necessary for certain data types or fetch modes:
+A call to OCIDefineArrayOfStruct() is necessary to set up skip parameters 
+for an array fetch of multiple columns.
+A call to OCIDefineObject() is necessary to set up the appropriate 
+attributes of a named data type fetch. In this case the data buffer pointer 
+in ocidefn() is ignored.
+Both OCIDefineArrayOfStruct() and OCIDefineObject() must be called 
+after ocidefn() in order to fetch multiple rows with a column of named 
+data types.
+For a LOB define, the buffer pointer must be a lob locator of type 
+OCILobLocator , allocated by the OCIDescAlloc() call. LOB locators, and not 
+LOB values, are always returned for a LOB column. LOB values can then be 
+fetched using OCI LOB calls on the fetched locator.
+For NCHAR (fixed and varying length), the buffer pointer must point to an 
+array of bytes sufficient for holding the required NCHAR characters. 
+Nested table columns are defined and fetched like any other named data type. 
+If the mode parameter is this call is set to OCI_DYNAMIC_FETCH, the client 
+application can fetch data dynamically at runtime.
+Runtime data can be provided in one of two ways:
+callbacks using a user-defined function which must be registered with a 
+subsequent call to OCIDefineDynamic(). When the client library needs a 
+buffer to return the fetched data, the callback will be invoked and the 
+runtime buffers provided will return a piece or the whole data. 
+a polling mechanism using calls supplied by the OCI. This mode is 
+assumed if no callbacks are defined. In this case, the fetch call returns the 
+OCI_NEED_DATA error code, and a piecewise polling method is used 
+to provide the data.
+Related Functions: For more information about using the 
+OCI_DYNAMIC_FETCH mode, see the section "Runtime Data 
+Allocation and Piecewise Operations" on page 5-16 of Volume 1..
+For more information about the define step, see the section "Defining" 
+on page 2-30.
+Parameters
+stmtp (IN) - a handle to the requested SQL query operation.
+defnp (IN/OUT) - a pointer to a pointer to a define handle which is implicitly 
+allocated by this call.  This handle is used to  store the define information 
+for this column.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+position (IN) - the position of this value in the select list. Positions are 
+1-based and are numbered from left to right. For example, in the SELECT 
+statement
+SELECT empno, ssn, mgrno FROM employees;
+empno is at position 1, ssn is at position 2, and mgrno is at position 3.
+valuep (IN/OUT) - a pointer to a buffer or an array of buffers of the type 
+specified in the dty parameter. A number of buffers can be specified when 
+results for more than one row are desired in a single fetch call.
+value_sz (IN) - the size of each valuep buffer in bytes. If the data is stored 
+internally in VARCHAR2 format, the number of characters desired, if different 
+from the buffer size in bytes, may be additionally specified by the using 
+OCIAttrSet(). 
+In an NLS conversion environment, a truncation error will be generated if the 
+number of bytes specified is insufficient to handle the number of characters 
+desired.
+dty (IN) - the data type. Named data type (SQLT_NTY) and REF (SQLT_REF) 
+are valid only if the environment has been intialized with in object mode. 
+indp - pointer to an indicator variable or array. For scalar data types, 
+pointer to sb2 or an array of sb2s. Ignored for named data types. For named 
+data types, a pointer to a named data type indicator structure or an array of 
+named data type indicator structures is associated by a subsequent 
+OCIDefineObject() call. 
+See the section "Indicator Variables" on page 2-43 for more information about 
+indicator variables.
+rlenp (IN/OUT) - pointer to array of length of data fetched. Each element in 
+rlenp is the length of the data in the corresponding element in the row after 
+the fetch. 
+rcodep (OUT) - pointer to array of column-level return codes
+mode (IN) - the valid modes are:
+OCI_DEFAULT. This is the default mode.
+OCI_DYNAMIC_FETCH. For applications requiring dynamically 
+allocated data at the time of fetch, this mode must be used. The user may 
+additionally call OCIDefineDynamic() to set up a callback function that 
+will be invoked to receive the dynamically allocated buffers and to set 
+up the memory allocate/free callbacks and the context for the callbacks. 
+valuep and value_sz are ignored in this mode. 
+Related Functions
+OCIDefineArrayOfStruct(), OCIDefineDynamic(), OCIDefineObject()
+
+
+
+
+OCIDefineDynamic()
+Name
+OCI Define Dynamic Fetch Attributes
+Purpose
+This call is used to set the additional attributes required if the 
+OCI_DYNAMIC_FETCH mode was selected in OCIDefineByPos(). 
+Syntax
+sword OCIDefineDynamic( OCIDefine   *defnp,
+                      OCIError    *errhp,
+                      dvoid       *octxp, 
+                      OCICallbackDefine (ocbfp)(
+                                  dvoid             *octxp,
+                                  OCIDefine         *defnp,
+                                  ub4               iter, 
+                                  dvoid             **bufpp,
+                                  ub4               **alenpp,
+                                  ub1               *piecep,
+                                  dvoid             **indpp,
+                                  ub2               **rcodep)  );
+Comments
+This call is used to set the additional attributes required if the 
+OCI_DYNAMIC_FETCH mode has been selected in a call to 
+OCIDefineByPos(). 
+When the OCI_DYNAMIC_FETCH mode is selected, buffers will be 
+dynamically allocated for REF, and named data type, values to receive the 
+data. The pointers to these buffers will be returned. 
+If OCI_DYNAMIC_FETCH mode was selected, and the call to 
+OCIDefineDynamic() is skipped, then the application can fetch data piecewise 
+using OCI calls.
+For more information about OCI_DYNAMIC_FETCH mode, see the section 
+"Runtime Data Allocation and Piecewise Operations" on page 5-16.
+Parameters
+defnp (IN/OUT) - the handle to a define structure returned by a call to 
+OCIDefineByPos().
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+octxp (IN) - points to a context for the callback function. 
+ocbfp (IN) - points to a callback function. This is invoked at runtime to get 
+a pointer to the buffer into which the fetched data or a piece of it will be 
+retreived. The callback also specifies the indicator, the return code and the 
+lengths of the data piece and indicator. The callback has the following 
+parameters:
+octxp (IN) - a context pointer passed as an argument to all the callback 
+functions.
+defnp (IN) - the define handle.
+iter (IN) - which row of this current fetch.
+bufpp (OUT) - returns a pointer to a buffer to store the column value, ie. 
+*bufp points to some appropriate storage for the column value.
+alenpp (OUT) - returns a pointer to the length of the buffer. *alenpp 
+contains the size of the buffer after return from callback. Gets set to 
+actual data size after fetch.
+piecep (IN/OUT) - returns a piece value, as follows:
+The IN value can be OCI_ONE_PIECE, OCI_FIRST_PIECE or 
+OCI_NEXT_PIECE.
+The OUT value can be OCI_ONE_PIECE if the IN value was 
+OCI_ONE_PIECE.
+The OUT value can be OCI_ONE_PIECE or OCI_FIRST_PIECE if 
+the IN value was OCI_FIRST_PIECE.
+The OUT value can only be OCI_NEXT_PIECE or 
+OCI_LAST_PIECE if the IN value was OCI_NEXT_PIECE. 
+indpp (IN) - indicator variable pointer
+rcodep (IN) - return code variable pointer
+Related Functions
+OCIAttrGet()
+OCIDefineObject()
+
+
+
+
+OCIDefineObject()
+Name
+OCI Define Named Data Type attributes
+Purpose
+Sets up additional attributes necessary for a Named Data Type define.
+Syntax
+sword OCIDefineObject ( OCIDefine       *defnp,
+                      OCIError        *errhp,
+                      CONST OCIType   *type,
+                      dvoid           **pgvpp, 
+                      ub4             *pvszsp, 
+                      dvoid           **indpp, 
+                      ub4             *indszp );
+Comments
+This call sets up additional attributes necessary for a Named Data Type define.An error will be returned if this function is called when the OCI environment 
+has been initialized in non-Object mode.
+This call takes as a paramter a type descriptor object (TDO) of datatype 
+OCIType for the named data type being defined.  The TDO can be retrieved 
+with a call to OCITypeByName().
+See the description of OCIInitialize() on page 13 - 43 for more information 
+about initializing the OCI process environment.
+Parameters
+defnp (IN/OUT) - a define handle previously allocated in a call to 
+OCIDefineByPos(). 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+type (IN, optional) - points to the Type Descriptor Object (TDO) which 
+describes the type of the program variable. Only used for program variables 
+of type SQLT_NTY. This parameter is optional, and may be passed as NULL 
+if it is not being used.
+pgvpp (IN/OUT) - points to a pointer to a program variable buffer. For an 
+array, pgvpp points to an array of pointers. Memory for the fetched named data 
+type instance(s) is dynamically allocated in the object cache. At the end of the 
+fetch when all the values have been received, pgvpp points to the pointer(s) to
+these newly allocated named data type instance(s). The application must call 
+OCIObjectMarkDel() to deallocate the named data type instance(s) when they 
+are no longer needed. 
+pvszsp (IN/OUT) - points to the size of the program variable. For an array, it 
+is an array of ub4s. On return points to the size(s) of unpickled fetched 
+values.
+indpp (IN/OUT) - points to a pointer to the program variable buffer 
+containing the parallel indicator structure. For an array, points to an array 
+of pointers. Memory is allocated to store the indicator structures in the 
+object cache. At the end of the fetch when all values have been received, 
+indpp points to the pointer(s) to these newly allocated indicator structure(s).
+indszp (IN/OUT) - points to the size(s) of the indicator structure program 
+variable. For an array, it is an array of ub4s. On return points to the size(s)
+of the unpickled fetched indicator values.
+Related Functions
+OCIAttrGet()
+
+
+
+OCIDescAlloc()
+Name
+OCI Get DESCriptor or lob locator
+Purpose
+Allocates storage to hold certain data types. The descriptors can be used as 
+bind or define variables.
+Syntax
+sword OCIDescAlloc ( CONST dvoid   *parenth,
+                   dvoid         **descpp, 
+                   ub4           type,
+                   size_t        xtramem_sz,
+                   dvoid         **usrmempp);
+Comments
+Returns a pointer to an allocated and initialized structure, corresponding to 
+the type specified in type. A non-NULL descriptor or LOB locator is returned 
+on success. No diagnostics are available on error.
+This call returns OCI_SUCCESS if successful, or OCI_INVALID_HANDLE if 
+an out-of-memory error occurs. 
+Parameters
+parenth (IN) - an environment handle. 
+descpp (OUT) - returns a descriptor or LOB locator of desired type. 
+type (IN) - specifies the type of descriptor or LOB locator to be allocated. 
+The specific types are:
+OCI_DTYPE_SNAP - specifies generation of snapshot descriptor of C 
+type - OCISnapshot
+OCI_DTYPE_LOB - specifies generation of a LOB data type locator of C 
+type - OCILobLocator
+OCI_DTYPE_RSET - specifies generation of a descriptor of C type 
+OCIResult that references a result set (a number of rows as a result of a 
+query). This descriptor is bound to a bind variable of data type 
+SQLT_RSET (result set). The descriptor has to be converted into a 
+statement handle using a function - OCIResultSetToStmt() - which can 
+then be passed to OCIDefineByPos() and OCIStmtFetch() to retrieve the 
+rows of the result set.
+OCI_DTYPE_ROWID - specifies generation of a ROWID descriptor of C 
+type OCIRowid.
+OCI_DTYPE_COMPLEXOBJECTCOMP - specifies generation of a 
+complex object retrieval descriptor of C type 
+OCIComplexObjectComp.
+xtramemsz (IN) - specifies an amount of user memory to be allocated for use 
+by the application. 
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user. 
+Related Functions
+OCIDescFree()
+
+
+
+
+OCIDescFree()
+Name
+OCI Free DESCriptor
+Purpose
+Deallocates a previously allocated descriptor.
+Syntax
+sword OCIDescFree ( dvoid    *descp,
+                  ub4      type);
+Comments
+This call frees up storage associated with the descriptor, corresponding to the
+type specified in type. Returns OCI_SUCCESS or OCI_INVALID_HANDLE. 
+All descriptors must be explicitly deallocated. OCI will not deallocate a 
+descriptor if the environment handle is deallocated.
+Parameters
+descp (IN) - an allocated descriptor. 
+type (IN) - specifies the type of storage to be freed. The specific types are: 
+OCI_DTYPE_SNAP - snapshot descriptor
+OCI_DTYPE_LOB - a LOB data type descriptor
+OCI_DTYPE_RSET - a descriptor that references a result set (a number 
+of rows as a result of a query).
+OCI_DTYPE_ROWID - a ROWID descriptor
+OCI_DTYPE_COMPLEXOBJECTCOMP - a complex object retrieval 
+descriptor
+Related Functions
+OCIDescAlloc()
+
+
+
+OCIDescribeAny()
+Name
+OCI DeSCribe Any
+Purpose
+Describes existing schema objects.
+Syntax
+sword OCIDescribeAny ( OCISvcCtx     *svchp,
+                     OCIError      *errhp,
+                     dvoid         *objptr,
+                     ub4           objnm_len,
+		     ub1           objptr_typ,
+                     ub1 	   info_level,
+		     ub1           objtype,
+                     OCIDesc       *dschp );
+Comments
+This is a generic describe call that describes existing schema objects: tables,
+views, synonyms, procedures, functions, packages, sequences, and types. As a 
+result of this call, the describe handle is populated with the object-specific 
+attributes which can be obtained through an OCIAttrGet() call.
+An OCIParamGet() on the describe handle returns a parameter descriptor for a 
+specified position. Parameter positions begin with 1. Calling OCIAttrGet() on 
+the parameter descriptor returns the specific attributes of a stored procedure 
+or function parameter or a table column descriptor as the case may be. 
+These subsequent calls do not need an extra round trip to the server because 
+the entire schema object description cached on the client side by 
+OCIDescribeAny(). Calling OCIAttrGet() on the describe handle can also return 
+the total number of positions.
+See the section "Describing" on page 2-33 for more information about describe 
+operations.
+Parameters
+TO BE UPDATED
+svchp (IN/OUT) - a service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+objptr (IN) - the name of the object (a null-terminated string) to be 
+described. Only procedure or function names are valid when connected to an 
+Oracle7 Server.
+objptr_len (IN) - the length of the string. Must be non-zero.
+objptr_typ (IN) - Must be OCI_OTYPE_NAME, OCI_OTYPE_REF, or OCI_OTYPE_PTR.
+info_level (IN) - reserved for future extensions. Pass OCI_DEFAULT.
+objtype (IN/OUT) - object type.
+dschp (IN/OUT) - a describe handle that is populated with describe 
+information about the object after the call.
+Related Functions
+OCIAttrGet()
+
+
+
+OCIEnvCreate()
+Name
+OCI ENVironment CREATE
+Purpose
+This function creates and initializes an environment for the rest of
+the OCI functions to work under.  This call is a replacement for both
+the OCIInitialize and OCIEnvInit calls.
+Syntax
+sword OCIEnvCreate  ( OCIEnv        **envhpp, 
+                      ub4           mode, 
+                      CONST dvoid   *ctxp, 
+                      CONST dvoid   *(*malocfp) 
+                                    (dvoid *ctxp, 
+                                        size_t size), 
+                      CONST dvoid   *(*ralocfp) 
+                                    (dvoid *ctxp, 
+                                       dvoid *memptr, 
+                                       size_t newsize), 
+                      CONST void    (*mfreefp) 
+                                    ( dvoid *ctxp, 
+                                       dvoid *memptr))
+                      size_t    xtramemsz,
+                      dvoid     **usrmempp );
+ 
+Comments
+This call creates an environment for all the OCI calls using the modes
+specified by the user. This call can be used instead of the two calls
+OCIInitialize and OCIEnvInit. This function returns an environment handle
+which is then used by the remaining OCI functions. There can be multiple
+environments in OCI each with its own environment modes.  This function 
+also performs any process level initialization if required by any mode.
+For example if the user wants to initialize an environment as OCI_THREADED,
+then all libraries that are used by OCI are also initialized in the
+threaded mode. 
+
+This call should be invoked before anny other OCI call and should be used
+instead of the OCIInitialize and OCIEnvInit calls. This is the recommended
+call, although OCIInitialize and OCIEnvInit calls will still be supported
+for backward compatibility. 
+ 
+envpp (OUT) - a pointer to a handle to the environment. 
+mode (IN) - specifies initialization of the mode. The valid modes are:
+OCI_DEFAULT - default mode.
+OCI_THREADED - threaded environment. In this mode, internal data 
+structures are protected from concurrent accesses by multiple threads. 
+OCI_OBJECT - will use navigational object interface. 
+ctxp (IN) - user defined context for the memory call back routines. 
+malocfp (IN) - user-defined memory allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory allocation function.
+size - size of memory to be allocated by the user-defined memory 
+allocation function
+ralocfp (IN) - user-defined memory re-allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory reallocation 
+function.
+memp - pointer to memory block
+newsize - new size of memory to be allocated
+mfreefp (IN) - user-defined memory free function. If mode is 
+OCI_THREADED, this memory free routine must be thread safe.
+ctxp - context pointer for the user-defined memory free function.
+memptr - pointer to memory to be freed
+xtramemsz (IN) - specifies the amount of user memory to be allocated. 
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user.
+
+Example
+
+Related Functions
+OCIInitialize, OCIEnvInit
+
+OCIEnvNlsCreate()
+Name
+OCI ENVironment CREATE with NLS info
+Purpose
+This function does almost everything OCIEnvCreate does, plus enabling setting
+of charset and ncharset programmatically, except OCI_UTF16 mode.
+Syntax
+sword OCIEnvNlsCreate(OCIEnv        **envhpp,
+                      ub4           mode,
+                      dvoid         *ctxp,
+                      dvoid         *(*malocfp)
+                                    (dvoid *ctxp,
+                                        size_t size),
+                      dvoid         *(*ralocfp)
+                                    (dvoid *ctxp,
+                                       dvoid *memptr,
+                                       size_t newsize),
+                      void          (*mfreefp)
+                                    (dvoid *ctxp,
+                                       dvoid *memptr),
+                      size_t        xtramemsz,
+                      dvoid         **usrmempp,
+                      ub2           charset,
+                      ub2           ncharset)
+Comments
+The charset and ncharset must be both zero or non-zero.
+The parameters have the same meaning as the ones in OCIEnvCreate().
+When charset or ncharset is non-zero, the corresponding character set will
+be used to replace the ones specified in NLS_LANG or NLS_NCHAR. Moreover,
+OCI_UTF16ID is allowed to be set as charset and ncharset.
+On the other hand, OCI_UTF16 mode is deprecated with this function. 
+Applications can achieve the same effects by setting 
+both charset and ncharset as OCI_UTF16ID.
+
+
+OCIEnvInit()
+Name
+OCI INITialize environment
+Purpose
+This call initializes the OCI environment handle.
+Syntax
+sword OCIEnvInit ( OCIEnv    **envp,
+                 ub4       mode,
+                 size_t    xtramemsz,
+                 dvoid     **usrmempp );
+Comments
+Initializes the OCI environment handle. No changes are done on an initialized 
+handle. If OCI_ERROR or OCI_SUCCESS_WITH_INFO is returned, the 
+environment handle can be used to obtain ORACLE specific errors and 
+diagnostics.
+This call is processed locally, without a server round-trip.
+Parameters
+envpp (OUT) - a pointer to a handle to the environment. 
+mode (IN) - specifies initialization of an environment mode. The only valid 
+mode is OCI_DEFAULT for default mode
+xtramemsz (IN) - specifies the amount of user memory to be allocated. 
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user.
+Example
+See the description of OCISessionBegin() on page 13-84 for an example showing 
+the use of OCIEnvInit(). 
+Related Functions
+
+
+
+
+OCIErrorGet()
+Name
+OCI Get Diagnostic Record
+Purpose
+Returns an error message in the buffer provided and an ORACLE error.
+Syntax
+sword OCIErrorGet ( dvoid      *hndlp, 
+                  ub4        recordno,
+                  OraText       *sqlstate,
+                  ub4        *errcodep, 
+                  OraText       *bufp,
+                  ub4        bufsiz,
+                  ub4        type );
+Comments
+Returns an error message in the buffer provided and an ORACLE error. 
+Currently does not support SQL state. This call can be called a multiple 
+number of times if there are more than one diagnostic record for an error.
+The error handle is originally allocated with a call to OCIHandleAlloc().
+Parameters
+hndlp (IN) - the error handle, in most cases, or the environment handle (for 
+errors on OCIEnvInit(), OCIHandleAlloc()).
+recordno (IN) - indicates the status record from which the application seeks 
+info. Starts from 1. 
+sqlstate (OUT) - Not supported in Version 8.0.
+errcodep (OUT) - an ORACLE Error is returned.
+bufp (OUT) - the error message text is returned.
+bufsiz (IN) - the size of the buffer provide to get the error message.
+type (IN) - the type of the handle.
+Related Functions
+OCIHandleAlloc()
+
+OCIExtractInit
+Name
+OCI Extract Initialize 
+Purpose
+This function initializes the parameter manager. 
+Syntax
+sword OCIExtractInit(dvoid *hndl, OCIError *err);
+Comments
+It must be called before calling any other parameter manager routine. The NLS 
+information is stored inside the parameter manager context and used in 
+subsequent calls to OCIExtract routines.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+Related Functions
+OCIExtractTerm()
+
+OCIExtractTerm
+Name
+OCI Extract Terminate
+Purpose
+This function releases all dynamically allocated storage and may perform 
+other internal bookkeeping functions.
+Syntax
+sword OCIExtractTerm(dvoid *hndl, OCIError *err);
+Comments
+It must be called when the parameter manager is no longer being used.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+Related Functions
+OCIExtractInit()
+
+OCIExtractReset
+Name
+OCI Extract Reset
+Purpose
+The memory currently used for parameter storage, key definition storage, and 
+parameter value lists is freed and the structure is reinitialized.
+Syntax
+sword OCIExtractReset(dvoid *hndl, OCIError *err);
+Comments
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+Related Functions
+
+OCIExtractSetNumKeys
+Name
+OCI Extract Set Number of Keys
+Purpose
+Informs the parameter manager of the number of keys that will be registered.
+Syntax
+sword OCIExtractSetNumKeys(dvoid *hndl, OCIError *err, uword numkeys);
+Comments
+This routine must be called prior to the first call of OCIExtractSetKey().  
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+numkeys (IN) - The number of keys that will be registered with 
+               OCIExtractSetKey().
+Related Functions
+OCIExtractSetKey()
+
+OCIExtractSetKey
+Name
+OCI Extract Set Key definition
+Purpose
+Registers information about a key with the parameter manager.
+Syntax
+sword OCIExtractSetKey(dvoid *hndl, OCIError *err, CONST OraText *name, 
+                       ub1 type, ub4 flag, CONST dvoid *defval,                                        CONST sb4 *intrange, CONST OraText *CONST *strlist);
+Comments
+This routine must be called after calling OCIExtractSetKey() and before 
+calling OCIExtractFromFile() or OCIExtractFromStr().  
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+name (IN) - The name of the key.
+type (IN) - The type of the key (OCI_EXTRACT_TYPE_INTEGER, 
+            OCI_EXTRACT_TYPE_OCINUM, OCI_EXTRACT_TYPE_STRING, or 
+            OCI_EXTRACT_TYPE_BOOLEAN).
+flag (IN) - Set to OCI_EXTRACT_MULTIPLE if the key can take multiple values 
+            or 0 otherwise.
+defval (IN) - Set to the default value for the key.  May be NULL if there is 
+               no default.  A string default must be a (text*) type, an 
+               integer default must be an (sb4*) type, and a boolean default 
+               must be a (ub1*) type.
+intrange (IN) - Starting and ending values for the allowable range of integer 
+                values.  May be NULL if the key is not an integer type or if 
+                all integer values are acceptable.
+strlist (IN) - List of all acceptable text strings for the key.  May be NULL 
+               if the key is not a string type or if all text values are 
+               acceptable.
+Related Functions
+OCIExtractSetNumKeys()
+
+OCIExtractFromFile
+Name
+OCI Extract parameters From File
+Purpose
+The keys and their values in the given file are processed. 
+Syntax
+sword OCIExtractFromFile(dvoid *hndl, OCIError *err, ub4 flag, 
+                         OraText *filename);
+Comments
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+flag (IN) - Zero or has one or more of the following bits set: 
+           OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or 
+           OCI_EXTRACT_APPEND_VALUES. 
+filename (IN) - Null-terminated filename string.
+Related Functions
+
+OCIExtractFromStr
+Name
+OCI Extract parameters From String
+Purpose
+The keys and their values in the given string are processed. 
+Syntax
+sword OCIExtractFromStr(dvoid *hndl, OCIError *err, ub4 flag, OraText *input);
+Comments
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+flag (IN) - Zero or has one or more of the following bits set: 
+           OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or 
+           OCI_EXTRACT_APPEND_VALUES. 
+input (IN) - Null-terminated input string.
+Related Functions
+
+OCIExtractToInt
+Name
+OCI Extract To Integer
+Purpose
+Gets the integer value for the specified key.
+Syntax
+sword OCIExtractToInt(dvoid *hndl, OCIError *err, OraText *keyname, uword valno, 
+                      sb4 *retval);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual integer value.
+Related Functions
+
+OCIExtractToBool
+Name
+OCI Extract To Boolean
+Purpose
+Gets the boolean value for the specified key. 
+Syntax
+sword OCIExtractToBool(dvoid *hndl, OCIError *err, OraText *keyname, 
+                       uword valno, ub1 *retval);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual boolean value.
+Related Functions
+
+OCIExtractToStr
+Name
+OCI Extract To String
+Purpose
+Gets the string value for the specified key.
+Syntax
+sword OCIExtractToStr(dvoid *hndl, OCIError *err, OraText *keyname, 
+                      uword valno, OraText *retval, uword buflen);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual null-terminated string value.
+buflen (IN) - The length of the buffer for retval.
+Related Functions
+
+Note: The following OCIExtract functions are unavailable in this release
+
+OCIExtractToOCINum
+Name
+OCI Extract To OCI Number
+Purpose
+Gets the OCINumber value for the specified key.
+Syntax
+sword OCIExtractToOCINum(dvoid *hndl, OCIError *err, OraText *keyname, 
+                         uword valno, OCINumber *retval);
+Comments
+The valno'th value (starting with 0) is returned.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR. 
+OCI_NO_DATA means that there is no valno'th value for this key.
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+keyname (IN) - Key name.
+valno (IN) - Which value to get for this key.
+retval (OUT) - The actual OCINumber value.
+Related Functions
+
+OCIExtractToList
+Name
+OCI Extract To parameter List
+Purpose
+Generates a list of parameters from the parameter structures that are stored 
+in memory. 
+Syntax
+sword OCIExtractToList(dvoid *hndl, OCIError *err, uword *numkeys);
+Comments
+Must be called before OCIExtractValues() is called.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+numkeys (OUT) - Number of distinct keys stored in memory.
+Related Functions
+OCIExtractFromList()
+
+OCIExtractFromList
+Name
+OCI Extract From parameter List
+Purpose
+Generates a list of values for the a parameter in the parameter list.
+Syntax
+sword OCIExtractFromList(dvoid *hndl, OCIError *err, uword index, OraText *name, 
+                         ub1 *type, uword *numvals, dvoid ***values);
+Comments
+Parameters are specified by an index. OCIExtractToList() must be called prior 
+to calling this routine to generate the parameter list from the parameter 
+structures that are stored in memory. 
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN) - The OCI environment or session handle.
+err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+               err and this function returns OCI_ERROR. Diagnostic information 
+               can be obtained by calling OCIErrorGet().
+name (OUT) - Name of the key for the current parameter.
+type (OUT) - Type of the current parameter (OCI_EXTRACT_TYPE_STRING, 
+             OCI_EXTRACT_TYPE_INTEGER, OCI_EXTRACT_TYPE_OCINUM, or 
+             OCI_EXTRACT_TYPE_BOOLEAN)
+numvals (OUT) - Number of values for this parameter.
+values (OUT) - The values for this parameter.
+Related Functions
+OCIExtractToList()
+
+
+************************  OCIFileClose() ***********************************
+ 
+Name
+ OCIFileClose - Oracle Call Interface FILE i/o CLOSE
+
+Purpose
+ Close a previously opened file.
+
+Syntax
+ sword OCIFileClose ( dvoid             *hndl, 
+             	      OCIError          *err,
+                      OCIFileObject     *filep )
+
+Comments
+ This function will close a previously opened file. If the function succeeds
+ then OCI_SUCCESS will be returned, else OCI_ERROR. 
+ 
+Parameters
+ hndl  (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle
+ filep (IN) - the OCIFile file object
+
+Related Functions
+ OCIFileOpen.  
+
+
+
+********************* OCIFileExists() **************************************
+
+Name
+ OCIFileExists - Oracle Call Interface FILE i/o EXIST
+
+Purpose
+ Check to see if the file exists.
+
+Syntax
+ sword OCIFileExists ( dvoid           *hndl, 
+            	      OCIError         *err, 
+                      OraText          *filename,
+                      OraText          *path,
+                      ub1              *flag )
+
+Comments
+ This function will set the flag to TRUE if the file exists else it will
+ be set to FALSE.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR. 
+
+Parameters
+ hndl(IN) - OCI environment or session handle
+ err(OUT) - OCI error handle
+ filename(IN) - filename
+ path(IN) - path of the file
+ flag(OUT) - whether the file exists or not
+
+Related Functions.
+ None.
+     
+
+ **************************** OCIFileFlush() ******************************
+
+
+Name
+ OCIFileFlush - Oracle Call Interface File i/o FLUSH
+
+Purpose
+ Flush the buffers associated with the file to the disk.
+
+Syntax
+ sword OCIFileFlush ( dvoid             *hndl, 
+             	      OCIError          *err,
+                      OCIFileObject     *filep )
+
+Comments
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters 
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle
+ filep (IN) - the OCIFile file object
+
+Related Functions
+ OCIFileOpen, OCIFileWrite
+
+
+
+ *************************** OCIFileGetLength() ****************************
+
+Name
+ OCIFileGetLength - Oracle Call Interface FILE i/o GET file LENGTH
+
+Purpose
+ Get the length of a file.
+
+Syntax
+ OCIFileGetLength(dvoid           *hndl, 
+	          OCIError        *err,
+                  OraText         *filename,
+                  OraText         *path,
+                  ubig_ora        *lenp )
+
+Comments
+ The length of the file will be returned in lenp.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+ 
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filename (IN) - file name.
+ path (IN) - path of the file.
+ lenp (OUT) - On output, it is the length of the file in bytes.
+ is the number of bytes in the file.
+
+Related Functions
+ None.
+
+
+
+******************************** OCIFileInit() *****************************
+   
+Name
+ OCIFileInit - Oracle Call Interface FILE i/o INITialize
+
+Purpose
+ Initialize the OCI File I/O package and create the OCIFile context.
+
+Syntax
+ sword OCIFileInit ( dvoid *hndl, 
+                     OCIError *err)
+
+Comments
+ This function should be called before any of the OCIFile functions are
+ used.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+ 
+Parameters
+ hndl(IN) - OCI environment or session handle.
+ err(OUT) - OCI error structure.
+
+Related Functions
+ OCIFileTerm
+     
+
+
+********************************* OCIFileOpen() *****************************
+
+Name
+ OCIFileOpen - Oracle Call Interface File i/o OPEN
+
+Purpose
+     Open a file.
+
+Syntax
+ sword OCIFileOpen ( dvoid               *hndl, 
+	             OCIError            *err,
+                     OCIFileObject      **filep,
+                     OraText             *filename,
+                     OraText             *path,
+                     ub4                  mode,
+                     ub4                  create, 
+                     ub4                  type )
+
+Comments
+ OCIFileOpen returns a handle to the open file in filep if the file is
+ successfully opened. 
+ If one wants to use the standard file objects (stdin, stdout & stderr)
+ then OCIFileOpen whould be called with the type filed containing the 
+ appropriate type (see the parameter type). If any of the standard files 
+ are specified then filename, path, mode and create are ignored.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (OUT) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (OUT) - the file object to be returned.
+ filename (IN) - file name (NULL terminated string).
+ path (IN) - path of the file (NULL terminated string).
+ mode - mode in which to open the file (valid modes are OCI_FILE_READONLY,
+ OCI_FILE_WRITEONLY, OCI_FILE_READ_WRITE).
+ create - should the file be created if it does not exist. Valid values
+ are: 
+     OCI_FILE_TRUNCATE - create a file regardless of whether or not it exists. 
+                        If the file already exists overwrite it.
+     OCI_FILE_EXIST - open it if it exists, else fail.
+     OCI_FILE_EXCL - fail if the file exists, else create.
+     OCI_FILE_CREATE - open the file if it exists, and create it if it doesn't.
+     OCI_FILE_APPEND - set the file pointer to the end of the file prior to 
+                      writing(this flag can be OR'ed with OCI_FILE_EXIST or
+                      OCI_FILE_CREATE).
+type - file type. Valid values are OCI_FILE_TEXT, OCI_FILE_BIN, 
+       OCI_FILE_STDIN, OCI_FILE_STDOUT and OCI_FILE_STDERR.
+       If any of the standard files are specified then filename, path, mode
+       and create are ignored.
+
+Related Functions.
+ OCIFileClose
+
+
+
+************************** OCIFileRead() ************************************
+   
+Name
+ OCIFileRead - Oracle Call Interface FILE i/o READ
+
+Purpose
+ Read from a file into a buffer.
+
+Syntax
+ sword OCIFileRead ( dvoid            *hndl, 
+          	     OCIError         *err,
+                     OCIFileObject    *filep,
+                     dvoid            *bufp,
+                     ub4               bufl,
+                     ub4              *bytesread )
+
+Comments
+ Upto bufl bytes from the file will be read into bufp. The user should
+ allocate memory for the buffer.
+ The number of bytes read would be in bytesread.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (IN/OUT) - a File Object that uniquely references the file.
+ bufp (IN) - the pointer to a buffer into which the data will be read. The 
+ length of the allocated memory is assumed to be bufl. 
+ bufl - the length of the buffer in bytes. 
+ bytesread (OUT) - the number of bytes read.
+
+Related Functions
+ OCIFileOpen, OCIFileSeek, OCIFileWrite
+
+
+
+****************************** OCIFileSeek() ******************************
+
+Name
+ OCIFileSeek - Oracle Call Interface FILE i/o SEEK
+
+Purpose
+ Perfom a seek to a byte position.
+
+Syntax
+ sword OCIFileSeek ( dvoid           *hndl, 
+        	     OCIError        *err,  
+                     OCIFileObject   *filep,
+                     uword            origin,
+                     ubig_ora         offset,
+                     sb1              dir)
+
+Comments
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (IN/OUT) - a file handle that uniquely references the file.
+ origin - The starting point we want to seek from. NOTE: The starting 
+ point may be OCI_FILE_SEEK_BEGINNING (beginning), OCI_FILE_SEEK_CURRENT 
+ (current position), or OCI_FILE_SEEK_END (end of file). 
+ offset - The number of bytes from the origin we want to start reading from. 
+ dir - The direction we want to go from the origin. NOTE: The direction 
+ can be either OCI_FILE_FORWARD or OCI_FILE_BACKWARD. 
+ 
+Related Function
+ OCIFileOpen, OCIFileRead, OCIFileWrite
+
+
+
+*************************** OCIFileTerm() **********************************
+
+Name
+ OCIFileTerm - Oracle Call Interface FILE i/o TERMinate
+
+Purpose
+ Terminate the OCI File I/O package and destroy the OCI File context.
+
+Syntax
+ sword OCIFileTerm ( dvoid *hndl, 
+                     OCIError *err )
+
+Comments
+ After this function has been called no OCIFile function should be used.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+ 
+Parameters
+ hndl(IN) - OCI environment or session handle.
+ err(OUT) - OCI error structure. 
+  
+Related Functions 
+ OCIFileInit   
+ 
+
+********************************* OCIFileWrite() **************************** 
+
+Name 
+ OCIFileWrite - Oracle Call Interface FILE i/o WRITE
+
+Purpose
+  Write data from buffer into a file.
+
+Syntax
+ sword OCIFileWrite ( dvoid            *hndl, 
+            	      OCIError         *err,  
+                      OCIFileObject    *filep,
+                      dvoid            *bufp, 
+                      ub4               buflen
+                      ub4              *byteswritten )
+
+Comments
+ The number of bytes written will be in *byteswritten.
+ The function will return OCI_ERROR if any error is encountered, else
+ it will return OCI_ERROR.
+
+Parameters
+ hndl (IN) - the OCI environment or session handle.
+ err (OUT) - the OCI error handle.  If  there is an error, it is recorded 
+ in err and this function returns OCI_ERROR.  Diagnostic information can be 
+ obtained by calling OCIErrorGet().
+ filep (IN/OUT) - a file handle that uniquely references the file.
+ bufp (IN) - the pointer to a buffer from which the data will be written. 
+ The length of the allocated memory is assumed to be the value passed
+ in bufl. 
+ bufl - the length of the buffer in bytes.
+ byteswritten (OUT) - the number of bytes written.
+ 
+Related Functions
+ OCIFileOpen, OCIFileSeek, OCIFileRead 
+
+
+
+
+
+OCIHandleAlloc() 
+Name
+OCI Get HaNDLe
+Purpose
+This call returns a pointer to an allocated and initialized handle.
+Syntax
+sword OCIHandleAlloc ( CONST dvoid   *parenth,
+                     dvoid         **hndlpp, 
+                     ub4           type, 
+                     size_t        xtramem_sz,
+                     dvoid         **usrmempp);
+Comments
+Returns a pointer to an allocated and initialized structure, corresponding to 
+the type specified in type. A non-NULL handle is returned on success. Bind 
+handle and define handles are allocated with respect to a statement handle. All
+other handles are allocated with respect to an environment handle which is 
+passed in as a parent handle.
+No diagnostics are available on error. This call returns OCI_SUCCESS if 
+successful, or OCI_INVALID_HANDLE if an out-of-memory error occurs.
+Handles must be allocated using OCIHandleAlloc() before they can be passed 
+into an OCI call.
+Parameters
+parenth (IN) - an environment or a statement handle. 
+hndlpp (OUT) - returns a handle to a handle type. 
+type (IN) - specifies the type of handle to be allocated. The specific types 
+are: 
+OCI_HTYPE_ERROR - specifies generation of an error report handle of 
+C type OCIError
+OCI_HTYPE_SVCCTX - specifies generation of a service context handle 
+of C type OCISvcCtx
+OCI_HTYPE_STMT - specifies generation of a statement (application 
+request) handle of C type OCIStmt
+OCI_HTYPE_BIND - specifies generation of a bind information handle 
+of C type OCIBind
+OCI_HTYPE_DEFINE - specifies generation of a column definition 
+handle of C type OCIDefine
+OCI_HTYPE_DESCRIBE  - specifies generation of a select list 
+description handle of C type OCIDesc
+OCI_HTYPE_SERVER - specifies generation of a server context handle 
+of C type OCIServer
+OCI_HTYPE_SESSION - specifies generation of an authentication 
+context handle of C type OCISession
+OCI_HTYPE_TRANS - specifies generation of a transaction context
+handle of C type OCITrans
+OCI_HTYPE_COMPLEXOBJECT - specifies generation of a complex 
+object retrieval handle of C type OCIComplexObject
+OCI_HTYPE_SECURITY - specifies generation of a security handle of C 
+type OCISecurity
+xtramem_sz (IN) - specifies an amount of user memory to be allocated.
+usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz 
+allocated by the call for the user. 
+Related Functions
+OCIHandleFree()
+
+
+
+OCIHandleFree()
+Name
+OCI Free HaNDLe
+Purpose
+This call explicitly deallocates a handle.
+Syntax
+sword OCIHandleFree ( dvoid     *hndlp,
+                    ub4       type);
+Comments
+This call frees up storage associated with a handle, corresponding to the type 
+specified in the type parameter.
+This call returns either OCI_SUCCESS or OCI_INVALID_HANDLE.
+All handles must be explicitly deallocated. OCI will not deallocate a child 
+handle if the parent is deallocated.
+Parameters
+hndlp (IN) - an opaque pointer to some storage.
+type (IN) - specifies the type of storage to be allocated. The specific types are:
+OCI_HTYPE_ENV - an environment handle
+OCI_HTYPE_ERROR - an error report handle
+OCI_HTYPE_SVCCTX - a service context handle
+OCI_HTYPE_STMT - a statement (application request) handle
+OCI_HTYPE_BIND - a bind information handle
+OCI_HTYPE_DEFINE - a column definition handle
+OCI_HTYPE_DESCRIBE  - a select list description handle
+OCI_HTYPE_SERVER - a server handle
+OCI_HTYPE_SESSION - a user authentication handle
+OCI_HTYPE_TRANS - a transaction handle
+OCI_HTYPE_COMPLEXOBJECT - a complex object retrieval handle
+OCI_HTYPE_SECURITY - a security handle
+Related Functions
+OCIHandleAlloc()
+
+
+
+
+OCIInitialize()
+Name
+OCI Process Initialize
+Purpose
+Initializes the OCI process environment.
+Syntax
+sword OCIInitialize ( ub4           mode,
+                    CONST dvoid   *ctxp, 
+                    CONST dvoid   *(*malocfp) 
+                                  ( dvoid *ctxp,
+                                    size_t size ),
+                    CONST dvoid   *(*ralocfp)
+                                  ( dvoid *ctxp,
+                                    dvoid *memp,
+                                    size_t newsize ),
+                    CONST void    (*mfreefp)
+                                  ( dvoid *ctxp,
+                                    dvoid *memptr ));
+Comments
+This call initializes the OCI process environment.
+OCIInitialize() must be invoked before any other OCI call. 
+Parameters
+mode (IN) - specifies initialization of the mode. The valid modes are:
+OCI_DEFAULT - default mode.
+OCI_THREADED - threaded environment. In this mode, internal data 
+structures are protected from concurrent accesses by multiple threads. 
+OCI_OBJECT - will use navigational object interface. 
+ctxp (IN) - user defined context for the memory call back routines. 
+malocfp (IN) - user-defined memory allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory allocation function.
+size - size of memory to be allocated by the user-defined memory 
+allocation function
+ralocfp (IN) - user-defined memory re-allocation function. If mode is 
+OCI_THREADED, this memory allocation routine must be thread safe.
+ctxp - context pointer for the user-defined memory reallocation 
+function.
+memp - pointer to memory block
+newsize - new size of memory to be allocated
+mfreefp (IN) - user-defined memory free function. If mode is 
+OCI_THREADED, this memory free routine must be thread safe.
+ctxp - context pointer for the user-defined memory free function.
+memptr - pointer to memory to be freed
+Example
+See the description of OCIStmtPrepare() on page 13-96 for an example showing 
+the use of OCIInitialize().
+Related Functions
+
+--------------------------------OCITerminate------------------------------------
+
+OCITerminate()
+Name
+OCI process Terminate
+Purpose
+Do cleanup before process termination
+Syntax
+sword OCITerminate (ub4 mode);
+
+Comments
+This call performs  OCI related clean up before the OCI process terminates.
+If the process is running in shared mode then the OCI process is disconnected
+from the shared memory subsystem.
+
+OCITerminate() should be the last OCI call in any process.
+
+Parameters
+mode (IN) - specifies different termination modes.
+
+OCI_DEFAULT - default mode.
+
+Example
+
+Related Functions
+OCIInitialize()
+
+---------------------- OCIIntervalAssign --------------------------------- 
+sword OCIIntervalAssign(dvoid *hndl, OCIError *err, 
+                    CONST OCIInterval *inpinter, OCIInterval *outinter );
+
+  DESCRIPTION
+    Copies one interval to another to create a replica
+  PARAMETERS
+     hndl (IN) - Session/Env handle.
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  inpinter - Input Interval 
+    (OUT) outinter - Output Interval 
+  RETURNS
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_SUCCESS otherwise
+
+ ---------------------- OCIIntervalCheck ------------------------------------ 
+sword OCIIntervalCheck(dvoid *hndl, OCIError *err, CONST OCIInterval *interval,
+			 ub4 *valid );
+
+  DESCRIPTION
+    Checks the validity of an interval
+  PARAMETERS
+     hndl (IN) - Session/Env handle.
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  interval - Interval to be checked 
+    (OUT) valid     - Zero if the interval is valid, else returns an Ored
+	combination of the following codes.
+
+   Macro name                   Bit number      Error
+   ----------                   ----------      -----
+   OCI_INTER_INVALID_DAY         0x1           Bad day
+   OCI_INTER_DAY_BELOW_VALID     0x2           Bad DAy Low/high bit (1=low)
+   OCI_INTER_INVALID_MONTH       0x4           Bad MOnth
+   OCI_INTER_MONTH_BELOW_VALID   0x8           Bad MOnth Low/high bit (1=low)
+   OCI_INTER_INVALID_YEAR        0x10          Bad YeaR
+   OCI_INTER_YEAR_BELOW_VALID    0x20          Bad YeaR Low/high bit (1=low)
+   OCI_INTER_INVALID_HOUR        0x40          Bad HouR
+   OCI_INTER_HOUR_BELOW_VALID    0x80          Bad HouR Low/high bit (1=low)
+   OCI_INTER_INVALID_MINUTE      0x100         Bad MiNute
+   OCI_INTER_MINUTE_BELOW_VALID	 0x200         Bad MiNute Low/high bit(1=low)
+   OCI_INTER_INVALID_SECOND      0x400         Bad SeCond
+   OCI_INTER_SECOND_BELOW_VALID  0x800         bad second Low/high bit(1=low)
+   OCI_INTER_INVALID_FRACSEC     0x1000        Bad Fractional second
+   OCI_INTER_FRACSEC_BELOW_VALID 0x2000        Bad fractional second Low/High
+
+	
+  RETURNS
+    OCI_SUCCESS if interval is okay
+    OCI_INVALID_HANDLE if 'err' is NULL.
+
+ ---------------------- OCIIntervalCompare ----------------------------------- 
+sword OCIIntervalCompare(dvoid *hndl, OCIError *err, OCIInterval *inter1, 
+			OCIInterval *inter2, sword *result );
+
+  DESCRIPTION
+	Compares two intervals, returns 0 if equal, -1 if inter1 < inter2, 
+      	1 if inter1 > inter2
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+     inter1  (IN)   - Interval to be compared 
+     inter2  (IN)   - Interval to be compared 
+     result  (OUT)  - 	comparison result, 0 if equal, -1 if inter1 < inter2, 
+                	1 if inter1 > inter2
+
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_ERROR if 
+	the two input datetimes are not mutually comparable.
+
+---------------------- OCIIntervalDivide ------------------------------------ 
+sword OCIIntervalDivide(dvoid *hndl, OCIError *err, OCIInterval *dividend, 
+		OCINumber *divisor, OCIInterval *result );
+ 
+  DESCRIPTION
+     Divides an interval by an Oracle Number to produce an interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+     dividend  (IN)   - Interval to be divided 
+     divisor   (IN)   - Oracle Number dividing `dividend' 
+     result    (OUT)  - resulting interval (dividend / divisor) 
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+
+ ---------------------- OCIIntervalFromNumber -------------------- 
+sword OCIIntervalFromNumber(dvoid *hndl, OCIError *err, 
+               OCIInterval *inter, OCINumber *number);
+  DESCRIPTION
+    Converts an interval to an Oracle Number
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (OUT)  interval - Interval to be converted 
+    (IN) number - Oracle number result  (in years for YEARMONTH interval
+                     and in days for DAYSECOND)
+  RETURNS
+    OCI_SUCCESS on success 
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_ERROR on error.
+  NOTES
+    Fractional portions of the date (for instance, minutes and seconds if
+    the unit chosen is hours) will be included in the Oracle number produced.
+    Excess precision will be truncated.
+ 
+ ---------------------- OCIIntervalFromText --------------------------------- 
+sword OCIIntervalFromText( dvoid *hndl, OCIError *err, CONST OraText *inpstr, 
+		size_t str_len, OCIInterval *result );
+
+  DESCRIPTION
+    Given an interval string produce the interval represented by the string.
+    The type of the interval is the type of the 'result' descriptor.
+  PARAMETERS
+
+     hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  inpstr - Input string 
+    (IN)  str_len - Length of input string 
+    (OUT) result - Resultant interval 
+  RETURNS
+    OCI_SUCCESS on success
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_ERROR if
+     	there are too many fields in the literal string
+	the year is out of range (-4713 to 9999)
+  	if the month is out of range (1 to 12)
+ 	if the day of month is out of range (1 to 28...31)
+    	if hour is not in range (0 to 23)
+     	if hour is not in range (0 to 11)
+  	if minute is not in range (0 to 59)
+    	if seconds in minute not in range (0 to 59)
+   	if seconds in day not in range (0 to 86399)
+  	if the interval is invalid
+
+
+ ---------------------- OCIIntervalGetDaySecond -------------------- 
+
+  DESCRIPTION
+     Gets values of day second interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+        day     (OUT) - number of days
+        hour    (OUT) - number of hours
+        min     (OUT) - number of mins
+        sec     (OUT) - number of secs
+        fsec    (OUT) - number of fractional seconds
+	result     (IN)  - resulting interval 
+  RETURNS
+	OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+ ---------------------- OCIIntervalGetYearMonth -------------------- 
+
+  DESCRIPTION
+     Gets year month from an interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+	year    (OUT)   - year value
+	month   (OUT)   - month value
+	result     (IN)  - resulting interval 
+  RETURNS
+	OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+
+-------------------------- OCIIntervalAdd ------------------------------
+sword OCIIntervalAdd(dvoid *hndl, OCIError *err, OCIInterval *addend1, 
+			OCIInterval *addend2, OCIInterval *result );
+NAME OCIIntervalAdd - Adds two intervals 
+PARAMETERS
+hndl (IN) - Session/Env handle. 
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+addend1  (IN)   - Interval to be added 
+addend2  (IN)   - Interval to be added 
+result   (OUT)  - resulting interval (addend1 + addend2) 
+DESCRIPTION
+     Adds two intervals to produce a resulting interval
+RETURNS
+     OCI_SUCCESS on success
+     OCI_ERROR if:
+	the two input intervals are not mutually comparable.
+	the resulting year would go above SB4MAXVAL
+	the resulting year would go below SB4MINVAL
+     OCI_INVALID_HANDLE if 'err' is NULL.
+NOTES
+     The two input intervals must be mutually comparable
+
+ ---------------------- OCIIntervalSubtract ------------------------------- 
+sword OCIIntervalSubtract(dvoid *hndl, OCIError *err, OCIInterval *minuend, 
+			    OCIInterval *subtrahend, OCIInterval *result );
+NAME - OCIIntervalSubtract - subtracts two intervals
+PARAMETERS
+hndl (IN) - Session/Env handle.
+err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+minuend    (IN)   - interval to be subtracted from 
+subtrahend (IN)   - interval subtracted from minuend 
+result     (OUT)  - resulting interval (minuend - subtrahend) 
+DESCRIPTION
+     Subtracts two intervals and stores the result in an interval
+RETURNS
+	OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+	OCI_ERROR if:
+	   the two input intervals are not mutually comparable.
+	   the resulting leading field would go below SB4MINVAL	
+	   the resulting leading field would go above SB4MAXVAL
+
+---------------------- OCIIntervalMultiply --------------------------------- 
+sword OCIIntervalMultiply(dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+			OCINumber *nfactor, OCIInterval *result );
+
+  DESCRIPTION
+     Multiplies an interval by an Oracle Number to produce an interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle. 
+     err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+     inter  (IN)   - Interval to be multiplied 
+     nfactor  (IN)   - Oracle Number to be multiplied 
+     result   (OUT)  - resulting interval (ifactor * nfactor) 
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_ERROR if:
+	the resulting year would go above SB4MAXVAL
+	the resulting year would go below SB4MINVAL
+
+
+ ---------------------- OCIIntervalSetDaySecond -------------------- 
+
+  DESCRIPTION
+     Sets day second interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+        day     (IN) - number of days
+        hour    (IN) - number of hours
+        min     (IN) - number of mins
+        sec     (IN) - number of secs
+        fsec    (IN) - number of fractional seconds
+	result     (OUT)  - resulting interval 
+  RETURNS
+	OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+ ---------------------- OCIIntervalSetYearMonth -------------------- 
+
+  DESCRIPTION
+     Sets year month interval
+  PARAMETERS
+	hndl (IN) - Session/Env handle.
+        err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().     
+	year    (IN)   - year value
+	month   (IN)   - month value
+	result     (OUT)  - resulting interval 
+  RETURNS
+	OCI_SUCCESS on success
+        OCI_INVALID_HANDLE if 'err' is NULL.
+
+
+----------------------- OCIIntervalToNumber ---------------------------------
+sword OCIIntervalToNumber(dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+			  OCINumber *number);
+
+  DESCRIPTION
+    Converts an interval to an Oracle Number
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  inter - Interval to be converted 
+    (OUT) number - Oracle number result  (in years for YEARMONTH interval
+                     and in days for DAYSECOND)
+  RETURNS
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_SUCCESS on success 
+  NOTES
+    Fractional portions of the date (for instance, minutes and seconds if
+    the unit chosen is hours) will be included in the Oracle number produced.
+    Excess precision will be truncated.
+ 
+------------------------------- OCIIntervalToText -------------------------
+sword OCIIntervalToText( dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+			ub1 lfprec, ub1 fsprec, OraText *buffer, 
+                        size_t buflen, size_t *resultlen );
+
+  DESCRIPTION
+    Given an interval, produces a string representing the interval.
+  PARAMETERS
+     hndl (IN) - Session/Env handle. 
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    (IN)  inter - Interval to be converted 
+    (IN)  lfprec  - Leading field precision. Number of digits used to
+                represent the leading field.
+    (IN)  fsprec  - Fractional second precision of the interval. Number of
+                digits used to represent the fractional seconds.
+    (OUT) buffer - buffer to hold result 
+    (IN)  buflen - length of above buffer 
+    (OUT) resultlen - length of result placed into buffer 
+ 
+  RETURNS
+    OCI_SUCCESS on success
+    OCI_INVALID_HANDLE if 'err' is NULL.
+    OCI_ERROR 
+    	if the buffer is not large enough to hold the result
+  NOTES
+    The interval literal will be output as `year' or `[year-]month' for
+    YEAR-MONTH intervals and as `seconds' or `minutes[:seconds]' or
+    `hours[:minutes[:seconds]]' or `days[ hours[:minutes[:seconds]]]' for
+    DAY-TIME intervals (where optional fields are surrounded by brackets).
+
+ ---------------------- OCIIntervalFromTZ -------------------- 
+sword OCIIntervalFromTZ(dvoid *hndl, OCIError *err, CONST oratext *inpstring,
+                        size_t str_len, OCIInterval *result);
+
+  DESCRIPTION
+    Retuns an OCI_DTYPE_INTERVAL_DS OCIInterval with the region id (if
+    the region is specified in the input string) set and the current
+    absolute offset or an absolut offset with the region id set to 0.
+  PARAMETERS
+    hndl (IN) - Session/Env handle.
+    err (IN/OUT) - error handle. If there is an error, it is
+                recorded in 'err' and this function returns OCI_ERROR.
+                The error recorded in 'err' can be retrieved by calling
+                OCIErrorGet().
+    inpstring (IN) - pointer to the input string
+    str_len (IN) - inpstring length
+    result - Output Interval 
+  RETURNS
+     OCI_SUCCESS on success
+     OCI_INVALID_HANDLE if 'err' is NULL.
+     OCI_ERROR on error
+        Bad interval type
+        Timezone errors
+  NOTES
+     The input string must be of the form [+/-]TZH:TZM or 'TZR [TZD]'
+
+OCILdaToSvcCtx()
+Name
+OCI toggle version 7 Lda_Def to SerVice context handle
+Purpose
+Converts a V7 Lda_Def to a V8 service context handle.
+Syntax
+sword OCILdaToSvcCtx ( OCISvcCtx  **svchpp,
+                     OCIError   *errhp,
+                     Lda_Def    *ldap );
+Comments
+Converts a V7 Lda_Def to a V8 service context handle. The action of this call 
+can be reversed by passing the resulting service context handle to the 
+OCISvcCtxToLda() function.
+Parameters
+svchpp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+ldap (IN/OUT) - the V7 logon data area returned by OCISvcCtxToLda() from 
+this service context.
+Related Functions
+OCISvcCtxToLda()
+
+
+
+
+OCILobAppend()
+
+Name
+OCI Lob APpend
+
+Purpose
+Appends a LOB value at the end of another LOB. 
+
+Syntax
+sword OCILobAppend ( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *dst_locp,
+                   OCILobLocator    *src_locp );
+Comments
+Appends a LOB value at the end of LOB. The data is 
+copied from the source to the destination at the end of the destination. The 
+source and the destination must already exist. The destination LOB is 
+extended to accommodate the newly written data.
+
+It is an error to extend the destination LOB beyond the maximum length 
+allowed or to try to copy from a NULL LOB. 
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB. 
+src_locp (IN/OUT) - a locator uniquely referencing the source LOB. 
+
+Related Functions
+OCILobTrim()
+OCIErrorGet()
+OCILobWrite()
+OCILobCopy()
+
+
+
+OCILobAssign()
+
+Name
+OCI Lob ASsiGn
+
+Purpose
+Assigns one LOB/FILE locator to another.
+
+Syntax
+sword OCILobAssign ( OCIEnv                *envhp, 
+                     OCIError              *errhp, 
+                     CONST OCILobLocator   *src_locp, 
+                     OCILobLocator         **dst_locpp );
+
+Comments
+Assign source locator to destination locator.  After the assignment, both 
+locators refer to the same LOB data.  For internal LOBs, the source locator's 
+LOB data gets copied to the destination locator's LOB data only when the 
+destination locator gets stored in the table.  Therefore, issuing a flush of 
+the object containing the destination locator will copy the LOB data. For 
+FILEs only the locator that refers to the OS file is copied to the table. The
+OS file is not copied.
+Note: The only difference between this and OCILobLocatorAssign is that this
+takes an environment handle whereas OCILobLocatorAssign takes an OCI service
+handle
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 
+in errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+src_locp (IN) - LOB locator to copy from.
+dst_locpp (IN/OUT) - LOB locator to copy to.  The caller must allocate space 
+for the OCILobLocator by calling OCIDescriptorAlloc().
+
+See also
+OCIErrorGet()
+OCILobIsEqual()
+OCILobLocatorIsInit()
+OCILobLocatorAssign()
+
+
+OCILobCharSetForm()
+
+Name
+OCI Lob Get Character Set Form
+
+Purpose
+Gets the LOB locator's character set fpr,, if any.
+
+Syntax
+sword OCILobCharSetForm ( OCIEnv                    *envhp, 
+                          OCIError                  *errhp, 
+                          CONST OCILobLocator       *locp, 
+                          ub1                       *csfrm );
+
+Comments
+Returns the character set form of the input LOB locator in the csfrm output 
+parameter. 
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+locp (IN) - LOB locator for which to get the character set form.
+csfrm(OUT) - character set form of the input LOB locator.  If the input 
+locator is for a BLOB or a BFILE, csfrm is set to 0 since there is no concept 
+of a character set for binary LOBs/FILEs.  The caller must allocate space for 
+the csfrm (ub1) and not write into the space.
+See also
+OCIErrorGet(), OCILobCharSetId(), OCILobLocatorIsInit
+
+
+
+OCILobCharSetId()
+
+Name
+OCI Lob get Character Set IDentifier
+
+Purpose
+Gets the LOB locator's character set ID, if any.
+
+Syntax
+sword OCILobCharSetId ( OCIEnv                    *envhp, 
+                        OCIError                  *errhp, 
+                        CONST OCILobLocator       *locp, 
+                        ub2                       *csid );
+
+Comments
+Returns the character set ID of the input LOB locator in the cid output 
+parameter. 
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+locp (IN) - LOB locator for which to get the character set ID.
+csid (OUT) - character set ID of the input LOB locator.  If the input locator 
+is for a BLOB or a BFILE, csid is set to 0 since there is no concept of a 
+character set for binary LOBs/FILEs.  The caller must allocate space for the 
+character set id of type ub2 and not write into the space.
+
+See also
+OCIErrorGet(), OCILobCharSetForm(), OCILobLocatorIsInit()
+
+
+
+OCILobCopy()
+
+Name
+OCI Lob Copy
+
+Purpose
+Copies a portion of a LOB value into another LOB value.
+
+Syntax
+sword OCILobCopy ( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *dst_locp,
+                   OCILobLocator    *src_locp,
+                   ub4              amount,
+                   ub4              dst_offset,
+                   ub4              src_offset );
+
+Comments
+Copies a portion of a LOB value into another LOB as specified. The data 
+is copied from the source to the destination. The source (src_locp) and the 
+destination (dlopb) LOBs must already exist.
+If the data already exists at the destination's start position, it is 
+overwritten with the source data. If the destination's start position is 
+beyond the end of the current data, a hole is created from the end of the data
+to the beginning of the newly written data from the source. The destination 
+LOB is extended to accommodate the newly written data if it extends 
+beyond the current length of the destination LOB. 
+It is an error to extend the destination LOB beyond the maximum length 
+allowed or to try to copy from a NULL LOB.
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB. 
+src_locp (IN/OUT) - a locator uniquely referencing the source LOB. 
+amount (IN) - the number of character or bytes, as appropriate, to be copied.
+dst_offset (IN) - this is the absolute offset for the destination LOB. 
+For character LOBs it is the number of characters from the beginning of the 
+LOB at which to begin writing. For binary LOBs it is the number of bytes from 
+the beginning of the lob from which to begin reading. The offset starts at 1.
+src_offset (IN) - this is the absolute offset for the source LOB. 
+For character LOBs it is the number of characters from the beginning of the 
+LOB, for binary LOBs it is the number of bytes. Starts at 1.
+
+See Also 
+OCIErrorGet(), OCILobAppend(), OCILobWrite(), OCILobTrim()
+
+OCILobCreateTemporary()
+
+Name
+OCI Lob Create Temporary
+
+Purpose
+Create a Temporary Lob
+
+Syntax
+sword OCILobCreateTemporary(OCISvcCtx          *svchp,
+                            OCIError           *errhp,
+                            OCILobLocator      *locp,
+                            ub2                 csid,
+                            ub1                 csfrm,
+                            ub1                 lobtype,
+                            boolean             cache,
+                            OCIDuration         duration);
+
+
+Comments
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator which points to the temporary Lob
+csid (IN) - the character set id
+csfrm(IN) - the character set form
+lobtype (IN) - the lob type - one of the three constants OCI_TEMP_BLOB, 
+               OCI_TEMP_CLOB and OCI_TEMP_NCLOB
+cache(IN)-  TRUE if the temporary LOB goes through the cache; FALSE, if not.
+duration(IN)- duration of the temporary LOB; Can be a valid duration id or one 
+              of the values: OCI_DURATION_SESSION, OCI_DURATION_CALL
+              Note: OCI_DURATION_TRANSACTION is NOT supported in 8.1
+Related functions
+OCILobFreeTemporary()
+OCILobIsTemporary()
+
+OCILobDisableBuffering()
+
+Name
+OCI Lob Disable Buffering
+
+Purpose
+Disable lob buffering for the input locator.
+
+
+Syntax
+sword OCILobDisableBuffering ( OCISvcCtx      *svchp,
+                               OCIError       *errhp,
+                               OCILobLocator  *locp);
+
+Comments
+
+Disable lob buffering for the input locator.  The next time data is
+read/written from/to the lob through the input locator, the lob
+buffering subsystem is *not* used.  Note that this call does *not*
+implicitly flush the changes made in the buffering subsystem.  The 
+user must explicitly call OCILobFlushBuffer() to do this.
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB. 
+
+Related Functions
+OCILobEnableBuffering()
+OCIErrorGet()
+OCILobFlushBuffer()
+
+
+
+
+OCILobEnableBuffering()
+
+Name
+OCI Lob Enable Buffering
+
+Purpose
+Enable lob buffering for the input locator.
+
+
+Syntax
+sword OCILobEnableBuffering ( OCISvcCtx      *svchp,
+                              OCIError       *errhp,
+                              OCILobLocator  *locp);
+
+Comments
+
+Enable lob buffering for the input locator.  The next time data is
+read/written from/to the lob through the input locator, the lob
+buffering subsystem is used.  
+
+Once lob buffering is enabled for a locator, if that locator is passed to 
+one of the following routines, an error is returned:
+        OCILobCopy, OCILobAppend, OCILobErase, OCILobGetLength, OCILobTrim
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB. 
+
+Related Functions
+OCILobDisableBuffering()
+OCIErrorGet()
+OCILobWrite()
+OCILobRead()
+OCILobFlushBuffer()
+
+
+
+
+OCILobErase()
+
+Name
+OCI Lob ERase
+
+Purpose
+Erases a specified portion of the LOB data starting at a specified offset.
+
+Syntax
+sword OCILobErase ( OCISvcCtx       *svchp,
+                  OCIError        *errhp,
+                  OCILobLocator   *locp,
+                  ub4             *amount,
+                  ub4             offset );
+
+Comments
+Erases a specified portion of the LOB data starting at a specified offset.
+The actual number of characters/bytes erased is returned. The actual number 
+of characters/bytes and the requested number of characters/bytes will differ 
+if the end of the LOB data is reached before erasing the requested number of 
+characters/bytes.
+If a section of data from the middle of the LOB data is erased, a hole is 
+created. When data from that hole is read, 0's are returned. If the LOB is
+NULL, this routine will indicate that 0 characters/bytes were erased.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - the LOB for which to erase a section of data.
+amount (IN/OUT) - On IN, the number of characters/bytes to erase. On OUT, 
+the actual number of characters/bytes erased.
+offset (IN) - absolute offset from the beginning of the LOB data from which 
+to start erasing data. Starts at 1.
+
+See Also
+OCIErrorGet(), OCILobRead(), OCILobWrite()
+
+OCILobOpen()
+
+Name
+OCI Lob Open
+
+Purpose
+Opens an internal or external Lob.
+
+Syntax
+sword OCILobOpen( OCISvcCtx        *svchp,
+                  OCIError         *errhp,
+                  OCILobLocator    *locp,
+                  ub1               mode );
+
+Comments
+It is an error if the same lob is opened more than once in
+the same transaction. Lobs are opened implicitly if they are
+not opened before using them. A LOB has to be closed before
+the transaction commits else the transaction is rolled back.
+Open locators are closed if the transaction aborts. Multiple 
+users can open the same lob on different locators.
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - locator points to the LOB to be opened
+mode (IN) - mode in which to open the lob. The valid modes are
+read-only - OCI_FILE_READONLY, read-write - OCI_FILE_READWRITE 
+
+OCILobClose()
+
+Name
+OCI Lob Close
+
+Purpose
+Closes an open internal or external Lob.
+
+Syntax
+sword OCILobClose( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *locp );
+
+
+Comments
+It is an error if the lob is not open at this time. All LOBs
+that have been opened in a transaction have to be closed 
+before the transaction commits, else the transaction gets
+rolled back.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp  (IN)  - A locator that was opened using OCILobOpen()
+
+
+OCILobFileClose()
+
+Name
+OCI Lob File CLoSe
+
+Purpose
+Closes a previously opened FILE.
+
+Syntax
+sword OCILobFileClose ( OCISvcCtx            *svchp,
+                        OCIError             *errhp,
+                        OCILobLocator        *filep );
+
+Comments
+Closes a previously opened FILE. It is an error if this function is called for
+an internal LOB. No error is returned if the FILE exists but is not opened.
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+filep (IN/OUT) - a pointer to a FILE locator to be closed.
+
+See Also
+OCIErrorGet(), OCILobFileOpen(), OCILobFileCloseAll(), OCILobFileIsOpen(),
+OCILobFileExists(), CREATE DIRECTORY DDL
+
+
+
+
+OCILobFileCloseAll()
+
+Name
+OCI LOB FILE Close All
+
+Purpose
+Closes all open FILEs on a given service context.
+
+Syntax
+sword OCILobFileCLoseAll ( OCISvcCtx *svchp, 
+                           OCIError  *errhp );
+
+Comments
+Closes all open FILEs on a given service context.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+
+See also
+OCILobFileClose(),
+OCIErrorGet(), OCILobFileOpen(), OCILobFileIsOpen(),
+OCILobFileExists(), CREATE DIRECTORY DDL
+
+
+
+
+OCILobFileExists()
+
+Name
+OCI LOB FILE exists
+
+Purpose
+Tests to see if the FILE exists on the server
+
+Syntax
+sword OCILobFileExists ( OCISvcCtx     *svchp,
+                         OCIError      *errhp,
+                         OCILobLocator *filep,
+                         boolean       *flag );
+
+Comments
+Checks to see if a FILE exists for on the server.
+
+Parameters
+svchp (IN) - the OCI service context handle.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, 
+it is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+filep (IN) - pointer to the FILE locator that refers to the file.
+flag (OUT) - returns TRUE if the FILE exists; FALSE if it does not.
+
+See also
+OCIErrorGet, CREATE DIRECTORY (DDL)
+
+
+
+
+OCILobFileGetName()
+
+Name
+OCI LOB FILE Get file Name
+
+Purpose
+Gets the FILE locator's directory alias and file name.
+
+Syntax
+sword OCILobFileGetName ( OCIEnv                   *envhp,
+                          OCIError                 *errhp, 
+                          CONST OCILobLocator      *filep, 
+                          OraText                     *dir_alias,
+                          ub2                      *d_length, 
+                          OraText                     *filename, 
+                          ub2                      *f_length );
+
+Comments
+Returns the directory alias and file name associated with this file locator.  
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) -The OCI error handle. If there is an error, it is recorded in 
+errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+filep (IN) - FILE locator for which to get the directory alias and file name.
+dir_alias (OUT) - buffer into which the directory alias name is placed. The 
+caller must allocate enough space for the directory alias name and must not 
+write into the space.
+d_length (IN/OUT)                 
+        - IN: length of the input dir_alias string;
+        - OUT: length of the returned dir_alias string.
+filename (OUT) - buffer into which the file name is placed. The caller must 
+allocate enough space for the file name and must not write into the space.
+f_length (IN/OUT) 
+        - IN: length of the input filename string;
+         - OUT: lenght of the returned filename string.
+
+See also
+OCILobFileSetName(), OCIErrorGet()
+
+
+
+
+OCILobFileIsOpen()
+
+Name
+OCI LOB FILE Is Open?
+
+Purpose
+Tests to see if the FILE is open
+
+Syntax
+sword OCILobFileIsOpen ( OCISvcCtx *svchp,
+                         OCIError  *errhp,
+                         OCILobLocator *filep,
+                         boolean       *flag );
+
+Comments
+Checks to see if the FILE on the server is open for a given LobLocator.
+
+Parameters
+svchp (IN) - the OCI service context handle.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+filep (IN) - pointer to the FILE locator being examined. If the input file 
+locator was never passed to OCILobFileOpen(), the file is considered not to 
+be opened by this locator. However, a different locator may have opened the 
+file. More than one file opens can be performed on the same file using 
+different locators.
+flag (OUT) - returns TRUE if the FILE is opened using this locator; FALSE if 
+it is not. 
+
+See also
+OCIErrorGet, OCILobFileOpen, OCILobFileClose, OCILobFileCloseAll, CREATE 
+DIRECTORY SQL command
+
+
+OCILobFileOpen()
+
+Name
+OCI LOB FILE open
+
+Purpose
+Opens a FILE for read-only access
+
+Syntax
+sword OCILobFileOpen ( OCISvcCtx            *svchp,
+                     OCIError             *errhp,
+                     OCILobLocator        *filep,
+                     ub1                  mode );
+
+Comments
+Opens a FILE. The FILE can be opened for read-only access only. FILEs may not 
+be written to throough ORACLE.
+
+Parameters 
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+filep (IN/OUT) - the FILE to open. Error if the locator does not refer to a 
+FILE. 
+mode (IN) - mode in which to open the file. The only valid mode is 
+read-only - OCI_FILE_READONLY. 
+
+See Also
+OCILobFileClose, OCIErrorGet, OCILobFileCloseAll, OCILobFileIsOpen, 
+OCILobFileSetName, CREATE DIRECTORY 
+
+
+
+
+OCILobFileSetName()
+
+Name
+OCI Lob File Set NaMe
+
+Purpose
+Sets directory alias and file name in the FILE locator.
+
+Syntax
+sword OCILobFileSetName ( OCIEnv             *envhp,
+                          OCIError           *errhp,
+                          OCILobLocator      **filepp,
+                          OraText               *dir_alias,
+                          ub2                d_length, 
+                          OraText               *filename, 
+                          ub2                f_length );
+Comments
+Sets the directory alias and file name in the LOB file locator.  
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 
+in errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+filepp (IN/OUT) - FILE locator for which to set the directory alias name.
+The caller must have already allocated space for the locator by calling
+OCIDescriptorAlloc().
+dir_alias (IN) - buffer that contains the directory alias name to set in the 
+locator.
+d_length (IN) - length of the input dir_alias parameter.
+filename (IN) - buffer that contains the file name is placed.
+f_length (IN) - length of the input filename parameter.
+See also
+OCILobFileGetName, OCIErrorGet, CREATE DIRECTORY
+
+
+
+
+OCILobFlushBuffer()
+
+Name
+OCI Lob Flush all Buffers for this lob.
+
+Purpose
+Flush/write all buffers for this lob to the server.
+
+
+Syntax
+sword OCILobFlushBuffer ( OCISvcCtx       *svchp,
+                          OCIError        *errhp,
+                          OCILobLocator   *locp,
+                          ub4              flag);
+
+Comments
+
+Flushes to the server, changes made to the buffering subsystem that 
+are associated with the lob referenced by the input locator.  This 
+routine will actually write the data in the buffer to the lob in 
+the database.  Lob buffering must have already been enabled for the 
+input lob locator.
+
+This routine, by default, does not free the buffer resources for
+reallocation to another buffered LOB operation. However, if you
+want to free the buffer explicitly, you can set the flag parameter
+to OCI_LOB_BUFFER_FREE.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB. 
+flag    (IN)     - to indicate if the buffer resources need to be freed
+                   after a flush. Default value is OCI_LOB_BUFFER_NOFREE.
+                   Set it to OCI_LOB_BUFFER_FREE if you want the buffer
+                   resources to be freed.
+Related Functions
+OCILobEnableBuffering()
+OCILobDisableBuffering()
+OCIErrorGet()
+OCILobWrite()
+OCILobRead()
+
+
+OCILobFreeTemporary()
+
+Name
+OCI Lob Free Temporary
+
+Purpose
+Free a temporary LOB
+
+Syntax
+sword OCILobFreeTemporary(OCISvcCtx          *svchp,
+                          OCIError           *errhp,
+                          OCILobLocator      *locp);
+
+Comments
+  Frees the contents of the temporary Lob this locator is pointing to. Note
+  that the locator itself is not freed until a OCIDescriptorFree is done.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a locator uniquely referencing the LOB
+
+Related functions
+OCILobCreateTemporary()
+OCILobIsTemporary()
+
+
+Name
+OCI Lob/File Get Chunk Size
+
+Purpose
+When creating the table, the user can specify the chunking factor, which can
+be a multiple of Oracle blocks. This corresponds to the chunk size used by the
+LOB data layer when accessing/modifying the LOB value. Part of the chunk is
+used to store system-related information and the rest stores the LOB value.
+This function returns the amount of space used in the LOB chunk to store 
+the LOB value.
+
+Syntax
+sword OCILobGetChunkSize ( OCISvcCtx      *svchp,
+                           OCIError       *errhp,
+                           OCILobLocator  *locp,
+                           ub4            *chunksizep );
+
+Comments
+ Performance will be improved if the user issues read/write
+requests using a multiple of this chunk size. For writes, there is an added 
+benefit since LOB chunks are versioned and, if all writes are done on chunk
+basis, no extra/excess versioning is done nor duplicated. Users could batch 
+up the write until they have enough for a chunk instead of issuing several
+write calls for the same chunk.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - a LOB locator that uniquely references the LOB. For internal
+LOBs, this locator must be a locator that was obtained from the server 
+specified by svchp. For FILEs, this locator can be initialized by a Select or
+OCILobFileSetName.
+chunksizep (OUT) - On output, it is the length of the LOB if not NULL - for 
+character LOBs it is the number of characters, for binary LOBs it is the 
+number of bytes in the LOB.
+
+Related Functions
+
+OCILobGetLength()
+
+Name
+OCI Lob/File Length
+
+Purpose
+Gets the length of a LOB/FILE. 
+
+Syntax
+sword OCILobGetLength ( OCISvcCtx      *svchp,
+                        OCIError       *errhp,
+                        OCILobLocator  *locp,
+                        ub4            *lenp );
+
+Comments
+Gets the length of a LOB/FILE. If the LOB/FILE is NULL, the length is 
+undefined.
+
+Parameters
+svchp (IN) - the service context handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - a LOB locator that uniquely references the LOB. For internal
+LOBs, this locator must be a locator that was obtained from the server 
+specified by svchp. For FILEs, this locator can be initialized by a Select or
+OCILobFileSetName.
+lenp (OUT) - On output, it is the length of the LOB if not NULL - for 
+character LOBs it is the number of characters, for binary LOBs it is the 
+number of bytes in the LOB.
+
+Related Functions
+OCIErrorGet, OCIFileSetName
+
+
+
+OCILobIsEqual()
+
+Name
+
+OCI Lob Is Equal
+
+Purpose
+Compares two LOB locators for equality.
+
+Syntax
+sword OCILobIsEqual ( OCIEnv                  *envhp,
+                      CONST OCILobLocator     *x,
+                      CONST OCILobLocator     *y,
+                      boolean                 *is_equal );
+
+Comments
+Compares the given LOB locators for equality.  Two LOB locators are equal if 
+and only if they both refer to the same LOB data.
+Two NULL locators are considered not equal by this function.
+Parameters
+envhp (IN) - the OCI environment handle.
+x (IN) - LOB locator to compare.
+y (IN) - LOB locator to compare.
+is_equal (OUT) - TRUE, if the LOB locators are equal; FALSE if they are not.
+
+See also
+OCILobAssign, OCILobLocatorIsInit
+OCILobLocatorAssign,
+OCILobIsOpen()
+
+Name
+
+OCI Lob Is Open
+sword OCILobIsOpen(svchp, errhp, locp, flag)
+OCISvcCtx     *svchp;
+OCIError      *errhp;
+OCILobLocator *locp;
+boolean       *flag;
+
+Comments
+   Checks if the LOB locator was opened before. flag is set to TRUE
+   if opened; FALSE otherwise 
+
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN) - the locator to test for temporary LOB
+flag(OUT) - TRUE, if the LOB locator points to is open
+                    FALSE, if not.
+
+OCILobIsTemporary()
+
+Name
+
+OCI Lob Is Temporary
+
+Purpose
+  Tests if this locator points to a temporary LOB
+
+Syntax
+sword OCILobIsTemporary(OCIEnv            *envhp,
+                        OCIError          *errhp,
+                        OCILobLocator     *locp,
+                        boolean           *is_temporary);
+
+Comments
+Tests the locator to determine if it points to a temporary LOB.
+If so, is_temporary is set to TRUE. If not, is_temporary is set
+to FALSE.
+
+Parameters
+envhp (IN) - the environment handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN) - the locator to test for temporary LOB
+is_temporary(OUT) - TRUE, if the LOB locator points to a temporary LOB;
+                    FALSE, if not.
+
+See Also
+OCILobCreateTemporary, OCILobFreeTemporary
+
+
+OCILobLoadFromFile()
+
+Name
+OCI Lob Load From File
+
+Purpose
+Load/copy all or a portion of the file into an internal LOB.
+
+Syntax
+sword OCILobLoadFromFile ( OCISvcCtx        *svchp,
+                           OCIError         *errhp,
+                           OCILobLocator    *dst_locp,
+                           OCILobLocator    *src_filep,
+                           ub4              amount,
+                           ub4              dst_offset,
+                           ub4              src_offset );
+
+Comments
+Loads/copies a portion or all of a file value into an internal LOB as 
+specified.  The data is copied from the source file to the destination 
+internal LOB (BLOB/CLOB).  No character set conversions are performed 
+when copying the bfile data to a clob/nclob.  The bfile data must already
+be in the same character set as the clob/nclob in the database.  No
+error checking is performed to verify this.
+The source (src_filep) and the destination (dst_locp) LOBs must already exist.
+If the data already exists at the destination's start position, it is 
+overwritten with the source data. If the destination's start position is 
+beyond the end of the current data, a hole is created from the end of the data
+to the beginning of the newly written data from the source. The destination 
+LOB is extended to accommodate the newly written data if it extends 
+beyond the current length of the destination LOB. 
+It is an error to extend the destination LOB beyond the maximum length 
+allowed or to try to copy from a NULL LOB.
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+dst_locp (IN/OUT) - a locator uniquely referencing the destination internal 
+LOB which may be of type blob, clob, or nclob. 
+src_filep (IN/OUT) - a locator uniquely referencing the source BFILE. 
+amount (IN) - the number of bytes to be copied.
+dst_offset (IN) - this is the absolute offset for the destination LOB. 
+For character LOBs it is the number of characters from the beginning of the 
+LOB at which to begin writing. For binary LOBs it is the number of bytes from 
+the beginning of the lob from which to begin reading. The offset starts at 1.
+src_offset (IN) - this is the absolute offset for the source BFILE.  It is 
+the number of bytes from the beginning of the LOB.  The offset starts at 1.
+
+See Also 
+OCIErrorGet(), OCILobAppend(), OCILobWrite(), OCILobTrim(), OCILobCopy()
+
+OCILobLocatorAssign()
+
+Name
+OCI Lob LOCATOR ASsiGn
+
+Purpose
+Assigns one LOB/FILE locator to another.
+
+Syntax
+sword OCILobLocatorAssign ( OCISvcCtx             *svchp, 
+                            OCIError              *errhp, 
+                            CONST OCILobLocator   *src_locp, 
+                            OCILobLocator         **dst_locpp );
+
+Comments
+Assign source locator to destination locator.  After the assignment, both 
+locators refer to the same LOB data.  For internal LOBs, the source locator's 
+LOB data gets copied to the destination locator's LOB data only when the 
+destination locator gets stored in the table.  Therefore, issuing a flush of 
+the object containing the destination locator will copy the LOB data. For 
+FILEs only the locator that refers to the OS file is copied to the table. The
+OS file is not copied.
+Note : the only difference between this and OCILobAssign is that this takes
+a OCI service handle pointer instead of a OCI environment handle pointer
+
+Parameters
+svchp (IN/OUT) - OCI service handle initialized in object mode.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded 
+in errhp and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+src_locp (IN) - LOB locator to copy from.
+dst_locpp (IN/OUT) - LOB locator to copy to.  The caller must allocate space 
+for the OCILobLocator by calling OCIDescriptorAlloc().
+
+See also
+OCIErrorGet()
+OCILobIsEqual()
+OCILobLocatorIsInit()
+OCILobAssign()
+
+
+
+
+OCILobLocatorIsInit()
+
+Name
+OCI LOB locator is initialized?
+
+Purpose
+Tests to see if a given LOB locator is initialized.
+
+Syntax
+sword OCILobLocatorIsInit ( OCIEnv   *envhp,
+                            OCIError *errhp,
+                            CONST OCILobLocator *locp,
+                            boolean *is_initialized );
+
+Comments
+Tests to see if a given LOB locator is initialized.
+
+Parameters
+envhp (IN/OUT) - OCI environment handle initialized in object mode.
+errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it 
+is recorded in err and this function returns OCI_ERROR. Diagnostic 
+information can be obtained by calling OCIErrorGet().
+locp (IN) - the LOB locator being tested
+is_initialized (OUT) - returns TRUE if the given LOB locator is initialized; 
+FALSE if it is not.
+
+See also
+OCIErrorGet, OCILobIsEqual
+
+
+
+
+OCILobRead()
+
+Name
+OCI Lob/File ReaD
+
+Purpose
+Reads a portion of a LOB/FILE as specified by the call into a buffer. 
+
+Syntax
+sword OCILobRead ( OCISvcCtx       *svchp,
+                   OCIError        *errhp,
+                   OCILobLocator   *locp,
+                   ub4             offset,
+                   ub4             *amtp,
+                   dvoid           *bufp,
+                   ub4             bufl,
+                   dvoid           *ctxp,  
+                   OCICallbackLobRead (cbfp)
+                                   (
+                                    dvoid         *ctxp,
+                                    CONST dvoid   *bufp,
+                                    ub4           len,
+                                    ub1           piece )
+                   ub2             csid,
+                   ub1             csfrm );
+
+Comments
+Reads a portion of a LOB/FILE as specified by the call into a buffer. Data 
+read from a hole is returned as 0s. It is an error to try to read from a NULL
+LOB/FILE. The OS FILE must already exist on the server and must have been 
+opened using the input locator. Oracle must hav epermission to read the OS 
+file and user must have read permission on the directory object.
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+offset (IN) - On input, it is the absolute offset, for character LOBs in the 
+number of characters from the beginning of the LOB, for binary LOBs it is the 
+number of bytes. Starts from 1.
+amtp (IN/OUT) - On input, the number of character or bytes to be read. On 
+output, the actual number of bytes or characters read. 
+If the amount of bytes to be read is larger than the buffer length it is 
+assumed that the LOB is being read in a streamed mode. On input if this value 
+is 0, then the data shall be read in streamed mode from the LOB until the end 
+of LOB. If the data is read in pieces, *amtp always contains the length of 
+the last piece read.  If a callback function is defined, then this callback 
+function will be invoked each time bufl bytes are read off the pipe. Each 
+piece will be written into bufp.
+If the callback function is not defined, then OCI_NEED_DATA error code will 
+be returned. The application must invoke the LOB read over and over again to 
+read more pieces of the LOB until the OCI_NEED_DATA error code is not 
+returned. The buffer pointer and the length can be different in each call 
+if the pieces are being read into different sizes and location. 
+bufp (IN) - the pointer to a buffer into which the piece will be read. The 
+length of the allocated memory is assumed to be bufl. 
+bufl (IN) - the length of the buffer in octets. 
+ctxp (IN) - the context for the call back function. Can be NULL.
+cbfp (IN) - a callback that may be registered to be called for each piece. If 
+this is NULL, then OCI_NEED_DATA will be returned for each piece. 
+The callback function must return OCI_CONTINUE for the read to continue. 
+If any other error code is returned, the LOB read is aborted. 
+  ctxp (IN) - the context for the call back function. Can be NULL.
+  bufp (IN) - a buffer pointer for the piece.
+  len (IN) - the length of length of current piece in bufp.
+  piece (IN) - which piece - OCI_FIRST_PIECE, OCI_NEXT_PIECE or 
+  OCI_LAST_PIECE.
+csid - the character set ID of the buffer data
+csfrm - the character set form of the buffer data
+
+Related Functions
+OCIErrorGet, OCILobWrite, OCILobFileOpen, OCILobFileSetName, CREATE DIRECTORY
+
+
+
+
+OCILobTrim()
+
+Name
+
+OCI Lob  Trim
+
+Purpose
+Trims the lob value to a shorter length
+
+Syntax
+sword OCILobTrim ( OCISvcCtx       *svchp,
+                 OCIError        *errhp,
+                 OCILobLocator   *locp,
+                 ub4             newlen );
+
+Comments
+Truncates LOB data to a specified shorter length. 
+
+Parameters
+svchp (IN) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a LOB locator that uniquely references the LOB. This locator 
+must be a locator that was obtained from the server specified by svchp. 
+newlen (IN) - the new length of the LOB data, which must be less than or equal
+to the current length. 
+
+Related Functions
+OCIErrorGet, OCILobWrite, OCiLobErase, OCILobAppend, OCILobCopy
+
+
+
+
+
+OCILobWrite()
+
+Name
+OCI Lob Write
+
+Purpose
+Writes a buffer into a LOB
+
+Syntax
+sword OCILobWrite ( OCISvcCtx       *svchp,
+                    OCIError        *errhp,
+                    OCILobLocator   *locp,
+                    ub4             offset,
+                    ub4             *amtp,
+                    dvoid           *bufp, 
+                    ub4             buflen,
+                    ub1             piece,
+                    dvoid           *ctxp,  
+                    OCICallbackLobWrite   (cbfp)
+                                    (
+                                    dvoid    *ctxp,
+                                    dvoid    *bufp,
+                                    ub4      *lenp,
+                                    ub1      *piecep ) 
+                    ub2             csid
+                    ub1             csfrm );
+
+
+Comments
+Writes a buffer into a LOB as specified. If LOB data already exists 
+it is overwritten with the data stored in the buffer.
+The buffer can be written to the LOB in a single piece with this call, or
+it can be provided piecewise using callbacks or a standard polling method.
+If this value of the piece parameter is OCI_FIRST_PIECE, data must be 
+provided through callbacks or polling.
+If a callback function is defined in the cbfp parameter, then this callback 
+function will be invoked to get the next piece after a piece is written to 
+the pipe. Each piece will be written from bufp.
+If no callback function is defined, then OCILobWrite() returns the 
+OCI_NEED_DATA error code. The application must all OCILobWrite() again 
+to write more pieces of the LOB. In this mode, the buffer pointer and the 
+length can be different in each call if the pieces are of different sizes and 
+from different locations. A piece value of OCI_LAST_PIECE terminates the 
+piecewise write. 
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+offset (IN) - On input, it is the absolute offset, for character LOBs in 
+the number of characters from the beginning of the LOB, for binary LOBs it 
+is the number of bytes. Starts at 1.
+bufp (IN) - the pointer to a buffer from which the piece will be written. The 
+length of the allocated memory is assumed to be the value passed in bufl. 
+Even if the data is being written in pieces, bufp must contain the first 
+piece of the LOB when this call is invoked.
+bufl (IN) - the length of the buffer in bytes.
+Note: This parameter assumes an 8-bit byte. If your platform uses a 
+longer byte, the value of bufl must be adjusted accordingly.
+piece (IN) - which piece of the buffer is being written. The default value for
+this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a 
+single piece.
+The following other values are also possible for piecewise or callback mode: 
+OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE.
+amtp (IN/OUT) - On input, takes the number of character or bytes to be 
+written. On output, returns the actual number of bytes or characters written. 
+If the data is written in pieces, *amtp will contain the total length of the 
+pieces written at the end of the call (last piece written) and is undefined in
+between. 
+(Note it is different from the piecewise read case)
+ctxp (IN) - the context for the call back function. Can be NULL.
+cbfp (IN) - a callback that may be registered to be called for each piece in 
+a piecewise write. If this is NULL, the standard polling method will be used.
+The callback function must return OCI_CONTINUE for the write to continue. 
+If any other error code is returned, the LOB write is aborted. The 
+callback takes the following parameters:
+  ctxp (IN) - the context for the call back function. Can be NULL.
+  bufp (IN/OUT) - a buffer pointer for the piece.
+  lenp (IN/OUT) - the length of the buffer (in octets) and the length of 
+  current piece in bufp (out octets).
+  piecep (OUT) - which piece - OCI_NEXT_PIECE or OCI_LAST_PIECE.
+csid - the character set ID of the buffer data
+csfrm - the character set form of the buffer data
+Related Functions
+
+OCILobWriteAppend()
+
+Name
+OCI Lob Write Append
+
+Purpose
+Writes data to the end of a LOB value. This call provides the ability
+to get the length of the data and append it to the end of the LOB in
+a single round trip to the server.
+
+Syntax
+sword OCILobWriteAppend ( OCISvcCtx       *svchp,
+                    OCIError        *errhp,
+                    OCILobLocator   *locp,
+                    ub4             *amtp,
+                    dvoid           *bufp, 
+                    ub4             buflen,
+                    ub1             piece,
+                    dvoid           *ctxp,  
+                    OCICallbackLobWrite   (cbfp)
+                                    (
+                                    dvoid    *ctxp,
+                                    dvoid    *bufp,
+                                    ub4      *lenp,
+                                    ub1      *piecep ) 
+                    ub2             csid
+                    ub1             csfrm );
+
+
+Comments
+Writes a buffer to the end of a LOB as specified. If LOB data already exists 
+it is overwritten with the data stored in the buffer.
+The buffer can be written to the LOB in a single piece with this call, or
+it can be provided piecewise using callbacks or a standard polling method.
+If this value of the piece parameter is OCI_FIRST_PIECE, data must be 
+provided through callbacks or polling.
+If a callback function is defined in the cbfp parameter, then this callback 
+function will be invoked to get the next piece after a piece is written to the 
+pipe. Each piece will be written from bufp.
+If no callback function is defined, then OCILobWriteAppend() returns the 
+OCI_NEED_DATA error code. The application must all OCILobWriteAppend() again 
+to write more pieces of the LOB. In this mode, the buffer pointer and the 
+length can be different in each call if the pieces are of different sizes and 
+from different locations. A piece value of OCI_LAST_PIECE terminates the 
+piecewise write. 
+
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+locp (IN/OUT) - a LOB locator that uniquely references a LOB. 
+bufp (IN) - the pointer to a buffer from which the piece will be written. The 
+length of the allocated memory is assumed to be the value passed in bufl. Even 
+if the data is being written in pieces, bufp must contain the first piece of 
+the LOB when this call is invoked.
+bufl (IN) - the length of the buffer in bytes.
+Note: This parameter assumes an 8-bit byte. If your platform uses a 
+longer byte, the value of bufl must be adjusted accordingly.
+piece (IN) - which piece of the buffer is being written. The default value for
+this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a 
+single piece.
+The following other values are also possible for piecewise or callback mode: 
+OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE.
+amtp (IN/OUT) - On input, takes the number of character or bytes to be 
+written. On output, returns the actual number of bytes or characters written. 
+If the data is written in pieces, *amtp will contain the total length of the 
+pieces written at the end of the call (last piece written) and is undefined in
+between. 
+(Note it is different from the piecewise read case)
+ctxp (IN) - the context for the call back function. Can be NULL.
+cbfp (IN) - a callback that may be registered to be called for each piece in a 
+piecewise write. If this is NULL, the standard polling method will be used.
+The callback function must return OCI_CONTINUE for the write to continue. 
+If any other error code is returned, the LOB write is aborted. The 
+callback takes the following parameters:
+  ctxp (IN) - the context for the call back function. Can be NULL.
+  bufp (IN/OUT) - a buffer pointer for the piece.
+  lenp (IN/OUT) - the length of the buffer (in octets) and the length of 
+  current piece in bufp (out octets).
+  piecep (OUT) - which piece - OCI_NEXT_PIECE or OCI_LAST_PIECE.
+csid - the character set ID of the buffer data
+csfrm - the character set form of the buffer data
+Related Functions
+
+
+
+
+OCILogoff()
+Name
+OCI simplified Logoff
+Purpose
+This function is used to terminate a session created with OCILogon() or
+OCILogon2().
+Syntax
+sword OCILogoff ( OCISvcCtx      *svchp
+                   OCIError       *errhp );
+Comments
+This call is used to terminate a session which was created with OCILogon() or
+OCILogon2().  
+This call implicitly deallocates the server, authentication, and service 
+context handles.
+Note: For more information on logging on and off in an application, 
+refer to the section "Application Initialization, Connection, and 
+Authorization" on page 2-16.
+Parameters
+svchp (IN) - the service context handle which was used in the call to 
+OCILogon() or OCILogon2().
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+See Also
+OCILogon(), OCILogon2().
+
+
+
+
+
+
+OCILogon()
+Name
+OCI Service Context Logon
+Purpose
+This function is used to create a simple logon session.
+Syntax
+sword OCILogon ( OCIEnv          *envhp,
+                       OCIError        *errhp,
+                       OCISvcCtx       *svchp,
+                       CONST OraText      *username,
+                       ub4             uname_len,
+                       CONST OraText      *password,
+                       ub4             passwd_len,
+                       CONST OraText      *dbname,
+                       ub4             dbname_len );
+Comments
+This function is used to create a simple logon session for an application. 
+Note: Users requiring more complex session (e.g., TP monitor 
+applications) should refer to the section "Application Initialization, 
+Connection, and Authorization" on page 2-16.
+This call allocates the error and service context handles which are passed to 
+it. This call also implicitly allocates server and authentication handles 
+associated with the session.  These handles can be retrieved by calling 
+OCIAttrGet() on the service context handle.
+Parameters
+envhp (IN) - the OCI environment handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+svchp (OUT) - the service context pointer.
+username (IN) - the username.
+uname_len (IN) - the length of username.
+password (IN) - the user's password.
+passwd_len (IN) - the length of password.
+dbname (IN) - the name of the database to connect to.
+dbname_len (IN) - the length of dbname.
+See Also
+OCILogoff()
+
+
+
+
+
+OCILogon2()
+Name
+OCI Service Context Logon
+Purpose
+This function is used to create a logon session in connection pooling mode.
+Syntax
+sword OCILogon2 ( OCIEnv          *envhp,
+                       OCIError        *errhp,
+                       OCISvcCtx       **svchp,
+                       CONST OraText      *username,
+                       ub4             uname_len,
+                       CONST OraText      *password,
+                       ub4             passwd_len,
+                       CONST OraText      *dbname,
+                       ub4             dbname_len,
+                       ub4             mode);
+Comments
+This function is used to create a simple logon session for an application in
+Connection Pooling mode. The valid values for mode are currently OCI_POOL and
+OCI_DEFAULT. Call to this function with OCI_DEFAULT mode is equivalent to 
+OCILogon() call.
+This call allocates the error and service context handles which are passed to 
+it. This call also implicitly allocates server and authentication handles 
+associated with the session.  These handles can be retrieved by calling 
+OCIAttrGet() on the service context handle. This call assumes that 
+OCIConnectionPoolCreate() has already been called for the same dbname.
+Parameters
+envhp (IN) - the OCI environment handle.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+svchp (OUT) - the service context pointer.
+username (IN) - the username.
+uname_len (IN) - the length of username.
+password (IN) - the user's password. If this is null, it is assumed that a
+                proxy session has to be created and the required grants on 
+                the database are already done.
+passwd_len (IN) - the length of password.
+dbname (IN) - the name of the database to connect to.
+dbname_len (IN) - the length of dbname.
+mode (IN) - the mode for doing the server attach. Should be OCI_POOL for
+            using Connection Pooling.
+
+
+See Also
+OCILogoff()
+
+
+
+
+
+OCIMemoryFree()
+Name
+OCI FREE Memory
+Purpose
+Frees up storage associated with the pointer.
+Syntax
+void OCIMemoryFree ( CONST OCIStmt   *stmhp,
+                     dvoid           *memptr);
+Comments
+Frees up dynamically allocated data pointers associated with the pointer using 
+either the default memory free function or the registered memory free 
+function, as the case may be.
+A user-defined memory free function can be registered during the initial call 
+to OCIInitialize(). 
+This call is always successful. 
+Parameters
+stmhp (IN) - statement handle which returned this data buffer.
+memptr (IN) - pointer to data allocated by the client library. 
+Related Functions
+OCIInitialize()
+
+
+
+
+
+OCIParamGet()
+Name
+OCI Get PARaMeter
+Purpose
+Returns a descriptor of a parameter specified by position in the describe 
+handle or statement handle.
+Syntax
+sword OCIParamGet ( CONST dvoid       *hndlp,
+                  ub4         htype,
+                  OCIError    *errhp,
+                  dvoid    **parmdpp,
+                  ub4         pos );
+Comments
+This call returns a descriptor of a parameter specified by position in the 
+describe handle or statement handle. Parameter descriptors are always 
+allocated internally by the OCI library. They are read-only.
+OCI_NO_DATA may be returned if there are no parameter descriptors for this 
+position. 
+See Appendix B for more detailed information about parameter descriptor 
+attributes.
+Parameters
+hndlp (IN) - a statement handle or describe handle. The OCIParamGet() 
+function will return a parameter descriptor for this handle. 
+htype (IN) - the type of the handle passed in the handle parameter. Valid 
+types are OCI_HTYPE_DESCRIBE, for a describe handle OCI_HTYPE_STMT, for a 
+statement handle
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+parmdpp (OUT) - a descriptor of the parameter at the position given in the pos 
+parameter.
+pos (IN) - position number in the statement handle or describe handle. A 
+parameter descriptor will be returned for this position.
+Note: OCI_NO_DATA may be returned if there are no parameter 
+descriptors for this position. 
+Related Functions
+OCIAttrGet(), OCIAttrSet()
+
+
+
+
+
+OCIParamSet()
+Name
+OCI Parameter Set in handle
+Purpose
+Used to set a complex object retrieval descriptor into a complex object 
+retrieval handle.
+Syntax
+sword   OCIParamGet ( dvoid *hndlp,
+                       ub4 htyp,
+                      OCIError *errhp,
+                      CONST dvoid *dscp,
+                      ub4 dtyp,
+                      ub4 pos );
+Comments
+This call sets a given complex object retrieval descriptor into a complex 
+object retrieval handle.
+The handle must have been previously allocated using OCIHandleAlloc(), and 
+the descriptor must have been previously allocated using OCIDescAlloc(). 
+Attributes of the descriptor are set using OCIAttrSet().
+Parameters
+hndlp (IN/OUT) - handle pointer.
+htype (IN) - handle type.
+errhp (IN/OUT) - error handle.
+dscp (IN) - complex object retrieval descriptor pointer.
+dtyp (IN) - 
+pos (IN) - position number.
+See Also
+
+
+
+
+
+OCIPasswordChange()
+Name
+OCI Change PassWord
+Purpose
+This call allows the password of an account to be changed.
+Syntax
+sword OCIPasswordChange ( OCISvcCtx     *svchp,
+                        OCIError      *errhp,
+                        CONST OraText    *user_name,
+                        ub4           usernm_len,
+                        CONST OraText    *opasswd,
+                        ub4           opasswd_len,
+                        CONST OraText    *npasswd,
+                        sb4           npasswd_len,
+                        ub4           mode);
+Comments
+This call allows the password of an account to be changed. This call is 
+similar to OCISessionBegin() with the following differences:
+If the user authentication is already established, it authenticates 
+the account using the old password and then changes the 
+password to the new password
+If the user authentication is not established, it establishes a user 
+authentication and authenticates the account using the old 
+password, then changes the password to the new password.
+This call is useful when the password of an account is expired and 
+OCISessionBegin() returns an error or warning which indicates that the 
+password has expired. 
+Parameters
+svchp (IN/OUT) - a handle to a service context. The service context handle 
+must be initialized and have a server context handle associated with it.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+user_name (IN) - specifies the user name. It points to a character string, 
+whose length is specified in usernm_len. This parameter must be NULL if the 
+service context has been initialized with an authentication handle.
+usernm_len (IN) - the length of the user name string specified in user_name. 
+For a valid user name string, usernm_len must be non-zero.
+opasswd (IN) - specifies the user's old password. It points to a character 
+string, whose length is specified in opasswd_len .
+opasswd_len (IN) - the length of the old password string specified in opasswd. 
+For a valid password string, opasswd_len must be non-zero.
+npasswd (IN) - specifies the user's new password. It points to a character 
+string, whose length is specified in npasswd_len which must be non-zero for a 
+valid password string. If the password complexity verification routine is 
+specified in the user's profile to verify the new password's complexity, the 
+new password must meet the complexity requirements of the verification 
+function.
+npasswd_len (IN)  - then length of the new password string specified in 
+npasswd. For a valid password string, npasswd_len must be non-zero.
+mode - pass as OCI_DEFAULT.
+Related Functions
+OCISessionBegin()
+
+
+----------------------------------OCIReset------------------------------------
+
+
+OCIReset()
+Name
+OCI Reset
+Purpose
+Resets the interrupted asynchronous operation and protocol. Must be called
+if a OCIBreak call had been issued while a non-blocking operation was in
+progress.
+Syntax
+sword OCIReset ( dvoid      *hndlp,
+                 OCIError   *errhp);
+Comments
+This call is called in non-blocking mode ONLY. Resets the interrupted
+asynchronous operation and protocol. Must be called if a OCIBreak call 
+had been issued while a non-blocking operation was in progress. 
+Parameters
+hndlp (IN) - the service context handle or the server context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+Related Functions
+
+
+OCIResultSetToStmt()
+Name
+OCI convert Result Set to Statement Handle
+Purpose
+Converts a descriptor to statement handle for fetching rows.
+Syntax
+sword OCIResultSetToStmt ( OCIResult     *rsetdp,
+                         OCIError      *errhp );
+Comments
+Converts a descriptor to statement handle for fetching rows.
+A result set descriptor can be allocated with a call to OCIDescAlloc().
+Parameters
+rsetdp (IN/OUT) - a result set descriptor pointer. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+Related Functions
+OCIDescAlloc()
+
+
+
+
+OCIServerAttach()
+Name
+OCI ATtaCH to server
+Purpose
+Creates an access path to a data source for OCI operations.
+Syntax
+sword OCIServerAttach ( OCIServer    *srvhp,
+                      OCIError     *errhp,
+                      CONST OraText   *dblink,
+                      sb4          dblink_len,
+                      ub4          mode);
+Comments
+This call is used to create an association between an OCI application and a 
+particular server. 
+This call initializes a server context handle, which must have been previously 
+allocated with a call to OCIHandleAlloc().
+The server context handle initialized by this call can be associated with a 
+service context through a call to OCIAttrSet(). Once that association has been 
+made, OCI operations can be performed against the server.
+If an application is operating against multiple servers, multiple server 
+context handles can be maintained. OCI operations are performed against 
+whichever server context is currently associated with the service context.
+Parameters
+srvhp (IN/OUT) - an uninitialized server context handle, which gets 
+initialized by this call. Passing in an initialized server handle causes an 
+error. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+dblink (IN) - specifies the database (server) to use. This parameter points to
+a character string which specifies a connect string or a service point. If the 
+connect string is NULL, then this call attaches to the default host. The length
+of connstr is specified in connstr_len. The connstr pointer may be freed by the
+caller on return.
+dblink_len (IN) - the length of the string pointed to by connstr. For a valid 
+connect string name or alias, connstr_len must be non-zero.
+mode (IN) - specifies the various modes of operation.  For release 8.0, pass as
+OCI_DEFAULT - in this mode, calls made to the server on this server context 
+are made in blocking mode. 
+Example
+See the description of OCIStmtPrepare() on page 13-96 for an example showing 
+the use of OCIServerAttach().
+Related Functions
+OCIServerDetach()
+
+
+
+OCIServerDetach()
+Name
+OCI DeTaCH server
+Purpose
+Deletes an access to a data source for OCI operations.
+Syntax
+sword OCIServerDetach ( OCIServer   *svrhp,
+                      OCIError    *errhp,
+                      ub4         mode); 
+Comments
+This call deletes an access to data source for OCI operations, which was 
+established by a call to OCIServerAttach(). 
+Parameters
+srvhp (IN) - a handle to an initialized server context, which gets reset to 
+uninitialized state. The handle is not de-allocated. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+mode (IN) - specifies the various modes of operation. The only valid mode is 
+OCI_DEFAULT for the default mode. 
+Related Functions
+OCIServerAttach()
+
+
+
+OCIServerVersion()
+Name
+OCI VERSion
+Purpose
+Returns the version string of the Oracle server.
+Syntax
+sword OCIServerVersion ( dvoid        *hndlp, 
+                       OCIError     *errhp, 
+                       OraText         *bufp,
+                       ub4          bufsz
+                       ub1          hndltype );
+Comments
+This call returns the version string of the Oracle server. 
+For example, the following might be returned as the version string if your 
+application is running against a 7.3.2 server:
+Oracle7 Server Release 7.3.2.0.0 - Production Release
+PL/SQL Release 2.3.2.0.0 - Production
+CORE Version 3.5.2.0.0 - Production
+TNS for SEQUENT DYNIX/ptx: Version 2.3.2.0.0 - Production
+NLSRTL Version 3.2.2.0.0 - Production
+
+Parameters
+hndlp (IN) - the service context handle or the server context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+bufp (IN) - the buffer in which the version information is returned.
+bufsz (IN) - the length of the buffer.
+hndltype (IN) - the type of handle passed to the function.
+Related Functions
+
+
+
+
+
+OCISessionBegin()
+Name
+OCI Session Begin and authenticate user
+Purpose
+Creates a user authentication and begins a user session for a given server.
+Syntax
+sword OCISessionBegin ( OCISvcCtx     *svchp,
+                      OCIError      *errhp,
+                      OCISession    *usrhp,
+                      ub4           credt,
+                      ub4           mode);
+
+Comments
+For Oracle8, OCISessionBegin() must be called for any given server handle 
+before requests can be made against it. Also, OCISessionBegin() only supports 
+authenticating the user for access to the Oracle server specified by the 
+server handle in the service context. In other words, after OCIServerAttach() 
+is called to initialize a server handle, OCISessionBegin() must be called to 
+authenticate the user for that given server. 
+When OCISessionBegin() is called for the first time for the given server 
+handle, the initialized authentication handle is called a primary 
+authentication context. A primary authentication context may not be created 
+with the OCI_MIGRATE mode. Also, only one primary authentication context can 
+be created for a given server handle and the primary authentication context c
+an only ever be used with that server handle. If the primary authentication 
+context is set in a service handle with a different server handle, then an 
+error will result.
+After OCISessionBegin() has been called for the server handle, and the primary 
+authentication context is set in the service handle, OCISessionBegin() may be 
+called again to initialize another authentication handle with different (or 
+the same) credentials. When OCISessionBegin() is called with a service handle 
+set with a primary authentication context, the returned authentication context
+in authp is called a user authentication context. As many user authentication 
+contexts may be initialized as desired.
+User authentication contexts may be created with the OCI_MIGRATE mode. 
+If the OCI_MIGRATE mode is not specified, then the user authentication 
+context can only ever be used with the same server handle set in svchp. If 
+OCI_MIGRATE mode is specified, then the user authentication may be set 
+with different server handles. However, the user authentication context is 
+restricted to use with only server handles which resolve to the same database 
+instance and that have equivalent primary authentication contexts. Equivalent 
+authentication contexts are those which were authenticated as the same 
+database user.
+OCI_SYSDBA, OCI_SYSOPER, and OCI_PRELIM_AUTH may only be used 
+with a primary authentication context.
+To provide credentials for a call to OCISessionBegin(), one of two methods are 
+supported. The first is to provide a valid username and password pair for 
+database authentication in the user authentication handle passed to 
+OCISessionBegin(). This involves using OCIAttrSet() to set the 
+OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD attributes on the 
+authentication handle. Then OCISessionBegin() is called with 
+OCI_CRED_RDBMS.
+Note: When the authentication handle is terminated using 
+OCISessionEnd(), the username and password attributes remain 
+unchanged and thus can be re-used in a future call to OCISessionBegin(). 
+Otherwise, they must be reset to new values before the next 
+OCISessionBegin() call.
+The second type of credentials supported are external credentials. No 
+attributes need to be set on the authentication handle before calling 
+OCISessionBegin(). The credential type is OCI_CRED_EXT. This is equivalent 
+to the Oracle7 `connect /' syntax. If values have been set for 
+OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD, then these are 
+ignored if OCI_CRED_EXT is used.
+Parameters
+svchp (IN) - a handle to a service context. There must be a valid server 
+handle set in svchp.
+errhp (IN) - an error handle to the retrieve diagnostic information.
+usrhp (IN/OUT) - a handle to an authentication context, which is initialized 
+by this call.
+credt (IN) - specifies the type of credentials to use for authentication. 
+Valid values for credt are:
+OCI_CRED_RDBMS - authenticate using a database username and 
+password pair as credentials. The attributes OCI_ATTR_USERNAME 
+and OCI_ATTR_PASSWORD should be set on the authentication 
+context before this call.
+OCI_CRED_EXT - authenticate using external credentials. No username 
+or password is provided.
+mode (IN) - specifies the various modes of operation. Valid modes are:
+OCI_DEFAULT - in this mode, the authentication context returned may 
+only ever be set with the same server context specified in svchp. This 
+establishes the primary authentication context.
+OCI_MIGRATE - in this mode, the new authentication context may be 
+set in a service handle with a different server handle. This mode 
+establishes the user authentication context. 
+OCI_SYSDBA - in this mode, the user is authenticated for SYSDBA 
+access.
+OCI_SYSOPER - in this mode, the user is authenticated for SYSOPER 
+access.
+OCI_PRELIM_AUTH - this mode may only be used with OCI_SYSDBA 
+or OCI_SYSOPER to authenticate for certain administration tasks.
+Related Functions
+OCISessionEnd()
+
+
+
+
+
+
+OCISessionEnd()
+Name
+OCI Terminate user Authentication Context
+Purpose
+Terminates a user authentication context created by OCISessionBegin()
+Syntax
+sword OCISessionEnd ( OCISvcCtx       *svchp,
+                    OCIError        *errhp,
+                    OCISession      *usrhp,
+                    ub4             mode);
+
+Comments
+The user security context associated with the service context is invalidated 
+by this call. Storage for the authentication context is not freed. The 
+transaction specified by the service context is implicitly committed. The 
+transaction handle, if explicitly allocated, may be freed if not being used.
+Resources allocated on the server for this user are freed.
+The authentication handle may be reused in a new call to OCISessionBegin().
+Parameters
+svchp (IN/OUT) - the service context handle. There must be a valid server 
+handle and user authentication handle associated with svchp.
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+usrhp (IN) - de-authenticate this user. If this parameter is passed as NULL, the 
+user in the service context handle is de-authenticated.
+mode (IN) - the only valid mode is OCI_DEFAULT.
+Example
+In this example, an authentication context is destroyed.
+Related Functions
+OCISessionBegin()
+
+
+
+
+OCIStmtExecute()
+Name
+OCI EXECute
+Purpose
+This call associates an application request with a server.
+Syntax
+sword OCIStmtExecute ( OCISvcCtx           *svchp,
+                     OCIStmt             *stmtp,
+                     OCIError            *errhp,
+                     ub4                 iters,
+                     ub4                 rowoff,
+                     CONST OCISnapshot   *snap_in,
+                     OCISnapshot         *snap_out,
+                     ub4                 mode );
+Comments
+This function  is used to execute a prepared SQL statement.
+Using an execute call, the application associates a request with a server. On 
+success, OCI_SUCCESS is returned.
+If a SELECT statement is executed, the description of the select list follows 
+implicitly as a response. This description is buffered on the client side for 
+describes, fetches and define type conversions. Hence it is optimal to 
+describe a select list only after an execute. 
+Also for SELECT statements, some results are available implicitly. Rows will 
+be received and buffered at the end of the execute. For queries with small row 
+count, a prefetch causes memory to be released in the server if the end of 
+fetch is reached, an optimization that may result in memory usage reduction. 
+Set attribute call has been defined to set the number of rows to be prefetched
+per result set.
+For SELECT statements, at the end of the execute, the statement handle 
+implicitly maintains a reference to the service context on which it is 
+executed. It is the user's responsibility to maintain the integrity of the 
+service context. If the attributes of a service context is changed for 
+executing some operations on this service context, the service context must 
+be restored to have the same attributes, that a statement was executed with, 
+prior to a fetch on the statement handle. The implicit reference is maintained 
+until the statement handle is freed or the fetch is cancelled or an end of 
+fetch condition is reached.
+Note: If output variables are defined for a SELECT statement before a 
+call to OCIStmtExecute(), the number of rows specified by iters will be 
+fetched directly into the defined output buffers and additional rows 
+equivalent to the prefetch count will be prefetched. If there are no 
+additional rows, then the fetch is complete without calling 
+OCIStmtFetch().
+The execute call will return errors if the statement has bind data types that 
+are not supported in an Oracle7 server.
+Parameters
+svchp (IN/OUT) - service context handle. 
+stmtp (IN/OUT) - an statement handle - defines the statement and the 
+associated data to be executed at the server. It is invalid to pass in a 
+statement handle that has bind of data types only supported in release 8.0 
+when srvchp points to an Oracle7 server. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. If the statement is being 
+batched and it is successful, then this handle will contain this particular 
+statement execution specific errors returned from the server when the batch is 
+flushed.
+iters (IN) - the number of times this statement is executed for non-Select 
+statements. For Select statements, if iters is non-zero, then defines must 
+have been done for the statement handle. The execution fetches iters rows into 
+these predefined buffers and prefetches more rows depending upon the prefetch 
+row count. This function returns an error if iters=0 for non-SELECT 
+statements.
+rowoff (IN) - the index from which the data in an array bind is relevant for 
+this multiple row execution. 
+snap_in (IN) - this parameter is optional. if supplied, must point to a 
+snapshot descriptor of type OCI_DTYPE_SNAP.  The contents of this descriptor 
+must be obtained from the snap_out parameter of a previous call.  The 
+descriptor is ignored if the SQL is not a SELECT.  This facility allows 
+multiple service contexts to ORACLE to see the same consistent snapshot of the 
+database's committed data.  However, uncommitted data in one context is not 
+visible to another context even using the same snapshot.
+snap_out (OUT) - this parameter optional. if supplied, must point to a 
+descriptor of type OCI_DTYPE_SNAP. This descriptor is filled in with an 
+opaque representation which is the current ORACLE "system change 
+number" suitable as a snap_in input to a subsequent call to OCIStmtExecute().  
+This descriptor should not be used any longer than necessary in order to avoid 
+"snapshot too old" errors. 
+mode (IN) - The modes are:
+If OCI_DEFAULT_MODE, the default mode, is selected, the request is 
+immediately executed. Error handle contains diagnostics on error if any. 
+OCI_EXACT_FETCH - if the statement is a SQL SELECT, this mode is 
+only valid if the application has set the prefetch row count prior to this 
+call. In this mode, the OCI library will get up to the number of rows 
+specified (i.e., prefetch row count plus iters). If the number of rows 
+returned by the query is greater than this value, OCI_ERROR will be 
+returned with ORA-01422 as the implementation specific error in a 
+diagnostic record. If the number of rows returned by the query is 
+smaller than the prefetch row count, OCI_SUCCESS_WITH_INFO will 
+be returned with ORA-01403 as the implementation specific error. The 
+prefetch buffer size is ignored and the OCI library tries to allocate all the 
+space required to contain the prefetched rows. The exact fetch semantics 
+apply to only the top level rows. No more rows can be fetched for this 
+query at the end of the call. 
+OCI_KEEP_FETCH_STATE - the result set rows (not yet fetched) of this 
+statement executed in this transaction will be maintained when the 
+transaction is detached for migration. By default, a query is cancelled 
+when a transaction is detached for migration. This mode is the default 
+mode when connected to a V7 server. 
+Related Functions
+OCIStmtPrepare()
+
+
+
+
+
+OCIStmtFetch()
+Name
+OCI FetCH
+Purpose
+Fetches rows from a query.
+Syntax
+sword OCIStmtFetch ( OCIStmt     *stmtp,
+                   OCIError    *errhp, 
+                   ub4         nrows,
+                   ub2         orientation,
+                   ub4         mode);
+Comments
+The fetch call is a local call, if prefetched rows suffice. However, this is 
+transparent to the application. If LOB columns are being read, LOB locators 
+are fetched for subsequent LOB operations to be performed on these locators. 
+Prefetching is turned off if LONG columns are involved. 
+A fetch with nrows set to 0 rows effectively cancels the fetch for this 
+statement.
+Parameters
+stmtp (IN) - a statement (application request) handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+nrows (IN) - number of rows to be fetched from the current position.
+orientation (IN) - for release 8.0, the only acceptable value is 
+OCI_FETCH_NEXT, which is also the default value. 
+mode (IN) - for release 8.0, beta-1, the following mode is defined.
+OCI_DEFAULT - default mode
+OCI_EOF_FETCH - indicates that it is the last fetch from the result set. 
+If nrows is non-zero, setting this mode effectively cancels fetching after 
+retrieving nrows, otherwise it cancels fetching immediately. 
+Related Functions
+OCIAttrGet()
+
+OCIStmtFetch2()
+Name
+OCI FetCH2
+Purpose
+Fetches rows from a query.
+Syntax
+sword OCIStmtFetch2 ( OCIStmt     *stmtp,
+                   OCIError    *errhp, 
+                   ub4         nrows,
+                   ub2         orientation,
+                   ub4         scrollOffset,
+                   ub4         mode);
+Comments
+The fetch call works similar to the OCIStmtFetch call with the 
+addition of the fetchOffset parameter. It can be used on any 
+statement handle, whether it is scrollable or not. For a 
+non-scrollable statement handle, the only acceptable value 
+will be OCI_FETCH_NEXT, and the fetchOffset parameter will be 
+ignored. Applications are encouraged to use this new call. 
+
+A fetchOffset with OCI_FETCH_RELATIVE is equivalent to 
+OCI_FETCH_CURRENT with a value of 0, is equivalent to 
+OCI_FETCH_NEXT with a value of 1, and equivalent to 
+OCI_FETCH_PRIOR with a value of -1. Note that the range of 
+accessible rows is [1,OCI_ATTR_ROW_COUNT] beyond which an 
+error could be raised if sufficient rows do not exist in 
+
+The fetch call is a local call, if prefetched rows suffice. However, this is 
+transparent to the application. If LOB columns are being read, LOB locators 
+are fetched for subsequent LOB operations to be performed on these locators. 
+Prefetching is turned off if LONG columns are involved. 
+A fetch with nrows set to 0 rows effectively cancels the fetch for this 
+statement.
+Parameters
+stmtp (IN) - a statement (application request) handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+nrows (IN) - number of rows to be fetched from the current position.
+It defaults to 1 for orientation OCI_FETCH_LAST.
+orientation (IN) -  The acceptable values are as follows, with 
+OCI_FETCH_NEXT being the default value.
+OCI_FETCH_CURRENT gets the current row, 
+OCI_FETCH_NEXT gets the next row from the current position,
+OCI_FETCH_FIRST gets the first row in the result set,
+OCI_FETCH_LAST gets the last row in the result set, 
+OCI_FETCH_PRIOR gets the previous row from the current row in the result set, 
+OCI_FETCH_ABSOLUTE will fetch the row number (specified by fetchOffset 
+parameter) in the result set using absolute positioning,
+OCI_FETCH_RELATIVE will fetch the row number (specified by fetchOffset 
+parameter) in the result set using relative positioning.
+scrollOffset(IN) - offset used with the OCI_FETCH_ABSOLUTE and 
+OCI_FETCH_RELATIVE orientation parameters only. It specify
+the new current position for scrollable result set. It is 
+ignored for non-scrollable result sets. 
+mode (IN) - for release 8.0, beta-1, the following mode is defined.
+OCI_DEFAULT - default mode
+OCI_EOF_FETCH - indicates that it is the last fetch from the result set. 
+If nrows is non-zero, setting this mode effectively cancels fetching after 
+retrieving nrows, otherwise it cancels fetching immediately. 
+Related Functions
+OCIAttrGet()
+
+
+
+OCIStmtGetPieceInfo()
+Name
+OCI Get Piece Information
+Purpose
+Returns piece information for a piecewise operation.
+Syntax
+sword OCIStmtGetPieceInfo( CONST OCIStmt  *stmtp,
+                         OCIError       *errhp,
+                         dvoid          **hndlpp,
+                         ub4            *typep,
+                         ub1            *in_outp,
+                         ub4            *iterp, 
+                         ub4            *idxp,
+                         ub1            *piecep );
+
+Comments
+When an execute/fetch call returns OCI_NEED_DATA to get/return a 
+dynamic bind/define value or piece, OCIStmtGetPieceInfo() returns the 
+relevant information: bind/define handle, iteration or index number and 
+which piece.
+See the section "Runtime Data Allocation and Piecewise Operations" on page 
+5-16 for more information about using OCIStmtGetPieceInfo().
+Parameters
+stmtp (IN) - the statement when executed returned OCI_NEED_DATA. 
+errhp (OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+hndlpp (OUT) - returns a pointer to the bind or define handle of the bind or 
+define whose runtime data is required or is being provided.
+typep (OUT) - the type of the handle pointed to by hndlpp: OCI_HTYPE_BIND 
+(for a bind handle) or OCI_HTYPE_DEFINE (for a define handle).
+in_outp (OUT) - returns OCI_PARAM_IN if the data is required for an IN bind 
+value. Returns OCI_PARAM_OUT if the data is available as an OUT bind 
+variable or a define position value.
+iterp (OUT) - returns the row number of a multiple row operation.
+idxp (OUT) - the index of an array element of a PL/SQL array bind operation.
+piecep (OUT) - returns one of the following defined values - 
+OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE and 
+OCI_LAST_PIECE. The default value is always OCI_ONE_PIECE. 
+Related Functions
+OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(), 
+OCIStmtSetPieceInfo()
+
+
+
+
+OCIStmtPrepare()
+Name
+OCI Statement REQuest
+Purpose
+This call defines the SQL/PLSQL statement to be executed.
+Syntax
+sword OCIStmtPrepare ( OCIStmt      *stmtp,
+                     OCIError     *errhp,
+                     CONST OraText   *stmt, 
+                     ub4          stmt_len,
+                     ub4          language,
+                     ub4          mode);
+Comments
+This call is used to prepare a SQL or PL/SQL statement for execution. The 
+OCIStmtPrepare() call defines an application request. 
+This is a purely local call. Data values for this statement initialized in 
+subsequent bind calls will be stored in a bind handle which will hang off this 
+statement handle.
+This call does not create an association between this statement handle and any 
+particular server.
+See the section "Preparing Statements" on page 2-21 for more information 
+about using this call.
+Parameters
+stmtp (IN) - a statement handle.
+errhp (IN) - an error handle to retrieve diagnostic information.
+stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null-
+terminated string. The pointer to the OraText of the statement must be available 
+as long as the statement is executed.
+stmt_len (IN) - length of the statement. Must not be zero.
+language (IN) - V7, V8, or native syntax. Possible values are:
+OCI_V7_SYNTAX - V7 ORACLE parsing syntax
+OCI_V8_SYNTAX - V8 ORACLE parsing syntax
+OCI_NTV_SYNTAX - syntax depending upon the version of the server. 
+mode (IN) - the only defined mode is OCI_DEFAULT for default mode. 
+Example
+This example demonstrates the use of OCIStmtPrepare(), as well as the OCI 
+application initialization calls.
+Related Functions
+OCIAttrGet(), OCIStmtExecute()
+
+
+OCIStmtPrepare2()
+Name
+OCI Statement REQuest with (a) early binding to svchp and/or
+(b) stmt caching
+Purpose
+This call defines the SQL/PLSQL statement to be executed.
+Syntax
+sword OCIStmtPrepare2 ( OCISvcCtx *svchp,
+                     OCIStmt      **stmtp,
+                     OCIError     *errhp,
+                     CONST OraText   *stmt,
+                     ub4          stmt_len,
+                     CONST OraText *key,
+                     ub4          key_len,
+                     ub4          language,
+                     ub4          mode);
+Comments
+This call is used to prepare a SQL or PL/SQL statement for execution. The
+OCIStmtPrepare() call defines an application request.
+This is a purely local call. Data values for this statement initialized in
+subsequent bind calls will be stored in a bind handle which will hang off this
+statement handle.
+This call creates an association between the statement handle and a service
+context. It differs from OCIStmtPrepare in that respect.It also supports
+stmt caching. The stmt will automatically be cached if the authp of the stmt
+has enabled stmt caching.
+Parameters
+svchp (IN) - the service context handle that contains the session that
+             this stmt handle belongs to.
+stmtp (OUT) - an unallocated stmt handle must be pased in. An allocated
+              and prepared  statement handle will be returned.
+errhp (IN) - an error handle to retrieve diagnostic information.
+stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null-
+            terminated string. The pointer to the OraText of the statement 
+            must be available as long as the statement is executed.
+stmt_len (IN) - length of the statement. Must not be zero.
+key (IN) - This is only Valid for OCI Stmt Caching. It indicates the
+           key to search with. It thus optimizes the search in the cache.
+key_len (IN) - the length of the key. This, too, is onlly valid for stmt
+               caching.
+language (IN) - V7, V8, or native syntax. Possible values are:
+OCI_V7_SYNTAX - V7 ORACLE parsing syntax
+OCI_V8_SYNTAX - V8 ORACLE parsing syntax
+OCI_NTV_SYNTAX - syntax depending upon the version of the server.
+mode (IN) - the defined modes are OCI_DEFAULT and OCI_PREP2_CACHE_SEARCHONLY.
+Example
+Related Functions
+OCIStmtExecute(), OCIStmtRelease()
+
+
+OCIStmtRelease()
+Name
+OCI Statement Release. This call is used to relesae the stmt that
+was retreived using OCIStmtPrepare2(). If the stmt is release
+using this call, OCIHandleFree() must not be called on the stmt
+handle.
+Purpose
+This call releases the statement obtained by OCIStmtPrepare2
+Syntax
+sword OCIStmtRelease ( OCIStmt      *stmtp,
+                     OCIError     *errhp,
+                     cONST OraText *key,
+                     ub4          key_len,
+                     ub4          mode);
+Comments
+This call is used to release a handle obtained via OCIStmtPrepare2().
+It also frees the memory associated with the handle.
+This is a purely local call.
+Parameters
+stmtp (IN/OUT) - The statement handle to be released/freed.
+errhp (IN) - an error handle to retrieve diagnostic information.
+key (IN) - This is only Valid for OCI Stmt Caching. It indicates the
+           key to tag the stmt with.
+key_len (IN) - the length of the key. This, too, is only valid for stmt
+               caching.
+mode (IN) - the defined modes are OCI_DEFAULT for default mode and
+            OCI_STRLS_CACHE_DELETE (only used for Stmt Caching).
+Example
+Related Functions
+OCIStmtExecute(), OCIStmtPrepare2()
+
+
+OCIStmtSetPieceInfo()
+Name
+OCI Set Piece Information
+Purpose
+Sets piece information for a piecewise operation.
+Syntax
+sword OCIStmtSetPieceInfo ( dvoid             *hndlp,
+                          ub4               type,
+                          OCIError          *errhp,
+                          CONST dvoid       *bufp,
+                          ub4               *alenp, 
+                          ub1               piece,
+                          CONST dvoid       *indp, 
+                          ub2               *rcodep ); 
+Comments
+When an execute call returns OCI_NEED_DATA to get a dynamic IN/OUT 
+bind value or piece, OCIStmtSetPieceInfo() sets the piece information: the 
+buffer, the length, the indicator and which piece is currently being processed.
+For more information about using OCIStmtSetPieceInfo() see the section 
+"Runtime Data Allocation and Piecewise Operations" on page 5-16.
+Parameters
+hndlp (IN/OUT) - the bind/define handle.
+type (IN) - type of the handle. 
+errhp (OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+bufp (IN/OUT) - bufp is a pointer to a storage containing the data value or 
+the piece when it is an IN bind variable, otherwise bufp is a pointer to 
+storage for getting a piece or a value for OUT binds and define variables. For
+named data types or REFs, a pointer to the object or REF is returned.
+alenp (IN/OUT) - the length of the piece or the value. 
+piece (IN) - the piece parameter. The following are valid values: 
+OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE, or 
+OCI_LAST_PIECE. 
+The default value is OCI_ONE_PIECE. This parameter is used for IN bind 
+variables only.
+indp (IN/OUT) - indicator. A pointer to a sb2 value or pointer to an indicator 
+structure for named data types (SQLT_NTY) and REFs (SQLT_REF), i.e., *indp 
+is either an sb2 or a dvoid * depending upon the data type.
+rcodep (IN/OUT) - return code. 
+Related Functions
+OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(), 
+OCIStmtGetPieceInfo()
+
+
+OCIFormatInit
+Name
+OCIFormat Package Initialize
+Purpose
+Initializes the OCIFormat package.
+Syntax
+sword OCIFormatInit(dvoid *hndl, OCIError *err);
+Comments
+This routine must be called before calling any other OCIFormat routine.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - OCI environment or session handle
+err (IN/OUT) - OCI error handle
+Related Functions
+OCIFormatTerm()
+
+
+OCIFormatString
+Name
+OCIFormat Package Format String
+Purpose
+Writes a text string into the supplied text buffer using the argument
+list submitted to it and in accordance with the format string given.
+Syntax
+sword OCIFormatString(dvoid *hndl, OCIError *err, OraText *buffer,
+                      sbig_ora bufferLength, sbig_ora *returnLength,
+                      CONST OraText *formatString, ...);
+Comments
+The first call to this routine must be preceded by a call to the
+OCIFormatInit routine that initializes the OCIFormat package
+for use.  When this routine is no longer needed then terminate
+the OCIFormat package by a call to the OCIFormatTerm routine.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl         (IN/OUT) - OCI environment or session handle
+err          (IN/OUT) - OCI error handle
+buffer       (OUT)    - text buffer for the string
+bufferLength (IN)     - length of the text buffer
+returnLength (OUT)    - length of the formatted string
+formatString (IN)     - format specification string
+...          (IN)     - variable argument list
+Related Functions
+
+
+OCIFormatTerm 
+Name
+OCIFormat Package Terminate
+Purpose
+Terminates the OCIFormat package.
+Syntax
+sword OCIFormatTerm(dvoid *hndl, OCIError *err);
+Comments
+It must be called after the OCIFormat package is no longer being used.
+Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+Parameters
+hndl (IN/OUT) - OCI environment or session handle
+err (IN/OUT) - OCI error handle
+Related Functions
+OCIFormatInit()
+
+
+OCIFormatTUb1
+Name
+OCIFormat Package ub1 Type
+Purpose
+Return the type value for the ub1 type.
+Syntax
+sword OCIFormatTUb1(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUb2
+Name
+OCIFormat Package ub2 Type
+Purpose
+Return the type value for the ub2 type.
+Syntax
+sword OCIFormatTUb2(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUb4
+Name
+OCIFormat Package ub4 Type
+Purpose
+Return the type value for the ub4 type.
+Syntax
+sword OCIFormatTUb4(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUword
+Name
+OCIFormat Package uword Type
+Purpose
+Return the type value for the uword type.
+Syntax
+sword OCIFormatTUword(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTUbig_ora
+Name
+OCIFormat Package ubig_ora Type
+Purpose
+Return the type value for the ubig_ora type.
+Syntax
+sword OCIFormatTUbig_ora(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSb1
+Name
+OCIFormat Package sb1 Type
+Purpose
+Return the type value for the sb1 type.
+Syntax
+sword OCIFormatTSb1(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSb2
+Name
+OCIFormat Package sb2 Type
+Purpose
+Return the type value for the sb2 type.
+Syntax
+sword OCIFormatTSb2(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSb4
+Name
+OCIFormat Package sb4 Type
+Purpose
+Return the type value for the sb4 type.
+Syntax
+sword OCIFormatTSb4(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSword
+Name
+OCIFormat Package sword Type
+Purpose
+Return the type value for the sword type.
+Syntax
+sword OCIFormatTSword(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTSbig_ora
+Name
+OCIFormat Package sbig_ora Type
+Purpose
+Return the type value for the sbig_ora type.
+Syntax
+sword OCIFormatTSbig_ora(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEb1
+Name
+OCIFormat Package eb1 Type
+Purpose
+Return the type value for the eb1 type.
+Syntax
+sword OCIFormatTEb1(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEb2
+Name
+OCIFormat Package eb2 Type
+Purpose
+Return the type value for the eb2 type.
+Syntax
+sword OCIFormatTEb2(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEb4
+Name
+OCIFormat Package eb4 Type
+Purpose
+Return the type value for the eb4 type.
+Syntax
+sword OCIFormatTEb4(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEword
+Name
+OCIFormat Package eword Type
+Purpose
+Return the type value for the eword type.
+Syntax
+sword OCIFormatTEword(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTChar
+Name
+OCIFormat Package text Type
+Purpose
+Return the type value for the text type.
+Syntax
+sword OCIFormatTChar(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTText
+Name
+OCIFormat Package *text Type
+Purpose
+Return the type value for the *text type.
+Syntax
+sword OCIFormatTText(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTDouble
+Name
+OCIFormat Package double Type
+Purpose
+Return the type value for the double type.
+Syntax
+sword OCIFormatTDouble(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatDvoid
+Name
+OCIFormat Package dvoid Type
+Purpose
+Return the type value for the dvoid type.
+Syntax
+sword OCIFormatTDvoid(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCIFormatTEnd
+Name
+OCIFormat Package end Type
+Purpose
+Return the list terminator's "type".
+Syntax
+sword OCIFormatTEnd(void);
+Comments
+None
+Parameters
+None
+Related Functions
+None
+
+
+OCISvcCtxToLda()
+Name
+OCI toggle SerVice context handle to Version 7 Lda_Def
+Purpose
+Toggles between a V8 service context handle and a V7 Lda_Def.
+Syntax
+sword OCISvcCtxToLda ( OCISvcCtx    *srvhp,
+                     OCIError     *errhp,
+                     Lda_Def      *ldap );
+Comments
+Toggles between an Oracle8 service context handle and an Oracle7 Lda_Def.
+This function can only be called after a service context has been properly 
+initialized.
+Once the service context has been translated to an Lda_Def, it can be used in 
+release 7.x OCI calls (e.g., obindps(), ofen()).
+Note: If there are multiple service contexts which share the same server 
+handle, only one can be in V7 mode at any time.
+The action of this call can be reversed by passing the resulting Lda_Def to 
+the OCILdaToSvcCtx() function.
+Parameters
+svchp (IN/OUT) - the service context handle. 
+errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error. 
+ldap (IN/OUT) - a Logon Data Area for V7-style OCI calls which is initialized 
+by this call. 
+Related Functions
+OCILdaToSvcCtx()
+
+
+
+
+OCITransCommit()
+Name
+OCI TX (transaction) CoMmit
+Purpose
+Commits the transaction associated with a specified service context.
+Syntax
+sword OCITransCommit ( OCISvcCtx    *srvcp,
+                     OCIError     *errhp,
+                     ub4          flags );
+Comments
+The transaction currently associated with the service context is committed. If 
+it is a distributed transaction that the server cannot commit, this call 
+additionally retrieves the state of the transaction from the database to be 
+returned to the user in the error handle.
+If the application has defined multiple transactions, this function operates 
+on the transaction currently associated with the service context. If the 
+application is working with only the implicit local transaction created when 
+database changes are made, that implicit transaction is committed.
+If the application is running in the object mode, then the modified or updated 
+objects in the object cache for this transaction are also committed.
+The flags parameter is used for one-phase commit optimization in distributed 
+transactions. If the transaction is non-distributed, the flags parameter is 
+ignored, and OCI_DEFAULT can be passed as its value. OCI applications 
+managing global transactions should pass a value of 
+OCI_TRANS_TWOPHASE to the flags parameter for a two-phase commit. The 
+default is one-phase commit.
+Under normal circumstances, OCITransCommit() returns with a status 
+indicating that the transaction has either been committed or rolled back. With 
+distributed transactions, it is possible that the transaction is now in-doubt 
+(i.e., neither committed nor aborted). In this case, OCITransCommit() 
+attempts to retrieve the status of the transaction from the server. 
+The status is returned.
+Parameters
+srvcp (IN) - the service context handle.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags -see the "Comments" section above.
+Related Functions
+OCITransRollback()
+
+
+
+
+OCITransDetach()
+Name
+OCI TX (transaction) DeTach
+Purpose
+Detaches a transaction.
+Syntax
+sword OCITransDetach ( OCISvcCtx    *srvcp,
+                     OCIError     *errhp,
+                     ub4          flags);
+Comments
+Detaches a global transaction from the service context handle. The transaction 
+currently attached to the service context handle becomes inactive at the end 
+of this call. The transaction may be resumed later by calling OCITransStart(), 
+specifying  a flags value of OCI_TRANS_RESUME.
+When a transaction is detached, the value which was specified in the timeout 
+parameter of OCITransStart() when the transaction was started is used to 
+determine the amount of time the branch can remain inactive before being 
+deleted by the server's PMON process.
+Note: The transaction can be resumed by a different process than the one 
+that detached it, provided that the transaction has the same 
+authorization.
+Parameters
+srvcp (IN) - the service context handle. 
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags (IN) - you must pass a value of OCI_DEFAULT for this parameter.
+Related Functions
+OCITransStart()
+
+
+
+OCITransForget()
+Name
+OCI TX (transaction) ForGeT
+Purpose
+Causes the server to forget a heuristically completed global transaction.
+Syntax
+sword OCITransForget ( OCISvcCtx     *svchp, 
+                     OCIError      *errhp,
+                     ub4           flags);
+
+Comments
+
+Forgets a heuristically completed global transaction. The server deletes the 
+status of the transaction from the system's pending transaction table.
+The XID of the transaction to be forgotten is set as an attribute of the 
+transaction handle (OCI_ATTR_XID).
+Parameters
+srvcp (IN) - the service context handle - the transaction is rolled back.
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags (IN) - you must pass OCI_DEFAULT for this parameter.
+Related Functions
+OCITransCommit(), OCITransRollback()
+
+
+OCITransMultiPrepare() 
+Name
+OCI Trans(action) Multi-Branch Prepare
+Purpose
+Prepares a transaction with multiple branches in a single call.
+Syntax
+sword OCITransMultiPrepare ( OCISvcCtx    *svchp,
+                             ub4           numBranches,
+                             OCITrans     **txns,
+                             OCIError     **errhp);
+
+Comments
+
+Prepares the specified global transaction for commit.
+This call is valid only for distributed transactions.
+This call is an advanced performance feature intended for use only in
+situations where the caller is responsible for preparing all the branches
+in a transaction. 
+Parameters
+srvcp (IN) - the service context handle. 
+numBranches (IN) - This is the number of branches expected. It is also the
+array size for the next two parameters.
+txns (IN) - This is the array of transaction handles for the branches to
+prepare. They should all have the OCI_ATTR_XID set. The global transaction
+ID should be the same.
+errhp (IN) - This is the array of error handles. If OCI_SUCCESS is not
+returned, then these will indicate which branches received which errors.
+Related Functions
+OCITransPrepare()
+
+
+OCITransPrepare()
+Name
+OCI TX (transaction) PREpare
+Purpose
+Prepares a transaction for commit.
+Syntax
+sword OCITransPrepare ( OCISvcCtx    *svchp, 
+                      OCIError     *errhp,
+                      ub4          flags);
+
+Comments
+
+Prepares the specified global transaction for commit.
+This call is valid only for distributed transactions.
+The call returns OCI_SUCCESS_WITH_INFO if the transaction has not made 
+any changes. The error handle will indicate that the transaction is read-only. 
+The flag parameter is not currently used. 
+Parameters
+srvcp (IN) - the service context handle. 
+errhp (IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags (IN) - you must pass OCI_DEFAULT for this parameter.
+Related Functions
+OCITransCommit(), OCITransForget()
+
+
+
+
+OCITransRollback()
+Name
+OCI TX (transaction) RoLlback
+Purpose
+Rolls back the current transaction.
+Syntax
+sword OCITransRollback ( dvoid        *svchp, 
+                       OCIError     *errhp,
+                       ub4          flags );
+Comments
+The current transaction- defined as the set of statements executed since the 
+last OCITransCommit() or since OCISessionBegin()-is rolled back.
+If the application is running under object mode then the modified or updated 
+objects in the object cache for this transaction are also rolled back.
+An error is returned if an attempt is made to roll back a global transaction 
+that is not currently active.
+Parameters
+svchp (IN) - a service context handle. The transaction currently set in the 
+service context handle is rolled back.
+errhp -(IN) - an error handle which can be passed to OCIErrorGet() for 
+diagnostic information in the event of an error.
+flags - you must pass a value of OCI_DEFAULT for this parameter.
+Related Functions
+OCITransCommit()
+
+
+
+
+OCITransStart()
+Name
+OCI TX (transaction) STart
+Purpose
+Sets the beginning of a transaction.
+Syntax
+sword OCITransStart ( OCISvcCtx    *svchp, 
+                    OCIError     *errhp, 
+                    uword        timeout,
+                    ub4          flags);
+
+Comments
+This function sets the beginning of a global or serializable transaction. The 
+transaction context currently associated with the service context handle is 
+initialized at the end of the call if the flags parameter specifies that a new 
+transaction should be started.
+The XID of the transaction is set as an attribute of the transaction handle 
+(OCI_ATTR_XID)
+Parameters
+svchp (IN/OUT) - the service context handle. The transaction context in the 
+service context handle is initialized at the end of the call if the flag 
+specified a new transaction to be started.
+errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded in 
+err and this function returns OCI_ERROR. Diagnostic information can be 
+obtained by calling OCIErrorGet().
+timeout (IN) - the time, in seconds, to wait for a transaction to become 
+available for resumption when OCI_TRANS_RESUME is specified. When 
+OCI_TRANS_NEW is specified, this value is stored and may be used later by 
+OCITransDetach().
+flags (IN) - specifies whether a new transaction is being started or an 
+existing transaction is being resumed. Also specifies serializiability or 
+read-only status. More than a single value can be specified. By default, 
+a read/write transaction is started. The flag values are:
+OCI_TRANS_NEW - starts a new transaction branch. By default starts a 
+tightly coupled and migratable branch.
+OCI_TRANS_TIGHT - explicitly specifies a tightly coupled branch
+OCI_TRANS_LOOSE - specifies a loosely coupled branch
+OCI_TRANS_RESUME - resumes an existing transaction branch. 
+OCI_TRANS_READONLY - start a readonly transaction
+OCI_TRANS_SERIALIZABLE - start a serializable transaction
+Related Functions
+OCITransDetach()
+
+
+
+
+
+******************************************************************************/
+/*-----------------------Dynamic Callback Function Pointers------------------*/
+ 
+ 
+typedef sb4 (*OCICallbackInBind)(dvoid *ictxp, OCIBind *bindp, ub4 iter,
+                                  ub4 index, dvoid **bufpp, ub4 *alenp,
+                                  ub1 *piecep, dvoid **indp);
+ 
+typedef sb4 (*OCICallbackOutBind)(dvoid *octxp, OCIBind *bindp, ub4 iter,
+                                 ub4 index, dvoid **bufpp, ub4 **alenp,
+                                 ub1 *piecep, dvoid **indp,
+                                 ub2 **rcodep);
+ 
+typedef sb4 (*OCICallbackDefine)(dvoid *octxp, OCIDefine *defnp, ub4 iter,
+                                 dvoid **bufpp, ub4 **alenp, ub1 *piecep,
+                                 dvoid **indp, ub2 **rcodep);
+
+typedef sword (*OCIUserCallback)(dvoid *ctxp, dvoid *hndlp, ub4 type,
+                                 ub4 fcode, ub4 when, sword returnCode,
+                                 sb4 *errnop, va_list arglist);
+
+typedef sword (*OCIEnvCallbackType)(OCIEnv *env, ub4 mode,
+                                   size_t xtramem_sz, dvoid *usrmemp,
+                                   OCIUcb *ucbDesc); 
+
+typedef sb4 (*OCICallbackLobRead)(dvoid *ctxp, CONST dvoid *bufp,
+                                             ub4 len, ub1 piece);
+
+typedef sb4 (*OCICallbackLobWrite)(dvoid *ctxp, dvoid *bufp, 
+                                          ub4 *lenp, ub1 *piece);
+
+/*--------------------------Failover Callback Structure ---------------------*/
+typedef sb4 (*OCICallbackFailover)(dvoid *svcctx, dvoid *envctx,
+                                   dvoid *fo_ctx, ub4 fo_type,
+                                   ub4 fo_event);
+
+typedef struct
+{
+  OCICallbackFailover callback_function;
+  dvoid *fo_ctx;
+} 
+OCIFocbkStruct;
+
+/*****************************************************************************
+                         ACTUAL PROTOTYPE DECLARATIONS
+******************************************************************************/
+
+sword   OCIInitialize   (ub4 mode, dvoid *ctxp, 
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr) );
+
+sword   OCITerminate( ub4 mode);
+
+sword   OCIEnvCreate (OCIEnv **envp, ub4 mode, dvoid *ctxp,
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+                 size_t xtramem_sz, dvoid **usrmempp);
+
+sword   OCIEnvNlsCreate (OCIEnv **envp, ub4 mode, dvoid *ctxp,
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+                 size_t xtramem_sz, dvoid **usrmempp,
+                 ub2 charset, ub2 ncharset);
+
+sword   OCIFEnvCreate (OCIEnv **envp, ub4 mode, dvoid *ctxp,
+                 dvoid *(*malocfp)(dvoid *ctxp, size_t size),
+                 dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize),
+                 void   (*mfreefp)(dvoid *ctxp, dvoid *memptr),
+                 size_t xtramem_sz, dvoid **usrmempp, dvoid *fupg);
+
+sword   OCIHandleAlloc(CONST dvoid *parenth, dvoid **hndlpp, CONST ub4 type, 
+                       CONST size_t xtramem_sz, dvoid **usrmempp);
+
+sword   OCIHandleFree(dvoid *hndlp, CONST ub4 type);
+
+
+sword   OCIDescriptorAlloc(CONST dvoid *parenth, dvoid **descpp, 
+                           CONST ub4 type, CONST size_t xtramem_sz, 
+                           dvoid **usrmempp);
+
+sword   OCIDescriptorFree(dvoid *descp, CONST ub4 type);
+
+sword   OCIEnvInit (OCIEnv **envp, ub4 mode, 
+                    size_t xtramem_sz, dvoid **usrmempp);
+
+sword   OCIServerAttach  (OCIServer *srvhp, OCIError *errhp,
+                          CONST OraText *dblink, sb4 dblink_len, ub4 mode);
+
+sword   OCIServerDetach  (OCIServer *srvhp, OCIError *errhp, ub4 mode);
+
+sword   OCISessionBegin  (OCISvcCtx *svchp, OCIError *errhp, OCISession *usrhp,
+                          ub4 credt, ub4 mode);
+
+sword   OCISessionEnd   (OCISvcCtx *svchp, OCIError *errhp, OCISession *usrhp, 
+                         ub4 mode);
+
+sword   OCILogon (OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp, 
+		  CONST OraText *username, ub4 uname_len, 
+		  CONST OraText *password, ub4 passwd_len, 
+		  CONST OraText *dbname, ub4 dbname_len);
+
+sword   OCILogon2 (OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp,
+                  CONST OraText *username, ub4 uname_len,
+                  CONST OraText *password, ub4 passwd_len,
+                  CONST OraText *dbname, ub4 dbname_len,
+                  ub4 mode);
+
+sword   OCILogoff (OCISvcCtx *svchp, OCIError *errhp);
+
+
+sword   OCIPasswordChange   (OCISvcCtx *svchp, OCIError *errhp, 
+                             CONST OraText *user_name, ub4 usernm_len, 
+                             CONST OraText *opasswd, ub4 opasswd_len, 
+                             CONST OraText *npasswd, ub4 npasswd_len, ub4 mode);
+
+sword   OCIStmtPrepare   (OCIStmt *stmtp, OCIError *errhp, CONST OraText *stmt,
+                          ub4 stmt_len, ub4 language, ub4 mode);
+
+sword OCIStmtPrepare2 ( OCISvcCtx *svchp, OCIStmt **stmtp, OCIError *errhp,
+                     CONST OraText *stmt, ub4 stmt_len, CONST OraText *key,
+                     ub4 key_len, ub4 language, ub4 mode);
+
+sword OCIStmtRelease ( OCIStmt *stmtp, OCIError *errhp, CONST OraText *key,
+                       ub4 key_len, ub4 mode);
+
+sword   OCIBindByPos  (OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
+		       ub4 position, dvoid *valuep, sb4 value_sz,
+		       ub2 dty, dvoid *indp, ub2 *alenp, ub2 *rcodep,
+		       ub4 maxarr_len, ub4 *curelep, ub4 mode);
+
+sword   OCIBindByName   (OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
+			 CONST OraText *placeholder, sb4 placeh_len, 
+                         dvoid *valuep, sb4 value_sz, ub2 dty, 
+                         dvoid *indp, ub2 *alenp, ub2 *rcodep, 
+                         ub4 maxarr_len, ub4 *curelep, ub4 mode);
+
+sword   OCIBindObject  (OCIBind *bindp, OCIError *errhp, CONST OCIType *type, 
+			dvoid **pgvpp, ub4 *pvszsp, dvoid **indpp, 
+			ub4 *indszp);
+
+sword   OCIBindDynamic   (OCIBind *bindp, OCIError *errhp, dvoid *ictxp,
+			  OCICallbackInBind icbfp, dvoid *octxp,
+			  OCICallbackOutBind ocbfp);
+
+sword   OCIBindArrayOfStruct   (OCIBind *bindp, OCIError *errhp, 
+                                ub4 pvskip, ub4 indskip,
+                                ub4 alskip, ub4 rcskip);
+
+sword   OCIStmtGetPieceInfo   (OCIStmt *stmtp, OCIError *errhp, 
+                               dvoid **hndlpp, ub4 *typep,
+                               ub1 *in_outp, ub4 *iterp, ub4 *idxp, 
+                               ub1 *piecep);
+
+sword   OCIStmtSetPieceInfo   (dvoid *hndlp, ub4 type, OCIError *errhp, 
+                               CONST dvoid *bufp, ub4 *alenp, ub1 piece, 
+                               CONST dvoid *indp, ub2 *rcodep);
+
+sword   OCIStmtExecute  (OCISvcCtx *svchp, OCIStmt *stmtp, OCIError *errhp, 
+                         ub4 iters, ub4 rowoff, CONST OCISnapshot *snap_in, 
+                         OCISnapshot *snap_out, ub4 mode);
+
+sword   OCIDefineByPos  (OCIStmt *stmtp, OCIDefine **defnp, OCIError *errhp,
+			 ub4 position, dvoid *valuep, sb4 value_sz, ub2 dty,
+			 dvoid *indp, ub2 *rlenp, ub2 *rcodep, ub4 mode);
+
+sword   OCIDefineObject  (OCIDefine *defnp, OCIError *errhp, 
+                          CONST OCIType *type, dvoid **pgvpp, 
+                          ub4 *pvszsp, dvoid **indpp, ub4 *indszp);
+
+sword   OCIDefineDynamic   (OCIDefine *defnp, OCIError *errhp, dvoid *octxp,
+                            OCICallbackDefine ocbfp);
+
+sword   OCIDefineArrayOfStruct  (OCIDefine *defnp, OCIError *errhp, ub4 pvskip,
+                                 ub4 indskip, ub4 rlskip, ub4 rcskip);
+
+sword   OCIStmtFetch   (OCIStmt *stmtp, OCIError *errhp, ub4 nrows, 
+                        ub2 orientation, ub4 mode);
+
+sword   OCIStmtFetch2   (OCIStmt *stmtp, OCIError *errhp, ub4 nrows, 
+                        ub2 orientation, sb4 scrollOffset, ub4 mode);
+
+sword   OCIStmtGetBindInfo   (OCIStmt *stmtp, OCIError *errhp, ub4 size, 
+                              ub4 startloc,
+                              sb4 *found, OraText *bvnp[], ub1 bvnl[],
+                              OraText *invp[], ub1 inpl[], ub1 dupl[],
+                              OCIBind *hndl[]);
+
+sword   OCIDescribeAny  (OCISvcCtx *svchp, OCIError *errhp, 
+                         dvoid *objptr, 
+                         ub4 objnm_len, ub1 objptr_typ, ub1 info_level,
+			 ub1 objtyp, OCIDescribe *dschp);
+
+sword   OCIParamGet (CONST dvoid *hndlp, ub4 htype, OCIError *errhp, 
+                     dvoid **parmdpp, ub4 pos);
+
+sword   OCIParamSet(dvoid *hdlp, ub4 htyp, OCIError *errhp, CONST dvoid *dscp,
+                    ub4 dtyp, ub4 pos);
+
+sword   OCITransStart  (OCISvcCtx *svchp, OCIError *errhp, 
+                        uword timeout, ub4 flags );
+
+sword   OCITransDetach  (OCISvcCtx *svchp, OCIError *errhp, ub4 flags );
+
+sword   OCITransCommit  (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+sword   OCITransRollback  (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+sword   OCITransPrepare (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+sword   OCITransMultiPrepare (OCISvcCtx *svchp, ub4 numBranches, 
+                              OCITrans **txns, OCIError **errhp);
+
+sword   OCITransForget (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
+
+sword   OCIErrorGet   (dvoid *hndlp, ub4 recordno, OraText *sqlstate,
+                       sb4 *errcodep, OraText *bufp, ub4 bufsiz, ub4 type);
+
+sword   OCILobAppend  (OCISvcCtx *svchp, OCIError *errhp, 
+                       OCILobLocator *dst_locp,
+                       OCILobLocator *src_locp);
+
+sword   OCILobAssign (OCIEnv *envhp, OCIError *errhp, 
+                      CONST OCILobLocator *src_locp, 
+                      OCILobLocator **dst_locpp);
+
+sword   OCILobCharSetForm (OCIEnv *envhp, OCIError *errhp, 
+                           CONST OCILobLocator *locp, ub1 *csfrm);
+
+sword   OCILobCharSetId (OCIEnv *envhp, OCIError *errhp, 
+                         CONST OCILobLocator *locp, ub2 *csid);
+
+sword   OCILobCopy (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *dst_locp,
+                    OCILobLocator *src_locp, ub4 amount, ub4 dst_offset, 
+                    ub4 src_offset);
+
+sword OCILobCreateTemporary(OCISvcCtx          *svchp,
+                            OCIError           *errhp,
+                            OCILobLocator      *locp,
+                            ub2                 csid,
+                            ub1                 csfrm,
+                            ub1                 lobtype,
+                            boolean             cache,
+                            OCIDuration         duration);
+
+
+sword OCILobClose( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *locp );
+
+
+sword   OCILobDisableBuffering (OCISvcCtx      *svchp,
+                                OCIError       *errhp,
+                                OCILobLocator  *locp);
+
+sword   OCILobEnableBuffering (OCISvcCtx      *svchp,
+                               OCIError       *errhp,
+                               OCILobLocator  *locp);
+
+sword   OCILobErase (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                      ub4 *amount, ub4 offset);
+
+sword   OCILobFileClose (OCISvcCtx *svchp, OCIError *errhp, 
+                         OCILobLocator *filep);
+
+sword   OCILobFileCloseAll (OCISvcCtx *svchp, OCIError *errhp);
+
+sword   OCILobFileExists (OCISvcCtx *svchp, OCIError *errhp, 
+			  OCILobLocator *filep,
+			  boolean *flag);
+
+sword   OCILobFileGetName (OCIEnv *envhp, OCIError *errhp, 
+                           CONST OCILobLocator *filep, 
+                           OraText *dir_alias, ub2 *d_length, 
+                           OraText *filename, ub2 *f_length);
+
+sword   OCILobFileIsOpen (OCISvcCtx *svchp, OCIError *errhp, 
+                          OCILobLocator *filep,
+                          boolean *flag);
+
+sword   OCILobFileOpen (OCISvcCtx *svchp, OCIError *errhp, 
+                        OCILobLocator *filep,
+                        ub1 mode);
+
+sword   OCILobFileSetName (OCIEnv *envhp, OCIError *errhp, 
+                           OCILobLocator **filepp, 
+                           CONST OraText *dir_alias, ub2 d_length, 
+                           CONST OraText *filename, ub2 f_length);
+
+sword   OCILobFlushBuffer (OCISvcCtx       *svchp,
+                           OCIError        *errhp,
+                           OCILobLocator   *locp,
+                           ub4              flag);
+
+sword OCILobFreeTemporary(OCISvcCtx          *svchp,
+                          OCIError           *errhp,
+                          OCILobLocator      *locp);
+
+sword OCILobGetChunkSize(OCISvcCtx         *svchp,
+                         OCIError          *errhp,
+                         OCILobLocator     *locp,
+                         ub4               *chunksizep);
+
+sword   OCILobGetLength  (OCISvcCtx *svchp, OCIError *errhp, 
+                          OCILobLocator *locp,
+                          ub4 *lenp);
+
+sword   OCILobIsEqual  (OCIEnv *envhp, CONST OCILobLocator *x, 
+                        CONST OCILobLocator *y, 
+                        boolean *is_equal);
+
+sword OCILobIsOpen( OCISvcCtx     *svchp,
+                    OCIError      *errhp,
+                    OCILobLocator *locp,
+                    boolean       *flag);
+
+sword OCILobIsTemporary(OCIEnv            *envp,
+                        OCIError          *errhp,
+                        OCILobLocator     *locp,
+                        boolean           *is_temporary);
+
+sword   OCILobLoadFromFile (OCISvcCtx *svchp, OCIError *errhp, 
+                            OCILobLocator *dst_locp,
+       	                    OCILobLocator *src_filep, 
+                            ub4 amount, ub4 dst_offset, 
+                            ub4 src_offset);
+
+sword   OCILobLocatorAssign  (OCISvcCtx *svchp, OCIError *errhp, 
+                            CONST OCILobLocator *src_locp, 
+                            OCILobLocator **dst_locpp);
+
+
+sword   OCILobLocatorIsInit (OCIEnv *envhp, OCIError *errhp, 
+                             CONST OCILobLocator *locp, 
+                             boolean *is_initialized);
+
+sword   OCILobOpen( OCISvcCtx        *svchp,
+                   OCIError         *errhp,
+                   OCILobLocator    *locp,
+                   ub1               mode );
+ 
+sword   OCILobRead  (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                     ub4 *amtp, ub4 offset, dvoid *bufp, ub4 bufl, 
+                     dvoid *ctxp, sb4 (*cbfp)(dvoid *ctxp, 
+                                              CONST dvoid *bufp, 
+                                              ub4 len, 
+                                              ub1 piece),
+                     ub2 csid, ub1 csfrm);
+
+sword   OCILobTrim  (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                     ub4 newlen);
+
+sword   OCILobWrite  (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
+                      ub4 *amtp, ub4 offset, dvoid *bufp, ub4 buflen, 
+                      ub1 piece, dvoid *ctxp, 
+                      sb4 (*cbfp)(dvoid *ctxp, 
+                                  dvoid *bufp, 
+                                  ub4 *len, 
+                                  ub1 *piece),
+                      ub2 csid, ub1 csfrm);
+
+sword OCILobWriteAppend(OCISvcCtx *svchp, OCIError *errhp, 
+                        OCILobLocator *lobp, ub4 *amtp, 
+                        dvoid *bufp, ub4 bufl, ub1 piece, dvoid *ctxp,
+                       sb4 (*cbfp)(dvoid *ctxp, dvoid *bufp, ub4 *len, 
+                       ub1 *piece), 
+                      ub2 csid, ub1 csfrm);
+
+sword   OCIBreak (dvoid *hndlp, OCIError *errhp);
+
+sword   OCIReset (dvoid *hndlp, OCIError *errhp);
+
+sword   OCIServerVersion  (dvoid *hndlp, OCIError *errhp, OraText *bufp, 
+                           ub4 bufsz,
+                           ub1 hndltype);
+
+sword   OCIServerRelease  (dvoid *hndlp, OCIError *errhp, OraText *bufp,
+                           ub4 bufsz,
+                           ub1 hndltype, ub4 *version);
+
+sword   OCIAttrGet (CONST dvoid *trgthndlp, ub4 trghndltyp, 
+                    dvoid *attributep, ub4 *sizep, ub4 attrtype, 
+                    OCIError *errhp);
+
+sword   OCIAttrSet (dvoid *trgthndlp, ub4 trghndltyp, dvoid *attributep,
+                    ub4 size, ub4 attrtype, OCIError *errhp);
+
+sword   OCISvcCtxToLda (OCISvcCtx *svchp, OCIError *errhp, Lda_Def *ldap);
+
+sword   OCILdaToSvcCtx (OCISvcCtx **svchpp, OCIError *errhp, Lda_Def *ldap);
+
+sword   OCIResultSetToStmt (OCIResult *rsetdp, OCIError *errhp);
+
+sword OCIFileClose ( dvoid  *hndl, OCIError *err, OCIFileObject *filep );
+
+sword	OCIUserCallbackRegister(dvoid *hndlp, ub4 type, dvoid *ehndlp,
+                                    OCIUserCallback callback, dvoid *ctxp,
+                                    ub4 fcode, ub4 when, OCIUcb *ucbDesc);
+
+sword	OCIUserCallbackGet(dvoid *hndlp, ub4 type, dvoid *ehndlp,
+                               ub4 fcode, ub4 when, OCIUserCallback *callbackp,
+                               dvoid **ctxpp, OCIUcb *ucbDesc);
+
+sword   OCISharedLibInit(dvoid *metaCtx, dvoid *libCtx, ub4 argfmt, sword argc,
+                         dvoid *argv[], OCIEnvCallbackType envCallback);
+
+sword OCIFileExists ( dvoid  *hndl, OCIError *err, OraText *filename,
+                     OraText *path, ub1 *flag  );
+
+sword OCIFileFlush( dvoid *hndl, OCIError *err, OCIFileObject *filep  );
+
+
+sword OCIFileGetLength( dvoid *hndl, OCIError *err, OraText *filename,
+                        OraText *path, ubig_ora *lenp  );
+
+sword OCIFileInit ( dvoid *hndl, OCIError *err );
+
+sword OCIFileOpen ( dvoid *hndl, OCIError *err, OCIFileObject **filep,
+                    OraText *filename, OraText *path, ub4 mode, ub4 create, 
+                    ub4 type );
+
+sword OCIFileRead ( dvoid *hndl, OCIError *err, OCIFileObject *filep,
+                    dvoid *bufp, ub4 bufl, ub4 *bytesread );
+
+sword OCIFileSeek ( dvoid *hndl, OCIError *err, OCIFileObject *filep,
+                     uword origin, ubig_ora offset, sb1 dir );
+
+sword OCIFileTerm ( dvoid *hndl, OCIError *err );
+
+
+sword OCIFileWrite ( dvoid *hndl, OCIError *err, OCIFileObject   *filep,
+                     dvoid *bufp, ub4 buflen, ub4 *byteswritten );
+
+
+/*
+ ** Initialize the security package
+ */
+sword   OCISecurityInitialize (OCISecurity *sechandle, OCIError *error_handle);
+
+sword   OCISecurityTerminate (OCISecurity *sechandle, OCIError *error_handle);
+
+sword OCISecurityOpenWallet(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            size_t wrllen,
+                            OraText *wallet_resource_locator,
+                            size_t pwdlen,
+                            OraText *password,
+                            nzttWallet *wallet);
+
+sword OCISecurityCloseWallet(OCISecurity *osshandle,
+                             OCIError *error_handle,
+                             nzttWallet *wallet);
+
+sword OCISecurityCreateWallet(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              size_t wrllen,
+                              OraText *wallet_resource_locator,
+                              size_t pwdlen,
+                              OraText *password,
+                              nzttWallet *wallet);
+
+sword OCISecurityDestroyWallet(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               size_t wrllen,
+                               OraText *wallet_resource_locator,
+                               size_t pwdlen,
+                               OraText *password);
+
+sword OCISecurityStorePersona(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              nzttPersona **persona,
+                              nzttWallet *wallet);
+
+sword OCISecurityOpenPersona(OCISecurity *osshandle,
+                             OCIError *error_handle,
+                             nzttPersona *persona);
+
+sword OCISecurityClosePersona(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              nzttPersona *persona);
+
+sword OCISecurityRemovePersona(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttPersona **persona);
+
+sword OCISecurityCreatePersona(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttIdentType identity_type,
+                               nzttCipherType cipher_type,
+                               nzttPersonaDesc *desc,
+                               nzttPersona **persona);
+
+sword OCISecuritySetProtection(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttPersona *persona,
+                               nzttcef crypto_engine_function,
+                               nztttdufmt data_unit_format,
+                               nzttProtInfo *protection_info);
+
+sword OCISecurityGetProtection(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttPersona *persona,
+                               nzttcef crypto_engine_function,
+                               nztttdufmt * data_unit_format_ptr,
+                               nzttProtInfo *protection_info);
+
+sword OCISecurityRemoveIdentity(OCISecurity *osshandle,
+                                OCIError *error_handle,
+                                nzttIdentity **identity_ptr);
+
+sword OCISecurityCreateIdentity(OCISecurity *osshandle,
+                                OCIError *error_handle,
+                                nzttIdentType type,
+                                nzttIdentityDesc *desc,
+                                nzttIdentity **identity_ptr);
+
+sword OCISecurityAbortIdentity(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttIdentity **identity_ptr);
+
+sword OCISecurityFreeIdentity(OCISecurity *osshandle,
+			      OCIError *error_handle,
+			      nzttIdentity **identity_ptr);
+
+
+sword OCISecurityStoreTrustedIdentity(OCISecurity *osshandle,
+                                      OCIError *error_handle,
+                                      nzttIdentity **identity_ptr,
+                                      nzttPersona *persona);
+
+sword OCISecuritySign(OCISecurity *osshandle,
+                      OCIError *error_handle,
+                      nzttPersona *persona,
+                      nzttces signature_state,
+                      size_t input_length,
+                      ub1 *input,
+                      nzttBufferBlock *buffer_block);
+
+sword OCISecuritySignExpansion(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttPersona *persona,
+                               size_t inputlen,
+                               size_t *signature_length);
+
+sword OCISecurityVerify(OCISecurity *osshandle,
+                        OCIError *error_handle,
+                        nzttPersona *persona,
+                        nzttces signature_state,
+                        size_t siglen,
+                        ub1 *signature,
+                        nzttBufferBlock *extracted_message,
+                        boolean *verified,
+                        boolean *validated,
+                        nzttIdentity **signing_party_identity);
+
+sword OCISecurityValidate(OCISecurity *osshandle,
+                          OCIError *error_handle,
+                          nzttPersona *persona,
+                          nzttIdentity *sidentity,
+                          boolean *validated);
+
+sword OCISecuritySignDetached(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              nzttPersona *persona,
+                              nzttces signature_state,
+                              size_t input_length,
+                              ub1 * input,
+                              nzttBufferBlock *signature);
+
+sword OCISecuritySignDetExpansion(OCISecurity *osshandle,
+                                  OCIError *error_handle,
+                                  nzttPersona *persona,
+                                  size_t input_length,
+                                  size_t *required_buffer_length);
+
+sword OCISecurityVerifyDetached(OCISecurity *osshandle,
+                                OCIError *error_handle,
+                                nzttPersona *persona,
+                                nzttces signature_state,
+                                size_t data_length,
+                                ub1 *data,
+                                size_t siglen,
+                                ub1 *signature,
+                                boolean *verified,
+                                boolean *validated,
+                                nzttIdentity **signing_party_identity);
+
+sword OCISecurity_PKEncrypt(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            nzttPersona *persona,
+                            size_t number_of_recipients,
+                            nzttIdentity *recipient_list,
+                            nzttces encryption_state,
+                            size_t input_length,
+                            ub1 *input,
+                            nzttBufferBlock *encrypted_data);
+
+sword OCISecurityPKEncryptExpansion(OCISecurity *osshandle,
+                                    OCIError *error_handle,
+                                    nzttPersona *persona,
+                                    size_t number_recipients,
+                                    size_t input_length,
+                                    size_t *buffer_length_required);
+
+sword OCISecurityPKDecrypt(OCISecurity *osshandle,
+                           OCIError *error_handle,
+                           nzttPersona *persona,
+                           nzttces encryption_state,
+                           size_t input_length,
+                           ub1 *input,
+                           nzttBufferBlock *encrypted_data);
+
+sword OCISecurityEncrypt(OCISecurity *osshandle,
+                         OCIError *error_handle,
+                         nzttPersona *persona,
+                         nzttces encryption_state,
+                         size_t input_length,
+                         ub1 *input,
+                         nzttBufferBlock *encrypted_data);
+
+sword OCISecurityEncryptExpansion(OCISecurity *osshandle,
+                                  OCIError *error_handle,
+                                  nzttPersona *persona,
+                                  size_t input_length,
+                                  size_t *encrypted_data_length);
+
+sword OCISecurityDecrypt(OCISecurity *osshandle,
+                         OCIError *error_handle,
+                         nzttPersona *persona,
+                         nzttces decryption_state,
+                         size_t input_length,
+                         ub1 *input,
+                         nzttBufferBlock *decrypted_data);
+
+sword OCISecurityEnvelope(OCISecurity *osshandle,
+                          OCIError *error_handle,
+                          nzttPersona *persona,
+                          size_t number_of_recipients,
+                          nzttIdentity *sidentity,
+                          nzttces encryption_state,
+                          size_t input_length,
+                          ub1 *input,
+                          nzttBufferBlock *enveloped_data);
+
+sword OCISecurityDeEnvelope(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            nzttPersona *persona,
+                            nzttces decryption_state,
+                            size_t input_length,
+                            ub1 *input,
+                            nzttBufferBlock *output_message,
+                            boolean *verified,
+                            boolean *validated,
+                            nzttIdentity **sender_identity);
+
+sword OCISecurityKeyedHash(OCISecurity *osshandle,
+                           OCIError *error_handle,
+                           nzttPersona *persona,
+                           nzttces hash_state,
+                           size_t input_length,
+                           ub1 *input,
+                           nzttBufferBlock *keyed_hash);
+
+sword OCISecurityKeyedHashExpansion(OCISecurity *osshandle,
+                                    OCIError *error_handle,
+                                    nzttPersona *persona,
+                                    size_t input_length,
+                                    size_t *required_buffer_length);
+
+sword OCISecurityHash(OCISecurity *osshandle,
+                      OCIError *error_handle,
+                      nzttPersona *persona,
+                      nzttces hash_state,
+                      size_t input,
+                      ub1 *input_length,
+                      nzttBufferBlock *shash);
+
+sword OCISecurityHashExpansion(OCISecurity *osshandle,
+                               OCIError *error_handle,
+                               nzttPersona *persona,
+                               size_t input_length,
+                               size_t *required_buffer_length);
+
+sword OCISecuritySeedRandom(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            nzttPersona *persona,
+                            size_t seed_length,
+                            ub1 *seed);
+
+sword OCISecurityRandomBytes(OCISecurity *osshandle,
+                             OCIError *error_handle,
+                             nzttPersona *persona,
+                             size_t number_of_bytes_desired,
+                             nzttBufferBlock *random_bytes);
+
+sword OCISecurityRandomNumber(OCISecurity *osshandle,
+                              OCIError *error_handle,
+                              nzttPersona *persona,
+                              uword *random_number_ptr);
+
+sword OCISecurityInitBlock(OCISecurity *osshandle,
+                           OCIError *error_handle,
+                           nzttBufferBlock *buffer_block);
+
+sword OCISecurityReuseBlock(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            nzttBufferBlock *buffer_block);
+
+sword OCISecurityPurgeBlock(OCISecurity *osshandle,
+                            OCIError *error_handle,
+                            nzttBufferBlock *buffer_block);
+
+sword OCISecuritySetBlock(OCISecurity *osshandle,
+                          OCIError *error_handle,
+                          uword flags_to_set,
+                          size_t buffer_length,
+                          size_t used_buffer_length,
+                          ub1 *buffer,
+                          nzttBufferBlock *buffer_block);
+
+sword OCISecurityGetIdentity(OCISecurity   *osshandle,
+                             OCIError      *error_handle,
+                             size_t         namelen,
+                             OraText          *distinguished_name,
+                             nzttIdentity **sidentity);
+
+sword OCIAQEnq(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
+		 OCIAQEnqOptions *enqopt, OCIAQMsgProperties *msgprop,
+		 OCIType *payload_tdo, dvoid **payload, dvoid **payload_ind, 
+		 OCIRaw **msgid, ub4 flags); 
+
+sword OCIAQDeq(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
+		 OCIAQDeqOptions *deqopt, OCIAQMsgProperties *msgprop,
+		 OCIType *payload_tdo, dvoid **payload, dvoid **payload_ind, 
+		 OCIRaw **msgid, ub4 flags); 
+
+sword OCIAQListen(/*_ OCISvcCtx *svchp, OCIError *errhp, 
+		      OCIAQAgent **agent_list, ub4 num_agents,
+		      sb4 wait, OCIAQAgent **agent,
+		      ub4 flags _*/);
+
+sword OCIExtractInit(dvoid *hndl, OCIError *err);
+
+sword OCIExtractTerm(dvoid *hndl, OCIError *err);
+
+sword OCIExtractReset(dvoid *hndl, OCIError *err);
+
+sword OCIExtractSetNumKeys(dvoid *hndl, OCIError *err, uword numkeys);
+
+sword OCIExtractSetKey(dvoid *hndl, OCIError *err, CONST OraText *name, 
+                       ub1 type, ub4 flag, CONST dvoid *defval, 
+                       CONST sb4 *intrange, CONST OraText *CONST *strlist);
+
+sword OCIExtractFromFile(dvoid *hndl, OCIError *err, ub4 flag, 
+                         OraText *filename);
+
+sword OCIExtractFromStr(dvoid *hndl, OCIError *err, ub4 flag, OraText *input);
+
+sword OCIExtractToInt(dvoid *hndl, OCIError *err, OraText *keyname, 
+                      uword valno, sb4 *retval);
+
+sword OCIExtractToBool(dvoid *hndl, OCIError *err, OraText *keyname, 
+                       uword valno, ub1 *retval);
+
+sword OCIExtractToStr(dvoid *hndl, OCIError *err, OraText *keyname, 
+                      uword valno, OraText *retval, uword buflen);
+
+sword OCIExtractToOCINum(dvoid *hndl, OCIError *err, OraText *keyname, 
+                         uword valno, OCINumber *retval);
+
+sword OCIExtractToList(dvoid *hndl, OCIError *err, uword *numkeys);
+
+sword OCIExtractFromList(dvoid *hndl, OCIError *err, uword index, 
+			 OraText **name, 
+                         ub1 *type, uword *numvals, dvoid ***values);
+
+/* Memory Related Service Interfaces */
+
+sword OCIMemoryAlloc(dvoid *hdl, OCIError *err, dvoid **mem,
+	OCIDuration dur, ub4 size, ub4 flags);
+
+sword OCIMemoryResize(dvoid *hdl, OCIError *err, dvoid **mem,
+			ub4 newsize, ub4 flags);
+			
+sword OCIMemoryFree(dvoid *hdl, OCIError *err, dvoid *mem);
+
+sword OCIContextSetValue(dvoid *hdl, OCIError *err, OCIDuration duration,
+			ub1 *key, ub1 keylen, dvoid *ctx_value);
+
+sword OCIContextGetValue(dvoid *hdl, OCIError *err, ub1 *key,
+			ub1 keylen, dvoid **ctx_value);
+
+sword OCIContextClearValue(dvoid *hdl, OCIError *err, ub1 *key, 
+			ub1 keylen);
+
+sword OCIContextGenerateKey(dvoid *hdl, OCIError *err, ub4 *key);
+
+sword OCIMemorySetCurrentIDs(dvoid *hdl, OCIError *err, 
+	ub4 curr_session_id, ub4 curr_trans_id, ub4 curr_stmt_id);
+
+sword OCIPicklerTdsCtxInit(OCIEnv *env, OCIError *err, 
+                           OCIPicklerTdsCtx **tdsc);
+
+sword OCIPicklerTdsCtxFree(OCIEnv *env, OCIError *err, OCIPicklerTdsCtx *tdsc);
+
+sword OCIPicklerTdsInit(OCIEnv *env, OCIError *err, OCIPicklerTdsCtx *tdsc, 
+					OCIPicklerTds **tdsh);
+
+sword OCIPicklerTdsFree(OCIEnv *env, OCIError *err, OCIPicklerTds *tdsh);
+
+sword OCIPicklerTdsCreateElementNumber(OCIEnv *env, OCIError *err, 
+					OCIPicklerTds *tdsh, ub1 prec, 
+					sb1 scale, OCIPicklerTdsElement *elt);
+
+sword OCIPicklerTdsCreateElementChar(OCIEnv *env, OCIError *err, 
+				     OCIPicklerTds *tdsh, ub2 len, 
+				     OCIPicklerTdsElement *elt);
+
+sword OCIPicklerTdsCreateElementVarchar(OCIEnv *env, OCIError *err, 
+                                        OCIPicklerTds *tdsh, ub2 len, 
+                                        OCIPicklerTdsElement *elt);
+
+sword OCIPicklerTdsCreateElementRaw(OCIEnv *env, OCIError *err, 
+                                    OCIPicklerTds *tdsh, ub2 len, 
+                                    OCIPicklerTdsElement *elt);
+
+sword OCIPicklerTdsCreateElement(OCIEnv *env, OCIError *err, 
+                                 OCIPicklerTds *tdsh, OCITypeCode dty, 
+                                 OCIPicklerTdsElement *elt);
+
+sword OCIPicklerTdsAddAttr(OCIEnv *env, OCIError *err, 
+                           OCIPicklerTds *tdsh, OCIPicklerTdsElement elt);
+
+sword OCIPicklerTdsGenerate(OCIEnv *env, OCIError *err, 
+				OCIPicklerTds *tdsh);
+
+sword OCIPicklerTdsGetAttr(OCIEnv *env, OCIError *err, 
+				CONST OCIPicklerTds *tdsh, ub1  attrno,
+				OCITypeCode *typ, ub2  *len);
+
+sword OCIPicklerFdoInit(OCIEnv *env, OCIError *err, 
+				OCIPicklerFdo **fdoh);
+
+sword OCIPicklerFdoFree(OCIEnv *env, OCIError *err, 
+				OCIPicklerFdo *fdoh);
+
+sword OCIPicklerImageInit(OCIEnv *env, OCIError *err, 
+                          OCIPicklerFdo *fdoh, 
+                          OCIPicklerTds *tdsh,
+			  OCIPicklerImage **imgh);
+
+sword OCIPicklerImageFree(OCIEnv *env, OCIError *err, 
+				OCIPicklerImage *imgh);
+ 
+sword OCIPicklerImageAddScalar(OCIEnv *env, OCIError *err,  
+                               OCIPicklerImage *imgh, dvoid *scalar, ub4  len);
+ 
+sword OCIPicklerImageAddNullScalar(OCIEnv *env, OCIError *err, 
+				OCIPicklerImage *imgh);
+ 
+sword OCIPicklerImageGenerate(OCIEnv *env, OCIError *err, 
+				OCIPicklerImage *imgh);
+ 
+sword OCIPicklerImageGetScalarSize(OCIEnv *env, OCIError *err, 
+				OCIPicklerImage *imgh, 
+				ub4  attrno, ub4  *size);
+ 
+sword OCIPicklerImageGetScalar(OCIEnv *env, OCIError *err, 
+				OCIPicklerImage *imgh, ub4  attrno, 
+				dvoid *buf, ub4  *len, OCIInd *ind);
+
+sword OCIPicklerImageCollBegin(OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh, CONST OCIPicklerTds *colltdsh);
+ 
+sword OCIPicklerImageCollAddScalar( OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh, dvoid *scalar,
+                ub4 buflen, OCIInd ind);
+ 
+sword OCIPicklerImageCollEnd(OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh);
+ 
+/* should take svcctx for locator stuff */
+sword OCIPicklerImageCollBeginScan(OCIEnv *env, OCIError *err,
+                OCIPicklerImage *imgh, CONST OCIPicklerTds *coll_tdsh,
+                ub4 attrnum, ub4 startidx, OCIInd *ind);
+ 
+sword OCIPicklerImageCollGetScalarSize(OCIEnv *env, OCIError *err,
+                CONST OCIPicklerTds *coll_tdsh, ub4 *size);
+ 
+sword OCIPicklerImageCollGetScalar(OCIEnv *env, OCIError *err,
+                                   OCIPicklerImage *imgh, dvoid *buf,
+                                   ub4 *buflen, OCIInd *ind);
+
+sword OCIAnyDataGetType(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        OCITypeCode *tc, OCIType **type);
+
+sword OCIAnyDataIsNull(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        boolean *isnull);
+
+sword OCIAnyDataConvert(OCISvcCtx *svchp, OCIError *errhp, OCITypeCode tc,
+        OCIType *type, OCIDuration dur, dvoid *ind, dvoid *data_val,
+        ub4 len, OCIAnyData **sdata);
+
+sword OCIAnyDataBeginCreate(OCISvcCtx *svchp, OCIError *errhp, OCITypeCode tc,
+        OCIType *type, OCIDuration dur, OCIAnyData **sdata);
+
+sword OCIAnyDataDestroy(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata);
+
+sword OCIAnyDataAttrSet(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        OCITypeCode tc, OCIType *type, dvoid *ind, dvoid *attr_val,
+        ub4 length, boolean is_any);
+
+sword OCIAnyDataCollAddElem(OCISvcCtx *svchp, OCIError *errhp,
+        OCIAnyData *sdata, OCITypeCode tc, OCIType *type, dvoid *ind,
+        dvoid *attr_val, ub4 length, boolean is_any, boolean last_elem);
+
+sword OCIAnyDataEndCreate(OCISvcCtx *svchp, OCIError *errhp,
+                          OCIAnyData *sdata);
+
+sword OCIAnyDataAccess(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+        OCITypeCode tc, OCIType *type, dvoid *ind, dvoid *attr_val,
+        ub4 *length);
+
+sword OCIAnyDataGetCurrAttrNum(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+			ub4 *attrnum);
+
+sword OCIAnyDataAttrGet(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
+  OCITypeCode tc, OCIType *type, dvoid *ind, dvoid *attr_val,
+        ub4 *length, boolean is_any);
+
+sword OCIAnyDataCollGetElem(OCISvcCtx *svchp, OCIError *errhp,
+  OCIAnyData *sdata,
+  OCITypeCode tc, OCIType *type, dvoid *ind, dvoid *celem_val,
+  ub4 *length, boolean is_any);
+
+
+/*------------------------ OCIAnyDataSet interfaces -------------------------*/
+
+/*
+   NAME
+     OCIAnyDataSetBeginCreate - OCIAnyDataSet Begin Creation
+   PARAMETERS
+     svchp (IN/OUT) - The OCI service context.
+     errhp (IN/OUT) - The OCI error handle. If there is an error, it is
+                      recorded in errhp and this function returns OCI_ERROR.
+                      Diagnostic information can be obtained by calling
+                      OCIErrorGet().
+     typecode       - typecode corresponding to the OCIAnyDataSet.
+     type (IN)      - type corresponding to the OCIAnyDataSet. If the typecode
+                      corresponds to a built-in type (OCI_TYPECODE_NUMBER etc.)
+                      , this parameter can be NULL. It should be non NULL for
+                      user defined types (OCI_TYPECODE_OBJECT,
+                      OCI_TYPECODE_REF, collection types etc.)
+     dur (IN)       - duration for which OCIAnyDataSet is allocated.
+     data_set (OUT) - Initialized OCIAnyDataSet.
+     RETURNS        - error code
+   NOTES
+     This call allocates an OCIAnyDataSet for the duration of dur and
+     initializes it with the type information. The OCIAnyDataSet can hold
+     multiple instances of the given type. For performance reasons, the 
+     OCIAnyDataSet will end up pointing to the passed in OCIType parameter.
+     It is the responsibility of the caller to ensure that the OCIType is
+     longer lived (has allocation duration >= the duration of the OCIAnyData
+     if the OCIType is a transient one, allocation/pin duration >= duration of
+     the OCIAnyData if the OCIType is a persistent one).
+
+*/
+sword OCIAnyDataSetBeginCreate(OCISvcCtx *svchp, OCIError *errhp,
+     OCITypeCode typecode, CONST OCIType *type, OCIDuration dur,
+     OCIAnyDataSet ** data_set);
+
+/*
+   NAME
+     OCIAnyDataSetDestroy  - OCIAnyDataSet Destroy
+   DESCRIPTION
+     This call frees the OCIAnyDataSet allocated using
+     OCIAnyDataSetBeginCreate().
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)    - The OCI service context.
+     errhp (IN/OUT)    - The OCI Error handle.
+     data_set (IN/OUT) - OCIAnyDataSet to be freed.
+*/
+sword OCIAnyDataSetDestroy(OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set);
+
+
+/*
+   NAME
+     OCIAnyDataSetAddInstance - OCIAnyDataSet Add an instance
+   DESCRIPTION
+     This call adds a new skeleton instance to the OCIAnyDataSet and all the
+     attributes of the instance are set to NULL. It returns this skeleton
+     instance through the OCIAnyData parameter which can be constructed
+     subsequently by invoking the OCIAnyData API.
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)      - The OCI service context.
+     errhp (IN/OUT)      - The OCI Error handle.
+     data_set (IN/OUT)   - OCIAnyDataSet to which a new instance is added.
+     data (IN/OUT)       - OCIAnyData corresponding to the newly added
+                           instance. If (*data) is NULL, a new OCIAnyData will
+                           be allocated for same duration as the OCIAnyDataSet.
+                           If (*data) is not NULL, it will get reused. This
+                           OCIAnyData can be subseqently constructed using the
+                           OCIAnyDataConvert() call or it can be constructed
+                           piece-wise using the OCIAnyDataAttrSet and
+                           OCIAnyDataCollAddElem calls.
+   NOTES
+     No Destruction of the old value is done here. It is the responsibility of
+     the caller to destroy the old value pointed to by (*data) and set (*data)
+     to a null pointer before beginning to make a sequence of this call. No
+     deep copying (of OCIType information nor the data part.) is done in the
+     returned OCIAnyData. This OCIAnyData cannot be used beyond the allocation
+     duration of the OCIAnyDataSet (it is like a reference into the
+     OCIAnyDataSet). The returned OCIAnyData can be reused on subsequent calls
+     to this function, to sequentially add new data instances to the
+     OCIAnyDataSet.
+*/
+sword OCIAnyDataSetAddInstance(OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, OCIAnyData **data);
+
+/*
+   NAME
+     OCIAnyDataSetEndCreate - OCIAnyDataSet End Creation process.
+   DESCRIPTION
+     This call marks the end of OCIAnyDataSet creation. It should be called
+     after constructing all of its instance(s).
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)        - The OCI service context.
+     errhp (IN/OUT)        - The OCI error handle. If there is an error, it is
+                             recorded in errhp and this function returns
+                             OCI_ERROR. Diagnostic information can be obtained
+                             by calling OCIErrorGet().
+     data_set (IN/OUT)     - OCIAnyDataSet that has been fully constructed.
+*/
+sword OCIAnyDataSetEndCreate(OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set);
+
+/*
+   NAME
+     OCIAnyDataSetGetType - OCIAnyDataSet Get Type of an OCIAnyDataSet
+   DESCRIPTION
+     Gets the Type corresponding to an OCIAnyDataSet. It returns the actual
+     pointer to the type maintained inside an OCIAnyDataSet. No copying is
+     done for performance reasons. The client is responsible for not using
+     this type once the OCIAnyDataSet is freed (or its duration ends).
+   RETURNS
+     error code.
+   PARAMETERS
+     svchp (IN/OUT)      - The OCI service context.
+     errhp (IN/OUT)      - The OCI Error handle.
+     data_set (IN)       - Initialized OCIAnyDataSet.
+     tc (OUT)            - The typecode of the type.
+     type (OUT)          - The type corresponding to the OCIAnyDataSet. This
+                           could be null if the OCIAnyData corresponds to a
+                           built-in type.
+*/
+sword OCIAnyDataSetGetType (OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, OCITypeCode *tc, OCIType **type);
+
+/*
+  NAME
+    OCIAnyDataSetGetCount - OCIAnyDataSet Get Count of instances.
+  DESCRIPTION
+    This call gets the number of instances in the OCIAnyDataSet.
+  RETURNS
+    error code.
+  PARAMETERS
+    svchp (IN/OUT)      - OCI Service Context
+    errhp (IN/OUT)      - OCI Error handle
+    data_set (IN)       - Well formed OCIAnyDataSet.
+    count (OUT)         - number of instances in OCIAnyDataSet
+*/
+sword OCIAnyDataSetGetCount(OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, ub4 *count);
+
+/*
+  NAME
+    OCIAnyDataSetGetInstance - OCIAnyDataSet Get next instance.
+  DESCRIPTION
+    Only sequential access to the instances in an OCIAnyDataSet is allowed.
+    This call returns the OCIAnyData corresponding to an instance at the
+    current position and updates the current position. Subsequently, the
+    OCIAnyData access routines may be used to access the instance.
+  RETURNS
+    error code. Returns OCI_NO_DATA if the current position is at the end of
+    the set, OCI_SUCCESS otherwise.
+  PARAMETERS
+    svchp (IN/OUT)      - OCI Service Context
+    errhp (IN/OUT)      - OCI Error handle
+    data_set (IN)       - Well formed OCIAnyDataSet
+    data (IN/OUT)       - OCIAnyData corresponding to the instance. If (*data)
+                          is NULL, a new OCIAnyData will be allocated for same
+                          duration as the OCIAnyDataSet. If (*data) is not NULL
+                          , it will get reused. This OCIAnyData can be
+                          subsequently accessed using the OCIAnyDataAccess()
+                          call or piece-wise by using the OCIAnyDataAttrGet()
+                          call.
+  NOTE
+    No Destruction of the old value is done here. It is the responsibility of
+    the caller to destroy the old value pointed to by (*data) and set (*data)
+    to a null pointer before beginning to make a sequence of this call. No deep
+    copying (of OCIType information nor the data part.) is done in the returned
+    OCIAnyData. This OCIAnyData cannot be used beyond the allocation duration
+    of the OCIAnyDataSet (it is like a reference into the OCIAnyDataSet). The
+    returned OCIAnyData can be reused on subsequent calls to this function to
+    sequentially access the OCIAnyDataSet.
+*/
+sword OCIAnyDataSetGetInstance(OCISvcCtx *svchp, OCIError *errhp,
+     OCIAnyDataSet *data_set, OCIAnyData **data);
+
+/*--------------------- End of OCIAnyDataSet interfaces ---------------------*/
+
+sword OCIFormatInit(dvoid *hndl, OCIError *err);
+
+sword OCIFormatString(dvoid *hndl, OCIError *err, OraText *buffer,
+                      sbig_ora bufferLength, sbig_ora *returnLength,
+                      CONST OraText *formatString, ...);
+
+sword OCIFormatTerm(dvoid *hndl, OCIError *err);
+
+sword OCIFormatTUb1(void);
+sword OCIFormatTUb2(void);
+sword OCIFormatTUb4(void);
+sword OCIFormatTUword(void);
+sword OCIFormatTUbig_ora(void);
+sword OCIFormatTSb1(void);
+sword OCIFormatTSb2(void);
+sword OCIFormatTSb4(void);
+sword OCIFormatTSword(void);
+sword OCIFormatTSbig_ora(void);
+sword OCIFormatTEb1(void);
+sword OCIFormatTEb2(void);
+sword OCIFormatTEb4(void);
+sword OCIFormatTEword(void);
+sword OCIFormatTChar(void);
+sword OCIFormatTText(void);
+sword OCIFormatTDouble(void);
+sword OCIFormatTDvoid(void);
+sword OCIFormatTEnd(void);
+
+/*-------------------------- Extensions to XA interface ---------------------*/
+/* ------------------------- xaosvch ----------------------------------------*/
+/*
+   NAME
+     xaosvch  -  XA Oracle get SerViCe Handle
+   DESCRIPTION
+     Given a database name return the service handle that is used by the
+     XA library
+   NOTE
+     This macro has been provided for backward compatibilty with 8.0.2
+*/
+OCISvcCtx *xaosvch(OraText *dbname);
+
+/* ------------------------- xaoSvcCtx --------------------------------------*/
+/*
+   NAME
+     xaoSvcCtx  -  XA Oracle get SerViCe ConTeXt
+   DESCRIPTION
+     Given a database name return the service handle that is used by the
+     XA library
+   NOTE
+     This routine has been provided for APs to get access to the service
+     handle that XA library uses. Without this routine APs must use SQLLIB
+     routine sqlld2 to get access to the Logon data area registered by the
+     XA library
+*/
+OCISvcCtx *xaoSvcCtx(OraText *dbname);
+
+/* ------------------------- xaoEnv -----------------------------------------*/
+/*
+   NAME
+     xaoEnv  -  XA Oracle get ENvironment Handle
+   DESCRIPTION
+     Given a database name return the environment handle that is used by the
+     XA library
+   NOTE
+     This routine has been provided for APs to get access to the environment
+     handle that XA library uses. Without this routine APs must use SQLLIB
+     routine sqlld2 to get access to the Logon data area registered by the
+     XA library
+*/
+OCIEnv *xaoEnv(OraText *dbname);
+
+/* ------------------------- xaosterr ---------------------------------------*/
+/*
+   NAME
+     xaosterr  -  XA Oracle get xa STart ERRor code
+   DESCRIPTION
+     Given an oracle error code return the XA error code
+ */
+int xaosterr(OCISvcCtx *svch, sb4 error);
+/*-------------------------- End Extensions ---------------------------------*/
+/*---------------------- Extensions to NLS cartridge service ----------------*/
+/* ----------------------- OCINlsGetInfo ------------------------------------*/
+/*
+   NAME
+     OCINlsGetInfo - Get NLS info from OCI environment handle
+   REMARKS
+     This function generates language information specified by item from OCI 
+     environment handle envhp into an array pointed to by buf within size 
+     limitation as buflen.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR on wrong item.
+   envhp(IN/OUT)
+     OCI environment handle.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and 
+     this function returns a NULL pointer. Diagnostic information can be 
+     obtained by calling OCIErrorGet().
+   buf(OUT)
+     Pointer to the destination buffer.
+   buflen(IN)
+     The size of destination buffer. The maximum length for each information
+     is 32 bytes.
+   item(IN)
+     It specifies to get which item in OCI environment handle and can be one
+     of following values:
+       OCI_NLS_DAYNAME1 : Native name for Monday.
+       OCI_NLS_DAYNAME2 : Native name for Tuesday.
+       OCI_NLS_DAYNAME3 : Native name for Wednesday.
+       OCI_NLS_DAYNAME4 : Native name for Thursday.
+       OCI_NLS_DAYNAME5 : Native name for Friday.
+       OCI_NLS_DAYNAME6 : Native name for for Saturday.
+       OCI_NLS_DAYNAME7 : Native name for for Sunday.
+       OCI_NLS_ABDAYNAME1 : Native abbreviated name for Monday.
+       OCI_NLS_ABDAYNAME2 : Native abbreviated name for Tuesday.
+       OCI_NLS_ABDAYNAME3 : Native abbreviated name for Wednesday.
+       OCI_NLS_ABDAYNAME4 : Native abbreviated name for Thursday.
+       OCI_NLS_ABDAYNAME5 : Native abbreviated name for Friday.
+       OCI_NLS_ABDAYNAME6 : Native abbreviated name for for Saturday.
+       OCI_NLS_ABDAYNAME7 : Native abbreviated name for for Sunday.
+       OCI_NLS_MONTHNAME1 : Native name for January.
+       OCI_NLS_MONTHNAME2 : Native name for February.
+       OCI_NLS_MONTHNAME3 : Native name for March.
+       OCI_NLS_MONTHNAME4 : Native name for April.
+       OCI_NLS_MONTHNAME5 : Native name for May.
+       OCI_NLS_MONTHNAME6 : Native name for June.
+       OCI_NLS_MONTHNAME7 : Native name for July.
+       OCI_NLS_MONTHNAME8 : Native name for August.
+       OCI_NLS_MONTHNAME9 : Native name for September.
+       OCI_NLS_MONTHNAME10 : Native name for October.
+       OCI_NLS_MONTHNAME11 : Native name for November.
+       OCI_NLS_MONTHNAME12 : Native name for December.
+       OCI_NLS_ABMONTHNAME1 : Native abbreviated name for January.
+       OCI_NLS_ABMONTHNAME2 : Native abbreviated name for February.
+       OCI_NLS_ABMONTHNAME3 : Native abbreviated name for March.
+       OCI_NLS_ABMONTHNAME4 : Native abbreviated name for April.
+       OCI_NLS_ABMONTHNAME5 : Native abbreviated name for May.
+       OCI_NLS_ABMONTHNAME6 : Native abbreviated name for June.
+       OCI_NLS_ABMONTHNAME7 : Native abbreviated name for July.
+       OCI_NLS_ABMONTHNAME8 : Native abbreviated name for August.
+       OCI_NLS_ABMONTHNAME9 : Native abbreviated name for September.
+       OCI_NLS_ABMONTHNAME10 : Native abbreviated name for October.
+       OCI_NLS_ABMONTHNAME11 : Native abbreviated name for November.
+       OCI_NLS_ABMONTHNAME12 : Native abbreviated name for December.
+       OCI_NLS_YES : Native string for affirmative response.
+       OCI_NLS_NO : Native negative response. 
+       OCI_NLS_AM : Native equivalent string of AM.
+       OCI_NLS_PM : Native equivalent string of PM.
+       OCI_NLS_AD : Native equivalent string of AD.
+       OCI_NLS_BC : Native equivalent string of BC.
+       OCI_NLS_DECIMAL : decimal character.
+       OCI_NLS_GROUP : group separator.
+       OCI_NLS_DEBIT : Native symbol of debit.
+       OCI_NLS_CREDIT : Native sumbol of credit.
+       OCI_NLS_DATEFORMAT : Oracle date format.
+       OCI_NLS_INT_CURRENCY: International currency symbol.
+       OCI_NLS_LOC_CURRENCY : Locale currency symbol.
+       OCI_NLS_LANGUAGE : Language name.
+       OCI_NLS_ABLANGUAGE : Abbreviation for language name.
+       OCI_NLS_TERRITORY : Territory name.
+       OCI_NLS_CHARACTER_SET : Character set name.
+       OCI_NLS_LINGUISTIC : Linguistic name.
+       OCI_NLS_CALENDAR : Calendar name.
+       OCI_NLS_DUAL_CURRENCY : Dual currency symbol.
+*/
+sword OCINlsGetInfo(dvoid *envhp, OCIError *errhp, OraText *buf,
+                    size_t buflen, ub2 item);
+
+/* ----------------------- OCINlsNumericInfoGet -----------------------------*/
+/*
+   NAME
+     OCINlsNumericInfoGet - Get NLS numeric info from OCI environment handle
+   REMARKS
+     This function generates numeric language information specified by item 
+     from OCI environment handle envhp into an output number variable.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR on wrong item.
+   envhp(IN/OUT)
+     OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and 
+     this function returns a NULL pointer. Diagnostic information can be 
+     obtained by calling OCIErrorGet().
+   val(OUT)
+     Pointer to the output number variable. On OCI_SUCCESS return, it will
+     contain the requested NLS numeric info.
+   item(IN)
+     It specifies to get which item in OCI environment handle and can be one
+     of following values:
+       OCI_NLS_CHARSET_MAXBYTESZ : Maximum character byte size for OCI
+                                   environment or session handle charset
+       OCI_NLS_CHARSET_FIXEDWIDTH: Character byte size for fixed-width charset;
+                                   0 for variable-width charset 
+*/
+sword OCINlsNumericInfoGet(dvoid *envhp, OCIError *errhp, sb4 *val, ub2 item);
+
+/* ----------------------- OCINlsCharSetNameToId -----------------------------*/
+/*
+   NAME
+     OCINlsCharSetNameToId - Get Oracle charset id given Oracle charset name
+   REMARKS
+     This function will get the Oracle character set id corresponding to
+     the given Oracle character set name.
+   RETURNS
+     Oracle character set id for the given Oracle character set name if
+     character set name and OCI handle are valid; otherwise returns 0.
+   envhp(IN/OUT)
+     OCI environment handle.
+   name(IN)
+     Pointer to a null-terminated Oracle character set name whose id 
+     will be returned.
+*/
+ub2 OCINlsCharSetNameToId(dvoid *envhp, const oratext *name);
+
+/* ----------------------- OCINlsCharSetIdToName -----------------------------*/
+/*
+   NAME
+     OCINlsCharSetIdToName - Get Oracle charset name given Oracle charset id
+   REMARKS
+     This function will get the Oracle character set name corresponding to
+     the given Oracle character set id.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
+   buf(OUT)
+     Pointer to the destination buffer. On OCI_SUCCESS return, it will contain
+     the null-terminated string for character set name.
+   buflen(IN)
+     Size of destination buffer. Recommended size is OCI_NLS_MAXBUFSZ for
+     guarantee to store an Oracle character set name. If it's smaller than
+     the length of the character set name, the function will return OCI_ERROR.
+   id(IN)
+     Oracle character set id.
+*/
+sword OCINlsCharSetIdToName(dvoid *envhp, oratext *buf, size_t buflen, ub2 id);
+
+/* ----------------------- OCINlsNameMap ------------------------------------*/
+/*
+   NAME
+     OCINlsNameMap - Map NLS naming from Oracle to other standards and vice 
+                     versa
+   REMARKS
+     This function will map NLS naming from Oracle to other standards (such
+     as ISO, IANA) and vice versa.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
+   buf(OUT)
+     Pointer to the destination buffer. On OCI_SUCCESS return, it will 
+     contain null-terminated string for requested mapped name.
+   buflen(IN)
+     The size of destination buffer. Recommended size is OCI_NLS_MAXBUFSZ
+     for guarantee to store an NLS name. If it is smaller than the length
+     of the name, the function will return OCI_ERROR.
+   srcbuf(IN)
+     Pointer to null-terminated NLS name. If it is not a valid name in its
+     define scope, the function will return OCI_ERROR.
+   flag(IN)
+     It specifies name mapping direction and can take the following values:
+       OCI_NLS_CS_IANA_TO_ORA : Map character set name from IANA to Oracle
+       OCI_NLS_CS_ORA_TO_IANA : Map character set name from Oracle to IANA
+       OCI_NLS_LANG_ISO_TO_ORA : Map language name from ISO to Oracle
+       OCI_NLS_LANG_ORA_TO_ISO : Map language name from Oracle to ISO
+       OCI_NLS_TERR_ISO_TO_ORA : Map territory name from ISO to Oracle
+       OCI_NLS_TERR_ORA_TO_ISO : Map territory name from Oracle to ISO
+       OCI_NLS_TERR_ISO3_TO_ORA : Map territory name from 3-letter ISO
+                                  abbreviation to Oracle
+       OCI_NLS_TERR_ORA_TO_ISO3 : Map territory name from Oracle to 3-letter
+                                  ISO abbreviation
+*/
+sword OCINlsNameMap(dvoid *envhp, oratext *buf, size_t buflen,
+                    const oratext *srcbuf, ub4 flag);
+
+/* -------------------- OCIMultiByteToWideChar ------------------------------*/
+/*
+   NAME
+     OCIMultiByteToWideChar - Convert a null terminated multibyte string into 
+                              wchar
+   REMARKS
+     This routine converts an entire null-terminated string into the wchar 
+     format. The wchar output buffer will be null-terminated.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Destination buffer for wchar.
+   src (IN)
+     Source string to be converted.
+   rsize (OUT)
+     Number of characters converted including null-terminator.
+     If it is a NULL pointer, no number return
+*/
+sword OCIMultiByteToWideChar(dvoid *envhp, OCIWchar *dst, CONST OraText *src,
+                             size_t *rsize);
+
+
+/* --------------------- OCIMultiByteInSizeToWideChar -----------------------*/
+/*
+   NAME
+     OCIMultiByteInSizeToWideChar - Convert a mulitbyte string in length into
+                                    wchar
+   REMARKS
+     This routine converts part of string into the wchar format. It will
+     convert as many complete characters as it can until it reaches output
+     buffer size or input buffer size or it reaches a null-terminator in
+     source string. The output buffer will be null-terminated if space permits.
+     If dstsz is zero, this function will only return number of characters not
+     including ending null terminator for converted string.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Pointer to a destination buffer for wchar. It can be NULL pointer when
+     dstsz is zero.
+   dstsz(IN)
+     Destination buffer size in character. If it is zero, this function just
+     returns number of characters will be need for the conversion.
+   src (IN)
+     Source string to be converted.
+   srcsz(IN)
+     Length of source string in byte.
+   rsize(OUT)
+     Number of characters written into destination buffer, or number of
+     characters for converted string is dstsz is zero.
+     If it is NULL pointer, nothing to return.
+*/
+sword OCIMultiByteInSizeToWideChar(dvoid *envhp, OCIWchar *dst,
+                                  size_t dstsz, CONST OraText *src, 
+                                  size_t srcsz, size_t *rsize);
+
+
+/* ---------------------- OCIWideCharToMultiByte ----------------------------*/
+/*
+   NAME
+     OCIWideCharToMultiByte - Convert a null terminated wchar string into
+                              multibyte
+   REMARKS
+     This routine converts an entire null-terminated wide character string into
+     multi-byte string. The output buffer will be null-terminated.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Destination buffer for multi-byte string.
+   src (IN)
+     Source wchar string to be converted.
+   rsize (OUT)
+     Number of bytes written into the destination buffer.
+     If it is NULL pointer, nothing to return.
+*/
+sword OCIWideCharToMultiByte(dvoid *envhp, OraText *dst, CONST OCIWchar *src,
+                             size_t *rsize);
+
+
+/* ---------------------- OCIWideCharInSizeToMultiByte ----------------------*/
+/*
+   NAME
+     OCIWideCharInSizeToMultiByte - Convert a wchar string in length into 
+                                    mulitbyte
+   REMARKS
+     This routine converts part of wchar string into the multi-byte format.
+     It will convert as many complete characters as it can until it reaches
+     output buffer size or input buffer size or it reaches a null-terminator
+     in source string. The output buffer will be null-terminated if space
+     permits. If dstsz is zero, the function just returns the size of byte not 
+     including ending null-terminator need to store the converted string.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set of string.
+   dst (OUT)
+     Destination buffer for multi-byte. It can be NULL pointer if dstsz is
+     zero.
+   dstsz(IN)
+     Destination buffer size in byte. If it is zero, it just returns the size
+     of bytes need for converted string.
+   src (IN)
+     Source wchar string to be converted.
+   srcsz(IN)
+     Length of source string in character.
+   rsize(OUT)
+     Number of bytes written into destination buffer, or number of bytes need
+     to store the converted string if dstsz is zero.
+     If it is NULL pointer, nothing to return.
+*/
+sword OCIWideCharInSizeToMultiByte(dvoid *envhp, OraText *dst,
+                                    size_t dstsz, CONST OCIWchar *src,
+                                    size_t srcsz, size_t *rsize);
+
+
+
+/* ----------------------- OCIWideCharIsAlnum -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsAlnum - test whether wc is a letter or decimal digit
+   REMARKS
+     It tests whether wc is a letter or decimal digit.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsAlnum(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsAlpha -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsAlpha - test whether wc is an alphabetic letter
+   REMARKS
+     It tests whether wc is an alphabetic letter
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsAlpha(dvoid *envhp, OCIWchar wc);
+
+
+/* --------------------- OCIWideCharIsCntrl ---------------------------------*/
+/*
+   NAME
+     OCIWideCharIsCntrl - test whether wc is a control character
+   REMARKS
+     It tests whether wc is a control character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsCntrl(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsDigit -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsDigit - test whether wc is a decimal digit character
+   REMARKS
+     It tests whether wc is a decimal digit character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsDigit(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsGraph -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsGraph - test whether wc is a graph character
+   REMARKS
+     It tests whether wc is a graph character. A graph character is character
+     with a visible representation and normally includes alphabetic letter,
+     decimal digit, and punctuation.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsGraph(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsLower -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsLower - test whether wc is a lowercase letter
+   REMARKS
+     It tests whether wc is a lowercase letter.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsLower(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsPrint -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsPrint - test whether wc is a printable character
+   REMARKS
+     It tests whether wc is a printable character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsPrint(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsPunct -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsPunct - test whether wc is a punctuation character
+   REMARKS
+     It tests whether wc is a punctuation character.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsPunct(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsSpace -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsSpace - test whether wc is a space character
+   REMARKS
+     It tests whether wc is a space character. A space character only causes
+     white space in displayed text(for example, space, tab, carriage return,
+     newline, vertical tab or form feed).
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsSpace(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharIsUpper -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsUpper - test whether wc is a uppercase letter
+   REMARKS
+     It tests whether wc is a uppercase letter.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsUpper(dvoid *envhp, OCIWchar wc);
+
+
+/*----------------------- OCIWideCharIsXdigit -------------------------------*/
+/*
+   NAME
+     OCIWideCharIsXdigit - test whether wc is a hexadecimal digit
+   REMARKS
+     It tests whether wc is a hexadecimal digit ( 0-9, A-F, a-f ).
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsXdigit(dvoid *envhp, OCIWchar wc);
+
+
+/* --------------------- OCIWideCharIsSingleByte ----------------------------*/
+/*
+   NAME
+     OCIWideCharIsSingleByte - test whether wc is a single-byte character
+   REMARKS
+     It tests whether wc is a single-byte character when converted into
+     multi-byte.
+   RETURNS
+     TRUE or FLASE.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for testing.
+*/
+boolean OCIWideCharIsSingleByte(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharToLower -------------------------------*/
+/*
+   NAME
+     OCIWideCharToLower - Convert a wchar into the lowercase
+   REMARKS
+     If there is a lower-case character mapping for wc in the specified locale,
+     it will return the lower-case in wchar, else return wc itself.
+   RETURNS
+     A wchar
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for lowercase mapping.
+*/
+OCIWchar OCIWideCharToLower(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharToUpper -------------------------------*/
+/*
+   NAME
+     OCIWideCharToUpper - Convert a wchar into the uppercase
+   REMARKS
+     If there is a upper-case character mapping for wc in the specified locale,
+     it will return the upper-case in wchar, else return wc itself.
+   RETURNS
+     A wchar
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar for uppercase mapping.
+*/
+OCIWchar OCIWideCharToUpper(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharStrcmp --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrcmp - compare two null terminated wchar string
+   REMARKS
+     It compares two wchar string in binary ( based on wchar encoding value ),
+     linguistic, or case-insensitive.
+   RETURNS
+     0, if wstr1 == wstr2.
+     Positive, if wstr1 > wstr2.
+     Negative, if wstr1 < wstr2.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set.
+   wstr1(IN)
+     Pointer to a null-terminated wchar string.
+   wstr2(IN)
+     Pointer to a null-terminated wchar string.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY : for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC : for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive
+     comparison.
+*/
+int OCIWideCharStrcmp(dvoid *envhp, CONST OCIWchar *wstr1, 
+                CONST OCIWchar *wstr2, int flag);
+
+
+/* ----------------------- OCIWideCharStrncmp -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrncmp - compare twe wchar string in length
+   REMARKS
+     This function is similar to OCIWideCharStrcmp(), except that at most len1
+     characters from wstr1 and len2 characters from wstr1 are compared. The
+     null-terminator will be taken into the comparison.
+   RETURNS
+     0, if wstr1 = wstr2
+     Positive, if wstr1 > wstr2
+     Negative, if wstr1 < wstr2
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr1(IN)
+     Pointer to the first wchar string
+   len1(IN)
+     The length for the first string for comparison
+   wstr2(IN)
+     Pointer to the second wchar string
+   len2(IN)
+     The length for the second string for comparison.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY : for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC : for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 
+     comparison.
+*/
+int OCIWideCharStrncmp(dvoid *envhp, CONST OCIWchar *wstr1, size_t len1,
+                 CONST OCIWchar *wstr2, size_t len2, int flag);
+
+
+/* ----------------------- OCIWideCharStrcat --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrcat - concatenate two wchar strings
+   REMARKS
+     This function appends a copy of the wchar string pointed to by wsrcstr,
+     including the null-terminator to the end of wchar string pointed to by
+     wdststr. It returns the number of character in the result string not
+     including the ending null-terminator.
+   RETURNS
+     number of characters in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(IN/OUT)
+     Pointer to the destination wchar string for appending.
+   wsrcstr(IN)
+     Pointer to the source wchar string to append.
+*/
+size_t OCIWideCharStrcat(dvoid *envhp, OCIWchar *wdststr,
+                         CONST OCIWchar *wsrcstr);
+
+
+/* ----------------------- OCIWideCharStrchr --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrchr - Search the first occurrence of wchar in a wchar string
+   REMARKS
+     This function searchs for the first occurrence of wc in the wchar string
+     pointed to by wstr. It returns a pointer to the whcar if successful, or
+     a null pointer.
+   RETURNS
+     wchar pointer if successful, otherwise a null pointer.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr(IN)
+     Pointer to the wchar string to search
+   wc(IN)
+     Wchar to search for.
+*/
+OCIWchar *OCIWideCharStrchr(dvoid *envhp, CONST OCIWchar *wstr,
+                            OCIWchar wc);
+
+
+/* ----------------------- OCIWideCharStrcpy --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrcpy - copy a wchar string
+   REMARKS
+     This function copies the wchar string pointed to by wsrcstr, including the
+     null-terminator, into the array pointed to by wdststr. It returns the
+     number of character copied not including the ending null-terminator.
+   RETURNS
+     number of characters copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(OUT)
+     Pointer to the destination wchar buffer.
+   wsrcstr(IN)
+     Pointer to the source wchar string.
+*/
+size_t OCIWideCharStrcpy(dvoid *envhp, OCIWchar *wdststr,
+                         CONST OCIWchar *wsrcstr);
+
+
+/* ----------------------- OCIWideCharStrlen --------------------------------*/
+/*
+   NAME
+     OCIWideCharStrlen - Return number of character in a wchar string
+   REMARKS
+     This function computes the number of characters in the wchar string
+     pointed to by wstr, not including the null-terminator, and returns
+    this number. 
+   RETURNS
+     number of characters not including ending null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr(IN)
+     Pointer to the source wchar string.
+*/
+size_t OCIWideCharStrlen(dvoid *envhp, CONST OCIWchar *wstr);
+
+
+/* ----------------------- OCIWideCharStrncat -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrncat - Concatenate wchar string in length
+   REMARKS
+     This function is similar to OCIWideCharStrcat(), except that at most n
+     characters from wsrcstr are appended to wdststr. Note that the
+     null-terminator in wsrcstr will stop appending. wdststr will be
+     null-terminated.. 
+   RETURNS
+     Number of characters in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(IN/OUT)
+     Pointer to the destination wchar string for appending.
+   wsrcstr(IN)
+     Pointer to the source wchar string to append.
+   n(IN)
+     Number of characters from wsrcstr to append.
+*/
+size_t OCIWideCharStrncat(dvoid *envhp, OCIWchar *wdststr,
+                          CONST OCIWchar *wsrcstr, size_t n);
+
+
+/* ----------------------- OCIWideCharStrncpy -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrncpy - Copy wchar string in length
+   REMARKS
+     This function is similar to OCIWideCharStrcpy(), except that at most n
+     characters are copied from the array pointed to by wsrcstr to the array
+     pointed to by wdststr. Note that the null-terminator in wdststr will
+     stop coping and result string will be null-terminated.
+   RETURNS
+     number of characters copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wdststr(OUT)
+     Pointer to the destination wchar buffer.
+   wsrcstr(IN)
+     Pointer to the source wchar string.
+   n(IN)
+     Number of characters from wsrcstr to copy.
+*/
+size_t OCIWideCharStrncpy(dvoid *envhp, OCIWchar *wdststr,
+                          CONST OCIWchar *wsrcstr, size_t n);
+
+
+/* ----------------------- OCIWideCharStrrchr -------------------------------*/
+/*
+   NAME
+     OCIWideCharStrrchr - search the last occurrence of a wchar in wchar string
+   REMARKS
+     This function searchs for the last occurrence of wc in the wchar string
+     pointed to by wstr. It returns a pointer to the whcar if successful, or
+     a null pointer.
+   RETURNS
+     wchar pointer if successful, otherwise a null pointer.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wstr(IN)
+     Pointer to the wchar string to search
+   wc(IN)
+     Wchar to search for.
+*/
+OCIWchar *OCIWideCharStrrchr(dvoid *envhp, CONST OCIWchar *wstr,
+                             OCIWchar wc);
+
+
+/* --------------------- OCIWideCharStrCaseConversion -----------------------*/
+/*
+   NAME
+     OCIWideCharStrCaseConversion - convert a wchar string into lowercase or
+                                    uppercase
+   REMARKS
+     This function convert the wide char string pointed to by wsrcstr into the
+     uppercase or lowercase specified by flag and copies the result into the
+     array pointed to by wdststr. The result string will be null-terminated.
+   RETURNS
+     number of characters for result string not including null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle.
+   wdststr(OUT)
+     Pointer to destination array.
+   wsrcstr(IN)
+     Pointer to source string.
+   flag(IN)
+     Specify the case to convert:
+       OCI_NLS_UPPERCASE : convert to uppercase.
+       OCI_NLS_LOWERCASE: convert to lowercase.
+     This flag can be ORed with OCI_NLS_LINGUISTIC to specify that the
+     linguistic setting in the locale will be used for case conversion.
+*/
+size_t OCIWideCharStrCaseConversion(dvoid *envhp, OCIWchar *wdststr,
+                                    CONST OCIWchar *wsrcstr, ub4 flag);
+
+
+/*---------------------- OCIWideCharDisplayLength ---------------------------*/
+/*
+   NAME
+     OCIWideCharDisplayLength - Calculate the display length for a wchar
+   REMARKS
+     This function determines the number of column positions required for wc
+     in display. It returns number of column positions, or 0 if wc is 
+     null-terminator.
+   RETURNS
+     Number of display positions.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar character.
+*/
+size_t OCIWideCharDisplayLength(dvoid *envhp, OCIWchar wc );
+
+
+/*---------------------- OCIWideCharMultiByteLength -------------------------*/
+/*
+   NAME
+     OCIWideCharMultiByteLength - Determine byte size in multi-byte encoding
+   REMARKS
+     This function determines the number of byte required for wc in multi-byte
+     encoding. It returns number of bytes in multi-byte for wc.
+   RETURNS
+     Number of bytes.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set .
+   wc(IN)
+     Wchar character.
+*/
+size_t OCIWideCharMultiByteLength(dvoid *envhp, OCIWchar wc);
+
+
+/* ----------------------- OCIMultiByteStrcmp -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrcmp - Compare two multi-byte strings
+   REMARKS
+     It compares two multi-byte strings in binary ( based on encoding value ),
+     linguistic, or case-insensitive.
+   RETURNS
+     0, if str1 == str2.
+     Positive, if str1 > str2.
+     Negative, if str1 < str2.
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set.
+   str1(IN)
+     Pointer to a null-terminated string.
+   str2(IN)
+     Pointer to a null-terminated string.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY: for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC: for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 
+     comparison.
+*/
+int OCIMultiByteStrcmp(dvoid *envhp, CONST OraText *str1,
+                       CONST OraText *str2, int flag);
+
+
+/*----------------------- OCIMultiByteStrncmp -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrncmp - compare two strings in length
+   REMARKS
+     This function is similar to OCIMultiBytestrcmp(), except that at most
+     len1 bytes from str1 and len2 bytes from str2 are compared. The
+     null-terminator will be taken into the comparison.
+   RETURNS
+     0, if str1 = str2
+     Positive, if str1 > str2
+     Negative, if str1 < str2
+   envhp(IN/OUT)
+     OCI environment handle to determine the character set.
+   str1(IN)
+     Pointer to the first string
+   len1(IN)
+     The length for the first string for comparison
+   str2(IN)
+     Pointer to the second string
+   len2(IN)
+     The length for the second string for comparison.
+   flag(IN)
+     It is used to decide the comparison method. It can be taken one of the
+     following values:
+       OCI_NLS_BINARY: for the binary comparison, this is default value.
+       OCI_NLS_LINGUISTIC: for linguistic comparison specified in the locale.
+     This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive 
+     comparison.
+*/
+int OCIMultiByteStrncmp(dvoid *envhp, CONST OraText *str1, size_t len1,
+                        OraText *str2, size_t len2, int flag);
+
+
+/*----------------------- OCIMultiByteStrcat --------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrcat - concatenate multibyte strings
+   REMARKS
+     This function appends a copy of the multi-byte string pointed to by
+     srcstr, including the null-terminator to the end of string pointed to by
+     dststr. It returns the number of bytes in the result string not including
+     the ending null-terminator.
+   RETURNS
+     number of bytes in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     Pointer to OCI environment handle
+   dststr(IN/OUT)
+     Pointer to the destination multi-byte string for appending.
+   srcstr(IN)
+     Pointer to the source string to append.
+*/
+size_t OCIMultiByteStrcat(dvoid *envhp, OraText *dststr,
+                          CONST OraText *srcstr);
+
+
+/*------------------------- OCIMultiByteStrcpy ------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrcpy - copy multibyte string
+   REMARKS
+     This function copies the multi-byte string pointed to by srcstr,
+     including the null-terminator, into the array pointed to by dststr. It
+     returns the number of bytes copied not including the ending 
+     null-terminator.
+   RETURNS
+     number of bytes copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     Pointer to the OCI environment handle.
+   srcstr(OUT)
+     Pointer to the destination buffer.
+   dststr(IN)
+     Pointer to the source multi-byte string.
+*/
+size_t OCIMultiByteStrcpy(dvoid *envhp, OraText *dststr,
+                          CONST OraText *srcstr);
+
+
+/*----------------------- OCIMultiByteStrlen --------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrlen - Calculate multibyte string length
+   REMARKS
+     This function computes the number of bytes in the multi-byte string
+     pointed to by str, not including the null-terminator, and returns this
+     number. 
+   RETURNS
+     number of bytes not including ending null-terminator.
+   str(IN)
+     Pointer to the source multi-byte string.
+*/
+size_t OCIMultiByteStrlen(dvoid *envhp, CONST OraText *str);
+
+
+/*----------------------- OCIMultiByteStrncat -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrncat - concatenate string in length
+   REMARKS
+     This function is similar to OCIMultiBytestrcat(), except that at most n
+     bytes from srcstr are appended to dststr. Note that the null-terminator in
+     srcstr will stop appending and the function will append as many character
+     as possible within n bytes. dststr will be null-terminated. 
+   RETURNS
+     Number of bytes in the result string not including the ending
+     null-terminator.
+   envhp(IN/OUT)
+     Pointer to OCI environment handle.
+   srcstr(IN/OUT)
+     Pointer to the destination multi-byte string for appending.
+   dststr(IN)
+     Pointer to the source multi-byte string to append.
+   n(IN)
+     Number of bytes from srcstr to append.
+*/
+size_t OCIMultiByteStrncat(dvoid *envhp, OraText *dststr,
+                           CONST OraText *srcstr, size_t n);
+
+
+/*----------------------- OCIMultiByteStrncpy -------------------------------*/
+/*
+   NAME
+     OCIMultiByteStrncpy - copy multibyte string in length
+   REMARKS
+     This function is similar to OCIMultiBytestrcpy(), except that at most n
+     bytes are copied from the array pointed to by srcstr to the array pointed
+     to by dststr. Note that the null-terminator in srcstr will stop coping and
+     the function will copy as many character as possible within n bytes. The 
+     result string will be null-terminated.
+   RETURNS
+     number of bytes copied not including the ending null-terminator.
+   envhp(IN/OUT)
+     Pointer to a OCI environment handle.
+   dststr(IN)
+     Pointer to the source multi-byte string.
+   srcstr(OUT)
+     Pointer to the destination buffer.
+   n(IN)
+     Number of bytes from srcstr to copy.
+*/
+size_t OCIMultiByteStrncpy(dvoid *envhp, OraText *dststr,
+                           CONST OraText *srcstr, size_t n);
+
+
+/*----------------------- OCIMultiByteStrnDisplayLength ---------------------*/
+/*
+   NAME
+     OCIMultiByteStrnDisplayLength - calculate the display length for a
+                                     multibyt string
+   REMARKS
+     This function returns the number of display positions occupied by the 
+     complete characters within the range of n bytes.
+   RETURNS
+     number of display positions.
+   envhp(IN/OUT)
+     OCI environment handle.
+   str(IN)
+     Pointer to a multi-byte string.
+   n(IN)
+     Number of bytes to examine.
+*/
+size_t OCIMultiByteStrnDisplayLength(dvoid *envhp, CONST OraText *str1,
+                                     size_t n);
+
+
+/*---------------------- OCIMultiByteStrCaseConversion  ---------------------*/
+/*
+   NAME
+     OCIMultiByteStrCaseConversion
+   REMARKS
+     This function convert the multi-byte string pointed to by srcstr into the
+     uppercase or lowercase specified by flag and copies the result into the
+     array pointed to by dststr. The result string will be null-terminated.
+   RETURNS
+     number of bytes for result string not including null-terminator.
+   envhp(IN/OUT)
+     OCI environment handle.
+   dststr(OUT)
+     Pointer to destination array.
+   srcstr(IN)
+     Pointer to source string.
+   flag(IN)
+     Specify the case to convert:
+       OCI_NLS_UPPERCASE: convert to uppercase.
+       OCI_NLS_LOWERCASE: convert to lowercase.
+     This flag can be ORed with OCI_NLS_LINGUISTIC to specify that the 
+     linguistic setting in the locale will be used for case conversion.
+*/
+size_t OCIMultiByteStrCaseConversion(dvoid *envhp, OraText *dststr,
+                                     CONST OraText *srcstr, ub4 flag);
+
+
+/*------------------------- OCICharSetToUnicode -----------------------------*/
+/*
+   NAME
+     OCICharSetToUnicode - convert multibyte string into Unicode as UCS2
+   REMARKS
+     This function converts a multi-byte string pointed to by src to Unicode 
+     into the array pointed to by dst. The conversion will stop when it reach
+     to the source limitation or destination limitation. 
+     The function will return number of characters converted into Unicode.
+     If dstlen is zero, it will just return the number of characters for the
+     result without real conversion.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     Pointer to an OCI environment handle
+   dst(OUT)
+     Pointer to a destination buffer
+   dstlen(IN)
+     Size of destination buffer in character
+   src(IN)
+     Pointer to multi-byte source string.
+   srclen(IN)
+     Size of source string in bytes.
+   rsize(OUT)
+     Number of characters converted.
+     If it is a NULL pointer, nothing to return.
+*/
+sword OCICharSetToUnicode(dvoid *envhp, ub2 *dst, size_t dstlen,
+                          CONST OraText *src, size_t  srclen, size_t *rsize);
+
+
+/*------------------------- OCIUnicodeToCharSet -----------------------------*/
+/*
+   NAME
+     OCIUnicodeToCharSet - convert Unicode into multibyte
+   REMARKS
+     This function converts a Unicode string pointed to by src to multi-byte
+     into the array pointed to by dst. The conversion will stop when it reach
+     to the source limitation or destination limitation. The function will
+     return number of bytes converted into multi-byte. If dstlen is zero, it
+     will just return the number of bytes for the result without real 
+     conversion. If a Unicode character is not convertible for the character
+     set specified in OCI environment handle, a replacement character will be
+     used for it. In this case, OCICharSetConversionIsReplacementUsed() will
+     return ture.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     Pointer to an OCI environment handle.
+   dst(OUT)
+     Pointer to a destination buffer.
+   dstlen(IN)
+     Size of destination buffer in byte.
+   src(IN)
+     Pointer to a Unicode string.
+   srclen(IN)
+     Size of source string in characters.
+   rsize(OUT)
+     Number of bytes converted.
+     If it is a NULL pointer, nothing to return.
+*/
+sword OCIUnicodeToCharSet(dvoid *envhp, OraText *dst, size_t dstlen, 
+                           CONST ub2 *src, size_t srclen, size_t *rsize);
+
+/*----------------------- OCINlsCharSetConvert ------------------------------*/
+/*
+   NAME
+     OCINlsCharSetConvert - convert between any two character set.
+   REMARKS
+     This function converts a string pointed to by src in the character set
+     specified with srcid to the array pointed to by dst in the character set
+     specified with dstid. The conversion will stop when it reaches the source
+     limitation or destination limitation. The function will return the number
+     of bytes converted into the destination buffer. Even though either source
+     or destination character set id is OCI_UTF16ID, given and return data
+     length will be represented with the byte length as this function is
+     intended for generic purpose. Note the conversion will not stop at null
+     data.
+     To get character set id from name, OCINlsCharSetNameToId can be used.
+     To check if derived data in the destination buffer contains any
+     replacement character resulting from conversion failure,
+     OCICharSetConversionIsReplacementUsed can be used to get the status.
+     Data alignment should be guaranteed by a caller. For example, UTF-16 data
+     should be aligned to ub2 type.
+
+   RETURNS
+     OCI_SUCCESS or OCI_ERROR.
+   errhp(IN/OUT)
+     OCI error handle. If there is an error, it is recorded in errhp and this
+     function returns a NULL pointer. Diagnostic information can be obtained
+     by calling OCIErrorGet().
+   dstid(IN)
+     Character set id for the destination buffer.
+   dstp(OUT)
+     Pointer to the destination buffer.
+   dstlen(IN)
+     The maximum byte size of destination buffer.
+   srcid(IN)
+     Character set id for the source buffer.
+   srcp(IN)
+     Pointer to the source buffer.
+   srclen(IN)
+     The length byte size of source buffer.
+   rsize(OUT)
+     The number of characters converted. If it is a NULL pointer, nothing to
+     return.
+*/
+sword OCINlsCharSetConvert(dvoid *envhp, OCIError *errhp, 
+                        ub2 dstid, dvoid *dstp, size_t dstlen,
+                        ub2 srcid, CONST dvoid *srcp, size_t srclen,
+                        size_t *rsize);
+
+
+/* ------------------- OCICharsetConversionIsReplacementUsed ----------------*/
+/*
+   NAME
+     OCICharsetConversionIsReplacementUsed - chech if replacement is used in 
+                                             conversion
+   REMARKS
+     This function indicates whether or not the replacement character was used
+     for nonconvertible characters in character set conversion in last invoke
+     of OCICharsetUcs2ToMb().
+   RETURNS
+     TRUE is the replacement character was used in last OCICharsetUcs2ToMb()
+     invoking, else FALSE.
+   envhp(IN/OUT)
+     OCI environment handle. This should be the first handle passed to 
+     OCICharsetUcs2ToMb().
+*/
+boolean OCICharSetConversionIsReplacementUsed(dvoid *envhp);
+
+/*------------------- OCINlsEnvironmentVariableGet -----------------*/
+/*
+   NAME
+     OCINlsEnvironmentVariableGet - get a value of NLS environment variable.
+
+   DESCRIPTION
+     This function retrieves a value of NLS environment variable to the buffer
+     pointed to by val. Data type is determined by the parameter specified by
+     item. Either numeric data or string data can be retrieved.
+
+   RETURNS
+     OCI_SUCCESS or OCI_ERROR.
+
+   PARAMETERS
+   valp(OUT) -
+     Pointer to the buffer.
+   size(IN) -
+     Size of the buffer. This argument is only applicable to string data type,
+     but not to numerical data, in such case, it is ignored.
+   item(IN) -
+     NLS item value, which can be one of following values:
+       OCI_NLS_CHARSET_ID  - NLS_LANG character set id in ub2 data type.
+       OCI_NLS_NCHARSET_ID - NLS_NCHAR character set id in ub2 data type.
+   charset(IN) -
+     Character set id for retrieved string data. If it is 0, NLS_LANG will be
+     used. OCI_UTF16ID is a valid id. In case of numeric data, this argument
+     is ignored.
+   rsize(OUT) -
+     Size of return value.
+
+   NOTE
+     This functions is mainly used for retrieving character set id from either
+     NLS_LANG or NLS_NCHAR environment variables. If NLS_LANG is not set,
+     the default character set id is returned.
+     For future extension, the buffer is capable for storing other data types.
+*/
+sword OCINlsEnvironmentVariableGet(dvoid  *valp, size_t size, ub2 item,
+                                   ub2 charset, size_t *rsize);
+
+
+/*------------------------- OCIMessageOpen ----------------------------------*/
+/*
+   NAME
+     OCIMessageOpen - open a locale message file
+   REMARKS
+     This function opens a message handle for facility of product in a language
+     pointed to by envhp. It first try to open the message file corresponding
+     to envhp for the facility. If it successes, it will use that file to
+     initialize a message handle, else it will use the default message file
+     which is for American language for the facility. The function return a
+     pointer pointed to a message handle into msghp parameter.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     A pointer to OCI environment handle for message language.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and this
+     function returns a NULL pointer. Diagnostic information can be obtained by
+     calling OCIErrorGet().
+   msghp(OUT)
+     a message handle for return
+   product(IN)
+     A pointer to a product name. Product name is used to locate the directory
+     for message in a system dependent way. For example, in Solaris, the
+     directory of message files for the product `rdbms' is
+     `${ORACLE_HOME}/rdbms'.
+   facility(IN)
+     A pointer to a facility name in the product. It is used to construct a
+     message file name. A message file name follows the conversion with 
+     facility as prefix. For example, the message file name for facility
+     `img' in American language will be `imgus.msb' where `us' is the 
+     abbreviation of American language and `msb' as message binary file 
+     extension.
+   dur(IN)
+     Duration for memory allocation for the return message handle. It can be
+     the following values:
+        OCI_DURATION_CALL
+        OCI_DURATION_STATEMENT
+        OCI_DURATION_SESSION
+        OCI_DURATION_TRANSACTION
+     For the detail description, please refer to Memory Related Service
+     Interfaces section.
+*/
+sword OCIMessageOpen(dvoid *envhp, OCIError *errhp, OCIMsg **msghp,
+                      CONST OraText *product, CONST OraText *facility, 
+                      OCIDuration dur);
+ 
+
+/*------------------------- OCIMessageGet -----------------------------------*/
+/*
+   NAME
+     OCIMessageGet - get a locale message from a message handle
+   REMARKS
+     This function will get message with message number identified by msgno and
+     if buflen is not zero, the function will copy the message into the buffer
+     pointed to by msgbuf. If buflen is zero, the message will be copied into
+     a message buffer inside the message handle pointed to by msgh. For both
+     cases. it will return the pointer to the null-terminated message string.
+     If it cannot get the message required, it will return a NULL pointer.
+   RETURNS
+     A pointer to a null-terminated message string on success, otherwise a NULL
+     pointer.
+   msgh(IN/OUT)
+     Pointer to a message handle which was previously opened by
+     OCIMessageOpen().
+   msgno(IN)
+     The message number for getting message.
+   msgbuf(OUT)
+     Pointer to a destination buffer to the message retrieved. If buflen is
+     zero, it can be NULL pointer.
+   buflen(IN)
+     The size of the above destination buffer.
+*/
+OraText *OCIMessageGet(OCIMsg *msgh, ub4 msgno, OraText *msgbuf,
+                       size_t buflen);
+
+/*------------------------- OCIMessageClose ---------------------------------*/
+/*
+   NAME
+     OCIMessageClose - close a message handle
+   REMARKS
+     This function closes a message handle pointed to by msgh and frees any
+     memory associated with this handle.
+   RETURNS
+     OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
+   envhp(IN/OUT)
+     A pointer to OCI environment handle for message language.
+   errhp(IN/OUT)
+     The OCI error handle. If there is an error, it is record in errhp and this
+     function returns a NULL pointer. Diagnostic information can be obtained by
+     calling OCIErrorGet().
+   msghp(IN/OUT)
+     A pointer to a message handle which was previously opened by
+     OCIMessageOpen().
+*/
+sword OCIMessageClose(dvoid *envhp, OCIError *errhp, OCIMsg *msghp);
+
+/*--------------- End of Extensions to NLS cartridge service ----------------*/
+
+
+/*----------------- Extensions to OCI Thread interface ---------------------*/
+/*****************************************************************************
+                              DESCRIPTION
+******************************************************************************
+1 Threads Interface
+
+The OCIThread package provides a number of commonly used threading
+primitives for use by Oracle customers.  It offers a portable interface to
+threading capabilities native to various platforms.  It does not implement
+threading on platforms which do not have native threading capability.
+
+OCIThread does not provide a portable implementation of multithreaded 
+facilities.  It only serves as a set of portable covers for native 
+multithreaded facilities.  Therefore, platforms that do not have native 
+support for multi-threading will only be able to support a limited 
+implementation of OCIThread.  As a result, products that rely on all of 
+OCIThread's functionality will not port to all platforms.  Products that must 
+port to all platforms must use only a subset of OCIThread's functionality.  
+This issue is discussed further in later sections of this document.
+
+The OCIThread API is split into four main parts.  Each part is described
+briefly here.  The following subsections describe each in greater detail.
+
+ 1. Initialization and Termination Calls
+
+     These calls deal with the initialization and termination of OCIThread.
+     Initialization of OCIThread initializes the OCIThread context which is
+     a member of the OCI environment or session handle.  This context is 
+     required for other OCIThread calls.
+
+ 2. Passive Threading Primitives
+
+     The passive threading primitives include primitives to manipulate mutual
+     exclusion (mutex) locks, thread ID's, and thread-specific data keys.
+
+     The reason that these primitives are described as 'passive' is that while
+     their specifications allow for the existence of multiple threads, they do
+     not require it.  This means that it is possible for these primitives to
+     be implemented according to specification in both single-threaded and
+     multi-threaded environments.
+
+     As a result, OCIThread clients that use only these primitives will not
+     require the existence of multiple threads in order to work correctly,
+     i.e., they will be able to work in single-threaded environments without 
+     branching code.
+
+ 3. Active Threading Primitives
+
+     Active threading primitives include primitives dealing with the creation,
+     termination, and other manipulation of threads.
+
+     The reason that these primitives are described as 'active' is that they
+     can only be used in true multi-threaded environments.  Their
+     specifications explicitly require that it be possible to have multiple
+     threads.  If you need to determine at runtime whether or not you are in a
+     multi-threaded environment, call OCIThreadIsMulti() before calling an
+     OCIThread active primitive.
+
+
+1.1 Initialization & Termination
+==================================
+
+The types and functions described in this section are associated with the
+initialization and termination of the OCIThread package.  OCIThread must
+be properly initialized before any of its functionality can be used.
+OCIThread's process initialization function, 'OCIThreadProcessInit()',
+must be called with care; see below.
+
+The observed behavior of the initialization and termination functions is the
+same regardless of whether OCIThread is in single-threaded or multi-threaded
+environment.  It is OK to call the initialization functions from both generic
+and operating system specific (OSD) code.
+
+1.1.1 Types
+
+  OCIThreadContext - OCIThread Context
+  -------------------------------------
+
+    Most calls to OCIThread functions take the OCI environment or session 
+    handle as a parameter.  The OCIThread context is part of the OCI 
+    environment or session handle and it must be initialized by calling 
+    'OCIThreadInit()'.  Termination of the OCIThread context occurs by calling
+    'OCIThreadTerm()'.
+
+    The OCIThread context is a private data structure.  Clients must NEVER
+    attempt to examine the contents of the context.
+
+1.1.2  OCIThreadProcessInit
+
+  OCIThreadProcessInit - OCIThread Process INITialization
+  --------------------------------------------------------
+
+    Description
+
+      This function should be called to perform OCIThread process
+      initialization.
+
+    Prototype
+
+      void OCIThreadProcessInit();
+
+    Returns
+
+      Nothing.
+
+    Notes
+
+      Whether or not this function needs to be called depends on how OCI
+      Thread is going to be used.
+
+        * In a single-threaded application, calling this function is optional.
+          If it is called at all, the first call to it must occur before calls
+          to any other OCIThread functions.  Subsequent calls can be made
+          without restriction; they will not have any effect.
+
+        * In a multi-threaded application, this function MUST be called.  The
+          first call to it MUST occur 'strictly before' any other OCIThread
+          calls; i.e., no other calls to OCIThread functions (including other
+          calls to this one) can be concurrent with the first call.
+          Subsequent calls to this function can be made without restriction;
+          they will not have any effect.
+
+
+1.1.3 OCIThreadInit
+
+  OCIThreadInit - OCIThread INITialize
+  -------------------------------------
+
+    Description
+
+      This initializes OCIThread context.
+
+    Prototype
+
+      sword OCIThreadInit(dvoid *hndl, OCIError *err);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal for OCIThread clients to try an examine the memory
+      pointed to by the returned pointer.
+
+      It is safe to make concurrent calls to 'OCIThreadInit()'.  Unlike
+      'OCIThreadProcessInit()',  there is no need to have a first call
+      that occurs before all the others.
+
+      The first time 'OCIThreadInit()' is called, it initilaizes the OCI
+      Thread context.  It also saves a pointer to the context in some system
+      dependent manner.  Subsequent calls to 'OCIThreadInit()' will return
+      the same context.
+
+      Each call to 'OCIThreadInit()' must eventually be matched by a call to
+      'OCIThreadTerm()'.
+
+  OCIThreadTerm - OCIThread TERMinate
+  ------------------------------------
+
+    Description
+
+      This should be called to release the OCIThread context.  It should be
+      called exactly once for each call made to 'OCIThreadInit()'.
+
+    Prototype
+
+      sword OCIThreadTerm(dvoid *hndl, OCIError *err);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is safe to make concurrent calls to 'OCIThreadTerm()'.
+
+      'OCIThreadTerm()' will not do anything until it has been called as
+      many times as 'OCIThreadInit()' has been called.  When that happens,
+      it terminates the OCIThread layer and frees the memory allocated for
+      the context.  Once this happens, the context should not be re-used.
+      It will be necessary to obtain a new one by calling 'OCIThreadInit()'.
+
+
+  OCIThreadIsMulti - OCIThread Is Multi-Threaded?
+  ------------------------------------------------
+
+    Description
+
+      This tells the caller whether the application is running in a
+      multi-threaded environment or a single-threaded environment.
+
+    Prototype
+      boolean OCIThreadIsMulti(void);
+
+    Returns
+
+      TRUE if the environment is multi-threaded;
+      FALSE if the environment is single-threaded.
+
+
+1.2 Passive Threading Primitives
+==================================
+
+1.2.1 Types
+
+The passive threading primitives deal with the manipulation of mutex, 
+thread ID's, and thread-specific data.  Since the specifications of these 
+primitives do not require the existence of multiple threads, they can be 
+used both on multithreaded and single-threaded platforms.
+
+1.2.1.1  OCIThreadMutex - OCIThread Mutual Exclusion Lock
+-----------------------------------------------------------
+
+  The type 'OCIThreadMutex' is used to represent a mutual exclusion lock
+  (mutex).  A mutex is typically used for one of two purposes: (i) to
+  ensure that only one thread accesses a given set of data at a time, or
+  (ii) to ensure that only one thread executes a given critical section of
+  code at a time.
+
+  Mutexes pointer can be declared as parts of client structures or as 
+  stand-alone variables.  Before they can be used, they must be initialized 
+  using 'OCIThreadMutexInit()'.  Once they are no longer needed, they must be
+  destroyed using 'OCIThreadMutexDestroy()'.  A mutex pointer must NOT be 
+  used after it is destroyed.
+
+  A thread can acquire a mutex by using either 'OCIThreadMutexAcquire()' or
+  'OCIThreadMutexTry()'.  They both ensure that only one thread at a time is
+  allowed to hold a given mutex.  A thread that holds a mutex can release it
+  by calling 'OCIThreadMutexRelease()'.
+
+
+1.2.1.2  OCIThreadKey - OCIThread Key for Thread-Specific Data
+----------------------------------------------------------------
+
+  A key can be thought of as a process-wide variable that has a
+  thread-specific value.  What this means is that all the threads in a
+  process can use any given key.  However, each thread can examine or modify
+  that key independently of the other threads.  The value that a thread sees
+  when it examines the key will always be the same as the value that it last
+  set for the key.  It will not see any values set for the key by the other
+  threads.
+
+  The type of the value held by a key is a 'dvoid *' generic pointer.
+
+  Keys can be created using 'OCIThreadKeyInit()'.  When a key is created, its
+  value is initialized to 'NULL' for all threads.
+
+  A thread can set a key's value using 'OCIThreadKeySet()'.  A thread can
+  get a key's value using 'OCIThreadKeyGet()'.
+
+  The OCIThread key functions will save and retrieve data SPECIFIC TO THE
+  THREAD.  When clients maintain a pool of threads and assign the threads to
+  different tasks, it *may not* be appropriate for a task to use OCIThread
+  key functions to save data associated with it.  Here is a scenario of how
+  things can fail: A thread is assigned to execute the initialization of a
+  task.  During the initialization, the task stored some data related to it
+  in the thread using OCIThread key functions.  After the initialization,
+  the thread is returned back to the threads pool.  Later, the threads pool
+  manager assigned another thread to perform some operations on the task,
+  and the task needs to retrieve those data it stored earlier in
+  initialization.  Since the task is running in another thread, it will not
+  be able to retrieve the same data back!  Applications that use thread
+  pools should be aware of this and be cautious when using OCIThread key
+  functions.
+
+
+1.2.1.3  OCIThreadKeyDestFunc - OCIThread Key Destructor Function Type
+------------------------------------------------------------------------
+
+  This is the type of a pointer to a key's destructor routine.  Keys can be
+  associated with a destructor routine when they are created (see
+  'OCIThreadKeyInit()').
+
+  A key's destructor routine will be called whenever a thread that has a
+  non-NULL value for the key terminates.
+
+  The destructor routine returns nothing and takes one parameter.  The
+  parameter will be the value that was set for key when the thread
+  terminated.
+
+  The destructor routine is guaranteed to be called on a thread's value
+  in the key after the termination of the thread and before process
+  termination.  No more precise guarantee can be made about the timing
+  of the destructor routine call; thus no code in the process may assume
+  any post-condition of the destructor routine.  In particular, the
+  destructor is not guaranteed to execute before a join call on the
+  terminated thread returns.
+
+
+1.2.1.4  OCIThreadId - OCIThread Thread ID
+--------------------------------------------
+
+  Type 'OCIThreadId' is the type that will be used to identify a thread.
+  At any given time, no two threads will ever have the same 'OCIThreadId'.
+  However, 'OCIThreadId' values can be recycled; i.e., once a thread dies,
+  a new thread may be created that has the same 'OCIThreadId' as the one
+  that died.  In particular, the thread ID must uniquely identify a thread
+  T within a process, and it must be consistent and valid in all threads U
+  of the process for which it can be guaranteed that T is running
+  concurrently with U.  The thread ID for a thread T must be retrievable
+  within thread T.  This will be done via OCIThreadIdGet().
+
+  The 'OCIThreadId' type supports the concept of a NULL thread ID: the NULL
+  thread ID will never be the same as the ID of an actual thread.
+
+
+
+1.2.2 Function prototypes for passive primitives
+--------------------------------------------------
+
+1.2.2.1 Mutex functions
+-------------------------
+
+  OCIThreadMutexInit - OCIThread MuteX Initialize
+  -----------------------------------------------
+
+    Description
+
+      This allocate and initializes a mutex.  All mutexes must be 
+      initialized prior to use.
+
+    Prototype
+
+      sword OCIThreadMutexInit(dvoid *hndl, OCIError *err, 
+                               OCIThreadMutex **mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        mutex(OUT):  The mutex to initialize.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      Multiple threads must not initialize the same mutex simultaneously.
+      Also, a mutex must not be reinitialized until it has been destroyed (see
+      'OCIThreadMutexDestroy()').
+
+  OCIThreadMutexDestroy - OCIThread MuteX Destroy
+  -----------------------------------------------
+
+    Description
+
+      This destroys and deallocate a mutex.  Each mutex must be destroyed 
+      once it is no longer needed.
+
+    Prototype
+
+      sword OCIThreadMutexDestroy(dvoid *hndl, OCIError *err,
+                                  OCIThreadMutex **mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        mutex(IN/OUT):   The mutex to destroy.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is not legal to destroy a mutex that is uninitialized or is currently
+      held by a thread.  The destruction of a mutex must not occur concurrently
+      with any other operations on the mutex.  A mutex must not be used after
+      it has been destroyed.
+
+
+  OCIThreadMutexAcquire - OCIThread MuteX Acquire
+  -----------------------------------------------
+
+    Description
+
+      This acquires a mutex for the thread in which it is called.  If the mutex
+      is held by another thread, the calling thread is blocked until it can
+      acquire the mutex.
+
+    Prototype
+
+     sword OCIThreadMutexAcquire(dvoid *hndl, OCIError *err,
+                                 OCIThreadMutex *mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error, it is 
+                     recorded in err and this function returns OCI_ERROR.  
+                     Diagnostic information can be obtained by calling 
+                     OCIErrorGet().
+
+        mutex(IN/OUT):   The mutex to acquire.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to attempt to acquire an uninitialized mutex.
+
+      This function's behavior is undefined if it is used by a thread to
+      acquire a mutex that is already held by that thread.
+
+
+
+  OCIThreadMutexRelease - OCIThread MuteX Release
+  -----------------------------------------------
+
+    Description
+
+      This releases a mutex.  If there are any threads blocked on the mutex,
+      one of them will acquire it and become unblocked.
+
+    Prototype
+
+      sword OCIThreadMutexRelease(dvoid *hndl, OCIError *err,
+                                  OCIThreadMutex *mutex);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        mutex(IN/OUT):   The mutex to release.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to attempt to release an uninitialized mutex.  It is also
+      illegal for a thread to release a mutex that it does not hold.
+
+
+  OCIThreadKeyInit - OCIThread KeY Initialize
+  -------------------------------------------
+
+    Description
+
+      This creates a key.  Each call to this routine allocate and generates 
+      a new key that is distinct from all other keys.
+
+    Prototype
+
+      sword OCIThreadKeyInit(dvoid *hndl, OCIError *err, OCIThreadKey **key,
+                             OCIThreadKeyDestFunc destFn);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(OUT):    The 'OCIThreadKey' in which to create the new key.
+
+        destFn(IN):  The destructor for the key.  NULL is permitted.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      Once this function executes successfully, a pointer to an allocated and 
+      initialized key is return.  That key can be used with 'OCIThreadKeyGet()'
+      and 'OCIThreadKeySet()'.  The initial value of the key will be 'NULL' for
+      all threads.
+
+      It is illegal for this function to be called more than once to create the
+      same key (i.e., to be called more than once with the same value for the
+      'key' parameter).
+
+      If the 'destFn' parameter is not NULL, the routine pointed to by 'destFn'
+      will be called whenever a thread that has a non-NULL value for the key
+      terminates.  The routine will be called with one parameter.  The
+      parameter will be the key's value for the thread at the time at which the
+      thread terminated.
+      If the key does not need a destructor function, pass NULL for 'destFn'.
+
+
+  OCIThreadKeyDestroy - OCIThread KeY DESTROY
+  -------------------------------------------
+
+   Description
+
+     Destroy and deallocate the key pointed to by 'key'.
+
+    Prototype
+
+      sword OCIThreadKeyDestroy(dvoid *hndl, OCIError *err, 
+                                OCIThreadKey **key);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(IN/OUT):  The 'OCIThreadKey' in which to destroy the key.
+ 
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      This is different from the destructor function callback passed to the
+      key create routine.  This new destroy function 'OCIThreadKeyDestroy' is 
+      used to terminate any resources OCI THREAD acquired when it created 
+      'key'.  [The 'OCIThreadKeyDestFunc' callback type is a key VALUE 
+      destructor; it does in no way operate on the key itself.]
+
+      This must be called once the user has finished using the key.  Not
+      calling the key destroy function may result in memory leaks.
+
+
+
+
+1.2.2.2 Thread Key operations
+-------------------------------
+
+  OCIThreadKeyGet - OCIThread KeY Get value
+  -----------------------------------------
+
+    Description
+
+      This gets the calling thread's current value for a key.
+
+    Prototype
+
+      sword OCIThreadKeyGet(dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                            dvoid **pValue);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(IN):          The key.
+
+        pValue(IN/OUT):   The location in which to place the thread-specific
+                          key value.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to use this function on a key that has not been created
+      using 'OCIThreadKeyInit()'.
+
+      If the calling thread has not yet assigned a value to the key, 'NULL' is
+      placed in the location pointed to by 'pValue'.
+
+
+  OCIThreadKeySet - OCIThread KeY Set value
+  -----------------------------------------
+
+    Description
+
+      This sets the calling thread's value for a key.
+
+    Prototype
+
+      sword OCIThreadKeySet(dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                            dvoid *value);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        key(IN/OUT): The key.
+
+        value(IN):   The thread-specific value to set in the key.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      It is illegal to use this function on a key that has not been created
+      using 'OCIThreadKeyInit()'.
+
+1.2.2.3  Thread Id
+--------------------
+
+  OCIThreadIdInit - OCIThread Thread Id INITialize
+  --------------------------------------------------
+
+    Description
+
+      Allocate and initialize the thread id 'tid'.
+
+    Prototype
+
+      sword OCIThreadIdInit(dvoid *hndl, OCIError *err, OCIThreadId **tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid (OUT):   Pointer to the thread ID to initialize.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+
+  OCIThreadIdDestroy - OCIThread Thread Id DESTROY
+  --------------------------------------------------
+
+    Description
+
+      Destroy and deallocate the thread id 'tid'.
+
+    Prototype
+
+      sword OCIThreadIdDestroy(dvoid *hndl, OCIError *err, OCIThreadId **tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid(IN/OUT):        Pointer to the thread ID to destroy.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Note
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdSet - OCIThread Thread Id Set
+  -----------------------------------------
+
+    Description
+
+      This sets one 'OCIThreadId' to another.
+
+    Prototype
+
+      sword OCIThreadIdSet(dvoid *hndl, OCIError *err, 
+                           OCIThreadId *tidDest,
+                           OCIThreadId *tidSrc);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tidDest(OUT):   This should point to the location of the 'OCIThreadId'
+                        to be set to.
+
+        tidSrc(IN):     This should point to the 'OCIThreadId' to set from.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdSetNull - OCIThread Thread Id Set Null
+  ---------------------------------------------------------
+
+    Description
+
+      This sets the NULL thread ID to a given 'OCIThreadId'.
+
+    Prototype
+
+      sword OCIThreadIdSetNull(dvoid *hndl, OCIError *err,
+                               OCIThreadId *tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error, it is 
+                     recorded in err and this function returns OCI_ERROR.  
+                     Diagnostic information can be obtained by calling 
+                     OCIErrorGet().
+
+        tid(OUT):    This should point to the 'OCIThreadId' in which to put
+                     the NULL thread ID.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdGet - OCIThread Thread Id Get
+  ------------------------------------------
+
+    Description
+
+      This retrieves the 'OCIThreadId' of the thread in which it is called.
+
+    Prototype
+
+      sword OCIThreadIdGet(dvoid *hndl, OCIError *err,
+                           OCIThreadId *tid);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid(OUT):    This should point to the location in which to place the
+                     ID of the calling thread.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+      When OCIThread is used in a single-threaded environment,
+      OCIThreadIdGet() will always place the same value in the location
+      pointed to by 'tid'.  The exact value itself is not important.  The
+      important thing is that it is not the same as the NULL thread ID and
+      that it is always the same value.
+
+
+  OCIThreadIdSame - OCIThread Thread Ids Same?
+  ----------------------------------------------
+
+    Description
+
+      This determines whether or not two 'OCIThreadId's represent the same
+      thread.
+
+    Prototype
+
+      sword OCIThreadIdSame(dvoid *hndl, OCIError *err,
+                            OCIThreadId *tid1, OCIThreadId *tid2,
+                            boolean *result);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid1(IN):   Pointer to the first 'OCIThreadId'.
+
+        tid2(IN):   Pointer to the second 'OCIThreadId'.
+	
+	result(IN/OUT): Pointer to the result.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      If 'tid1' and 'tid2' represent the same thread, 'result' is set to TRUE.
+      Otherwise, 'result' is set to FALSE.
+
+      'result' is set to TRUE if both 'tid1' and 'tid2' are the NULL thread ID.
+
+      'ti1d' and 'tid2' should be initialized by OCIThreadIdInit().
+
+
+  OCIThreadIdNull - OCIThread Thread Id NULL?
+  ---------------------------------------------
+
+    Description
+
+      This determines whether or not a given 'OCIThreadId' is the NULL thread
+      ID.
+
+    Prototype
+
+      sword OCIThreadIdNull(dvoid *hndl, OCIError *err,
+                            OCIThreadId *tid,
+                            boolean *result);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tid(IN):    Pointer to the 'OCIThreadId' to check.
+
+	result(IN/OUT): Pointer to the result.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      If 'tid' is the NULL thread ID, 'result' is set to TRUE.  Otherwise, 
+      'result' is set to FALSE.
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+
+1.3 Active Threading Primitives
+=================================
+
+The active threading primitives deal with the manipulation of actual
+threads.  Because the specifications of most of these primitives require
+that it be possible to have multiple threads, they work correctly only in
+the enabled OCIThread; In the disabled OCIThread, they always return
+failure.  The exception is OCIThreadHandleGet(); it may be called in a 
+single-threaded environment, in which case it will have no effect.
+
+Active primitives should only be called by code running in a multi-threaded
+environment.  You can call OCIThreadIsMulti() to determine whether the 
+environment is multi-threaded or single-threaded.
+
+
+1.3.1  Types
+--------------
+
+1.3.1.1    OCIThreadHandle - OCIThread Thread Handle
+------------------------------------------------------
+
+  Type 'OCIThreadHandle' is used to manipulate a thread in the active
+  primitives:  OCIThreadJoin()and OCIThreadClose().  A thread handle opened by
+  OCIThreadCreate() must be closed in a matching call to
+  OCIThreadClose().  A thread handle is invalid after the call to
+  OCIThreadClose().
+
+  The distinction between a thread ID and a thread handle in OCIThread usage
+  follows the distinction between the thread ID and the thread handle on
+  Windows NT.  On many platforms, the underlying native types are the same.
+
+
+1.3.2  Functions
+------------------
+
+  OCIThreadHndInit - OCIThread HaNDle Initialize
+  ----------------------------------------------
+
+    Description
+
+      Allocate and initialize the thread handle.
+
+    Prototype
+
+      sword OCIThreadHndInit(dvoid *hndl, OCIError *err, 
+                             OCIThreadHandle **thnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        thnd(OUT):   The address of pointer to the thread handle to initialize.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+
+  OCIThreadHndDestroy - OCIThread HaNDle Destroy
+  ----------------------------------------------
+
+    Description
+
+      Destroy and deallocate the thread handle.
+
+    Prototype
+
+      sword OCIThreadHndDestroy(dvoid *hndl, OCIError *err, 
+                                OCIThreadHandle **thnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        thnd(IN/OUT):  The address of pointer to the thread handle to destroy.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+
+  OCIThreadCreate - OCIThread Thread Create
+  -----------------------------------------
+
+    Description
+
+      This creates a new thread.
+
+    Prototype
+
+      sword OCIThreadCreate(dvoid *hndl, OCIError *err,
+                            void (*start)(dvoid *), dvoid *arg,
+                            OCIThreadId *tid, OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        start(IN):    The function in which the new thread should begin
+                      execution.
+
+        arg(IN):      The argument to give the function pointed to by 'start'.
+
+        tid(IN/OUT):  If not NULL, gets the ID for the new thread.
+
+        tHnd(IN/OUT): If not NULL, gets the handle for the new thread.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      The new thread will start by executing a call to the function pointed
+      to by 'start' with the argument given by 'arg'.  When that function
+      returns, the new thread will terminate.  The function should not
+      return a value and should accept one parameter, a 'dvoid *'.
+
+      The call to OCIThreadCreate() must be matched by a call to
+      OCIThreadClose() if and only if tHnd is non-NULL.
+
+      If tHnd is NULL, a thread ID placed in *tid will not be valid in the
+      calling thread because the timing of the spawned thread's termination
+      is unknown.
+
+      'tid' should be initialized by OCIThreadIdInit().
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+
+
+  OCIThreadJoin - OCIThread Thread Join
+  -------------------------------------
+
+    Description
+
+      This function allows the calling thread to 'join' with another thread.
+      It blocks the caller until the specified thread terminates.
+
+    Prototype
+
+      sword OCIThreadJoin(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tHnd(IN):    The 'OCIThreadHandle' of the thread to join with.
+
+    Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+      The result of multiple threads all trying to join with the same thread is
+      undefined.
+
+
+  OCIThreadClose - OCIThread Thread Close
+  ---------------------------------------
+
+   Description
+
+     This function should be called to close a thread handle.
+
+   Prototype
+
+     sword OCIThreadClose(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tHnd(IN/OUT):    The OCIThread thread handle to close.
+
+   Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+   Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().
+
+      Both thread handle and the thread ID that was returned by the same call
+      to OCIThreadCreate() are invalid after the call to OCIThreadClose().
+
+
+
+  OCIThreadHandleGet - OCIThread Thread Get Handle
+  ------------------------------------------------
+
+    Description
+
+      Retrieve the 'OCIThreadHandle' of the thread in which it is called.
+
+    Prototype
+
+      sword OCIThreadHandleGet(dvoid *hndl, OCIError *err,
+                               OCIThreadHandle *tHnd);
+
+        hndl(IN/OUT): The OCI environment or session handle.
+
+        err(IN/OUT): The OCI error handle.  If there is an error and OCI_ERROR
+                     is returned, the error is recorded in err and diagnostic 
+                     information can be obtained by calling OCIErrorGet().
+
+        tHnd(IN/OUT):      If not NULL, the location to place the thread
+                           handle for the thread.
+
+     Returns
+
+      OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
+
+    Notes
+
+      'thnd' should be initialized by OCIThreadHndInit().   
+
+      The thread handle 'tHnd' retrieved by this function must be closed 
+      with OCIThreadClose() and destroyed by OCIThreadHndDestroy() after it
+      is used.
+
+
+
+
+1.4 Using OCIThread
+=====================
+
+This section summarizes some of the more important details relating to the use
+of OCIThread.
+
+  * Process initialization
+
+    OCIThread only requires that the process initialization function
+    ('OCIThreadProcessInit()') be called when OCIThread is being used in a
+    multi-threaded application.  Failing to call 'OCIThreadProcessInit()' in
+    a single-threaded application is not an error.
+
+  * OCIThread initialization
+
+    Separate calls to 'OCIThreadInit()' will all return the same OCIThread
+    context.
+
+    Also, remember that each call to 'OCIThreadInit()' must eventually be
+    matched by a call to 'OCIThreadTerm()'.
+
+  * Active vs. Passive Threading primitives
+
+    OCIThread client code written without using any active primitives can be
+    compiled and used without change on both single-threaded and
+    multi-threaded platforms.
+
+    OCIThread client code written using active primitives will only work
+    correctly on multi-threaded platforms.  In order to write a version of the
+    same application to run on single-threaded platform, it is necessary to 
+    branch the your code, whether by branching versions of the source file or 
+    by branching at runtime with the OCIThreadIsMulti() call.
+
+******************************************************************************/
+
+/*****************************************************************************
+                         ACTUAL PROTOTYPE DECLARATIONS
+******************************************************************************/
+
+void OCIThreadProcessInit();
+
+sword OCIThreadInit(dvoid *hndl, OCIError *err);
+
+sword OCIThreadTerm(dvoid *hndl, OCIError *err);
+
+boolean OCIThreadIsMulti();
+
+sword OCIThreadMutexInit(dvoid *hndl, OCIError *err,  
+                         OCIThreadMutex **mutex); 
+
+sword OCIThreadMutexDestroy(dvoid *hndl, OCIError *err, 
+                            OCIThreadMutex **mutex);
+
+sword OCIThreadMutexAcquire(dvoid *hndl, OCIError *err,
+                            OCIThreadMutex *mutex);
+
+sword OCIThreadMutexRelease(dvoid *hndl, OCIError *err,
+                            OCIThreadMutex *mutex);
+
+sword OCIThreadKeyInit(dvoid *hndl, OCIError *err, OCIThreadKey **key,
+                       OCIThreadKeyDestFunc destFn);
+
+sword OCIThreadKeyDestroy(dvoid *hndl, OCIError *err, 
+                          OCIThreadKey **key);
+
+sword OCIThreadKeyGet(dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                      dvoid **pValue);
+
+sword OCIThreadKeySet(dvoid *hndl, OCIError *err, OCIThreadKey *key,
+                      dvoid *value);
+
+sword OCIThreadIdInit(dvoid *hndl, OCIError *err, OCIThreadId **tid);
+
+sword OCIThreadIdDestroy(dvoid *hndl, OCIError *err, OCIThreadId **tid);
+
+sword OCIThreadIdSet(dvoid *hndl, OCIError *err, 
+                     OCIThreadId *tidDest, OCIThreadId *tidSrc);
+
+sword OCIThreadIdSetNull(dvoid *hndl, OCIError *err, OCIThreadId *tid);
+
+sword OCIThreadIdGet(dvoid *hndl, OCIError *err, OCIThreadId *tid);
+
+sword OCIThreadIdSame(dvoid *hndl, OCIError *err,
+                      OCIThreadId *tid1, OCIThreadId *tid2,
+                      boolean *result);
+
+sword OCIThreadIdNull(dvoid *hndl, OCIError *err,
+                      OCIThreadId *tid, boolean *result);
+
+sword OCIThreadHndInit(dvoid *hndl, OCIError *err, OCIThreadHandle **thnd);
+
+sword OCIThreadHndDestroy(dvoid *hndl, OCIError *err, OCIThreadHandle **thnd);
+
+sword OCIThreadCreate(dvoid *hndl, OCIError *err,
+                      void (*start)(dvoid *), dvoid *arg,
+                      OCIThreadId *tid, OCIThreadHandle *tHnd);
+
+sword OCIThreadJoin(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+
+sword OCIThreadClose(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+
+sword OCIThreadHandleGet(dvoid *hndl, OCIError *err, OCIThreadHandle *tHnd);
+/*----------------- End OCI Thread interface Extensions ---------------------*/
+
+/*--------------- Begin OCI Client Notification Interfaces ------------------*/
+
+typedef ub4 (*OCISubscriptionNotify)(dvoid *ctx, OCISubscription *subscrhp, 
+				     dvoid *pay, ub4 payl, 
+				     dvoid *desc, ub4 mode);
+
+sword OCISubscriptionRegister(OCISvcCtx *svchp, OCISubscription **subscrhpp, 
+			      ub2 count, OCIError *errhp, ub4 mode);
+
+
+sword OCISubscriptionPost(OCISvcCtx *svchp, OCISubscription **subscrhpp, 
+			      ub2 count, OCIError *errhp, ub4 mode);
+
+sword OCISubscriptionUnRegister(OCISvcCtx *svchp, OCISubscription *subscrhp, 
+			      OCIError *errhp, ub4 mode);
+
+sword OCISubscriptionDisable(OCISubscription *subscrhp, 
+			   OCIError *errhp, ub4 mode);
+
+sword OCISubscriptionEnable(OCISubscription *subscrhp, 
+			  OCIError *errhp, ub4 mode);
+
+/*------------------- End OCI Publish/Subscribe Interfaces ------------------*/
+
+/*----------------- Extensions to Datetime interfaces -----------------------*/
+/*--------------------- Actual Prototypes -----------------------------------*/
+sword OCIDateTimeGetTime(dvoid *hndl, OCIError *err, OCIDateTime *datetime, 
+			 ub1 *hr, ub1 *mm, ub1 *ss, ub4 *fsec);
+
+sword OCIDateTimeGetDate(dvoid *hndl, OCIError *err,  CONST OCIDateTime *date, 
+		 sb2 *yr, ub1 *mnth, ub1 *dy );
+
+sword OCIDateTimeGetTimeZoneOffset(dvoid *hndl,OCIError *err,
+		  CONST OCIDateTime   *datetime,sb1 *hr,sb1 *mm);
+
+sword OCIDateTimeConstruct(dvoid  *hndl,OCIError *err,OCIDateTime *datetime,
+               sb2 yr,ub1 mnth,ub1 dy,ub1 hr,ub1 mm,ub1 ss,ub4 fsec,
+               OraText  *timezone,size_t timezone_length);
+
+sword OCIDateTimeSysTimeStamp(dvoid *hndl, OCIError *err, 
+			      OCIDateTime *sys_date );
+
+sword OCIDateTimeAssign(dvoid *hndl, OCIError *err, CONST OCIDateTime *from, 
+		       OCIDateTime *to);
+
+sword OCIDateTimeToText(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 
+                        CONST OraText *fmt, ub1 fmt_length, ub1 fsprec, 
+                        CONST OraText *lang_name, size_t lang_length, 
+                        ub4 *buf_size, OraText *buf );
+
+sword OCIDateTimeFromText(dvoid *hndl, OCIError *err, CONST OraText *date_str, 
+             size_t dstr_length, CONST OraText *fmt, ub1 fmt_length,
+             CONST OraText *lang_name, size_t lang_length, OCIDateTime *date );
+
+sword OCIDateTimeCompare(dvoid *hndl, OCIError *err, CONST OCIDateTime *date1, 
+                     CONST OCIDateTime *date2,  sword *result );
+
+sword OCIDateTimeCheck(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, 
+		 ub4 *valid );
+
+sword OCIDateTimeConvert(dvoid *hndl, OCIError *err, OCIDateTime *indate,
+				OCIDateTime *outdate);
+
+sword OCIDateTimeSubtract(dvoid *hndl, OCIError *err, OCIDateTime *indate1, 
+		OCIDateTime *indate2,	 OCIInterval *inter);
+
+sword OCIDateTimeIntervalAdd(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+	 OCIInterval *inter, OCIDateTime *outdatetime);
+
+sword OCIDateTimeIntervalSub(dvoid *hndl, OCIError *err, OCIDateTime *datetime,
+	 OCIInterval *inter, OCIDateTime *outdatetime);
+
+sword OCIIntervalSubtract(dvoid *hndl, OCIError *err, OCIInterval *minuend, 
+			    OCIInterval *subtrahend, OCIInterval *result );
+
+sword OCIIntervalAdd(dvoid *hndl, OCIError *err, OCIInterval *addend1, 
+			OCIInterval *addend2, OCIInterval *result );
+
+sword OCIIntervalMultiply(dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+			OCINumber *nfactor, OCIInterval *result );
+
+sword OCIIntervalDivide(dvoid *hndl, OCIError *err, OCIInterval *dividend, 
+		OCINumber *divisor, OCIInterval *result );
+
+sword OCIIntervalCompare(dvoid *hndl, OCIError *err, OCIInterval *inter1, 
+			OCIInterval *inter2, sword *result );
+
+sword OCIIntervalFromNumber(dvoid *hndl, OCIError *err, OCIInterval *inter, 
+			OCINumber *number);
+
+sword OCIIntervalFromText( dvoid *hndl, OCIError *err, CONST OraText *inpstr, 
+		size_t str_len, OCIInterval *result );
+
+sword OCIIntervalToText( dvoid *hndl, OCIError *err, CONST OCIInterval *inter,
+                         ub1 lfprec, ub1 fsprec, 
+			OraText *buffer, size_t buflen, size_t *resultlen );
+
+sword OCIIntervalToNumber(dvoid *hndl, OCIError *err,CONST OCIInterval *inter, 
+			OCINumber *number);
+
+sword OCIIntervalCheck(dvoid *hndl, OCIError *err, CONST OCIInterval *interval,
+			 ub4 *valid );
+
+sword OCIIntervalAssign(dvoid *hndl, OCIError *err, CONST OCIInterval *ininter,
+			OCIInterval *outinter );
+
+sword OCIIntervalSetYearMonth(dvoid *hndl, OCIError *err, sb4 yr, sb4 mnth,
+                        OCIInterval *result );
+
+sword OCIIntervalGetYearMonth(dvoid *hndl, OCIError *err, sb4 *yr, sb4 *mnth,
+                        CONST OCIInterval *result );
+
+sword OCIIntervalSetDaySecond(dvoid *hndl, OCIError *err, sb4 dy, sb4 hr,
+                        sb4 mm, sb4 ss, sb4 fsec, OCIInterval *result );
+
+sword OCIIntervalGetDaySecond(dvoid *hndl, OCIError *err, sb4 *dy, sb4 *hr,
+                     sb4 *mm, sb4 *ss, sb4 *fsec, CONST OCIInterval *result );
+
+sword OCIDateTimeToArray(dvoid *hndl, OCIError *err,
+                         CONST OCIDateTime *datetime, CONST OCIInterval *reftz,
+                         ub1 *outarray, ub4 *len, ub1 fsprec);
+
+sword OCIDateTimeFromArray(dvoid *hndl, OCIError *err, ub1 *inarray, ub4 len,
+                           ub1 type, OCIDateTime *datetime,
+                           CONST OCIInterval *reftz, ub1 fsprec);
+
+sword OCIDateTimeGetTimeZoneName(dvoid *hndl, OCIError *err,
+                                 CONST OCIDateTime *datetime, 
+                                 ub1 *buf, ub4 *buflen);
+
+sword OCIIntervalFromTZ(dvoid *hndl, OCIError *err, CONST oratext *inpstring,
+                        size_t str_len, OCIInterval *result);
+
+/*----------------- End Datetime interface Extensions -----------------------*/
+
+/*----------------- Connection Pooling prototypes ---------------------------*/
+sword OCIConnectionPoolCreate(OCIEnv *envhp, OCIError *errhp, OCICPool *poolhp,
+                              OraText **poolName, sb4 *poolNameLen,  
+                              CONST OraText *dblink, sb4 dblinkLen,
+                              ub4 connMin, ub4 connMax, ub4 connIncr,
+                              CONST OraText *poolUserName, sb4 poolUserLen,
+                              CONST OraText *poolPassword, sb4 poolPassLen,
+                              ub4 mode);
+
+sword OCIConnectionPoolDestroy(OCICPool *poolhp,
+                               OCIError *errhp, ub4 mode);
+
+/*----------------- End Connection Pooling prototypes -----------------------*/
+
+/*-------------------- Session Pooling prototypes ---------------------------*/
+
+sword OCISessionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCISPool *spoolhp, 
+                            OraText **poolName, ub4 *poolNameLen, 
+                            CONST OraText *connStr, ub4 connStrLen,
+                            ub4 sessMin, ub4 sessMax, ub4 sessIncr,
+                            OraText *userid, ub4 useridLen,
+                            OraText *password, ub4 passwordLen,
+                            ub4 mode);
+                                                  
+sword OCISessionPoolDestroy (OCISPool *spoolhp,
+                             OCIError *errhp,
+                             ub4 mode);
+                             
+sword OCISessionGet (OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp,
+                     OCIAuthInfo *authhp,
+                     OraText *poolName, ub4 poolName_len, 
+                     CONST OraText *tagInfo, ub4 tagInfo_len,
+                     OraText **retTagInfo, ub4 *retTagInfo_len,
+                     boolean *found, ub4 mode);
+
+sword OCISessionRelease (OCISvcCtx *svchp, OCIError *errhp,
+                         OraText *tag, ub4 tag_len,
+                         ub4 mode);
+
+/*-------------------- End Session Pooling prototypes -----------------------*/
+
+sword  OCIXMLTypeNew(OCISvcCtx *svchp, OCIError *errhp, OCIDuration dur,
+                     OraText *elname, ub4 elname_Len,
+                     OraText *schemaURL, ub4 schemaURL_Len,
+                     OCIXMLType **retInstance);
+
+sword  OCIXMLTypeCreateFromSrc(OCISvcCtx *svchp, OCIError *errhp,
+                     OCIDuration dur, ub1 src_type, dvoid *src_ptr,
+                     sb4 ind, OCIXMLType **retInstance);
+
+sword OCIXMLTypeExtract(OCIError *errhp,
+              OCIXMLType *doc, OCIDuration dur,
+              OraText *xpathexpr, ub4 xpathexpr_Len,
+              OraText *nsmap, ub4 nsmap_Len,
+              OCIXMLType **retDoc);
+
+sword OCIXMLTypeTransform(OCIError *errhp, OCIDuration dur,
+               OCIXMLType *doc, OCIXMLType *xsldoc,
+               OCIXMLType **retDoc);
+
+sword OCIXMLTypeExists(OCIError *errhp, OCIXMLType *doc,
+                 OraText *xpathexpr, ub4 xpathexpr_Len,
+                 OraText *nsmap, ub4 nsmap_Len,
+                 boolean *retval);
+
+sword OCIXMLTypeIsSchemaBased(OCIError *errhp,
+                              OCIXMLType *doc, boolean *retval);
+
+sword OCIXMLTypeGetSchema(OCIError *errhp, OCIXMLType *doc,
+             OCIXMLType **schemadoc,
+             OraText **schemaURL, ub4 *schemaURL_Len,
+             OraText **rootelem, ub4 *rootelem_Len);
+
+sword OCIXMLTypeValidate(OCIError *errhp, OCIXMLType *doc,
+                   OraText *schemaURL, ub4 schemaURL_Len, boolean *retval);
+
+sword OCIXMLTypeGetDOM(OCIError *errhp, OCIXMLType *doc, OCIDuration dur,
+                       OCIDOMDocument **retDom);
+
+sword OCIXMLTypeGetFromDOM(OCIError *errhp, OCIDOMDocument *domdoc,
+                           OCIXMLType **retXMLType);
+
+sword OCIDOMFree(OCIError *errhp, OCIDOMDocument *domdoc);
+
+
+/*---------------------------------------------------------------------------
+                          PRIVATE FUNCTIONS
+  ---------------------------------------------------------------------------*/
+
+            /* the following functions are depracated and should not be used */
+#ifdef NEVER
+sword   OCIStmtBindByPos  (OCIStmt *stmtp, OCIBind *bindp, OCIError *errhp,
+                  ub4 position, dvoid *valuep, sb4 value_sz,
+                  ub2 dty, dvoid *indp, ub2 *alenp, ub2 *rcodep,
+                  ub4 maxarr_len, ub4 *curelep, ub4 mode);
+
+
+sword   OCIStmtBindByName  (OCIStmt *stmtp, OCIBind *bindp, OCIError *errhp,
+                  CONST OraText *placeholder, sb4 placeh_len, dvoid *valuep, 
+                  sb4 value_sz, ub2 dty, dvoid *indp, ub2 *alenp, 
+                  ub2 *rcodep, ub4 maxarr_len, ub4 *curelep, ub4 mode);
+
+sword   ocidefn  (OCIStmt *stmtp, OCIDefine *defnp, OCIError *errhp,
+                  ub4 position, dvoid *valuep, sb4 value_sz, ub2 dty,
+                  dvoid *indp, ub2 *rlenp, ub2 *rcodep, ub4 mode);
+#endif /* NEVER */
+
+#endif                                                       /* OCIAP_ORACLE */
diff --git a/src/terralib/drivers/PAMDecoder/TeDecoderPAM.cpp b/src/terralib/drivers/PAMDecoder/TeDecoderPAM.cpp
old mode 100755
new mode 100644
index 75c8b2a..9eff6ae
--- a/src/terralib/drivers/PAMDecoder/TeDecoderPAM.cpp
+++ b/src/terralib/drivers/PAMDecoder/TeDecoderPAM.cpp
@@ -1,295 +1,295 @@
-#include "TeDecoderPAM.h"
-
-#include <TeAgnostic.h>
-#include <TeUtils.h>
-
-extern "C"
-{
-  #include <pam.h>
-}
-
-#include <assert.h>
-#include <string.h>
-
-
-TeDecoderPAM::TeDecoderPAM ()
-{ 
-  initVars();
-  
-  params_.decoderIdentifier_ = "PAM";
-};
-
-
-TeDecoderPAM::TeDecoderPAM ( const TeRasterParams& par )
-{
-  initVars();
-  
-  params_ = par; 
-  params_.decoderIdentifier_ = "PAM"; 
-};
-
-
-
-TeDecoderPAM::~TeDecoderPAM ()
-{
-  /* Writing data to disk file */
-  
-  if ( ( ( params_.mode_ == 'c' ) || ( params_.mode_ == 'w') ) &&
-    ( params_.status_ == TeRasterParams::TeReadyToWrite ) &&
-    ( params_.nBands() > 0 ) && ( params_.nlines_ > 0 ) && 
-    ( params_.ncols_ > 0 ) && ( ! params_.fileName_.empty() ) ) {
-    
-    /* Defining the PAM Handler */
-    
-    pam pam_file_handler;
-    
-    pam_file_handler.size = sizeof( pam );
-    pam_file_handler.len = sizeof( pam );
-    
-    std::string extension = TeConvertToUpperCase( TeGetExtension( 
-      params_.fileName_.c_str() ) );
-      
-    if( extension == "PBM" ) {
-      pam_file_handler.format = PBM_FORMAT;
-      strcpy( pam_file_handler.tuple_type, "BLACKANDWHITE" );
-    } else if( extension == "PGM" ) {
-      pam_file_handler.format = PGM_FORMAT;
-      strcpy( pam_file_handler.tuple_type, "GRAYSCALE" );
-    } else if( extension == "PPM" ) {
-      pam_file_handler.format = PPM_FORMAT;
-      strcpy( pam_file_handler.tuple_type, "RGB" );
-    } else {
-      TEAGN_LOG_AND_THROW( "Invalid file format" )
-    }
-    
-    pam_file_handler.plainformat = 0;
-    
-    pam_file_handler.height = params_.nlines_;
-    pam_file_handler.width = params_.ncols_;
-    pam_file_handler.depth = params_.nBands();
-    
-    switch( params_.dataType_[ 0 ] ) {
-      case TeUNSIGNEDCHAR :
-      {
-        pam_file_handler.maxval = 255;
-        pam_file_handler.bytes_per_sample = 1;
-        break;
-      }
-      case TeUNSIGNEDSHORT :
-      {
-        pam_file_handler.maxval = 65535;
-        pam_file_handler.bytes_per_sample = 2;
-        break;
-      }      
-      default :
-      {
-        TEAGN_LOG_AND_THROW( "Invalid data type" )
-        break;
-      }
-    }
-    
-    pam_file_handler.allocation_depth = params_.nBands();    
-  
-    FILE* image_file_ptr = fopen( params_.fileName_.c_str(), "w" );
-    if( image_file_ptr != 0 ) {
-      pam_file_handler.file = image_file_ptr;
-      
-      pnm_writepaminit( &pam_file_handler );    
-      
-      /* encoding data into file */
-        
-      tuple* tuple_ptr = pnm_allocpamrow( &pam_file_handler );
-      if( tuple_ptr == 0 ) {
-        fclose( image_file_ptr );
-        TEAGN_LOG_AND_THROW( "TeDecoderPAM init error" )
-      }
-        
-      int line = 0;
-      int col = 0;
-      unsigned int channel = 0; 
-      double value = 0;
-        
-      TeProgressBase* prog_interf = TeProgress::instance();
-      if( prog_interf != 0 ) {
-        prog_interf->setMessage( "Encoding image" );
-        prog_interf->setTotalSteps( 100 );
-      }
-        
-      for( line = 0 ; line < pam_file_handler.height ; ++line ) {
-        if( prog_interf != 0 ) {
-          prog_interf->setProgress( (int)( 100.0 * ( (double)line) / 
-            ((double)pam_file_handler.height ) ) );
-        }
-        
-        for( col = 0 ; col < pam_file_handler.width ; ++col ) {
-        
-          for( channel = 0 ; channel < pam_file_handler.depth ; ++channel ) {
-          
-            getElement( col, line, value, channel );
-            tuple_ptr[ col ][ channel ] = (sample)value;
-          }
-        }        
-        
-        pnm_writepamrow( &pam_file_handler, tuple_ptr );
-      }
-        
-      if( prog_interf != 0 ) {
-        prog_interf->reset();
-      }
-        
-      pnm_freepamrow( tuple_ptr );      
-    
-      fclose( image_file_ptr );
-    }  
-  }
-  
-  /* Free the memory structures */
-
-  clear();
-}
-
-void TeDecoderPAM::init()
-{
-  clear();
-  
-  params_.status_ = TeRasterParams::TeNotReady;
-  
-  if (params_.mode_ == 'c' || params_.mode_ == 'w') // creating a new file
-  {
-    bool params_checks_ok = true;
-    
-    std::string extension = TeConvertToUpperCase( TeGetExtension( 
-      params_.fileName_.c_str() ) );
-      
-    /* Checking extension */  
-      
-    if( ( extension == "PPM" ) && ( params_.nBands() != 3 ) ) {
-      params_checks_ok = false;
-    }
-    
-    /* Checking data type */
-    
-    for( int band_index = 0 ; band_index < params_.nBands() ;
-      ++band_index ) {
-      
-      if( ( params_.dataType_[ band_index ] != TeUNSIGNEDCHAR ) &&
-        ( params_.dataType_[ band_index ] != TeUNSIGNEDSHORT ) ) {
-        
-        TEAGN_LOGERR( "Invalid data type ( band " + Te2String( band_index ) +
-          ")" )
-        
-        params_checks_ok = false;
-        break;
-      }
-    }
-    
-    if( params_checks_ok ) {
-      TeDecoderSmartMem::init();
-    }
-  } else if (params_.mode_ == 'r') {
-    /* Creating PAM handler */
-    
-    FILE* image_file_ptr = fopen( params_.fileName_.c_str(), "r" );
-    if( image_file_ptr != 0 ) {
-      pam pam_file_handler;
-      
-      pnm_readpaminit( image_file_ptr, &pam_file_handler, 
-        PAM_STRUCT_SIZE(tuple_type) );
-        
-      if( ( pam_file_handler.height != 0  && ( pam_file_handler.width != 0 ) 
-        ) ) {
-        /* updating the current parameters */
-        
-        if( pam_file_handler.bytes_per_sample == 1 ) {
-          params_.setDataType( TeUNSIGNEDCHAR, -1 );  
-        } else if( pam_file_handler.bytes_per_sample == 2 ) {
-          params_.setDataType( TeUNSIGNEDSHORT, -1 );  
-        } else  {
-          fclose( image_file_ptr );
-          TEAGN_LOG_AND_THROW( "Invalid bytes_per_sample value" )
-        }
-        
-        params_.nBands( pam_file_handler.depth );
-        
-        std::string tuple_type( pam_file_handler.tuple_type );
-        if( tuple_type.find( "RGB" ) < tuple_type.size() ) {
-          params_.setPhotometric( TeRasterParams::TeRGB );
-        } else {
-          params_.setPhotometric( TeRasterParams::TeMultiBand );
-        }
-        
-        params_.useDummy_ = false;
-        
-        params_.setNLinesNColumns( pam_file_handler.height, 
-          pam_file_handler.width );
-          
-        /* Creating the new memory data structures */
-        
-        TeDecoderSmartMem::init();
-        
-        if( params_.status_ != TeRasterParams::TeNotReady ) {
-          /* Decoding data into memory */
-          
-          tuple* tuple_ptr = pnm_allocpamrow( &pam_file_handler );
-          if( tuple_ptr == 0 ) {
-            fclose( image_file_ptr );
-            TEAGN_LOG_AND_THROW( "TeDecoderPAM init error" )
-          }
-          
-          int line = 0;
-          int col = 0;
-          unsigned int channel = 0; 
-          
-          TeProgressBase* prog_interf = TeProgress::instance();
-          if( prog_interf != 0 ) {
-            prog_interf->setMessage( "Decoding image" );
-            prog_interf->setTotalSteps( 100 );
-          }
-          
-          for( line = 0 ; line < pam_file_handler.height ; ++line ) {
-            if( prog_interf != 0 ) {
-              prog_interf->setProgress( (int)( 100.0 * ( (double)line ) / 
-                ( (double)pam_file_handler.height ) ) );
-            }
-          
-            pnm_readpamrow( &pam_file_handler, tuple_ptr );
-              
-            for( col = 0 ; col < pam_file_handler.width ; ++col ) {
-              for( channel = 0 ; channel < pam_file_handler.depth ; ++channel ) {
-                setElement( col, line, (double)tuple_ptr[ col ][ channel ], 
-                  channel );
-              }
-            }
-          }
-          
-          if( prog_interf != 0 ) {
-            prog_interf->reset();
-          }
-          
-          pnm_freepamrow( tuple_ptr );
-        
-          params_.status_ = TeRasterParams::TeReadyToRead;
-        }
-      }
-      
-      fclose( image_file_ptr );
-    }
-  }
-}
-
-
-bool registerPAMDecoder()
-{
-  static TeDecoderPAMFactory TeDecoderPAMFactory_instance("PAM");
-  
-  TeDecoderFactory::instanceName2Dec()["PBM"] = "PAM";  
-  TeDecoderFactory::instanceName2Dec()["pbm"] = "PAM";
-
-  TeDecoderFactory::instanceName2Dec()["PGM"] = "PAM";  
-  TeDecoderFactory::instanceName2Dec()["pgm"] = "PAM";
-
-  TeDecoderFactory::instanceName2Dec()["PPM"] = "PAM";  
-  TeDecoderFactory::instanceName2Dec()["ppm"] = "PAM";
-  
-  return true;  
-};
+#include "TeDecoderPAM.h"
+
+#include <TeAgnostic.h>
+#include <TeUtils.h>
+
+extern "C"
+{
+  #include <pam.h>
+}
+
+#include <assert.h>
+#include <string.h>
+
+
+TeDecoderPAM::TeDecoderPAM ()
+{ 
+  initVars();
+  
+  params_.decoderIdentifier_ = "PAM";
+};
+
+
+TeDecoderPAM::TeDecoderPAM ( const TeRasterParams& par )
+{
+  initVars();
+  
+  params_ = par; 
+  params_.decoderIdentifier_ = "PAM"; 
+};
+
+
+
+TeDecoderPAM::~TeDecoderPAM ()
+{
+  /* Writing data to disk file */
+  
+  if ( ( ( params_.mode_ == 'c' ) || ( params_.mode_ == 'w') ) &&
+    ( params_.status_ == TeRasterParams::TeReadyToWrite ) &&
+    ( params_.nBands() > 0 ) && ( params_.nlines_ > 0 ) && 
+    ( params_.ncols_ > 0 ) && ( ! params_.fileName_.empty() ) ) {
+    
+    /* Defining the PAM Handler */
+    
+    pam pam_file_handler;
+    
+    pam_file_handler.size = sizeof( pam );
+    pam_file_handler.len = sizeof( pam );
+    
+    std::string extension = TeConvertToUpperCase( TeGetExtension( 
+      params_.fileName_.c_str() ) );
+      
+    if( extension == "PBM" ) {
+      pam_file_handler.format = PBM_FORMAT;
+      strcpy( pam_file_handler.tuple_type, "BLACKANDWHITE" );
+    } else if( extension == "PGM" ) {
+      pam_file_handler.format = PGM_FORMAT;
+      strcpy( pam_file_handler.tuple_type, "GRAYSCALE" );
+    } else if( extension == "PPM" ) {
+      pam_file_handler.format = PPM_FORMAT;
+      strcpy( pam_file_handler.tuple_type, "RGB" );
+    } else {
+      TEAGN_LOG_AND_THROW( "Invalid file format" )
+    }
+    
+    pam_file_handler.plainformat = 0;
+    
+    pam_file_handler.height = params_.nlines_;
+    pam_file_handler.width = params_.ncols_;
+    pam_file_handler.depth = params_.nBands();
+    
+    switch( params_.dataType_[ 0 ] ) {
+      case TeUNSIGNEDCHAR :
+      {
+        pam_file_handler.maxval = 255;
+        pam_file_handler.bytes_per_sample = 1;
+        break;
+      }
+      case TeUNSIGNEDSHORT :
+      {
+        pam_file_handler.maxval = 65535;
+        pam_file_handler.bytes_per_sample = 2;
+        break;
+      }      
+      default :
+      {
+        TEAGN_LOG_AND_THROW( "Invalid data type" )
+        break;
+      }
+    }
+    
+    pam_file_handler.allocation_depth = params_.nBands();    
+  
+    FILE* image_file_ptr = fopen( params_.fileName_.c_str(), "wb" );
+    if( image_file_ptr != 0 ) {
+      pam_file_handler.file = image_file_ptr;
+      
+      pnm_writepaminit( &pam_file_handler );    
+      
+      /* encoding data into file */
+        
+      tuple* tuple_ptr = pnm_allocpamrow( &pam_file_handler );
+      if( tuple_ptr == 0 ) {
+        fclose( image_file_ptr );
+        TEAGN_LOG_AND_THROW( "TeDecoderPAM init error" )
+      }
+        
+      int line = 0;
+      int col = 0;
+      unsigned int channel = 0; 
+      double value = 0;
+        
+      TeProgressBase* prog_interf = TeProgress::instance();
+      if( prog_interf != 0 ) {
+        prog_interf->setMessage( "Encoding image" );
+        prog_interf->setTotalSteps( 100 );
+      }
+        
+      for( line = 0 ; line < pam_file_handler.height ; ++line ) {
+        if( prog_interf != 0 ) {
+          prog_interf->setProgress( (int)( 100.0 * ( (double)line) / 
+            ((double)pam_file_handler.height ) ) );
+        }
+        
+        for( col = 0 ; col < pam_file_handler.width ; ++col ) {
+        
+          for( channel = 0 ; channel < pam_file_handler.depth ; ++channel ) {
+          
+            getElement( col, line, value, channel );
+            tuple_ptr[ col ][ channel ] = (sample)value;
+          }
+        }        
+        
+        pnm_writepamrow( &pam_file_handler, tuple_ptr );
+      }
+        
+      if( prog_interf != 0 ) {
+        prog_interf->reset();
+      }
+        
+      pnm_freepamrow( tuple_ptr );      
+    
+      fclose( image_file_ptr );
+    }  
+  }
+  
+  /* Free the memory structures */
+
+  clear();
+}
+
+void TeDecoderPAM::init()
+{
+  clear();
+  
+  params_.status_ = TeRasterParams::TeNotReady;
+  
+  if (params_.mode_ == 'c' || params_.mode_ == 'w') // creating a new file
+  {
+    bool params_checks_ok = true;
+    
+    std::string extension = TeConvertToUpperCase( TeGetExtension( 
+      params_.fileName_.c_str() ) );
+      
+    /* Checking extension */  
+      
+    if( ( extension == "PPM" ) && ( params_.nBands() != 3 ) ) {
+      params_checks_ok = false;
+    }
+    
+    /* Checking data type */
+    
+    for( int band_index = 0 ; band_index < params_.nBands() ;
+      ++band_index ) {
+      
+      if( ( params_.dataType_[ band_index ] != TeUNSIGNEDCHAR ) &&
+        ( params_.dataType_[ band_index ] != TeUNSIGNEDSHORT ) ) {
+        
+        TEAGN_LOGERR( "Invalid data type ( band " + Te2String( band_index ) +
+          ")" )
+        
+        params_checks_ok = false;
+        break;
+      }
+    }
+    
+    if( params_checks_ok ) {
+      TeDecoderSmartMem::init();
+    }
+  } else if (params_.mode_ == 'r') {
+    /* Creating PAM handler */
+    
+    FILE* image_file_ptr = fopen( params_.fileName_.c_str(), "rb" );
+    if( image_file_ptr != 0 ) {
+      pam pam_file_handler;
+      
+      pnm_readpaminit( image_file_ptr, &pam_file_handler, 
+        PAM_STRUCT_SIZE(tuple_type) );
+        
+      if( ( pam_file_handler.height != 0  && ( pam_file_handler.width != 0 ) 
+        ) ) {
+        /* updating the current parameters */
+        
+        if( pam_file_handler.bytes_per_sample == 1 ) {
+          params_.setDataType( TeUNSIGNEDCHAR, -1 );  
+        } else if( pam_file_handler.bytes_per_sample == 2 ) {
+          params_.setDataType( TeUNSIGNEDSHORT, -1 );  
+        } else  {
+          fclose( image_file_ptr );
+          TEAGN_LOG_AND_THROW( "Invalid bytes_per_sample value" )
+        }
+        
+        params_.nBands( pam_file_handler.depth );
+        
+        std::string tuple_type( pam_file_handler.tuple_type );
+        if( tuple_type.find( "RGB" ) < tuple_type.size() ) {
+          params_.setPhotometric( TeRasterParams::TeRGB );
+        } else {
+          params_.setPhotometric( TeRasterParams::TeMultiBand );
+        }
+        
+        params_.useDummy_ = false;
+        
+        params_.setNLinesNColumns( pam_file_handler.height, 
+          pam_file_handler.width );
+          
+        /* Creating the new memory data structures */
+        
+        TeDecoderSmartMem::init();
+        
+        if( params_.status_ != TeRasterParams::TeNotReady ) {
+          /* Decoding data into memory */
+          
+          tuple* tuple_ptr = pnm_allocpamrow( &pam_file_handler );
+          if( tuple_ptr == 0 ) {
+            fclose( image_file_ptr );
+            TEAGN_LOG_AND_THROW( "TeDecoderPAM init error" )
+          }
+          
+          int line = 0;
+          int col = 0;
+          unsigned int channel = 0; 
+          
+          TeProgressBase* prog_interf = TeProgress::instance();
+          if( prog_interf != 0 ) {
+            prog_interf->setMessage( "Decoding image" );
+            prog_interf->setTotalSteps( 100 );
+          }
+          
+          for( line = 0 ; line < pam_file_handler.height ; ++line ) {
+            if( prog_interf != 0 ) {
+              prog_interf->setProgress( (int)( 100.0 * ( (double)line ) / 
+                ( (double)pam_file_handler.height ) ) );
+            }
+          
+            pnm_readpamrow( &pam_file_handler, tuple_ptr );
+              
+            for( col = 0 ; col < pam_file_handler.width ; ++col ) {
+              for( channel = 0 ; channel < pam_file_handler.depth ; ++channel ) {
+                setElement( col, line, (double)tuple_ptr[ col ][ channel ], 
+                  channel );
+              }
+            }
+          }
+          
+          if( prog_interf != 0 ) {
+            prog_interf->reset();
+          }
+          
+          pnm_freepamrow( tuple_ptr );
+        
+          params_.status_ = TeRasterParams::TeReadyToRead;
+        }
+      }
+      
+      fclose( image_file_ptr );
+    }
+  }
+}
+
+
+bool registerPAMDecoder()
+{
+  static TeDecoderPAMFactory TeDecoderPAMFactory_instance("PAM");
+  
+  TeDecoderFactory::instanceName2Dec()["PBM"] = "PAM";  
+  TeDecoderFactory::instanceName2Dec()["pbm"] = "PAM";
+
+  TeDecoderFactory::instanceName2Dec()["PGM"] = "PAM";  
+  TeDecoderFactory::instanceName2Dec()["pgm"] = "PAM";
+
+  TeDecoderFactory::instanceName2Dec()["PPM"] = "PAM";  
+  TeDecoderFactory::instanceName2Dec()["ppm"] = "PAM";
+  
+  return true;  
+};
diff --git a/src/terralib/drivers/PAMDecoder/TeDecoderPAM.h b/src/terralib/drivers/PAMDecoder/TeDecoderPAM.h
old mode 100755
new mode 100644
index 0330369..e7156ef
--- a/src/terralib/drivers/PAMDecoder/TeDecoderPAM.h
+++ b/src/terralib/drivers/PAMDecoder/TeDecoderPAM.h
@@ -1,85 +1,85 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/** \file TeDecoderPAM.h
- *  \brief Implements a decoder to read/write PAM (Portable Arbitrary Maps) 
- * image files ( PBM, PGM, or PPM formats).
- */
-#ifndef  TEDECODERPAM_H
-#define  TEDECODERPAM_H
-
-#include <TeDecoderSmartMem.h>
-#include <TeRasterMemManager.h>
-
-class TeDecoderPAMFactory;
-
-/** 
- * @brief Implements a decoder to read/write PAM (Portable Arbitrary Maps) 
- * image files (PBM, PGM, or PPM formats).
- * @note No interleaving support.
- * @note libnetpbm devel 10.26 linking required.
- * @note Both TeDecoderPAM.h and TeDecoderPAM.cpp must be compiled into 
- * application code.
- * @note TeDecoderPAM.h must be included into application main.cpp to
- * register the decoder with the TerraLib decoder factory.
- * @note Only TeUNSIGNEDCHAR and TeUNSIGNEDSHORT supported formats.
- */
-class TeDecoderPAM : public TeDecoderSmartMem
-{
-
-public:
-
-  //! @brief Empty constructor
-  TeDecoderPAM ();
-
-  //! @brief Constructor from parameters
-  TeDecoderPAM ( const TeRasterParams& par );
-
-  //! @brief Destructor
-  virtual ~TeDecoderPAM ();
-
-  //! @brief Initializes the internal structures of the decoder
-  virtual void  init  ();
-
-};
-
-//! Implements a factory to build decoder to MEMORY raster
-class TeDecoderPAMFactory : public TeDecoderFactory
-{
-public:
-
-  //! Factory constructor
-  TeDecoderPAMFactory(const string& name) : TeDecoderFactory(name) {}
-
-  //! Builds the object
-  virtual TeDecoder* build (const TeRasterParams& arg)
-  {  return new TeDecoderPAM(arg); }
-};
-
-bool registerPAMDecoder();
-
-namespace {
-  static bool register_result = registerPAMDecoder();
-};  
-  
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/** \file TeDecoderPAM.h
+ *  \brief Implements a decoder to read/write PAM (Portable Arbitrary Maps) 
+ * image files ( PBM, PGM, or PPM formats).
+ */
+#ifndef  TEDECODERPAM_H
+#define  TEDECODERPAM_H
+
+#include <TeDecoderSmartMem.h>
+#include <TeRasterMemManager.h>
+
+class TeDecoderPAMFactory;
+
+/** 
+ * @brief Implements a decoder to read/write PAM (Portable Arbitrary Maps) 
+ * image files (PBM, PGM, or PPM formats).
+ * @note No interleaving support.
+ * @note libnetpbm devel 10.26 linking required.
+ * @note Both TeDecoderPAM.h and TeDecoderPAM.cpp must be compiled into 
+ * application code.
+ * @note TeDecoderPAM.h must be included into application main.cpp to
+ * register the decoder with the TerraLib decoder factory.
+ * @note Only TeUNSIGNEDCHAR and TeUNSIGNEDSHORT supported formats.
+ */
+class TeDecoderPAM : public TeDecoderSmartMem
+{
+
+public:
+
+  //! @brief Empty constructor
+  TeDecoderPAM ();
+
+  //! @brief Constructor from parameters
+  TeDecoderPAM ( const TeRasterParams& par );
+
+  //! @brief Destructor
+  virtual ~TeDecoderPAM ();
+
+  //! @brief Initializes the internal structures of the decoder
+  virtual void  init  ();
+
+};
+
+//! Implements a factory to build decoder to MEMORY raster
+class TeDecoderPAMFactory : public TeDecoderFactory
+{
+public:
+
+  //! Factory constructor
+  TeDecoderPAMFactory(const string& name) : TeDecoderFactory(name) {}
+
+  //! Builds the object
+  virtual TeDecoder* build (const TeRasterParams& arg)
+  {  return new TeDecoderPAM(arg); }
+};
+
+bool registerPAMDecoder();
+
+namespace {
+  static bool register_result = registerPAMDecoder();
+};  
+  
+#endif
+
diff --git a/src/terralib/drivers/PostgreSQL/TePGInterface.cpp b/src/terralib/drivers/PostgreSQL/TePGInterface.cpp
old mode 100755
new mode 100644
index 4176d3c..4900ade
--- a/src/terralib/drivers/PostgreSQL/TePGInterface.cpp
+++ b/src/terralib/drivers/PostgreSQL/TePGInterface.cpp
@@ -1,2532 +1,2566 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*
- * TODO: 1. NAO PEGAR O DOBRO DE REGISTROS NA VOLTA (MOVE PREVIOUS) NO FUTURO!!!!
- *       2. set datestyle = 'ISO, YMD'
- *
- */
-
-#include "TePGInterface.h"
-#include "TePGUtils.h"
-#include <stdexcept>
-#include <string>
-#include <climits>
-
-
-#include "TeUtils.h"
-
-/*
- *	Read/write mode flags for inversion (large object) calls
- */
-
-#define INV_WRITE		0x00020000
-#define INV_READ		0x00040000
-
-/*
- * Read buffer size
- */
-#define BUFFSIZE        1024
-
-/*
- * PostgreSQL Geometric Types
- */
-typedef struct
-{
-	double		x, y;
-} BIN_PG_POINT;
-
-using namespace std;
-
-/*******************************
- * FUN��ES AUXILIARES          *
- *******************************/
-// swapp bytes
-unsigned int TePGSwapUInt(const unsigned int& uintVal)
-{
-	char uintIn[4], uintOut[4];
-
-	unsigned int outVal;
-
-	memcpy(uintIn,&uintVal,4);
-
-	uintOut[0] = uintIn[3];
-	uintOut[1] = uintIn[2];
-	uintOut[2] = uintIn[1];
-	uintOut[3] = uintIn[0];
-
-	memcpy (&outVal,uintOut,4);
-
-	return outVal;
-}
-
-
-// This function is the same parse_hex function in PostGIS rc3 source code.
-inline unsigned char parse_hex(char *str)
-{
-	//do this a little brute force to make it faster
-
-	unsigned char		result_high = 0;
-	unsigned char		result_low = 0;
-
-	switch (str[0])
-	{
-		case '0' :
-			result_high = 0;
-			break;
-		case '1' :
-			result_high = 1;
-			break;
-		case '2' :
-			result_high = 2;
-			break;
-		case '3' :
-			result_high = 3;
-			break;
-		case '4' :
-			result_high = 4;
-			break;
-		case '5' :
-			result_high = 5;
-			break;
-		case '6' :
-			result_high = 6;
-			break;
-		case '7' :
-			result_high = 7;
-			break;
-		case '8' :
-			result_high = 8;
-			break;
-		case '9' :
-			result_high = 9;
-			break;
-		case 'A' :
-			result_high = 10;
-			break;
-		case 'B' :
-			result_high = 11;
-			break;
-		case 'C' :
-			result_high = 12;
-			break;
-		case 'D' :
-			result_high = 13;
-			break;
-		case 'E' :
-			result_high = 14;
-			break;
-		case 'F' :
-			result_high = 15;
-			break;
-	}
-	switch (str[1])
-	{
-		case '0' :
-			result_low = 0;
-			break;
-		case '1' :
-			result_low = 1;
-			break;
-		case '2' :
-			result_low = 2;
-			break;
-		case '3' :
-			result_low = 3;
-			break;
-		case '4' :
-			result_low = 4;
-			break;
-		case '5' :
-			result_low = 5;
-			break;
-		case '6' :
-			result_low = 6;
-			break;
-		case '7' :
-			result_low = 7;
-			break;
-		case '8' :
-			result_low = 8;
-			break;
-		case '9' :
-			result_low = 9;
-			break;
-		case 'A' :
-			result_low = 10;
-			break;
-		case 'B' :
-			result_low = 11;
-			break;
-		case 'C' :
-			result_low = 12;
-			break;
-		case 'D' :
-			result_low = 13;
-			break;
-		case 'E' :
-			result_low = 14;
-			break;
-		case 'F' :
-			result_low = 15;
-			break;
-	}
-	return (unsigned char) ((result_high<<4) + result_low);
-}
-
-//Os trechos abaixo fram retirados do codigo fonte do Servidor PostgreSQL, pois aqui utilizamos cursores binarios
-// timestamp values are stored as seconds before or after midnight 2000-01-01
-#define UNIX_EPOCH_JDATE		2440588 /* == date2j(1970, 1, 1) */
-
-#define POSTGRES_EPOCH_JDATE	2451545 /* == date2j(2000, 1, 1) */
-#define MAXDATELEN		51		/* maximum possible length of an input date string (not counting tr. null) */
-#define MAXDATEFIELDS	25		/* maximum possible number of fields in a date string */
-
-typedef int TeDateADT;
-typedef long long int te_int64;
-typedef te_int64 te_pg_time_t;
-
-typedef int te_fsec_t;
-
-/* Decide if we need to decorate 64-bit constants */
-//#ifdef HAVE_LL_CONSTANTS
-#define INT64CONST(x)  ((te_int64) x##LL)
-//#else
-//#define INT64CONST(x)  ((te_int64) x)
-//#endif
-
-
-#define DT_NOBEGIN		(-INT64CONST(0x7fffffffffffffff) - 1)
-#define DT_NOEND		(INT64CONST(0x7fffffffffffffff))
-
-#define TIMESTAMP_NOBEGIN(j)	do {j = DT_NOBEGIN;} while (0)
-#define TIMESTAMP_IS_NOBEGIN(j) ((j) == DT_NOBEGIN)
-
-#define TIMESTAMP_NOEND(j)		do {j = DT_NOEND;} while (0)
-#define TIMESTAMP_IS_NOEND(j)	((j) == DT_NOEND)
-
-#define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j))
-
-#define TMODULO_INT64(t,q,u) \
-do { \
-	q = (t / u); \
-	if (q != 0) t -= (q * u); \
-} while(0)
-
-
-
-struct te_pg_tm
-{
-	int			tm_sec;
-	int			tm_min;
-	int			tm_hour;
-	int			tm_mday;
-	int			tm_mon;			/* origin 0, not 1 */
-	int			tm_year;		/* relative to 1900 */
-	int			tm_wday;
-	int			tm_yday;
-	int			tm_isdst;
-	long int	tm_gmtoff;
-	const char *tm_zone;
-};
-
-inline void j2date(int jd, int *year, int *month, int *day)
-{
-	unsigned int julian;
-	unsigned int quad;
-	unsigned int extra;
-	int			y;
-
-	julian = jd;
-	julian += 32044;
-	quad = julian / 146097;
-	extra = (julian - quad * 146097) * 4 + 3;
-	julian += 60 + quad * 3 + extra / 146097;
-	quad = julian / 1461;
-	julian -= quad * 1461;
-	y = julian * 4 / 1461;
-	julian = ((y != 0) ? ((julian + 305) % 365) : ((julian + 306) % 366))
-		+ 123;
-	y += quad * 4;
-	*year = y - 4800;
-	quad = julian * 2141 / 65536;
-	*day = julian - 7834 * quad / 256;
-	*month = (quad + 10) % 12 + 1;
-
-	return;
-}	/* j2date() */
-
-/* EncodeDateOnly()
- * Encode date as local time.
- */
-inline bool EncodeDateOnly(struct te_pg_tm* tm, char *str)
-{
-	if ((tm->tm_mon < 1) || (tm->tm_mon > 12))
-		return false;
-
-	/* compatible with ISO date formats */
-	if (tm->tm_year > 0)
-		sprintf(str, "%04d-%02d-%02d",
-				tm->tm_year, tm->tm_mon, tm->tm_mday);
-	else
-		sprintf(str, "%04d-%02d-%02d %s", -(tm->tm_year - 1), tm->tm_mon, tm->tm_mday, "BC");
-
-	
-	return true;
-}	/* EncodeDateOnly() */
-
-inline  int time2tm(te_int64 time, struct te_pg_tm * tm, te_fsec_t *fsec)
-{
-	tm->tm_hour = (int)((time / INT64CONST(3600000000)));
-	time -= (tm->tm_hour * INT64CONST(3600000000));
-	tm->tm_min = (int)((time / INT64CONST(60000000)));
-	time -= (tm->tm_min * INT64CONST(60000000));
-	tm->tm_sec = (int)((time / INT64CONST(1000000)));
-	time -= (tm->tm_sec * INT64CONST(1000000));
-	*fsec = (te_fsec_t)time;
-
-	return 0;
-}
-
-/* EncodeTimeOnly()
- * Encode time fields only.
- */
-inline bool EncodeTimeOnly(struct te_pg_tm * tm, te_fsec_t fsec, int *tzp, char *str)
-{
-	if ((tm->tm_hour < 0) || (tm->tm_hour > 24))
-		return false;
-
-	sprintf(str, "%02d:%02d", tm->tm_hour, tm->tm_min);
-
-	/*
-	 * Print fractional seconds if any.  The field widths here should be
-	 * at least equal to the larger of MAX_TIME_PRECISION and
-	 * MAX_TIMESTAMP_PRECISION.
-	 */
-	if(fsec != 0)
-	{
-		sprintf((str + strlen(str)), ":%02d.%06d", tm->tm_sec, fsec);
-
-		/* chop off trailing pairs of zeros... */
-		while ((strcmp((str + strlen(str) - 2), "00") == 0)
-			   && (*(str + strlen(str) - 3) != '.'))
-			*(str + strlen(str) - 2) = '\0';
-	}
-	else
-		sprintf((str + strlen(str)), ":%02d", tm->tm_sec);
-
-	if(tzp != NULL)
-	{
-		int			hour,
-					min;
-
-		hour = -(*tzp / 3600);
-		min = ((abs(*tzp) / 60) % 60);
-		sprintf((str + strlen(str)), ((min != 0) ? "%+03d:%02d" : "%+03d"), hour, min);
-	}
-
-	return true;
-}	/* EncodeTimeOnly() */
-
-inline void TrimTrailingZeros(char *str)
-{
-	size_t	len = strlen(str);
-
-	/* chop off trailing zeros... but leave at least 2 fractional digits */
-	while ((*(str + len - 1) == '0') && (*(str + len - 3) != '.'))
-	{
-		len--;
-		*(str + len) = '\0';
-	}
-}
-
-
-/* EncodeDateTime()
- * Encode date and time interpreted as local time.
- * Support several date styles:
- *	Postgres - day mon hh:mm:ss yyyy tz
- *	SQL - mm/dd/yyyy hh:mm:ss.ss tz
- *	ISO - yyyy-mm-dd hh:mm:ss+/-tz
- *	German - dd.mm.yyyy hh:mm:ss tz
- * Variants (affects order of month and day for Postgres and SQL styles):
- *	US - mm/dd/yyyy
- *	European - dd/mm/yyyy
- */
-inline bool EncodeDateTime(struct te_pg_tm * tm, te_fsec_t fsec, int *tzp, char ** /* tzn */, char *str)
-{
-	int			hour,
-				min;
-
-	if ((tm->tm_mon < 1) || (tm->tm_mon > 12))
-		return false;
-
-	/* Compatible with ISO-8601 date formats */
-
-	sprintf(str, "%04d-%02d-%02d %02d:%02d",
-		  ((tm->tm_year > 0) ? tm->tm_year : -(tm->tm_year - 1)),
-			tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min);
-
-	/*
-		* Print fractional seconds if any.  The field widths here
-		* should be at least equal to MAX_TIMESTAMP_PRECISION.
-		*
-		* In float mode, don't print fractional seconds before 1 AD,
-		* since it's unlikely there's any precision left ...
-		*/
-
-	if (fsec != 0)
-	{
-		sprintf((str + strlen(str)), ":%02d.%06d", tm->tm_sec, fsec);
-		TrimTrailingZeros(str);
-	}
-	else
-        sprintf((str + strlen(str)), ":%02d", tm->tm_sec);
-
-	/*
-		* tzp == NULL indicates that we don't want *any* time zone
-		* info in the output string. *tzn != NULL indicates that we
-		* have alpha time zone info available. tm_isdst != -1
-		* indicates that we have a valid time zone translation.
-		*/
-	if ((tzp != NULL) && (tm->tm_isdst >= 0))
-	{
-		hour = -(*tzp / 3600);
-		min = ((abs(*tzp) / 60) % 60);
-		sprintf((str + strlen(str)), ((min != 0) ? "%+03d:%02d" : "%+03d"), hour, min);
-	}
-
-	if (tm->tm_year <= 0)
-		sprintf((str + strlen(str)), " BC");
-
-	return true;
-}
-
-
-/* EncodeSpecialTimestamp()
- * Convert reserved timestamp data type to string.
- */
-inline bool EncodeSpecialTimestamp(te_int64 dt, char *str)
-{
-	if (TIMESTAMP_IS_NOBEGIN(dt))
-		strcpy(str, "-infinity");
-	else if (TIMESTAMP_IS_NOEND(dt))
-		strcpy(str, "infinity");
-	else
-		return false;
-
-	return true;
-}	/* EncodeSpecialTimestamp() */
-
-inline  void dt2time(te_int64 jd, int *hour, int *min, int *sec, te_fsec_t *fsec)
-{
-
-	te_int64		time;
-
-	time = jd;
-
-	*hour = (int)((time / INT64CONST(3600000000)));
-	time -= ((*hour) * INT64CONST(3600000000));
-	*min = (int)((time / INT64CONST(60000000)));
-	time -= ((*min) * INT64CONST(60000000));
-	*sec = (int)((time / INT64CONST(1000000)));
-	*fsec = (te_fsec_t)(time - (*sec * INT64CONST(1000000)));
-
-	return;
-}	/* dt2time() */
-
-
-/*
- * timestamp2tm() - Convert timestamp data type to POSIX time structure.
- *
- * Note that year is _not_ 1900-based, but is an explicit full value.
- * Also, month is one-based, _not_ zero-based.
- * Returns:
- *	 0 on success
- *	-1 on out of range
- */
-bool timestamp2tm(te_int64 dt, int *tzp, struct te_pg_tm * tm, te_fsec_t *fsec, char **tzn)
-{
-	te_int64 date;
-	te_int64	time;
-
-	/*
-	 * If HasCTZSet is true then we have a brute force time zone
-	 * specified. Go ahead and rotate to the local time zone since we will
-	 * later bypass any calls which adjust the tm fields.
-	 */
-	//if (HasCTZSet && (tzp != NULL))
-	//{
-	//	dt -= CTimeZone * INT64CONST(1000000);
-	//
-	//}
-
-	time = dt;
-
-	TMODULO_INT64(time, date, INT64CONST(86400000000));
-
-	if (time < INT64CONST(0))
-	{
-		time += INT64CONST(86400000000);
-		date	  -=1;
-	}
-
-	/* add offset to go from J2000 back to standard Julian date */
-	date	  +=POSTGRES_EPOCH_JDATE;
-
-	/* Julian day routine does not work for negative Julian days */
-	if (date <0 || date > (te_int64) INT_MAX)
-		return false;
-
-	j2date((int) date, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
-	dt2time(time, &tm->tm_hour, &tm->tm_min, &tm->tm_sec, fsec);
-
-	/* Done if no TZ conversion wanted */
-	if (tzp == NULL)
-	{
-		tm->tm_isdst = -1;
-		tm->tm_gmtoff = 0;
-		tm->tm_zone = NULL;
-		if (tzn != NULL)
-			*tzn = NULL;
-		return true;
-	}
-
-	return false;
-//	return true;
-}
-
-/*******************************
- * Definicao de TePGConnection *
- *******************************/
-bool TePGConnection::open(const string& str_connection)
-{
-	close();
-
-	pg_connection_ = PQconnectdb(str_connection.c_str());
-
-	if(this->state())
-	{
-		int_connection_ = 1;
-
-		string off = "off";
-		string answer = PQparameterStatus(pg_connection_, "integer_datetimes");
-
-		if(answer == off)
-			isDateInt_ = false;
-
-		return true;
-	}
-	else
-		return false;
-}
-
-void TePGConnection::close(void)
-{
- if(int_connection_)
-   {
-    if(pg_connection_)
-      {
-       PQfinish(pg_connection_);
-      }
-    pg_connection_ = 0;
-    int_connection_ = 0;
-   }
- return;
-}
-
-
-int TePGConnection::exec_cmd(const string& str_qry)
-{
- PGresult *result_temp;
- int resp = -1;
- result_temp = PQexec(pg_connection_, str_qry.c_str());
-
-    switch (PQresultStatus(result_temp))
-	{
-		case PGRES_EMPTY_QUERY: // The string sent to the backend was empty.
-				break;
-		case PGRES_COMMAND_OK: // Successful completion of a command returning no data
-			    resp = atoi(PQcmdTuples(result_temp));
-				last_oid_ = PQoidValue(result_temp);
-				break;
-		case PGRES_TUPLES_OK: // The query successfully executed
-				break;
-
-		case PGRES_COPY_OUT: // Copy Out (from server) data transfer started
-		case PGRES_COPY_IN: // Copy In (to server) data transfer started
-				break;
-
-		case PGRES_BAD_RESPONSE: // The server's response was not understood
-		case PGRES_NONFATAL_ERROR: // TODO: Is this one really an error?
-		case PGRES_FATAL_ERROR:
-			throw runtime_error("The server's response was not understood");
-
-		default:
-			throw logic_error("Internal lib TePGInterface error: ");
-	}
-
- PQclear(result_temp);
- result_temp = 0;
- return resp;
-}
-
-Oid TePGConnection::insertBlob(char* buff, const int& blobSize)
-{
-	if(!buff)
-		return 0;
-
-	Oid obj_oid = lo_creat(pg_connection_, INV_READ | INV_WRITE);
-
-	int fd  = lo_open(pg_connection_, obj_oid, INV_READ);
-
-	if(fd < 0)
-		return 0;
-
-	int nbwrite = 0;
-
-	int size_tmp = blobSize;
-
-	while(size_tmp > 0)
-	{
-		if((size_tmp - BUFFSIZE) >= 0)
-			nbwrite = lo_write(pg_connection_, fd, buff, BUFFSIZE);				
-		else
-			nbwrite = lo_write(pg_connection_, fd, buff, size_tmp);
-
-		if(nbwrite <= 0)
-			return 0;
-
-		buff += nbwrite;
-		size_tmp -= nbwrite;
-	}
-
-	if(lo_close(pg_connection_, fd) == 0)
-		return obj_oid;
-
-	return 0;
-}
-
-int TePGConnection::getBlob(const Oid& blobId, char *&buff)
-{
-	int fd = lo_open(pg_connection_, blobId, INV_READ);
-
-	if(fd < 0)
-		return -1;
-
-	int len = lo_lseek(pg_connection_, fd, 0, SEEK_END);
-
-	lo_lseek(pg_connection_, fd, 0, SEEK_SET);
-
-	if(len <= 0)
-		return len;
-
-	if(!buff)
-		buff = new char[len];
-
-	char* buffAux = buff;
-
-	int nbread = 0;
-
-	while((nbread = lo_read(pg_connection_, fd, buffAux, BUFFSIZE)) > 0)
-		buffAux += nbread;
-
-	return len;
-}
-
-bool TePGConnection::beginTransaction(void)
-{
-	if(inTransaction_)
-		return true;
-
-	if(exec_cmd("BEGIN TRANSACTION") == 0)
-	{
-		inTransaction_ = true;
-
-		return true;
-	}
-
-	return false;
-}
-
-
-bool TePGConnection::commitTransaction(void)
-{
-	if(exec_cmd("COMMIT TRANSACTION") == 0)
-	{
-		inTransaction_ = false;
-
-		return true;
-	}
-
-	return false;
-}
-
-bool TePGConnection::rollBackTransaction(void)
-{
-	if(exec_cmd("ROLLBACK TRANSACTION") == 0)
-	{
-		inTransaction_ = false;
-
-		return true;
-	}
-
-	return false;
-}
-
-int TePGConnection::exec_cmd_params(const char *command,
-								int nParams,
-								const Oid *paramTypes,
-								const char * const *paramValues,
-								const int *paramLengths,
-								const int *paramFormats,
-								int resultFormat)
-{
-	PGresult *result_temp;
-	int resp = -1;
-	result_temp = PQexecParams(pg_connection_,
-                       command, 
-                       nParams,
-                       paramTypes,
-                       paramValues,
-                       paramLengths,
-                       paramFormats,
-                       resultFormat);
-
-	//errorMessage_= PQresultErrorMessage(result_temp);
-    switch (PQresultStatus(result_temp))
-	{
-		case PGRES_EMPTY_QUERY: // The string sent to the backend was empty.
-				break;
-		case PGRES_COMMAND_OK: // Successful completion of a command returning no data
-			    resp = atoi(PQcmdTuples(result_temp));
-				last_oid_ = PQoidValue(result_temp);
-				break;
-		case PGRES_TUPLES_OK: // The query successfully executed
-				break;
-
-		case PGRES_COPY_OUT: // Copy Out (from server) data transfer started
-		case PGRES_COPY_IN: // Copy In (to server) data transfer started
-				break;
-
-		case PGRES_BAD_RESPONSE: // The server's response was not understood
-		case PGRES_NONFATAL_ERROR: // TODO: Is this one really an error?
-		case PGRES_FATAL_ERROR:
-			throw runtime_error("The server's response was not understood");
-
-		default:
-			throw logic_error("Internal lib TePGInterface error: ");
-	}
-
-	PQclear(result_temp);
-	result_temp = 0;
-	return resp;
-}
-/******************************
- * Definicao de TePGRecordset *
- ******************************/
-const int TePGRecordset::int_bof_ = -1;
-int TePGRecordset::openRecordSets_ = 0;
-std::set<int> TePGRecordset::freeCursorNumbers_;
-TeMutex TePGRecordset::_mutexLock;
-
-//const int TePGRecordset::numRowsToRetrieve_ = 2000;
-
-TePGRecordset::TePGRecordset(const string& str_qry, TePGConnection* con_x,
-			                 const TeCursorType& cursorType,
-				             const TeCursorLocation& cursorLocation,
-				             const TeCursorDataType& cursorDataType,
-					         const int& numRowsToRetrieve)
- : pg_recordset_(0), conn_(con_x), cursorDeclared_(false), int_index_current_(-1),
-   int_eof_(-1), cursorType_(cursorType), cursorLocation_(cursorLocation), 
-   cursorDataType_(cursorDataType), numRowsToRetrieve_(numRowsToRetrieve)
-{
-	// endianness test
-	if(((unsigned int) 1) == htonl((unsigned int) 1))
-		isLittleEndian_ = false;	
-	else
-		isLittleEndian_ = true;
-
-	recordSetId_ = TePGRecordset::getFreeCursor();
-
-	/*if(freeCursorNumbers_.empty())
-	{	// Se n�o houver cursores livres aberto => criar novo id
-		++openRecordSets_;
-		recordSetId_ = openRecordSets_;
-	}
-	else
-	{
-		set<int>::iterator it = freeCursorNumbers_.begin();
-		recordSetId_ = *it;
-		freeCursorNumbers_.erase(it);
-	}*/
-
-	if(!str_qry.empty() && conn_)
-		open(str_qry, conn_, cursorType_, cursorLocation_, cursorDataType_);
-}
-
-TePGRecordset::~TePGRecordset()
-{	
-	// Deixa o id livre
-	//freeCursorNumbers_.insert(recordSetId_);
-	TePGRecordset::releaseCursor(recordSetId_);
-
-	close();
-}
-
-void TePGRecordset::close(void)
-{
-	if(cursorDeclared_ && conn_)
-	{
-		string sqlCloseCursor  = "CLOSE CURSOR_";
-	           sqlCloseCursor += Te2String(recordSetId_);
-
-		conn_->exec_cmd(sqlCloseCursor.c_str());
-	}	
-
-	freeRecordSet();
-
-	cursorDeclared_ = false;
-
-	conn_ = 0;
-
-	return;
-}
-
-bool TePGRecordset::moveFirst(void)
-{
-	if(!cursorDeclared_)
-		return false;
-
-	if(cursorLocation_ == TeCLIENTESIDE)
-	{
-		if(recordCount() > 0)
-		{
-			int_index_current_ = 0;
-			return true;
-		}
-		else
-			return false;
-	}
-
-	firstFetch = false;
-	lastFetch = false;
-
-	string moveFirstSQL  = "MOVE ABSOLUTE 0 IN CURSOR_";
-		   moveFirstSQL += Te2String(recordSetId_);
-
-	int res = conn_->exec_cmd(moveFirstSQL.c_str());
-
-	if(res == 0)
-	{
-		freeRecordSet();
-
-		string fetchSQL  = "FETCH FORWARD " + Te2String(numRowsToRetrieve_);
-	           fetchSQL += " FROM CURSOR_";
-		       fetchSQL += Te2String(recordSetId_);
-
-		pg_recordset_ = conn_->exec(fetchSQL.c_str());
-
-		if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
-		{
-			if(recordCount() > 0)
-			{
-				int_eof_ = recordCount();
-				int_index_current_ = 0;
-				return true;
-			}
-		}
-		
-		freeRecordSet();
-		return false;
-	}
- 
-	return false;
-}
-
-bool TePGRecordset::movePrevious(void)
-{	
-	//if(!cursorDeclared_ || (cursorType_ == TeUNIDIRECTIONAL))
-	if(!cursorDeclared_)
-		return false;
-
-	if(cursorLocation_ == TeCLIENTESIDE)
-	{
-		if(bof())
-			return false;
-		else
-		{
-			--int_index_current_;
-			return true;
-		}
-	}
-
-	if(recordCount() > 0)
-	{
-		string move = "";
-		string fetchSQL = "";
-
-		if(!movingBackward_)
-		{
-			 if(bof())
-				 return false;
-		
-			--int_index_current_;
-
-			if(bof())
-			{
-				movingBackward_ = true;
-
-				int val = recordCount() - 1;
-
-				if(lastFetch)
-				{
-					++val;
-				}
-
-				move = " MOVE BACKWARD "+Te2String(val)+" FROM CURSOR_"+Te2String(recordSetId_)+";";
-
-				fetchSQL = move;
-				fetchSQL += " FETCH BACKWARD ";
-				fetchSQL += Te2String(numRowsToRetrieve_);
-				fetchSQL += " FROM CURSOR_";
-				fetchSQL += Te2String(recordSetId_);
-			}
-			else
-			{
-				return true;
-			}
-		}
-		else
-		{
-			if(eof())
-				 return false;
-		
-			++int_index_current_;
-
-			if(eof())
-			{	
-				fetchSQL  = "FETCH BACKWARD ";
-				fetchSQL += Te2String(numRowsToRetrieve_);
-				fetchSQL += " FROM CURSOR_";
-				fetchSQL += Te2String(recordSetId_);
-			}
-			else
-			{
-				return true;
-			}
-		}
-		pg_recordset_ = conn_->exec(fetchSQL.c_str());
-
-		if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
-		{			
-			firstFetch = false;
-			lastFetch = false;
-			
-			if(this->recordCount() > 0)
-			{
-				int_eof_ = recordCount();
-				int_index_current_ = 0;
-
-				if(this->recordCount() != numRowsToRetrieve_)
-				{
-					firstFetch = true;
-				}
-
-
-				return true;
-			}
-			
-		}
-
-		freeRecordSet();
- 	}
-
-	return false;
-}
-
-bool TePGRecordset::moveNext(void)
-{
-	if(!cursorDeclared_)
-		return false;
-
-	if(cursorLocation_ == TeCLIENTESIDE)
-	{
-		if(eof())
-			return false;
-
-		++int_index_current_;
-
-		return true;
-	}
-
-	if((recordCount() > 0))
-	{
-		string move = "";
-		string fetchSQL = "";
-
-		if(!movingBackward_)
-		{	
-			if(!eof())
-			{
-				++int_index_current_;
-
-				if(eof())
-				{
-					fetchSQL  = "FETCH FORWARD ";
-					fetchSQL += Te2String(numRowsToRetrieve_);
-					fetchSQL += " FROM CURSOR_";
-					fetchSQL += Te2String(recordSetId_);
-				}
-				else
-				{
-					return true;
-				}
-			}
-		}
-		else
-		{
-			if(!bof())
-			{
-				--int_index_current_;
-
-				if(bof())
-				{
-					movingBackward_ = false;	
-					int val = recordCount() -1;
-					if(firstFetch)
-					{
-						++val;
-					}
-					move = " MOVE FORWARD "+Te2String(val)+" FROM CURSOR_"+Te2String(recordSetId_)+";";
-
-					fetchSQL = move;
-
-					fetchSQL += "FETCH FORWARD ";
-					fetchSQL += Te2String(numRowsToRetrieve_);
-					fetchSQL += " FROM CURSOR_";
-					fetchSQL += Te2String(recordSetId_);
-				}
-				else
-				{
-					return true;
-				}
-			}
-		}
-		freeRecordSet();
-
-		pg_recordset_ = conn_->exec(fetchSQL.c_str());
-
-		if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
-		{
-			firstFetch = false;
-			lastFetch = false;
-
-			if(recordCount() > 0)
-			{
-				int_eof_ = recordCount();
-				int_index_current_ = 0;
-
-				if(this->recordCount() != numRowsToRetrieve_)
-				{
-					lastFetch = true;
-				}
-				
-				return true;
-			}
-		}
-		
-		freeRecordSet();
-	}
-
-	return false;
-}
-
-bool TePGRecordset::moveLast(void)
-{
-	//if(!cursorDeclared_ || (cursorType_ == TeUNIDIRECTIONAL))
-	if(!cursorDeclared_)
-		return false;
-
-	if(cursorLocation_ == TeCLIENTESIDE)
-	{
-		if(recordCount() > 0)
-		{
-			int_index_current_ = recordCount() - 1;
-			return true;
-		}
-		
-		return false;
-	}
-
-	firstFetch = false;
-	lastFetch = false;
-
-	freeRecordSet();
-
-	string fetchSQL  = "FETCH LAST FROM CURSOR_";
-		   fetchSQL += Te2String(recordSetId_);
-
-	pg_recordset_ = conn_->exec(fetchSQL.c_str());
-
-	if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
-	{
-		if(this->recordCount() > 0)
-		{
-			int_eof_ = recordCount();
-			int_index_current_ = 0;
-			return true;
-		}		
-	}
-	
-	freeRecordSet();
- 
-	return false;
-	
-}
-
-bool TePGRecordset::moveTo(const int& lin_number)
-{
-	//if(!cursorDeclared_ || (cursorType_ == TeUNIDIRECTIONAL))
-	if(!cursorDeclared_)
-		return false;
-
-	if(cursorLocation_ == TeCLIENTESIDE)
-	{
-		if((lin_number > int_bof_) && (lin_number < int_eof_))
-		{
-			int_index_current_ = lin_number;
-			return true;
-		}
-		
-		return false;		
-	}
-
-	firstFetch = false;
-	lastFetch = false;
-
-	freeRecordSet();
-
-	string fetchSQL  = "FETCH ABSOLUTE ";
-		   fetchSQL += Te2String(lin_number);
-	       fetchSQL += " FROM CURSOR_";
-		   fetchSQL += Te2String(recordSetId_);
-
-	pg_recordset_ = conn_->exec(fetchSQL.c_str());
-
-	if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
-	{
-		if(this->recordCount() > 0)
-		{
-			int_eof_ = recordCount();
-			int_index_current_ = 0;
-			return true;
-		}
-	}
-
-	freeRecordSet();
- 
-	return false;	
-}
-
-bool TePGRecordset::open(const string& str_qry, TePGConnection* con_x,
-			      const TeCursorType& cursorType,
-				  const TeCursorLocation& cursorLocation,
-				  const TeCursorDataType& cursorDataType,
-				  const int& numRowsToRetrieve)
-{
-	close();
-
-	if(str_qry.empty() || !con_x)
-		return false;
-
-	cursorType_ = cursorType;
-	cursorLocation_ = cursorLocation;
-	cursorDataType_ = cursorDataType;
-	numRowsToRetrieve_ = numRowsToRetrieve;
-	cursorDeclared_ = false;
-	conn_ = con_x;
-	movingBackward_ = false;
-	lastFetch = false;
-	firstFetch = false;
-
-	string sqlCursor  = "DECLARE CURSOR_";
-		   sqlCursor += Te2String(recordSetId_);
-		   sqlCursor += (cursorDataType_  == TeBINARYCURSOR) ? " BINARY " : " ";
-		   //sqlCursor += (cursorType_ == TeUNIDIRECTIONAL) ? " NO " : " ";
-		   sqlCursor += "SCROLL CURSOR WITH HOLD FOR ";
-		   sqlCursor += str_qry;	
-
-	pg_recordset_ = conn_->exec(sqlCursor.c_str());
-
-	if(PQresultStatus(pg_recordset_) == PGRES_COMMAND_OK)
-	{
-		cursorDeclared_ = true;
-
-		string numRows = (cursorLocation_ == TeSERVERSIDE) ? Te2String(numRowsToRetrieve_) : string("ALL");
-		
-		string fetchSQL  = "FETCH FORWARD " + numRows;
-	           fetchSQL += " FROM CURSOR_";
-		       fetchSQL += Te2String(recordSetId_);
-
-		pg_recordset_ = conn_->exec(fetchSQL.c_str());
-
-		if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
-		{
-			if(recordCount() > 0)
-			{
-				int_eof_ = recordCount();
-				int_index_current_ = 0;				
-			}
-
-			return true;
-		}
-	}
-	
-	freeRecordSet();
-
-	return false;
-}
-
-int TePGRecordset::getBytea(const int& field_num, char*& buff) const
-{
-	if(cursorDataType_ == TeTEXTCURSOR)
-	{
-		size_t newLen;
-
-		unsigned char* ptData = PQunescapeBytea((unsigned char*)(value(field_num)), &newLen);
-
-		if(newLen <= 0)
-			return (int)newLen;
-		
-		if(!buff)
-			buff = new char[newLen];
-
-		memcpy(buff, ptData, newLen);
-
-		TePGConnection::freeMem(ptData);
-
-		return (int)newLen;
-	}
-	else	// TeBINARYCURSOR
-	{
-		unsigned int numBytes = PQgetlength(pg_recordset_, int_index_current_, field_num);
-
-		char* ptData = value(field_num);		
-
-		if(!buff)
-			buff = new char[numBytes];
-
-		memcpy(buff, ptData, numBytes);
-
-		return numBytes;
-	}
-}
-
-void TePGRecordset::getByteALine2D(const int& field_num, TeLine2D& l) const
-{
-	char* ptDataAux = 0;
-
-	unsigned long newLen = getBytea(field_num, ptDataAux);
-
-	double* data = (double*) ptDataAux;
-
-	unsigned int npts = newLen / (2 * sizeof(double));
-
-	double x, y;
-
-	for(unsigned int k = 0; k < npts; ++k)
-	{
-		x = (*data++);
-		y = (*data++);
-		
-		TeCoord2D pt(x,y);
-
-		l.add(pt);
-	}
-
-	delete [] ptDataAux;
-}
-
-void TePGRecordset::getPGBox(const int& field_num, TeBox& b) const
-{
-	char* pgbox = value(field_num);
-
-	if(cursorDataType_ == TeBINARYCURSOR)
-	{
-		// POINT ARRAY IS SUPPOSED ALWAYS IN BIG ENDIAN
-		BIN_PG_POINT* pts = (BIN_PG_POINT*)(pgbox);
-
-		// endianness test
-		if(isLittleEndian_)
-		{
-			union
-			{
-				double dWord_;
-				unsigned int aux_[2];
-			} swapx1, swapy1, swapx2, swapy2;
-
-			// little-endian
-			swapx1.dWord_ = pts[0].x;
-			swapy1.dWord_ = pts[0].y;
-
-			swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
-			swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
-
-			swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
-			swapy2.aux_[0] = ntohl(swapy1.aux_[1]);
-
-			double X2 = swapx2.dWord_;
-			double Y2 = swapy2.dWord_;
-
-			swapx1.dWord_ = pts[1].x;
-			swapy1.dWord_ = pts[1].y;
-
-			swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
-			swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
-
-			swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
-			swapy2.aux_[0] = ntohl(swapy1.aux_[1]);
-
-			double X1 = swapx2.dWord_;
-			double Y1 = swapy2.dWord_;
-
-			TeBox baux(X1, Y1, X2, Y2);
-
-			b = baux;						
-		}
-		else
-		{
-			// big-endian!
-			double X2 = pts[0].x;
-			double Y2 = pts[0].y;
-			double X1 = pts[1].x;
-			double Y1 = pts[1].y;
-			TeBox baux(X1, Y1, X2, Y2);
-
-			b = baux;
-		}
-	}
-	else	//TeTEXTCURSOR
-		b = PGBoxRtree_decode(pgbox);
-}
-
-void TePGRecordset::getPGLine2D(const int& field_num, TeLine2D& l) const
-{
-	char* polygon = value(field_num);
-
-	if(cursorDataType_ == TeBINARYCURSOR)
-	{
-		unsigned int numPts;
-		memcpy(&numPts, polygon, sizeof(int));
-		numPts = ntohl(numPts);
-
-		l.reserve(numPts);
-
-		// POINT ARRAY IS SUPPOSED ALWAYS IN BIG ENDIAN
-		BIN_PG_POINT* pts = (BIN_PG_POINT*)(polygon + sizeof(int));		
-
-		// endianness test
-		if(isLittleEndian_)
-		{
-			union
-			{
-				double dWord_;
-				unsigned int aux_[2];
-			} swapx1, swapy1, swapx2, swapy2;
-
-			// little-endian
-			for(unsigned int i = 0; i < numPts ; ++i)
-			{
-				swapx1.dWord_ = pts[i].x;
-				swapy1.dWord_ = pts[i].y;
-
-				swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
-				swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
-
-				swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
-				swapy2.aux_[0] = ntohl(swapy1.aux_[1]);
-
-				l.add(TeCoord2D(swapx2.dWord_, swapy2.dWord_));
-			}
-			
-		}
-		else
-		{
-			// big-endian!
-			for(unsigned int i = 0; i < numPts ; ++i)
-				l.add(TeCoord2D(pts[i].x, pts[i].y));
-			
-		}
-	}
-	else	//TeTEXTCURSOR
-		l = PgGeomPolygon2Te(polygon);
-}
-
-char* TePGRecordset::getWKBHeader(char* v, unsigned char &byteOrder, unsigned int &wkbType, unsigned int &numGeometries) const
-{
-	const int byteOrderPlusGeomType = sizeof(unsigned char) + sizeof(unsigned int);	
-
-	if(cursorDataType_ == TeTEXTCURSOR)
-	{
-		unsigned char header [byteOrderPlusGeomType];
-
-		for (int t = 0; t < byteOrderPlusGeomType; ++t)
-		{
-			header[t] =(unsigned char) parse_hex(v) ;
-			v += 2;
-		}
-
-		memcpy(&byteOrder, header, sizeof(unsigned char));		
-		memcpy(&wkbType, header + sizeof(unsigned char), sizeof(unsigned int));
-	}
-	else
-	{
-		memcpy(&byteOrder, v, sizeof(unsigned char));		
-		memcpy(&wkbType, v + sizeof(unsigned char), sizeof(unsigned int));
-
-		v += byteOrderPlusGeomType;
-	}	
-	
-
-	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-	if((byteOrder == 0) && isLittleEndian_)
-	{
-		wkbType = ntohl(wkbType);
-	}
-	else if((byteOrder == 1) && !isLittleEndian_)
-	{
-		wkbType = TePGSwapUInt(wkbType);
-	}	
-
-	numGeometries = 0;
-
-	if(wkbType > 1 && wkbType <= 7)
-	{
-		if(cursorDataType_ == TeTEXTCURSOR)
-		{
-			unsigned char qtd[sizeof(unsigned int)];
-
-			for(unsigned int t = 0; t < sizeof(unsigned int); ++t)
-			{
-				qtd[t] = (unsigned char)parse_hex(v);
-				v += 2;
-			}
-
-			memcpy(&numGeometries, qtd, sizeof(unsigned int));
-		}
-		else
-		{
-			memcpy(&numGeometries, v, sizeof(unsigned int));
-			v += sizeof(unsigned int);
-		}
-
-		// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-		if((byteOrder == 0) && isLittleEndian_)
-		{
-			numGeometries = ntohl(numGeometries);	
-		}
-		else if((byteOrder == 1) && !isLittleEndian_)
-		{
-			numGeometries = TePGSwapUInt(numGeometries);
-		}
-	}
-
-	return v;	
-}
-
-char* TePGRecordset::getWKBPoint(char* v, TeCoord2D& c) const
-{
-	unsigned char byteOrder;
-	unsigned int wkbType;
-	unsigned int numGeometries;
-
-	v = getWKBHeader(v, byteOrder, wkbType, numGeometries);
-	
-	if(wkbType != 1)
-		throw logic_error("Binary data doesn't supported!");
-		
-
-	union
-	{
-		double dWord_;
-		unsigned int aux_[2];
-	} swapx1, swapy1;
-
-	if(cursorDataType_ == TeTEXTCURSOR)
-	{
-
-		const int double2Size = 2 * sizeof(double);
-		unsigned char data[double2Size];
-		
-		for(int t = 0; t < double2Size; ++t) // len/2
-		{
-			data[t] = (unsigned char)parse_hex(v);
-			v += 2;
-		}
-		
-
-		memcpy(&swapx1.dWord_, data , sizeof(double));
-		memcpy(&swapy1.dWord_, data + sizeof(double), sizeof(double));
-	}
-	else
-	{
-		memcpy(&swapx1.dWord_, v , sizeof(double));
-		memcpy(&swapy1.dWord_, v + sizeof(double), sizeof(double));
-
-		v += (sizeof(double) + sizeof(double)); // x + y
-	}
-
-	// 0 = Big Endian (wkbXDR)
-	if((byteOrder == 0) && isLittleEndian_)
-	{
-		union
-		{
-			double dWord_;
-			unsigned int aux_[2];
-		} swapx2, swapy2;
-
-		swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
-		swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
-
-		swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
-		swapy2.aux_[0] = ntohl(swapy1.aux_[1]);	
-		
-		c.x(swapx2.dWord_);
-		c.y(swapy2.dWord_);
-
-		return v;
-	}
-	else if((byteOrder == 1) && !isLittleEndian_)
-	{
-		union
-		{
-			double dWord_;
-			unsigned int aux_[2];
-		} swapx2, swapy2;
-
-		swapx2.aux_[1] = TePGSwapUInt(swapx1.aux_[0]);
-		swapx2.aux_[0] = TePGSwapUInt(swapx1.aux_[1]);
-
-		swapy2.aux_[1] = TePGSwapUInt(swapy1.aux_[0]);
-		swapy2.aux_[0] = TePGSwapUInt(swapy1.aux_[1]);
-		
-		c.x(swapx2.dWord_);
-		c.y(swapy2.dWord_);
-
-		return v;
-
-	}
-
-	c.x(swapx1.dWord_);
-	c.y(swapy1.dWord_);
-
-	return v;
-}
-
-char* TePGRecordset::getWKBLinearRing(char* v, int byteOrder, TeLine2D &line) const
-{
-	unsigned int numPoints;
-	
-	const int size2Double = sizeof(double) + sizeof(double); // x + y
-
-	if(cursorDataType_ == TeTEXTCURSOR)
-	{
-		unsigned char data[size2Double];
-
-		for(unsigned int n = 0; n < sizeof(unsigned int); ++n)
-		{
-			data[n] = (unsigned char)parse_hex(v);
-			v += 2;
-		}
-
-		memcpy(&numPoints, data , sizeof(unsigned int));
-	}
-	else
-	{
-		memcpy(&numPoints, v , sizeof(unsigned int));
-		v += sizeof(unsigned int);
-	}
-
-	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-	if((byteOrder == 0) && isLittleEndian_)
-	{
-		numPoints = ntohl(numPoints);	
-	}
-	else if((byteOrder == 1) && !isLittleEndian_)
-	{
-		numPoints = TePGSwapUInt(numPoints);
-	}
-
-	for(unsigned int i = 0; i < numPoints; ++i)
-	{
-		union
-		{
-			double dWord_;
-			unsigned int aux_[2];
-		} swapx1, swapy1;
-
-		if(cursorDataType_ == TeTEXTCURSOR)
-		{
-			unsigned char data[size2Double];
-
-			for(int t = 0; t < size2Double; ++t) // len/2
-			{
-				data[t] = (unsigned char)parse_hex(v);
-				v += 2;
-			}	
-
-			memcpy(&swapx1.dWord_, data , sizeof(double));
-			memcpy(&swapy1.dWord_, data + sizeof(double), sizeof(double));
-		}
-		else
-		{
-			memcpy(&swapx1.dWord_, v , sizeof(double));
-			memcpy(&swapy1.dWord_, v + sizeof(double), sizeof(double));
-			v += size2Double;
-		}
-
-		// 0 = Big Endian (wkbXDR)
-		if((byteOrder == 0) && isLittleEndian_)
-		{
-			union
-			{
-				double dWord_;
-				unsigned int aux_[2];
-			} swapx2, swapy2;
-
-			swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
-			swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
-
-			swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
-			swapy2.aux_[0] = ntohl(swapy1.aux_[1]);	
-			
-			line.add(TeCoord2D(swapx2.dWord_, swapy2.dWord_));			
-		}
-		else if((byteOrder == 1) && !isLittleEndian_)	//1 = Little Endian (wkbNDR)
-		{
-			union
-			{
-				double dWord_;
-				unsigned int aux_[2];
-			} swapx2, swapy2;
-
-			swapx2.aux_[1] = TePGSwapUInt(swapx1.aux_[0]);
-			swapx2.aux_[0] = TePGSwapUInt(swapx1.aux_[1]);
-
-			swapy2.aux_[1] = TePGSwapUInt(swapy1.aux_[0]);
-			swapy2.aux_[0] = TePGSwapUInt(swapy1.aux_[1]);
-			
-			line.add(TeCoord2D(swapx2.dWord_, swapy2.dWord_));
-		}
-		else
-		{
-			line.add(TeCoord2D(swapx1.dWord_, swapy1.dWord_));
-		}
-	}
-
-	return v;
-
-}
-
-char* TePGRecordset::getWKBLine(char* v, TeLine2D& l) const
-{
-	unsigned char byteOrder;
-	unsigned int wkbType;
-	unsigned int numPoints;
-
-	v = getWKBHeader(v, byteOrder, wkbType, numPoints);
-	
-	if(wkbType != 2)
-		throw logic_error("Binary data doesn't supported!");
-
-	if(cursorDataType_ == TeTEXTCURSOR)
-	{
-		// Volta duas vezes o n�mero de bytes do n�mero de geometrias lidos ao chamar getWKBHeader
-		v = getWKBLinearRing(v - (sizeof(unsigned int) + sizeof(unsigned int)), byteOrder, l);
-	}
-	else
-	{
-		// Volta o n�mero de bytes do n�mero de geometrias lidos ao chamar getWKBHeader
-		v = getWKBLinearRing(v - sizeof(unsigned int), byteOrder, l);
-	}
-
-	return v;
-
-}
-
-char* TePGRecordset::getWKBPolygon(char* v, TePolygon& p) const
-{
-	unsigned char byteOrder;
-	unsigned int wkbType;
-	unsigned int numRings;
-
-	v = getWKBHeader(v, byteOrder, wkbType, numRings);
-	
-	if(wkbType != 3)
-		throw logic_error("Binary data doesn't supported!");
-
-	for(unsigned int i = 0; i < numRings; ++i)
-	{
-		TeLine2D line;
-		v = getWKBLinearRing(v, byteOrder, line);
-		p.add(line);
-	}
-
-	return v;
-
-}
-
-char* TePGRecordset::getWKBMultiPoint(char* v, TePointSet &ps) const
-{
-	unsigned char byteOrder; 
-	unsigned int wkbType; 
-	unsigned int num_wkbPoints; 
-
-	v = getWKBHeader(v, byteOrder, wkbType, num_wkbPoints);
-
-	if(wkbType != 4)
-		throw logic_error("Binary data doesn't supported!");
-
-	for(unsigned int i = 0; i < num_wkbPoints; ++i)
-	{
-		TeCoord2D coord;
-		v = getWKBPoint(v, coord);
-		ps.add(coord);
-	}
-
-	return v;
-}
-
-char* TePGRecordset::getWKBMultiLine(char* v, TeLineSet &ls) const
-{
-	unsigned char byteOrder; 
-	unsigned int wkbType; 
-	unsigned int num_wkbLineStrings; 
-
-	v = getWKBHeader(v, byteOrder, wkbType, num_wkbLineStrings);
-
-	if(wkbType != 5)
-		throw logic_error("Binary data doesn't supported!");
-
-	for(unsigned int i = 0; i < num_wkbLineStrings; ++i)
-	{
-		TeLine2D line;
-		v = getWKBLine(v, line);
-		ls.add(line);
-	}
-
-	return v;
-}
-
-char* TePGRecordset::getWKBMultiPolygon(char* v, TePolygonSet &ps) const
-{
-	unsigned char byteOrder;
-	unsigned int wkbType;
-	unsigned int num_wkbPolygons;
-
-	v = getWKBHeader(v, byteOrder, wkbType, num_wkbPolygons);
-
-	if(wkbType != 6)
-		throw logic_error("Binary data doesn't supported!");
-
-	for(unsigned int i = 0; i < num_wkbPolygons; ++i)
-	{
-		TePolygon poly;
-		v = getWKBPolygon(v, poly);
-		ps.add(poly);
-	}
-
-	return v;
-}
-
-void TePGRecordset::getWKBGeomColl(char* v, TeMultiGeometry &mg) const
-{
-	unsigned char byteOrder; 
-	unsigned int wkbType; 
-	unsigned int num_wkbGeometries;
-
-	v = getWKBHeader(v, byteOrder, wkbType, num_wkbGeometries);
-
-	if(wkbType != 7)
-		throw logic_error("Binary data doesn't supported!");
-
-	for(unsigned int i = 0; i < num_wkbGeometries; ++i)
-	{
-		unsigned int geomType;
-		unsigned char geomByteOrder;
-		unsigned int num_geometries;
-
-		getWKBHeader(v, geomByteOrder, geomType, num_geometries);
-
-		if(geomType == 1)
-		{
-			TeCoord2D coord;
-
-			v = getWKBPoint(v, coord);
-
-			mg.addGeometry(TePoint(coord));
-		}
-		else if(geomType == 2)
-		{
-			TeLine2D line;
-
-			v = getWKBLine(v, line);
-
-			mg.addGeometry(line);
-		}
-		else if(geomType == 3)
-		{
-			TePolygon poly;
-
-			v = getWKBPolygon(v, poly);
-
-			mg.addGeometry(poly);
-		}
-		else if(geomType == 4)
-		{
-			TePointSet pointSet;
-
-			v = getWKBMultiPoint(v, pointSet);
-
-			for(unsigned int a = 0; a < pointSet.size(); ++a)
-			{
-				TePoint point = pointSet[a];
-				mg.addGeometry(point);
-			}
-		}
-		else if(geomType == 5)
-		{
-			TeLineSet lineSet;
-
-			v = getWKBMultiLine(v, lineSet);
-
-			for(unsigned int a = 0; a < lineSet.size(); ++a)
-			{
-				TeLine2D coord = lineSet[a];
-
-				mg.addGeometry(coord);
-			}
-		}
-		else if(geomType == 6)
-		{
-			TePolygonSet polygonSet;
-			
-			v = getWKBMultiPolygon(v, polygonSet);
-			
-			for(unsigned int a = 0; a < polygonSet.size(); ++a)
-			{
-				TePolygon poly = polygonSet[a];
-
-				mg.addGeometry(poly);
-			}
-		}
-		else
-		{
-			throw logic_error("The data couldn't be decoded as a valid WKB geometry!");
-		}
-	}
-
-}
-
-
-void TePGRecordset::getPGISPoint(const int& field_num, TePoint& p) const
-{
-	TeCoord2D c;
-	getWKBPoint(value(field_num), c);
-	p.add(c);
-}
-
-
-void TePGRecordset::getPGISLine(const int& field_num, TeLine2D& l) const
-{
-	getWKBLine(value(field_num), l);		
-}
-
-
-void TePGRecordset::getPGISPolygon(const int& field_num, TePolygon& p) const
-{
-	getWKBPolygon(value(field_num), p);		
-}
-
-
-void TePGRecordset::getPGISMultiPoint(const int& field_num, TePointSet& ps) const
-{
-	getWKBMultiPoint(value(field_num), ps);		
-}
-
-
-void TePGRecordset::getPGISMultiLine(const int& field_num, TeLineSet& ls) const
-{
-	getWKBMultiLine(value(field_num), ls);		
-}
-
-
-void TePGRecordset::getPGISMultiPolygon(const int& field_num, TePolygonSet& ps) const
-{
-	getWKBMultiPolygon(value(field_num), ps);	
-}
-
-
-void TePGRecordset::getPGISGeomColl(const int& field_num, TeMultiGeometry& m) const
-{
-	getWKBGeomColl(value(field_num), m);
-}
-
-string TePGRecordset::getDate(const int& field_num) const
-{
-	if(cursorDataType_ == TeTEXTCURSOR)
-		return value(field_num);
-
-// for binary cursors only
-	struct te_pg_tm tt;
-	struct te_pg_tm *tm = &tt;
-    
-	TeDateADT date = getInt(field_num);
-
-	j2date(date + POSTGRES_EPOCH_JDATE,
-		   &(tm->tm_year), &(tm->tm_mon), &(tm->tm_mday));
-
-	char buf[MAXDATELEN + 1];
-	
-	string datestr = "";
-
-	if(EncodeDateOnly(tm, buf))
-        datestr = buf;
-	
-	return datestr;
-}
-
-string TePGRecordset::getTime(const int& field_num)
-{
-	if(cursorDataType_ == TeTEXTCURSOR)
-	{
-		string res = value(field_num);
-
-		return res;
-	}
-
-	te_int64 time;
-
-	if(this->conn_->isDateInt())
-	{
-        unsigned int h32;
-		unsigned int l32;
-
-		memcpy(&h32, value(field_num), sizeof(unsigned));
-		memcpy(&l32, value(field_num) + sizeof(unsigned), sizeof(unsigned));
-
-		h32 = ntohl(h32);
-		l32 = ntohl(l32);
-
-		time = h32;
-		time <<= 32;
-		time |= l32;
-	}
-	else
-	{
-		double t_aux = getDouble(field_num);
-
-		t_aux*=1000000;
-		time=(te_int64)t_aux;
-	}
-
-	struct te_pg_tm tt;
-	struct te_pg_tm *tm = &tt;
-	te_fsec_t fsec;
-
-	char buf[MAXDATELEN + 1];
-
-	string datestr = "";
-
-	time2tm(time, tm, &fsec);
-	
-	if(EncodeTimeOnly(tm, fsec, NULL, buf))
-        datestr = buf;
-	
-	return datestr;
-}
-
-string TePGRecordset::getTimeStamp(const int& field_num)
-{
-	if(cursorDataType_ == TeTEXTCURSOR)
-	{
-		string res = value(field_num);
-
-		return res;
-	}
-
-	te_int64 timestamp;
-
-	if(this->conn_->isDateInt())
-	{
-        unsigned int h32;
-		unsigned int l32;
-
-		memcpy(&h32, value(field_num), sizeof(unsigned));
-		memcpy(&l32, value(field_num) + sizeof(unsigned), sizeof(unsigned));
-
-		h32 = ntohl(h32);
-		l32 = ntohl(l32);
-
-		timestamp = h32;
-		timestamp <<= 32;
-		timestamp |= l32;
-	}
-	else
-	{
-		double t_aux = getDouble(field_num);
-
-		t_aux*=1000000;
-		timestamp=(te_int64)t_aux;
-	}
-
-	struct te_pg_tm tt;
-	struct te_pg_tm *tm = &tt;
-	te_fsec_t fsec;
-	char *tzn = NULL;
-
-	char buf[MAXDATELEN + 1];
-
-	string datestr = "";
-
-	if(TIMESTAMP_NOT_FINITE(timestamp))
-	{
-		if(EncodeSpecialTimestamp(timestamp, buf))
-			datestr = buf;
-	}
-	else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL))
-	{
-		if(EncodeDateTime(tm, fsec, NULL, &tzn, buf))
-			datestr = buf;
-	}
-        
-	
-	return datestr;
-}
-
-int TePGRecordset::getInt8(const int& field_num) const
-{
-	unsigned int h32;
-	unsigned int l32;
-
-	memcpy(&h32, value(field_num), sizeof(unsigned));
-	memcpy(&l32, value(field_num) + sizeof(unsigned), sizeof(unsigned));
-
-	h32 = ntohl(h32);
-	l32 = ntohl(l32);
-
-	te_int64 i64value = h32;
-	i64value <<= 32;
-	i64value |= l32;
-
-	return (int)i64value;
-}
-
-
-char* TePGRecordset::getData(const int& field_num)
-{
-	data_ = "";
-
-	if(cursorDataType_ == TeTEXTCURSOR)
-		return value(field_num);
-	else
-	{
-		// chamar o conversor de tipo de dado de bin�rio p/ string p/ cada tipo!
-		switch(fieldType(field_num))
-		{
-			case PG_NAME_TYPE			:
-			case PG_TEXT_TYPE			:
-			case PG_VARCHAR_TYPE		:		if(isNull(field_num))  
-												{
-													data_ = "";
-												}
-												else
-												{
-													return value(field_num);
-												}
-
-												break;
-
-			case PG_INT8_TYPE			:		if(isNull(field_num))  
-												{
-													data_ = "";
-												}
-												else
-												{
-													data_ = Te2String(getInt8(field_num));
-												}
-												break;
-
-			case PG_BOOL_TYPE			:
-			case PG_BYTEA_TYPE			:
-			case PG_CHAR_TYPE			:			
-			case PG_INT2_TYPE			: 
-											break;
-
-			case PG_OID_TYPE			:
-			case PG_INT4_TYPE			: if(isNull(field_num))  
-										  {
-											  data_ = "";
-										  }
-										  else
-										  {
-                                              data_ = Te2String(getInt(field_num));
-										  }
-										  break;			
-			
-			case PG_PG_FLOAT4_TYPE      :
-			case PG_POINT_TYPE			:
-			case PG_LSEG_TYPE			:
-			case PG_PATH_TYPE			:
-			case PG_BOX_TYPE			:
-			case PG_POLYGON_TYPE		:
-			case PG_LINE_TYPE			: 
-											break;
-
-
-			case PG_FLOAT8_TYPE			: if(isNull(field_num))  
-										  {
-											  data_ = "";
-										  }
-										  else
-										  {
-											  data_ = Te2String(getDouble(field_num), 15);
-										  }
-										  break;
-
-			case PG_TIMESTAMP_TYPE		: if(isNull(field_num))  
-										  {
-											  data_ = "";
-										  }
-										  else
-										  {
-                                              data_ = getTimeStamp(field_num);
-										  }
-				                          break;
-
-		    case PG_DATE_TYPE			: if(isNull(field_num))  
-										  {
-											  data_ = "";
-										  }
-										  else
-										  {
-											  data_ = getDate(field_num);
-										  }
-				                          break;
-
-		    case PG_TIME_TYPE			: if(isNull(field_num))  
-										  {
-											  data_ = "";
-										  }
-										  else
-										  {
-											  data_ = getTime(field_num);	
-										  }
-										  break;
-
-
-			case PG_TIMESTAMPTZ_TYPE	:			
-			case PG_TIMETZ_TYPE			:
-										
-										  break;
-
-			case PG_INTERVAL_TYPE		: 
-										  break;
-
-			case PG_CIRCLE_TYPE			:
-			case PG_MONEY_TYPE			:
-			case PG_BPCHAR_TYPE			:			
-			case PG_BIT_TYPE			:
-			case PG_VARBIT_TYPE			:
-			case PG_NUMERIC_TYPE		:
-			default						: 
-											
-											break;
-		}
-		
-		return (char*)data_.c_str();
-	}
-}
-
-int TePGRecordset::fieldSize(const int& field_num)
-{
- Oid field_t = this->fieldType(field_num);
- Oid field_m = PQfmod(pg_recordset_, field_num);
- PGresult *result_temp;
- char str_int[5];   //integer part if DECIMAL(p,s) or NUMERIC(p,s)
- //int size = -1;
- int size = 0;
- char str_field_t[50];
- char str_field_m[50];
- sprintf(str_field_t,"%d", field_t);
- sprintf(str_field_m,"%d", field_m);
- string str_qry = "SELECT format_type(";
-        str_qry += str_field_t;
-        str_qry += ",";
-        str_qry += str_field_m;
-        str_qry += ")";
- switch(field_t)
-       {
-		case 1042:	// CHAR(n)
-        case 1043:   //VARCHAR(s) or CHARACTER VARYING(s)
-        case 1700:   //NUMERIC(p,s) or DECIMAL(p,s)
-                     result_temp = PQexec(conn_->c_ptr(), str_qry.c_str());
-                     if(PQresultStatus(result_temp) == PGRES_TUPLES_OK)
-                       {
-                        char *lin = PQgetvalue(result_temp, 0, 0);  //Don't free lin because the return of PQgetvalue is in the struct PGResult
-                        int i = 0;
-                        while(*lin != '\0' && *lin != ',')
-                             {
-                              if(*lin >= '0' && *lin <= '9' && i < 4)
-                                {
-                                 str_int[i] = *lin;
-                                 i++;
-                                }
-                              lin++;
-                             }
-                        str_int[i]='\0';
-                        size = atoi(str_int);
-                       }
-                     PQclear(result_temp);
-                     break;
-        default:     //The size of fixed size or for other variable size -1
-                     return PQfsize(pg_recordset_, field_num);
-       }
- result_temp = 0;
- return size;
-}
-
-int TePGRecordset::fieldSizeFractionaryPart(const int& field_num)
-{
- Oid field_t = this->fieldType(field_num);
- Oid field_m = PQfmod(pg_recordset_, field_num);
- PGresult *result_temp;
- char str_frac[5];   //fractionary part if DECIMAL(p,s) or NUMERIC(p,s)
- //int size = -1;
- int size = 0;
- char str_field_t[50];
- char str_field_m[50];
- sprintf(str_field_t,"%d", field_t);
- sprintf(str_field_m,"%d", field_m);
- string str_qry = "SELECT format_type(";
-        str_qry += str_field_t;
-        str_qry += ",";
-        str_qry += str_field_m;
-        str_qry += ")";
- switch(field_t)
-       {
-        case 1700:   //NUMERIC(p,s) or DECIMAL(p,s)
-                     result_temp = PQexec(conn_->c_ptr(), str_qry.c_str());
-                     if(PQresultStatus(result_temp) == PGRES_TUPLES_OK)
-                       {
-                        char *lin = PQgetvalue(result_temp, 0, 0);  //Don't free lin because the return of PQgetvalue is in the struct PGResult
-                        int i = 0;
-                        while(*lin != '\0' && *lin != ',')
-                             {
-                              lin++;
-                             }
-                        if(*lin == ',')
-                          {
-                           lin++;
-                          }
-                        while(*lin != '\0')
-                             {
-                              if(*lin >= '0' && *lin <= '9' && i < 4)
-                                {
-                                 str_frac[i] = *lin;
-                                 i++;
-                                }
-                              lin++;
-                             }
-                        str_frac[i]='\0';
-                        size = atoi(str_frac);
-                       }
-                     PQclear(result_temp);
-                     break;
-        default:     //Others doesn't have a fractionary part
-                     break;
-
-       }
- result_temp = 0;
- return size;
-}
-
-void TePGRecordset::freeRecordSet()
-{
-	if(pg_recordset_)
-		PQclear(pg_recordset_);
-
-
-	pg_recordset_ = 0;
-	int_index_current_ = -1;
-	int_eof_ = -1;
-	return;
-}
-
-char* TeLine2DToPGBinary(const TeLine2D &line, unsigned int &size)
-{
-	unsigned int numPts = line.size();
-	size = sizeof(int) + (numPts * sizeof(double) * 2);
-
-	char* p = new char[size];
-
-	char* paux = p;
-
-	//coloca o cabe�alho (Numero de pontos)
-	unsigned int numPts_net = htonl(numPts);
-
-	memcpy(p, &numPts_net, sizeof(int));
-	p += sizeof(int);
-
-	for(unsigned int i = 0; i < numPts ; ++i)
-	{
-		double swappedDoubleX = TeConvertToBigEndian(line[i].x());
-		double swappedDoubleY = TeConvertToBigEndian(line[i].y());
-
-		memcpy(p, &swappedDoubleX, sizeof(double));
-		p += sizeof(double);
-		
-		memcpy(p, &swappedDoubleY, sizeof(double));
-		p += sizeof(double);
-	}
-
-	return paux;
-}
-
-char* TeBoxToPGBinary(const TeBox &box, unsigned int &size)
-{
-	size = 4 * sizeof(double);
-
-	char* b = new char[size];
-	char* baux = b;
-
-	double swappedDoubleURX = TeConvertToBigEndian(box.upperRight().x());
-	double swappedDoubleURY = TeConvertToBigEndian(box.upperRight().y());
-
-	double swappedDoubleLFX = TeConvertToBigEndian(box.lowerLeft().x());
-	double swappedDoubleLFY = TeConvertToBigEndian(box.lowerLeft().y());
-
-	memcpy(b, &swappedDoubleURX, sizeof(double));
-	b += sizeof(double);
-	
-	memcpy(b, &swappedDoubleURY, sizeof(double));
-	b += sizeof(double);
-
-	memcpy(b, &swappedDoubleLFX, sizeof(double));
-	b += sizeof(double);
-	
-	memcpy(b, &swappedDoubleLFY, sizeof(double));
-	b += sizeof(double);
-
-	return baux;
-}
-
-double TeConvertToBigEndian(const double &value)
-{
-	double swappedValue;
-
-	union
-	{
-		double dWord_;
-		unsigned int aux_[2];
-	} swapIN, swapOUT;
-
-
-	// endianness test
-	if(((unsigned int) 1) == htonl((unsigned int) 1))
-	{
-		//isLittleEndian_ = false => doesn't need to swap bytes;	
-		swapIN.dWord_ = value;
-
-		memcpy(&swappedValue, &swapIN.dWord_, sizeof(double));
-	}		
-	else
-	{
-		//isLittleEndian_ = true  => swap bytes;
-		swapIN.dWord_ = value;
-
-		swapOUT.aux_[1] = htonl(swapIN.aux_[0]);
-		swapOUT.aux_[0] = htonl(swapIN.aux_[1]);
-	
-		memcpy(&swappedValue, &swapOUT.dWord_, sizeof(double));
-	}
-	return swappedValue;
-}
-
-
-char* TePointToWKBPoint(const TePoint &point, unsigned int &size)
-{
-	char byteOrder;
-	unsigned int wkbType = 1;//WKBPoint
-
-	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-	if(((unsigned int) 1) == htonl((unsigned int) 1))
-	{
-		byteOrder = 0;
-	}
-	else
-	{
-		byteOrder = 1;		
-	}
-
-	//cabecalho
-	size = sizeof(char) + sizeof(int) + (2 * sizeof(double));
-	
-	char* p = new char[size];
-	char* paux = p;
-
-	//byteOrder	
-	memcpy(p, &byteOrder , sizeof(char));
-	p += sizeof(char);
-
-	//WKBPoint
-	memcpy(p, &wkbType , sizeof(unsigned int));
-	p += sizeof(unsigned int);
-
-	double x = point.location().x();
-	double y = point.location().y();
-
-	memcpy(p, &x, sizeof(double));
-	p += sizeof(double);
-	memcpy(p, &y, sizeof(double));
-	p += sizeof(double);
-
-	return paux;
-}
-
-
-char* TeLine2DToWKBLineString(const TeLine2D &line, unsigned int &size)
-{
-	char byteOrder;
-	unsigned int wkbType = 2;//WKBLineString
-	unsigned int nPoints = line.size();
-
-	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-	if(((unsigned int) 1) == htonl((unsigned int) 1))
-	{
-		byteOrder = 0;
-	}
-	else
-	{
-		byteOrder = 1;		
-	}
-
-	size = sizeof(char) + sizeof(int) + sizeof(int) + (2 * sizeof(double) * nPoints);
-	
-	char* l = new char[size];
-	char* laux = l;
-
-	//byteOrder	
-	memcpy(l, &byteOrder , sizeof(char));
-	l += sizeof(char);
-
-	//WKBLineString
-	memcpy(l, &wkbType , sizeof(unsigned int));
-	l += sizeof(unsigned int);
-
-	//nPoints
-	memcpy(l, &nPoints , sizeof(unsigned int));
-	l += sizeof(unsigned int);
-
-	for(unsigned int i = 0; i < nPoints ; ++i)
-	{
-		double x = line[i].x();
-		double y = line[i].y();
-
-		memcpy(l, &x, sizeof(double));
-		l += sizeof(double);
-		
-		memcpy(l, &y, sizeof(double));
-		l += sizeof(double);
-	}
-
-	return laux;
-}
-
-
-char* TePolygonToWKBPolygon(const TePolygon &polygon, unsigned int &size)
-{
-	char byteOrder;
-	unsigned int wkbType = 3;//WKBPolygon
-	unsigned int nRings = polygon.size();
-
-	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-	if(((unsigned int) 1) == htonl((unsigned int) 1))
-	{
-		byteOrder = 0;
-	}
-	else
-	{
-		byteOrder = 1;		
-	}
-
-	//cabecalho
-	size = sizeof(char) + sizeof(int) + sizeof(int);
-	//rings
-	for(unsigned int i = 0; i < nRings ; ++i)
-	{
-		size += sizeof(int) + (2 * sizeof(double) * polygon[i].size());
-	}
-	
-	char* p = new char[size];
-	char* paux = p;
-
-	//byteOrder	
-	memcpy(p, &byteOrder , sizeof(char));
-	p += sizeof(char);
-
-	//WKBPolygon
-	memcpy(p, &wkbType , sizeof(unsigned int));
-	p += sizeof(unsigned int);
-
-	//nRings
-	memcpy(p, &nRings , sizeof(unsigned int));
-	p += sizeof(unsigned int);
-	
-	for(unsigned int i = 0; i < nRings ; ++i)
-	{
-		TeLinearRing ring = polygon[i];
-		unsigned int nPoints = ring.size();
-
-		memcpy(p, &nPoints, sizeof(int));
-		p += sizeof(int);
-		
-		for(unsigned int j = 0; j < nPoints; ++j)
-		{
-			double x = ring[j].x();
-			double y = ring[j].y();
-		
-			memcpy(p, &x, sizeof(double));
-			p += sizeof(double);
-			
-			memcpy(p, &y, sizeof(double));
-			p += sizeof(double);		
-		}
-	}
-
-	return paux;
-}
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*
+ * TODO: 1. NAO PEGAR O DOBRO DE REGISTROS NA VOLTA (MOVE PREVIOUS) NO FUTURO!!!!
+ *       2. set datestyle = 'ISO, YMD'
+ *
+ */
+
+#include "TePGInterface.h"
+#include "TePGUtils.h"
+#include <stdexcept>
+#include <string>
+#include <climits>
+
+
+#include "TeUtils.h"
+
+/*
+ *	Read/write mode flags for inversion (large object) calls
+ */
+
+#define INV_WRITE		0x00020000
+#define INV_READ		0x00040000
+
+/*
+ * Read buffer size
+ */
+#define BUFFSIZE        1024
+
+/*
+ * PostgreSQL Geometric Types
+ */
+typedef struct
+{
+	double		x, y;
+} BIN_PG_POINT;
+
+using namespace std;
+
+/*******************************
+ * FUN��ES AUXILIARES          *
+ *******************************/
+// swapp bytes
+unsigned int TePGSwapUInt(const unsigned int& uintVal)
+{
+	char uintIn[4], uintOut[4];
+
+	unsigned int outVal;
+
+	memcpy(uintIn,&uintVal,4);
+
+	uintOut[0] = uintIn[3];
+	uintOut[1] = uintIn[2];
+	uintOut[2] = uintIn[1];
+	uintOut[3] = uintIn[0];
+
+	memcpy (&outVal,uintOut,4);
+
+	return outVal;
+}
+
+
+// This function is the same parse_hex function in PostGIS rc3 source code.
+inline unsigned char parse_hex(char *str)
+{
+	//do this a little brute force to make it faster
+
+	unsigned char		result_high = 0;
+	unsigned char		result_low = 0;
+
+	switch (str[0])
+	{
+		case '0' :
+			result_high = 0;
+			break;
+		case '1' :
+			result_high = 1;
+			break;
+		case '2' :
+			result_high = 2;
+			break;
+		case '3' :
+			result_high = 3;
+			break;
+		case '4' :
+			result_high = 4;
+			break;
+		case '5' :
+			result_high = 5;
+			break;
+		case '6' :
+			result_high = 6;
+			break;
+		case '7' :
+			result_high = 7;
+			break;
+		case '8' :
+			result_high = 8;
+			break;
+		case '9' :
+			result_high = 9;
+			break;
+		case 'A' :
+			result_high = 10;
+			break;
+		case 'B' :
+			result_high = 11;
+			break;
+		case 'C' :
+			result_high = 12;
+			break;
+		case 'D' :
+			result_high = 13;
+			break;
+		case 'E' :
+			result_high = 14;
+			break;
+		case 'F' :
+			result_high = 15;
+			break;
+	}
+	switch (str[1])
+	{
+		case '0' :
+			result_low = 0;
+			break;
+		case '1' :
+			result_low = 1;
+			break;
+		case '2' :
+			result_low = 2;
+			break;
+		case '3' :
+			result_low = 3;
+			break;
+		case '4' :
+			result_low = 4;
+			break;
+		case '5' :
+			result_low = 5;
+			break;
+		case '6' :
+			result_low = 6;
+			break;
+		case '7' :
+			result_low = 7;
+			break;
+		case '8' :
+			result_low = 8;
+			break;
+		case '9' :
+			result_low = 9;
+			break;
+		case 'A' :
+			result_low = 10;
+			break;
+		case 'B' :
+			result_low = 11;
+			break;
+		case 'C' :
+			result_low = 12;
+			break;
+		case 'D' :
+			result_low = 13;
+			break;
+		case 'E' :
+			result_low = 14;
+			break;
+		case 'F' :
+			result_low = 15;
+			break;
+	}
+	return (unsigned char) ((result_high<<4) + result_low);
+}
+
+//Os trechos abaixo fram retirados do codigo fonte do Servidor PostgreSQL, pois aqui utilizamos cursores binarios
+// timestamp values are stored as seconds before or after midnight 2000-01-01
+#define UNIX_EPOCH_JDATE		2440588 /* == date2j(1970, 1, 1) */
+
+#define POSTGRES_EPOCH_JDATE	2451545 /* == date2j(2000, 1, 1) */
+#define MAXDATELEN		51		/* maximum possible length of an input date string (not counting tr. null) */
+#define MAXDATEFIELDS	25		/* maximum possible number of fields in a date string */
+
+typedef int TeDateADT;
+typedef long long int te_int64;
+typedef te_int64 te_pg_time_t;
+
+typedef int te_fsec_t;
+
+/* Decide if we need to decorate 64-bit constants */
+//#ifdef HAVE_LL_CONSTANTS
+#define INT64CONST(x)  ((te_int64) x##LL)
+//#else
+//#define INT64CONST(x)  ((te_int64) x)
+//#endif
+
+
+#define DT_NOBEGIN		(-INT64CONST(0x7fffffffffffffff) - 1)
+#define DT_NOEND		(INT64CONST(0x7fffffffffffffff))
+
+#define TIMESTAMP_NOBEGIN(j)	do {j = DT_NOBEGIN;} while (0)
+#define TIMESTAMP_IS_NOBEGIN(j) ((j) == DT_NOBEGIN)
+
+#define TIMESTAMP_NOEND(j)		do {j = DT_NOEND;} while (0)
+#define TIMESTAMP_IS_NOEND(j)	((j) == DT_NOEND)
+
+#define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j))
+
+#define TMODULO_INT64(t,q,u) \
+do { \
+	q = (t / u); \
+	if (q != 0) t -= (q * u); \
+} while(0)
+
+
+
+struct te_pg_tm
+{
+	int			tm_sec;
+	int			tm_min;
+	int			tm_hour;
+	int			tm_mday;
+	int			tm_mon;			/* origin 0, not 1 */
+	int			tm_year;		/* relative to 1900 */
+	int			tm_wday;
+	int			tm_yday;
+	int			tm_isdst;
+	long int	tm_gmtoff;
+	const char *tm_zone;
+};
+
+inline void j2date(int jd, int *year, int *month, int *day)
+{
+	unsigned int julian;
+	unsigned int quad;
+	unsigned int extra;
+	int			y;
+
+	julian = jd;
+	julian += 32044;
+	quad = julian / 146097;
+	extra = (julian - quad * 146097) * 4 + 3;
+	julian += 60 + quad * 3 + extra / 146097;
+	quad = julian / 1461;
+	julian -= quad * 1461;
+	y = julian * 4 / 1461;
+	julian = ((y != 0) ? ((julian + 305) % 365) : ((julian + 306) % 366))
+		+ 123;
+	y += quad * 4;
+	*year = y - 4800;
+	quad = julian * 2141 / 65536;
+	*day = julian - 7834 * quad / 256;
+	*month = (quad + 10) % 12 + 1;
+
+	return;
+}	/* j2date() */
+
+/* EncodeDateOnly()
+ * Encode date as local time.
+ */
+inline bool EncodeDateOnly(struct te_pg_tm* tm, char *str)
+{
+	if ((tm->tm_mon < 1) || (tm->tm_mon > 12))
+		return false;
+
+	/* compatible with ISO date formats */
+	if (tm->tm_year > 0)
+		sprintf(str, "%04d-%02d-%02d",
+				tm->tm_year, tm->tm_mon, tm->tm_mday);
+	else
+		sprintf(str, "%04d-%02d-%02d %s", -(tm->tm_year - 1), tm->tm_mon, tm->tm_mday, "BC");
+
+	
+	return true;
+}	/* EncodeDateOnly() */
+
+inline  int time2tm(te_int64 time, struct te_pg_tm * tm, te_fsec_t *fsec)
+{
+	tm->tm_hour = (int)((time / INT64CONST(3600000000)));
+	time -= (tm->tm_hour * INT64CONST(3600000000));
+	tm->tm_min = (int)((time / INT64CONST(60000000)));
+	time -= (tm->tm_min * INT64CONST(60000000));
+	tm->tm_sec = (int)((time / INT64CONST(1000000)));
+	time -= (tm->tm_sec * INT64CONST(1000000));
+	*fsec = (te_fsec_t)time;
+
+	return 0;
+}
+
+/* EncodeTimeOnly()
+ * Encode time fields only.
+ */
+inline bool EncodeTimeOnly(struct te_pg_tm * tm, te_fsec_t fsec, int *tzp, char *str)
+{
+	if ((tm->tm_hour < 0) || (tm->tm_hour > 24))
+		return false;
+
+	sprintf(str, "%02d:%02d", tm->tm_hour, tm->tm_min);
+
+	/*
+	 * Print fractional seconds if any.  The field widths here should be
+	 * at least equal to the larger of MAX_TIME_PRECISION and
+	 * MAX_TIMESTAMP_PRECISION.
+	 */
+	if(fsec != 0)
+	{
+		sprintf((str + strlen(str)), ":%02d.%06d", tm->tm_sec, fsec);
+
+		/* chop off trailing pairs of zeros... */
+		while ((strcmp((str + strlen(str) - 2), "00") == 0)
+			   && (*(str + strlen(str) - 3) != '.'))
+			*(str + strlen(str) - 2) = '\0';
+	}
+	else
+		sprintf((str + strlen(str)), ":%02d", tm->tm_sec);
+
+	if(tzp != NULL)
+	{
+		int			hour,
+					min;
+
+		hour = -(*tzp / 3600);
+		min = ((abs(*tzp) / 60) % 60);
+		sprintf((str + strlen(str)), ((min != 0) ? "%+03d:%02d" : "%+03d"), hour, min);
+	}
+
+	return true;
+}	/* EncodeTimeOnly() */
+
+inline void TrimTrailingZeros(char *str)
+{
+	size_t	len = strlen(str);
+
+	/* chop off trailing zeros... but leave at least 2 fractional digits */
+	while ((*(str + len - 1) == '0') && (*(str + len - 3) != '.'))
+	{
+		len--;
+		*(str + len) = '\0';
+	}
+}
+
+
+/* EncodeDateTime()
+ * Encode date and time interpreted as local time.
+ * Support several date styles:
+ *	Postgres - day mon hh:mm:ss yyyy tz
+ *	SQL - mm/dd/yyyy hh:mm:ss.ss tz
+ *	ISO - yyyy-mm-dd hh:mm:ss+/-tz
+ *	German - dd.mm.yyyy hh:mm:ss tz
+ * Variants (affects order of month and day for Postgres and SQL styles):
+ *	US - mm/dd/yyyy
+ *	European - dd/mm/yyyy
+ */
+inline bool EncodeDateTime(struct te_pg_tm * tm, te_fsec_t fsec, int *tzp, char ** /* tzn */, char *str)
+{
+	int			hour,
+				min;
+
+	if ((tm->tm_mon < 1) || (tm->tm_mon > 12))
+		return false;
+
+	/* Compatible with ISO-8601 date formats */
+
+	sprintf(str, "%04d-%02d-%02d %02d:%02d",
+		  ((tm->tm_year > 0) ? tm->tm_year : -(tm->tm_year - 1)),
+			tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min);
+
+	/*
+		* Print fractional seconds if any.  The field widths here
+		* should be at least equal to MAX_TIMESTAMP_PRECISION.
+		*
+		* In float mode, don't print fractional seconds before 1 AD,
+		* since it's unlikely there's any precision left ...
+		*/
+
+	if (fsec != 0)
+	{
+		sprintf((str + strlen(str)), ":%02d.%06d", tm->tm_sec, fsec);
+		TrimTrailingZeros(str);
+	}
+	else
+        sprintf((str + strlen(str)), ":%02d", tm->tm_sec);
+
+	/*
+		* tzp == NULL indicates that we don't want *any* time zone
+		* info in the output string. *tzn != NULL indicates that we
+		* have alpha time zone info available. tm_isdst != -1
+		* indicates that we have a valid time zone translation.
+		*/
+	if ((tzp != NULL) && (tm->tm_isdst >= 0))
+	{
+		hour = -(*tzp / 3600);
+		min = ((abs(*tzp) / 60) % 60);
+		sprintf((str + strlen(str)), ((min != 0) ? "%+03d:%02d" : "%+03d"), hour, min);
+	}
+
+	if (tm->tm_year <= 0)
+		sprintf((str + strlen(str)), " BC");
+
+	return true;
+}
+
+
+/* EncodeSpecialTimestamp()
+ * Convert reserved timestamp data type to string.
+ */
+inline bool EncodeSpecialTimestamp(te_int64 dt, char *str)
+{
+	if (TIMESTAMP_IS_NOBEGIN(dt))
+		strcpy(str, "-infinity");
+	else if (TIMESTAMP_IS_NOEND(dt))
+		strcpy(str, "infinity");
+	else
+		return false;
+
+	return true;
+}	/* EncodeSpecialTimestamp() */
+
+inline  void dt2time(te_int64 jd, int *hour, int *min, int *sec, te_fsec_t *fsec)
+{
+
+	te_int64		time;
+
+	time = jd;
+
+	*hour = (int)((time / INT64CONST(3600000000)));
+	time -= ((*hour) * INT64CONST(3600000000));
+	*min = (int)((time / INT64CONST(60000000)));
+	time -= ((*min) * INT64CONST(60000000));
+	*sec = (int)((time / INT64CONST(1000000)));
+	*fsec = (te_fsec_t)(time - (*sec * INT64CONST(1000000)));
+
+	return;
+}	/* dt2time() */
+
+
+/*
+ * timestamp2tm() - Convert timestamp data type to POSIX time structure.
+ *
+ * Note that year is _not_ 1900-based, but is an explicit full value.
+ * Also, month is one-based, _not_ zero-based.
+ * Returns:
+ *	 0 on success
+ *	-1 on out of range
+ */
+bool timestamp2tm(te_int64 dt, int *tzp, struct te_pg_tm * tm, te_fsec_t *fsec, char **tzn)
+{
+	te_int64 date;
+	te_int64	time;
+
+	/*
+	 * If HasCTZSet is true then we have a brute force time zone
+	 * specified. Go ahead and rotate to the local time zone since we will
+	 * later bypass any calls which adjust the tm fields.
+	 */
+	//if (HasCTZSet && (tzp != NULL))
+	//{
+	//	dt -= CTimeZone * INT64CONST(1000000);
+	//
+	//}
+
+	time = dt;
+
+	TMODULO_INT64(time, date, INT64CONST(86400000000));
+
+	if (time < INT64CONST(0))
+	{
+		time += INT64CONST(86400000000);
+		date	  -=1;
+	}
+
+	/* add offset to go from J2000 back to standard Julian date */
+	date	  +=POSTGRES_EPOCH_JDATE;
+
+	/* Julian day routine does not work for negative Julian days */
+	if (date <0 || date > (te_int64) INT_MAX)
+		return false;
+
+	j2date((int) date, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
+	dt2time(time, &tm->tm_hour, &tm->tm_min, &tm->tm_sec, fsec);
+
+	/* Done if no TZ conversion wanted */
+	if (tzp == NULL)
+	{
+		tm->tm_isdst = -1;
+		tm->tm_gmtoff = 0;
+		tm->tm_zone = NULL;
+		if (tzn != NULL)
+			*tzn = NULL;
+		return true;
+	}
+
+	return false;
+//	return true;
+}
+
+/*******************************
+ * Definicao de TePGConnection *
+ *******************************/
+bool TePGConnection::open(const string& str_connection)
+{
+	close();
+
+	pg_connection_ = PQconnectdb(str_connection.c_str());
+
+	if(this->state())
+	{
+		int_connection_ = 1;
+
+		string off = "off";
+		string answer = PQparameterStatus(pg_connection_, "integer_datetimes");
+
+		if(answer == off)
+			isDateInt_ = false;
+
+		return true;
+	}
+	else
+		return false;
+}
+
+bool TePGConnection::open(PGconn* conn)
+{
+	pg_connection_ = conn;
+
+	if(this->state())
+	{
+		int_connection_ = 1;
+
+		string off = "off";
+		string answer = PQparameterStatus(pg_connection_, "integer_datetimes");
+
+		if(answer == off)
+			isDateInt_ = false;
+
+		return true;
+	}
+	return false;
+}
+
+void TePGConnection::close(void)
+{
+ if(int_connection_)
+   {
+    if(pg_connection_)
+      {
+       PQfinish(pg_connection_);
+      }
+    pg_connection_ = 0;
+    int_connection_ = 0;
+   }
+ return;
+}
+
+
+int TePGConnection::exec_cmd(const string& str_qry)
+{
+ PGresult *result_temp;
+ int resp = -1;
+ result_temp = PQexec(pg_connection_, str_qry.c_str());
+
+    switch (PQresultStatus(result_temp))
+	{
+		case PGRES_EMPTY_QUERY: // The string sent to the backend was empty.
+				break;
+		case PGRES_COMMAND_OK: // Successful completion of a command returning no data
+			    resp = atoi(PQcmdTuples(result_temp));
+				last_oid_ = PQoidValue(result_temp);
+				break;
+		case PGRES_TUPLES_OK: // The query successfully executed
+				break;
+
+		case PGRES_COPY_OUT: // Copy Out (from server) data transfer started
+		case PGRES_COPY_IN: // Copy In (to server) data transfer started
+				break;
+
+		case PGRES_BAD_RESPONSE: // The server's response was not understood
+		case PGRES_NONFATAL_ERROR: // TODO: Is this one really an error?
+		case PGRES_FATAL_ERROR:
+			throw runtime_error("The server's response was not understood");
+
+		default:
+			throw logic_error("Internal lib TePGInterface error: ");
+	}
+
+ PQclear(result_temp);
+ result_temp = 0;
+ return resp;
+}
+
+Oid TePGConnection::insertBlob(char* buff, const int& blobSize)
+{
+	if(!buff)
+		return 0;
+
+	Oid obj_oid = lo_creat(pg_connection_, INV_READ | INV_WRITE);
+
+	int fd  = lo_open(pg_connection_, obj_oid, INV_READ);
+
+	if(fd < 0)
+		return 0;
+
+	int nbwrite = 0;
+
+	int size_tmp = blobSize;
+
+	while(size_tmp > 0)
+	{
+		if((size_tmp - BUFFSIZE) >= 0)
+			nbwrite = lo_write(pg_connection_, fd, buff, BUFFSIZE);				
+		else
+			nbwrite = lo_write(pg_connection_, fd, buff, size_tmp);
+
+		if(nbwrite <= 0)
+			return 0;
+
+		buff += nbwrite;
+		size_tmp -= nbwrite;
+	}
+
+	if(lo_close(pg_connection_, fd) == 0)
+		return obj_oid;
+
+	return 0;
+}
+
+int TePGConnection::getBlob(const Oid& blobId, char *&buff)
+{
+	int fd = lo_open(pg_connection_, blobId, INV_READ);
+
+	if(fd < 0)
+		return -1;
+
+	int len = lo_lseek(pg_connection_, fd, 0, SEEK_END);
+
+	lo_lseek(pg_connection_, fd, 0, SEEK_SET);
+
+	if(len <= 0)
+		return len;
+
+	if(!buff)
+		buff = new char[len];
+
+	char* buffAux = buff;
+
+	int nbread = 0;
+
+	while((nbread = lo_read(pg_connection_, fd, buffAux, BUFFSIZE)) > 0)
+		buffAux += nbread;
+
+	return len;
+}
+
+bool TePGConnection::beginTransaction(void)
+{
+	if(inTransaction_)
+		return true;
+
+	if(exec_cmd("BEGIN TRANSACTION") == 0)
+	{
+		inTransaction_ = true;
+
+		return true;
+	}
+
+	return false;
+}
+
+
+bool TePGConnection::commitTransaction(void)
+{
+	if(exec_cmd("COMMIT TRANSACTION") == 0)
+	{
+		inTransaction_ = false;
+
+		return true;
+	}
+
+	return false;
+}
+
+bool TePGConnection::rollBackTransaction(void)
+{
+	if(exec_cmd("ROLLBACK TRANSACTION") == 0)
+	{
+		inTransaction_ = false;
+
+		return true;
+	}
+
+	return false;
+}
+
+int TePGConnection::exec_cmd_params(const char *command,
+								int nParams,
+								const Oid *paramTypes,
+								const char * const *paramValues,
+								const int *paramLengths,
+								const int *paramFormats,
+								int resultFormat)
+{
+	PGresult *result_temp;
+	int resp = -1;
+	result_temp = PQexecParams(pg_connection_,
+                       command, 
+                       nParams,
+                       paramTypes,
+                       paramValues,
+                       paramLengths,
+                       paramFormats,
+                       resultFormat);
+
+	//errorMessage_= PQresultErrorMessage(result_temp);
+    switch (PQresultStatus(result_temp))
+	{
+		case PGRES_EMPTY_QUERY: // The string sent to the backend was empty.
+				break;
+		case PGRES_COMMAND_OK: // Successful completion of a command returning no data
+			    resp = atoi(PQcmdTuples(result_temp));
+				last_oid_ = PQoidValue(result_temp);
+				break;
+		case PGRES_TUPLES_OK: // The query successfully executed
+				break;
+
+		case PGRES_COPY_OUT: // Copy Out (from server) data transfer started
+		case PGRES_COPY_IN: // Copy In (to server) data transfer started
+				break;
+
+		case PGRES_BAD_RESPONSE: // The server's response was not understood
+		case PGRES_NONFATAL_ERROR: // TODO: Is this one really an error?
+		case PGRES_FATAL_ERROR:
+			throw runtime_error("The server's response was not understood");
+
+		default:
+			throw logic_error("Internal lib TePGInterface error: ");
+	}
+
+	PQclear(result_temp);
+	result_temp = 0;
+	return resp;
+}
+
+std::string TePGConnection::getClientEncoding()
+{
+	std::string clientEncoding = "";
+
+	PGresult* result = PQexec(pg_connection_, "SHOW client_encoding");
+	if(PQresultStatus(result) == PGRES_TUPLES_OK)
+	{
+		clientEncoding = PQgetvalue(result, 0, 0);  //Don't free lin because the return of PQgetvalue is in the struct PGResult
+	}
+	PQclear(result);
+	return clientEncoding;
+}
+
+
+/******************************
+ * Definicao de TePGRecordset *
+ ******************************/
+const int TePGRecordset::int_bof_ = -1;
+int TePGRecordset::openRecordSets_ = 0;
+std::set<int> TePGRecordset::freeCursorNumbers_;
+TeMutex TePGRecordset::_mutexLock;
+
+//const int TePGRecordset::numRowsToRetrieve_ = 2000;
+
+TePGRecordset::TePGRecordset(const string& str_qry, TePGConnection* con_x,
+			                 const TeCursorType& cursorType,
+				             const TeCursorLocation& cursorLocation,
+				             const TeCursorDataType& cursorDataType,
+					         const int& numRowsToRetrieve)
+ : pg_recordset_(0), conn_(con_x), cursorDeclared_(false), int_index_current_(-1),
+   int_eof_(-1), cursorType_(cursorType), cursorLocation_(cursorLocation), 
+   cursorDataType_(cursorDataType), numRowsToRetrieve_(numRowsToRetrieve)
+{
+	// endianness test
+	if(((unsigned int) 1) == htonl((unsigned int) 1))
+		isLittleEndian_ = false;	
+	else
+		isLittleEndian_ = true;
+
+	recordSetId_ = TePGRecordset::getFreeCursor();
+
+	/*if(freeCursorNumbers_.empty())
+	{	// Se n�o houver cursores livres aberto => criar novo id
+		++openRecordSets_;
+		recordSetId_ = openRecordSets_;
+	}
+	else
+	{
+		set<int>::iterator it = freeCursorNumbers_.begin();
+		recordSetId_ = *it;
+		freeCursorNumbers_.erase(it);
+	}*/
+
+	if(!str_qry.empty() && conn_)
+		open(str_qry, conn_, cursorType_, cursorLocation_, cursorDataType_);
+}
+
+TePGRecordset::~TePGRecordset()
+{	
+	// Deixa o id livre
+	//freeCursorNumbers_.insert(recordSetId_);
+	TePGRecordset::releaseCursor(recordSetId_);
+
+	close();
+}
+
+void TePGRecordset::close(void)
+{
+	if(cursorDeclared_ && conn_)
+	{
+		string sqlCloseCursor  = "CLOSE CURSOR_";
+	           sqlCloseCursor += Te2String(recordSetId_);
+
+		conn_->exec_cmd(sqlCloseCursor.c_str());
+	}	
+
+	freeRecordSet();
+
+	cursorDeclared_ = false;
+
+	conn_ = 0;
+
+	return;
+}
+
+bool TePGRecordset::moveFirst(void)
+{
+	if(!cursorDeclared_)
+		return false;
+
+	if(cursorLocation_ == TeCLIENTESIDE)
+	{
+		if(recordCount() > 0)
+		{
+			int_index_current_ = 0;
+			return true;
+		}
+		else
+			return false;
+	}
+
+	firstFetch = false;
+	lastFetch = false;
+
+	string moveFirstSQL  = "MOVE ABSOLUTE 0 IN CURSOR_";
+		   moveFirstSQL += Te2String(recordSetId_);
+
+	int res = conn_->exec_cmd(moveFirstSQL.c_str());
+
+	if(res == 0)
+	{
+		freeRecordSet();
+
+		string fetchSQL  = "FETCH FORWARD " + Te2String(numRowsToRetrieve_);
+	           fetchSQL += " FROM CURSOR_";
+		       fetchSQL += Te2String(recordSetId_);
+
+		pg_recordset_ = conn_->exec(fetchSQL.c_str());
+
+		if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
+		{
+			if(recordCount() > 0)
+			{
+				int_eof_ = recordCount();
+				int_index_current_ = 0;
+				return true;
+			}
+		}
+		
+		freeRecordSet();
+		return false;
+	}
+ 
+	return false;
+}
+
+bool TePGRecordset::movePrevious(void)
+{	
+	//if(!cursorDeclared_ || (cursorType_ == TeUNIDIRECTIONAL))
+	if(!cursorDeclared_)
+		return false;
+
+	if(cursorLocation_ == TeCLIENTESIDE)
+	{
+		if(bof())
+			return false;
+		else
+		{
+			--int_index_current_;
+			return true;
+		}
+	}
+
+	if(recordCount() > 0)
+	{
+		string move = "";
+		string fetchSQL = "";
+
+		if(!movingBackward_)
+		{
+			 if(bof())
+				 return false;
+		
+			--int_index_current_;
+
+			if(bof())
+			{
+				movingBackward_ = true;
+
+				int val = recordCount() - 1;
+
+				if(lastFetch)
+				{
+					++val;
+				}
+
+				move = " MOVE BACKWARD "+Te2String(val)+" FROM CURSOR_"+Te2String(recordSetId_)+";";
+
+				fetchSQL = move;
+				fetchSQL += " FETCH BACKWARD ";
+				fetchSQL += Te2String(numRowsToRetrieve_);
+				fetchSQL += " FROM CURSOR_";
+				fetchSQL += Te2String(recordSetId_);
+			}
+			else
+			{
+				return true;
+			}
+		}
+		else
+		{
+			if(eof())
+				 return false;
+		
+			++int_index_current_;
+
+			if(eof())
+			{	
+				fetchSQL  = "FETCH BACKWARD ";
+				fetchSQL += Te2String(numRowsToRetrieve_);
+				fetchSQL += " FROM CURSOR_";
+				fetchSQL += Te2String(recordSetId_);
+			}
+			else
+			{
+				return true;
+			}
+		}
+		pg_recordset_ = conn_->exec(fetchSQL.c_str());
+
+		if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
+		{			
+			firstFetch = false;
+			lastFetch = false;
+			
+			if(this->recordCount() > 0)
+			{
+				int_eof_ = recordCount();
+				int_index_current_ = 0;
+
+				if(this->recordCount() != numRowsToRetrieve_)
+				{
+					firstFetch = true;
+				}
+
+
+				return true;
+			}
+			
+		}
+
+		freeRecordSet();
+ 	}
+
+	return false;
+}
+
+bool TePGRecordset::moveNext(void)
+{
+	if(!cursorDeclared_)
+		return false;
+
+	if(cursorLocation_ == TeCLIENTESIDE)
+	{
+		if(eof())
+			return false;
+
+		++int_index_current_;
+
+		return true;
+	}
+
+	if((recordCount() > 0))
+	{
+		string move = "";
+		string fetchSQL = "";
+
+		if(!movingBackward_)
+		{	
+			if(!eof())
+			{
+				++int_index_current_;
+
+				if(eof())
+				{
+					fetchSQL  = "FETCH FORWARD ";
+					fetchSQL += Te2String(numRowsToRetrieve_);
+					fetchSQL += " FROM CURSOR_";
+					fetchSQL += Te2String(recordSetId_);
+				}
+				else
+				{
+					return true;
+				}
+			}
+		}
+		else
+		{
+			if(!bof())
+			{
+				--int_index_current_;
+
+				if(bof())
+				{
+					movingBackward_ = false;	
+					int val = recordCount() -1;
+					if(firstFetch)
+					{
+						++val;
+					}
+					move = " MOVE FORWARD "+Te2String(val)+" FROM CURSOR_"+Te2String(recordSetId_)+";";
+
+					fetchSQL = move;
+
+					fetchSQL += "FETCH FORWARD ";
+					fetchSQL += Te2String(numRowsToRetrieve_);
+					fetchSQL += " FROM CURSOR_";
+					fetchSQL += Te2String(recordSetId_);
+				}
+				else
+				{
+					return true;
+				}
+			}
+		}
+		freeRecordSet();
+
+		pg_recordset_ = conn_->exec(fetchSQL.c_str());
+
+		if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
+		{
+			firstFetch = false;
+			lastFetch = false;
+
+			if(recordCount() > 0)
+			{
+				int_eof_ = recordCount();
+				int_index_current_ = 0;
+
+				if(this->recordCount() != numRowsToRetrieve_)
+				{
+					lastFetch = true;
+				}
+				
+				return true;
+			}
+		}
+		
+		freeRecordSet();
+	}
+
+	return false;
+}
+
+bool TePGRecordset::moveLast(void)
+{
+	//if(!cursorDeclared_ || (cursorType_ == TeUNIDIRECTIONAL))
+	if(!cursorDeclared_)
+		return false;
+
+	if(cursorLocation_ == TeCLIENTESIDE)
+	{
+		if(recordCount() > 0)
+		{
+			int_index_current_ = recordCount() - 1;
+			return true;
+		}
+		
+		return false;
+	}
+
+	firstFetch = false;
+	lastFetch = false;
+
+	freeRecordSet();
+
+	string fetchSQL  = "FETCH LAST FROM CURSOR_";
+		   fetchSQL += Te2String(recordSetId_);
+
+	pg_recordset_ = conn_->exec(fetchSQL.c_str());
+
+	if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
+	{
+		if(this->recordCount() > 0)
+		{
+			int_eof_ = recordCount();
+			int_index_current_ = 0;
+			return true;
+		}		
+	}
+	
+	freeRecordSet();
+ 
+	return false;
+	
+}
+
+bool TePGRecordset::moveTo(const int& lin_number)
+{
+	//if(!cursorDeclared_ || (cursorType_ == TeUNIDIRECTIONAL))
+	if(!cursorDeclared_)
+		return false;
+
+	if(cursorLocation_ == TeCLIENTESIDE)
+	{
+		if((lin_number > int_bof_) && (lin_number < int_eof_))
+		{
+			int_index_current_ = lin_number;
+			return true;
+		}
+		
+		return false;		
+	}
+
+	firstFetch = false;
+	lastFetch = false;
+
+	freeRecordSet();
+
+	string fetchSQL  = "FETCH ABSOLUTE ";
+		   fetchSQL += Te2String(lin_number);
+	       fetchSQL += " FROM CURSOR_";
+		   fetchSQL += Te2String(recordSetId_);
+
+	pg_recordset_ = conn_->exec(fetchSQL.c_str());
+
+	if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
+	{
+		if(this->recordCount() > 0)
+		{
+			int_eof_ = recordCount();
+			int_index_current_ = 0;
+			return true;
+		}
+	}
+
+	freeRecordSet();
+ 
+	return false;	
+}
+
+bool TePGRecordset::open(const string& str_qry, TePGConnection* con_x,
+			      const TeCursorType& cursorType,
+				  const TeCursorLocation& cursorLocation,
+				  const TeCursorDataType& cursorDataType,
+				  const int& numRowsToRetrieve)
+{
+	close();
+
+	if(str_qry.empty() || !con_x)
+		return false;
+
+	cursorType_ = cursorType;
+	cursorLocation_ = cursorLocation;
+	cursorDataType_ = cursorDataType;
+	numRowsToRetrieve_ = numRowsToRetrieve;
+	cursorDeclared_ = false;
+	conn_ = con_x;
+	movingBackward_ = false;
+	lastFetch = false;
+	firstFetch = false;
+
+	string sqlCursor  = "DECLARE CURSOR_";
+		   sqlCursor += Te2String(recordSetId_);
+		   sqlCursor += (cursorDataType_  == TeBINARYCURSOR) ? " BINARY " : " ";
+		   //sqlCursor += (cursorType_ == TeUNIDIRECTIONAL) ? " NO " : " ";
+		   sqlCursor += "SCROLL CURSOR WITH HOLD FOR ";
+		   sqlCursor += str_qry;	
+
+	pg_recordset_ = conn_->exec(sqlCursor.c_str());
+
+	if(PQresultStatus(pg_recordset_) == PGRES_COMMAND_OK)
+	{
+		cursorDeclared_ = true;
+
+		string numRows = (cursorLocation_ == TeSERVERSIDE) ? Te2String(numRowsToRetrieve_) : string("ALL");
+		
+		string fetchSQL  = "FETCH FORWARD " + numRows;
+	           fetchSQL += " FROM CURSOR_";
+		       fetchSQL += Te2String(recordSetId_);
+
+		pg_recordset_ = conn_->exec(fetchSQL.c_str());
+
+		if(PQresultStatus(pg_recordset_) == PGRES_TUPLES_OK)
+		{
+			if(recordCount() > 0)
+			{
+				int_eof_ = recordCount();
+				int_index_current_ = 0;				
+			}
+
+			return true;
+		}
+	}
+	
+	freeRecordSet();
+
+	return false;
+}
+
+int TePGRecordset::getBytea(const int& field_num, char*& buff) const
+{
+	if(cursorDataType_ == TeTEXTCURSOR)
+	{
+		size_t newLen;
+
+		unsigned char* ptData = PQunescapeBytea((unsigned char*)(value(field_num)), &newLen);
+
+		if(newLen <= 0)
+			return (int)newLen;
+		
+		if(!buff)
+			buff = new char[newLen];
+
+		memcpy(buff, ptData, newLen);
+
+		TePGConnection::freeMem(ptData);
+
+		return (int)newLen;
+	}
+	else	// TeBINARYCURSOR
+	{
+		unsigned int numBytes = PQgetlength(pg_recordset_, int_index_current_, field_num);
+
+		char* ptData = value(field_num);		
+
+		if(!buff)
+			buff = new char[numBytes];
+
+		memcpy(buff, ptData, numBytes);
+
+		return numBytes;
+	}
+}
+
+void TePGRecordset::getByteALine2D(const int& field_num, TeLine2D& l) const
+{
+	char* ptDataAux = 0;
+
+	unsigned long newLen = getBytea(field_num, ptDataAux);
+
+	double* data = (double*) ptDataAux;
+
+	unsigned int npts = newLen / (2 * sizeof(double));
+
+	double x, y;
+
+	for(unsigned int k = 0; k < npts; ++k)
+	{
+		x = (*data++);
+		y = (*data++);
+		
+		TeCoord2D pt(x,y);
+
+		l.add(pt);
+	}
+
+	delete [] ptDataAux;
+}
+
+void TePGRecordset::getPGBox(const int& field_num, TeBox& b) const
+{
+	char* pgbox = value(field_num);
+
+	if(cursorDataType_ == TeBINARYCURSOR)
+	{
+		// POINT ARRAY IS SUPPOSED ALWAYS IN BIG ENDIAN
+		BIN_PG_POINT* pts = (BIN_PG_POINT*)(pgbox);
+
+		// endianness test
+		if(isLittleEndian_)
+		{
+			union
+			{
+				double dWord_;
+				unsigned int aux_[2];
+			} swapx1, swapy1, swapx2, swapy2;
+
+			// little-endian
+			swapx1.dWord_ = pts[0].x;
+			swapy1.dWord_ = pts[0].y;
+
+			swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
+			swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
+
+			swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
+			swapy2.aux_[0] = ntohl(swapy1.aux_[1]);
+
+			double X2 = swapx2.dWord_;
+			double Y2 = swapy2.dWord_;
+
+			swapx1.dWord_ = pts[1].x;
+			swapy1.dWord_ = pts[1].y;
+
+			swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
+			swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
+
+			swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
+			swapy2.aux_[0] = ntohl(swapy1.aux_[1]);
+
+			double X1 = swapx2.dWord_;
+			double Y1 = swapy2.dWord_;
+
+			TeBox baux(X1, Y1, X2, Y2);
+
+			b = baux;						
+		}
+		else
+		{
+			// big-endian!
+			double X2 = pts[0].x;
+			double Y2 = pts[0].y;
+			double X1 = pts[1].x;
+			double Y1 = pts[1].y;
+			TeBox baux(X1, Y1, X2, Y2);
+
+			b = baux;
+		}
+	}
+	else	//TeTEXTCURSOR
+		b = PGBoxRtree_decode(pgbox);
+}
+
+void TePGRecordset::getPGLine2D(const int& field_num, TeLine2D& l) const
+{
+	char* polygon = value(field_num);
+
+	if(cursorDataType_ == TeBINARYCURSOR)
+	{
+		unsigned int numPts;
+		memcpy(&numPts, polygon, sizeof(int));
+		numPts = ntohl(numPts);
+
+		l.reserve(numPts);
+
+		// POINT ARRAY IS SUPPOSED ALWAYS IN BIG ENDIAN
+		BIN_PG_POINT* pts = (BIN_PG_POINT*)(polygon + sizeof(int));		
+
+		// endianness test
+		if(isLittleEndian_)
+		{
+			union
+			{
+				double dWord_;
+				unsigned int aux_[2];
+			} swapx1, swapy1, swapx2, swapy2;
+
+			// little-endian
+			for(unsigned int i = 0; i < numPts ; ++i)
+			{
+				swapx1.dWord_ = pts[i].x;
+				swapy1.dWord_ = pts[i].y;
+
+				swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
+				swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
+
+				swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
+				swapy2.aux_[0] = ntohl(swapy1.aux_[1]);
+
+				l.add(TeCoord2D(swapx2.dWord_, swapy2.dWord_));
+			}
+			
+		}
+		else
+		{
+			// big-endian!
+			for(unsigned int i = 0; i < numPts ; ++i)
+				l.add(TeCoord2D(pts[i].x, pts[i].y));
+			
+		}
+	}
+	else	//TeTEXTCURSOR
+		l = PgGeomPolygon2Te(polygon);
+}
+
+char* TePGRecordset::getWKBHeader(char* v, unsigned char &byteOrder, unsigned int &wkbType, unsigned int &numGeometries) const
+{
+	const int byteOrderPlusGeomType = sizeof(unsigned char) + sizeof(unsigned int);	
+
+	if(cursorDataType_ == TeTEXTCURSOR)
+	{
+		unsigned char header [byteOrderPlusGeomType];
+
+		for (int t = 0; t < byteOrderPlusGeomType; ++t)
+		{
+			header[t] =(unsigned char) parse_hex(v) ;
+			v += 2;
+		}
+
+		memcpy(&byteOrder, header, sizeof(unsigned char));		
+		memcpy(&wkbType, header + sizeof(unsigned char), sizeof(unsigned int));
+	}
+	else
+	{
+		memcpy(&byteOrder, v, sizeof(unsigned char));		
+		memcpy(&wkbType, v + sizeof(unsigned char), sizeof(unsigned int));
+
+		v += byteOrderPlusGeomType;
+	}	
+	
+
+	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+	if((byteOrder == 0) && isLittleEndian_)
+	{
+		wkbType = ntohl(wkbType);
+	}
+	else if((byteOrder == 1) && !isLittleEndian_)
+	{
+		wkbType = TePGSwapUInt(wkbType);
+	}	
+
+	numGeometries = 0;
+
+	if(wkbType > 1 && wkbType <= 7)
+	{
+		if(cursorDataType_ == TeTEXTCURSOR)
+		{
+			unsigned char qtd[sizeof(unsigned int)];
+
+			for(unsigned int t = 0; t < sizeof(unsigned int); ++t)
+			{
+				qtd[t] = (unsigned char)parse_hex(v);
+				v += 2;
+			}
+
+			memcpy(&numGeometries, qtd, sizeof(unsigned int));
+		}
+		else
+		{
+			memcpy(&numGeometries, v, sizeof(unsigned int));
+			v += sizeof(unsigned int);
+		}
+
+		// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+		if((byteOrder == 0) && isLittleEndian_)
+		{
+			numGeometries = ntohl(numGeometries);	
+		}
+		else if((byteOrder == 1) && !isLittleEndian_)
+		{
+			numGeometries = TePGSwapUInt(numGeometries);
+		}
+	}
+
+	return v;	
+}
+
+char* TePGRecordset::getWKBPoint(char* v, TeCoord2D& c) const
+{
+	unsigned char byteOrder;
+	unsigned int wkbType;
+	unsigned int numGeometries;
+
+	v = getWKBHeader(v, byteOrder, wkbType, numGeometries);
+	
+	if(wkbType != 1)
+		throw logic_error("Binary data doesn't supported!");
+		
+
+	union
+	{
+		double dWord_;
+		unsigned int aux_[2];
+	} swapx1, swapy1;
+
+	if(cursorDataType_ == TeTEXTCURSOR)
+	{
+
+		const int double2Size = 2 * sizeof(double);
+		unsigned char data[double2Size];
+		
+		for(int t = 0; t < double2Size; ++t) // len/2
+		{
+			data[t] = (unsigned char)parse_hex(v);
+			v += 2;
+		}
+		
+
+		memcpy(&swapx1.dWord_, data , sizeof(double));
+		memcpy(&swapy1.dWord_, data + sizeof(double), sizeof(double));
+	}
+	else
+	{
+		memcpy(&swapx1.dWord_, v , sizeof(double));
+		memcpy(&swapy1.dWord_, v + sizeof(double), sizeof(double));
+
+		v += (sizeof(double) + sizeof(double)); // x + y
+	}
+
+	// 0 = Big Endian (wkbXDR)
+	if((byteOrder == 0) && isLittleEndian_)
+	{
+		union
+		{
+			double dWord_;
+			unsigned int aux_[2];
+		} swapx2, swapy2;
+
+		swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
+		swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
+
+		swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
+		swapy2.aux_[0] = ntohl(swapy1.aux_[1]);	
+		
+		c.x(swapx2.dWord_);
+		c.y(swapy2.dWord_);
+
+		return v;
+	}
+	else if((byteOrder == 1) && !isLittleEndian_)
+	{
+		union
+		{
+			double dWord_;
+			unsigned int aux_[2];
+		} swapx2, swapy2;
+
+		swapx2.aux_[1] = TePGSwapUInt(swapx1.aux_[0]);
+		swapx2.aux_[0] = TePGSwapUInt(swapx1.aux_[1]);
+
+		swapy2.aux_[1] = TePGSwapUInt(swapy1.aux_[0]);
+		swapy2.aux_[0] = TePGSwapUInt(swapy1.aux_[1]);
+		
+		c.x(swapx2.dWord_);
+		c.y(swapy2.dWord_);
+
+		return v;
+
+	}
+
+	c.x(swapx1.dWord_);
+	c.y(swapy1.dWord_);
+
+	return v;
+}
+
+char* TePGRecordset::getWKBLinearRing(char* v, int byteOrder, TeLine2D &line) const
+{
+	unsigned int numPoints;
+	
+	const int size2Double = sizeof(double) + sizeof(double); // x + y
+
+	if(cursorDataType_ == TeTEXTCURSOR)
+	{
+		unsigned char data[size2Double];
+
+		for(unsigned int n = 0; n < sizeof(unsigned int); ++n)
+		{
+			data[n] = (unsigned char)parse_hex(v);
+			v += 2;
+		}
+
+		memcpy(&numPoints, data , sizeof(unsigned int));
+	}
+	else
+	{
+		memcpy(&numPoints, v , sizeof(unsigned int));
+		v += sizeof(unsigned int);
+	}
+
+	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+	if((byteOrder == 0) && isLittleEndian_)
+	{
+		numPoints = ntohl(numPoints);	
+	}
+	else if((byteOrder == 1) && !isLittleEndian_)
+	{
+		numPoints = TePGSwapUInt(numPoints);
+	}
+
+	for(unsigned int i = 0; i < numPoints; ++i)
+	{
+		union
+		{
+			double dWord_;
+			unsigned int aux_[2];
+		} swapx1, swapy1;
+
+		if(cursorDataType_ == TeTEXTCURSOR)
+		{
+			unsigned char data[size2Double];
+
+			for(int t = 0; t < size2Double; ++t) // len/2
+			{
+				data[t] = (unsigned char)parse_hex(v);
+				v += 2;
+			}	
+
+			memcpy(&swapx1.dWord_, data , sizeof(double));
+			memcpy(&swapy1.dWord_, data + sizeof(double), sizeof(double));
+		}
+		else
+		{
+			memcpy(&swapx1.dWord_, v , sizeof(double));
+			memcpy(&swapy1.dWord_, v + sizeof(double), sizeof(double));
+			v += size2Double;
+		}
+
+		// 0 = Big Endian (wkbXDR)
+		if((byteOrder == 0) && isLittleEndian_)
+		{
+			union
+			{
+				double dWord_;
+				unsigned int aux_[2];
+			} swapx2, swapy2;
+
+			swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
+			swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
+
+			swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
+			swapy2.aux_[0] = ntohl(swapy1.aux_[1]);	
+			
+			line.add(TeCoord2D(swapx2.dWord_, swapy2.dWord_));			
+		}
+		else if((byteOrder == 1) && !isLittleEndian_)	//1 = Little Endian (wkbNDR)
+		{
+			union
+			{
+				double dWord_;
+				unsigned int aux_[2];
+			} swapx2, swapy2;
+
+			swapx2.aux_[1] = TePGSwapUInt(swapx1.aux_[0]);
+			swapx2.aux_[0] = TePGSwapUInt(swapx1.aux_[1]);
+
+			swapy2.aux_[1] = TePGSwapUInt(swapy1.aux_[0]);
+			swapy2.aux_[0] = TePGSwapUInt(swapy1.aux_[1]);
+			
+			line.add(TeCoord2D(swapx2.dWord_, swapy2.dWord_));
+		}
+		else
+		{
+			line.add(TeCoord2D(swapx1.dWord_, swapy1.dWord_));
+		}
+	}
+
+	return v;
+
+}
+
+char* TePGRecordset::getWKBLine(char* v, TeLine2D& l) const
+{
+	unsigned char byteOrder;
+	unsigned int wkbType;
+	unsigned int numPoints;
+
+	v = getWKBHeader(v, byteOrder, wkbType, numPoints);
+	
+	if(wkbType != 2)
+		throw logic_error("Binary data doesn't supported!");
+
+	if(cursorDataType_ == TeTEXTCURSOR)
+	{
+		// Volta duas vezes o n�mero de bytes do n�mero de geometrias lidos ao chamar getWKBHeader
+		v = getWKBLinearRing(v - (sizeof(unsigned int) + sizeof(unsigned int)), byteOrder, l);
+	}
+	else
+	{
+		// Volta o n�mero de bytes do n�mero de geometrias lidos ao chamar getWKBHeader
+		v = getWKBLinearRing(v - sizeof(unsigned int), byteOrder, l);
+	}
+
+	return v;
+
+}
+
+char* TePGRecordset::getWKBPolygon(char* v, TePolygon& p) const
+{
+	unsigned char byteOrder;
+	unsigned int wkbType;
+	unsigned int numRings;
+
+	v = getWKBHeader(v, byteOrder, wkbType, numRings);
+	
+	if(wkbType != 3)
+		throw logic_error("Binary data doesn't supported!");
+
+	for(unsigned int i = 0; i < numRings; ++i)
+	{
+		TeLine2D line;
+		v = getWKBLinearRing(v, byteOrder, line);
+		p.add(line);
+	}
+
+	return v;
+
+}
+
+char* TePGRecordset::getWKBMultiPoint(char* v, TePointSet &ps) const
+{
+	unsigned char byteOrder; 
+	unsigned int wkbType; 
+	unsigned int num_wkbPoints; 
+
+	v = getWKBHeader(v, byteOrder, wkbType, num_wkbPoints);
+
+	if(wkbType != 4)
+		throw logic_error("Binary data doesn't supported!");
+
+	for(unsigned int i = 0; i < num_wkbPoints; ++i)
+	{
+		TeCoord2D coord;
+		v = getWKBPoint(v, coord);
+		ps.add(coord);
+	}
+
+	return v;
+}
+
+char* TePGRecordset::getWKBMultiLine(char* v, TeLineSet &ls) const
+{
+	unsigned char byteOrder; 
+	unsigned int wkbType; 
+	unsigned int num_wkbLineStrings; 
+
+	v = getWKBHeader(v, byteOrder, wkbType, num_wkbLineStrings);
+
+	if(wkbType != 5)
+		throw logic_error("Binary data doesn't supported!");
+
+	for(unsigned int i = 0; i < num_wkbLineStrings; ++i)
+	{
+		TeLine2D line;
+		v = getWKBLine(v, line);
+		ls.add(line);
+	}
+
+	return v;
+}
+
+char* TePGRecordset::getWKBMultiPolygon(char* v, TePolygonSet &ps) const
+{
+	unsigned char byteOrder;
+	unsigned int wkbType;
+	unsigned int num_wkbPolygons;
+
+	v = getWKBHeader(v, byteOrder, wkbType, num_wkbPolygons);
+
+	if(wkbType != 6)
+		throw logic_error("Binary data doesn't supported!");
+
+	for(unsigned int i = 0; i < num_wkbPolygons; ++i)
+	{
+		TePolygon poly;
+		v = getWKBPolygon(v, poly);
+		ps.add(poly);
+	}
+
+	return v;
+}
+
+void TePGRecordset::getWKBGeomColl(char* v, TeMultiGeometry &mg) const
+{
+	unsigned char byteOrder; 
+	unsigned int wkbType; 
+	unsigned int num_wkbGeometries;
+
+	v = getWKBHeader(v, byteOrder, wkbType, num_wkbGeometries);
+
+	if(wkbType != 7)
+		throw logic_error("Binary data doesn't supported!");
+
+	for(unsigned int i = 0; i < num_wkbGeometries; ++i)
+	{
+		unsigned int geomType;
+		unsigned char geomByteOrder;
+		unsigned int num_geometries;
+
+		getWKBHeader(v, geomByteOrder, geomType, num_geometries);
+
+		if(geomType == 1)
+		{
+			TeCoord2D coord;
+
+			v = getWKBPoint(v, coord);
+
+			mg.addGeometry(TePoint(coord));
+		}
+		else if(geomType == 2)
+		{
+			TeLine2D line;
+
+			v = getWKBLine(v, line);
+
+			mg.addGeometry(line);
+		}
+		else if(geomType == 3)
+		{
+			TePolygon poly;
+
+			v = getWKBPolygon(v, poly);
+
+			mg.addGeometry(poly);
+		}
+		else if(geomType == 4)
+		{
+			TePointSet pointSet;
+
+			v = getWKBMultiPoint(v, pointSet);
+
+			for(unsigned int a = 0; a < pointSet.size(); ++a)
+			{
+				TePoint point = pointSet[a];
+				mg.addGeometry(point);
+			}
+		}
+		else if(geomType == 5)
+		{
+			TeLineSet lineSet;
+
+			v = getWKBMultiLine(v, lineSet);
+
+			for(unsigned int a = 0; a < lineSet.size(); ++a)
+			{
+				TeLine2D coord = lineSet[a];
+
+				mg.addGeometry(coord);
+			}
+		}
+		else if(geomType == 6)
+		{
+			TePolygonSet polygonSet;
+			
+			v = getWKBMultiPolygon(v, polygonSet);
+			
+			for(unsigned int a = 0; a < polygonSet.size(); ++a)
+			{
+				TePolygon poly = polygonSet[a];
+
+				mg.addGeometry(poly);
+			}
+		}
+		else
+		{
+			throw logic_error("The data couldn't be decoded as a valid WKB geometry!");
+		}
+	}
+
+}
+
+
+void TePGRecordset::getPGISPoint(const int& field_num, TePoint& p) const
+{
+	TeCoord2D c;
+	getWKBPoint(value(field_num), c);
+	p.add(c);
+}
+
+
+void TePGRecordset::getPGISLine(const int& field_num, TeLine2D& l) const
+{
+	getWKBLine(value(field_num), l);		
+}
+
+
+void TePGRecordset::getPGISPolygon(const int& field_num, TePolygon& p) const
+{
+	getWKBPolygon(value(field_num), p);		
+}
+
+
+void TePGRecordset::getPGISMultiPoint(const int& field_num, TePointSet& ps) const
+{
+	getWKBMultiPoint(value(field_num), ps);		
+}
+
+
+void TePGRecordset::getPGISMultiLine(const int& field_num, TeLineSet& ls) const
+{
+	getWKBMultiLine(value(field_num), ls);		
+}
+
+
+void TePGRecordset::getPGISMultiPolygon(const int& field_num, TePolygonSet& ps) const
+{
+	getWKBMultiPolygon(value(field_num), ps);	
+}
+
+
+void TePGRecordset::getPGISGeomColl(const int& field_num, TeMultiGeometry& m) const
+{
+	getWKBGeomColl(value(field_num), m);
+}
+
+string TePGRecordset::getDate(const int& field_num) const
+{
+	if(cursorDataType_ == TeTEXTCURSOR)
+		return value(field_num);
+
+// for binary cursors only
+	struct te_pg_tm tt;
+	struct te_pg_tm *tm = &tt;
+    
+	TeDateADT date = getInt(field_num);
+
+	j2date(date + POSTGRES_EPOCH_JDATE,
+		   &(tm->tm_year), &(tm->tm_mon), &(tm->tm_mday));
+
+	char buf[MAXDATELEN + 1];
+	
+	string datestr = "";
+
+	if(EncodeDateOnly(tm, buf))
+        datestr = buf;
+	
+	return datestr;
+}
+
+string TePGRecordset::getTime(const int& field_num)
+{
+	if(cursorDataType_ == TeTEXTCURSOR)
+	{
+		string res = value(field_num);
+
+		return res;
+	}
+
+	te_int64 time;
+
+	if(this->conn_->isDateInt())
+	{
+        unsigned int h32;
+		unsigned int l32;
+
+		memcpy(&h32, value(field_num), sizeof(unsigned));
+		memcpy(&l32, value(field_num) + sizeof(unsigned), sizeof(unsigned));
+
+		h32 = ntohl(h32);
+		l32 = ntohl(l32);
+
+		time = h32;
+		time <<= 32;
+		time |= l32;
+	}
+	else
+	{
+		double t_aux = getDouble(field_num);
+
+		t_aux*=1000000;
+		time=(te_int64)t_aux;
+	}
+
+	struct te_pg_tm tt;
+	struct te_pg_tm *tm = &tt;
+	te_fsec_t fsec;
+
+	char buf[MAXDATELEN + 1];
+
+	string datestr = "";
+
+	time2tm(time, tm, &fsec);
+	
+	if(EncodeTimeOnly(tm, fsec, NULL, buf))
+        datestr = buf;
+	
+	return datestr;
+}
+
+string TePGRecordset::getTimeStamp(const int& field_num)
+{
+	if(cursorDataType_ == TeTEXTCURSOR)
+	{
+		string res = value(field_num);
+
+		return res;
+	}
+
+	te_int64 timestamp;
+
+	if(this->conn_->isDateInt())
+	{
+        unsigned int h32;
+		unsigned int l32;
+
+		memcpy(&h32, value(field_num), sizeof(unsigned));
+		memcpy(&l32, value(field_num) + sizeof(unsigned), sizeof(unsigned));
+
+		h32 = ntohl(h32);
+		l32 = ntohl(l32);
+
+		timestamp = h32;
+		timestamp <<= 32;
+		timestamp |= l32;
+	}
+	else
+	{
+		double t_aux = getDouble(field_num);
+
+		t_aux*=1000000;
+		timestamp=(te_int64)t_aux;
+	}
+
+	struct te_pg_tm tt;
+	struct te_pg_tm *tm = &tt;
+	te_fsec_t fsec;
+	char *tzn = NULL;
+
+	char buf[MAXDATELEN + 1];
+
+	string datestr = "";
+
+	if(TIMESTAMP_NOT_FINITE(timestamp))
+	{
+		if(EncodeSpecialTimestamp(timestamp, buf))
+			datestr = buf;
+	}
+	else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL))
+	{
+		if(EncodeDateTime(tm, fsec, NULL, &tzn, buf))
+			datestr = buf;
+	}
+        
+	
+	return datestr;
+}
+
+int TePGRecordset::getInt8(const int& field_num) const
+{
+	unsigned int h32;
+	unsigned int l32;
+
+	memcpy(&h32, value(field_num), sizeof(unsigned));
+	memcpy(&l32, value(field_num) + sizeof(unsigned), sizeof(unsigned));
+
+	h32 = ntohl(h32);
+	l32 = ntohl(l32);
+
+	te_int64 i64value = h32;
+	i64value <<= 32;
+	i64value |= l32;
+
+	return (int)i64value;
+}
+
+
+char* TePGRecordset::getData(const int& field_num)
+{
+	data_ = "";
+
+	if(cursorDataType_ == TeTEXTCURSOR)
+		return value(field_num);
+	else
+	{
+		// chamar o conversor de tipo de dado de bin�rio p/ string p/ cada tipo!
+		switch(fieldType(field_num))
+		{
+			case PG_NAME_TYPE			:
+			case PG_TEXT_TYPE			:
+			case PG_VARCHAR_TYPE		:		if(isNull(field_num))  
+												{
+													data_ = "";
+												}
+												else
+												{
+													return value(field_num);
+												}
+
+												break;
+
+			case PG_INT8_TYPE			:		if(isNull(field_num))  
+												{
+													data_ = "";
+												}
+												else
+												{
+													data_ = Te2String(getInt8(field_num));
+												}
+												break;
+
+			case PG_BOOL_TYPE			:
+			case PG_BYTEA_TYPE			:
+			case PG_CHAR_TYPE			:			
+			case PG_INT2_TYPE			: 
+											break;
+
+			case PG_OID_TYPE			:
+			case PG_INT4_TYPE			: if(isNull(field_num))  
+										  {
+											  data_ = "";
+										  }
+										  else
+										  {
+                                              data_ = Te2String(getInt(field_num));
+										  }
+										  break;			
+			
+			case PG_PG_FLOAT4_TYPE      :
+			case PG_POINT_TYPE			:
+			case PG_LSEG_TYPE			:
+			case PG_PATH_TYPE			:
+			case PG_BOX_TYPE			:
+			case PG_POLYGON_TYPE		:
+			case PG_LINE_TYPE			: 
+											break;
+
+
+			case PG_FLOAT8_TYPE			: if(isNull(field_num))  
+										  {
+											  data_ = "";
+										  }
+										  else
+										  {
+											  data_ = Te2String(getDouble(field_num), 15);
+										  }
+										  break;
+
+			case PG_TIMESTAMP_TYPE		: if(isNull(field_num))  
+										  {
+											  data_ = "";
+										  }
+										  else
+										  {
+                                              data_ = getTimeStamp(field_num);
+										  }
+				                          break;
+
+		    case PG_DATE_TYPE			: if(isNull(field_num))  
+										  {
+											  data_ = "";
+										  }
+										  else
+										  {
+											  data_ = getDate(field_num);
+										  }
+				                          break;
+
+		    case PG_TIME_TYPE			: if(isNull(field_num))  
+										  {
+											  data_ = "";
+										  }
+										  else
+										  {
+											  data_ = getTime(field_num);	
+										  }
+										  break;
+
+
+			case PG_TIMESTAMPTZ_TYPE	:			
+			case PG_TIMETZ_TYPE			:
+										
+										  break;
+
+			case PG_INTERVAL_TYPE		: 
+										  break;
+
+			case PG_CIRCLE_TYPE			:
+			case PG_MONEY_TYPE			:
+			case PG_BPCHAR_TYPE			:			
+			case PG_BIT_TYPE			:
+			case PG_VARBIT_TYPE			:
+			case PG_NUMERIC_TYPE		:
+			default						: 
+											
+											break;
+		}
+		
+		return (char*)data_.c_str();
+	}
+}
+
+int TePGRecordset::fieldSize(const int& field_num)
+{
+ Oid field_t = this->fieldType(field_num);
+ Oid field_m = PQfmod(pg_recordset_, field_num);
+ PGresult *result_temp;
+ char str_int[5];   //integer part if DECIMAL(p,s) or NUMERIC(p,s)
+ //int size = -1;
+ int size = 0;
+ char str_field_t[50];
+ char str_field_m[50];
+ sprintf(str_field_t,"%d", field_t);
+ sprintf(str_field_m,"%d", field_m);
+ string str_qry = "SELECT format_type(";
+        str_qry += str_field_t;
+        str_qry += ",";
+        str_qry += str_field_m;
+        str_qry += ")";
+ switch(field_t)
+       {
+		case 1042:	// CHAR(n)
+        case 1043:   //VARCHAR(s) or CHARACTER VARYING(s)
+        case 1700:   //NUMERIC(p,s) or DECIMAL(p,s)
+                     result_temp = PQexec(conn_->c_ptr(), str_qry.c_str());
+                     if(PQresultStatus(result_temp) == PGRES_TUPLES_OK)
+                       {
+                        char *lin = PQgetvalue(result_temp, 0, 0);  //Don't free lin because the return of PQgetvalue is in the struct PGResult
+                        int i = 0;
+                        while(*lin != '\0' && *lin != ',')
+                             {
+                              if(*lin >= '0' && *lin <= '9' && i < 4)
+                                {
+                                 str_int[i] = *lin;
+                                 i++;
+                                }
+                              lin++;
+                             }
+                        str_int[i]='\0';
+                        size = atoi(str_int);
+                       }
+                     PQclear(result_temp);
+                     break;
+        default:     //The size of fixed size or for other variable size -1
+                     return PQfsize(pg_recordset_, field_num);
+       }
+ result_temp = 0;
+ return size;
+}
+
+int TePGRecordset::fieldSizeFractionaryPart(const int& field_num)
+{
+ Oid field_t = this->fieldType(field_num);
+ Oid field_m = PQfmod(pg_recordset_, field_num);
+ PGresult *result_temp;
+ char str_frac[5];   //fractionary part if DECIMAL(p,s) or NUMERIC(p,s)
+ //int size = -1;
+ int size = 0;
+ char str_field_t[50];
+ char str_field_m[50];
+ sprintf(str_field_t,"%d", field_t);
+ sprintf(str_field_m,"%d", field_m);
+ string str_qry = "SELECT format_type(";
+        str_qry += str_field_t;
+        str_qry += ",";
+        str_qry += str_field_m;
+        str_qry += ")";
+ switch(field_t)
+       {
+        case 1700:   //NUMERIC(p,s) or DECIMAL(p,s)
+                     result_temp = PQexec(conn_->c_ptr(), str_qry.c_str());
+                     if(PQresultStatus(result_temp) == PGRES_TUPLES_OK)
+                       {
+                        char *lin = PQgetvalue(result_temp, 0, 0);  //Don't free lin because the return of PQgetvalue is in the struct PGResult
+                        int i = 0;
+                        while(*lin != '\0' && *lin != ',')
+                             {
+                              lin++;
+                             }
+                        if(*lin == ',')
+                          {
+                           lin++;
+                          }
+                        while(*lin != '\0')
+                             {
+                              if(*lin >= '0' && *lin <= '9' && i < 4)
+                                {
+                                 str_frac[i] = *lin;
+                                 i++;
+                                }
+                              lin++;
+                             }
+                        str_frac[i]='\0';
+                        size = atoi(str_frac);
+                       }
+                     PQclear(result_temp);
+                     break;
+        default:     //Others doesn't have a fractionary part
+                     break;
+
+       }
+ result_temp = 0;
+ return size;
+}
+
+void TePGRecordset::freeRecordSet()
+{
+	if(pg_recordset_)
+		PQclear(pg_recordset_);
+
+
+	pg_recordset_ = 0;
+	int_index_current_ = -1;
+	int_eof_ = -1;
+	return;
+}
+
+char* TeLine2DToPGBinary(const TeLine2D &line, unsigned int &size)
+{
+	unsigned int numPts = line.size();
+	size = sizeof(int) + (numPts * sizeof(double) * 2);
+
+	char* p = new char[size];
+
+	char* paux = p;
+
+	//coloca o cabe�alho (Numero de pontos)
+	unsigned int numPts_net = htonl(numPts);
+
+	memcpy(p, &numPts_net, sizeof(int));
+	p += sizeof(int);
+
+	for(unsigned int i = 0; i < numPts ; ++i)
+	{
+		double swappedDoubleX = TeConvertToBigEndian(line[i].x());
+		double swappedDoubleY = TeConvertToBigEndian(line[i].y());
+
+		memcpy(p, &swappedDoubleX, sizeof(double));
+		p += sizeof(double);
+		
+		memcpy(p, &swappedDoubleY, sizeof(double));
+		p += sizeof(double);
+	}
+
+	return paux;
+}
+
+char* TeBoxToPGBinary(const TeBox &box, unsigned int &size)
+{
+	size = 4 * sizeof(double);
+
+	char* b = new char[size];
+	char* baux = b;
+
+	double swappedDoubleURX = TeConvertToBigEndian(box.upperRight().x());
+	double swappedDoubleURY = TeConvertToBigEndian(box.upperRight().y());
+
+	double swappedDoubleLFX = TeConvertToBigEndian(box.lowerLeft().x());
+	double swappedDoubleLFY = TeConvertToBigEndian(box.lowerLeft().y());
+
+	memcpy(b, &swappedDoubleURX, sizeof(double));
+	b += sizeof(double);
+	
+	memcpy(b, &swappedDoubleURY, sizeof(double));
+	b += sizeof(double);
+
+	memcpy(b, &swappedDoubleLFX, sizeof(double));
+	b += sizeof(double);
+	
+	memcpy(b, &swappedDoubleLFY, sizeof(double));
+	b += sizeof(double);
+
+	return baux;
+}
+
+double TeConvertToBigEndian(const double &value)
+{
+	double swappedValue;
+
+	union
+	{
+		double dWord_;
+		unsigned int aux_[2];
+	} swapIN, swapOUT;
+
+
+	// endianness test
+	if(((unsigned int) 1) == htonl((unsigned int) 1))
+	{
+		//isLittleEndian_ = false => doesn't need to swap bytes;	
+		swapIN.dWord_ = value;
+
+		memcpy(&swappedValue, &swapIN.dWord_, sizeof(double));
+	}		
+	else
+	{
+		//isLittleEndian_ = true  => swap bytes;
+		swapIN.dWord_ = value;
+
+		swapOUT.aux_[1] = htonl(swapIN.aux_[0]);
+		swapOUT.aux_[0] = htonl(swapIN.aux_[1]);
+	
+		memcpy(&swappedValue, &swapOUT.dWord_, sizeof(double));
+	}
+	return swappedValue;
+}
+
+
+char* TePointToWKBPoint(const TePoint &point, unsigned int &size)
+{
+	char byteOrder;
+	unsigned int wkbType = 1;//WKBPoint
+
+	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+	if(((unsigned int) 1) == htonl((unsigned int) 1))
+	{
+		byteOrder = 0;
+	}
+	else
+	{
+		byteOrder = 1;		
+	}
+
+	//cabecalho
+	size = sizeof(char) + sizeof(int) + (2 * sizeof(double));
+	
+	char* p = new char[size];
+	char* paux = p;
+
+	//byteOrder	
+	memcpy(p, &byteOrder , sizeof(char));
+	p += sizeof(char);
+
+	//WKBPoint
+	memcpy(p, &wkbType , sizeof(unsigned int));
+	p += sizeof(unsigned int);
+
+	double x = point.location().x();
+	double y = point.location().y();
+
+	memcpy(p, &x, sizeof(double));
+	p += sizeof(double);
+	memcpy(p, &y, sizeof(double));
+	p += sizeof(double);
+
+	return paux;
+}
+
+
+char* TeLine2DToWKBLineString(const TeLine2D &line, unsigned int &size)
+{
+	char byteOrder;
+	unsigned int wkbType = 2;//WKBLineString
+	unsigned int nPoints = line.size();
+
+	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+	if(((unsigned int) 1) == htonl((unsigned int) 1))
+	{
+		byteOrder = 0;
+	}
+	else
+	{
+		byteOrder = 1;		
+	}
+
+	size = sizeof(char) + sizeof(int) + sizeof(int) + (2 * sizeof(double) * nPoints);
+	
+	char* l = new char[size];
+	char* laux = l;
+
+	//byteOrder	
+	memcpy(l, &byteOrder , sizeof(char));
+	l += sizeof(char);
+
+	//WKBLineString
+	memcpy(l, &wkbType , sizeof(unsigned int));
+	l += sizeof(unsigned int);
+
+	//nPoints
+	memcpy(l, &nPoints , sizeof(unsigned int));
+	l += sizeof(unsigned int);
+
+	for(unsigned int i = 0; i < nPoints ; ++i)
+	{
+		double x = line[i].x();
+		double y = line[i].y();
+
+		memcpy(l, &x, sizeof(double));
+		l += sizeof(double);
+		
+		memcpy(l, &y, sizeof(double));
+		l += sizeof(double);
+	}
+
+	return laux;
+}
+
+
+char* TePolygonToWKBPolygon(const TePolygon &polygon, unsigned int &size)
+{
+	char byteOrder;
+	unsigned int wkbType = 3;//WKBPolygon
+	unsigned int nRings = polygon.size();
+
+	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+	if(((unsigned int) 1) == htonl((unsigned int) 1))
+	{
+		byteOrder = 0;
+	}
+	else
+	{
+		byteOrder = 1;		
+	}
+
+	//cabecalho
+	size = sizeof(char) + sizeof(int) + sizeof(int);
+	//rings
+	for(unsigned int i = 0; i < nRings ; ++i)
+	{
+		size += sizeof(int) + (2 * sizeof(double) * polygon[i].size());
+	}
+	
+	char* p = new char[size];
+	char* paux = p;
+
+	//byteOrder	
+	memcpy(p, &byteOrder , sizeof(char));
+	p += sizeof(char);
+
+	//WKBPolygon
+	memcpy(p, &wkbType , sizeof(unsigned int));
+	p += sizeof(unsigned int);
+
+	//nRings
+	memcpy(p, &nRings , sizeof(unsigned int));
+	p += sizeof(unsigned int);
+	
+	for(unsigned int i = 0; i < nRings ; ++i)
+	{
+		TeLinearRing ring = polygon[i];
+		unsigned int nPoints = ring.size();
+
+		memcpy(p, &nPoints, sizeof(int));
+		p += sizeof(int);
+		
+		for(unsigned int j = 0; j < nPoints; ++j)
+		{
+			double x = ring[j].x();
+			double y = ring[j].y();
+		
+			memcpy(p, &x, sizeof(double));
+			p += sizeof(double);
+			
+			memcpy(p, &y, sizeof(double));
+			p += sizeof(double);		
+		}
+	}
+
+	return paux;
+}
+
+
+
+
diff --git a/src/terralib/drivers/PostgreSQL/TePGInterface.h b/src/terralib/drivers/PostgreSQL/TePGInterface.h
old mode 100755
new mode 100644
index eb898a8..cad1f2b
--- a/src/terralib/drivers/PostgreSQL/TePGInterface.h
+++ b/src/terralib/drivers/PostgreSQL/TePGInterface.h
@@ -1,512 +1,518 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TePGInterface.h
-    \brief This file contains a database recordset and connection class to PostgreSQL.
-	\author Gilberto Ribeiro de Queiroz - gribeiro at dpi.inpe.br
- */
-
-
-#ifndef  __TERRALIB_INTERNAL_PGINTERFACE_H
-#define  __TERRALIB_INTERNAL_PGINTERFACE_H
- 
-/**
-  * TODO: 1. O caminhamento para tras esta na ordem errada.
-  *       2. A funcao getData devera ser completada para tipos diferentes da TerraLib
-  *
-  */
-//extern "C"
-//{
-#include "libpq-fe.h"
-//}
-
-#ifdef WIN32
-#include <winsock.h>
-#else
-#include <netinet/in.h>
-#endif
-
-
-#include <stdlib.h>
-#include <string>
-#include <cstring>
-
-#include "TeDatabase.h"
-#include "TeMultiGeometry.h"
-#include <TeMutex.h>
-
-using namespace std;
-
-/***************************************************************************
- * Constantes numericas dos tipos de dados do PostgreSQL                   * 
- ***************************************************************************/
-const Oid PG_BOOL_TYPE = 16;
-const Oid PG_BYTEA_TYPE = 17;
-const Oid PG_CHAR_TYPE = 18;
-const Oid PG_NAME_TYPE = 19;
-const Oid PG_INT8_TYPE = 20;
-const Oid PG_INT2_TYPE = 21;
-const Oid PG_INT4_TYPE = 23;
-const Oid PG_TEXT_TYPE = 25;
-const Oid PG_OID_TYPE = 26;
-const Oid PG_POINT_TYPE = 600;
-const Oid PG_LSEG_TYPE = 601;
-const Oid PG_PATH_TYPE = 602;
-const Oid PG_BOX_TYPE = 603;
-const Oid PG_POLYGON_TYPE = 604;
-const Oid PG_LINE_TYPE = 628;
-const Oid PG_PG_FLOAT4_TYPE = 700;
-const Oid PG_FLOAT8_TYPE = 701;
-const Oid PG_CIRCLE_TYPE = 718;
-const Oid PG_MONEY_TYPE = 790;
-const Oid PG_BPCHAR_TYPE = 1042;
-const Oid PG_VARCHAR_TYPE = 1043;
-const Oid PG_DATE_TYPE = 1082;
-const Oid PG_TIME_TYPE = 1083;
-const Oid PG_TIMESTAMP_TYPE = 1114;
-const Oid PG_TIMESTAMPTZ_TYPE = 1184;
-const Oid PG_INTERVAL_TYPE = 1186;
-const Oid PG_TIMETZ_TYPE = 1266;
-const Oid PG_BIT_TYPE = 1560;
-const Oid PG_VARBIT_TYPE = 1562;
-const Oid PG_NUMERIC_TYPE = 1700;			
-
-
-
-/***************************************************************************
- * Classe responsavel pela abertura e fechamento de uma conexao com o      *
- * banco de dados. Alem de abrir e fechar uma conexao, permite que uma     *
- * consulta seja executada, retornando um conjunto de registros, ou que um *
- * comando - insert, update, delete - seja executado diretamente,          *
- * retornando o numero de registros afetados pelo comando.                 *
- ***************************************************************************/
-class TePGConnection
-{
-    protected:
-
-        PGconn *pg_connection_;	// A pointer to a connection
-        int int_connection_;	// A flag that indicates the state of a connection
-        Oid last_oid_;			// Always stores the last OID resulted of a command
-		bool inTransaction_;
-		bool isDateInt_;		// Tells if server date format is int64 or double (IEEE754)
-
-    public:
-
-        // Constructor / Destructor
-        TePGConnection(const string& str_connection = "")
-			: pg_connection_(0), int_connection_(0), last_oid_(0), inTransaction_(false), isDateInt_(true)
-		{
-			if(!str_connection.empty())
-				open(str_connection);
-		}
-
-        virtual ~TePGConnection() { close(); }
-
-		// Basic database methods
-        bool open(const string& str_connection);
-
-        bool state(void) const { return (PQstatus(pg_connection_) == CONNECTION_OK); }
-        void close(void);
-        const char* dbname(void) const { return PQdb(pg_connection_); }
-        const char* err_msg(void) const { return PQerrorMessage(pg_connection_); }
-        PGresult* exec(const string& str_qry) { return PQexec(pg_connection_, str_qry.c_str()); }
-        int exec_cmd(const string& str_qry);
-        Oid getOID(void) const { return last_oid_; }
-		PGconn* c_ptr(void) { return pg_connection_; }
-
-		bool isDateInt() const
-		{
-			return isDateInt_;
-		}
-
-		// Utilities functions - You must destroy the return string
-		static char* escapeString(const char* from, const size_t& fromLen, size_t& newLen)
-		{
-			char *sql = new char[2 * fromLen + 1];	
-
-			newLen = PQescapeString(sql, from, fromLen);
-
-			return sql;
-		}
-
-		static void freeMem(void* ptr) 	{ PQfreemem(ptr); }
-
-		static unsigned char* escapeBytea(const unsigned char *from, size_t from_length, size_t* to_length) { return PQescapeBytea(from, from_length, to_length); }
-		
-		Oid insertBlob(char* buff, const int& blobSize);	// Returns 0 on error
-		int getBlob(const Oid& blobId, char *&buff);		// return -1 on error otherwise returns bytes read
-		bool removeBlob(const Oid& blobId) { return lo_unlink(pg_connection_, blobId) == 1; }
-
-		bool beginTransaction(void);
-		bool commitTransaction(void);
-		bool rollBackTransaction(void);
-
-		int exec_cmd_params(const char *command,
-							 int nParams,
-							 const Oid *paramTypes,
-							 const char * const *paramValues,
-							 const int *paramLengths,
-							 const int *paramFormats,
-							 int resultFormat);
-
-	protected:
-
-        // don't support copying of TePGConnection objects,
-        // so make copy constructor and assignment op private.
-        TePGConnection(const TePGConnection& c);
-        TePGConnection& operator=(const TePGConnection& c);
-};
-
-/***************************************************************************
- * Classe resposnsavel pela manipulacao de dados resultantes de uma        *
- * consulta.                                                               *
- ***************************************************************************/
-class TePGRecordset
-{
-	protected:
-
-		static const int int_bof_;
-		static int openRecordSets_;
-		static set<int> freeCursorNumbers_;
-		static TeMutex _mutexLock;
-		
-        PGresult *pg_recordset_;
-		TePGConnection* conn_;
-		bool cursorDeclared_;
-        int int_index_current_;
-        int int_eof_;
-		TeCursorType cursorType_;
-		TeCursorLocation cursorLocation_;
-		TeCursorDataType cursorDataType_;
-		int numRowsToRetrieve_;
-
-		int recordSetId_;
-		bool isLittleEndian_;
-
-		string data_;
-
-		bool movingBackward_;	// Mario
-		bool lastFetch;			// Mario
-		bool firstFetch;		// Mario
-		
-
-    public:
-
-        // Constructor / Destructor
-        TePGRecordset(const string& str_qry = string(""), TePGConnection* con_x = 0,
-			          const TeCursorType& cursorType = TeUNIDIRECTIONAL,
-				      const TeCursorLocation& cursorLocation = TeSERVERSIDE,
-				      const TeCursorDataType& cursorDataType = TeTEXTCURSOR,
-					  const int& numRowsToRetrieve = 2000);
-        virtual ~TePGRecordset();
-
-        // Basic database methods
-		void close(void);
-
-        int recordCount(void) const
-		{
-			if(pg_recordset_)
-				return PQntuples(pg_recordset_);
-			
-			return 0;
-		}
-
-		int getFieldCount(void) const	{ return PQnfields(pg_recordset_); }
-
-		bool state(void) const
-		{
-			if(pg_recordset_) 
-				return true;
-			else
-				return false;
-		}
-
-		bool eof(void) const { return int_index_current_ == int_eof_; }
-        bool bof(void) const { return int_index_current_ == int_bof_; }
-
-		bool moveFirst(void);
-        bool movePrevious(void);	
-        bool moveNext(void);		
-        bool moveLast(void);		
-        bool moveTo(const int& lin_number);	// first index == 0
-		
-		int index(void) const
-		{
-			if(!(this->bof() || this->eof()))
-				return int_index_current_;
-			
-			return -1;
-		}
-
-	    bool open(const string& str_qry, TePGConnection* con_x,
-			      const TeCursorType& cursorType = TeUNIDIRECTIONAL,
-				  const TeCursorLocation& cursorLocation = TeSERVERSIDE,
-				  const TeCursorDataType& cursorDataType = TeTEXTCURSOR,
-				  const int& numRowsToRetrieve = 2000);      
-
-		
-
-		// Functions tha apllies to columns
-		char *fieldName(const int& field_num) const { return PQfname(pg_recordset_, field_num); }
-
-        int fieldNum(const string& field_name) const
-		{
-			int num = PQfnumber(pg_recordset_, field_name.c_str());
-
-			if(num < 0)
-			{
-				std::string::size_type ip = field_name.rfind('.');
-                
-				if(ip == std::string::npos)
-					return num;
-
-				std::string::size_type len = field_name.size();
-
-				std::string fieldName = field_name.substr(ip + 1, len - ip - 1);
-
-				num = PQfnumber(pg_recordset_, fieldName.c_str());
-			}
-
-			return num;
-		}
-
-		Oid fieldType(const int& field_num) const { return PQftype(pg_recordset_, field_num); }
-        Oid fieldType(const string& field_name) const { return fieldType(fieldNum(field_name)); }
-
-		bool isNull(const int& field_num) const { return PQgetisnull(pg_recordset_, index(), field_num) == 1; }
-		bool isNull(const string& field_name) const { return isNull(fieldNum(field_name)); }
-
-		int fieldSize(const int& field_num);
-        int fieldSize(const string& field_name) { return fieldSize(fieldNum(field_name)); }
-
-        int fieldSizeFractionaryPart(const int& field_num);
-        int fieldSizeFractionaryPart(const string& field_name) {  return fieldSizeFractionaryPart(fieldNum(field_name)); }
-
-
-		// Datatype functions
-		
-		// when you use value, make sure to copy the value, otherwise, a sucessive call may destroy the pointer
-		char* value(const int& field_num) const { return PQgetvalue(pg_recordset_, int_index_current_, field_num); }
-		char* value(const string& field_name) const { return value(fieldNum(field_name)); }
-
-		int getBytea(const int& field_num, char*& buff) const;	
-		int getBytea(const string& field_name, char*& buff) const { return getBytea(fieldNum(field_name), buff); }
-		
-		int getInt(const int& field_num) const
-		{
-			if(cursorDataType_ == TeTEXTCURSOR) 
-				return atol(value(field_num));
-			else
-			{
-				if(fieldType(field_num) == PG_INT8_TYPE)
-				{
-					return getInt8(field_num);
-				}
-				else
-				{
-					unsigned int number;
-
-					memcpy(&number, value(field_num), sizeof(int));
-
-					if(isLittleEndian_)
-						number = ntohl(number);
-
-					return number;
-				}
-			}
-		}
-
-		int getInt(const string& field_name) const { return getInt(fieldNum(field_name)); }
-
-		int getInt8(const int& field_num) const ;
-		int getInt8(const string& field_name) const { return getInt8(fieldNum(field_name)); }
-
-		bool getBool(const int& field_num) const
-		{
-			if(cursorDataType_ == TeTEXTCURSOR) 
-			{
-				string t = "t";
-
-				return (t == value(field_num));
-			}
-			else
-			{
-				unsigned char v = value(field_num)[0];
-				int v1 = v;
-				return v1 != 0;		
-			}
-		}
-
-		bool getBool(const string& field_name) const { return getBool(fieldNum(field_name)); }
-
-		double getDouble(const int& field_num) const
-		{
-			if(cursorDataType_ == TeTEXTCURSOR) 
-				return atof(value(field_num));
-			else
-			{
-				union
-				{
-					double dWord_;
-					unsigned int aux_[2];
-				} swapDouble1, swapDouble2;
-
-
-				// endianness test
-				if(isLittleEndian_)
-				{
-					// little-endian!
-					memcpy(&swapDouble1.dWord_, value(field_num), sizeof(double));
-
-					swapDouble2.aux_[1] = ntohl(swapDouble1.aux_[0]);
-					swapDouble2.aux_[0] = ntohl(swapDouble1.aux_[1]);
-
-					return swapDouble2.dWord_;
-				}
-				else
-				{
-					// big-endian!
-					memcpy(&swapDouble1.dWord_, value(field_num), sizeof(double));
-
-					swapDouble2.aux_[0] = ntohl(swapDouble1.aux_[0]);
-					swapDouble2.aux_[1] = ntohl(swapDouble1.aux_[1]);
-
-					return swapDouble2.dWord_;
-				}
-					
-			}
-		}
-
-		double getDouble(const string& field_name) const { return getDouble(fieldNum(field_name)); }
-
-		string getDate(const int& field_num) const;
-		string getDate(const string& field_name) const { return getDate(fieldNum(field_name)); }
-
-		string getTime(const int& field_num);
-		string getTime(const string& field_name) { return getTime(fieldNum(field_name)); }
-
-		string getTimeStamp(const int& field_num);
-		string getTimeStamp(const string& field_name) { return getTimeStamp(fieldNum(field_name)); }
-
-
-
-		char* getData(const int& field_num);
-		char* getData(const string& field_name) { return getData(fieldNum(field_name)); }
-
-		// TerraLib Geometric Types
-		void getByteALine2D(const int& field_num, TeLine2D& l) const;
-		void getByteALine2D(const string& field_name, TeLine2D& l) const { getByteALine2D(fieldNum(field_name), l); }
-
-		// PostgreSQL Geometric types
-		void getPGBox(const int& field_num, TeBox& b) const;
-		void getPGBox(const string& field_name, TeBox& b) const { getPGBox(fieldNum(field_name), b); }
-
-		void getPGLine2D(const int& field_num, TeLine2D& l) const;
-		void getPGLine2D(const string& field_name, TeLine2D& l) const { getPGLine2D(fieldNum(field_name), l); }
-
-		// PostGIS Methods
-		void getPGISPoint(const int& field_num, TePoint& p) const;
-		void getPGISPoint(const string& field_name, TePoint& p) const { getPGISPoint(fieldNum(field_name), p); }
-
-		void getPGISLine(const int& field_num, TeLine2D& l) const;
-		void getPGISLine(const string& field_name, TeLine2D& l) const { getPGISLine(fieldNum(field_name), l); }
-
-		void getPGISPolygon(const int& field_num, TePolygon& p) const;
-		void getPGISPolygon(const string& field_name, TePolygon& p) const { getPGISPolygon(fieldNum(field_name), p); }
-
-		void getPGISMultiPoint(const int& field_num, TePointSet& ps) const;
-		void getPGISMultiPoint(const string& field_name, TePointSet& ps) const { getPGISMultiPoint(fieldNum(field_name), ps); }
-
-		void getPGISMultiLine(const int& field_num, TeLineSet& ls) const;
-		void getPGISMultiLine(const string& field_name, TeLineSet& ls) const { getPGISMultiLine(fieldNum(field_name), ls); }
-
-		void getPGISMultiPolygon(const int& field_num, TePolygonSet& ps) const;
-		void getPGISMultiPolygon(const string& field_name, TePolygonSet& ps) const { getPGISMultiPolygon(fieldNum(field_name), ps); }
-
-		void getPGISGeomColl(const int& field_num, TeMultiGeometry& m) const;
-		void getPGISGeomColl(const string& field_name, TeMultiGeometry& m) const { getPGISGeomColl(fieldNum(field_name), m); }
-
-	protected:
-
-        // don't support copying of TePGRecordset objects,
-        // so make copy constructor and assignment op private.
-        TePGRecordset(const TePGRecordset& c);
-        TePGRecordset& operator=(const TePGRecordset& c);
-
-		static int getFreeCursor()
-		{
-			_mutexLock.lock();
-
-			int freeId = 0;
-			if(freeCursorNumbers_.empty())
-			{	// Se n�o houver cursores livres aberto => criar novo id
-				++openRecordSets_;
-				freeId = openRecordSets_;
-			}
-			else
-			{
-				set<int>::iterator it = freeCursorNumbers_.begin();
-				freeId = *it;
-				freeCursorNumbers_.erase(it);
-			}
-
-			_mutexLock.unLock();
-
-			return freeId;
-		}
-		static void releaseCursor(const int& idToRelease)
-		{
-			_mutexLock.lock();
-			freeCursorNumbers_.insert(idToRelease);
-			_mutexLock.unLock();
-		}
-
-		void freeRecordSet();
-
-		char* getWKBHeader(char* v, unsigned char &byteOrder, unsigned int& wkbType, unsigned int &numGeometries) const;
-
-		char* getWKBPoint(char* v, TeCoord2D& c) const;
-		char* getWKBLine(char* v, TeLine2D& l) const;
-		char* getWKBPolygon(char* v, TePolygon& p) const;
-
-		char* getWKBMultiPoint(char* v, TePointSet &ps) const;
-		char* getWKBMultiLine(char* v, TeLineSet &ls) const;
-		char* getWKBMultiPolygon(char* v, TePolygonSet &ps) const;
-
-		void getWKBGeomColl(char* v, TeMultiGeometry &mg) const;
-
-		
-
-		char* getWKBLinearRing(char* v, int byteOrder, TeLine2D &line) const;
-};
-
-char* TeLine2DToPGBinary(const TeLine2D &line, unsigned int &size);
-char* TeBoxToPGBinary(const TeBox &box, unsigned int &size);
-
-char* TePointToWKBPoint(const TePoint &point, unsigned int &size);
-char* TeLine2DToWKBLineString(const TeLine2D &line, unsigned int &size);
-char* TePolygonToWKBPolygon(const TePolygon &polygon, unsigned int &size);
-
-double TeConvertToBigEndian(const double &value);
-
-
-#endif	//  __TERRALIB_INTERNAL_PGINTERFACE_H
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TePGInterface.h
+    \brief This file contains a database recordset and connection class to PostgreSQL.
+	\author Gilberto Ribeiro de Queiroz - gribeiro at dpi.inpe.br
+ */
+
+
+#ifndef  __TERRALIB_INTERNAL_PGINTERFACE_H
+#define  __TERRALIB_INTERNAL_PGINTERFACE_H
+ 
+/**
+  * TODO: 1. O caminhamento para tras esta na ordem errada.
+  *       2. A funcao getData devera ser completada para tipos diferentes da TerraLib
+  *
+  */
+//extern "C"
+//{
+#include "libpq-fe.h"
+//}
+
+#ifdef WIN32
+#include <winsock.h>
+#else
+#include <netinet/in.h>
+#endif
+
+
+#include <stdlib.h>
+#include <string>
+#include <cstring>
+
+#include "TeDatabase.h"
+#include "TeMultiGeometry.h"
+#include <TeMutex.h>
+
+#include "TePostgreSQLDefines.h"
+
+using namespace std;
+
+/***************************************************************************
+ * Constantes numericas dos tipos de dados do PostgreSQL                   * 
+ ***************************************************************************/
+const Oid PG_BOOL_TYPE = 16;
+const Oid PG_BYTEA_TYPE = 17;
+const Oid PG_CHAR_TYPE = 18;
+const Oid PG_NAME_TYPE = 19;
+const Oid PG_INT8_TYPE = 20;
+const Oid PG_INT2_TYPE = 21;
+const Oid PG_INT4_TYPE = 23;
+const Oid PG_TEXT_TYPE = 25;
+const Oid PG_OID_TYPE = 26;
+const Oid PG_POINT_TYPE = 600;
+const Oid PG_LSEG_TYPE = 601;
+const Oid PG_PATH_TYPE = 602;
+const Oid PG_BOX_TYPE = 603;
+const Oid PG_POLYGON_TYPE = 604;
+const Oid PG_LINE_TYPE = 628;
+const Oid PG_PG_FLOAT4_TYPE = 700;
+const Oid PG_FLOAT8_TYPE = 701;
+const Oid PG_CIRCLE_TYPE = 718;
+const Oid PG_MONEY_TYPE = 790;
+const Oid PG_BPCHAR_TYPE = 1042;
+const Oid PG_VARCHAR_TYPE = 1043;
+const Oid PG_DATE_TYPE = 1082;
+const Oid PG_TIME_TYPE = 1083;
+const Oid PG_TIMESTAMP_TYPE = 1114;
+const Oid PG_TIMESTAMPTZ_TYPE = 1184;
+const Oid PG_INTERVAL_TYPE = 1186;
+const Oid PG_TIMETZ_TYPE = 1266;
+const Oid PG_BIT_TYPE = 1560;
+const Oid PG_VARBIT_TYPE = 1562;
+const Oid PG_NUMERIC_TYPE = 1700;			
+
+
+
+/***************************************************************************
+ * Classe responsavel pela abertura e fechamento de uma conexao com o      *
+ * banco de dados. Alem de abrir e fechar uma conexao, permite que uma     *
+ * consulta seja executada, retornando um conjunto de registros, ou que um *
+ * comando - insert, update, delete - seja executado diretamente,          *
+ * retornando o numero de registros afetados pelo comando.                 *
+ ***************************************************************************/
+class TLPOSTGRESQL_DLL TePGConnection
+{
+    protected:
+
+        PGconn *pg_connection_;	// A pointer to a connection
+        int int_connection_;	// A flag that indicates the state of a connection
+        Oid last_oid_;			// Always stores the last OID resulted of a command
+		bool inTransaction_;
+		bool isDateInt_;		// Tells if server date format is int64 or double (IEEE754)
+
+    public:
+
+        // Constructor / Destructor
+        TePGConnection(const string& str_connection = "")
+			: pg_connection_(0), int_connection_(0), last_oid_(0), inTransaction_(false), isDateInt_(true)
+		{
+			if(!str_connection.empty())
+				open(str_connection);
+		}
+
+        virtual ~TePGConnection() { close(); }
+
+		// Basic database methods
+        bool open(const string& str_connection);
+
+		bool open(PGconn* conn);
+
+        bool state(void) const { return (PQstatus(pg_connection_) == CONNECTION_OK); }
+        void close(void);
+        const char* dbname(void) const { return PQdb(pg_connection_); }
+        const char* err_msg(void) const { return PQerrorMessage(pg_connection_); }
+        PGresult* exec(const string& str_qry) { return PQexec(pg_connection_, str_qry.c_str()); }
+        int exec_cmd(const string& str_qry);
+        Oid getOID(void) const { return last_oid_; }
+		PGconn* c_ptr(void) { return pg_connection_; }
+
+		bool isDateInt() const
+		{
+			return isDateInt_;
+		}
+
+		// Utilities functions - You must destroy the return string
+		static char* escapeString(const char* from, const size_t& fromLen, size_t& newLen)
+		{
+			char *sql = new char[2 * fromLen + 1];	
+
+			newLen = PQescapeString(sql, from, fromLen);
+
+			return sql;
+		}
+
+		static void freeMem(void* ptr) 	{ PQfreemem(ptr); }
+
+		static unsigned char* escapeBytea(const unsigned char *from, size_t from_length, size_t* to_length) { return PQescapeBytea(from, from_length, to_length); }
+		
+		Oid insertBlob(char* buff, const int& blobSize);	// Returns 0 on error
+		int getBlob(const Oid& blobId, char *&buff);		// return -1 on error otherwise returns bytes read
+		bool removeBlob(const Oid& blobId) { return lo_unlink(pg_connection_, blobId) == 1; }
+
+		bool beginTransaction(void);
+		bool commitTransaction(void);
+		bool rollBackTransaction(void);
+
+		int exec_cmd_params(const char *command,
+							 int nParams,
+							 const Oid *paramTypes,
+							 const char * const *paramValues,
+							 const int *paramLengths,
+							 const int *paramFormats,
+							 int resultFormat);
+
+		std::string getClientEncoding();
+
+	protected:
+
+        // don't support copying of TePGConnection objects,
+        // so make copy constructor and assignment op private.
+        TePGConnection(const TePGConnection& c);
+        TePGConnection& operator=(const TePGConnection& c);
+};
+
+/***************************************************************************
+ * Classe resposnsavel pela manipulacao de dados resultantes de uma        *
+ * consulta.                                                               *
+ ***************************************************************************/
+class TLPOSTGRESQL_DLL TePGRecordset
+{
+	protected:
+
+		static const int int_bof_;
+		static int openRecordSets_;
+		static set<int> freeCursorNumbers_;
+		static TeMutex _mutexLock;
+		
+        PGresult *pg_recordset_;
+		TePGConnection* conn_;
+		bool cursorDeclared_;
+        int int_index_current_;
+        int int_eof_;
+		TeCursorType cursorType_;
+		TeCursorLocation cursorLocation_;
+		TeCursorDataType cursorDataType_;
+		int numRowsToRetrieve_;
+
+		int recordSetId_;
+		bool isLittleEndian_;
+
+		string data_;
+
+		bool movingBackward_;	// Mario
+		bool lastFetch;			// Mario
+		bool firstFetch;		// Mario
+		
+
+    public:
+
+        // Constructor / Destructor
+        TePGRecordset(const string& str_qry = string(""), TePGConnection* con_x = 0,
+			          const TeCursorType& cursorType = TeUNIDIRECTIONAL,
+				      const TeCursorLocation& cursorLocation = TeSERVERSIDE,
+				      const TeCursorDataType& cursorDataType = TeTEXTCURSOR,
+					  const int& numRowsToRetrieve = 2000);
+        virtual ~TePGRecordset();
+
+        // Basic database methods
+		void close(void);
+
+        int recordCount(void) const
+		{
+			if(pg_recordset_)
+				return PQntuples(pg_recordset_);
+			
+			return 0;
+		}
+
+		int getFieldCount(void) const	{ return PQnfields(pg_recordset_); }
+
+		bool state(void) const
+		{
+			if(pg_recordset_) 
+				return true;
+			else
+				return false;
+		}
+
+		bool eof(void) const { return int_index_current_ == int_eof_; }
+        bool bof(void) const { return int_index_current_ == int_bof_; }
+
+		bool moveFirst(void);
+        bool movePrevious(void);	
+        bool moveNext(void);		
+        bool moveLast(void);		
+        bool moveTo(const int& lin_number);	// first index == 0
+		
+		int index(void) const
+		{
+			if(!(this->bof() || this->eof()))
+				return int_index_current_;
+			
+			return -1;
+		}
+
+	    bool open(const string& str_qry, TePGConnection* con_x,
+			      const TeCursorType& cursorType = TeUNIDIRECTIONAL,
+				  const TeCursorLocation& cursorLocation = TeSERVERSIDE,
+				  const TeCursorDataType& cursorDataType = TeTEXTCURSOR,
+				  const int& numRowsToRetrieve = 2000);      
+
+		
+
+		// Functions tha apllies to columns
+		char *fieldName(const int& field_num) const { return PQfname(pg_recordset_, field_num); }
+
+        int fieldNum(const string& field_name) const
+		{
+			int num = PQfnumber(pg_recordset_, field_name.c_str());
+
+			if(num < 0)
+			{
+				std::string::size_type ip = field_name.rfind('.');
+                
+				if(ip == std::string::npos)
+					return num;
+
+				std::string::size_type len = field_name.size();
+
+				std::string fieldName = field_name.substr(ip + 1, len - ip - 1);
+
+				num = PQfnumber(pg_recordset_, fieldName.c_str());
+			}
+
+			return num;
+		}
+
+		Oid fieldType(const int& field_num) const { return PQftype(pg_recordset_, field_num); }
+        Oid fieldType(const string& field_name) const { return fieldType(fieldNum(field_name)); }
+
+		bool isNull(const int& field_num) const { return PQgetisnull(pg_recordset_, index(), field_num) == 1; }
+		bool isNull(const string& field_name) const { return isNull(fieldNum(field_name)); }
+
+		int fieldSize(const int& field_num);
+        int fieldSize(const string& field_name) { return fieldSize(fieldNum(field_name)); }
+
+        int fieldSizeFractionaryPart(const int& field_num);
+        int fieldSizeFractionaryPart(const string& field_name) {  return fieldSizeFractionaryPart(fieldNum(field_name)); }
+
+
+		// Datatype functions
+		
+		// when you use value, make sure to copy the value, otherwise, a sucessive call may destroy the pointer
+		char* value(const int& field_num) const { return PQgetvalue(pg_recordset_, int_index_current_, field_num); }
+		char* value(const string& field_name) const { return value(fieldNum(field_name)); }
+
+		int getBytea(const int& field_num, char*& buff) const;	
+		int getBytea(const string& field_name, char*& buff) const { return getBytea(fieldNum(field_name), buff); }
+		
+		int getInt(const int& field_num) const
+		{
+			if(cursorDataType_ == TeTEXTCURSOR) 
+				return atol(value(field_num));
+			else
+			{
+				if(fieldType(field_num) == PG_INT8_TYPE)
+				{
+					return getInt8(field_num);
+				}
+				else
+				{
+					unsigned int number;
+
+					memcpy(&number, value(field_num), sizeof(int));
+
+					if(isLittleEndian_)
+						number = ntohl(number);
+
+					return number;
+				}
+			}
+		}
+
+		int getInt(const string& field_name) const { return getInt(fieldNum(field_name)); }
+
+		int getInt8(const int& field_num) const ;
+		int getInt8(const string& field_name) const { return getInt8(fieldNum(field_name)); }
+
+		bool getBool(const int& field_num) const
+		{
+			if(cursorDataType_ == TeTEXTCURSOR) 
+			{
+				string t = "t";
+
+				return (t == value(field_num));
+			}
+			else
+			{
+				unsigned char v = value(field_num)[0];
+				int v1 = v;
+				return v1 != 0;		
+			}
+		}
+
+		bool getBool(const string& field_name) const { return getBool(fieldNum(field_name)); }
+
+		double getDouble(const int& field_num) const
+		{
+			if(cursorDataType_ == TeTEXTCURSOR) 
+				return atof(value(field_num));
+			else
+			{
+				union
+				{
+					double dWord_;
+					unsigned int aux_[2];
+				} swapDouble1, swapDouble2;
+
+
+				// endianness test
+				if(isLittleEndian_)
+				{
+					// little-endian!
+					memcpy(&swapDouble1.dWord_, value(field_num), sizeof(double));
+
+					swapDouble2.aux_[1] = ntohl(swapDouble1.aux_[0]);
+					swapDouble2.aux_[0] = ntohl(swapDouble1.aux_[1]);
+
+					return swapDouble2.dWord_;
+				}
+				else
+				{
+					// big-endian!
+					memcpy(&swapDouble1.dWord_, value(field_num), sizeof(double));
+
+					swapDouble2.aux_[0] = ntohl(swapDouble1.aux_[0]);
+					swapDouble2.aux_[1] = ntohl(swapDouble1.aux_[1]);
+
+					return swapDouble2.dWord_;
+				}
+					
+			}
+		}
+
+		double getDouble(const string& field_name) const { return getDouble(fieldNum(field_name)); }
+
+		string getDate(const int& field_num) const;
+		string getDate(const string& field_name) const { return getDate(fieldNum(field_name)); }
+
+		string getTime(const int& field_num);
+		string getTime(const string& field_name) { return getTime(fieldNum(field_name)); }
+
+		string getTimeStamp(const int& field_num);
+		string getTimeStamp(const string& field_name) { return getTimeStamp(fieldNum(field_name)); }
+
+
+
+		char* getData(const int& field_num);
+		char* getData(const string& field_name) { return getData(fieldNum(field_name)); }
+
+		// TerraLib Geometric Types
+		void getByteALine2D(const int& field_num, TeLine2D& l) const;
+		void getByteALine2D(const string& field_name, TeLine2D& l) const { getByteALine2D(fieldNum(field_name), l); }
+
+		// PostgreSQL Geometric types
+		void getPGBox(const int& field_num, TeBox& b) const;
+		void getPGBox(const string& field_name, TeBox& b) const { getPGBox(fieldNum(field_name), b); }
+
+		void getPGLine2D(const int& field_num, TeLine2D& l) const;
+		void getPGLine2D(const string& field_name, TeLine2D& l) const { getPGLine2D(fieldNum(field_name), l); }
+
+		// PostGIS Methods
+		void getPGISPoint(const int& field_num, TePoint& p) const;
+		void getPGISPoint(const string& field_name, TePoint& p) const { getPGISPoint(fieldNum(field_name), p); }
+
+		void getPGISLine(const int& field_num, TeLine2D& l) const;
+		void getPGISLine(const string& field_name, TeLine2D& l) const { getPGISLine(fieldNum(field_name), l); }
+
+		void getPGISPolygon(const int& field_num, TePolygon& p) const;
+		void getPGISPolygon(const string& field_name, TePolygon& p) const { getPGISPolygon(fieldNum(field_name), p); }
+
+		void getPGISMultiPoint(const int& field_num, TePointSet& ps) const;
+		void getPGISMultiPoint(const string& field_name, TePointSet& ps) const { getPGISMultiPoint(fieldNum(field_name), ps); }
+
+		void getPGISMultiLine(const int& field_num, TeLineSet& ls) const;
+		void getPGISMultiLine(const string& field_name, TeLineSet& ls) const { getPGISMultiLine(fieldNum(field_name), ls); }
+
+		void getPGISMultiPolygon(const int& field_num, TePolygonSet& ps) const;
+		void getPGISMultiPolygon(const string& field_name, TePolygonSet& ps) const { getPGISMultiPolygon(fieldNum(field_name), ps); }
+
+		void getPGISGeomColl(const int& field_num, TeMultiGeometry& m) const;
+		void getPGISGeomColl(const string& field_name, TeMultiGeometry& m) const { getPGISGeomColl(fieldNum(field_name), m); }
+
+	protected:
+
+        // don't support copying of TePGRecordset objects,
+        // so make copy constructor and assignment op private.
+        TePGRecordset(const TePGRecordset& c);
+        TePGRecordset& operator=(const TePGRecordset& c);
+
+		static int getFreeCursor()
+		{
+			_mutexLock.lock();
+
+			int freeId = 0;
+			if(freeCursorNumbers_.empty())
+			{	// Se n�o houver cursores livres aberto => criar novo id
+				++openRecordSets_;
+				freeId = openRecordSets_;
+			}
+			else
+			{
+				set<int>::iterator it = freeCursorNumbers_.begin();
+				freeId = *it;
+				freeCursorNumbers_.erase(it);
+			}
+
+			_mutexLock.unLock();
+
+			return freeId;
+		}
+		static void releaseCursor(const int& idToRelease)
+		{
+			_mutexLock.lock();
+			freeCursorNumbers_.insert(idToRelease);
+			_mutexLock.unLock();
+		}
+
+		void freeRecordSet();
+
+		char* getWKBHeader(char* v, unsigned char &byteOrder, unsigned int& wkbType, unsigned int &numGeometries) const;
+
+		char* getWKBPoint(char* v, TeCoord2D& c) const;
+		char* getWKBLine(char* v, TeLine2D& l) const;
+		char* getWKBPolygon(char* v, TePolygon& p) const;
+
+		char* getWKBMultiPoint(char* v, TePointSet &ps) const;
+		char* getWKBMultiLine(char* v, TeLineSet &ls) const;
+		char* getWKBMultiPolygon(char* v, TePolygonSet &ps) const;
+
+		void getWKBGeomColl(char* v, TeMultiGeometry &mg) const;
+
+		
+
+		char* getWKBLinearRing(char* v, int byteOrder, TeLine2D &line) const;
+};
+
+TLPOSTGRESQL_DLL char* TeLine2DToPGBinary(const TeLine2D &line, unsigned int &size);
+TLPOSTGRESQL_DLL char* TeBoxToPGBinary(const TeBox &box, unsigned int &size);
+
+TLPOSTGRESQL_DLL char* TePointToWKBPoint(const TePoint &point, unsigned int &size);
+TLPOSTGRESQL_DLL char* TeLine2DToWKBLineString(const TeLine2D &line, unsigned int &size);
+TLPOSTGRESQL_DLL char* TePolygonToWKBPolygon(const TePolygon &polygon, unsigned int &size);
+
+TLPOSTGRESQL_DLL double TeConvertToBigEndian(const double &value);
+
+
+#endif	//  __TERRALIB_INTERNAL_PGINTERFACE_H
diff --git a/src/terralib/drivers/PostgreSQL/TePGUtils.cpp b/src/terralib/drivers/PostgreSQL/TePGUtils.cpp
old mode 100755
new mode 100644
index 7f00fa9..e3550b3
--- a/src/terralib/drivers/PostgreSQL/TePGUtils.cpp
+++ b/src/terralib/drivers/PostgreSQL/TePGUtils.cpp
@@ -1,590 +1,590 @@
-#include "TePGUtils.h"
-#include <stdexcept>
-
-using namespace std;
-
-TeCoord2D PgGeomPolygonCoordDecode(char *str, char* *s)
-{
-
-	char *cp;	// I use this pointer to get the pointer address
-                // that strtod store in the second parameter.
-                // It is used to know if the conversion of a string
-                // to double ocurried normally
-
-	if(!str)
-		throw runtime_error("Invalid Coordinate!");
-
-	// SKIP WHITE SPACES
-	while(isspace((unsigned char)*str))
-		++str;
-
-	// SKIP THE FIRST '(' an go to number begin
-	if(*str != '(')
-			throw runtime_error("Invalid Coordinate!");
-
-	++str;
-
-	while(isspace((unsigned char)*str))
-		++str;
-
-	double x = strtod(str, &cp);
-
-	if(cp <= str)								// If no conversion or there aren't more characters
-		throw runtime_error("Invalid format!");	// Error, because the coord y will not be extracted
-												// Otherwise, cp will point to the next caracter, that begin the list conversion of coord y
-
-	// SKIP WHITE SPACES AFTER X COORDINATE AND JUMP ',' AND WHITE SPACES
-	while(isspace((unsigned char) *cp))
-		++cp;
-
-	if(*cp != ',')
-			throw runtime_error("Invalid Coordinate!");
-
-	++cp;
-
-	while(isspace((unsigned char) *cp))
-		++cp;
-
-	double y = strtod(cp, &str);
-	
-	if(str <= cp)
-		throw runtime_error("Invalid format!");
-
-	while(isspace((unsigned char) *str))
-		++str;
-
-	if(*str != ')')
-			throw runtime_error("Invalid Coordinate!");
-
-	++str;
-
-	while(isspace((unsigned char) *str))
-		++str;
-
-	if(s != 0)
-		*s = str;
-
-	return TeCoord2D(x, y);
-}
-
-void Te2PgGeomPolygon(const TeLine2D& l, string& strPolygon)
-{
-	strPolygon = "(";
-
-	unsigned int nVertex = l.size();
-	for(unsigned int i = 0u; i < nVertex; ++i)
-	{
-		if(i != 0u)
-			strPolygon += ",";
-
-		 strPolygon += Te2String(l[i].x_, 15);
-		 strPolygon += ",";
-		 strPolygon += Te2String(l[i].y_, 15);
-	}
-
-	strPolygon += ")";
-
-	return;
-}
-
-TeLine2D PgGeomPolygon2Te(char* strPolygon)
-{
-	char *s = strPolygon;
-
-	while(isspace((unsigned char) *s))
-		++s;
-
-	if(*s != LDELIM_PGGEOMPOLYGON)
-		throw runtime_error("Invalid line format!");
-
-	++s;
-
-	TeLine2D l;
-
-	while(true)
-	{
-		TeCoord2D coord = PgGeomPolygonCoordDecode(s, &s);
-		l.add(coord);	
-
-		if(*s == PGGEOMPOLYGON_COORDS_DELIM)
-			++s;
-		else
-			if(*s == RDELIM_PGGEOMPOLYGON)
-			{
-				++s;
-				break;
-			}
-	}
-
-    while(isspace((unsigned char) *s))
-		++s;
-
-	if((*s != '\0'))
-		throw runtime_error("Invalid line format!");
-
-	return l;
-}
-
-
-
-
-
-/*
- * Codificadores e decodificadores PostGIS
- *
- */
-
-TeCoord2D PGCoord_decode(char *str, char* *s)
-{
-	char *cp;	// I use this pointer to get the pointer address
-                // that strtod store in the second parameter.
-                // It is used to know if the conversion of a string
-                // to double ocurried normally
-
-	if(!str)
-		throw runtime_error("Invalid Coordinate!");
-
-	while(isspace((unsigned char)*str))
-		++str;	
-
-	double x = strtod(str, &cp);
-
-	if(cp <= str)								// If no conversion or there aren't more characters
-		throw runtime_error("Invalid format!");	// Error, because the coord y will not be extracted
-												// Otherwise, cp will point to the next caracter, that begin the list conversion of coord y
-
-	while(isspace((unsigned char) *cp))
-		++cp;	
-
-	double y = strtod(cp, &str);
-	
-	if(str <= cp)
-		throw runtime_error("Invalid format!");
-
-	while(isspace((unsigned char) *str))
-		++str;	
-
-	if(s != 0)
-		*s = str;
-
-	return TeCoord2D(x, y);
-}
-
-string PGCoord_encode(const TeCoord2D& c)
-{
-	string str_p  = Te2String(c.x(), 15);
-		   str_p += " ";
-		   str_p += Te2String(c.y(), 15);
-
-	return str_p;
-}
-
-TePoint PGPoint_decode(char *str)
-{
-	if(!str)
-		throw runtime_error("Invalid point format!");
-		
-	char *s;
-
-	while(*str != ';')
-		 ++str;
-
-	if(*str == ';')
-		++str;
-
-	while(isspace((unsigned char) *str))
-		 ++str;
-
-	str+=6;	// Jump text "POINT(" and go to number.
-
-	TeCoord2D c = PGCoord_decode(str, &s);
-
-	if(*s != ')')
-		throw logic_error("Invalid point format!");
-
-	TePoint p;
-	
-	p.add(c);
-
-	return p;
-}
-
-string PGPoint_encode(const TePoint& p)
-{
-	string result  = "POINT(";
-		   result += PGCoord_encode(p.location());
-		   result += ")";
-
-	return result;
-}
-
-string PGNode_encode(const TeNode& p)
-{
-	string result  = "POINT(";
-		   result += PGCoord_encode(p.location());
-		   result += ")";
-
-	return result;
-}
-
-TeLine2D PGLine_decode(char *str, char* *sd)
-{
-	char *s;
-
-	s = str;
-
-	while(isspace((unsigned char) *s))
-		++s;
-
-	if(*s != LDELIM_LINESTRING)
-		throw runtime_error("Invalid line format!");
-
-	++s;
-
-	TeLine2D l;
-
-	double	xmin, ymin, xmax, ymax;
-
-	xmin = ymin = +TeMAXFLOAT;
-	xmax = ymax = -TeMAXFLOAT;
-
-	while(true)
-	{
-		TeCoord2D coord = PGCoord_decode(s, &s);
-		l.add(coord);
-
-		if(xmin > coord.x())
-			xmin = coord.x();
-
-		if(xmax < coord.x())
-			xmax = coord.x();
-		
-		if(ymin > coord.y())
-			ymin = coord.y();
-		
-		if(ymax < coord.y())
-			ymax = coord.y();
-
-		if(*s == COORDS_DELIM)
-			++s;
-		else
-			if(*s == RDELIM_LINESTRING)
-			{
-				++s;
-				break;
-			}
-	}
-
-    while(isspace((unsigned char) *s))
-		++s;
-
-	if((*s != '\0') && (*s != RDELIM_LINESTRING) && (*s != LINES_DELIM))
-		throw runtime_error("Invalid line format!");
-
-	l.setBox(TeBox(xmin, ymin, xmax, ymax));
-
-	*sd = s;
-
-	return l;
-}
-
-TeLine2D PGLinestring_decode(char *str)
-{
-	if(!str)
-		throw runtime_error("Invalid point format!");
-		
-	char *s;
-
-	s = str;
-
-	while(*s != ';')
-		 ++s;
-
-	if(*s == ';')
-		++s;
-
-	while(isspace((unsigned char) *s))
-		 ++s;
-
-	s += 10;	// Jump text "LINESTRING(" and go to number.
-
-	return PGLine_decode(s, &s);
-}
-
-TePolygon PGPolygon_decode(char *str)
-{
-	if(!str)
-		throw runtime_error("Invalid polygon format!");
-		
-	char *s;
-
-	while(*str != ';')
-		++str;
-
-	if(*str == ';')
-		++str;
-
-	while(isspace((unsigned char) *str))
-		 ++str;
-
-	str += 8;	// Jump text "POLYGON(" and go to first line.
-
-
-	s = str;
-
-	TePolygon pol;
-	while(true)
-	{
-		TeLine2D l = PGLine_decode(s, &s);
-		TeLinearRing r(l);
-		pol.add(r);
-
-		if(*s == COORDS_DELIM)
-			++s;
-		else
-			if(*s == RDELIM_LINESTRING)
-			{
-				++s;
-				break;
-			}
-	}
-
-	while(isspace((unsigned char) *s))
-		++s;
-
-	if(*s != '\0')
-		throw runtime_error("Invalid polygon format!");
-
-	pol.setBox(pol[0].box());
-
-	return pol;
-}
-
-TeBox PGBox_decode(char *str)
-{
-	 char *s;
-
-	 s = str;
-
-	 while(isspace((unsigned char) *s))
-		 ++s;
-
-	 s+=6;
-	 
-	 TeCoord2D coord1 = PGCoord_decode(s, &s);
-
-	 while(*s != ',')
-		 ++s;
-
-	 ++s;
-	 
-	 //if(*s != COORDS_DELIM)
-	 //	throw runtime_error("Invalid box format!");
-
-	 //++s;
-
-	 TeCoord2D coord2 = PGCoord_decode(s, &s);
-
-     //if(*s != RDELIM_BOX)
-	 //	throw runtime_error("Invalid box format!");
-	
-	 //++s;
-
-	 //while(isspace((unsigned char) *s))
-	 //	 ++s;
-
-	 //if(*s != '\0')
-	 //	 throw runtime_error("Invalid box format!");
-
-	 return TeBox(coord1, coord2);
-}
-
-string PGBox_encode(TeBox& b)
-{
-	string str_b = "BOX3D(";
-	       str_b += PGCoord_encode(b.upperRight());
-           str_b += ",";
-		   str_b += PGCoord_encode(b.lowerLeft());
-           str_b += ")";
-
-	return str_b;
-}
-
-TeBox PGBoxRtree_decode(char *str)
-{
-	char *cp;	// I use this pointer to get the pointer address
-                // that strtod store in the second parameter.
-                // It is used to know if the conversion of a string
-                // to double ocurried normally
-
-	if(!str)
-		throw runtime_error("Invalid Coordinate!");
-
-	// SKIP WHITE SPACES
-	while(isspace((unsigned char)*str))
-		++str;
-
-	// SKIP THE FIRST '(' an go to number begin
-	if(*str != '(')
-			throw runtime_error("Invalid Box!");
-
-	++str;
-
-	while(isspace((unsigned char)*str))
-		++str;
-
-	double x2 = strtod(str, &cp);
-
-	if(cp <= str)								// If no conversion or there aren't more characters
-		throw runtime_error("Invalid format!");	// Error, because the coord y will not be extracted
-												// Otherwise, cp will point to the next caracter, that begin the list conversion of coord y
-
-	// SKIP WHITE SPACES AFTER X1 COORDINATE AND JUMP ',' AND WHITE SPACES
-	while(isspace((unsigned char) *cp))
-		++cp;
-
-	if(*cp != ',')
-			throw runtime_error("Invalid Box!");
-
-	++cp;
-
-	while(isspace((unsigned char) *cp))
-		++cp;
-
-	double y2 = strtod(cp, &str);
-	
-	if(str <= cp)
-		throw runtime_error("Invalid format!");
-
-	// SKIP WHITE SPACES AFTER Y1 COORDINATE AND JUMP ',' AND WHITE SPACES
-	while(isspace((unsigned char) *str))
-		++str;
-
-	if(*str != ')')
-		throw runtime_error("Invalid Box!");
-
-	++str;
-
-	while(isspace((unsigned char) *str))
-		++str;
-
-	if(*str != ',')
-		throw runtime_error("Invalid Box!");
-
-	++str;
-
-	while(isspace((unsigned char) *str))
-		++str;
-
-	if(*str != '(')
-		throw runtime_error("Invalid Box!");
-
-	++str;
-
-	while(isspace((unsigned char) *str))
-		++str;
-
-	double x1 = strtod(str, &cp);
-	
-	if(cp <= str)
-		throw runtime_error("Invalid format!");
-
-	// SKIP WHITE SPACES AFTER x2 COORDINATE AND JUMP ',' AND WHITE SPACES
-	while(isspace((unsigned char) *cp))
-		++cp;
-
-	if(*cp != ',')
-			throw runtime_error("Invalid Box!");
-
-	++cp;
-
-	while(isspace((unsigned char) *cp))
-		++cp;
-
-	double y1 = strtod(cp, &str);
-	
-	if(str <= cp)
-		throw runtime_error("Invalid format!");
-
-	while(isspace((unsigned char) *str))
-		++str;
-
-	if(*str != ')')
-		throw runtime_error("Invalid Box!");
-
-	return TeBox(x1, y1, x2, y2);
-}
-
-string PGBoxRtree_encode(const TeBox& b)
-{
-	string str_b  = "(";
-	       str_b += Te2String(b.upperRight().x(), 15);
-		   str_b += ", ";
-		   str_b += Te2String(b.upperRight().y(), 15);
-		   str_b += ", ";
-		   str_b += Te2String(b.lowerLeft().x(), 15);
-		   str_b += ", ";
-		   str_b += Te2String(b.lowerLeft().y(), 15);
-		   str_b += ")";	       
-
-	return str_b;
-}
-
-
-
-void PGConcatLineString(const TeLine2D& l, string& concatString)
-{
-	register unsigned int i = 0;
-	register unsigned int nStep = l.size();
-
-	concatString += "(";
-	for(; i < nStep; ++i)
-	{
-		if(i != 0)
-		{
-			concatString += ", ";
-		}		 
-
-		concatString += PGCoord_encode(l[i]);
-	}
-	
-	concatString += ")";
-
-	return;
-}
-
-TeBox PGBoxFromPolygon(char *str)
-{
-	TePolygon pol = PGPolygon_decode(str);
-
-	return pol.box();
-}
-
-string PGMakePolygon(const TeBox& box)
-{
-	string result  = "POLYGON((";
-		   result += Te2String(box.x1(), 15);
-	       result += " ";
-	       result += Te2String(box.y1(), 15);
-		   result += ", ";
-		   result += Te2String(box.x1(), 15);
-	       result += " ";
-	       result += Te2String(box.y2(), 15);
-		   result += ", ";
-		   result += Te2String(box.x2(), 15);
-	       result += " ";
-	       result += Te2String(box.y2(), 15);
-		   result += ", ";
-		   result += Te2String(box.x2(), 15);
-	       result += " ";
-	       result += Te2String(box.y1(), 15);
-		   result += ", ";
-		   result += Te2String(box.x1(), 15);
-	       result += " ";
-	       result += Te2String(box.y1(), 15);
-		   result += "))";
-
-	return result;
-}
-
-
+#include "TePGUtils.h"
+#include <stdexcept>
+
+using namespace std;
+
+TeCoord2D PgGeomPolygonCoordDecode(char *str, char* *s)
+{
+
+	char *cp;	// I use this pointer to get the pointer address
+                // that strtod store in the second parameter.
+                // It is used to know if the conversion of a string
+                // to double ocurried normally
+
+	if(!str)
+		throw runtime_error("Invalid Coordinate!");
+
+	// SKIP WHITE SPACES
+	while(isspace((unsigned char)*str))
+		++str;
+
+	// SKIP THE FIRST '(' an go to number begin
+	if(*str != '(')
+			throw runtime_error("Invalid Coordinate!");
+
+	++str;
+
+	while(isspace((unsigned char)*str))
+		++str;
+
+	double x = strtod(str, &cp);
+
+	if(cp <= str)								// If no conversion or there aren't more characters
+		throw runtime_error("Invalid format!");	// Error, because the coord y will not be extracted
+												// Otherwise, cp will point to the next caracter, that begin the list conversion of coord y
+
+	// SKIP WHITE SPACES AFTER X COORDINATE AND JUMP ',' AND WHITE SPACES
+	while(isspace((unsigned char) *cp))
+		++cp;
+
+	if(*cp != ',')
+			throw runtime_error("Invalid Coordinate!");
+
+	++cp;
+
+	while(isspace((unsigned char) *cp))
+		++cp;
+
+	double y = strtod(cp, &str);
+	
+	if(str <= cp)
+		throw runtime_error("Invalid format!");
+
+	while(isspace((unsigned char) *str))
+		++str;
+
+	if(*str != ')')
+			throw runtime_error("Invalid Coordinate!");
+
+	++str;
+
+	while(isspace((unsigned char) *str))
+		++str;
+
+	if(s != 0)
+		*s = str;
+
+	return TeCoord2D(x, y);
+}
+
+void Te2PgGeomPolygon(const TeLine2D& l, string& strPolygon)
+{
+	strPolygon = "(";
+
+	unsigned int nVertex = l.size();
+	for(unsigned int i = 0u; i < nVertex; ++i)
+	{
+		if(i != 0u)
+			strPolygon += ",";
+
+		 strPolygon += Te2String(l[i].x_, 15);
+		 strPolygon += ",";
+		 strPolygon += Te2String(l[i].y_, 15);
+	}
+
+	strPolygon += ")";
+
+	return;
+}
+
+TeLine2D PgGeomPolygon2Te(char* strPolygon)
+{
+	char *s = strPolygon;
+
+	while(isspace((unsigned char) *s))
+		++s;
+
+	if(*s != LDELIM_PGGEOMPOLYGON)
+		throw runtime_error("Invalid line format!");
+
+	++s;
+
+	TeLine2D l;
+
+	while(true)
+	{
+		TeCoord2D coord = PgGeomPolygonCoordDecode(s, &s);
+		l.add(coord);	
+
+		if(*s == PGGEOMPOLYGON_COORDS_DELIM)
+			++s;
+		else
+			if(*s == RDELIM_PGGEOMPOLYGON)
+			{
+				++s;
+				break;
+			}
+	}
+
+    while(isspace((unsigned char) *s))
+		++s;
+
+	if((*s != '\0'))
+		throw runtime_error("Invalid line format!");
+
+	return l;
+}
+
+
+
+
+
+/*
+ * Codificadores e decodificadores PostGIS
+ *
+ */
+
+TeCoord2D PGCoord_decode(char *str, char* *s)
+{
+	char *cp;	// I use this pointer to get the pointer address
+                // that strtod store in the second parameter.
+                // It is used to know if the conversion of a string
+                // to double ocurried normally
+
+	if(!str)
+		throw runtime_error("Invalid Coordinate!");
+
+	while(isspace((unsigned char)*str))
+		++str;	
+
+	double x = strtod(str, &cp);
+
+	if(cp <= str)								// If no conversion or there aren't more characters
+		throw runtime_error("Invalid format!");	// Error, because the coord y will not be extracted
+												// Otherwise, cp will point to the next caracter, that begin the list conversion of coord y
+
+	while(isspace((unsigned char) *cp))
+		++cp;	
+
+	double y = strtod(cp, &str);
+	
+	if(str <= cp)
+		throw runtime_error("Invalid format!");
+
+	while(isspace((unsigned char) *str))
+		++str;	
+
+	if(s != 0)
+		*s = str;
+
+	return TeCoord2D(x, y);
+}
+
+string PGCoord_encode(const TeCoord2D& c)
+{
+	string str_p  = Te2String(c.x(), 15);
+		   str_p += " ";
+		   str_p += Te2String(c.y(), 15);
+
+	return str_p;
+}
+
+TePoint PGPoint_decode(char *str)
+{
+	if(!str)
+		throw runtime_error("Invalid point format!");
+		
+	char *s;
+
+	while(*str != ';')
+		 ++str;
+
+	if(*str == ';')
+		++str;
+
+	while(isspace((unsigned char) *str))
+		 ++str;
+
+	str+=6;	// Jump text "POINT(" and go to number.
+
+	TeCoord2D c = PGCoord_decode(str, &s);
+
+	if(*s != ')')
+		throw logic_error("Invalid point format!");
+
+	TePoint p;
+	
+	p.add(c);
+
+	return p;
+}
+
+string PGPoint_encode(const TePoint& p)
+{
+	string result  = "POINT(";
+		   result += PGCoord_encode(p.location());
+		   result += ")";
+
+	return result;
+}
+
+string PGNode_encode(const TeNode& p)
+{
+	string result  = "POINT(";
+		   result += PGCoord_encode(p.location());
+		   result += ")";
+
+	return result;
+}
+
+TeLine2D PGLine_decode(char *str, char* *sd)
+{
+	char *s;
+
+	s = str;
+
+	while(isspace((unsigned char) *s))
+		++s;
+
+	if(*s != LDELIM_LINESTRING)
+		throw runtime_error("Invalid line format!");
+
+	++s;
+
+	TeLine2D l;
+
+	double	xmin, ymin, xmax, ymax;
+
+	xmin = ymin = +TeMAXFLOAT;
+	xmax = ymax = -TeMAXFLOAT;
+
+	while(true)
+	{
+		TeCoord2D coord = PGCoord_decode(s, &s);
+		l.add(coord);
+
+		if(xmin > coord.x())
+			xmin = coord.x();
+
+		if(xmax < coord.x())
+			xmax = coord.x();
+		
+		if(ymin > coord.y())
+			ymin = coord.y();
+		
+		if(ymax < coord.y())
+			ymax = coord.y();
+
+		if(*s == COORDS_DELIM)
+			++s;
+		else
+			if(*s == RDELIM_LINESTRING)
+			{
+				++s;
+				break;
+			}
+	}
+
+    while(isspace((unsigned char) *s))
+		++s;
+
+	if((*s != '\0') && (*s != RDELIM_LINESTRING) && (*s != LINES_DELIM))
+		throw runtime_error("Invalid line format!");
+
+	l.setBox(TeBox(xmin, ymin, xmax, ymax));
+
+	*sd = s;
+
+	return l;
+}
+
+TeLine2D PGLinestring_decode(char *str)
+{
+	if(!str)
+		throw runtime_error("Invalid point format!");
+		
+	char *s;
+
+	s = str;
+
+	while(*s != ';')
+		 ++s;
+
+	if(*s == ';')
+		++s;
+
+	while(isspace((unsigned char) *s))
+		 ++s;
+
+	s += 10;	// Jump text "LINESTRING(" and go to number.
+
+	return PGLine_decode(s, &s);
+}
+
+TePolygon PGPolygon_decode(char *str)
+{
+	if(!str)
+		throw runtime_error("Invalid polygon format!");
+		
+	char *s;
+
+	while(*str != ';')
+		++str;
+
+	if(*str == ';')
+		++str;
+
+	while(isspace((unsigned char) *str))
+		 ++str;
+
+	str += 8;	// Jump text "POLYGON(" and go to first line.
+
+
+	s = str;
+
+	TePolygon pol;
+	while(true)
+	{
+		TeLine2D l = PGLine_decode(s, &s);
+		TeLinearRing r(l);
+		pol.add(r);
+
+		if(*s == COORDS_DELIM)
+			++s;
+		else
+			if(*s == RDELIM_LINESTRING)
+			{
+				++s;
+				break;
+			}
+	}
+
+	while(isspace((unsigned char) *s))
+		++s;
+
+	if(*s != '\0')
+		throw runtime_error("Invalid polygon format!");
+
+	pol.setBox(pol[0].box());
+
+	return pol;
+}
+
+TeBox PGBox_decode(char *str)
+{
+	 char *s;
+
+	 s = str;
+
+	 while(isspace((unsigned char) *s))
+		 ++s;
+
+	 s+=6;
+	 
+	 TeCoord2D coord1 = PGCoord_decode(s, &s);
+
+	 while(*s != ',')
+		 ++s;
+
+	 ++s;
+	 
+	 //if(*s != COORDS_DELIM)
+	 //	throw runtime_error("Invalid box format!");
+
+	 //++s;
+
+	 TeCoord2D coord2 = PGCoord_decode(s, &s);
+
+     //if(*s != RDELIM_BOX)
+	 //	throw runtime_error("Invalid box format!");
+	
+	 //++s;
+
+	 //while(isspace((unsigned char) *s))
+	 //	 ++s;
+
+	 //if(*s != '\0')
+	 //	 throw runtime_error("Invalid box format!");
+
+	 return TeBox(coord1, coord2);
+}
+
+string PGBox_encode(const TeBox& b)
+{
+	string str_b = "BOX3D(";
+	       str_b += PGCoord_encode(b.upperRight());
+           str_b += ",";
+		   str_b += PGCoord_encode(b.lowerLeft());
+           str_b += ")";
+
+	return str_b;
+}
+
+TeBox PGBoxRtree_decode(char *str)
+{
+	char *cp;	// I use this pointer to get the pointer address
+                // that strtod store in the second parameter.
+                // It is used to know if the conversion of a string
+                // to double ocurried normally
+
+	if(!str)
+		throw runtime_error("Invalid Coordinate!");
+
+	// SKIP WHITE SPACES
+	while(isspace((unsigned char)*str))
+		++str;
+
+	// SKIP THE FIRST '(' an go to number begin
+	if(*str != '(')
+			throw runtime_error("Invalid Box!");
+
+	++str;
+
+	while(isspace((unsigned char)*str))
+		++str;
+
+	double x2 = strtod(str, &cp);
+
+	if(cp <= str)								// If no conversion or there aren't more characters
+		throw runtime_error("Invalid format!");	// Error, because the coord y will not be extracted
+												// Otherwise, cp will point to the next caracter, that begin the list conversion of coord y
+
+	// SKIP WHITE SPACES AFTER X1 COORDINATE AND JUMP ',' AND WHITE SPACES
+	while(isspace((unsigned char) *cp))
+		++cp;
+
+	if(*cp != ',')
+			throw runtime_error("Invalid Box!");
+
+	++cp;
+
+	while(isspace((unsigned char) *cp))
+		++cp;
+
+	double y2 = strtod(cp, &str);
+	
+	if(str <= cp)
+		throw runtime_error("Invalid format!");
+
+	// SKIP WHITE SPACES AFTER Y1 COORDINATE AND JUMP ',' AND WHITE SPACES
+	while(isspace((unsigned char) *str))
+		++str;
+
+	if(*str != ')')
+		throw runtime_error("Invalid Box!");
+
+	++str;
+
+	while(isspace((unsigned char) *str))
+		++str;
+
+	if(*str != ',')
+		throw runtime_error("Invalid Box!");
+
+	++str;
+
+	while(isspace((unsigned char) *str))
+		++str;
+
+	if(*str != '(')
+		throw runtime_error("Invalid Box!");
+
+	++str;
+
+	while(isspace((unsigned char) *str))
+		++str;
+
+	double x1 = strtod(str, &cp);
+	
+	if(cp <= str)
+		throw runtime_error("Invalid format!");
+
+	// SKIP WHITE SPACES AFTER x2 COORDINATE AND JUMP ',' AND WHITE SPACES
+	while(isspace((unsigned char) *cp))
+		++cp;
+
+	if(*cp != ',')
+			throw runtime_error("Invalid Box!");
+
+	++cp;
+
+	while(isspace((unsigned char) *cp))
+		++cp;
+
+	double y1 = strtod(cp, &str);
+	
+	if(str <= cp)
+		throw runtime_error("Invalid format!");
+
+	while(isspace((unsigned char) *str))
+		++str;
+
+	if(*str != ')')
+		throw runtime_error("Invalid Box!");
+
+	return TeBox(x1, y1, x2, y2);
+}
+
+string PGBoxRtree_encode(const TeBox& b)
+{
+	string str_b  = "(";
+	       str_b += Te2String(b.upperRight().x(), 15);
+		   str_b += ", ";
+		   str_b += Te2String(b.upperRight().y(), 15);
+		   str_b += ", ";
+		   str_b += Te2String(b.lowerLeft().x(), 15);
+		   str_b += ", ";
+		   str_b += Te2String(b.lowerLeft().y(), 15);
+		   str_b += ")";	       
+
+	return str_b;
+}
+
+
+
+void PGConcatLineString(const TeLine2D& l, string& concatString)
+{
+	register unsigned int i = 0;
+	register unsigned int nStep = l.size();
+
+	concatString += "(";
+	for(; i < nStep; ++i)
+	{
+		if(i != 0)
+		{
+			concatString += ", ";
+		}		 
+
+		concatString += PGCoord_encode(l[i]);
+	}
+	
+	concatString += ")";
+
+	return;
+}
+
+TeBox PGBoxFromPolygon(char *str)
+{
+	TePolygon pol = PGPolygon_decode(str);
+
+	return pol.box();
+}
+
+string PGMakePolygon(const TeBox& box)
+{
+	string result  = "POLYGON((";
+		   result += Te2String(box.x1(), 15);
+	       result += " ";
+	       result += Te2String(box.y1(), 15);
+		   result += ", ";
+		   result += Te2String(box.x1(), 15);
+	       result += " ";
+	       result += Te2String(box.y2(), 15);
+		   result += ", ";
+		   result += Te2String(box.x2(), 15);
+	       result += " ";
+	       result += Te2String(box.y2(), 15);
+		   result += ", ";
+		   result += Te2String(box.x2(), 15);
+	       result += " ";
+	       result += Te2String(box.y1(), 15);
+		   result += ", ";
+		   result += Te2String(box.x1(), 15);
+	       result += " ";
+	       result += Te2String(box.y1(), 15);
+		   result += "))";
+
+	return result;
+}
+
+
diff --git a/src/terralib/drivers/PostgreSQL/TePGUtils.h b/src/terralib/drivers/PostgreSQL/TePGUtils.h
old mode 100755
new mode 100644
index 8ab9c69..7a0da7b
--- a/src/terralib/drivers/PostgreSQL/TePGUtils.h
+++ b/src/terralib/drivers/PostgreSQL/TePGUtils.h
@@ -1,108 +1,110 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TePGUtils.h
-    \brief This file contains utilities functions to read/write geometry fields (PostGIS and PostgreSQL).
-	\author Gilberto Ribeiro de Queiroz - gribeiro at dpi.inpe.br
- */
-
-#ifndef  __TERRALIB_INTERNAL_TePOSTGRESQLUTILS_H
-#define  __TERRALIB_INTERNAL_TePOSTGRESQLUTILS_H
-
-#include "TeGeometry.h"
-
-#define COORDS_DELIM		','
-
-#define COORD_DELIM			' '
-
-#define LINES_DELIM		','
-
-#define LDELIM_POINT		'('
-#define RDELIM_POINT		')'
-
-#define LDELIM_LINESTRING	'('
-#define RDELIM_LINESTRING	')'
-
-#define LDELIM_POLYGON		'('
-#define RDELIM_POLYGON		')'
-
-#define LDELIM_BOX			'('
-#define RDELIM_BOX			')'
-
-// DELIMITADORES PARA TIPOS GEOMETRICOS DO POSTGRESQL
-#define LDELIM_PGGEOMPOLYGON       '('
-#define RDELIM_PGGEOMPOLYGON       ')'
-
-#define PGGEOMPOLYGON_COORDS_DELIM ','
-
-/*
- * Codificadores e decodificadores de tipos geometricos do PostgreSQL.
- * Essas funcoes sao para o driver sem extensao espacial.
- *
- */
-
-//! Decodifica uma coordenada no formato poligono dos tipos geometricos do PostgreSQL: (x1, y1)
-TeCoord2D PgGeomPolygonCoordDecode(char *str, char* *s);
-
-//! Transaforma a linha l em um poligono texto strPolygon
-void Te2PgGeomPolygon(const TeLine2D& l, string& strPolygon);
-
-//! Transaforma um poligono texto strPolygon em uma linha
-TeLine2D PgGeomPolygon2Te(char* strPolygon);
-
-/*
- * Codificadores e decodificadores PostGIS - Texto
- * 
- */
-TeCoord2D PGCoord_decode(char *str, char* *s);
-
-string PGCoord_encode(const TeCoord2D& c);
-
-TePoint PGPoint_decode(char *str);
-
-string PGPoint_encode(const TePoint& p);
-
-string PGNode_encode(const TeNode& p);
-
-TeLine2D PGLine_decode(char *str, char* *sd);
-
-TeLine2D PGLinestring_decode(char *str);
-
-TePolygon PGPolygon_decode(char *str);
-
-TeBox PGBox_decode(char *str);
-
-string PGBox_encode(TeBox& b);
-
-TeBox PGBoxRtree_decode(char *str);
-
-string PGBoxRtree_encode(const TeBox& b);
-
-void PGConcatLineString(const TeLine2D& l, string& concatString);
-
-TeBox PGBoxFromPolygon(char *str);
-
-string PGMakePolygon(const TeBox& box);
-
-
-#endif	// __TERRALIB_INTERNAL_TePOSTGRESQLUTILS_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TePGUtils.h
+    \brief This file contains utilities functions to read/write geometry fields (PostGIS and PostgreSQL).
+	\author Gilberto Ribeiro de Queiroz - gribeiro at dpi.inpe.br
+ */
+
+#ifndef  __TERRALIB_INTERNAL_TePOSTGRESQLUTILS_H
+#define  __TERRALIB_INTERNAL_TePOSTGRESQLUTILS_H
+
+#include "TeGeometry.h"
+
+#include "TePostgreSQLDefines.h"
+
+#define COORDS_DELIM		','
+
+#define COORD_DELIM			' '
+
+#define LINES_DELIM		','
+
+#define LDELIM_POINT		'('
+#define RDELIM_POINT		')'
+
+#define LDELIM_LINESTRING	'('
+#define RDELIM_LINESTRING	')'
+
+#define LDELIM_POLYGON		'('
+#define RDELIM_POLYGON		')'
+
+#define LDELIM_BOX			'('
+#define RDELIM_BOX			')'
+
+// DELIMITADORES PARA TIPOS GEOMETRICOS DO POSTGRESQL
+#define LDELIM_PGGEOMPOLYGON       '('
+#define RDELIM_PGGEOMPOLYGON       ')'
+
+#define PGGEOMPOLYGON_COORDS_DELIM ','
+
+/*
+ * Codificadores e decodificadores de tipos geometricos do PostgreSQL.
+ * Essas funcoes sao para o driver sem extensao espacial.
+ *
+ */
+
+//! Decodifica uma coordenada no formato poligono dos tipos geometricos do PostgreSQL: (x1, y1)
+TLPOSTGRESQL_DLL TeCoord2D PgGeomPolygonCoordDecode(char *str, char* *s);
+
+//! Transaforma a linha l em um poligono texto strPolygon
+TLPOSTGRESQL_DLL void Te2PgGeomPolygon(const TeLine2D& l, string& strPolygon);
+
+//! Transaforma um poligono texto strPolygon em uma linha
+TLPOSTGRESQL_DLL TeLine2D PgGeomPolygon2Te(char* strPolygon);
+
+/*
+ * Codificadores e decodificadores PostGIS - Texto
+ * 
+ */
+TLPOSTGRESQL_DLL TeCoord2D PGCoord_decode(char *str, char* *s);
+
+TLPOSTGRESQL_DLL string PGCoord_encode(const TeCoord2D& c);
+
+TLPOSTGRESQL_DLL TePoint PGPoint_decode(char *str);
+
+TLPOSTGRESQL_DLL string PGPoint_encode(const TePoint& p);
+
+TLPOSTGRESQL_DLL string PGNode_encode(const TeNode& p);
+
+TLPOSTGRESQL_DLL TeLine2D PGLine_decode(char *str, char* *sd);
+
+TLPOSTGRESQL_DLL TeLine2D PGLinestring_decode(char *str);
+
+TLPOSTGRESQL_DLL TePolygon PGPolygon_decode(char *str);
+
+TLPOSTGRESQL_DLL TeBox PGBox_decode(char *str);
+
+TLPOSTGRESQL_DLL string PGBox_encode(const TeBox& b);
+
+TLPOSTGRESQL_DLL TeBox PGBoxRtree_decode(char *str);
+
+TLPOSTGRESQL_DLL string PGBoxRtree_encode(const TeBox& b);
+
+TLPOSTGRESQL_DLL void PGConcatLineString(const TeLine2D& l, string& concatString);
+
+TLPOSTGRESQL_DLL TeBox PGBoxFromPolygon(char *str);
+
+TLPOSTGRESQL_DLL string PGMakePolygon(const TeBox& box);
+
+
+#endif	// __TERRALIB_INTERNAL_TePOSTGRESQLUTILS_H
+
diff --git a/src/terralib/drivers/PostgreSQL/TePostGIS.cpp b/src/terralib/drivers/PostgreSQL/TePostGIS.cpp
old mode 100755
new mode 100644
index bb92406..cfccbf4
--- a/src/terralib/drivers/PostgreSQL/TePostGIS.cpp
+++ b/src/terralib/drivers/PostgreSQL/TePostGIS.cpp
@@ -1,1742 +1,1765 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TePostGIS.h"
-#include "TePGUtils.h"
-
-#define BUFFSIZE                1024
-
-TePostGIS::TePostGIS()
-{
-	dbmsName_ = "PostGIS";
-}
-
-bool TePostGIS::newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port, bool terralibModel)
-{
-	errorMessage_ = "";
-
-	string createDB  = "CREATE DATABASE ";
-	       createDB += "\"" + database + "\"";
-		   createDB += " TEMPLATE = template_postgis";
-
-	if(!connect(host, user, password, "template_postgis", port))
-	{
-		close();
-		return false;
-	}
-		
-	bool connected = false;
-	
-	if(execute(createDB))
-	{
-		connected = connect(host, user, password, database, port);
-	}
-	else
-	{
-		close();
-		return false;
-	}
-
-	if(terralibModel)
-	{
-		//create conceptual model
-		if(connected)
-		{
-			if(!createConceptualModel())
-			{
-				close();
-				return false;
-			}
-		}
-		else
-		{
-			close();
-			return false;
-		}
-	}
-
-	return true;
-}
-
-bool TePostGIS::connect(const string& host, const string& user, const string& password, const string& database, int port)
-{
-	if(!realConnect(host, user, password, database, port))
-		return false;
-
-// see if PostGIS is present
-	TePGRecordset rec;
-
-	string sql = "SELECT postgis_version()";
-
-	if(!rec.open(sql.c_str(), &tepg_connection_) || rec.recordCount() <= 0)
-	{
-		rec.close();
-
-		this->close();
-
-		errorMessage_ = "Couldn't find PostGIS extension! You may use the PostgreSQL driver!";
-
-		return false;	
-	}
-
-// see if RTree GiST is present for box: it must be present
-	int version = PQserverVersion(tepg_connection_.c_ptr());
-	if(version >= 80100)
-	{
-		gistBoxOps_ = "box_ops";
-		return true;
-	}
-
-	sql = "SELECT opcname FROM pg_opclass WHERE (opcname = 'gist_box_ops') ORDER BY opcname DESC";
-
-	if(rec.open(sql.c_str(), &tepg_connection_) && rec.recordCount() > 0)
-	{
-		TePostgreSQL::gistBoxOps_ = rec.value(0);
-		rec.close();
-
-		return true;
-	}
-
-	rec.close();
-
-	this->close();
-
-	errorMessage_ = "GiST extension not found! Please, install R-Tree GiST in your database and try again!";
-
-	return false;	
-}
-
-bool TePostGIS::showDatabases(const string& host, const string& user, const string& password, vector<string>& dbNames, int port)
-{
-	errorMessage_ = "";
-
-	if(TePostgreSQL::realConnect(host, user, password, "template1", port))
-	{
-		string sql = "SELECT datname FROM pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY datname";
-
-		TePostGISPortal p(this);
-
-		if(p.query(sql) && p.fetchRow())
-		{
-			do
-			{
-				dbNames.push_back(p.getData("datname"));
-			}while(p.fetchRow());
-
-			return true;
-		}
-		else
-			errorMessage_ = "Didn't find any database!";
-	}
-	
-	return false;
-}
-
-TeDatabasePortal* TePostGIS::getPortal()
-{
-	errorMessage_ = "";
-
-	TeDatabasePortal *portal = new TePostGISPortal(this);
-
-	return portal;
-}
-
-bool TePostGIS::createTable(const string& table, TeAttributeList &attr)
-{
-	errorMessage_ = "";
-
-	bool first = true;
-
-	TeAttributeList::iterator it = attr.begin();
-	
-	string createTable ="CREATE TABLE " + table +" (";
-	
-	string type;
-	char	size[8];
-
-	string pkeys;
-
-	vector<string> addGeomColumnsSQL;
-	string addGeomSQL = "";
-
-	while(it != attr.end())
-	{
-		switch ((*it).rep_.type_)
-		{
-			case TeSTRING:		if((*it).rep_.numChar_ > 0)
-								{
-									type = "VARCHAR(" + Te2String((*it).rep_.numChar_) + ")";
-								}
-								else
-								{
-									type = "TEXT";
-								}
-								break;
-
-			case TeREAL:		type = "FLOAT8";
-								break;
-
-			case TeINT:
-			case TeUNSIGNEDINT:
-								type = ((*it).rep_.isAutoNumber_) ? "SERIAL" : "INTEGER";
-								break;
-
-			case TeBLOB:		//type = "OID";
-				                type = "BYTEA";
-								break;
-
-			case TeDATETIME:	type = "TIMESTAMP(0)";
-								break;
-
-			case TeCHARACTER:	type = "CHAR ";
-								sprintf (size, "(%d)", (*it).rep_.numChar_);
-								type += string (size);
-								break;
-
-			case TePOINTTYPE:
-			case TePOINTSETTYPE:
-								addGeomSQL = "SELECT AddGeometryColumn('";
-								addGeomSQL += database_;
-								addGeomSQL += "', '";
-								addGeomSQL += TeConvertToLowerCase(table);
-								addGeomSQL += "', 'spatial_data', ";
-								addGeomSQL += " -1, 'POINT', 2)";
-
-								addGeomColumnsSQL.push_back(addGeomSQL);
-
-								++it;
-								continue;
-
-			case TeLINE2DTYPE:
-			case TeLINESETTYPE:							
-								addGeomSQL  = "SELECT AddGeometryColumn('";
-								addGeomSQL += database_;
-								addGeomSQL += "', '";
-								addGeomSQL += TeConvertToLowerCase(table);
-								addGeomSQL += "', 'spatial_data',";
-								addGeomSQL += " -1, 'LINESTRING', 2)";
-
-								addGeomColumnsSQL.push_back(addGeomSQL);
-
-								++it;
-								continue;
-
-			case TePOLYGONTYPE:
-			case TePOLYGONSETTYPE:
-								addGeomSQL  = "SELECT AddGeometryColumn('";
-								addGeomSQL += database_;
-								addGeomSQL += "', '";
-								addGeomSQL += TeConvertToLowerCase(table);
-								addGeomSQL += "', 'spatial_data',";
-								addGeomSQL += " -1, 'POLYGON', 2)";
-
-								addGeomColumnsSQL.push_back(addGeomSQL);
-
-								++it;
-								continue;
-
-			case TeCELLTYPE:
-			case TeCELLSETTYPE:
-								if(!first)
-									createTable += ", ";
-								else
-									first = false;
-
-								addGeomSQL  = "SELECT AddGeometryColumn('";
-								addGeomSQL += database_;
-								addGeomSQL += "', '";
-								addGeomSQL += TeConvertToLowerCase(table);
-								addGeomSQL += "', 'spatial_data',";
-								addGeomSQL += " -1, 'POLYGON', 2)";
-
-								addGeomColumnsSQL.push_back(addGeomSQL);
-
-								createTable += " col_number   INTEGER      NOT NULL,";
-								createTable += " row_number	INTEGER      NOT NULL ";
-								++it;
-								continue;					
-
-			case TeRASTERTYPE:
-								if(!first)
-									createTable += ", ";
-								else
-									first = false;
-
-								createTable += " block_box         BOX         NOT NULL,";
-								createTable += " band_id		     INTEGER     NOT NULL,";		   
-								createTable += " resolution_factor INTEGER     NOT NULL,";
-								createTable += " subband		     INTEGER     NOT NULL,";		   
-								createTable += " spatial_data      BYTEA,";
-								createTable += " block_size        INTEGER  NOT NULL ";
-		   						++it;
-								continue;
-
-			case TeNODETYPE:
-			case TeNODESETTYPE:
-								addGeomSQL = "SELECT AddGeometryColumn('";
-								addGeomSQL += database_;
-								addGeomSQL += "', '";
-								addGeomSQL += TeConvertToLowerCase(table);
-								addGeomSQL += "', 'spatial_data', ";
-								addGeomSQL += " -1, 'POINT', 2)";
-
-								addGeomColumnsSQL.push_back(addGeomSQL);
-
-								++it;
-								continue;
-
-			case TeTEXTTYPE:
-			case TeTEXTSETTYPE:
-
-			default:			type = "VARCHAR ";
-								sprintf (size, "(%d)", (*it).rep_.numChar_);
-								type += string (size);
-								break;
-		}
-
-		if(!((*it).rep_.defaultValue_.empty()))
-			type += " DEFAULT '" + (*it).rep_.defaultValue_ + "' ";
-
-		if(!((*it).rep_.null_))
-			type += " NOT NULL ";
-		
-		if(!first)
-			createTable += ",  ";
-		else
-			first = false;
-
-		createTable += (*it).rep_.name_ + " ";
-		createTable += type;
-
-		// check if column is part of primary key
-		if((*it).rep_.isPrimaryKey_ && (*it).rep_.type_ != TeBLOB )
-		{
-			if(!pkeys.empty())
-				pkeys += ", ";
-			
-			pkeys += (*it).rep_.name_;
-		}
-
-
-		++it;
-	}
-
-	if(!pkeys.empty())
-	{	string pk = ", PRIMARY KEY(";
-	           pk += pkeys;
-			   pk += ")";
-
-		createTable += pk;
-	}
-
-
-	createTable += ");";
-
-	if(!execute(createTable))
-		return false;
-
-	for(unsigned int i = 0; i < addGeomColumnsSQL.size(); ++i)
-	{
-		if(!execute(addGeomColumnsSQL[i]))
-			return false;
-	}
-
-	return true;
-}
-
-bool TePostGIS::generateLabelPositions(TeTheme *theme, const std::string& objectId)
-{
-	string	geomTable, upd;
-	string	collTable = theme->collectionTable();
-	
-	if((collTable.empty()) || (!tableExist(collTable)))
-		return false;
-
-	if(theme->layer()->hasGeometry(TeCELLS)    || 
-	   theme->layer()->hasGeometry(TePOLYGONS) ||
-	   theme->layer()->hasGeometry(TeLINES)    ||
-	   theme->layer()->hasGeometry(TePOINTS))
-	{
-		geomTable = theme->layer()->tableName(TeCELLS);
-		
-		if(geomTable.empty())
-		{
-			geomTable = theme->layer()->tableName(TePOLYGONS);
-			if(geomTable.empty())
-			{
-				geomTable = theme->layer()->tableName(TeLINES);
-
-				if(geomTable.empty())
-					geomTable = theme->layer()->tableName(TePOINTS);
-			}
-		}
-		
-		upd= " UPDATE " + collTable + " SET ";
-		upd += " label_x = (SELECT MAX(xmin(spatial_data::box3d) + (xmax(spatial_data::box3d)";
-		upd += " -  xmin(spatial_data::box3d)) / 2.0) ";
-		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
-		
-		upd += " label_y = (SELECT MAX(ymin(spatial_data::box3d) + (ymax(spatial_data::box3d)";
-		upd += " - ymin(spatial_data::box3d)) / 2.0) ";
-		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
-
-		upd += " WHERE (label_x IS NULL) OR (label_y IS NULL)";
-	}	
-
-	if (!objectId.empty())
-		upd += " AND c_object_id='"+objectId+"'";
-		
-	return execute(upd);
-}
-
-
-bool TePostGIS::selectPolygonSet(const string& table, const string& criteria, TePolygonSet& ps)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	
-	string sql ="SELECT * FROM " + table;
-	
-	if(!criteria.empty())
-		sql += " WHERE " + criteria;
-	
-	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-	
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		ps.add(poly);
-	}
-	while(flag);
-
-	delete portal;
-
-	return true;
-}
-
-bool TePostGIS::loadPolygonSet(TeTheme* theme, TePolygonSet& ps)
-{
-	string collTable = theme->collectionTable();
-	
-	if(collTable.empty())
-		return false;
-
-	TeLayer* themeLayer = theme->layer();
-
-	if(!themeLayer->hasGeometry(TePOLYGONS))
-		return false;
-	
-	string polygonTable = themeLayer->tableName(TePOLYGONS);
-
-	if(polygonTable.empty())
-		return false;
-
-	string sql  = "SELECT * FROM (" + polygonTable + " RIGHT JOIN " + collTable;
-	       sql += " ON " + polygonTable + ".object_id = " + collTable + ".c_object_id)";
-	
-	TeDatabasePortal *portal = this->getPortal();
-	
-	if(!portal)
-		return false;
-
-	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		ps.add ( poly );
-	}
-	while(flag);		
-	
-	delete portal;
-	
-	return true;
-}
-
-bool TePostGIS::loadPolygonSet(const string& table, const string& geoid, TePolygonSet& ps)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	
-	string q ="SELECT * FROM " + table;
-
-	if (!geoid.empty())
-		q += " WHERE object_id = '" + geoid +"'";
-	
-	if (!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		ps.add(poly);
-	}
-	while (flag);
-
-	delete portal;
-
-	return true;
-}
-
-bool TePostGIS::loadPolygonSet(const string& table, TeBox& box, TePolygonSet& ps)
-{
-	TeDatabasePortal *portal = this->getPortal();
-
-	if(!portal)
-		return false;
-
-	string q = "SELECT * FROM " + table + " WHERE ";
-	       q += this->getSQLBoxWhere (box, TePOLYGONS);
-
-	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		ps.add(poly);
-	}
-	while (flag);
-
-	delete portal;
-
-	return true;
-}
-
-TeDatabasePortal* TePostGIS::loadPolygonSet(const string& table, TeBox& box)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	
-	if(!portal)
-		return 0;
-
-	string q = "SELECT * FROM " + table + " WHERE ";
-	       q += this->getSQLBoxWhere(box, TePOLYGONS);
-
-	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return 0;
-	}
-	else 
-		return portal;
-}
-
-bool TePostGIS::locatePolygon(const string& table, TeCoord2D& pt, TePolygon& polygon, const double& tol)
-{
-	TeDatabasePortal *portal = this->getPortal();
-
-	if (!portal)
-		return false;
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-
-
-	string sql  = "SELECT * FROM ";
-	       sql += table;
-		   sql += " WHERE ";
-		   sql += getSQLBoxWhere(box, TePOLYGONS);
-	
-	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-
-	do
-	{
-		TePolygon poly;
-
-		flag = portal->fetchGeometry(poly);
-
-		if(TeWithin(TePoint(pt), poly))
-		{
-			polygon = poly;
-			delete portal;
-			return true;
-		}
-	}
-	while(flag);
-	
-	delete portal;
-	
-	return false;
-}
-
-bool TePostGIS::locatePolygonSet(const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	
-	if (!portal)
-		return false;
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-
-
-	string sql  = "SELECT * FROM ";
-	       sql += table;
-		   sql += " WHERE ";
-		   sql += getSQLBoxWhere(box, TePOLYGONS);
-
-	if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}	
-	bool flag = true;
-	
-	polygons.clear();
-	
-	do
-	{
-		TePolygon poly;
-
-		flag = portal->fetchGeometry(poly);
-
-		if(TeWithin(TePoint(pt), poly))
-			polygons.add(poly);
-	}
-	while (flag);
-
-	delete portal;
-
-	if(polygons.size())
-		return (true);
-
-	return false;
-}
-
-bool TePostGIS::insertPolygon(const string& table, TePolygon &p)
-{
-	errorMessage_ = "";
-
-	unsigned int sizeBinaryPolygon = 0;
-	char* binaryPolygon = TePolygonToWKBPolygon(p, sizeBinaryPolygon);
-
-	int nParams = 2;
-	Oid paramTypes[2];
-	const char *paramValues[2];
-	int paramLengths[2];
-	int paramFormats[2];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = 0;
-
-	string strOid = escapeSequence(p.objectId());
-	paramValues[0] = strOid.c_str();
-	paramValues[1] = binaryPolygon;
-
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryPolygon;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	
-
-	string command = "INSERT INTO ";
-			command += table;
-			command += " (object_id, spatial_data)";//::geometry
-			command += " VALUES ($1, $2::geometry)";
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryPolygon;
-			
-	if(result == 1)
-	{
-		string sql = "SELECT currval('" + table + "_geom_id_seq')";
-		
-		TePGRecordset rec;
-		rec.open(sql.c_str(), &tepg_connection_);
-		if(rec.recordCount() > 0)
-		{
-			p.geomId(rec.getInt(0));
-			for(register unsigned int i = 0; i < p.size(); ++i)
-			{
-				p[i].geomId(rec.getInt(0));
-			}
-		}
-
-		rec.close();
-	}
-	else
-		return false;
-
-	return true;
-}
-
-bool TePostGIS::updatePolygon(const string& table, TePolygon &p)
-{
-	errorMessage_ = "";
-
-	unsigned int sizeBinaryPolygon = 0;
-	char* binaryPolygon = TePolygonToWKBPolygon(p, sizeBinaryPolygon);
-
-	int nParams = 2;
-	Oid paramTypes[2];
-	const char *paramValues[2];
-	int paramLengths[2];
-	int paramFormats[2];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = 0;
-
-	string strOid = escapeSequence(p.objectId());
-	paramValues[0] = strOid.c_str();
-	paramValues[1] = binaryPolygon;
-
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryPolygon;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	
-	string command = "UPDATE " + table + " SET";
-	command += " object_id = $1";
-	command += ", spatial_data = $2::geometry";
-	command += " WHERE geom_id = ";
-    command += Te2String(p.geomId());
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryPolygon;
-
-	return (result == 1);
-}
-
-bool TePostGIS::loadLineSet(const string& table, const string& geoid, TeLineSet& ls)
-{
-	TeDatabasePortal *portal = this->getPortal();
-
-	string q ="SELECT * FROM " + table;
-
-	if(!geoid.empty())
-		q += " WHERE object_id = '" + geoid +"'";
-
-	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-
-	do 
-	{
-		TeLine2D line;
-		flag = portal->fetchGeometry(line);
-		ls.add (line);
-	}while(flag);
-
-	delete portal;
-
-	return true;
-}
-
-bool TePostGIS::loadLineSet(const string& table, TeBox& box, TeLineSet& linSet)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	
-	if(!portal)
-		return false;
-
-	string q  = "SELECT * FROM " + table + " WHERE ";
-	       q += this->getSQLBoxWhere (box, TeLINES);       
-
-	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-
-	do
-	{
-		TeLine2D lin;
-		flag = portal->fetchGeometry(lin);
-		linSet.add(lin);
-	}
-	while (flag);
-
-	delete portal;
-
-	return true;
-}
-
-TeDatabasePortal* TePostGIS::loadLineSet(const string& table, TeBox& box)
-{
-	TeDatabasePortal *portal = this->getPortal();
-
-	if(!portal)
-		return 0;
-
-	string q  = "SELECT * FROM " + table + " WHERE ";
-	       q += this->getSQLBoxWhere (box, TeLINES);
-	       
-
-	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-
-		return 0;
-	}
-
-	return portal;
-}
-
-bool TePostGIS::insertLine(const string& table, TeLine2D& l)
-{
-	errorMessage_ = "";
-
-	unsigned int sizeBinaryRing = 0;
-	char* binaryRing = TeLine2DToWKBLineString(l, sizeBinaryRing);
-
-	int nParams = 2;
-	Oid paramTypes[2];
-	const char *paramValues[2];
-	int paramLengths[2];
-	int paramFormats[2];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = 0;
-
-	string strOid = escapeSequence(l.objectId());
-	paramValues[0] = strOid.c_str();
-	paramValues[1] = binaryRing;
-
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryRing;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	
-
-	string command = "INSERT INTO ";
-			command += table;
-			command += " (object_id, spatial_data)";
-			command += " VALUES ($1, $2::geometry)";
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryRing;
-
-	if(result == 1)
-	{
-		string sql = "SELECT currval('" + table + "_geom_id_seq')";
-
-		TePGRecordset rec;
-		rec.open(sql.c_str(), &tepg_connection_);
-
-		if(rec.recordCount() > 0)
-			l.geomId(rec.getInt(0));
-
-		rec.close();
-	}
-	else
-		return false;
-
-	return true;
-}
-
-bool TePostGIS::updateLine(const string& table, TeLine2D& l)
-{
-	errorMessage_ = "";
-
-		unsigned int sizeBinaryRing = 0;
-	char* binaryRing = TeLine2DToWKBLineString(l, sizeBinaryRing);
-
-	int nParams = 2;
-	Oid paramTypes[2];
-	const char *paramValues[2];
-	int paramLengths[2];
-	int paramFormats[2];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = 0;
-
-	string strOid = escapeSequence(l.objectId());
-	paramValues[0] = strOid.c_str();
-	paramValues[1] = binaryRing;
-
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryRing;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-
-	string command  = "UPDATE " + table + " SET";
-		   command += " obejct_id = $1";
-		   command += ", spatial_data = $2::geometry";
-		   command += " WHERE geom_id = ";
-		   command += Te2String(l.geomId());		
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryRing;
-
-	return (result == 1);
-}
-
-bool TePostGIS::locateLine(const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-
-	string sql  = "SELECT * FROM ";
-	       sql += table;
-		   sql += " WHERE ";
-		   sql += this->getSQLBoxWhere(box, TeLINES);
-	
-	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	// Get all lines
-	TeLineSet ls;
-	int k;
-	bool flag = true;
-	do 
-	{
-		TeLine2D l;
-		flag = portal->fetchGeometry( l );
-		ls.add ( l );
-	} while(flag);
-
-	delete portal;
-
-	TeCoord2D paux;
-
-	if(TeNearest(pt, ls, k, paux, tol))
-	{
-		line = ls[k];
-		return true;
-	}
-
-	return false;
-}
-
-bool TePostGIS::insertPoint(const string& table, TePoint &p)
-{
-	errorMessage_ = "";
-
-	unsigned int sizeBinaryPoint = 2 * sizeof(double);
-	char* binaryPoint = TePointToWKBPoint(p, sizeBinaryPoint);
-
-	int nParams = 2;
-	Oid paramTypes[2];
-	const char *paramValues[2];
-	int paramLengths[2];
-	int paramFormats[2];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = 0;
-
-	string strOid = escapeSequence(p.objectId());
-	paramValues[0] = strOid.c_str();
-	paramValues[1] = binaryPoint;
-
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryPoint;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	
-
-	string command = "INSERT INTO ";
-			command += table;
-			command += " (object_id, spatial_data)";
-			command += " VALUES ($1, $2::geometry)";
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryPoint;
-
-	if(result == 1)
-	{
-		string sql = "SELECT currval('" + table + "_geom_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql.c_str(), &tepg_connection_);
-		if(rec.recordCount() > 0)
-			p.geomId(rec.getInt(0));
-
-		rec.close();
-	}
-	else
-		return false;
-	
-	return true;
-}
-
-bool TePostGIS::updatePoint(const string& table, TePoint &p)
-{
-	errorMessage_ = "";
-
-	unsigned int sizeBinaryPoint = 2 * sizeof(double);
-	char* binaryPoint = TePointToWKBPoint(p, sizeBinaryPoint);
-
-	int nParams = 2;
-	Oid paramTypes[2];
-	const char *paramValues[2];
-	int paramLengths[2];
-	int paramFormats[2];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = 0;
-
-	string strOid = escapeSequence(p.objectId());
-	paramValues[0] = strOid.c_str();
-	paramValues[1] = binaryPoint;
-
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryPoint;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	
-	string command  = "UPDATE " + table + " SET";
-			command += "  object_id = $1";
-			command += ", spatial_data = $2::geometry";
-			command += " WHERE geom_id = ";
-			command += Te2String(p.geomId());
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryPoint;
-	
-	return (result == 1);
-}
-
-bool TePostGIS::locatePoint(const string& table, TeCoord2D& pt, TePoint& point, const double& tol)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox bbox(pt.x() - tol, pt.y() - tol, pt.x() + tol, pt.y() + tol);
-
-	string sql  = "SELECT * FROM ";
-	       sql += table;
-		   sql += " WHERE ";
-		   sql += this->getSQLBoxWhere(bbox, TePOINTS);
-
-	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	TePointSet ps;
-	
-	bool flag = true;
-
-	do 
-	{
-		TePoint point;
-		flag = portal->fetchGeometry(point);
-		ps.add(point);
-	}while(flag);
-
-	delete portal;
-	int k;
-	if(TeNearest(pt, ps, k, tol))
-	{
-		point = ps[k];
-		return true;
-	}
-	return false;
-}
-
-bool TePostGIS::insertNode(const string& table, TeNode& node)
-{
-	errorMessage_ = "";
-
-	TePoint p;
-	TeCoord2D nodeCoord(node.location().x(), node.location().y());
-	p.add(nodeCoord);
-
-	unsigned int sizeBinaryPoint = 2 * sizeof(double);
-	char* binaryPoint = TePointToWKBPoint(p, sizeBinaryPoint);
-
-	int nParams = 2;
-	Oid paramTypes[2];
-	const char *paramValues[2];
-	int paramLengths[2];
-	int paramFormats[2];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = 0;
-
-	string strOid = escapeSequence(node.objectId());
-	paramValues[0] = strOid.c_str();
-	paramValues[1] = binaryPoint;
-
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryPoint;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	
-
-	string command = "INSERT INTO ";
-			command += table;
-			command += " (object_id, spatial_data)";
-			command += " VALUES ($1, $2::geometry)";
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryPoint;
-
-	if(result != 1)
-		return false;
-
-	string sql = "SELECT currval('" + table + "_geom_id_seq')";
-	TePGRecordset rec;
-	rec.open(sql.c_str(), &tepg_connection_);
-	if(rec.recordCount() > 0)
-		node.geomId(rec.getInt(0));
-
-	rec.close();
-
-	return true;
-}
-
-bool TePostGIS::updateNode(const string& table, TeNode& node)
-{
-	errorMessage_ = "";
-
-	TePoint p;
-	TeCoord2D nodeCoord(node.location().x(), node.location().y());
-	p.add(nodeCoord);
-
-	unsigned int sizeBinaryPoint = 2 * sizeof(double);
-	char* binaryPoint = TePointToWKBPoint(p, sizeBinaryPoint);
-
-	int nParams = 2;
-	Oid paramTypes[2];
-	const char *paramValues[2];
-	int paramLengths[2];
-	int paramFormats[2];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = 0;
-
-	string strOid = escapeSequence(node.objectId());
-	paramValues[0] = strOid.c_str();
-	paramValues[1] = binaryPoint;
-
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryPoint;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	
-	string  command  = "UPDATE " + table + " SET";
-		    command += " object_id = $1";
-			command += ", spatial_data = $2::geometry";
-			command += " WHERE geom_id = ";
-			command += Te2String(node.geomId());
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryPoint;
-
-	return (result == 1);
-}
-
-bool TePostGIS::insertCell(const string& table, TeCell &c)
-{
-	errorMessage_ = "";
-
-	TePolygon p;
-	TeLinearRing ring;
-	ring.add(TeCoord2D(c.box().x1(), c.box().y1()));
-	ring.add(TeCoord2D(c.box().x2(), c.box().y1()));
-	ring.add(TeCoord2D(c.box().x2(), c.box().y2()));
-	ring.add(TeCoord2D(c.box().x1(), c.box().y2()));
-	ring.add(TeCoord2D(c.box().x1(), c.box().y1()));
-
-	p.add(ring);
-
-	unsigned int sizeBinaryPolygon = 0;
-	char* binaryPolygon = TePolygonToWKBPolygon(p, sizeBinaryPolygon);
-
-	int nParams = 4;
-	Oid paramTypes[4];
-	const char *paramValues[4];
-	int paramLengths[4];
-	int paramFormats[4];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = 0;
-	paramTypes[2] = PG_INT4_TYPE;
-	paramTypes[3] = PG_INT4_TYPE;
-
-	string strOid = escapeSequence(c.objectId());
-	paramValues[0] = strOid.c_str();
-	paramValues[1] = binaryPolygon;
-
-	string strCol = Te2String(c.column());
-	paramValues[2] = strCol.c_str();		
-
-	string strRow = Te2String(c.line());
-	paramValues[3] = strRow.c_str();	
-
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryPolygon;
-	paramLengths[2] = 0;
-	paramLengths[3] = 0;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	paramFormats[2] = 0;
-	paramFormats[3] = 0;
-
-	string command = "INSERT INTO ";
-			command += table;
-			command += " (object_id, spatial_data, col_number, row_number)";
-			command += " VALUES ($1, $2::geometry, $3, $4)";
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryPolygon;
-
-	if(result != 1)
-		return false;
-		
-
-	string sql = "SELECT currval('" + table + "_geom_id_seq')";
-	TePGRecordset rec;
-	rec.open(sql.c_str(), &tepg_connection_);
-	if(rec.recordCount() > 0)
-		c.geomId(rec.getInt(0));
-	
-	rec.close();	
-
-	return true;
-}
-
-bool TePostGIS::updateCell(const string& table, TeCell &c)
-{
-	errorMessage_ = "";
-
-	TePolygon p;
-	TeLinearRing ring;
-	ring.add(TeCoord2D(c.box().x1(), c.box().y1()));
-	ring.add(TeCoord2D(c.box().x2(), c.box().y1()));
-	ring.add(TeCoord2D(c.box().x2(), c.box().y2()));
-	ring.add(TeCoord2D(c.box().x1(), c.box().y2()));
-	ring.add(TeCoord2D(c.box().x1(), c.box().y1()));
-
-	p.add(ring);
-
-	unsigned int sizeBinaryPolygon = 0;
-	char* binaryPolygon = TePolygonToWKBPolygon(p, sizeBinaryPolygon);
-
-	int nParams = 4;
-	Oid paramTypes[4];
-	const char *paramValues[4];
-	int paramLengths[4];
-	int paramFormats[4];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = 0;
-	paramTypes[2] = PG_INT4_TYPE;
-	paramTypes[3] = PG_INT4_TYPE;
-
-	string strOid = escapeSequence(c.objectId());
-	paramValues[0] = strOid.c_str();
-	paramValues[1] = binaryPolygon;
-
-	string strCol = Te2String(c.column());
-	paramValues[2] = strCol.c_str();		
-
-	string strRow = Te2String(c.line());
-	paramValues[3] = strRow.c_str();	
-
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryPolygon;
-	paramLengths[2] = 0;
-	paramLengths[3] = 0;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	paramFormats[2] = 0;
-	paramFormats[3] = 0;
-
-	string command  = "UPDATE " + table + " SET";
-			command += " object_id = $1";
-			command += ", spatial_data = $2::geometry";
-			command += ", col_number = $3";
-			command += ", row_number = $4";
-			command += " WHERE geom_id = ";
-			command += Te2String(c.geomId());
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryPolygon;
-
-	return (result == 1);
-}
-
-bool TePostGIS::locateCell(const string& table, TeCoord2D& pt, TeCell& c, const double& tol)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-
-
-	string sql  ="SELECT * FROM ";
-	       sql += table;
-		   sql += " WHERE ";
-		   sql += this->getSQLBoxWhere(box, TeCELLS);
-
-	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	portal->fetchGeometry(c);
-
-	delete portal;
-
-	return true;
-}
-
-bool TePostGIS::removeGeometry(const string& tableName, const TeGeomRep& rep, const int& geomId)
-{
-	if(tableName.empty())
-	{
-		return false;
-	}
-
-	std::string remove = "DELETE FROM " + tableName;
-	remove += " WHERE geom_id = " + geomId;
-
-	return this->execute(remove);
-}
-
-bool TePostGIS::createSpatialIndex(const string& table, const string& column, TeSpatialIndexType /*type*/, short /*level*/, short /*tile*/)
-{
-// we need to find te type we are indexing: a box from PostgreSQL or a geometry from PostGIS.
-	string sql = "SELECT " + column + " FROM " + table + " WHERE 1 = 2";
-
-	TePGRecordset rec;
-
-	if(!rec.open(sql, &(TePostgreSQL::tepg_connection_)))
-	{
-		rec.close();
-		return false;
-	}
-
-	string create = "";
-
-	if(rec.fieldType(0) == PG_BOX_TYPE)
-	{
-		create = "CREATE INDEX sp_idx_" + table + " ON " + table + " USING GIST (" + column + " " + TePostgreSQL::gistBoxOps_ + ")";
-	}
-	else
-	{
-		create = "CREATE INDEX sp_idx_" + table + " ON " + table + " USING GIST (" + column + " GIST_GEOMETRY_OPS)";
-	}
-
-	rec.close();	
-
-	return this->execute(create);
-}
-
-string TePostGIS::getSQLBoxWhere(TeBox& box, TeGeomRep rep)
-{
-	if(rep == TeTEXT)
-		return TeDatabase::getSQLBoxWhere(box, rep);
-
-	string colname = "spatial_data";
-	
-	if(rep & TeRASTER)
-		return TePostgreSQL::getSQLBoxWhere(box, rep);
-
-	string wherebox  = "('" + PGBox_encode(box) + "'::box3d";
-		   wherebox += " && " + colname + ")";	
-
-	return wherebox;
-}
-
-string TePostGIS::getSQLBoxWhere(const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1)
-{
-	if((rep1 == TeTEXT) || (rep2 == TeTEXT))
-	{
-		return TeDatabase::getSQLBoxWhere(table1, table2, rep2, rep1);
-	}
-
-	string col1name = "spatial_data";
-	string col2name = "spatial_data";;
-
-	if(rep1 & TeRASTER)
-		col1name = "block_box";
-
-	if(rep2 & TeRASTER)
-		col2name = "block_box";
-
-	string wherebox  = "(";
-		   wherebox += table1;
-           wherebox += "." + col1name + " && ";
-           wherebox += table2;
-           wherebox += "." + col2name + ")";
-
-	return wherebox;
-}
-
-string TePostGIS::getSQLBoxSelect (const string& tableName, TeGeomRep rep)
-{
-	if(rep == TeTEXT)
-		return TeDatabase::getSQLBoxSelect(tableName, rep);
-
-	string colname = "spatial_data";
-
-	if(rep & TeRASTER)
-		return TePostgreSQL::getSQLBoxSelect(tableName, rep);
-
-	string select  = tableName +".* , ";
-			select += "xmin("  + tableName + "." + colname + ") as lower_x, ";
-			select += "ymin("  + tableName + "." + colname + ") as lower_y, ";
-			select += "xmax("  + tableName + "." + colname + ") as upper_x, ";
-			select += "ymax("  + tableName + "." + colname + ") as upper_y ";
-
-	return select;
-}
-
-bool TePostGIS::getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom)
-{
-// we need to find the type we are computing bounding box: a box from PostgreSQL or a geometry from PostGIS.
-	string sql = "SELECT " + colGeom + " FROM " + tableGeom + " WHERE 1 = 2";
-
-	TePGRecordset rec;
-
-	if(!rec.open(sql, &(TePostgreSQL::tepg_connection_)))
-	{
-		rec.close();
-		return false;
-	}
-
-	if(rec.fieldType(0) == PG_BOX_TYPE)	// use the TePostgreSQL method
-	{
-		rec.close();
-
-		return TePostgreSQL::getMBRGeom(tableGeom, object_id, box, colGeom);
-	}
-
-	rec.close();
-
-// if we are here, so it is a PostGIS geometry: in this case we can use the function extent
-
-	TeDatabasePortal* portal = getPortal();
-	if(!portal)
-		return false;
-
-	string sel = "SELECT extent(" +  colGeom + ") FROM " + tableGeom;
-	sel += " WHERE object_id = '" + object_id + "'";
-
-	if(!portal->query(sel)|| !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	box = PGBox_decode(portal->getData(0));
-
-	delete portal;
-	return true;
-}
-
-bool TePostGIS::getMBRSelectedObjects(string geomTable, string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType, TeBox& bout, const double& tol)
-{
-	if(repType == TeTEXT)
-		return TeDatabase::getMBRSelectedObjects(geomTable, colGeom, fromClause, whereClause, afterWhereClause, repType, bout, tol);
-
-	if(repType == TeRASTER)
-		return TePostgreSQL::getMBRSelectedObjects(geomTable, colGeom, fromClause, whereClause, afterWhereClause, repType, bout, tol);
-
-	TeDatabasePortal* portal = getPortal();
-	
-	if (!portal)
-		return false;
-
-	string	fields = "extent(" + geomTable + "." + colGeom + ")::BOX3D";
-	string	query  = " SELECT " + fields;
-			query += " FROM " + fromClause; 
-
-	if(!whereClause.empty())
-		query += " WHERE " + whereClause;		
-
-	if(portal->query(query) && portal->fetchRow())
-
-
-	{
-		TeBox aux(PGBox_decode(portal->getData(0)));
-		bout = aux;
-
-		delete portal;
-		return true;
-	}	
-
-	delete portal;	
-
-	return false;
-}
-
-string TePostGIS::getSpatialIdxColumn(TeGeomRep rep)
-{
-	if (rep == TeRASTER)
-		return "block_box";
-
-	return "spatial_data";
-}
-
-TePostGISPortal::TePostGISPortal(TeDatabase *pDatabase)
-{
-	db_ = pDatabase;
-	con_ = &((static_cast<TePostGIS*>(pDatabase))->tepg_connection_);
-}
-
-bool TePostGISPortal::fetchGeometry(TePolygon& pol)
-{
-	errorMessage_ = "";
-	
-	tepg_recordset_.getPGISPolygon("spatial_data", pol);
-	pol.geomId(tepg_recordset_.getInt("geom_id"));
-	pol.objectId(tepg_recordset_.getData("object_id"));	
-
-	return fetchRow();
-}
-
-bool TePostGISPortal::fetchGeometry(TePolygon& pol, const unsigned int& initIndex)
-{
-	errorMessage_ = "";
-	
-	tepg_recordset_.getPGISPolygon(initIndex+2, pol);
-	pol.geomId(tepg_recordset_.getInt(initIndex));
-	pol.objectId(tepg_recordset_.getData(initIndex+1));	
-
-	return fetchRow();
-}
-
-bool TePostGISPortal::fetchGeometry(TeLine2D& line)
-{
-	errorMessage_ = "";
-
-	tepg_recordset_.getPGISLine("spatial_data", line);
-	line.geomId(tepg_recordset_.getInt("geom_id"));
-	line.objectId(tepg_recordset_.getData("object_id"));
-
-	return fetchRow();
-}
-
-bool TePostGISPortal::fetchGeometry(TeLine2D& line, const unsigned int& initIndex)
-{
-	errorMessage_ = "";
-
-	tepg_recordset_.getPGISLine(initIndex+2, line);
-	line.geomId(tepg_recordset_.getInt(initIndex));
-	line.objectId(tepg_recordset_.getData(initIndex+1));
-
-	return fetchRow();
-}
-
-bool TePostGISPortal::fetchGeometry(TeNode& n)
-{
-	errorMessage_ = "";
-
-	TePoint p;
-	tepg_recordset_.getPGISPoint("spatial_data", p);
-	n.add(p.location());
-	n.geomId(tepg_recordset_.getInt("geom_id"));
-	n.objectId(tepg_recordset_.getData("object_id"));
-
-	return fetchRow();
-}
-
-bool TePostGISPortal::fetchGeometry(TeNode& n, const unsigned int& initIndex)
-{
-	errorMessage_ = "";
-
-	TePoint p;
-	tepg_recordset_.getPGISPoint(initIndex+2, p);
-	n.add(p.location());
-	n.geomId(tepg_recordset_.getInt(initIndex));
-	n.objectId(tepg_recordset_.getData(initIndex+1));
-
-	return fetchRow();
-}
-
-bool TePostGISPortal::fetchGeometry(TePoint& p)
-{
-	errorMessage_ = "";
-	
-	tepg_recordset_.getPGISPoint("spatial_data", p);
-	p.geomId(tepg_recordset_.getInt("geom_id"));
-	p.objectId(tepg_recordset_.getData("object_id"));
-		
-	return fetchRow();
-}
-
-bool TePostGISPortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
-{
-	errorMessage_ = "";
-	
-	tepg_recordset_.getPGISPoint(initIndex+2, p);
-	p.geomId(tepg_recordset_.getInt(initIndex));
-	p.objectId(tepg_recordset_.getData(initIndex+1));
-		
-	return fetchRow();
-}
-
-bool TePostGISPortal::fetchGeometry(TeCell& cell)
-{
-	errorMessage_ = "";
-
-	TePolygon pol;
-	tepg_recordset_.getPGISPolygon("spatial_data", pol);
-
-	cell.geomId(tepg_recordset_.getInt("geom_id"));
-	cell.objectId(tepg_recordset_.getData("object_id"));
-	cell.setBox (pol.box());
-	cell.column(tepg_recordset_.getInt("col_number"));
-	cell.line(tepg_recordset_.getInt("row_number"));
-
-	return fetchRow();
-}
-
-bool TePostGISPortal::fetchGeometry(TeCell& cell, const unsigned int& initIndex)
-{
-	errorMessage_ = "";
-
-	TePolygon pol;
-	tepg_recordset_.getPGISPolygon(initIndex+2, pol);
-
-	cell.geomId(tepg_recordset_.getInt(initIndex));
-	cell.objectId(tepg_recordset_.getData(initIndex+1));
-	cell.setBox (pol.box());
-	cell.column(tepg_recordset_.getInt(initIndex+3));
-	cell.line(tepg_recordset_.getInt(initIndex+4));
-
-	return fetchRow();
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TePostGIS.h"
+#include "TePGUtils.h"
+
+#define BUFFSIZE                1024
+
+TePostGIS::TePostGIS()
+{
+	dbmsName_ = "PostGIS";
+}
+ 
+bool TePostGIS::newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port, bool terralibModel, const std::string& characterSet)
+{
+	errorMessage_ = "";
+
+	string createDB  = "CREATE DATABASE ";
+	       createDB += "\"" + database + "\"";
+		   createDB += " TEMPLATE = template_postgis";
+
+   if(!characterSet.empty())
+	{
+		createDB += " ENCODING = '" + characterSet + "'";
+	}
+
+	if(!connect(host, user, password, "template_postgis", port))
+	{
+		close();
+		return false;
+	}
+		
+	bool connected = false;
+	
+	if(execute(createDB))
+	{
+		connected = connect(host, user, password, database, port);
+	}
+	else
+	{
+		std::string errMessage = errorMessage();
+		close();
+		errorMessage_ = errMessage;
+		return false;
+	}
+
+	if(terralibModel)
+	{
+		//create conceptual model
+		if(connected)
+		{
+			if(!createConceptualModel())
+			{
+				close();
+				return false;
+			}
+		}
+		else
+		{
+			close();
+			return false;
+		}
+	}
+
+	return true;
+}
+
+bool TePostGIS::connect(const string& host, const string& user, const string& password, const string& database, int port)
+{
+	if(!realConnect(host, user, password, database, port))
+		return false;
+
+// see if PostGIS is present
+	TePGRecordset rec;
+
+	string sql = "SELECT postgis_version()";
+
+	if(!rec.open(sql.c_str(), &tepg_connection_) || rec.recordCount() <= 0)
+	{
+		rec.close();
+
+		this->close();
+
+		errorMessage_ = "Couldn't find PostGIS extension! You may use the PostgreSQL driver!";
+
+		return false;	
+	}
+
+// see if RTree GiST is present for box: it must be present
+	int version = PQserverVersion(tepg_connection_.c_ptr());
+	if(version >= 80100)
+	{
+		gistBoxOps_ = "box_ops";
+		return true;
+	}
+
+	sql = "SELECT opcname FROM pg_opclass WHERE (opcname = 'gist_box_ops') ORDER BY opcname DESC";
+
+	if(rec.open(sql.c_str(), &tepg_connection_) && rec.recordCount() > 0)
+	{
+		TePostgreSQL::gistBoxOps_ = rec.value(0);
+		rec.close();
+
+		return true;
+	}
+
+	rec.close();
+
+	this->close();
+
+	errorMessage_ = "GiST extension not found! Please, install R-Tree GiST in your database and try again!";
+
+	return false;	
+}
+
+bool TePostGIS::showDatabases(const string& host, const string& user, const string& password, vector<string>& dbNames, int port)
+{
+	errorMessage_ = "";
+
+	if(TePostgreSQL::realConnect(host, user, password, "template1", port))
+	{
+		string sql = "SELECT datname FROM pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY datname";
+
+		TePostGISPortal p(this);
+
+		if(p.query(sql) && p.fetchRow())
+		{
+			do
+			{
+				dbNames.push_back(p.getData("datname"));
+			}while(p.fetchRow());
+
+			return true;
+		}
+		else
+			errorMessage_ = "Didn't find any database!";
+	}
+	
+	return false;
+}
+
+TeDatabasePortal* TePostGIS::getPortal()
+{
+	errorMessage_ = "";
+
+	TeDatabasePortal *portal = new TePostGISPortal(this);
+
+	return portal;
+}
+
+bool TePostGIS::createTable(const string& table, TeAttributeList &attr)
+{
+	errorMessage_ = "";
+
+	bool first = true;
+
+	TeAttributeList::iterator it = attr.begin();
+	
+	string createTable ="CREATE TABLE " + table +" (";
+	
+	string type;
+	char	size[8];
+
+	string pkeys;
+
+	vector<string> addGeomColumnsSQL;
+	string addGeomSQL = "";
+
+	while(it != attr.end())
+	{
+		switch ((*it).rep_.type_)
+		{
+			case TeSTRING:		if((*it).rep_.numChar_ > 0)
+								{
+									type = "VARCHAR(" + Te2String((*it).rep_.numChar_) + ")";
+								}
+								else
+								{
+									type = "TEXT";
+								}
+								break;
+
+			case TeREAL:		type = "FLOAT8";
+								break;
+
+			case TeINT:
+			case TeUNSIGNEDINT:
+								type = ((*it).rep_.isAutoNumber_) ? "SERIAL" : "INTEGER";
+								break;
+
+			case TeBLOB:		//type = "OID";
+				                type = "BYTEA";
+								break;
+
+			case TeDATETIME:	type = "TIMESTAMP(0)";
+								break;
+
+			case TeCHARACTER:	type = "CHAR ";
+								sprintf (size, "(%d)", (*it).rep_.numChar_);
+								type += string (size);
+								break;
+
+			case TeBOOLEAN:		type = "BOOLEAN";
+								break;
+
+			case TePOINTTYPE:
+			case TePOINTSETTYPE:
+								addGeomSQL = "SELECT AddGeometryColumn('";
+								addGeomSQL += TeConvertToLowerCase(table);
+								addGeomSQL += "', 'spatial_data', ";
+								addGeomSQL += " -1, 'POINT', 2)";
+
+								addGeomColumnsSQL.push_back(addGeomSQL);
+
+								++it;
+								continue;
+
+			case TeLINE2DTYPE:
+			case TeLINESETTYPE:							
+								addGeomSQL  = "SELECT AddGeometryColumn('";
+								addGeomSQL += TeConvertToLowerCase(table);
+								addGeomSQL += "', 'spatial_data',";
+								addGeomSQL += " -1, 'LINESTRING', 2)";
+
+								addGeomColumnsSQL.push_back(addGeomSQL);
+
+								++it;
+								continue;
+
+			case TePOLYGONTYPE:
+			case TePOLYGONSETTYPE:
+								addGeomSQL  = "SELECT AddGeometryColumn('";
+								addGeomSQL += TeConvertToLowerCase(table);
+								addGeomSQL += "', 'spatial_data',";
+								addGeomSQL += " -1, 'POLYGON', 2)";
+
+								addGeomColumnsSQL.push_back(addGeomSQL);
+
+								++it;
+								continue;
+
+			case TeCELLTYPE:
+			case TeCELLSETTYPE:
+								if(!first)
+									createTable += ", ";
+								else
+									first = false;
+
+								addGeomSQL  = "SELECT AddGeometryColumn('";
+								addGeomSQL += TeConvertToLowerCase(table);
+								addGeomSQL += "', 'spatial_data',";
+								addGeomSQL += " -1, 'POLYGON', 2)";
+
+								addGeomColumnsSQL.push_back(addGeomSQL);
+
+								createTable += " col_number   INTEGER      NOT NULL,";
+								createTable += " row_number	INTEGER      NOT NULL ";
+								++it;
+								continue;					
+
+			case TeRASTERTYPE:
+								if(!first)
+									createTable += ", ";
+								else
+									first = false;
+
+								createTable += " block_box         BOX         NOT NULL,";
+								createTable += " band_id		     INTEGER     NOT NULL,";		   
+								createTable += " resolution_factor INTEGER     NOT NULL,";
+								createTable += " subband		     INTEGER     NOT NULL,";		   
+								createTable += " spatial_data      BYTEA,";
+								createTable += " block_size        INTEGER  NOT NULL ";
+		   						++it;
+								continue;
+
+			case TeNODETYPE:
+			case TeNODESETTYPE:
+								addGeomSQL = "SELECT AddGeometryColumn('";
+								addGeomSQL += TeConvertToLowerCase(table);
+								addGeomSQL += "', 'spatial_data', ";
+								addGeomSQL += " -1, 'POINT', 2)";
+
+								addGeomColumnsSQL.push_back(addGeomSQL);
+
+								++it;
+								continue;
+
+			case TeTEXTTYPE:
+			case TeTEXTSETTYPE:
+
+			default:			type = "VARCHAR ";
+								sprintf (size, "(%d)", (*it).rep_.numChar_);
+								type += string (size);
+								break;
+		}
+
+		if(!((*it).rep_.defaultValue_.empty()))
+			type += " DEFAULT '" + (*it).rep_.defaultValue_ + "' ";
+
+		if(!((*it).rep_.null_))
+			type += " NOT NULL ";
+		
+		if(!first)
+			createTable += ",  ";
+		else
+			first = false;
+
+		createTable += (*it).rep_.name_ + " ";
+		createTable += type;
+
+		// check if column is part of primary key
+		if((*it).rep_.isPrimaryKey_ && (*it).rep_.type_ != TeBLOB )
+		{
+			if(!pkeys.empty())
+				pkeys += ", ";
+			
+			pkeys += (*it).rep_.name_;
+		}
+
+
+		++it;
+	}
+
+	if(!pkeys.empty())
+	{	string pk = ", PRIMARY KEY(";
+	           pk += pkeys;
+			   pk += ")";
+
+		createTable += pk;
+	}
+
+
+	createTable += ");";
+
+	if(!execute(createTable))
+		return false;
+
+	for(unsigned int i = 0; i < addGeomColumnsSQL.size(); ++i)
+	{
+		if(!execute(addGeomColumnsSQL[i]))
+			return false;
+	}
+
+	return true;
+}
+
+bool TePostGIS::generateLabelPositions(TeTheme *theme, const std::string& objectId)
+{
+	string	geomTable, upd;
+	string	collTable = theme->collectionTable();
+	
+	if((collTable.empty()) || (!tableExist(collTable)))
+		return false;
+
+	if(theme->layer()->hasGeometry(TeCELLS)    || 
+	   theme->layer()->hasGeometry(TePOLYGONS) ||
+	   theme->layer()->hasGeometry(TeLINES)    ||
+	   theme->layer()->hasGeometry(TePOINTS))
+	{
+		geomTable = theme->layer()->tableName(TeCELLS);
+		
+		if(geomTable.empty())
+		{
+			geomTable = theme->layer()->tableName(TePOLYGONS);
+			if(geomTable.empty())
+			{
+				geomTable = theme->layer()->tableName(TeLINES);
+
+				if(geomTable.empty())
+					geomTable = theme->layer()->tableName(TePOINTS);
+			}
+		}
+		
+		upd= " UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(xmin(spatial_data::box3d) + (xmax(spatial_data::box3d)";
+		upd += " -  xmin(spatial_data::box3d)) / 2.0) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(ymin(spatial_data::box3d) + (ymax(spatial_data::box3d)";
+		upd += " - ymin(spatial_data::box3d)) / 2.0) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+
+		upd += " WHERE (label_x IS NULL) OR (label_y IS NULL)";
+	}	
+
+	if (!objectId.empty())
+		upd += " AND c_object_id='"+objectId+"'";
+		
+	return execute(upd);
+}
+
+
+bool TePostGIS::selectPolygonSet(const string& table, const string& criteria, TePolygonSet& ps)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	
+	string sql ="SELECT * FROM " + table;
+	
+	if(!criteria.empty())
+		sql += " WHERE " + criteria;
+	
+	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		ps.add(poly);
+	}
+	while(flag);
+
+	delete portal;
+
+	return true;
+}
+
+bool TePostGIS::loadPolygonSet(TeTheme* theme, TePolygonSet& ps)
+{
+	string collTable = theme->collectionTable();
+	
+	if(collTable.empty())
+		return false;
+
+	TeLayer* themeLayer = theme->layer();
+
+	if(!themeLayer->hasGeometry(TePOLYGONS))
+		return false;
+	
+	string polygonTable = themeLayer->tableName(TePOLYGONS);
+
+	if(polygonTable.empty())
+		return false;
+
+	string sql  = "SELECT * FROM (" + polygonTable + " RIGHT JOIN " + collTable;
+	       sql += " ON " + polygonTable + ".object_id = " + collTable + ".c_object_id)";
+	
+	TeDatabasePortal *portal = this->getPortal();
+	
+	if(!portal)
+		return false;
+
+	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		ps.add ( poly );
+	}
+	while(flag);		
+	
+	delete portal;
+	
+	return true;
+}
+
+bool TePostGIS::loadPolygonSet(const string& table, const string& geoid, TePolygonSet& ps)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	
+	string q ="SELECT * FROM " + table;
+
+	if (!geoid.empty())
+		q += " WHERE object_id = '" + geoid +"'";
+	
+	if (!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		ps.add(poly);
+	}
+	while (flag);
+
+	delete portal;
+
+	return true;
+}
+
+bool TePostGIS::loadPolygonSet(const string& table, TeBox& box, TePolygonSet& ps)
+{
+	TeDatabasePortal *portal = this->getPortal();
+
+	if(!portal)
+		return false;
+
+	string q = "SELECT * FROM " + table + " WHERE ";
+	       q += this->getSQLBoxWhere (box, TePOLYGONS, table);
+
+	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		ps.add(poly);
+	}
+	while (flag);
+
+	delete portal;
+
+	return true;
+}
+
+TeDatabasePortal* TePostGIS::loadPolygonSet(const string& table, TeBox& box)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	
+	if(!portal)
+		return 0;
+
+	string q = "SELECT * FROM " + table + " WHERE ";
+	       q += this->getSQLBoxWhere(box, TePOLYGONS, table);
+
+	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return 0;
+	}
+	else 
+		return portal;
+}
+
+bool TePostGIS::locatePolygon(const string& table, TeCoord2D& pt, TePolygon& polygon, const double& tol)
+{
+	TeDatabasePortal *portal = this->getPortal();
+
+	if (!portal)
+		return false;
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+
+
+	string sql  = "SELECT * FROM ";
+	       sql += table;
+		   sql += " WHERE ";
+		   sql += getSQLBoxWhere(box, TePOLYGONS, table);
+	
+	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+
+	do
+	{
+		TePolygon poly;
+
+		flag = portal->fetchGeometry(poly);
+
+		if(TeWithin(TePoint(pt), poly))
+		{
+			polygon = poly;
+			delete portal;
+			return true;
+		}
+	}
+	while(flag);
+	
+	delete portal;
+	
+	return false;
+}
+
+bool TePostGIS::locatePolygonSet(const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	
+	if (!portal)
+		return false;
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+
+
+	string sql  = "SELECT * FROM ";
+	       sql += table;
+		   sql += " WHERE ";
+		   sql += getSQLBoxWhere(box, TePOLYGONS, table);
+
+	if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}	
+	bool flag = true;
+	
+	polygons.clear();
+	
+	do
+	{
+		TePolygon poly;
+
+		flag = portal->fetchGeometry(poly);
+
+		if(TeWithin(TePoint(pt), poly))
+			polygons.add(poly);
+	}
+	while (flag);
+
+	delete portal;
+
+	if(polygons.size())
+		return (true);
+
+	return false;
+}
+
+bool TePostGIS::insertPolygon(const string& table, TePolygon &p)
+{
+	errorMessage_ = "";
+
+	unsigned int sizeBinaryPolygon = 0;
+	char* binaryPolygon = TePolygonToWKBPolygon(p, sizeBinaryPolygon);
+
+	int nParams = 2;
+	Oid paramTypes[2];
+	const char *paramValues[2];
+	int paramLengths[2];
+	int paramFormats[2];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = 0;
+
+	string strOid = escapeSequence(p.objectId());
+	paramValues[0] = strOid.c_str();
+	paramValues[1] = binaryPolygon;
+
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryPolygon;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	
+
+	string command = "INSERT INTO ";
+			command += table;
+			command += " (object_id, spatial_data)";//::geometry
+			command += " VALUES ($1, $2::geometry)";
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryPolygon;
+			
+	if(result == 1)
+	{
+		string sql = "SELECT currval('" + table + "_geom_id_seq')";
+		
+		TePGRecordset rec;
+		rec.open(sql.c_str(), &tepg_connection_);
+		if(rec.recordCount() > 0)
+		{
+			p.geomId(rec.getInt(0));
+			for(register unsigned int i = 0; i < p.size(); ++i)
+			{
+				p[i].geomId(rec.getInt(0));
+			}
+		}
+
+		rec.close();
+	}
+	else
+		return false;
+
+	return true;
+}
+
+bool TePostGIS::updatePolygon(const string& table, TePolygon &p)
+{
+	errorMessage_ = "";
+
+	unsigned int sizeBinaryPolygon = 0;
+	char* binaryPolygon = TePolygonToWKBPolygon(p, sizeBinaryPolygon);
+
+	int nParams = 2;
+	Oid paramTypes[2];
+	const char *paramValues[2];
+	int paramLengths[2];
+	int paramFormats[2];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = 0;
+
+	string strOid = escapeSequence(p.objectId());
+	paramValues[0] = strOid.c_str();
+	paramValues[1] = binaryPolygon;
+
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryPolygon;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	
+	string command = "UPDATE " + table + " SET";
+	command += " object_id = $1";
+	command += ", spatial_data = $2::geometry";
+	command += " WHERE geom_id = ";
+    command += Te2String(p.geomId());
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryPolygon;
+
+	return (result == 1);
+}
+
+bool TePostGIS::loadLineSet(const string& table, const string& geoid, TeLineSet& ls)
+{
+	TeDatabasePortal *portal = this->getPortal();
+
+	string q ="SELECT * FROM " + table;
+
+	if(!geoid.empty())
+		q += " WHERE object_id = '" + geoid +"'";
+
+	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+
+	do 
+	{
+		TeLine2D line;
+		flag = portal->fetchGeometry(line);
+		ls.add (line);
+	}while(flag);
+
+	delete portal;
+
+	return true;
+}
+
+bool TePostGIS::loadLineSet(const string& table, TeBox& box, TeLineSet& linSet)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	
+	if(!portal)
+		return false;
+
+	string q  = "SELECT * FROM " + table + " WHERE ";
+	       q += this->getSQLBoxWhere (box, TeLINES, table);       
+
+	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+
+	do
+	{
+		TeLine2D lin;
+		flag = portal->fetchGeometry(lin);
+		linSet.add(lin);
+	}
+	while (flag);
+
+	delete portal;
+
+	return true;
+}
+
+TeDatabasePortal* TePostGIS::loadLineSet(const string& table, TeBox& box)
+{
+	TeDatabasePortal *portal = this->getPortal();
+
+	if(!portal)
+		return 0;
+
+	string q  = "SELECT * FROM " + table + " WHERE ";
+	       q += this->getSQLBoxWhere (box, TeLINES, table);
+	       
+
+	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+
+		return 0;
+	}
+
+	return portal;
+}
+
+bool TePostGIS::insertLine(const string& table, TeLine2D& l)
+{
+	errorMessage_ = "";
+
+	unsigned int sizeBinaryRing = 0;
+	char* binaryRing = TeLine2DToWKBLineString(l, sizeBinaryRing);
+
+	int nParams = 2;
+	Oid paramTypes[2];
+	const char *paramValues[2];
+	int paramLengths[2];
+	int paramFormats[2];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = 0;
+
+	string strOid = escapeSequence(l.objectId());
+	paramValues[0] = strOid.c_str();
+	paramValues[1] = binaryRing;
+
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryRing;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	
+
+	string command = "INSERT INTO ";
+			command += table;
+			command += " (object_id, spatial_data)";
+			command += " VALUES ($1, $2::geometry)";
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryRing;
+
+	if(result == 1)
+	{
+		string sql = "SELECT currval('" + table + "_geom_id_seq')";
+
+		TePGRecordset rec;
+		rec.open(sql.c_str(), &tepg_connection_);
+
+		if(rec.recordCount() > 0)
+			l.geomId(rec.getInt(0));
+
+		rec.close();
+	}
+	else
+		return false;
+
+	return true;
+}
+
+bool TePostGIS::updateLine(const string& table, TeLine2D& l)
+{
+	errorMessage_ = "";
+
+		unsigned int sizeBinaryRing = 0;
+	char* binaryRing = TeLine2DToWKBLineString(l, sizeBinaryRing);
+
+	int nParams = 2;
+	Oid paramTypes[2];
+	const char *paramValues[2];
+	int paramLengths[2];
+	int paramFormats[2];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = 0;
+
+	string strOid = escapeSequence(l.objectId());
+	paramValues[0] = strOid.c_str();
+	paramValues[1] = binaryRing;
+
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryRing;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+
+	string command  = "UPDATE " + table + " SET";
+		   command += " obejct_id = $1";
+		   command += ", spatial_data = $2::geometry";
+		   command += " WHERE geom_id = ";
+		   command += Te2String(l.geomId());		
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryRing;
+
+	return (result == 1);
+}
+
+bool TePostGIS::locateLine(const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+
+	string sql  = "SELECT * FROM ";
+	       sql += table;
+		   sql += " WHERE ";
+		   sql += this->getSQLBoxWhere(box, TeLINES, table);
+	
+	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	// Get all lines
+	TeLineSet ls;
+	int k;
+	bool flag = true;
+	do 
+	{
+		TeLine2D l;
+		flag = portal->fetchGeometry( l );
+		ls.add ( l );
+	} while(flag);
+
+	delete portal;
+
+	TeCoord2D paux;
+
+	if(TeNearest(pt, ls, k, paux, tol))
+	{
+		line = ls[k];
+		return true;
+	}
+
+	return false;
+}
+
+bool TePostGIS::insertPoint(const string& table, TePoint &p)
+{
+	errorMessage_ = "";
+
+	unsigned int sizeBinaryPoint = 2 * sizeof(double);
+	char* binaryPoint = TePointToWKBPoint(p, sizeBinaryPoint);
+
+	int nParams = 2;
+	Oid paramTypes[2];
+	const char *paramValues[2];
+	int paramLengths[2];
+	int paramFormats[2];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = 0;
+
+	string strOid = escapeSequence(p.objectId());
+	paramValues[0] = strOid.c_str();
+	paramValues[1] = binaryPoint;
+
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryPoint;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	
+
+	string command = "INSERT INTO ";
+			command += table;
+			command += " (object_id, spatial_data)";
+			command += " VALUES ($1, $2::geometry)";
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryPoint;
+
+	if(result == 1)
+	{
+		string sql = "SELECT currval('" + table + "_geom_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql.c_str(), &tepg_connection_);
+		if(rec.recordCount() > 0)
+			p.geomId(rec.getInt(0));
+
+		rec.close();
+	}
+	else
+		return false;
+	
+	return true;
+}
+
+bool TePostGIS::updatePoint(const string& table, TePoint &p)
+{
+	errorMessage_ = "";
+
+	unsigned int sizeBinaryPoint = 2 * sizeof(double);
+	char* binaryPoint = TePointToWKBPoint(p, sizeBinaryPoint);
+
+	int nParams = 2;
+	Oid paramTypes[2];
+	const char *paramValues[2];
+	int paramLengths[2];
+	int paramFormats[2];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = 0;
+
+	string strOid = escapeSequence(p.objectId());
+	paramValues[0] = strOid.c_str();
+	paramValues[1] = binaryPoint;
+
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryPoint;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	
+	string command  = "UPDATE " + table + " SET";
+			command += "  object_id = $1";
+			command += ", spatial_data = $2::geometry";
+			command += " WHERE geom_id = ";
+			command += Te2String(p.geomId());
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryPoint;
+	
+	return (result == 1);
+}
+
+bool TePostGIS::locatePoint(const string& table, TeCoord2D& pt, TePoint& point, const double& tol)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox bbox(pt.x() - tol, pt.y() - tol, pt.x() + tol, pt.y() + tol);
+
+	string sql  = "SELECT * FROM ";
+	       sql += table;
+		   sql += " WHERE ";
+		   sql += this->getSQLBoxWhere(bbox, TePOINTS, table);
+
+	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	TePointSet ps;
+	
+	bool flag = true;
+
+	do 
+	{
+		TePoint point;
+		flag = portal->fetchGeometry(point);
+		ps.add(point);
+	}while(flag);
+
+	delete portal;
+	int k;
+	if(TeNearest(pt, ps, k, tol))
+	{
+		point = ps[k];
+		return true;
+	}
+	return false;
+}
+
+bool TePostGIS::insertNode(const string& table, TeNode& node)
+{
+	errorMessage_ = "";
+
+	TePoint p;
+	TeCoord2D nodeCoord(node.location().x(), node.location().y());
+	p.add(nodeCoord);
+
+	unsigned int sizeBinaryPoint = 2 * sizeof(double);
+	char* binaryPoint = TePointToWKBPoint(p, sizeBinaryPoint);
+
+	int nParams = 2;
+	Oid paramTypes[2];
+	const char *paramValues[2];
+	int paramLengths[2];
+	int paramFormats[2];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = 0;
+
+	string strOid = escapeSequence(node.objectId());
+	paramValues[0] = strOid.c_str();
+	paramValues[1] = binaryPoint;
+
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryPoint;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	
+
+	string command = "INSERT INTO ";
+			command += table;
+			command += " (object_id, spatial_data)";
+			command += " VALUES ($1, $2::geometry)";
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryPoint;
+
+	if(result != 1)
+		return false;
+
+	string sql = "SELECT currval('" + table + "_geom_id_seq')";
+	TePGRecordset rec;
+	rec.open(sql.c_str(), &tepg_connection_);
+	if(rec.recordCount() > 0)
+		node.geomId(rec.getInt(0));
+
+	rec.close();
+
+	return true;
+}
+
+bool TePostGIS::updateNode(const string& table, TeNode& node)
+{
+	errorMessage_ = "";
+
+	TePoint p;
+	TeCoord2D nodeCoord(node.location().x(), node.location().y());
+	p.add(nodeCoord);
+
+	unsigned int sizeBinaryPoint = 2 * sizeof(double);
+	char* binaryPoint = TePointToWKBPoint(p, sizeBinaryPoint);
+
+	int nParams = 2;
+	Oid paramTypes[2];
+	const char *paramValues[2];
+	int paramLengths[2];
+	int paramFormats[2];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = 0;
+
+	string strOid = escapeSequence(node.objectId());
+	paramValues[0] = strOid.c_str();
+	paramValues[1] = binaryPoint;
+
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryPoint;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	
+	string  command  = "UPDATE " + table + " SET";
+		    command += " object_id = $1";
+			command += ", spatial_data = $2::geometry";
+			command += " WHERE geom_id = ";
+			command += Te2String(node.geomId());
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryPoint;
+
+	return (result == 1);
+}
+
+bool TePostGIS::insertCell(const string& table, TeCell &c)
+{
+	errorMessage_ = "";
+
+	TePolygon p;
+	TeLinearRing ring;
+	ring.add(TeCoord2D(c.box().x1(), c.box().y1()));
+	ring.add(TeCoord2D(c.box().x2(), c.box().y1()));
+	ring.add(TeCoord2D(c.box().x2(), c.box().y2()));
+	ring.add(TeCoord2D(c.box().x1(), c.box().y2()));
+	ring.add(TeCoord2D(c.box().x1(), c.box().y1()));
+
+	p.add(ring);
+
+	unsigned int sizeBinaryPolygon = 0;
+	char* binaryPolygon = TePolygonToWKBPolygon(p, sizeBinaryPolygon);
+
+	int nParams = 4;
+	Oid paramTypes[4];
+	const char *paramValues[4];
+	int paramLengths[4];
+	int paramFormats[4];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = 0;
+	paramTypes[2] = PG_INT4_TYPE;
+	paramTypes[3] = PG_INT4_TYPE;
+
+	string strOid = escapeSequence(c.objectId());
+	paramValues[0] = strOid.c_str();
+	paramValues[1] = binaryPolygon;
+
+	string strCol = Te2String(c.column());
+	paramValues[2] = strCol.c_str();		
+
+	string strRow = Te2String(c.line());
+	paramValues[3] = strRow.c_str();	
+
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryPolygon;
+	paramLengths[2] = 0;
+	paramLengths[3] = 0;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	paramFormats[2] = 0;
+	paramFormats[3] = 0;
+
+	string command = "INSERT INTO ";
+			command += table;
+			command += " (object_id, spatial_data, col_number, row_number)";
+			command += " VALUES ($1, $2::geometry, $3, $4)";
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryPolygon;
+
+	if(result != 1)
+		return false;
+		
+
+	string sql = "SELECT currval('" + table + "_geom_id_seq')";
+	TePGRecordset rec;
+	rec.open(sql.c_str(), &tepg_connection_);
+	if(rec.recordCount() > 0)
+		c.geomId(rec.getInt(0));
+	
+	rec.close();	
+
+	return true;
+}
+
+bool TePostGIS::updateCell(const string& table, TeCell &c)
+{
+	errorMessage_ = "";
+
+	TePolygon p;
+	TeLinearRing ring;
+	ring.add(TeCoord2D(c.box().x1(), c.box().y1()));
+	ring.add(TeCoord2D(c.box().x2(), c.box().y1()));
+	ring.add(TeCoord2D(c.box().x2(), c.box().y2()));
+	ring.add(TeCoord2D(c.box().x1(), c.box().y2()));
+	ring.add(TeCoord2D(c.box().x1(), c.box().y1()));
+
+	p.add(ring);
+
+	unsigned int sizeBinaryPolygon = 0;
+	char* binaryPolygon = TePolygonToWKBPolygon(p, sizeBinaryPolygon);
+
+	int nParams = 4;
+	Oid paramTypes[4];
+	const char *paramValues[4];
+	int paramLengths[4];
+	int paramFormats[4];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = 0;
+	paramTypes[2] = PG_INT4_TYPE;
+	paramTypes[3] = PG_INT4_TYPE;
+
+	string strOid = escapeSequence(c.objectId());
+	paramValues[0] = strOid.c_str();
+	paramValues[1] = binaryPolygon;
+
+	string strCol = Te2String(c.column());
+	paramValues[2] = strCol.c_str();		
+
+	string strRow = Te2String(c.line());
+	paramValues[3] = strRow.c_str();	
+
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryPolygon;
+	paramLengths[2] = 0;
+	paramLengths[3] = 0;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	paramFormats[2] = 0;
+	paramFormats[3] = 0;
+
+	string command  = "UPDATE " + table + " SET";
+			command += " object_id = $1";
+			command += ", spatial_data = $2::geometry";
+			command += ", col_number = $3";
+			command += ", row_number = $4";
+			command += " WHERE geom_id = ";
+			command += Te2String(c.geomId());
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryPolygon;
+
+	return (result == 1);
+}
+
+bool TePostGIS::locateCell(const string& table, TeCoord2D& pt, TeCell& c, const double& tol)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+
+
+	string sql  ="SELECT * FROM ";
+	       sql += table;
+		   sql += " WHERE ";
+		   sql += this->getSQLBoxWhere(box, TeCELLS, table);
+
+	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	portal->fetchGeometry(c);
+
+	delete portal;
+
+	return true;
+}
+
+bool TePostGIS::removeGeometry(const string& tableName, const TeGeomRep& rep, const int& geomId)
+{
+	if(tableName.empty())
+	{
+		return false;
+	}
+
+	std::string remove = "DELETE FROM " + tableName;
+	remove += " WHERE geom_id = " + geomId;
+
+	return this->execute(remove);
+}
+
+bool TePostGIS::createSpatialIndex(const string& table, const string& column, TeSpatialIndexType /*type*/, short /*level*/, short /*tile*/)
+{
+// we need to find te type we are indexing: a box from PostgreSQL or a geometry from PostGIS.
+	string sql = "SELECT " + column + " FROM " + table + " WHERE 1 = 2";
+
+	TePGRecordset rec;
+
+	if(!rec.open(sql, &(TePostgreSQL::tepg_connection_)))
+	{
+		rec.close();
+		return false;
+	}
+
+	string create = "";
+
+	if(rec.fieldType(0) == PG_BOX_TYPE)
+	{
+		create = "CREATE INDEX sp_idx_" + table + " ON " + table + " USING GIST (" + column + " " + TePostgreSQL::gistBoxOps_ + ")";
+	}
+	else
+	{
+		create = "CREATE INDEX sp_idx_" + table + " ON " + table + " USING GIST (" + column + " GIST_GEOMETRY_OPS)";
+	}
+
+	rec.close();	
+
+	return this->execute(create);
+}
+
+string TePostGIS::getSQLBoxWhere(const TeBox& box, const TeGeomRep rep, const std::string& tableName)
+{
+	if(rep == TeTEXT)
+		return TeDatabase::getSQLBoxWhere(box, rep, tableName);
+
+	string colname = "spatial_data";
+	
+	if(rep & TeRASTER)
+		return TePostgreSQL::getSQLBoxWhere(box, rep, tableName);
+
+	string wherebox  = "('" + PGBox_encode(box) + "'::box3d";
+		   wherebox += " && " + colname + ")";	
+
+	return wherebox;
+}
+
+std::string TePostGIS::getSQLOrderBy(const TeGeomRep& rep) const
+{
+	std::string orderBy = "object_id ASC";
+	return orderBy;
+}
+
+string TePostGIS::getSQLBoxWhere(const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1)
+{
+	if((rep1 == TeTEXT) || (rep2 == TeTEXT))
+	{
+		return TeDatabase::getSQLBoxWhere(table1, table2, rep2, rep1);
+	}
+
+	string col1name = "spatial_data";
+	string col2name = "spatial_data";;
+
+	if(rep1 & TeRASTER)
+		col1name = "block_box";
+
+	if(rep2 & TeRASTER)
+		col2name = "block_box";
+
+	string wherebox  = "(";
+		   wherebox += table1;
+           wherebox += "." + col1name + " && ";
+           wherebox += table2;
+           wherebox += "." + col2name + ")";
+
+	return wherebox;
+}
+
+string TePostGIS::getSQLBoxSelect (const string& tableName, TeGeomRep rep)
+{
+	if(rep == TeTEXT)
+		return TeDatabase::getSQLBoxSelect(tableName, rep);
+
+	string colname = "spatial_data";
+
+	if(rep & TeRASTER)
+		return TePostgreSQL::getSQLBoxSelect(tableName, rep);
+
+	string select  = tableName +".* , ";
+			select += "xmin("  + tableName + "." + colname + ") as lower_x, ";
+			select += "ymin("  + tableName + "." + colname + ") as lower_y, ";
+			select += "xmax("  + tableName + "." + colname + ") as upper_x, ";
+			select += "ymax("  + tableName + "." + colname + ") as upper_y ";
+
+	return select;
+}
+
+bool TePostGIS::getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom)
+{
+// we need to find the type we are computing bounding box: a box from PostgreSQL or a geometry from PostGIS.
+	string sql = "SELECT " + colGeom + " FROM " + tableGeom + " WHERE 1 = 2";
+
+	TePGRecordset rec;
+
+	if(!rec.open(sql, &(TePostgreSQL::tepg_connection_)))
+	{
+		rec.close();
+		return false;
+	}
+
+	if(rec.fieldType(0) == PG_BOX_TYPE)	// use the TePostgreSQL method
+	{
+		rec.close();
+
+		return TePostgreSQL::getMBRGeom(tableGeom, object_id, box, colGeom);
+	}
+
+	rec.close();
+
+// if we are here, so it is a PostGIS geometry: in this case we can use the function extent
+
+	TeDatabasePortal* portal = getPortal();
+	if(!portal)
+		return false;
+
+	string sel = "SELECT extent(" +  colGeom + ") FROM " + tableGeom;
+	sel += " WHERE object_id = '" + object_id + "'";
+
+	if(!portal->query(sel)|| !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	box = PGBox_decode(portal->getData(0));
+
+	delete portal;
+	return true;
+}
+
+bool TePostGIS::getMBRSelectedObjects(string geomTable, string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType, TeBox& bout, const double& tol)
+{
+	if(repType == TeTEXT)
+		return TeDatabase::getMBRSelectedObjects(geomTable, colGeom, fromClause, whereClause, afterWhereClause, repType, bout, tol);
+
+	if(repType == TeRASTER)
+		return TePostgreSQL::getMBRSelectedObjects(geomTable, colGeom, fromClause, whereClause, afterWhereClause, repType, bout, tol);
+
+	TeDatabasePortal* portal = getPortal();
+	
+	if (!portal)
+		return false;
+
+	string	fields = "extent(" + geomTable + "." + colGeom + ")::BOX3D";
+	string	query  = " SELECT " + fields;
+			query += " FROM " + fromClause; 
+
+	if(!whereClause.empty())
+		query += " WHERE " + whereClause;		
+
+	if(portal->query(query) && portal->fetchRow())
+
+
+	{
+		TeBox aux(PGBox_decode(portal->getData(0)));
+		bout = aux;
+
+		delete portal;
+		return true;
+	}	
+
+	delete portal;	
+
+	return false;
+}
+
+string TePostGIS::getSpatialIdxColumn(TeGeomRep rep)
+{
+	if (rep == TeRASTER)
+		return "block_box";
+
+	return "spatial_data";
+}
+
+
+bool TePostGIS::getEncodingList(const std::string& host, const std::string& user, const std::string& password, const int& port, std::vector<std::string>& vecEncodingList)
+{ 
+	if(!connect(host, user, password, "template_postgis", port))
+	{
+		close();
+		return false;
+	}
+
+	bool returnValue = TePostgreSQL::getEncodingList(vecEncodingList);
+
+	close();
+
+	return returnValue; 
+}
+
+
+TePostGISPortal::TePostGISPortal(TeDatabase *pDatabase)
+{
+	db_ = pDatabase;
+	con_ = &((static_cast<TePostGIS*>(pDatabase))->tepg_connection_);
+}
+
+bool TePostGISPortal::fetchGeometry(TePolygon& pol)
+{
+	errorMessage_ = "";
+	
+	tepg_recordset_.getPGISPolygon("spatial_data", pol);
+	pol.geomId(tepg_recordset_.getInt("geom_id"));
+	pol.objectId(tepg_recordset_.getData("object_id"));	
+
+	return fetchRow();
+}
+
+bool TePostGISPortal::fetchGeometry(TePolygon& pol, const unsigned int& initIndex)
+{
+	errorMessage_ = "";
+	
+	tepg_recordset_.getPGISPolygon(initIndex+2, pol);
+	pol.geomId(tepg_recordset_.getInt(initIndex));
+	pol.objectId(tepg_recordset_.getData(initIndex+1));	
+
+	return fetchRow();
+}
+
+bool TePostGISPortal::fetchGeometry(TeLine2D& line)
+{
+	errorMessage_ = "";
+
+	tepg_recordset_.getPGISLine("spatial_data", line);
+	line.geomId(tepg_recordset_.getInt("geom_id"));
+	line.objectId(tepg_recordset_.getData("object_id"));
+
+	return fetchRow();
+}
+
+bool TePostGISPortal::fetchGeometry(TeLine2D& line, const unsigned int& initIndex)
+{
+	errorMessage_ = "";
+
+	tepg_recordset_.getPGISLine(initIndex+2, line);
+	line.geomId(tepg_recordset_.getInt(initIndex));
+	line.objectId(tepg_recordset_.getData(initIndex+1));
+
+	return fetchRow();
+}
+
+bool TePostGISPortal::fetchGeometry(TeNode& n)
+{
+	errorMessage_ = "";
+
+	TePoint p;
+	tepg_recordset_.getPGISPoint("spatial_data", p);
+	n.add(p.location());
+	n.geomId(tepg_recordset_.getInt("geom_id"));
+	n.objectId(tepg_recordset_.getData("object_id"));
+
+	return fetchRow();
+}
+
+bool TePostGISPortal::fetchGeometry(TeNode& n, const unsigned int& initIndex)
+{
+	errorMessage_ = "";
+
+	TePoint p;
+	tepg_recordset_.getPGISPoint(initIndex+2, p);
+	n.add(p.location());
+	n.geomId(tepg_recordset_.getInt(initIndex));
+	n.objectId(tepg_recordset_.getData(initIndex+1));
+
+	return fetchRow();
+}
+
+bool TePostGISPortal::fetchGeometry(TePoint& p)
+{
+	errorMessage_ = "";
+	
+	tepg_recordset_.getPGISPoint("spatial_data", p);
+	p.geomId(tepg_recordset_.getInt("geom_id"));
+	p.objectId(tepg_recordset_.getData("object_id"));
+		
+	return fetchRow();
+}
+
+bool TePostGISPortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
+{
+	errorMessage_ = "";
+	
+	tepg_recordset_.getPGISPoint(initIndex+2, p);
+	p.geomId(tepg_recordset_.getInt(initIndex));
+	p.objectId(tepg_recordset_.getData(initIndex+1));
+		
+	return fetchRow();
+}
+
+bool TePostGISPortal::fetchGeometry(TeCell& cell)
+{
+	errorMessage_ = "";
+
+	TePolygon pol;
+	tepg_recordset_.getPGISPolygon("spatial_data", pol);
+
+	cell.geomId(tepg_recordset_.getInt("geom_id"));
+	cell.objectId(tepg_recordset_.getData("object_id"));
+	cell.setBox (pol.box());
+	cell.column(tepg_recordset_.getInt("col_number"));
+	cell.line(tepg_recordset_.getInt("row_number"));
+
+	return fetchRow();
+}
+
+bool TePostGISPortal::fetchGeometry(TeCell& cell, const unsigned int& initIndex)
+{
+	errorMessage_ = "";
+
+	TePolygon pol;
+	tepg_recordset_.getPGISPolygon(initIndex+2, pol);
+
+	cell.geomId(tepg_recordset_.getInt(initIndex));
+	cell.objectId(tepg_recordset_.getData(initIndex+1));
+	cell.setBox (pol.box());
+	cell.column(tepg_recordset_.getInt(initIndex+3));
+	cell.line(tepg_recordset_.getInt(initIndex+4));
+
+	return fetchRow();
+}
+
diff --git a/src/terralib/drivers/PostgreSQL/TePostGIS.h b/src/terralib/drivers/PostgreSQL/TePostGIS.h
old mode 100755
new mode 100644
index ad36798..da00272
--- a/src/terralib/drivers/PostgreSQL/TePostGIS.h
+++ b/src/terralib/drivers/PostgreSQL/TePostGIS.h
@@ -1,249 +1,255 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TePostGIS.h
-    \brief This file contains the especifics routines of PostgreSQL with PostGIS extension.
-*/
-#ifndef  __TERRALIB_INTERNAL_POSTGIS_H
-#define  __TERRALIB_INTERNAL_POSTGIS_H
-
-#include "TePostgreSQL.h"
-#include <TeDatabaseFactory.h>
-
-class TePostGISPortal;
-
-//! PostgreSQL with PostGIS extension database access class.
-/*!
-	This class contains the implementation of common methods for TerraLib access PostgreSQL using a PostGIS extension.    
-	From release 3.1 on, this driver makes use of RTree over GiST.
-    So, to use it you will need install RTRee GiST support in your database.
-	\note MAKE SURE you have UPGRADE your PostgreSQL database before use this driver.
-    If you need to upgrade without use TerraView, please look at 
-    TeUpdateDBVersion.cpp for the routines: updateDB302To310 and PostgreSQLUpdateDB302To310,
-    for a tip on how to upgrade by yourself.
-    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>    
- */	
-class TePostGIS : public TePostgreSQL
-{
-	friend class TePostGISPortal;
-
-	public:
-		
-		//! Constructor
-		TePostGIS();
-
-		//! Destructor
-		virtual ~TePostGIS()
-		{
-		}
-
-		//! Creates a new database based on "template1" and open a connection to the new one
-		bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port = -1, bool terralibModel=true);
-
-		//! Opens a conection to a database server
-		bool connect(const string& host, const string& user, const string& password, const string& database, int port = -1);
-
-		bool showDatabases(const string& host, const string& user, const string& password, vector<string>& dbNames, int port = -1);
-
-		//! Returns a portal associated to this database
-		TeDatabasePortal* getPortal();
-
-		//! Creates a generic table
-		bool createTable(const string& table, TeAttributeList &attr);
-
-		//! Generate the label position (x,y) to each object of a theme
-		bool generateLabelPositions(TeTheme *theme, const std::string& objectId = "");
-
-		//! Returns all polygons in a table given a criteria expressed as an SQL where statement
-		bool selectPolygonSet(const string& table, const string& criteria, TePolygonSet& ps);
-
-		//! Returns all polygons that represents objects of a particular theme
-		bool loadPolygonSet(TeTheme* theme, TePolygonSet& ps);
-
-		//! Returns all polygons  that represents objects of a particular geoid
-		bool loadPolygonSet(const string& table, const string& geoid, TePolygonSet& ps);
-
-		//! Returns all polygons inside a given box
-		bool loadPolygonSet(const string& table, TeBox& box, TePolygonSet& ps);
-
-		//! Returns a database portal to iterate over the polygons that are inside a given box
-		TeDatabasePortal* loadPolygonSet(const string& table, TeBox& box);
-
-		//! Returns the first polygon that contais a given coordinate
-	    bool locatePolygon(const string& table, TeCoord2D& pt, TePolygon& polygon, const double& tol = 0.0);		
-
-		//! Returns the polygons that contains a give coordinate
-		bool locatePolygonSet  (const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons);
-
-		//! Inserts a polygon
-		bool insertPolygon(const string& table, TePolygon& p);
-
-		//! Updates a polygon
-		bool updatePolygon(const string& table, TePolygon& p);
-
-		bool loadLineSet(const string& table, const string& geoid, TeLineSet& ls);
-
-		bool loadLineSet(const string& table, TeBox& box, TeLineSet& linSet);
-
-		TeDatabasePortal* loadLineSet(const string& table, TeBox& box);
-
-		//! Inserts a line
-		bool insertLine(const string& table, TeLine2D& l);
-
-		//! Updates a line
-		bool updateLine(const string& table, TeLine2D& l);
-
-		//! Locates a line
-		bool locateLine(const string& table, TeCoord2D& pt, TeLine2D& line, const double& tol = 0.0);
-
-		//! Inserts a point
-		bool insertPoint(const string& table, TePoint& p);
-
-		//! Updates a point
-		bool updatePoint(const string& table, TePoint& p);
-
-		//! Locates a point
-		bool locatePoint(const string& table, TeCoord2D& pt, TePoint& point, const double& tol = 0.0);
-
-		//! Inserts a node
-		bool insertNode(const string& table, TeNode& node);
-
-		//! Updates a node
-		bool updateNode(const string& table, TeNode& node);
-
-		//! Inserts a cell
-		bool insertCell(const string& table, TeCell& c);
-
-		//! Updates a cell
-		bool updateCell(const string& table, TeCell& c);
-
-		//! Locates a cell
-		bool locateCell(const string& table, TeCoord2D& pt, TeCell& c, const double& tol = 0.0);
-
-		//! Removes a geometry from the given tableName
-		virtual bool removeGeometry(const string& tableName, const TeGeomRep& rep, const int& geomId);
-
-		//! Creates a spatial index on column table
-		bool createSpatialIndex(const string& table, const string& column, TeSpatialIndexType type = TeRTREE, short level = 0, short tile = 0);
-
-		//! Return a string that describes a where clause to return the geometries inside the box
-		string getSQLBoxWhere(TeBox &box, TeGeomRep rep);
-
-		//! Returns a string that describes a where clause to return the geometries of the table2 that are inside the geometries box of the table1
-		string getSQLBoxWhere(const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1 = TePOLYGONS);
-
-		//! Return a string SQL to be used in the clause SELECT to select the box (lower_x, lower_y, upper_x, upper_y)
-		string getSQLBoxSelect(const string& tableName, TeGeomRep rep);
-
-		//! Returns the box of a specific geometry (object_id)  
-		bool getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom);
-
-		//! Return the box of a select objects set 
-		bool getMBRSelectedObjects(string geomTable, string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType, TeBox& bout, const double& tol = 0.0);
-
-		//! Returns the name of the column that wiil be the spatially indexed, for a given type of geometry table 
-		string getSpatialIdxColumn(TeGeomRep rep);
-};
-
-
-//! PostgreSQL with PostGIS extension data navigation functionalities.
-/*!
-	This class contains the implementation of common methods for TerraLib navigate throw data.    
- */	
-class TePostGISPortal : public TePostgreSQLPortal
-{
-	public:
-
-		//! Constructor
-		TePostGISPortal()
-		{
-		}
-
-		//! Constructor
-		TePostGISPortal(TeDatabase *pDatabase);
-		
-		//! Virtual Destructor
-		virtual ~TePostGISPortal()
-		{
-		};	
-
-		bool fetchGeometry(TePolygon& pol);
-		bool fetchGeometry(TeLine2D& line);
-		bool fetchGeometry(TeNode& n);
-		bool fetchGeometry(TePoint& p);
-		bool fetchGeometry(TeCell& cell);
-
-		bool fetchGeometry(TePolygon& pol, const unsigned int& initIndex);
-		bool fetchGeometry(TeLine2D& line, const unsigned int& initIndex);
-		bool fetchGeometry(TeNode& n, const unsigned int& initIndex);
-		bool fetchGeometry(TePoint& p, const unsigned int& initIndex);
-		bool fetchGeometry(TeCell& cell, const unsigned int& initIndex);
-};
-
-
-/**
- * @brief This is the class for TePostGIS driver factory.
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- * @ingroup DatabaseUtils
- */
-class TePostGISFactory : public TeDatabaseFactory
-{
-  public :
-      
-    /**
-     * Default constructor
-     */
-    TePostGISFactory() : TeDatabaseFactory( std::string( "PostGIS" ) ) {};      
-      
-    /**
-     * Default Destructor
-     */
-    ~TePostGISFactory() {};
-      
-  protected :  
-  
-    /**
-     * Implementation for the abstract TeFactory::build.
-     *
-     * @param arg A const reference to the parameters used by the
-     * database.
-     * @return A pointer to the new generated database instance.
-     */
-    TeDatabase* build( const TeDatabaseFactoryParams& arg )
-    {
-      TePostGIS* instance_ptr = new TePostGIS();
-      
-      if( arg.host_ != "" ) {
-        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
-          arg.database_, arg.port_ );
-      }
-  
-      return (TeDatabase*)instance_ptr;
-    }
-};
-
-namespace {
-  static TePostGISFactory TePostGISFactory_instance;
-};
-
-#endif	// __TERRALIB_INTERNAL_POSTGIS_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TePostGIS.h
+    \brief This file contains the especifics routines of PostgreSQL with PostGIS extension.
+*/
+#ifndef  __TERRALIB_INTERNAL_POSTGIS_H
+#define  __TERRALIB_INTERNAL_POSTGIS_H
+
+#include "TePostgreSQL.h"
+#include <TeDatabaseFactory.h>
+
+class TePostGISPortal;
+
+//! PostgreSQL with PostGIS extension database access class.
+/*!
+	This class contains the implementation of common methods for TerraLib access PostgreSQL using a PostGIS extension.    
+	From release 3.1 on, this driver makes use of RTree over GiST.
+    So, to use it you will need install RTRee GiST support in your database.
+	\note MAKE SURE you have UPGRADE your PostgreSQL database before use this driver.
+    If you need to upgrade without use TerraView, please look at 
+    TeUpdateDBVersion.cpp for the routines: updateDB302To310 and PostgreSQLUpdateDB302To310,
+    for a tip on how to upgrade by yourself.
+    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>    
+ */	
+class TLPOSTGRESQL_DLL TePostGIS : public TePostgreSQL
+{
+	friend class TePostGISPortal;
+
+	public:
+		
+		//! Constructor
+		TePostGIS();
+
+		//! Destructor
+		virtual ~TePostGIS()
+		{
+		}
+
+		//! Creates a new database based on "template1" and open a connection to the new one
+		bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port = -1, bool terralibModel=true, const std::string& characterSet = "");
+
+		//! Opens a conection to a database server
+		bool connect(const string& host, const string& user, const string& password, const string& database, int port = -1);
+
+		bool showDatabases(const string& host, const string& user, const string& password, vector<string>& dbNames, int port = -1);
+
+		//! Returns a portal associated to this database
+		TeDatabasePortal* getPortal();
+
+		//! Creates a generic table
+		bool createTable(const string& table, TeAttributeList &attr);
+
+		//! Generate the label position (x,y) to each object of a theme
+		bool generateLabelPositions(TeTheme *theme, const std::string& objectId = "");
+
+		//! Returns all polygons in a table given a criteria expressed as an SQL where statement
+		bool selectPolygonSet(const string& table, const string& criteria, TePolygonSet& ps);
+
+		//! Returns all polygons that represents objects of a particular theme
+		bool loadPolygonSet(TeTheme* theme, TePolygonSet& ps);
+
+		//! Returns all polygons  that represents objects of a particular geoid
+		bool loadPolygonSet(const string& table, const string& geoid, TePolygonSet& ps);
+
+		//! Returns all polygons inside a given box
+		bool loadPolygonSet(const string& table, TeBox& box, TePolygonSet& ps);
+
+		//! Returns a database portal to iterate over the polygons that are inside a given box
+		TeDatabasePortal* loadPolygonSet(const string& table, TeBox& box);
+
+		//! Returns the first polygon that contais a given coordinate
+	    bool locatePolygon(const string& table, TeCoord2D& pt, TePolygon& polygon, const double& tol = 0.0);		
+
+		//! Returns the polygons that contains a give coordinate
+		bool locatePolygonSet  (const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons);
+
+		//! Inserts a polygon
+		bool insertPolygon(const string& table, TePolygon& p);
+
+		//! Updates a polygon
+		bool updatePolygon(const string& table, TePolygon& p);
+
+		bool loadLineSet(const string& table, const string& geoid, TeLineSet& ls);
+
+		bool loadLineSet(const string& table, TeBox& box, TeLineSet& linSet);
+
+		TeDatabasePortal* loadLineSet(const string& table, TeBox& box);
+
+		//! Inserts a line
+		bool insertLine(const string& table, TeLine2D& l);
+
+		//! Updates a line
+		bool updateLine(const string& table, TeLine2D& l);
+
+		//! Locates a line
+		bool locateLine(const string& table, TeCoord2D& pt, TeLine2D& line, const double& tol = 0.0);
+
+		//! Inserts a point
+		bool insertPoint(const string& table, TePoint& p);
+
+		//! Updates a point
+		bool updatePoint(const string& table, TePoint& p);
+
+		//! Locates a point
+		bool locatePoint(const string& table, TeCoord2D& pt, TePoint& point, const double& tol = 0.0);
+
+		//! Inserts a node
+		bool insertNode(const string& table, TeNode& node);
+
+		//! Updates a node
+		bool updateNode(const string& table, TeNode& node);
+
+		//! Inserts a cell
+		bool insertCell(const string& table, TeCell& c);
+
+		//! Updates a cell
+		bool updateCell(const string& table, TeCell& c);
+
+		//! Locates a cell
+		bool locateCell(const string& table, TeCoord2D& pt, TeCell& c, const double& tol = 0.0);
+
+		//! Removes a geometry from the given tableName
+		virtual bool removeGeometry(const string& tableName, const TeGeomRep& rep, const int& geomId);
+
+		//! Creates a spatial index on column table
+		bool createSpatialIndex(const string& table, const string& column, TeSpatialIndexType type = TeRTREE, short level = 0, short tile = 0);
+
+		//! Return a string that describes a where clause to return the geometries inside the box
+		string getSQLBoxWhere(const TeBox& box, const TeGeomRep rep, const std::string& tableName);
+
+		//!< Returns a string SQL to be used in the ORDER BY clause when querying geometries.
+		virtual std::string getSQLOrderBy(const TeGeomRep& rep) const;
+
+		//! Returns a string that describes a where clause to return the geometries of the table2 that are inside the geometries box of the table1
+		string getSQLBoxWhere(const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1 = TePOLYGONS);
+
+		//! Return a string SQL to be used in the clause SELECT to select the box (lower_x, lower_y, upper_x, upper_y)
+		string getSQLBoxSelect(const string& tableName, TeGeomRep rep);
+
+		//! Returns the box of a specific geometry (object_id)  
+		bool getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom);
+
+		//! Return the box of a select objects set 
+		bool getMBRSelectedObjects(string geomTable, string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType, TeBox& bout, const double& tol = 0.0);
+
+		//! Returns the name of the column that wiil be the spatially indexed, for a given type of geometry table 
+		string getSpatialIdxColumn(TeGeomRep rep);
+
+		//! Retrives the list of available character sets
+		bool getEncodingList(const std::string& host, const std::string& user, const std::string& password, const int& port, std::vector<std::string>& vecEncodingList);
+};
+
+
+//! PostgreSQL with PostGIS extension data navigation functionalities.
+/*!
+	This class contains the implementation of common methods for TerraLib navigate throw data.    
+ */	
+class TLPOSTGRESQL_DLL TePostGISPortal : public TePostgreSQLPortal
+{
+	public:
+
+		//! Constructor
+		TePostGISPortal()
+		{
+		}
+
+		//! Constructor
+		TePostGISPortal(TeDatabase *pDatabase);
+		
+		//! Virtual Destructor
+		virtual ~TePostGISPortal()
+		{
+		};	
+
+		bool fetchGeometry(TePolygon& pol);
+		bool fetchGeometry(TeLine2D& line);
+		bool fetchGeometry(TeNode& n);
+		bool fetchGeometry(TePoint& p);
+		bool fetchGeometry(TeCell& cell);
+
+		bool fetchGeometry(TePolygon& pol, const unsigned int& initIndex);
+		bool fetchGeometry(TeLine2D& line, const unsigned int& initIndex);
+		bool fetchGeometry(TeNode& n, const unsigned int& initIndex);
+		bool fetchGeometry(TePoint& p, const unsigned int& initIndex);
+		bool fetchGeometry(TeCell& cell, const unsigned int& initIndex);
+};
+
+
+/**
+ * @brief This is the class for TePostGIS driver factory.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup DatabaseUtils
+ */
+class TLPOSTGRESQL_DLL TePostGISFactory : public TeDatabaseFactory
+{
+  public :
+      
+    /**
+     * Default constructor
+     */
+    TePostGISFactory() : TeDatabaseFactory( std::string( "PostGIS" ) ) {};      
+      
+    /**
+     * Default Destructor
+     */
+    ~TePostGISFactory() {};
+      
+  protected :  
+  
+    /**
+     * Implementation for the abstract TeFactory::build.
+     *
+     * @param arg A const reference to the parameters used by the
+     * database.
+     * @return A pointer to the new generated database instance.
+     */
+    TeDatabase* build( const TeDatabaseFactoryParams& arg )
+    {
+      TePostGIS* instance_ptr = new TePostGIS();
+      
+      if( arg.host_ != "" ) {
+        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
+          arg.database_, arg.port_ );
+      }
+  
+      return (TeDatabase*)instance_ptr;
+    }
+};
+
+namespace {
+  static TePostGISFactory TePostGISFactory_instance;
+};
+
+#endif	// __TERRALIB_INTERNAL_POSTGIS_H
+
diff --git a/src/terralib/drivers/PostgreSQL/TePostgreSQL.cpp b/src/terralib/drivers/PostgreSQL/TePostgreSQL.cpp
old mode 100755
new mode 100644
index aff3b78..2dbecb3
--- a/src/terralib/drivers/PostgreSQL/TePostgreSQL.cpp
+++ b/src/terralib/drivers/PostgreSQL/TePostgreSQL.cpp
@@ -1,4170 +1,4565 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TePostgreSQL.h"
-#include "TePGUtils.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "TeSpatialOperations.h"
-#include "TeGeometryAlgorithms.h"
-#include <TeTimeInterval.h>
-#include <TeProject.h>
-#include <string>
-using namespace std;
-
-// Create a block of doubles for the bytea
-unsigned char* getByteArray(const TeLine2D& l)
-{
-	unsigned int size = l.size();
-
-	double* points = new double[2 * size];
-
-	int iac = 0;
-
-	for(unsigned int i = 0; i < size; ++i)
-	{
-		points[iac++] = l[i].x();
-		points[iac++] = l[i].y();
-	}
-
-	size_t newLen = 0;
-
-	// N�mero de doubles = 2 * size
-	// N�mero de bytes = 2 * size * sizeof(double)
-	unsigned char* newbuf = TePGConnection::escapeBytea((unsigned char*)points, 2 * size * sizeof(double) , &newLen);
-
-	delete points;
-
-	return newbuf;
-}
-
-
-//----- TePostgreSQL methods ---
-TePostgreSQL::TePostgreSQL()
-	: transactionCounter_(0)
-{
-	errorMessage_ = "";
-	gistBoxOps_ = "";
-	dbmsName_ = "PostgreSQL";
-}
-
-TePostgreSQL::~TePostgreSQL()
-{
-	if(isConnected_)
-		close();
-}
-
-string TePostgreSQL::errorMessage()
-{
-	if(errorMessage_.empty())
-		return tepg_connection_.err_msg();
-	else
-		return errorMessage_;
-	
-}
-
-bool TePostgreSQL::newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port, bool terralibModel)
-{
-	errorMessage_ = "";
-
-	string createDB  = "CREATE DATABASE ";
-	       createDB += "\"" + database + "\"";
-
-	//if(!realConnect(host, user, password, "template1", port))
-	//	return false;	
-
-	if(!connect(host, user, password, "template1", port))
-	{
-		close();
-		return false;
-	}
-
-	
-	bool connected = false;
-	
-	if(execute(createDB))
-	{
-		connected = connect(host, user, password, database, port);
-	}
-	else
-	{
-		close();
-		return false;
-	}
-
-	if(terralibModel)
-	{
-		//create conceptual model
-		if(connected)
-		{
-			if(!createConceptualModel())
-			{
-				close();
-				return false;
-			}
-		}
-		else
-		{
-			close();
-			return false;
-		}
-	}
-
-	return true;
-}
-
-
-bool TePostgreSQL::connect(const string& host, const string& user, const string& password, const string& database, int port)
-{
-	if(TePostgreSQL::realConnect(host, user, password, database, port))
-	{
-// see if PostGIS is present
-		TePGRecordset rec;
-
-		string sql = "SELECT postgis_version()";
-
-		if(rec.open(sql.c_str(), &tepg_connection_) && rec.recordCount() > 0)
-		{
-			rec.close();
-
-			this->close();
-
-			errorMessage_ = "PostGIS extension found! Please use a PostGIS driver!";
-
-			return false;	
-		}
-
-// see if RTree GiST is present for box: it must be present
-		int version = PQserverVersion(tepg_connection_.c_ptr());
-		if(version >= 80100)
-		{
-			gistBoxOps_ = "box_ops";
-			return true;
-		}
-
-		sql = "SELECT opcname FROM pg_opclass WHERE (opcname = 'gist_box_ops') ORDER BY opcname DESC";
-
-		if(rec.open(sql.c_str(), &tepg_connection_) && rec.recordCount() > 0)
-		{
-			gistBoxOps_ = rec.value(0);
-			rec.close();
-
-			return true;
-		}
-
-		rec.close();
-
-		this->close();
-
-		errorMessage_ = "GiST extension not found! Please, install R-Tree GiST in your database and try again!";
-
-		return false;	
-	}
-	
-	return false;
-}
-
-bool TePostgreSQL::realConnect(const string& host, const string& user, const string& password, const string& database, int port)
-{
-	errorMessage_ = "";
-
-	host_             = (host == "")     ? (string("")) : (" host = " + host + " ");
-	user_             = (user == "")     ? (string("")) : (" user = " + user + " ");
-	password_         = (password == "") ? (string("")) : (" password = " + password + " ");
-	database_         = (database == "") ? (string("")) : (" dbname = " + database + " ");
-	string portNumber = (port <= 0)     ? (string("")) : (" port = " + Te2String(port)  + " ");
-
-	portNumber_ = port;
-
-	string connInfo = host_ + user_ + password_ + database_ + portNumber;
-
-	host_     = host;
-	user_     = user;
-	password_ = password;
-	database_ = database;
-
-	this->close();
-
-	if(!tepg_connection_.open(connInfo))
-	{
-		errorMessage_ = "Could not connect to the database server!";
-		return false;
-	}
-
-	isConnected_ = true;	
-
-	return true;
-}
-
-bool TePostgreSQL::showDatabases(const string& host, const string& user, const string& password, vector<string>& dbNames, int port)
-{
-	errorMessage_ = "";
-
-	if(realConnect(host, user, password, "template1", port))
-	{
-		string sql = "SELECT datname FROM pg_database WHERE datname NOT IN ('template0', 'template1', 'template_postgis', 'postgres') ORDER BY datname";
-
-		TePostgreSQLPortal p(this);
-
-		if(p.query(sql) && p.fetchRow())
-		{
-			do
-			{
-				dbNames.push_back(p.getData("datname"));
-			}while(p.fetchRow());
-
-			return true;
-		}
-		else
-			errorMessage_ = "Didn't find any database!";
-	}
-	
-	return false;
-}
-
-void TePostgreSQL::close(void)
-{
-	errorMessage_ = "";
-
-	tepg_connection_.close();
-	isConnected_ = false;
-	transactionCounter_ = 0;
-
-	return;
-}
-
-bool TePostgreSQL::listTables(vector<string>& tableList)
-{
-	errorMessage_ = "";
-
-	TePGRecordset rec;
-
-	string sql = "SELECT tablename FROM pg_table WHERE schemaname = 'public' ORDER BY tablename";
-
-	if(!rec.open(sql, &tepg_connection_) || rec.recordCount() <= 0)
-		return false;
-
-	while(!rec.eof())
-	{
-		tableList.push_back(rec.getData(0));
-		rec.moveNext();
-	}
-	
-	return true;
-
-}
-
-bool TePostgreSQL::tableExist(const string& table)
-{
-	if (table.empty())
-		return false;
-
-	errorMessage_ = "";
-
-	TePGRecordset rec;
-
-	string sql = "SELECT relname FROM pg_class WHERE lower(relname) = lower('" + table + "')";
-
-	if(!rec.open(sql, &tepg_connection_))
-		return false;
-
-	return (rec.recordCount() > 0);
-}
-
-bool TePostgreSQL::columnExist(const string& table, const string& column, TeAttribute& attr)
-{
-	errorMessage_ = "";
-
-	TePGRecordset rec;
-
-	string sql  = "SELECT atttypid, attname, atttypmod, attlen  FROM pg_class, pg_attribute ";
-	       sql += "WHERE lower(pg_class.relname) = lower('" + table + "') AND ";
-		   sql += "      pg_class.oid = pg_attribute.attrelid AND ";
-		   sql += "      pg_attribute.attname = lower('" + column + "')";
-
-	if(!rec.open(sql, &tepg_connection_))
-		return false;
-
-	if(rec.recordCount() > 0)
-	{
-		attr.rep_.name_ = rec.getData("attname");
-
-		Oid nType = static_cast<Oid>(rec.getInt("atttypid"));
-		switch(nType)
-		{
-			case 16:    //BOOL
-			case 20:    //INT8
-			case 21:    //INT2
-			case 23:    //INT4
-			case 26:    //OID			
-						attr.rep_.type_ = TeINT;
-						attr.rep_.numChar_ = 15;
-						break;
-
-			case 700 :  //float4  -> float(p)
-			case 701 :  //float8  -> float(p)
-			case 790 :  //money   -> decimal(9, 2)  
-			case 1700:  //numeric -> numeric(p, s)  
-						attr.rep_.type_ = TeREAL;
-						attr.rep_.numChar_ = 15;
-						break;
-
-			case 1082:	//date -> date
-			case 1083:  //time -> time
-			case 1114:  //timestamp
-			case 1186:  //interval
-			case 1266:	//
-						attr.rep_.type_ = TeDATETIME;
-						attr.rep_.numChar_ = rec.getInt("attlen");
-						break;
-
-			//case 26:    //OID
-			case 17:	//bytea
-						attr.rep_.type_ = TeBLOB;
-						attr.rep_.numChar_ = 0;
-						break;
-			case 1042:
-						attr.rep_.type_ = TeCHARACTER;
-						attr.rep_.numChar_ = rec.getInt("atttypmod") - 4;
-						break;
-
-			case 1043:  //varchar(n)
-						attr.rep_.type_ = TeSTRING;
-						attr.rep_.numChar_ = rec.getInt("atttypmod") - 4;
-						break;
-
-			case 25:    //text
-						attr.rep_.type_ = TeSTRING;
-						break;
-
-			default:
-						attr.rep_.type_ = TeUNKNOWN;
-						attr.rep_.numChar_ = 0;
-						break;
-		}
-
-		return true;
-	}
-
-	return false;
-}
-
-bool TePostgreSQL::createTable(const string& table, TeAttributeList &attr)
-{
-	errorMessage_ = "";
-
-	bool first = true;
-
-	TeAttributeList::iterator it = attr.begin();
-	
-	string createTable ="CREATE TABLE " + table +" (";
-	
-	string type;
-
-	string pkeys;
-
-	while(it != attr.end())
-	{
-		switch ((*it).rep_.type_)
-		{
-			case TeSTRING:		if((*it).rep_.numChar_ > 0)
-								{
-									type = "VARCHAR(" + Te2String((*it).rep_.numChar_) + ")";
-								}
-								else
-								{
-									type = "TEXT";
-								}
-								break;
-
-			case TeREAL:		type = "FLOAT8";
-								break;
-
-			case TeINT:
-			case TeUNSIGNEDINT:
-								type = ((*it).rep_.isAutoNumber_) ? "SERIAL" : "INTEGER";
-								break;
-
-			case TeBLOB:		//type = "OID";
-				                type = "BYTEA";
-								break;
-
-			case TeDATETIME:	type = "TIMESTAMP(0)";
-								break;
-
-			case TeCHARACTER:	type = "CHAR(" + (((*it).rep_.numChar_ == 0)? std::string("1") : Te2String((*it).rep_.numChar_)) + ") ";
-								break;
-
-			case TePOINTTYPE:
-			case TePOINTSETTYPE:
-								if(!first)
-									createTable += ", ";
-								else
-									first = false;
-
-								createTable += " spatial_box  BOX           NOT NULL,";
-								createTable += " x		      FLOAT8        DEFAULT 0.0,";
-								createTable += " y            FLOAT8        DEFAULT 0.0 ";
-								++it;
-								continue;
-
-			case TeLINE2DTYPE:
-			case TeLINESETTYPE:
-							if(!first)
-								createTable += ", ";
-							else
-								first = false;
-
-							createTable += " num_coords   INTEGER      NOT NULL,";
-							createTable += " spatial_box  BOX          NOT NULL,";
-							createTable += " ext_max      FLOAT8       NOT NULL,";
-							createTable += " spatial_data POLYGON ";
-							++it;
-							continue;
-
-			case TePOLYGONTYPE:
-			case TePOLYGONSETTYPE:
-							if(!first)
-								createTable += ", ";
-							else
-								first = false;
-
-							createTable += " num_coords   INTEGER      NOT NULL,";
-							createTable += " num_holes    INTEGER      NOT NULL,";
-							createTable += " parent_id    INTEGER      NOT NULL,";
-							createTable += " spatial_box  BOX          NOT NULL,";
-							createTable += " ext_max      FLOAT8       NOT NULL,";
-							createTable += " spatial_data POLYGON ";
-							++it;
-							continue;
-
-			case TeCELLTYPE:
-			case TeCELLSETTYPE:
-							if(!first)
-								createTable += ", ";
-							else
-								first = false;
-
-							createTable += " spatial_box  BOX          NOT NULL,";
-							createTable += " col_number   INTEGER      NOT NULL,";
-							createTable += " row_number	  INTEGER      NOT NULL ";
-							++it;
-							continue;					
-
-			case TeRASTERTYPE:
-							if(!first)
-								createTable += ", ";
-							else
-								first = false;
-
-							createTable += " block_box         BOX         NOT NULL,";
-							createTable += " band_id		     INTEGER     NOT NULL,";		   
-							createTable += " resolution_factor INTEGER     NOT NULL,";
-							createTable += " subband		     INTEGER     NOT NULL,";		   
-							createTable += " spatial_data      BYTEA,";
-							createTable += " block_size        INTEGER  NOT NULL ";
-		   					++it;
-							continue;
-
-			case TeNODETYPE:
-			case TeNODESETTYPE:
-							if(!first)
-								createTable += ", ";
-							else
-								first = false;
-
-							createTable += " spatial_box  BOX           NOT NULL,";
-							createTable += " x		    FLOAT8        DEFAULT 0.0,";
-							createTable += " y            FLOAT8        DEFAULT 0.0 ";
-							++it;
-							continue;
-
-			case TeTEXTTYPE:
-			case TeTEXTSETTYPE:
-
-			default:			type += "VARCHAR(" + Te2String((*it).rep_.numChar_) + ")";
-								break;
-		}
-
-		if(!((*it).rep_.defaultValue_.empty()))
-			type += " DEFAULT '" + (*it).rep_.defaultValue_ + "' ";
-
-		if(!((*it).rep_.null_))
-			type += " NOT NULL ";
-		
-		if(!first)
-			createTable += ",  ";
-		else
-			first = false;
-
-		createTable += (*it).rep_.name_ + " ";
-		createTable += type;
-
-		// check if column is part of primary key
-		if((*it).rep_.isPrimaryKey_ && (*it).rep_.type_ != TeBLOB )
-		{
-			if(!pkeys.empty())
-				pkeys += ", ";
-			
-			pkeys += (*it).rep_.name_;
-		}
-
-		++it;
-	}
-
-	if(!pkeys.empty())
-	{	string pk = ", PRIMARY KEY(";
-	           pk += pkeys;
-			   pk += ")";
-
-		createTable += pk;
-	}
-
-
-	createTable += ");";
-
-	return execute(createTable);
-}
-
-bool TePostgreSQL::addColumn(const string& table, TeAttributeRep &rep)
-{
-	errorMessage_ = "";
-	
-	string field = TeGetExtension(rep.name_.c_str());
-	if(field.empty())
-		field = rep.name_;
-
-	string new_column  = "ALTER TABLE " + table + " ADD COLUMN " + field + " ";
-
-	switch(rep.type_)
-	{
-		case TeSTRING:		if(rep.numChar_ > 0)
-							{
-								new_column += "VARCHAR(" + Te2String(rep.numChar_) + ")";
-							}
-							else
-							{
-								new_column += "TEXT";
-							}
-							
-							break;
-		case TeREAL:		new_column += "FLOAT8";
-							break;
-		case TeINT:			new_column += (rep.isAutoNumber_ ? "SERIAL" : "INTEGER");
-							break;
-		case TeDATETIME:	new_column += "TIMESTAMP(0)";
-							break;
-		case TeBLOB:		//new_column += "OID";
-							new_column += "BYTEA";
-							break;
-		default:			new_column += "VARCHAR";
-							break;
-	}
-
-	if(!this->execute(new_column))
-        return false;
-
-	alterTableInfoInMemory(table);
-
-	return true;
-}
-
-bool TePostgreSQL::createRelation(const string& relName, const string& table, const string& fieldName, const string& relatedTable, const string& relatedField, bool cascadeDeletion)
-{
-	errorMessage_ = "";
-
-	string alter  = "ALTER TABLE " +  table + " ADD CONSTRAINT " + relName + " ";
-	       alter += "FOREIGN KEY (" + fieldName + ") "; 
-	       alter += "REFERENCES " + relatedTable + "(" + relatedField + ") ";
-
-	if(cascadeDeletion)
-		alter += " ON DELETE CASCADE";
-
-	return execute(alter);
-}
-
-TeDBRelationType TePostgreSQL::existRelation(const string& /*tableName*/, const string& relName)
-{
-	errorMessage_ = "";
-
-	string sql  = "SELECT proname FROM pg_trigger, pg_proc WHERE tgconstrname = '" + relName + "' AND pg_trigger.tgfoid = pg_proc.oid AND pg_proc.proname LIKE 'RI_FKey_cascade_del%'";
-	TeDBRelationType resp = TeNoRelation;
-
-	TePGRecordset r(sql, &tepg_connection_);
-	if(r.recordCount() > 0)
-		resp = TeRICascadeDeletion; 
-	else
-	{
-		sql  = "SELECT proname FROM pg_trigger, pg_proc WHERE tgconstrname = '" + relName + "' AND pg_trigger.tgfoid = pg_proc.oid AND pg_proc.proname LIKE 'RI_FKey_check_ins%'";
-		r.open(sql, &tepg_connection_);
-		if(r.recordCount() > 0)
-			resp = TeRINoCascadeDeletion; 
-	}
-
-	r.close();
-	
-	return resp;
-}
-
-bool TePostgreSQL::execute(const string &sql)
-{
-	try
-	{
-		this->tepg_connection_.exec_cmd(sql);
-	}
-
-	catch(...)
-	{
-		return false;
-	}
-
-	return true;
-}
-
-TeDatabasePortal* TePostgreSQL::getPortal()
-{
-	errorMessage_ = "";
-
-	TeDatabasePortal *portal = new TePostgreSQLPortal(this);
-
-	return portal;
-}
-
-bool TePostgreSQL::insertRelationInfo(const int tableId, const string& tField, const string& rTable, const string& rField, int& relId)
-{
-	// check if relation already exists
-	TePostgreSQLPortal* portal = (TePostgreSQLPortal*)this->getPortal();
-
-	if(!portal)
-		return false;
-
-	relId = -1;
-	
-	string sel = "SELECT relation_id FROM te_tables_relation WHERE";
-	sel += " related_table_id = " + Te2String(tableId);
-	sel += " AND related_attr = '" + tField + "'";
-	sel += " AND external_table_name = '" + rTable + "'";
-	sel += " AND external_attr = '" + rField + "'";
-
-	if(!portal->query(sel))
-	{
-		delete portal;
-		return false;
-	}
-
-	if(portal->fetchRow())
-	{
-		relId = atoi(portal->getData("relation_id"));
-		delete portal;
-		return true;
-	}
-
-	delete portal;
-
-	string sql =  "INSERT INTO te_tables_relation (related_table_id, related_attr, external_table_name, external_attr) VALUES(";
-	       sql += Te2String(tableId);
-		   sql += ", '";
-		   sql += tField;
-		   sql += "', '";
-		   sql += rTable;
-		   sql += "', '";
-		   sql += rField;
-		   sql += "')";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('te_tables_relation_relation_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-
-		if(rec.recordCount() > 0)
-			relId = rec.getInt(0);
-
-		rec.close();
-	}
-	else
-		return false;
-
-	return true;
-}
-
-bool 
-TePostgreSQL::insertTable(TeTable &table)
-{
-	string tableName = table.name();
-	int size = table.size();
-	TeAttributeList att = table.attributeList();
-	TeAttributeList::iterator it = att.begin();
-	TeAttributeList::iterator itEnd = att.end();
-	TeTableRow row;
-	
-	if (!beginTransaction())
-		return false;
-
-	size_t newLen = 0;
-	unsigned char* newbuf = 0;
-	int i;
-	unsigned int j;
-	for ( i = 0; i < size; i++ )	
-	{
-		row = table[i];
-		it = att.begin();
-		string attrs;
-		string values;
-		j = 1;
-		int jj = 0;
-		while ( it != itEnd )
-		{
-			if (row[jj].empty() || (*it).rep_.isAutoNumber_)
-			{
-				++it;
-				j++;
-				jj++;
-				continue;
-			}
-			
-			if (!values.empty())
-			{
-				attrs += ", ";
-				values += ", ";
-			}			
-			attrs += (*it).rep_.name_;			
-			switch ((*it).rep_.type_)
-			{
-			case TeSTRING:
-				values += "'"+ escapeSequence( row[jj] ) +"'";
-				break;
-			case TeREAL:
-				{
-					std::string strValue = row[jj];
-					replace(strValue.begin(), strValue.end(), ',', '.');
-					values += strValue;
-				}
-				break;
-			case TeUNSIGNEDINT:
-			case TeINT:
-				values += row[jj];
-				break;
-			case TeDATETIME:
-				{
-					const string temp_dt = string(row[jj].c_str());
-					TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
-					values += this->getSQLTime(t);
-				}
-				break;
-			case TeCHARACTER:
-				values += "'" + escapeSequence(row[jj]) + "'";
-				break;
-			case TeBLOB:
-				newbuf = TePGConnection::escapeBytea((unsigned char*)row[jj].c_str(), row[jj].size(), &newLen);
-				values += "'";
-				values += (char*)newbuf; 
-				values += "'";
-				TePGConnection::freeMem(newbuf);
-				newbuf = NULL;
-			default:
-				values += "'"+ escapeSequence(row[jj]) +"'";
-				break;
-			}
-			++it;
-			j++;
-			jj++;
-		}
-
-		if (values.empty()) 
-			continue;
-
-		string q = "INSERT INTO "+tableName + " ("+ attrs+") " + " VALUES ("+values+") ";
-		if (!execute(q)) 
-			continue;
-	}
-
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		if(newbuf)
-		{
-			TePGConnection::freeMem(newbuf);
-			newbuf = NULL;
-		}
-		return false;
-	}
-	if(newbuf)
-	{
-		TePGConnection::freeMem(newbuf);
-		newbuf = NULL;
-	}
-	return true;
-}
-
-bool
-TePostgreSQL::updateTable(TeTable &table)
-{
-	TeAttributeList& att = table.attributeList();
-	unsigned int i;
-	string uniqueVal;
-	bool isUniqueValString = false;
-	
-	if (!beginTransaction())
-		return false;
-
-	string uniqueName = table.uniqueName(); // primary key explicitly defined or 
-	if (table.uniqueName().empty())			// check in the attribute list
-	{								
-		for (i=0; i<att.size(); ++i)
-			if (att[i].rep_.isPrimaryKey_)
-			{
-				uniqueName = att[i].rep_.name_;
-				table.setUniqueName(uniqueName);
-				break;
-			}
-	}
-
-	size_t newLen = 0;
-	unsigned char* newbuf = 0;
-	TeAttributeList::iterator it;
-	TeTableRow row;
-	unsigned int j;
-	bool useComma = false;
-	for (i = 0; i < table.size(); i++  )
-	{
-		row = table[i];
-		it = att.begin();
-		string q;
-		j = 1;
-		int jj = 0;
-		while ( it != att.end() )
-		{
-			if (uniqueName != (*it).rep_.name_)
-			{
-				if ((*it).rep_.isAutoNumber_)
-				{
-					++it;
-					j++;
-					jj++;
-					continue;
-				}
-				if(useComma == true)
-				{
-					q += ", ";
-				}
-				else
-				{
-					useComma = true;
-				}				
-				
-				q += (*it).rep_.name_ + " = ";
-  				
-				if(row[jj].empty())
-				{
-					q += " null";
-
-					++it;
-					j++;
-					jj++;
-					continue;
-				}
-
-				switch ((*it).rep_.type_)
-  				{
-  					case TeSTRING:
-						q += "'"+escapeSequence(row[jj])+"'";
-  					break;
-  					case TeREAL:
-					{
-						std::string value = row[jj];
-						replace(value.begin(), value.end(), ',', '.');
-						q += value;
-					}
-  					break;
-  					case TeINT:
-					case TeUNSIGNEDINT:
-						q += row[jj];
-  					break;
-					case TeDATETIME:
-					{
-						const string temp_dt = string(row[jj].c_str());
-						TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
-						q += this->getSQLTime(t);
-					}
-  					break;
-					case TeCHARACTER:
-						q += "'" + escapeSequence(row[jj]) + "'";
-  					break;
-					case TeBLOB:
-						newbuf = TePGConnection::escapeBytea((unsigned char*)row[jj].c_str(), row[jj].size(), &newLen);
-						q += "'";
-						q += (char*)newbuf; 
-						q += "'";
-						TePGConnection::freeMem(newbuf);
-						newbuf = NULL;
-					break;
-  					default:
-						q += "'"+escapeSequence(row[jj])+"'";
-  					break;
-  				}				
-			}
-			else
-			{
-				uniqueVal = row[jj];
-				isUniqueValString = ((*it).rep_.type_ == TeSTRING);
-			}
-			++it;
-			j++;
-			jj++;
-		}
-		if (q.empty())
-			continue;
-		
-		if (!uniqueName.empty() && !uniqueVal.empty())  
-		{
-			if(isUniqueValString)
-				q += " WHERE " + uniqueName + " = '" + uniqueVal +"'";
-			else
-				q += " WHERE " + uniqueName + " = " + uniqueVal;
-		}
-		string sql = "UPDATE "+ table.name() + " SET " + q;
-		if (!execute(sql))
-		{
-			rollbackTransaction();
-			if(newbuf)
-			{
-				TePGConnection::freeMem(newbuf);
-				newbuf = NULL;
-			}
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		if(newbuf)
-		{
-			TePGConnection::freeMem(newbuf);
-			newbuf = NULL;
-		}
-		return false;
-	}
-	if(newbuf)
-	{
-		TePGConnection::freeMem(newbuf);
-		newbuf = NULL;
-	}
-	return true;
-}
-
-bool TePostgreSQL::insertTableInfo(int layerId, TeTable& table, const string& user)
-{
-	errorMessage_ = "";
-
-	if(table.name().empty())
-		return false;
-
-	if(table.id() <= 0)
-	{
-		string sql  = "INSERT INTO te_layer_table (";
-		
-		if(layerId > 0)
-		{
-			sql += "layer_id, ";
-		}
-
-		sql += "attr_table, unique_id, attr_link, attr_initial_time, attr_final_time, ";
-		sql += "attr_time_unit, attr_table_type, user_name) VALUES(";
-		
-		if(layerId > 0)
-		{
-			sql += Te2String(layerId) + ", ";
-		}	
-		
-		sql += "'" + table.name();
-		sql += "', '" + table.uniqueName();		
-		sql += "', '";
-		sql += table.linkName();
-		sql += "', '";
-		sql += table.attInitialTime();
-		sql += "', '";
-		sql += table.attFinalTime();
-		sql += "', ";
-		sql += Te2String(table.attTimeUnit());
-		sql += ", ";
-		sql += Te2String(table.tableType());
-		sql += ", '";
-		sql += user;
-		sql += "')";
-
-		if(this->execute(sql))
-		{
-			sql = "SELECT currval('te_layer_table_table_id_seq')";
-			TePGRecordset rec;
-			rec.open(sql, &tepg_connection_);
-
-			if(rec.recordCount() > 0)
-				table.setId(rec.getInt(0));
-
-			rec.close();
-		}
-		else
-			return false;
-	}
-	
-	return true;	
-}
-
-
-bool TePostgreSQL::alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName)
-{
-	if(!tableExist(tableName))
-		return false;
-
-	string tab;
-
-	if(!oldColName.empty())
-	{
-		tab  = " ALTER TABLE " + tableName + " RENAME COLUMN ";
-		tab += oldColName +  " TO " + rep.name_;
-	}
-	else
-	{
-		tab  = " ALTER TABLE " + tableName + " ALTER COLUMN ";
-		tab += rep.name_ + " TYPE ";
-
-		switch (rep.type_)
-		{
-			case TeSTRING:
-				if(rep.numChar_ > 0)
-				{
-					tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
-				}
-				else
-				{
-					tab += "TEXT ";
-				}	
-				break;
-				
-			case TeREAL:
-				tab += "FLOAT8";	
-				break;
-				
-			case TeINT:
-				tab += (rep.isAutoNumber_ ? "SERIAL" : "INTEGER");
-				break;
-
-			case TeDATETIME:
-				tab += "TIMESTAMP(0)";
-				break;
-
-			case TeCHARACTER:
-				tab += "CHAR";
-				break;
-
-			case TeBLOB:
-				tab += "BYTEA";
-				break; 
-			
-			default:
-				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
-				break;
-		}	
-	}
-
-	if(!execute(tab))
-	{
-		if(errorMessage_.empty())
-			errorMessage_ = "Error alter table " + tableName + " !";
-
-		return false;
-	}
-
-	string tableId;
-	TeDatabasePortal* portal = getPortal();
-	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + tableName + "'";
-	if(portal->query(sql) && portal->fetchRow())
-		tableId = portal->getData(0);
-
-	delete portal;
-
-	if(tableId.empty() == false)
-	{
-		if(oldColName.empty() == false) // column name changed
-		{
-			 // update relation
-			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
-			sql += " WHERE related_table_id = " + tableId;
-			sql += " AND related_attr = '" + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-
-			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
-			sql += " WHERE external_table_name = '" + tableName + "'";
-			sql += " AND external_attr = '" + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-
-			 // update grouping
-			sql = "UPDATE te_grouping SET grouping_attr = '" + tableName + "." + rep.name_ + "'";
-			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-		}
-		else // column type changed
-		{
-			// delete relation
-			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
-			sql += " AND related_attr = '" + rep.name_ + "')";
-			sql += " OR (external_table_name = '" + tableName + "'";
-			sql += " AND external_attr = '" + rep.name_ + "')";
-			if(execute(sql) == false)
-				return false;
-
-			// delete grouping
-			TeDatabasePortal* portal = getPortal();
-			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
-			if(portal->query(sql) && portal->fetchRow())
-			{
-				string themeId = portal->getData(0);
-
-				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
-				if(execute(sql) == false)
-				{
-					delete portal;
-					return false;
-				}
-			}
-			delete portal;
-
-			sql = "DELETE FROM te_grouping";
-			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-		}
-	}
-	alterTableInfoInMemory(tableName);
-	return true;
-}
-
-bool TePostgreSQL::alterTable(const string& oldTableName, const string& newTableName)
-{
-	string sql = " ALTER TABLE "+ oldTableName +" RENAME TO "+ newTableName;
-	if(!this->execute(sql))
-		return false;
-
-	//update te_layer_table
-	sql = " UPDATE te_layer_table ";
-	sql += " SET attr_table = '"+ newTableName +"'";
-	sql += " WHERE attr_table = '"+ oldTableName +"'";
-	execute(sql);
-
-	//update te_tables_relation
-	sql = " UPDATE te_tables_relation ";
-	sql += " SET external_table_name = '"+ newTableName +"'";
-	sql += " WHERE external_table_name = '"+ oldTableName +"'";
-	execute(sql);
-	
-	alterTableInfoInMemory(newTableName, oldTableName);
-	return true;
-}
-
-bool TePostgreSQL::insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size)
-{
-	if (whereClause.empty())
-		return false;
-
-	errorMessage_ = "";
-
-	TePostgreSQLPortal* portal = static_cast<TePostgreSQLPortal*>(this->getPortal());
-	
-	if(!portal)
-		return false;
-
-	string q = "SELECT * FROM "+ tableName +" WHERE "+ whereClause;
-	if((!portal->query(q)) || (!portal->fetchRow()))
-	{
-		delete portal;
-		return false;
-	}
-
-//	int exist = portal->getInt(columnBlob);
-
-	delete portal;
-
-	size_t newLen = 0;
-
-	unsigned char* newbuf = TePGConnection::escapeBytea(data, size, &newLen);
-
-	string sql  = "UPDATE ";
-	       sql += tableName;
-	       sql += " SET ";
-	       sql += columnBlob;
-	       sql += " = '";
-	       sql += (char*)newbuf;
-		   sql += "' WHERE ";
-		   sql += whereClause;
-
-	if (!TePostgreSQL::execute(sql))
-	{
-		TePGConnection::freeMem(newbuf);
-		newbuf = NULL;
-
-		errorMessage_ = "Couldn't update blob!";
-
-		return false;
-	}
-
-	TePGConnection::freeMem(newbuf);
-	newbuf = NULL;
-
-	return true;
-}
-
-bool TePostgreSQL::insertProjection(TeProjection *proj)
-{
-	errorMessage_ = "";
-
-	TeProjectionParams par = proj->params();
-
-	string sql  = "INSERT INTO te_projection (name, long0, lat0, offx, ";
-		   sql += "offy, stlat1, stlat2, unit, scale, ";
-		   sql += "hemis, datum, radius, flattening, ";
-		   sql += "dx, dy, dz) VALUES('";
-		   sql += proj->name();
-		   sql += "', ";
-		   sql += Te2String(par.lon0*TeCRD, 15);
-		   sql += ", ";
-		   sql += Te2String(par.lat0*TeCRD, 15);
-		   sql += ", ";
-		   sql += Te2String(par.offx, 15);
-		   sql += ", ";
-		   sql += Te2String(par.offy, 15);
-		   sql += ", ";
-		   sql += Te2String(par.stlat1*TeCRD, 15);
-		   sql += ", ";
-		   sql += Te2String(par.stlat2*TeCRD, 15);
-		   sql += ", '";
-		   sql += par.units;
-		   sql += "', ";
-		   sql += Te2String(par.scale, 15);
-		   sql += ", ";
-		   sql += Te2String(par.hemisphere);
-		   sql += ", '";
-		   sql += proj->datum().name();
-		   sql += "', ";
-		   sql += Te2String(proj->datum().radius(), 15);
-		   sql += ", ";
-		   sql += Te2String(proj->datum().flattening(), 15);
-		   sql += ", ";
-		   sql += Te2String(proj->datum().xShift(), 15);
-		   sql += ", ";
-		   sql += Te2String(proj->datum().yShift(), 15);
-		   sql += ", ";
-		   sql += Te2String(proj->datum().zShift(), 15);
-		   sql += ")";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('te_projection_projection_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-			proj->id(rec.getInt(0));
-
-		rec.close();
-	}
-	else
-		return false;
-		
-	return true;	
-}
-
-
-bool TePostgreSQL::insertLayer(TeLayer *layer)
-{
-	errorMessage_ = "";
-
-	TeProjection* proj = layer->projection();
-	if (!proj || !insertProjection(proj))
-	{
-		errorMessage_ = "Error inserting projection!";
-		return false;
-	}
-
-	string sql  = "INSERT INTO te_layer (projection_id, name, lower_x, lower_y, upper_x, ";
-		   sql += "upper_y, edition_time) VALUES(";
-		   sql += Te2String(proj->id());
-		   sql += ", '";
-		   sql += layer->name();
-	       sql += "', ";
-	       sql += Te2String(layer->box().x1(), 15);
-	       sql += ", ";
-	       sql += Te2String(layer->box().y1(), 15);
-	       sql += ", ";
-	       sql += Te2String(layer->box().x2(), 15);
-	       sql += ", ";
-	       sql += Te2String(layer->box().y2(), 15);
-		   sql += ", ";
-		   TeTime editionTime = layer->getEditionTime();
-		   sql += getSQLTime(editionTime);
-	       sql += ")";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('te_layer_layer_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-		{
-			layer->id(rec.getInt(0));
-		}
-		rec.close();
-	}
-	else
-		return false;
-
-	layerMap()[layer->id()] = layer;
-
-	return true;	
-}
-
-
-bool TePostgreSQL::insertProject(TeProject *project)
-{
-	errorMessage_ = "";
-
-	if (!project)
-		return false;
-
-	string sql  = "INSERT INTO te_project (name, description, current_view) VALUES(";
-		   sql += " '";
-		   sql += project->name();
-	       sql += "', '";
-		   sql += project->description();
-	       sql += "', ";
-		   sql += Te2String(project->getCurrentViewId());
-	       sql += ")";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('te_project_project_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-		{
-			project->setId(rec.getInt(0));
-		}
-		rec.close();
-	}
-	else
-		return false;
-	projectMap()[project->id()] = project;
-	for (unsigned int i=0; i<project->getViewVector().size(); i++)
-		insertProjectViewRel(project->id(), project->getViewVector()[i]);
-	return true;	
-}
-
-
-
-bool TePostgreSQL::insertRepresentation(int layerId, TeRepresentation& rep)
-{	
-	errorMessage_ = "";
-
-	if(layerId <= 0)
-		return false;
-	
-
-	string sql  = "INSERT INTO te_representation (layer_id, geom_type, geom_table, description, lower_x, ";
-		   sql += "lower_y, upper_x, upper_y, res_x, res_y, num_cols, num_rows) VALUES(";
-		   sql += Te2String(layerId);
-		   sql += ", ";
-		   sql += Te2String(static_cast<long>(rep.geomRep_));
-		   sql += ", '";
-		   sql += rep.tableName_;
-		   sql += "', '";
-		   sql += rep.description_;		   
-		   sql += "', ";
-           sql += Te2String(rep.box_.x1(), 15);
-		   sql += ", ";
-		   sql += Te2String(rep.box_.y1(), 15);
-		   sql += ", ";
-		   sql += Te2String(rep.box_.x2(), 15);
-		   sql += ", ";
-		   sql += Te2String(rep.box_.y2(), 15);
-		   sql += ", ";
-		   sql += Te2String(rep.resX_, 15);
-		   sql += ", ";
-		   sql += Te2String(rep.resY_, 15);
-		   sql += ", ";
-		   sql += Te2String(static_cast<long>(rep.nCols_));
-		   sql += ", ";
-		   sql += Te2String(static_cast<long>(rep.nLins_));
-		   sql += ")";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('te_representation_repres_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-			rep.id_ = rec.getInt(0);
-
-		rec.close();
-	}
-	else
-		return false;
-
-	return true;		
-}
-
-bool TePostgreSQL::insertView(TeView *view)
-{
-	errorMessage_ = "";
-
-	// save it�s projection
-	TeProjection* proj = view->projection();
-	if ( !proj || !insertProjection(proj))
-	{
-		errorMessage_ = "Error inserting projection";
-		return false;
-	}
-
-	string sql  = "INSERT INTO te_view (projection_id, name, user_name, visibility, lower_x, lower_y, upper_x, upper_y, current_theme) VALUES(";
-	       sql += Te2String(proj->id());
-		   sql += ", '";
-		   sql += view->name();
-		   sql += "', '";
-		   sql += view->user();
-		   sql += "', ";
-		   sql += Te2String(view->isVisible()) + ", ";
-		   sql += Te2String(view->getCurrentBox().lowerLeft().x(),15) + ", ";
-		   sql += Te2String(view->getCurrentBox().lowerLeft().y(),15) + ", ";
-		   sql += Te2String(view->getCurrentBox().upperRight().x(),15) + ", ";
-		   sql += Te2String(view->getCurrentBox().upperRight().y(),15) + ", ";
-		   if(view->getCurrentTheme() == -1)
-				sql += "null ";
-		   else
-				sql += Te2String(view->getCurrentTheme());
-		   sql += ")";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('te_view_view_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-		{
-			view->id(rec.getInt(0));
-		}
-		rec.close();
-	}
-	else
-		return false;
-
-	for(unsigned int th = 0; th < view->size(); ++th)
-	{
-		TeViewNode* node = view->get (th);
-		if (node->type() == TeTHEME)
-		{
-			TeTheme *theme = (TeTheme*) node;
-			insertTheme (theme);
-		}
-		else
-		{
-			TeViewTree* tree = (TeViewTree*)node;
-			insertViewTree (tree);
-		}
-	}
-
-	viewMap()[view->id()] = view;
-
-	return true;
-}
-
-bool TePostgreSQL::insertViewTree(TeViewTree *tree)
-{
-	errorMessage_ = "";
-
-	string sql  = "INSERT INTO te_theme (view_id, name, parent_id, priority, node_type) VALUES(";
-
-		   sql += Te2String(tree->view());
-		   sql += ", '";
-	       sql += tree->name();
-	       sql += "', ";
-	       sql += Te2String(tree->parentId());
-	       sql += ", ";
-		   sql += Te2String(tree->priority());
-	       sql += ", ";
-	       sql += Te2String(tree->type());
-	       sql += ", ";
-	       
-	       sql += ")";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('te_theme_theme_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-			tree->id(rec.getInt(0));
-
-		rec.close();
-	}
-	else
-		return false;
-		
-	return true;	
-}
-
-bool TePostgreSQL::insertThemeGroup(TeViewTree* tree)
-{
-	errorMessage_ = "";
-
-	string sql  = "INSERT INTO te_theme (name, parent_id, node_type, view_id, priority) VALUES(";
-	       sql += "'";
-		   sql += tree->name();
-		   sql += "', 1, 1, ";
-		   sql += Te2String(tree->view());
-		   sql += ", ";
-	       sql += Te2String(tree->priority());
-	       sql += ")";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('te_theme_theme_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-			tree->id(rec.getInt(0));
-
-		rec.close();
-	}
-	else
-		return false;
-		
-	return true;	
-}
-
-bool TePostgreSQL::insertTheme(TeAbstractTheme *theme)
-{
-	errorMessage_ = "";
-
-	string sql  = "INSERT INTO te_theme (layer_id, view_id, name, parent_id, priority, node_type, ";
-	       sql += "min_scale, max_scale, generate_attribute_where, generate_spatial_where, ";
-		   sql += "generate_temporal_where, collection_table, visible_rep, enable_visibility, ";
-		   sql += "lower_x, lower_y, upper_x, upper_y, creation_time) VALUES(";
-		   
-		   if(theme->type()==TeTHEME)
-			   sql += Te2String(static_cast<TeTheme*>(theme)->layerId());
-		   else
-			   sql += " NULL ";
-		   sql += ", ";
-		   sql += Te2String(theme->view());
-		   sql += ", '";
-		   sql += theme->name();
-		   sql += "', ";
-		   sql += Te2String(theme->parentId());
-		   sql += ", ";
-		   sql += Te2String(theme->priority());
-		   sql += ", ";
-		   sql += Te2String(theme->type());
-		   sql += ", ";
-		   sql += Te2String(theme->minScale(), 15);
-		   sql += ", ";
-		   sql += Te2String(theme->maxScale(), 15);
-		   sql += ", '";
-		   sql += escapeSequence(theme->attributeRest());
-		   sql += "', '";
-		   sql += escapeSequence(theme->spatialRest());
-		   sql += "', '";
-		   sql += escapeSequence(theme->temporalRest());
-		   sql += "', '";
-		   if(theme->type()==TeTHEME)
-				sql += static_cast<TeTheme*>(theme)->collectionTable();
-		   sql += "', ";
-		   sql += Te2String(theme->visibleRep());
-		   sql += ", ";
-		   sql += Te2String(theme->visibility());
-		   sql += ", ";
-		   sql += Te2String(theme->box().x1(), 15);
-		   sql += ", ";
-		   sql += Te2String(theme->box().y1(), 15);
-		   sql += ", ";
-		   sql += Te2String(theme->box().x2(), 15);
-		   sql += ", ";
-		   sql += Te2String(theme->box().y2(), 15);
-		   sql += ", ";
-		   TeTime creationTime = theme->getCreationTime();
-		   sql += getSQLTime(creationTime);
-		   sql += " )";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('te_theme_theme_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-		{
-			theme->id(rec.getInt(0));
-		}
-		rec.close();
-	}
-	else
-		return false;
-
-
-	if((theme->type()==TeTHEME || theme->type()==TeEXTERNALTHEME) && static_cast<TeTheme*>(theme)->collectionTable().empty())
-	{
-		sql  = "UPDATE te_theme SET collection_table = '";
-		sql += "te_collection_";
-		sql += Te2String(theme->id());
-		sql += "' WHERE theme_id = ";
-		sql += Te2String(theme->id());
-
-		static_cast<TeTheme*>(theme)->collectionTable(string("te_collection_") + Te2String(theme->id()));
-
-		if(!this->execute(sql))
-			return false;
-	}
-
-
-	bool status;
-
-	// insert grouping
-	int numSlices = 0;
-	if(theme->grouping().groupMode_ != TeNoGrouping)
-	{
-		if(!insertGrouping (theme->id(), theme->grouping()))
-			return false;
-		numSlices = theme->grouping().groupNumSlices_;
-	}
-		
-	// insert legend
-	theme->outOfCollectionLegend().group(-1); 
-	theme->outOfCollectionLegend().theme(theme->id()); 
-	status = insertLegend (&(theme->outOfCollectionLegend())); 
-	if (!status)
-		return status;
-
-	theme->withoutDataConnectionLegend().group(-2); 
-	theme->withoutDataConnectionLegend().theme(theme->id()); 
-	status = insertLegend (&(theme->withoutDataConnectionLegend())); 
-	if (!status)
-		return status;
-
-	theme->defaultLegend().group(-3); 
-	theme->defaultLegend().theme(theme->id()); 
-	status = insertLegend (&(theme->defaultLegend())); 
-	if (!status)
-		return status;
-
-	theme->pointingLegend().group(-4); 
-	theme->pointingLegend().theme(theme->id()); 
-	status = insertLegend (&(theme->pointingLegend())); 
-	if (!status)
-		return status;
-
-	theme->queryLegend().group(-5); 
-	theme->queryLegend().theme(theme->id()); 
-	status = insertLegend (&(theme->queryLegend())); 
-	if (!status)
-		return status;
-
-	theme->queryAndPointingLegend().group(-6); 
-	theme->queryAndPointingLegend().theme(theme->id()); 
-	status = insertLegend (&(theme->queryAndPointingLegend())); 
-	if (!status)
-		return status;
-
-	for (int i = 0; i < numSlices; i++)
-	{
-		theme->legend()[i].group(i);
-		theme->legend()[i].theme(theme->id());
-		status = insertLegend (&(theme->legend()[i]));
-		if (!status)
-			return status;
-	}
-	if (!status)
-		return status;
-
-	//insert metadata theme
-	if(!theme->saveMetadata(this))
-		return false;
-
-	themeMap()[theme->id()] = theme;
-
-	if(theme->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(theme)))
-		return false;
-
-	return true;
-}
-
-bool TePostgreSQL::insertThemeTable(int themeId, int tableId, int relationId, int tableOrder)
-{
-	errorMessage_ = "";
-
-	string sql  = "INSERT INTO te_theme_table (theme_id, table_id, ";
-
-	if(relationId > 0)
-		sql += "relation_id, ";
-
-	sql += "table_order) VALUES(";
-	sql += Te2String(themeId);
-	sql += ", ";
-	sql += Te2String(tableId);
-	sql += ", ";
-
-	if(relationId > 0)
-	{
-		sql += Te2String(relationId);
-		sql += ", ";
-	}
-
-	sql += Te2String(tableOrder);
-	sql += ")";
-
-	if(this->execute(sql))
-	{
-		//sql = "SELECT currval('te_theme_table_theme_table_id_seq')";
-		//TePGRecordset rec;
-		//rec.open(sql, &tepg_connection_);
-		//if(rec.recordCount() > 0)
-		//{
-		//	tree->id(atoi(rec.value(0)));
-		//}
-		//rec.close();
-	}
-	else
-		return false;
-		
-	return true;	
-}
-
-bool TePostgreSQL::generateLabelPositions(TeTheme *theme, const std::string& objectId)
-{
-	string	geomTable, upd;
-	string	collTable = theme->collectionTable();
-	
-	if((collTable.empty()) || (!tableExist(collTable)))
-		return false;
-
-	if(theme->layer()->hasGeometry(TeCELLS)    || 
-	   theme->layer()->hasGeometry(TePOLYGONS) ||
-	   theme->layer()->hasGeometry(TeLINES))
-	{
-		geomTable = theme->layer()->tableName(TeCELLS);
-		
-		if(geomTable.empty())
-		{
-			geomTable = theme->layer()->tableName(TePOLYGONS);
-			if(geomTable.empty())
-			{
-				geomTable = theme->layer()->tableName(TeLINES);
-
-				if(geomTable.empty())
-					return false;
-			}
-		}
-		
-		string lower_x =  "(((" + geomTable + ".spatial_box[1])[0]))";
-		string lower_y =  "(((" + geomTable + ".spatial_box[1])[1]))";
-		string upper_x =  "(((" + geomTable + ".spatial_box[0])[0]))";
-		string upper_y =  "(((" + geomTable + ".spatial_box[0])[1]))";
-		
-		upd  = " UPDATE " + collTable + " SET ";
-		upd += " label_x = (SELECT MAX(" + lower_x + " + (" + upper_x;
-		upd += " - " + lower_x + ") / 2.0) ";
-		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
-		
-		upd += " label_y = (SELECT MAX(" + lower_y + " + (" + upper_y;
-		upd += " - " + lower_y + ") / 2.0) ";
-		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
-
-		upd += " WHERE (label_x IS NULL) OR (label_y IS NULL)";
-	}	
-	else if(theme->layer()->hasGeometry(TePOINTS))
-	{
-		geomTable = theme->layer()->tableName(TePOINTS);
-	
-		upd  = " UPDATE " + collTable + " SET ";
-		upd += " label_x = (SELECT MAX(x)";
-		upd += " FROM " + geomTable + " WHERE object_id = c_object_id), ";
-
-
-		upd += " label_y = (SELECT MAX(y)";
-		upd += " FROM " + geomTable + " WHERE object_id = c_object_id) ";
-
-		upd += " WHERE (label_x IS NULL) OR (label_y IS NULL)";
-	}
-
-	if (!upd.empty())
-	{
-		if (!objectId.empty())
-		{
-			upd += " AND c_object_id='"+objectId+"'";
-		}
-		if(!execute(upd))
-			return false;
-	}
-
-	return true;
-}
-
-bool TePostgreSQL::insertLegend(TeLegendEntry *legend)
-{
-	errorMessage_ = "";
-
-	string sql  = "INSERT INTO te_legend (theme_id, group_id, num_objs, lower_value, upper_value, ";
-		   sql += "label) VALUES(";
-		   sql += Te2String(legend->theme());
-		   sql += ", ";
-		   sql += Te2String(legend->group());
-		   sql += ", ";
-	   	   sql += Te2String(legend->count());
-		   sql += ", '";
-		   sql += escapeSequence(legend->from());
-		   sql += "', '";
-		   sql += escapeSequence(legend->to());
-		   sql += "', '";
-		   sql += escapeSequence(legend->label());
-		   sql += "')";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('te_legend_legend_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-		{
-			legend->id(rec.getInt(0));
-		}
-		rec.close();
-	}
-	else
-		return false;	
-
-	legendMap()[legend->id()] = legend;
-
-	return insertVisual(legend);
-}
-
-bool TePostgreSQL::loadPolygonSet(const string& table, TeBox& box, TePolygonSet& ps)
-{
-	TeDatabasePortal *portal = this->getPortal();
-
-	if(!portal)
-		return false;
-
-	string q = "SELECT * FROM " + table + " WHERE ";
-	       q += this->getSQLBoxWhere(box, TePOLYGONS);
-	       q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
-
-	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		ps.add(poly);
-	}
-	while (flag);
-
-	delete portal;
-
-	return true;
-}
-
-TeDatabasePortal* TePostgreSQL::loadPolygonSet(const string& table, TeBox& box)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	
-	if(!portal)
-		return 0;
-
-	string q = "SELECT * FROM " + table + " WHERE ";
-	       q += this->getSQLBoxWhere(box, TePOLYGONS);
-	       q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
-
-	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return 0;
-	}
-	else 
-		return portal;
-}
-
-bool TePostgreSQL::locatePolygon(const string& table, TeCoord2D& pt, TePolygon& polygon, const double& tol)
-{
-	TeDatabasePortal *portal = this->getPortal();
-
-	if (!portal)
-		return false;
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-
-
-	string sql  = "SELECT * FROM ";
-	       sql += table;
-		   sql += " WHERE ";
-		   sql += getSQLBoxWhere(box, TePOLYGONS);
-		   sql += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
-		   
-	
-	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-
-	do
-	{
-		TePolygon poly;
-
-		flag = portal->fetchGeometry(poly);
-
-		if(TeWithin(TePoint(pt), poly))
-		{
-			polygon = poly;
-			delete portal;
-			return true;
-		}
-	}
-	while(flag);
-	
-	delete portal;
-	
-	return false;
-}
-
-bool TePostgreSQL::locatePolygonSet(const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	
-	if (!portal)
-		return false;
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-
-
-	string sql  = "SELECT * FROM ";
-	       sql += table;
-		   sql += " WHERE ";
-		   sql += getSQLBoxWhere(box, TePOLYGONS);
-		   sql += " ORDER BY object_id, parent_id, num_holes DESC, ext_max ASC";
-
-	if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-	
-	polygons.clear();
-	
-	do
-	{
-		TePolygon poly;
-
-		flag = portal->fetchGeometry(poly);
-
-		if(TeWithin(TePoint(pt), poly))
-			polygons.add(poly);
-	}
-	while (flag);
-
-	delete portal;
-
-	if(polygons.size())
-		return (true);
-
-	return false;
-}
-
-bool TePostgreSQL::insertPolygon(const string& table, TePolygon &p)
-{
-	errorMessage_ = "";
-
-	int parentId = 0;
-
-	for(unsigned int k = 0u; k < p.size(); ++k)
-	{
-		TeLinearRing& ring = p[k];
-
-		TeBox b = ring.box();
-
-		unsigned int ringSize = ring.size();
-
-		double extMax = MAX(b.width(), b.height());
-
-		unsigned int numberOfHoles = 0u;
-		
-		if(k == 0u)
-			numberOfHoles = p.size() - 1u;
-
-		unsigned int sizeBinaryRing = 0;
-		unsigned int sizeBinaryBox = 0;
-		char* binaryRing = TeLine2DToPGBinary(ring, sizeBinaryRing);
-		char* binaryBox = TeBoxToPGBinary(b, sizeBinaryBox);
-
-		int nParams = 7;
-		Oid paramTypes[7];
-		const char *paramValues[7];
-		int paramLengths[7];
-		int paramFormats[7];
-		
-		//tipos dos parametros
-		paramTypes[0] = PG_VARCHAR_TYPE;
-		paramTypes[1] = PG_INT4_TYPE;
-		paramTypes[2] = PG_INT4_TYPE;
-		paramTypes[3] = PG_INT4_TYPE;
-		paramTypes[4] = PG_BOX_TYPE;
-		paramTypes[5] = PG_FLOAT8_TYPE;
-		paramTypes[6] = PG_POLYGON_TYPE;
-
-		string strOid = escapeSequence(p.objectId());
-		paramValues[0] = strOid.c_str();
-
-		string strSize = Te2String(ringSize);
-		paramValues[1] = strSize.c_str();		
-
-		string strHoles = Te2String(numberOfHoles);
-		paramValues[2] = strHoles.c_str();
-
-		string strParent = Te2String(parentId);
-		paramValues[3] = strParent.c_str();		
-
-		paramValues[4] = binaryBox;
-
-		char* chrExtMax = new char[sizeof(double)];
-		double swappedDouble = TeConvertToBigEndian(extMax);
-		memcpy(chrExtMax, &swappedDouble, sizeof(double));
-		paramValues[5] = chrExtMax;
-
-		paramValues[6] = binaryRing;
-
-		paramLengths[0] = 0;
-		paramLengths[1] = 0;
-		paramLengths[2] = 0;
-		paramLengths[3] = 0;
-		paramLengths[4] = sizeBinaryBox;
-		paramLengths[5] = sizeof(double);
-		paramLengths[6] = sizeBinaryRing;
-		
-		paramFormats[0] = 0;
-		paramFormats[1] = 0;
-		paramFormats[2] = 0;
-		paramFormats[3] = 0;
-		paramFormats[4] = 1;
-		paramFormats[5] = 1;
-		paramFormats[6] = 1;
-		
-
-		string command = "INSERT INTO ";
-				command += table;
-				command += " (object_id, num_coords, num_holes, parent_id, spatial_box, ext_max, spatial_data)"; 
-				command += " VALUES ($1, $2, $3, $4,$5, $6, $7)";
-		
-		int result = tepg_connection_.exec_cmd_params(command.c_str(), 
-                       nParams,
-                       paramTypes,
-                       paramValues,
-                       paramLengths,
-                       paramFormats,
-                       0);
-
-		delete [] binaryRing;
-		delete [] binaryBox;
-		delete [] chrExtMax;
-
-		if(result == 1)
-		{
-			string sql = "SELECT currval('" + table + "_geom_id_seq')";
-		
-			TePGRecordset rec;
-			rec.open(sql, &tepg_connection_);
-
-			if(rec.recordCount() > 0)
-				ring.geomId(rec.getInt(0));
-
-			if(k == 0u)
-			{
-				parentId = ring.geomId();
-
-				p.geomId(ring.geomId());
-
-				string newSQL  = "UPDATE " + table + " SET parent_id = ";
-				       newSQL += Te2String(parentId);
-					   newSQL += " WHERE geom_id = ";
-					   newSQL += Te2String(parentId);
-
-				if(!this->execute(newSQL))
-					return false;
-			}
-
-			rec.close();
-		}
-		else
-			return false;
-	}
-
-	return true;
-}
-
-bool TePostgreSQL::updatePolygon(const string& table, TePolygon &p)
-{
-	errorMessage_ = "";
-
-	int parentId = 0;
-
-	for(unsigned int k = 0u; k < p.size(); ++k)
-	{
-		TeLinearRing& ring = p[k];
-
-		TeBox b = ring.box();
-
-		unsigned int ringSize = ring.size();
-
-		double extMax = MAX(b.width(), b.height());
-
-		unsigned int numberOfHoles = 0u;
-		
-		if(k == 0u)
-		{
-			parentId = ring.geomId();
-
-			numberOfHoles = p.size() - 1u;
-		}
-
-		unsigned int sizeBinaryRing = 0;
-		unsigned int sizeBinaryBox = 0;
-		char* binaryRing = TeLine2DToPGBinary(ring, sizeBinaryRing);
-		char* binaryBox = TeBoxToPGBinary(b, sizeBinaryBox);
-
-		int nParams = 7;
-		Oid paramTypes[7];
-		const char *paramValues[7];
-		int paramLengths[7];
-		int paramFormats[7];
-		
-		//tipos dos parametros
-		paramTypes[0] = PG_VARCHAR_TYPE;
-		paramTypes[1] = PG_INT4_TYPE;
-		paramTypes[2] = PG_INT4_TYPE;
-		paramTypes[3] = PG_INT4_TYPE;
-		paramTypes[4] = PG_BOX_TYPE;
-		paramTypes[5] = PG_FLOAT8_TYPE;
-		paramTypes[6] = PG_POLYGON_TYPE;
-
-		string strOid = escapeSequence(p.objectId());
-		paramValues[0] = strOid.c_str();
-
-		string strSize = Te2String(ringSize);
-		paramValues[1] = strSize.c_str();		
-
-		string strHoles = Te2String(numberOfHoles);
-		paramValues[2] = strHoles.c_str();
-
-		string strParent = Te2String(parentId);
-		paramValues[3] = strParent.c_str();		
-
-		paramValues[4] = binaryBox;
-
-		char* chrExtMax = new char[sizeof(double)];
-		double swappedDouble = TeConvertToBigEndian(extMax);
-		memcpy(chrExtMax, &swappedDouble, sizeof(double));
-		paramValues[5] = chrExtMax;
-
-		paramValues[6] = binaryRing;
-
-		paramLengths[0] = 0;
-		paramLengths[1] = 0;
-		paramLengths[2] = 0;
-		paramLengths[3] = 0;
-		paramLengths[4] = sizeBinaryBox;
-		paramLengths[5] = sizeof(double);
-		paramLengths[6] = sizeBinaryRing;
-		
-		paramFormats[0] = 0;
-		paramFormats[1] = 0;
-		paramFormats[2] = 0;
-		paramFormats[3] = 0;
-		paramFormats[4] = 1;
-		paramFormats[5] = 1;
-		paramFormats[6] = 1;
-
-		string command  = "UPDATE " + table + " SET ";
-		command += "object_id = $1";
-		command += ", num_coords = $2";
-		command += ", num_holes = $3";
-		command += ", parent_id = $4";
-		command += ", spatial_box = $5";
-		command += ", ext_max = $6";
-		command += ", spatial_data = $7";
-		command += " WHERE geom_id = ";
-		command += Te2String(ring.geomId());
-		
-		int result = tepg_connection_.exec_cmd_params(command.c_str(), 
-                       nParams,
-                       paramTypes,
-                       paramValues,
-                       paramLengths,
-                       paramFormats,
-                       0);
-
-		delete [] binaryRing;
-		delete [] binaryBox;
-		delete [] chrExtMax;
-
-		if(result != 1)
-		{
-			return false;
-		}
-	}
-
-	return true;
-}
-
-bool TePostgreSQL::loadLineSet(const string& table, TeBox& box, TeLineSet& linSet)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	
-	if(!portal)
-		return false;
-
-	string q  = "SELECT * FROM " + table + " WHERE ";
-	       q += this->getSQLBoxWhere (box, TeLINES);
-
-	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-
-	do
-	{
-		TeLine2D lin;
-		flag = portal->fetchGeometry(lin);
-		linSet.add(lin);
-	}
-	while (flag);
-
-	delete portal;
-
-	return true;
-}
-
-TeDatabasePortal* TePostgreSQL::loadLineSet(const string& table, TeBox& box)
-{
-	TeDatabasePortal *portal = this->getPortal();
-
-	if(!portal)
-		return 0;
-
-	string q  = "SELECT * FROM " + table + " WHERE ";
-	       q += this->getSQLBoxWhere (box, TeLINES);
-
-	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{	
-		delete portal;
-
-		return 0;
-	}
-
-	return portal;
-}
-
-bool TePostgreSQL::insertLine(const string& table, TeLine2D& l)
-{
-	errorMessage_ = "";
-
-	double extMax = MAX(l.box().width(), l.box().height());
-
-	unsigned int sizeBinaryRing = 0;
-	unsigned int sizeBinaryBox = 0;
-	char* binaryRing = TeLine2DToPGBinary(l, sizeBinaryRing);
-	char* binaryBox = TeBoxToPGBinary(l.box(), sizeBinaryBox);
-
-	int nParams = 5;
-	Oid paramTypes[5];
-	const char *paramValues[5];
-	int paramLengths[5];
-	int paramFormats[5];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = PG_INT4_TYPE;
-	paramTypes[2] = PG_BOX_TYPE;
-	paramTypes[3] = PG_FLOAT8_TYPE;
-	paramTypes[4] = PG_POLYGON_TYPE;
-
-	string strOid = escapeSequence(l.objectId());
-	paramValues[0] = strOid.c_str();
-
-	string strSize = Te2String(l.size());
-	paramValues[1] = strSize.c_str();		
-
-	paramValues[2] = binaryBox;
-
-	char* chrExtMax = new char[sizeof(double)];
-	double swappedDouble = TeConvertToBigEndian(extMax);
-	memcpy(chrExtMax, &swappedDouble, sizeof(double));
-	paramValues[3] = chrExtMax;
-	
-	paramValues[4] = binaryRing;
-
-	paramLengths[0] = 0;
-	paramLengths[1] = 0;
-	paramLengths[2] = sizeBinaryBox;
-	paramLengths[3] = sizeof(double);
-	paramLengths[4] = sizeBinaryRing;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 0;
-	paramFormats[2] = 1;
-	paramFormats[3] = 1;
-	paramFormats[4] = 1;
-	
-
-	string command = "INSERT INTO ";
-			command += table;
-			command += " (object_id, num_coords, spatial_box, ext_max, spatial_data)";
-			command += " VALUES ($1, $2, $3, $4, $5)";
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryRing;
-	delete [] binaryBox;
-	delete [] chrExtMax;
-
-	if(result == 1)
-	{
-		string sql = "SELECT currval('" + table + "_geom_id_seq')";
-
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-
-		if(rec.recordCount() > 0)
-			l.geomId(rec.getInt(0));
-
-		rec.close();
-	}
-	else
-		return false;
-
-	return true;
-}
-
-bool TePostgreSQL::updateLine(const string& table, TeLine2D& l)
-{
-	errorMessage_ = "";
-
-	double extMax = MAX(l.box().width(), l.box().height());
-
-	unsigned int sizeBinaryRing = 0;
-	unsigned int sizeBinaryBox = 0;
-	char* binaryRing = TeLine2DToPGBinary(l, sizeBinaryRing);
-	char* binaryBox = TeBoxToPGBinary(l.box(), sizeBinaryBox);
-
-	int nParams = 5;
-	Oid paramTypes[5];
-	const char *paramValues[5];
-	int paramLengths[5];
-	int paramFormats[5];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = PG_INT4_TYPE;
-	paramTypes[2] = PG_BOX_TYPE;
-	paramTypes[3] = PG_FLOAT8_TYPE;
-	paramTypes[4] = PG_POLYGON_TYPE;
-
-	string strOid = escapeSequence(l.objectId());
-	paramValues[0] = strOid.c_str();
-
-	string strSize = Te2String(l.size());
-	paramValues[1] = strSize.c_str();		
-
-	paramValues[2] = binaryBox;
-
-	char* chrExtMax = new char[sizeof(double)];
-	double swappedDouble = TeConvertToBigEndian(extMax);
-	memcpy(chrExtMax, &swappedDouble, sizeof(double));
-	paramValues[3] = chrExtMax;
-	
-	paramValues[4] = binaryRing;
-
-	paramLengths[0] = 0;
-	paramLengths[1] = 0;
-	paramLengths[2] = sizeBinaryBox;
-	paramLengths[3] = sizeof(double);
-	paramLengths[4] = sizeBinaryRing;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 0;
-	paramFormats[2] = 1;
-	paramFormats[3] = 1;
-	paramFormats[4] = 1;
-
-	string command = "UPDATE " + table + " SET";
-		command += " object_id = $1";
-		command += ", num_coords = $2";
-		command += ", spatial_box = $3";
-		command += ", ext_max = $4";
-		command += ", spatial_data = $5";
-		command += " WHERE geom_id = ";
-		command += Te2String(l.geomId());
-	
-	int result = tepg_connection_.exec_cmd_params(command.c_str(), 
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryRing;
-	delete [] binaryBox;
-	delete [] chrExtMax;
-
-	return (result == 1);
-}
-
-bool TePostgreSQL::locateLine(const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-
-	string sql  = "SELECT * FROM ";
-	       sql += table;
-		   sql += " WHERE ";
-		   sql += this->getSQLBoxWhere(box, TeLINES);
-
-	
-	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	// Get all lines
-	TeLineSet ls;
-	int k;
-	bool flag = true;
-	do 
-	{
-		TeLine2D l;
-		flag = portal->fetchGeometry( l );
-		ls.add ( l );
-	} while(flag);
-
-	delete portal;
-
-	TeCoord2D paux;
-
-	if(TeNearest(pt, ls, k, paux, tol))
-	{
-		line = ls[k];
-		return true;
-	}
-
-	return false;
-}
-
-bool TePostgreSQL::insertPoint(const string& table, TePoint &p)
-{
-	errorMessage_ = "";
-
-	unsigned int sizeBinaryBox = 0;
-	char* binaryBox = TeBoxToPGBinary(p.box(), sizeBinaryBox);
-
-	int nParams = 4;
-	Oid paramTypes[4];
-	const char *paramValues[4];
-	int paramLengths[4];
-	int paramFormats[4];
-	
-	//tipos dos parametros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = PG_BOX_TYPE;
-	paramTypes[2] = PG_FLOAT8_TYPE;
-	paramTypes[3] = PG_FLOAT8_TYPE;
-
-	char* chrX = new char[sizeof(double)];
-	double swappedDoubleX = TeConvertToBigEndian(p.location().x_);
-	memcpy(chrX, &swappedDoubleX, sizeof(double));
-
-	char* chrY = new char[sizeof(double)];
-	double swappedDoubleY = TeConvertToBigEndian(p.location().y_);
-	memcpy(chrY, &swappedDoubleY, sizeof(double));
-
-	string strOid = escapeSequence(p.objectId());
-	paramValues[0] = strOid.c_str();
-
-	paramValues[1] = binaryBox;
-
-	paramValues[2] = chrX;
-
-	paramValues[3] = chrY;
-	
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryBox;
-	paramLengths[2] = sizeof(double);
-	paramLengths[3] = sizeof(double);
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	paramFormats[2] = 1;
-	paramFormats[3] = 1;
-	
-	
-	string command  = "INSERT INTO " + table + " (object_id, spatial_box, x, y)";
-	command += " VALUES($1, $2, $3, $4)";
-		
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryBox;
-	delete [] chrX;
-	delete [] chrY;
-
-	if(result == 1)
-	{
-		string sql = "SELECT currval('" + table + "_geom_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-			p.geomId(rec.getInt(0));
-
-		rec.close();
-	}
-	else
-		return false;
-	
-	return true;
-}
-
-bool TePostgreSQL::updatePoint(const string& table, TePoint &p)
-{
-	unsigned int sizeBinaryBox = 0;
-	char* binaryBox = TeBoxToPGBinary(p.box(), sizeBinaryBox);
-
-	int nParams = 4;
-	Oid paramTypes[4];
-	const char *paramValues[4];
-	int paramLengths[4];
-	int paramFormats[4];
-	
-	//tipos dos par�metros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = PG_BOX_TYPE;
-	paramTypes[2] = PG_FLOAT8_TYPE;
-	paramTypes[3] = PG_FLOAT8_TYPE;
-
-	char* chrX = new char[sizeof(double)];
-	double swappedDoubleX = TeConvertToBigEndian(p.location().x_);
-	memcpy(chrX, &swappedDoubleX, sizeof(double));
-
-	char* chrY = new char[sizeof(double)];
-	double swappedDoubleY = TeConvertToBigEndian(p.location().y_);
-	memcpy(chrY, &swappedDoubleY, sizeof(double));
-
-	string strOid = escapeSequence(p.objectId());
-	paramValues[0] = strOid.c_str();
-
-	paramValues[1] = binaryBox;
-
-	paramValues[2] = chrX;
-
-	paramValues[3] = chrY;
-	
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryBox;
-	paramLengths[2] = sizeof(double);
-	paramLengths[3] = sizeof(double);
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	paramFormats[2] = 1;
-	paramFormats[3] = 1;
-
-	string command  = "UPDATE " + table + " SET ";
-	       command += " object_id = $1";
-	       command += ", spatial_box = $2";
-           command += ", x = $3";
-           command += ", y = $4";
-           command += " WHERE geom_id = " + Te2String(p.geomId());
-		
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryBox;
-	delete [] chrX;
-	delete [] chrY;
-
-	return (result == 1);
-}
-
-bool TePostgreSQL::locatePoint(const string& table, TeCoord2D& pt, TePoint& point, const double& tol)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox bbox(pt.x() - tol, pt.y() - tol, pt.x() + tol, pt.y() + tol);
-
-	string sql  = "SELECT * FROM ";
-	       sql += table;
-		   sql += " WHERE ";
-		   sql += this->getSQLBoxWhere(bbox, TePOINTS);
-
-	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	TePointSet ps;
-	
-	bool flag = true;
-
-	do 
-	{
-		TePoint point;
-		flag = portal->fetchGeometry(point);
-		ps.add(point);
-	}while(flag);
-
-	delete portal;
-	int k;
-	if(TeNearest(pt, ps, k, tol))
-	{
-		point = ps[k];
-		return true;
-	}
-	return false;
-}
-
-bool TePostgreSQL::insertText(const string& table, TeText& t)
-{
-	errorMessage_ = "";
-
-	string sql  = "INSERT INTO " + table + " (object_id, x, y, text_value, angle, height, alignment_vert, alignment_horiz) VALUES('";
-		   sql += escapeSequence(t.objectId());
-		   sql += "', ";
-		   sql += Te2String(t.location().x(), 15);
-		   sql += ", ";
-		   sql += Te2String(t.location().y(), 15);
-		   sql += ", '";
-		   sql += escapeSequence(t.textValue());
-		   sql += "', ";
-		   sql += Te2String(t.angle(), 15);
-		   sql += ", ";
-		   sql += Te2String(t.height(), 15);
-		   sql += ", ";
-		   sql += Te2String(t.alignmentVert(), 15);
-		   sql += ", ";
-		   sql += Te2String(t.alignmentHoriz(), 15);
-		   sql += ")";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('" + table + "_geom_id_seq')";
-
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-			t.geomId(rec.getInt(0));
-
-		rec.close();
-	}
-	else
-		return false;
-
-	return true;
-}
-
-bool TePostgreSQL::insertArc(const string& table, TeArc& arc)
-{
-	errorMessage_ = "";
-
-	string sql  = "INSERT INTO " + table + " (object_id, from_node, to_node) VALUES('";
-		   sql += escapeSequence(arc.objectId());
-		   sql += "', ";
-		   sql += Te2String(arc.fromNode().geomId());
-	       sql += ", ";
-		   sql += Te2String(arc.toNode().geomId());
-		   sql += ")";
-
-	if(this->execute(sql))
-	{
-		sql = "SELECT currval('" + table + "_geom_id_seq')";
-		TePGRecordset rec;
-		rec.open(sql, &tepg_connection_);
-		if(rec.recordCount() > 0)
-			arc.geomId(rec.getInt(0));
-
-		rec.close();
-	}
-	else
-		return false;
-	
-
-	return true;
-}
-
-bool TePostgreSQL::insertNode(const string& table, TeNode& node)
-{
-	errorMessage_ = "";
-
-	unsigned int sizeBinaryBox = 0;
-	char* binaryBox = TeBoxToPGBinary(node.box(), sizeBinaryBox);
-
-	int nParams = 4;
-	Oid paramTypes[4];
-	const char *paramValues[4];
-	int paramLengths[4];
-	int paramFormats[4];
-	
-	//tipos dos par�metros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = PG_BOX_TYPE;
-	paramTypes[2] = PG_FLOAT8_TYPE;
-	paramTypes[3] = PG_FLOAT8_TYPE;
-
-	char* chrX = new char[sizeof(double)];
-	double swappedDoubleX = TeConvertToBigEndian(node.location().x_);
-	memcpy(chrX, &swappedDoubleX, sizeof(double));
-
-	char* chrY = new char[sizeof(double)];
-	double swappedDoubleY = TeConvertToBigEndian(node.location().y_);
-	memcpy(chrY, &swappedDoubleY, sizeof(double));
-
-	string strOid = escapeSequence(node.objectId());
-	paramValues[0] = strOid.c_str();
-
-	paramValues[1] = binaryBox;
-
-	paramValues[2] = chrX;
-
-	paramValues[3] = chrY;
-	
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryBox;
-	paramLengths[2] = sizeof(double);
-	paramLengths[3] = sizeof(double);
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	paramFormats[2] = 1;
-	paramFormats[3] = 1;
-	
-	
-	string command  = "INSERT INTO " + table + " (object_id, spatial_box, x, y)";
-	command += " VALUES($1, $2, $3, $4)";
-		
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryBox;
-	delete [] chrX;
-	delete [] chrY;
-
-	if(result != 1)
-		return false;
-
-	string sql = "SELECT currval('" + table + "_geom_id_seq')";
-	TePGRecordset rec;
-	rec.open(sql, &tepg_connection_);
-	if(rec.recordCount() > 0)
-		node.geomId(rec.getInt(0));
-
-	rec.close();
-
-	return true;
-}
-
-bool TePostgreSQL::updateNode(const string& table, TeNode &node)
-{
-	unsigned int sizeBinaryBox = 0;
-	char* binaryBox = TeBoxToPGBinary(node.box(), sizeBinaryBox);
-
-	int nParams = 4;
-	Oid paramTypes[4];
-	const char *paramValues[4];
-	int paramLengths[4];
-	int paramFormats[4];
-	
-	//tipos dos par�metros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = PG_BOX_TYPE;
-	paramTypes[2] = PG_FLOAT8_TYPE;
-	paramTypes[3] = PG_FLOAT8_TYPE;
-
-	char* chrX = new char[sizeof(double)];
-	double swappedDoubleX = TeConvertToBigEndian(node.location().x_);
-	memcpy(chrX, &swappedDoubleX, sizeof(double));
-
-	char* chrY = new char[sizeof(double)];
-	double swappedDoubleY = TeConvertToBigEndian(node.location().y_);
-	memcpy(chrY, &swappedDoubleY, sizeof(double));
-
-	string strOid = escapeSequence(node.objectId());
-	paramValues[0] = strOid.c_str();
-
-	paramValues[1] = binaryBox;
-
-	paramValues[2] = chrX;
-
-	paramValues[3] = chrY;
-	
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryBox;
-	paramLengths[2] = sizeof(double);
-	paramLengths[3] = sizeof(double);
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	paramFormats[2] = 1;
-	paramFormats[3] = 1;
-	
-	
-	string command = "UPDATE " + table + " SET ";
-    command += "  object_id = $1";
-    command += ", spatial_box = $2";
-	command += ", x = $3";
-	command += ", y = $4";
-    command += " WHERE geom_id = " + Te2String(node.geomId());
-		
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryBox;
-	delete [] chrX;
-	delete [] chrY;
-
-	return (result == 1);
-
-}
-
-bool TePostgreSQL::insertCell(const string& table, TeCell &c)
-{
-	errorMessage_ = "";
-
-	unsigned int sizeBinaryBox = 0;
-	char* binaryBox = TeBoxToPGBinary(c.box(), sizeBinaryBox);
-
-	int nParams = 4;
-	Oid paramTypes[4];
-	const char *paramValues[4];
-	int paramLengths[4];
-	int paramFormats[4];
-	
-	//tipos dos par�metros
-	paramTypes[0] = PG_VARCHAR_TYPE;
-	paramTypes[1] = PG_BOX_TYPE;
-	paramTypes[2] = PG_INT4_TYPE;
-	paramTypes[3] = PG_INT4_TYPE;
-
-	string strOid = escapeSequence(c.objectId());
-	paramValues[0] = strOid.c_str();
-
-	paramValues[1] = binaryBox;
-
-	string strCol = Te2String(c.column());
-	paramValues[2] = strCol.c_str();		
-
-	string strRow = Te2String(c.line());
-	paramValues[3] = strRow.c_str();		
-
-	
-	paramLengths[0] = 0;
-	paramLengths[1] = sizeBinaryBox;
-	paramLengths[2] = 0;
-	paramLengths[3] = 0;
-	
-	paramFormats[0] = 0;
-	paramFormats[1] = 1;
-	paramFormats[2] = 0;
-	paramFormats[3] = 0;
-	
-	
-	string command  = "INSERT INTO " + table + " (object_id, spatial_box, col_number, row_number)";
-	command += " VALUES($1, $2, $3, $4)";
-		
-	int result = tepg_connection_.exec_cmd_params(command.c_str(),
-                    nParams,
-                    paramTypes,
-                    paramValues,
-                    paramLengths,
-                    paramFormats,
-                    0);
-
-	delete [] binaryBox;
-
-	if(result != 1)
-		return false;
-
-	string sql = "SELECT currval('" + table + "_geom_id_seq')";
-	TePGRecordset rec;
-	rec.open(sql, &tepg_connection_);
-	if(rec.recordCount() > 0)
-		c.geomId(rec.getInt(0));
-	
-	rec.close();	
-
-	return true;
-}
-
-bool TePostgreSQL::updateCell(const string& table, TeCell &c)
-{
-	TeBox b = c.box();
-
-	string sql;
-	sql = "UPDATE " + table + " SET ";
-	sql += "spatial_box = '" + PGBoxRtree_encode(b) + "', ";
-	sql += "col_number=" + Te2String(c.column()) + ", ";
-	sql += "row_number=" + Te2String(c.line());
-	sql += " WHERE geom_id = " + c.geomId();
-	
-	return (this->execute(sql));
-}
-
-bool TePostgreSQL::insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char* buf, unsigned long size, int band, unsigned int res, unsigned int subband)
-{
-	errorMessage_ = "";
-
-	if (blockId.empty()) 
-	{
-		errorMessage_ = "No block identifier provided!";
-		return false;
-	}
-
-	TePostgreSQLPortal* portal = static_cast<TePostgreSQLPortal*>(this->getPortal());
-	if(!portal)
-		return false;
-
-	bool update = false;
-	string q ="SELECT * FROM " + table; 
-	q += " WHERE block_id='" + blockId + "'";
-
-	if (!portal->query(q))
-	{
-		delete portal;
-		return false;
-	}
-
-	// check if this block is alread in the database
-	if(portal->fetchRow())
-		update = true;
-
-	delete portal;
-
-
-	string sql = "";
-		
-	size_t newLen = 0;
-
-	unsigned char* newbuf = TePGConnection::escapeBytea(buf, size, &newLen);
-
-	if(!update)
-		getInsertRasterBlock(table, blockId, ll, ur, band, res, subband, (char*)newbuf, size, sql);
-	else
-		getUpdateRasterBlock(table, blockId, ll, ur, band, res, subband, (char*)newbuf, size, sql);
-
-
-	if(!execute(sql))
-	{
-		TePGConnection::freeMem(newbuf);
-		newbuf = NULL;
-		errorMessage_ = "Couldn't insert/update a rasterblock!";
-		return false;
-	}
-
-	TePGConnection::freeMem(newbuf);
-	newbuf = NULL;
-
-	return true;
-}
-
-string TePostgreSQL::getSQLStatistics(TeGroupingAttr& attrs)
-{
-	string sql = "";
-	string virg = "";
-
-	TeGroupingAttr::iterator it = attrs.begin();
-	int count = 0;
-	while(it != attrs.end())
-	{
-		if(count > 0)
-			virg = ",";
-
-		string strAux = (*it).first.name_;
-		size_t pos = strAux.find(".");
-		if(pos != string::npos)
-			strAux[pos] = '_';
-
-		switch((*it).second)
-		{
-			case TeSUM:
-				sql += virg +" SUM( "+ (*it).first.name_ +") AS SUM_"+ strAux;
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			case TeMAXVALUE:
-				sql += virg +" MAX( "+ (*it).first.name_ +") AS MAX_"+ strAux;
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			case TeMINVALUE:
-				sql += virg +" MIN( "+ (*it).first.name_ +") AS MIN_"+ strAux;
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			case TeCOUNT:
-				sql += virg +" COUNT( "+ (*it).first.name_ +") AS COUNT_"+ strAux;
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			case TeMEAN:
-				sql += virg +" AVG( "+ (*it).first.name_ +") AS AVG_"+ strAux;
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			case TeSTANDARDDEVIATION:
-				sql += virg +" STDDEV( "+ (*it).first.name_ +") AS STDDEV_"+ strAux;
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			case TeVARIANCE:
-				sql += virg +" VARIANCE( "+ (*it).first.name_ +") AS VAR_"+ strAux;
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			default:
-				break;
-		}
-		++it;
-
-	}
-
-	return sql;
-}
-
-string TePostgreSQL::getSQLTemporalWhere(TeTimeInterval& timeInterval, TeTemporalRelation timeOperator, const string& initialTime, const string& finalTime)
-{
-	string sql;
-	
-	string t1 = timeInterval.getInitialDateTime("YYYYsMMsDDsHHsmmsSS");
-	string t2 = timeInterval.getFinalDateTime ("YYYYsMMsDDsHHsmmsSS");
-	
-	switch(timeOperator)
-	{
-		case TeTIMEBEFORE:		sql = finalTime +" < '"+ t1 +"'";
-								break;
-
-		case TeTIMEAFTER:		sql = initialTime +" > '"+ t2 +"'";
-								break;
-
-		case TeTIMEEQUAL:       sql = "("+ initialTime +" >= '"+ t1 +"'";
-								sql += " AND "+ initialTime +" <= '"+ t2 +"')";
-								sql += " AND ";
-								sql += "("+ finalTime +" >= '"+ t1 +"'";
-								sql += " AND "+ finalTime +" <= '"+ t2 +"')";
-								break;
-
-		case TeTIMEMEETS:       sql = finalTime +" = '"+ t1 +"'";
-								sql += " OR "+ initialTime +" = '"+ t2 +"'";
-								break;
-
-		case TeTIMEDURING:		sql = initialTime +" > '"+ t1 +"'";
-								sql += " AND "+ initialTime +" < '"+ t2 +"'";
-								sql += " AND "+ finalTime +" > '"+ t1 +"'";
-								sql += " AND "+ finalTime +" < '"+ t2 +"'";
-								break;
-
-		case TeTIMEOVERLAPS:    sql = "("+ initialTime +" < '"+ t1 +"'";
-								sql += " AND "+ finalTime +" > '"+ t1 +"'";
-								sql += " AND "+ finalTime +" < '"+ t2 +"')";
-								sql += " OR ";
-								sql += "("+ initialTime + " > '"+ t1 +"'";
-								sql += " AND "+ initialTime +" < '"+ t2 +"'";
-								sql += " AND "+ finalTime +" > '"+ t2 +"')";
-								break;
-
-		case TeTIMEENDS:		sql = finalTime +" = '"+ t2 +"'";
-								break;
-
-		case TeTIMESTARTS:		sql = initialTime +" = '"+ t1 +"'";
-								break;
-		case TeTIMEUNDEFINED:	
-				return sql;				
-	}
-
-	return sql; 
-}
-
-string TePostgreSQL::getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, const string& initialTime, const string& finalTime)
-{
-	string func = " EXTRACT(";
-	string sql;
-
-	switch(chr)
-	{
-		case TeSECOND:		func = "second FROM "; 
-							break;
-		
-		case TeMINUTE:		func = "minute FROM ";
-							break;
-		
-		case TeHOUR:        func = "hour FROM ";
-							break;
-		
-		case TeDAY:         func = "day FROM ";
-							break;
-
-		case TeMONTH:		func = "month FROM ";
-							break;
-
-		case TeYEAR:        func = "year FROM ";	
-							break;
-		default:			return "";
-	}
-
-	switch(rel)
-	{
-		case TeTIMEBEFORE:		sql = func + finalTime + ") < " + Te2String(time1);
-								break;
-		
-		case TeTIMEAFTER:		sql = func + initialTime + ") > " + Te2String(time2);
-								break;
-		
-		case TeTIMEEQUAL:		sql  = func + initialTime + ") = " + Te2String(time1);
-								sql += " AND "+ func + finalTime +") = " + Te2String(time2);
-								break;
-
-		case TeTIMEMEETS:		sql  = func + finalTime + ") = " + Te2String(time1);
-								sql += " OR "+ func + initialTime +") = " + Te2String(time2);
-								break;
-
-		case TeTIMEDURING:		sql  = func + initialTime + ") >= " + Te2String(time1);
-								sql += " AND " + func + initialTime + ") <= " + Te2String(time2);
-								sql += " AND " + func + finalTime + ") >= " + Te2String(time1);
-								sql += " AND " + func + finalTime + ") <= " + Te2String(time2);
-								break;
-
-		case TeTIMEOVERLAPS:    sql  =  "("+ func + initialTime + ") <= " + Te2String(time1);
-								sql += " AND " + func + finalTime + ") >= " + Te2String(time1);
-								sql += " AND " + func + finalTime + ") <= " + Te2String(time2) + ")";
-								sql += " OR ";
-								sql += "(" + func + initialTime + ") >= " + Te2String(time1);
-								sql += " AND " + func + initialTime + ") <= " + Te2String(time2);
-								sql += " AND " + func + finalTime + ") >= " + Te2String(time2) +")";
-								break;
-
-		case TeTIMEENDS:		sql = func + finalTime + ") = " + Te2String(time2);
-								break;
-
-		case TeTIMESTARTS:		sql = func + initialTime + ") = " + Te2String(time1);
-								break;
-		case TeTIMEUNDEFINED:	
-				return sql;				
-	}
-	
-	return sql;
-}
-
-string TePostgreSQL::getAutoNumberSQL(const string& table)
-{
-	errorMessage_ = "";
-
-	TePGRecordset rec;
-
-	string sql = "SELECT adsrc FROM pg_class, pg_attrdef  WHERE lower(pg_class.relname) = lower('" + table + "') AND pg_attrdef.adnum = 1 AND pg_class.oid = pg_attrdef.adrelid";
-
-	if(!rec.open(sql, &tepg_connection_))
-		return "";
-
-	if(rec.recordCount() > 0)
-	{
-		return rec.getData(0);
-	}
-	else
-		return "";
-}
-
-string TePostgreSQL::getSQLTime(TeTime& time)
-{
-	return "'" + time.getDateTime("YYYYsMMsDDsHHsmmsSS", "-") + "'";
-}
-
-string TePostgreSQL::concatValues(vector<string>& values, const string& unionString)
-{
-	string concat = "";
-	
-	for(unsigned int i = 0; i < values.size(); ++i)
-	{
-		if(i != 0)
-		{
-			concat += " || ";
-
-			if(!unionString.empty())
-			{
-				concat += "'";
-				concat += unionString;
-				concat += "'";
-				concat += " || ";
-			}
-		}
-
-		concat += values[i];
-	}
-
-	return concat;
-}
-
-string TePostgreSQL::toUpper(const string& value)
-{
-	string result  = "upper(";
-	       result += value;
-		   result += ")";
-
-	return result;
-}
-
-string TePostgreSQL::leftString(const string& name, const int& length)
-{
-    string substringClause = "SUBSTRING(" + name+ ", 1, " + Te2String(length) + ")";
-    return substringClause;
-}
-
-bool TePostgreSQL::locateCell(const string& table, TeCoord2D& pt, TeCell& c, const double& tol)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-
-
-	string sql  ="SELECT * FROM ";
-	       sql += table;
-		   sql += " WHERE ";
-		   sql += this->getSQLBoxWhere(box, TeCELLS);
-
-	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	portal->fetchGeometry(c);
-
-	delete portal;
-
-	return true;
-}
-
-bool TePostgreSQL::createSpatialIndex(const string& table, const string& column, TeSpatialIndexType /* type */, short /* level */, short /* tile */)
-{
-	string create = "CREATE INDEX sp_idx_gist_" + table + " ON " + table + " USING GIST (" + column + " " + gistBoxOps_ + ")";
-
-	return this->execute(create);
-}
-
-string TePostgreSQL::getSQLBoxWhere(TeBox &box, TeGeomRep rep)
-{
-	if(rep == TeTEXT)
-		return TeDatabase::getSQLBoxWhere(box, rep);
-
-	string colname = "spatial_box";
-
-	if(rep & TeRASTER)
-		colname = "block_box";
-	
-
-	string urx = Te2String(box.x2(), 15);
-	string llx = Te2String(box.x1(), 15);
-	string ury = Te2String(box.y2(), 15);
-	string lly = Te2String(box.y1(), 15);
-
-	string wherebox  = " ( " + colname + " && '(" + urx + ", " + ury + ", " + llx + ", " + lly + ")'::box)";
-
-	return wherebox;
-}
-
-string TePostgreSQL::getSQLBoxWhere(const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1)
-{
-	if((rep1 == TeTEXT) || (rep2 == TeTEXT))
-	{
-		return TeDatabase::getSQLBoxWhere(table1, table2, rep2, rep1);
-	}
-	else
-	{
-		string col1name = "spatial_box";
-		string col2name = "spatial_box";;
-
-		if(rep1 & TeRASTER)
-			col1name = "block_box";
-
-		if(rep2 & TeRASTER)
-			col2name = "block_box";
-
-		string wherebox  = "(";
-		       wherebox += table1;
-               wherebox += "." + col1name + " && ";
-               wherebox += table2;
-               wherebox += "." + col2name + ")";
-
-	   return wherebox;
-	}
-}
-
-string TePostgreSQL::getSQLBoxSelect(const string& tableName, TeGeomRep rep)
-{
-	if(rep == TeTEXT)
-	{
-		return TeDatabase::getSQLBoxSelect(tableName, rep);
-	}
-	else
-	{
-		string colname = "spatial_box";
-
-		if(rep & TeRASTER)
-			colname = "block_box";
-
-		string select  = tableName + ".* , ";
-			   select += "((" + tableName + "." + colname + "[1])[0]) as lower_x, ";
-			   select += "((" + tableName + "." + colname + "[1])[1]) as lower_y, ";
-			   select += "((" + tableName + "." + colname + "[0])[0]) as upper_x, ";
-			   select += "((" + tableName + "." + colname + "[0])[1]) as upper_y ";
-
-		return select;
-	}
-}
-
-bool TePostgreSQL::getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom)
-{		
-	TeDatabasePortal* portal = getPortal();
-
-	if(!portal)
-		return false;
-
-	string sel  = "SELECT MIN(";
-	       sel += "((" + tableGeom + "." + colGeom + "[1])[0])), MIN(";
-           sel += "((" + tableGeom + "." + colGeom + "[1])[1])), MAX(";
-           sel += "((" + tableGeom + "." + colGeom + "[0])[0])), MAX(";
-           sel += "((" + tableGeom + "." + colGeom + "[0])[1])) ";
-           sel += " FROM " + tableGeom;
-           sel += " WHERE object_id = '" + object_id + "'";
-
-	if(!(portal->query(sel)) || !(portal->fetchRow()))
-	{
-		delete portal;
-
-		return false;
-	}
-		
-	double xmin = portal->getDouble(0);
-	double ymin = portal->getDouble(1);
-	double xmax = portal->getDouble(2);
-	double ymax = portal->getDouble(3);
-				
-	TeBox bb(xmin, ymin, xmax, ymax);
-
-	box = bb;
-
-	delete portal;
-
-	return true;
-}
-
-bool TePostgreSQL::getMBRSelectedObjects(string geomTable, string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType, TeBox& bout, const double& tol)
-{
-	if(repType == TeTEXT)
-		return TeDatabase::getMBRSelectedObjects(geomTable, colGeom, fromClause, whereClause, afterWhereClause, repType, bout, tol);
-
-	TeDatabasePortal* portal = getPortal();
-	
-	if (!portal)
-		return false;
-
-	colGeom = "spatial_box";
-
-	if(repType & TeRASTER)
-		colGeom = "block_box";
-
-	string sel  = "SELECT MIN(";
-	       sel += "((" + geomTable + "." + colGeom + "[1])[0])), MIN(";
-           sel += "((" + geomTable + "." + colGeom + "[1])[1])), MAX(";
-           sel += "((" + geomTable + "." + colGeom + "[0])[0])), MAX(";
-           sel += "((" + geomTable + "." + colGeom + "[0])[1])) ";
-           sel += " FROM " + fromClause;
-
-	if(!whereClause.empty())
-		sel += " WHERE " + whereClause;  
-	
-	if(!(portal->query(sel)) || !(portal->fetchRow())) 
-	{
-		delete portal;
-
-		return false;
-	}
-
-	double xmin = portal->getDouble(0);
-	double ymin = portal->getDouble(1);
-	double xmax = portal->getDouble(2);
-	double ymax = portal->getDouble(3);
-
-	TeBox b(xmin, ymin, xmax, ymax);
-
-	bout = b;
-	
-	delete portal;
-
-	return true;
-}
-
-void TePostgreSQL::getInsertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, const int& band, const unsigned int& res, const unsigned int& subband, char* buf, const unsigned long& size, string& sql)
-{
-	sql += "INSERT INTO " + table + " (block_id, block_box, band_id, resolution_factor, subband, spatial_data, block_size) VALUES('";
-	sql += blockId;
-	sql += "', '";
-	sql += PGBoxRtree_encode(TeBox(ll, ur));
-	sql += "', ";
-	sql += Te2String(band);
-	sql += ", ";
-	sql += Te2String(res);
-	sql += ", ";
-	sql += Te2String(subband);
-	sql += ", E'";
-	sql += buf;
-	sql += "', ";
-	sql += Te2String(size);
-	sql += ")";
-
-	return;
-}
-
-void TePostgreSQL::getUpdateRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, const int& band, const unsigned int& res, const unsigned int& subband, char* buf, const unsigned long& size, string& sql)
-{
-	sql += "UPDATE ";
-	sql += table;
-	sql += " SET block_box = '";
-	sql += PGBoxRtree_encode(TeBox(ll, ur));
-	sql += "', band_id = ";
-	sql += Te2String(band);
-	sql += ", resolution_factor = ";
-	sql += Te2String(res);
-	sql += ", subband = ";
-	sql += Te2String(subband);
-	sql += ", spatial_data = E'";
-	//sql += Te2String(static_cast<long>(obj_oid));;
-	sql += buf;
-	sql += "', block_size = ";
-	sql += Te2String(size);
-	sql += " WHERE block_id = '";
-	sql += blockId;
-	sql += "'";
-
-	return;
-}
-
-
-string TePostgreSQL::escapeSequence(const string& from)
-{
-	size_t newLen = 0;
-
-
-	char* aux = TePGConnection::escapeString(from.c_str(), from.length(), newLen);
-
-	string str = aux;
-
-	delete [] aux;
-
-	return str;
-}
-
-string TePostgreSQL::getSpatialIdxColumn(TeGeomRep rep)
-{
-	if(rep == TeRASTER)
-		return "block_box";
-
-	return "spatial_box";
-}
-
-bool TePostgreSQL::beginTransaction()
-{
-	transactionCounter_++;
-
-	if (transactionCounter_ > 1)
-		return true;
-	else
-		return tepg_connection_.beginTransaction();
-}
-
-bool TePostgreSQL::commitTransaction()
-{
-	transactionCounter_--;
-
-	if (transactionCounter_ > 0)
-		return true;
-	else
-		return tepg_connection_.commitTransaction();
-}
-
-bool TePostgreSQL::rollbackTransaction()
-{
-	transactionCounter_--;
-
-	if (transactionCounter_ > 0)
-		return true;
-	else
-		return tepg_connection_.rollBackTransaction();
-}
-
-//----- TePostgreSQLPortal methods ---
-TePostgreSQLPortal::TePostgreSQLPortal() : con_(0), curRow_(-1)
-{
-}
-
-TePostgreSQLPortal::TePostgreSQLPortal(TeDatabase *pDatabase) : curRow_(-1)
-{
-	db_ = pDatabase;
-	con_ = &((static_cast<TePostgreSQL*>(pDatabase))->tepg_connection_);
-}
-
-TePostgreSQLPortal::~TePostgreSQLPortal()
-{
-	this->freeResult();
-	con_ = 0;
-}
-
-bool TePostgreSQLPortal::query(const string &qry, TeCursorLocation l, TeCursorType t, TeCursorEditType /* e */, TeCursorDataType dt)
-{
-	errorMessage_ = "";
-
-	freeResult();	
-
-	if(!tepg_recordset_.open(qry, con_, t, l, dt))
-		return false;
-
-	numRows_ = tepg_recordset_.recordCount();
-
-	numFields_ = tepg_recordset_.getFieldCount(); 
-
-	attList_.clear ();
-
-	for(int i = 0; i < numFields_; ++i)
-	{
-		TeAttribute attribute;
-
-		Oid nType = tepg_recordset_.fieldType(i);
-
-		switch(nType)
-		{
-			case 16:    //BOOL			
-			case 20:    //INT8
-			case 21:    //INT2
-			case 23:    //INT4
-			case 26:    //OID			
-						attribute.rep_.type_ = TeINT;
-						break;
-			case 700 :  //float4  -> float(p)
-			case 701 :  //float8  -> float(p)
-			case 790 :  //money   -> decimal(9, 2)
-			case 1700:  //numeric -> numeric(p, s)
-						attribute.rep_.type_ = TeREAL;
-						break;
-
-			case 1082:	//date -> date
-			case 1083:  //time -> time
-			case 1114:  //timestamp
-			case 1186:  //interval
-			case 1266:	//
-						attribute.rep_.type_ = TeDATETIME;
-						attribute.dateTimeFormat_ = "YYYYsMMsDDsHHsmmsSS24";
-						attribute.dateChronon_ = TeSECOND;
-						attribute.dateSeparator_ = "-";	
-						break;
-
-			//case 26:    //OID
-			case 17:	//bytea
-						attribute.rep_.type_ = TeBLOB;
-						break;
-			case 1042:
-						attribute.rep_.type_ = TeCHARACTER;
-						break;
-
-			case 1043:  //varchar(n)
-			case 25:    //text
-						attribute.rep_.type_ = TeSTRING;
-						break;
-
-			default:
-						attribute.rep_.type_ = TeUNKNOWN;
-						break;
-		}
-
-		attribute.rep_.name_ = tepg_recordset_.fieldName(i);
-		pair<int, int> len(tepg_recordset_.fieldSize(i), tepg_recordset_.fieldSizeFractionaryPart(i));
-		
-		if(nType != 25) //text
-		{
-			attribute.rep_.numChar_ = len.first + len.second;
-		}
-		attList_.push_back(attribute);
-	}
-
-	curRow_ = 0;	
-
-	return true;
-}
-
-bool TePostgreSQLPortal::fetchRow()
-{
-	errorMessage_ = "";
-
-	if(numFields_ <= 0)
-	{
-		errorMessage_ = "The PostgreSQL portal is empty!";
-		return false;
-	}
-
-	if(curRow_ > 0)
-		tepg_recordset_.moveNext();
-
-	if(tepg_recordset_.eof())
-		return false;
-
-	++curRow_;	
-
-	return true;
-}
-
-bool TePostgreSQLPortal::fetchRow(int i)
-{
-	errorMessage_ = "";
-
-	curRow_ = i + 1;
-	return tepg_recordset_.moveTo(curRow_);
-}
-
-void TePostgreSQLPortal::freeResult()
-{
-	tepg_recordset_.close();
-
-	return;
-}
-
-string TePostgreSQLPortal::errorMessage()
-{
-	if(errorMessage_.empty())
-		return con_->err_msg();	
-	else
-		return errorMessage_;
-}
-
-char* TePostgreSQLPortal::getData(int i)
-{
-	errorMessage_ = "";
-	
-	try
-	{
-		return tepg_recordset_.getData(i);
-	}
-
-	catch(...)
-	{
-		return "";
-	}
-
-	return "";
-
-}
-
-char* TePostgreSQLPortal::getData(const string& s)
-{
-	errorMessage_ = "";
-
-	try
-	{
-		return tepg_recordset_.getData(s);
-	}
-
-	catch(...)
-	{
-		return "";
-	}
-
-	return "";
-}
-
-double TePostgreSQLPortal::getDouble(int i)
-{
-	errorMessage_ = "";
-
-	try
-	{
-		return tepg_recordset_.getDouble(i);
-	}
-
-	catch(...)
-	{
-		return 0.0;
-	}
-
-	return 0.0;
-}
-
-double TePostgreSQLPortal::getDouble(const string& s)
-{
-	errorMessage_ = "";
-
-	try
-	{
-		return tepg_recordset_.getDouble(s);
-	}
-
-	catch(...)
-	{
-		return 0.0;
-	}
-
-	return 0.0;
-}
-
-int TePostgreSQLPortal::getInt(int i)
-{
-	errorMessage_ = "";
-
-	try
-	{
-		return tepg_recordset_.getInt(i);
-	}
-
-	catch(...)
-	{
-		return 0;
-	}
-
-	return 0;
-}
-
-int TePostgreSQLPortal::getInt(const string& s)
-{
-	errorMessage_ = "";
-
-	try
-	{
-		return tepg_recordset_.getInt(s);
-	}
-
-	catch(...)
-	{
-		return 0;
-	}
-
-	return 0;
-}
-
-bool TePostgreSQLPortal::getBool(const string& s)
-{
-	errorMessage_ = "";
-
-	try
-	{
-		if(tepg_recordset_.getBool(s))
-			return true;
-		else
-			return false;
-	}
-
-	catch(...)
-	{
-		return false;
-	}
-	
-	return false;
-}
-
-bool TePostgreSQLPortal::getBool(int i)
-{
-	errorMessage_ = "";
-
-	try
-	{
-		if(tepg_recordset_.getInt(i))
-			return true;
-		else
-			return false;
-	}
-
-	catch(...)
-	{
-		return false;
-	}
-
-	return false;
-}
-
-TeTime TePostgreSQLPortal::getDate(int i)
-{
-	string s = getData(i);
-
-	TeTime t(s, TeSECOND, "YYYYsMMsDDsHHsmmsSS", "-"); 
-
-	return t;
-}
-
-TeTime TePostgreSQLPortal::getDate(const string& s)
-{
-	string ss = getData(s);
-
-	TeTime t(ss, TeSECOND, "YYYYsMMsDDsHHsmmsSS", "-"); 
-
-	return t;
-}
-
-string TePostgreSQLPortal::getDateAsString(int i)
-{
-	return getData(i);
-}
-
-string TePostgreSQLPortal::getDateAsString(const string& s)
-{
-	return getData(s);
-}
-
-bool TePostgreSQLPortal::getBlob(const string& s, unsigned char*& data, long& size)
-{
-	errorMessage_ = "";
-
-	data = 0;
-
-	char* ptDataAux = (char*)data;
-
-	unsigned long newLen = tepg_recordset_.getBytea(s, ptDataAux);
-
-	if(newLen > 0)
-	{
-		size = newLen;
-		data = (unsigned char*)ptDataAux;
-		return true;
-	}
-
-	errorMessage_ = "Couldn't read blob! Blob size error!";
-
-	if(data)
-	{
-		delete [] data;
-		data = 0;
-	}
-
-	return false;
-}
-
-bool TePostgreSQLPortal::getRasterBlock(unsigned long& size, unsigned char* ptData)
-{
-	errorMessage_ = "";
-
-	// get the actual length of the compressed data
-	size = tepg_recordset_.getInt("block_size");
-	
-	
-	if(size > 0)
-	{
-		char* ptDataAux = (char*)ptData;
-
-		unsigned long newLen = tepg_recordset_.getBytea("spatial_data", ptDataAux);
-
-		if(newLen == size)
-		{
-			ptData = (unsigned char*)ptDataAux;
-			return true;
-		}
-	}
-
-	return false;
-}
-
-
-bool TePostgreSQLPortal::fetchGeometry(TePolygon& pol)
-{
-	errorMessage_ = "";
-
-	int numberOfHoles;
-
-	TeLinearRing ring = this->getLinearRing(numberOfHoles);
-
-	pol.objectId(ring.objectId());
-	pol.geomId(ring.geomId());
-	pol.add(ring);
-	int parentId = pol.geomId();
-
-	while(fetchRow())
-	{
-		if(this->getInt("parent_id") == parentId)
-		{
-			int dummy;
-
-			TeLinearRing ring = getLinearRing(dummy);
-			pol.add(ring);
-		}
-		else
-			return true;
-	}
-
-	return false;
-}
-
-bool TePostgreSQLPortal::fetchGeometry(TePolygon& pol, const unsigned int& initIndex)
-{
-	errorMessage_ = "";
-
-	int numberOfHoles;
-
-	TeLinearRing ring = this->getLinearRing(numberOfHoles, initIndex);
-
-	pol.objectId(ring.objectId());
-	pol.geomId(ring.geomId());
-	pol.add(ring);
-	int parentId = pol.geomId();
-
-	while(fetchRow())
-	{
-		if(this->getInt(initIndex+4) == parentId)
-		{
-			int dummy;
-
-			TeLinearRing ring = getLinearRing(dummy, initIndex);
-			pol.add(ring);
-		}
-		else
-			return true;
-	}
-
-	return false;
-}
-
-bool TePostgreSQLPortal::fetchGeometry(TeLine2D& line)
-{
-	errorMessage_ = "";
-
-	tepg_recordset_.getPGLine2D("spatial_data", line);
-
-	int geomId = tepg_recordset_.getInt("geom_id");
-
-	string objectId = tepg_recordset_.getData("object_id");
-
-	line.objectId(objectId);
-	
-	line.geomId(geomId);
-
-	return fetchRow();
-}
-
-bool TePostgreSQLPortal::fetchGeometry(TeLine2D& line, const unsigned int& initIndex )
-{
-	errorMessage_ = "";
-
-	tepg_recordset_.getPGLine2D(initIndex+5, line); //spatial_data
-
-	int geomId = tepg_recordset_.getInt(initIndex);
-
-	string objectId = tepg_recordset_.getData(initIndex+1);
-
-	line.objectId(objectId);
-	
-	line.geomId(geomId);
-
-	return fetchRow();
-}
-
-bool TePostgreSQLPortal::fetchGeometry(TeNode& n)
-{
-	errorMessage_ = "";
-	
-	TeCoord2D pt(getDouble("x"), getDouble("y"));
-
-	n.add(pt);
-	n.geomId(atoi(getData("geom_id")));
-	n.objectId(string(getData("object_id")));
-
-	return fetchRow();
-}
-
-bool TePostgreSQLPortal::fetchGeometry(TeNode& n, const unsigned int& initIndex)
-{
-	errorMessage_ = "";
-	
-	TeCoord2D pt(getDouble(initIndex+3), getDouble(initIndex+4)); 
-
-	n.add(pt);
-	n.geomId(atoi(getData(initIndex)));
-	n.objectId(string(getData(initIndex+1)));
-
-	return fetchRow();
-}
-
-bool TePostgreSQLPortal::fetchGeometry(TePoint& p)
-{
-	errorMessage_ = "";
-
-	TeCoord2D c(getDouble("x"), getDouble("y"));
-	p.add(c);
-	p.geomId(atoi(getData("geom_id")));
-	p.objectId(string(getData("object_id")));
-	
-	return fetchRow();
-}
-
-bool TePostgreSQLPortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
-{
-	errorMessage_ = "";
-
-	TeCoord2D c(getDouble(initIndex+3), getDouble(initIndex+4));
-	p.add(c);
-	p.geomId(atoi(getData(initIndex)));
-	p.objectId(string(getData(initIndex+1)));
-	
-	return fetchRow();
-}
-
-TeLinearRing TePostgreSQLPortal::getLinearRing(int& numberOfHoles)
-{
-	int geomId = tepg_recordset_.getInt("geom_id");
-	string objectId = tepg_recordset_.getData("object_id");
-
-	numberOfHoles = tepg_recordset_.getInt("num_holes");	
-
-	TeLine2D line;
-
-	tepg_recordset_.getPGLine2D("spatial_data", line);
-
-	TeLinearRing ring = line;
-
-	ring.objectId(objectId);
-	
-	ring.geomId(geomId);
-
-	return ring;
-}
-
-TeLinearRing TePostgreSQLPortal::getLinearRing(int& numberOfHoles, const unsigned int& initIndex)
-{
-	int geomId = tepg_recordset_.getInt(initIndex);
-	string objectId = tepg_recordset_.getData(initIndex+1);
-
-	numberOfHoles = tepg_recordset_.getInt(initIndex+3);	
-
-	TeLine2D line;
-
-	tepg_recordset_.getPGLine2D(initIndex+7, line); //spatial_data
-
-	TeLinearRing ring = line;
-
-	ring.objectId(objectId);
-	
-	ring.geomId(geomId);
-
-	return ring;
-}
-
-string TePostgreSQLPortal::escapeSequence(const string& from)
-{
-	size_t newLen = 0;
-
-	char* aux = TePGConnection::escapeString(from.c_str(), from.length(), newLen);
-
-	string str = aux;
-
-	delete [] aux;
-
-	return str;
-}
-
-bool TePostgreSQLPortal::fetchGeometry(TeCell& cell)
-{
-	errorMessage_ = "";
-
-	TeBox b;
-	tepg_recordset_.getPGBox("spatial_box", b);
-
-	cell.geomId(tepg_recordset_.getInt("geom_id"));
-	cell.objectId(tepg_recordset_.getData("object_id"));
-	cell.setBox (b);
-	cell.column(tepg_recordset_.getInt("col_number"));
-	cell.line(tepg_recordset_.getInt("row_number"));
-
-	return fetchRow();
-}
-
-bool TePostgreSQLPortal::fetchGeometry(TeCell& cell, const unsigned int& initIndex)
-{
-	errorMessage_ = "";
-
-	TeBox b;
-	tepg_recordset_.getPGBox(initIndex+2, b);
-
-	cell.geomId(tepg_recordset_.getInt(initIndex));
-	cell.objectId(tepg_recordset_.getData(initIndex+1));
-	cell.setBox (b);
-	cell.column(tepg_recordset_.getInt(initIndex+3));
-	cell.line(tepg_recordset_.getInt(initIndex+4));
-
-	return fetchRow();
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TePostgreSQL.h"
+#include "TePGUtils.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "TeSpatialOperations.h"
+#include "TeGeometryAlgorithms.h"
+#include <TeTimeInterval.h>
+#include <TeProject.h>
+#include <string>
+using namespace std;
+
+// Create a block of doubles for the bytea
+unsigned char* getByteArray(const TeLine2D& l)
+{
+	unsigned int size = l.size();
+
+	double* points = new double[2 * size];
+
+	int iac = 0;
+
+	for(unsigned int i = 0; i < size; ++i)
+	{
+		points[iac++] = l[i].x();
+		points[iac++] = l[i].y();
+	}
+
+	size_t newLen = 0;
+
+	// N�mero de doubles = 2 * size
+	// N�mero de bytes = 2 * size * sizeof(double)
+	unsigned char* newbuf = TePGConnection::escapeBytea((unsigned char*)points, 2 * size * sizeof(double) , &newLen);
+
+	delete points;
+
+	return newbuf;
+}
+
+
+//----- TePostgreSQL methods ---
+TePostgreSQL::TePostgreSQL()
+	: transactionCounter_(0)
+{
+	errorMessage_ = "";
+	gistBoxOps_ = "";
+	dbmsName_ = "PostgreSQL";
+}
+
+TePostgreSQL::~TePostgreSQL()
+{
+	if(isConnected_)
+		close();
+}
+
+string TePostgreSQL::errorMessage()
+{
+	if(errorMessage_.empty())
+		return tepg_connection_.err_msg();
+	else
+		return errorMessage_;
+	
+}
+
+bool TePostgreSQL::newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port, bool terralibModel, const std::string& characterSet)
+{
+	errorMessage_ = "";
+
+	std::string createDB  = "CREATE DATABASE ";
+	createDB += "\"" + database + "\"";
+	if(!characterSet.empty())
+	{
+		createDB += " ENCODING = '" + characterSet + "'";
+	}
+
+	//if(!realConnect(host, user, password, "template1", port))
+	//	return false;	
+
+	if(!connect(host, user, password, "template1", port))
+	{
+		close();
+		return false;
+	}
+
+	
+	bool connected = false;
+	
+	if(execute(createDB))
+	{
+		connected = connect(host, user, password, database, port);
+	}
+	else
+	{
+		createDB += " TEMPLATE = template0";		
+		if(execute(createDB))
+		{
+			connected = connect(host, user, password, database, port);
+		}
+		else
+		{
+			std::string err = "Error creating a new database: " + errorMessage();
+			close();
+			errorMessage_ = err;
+			return false;
+		}
+	}
+
+	if(terralibModel)
+	{
+		//create conceptual model
+		if(connected)
+		{
+			if(!createConceptualModel())
+			{
+				close();
+				return false;
+			}
+		}
+		else
+		{
+			close();
+			return false;
+		}
+	}
+
+	return true;
+}
+
+
+bool TePostgreSQL::connect(const string& host, const string& user, const string& password, const string& database, int port)
+{
+	if(TePostgreSQL::realConnect(host, user, password, database, port))
+	{
+// see if PostGIS is present
+		TePGRecordset rec;
+
+		string sql = "SELECT postgis_version()";
+
+		if(rec.open(sql.c_str(), &tepg_connection_) && rec.recordCount() > 0)
+		{
+			rec.close();
+
+			this->close();
+
+			errorMessage_ = "PostGIS extension found! Please use a PostGIS driver!";
+
+			return false;	
+		}
+
+// see if RTree GiST is present for box: it must be present
+		int version = PQserverVersion(tepg_connection_.c_ptr());
+		if(version >= 80100)
+		{
+			gistBoxOps_ = "box_ops";
+			return true;
+		}
+
+		sql = "SELECT opcname FROM pg_opclass WHERE (opcname = 'gist_box_ops') ORDER BY opcname DESC";
+
+		if(rec.open(sql.c_str(), &tepg_connection_) && rec.recordCount() > 0)
+		{
+			gistBoxOps_ = rec.value(0);
+			rec.close();
+
+			return true;
+		}
+
+		rec.close();
+
+		this->close();
+
+		errorMessage_ = "GiST extension not found! Please, install R-Tree GiST in your database and try again!";
+
+		return false;	
+	}
+	
+	return false;
+}
+
+bool TePostgreSQL::connect(PGconn* conn)
+{
+	this->close();
+
+	if(tepg_connection_.open(conn))
+	{	
+		TePGRecordset rec;
+
+		string sql = "SELECT postgis_version()";
+
+		if(rec.open(sql.c_str(), &tepg_connection_) && rec.recordCount() > 0)
+		{
+			rec.close();
+
+			this->close();
+
+			errorMessage_ = "PostGIS extension found! Please use a PostGIS driver!";
+
+			return false;	
+		}
+
+// see if RTree GiST is present for box: it must be present
+		int version = PQserverVersion(tepg_connection_.c_ptr());
+		if(version >= 80100)
+		{
+			gistBoxOps_ = "box_ops";
+			return true;
+		}
+
+		sql = "SELECT opcname FROM pg_opclass WHERE (opcname = 'gist_box_ops') ORDER BY opcname DESC";
+
+		if(rec.open(sql.c_str(), &tepg_connection_) && rec.recordCount() > 0)
+		{
+			gistBoxOps_ = rec.value(0);
+			rec.close();
+
+//			host_     = tepg_connection_..dbHost();
+//			user_     = tepg_connection_.dbUser();
+			password_ = "";
+			database_ = tepg_connection_.dbname();	
+
+			return true;
+		}
+
+		rec.close();
+
+		this->close();
+
+		errorMessage_ = "GiST extension not found! Please, install R-Tree GiST in your database and try again!";
+	}
+	return false;	
+}
+
+bool TePostgreSQL::realConnect(const string& host, const string& user, const string& password, const string& database, int port)
+{
+	errorMessage_ = "";
+
+	host_             = (host == "")     ? (string("")) : (" host = " + host + " ");
+	user_             = (user == "")     ? (string("")) : (" user = " + user + " ");
+	password_         = (password == "") ? (string("")) : (" password = " + password + " ");
+	database_         = (database == "") ? (string("")) : (" dbname = '" + database + "' ");
+	string portNumber = (port <= 0)     ? (string("")) : (" port = " + Te2String(port)  + " ");
+
+	portNumber_ = port;
+
+	string connInfo = host_ + user_ + password_ + database_ + portNumber;
+
+	host_     = host;
+	user_     = user;
+	password_ = password;
+	database_ = database;
+
+	this->close();
+
+	if(!tepg_connection_.open(connInfo))
+	{
+		errorMessage_ = "Could not connect to the database server!";
+		return false;
+	}
+
+	isConnected_ = true;
+
+	return true;
+}
+
+bool TePostgreSQL::showDatabases(const string& host, const string& user, const string& password, vector<string>& dbNames, int port)
+{
+	errorMessage_ = "";
+
+	if(realConnect(host, user, password, "template1", port))
+	{
+		string sql = "SELECT datname FROM pg_database WHERE datname NOT IN ('template0', 'template1', 'template_postgis', 'postgres') ORDER BY datname";
+
+		TePostgreSQLPortal p(this);
+
+		if(p.query(sql) && p.fetchRow())
+		{
+			do
+			{
+				dbNames.push_back(p.getData("datname"));
+			}while(p.fetchRow());
+
+			return true;
+		}
+		else
+			errorMessage_ = "Didn't find any database!";
+	}
+	
+	return false;
+}
+
+void TePostgreSQL::close(void)
+{
+	errorMessage_ = "";
+
+	tepg_connection_.close();
+	isConnected_ = false;
+	transactionCounter_ = 0;
+
+	return;
+}
+
+bool TePostgreSQL::listTables(vector<string>& tableList)
+{
+	errorMessage_ = "";
+
+	TePGRecordset rec;
+
+	string sql = "SELECT tablename FROM pg_table WHERE schemaname = 'public' ORDER BY tablename";
+
+	if(!rec.open(sql, &tepg_connection_) || rec.recordCount() <= 0)
+		return false;
+
+	while(!rec.eof())
+	{
+		tableList.push_back(rec.getData(0));
+		rec.moveNext();
+	}
+	
+	return true;
+
+}
+
+bool TePostgreSQL::tableExist(const string& table)
+{
+	if (table.empty())
+		return false;
+
+	errorMessage_ = "";
+
+	TePGRecordset rec;
+
+	string sql = "SELECT relname FROM pg_class WHERE lower(relname) = lower('" + table + "')";
+
+	if(!rec.open(sql, &tepg_connection_))
+		return false;
+
+	return (rec.recordCount() > 0);
+}
+
+bool TePostgreSQL::deleteTable(const string& table)
+{
+	int f =	table.find ("te_collection");
+
+	if( table=="te_theme" ||
+		table=="te_layer" ||
+		table=="te_representation" ||
+		table=="te_tables_relation" ||
+		table=="te_layer_table" ||
+		table=="te_raster_metadata" ||
+		table=="te_projection" ||
+		table=="te_view" ||
+		table=="te_legend" ||
+		table=="te_visual" ||
+		table=="te_database" ||
+		f == 0)
+	{
+		errorMessage_ = "N�o � poss�vel deletar tabelas do modelo!";
+		return false;
+	}
+
+	if (table.empty())
+		return false;
+
+	errorMessage_ = "";
+
+	std::string sql = "SELECT relname FROM pg_class WHERE lower(relname) = lower('" + table + "')";
+
+	TePGRecordset rec;
+	if(!rec.open(sql, &tepg_connection_))
+		return false;
+
+	if(rec.recordCount() == 0)
+	{
+		return false;
+	}
+
+	std::string dbTableName = rec.getData(0);
+
+	rec.close();
+
+	string del = "DROP TABLE \"" + dbTableName + "\"";
+	if(!execute(del))
+	{
+		return false;
+	}
+
+	return true;
+}
+
+bool TePostgreSQL::columnExist(const string& table, const string& column, TeAttribute& attr)
+{
+	errorMessage_ = "";
+
+	TePGRecordset rec;
+
+	string sql  = "SELECT atttypid, attname, atttypmod, attlen  FROM pg_class, pg_attribute ";
+	       sql += "WHERE lower(pg_class.relname) = lower('" + table + "') AND ";
+		   sql += "      pg_class.oid = pg_attribute.attrelid AND ";
+		   sql += "      pg_attribute.attname = lower('" + column + "')";
+
+	if(!rec.open(sql, &tepg_connection_))
+		return false;
+
+	if(rec.recordCount() > 0)
+	{
+		attr.rep_.name_ = rec.getData("attname");
+
+		Oid nType = static_cast<Oid>(rec.getInt("atttypid"));
+		switch(nType)
+		{
+			case 16:    //BOOL
+			case 20:    //INT8
+			case 21:    //INT2
+			case 23:    //INT4
+			case 26:    //OID			
+						attr.rep_.type_ = TeINT;
+						attr.rep_.numChar_ = 15;
+						break;
+
+			case 700 :  //float4  -> float(p)
+			case 701 :  //float8  -> float(p)
+			case 790 :  //money   -> decimal(9, 2)  
+			case 1700:  //numeric -> numeric(p, s)  
+						attr.rep_.type_ = TeREAL;
+						attr.rep_.numChar_ = 15;
+						break;
+
+			case 1082:	//date -> date
+			case 1083:  //time -> time
+			case 1114:  //timestamp
+			case 1186:  //interval
+			case 1266:	//
+						attr.rep_.type_ = TeDATETIME;
+						attr.rep_.numChar_ = rec.getInt("attlen");
+						break;
+
+			//case 26:    //OID
+			case 17:	//bytea
+						attr.rep_.type_ = TeBLOB;
+						attr.rep_.numChar_ = 0;
+						break;
+			case 1042:
+						attr.rep_.type_ = TeCHARACTER;
+						attr.rep_.numChar_ = rec.getInt("atttypmod") - 4;
+						break;
+
+			case 1043:  //varchar(n)
+						attr.rep_.type_ = TeSTRING;
+						attr.rep_.numChar_ = rec.getInt("atttypmod") - 4;
+						break;
+
+			case 25:    //text
+						attr.rep_.type_ = TeSTRING;
+						break;
+
+			default:
+						attr.rep_.type_ = TeUNKNOWN;
+						attr.rep_.numChar_ = 0;
+						break;
+		}
+
+		return true;
+	}
+
+	return false;
+}
+
+bool TePostgreSQL::createTable(const string& table, TeAttributeList &attr)
+{
+	errorMessage_ = "";
+
+	bool first = true;
+
+	TeAttributeList::iterator it = attr.begin();
+	
+	string createTable ="CREATE TABLE " + table +" (";
+	
+	string type;
+
+	string pkeys;
+
+	while(it != attr.end())
+	{
+		switch ((*it).rep_.type_)
+		{
+			case TeSTRING:		if((*it).rep_.numChar_ > 0)
+								{
+									type = "VARCHAR(" + Te2String((*it).rep_.numChar_) + ")";
+								}
+								else
+								{
+									type = "TEXT";
+								}
+								break;
+
+			case TeREAL:		type = "FLOAT8";
+								break;
+
+			case TeINT:
+			case TeUNSIGNEDINT:
+								type = ((*it).rep_.isAutoNumber_) ? "SERIAL" : "INTEGER";
+								break;
+
+			case TeBLOB:		//type = "OID";
+				                type = "BYTEA";
+								break;
+
+			case TeDATETIME:	type = "TIMESTAMP(0)";
+								break;
+
+			case TeCHARACTER:	type = "CHAR(" + (((*it).rep_.numChar_ == 0)? std::string("1") : Te2String((*it).rep_.numChar_)) + ") ";
+								break;
+
+			case TeBOOLEAN:		type = "BOOLEAN";
+								break;
+
+			case TePOINTTYPE:
+			case TePOINTSETTYPE:
+								if(!first)
+									createTable += ", ";
+								else
+									first = false;
+
+								createTable += " spatial_box  BOX           NOT NULL,";
+								createTable += " x		      FLOAT8        DEFAULT 0.0,";
+								createTable += " y            FLOAT8        DEFAULT 0.0 ";
+								++it;
+								continue;
+
+			case TeLINE2DTYPE:
+			case TeLINESETTYPE:
+							if(!first)
+								createTable += ", ";
+							else
+								first = false;
+
+							createTable += " num_coords   INTEGER      NOT NULL,";
+							createTable += " spatial_box  BOX          NOT NULL,";
+							createTable += " ext_max      FLOAT8       NOT NULL,";
+							createTable += " spatial_data POLYGON ";
+							++it;
+							continue;
+
+			case TePOLYGONTYPE:
+			case TePOLYGONSETTYPE:
+							if(!first)
+								createTable += ", ";
+							else
+								first = false;
+
+							createTable += " num_coords   INTEGER      NOT NULL,";
+							createTable += " num_holes    INTEGER      NOT NULL,";
+							createTable += " parent_id    INTEGER      NOT NULL,";
+							createTable += " spatial_box  BOX          NOT NULL,";
+							createTable += " ext_max      FLOAT8       NOT NULL,";
+							createTable += " spatial_data POLYGON ";
+							++it;
+							continue;
+
+			case TeCELLTYPE:
+			case TeCELLSETTYPE:
+							if(!first)
+								createTable += ", ";
+							else
+								first = false;
+
+							createTable += " spatial_box  BOX          NOT NULL,";
+							createTable += " col_number   INTEGER      NOT NULL,";
+							createTable += " row_number	  INTEGER      NOT NULL ";
+							++it;
+							continue;					
+
+			case TeRASTERTYPE:
+							if(!first)
+								createTable += ", ";
+							else
+								first = false;
+
+							createTable += " block_box         BOX         NOT NULL,";
+							createTable += " band_id		     INTEGER     NOT NULL,";		   
+							createTable += " resolution_factor INTEGER     NOT NULL,";
+							createTable += " subband		     INTEGER     NOT NULL,";		   
+							createTable += " spatial_data      BYTEA,";
+							createTable += " block_size        INTEGER  NOT NULL ";
+		   					++it;
+							continue;
+
+			case TeNODETYPE:
+			case TeNODESETTYPE:
+							if(!first)
+								createTable += ", ";
+							else
+								first = false;
+
+							createTable += " spatial_box  BOX           NOT NULL,";
+							createTable += " x		    FLOAT8        DEFAULT 0.0,";
+							createTable += " y            FLOAT8        DEFAULT 0.0 ";
+							++it;
+							continue;
+
+			case TeTEXTTYPE:
+			case TeTEXTSETTYPE:
+
+			default:			type += "VARCHAR(" + Te2String((*it).rep_.numChar_) + ")";
+								break;
+		}
+
+		if(!((*it).rep_.defaultValue_.empty()))
+			type += " DEFAULT '" + (*it).rep_.defaultValue_ + "' ";
+
+		if(!((*it).rep_.null_))
+			type += " NOT NULL ";
+		
+		if(!first)
+			createTable += ",  ";
+		else
+			first = false;
+
+		createTable += (*it).rep_.name_ + " ";
+		createTable += type;
+
+		// check if column is part of primary key
+		if((*it).rep_.isPrimaryKey_ && (*it).rep_.type_ != TeBLOB )
+		{
+			if(!pkeys.empty())
+				pkeys += ", ";
+			
+			pkeys += (*it).rep_.name_;
+		}
+
+		++it;
+	}
+
+	if(!pkeys.empty())
+	{	string pk = ", PRIMARY KEY(";
+	           pk += pkeys;
+			   pk += ")";
+
+		createTable += pk;
+	}
+
+
+	createTable += ");";
+
+	return execute(createTable);
+}
+
+bool TePostgreSQL::addColumn(const string& table, TeAttributeRep &rep)
+{
+	errorMessage_ = "";
+	
+	string field = TeGetExtension(rep.name_.c_str());
+	if(field.empty())
+		field = rep.name_;
+
+	string new_column  = "ALTER TABLE " + table + " ADD COLUMN " + field + " ";
+
+	switch(rep.type_)
+	{
+		case TeSTRING:		if(rep.numChar_ > 0)
+							{
+								new_column += "VARCHAR(" + Te2String(rep.numChar_) + ")";
+							}
+							else
+							{
+								new_column += "TEXT";
+							}
+							
+							break;
+		case TeREAL:		new_column += "FLOAT8";
+							break;
+		case TeBOOLEAN:		new_column += "BOOLEAN";
+							break;
+		case TeINT:			new_column += (rep.isAutoNumber_ ? "SERIAL" : "INTEGER");
+							break;
+		case TeDATETIME:	new_column += "TIMESTAMP(0)";
+							break;
+		case TeBLOB:		//new_column += "OID";
+							new_column += "BYTEA";
+							break;
+		default:			new_column += "VARCHAR";
+							break;
+	}
+
+	if(!this->execute(new_column))
+        return false;
+
+	alterTableInfoInMemory(table);
+
+	return true;
+}
+
+bool TePostgreSQL::createRelation(const string& relName, const string& table, const string& fieldName, const string& relatedTable, const string& relatedField, bool cascadeDeletion)
+{
+	errorMessage_ = "";
+
+	string alter  = "ALTER TABLE " +  table + " ADD CONSTRAINT " + relName + " ";
+	       alter += "FOREIGN KEY (" + fieldName + ") "; 
+	       alter += "REFERENCES " + relatedTable + "(" + relatedField + ") ";
+
+	if(cascadeDeletion)
+		alter += " ON DELETE CASCADE";
+
+	return execute(alter);
+}
+
+TeDBRelationType TePostgreSQL::existRelation(const string& /*tableName*/, const string& relName)
+{
+	errorMessage_ = "";
+
+	string sql  = "SELECT proname FROM pg_trigger, pg_proc WHERE tgconstrname = '" + relName + "' AND pg_trigger.tgfoid = pg_proc.oid AND pg_proc.proname LIKE 'RI_FKey_cascade_del%'";
+	TeDBRelationType resp = TeNoRelation;
+
+	TePGRecordset r(sql, &tepg_connection_);
+	if(r.recordCount() > 0)
+		resp = TeRICascadeDeletion; 
+	else
+	{
+		sql  = "SELECT proname FROM pg_trigger, pg_proc WHERE tgconstrname = '" + relName + "' AND pg_trigger.tgfoid = pg_proc.oid AND pg_proc.proname LIKE 'RI_FKey_check_ins%'";
+		r.open(sql, &tepg_connection_);
+		if(r.recordCount() > 0)
+			resp = TeRINoCascadeDeletion; 
+	}
+
+	r.close();
+	
+	return resp;
+}
+
+bool TePostgreSQL::execute(const string &sql)
+{
+	try
+	{
+		this->tepg_connection_.exec_cmd(sql);
+	}
+
+	catch(...)
+	{
+		return false;
+	}
+
+	return true;
+}
+
+TeDatabasePortal* TePostgreSQL::getPortal()
+{
+	errorMessage_ = "";
+
+	TeDatabasePortal *portal = new TePostgreSQLPortal(this);
+
+	return portal;
+}
+
+bool TePostgreSQL::insertRelationInfo(const int tableId, const string& tField, const string& rTable, const string& rField, int& relId)
+{
+	if(tableId < 0)
+	{
+		return false;
+	}
+	// check if relation already exists
+	TePostgreSQLPortal* portal = (TePostgreSQLPortal*)this->getPortal();
+
+	if(!portal)
+		return false;
+
+	relId = -1;
+	
+	string sel = "SELECT relation_id FROM te_tables_relation WHERE";
+	sel += " related_table_id = " + Te2String(tableId);
+	sel += " AND related_attr = '" + tField + "'";
+	sel += " AND external_table_name = '" + rTable + "'";
+	sel += " AND external_attr = '" + rField + "'";
+
+	if(!portal->query(sel))
+	{
+		delete portal;
+		return false;
+	}
+
+	if(portal->fetchRow())
+	{
+		relId = atoi(portal->getData("relation_id"));
+		delete portal;
+		return true;
+	}
+
+	delete portal;
+
+	string sql =  "INSERT INTO te_tables_relation (related_table_id, related_attr, external_table_name, external_attr) VALUES(";
+	       sql += Te2String(tableId);
+		   sql += ", '";
+		   sql += tField;
+		   sql += "', '";
+		   sql += rTable;
+		   sql += "', '";
+		   sql += rField;
+		   sql += "')";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('te_tables_relation_relation_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+
+		if(rec.recordCount() > 0)
+			relId = rec.getInt(0);
+
+		rec.close();
+	}
+	else
+		return false;
+
+	return true;
+}
+
+bool 
+TePostgreSQL::insertTable(TeTable &table)
+{
+	string tableName = table.name();
+	int size = table.size();
+	TeAttributeList att = table.attributeList();
+	TeAttributeList::iterator it = att.begin();
+	TeAttributeList::iterator itEnd = att.end();
+	TeTableRow row;
+	
+	if (!beginTransaction())
+		return false;
+
+	size_t newLen = 0;
+	unsigned char* newbuf = 0;
+	int i;
+	unsigned int j;
+	for ( i = 0; i < size; i++ )	
+	{
+		row = table[i];
+		it = att.begin();
+		string attrs;
+		string values;
+		j = 1;
+		int jj = 0;
+		while ( it != itEnd )
+		{
+			if (row[jj].empty() || (*it).rep_.isAutoNumber_)
+			{
+				++it;
+				j++;
+				jj++;
+				continue;
+			}
+			
+			if (!values.empty())
+			{
+				attrs += ", ";
+				values += ", ";
+			}			
+			attrs += (*it).rep_.name_;			
+			switch ((*it).rep_.type_)
+			{
+			case TeSTRING:
+				values += "'"+ escapeSequence( row[jj] ) +"'";
+				break;
+			case TeREAL:
+				{
+					std::string strValue = row[jj];
+					replace(strValue.begin(), strValue.end(), ',', '.');
+					values += strValue;
+				}
+				break;
+			case TeUNSIGNEDINT:
+			case TeINT:
+				values += row[jj];
+				break;
+			case TeDATETIME:
+				{
+					const string temp_dt = string(row[jj].c_str());
+					TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
+					values += this->getSQLTime(t);
+				}
+				break;
+			case TeCHARACTER:
+				values += "'" + escapeSequence(row[jj]) + "'";
+				break;
+
+			case TeBOOLEAN: "'" + row[jj] + "'";
+				break;
+
+			case TeBLOB:
+				newbuf = TePGConnection::escapeBytea((unsigned char*)row[jj].c_str(), row[jj].size(), &newLen);
+				values += "'";
+				values += (char*)newbuf; 
+				values += "'";
+				TePGConnection::freeMem(newbuf);
+				newbuf = NULL;
+			default:
+				values += "'"+ escapeSequence(row[jj]) +"'";
+				break;
+			}
+			++it;
+			j++;
+			jj++;
+		}
+
+		if (values.empty()) 
+			continue;
+
+		string q = "INSERT INTO "+tableName + " ("+ attrs+") " + " VALUES ("+values+") ";
+		if(!execute(q))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		if(newbuf)
+		{
+			TePGConnection::freeMem(newbuf);
+			newbuf = NULL;
+		}
+		return false;
+	}
+	if(newbuf)
+	{
+		TePGConnection::freeMem(newbuf);
+		newbuf = NULL;
+	}
+	return true;
+}
+
+bool
+TePostgreSQL::updateTable(TeTable &table)
+{
+	TeAttributeList& att = table.attributeList();
+	unsigned int i;
+	string uniqueVal;
+	bool isUniqueValString = false;
+	
+	if (!beginTransaction())
+		return false;
+
+	string uniqueName = table.uniqueName(); // primary key explicitly defined or 
+	if (table.uniqueName().empty())			// check in the attribute list
+	{								
+		for (i=0; i<att.size(); ++i)
+			if (att[i].rep_.isPrimaryKey_)
+			{
+				uniqueName = att[i].rep_.name_;
+				table.setUniqueName(uniqueName);
+				break;
+			}
+	}
+
+	size_t newLen = 0;
+	unsigned char* newbuf = 0;
+	TeAttributeList::iterator it;
+	TeTableRow row;
+	unsigned int j;
+	bool useComma = false;
+	for (i = 0; i < table.size(); i++  )
+	{
+		row = table[i];
+		it = att.begin();
+		string q;
+		j = 1;
+		int jj = 0;
+		while ( it != att.end() )
+		{
+			if (TeConvertToUpperCase(uniqueName) != TeConvertToUpperCase((*it).rep_.name_))
+			{
+				if ((*it).rep_.isAutoNumber_)
+				{
+					++it;
+					j++;
+					jj++;
+					continue;
+				}
+				if(useComma == true)
+				{
+					q += ", ";
+				}
+				else
+				{
+					useComma = true;
+				}				
+				
+				q += (*it).rep_.name_ + " = ";
+  				
+				if(row[jj].empty())
+				{
+					q += " null";
+
+					++it;
+					j++;
+					jj++;
+					continue;
+				}
+
+				switch ((*it).rep_.type_)
+  				{
+  					case TeSTRING:
+						q += "'"+escapeSequence(row[jj])+"'";
+  					break;
+  					case TeREAL:
+					{
+						std::string value = row[jj];
+						replace(value.begin(), value.end(), ',', '.');
+						q += value;
+					}
+  					break;
+  					case TeINT:
+					case TeUNSIGNEDINT:
+						q += row[jj];
+  					break;
+					case TeDATETIME:
+					{
+						const string temp_dt = string(row[jj].c_str());
+						TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
+						q += this->getSQLTime(t);
+					}
+  					break;
+					case TeCHARACTER:
+						q += "'" + escapeSequence(row[jj]) + "'";
+  					break;
+					case TeBLOB:
+						newbuf = TePGConnection::escapeBytea((unsigned char*)row[jj].c_str(), row[jj].size(), &newLen);
+						q += "'";
+						q += (char*)newbuf; 
+						q += "'";
+						TePGConnection::freeMem(newbuf);
+						newbuf = NULL;
+					break;
+  					default:
+						q += "'"+escapeSequence(row[jj])+"'";
+  					break;
+  				}				
+			}
+			else
+			{
+				uniqueVal = row[jj];
+				isUniqueValString = ((*it).rep_.type_ == TeSTRING);
+			}
+			++it;
+			j++;
+			jj++;
+		}
+		if (q.empty())
+			continue;
+		
+		if (!uniqueName.empty() && !uniqueVal.empty())  
+		{
+			if(isUniqueValString)
+				q += " WHERE " + uniqueName + " = '" + uniqueVal +"'";
+			else
+				q += " WHERE " + uniqueName + " = " + uniqueVal;
+		}
+		string sql = "UPDATE "+ table.name() + " SET " + q;
+		if (!execute(sql))
+		{
+			rollbackTransaction();
+			if(newbuf)
+			{
+				TePGConnection::freeMem(newbuf);
+				newbuf = NULL;
+			}
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		if(newbuf)
+		{
+			TePGConnection::freeMem(newbuf);
+			newbuf = NULL;
+		}
+		return false;
+	}
+	if(newbuf)
+	{
+		TePGConnection::freeMem(newbuf);
+		newbuf = NULL;
+	}
+	return true;
+}
+
+bool TePostgreSQL::insertTableInfo(int layerId, TeTable& table, const string& user)
+{
+	errorMessage_ = "";
+
+	if(table.name().empty())
+		return false;
+
+	if(table.id() <= 0)
+	{
+		string sql  = "INSERT INTO te_layer_table (";
+		
+		if(layerId > 0)
+		{
+			sql += "layer_id, ";
+		}
+
+		sql += "attr_table, unique_id, attr_link, attr_initial_time, attr_final_time, ";
+		sql += "attr_time_unit, attr_table_type, user_name) VALUES(";
+		
+		if(layerId > 0)
+		{
+			sql += Te2String(layerId) + ", ";
+		}	
+		
+		sql += "'" + table.name();
+		sql += "', '" + table.uniqueName();		
+		sql += "', '";
+		sql += table.linkName();
+		sql += "', '";
+		sql += table.attInitialTime();
+		sql += "', '";
+		sql += table.attFinalTime();
+		sql += "', ";
+		sql += Te2String(table.attTimeUnit());
+		sql += ", ";
+		sql += Te2String(table.tableType());
+		sql += ", '";
+		sql += user;
+		sql += "')";
+
+		if(this->execute(sql))
+		{
+			sql = "SELECT currval('te_layer_table_table_id_seq')";
+			TePGRecordset rec;
+			rec.open(sql, &tepg_connection_);
+
+			if(rec.recordCount() > 0)
+				table.setId(rec.getInt(0));
+
+			rec.close();
+		}
+		else
+			return false;
+	}
+	
+	return true;	
+}
+
+
+bool TePostgreSQL::alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName)
+{
+	if(!tableExist(tableName))
+		return false;
+
+	string tab;
+
+	if(!oldColName.empty())
+	{
+		tab  = " ALTER TABLE " + tableName + " RENAME COLUMN ";
+		tab += oldColName +  " TO " + rep.name_;
+	}
+	else
+	{
+		tab  = " ALTER TABLE " + tableName + " ALTER COLUMN ";
+		tab += rep.name_ + " TYPE ";
+
+		switch (rep.type_)
+		{
+			case TeSTRING:
+				if(rep.numChar_ > 0)
+				{
+					tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+				}
+				else
+				{
+					tab += "TEXT ";
+				}	
+				break;
+				
+			case TeREAL:
+				tab += "FLOAT8";	
+				break;
+				
+			case TeINT:
+				tab += (rep.isAutoNumber_ ? "SERIAL" : "INTEGER");
+				break;
+
+			case TeDATETIME:
+				tab += "TIMESTAMP(0)";
+				break;
+
+			case TeCHARACTER:
+				tab += "CHAR";
+				break;
+			case TeBOOLEAN:		
+				tab += "BOOLEAN";
+				break;
+
+			case TeBLOB:
+				tab += "BYTEA";
+				break; 
+			
+			default:
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+				break;
+		}	
+	}
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error alter table " + tableName + " !";
+
+		return false;
+	}
+
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + tableName + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+
+	if(tableId.empty() == false)
+	{
+		if(oldColName.empty() == false) // column name changed
+		{
+			 // update relation
+			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
+			sql += " WHERE related_table_id = " + tableId;
+			sql += " AND related_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
+			sql += " WHERE external_table_name = '" + tableName + "'";
+			sql += " AND external_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			 // update grouping
+			sql = "UPDATE te_grouping SET grouping_attr = '" + tableName + "." + rep.name_ + "'";
+			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+		else // column type changed
+		{
+			// delete relation
+			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+			sql += " AND related_attr = '" + rep.name_ + "')";
+			sql += " OR (external_table_name = '" + tableName + "'";
+			sql += " AND external_attr = '" + rep.name_ + "')";
+			if(execute(sql) == false)
+				return false;
+
+			// delete grouping
+			TeDatabasePortal* portal = getPortal();
+			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(portal->query(sql) && portal->fetchRow())
+			{
+				string themeId = portal->getData(0);
+
+				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
+				if(execute(sql) == false)
+				{
+					delete portal;
+					return false;
+				}
+			}
+			delete portal;
+
+			sql = "DELETE FROM te_grouping";
+			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+	}
+	alterTableInfoInMemory(tableName);
+	return true;
+}
+
+bool TePostgreSQL::alterTable(const string& oldTableName, const string& newTableName)
+{
+	string sql = " ALTER TABLE \""+ oldTableName +"\" RENAME TO "+ newTableName;
+	if(!this->execute(sql))
+		return false;
+
+	//update te_layer_table
+	sql = " UPDATE te_layer_table ";
+	sql += " SET attr_table = '"+ newTableName +"'";
+	sql += " WHERE attr_table = '"+ oldTableName +"'";
+	execute(sql);
+
+	//update te_tables_relation
+	sql = " UPDATE te_tables_relation ";
+	sql += " SET external_table_name = '"+ newTableName +"'";
+	sql += " WHERE external_table_name = '"+ oldTableName +"'";
+	execute(sql);
+	
+	alterTableInfoInMemory(newTableName, oldTableName);
+	return true;
+}
+
+bool TePostgreSQL::insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size)
+{
+	if (whereClause.empty())
+		return false;
+
+	errorMessage_ = "";
+
+	TePostgreSQLPortal* portal = static_cast<TePostgreSQLPortal*>(this->getPortal());
+	
+	if(!portal)
+		return false;
+
+	string q = "SELECT * FROM "+ tableName +" WHERE "+ whereClause;
+	if((!portal->query(q)) || (!portal->fetchRow()))
+	{
+		delete portal;
+		return false;
+	}
+
+//	int exist = portal->getInt(columnBlob);
+
+	delete portal;
+
+	size_t newLen = 0;
+
+	unsigned char* newbuf = TePGConnection::escapeBytea(data, size, &newLen);
+
+	string sql  = "UPDATE ";
+	       sql += tableName;
+	       sql += " SET ";
+	       sql += columnBlob;
+	       sql += " = '";
+	       sql += (char*)newbuf;
+		   sql += "' WHERE ";
+		   sql += whereClause;
+
+	if (!TePostgreSQL::execute(sql))
+	{
+		TePGConnection::freeMem(newbuf);
+		newbuf = NULL;
+
+		errorMessage_ = "Couldn't update blob!";
+
+		return false;
+	}
+
+	TePGConnection::freeMem(newbuf);
+	newbuf = NULL;
+
+	return true;
+}
+
+bool TePostgreSQL::insertProjection(TeProjection *proj)
+{
+	errorMessage_ = "";
+
+	TeProjectionParams par = proj->params();
+
+	string sql  = "INSERT INTO te_projection (name, long0, lat0, offx, ";
+		   sql += "offy, stlat1, stlat2, unit, scale, ";
+		   sql += "hemis, datum, radius, flattening, ";
+		   sql += "dx, dy, dz) VALUES('";
+		   sql += proj->name();
+		   sql += "', ";
+		   sql += Te2String(par.lon0*TeCRD, 15);
+		   sql += ", ";
+		   sql += Te2String(par.lat0*TeCRD, 15);
+		   sql += ", ";
+		   sql += Te2String(par.offx, 15);
+		   sql += ", ";
+		   sql += Te2String(par.offy, 15);
+		   sql += ", ";
+		   sql += Te2String(par.stlat1*TeCRD, 15);
+		   sql += ", ";
+		   sql += Te2String(par.stlat2*TeCRD, 15);
+		   sql += ", '";
+		   sql += par.units;
+		   sql += "', ";
+		   sql += Te2String(par.scale, 15);
+		   sql += ", ";
+		   sql += Te2String(par.hemisphere);
+		   sql += ", '";
+		   sql += proj->datum().name();
+		   sql += "', ";
+		   sql += Te2String(proj->datum().radius(), 15);
+		   sql += ", ";
+		   sql += Te2String(proj->datum().flattening(), 15);
+		   sql += ", ";
+		   sql += Te2String(proj->datum().xShift(), 15);
+		   sql += ", ";
+		   sql += Te2String(proj->datum().yShift(), 15);
+		   sql += ", ";
+		   sql += Te2String(proj->datum().zShift(), 15);
+		   sql += ")";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('te_projection_projection_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+			proj->id(rec.getInt(0));
+
+		rec.close();
+	}
+	else
+		return false;
+		
+	return true;	
+}
+
+
+bool TePostgreSQL::insertLayer(TeLayer *layer)
+{
+	errorMessage_ = "";
+
+	TeProjection* proj = layer->projection();
+	if (!proj || !insertProjection(proj))
+	{
+		errorMessage_ = "Error inserting projection!";
+		return false;
+	}
+
+	string sql  = "INSERT INTO te_layer (projection_id, name, lower_x, lower_y, upper_x, ";
+		   sql += "upper_y, edition_time) VALUES(";
+		   sql += Te2String(proj->id());
+		   sql += ", '";
+		   sql += layer->name();
+	       sql += "', ";
+	       sql += Te2String(layer->box().x1(), 15);
+	       sql += ", ";
+	       sql += Te2String(layer->box().y1(), 15);
+	       sql += ", ";
+	       sql += Te2String(layer->box().x2(), 15);
+	       sql += ", ";
+	       sql += Te2String(layer->box().y2(), 15);
+		   sql += ", ";
+		   TeTime editionTime = layer->getEditionTime();
+		   sql += getSQLTime(editionTime);
+	       sql += ")";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('te_layer_layer_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+		{
+			layer->id(rec.getInt(0));
+		}
+		rec.close();
+	}
+	else
+		return false;
+
+	layerMap()[layer->id()] = layer;
+
+	return true;	
+}
+
+
+bool TePostgreSQL::insertProject(TeProject *project)
+{
+	errorMessage_ = "";
+
+	if (!project)
+		return false;
+
+	string sql  = "INSERT INTO te_project (name, description, current_view) VALUES(";
+		   sql += " '";
+		   sql += project->name();
+	       sql += "', '";
+		   sql += project->description();
+	       sql += "', ";
+		   sql += Te2String(project->getCurrentViewId());
+	       sql += ")";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('te_project_project_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+		{
+			project->setId(rec.getInt(0));
+		}
+		rec.close();
+	}
+	else
+		return false;
+	projectMap()[project->id()] = project;
+	for (unsigned int i=0; i<project->getViewVector().size(); i++)
+		insertProjectViewRel(project->id(), project->getViewVector()[i]);
+	return true;	
+}
+
+
+
+bool TePostgreSQL::insertRepresentation(int layerId, TeRepresentation& rep)
+{	
+	errorMessage_ = "";
+
+	if(layerId <= 0)
+		return false;
+	
+
+	string sql  = "INSERT INTO te_representation (layer_id, geom_type, geom_table, description, lower_x, ";
+		   sql += "lower_y, upper_x, upper_y, res_x, res_y, num_cols, num_rows) VALUES(";
+		   sql += Te2String(layerId);
+		   sql += ", ";
+		   sql += Te2String(static_cast<long>(rep.geomRep_));
+		   sql += ", '";
+		   sql += rep.tableName_;
+		   sql += "', '";
+		   sql += rep.description_;		   
+		   sql += "', ";
+           sql += Te2String(rep.box_.x1(), 15);
+		   sql += ", ";
+		   sql += Te2String(rep.box_.y1(), 15);
+		   sql += ", ";
+		   sql += Te2String(rep.box_.x2(), 15);
+		   sql += ", ";
+		   sql += Te2String(rep.box_.y2(), 15);
+		   sql += ", ";
+		   sql += Te2String(rep.resX_, 15);
+		   sql += ", ";
+		   sql += Te2String(rep.resY_, 15);
+		   sql += ", ";
+		   sql += Te2String(static_cast<long>(rep.nCols_));
+		   sql += ", ";
+		   sql += Te2String(static_cast<long>(rep.nLins_));
+		   sql += ")";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('te_representation_repres_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+			rep.id_ = rec.getInt(0);
+
+		rec.close();
+	}
+	else
+		return false;
+
+	return true;		
+}
+
+bool TePostgreSQL::insertView(TeView *view)
+{
+	errorMessage_ = "";
+
+	// save it�s projection
+	TeProjection* proj = view->projection();
+	if ( !proj || !insertProjection(proj))
+	{
+		errorMessage_ = "Error inserting projection";
+		return false;
+	}
+
+	string sql  = "INSERT INTO te_view (projection_id, name, user_name, visibility, lower_x, lower_y, upper_x, upper_y, current_theme) VALUES(";
+	       sql += Te2String(proj->id());
+		   sql += ", '";
+		   sql += view->name();
+		   sql += "', '";
+		   sql += view->user();
+		   sql += "', ";
+		   sql += Te2String(view->isVisible()) + ", ";
+		   sql += Te2String(view->getCurrentBox().lowerLeft().x(),15) + ", ";
+		   sql += Te2String(view->getCurrentBox().lowerLeft().y(),15) + ", ";
+		   sql += Te2String(view->getCurrentBox().upperRight().x(),15) + ", ";
+		   sql += Te2String(view->getCurrentBox().upperRight().y(),15) + ", ";
+		   if(view->getCurrentTheme() == -1)
+				sql += "null ";
+		   else
+				sql += Te2String(view->getCurrentTheme());
+		   sql += ")";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('te_view_view_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+		{
+			view->id(rec.getInt(0));
+		}
+		rec.close();
+	}
+	else
+		return false;
+
+	for(unsigned int th = 0; th < view->size(); ++th)
+	{
+		TeViewNode* node = view->get (th);
+		if (node->type() == TeTHEME)
+		{
+			TeTheme *theme = (TeTheme*) node;
+			insertTheme (theme);
+		}
+		else
+		{
+			TeViewTree* tree = (TeViewTree*)node;
+			insertViewTree (tree);
+		}
+	}
+
+	viewMap()[view->id()] = view;
+
+	return true;
+}
+
+bool TePostgreSQL::insertViewTree(TeViewTree *tree)
+{
+	errorMessage_ = "";
+
+	string sql  = "INSERT INTO te_theme (view_id, name, parent_id, priority, node_type) VALUES(";
+
+		   sql += Te2String(tree->view());
+		   sql += ", '";
+	       sql += tree->name();
+	       sql += "', ";
+	       sql += Te2String(tree->parentId());
+	       sql += ", ";
+		   sql += Te2String(tree->priority());
+	       sql += ", ";
+	       sql += Te2String(tree->type());
+	       
+	       sql += ")";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('te_theme_theme_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+			tree->id(rec.getInt(0));
+
+		rec.close();
+	}
+	else
+		return false;
+		
+	return true;	
+}
+
+bool TePostgreSQL::insertThemeGroup(TeViewTree* tree)
+{
+	errorMessage_ = "";
+
+	string sql  = "INSERT INTO te_theme (name, parent_id, node_type, view_id, priority) VALUES(";
+	       sql += "'";
+		   sql += tree->name();
+		   sql += "', 1, 1, ";
+		   sql += Te2String(tree->view());
+		   sql += ", ";
+	       sql += Te2String(tree->priority());
+	       sql += ")";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('te_theme_theme_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+			tree->id(rec.getInt(0));
+
+		rec.close();
+	}
+	else
+		return false;
+		
+	return true;	
+}
+
+bool TePostgreSQL::insertTheme(TeAbstractTheme *theme)
+{
+	errorMessage_ = "";
+
+	string sql  = "INSERT INTO te_theme (layer_id, view_id, name, parent_id, priority, node_type, ";
+	       sql += "min_scale, max_scale, generate_attribute_where, generate_spatial_where, ";
+		   sql += "generate_temporal_where, collection_table, visible_rep, enable_visibility, ";
+		   sql += "lower_x, lower_y, upper_x, upper_y, creation_time) VALUES(";
+		   
+		   if(theme->type()==TeTHEME)
+			   sql += Te2String(static_cast<TeTheme*>(theme)->layerId());
+		   else
+			   sql += " NULL ";
+		   sql += ", ";
+		   sql += Te2String(theme->view());
+		   sql += ", '";
+		   sql += theme->name();
+		   sql += "', ";
+		   sql += Te2String(theme->parentId());
+		   sql += ", ";
+		   sql += Te2String(theme->priority());
+		   sql += ", ";
+		   sql += Te2String(theme->type());
+		   sql += ", ";
+		   sql += Te2String(theme->minScale(), 15);
+		   sql += ", ";
+		   sql += Te2String(theme->maxScale(), 15);
+		   sql += ", '";
+		   sql += escapeSequence(theme->attributeRest());
+		   sql += "', '";
+		   sql += escapeSequence(theme->spatialRest());
+		   sql += "', '";
+		   sql += escapeSequence(theme->temporalRest());
+		   sql += "', '";
+		   if(theme->type()==TeTHEME)
+				sql += static_cast<TeTheme*>(theme)->collectionTable();
+		   sql += "', ";
+		   sql += Te2String(theme->visibleRep());
+		   sql += ", ";
+		   sql += Te2String(theme->visibility());
+		   sql += ", ";
+		   sql += Te2String(theme->box().x1(), 15);
+		   sql += ", ";
+		   sql += Te2String(theme->box().y1(), 15);
+		   sql += ", ";
+		   sql += Te2String(theme->box().x2(), 15);
+		   sql += ", ";
+		   sql += Te2String(theme->box().y2(), 15);
+		   sql += ", ";
+		   TeTime creationTime = theme->getCreationTime();
+		   sql += getSQLTime(creationTime);
+		   sql += " )";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('te_theme_theme_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+		{
+			theme->id(rec.getInt(0));
+		}
+		rec.close();
+	}
+	else
+		return false;
+
+
+	if((theme->type()==TeTHEME || theme->type()==TeEXTERNALTHEME) && static_cast<TeTheme*>(theme)->collectionTable().empty())
+	{
+		sql  = "UPDATE te_theme SET";
+		sql += " collection_table = 'te_collection_" + Te2String(theme->id()) + "'";
+		sql += " WHERE theme_id = ";
+		sql += Te2String(theme->id());
+
+		static_cast<TeTheme*>(theme)->collectionTable(string("te_collection_") + Te2String(theme->id()));
+
+		if(!this->execute(sql))
+			return false;
+	}
+	if(theme->parentId() == 0)
+	{
+		std::string sql = "UPDATE te_theme SET";
+		sql += "  parent_id = " + Te2String(theme->id());
+		sql += " WHERE theme_id = ";
+		sql += Te2String(theme->id());
+
+		theme->parentId(theme->id());
+
+		if(!this->execute(sql))
+			return false;
+	}
+
+	bool status;
+
+	// insert grouping
+	int numSlices = 0;
+	if(theme->grouping().groupMode_ != TeNoGrouping)
+	{
+		if(!insertGrouping (theme->id(), theme->grouping()))
+			return false;
+		numSlices = theme->grouping().groupNumSlices_;
+	}
+		
+	// insert legend
+	theme->outOfCollectionLegend().group(-1); 
+	theme->outOfCollectionLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->outOfCollectionLegend())); 
+	if (!status)
+		return status;
+
+	theme->withoutDataConnectionLegend().group(-2); 
+	theme->withoutDataConnectionLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->withoutDataConnectionLegend())); 
+	if (!status)
+		return status;
+
+	theme->defaultLegend().group(-3); 
+	theme->defaultLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->defaultLegend())); 
+	if (!status)
+		return status;
+
+	theme->pointingLegend().group(-4); 
+	theme->pointingLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->pointingLegend())); 
+	if (!status)
+		return status;
+
+	theme->queryLegend().group(-5); 
+	theme->queryLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->queryLegend())); 
+	if (!status)
+		return status;
+
+	theme->queryAndPointingLegend().group(-6); 
+	theme->queryAndPointingLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->queryAndPointingLegend())); 
+	if (!status)
+		return status;
+
+	for (int i = 0; i < numSlices; i++)
+	{
+		theme->legend()[i].group(i);
+		theme->legend()[i].theme(theme->id());
+		status = insertLegend (&(theme->legend()[i]));
+		if (!status)
+			return status;
+	}
+	if (!status)
+		return status;
+
+	//insert metadata theme
+	if(!theme->saveMetadata(this))
+		return false;
+
+	themeMap()[theme->id()] = theme;
+
+	if(theme->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(theme)))
+		return false;
+
+	return true;
+}
+
+bool TePostgreSQL::insertThemeTable(int themeId, int tableId, int relationId, int tableOrder)
+{
+	errorMessage_ = "";
+
+	string sql  = "INSERT INTO te_theme_table (theme_id, table_id, ";
+
+	if(relationId > 0)
+		sql += "relation_id, ";
+
+	sql += "table_order) VALUES(";
+	sql += Te2String(themeId);
+	sql += ", ";
+	sql += Te2String(tableId);
+	sql += ", ";
+
+	if(relationId > 0)
+	{
+		sql += Te2String(relationId);
+		sql += ", ";
+	}
+
+	sql += Te2String(tableOrder);
+	sql += ")";
+
+	if(this->execute(sql))
+	{
+		//sql = "SELECT currval('te_theme_table_theme_table_id_seq')";
+		//TePGRecordset rec;
+		//rec.open(sql, &tepg_connection_);
+		//if(rec.recordCount() > 0)
+		//{
+		//	tree->id(atoi(rec.value(0)));
+		//}
+		//rec.close();
+	}
+	else
+		return false;
+		
+	return true;	
+}
+
+bool TePostgreSQL::generateLabelPositions(TeTheme *theme, const std::string& objectId)
+{
+	string	geomTable, upd;
+	string	collTable = theme->collectionTable();
+	
+	if((collTable.empty()) || (!tableExist(collTable)))
+		return false;
+
+	if(theme->layer()->hasGeometry(TeCELLS)    || 
+	   theme->layer()->hasGeometry(TePOLYGONS) ||
+	   theme->layer()->hasGeometry(TeLINES))
+	{
+		geomTable = theme->layer()->tableName(TeCELLS);
+		
+		if(geomTable.empty())
+		{
+			geomTable = theme->layer()->tableName(TePOLYGONS);
+			if(geomTable.empty())
+			{
+				geomTable = theme->layer()->tableName(TeLINES);
+
+				if(geomTable.empty())
+					return false;
+			}
+		}
+		
+		string lower_x =  "(((" + geomTable + ".spatial_box[1])[0]))";
+		string lower_y =  "(((" + geomTable + ".spatial_box[1])[1]))";
+		string upper_x =  "(((" + geomTable + ".spatial_box[0])[0]))";
+		string upper_y =  "(((" + geomTable + ".spatial_box[0])[1]))";
+		
+		upd  = " UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(" + lower_x + " + (" + upper_x;
+		upd += " - " + lower_x + ") / 2.0) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(" + lower_y + " + (" + upper_y;
+		upd += " - " + lower_y + ") / 2.0) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+
+		upd += " WHERE (label_x IS NULL) OR (label_y IS NULL)";
+	}	
+	else if(theme->layer()->hasGeometry(TePOINTS))
+	{
+		geomTable = theme->layer()->tableName(TePOINTS);
+	
+		upd  = " UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(x)";
+		upd += " FROM " + geomTable + " WHERE object_id = c_object_id), ";
+
+
+		upd += " label_y = (SELECT MAX(y)";
+		upd += " FROM " + geomTable + " WHERE object_id = c_object_id) ";
+
+		upd += " WHERE (label_x IS NULL) OR (label_y IS NULL)";
+	}
+
+	if (!upd.empty())
+	{
+		if (!objectId.empty())
+		{
+			upd += " AND c_object_id='"+objectId+"'";
+		}
+		if(!execute(upd))
+			return false;
+	}
+
+	return true;
+}
+
+bool TePostgreSQL::insertLegend(TeLegendEntry *legend)
+{
+	errorMessage_ = "";
+
+	string sql  = "INSERT INTO te_legend (theme_id, group_id, num_objs, lower_value, upper_value, ";
+		   sql += "label) VALUES(";
+		   sql += Te2String(legend->theme());
+		   sql += ", ";
+		   sql += Te2String(legend->group());
+		   sql += ", ";
+	   	   sql += Te2String(legend->count());
+		   sql += ", '";
+		   sql += escapeSequence(legend->from());
+		   sql += "', '";
+		   sql += escapeSequence(legend->to());
+		   sql += "', '";
+		   sql += escapeSequence(legend->label());
+		   sql += "')";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('te_legend_legend_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+		{
+			legend->id(rec.getInt(0));
+		}
+		rec.close();
+	}
+	else
+		return false;	
+
+	legendMap()[legend->id()] = legend;
+
+	return insertVisual(legend);
+}
+
+bool TePostgreSQL::loadPolygonSet(const string& table, TeBox& box, TePolygonSet& ps)
+{
+	TeDatabasePortal *portal = this->getPortal();
+
+	if(!portal)
+		return false;
+
+	string q = "SELECT * FROM " + table + " WHERE ";
+	       q += this->getSQLBoxWhere(box, TePOLYGONS, table);
+	       q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
+
+	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		ps.add(poly);
+	}
+	while (flag);
+
+	delete portal;
+
+	return true;
+}
+
+TeDatabasePortal* TePostgreSQL::loadPolygonSet(const string& table, TeBox& box)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	
+	if(!portal)
+		return 0;
+
+	string q = "SELECT * FROM " + table + " WHERE ";
+	       q += this->getSQLBoxWhere(box, TePOLYGONS, table);
+	       q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
+
+	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return 0;
+	}
+	else 
+		return portal;
+}
+
+bool TePostgreSQL::locatePolygon(const string& table, TeCoord2D& pt, TePolygon& polygon, const double& tol)
+{
+	TeDatabasePortal *portal = this->getPortal();
+
+	if (!portal)
+		return false;
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+
+
+	string sql  = "SELECT * FROM ";
+	       sql += table;
+		   sql += " WHERE ";
+		   sql += getSQLBoxWhere(box, TePOLYGONS, table);
+		   sql += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
+		   
+	
+	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+
+	do
+	{
+		TePolygon poly;
+
+		flag = portal->fetchGeometry(poly);
+
+		if(TeWithin(TePoint(pt), poly))
+		{
+			polygon = poly;
+			delete portal;
+			return true;
+		}
+	}
+	while(flag);
+	
+	delete portal;
+	
+	return false;
+}
+
+bool TePostgreSQL::locatePolygonSet(const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	
+	if (!portal)
+		return false;
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+
+
+	string sql  = "SELECT * FROM ";
+	       sql += table;
+		   sql += " WHERE ";
+		   sql += getSQLBoxWhere(box, TePOLYGONS, table);
+		   sql += " ORDER BY object_id, parent_id, num_holes DESC, ext_max ASC";
+
+	if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+	
+	polygons.clear();
+	
+	do
+	{
+		TePolygon poly;
+
+		flag = portal->fetchGeometry(poly);
+
+		if(TeWithin(TePoint(pt), poly))
+			polygons.add(poly);
+	}
+	while (flag);
+
+	delete portal;
+
+	if(polygons.size())
+		return (true);
+
+	return false;
+}
+
+bool TePostgreSQL::insertPolygon(const string& table, TePolygon &p)
+{
+	errorMessage_ = "";
+
+	int parentId = 0;
+
+	for(unsigned int k = 0u; k < p.size(); ++k)
+	{
+		TeLinearRing& ring = p[k];
+
+		TeBox b = ring.box();
+
+		unsigned int ringSize = ring.size();
+
+		double extMax = MAX(b.width(), b.height());
+
+		unsigned int numberOfHoles = 0u;
+		
+		if(k == 0u)
+			numberOfHoles = p.size() - 1u;
+
+		unsigned int sizeBinaryRing = 0;
+		unsigned int sizeBinaryBox = 0;
+		char* binaryRing = TeLine2DToPGBinary(ring, sizeBinaryRing);
+		char* binaryBox = TeBoxToPGBinary(b, sizeBinaryBox);
+
+		int nParams = 7;
+		Oid paramTypes[7];
+		const char *paramValues[7];
+		int paramLengths[7];
+		int paramFormats[7];
+		
+		//tipos dos parametros
+		paramTypes[0] = PG_VARCHAR_TYPE;
+		paramTypes[1] = PG_INT4_TYPE;
+		paramTypes[2] = PG_INT4_TYPE;
+		paramTypes[3] = PG_INT4_TYPE;
+		paramTypes[4] = PG_BOX_TYPE;
+		paramTypes[5] = PG_FLOAT8_TYPE;
+		paramTypes[6] = PG_POLYGON_TYPE;
+
+		string strOid = escapeSequence(p.objectId());
+		paramValues[0] = strOid.c_str();
+
+		string strSize = Te2String(ringSize);
+		paramValues[1] = strSize.c_str();		
+
+		string strHoles = Te2String(numberOfHoles);
+		paramValues[2] = strHoles.c_str();
+
+		string strParent = Te2String(parentId);
+		paramValues[3] = strParent.c_str();		
+
+		paramValues[4] = binaryBox;
+
+		char* chrExtMax = new char[sizeof(double)];
+		double swappedDouble = TeConvertToBigEndian(extMax);
+		memcpy(chrExtMax, &swappedDouble, sizeof(double));
+		paramValues[5] = chrExtMax;
+
+		paramValues[6] = binaryRing;
+
+		paramLengths[0] = 0;
+		paramLengths[1] = 0;
+		paramLengths[2] = 0;
+		paramLengths[3] = 0;
+		paramLengths[4] = sizeBinaryBox;
+		paramLengths[5] = sizeof(double);
+		paramLengths[6] = sizeBinaryRing;
+		
+		paramFormats[0] = 0;
+		paramFormats[1] = 0;
+		paramFormats[2] = 0;
+		paramFormats[3] = 0;
+		paramFormats[4] = 1;
+		paramFormats[5] = 1;
+		paramFormats[6] = 1;
+		
+
+		string command = "INSERT INTO ";
+				command += table;
+				command += " (object_id, num_coords, num_holes, parent_id, spatial_box, ext_max, spatial_data)"; 
+				command += " VALUES ($1, $2, $3, $4,$5, $6, $7)";
+		
+		int result = tepg_connection_.exec_cmd_params(command.c_str(), 
+                       nParams,
+                       paramTypes,
+                       paramValues,
+                       paramLengths,
+                       paramFormats,
+                       0);
+
+		delete [] binaryRing;
+		delete [] binaryBox;
+		delete [] chrExtMax;
+
+		if(result == 1)
+		{
+			string sql = "SELECT currval('" + table + "_geom_id_seq')";
+		
+			TePGRecordset rec;
+			rec.open(sql, &tepg_connection_);
+
+			if(rec.recordCount() > 0)
+				ring.geomId(rec.getInt(0));
+
+			if(k == 0u)
+			{
+				parentId = ring.geomId();
+
+				p.geomId(ring.geomId());
+
+				string newSQL  = "UPDATE " + table + " SET parent_id = ";
+				       newSQL += Te2String(parentId);
+					   newSQL += " WHERE geom_id = ";
+					   newSQL += Te2String(parentId);
+
+				if(!this->execute(newSQL))
+					return false;
+			}
+
+			rec.close();
+		}
+		else
+			return false;
+	}
+
+	return true;
+}
+
+bool TePostgreSQL::updatePolygon(const string& table, TePolygon &p)
+{
+	errorMessage_ = "";
+
+	int parentId = 0;
+
+	for(unsigned int k = 0u; k < p.size(); ++k)
+	{
+		TeLinearRing& ring = p[k];
+
+		TeBox b = ring.box();
+
+		unsigned int ringSize = ring.size();
+
+		double extMax = MAX(b.width(), b.height());
+
+		unsigned int numberOfHoles = 0u;
+		
+		if(k == 0u)
+		{
+			parentId = ring.geomId();
+
+			numberOfHoles = p.size() - 1u;
+		}
+
+		unsigned int sizeBinaryRing = 0;
+		unsigned int sizeBinaryBox = 0;
+		char* binaryRing = TeLine2DToPGBinary(ring, sizeBinaryRing);
+		char* binaryBox = TeBoxToPGBinary(b, sizeBinaryBox);
+
+		int nParams = 7;
+		Oid paramTypes[7];
+		const char *paramValues[7];
+		int paramLengths[7];
+		int paramFormats[7];
+		
+		//tipos dos parametros
+		paramTypes[0] = PG_VARCHAR_TYPE;
+		paramTypes[1] = PG_INT4_TYPE;
+		paramTypes[2] = PG_INT4_TYPE;
+		paramTypes[3] = PG_INT4_TYPE;
+		paramTypes[4] = PG_BOX_TYPE;
+		paramTypes[5] = PG_FLOAT8_TYPE;
+		paramTypes[6] = PG_POLYGON_TYPE;
+
+		string strOid = escapeSequence(p.objectId());
+		paramValues[0] = strOid.c_str();
+
+		string strSize = Te2String(ringSize);
+		paramValues[1] = strSize.c_str();		
+
+		string strHoles = Te2String(numberOfHoles);
+		paramValues[2] = strHoles.c_str();
+
+		string strParent = Te2String(parentId);
+		paramValues[3] = strParent.c_str();		
+
+		paramValues[4] = binaryBox;
+
+		char* chrExtMax = new char[sizeof(double)];
+		double swappedDouble = TeConvertToBigEndian(extMax);
+		memcpy(chrExtMax, &swappedDouble, sizeof(double));
+		paramValues[5] = chrExtMax;
+
+		paramValues[6] = binaryRing;
+
+		paramLengths[0] = 0;
+		paramLengths[1] = 0;
+		paramLengths[2] = 0;
+		paramLengths[3] = 0;
+		paramLengths[4] = sizeBinaryBox;
+		paramLengths[5] = sizeof(double);
+		paramLengths[6] = sizeBinaryRing;
+		
+		paramFormats[0] = 0;
+		paramFormats[1] = 0;
+		paramFormats[2] = 0;
+		paramFormats[3] = 0;
+		paramFormats[4] = 1;
+		paramFormats[5] = 1;
+		paramFormats[6] = 1;
+
+		string command  = "UPDATE " + table + " SET ";
+		command += "object_id = $1";
+		command += ", num_coords = $2";
+		command += ", num_holes = $3";
+		command += ", parent_id = $4";
+		command += ", spatial_box = $5";
+		command += ", ext_max = $6";
+		command += ", spatial_data = $7";
+		command += " WHERE geom_id = ";
+		command += Te2String(ring.geomId());
+		
+		int result = tepg_connection_.exec_cmd_params(command.c_str(), 
+                       nParams,
+                       paramTypes,
+                       paramValues,
+                       paramLengths,
+                       paramFormats,
+                       0);
+
+		delete [] binaryRing;
+		delete [] binaryBox;
+		delete [] chrExtMax;
+
+		if(result != 1)
+		{
+			return false;
+		}
+	}
+
+	return true;
+}
+
+bool TePostgreSQL::loadLineSet(const string& table, TeBox& box, TeLineSet& linSet)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	
+	if(!portal)
+		return false;
+
+	string q  = "SELECT * FROM " + table + " WHERE ";
+	       q += this->getSQLBoxWhere (box, TeLINES, table);
+
+	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+
+	do
+	{
+		TeLine2D lin;
+		flag = portal->fetchGeometry(lin);
+		linSet.add(lin);
+	}
+	while (flag);
+
+	delete portal;
+
+	return true;
+}
+
+TeDatabasePortal* TePostgreSQL::loadLineSet(const string& table, TeBox& box)
+{
+	TeDatabasePortal *portal = this->getPortal();
+
+	if(!portal)
+		return 0;
+
+	string q  = "SELECT * FROM " + table + " WHERE ";
+	       q += this->getSQLBoxWhere (box, TeLINES, table);
+
+	if(!portal->query(q, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{	
+		delete portal;
+
+		return 0;
+	}
+
+	return portal;
+}
+
+bool TePostgreSQL::insertLine(const string& table, TeLine2D& l)
+{
+	errorMessage_ = "";
+
+	double extMax = MAX(l.box().width(), l.box().height());
+
+	unsigned int sizeBinaryRing = 0;
+	unsigned int sizeBinaryBox = 0;
+	char* binaryRing = TeLine2DToPGBinary(l, sizeBinaryRing);
+	char* binaryBox = TeBoxToPGBinary(l.box(), sizeBinaryBox);
+
+	int nParams = 5;
+	Oid paramTypes[5];
+	const char *paramValues[5];
+	int paramLengths[5];
+	int paramFormats[5];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = PG_INT4_TYPE;
+	paramTypes[2] = PG_BOX_TYPE;
+	paramTypes[3] = PG_FLOAT8_TYPE;
+	paramTypes[4] = PG_POLYGON_TYPE;
+
+	string strOid = escapeSequence(l.objectId());
+	paramValues[0] = strOid.c_str();
+
+	string strSize = Te2String(l.size());
+	paramValues[1] = strSize.c_str();		
+
+	paramValues[2] = binaryBox;
+
+	char* chrExtMax = new char[sizeof(double)];
+	double swappedDouble = TeConvertToBigEndian(extMax);
+	memcpy(chrExtMax, &swappedDouble, sizeof(double));
+	paramValues[3] = chrExtMax;
+	
+	paramValues[4] = binaryRing;
+
+	paramLengths[0] = 0;
+	paramLengths[1] = 0;
+	paramLengths[2] = sizeBinaryBox;
+	paramLengths[3] = sizeof(double);
+	paramLengths[4] = sizeBinaryRing;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 0;
+	paramFormats[2] = 1;
+	paramFormats[3] = 1;
+	paramFormats[4] = 1;
+	
+
+	string command = "INSERT INTO ";
+			command += table;
+			command += " (object_id, num_coords, spatial_box, ext_max, spatial_data)";
+			command += " VALUES ($1, $2, $3, $4, $5)";
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryRing;
+	delete [] binaryBox;
+	delete [] chrExtMax;
+
+	if(result == 1)
+	{
+		string sql = "SELECT currval('" + table + "_geom_id_seq')";
+
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+
+		if(rec.recordCount() > 0)
+			l.geomId(rec.getInt(0));
+
+		rec.close();
+	}
+	else
+		return false;
+
+	return true;
+}
+
+bool TePostgreSQL::updateLine(const string& table, TeLine2D& l)
+{
+	errorMessage_ = "";
+
+	double extMax = MAX(l.box().width(), l.box().height());
+
+	unsigned int sizeBinaryRing = 0;
+	unsigned int sizeBinaryBox = 0;
+	char* binaryRing = TeLine2DToPGBinary(l, sizeBinaryRing);
+	char* binaryBox = TeBoxToPGBinary(l.box(), sizeBinaryBox);
+
+	int nParams = 5;
+	Oid paramTypes[5];
+	const char *paramValues[5];
+	int paramLengths[5];
+	int paramFormats[5];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = PG_INT4_TYPE;
+	paramTypes[2] = PG_BOX_TYPE;
+	paramTypes[3] = PG_FLOAT8_TYPE;
+	paramTypes[4] = PG_POLYGON_TYPE;
+
+	string strOid = escapeSequence(l.objectId());
+	paramValues[0] = strOid.c_str();
+
+	string strSize = Te2String(l.size());
+	paramValues[1] = strSize.c_str();		
+
+	paramValues[2] = binaryBox;
+
+	char* chrExtMax = new char[sizeof(double)];
+	double swappedDouble = TeConvertToBigEndian(extMax);
+	memcpy(chrExtMax, &swappedDouble, sizeof(double));
+	paramValues[3] = chrExtMax;
+	
+	paramValues[4] = binaryRing;
+
+	paramLengths[0] = 0;
+	paramLengths[1] = 0;
+	paramLengths[2] = sizeBinaryBox;
+	paramLengths[3] = sizeof(double);
+	paramLengths[4] = sizeBinaryRing;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 0;
+	paramFormats[2] = 1;
+	paramFormats[3] = 1;
+	paramFormats[4] = 1;
+
+	string command = "UPDATE " + table + " SET";
+		command += " object_id = $1";
+		command += ", num_coords = $2";
+		command += ", spatial_box = $3";
+		command += ", ext_max = $4";
+		command += ", spatial_data = $5";
+		command += " WHERE geom_id = ";
+		command += Te2String(l.geomId());
+	
+	int result = tepg_connection_.exec_cmd_params(command.c_str(), 
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryRing;
+	delete [] binaryBox;
+	delete [] chrExtMax;
+
+	return (result == 1);
+}
+
+bool TePostgreSQL::locateLine(const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+
+	string sql  = "SELECT * FROM ";
+	       sql += table;
+		   sql += " WHERE ";
+		   sql += this->getSQLBoxWhere(box, TeLINES, table);
+
+	
+	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	// Get all lines
+	TeLineSet ls;
+	int k;
+	bool flag = true;
+	do 
+	{
+		TeLine2D l;
+		flag = portal->fetchGeometry( l );
+		ls.add ( l );
+	} while(flag);
+
+	delete portal;
+
+	TeCoord2D paux;
+
+	if(TeNearest(pt, ls, k, paux, tol))
+	{
+		line = ls[k];
+		return true;
+	}
+
+	return false;
+}
+
+bool TePostgreSQL::insertPoint(const string& table, TePoint &p)
+{
+	errorMessage_ = "";
+
+	unsigned int sizeBinaryBox = 0;
+	char* binaryBox = TeBoxToPGBinary(p.box(), sizeBinaryBox);
+
+	int nParams = 4;
+	Oid paramTypes[4];
+	const char *paramValues[4];
+	int paramLengths[4];
+	int paramFormats[4];
+	
+	//tipos dos parametros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = PG_BOX_TYPE;
+	paramTypes[2] = PG_FLOAT8_TYPE;
+	paramTypes[3] = PG_FLOAT8_TYPE;
+
+	char* chrX = new char[sizeof(double)];
+	double swappedDoubleX = TeConvertToBigEndian(p.location().x_);
+	memcpy(chrX, &swappedDoubleX, sizeof(double));
+
+	char* chrY = new char[sizeof(double)];
+	double swappedDoubleY = TeConvertToBigEndian(p.location().y_);
+	memcpy(chrY, &swappedDoubleY, sizeof(double));
+
+	string strOid = escapeSequence(p.objectId());
+	paramValues[0] = strOid.c_str();
+
+	paramValues[1] = binaryBox;
+
+	paramValues[2] = chrX;
+
+	paramValues[3] = chrY;
+	
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryBox;
+	paramLengths[2] = sizeof(double);
+	paramLengths[3] = sizeof(double);
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	paramFormats[2] = 1;
+	paramFormats[3] = 1;
+	
+	
+	string command  = "INSERT INTO " + table + " (object_id, spatial_box, x, y)";
+	command += " VALUES($1, $2, $3, $4)";
+		
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryBox;
+	delete [] chrX;
+	delete [] chrY;
+
+	if(result == 1)
+	{
+		string sql = "SELECT currval('" + table + "_geom_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+			p.geomId(rec.getInt(0));
+
+		rec.close();
+	}
+	else
+		return false;
+	
+	return true;
+}
+
+bool TePostgreSQL::updatePoint(const string& table, TePoint &p)
+{
+	unsigned int sizeBinaryBox = 0;
+	char* binaryBox = TeBoxToPGBinary(p.box(), sizeBinaryBox);
+
+	int nParams = 4;
+	Oid paramTypes[4];
+	const char *paramValues[4];
+	int paramLengths[4];
+	int paramFormats[4];
+	
+	//tipos dos par�metros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = PG_BOX_TYPE;
+	paramTypes[2] = PG_FLOAT8_TYPE;
+	paramTypes[3] = PG_FLOAT8_TYPE;
+
+	char* chrX = new char[sizeof(double)];
+	double swappedDoubleX = TeConvertToBigEndian(p.location().x_);
+	memcpy(chrX, &swappedDoubleX, sizeof(double));
+
+	char* chrY = new char[sizeof(double)];
+	double swappedDoubleY = TeConvertToBigEndian(p.location().y_);
+	memcpy(chrY, &swappedDoubleY, sizeof(double));
+
+	string strOid = escapeSequence(p.objectId());
+	paramValues[0] = strOid.c_str();
+
+	paramValues[1] = binaryBox;
+
+	paramValues[2] = chrX;
+
+	paramValues[3] = chrY;
+	
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryBox;
+	paramLengths[2] = sizeof(double);
+	paramLengths[3] = sizeof(double);
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	paramFormats[2] = 1;
+	paramFormats[3] = 1;
+
+	string command  = "UPDATE " + table + " SET ";
+	       command += " object_id = $1";
+	       command += ", spatial_box = $2";
+           command += ", x = $3";
+           command += ", y = $4";
+           command += " WHERE geom_id = " + Te2String(p.geomId());
+		
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryBox;
+	delete [] chrX;
+	delete [] chrY;
+
+	return (result == 1);
+}
+
+bool TePostgreSQL::locatePoint(const string& table, TeCoord2D& pt, TePoint& point, const double& tol)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox bbox(pt.x() - tol, pt.y() - tol, pt.x() + tol, pt.y() + tol);
+
+	string sql  = "SELECT * FROM ";
+	       sql += table;
+		   sql += " WHERE ";
+		   sql += this->getSQLBoxWhere(bbox, TePOINTS, table);
+
+	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	TePointSet ps;
+	
+	bool flag = true;
+
+	do 
+	{
+		TePoint point;
+		flag = portal->fetchGeometry(point);
+		ps.add(point);
+	}while(flag);
+
+	delete portal;
+	int k;
+	if(TeNearest(pt, ps, k, tol))
+	{
+		point = ps[k];
+		return true;
+	}
+	return false;
+}
+
+bool TePostgreSQL::insertText(const string& table, TeText& t)
+{
+	errorMessage_ = "";
+
+	string sql  = "INSERT INTO " + table + " (object_id, x, y, text_value, angle, height, alignment_vert, alignment_horiz) VALUES('";
+		   sql += escapeSequence(t.objectId());
+		   sql += "', ";
+		   sql += Te2String(t.location().x(), 15);
+		   sql += ", ";
+		   sql += Te2String(t.location().y(), 15);
+		   sql += ", '";
+		   sql += escapeSequence(t.textValue());
+		   sql += "', ";
+		   sql += Te2String(t.angle(), 15);
+		   sql += ", ";
+		   sql += Te2String(t.height(), 15);
+		   sql += ", ";
+		   sql += Te2String(t.alignmentVert(), 15);
+		   sql += ", ";
+		   sql += Te2String(t.alignmentHoriz(), 15);
+		   sql += ")";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('" + table + "_geom_id_seq')";
+
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+			t.geomId(rec.getInt(0));
+
+		rec.close();
+	}
+	else
+		return false;
+
+	return true;
+}
+
+bool TePostgreSQL::insertArc(const string& table, TeArc& arc)
+{
+	errorMessage_ = "";
+
+	string sql  = "INSERT INTO " + table + " (object_id, from_node, to_node) VALUES('";
+		   sql += escapeSequence(arc.objectId());
+		   sql += "', ";
+		   sql += Te2String(arc.fromNode().geomId());
+	       sql += ", ";
+		   sql += Te2String(arc.toNode().geomId());
+		   sql += ")";
+
+	if(this->execute(sql))
+	{
+		sql = "SELECT currval('" + table + "_geom_id_seq')";
+		TePGRecordset rec;
+		rec.open(sql, &tepg_connection_);
+		if(rec.recordCount() > 0)
+			arc.geomId(rec.getInt(0));
+
+		rec.close();
+	}
+	else
+		return false;
+	
+
+	return true;
+}
+
+bool TePostgreSQL::insertNode(const string& table, TeNode& node)
+{
+	errorMessage_ = "";
+
+	unsigned int sizeBinaryBox = 0;
+	char* binaryBox = TeBoxToPGBinary(node.box(), sizeBinaryBox);
+
+	int nParams = 4;
+	Oid paramTypes[4];
+	const char *paramValues[4];
+	int paramLengths[4];
+	int paramFormats[4];
+	
+	//tipos dos par�metros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = PG_BOX_TYPE;
+	paramTypes[2] = PG_FLOAT8_TYPE;
+	paramTypes[3] = PG_FLOAT8_TYPE;
+
+	char* chrX = new char[sizeof(double)];
+	double swappedDoubleX = TeConvertToBigEndian(node.location().x_);
+	memcpy(chrX, &swappedDoubleX, sizeof(double));
+
+	char* chrY = new char[sizeof(double)];
+	double swappedDoubleY = TeConvertToBigEndian(node.location().y_);
+	memcpy(chrY, &swappedDoubleY, sizeof(double));
+
+	string strOid = escapeSequence(node.objectId());
+	paramValues[0] = strOid.c_str();
+
+	paramValues[1] = binaryBox;
+
+	paramValues[2] = chrX;
+
+	paramValues[3] = chrY;
+	
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryBox;
+	paramLengths[2] = sizeof(double);
+	paramLengths[3] = sizeof(double);
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	paramFormats[2] = 1;
+	paramFormats[3] = 1;
+	
+	
+	string command  = "INSERT INTO " + table + " (object_id, spatial_box, x, y)";
+	command += " VALUES($1, $2, $3, $4)";
+		
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryBox;
+	delete [] chrX;
+	delete [] chrY;
+
+	if(result != 1)
+		return false;
+
+	string sql = "SELECT currval('" + table + "_geom_id_seq')";
+	TePGRecordset rec;
+	rec.open(sql, &tepg_connection_);
+	if(rec.recordCount() > 0)
+		node.geomId(rec.getInt(0));
+
+	rec.close();
+
+	return true;
+}
+
+bool TePostgreSQL::updateNode(const string& table, TeNode &node)
+{
+	unsigned int sizeBinaryBox = 0;
+	char* binaryBox = TeBoxToPGBinary(node.box(), sizeBinaryBox);
+
+	int nParams = 4;
+	Oid paramTypes[4];
+	const char *paramValues[4];
+	int paramLengths[4];
+	int paramFormats[4];
+	
+	//tipos dos par�metros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = PG_BOX_TYPE;
+	paramTypes[2] = PG_FLOAT8_TYPE;
+	paramTypes[3] = PG_FLOAT8_TYPE;
+
+	char* chrX = new char[sizeof(double)];
+	double swappedDoubleX = TeConvertToBigEndian(node.location().x_);
+	memcpy(chrX, &swappedDoubleX, sizeof(double));
+
+	char* chrY = new char[sizeof(double)];
+	double swappedDoubleY = TeConvertToBigEndian(node.location().y_);
+	memcpy(chrY, &swappedDoubleY, sizeof(double));
+
+	string strOid = escapeSequence(node.objectId());
+	paramValues[0] = strOid.c_str();
+
+	paramValues[1] = binaryBox;
+
+	paramValues[2] = chrX;
+
+	paramValues[3] = chrY;
+	
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryBox;
+	paramLengths[2] = sizeof(double);
+	paramLengths[3] = sizeof(double);
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	paramFormats[2] = 1;
+	paramFormats[3] = 1;
+	
+	
+	string command = "UPDATE " + table + " SET ";
+    command += "  object_id = $1";
+    command += ", spatial_box = $2";
+	command += ", x = $3";
+	command += ", y = $4";
+    command += " WHERE geom_id = " + Te2String(node.geomId());
+		
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryBox;
+	delete [] chrX;
+	delete [] chrY;
+
+	return (result == 1);
+
+}
+
+bool TePostgreSQL::insertCell(const string& table, TeCell &c)
+{
+	errorMessage_ = "";
+
+	unsigned int sizeBinaryBox = 0;
+	char* binaryBox = TeBoxToPGBinary(c.box(), sizeBinaryBox);
+
+	int nParams = 4;
+	Oid paramTypes[4];
+	const char *paramValues[4];
+	int paramLengths[4];
+	int paramFormats[4];
+	
+	//tipos dos par�metros
+	paramTypes[0] = PG_VARCHAR_TYPE;
+	paramTypes[1] = PG_BOX_TYPE;
+	paramTypes[2] = PG_INT4_TYPE;
+	paramTypes[3] = PG_INT4_TYPE;
+
+	string strOid = escapeSequence(c.objectId());
+	paramValues[0] = strOid.c_str();
+
+	paramValues[1] = binaryBox;
+
+	string strCol = Te2String(c.column());
+	paramValues[2] = strCol.c_str();		
+
+	string strRow = Te2String(c.line());
+	paramValues[3] = strRow.c_str();		
+
+	
+	paramLengths[0] = 0;
+	paramLengths[1] = sizeBinaryBox;
+	paramLengths[2] = 0;
+	paramLengths[3] = 0;
+	
+	paramFormats[0] = 0;
+	paramFormats[1] = 1;
+	paramFormats[2] = 0;
+	paramFormats[3] = 0;
+	
+	
+	string command  = "INSERT INTO " + table + " (object_id, spatial_box, col_number, row_number)";
+	command += " VALUES($1, $2, $3, $4)";
+		
+	int result = tepg_connection_.exec_cmd_params(command.c_str(),
+                    nParams,
+                    paramTypes,
+                    paramValues,
+                    paramLengths,
+                    paramFormats,
+                    0);
+
+	delete [] binaryBox;
+
+	if(result != 1)
+		return false;
+
+	string sql = "SELECT currval('" + table + "_geom_id_seq')";
+	TePGRecordset rec;
+	rec.open(sql, &tepg_connection_);
+	if(rec.recordCount() > 0)
+		c.geomId(rec.getInt(0));
+	
+	rec.close();	
+
+	return true;
+}
+
+bool TePostgreSQL::updateCell(const string& table, TeCell &c)
+{
+	TeBox b = c.box();
+
+	string sql;
+	sql = "UPDATE " + table + " SET ";
+	sql += "spatial_box = '" + PGBoxRtree_encode(b) + "', ";
+	sql += "col_number=" + Te2String(c.column()) + ", ";
+	sql += "row_number=" + Te2String(c.line());
+	sql += " WHERE geom_id = " + c.geomId();
+	
+	return (this->execute(sql));
+}
+
+bool TePostgreSQL::insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char* buf, unsigned long size, int band, unsigned int res, unsigned int subband)
+{
+	errorMessage_ = "";
+
+	if (blockId.empty()) 
+	{
+		errorMessage_ = "No block identifier provided!";
+		return false;
+	}
+
+	TePostgreSQLPortal* portal = static_cast<TePostgreSQLPortal*>(this->getPortal());
+	if(!portal)
+		return false;
+
+	bool update = false;
+	string q ="SELECT * FROM " + table; 
+	q += " WHERE block_id='" + blockId + "'";
+
+	if (!portal->query(q))
+	{
+		delete portal;
+		return false;
+	}
+
+	// check if this block is alread in the database
+	if(portal->fetchRow())
+		update = true;
+
+	delete portal;
+
+
+	string sql = "";
+		
+	size_t newLen = 0;
+
+	unsigned char* newbuf = TePGConnection::escapeBytea(buf, size, &newLen);
+
+	if(!update)
+		getInsertRasterBlock(table, blockId, ll, ur, band, res, subband, (char*)newbuf, size, sql);
+	else
+		getUpdateRasterBlock(table, blockId, ll, ur, band, res, subband, (char*)newbuf, size, sql);
+
+
+	if(!execute(sql))
+	{
+		TePGConnection::freeMem(newbuf);
+		newbuf = NULL;
+		errorMessage_ = "Couldn't insert/update a rasterblock!";
+		return false;
+	}
+
+	TePGConnection::freeMem(newbuf);
+	newbuf = NULL;
+
+	return true;
+}
+
+string TePostgreSQL::getSQLStatistics(TeGroupingAttr& attrs)
+{
+	string sql = "";
+	string virg = "";
+
+	TeGroupingAttr::iterator it = attrs.begin();
+	int count = 0;
+	while(it != attrs.end())
+	{
+		if(count > 0)
+			virg = ",";
+
+		string strAux = (*it).first.name_;
+		size_t pos = strAux.find(".");
+		if(pos != string::npos)
+			strAux[pos] = '_';
+
+		switch((*it).second)
+		{
+			case TeSUM:
+				sql += virg +" SUM( "+ (*it).first.name_ +") AS SUM_"+ strAux;
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeMAXVALUE:
+				sql += virg +" MAX( "+ (*it).first.name_ +") AS MAX_"+ strAux;
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeMINVALUE:
+				sql += virg +" MIN( "+ (*it).first.name_ +") AS MIN_"+ strAux;
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeCOUNT:
+				sql += virg +" COUNT( "+ (*it).first.name_ +") AS COUNT_"+ strAux;
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeMEAN:
+				sql += virg +" AVG( "+ (*it).first.name_ +") AS AVG_"+ strAux;
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeSTANDARDDEVIATION:
+				sql += virg +" STDDEV( "+ (*it).first.name_ +") AS STDDEV_"+ strAux;
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeVARIANCE:
+				sql += virg +" VARIANCE( "+ (*it).first.name_ +") AS VAR_"+ strAux;
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			default:
+				break;
+		}
+		++it;
+
+	}
+
+	return sql;
+}
+
+string TePostgreSQL::getSQLTemporalWhere(TeTimeInterval& timeInterval, TeTemporalRelation timeOperator, const string& initialTime, const string& finalTime)
+{
+	string sql;
+	
+	string t1 = timeInterval.getInitialDateTime("YYYYsMMsDDsHHsmmsSS");
+	string t2 = timeInterval.getFinalDateTime ("YYYYsMMsDDsHHsmmsSS");
+	
+	switch(timeOperator)
+	{
+		case TeTIMEBEFORE:		sql = finalTime +" < '"+ t1 +"'";
+								break;
+
+		case TeTIMEAFTER:		sql = initialTime +" > '"+ t2 +"'";
+								break;
+
+		case TeTIMEEQUAL:       sql = "("+ initialTime +" >= '"+ t1 +"'";
+								sql += " AND "+ initialTime +" <= '"+ t2 +"')";
+								sql += " AND ";
+								sql += "("+ finalTime +" >= '"+ t1 +"'";
+								sql += " AND "+ finalTime +" <= '"+ t2 +"')";
+								break;
+
+		case TeTIMEMEETS:       sql = finalTime +" = '"+ t1 +"'";
+								sql += " OR "+ initialTime +" = '"+ t2 +"'";
+								break;
+
+		case TeTIMEDURING:		sql = initialTime +" > '"+ t1 +"'";
+								sql += " AND "+ initialTime +" < '"+ t2 +"'";
+								sql += " AND "+ finalTime +" > '"+ t1 +"'";
+								sql += " AND "+ finalTime +" < '"+ t2 +"'";
+								break;
+
+		case TeTIMEOVERLAPS:    sql = "("+ initialTime +" < '"+ t1 +"'";
+								sql += " AND "+ finalTime +" > '"+ t1 +"'";
+								sql += " AND "+ finalTime +" < '"+ t2 +"')";
+								sql += " OR ";
+								sql += "("+ initialTime + " > '"+ t1 +"'";
+								sql += " AND "+ initialTime +" < '"+ t2 +"'";
+								sql += " AND "+ finalTime +" > '"+ t2 +"')";
+								break;
+
+		case TeTIMEENDS:		sql = finalTime +" = '"+ t2 +"'";
+								break;
+
+		case TeTIMESTARTS:		sql = initialTime +" = '"+ t1 +"'";
+								break;
+		case TeTIMEUNDEFINED:	
+				return sql;				
+	}
+
+	return sql; 
+}
+
+string TePostgreSQL::getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, const string& initialTime, const string& finalTime)
+{
+	string func = " EXTRACT(";
+	string sql;
+
+	switch(chr)
+	{
+		case TeSECOND:		func = "second FROM "; 
+							break;
+		
+		case TeMINUTE:		func = "minute FROM ";
+							break;
+		
+		case TeHOUR:        func = "hour FROM ";
+							break;
+		
+		case TeDAY:         func = "day FROM ";
+							break;
+
+		case TeMONTH:		func = "month FROM ";
+							break;
+
+		case TeYEAR:        func = "year FROM ";	
+							break;
+		default:			return "";
+	}
+
+	switch(rel)
+	{
+		case TeTIMEBEFORE:		sql = func + finalTime + ") < " + Te2String(time1);
+								break;
+		
+		case TeTIMEAFTER:		sql = func + initialTime + ") > " + Te2String(time2);
+								break;
+		
+		case TeTIMEEQUAL:		sql  = func + initialTime + ") = " + Te2String(time1);
+								sql += " AND "+ func + finalTime +") = " + Te2String(time2);
+								break;
+
+		case TeTIMEMEETS:		sql  = func + finalTime + ") = " + Te2String(time1);
+								sql += " OR "+ func + initialTime +") = " + Te2String(time2);
+								break;
+
+		case TeTIMEDURING:		sql  = func + initialTime + ") >= " + Te2String(time1);
+								sql += " AND " + func + initialTime + ") <= " + Te2String(time2);
+								sql += " AND " + func + finalTime + ") >= " + Te2String(time1);
+								sql += " AND " + func + finalTime + ") <= " + Te2String(time2);
+								break;
+
+		case TeTIMEOVERLAPS:    sql  =  "("+ func + initialTime + ") <= " + Te2String(time1);
+								sql += " AND " + func + finalTime + ") >= " + Te2String(time1);
+								sql += " AND " + func + finalTime + ") <= " + Te2String(time2) + ")";
+								sql += " OR ";
+								sql += "(" + func + initialTime + ") >= " + Te2String(time1);
+								sql += " AND " + func + initialTime + ") <= " + Te2String(time2);
+								sql += " AND " + func + finalTime + ") >= " + Te2String(time2) +")";
+								break;
+
+		case TeTIMEENDS:		sql = func + finalTime + ") = " + Te2String(time2);
+								break;
+
+		case TeTIMESTARTS:		sql = func + initialTime + ") = " + Te2String(time1);
+								break;
+		case TeTIMEUNDEFINED:	
+				return sql;				
+	}
+	
+	return sql;
+}
+
+string TePostgreSQL::getAutoNumberSQL(const string& table)
+{
+	errorMessage_ = "";
+
+	TePGRecordset rec;
+
+	string sql = "SELECT adsrc FROM pg_class, pg_attrdef  WHERE lower(pg_class.relname) = lower('" + table + "') AND pg_attrdef.adnum = 1 AND pg_class.oid = pg_attrdef.adrelid";
+
+	if(!rec.open(sql, &tepg_connection_))
+		return "";
+
+	if(rec.recordCount() > 0)
+	{
+		return rec.getData(0);
+	}
+	else
+		return "";
+}
+
+string TePostgreSQL::getSQLTime(const TeTime& time) const
+{
+	return "'" + time.getDateTime("YYYYsMMsDDsHHsmmsSS", "-") + "'";
+}
+
+string TePostgreSQL::concatValues(vector<string>& values, const string& unionString)
+{
+	string concat = "";
+	
+	for(unsigned int i = 0; i < values.size(); ++i)
+	{
+		if(i != 0)
+		{
+			concat += " || ";
+
+			if(!unionString.empty())
+			{
+				concat += "'";
+				concat += unionString;
+				concat += "'";
+				concat += " || ";
+			}
+		}
+
+		concat += values[i];
+	}
+
+	return concat;
+}
+
+string TePostgreSQL::toUpper(const string& value)
+{
+	string result  = "upper(";
+	       result += value;
+		   result += ")";
+
+	return result;
+}
+
+string TePostgreSQL::leftString(const string& name, const int& length)
+{
+    string substringClause = "SUBSTRING(" + name+ ", 1, " + Te2String(length) + ")";
+    return substringClause;
+}
+
+bool TePostgreSQL::locateCell(const string& table, TeCoord2D& pt, TeCell& c, const double& tol)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+
+
+	string sql  ="SELECT * FROM ";
+	       sql += table;
+		   sql += " WHERE ";
+		   sql += this->getSQLBoxWhere(box, TeCELLS, table);
+
+	if(!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	portal->fetchGeometry(c);
+
+	delete portal;
+
+	return true;
+}
+
+bool TePostgreSQL::createSpatialIndex(const string& table, const string& column, TeSpatialIndexType /* type */, short /* level */, short /* tile */)
+{
+	string create = "CREATE INDEX sp_idx_gist_" + table + " ON " + table + " USING GIST (" + column + " " + gistBoxOps_ + ")";
+
+	return this->execute(create);
+}
+
+string TePostgreSQL::getSQLBoxWhere(const TeBox& box, const TeGeomRep rep, const std::string& tableName)
+{
+	if(rep == TeTEXT)
+		return TeDatabase::getSQLBoxWhere(box, rep, tableName);
+
+	string colname = "spatial_box";
+
+	if(rep & TeRASTER)
+		colname = "block_box";
+	
+
+	string urx = Te2String(box.x2(), 15);
+	string llx = Te2String(box.x1(), 15);
+	string ury = Te2String(box.y2(), 15);
+	string lly = Te2String(box.y1(), 15);
+
+	string wherebox  = " ( " + colname + " && '(" + urx + ", " + ury + ", " + llx + ", " + lly + ")'::box)";
+
+	return wherebox;
+}
+
+string TePostgreSQL::getSQLBoxWhere(const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1)
+{
+	if((rep1 == TeTEXT) || (rep2 == TeTEXT))
+	{
+		return TeDatabase::getSQLBoxWhere(table1, table2, rep2, rep1);
+	}
+	else
+	{
+		string col1name = "spatial_box";
+		string col2name = "spatial_box";;
+
+		if(rep1 & TeRASTER)
+			col1name = "block_box";
+
+		if(rep2 & TeRASTER)
+			col2name = "block_box";
+
+		string wherebox  = "(";
+		       wherebox += table1;
+               wherebox += "." + col1name + " && ";
+               wherebox += table2;
+               wherebox += "." + col2name + ")";
+
+	   return wherebox;
+	}
+}
+
+string TePostgreSQL::getSQLBoxSelect(const string& tableName, TeGeomRep rep)
+{
+	if(rep == TeTEXT)
+	{
+		return TeDatabase::getSQLBoxSelect(tableName, rep);
+	}
+	else
+	{
+		string colname = "spatial_box";
+
+		if(rep & TeRASTER)
+			colname = "block_box";
+
+		string select  = tableName + ".* , ";
+			   select += "((" + tableName + "." + colname + "[1])[0]) as lower_x, ";
+			   select += "((" + tableName + "." + colname + "[1])[1]) as lower_y, ";
+			   select += "((" + tableName + "." + colname + "[0])[0]) as upper_x, ";
+			   select += "((" + tableName + "." + colname + "[0])[1]) as upper_y ";
+
+		return select;
+	}
+}
+
+bool TePostgreSQL::getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom)
+{		
+	TeDatabasePortal* portal = getPortal();
+
+	if(!portal)
+		return false;
+
+	string sel  = "SELECT MIN(";
+	       sel += "((" + tableGeom + "." + colGeom + "[1])[0])), MIN(";
+           sel += "((" + tableGeom + "." + colGeom + "[1])[1])), MAX(";
+           sel += "((" + tableGeom + "." + colGeom + "[0])[0])), MAX(";
+           sel += "((" + tableGeom + "." + colGeom + "[0])[1])) ";
+           sel += " FROM " + tableGeom;
+           sel += " WHERE object_id = '" + object_id + "'";
+
+	if(!(portal->query(sel)) || !(portal->fetchRow()))
+	{
+		delete portal;
+
+		return false;
+	}
+		
+	double xmin = portal->getDouble(0);
+	double ymin = portal->getDouble(1);
+	double xmax = portal->getDouble(2);
+	double ymax = portal->getDouble(3);
+				
+	TeBox bb(xmin, ymin, xmax, ymax);
+
+	box = bb;
+
+	delete portal;
+
+	return true;
+}
+
+bool TePostgreSQL::getMBRSelectedObjects(string geomTable, string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType, TeBox& bout, const double& tol)
+{
+	if(repType == TeTEXT)
+		return TeDatabase::getMBRSelectedObjects(geomTable, colGeom, fromClause, whereClause, afterWhereClause, repType, bout, tol);
+
+	TeDatabasePortal* portal = getPortal();
+	
+	if (!portal)
+		return false;
+
+	colGeom = "spatial_box";
+
+	if(repType & TeRASTER)
+		colGeom = "block_box";
+
+	string sel  = "SELECT MIN(";
+	       sel += "((" + geomTable + "." + colGeom + "[1])[0])), MIN(";
+           sel += "((" + geomTable + "." + colGeom + "[1])[1])), MAX(";
+           sel += "((" + geomTable + "." + colGeom + "[0])[0])), MAX(";
+           sel += "((" + geomTable + "." + colGeom + "[0])[1])) ";
+           sel += " FROM " + fromClause;
+
+	if(!whereClause.empty())
+		sel += " WHERE " + whereClause;  
+	
+	if(!(portal->query(sel)) || !(portal->fetchRow())) 
+	{
+		delete portal;
+
+		return false;
+	}
+
+	double xmin = portal->getDouble(0);
+	double ymin = portal->getDouble(1);
+	double xmax = portal->getDouble(2);
+	double ymax = portal->getDouble(3);
+
+	TeBox b(xmin, ymin, xmax, ymax);
+
+	bout = b;
+	
+	delete portal;
+
+	return true;
+}
+
+void TePostgreSQL::getInsertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, const int& band, const unsigned int& res, const unsigned int& subband, char* buf, const unsigned long& size, string& sql)
+{
+	sql += "INSERT INTO " + table + " (block_id, block_box, band_id, resolution_factor, subband, spatial_data, block_size) VALUES('";
+	sql += blockId;
+	sql += "', '";
+	sql += PGBoxRtree_encode(TeBox(ll, ur));
+	sql += "', ";
+	sql += Te2String(band);
+	sql += ", ";
+	sql += Te2String(res);
+	sql += ", ";
+	sql += Te2String(subband);
+	sql += ", E'";
+	sql += buf;
+	sql += "', ";
+	sql += Te2String(size);
+	sql += ")";
+
+	return;
+}
+
+void TePostgreSQL::getUpdateRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, const int& band, const unsigned int& res, const unsigned int& subband, char* buf, const unsigned long& size, string& sql)
+{
+	sql += "UPDATE ";
+	sql += table;
+	sql += " SET block_box = '";
+	sql += PGBoxRtree_encode(TeBox(ll, ur));
+	sql += "', band_id = ";
+	sql += Te2String(band);
+	sql += ", resolution_factor = ";
+	sql += Te2String(res);
+	sql += ", subband = ";
+	sql += Te2String(subband);
+	sql += ", spatial_data = E'";
+	//sql += Te2String(static_cast<long>(obj_oid));;
+	sql += buf;
+	sql += "', block_size = ";
+	sql += Te2String(size);
+	sql += " WHERE block_id = '";
+	sql += blockId;
+	sql += "'";
+
+	return;
+}
+
+
+string TePostgreSQL::escapeSequence(const string& from)
+{
+	size_t newLen = 0;
+
+
+	char* aux = TePGConnection::escapeString(from.c_str(), from.length(), newLen);
+
+	string str = aux;
+
+	delete [] aux;
+
+	return str;
+}
+
+string TePostgreSQL::getSpatialIdxColumn(TeGeomRep rep)
+{
+	if(rep == TeRASTER)
+		return "block_box";
+
+	return "spatial_box";
+}
+
+bool TePostgreSQL::beginTransaction()
+{
+	transactionCounter_++;
+
+	if (transactionCounter_ > 1)
+		return true;
+	else
+		return tepg_connection_.beginTransaction();
+}
+
+bool TePostgreSQL::commitTransaction()
+{
+	transactionCounter_--;
+
+	if (transactionCounter_ > 0)
+		return true;
+	else
+		return tepg_connection_.commitTransaction();
+}
+
+bool TePostgreSQL::rollbackTransaction()
+{
+	transactionCounter_--;
+
+	if (transactionCounter_ > 0)
+		return true;
+	else
+		return tepg_connection_.rollBackTransaction();
+}
+
+std::string TePostgreSQL::getClientEncoding()
+{
+	return tepg_connection_.getClientEncoding();
+
+	/*int clientEncodingId = tepg_connection_.getClientEncodingId();
+
+	std::string clientEncoding = "";
+
+	std::string sql = "select pg_encoding_to_char("+Te2String(clientEncodingId)+")";
+
+	TeDatabasePortal* portal = getPortal();
+
+	if(portal->query(sql) && portal->fetchRow())
+	{
+		clientEncoding = portal->getData(0);
+	}
+
+	delete portal;
+	portal =  NULL;
+
+	return clientEncoding;*/
+}
+
+bool TePostgreSQL::setClientEncoding(const std::string& characterSet)
+{
+	std::string sql = "SET CLIENT_ENCODING TO '" + characterSet + "'";
+	return execute(sql);
+}
+
+bool TePostgreSQL::getEncodingList(std::vector<std::string>& vecEncodingList)
+{
+	vecEncodingList.clear();
+
+	std::string sql = "SELECT DISTINCT pg_catalog.pg_encoding_to_char(conforencoding)";
+	sql += " FROM pg_catalog.pg_conversion";
+	sql += " ORDER BY pg_catalog.pg_encoding_to_char(conforencoding)";
+
+	TeDatabasePortal* portal = getPortal();
+
+	bool returnValue = false;
+	if(portal->query(sql))
+	{
+		returnValue = true;
+		while(portal->fetchRow())
+		{
+			vecEncodingList.push_back(portal->getData(0));
+		}
+	}
+
+	delete portal;
+	portal =  NULL;
+
+	return returnValue; 
+}
+
+bool TePostgreSQL::getEncodingList(const std::string& host, const std::string& user, const std::string& password, const int& port, std::vector<std::string>& vecEncodingList)
+{ 
+	if(!connect(host, user, password, "template1", port))
+	{
+		close();
+		return false;
+	}
+
+	bool returnValue = getEncodingList(vecEncodingList);
+
+	close();
+
+	return returnValue; 
+}
+
+bool
+TePostgreSQL::getIndexesFromTable(const string& tableName, std::vector<TeDatabaseIndex>& vecIndexes)
+{
+	
+	std::string query1 = "select t.relname as tabela , u.relname as indice, i.indkey as posicao ";
+		query1 += "from pg_class t, pg_class u, pg_index i ";
+		query1 += "where t.oid = i.indrelid and i.indexrelid = u.oid and " + toUpper("t.relname") + " = "+ toUpper("'" + tableName + "'");
+		query1 += "and indisprimary = 'f'";
+
+
+	TeDatabasePortal* portal = getPortal();
+
+	std::string tabName = "";
+	std::string indName = "";
+	std::string posicao = "";
+	
+	vector<string> indexesNames;
+	vector<string> posicoes;
+	vector<TeDatabaseIndex> indexes;
+
+	if(portal->query(query1))
+	{		
+		while(portal->fetchRow())
+		{
+			tabName = portal->getData("tabela");
+			indName = portal->getData("indice");
+			posicao = portal->getData("posicao");
+			indexesNames.push_back(indName);
+
+			std::vector<std::string> vecParts;
+			TeSplitString(posicao, ",", vecParts);
+
+			for(unsigned int i=0; i < vecParts.size(); ++i)
+			{
+				std::string str = vecParts[i];
+				TeTrim(str);
+
+				std::vector<std::string> vecPartsComposto;
+				TeSplitString(str, " ", vecPartsComposto);
+
+				std::string strComposto = "";
+				for(unsigned int j = 0; j < vecPartsComposto.size(); ++j)
+				{
+					if(!strComposto.empty())
+					{
+						strComposto += ",";
+					}
+					strComposto += vecPartsComposto[j];
+				}
+
+				posicoes.push_back(strComposto.c_str());
+			}
+		}
+	}
+	else
+	{
+		delete portal;
+		return false;
+	}
+		
+
+	portal->freeResult();
+
+	
+	for(unsigned int i=0; i < posicoes.size(); i++)
+	{
+		std::string query2 = "select a.attname as colName from pg_attribute a, pg_class c where a.attrelid = c.oid ";
+		query2 += "and " + toUpper("c.relname") + " = " + toUpper("'" + tabName + "'") + " and a.attnum > 0 ";
+		query2 += "and attnum in(" + posicoes[i] + ")";
+
+		if(portal->query(query2))
+		{
+			
+			vector<string> attributes;
+			while(portal->fetchRow())
+			{
+				attributes.push_back(portal->getData("colName"));
+			}
+
+			TeDatabaseIndex dbi;
+			dbi.setIndexName(indexesNames[i]);
+			dbi.setColumns(attributes);
+			dbi.setIsPrimaryKey(false);
+
+			indexes.push_back(dbi);
+			
+		}
+		else
+		{
+			delete portal;
+			return false;
+		}
+
+		portal->freeResult();
+
+	}
+
+	vecIndexes = indexes;
+
+	delete portal;
+	portal =  NULL;
+
+	return true;
+}
+
+bool 
+TePostgreSQL::getAttributeList(const string& tableName, TeAttributeList& attList)
+{
+//recupera o nome da tabela da forma que ela esta salva no banco. 
+	if (tableName.empty())
+		return false;
+
+	errorMessage_ = "";
+
+	string sql = "SELECT relname FROM pg_class WHERE lower(relname) = lower('" + tableName + "')";
+	TePGRecordset rec;
+	if(!rec.open(sql, &tepg_connection_) || rec.recordCount() == 0)
+	{
+		rec.close();
+		TeDatabase::getAttributeList(tableName, attList);
+		return false;
+	}
+
+	std::string tableNameDB = rec.getData(0);
+
+	rec.close();
+
+//em seguida recupera a lista de atributos
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	sql = "SELECT * FROM \"" + tableNameDB + "\" WHERE 1=2";
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	else
+	{
+		attList = portal->getAttributeList();
+	}
+
+	portal->freeResult();
+	
+//por fim preenchemos as informacoes com relacao as chaves
+	sql = "SELECT ta.attname AS column_name";
+	sql += " FROM pg_class bc, pg_class ic, pg_index i, pg_attribute ta, pg_attribute ia";
+	sql += " WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid AND ia.attrelid = i.indexrelid AND ta.attrelid = bc.oid";
+	sql += " AND " + toUpper("bc.relname") + " = '" + TeConvertToUpperCase(tableName) + "'";
+	sql += " AND ta.attrelid = i.indrelid AND ta.attnum = i.indkey[ia.attnum-1]";
+	sql += " AND  i.indisprimary = 't'";
+	
+	if(!portal->query(sql))
+	{		
+		delete portal;
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+        std::string columnName = portal->getData(0);
+		for(unsigned int i = 0; i < attList.size(); ++i)
+		{
+			if(attList[i].rep_.name_ == columnName)
+			{
+				attList[i].rep_.isPrimaryKey_ = true;
+                break;
+			}
+		}
+	}
+
+	delete portal;
+
+	return true;
+}
+
+//----- TePostgreSQLPortal methods ---
+TePostgreSQLPortal::TePostgreSQLPortal() : con_(0), curRow_(-1)
+{
+}
+
+TePostgreSQLPortal::TePostgreSQLPortal(TeDatabase *pDatabase) : curRow_(-1)
+{
+	db_ = pDatabase;
+	con_ = &((static_cast<TePostgreSQL*>(pDatabase))->tepg_connection_);
+}
+
+TePostgreSQLPortal::~TePostgreSQLPortal()
+{
+	this->freeResult();
+	con_ = 0;
+}
+
+bool TePostgreSQLPortal::query(const string &qry, TeCursorLocation l, TeCursorType t, TeCursorEditType /* e */, TeCursorDataType dt)
+{
+	errorMessage_ = "";
+
+	freeResult();	
+
+	if(!tepg_recordset_.open(qry, con_, t, l, dt))
+		return false;
+
+	numRows_ = tepg_recordset_.recordCount();
+
+	numFields_ = tepg_recordset_.getFieldCount(); 
+
+	attList_.clear ();
+
+	for(int i = 0; i < numFields_; ++i)
+	{
+		TeAttribute attribute;
+
+		Oid nType = tepg_recordset_.fieldType(i);
+
+		switch(nType)
+		{
+			case 16:    //BOOL			
+						attribute.rep_.type_ = TeBOOLEAN;
+						break;
+
+			case 20:    //INT8
+			case 21:    //INT2
+			case 23:    //INT4
+			case 26:    //OID			
+						attribute.rep_.type_ = TeINT;
+						break;
+			case 700 :  //float4  -> float(p)
+			case 701 :  //float8  -> float(p)
+			case 790 :  //money   -> decimal(9, 2)
+			case 1700:  //numeric -> numeric(p, s)
+						attribute.rep_.type_ = TeREAL;
+						break;
+
+			case 1082:	//date -> date
+			case 1083:  //time -> time
+			case 1114:  //timestamp
+			case 1186:  //interval
+			case 1266:	//
+						attribute.rep_.type_ = TeDATETIME;
+						attribute.dateTimeFormat_ = "YYYYsMMsDDsHHsmmsSS24";
+						attribute.dateChronon_ = TeSECOND;
+						attribute.dateSeparator_ = "-";	
+						break;
+
+			//case 26:    //OID
+			case 17:	//bytea
+						attribute.rep_.type_ = TeBLOB;
+						break;
+			case 1042:
+						attribute.rep_.type_ = TeCHARACTER;
+						break;
+
+			case 1043:  //varchar(n)
+			case 25:    //text
+						attribute.rep_.type_ = TeSTRING;
+						break;
+
+			default:
+						attribute.rep_.type_ = TeUNKNOWN;
+						break;
+		}
+
+		attribute.rep_.name_ = tepg_recordset_.fieldName(i);
+		pair<int, int> len(tepg_recordset_.fieldSize(i), tepg_recordset_.fieldSizeFractionaryPart(i));
+		
+		if(nType != 25) //text
+		{
+			attribute.rep_.numChar_ = len.first + len.second;
+		}
+		attList_.push_back(attribute);
+	}
+
+	curRow_ = 0;	
+
+	return true;
+}
+
+bool TePostgreSQLPortal::fetchRow()
+{
+	errorMessage_ = "";
+
+	if(numFields_ <= 0)
+	{
+		errorMessage_ = "The PostgreSQL portal is empty!";
+		return false;
+	}
+
+	if(curRow_ > 0)
+		tepg_recordset_.moveNext();
+
+	if(tepg_recordset_.eof())
+		return false;
+
+	++curRow_;	
+
+	return true;
+}
+
+bool TePostgreSQLPortal::fetchRow(int i)
+{
+	errorMessage_ = "";
+
+	curRow_ = i + 1;
+	return tepg_recordset_.moveTo(curRow_);
+}
+
+void TePostgreSQLPortal::freeResult()
+{
+	tepg_recordset_.close();
+
+	return;
+}
+
+string TePostgreSQLPortal::errorMessage()
+{
+	if(errorMessage_.empty())
+		return con_->err_msg();	
+	else
+		return errorMessage_;
+}
+
+char* TePostgreSQLPortal::getData(int i)
+{
+	errorMessage_ = "";
+	
+	try
+	{
+		return tepg_recordset_.getData(i);
+	}
+
+	catch(...)
+	{
+		return "";
+	}
+
+	return "";
+
+}
+
+char* TePostgreSQLPortal::getData(const string& s)
+{
+	errorMessage_ = "";
+
+	try
+	{
+		return tepg_recordset_.getData(s);
+	}
+
+	catch(...)
+	{
+		return "";
+	}
+
+	return "";
+}
+
+double TePostgreSQLPortal::getDouble(int i)
+{
+	errorMessage_ = "";
+
+	try
+	{
+		return tepg_recordset_.getDouble(i);
+	}
+
+	catch(...)
+	{
+		return 0.0;
+	}
+
+	return 0.0;
+}
+
+double TePostgreSQLPortal::getDouble(const string& s)
+{
+	errorMessage_ = "";
+
+	try
+	{
+		return tepg_recordset_.getDouble(s);
+	}
+
+	catch(...)
+	{
+		return 0.0;
+	}
+
+	return 0.0;
+}
+
+int TePostgreSQLPortal::getInt(int i)
+{
+	errorMessage_ = "";
+
+	try
+	{
+		return tepg_recordset_.getInt(i);
+	}
+
+	catch(...)
+	{
+		return 0;
+	}
+
+	return 0;
+}
+
+int TePostgreSQLPortal::getInt(const string& s)
+{
+	errorMessage_ = "";
+
+	try
+	{
+		return tepg_recordset_.getInt(s);
+	}
+
+	catch(...)
+	{
+		return 0;
+	}
+
+	return 0;
+}
+
+bool TePostgreSQLPortal::getBool(const string& s)
+{
+	errorMessage_ = "";
+
+	try
+	{
+		if(tepg_recordset_.getBool(s))
+			return true;
+		else
+			return false;
+	}
+
+	catch(...)
+	{
+		return false;
+	}
+	
+	return false;
+}
+
+bool TePostgreSQLPortal::getBool(int i)
+{
+	errorMessage_ = "";
+
+	try
+	{
+		if(tepg_recordset_.getInt(i))
+			return true;
+		else
+			return false;
+	}
+
+	catch(...)
+	{
+		return false;
+	}
+
+	return false;
+}
+
+TeTime TePostgreSQLPortal::getDate(int i)
+{
+	string s = getData(i);
+
+	TeTime t(s, TeSECOND, "YYYYsMMsDDsHHsmmsSS", "-"); 
+
+	return t;
+}
+
+TeTime TePostgreSQLPortal::getDate(const string& s)
+{
+	string ss = getData(s);
+
+	TeTime t(ss, TeSECOND, "YYYYsMMsDDsHHsmmsSS", "-"); 
+
+	return t;
+}
+
+string TePostgreSQLPortal::getDateAsString(int i)
+{
+	return getData(i);
+}
+
+string TePostgreSQLPortal::getDateAsString(const string& s)
+{
+	return getData(s);
+}
+
+bool TePostgreSQLPortal::getBlob(const string& s, unsigned char*& data, long& size)
+{
+	errorMessage_ = "";
+
+	data = 0;
+
+	char* ptDataAux = (char*)data;
+
+	unsigned long newLen = tepg_recordset_.getBytea(s, ptDataAux);
+
+	if(newLen > 0)
+	{
+		size = newLen;
+		data = (unsigned char*)ptDataAux;
+		return true;
+	}
+
+	errorMessage_ = "Couldn't read blob! Blob size error!";
+
+	if(data)
+	{
+		delete [] data;
+		data = 0;
+	}
+
+	return false;
+}
+
+bool TePostgreSQLPortal::getRasterBlock(unsigned long& size, unsigned char* ptData)
+{
+	errorMessage_ = "";
+
+	// get the actual length of the compressed data
+	size = tepg_recordset_.getInt("block_size");
+	
+	
+	if(size > 0)
+	{
+		char* ptDataAux = (char*)ptData;
+
+		unsigned long newLen = tepg_recordset_.getBytea("spatial_data", ptDataAux);
+
+		if(newLen == size)
+		{
+			ptData = (unsigned char*)ptDataAux;
+			return true;
+		}
+	}
+
+	return false;
+}
+
+
+bool TePostgreSQLPortal::fetchGeometry(TePolygon& pol)
+{
+	errorMessage_ = "";
+
+	int numberOfHoles;
+
+	TeLinearRing ring = this->getLinearRing(numberOfHoles);
+
+	pol.objectId(ring.objectId());
+	pol.geomId(ring.geomId());
+	pol.add(ring);
+	int parentId = pol.geomId();
+
+	while(fetchRow())
+	{
+		if(this->getInt("parent_id") == parentId)
+		{
+			int dummy;
+
+			TeLinearRing ring = getLinearRing(dummy);
+			pol.add(ring);
+		}
+		else
+			return true;
+	}
+
+	return false;
+}
+
+bool TePostgreSQLPortal::fetchGeometry(TePolygon& pol, const unsigned int& initIndex)
+{
+	errorMessage_ = "";
+
+	int numberOfHoles;
+
+	TeLinearRing ring = this->getLinearRing(numberOfHoles, initIndex);
+
+	pol.objectId(ring.objectId());
+	pol.geomId(ring.geomId());
+	pol.add(ring);
+	int parentId = pol.geomId();
+
+	while(fetchRow())
+	{
+		if(this->getInt(initIndex+4) == parentId)
+		{
+			int dummy;
+
+			TeLinearRing ring = getLinearRing(dummy, initIndex);
+			pol.add(ring);
+		}
+		else
+			return true;
+	}
+
+	return false;
+}
+
+bool TePostgreSQLPortal::fetchGeometry(TeLine2D& line)
+{
+	errorMessage_ = "";
+
+	tepg_recordset_.getPGLine2D("spatial_data", line);
+
+	int geomId = tepg_recordset_.getInt("geom_id");
+
+	string objectId = tepg_recordset_.getData("object_id");
+
+	line.objectId(objectId);
+	
+	line.geomId(geomId);
+
+	return fetchRow();
+}
+
+bool TePostgreSQLPortal::fetchGeometry(TeLine2D& line, const unsigned int& initIndex )
+{
+	errorMessage_ = "";
+
+	tepg_recordset_.getPGLine2D(initIndex+5, line); //spatial_data
+
+	int geomId = tepg_recordset_.getInt(initIndex);
+
+	string objectId = tepg_recordset_.getData(initIndex+1);
+
+	line.objectId(objectId);
+	
+	line.geomId(geomId);
+
+	return fetchRow();
+}
+
+bool TePostgreSQLPortal::fetchGeometry(TeNode& n)
+{
+	errorMessage_ = "";
+	
+	TeCoord2D pt(getDouble("x"), getDouble("y"));
+
+	n.add(pt);
+	n.geomId(atoi(getData("geom_id")));
+	n.objectId(string(getData("object_id")));
+
+	return fetchRow();
+}
+
+bool TePostgreSQLPortal::fetchGeometry(TeNode& n, const unsigned int& initIndex)
+{
+	errorMessage_ = "";
+	
+	TeCoord2D pt(getDouble(initIndex+3), getDouble(initIndex+4)); 
+
+	n.add(pt);
+	n.geomId(atoi(getData(initIndex)));
+	n.objectId(string(getData(initIndex+1)));
+
+	return fetchRow();
+}
+
+bool TePostgreSQLPortal::fetchGeometry(TePoint& p)
+{
+	errorMessage_ = "";
+
+	TeCoord2D c(getDouble("x"), getDouble("y"));
+	p.add(c);
+	p.geomId(atoi(getData("geom_id")));
+	p.objectId(string(getData("object_id")));
+	
+	return fetchRow();
+}
+
+bool TePostgreSQLPortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
+{
+	errorMessage_ = "";
+
+	TeCoord2D c(getDouble(initIndex+3), getDouble(initIndex+4));
+	p.add(c);
+	p.geomId(atoi(getData(initIndex)));
+	p.objectId(string(getData(initIndex+1)));
+	
+	return fetchRow();
+}
+
+TeLinearRing TePostgreSQLPortal::getLinearRing(int& numberOfHoles)
+{
+	int geomId = tepg_recordset_.getInt("geom_id");
+	string objectId = tepg_recordset_.getData("object_id");
+
+	numberOfHoles = tepg_recordset_.getInt("num_holes");	
+
+	TeLine2D line;
+
+	tepg_recordset_.getPGLine2D("spatial_data", line);
+
+	TeLinearRing ring = line;
+
+	ring.objectId(objectId);
+	
+	ring.geomId(geomId);
+
+	return ring;
+}
+
+TeLinearRing TePostgreSQLPortal::getLinearRing(int& numberOfHoles, const unsigned int& initIndex)
+{
+	int geomId = tepg_recordset_.getInt(initIndex);
+	string objectId = tepg_recordset_.getData(initIndex+1);
+
+	numberOfHoles = tepg_recordset_.getInt(initIndex+3);	
+
+	TeLine2D line;
+
+	tepg_recordset_.getPGLine2D(initIndex+7, line); //spatial_data
+
+	TeLinearRing ring = line;
+
+	ring.objectId(objectId);
+	
+	ring.geomId(geomId);
+
+	return ring;
+}
+
+string TePostgreSQLPortal::escapeSequence(const string& from)
+{
+	size_t newLen = 0;
+
+	char* aux = TePGConnection::escapeString(from.c_str(), from.length(), newLen);
+
+	string str = aux;
+
+	delete [] aux;
+
+	return str;
+}
+
+bool TePostgreSQLPortal::fetchGeometry(TeCell& cell)
+{
+	errorMessage_ = "";
+
+	TeBox b;
+	tepg_recordset_.getPGBox("spatial_box", b);
+
+	cell.geomId(tepg_recordset_.getInt("geom_id"));
+	cell.objectId(tepg_recordset_.getData("object_id"));
+	cell.setBox (b);
+	cell.column(tepg_recordset_.getInt("col_number"));
+	cell.line(tepg_recordset_.getInt("row_number"));
+
+	return fetchRow();
+}
+
+bool TePostgreSQLPortal::fetchGeometry(TeCell& cell, const unsigned int& initIndex)
+{
+	errorMessage_ = "";
+
+	TeBox b;
+	tepg_recordset_.getPGBox(initIndex+2, b);
+
+	cell.geomId(tepg_recordset_.getInt(initIndex));
+	cell.objectId(tepg_recordset_.getData(initIndex+1));
+	cell.setBox (b);
+	cell.column(tepg_recordset_.getInt(initIndex+3));
+	cell.line(tepg_recordset_.getInt(initIndex+4));
+
+	return fetchRow();
+}
+
diff --git a/src/terralib/drivers/PostgreSQL/TePostgreSQL.h b/src/terralib/drivers/PostgreSQL/TePostgreSQL.h
old mode 100755
new mode 100644
index 95c2d0e..b6ca4f8
--- a/src/terralib/drivers/PostgreSQL/TePostgreSQL.h
+++ b/src/terralib/drivers/PostgreSQL/TePostgreSQL.h
@@ -1,457 +1,480 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*!
- \file TePostgreSQL.h
- \brief This file contains the especifics routines of PostgreSQL.
-*/
-
-/*
- * TODO: 01. Implementar o alterTable que nao pode simplesmente alterar o tipo da coluna
- *		 02. No metodo query do portal, determinar os campos que fazem parte da chave primaria
- *
- */
-
-#ifndef  __TERRALIB_INTERNAL_POSTGRESQL_H
-#define  __TERRALIB_INTERNAL_POSTGRESQL_H
-
-#include "TeDatabase.h"
-#include "TePGInterface.h"
-#include <TeDatabaseFactory.h>
-
-
-class TePostgreSQLPortal;
-
-//! PostgreSQL database access class.
-/*!
-	This class contains the implementation of common methods for TerraLib access PostgreSQL.   
-	\note MAKE SURE you have UPGRADE your PostgreSQL database before use this driver.
-    If you need to upgrade without use TerraView, please look at 
-    TeUpdateDBVersion.cpp for the routines: updateDB302To310 and PostgreSQLUpdateDB302To310,
-    for a tip on how to upgrade by yourself.
-    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>    
-
- */	
-class TePostgreSQL : public TeDatabase
-{
-	friend class TePostgreSQLPortal;
-
-	public:
-		
-		//! Constructor
-		TePostgreSQL();
-
-		//! Destructor
-		virtual ~TePostgreSQL();
-
-		//! Returns the error message from the server
-		string errorMessage();
-
-		//! Creates a new database based on "template1" and open a connection to the new one
-		virtual bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port = -1, bool terralibModel=true);
-
-		//! Opens a conection to a database server
-		virtual bool connect(const string& host, const string& user, const string& password, const string& database, int port = -1);
-
-		//! Show the server databases (only for MySQL, Oracle and PostgreSQL)
-		virtual bool showDatabases(const string& host, const string& user, const string& password, vector<string>& dbNames, int port = -1);
-
-		//! Closes the conection
-		void close(void);
-
-		bool listTables(vector<string>& tableList);
-
-		//! Verifies if a table exist
-		bool tableExist(const string& table);
-
-		//! Verifies if a table has a column
-	    bool columnExist(const string& table, const string& column, TeAttribute& attr);
-
-		//! Creates a generic table
-		virtual bool createTable(const string& table, TeAttributeList &attr);
-
-		//! Adds an attribute field
-		virtual bool addColumn(const string& table, TeAttributeRep &rep);
-
-		//! Creates a reationship between two tables
-		bool createRelation(const string& relName, const string& table, const string& fieldName, const string& relatedTable, const string& relatedField, bool cascadeDeletion);
-
-		//! Checks if a relation exist
-		TeDBRelationType existRelation(const string& tableName, const string& relName);
-
-		//! Executes a SQL command that doesnt return a record set tipically a data definition comand
-		bool execute(const string &sql);
-
-		//! Returns a portal associated to this database
-		virtual TeDatabasePortal* getPortal();
-
-		//! Saves a table and its contents in the database
-		bool insertTable(TeTable &table);
-
-		//! Updates a table and its contents in the database
-		bool updateTable	(TeTable &table);
-		
-		//! Inserts information about a link to an external table
-		bool insertRelationInfo(const int tableId, const string& tField, const string& rTable, const string& rField, int& relId);
-
-		//! Insert information about a table related to a layer
-	    bool insertTableInfo(int layerId, TeTable& table, const string& user = "");
-
-		//! Alter a property of a table 
-		bool alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName="");
-
-		//! Alter a table name
-		bool alterTable(const string& oldTableName, const string& newTableName);
-
-	    //! Saves a large binary objects (BLOB) in a row table 
-	   	bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size);
-		
-		//! Insert information about a geographical projection
-		bool insertProjection(TeProjection *proj);
-
-		//! Insert information about a layer
-		bool insertLayer(TeLayer *layer);
-
-		//! Insert information about a project
-		bool insertProject(TeProject *proj);
-
-		//! Insert information about a geometrical representation
-		bool insertRepresentation(int layerId, TeRepresentation& rep);
-
-		//! Inserts information about a view
-		bool insertView(TeView *view);
-
-		//! Inserts view tree information
-		bool insertViewTree(TeViewTree *tree);
-
-		//! Inserts a theme group
-		bool insertThemeGroup(TeViewTree* tree);
-
-		//! Inserts theme information
-		bool insertTheme(TeAbstractTheme *theme);
-
-		//! Inserts information about a table used by a theme 
-		bool insertThemeTable(int themeId, int tableId, int relationId, int tableOrder);
-
-		//! Generate the label position (x,y) to each object of a theme
-		virtual bool generateLabelPositions(TeTheme *theme, const std::string& objectId = "");
-
-		//! Inserts legend information
-		bool insertLegend(TeLegendEntry *legend);		
-
-		//! Returns all polygons inside a given box
-		virtual bool loadPolygonSet(const string& table, TeBox& box, TePolygonSet& ps);
-
-		//! Returns a database portal to iterate over the polygons that are inside a given box
-		virtual TeDatabasePortal* loadPolygonSet(const string& table, TeBox& box);
-
-		//! Returns the first polygon that contais a given coordinate
-	    virtual bool locatePolygon(const string& table, TeCoord2D& pt, TePolygon& polygon, const double& tol = 0.0);		
-
-		//! Returns the polygons that contains a give coordinate
-		virtual bool locatePolygonSet  (const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons);
-
-		//! Inserts a polygon
-		virtual bool insertPolygon(const string& table, TePolygon& p);
-
-		//! Updates a polygon
-		virtual bool updatePolygon(const string& table, TePolygon& p);
-
-		virtual bool loadLineSet(const string& table, TeBox& box, TeLineSet& linSet);
-
-		virtual TeDatabasePortal* loadLineSet(const string& table, TeBox& box);
-
-		//! Inserts a line
-		virtual bool insertLine(const string& table, TeLine2D& l);
-
-		//! Updates a line
-		virtual bool updateLine(const string& table, TeLine2D& l);
-
-		//! Locates a line
-		virtual bool locateLine(const string& table, TeCoord2D& pt, TeLine2D& line, const double& tol = 0.0);
-
-		//! Inserts a point
-		virtual bool insertPoint(const string& table, TePoint& p);
-
-		virtual bool updatePoint(const string& table, TePoint& p);
-
-		//! Locates a point
-		virtual bool locatePoint(const string& table, TeCoord2D& pt, TePoint& point, const double& tol = 0.0);
-
-		//! Inserts text
-		bool insertText(const string& table, TeText& t);
-
-		//! Inserts an arc
-		bool insertArc(const string& table,TeArc& arc);
-
-		//! Inserts a node
-		virtual bool insertNode(const string& table, TeNode& node);
-		virtual bool updateNode(const string& table, TeNode &node);
-
-		//! Inserts a cell
-		virtual bool insertCell(const string& table, TeCell& c);
-		virtual bool updateCell(const string& table, TeCell &c);
-
-		// Locates a cell
-		virtual bool locateCell(const string& table, TeCoord2D& pt, TeCell& c, const double& tol = 0.0);
-
-		//! Insert a raster block into the database
-		virtual bool insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char* buf,unsigned long size, int band = 0, unsigned int res = 1, unsigned int subband = 0);
-
-		//! Return a string SQL to calculate the statistics to each cell through database functions 
-		string getSQLStatistics(TeGroupingAttr& attrs);
-
-		//! Return a string SQL to temporal where 
-		string getSQLTemporalWhere(TeTimeInterval& timeInterval, TeTemporalRelation timeOperator, const string& initialTime, const string& finalTime);
-
-		//! Return a string SQL to temporal where
-		string getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, const string& initialTime, const string& finalTime);
-
-		//! Return the database function to generate autonumber values
-		string getAutoNumberSQL(const string& table);
-
-		//! Decodes a time structure into a time string that PostgreSQL can understand
-		string getSQLTime(TeTime& t);
-
-		//! Concat values in a vector using unionString as the join between each value
-	    string concatValues(vector<string>& values, const string& unionString);
-
-	    //! Returns the SQL function for upper case
-	    string toUpper(const string& value);
-
-		//! Returns the SQL function for substring that starts from left to right with informed length.
-        string leftString(const string& name, const int& length);
-
-		//! Creates a spatial index on column table
-		virtual bool createSpatialIndex(const string& table, const string& column, TeSpatialIndexType type = TeRTREE, short level = 0, short tile = 0);
-
-		//! Return a string that describes a where clause to return the geometries inside the box
-		virtual string getSQLBoxWhere(TeBox &box, TeGeomRep rep);
-
-		//! Returns a string that describes a where clause to return the geometries of the table2 that are inside the geometries box of the table1
-		virtual string getSQLBoxWhere(const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1 = TePOLYGONS);
-
-		//! Return a string SQL to be used in the clause SELECT to select the box (lower_x, lower_y, upper_x, upper_y)
-		virtual string getSQLBoxSelect(const string& tableName, TeGeomRep rep);
-
-		//! Returns the box of a specific geometry (object_id)  
-		virtual bool getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom);
-
-		//! Return the box of a select objects set 
-		virtual bool getMBRSelectedObjects(string geomTable, string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType, TeBox& bout, const double& tol = 0.0);
-
-		//! Returns the name of the column that wiil be the spatially indexed, for a given type of geometry table 
-		virtual string getSpatialIdxColumn(TeGeomRep rep);
-
-		//! Begins a transaction
-		bool beginTransaction(); 
-
-		//! Commits a transaction
-		bool commitTransaction();
-
-		//! Rollbacks a transaction
-		bool rollbackTransaction();
-
-	protected:
-
-		//! Returns a string with insert of a raster block
-		virtual void getInsertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, const int& band, const unsigned int& res, const unsigned int& subband, char* buf, const unsigned long& size, string& sql);
-
-		//! Returns a string with update of a raster block
-		virtual void getUpdateRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, const int& band, const unsigned int& res, const unsigned int& subband, char* buf, const unsigned long& size, string& sql);
-		
-		//! Escape special characters in a string to be used in a SQL statement
-		string escapeSequence(const string& from);
-
-		//! Opens a conection to a database server
-		bool realConnect(const string& host, const string& user, const string& password, const string& database, int port = -1);
-
-		//! Connection to a PostgreSQL server
-		TePGConnection tepg_connection_;
-
-		//! Choose GIST OPERATOR beteween PostgreSQL 8.0 and 8.1
-		string gistBoxOps_;
-
-		//! Keeps the number of opened transactions
-		int transactionCounter_;
-
-};
-
-
-//! PostgreSQL data navigation functionalities.
-/*!
-	This class contains the implementation of common methods for TerraLib navigate throw data.    
- */	
-class TePostgreSQLPortal : public TeDatabasePortal
-{
-	public:
-
-		//! Constructor
-		TePostgreSQLPortal();
-
-		//! Constructor
-		TePostgreSQLPortal(TeDatabase *pDatabase);
-		
-		//! Virtual Destructor
-		virtual ~TePostgreSQLPortal();
-
-		//! Executes a SQL query that opens a record set
-		virtual bool query(const string &qry, TeCursorLocation l = TeSERVERSIDE, TeCursorType t = TeUNIDIRECTIONAL, TeCursorEditType e = TeREADONLY, TeCursorDataType dt = TeTEXTCURSOR);
-
-		//! Fetchs the next row in a record set that shouldve been previously opened
-		bool fetchRow();
-
-		//! Fetchs a particular row
-		bool fetchRow(int i);
-
-		//! Frees the current record set
-		void freeResult();
-
-		//! Gets the last error message
-		string errorMessage();
-
-		//! Gets the value of the i-th attribute as a literal
-		char* getData(int i);
-
-		//! Gets the value of a named attribute as a literal
-		char* getData(const string& s);
-
-		//! Gets the value of the i-th attribute a double
-		double getDouble(int i);
-
-		//! Gets the value of a named attribute as a double
-		double getDouble(const string& s);
-
-		//! Gets the value of the i-th attribute as an integer
-		int	getInt(int i);
-
-		//! Gets the value of a named attribute as an integer
-		int	getInt(const string& s);
-
-		//! Gets the value of a named attribute as a boolean
-		bool getBool(const string& s);
-
-		//! Gets the value of the i-th attribute as a boolean
-		bool getBool(int i);
-
-		//! Gets the value of the i-th attribute as a date 
-	    TeTime getDate(int i);
-
-	    //! Gets the value of a named attribute as a date 
-	    TeTime getDate(const string& s);
-
-		//! Gets the of a date/time attribute as a string formatted as accepted in further SQL statements
-		string getDateAsString(int i);
-
-		//! Gets the of a date/time attribute as a string formatted as accepted in further SQL statements
-		string getDateAsString(const string& s);
-
-		//! Gets the value of a named BLOB attribute 
-		bool getBlob(const string& s, unsigned char*& data, long& size);
-
-		virtual bool getRasterBlock(unsigned long& size, unsigned char* ptData);
-
-		virtual bool fetchGeometry(TePolygon& pol);
-		virtual bool fetchGeometry(TeLine2D& line);
-		virtual bool fetchGeometry(TeNode& n);
-		virtual bool fetchGeometry(TePoint& p);
-		virtual	bool fetchGeometry (TeCell& cell);
-		virtual bool fetchGeometry(TePolygon& pol, const unsigned int& initIndex);
-		virtual bool fetchGeometry(TeLine2D& line, const unsigned int& initIndex);
-		virtual bool fetchGeometry(TeNode& n, const unsigned int& initIndex);
-		virtual bool fetchGeometry(TePoint& p, const unsigned int& initIndex);
-		virtual	bool fetchGeometry (TeCell& cell, const unsigned int& initIndex);
-
-
-	protected:
-
-		//! Return a linear ring and the number of holes in case of external ring
-		TeLinearRing getLinearRing(int& numberOfHoles);
-
-		//! Return a linear ring that begins in the portal i-th position and the number of holes in case of external ring
-		TeLinearRing getLinearRing(int& numberOfHoles, const unsigned int& i);
-
-		//! Escape special characters in a string to be used in a SQL statement
-		string escapeSequence(const string& from);
-
-		// Protected data members
-		TePGConnection *con_;
-		TePGRecordset tepg_recordset_;
-
-		long curRow_;		
-
-};
-
-
-/**
- * @brief This is the class for TePostgreSQL driver factory.
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- * @ingroup DatabaseUtils
- */
-class TePostgreSQLFactory : public TeDatabaseFactory
-{
-  public :
-      
-    /**
-     * Default constructor
-     */
-    TePostgreSQLFactory() : TeDatabaseFactory( 
-      std::string( "PostgreSQL" ) ) {};      
-      
-    /**
-     * Default Destructor
-     */
-    ~TePostgreSQLFactory() {};
-      
-  protected :  
-  
-    /**
-     * Implementation for the abstract TeFactory::build.
-     *
-     * @param arg A const reference to the parameters used by the
-     * database.
-     * @return A pointer to the new generated database instance.
-     */
-    TeDatabase* build( const TeDatabaseFactoryParams& arg )
-    {
-      TePostgreSQL* instance_ptr = new TePostgreSQL();
-      
-      if( arg.host_ != "" ) {
-        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
-          arg.database_, arg.port_ );
-      }
-  
-      return (TeDatabase*)instance_ptr;
-    }
-};
-
-namespace {
-  static TePostgreSQLFactory TePostgreSQLFactory_instance;
-}; 
-
-#endif	// __TERRALIB_INTERNAL_TePOSTGRESQL_H
-
-/*
- *  Updates:
- *      - 2007/03/26: Mario Rocco Added new method - string leftString(const string& name, const int& length);
- */
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*!
+ \file TePostgreSQL.h
+ \brief This file contains the especifics routines of PostgreSQL.
+*/
+
+/*
+ * TODO: 01. Implementar o alterTable que nao pode simplesmente alterar o tipo da coluna
+ *		 02. No metodo query do portal, determinar os campos que fazem parte da chave primaria
+ *
+ */
+
+#ifndef  __TERRALIB_INTERNAL_POSTGRESQL_H
+#define  __TERRALIB_INTERNAL_POSTGRESQL_H
+
+#include "TeDatabase.h"
+#include "TePGInterface.h"
+#include <TeDatabaseFactory.h>
+
+class TePostgreSQLPortal;
+
+//! PostgreSQL database access class.
+/*!
+	This class contains the implementation of common methods for TerraLib access PostgreSQL.   //
+	\note MAKE SURE you have UPGRADE your PostgreSQL database before use this driver.
+    If you need to upgrade without use TerraView, please look at 
+    TeUpdateDBVersion.cpp for the routines: updateDB302To310 and PostgreSQLUpdateDB302To310,
+    for a tip on how to upgrade by yourself.
+    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>    
+
+ */	
+class TLPOSTGRESQL_DLL TePostgreSQL : public TeDatabase
+{
+	friend class TePostgreSQLPortal;
+
+	public:
+		
+		//! Constructor
+		TePostgreSQL();
+
+		//! Destructor
+		virtual ~TePostgreSQL();
+
+		//! Returns the error message from the server
+		string errorMessage();
+
+		//! Creates a new database based on "template1" and open a connection to the new one
+		virtual bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port = -1, bool terralibModel=true, const std::string& characterSet = "");
+
+		//! Opens a conection to a database server
+		virtual bool connect(const string& host, const string& user, const string& password, const string& database, int port = -1);
+
+		virtual bool connect(PGconn* conn);
+
+		//! Show the server databases (only for MySQL, Oracle and PostgreSQL)
+		virtual bool showDatabases(const string& host, const string& user, const string& password, vector<string>& dbNames, int port = -1);
+
+		//! Closes the conection
+		void close(void);
+
+		bool listTables(vector<string>& tableList);
+
+		//! Verifies if a table exist
+		bool tableExist(const string& table);
+
+		//! Deletes a table. Do not allow the deletion of model tables
+		virtual bool deleteTable (const string& table);
+
+		//! Verifies if a table has a column
+	    bool columnExist(const string& table, const string& column, TeAttribute& attr);
+
+		//! Creates a generic table
+		virtual bool createTable(const string& table, TeAttributeList &attr);
+
+		//! Adds an attribute field
+		virtual bool addColumn(const string& table, TeAttributeRep &rep);
+
+		//! Creates a reationship between two tables
+		bool createRelation(const string& relName, const string& table, const string& fieldName, const string& relatedTable, const string& relatedField, bool cascadeDeletion);
+
+		//! Checks if a relation exist
+		TeDBRelationType existRelation(const string& tableName, const string& relName);
+
+		//! Executes a SQL command that doesnt return a record set tipically a data definition comand
+		bool execute(const string &sql);
+
+		//! Returns a portal associated to this database
+		virtual TeDatabasePortal* getPortal();
+
+		//! Saves a table and its contents in the database
+		bool insertTable(TeTable &table);
+
+		//! Updates a table and its contents in the database
+		bool updateTable	(TeTable &table);
+		
+		//! Inserts information about a link to an external table
+		bool insertRelationInfo(const int tableId, const string& tField, const string& rTable, const string& rField, int& relId);
+
+		//! Insert information about a table related to a layer
+	    bool insertTableInfo(int layerId, TeTable& table, const string& user = "");
+
+		//! Alter a property of a table 
+		bool alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName="");
+
+		//! Alter a table name
+		bool alterTable(const string& oldTableName, const string& newTableName);
+
+	    //! Saves a large binary objects (BLOB) in a row table 
+	   	bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size);
+		
+		//! Insert information about a geographical projection
+		bool insertProjection(TeProjection *proj);
+
+		//! Insert information about a layer
+		bool insertLayer(TeLayer *layer);
+
+		//! Insert information about a project
+		bool insertProject(TeProject *proj);
+
+		//! Insert information about a geometrical representation
+		bool insertRepresentation(int layerId, TeRepresentation& rep);
+
+		//! Inserts information about a view
+		bool insertView(TeView *view);
+
+		//! Inserts view tree information
+		bool insertViewTree(TeViewTree *tree);
+
+		//! Inserts a theme group
+		bool insertThemeGroup(TeViewTree* tree);
+
+		//! Inserts theme information
+		bool insertTheme(TeAbstractTheme *theme);
+
+		//! Inserts information about a table used by a theme 
+		bool insertThemeTable(int themeId, int tableId, int relationId, int tableOrder);
+
+		//! Generate the label position (x,y) to each object of a theme
+		virtual bool generateLabelPositions(TeTheme *theme, const std::string& objectId = "");
+
+		//! Inserts legend information
+		bool insertLegend(TeLegendEntry *legend);		
+
+		//! Returns all polygons inside a given box
+		virtual bool loadPolygonSet(const string& table, TeBox& box, TePolygonSet& ps);
+
+		//! Returns a database portal to iterate over the polygons that are inside a given box
+		virtual TeDatabasePortal* loadPolygonSet(const string& table, TeBox& box);
+
+		//! Returns the first polygon that contais a given coordinate
+	    virtual bool locatePolygon(const string& table, TeCoord2D& pt, TePolygon& polygon, const double& tol = 0.0);		
+
+		//! Returns the polygons that contains a give coordinate
+		virtual bool locatePolygonSet  (const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons);
+
+		//! Inserts a polygon
+		virtual bool insertPolygon(const string& table, TePolygon& p);
+
+		//! Updates a polygon
+		virtual bool updatePolygon(const string& table, TePolygon& p);
+
+		virtual bool loadLineSet(const string& table, TeBox& box, TeLineSet& linSet);
+
+		virtual TeDatabasePortal* loadLineSet(const string& table, TeBox& box);
+
+		//! Inserts a line
+		virtual bool insertLine(const string& table, TeLine2D& l);
+
+		//! Updates a line
+		virtual bool updateLine(const string& table, TeLine2D& l);
+
+		//! Locates a line
+		virtual bool locateLine(const string& table, TeCoord2D& pt, TeLine2D& line, const double& tol = 0.0);
+
+		//! Inserts a point
+		virtual bool insertPoint(const string& table, TePoint& p);
+
+		virtual bool updatePoint(const string& table, TePoint& p);
+
+		//! Locates a point
+		virtual bool locatePoint(const string& table, TeCoord2D& pt, TePoint& point, const double& tol = 0.0);
+
+		//! Inserts text
+		bool insertText(const string& table, TeText& t);
+
+		//! Inserts an arc
+		bool insertArc(const string& table,TeArc& arc);
+
+		//! Inserts a node
+		virtual bool insertNode(const string& table, TeNode& node);
+		virtual bool updateNode(const string& table, TeNode &node);
+
+		//! Inserts a cell
+		virtual bool insertCell(const string& table, TeCell& c);
+		virtual bool updateCell(const string& table, TeCell &c);
+
+		// Locates a cell
+		virtual bool locateCell(const string& table, TeCoord2D& pt, TeCell& c, const double& tol = 0.0);
+
+		//! Insert a raster block into the database
+		virtual bool insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char* buf,unsigned long size, int band = 0, unsigned int res = 1, unsigned int subband = 0);
+
+		//! Return a string SQL to calculate the statistics to each cell through database functions 
+		string getSQLStatistics(TeGroupingAttr& attrs);
+
+		//! Return a string SQL to temporal where 
+		string getSQLTemporalWhere(TeTimeInterval& timeInterval, TeTemporalRelation timeOperator, const string& initialTime, const string& finalTime);
+
+		//! Return a string SQL to temporal where
+		string getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, const string& initialTime, const string& finalTime);
+
+		//! Return the database function to generate autonumber values
+		string getAutoNumberSQL(const string& table);
+
+		//! Decodes a time structure into a time string that PostgreSQL can understand
+		string getSQLTime(const TeTime& t) const;
+
+		//! Concat values in a vector using unionString as the join between each value
+	    string concatValues(vector<string>& values, const string& unionString);
+
+	    //! Returns the SQL function for upper case
+	    string toUpper(const string& value);
+
+		//! Returns the SQL function for substring that starts from left to right with informed length.
+        string leftString(const string& name, const int& length);
+
+		//! Creates a spatial index on column table
+		virtual bool createSpatialIndex(const string& table, const string& column, TeSpatialIndexType type = TeRTREE, short level = 0, short tile = 0);
+
+		//! Return a string that describes a where clause to return the geometries inside the box
+		virtual string getSQLBoxWhere(const TeBox& box, const TeGeomRep rep, const std::string& tableName);
+
+		//! Returns a string that describes a where clause to return the geometries of the table2 that are inside the geometries box of the table1
+		virtual string getSQLBoxWhere(const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1 = TePOLYGONS);
+
+		//! Return a string SQL to be used in the clause SELECT to select the box (lower_x, lower_y, upper_x, upper_y)
+		virtual string getSQLBoxSelect(const string& tableName, TeGeomRep rep);
+
+		//! Returns the box of a specific geometry (object_id)  
+		virtual bool getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom);
+
+		//! Return the box of a select objects set 
+		virtual bool getMBRSelectedObjects(string geomTable, string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType, TeBox& bout, const double& tol = 0.0);
+
+		//! Returns the name of the column that wiil be the spatially indexed, for a given type of geometry table 
+		virtual string getSpatialIdxColumn(TeGeomRep rep);
+
+		//! Begins a transaction
+		bool beginTransaction(); 
+
+		//! Commits a transaction
+		bool commitTransaction();
+
+		//! Rollbacks a transaction
+		bool rollbackTransaction();
+
+		//! Gets the client encoding
+		virtual std::string getClientEncoding();
+
+		//! Sets the client encoding
+		virtual bool setClientEncoding(const std::string& characterSet);
+
+		//! Retrives the list of available character sets
+		virtual bool getEncodingList(std::vector<std::string>& vecEncodingList);
+		 
+		//! Retrives the list of available character sets
+		virtual bool getEncodingList(const std::string& host, const std::string& user, const std::string& password, const int& port, std::vector<std::string>& vecEncodingList);
+
+		//! Return a TeDatabaseIndex vector from a table
+		virtual bool getIndexesFromTable(const string& tableName, std::vector<TeDatabaseIndex>& vecIndexes);
+
+		//! Gets the list of attributes of a table
+		virtual bool getAttributeList(const string& tableName,TeAttributeList& attList);
+
+	protected:
+
+		//! Returns a string with insert of a raster block
+		virtual void getInsertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, const int& band, const unsigned int& res, const unsigned int& subband, char* buf, const unsigned long& size, string& sql);
+
+		//! Returns a string with update of a raster block
+		virtual void getUpdateRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, const int& band, const unsigned int& res, const unsigned int& subband, char* buf, const unsigned long& size, string& sql);
+		
+		//! Escape special characters in a string to be used in a SQL statement
+		string escapeSequence(const string& from);
+		
+
+		//! Opens a conection to a database server
+		bool realConnect(const string& host, const string& user, const string& password, const string& database, int port = -1);
+
+		//! Connection to a PostgreSQL server
+		TePGConnection tepg_connection_;
+
+		//! Choose GIST OPERATOR beteween PostgreSQL 8.0 and 8.1
+		string gistBoxOps_;
+
+		//! Keeps the number of opened transactions
+		int transactionCounter_;
+
+};
+
+
+//! PostgreSQL data navigation functionalities.
+/*!
+	This class contains the implementation of common methods for TerraLib navigate throw data.    
+ */	
+class TLPOSTGRESQL_DLL TePostgreSQLPortal : public TeDatabasePortal
+{
+	public:
+
+		//! Constructor
+		TePostgreSQLPortal();
+
+		//! Constructor
+		TePostgreSQLPortal(TeDatabase *pDatabase);
+		
+		//! Virtual Destructor
+		virtual ~TePostgreSQLPortal();
+
+		//! Executes a SQL query that opens a record set
+		virtual bool query(const string &qry, TeCursorLocation l = TeSERVERSIDE, TeCursorType t = TeUNIDIRECTIONAL, TeCursorEditType e = TeREADONLY, TeCursorDataType dt = TeTEXTCURSOR);
+
+		//! Fetchs the next row in a record set that shouldve been previously opened
+		bool fetchRow();
+
+		//! Fetchs a particular row
+		bool fetchRow(int i);
+
+		//! Frees the current record set
+		void freeResult();
+
+		//! Gets the last error message
+		string errorMessage();
+
+		//! Gets the value of the i-th attribute as a literal
+		char* getData(int i);
+
+		//! Gets the value of a named attribute as a literal
+		char* getData(const string& s);
+
+		//! Gets the value of the i-th attribute a double
+		double getDouble(int i);
+
+		//! Gets the value of a named attribute as a double
+		double getDouble(const string& s);
+
+		//! Gets the value of the i-th attribute as an integer
+		int	getInt(int i);
+
+		//! Gets the value of a named attribute as an integer
+		int	getInt(const string& s);
+
+		//! Gets the value of a named attribute as a boolean
+		bool getBool(const string& s);
+
+		//! Gets the value of the i-th attribute as a boolean
+		bool getBool(int i);
+
+		//! Gets the value of the i-th attribute as a date 
+	    TeTime getDate(int i);
+
+	    //! Gets the value of a named attribute as a date 
+	    TeTime getDate(const string& s);
+
+		//! Gets the of a date/time attribute as a string formatted as accepted in further SQL statements
+		string getDateAsString(int i);
+
+		//! Gets the of a date/time attribute as a string formatted as accepted in further SQL statements
+		string getDateAsString(const string& s);
+
+		//! Gets the value of a named BLOB attribute 
+		bool getBlob(const string& s, unsigned char*& data, long& size);
+
+		virtual bool getRasterBlock(unsigned long& size, unsigned char* ptData);
+
+		virtual bool fetchGeometry(TePolygon& pol);
+		virtual bool fetchGeometry(TeLine2D& line);
+		virtual bool fetchGeometry(TeNode& n);
+		virtual bool fetchGeometry(TePoint& p);
+		virtual	bool fetchGeometry (TeCell& cell);
+		virtual bool fetchGeometry(TePolygon& pol, const unsigned int& initIndex);
+		virtual bool fetchGeometry(TeLine2D& line, const unsigned int& initIndex);
+		virtual bool fetchGeometry(TeNode& n, const unsigned int& initIndex);
+		virtual bool fetchGeometry(TePoint& p, const unsigned int& initIndex);
+		virtual	bool fetchGeometry (TeCell& cell, const unsigned int& initIndex);
+
+
+	protected:
+
+		//! Return a linear ring and the number of holes in case of external ring
+		TeLinearRing getLinearRing(int& numberOfHoles);
+
+		//! Return a linear ring that begins in the portal i-th position and the number of holes in case of external ring
+		TeLinearRing getLinearRing(int& numberOfHoles, const unsigned int& i);
+
+		//! Escape special characters in a string to be used in a SQL statement
+		string escapeSequence(const string& from);
+
+		// Protected data members
+		TePGConnection *con_;
+		TePGRecordset tepg_recordset_;
+
+		long curRow_;		
+
+};
+
+
+/**
+ * @brief This is the class for TePostgreSQL driver factory.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup DatabaseUtils
+ */
+class TLPOSTGRESQL_DLL TePostgreSQLFactory : public TeDatabaseFactory
+{
+  public :
+      
+    /**
+     * Default constructor
+     */
+    TePostgreSQLFactory() : TeDatabaseFactory( 
+      std::string( "PostgreSQL" ) ) {};      
+      
+    /**
+     * Default Destructor
+     */
+    ~TePostgreSQLFactory() {};
+      
+  protected :  
+  
+    /**
+     * Implementation for the abstract TeFactory::build.
+     *
+     * @param arg A const reference to the parameters used by the
+     * database.
+     * @return A pointer to the new generated database instance.
+     */
+    TeDatabase* build( const TeDatabaseFactoryParams& arg )
+    {
+      TePostgreSQL* instance_ptr = new TePostgreSQL();
+      
+      if( arg.host_ != "" ) {
+        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
+          arg.database_, arg.port_ );
+      }
+  
+      return (TeDatabase*)instance_ptr;
+    }
+};
+
+namespace {
+  static TePostgreSQLFactory TePostgreSQLFactory_instance;
+}; 
+
+#endif	// __TERRALIB_INTERNAL_TePOSTGRESQL_H
+
+/*
+ *  Updates:
+ *      - 2007/03/26: Mario Rocco Added new method - string leftString(const string& name, const int& length);
+ */
+
diff --git a/src/terralib/drivers/PostgreSQL/TePostgreSQLDefines.h b/src/terralib/drivers/PostgreSQL/TePostgreSQLDefines.h
new file mode 100644
index 0000000..6efe548
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/TePostgreSQLDefines.h
@@ -0,0 +1,49 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TePostgreSQLDefines.h
+    \brief Provides a set of general definitions used by te_postgresql project.
+*/
+#ifndef  __TERRALIB_INTERNAL_POSTGRESQLDEFINES_H
+#define  __TERRALIB_INTERNAL_POSTGRESQLDEFINES_H
+
+/** @defgroup TePOSTGRESQL_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLPOSTGRESQL_AS_DLL
+#define TLPOSTGRESQL_DLL __declspec(dllexport)
+#else
+#define TLPOSTGRESQL_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TLPOSTGRESQL_DLL
+#endif
+/** @} */ 
+
+#endif //__TERRALIB_INTERNAL_POSTGRESQLDEFINES_H
diff --git a/src/terralib/drivers/PostgreSQL/includepg/ecpg_informix.h b/src/terralib/drivers/PostgreSQL/includepg/ecpg_informix.h
new file mode 100644
index 0000000..f514144
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/ecpg_informix.h
@@ -0,0 +1,90 @@
+/*
+ * This file contains stuff needed to be as compatible to Informix as possible.
+ *
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpg_informix.h,v 1.16 2004/08/29 05:06:59 momjian Exp $
+ */
+#ifndef _ECPG_INFORMIX_H
+#define _ECPG_INFORMIX_H
+
+#include <ecpglib.h>
+#include <pgtypes_date.h>
+#include <pgtypes_interval.h>
+#include <pgtypes_numeric.h>
+#include <pgtypes_timestamp.h>
+
+#define SQLNOTFOUND 100
+
+#define ECPG_INFORMIX_NUM_OVERFLOW	-1200
+#define ECPG_INFORMIX_NUM_UNDERFLOW -1201
+#define ECPG_INFORMIX_DIVIDE_ZERO	-1202
+#define ECPG_INFORMIX_BAD_YEAR		-1204
+#define ECPG_INFORMIX_BAD_MONTH		-1205
+#define ECPG_INFORMIX_BAD_DAY		-1206
+#define ECPG_INFORMIX_ENOSHORTDATE	-1209
+#define ECPG_INFORMIX_DATE_CONVERT	-1210
+#define ECPG_INFORMIX_OUT_OF_MEMORY -1211
+#define ECPG_INFORMIX_ENOTDMY		-1212
+#define ECPG_INFORMIX_BAD_NUMERIC	-1213
+#define ECPG_INFORMIX_BAD_EXPONENT	-1216
+#define ECPG_INFORMIX_BAD_DATE		-1218
+#define ECPG_INFORMIX_EXTRA_CHARS	-1264
+
+#ifdef __cplusplus
+extern		"C"
+{
+#endif
+
+extern int	rdatestr(date, char *);
+extern void rtoday(date *);
+extern int	rjulmdy(date, short *);
+extern int	rdefmtdate(date *, char *, char *);
+extern int	rfmtdate(date, char *, char *);
+extern int	rmdyjul(short *, date *);
+extern int	rstrdate(char *, date *);
+extern int	rdayofweek(date);
+
+extern int	rfmtlong(long, char *, char *);
+extern int	rgetmsg(int, char *, int);
+extern int	risnull(int, char *);
+extern int	rsetnull(int, char *);
+extern int	rtypalign(int, int);
+extern int	rtypmsize(int, int);
+extern int	rtypwidth(int, int);
+extern void rupshift(char *);
+
+extern int	byleng(char *, int);
+extern void ldchar(char *, int, char *);
+
+extern void ECPG_informix_set_var(int, void *, int);
+extern void *ECPG_informix_get_var(int);
+
+/* Informix defines these in decimal.h */
+int			decadd(decimal *, decimal *, decimal *);
+int			deccmp(decimal *, decimal *);
+void		deccopy(decimal *, decimal *);
+int			deccvasc(char *, int, decimal *);
+int			deccvdbl(double, decimal *);
+int			deccvint(int, decimal *);
+int			deccvlong(long, decimal *);
+int			decdiv(decimal *, decimal *, decimal *);
+int			decmul(decimal *, decimal *, decimal *);
+int			decsub(decimal *, decimal *, decimal *);
+int			dectoasc(decimal *, char *, int, int);
+int			dectodbl(decimal *, double *);
+int			dectoint(decimal *, int *);
+int			dectolong(decimal *, long *);
+
+/* Informix defines these in datetime.h */
+extern void dtcurrent(timestamp *);
+extern int	dtcvasc(char *, timestamp *);
+extern int	dtsub(timestamp *, timestamp *, interval *);
+extern int	dttoasc(timestamp *, char *);
+extern int	dttofmtasc(timestamp *, char *, int, char *);
+extern int	intoasc(interval *, char *);
+extern int	dtcvfmtasc(char *, char *, timestamp *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif   /* ndef _ECPG_INFORMIX_H */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/ecpgerrno.h b/src/terralib/drivers/PostgreSQL/includepg/ecpgerrno.h
new file mode 100644
index 0000000..2eb4a18
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/ecpgerrno.h
@@ -0,0 +1,77 @@
+#ifndef _ECPG_ERRNO_H
+#define _ECPG_ERRNO_H
+
+#include <errno.h>
+
+/* This is a list of all error codes the embedded SQL program can return */
+#define ECPG_NO_ERROR		0
+#define ECPG_NOT_FOUND		100
+
+/* system error codes returned by ecpglib get the correct number,
+ * but are made negative
+ */
+#define ECPG_OUT_OF_MEMORY	-ENOMEM
+
+/* first we have a set of ecpg messages, they start at 200 */
+#define ECPG_UNSUPPORTED		-200
+#define ECPG_TOO_MANY_ARGUMENTS		-201
+#define ECPG_TOO_FEW_ARGUMENTS		-202
+#define ECPG_TOO_MANY_MATCHES		-203
+#define ECPG_INT_FORMAT			-204
+#define ECPG_UINT_FORMAT		-205
+#define ECPG_FLOAT_FORMAT		-206
+#define ECPG_NUMERIC_FORMAT		-207
+#define ECPG_INTERVAL_FORMAT		-208
+#define ECPG_DATE_FORMAT		-209
+#define ECPG_TIMESTAMP_FORMAT		-210
+#define ECPG_CONVERT_BOOL		-211
+#define ECPG_EMPTY			-212
+#define ECPG_MISSING_INDICATOR		-213
+#define ECPG_NO_ARRAY			-214
+#define ECPG_DATA_NOT_ARRAY		-215
+#define ECPG_ARRAY_INSERT		-216
+
+#define ECPG_NO_CONN			-220
+#define ECPG_NOT_CONN			-221
+
+#define ECPG_INVALID_STMT		-230
+
+/* dynamic SQL related */
+#define ECPG_UNKNOWN_DESCRIPTOR		-240
+#define ECPG_INVALID_DESCRIPTOR_INDEX	-241
+#define ECPG_UNKNOWN_DESCRIPTOR_ITEM	-242
+#define ECPG_VAR_NOT_NUMERIC		-243
+#define ECPG_VAR_NOT_CHAR		-244
+
+/* finally the backend error messages, they start at 400 */
+#define ECPG_PGSQL			-400
+#define ECPG_TRANS			-401
+#define ECPG_CONNECT			-402
+#define ECPG_DUPLICATE_KEY		-403
+#define ECPG_SUBSELECT_NOT_ONE		-404
+
+/* for compatibility we define some different error codes for the same error
+ * if adding a new one make sure to not double define it */
+#define ECPG_INFORMIX_DUPLICATE_KEY -239
+#define ECPG_INFORMIX_SUBSELECT_NOT_ONE -284
+
+/* backend WARNINGs, starting at 600 */
+#define ECPG_WARNING_UNRECOGNIZED	   -600
+ /* WARNING:  (transaction aborted): queries ignored until END */
+
+ /*
+  * WARNING:  current transaction is aborted, queries ignored until end of
+  * transaction block
+  */
+#define ECPG_WARNING_QUERY_IGNORED	   -601
+ /* WARNING:  PerformPortalClose: portal "*" not found */
+#define ECPG_WARNING_UNKNOWN_PORTAL    -602
+ /* WARNING:  BEGIN: already a transaction in progress */
+#define ECPG_WARNING_IN_TRANSACTION    -603
+ /* WARNING:  AbortTransaction and not in in-progress state */
+ /* WARNING:  COMMIT: no transaction in progress */
+#define ECPG_WARNING_NO_TRANSACTION    -604
+ /* WARNING:  BlankPortalAssignName: portal * already exists */
+#define ECPG_WARNING_PORTAL_EXISTS	   -605
+
+#endif   /* !_ECPG_ERRNO_H */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/ecpglib.h b/src/terralib/drivers/PostgreSQL/includepg/ecpglib.h
new file mode 100644
index 0000000..c3f8228
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/ecpglib.h
@@ -0,0 +1,94 @@
+/*
+ * this is a small part of c.h since we don't want to leak all postgres
+ * definitions into ecpg programs
+ */
+
+#ifndef _ECPGLIB_H
+#define _ECPGLIB_H
+
+#include "libpq-fe.h"
+#include "ecpgtype.h"
+#include <string.h>
+
+#ifndef __BEOS__
+#ifndef __cplusplus
+#ifndef bool
+#define bool char
+#endif   /* ndef bool */
+
+#ifndef true
+#define true	((bool) 1)
+#endif   /* ndef true */
+#ifndef false
+#define false	((bool) 0)
+#endif   /* ndef false */
+#endif   /* not C++ */
+#else							/* __BEOS__ */
+#include <SupportDefs.h>
+#endif   /* __BEOS__ */
+
+#ifndef TRUE
+#define TRUE	1
+#endif   /* TRUE */
+
+#ifndef FALSE
+#define FALSE	0
+#endif   /* FALSE */
+
+#ifdef __cplusplus
+extern		"C"
+{
+#endif
+
+struct sqlca_t;
+
+void		ECPGinit_sqlca(struct sqlca_t * sqlca);
+void		ECPGdebug(int, FILE *);
+bool		ECPGstatus(int, const char *);
+bool		ECPGsetcommit(int, const char *, const char *);
+bool		ECPGsetconn(int, const char *);
+bool		ECPGconnect(int, int, const char *, const char *, const char *, const char *, int);
+bool		ECPGdo(int, int, int, const char *, char *,...);
+bool		ECPGtrans(int, const char *, const char *);
+bool		ECPGdisconnect(int, const char *);
+bool		ECPGprepare(int, char *, char *);
+bool		ECPGdeallocate(int, int, char *);
+bool		ECPGdeallocate_one(int, char *);
+bool		ECPGdeallocate_all(int);
+char	   *ECPGprepared_statement(const char *);
+
+void		ECPGlog(const char *format,...);
+char	   *ECPGerrmsg(void);
+
+ /* print an error message */
+void		sqlprint(void);
+
+/* define this for simplicity as well as compatibility */
+
+#define		  SQLCODE	 sqlca.sqlcode
+
+/* dynamic SQL */
+
+bool ECPGdo_descriptor(int line, const char *connection,
+				  const char *descriptor, const char *query);
+bool		ECPGdeallocate_desc(int line, const char *name);
+bool		ECPGallocate_desc(int line, const char *name);
+void		ECPGraise(int line, int code, const char *sqlstate, const char *str);
+void		ECPGraise_backend(int line, PGresult *result, PGconn *conn, int compat);
+bool		ECPGget_desc_header(int, char *, int *);
+bool		ECPGget_desc(int, char *, int,...);
+bool		ECPGset_desc_header(int, char *, int);
+bool		ECPGset_desc(int, char *, int,...);
+
+void		ECPGset_noind_null(enum ECPGttype, void *);
+bool		ECPGis_noind_null(enum ECPGttype, void *);
+bool		ECPGdescribe(int, bool, const char *,...);
+
+/* dynamic result allocation */
+void		ECPGfree_auto_mem(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif   /* _ECPGLIB_H */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/ecpgtype.h b/src/terralib/drivers/PostgreSQL/includepg/ecpgtype.h
new file mode 100644
index 0000000..1371164
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/ecpgtype.h
@@ -0,0 +1,93 @@
+/*
+ * This file implements a data structure that is built and maintained by the
+ * preprocessor.
+ *
+ * All types that can be handled for host variable declarations has to
+ * be handled eventually.
+ */
+
+/*
+ * Here are all the types that we are to handle. Note that it is the type
+ * that is registered and that has nothing whatsoever to do with the storage
+ * class.
+ *
+ * Simple types
+ * integers: char, short, int, long (signed and unsigned)
+ * floats: float, double
+ *
+ * Complex types:
+ * VARCHAR, VARCHAR2 - Strings with length (maxlen is given in the declaration)
+ * Arrays of simple types and of VARCHAR, VARCHAR2 (size given in declaration)
+ * Records build of simple types, arrays and other structs.
+ *
+ * Complicating things:
+ * typedefs and struct names!
+ *
+ * Conclusion:
+ * This is a typically recursive definition. A structure of typed list elements
+ * would probably work fine:
+ */
+
+#ifndef _ECPGTYPE_H
+#define _ECPGTYPE_H
+
+#ifdef __cplusplus
+extern		"C"
+{
+#endif
+
+enum ECPGttype
+{
+	ECPGt_char = 1, ECPGt_unsigned_char, ECPGt_short, ECPGt_unsigned_short,
+	ECPGt_int, ECPGt_unsigned_int, ECPGt_long, ECPGt_unsigned_long,
+	ECPGt_long_long, ECPGt_unsigned_long_long,
+	ECPGt_bool,
+	ECPGt_float, ECPGt_double,
+	ECPGt_varchar, ECPGt_varchar2,
+	ECPGt_numeric,				/* this is a decimal that stores its
+								 * digits in a malloced array */
+	ECPGt_decimal,				/* this is a decimal that stores its
+								 * digits in a fixed array */
+	ECPGt_date,
+	ECPGt_timestamp,
+	ECPGt_interval,
+	ECPGt_array,
+	ECPGt_struct,
+	ECPGt_union,
+	ECPGt_descriptor,			/* sql descriptor, no C variable */
+	ECPGt_char_variable,
+	ECPGt_const,				/* a constant is needed sometimes */
+	ECPGt_EOIT,					/* End of insert types. */
+	ECPGt_EORT,					/* End of result types. */
+	ECPGt_NO_INDICATOR			/* no indicator */
+};
+
+ /* descriptor items */
+enum ECPGdtype
+{
+	ECPGd_count = 1,
+	ECPGd_data,
+	ECPGd_di_code,
+	ECPGd_di_precision,
+	ECPGd_indicator,
+	ECPGd_key_member,
+	ECPGd_length,
+	ECPGd_name,
+	ECPGd_nullable,
+	ECPGd_octet,
+	ECPGd_precision,
+	ECPGd_ret_length,
+	ECPGd_ret_octet,
+	ECPGd_scale,
+	ECPGd_type,
+	ECPGd_EODT,					/* End of descriptor types. */
+	ECPGd_cardinality
+};
+
+#define IS_SIMPLE_TYPE(type) ((type) >= ECPGt_char && (type) <= ECPGt_interval)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif   /* _ECPGTYPE_H */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/libpq-fe.h b/src/terralib/drivers/PostgreSQL/includepg/libpq-fe.h
new file mode 100644
index 0000000..53d2eee
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/libpq-fe.h
@@ -0,0 +1,503 @@
+/*-------------------------------------------------------------------------
+ *
+ * libpq-fe.h
+ *	  This file contains definitions for structures and
+ *	  externs for functions used by frontend postgres applications.
+ *
+ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-fe.h,v 1.116 2004/12/31 22:03:50 pgsql Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef LIBPQ_FE_H
+#define LIBPQ_FE_H
+
+#ifdef __cplusplus
+extern		"C"
+{
+#endif
+
+#include <stdio.h>
+
+/*
+ * postgres_ext.h defines the backend's externally visible types,
+ * such as Oid.
+ */
+#include "postgres_ext.h"
+
+/* SSL type is needed here only to declare PQgetssl() */
+#ifdef USE_SSL
+#include <openssl/ssl.h>
+#endif
+
+/* Application-visible enum types */
+
+typedef enum
+{
+	/*
+	 * Although it is okay to add to this list, values which become unused
+	 * should never be removed, nor should constants be redefined - that
+	 * would break compatibility with existing code.
+	 */
+	CONNECTION_OK,
+	CONNECTION_BAD,
+	/* Non-blocking mode only below here */
+
+	/*
+	 * The existence of these should never be relied upon - they should
+	 * only be used for user feedback or similar purposes.
+	 */
+	CONNECTION_STARTED,			/* Waiting for connection to be made.  */
+	CONNECTION_MADE,			/* Connection OK; waiting to send.	   */
+	CONNECTION_AWAITING_RESPONSE,		/* Waiting for a response from the
+										 * postmaster.		  */
+	CONNECTION_AUTH_OK,			/* Received authentication; waiting for
+								 * backend startup. */
+	CONNECTION_SETENV,			/* Negotiating environment. */
+	CONNECTION_SSL_STARTUP,		/* Negotiating SSL. */
+	CONNECTION_NEEDED			/* Internal state: connect() needed */
+} ConnStatusType;
+
+typedef enum
+{
+	PGRES_POLLING_FAILED = 0,
+	PGRES_POLLING_READING,		/* These two indicate that one may	  */
+	PGRES_POLLING_WRITING,		/* use select before polling again.   */
+	PGRES_POLLING_OK,
+	PGRES_POLLING_ACTIVE		/* unused; keep for awhile for backwards
+								 * compatibility */
+} PostgresPollingStatusType;
+
+typedef enum
+{
+	PGRES_EMPTY_QUERY = 0,		/* empty query string was executed */
+	PGRES_COMMAND_OK,			/* a query command that doesn't return
+								 * anything was executed properly by the
+								 * backend */
+	PGRES_TUPLES_OK,			/* a query command that returns tuples was
+								 * executed properly by the backend,
+								 * PGresult contains the result tuples */
+	PGRES_COPY_OUT,				/* Copy Out data transfer in progress */
+	PGRES_COPY_IN,				/* Copy In data transfer in progress */
+	PGRES_BAD_RESPONSE,			/* an unexpected response was recv'd from
+								 * the backend */
+	PGRES_NONFATAL_ERROR,		/* notice or warning message */
+	PGRES_FATAL_ERROR			/* query failed */
+} ExecStatusType;
+
+typedef enum
+{
+	PQTRANS_IDLE,				/* connection idle */
+	PQTRANS_ACTIVE,				/* command in progress */
+	PQTRANS_INTRANS,			/* idle, within transaction block */
+	PQTRANS_INERROR,			/* idle, within failed transaction */
+	PQTRANS_UNKNOWN				/* cannot determine status */
+} PGTransactionStatusType;
+
+typedef enum
+{
+	PQERRORS_TERSE,				/* single-line error messages */
+	PQERRORS_DEFAULT,			/* recommended style */
+	PQERRORS_VERBOSE			/* all the facts, ma'am */
+} PGVerbosity;
+
+/* PGconn encapsulates a connection to the backend.
+ * The contents of this struct are not supposed to be known to applications.
+ */
+typedef struct pg_conn PGconn;
+
+/* PGresult encapsulates the result of a query (or more precisely, of a single
+ * SQL command --- a query string given to PQsendQuery can contain multiple
+ * commands and thus return multiple PGresult objects).
+ * The contents of this struct are not supposed to be known to applications.
+ */
+typedef struct pg_result PGresult;
+
+/* PGcancel encapsulates the information needed to cancel a running
+ * query on an existing connection.
+ * The contents of this struct are not supposed to be known to applications.
+ */
+typedef struct pg_cancel PGcancel;
+
+/* PGnotify represents the occurrence of a NOTIFY message.
+ * Ideally this would be an opaque typedef, but it's so simple that it's
+ * unlikely to change.
+ * NOTE: in Postgres 6.4 and later, the be_pid is the notifying backend's,
+ * whereas in earlier versions it was always your own backend's PID.
+ */
+typedef struct pgNotify
+{
+	char	   *relname;		/* notification condition name */
+	int			be_pid;			/* process ID of server process */
+	char	   *extra;			/* notification parameter */
+	/* Fields below here are private to libpq; apps should not use 'em */
+	struct pgNotify *next;		/* list link */
+} PGnotify;
+
+/* Function types for notice-handling callbacks */
+typedef void (*PQnoticeReceiver) (void *arg, const PGresult *res);
+typedef void (*PQnoticeProcessor) (void *arg, const char *message);
+
+/* Print options for PQprint() */
+typedef char pqbool;
+
+typedef struct _PQprintOpt
+{
+	pqbool		header;			/* print output field headings and row
+								 * count */
+	pqbool		align;			/* fill align the fields */
+	pqbool		standard;		/* old brain dead format */
+	pqbool		html3;			/* output html tables */
+	pqbool		expanded;		/* expand tables */
+	pqbool		pager;			/* use pager for output if needed */
+	char	   *fieldSep;		/* field separator */
+	char	   *tableOpt;		/* insert to HTML <table ...> */
+	char	   *caption;		/* HTML <caption> */
+	char	  **fieldName;		/* null terminated array of repalcement
+								 * field names */
+} PQprintOpt;
+
+/* ----------------
+ * Structure for the conninfo parameter definitions returned by PQconndefaults
+ *
+ * All fields except "val" point at static strings which must not be altered.
+ * "val" is either NULL or a malloc'd current-value string.  PQconninfoFree()
+ * will release both the val strings and the PQconninfoOption array itself.
+ * ----------------
+ */
+typedef struct _PQconninfoOption
+{
+	char	   *keyword;		/* The keyword of the option			*/
+	char	   *envvar;			/* Fallback environment variable name	*/
+	char	   *compiled;		/* Fallback compiled in default value	*/
+	char	   *val;			/* Option's current value, or NULL		 */
+	char	   *label;			/* Label for field in connect dialog	*/
+	char	   *dispchar;		/* Character to display for this field in
+								 * a connect dialog. Values are: ""
+								 * Display entered value as is "*"
+								 * Password field - hide value "D"	Debug
+								 * option - don't show by default */
+	int			dispsize;		/* Field size in characters for dialog	*/
+} PQconninfoOption;
+
+/* ----------------
+ * PQArgBlock -- structure for PQfn() arguments
+ * ----------------
+ */
+typedef struct
+{
+	int			len;
+	int			isint;
+	union
+	{
+		int		   *ptr;		/* can't use void (dec compiler barfs)	 */
+		int			integer;
+	}			u;
+} PQArgBlock;
+
+/* ----------------
+ * Exported functions of libpq
+ * ----------------
+ */
+
+/* ===	in fe-connect.c === */
+
+/* make a new client connection to the backend */
+/* Asynchronous (non-blocking) */
+extern PGconn *PQconnectStart(const char *conninfo);
+extern PostgresPollingStatusType PQconnectPoll(PGconn *conn);
+
+/* Synchronous (blocking) */
+extern PGconn *PQconnectdb(const char *conninfo);
+extern PGconn *PQsetdbLogin(const char *pghost, const char *pgport,
+			 const char *pgoptions, const char *pgtty,
+			 const char *dbName,
+			 const char *login, const char *pwd);
+
+#define PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME)  \
+	PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL)
+
+/* close the current connection and free the PGconn data structure */
+extern void PQfinish(PGconn *conn);
+
+/* get info about connection options known to PQconnectdb */
+extern PQconninfoOption *PQconndefaults(void);
+
+/* free the data structure returned by PQconndefaults() */
+extern void PQconninfoFree(PQconninfoOption *connOptions);
+
+/*
+ * close the current connection and restablish a new one with the same
+ * parameters
+ */
+/* Asynchronous (non-blocking) */
+extern int	PQresetStart(PGconn *conn);
+extern PostgresPollingStatusType PQresetPoll(PGconn *conn);
+
+/* Synchronous (blocking) */
+extern void PQreset(PGconn *conn);
+
+/* request a cancel structure */
+extern PGcancel *PQgetCancel(PGconn *conn);
+
+/* free a cancel structure */
+extern void PQfreeCancel(PGcancel *cancel);
+
+/* issue a cancel request */
+extern int	PQcancel(PGcancel *cancel, char *errbuf, int errbufsize);
+
+/* backwards compatible version of PQcancel; not thread-safe */
+extern int	PQrequestCancel(PGconn *conn);
+
+/* Accessor functions for PGconn objects */
+extern char *PQdb(const PGconn *conn);
+extern char *PQuser(const PGconn *conn);
+extern char *PQpass(const PGconn *conn);
+extern char *PQhost(const PGconn *conn);
+extern char *PQport(const PGconn *conn);
+extern char *PQtty(const PGconn *conn);
+extern char *PQoptions(const PGconn *conn);
+extern ConnStatusType PQstatus(const PGconn *conn);
+extern PGTransactionStatusType PQtransactionStatus(const PGconn *conn);
+extern const char *PQparameterStatus(const PGconn *conn,
+				  const char *paramName);
+extern int	PQprotocolVersion(const PGconn *conn);
+extern int	PQserverVersion(const PGconn *conn);
+extern char *PQerrorMessage(const PGconn *conn);
+extern int	PQsocket(const PGconn *conn);
+extern int	PQbackendPID(const PGconn *conn);
+extern int	PQclientEncoding(const PGconn *conn);
+extern int	PQsetClientEncoding(PGconn *conn, const char *encoding);
+
+#ifdef USE_SSL
+/* Get the SSL structure associated with a connection */
+extern SSL *PQgetssl(PGconn *conn);
+#else
+extern void *PQgetssl(PGconn *conn);
+#endif
+
+/* Tell libpq whether it needs to initialize OpenSSL */
+extern void PQinitSSL(int do_init);
+
+/* Set verbosity for PQerrorMessage and PQresultErrorMessage */
+extern PGVerbosity PQsetErrorVerbosity(PGconn *conn, PGVerbosity verbosity);
+
+/* Enable/disable tracing */
+extern void PQtrace(PGconn *conn, FILE *debug_port);
+extern void PQuntrace(PGconn *conn);
+
+/* Override default notice handling routines */
+extern PQnoticeReceiver PQsetNoticeReceiver(PGconn *conn,
+					PQnoticeReceiver proc,
+					void *arg);
+extern PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn,
+					 PQnoticeProcessor proc,
+					 void *arg);
+
+/*
+ *	   Used to set callback that prevents concurrent access to
+ *	   non-thread safe functions that libpq needs.
+ *	   The default implementation uses a libpq internal mutex.
+ *	   Only required for multithreaded apps that use kerberos
+ *	   both within their app and for postgresql connections.
+ */
+typedef void (*pgthreadlock_t) (int acquire);
+
+extern pgthreadlock_t PQregisterThreadLock(pgthreadlock_t newhandler);
+
+/* === in fe-exec.c === */
+
+/* Simple synchronous query */
+extern PGresult *PQexec(PGconn *conn, const char *query);
+extern PGresult *PQexecParams(PGconn *conn,
+			 const char *command,
+			 int nParams,
+			 const Oid *paramTypes,
+			 const char *const * paramValues,
+			 const int *paramLengths,
+			 const int *paramFormats,
+			 int resultFormat);
+extern PGresult *PQprepare(PGconn *conn, const char *stmtName,
+						   const char *query, int nParams,
+						   const Oid *paramTypes);
+extern PGresult *PQexecPrepared(PGconn *conn,
+			   const char *stmtName,
+			   int nParams,
+			   const char *const * paramValues,
+			   const int *paramLengths,
+			   const int *paramFormats,
+			   int resultFormat);
+
+/* Interface for multiple-result or asynchronous queries */
+extern int	PQsendQuery(PGconn *conn, const char *query);
+extern int PQsendQueryParams(PGconn *conn,
+				  const char *command,
+				  int nParams,
+				  const Oid *paramTypes,
+				  const char *const * paramValues,
+				  const int *paramLengths,
+				  const int *paramFormats,
+				  int resultFormat);
+extern int PQsendPrepare(PGconn *conn, const char *stmtName,
+						 const char *query, int nParams,
+						 const Oid *paramTypes);
+extern int PQsendQueryPrepared(PGconn *conn,
+					const char *stmtName,
+					int nParams,
+					const char *const * paramValues,
+					const int *paramLengths,
+					const int *paramFormats,
+					int resultFormat);
+extern PGresult *PQgetResult(PGconn *conn);
+
+/* Routines for managing an asynchronous query */
+extern int	PQisBusy(PGconn *conn);
+extern int	PQconsumeInput(PGconn *conn);
+
+/* LISTEN/NOTIFY support */
+extern PGnotify *PQnotifies(PGconn *conn);
+
+/* Routines for copy in/out */
+extern int	PQputCopyData(PGconn *conn, const char *buffer, int nbytes);
+extern int	PQputCopyEnd(PGconn *conn, const char *errormsg);
+extern int	PQgetCopyData(PGconn *conn, char **buffer, int async);
+
+/* Deprecated routines for copy in/out */
+extern int	PQgetline(PGconn *conn, char *string, int length);
+extern int	PQputline(PGconn *conn, const char *string);
+extern int	PQgetlineAsync(PGconn *conn, char *buffer, int bufsize);
+extern int	PQputnbytes(PGconn *conn, const char *buffer, int nbytes);
+extern int	PQendcopy(PGconn *conn);
+
+/* Set blocking/nonblocking connection to the backend */
+extern int	PQsetnonblocking(PGconn *conn, int arg);
+extern int	PQisnonblocking(const PGconn *conn);
+
+/* Force the write buffer to be written (or at least try) */
+extern int	PQflush(PGconn *conn);
+
+/*
+ * "Fast path" interface --- not really recommended for application
+ * use
+ */
+extern PGresult *PQfn(PGconn *conn,
+	 int fnid,
+	 int *result_buf,
+	 int *result_len,
+	 int result_is_int,
+	 const PQArgBlock *args,
+	 int nargs);
+
+/* Accessor functions for PGresult objects */
+extern ExecStatusType PQresultStatus(const PGresult *res);
+extern char *PQresStatus(ExecStatusType status);
+extern char *PQresultErrorMessage(const PGresult *res);
+extern char *PQresultErrorField(const PGresult *res, int fieldcode);
+extern int	PQntuples(const PGresult *res);
+extern int	PQnfields(const PGresult *res);
+extern int	PQbinaryTuples(const PGresult *res);
+extern char *PQfname(const PGresult *res, int field_num);
+extern int	PQfnumber(const PGresult *res, const char *field_name);
+extern Oid	PQftable(const PGresult *res, int field_num);
+extern int	PQftablecol(const PGresult *res, int field_num);
+extern int	PQfformat(const PGresult *res, int field_num);
+extern Oid	PQftype(const PGresult *res, int field_num);
+extern int	PQfsize(const PGresult *res, int field_num);
+extern int	PQfmod(const PGresult *res, int field_num);
+extern char *PQcmdStatus(PGresult *res);
+extern char *PQoidStatus(const PGresult *res);	/* old and ugly */
+extern Oid	PQoidValue(const PGresult *res);	/* new and improved */
+extern char *PQcmdTuples(PGresult *res);
+extern char *PQgetvalue(const PGresult *res, int tup_num, int field_num);
+extern int	PQgetlength(const PGresult *res, int tup_num, int field_num);
+extern int	PQgetisnull(const PGresult *res, int tup_num, int field_num);
+
+/* Delete a PGresult */
+extern void PQclear(PGresult *res);
+
+/* For freeing other alloc'd results, such as PGnotify structs */
+extern void PQfreemem(void *ptr);
+
+/* Exists for backward compatibility.  bjm 2003-03-24 */
+#define PQfreeNotify(ptr) PQfreemem(ptr)
+
+/* Define the string so all uses are consistent. */
+#define PQnoPasswordSupplied	"fe_sendauth: no password supplied\n"
+
+/*
+ * Make an empty PGresult with given status (some apps find this
+ * useful). If conn is not NULL and status indicates an error, the
+ * conn's errorMessage is copied.
+ */
+extern PGresult *PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status);
+
+
+/* Quoting strings before inclusion in queries. */
+extern size_t PQescapeString(char *to, const char *from, size_t length);
+extern unsigned char *PQescapeBytea(const unsigned char *bintext, size_t binlen,
+			  size_t *bytealen);
+extern unsigned char *PQunescapeBytea(const unsigned char *strtext,
+				size_t *retbuflen);
+
+
+
+/* === in fe-print.c === */
+
+extern void
+PQprint(FILE *fout,				/* output stream */
+		const PGresult *res,
+		const PQprintOpt *ps);	/* option structure */
+
+/*
+ * really old printing routines
+ */
+extern void
+PQdisplayTuples(const PGresult *res,
+				FILE *fp,		/* where to send the output */
+				int fillAlign,	/* pad the fields with spaces */
+				const char *fieldSep,	/* field separator */
+				int printHeader,	/* display headers? */
+				int quiet);
+
+extern void
+PQprintTuples(const PGresult *res,
+			  FILE *fout,		/* output stream */
+			  int printAttName, /* print attribute names */
+			  int terseOutput,	/* delimiter bars */
+			  int width);		/* width of column, if 0, use variable
+								 * width */
+
+
+/* === in fe-lobj.c === */
+
+/* Large-object access routines */
+extern int	lo_open(PGconn *conn, Oid lobjId, int mode);
+extern int	lo_close(PGconn *conn, int fd);
+extern int	lo_read(PGconn *conn, int fd, char *buf, size_t len);
+extern int	lo_write(PGconn *conn, int fd, char *buf, size_t len);
+extern int	lo_lseek(PGconn *conn, int fd, int offset, int whence);
+extern Oid	lo_creat(PGconn *conn, int mode);
+extern int	lo_tell(PGconn *conn, int fd);
+extern int	lo_unlink(PGconn *conn, Oid lobjId);
+extern Oid	lo_import(PGconn *conn, const char *filename);
+extern int	lo_export(PGconn *conn, Oid lobjId, const char *filename);
+
+/* === in fe-misc.c === */
+
+/* Determine length of multibyte encoded char at *s */
+extern int	PQmblen(const unsigned char *s, int encoding);
+
+/* Determine display length of multibyte encoded char at *s */
+extern int	PQdsplen(const unsigned char *s, int encoding);
+
+/* Get encoding id from environment variable PGCLIENTENCODING */
+extern int	PQenv2encoding(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif   /* LIBPQ_FE_H */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/pg_config.h b/src/terralib/drivers/PostgreSQL/includepg/pg_config.h
new file mode 100644
index 0000000..1ea770c
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/pg_config.h
@@ -0,0 +1,685 @@
+/* src/include/pg_config.h.  Generated by configure.  */
+/* src/include/pg_config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Define to the type of arg 1 of 'accept' */
+#define ACCEPT_TYPE_ARG1 unsigned int
+
+/* Define to the type of arg 2 of 'accept' */
+#define ACCEPT_TYPE_ARG2 struct sockaddr *
+
+/* Define to the type of arg 3 of 'accept' */
+#define ACCEPT_TYPE_ARG3 int
+
+/* Define to the return type of 'accept' */
+#define ACCEPT_TYPE_RETURN unsigned int PASCAL
+
+/* The alignment requirement of a `double'. */
+#define ALIGNOF_DOUBLE 8
+
+/* The alignment requirement of a `int'. */
+#define ALIGNOF_INT 4
+
+/* The alignment requirement of a `long'. */
+#define ALIGNOF_LONG 4
+
+/* The alignment requirement of a `long long int'. */
+#define ALIGNOF_LONG_LONG_INT 8
+
+/* The alignment requirement of a `short'. */
+#define ALIGNOF_SHORT 2
+
+/* Define to the default TCP port number on which the server listens and to
+   which clients will try to connect. This can be overridden at run-time, but
+   it's convenient if your clients have the right default compiled in.
+   (--with-pgport=PORTNUM) */
+#define DEF_PGPORT 5432
+
+/* Define to the default TCP port number as a string constant. */
+#define DEF_PGPORT_STR "5432"
+
+/* Define to 1 if you want National Language Support. (--enable-nls) */
+#define ENABLE_NLS 1
+
+/* Define to 1 to build client libraries as thread-safe code.
+   (--enable-thread-safety) */
+/* #undef ENABLE_THREAD_SAFETY */
+
+/* Define to 1 if getpwuid_r() takes a 5th argument. */
+/* #undef GETPWUID_R_5ARG */
+
+/* Define to 1 if gettimeofday() takes only 1 argument. */
+/* #undef GETTIMEOFDAY_1ARG */
+
+#ifdef GETTIMEOFDAY_1ARG
+# define gettimeofday(a,b) gettimeofday(a)
+#endif
+
+/* Define to 1 if you have the `atexit' function. */
+#define HAVE_ATEXIT 1
+
+/* Define to 1 if you have the `cbrt' function. */
+#define HAVE_CBRT 1
+
+/* Define to 1 if you have the `class' function. */
+/* #undef HAVE_CLASS */
+
+/* Define to 1 if you have the `crypt' function. */
+/* #undef HAVE_CRYPT */
+
+/* Define to 1 if you have the <crypt.h> header file. */
+/* #undef HAVE_CRYPT_H */
+
+/* Define to 1 if you have the declaration of `fdatasync', and to 0 if you
+   don't. */
+#define HAVE_DECL_FDATASYNC 0
+
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+   don't. */
+#define HAVE_DECL_SNPRINTF 1
+
+/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
+   don't. */
+#define HAVE_DECL_VSNPRINTF 1
+
+/* Define to 1 if you have the <dld.h> header file. */
+/* #undef HAVE_DLD_H */
+
+/* Define to 1 if you have the `dlopen' function. */
+/* #undef HAVE_DLOPEN */
+
+/* Define to 1 if you have the <editline/history.h> header file. */
+/* #undef HAVE_EDITLINE_HISTORY_H */
+
+/* Define to 1 if you have the <editline/readline.h> header file. */
+/* #undef HAVE_EDITLINE_READLINE_H */
+
+/* Define to 1 if you have the <endian.h> header file. */
+/* #undef HAVE_ENDIAN_H */
+
+/* Define to 1 if you have the `fcvt' function. */
+#define HAVE_FCVT 1
+
+/* Define to 1 if you have the `fdatasync' function. */
+/* #undef HAVE_FDATASYNC */
+
+/* Define to 1 if you have finite(). */
+#define HAVE_FINITE 1
+
+/* Define to 1 if you have the `fpclass' function. */
+/* #undef HAVE_FPCLASS */
+
+/* Define to 1 if you have the `fp_class' function. */
+/* #undef HAVE_FP_CLASS */
+
+/* Define to 1 if you have the `fp_class_d' function. */
+/* #undef HAVE_FP_CLASS_D */
+
+/* Define to 1 if you have the <fp_class.h> header file. */
+/* #undef HAVE_FP_CLASS_H */
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+/* #undef HAVE_FSEEKO */
+
+/* Define to 1 if your compiler understands __func__. */
+#define HAVE_FUNCNAME__FUNC 1
+
+/* Define to 1 if your compiler understands __FUNCTION__. */
+/* #undef HAVE_FUNCNAME__FUNCTION */
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+/* #undef HAVE_GETADDRINFO */
+
+/* Define to 1 if you have the `gethostbyname_r' function. */
+/* #undef HAVE_GETHOSTBYNAME_R */
+
+/* Define to 1 if you have the `gethostname' function. */
+/* #undef HAVE_GETHOSTNAME */
+
+/* Define to 1 if you have the `getopt' function. */
+#define HAVE_GETOPT 1
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#define HAVE_GETOPT_H 1
+
+/* Define to 1 if you have the `getopt_long' function. */
+#define HAVE_GETOPT_LONG 1
+
+/* Define to 1 if you have the `getpeereid' function. */
+/* #undef HAVE_GETPEEREID */
+
+/* Define to 1 if you have the `getpwuid_r' function. */
+/* #undef HAVE_GETPWUID_R */
+
+/* Define to 1 if you have the `getrusage' function. */
+/* #undef HAVE_GETRUSAGE */
+
+/* Define to 1 if you have the <history.h> header file. */
+/* #undef HAVE_HISTORY_H */
+
+/* Define to 1 if you have the <ieeefp.h> header file. */
+/* #undef HAVE_IEEEFP_H */
+
+/* Define to 1 if you have the `inet_aton' function. */
+/* #undef HAVE_INET_ATON */
+
+/* Define to 1 if the system has the type `int64'. */
+/* #undef HAVE_INT64 */
+
+/* Define to 1 if the system has the type `int8'. */
+/* #undef HAVE_INT8 */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the global variable 'int optreset'. */
+#define HAVE_INT_OPTRESET 1
+
+/* Define to 1 if you have the global variable 'int timezone'. */
+#define HAVE_INT_TIMEZONE 
+
+/* Define to 1 if you have support for IPv6. */
+/* #undef HAVE_IPV6 */
+
+/* Define to 1 if you have isinf(). */
+#define HAVE_ISINF 1
+
+/* Define to 1 if you have the <kernel/image.h> header file. */
+/* #undef HAVE_KERNEL_IMAGE_H */
+
+/* Define to 1 if you have the <kernel/OS.h> header file. */
+/* #undef HAVE_KERNEL_OS_H */
+
+/* Define to 1 if `e_data' is member of `krb5_error'. */
+/* #undef HAVE_KRB5_ERROR_E_DATA */
+
+/* Define to 1 if `text.data' is member of `krb5_error'. */
+/* #undef HAVE_KRB5_ERROR_TEXT_DATA */
+
+/* Define to 1 if `client' is member of `krb5_ticket'. */
+/* #undef HAVE_KRB5_TICKET_CLIENT */
+
+/* Define to 1 if `enc_part2' is member of `krb5_ticket'. */
+/* #undef HAVE_KRB5_TICKET_ENC_PART2 */
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+/* #undef HAVE_LANGINFO_H */
+
+/* Define to 1 if you have the `bind' library (-lbind). */
+/* #undef HAVE_LIBBIND */
+
+/* Define to 1 if you have the `BSD' library (-lBSD). */
+/* #undef HAVE_LIBBSD */
+
+/* Define to 1 if you have the `compat' library (-lcompat). */
+/* #undef HAVE_LIBCOMPAT */
+
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+/* #undef HAVE_LIBCRYPTO */
+
+/* Define to 1 if you have the `cygipc' library (-lcygipc). */
+/* #undef HAVE_LIBCYGIPC */
+
+/* Define to 1 if you have the `des' library (-ldes). */
+/* #undef HAVE_LIBDES */
+
+/* Define to 1 if you have the `dl' library (-ldl). */
+/* #undef HAVE_LIBDL */
+
+/* Define to 1 if you have the `dld' library (-ldld). */
+/* #undef HAVE_LIBDLD */
+
+/* Define to 1 if you have the `eay32' library (-leay32). */
+#define HAVE_LIBEAY32 1
+
+/* Define to 1 if you have the `gen' library (-lgen). */
+/* #undef HAVE_LIBGEN */
+
+/* Define to 1 if you have the `IPC' library (-lIPC). */
+/* #undef HAVE_LIBIPC */
+
+/* Define to 1 if you have the `krb' library (-lkrb). */
+/* #undef HAVE_LIBKRB */
+
+/* Define to 1 if you have the `lc' library (-llc). */
+/* #undef HAVE_LIBLC */
+
+/* Define to 1 if you have the `ld' library (-lld). */
+/* #undef HAVE_LIBLD */
+
+/* Define to 1 if you have the `m' library (-lm). */
+#define HAVE_LIBM 1
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the `pam' library (-lpam). */
+/* #undef HAVE_LIBPAM */
+
+/* Define to 1 if you have the `PW' library (-lPW). */
+/* #undef HAVE_LIBPW */
+
+/* Define if you have a function readline library */
+/* #undef HAVE_LIBREADLINE */
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+/* #undef HAVE_LIBRESOLV */
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the `ssl' library (-lssl). */
+/* #undef HAVE_LIBSSL */
+
+/* Define to 1 if you have the `ssleay32' library (-lssleay32). */
+#define HAVE_LIBSSLEAY32 1
+
+/* Define to 1 if you have the `unix' library (-lunix). */
+/* #undef HAVE_LIBUNIX */
+
+/* Define to 1 if you have the `util' library (-lutil). */
+/* #undef HAVE_LIBUTIL */
+
+/* Define to 1 if you have the `wsock32' library (-lwsock32). */
+#define HAVE_LIBWSOCK32 1
+
+/* Define to 1 if you have the `z' library (-lz). */
+#define HAVE_LIBZ 1
+
+/* Define to 1 if constants of type 'long long int' should have the suffix LL.
+   */
+#define HAVE_LL_CONSTANTS 1
+
+/* Define to 1 if `long int' works and is 64 bits. */
+/* #undef HAVE_LONG_INT_64 */
+
+/* Define to 1 if `long long int' works and is 64 bits. */
+#define HAVE_LONG_LONG_INT_64 
+
+/* Define to 1 if you have the `memmove' function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+/* #undef HAVE_NETINET_TCP_H */
+
+/* Define to 1 if you have the `on_exit' function. */
+/* #undef HAVE_ON_EXIT */
+
+/* Define to 1 if you have the <pam/pam_appl.h> header file. */
+/* #undef HAVE_PAM_PAM_APPL_H */
+
+/* Define to 1 if you have the `poll' function. */
+/* #undef HAVE_POLL */
+
+/* Define to 1 if you have the <poll.h> header file. */
+/* #undef HAVE_POLL_H */
+
+/* Define to 1 if you have the POSIX signal interface. */
+/* #undef HAVE_POSIX_SIGNALS */
+
+/* Define to 1 if you have the `pstat' function. */
+/* #undef HAVE_PSTAT */
+
+/* Define to 1 if the PS_STRINGS thing exists. */
+/* #undef HAVE_PS_STRINGS */
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef HAVE_PTHREAD */
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#define HAVE_PWD_H 1
+
+/* Define to 1 if you have the `random' function. */
+/* #undef HAVE_RANDOM */
+
+/* Define to 1 if you have the <readline.h> header file. */
+/* #undef HAVE_READLINE_H */
+
+/* Define to 1 if you have the <readline/history.h> header file. */
+/* #undef HAVE_READLINE_HISTORY_H */
+
+/* Define to 1 if you have the <readline/readline.h> header file. */
+/* #undef HAVE_READLINE_READLINE_H */
+
+/* Define to 1 if you have the `readlink' function. */
+/* #undef HAVE_READLINK */
+
+/* Define to 1 if you have the `replace_history_entry' function. */
+/* #undef HAVE_REPLACE_HISTORY_ENTRY */
+
+/* Define to 1 if you have the `rint' function. */
+#define HAVE_RINT 1
+
+/* Define to 1 if you have the global variable
+   'rl_completion_append_character'. */
+/* #undef HAVE_RL_COMPLETION_APPEND_CHARACTER */
+
+/* Define to 1 if you have the `rl_completion_matches' function. */
+/* #undef HAVE_RL_COMPLETION_MATCHES */
+
+/* Define to 1 if you have the `rl_filename_completion_function' function. */
+/* #undef HAVE_RL_FILENAME_COMPLETION_FUNCTION */
+
+/* Define to 1 if you have the <security/pam_appl.h> header file. */
+/* #undef HAVE_SECURITY_PAM_APPL_H */
+
+/* Define to 1 if you have the `setproctitle' function. */
+/* #undef HAVE_SETPROCTITLE */
+
+/* Define to 1 if you have the `setsid' function. */
+/* #undef HAVE_SETSID */
+
+/* Define to 1 if you have the `sigprocmask' function. */
+/* #undef HAVE_SIGPROCMASK */
+
+/* Define to 1 if you have sigsetjmp(). */
+/* #undef HAVE_SIGSETJMP */
+
+/* Define to 1 if the system has the type `sig_atomic_t'. */
+#define HAVE_SIG_ATOMIC_T 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if you have spinlocks. */
+#define HAVE_SPINLOCKS 1
+
+/* Define to 1 if you have the `srandom' function. */
+/* #undef HAVE_SRANDOM */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the `strerror_r' function. */
+/* #undef HAVE_STRERROR_R */
+
+/* Define to 1 if cpp supports the ANSI # stringizing operator. */
+#define HAVE_STRINGIZE 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if you have the `strtoll' function. */
+#define HAVE_STRTOLL 1
+
+/* Define to 1 if you have the `strtoq' function. */
+/* #undef HAVE_STRTOQ */
+
+/* Define to 1 if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
+
+/* Define to 1 if you have the `strtoull' function. */
+#define HAVE_STRTOULL 1
+
+/* Define to 1 if you have the `strtouq' function. */
+/* #undef HAVE_STRTOUQ */
+
+/* Define to 1 if the system has the type `struct addrinfo'. */
+/* #undef HAVE_STRUCT_ADDRINFO */
+
+/* Define to 1 if the system has the type `struct cmsgcred'. */
+/* #undef HAVE_STRUCT_CMSGCRED */
+
+/* Define to 1 if the system has the type `struct fcred'. */
+/* #undef HAVE_STRUCT_FCRED */
+
+/* Define to 1 if the system has the type `struct option'. */
+#define HAVE_STRUCT_OPTION 1
+
+/* Define to 1 if `sa_len' is member of `struct sockaddr'. */
+/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
+
+/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+
+/* Define to 1 if `ss_family' is member of `struct sockaddr_storage'. */
+#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
+
+/* Define to 1 if `ss_len' is member of `struct sockaddr_storage'. */
+/* #undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN */
+
+/* Define to 1 if `__ss_family' is member of `struct sockaddr_storage'. */
+/* #undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */
+
+/* Define to 1 if `__ss_len' is member of `struct sockaddr_storage'. */
+/* #undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN */
+
+/* Define to 1 if the system has the type `struct sockaddr_un'. */
+/* #undef HAVE_STRUCT_SOCKADDR_UN */
+
+/* Define to 1 if the system has the type `struct sockcred'. */
+/* #undef HAVE_STRUCT_SOCKCRED */
+
+/* Define to 1 if `tm_zone' is member of `struct tm'. */
+/* #undef HAVE_STRUCT_TM_TM_ZONE */
+
+/* Define to 1 if you have the <SupportDefs.h> header file. */
+/* #undef HAVE_SUPPORTDEFS_H */
+
+/* Define to 1 if you have the `symlink' function. */
+#define HAVE_SYMLINK 1
+
+/* Define to 1 if you have the `sysconf' function. */
+/* #undef HAVE_SYSCONF */
+
+/* Define to 1 if you have the syslog interface. */
+/* #undef HAVE_SYSLOG */
+
+/* Define to 1 if you have the <sys/ipc.h> header file. */
+/* #undef HAVE_SYS_IPC_H */
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+/* #undef HAVE_SYS_POLL_H */
+
+/* Define to 1 if you have the <sys/pstat.h> header file. */
+/* #undef HAVE_SYS_PSTAT_H */
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/sem.h> header file. */
+/* #undef HAVE_SYS_SEM_H */
+
+/* Define to 1 if you have the <sys/shm.h> header file. */
+/* #undef HAVE_SYS_SHM_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+/* #undef HAVE_SYS_UN_H */
+
+/* Define to 1 if you have the <termios.h> header file. */
+/* #undef HAVE_TERMIOS_H */
+
+/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
+   `HAVE_STRUCT_TM_TM_ZONE' instead. */
+/* #undef HAVE_TM_ZONE */
+
+/* Define to 1 if you have the `towlower' function. */
+#define HAVE_TOWLOWER 1
+
+/* Define to 1 if you have the external array `tzname'. */
+/* #undef HAVE_TZNAME */
+
+/* Define to 1 if the system has the type `uint64'. */
+/* #undef HAVE_UINT64 */
+
+/* Define to 1 if the system has the type `uint8'. */
+/* #undef HAVE_UINT8 */
+
+/* Define to 1 if the system has the type `union semun'. */
+/* #undef HAVE_UNION_SEMUN */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have unix sockets. */
+/* #undef HAVE_UNIX_SOCKETS */
+
+/* Define to 1 if you have the `unsetenv' function. */
+/* #undef HAVE_UNSETENV */
+
+/* Define to 1 if you have the `utime' function. */
+#define HAVE_UTIME 1
+
+/* Define to 1 if you have the `utimes' function. */
+/* #undef HAVE_UTIMES */
+
+/* Define to 1 if you have the <utime.h> header file. */
+#define HAVE_UTIME_H 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `waitpid' function. */
+/* #undef HAVE_WAITPID */
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define to 1 if you have the `wcstombs' function. */
+#define HAVE_WCSTOMBS 1
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#define HAVE_WCTYPE_H 1
+
+/* Define to the appropriate snprintf format for 64-bit ints, if any. */
+#define INT64_FORMAT "%I64d"
+
+/* Define to build with Kerberos 4 support. (--with-krb4) */
+/* #undef KRB4 */
+
+/* Define to build with Kerberos 5 support. (--with-krb5) */
+/* #undef KRB5 */
+
+/* Define to the location of locale files. */
+#define LOCALEDIR "/usr/local/pgsql/share/locale"
+
+/* Define as the maximum alignment requirement of any C data type. */
+#define MAXIMUM_ALIGNOF 8
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "pgsql-bugs at postgresql.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "PostgreSQL"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "PostgreSQL 8.0.1"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "postgresql"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "8.0.1"
+
+/* Define to the name of the PostgreSQL service principal in Kerberos.
+   (--with-krb-srvnam=NAME) */
+#define PG_KRB_SRVNAM "postgres"
+
+/* PostgreSQL version */
+#define PG_VERSION "8.0.1"
+
+/* A string containing the version number, platform, and C compiler */
+#define PG_VERSION_STR "PostgreSQL 8.0.1 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)"
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+   your system. */
+/* #undef PTHREAD_CREATE_JOINABLE */
+
+/* The size of a `unsigned long', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_LONG 4
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if strerror_r() returns a int. */
+/* #undef STRERROR_R_INT */
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+/* #undef TM_IN_SYS_TIME */
+
+/* Define to the appropriate snprintf format for unsigned 64-bit ints, if any.
+   */
+#define UINT64_FORMAT "%I64u"
+
+/* Define to 1 to build with assertion checks. (--enable-cassert) */
+/* #undef USE_ASSERT_CHECKING */
+
+/* Define to 1 if you want 64-bit integer timestamp and interval support.
+   (--enable-integer-datetimes) */
+/* #undef USE_INTEGER_DATETIMES */
+
+/* Define to select named POSIX semaphores. */
+/* #undef USE_NAMED_POSIX_SEMAPHORES */
+
+/* Define to 1 to build with PAM support. (--with-pam) */
+/* #undef USE_PAM */
+
+/* Define to 1 to build with Rendezvous support. (--with-rendezvous) */
+/* #undef USE_RENDEZVOUS */
+
+/* Define to build with (Open)SSL support. (--with-openssl) */
+#define USE_SSL 1
+
+/* Define to select SysV-style semaphores. */
+#define USE_SYSV_SEMAPHORES 1
+
+/* Define to select SysV-style shared memory. */
+#define USE_SYSV_SHARED_MEMORY 1
+
+/* Define to select unnamed POSIX semaphores. */
+/* #undef USE_UNNAMED_POSIX_SEMAPHORES */
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+/* #undef _LARGEFILE_SOURCE */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+   if it is not supported. */
+/* #undef inline */
+
+/* Define to empty if the C compiler does not understand signed types. */
+/* #undef signed */
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+   code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/pg_config_manual.h b/src/terralib/drivers/PostgreSQL/includepg/pg_config_manual.h
new file mode 100644
index 0000000..f301065
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/pg_config_manual.h
@@ -0,0 +1,229 @@
+/*------------------------------------------------------------------------
+ * PostgreSQL manual configuration settings
+ *
+ * This file contains various configuration symbols and limits.  In
+ * all cases, changing them is only useful in very rare situations or
+ * for developers.	If you edit any of these, be sure to do a *full*
+ * rebuild (and an initdb if noted).
+ *
+ * $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.15 2004/09/10 14:27:37 momjian Exp $
+ *------------------------------------------------------------------------
+ */
+
+/*
+ * Size of a disk block --- this also limits the size of a tuple.  You
+ * can set it bigger if you need bigger tuples (although TOAST should
+ * reduce the need to have large tuples, since fields can be spread
+ * across multiple tuples).
+ *
+ * BLCKSZ must be a power of 2.  The maximum possible value of BLCKSZ
+ * is currently 2^15 (32768).  This is determined by the 15-bit widths
+ * of the lp_off and lp_len fields in ItemIdData (see
+ * include/storage/itemid.h).
+ *
+ * Changing BLCKSZ requires an initdb.
+ */
+#define BLCKSZ	8192
+
+/*
+ * RELSEG_SIZE is the maximum number of blocks allowed in one disk
+ * file.  Thus, the maximum size of a single file is RELSEG_SIZE *
+ * BLCKSZ; relations bigger than that are divided into multiple files.
+ *
+ * RELSEG_SIZE * BLCKSZ must be less than your OS' limit on file size.
+ * This is often 2 GB or 4GB in a 32-bit operating system, unless you
+ * have large file support enabled.  By default, we make the limit 1
+ * GB to avoid any possible integer-overflow problems within the OS.
+ * A limit smaller than necessary only means we divide a large
+ * relation into more chunks than necessary, so it seems best to err
+ * in the direction of a small limit.  (Besides, a power-of-2 value
+ * saves a few cycles in md.c.)
+ *
+ * Changing RELSEG_SIZE requires an initdb.
+ */
+#define RELSEG_SIZE (0x40000000 / BLCKSZ)
+
+/*
+ * XLOG_SEG_SIZE is the size of a single WAL file.	This must be a power of 2
+ * and larger than BLCKSZ (preferably, a great deal larger than BLCKSZ).
+ *
+ * Changing XLOG_SEG_SIZE requires an initdb.
+ */
+#define XLOG_SEG_SIZE	(16*1024*1024)
+
+/*
+ * Maximum number of columns in an index and maximum number of
+ * arguments to a function. They must be the same value.
+ *
+ * The minimum value is 8 (index creation uses 8-argument functions).
+ * There is no specific upper limit, although large values will waste
+ * system-table space and processing time.
+ *
+ * Changing these requires an initdb.
+ */
+#define INDEX_MAX_KEYS		32
+#define FUNC_MAX_ARGS		INDEX_MAX_KEYS
+
+/*
+ * Define this to make libpgtcl's "pg_result -assign" command process
+ * C-style backslash sequences in returned tuple data and convert
+ * PostgreSQL array values into Tcl lists.	CAUTION: This conversion
+ * is *wrong* unless you install the routines in
+ * contrib/string/string_io to make the server produce C-style
+ * backslash sequences in the first place.
+ */
+/* #define TCL_ARRAYS */
+
+/*
+ * User locks are handled totally on the application side as long term
+ * cooperative locks which extend beyond the normal transaction
+ * boundaries.	Their purpose is to indicate to an application that
+ * someone is `working' on an item.  Define this flag to enable user
+ * locks.  You will need the loadable module user-locks.c to use this
+ * feature.
+ */
+#define USER_LOCKS
+
+/*
+ * Define this if you want psql to _always_ ask for a username and a
+ * password for password authentication.
+ */
+/* #define PSQL_ALWAYS_GET_PASSWORDS */
+
+/*
+ * Define this if you want to allow the lo_import and lo_export SQL
+ * functions to be executed by ordinary users.	By default these
+ * functions are only available to the Postgres superuser.	CAUTION:
+ * These functions are SECURITY HOLES since they can read and write
+ * any file that the PostgreSQL server has permission to access.  If
+ * you turn this on, don't say we didn't warn you.
+ */
+/* #define ALLOW_DANGEROUS_LO_FUNCTIONS */
+
+/*
+ * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
+ * maximum usable pathname length is one less).
+ *
+ * We'd use a standard system header symbol for this, if there weren't
+ * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all
+ * defined by different "standards", and often have different values
+ * on the same platform!  So we just punt and use a reasonably
+ * generous setting here.
+ */
+#define MAXPGPATH		1024
+
+/*
+ * PG_SOMAXCONN: maximum accept-queue length limit passed to
+ * listen(2).  You'd think we should use SOMAXCONN from
+ * <sys/socket.h>, but on many systems that symbol is much smaller
+ * than the kernel's actual limit.  In any case, this symbol need be
+ * twiddled only if you have a kernel that refuses large limit values,
+ * rather than silently reducing the value to what it can handle
+ * (which is what most if not all Unixen do).
+ */
+#define PG_SOMAXCONN	10000
+
+/*
+ * You can try changing this if you have a machine with bytes of
+ * another size, but no guarantee...
+ */
+#define BITS_PER_BYTE		8
+
+/*
+ * Preferred alignment for disk I/O buffers.  On some CPUs, copies between
+ * user space and kernel space are significantly faster if the user buffer
+ * is aligned on a larger-than-MAXALIGN boundary.  Ideally this should be
+ * a platform-dependent value, but for now we just hard-wire it.
+ */
+#define ALIGNOF_BUFFER	32
+
+/*
+ * Disable UNIX sockets for those operating system.
+ */
+#if defined(__QNX__) || defined(__BEOS__) || defined(WIN32)
+#undef HAVE_UNIX_SOCKETS
+#endif
+
+/*
+ * Define this if your operating system supports link()
+ */
+#if !defined(__QNX__) && !defined(__BEOS__) && \
+	!defined(WIN32) && !defined(__CYGWIN__)
+#define HAVE_WORKING_LINK 1
+#endif
+
+/*
+ * This is the default directory in which AF_UNIX socket files are
+ * placed.	Caution: changing this risks breaking your existing client
+ * applications, which are likely to continue to look in the old
+ * directory.  But if you just hate the idea of sockets in /tmp,
+ * here's where to twiddle it.  You can also override this at runtime
+ * with the postmaster's -k switch.
+ */
+#define DEFAULT_PGSOCKET_DIR  "/tmp"
+
+/*
+ * The random() function is expected to yield values between 0 and
+ * MAX_RANDOM_VALUE.  Currently, all known implementations yield
+ * 0..2^31-1, so we just hardwire this constant.  We could do a
+ * configure test if it proves to be necessary.  CAUTION: Think not to
+ * replace this with RAND_MAX.	RAND_MAX defines the maximum value of
+ * the older rand() function, which is often different from --- and
+ * considerably inferior to --- random().
+ */
+#define MAX_RANDOM_VALUE  (0x7FFFFFFF)
+
+
+/*
+ *------------------------------------------------------------------------
+ * The following symbols are for enabling debugging code, not for
+ * controlling user-visible features or resource limits.
+ *------------------------------------------------------------------------
+ */
+
+/*
+ * Define this to cause pfree()'d memory to be cleared immediately, to
+ * facilitate catching bugs that refer to already-freed values.  XXX
+ * Right now, this gets defined automatically if --enable-cassert.	In
+ * the long term it probably doesn't need to be on by default.
+ */
+#ifdef USE_ASSERT_CHECKING
+#define CLOBBER_FREED_MEMORY
+#endif
+
+/*
+ * Define this to check memory allocation errors (scribbling on more
+ * bytes than were allocated).	Right now, this gets defined
+ * automatically if --enable-cassert.  In the long term it probably
+ * doesn't need to be on by default.
+ */
+#ifdef USE_ASSERT_CHECKING
+#define MEMORY_CONTEXT_CHECKING
+#endif
+
+/*
+ * Define this to force all parse and plan trees to be passed through
+ * copyObject(), to facilitate catching errors and omissions in
+ * copyObject().
+ */
+/* #define COPY_PARSE_PLAN_TREES */
+
+/*
+ * Enable debugging print statements for lock-related operations.
+ */
+/* #define LOCK_DEBUG */
+
+/*
+ * Enable debugging print statements for WAL-related operations; see
+ * also the wal_debug GUC var.
+ */
+/* #define WAL_DEBUG */
+
+/*
+ * Other debug #defines (documentation, anyone?)
+ */
+/* #define IPORTAL_DEBUG  */
+/* #define HEAPDEBUGALL  */
+/* #define ACLDEBUG */
+/* #define RTDEBUG */
+/* #define GISTDEBUG */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/pg_config_os.h b/src/terralib/drivers/PostgreSQL/includepg/pg_config_os.h
new file mode 100644
index 0000000..de9ff2f
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/pg_config_os.h
@@ -0,0 +1,244 @@
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.42 2004/12/26 19:20:33 tgl Exp $ */
+
+/* undefine and redefine after #include */
+#undef mkdir
+
+#undef ERROR
+#include <windows.h>
+#include <winsock.h>
+#include <process.h>
+#include <signal.h>
+#include <errno.h>
+
+#undef near
+
+/* Must be here to avoid conflicting with prototype in windows.h */
+#define mkdir(a,b)	mkdir(a)
+
+
+#define fsync(a)	_commit(a)
+#define ftruncate(a,b)	chsize(a,b)
+
+#define USES_WINSOCK
+
+/* defines for dynamic linking on Win32 platform */
+#if defined(__MINGW32__) || defined(__CYGWIN__)
+
+#if __GNUC__ && ! defined (__declspec)
+#error You need egcs 1.1 or newer for compiling!
+#endif
+
+#ifdef BUILDING_DLL
+#define DLLIMPORT __declspec (dllexport)
+#else							/* not BUILDING_DLL */
+#define DLLIMPORT __declspec (dllimport)
+#endif
+
+#elif defined(WIN32_CLIENT_ONLY)
+
+#if defined(_DLL)
+#define DLLIMPORT __declspec (dllexport)
+#else							/* not _DLL */
+#define DLLIMPORT __declspec (dllimport)
+#endif
+
+#else							/* not CYGWIN, not MSVC, not MingW */
+
+#define DLLIMPORT
+#endif
+
+/*
+ *	IPC defines
+ */
+#undef HAVE_UNION_SEMUN
+#define HAVE_UNION_SEMUN 1
+
+#define IPC_RMID 256
+#define IPC_CREAT 512
+#define IPC_EXCL 1024
+#define IPC_PRIVATE 234564
+#define IPC_NOWAIT	2048
+#define IPC_STAT 4096
+
+#define EACCESS 2048
+#define EIDRM 4096
+
+#define SETALL 8192
+#define GETNCNT 16384
+#define GETVAL 65536
+#define SETVAL 131072
+#define GETPID 262144
+
+/*
+ *	Shared memory
+ */
+struct shmid_ds
+{
+	int			dummy;
+	int			shm_nattch;
+};
+
+int			shmdt(const void *shmaddr);
+void	   *shmat(int memId, void *shmaddr, int flag);
+int			shmctl(int shmid, int flag, struct shmid_ds * dummy);
+int			shmget(int memKey, int size, int flag);
+
+
+/*
+ *	Semaphores
+ */
+union semun
+{
+	int			val;
+	struct semid_ds *buf;
+	unsigned short *array;
+};
+
+struct sembuf
+{
+	int			sem_flg;
+	int			sem_op;
+	int			sem_num;
+};
+
+int			semctl(int semId, int semNum, int flag, union semun);
+int			semget(int semKey, int semNum, int flags);
+int			semop(int semId, struct sembuf * sops, int flag);
+
+
+/*
+ * Signal stuff
+ */
+#define WEXITSTATUS(w)	(((w) >> 8) & 0xff)
+#define WIFEXITED(w)	(((w) & 0xff) == 0)
+#define WIFSIGNALED(w)	(((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
+#define WTERMSIG(w)		((w) & 0x7f)
+
+#define sigmask(sig) ( 1 << ((sig)-1) )
+
+/* Signal function return values */
+#undef SIG_DFL
+#undef SIG_ERR
+#undef SIG_IGN
+#define SIG_DFL ((pqsigfunc)0)
+#define SIG_ERR ((pqsigfunc)-1)
+#define SIG_IGN ((pqsigfunc)1)
+
+/* Some extra signals */
+#define SIGHUP				1
+#define SIGQUIT				3
+#define SIGTRAP				5
+#define SIGABRT				22	/* Set to match W32 value -- not UNIX
+								 * value */
+#define SIGKILL				9
+#define SIGPIPE				13
+#define SIGALRM				14
+#define SIGSTOP				17
+#define SIGTSTP				18
+#define SIGCONT				19
+#define SIGCHLD				20
+#define SIGTTIN				21
+#define SIGTTOU				22	/* Same as SIGABRT -- no problem, I hope */
+#define SIGWINCH			28
+#define SIGUSR1				30
+#define SIGUSR2				31
+
+struct timezone
+{
+	int			tz_minuteswest; /* Minutes west of GMT.  */
+	int			tz_dsttime;		/* Nonzero if DST is ever in effect.  */
+};
+
+/* for setitimer in backend/port/win32/timer.c */
+#define ITIMER_REAL 0
+struct itimerval
+{
+	struct timeval it_interval;
+	struct timeval it_value;
+};
+int			setitimer(int which, const struct itimerval * value, struct itimerval * ovalue);
+
+
+/*
+ * Supplement to <sys/types.h>.
+ *
+ * Perl already has conflicting defines for uid_t and gid_t.
+ */
+#ifndef PLPERL_HAVE_UID_GID
+typedef int uid_t;
+typedef int gid_t;
+#else
+/* These are redefined by perl. */
+#define uid_t int
+#define gid_t int
+#endif
+typedef long key_t;
+
+#ifdef WIN32_CLIENT_ONLY
+typedef int pid_t;
+#endif
+
+/*
+ * Supplement to <sys/stat.h>.
+ */
+#define lstat(path, sb)	stat((path), (sb))
+
+/*
+ * Supplement to <errno.h>.
+ */
+#undef EAGAIN
+#undef EINTR
+#define EINTR WSAEINTR
+#define EAGAIN WSAEWOULDBLOCK
+#define EMSGSIZE WSAEMSGSIZE
+#define EAFNOSUPPORT WSAEAFNOSUPPORT
+#define EWOULDBLOCK WSAEWOULDBLOCK
+#define ECONNRESET WSAECONNRESET
+#define EINPROGRESS WSAEINPROGRESS
+#define ENOBUFS WSAENOBUFS
+#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+#define ECONNREFUSED WSAECONNREFUSED
+#define EBADFD WSAENOTSOCK
+#define EOPNOTSUPP WSAEOPNOTSUPP
+
+
+/* In backend/port/win32/signal.c */
+extern DLLIMPORT HANDLE pgwin32_signal_event;
+extern HANDLE pgwin32_initial_signal_pipe;
+
+void		pgwin32_signal_initialize(void);
+HANDLE		pgwin32_create_signal_listener(pid_t pid);
+void		pgwin32_dispatch_queued_signals(void);
+void		pg_queue_signal(int signum);
+
+#ifndef FRONTEND
+#define pg_usleep(t) pgwin32_backend_usleep(t)
+void		pgwin32_backend_usleep(long microsec);
+#endif
+
+/* In backend/port/win32/socket.c */
+#ifndef FRONTEND
+#define socket(af, type, protocol) pgwin32_socket(af, type, protocol)
+#define accept(s, addr, addrlen) pgwin32_accept(s, addr, addrlen)
+#define connect(s, name, namelen) pgwin32_connect(s, name, namelen)
+#define select(n, r, w, e, timeout) pgwin32_select(n, r, w, e, timeout)
+#define recv(s, buf, len, flags) pgwin32_recv(s, buf, len, flags)
+#define send(s, buf, len, flags) pgwin32_send(s, buf, len, flags)
+
+SOCKET		pgwin32_socket(int af, int type, int protocol);
+SOCKET		pgwin32_accept(SOCKET s, struct sockaddr * addr, int *addrlen);
+int			pgwin32_connect(SOCKET s, const struct sockaddr * name, int namelen);
+int			pgwin32_select(int nfds, fd_set *readfs, fd_set *writefds, fd_set *exceptfds, const struct timeval * timeout);
+int			pgwin32_recv(SOCKET s, char *buf, int len, int flags);
+int			pgwin32_send(SOCKET s, char *buf, int len, int flags);
+
+const char *pgwin32_socket_strerror(int err);
+int pgwin32_waitforsinglesocket(SOCKET s, int what);
+
+/* in backend/port/win32/security.c */
+extern int	pgwin32_is_admin(void);
+extern int	pgwin32_is_service(void);
+#endif
+
+/* in backend/port/win32/error.c */
+extern void _dosmaperr(unsigned long);
diff --git a/src/terralib/drivers/PostgreSQL/includepg/pgtypes_date.h b/src/terralib/drivers/PostgreSQL/includepg/pgtypes_date.h
new file mode 100644
index 0000000..e360a72
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/pgtypes_date.h
@@ -0,0 +1,27 @@
+#ifndef PGTYPES_DATETIME
+#define PGTYPES_DATETIME
+
+#include <pgtypes_timestamp.h>
+
+typedef long date;
+
+#ifdef __cplusplus
+extern		"C"
+{
+#endif
+
+extern date PGTYPESdate_from_asc(char *, char **);
+extern char *PGTYPESdate_to_asc(date);
+extern date PGTYPESdate_from_timestamp(timestamp);
+extern void PGTYPESdate_julmdy(date, int *);
+extern void PGTYPESdate_mdyjul(int *, date *);
+extern int	PGTYPESdate_dayofweek(date);
+extern void PGTYPESdate_today(date *);
+extern int	PGTYPESdate_defmt_asc(date *, char *, char *);
+extern int	PGTYPESdate_fmt_asc(date, char *, char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif   /* PGTYPES_DATETIME */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/pgtypes_error.h b/src/terralib/drivers/PostgreSQL/includepg/pgtypes_error.h
new file mode 100644
index 0000000..16af617
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/pgtypes_error.h
@@ -0,0 +1,15 @@
+#define PGTYPES_NUM_OVERFLOW		301
+#define PGTYPES_NUM_BAD_NUMERIC		302
+#define PGTYPES_NUM_DIVIDE_ZERO		303
+
+#define PGTYPES_DATE_BAD_DATE		310
+#define PGTYPES_DATE_ERR_EARGS		311
+#define PGTYPES_DATE_ERR_ENOSHORTDATE	312
+#define PGTYPES_DATE_ERR_ENOTDMY	313
+#define PGTYPES_DATE_BAD_DAY		314
+#define PGTYPES_DATE_BAD_MONTH		315
+
+#define PGTYPES_TS_BAD_TIMESTAMP	320
+#define PGTYPES_TS_ERR_EINFTIME		321
+
+#define PGTYPES_INTVL_BAD_INTERVAL	330
diff --git a/src/terralib/drivers/PostgreSQL/includepg/pgtypes_interval.h b/src/terralib/drivers/PostgreSQL/includepg/pgtypes_interval.h
new file mode 100644
index 0000000..6992cf4
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/pgtypes_interval.h
@@ -0,0 +1,30 @@
+#ifndef PGTYPES_INTERVAL
+#define PGTYPES_INTERVAL
+
+typedef struct
+{
+#ifdef HAVE_INT64_TIMESTAMP
+	int64		time;			/* all time units other than months and
+								 * years */
+#else
+	double		time;			/* all time units other than months and
+								 * years */
+#endif
+	long		month;			/* months and years, after time for
+								 * alignment */
+} interval;
+
+#ifdef __cplusplus
+extern		"C"
+{
+#endif
+
+extern interval *PGTYPESinterval_from_asc(char *, char **);
+extern char *PGTYPESinterval_to_asc(interval *);
+extern int	PGTYPESinterval_copy(interval *, interval *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif   /* PGTYPES_INTERVAL */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/pgtypes_numeric.h b/src/terralib/drivers/PostgreSQL/includepg/pgtypes_numeric.h
new file mode 100644
index 0000000..bf38ad8
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/pgtypes_numeric.h
@@ -0,0 +1,68 @@
+#ifndef PGTYPES_NUMERIC
+#define PGTYPES_NUMERIC
+
+#define NUMERIC_POS						0x0000
+#define NUMERIC_NEG						0x4000
+#define NUMERIC_NAN						0xC000
+#define NUMERIC_MAX_PRECISION			1000
+#define NUMERIC_MAX_DISPLAY_SCALE		NUMERIC_MAX_PRECISION
+#define NUMERIC_MIN_DISPLAY_SCALE		0
+#define NUMERIC_MIN_SIG_DIGITS			16
+
+#define DECSIZE 30
+
+typedef unsigned char NumericDigit;
+typedef struct
+{
+	int			ndigits;		/* number of digits in digits[] - can be
+								 * 0! */
+	int			weight;			/* weight of first digit */
+	int			rscale;			/* result scale */
+	int			dscale;			/* display scale */
+	int			sign;			/* NUMERIC_POS, NUMERIC_NEG, or
+								 * NUMERIC_NAN */
+	NumericDigit *buf;			/* start of alloc'd space for digits[] */
+	NumericDigit *digits;		/* decimal digits */
+} numeric;
+
+typedef struct
+{
+	int			ndigits;		/* number of digits in digits[] - can be
+								 * 0! */
+	int			weight;			/* weight of first digit */
+	int			rscale;			/* result scale */
+	int			dscale;			/* display scale */
+	int			sign;			/* NUMERIC_POS, NUMERIC_NEG, or
+								 * NUMERIC_NAN */
+	NumericDigit digits[DECSIZE];		/* decimal digits */
+} decimal;
+
+#ifdef __cplusplus
+extern		"C"
+{
+#endif
+
+numeric    *PGTYPESnumeric_new(void);
+void		PGTYPESnumeric_free(numeric *);
+numeric    *PGTYPESnumeric_from_asc(char *, char **);
+char	   *PGTYPESnumeric_to_asc(numeric *, int);
+int			PGTYPESnumeric_add(numeric *, numeric *, numeric *);
+int			PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
+int			PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
+int			PGTYPESnumeric_div(numeric *, numeric *, numeric *);
+int			PGTYPESnumeric_cmp(numeric *, numeric *);
+int			PGTYPESnumeric_from_int(signed int, numeric *);
+int			PGTYPESnumeric_from_long(signed long int, numeric *);
+int			PGTYPESnumeric_copy(numeric *, numeric *);
+int			PGTYPESnumeric_from_double(double, numeric *);
+int			PGTYPESnumeric_to_double(numeric *, double *);
+int			PGTYPESnumeric_to_int(numeric *, int *);
+int			PGTYPESnumeric_to_long(numeric *, long *);
+int			PGTYPESnumeric_to_decimal(numeric *, decimal *);
+int			PGTYPESnumeric_from_decimal(decimal *, numeric *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif   /* PGTYPES_NUMERIC */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/pgtypes_timestamp.h b/src/terralib/drivers/PostgreSQL/includepg/pgtypes_timestamp.h
new file mode 100644
index 0000000..cbd2c9a
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/pgtypes_timestamp.h
@@ -0,0 +1,33 @@
+#ifndef PGTYPES_TIMESTAMP
+#define PGTYPES_TIMESTAMP
+
+#include <pgtypes_interval.h>
+
+#ifdef HAVE_INT64_TIMESTAMP
+typedef int64 timestamp;
+typedef int64 TimestampTz;
+
+#else
+typedef double timestamp;
+typedef double TimestampTz;
+#endif
+
+#ifdef __cplusplus
+extern		"C"
+{
+#endif
+
+extern timestamp PGTYPEStimestamp_from_asc(char *, char **);
+extern char *PGTYPEStimestamp_to_asc(timestamp);
+extern int	PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *);
+extern int	PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, char *);
+extern void PGTYPEStimestamp_current(timestamp *);
+extern int	PGTYPEStimestamp_defmt_asc(char *, char *, timestamp *);
+extern int  PGTYPEStimestamp_add_interval(timestamp *tin, interval *span, timestamp *tout);
+extern int  PGTYPEStimestamp_sub_interval(timestamp *tin, interval *span, timestamp *tout);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif   /* PGTYPES_TIMESTAMP */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/postgres_ext.h b/src/terralib/drivers/PostgreSQL/includepg/postgres_ext.h
new file mode 100644
index 0000000..3c873cb
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/postgres_ext.h
@@ -0,0 +1,69 @@
+/*-------------------------------------------------------------------------
+ *
+ * postgres_ext.h
+ *
+ *	   This file contains declarations of things that are visible everywhere
+ *	in PostgreSQL *and* are visible to clients of frontend interface libraries.
+ *	For example, the Oid type is part of the API of libpq and other libraries.
+ *
+ *	   Declarations which are specific to a particular interface should
+ *	go in the header file for that interface (such as libpq-fe.h).	This
+ *	file is only for fundamental Postgres declarations.
+ *
+ *	   User-written C functions don't count as "external to Postgres."
+ *	Those function much as local modifications to the backend itself, and
+ *	use header files that are otherwise internal to Postgres to interface
+ *	with the backend.
+ *
+ * $PostgreSQL: pgsql/src/include/postgres_ext.h,v 1.16 2004/08/29 05:06:55 momjian Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef POSTGRES_EXT_H
+#define POSTGRES_EXT_H
+
+/*
+ * Object ID is a fundamental type in Postgres.
+ */
+typedef unsigned int Oid;
+
+#ifdef __cplusplus
+#define InvalidOid		(Oid(0))
+#else
+#define InvalidOid		((Oid) 0)
+#endif
+
+#define OID_MAX  UINT_MAX
+/* you will need to include <limits.h> to use the above #define */
+
+
+/*
+ * NAMEDATALEN is the max length for system identifiers (e.g. table names,
+ * attribute names, function names, etc).  It must be a multiple of
+ * sizeof(int) (typically 4).
+ *
+ * NOTE that databases with different NAMEDATALEN's cannot interoperate!
+ */
+#define NAMEDATALEN 64
+
+
+/*
+ * Identifiers of error message fields.  Kept here to keep common
+ * between frontend and backend, and also to export them to libpq
+ * applications.
+ */
+#define PG_DIAG_SEVERITY		'S'
+#define PG_DIAG_SQLSTATE		'C'
+#define PG_DIAG_MESSAGE_PRIMARY 'M'
+#define PG_DIAG_MESSAGE_DETAIL	'D'
+#define PG_DIAG_MESSAGE_HINT	'H'
+#define PG_DIAG_STATEMENT_POSITION 'P'
+#define PG_DIAG_INTERNAL_POSITION 'p'
+#define PG_DIAG_INTERNAL_QUERY	'q'
+#define PG_DIAG_CONTEXT			'W'
+#define PG_DIAG_SOURCE_FILE		'F'
+#define PG_DIAG_SOURCE_LINE		'L'
+#define PG_DIAG_SOURCE_FUNCTION 'R'
+
+#endif
diff --git a/src/terralib/drivers/PostgreSQL/includepg/sql3types.h b/src/terralib/drivers/PostgreSQL/includepg/sql3types.h
new file mode 100644
index 0000000..66d08b4
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/sql3types.h
@@ -0,0 +1,48 @@
+#ifndef _ECPG_SQL3TYPES_H
+#define _ECPG_SQL3TYPES_H
+
+/* SQL3 dynamic type codes
+ *
+ * Copyright (c) 2000, Christof Petig <christof.petig at wtal.de>
+ *
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/include/sql3types.h,v 1.10 2004/08/29 05:06:59 momjian Exp $
+ */
+
+/* chapter 13.1 table 2: Codes used for SQL data types in Dynamic SQL */
+
+enum
+{
+	SQL3_CHARACTER = 1,
+	SQL3_NUMERIC,
+	SQL3_DECIMAL,
+	SQL3_INTEGER,
+	SQL3_SMALLINT,
+	SQL3_FLOAT,
+	SQL3_REAL,
+	SQL3_DOUBLE_PRECISION,
+	SQL3_DATE_TIME_TIMESTAMP,
+	SQL3_INTERVAL,				/* 10 */
+	SQL3_CHARACTER_VARYING = 12,
+	SQL3_ENUMERATED,
+	SQL3_BIT,
+	SQL3_BIT_VARYING,
+	SQL3_BOOLEAN,
+	SQL3_abstract
+	/* the rest is xLOB stuff */
+};
+
+/* chapter 13.1 table 3: Codes associated with datetime data types in Dynamic SQL */
+
+enum
+{
+	SQL3_DDT_DATE = 1,
+	SQL3_DDT_TIME,
+	SQL3_DDT_TIMESTAMP,
+	SQL3_DDT_TIME_WITH_TIME_ZONE,
+	SQL3_DDT_TIMESTAMP_WITH_TIME_ZONE,
+
+	SQL3_DDT_ILLEGAL			/* not a datetime data type (not part of
+								 * standard) */
+};
+
+#endif   /* !_ECPG_SQL3TYPES_H */
diff --git a/src/terralib/drivers/PostgreSQL/includepg/sqlca.h b/src/terralib/drivers/PostgreSQL/includepg/sqlca.h
new file mode 100644
index 0000000..eae7008
--- /dev/null
+++ b/src/terralib/drivers/PostgreSQL/includepg/sqlca.h
@@ -0,0 +1,66 @@
+#ifndef POSTGRES_SQLCA_H
+#define POSTGRES_SQLCA_H
+
+#ifndef DLLIMPORT
+#if  defined(WIN32) || defined(__CYGWIN__)
+#define DLLIMPORT __declspec (dllimport)
+#else
+#define DLLIMPORT
+#endif   /* __CYGWIN__ */
+#endif   /* DLLIMPORT */
+
+#define SQLERRMC_LEN	70
+
+#ifdef __cplusplus
+extern		"C"
+{
+#endif
+
+struct sqlca_t
+{
+	char		sqlcaid[8];
+	long		sqlabc;
+	long		sqlcode;
+	struct
+	{
+		int			sqlerrml;
+		char		sqlerrmc[SQLERRMC_LEN];
+	}			sqlerrm;
+	char		sqlerrp[8];
+	long		sqlerrd[6];
+	/* Element 0: empty						*/
+	/* 1: OID of processed tuple if applicable			*/
+	/* 2: number of rows processed				*/
+	/* after an INSERT, UPDATE or				*/
+	/* DELETE statement					*/
+	/* 3: empty						*/
+	/* 4: empty						*/
+	/* 5: empty						*/
+	char		sqlwarn[8];
+	/* Element 0: set to 'W' if at least one other is 'W'	*/
+	/* 1: if 'W' at least one character string		*/
+	/* value was truncated when it was			*/
+	/* stored into a host variable.				*/
+
+	/*
+	 * 2: if 'W' a (hopefully) non-fatal notice occurred
+	 */	/* 3: empty */
+	/* 4: empty						*/
+	/* 5: empty						*/
+	/* 6: empty						*/
+	/* 7: empty						*/
+
+	char		sqlstate[5];
+};
+
+struct sqlca_t *ECPGget_sqlca(void);
+
+#ifndef POSTGRES_ECPG_INTERNAL
+#define sqlca (*ECPGget_sqlca())
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/terralib/drivers/PostgreSQL/readme.txt b/src/terralib/drivers/PostgreSQL/readme.txt
old mode 100755
new mode 100644
index 517f5a9..f94a5ae
--- a/src/terralib/drivers/PostgreSQL/readme.txt
+++ b/src/terralib/drivers/PostgreSQL/readme.txt
@@ -1,44 +1,44 @@
-Note to users of PostgreSQL driver:
-===================================
-
-1. The file "TePostgreSQL.h e TePostgreSQL.cpp" contains the especifics routines to access a PostgreSQL Server.
-
-2. This version, makes use of RTree over GiST.
-   So, it will be necessary installing this support, please, look the readme file in your GiST directory in the PostgreSQL contrib directory.
-
-2. The tables for Raster, Polygon, Line, Cell and Point will use a column of type box to allow the use of GiST.
-   An old database version can be upgraded by using TerraView or you can do via TerraLib API, with the 
-   routines in the file "TeUpdateDBVersion.cpp" (directory application):
-   - there are two specific routines to upgrade a existing database: updateDB302To310 and PostgreSQLUpdateDB302To310.
-
-   
-3. Any doubts or problems, please e-mail Gilberto Ribeiro de Queiroz at <gribeiro at dpi.inpe.br>
-
-
-Note to users of PostGIS driver:
-================================
-
-1. The file "TePostGIS.h e TePostGIS.cpp" contains the especifics routines to access a PostgreSQL Server with a installed PostGIS extension.
-
-2.This version, makes use of RTree over GiST.
-  So, it will be necessary installing this support, please, look the readme file in your GiST directory in the PostgreSQL contrib directory.
-
-3. The tables for Raster will use a column of type box to allow the use of R-Tree over GiST.
-   An old database version can be upgraded by using TerraView or you can do via TerraLib API, with the 
-   routines in the file "TeUpdateDBVersion.cpp" (directory application):
-   - there are two specific routines to upgrade a existing database: updateDB302To310 and PostgreSQLUpdateDB302To310.
-
-4. The table for Polygons, Lines, Cells and Points use PostGIS geometry type, so the index used were PostGIS R-Tree over GiST and they will be kept,
-   only raster tables will change.
-
-5. Any doubts or problems, please e-mail Gilberto Ribeiro de Queiroz at <gribeiro at dpi.inpe.br>
-
-
-Note to all users of PostgreSQL and PostGIS drivers:
-====================================================
-
-1. Now, the binary cursor are supporting dates, times and timestamp in binary mode.
-
-2. The files TePGUtils.h, TePGUtils.cpp, TePGInterface.h and TePGInterface.cpp are only for internal use, don't make use of it.
-
-
+Note to users of PostgreSQL driver:
+===================================
+
+1. The file "TePostgreSQL.h e TePostgreSQL.cpp" contains the especifics routines to access a PostgreSQL Server.
+
+2. This version, makes use of RTree over GiST.
+   So, it will be necessary installing this support, please, look the readme file in your GiST directory in the PostgreSQL contrib directory.
+
+2. The tables for Raster, Polygon, Line, Cell and Point will use a column of type box to allow the use of GiST.
+   An old database version can be upgraded by using TerraView or you can do via TerraLib API, with the 
+   routines in the file "TeUpdateDBVersion.cpp" (directory application):
+   - there are two specific routines to upgrade a existing database: updateDB302To310 and PostgreSQLUpdateDB302To310.
+
+   
+3. Any doubts or problems, please e-mail Gilberto Ribeiro de Queiroz at <gribeiro at dpi.inpe.br>
+
+
+Note to users of PostGIS driver:
+================================
+
+1. The file "TePostGIS.h e TePostGIS.cpp" contains the especifics routines to access a PostgreSQL Server with a installed PostGIS extension.
+
+2.This version, makes use of RTree over GiST.
+  So, it will be necessary installing this support, please, look the readme file in your GiST directory in the PostgreSQL contrib directory.
+
+3. The tables for Raster will use a column of type box to allow the use of R-Tree over GiST.
+   An old database version can be upgraded by using TerraView or you can do via TerraLib API, with the 
+   routines in the file "TeUpdateDBVersion.cpp" (directory application):
+   - there are two specific routines to upgrade a existing database: updateDB302To310 and PostgreSQLUpdateDB302To310.
+
+4. The table for Polygons, Lines, Cells and Points use PostGIS geometry type, so the index used were PostGIS R-Tree over GiST and they will be kept,
+   only raster tables will change.
+
+5. Any doubts or problems, please e-mail Gilberto Ribeiro de Queiroz at <gribeiro at dpi.inpe.br>
+
+
+Note to all users of PostgreSQL and PostGIS drivers:
+====================================================
+
+1. Now, the binary cursor are supporting dates, times and timestamp in binary mode.
+
+2. The files TePGUtils.h, TePGUtils.cpp, TePGInterface.h and TePGInterface.cpp are only for internal use, don't make use of it.
+
+
diff --git a/src/terralib/drivers/ado/TeAdoDB.cpp b/src/terralib/drivers/ado/TeAdoDB.cpp
new file mode 100644
index 0000000..f3f3dfa
--- /dev/null
+++ b/src/terralib/drivers/ado/TeAdoDB.cpp
@@ -0,0 +1,4970 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+
+#include <stdio.h>
+#include <direct.h>
+#include <sys/stat.h>
+#include "TeAdoDB.h"
+#include <TeUtils.h>
+#include "TeProject.h"
+
+
+#define CHUNKSIZE	240
+
+
+//colTemp.DefinedSize = 24
+
+
+typedef map<int,TeNode> TeNodeMap;
+
+inline void TESTHR( HRESULT hr )
+{
+	if( FAILED(hr) ) _com_issue_error( hr );
+}
+
+bool ShowDataLink( _bstr_t * bstr_ConnectString )
+{
+	HRESULT		hr;
+	OLEDB::IDataSourceLocatorPtr	p_IDSL= NULL;			// This is the Data Link dialog object
+	ADODB::_ConnectionPtr			p_conn = NULL;			// We need a connection pointer too
+	bool							b_ConnValid = false;
+	
+	try
+	{
+		hr = p_IDSL.CreateInstance( __uuidof( OLEDB::DataLinks ));
+		TESTHR( hr );
+
+		if( *bstr_ConnectString == _bstr_t("") )
+		{
+			p_conn = p_IDSL->PromptNew();
+			if( p_conn != NULL ) b_ConnValid = true;
+			
+		}
+		else 
+		{
+			p_conn.CreateInstance( "ADODB.Connection" );
+			p_conn->ConnectionString = *bstr_ConnectString;
+			IDispatch * p_Dispatch = NULL;
+			p_conn.QueryInterface( IID_IDispatch, (LPVOID*) & p_Dispatch );
+			
+			if( p_IDSL->PromptEdit( &p_Dispatch ))
+				b_ConnValid = true;
+			
+			p_Dispatch->Release();
+		}
+		if( b_ConnValid )
+			*bstr_ConnectString = p_conn->ConnectionString;
+	}
+	catch( _com_error & e )
+	{
+		cout << "\nCom Exception raised\n";
+		cout << "Description : " << (char*) e.Description() << "\n";
+		cout << "Message     : " << (char*) e.ErrorMessage() << "\n";		
+		return false;
+	}
+	catch(...)
+	{
+		return false;
+	}
+
+	return b_ConnValid;
+}
+
+
+string 
+TeAdo::systemDateTimeFormat(string& indAM, string& indPM, string& sepD, string& sepT)
+{
+	string key = "Control Panel\\International";
+	string dateFormat = "sShortDate";	//formato da data d/M/yyyy
+	string timeFormat = "sTimeFormat";	//formato da hora HH:mm:ss
+	string hourFormat = "iTime";		//12 horas (0) ou 24 horas(1)
+	string indicatorAM = "s1159";		//AM
+	string indicatorPM = "s2359";		//PM
+	string dateSeparator = "sDate";		//separador de data
+	string timeSeparator = "sTime";		//separador de hora
+
+	string rdateFormat;
+	string rtimeFormat;
+	string rhourFormat;
+	string rdateSeparator;
+	string rtimeSeparator; 
+	
+	HKEY    hk;
+	DWORD	DataSize = 1024;
+    DWORD   Type = REG_SZ;
+    char    buf[1024];
+    
+    if (RegOpenKeyExA(HKEY_CURRENT_USER, key.c_str(), 0, KEY_READ, &hk) == ERROR_SUCCESS)
+	{
+		memset (buf, 0, 1024);
+		DataSize = 1024;
+		//date format
+		if (RegQueryValueExA(hk, dateFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
+			rdateFormat = buf;
+		
+		memset (buf, 0, 1024);
+		DataSize = 1024;
+		//date separator
+		if (RegQueryValueExA(hk, dateSeparator.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
+			rdateSeparator = buf;
+		
+		memset (buf, 0, 1024);
+		DataSize = 1024;
+		//time format
+		if (RegQueryValueExA(hk, timeFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
+			rtimeFormat = buf;
+		
+		memset (buf, 0, 1024);
+		DataSize = 1024;
+		//hour format
+		if (RegQueryValueExA(hk, hourFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
+			rhourFormat = buf;
+
+		memset (buf, 0, 1024);
+		DataSize = 1024;
+		//indicator AM
+		if (RegQueryValueExA(hk, indicatorAM.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
+			indAM = buf;
+
+		memset (buf, 0, 1024);
+		DataSize = 1024;
+		//indicator PM 
+		if (RegQueryValueExA(hk, indicatorPM.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
+			indPM = buf;
+
+		memset (buf, 0, 1024);
+		DataSize = 1024;
+		//time separator
+		if (RegQueryValueExA(hk, timeSeparator.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
+			rtimeSeparator = buf;
+	}
+	else
+		return "";
+	
+	sepD = rdateSeparator;
+	sepT = rtimeSeparator;
+
+	//DATE
+	//first
+	int pos = rdateFormat.find(rdateSeparator);
+	string firstD = rdateFormat.substr(0,pos);
+	string temp = rdateFormat.substr(pos+1);
+	//second and third
+	pos = temp.find(rdateSeparator);
+	string secondD = temp.substr(0,pos);
+	string thirdD = temp.substr(pos+1);
+
+	//passar para o formato
+	if(firstD.find("a")==0)
+		replace(firstD.begin(), firstD.end(), 97, 89);
+	else if(secondD.find("a")==0)
+		replace(secondD.begin(), secondD.end(),97, 89);
+	else if(thirdD.find("a")==0)
+		replace(thirdD.begin(), thirdD.end(), 97, 89);
+
+	//TIME
+	//first
+	pos = rtimeFormat.find(rtimeSeparator);
+	string firstT = rtimeFormat.substr(0,pos);
+	temp = rtimeFormat.substr(pos+1);
+	//second and third
+	pos = temp.find(rtimeSeparator);
+	string secondT = temp.substr(0,pos);
+	int posEmpth = temp.find(" ");
+	string thirdT;
+	
+	if(posEmpth==-1)
+		thirdT = temp.substr(pos+1);
+	else
+		thirdT = temp.substr(pos+1, (posEmpth-(pos+1)));
+
+	int hFormat = atoi(rhourFormat.c_str());
+
+	//passar para o formato
+	firstT = TeConvertToUpperCase(firstT);
+	secondT = TeConvertToUpperCase(secondT);
+	thirdT = TeConvertToUpperCase(thirdT);
+
+	if((firstT.find("M")==0))
+		replace(firstT.begin(), firstT.end(), 77, 109);
+	else if(secondT.find("M")==0)
+		replace(secondT.begin(), secondT.end(), 77, 109);
+	else if(thirdT.find("M")==0)
+		replace(thirdT.begin(), thirdT.end(), 77, 109);
+		
+	string timef;
+	if(hFormat==0)
+		timef = "sTT";
+	else
+		timef = "";
+
+	string result = TeConvertToUpperCase(firstD) +"s"+ 
+					TeConvertToUpperCase(secondD) +"s"+ 
+					TeConvertToUpperCase(thirdD) +"s"+ 
+					firstT +"s"+ 
+					secondT +"s"+ 
+					thirdT + timef;
+	
+	RegCloseKey (hk);
+	return result;
+}
+
+
+TeAdo::TeAdo()
+{
+    HRESULT hr = CoInitialize(0);
+	dbmsName_ = "Ado";
+	//return system datetime format
+	systemDateTimeFormat_ = systemDateTimeFormat(systemIndAM_, systemIndPM_, systemDateSep_, systemTimeSep_);
+    if(FAILED(hr))
+    {
+        cout << "Can't start COM!? " << endl;
+    }
+}
+
+TeAdo::~TeAdo()
+{
+}
+
+void 
+TeAdo::connection (ADODB::_ConnectionPtr conn)
+{
+	close();
+	connection_ = conn;
+	isConnected_ = true;
+	user_ = _bstr_t(connection_->Properties->GetItem("User Id")->Value);
+	password_ = _bstr_t(connection_->Properties->GetItem("Password")->Value);
+}
+
+bool 
+TeAdo::newDatabase(const string& database, const string& user, const string& password , const string& /* host */, const int& /* port */, bool terralibModel, const std::string& characterSet)
+{
+	_bstr_t	bstr_myConnectString = "";
+
+	if (database.empty())
+		return false;
+
+
+	HKEY hKey;
+    DWORD dwType=REG_SZ;
+	DWORD bufSize = 128;
+	char buf[128];
+
+	if(database.find(".accdb",0)!=string::npos)
+	{
+		if(RegOpenKeyExA(HKEY_CLASSES_ROOT,"Microsoft.ACE.OLEDB.12.0", 0L, KEY_READ, &hKey) == ERROR_SUCCESS)
+		{
+			if (RegQueryValueExA(hKey, "", NULL, &dwType,(LPBYTE)buf, &bufSize) == ERROR_SUCCESS)
+				{
+					connectionString_ = "Provider=";
+					connectionString_ += buf;
+					connectionString_ += ";Data Source=";
+					RegCloseKey(hKey);
+				}
+		}else
+		{
+			isConnected_ = false;
+			RegCloseKey(hKey);
+			errorMessage_ = "The Microsoft Jet Engine ACE OLEDB 12.0 is not installed";
+			return false;
+		}
+
+	}else if( RegOpenKeyExA(HKEY_CLASSES_ROOT, "Microsoft.Jet.OLEDB.4.0", 0L, KEY_READ , &hKey) == ERROR_SUCCESS ||
+			  RegOpenKeyExA(HKEY_CLASSES_ROOT,"Microsoft.Jet.OLEDB.3.51", 0L, KEY_READ, &hKey) == ERROR_SUCCESS)
+    {
+		if (RegQueryValueExA(hKey, "", NULL, &dwType,(LPBYTE)buf, &bufSize) == ERROR_SUCCESS)
+		{
+			connectionString_ = "Provider=";
+			connectionString_ += buf;
+			connectionString_ += ";Data Source=";
+			RegCloseKey(hKey);
+		}
+	}
+	else
+	{
+		isConnected_ = false;
+		RegCloseKey(hKey);
+		errorMessage_ = "The Microsoft Jet Engine 4.0 or 3.51 is not installed";
+		return false;
+	}
+
+	connectionString_ += database;
+
+	try
+	{
+		// Define ADOX object pointers to Catalog (Database)
+		ADOX::_CatalogPtr m_pCatalog  = NULL;
+
+		//Create object instances:
+		m_pCatalog.CreateInstance(__uuidof (ADOX::Catalog));
+
+		//Create Database
+		m_pCatalog->Create(connectionString_.c_str());
+
+		connection_.CreateInstance(__uuidof(ADODB::Connection));
+		bstr_myConnectString = connectionString_.c_str();
+		HRESULT hr  = connection_->Open (bstr_myConnectString,"","",-1);
+		TESTHR( hr );
+		m_pCatalog  = NULL;
+	}
+	catch(_com_error &e)
+	{
+		isConnected_ = false;
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		isConnected_ = false;
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	isConnected_ = true;
+
+	database_= database;
+
+	if(terralibModel)
+	{
+		//create conceptual model
+		if(!this->createConceptualModel())
+			return false;
+	}
+
+	return true;
+}
+
+bool 
+TeAdo::connect (const string& fullDatabaseName)
+{
+	_bstr_t	bstr_myConnectString = "";
+
+	if (fullDatabaseName.empty())
+	{
+		if (!ShowDataLink( &bstr_myConnectString ))
+		{
+			isConnected_ = false;
+			return false;
+		}
+	}
+	
+	HKEY hKey;
+    DWORD dwType=REG_SZ;
+	DWORD bufSize = 128;
+	char buf[128];
+
+	if(fullDatabaseName.find(".accdb",0)!=string::npos)
+	{
+		if(RegOpenKeyExA(HKEY_CLASSES_ROOT,"Microsoft.ACE.OLEDB.12.0", 0L, KEY_READ, &hKey) == ERROR_SUCCESS)
+		{
+			if (RegQueryValueExA(hKey, "", NULL, &dwType,(LPBYTE)buf, &bufSize) == ERROR_SUCCESS)
+				{
+					connectionString_ = "Provider=";
+					connectionString_ += buf;
+					connectionString_ += ";Data Source=";
+					RegCloseKey(hKey);
+				}
+		}else
+		{
+			isConnected_ = false;
+			RegCloseKey(hKey);
+			errorMessage_ = "The Microsoft Jet Engine ACE OLEDB 12.0 is not installed";
+			return false;
+		}
+
+	}else if(RegOpenKeyExA(HKEY_CLASSES_ROOT, "Microsoft.Jet.OLEDB.4.0", 0L, KEY_READ , &hKey) == ERROR_SUCCESS ||
+			 RegOpenKeyExA(HKEY_CLASSES_ROOT,"Microsoft.Jet.OLEDB.3.51", 0L, KEY_READ, &hKey) == ERROR_SUCCESS)
+    {
+		if (RegQueryValueExA(hKey, "", NULL, &dwType,(LPBYTE)buf, &bufSize) == ERROR_SUCCESS)
+		{
+			connectionString_ = "Provider=";
+			connectionString_ += buf;
+			connectionString_ += ";Data Source=";
+			RegCloseKey(hKey);
+		}
+	}
+	else
+	{
+		isConnected_ = false;
+		RegCloseKey(hKey);
+		errorMessage_ = "The Microsoft Jet Engine 4.0 or 3.51 is not installed";
+		return false;
+	}
+
+	connectionString_ += fullDatabaseName;
+	bstr_myConnectString = connectionString_.c_str();
+
+	try
+	{
+		connection_.CreateInstance(__uuidof(ADODB::Connection));
+		HRESULT hr  = connection_->Open (bstr_myConnectString,"","",-1);
+		TESTHR( hr );
+	}
+	catch(_com_error &e)
+	{
+		isConnected_ = false;
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		isConnected_ = false;
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	isConnected_ = true;
+
+	database_ = fullDatabaseName;
+	return true;
+}
+
+
+bool 
+TeAdo::connect (const string& host, const string& user, const string& password, const string& database, int /* port */)
+{
+	char	myConnectString[512] = {0};
+
+
+	if(database.find(".accdb",0)!=string::npos)
+	{
+		sprintf(myConnectString,"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=%s;User Id=%s;Password=%s",
+			    database.c_str(),user.c_str(),password.c_str());
+	}else
+	{
+		sprintf(myConnectString,"provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;User Id=%s;Password=%s",
+			    database.c_str(),user.c_str(),password.c_str());
+	}
+
+	_bstr_t		bstr_myConnectString=myConnectString;
+	try
+	{
+		connection_.CreateInstance(__uuidof(ADODB::Connection));
+		HRESULT hr  = connection_->Open (bstr_myConnectString,"","",-1);
+		TESTHR( hr );
+	}
+	catch(_com_error &e)
+	{
+		isConnected_ = false;
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		isConnected_ = false;
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	isConnected_ = true;
+	database_ = database;
+
+	return true;
+}
+
+
+void 
+TeAdo::close()
+{
+	if (isConnected_)
+	{
+		if(transactionCounter_ > 0)
+		{
+			connection_->RollbackTrans();
+		}
+		connection_->Close();
+	}
+	isConnected_ = false;
+	transactionCounter_ = 0;
+}
+
+bool 
+TeAdo::execute (const string &q)
+{
+	try
+	{
+		long options = ADODB::adCmdText;// || ADODB::adExecuteNoRecords;
+		connection_->Execute(_bstr_t(q.c_str()),NULL, options);
+	}
+	catch(_com_error &e)
+	{
+		
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	return true;
+}
+
+string
+TeAdo::escapeSequence(const string& from)
+{
+	int	fa = 0;
+	string to = from;
+	to.insert(0, " ");
+	string::iterator it = to.begin();
+	while(it != to.end())
+	{
+		int f = to.find("'", fa);
+		if(f > fa)
+		{
+			to.insert(f, "'");
+			fa = f + 2;
+		}
+		else
+			break;
+	}
+	to = to.substr(1);
+	return to;
+}
+
+bool 
+TeAdo::tableExist(const string& table)
+{
+	if (table.empty())
+		return false;
+	ADOX::_CatalogPtr pCatalog = NULL;
+    HRESULT hr = S_OK;
+	try
+	{
+		TESTHR(hr = pCatalog.CreateInstance(__uuidof(ADOX::Catalog)));
+
+// Connect the catalog.
+		pCatalog->PutActiveConnection(_variant_t((IDispatch *)connection_));
+
+		long tableCount = pCatalog->Tables->Count;
+		for(long i = 0; i < tableCount; ++i)
+		{
+			if(pCatalog->Tables->Item[i]->Name == (_bstr_t)table.c_str())
+			{
+				pCatalog = NULL;
+				return true;
+			}
+		}
+		return false;
+	}
+	catch(_com_error &e)
+    {
+		errorMessage_ = e.Description();
+		return false;
+    }
+    catch(...)
+    {
+		errorMessage_ = "Oppps ! ";
+		return false;
+    }
+	return true;
+}
+
+bool
+TeAdo::listTables(vector<string>& tableList)
+{
+	tableList.clear();
+	ADOX::_CatalogPtr pCatalog = NULL;
+	ADOX::_TablePtr pTable = NULL;
+    HRESULT hr = S_OK;
+	_variant_t value;
+	_bstr_t	bbvalue_;
+	try
+	{
+		TESTHR(hr = pCatalog.CreateInstance(__uuidof(ADOX::Catalog)));
+
+		pCatalog->PutActiveConnection(_variant_t((IDispatch *)connection_));
+		int n = pCatalog->Tables->Count;
+		for (int i=0; i<n; i++)
+		{
+			pTable = pCatalog->Tables->GetItem((long)i);
+			value = pTable->Name;
+			if (value.vt != VT_NULL)
+			{
+				bbvalue_ = _bstr_t(value);
+				tableList.push_back(string((char*)bbvalue_));
+			}
+		}
+		pCatalog = NULL;
+		pTable = NULL;
+		return true;
+	}
+	catch(_com_error &e)
+    {
+		errorMessage_ = e.Description();
+		pCatalog = NULL;
+		pTable = NULL;
+		return false;
+    }
+    catch(...)
+    {
+		errorMessage_ = "Oppps ! ";
+		pCatalog = NULL;
+		pTable = NULL;
+		return false;
+    }
+	return true;
+}
+
+bool 
+TeAdo::columnExist(const string& table, const string& column, TeAttribute& attr)
+{
+	if (table.empty())
+	{
+		return false;
+	}
+	if (column.empty())
+	{
+		return false;
+	}
+
+	ADOX::_CatalogPtr pCatalog = NULL;
+	ADOX::_TablePtr pTable = NULL;
+    HRESULT hr = S_OK;
+	try
+	{
+		TESTHR(hr = pCatalog.CreateInstance(__uuidof(ADOX::Catalog)));
+
+// Connect the catalog.
+		pCatalog->PutActiveConnection(_variant_t((IDispatch *)connection_));
+
+// Get the table
+		pTable = pCatalog->Tables->GetItem((_bstr_t)table.c_str ());
+		if (pTable)
+		{
+			ADOX::ColumnsPtr columns = pTable->GetColumns();
+			if(columns == NULL)
+			{
+				pTable = NULL;
+				pCatalog = NULL;
+				return false;
+			}
+			
+			ADOX::_ColumnPtr columnAdo = NULL;
+			bool found = false;
+			for(long i = 0; i < columns->GetCount(); ++i)
+			{
+				columnAdo = columns->GetItem(i);
+				if(columnAdo == NULL)
+				{
+					pTable = NULL;
+					pCatalog = NULL;
+					return false;
+				}
+				if(columnAdo->GetName() == (_bstr_t)column.c_str())
+				{
+					found = true;
+					break;
+				}
+			}			
+			if(!found)
+			{
+				pTable = NULL;
+				pCatalog = NULL;
+				return false;
+			}
+			
+			int nType = columnAdo->GetType();
+			switch (nType)
+			{
+				case ADODB::adBoolean:
+				case ADODB::adNumeric:
+				case ADODB::adInteger:
+				case ADODB::adSmallInt:
+				case ADODB::adTinyInt:
+				case ADODB::adUnsignedInt:
+				case ADODB::adUnsignedSmallInt:
+				case ADODB::adUnsignedTinyInt:
+				case ADODB::adVarNumeric:
+					attr.rep_.type_ = TeINT;
+					break;
+
+				case ADODB::adSingle:
+				case ADODB::adDouble:
+					attr.rep_.type_ = TeREAL;
+					break;
+
+				case ADODB::adDate:
+				case ADODB::adDBDate:
+				case ADODB::adDBTime:
+				case ADODB::adDBTimeStamp:
+					attr.rep_.type_ = TeDATETIME;
+					break;
+
+				case ADODB::adLongVarBinary:
+				case ADODB::adVarBinary:
+				case ADODB::adBinary:
+					attr.rep_.type_ = TeBLOB;
+					break;
+
+				case ADODB::adWChar:
+				case ADODB::adVarChar:
+				case ADODB::adVarWChar:
+				case ADODB::adLongVarWChar: 
+				case ADODB::adLongVarChar:
+				case ADODB::adChar: 
+					attr.rep_.type_ = TeSTRING;
+					break;
+
+				case ADODB::adCurrency: // ??? CURRENCY
+				default :
+					attr.rep_.type_ = TeUNKNOWN;
+					break;
+			}
+			
+			attr.rep_.name_ = columnAdo->GetName();
+			attr.rep_.numChar_ = columnAdo->GetDefinedSize();
+
+			pTable = NULL;
+			pCatalog = NULL;
+			return true;
+		}
+		else
+		{
+			pCatalog = NULL;
+			return false;
+		}
+	}
+	catch(_com_error &e)
+    {
+		errorMessage_ = e.Description();
+		return false;
+    }
+    catch(...)
+    {
+		errorMessage_ = "Oppps ! ";
+		return false;
+    }
+
+	return false;
+	/*ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(table.c_str(),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+	}
+	catch(_com_error &e)
+    {
+		errorMessage_ = e.Description();
+		return false;
+    }
+	try
+	{	
+		ADODB::FieldsPtr ptrFields = NULL;
+		ADODB::FieldPtr ptrField = NULL;
+		ptrFields = recset_->Fields;
+		int ncols = recset_->Fields->Count;
+        for (int i = 0; i < ncols; i++)
+        {
+			_variant_t vCol((long)i);
+ 			ptrFields->get_Item(vCol, &ptrField);
+			string name = ptrField->Name;
+            if (TeStringCompare(name,column,false))
+			{
+				int nType = ptrField->Type;
+				switch (nType)
+				{
+					case ADODB::adBoolean:
+					case ADODB::adNumeric:
+					case ADODB::adInteger:
+					case ADODB::adSmallInt:
+					case ADODB::adTinyInt:
+					case ADODB::adUnsignedInt:
+					case ADODB::adUnsignedSmallInt:
+					case ADODB::adUnsignedTinyInt:
+					case ADODB::adVarNumeric:
+						attr.rep_.type_ = TeINT;
+						break;
+
+					case ADODB::adSingle:
+					case ADODB::adDouble:
+						attr.rep_.type_ = TeREAL;
+						break;
+
+					case ADODB::adDate:
+					case ADODB::adDBDate:
+					case ADODB::adDBTime:
+					case ADODB::adDBTimeStamp:
+						attr.rep_.type_ = TeDATETIME;
+						break;
+
+					case ADODB::adLongVarBinary:
+					case ADODB::adVarBinary:
+					case ADODB::adBinary:
+						attr.rep_.type_ = TeBLOB;
+						break;
+
+					case ADODB::adWChar:
+					case ADODB::adVarChar:
+					case ADODB::adVarWChar:
+					case ADODB::adLongVarWChar: 
+					case ADODB::adLongVarChar:
+					case ADODB::adChar: 
+						attr.rep_.type_ = TeSTRING;
+						break;
+
+					case ADODB::adCurrency: // ??? CURRENCY
+					default :
+						attr.rep_.type_ = TeUNKNOWN;
+						break;
+				}
+				attr.rep_.name_ = ptrField->Name;
+				attr.rep_.numChar_ = ptrField->DefinedSize;
+				recset_->Close();
+				return true;
+		   }
+		}
+	}	  
+	catch(_com_error &e)
+    {
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return false;
+    }
+    catch(...)
+    {
+		recset_->Close();
+		errorMessage_ = "Oppps ! ";
+		return false;
+    }
+	recset_->Close();
+	return false;*/
+}
+
+bool 
+TeAdo::allowEmptyString(const string& tableName, const string& column)
+{
+	if (tableName.empty() || column.empty())
+		return false;
+
+	HRESULT hr = S_OK;
+	ADOX::_CatalogPtr pCatalog = NULL;
+	ADOX::_TablePtr pTable = NULL;
+	
+	try
+	{
+        TESTHR(hr = pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
+		pCatalog->PutActiveConnection(_variant_t((IDispatch *)connection_));
+		pTable = pCatalog->Tables->GetItem((_bstr_t)tableName.c_str());
+
+		pTable->Columns->GetItem(column.c_str())->Properties->GetItem("Jet OLEDB:Allow Zero Length")->Value = true;
+
+		pCatalog->Tables->Refresh();
+		pCatalog = NULL;
+		pTable = NULL;
+	}
+    catch(_com_error &e)
+    {
+		errorMessage_ = e.Description();
+		pCatalog = NULL;
+		pTable = NULL;
+		return false;
+    }
+    catch(...)
+    {
+		errorMessage_ = "Error"; 
+		pCatalog = NULL;
+		pTable = NULL;
+		return false;
+    }
+	return true;
+}
+
+bool
+TeAdo::createTable(const string& table, TeAttributeList &attr)
+{
+	HRESULT hr = S_OK;
+	ADOX::_CatalogPtr pCatalog = NULL;
+	ADOX::_TablePtr pTable = NULL;
+	ADOX::_KeyPtr pKey = NULL; 
+
+	TeAttributeList::iterator it;
+	TeAttributeList validPk;   
+	try
+    { 
+        TESTHR(hr = pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
+        TESTHR(hr = pTable.CreateInstance(__uuidof (ADOX::Table)));
+
+		pCatalog->PutActiveConnection(variant_t((IDispatch *)connection_));
+		pTable->Name=table.c_str();
+		pTable->ParentCatalog = pCatalog;
+		it = attr.begin();
+		while ( it != attr.end() )
+		{
+			string attName = (*it).rep_.name_;
+
+			switch ((*it).rep_.type_)
+  			{
+  				case TeSTRING:
+					if((*it).rep_.numChar_ > 0)
+					{
+						if ((*it).rep_.numChar_<256)
+							pTable->Columns->Append(attName.c_str(), ADOX::adVarWChar,(*it).rep_.numChar_);
+						else
+							pTable->Columns->Append(attName.c_str(), ADOX::adLongVarWChar,(*it).rep_.numChar_);
+					}
+					else
+					{
+						//iSize = 66560; // o n�mero 66560 equivale a 65K
+						pTable->Columns->Append(attName.c_str(), ADOX::adLongVarWChar, 66560);
+					}
+  					break;
+  				
+				case TeREAL:
+					pTable->Columns->Append(attName.c_str(),ADOX::adDouble,sizeof(double));
+  					break;
+  				
+				case TeINT:
+				case TeUNSIGNEDINT:
+					pTable->Columns->Append(attName.c_str(), ADOX::adInteger,0);
+  					break;
+				
+				case TeCHARACTER:
+					pTable->Columns->Append(attName.c_str(), ADOX::adWChar,0);
+					break;
+				
+				case TeDATETIME:
+					pTable->Columns->Append(attName.c_str(), ADOX::adDate,0);
+					break;
+				
+				case TeBLOB:
+					pTable->Columns->Append(attName.c_str(), ADOX::adLongVarBinary,0);
+					break;
+
+				case TeBOOLEAN:
+					pTable->Columns->Append(attName.c_str(), ADOX::adBoolean,0);
+					break;
+				
+				case TePOINTTYPE:
+				case TePOINTSETTYPE:
+				case TeNODETYPE:
+				case TeNODESETTYPE:
+					pTable->Columns->Append("x", ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("y", ADOX::adDouble,sizeof(double));
+					++it;
+					continue;
+				
+				case TeLINE2DTYPE:
+				case TeLINESETTYPE:
+					pTable->Columns->Append("num_coords",ADOX::adInteger,sizeof(int));
+					pTable->Columns->Append("lower_x",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("lower_y",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("upper_x",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("upper_y",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("ext_max",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("spatial_data",ADOX::adLongVarBinary,0);
+					++it;
+					continue;
+				
+				case TePOLYGONTYPE:
+                case TePOLYGONSETTYPE:
+					pTable->Columns->Append("num_coords",ADOX::adInteger,sizeof(int));
+					pTable->Columns->Append("num_holes",ADOX::adInteger,sizeof(int));
+					pTable->Columns->Append("parent_id",ADOX::adInteger,sizeof(int));
+					pTable->Columns->Append("lower_x",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("lower_y",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("upper_x",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("upper_y",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("ext_max",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("spatial_data",ADOX::adLongVarBinary,0);
+					++it;
+					continue;
+
+				case TeCELLTYPE:
+				case TeCELLSETTYPE:
+					pTable->Columns->Append("lower_x",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("lower_y",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("upper_x",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("upper_y",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("col_number",ADOX::adInteger,sizeof(int));
+					pTable->Columns->Append("row_number",ADOX::adInteger,sizeof(int));
+					++it;
+					continue;
+
+				case TeRASTERTYPE:
+					pTable->Columns->Append("lower_x",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("lower_y",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("upper_x",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("upper_y",ADOX::adDouble,sizeof(double));
+					pTable->Columns->Append("band_id", ADOX::adInteger,0);
+					pTable->Columns->Append("resolution_factor", ADOX::adInteger,0);
+					pTable->Columns->Append("subband", ADOX::adInteger,0);
+					pTable->Columns->Append("spatial_data",ADOX::adLongVarBinary,0);
+					pTable->Columns->Append("block_size",ADOX::adInteger,0);
+					++it;
+					continue;
+
+				case TeTEXTTYPE:
+				case TeTEXTSETTYPE:
+				default:
+					pTable->Columns->Append(attName.c_str(), ADOX::adVarWChar,(*it).rep_.numChar_);
+					break;
+  			}
+
+			//auto increment
+			if ((*it).rep_.isAutoNumber_)
+				pTable->Columns->GetItem(attName.c_str())->Properties->GetItem("AutoIncrement")->Value = true;
+
+			//nullable /  a boolean column cannot be nullable
+			if((*it).rep_.null_ && (!(*it).rep_.isPrimaryKey_) && ((*it).rep_.type_ != TeBOOLEAN))
+				pTable->Columns->GetItem(attName.c_str())->Attributes = ADOX::adColNullable;
+
+			// check if column is part of primary key
+			if ((*it).rep_.isPrimaryKey_ && (*it).rep_.type_ != TeBLOB)
+				validPk.push_back((*it));
+			
+			++it;
+		}
+
+		if (!validPk.empty())
+		{
+			TESTHR(hr = pKey.CreateInstance(__uuidof(ADOX::Key)));
+			// To pass as column parameter to Key's Apppend method
+			_variant_t vOptional;
+			vOptional.vt = VT_ERROR;
+			vOptional.scode = DISP_E_PARAMNOTFOUND;
+
+			pKey->Name = (table+"_primkey").c_str();
+			pKey->Type = ADOX::adKeyPrimary;
+			
+			it = validPk.begin();
+			while (it != validPk.end())
+			{
+				switch ((*it).rep_.type_)
+  				{
+  				case TeSTRING:
+					if((*it).rep_.numChar_ > 0)
+					{
+						if((*it).rep_.numChar_<256)
+							pKey->Columns->Append((*it).rep_.name_.c_str(), ADOX::adVarWChar,(*it).rep_.numChar_);
+						else
+							pKey->Columns->Append((*it).rep_.name_.c_str(), ADOX::adLongVarWChar,(*it).rep_.numChar_);
+					}
+					else
+					{
+						//iSize = 66560; // o n�mero 66560 equivale a 65K
+						pKey->Columns->Append((*it).rep_.name_.c_str(), ADOX::adLongVarWChar, 66560);
+					}
+  					break;
+  				case TeREAL:
+					pKey->Columns->Append((*it).rep_.name_.c_str(),ADOX::adDouble,sizeof(double));
+  					break;
+  				case TeINT:
+				case TeUNSIGNEDINT:
+					pKey->Columns->Append((*it).rep_.name_.c_str(), ADOX::adInteger,0);
+  					break;
+				case TeCHARACTER:
+					pKey->Columns->Append((*it).rep_.name_.c_str(), ADOX::adWChar,0);
+					break; 
+				case TeDATETIME:
+					pKey->Columns->Append((*it).rep_.name_.c_str(), ADOX::adDate,0);
+					break;
+				}
+				++it;
+			}
+			validPk.clear();
+			pTable->Keys->Append(_variant_t((IDispatch *)pKey),ADOX::adKeyPrimary,vOptional,L"",L"");
+		}
+		
+		pCatalog->Tables->Append(_variant_t((IDispatch*)pTable));
+		pCatalog->Tables->Refresh();
+
+		it = attr.begin();
+		while ( it != attr.end() )
+		{
+			if (!(*it).rep_.isPrimaryKey_ && (*it).rep_.type_ == TeSTRING)
+				pTable->Columns->GetItem((*it).rep_.name_.c_str())->Properties->GetItem("Jet OLEDB:Allow Zero Length")->Value = true;
+			++it;
+		}
+		pCatalog->Tables->Refresh();
+		pCatalog = NULL;
+		pTable = NULL;
+		pKey = NULL; 
+	}
+    catch(_com_error &e)
+    {
+		errorMessage_ = e.Description();
+		pCatalog = NULL; 
+		pTable = NULL;
+		pKey = NULL; 
+		return false;
+    }
+    catch(...)
+    {
+		errorMessage_ = "Error creating table "+ table;
+		pCatalog = NULL; 
+		pTable = NULL;
+		pKey = NULL; 
+		return false;
+    }
+	return true;
+}
+
+bool 
+TeAdo::deleteColumn (const string& table, const string& colName)
+{
+	ADOX::_CatalogPtr pCatalog = NULL;
+	ADOX::_TablePtr pTable = NULL;
+	
+    HRESULT hr = S_OK;
+	try
+	{
+		TESTHR(hr = pCatalog.CreateInstance(__uuidof(ADOX::Catalog)));
+		
+
+// Connect the catalog.
+		pCatalog->PutActiveConnection(_variant_t((IDispatch *)connection_));
+
+// Get the table
+		pTable = pCatalog->Tables->GetItem((_bstr_t)table.c_str ());
+
+		pTable->Columns->Delete(_variant_t(colName.c_str()));
+
+        pCatalog->Tables->Refresh();
+		pCatalog = NULL; 
+		pTable = NULL;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		pCatalog = NULL; 
+		pTable = NULL;
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error deleting colum " + colName + "of the table " + table;
+		pCatalog = NULL; 
+		pTable = NULL;
+		return false;
+	}
+
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + table + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+	if(tableId.empty() == false)
+	{
+		sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+		sql += " AND related_attr = '" + colName + "')";
+		sql += " OR (external_table_name = '" + table + "'";
+		sql += " AND external_attr = '" + colName + "')";
+		if(execute(sql) == false)
+			return false;
+	}
+	alterTableInfoInMemory(table);
+	return true;
+}
+
+bool 
+TeAdo::addColumn (const string& table, TeAttributeRep &rep)
+{
+	if(!tableExist(table))
+		return false;
+
+	string field = TeGetExtension(rep.name_.c_str());
+	if(field.empty())
+		field = rep.name_;
+
+	string tab;
+	tab = " ALTER TABLE " + table + " ADD ";
+	tab += field + "  ";
+	
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if (rep.numChar_ > 255 || rep.numChar_ == 0)
+				tab += "TEXT ";
+			else
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+			
+		case TeREAL:
+			tab += "FLOAT";	
+			break;
+			
+		case TeINT:
+			tab += "INT";
+			break;
+
+		case TeDATETIME:
+			tab += "DATE";
+			break;
+
+		case TeCHARACTER:
+			tab += "CHAR";
+			break;
+
+		case TeBOOLEAN:
+			tab += "YESNO";
+			break;
+		
+		case TeBLOB:
+			tab = "BLOB ";
+		
+		default:
+			if (rep.numChar_ > 255 || rep.numChar_ == 0)
+				tab += "TEXT ";
+			else
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+	if (rep.isAutoNumber_)
+		tab += " AUTO_INCREMENT ";
+	else
+		tab += " NULL ";
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting a column to table " + table + " !";
+		return false;
+	}
+
+	if (rep.type_ == TeSTRING && !rep.isPrimaryKey_)
+	{
+		HRESULT hr = S_OK;
+		ADOX::_CatalogPtr m_pCatalog   = NULL;
+		try
+		{
+			TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
+ 			m_pCatalog->PutActiveConnection(variant_t((IDispatch *)connection_));
+			ADOX::_ColumnPtr m_pCol = m_pCatalog->Tables->GetItem(table.c_str())->Columns->GetItem(field.c_str());
+
+				m_pCol->Properties->GetItem("Jet OLEDB:Allow Zero Length")->Value = true;
+			m_pCatalog->Tables->Refresh();
+			m_pCatalog = NULL;
+		}
+		catch(_com_error &e)
+		{
+			errorMessage_ = e.Description();
+			m_pCatalog  = NULL;
+			return false;
+		}
+		catch(...)
+		{
+			errorMessage_ = "Error setting column property ";
+			m_pCatalog = NULL;
+			return false;
+		}
+	}
+	alterTableInfoInMemory(table);
+	return true;
+}
+
+bool 
+TeAdo::alterTable (const string& table, TeAttributeRep &rep, const string& oldColName)
+{
+	if(!tableExist(table))
+		return false;
+
+	if(!oldColName.empty() && oldColName != rep.name_)
+	{
+		HRESULT hr = S_OK;
+		ADOX::_CatalogPtr m_pCatalog   = NULL;
+		ADOX::_TablePtr m_pTable  = NULL;
+		ADOX::_ColumnPtr m_pColumn  = NULL;
+		try
+		{
+			TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
+ 			m_pCatalog->PutActiveConnection(variant_t((IDispatch *)connection_));
+
+			m_pTable= m_pCatalog->Tables->GetItem(table.c_str());
+			m_pColumn = m_pTable->Columns->GetItem(oldColName.c_str()); 
+			m_pColumn->Name = rep.name_.c_str();
+			m_pCatalog->Tables->Refresh();								// Refresh the database.
+			m_pCatalog = NULL;
+			m_pTable  = NULL;
+		}
+		catch(_com_error &e)
+		{
+ 			errorMessage_ = e.Description();
+			m_pCatalog   = NULL;
+			m_pTable  = NULL;
+			return false;
+		}
+
+		catch(...)
+		{
+			errorMessage_ = "Error alter table";
+			m_pCatalog   = NULL;
+			m_pTable  = NULL;
+			return false;
+		}
+	}
+
+	string tab = " ALTER TABLE " + table + " ALTER COLUMN ";
+	tab += rep.name_ + "  ";
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if (rep.numChar_ > 255 || rep.numChar_ == 0)
+				tab += "TEXT ";
+			else
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+		
+		case TeREAL:
+			tab += "FLOAT";	
+			break;
+		
+		case TeINT:
+			tab += "INT";
+			break;
+
+		case TeDATETIME:
+			tab += "DATE";
+			break;
+
+		case TeCHARACTER:
+			tab += "CHAR";
+			break;
+
+		case TeBOOLEAN:
+			tab += "YESNO";
+			break;
+
+		
+		default:
+			if (rep.numChar_ > 255 || rep.numChar_ == 0)
+				tab += "TEXT ";
+			else
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+
+	tab += " NULL ";
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error alter table " + table + " !";
+		return false;
+	}
+	
+	if (rep.type_ == TeSTRING)  // Allow Zero Length
+	{
+		HRESULT hr = S_OK;
+		ADOX::_CatalogPtr m_pCatalog   = NULL;
+		ADOX::_TablePtr m_pTable  = NULL;
+		try
+		{
+			TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
+ 			m_pCatalog->PutActiveConnection(variant_t((IDispatch *)connection_));
+
+			m_pTable= m_pCatalog->Tables->GetItem(table.c_str());
+			if (!rep.isPrimaryKey_ && rep.type_ == TeSTRING)
+				m_pTable->Columns->GetItem(rep.name_.c_str())->Properties->GetItem("Jet OLEDB:Allow Zero Length")->Value = true;
+			m_pCatalog   = NULL;
+			m_pTable  = NULL;
+		}
+		catch(_com_error &e)
+		{
+			errorMessage_ = e.Description();
+			m_pCatalog   = NULL;
+			m_pTable  = NULL;
+			return false;
+		}
+
+		catch(...)
+		{
+			errorMessage_ = "Error alter table";
+			m_pCatalog   = NULL;
+			m_pTable  = NULL;
+			return false;
+		}
+	}
+		
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + table + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+
+	if(tableId.empty() == false)
+	{
+		if(oldColName.empty() == false) // column name changed
+		{
+			 // update relation
+			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
+			sql += " WHERE related_table_id = " + tableId;
+			sql += " AND related_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
+			sql += " WHERE external_table_name = '" + table + "'";
+			sql += " AND external_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			 // update grouping
+			sql = "UPDATE te_grouping SET grouping_attr = '" + table + "." + rep.name_ + "'";
+			sql += " WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+		else // column type changed
+		{
+			// delete relation
+			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+			sql += " AND related_attr = '" + rep.name_ + "')";
+			sql += " OR (external_table_name = '" + table + "'";
+			sql += " AND external_attr = '" + rep.name_ + "')";
+			if(execute(sql) == false)
+				return false;
+
+			// delete grouping
+			TeDatabasePortal* portal = getPortal();
+			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(portal->query(sql) && portal->fetchRow())
+			{
+				string themeId = portal->getData(0);
+
+				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
+				if(execute(sql) == false)
+				{
+					delete portal;
+					return false;
+				}
+			}
+			delete portal;
+
+			sql = "DELETE FROM te_grouping";
+			sql += " WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+	}
+	alterTableInfoInMemory(table);
+	return true;
+}
+
+bool 
+TeAdo::alterTable (const string& oldTableName, const string& newTableName)
+{
+	if(!tableExist(oldTableName))
+		return false;
+
+	HRESULT hr = S_OK;
+	ADOX::_CatalogPtr m_pCatalog   = NULL;
+	ADOX::_TablePtr m_pTable  = NULL;
+	try
+	{
+		TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
+ 		m_pCatalog->PutActiveConnection(variant_t((IDispatch *)connection_));
+
+		m_pTable= m_pCatalog->Tables->GetItem(oldTableName.c_str());
+		m_pTable->Name = newTableName.c_str();
+		m_pCatalog->Tables->Refresh();								// Refresh the database.
+		m_pCatalog = NULL;
+		m_pTable  = NULL;
+	}
+	catch(_com_error &e)
+	{
+ 		errorMessage_ = e.Description();
+		m_pCatalog = NULL;
+		m_pTable  = NULL;
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error alter table";
+		m_pCatalog = NULL;
+		m_pTable  = NULL;
+		return false;
+	}
+	
+	//update te_layer_table
+	string sql = " UPDATE te_layer_table ";
+	sql += " SET attr_table = '"+ newTableName +"'";
+	sql += " WHERE attr_table = '"+ oldTableName +"'";
+	execute(sql);
+
+	//update te_tables_relation
+	sql = " UPDATE te_tables_relation ";
+	sql += " SET external_table_name = '"+ newTableName +"'";
+	sql += " WHERE external_table_name = '"+ oldTableName +"'";
+	execute(sql);
+	
+	alterTableInfoInMemory(newTableName, oldTableName);
+	return true;
+}
+
+bool
+TeAdo::createRelation (const string& relationName, 
+					   const string& foreignTbl, 
+					   const string& FTKey, 
+					   const string& relatedTbl, 
+					   const string& RTKey, 
+					   bool cascadeDeletion)
+{
+	HRESULT hr = S_OK;
+	ADOX::_KeyPtr pKeyForeign = NULL; 
+    ADOX::_CatalogPtr pCatalog   = NULL;
+    try
+    {
+        TESTHR(hr = pKeyForeign.CreateInstance(__uuidof(ADOX::Key)));
+        TESTHR(hr = pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
+ 		pCatalog->PutActiveConnection(_variant_t((IDispatch *)connection_));
+
+        // Define the foreign key.
+        pKeyForeign->Name = relationName.c_str();
+        pKeyForeign->Type = ADOX::adKeyForeign;
+        pKeyForeign->RelatedTable = relatedTbl.c_str();
+
+		// Append all columns that compose the foreign key
+		vector<string> FTCols, RTCols;
+		if (TeSplitString(FTKey, ",",FTCols) == TeSplitString(RTKey, ",",RTCols))
+		{
+			vector<string>::iterator FTit, RTit;
+			FTit = FTCols.begin();
+			RTit = RTCols.begin();
+			while (FTit != FTCols.end())
+			{
+				pKeyForeign->Columns->Append((*FTit).c_str(),ADOX::adVarWChar,0);
+				pKeyForeign->Columns->GetItem((*FTit).c_str())->RelatedColumn = (*RTit).c_str();
+				FTit++;
+				RTit++;
+			}
+		}
+
+        if (cascadeDeletion)
+			pKeyForeign->DeleteRule = ADOX::adRICascade;
+
+        // To pass as column parameter to Key's Apppend method
+        _variant_t vOptional;
+        vOptional.vt = VT_ERROR;
+        vOptional.scode = DISP_E_PARAMNOTFOUND;
+
+        // Append the foreign key.
+        pCatalog->Tables->GetItem(foreignTbl.c_str())->Keys->
+            Append(_variant_t((IDispatch *)pKeyForeign),
+            ADOX::adKeyPrimary,vOptional,L"",L"");
+		pCatalog   = NULL;
+	}
+    catch(_com_error &e)
+    {
+		int count = connection_->GetErrors()->GetCount();
+		if(count > 0)
+		{
+			errorMessage_ = (std::string)connection_->GetErrors()->GetItem(0)->GetDescription();
+		}
+		
+		pCatalog   = NULL;
+		return false;
+	}
+
+    catch(...)
+    {
+		errorMessage_ = "Error creating foreign key on table " + foreignTbl;
+		pCatalog   = NULL;
+		return false;
+    }
+	return true;
+}
+
+
+TeDBRelationType 
+TeAdo::existRelation(const string& tableName, const string& relName)
+{
+    HRESULT hr = S_OK;
+
+    ADOX::_CatalogPtr m_pCatalog   = NULL;
+	ADOX::_TablePtr m_pTable  = NULL;
+    ADOX::_KeyPtr m_pKey = NULL; 
+
+    try
+    {
+        TeDBRelationType resultRelType = TeNoRelation;
+		TESTHR(hr = m_pKey.CreateInstance(__uuidof(ADOX::Key)));
+        TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
+ 		m_pCatalog->PutActiveConnection(variant_t((IDispatch *)connection_));
+
+        m_pTable= m_pCatalog->Tables->GetItem(tableName.c_str());
+		m_pKey = m_pTable->Keys->GetItem(relName.c_str());
+		if (m_pKey)
+		{
+			if (m_pKey->DeleteRule == ADOX::adRICascade)
+			   resultRelType = TeRICascadeDeletion;
+			else
+				resultRelType = TeRINoCascadeDeletion;
+		}
+		
+		m_pCatalog   = NULL;
+		m_pTable  = NULL;
+		return resultRelType;
+	}
+    catch(...)
+    {
+		m_pCatalog   = NULL;
+		m_pTable  = NULL;
+		return TeNoRelation;
+    }
+}
+
+
+TeDatabasePortal*  
+TeAdo::getPortal ()
+{
+	TeAdoPortal* portal = new TeAdoPortal (this);
+	return portal;
+}
+
+bool
+TeAdo::insertProjection(TeProjection* proj)
+{
+	
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("te_projection",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+			recset_->AddNew();
+
+		TeProjectionParams par = proj->params();
+	
+		recset_->Fields->GetItem("long0")->Value = (_variant_t) (par.lon0*TeCRD);
+		recset_->Fields->GetItem("lat0")->Value = (_variant_t) (par.lat0*TeCRD);
+		recset_->Fields->GetItem("offx")->Value = (_variant_t) (par.offx);
+		recset_->Fields->GetItem("offy")->Value = (_variant_t) (par.offy);
+		recset_->Fields->GetItem("stlat1")->Value = (_variant_t) (par.stlat1*TeCRD);
+		recset_->Fields->GetItem("stlat2")->Value = (_variant_t) (par.stlat2*TeCRD);
+		recset_->Fields->GetItem("scale")->Value = (_variant_t) (par.scale);
+		recset_->Fields->GetItem("hemis")->Value = (_variant_t) ((long)par.hemisphere);
+		recset_->Fields->GetItem("radius")->Value = (_variant_t) (proj->datum().radius());
+		recset_->Fields->GetItem("flattening")->Value = (_variant_t) (proj->datum().flattening());
+		recset_->Fields->GetItem("dx")->Value = (_variant_t) (proj->datum().xShift());
+		recset_->Fields->GetItem("dy")->Value = (_variant_t) (proj->datum().yShift());
+		recset_->Fields->GetItem("dz")->Value = (_variant_t) (proj->datum().zShift());
+
+		recset_->Fields->GetItem("name")->Value = (_bstr_t) (proj->name().c_str());
+		recset_->Fields->GetItem("unit")->Value = (_bstr_t) (par.units.c_str());
+		recset_->Fields->GetItem("datum")->Value = (_bstr_t) (proj->datum().name().c_str());
+		recset_->Update();
+		_variant_t newID;
+		newID = recset_->GetCollect("projection_id");
+		int id = newID.intVal;
+		proj->id(id);
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertRelationInfo(const int tableId, const string& tField,
+						  const string& eTable,  const string& eField, int& relId)
+{
+	if(tableId < 0)
+	{
+		return false;
+	}
+
+	// check if relation already exists
+	TeAdoPortal* portal = (TeAdoPortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	relId = -1;
+	string sel = "SELECT relation_id FROM te_tables_relation WHERE";
+	sel += " related_table_id = " + Te2String(tableId);
+	sel += " AND related_attr = '" + tField + "'";
+	sel += " AND external_table_name = '" + eTable + "'";
+	sel += " AND external_attr = '" + eField + "'";
+
+	if (!portal->query(sel))
+	{
+		delete portal;
+		return false;
+	}
+
+	if (portal->fetchRow())
+	{
+		relId = atoi(portal->getData(0));
+		delete portal;
+		return true;
+	}
+
+	delete portal;
+	try
+	{
+		ADODB::_RecordsetPtr recset_;
+		recset_.CreateInstance(__uuidof(ADODB::Recordset));
+
+		recset_->Open("te_tables_relation",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+			recset_->AddNew();
+		recset_->Fields->GetItem("related_table_id")->Value =  (_variant_t) ((long)tableId);
+		recset_->Fields->GetItem("related_attr")->Value = (_bstr_t) tField.c_str();
+		recset_->Fields->GetItem("external_table_name")->Value = (_bstr_t) eTable.c_str();
+		recset_->Fields->GetItem("external_attr")->Value = (_bstr_t) eField.c_str();
+		recset_->Update();
+
+		_variant_t newID = recset_->GetCollect("relation_id");
+		relId =  newID.intVal;
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertTableInfo(int layerId, TeTable &table, const string& user)
+{
+	if (table.name().empty())
+		return false;
+
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		// if table is not in the layer tables metadata include it
+		if (table.id() <= 0)
+		{
+			recset_->Open("te_layer_table",
+				_variant_t((IDispatch*)connection_,true),
+				ADODB::adOpenKeyset,
+				ADODB::adLockOptimistic,
+				ADODB::adCmdTable);
+				recset_->AddNew();
+
+			if (layerId > 0)
+				recset_->Fields->GetItem("layer_id")->Value = (_variant_t) ((long)layerId);
+
+			recset_->Fields->GetItem("attr_table")->Value = (_bstr_t) table.name().c_str ();
+			
+			if (!table.uniqueName().empty())
+				recset_->Fields->GetItem("unique_id")->Value = (_bstr_t) table.uniqueName().c_str();
+
+			if (!table.linkName().empty())
+				recset_->Fields->GetItem("attr_link")->Value = (_bstr_t) table.linkName().c_str();
+						
+			if (!table.attInitialTime().empty())
+				recset_->Fields->GetItem("attr_initial_time")->Value = (_bstr_t) table.attInitialTime().c_str();
+			
+			if (!table.attFinalTime().empty())
+				recset_->Fields->GetItem("attr_final_time")->Value = (_bstr_t) table.attFinalTime().c_str();
+
+			recset_->Fields->GetItem("attr_time_unit")->Value = (_variant_t) ((long)table.attTimeUnit());
+			recset_->Fields->GetItem("attr_table_type")->Value = (_variant_t) ((long)table.tableType());
+			if (!user.empty())
+				recset_->Fields->GetItem("user_name")->Value = (_bstr_t) user.c_str ();
+
+			recset_->Update();
+			_variant_t newID;
+			newID = recset_->GetCollect("table_id");
+			int id = newID.intVal;
+			table.setId(id);
+			recset_->Close();
+			return true;
+		}
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertView (TeView *view)
+{
+	// save it�s projection
+	TeProjection* proj = view->projection();
+	if ( !proj || !insertProjection(proj))
+	{
+		errorMessage_ = "N�o � poss�vel inserir vista sem proje��o!";
+		return false;
+	}
+
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("te_view",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+			recset_->AddNew();
+
+		recset_->Fields->GetItem("name")->Value = (_bstr_t) (view->name().c_str());
+		recset_->Fields->GetItem("user_name")->Value = (_bstr_t) (view->user().c_str());
+		recset_->Fields->GetItem("projection_id")->Value = (_bstr_t) ((long) proj->id());
+		recset_->Fields->GetItem("visibility")->Value = (_variant_t) ((long)view->isVisible());
+		recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (view->getCurrentBox().lowerLeft().x());
+		recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (view->getCurrentBox().lowerLeft().y());
+		recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (view->getCurrentBox().upperRight().x());
+		recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (view->getCurrentBox().upperRight().y());
+		if(view->getCurrentTheme() > 0)
+			recset_->Fields->GetItem("current_theme")->Value = (_variant_t) ((long)view->getCurrentTheme());
+		recset_->Update();
+		_variant_t newID;
+		newID = recset_->GetCollect("view_id");
+		view->id(newID.intVal);
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return 0;
+	}
+
+	for (unsigned int th=0; th<view->size(); th++)
+	{
+		TeViewNode* node = view->get (th);
+		if (node->type() == TeTHEME)
+		{
+			TeTheme *theme = (TeTheme*) node;
+			insertTheme (theme);
+		}
+		else
+		{
+			TeViewTree* tree = (TeViewTree*)node;
+			insertViewTree (tree);
+		}
+	}
+	// Insert view in the view map
+	viewMap()[view->id()] = view;
+	return true;
+}
+
+bool 
+TeAdo::insertTheme (TeAbstractTheme *theme)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("te_theme",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+		recset_->AddNew();
+		recset_->Fields->GetItem("view_id")->Value = (_variant_t) ((long)theme->view());
+		recset_->Fields->GetItem("name")->Value = (_bstr_t) (theme->name().c_str ());
+		recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)theme->parentId());
+		recset_->Fields->GetItem("priority")->Value = (_variant_t) ((long)theme->priority());
+		recset_->Fields->GetItem("node_type")->Value = (_variant_t) ((long)theme->type());
+		recset_->Fields->GetItem("min_scale")->Value = (_variant_t) (TeRoundD(theme->minScale(),15));
+		recset_->Fields->GetItem("max_scale")->Value = (_variant_t) (TeRoundD(theme->maxScale(),15));
+		
+		if(!theme->attributeRest().empty())
+			recset_->Fields->GetItem("generate_attribute_where")->Value = (_bstr_t) (theme->attributeRest().c_str());
+		if(!theme->spatialRest().empty())
+			recset_->Fields->GetItem("generate_spatial_where")->Value = (_bstr_t) (theme->spatialRest().c_str());
+		if(!theme->temporalRest().empty())
+			recset_->Fields->GetItem("generate_temporal_where")->Value = (_bstr_t) (theme->temporalRest().c_str());
+				
+		recset_->Fields->GetItem("visible_rep")->Value = (_variant_t) ((long)theme->visibleRep());
+		recset_->Fields->GetItem("enable_visibility")->Value = (_variant_t) ((long)theme->visibility());
+
+		recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(theme->box().x1(),15));
+		recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(theme->box().y1(),15));
+		recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(theme->box().x2(),15));
+		recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(theme->box().y2(),15));
+		recset_->Fields->GetItem("creation_time")->Value = (_bstr_t) (theme->getCreationTime().getDateTime(systemDateTimeFormat_, systemDateSep_, systemTimeSep_, systemIndPM_, systemIndAM_).c_str());
+
+		if(theme->type()==TeTHEME)
+		{
+			recset_->Fields->GetItem("layer_id")->Value = (_variant_t) ((long)static_cast<TeTheme*>(theme)->layerId());
+			if(!static_cast<TeTheme*>(theme)->collectionTable().empty())
+				recset_->Fields->GetItem("collection_table")->Value = (_bstr_t) (static_cast<TeTheme*>(theme)->collectionTable().c_str());
+		}
+		
+		recset_->Update();
+		_variant_t newID;
+		newID = recset_->GetCollect("theme_id");
+		theme->id(newID.intVal);
+
+		if((theme->type()==TeTHEME || theme->type()==TeEXTERNALTHEME) && static_cast<TeTheme*>(theme)->collectionTable().empty())
+		{
+			string name = "te_collection_" + Te2String(theme->id());
+			static_cast<TeTheme*>(theme)->collectionTable(name);
+			recset_->Fields->GetItem("collection_table")->Value = (_bstr_t) (name.c_str());
+		}
+		if(theme->parentId() == 0)
+		{
+			theme->parentId(theme->id());
+			recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)theme->parentId());			
+		}
+
+		recset_->Update();
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+
+	// insert grouping
+	int numSlices = 0;
+	if(theme->grouping().groupMode_ != TeNoGrouping)
+	{
+		if(!insertGrouping (theme->id(), theme->grouping()))
+			return false;
+		numSlices = theme->grouping().groupNumSlices_;
+	}
+		
+	// insert legend
+	theme->outOfCollectionLegend().group(-1); 
+	theme->outOfCollectionLegend().theme(theme->id()); 
+	if (!insertLegend (&(theme->outOfCollectionLegend()))) 
+		return false;
+
+	theme->withoutDataConnectionLegend().group(-2); 
+	theme->withoutDataConnectionLegend().theme(theme->id()); 
+	if (!insertLegend (&(theme->withoutDataConnectionLegend()))) 
+		return false;
+
+	theme->defaultLegend().group(-3); 
+	theme->defaultLegend().theme(theme->id()); 
+	if (!insertLegend (&(theme->defaultLegend()))) 
+		return false;
+
+	theme->pointingLegend().group(-4); 
+	theme->pointingLegend().theme(theme->id()); 
+	if (!insertLegend (&(theme->pointingLegend()))) 
+		return false;
+
+	theme->queryLegend().group(-5); 
+	theme->queryLegend().theme(theme->id()); 
+	if (!insertLegend(&(theme->queryLegend()))) 
+		return false;
+
+	theme->queryAndPointingLegend().group(-6); 
+	theme->queryAndPointingLegend().theme(theme->id()); 
+	if (!insertLegend (&(theme->queryAndPointingLegend())))
+		return false;
+
+	for (int i = 0; i < numSlices; ++i)
+	{
+		theme->legend()[i].group(i);
+		theme->legend()[i].theme(theme->id());
+		if (!insertLegend (&(theme->legend()[i])))
+			return false;
+	}
+
+    //insert metadata theme
+	if(!theme->saveMetadata(this))
+		return false;
+	
+	themeMap()[theme->id()] = theme;
+	
+	if(theme->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(theme)))
+		return false; 
+
+	//save in the database particular attributes of each theme type
+	return true;
+}
+
+bool 
+TeAdo::insertThemeGroup (TeViewTree* tree)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("te_theme",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+		recset_->AddNew();
+		recset_->Fields->GetItem("name")->Value = (_bstr_t) (tree->name().c_str());
+		recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)tree->parentId());
+		recset_->Fields->GetItem("node_type")->Value = (_variant_t) ((long)1);
+		recset_->Fields->GetItem("view_id")->Value = (_variant_t) ((long)tree->view());
+		recset_->Fields->GetItem("priority")->Value = (_variant_t) ((long)tree->priority());
+
+		recset_->Update();
+		_variant_t newID;
+		newID = recset_->GetCollect("theme_id");
+		tree->id(newID.intVal);
+
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeAdo::insertThemeTable	(int themeId, int tableId, int relationId, int tableOrder)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("te_theme_table",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+		recset_->AddNew();
+		recset_->Fields->GetItem("theme_id")->Value = (_variant_t) ((long)themeId);
+		recset_->Fields->GetItem("table_id")->Value = (_variant_t) ((long)tableId);
+		
+		if(relationId > 0)
+			recset_->Fields->GetItem("relation_id")->Value = (_variant_t) ((long)relationId);
+		
+		recset_->Fields->GetItem("table_order")->Value = (_variant_t) ((long)tableOrder);
+
+		recset_->Update();
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	return true;
+}
+
+
+bool 
+TeAdo::insertViewTree (TeViewTree *tree)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("te_theme",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+		recset_->AddNew();
+
+		recset_->Fields->GetItem("name")->Value = (_bstr_t) (tree->name().c_str ());
+		recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)tree->parentId());
+		recset_->Fields->GetItem("node_type")->Value = (_variant_t) ((long)tree->type());
+		recset_->Fields->GetItem("view_id")->Value = (_variant_t) ((long)tree->view());
+		recset_->Fields->GetItem("priority")->Value = (_variant_t) ((long)tree->priority());
+
+		recset_->Update();
+		_variant_t newID;
+		newID = recset_->GetCollect("theme_id");
+		tree->id(newID.intVal);
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	return true;
+}
+
+bool TeAdo::insertProject(TeProject *project)
+{
+	if (!project)
+		return false;
+	_variant_t newID;
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("te_project",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+
+		recset_->AddNew();
+		recset_->Fields->GetItem("name")->Value = (_bstr_t) (project->name().c_str());
+		recset_->Fields->GetItem("description")->Value = (_bstr_t) (project->description().c_str());
+		recset_->Fields->GetItem("current_view")->Value = (_variant_t) ((long)project->getCurrentViewId());
+		recset_->Update();
+		newID = recset_->GetCollect("project_id");
+		project->setId(newID.intVal);
+		recset_->Close();		
+		projectMap()[project->id()] = project;
+		for (unsigned int i=0; i<project->getViewVector().size(); i++)
+			insertProjectViewRel(project->id(), project->getViewVector()[i]);
+		return true;
+
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+}
+bool 
+TeAdo::updateBBox(const string& tableName, const string& idName, int idValue, const TeBox& box)
+{
+	TeAdoPortal* portal = (TeAdoPortal*) this->getPortal();
+	if (!portal)
+		return false;
+	try
+	{
+		string q ="SELECT * FROM "+tableName;
+		q += " WHERE "+idName+" = " + Te2String(idValue);
+		if (!portal->query (q) || !portal->fetchRow())
+		{
+			delete portal;
+			return false;
+		}
+		
+		portal->recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(box.x1(),15));
+		portal->recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(box.y1(),15));
+		portal->recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(box.x2(),15));
+		portal->recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(box.y2(),15));
+		portal->recset_->Update();
+		portal->recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		delete portal;
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		delete portal;
+		return false;
+	}
+	delete portal;
+	return true;
+}
+
+bool 
+TeAdo::updateLayerBox(TeLayer* layer)
+{
+	if (!layer)
+		return false;
+	return TeAdo::updateBBox("te_layer", "layer_id", layer->id(), layer->box());
+}
+
+bool 
+TeAdo::updateLayer(TeLayer* layer)
+{
+	if (!layer)
+		return false;
+	TeAdoPortal* portal = (TeAdoPortal*) this->getPortal();
+	if (!portal)
+		return false;
+	try
+	{
+		string q ="SELECT * FROM te_layer";
+		q += " WHERE layer_id = " + Te2String(layer->id());
+
+		if (!portal->query(q) || !portal->fetchRow())
+		{
+			delete portal;
+			return false;
+		}
+		if (layer->projection())
+			portal->recset_->Fields->GetItem("projection_id")->Value = (_variant_t) ((long)layer->projection()->id());
+		portal->recset_->Fields->GetItem("name")->Value = (_bstr_t) (layer->name().c_str());
+		portal->recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(layer->box().x1(),15));
+		portal->recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(layer->box().y1(),15));
+		portal->recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(layer->box().x2(),15));
+		portal->recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(layer->box().y2(),15));
+
+		if(layer->getEditionTime().isValid())
+		{
+			portal->recset_->Fields->GetItem("edition_time")->Value = (_bstr_t) (layer->getEditionTime().getDateTime(systemDateTimeFormat_, systemDateSep_, systemTimeSep_, systemIndPM_, systemIndAM_).c_str());
+		}
+
+		portal->recset_->Update();
+		portal->recset_->Close();
+		if (layer->projection())
+			updateProjection(layer->projection());
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		delete portal;
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		delete portal;
+		return false;
+	}
+	delete portal;
+	return true;
+}
+
+bool TeAdo::insertLayer (TeLayer* layer)
+{
+	TeProjection* proj = layer->projection();
+	if (!proj || !insertProjection(proj))
+	{
+		errorMessage_ = "N�o � poss�vel inserir layer sem proje��o";
+		return false;
+	}
+
+	_variant_t newID;
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("te_layer",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+
+		recset_->AddNew();
+		recset_->Fields->GetItem("projection_id")->Value = (_variant_t) ((long)proj->id());
+		recset_->Fields->GetItem("name")->Value = (_bstr_t) (layer->name().c_str());
+		recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(layer->box().x1(),15));
+		recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(layer->box().y1(),15));
+		recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(layer->box().x2(),15));
+		recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(layer->box().y2(),15));
+		recset_->Fields->GetItem("edition_time")->Value = (_bstr_t) (layer->getEditionTime().getDateTime(systemDateTimeFormat_, systemDateSep_, systemTimeSep_, systemIndPM_, systemIndAM_).c_str());
+
+		recset_->Update();
+		newID = recset_->GetCollect("layer_id");
+		layer->id(newID.intVal);
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	layerMap()[layer->id()] = layer;
+	return true;
+}
+
+bool 
+TeAdo::insertRepresentation (int layerId, TeRepresentation& rep)
+{
+	if (layerId <= 0)
+		return false;
+
+	_variant_t newID;
+	int id;
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("te_representation",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+		recset_->AddNew();
+
+		recset_->Fields->GetItem("layer_id")->Value = (_variant_t)((long)layerId);
+		recset_->Fields->GetItem("geom_type")->Value = (_variant_t) static_cast<long>(rep.geomRep_);
+		recset_->Fields->GetItem("geom_table")->Value = (_bstr_t) rep.tableName_.c_str();
+		recset_->Fields->GetItem("description")->Value = (_bstr_t) rep.description_.c_str();
+		recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(rep.box_.x1(),15));
+		recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(rep.box_.y1(),15));
+		recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(rep.box_.x2(),15));
+		recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(rep.box_.y2(),15));
+		recset_->Fields->GetItem("res_x")->Value = (_variant_t) (rep.resX_);
+		recset_->Fields->GetItem("res_y")->Value = (_variant_t) (rep.resY_);
+		recset_->Fields->GetItem("num_cols")->Value = (_variant_t) ((long)rep.nCols_);
+		recset_->Fields->GetItem("num_rows")->Value = (_variant_t) ((long)rep.nLins_);
+		recset_->Update();
+		newID = recset_->GetCollect("repres_id");
+		id = newID.intVal;
+		rep.id_ = id;
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertLegend (TeLegendEntry *legend)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("te_legend",
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+		recset_->AddNew();
+		recset_->Fields->GetItem("theme_id")->Value = (_variant_t) ((long)legend->theme());
+		recset_->Fields->GetItem("group_id")->Value = (_variant_t) ((long)legend->group());
+
+// Group parameters
+		recset_->Fields->GetItem("num_objs")->Value = (_variant_t) ((long)legend->count());
+		recset_->Fields->GetItem("lower_value")->Value = (_bstr_t) (legend->from().c_str());
+		recset_->Fields->GetItem("upper_value")->Value = (_bstr_t) (legend->to().c_str());
+		recset_->Fields->GetItem("label")->Value = (_bstr_t) (legend->label().c_str());
+
+		recset_->Update();
+		_variant_t newID;
+		newID = recset_->GetCollect("legend_id");
+		legend->id(newID.intVal);
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return 0;
+	}
+
+	legendMap()[legend->id()] = legend;
+	return insertVisual(legend);
+}
+
+bool 
+TeAdo::insertPolygonSet (const string& table, TePolygonSet &ps)
+{
+	if (ps.empty())
+		return false;
+
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+
+	unsigned int i;
+	unsigned int n = ps.size();
+	try
+	{
+		// for each polygon in the polygon set
+		for (i = 0; i < n; ++i)
+		{
+			unsigned int k;
+			int parentId = 0;
+			unsigned int numberHoles = ps[i].size()-1;
+			// for each ring 
+			for (k=0; k<ps[i].size(); ++k)
+			{
+				recset_->AddNew();
+				recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (ps[i].objectId().c_str());
+				recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)ps[i][k].size());
+				recset_->Fields->GetItem("num_holes")->Value = (_variant_t) ((long)numberHoles);
+				recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)parentId);
+				recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(ps[i][k].box().lowerLeft().x_,15));
+				recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(ps[i][k].box().lowerLeft().y_,15));
+				recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(ps[i][k].box().upperRight().x_,15));
+				recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(ps[i][k].box().upperRight().y_,15));
+				recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (MAX(ps[i][k].box().width(),ps[i][k].box().height()));
+
+				// create and save the BLOB
+				VARIANT varPoints;
+				if(!LinearRingToVariant(varPoints, ps[i][k]))
+				{
+					recset_->Close();
+					return false;
+				}
+
+				recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+				recset_->Update();
+				SafeArrayDestroy (varPoints.parray);
+
+				// retrieve the geometry id of the ring (given by the auto increment property)
+				ps[i][k].geomId(recset_->GetCollect("geom_id").intVal);
+ 
+				if (k==0)
+				{
+					parentId = ps[i][k].geomId(); // save the geometry id of the parent
+					ps[i].geomId(parentId);
+					// update in the database the parent id of an outter ring 
+					recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)parentId);
+					recset_->Update();
+					numberHoles=0;
+
+					ps[i].geomId(parentId);
+				}
+			}
+		}
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return false;
+	}
+	recset_->Close();
+	return true;
+}
+
+
+bool 
+TeAdo::insertPolygon (const string& table, TePolygon& pol)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+
+	recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+
+	try
+	{
+		unsigned int k;
+		int parentId = 0;
+		unsigned int numberHoles = pol.size()-1;
+		// for each ring
+		for (k=0; k<pol.size(); ++k)
+		{
+			recset_->AddNew();
+			recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (pol.objectId().c_str());
+			recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)pol[k].size());
+			recset_->Fields->GetItem("num_holes")->Value = (_variant_t) ((long)numberHoles);
+			recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)parentId);
+			recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(pol[k].box().lowerLeft().x_,15));
+			recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(pol[k].box().lowerLeft().y_,15));
+			recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(pol[k].box().upperRight().x_,15));
+			recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(pol[k].box().upperRight().y_,15));
+			recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (MAX(pol[k].box().width(),pol[k].box().height()));
+
+			// create and save the BLOB
+			VARIANT varPoints;
+			if(!LinearRingToVariant(varPoints,pol[k]))
+			{
+				recset_->Close();
+				return false;
+			}
+
+			recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+			recset_->Update();
+			SafeArrayDestroy (varPoints.parray);
+
+			// retrieve the geometry id of the ring (given by the auto increment property)
+			pol[k].geomId(recset_->GetCollect("geom_id").intVal);
+
+			if (k==0)
+			{
+				parentId = pol[k].geomId();// save the geometry id of the parent
+				// update in the database the parent id of an outter ring 
+				recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)parentId);
+				recset_->Update();
+
+				pol.geomId(parentId);
+				numberHoles=0;
+			}
+		}
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return false;
+	}
+	recset_->Close();
+	return true;
+}
+
+
+bool 
+TeAdo::updatePolygon (const string& table, TePolygon &p )
+{
+	double	extmax;
+	unsigned int k, ni, size;
+//	double	*points	= NULL;
+
+	TeAdoPortal* portal = (TeAdoPortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	try
+	{
+		TeBox b = p[0].box();
+		for ( k = 0; k < p.size(); k++ )
+		{
+			TeLinearRing ring ( p[k] );
+			string q ="SELECT * FROM " + table;
+
+			q += " WHERE geom_id = " + Te2String(ring.geomId());
+
+			if (!portal->query (q))
+			{
+				delete portal;
+				return false;
+			}
+
+			if (!portal->fetchRow())
+			{
+				portal->freeResult();
+				delete portal;
+				return false;
+			}
+			size = ring.size();
+			ni = 0;
+			if (k==0)
+			{
+				extmax = MAX(b.width(),b.height());
+				ni = p.size()-1;
+			}
+			else
+				ni = 0;
+
+			portal->recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (p.objectId().c_str());
+			portal->recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)size);
+			portal->recset_->Fields->GetItem("num_holes")->Value = (_variant_t) ((long)ni);
+			portal->recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)p[0].geomId());
+			portal->recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(b.lowerLeft().x(),15));
+			portal->recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(b.lowerLeft().y(),15));
+			portal->recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(b.upperRight().x(),15));
+			portal->recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(b.upperRight().y(),15));
+			portal->recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (extmax);
+// Create and save the BLOB
+			VARIANT varPoints;
+
+			if(!LinearRingToVariant(varPoints, ring))
+			{
+				delete portal;
+				return false;
+			}
+
+			portal->recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+			portal->recset_->Update();
+			SafeArrayDestroy (varPoints.parray);
+			portal->recset_->Close();
+		}
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		delete portal;
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		delete portal;
+		return 0;
+	}
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeAdo::insertLineSet (const string& table, TeLineSet &ls)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	recset_->Open(_bstr_t(table.c_str()),
+		_variant_t((IDispatch*)connection_,true),
+		ADODB::adOpenKeyset,
+		ADODB::adLockOptimistic,
+		ADODB::adCmdTable);
+	try
+	{
+		// for each line
+		for (unsigned int i = 0; i < ls.size(); ++i)
+		{
+			recset_->AddNew();
+			recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (ls[i].objectId().c_str());
+			recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)ls[i].size());
+			recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(ls[i].box().lowerLeft().x_,15));
+			recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(ls[i].box().lowerLeft().y_,15));
+			recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(ls[i].box().upperRight().x_,15));
+			recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(ls[i].box().upperRight().y_,15));
+			recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (MAX(ls[i].box().width(),ls[i].box().height()));
+
+			// create and save the BLOB
+			VARIANT varPoints;
+			if (!LineToVariant(varPoints,ls[i]))
+			{
+				recset_->Close();
+				return false;
+			}
+
+			recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+			recset_->Update();
+			SafeArrayDestroy (varPoints.parray);
+			
+			// retrieve the geometry id of the line (given by the auto increment property)		
+			ls[i].geomId (recset_->GetCollect("geom_id").intVal);
+		}
+	}
+	catch(_com_error &e)
+	{
+		recset_->Close();
+		errorMessage_ = e.Description();
+		return 0;
+	}
+	catch(...)
+	{
+		recset_->Close();
+		errorMessage_ = "Oppps !";
+		return 0;
+	}
+	recset_->Close();
+	return true;
+}
+
+bool 
+TeAdo::insertLine (const string& table, TeLine2D &line)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+
+	try
+	{	
+		recset_->Open(_bstr_t(table.c_str()),
+		_variant_t((IDispatch*)connection_,true),
+		ADODB::adOpenKeyset,
+		ADODB::adLockOptimistic,
+		ADODB::adCmdTable);
+
+		recset_->AddNew();
+		recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (line.objectId().c_str());
+		recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)line.size());
+		recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(line.box().lowerLeft().x_,15));
+		recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(line.box().lowerLeft().y_,15));
+		recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(line.box().upperRight().x_,15));
+		recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(line.box().upperRight().y_,15));
+		recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (MAX(line.box().width(),line.box().height()));
+
+		// create and save the BLOB
+		VARIANT varPoints;
+		if (!LineToVariant(varPoints, line))
+		{
+			recset_->Close();
+			return false;
+		}
+
+		recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+		recset_->Update();
+		SafeArrayDestroy (varPoints.parray);
+		
+		// retrieve the geometry id of the line (given by the auto increment property)		
+		line.geomId (recset_->GetCollect("geom_id").intVal);
+	}
+	catch(_com_error &e)
+	{
+		recset_->Close();
+		errorMessage_ = e.Description();
+		return 0;
+	}
+	catch(...)
+	{
+		recset_->Close();
+		errorMessage_ = "Oppps !";
+		return 0;
+	}
+	recset_->Close();
+	return true;
+}
+
+bool 
+TeAdo::updateLine (const string& table, TeLine2D &line)
+{
+	TeAdoPortal* portal = (TeAdoPortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	string q ="SELECT * FROM " + table;
+	q += " WHERE geom_id = " + Te2String(line.geomId());
+
+	if (!portal->query (q))
+	{
+		delete portal;
+		return false;
+	}
+
+	if (!portal->fetchRow())
+	{
+		portal->freeResult();
+		delete portal;
+		return false;
+	}
+
+	double	extmax;
+	int		size;
+//	double	*points	= NULL;
+	size = line.size();
+	TeBox b = line.box();
+	extmax = MAX(b.width(),b.height());
+
+	try
+	{
+		portal->recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (line.objectId().c_str());
+		portal->recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)size);
+		portal->recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(b.lowerLeft().x(),15));
+		portal->recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(b.lowerLeft().y(),15));
+		portal->recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(b.upperRight().x(),15));
+		portal->recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(b.upperRight().y(),15));
+		portal->recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (extmax);
+
+// Create and save the BLOB
+		VARIANT varPoints;
+
+		if (!LineToVariant(varPoints, line))
+		{
+			delete portal;
+			return false;
+		}
+
+		portal->recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+		portal->recset_->Update();
+		portal->recset_->Close();
+
+		SafeArrayDestroy (varPoints.parray);
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		delete portal;
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		delete portal;
+		return 0;
+	}
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeAdo::insertPointSet (const string& table, TePointSet &ps)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+
+		for (unsigned int i = 0; i < ps.size(); ++i)
+		{
+			recset_->AddNew();
+			recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (ps[i].objectId().c_str());
+			recset_->Fields->GetItem("x")->Value = (_variant_t) TeRoundD(ps[i].location().x_,15);
+			recset_->Fields->GetItem("y")->Value = (_variant_t) TeRoundD(ps[i].location().y_,15);
+			recset_->Update();
+			ps[i].geomId (recset_->GetCollect("geom_id").intVal);
+		}
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		recset_->Close();
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		recset_->Close();
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertPoint (const string& table, TePoint &p)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+		recset_->AddNew();
+		recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (p.objectId().c_str());
+		recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(p.location().x_,15));
+		recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(p.location().y_,15));
+		recset_->Update();
+		p.geomId (recset_->GetCollect("geom_id").intVal);
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return 0;
+	}
+	return true;
+}
+
+bool 
+TeAdo::updatePoint (const string& table, TePoint &p)
+{
+	TeAdoPortal* portal = (TeAdoPortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	try
+	{
+		string q ="SELECT * FROM " + table;
+		q += " WHERE geom_id = " + Te2String(p.geomId());
+
+		if (!portal->query (q))
+		{
+			delete portal;
+			return false;
+		}
+
+//		bool update = false;
+		if (!portal->fetchRow())
+		{
+			portal->freeResult();
+			delete portal;
+			return false;
+		}
+
+		portal->recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (p.objectId().c_str());
+		portal->recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(p.location().x(),15));
+		portal->recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(p.location().y(),15));
+		portal->recset_->Update();
+		portal->recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		delete portal;
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		delete portal;
+		return 0;
+	}
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeAdo::insertCellSet (const string& table, TeCellSet &cs)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(table.c_str()),
+				_variant_t((IDispatch*)connection_,true),
+				ADODB::adOpenKeyset,
+				ADODB::adLockOptimistic,
+				ADODB::adCmdTable);
+		for (unsigned int i = 0; i < cs.size(); ++i)
+		{
+			recset_->AddNew();
+			recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (cs[i].objectId().c_str());
+			recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(cs[i].box().lowerLeft().x_,15));
+			recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(cs[i].box().lowerLeft().y_,15));
+			recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(cs[i].box().upperRight().x_,15));
+			recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(cs[i].box().upperRight().y_,15));
+			recset_->Fields->GetItem("col_number")->Value = (_variant_t) ((long)cs[i].column());
+			recset_->Fields->GetItem("row_number")->Value = (_variant_t) ((long)cs[i].line());
+			recset_->Update();
+			cs[i].geomId (recset_->GetCollect("geom_id").intVal);
+		}
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return 0;
+	}
+	recset_->Close();
+	return true;
+}
+
+bool 
+TeAdo::insertCell (const string& table, TeCell &c)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+
+	recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+	try
+	{
+		recset_->AddNew();
+		recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (c.objectId().c_str());
+		recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(c.box().lowerLeft().x_,15));
+		recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(c.box().lowerLeft().y_,15));
+		recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(c.box().upperRight().x_,15));
+		recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(c.box().upperRight().y_,15));
+		recset_->Fields->GetItem("col_number")->Value = (_variant_t) ((long)c.column());
+		recset_->Fields->GetItem("row_number")->Value = (_variant_t) ((long)c.line());
+		recset_->Update();
+		c.geomId (recset_->GetCollect("geom_id").intVal);
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return 0;
+	}
+	catch(...)
+	{
+		recset_->Close();
+		errorMessage_ = "Oppps !";
+		return 0;
+	}
+	recset_->Close();
+	return true;
+}
+
+bool 
+TeAdo::insertTextSet (const string& table, TeTextSet &ts)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+
+		for (unsigned int i = 0; i < ts.size(); ++i)
+		{
+			recset_->AddNew();
+			recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (ts[i].objectId().c_str());
+			recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(ts[i].location().x_,15));
+			recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(ts[i].location().y_,15));
+			recset_->Fields->GetItem("text_value")->Value = (_bstr_t) (ts[i].textValue().c_str());
+			recset_->Fields->GetItem("angle")->Value = (_variant_t) (ts[i].angle());
+			recset_->Fields->GetItem("height")->Value = (_variant_t) (ts[i].height());
+			recset_->Fields->GetItem("alignment_vert")->Value = (_variant_t) (ts[i].alignmentVert());
+			recset_->Fields->GetItem("alignment_horiz")->Value = (_variant_t) (ts[i].alignmentHoriz());
+			recset_->Update();
+			ts[i].geomId (recset_->GetCollect("geom_id").intVal);
+		}
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return 0;
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertText(const string& table, TeText &t)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+		recset_->AddNew();
+		recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (t.objectId().c_str());
+		recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(t.location().x(),15));
+		recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(t.location().y(),15));
+		recset_->Fields->GetItem("text_value")->Value = (_bstr_t) (t.textValue().c_str());
+		recset_->Fields->GetItem("angle")->Value = (_variant_t) (t.angle());
+		recset_->Fields->GetItem("height")->Value = (_variant_t) (t.height());
+		recset_->Fields->GetItem("alignment_vert")->Value = (_variant_t)(t.alignmentVert());
+		recset_->Fields->GetItem("alignment_horiz")->Value = (_variant_t)(t.alignmentHoriz());
+		recset_->Update();
+		t.geomId (recset_->GetCollect("geom_id").intVal);
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return 0;
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertArcSet (const string& table, TeArcSet &as)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+
+		for ( unsigned int i = 0; i < as.size(); i++ )
+		{
+			TeArc arc = as [i];
+			recset_->AddNew();
+			recset_->Fields->GetItem("geom_id")->Value = (_variant_t) ((long)arc.geomId());
+			recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (arc.objectId().c_str());
+			recset_->Fields->GetItem("from_node")->Value = (_variant_t) ((long)arc.fromNode().geomId());
+			recset_->Fields->GetItem("to_node")->Value = (_variant_t) ((long)arc.toNode().geomId());
+			recset_->Update();
+			as[i].geomId (recset_->GetCollect("geom_id").intVal);
+		}
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return 0;
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertArc (const string& table, TeArc &arc)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+		recset_->AddNew();
+		recset_->Fields->GetItem("geom_id")->Value = (_variant_t) ((long)arc.geomId());
+		recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (arc.objectId().c_str());
+		recset_->Fields->GetItem("from_node")->Value = (_variant_t) ((long)arc.fromNode().geomId());
+		recset_->Fields->GetItem("to_node")->Value = (_variant_t) ((long)arc.toNode().geomId());
+		recset_->Update();
+		recset_->Close();
+		arc.geomId (recset_->GetCollect("geom_id").intVal);
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return 0;
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertNodeSet (const string& table, TeNodeSet &ns)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+
+		for ( unsigned int i = 0; i < ns.size(); i++ )
+		{
+			TeNode node = ns [i];
+			recset_->AddNew();
+			recset_->Fields->GetItem("geom_id")->Value = (_variant_t) ((long)node.geomId());
+			recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (node.objectId().c_str());
+			recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(node.location().x(),15));
+			recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(node.location().y(),15));
+			recset_->Update();
+			ns[i].geomId (recset_->GetCollect("geom_id").intVal);
+		}
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return 0;
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertNode (const string& table, TeNode &n)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(table.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+
+		recset_->AddNew();
+		recset_->Fields->GetItem("geom_id")->Value = (_variant_t) ((long)n.geomId());
+		recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (n.objectId().c_str());
+		recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(n.location().x(),15));
+		recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(n.location().y(),15));
+		recset_->Update();
+		n.geomId (recset_->GetCollect("geom_id").intVal);
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return 0;
+	}
+	return true;
+}
+
+bool 
+TeAdo::updateNode (const string& table, TeNode &node)
+{
+	TeAdoPortal* portal = (TeAdoPortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	try
+	{
+		string q ="SELECT * FROM " + table;
+		q += " WHERE geom_id = " + Te2String(node.geomId());
+
+		if (!portal->query (q))
+		{
+			delete portal;
+			return false;
+		}
+
+//		bool update = false;
+		if (!portal->fetchRow())
+		{
+			delete portal;
+			return false;
+		}
+
+		portal->recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (node.objectId().c_str());
+		portal->recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(node.location().x(),15));
+		portal->recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(node.location().y(),15));
+		portal->recset_->Update();
+		portal->recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		delete portal;
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		delete portal;
+		return 0;
+	}
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeAdo::insertTable (TeTable &table)
+{
+	string				tableName = table.name();	
+	TeAttributeList		att = table.attributeList();
+	TeAttributeList::iterator	it;
+
+	TeTableRow row;
+	unsigned int i;
+	
+	_variant_t index;
+	index.vt = VT_I4;
+
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(tableName.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdTable);
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error insert table!";
+		return false;
+	}
+
+	bool rec_open = false;
+	for ( i = 0; i < table.size(); i++  )
+	{
+		try 
+		{
+			if (!rec_open)
+				recset_->AddNew();
+			row = table[i];
+			it = att.begin();
+
+			for(unsigned int j=0; j<row.size(); j++) 
+			{
+				if (row[j].empty() || (*it).rep_.isAutoNumber_)
+				{
+					++it;
+					continue;
+				}
+
+				TeTime dt;
+				index.lVal = j;
+				string value = row[j];
+				if((*it).rep_.type_==TeDATETIME)
+				{
+					TeTime t(string(row[j].c_str()), (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_,  (*it).timeSeparator_, (*it).indicatorPM_);
+					dt=t;
+				}
+				switch ((*it).rep_.type_)
+  				{
+  					case TeREAL:
+						recset_->GetFields()->GetItem((*it).rep_.name_.c_str())->Value = (_variant_t) atof(row[j].c_str());
+  					break;
+  					case TeINT:
+						recset_->GetFields()->GetItem((*it).rep_.name_.c_str())->Value = (_variant_t) atol(row[j].c_str());
+  					break;
+					case TeDATETIME:
+						recset_->GetFields()->GetItem((*it).rep_.name_.c_str())->Value = (_bstr_t) (dt.getDateTime(systemDateTimeFormat_, systemDateSep_, systemTimeSep_, systemIndPM_, systemIndAM_).c_str()); 
+  					break;
+					
+					case TeBOOLEAN:
+						{
+							int value = 0;
+							if(row[j] == "1" || TeConvertToLowerCase(row[j]) == "t" || TeConvertToLowerCase(row[j]) == "true")
+							{
+								value = 1;
+							}
+							recset_->GetFields()->GetItem((*it).rep_.name_.c_str())->Value = (_variant_t) value;
+						}
+					break;
+
+					case TeBLOB:
+						BYTE *pByte;
+						VARIANT var;
+
+						SAFEARRAY FAR* psa;
+						SAFEARRAYBOUND rgsabound[1];
+						rgsabound[0].lLbound = 0;	
+						rgsabound[0].cElements =  value.size();
+
+						// create a single dimensional byte array
+						psa = SafeArrayCreate(VT_I1, 1, rgsabound);
+
+						// set the data of the array with data in the edit box
+						if(SafeArrayAccessData(psa,(void **)&pByte) == NOERROR)
+							memcpy((LPVOID)pByte,(LPVOID)(char*)value.c_str(), value.size() * sizeof(char));
+						SafeArrayUnaccessData(psa);
+						var.vt = VT_ARRAY | VT_UI1;
+						var.parray = psa;
+
+						recset_->Fields->Item[(*it).rep_.name_.c_str()]->AppendChunk (var);
+						SafeArrayDestroy (var.parray);						
+						break;
+  					default:
+						if (value.size() > (unsigned int)((*it).rep_.numChar_))
+							value = value.substr(0,(*it).rep_.numChar_);
+						recset_->GetFields()->GetItem((*it).rep_.name_.c_str())->Value = (_bstr_t) (value.c_str());
+  					break;
+  				}
+				++it;
+			}
+			recset_->Update();
+			rec_open =  false;
+		}
+		catch(_com_error &e)
+		{
+			errorMessage_ = e.Description();
+			rec_open = true;
+		}
+		catch(...)
+		{
+			errorMessage_ = "Error insert table!";
+			rec_open = true;
+		}
+	}
+	return true;
+}
+
+bool 
+TeAdo::insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size)
+{
+	if (whereClause.empty())
+		return false;
+
+	TeAdoPortal* portal = (TeAdoPortal*)getPortal();
+	if (!portal)
+		return false;
+
+	string q = "SELECT * FROM "+ tableName +" WHERE " + whereClause;
+	if ((!portal->query(q)) || (!portal->fetchRow()))
+	{
+		delete portal;
+		return false;
+	}
+
+	try
+	{
+		BYTE *pByte;
+		VARIANT var;
+		
+		SAFEARRAY FAR* psa;
+		SAFEARRAYBOUND rgsabound[1];
+		rgsabound[0].lLbound = 0;	
+		rgsabound[0].cElements = size;
+
+		// create a single dimensional byte array
+		psa = SafeArrayCreate(VT_I1, 1, rgsabound);
+			
+		// set the data of the array with data in the edit box
+		if(SafeArrayAccessData(psa,(void **)&pByte) == NOERROR)
+			memcpy((LPVOID)pByte,(LPVOID)data, size * sizeof(unsigned char));
+		SafeArrayUnaccessData(psa);
+		var.vt = VT_ARRAY | VT_UI1;
+		var.parray = psa;
+
+		portal->recset_->Fields->Item[columnBlob.c_str()]->AppendChunk (var);
+		portal->recset_->Update();
+		portal->recset_->Close();
+		SafeArrayDestroy (var.parray);
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		delete portal;
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error insert blob!";
+		delete portal;
+		return false;
+	}
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeAdo::insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, 
+					     unsigned char *buf,unsigned long size, int band, unsigned int res, unsigned int subband)
+{
+
+	if (blockId.empty()) // no block identifier provided
+	{
+		errorMessage_ = "bloco sem identificador";
+		return false;
+	}
+
+	TeAdoPortal* portal = (TeAdoPortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	bool update = false;
+	string q ="SELECT * FROM " + table; 
+	q += " WHERE block_id='" + blockId + "'";
+
+	if (!portal->query (q))
+	{
+		delete portal;
+		return false;
+	}
+		// check if this block is alread in the database
+	if (portal->fetchRow())
+		update = true;
+
+	try
+	{
+		if (!update)
+		{
+			portal->freeResult();
+			portal->recset_->Open(_bstr_t(table.c_str()),
+				_variant_t((IDispatch*)connection_,true),
+				ADODB::adOpenKeyset,
+				ADODB::adLockOptimistic,
+				ADODB::adCmdTable);
+			portal->recset_->AddNew();
+		}
+		portal->recset_->Fields->GetItem("block_id")->Value = (_bstr_t) blockId.c_str();
+		portal->recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(ll.x(),15));
+		portal->recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(ll.y(),15));
+		portal->recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(ur.x(),15));
+		portal->recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(ur.y(),15));
+		portal->recset_->Fields->GetItem("band_id")->Value = (long) band;
+		portal->recset_->Fields->GetItem("resolution_factor")->Value = (long) res;
+		portal->recset_->Fields->GetItem("subband")->Value = (long) subband;
+		portal->recset_->Fields->GetItem("block_size")->Value = (long) size;
+
+		VARIANT var;
+		BYTE *pByte;
+
+		// create a single dimensional byte array
+		SAFEARRAY FAR* psa;
+		SAFEARRAYBOUND rgsabound[1];
+		rgsabound[0].lLbound = 0;	
+		rgsabound[0].cElements = size;
+
+		psa = SafeArrayCreate(VT_I1, 1, rgsabound);
+			
+		// set the data of the array with compressed data
+		if(SafeArrayAccessData(psa,(void **)&pByte) == NOERROR)
+			memcpy((LPVOID)pByte,(LPVOID)buf,size);
+		SafeArrayUnaccessData(psa);
+
+		var.vt = VT_ARRAY | VT_UI1;
+		var.parray = psa;
+
+		portal->recset_->Fields->Item["spatial_data"]->AppendChunk (var);
+		portal->recset_->Update();
+		portal->recset_->Close();
+		SafeArrayDestroy (var.parray);
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		delete portal;
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		delete portal;
+		return false;
+	}
+	delete portal;
+	return true;
+}
+
+
+string 
+TeAdo::getSQLTime(const TeTime& time) const
+{
+	//Insert datetime in a database ACCESS always in the format MMsDDsYYYY HHsMMsSS
+	string result = "#";		
+	result += time.getDateTime("MMsDDsYYYYsHHsmmsSS"); 
+	result += "#";
+	return result;
+}
+
+string
+TeAdo::getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, 
+						   const string& initialTime, const string& finalTime)
+{
+	
+	//In Access the first day of the week is sunday with index 1
+	if(chr==TeDAYOFWEEK)
+	{
+		time1 = time1+1;
+		time2 = time2+1;
+	}
+
+	return(TeDatabase::getSQLTemporalWhere(time1, time2, chr, rel, initialTime, finalTime));
+}
+
+string TeAdo::concatValues(vector<string>& values, const string& unionString)
+{
+	string concat = "";
+	
+	for(unsigned int i = 0; i < values.size(); ++i)
+	{
+		if(i != 0)
+		{
+			concat += " + ";
+
+			if(!unionString.empty())
+			{
+				concat += "'";
+				concat += unionString;
+				concat += "'";
+				concat += " + ";
+			}
+		}
+
+		concat += values[i];
+	}
+
+	return concat;
+}
+
+string TeAdo::toUpper(const string& value)
+{
+	string result  = "UCASE(";
+	       result += value;
+		   result += ")";
+
+	return result;
+}
+
+bool 
+TeAdo::getAttributeList(const string& tableName,TeAttributeList& attList)
+{
+	if (!TeDatabase::getAttributeList (tableName, attList))
+		return false;
+
+	vector<string> pks;
+	ADOX::_CatalogPtr pCatalog = NULL;
+	ADOX::_TablePtr pTable = NULL;
+    HRESULT hr = S_OK;
+	try
+	{
+		TESTHR(hr = pCatalog.CreateInstance(__uuidof(ADOX::Catalog)));
+		pCatalog->PutActiveConnection(_variant_t((IDispatch *)connection_));
+		pTable = pCatalog->Tables->GetItem((_bstr_t)tableName.c_str ());
+        int n = pTable->Keys->Count;
+		for (int i=0; i<n; i++)
+		{
+			if (pTable->Keys->GetItem((long)i)->Type == ADOX::adKeyPrimary)
+			{
+				_bstr_t	bbvalue_;
+				_variant_t value;
+				int m = pTable->Keys->GetItem((long)i)->Columns->Count;
+				for (int j = 0; j < m; j++)
+				{
+					value = pTable->Keys->GetItem((long)i)->Columns->GetItem((long)j)->Name;
+					bbvalue_ = _bstr_t(value);
+					pks.push_back(string((char*)bbvalue_));
+				}
+			}
+		}
+	}
+	catch(...) 
+	{
+		pCatalog = NULL;
+		pTable = NULL;
+		return false;
+	}
+	vector<string>::iterator itn;
+	TeAttributeList::iterator it = attList.begin();
+	while (it != attList.end())
+	{
+		itn = find(pks.begin(),pks.end(),(*it).rep_.name_);
+		if (itn != pks.end())
+			(*it).rep_.isPrimaryKey_ = true;
+		++it;
+	}
+	pks.clear();
+	pCatalog = NULL;
+	pTable = NULL;
+	return true;
+}
+
+bool TeAdo::beginTransaction()
+{
+	transactionCounter_++;
+
+	if (transactionCounter_ > 1)
+	{
+		return true;
+	}
+	else
+	{
+		HRESULT hr = connection_->BeginTrans();
+		return !(FAILED(hr));
+	}
+}
+
+bool TeAdo::commitTransaction()
+{
+	transactionCounter_--;
+
+	if (transactionCounter_ > 0)
+	{
+		return true;
+	}
+	else
+	{
+		HRESULT hr = connection_->CommitTrans();
+		return !(FAILED(hr));
+	}
+}
+
+bool TeAdo::rollbackTransaction()
+{
+	transactionCounter_--;
+
+	if (transactionCounter_ > 0)
+	{
+		return true;
+	}
+	else
+	{
+		HRESULT hr = connection_->RollbackTrans();
+		return !(FAILED(hr));
+	}
+}
+
+
+//----- TeAdoPortal methods ---
+
+TeAdoPortal::TeAdoPortal ( TeDatabase*  pDatabase)
+{
+	db_ = pDatabase;
+	connection_ = ((TeAdo*)pDatabase)->connection_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+}
+
+
+TeAdoPortal::TeAdoPortal ()
+{
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	curRow_ = 0;
+}
+
+TeAdoPortal::~TeAdoPortal ()
+{
+	freeResult();
+}
+
+bool 
+TeAdoPortal::isConnected()
+{
+	if(connection_ != NULL)
+	{
+		if(connection_->State==ADODB::adStateOpen)
+			return true;
+	}
+	return false;
+}
+
+bool 
+TeAdoPortal::isEOF()
+{
+	if (recset_->IsEOF)
+		return true;
+	return false;
+}
+
+bool 
+TeAdoPortal::moveFirst()
+{
+	try
+	{
+		HRESULT hr = recset_->MoveFirst();
+		TESTHR(hr);
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeAdo::LinearRingToVariant(VARIANT &varArray, TeLinearRing& ring)
+{
+	unsigned long i, iac = 0;
+	double *points = new double[2*ring.size()];
+	for (i=0;i<ring.size();i++)
+	{
+		points[iac++]=ring[i].x();
+		points[iac++]=ring[i].y();
+	}
+
+	if (!PointsToVariant(varArray, points, ring.size()))
+	{
+		delete [] points;
+		return false;
+	}
+
+	delete [] points;
+	return true;
+}
+
+bool 
+TeAdo::LineToVariant(VARIANT &varArray, TeLine2D& line)
+{
+	unsigned long i, iac = 0;
+	double *points = new double[2*line.size()];
+	for (i=0;i<line.size();i++)
+	{
+		points[iac++]=line[i].x();
+		points[iac++]=line[i].y();
+	}
+
+	if (!PointsToVariant(varArray, points, line.size()))
+	{
+		delete [] points;
+		return false;
+	}
+
+	delete [] points;
+	return true;
+}
+
+bool 
+TeAdo::PointsToVariant(VARIANT &varArray, double* points, int npoints)
+{
+	BYTE *pByte;
+	try
+	{
+		SAFEARRAY FAR* psa;
+		SAFEARRAYBOUND rgsabound[1];
+		rgsabound[0].lLbound = 0;	
+		rgsabound[0].cElements = 2 * npoints * sizeof(double);
+
+// create a single dimensional byte array
+		psa = SafeArrayCreate(VT_I1, 1, rgsabound);
+			
+// set the data of the array with data in the edit box
+		if(SafeArrayAccessData(psa,(void **)&pByte) == NOERROR)
+			memcpy((LPVOID)pByte,(LPVOID)points,2 * npoints * sizeof(double));
+		SafeArrayUnaccessData(psa);
+
+		varArray.vt = VT_ARRAY | VT_UI1;
+		varArray.parray = psa;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error PointsToVariant";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeAdoPortal::BlobToLine(TeLine2D& line)
+{
+	long		size;
+	_variant_t	varBLOB;
+	int			k,
+				np = atoi (getData("num_coords"));
+	double		x,
+				y,
+				*points = 0;
+	try
+	{
+// get the actual length of the data
+		size = recset_->Fields->Item["spatial_data"]->ActualSize;
+	
+		if(size > 0)
+		{
+			VariantInit(&varBLOB);
+// get the chunk of data 
+			varBLOB = recset_->Fields->Item["spatial_data"]->GetChunk(size);
+			
+// If the data retrieved is array of bytes then get data from the array
+			if(varBLOB.vt == (VT_ARRAY | VT_UI1))
+			{
+				SafeArrayAccessData(varBLOB.parray,(void **)&points);
+				line.reserve(np);
+				for (k=0;k<np;k++)
+				{
+					x = *points++;
+					y = *points++;
+					TeCoord2D pt(x,y);
+					line.add(pt);
+				}
+				SafeArrayUnaccessData(varBLOB.parray);
+			}
+			
+		}
+// some of the providers return -1 as the data length 
+// in that case loop through to get the data in chunks
+		else
+		if(size < 0)
+		{
+			int nDataLenRetrieved = 0;
+			do
+			{
+				VariantInit(&varBLOB);
+				int kkk = recset_->Fields->Item["spatial_data"]->Attributes ;
+				if (kkk & ADODB::adFldLong)
+				{
+
+					varBLOB = recset_->Fields->Item["spatial_data"]->GetChunk((long)CHUNKSIZE);
+
+					// If the data retrieved is array of bytes then get data from the array and set the 
+					// data value variable of the edit box 
+					if(varBLOB.vt == (VT_ARRAY | VT_UI1))
+					{
+						nDataLenRetrieved = varBLOB.parray->rgsabound[0].cElements;
+						SafeArrayAccessData(varBLOB.parray,(void **)&points);
+
+						SafeArrayUnaccessData(varBLOB.parray);
+						// get the length of chunk retrieved
+					}
+				}
+			}
+			while(nDataLenRetrieved == CHUNKSIZE);  // loop through to get the in chunks of data of CHUNKSIZE size
+//			errorMessage_ = "Esta vindo em chunks";
+//			return false;
+		}
+
+
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error in BlobToLine!";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeAdoPortal::moveNext()
+{
+    HRESULT hr;
+
+	hr = recset_->MoveNext();
+	if (FAILED(hr))
+		return false;
+	return true;
+}
+
+bool 
+TeAdoPortal::query (const string &qry, TeCursorLocation l, TeCursorType /* t */, TeCursorEditType  e , TeCursorDataType /* dt */  )
+{
+   
+ 	try
+	{
+		if(l==TeCLIENTESIDE)
+			recset_->CursorLocation=ADODB::adUseClient;
+		else
+			recset_->CursorLocation=ADODB::adUseServer;
+
+		ADODB::LockTypeEnum lockType = ADODB::adLockReadOnly;
+		if(e == TeREADWRITE)
+		{
+			lockType = ADODB::adLockOptimistic;
+		}
+
+		recset_->Open(qry.c_str(),connection_.GetInterfacePtr(),
+					ADODB::adOpenKeyset,
+					lockType,
+					ADODB::adCmdText);
+		numRows_ = recset_->GetRecordCount();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+
+	ADODB::FieldsPtr ptrFields = NULL;
+	ADODB::FieldPtr ptrField = NULL;
+	ptrFields = recset_->Fields;
+	numFields_ = ptrFields->Count; 
+
+	attList_.clear ();
+	int i;
+	for(i = 0; i < numFields_; i++)
+	{
+		_variant_t vCol((long)i);
+		ptrFields->get_Item(vCol, &ptrField);
+		TeAttribute attribute;
+		int nType = ptrField->Type;
+		switch (nType)
+		{
+		case ADODB::adBoolean:
+			attribute.rep_.type_ = TeBOOLEAN;
+			break;
+
+		case ADODB::adVarNumeric:
+		case ADODB::adInteger:
+		case ADODB::adSmallInt:
+		case ADODB::adTinyInt:
+		case ADODB::adUnsignedInt:
+		case ADODB::adUnsignedSmallInt:
+		case ADODB::adUnsignedTinyInt:
+			attribute.rep_.type_ = TeINT;
+			break;
+
+		case ADODB::adNumeric:
+		case ADODB::adDecimal:
+			attribute.rep_.type_ =(ptrField->GetNumericScale()=='0' ? TeINT : TeREAL);
+			break;
+
+		case ADODB::adSingle:
+		case ADODB::adDouble:
+			attribute.rep_.type_ = TeREAL;
+			break;
+
+		case ADODB::adDate:
+		case ADODB::adDBDate:
+		case ADODB::adDBTime:
+		case ADODB::adDBTimeStamp:
+			attribute.rep_.type_ = TeDATETIME;
+			attribute.dateChronon_ = TeSECOND;
+			attribute.dateTimeFormat_ = TeAdo::systemDateTimeFormat(attribute.indicatorAM_, attribute.indicatorPM_, attribute.dateSeparator_, attribute.timeSeparator_);
+			break;
+
+		case ADODB::adLongVarBinary:
+		case ADODB::adVarBinary:
+		case ADODB::adBinary:
+			attribute.rep_.type_ = TeBLOB;
+			break;
+
+		case ADODB::adChar: 
+		case ADODB::adWChar:
+		case ADODB::adVarChar:
+		case ADODB::adVarWChar:
+		case ADODB::adLongVarChar:
+		case ADODB::adLongVarWChar: 
+			attribute.rep_.type_ = TeSTRING;
+			break;
+		break;
+
+		case ADODB::adCurrency: // ??? CURRENCY
+		default :
+			attribute.rep_.type_ = TeUNKNOWN;
+			break;
+		}
+		attribute.rep_.name_ = ptrField->Name;
+		attribute.rep_.numChar_ = ptrField->DefinedSize;
+		attList_.push_back ( attribute );
+	}
+
+	curRow_=-1;
+	return true;
+}
+
+bool 
+TeAdoPortal::fetchRow ()
+{
+	try
+	{
+		if (curRow_ == -1)
+			moveFirst();
+		else
+			moveNext();
+		if( isEOF() )
+			return false;
+		curRow_++;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchRow!";
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeAdoPortal::fetchRow (int i)
+{
+	curRow_ = i;
+	try
+	{
+		moveFirst ();
+		HRESULT hr = recset_->Move(i);
+		TESTHR(hr);
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = (char*)e.ErrorMessage();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}	return true;
+}
+
+
+void 
+TeAdoPortal::freeResult ()
+{
+    long state = ADODB::adStateClosed;
+
+	recset_->get_State(&state);
+	if (state == ADODB::adStateOpen)
+  		recset_->Close();
+}
+
+bool 
+TeAdoPortal::fetchGeometry(TePolygon& pol)
+{
+	try 
+	{
+		TeLine2D line;
+		int numHoles = atoi(this->getData("num_holes"));
+		this->fetchGeometry(line);	// get outter ring
+		
+		if(line.empty())
+		{
+			fetchRow(); 
+			if(recset_->IsEOF)
+				return false;
+			else
+				return true;
+		}
+					
+		TeLinearRing ring(line);
+		pol.objectId ( ring.objectId());
+		pol.geomId ( ring.geomId() );
+		pol.add ( ring );
+		int parentId = pol.geomId();
+		while (!recset_->IsEOF && numHoles>0 && (atoi(this->getData("parent_id")) == parentId)) // get holes
+		{
+			TeLinearRing hole = getLinearRing();
+			pol.add ( hole );
+			fetchRow();
+		}
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+	if(recset_->IsEOF)
+		return false;
+	else
+		return true;
+}
+
+bool 
+TeAdoPortal::fetchGeometry(TePolygon& pol, const unsigned int& initIndex)
+{
+	try 
+	{
+		TeLine2D line;
+		int numHoles = atoi(this->getData(initIndex+3));
+		// get outter ring
+		line.objectId (string(getData (initIndex+1)));
+		line.geomId (atoi(getData(initIndex)));
+		BlobToLine(line);
+		this->fetchRow();
+		
+		if(line.empty())
+		{
+			fetchRow(); 
+			if(recset_->IsEOF)
+				return false;
+			else
+				return true;
+		}
+					
+		TeLinearRing ring(line);
+		pol.objectId ( ring.objectId());
+		pol.geomId ( ring.geomId() );
+		pol.add ( ring );
+		int parentId = pol.geomId();
+		while (!recset_->IsEOF && numHoles>0 && (atoi(this->getData(initIndex+4)) == parentId)) // get holes
+		{
+			TeLine2D line;
+			BlobToLine(line);
+			TeLinearRing hole( line );
+			hole.objectId (string (getData (initIndex+1)));
+			hole.geomId (atoi(getData(initIndex)));
+			pol.add ( hole );
+			fetchRow();
+		}
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+	if(recset_->IsEOF)
+		return false;
+	else
+		return true;
+}
+
+bool 
+TeAdoPortal::fetchGeometry(TeLine2D& line)
+{
+	try {
+		int index = atoi (getData ("geom_id"));
+		TeBox b (getDouble("lower_x"),getDouble("lower_y"),getDouble("upper_x"),getDouble("upper_y"));
+		line.objectId (string (getData ("object_id")));
+		line.geomId (index);
+		line.setBox (b);
+		BlobToLine(line);
+		return(this->fetchRow());
+	} 
+	catch (_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+}
+
+bool 
+TeAdoPortal::fetchGeometry(TeLine2D& line, const unsigned int& initIndex)
+{
+	try 
+	{
+		line.objectId (string (getData (initIndex+1)));
+		line.geomId (atoi (getData (initIndex)));
+		BlobToLine(line);
+		return(this->fetchRow());
+	} 
+	catch (_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+}
+
+bool 
+TeAdoPortal::fetchGeometry(TePoint& p)
+{
+	try {
+		p.geomId( atoi(getData("geom_id")));
+		p.objectId( string(getData("object_id")));
+		double x = getDouble("x");
+		double y = getDouble("y");
+		TeCoord2D c(x, y);
+		p.add(c);
+		return(this->fetchRow());
+	} 
+	catch (_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+}
+
+bool 
+TeAdoPortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
+{
+	try 
+	{
+		p.geomId( atoi(getData(initIndex)));
+		p.objectId( string(getData(initIndex+1)));
+		double x = getDouble(initIndex+2);
+		double y = getDouble(initIndex+3);
+		TeCoord2D c(x, y);
+		p.add(c);
+		return(this->fetchRow());
+	} 
+	catch (_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+}
+
+TeLinearRing 
+TeAdoPortal::getLinearRing()
+{
+	int index = atoi(getData ("geom_id"));
+	TeBox b (getDouble("lower_x"),getDouble("lower_y"),getDouble("upper_x"),getDouble("upper_y"));
+	TeLine2D line;
+	BlobToLine(line);
+	TeLinearRing ring( line );
+	ring.objectId (string (getData ("object_id")));
+	ring.geomId (index);
+	ring.setBox (b);
+	return(ring);
+}
+
+bool 
+TeAdoPortal::fetchGeometry (TeNode& n)
+{
+	try {
+		TeCoord2D c(getDouble("x"), getDouble("y"));
+		n.geomId( atol(getData("geom_id")));
+		n.objectId( string(getData("object_id")));
+		n.add(c);
+		return(this->fetchRow());
+	} 
+	catch (_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeAdoPortal::fetchGeometry (TeNode& n, const unsigned int& initIndex)
+{
+	try {
+		TeCoord2D c(getDouble(initIndex+2), getDouble(initIndex+3));
+		n.geomId( atol(getData(initIndex)));
+		n.objectId( string(getData(initIndex+1)));
+		n.add(c);
+		return(this->fetchRow());
+	} 
+	catch (_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+	return true;
+}
+
+char* 
+TeAdoPortal::getData (int i)
+{
+    _variant_t vtIndex;
+	_variant_t value;
+
+    vtIndex.vt = VT_I4;
+	vtIndex.lVal = i;
+	
+	try
+	{
+		value = recset_->GetFields()->GetItem(vtIndex)->Value;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return 0;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return "";
+	}
+	if (value.vt != VT_NULL)
+	{
+		bvalue_ = _bstr_t(value);
+		return (char*)bvalue_;
+	}
+	else
+		return "";
+}
+
+char* 
+TeAdoPortal::getData (const string& s)
+{
+	_variant_t value;
+	try
+	{
+		value = recset_->GetCollect(s.c_str());
+	}
+	catch(_com_error &e)
+	{
+		string field = TeGetExtension(s.c_str());
+		if (!field.empty())
+		{
+			try
+			{
+				value = recset_->GetCollect(field.c_str());
+			}
+			catch(_com_error &e)
+			{
+				errorMessage_ = e.Description();
+ 				return "";
+			}
+			catch(...)
+			{
+				errorMessage_ = "Error getData!";
+				return false;
+			}
+		}
+		else
+		{
+			errorMessage_ = e.Description();
+			return "";
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return "";
+	}
+
+	if (value.vt != VT_NULL)
+	{
+		bvalue_ = _bstr_t(value);
+		return (char*)bvalue_;
+	}
+	else
+		return "";
+}
+
+double 
+TeAdoPortal::getDouble (int i)
+{
+    _variant_t vtIndex;
+	_variant_t value;
+	double d = 0.;
+
+    vtIndex.vt = VT_I4;
+	vtIndex.lVal = i;
+	
+	try
+	{
+		value = recset_->GetFields()->GetItem(vtIndex)->Value;
+		if(value.vt!=VT_NULL)
+			d = (double)value;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+	}
+
+	return d;
+}
+
+double 
+TeAdoPortal::getDouble (const string& s)
+{
+	_variant_t value;
+	double d = 0.;
+	try
+	{
+		value = recset_->GetCollect(s.c_str());
+	}
+	catch(_com_error &e)
+	{
+		string field = TeGetExtension(s.c_str());
+		if (!field.empty())
+		{
+			try
+			{
+				value = recset_->GetCollect(field.c_str());
+			}
+			catch(_com_error &e)
+			{
+				errorMessage_ = e.Description();
+				return 0.;
+			}
+			catch(...)
+			{
+				errorMessage_ = "Error getDouble!";
+				return 0.;
+			}
+		}
+		else
+		{
+			errorMessage_ = e.Description();
+			return 0.;
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return 0.;
+	}
+
+	if(value.vt!=VT_NULL)
+		d =(double)value;
+	return d;
+}
+
+
+int 
+TeAdoPortal::getInt (int i)
+{
+    _variant_t vtIndex;
+	_variant_t value;
+	int d = 0;
+
+    vtIndex.vt = VT_I4;
+	vtIndex.lVal = i;
+	
+	try
+	{
+		value = recset_->GetFields()->GetItem(vtIndex)->Value;
+		if(value.vt!=VT_NULL)
+			d = (int)value;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+	}
+
+	return d;
+}
+
+int 
+TeAdoPortal::getInt(const string& s)
+{
+	_variant_t value;
+	int d = 0;
+	try
+	{
+		value = recset_->GetCollect(s.c_str());
+	}
+	catch(_com_error &e)
+	{
+		string field = TeGetExtension(s.c_str());
+		if (!field.empty())
+		{
+			try
+			{
+				value = recset_->GetCollect(field.c_str());
+			}
+			catch(_com_error &e)
+			{
+				errorMessage_ = e.Description();
+				return 0;
+			}
+			catch(...)
+			{
+				errorMessage_ = "Error getDouble!";
+				return 0;
+			}
+		}
+		else
+		{
+			errorMessage_ = e.Description();
+			return 0;
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return 0;
+	}
+
+	if(value.vt!=VT_NULL)
+		d = (int)value;
+	return d;
+}
+
+
+bool 
+TeAdoPortal::getBool(const string& s)
+{
+	_variant_t value;
+	try
+	{
+		value = recset_->GetCollect(s.c_str());
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error getBool!";
+		return false;
+	}
+
+	if (value.vt != VT_NULL)
+		return (bool)value;
+		
+	return false;	
+}
+
+bool
+TeAdoPortal::getBool (int i)
+{
+    _variant_t vtIndex;
+	_variant_t value;
+
+    vtIndex.vt = VT_I4;
+	vtIndex.lVal = i;
+	
+	try
+	{
+		value = recset_->GetFields()->GetItem(vtIndex)->Value;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error getBool!";
+		return false;
+	}
+	if (value.vt != VT_NULL)
+		return (bool)value;
+		
+	return false;	
+}
+
+TeTime
+TeAdoPortal::getDate (const string& name)
+{
+	TeTime t;
+	_variant_t value;
+
+	TeAdo* adoDb = (TeAdo*) this->getDatabase();
+
+	try
+	{
+		value = recset_->GetCollect(name.c_str());
+	}
+	catch(_com_error &e)
+	{
+		string field = TeGetExtension(name.c_str());
+		if (!field.empty())
+		{
+			try
+			{
+				value = recset_->GetCollect(field.c_str());
+			}
+			catch(_com_error &e)
+			{
+				errorMessage_ = e.Description();
+				return t;
+			}
+			catch(...)
+			{
+				errorMessage_ = "Error getDate!";
+				return t;
+			}
+		}
+		else
+		{
+			errorMessage_ = e.Description();
+			return t;
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return t;
+	}
+
+	if (value.vt != VT_NULL)
+	{
+		bvalue_ = _bstr_t(value);
+		TeTime t = TeTime( string((char*)bvalue_), TeSECOND, adoDb->systemDateTimeFormat_, 
+			adoDb->systemDateSep_, adoDb->systemTimeSep_, adoDb->systemIndPM_); 
+		return t;
+	}
+	else
+		return TeTime();
+}
+
+
+TeTime
+TeAdoPortal::getDate (int i)
+{
+    _variant_t vtIndex;
+	_variant_t value;
+
+    vtIndex.vt = VT_I4;
+	vtIndex.lVal = i;
+	
+	TeTime t;
+	TeAdo* adoDb = (TeAdo*) this->getDatabase();
+	
+	try
+	{
+		value = recset_->GetFields()->GetItem(vtIndex)->Value;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return t;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return t;
+	}
+	if (value.vt != VT_NULL)
+	{
+		bvalue_ = _bstr_t(value);
+		TeTime time (string((char*)bvalue_), TeSECOND, adoDb->systemDateTimeFormat_, 
+			adoDb->systemDateSep_, adoDb->systemTimeSep_, adoDb->systemIndPM_);
+		return time;
+	}
+	else
+		return t;
+}
+
+
+
+string 
+TeAdoPortal::getDateAsString(const string& s)
+{
+	TeTime t = this->getDate(s);
+	TeAdo* adoDb = (TeAdo*) this->getDatabase();
+	if (t.isValid())
+	{		string tval = "#"+t.getDateTime(adoDb->systemDateTimeFormat_, adoDb->systemDateSep_, adoDb->systemTimeSep_, adoDb->systemIndPM_, adoDb->systemIndAM_)+"#";
+		return tval;
+	}
+	else
+		return "";
+}
+
+string 
+TeAdoPortal::getDateAsString(int i)
+{
+	TeTime t = this->getDate(i);
+	TeAdo* adoDb = (TeAdo*) this->getDatabase();
+	if (t.isValid())
+	{		string tval = "#"+t.getDateTime(adoDb->systemDateTimeFormat_, adoDb->systemDateSep_, adoDb->systemTimeSep_, adoDb->systemIndPM_, adoDb->systemIndAM_)+"#";
+		return tval;
+	}
+	else
+		return "";
+}
+
+bool
+TeAdoPortal::getBlob (int i, unsigned char* &data, long& size)
+{
+	_variant_t	varBLOB;
+	_variant_t vtIndex;
+    vtIndex.vt = VT_I4;
+	vtIndex.lVal = i;
+	char		*cdata = 0;
+	try
+	{
+		// get the actual length of the data
+		size = recset_->GetFields()->GetItem(vtIndex)->ActualSize;
+		if(size > 0)
+		{
+			VariantInit(&varBLOB);
+			// get the chunk of data 
+			varBLOB = recset_->GetFields()->GetItem(vtIndex)->GetChunk(size);
+			
+			// If the data retrieved is array of bytes then get data from the array
+			if(varBLOB.vt == (VT_ARRAY | VT_UI1))
+			{
+				SafeArrayAccessData(varBLOB.parray,(void **)&cdata);
+				data = new unsigned char[size];
+				memcpy(data, cdata, size * sizeof(char));
+				SafeArrayUnaccessData(varBLOB.parray);
+			}
+		}
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error getBlob!";
+		return false;
+	}
+	return true;
+}
+
+bool
+TeAdoPortal::getBlob (const string& s, unsigned char* &data, long& size)
+{
+	_variant_t	varBLOB;
+	char		*cdata = 0;
+	try
+	{
+		// get the actual length of the data
+		size = recset_->Fields->Item[s.c_str()]->ActualSize;
+		if(size > 0)
+		{
+			VariantInit(&varBLOB);
+			// get the chunk of data 
+			varBLOB = recset_->Fields->Item[s.c_str()]->GetChunk(size);
+			
+			// If the data retrieved is array of bytes then get data from the array
+			if(varBLOB.vt == (VT_ARRAY | VT_UI1))
+			{
+				SafeArrayAccessData(varBLOB.parray,(void **)&cdata);
+				data = new unsigned char[size];
+				memcpy(data, cdata, size * sizeof(char));
+				SafeArrayUnaccessData(varBLOB.parray);
+			}
+		}
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error getBlob!";
+		return false;
+	}
+	return true;
+}
+
+bool
+TeAdoPortal::getRasterBlock(unsigned long& size, unsigned char* ptData)
+{
+
+	// gets the spatial data
+	unsigned long	len;
+	_variant_t	var;
+	BYTE	*buffer;
+	try
+	{
+		// get the actual length of the compressed data
+		len = recset_->Fields->Item["spatial_data"]->ActualSize;
+		if(len > 0)
+		{
+			VariantInit(&var);
+			// get the chunk of data 
+			var = recset_->Fields->Item["spatial_data"]->GetChunk(len);
+				
+			// if the data retrieved is array of bytes then get data from the array
+			if(var.vt == (VT_ARRAY | VT_UI1))
+			{
+				size = len;
+				SafeArrayAccessData(var.parray,(void **)&buffer);
+				memcpy((LPVOID)ptData,(LPVOID)buffer,len);
+				SafeArrayUnaccessData(var.parray);
+			}
+			VariantClear(&var);
+
+		}
+	}
+	catch(_com_error &e)
+	{
+		size = 0;
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error getRasterBlock!";
+		size = 0;
+		return false;
+	}
+	return true;
+}
\ No newline at end of file
diff --git a/src/terralib/drivers/ado/TeAdoDB.h b/src/terralib/drivers/ado/TeAdoDB.h
new file mode 100644
index 0000000..bd41637
--- /dev/null
+++ b/src/terralib/drivers/ado/TeAdoDB.h
@@ -0,0 +1,315 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAdoDB.h
+    \brief This file contains the particularities of a ADO driver
+*/
+#ifndef  __TERRALIB_INTERNAL_ADODB_H
+#define  __TERRALIB_INTERNAL_ADODB_H
+
+#include <TeDatabaseFactory.h>
+
+#ifdef WIN32
+#pragma warning ( disable: 4192 )
+#pragma warning ( disable: 4146 )
+#include <atldbcli.h>
+#include <iostream>
+#include <comdef.h>
+
+/*
+ *   Lets use the import directive to create some smart pointers for us
+ */
+#import "msado26.tlb"  rename("EOF", "IsEOF") rename("BOF", "IsBOF")
+#import "msadox.dll"
+#import "oledb32.dll" rename_namespace("OLEDB")
+#else
+#error ONLY FOR WINDOWS OPERATIONAL SYSTEM
+#endif
+#include <TeDatabase.h>
+
+
+#ifdef AFX_DLL
+#define EXPORT_WIN __declspec( dllexport )
+#else
+#define EXPORT_WIN
+#endif
+
+#include "TeAdoDefines.h"
+
+//! A driver class to a database accessible using ADO library
+class  TLADO_DLL  TeAdo : public TeDatabase
+{
+friend class TeAdoPortal;
+
+public: 
+	TeAdo();
+	~TeAdo();
+
+	// Methods to create and connect to a ADO database
+	virtual bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int &port=-1, bool terralibModel=true, const std::string& characterSet = "");
+	virtual bool connect (const string& host, const string& user, const string& password, const string& database, int port = -1);
+	//! Connects using a stored connection string
+	virtual bool connect (const string& fullDatabaseName = "");
+//	bool connect ();
+	virtual void connection (ADODB::_ConnectionPtr conn);
+	string connectionString() { return connectionString_; }
+
+	// Close connection
+	void close() ;
+
+	// Submit a SQL statement
+	bool execute ( const string &sql);
+	string  escapeSequence(const string& from);
+
+	// Methods to manipulate a table
+	bool tableExist(const string& table);
+	bool listTables(vector<string>& tableList);
+	bool columnExist(const string& table, const string& column,TeAttribute& attr);
+	bool allowEmptyString(const string& tableName, const string& column);
+	bool getAttributeList(const string& tableName,TeAttributeList& attList);
+	
+	virtual bool createTable(const string& table, TeAttributeList &attr);
+	virtual bool addColumn(const string& table,TeAttributeRep &rep);
+	virtual bool alterTable (const string& table, TeAttributeRep &rep, const string& oldColName="");
+	virtual bool alterTable (const string& oldTableName, const string& newTableName);
+	
+	virtual bool deleteColumn (const string& table, const string& colName);
+	virtual bool createRelation (const string& relationName, 
+					   const string& foreignTbl, const string& FTKey, 
+					   const string& relatedTbl, const string& RTKey, 
+					   bool cascadeDeletion);
+
+	TeDBRelationType existRelation(const string& tableName, const string& relName);
+
+	// Insert/Update methods
+	bool insertProject(TeProject *project);
+
+	// Insert an attribute table
+	bool insertTable(TeTable &table);
+	bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size);
+		
+	bool insertTableInfo (int layerId, TeTable &table, const string& user="");
+	bool insertRelationInfo(const int tableId, const string& tField,
+						    const string& eTable, const string& eField, int& relId);
+	bool insertLayer(TeLayer *layer);
+	bool insertRepresentation (int layerId, TeRepresentation& rep);
+	bool insertView (TeView *view);
+	virtual bool insertTheme (TeAbstractTheme *theme);
+	virtual bool insertThemeGroup (TeViewTree* tree);
+	bool insertThemeTable	(int themeId, int tableId, int relationId, int tableOrder);
+	
+	bool insertViewTree (TeViewTree *tree);
+	bool insertLegend (TeLegendEntry *legend);
+	bool insertProjection (TeProjection *proj);	
+
+	virtual bool insertPolygonSet (const string& table, TePolygonSet &ps);	
+	virtual bool insertPolygon (const string& table, TePolygon &p);
+	bool updatePolygon (const string& table, TePolygon &p);
+
+	bool insertLineSet (const string& table, TeLineSet &ls);
+	bool insertLine (const string& table, TeLine2D &l);
+	bool updateLine (const string& table, TeLine2D &l);
+
+	bool insertPointSet (const string& table, TePointSet &ps);
+	bool insertPoint (const string& table, TePoint &p);
+	bool updatePoint (const string& table, TePoint &p);
+
+	bool insertTextSet (const string& table, TeTextSet &ts);	
+	bool insertText (const string& table, TeText &t);
+
+	bool insertArcSet (const string& table, TeArcSet &as);
+	bool insertArc (const string& table,TeArc &arc);
+
+	bool insertNodeSet (const string& table, TeNodeSet &ns);	
+	bool insertNode	(const string& table, TeNode &node);	
+	bool updateNode	(const string& table, TeNode &node);	
+
+	bool insertCellSet (const string& table, TeCellSet &cs);
+	bool insertCell	(const string& table, TeCell &c);
+
+	bool ByteArrayToVariant(VARIANT &varArray, unsigned char* bytes, int nbytes);
+	bool LineToVariant(VARIANT &varArray, TeLine2D& line);
+	bool LinearRingToVariant(VARIANT &varArray, TeLinearRing& ring);
+	bool PointsToVariant(VARIANT &varArray, double* points, int npoints);
+
+	TeDatabasePortal* getPortal ();
+
+	bool insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char *buf,unsigned long size, int band=0, unsigned int res=1, unsigned int subband=0);
+
+	//! Gets the date and time following the format MMsDDsYYYYsHHsMMsSS to use with Access
+	string getSQLTime(const TeTime& time) const;
+	string getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, 
+						   const string& initialTime, const string& finalTime);
+	
+	//! Concat values in a vector using unionString as the join between each value
+	string concatValues(vector<string>& values, const string& unionString);
+
+	//! Returns the SQL function for upper case
+	string toUpper(const string& value);
+
+	//informations about the system datetime format
+	string			systemDateTimeFormat_;  //!< system format for date and time 
+	string			systemIndAM_;			//!< AM indicator for a 12 hour clock
+	string			systemIndPM_;			//!< PM indicator for a 12 hour clock
+	string			systemDateSep_;			//!< date separator
+	string			systemTimeSep_;			//!< time separator
+
+	bool updateBBox(const string& tableName, const string& idName, int idValue, const TeBox& box);
+	bool updateLayerBox(TeLayer* layer);
+	bool updateLayer(TeLayer* layer);
+
+	static string systemDateTimeFormat(string& indAM, string& indPM, string& sepD, string& sepT);
+
+	/** @name Transaction control methods 
+	  */
+	//@{ 
+	//! Begins a transaction
+	virtual bool beginTransaction(); 
+
+	//! Commits a transaction
+	virtual bool commitTransaction();
+
+	//! Rollbacks a transaction
+	virtual bool rollbackTransaction();
+   //@}
+
+protected :
+	ADODB::_ConnectionPtr connection_;
+	string connectionString_;
+};
+
+//! A portal to access a ADO database
+class  TLADO_DLL  TeAdoPortal : public TeDatabasePortal
+{
+protected:
+	
+	_bstr_t					bvalue_;
+	string					error_message_;
+	long					error_num_;
+	long					curRow_;
+	
+	TeLinearRing			getLinearRing();
+
+public :
+// Constructor / Destructor
+
+	TeAdoPortal ();
+	TeAdoPortal (TeDatabase* pDatabase);
+	~TeAdoPortal ();
+
+    // Queries
+	bool isConnected ();
+    bool isEOF();
+
+    // Move operations
+    bool moveFirst();
+    bool moveNext();
+
+	ADODB::_ConnectionPtr	connection_;
+	ADODB::_RecordsetPtr	recset_;
+
+
+// Basic database methods
+	bool query ( const string &qry, TeCursorLocation l = TeSERVERSIDE, TeCursorType t = TeBIDIRECTIONAL, TeCursorEditType e = TeREADWRITE, TeCursorDataType dt = TeTEXTCURSOR );
+	bool fetchRow ();
+	bool fetchRow (int i);
+	void freeResult ();
+	
+// specific TerraLib database access methods
+	bool fetchGeometry(TePolygon& pol);
+	bool fetchGeometry(TePolygon& pol, const unsigned int& initIndex);
+	bool fetchGeometry(TeLine2D& line);
+	bool fetchGeometry(TeLine2D& line, const unsigned int& initIndex);
+	bool fetchGeometry(TeNode& n);
+	bool fetchGeometry(TeNode& n, const unsigned int& initIndex );
+	bool fetchGeometry(TePoint& p);
+	bool fetchGeometry(TePoint& p, const unsigned int& initIndex);
+
+	char* getData (int i);
+	char* getData (const string& s);
+	double  getDouble (int i);
+	double  getDouble (const string& s);
+	int	getInt (int i);
+	int	getInt (const string& s);
+	bool  getBool (const string& s);
+	bool  getBool (int i);
+	bool  getBlob (const string& s, unsigned char* &data, long& size);
+	bool getBlob (int i, unsigned char* &data, long& size);
+
+	bool BlobToLine(TeLine2D& line);
+	bool getRasterBlock(unsigned long& size, unsigned char* ptData);
+
+	TeTime getDate (int i);
+	TeTime getDate (const string& s);
+
+	//! Returns 
+	string getDateAsString(int i);
+	string getDateAsString(const string& s);
+
+};
+
+/**
+ * @brief This is the class for TeAdo driver factory.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup DatabaseUtils
+ */
+class TLADO_DLL TeAdoFactory : public TeDatabaseFactory
+{
+  public :
+      
+    /**
+     * Default constructor
+     */
+    TeAdoFactory() : TeDatabaseFactory( std::string( "Ado" ) ) {};      
+      
+    /**
+     * Default Destructor
+     */
+    ~TeAdoFactory() {};
+      
+  protected :  
+  
+    /**
+     * Implementation for the abstract TeFactory::build.
+     *
+     * @param arg A const reference to the parameters used by the
+     * database.
+     * @return A pointer to the new generated database instance.
+     */
+    TeDatabase* build( const TeDatabaseFactoryParams& arg )
+    {
+      TeAdo* instance_ptr = new TeAdo();
+      
+      if( arg.database_ != "" ) {
+        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
+          arg.database_, arg.port_ );
+      }
+  
+      return (TeDatabase*)instance_ptr;
+    }
+};
+
+namespace {
+  static TeAdoFactory TeAdoFactory_instance;
+}; 
+
+#endif
diff --git a/src/terralib/drivers/ado/TeAdoDefines.h b/src/terralib/drivers/ado/TeAdoDefines.h
new file mode 100644
index 0000000..681ab2b
--- /dev/null
+++ b/src/terralib/drivers/ado/TeAdoDefines.h
@@ -0,0 +1,49 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAdoDefines.h
+    \brief Provides a set of general definitions used by te_ado project.
+*/
+#ifndef  __TERRALIB_INTERNAL_ADODEFINES_H
+#define  __TERRALIB_INTERNAL_ADODEFINES_H
+
+/** @defgroup TLADO_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLADO_AS_DLL
+#define TLADO_DLL __declspec(dllexport)
+#else
+#define TLADO_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TLADO_DLL
+#endif
+/** @} */ 
+
+#endif //__TERRALIB_INTERNAL_ADODEFINES_H
diff --git a/src/terralib/drivers/ado/TeAdoOracle.cpp b/src/terralib/drivers/ado/TeAdoOracle.cpp
new file mode 100644
index 0000000..ac83410
--- /dev/null
+++ b/src/terralib/drivers/ado/TeAdoOracle.cpp
@@ -0,0 +1,2838 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <stdio.h>
+#include <direct.h>
+#include <sys/stat.h>
+#include <TeAdoOracle.h>
+#include <sys/stat.h>
+#include <TeProject.h>
+
+#include <TeUtils.h>
+
+#define CHUNKSIZE	240
+
+typedef map<int,TeNode> TeNodeMap;
+
+inline void TESTHR( HRESULT hr )
+{
+	if( FAILED(hr) ) _com_issue_error( hr );
+}
+
+TeOracle::TeOracle()  
+{
+    HRESULT hr = CoInitialize(0);
+	dbmsName_ = "OracleAdo";
+    if(FAILED(hr))
+    {
+        cout << "Can't start COM!? " << endl;
+    }
+}
+
+TeOracle::~TeOracle()
+{
+}
+
+bool 
+TeOracle::newDatabase(const string& database, const string& user, const string& password, 
+					  const string& host, const int& port, bool terralibModel)
+{
+    if (!connect(host,user,password,database,port))
+        return false;
+    if (terralibModel)
+    {
+        //create conceptual model
+        if(!this->createConceptualModel())  
+			return false;
+    }
+     return true;
+}
+
+
+bool 
+TeOracle::connect (const string& host, const string& user, const string& password, const string& database, int /* port */)
+{
+	
+	string  connectionString = "Provider = OraOLEDB.Oracle.1;FetchSize=300;Password="+password+";Persist Security Info=True;User ID="+user+";Data Source="+database+"";
+
+	try
+	{
+		connection_.CreateInstance(__uuidof(ADODB::Connection));
+		HRESULT hr  = connection_->Open (connectionString.c_str(),"","",-1);
+		TESTHR( hr );
+	}
+	catch(_com_error &e)
+	{
+		isConnected_ = false;
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		isConnected_ = false;
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	isConnected_ = true;
+	database_ = database;
+	host_ = host;
+	user_ = user;
+	password_ = password;
+	return true;
+}
+
+
+bool
+TeOracle::tableExist(const string& table)
+{
+	if (table.empty())
+		return false;
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string exist = " SELECT table_name FROM all_tables WHERE";
+	exist += " TABLE_NAME = '" + TeConvertToUpperCase(table) + "'";
+	exist += " AND OWNER = '" + TeConvertToUpperCase(user_) + "'";
+
+	if(!ocip->query(exist))
+	{
+		delete ocip;
+		return false;
+	}
+
+	if(ocip->fetchRow())
+	{
+		delete ocip;
+		return true;
+	}
+	else
+	{
+		delete ocip;
+		return false;
+	}
+}
+
+
+bool 
+TeOracle::listTables(vector<string>& tableList)
+{
+	tableList.clear();
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string exist = " SELECT table_name FROM all_tables WHERE ";
+	exist += " OWNER = '" + TeConvertToUpperCase(user_) + "'";
+
+	if(!ocip->query(exist))
+	{
+		delete ocip;
+		return false;
+	}
+
+	while(ocip->fetchRow())
+		tableList.push_back (ocip->getData(0));
+			
+	delete ocip;
+	return true;
+}
+
+
+bool 
+TeOracle::columnExist(const string& table, const string& column, TeAttribute& attr)
+{
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string exist = " SELECT DATA_TYPE, DATA_LENGTH, DATA_SCALE FROM ALL_TAB_COLUMNS WHERE";
+	exist += " TABLE_NAME = '" + TeConvertToUpperCase(table) + "'";
+	exist += " AND COLUMN_NAME = '" + TeConvertToUpperCase(column) + "'";
+	exist += " AND OWNER = '" + TeConvertToUpperCase(user_) + "'";
+
+	if(!ocip->query(exist))
+	{
+		delete ocip;
+		return false;
+	}
+
+	if(ocip->fetchRow())
+	{	
+		attr.rep_.name_ = column;
+		
+		string	dataType = string(ocip->getData(0)); 
+		int		dataLength = atoi(ocip->getData(1)); 
+		int		dataScale = atoi(ocip->getData(2));
+		bool    number = false;
+		
+		if(dataType=="VARCHAR2")
+		{
+			attr.rep_.type_ = TeSTRING;
+			attr.rep_.numChar_ = dataLength;
+		}
+		else if (dataType=="BLOB")
+		{
+			attr.rep_.type_ = TeBLOB;
+			attr.rep_.numChar_ = dataLength;
+		}
+		else if (dataType=="NUMBER")
+		{
+			number = true;
+		}
+		else if (dataType== "CHAR")
+		{	
+			attr.rep_.type_ = TeCHARACTER;
+			attr.rep_.numChar_ = dataLength;
+		}
+		else if (dataType=="DATE")
+		{
+			attr.rep_.type_ = TeDATETIME;
+		}
+		else
+		{
+			attr.rep_.type_ = TeSTRING;
+			attr.rep_.numChar_ = dataLength;
+		}
+
+		if(number)
+		{
+			if(dataScale > 0)
+				attr.rep_.type_ = TeREAL;
+			else
+				attr.rep_.type_ = TeINT;
+		}
+		delete ocip;
+		return true;
+	}
+	delete ocip;
+	return false;
+}
+
+bool
+TeOracle::createTable(const string& table, TeAttributeList &attr)
+{
+	short	cont=0;
+	string pkeys ="";
+	bool	hasAutoNumber=false;
+	string	fieldName="";
+
+	TeAttributeList::iterator it = attr.begin();
+	string tablec;
+	tablec = "CREATE TABLE " + table +" (";
+	
+	while ( it != attr.end())
+	{
+		if (cont)
+			tablec += ", ";
+			
+		switch ((*it).rep_.type_)
+		{
+			case TeSTRING:
+				if((*it).rep_.numChar_ > 0)
+				{
+					tablec += (*it).rep_.name_ + " VARCHAR2(" + Te2String((*it).rep_.numChar_) + ")";					
+				}
+				else
+				{
+					tablec += (*it).rep_.name_ + " VARCHAR2(4000)";
+					
+				}
+			break;
+			
+			case TeREAL:
+				if((*it).rep_.decimals_>0)
+					tablec += (*it).rep_.name_ +" NUMBER(*,"+ Te2String((*it).rep_.decimals_) +") ";
+				else
+					tablec += (*it).rep_.name_ +" NUMBER(*,15) ";
+			break;
+			
+			case TeINT:
+			case TeUNSIGNEDINT:
+				tablec += (*it).rep_.name_ + " NUMBER(32) ";
+			break;
+
+			case TeDATETIME:
+				tablec += (*it).rep_.name_ + " DATE ";
+			break;
+
+			case TeCHARACTER:
+				tablec += (*it).rep_.name_ + " CHAR ";
+			break;
+
+			case TeBOOLEAN:
+				tablec += (*it).rep_.name_ + " NUMBER(1) ";
+			break;
+
+			case TeBLOB:
+				tablec += (*it).rep_.name_ + " BLOB ";
+			break;
+
+			case TePOINTTYPE:
+			case TePOINTSETTYPE:
+			case TeNODETYPE:
+			case TeNODESETTYPE:
+				tablec += " x		NUMBER(*,15), ";
+				tablec += " y		NUMBER(*,15) ";
+				++it;
+				cont++;
+				continue;
+
+			case TeLINE2DTYPE:
+			case TeLINESETTYPE:
+				tablec += " num_coords NUMBER(32) NOT NULL, ";
+				tablec += " lower_x NUMBER(*,15) NOT NULL, ";
+				tablec += " lower_y NUMBER(*,15) NOT NULL, ";
+				tablec += " upper_x NUMBER(*,15) NOT NULL, ";
+				tablec += " upper_y NUMBER(*,15) NOT NULL, ";
+				tablec += " ext_max NUMBER(*,15) NOT NULL, ";
+				tablec += " spatial_data BLOB ";
+				++it;
+				cont++;
+				continue;
+
+			case TePOLYGONTYPE:
+			case TePOLYGONSETTYPE:
+				tablec += " num_coords NUMBER(32) NOT NULL,";
+				tablec += " num_holes  NUMBER(32) NOT NULL,";
+				tablec += " parent_id  NUMBER(32) NOT NULL,";
+				tablec += " lower_x    NUMBER(*,15) NOT NULL,";
+				tablec += " lower_y    NUMBER(*,15) NOT NULL,";
+				tablec += " upper_x    NUMBER(*,15) NOT NULL,";
+				tablec += " upper_y    NUMBER(*,15) NOT NULL,";
+				tablec += " ext_max    NUMBER(*,15) NOT NULL,";
+				tablec += " spatial_data BLOB ";
+				++it;
+				cont++;
+				continue;
+
+			case TeCELLTYPE:
+			case TeCELLSETTYPE:
+				tablec += " col_number	NUMBER(32) NOT NULL,";
+				tablec += " row_number	NUMBER(32) NOT NULL,";
+				tablec += " lower_x		NUMBER(*,15),";
+				tablec += " lower_y		NUMBER(*,15),";
+				tablec += " upper_x		NUMBER(*,15),";
+				tablec += " upper_y		NUMBER(*,15) ";
+				++it;
+				cont++;
+				continue;					
+
+			case TeRASTERTYPE:
+				tablec += " band_id NUMBER(32) NOT NULL, ";
+				tablec += " resolution_factor NUMBER(32), ";
+				tablec += " subband NUMBER(32),";
+				tablec += " lower_x NUMBER(*,15) DEFAULT 0.0, ";
+				tablec += " lower_y NUMBER(*,15) DEFAULT 0.0, ";
+				tablec += " upper_x NUMBER(*,15) DEFAULT 0.0, ";
+				tablec += " upper_y NUMBER(*,15) DEFAULT 0.0, ";							
+				tablec += " block_size NUMBER(32), ";
+				tablec += " spatial_data BLOB ";
+				++it;
+				cont++;
+				continue;
+
+			case TeTEXTTYPE:
+			case TeTEXTSETTYPE:
+			default:
+				tablec += (*it).rep_.name_ + " VARCHAR2(255) ";
+			break;
+		}
+
+		//default values
+		if(!((*it).rep_.defaultValue_.empty()))
+			tablec += " DEFAULT '" + (*it).rep_.defaultValue_ + "' ";
+
+		//not null values
+		if(!((*it).rep_.null_))
+			tablec += " NOT NULL ";
+
+		// auto number
+		if((*it).rep_.isAutoNumber_ && ((*it).rep_.type_==TeINT || (*it).rep_.type_==TeUNSIGNEDINT))  
+		{
+			hasAutoNumber=true;
+			fieldName=(*it).rep_.name_;
+		}
+
+		// check if column is part of primary key
+		if ((*it).rep_.isPrimaryKey_ && (*it).rep_.type_ != TeBLOB )
+		{
+			if (!pkeys.empty())
+				pkeys += ", ";
+			pkeys += (*it).rep_.name_;
+		}
+
+		++it;
+		cont++;
+	}
+
+	if(!pkeys.empty())
+		tablec += ", PRIMARY KEY (" + pkeys + ") ";
+
+	tablec += ")";
+
+	if(!execute(tablec))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error creating table " + table;
+
+		return false;
+	}
+
+	if(hasAutoNumber)
+	{
+		string dropSql = " DROP TRIGGER "+ getNameTrigger(table); 
+		execute(dropSql);
+		dropSql = " DROP SEQUENCE "+ getNameSequence(table); 
+		execute(dropSql);
+
+		if(!createSequence(table))
+		{
+			deleteTable(table);
+			return false;
+		}
+		
+		if(!createAutoIncrementTrigger(table,fieldName))
+		{
+			deleteTable(table);
+			string sql= "DROP SEQUENCE "+ getNameSequence(table);
+			execute(sql); 
+			return false;
+		}
+	}
+	return true;
+}
+
+
+bool
+TeOracle::deleteTable (const string& table)
+{
+//	int f =	table.find ("te_collection", std::string::npos);
+	int f =	table.find ("te_collection");
+
+	if( table=="te_theme" ||
+		table=="te_layer" ||
+		table=="te_representation" ||
+		table=="te_tables_relation" ||
+		table=="te_layer_table" ||
+		table=="te_raster_metadata" ||
+		table=="te_projection" ||
+		table=="te_view" ||
+		table=="te_chart_params" ||
+		table=="te_legend" ||
+		table=="te_visual" ||
+		f == 0)
+	{
+		errorMessage_ = "N�o � poss�vel deletar tabelas do modelo!";
+		return false;
+	}
+
+	string del = "DROP TABLE " + table;
+	if(tableExist(table))
+	{
+		if(!execute(del))
+			return false;
+	}
+
+	string seq = "DROP SEQUENCE " + getNameSequence(table);
+	execute(seq);
+		
+	string trig = "DROP TRIGGER " + getNameTrigger(table);
+	execute(trig);
+		
+	return true;
+}
+
+bool 
+TeOracle::addColumn (const string& table, TeAttributeRep &rep)
+{
+	if(!tableExist(table))
+		return false;
+
+	string tab;
+	tab = " ALTER TABLE " + table + " ADD ( ";
+	tab += rep.name_ + "  ";
+	
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if (rep.numChar_ > 0)
+				tab  += "VARCHAR2(" + Te2String(rep.numChar_) + ") ";
+			else
+				tab += "VARCHAR2(4000) ";
+			break;
+		
+		case TeREAL:
+			if(rep.decimals_>0)
+				tab += " NUMBER(*," + Te2String(rep.decimals_) +") ";
+			else
+				tab += " NUMBER(*,38) ";
+			break;
+			
+		case TeINT:
+			tab += "NUMBER(32)";
+			break;
+
+		case TeDATETIME:
+			tab += "DATE";
+			break;
+
+		case TeCHARACTER:
+			tab += "CHAR";
+			break;
+
+		case TeBOOLEAN:
+			tab += "NUMBER(1)";
+			break;
+		
+		case TeBLOB:
+			tab += "BLOB";
+			break;
+		
+		default:
+			tab += "VARCHAR2(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+	if (rep.isAutoNumber_)
+		tab += " AUTO_INCREMENT)";
+	else
+		tab += " NULL)";
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting a column to table " + table + " !";
+		return false;
+	}
+
+	alterTableInfoInMemory(table);
+	return true;
+}
+
+bool 
+TeOracle::alterTable (const string& table, TeAttributeRep &rep, const string& oldColName)
+{
+	if(!tableExist(table))
+		return false;
+
+	if(!oldColName.empty() && oldColName != rep.name_ ) //rename column
+	{
+		string add = " ALTER TABLE "+ table +" RENAME COLUMN "+ oldColName +" TO "+ rep.name_;
+		if(!execute(add))
+		{
+			if(errorMessage_.empty())
+				errorMessage_ = "Error alter table " + table + " !";
+			return false;
+		}
+	}
+
+	string tab = " ALTER TABLE " + table + " MODIFY ( ";
+	tab += rep.name_ + "  ";
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if ( rep.numChar_ > 0)
+				tab  += "VARCHAR2(" + Te2String(rep.numChar_) + ") ";
+			else
+				tab += "VARCHAR2(4000) ";
+			break;
+
+		case TeREAL:
+			if(rep.decimals_>0)
+				tab += " NUMBER(*,"+ Te2String(rep.decimals_) +") ";
+			else
+				tab += " NUMBER(*,38) ";
+		break;
+		
+		case TeINT:
+			tab += " NUMBER(32) ";
+			break;
+
+		case TeDATETIME:
+			tab += " DATE ";
+			break;
+
+		case TeCHARACTER:
+			tab += " CHAR ";
+			break;
+
+		case TeBOOLEAN:
+			tab += " NUMBER(1) ";
+			break;
+		
+		default:
+			tab += " VARCHAR2(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+
+	tab += " )";
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error alter table " + table + " !";
+		return false;
+	}
+	
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + table + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+
+	if(tableId.empty() == false)
+	{
+		if(oldColName.empty() == false) // column name changed
+		{
+			 // update relation
+			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
+			sql += " WHERE related_table_id = " + tableId;
+			sql += " AND related_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
+			sql += " WHERE external_table_name = '" + table + "'";
+			sql += " AND external_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			 // update grouping
+			sql = "UPDATE te_grouping SET grouping_attr = '" + table + "." + rep.name_ + "'";
+			sql += " WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+		else // column type changed
+		{
+			// delete relation
+			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+			sql += " AND related_attr = '" + rep.name_ + "')";
+			sql += " OR (external_table_name = '" + table + "'";
+			sql += " AND external_attr = '" + rep.name_ + "')";
+			if(execute(sql) == false)
+				return false;
+
+			// delete grouping
+			TeDatabasePortal* portal = getPortal();
+			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(portal->query(sql) && portal->fetchRow())
+			{
+				string themeId = portal->getData(0);
+
+				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
+				if(execute(sql) == false)
+				{
+					delete portal;
+					return false;
+				}
+			}
+			delete portal;
+
+			sql = "DELETE FROM te_grouping";
+			sql += " WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+	}
+	alterTableInfoInMemory(table);
+	return true;
+}
+
+bool 
+TeOracle::alterTable(const string& oldTableName, const string& newTablename)
+{
+	string sql = " ALTER TABLE "+ oldTableName +" RENAME TO "+ newTablename;
+	if(!this->execute(sql))
+		return false;
+
+	//update te_layer_table
+	sql = " UPDATE te_layer_table ";
+	sql += " SET attr_table = '"+ newTablename +"'";
+	sql += " WHERE attr_table = '"+ oldTableName +"'";
+	execute(sql);
+
+	//update te_tables_relation
+	sql = " UPDATE te_tables_relation ";
+	sql += " SET external_table_name = '"+ newTablename +"'";
+	sql += " WHERE external_table_name = '"+ oldTableName +"'";
+	execute(sql);
+	
+	alterTableInfoInMemory(newTablename, oldTableName);
+	return true;
+}
+
+
+bool
+TeOracle::createRelation (const string& name, const string& table, const string& fieldName, const string& relatedTable, const string& relatedField, bool cascadeDeletion)
+{
+	
+	string relation = "ALTER TABLE " + table + " ADD ";
+	relation += " CONSTRAINT " + name;
+	relation += " FOREIGN KEY ( " + fieldName + ") "; 
+	relation += " REFERENCES " + relatedTable + "(" + relatedField + ")";
+		
+	if (cascadeDeletion)
+		relation += " ON DELETE CASCADE ";
+
+	if(!execute(relation))
+		return false;
+
+	return true;
+}
+
+
+TeDBRelationType 
+TeOracle::existRelation(const string& tableName, const string& relName)
+{
+
+	TeOraclePortal  *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return TeNoRelation;
+	
+	string integ = " SELECT DELETE_RULE  ";
+	integ += " FROM   all_constraints ";
+	integ += " WHERE  CONSTRAINT_TYPE = 'R'"; 
+	integ += " AND    OWNER = '" + TeConvertToUpperCase(user_) + "'";
+	integ += " AND    CONSTRAINT_NAME = '" + TeConvertToUpperCase(relName) + "'";
+	
+	string temp = " AND    TABLE_NAME = '" + TeConvertToUpperCase(tableName) + "' ";   
+	integ += temp;
+	
+	if(!ocip->query(integ))
+	{
+		delete ocip;
+		return TeNoRelation;
+	}
+
+	string cascade;
+	if(ocip->fetchRow())
+	{
+		cascade = string(ocip->getData(0));
+		if(cascade== "CASCADE")
+		{
+			delete ocip;
+			return TeRICascadeDeletion;
+		}
+		
+		delete ocip;
+		return TeRINoCascadeDeletion;
+	}
+
+	delete ocip;
+	return TeNoRelation;	
+}
+
+
+TeDatabasePortal*  
+TeOracle::getPortal ()
+{
+	TeOraclePortal* portal = new TeOraclePortal (this);
+	return portal;
+}
+
+bool
+TeOracle::createAutoIncrementTrigger(const string &tableName, const string &fieldName)
+{
+	string nameTri = getNameTrigger(tableName);
+	string nameSeq = getNameSequence(tableName);
+
+	string tri;
+	tri = "CREATE TRIGGER " + nameTri; 
+	tri += " BEFORE INSERT ON "+tableName; 
+	tri += " for each row";
+	tri += " begin";
+	tri += " select "+nameSeq+".nextval";
+	tri += " into :new."+fieldName;
+	tri += " from dual;";
+	tri += " end;";
+
+	if(!execute(tri))
+	{	
+		if(errorMessage_.empty())
+			errorMessage_ = "Error creating trigger to table " + tableName + " !";
+		return false;
+	}
+	return true;
+}
+
+
+bool
+TeOracle::createSequence(const string &tableName)
+{
+	string nameSeq = getNameSequence(tableName);
+	
+	string seq = " CREATE SEQUENCE " + nameSeq;
+	seq += " START WITH 1 INCREMENT BY 1 ORDER ";
+	if (!execute(seq))
+	{	
+		if(errorMessage_.empty())
+			errorMessage_ = "Error creating sequence to table " + tableName + " !";
+		return false;
+	}
+
+	return true;
+}
+
+string
+TeOracle::getNameSequence(const string &tableName)
+{
+	string name;
+	if(tableName.size()>21)
+		name = tableName.substr(0,20) + "_seq";
+	else
+		name = tableName + "_seq";
+
+	return name;
+}
+
+string
+TeOracle::getNameTrigger(const string &tableName)
+{
+	string name;
+	if(tableName.size()>21)
+		name = tableName.substr(0,20) + "_tri";
+	else
+		name = tableName + "_tri";
+
+	return name;
+}
+
+bool
+TeOracle::deleteLayer(int layerId)
+{
+	//Delete attributes tables
+	if(!deleteLayerTable(layerId))
+		return false;
+
+	TeOraclePortal* portal = (TeOraclePortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	string geomTable;
+	string sql = "SELECT projection_id FROM te_layer WHERE layer_id = ";
+	sql += Te2String(layerId);
+
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	string projId = portal->getData("projection_id");
+	portal->freeResult();
+
+	// Get all representations that are associated to this layer
+	sql = "SELECT * FROM te_representation WHERE layer_id = "+ Te2String(layerId);
+	if (!portal->query (sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	while (portal->fetchRow())
+	{	// Delete the geometry tables
+		geomTable = portal->getData("geom_table");
+	
+		// Delete lut table
+		TeGeomRep rep = TeGeomRep(atoi(portal->getData("geom_type")));
+		if (rep == TeRASTER || rep == TeRASTERFILE)
+		{
+			TeOraclePortal* portal2 = (TeOraclePortal*)this->getPortal();
+			sql = "SELECT lut_table, raster_table FROM " + geomTable;
+			string tabName;
+			if (!portal2->query (sql))
+			{
+				delete portal2;
+				continue;
+			}
+
+			while (portal2->fetchRow())
+			{
+				// remove lut table
+				tabName = portal2->getData(0);
+				if (!tabName.empty() && this->tableExist(tabName))
+				{
+					sql = "DROP TABLE " + tabName;
+					this->execute(sql);
+
+					sql= "DROP SEQUENCE "+ getNameSequence(tabName);
+					this->execute(sql); 
+				}
+				// remove raster table
+				tabName = portal2->getData(1);
+				if (!tabName.empty() && this->tableExist(tabName))
+				{
+					sql = "DROP TABLE " + tabName;
+					this->execute(sql);
+
+					sql= "DROP SEQUENCE "+ getNameSequence(tabName);
+					this->execute(sql); 
+				}
+			}
+			delete portal2;
+			// remove raster metadata table
+			tabName = geomTable + "_metadata";
+			if (!tabName.empty() && this->tableExist(tabName))
+			{
+				sql = "DROP TABLE " + tabName;
+				this->execute(sql);
+
+				sql= "DROP SEQUENCE "+ getNameSequence(tabName);
+				this->execute(sql); 
+			}
+		}
+		if (this->tableExist(geomTable))
+		{
+			sql = "DROP TABLE " + geomTable;
+			if (!this->execute(sql) )
+			{
+				delete portal;
+				return false;
+			}
+			
+			sql= "DROP SEQUENCE "+ getNameSequence(geomTable);
+			this->execute(sql);
+		}
+	}
+
+	portal->freeResult();
+	if (existRelation("te_representation","fk_rep_layer_id") != TeRICascadeDeletion)
+	{
+		// Delete entries into representations table
+		sql = "DELETE FROM te_representation WHERE layer_id = " +Te2String(layerId);
+		if (!this->execute(sql) )
+		{
+			delete portal;
+			return false;
+		}
+	}
+
+	// delete layer themes
+	sql = "SELECT theme_id FROM te_theme WHERE layer_id=" + Te2String(layerId);
+	if (!portal->query (sql))
+	{
+		delete portal;
+		return false;
+	}
+	
+	int themeId;
+	while (portal->fetchRow())
+	{	
+		themeId = atoi(portal->getData("theme_id"));
+		this->deleteTheme(themeId);
+	}
+	
+	sql = "DELETE FROM te_layer WHERE layer_id=" + Te2String(layerId);
+	if (!this->execute(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	// delete layer projection
+	sql = "DELETE FROM te_projection WHERE projection_id = "+ projId;
+	if (!this->execute(sql))
+	{	
+		delete portal;
+		return false;
+	}
+
+	// remove all the items� themes associated to the layer to be removed
+	TeThemeMap::iterator it;
+	for (it = themeMap().begin(); it != themeMap().end(); ++it)
+	{
+		TeTheme *theme = (TeTheme*)it->second;
+		if (theme->layer()->id() == layerId)
+		{
+			themeMap().erase(theme->id());
+			delete theme;
+		}
+	}
+
+	// Delete layer and its entry in the layer map
+	TeLayer* layer = layerMap()[layerId];
+	layerMap().erase(layerId);
+	delete layer;
+
+	delete portal;
+	return true;
+}
+
+bool
+TeOracle::insertProjection(TeProjection* proj)
+{
+	string insert = "INSERT INTO te_projection (projection_id, name, long0, lat0,";
+	insert += " offx, offy, stlat1, stlat2, unit, scale, hemis, datum, ";
+	insert += " radius, flattening, dx , dy, dz ) VALUES ( ";
+	insert += "te_projection_seq.NEXTVAL";
+	insert += ", '" + escapeSequence(proj->name()) + "'";
+	insert += ", " + Te2String(proj->params().lon0*TeCRD,15);
+	insert += ", " + Te2String(proj->params().lat0*TeCRD,15);
+	insert += ", " + Te2String(proj->params().offx,15);
+	insert += ", " + Te2String(proj->params().offy,15);
+	insert += ", " + Te2String(proj->params().stlat1*TeCRD,15);
+	insert += ", " + Te2String(proj->params().stlat2*TeCRD,15);
+	insert += ", '" + escapeSequence(proj->params().units) + "'";
+	insert += ", " + Te2String(proj->params().scale,15);
+	insert += ", " + Te2String(proj->params().hemisphere);
+	insert += ", '" + escapeSequence(proj->params().datum.name()) + "'";
+	insert += ", " + Te2String(proj->params().datum.radius(),15);
+	insert += ", " + Te2String(proj->params().datum.flattening(),15);
+	insert += ", " + Te2String(proj->params().datum.xShift(),15);
+	insert += ", " + Te2String(proj->params().datum.yShift(),15);
+	insert += ", " + Te2String(proj->params().datum.zShift(),15);
+	insert += ")";
+
+	if(!execute(insert))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_projection!";   
+		return false;
+	}
+
+	TeOraclePortal *ocip = (TeOraclePortal*) getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT te_projection_seq.CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence te_projection_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	proj->id(atoi((const char*)ocip->getData(0))); 
+	delete ocip;
+
+	return true;
+}
+
+bool 
+TeOracle::insertTableInfo(int layerId, TeTable &table, const string& user)
+{
+	string seq = getNameSequence("te_layer_table");
+	string ins = "INSERT INTO te_layer_table ( "; 
+	ins += " table_id, layer_id, attr_table, unique_id, attr_link, ";
+	ins += " attr_initial_time, attr_final_time, attr_time_unit, ";
+	ins += " attr_table_type, user_name) VALUES ( ";
+	ins += seq + ".NEXTVAL ";
+	
+	if(layerId>0)
+		ins += ", " + Te2String(layerId);
+	else
+		ins += ", NULL ";
+	
+	ins += ", '" + escapeSequence(table.name()) + "'";
+	ins += ", '" + escapeSequence(table.uniqueName()) + "'";
+	ins += ", '" + escapeSequence(table.linkName()) + "'";
+	ins += ", '" + escapeSequence(table.attInitialTime()) + "'";
+	ins += ", '" + escapeSequence(table.attFinalTime()) + "'";
+	ins += ",  " + Te2String(table.attTimeUnit());
+	ins += ",  " + Te2String(table.tableType());
+	ins += ", '" +  escapeSequence(user) + "'";
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting tables information!";   
+		return false;
+	}
+
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	ins = "SELECT "+ seq +".CURRVAL FROM DUAL";
+	if (!ocip->query(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence te_layertable_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0));
+	table.setId(index);
+	delete ocip;
+
+	return true;
+}
+
+bool 
+TeOracle::insertRelationInfo(const int tableId, const string& tField,
+						  const string& rName, const string& rField, int& relId)
+{
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	relId = -1;
+
+	relId = -1;
+	string sel = "SELECT relation_id FROM te_tables_relation WHERE";
+	sel += " related_table_id = " + Te2String(tableId);
+	sel += " AND related_attr = '" + tField + "'";
+	sel += " AND external_table_name = '" + rName + "'";
+	sel += " AND external_attr = '" + rField + "'";
+	if (!ocip->query(sel))
+	{
+		delete ocip;
+		return false;
+	}
+
+	if (ocip->fetchRow())
+	{
+		relId = atoi(ocip->getData(0));
+		delete ocip;
+		return true;
+	}
+
+	string seq, ins;
+	seq = getNameSequence("te_tables_relation");	
+	ins = " INSERT INTO te_tables_relation ( "; 
+	ins += " relation_id, related_table_id, ";
+	ins += " related_attr, external_table_name, external_attr) VALUES ( ";
+	ins += seq +".NEXTVAL "; 
+	ins += ",  " + Te2String(tableId);
+	ins += ", '" + escapeSequence(tField) + "'";
+	ins += ", '" +  escapeSequence(rName) + "'";
+	ins += ", '" +  escapeSequence(rField) + "'";
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting tables information!";   
+		delete ocip;
+		return false;
+	}
+
+	ocip->freeResult();
+	ins = "SELECT "+ seq +".CURRVAL FROM DUAL";
+	if (!ocip->query(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence te_table_relation_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	relId = atoi((const char*)ocip->getData(0));
+	delete ocip;
+	return true;
+}
+
+
+bool 
+TeOracle::insertView (TeView *view)
+{
+		// save it�s projection
+	TeProjection* proj = view->projection();
+	if ( !proj || !insertProjection(proj))
+	{
+		errorMessage_ = "N�o � poss�vel inserir vista sem proje��o";
+		return false;
+	}
+
+	string ins = "INSERT INTO te_view (view_id, projection_id, name, user_name, visibility, lower_x, lower_y, upper_x, upper_y, current_theme)";
+	ins += " VALUES (";
+	ins += "te_view_seq.NEXTVAL";
+	ins += ", " + Te2String(proj->id());
+	ins += ", '" + escapeSequence(view->name ()) + "'";
+	ins += ", '" + escapeSequence(view->user ()) + "'";
+	ins += ", " + Te2String((int)view->isVisible());
+	ins += ", " + Te2String(view->getCurrentBox().lowerLeft().x(),15);
+	ins += ", " + Te2String(view->getCurrentBox().lowerLeft().y(),15);
+	ins += ", " + Te2String(view->getCurrentBox().upperRight().x(),15);
+	ins += ", " + Te2String(view->getCurrentBox().upperRight().y(),15);
+	if(view->getCurrentTheme() > 0)
+		ins += ", " + Te2String(view->getCurrentTheme());
+	else
+		ins += ", null";
+	ins += " )";
+	
+	if(!execute (ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_view!";   
+		return false;
+	}
+
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	ins = "SELECT te_view_seq.CURRVAL FROM DUAL";
+	if (!ocip->query(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence te_view_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0));
+	view->id(index);
+	delete ocip;
+
+	int size = view->size();
+
+	for (int th=0; th<size; th++)
+	{
+		TeViewNode* node = view->get(th);
+		if (node->type() == TeTHEME)
+		{
+			TeTheme *theme = (TeTheme*) node;
+			insertTheme (theme);
+		}
+		else
+		{
+			TeViewTree* tree = (TeViewTree*)node;
+			insertViewTree (tree);
+		}
+	}
+
+	// Insert view in the view map
+	viewMap()[view->id()] = view;
+	return true;
+}
+
+bool
+TeOracle::insertViewTree (TeViewTree *tree)
+{
+	
+	string ins = "INSERT INTO te_theme (theme_id, view_id, name, ";
+	ins += " parent_id, node_type, priority) VALUES (";
+	ins += " te_theme_seq.NEXTVAL";
+	ins += ", " + Te2String(tree->view());
+	ins += ", '" + escapeSequence(tree->name()) + "'";
+	ins += ", " + Te2String(tree->parentId());
+	ins += ", " + Te2String(tree->type());
+	ins += ", " + Te2String(tree->priority());
+	ins += ")";
+	
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_theme!";
+		return false;
+	}
+
+	TeOraclePortal	*ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT te_theme_seq.CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence te_theme_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0)); 
+	tree->id(index);
+	delete ocip;
+	
+	return true;
+}
+
+
+bool 
+TeOracle::insertTheme (TeAbstractTheme *theme)
+{
+
+	double maxScale = theme->maxScale ();
+	if(maxScale==TeMAXFLOAT)
+		maxScale = 0.;
+
+	string ins = "INSERT INTO te_theme (theme_id, layer_id, view_id, name, ";
+	ins += " parent_id, priority, node_type, min_scale, max_scale, ";
+	ins += " generate_attribute_where, generate_spatial_where, generate_temporal_where, ";
+	ins += " collection_table, visible_rep, enable_visibility, lower_x, lower_y, upper_x, upper_y, creation_time) ";
+	ins += " VALUES (";
+	ins += "te_theme_seq.NEXTVAL";
+
+	if(theme->type()==TeTHEME)
+		ins += ", " + Te2String(static_cast<TeTheme*>(theme)->layerId());
+	else
+		ins += ", NULL ";
+
+	ins += ", " + Te2String(theme->view());
+	ins += ", '" + escapeSequence(theme->name()) + "'";
+	ins += ", " + Te2String(theme->parentId ());
+	ins += ", " + Te2String(theme->priority());
+	ins += ", " + Te2String(theme->type ());
+	ins += ", " + Te2String (theme->minScale(),15);
+	ins += ", " + Te2String (maxScale,15);
+	ins += ", '" + escapeSequence(theme->attributeRest()) + "'";
+	ins += ", '" + escapeSequence(theme->spatialRest()) + "'";
+	ins += ", '" + escapeSequence(theme->temporalRest()) + "'";
+	
+	if(theme->type()==TeTHEME)
+		ins += ", '" + escapeSequence(static_cast<TeTheme*>(theme)->collectionTable()) + "'";
+	else
+		ins += ", '' ";
+	
+	ins += ", " + Te2String(theme->visibleRep());
+	ins += ", " + Te2String(theme->visibility());
+	ins += ", " + Te2String (theme->box().x1(),15);
+	ins += ", " + Te2String (theme->box().y1(),15);
+	ins += ", " + Te2String (theme->box().x2(),15);
+	ins += ", " + Te2String (theme->box().y2(),15);
+	ins += ", " + getSQLTime(theme->getCreationTime());
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_theme!";   
+		return false;
+	}
+
+	TeOraclePortal  *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT te_theme_seq.CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence te_theme_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0)); 
+	theme->id(index);
+	delete ocip;
+	
+	if(theme->type()==TeTHEME || theme->type()==TeEXTERNALTHEME)
+	{
+		string colName = static_cast<TeTheme*>(theme)->collectionTable(); 
+		//insert collection name
+		if(colName.empty())
+		{
+			colName = "te_collection_" + Te2String(index);
+			static_cast<TeTheme*>(theme)->collectionTable(colName);	
+			
+			ins = "UPDATE te_theme SET ";
+			ins += " collection_table = '" + escapeSequence(colName) + "'";
+			ins += " WHERE theme_id = " + Te2String (index);
+			
+			if(!execute(ins))
+			{
+				if(errorMessage_.empty())
+					errorMessage_ = "Error inserting in the table te_theme!";   
+				return false;
+			}
+		}
+	}
+
+	if(theme->parentId() == 0)
+	{
+		std::string sql = "UPDATE te_theme SET";
+		sql += "  parent_id = " + Te2String(theme->id());
+		sql += " WHERE theme_id = ";
+		sql += Te2String(theme->id());
+
+		theme->parentId(theme->id());
+
+		if(!this->execute(sql))
+			return false;
+	}
+	
+	bool status;
+
+	// insert grouping
+	int numSlices = 0;
+	if(theme->grouping().groupMode_ != TeNoGrouping)
+	{
+		if(!insertGrouping (theme->id(), theme->grouping()))
+			return false;
+		numSlices = theme->grouping().groupNumSlices_;
+	}
+	
+	// insert legend
+	theme->outOfCollectionLegend().group(-1); 
+	theme->outOfCollectionLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->outOfCollectionLegend())); 
+	if (!status)
+		return status;
+
+	theme->withoutDataConnectionLegend().group(-2); 
+	theme->withoutDataConnectionLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->withoutDataConnectionLegend())); 
+	if (!status)
+		return status;
+
+	theme->defaultLegend().group(-3); 
+	theme->defaultLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->defaultLegend())); 
+	if (!status)
+		return status;
+
+	theme->pointingLegend().group(-4); 
+	theme->pointingLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->pointingLegend())); 
+	if (!status)
+		return status;
+
+	theme->queryLegend().group(-5); 
+	theme->queryLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->queryLegend())); 
+	if (!status)
+		return status;
+
+	theme->queryAndPointingLegend().group(-6); 
+	theme->queryAndPointingLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->queryAndPointingLegend())); 
+	if (!status)
+		return status;
+
+	for (int i = 0; i < numSlices; i++)
+	{
+		theme->legend()[i].group(i);
+		theme->legend()[i].theme(theme->id());
+		status = insertLegend (&(theme->legend()[i]));
+		if (!status)
+			return status;
+	}
+	if (!status)
+		return status;
+
+	//insert metadata theme
+	if(!theme->saveMetadata(this))
+		return false;
+
+	themeMap()[theme->id()] = theme;
+
+	if(theme->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(theme)))
+		return false;
+
+    return true;
+}
+
+
+bool 
+TeOracle::insertThemeTable (int themeId, int tableId, int relationId, int tableOrder)
+{
+	string ins = "INSERT INTO te_theme_table ";
+	ins += " (theme_table_id, theme_id, table_id, relation_id, table_order)";
+	ins += " VALUES ( ";
+	ins += getNameSequence("te_theme_table") +".NEXTVAL ";
+	ins += ", "+ Te2String(themeId);
+	ins += ", "+ Te2String(tableId);
+	
+	if(relationId>0)
+		ins += ", "+ Te2String(relationId);
+	else
+		ins += ", NULL ";
+
+	ins += ", "+ Te2String(tableOrder);
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_theme_table!";   
+		return false;
+	}
+
+	return true;
+}
+
+bool 
+TeOracle::insertThemeGroup(TeViewTree* tree)
+{
+	string ins = "INSERT INTO te_theme (theme_id, view_id, name, ";
+	ins += " parent_id, priority, node_type ) VALUES (";
+	ins += "te_theme_seq.NEXTVAL";
+	ins += ", " + Te2String(tree->view());
+	ins += ", '" + escapeSequence(tree->name()) + "'";
+	ins += ", " + Te2String(tree->parentId ());
+	ins += ", " + Te2String(tree->priority());
+	ins += ", " + Te2String(1);
+	ins += ")";
+
+	TeOraclePortal  *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+	
+	try
+	{
+		if(!execute(ins))
+		{
+			if(errorMessage_.empty())
+				errorMessage_ = "Error inserting in the table te_theme!";   
+			return false;
+		}
+
+		string seq = "SELECT te_theme_seq.CURRVAL FROM DUAL";
+		if(!ocip->query(seq))
+		{
+			if(errorMessage_.empty())
+				errorMessage_ = "Error in the sequence te_theme_seq!";  
+			delete ocip;
+			return false;
+		}
+
+		if(!ocip->fetchRow())
+		{
+			errorMessage_ = "Sequence value not found!";
+			delete ocip;
+			return false;
+		}
+
+		int index = atoi((const char*)ocip->getData(0)); 
+		tree->id(index);
+		
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error inserting in the table te_theme!";
+		if(ocip)
+			delete ocip;
+		return false;
+	}
+
+	delete ocip;
+	return true;
+}
+
+
+bool 
+TeOracle::generateLabelPositions (TeTheme *theme, const std::string& objectId )
+{
+	string	geomTable, upd;
+	string	collTable = theme->collectionTable();
+	
+	if((collTable.empty()) || (!tableExist(collTable)))
+		return false;
+
+	if( theme->layer()->hasGeometry(TeCELLS)  )
+	{
+		geomTable = theme->layer()->tableName(TeCELLS);
+		
+		upd= "UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(lower_x + (upper_x - lower_x)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(lower_y + (upper_y - lower_y)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+
+	if( theme->layer()->hasGeometry(TePOLYGONS) )
+	{
+		geomTable = theme->layer()->tableName(TePOLYGONS);
+		
+		upd= "UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(lower_x + (upper_x - lower_x)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(lower_y + (upper_y - lower_y)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+	
+	if( theme->layer()->hasGeometry(TeLINES) )
+	{
+		geomTable = theme->layer()->tableName(TeLINES);
+
+		upd= "UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(lower_x + (upper_x - lower_x)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(lower_y + (upper_y - lower_y)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+	
+	if(theme->layer()->hasGeometry(TePOINTS))
+	{
+		geomTable = theme->layer()->tableName(TePOINTS);
+		
+		upd= " UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(x) ";
+		upd += " FROM " + geomTable + " p WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(y) ";
+		upd += " FROM " + geomTable + " p WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+
+	if (!upd.empty())
+	{
+		if (!objectId.empty())
+		{
+			upd += " AND c_object_id='"+objectId+"'";
+		}
+		if(!execute(upd))
+			return false;
+	}
+	return true;
+}
+
+bool TeOracle::updateBBox(const string& tableName, const string& idName, 
+							 int idValue, const TeBox& box)
+{
+	string sql;
+	sql = "UPDATE "+tableName+" SET ";
+	//the same precision that the insertpoint
+	sql += " lower_x = " + Te2String(box.x1(),15) + " ";
+	sql += ", lower_y = " + Te2String(box.y1(),15) + " ";
+	sql += ", upper_x = " + Te2String(box.x2(),15) + " ";
+	sql += ", upper_y = " + Te2String(box.y2(),15) + " ";
+	sql += " WHERE "+idName+" = " + Te2String(idValue);
+	return (this->execute (sql));
+}
+
+bool
+TeOracle::updateLayerBox(TeLayer *layer)
+{
+	if (!layer)
+		return false;
+
+	string sql;
+	sql = "UPDATE te_layer SET ";
+	//the same precision that the insertpoint
+	sql += " lower_x = " + Te2String(layer->box().x1(),15) + " ";
+	sql += ", lower_y = " + Te2String(layer->box().y1(),15) + " ";
+	sql += ", upper_x = " + Te2String(layer->box().x2(),15) + " ";
+	sql += ", upper_y = " + Te2String(layer->box().y2(),15) + " ";
+	sql += " WHERE layer_id = " + Te2String(layer->id(),15);
+	return (this->execute (sql));
+}
+
+bool
+TeOracle::updateLayer(TeLayer *layer)
+{
+	if (!layer)
+		return false;
+
+	string sql;
+	sql = "UPDATE te_layer SET ";
+	sql += "name = '" + layer->name() + "' ";
+	//the same precision that the insertpoint
+	sql += ", lower_x = " + Te2String(layer->box().x1(),15) + " ";
+	sql += ", lower_y = " + Te2String(layer->box().y1(),15) + " ";
+	sql += ", upper_x = " + Te2String(layer->box().x2(),15) + " ";
+	sql += ", upper_y = " + Te2String(layer->box().y2(),15) + " ";
+	if(layer->getEditionTime().isValid())
+	{
+		sql += ", edition_time = " + this->getSQLTime(layer->getEditionTime());
+	}
+	sql += " WHERE layer_id = " + Te2String(layer->id());
+
+	if (layer->projection())
+		updateProjection(layer->projection());
+	return (this->execute (sql));
+}
+
+bool 
+TeOracle::insertProject(TeProject* project)
+{
+	if (!project)
+	{
+		errorMessage_ = "N�o � poss�vel inserir layer sem proje��o";
+		return false;
+	}
+	
+	string ins = "INSERT INTO te_project (project_id, name, description, current_view) ";
+	ins += " VALUES ( ";
+	ins += "te_project_seq.NEXTVAL";
+	ins += ", '" + escapeSequence(project->name()) + "'";
+	ins += ", '" + escapeSequence(project->description()) + "'";
+	ins += ", " + Te2String(project->getCurrentViewId());
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_project!";   
+		return false;
+	}
+
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	ins = "SELECT te_project_seq.CURRVAL FROM DUAL";
+	if (!ocip->query(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence te_project_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0));
+	project->setId(index);
+	projectMap()[project->id()] = project;
+	for (unsigned int i=0; i<project->getViewVector().size(); i++)
+		insertProjectViewRel(project->id(), project->getViewVector()[i]);
+	delete ocip;
+	for (unsigned int i=0; i<project->getViewVector().size(); i++)
+		insertProjectViewRel(project->id(), project->getViewVector()[i]);
+	return true;
+}
+
+bool 
+TeOracle::insertLayer (TeLayer* layer)
+{
+	int index;
+	TeProjection* proj = layer->projection();
+	if (!proj || !insertProjection(proj))
+	{
+		errorMessage_ = "N�o � poss�vel inserir layer sem proje��o";
+		return false;
+	}
+	
+	string ins = "INSERT INTO te_layer (projection_id, name ";
+	ins += ", lower_x, lower_y, upper_x, upper_y, edition_time) ";
+	ins += " VALUES ( ";
+	ins += Te2String(proj->id());
+	ins += ", '" + escapeSequence(layer->name()) + "'";
+	ins += ", " + Te2String(layer->box().x1(),15);
+	ins += ", " + Te2String(layer->box().y1(),15);
+	ins += ", " + Te2String(layer->box().x2(),15);
+	ins += ", " + Te2String(layer->box().y2(),15);
+	ins += ", " + getSQLTime(layer->getEditionTime());
+	ins += ")";
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table te_layer!";   
+		return false;
+	}
+
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	ins = "SELECT te_layer_seq.CURRVAL FROM DUAL";
+	if (!ocip->query(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence te_layer_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	index = atoi((const char*)ocip->getData(0));
+	layer->id(index);
+	delete ocip;
+	layerMap()[layer->id()] = layer;
+	return true;
+}
+
+bool 
+TeOracle::insertRepresentation (int layerId, TeRepresentation& rep)
+{
+	if (layerId <= 0)
+		return false;
+	
+	string ins;
+	TeOraclePortal *ocip = (TeOraclePortal*) getPortal();
+	if(!ocip)
+		return false;
+
+	try
+	{
+		ins = " INSERT INTO te_representation (repres_id, layer_id, geom_type, geom_table, ";
+		ins += " description, lower_x, lower_y, upper_x, upper_y, res_x, res_y, num_cols, ";
+		ins += " num_rows) VALUES (";
+		ins += " te_representation_seq.NEXTVAL ";
+		ins += ", " + Te2String(layerId);
+		ins += ", " + Te2String(static_cast<int>(rep.geomRep_));
+		ins += ", '" + escapeSequence(rep.tableName_) + "'";
+		ins += ", '" + escapeSequence(rep.description_) + "'";
+		ins += ", " + Te2String(rep.box_.x1(),15);
+		ins += ", " + Te2String(rep.box_.y1(),15);
+		ins += ", " + Te2String(rep.box_.x2(),15);
+		ins += ", " + Te2String(rep.box_.y2(),15);
+		ins += ", " + Te2String(rep.resX_,15);
+		ins += ", " + Te2String(rep.resY_,15);
+		ins += ", " + Te2String(rep.nCols_);
+		ins += ", " + Te2String(rep.nLins_);
+		ins += ")";
+
+		if(!execute(ins))
+		{
+			if(errorMessage_.empty())
+				errorMessage_ = "Error inserting in the table te_representation!";   
+			return false;
+		}
+		
+		string seq = "SELECT te_representation_seq.CURRVAL FROM DUAL";
+		if(!ocip->query(seq))
+		{
+			if(errorMessage_.empty())
+				errorMessage_ = "Error in the sequence te_representation_seq!";  
+			delete ocip;
+			return false;
+		}
+
+		if(!ocip->fetchRow())
+		{
+			errorMessage_ = "Sequence value not found!";
+			delete ocip;
+			return false;
+		}
+
+		int id = atoi((const char*)ocip->getData(0)); 
+		rep.id_ = id;
+	}
+
+	catch(...)
+	{
+		errorMessage_ = "Error inserting in the table te_representation!"; 
+		delete ocip;
+		return false;
+	}
+
+	delete ocip;
+	return true;
+}	
+
+
+bool 
+TeOracle::insertLegend (TeLegendEntry* leg)
+{
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	try
+	{
+		string ins = "INSERT INTO te_legend (legend_id, theme_id, group_id, ";
+		ins += " num_objs, lower_value, upper_value, label) VALUES ( ";
+		ins += "te_legend_seq.NEXTVAL";
+		ins += ", " + Te2String(leg->theme());
+		ins += ", " + Te2String(leg->group());
+		ins += ", " + Te2String(leg->count());
+		ins += ", '" + escapeSequence(leg->from()) + "'";
+		ins += ", '" + escapeSequence(leg->to()) + "'";
+		ins += ", '" + escapeSequence(leg->label()) + "'";
+		ins += ")";
+			
+		if (!execute(ins))
+		{
+			if(errorMessage_.empty())
+				errorMessage_ = "Error inserting in the table te_legend!"; 
+			return false;
+		}
+
+		string seq = "SELECT te_legend_seq.CURRVAL FROM DUAL";
+		if(!ocip->query(seq))
+		{
+			if(errorMessage_.empty())
+				errorMessage_ = "Error in the sequence te_theme_seq!";  
+			delete ocip;
+			return false;
+		}
+
+		if(!ocip->fetchRow())
+		{
+			errorMessage_ = "Sequence value not found!";;
+			delete ocip;
+			return false;
+		}
+
+		int index = atoi((const char*)ocip->getData(0)); 
+		leg->id(index);
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error inserting in the table te_legend!"; 
+		delete ocip;
+		return false;
+	}
+		
+	delete ocip;
+	legendMap()[leg->id()] = leg;
+	return insertVisual(leg);
+}
+
+bool 
+TeOracle::insertPolygonSet (const string& table, TePolygonSet &ps)
+{
+	
+	for (unsigned int i = 0; i < ps.size(); i++ )
+	{
+		TePolygon& poly = ps [i];
+		if (!insertPolygon (table,poly))
+			return false;
+	}
+	return true;
+}
+
+
+bool 
+TeOracle::insertPolygon (const string& table, TePolygon &poly)
+{
+	
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	
+	recset_->CursorLocation=ADODB::adUseServer;
+	
+	recset_->Open(_bstr_t(table.c_str()),
+		_variant_t((IDispatch*)connection_,true),
+		ADODB::adOpenKeyset, 
+		ADODB::adLockOptimistic,
+		ADODB::adCmdTable);
+	
+	TeOraclePortal  *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	double	extmax;
+	unsigned int k, ni, size;
+//	double	*points	= NULL;
+
+	try
+	{
+		int parentId = 0;
+		for ( k = 0; k < poly.size(); k++ )
+		{
+			TeLinearRing ring ( poly[k] );
+			TeBox b = ring.box();
+			size = ring.size();
+			ni = 0;
+			extmax = MAX(b.width(),b.height());
+			if (k==0)
+				ni = poly.size()-1;
+			else
+				ni = 0;
+			recset_->AddNew();
+			recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (poly.objectId().c_str());
+			recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)size);
+			recset_->Fields->GetItem("num_holes")->Value = (_variant_t) ((long)ni);
+			recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)parentId);
+			recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(b.lowerLeft().x(),15));
+			recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(b.lowerLeft().y(),15));
+			recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(b.upperRight().x(),15));
+			recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(b.upperRight().y(),15));
+			recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (extmax);
+
+			// Create and save the BLOB
+			VARIANT varPoints;
+
+			if(!LinearRingToVariant(varPoints, ring))
+			{
+				recset_->Close();
+				delete ocip;
+				return false;
+			}
+
+			//recset_->Fields->GetItem("spatial_data")->Value = (_variant_t) (varPoints);
+			recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+			recset_->Update();
+			
+			string seq = "SELECT " + getNameSequence(table)+ ".CURRVAL FROM DUAL";
+			if(!ocip->query(seq))
+			{
+				if(errorMessage_.empty())
+					errorMessage_ = "Error in the sequence " + table+ "!";  
+				delete ocip;
+				recset_->Close();
+				return false;
+			}
+
+			if(!ocip->fetchRow())
+			{
+				errorMessage_ = "Sequence value not found!";
+				recset_->Close();
+				delete ocip;
+				return false;
+			}
+
+			int index = atoi((const char*)ocip->getData(0)); 
+			ring.geomId (index);
+			ocip->freeResult();
+			
+			//ring.geomId (recset_->GetCollect("geom_id").intVal);			
+			SafeArrayDestroy (varPoints.parray);
+			if (k==0)
+			{
+				parentId = ring.geomId();
+				string sql = "UPDATE "+table+" SET parent_id  ="+Te2String(parentId)+" WHERE geom_id = "+Te2String(ring.geomId());
+				if(!execute(sql))
+				{
+					if(errorMessage_.empty())
+						errorMessage_ = "Error inserting in table " + table;
+					delete ocip;
+					recset_->Close();
+					return false;
+				}
+				
+			}
+			
+		} //for
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		delete ocip;
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		delete ocip;
+		return false;
+	}
+
+	delete ocip;
+	recset_->Close();
+	return true;
+}
+
+bool 
+TeOracle::insertLineSet(const string& table, TeLineSet &ls)
+{		
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+		
+	recset_->CursorLocation=ADODB::adUseServer;
+	recset_->CacheSize = 300;
+	recset_->Open(_bstr_t(table.c_str()),
+		_variant_t((IDispatch*)connection_,true),
+		ADODB::adOpenStatic,	
+		ADODB::adLockBatchOptimistic,
+		ADODB::adCmdTable);
+	
+	double	extmax;
+	int		size;
+//	double	*points	= NULL;
+
+	for ( unsigned int i = 0; i < ls.size(); i++ )
+	{
+		TeLine2D& line = ls [i];
+		try
+		{
+			size = line.size();
+			TeBox b = line.box();
+			extmax = MAX(b.width(),b.height());
+			recset_->AddNew();
+			recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (line.objectId().c_str());
+			recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)size);
+			recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(b.lowerLeft().x(),15));
+			recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(b.lowerLeft().y(),15));
+			recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(b.upperRight().x(),15));
+			recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(b.upperRight().y(),15));
+			recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (extmax);
+
+			// Create and save the BLOB
+			VARIANT varPoints;
+
+			if (!LineToVariant(varPoints, line))
+			{
+				recset_->Close();
+				return false;
+			}
+
+			recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+			//recset_->Update();
+			
+			SafeArrayDestroy (varPoints.parray);
+		}
+		catch(_com_error &e)
+		{
+			errorMessage_ = e.Description();
+			recset_->Close();
+			return false;
+		}
+		catch(...)
+		{
+			errorMessage_ = "Oppps !";
+			recset_->Close();
+			return false;
+		}
+	}
+	
+	recset_->UpdateBatch(ADODB::adAffectAll);
+	recset_->Close();
+	return true;
+}
+
+
+bool 
+TeOracle::insertLine (const string& table, TeLine2D &line)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	
+	recset_->CursorLocation=ADODB::adUseServer;
+	recset_->Open(_bstr_t(table.c_str()),
+		_variant_t((IDispatch*)connection_,true),
+		ADODB::adOpenKeyset, 
+		ADODB::adLockOptimistic,
+		ADODB::adCmdTable);
+
+	double	extmax;
+	int		size;
+//	double	*points	= NULL;
+
+	try
+	{
+		size = line.size();
+		TeBox b = line.box();
+		extmax = MAX(b.width(),b.height());
+		recset_->AddNew();
+		recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (line.objectId().c_str());
+		recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)size);
+		recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(b.lowerLeft().x(),15));
+		recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(b.lowerLeft().y(),15));
+		recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(b.upperRight().x(),15));
+		recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(b.upperRight().y(),15));
+		recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (extmax);
+		
+		// Create and save the BLOB
+		VARIANT varPoints;
+		if (!LineToVariant(varPoints, line))
+		{
+			recset_->Close();
+			return false;
+		}
+		
+		//recset_->Fields->GetItem("spatial_data")->Value = (_variant_t) (varPoints);		
+		recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+		recset_->Update();
+
+		SafeArrayDestroy (varPoints.parray);
+	}
+	catch(_com_error &e)
+	{
+		recset_->Close();
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		recset_->Close();
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	recset_->Close();
+	return true;
+}
+
+bool 
+TeOracle::insertPointSet (const string& table, TePointSet &ps)
+{
+	for (unsigned int i = 0; i < ps.size(); i++ )
+	{
+		TePoint& point = ps [i];
+		if (!insertPoint (table,point))
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeOracle::insertPoint (const string& table, TePoint &p)
+{
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, object_id, x, y) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(p.objectId()) + "'";
+	ins += ",  " + Te2String(p.location().x_,15);
+	ins += ",  " + Te2String(p.location().y_,15);
+	ins += " ) ";
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT "+ getNameSequence(table) + ".CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence " + table + "_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0)); 
+	p.geomId(index); 
+	delete ocip;
+	return true;
+}
+
+
+bool 
+TeOracle::insertCellSet (const string& table, TeCellSet &cs)
+{
+	for (unsigned int i = 0; i < cs.size(); i++ )
+	{
+		TeCell& cell = cs [i];
+		if (!insertCell (table,cell))
+			return false;
+	}
+	return true;
+}
+
+
+bool 
+TeOracle::insertCell (const string& table, TeCell &cell)
+{
+	TeBox b = cell.box();
+	
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, object_id, col_number, row_number, lower_x, ";
+	ins += " lower_y, upper_x, upper_y ) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(cell.objectId ()) + "'";
+	ins += ",  " + Te2String(cell.column ());
+	ins += ",  " + Te2String(cell.line ());
+	ins += ",  " + Te2String(b.x1(),15);
+	ins += ",  " + Te2String(b.y1(),15);
+	ins += ",  " + Te2String(b.x2(),15);
+	ins += ",  " + Te2String(b.y2(),15);
+	ins += " )";
+		
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT "+ getNameSequence(table) +".CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence " + table + "_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0)); 
+	cell.geomId(index); 
+	delete ocip;
+	
+	return true;
+}
+
+bool 
+TeOracle::insertTextSet (const string& table, TeTextSet &ts)
+{
+	for (unsigned int i = 0; i < ts.size(); i++ )
+	{
+		TeText& text = ts [i];
+		if (!insertText (table,text))
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeOracle::insertText(const string& table, TeText &text)
+{
+	string ins = "INSERT INTO " + table + " (geom_id, ";
+	ins += " object_id, x, y, text_value, angle, height, alignment_vert, ";
+	ins += " alignment_horiz) VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(text.objectId()) + "'";
+	ins += ",  " + Te2String(text.location().x(),15); 
+	ins += ",  " + Te2String(text.location().y(),15); 
+	ins += ", '" + escapeSequence(text.textValue()) + "'";
+	ins += ",  " + Te2String(text.angle(),15);
+	ins += ",  " + Te2String(text.height(),15);
+	ins += ",  " + Te2String(text.alignmentVert(),15);
+	ins += ",  " + Te2String(text.alignmentHoriz(),15);
+	ins += " )";
+	
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT "+ getNameSequence(table) +".CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence " + table + "_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0)); 
+	text.geomId(index); 
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOracle::insertArcSet (const string& table, TeArcSet &as)
+{
+	for (unsigned int i = 0; i < as.size(); i++ )
+	{
+		TeArc& arc = as [i];
+		if (!insertArc (table,arc))
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeOracle::insertArc (const string& table, TeArc &arc)
+{
+	string ins = "INSERT INTO " + table + " (geom_id, ";
+	ins += " object_id, from_node, to_node ) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(arc.objectId()) + "'";
+	ins += ",  " + Te2String(arc.fromNode().geomId());
+	ins += ",  " + Te2String(arc.toNode().geomId());
+	ins += " )";
+	
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT "+ getNameSequence(table) +".CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence " + table + "_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0)); 
+	arc.geomId(index); 
+	delete ocip;
+	return true;
+}
+
+bool 
+TeOracle::insertNodeSet (const string& table, TeNodeSet &ns)
+{
+	for (unsigned int i = 0; i < ns.size(); i++ )
+	{
+	     TeNode& no = ns [i];
+	     if (!insertNode (table,no))
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeOracle::insertNode (const string& table, TeNode &node)
+{
+	string ins = "INSERT INTO " + table + " ( ";
+	ins += " geom_id, object_id, x, y) ";
+	ins += " VALUES ( ";
+	ins += getNameSequence(table) +".NEXTVAL";
+	ins += ", '" + escapeSequence(node.objectId()) + "'";
+	ins += ",  " + Te2String(node.location().x(),15);
+	ins += ",  " + Te2String(node.location().y(),15);
+	ins += " ) ";
+
+	if(!execute(ins))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting in the table " + table + "!"; 
+		return false;
+	}
+
+	TeOraclePortal *ocip = (TeOraclePortal*)getPortal();
+	if(!ocip)
+		return false;
+
+	string seq = "SELECT "+ getNameSequence(table) + ".CURRVAL FROM DUAL";
+	if(!ocip->query(seq))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error in the sequence " + table + "_seq!";  
+		delete ocip;
+		return false;
+	}
+
+	if(!ocip->fetchRow())
+	{
+		errorMessage_ = "Sequence value not found!";
+		delete ocip;
+		return false;
+	}
+
+	int index = atoi((const char*)ocip->getData(0)); 
+	node.geomId(index); 
+	delete ocip;
+	return true;
+}
+
+string 
+TeOracle::getSQLAutoNumber(const string& table)
+{
+	string aut = getNameSequence(table) +".NEXTVAL";
+	return aut;
+}
+
+
+bool 
+TeOracle::getAttributeList(const string& tableName,TeAttributeList& attList)
+{
+	vector<string> pks;
+	TeDatabasePortal* portal = getPortal();
+	if(!portal)
+		return false;
+
+	string keys = " SELECT COLUMN_NAME "; 
+	keys += " FROM ALL_CONS_COLUMNS, ALL_CONSTRAINTS "; 
+	keys += " WHERE ALL_CONS_COLUMNS.CONSTRAINT_NAME = ALL_CONSTRAINTS.CONSTRAINT_NAME ";
+	keys += " AND ALL_CONSTRAINTS.table_name = '"+ TeConvertToUpperCase(tableName) +"' AND ";
+	keys += " ALL_CONSTRAINTS.OWNER= '"+ TeConvertToUpperCase(user()) +"' AND ";
+	keys += " ALL_CONSTRAINTS.CONSTRAINT_TYPE = 'P' ";
+
+	if(!portal->query(keys))
+	{
+		delete portal;
+		return false;
+	}
+
+	while(portal->fetchRow())
+		pks.push_back(portal->getData(0));
+
+	portal->freeResult();
+
+	string sql = "SELECT * FROM " + tableName + " WHERE 1=2";
+	
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	attList = portal->getAttributeList();
+
+	vector<string>::iterator itn;
+	TeAttributeList::iterator it = attList.begin();
+	while (it != attList.end())
+	{
+		itn = find(pks.begin(),pks.end(), TeConvertToUpperCase((*it).rep_.name_));
+		if (itn != pks.end())
+			(*it).rep_.isPrimaryKey_ = true;
+		++it;
+	}
+	delete portal;
+	return true;
+}
+
+string  
+TeOracle::getSQLTime(const TeTime& time) const
+{
+	string dateTime = time.getDateTime();	
+	string result;
+	result = "TO_DATE('";
+	result += dateTime;
+	result += "  ";
+	result += "','DD/MM/YYYY HH24:MI:SS')"; 
+	return result;
+}
+
+
+//----- TeOraclePortal methods ---
+
+TeOraclePortal::TeOraclePortal ( TeDatabase*  pDatabase) 
+{
+	db_ = pDatabase;
+	connection_ = ((TeOracle*)pDatabase)->connection_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+}
+
+
+TeOraclePortal::TeOraclePortal()
+{
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	curRow_ = 0;
+}
+
+TeOraclePortal::~TeOraclePortal ()
+{
+	freeResult();
+}
+
+
+bool 
+TeOraclePortal::query (const string &qry, TeCursorLocation l, TeCursorType /* t */, TeCursorEditType /* e */, TeCursorDataType /*dt */ )
+{
+	try
+	{
+		if(l==TeCLIENTESIDE)
+			recset_->CursorLocation=ADODB::adUseClient;
+		else
+			recset_->CursorLocation=ADODB::adUseServer;
+
+		recset_->Open(qry.c_str(),connection_.GetInterfacePtr(),
+					ADODB::adOpenForwardOnly,  //adOpenKeyset  //adOpenStatic
+					ADODB::adLockOptimistic,
+					ADODB::adCmdText);
+		numRows_ = recset_->GetRecordCount();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+
+	ADODB::FieldsPtr ptrFields = NULL;
+	ADODB::FieldPtr ptrField = NULL;
+	ptrFields = recset_->Fields;
+	numFields_ = ptrFields->Count; 
+
+	attList_.clear ();
+	int i;
+	for(i = 0; i < numFields_; i++)
+	{
+		_variant_t vCol((long)i);
+//		HRESULT hr = ptrFields->get_Item(vCol, &ptrField);
+		ptrFields->get_Item(vCol, &ptrField);
+		TeAttribute attribute;
+		
+		int nType = ptrField->Type;
+//		int precision = ptrField->Precision;
+		int numericScale = ptrField->NumericScale;
+
+		if((nType==ADODB::adNumeric)||(nType==ADODB::adVarNumeric))
+		{
+			if(numericScale>0)
+				nType = ADODB::adDouble;
+			else
+				nType = ADODB::adInteger;
+		}
+		
+		switch (nType)
+		{
+		case ADODB::adBoolean:
+			attribute.rep_.type_ = TeBOOLEAN;
+			break;
+
+		case ADODB::adNumeric:
+		case ADODB::adInteger:		
+		case ADODB::adTinyInt:
+		case ADODB::adUnsignedInt:
+		case ADODB::adUnsignedSmallInt:
+		case ADODB::adUnsignedTinyInt:
+		case ADODB::adVarNumeric: 
+			attribute.rep_.type_ = TeINT;
+			break;
+
+		case ADODB::adSingle:
+		case ADODB::adDouble:
+			attribute.rep_.type_ = TeREAL;
+			attribute.rep_.decimals_ = numericScale; 
+			break;
+
+		case ADODB::adDate:
+		case ADODB::adDBDate:
+		case ADODB::adDBTime:
+		case ADODB::adDBTimeStamp:
+			attribute.rep_.type_ = TeDATETIME;
+			attribute.dateChronon_ = TeSECOND;
+			attribute.dateTimeFormat_ = TeAdo::systemDateTimeFormat(attribute.indicatorAM_, attribute.indicatorPM_, attribute.dateSeparator_, attribute.timeSeparator_);
+			break;
+
+		case ADODB::adLongVarBinary:
+		case ADODB::adVarBinary:
+		case ADODB::adBinary:
+			attribute.rep_.type_ = TeBLOB;
+			break;
+
+		case ADODB::adChar: 
+		case ADODB::adWChar:
+		case ADODB::adVarChar:
+		case ADODB::adVarWChar:
+		case ADODB::adLongVarChar:
+		case ADODB::adLongVarWChar: 
+			attribute.rep_.type_ = TeSTRING;
+			break;
+
+		case ADODB::adCurrency: 
+		default :
+			attribute.rep_.type_ = TeUNKNOWN;
+			break;
+		}
+		attribute.rep_.name_ = ptrField->Name;
+		attribute.rep_.numChar_ = ptrField->DefinedSize;
+
+		attList_.push_back ( attribute );
+	}
+
+	curRow_=-1;
+
+	return true;
+}
+
+
+TeTime
+TeOraclePortal::getDate (const string& name)
+{
+	_variant_t value;
+
+	TeTime t;
+	try
+	{
+		value = recset_->GetCollect(name.c_str());
+	}
+	catch(_com_error &e)
+	{
+		string field = TeGetExtension(name.c_str());
+		if (!field.empty())
+		{
+			try
+			{
+				value = recset_->GetCollect(field.c_str());
+			}
+			catch(_com_error &e)
+			{
+				errorMessage_ = e.Description();
+				return t;
+			}
+			catch(...)
+			{
+				errorMessage_ = "Error getDate!";
+				return t;
+			}
+		}
+		else
+		{
+			errorMessage_ = e.Description();
+			return t;
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return t;
+	}
+
+	if (value.vt != VT_NULL)
+	{
+		bvalue_ = _bstr_t(value);
+		TeAdo* adoDb = (TeAdo*) this->getDatabase();
+		t = TeTime (string((char*)bvalue_), TeSECOND, adoDb->systemDateTimeFormat_, 
+			adoDb->systemDateSep_, adoDb->systemTimeSep_, adoDb->systemIndPM_);
+	}
+	return t;
+}
+
+
+TeTime
+TeOraclePortal::getDate (int i)
+{
+    _variant_t vtIndex;
+	_variant_t value;
+
+    vtIndex.vt = VT_I4;
+	vtIndex.lVal = i;
+	
+	TeTime t;
+	try
+	{
+		value = recset_->GetFields()->GetItem(vtIndex)->Value;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return t;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return t;
+	}
+	if (value.vt != VT_NULL)
+	{
+		bvalue_ = _bstr_t(value);
+		TeAdo* adoDb = (TeAdo*) this->getDatabase();
+		t = TeTime (string((char*)bvalue_), TeSECOND, adoDb->systemDateTimeFormat_, 
+			adoDb->systemDateSep_, adoDb->systemTimeSep_, adoDb->systemIndPM_);
+	}
+	return t;
+}
+
+
+string
+TeOraclePortal::getDateAsString(int i)
+{
+	TeTime t = this->getDate(i);
+	string date = t.getDateTime ();
+
+	if (!date.empty())
+	{		string tval = " TO_DATE ('"+ date +"','DDsMMsYYYYsHHsmmsSS') ";
+		return tval;
+	}
+	else
+		return "";
+}
+
+string 
+TeOraclePortal::getDateAsString(const string& s)
+{
+	TeTime t = this->getDate(s);
+	string date = t.getDateTime ();
+
+	if (!date.empty())
+	{		string tval = " TO_DATE ('"+ date +"','DDsMMsYYYYsHHsmmsSS') ";
+		return tval;
+	}
+	else
+		return "";
+}
+
+
+
diff --git a/src/terralib/drivers/ado/TeAdoOracle.h b/src/terralib/drivers/ado/TeAdoOracle.h
new file mode 100644
index 0000000..b572b45
--- /dev/null
+++ b/src/terralib/drivers/ado/TeAdoOracle.h
@@ -0,0 +1,214 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAdoOracle.h
+    \brief This file contains the particularities of a ADO Oracle driver
+*/
+#ifndef  __TERRALIB_INTERNAL_ADOORACLE_H
+#define  __TERRALIB_INTERNAL_ADOORACLE_H
+
+#include <TeDatabaseFactory.h>
+
+#ifdef WIN32
+#pragma warning ( disable: 4192 )
+#pragma warning ( disable: 4146 )
+#include <atldbcli.h>
+#include <iostream>
+#include <comdef.h>
+
+/*
+ *   Lets use the import directive to create some smart pointers for us
+ */
+#import "msado26.tlb"  rename("EOF", "IsEOF") rename("BOF", "IsBOF")
+#import <msadox.dll>
+#import <oledb32.dll> rename_namespace("OLEDB") 
+#else
+#error ONLY FOR WINDOWS OPERATIONAL SYSTEM
+#endif
+
+#include <TeDatabase.h>
+#include <TeAdoDB.h>
+
+
+#ifdef AFX_DLL
+#define EXPORT_WIN __declspec( dllexport )
+#else
+#define EXPORT_WIN
+#endif
+
+//! A driver class to an Oracle database accessible using ADO library
+class  TLADO_DLL  TeOracle : public TeAdo
+{
+friend class TeOraclePortal;
+
+public: 
+
+	TeOracle();
+	~TeOracle();
+
+	// Methods to create and connect to a ADO database
+		bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int &port=-1, bool terralibModel=true);
+		bool connect (const string& host, const string& user, const string& password, const string& database, int port = -1);
+
+	// Methods to manipulate a table
+		bool tableExist(const string& table);
+		bool listTables(vector<string>& tableList);
+     	bool columnExist(const string& table, const string& column, TeAttribute& attr);
+		bool createTable(const string& table, TeAttributeList &attr);
+			
+     	bool addColumn(const string& table,TeAttributeRep &rep);
+		bool alterTable (const string& table, TeAttributeRep &rep, const string& oldColName="");
+		bool alterTable (const string& oldTableName, const string& newTableName);
+		bool deleteTable (const string& table);
+     	bool createRelation (const string& name, const string& table, const string& fieldName, const string& relatedTable, const string& relatedField, bool cascadeDeletion);
+
+		bool deleteLayer(int layerId);
+
+		TeDBRelationType existRelation(const string& tableName, const string& relName);
+
+// Insert/Update methods
+
+	// Insert an attribute table
+        bool insertTableInfo (int layerId, TeTable &table, const string& user="");
+		bool insertRelationInfo(const int tableId, const string& tField, const string& rName, const string& rField, int& relId);
+
+     	bool insertLayer(TeLayer *layer);
+		virtual bool updateBBox	(const string& tableName, const string& idName, int idValue, const TeBox& box); /*****/
+		virtual bool updateLayerBox	(TeLayer* layer); 
+		virtual bool updateLayer	(TeLayer* layer); 
+
+     	bool insertRepresentation (int layerId, TeRepresentation& rep);
+     	bool insertView (TeView *view);
+		bool insertViewTree (TeViewTree *tree);
+     	bool insertTheme (TeAbstractTheme *theme);     	
+		bool insertThemeTable (int themeId, int tableId, int relationId, int tableOrder);
+		bool insertThemeGroup(TeViewTree* tree);
+		bool generateLabelPositions (TeTheme *theme, const std::string& objectId = "");
+     	bool insertLegend (TeLegendEntry *legend);
+     	bool insertProjection (TeProjection *proj);	
+	
+		bool insertPolygonSet (const string& table, TePolygonSet &ps);	
+     	bool insertPolygon (const string& table, TePolygon &p);
+
+     	bool insertLineSet (const string& table, TeLineSet &ls);
+     	bool insertLine (const string& table, TeLine2D &l);
+
+     	bool insertPointSet (const string& table, TePointSet &ps);
+     	bool insertPoint (const string& table, TePoint &p);
+
+     	bool insertTextSet (const string& table, TeTextSet &ts);	
+     	bool insertText (const string& table, TeText &t);
+
+     	bool insertArcSet (const string& table, TeArcSet &as);
+     	bool insertArc (const string& table,TeArc &arc);
+
+     	bool insertNodeSet (const string& table, TeNodeSet &ns);	
+     	bool insertNode	(const string& table, TeNode &node);	
+
+     	bool insertCellSet (const string& table, TeCellSet &cs);
+		bool insertCell	(const string& table, TeCell &c);
+
+     	TeDatabasePortal* getPortal ();
+
+     	bool createAutoIncrementTrigger(const string &tableName, const string &fieldName);
+		string	getNameTrigger(const string &tableName);
+
+		bool	createSequence(const string &seqName);
+		string	getNameSequence(const string &tableName);
+
+		string  getSQLAutoNumber(const string& table);
+
+		bool getAttributeList(const string& tableName,TeAttributeList& attList);
+
+		string getSQLTime(const TeTime& time) const;
+
+		bool insertProject(TeProject* project);
+};
+
+//! A portal to access a ADO database
+class  TLADO_DLL  TeOraclePortal : public TeAdoPortal
+{
+
+public :
+
+	// Constructor / Destructor
+	TeOraclePortal ();
+	TeOraclePortal (TeDatabase* pDatabase);
+	~TeOraclePortal ();
+
+	bool query ( const string &qry, TeCursorLocation l = TeSERVERSIDE, TeCursorType t = TeBIDIRECTIONAL, TeCursorEditType e = TeREADWRITE, TeCursorDataType dt = TeTEXTCURSOR );
+
+	TeTime getDate (int i);
+	TeTime getDate (const string& s);
+
+	string getDateAsString(int i);
+	string getDateAsString(const string& s);
+};
+
+
+/**
+ * @brief This is the class for TeOracle driver factory.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup DatabaseUtils
+ */
+class TLADO_DLL TeOracleFactory : public TeDatabaseFactory
+{
+  public :
+      
+    /**
+     * Default constructor
+     */
+    TeOracleFactory() : TeDatabaseFactory( std::string( "OracleAdo" ) ) {};      
+      
+    /**
+     * Default Destructor
+     */
+    ~TeOracleFactory() {};
+      
+  protected :  
+  
+    /**
+     * Implementation for the abstract TeFactory::build.
+     *
+     * @param arg A const reference to the parameters used by the
+     * database.
+     * @return A pointer to the new generated database instance.
+     */
+    TeDatabase* build( const TeDatabaseFactoryParams& arg )
+    {
+      TeOracle* instance_ptr = new TeOracle();
+      
+      if( arg.host_ != "" ) {
+        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
+          arg.database_, arg.port_ );
+      }
+  
+      return (TeDatabase*)instance_ptr;
+    }
+};
+
+namespace {
+  static TeOracleFactory TeOracleFactory_instance;
+};
+
+
+#endif
diff --git a/src/terralib/drivers/ado/TeAdoSqlServer.cpp b/src/terralib/drivers/ado/TeAdoSqlServer.cpp
new file mode 100644
index 0000000..1f03277
--- /dev/null
+++ b/src/terralib/drivers/ado/TeAdoSqlServer.cpp
@@ -0,0 +1,2135 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <stdio.h>
+#include <direct.h>
+#include <sys/stat.h>
+#include <TeAdoSqlServer.h>
+#include <sys/stat.h>
+
+#include <TeUtils.h>
+
+#define CHUNKSIZE	240
+
+typedef map<int,TeNode> TeNodeMap;
+
+inline void TESTHR( HRESULT hr )
+{
+	if( FAILED(hr) ) _com_issue_error( hr );
+}
+
+TeSqlServer::TeSqlServer()  
+{
+    HRESULT hr = CoInitialize(0);
+	dbmsName_ = "SqlServerAdo";
+    if(FAILED(hr))
+    {
+        cout << "Can't start COM!? " << endl;
+    }
+}
+
+TeSqlServer::~TeSqlServer()
+{
+}
+
+bool 
+TeSqlServer::newDatabase(const string& database, const string& user, const string& password, const string& host, const int& port, bool terralibModel, const std::string& /*characterSet*/)
+{
+	if ( connect(host,user,password,database,port) == false )
+		return false;
+	
+	if ( terralibModel )
+	{
+		//create conceptual model
+		if(!this->createConceptualModel())
+			return false;
+	}	
+	return true;
+}
+
+
+bool 
+TeSqlServer::connect (const string& host, const string& user, const string& password, const string& database, int /* port */)
+{
+	
+	string  connectionString = "Provider=SQLOLEDB.1;Password=" + password + ";Persist Security Info=True;User ID=" + user + ";Initial Catalog=" + database + ";Data Source=" + host;
+
+	try
+	{
+		connection_.CreateInstance(__uuidof(ADODB::Connection));
+		HRESULT hr  = connection_->Open (connectionString.c_str(),"","",-1);
+		TESTHR( hr );
+	}
+	catch(_com_error &e)
+	{
+		isConnected_ = false;
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		isConnected_ = false;
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	isConnected_ = true;
+	database_ = database;
+	host_ = host;
+	user_ = user;
+	password_ = password;
+	return true;
+}
+
+
+bool
+TeSqlServer::tableExist(const string& table)
+{
+	if (table.empty())
+		return false;
+	TeSqlServerPortal *sqlp = (TeSqlServerPortal*)getPortal();
+	if(!sqlp)
+		return false;
+
+	string exist = "SELECT name FROM sysobjects WHERE UPPER(name) = UPPER('" + table + "') ";
+	exist+=" and (UPPER(xtype)='U' or UPPER(xtype)='V') ";
+	
+	if(!sqlp->query(exist))
+	{
+		delete sqlp;
+		return false;
+	}
+
+	if(sqlp->fetchRow())
+	{
+		delete sqlp;
+		return true;
+	}
+	else
+	{
+		delete sqlp;
+		return false;
+	}
+}
+
+
+bool 
+TeSqlServer::columnExist(const string& table, const string& column, TeAttribute& attr)
+{
+	TeSqlServerPortal *sqlp = (TeSqlServerPortal*)getPortal();
+	if(!sqlp)
+		return false;
+
+	string exist ="select name,xtype,length,xscale  from syscolumns where name='" + column + "' and ";
+	exist+=" id in(select id from sysobjects where xtype='U' and name='" + table + "')";
+
+	
+	if(!sqlp->query(exist))
+	{
+		delete sqlp;
+		return false;
+	}
+
+	if(sqlp->fetchRow())
+	{	
+		attr.rep_.name_ = column;
+		
+		int	dataType = atoi(sqlp->getData(1)); 
+		int		dataLength = atoi(sqlp->getData(2)); 
+		attr.rep_.numChar_ = dataLength;
+		if(dataType == 167 && dataLength < 256)
+		{
+			attr.rep_.type_ = TeSTRING;
+		}
+		else if (dataType == 167 && dataLength >= 256)
+		{
+			attr.rep_.type_ = TeBLOB;
+		}
+		else if (dataType == 34)
+		{
+			attr.rep_.type_ = TeBLOB;
+		}
+		else if (dataType == 56)
+		{
+			attr.rep_.type_ = TeREAL;
+		}
+		else if (dataType == 62)
+		{
+			attr.rep_.type_ = TeINT;
+		}
+		else if (dataType == 167 && dataLength == 0)
+		{	
+			attr.rep_.type_ = TeCHARACTER;
+		}
+		else if (dataType == 61)
+		{
+			attr.rep_.type_ = TeDATETIME;
+		}
+		else
+		{
+			attr.rep_.type_ = TeSTRING;
+			attr.rep_.numChar_ = dataLength;
+		}
+		delete sqlp;
+		return true;
+	}
+	delete sqlp;
+	return false;
+}
+
+bool 
+TeSqlServer::getAttributeList(const string& tableName,TeAttributeList& attList)
+{
+	return(TeDatabase::getAttributeList (tableName, attList));
+}
+
+
+bool
+TeSqlServer::createTable(const string& table, TeAttributeList &attr)
+{
+	bool first = true;
+	string pkeys ="";
+
+	if(tableExist(table))
+	{
+		errorMessage_= "Table already exist!";
+		return false;
+	}
+
+	TeAttributeList::iterator it = attr.begin();
+	string tablec;
+	tablec = "CREATE TABLE dbo." + table +" (";
+	
+	while ( it != attr.end())
+	{
+		if (first == false)
+		{
+			tablec += ", ";
+		}
+			
+		switch ((*it).rep_.type_)
+		{
+			case TeSTRING:
+				if ( (*it).rep_.numChar_ > 0 && (*it).rep_.numChar_ < 256)
+				   tablec += (*it).rep_.name_ + " VARCHAR(" + Te2String((*it).rep_.numChar_) + ") ";
+				else
+				   tablec += (*it).rep_.name_ + " TEXT "; 
+			break;
+			
+			case TeREAL:
+				tablec += (*it).rep_.name_ + " DOUBLE PRECISION ";
+			break;
+			
+			case TeINT:
+			case TeUNSIGNEDINT:
+				tablec += (*it).rep_.name_ + " INT ";
+			break; 
+
+			case TeDATETIME:
+				tablec += (*it).rep_.name_ + " DATETIME ";
+			break;
+
+			case TeCHARACTER:
+				tablec += (*it).rep_.name_ + " CHAR ";
+			break;
+
+			case TeBOOLEAN:
+				tablec += (*it).rep_.name_ + " BIT ";
+			break;
+
+			case TeBLOB:
+				tablec += (*it).rep_.name_ + " IMAGE ";
+			break;
+
+			case TePOINTTYPE:
+			case TePOINTSETTYPE:
+			case TeNODETYPE:
+			case TeNODESETTYPE:
+				tablec += "x	 DOUBLE PRECISION  DEFAULT 0.000 ";
+				tablec += ", y	 DOUBLE PRECISION  DEFAULT 0.000 ";
+				++it;
+				continue;
+
+			case TeLINE2DTYPE:
+			case TeLINESETTYPE:
+				tablec += " num_coords INT NOT NULL ,";
+				tablec += " lower_x DOUBLE PRECISION NOT NULL ,";
+				tablec += " lower_y DOUBLE PRECISION NOT NULL ,";
+				tablec += " upper_x DOUBLE PRECISION NOT NULL ,";
+				tablec += " upper_y DOUBLE PRECISION NOT NULL ,";
+				tablec += " ext_max DOUBLE PRECISION NOT NULL, ";
+				tablec += " spatial_data IMAGE ";
+				++it;
+				continue;
+
+			case TePOLYGONTYPE:
+			case TePOLYGONSETTYPE:
+				tablec += " num_coords INT NOT NULL ,";
+				tablec += " num_holes INT NOT NULL ,";
+				tablec += " parent_id INT NOT NULL ,";
+				tablec += " lower_x DOUBLE PRECISION NOT NULL ,";
+				tablec += " lower_y DOUBLE PRECISION NOT NULL ,";
+				tablec += " upper_x DOUBLE PRECISION NOT NULL ,";
+				tablec += " upper_y DOUBLE PRECISION NOT NULL ,";
+				tablec += " ext_max DOUBLE PRECISION NOT NULL ,";
+				tablec += " spatial_data IMAGE ";
+				++it;
+				continue;
+
+			case TeCELLTYPE:
+			case TeCELLSETTYPE:
+				tablec += " lower_x	DOUBLE PRECISION NOT NULL ,";
+				tablec += " lower_y	DOUBLE PRECISION NOT NULL  ,";
+				tablec += " upper_x	DOUBLE PRECISION NOT NULL ,";
+				tablec += " upper_y	DOUBLE PRECISION NOT NULL ,";
+				tablec += " col_number	INT NOT NULL ,";
+				tablec += " row_number	INT NOT NULL ";
+				++it;
+				continue;			
+
+			case TeRASTERTYPE:
+				tablec += " lower_x DOUBLE PRECISION NOT NULL, ";
+				tablec += " lower_y DOUBLE PRECISION NOT NULL, ";
+				tablec += " upper_x DOUBLE PRECISION NOT NULL, ";
+				tablec += " upper_y DOUBLE PRECISION NOT NULL, ";
+				tablec += " band_id INT NOT NULL, ";
+				tablec += " resolution_factor INT NOT NULL , ";
+				tablec += " subband INT ,";
+				tablec += " spatial_data IMAGE, ";
+				tablec += " block_size INT NOT NULL ";
+				++it;
+				continue;
+
+            case TeTEXTTYPE:
+			case TeTEXTSETTYPE:
+			default:
+				tablec += (*it).rep_.name_ + " VARCHAR(255) ";
+			break;
+		}
+
+		//default value
+		if(!((*it).rep_.defaultValue_.empty()))
+            tablec += " DEFAULT '" + (*it).rep_.defaultValue_ +"' " ;
+
+		//not null
+		if(!((*it).rep_.null_))
+			tablec += " NOT NULL ";
+		
+		// auto number
+		if((*it).rep_.isAutoNumber_ && ((*it).rep_.type_==TeINT || (*it).rep_.type_==TeUNSIGNEDINT))  
+			tablec += " IDENTITY(1,1) "; 
+
+		// check if column is part of primary key
+		if ((*it).rep_.isPrimaryKey_ && (*it).rep_.type_ != TeBLOB )
+		{
+			if (!pkeys.empty())
+				pkeys += ", ";
+			pkeys += (*it).rep_.name_;
+		}
+
+		++it;
+		first = false;
+	}
+
+	if(!pkeys.empty())
+		tablec += ", PRIMARY KEY (" + pkeys + ") ";
+
+	tablec += ")";
+
+	if(!execute(tablec))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error creating table " + table;
+
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeSqlServer::alterTable (const string& table, TeAttributeRep &rep, const string& oldColName)
+{
+	if(!tableExist(table))
+		return false;
+
+	if(!oldColName.empty() && oldColName != rep.name_)
+	{
+		HRESULT hr = S_OK;
+		ADOX::_CatalogPtr m_pCatalog   = NULL;
+		ADOX::_TablePtr m_pTable  = NULL;
+		ADOX::_ColumnPtr m_pColumn  = NULL;
+		try
+		{
+			TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
+ 			m_pCatalog->PutActiveConnection(variant_t((IDispatch *)connection_));
+
+			m_pTable= m_pCatalog->Tables->GetItem(table.c_str());
+			m_pColumn = m_pTable->Columns->GetItem(oldColName.c_str()); 
+			m_pColumn->Name = rep.name_.c_str();
+			m_pCatalog->Tables->Refresh();								// Refresh the database.
+			m_pCatalog = NULL;
+			m_pTable  = NULL;
+		}
+		catch(_com_error &e)
+		{
+ 			errorMessage_ = e.Description();
+			m_pCatalog   = NULL;
+			m_pTable  = NULL;
+			return false;
+		}
+
+		catch(...)
+		{
+			errorMessage_ = "Error alter table";
+			m_pCatalog   = NULL;
+			m_pTable  = NULL;
+			return false;
+		}
+	}
+
+	string tab = " ALTER TABLE " + table + " ALTER COLUMN ";
+	tab += rep.name_ + "  ";
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if (rep.numChar_ > 255 || rep.numChar_ == 0)
+				tab += "TEXT ";
+			else
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+		
+		case TeREAL:
+			tab += "FLOAT";	
+			break;
+		
+		case TeINT:
+			tab += "INT";
+			break;
+
+		case TeDATETIME:
+			tab += "DATE";
+			break;
+
+		case TeCHARACTER:
+			tab += "CHAR";
+			break;
+
+		case TeBOOLEAN:
+			tab += "BIT";
+			break;
+		
+		default:
+			if (rep.numChar_ > 255 || rep.numChar_ == 0)
+				tab += "TEXT ";
+			else
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+
+	tab += " NULL ";
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error alter table " + table + " !";
+		return false;
+	}
+		
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + table + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+
+	if(tableId.empty() == false)
+	{
+		if(oldColName.empty() == false) // column name changed
+		{
+			 // update relation
+			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
+			sql += " WHERE related_table_id = " + tableId;
+			sql += " AND related_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
+			sql += " WHERE external_table_name = '" + table + "'";
+			sql += " AND external_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			 // update grouping
+			sql = "UPDATE te_grouping SET grouping_attr = '" + table + "." + rep.name_ + "'";
+			sql += " WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+		else // column type changed
+		{
+			// delete relation
+			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+			sql += " AND related_attr = '" + rep.name_ + "')";
+			sql += " OR (external_table_name = '" + table + "'";
+			sql += " AND external_attr = '" + rep.name_ + "')";
+			if(execute(sql) == false)
+				return false;
+
+			// delete grouping
+			TeDatabasePortal* portal = getPortal();
+			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(portal->query(sql) && portal->fetchRow())
+			{
+				string themeId = portal->getData(0);
+
+				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
+				if(execute(sql) == false)
+				{
+					delete portal;
+					return false;
+				}
+			}
+			delete portal;
+
+			sql = "DELETE FROM te_grouping";
+			sql += " WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+	}
+	alterTableInfoInMemory(table);
+	return true;
+}
+
+bool 
+TeSqlServer::alterTable(const string& oldTableName, const string& newTablename)
+{
+	string sql = "sp_rename '"+ oldTableName +"', '"+ newTablename +"'";
+	if(!this->execute(sql))
+		return false;
+
+	//update te_layer_table
+	sql = " UPDATE te_layer_table ";
+	sql += " SET attr_table = '"+ newTablename +"'";
+	sql += " WHERE attr_table = '"+ oldTableName +"'";
+	execute(sql);
+
+	//update te_tables_relation
+	sql = " UPDATE te_tables_relation ";
+	sql += " SET external_table_name = '"+ newTablename +"'";
+	sql += " WHERE external_table_name = '"+ oldTableName +"'";
+	execute(sql);
+	
+	alterTableInfoInMemory(newTablename, oldTableName);
+	return true;
+}
+
+bool
+TeSqlServer::deleteTable (const string& table)
+{
+	int f =	table.find ("te_collection");
+
+	if( table=="te_theme" ||
+		table=="te_layer" ||
+		table=="te_representation" ||
+		table=="te_tables_relation" ||
+		table=="te_layer_table" ||
+		table=="te_raster_metadata" ||
+		table=="te_projection" ||
+		table=="te_view" ||
+		table=="te_chart_params" ||
+		table=="te_legend" ||
+		table=="te_visual" ||
+		f == 0)
+	{
+		errorMessage_ = "N�o � poss�vel deletar tabelas do modelo!";
+		return false;
+	}
+
+	string del = "DROP TABLE " + table;
+	if(tableExist(table))
+	{
+		if(!execute(del))
+			return false;
+	}
+	string trig = "DROP TRIGGER " + getNameTrigger(table);
+	execute(trig);
+	return true;
+}
+
+bool 
+TeSqlServer::addColumn (const string& table, TeAttributeRep &rep)
+{
+	if(!tableExist(table))
+		return false;
+
+	string tab;
+	tab = " ALTER TABLE " + table + " ADD  ";
+	tab += rep.name_ + "  ";
+	
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if ( rep.numChar_ > 0 && rep.numChar_ < 256 )
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			else
+				tab += "TEXT "; 
+		break;
+			
+		case TeREAL:
+			tab += "DOUBLE PRECISION";	
+			break;
+			
+		case TeINT:
+			tab += "INT";
+			break;
+
+		case TeDATETIME:
+			tab += "DATETIME";
+			break;
+
+		case TeCHARACTER:
+			tab += "CHAR";
+			break;
+
+		case TeBOOLEAN:
+			tab += "BIT";
+			break;
+		
+		case TeBLOB:
+			tab += "IMAGE";
+			break;
+		
+		default:
+			tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+
+	alterTableInfoInMemory(table);
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error inserting a column to table " + table + " !";
+		return false;
+	}
+
+	return true;
+}
+
+
+bool
+TeSqlServer::createRelation (const string& name, const string& table, const string& fieldName, const string& relatedTable, const string& relatedField, bool cascadeDeletion)
+{
+	
+	string relation = "ALTER TABLE " + table + " ADD ";
+	relation += " CONSTRAINT " + name;
+	relation += " FOREIGN KEY ( " + fieldName + ") "; 
+	relation += " REFERENCES " + relatedTable + "(" + relatedField + ")";
+		
+	if (cascadeDeletion)
+		relation += " ON DELETE CASCADE ON UPDATE NO ACTION"; 
+
+	if(!execute(relation))
+		return false;
+
+	return true;
+}
+
+
+TeDBRelationType 
+TeSqlServer::existRelation(const string& /* tableName */, const string& relName)
+{
+
+	TeSqlServerPortal  *sqlp = (TeSqlServerPortal*)getPortal();
+	if(!sqlp)
+		return TeNoRelation;
+
+	string integ="select name from sysobjects where upper(name)=upper('" + relName + "')";
+	integ +=" and upper(xtype)='F'";
+	
+	if(!sqlp->query(integ))
+	{
+		delete sqlp;
+		return TeNoRelation;
+	}
+	
+
+	if ( sqlp->fetchRow() )		
+	{
+		int status = sqlp->getInt("status");
+		if ( (status & 14338) == 14338 ) //Cascade Update Delete 
+		{
+			delete sqlp;
+			return TeRICascadeDeletion; 
+		}
+		if ( (status & 4098) == 4098 ) //Cascade Delete
+		{
+			delete sqlp;
+			return TeRICascadeDeletion;
+		}
+		delete sqlp;
+		return TeRINoCascadeDeletion;
+	}
+
+	delete sqlp;
+	return TeNoRelation;	
+}
+
+
+TeDatabasePortal*  
+TeSqlServer::getPortal ()
+{
+	TeSqlServerPortal* portal = new TeSqlServerPortal (this);
+	return portal;
+}
+
+bool
+TeSqlServer::deleteLayer(int layerId)
+{
+	//Delete attributes tables
+	if(!deleteLayerTable(layerId))
+		return false;
+
+	TeSqlServerPortal* portal = (TeSqlServerPortal*) this->getPortal();
+	if (!portal)
+		return false;
+
+	string geomTable;
+	string sql = "SELECT projection_id FROM te_layer WHERE layer_id = ";
+	sql += Te2String(layerId);
+
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	string projId = portal->getData("projection_id");
+	portal->freeResult();
+
+	// Get all representations that are associated to this layer
+	sql = "SELECT * FROM te_representation WHERE layer_id = "+ Te2String(layerId);
+	if (!portal->query (sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	while (portal->fetchRow())
+	{	// Delete the geometry tables
+		geomTable = portal->getData("geom_table");
+	
+		// Delete lut table
+		TeGeomRep rep = TeGeomRep(atoi(portal->getData("geom_type")));
+		if (rep == TeRASTER)
+		{
+			TeSqlServerPortal* portal2 = (TeSqlServerPortal*)this->getPortal();
+			sql = "SELECT lut_table, raster_table FROM " + geomTable;
+			string tabName;
+			if (!portal2->query (sql))
+			{
+				delete portal2;
+				continue;
+			}
+
+			while (portal2->fetchRow())
+			{
+				// remove lut table
+				tabName = portal2->getData(0);
+				if (!tabName.empty() && this->tableExist(tabName))
+				{
+					sql = "DROP TABLE " + tabName;
+					this->execute(sql);
+
+				}
+				// remove raster table
+				tabName = portal2->getData(1);
+				if (!tabName.empty() && this->tableExist(tabName))
+				{
+					sql = "DROP TABLE " + tabName;
+					this->execute(sql);
+				}
+			}
+			delete portal2;
+			// remove raster metadata table
+			tabName = geomTable + "_metadata";
+			if (!tabName.empty() && this->tableExist(tabName))
+			{
+				sql = "DROP TABLE " + tabName;
+				this->execute(sql);
+			}
+		}
+		if (this->tableExist(geomTable))
+		{
+			sql = "DROP TABLE " + geomTable;
+			if (!this->execute(sql) )
+			{
+				delete portal;
+				return false;
+			}
+			
+		}
+	}
+
+	portal->freeResult();
+	if (existRelation("te_representation","fk_rep_layer_id") != TeRICascadeDeletion)
+	{
+		// Delete entries into representations table
+		sql = "DELETE FROM te_representation WHERE layer_id = " +Te2String(layerId);
+		if (!this->execute(sql) )
+		{
+			delete portal;
+			return false;
+		}
+	}
+
+	
+	// delete layer themes
+	sql = "SELECT theme_id FROM te_theme WHERE layer_id=" + Te2String(layerId);
+	if (!portal->query (sql))
+	{
+		delete portal;
+		return false;
+	}
+	
+	int themeId;
+	while (portal->fetchRow())
+	{	
+		themeId = atoi(portal->getData("theme_id"));
+		this->deleteTheme(themeId);
+	}
+	
+	sql = "DELETE FROM te_layer WHERE layer_id=" + Te2String(layerId);
+	if (!this->execute(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	// delete layer projection
+	sql = "DELETE FROM te_projection WHERE projection_id = "+ projId;
+	if (!this->execute(sql))
+	{	
+		delete portal;
+		return false;
+	}
+
+	// remove all the items� themes associated to the layer to be removed
+	TeThemeMap::iterator it;
+	for (it = themeMap().begin(); it != themeMap().end(); ++it)
+	{
+		TeTheme *theme = (TeTheme*)it->second;
+		if (theme->layer()->id() == layerId)
+		{
+			themeMap().erase(theme->id());
+			delete theme;
+		}
+	}
+
+	// Delete layer and its entry in the layer map
+	TeLayer* layer = layerMap()[layerId];
+	layerMap().erase(layerId);
+	delete layer;
+
+	delete portal;
+	return true;
+}
+
+
+
+bool
+TeSqlServer::deleteTheme(int themeId)
+{
+   string sql;
+   // delete the collection table associated to this theme
+   TeDatabasePortal* portal = this->getPortal();
+   if(!portal)
+       return false;
+
+   sql = "SELECT collection_table FROM te_theme WHERE theme_id = " + Te2String(themeId);
+   if(!portal->query(sql) || !portal->fetchRow())
+   {          
+	   delete portal;
+       return false;
+   }
+    string colTab = portal->getData("collection_table");
+   //delete collection table
+   if (this->tableExist(colTab))      
+   {
+       sql = "DROP TABLE " + colTab;
+       if (!this->execute(sql) )
+       {   
+		   delete portal;
+           return false;
+       }
+   }
+   //delete auxiliar collection table
+   if (this->tableExist(colTab +"_aux"))      
+   {
+       sql = "DROP TABLE " +colTab +"_aux";
+       if (!this->execute(sql) )
+       {              
+		   delete portal;
+           return false;
+       }
+   }
+   portal->freeResult();
+
+   //delete the visual associated to this theme
+   if (existRelation("te_visual","fk_visual_legend_id") != TeRICascadeDeletion)
+   {
+       sql = "SELECT legend_id FROM te_legend WHERE theme_id = " + Te2String(themeId);
+       if(!portal->query(sql))
+       {              
+		   delete portal;
+           return false;
+       }
+       string wherec;
+       int c = 0;
+       while (portal->fetchRow())
+       {
+           if (c)
+               wherec += ",";
+           c++;
+           wherec += portal->getData(0);
+       }
+       portal->freeResult();
+       if (!wherec.empty()) 
+       {
+           sql = "DELETE FROM te_visual WHERE legend_id IN (" + wherec + ")";
+           if (!this->execute(sql))
+           {                  
+			   delete portal;
+               return false;
+           }
+       }
+   }
+
+   //delete all visuals of raster associated to this theme
+   if (existRelation("te_visual_raster","fk_visrast_theme_id") != TeRICascadeDeletion)
+   {
+       sql = "DELETE FROM te_visual_raster WHERE theme_id =" + Te2String(themeId);
+       if (!this->execute (sql))
+       {              
+		   delete portal;
+           return false;
+       }
+   }
+     //delete all legends associated to this theme
+   if (existRelation("te_legend","fk_legend_theme_id") != TeRICascadeDeletion)
+   {
+       sql = "DELETE FROM te_legend WHERE theme_id =" + Te2String(themeId);
+       if (!this->execute (sql))
+       {              
+		   delete portal;
+           return false;
+       }
+   }
+     //select the view of this theme
+   sql = "SELECT view_id FROM te_theme WHERE theme_id = " + Te2String(themeId);
+   portal->freeResult();
+   if(!portal->query(sql) ||!portal->fetchRow())
+   {          
+	   delete portal;
+       return false;
+   }
+ 
+   int viewId = portal->getInt("view_id");
+   TeView* view = viewMap()[viewId];
+   sql = "SELECT name FROM te_theme WHERE theme_id = " + Te2String(themeId);
+   portal->freeResult();
+   if (!portal->query(sql) || !portal->fetchRow())
+   {          
+	   delete portal;
+       return false;
+   }
+  
+   TeTheme* tema = NULL;
+   if (view != 0)
+	   tema = (TeTheme*)view->remove(themeId);
+   if (tema != 0) 
+   {
+       unsigned int i;
+       TeLegendEntryVector& legendVector = tema->legend();
+       for (i = 0; i < legendVector.size(); ++i)
+           legendMap().erase(legendVector[i].id());
+       themeMap().erase(themeId);
+       delete tema;
+   }
+   delete portal;
+
+   //delete the tables associated to this theme
+   if (existRelation("te_theme_table","fk_thmtable_theme_id") != TeRICascadeDeletion)
+   {
+       sql = "DELETE FROM te_theme_table WHERE theme_id =" + Te2String(themeId);
+       if (!this->execute (sql))
+           return false;
+   }
+   //delete the grouping
+   if (existRelation("te_grouping","fk_group_theme_id")  != TeRICascadeDeletion)
+   {
+       sql = "DELETE FROM te_grouping WHERE theme_id =" + Te2String(themeId);
+       if (!this->execute (sql))
+           return false;
+   }   
+
+	sql = " UPDATE te_view SET current_theme = NULL WHERE current_theme = "+ Te2String(themeId);
+	this->execute(sql);
+
+	if(tableExist("te_theme_application"))
+	{
+		sql=" DELETE FROM te_theme_application where theme_id=" + Te2String(themeId);
+		if(!this->execute(sql))
+		{
+			return false;
+		}
+	}
+
+   // delete the theme
+   sql = "DELETE FROM te_theme WHERE theme_id = " + Te2String(themeId);
+   if (!this->execute (sql))
+       return false;
+
+   return true;
+} 
+
+bool 
+TeSqlServer::deleteView (int viewId)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	// view projection should be deleted manually
+	string sql =  "SELECT projection_id FROM te_view WHERE view_id=" + Te2String(viewId);
+	portal->freeResult();
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	string projId = portal->getData("projection_id");
+	portal->freeResult();
+	
+	// delete themes belonging to this view 
+	sql = "SELECT theme_id FROM te_theme WHERE view_id=" + Te2String(viewId);
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	while (portal->fetchRow())
+	{
+		int id = atoi(portal->getData(0));
+		if(deleteTheme(id) == false)
+		{	
+			delete portal;
+			return false;
+		}
+	}
+
+	// delete view
+	sql = "DELETE FROM te_view WHERE view_id = " + Te2String(viewId);
+	if (!this->execute (sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	sql = "DELETE FROM te_projection WHERE  projection_id = " + projId;
+	if (!this->execute (sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	// Delete the view and its themes
+	TeView* view = viewMap()[viewId];
+	viewMap().erase(viewId);
+	delete view;
+	delete portal;
+	return true;
+}
+string
+TeSqlServer::getNameTrigger(const string &tableName)
+{
+	string name;
+	if(tableName.size()>21)
+		name = tableName.substr(0,20) + "_tri";
+	else
+		name = tableName + "_tri";
+
+	return name;
+}
+
+bool
+TeSqlServer::insertTable(TeTable &table)
+{
+	string tableName = table.name();
+
+	string sql = "select * from ";
+	sql += tableName;
+	sql += " where 1=0";
+
+	TeAttributeList		att = table.attributeList();
+	TeAttributeList::iterator	it;
+
+	TeTableRow row;
+	unsigned int i;
+
+	_variant_t index;
+	index.vt = VT_I4;
+
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open(_bstr_t(sql.c_str()),
+			_variant_t((IDispatch*)connection_,true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdText);
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error insert table!";
+		return false;
+	}
+
+	bool rec_open = false;
+	for ( i = 0; i < table.size(); i++  )
+	{
+		try 
+		{
+			if (!rec_open)
+				recset_->AddNew();
+			row = table[i];
+			it = att.begin();
+
+			for(unsigned int j=0; j<row.size(); j++) 
+			{
+				if (row[j].empty() || (*it).rep_.isAutoNumber_)
+				{
+					++it;
+					continue;
+				}
+
+				TeTime dt;
+				index.lVal = j;
+				string value = row[j];
+				std::string name = (*it).rep_.name_;
+
+				if((*it).rep_.type_==TeDATETIME)
+				{
+					TeTime t(string(row[j].c_str()), (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_,  (*it).timeSeparator_, (*it).indicatorPM_);
+					dt=t;
+				}
+
+				switch ((*it).rep_.type_)
+				{
+				case TeREAL:
+					recset_->GetFields()->GetItem((*it).rep_.name_.c_str())->Value = (_variant_t) atof(row[j].c_str());
+					break;
+				case TeINT:
+					recset_->GetFields()->GetItem((*it).rep_.name_.c_str())->Value = (_variant_t) atol(row[j].c_str());
+					break;
+				case TeBOOLEAN:
+					{
+						int value = 0;
+						if(row[j] == "1" || TeConvertToLowerCase(row[j]) == "t" || TeConvertToLowerCase(row[j]) == "true")
+						{
+							value = 1;
+						}
+						recset_->GetFields()->GetItem((*it).rep_.name_.c_str())->Value = (_variant_t) value;
+					}
+					break;
+
+				case TeDATETIME:
+					recset_->GetFields()->GetItem((*it).rep_.name_.c_str())->Value = (_bstr_t) (dt.getDateTime(systemDateTimeFormat_, systemDateSep_, systemTimeSep_, systemIndPM_, systemIndAM_).c_str()); 
+					break;
+				case TeBLOB:
+					{
+						BYTE *pByte;
+						VARIANT var;
+
+						SAFEARRAY FAR* psa;
+						SAFEARRAYBOUND rgsabound[1];
+						rgsabound[0].lLbound = 0;	
+						rgsabound[0].cElements =  value.size();
+
+						// create a single dimensional byte array
+						psa = SafeArrayCreate(VT_I1, 1, rgsabound);
+
+						// set the data of the array with data in the edit box
+						if(SafeArrayAccessData(psa,(void **)&pByte) == NOERROR)
+							memcpy((LPVOID)pByte,(LPVOID)(char*)value.c_str(), value.size() * sizeof(char));
+						SafeArrayUnaccessData(psa);
+						var.vt = VT_ARRAY | VT_UI1;
+						var.parray = psa;
+
+						recset_->Fields->Item[(*it).rep_.name_.c_str()]->AppendChunk (var);
+						SafeArrayDestroy (var.parray);						
+						break;	
+					}
+				default:
+					if (value.size() > (unsigned int)((*it).rep_.numChar_))
+						value = value.substr(0,(*it).rep_.numChar_);
+					recset_->GetFields()->GetItem((*it).rep_.name_.c_str())->Value = (_bstr_t) (value.c_str());
+					break;
+				}				
+				++it;				
+			}
+			recset_->Update();			
+			rec_open =  false;
+		}
+		catch(_com_error &e)
+		{
+			errorMessage_ = e.Description();
+			rec_open = true;
+			recset_->Close();
+			return false; 
+		}
+		catch(...)
+		{
+			errorMessage_ = "Error insert table!";
+			rec_open = true;
+			recset_->Close();
+			return false; 
+		}
+	}
+	recset_->Close();
+	return true;
+}
+
+bool 
+TeSqlServer::insertTheme(TeAbstractTheme *theme)
+{
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+		recset_->Open("select * from te_theme where 1=0",
+			_variant_t((IDispatch*)connection_, true),
+			ADODB::adOpenKeyset,
+			ADODB::adLockOptimistic,
+			ADODB::adCmdText);
+		recset_->AddNew();
+		if(theme->type()==TeTHEME)
+			recset_->Fields->GetItem("layer_id")->Value = (_variant_t) ((long)static_cast<TeTheme*>(theme)->layerId());
+		recset_->Fields->GetItem("view_id")->Value = (_variant_t) ((long)theme->view());
+		recset_->Fields->GetItem("name")->Value = (_bstr_t) (theme->name().c_str ());
+		recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)theme->parentId());
+		recset_->Fields->GetItem("priority")->Value = (_variant_t) ((long)theme->priority());
+		recset_->Fields->GetItem("node_type")->Value = (_variant_t) ((long)theme->type());
+		recset_->Fields->GetItem("min_scale")->Value = (_variant_t) (TeRoundD(theme->minScale(),15));
+		recset_->Fields->GetItem("max_scale")->Value = (_variant_t) (TeRoundD(theme->maxScale(),15));
+		
+		if(!theme->attributeRest().empty())
+			recset_->Fields->GetItem("generate_attribute_where")->Value = (_bstr_t) (theme->attributeRest().c_str());
+		if(!theme->spatialRest().empty())
+			recset_->Fields->GetItem("generate_spatial_where")->Value = (_bstr_t) (theme->spatialRest().c_str());
+		if(!theme->temporalRest().empty())
+			recset_->Fields->GetItem("generate_temporal_where")->Value = (_bstr_t) (theme->temporalRest().c_str());
+		
+		if(theme->type()==TeTHEME && !static_cast<TeTheme*>(theme)->collectionTable().empty())
+			recset_->Fields->GetItem("collection_table")->Value = (_bstr_t) (static_cast<TeTheme*>(theme)->collectionTable().c_str());
+		
+		recset_->Fields->GetItem("visible_rep")->Value = (_variant_t) ((long)theme->visibleRep());
+		recset_->Fields->GetItem("enable_visibility")->Value = (_variant_t) ((long)theme->visibility());
+
+		recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(theme->box().x1(),15));
+		recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(theme->box().y1(),15));
+		recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(theme->box().x2(),15));
+		recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(theme->box().y2(),15));
+		recset_->Fields->GetItem("creation_time")->Value = (_bstr_t) (theme->getCreationTime().getDateTime(systemDateTimeFormat_, systemDateSep_, systemTimeSep_, systemIndPM_, systemIndAM_).c_str());
+		
+		recset_->Update();
+		_variant_t newID;
+		newID = recset_->GetCollect("theme_id");
+		theme->id(newID.intVal);
+
+		//recset_->Update();
+		recset_->Close();
+
+		if((theme->type()==TeTHEME || theme->type()==TeEXTERNALTHEME)&& static_cast<TeTheme*>(theme)->collectionTable().empty())
+		{
+			static_cast<TeTheme*>(theme)->collectionTable("te_collection_" + Te2String(theme->id()));
+			string strSQL="update te_theme set collection_table='te_collection_" + Te2String(theme->id()) + "'";
+			if(theme->parentId() == 0)
+			{
+				theme->parentId(theme->id());
+				strSQL += " , parent_id = " + Te2String(theme->parentId());				
+			}
+			strSQL+= " where theme_id=" + Te2String(theme->id());
+			execute(strSQL);
+		}
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	
+	bool status = false;
+
+	// insert grouping
+	int numSlices = 0;
+	if(theme->grouping().groupMode_ != TeNoGrouping)
+	{
+		if(!insertGrouping (theme->id(), theme->grouping()))
+			return false;
+		numSlices = theme->grouping().groupNumSlices_;
+	}
+
+//	if(theme->rasterVisual()!=0)
+//	{
+//		if(!insertRasterVisual(theme->id(), theme->rasterVisual()))
+//			return false;
+//	}
+		
+	// insert legend
+	theme->outOfCollectionLegend().group(-1); 
+	theme->outOfCollectionLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->outOfCollectionLegend())); 
+	if (!status)
+		return status;
+
+	theme->withoutDataConnectionLegend().group(-2); 
+	theme->withoutDataConnectionLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->withoutDataConnectionLegend())); 
+	if (!status)
+		return status;
+
+	theme->defaultLegend().group(-3); 
+	theme->defaultLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->defaultLegend())); 
+	if (!status)
+		return status;
+
+	theme->pointingLegend().group(-4); 
+	theme->pointingLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->pointingLegend())); 
+	if (!status)
+		return status;
+
+	theme->queryLegend().group(-5); 
+	theme->queryLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->queryLegend())); 
+	if (!status)
+		return status;
+
+	theme->queryAndPointingLegend().group(-6); 
+	theme->queryAndPointingLegend().theme(theme->id()); 
+	status = insertLegend (&(theme->queryAndPointingLegend())); 
+	if (!status)
+		return status;
+
+	for (int i = 0; i < numSlices; i++)
+	{
+		theme->legend()[i].group(i);
+		theme->legend()[i].theme(theme->id());
+		status = insertLegend (&(theme->legend()[i]));
+		if (!status)
+			return status;
+	}
+	if (!status)
+		return status;
+
+	//insert metadata theme
+	if(!theme->saveMetadata(this))
+		return false;
+
+	themeMap()[theme->id()] = theme;
+	if(theme->type() == TeTHEME && !updateThemeTable(static_cast<TeTheme*>(theme)))
+		return false;
+
+	return true;
+}
+
+
+bool 
+TeSqlServer::generateLabelPositions (TeTheme *theme, const std::string& objectId )
+{
+	string	geomTable, upd;
+	string	collTable = theme->collectionTable();
+	
+	if((collTable.empty()) || (!tableExist(collTable)))
+		return false;
+
+	if( theme->layer()->hasGeometry(TeCELLS) )
+	{
+		geomTable = theme->layer()->tableName(TeCELLS);
+
+		upd= "UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(lower_x + (upper_x - lower_x)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(lower_y + (upper_y - lower_y)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+
+	if( theme->layer()->hasGeometry(TePOLYGONS) )
+	{
+		geomTable = theme->layer()->tableName(TePOLYGONS);
+
+		upd= "UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(lower_x + (upper_x - lower_x)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(lower_y + (upper_y - lower_y)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+
+	if( theme->layer()->hasGeometry(TeLINES) )
+	{
+		geomTable = theme->layer()->tableName(TeLINES);
+
+		upd= "UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(lower_x + (upper_x - lower_x)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(lower_y + (upper_y - lower_y)/2) ";
+		upd += "FROM " + geomTable + " WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+	
+	if(theme->layer()->hasGeometry(TePOINTS))
+	{
+		geomTable = theme->layer()->tableName(TePOINTS);
+		
+		upd= " UPDATE " + collTable + " SET ";
+		upd += " label_x = (SELECT MAX(x) ";
+		upd += " FROM " + geomTable + " p WHERE object_id = c_object_id), ";
+		
+		upd += " label_y = (SELECT MAX(y) ";
+		upd += " FROM " + geomTable + " p WHERE object_id = c_object_id) ";
+		upd += " WHERE label_x IS NULL OR label_y IS NULL";
+	}
+
+	if (!upd.empty())
+	{
+		if (!objectId.empty())
+		{
+			upd += " AND c_object_id='"+objectId+"'";
+		}
+		if(!execute(upd))
+			return false;
+	}
+
+	return true;
+}
+
+bool 
+TeSqlServer::insertPolygonSet (const string& table, TePolygonSet &ps)
+{
+	if (ps.empty())
+		return true;
+    string sql = "select * from ";
+    sql += table;
+    sql += " where 1=0";	
+
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	
+    try
+	{
+        recset_->Open(_bstr_t(sql.c_str()),
+            _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenKeyset,
+            ADODB::adLockOptimistic,
+            ADODB::adCmdText);
+
+        unsigned int i;
+        unsigned int n = ps.size();
+
+		// for each polygon in the polygon set
+		for (i = 0; i < n; ++i)
+		{
+			unsigned int k;
+			int parentId = 0;
+			unsigned int numberHoles = ps[i].size()-1;
+			// for each ring 
+			for (k=0; k<ps[i].size(); ++k)
+			{
+				recset_->AddNew();
+				recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (ps[i].objectId().c_str());
+				recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)ps[i][k].size());
+				recset_->Fields->GetItem("num_holes")->Value = (_variant_t) ((long)numberHoles);
+				recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)parentId);
+				recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(ps[i][k].box().lowerLeft().x_,15));
+				recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(ps[i][k].box().lowerLeft().y_,15));
+				recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(ps[i][k].box().upperRight().x_,15));
+				recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(ps[i][k].box().upperRight().y_,15));
+				recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (MAX(ps[i][k].box().width(),ps[i][k].box().height()));
+
+				// create and save the BLOB
+				VARIANT varPoints;
+				if(!LinearRingToVariant(varPoints, ps[i][k]))
+				{
+					recset_->Close();
+					return false;
+				}
+
+				recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+				recset_->Update();
+				SafeArrayDestroy (varPoints.parray);
+
+				// retrieve the geometry id of the ring (given by the auto increment property)
+				ps[i][k].geomId(recset_->GetCollect("geom_id").intVal);
+ 
+				if (k==0)
+				{
+					parentId = ps[i][k].geomId(); // save the geometry id of the parent
+					ps[i].geomId(parentId);
+					numberHoles=0;
+				}
+			}
+		}
+		recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return false;
+	}
+	// update in the database the parent id of an outter ring 
+	string strSQL="update " + table + " set parent_id=geom_id where parent_id=0";
+	execute(strSQL);
+	return true;
+}
+
+
+bool 
+TeSqlServer::insertPolygon (const string& table, TePolygon &pol)
+{
+    string sql = "select * from ";
+    sql += table;
+    sql += " where 1=0";	
+
+	ADODB::_RecordsetPtr recset_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	try
+	{
+        recset_->Open(_bstr_t(sql.c_str()),
+            _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenKeyset,
+            ADODB::adLockOptimistic,
+            ADODB::adCmdText);
+
+		unsigned int k;
+		int parentId = 0;
+		unsigned int numberHoles = pol.size()-1;
+		// for each ring
+		for (k=0; k<pol.size(); ++k)
+		{
+			recset_->AddNew();
+			recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (pol.objectId().c_str());
+			recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)pol[k].size());
+			recset_->Fields->GetItem("num_holes")->Value = (_variant_t) ((long)numberHoles);
+			recset_->Fields->GetItem("parent_id")->Value = (_variant_t) ((long)parentId);
+			recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(pol[k].box().lowerLeft().x_,15));
+			recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(pol[k].box().lowerLeft().y_,15));
+			recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(pol[k].box().upperRight().x_,15));
+			recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(pol[k].box().upperRight().y_,15));
+			recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (MAX(pol[k].box().width(),pol[k].box().height()));
+
+			// create and save the BLOB
+			VARIANT varPoints;
+			if(!LinearRingToVariant(varPoints,pol[k]))
+			{
+				recset_->Close();
+				return false;
+			}
+
+			recset_->Fields->Item["spatial_data"]->AppendChunk (varPoints);
+			recset_->Update();
+			SafeArrayDestroy (varPoints.parray);
+
+			// retrieve the geometry id of the ring (given by the auto increment property)
+			pol[k].geomId(recset_->GetCollect("geom_id").intVal);
+
+			if (k==0)
+			{
+				parentId = pol[k].geomId();// save the geometry id of the parent
+				pol.geomId(parentId);
+				numberHoles=0;
+			}
+		}
+        recset_->Close();
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		recset_->Close();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		recset_->Close();
+		return false;
+	}
+
+	// update in the database the parent id of the outter rings 
+	string strSQL="update " + table + " set parent_id=geom_id where parent_id=0";
+	return (execute(strSQL));
+}
+
+bool
+TeSqlServer::insertLineSet(const string& table, TeLineSet &ls)
+{
+    if (ls.empty())
+        return true;
+
+    string sql = "select * from ";
+    sql += table;
+    sql += " where 1=0";	
+
+    ADODB::_RecordsetPtr recset_;
+    recset_.CreateInstance(__uuidof(ADODB::Recordset));
+
+    try
+    {
+        recset_->Open(_bstr_t(sql.c_str()),
+            _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenKeyset,
+            ADODB::adLockOptimistic,
+            ADODB::adCmdText);
+
+        // for each line
+        for (unsigned int i = 0; i < ls.size(); ++i)
+        {
+            recset_->AddNew();
+            recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (ls[i].objectId().c_str());
+            recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)ls[i].size());
+            recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(ls[i].box().lowerLeft().x_,15));
+            recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(ls[i].box().lowerLeft().y_,15));
+            recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(ls[i].box().upperRight().x_,15));
+            recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(ls[i].box().upperRight().y_,15));
+            recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (MAX(ls[i].box().width(),ls[i].box().height()));
+
+            // create and save the BLOB
+            VARIANT varPoints;
+            if (!LineToVariant(varPoints,ls[i]))
+            {
+                recset_->Close();
+                return false;
+            }
+
+            recset_->Fields->Item["spatial_data"]->AppendChunk(varPoints);
+            recset_->Update();
+            SafeArrayDestroy(varPoints.parray);
+
+            // retrieve the geometry id of the line (given by the auto increment property)		
+            ls[i].geomId (recset_->GetCollect("geom_id").intVal);
+        }
+        
+        recset_->Close();
+    }
+    catch(_com_error &e)
+    {
+        recset_->Close();
+        errorMessage_ = e.Description();
+        return 0;
+    }
+    catch(...)
+    {
+        recset_->Close();
+        errorMessage_ = "Oppps !";
+        return 0;
+    }
+
+    return true;
+}
+
+bool
+TeSqlServer::insertLine(const string& table, TeLine2D &l)
+{
+    string sql = "select * from ";
+    sql += table;
+    sql += " where 1=0";	
+
+    ADODB::_RecordsetPtr recset_;
+    recset_.CreateInstance(__uuidof(ADODB::Recordset));
+
+    try
+    {	
+        recset_->Open(_bstr_t(sql.c_str()),
+            _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenKeyset,
+            ADODB::adLockOptimistic,
+            ADODB::adCmdText);
+
+        recset_->AddNew();
+        recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (l.objectId().c_str());
+        recset_->Fields->GetItem("num_coords")->Value = (_variant_t) ((long)l.size());
+        recset_->Fields->GetItem("lower_x")->Value = (_variant_t) (TeRoundD(l.box().lowerLeft().x_,15));
+        recset_->Fields->GetItem("lower_y")->Value = (_variant_t) (TeRoundD(l.box().lowerLeft().y_,15));
+        recset_->Fields->GetItem("upper_x")->Value = (_variant_t) (TeRoundD(l.box().upperRight().x_,15));
+        recset_->Fields->GetItem("upper_y")->Value = (_variant_t) (TeRoundD(l.box().upperRight().y_,15));
+        recset_->Fields->GetItem("ext_max")->Value = (_variant_t) (MAX(l.box().width(),l.box().height()));
+
+        // create and save the BLOB
+        VARIANT varPoints;
+        if (!LineToVariant(varPoints, l))
+        {
+            recset_->Close();
+            return false;
+        }
+
+        recset_->Fields->Item["spatial_data"]->AppendChunk(varPoints);
+        recset_->Update();
+        SafeArrayDestroy(varPoints.parray);
+
+        // retrieve the geometry id of the line (given by the auto increment property)		
+        l.geomId (recset_->GetCollect("geom_id").intVal);
+        
+        recset_->Close();
+    }
+    catch(_com_error &e)
+    {
+        recset_->Close();
+        errorMessage_ = e.Description();
+        return 0;
+    }
+    catch(...)
+    {
+        recset_->Close();
+        errorMessage_ = "Oppps !";
+        return 0;
+    }
+
+    return true;
+}
+
+bool
+TeSqlServer::insertPointSet(const string& table, TePointSet &ps)
+{
+    if (ps.empty())
+        return true;
+
+    string sql = "select * from ";
+    sql += table;
+    sql += " where 1=0"; 
+    
+    ADODB::_RecordsetPtr recset_;
+    recset_.CreateInstance(__uuidof(ADODB::Recordset));
+    try
+    {
+        recset_->Open(_bstr_t(sql.c_str()),
+            _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenKeyset,
+            ADODB::adLockOptimistic,
+            ADODB::adCmdText);
+
+        for (unsigned int i = 0; i < ps.size(); ++i)
+        {
+            recset_->AddNew();
+            recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (ps[i].objectId().c_str());
+            recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(ps[i].location().x_,15));
+            recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(ps[i].location().y_,15));
+            recset_->Update();
+			ps[i].geomId(recset_->GetCollect("geom_id").intVal);
+        }
+
+        recset_->Close();
+    }
+    catch(_com_error &e)
+    {
+        recset_->Close();
+        errorMessage_ = e.Description();
+        return false;
+    }
+    catch(...)
+    {
+        recset_->Close();
+        errorMessage_ = "Oppps !";
+        return false;
+    }
+    
+    return true;
+}
+
+bool
+TeSqlServer::insertPoint(const string& table, TePoint &p)
+{
+    string sql = "select * from ";
+    sql += table;
+    sql += " where 1=0";	
+    
+    ADODB::_RecordsetPtr recset_;
+    recset_.CreateInstance(__uuidof(ADODB::Recordset));
+    try
+    {
+        recset_->Open(_bstr_t(sql.c_str()),
+            _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenKeyset,
+            ADODB::adLockOptimistic,
+            ADODB::adCmdText);
+        recset_->AddNew();
+        recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (p.objectId().c_str());
+        recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(p.location().x_,15));
+        recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(p.location().y_,15));
+        recset_->Update();
+        p.geomId (recset_->GetCollect("geom_id").intVal);
+        recset_->Close();
+    }
+    catch(_com_error &e)
+    {
+        errorMessage_ = e.Description();
+        return 0;
+    }
+    catch(...)
+    {
+        errorMessage_ = "Oppps !";
+        return 0;
+    }
+    return true;
+}
+
+bool
+TeSqlServer::insertTextSet(const string& table, TeTextSet &ts)
+{
+    if (ts.empty())
+        return true;
+
+    string sql = "select * from ";
+    sql += table;
+    sql += " where 1=0";	
+
+    ADODB::_RecordsetPtr recset_;
+    recset_.CreateInstance(__uuidof(ADODB::Recordset));
+    try
+    {
+        recset_->Open(_bstr_t(sql.c_str()),
+            _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenKeyset,
+            ADODB::adLockOptimistic,
+            ADODB::adCmdText);
+
+        for (unsigned int i = 0; i < ts.size(); ++i)
+        {
+            recset_->AddNew();
+            recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (ts[i].objectId().c_str());
+            recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(ts[i].location().x_,15));
+            recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(ts[i].location().y_,15));
+            recset_->Fields->GetItem("text_value")->Value = (_bstr_t) (ts[i].textValue().c_str());
+            recset_->Fields->GetItem("angle")->Value = (_variant_t) (ts[i].angle());
+            recset_->Fields->GetItem("height")->Value = (_variant_t) (ts[i].height());
+            recset_->Fields->GetItem("alignment_vert")->Value = (_variant_t) (ts[i].alignmentVert());
+            recset_->Fields->GetItem("alignment_horiz")->Value = (_variant_t) (ts[i].alignmentHoriz());
+			recset_->Update();
+            ts[i].geomId (recset_->GetCollect("geom_id").intVal);
+        }
+        recset_->Close();
+    }
+    catch(_com_error &e)
+    {
+        errorMessage_ = e.Description();
+        recset_->Close();
+        return 0;
+    }
+    catch(...)
+    {
+        errorMessage_ = "Oppps !";
+        recset_->Close();
+        return 0;
+    }
+    return true;
+}
+
+bool
+TeSqlServer::insertText(const string& table, TeText &t)
+{
+    string sql = "select * from ";
+    sql += table;
+    sql += " where 1=0";	
+
+    ADODB::_RecordsetPtr recset_;
+    recset_.CreateInstance(__uuidof(ADODB::Recordset));
+    try
+    {
+        recset_->Open(_bstr_t(sql.c_str()),
+            _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenKeyset,
+            ADODB::adLockOptimistic,
+            ADODB::adCmdText);
+        recset_->AddNew();
+        recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (t.objectId().c_str());
+        recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(t.location().x(),15));
+        recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(t.location().y(),15));
+        recset_->Fields->GetItem("text_value")->Value = (_bstr_t) (t.textValue().c_str());
+        recset_->Fields->GetItem("angle")->Value = (_variant_t) (t.angle());
+        recset_->Fields->GetItem("height")->Value = (_variant_t) (t.height());
+        recset_->Fields->GetItem("alignment_vert")->Value = (_variant_t)(t.alignmentVert());
+        recset_->Fields->GetItem("alignment_horiz")->Value = (_variant_t)(t.alignmentHoriz());
+        recset_->Update();
+        t.geomId (recset_->GetCollect("geom_id").intVal);
+        recset_->Close();
+    }
+    catch(_com_error &e)
+    {
+        errorMessage_ = e.Description();
+        recset_->Close();
+        return 0;
+    }
+    catch(...)
+    {
+        errorMessage_ = "Oppps !";
+        recset_->Close();
+        return 0;
+    }
+    return true;
+}
+string 
+TeSqlServer::getSQLTime(const TeTime& time) const
+{
+	std::string dateStr = time.getDate(); //yyyy-mm-dd
+	std::string timeStr = time.getTime();	
+	string result = "'"+dateStr+" "+timeStr+"'";
+	return result;
+}
+
+string TeSqlServer::toUpper(const string& value)
+{
+	string result  = " UPPER(";
+	       result += value;
+		   result += ")";
+	return result;
+}
+
+
+//----- TeSqlServerPortal methods ---
+
+TeSqlServerPortal::TeSqlServerPortal ( TeDatabase*  pDatabase) 
+{
+	db_ = pDatabase;
+	connection_ = ((TeSqlServer*)pDatabase)->connection_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+}
+
+
+TeSqlServerPortal::TeSqlServerPortal ()
+{
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	curRow_ = 0;
+}
+
+TeSqlServerPortal::~TeSqlServerPortal ()
+{
+	freeResult();
+}
+
+TeTime
+TeSqlServerPortal::getDate (const string& name)
+{
+	_variant_t value;
+
+	TeTime t;
+	try
+	{
+		value = recset_->GetCollect(name.c_str());
+	}
+	catch(_com_error &e)
+	{
+		string field = TeGetExtension(name.c_str());
+		if (!field.empty())
+		{
+			try
+			{
+				value = recset_->GetCollect(field.c_str());
+			}
+			catch(_com_error &e)
+			{
+				errorMessage_ = e.Description();
+				return t;
+			}
+			catch(...)
+			{
+				errorMessage_ = "Error getDate!";
+				return t;
+			}
+		}
+		else
+		{
+			errorMessage_ = e.Description();
+			return t;
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return t;
+	}
+
+	if (value.vt != VT_NULL)
+	{
+		bvalue_ = _bstr_t(value);
+		TeAdo* adoDb = (TeAdo*) this->getDatabase();
+		t = TeTime (string((char*)bvalue_), TeSECOND, adoDb->systemDateTimeFormat_, 
+			adoDb->systemDateSep_, adoDb->systemTimeSep_, adoDb->systemIndPM_);
+		return t;
+	}
+	else
+		return t;
+}
+
+
+TeTime
+TeSqlServerPortal::getDate (int i)
+{
+    _variant_t vtIndex;
+	_variant_t value;
+
+    vtIndex.vt = VT_I4;
+	vtIndex.lVal = i;
+	
+	TeTime t;
+	try
+	{
+		value = recset_->GetFields()->GetItem(vtIndex)->Value;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return t;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return t;
+	}
+	if (value.vt != VT_NULL)
+	{
+		bvalue_ = _bstr_t(value);
+		TeAdo* adoDb = (TeAdo*) this->getDatabase();
+		t = TeTime (string((char*)bvalue_), TeSECOND, adoDb->systemDateTimeFormat_, 
+			adoDb->systemDateSep_, adoDb->systemTimeSep_, adoDb->systemIndPM_);
+		return t;
+	}
+	else
+		return t;
+}
+
+
+string
+TeSqlServerPortal::getDateAsString(int i)
+{
+	TeTime t = this->getDate(i);
+	string date = t.getDateTime ();
+
+	if (!date.empty())
+	{		string tval = " TO_DATE ('"+ date +"','DDsMMsYYYYsHHsmmsSS') ";
+		return tval;
+	}
+	else
+		return "";
+}
+
+string 
+TeSqlServerPortal::getDateAsString(const string& s)
+{
+	TeTime t = this->getDate(s);
+	string date = t.getDateTime ();
+
+	if (!date.empty())
+	{		string tval = " TO_DATE ('"+ date +"','DDsMMsYYYYsHHsmmsSS') ";
+		return tval;
+	}
+	else
+		return "";
+}
+
+int getLastGeomId ( TeSqlServer* db, const string& table )
+{
+	TeSqlServerPortal *sqlp = NULL;
+	try
+	{
+		int lastGeomId = 0;
+
+		if (db == NULL)
+			return lastGeomId;
+		//gets the last geom id
+	
+		sqlp = (TeSqlServerPortal*)db->getPortal();
+		if(!sqlp)
+			return false;
+		sqlp->freeResult();
+		std::string sql= "SELECT MAX(geom_id) AS MaxGeomId FROM " + table;
+		
+		if(!sqlp->query(sql))
+		{
+			delete sqlp;
+			return false;
+		}		
+		
+		if( sqlp->fetchRow() )
+		{
+			lastGeomId = atoi( sqlp->getData("MaxGeomId") ); //the string must be empty
+		}
+		
+		delete sqlp;
+		sqlp = NULL;
+		
+		return lastGeomId;
+	}
+	catch(...)
+	{
+		if (sqlp)
+		{
+			delete sqlp;
+			sqlp = NULL;
+		}
+		return 0;
+	}
+}
+
+
+
diff --git a/src/terralib/drivers/ado/TeAdoSqlServer.h b/src/terralib/drivers/ado/TeAdoSqlServer.h
new file mode 100644
index 0000000..b7b4ca6
--- /dev/null
+++ b/src/terralib/drivers/ado/TeAdoSqlServer.h
@@ -0,0 +1,183 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAdoSqlServer.h
+    \brief This file contains the particularities of a ADO SQL Server driver
+*/
+#ifndef  __TERRALIB_INTERNAL_ADOSQLSERVER_H
+#define  __TERRALIB_INTERNAL_ADOSQLSERVER_H
+
+#include <TeDatabaseFactory.h>
+
+#ifdef WIN32
+#pragma warning ( disable: 4192 )
+#pragma warning ( disable: 4146 )
+#include <atldbcli.h>
+#include <iostream>
+#include <comdef.h>
+
+/*
+ *   Lets use the import directive to create some smart pointers for us
+ */
+#import "msado26.tlb"  rename("EOF", "IsEOF") rename("BOF", "IsBOF")
+#import <msadox.dll>
+#import <oledb32.dll> rename_namespace("OLEDB") 
+#else
+#error ONLY FOR WINDOWS OPERATIONAL SYSTEM
+#endif
+
+#include <TeDatabase.h>
+#include <TeAdoDB.h>
+
+
+#ifdef AFX_DLL
+#define EXPORT_WIN __declspec( dllexport )
+#else
+#define EXPORT_WIN
+#endif
+
+//! A driver class to an SQL Server database accessible using ADO library
+class  TLADO_DLL  TeSqlServer : public TeAdo
+{
+friend class TeSqlServerPortal;
+
+public: 
+
+	TeSqlServer();
+	~TeSqlServer();
+
+	// Methods to create and connect to a ADO database
+		virtual bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int &port=-1, bool terralibModel=true, const std::string& characterSet = "");
+		virtual bool connect (const string& host, const string& user, const string& password, const string& database, int port = -1);
+
+	// Methods to manipulate a table
+		virtual bool tableExist(const string& table);
+     	virtual bool columnExist(const string& table, const string& column, TeAttribute& attr);
+		virtual bool getAttributeList(const string& tableName,TeAttributeList& attList);
+     	virtual bool createTable(const string& table, TeAttributeList &attr);
+		virtual bool alterTable (const string& table, TeAttributeRep &rep, const string& oldColName="");
+		virtual bool alterTable(const string& oldTableName, const string& newTablename);
+			
+     	virtual bool addColumn(const string& table,TeAttributeRep &rep);
+		virtual bool deleteTable (const string& table);
+     	virtual bool createRelation (const string& name, const string& table, const string& fieldName, const string& relatedTable, const string& relatedField, bool cascadeDeletion);
+
+		virtual bool deleteLayer(int layerId);
+		virtual bool deleteTheme(int themeId);
+		virtual bool deleteView (int viewId);
+
+		virtual TeDBRelationType existRelation(const string& tableName, const string& relName);
+
+	
+		// Insert an attribute table
+		virtual bool insertTable(TeTable &table);
+     	virtual bool insertTheme (TeAbstractTheme *theme);     	
+		virtual bool generateLabelPositions (TeTheme *theme, const std::string& objectId = "");
+    
+		virtual bool insertPolygonSet (const string& table, TePolygonSet &ps);	
+     	virtual bool insertPolygon (const string& table, TePolygon &p);
+
+	    virtual bool insertLineSet(const string& table, TeLineSet &ls); 
+		virtual bool insertLine(const string& table, TeLine2D &l);
+	
+	    virtual bool insertPointSet(const string& table, TePointSet &ps); 
+		virtual bool insertPoint(const string& table, TePoint &p);
+
+		virtual bool insertTextSet(const string& table, TeTextSet &ts);	
+		virtual bool insertText(const string& table, TeText &t);
+
+
+     	virtual TeDatabasePortal* getPortal ();
+     	virtual string	getNameTrigger(const string &tableName); 
+
+		virtual string getSQLTime(const TeTime& time) const; 
+
+		virtual string toUpper(const string& value);
+};
+
+//! A portal to access a ADO database
+class  TLADO_DLL  TeSqlServerPortal : public TeAdoPortal
+{
+
+public :
+
+	// Constructor / Destructor
+	TeSqlServerPortal ();
+	TeSqlServerPortal (TeDatabase* pDatabase);
+	~TeSqlServerPortal ();
+
+	TeTime getDate (int i);
+	TeTime getDate (const string& s);
+
+	string getDateAsString(int i);
+	string getDateAsString(const string& s);
+};
+
+
+/**
+ * @brief This is the class for TeSqlServer driver factory.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup DatabaseUtils
+ */
+class TLADO_DLL TeSqlServerFactory : public TeDatabaseFactory
+{
+  public :
+      
+    /**
+     * Default constructor
+     */
+    TeSqlServerFactory() : TeDatabaseFactory( 
+      std::string( "SqlServerAdo" ) ) {};      
+      
+    /**
+     * Default Destructor
+     */
+    ~TeSqlServerFactory() {};
+      
+  protected :  
+  
+    /**
+     * Implementation for the abstract TeFactory::build.
+     *
+     * @param arg A const reference to the parameters used by the
+     * database.
+     * @return A pointer to the new generated database instance.
+     */
+    TeDatabase* build( const TeDatabaseFactoryParams& arg )
+    {
+      TeSqlServer* instance_ptr = new TeSqlServer();
+      
+      if( arg.host_ != "" ) {
+        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
+          arg.database_, arg.port_ );
+      }
+  
+      return (TeDatabase*)instance_ptr;
+    }
+};
+
+namespace {
+  static TeSqlServerFactory TeSqlServerFactory_instance;
+};
+
+
+#endif
diff --git a/src/terralib/drivers/ado/TeAdoSqlServerSpatial.cpp b/src/terralib/drivers/ado/TeAdoSqlServerSpatial.cpp
new file mode 100644
index 0000000..67b06a7
--- /dev/null
+++ b/src/terralib/drivers/ado/TeAdoSqlServerSpatial.cpp
@@ -0,0 +1,1582 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <stdio.h>
+#include <direct.h>
+#include <sys/stat.h>
+#include <TeAdoSqlServerSpatial.h>
+#include <TeWKBGeometryDecoder.h>
+#include <sys/stat.h>
+
+#include <TeUtils.h>
+
+#define CHUNKSIZE	240
+
+typedef map<int,TeNode> TeNodeMap;
+
+
+inline void TESTHR( HRESULT hr )
+{
+	if( FAILED(hr) ) _com_issue_error( hr );
+}
+
+TeSqlServerSpatial::TeSqlServerSpatial()  
+{
+    HRESULT hr = CoInitialize(0);
+	dbmsName_ = "SqlServerAdoSpatial";
+    if(FAILED(hr))
+    {
+        cout << "Can't start COM!? " << endl;
+    }
+}
+
+TeSqlServerSpatial::~TeSqlServerSpatial()
+{
+}
+
+
+bool 
+TeSqlServerSpatial::connect (const string& host, const string& user, const string& password, const string& database, int /* port */)
+{
+	
+	std::string  connectionString;
+	
+	connectionString = "Provider=SQLNCLI10.1;Integrated Security='';Persist Security Info=False;User ID=";
+	connectionString+=user + ";Initial Catalog=" + database + ";Data Source=" + host + ";Initial File Name='';Server SPN=''";
+
+	connectionString = "Provider=SQLOLEDB.1;Password=" + password + ";Persist Security Info=True;User ID=" + user + ";Initial Catalog=" + database + ";Data Source=" + host;
+
+	try
+	{
+		connection_.CreateInstance(__uuidof(ADODB::Connection));
+		HRESULT hr  = connection_->Open (connectionString.c_str(),"","",-1);
+		TESTHR( hr );
+	}
+	catch(_com_error &e)
+	{
+		isConnected_ = false;
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		isConnected_ = false;
+		errorMessage_ = "Oppps !";
+		return false;
+	}
+	isConnected_ = true;
+	database_ = database;
+	host_ = host;
+	user_ = user;
+	password_ = password;
+	return true;
+}
+
+
+bool 
+TeSqlServerSpatial::getMBRSelectedObjects(string /* geomTable */,string /* colGeom */, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType,TeBox &bout, const double& tol)
+{
+	string	fields;
+	string	query;
+	bool	status = false;
+
+	TeBox	box;
+	bout = box;
+
+	TeDatabasePortal* portal = this->getPortal();
+	fields = " MIN(spatial_data.MakeValid().STEnvelope().STPointN(1).STX) as X1,";
+	fields+= "MIN(spatial_data.MakeValid().STEnvelope().STPointN(1).STY) as Y1,";
+	fields+= "MAX(spatial_data.MakeValid().STEnvelope().STPointN(3).STX) as X2,";
+	fields+= "MAX(spatial_data.MakeValid().STEnvelope().STPointN(3).STY) as Y2 ";
+	query =  " SELECT " + fields;
+	query += " FROM " + fromClause; 
+	if (!whereClause.empty())			query += " WHERE " + whereClause;
+	if (!afterWhereClause.empty())		query += afterWhereClause;
+	if (portal->query (query))
+			{
+				bool b = portal->fetchRow();
+				while(b)
+				{
+					string vxmin = portal->getData(0);
+					string vymin = portal->getData(1);
+					string vxmax = portal->getData(2);
+					string vymax = portal->getData(3);
+					if(vxmin.empty() || vymin.empty() || vxmax.empty() || vymax.empty())
+					{
+						b = portal->fetchRow();
+						continue;
+					}
+					double xmin = atof(vxmin.c_str());
+					double ymin = atof(vymin.c_str());
+					double xmax = atof(vxmax.c_str());
+					double ymax = atof(vymax.c_str());
+					TeBox	ibox(xmin, ymin, xmax, ymax);
+					updateBox (bout, ibox);
+					b = portal->fetchRow();
+					status = true;
+				}
+			}
+	delete portal;
+	return status;
+}
+
+
+string
+TeSqlServerSpatial::getSQLBoxWhere(const TeBox& box, const TeGeomRep rep, const std::string& )
+{
+	std::string whereBox;
+
+	whereBox=" spatial_data.STIsValid() = 1 and spatial_data.STIntersects (geometry::STGeomFromText('POLYGON((";
+	whereBox+=Te2String(box.x1());
+	whereBox+=" ";
+	whereBox+=Te2String(box.y1());
+	whereBox+=",";
+	whereBox+=Te2String(box.x2());
+	whereBox+=" ";
+	whereBox+=Te2String(box.y1());
+	whereBox+=",";
+	whereBox+=Te2String(box.x2());
+	whereBox+=" ";
+	whereBox+=Te2String(box.y2());
+	whereBox+=",";
+	whereBox+=Te2String(box.x1());
+	whereBox+=" ";
+	whereBox+=Te2String(box.y2());
+	whereBox+=",";
+	whereBox+=Te2String(box.x1());
+	whereBox+=" ";
+	whereBox+=Te2String(box.y1());
+	whereBox+="))',0))=1 ";
+	return whereBox;
+}
+
+std::string TeSqlServerSpatial::getSQLOrderBy(const TeGeomRep& rep) const
+{
+	std::string orderBy = "object_id DESC";
+	return orderBy;
+}
+
+
+bool 
+TeSqlServerSpatial::columnExist(const string& table, const string& column, TeAttribute& attr)
+{
+	TeSqlServerSpatialPortal *sqlp = (TeSqlServerSpatialPortal*)getPortal();
+	if(!sqlp)
+		return false;
+
+	string exist ="select name,xtype,length,xscale  from syscolumns where name='" + column + "' and ";
+	exist+=" id in(select id from sysobjects where xtype='U' and name='" + table + "')";
+
+	
+	if(!sqlp->query(exist))
+	{
+		delete sqlp;
+		return false;
+	}
+
+	if(sqlp->fetchRow())
+	{	
+		attr.rep_.name_ = column;
+		
+		int	dataType = atoi(sqlp->getData(1)); 
+		int		dataLength = atoi(sqlp->getData(2)); 
+		attr.rep_.numChar_ = dataLength;
+		if(dataType == 167 && dataLength < 256)
+		{
+			attr.rep_.type_ = TeSTRING;
+		}
+		else if (dataType == 167 && dataLength >= 256)
+		{
+			attr.rep_.type_ = TeBLOB;
+		}
+		else if (dataType == 34)
+		{
+			attr.rep_.type_ = TeBLOB;
+		}
+		else if (dataType == 56)
+		{
+			attr.rep_.type_ = TeREAL;
+		}
+		else if (dataType == 62)
+		{
+			attr.rep_.type_ = TeINT;
+		}
+		else if (dataType == 167 && dataLength == 0)
+		{	
+			attr.rep_.type_ = TeCHARACTER;
+		}
+		else if (dataType == 61)
+		{
+			attr.rep_.type_ = TeDATETIME;
+		}
+		else if (dataType == 240)
+		{
+			attr.rep_.type_ = TeOBJECT;
+		}
+		else
+		{
+			attr.rep_.type_ = TeSTRING;
+			attr.rep_.numChar_ = dataLength;
+		}
+		delete sqlp;
+		return true;
+	}
+	delete sqlp;
+	return false;
+}
+
+
+
+bool
+TeSqlServerSpatial::createTable(const string& table, TeAttributeList &attr)
+{
+	bool first = true;
+	string pkeys ="";
+
+	if(tableExist(table))
+	{
+		errorMessage_= "Table already exist!";
+		return false;
+	}
+
+	TeAttributeList::iterator it = attr.begin();
+	string tablec;
+	tablec = "CREATE TABLE dbo." + table +" (";
+	
+	while ( it != attr.end())
+	{
+		if (first == false)
+		{
+			tablec += ", ";
+		}
+			
+		switch ((*it).rep_.type_)
+		{
+			case TeSTRING:
+				if ( (*it).rep_.numChar_ > 0 && (*it).rep_.numChar_ < 256)
+				   tablec += (*it).rep_.name_ + " VARCHAR(" + Te2String((*it).rep_.numChar_) + ") ";
+				else
+				   tablec += (*it).rep_.name_ + " TEXT "; 
+			break;
+			
+			case TeREAL:
+				tablec += (*it).rep_.name_ + " DOUBLE PRECISION ";
+			break;
+			
+			case TeINT:
+			case TeUNSIGNEDINT:
+				tablec += (*it).rep_.name_ + " INT ";
+			break; 
+
+			case TeDATETIME:
+				tablec += (*it).rep_.name_ + " DATETIME ";
+			break;
+
+			case TeCHARACTER:
+				tablec += (*it).rep_.name_ + " CHAR ";
+			break;
+
+			case TeBOOLEAN:
+				tablec += (*it).rep_.name_ + " BIT ";
+			break;
+
+			case TeBLOB:
+				tablec += (*it).rep_.name_ + " IMAGE ";
+			break;
+
+			case TePOINTTYPE:
+			case TePOINTSETTYPE:
+			case TeNODETYPE:
+			case TeNODESETTYPE:
+			case TeLINE2DTYPE:
+			case TeLINESETTYPE:
+			case TePOLYGONTYPE:
+			case TePOLYGONSETTYPE:
+			case TeCELLTYPE:
+			case TeCELLSETTYPE:
+				tablec += " spatial_data geometry";
+				++it;
+				continue;
+
+			case TeRASTERTYPE:
+				tablec += " lower_x DOUBLE PRECISION NOT NULL, ";
+				tablec += " lower_y DOUBLE PRECISION NOT NULL, ";
+				tablec += " upper_x DOUBLE PRECISION NOT NULL, ";
+				tablec += " upper_y DOUBLE PRECISION NOT NULL, ";
+				tablec += " band_id INT NOT NULL, ";
+				tablec += " resolution_factor INT NOT NULL , ";
+				tablec += " subband INT ,";
+				tablec += " spatial_data IMAGE, ";
+				tablec += " block_size INT NOT NULL ";
+				++it;
+				continue;
+
+            case TeTEXTTYPE:
+			case TeTEXTSETTYPE:
+			default:
+				tablec += (*it).rep_.name_ + " VARCHAR(255) ";
+			break;
+		}
+
+		//default value
+		if(!((*it).rep_.defaultValue_.empty()))
+            tablec += " DEFAULT '" + (*it).rep_.defaultValue_ +"' " ;
+
+		//not null
+		if(!((*it).rep_.null_))
+			tablec += " NOT NULL ";
+		
+		// auto number
+		if((*it).rep_.isAutoNumber_ && ((*it).rep_.type_==TeINT || (*it).rep_.type_==TeUNSIGNEDINT))  
+			tablec += " IDENTITY(1,1) "; 
+
+		// check if column is part of primary key
+		if ((*it).rep_.isPrimaryKey_ && (*it).rep_.type_ != TeBLOB )
+		{
+			if (!pkeys.empty())
+				pkeys += ", ";
+			pkeys += (*it).rep_.name_;
+		}
+
+		++it;
+		first = false;
+	}
+
+	if(!pkeys.empty())
+		tablec += ", PRIMARY KEY (" + pkeys + ") ";
+
+	tablec += ")";
+
+	if(!execute(tablec))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error creating table " + table;
+
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeSqlServerSpatial::alterTable (const string& table, TeAttributeRep &rep, const string& oldColName)
+{
+	if(!tableExist(table))
+		return false;
+
+	if(!oldColName.empty() && oldColName != rep.name_)
+	{
+		HRESULT hr = S_OK;
+		ADOX::_CatalogPtr m_pCatalog   = NULL;
+		ADOX::_TablePtr m_pTable  = NULL;
+		ADOX::_ColumnPtr m_pColumn  = NULL;
+		try
+		{
+			TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
+ 			m_pCatalog->PutActiveConnection(variant_t((IDispatch *)connection_));
+
+			m_pTable= m_pCatalog->Tables->GetItem(table.c_str());
+			m_pColumn = m_pTable->Columns->GetItem(oldColName.c_str()); 
+			m_pColumn->Name = rep.name_.c_str();
+			m_pCatalog->Tables->Refresh();								// Refresh the database.
+			m_pCatalog = NULL;
+			m_pTable  = NULL;
+		}
+		catch(_com_error &e)
+		{
+ 			errorMessage_ = e.Description();
+			m_pCatalog   = NULL;
+			m_pTable  = NULL;
+			return false;
+		}
+
+		catch(...)
+		{
+			errorMessage_ = "Error alter table";
+			m_pCatalog   = NULL;
+			m_pTable  = NULL;
+			return false;
+		}
+	}
+
+	string tab = " ALTER TABLE " + table + " ALTER COLUMN ";
+	tab += rep.name_ + "  ";
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			if (rep.numChar_ > 255 || rep.numChar_ == 0)
+				tab += "TEXT ";
+			else
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+		
+		case TeREAL:
+			tab += "FLOAT";	
+			break;
+		
+		case TeINT:
+			tab += "INT";
+			break;
+
+		case TeDATETIME:
+			tab += "DATE";
+			break;
+
+		case TeCHARACTER:
+			tab += "CHAR";
+			break;
+
+		case TeBOOLEAN:
+			tab += "BIT";
+			break;
+		
+		default:
+			if (rep.numChar_ > 255 || rep.numChar_ == 0)
+				tab += "TEXT ";
+			else
+				tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+
+	tab += " NULL ";
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error alter table " + table + " !";
+		return false;
+	}
+		
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + table + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+
+	if(tableId.empty() == false)
+	{
+		if(oldColName.empty() == false) // column name changed
+		{
+			 // update relation
+			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
+			sql += " WHERE related_table_id = " + tableId;
+			sql += " AND related_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
+			sql += " WHERE external_table_name = '" + table + "'";
+			sql += " AND external_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			 // update grouping
+			sql = "UPDATE te_grouping SET grouping_attr = '" + table + "." + rep.name_ + "'";
+			sql += " WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+		else // column type changed
+		{
+			// delete relation
+			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+			sql += " AND related_attr = '" + rep.name_ + "')";
+			sql += " OR (external_table_name = '" + table + "'";
+			sql += " AND external_attr = '" + rep.name_ + "')";
+			if(execute(sql) == false)
+				return false;
+
+			// delete grouping
+			TeDatabasePortal* portal = getPortal();
+			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(portal->query(sql) && portal->fetchRow())
+			{
+				string themeId = portal->getData(0);
+
+				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
+				if(execute(sql) == false)
+				{
+					delete portal;
+					return false;
+				}
+			}
+			delete portal;
+
+			sql = "DELETE FROM te_grouping";
+			sql += " WHERE grouping_attr = '" + table + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+	}
+	alterTableInfoInMemory(table);
+	return true;
+}
+
+
+
+
+
+TeDatabasePortal*  
+TeSqlServerSpatial::getPortal ()
+{
+	TeSqlServerSpatialPortal* portal = new TeSqlServerSpatialPortal (this);
+	return portal;
+}
+
+
+
+
+bool 
+TeSqlServerSpatial::generateLabelPositions (TeTheme *theme, const std::string& objectId )
+{
+	string	geomTable, upd;
+	string	collTable = theme->collectionTable();
+	
+	if((collTable.empty()) || (!tableExist(collTable)))
+		return false;
+
+	if(theme->layer()->hasGeometry(TePOLYGONS))		geomTable = theme->layer()->tableName(TePOLYGONS);
+	else if(theme->layer()->hasGeometry(TeLINES))	geomTable = theme->layer()->tableName(TeLINES);
+	else if(theme->layer()->hasGeometry(TePOINTS))	geomTable = theme->layer()->tableName(TePOINTS);
+	else if(theme->layer()->hasGeometry(TeCELLS))	geomTable = theme->layer()->tableName(TeCELLS);
+
+	upd="update " + collTable +" set label_x=(select MAX(spatial_data.MakeValid().STCentroid ( ).STX) from ";
+	upd+=geomTable + " where spatial_data.STIsValid()=1 and object_id=c_object_id), ";
+	upd+=" label_y=(select MAX(spatial_data.MakeValid().STCentroid ( ).STY) from ";
+	upd+=geomTable + " where spatial_data.STIsValid()=1 and object_id=c_object_id) ";
+	upd += " WHERE label_x IS NULL OR label_y IS NULL";
+
+	if (!upd.empty())
+	{
+		if (!objectId.empty())
+		{
+			upd += " AND c_object_id='"+objectId+"'";
+		}
+		if(!execute(upd))
+			return false;
+	}
+
+	return true;
+}
+
+
+
+std::string TeSqlServerSpatial::STGeomFromText(const TePolygon &polygon)
+{
+	std::string					sql;
+	TeLine2D					lnePolygon;
+	TeLine2D::iterator			it;
+
+	lnePolygon.copyElements(polygon[0]);
+
+	sql=" geometry::STGeomFromText('POLYGON ((";
+	for(it=lnePolygon.begin();it!=lnePolygon.end();it++)
+	{
+		if(it!=lnePolygon.begin()) sql+=",";
+		sql+=Te2String((*it).x());
+		sql+=" ";
+		sql+=Te2String((*it).y());
+	}
+	sql+="))',0)";
+	return sql;
+}
+
+std::string TeSqlServerSpatial::STGeomFromWkb(const TePolygon &polygon)
+{
+	std::string					sql;
+	TeLine2D					lnePolygon;
+	TeLine2D::iterator			it;
+	unsigned int				size;
+	char						*wkbPol;
+
+	
+
+	TeWKBGeometryDecoder::encodePolygon(polygon,wkbPol,size);
+
+	sql=" geometry::STGeomFromWKB(";
+	sql+=wkbPol;
+	sql+="),0)";
+	return sql;
+}
+
+
+bool
+TeSqlServerSpatial::createSpatialIndex(const string& table, const string& columns, TeSpatialIndexType /*type*/, short /*level*/, short /*tile*/)
+{
+	std::string			SQL;
+	double				x1=0,y1=0;
+	double				x2=0,y2=0;
+	TeDatabasePortal	*dbPortal=0;
+
+	SQL=" SELECT MIN(spatial_data.MakeValid().STEnvelope().STPointN(1).STX) as X1,";
+	SQL+=" MIN(spatial_data.MakeValid().STEnvelope().STPointN(1).STY) as Y1,";
+	SQL+=" MAX(spatial_data.MakeValid().STEnvelope().STPointN(3).STX) as X2,";
+	SQL+=" MAX(spatial_data.MakeValid().STEnvelope().STPointN(3).STY) as Y2 ";
+	SQL+=" FROM " + table;
+
+	dbPortal= this->getPortal();
+	if(dbPortal)
+	{
+		if( dbPortal->query(SQL) && dbPortal->fetchRow())
+		{
+			x1=dbPortal->getDouble("X1");
+			y1=dbPortal->getDouble("Y1");
+			x2=dbPortal->getDouble("X2");
+			y2=dbPortal->getDouble("Y2");
+		}
+		delete dbPortal;
+	}
+
+	SQL="CREATE SPATIAL INDEX SP_IDX_SPATIAL_" + table;
+	SQL+=" ON " + table + "(spatial_data)";
+	SQL+=" USING GEOMETRY_GRID WITH (";
+	SQL+=" BOUNDING_BOX = ( xmin=" + Te2String(x1);
+	SQL+=", ymin=" + Te2String(y1);
+	SQL+=", xmax=" + Te2String(x2);
+	SQL+=", ymax=" + Te2String(y2);
+	SQL+="), GRIDS = (MEDIUM, MEDIUM, MEDIUM, MEDIUM),";
+	SQL+=" CELLS_PER_OBJECT = 64,  PAD_INDEX  = ON );";
+	return this->execute(SQL);
+}
+
+
+bool 
+TeSqlServerSpatial::PutBinaryIntoVariant(VARIANT &ovData, BYTE * pBuf,unsigned long cBufLen)
+{
+	bool fRetVal = false;
+	
+	VariantInit(&ovData); 
+
+	ovData.vt = VT_ARRAY | VT_UI1;
+	SAFEARRAYBOUND rgsabound[1];
+	rgsabound[0].cElements = cBufLen;
+	rgsabound[0].lLbound = 0;
+
+	ovData.parray = SafeArrayCreate(VT_UI1,1,rgsabound);
+	if(ovData.parray != NULL)
+		{
+			void * pArrayData = NULL;
+			SafeArrayAccessData(ovData.parray,&pArrayData);
+			memcpy(pArrayData, pBuf, cBufLen);
+			SafeArrayUnaccessData(ovData.parray);
+			fRetVal = true;
+		}
+	return fRetVal;
+}
+
+bool 
+TeSqlServerSpatial::insertPolygonSet (const string& table, TePolygonSet &ps)
+{
+	string			sql;
+	unsigned int	i;
+	unsigned int	size=0;
+	int				geom_id;
+	char			*wkb;
+
+	ADODB::_RecordsetPtr recset;
+	recset.CreateInstance(__uuidof(ADODB::Recordset));
+
+try
+{
+	if (ps.empty())	return true;
+	for(i=0;i<ps.size(); i++)
+	{
+		sql=" insert into " + table;
+		sql+=" (object_id,spatial_data) values('";
+		sql+=ps[i].objectId();
+		sql+="',geometry::STPolyFromWKB(?,0))";
+
+		
+		TeWKBGeometryDecoder::encodePolygon(ps[i],wkb,size);
+		VARIANT varWKB;
+		
+		if(PutBinaryIntoVariant(varWKB,(BYTE*)wkb,size))
+		{
+			ADODB::_CommandPtr		comm;
+			ADODB::_ParameterPtr	param;
+
+			comm.CreateInstance(__uuidof(ADODB::Command)); 
+			comm->ActiveConnection = connection_;
+			comm->CommandType=ADODB::adCmdText;
+			comm->CommandText=sql.c_str();
+
+			param = comm->CreateParameter(_bstr_t(L""),ADODB::adVarBinary,ADODB::adParamInput,-1);
+			param->Value=varWKB;
+			comm->Parameters->Append(param);
+			comm->Execute(0,0,ADODB::adCmdText);
+			SafeArrayDestroy (varWKB.parray);
+			delete wkb;
+		}
+		sql="select @@IDENTITY as id from " + table;
+		recset->Open(_bstr_t(sql.c_str()), _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenForwardOnly,ADODB::adLockReadOnly,ADODB::adCmdText);
+		geom_id=recset->GetCollect("id").intVal;
+		ps[i].geomId(geom_id);
+		recset->Close();
+	}
+}catch(_com_error &e)
+{
+		errorMessage_ = e.Description();
+		if(recset->State == 1)	recset->Close();
+		return false;
+}
+catch(...)
+{
+	errorMessage_ = "Oppps !";
+	recset->Close();
+	return false;
+}
+	return true;
+}
+
+
+bool 
+TeSqlServerSpatial::insertPolygon (const string& table, TePolygon &pol)
+{
+	TePolygonSet	pls;
+	pls.add(pol);
+	return this->insertPolygonSet(table,pls);
+}
+
+
+std::string TeSqlServerSpatial::STGeomFromText(const TeLine2D &line)
+{
+	std::string					sql;
+	TeLine2D::iterator			it;
+
+
+	sql=" geometry::STGeomFromText('LINESTRING (";
+	for(it=line.begin();it!=line.end();it++)
+	{
+		if(it!=line.begin()) sql+=",";
+		sql+=Te2String((*it).x());
+		sql+=" ";
+		sql+=Te2String((*it).y());
+	}
+	sql+=")',0)";
+	return sql;
+}
+
+//std::string TeSqlServerSpatial::STGeomFromWkb(const TePolygon &polygon)
+//{
+//
+//
+//}
+
+bool
+TeSqlServerSpatial::insertLineSet(const string& table, TeLineSet &ls)
+{
+	string			sql;
+	unsigned int	i;
+	unsigned int	size=0;
+	int				geom_id;
+	char			*wkb;
+
+	ADODB::_RecordsetPtr recset;
+	recset.CreateInstance(__uuidof(ADODB::Recordset));
+
+try
+{
+	if (ls.empty())	return true;
+	for(i=0;i<ls.size(); i++)
+	{
+		sql=" insert into " + table;
+		sql+=" (object_id,spatial_data) values('";
+		sql+=ls[i].objectId();
+		sql+="',geometry::STLineFromWKB(?,0))";
+
+		
+		TeWKBGeometryDecoder::encodeLine(ls[i],wkb,size);
+		VARIANT varWKB;
+		
+		if(PutBinaryIntoVariant(varWKB,(BYTE*)wkb,size))
+		{
+			ADODB::_CommandPtr		comm;
+			ADODB::_ParameterPtr	param;
+
+			comm.CreateInstance(__uuidof(ADODB::Command)); 
+			comm->ActiveConnection = connection_;
+			comm->CommandType=ADODB::adCmdText;
+			comm->CommandText=sql.c_str();
+
+			param = comm->CreateParameter(_bstr_t(L""),ADODB::adVarBinary,ADODB::adParamInput,-1);
+			param->Value=varWKB;
+			comm->Parameters->Append(param);
+			comm->Execute(0,0,ADODB::adCmdText);
+			SafeArrayDestroy (varWKB.parray);
+			delete wkb;
+		}
+		sql="select @@IDENTITY as id from " + table;
+		recset->Open(_bstr_t(sql.c_str()), _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenForwardOnly,ADODB::adLockReadOnly,ADODB::adCmdText);
+		geom_id=recset->GetCollect("id").intVal;
+		ls[i].geomId(geom_id);
+		recset->Close();
+	}
+}catch(_com_error &e)
+{
+		errorMessage_ = e.Description();
+		if(recset->State == 1)	recset->Close();
+		return false;
+}
+catch(...)
+{
+	errorMessage_ = "Oppps !";
+	recset->Close();
+	return false;
+}
+	return true;
+}
+
+bool
+TeSqlServerSpatial::insertLine(const string& table, TeLine2D &l)
+{
+    TeLineSet	lns;
+	lns.add(l);
+	return this->insertLineSet(table,lns);
+}
+
+std::string TeSqlServerSpatial::STGeomFromText(const TePoint &point)
+{
+	std::string					sql;
+	sql=" geometry::STGeomFromText('POINT (";
+	sql+=Te2String(point.location().x());
+	sql+=" ";
+	sql+=Te2String(point.location().y());
+	sql+=")',0)";
+	return sql;
+}
+
+bool
+TeSqlServerSpatial::insertPointSet(const string& table, TePointSet &ps)
+{
+	string			sql;
+	unsigned int	i;
+	unsigned int	size=0;
+	int				geom_id;
+	char			*wkb;
+
+	ADODB::_RecordsetPtr recset;
+	recset.CreateInstance(__uuidof(ADODB::Recordset));
+
+try
+{
+	if (ps.empty())	return true;
+	for(i=0;i<ps.size(); i++)
+	{
+		sql=" insert into " + table;
+		sql+=" (object_id,spatial_data) values('";
+		sql+=ps[i].objectId();
+		sql+="',geometry::STPointFromWKB(?,0))";
+
+		
+		TeWKBGeometryDecoder::encodePoint(ps[i].location(),wkb,size);
+		VARIANT varWKB;
+		
+		if(PutBinaryIntoVariant(varWKB,(BYTE*)wkb,size))
+		{
+			ADODB::_CommandPtr		comm;
+			ADODB::_ParameterPtr	param;
+
+			comm.CreateInstance(__uuidof(ADODB::Command)); 
+			comm->ActiveConnection = connection_;
+			comm->CommandType=ADODB::adCmdText;
+			comm->CommandText=sql.c_str();
+
+			param = comm->CreateParameter(_bstr_t(L""),ADODB::adVarBinary,ADODB::adParamInput,-1);
+			param->Value=varWKB;
+			comm->Parameters->Append(param);
+			comm->Execute(0,0,ADODB::adCmdText);
+			SafeArrayDestroy (varWKB.parray);
+			delete wkb;
+		}
+		sql="select @@IDENTITY as id from " + table;
+		recset->Open(_bstr_t(sql.c_str()), _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenForwardOnly,ADODB::adLockReadOnly,ADODB::adCmdText);
+		geom_id=recset->GetCollect("id").intVal;
+		ps[i].geomId(geom_id);
+		recset->Close();
+	}
+}catch(_com_error &e)
+{
+		errorMessage_ = e.Description();
+		if(recset->State == 1)	recset->Close();
+		return false;
+}
+catch(...)
+{
+	errorMessage_ = "Oppps !";
+	recset->Close();
+	return false;
+}
+	return true;
+}
+
+bool
+TeSqlServerSpatial::insertPoint(const string& table, TePoint &p)
+{
+   
+    TePointSet	pts;
+	pts.add(p);
+	return this->insertPointSet(table,pts);
+}
+
+
+bool 
+TeSqlServerSpatial::createTextGeometry(const string& table)
+{
+	if(table.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "geom_id";
+	attGeomId.rep_.type_ = TeUNSIGNEDINT;
+	attGeomId.rep_.isAutoNumber_ = true;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attObjId;
+	attObjId.rep_.name_ = "object_id";
+	attObjId.rep_.type_ = TeSTRING;
+	attObjId.rep_.numChar_ = 255;
+	attObjId.rep_.null_ = false;
+	attList.push_back(attObjId);}
+
+
+	{TeAttribute attSpatial;
+	attSpatial.rep_.name_ = "spatial_data";
+	attSpatial.rep_.type_ = TePOINTTYPE;
+	attList.push_back(attSpatial);}
+
+	{TeAttribute attTextValue;
+	attTextValue.rep_.name_ = "text_value";
+	attTextValue.rep_.type_ = TeSTRING;
+	attTextValue.rep_.numChar_ = 255;
+	attList.push_back(attTextValue);}
+
+	{TeAttribute attAngle;
+	attAngle.rep_.name_ = "angle";
+	attAngle.rep_.type_ = TeREAL;
+	attAngle.rep_.decimals_ = 15;
+	attAngle.rep_.defaultValue_ = "0.0";
+	attList.push_back(attAngle);}
+
+	{TeAttribute attHeight;
+	attHeight.rep_.name_ = "height";
+	attHeight.rep_.type_ = TeREAL;
+	attHeight.rep_.decimals_ = 15;
+	attHeight.rep_.defaultValue_ = "0.0";
+	attList.push_back(attHeight);}
+
+	{TeAttribute attAlignVert;
+	attAlignVert.rep_.name_ = "alignment_vert";
+	attAlignVert.rep_.type_ = TeREAL;
+	attAlignVert.rep_.decimals_ = 15;
+	attList.push_back(attAlignVert);}
+
+	{TeAttribute attAlignHoriz;
+	attAlignHoriz.rep_.name_ = "alignment_horiz";
+	attAlignHoriz.rep_.type_ = TeREAL;
+	attAlignHoriz.rep_.decimals_ = 15;
+	attList.push_back(attAlignHoriz);}
+
+	if(!createTable(table, attList))
+		return false;
+
+	string idxName = "te_idx_"  + table + "_obj";
+
+	if(!createIndex(table, idxName, "object_id"))
+		return false;
+
+	idxName = "te_idx_"  + table + "_pos";
+
+	return createIndex(table, idxName, "x, y");
+}
+
+bool
+TeSqlServerSpatial::insertTextSet(const string& table, TeTextSet &ts)
+{
+    if (ts.empty())
+        return true;
+
+    string sql = "select * from ";
+    sql += table;
+    sql += " where 1=0";	
+
+    ADODB::_RecordsetPtr recset_;
+    recset_.CreateInstance(__uuidof(ADODB::Recordset));
+    try
+    {
+        recset_->Open(_bstr_t(sql.c_str()),
+            _variant_t((IDispatch*)connection_, true),
+            ADODB::adOpenKeyset,
+            ADODB::adLockOptimistic,
+            ADODB::adCmdText);
+
+        for (unsigned int i = 0; i < ts.size(); ++i)
+        {
+            recset_->AddNew();
+            recset_->Fields->GetItem("object_id")->Value = (_bstr_t) (ts[i].objectId().c_str());
+            recset_->Fields->GetItem("x")->Value = (_variant_t) (TeRoundD(ts[i].location().x_,15));
+            recset_->Fields->GetItem("y")->Value = (_variant_t) (TeRoundD(ts[i].location().y_,15));
+            recset_->Fields->GetItem("text_value")->Value = (_bstr_t) (ts[i].textValue().c_str());
+            recset_->Fields->GetItem("angle")->Value = (_variant_t) (ts[i].angle());
+            recset_->Fields->GetItem("height")->Value = (_variant_t) (ts[i].height());
+            recset_->Fields->GetItem("alignment_vert")->Value = (_variant_t) (ts[i].alignmentVert());
+            recset_->Fields->GetItem("alignment_horiz")->Value = (_variant_t) (ts[i].alignmentHoriz());
+			recset_->Update();
+            ts[i].geomId (recset_->GetCollect("geom_id").intVal);
+        }
+        recset_->Close();
+    }
+    catch(_com_error &e)
+    {
+        errorMessage_ = e.Description();
+        recset_->Close();
+        return 0;
+    }
+    catch(...)
+    {
+        errorMessage_ = "Oppps !";
+        recset_->Close();
+        return 0;
+    }
+    return true;
+}
+
+bool
+TeSqlServerSpatial::insertText(const string& table, TeText &t)
+{
+    TeTextSet	txs;
+	txs.add(t);
+	return this->insertTextSet(table,txs);
+}
+
+bool 
+TeSqlServerSpatial::locatePoint (const string& table, TeCoord2D &pt, TePoint &point, const double& tol)
+{
+	TePointSet				ps;
+	int						k;
+	TeDatabasePortal		*portal = this->getPortal();
+	bool					flag;
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	string q ="SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data FROM " + table;
+	q+=" where ";
+	q+=this->getSQLBoxWhere(box,TePOINTS,table);
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	do 
+	{
+		TePoint point;
+		flag = portal->fetchGeometry (point);
+		ps.add ( point );
+	}while (flag);
+	delete portal;
+	if (TeNearest (pt, ps, k, tol))
+	{
+		point = ps[k];
+		return true;
+	}
+	return false;
+}
+
+
+bool 
+TeSqlServerSpatial::locatePolygon (const string& table, TeCoord2D &pt, TePolygon &polygon, const double& tol)
+{
+	bool					flag;
+	TeDatabasePortal		*portal = this->getPortal();
+
+	if (!portal)			return false;
+
+	std::string q;
+	q="select geom_id, object_id, spatial_data.STAsBinary() as spatial_data from ";
+	q+=table;
+	q+=" where spatial_data.STContains(geometry::STGeomFromText('POINT(";
+	q+=Te2String(pt.x());
+	q+=" ";
+	q+=Te2String(pt.y());
+	q+=")',0))=1";
+	
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	
+	do
+	{
+		flag = portal->fetchGeometry(polygon);
+	}while (flag);
+	delete portal;
+	return true;
+}
+
+bool 
+TeSqlServerSpatial::locatePolygonSet (const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons)
+{
+
+	
+	bool					flag;
+	TeDatabasePortal		*portal = this->getPortal();
+
+	if (!portal)			return false;
+
+	std::string q;
+	q="select geom_id, object_id, spatial_data.STAsBinary() as spatial_data from ";
+	q+=table;
+	q+=" where spatial_data.STContains(geometry::STGeomFromText('POINT(";
+	q+=Te2String(pt.x());
+	q+=" ";
+	q+=Te2String(pt.y());
+	q+=")',0))=1";
+	
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	
+	do
+	{
+		TePolygon pol;
+		flag = portal->fetchGeometry(pol);
+		polygons.add(pol);
+	}while (flag);
+	delete portal;
+	return !polygons.empty();
+}
+
+
+bool 
+TeSqlServerSpatial::locateLine (const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol)
+{
+	TeLineSet				ls;
+	int						k;
+	bool					flag;
+	TeDatabasePortal		*portal = this->getPortal();
+	TeCoord2D				paux;
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	string q ="SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data FROM " + table;
+	q+=" where ";
+	q+=this->getSQLBoxWhere(box,TeLINES,table);
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	do 
+	{
+		TeLine2D l;
+		flag = portal->fetchGeometry( l );
+		ls.add ( l );
+	} while (flag);
+	delete portal;
+	if (TeNearest (pt, ls, k, paux, tol))
+	{
+		line = ls[k];
+		return true;
+	}
+	return false;
+}
+
+bool 
+TeSqlServerSpatial::locateLineSet (const string& table, TeCoord2D &pt, TeLineSet &ls, const double& tol)
+{
+	TeDatabasePortal		*portal = this->getPortal();
+	TeBox					box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	string					q ="SELECT geom_id, object_id, spatial_data.STAsBinary() as spatial_data FROM " + table;
+
+	q+=" where ";
+	q+=this->getSQLBoxWhere(box,TeLINES,table);
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	// Get all lines
+	bool flag = true;
+	do 
+	{
+		TeLine2D l;
+		flag = portal->fetchGeometry( l );
+		ls.add(l);
+	} while (flag);
+
+	delete portal;
+	return !ls.empty();
+}
+
+//----- TeSqlServerSpatialPortal methods ---
+
+TeSqlServerSpatialPortal::TeSqlServerSpatialPortal ( TeDatabase*  pDatabase) 
+{
+	db_ = pDatabase;
+	connection_ = ((TeSqlServerSpatial*)pDatabase)->connection_;
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+}
+
+
+TeSqlServerSpatialPortal::TeSqlServerSpatialPortal ()
+{
+	recset_.CreateInstance(__uuidof(ADODB::Recordset));
+	curRow_ = 0;
+}
+
+TeSqlServerSpatialPortal::~TeSqlServerSpatialPortal ()
+{
+	freeResult();
+}
+
+TeTime
+TeSqlServerSpatialPortal::getDate (const string& name)
+{
+	_variant_t value;
+
+	TeTime t;
+	try
+	{
+		value = recset_->GetCollect(name.c_str());
+	}
+	catch(_com_error &e)
+	{
+		string field = TeGetExtension(name.c_str());
+		if (!field.empty())
+		{
+			try
+			{
+				value = recset_->GetCollect(field.c_str());
+			}
+			catch(_com_error &e)
+			{
+				errorMessage_ = e.Description();
+				return t;
+			}
+			catch(...)
+			{
+				errorMessage_ = "Error getDate!";
+				return t;
+			}
+		}
+		else
+		{
+			errorMessage_ = e.Description();
+			return t;
+		}
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return t;
+	}
+
+	if (value.vt != VT_NULL)
+	{
+		bvalue_ = _bstr_t(value);
+		TeAdo* adoDb = (TeAdo*) this->getDatabase();
+		t = TeTime (string((char*)bvalue_), TeSECOND, adoDb->systemDateTimeFormat_, 
+			adoDb->systemDateSep_, adoDb->systemTimeSep_, adoDb->systemIndPM_);
+		return t;
+	}
+	else
+		return t;
+}
+
+
+TeTime
+TeSqlServerSpatialPortal::getDate (int i)
+{
+    _variant_t vtIndex;
+	_variant_t value;
+
+    vtIndex.vt = VT_I4;
+	vtIndex.lVal = i;
+	
+	TeTime t;
+	try
+	{
+		value = recset_->GetFields()->GetItem(vtIndex)->Value;
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return t;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Oppps !";
+		return t;
+	}
+	if (value.vt != VT_NULL)
+	{
+		bvalue_ = _bstr_t(value);
+		TeAdo* adoDb = (TeAdo*) this->getDatabase();
+		t = TeTime (string((char*)bvalue_), TeSECOND, adoDb->systemDateTimeFormat_, 
+			adoDb->systemDateSep_, adoDb->systemTimeSep_, adoDb->systemIndPM_);
+		return t;
+	}
+	else
+		return t;
+}
+
+
+string
+TeSqlServerSpatialPortal::getDateAsString(int i)
+{
+	TeTime t = this->getDate(i);
+	string date = t.getDateTime ();
+
+	if (!date.empty())
+	{		string tval = " TO_DATE ('"+ date +"','DDsMMsYYYYsHHsmmsSS') ";
+		return tval;
+	}
+	else
+		return "";
+}
+
+string 
+TeSqlServerSpatialPortal::getDateAsString(const string& s)
+{
+	TeTime t = this->getDate(s);
+	string date = t.getDateTime ();
+
+	if (!date.empty())
+	{		string tval = " TO_DATE ('"+ date +"','DDsMMsYYYYsHHsmmsSS') ";
+		return tval;
+	}
+	else
+		return "";
+}
+
+
+bool 
+TeSqlServerSpatialPortal::fetchGeometry(TePolygon& pol)
+{
+	int				geom_id;
+	std::string		object_id;
+	unsigned int	readBytes;	
+	unsigned char	*wkb=0;
+	const char		*wkb2Decoder;
+	long			size;
+
+	try 
+	{
+		this->getBlob("spatial_data",wkb,size);
+		if(wkb !=0)
+		{
+			wkb2Decoder=(const char*)wkb;
+			TeWKBGeometryDecoder::decodePolygon(wkb2Decoder,pol,readBytes);
+			geom_id=this->getInt("geom_id");
+			object_id=this->getData("object_id");
+
+			pol.geomId(geom_id);
+			pol.objectId(object_id);
+			delete wkb;
+		}
+		fetchRow(); 
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+	if(recset_->IsEOF)	return false;
+	return true;
+}
+
+
+bool 
+TeSqlServerSpatialPortal::fetchGeometry(TeLine2D& line)
+{
+	int				geom_id;
+	std::string		object_id;
+	unsigned int	readBytes;	
+	unsigned char	*wkb=0;
+	const char		*wkb2Decoder;
+	long			size;
+
+	try 
+	{
+		this->getBlob("spatial_data",wkb,size);
+		if(wkb !=0)
+		{
+			wkb2Decoder=(const char*)wkb;
+			TeWKBGeometryDecoder::decodeLine(wkb2Decoder,line,readBytes);
+			geom_id=this->getInt("geom_id");
+			object_id=this->getData("object_id");
+
+			line.geomId(geom_id);
+			line.objectId(object_id);
+			delete wkb;
+		}
+		fetchRow(); 
+	}
+	catch(_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+	if(recset_->IsEOF)	return false;
+	return true;
+}
+
+bool 
+TeSqlServerSpatialPortal::fetchGeometry(TePoint& p)
+{
+	TeCoord2D		coord;
+	unsigned int	readBytes;	
+	unsigned char	*wkb=0;
+	const char		*wkb2Decoder;
+	long			size;
+
+	try {
+			p.geomId( atoi(getData("geom_id")));
+			p.objectId( string(getData("object_id")));
+			this->getBlob("spatial_data",wkb,size);
+			if(wkb !=0)
+			{
+				wkb2Decoder=(const char*)wkb;
+				TeWKBGeometryDecoder::decodePoint(wkb2Decoder,coord,readBytes);
+				delete wkb;
+				p.add(coord);
+		}
+		return(this->fetchRow());
+	} 
+	catch (_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+}
+
+bool 
+TeSqlServerSpatialPortal::fetchGeometry(TePoint& p, const unsigned int& initIndex)
+{
+	TeCoord2D		coord;
+	unsigned int	readBytes;	
+	unsigned char	*wkb=0;
+	const char		*wkb2Decoder;
+	long			size;
+
+	try 
+	{
+		p.geomId( atoi(getData(initIndex)));
+		p.objectId( string(getData(initIndex+1)));
+		this->getBlob("spatial_data",wkb,size);
+		if(wkb !=0)
+			{
+				wkb2Decoder=(const char*)wkb;
+				TeWKBGeometryDecoder::decodePoint(wkb2Decoder,coord,readBytes);
+				delete wkb;
+				p.add(coord);
+			}
+		return(this->fetchRow());
+	} 
+	catch (_com_error &e)
+	{
+		errorMessage_ = e.Description();
+		return false;
+	}
+	catch(...)
+	{
+		errorMessage_ = "Error fetchGeometry!";
+		return false;
+	}
+}
+
+
+int getLastGeomId ( TeSqlServerSpatial* db, const string& table )
+{
+	TeSqlServerSpatialPortal *sqlp = NULL;
+	try
+	{
+		int lastGeomId = 0;
+
+		if (db == NULL)
+			return lastGeomId;
+		//gets the last geom id
+	
+		sqlp = (TeSqlServerSpatialPortal*)db->getPortal();
+		if(!sqlp)
+			return false;
+		sqlp->freeResult();
+		std::string sql= "SELECT MAX(geom_id) AS MaxGeomId FROM " + table;
+		
+		if(!sqlp->query(sql))
+		{
+			delete sqlp;
+			return false;
+		}		
+		
+		if( sqlp->fetchRow() )
+		{
+			lastGeomId = atoi( sqlp->getData("MaxGeomId") ); //the string must be empty
+		}
+		
+		delete sqlp;
+		sqlp = NULL;
+		
+		return lastGeomId;
+	}
+	catch(...)
+	{
+		if (sqlp)
+		{
+			delete sqlp;
+			sqlp = NULL;
+		}
+		return 0;
+	}
+}
+
+
+
diff --git a/src/terralib/drivers/ado/TeAdoSqlServerSpatial.h b/src/terralib/drivers/ado/TeAdoSqlServerSpatial.h
new file mode 100644
index 0000000..b775463
--- /dev/null
+++ b/src/terralib/drivers/ado/TeAdoSqlServerSpatial.h
@@ -0,0 +1,328 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAdoSqlServer.h
+    \brief This file contains the particularities of a ADO SQL Server Spatial driver
+*/
+#ifndef  __TERRALIB_INTERNAL_ADOSQLSERVER_SPATIAL_H
+#define  __TERRALIB_INTERNAL_ADOSQLSERVER_SPATIAL_H
+
+#include <TeDatabaseFactory.h>
+
+#ifdef WIN32
+#pragma warning ( disable: 4192 )
+#pragma warning ( disable: 4146 )
+#include <atldbcli.h>
+#include <iostream>
+#include <comdef.h>
+
+/*
+ *   Lets use the import directive to create some smart pointers for us
+ */
+#import "msado26.tlb"  rename("EOF", "IsEOF") rename("BOF", "IsBOF")
+#import <msadox.dll>
+#import <oledb32.dll> rename_namespace("OLEDB") 
+#else
+#error ONLY FOR WINDOWS OPERATIONAL SYSTEM
+#endif
+
+#include <TeDatabase.h>
+#include <TeAdoDB.h>
+#include <TeAdoSqlServer.h>
+
+
+#ifdef AFX_DLL
+#define EXPORT_WIN __declspec( dllexport )
+#else
+#define EXPORT_WIN
+#endif
+
+//! A driver class to an SQL Server Spatial database accessible using ADO library
+class  TLADO_DLL  TeSqlServerSpatial : public TeSqlServer
+{
+friend class TeSqlServerSpatialPortal;
+
+protected:
+
+	virtual std::string STGeomFromWkb(const TePolygon &polygon);
+
+	//! \brief STGeomFromText
+	/*! Method to convert a terralib polygon to wbt
+		\param		polygon		terralib polygon
+		\return		returns the sql in wbt format
+	*/
+	virtual std::string STGeomFromText(const TePolygon &polygon);
+
+	//! \brief STGeomFromText
+	/*! Method to convert a terralib line to wbt
+		\param		line		terralib line
+		\return		returns the sql in wbt format
+	*/
+	virtual std::string STGeomFromText(const TeLine2D &line);
+
+	//! \brief STGeomFromText
+	/*! Method to convert a terralib point to wbt
+		\param		point		terralib point
+		\return		returns the sql in wbt format
+	*/
+	virtual std::string STGeomFromText(const TePoint &point);
+
+	//! \brief PutBinaryIntoVariant
+	/*! Method to transform the binary data to variant
+		\param	ovData		variant
+		\param	pBuf		binary data
+		\param	cBufLen		buf length
+	*/
+	virtual bool PutBinaryIntoVariant(VARIANT &ovData, BYTE * pBuf,unsigned long cBufLen);
+
+public: 
+
+	//! \brief Empty Constructor
+	TeSqlServerSpatial();
+
+	//! \brief Destructor
+	~TeSqlServerSpatial();
+
+	virtual bool connect (const string& host, const string& user, const string& password, const string& database,  int port = -1);
+
+	
+	// Methods to manipulate a table
+
+	//! \brief columnExist
+	/*! Method to check if column exists
+		\param	table		table name
+		\param	column		column name
+		\param	attr		terralib attribute
+		\return	returns true whether column exist
+	*/
+    bool columnExist(const string& table, const string& column, TeAttribute& attr);
+    
+	//! \brief createTable
+	/*! Method to create a table
+		\param	table		table name
+		\param	attr		terralib attribute
+		\return	returns true whether create table with sucess
+	*/
+	bool createTable(const string& table, TeAttributeList &attr);
+	
+	//! \brief alterTable
+	/*! Method to alter table structure
+		\param	table		table name
+		\param	rep			Terralib Attribute representation
+		\param	oldColName	old column name
+		\return	returns true whether sucess
+	*/
+	bool alterTable (const string& table, TeAttributeRep &rep, const string& oldColName="");
+			
+	// Insert an attribute table
+	//! \brief generateLabelPositions
+	/*! Method to generate labels positions to terralib theme
+		when created
+		\param	theme		terralib theme
+		\param	objectid	object identify
+		\return returns true whether sucess
+	*/
+	bool generateLabelPositions (TeTheme *theme, const std::string& objectId = "");
+    
+	//! \brief insertPolygonSet
+	/*! Method to insert the polygon list to spatial database
+		\param	table		table name
+		\param	ps			terralib polygon list
+		\return	returns true whether sucess
+	*/
+	bool insertPolygonSet (const string& table, TePolygonSet &ps);	
+
+	//! \brief insertPolygon
+	/*! Method to insert the polygon to spatial database
+		\param	table		table name
+		\param	p			terralib polygon 
+		\return	returns true whether sucess
+	*/
+    bool insertPolygon (const string& table, TePolygon &p);
+
+	//! \brief insertLineSet
+	/*! Method to insert the terralib line list to spatial database
+		\param	table		table name
+		\param	ls			terralib line list
+		\return	returns true whether sucess
+	*/
+	bool insertLineSet(const string& table, TeLineSet &ls); 
+
+	//! \brief insertLine
+	/*! Method to insert the terralib line to spatial database
+		\param	table		table name
+		\param	l			terralib line
+		\return	returns true whether sucess
+	*/
+	bool insertLine(const string& table, TeLine2D &l);
+	
+	//! \brief insertPointSet
+	/*! Method to insert the terralib point list
+		\param	table		table name
+		\param	ps			terralib point list
+		\return	returns true whether sucess
+	*/
+	bool insertPointSet(const string& table, TePointSet &ps); 
+
+	//! \brief insertPoint
+	/*! Method to insert the terralib point to database
+		\param	table		table name
+		\param	p			terralib point
+		\return	returns true whether sucess
+	*/
+	bool insertPoint(const string& table, TePoint &p);
+
+	//! \brief insertTextSet
+	/*! Method to insert the terralib text list to database
+		\param	table		table name
+		\param	ts			terralib text list
+		\return	returns true whether sucess
+	*/
+	bool insertTextSet(const string& table, TeTextSet &ts);	
+
+	//! \brief insertText
+	/*! Method to insert terralib text to database
+		\param	table		table name
+		\param	t			terralib text
+		\return	returns true whether sucess
+	*/
+	bool insertText(const string& table, TeText &t);
+
+	//! \brief createTextGeometry
+	/*! Method to create a terralib text geometry table
+		\param	table		table name
+		\return returns true whether sucess
+	*/
+	virtual bool createTextGeometry(const string& table);
+	
+	//! \brief getSQLBoxWhere
+	/*! Method to return the espatial sql box where
+		\param	box			terralib bounding box
+		\param	rep			representation
+		\return		returns the spatial sql box where string
+	*/
+	virtual string  getSQLBoxWhere(const TeBox& box, const TeGeomRep rep, const std::string& );
+	
+	//! \brief getSQLOrderBy
+	/*! Method to return the SQL Order By
+		\param	rep		terralib representation
+		\return	returns the sql string
+	*/
+	virtual std::string getSQLOrderBy(const TeGeomRep& rep) const;
+
+	//! \brief getPortal
+	/*! Method to return the terralib database portal
+		\return	returns the terralib database portal
+	*/
+    TeDatabasePortal* getPortal ();
+
+	//! \brief createSpatialIndex
+	/*! Create a SQL Server Spatial Index
+	*/
+	bool	createSpatialIndex(const string& table, const string& columns, TeSpatialIndexType type, short level, short tile);
+
+	//! Return the box of a specific geometry (object_id)  
+	virtual bool	getMBRSelectedObjects(string geomTable,string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType,TeBox &bout, const double& tol);
+
+	virtual bool locatePoint (const string& table, TeCoord2D &pt, TePoint &point, const double& tol);
+
+	virtual bool locatePolygon (const string& table, TeCoord2D &pt, TePolygon &polygon, const double& tol);
+
+	virtual bool locatePolygonSet (const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons);
+
+	virtual bool locateLine		(const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
+
+	virtual bool locateLineSet	(const string& table, TeCoord2D &pt, TeLineSet & ls, const double& tol = 0.0);
+     	
+};
+
+//! A portal to access a ADO database
+class  TLADO_DLL  TeSqlServerSpatialPortal : public TeAdoPortal
+{
+
+public :
+
+	// Constructor / Destructor
+	TeSqlServerSpatialPortal ();
+	TeSqlServerSpatialPortal (TeDatabase* pDatabase);
+	~TeSqlServerSpatialPortal ();
+
+	TeTime getDate (int i);
+	TeTime getDate (const string& s);
+
+	string getDateAsString(int i);
+	string getDateAsString(const string& s);
+	bool	fetchGeometry(TePolygon& pol);
+	bool	fetchGeometry(TeLine2D& line);
+	bool	fetchGeometry(TePoint& p);
+	bool	fetchGeometry(TePoint& p, const unsigned int& initIndex);
+};
+
+
+/**
+ * @brief This is the class for TeSqlServerSpatial driver factory.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup DatabaseUtils
+ */
+class TLADO_DLL TeSqlServerSpatialFactory : public TeDatabaseFactory
+{
+  public :
+      
+    /**
+     * Default constructor
+     */
+    TeSqlServerSpatialFactory() : TeDatabaseFactory( 
+      std::string( "SqlServerAdoSpatial" ) ) {};      
+      
+    /**
+     * Default Destructor
+     */
+    ~TeSqlServerSpatialFactory() {};
+      
+  protected :  
+  
+    /**
+     * Implementation for the abstract TeFactory::build.
+     *
+     * @param arg A const reference to the parameters used by the
+     * database.
+     * @return A pointer to the new generated database instance.
+     */
+    TeDatabase* build( const TeDatabaseFactoryParams& arg )
+    {
+      TeSqlServerSpatial* instance_ptr = new TeSqlServerSpatial();
+      
+      if( arg.host_ != "" ) {
+        instance_ptr->connect( arg.host_, arg.user_, arg.password_,
+          arg.database_, arg.port_ );
+      }
+  
+      return (TeDatabase*)instance_ptr;
+    }
+};
+
+namespace {
+  static TeSqlServerSpatialFactory TeSqlServerSpatialFactory_instance;
+};
+
+
+#endif
diff --git a/src/terralib/drivers/gdal/TeGDALDecoder.cpp b/src/terralib/drivers/gdal/TeGDALDecoder.cpp
new file mode 100644
index 0000000..4e18849
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeGDALDecoder.cpp
@@ -0,0 +1,87 @@
+#include "TeGDALDecoder.h"
+#include "TeGDALUtils.h"
+
+// GDAL
+#include <gdal_priv.h>
+
+TeGDALDecoder::TeGDALDecoder() :
+_gdalDS(0)
+{}
+
+TeGDALDecoder::TeGDALDecoder(const TeRasterParams& par)
+{
+	params_ = par;
+	params_.decoderIdentifier_ = "GDAL";
+	params_.errorMessage_.clear();
+}
+
+TeGDALDecoder::~TeGDALDecoder() 
+{
+	if(_gdalDS != 0)
+		clear();
+}
+
+void TeGDALDecoder::init()
+{
+	// Registers all format drivers built into GDAL.
+	GDALAllRegister();
+
+	params_.status_= TeRasterParams::TeNotReady;
+
+	if(params_.mode_ != 'r')
+	{
+		params_.errorMessage_ = "There is no support for creating or altering a file from GDAL Decoder.";
+		return;
+	}
+
+	// Opens the raster file
+	_gdalDS = (GDALDataset*)GDALOpen(params_.fileName_.c_str(), GA_ReadOnly);
+	if(_gdalDS == 0)
+	{
+		params_.errorMessage_ = "Fail to open the raster file:" + params_.fileName_ + "\n";
+		params_.errorMessage_ += CPLGetLastErrorMsg();
+		return;
+	}
+
+	params_.status_ = TeRasterParams::TeReadyToRead;
+
+	Convert2TerraLib(_gdalDS, params_);
+}
+
+bool TeGDALDecoder::clear()
+{
+	GDALClose((GDALDataset*)_gdalDS);
+	_gdalDS = 0;
+	return true;
+} 
+
+bool TeGDALDecoder::setElement(int col, int lin, double val, int band)
+{
+	return false; // TODO!
+}
+
+bool TeGDALDecoder::getElement(int col, int lin, double& val, int band)
+{
+	GDALRasterBand* rasterBand = _gdalDS->GetRasterBand(band+1);
+
+	// Reads the pixel value
+	CPLErr error = rasterBand->RasterIO(GF_Read, col, lin, 1, 1, &val, 1, 1, GDT_Float64/*?*/, 0, 0);
+	if(error == CE_Failure)
+		return false;
+
+	return true;
+}
+
+TeGDALDecoderFactory::TeGDALDecoderFactory(const string& name):  TeDecoderFactory(name) 
+{
+	// Registers some file formats...
+	TeDecoderFactory::instanceName2Dec()["JPG"]  = "GDAL";	
+	TeDecoderFactory::instanceName2Dec()["JPEG"] = "GDAL";
+	TeDecoderFactory::instanceName2Dec()["TIF"]  = "GDAL";
+	TeDecoderFactory::instanceName2Dec()["TER"]  = "GDAL";
+	TeDecoderFactory::instanceName2Dec()["DEM"]  = "GDAL";
+	TeDecoderFactory::instanceName2Dec()["BMP"]  = "GDAL";
+	TeDecoderFactory::instanceName2Dec()["PNG"]  = "GDAL";
+	TeDecoderFactory::instanceName2Dec()["GIF"]  = "GDAL";
+	// ... TODO ...
+}
diff --git a/src/terralib/drivers/gdal/TeGDALDecoder.h b/src/terralib/drivers/gdal/TeGDALDecoder.h
new file mode 100644
index 0000000..684d2bd
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeGDALDecoder.h
@@ -0,0 +1,92 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/** \file  TeGDALDecoder.h
+    \brief This file contains a concrete raster decoder based on GDAL Library.
+    \author Douglas Uba <douglas at dpi.inpe.br>
+   */
+
+#ifndef _TEGDALDRIVER_H
+#define _TEGDALDRIVER_H
+
+// Defines
+#include "TeGDALDefines.h"
+
+// TerraLib include files
+#include "TeDecoder.h"
+
+// STL include files
+#include <vector>
+#include <string>
+
+// forward declarations;
+class GDALDataset;
+
+class TEGDAL_DLL TeGDALDecoder : public TeDecoder 
+{
+	
+public:
+  
+	TeGDALDecoder();
+
+	TeGDALDecoder(const TeRasterParams& par);
+
+    ~TeGDALDecoder();
+
+	//! Initializes the internal structures
+	void init();
+
+	//! Releases the internal structures
+	bool clear();
+
+	//! Writes an element
+	bool setElement(int col, int lin, double val, int band = 0);
+
+	//! Reads an element
+	bool getElement(int col, int lin, double &val, int band = 0);
+
+protected:
+	
+	GDALDataset* _gdalDS; //!< A pointer to GDAL Data Source.
+
+private:
+  
+    TeGDALDecoder(const TeGDALDecoder& source);
+
+    TeGDALDecoder& operator=(const TeGDALDecoder& source);
+};
+
+//! Implements a factory to build decoders based on GDAL library
+class TEGDAL_DLL TeGDALDecoderFactory : public TeDecoderFactory
+{
+public:
+
+	//! Constructor for the factory
+	TeGDALDecoderFactory(const string& name);
+
+	//! Built the object
+	TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeGDALDecoder(arg); }
+};
+
+#endif // _TEGDALDRIVER_H
diff --git a/src/terralib/drivers/gdal/TeGDALDefines.h b/src/terralib/drivers/gdal/TeGDALDefines.h
new file mode 100644
index 0000000..5712c5b
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeGDALDefines.h
@@ -0,0 +1,14 @@
+#ifndef  __TEGDAL_INTERNAL_DEFINES_H
+#define  __TEGDAL_INTERNAL_DEFINES_H
+
+#ifdef WIN32
+	#ifdef TEGDAL_EXPORTS
+		#define TEGDAL_DLL  __declspec(dllexport)   // export DLL information
+	#else
+		#define TEGDAL_DLL  __declspec(dllimport)   // import DLL information
+	#endif
+#else
+	#define TEGDAL_DLL
+#endif
+
+#endif
diff --git a/src/terralib/drivers/gdal/TeGDALUtils.cpp b/src/terralib/drivers/gdal/TeGDALUtils.cpp
new file mode 100644
index 0000000..53655c6
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeGDALUtils.cpp
@@ -0,0 +1,104 @@
+// OGR Driver include files
+#include "TeGDALUtils.h"
+
+// TerraLib include files
+#include <TeRaster.h>
+
+void Convert2TerraLib(GDALDataset* ds, TeRasterParams& params)
+{
+	// Number of collumns
+	params.ncols_  = ds->GetRasterXSize();
+	// Number of lines
+	params.nlines_ = ds->GetRasterYSize();
+	// Number of bands
+	params.nBands(ds->GetRasterCount());
+
+	// For each band, adjusts params
+	for(int b = 0; b < params.nBands(); b++)
+	{
+		GDALRasterBand* band = ds->GetRasterBand(b+1);
+		Convert2TerraLib(band, params, b);
+	}
+
+	double geoTransformParams[6];
+	CPLErr error = ds->GetGeoTransform(geoTransformParams);
+	if(error == CE_Failure) // format does not support transformation to projection coordinates
+	{
+		// Builds the Box
+		double llx = 0;
+		double lly = 0;
+		double urx = (double)params.ncols_;
+		double ury = (double)params.nlines_;
+
+		params.boundingBoxLinesColumns(llx, lly, urx, ury, params.nlines_, params.ncols_);
+		
+		return;
+	}
+
+	// Calculates box and pixel resolution
+	Convert2TerraLib(geoTransformParams, params);
+}
+
+void Convert2TerraLib(GDALRasterBand* rasterBand, TeRasterParams& params, const int& i)
+{
+	// Gets the dummy value
+	int noDataValueIsUsed = 0;
+	double dummy = rasterBand->GetNoDataValue(&noDataValueIsUsed);
+	if(!noDataValueIsUsed)
+	{
+		params.useDummy_ = false;
+		dummy = TeMAXFLOAT;
+	}
+	params.setDummy(dummy, i);
+
+	// Gets the DataType
+	GDALDataType type = rasterBand->GetRasterDataType();
+	params.setDataType(Convert2TerraLib(type), i);
+}
+
+void Convert2TerraLib(double* geoTransformParams, TeRasterParams& params)
+{
+	// Gets the resolution
+	params.resx_ = geoTransformParams[1];
+	params.resy_ = (-1.0) * geoTransformParams[5];
+
+	// Builds the Box
+	double llx = geoTransformParams[0];
+	double lly = geoTransformParams[3] + ((double)params.nlines_ * geoTransformParams[5]);
+	double urx = geoTransformParams[0] + ((double)params.ncols_  * geoTransformParams[1]);
+	double ury = geoTransformParams[3];
+
+	params.boundingBoxLinesColumns(llx, lly, urx, ury, params.nlines_, params.ncols_);
+}
+
+TeDataType Convert2TerraLib(GDALDataType type)
+{
+	// Convert GDAL DataType to TerraLib
+	switch(type)
+	{
+		case GDT_Byte: 
+			return TeUNSIGNEDCHAR;
+		break;
+		
+		case GDT_UInt16: 
+		case GDT_UInt32:
+			return TeUNSIGNEDLONG;
+		break;
+
+		case GDT_Int16:
+		case GDT_Int32:
+			return TeINTEGER;
+		break;
+
+		case GDT_Float32: 
+			return TeFLOAT;
+		break;
+		
+		case GDT_Float64: 
+			return TeDOUBLE;
+		break;
+
+		default:
+			return TeUNSIGNEDCHAR;
+	}
+}
diff --git a/src/terralib/drivers/gdal/TeGDALUtils.h b/src/terralib/drivers/gdal/TeGDALUtils.h
new file mode 100644
index 0000000..6499630
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeGDALUtils.h
@@ -0,0 +1,83 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/** \file  TeGDALUtils.h
+    \brief Utility functions for GDAL support.
+    \author Douglas Uba <douglas at dpi.inpe.br>
+   */
+
+#ifndef _TEGDALUTILS_H
+#define _TEGDALUTILS_H
+
+// Defines
+#include "TeGDALDefines.h"
+
+// TerraLib include files
+#include <TeDataTypes.h>
+
+// GDAL
+#include <gdal_priv.h>
+
+// forward declarations
+class TeRasterParams;
+class GDALDataset;
+class GDALRasterBand;
+
+/*!
+    \brief It converts the GDAL data set to TerraLib Raster Parameters set.
+    \param  ds[in] A valid GDAL data set.
+	\params params[out] TerraLib Raster Parameters that will be filled.
+*/
+TEGDAL_DLL void Convert2TerraLib(GDALDataset* ds, TeRasterParams& params);
+
+/*!
+    \brief It converts a GDAL raster band definition to TerraLib Raster Parameters set.
+    \param  rasterBand[in] A valid GDAL raster band.
+	\params params[out] TerraLib Raster Parameters that will be filled.
+	\params i[in] The index of band.
+*/
+TEGDAL_DLL void Convert2TerraLib(GDALRasterBand* rasterBand, TeRasterParams& params, const int& i);
+
+/*!
+    \brief It converts the GDAL data type to TerraLib Data Type.
+    \param  type A valid GDAL data type.
+	\return TerraLib Data Type enum element.
+*/
+TEGDAL_DLL TeDataType Convert2TerraLib(GDALDataType type);
+
+/*!
+    \brief It converts the GDAL affine transformation coefficients to TerraLib Raster Parameters set.
+    \param	geoTransformParams[in] A valid GDAL affine transformation coefficients.
+	\params params[out] TerraLib Raster Parameters that will be filled.
+	\note This method extracts the raster resolution (x,y) and builds the correct box based on affine transformation coefficients.
+	\note geoTransformParams is an array of double with size = 6, where:
+											geoTransformParams[0] /* top left x 
+											geoTransformParams[1] /* w-e pixel resolution
+											geoTransformParams[2] /* rotation, 0 if image is "north up"
+											geoTransformParams[3] /* top left y
+											geoTransformParams[4] /* rotation, 0 if image is "north up"
+											geoTransformParams[5] /* n-s pixel resolution
+*/
+TEGDAL_DLL void Convert2TerraLib(double* geoTransformParams, TeRasterParams& params);
+
+#endif // _TEGDALUTILS_H
diff --git a/src/terralib/drivers/gdal/TeOGRDriver.cpp b/src/terralib/drivers/gdal/TeOGRDriver.cpp
new file mode 100644
index 0000000..7b18a24
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeOGRDriver.cpp
@@ -0,0 +1,123 @@
+#include "TeOGRDriver.h"
+#include "TeOGRUtils.h"
+
+// TerraLib include files
+#include "TeProjection.h"
+#include "TeSTElementSet.h"
+
+// OGR
+#include <ogrsf_frmts.h>
+
+TeOGRDriver::TeOGRDriver(const std::string& fileName) :
+TeGeoDataDriver(),
+fileName_(fileName),
+numObjs_(0),
+ogrLayer_(0)
+{
+	// Registers all format drivers built into OGR.
+	OGRRegisterAll();	
+	
+	// Open OGR Datasource
+	ogrDS_ = OGRSFDriverRegistrar::Open(fileName.c_str());
+	
+	/* TODO: The data set may has one or more layers. Is necessary a revision on TeGeoDataDriver interface?
+			 For while, only first layer is considered by the driver. */
+
+	if(ogrDS_ != 0)
+	{
+		int nLayers = ogrDS_->GetLayerCount();
+		if(nLayers > 0)
+			ogrLayer_ = ogrDS_->GetLayer(0); // Gets the first layer
+	}
+}
+
+TeOGRDriver::~TeOGRDriver() 
+{
+	OGRDataSource::DestroyDataSource(ogrDS_);
+	ogrDS_ = 0;
+}
+
+std::string TeOGRDriver::getFileName() 
+{
+	return fileName_;
+}
+
+bool TeOGRDriver::isDataAccessible() 
+{
+	return TeCheckFileExistence(fileName_) && (ogrDS_ != 0);
+}
+
+TeProjection* TeOGRDriver::getDataProjection() 
+{
+	if(ogrLayer_ == 0)
+		return new TeNoProjection();
+
+	OGRSpatialReference* srs = ogrLayer_->GetSpatialRef();
+	if(srs == 0)
+		return new TeNoProjection();
+
+	if(srs->AutoIdentifyEPSG() == OGRERR_UNSUPPORTED_SRS)
+		return new TeNoProjection();
+
+	TeProjection* proj = TeProjectionFactory::make(atoi(srs->GetAuthorityCode(0)));
+
+	return proj;
+}
+
+bool TeOGRDriver::getDataInfo(unsigned int& nObjects, TeBox& ext, TeGeomRep& repres) 
+{
+	if(ogrLayer_ == 0)
+		return false;
+
+	// Number of objects
+	nObjects = ogrLayer_->GetFeatureCount();
+
+	// Box
+	OGREnvelope* env = new OGREnvelope();
+	ogrLayer_->GetExtent(env);
+	ext = Convert2TerraLib(env);
+	delete env;
+	
+	// Geometric representation
+	repres = (TeGeomRep)Convert2TerraLib(ogrLayer_->GetLayerDefn()->GetGeomType());
+
+	return true;
+}
+
+bool TeOGRDriver::getDataAttributesList(TeAttributeList& attList) 
+{
+	if(ogrLayer_ == 0)
+		return false;
+	
+	attList = Convert2TerraLib(ogrLayer_->GetLayerDefn());
+
+	return true;
+}
+
+bool TeOGRDriver::loadData(TeSTElementSet* dataSet) 
+{
+	if(ogrLayer_ == 0)
+		return false;
+
+	TeAttributeList attrList = Convert2TerraLib(ogrLayer_->GetLayerDefn());
+	dataSet->setAttributeList(attrList);
+
+	ogrLayer_->ResetReading();
+	OGRFeature* feat;
+	while((feat = ogrLayer_->GetNextFeature()) != 0)
+	{
+		dataSet->insertSTInstance(Convert2TerraLib(feat));
+	}
+
+	return true;
+}
+
+void TeOGRDriver::getDriversNames(std::vector<std::string>& dnames)
+{
+	int ndrivers = OGRSFDriverRegistrar::GetRegistrar()->GetDriverCount();
+	for(int i = 0; i < ndrivers; ++i)
+	{
+		OGRSFDriver* driver = OGRSFDriverRegistrar::GetRegistrar()->GetDriver(i);
+		dnames.push_back(driver->GetName());
+	}
+}
diff --git a/src/terralib/drivers/gdal/TeOGRDriver.h b/src/terralib/drivers/gdal/TeOGRDriver.h
new file mode 100644
index 0000000..4776f94
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeOGRDriver.h
@@ -0,0 +1,97 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/** \file  TeOGRDriver.h
+    \brief This file contains a concrete geo data driver based on OGR Library.
+    \author Douglas Uba <douglas at dpi.inpe.br>
+   */
+
+#ifndef _TEOGRDRIVER_H
+#define _TEOGRDRIVER_H
+
+// Defines
+#include "TeGDALDefines.h"
+
+// TerraLib include files
+#include "TeGeoDataDriver.h"
+#include "TeBox.h"
+#include "TeDataTypes.h"
+#include "TeAttribute.h"
+
+// STL include files
+#include <vector>
+#include <string>
+
+// forward declarations;
+class TeProjection;
+class TeSTElementSet;
+class OGRDataSource;
+class OGRLayer;
+
+class TEGDAL_DLL TeOGRDriver : public TeGeoDataDriver 
+{
+	
+public:
+  
+	TeOGRDriver(const std::string& fileName);
+
+    ~TeOGRDriver();
+
+	//! Returns the complete access path associated to this driver
+	virtual std::string getFileName();
+
+	//! Returns true or false whether the data file is accessible
+	virtual bool isDataAccessible();
+
+	//! Returns the spatial reference associated to the data as an instance of TeProjection 
+	virtual TeProjection * getDataProjection();
+
+	//! Loads the minimum metadata information about the data
+	virtual bool getDataInfo(unsigned int& nObjects, TeBox& ext, TeGeomRep& repres);
+
+	//! Loads the list of descriptive attributes of the objetcts represented in the file
+	virtual bool getDataAttributesList(TeAttributeList& attList);
+
+	//! Loads the data into an TeSTElementSet structure in memory
+	virtual bool loadData(TeSTElementSet* dataSet);
+
+	//! Gets the names of registered OGR drivers.
+	virtual void getDriversNames(std::vector<std::string>& dnames);
+
+protected:
+
+	OGRDataSource* ogrDS_;  //!< A pointer to OGR Data Source.
+	OGRLayer* ogrLayer_;	//!< A pointer to first OGR Layer on DataSource. // TODO: revision is necessary.
+	std::string fileName_;  //!< Complete access path
+	TeBox box_;				//<! Data set box
+	unsigned int numObjs_;  //<! Number of features in data set
+	TeGeomRep geomType_;    //<! Geometric representation of data set
+
+private:
+  
+    TeOGRDriver(const TeOGRDriver& source);
+
+    TeOGRDriver & operator=(const TeOGRDriver & source);
+};
+
+#endif // _TEOGRDRIVER_H
diff --git a/src/terralib/drivers/gdal/TeOGRDriverFactory.cpp b/src/terralib/drivers/gdal/TeOGRDriverFactory.cpp
new file mode 100644
index 0000000..7d5657c
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeOGRDriverFactory.cpp
@@ -0,0 +1,27 @@
+#include "TeOGRDriverFactory.h"
+#include "TeOGRDriver.h"
+
+// TerraLib include files
+#include "TeGeoDataDriver.h"
+
+TeOGRDriverFactory::TeOGRDriverFactory() :
+TeGDriverFactory("OGR")
+{}
+
+TeOGRDriverFactory::~TeOGRDriverFactory() 
+{}
+
+TeGeoDataDriver * TeOGRDriverFactory::build(TeGDriverParams * params) 
+{
+	TeGeoDataDriver* driver = 0;
+
+	if(params != 0 && !params->fileName_.empty())
+		driver = new TeOGRDriver(params->fileName_);
+
+	return driver;
+}
+
+TeGeoDataDriver* TeOGRDriverFactory::build() 
+{
+	return 0;
+}
diff --git a/src/terralib/drivers/gdal/TeOGRDriverFactory.h b/src/terralib/drivers/gdal/TeOGRDriverFactory.h
new file mode 100644
index 0000000..e111b46
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeOGRDriverFactory.h
@@ -0,0 +1,59 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/** \file  TeOGRDriverFactory.h
+    \brief This file contains a factory that builds OGR geo data drivers.
+    \author Douglas Uba <douglas at dpi.inpe.br>
+   */
+
+#ifndef _TEOGRDRIVERFACTORY_H
+#define _TEOGRDRIVERFACTORY_H
+
+// Defines
+#include "TeGDALDefines.h"
+
+// TerraLib include files
+#include "TeGDriverFactory.h"
+
+// forward declarations
+class  TeOGRDriver;
+class  TeGeoDataDriver;
+struct TeGDriverParams;
+
+class TEGDAL_DLL TeOGRDriverFactory : public TeGDriverFactory 
+{
+  public:
+    
+	TeOGRDriverFactory();
+    ~TeOGRDriverFactory();
+	
+  protected:
+  
+    //! Builds a new product from a set of parameters
+    TeGeoDataDriver* build(TeGDriverParams * params); 
+
+    //! Builds a new product without parameters
+    TeGeoDataDriver* build();
+};
+
+#endif // _TEOGRDRIVERFACTORY_H
diff --git a/src/terralib/drivers/gdal/TeOGRUtils.cpp b/src/terralib/drivers/gdal/TeOGRUtils.cpp
new file mode 100644
index 0000000..804f5e0
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeOGRUtils.cpp
@@ -0,0 +1,219 @@
+// OGR Driver include files
+#include "TeOGRUtils.h"
+
+// TerraLib include files
+#include "TeGeometry.h"
+#include "TeUtils.h"
+#include "TeWKBGeometryDecoder.h"
+
+// OGR include files
+#include <ogrsf_frmts.h>
+#include <ogr_spatialref.h>
+
+std::vector<TeGeometry*> Convert2TerraLib(OGRGeometry* ogrGeom)
+{
+	ogrGeom->flattenTo2D();
+	int wkbSize = ogrGeom->WkbSize();
+	unsigned char* wkbArray = new unsigned char[wkbSize];
+	ogrGeom->exportToWkb(wkbNDR, wkbArray);
+	
+	const char* wkb = (const char*)wkbArray;
+	
+	unsigned int readBytes;
+	std::vector<TeGeometry*> geoms;
+	OGRwkbGeometryType geomType = ogrGeom->getGeometryType();
+	std::string gname = ogrGeom->getGeometryName();
+	switch(geomType)
+	{
+		case wkbPolygon:
+		{
+			TePolygon* p = new TePolygon();
+			TeWKBGeometryDecoder::decodePolygon(wkb, *p, readBytes);
+			geoms.push_back(p);
+			break;
+		}
+
+		case wkbLineString:
+		{
+			TeLine2D* l = new TeLine2D();
+			TeWKBGeometryDecoder::decodeLine(wkb, *l, readBytes);
+			geoms.push_back(l);
+			break;
+		}
+
+		case wkbPoint:
+		{
+			TeCoord2D c;
+			TeWKBGeometryDecoder::decodePoint(wkb, c, readBytes);
+			TePoint* pt = new TePoint(c);
+			geoms.push_back(pt);
+			break;
+		}
+
+		case wkbMultiPolygon:
+		{
+			TePolygonSet pset;
+			TeWKBGeometryDecoder::decodePolygonSet(wkb, pset, readBytes);
+			for(unsigned int i = 0; i < pset.size(); i++)
+				geoms.push_back(new TePolygon(pset[i]));
+			break;
+		}
+
+		case wkbMultiLineString:
+		{
+			TeLineSet lset;
+			TeWKBGeometryDecoder::decodeLineSet(wkb, lset, readBytes);
+			for(unsigned int i = 0; i < lset.size(); i++)
+				geoms.push_back(new TeLine2D(lset[i]));
+			break;
+		}
+
+		case wkbMultiPoint:
+		{
+			TePointSet ptset;
+			TeWKBGeometryDecoder::decodePointSet(wkb, ptset, readBytes);
+			for(unsigned int i = 0; i < ptset.size(); i++)
+				geoms.push_back(new TePoint(ptset[i]));
+			break;
+		}
+	}
+
+	delete [] wkbArray;
+
+	return geoms;
+}
+
+TeBox Convert2TerraLib(OGREnvelope* env)
+{
+	return TeBox(env->MinX, env->MinY, env->MaxX, env->MaxY);
+}
+
+TeAttributeList Convert2TerraLib(OGRFeatureDefn* featDef)
+{
+	TeAttributeList attrList;
+	int nFields = featDef->GetFieldCount();
+	for(int i = 0; i < nFields; i++)
+	{
+		OGRFieldDefn* fieldDef = featDef->GetFieldDefn(i); 
+		attrList.push_back(Convert2TerraLib(fieldDef));
+	}
+	return attrList;
+}
+
+TeAttribute Convert2TerraLib(OGRFieldDefn* fieldDef)
+{
+	TeAttribute attr;
+	attr.rep_.name_ = fieldDef->GetNameRef();
+	switch(fieldDef->GetType())
+	{
+		case OFTInteger:
+			attr.rep_.type_ = TeINT;
+		break;
+
+		case OFTIntegerList:
+			attr.rep_.type_ = TeUNKNOWN; // ?
+		break;
+
+		case OFTString:
+			attr.rep_.type_ = TeSTRING;
+			attr.rep_.numChar_ = fieldDef->GetWidth();
+		break;
+
+		case OFTStringList:
+			attr.rep_.type_ = TeUNKNOWN; // ?
+		break;
+
+		case OFTReal:
+			attr.rep_.type_ = TeREAL;
+		break;
+
+		case OFTRealList:
+			attr.rep_.type_ = TeUNKNOWN; // ?
+		break;
+
+		case OFTBinary:
+			attr.rep_.type_ = TeBLOB;
+		break;
+
+		case OFTDate:
+		case OFTTime:
+		case OFTDateTime:
+			attr.rep_.type_ = TeDATETIME;
+		break;
+
+		default:
+			attr.rep_.type_ = TeUNKNOWN; // ?
+	}
+
+	return attr;
+}
+
+TeSTInstance Convert2TerraLib(OGRFeature* feat)
+{
+	TeSTInstance obj;
+	obj.setObjectId(Te2String(feat->GetFID()));
+	obj.addPropertyValue(Te2String(feat->GetFID()));
+
+	int nFields = feat->GetFieldCount();
+	for(int i = 0; i < nFields; i++)
+		obj.addPropertyValue(feat->GetFieldAsString(i));
+
+	OGRGeometry* ogrGeom = feat->GetGeometryRef();
+	if(ogrGeom == 0)
+		return obj;
+
+	std::vector<TeGeometry*> geoms = Convert2TerraLib(ogrGeom);
+	for(unsigned int i = 0; i < geoms.size(); i++)
+	{
+		geoms[i]->objectId(obj.getObjectId());
+		switch(geoms[i]->elemType())
+		{
+			case TePOLYGONS:
+				obj.addGeometry(*(static_cast<TePolygon*>(geoms[i])));
+			break;
+
+			case TeLINES:
+				obj.addGeometry(*(static_cast<TeLine2D*>(geoms[i])));
+			break;
+
+			case TePOINTS:
+				obj.addGeometry(*(static_cast<TePoint*>(geoms[i])));
+			break;
+		}
+	}
+
+	for(unsigned int i = 0; i < geoms.size(); i++)
+		delete geoms[i];
+
+	return obj;
+}
+
+int Convert2TerraLib(OGRwkbGeometryType geomType)
+{
+	switch(geomType)
+	{
+		case wkbPolygon:
+		case wkbPolygon25D:
+		case wkbMultiPolygon:
+		case wkbMultiPolygon25D:
+			return TePOLYGONS;
+
+		case wkbLineString:
+		case wkbLineString25D:
+		case wkbMultiLineString:
+		case wkbMultiLineString25D:
+			return TeLINES;
+
+		case wkbPoint:
+		case wkbPoint25D:
+		case wkbMultiPoint:
+		case wkbMultiPoint25D:
+			return TePOINTS;
+
+		case wkbUnknown:
+			return TePOLYGONS | TeLINES | TePOINTS;
+
+		default:
+			return TeGEOMETRYNONE;
+	}
+}
\ No newline at end of file
diff --git a/src/terralib/drivers/gdal/TeOGRUtils.h b/src/terralib/drivers/gdal/TeOGRUtils.h
new file mode 100644
index 0000000..9501e42
--- /dev/null
+++ b/src/terralib/drivers/gdal/TeOGRUtils.h
@@ -0,0 +1,95 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/** \file  TeOGRUtils.h
+    \brief Utility functions for OGR support.
+    \author Douglas Uba <douglas at dpi.inpe.br>
+   */
+
+#ifndef _TEOGRUTILS_H
+#define _TEOGRUTILS_H
+
+// Defines
+#include "TeGDALDefines.h"
+
+// TerraLib include files
+#include "TeAttribute.h"
+#include "TeBox.h"
+#include "TeSTInstance.h"
+
+// OGR include files
+#include <ogr_core.h>
+
+// forward declarations
+class OGRGeometry;
+class OGREnvelope;
+class OGRSpatialReference;
+class OGRFeatureDefn;
+class OGRFieldDefn;
+class OGRFeature;
+
+/*!
+    \brief It converts the OGR Geometry to TerraLib Geometry.
+    \param ogrGeom A valid OGR Geometry.
+    \return A vector of TerraLib Geometries.
+    \note It uses the WKB to create the TerraLib Geometry.  
+*/
+TEGDAL_DLL std::vector<TeGeometry*> Convert2TerraLib(OGRGeometry* ogrGeom);
+
+/*!
+	\brief It converts the OGR Envelope to TerraLib Box.
+	\param env A valid OGR Envelope.
+	\return A valid TerraLib Box.
+*/
+TEGDAL_DLL TeBox Convert2TerraLib(OGREnvelope* env);
+
+/*!
+	\brief It converts the OGR Feature Definition to TerraLib Attribute List.
+    \param featDef A valid OGR Feature Definition.
+    \return A TerraLib Attribute List.
+    \note It uses the method that converts a OGR Field Definition to TerraLib Attribute.
+*/
+TEGDAL_DLL TeAttributeList Convert2TerraLib(OGRFeatureDefn* featDef);
+
+/*!
+	\brief It converts the OGR Field Definition to TerraLib Attribute.
+	\param fieldDef A valid OGR Field Definition.
+	\return A TerraLib Attribute.
+*/
+TEGDAL_DLL TeAttribute Convert2TerraLib(OGRFieldDefn* fieldDef);
+
+/*!
+	\brief It converts a OGR Feature to TerraLib STInstance object.
+    \param feat A valid OGR Feature.
+    \return A TerraLib STInstance object.
+*/
+TEGDAL_DLL TeSTInstance Convert2TerraLib(OGRFeature* feat);
+
+/*!
+	\brief It converts the OGR Geometry Type element to TerraLib Geometric Representation
+	\param geomType A valid OGR Geometry Type element.
+	\return TerraLib Geometric composite.
+*/
+TEGDAL_DLL int Convert2TerraLib(OGRwkbGeometryType geomType);
+
+#endif // _TEOGRUTILS_H
diff --git a/src/terralib/drivers/libjpeg/TeLibJpegWrapper.cpp b/src/terralib/drivers/libjpeg/TeLibJpegWrapper.cpp
old mode 100755
new mode 100644
index 350f09d..0da7e1b
--- a/src/terralib/drivers/libjpeg/TeLibJpegWrapper.cpp
+++ b/src/terralib/drivers/libjpeg/TeLibJpegWrapper.cpp
@@ -1,216 +1,216 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include <stdio.h>
-
-extern "C" { 
-#include "jmemdstsrc.h"
-} 
-
-#include <string>
-using std::string;
-
-namespace Jpeg
-{
-	bool  ReadFileParams(const string& fileName, int& width, int& height, int& nChannels)
-	{
-		if (fileName.empty())
-			return false;
-
-		FILE* infile;
-		if ((infile = fopen(fileName.c_str(), "rb")) == 0) 
-			return false;
-			
-		struct jpeg_decompress_struct cinfo;
-		struct jpeg_error_mgr jerr;
-		cinfo.err = jpeg_std_error(&jerr);
-		jpeg_create_decompress(&cinfo);
-
-		jpeg_stdio_src(&cinfo, infile);
-		jpeg_read_header(&cinfo, true);
-		jpeg_calc_output_dimensions(&cinfo);
-		
-		width = cinfo.image_width;
-		height = cinfo.image_height;
-		nChannels = cinfo.num_components;
-		jpeg_destroy_decompress(&cinfo);
-		fclose(infile);
-		return true;
-	}
-
-	bool DecompressFile(const string& fileName, unsigned char* dstBuffer, int& width, int& height, int& nChannels)
-	{
-		if (!dstBuffer || fileName.empty())
-			return false;
-
-		FILE* infile;
-		if ((infile = fopen(fileName.c_str(), "rb")) == 0) 
-			return false;
-		
-		struct jpeg_error_mgr jerr;
-		struct jpeg_decompress_struct cinfo;
-		cinfo.err = jpeg_std_error(&jerr);
-		jpeg_create_decompress(&cinfo);
-		jpeg_stdio_src(&cinfo, infile);
-		jpeg_read_header(&cinfo, true);
-		jpeg_start_decompress(&cinfo);
-
-		width = cinfo.output_width; 
-		height = cinfo.output_height;
-		nChannels = cinfo.num_components;	
-
-		unsigned char* rowptr[1];
-		while (cinfo.output_scanline < cinfo.output_height)
-		{
-			rowptr[0] = &dstBuffer[cinfo.output_scanline*cinfo.output_width*cinfo.num_components];
-			jpeg_read_scanlines(&cinfo, rowptr, 1);
-		}
-		jpeg_finish_decompress(&cinfo);
-		jpeg_destroy_decompress(&cinfo);
-		fclose(infile);
-		return true;
-	}	
-
-	bool DecompressBuffer(unsigned char* srcBuffer, int size, unsigned char* dstBuffer, int& width, int& height, int& bpp)
-	{
-		if (!dstBuffer)
-			return false;
-
-		struct jpeg_error_mgr jerr;
-		struct jpeg_decompress_struct cinfo;
-
-		cinfo.err = jpeg_std_error(&jerr);
-		jpeg_create_decompress(&cinfo);
-
-		jpeg_mem_src (&cinfo, srcBuffer, size);
-
-		jpeg_read_header(&cinfo,true);
-		jpeg_start_decompress(&cinfo);
-		
-		width = cinfo.output_width;
-		height = cinfo.output_height;
-		bpp = cinfo.num_components;
-		unsigned char* rowptr[1];
-		while (cinfo.output_scanline < cinfo.output_height)
-		{
-			rowptr[0] = &dstBuffer[cinfo.output_scanline*cinfo.output_width*cinfo.num_components];
-			if (rowptr[0] == 0)
-			{
-				jpeg_finish_decompress(&cinfo);
-				jpeg_destroy_decompress(&cinfo);
-				return false;
-			}
-			if (jpeg_read_scanlines(&cinfo, rowptr, 1) != 1)
-			{
-				jpeg_finish_decompress(&cinfo);
-				jpeg_destroy_decompress(&cinfo);
-				return false;
-			}
-		}
-		jpeg_finish_decompress(&cinfo);
-		jpeg_destroy_decompress(&cinfo);
-		return true;
-	}
-
-	bool CompressToFile(unsigned char* buffer, int width, int height, int bpp, const string& fileName, int quality=75)
-	{
-		// check if input parameters are valid
-		if (fileName.empty() || !buffer || (bpp != 1 && bpp != 3) )
-			return false;
-		
-		// create the destination file
-		FILE* outfile = fopen(fileName.c_str(), "wb");
-		if (outfile == 0) 
-			return false;
-
-		// create access to source buffer as expected by jpeglib
-		JSAMPROW row_pointer[1];	
-		int row_stride = width*bpp;	
-
-		// create compress structure
-		struct jpeg_compress_struct cinfo;
-		struct jpeg_error_mgr jerr;
-		jpeg_create_compress(&cinfo);
-		cinfo.err = jpeg_std_error(&jerr);
-
-		// set the known parameters and default parameters
-		if (bpp == 3)
-			cinfo.in_color_space = JCS_RGB; 
-		else if (bpp == 1)
-			cinfo.in_color_space = JCS_GRAYSCALE; 
-		cinfo.image_width = width;
-		cinfo.image_height = height;
-		cinfo.input_components = bpp;
-		jpeg_set_defaults(&cinfo);
-	    jpeg_set_quality(&cinfo, quality, true);
-		jpeg_stdio_dest(&cinfo, outfile);
-
-		// decompress the data line by line
-		jpeg_start_compress(&cinfo, true);
-		while (cinfo.next_scanline < cinfo.image_height) 
-		{
-			row_pointer[0] = &buffer[cinfo.next_scanline * row_stride];
-			jpeg_write_scanlines(&cinfo, row_pointer, 1);
-		}
-
-		// release structures
-		jpeg_finish_compress(&cinfo);
-		jpeg_destroy_compress(&cinfo);
-
-		fclose(outfile);
-		return true;
-	}
-
-	bool CompressToBuffer(unsigned char* srcBuffer, int width, int height, int bpp, unsigned char* dstBuffer, int& len, int quality)
-	{
-		if (!srcBuffer || !dstBuffer || len<=0 )
-			return false;
-
-		JSAMPROW row_pointer[1];	
-		int row_stride = width*bpp;	
-
-		struct jpeg_error_mgr jerr;
-		struct jpeg_compress_struct cinfo;
-		jpeg_create_compress(&cinfo);
-		cinfo.err = jpeg_std_error(&jerr);
-		if (bpp == 3)
-			cinfo.in_color_space = JCS_RGB; 
-		else if (bpp == 1)
-			cinfo.in_color_space = JCS_GRAYSCALE; 
-		cinfo.image_width = width;
-		cinfo.image_height = height;
-		cinfo.input_components = bpp;
-		jpeg_set_defaults(&cinfo);
-	    jpeg_set_quality(&cinfo, quality, true);
-
-		jpeg_mem_dest(&cinfo,reinterpret_cast<void**>(&dstBuffer),reinterpret_cast<unsigned int*>(&len));
-		jpeg_start_compress(&cinfo,true);
-		while (cinfo.next_scanline < cinfo.image_height) 
-		{
-			row_pointer[0] = &srcBuffer[cinfo.next_scanline * row_stride];
-			jpeg_write_scanlines(&cinfo, row_pointer, 1);
-		}
-		jpeg_finish_compress(&cinfo);
-		jpeg_destroy_compress(&cinfo);
-		return true;
-	}
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include <stdio.h>
+
+extern "C" { 
+#include "jmemdstsrc.h"
+} 
+
+#include <string>
+using std::string;
+
+namespace Jpeg
+{
+	bool  ReadFileParams(const string& fileName, int& width, int& height, int& nChannels)
+	{
+		if (fileName.empty())
+			return false;
+
+		FILE* infile;
+		if ((infile = fopen(fileName.c_str(), "rb")) == 0) 
+			return false;
+			
+		struct jpeg_decompress_struct cinfo;
+		struct jpeg_error_mgr jerr;
+		cinfo.err = jpeg_std_error(&jerr);
+		jpeg_create_decompress(&cinfo);
+
+		jpeg_stdio_src(&cinfo, infile);
+		jpeg_read_header(&cinfo, true);
+		jpeg_calc_output_dimensions(&cinfo);
+		
+		width = cinfo.image_width;
+		height = cinfo.image_height;
+		nChannels = cinfo.num_components;
+		jpeg_destroy_decompress(&cinfo);
+		fclose(infile);
+		return true;
+	}
+
+	bool DecompressFile(const string& fileName, unsigned char* dstBuffer, int& width, int& height, int& nChannels)
+	{
+		if (!dstBuffer || fileName.empty())
+			return false;
+
+		FILE* infile;
+		if ((infile = fopen(fileName.c_str(), "rb")) == 0) 
+			return false;
+		
+		struct jpeg_error_mgr jerr;
+		struct jpeg_decompress_struct cinfo;
+		cinfo.err = jpeg_std_error(&jerr);
+		jpeg_create_decompress(&cinfo);
+		jpeg_stdio_src(&cinfo, infile);
+		jpeg_read_header(&cinfo, true);
+		jpeg_start_decompress(&cinfo);
+
+		width = cinfo.output_width; 
+		height = cinfo.output_height;
+		nChannels = cinfo.num_components;	
+
+		unsigned char* rowptr[1];
+		while (cinfo.output_scanline < cinfo.output_height)
+		{
+			rowptr[0] = &dstBuffer[cinfo.output_scanline*cinfo.output_width*cinfo.num_components];
+			jpeg_read_scanlines(&cinfo, rowptr, 1);
+		}
+		jpeg_finish_decompress(&cinfo);
+		jpeg_destroy_decompress(&cinfo);
+		fclose(infile);
+		return true;
+	}	
+
+	bool DecompressBuffer(unsigned char* srcBuffer, int size, unsigned char* dstBuffer, int& width, int& height, int& bpp)
+	{
+		if (!dstBuffer)
+			return false;
+
+		struct jpeg_error_mgr jerr;
+		struct jpeg_decompress_struct cinfo;
+
+		cinfo.err = jpeg_std_error(&jerr);
+		jpeg_create_decompress(&cinfo);
+
+		j_mem_src (&cinfo, srcBuffer, size);
+
+		jpeg_read_header(&cinfo,true);
+		jpeg_start_decompress(&cinfo);
+		
+		width = cinfo.output_width;
+		height = cinfo.output_height;
+		bpp = cinfo.num_components;
+		unsigned char* rowptr[1];
+		while (cinfo.output_scanline < cinfo.output_height)
+		{
+			rowptr[0] = &dstBuffer[cinfo.output_scanline*cinfo.output_width*cinfo.num_components];
+			if (rowptr[0] == 0)
+			{
+				jpeg_finish_decompress(&cinfo);
+				jpeg_destroy_decompress(&cinfo);
+				return false;
+			}
+			if (jpeg_read_scanlines(&cinfo, rowptr, 1) != 1)
+			{
+				jpeg_finish_decompress(&cinfo);
+				jpeg_destroy_decompress(&cinfo);
+				return false;
+			}
+		}
+		jpeg_finish_decompress(&cinfo);
+		jpeg_destroy_decompress(&cinfo);
+		return true;
+	}
+
+	bool CompressToFile(unsigned char* buffer, int width, int height, int bpp, const string& fileName, int quality=75)
+	{
+		// check if input parameters are valid
+		if (fileName.empty() || !buffer || (bpp != 1 && bpp != 3) )
+			return false;
+		
+		// create the destination file
+		FILE* outfile = fopen(fileName.c_str(), "wb");
+		if (outfile == 0) 
+			return false;
+
+		// create access to source buffer as expected by jpeglib
+		JSAMPROW row_pointer[1];	
+		int row_stride = width*bpp;	
+
+		// create compress structure
+		struct jpeg_compress_struct cinfo;
+		struct jpeg_error_mgr jerr;
+		jpeg_create_compress(&cinfo);
+		cinfo.err = jpeg_std_error(&jerr);
+
+		// set the known parameters and default parameters
+		if (bpp == 3)
+			cinfo.in_color_space = JCS_RGB; 
+		else if (bpp == 1)
+			cinfo.in_color_space = JCS_GRAYSCALE; 
+		cinfo.image_width = width;
+		cinfo.image_height = height;
+		cinfo.input_components = bpp;
+		jpeg_set_defaults(&cinfo);
+	    jpeg_set_quality(&cinfo, quality, true);
+		jpeg_stdio_dest(&cinfo, outfile);
+
+		// decompress the data line by line
+		jpeg_start_compress(&cinfo, true);
+		while (cinfo.next_scanline < cinfo.image_height) 
+		{
+			row_pointer[0] = &buffer[cinfo.next_scanline * row_stride];
+			jpeg_write_scanlines(&cinfo, row_pointer, 1);
+		}
+
+		// release structures
+		jpeg_finish_compress(&cinfo);
+		jpeg_destroy_compress(&cinfo);
+
+		fclose(outfile);
+		return true;
+	}
+
+	bool CompressToBuffer(unsigned char* srcBuffer, int width, int height, int bpp, unsigned char* dstBuffer, int& len, int quality)
+	{
+		if (!srcBuffer || !dstBuffer || len<=0 )
+			return false;
+
+		JSAMPROW row_pointer[1];	
+		int row_stride = width*bpp;	
+
+		struct jpeg_error_mgr jerr;
+		struct jpeg_compress_struct cinfo;
+		jpeg_create_compress(&cinfo);
+		cinfo.err = jpeg_std_error(&jerr);
+		if (bpp == 3)
+			cinfo.in_color_space = JCS_RGB; 
+		else if (bpp == 1)
+			cinfo.in_color_space = JCS_GRAYSCALE; 
+		cinfo.image_width = width;
+		cinfo.image_height = height;
+		cinfo.input_components = bpp;
+		jpeg_set_defaults(&cinfo);
+	    jpeg_set_quality(&cinfo, quality, true);
+
+		j_mem_dest(&cinfo,reinterpret_cast<void**>(&dstBuffer),reinterpret_cast<unsigned int*>(&len));
+		jpeg_start_compress(&cinfo,true);
+		while (cinfo.next_scanline < cinfo.image_height) 
+		{
+			row_pointer[0] = &srcBuffer[cinfo.next_scanline * row_stride];
+			jpeg_write_scanlines(&cinfo, row_pointer, 1);
+		}
+		jpeg_finish_compress(&cinfo);
+		jpeg_destroy_compress(&cinfo);
+		return true;
+	}
+}
diff --git a/src/terralib/drivers/libjpeg/TeLibJpegWrapper.h b/src/terralib/drivers/libjpeg/TeLibJpegWrapper.h
old mode 100755
new mode 100644
index 238046f..c58bc46
--- a/src/terralib/drivers/libjpeg/TeLibJpegWrapper.h
+++ b/src/terralib/drivers/libjpeg/TeLibJpegWrapper.h
@@ -1,97 +1,97 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeLibJpegWrapper.h
-    This file is a wrapper around libjpeg provinding higher level C++ calls to
-	some functionalities.
-*/
-#ifndef  __TERRALIB_DRIVER_LIBJPEG_WRAPPER_H
-#define  __TERRALIB_DRIVER_LIBJPEG_WRAPPER_H
-
-#include <TeDefines.h>
-#include <string>
-/** 
- at brief A wrapper around the libjpeg provinding higher level C++ functions
-*/
-namespace Jpeg
-{
-	/** Reads the main informations about a JPEG image file 
-	  \param fileName	name of the file 
-      \param width		return the number of columns of the data
-      \param height		return the number of lines of the data
-	  \param nChannels	return the number of bands, or channels, of the data
-	  \return true or false whether the raster was imported successfully
-	*/
-	TL_DLL bool ReadFileParams(const std::string& fileName, int& width, int& height, int& nChannels);
-
-// --------------  Handles the compression and uncompression to/from files.
-
-	/** Reads and decompresses a JPEG image file to a buffer in memory 
-	  \param fileName	name of the file 
-	  \param dstBuffer	pointer to a buffer to return the decompressed data. The function 
-						assumes that it was allocated with enough space to hold the decompressed data
-      \param width		returns the number of columns of the data
-      \param height		returns the number of lines of the data
-	  \param nChannels	returns the number of bands, or channels, of the data
-	  \return true or false whether the decompressing was successfull or not
-	*/
-	TL_DLL bool DecompressFile(const std::string& fileName, unsigned char* dstBuffer, int& width, int& height, int& nChannels);
-
-	/** Compresses an image buffer to a JPEG image file 
-      \param buffer		address of the buffer that contains the image in memory
-	  \param width		width of image in pixels
-      \param height		height of image in pixels
-	  \param bpp		number of bytes per pixel (1 or 3)
-	  \param fileName	name of the compressed file 
-	  \param quality	image quality as a percentage value
-	  \return true or false whether the compressing was successfull or not
-	*/
-	TL_DLL bool CompressToFile(unsigned char* buffer, int width, int height, int bpp, const std::string& fileName, int quality=75);
-
-	/** Decompresses a JPEG image buffer to a buffer in memory 
-	  \param srcBuffer	memory address containing jpeg compressed data 
-	  \param size		size in bytes of the jpeg compressed data
-	  \param dstBuffer	pointer to a buffer to return the decompressed data. The function 
-						assumes that it was allocated with enough space to hold the decompressed data
-      \param width		return the number of columns of the data
-      \param height		return the number of lines of the data
-	  \param bpp		return the number of bytes per pixel
-	  \return true or false whether the decompressing was successfull or not
-	*/
-	TL_DLL bool DecompressBuffer(unsigned char* srcBuffer, int size, unsigned char* dstBuffer, int& width, int& height, int& bpp); 
-
-	/** Compresses an image buffer to a JPEG image in memory 
-      \param srcBuffer	address of the image in memory
-	  \param width		width of image in pixels
-      \param height		height of image in pixels
-	  \param bpp		number of bytes per pixel (1 or 3)
-	  \param dstBuffer	pointer to a buffer to buffer to return the compressed data. The function assumes that it was allocated 
-						with enough space to hold the compressed data
-	  \param len		returns the size of the compressed data. Initially this parameter should contain 
-						the size of the pre-allocated buffer
-	  \param quality	image quality as a percentage
-	  \return true or false whether the compressing was successfull or not
-	*/
-	TL_DLL bool CompressToBuffer(unsigned char* srcBuffer, int width, int height, int bpp, unsigned char* dstBuffer, int& len, int quality=75); 
-}
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeLibJpegWrapper.h
+    This file is a wrapper around libjpeg provinding higher level C++ calls to
+	some functionalities.
+*/
+#ifndef  __TERRALIB_DRIVER_LIBJPEG_WRAPPER_H
+#define  __TERRALIB_DRIVER_LIBJPEG_WRAPPER_H
+
+#include <TeDefines.h>
+#include <string>
+/** 
+ at brief A wrapper around the libjpeg provinding higher level C++ functions
+*/
+namespace Jpeg
+{
+	/** Reads the main informations about a JPEG image file 
+	  \param fileName	name of the file 
+      \param width		return the number of columns of the data
+      \param height		return the number of lines of the data
+	  \param nChannels	return the number of bands, or channels, of the data
+	  \return true or false whether the raster was imported successfully
+	*/
+	TL_DLL bool ReadFileParams(const std::string& fileName, int& width, int& height, int& nChannels);
+
+// --------------  Handles the compression and uncompression to/from files.
+
+	/** Reads and decompresses a JPEG image file to a buffer in memory 
+	  \param fileName	name of the file 
+	  \param dstBuffer	pointer to a buffer to return the decompressed data. The function 
+						assumes that it was allocated with enough space to hold the decompressed data
+      \param width		returns the number of columns of the data
+      \param height		returns the number of lines of the data
+	  \param nChannels	returns the number of bands, or channels, of the data
+	  \return true or false whether the decompressing was successfull or not
+	*/
+	TL_DLL bool DecompressFile(const std::string& fileName, unsigned char* dstBuffer, int& width, int& height, int& nChannels);
+
+	/** Compresses an image buffer to a JPEG image file 
+      \param buffer		address of the buffer that contains the image in memory
+	  \param width		width of image in pixels
+      \param height		height of image in pixels
+	  \param bpp		number of bytes per pixel (1 or 3)
+	  \param fileName	name of the compressed file 
+	  \param quality	image quality as a percentage value
+	  \return true or false whether the compressing was successfull or not
+	*/
+	TL_DLL bool CompressToFile(unsigned char* buffer, int width, int height, int bpp, const std::string& fileName, int quality=75);
+
+	/** Decompresses a JPEG image buffer to a buffer in memory 
+	  \param srcBuffer	memory address containing jpeg compressed data 
+	  \param size		size in bytes of the jpeg compressed data
+	  \param dstBuffer	pointer to a buffer to return the decompressed data. The function 
+						assumes that it was allocated with enough space to hold the decompressed data
+      \param width		return the number of columns of the data
+      \param height		return the number of lines of the data
+	  \param bpp		return the number of bytes per pixel
+	  \return true or false whether the decompressing was successfull or not
+	*/
+	TL_DLL bool DecompressBuffer(unsigned char* srcBuffer, int size, unsigned char* dstBuffer, int& width, int& height, int& bpp); 
+
+	/** Compresses an image buffer to a JPEG image in memory 
+      \param srcBuffer	address of the image in memory
+	  \param width		width of image in pixels
+      \param height		height of image in pixels
+	  \param bpp		number of bytes per pixel (1 or 3)
+	  \param dstBuffer	pointer to a buffer to buffer to return the compressed data. The function assumes that it was allocated 
+						with enough space to hold the compressed data
+	  \param len		returns the size of the compressed data. Initially this parameter should contain 
+						the size of the pre-allocated buffer
+	  \param quality	image quality as a percentage
+	  \return true or false whether the compressing was successfull or not
+	*/
+	TL_DLL bool CompressToBuffer(unsigned char* srcBuffer, int width, int height, int bpp, unsigned char* dstBuffer, int& len, int quality=75); 
+}
+#endif
+
diff --git a/src/terralib/drivers/libjpeg/jmemdst.c b/src/terralib/drivers/libjpeg/jmemdst.c
old mode 100755
new mode 100644
index f868219..34b2fb5
--- a/src/terralib/drivers/libjpeg/jmemdst.c
+++ b/src/terralib/drivers/libjpeg/jmemdst.c
@@ -1,157 +1,157 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "jmemdstsrc.h"
-/*
- Initialize destination 
- */
-METHODDEF(void)
-init_destination (j_compress_ptr cinfo)
-{
-	mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest;
-
-	/* have the compresser write the image target memory */
-	dest->pub.next_output_byte = (*(dest->pTargetData));
-	dest->pub.free_in_buffer = dest->initialDataSize;
-}
-
-
-/* 
- * change_target_buffer_size() enlarges pTargetData if needed
- * it is used by empty_output_buffer() and term_destination()
- */
-void change_target_buffer_size(j_compress_ptr cinfo, unsigned int new_size)
-{
-	mem_dest_ptr dest = (mem_dest_ptr)cinfo->dest;
-	JOCTET * new_ptr = NULL;
-	JOCTET * old_ptr = *(dest->pTargetData);
-	if(new_size == dest->initialDataSize)
-      return;
-	if(new_size < dest->initialDataSize && dest->bufferPreallocated && !dest->bufferSizeChanged)
-      return;
-	new_ptr = (JOCTET*)malloc(new_size);
-	if (new_ptr)
-	{
-		dest->initialDataSize = new_size;
-		dest->bufferSizeChanged = 1;
-		memcpy(new_ptr, old_ptr, *(dest->pNumBytes));
-		free(old_ptr);
-		*(dest->pTargetData) = new_ptr;
-   }
-   else if(!dest->bufferPreallocated)
-   {
-		free(old_ptr);
-		dest->initialDataSize = 0;
-		*(dest->pTargetData) = NULL;
-		*(dest->pNumBytes) = 0;
-//      ERROR!
-   }
-}
-
-/*
- * Empty the output buffer --- called whenever buffer fills up.
- */
-METHODDEF(boolean)
-empty_output_buffer (j_compress_ptr cinfo)
-{
-	mem_dest_ptr	dest = (mem_dest_ptr) cinfo->dest;
-	*(dest->pNumBytes) = dest->initialDataSize;
-
-	change_target_buffer_size(cinfo, dest->initialDataSize + OUTPUT_BUF_SIZE);
-
-	dest->pub.next_output_byte = *(dest->pTargetData) + *(dest->pNumBytes);
-	dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
-
-	return TRUE;
-}
-
-/*
- * Terminate destination --- called by jpeg_finish_compress
- */
-METHODDEF(void)
-term_destination (j_compress_ptr cinfo)
-{
-	mem_dest_ptr dest = (mem_dest_ptr)cinfo->dest;
-	if (dest->bufferSizeChanged)
-	{
-		unsigned int datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;
-		*(dest->pNumBytes) += datacount;
-		change_target_buffer_size(cinfo, *(dest->pNumBytes));
-	}
-	else
-	{
-	   *(dest->pNumBytes) = dest->initialDataSize - dest->pub.free_in_buffer;
-	}
-   return;
-}
-
-/*
- * Prepare for output to an allocated buffer.
- * The caller is responsible for free()ing the buffer when they are done.
- */
-
-GLOBAL(void)
-jpeg_mem_dest(j_compress_ptr cinfo, void **pTargetData, unsigned int *pNumBytes)
-{
-	mem_dest_ptr dest;	if(cinfo->dest == NULL)
-	{
-		cinfo->dest = (struct jpeg_destination_mgr *)
-        (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
-        sizeof(mem_destination_mgr));
-	}
-
-	dest = (mem_dest_ptr) cinfo->dest;
-	dest->pub.init_destination = init_destination;
-	dest->pub.empty_output_buffer = empty_output_buffer;
-	dest->pub.term_destination = term_destination;
-   /* if the number of bytes > 0 and the data pointer is not NULL, then we
-      assume that space has been allocated, otherwise, we allocate here */
-	if (( *pNumBytes > 0 ) && (*pTargetData ))
-	{
-		dest->bufferPreallocated = 1;
-		dest->initialDataSize = *pNumBytes;
-	}
-	else
-	{
-		dest->bufferPreallocated = 0;
-		if(!((*pTargetData) = malloc(OUTPUT_BUF_SIZE * sizeof(JOCTET))))
-		{
-         /* malloc() failed - call jpeg error/exit subsystem */
-		// ERROR( cinfo, JERR_OUT_OF_MEMORY, 0);
-		}
-		else
-		{
-			dest->initialDataSize = OUTPUT_BUF_SIZE;
-		}
-   }
-
-   dest->pNumBytes = pNumBytes;
-   dest->pTargetData = (JOCTET**)pTargetData;
-   dest->bufferSizeChanged = 0;
-   *pNumBytes = 0;
-	return;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "jmemdstsrc.h"
+/*
+ Initialize destination 
+ */
+METHODDEF(void)
+init_destination (j_compress_ptr cinfo)
+{
+	mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest;
+
+	/* have the compresser write the image target memory */
+	dest->pub.next_output_byte = (*(dest->pTargetData));
+	dest->pub.free_in_buffer = dest->initialDataSize;
+}
+
+
+/* 
+ * change_target_buffer_size() enlarges pTargetData if needed
+ * it is used by empty_output_buffer() and term_destination()
+ */
+void change_target_buffer_size(j_compress_ptr cinfo, unsigned int new_size)
+{
+	mem_dest_ptr dest = (mem_dest_ptr)cinfo->dest;
+	JOCTET * new_ptr = NULL;
+	JOCTET * old_ptr = *(dest->pTargetData);
+	if(new_size == dest->initialDataSize)
+      return;
+	if(new_size < dest->initialDataSize && dest->bufferPreallocated && !dest->bufferSizeChanged)
+      return;
+	new_ptr = (JOCTET*)malloc(new_size);
+	if (new_ptr)
+	{
+		dest->initialDataSize = new_size;
+		dest->bufferSizeChanged = 1;
+		memcpy(new_ptr, old_ptr, *(dest->pNumBytes));
+		free(old_ptr);
+		*(dest->pTargetData) = new_ptr;
+   }
+   else if(!dest->bufferPreallocated)
+   {
+		free(old_ptr);
+		dest->initialDataSize = 0;
+		*(dest->pTargetData) = NULL;
+		*(dest->pNumBytes) = 0;
+//      ERROR!
+   }
+}
+
+/*
+ * Empty the output buffer --- called whenever buffer fills up.
+ */
+METHODDEF(boolean)
+empty_output_buffer (j_compress_ptr cinfo)
+{
+	mem_dest_ptr	dest = (mem_dest_ptr) cinfo->dest;
+	*(dest->pNumBytes) = dest->initialDataSize;
+
+	change_target_buffer_size(cinfo, dest->initialDataSize + OUTPUT_BUF_SIZE);
+
+	dest->pub.next_output_byte = *(dest->pTargetData) + *(dest->pNumBytes);
+	dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
+
+	return TRUE;
+}
+
+/*
+ * Terminate destination --- called by jpeg_finish_compress
+ */
+METHODDEF(void)
+term_destination (j_compress_ptr cinfo)
+{
+	mem_dest_ptr dest = (mem_dest_ptr)cinfo->dest;
+	if (dest->bufferSizeChanged)
+	{
+		unsigned int datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;
+		*(dest->pNumBytes) += datacount;
+		change_target_buffer_size(cinfo, *(dest->pNumBytes));
+	}
+	else
+	{
+	   *(dest->pNumBytes) = dest->initialDataSize - dest->pub.free_in_buffer;
+	}
+   return;
+}
+
+/*
+ * Prepare for output to an allocated buffer.
+ * The caller is responsible for free()ing the buffer when they are done.
+ */
+
+GLOBAL(void)
+j_mem_dest(j_compress_ptr cinfo, void **pTargetData, unsigned int *pNumBytes)
+{
+	mem_dest_ptr dest;	if(cinfo->dest == NULL)
+	{
+		cinfo->dest = (struct jpeg_destination_mgr *)
+        (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+        sizeof(mem_destination_mgr));
+	}
+
+	dest = (mem_dest_ptr) cinfo->dest;
+	dest->pub.init_destination = init_destination;
+	dest->pub.empty_output_buffer = empty_output_buffer;
+	dest->pub.term_destination = term_destination;
+   /* if the number of bytes > 0 and the data pointer is not NULL, then we
+      assume that space has been allocated, otherwise, we allocate here */
+	if (( *pNumBytes > 0 ) && (*pTargetData ))
+	{
+		dest->bufferPreallocated = 1;
+		dest->initialDataSize = *pNumBytes;
+	}
+	else
+	{
+		dest->bufferPreallocated = 0;
+		if(!((*pTargetData) = malloc(OUTPUT_BUF_SIZE * sizeof(JOCTET))))
+		{
+         /* malloc() failed - call jpeg error/exit subsystem */
+		// ERROR( cinfo, JERR_OUT_OF_MEMORY, 0);
+		}
+		else
+		{
+			dest->initialDataSize = OUTPUT_BUF_SIZE;
+		}
+   }
+
+   dest->pNumBytes = pNumBytes;
+   dest->pTargetData = (JOCTET**)pTargetData;
+   dest->bufferSizeChanged = 0;
+   *pNumBytes = 0;
+	return;
+}
diff --git a/src/terralib/drivers/libjpeg/jmemdstsrc.h b/src/terralib/drivers/libjpeg/jmemdstsrc.h
old mode 100755
new mode 100644
index f8a3e21..e8bde83
--- a/src/terralib/drivers/libjpeg/jmemdstsrc.h
+++ b/src/terralib/drivers/libjpeg/jmemdstsrc.h
@@ -1,68 +1,68 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file jmemdst.h
-    \brief This file complements the jpeglib source in order to allow the writting of a JPEG data to a buffer in memory
-	\note THIS IS FOR INTERNAL USE. DO NOT USE IT DIRECTLY.
-*/
-#ifndef  __TERRALIB_INTERNAL_DRIVER_JPEGLIB_MEMDST_H
-#define  __TERRALIB_INTERNAL_DRIVER_JPEGLIB_MEMDST_H
-
-#include "jpeglib.h"
- 
-/*! Expanded data destination object for memory buffer output 
-	\note THIS IS FOR INTERNAL USE. DO NOT USE IT DIRECTLY.
-*/
-typedef struct 
-{
-  struct jpeg_destination_mgr pub;	/* public fields */
-  JOCTET **pTargetData;				/* memory buffer for jpeg output */
-  unsigned int *pNumBytes;			/* number of bytes in the buffer */
-  unsigned int initialDataSize;		/* size of the initially allocated buffer*/
-  int bufferPreallocated;			/* boolean indicating whether buffer was previously allocated */
-  int bufferSizeChanged;			/* boolean indicating whether buffer was changed inside the routine*/ 
-} mem_destination_mgr;
-
-typedef mem_destination_mgr * mem_dest_ptr;
-
-/*! try initial buffer size of 1M */
-#define OUTPUT_BUF_SIZE  ((unsigned int)1048576)
-
-//! Function to allows the writting of JPEG data to a memory buffer
-GLOBAL(void)
-jpeg_mem_dest(j_compress_ptr cinfo, void **pTargetData,	unsigned int *pNumBytes);
-
-// Expanded data source object for memory buffer input
-typedef struct
-{
-	struct jpeg_source_mgr pub;   
-	unsigned char* buffer;
-	unsigned int   bufsize;
-} my_source_mgr;
-
-typedef my_source_mgr* my_src_ptr;
-
-//! Function to allows the reading of JPEG data from a memory buffer
-GLOBAL(void)
-jpeg_mem_src (j_decompress_ptr cinfo, unsigned char* buffer, unsigned int bufsize);
-
-#endif   
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file jmemdst.h
+    \brief This file complements the jpeglib source in order to allow the writting of a JPEG data to a buffer in memory
+	\note THIS IS FOR INTERNAL USE. DO NOT USE IT DIRECTLY.
+*/
+#ifndef  __TERRALIB_INTERNAL_DRIVER_JPEGLIB_MEMDST_H
+#define  __TERRALIB_INTERNAL_DRIVER_JPEGLIB_MEMDST_H
+
+#include "jpeglib.h"
+ 
+/*! Expanded data destination object for memory buffer output 
+	\note THIS IS FOR INTERNAL USE. DO NOT USE IT DIRECTLY.
+*/
+typedef struct 
+{
+  struct jpeg_destination_mgr pub;	/* public fields */
+  JOCTET **pTargetData;				/* memory buffer for jpeg output */
+  unsigned int *pNumBytes;			/* number of bytes in the buffer */
+  unsigned int initialDataSize;		/* size of the initially allocated buffer*/
+  int bufferPreallocated;			/* boolean indicating whether buffer was previously allocated */
+  int bufferSizeChanged;			/* boolean indicating whether buffer was changed inside the routine*/ 
+} mem_destination_mgr;
+
+typedef mem_destination_mgr * mem_dest_ptr;
+
+/*! try initial buffer size of 1M */
+#define OUTPUT_BUF_SIZE  ((unsigned int)1048576)
+
+//! Function to allows the writting of JPEG data to a memory buffer
+GLOBAL(void)
+j_mem_dest(j_compress_ptr cinfo, void **pTargetData,	unsigned int *pNumBytes);
+
+// Expanded data source object for memory buffer input
+typedef struct
+{
+	struct jpeg_source_mgr pub;   
+	unsigned char* buffer;
+	unsigned int   bufsize;
+} my_source_mgr;
+
+typedef my_source_mgr* my_src_ptr;
+
+//! Function to allows the reading of JPEG data from a memory buffer
+GLOBAL(void)
+j_mem_src (j_decompress_ptr cinfo, unsigned char* buffer, unsigned int bufsize);
+
+#endif   
diff --git a/src/terralib/drivers/libjpeg/jmemsrc.c b/src/terralib/drivers/libjpeg/jmemsrc.c
old mode 100755
new mode 100644
index 6857e3d..0905ebc
--- a/src/terralib/drivers/libjpeg/jmemsrc.c
+++ b/src/terralib/drivers/libjpeg/jmemsrc.c
@@ -1,94 +1,94 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include "jmemdstsrc.h"
-/*
- Initialize source --- Nothing to do
- */
-METHODDEF(void)
-init_source (j_decompress_ptr cinfo)
-{}
-
-
-/*
- Fill the input buffer --- called whenever buffer is emptied.
- */
-METHODDEF(boolean)
-fill_input_buffer (j_decompress_ptr cinfo)
-{
-	my_src_ptr src = (my_src_ptr) cinfo->src;
-
-	src->pub.next_input_byte = src->buffer;
-	src->pub.bytes_in_buffer = src->bufsize;
-
-	return TRUE;
-}
-
-/*
- Skip data --- used to skip over a potentially large amount of
- uninteresting data.
- */
-METHODDEF(void)
-skip_input_data (j_decompress_ptr cinfo, long num_bytes)
-{
-	my_src_ptr src = (my_src_ptr) cinfo->src;
-
-	/* just move the ptr */
-	src->pub.next_input_byte += num_bytes;
-	src->pub.bytes_in_buffer -= num_bytes;
-}
-
-/*
-  Terminate source --- called by jpeg_finish_decompress
- */
-METHODDEF(void)
-term_source (j_decompress_ptr cinfo)
-{}
-
-/*
- Prepare for input from a memory buffer.
- */
-GLOBAL(void)
-jpeg_mem_src (j_decompress_ptr cinfo, unsigned char* buffer, unsigned int bufsize)
-{
-	my_src_ptr src;
-
-	if (cinfo->src == NULL) {
-		cinfo->src = (struct jpeg_source_mgr *)
-		(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,  sizeof(my_source_mgr));
-  }
-
-	src = (my_src_ptr) cinfo->src;
-	src->pub.init_source = init_source;
-	src->pub.fill_input_buffer = fill_input_buffer;
-	src->pub.skip_input_data = skip_input_data;
-	src->pub.resync_to_restart = jpeg_resync_to_restart; 
-	src->pub.term_source = term_source;
-	src->pub.bytes_in_buffer = 0; 
-	src->pub.next_input_byte = NULL; 
-
-	src->buffer = buffer;
-	src->bufsize = bufsize;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "jmemdstsrc.h"
+/*
+ Initialize source --- Nothing to do
+ */
+METHODDEF(void)
+init_source (j_decompress_ptr cinfo)
+{}
+
+
+/*
+ Fill the input buffer --- called whenever buffer is emptied.
+ */
+METHODDEF(boolean)
+fill_input_buffer (j_decompress_ptr cinfo)
+{
+	my_src_ptr src = (my_src_ptr) cinfo->src;
+
+	src->pub.next_input_byte = src->buffer;
+	src->pub.bytes_in_buffer = src->bufsize;
+
+	return TRUE;
+}
+
+/*
+ Skip data --- used to skip over a potentially large amount of
+ uninteresting data.
+ */
+METHODDEF(void)
+skip_input_data (j_decompress_ptr cinfo, long num_bytes)
+{
+	my_src_ptr src = (my_src_ptr) cinfo->src;
+
+	/* just move the ptr */
+	src->pub.next_input_byte += num_bytes;
+	src->pub.bytes_in_buffer -= num_bytes;
+}
+
+/*
+  Terminate source --- called by jpeg_finish_decompress
+ */
+METHODDEF(void)
+term_source (j_decompress_ptr cinfo)
+{}
+
+/*
+ Prepare for input from a memory buffer.
+ */
+GLOBAL(void)
+j_mem_src (j_decompress_ptr cinfo, unsigned char* buffer, unsigned int bufsize)
+{
+	my_src_ptr src;
+
+	if (cinfo->src == NULL) {
+		cinfo->src = (struct jpeg_source_mgr *)
+		(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,  sizeof(my_source_mgr));
+  }
+
+	src = (my_src_ptr) cinfo->src;
+	src->pub.init_source = init_source;
+	src->pub.fill_input_buffer = fill_input_buffer;
+	src->pub.skip_input_data = skip_input_data;
+	src->pub.resync_to_restart = jpeg_resync_to_restart; 
+	src->pub.term_source = term_source;
+	src->pub.bytes_in_buffer = 0; 
+	src->pub.next_input_byte = NULL; 
+
+	src->buffer = buffer;
+	src->bufsize = bufsize;
+}
+
diff --git a/src/terralib/drivers/qt/TeAddressNotifyFunctorWindow.h b/src/terralib/drivers/qt/TeAddressNotifyFunctorWindow.h
old mode 100755
new mode 100644
index f5018cb..10dcb76
--- a/src/terralib/drivers/qt/TeAddressNotifyFunctorWindow.h
+++ b/src/terralib/drivers/qt/TeAddressNotifyFunctorWindow.h
@@ -1,84 +1,84 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeAddressNotifyFunctorWindow.h
-    \brief This file contains a notification window for address geocodofication.
-*/
-
-/**
-  *@author Gilberto Ribeiro de Queiroz and Ricardo Cartaxo
-  */
-
-#ifndef  __TERRALIB_INTERNAL_ADDRESSNOTIFYFUNCTORWINDOW_H
-#define  __TERRALIB_INTERNAL_ADDRESSNOTIFYFUNCTORWINDOW_H
-
-#include <TeAddressLocator.h>
-#include <addressChoiceWindow.h>
-#include <qcheckbox.h>
-
-//! A notification window for address geocodofication
-class TeAdressNotifyFunctorWindow : public TeAbstractAddressNotifyFunctor
-{
-	protected:
-
-		QDialog* w_;
-		bool selectFirst_;
-		bool selectAllVisible_;
-
-	public:
-
-		TeAdressNotifyFunctorWindow(QDialog* w, const bool& selectAllVisible = true)
-			: w_(w), selectFirst_(false), selectAllVisible_(selectAllVisible)
-		{			
-		}
-
-		virtual ~TeAdressNotifyFunctorWindow()
-		{
-		}
-		
-		int operator()(const TeAddress& searchedAddress, vector<TeAddressDescription>& foundAddresses)
-		{
-			if(selectFirst_)
-				return 0;
-
-			AddressChoiceWindow *addWindow = new AddressChoiceWindow(w_, "addWindow", true);
-		
-			addWindow->listSearchedAddress(searchedAddress);
-
-			addWindow->listFoundedAddressListBox(foundAddresses);
-
-			addWindow->selectAllCheckBoxVisible(selectAllVisible_);
-
-			if(addWindow->exec() != QDialog::Accepted)
-				return -1;
-
-			int ret = addWindow->getChoosedAddress();
-
-			selectFirst_ = addWindow->selectAllCheckBox->isOn();
-
-			delete addWindow;
-
-			return ret;
-		}
-};
-
-#endif	// __TERRALIB_INTERNAL_ADDRESSNOTIFYFUNCTORWINDOW_H
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAddressNotifyFunctorWindow.h
+    \brief This file contains a notification window for address geocodofication.
+*/
+
+/**
+  *@author Gilberto Ribeiro de Queiroz and Ricardo Cartaxo
+  */
+
+#ifndef  __TERRALIB_INTERNAL_ADDRESSNOTIFYFUNCTORWINDOW_H
+#define  __TERRALIB_INTERNAL_ADDRESSNOTIFYFUNCTORWINDOW_H
+
+#include <TeAddressLocator.h>
+#include <addressChoiceWindow.h>
+#include <qcheckbox.h>
+
+//! A notification window for address geocodofication
+class TeAdressNotifyFunctorWindow : public TeAbstractAddressNotifyFunctor
+{
+	protected:
+
+		QDialog* w_;
+		bool selectFirst_;
+		bool selectAllVisible_;
+
+	public:
+
+		TeAdressNotifyFunctorWindow(QDialog* w, const bool& selectAllVisible = true)
+			: w_(w), selectFirst_(false), selectAllVisible_(selectAllVisible)
+		{			
+		}
+
+		virtual ~TeAdressNotifyFunctorWindow()
+		{
+		}
+		
+		int operator()(const TeAddress& searchedAddress, vector<TeAddressDescription>& foundAddresses)
+		{
+			if(selectFirst_)
+				return 0;
+
+			AddressChoiceWindow *addWindow = new AddressChoiceWindow(w_, "addWindow", true);
+		
+			addWindow->listSearchedAddress(searchedAddress);
+
+			addWindow->listFoundedAddressListBox(foundAddresses);
+
+			addWindow->selectAllCheckBoxVisible(selectAllVisible_);
+
+			if(addWindow->exec() != QDialog::Accepted)
+				return -1;
+
+			int ret = addWindow->getChoosedAddress();
+
+			selectFirst_ = addWindow->selectAllCheckBox->isOn();
+
+			delete addWindow;
+
+			return ret;
+		}
+};
+
+#endif	// __TERRALIB_INTERNAL_ADDRESSNOTIFYFUNCTORWINDOW_H
diff --git a/src/terralib/drivers/qt/TeDecoderQtImage.cpp b/src/terralib/drivers/qt/TeDecoderQtImage.cpp
old mode 100755
new mode 100644
index cd7253e..6208961
--- a/src/terralib/drivers/qt/TeDecoderQtImage.cpp
+++ b/src/terralib/drivers/qt/TeDecoderQtImage.cpp
@@ -1,125 +1,125 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeDecoderQtImage.h>
-
-TeDecoderQtImage::TeDecoderQtImage ( const TeRasterParams& par )
-{
-	image_ = 0;
-	transp_ = 255;
-	params_ = par;
-}
-
-TeDecoderQtImage::~TeDecoderQtImage ()
-{
-	clear ();
-	transp_ = 255;
-}
-
-void
-TeDecoderQtImage::init()
-{
-	params_.status_= TeRasterParams::TeNotReady;
-	if (params_.mode_ == 'c')	// creating a new file
-	{
-		clear ();
-		image_ = new QImage (params_.ncols_,params_.nlines_,32);
-		params_.status_ = TeRasterParams::TeReadyToWrite;
-	}
-	else if (params_.mode_ == 'w')
-	{
-		if (image_)
-			params_.status_ = TeRasterParams::TeReadyToWrite;
-	}
-	else if (params_.mode_ == 'r')
-	{
-		if (image_)
-			params_.status_ = TeRasterParams::TeReadyToRead;	
-	}
-	image_->fill(0);
-}
-
-bool
-TeDecoderQtImage::clear()
-{
-	if (image_ != 0)
-		delete image_;
-	image_ = 0;
-	return true;
-}
-
-bool 
-TeDecoderQtImage::getElement (int col, int lin, double &val,int band)
-{
-	QRgb cell = image_->pixel(col, lin);
-	if (band == 0)
-	{
-		val = (double) qRed(cell);
-		return true;
-	}
-	if (band == 1)
-	{
-		val = (double) qGreen(cell);
-		return true;
-	}
-	if (band == 2)
-		val = (double) qBlue(cell);
-	return true;
-}
-
-bool 
-TeDecoderQtImage::setElement (int col, int lin, double val,int band )
-{
-	uchar* c = image_->scanLine(lin);
-	int pixel = col << 2;
-	c[pixel+2-band] = (uchar)val;
-	c[pixel+3] = transp_;
-	return true;
-}
-
-bool 
-TeDecoderQtImage::setElementRGB(int col, int lin, double Rval, double Gval, double Bval, unsigned int /*transp*/)
-{
-	unsigned int val = (transp_ << 24) | 
-		               static_cast<int>(Rval) << 16 | 
-					   static_cast<int>(Gval) << 8  |
-					   static_cast<int>(Bval);
-	image_->setPixel(col,lin,val);
-	return true;
-}
-
-bool 
-TeDecoderQtImage::setAlphaBufferToTransparent()
-{
-	int	i, j, p;
-	int width = image_->width();
-	int height = image_->height();
-
-	for(i=0; i<height; ++i)
-	{
-		uchar* c = image_->scanLine(i);
-		for(j=0; j<width; ++j)
-		{
-			p = (j << 2) + 3;
-			c[p] = 0;
-		}
-	}
-	return true;
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeDecoderQtImage.h>
+
+TeDecoderQtImage::TeDecoderQtImage ( const TeRasterParams& par )
+{
+	image_ = 0;
+	transp_ = 255;
+	params_ = par;
+}
+
+TeDecoderQtImage::~TeDecoderQtImage ()
+{
+	clear ();
+	transp_ = 255;
+}
+
+void
+TeDecoderQtImage::init()
+{
+	params_.status_= TeRasterParams::TeNotReady;
+	if (params_.mode_ == 'c')	// creating a new file
+	{
+		clear ();
+		image_ = new QImage (params_.ncols_,params_.nlines_,32);
+		params_.status_ = TeRasterParams::TeReadyToWrite;
+	}
+	else if (params_.mode_ == 'w')
+	{
+		if (image_)
+			params_.status_ = TeRasterParams::TeReadyToWrite;
+	}
+	else if (params_.mode_ == 'r')
+	{
+		if (image_)
+			params_.status_ = TeRasterParams::TeReadyToRead;	
+	}
+	image_->fill(0);
+}
+
+bool
+TeDecoderQtImage::clear()
+{
+	if (image_ != 0)
+		delete image_;
+	image_ = 0;
+	return true;
+}
+
+bool 
+TeDecoderQtImage::getElement (int col, int lin, double &val,int band)
+{
+	QRgb cell = image_->pixel(col, lin);
+	if (band == 0)
+	{
+		val = (double) qRed(cell);
+		return true;
+	}
+	if (band == 1)
+	{
+		val = (double) qGreen(cell);
+		return true;
+	}
+	if (band == 2)
+		val = (double) qBlue(cell);
+	return true;
+}
+
+bool 
+TeDecoderQtImage::setElement (int col, int lin, double val,int band )
+{
+	uchar* c = image_->scanLine(lin);
+	int pixel = col << 2;
+	c[pixel+2-band] = (uchar)val;
+	c[pixel+3] = transp_;
+	return true;
+}
+
+bool 
+TeDecoderQtImage::setElementRGB(int col, int lin, double Rval, double Gval, double Bval, unsigned int /*transp*/)
+{
+	unsigned int val = (transp_ << 24) | 
+		               static_cast<int>(Rval) << 16 | 
+					   static_cast<int>(Gval) << 8  |
+					   static_cast<int>(Bval);
+	image_->setPixel(col,lin,val);
+	return true;
+}
+
+bool 
+TeDecoderQtImage::setAlphaBufferToTransparent()
+{
+	int	i, j, p;
+	int width = image_->width();
+	int height = image_->height();
+
+	for(i=0; i<height; ++i)
+	{
+		uchar* c = image_->scanLine(i);
+		for(j=0; j<width; ++j)
+		{
+			p = (j << 2) + 3;
+			c[p] = 0;
+		}
+	}
+	return true;
+}
diff --git a/src/terralib/drivers/qt/TeDecoderQtImage.h b/src/terralib/drivers/qt/TeDecoderQtImage.h
old mode 100755
new mode 100644
index c21cb71..e369d9d
--- a/src/terralib/drivers/qt/TeDecoderQtImage.h
+++ b/src/terralib/drivers/qt/TeDecoderQtImage.h
@@ -1,74 +1,76 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderQtImage.h
-    \brief This file contais the definitions of a decoder to a QTImage
-*/
-#ifndef __TERRALIB_INTERNAL_DECODERQTIMAGE_H
-#define __TERRALIB_INTERNAL_DECODERQTIMAGE_H
-
-#include "TeDecoder.h"
-#include <qimage.h>
-
-//! Implements a decoder to access a Qt image as a TeRaster
-class TeDecoderQtImage : public TeDecoder
-{
-public:
-	TeDecoderQtImage ( const TeRasterParams& );
-	~TeDecoderQtImage ();
-
-	bool setElement (int col, int lin, double val, int band = 0);
-	bool getElement (int col, int lin, double &val, int band = 0);
-
-	void init	();
-	bool clear	();
-	QImage*	getImage () { return image_; }
-
-	bool setElementRGB(int col, int lin, double Rval, double Gval, double Bval, unsigned int /*transp*/ = 255);
-
-	bool setAlphaBufferToTransparent();
-
-	void setTransparency(int t)
-	{ transp_ = t; }
-
-	unsigned int getTransparency()
-	{	return transp_; }
-
-private:
-
-	QImage*	image_;
-	unsigned int transp_;
-};
-
-//! Implements a factory to build TeQtDecoders
-class TeDecoderQtImageFactory : public TeDecoderFactory
-{
-public:
-
-	TeDecoderQtImageFactory(const string& name) : TeDecoderFactory(name) {}
-
-	virtual TeDecoder* build (const TeRasterParams& arg)
-	{  return new TeDecoderQtImage(arg); }
-};
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderQtImage.h
+    \brief This file contais the definitions of a decoder to a QTImage
+*/
+#ifndef __TERRALIB_INTERNAL_DECODERQTIMAGE_H
+#define __TERRALIB_INTERNAL_DECODERQTIMAGE_H
+
+#include "TeDecoder.h"
+#include <qimage.h>
+
+#include <TeAppUtilsDefines.h>
+
+//! Implements a decoder to access a Qt image as a TeRaster
+class TLAPPUTILS_DLL TeDecoderQtImage : public TeDecoder
+{
+public:
+	TeDecoderQtImage ( const TeRasterParams& );
+	~TeDecoderQtImage ();
+
+	bool setElement (int col, int lin, double val, int band = 0);
+	bool getElement (int col, int lin, double &val, int band = 0);
+
+	void init	();
+	bool clear	();
+	QImage*	getImage () { return image_; }
+
+	bool setElementRGB(int col, int lin, double Rval, double Gval, double Bval, unsigned int /*transp*/ = 255);
+
+	bool setAlphaBufferToTransparent();
+
+	void setTransparency(int t)
+	{ transp_ = t; }
+
+	unsigned int getTransparency()
+	{	return transp_; }
+
+private:
+
+	QImage*	image_;
+	unsigned int transp_;
+};
+
+//! Implements a factory to build TeQtDecoders
+class TLAPPUTILS_DLL TeDecoderQtImageFactory : public TeDecoderFactory
+{
+public:
+
+	TeDecoderQtImageFactory(const string& name) : TeDecoderFactory(name) {}
+
+	virtual TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeDecoderQtImage(arg); }
+};
+
+#endif
+
diff --git a/src/terralib/drivers/qt/TeGUIUtils.cpp b/src/terralib/drivers/qt/TeGUIUtils.cpp
old mode 100755
new mode 100644
index 647352b..fc55f4a
--- a/src/terralib/drivers/qt/TeGUIUtils.cpp
+++ b/src/terralib/drivers/qt/TeGUIUtils.cpp
@@ -1,272 +1,271 @@
-#include "TeGUIUtils.h"
-#include <TeViewNode.h>
-#include <TeAppTheme.h>
-#include <TeView.h>
-#include <TeDatabase.h>
-
-bool fillThemeCombo(TeGeomRep tg, TeView* view, QComboBox* cBox, string selName, bool clear)
-{
-//	bool enableWindow = false;
-	
-	if (clear)
-		cBox->clear();
-	
-	int idx = 0;
-	int count = 0;
-
-	vector<TeViewNode *>& themeVec = view->themes();
-	for(unsigned int i=0; i<themeVec.size(); i++)
-	{
-		TeAbstractTheme* t = (TeAbstractTheme*)themeVec[i];
-		if(t->type() < 2 && t->visibleGeoRep() & tg)
-		{
-			cBox->insertItem(t->name().c_str());
-			if (!t->name().compare(selName)) 
-			{
-				idx = count;
-			}
-			count++;
-		}
-	}
-  
-	if (count > 0) 
-	{
-		cBox->setCurrentItem(idx);
-	}
-	
-	return (count > 0);
-}
-
-bool fillThemeCombo(vector<TeGeomRep>& tg, TeView* view, QComboBox* cBox, string selName, bool clear)
-{
-	if(clear)
-		cBox->clear();
-	
-	vector<TeViewNode *> themeVec = view->themes();
-	if (clear)
-		cBox->clear();
-	
-	int idx = 0;
-	int count = 0;
-	
-	for(unsigned int i=0; i<themeVec.size(); i++)
-	{
-		TeAbstractTheme* t = (TeAbstractTheme*)themeVec[i];
-		if (t->type() >= 2)
-			continue;
-
-		bool hasGeomRep = false;
-		for(unsigned int j=0; j<tg.size(); ++j)
-		{
-			if(t->visibleGeoRep() & tg[j])
-				hasGeomRep = true;
-		}
-		
-		if(hasGeomRep)
-		{
-			cBox->insertItem(t->name().c_str());
-			if (!t->name().compare(selName)) 
-			{
-				idx = count;
-			}
-			count++;
-		}
-	}
-  
-	if (count > 0) 
-	{
-		cBox->setCurrentItem(idx);
-	}
-	
-	return (count > 0);
-}
-
-bool fillThemeCombo( TeView* view, QComboBox* cBox, string selName, bool clear)
-{
-	vector<TeViewNode *> themeVec = view->themes();
-	
-	if (clear)
-		cBox->clear();
-	
-	int idx = 0;
-	int count = 0;
-	
-	for(unsigned int i=0; i<themeVec.size(); i++)
-	{
-		TeAbstractTheme* t = (TeAbstractTheme*)themeVec[i];
-		if (t->type() >= 2)
-			continue;
-		cBox->insertItem(t->name().c_str());
-		if (!t->name().compare(selName)) 
-		{
-			idx = count;
-		}
-		count++;
-	}
-  
-	if (count > 0) 
-	{
-		cBox->setCurrentItem(idx);
-	}
-	
-	return (count > 0);
-}
-
-
-bool fillTableCombo(TeView* view,
-                     QComboBox *cTableCombo, 
-                     QComboBox *cThemeCombo,
-                     string selName, bool clear, TeAttrTableType tableType)
-{
-	TeTable ttable;
-	string tableName;
-	string themeName =  string(cThemeCombo->currentText().ascii());
-	TeTheme* currTheme = view->get(themeName);
-
-	if (currTheme == NULL) 
-		return false;
-
-	TeAttrTableVector atvec;
-	currTheme->getAttTables(atvec, tableType);
-	
-	if (atvec.size() == 0)
-		return false;
-
-	if (clear)
-		cTableCombo->clear();
-	int idx = 0;
-	
-	for(unsigned int i=0; i<atvec.size(); i++)
-	{
-		TeTable ttable = atvec[i];
-		tableName = ttable.name();
-		cTableCombo->insertItem(tableName.c_str());
-		if(selName.compare(tableName)) 
-		{
-			idx = i;
-		}
-	}
-	
-	cTableCombo->setCurrentItem(idx);
-	return true;
-}
-
-
-bool fillColumnCombo(TeAttrDataType aType,
-                      TeTheme* theme,
-                      QComboBox *cColumnCombo, 
-                      QComboBox *cTableCombo,
-                      string selName, bool clear) 
-{
-
-//	bool done = false;
-  
-	TeAttributeList columns;
-	TeAttrTableVector atvec;
-  theme->getAttTables(atvec);
-
-	string tableName = string(cTableCombo->currentText().ascii());
-	unsigned int t;
-
-	for (t = 0; t < atvec.size(); t++) 
-	{
-		if (!tableName.compare(atvec[t].name()))
-			break;
-	}
-	
-	if (t == atvec.size())
-		return false;
-
-	TeTable ttable = atvec[t];
-	columns = ttable.attributeList();
-	
-	if (clear)
-		cColumnCombo->clear();
-	
-	int idx = 0;
-	int count = 0;
-	
-	for(unsigned int i=0; i<columns.size(); i++)
-	{
-		int type = columns[i].rep_.type_;
-		string colName = columns[i].rep_.name_;	
-		if ((aType == TeUNKNOWN) || (type == aType)) 
-		{
-			cColumnCombo->insertItem(colName.c_str());
-			if (!selName.compare(colName)) 
-			{
-				idx = count;
-			}
-			count++;
-		}
-	}
-	
-	if (count > 0) 
-		cColumnCombo->setCurrentItem(idx);
-	
-	return count> 0;
-}
-
-bool fillColumnCombo(vector<TeAttrDataType> &aTypeVec,
-                      TeTheme* theme,
-                      QComboBox *cColumnCombo, 
-                      QComboBox *cTableCombo,
-                      string selName, bool clear)
-{
-	if(clear)
-		cColumnCombo->clear();
-
-	for(unsigned int i = 0; i < aTypeVec.size(); i++)
-		fillColumnCombo(aTypeVec[i], theme, cColumnCombo, cTableCombo, selName, false);
-	
-	return true;
-}
-
-bool fillColumnCombo(vector<TeAttrDataType> &aTypeVec, TeTheme* theme,  QComboBox *cColumnCombo, bool clear)
-{
-	if(clear)
-		cColumnCombo->clear();
-	TeAttrTableVector attrTables = theme->attrTables();
-	for(unsigned int i=0; i<attrTables.size(); ++i)
-	{
-		TeAttributeList attrList = attrTables[i].attributeList();
-		for(unsigned int j=0; j<attrList.size(); ++j)
-		{
-			for(unsigned int type=0; type<aTypeVec.size(); ++type)
-			{
-				if(attrList[j].rep_.type_==aTypeVec[type])
-				{
-					string tableCol = attrTables[i].name()+"."+attrList[j].rep_.name_;
-					cColumnCombo->insertItem(tableCol.c_str());
-				}
-			}
-		}
-	}
-	return true;
-}
-
-bool fillLayerCombo(TeDatabase* db, TeGeomRep rep, QComboBox *lColumnCombo, const string& current, bool clear)
-{
-	int cur=0;
-	if (clear)
-		lColumnCombo->clear();
-	else
-		cur=lColumnCombo->count();
-
-	TeLayerMap& layerMap = db->layerMap();
-	TeLayerMap::iterator itlay = layerMap.begin();
-	int i=0;
-	while ( itlay != layerMap.end() )
-	{
-		if ((*itlay).second->geomRep() & rep)
-		{
-			lColumnCombo->insertItem((*itlay).second->name().c_str());
-			if ((*itlay).second->name() == current)
-				cur += i;
-			++i;
-		}
-		++itlay;
-	}
-	lColumnCombo->setCurrentItem(cur);
-	return i>0;
-}
+#include "TeGUIUtils.h"
+#include <TeViewNode.h>
+#include <TeView.h>
+#include <TeDatabase.h>
+
+bool fillThemeCombo(TeGeomRep tg, TeView* view, QComboBox* cBox, string selName, bool clear)
+{
+//	bool enableWindow = false;
+	
+	if (clear)
+		cBox->clear();
+	
+	int idx = 0;
+	int count = 0;
+
+	vector<TeViewNode *>& themeVec = view->themes();
+	for(unsigned int i=0; i<themeVec.size(); i++)
+	{
+		TeAbstractTheme* t = (TeAbstractTheme*)themeVec[i];
+		if(t->type() < 2 && t->visibleGeoRep() & tg)
+		{
+			cBox->insertItem(t->name().c_str());
+			if (!t->name().compare(selName)) 
+			{
+				idx = count;
+			}
+			count++;
+		}
+	}
+  
+	if (count > 0) 
+	{
+		cBox->setCurrentItem(idx);
+	}
+	
+	return (count > 0);
+}
+
+bool fillThemeCombo(vector<TeGeomRep>& tg, TeView* view, QComboBox* cBox, string selName, bool clear)
+{
+	if(clear)
+		cBox->clear();
+	
+	vector<TeViewNode *> themeVec = view->themes();
+	if (clear)
+		cBox->clear();
+	
+	int idx = 0;
+	int count = 0;
+	
+	for(unsigned int i=0; i<themeVec.size(); i++)
+	{
+		TeAbstractTheme* t = (TeAbstractTheme*)themeVec[i];
+		if (t->type() >= 2)
+			continue;
+
+		bool hasGeomRep = false;
+		for(unsigned int j=0; j<tg.size(); ++j)
+		{
+			if(t->visibleGeoRep() & tg[j])
+				hasGeomRep = true;
+		}
+		
+		if(hasGeomRep)
+		{
+			cBox->insertItem(t->name().c_str());
+			if (!t->name().compare(selName)) 
+			{
+				idx = count;
+			}
+			count++;
+		}
+	}
+  
+	if (count > 0) 
+	{
+		cBox->setCurrentItem(idx);
+	}
+	
+	return (count > 0);
+}
+
+bool fillThemeCombo( TeView* view, QComboBox* cBox, string selName, bool clear)
+{
+	vector<TeViewNode *> themeVec = view->themes();
+	
+	if (clear)
+		cBox->clear();
+	
+	int idx = 0;
+	int count = 0;
+	
+	for(unsigned int i=0; i<themeVec.size(); i++)
+	{
+		TeAbstractTheme* t = (TeAbstractTheme*)themeVec[i];
+		if (t->type() >= 2)
+			continue;
+		cBox->insertItem(t->name().c_str());
+		if (!t->name().compare(selName)) 
+		{
+			idx = count;
+		}
+		count++;
+	}
+  
+	if (count > 0) 
+	{
+		cBox->setCurrentItem(idx);
+	}
+	
+	return (count > 0);
+}
+
+
+bool fillTableCombo(TeView* view,
+                     QComboBox *cTableCombo, 
+                     QComboBox *cThemeCombo,
+                     string selName, bool clear, TeAttrTableType tableType)
+{
+	TeTable ttable;
+	string tableName;
+	string themeName =  string(cThemeCombo->currentText().ascii());
+	TeTheme* currTheme = view->get(themeName);
+
+	if (currTheme == NULL) 
+		return false;
+
+	TeAttrTableVector atvec;
+	currTheme->getAttTables(atvec, tableType);
+	
+	if (atvec.size() == 0)
+		return false;
+
+	if (clear)
+		cTableCombo->clear();
+	int idx = 0;
+	
+	for(unsigned int i=0; i<atvec.size(); i++)
+	{
+		TeTable ttable = atvec[i];
+		tableName = ttable.name();
+		cTableCombo->insertItem(tableName.c_str());
+		if(selName.compare(tableName)) 
+		{
+			idx = i;
+		}
+	}
+	
+	cTableCombo->setCurrentItem(idx);
+	return true;
+}
+
+
+bool fillColumnCombo(TeAttrDataType aType,
+                      TeTheme* theme,
+                      QComboBox *cColumnCombo, 
+                      QComboBox *cTableCombo,
+                      string selName, bool clear) 
+{
+
+//	bool done = false;
+  
+	TeAttributeList columns;
+	TeAttrTableVector atvec;
+  theme->getAttTables(atvec);
+
+	string tableName = string(cTableCombo->currentText().ascii());
+	unsigned int t;
+
+	for (t = 0; t < atvec.size(); t++) 
+	{
+		if (!tableName.compare(atvec[t].name()))
+			break;
+	}
+	
+	if (t == atvec.size())
+		return false;
+
+	TeTable ttable = atvec[t];
+	columns = ttable.attributeList();
+	
+	if (clear)
+		cColumnCombo->clear();
+	
+	int idx = 0;
+	int count = 0;
+	
+	for(unsigned int i=0; i<columns.size(); i++)
+	{
+		int type = columns[i].rep_.type_;
+		string colName = columns[i].rep_.name_;	
+		if ((aType == TeUNKNOWN) || (type == aType)) 
+		{
+			cColumnCombo->insertItem(colName.c_str());
+			if (!selName.compare(colName)) 
+			{
+				idx = count;
+			}
+			count++;
+		}
+	}
+	
+	if (count > 0) 
+		cColumnCombo->setCurrentItem(idx);
+	
+	return count> 0;
+}
+
+bool fillColumnCombo(vector<TeAttrDataType> &aTypeVec,
+                      TeTheme* theme,
+                      QComboBox *cColumnCombo, 
+                      QComboBox *cTableCombo,
+                      string selName, bool clear)
+{
+	if(clear)
+		cColumnCombo->clear();
+
+	for(unsigned int i = 0; i < aTypeVec.size(); i++)
+		fillColumnCombo(aTypeVec[i], theme, cColumnCombo, cTableCombo, selName, false);
+	
+	return true;
+}
+
+bool fillColumnCombo(vector<TeAttrDataType> &aTypeVec, TeTheme* theme,  QComboBox *cColumnCombo, bool clear)
+{
+	if(clear)
+		cColumnCombo->clear();
+	TeAttrTableVector attrTables = theme->attrTables();
+	for(unsigned int i=0; i<attrTables.size(); ++i)
+	{
+		TeAttributeList attrList = attrTables[i].attributeList();
+		for(unsigned int j=0; j<attrList.size(); ++j)
+		{
+			for(unsigned int type=0; type<aTypeVec.size(); ++type)
+			{
+				if(attrList[j].rep_.type_==aTypeVec[type])
+				{
+					string tableCol = attrTables[i].name()+"."+attrList[j].rep_.name_;
+					cColumnCombo->insertItem(tableCol.c_str());
+				}
+			}
+		}
+	}
+	return true;
+}
+
+bool fillLayerCombo(TeDatabase* db, TeGeomRep rep, QComboBox *lColumnCombo, const string& current, bool clear)
+{
+	int cur=0;
+	if (clear)
+		lColumnCombo->clear();
+	else
+		cur=lColumnCombo->count();
+
+	TeLayerMap& layerMap = db->layerMap();
+	TeLayerMap::iterator itlay = layerMap.begin();
+	int i=0;
+	while ( itlay != layerMap.end() )
+	{
+		if ((*itlay).second->geomRep() & rep)
+		{
+			lColumnCombo->insertItem((*itlay).second->name().c_str());
+			if ((*itlay).second->name() == current)
+				cur += i;
+			++i;
+		}
+		++itlay;
+	}
+	lColumnCombo->setCurrentItem(cur);
+	return i>0;
+}
diff --git a/src/terralib/drivers/qt/TeGUIUtils.h b/src/terralib/drivers/qt/TeGUIUtils.h
old mode 100755
new mode 100644
index 002d56c..16a28f8
--- a/src/terralib/drivers/qt/TeGUIUtils.h
+++ b/src/terralib/drivers/qt/TeGUIUtils.h
@@ -1,60 +1,62 @@
-#ifndef __GUIUTILSH
-#define __GUIUTILSH
-
-#include <TeDataTypes.h>
-#include <qcombobox.h>
-
-class TeView;
-class TeTheme;
-class TeDatabase;
-
-
-//! Fills the comboBox (cBox) with the themes that belong to the view and have a specific geometric representation   
-bool fillThemeCombo(TeGeomRep tg, 
-                TeView* view, 
-                QComboBox* cBox, 
-                string selName, bool clear=true);
-
-//! Fills the comboBox (cBox) with the themes that belong to the view and have the geometric representations   
-bool fillThemeCombo(vector<TeGeomRep>& tg, 
-                TeView* view, 
-                QComboBox* cBox, 
-                string selName, bool clear=true);
-
-
-//! Fills the comboBox (cBox) with all the themes that belong to the view    
-bool fillThemeCombo( TeView* view, 
-                QComboBox* cBox, 
-                string selName, bool clear=true);
-
-
-//! Fills the comboBox (cTableCombo) with the tables of the comboBox (cThemeCombo) current theme  
-bool fillTableCombo(TeView* view,
-                     QComboBox *cTableCombo, 
-                     QComboBox *cThemeCombo,
-                     string selName="", bool clear=true, TeAttrTableType tableType=TeAllAttrTypes);
-
-
-//! Fills the comboBox (cColumnCombo) with the specific type columns of the comboBox (cTableCombo) current table  
-bool fillColumnCombo(TeAttrDataType aType,
-                     TeTheme* theme,
-                     QComboBox *cColumnCombo, 
-                     QComboBox *cTableCombo,
-                     string selName, bool clear=true);
-
-//! Fills the comboBox (cColumnCombo) with columns of the comboBox (cTableCombo) current table  
-bool fillColumnCombo(vector<TeAttrDataType> &aTypeVec,
-                      TeTheme* theme,
-                      QComboBox *cColumnCombo, 
-                      QComboBox *cTableCombo,
-                      string selName="", bool clear=true);
-
-//! Fills the comboBox (cColumnCombo) with the all columns of specific types of the current theme  "tableName.columnName"
-bool fillColumnCombo(vector<TeAttrDataType> &aTypeVec,
-                     TeTheme* theme,
-                     QComboBox *cColumnCombo, bool clear=true);
-
-//! Fills the comboBox (lColumnCombo) with the all layers with specific representations
-bool fillLayerCombo(TeDatabase* db, TeGeomRep rep, QComboBox *lColumnCombo, const string& selName="", bool clear=true);
-
-#endif
+#ifndef __GUIUTILSH
+#define __GUIUTILSH
+
+#include <TeDataTypes.h>
+#include <qcombobox.h>
+
+#include <TeAppUtilsDefines.h>
+
+class TeView;
+class TeTheme;
+class TeDatabase;
+
+
+//! Fills the comboBox (cBox) with the themes that belong to the view and have a specific geometric representation   
+TLAPPUTILS_DLL bool fillThemeCombo(TeGeomRep tg,
+                TeView* view, 
+                QComboBox* cBox, 
+                string selName, bool clear=true);
+
+//! Fills the comboBox (cBox) with the themes that belong to the view and have the geometric representations   
+TLAPPUTILS_DLL bool fillThemeCombo(vector<TeGeomRep>& tg,
+                TeView* view, 
+                QComboBox* cBox, 
+                string selName, bool clear=true);
+
+
+//! Fills the comboBox (cBox) with all the themes that belong to the view    
+TLAPPUTILS_DLL bool fillThemeCombo( TeView* view,
+                QComboBox* cBox, 
+                string selName, bool clear=true);
+
+
+//! Fills the comboBox (cTableCombo) with the tables of the comboBox (cThemeCombo) current theme  
+TLAPPUTILS_DLL bool fillTableCombo(TeView* view,
+                     QComboBox *cTableCombo, 
+                     QComboBox *cThemeCombo,
+                     string selName="", bool clear=true, TeAttrTableType tableType=TeAllAttrTypes);
+
+
+//! Fills the comboBox (cColumnCombo) with the specific type columns of the comboBox (cTableCombo) current table  
+TLAPPUTILS_DLL bool fillColumnCombo(TeAttrDataType aType,
+                     TeTheme* theme,
+                     QComboBox *cColumnCombo, 
+                     QComboBox *cTableCombo,
+                     string selName, bool clear=true);
+
+//! Fills the comboBox (cColumnCombo) with columns of the comboBox (cTableCombo) current table  
+TLAPPUTILS_DLL bool fillColumnCombo(vector<TeAttrDataType> &aTypeVec,
+                      TeTheme* theme,
+                      QComboBox *cColumnCombo, 
+                      QComboBox *cTableCombo,
+                      string selName="", bool clear=true);
+
+//! Fills the comboBox (cColumnCombo) with the all columns of specific types of the current theme  "tableName.columnName"
+TLAPPUTILS_DLL bool fillColumnCombo(vector<TeAttrDataType> &aTypeVec,
+                     TeTheme* theme,
+                     QComboBox *cColumnCombo, bool clear=true);
+
+//! Fills the comboBox (lColumnCombo) with the all layers with specific representations
+TLAPPUTILS_DLL bool fillLayerCombo(TeDatabase* db, TeGeomRep rep, QComboBox *lColumnCombo, const string& selName="", bool clear=true);
+
+#endif
diff --git a/src/terralib/drivers/qt/TeInitRasterQtDecoder.cpp b/src/terralib/drivers/qt/TeInitRasterQtDecoder.cpp
old mode 100755
new mode 100644
index 04a5aa5..48a7f3e
--- a/src/terralib/drivers/qt/TeInitRasterQtDecoder.cpp
+++ b/src/terralib/drivers/qt/TeInitRasterQtDecoder.cpp
@@ -1,11 +1,11 @@
-#include <TeDecoderQtImage.h>
-
-#include <map>
-
-void TeInitRasterQtDecoder();
-
-void 
-TeInitRasterQtDecoder()
-{
-	static TeDecoderQtImageFactory theDecoderQtImageFactory("QT");
+#include <TeDecoderQtImage.h>
+
+#include <map>
+
+void TeInitRasterQtDecoder();
+
+void 
+TeInitRasterQtDecoder()
+{
+	static TeDecoderQtImageFactory theDecoderQtImageFactory("QT");
 }
\ No newline at end of file
diff --git a/src/terralib/drivers/qt/TeQtAnimaThread.cpp b/src/terralib/drivers/qt/TeQtAnimaThread.cpp
old mode 100755
new mode 100644
index ed32875..56bac09
--- a/src/terralib/drivers/qt/TeQtAnimaThread.cpp
+++ b/src/terralib/drivers/qt/TeQtAnimaThread.cpp
@@ -1,117 +1,117 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-#include <TeQtAnimaThread.h>
-#include <TeQtCanvas.h>
-#include <qpainter.h>
-#include <qpaintdevice.h>
-#include <qlineedit.h>
-#include <qcheckbox.h>
-#include <qpushbutton.h>
-#include <qslider.h>
-#include <animation.h>
-#include <qdatetime.h>
-
-void TeQtAnimaThread::run()
-{
-	bool init = false;
-	stop_ = false;
-	frame_ = pauseFrame_;
-	frames_ = fileList_.count();
-	animation_->playingScrollBar->setMinValue(0);
-	animation_->playingScrollBar->setMaxValue(frames_-1);
-	animation_->playingScrollBar->setValue(frame_);
-	while(frame_ < frames_)
-	{
-		showFrame(frame_);
-		if(pause_)
-			frame_ = pauseFrame_;
-		if(pause_ || stop_)
-			break;
-
-		int t = 10000 / animation_->velocitySlider->value() - 10000 / animation_->velocitySlider->maxValue();
-		sleep(t);
-		frame_++;
-		if(frame_ == frames_)
-		{
-			if(animation_->loopCheckBox->isChecked())
-			{
-				sleep(t);
-				sleep(t);
-				frame_ = 0;
-			}
-			else
-				init = true;
-		}
-	}
-	if(init)
-	{
-		animation_->stopButton->setEnabled(false);
-		animation_->pauseButton->setEnabled(false);
-		animation_->playButton->setEnabled(true);
-		animation_->playingScrollBar->setEnabled(false);
-		showFrame(0);
-	}
-}
-
-void TeQtAnimaThread::showFrame(int i)
-{
-	if((unsigned int)i >= fileList_.count())
-		return;
-	pauseFrame_ = i;
-	QString s = *(fileList_.at(i));
-	QString ss = dir_.absPath() + "/" + s;
-	QPixmap pixmap(ss);
-	QRect rect = pixmap.rect();
-	QRect crect = canvas_->viewport()->rect();
-	rect = crect.intersect(rect);
-	QPaintDevice *device = canvas_->viewport();
-	bitBlt(device, 0, 0, &pixmap, 0, 0, rect.width(), rect.height(), Qt::CopyROP);
-	animation_->frameNumberLineEdit->setText(Te2String(pauseFrame_).c_str());
-	animation_->playingScrollBar->setValue(pauseFrame_);
-}
-
-void TeQtAnimaThread::setAnimation(Animation* a, QDir d)
-{
-	animation_ = a;
-	dir_ = d;
-	fileList_ = dir_.entryList(QDir::Files);
-}
-
-void TeQtAnimaThread::stop()
-{
-	if(pause_)
-		pause_=false;
-	stop_ = true; wait();
-}
-
-void TeQtAnimaThread::sleep(int t)
-{
-	QTime time;
-	time.start();
-
-	int vel = animation_->velocitySlider->value();
-	int frame = animation_->playingScrollBar->value();
-	while(time.elapsed() < t)
-	{
-		if(pause_ || stop_ || vel != animation_->velocitySlider->value() || frame != animation_->playingScrollBar->value())
-			break;
-	}
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+#include <TeQtAnimaThread.h>
+#include <TeQtCanvas.h>
+#include <qpainter.h>
+#include <qpaintdevice.h>
+#include <qlineedit.h>
+#include <qcheckbox.h>
+#include <qpushbutton.h>
+#include <qslider.h>
+#include <animation.h>
+#include <qdatetime.h>
+
+void TeQtAnimaThread::run()
+{
+	bool init = false;
+	stop_ = false;
+	frame_ = pauseFrame_;
+	frames_ = fileList_.count();
+	animation_->playingScrollBar->setMinValue(0);
+	animation_->playingScrollBar->setMaxValue(frames_-1);
+	animation_->playingScrollBar->setValue(frame_);
+	while(frame_ < frames_)
+	{
+		showFrame(frame_);
+		if(pause_)
+			frame_ = pauseFrame_;
+		if(pause_ || stop_)
+			break;
+
+		int t = 10000 / animation_->velocitySlider->value() - 10000 / animation_->velocitySlider->maxValue();
+		sleep(t);
+		frame_++;
+		if(frame_ == frames_)
+		{
+			if(animation_->loopCheckBox->isChecked())
+			{
+				sleep(t);
+				sleep(t);
+				frame_ = 0;
+			}
+			else
+				init = true;
+		}
+	}
+	if(init)
+	{
+		animation_->stopButton->setEnabled(false);
+		animation_->pauseButton->setEnabled(false);
+		animation_->playButton->setEnabled(true);
+		animation_->playingScrollBar->setEnabled(false);
+		showFrame(0);
+	}
+}
+
+void TeQtAnimaThread::showFrame(int i)
+{
+	if((unsigned int)i >= fileList_.count())
+		return;
+	pauseFrame_ = i;
+	QString s = *(fileList_.at(i));
+	QString ss = dir_.absPath() + "/" + s;
+	QPixmap pixmap(ss);
+	QRect rect = pixmap.rect();
+	QRect crect = canvas_->viewport()->rect();
+	rect = crect.intersect(rect);
+	QPaintDevice *device = canvas_->viewport();
+	bitBlt(device, 0, 0, &pixmap, 0, 0, rect.width(), rect.height(), Qt::CopyROP);
+	animation_->frameNumberLineEdit->setText(Te2String(pauseFrame_).c_str());
+	animation_->playingScrollBar->setValue(pauseFrame_);
+}
+
+void TeQtAnimaThread::setAnimation(Animation* a, QDir d)
+{
+	animation_ = a;
+	dir_ = d;
+	fileList_ = dir_.entryList(QDir::Files);
+}
+
+void TeQtAnimaThread::stop()
+{
+	if(pause_)
+		pause_=false;
+	stop_ = true; wait();
+}
+
+void TeQtAnimaThread::sleep(int t)
+{
+	QTime time;
+	time.start();
+
+	int vel = animation_->velocitySlider->value();
+	int frame = animation_->playingScrollBar->value();
+	while(time.elapsed() < t)
+	{
+		if(pause_ || stop_ || vel != animation_->velocitySlider->value() || frame != animation_->playingScrollBar->value())
+			break;
+	}
+}
diff --git a/src/terralib/drivers/qt/TeQtAnimaThread.h b/src/terralib/drivers/qt/TeQtAnimaThread.h
old mode 100755
new mode 100644
index a1cb302..15f28f2
--- a/src/terralib/drivers/qt/TeQtAnimaThread.h
+++ b/src/terralib/drivers/qt/TeQtAnimaThread.h
@@ -1,48 +1,51 @@
-#ifndef  __TERRALIB_INTERNAL_QTANIMATHREAD_H
-#define  __TERRALIB_INTERNAL_QTANIMATHREAD_H
-#include <qthread.h>
-#include<qdir.h>
-#include<qstringlist.h>
-class TeQtCanvas;
-class Animation;
-
-class TeQtAnimaThread : public QThread
-{
-public:
-	TeQtAnimaThread(){
-		canvas_ = 0;
-		pause_ = false;
-		stop_ = true;
-		rate_ = 1;
-		frame_ = 0;
-		frames_ = 0;
-		pauseFrame_ = 0;
-	}
-
-	void run();
-	void stop();
-	void pause(bool b) {pause_ = b;}
-	bool pause() {return pause_;}
-	void frame(int n) {frame_ = n;}
-	int frame() {return frame_;}
-	void frames(int n) {frames_ = n;}
-	int frames() {return frames_;}
-	int pauseFrame(int pf) {return pauseFrame_ = pf;}
-	void canvas(TeQtCanvas* c) {canvas_ = c;}
-	void setAnimation(Animation* a, QDir d);
-	void showFrame(int i);
-
-private:
-	bool		pause_;
-	bool		stop_;
-	int			rate_;
-	int			frame_;
-	int			frames_;
-	int			pauseFrame_;
-	TeQtCanvas*	canvas_;
-	Animation*	animation_;
-	QDir		dir_;
-	QStringList	fileList_;
-	void sleep(int t);
-};
-#endif
+#ifndef  __TERRALIB_INTERNAL_QTANIMATHREAD_H
+#define  __TERRALIB_INTERNAL_QTANIMATHREAD_H
+#include <qthread.h>
+#include<qdir.h>
+#include<qstringlist.h>
+
+#include <TeAppUtilsDefines.h>
+
+class TeQtCanvas;
+class Animation;
+
+class TLAPPUTILS_DLL TeQtAnimaThread : public QThread
+{
+public:
+	TeQtAnimaThread(){
+		canvas_ = 0;
+		pause_ = false;
+		stop_ = true;
+		rate_ = 1;
+		frame_ = 0;
+		frames_ = 0;
+		pauseFrame_ = 0;
+	}
+
+	void run();
+	void stop();
+	void pause(bool b) {pause_ = b;}
+	bool pause() {return pause_;}
+	void frame(int n) {frame_ = n;}
+	int frame() {return frame_;}
+	void frames(int n) {frames_ = n;}
+	int frames() {return frames_;}
+	int pauseFrame(int pf) {return pauseFrame_ = pf;}
+	void canvas(TeQtCanvas* c) {canvas_ = c;}
+	void setAnimation(Animation* a, QDir d);
+	void showFrame(int i);
+
+private:
+	bool		pause_;
+	bool		stop_;
+	int			rate_;
+	int			frame_;
+	int			frames_;
+	int			pauseFrame_;
+	TeQtCanvas*	canvas_;
+	Animation*	animation_;
+	QDir		dir_;
+	QStringList	fileList_;
+	void sleep(int t);
+};
+#endif
diff --git a/src/terralib/drivers/qt/TeQtBigTable.cpp b/src/terralib/drivers/qt/TeQtBigTable.cpp
old mode 100755
new mode 100644
index 8afe248..340ff66
--- a/src/terralib/drivers/qt/TeQtBigTable.cpp
+++ b/src/terralib/drivers/qt/TeQtBigTable.cpp
@@ -1,158 +1,158 @@
-#include <TeQtBigTable.h>
-#include <TeQtDataSource.h>
-#include <qpainter.h>
-#include <qapplication.h>
-
-
-
-TeQtBigTable::TeQtBigTable(QWidget *parent, const char *name)
-        : QTable(parent, name)
-{
-}
-
-TeQtBigTable::TeQtBigTable(TeQtDataSource *dSource, QWidget *parent, const char *name)
-        : QTable(dSource->numRows(), dSource->numCols(), parent, name),
-          dataSource_(dSource), editor_(0)
-{
-	connect(dataSource_, SIGNAL(dataChanged()), this, SLOT(updateContents()));
-}
-
-void TeQtBigTable::setDataSource(TeQtDataSource *dSource)
-{
-	dataSource_ = dSource;
-
-	connect(dataSource_, SIGNAL(dataChanged()), this, SLOT(updateContents()));
-}
-
-void TeQtBigTable::updateContents()
-{
-	if (numRows() == 0 || numCols() == 0)
-	{
-		setNumRows(dataSource_->numRows());
-		setNumCols(dataSource_->numCols());
-	}
-	QTable::updateContents();
-}
-
-QString TeQtBigTable::text(int row, int col) const
-{
-	QVariant v(dataSource_->cell(row, col));
-	return v.toString();
-}
-    
-
-void TeQtBigTable::paintCell(QPainter *painter, int row, int col,
-                          const QRect &cr, bool selected, const QColorGroup &cg)
-{
-	QRect rect(0, 0, cr.width(), cr.height());
-	if (selected)
-	{
-		painter->fillRect(rect, cg.highlight());
-		painter->setPen(cg.highlightedText());
-	}
-	else
-	{
-		painter->fillRect(rect, cg.base());
-		painter->setPen(cg.text());
-	}
-
-	QTable::paintCell(painter, row, col, cr, selected, cg);
-
-	QVariant v(dataSource_->cell(row, col));
-	if (v.type() == QVariant::Pixmap)
-	{
-		QPixmap p = v.toPixmap();
-		painter->drawPixmap(0, 0, p);
-	}
-	else if (v.type() == QVariant::String || v.type() == QVariant::CString)
-	{
-		QString qs = v.toString();
-		bool ok;
-		qs.toDouble(&ok);
-		if (ok)
-			painter->drawText(0, 0, cr.width()-10, cr.height(), Qt::AlignRight | Qt::SingleLine, v.toString());
-		else
-			painter->drawText(0, 0, cr.width()-10, cr.height(), Qt::AlignLeft | Qt::SingleLine, v.toString());
-
-	}
-}
-
-QWidget* TeQtBigTable::createEditor(int row, int col, bool initFromCell) const
-{
-	QVariant v(dataSource_->cell(row, col));
-	if (v.type() == QVariant::Pixmap)
-		return 0;
-
-	editor_ = new QLineEdit(viewport());
-	if (initFromCell)
-		editor_->setText(text(row, col));
-	return editor_;
-}
-
-
-QWidget* TeQtBigTable::cellWidget(int row, int col) const
-{
-	if (row < 0 || col < 0)
-		return 0;
-	
-	if (row == currEditRow() && col == currEditCol())
-			return editor_;
-	else
-		return 0;
-}
-
-
-void TeQtBigTable::endEdit(int row, int col, bool /* accept */, bool replace)
-{
-	QTable::endEdit(row, col, false, replace);
-	if (editor_)
-	{
-		// Update the data that was edited in the table in the data source
-		dataSource_->setCell(row, col, editor_->text());
-	}
-	delete editor_;
-	editor_ = 0;
-}
-
-
-void TeQtBigTable::setCellContentFromEditor(int row, int col)
-{
-	if (editor_)
-		dataSource_->setCell(row, col, editor_->text());
-}
-
-void TeQtBigTable::adjustColumn(int col)
-{
-	int i, w, oldw;
-	QString txt;
-	QFontMetrics fm = fontMetrics();
-
-	txt = horizontalHeader()->label(col);
-	oldw = fm.width(txt) + 10;
-	oldw = QMAX(oldw, 30);
-
-	QVariant v(dataSource_->cell(0, col));
-	if (v.type() == QVariant::Pixmap)
-	{
-		QPixmap p = v.toPixmap();
-		w = p.width() + 10;
-		w = QMAX(w, oldw);
-		oldw = w;
-	}
-	else
-	{
-		for (i = 0; i < numRows(); ++i )
-		{
-			QString txt = text(i,col);
-			w = fm.width(txt) + 15;
-			w = QMAX(w, oldw);
-			oldw = w;
-		}
-	}
-	w = QMAX( w, QApplication::globalStrut().width() );
-	setColumnWidth(col, w);
-}
-
-
-
-
+#include <TeQtBigTable.h>
+#include <TeQtDataSource.h>
+#include <qpainter.h>
+#include <qapplication.h>
+
+
+
+TeQtBigTable::TeQtBigTable(QWidget *parent, const char *name)
+        : QTable(parent, name)
+{
+}
+
+TeQtBigTable::TeQtBigTable(TeQtDataSource *dSource, QWidget *parent, const char *name)
+        : QTable(dSource->numRows(), dSource->numCols(), parent, name),
+          dataSource_(dSource), editor_(0)
+{
+	connect(dataSource_, SIGNAL(dataChanged()), this, SLOT(updateContents()));
+}
+
+void TeQtBigTable::setDataSource(TeQtDataSource *dSource)
+{
+	dataSource_ = dSource;
+
+	connect(dataSource_, SIGNAL(dataChanged()), this, SLOT(updateContents()));
+}
+
+void TeQtBigTable::updateContents()
+{
+	if (numRows() == 0 || numCols() == 0)
+	{
+		setNumRows(dataSource_->numRows());
+		setNumCols(dataSource_->numCols());
+	}
+	QTable::updateContents();
+}
+
+QString TeQtBigTable::text(int row, int col) const
+{
+	QVariant v(dataSource_->cell(row, col));
+	return v.toString();
+}
+    
+
+void TeQtBigTable::paintCell(QPainter *painter, int row, int col,
+                          const QRect &cr, bool selected, const QColorGroup &cg)
+{
+	QRect rect(0, 0, cr.width(), cr.height());
+	if (selected)
+	{
+		painter->fillRect(rect, cg.highlight());
+		painter->setPen(cg.highlightedText());
+	}
+	else
+	{
+		painter->fillRect(rect, cg.base());
+		painter->setPen(cg.text());
+	}
+
+	QTable::paintCell(painter, row, col, cr, selected, cg);
+
+	QVariant v(dataSource_->cell(row, col));
+	if (v.type() == QVariant::Pixmap)
+	{
+		QPixmap p = v.toPixmap();
+		painter->drawPixmap(0, 0, p);
+	}
+	else if (v.type() == QVariant::String || v.type() == QVariant::CString)
+	{
+		QString qs = v.toString();
+		bool ok;
+		qs.toDouble(&ok);
+		if (ok)
+			painter->drawText(0, 0, cr.width()-10, cr.height(), Qt::AlignRight | Qt::SingleLine, v.toString());
+		else
+			painter->drawText(0, 0, cr.width()-10, cr.height(), Qt::AlignLeft | Qt::SingleLine, v.toString());
+
+	}
+}
+
+QWidget* TeQtBigTable::createEditor(int row, int col, bool initFromCell) const
+{
+	QVariant v(dataSource_->cell(row, col));
+	if (v.type() == QVariant::Pixmap)
+		return 0;
+
+	editor_ = new QLineEdit(viewport());
+	if (initFromCell)
+		editor_->setText(text(row, col));
+	return editor_;
+}
+
+
+QWidget* TeQtBigTable::cellWidget(int row, int col) const
+{
+	if (row < 0 || col < 0)
+		return 0;
+	
+	if (row == currEditRow() && col == currEditCol())
+			return editor_;
+	else
+		return 0;
+}
+
+
+void TeQtBigTable::endEdit(int row, int col, bool /* accept */, bool replace)
+{
+	QTable::endEdit(row, col, false, replace);
+	if (editor_)
+	{
+		// Update the data that was edited in the table in the data source
+		dataSource_->setCell(row, col, editor_->text());
+	}
+	delete editor_;
+	editor_ = 0;
+}
+
+
+void TeQtBigTable::setCellContentFromEditor(int row, int col)
+{
+	if (editor_)
+		dataSource_->setCell(row, col, editor_->text());
+}
+
+void TeQtBigTable::adjustColumn(int col)
+{
+	int i, w, oldw;
+	QString txt;
+	QFontMetrics fm = fontMetrics();
+
+	txt = horizontalHeader()->label(col);
+	oldw = fm.width(txt) + 10;
+	oldw = QMAX(oldw, 30);
+
+	QVariant v(dataSource_->cell(0, col));
+	if (v.type() == QVariant::Pixmap)
+	{
+		QPixmap p = v.toPixmap();
+		w = p.width() + 10;
+		w = QMAX(w, oldw);
+		oldw = w;
+	}
+	else
+	{
+		for (i = 0; i < numRows(); ++i )
+		{
+			QString txt = text(i,col);
+			w = fm.width(txt) + 15;
+			w = QMAX(w, oldw);
+			oldw = w;
+		}
+	}
+	w = QMAX( w, QApplication::globalStrut().width() );
+	setColumnWidth(col, w);
+}
+
+
+
+
diff --git a/src/terralib/drivers/qt/TeQtBigTable.h b/src/terralib/drivers/qt/TeQtBigTable.h
old mode 100755
new mode 100644
index 265ac31..417e3d8
--- a/src/terralib/drivers/qt/TeQtBigTable.h
+++ b/src/terralib/drivers/qt/TeQtBigTable.h
@@ -1,51 +1,53 @@
-#ifndef TABLE_H
-#define TABLE_H
-
-#include <qtable.h>
-#include <qlineedit.h>
-#include <string>
-
-class TeQtDataSource;
-
-using namespace std;
-
-class TeQtBigTable : public QTable
-{
-	Q_OBJECT
-
-public:
-	TeQtBigTable(QWidget *parent = 0, const char *name = 0);
-	TeQtBigTable(TeQtDataSource *dSource, QWidget *parent = 0, const char *name = 0);
-
-	void setDataSource(TeQtDataSource *dSource);
-	TeQtDataSource* getDataSource() { return dataSource_; }
-
-	QString text(int row, int col) const;
-	QWidget *createEditor(int row, int col, bool initFromCell) const;
-	void setCellContentFromEditor(int row, int col);
-	QWidget *cellWidget(int row, int col) const;
-	void endEdit(int row, int col, bool accept, bool replace);
-
-	void resizeData(int) {}
-	QTableItem *item(int, int) { return 0; }
-	void setItem(int, int, QTableItem *) {}
-	void clearCell(int, int) {}
-	void insertWidget(int, int, QWidget *) {}
-	void clearCellWidget(int, int) {}
-
-	void adjustColumn(int col);
-
-public slots:
-	void updateContents();
-
-protected:
-	TeQtDataSource *dataSource_;
-	mutable QLineEdit *editor_;
-
-	virtual void paintCell(QPainter *painter, int row, int col,
-				   const QRect &cr, bool selected, const QColorGroup &cg);
-
-};
-
-
-#endif
+#ifndef TABLE_H
+#define TABLE_H
+
+#include <qtable.h>
+#include <qlineedit.h>
+#include <string>
+
+#include <TeAppUtilsDefines.h>
+
+class TeQtDataSource;
+
+using namespace std;
+
+class TLAPPUTILS_DLL TeQtBigTable : public QTable
+{
+	Q_OBJECT
+
+public:
+	TeQtBigTable(QWidget *parent = 0, const char *name = 0);
+	TeQtBigTable(TeQtDataSource *dSource, QWidget *parent = 0, const char *name = 0);
+
+	void setDataSource(TeQtDataSource *dSource);
+	TeQtDataSource* getDataSource() { return dataSource_; }
+
+	QString text(int row, int col) const;
+	QWidget *createEditor(int row, int col, bool initFromCell) const;
+	void setCellContentFromEditor(int row, int col);
+	QWidget *cellWidget(int row, int col) const;
+	void endEdit(int row, int col, bool accept, bool replace);
+
+	void resizeData(int) {}
+	QTableItem *item(int, int) { return 0; }
+	void setItem(int, int, QTableItem *) {}
+	void clearCell(int, int) {}
+	void insertWidget(int, int, QWidget *) {}
+	void clearCellWidget(int, int) {}
+
+	void adjustColumn(int col);
+
+public slots:
+	void updateContents();
+
+protected:
+	TeQtDataSource *dataSource_;
+	mutable QLineEdit *editor_;
+
+	virtual void paintCell(QPainter *painter, int row, int col,
+				   const QRect &cr, bool selected, const QColorGroup &cg);
+
+};
+
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtCanvas.cpp b/src/terralib/drivers/qt/TeQtCanvas.cpp
old mode 100755
new mode 100644
index e93fa60..a8e961f
--- a/src/terralib/drivers/qt/TeQtCanvas.cpp
+++ b/src/terralib/drivers/qt/TeQtCanvas.cpp
@@ -1,3411 +1,3498 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtCanvas.h>
-#include <TeDecoderMemory.h>
-#include <TeQtProgress.h>
-#include <TeVectorRemap.h>
-#include <TeGeometryAlgorithms.h>
-#include <TeDefines.h>
-#include <TeRasterRemap.h>
-#include <TeDecoderQtImage.h>
-
-#include <qpaintdevice.h> 
-#include <qpaintdevicemetrics.h> 
-#include <qapplication.h>
-
-#include <string>	
-#include <algorithm>	
-#include <time.h>
-
-
-TeQtCanvas::TeQtCanvas(QWidget *parent, const char *name)
-			: QScrollView(parent,name,WNorthWestGravity)
-{
-	pixmap0_ = 0;
-	pixmap1_ = 0;
-	pixmap2_ = 0;
-	backRaster_ = 0;
-	printerFactor_ = 1.;
-	numberOfPixmaps_ = 3;
-
-	canvasProjection_ = 0;
-	dataProjection_ = 0;
-	pointStyle_ = 0;
-	nodeStyle_ = 0;
-	pointSize_ = 3;
-	nodeSize_ = 4;
-	db_ = 0;
-
-	//Mounting the brushStyleMap
-	brushStyleMap_[TePolyTypeTransparent] = Qt::NoBrush;
-	brushStyleMap_[TePolyTypeFill] = Qt::SolidPattern;
-	brushStyleMap_[TePolyTypeHorizontal] = Qt::HorPattern;
-	brushStyleMap_[TePolyTypeVertical] = Qt::VerPattern;
-	brushStyleMap_[TePolyTypeFDiagonal] = Qt::FDiagPattern;
-	brushStyleMap_[TePolyTypeBDiagonal] = Qt::BDiagPattern;
-	brushStyleMap_[TePolyTypeCross] = Qt::CrossPattern;
-	brushStyleMap_[TePolyTypeDiagonalCross] = Qt::DiagCrossPattern;
-
-	//Mounting the penStyleMap
-	penStyleMap_[TeLnTypeContinuous] = Qt::SolidLine;
-	penStyleMap_[TeLnTypeDashed] = Qt::DashLine;
-	penStyleMap_[TeLnTypeDotted] = Qt::DotLine;
-	penStyleMap_[TeLnTypeDashDot] = Qt::DashDotLine;
-	penStyleMap_[TeLnTypeDashDotDot] = Qt::DashDotDotLine;
-	penStyleMap_[TeLnTypeNone] = Qt::NoPen;
-
-	setVScrollBarMode(QScrollView::Auto);
-	setHScrollBarMode(QScrollView::Auto);
-    viewport()->setMouseTracking(true);
-    viewport()->setFocusPolicy(StrongFocus);
-    viewport()->setBackgroundColor(backgroundColor());
-	setMargin(0);
-
-	width_ = viewport()->width();
-	height_ = viewport()->height();
-	popupCanvas_ = new QPopupMenu(this);
-}
-
-TeQtCanvas::~TeQtCanvas()
-{
-	if (dataProjection_)
-		delete dataProjection_;
-	if (canvasProjection_)
-		delete canvasProjection_;
-
-	if (backRaster_)
-		delete backRaster_;
-	backRaster_ = 0;
-
-	QPaintDevice* dev = painter_.device();
-	if(dev)
-		painter_.end();
-
-	if(pixmap0_)
-		delete pixmap0_;
-	pixmap0_ = 0;
-
-	if(pixmap1_)
-		delete pixmap1_;
-	pixmap1_ = 0;
-
-	if(pixmap2_)
-		delete pixmap2_;
-	pixmap2_ = 0;
-}
-
-void TeQtCanvas::setDataProjection ( TeProjection* proj )
-{	
-	if(dataProjection_)
-		delete dataProjection_;
-
-	if (proj == 0)
-		return;
-	dataProjection_ = TeProjectionFactory::make(proj->params());
-
-	canvasAndDataProjectionEqual_ = true;
-	if (canvasProjection_ && dataProjection_ && !(*canvasProjection_== *dataProjection_))
-	{
-		canvasAndDataProjectionEqual_ = false;
-		dataProjection_->setDestinationProjection(canvasProjection_);
-		canvasProjection_->setDestinationProjection(dataProjection_);
-	}
-}
-
-void TeQtCanvas::setProjection ( TeProjection* proj )
-{	
-	if (canvasProjection_)
-		delete canvasProjection_;
-	canvasProjection_ = TeProjectionFactory::make(proj->params()); 
-	params_.projection(canvasProjection_);
-
-	canvasAndDataProjectionEqual_ = true;
-	if(canvasProjection_ && dataProjection_ && !(*canvasProjection_== *dataProjection_))
-		canvasAndDataProjectionEqual_ = false;
-}
-
-void TeQtCanvas::plotOnWindow ()
-{
-	QPaintDevice* dev = painter_.device();
-	if(dev == viewport())
-		return;
-	if(dev)
-		painter_.end();
-	painter_.begin(viewport());
-}
-
-void TeQtCanvas::plotOnPixmap0 ()
-{
-	QPaintDevice* dev = painter_.device();
-	if(dev == pixmap0_)
-		return;
-	if(dev)
-		painter_.end();
-	painter_.begin(pixmap0_);
-}
-
-void TeQtCanvas::plotOnPixmap1 ()
-{
-	QPaintDevice* dev = painter_.device();
-	if(dev == pixmap1_)
-		return;
-	if(dev)
-		painter_.end();
-	painter_.begin(pixmap1_);
-}
-
-bool TeQtCanvas::setWorld(TeBox b, int w, int h, QPaintDevice *pd)
-{
-	xmin_= b.x1();
-	xmax_= b.x2();
-	ymin_= b.y1();
-	ymax_= b.y2();
-	if(setView(w, h, pd) == false)
-		return false;
-	bool extend = pd ? false : true;
-	setTransformation(xmin_, xmax_, ymin_, ymax_, extend);
-	params_.nBands(3);
-	double resx = pixelSize();
-	double resy = pixelSize();
-	TeBox box(getWorld());
-	params_.lowerLeftResolutionSize(box.x1_+0.5*resx,box.y1_+0.5*resy,resx,resy,width_,height_);
-	params_.projection();
-	params_.mode_ = 'w';
-	params_.decoderIdentifier_ = "";
-	return true;
-}
-
-void TeQtCanvas::setTransformation(double xmin, double xmax, double ymin, double ymax, bool extend)
-{
-	if (painter_.device() == 0)
-		return;
-	
-	xmin_= xmin;
-	xmax_= xmax;
-	ymin_= ymin;
-	ymax_= ymax;
-
-	double	dxw = xmax_ - xmin_;
-	double	dyw = ymax_ - ymin_;
-	double	dxv = width_;
-	double	dyv = height_;
-					
-	double	fx = dxv/dxw;
-	double	fy = dyv/dyw;
-
-	if (fx > fy)
-	{
-		f_ = fy;
-		if (extend)
-		{
-			dxw = width_/f_;
-			xmax_ = xmin_ + dxw;
-		}
-		else
-			width_ = (int)(f_*dxw + .5);
-	}
-	else
-	{
-		f_ = fx;
-		if (extend)
-		{
-			dyw = height_/f_;
-			ymax_ = ymin_ + dyw;
-		}
-		else
-			height_ = (int)(f_*dyw + .5);
-	}
-
-	wc_ = TeBox (xmin_,ymin_,xmax_,ymax_);
-	params_.boundingBoxResolution(xmin_,ymin_,xmax_,ymax_,params_.resx_,params_.resy_);
-
-	QPaintDeviceMetrics devMetric(viewport());
-	double wpixels = devMetric.width();
-	double wMM = devMetric.widthMM();
-	double wT = wMM;
-	if(canvasProjection_)
-	{
-		string unit = TeConvertToUpperCase(canvasProjection_->units());
-		if(unit == "METERS")
-			wT = wMM / 1000.;
-		else if(unit == "KILOMETERS")
-			wT = wMM / 1000000.;
-		else if(unit == "CENTIMETERS")
-			wT = wMM / 100.;
-		else if(unit == "MILLIMETERS")
-			wT = wMM;
-		else if(unit == "FEET")
-			wT = wMM / (12. * 25.4);
-		else if(unit == "INCHES")
-			wT = wMM / 25.4;
-		else if(unit == "DECIMALDEGREES")
-			wT = wMM / 110000000.;
-	}
-	double wp = wT / wpixels;
-	scaleApx_ = (1. / f_) / wp;
-}
-
-void TeQtCanvas::scaleApx(double scale)
-{
-	QPaintDeviceMetrics devMetric(viewport());
-	double wMM = devMetric.widthMM();
-	double wT = wMM;
-	if(canvasProjection_)
-	{
-		string unit = TeConvertToUpperCase(canvasProjection_->units());
-		if(unit == "METERS")
-			wT = wMM / 1000.;
-		else if(unit == "KILOMETERS")
-			wT = wMM / 1000000.;
-		else if(unit == "CENTIMETERS")
-			wT = wMM / 100.;
-		else if(unit == "MILLIMETERS")
-			wT = wMM;
-		else if(unit == "FEET")
-			wT = wMM / (12. * 25.4);
-		else if(unit == "INCHES")
-			wT = wMM / 25.4;
-		else if(unit == "DECIMALDEGREES")
-			wT = wMM / 110000000.;
-	}
-
-	double ff = scale / scaleApx_;
-	double xmin, ymin, xmax, ymax;
-	if(ff < 1)
-	{
-		double dx = (wc_.width() - (wc_.width() * ff)) / 2.;
-		double dy = (wc_.height() - (wc_.height() * ff)) / 2.;
-		xmin = xmin_ + dx;
-		ymin = ymin_ + dy;
-		xmax = xmax_ - dx;
-		ymax = ymax_ - dy;
-	}
-	else
-	{
-		double dx = ((wc_.width() * ff) - wc_.width()) / 2.;
-		double dy = ((wc_.height() * ff) - wc_.height()) / 2.;
-		xmin = xmin_ - dx;
-		ymin = ymin_ - dy;
-		xmax = xmax_ + dx;
-		ymax = ymax_ + dy;
-	}
-
-	TeBox box(xmin, ymin, xmax, ymax);
-	setWorld(box, contentsWidth(), contentsHeight());
-}
-
-double TeQtCanvas::mapVtoCW(int pixels)
-{
-	TeBox wbox = getDataWorld();
-	TeCoord2D wpc(wbox.x1_ + wbox.width()/2., wbox.y1_ + wbox.height()/2.);
-	QPoint pc = mapDWtoV(wpc);
-	QPoint qp(pc.x()+pixels, pc.y());
-	TeCoord2D wp = mapVtoCW(qp);
-	wpc = mapVtoCW(pc);
-	double d = fabs(wp.x() - wpc.x());
-	return d;
-}
-
-double TeQtCanvas::mapVtoDW(int pixels)
-{
-	TeBox wbox = getDataWorld();
-	TeCoord2D	wpc(wbox.x1_ + wbox.width()/2., wbox.y1_ + wbox.height()/2.);
-	QPoint pc = mapDWtoV(wpc);
-	QPoint qp(pc.x()+pixels, pc.y());
-	TeCoord2D	wp = mapVtoDW(qp);
-	wpc = mapVtoDW(pc);
-	double d = fabs(wp.x() - wpc.x());
-	return d;
-}
-
-TeCoord2D TeQtCanvas::mapVtoCW(const QPoint& p)
-{
-	TeCoord2D w((p.x()-x0_)/f_ + xmin_,
-		(height_ - y0_ - p.y())/f_ + ymin_);
-	return w;
-}
-
-TeCoord2D TeQtCanvas::mapVtoDW(const QPoint& v)
-{
-	TeCoord2D w((v.x()-x0_)/f_ + xmin_,
-		(height_ - y0_ - v.y())/f_ + ymin_);
-
-	if(canvasAndDataProjectionEqual_ == false)
-	{
-		canvasProjection_->setDestinationProjection(dataProjection_);
-		dataProjection_->setDestinationProjection(canvasProjection_);
-		w = canvasProjection_->PC2LL (w);
-		w = dataProjection_->LL2PC (w);
-	}
-	return w;
-}
-
-
-TeBox TeQtCanvas::getDataWorld()
-{
-	if(canvasAndDataProjectionEqual_ == false)
-	{
-		TeBox b = TeRemapBox(wc_, canvasProjection_, dataProjection_);
-		return b;
-	}
-	return wc_ ;
-}
-
-QPoint TeQtCanvas::mapDWtoV(const TeCoord2D& dw)
-{
-	TeCoord2D w = dw;
-	if(canvasAndDataProjectionEqual_ == false)
-	{
-		canvasProjection_->setDestinationProjection(dataProjection_);
-		dataProjection_->setDestinationProjection(canvasProjection_);
-		w = dataProjection_->PC2LL (w);
-		w = canvasProjection_->LL2PC (w);
-	}
-
-	QPoint v((int)((w.x() - xmin_)*f_ + 0.5)+x0_,
-		height_ - y0_ - (int)((w.y() - ymin_)*f_ + 0.5));
-	correctScrolling (v);
-	return v;
-}
-
-QPointArray TeQtCanvas::mapDWtoV(const TeLine2D& line)
-{
- 	int i;
-	int np = line.size();
- 	QPointArray parray(np);
-	TeCoord2D p;
-
-	if(canvasAndDataProjectionEqual_ == false)
-	{
-		canvasProjection_->setDestinationProjection(dataProjection_);
-		dataProjection_->setDestinationProjection(canvasProjection_);
- 		for (i = 0 ; i < np; ++i)
- 		{
-			p = line[i];
-			p = dataProjection_->PC2LL(p);
-			p = canvasProjection_->LL2PC(p);
-			QPoint v((int)((p.x() - xmin_)*f_ + 0.5)+x0_,
-				height_ - y0_ - (int)((p.y() - ymin_)*f_ + 0.5));
-			correctScrolling (v);
- 			parray.setPoint(i, v);
- 		}
-	}
-	else
-	{
- 		for (i = 0 ; i < np; i++)
- 		{
-			p = line[i];
-			QPoint v((int)((p.x() - xmin_)*f_ + 0.5)+x0_,
-				height_ - y0_ - (int)((p.y() - ymin_)*f_ + 0.5));
-			correctScrolling (v);
- 			parray.setPoint(i, v);
- 		}
-	}
-	return parray;
-}
-
-void TeQtCanvas::mapDWtoV(TeBox& w)
-{
-	TeCoord2D ll, ur;
-	if(canvasAndDataProjectionEqual_ == false)
-		w = TeRemapBox (w, dataProjection_, canvasProjection_);
-
-	ll = w.lowerLeft();
-	ur = w.upperRight();
-
-	QPoint p1((int)((ll.x() - xmin_)*f_ + 0.5)+x0_,
-		height_ - y0_ - (int)((ll.y() - ymin_)*f_ + 0.5));
-	correctScrolling (p1);
-
-	QPoint p2((int)((ur.x() - xmin_)*f_ + 0.5)+x0_,
-		height_ - y0_ - (int)((ur.y() - ymin_)*f_ + 0.5));
-	correctScrolling (p2);
-
-	w.x1_ = p1.x();
-	w.y1_ = p2.y();
-	w.x2_ = p2.x();
-	w.y2_ = p1.y();
-
-	//TeCoord2D ll, lr, ur, ul;
-	//if(canvasAndDataProjectionEqual_ == false)
-	//	TeBox TeRemapBox ( TeBox& box, TeProjection* projFrom, TeProjection* projTo)
-
-	//{
-	//	canvasProjection_->setDestinationProjection(dataProjection_);
-	//	dataProjection_->setDestinationProjection(canvasProjection_);
-	//	ll = dataProjection_->PC2LL (w.lowerLeft());
-	//	lr.x(w.upperRight().x());
-	//	lr.y(w.lowerLeft().y());
-	//	lr = dataProjection_->PC2LL (lr);
-	//	ur = dataProjection_->PC2LL (w.upperRight());
-	//	ul.x(w.lowerLeft().x());
-	//	ul.y(w.upperRight().y());
-	//	ul = dataProjection_->PC2LL (ul);
-
-	//	ll.x(std::min(ll.x(),ul.x()));
-	//	ll.y(std::min(ll.y(),lr.y()));
-	//	lr.x(std::max(lr.x(),ur.x()));
-	//	lr.y(std::min(ll.y(),lr.y()));
-	//	ur.x(std::max(ur.x(),lr.x()));
-	//	ur.y(std::max(ul.y(),ur.y()));
-	//	ul.x(std::min(ll.x(),ul.x()));
-	//	ul.y(std::max(ul.y(),ur.y()));
-
-	//	ll = canvasProjection_->LL2PC (ll);
-	//	lr = canvasProjection_->LL2PC (lr);
-	//	ur = canvasProjection_->LL2PC (ur);
-	//	ul = canvasProjection_->LL2PC (ul);
-	//	ll.x(std::min(ll.x(),ul.x()));
-	//	ll.y(std::min(ll.y(),lr.y()));
-	//	ur.x(std::max(ur.x(),lr.x()));
-	//	ur.y(std::max(ul.y(),ur.y()));
-	//}
-
-	//QPoint p1((int)((ll.x() - xmin_)*f_ + 0.5)+x0_,
-	//	height_ - y0_ - (int)((ll.y() - ymin_)*f_ + 0.5));
-	//correctScrolling (p1);
-
-	//QPoint p2((int)((ur.x() - xmin_)*f_ + 0.5)+x0_,
-	//	height_ - y0_ - (int)((ur.y() - ymin_)*f_ + 0.5));
-	//correctScrolling (p2);
-
-	//w.x1_ = p1.x();
-	//w.y1_ = p2.y();
-	//w.x2_ = p2.x();
-	//w.y2_ = p1.y();
-}
-
-void TeQtCanvas::mapCWtoDW(TeBox& box)
-{
-	TeCoord2D ll, ur;
-	if(canvasAndDataProjectionEqual_ == false)
-		box = TeRemapBox (box, canvasProjection_, dataProjection_);
-
-	//TeCoord2D boxll = box.lowerLeft();
-	//TeCoord2D boxur = box.upperRight();
-
-	//if(canvasAndDataProjectionEqual_ == false)
-	//{
-	//	canvasProjection_->setDestinationProjection(dataProjection_);
-	//	boxll = canvasProjection_->PC2LL(boxll);
-	//	boxll = dataProjection_->LL2PC(boxll);
-	//	boxur = canvasProjection_->PC2LL(boxur);
-	//	boxur = dataProjection_->LL2PC(boxur);
-	//}
-
-	//box = TeBox(boxll, boxur);
-}
-
-void TeQtCanvas::mapDWtoCW(TeBox& box)
-{
-	TeCoord2D ll, ur;
-	if(canvasAndDataProjectionEqual_ == false)
-		box = TeRemapBox (box, dataProjection_, canvasProjection_);
-
-	//TeCoord2D boxll = box.lowerLeft();
-	//TeCoord2D boxur = box.upperRight();
-
-	//if(canvasAndDataProjectionEqual_ == false)
-	//{
-	//	dataProjection_->setDestinationProjection(canvasProjection_);
-	//	boxll = dataProjection_->PC2LL(boxll);
-	//	boxll = canvasProjection_->LL2PC(boxll);
-	//	boxur = dataProjection_->PC2LL(boxur);
-	//	boxur = canvasProjection_->LL2PC(boxur);
-	//}
-
-	//box = TeBox(boxll, boxur);
-}
-
-void TeQtCanvas::mapCWtoV(TeBox& box)
-{
-	QPoint p1((int)((box.x1() - xmin_)*f_ + 0.5)+x0_,
-		height_ - y0_ - (int)((box.y1() - ymin_)*f_ + 0.5));
-	correctScrolling (p1);
-
-	QPoint p2((int)((box.x2() - xmin_)*f_ + 0.5)+x0_,
-		height_ - y0_ - (int)((box.y2() - ymin_)*f_ + 0.5));
-	correctScrolling (p2);
-
-// swap y value
-	box.x1_ = p1.x();
-	box.y1_ = p2.y();
-	box.x2_ = p2.x();
-	box.y2_ = p1.y();
-}
-
-void TeQtCanvas::mapVtoCW(TeBox& box)
-{
-	// swap y value
-	TeCoord2D w1((box.x1()-x0_)/f_ + xmin_,
-		(height_ - y0_ - box.y2())/f_ + ymin_);
-
-	TeCoord2D w2((box.x2()-x0_)/f_ + xmin_,
-		(height_ - y0_ - box.y1())/f_ + ymin_);
-
-	box = TeBox(w1, w2);
-}
-
-QPoint TeQtCanvas::mapCWtoV(const TeCoord2D& c)
-{
-	QPoint p((int)((c.x() - xmin_)*f_ + 0.5)+x0_,
-		height_ - y0_ - (int)((c.y() - ymin_)*f_ + 0.5));
-	correctScrolling (p);
-
-	return p;
-}
-
-void TeQtCanvas::setPolygonColor (int r, int g, int b)
-{
-	QRgb cor = qRgba(r, g, b, 50);
-	polygonColor_.setRgb(cor);
-	polygonBrush_.setColor (polygonColor_);
-}
-
-void TeQtCanvas::setPolygonStyle (int s, int t)
-{
-	polygonBrush_.setStyle(brushStyleMap_[(TePolyBasicType)s]);
-	polygonTransparency_ = t;
-}
-
-void TeQtCanvas::setPolygonLineColor (int r, int g, int b)
-{
-	QColor cor(r, g, b);
-	polygonPen_.setColor (cor);
-}
-
-void TeQtCanvas::setPolygonLineStyle (int s, int w)
-{
-	polygonPen_.setStyle(penStyleMap_[(TeLnBasicType)s]);
-	polygonPen_.setWidth(w);
-}
-
-void TeQtCanvas::setLineColor (int r, int g, int b)
-{
-	lineColor_.setRgb(r,g,b);
-	linePen_.setColor (lineColor_);
-}
-
-void TeQtCanvas::setLineStyle (int s, int w)
-{
-	linePen_.setStyle(penStyleMap_[(TeLnBasicType)s]);
-	linePen_.setWidth(w);
-}
-
-void TeQtCanvas::setTextColor (int r, int g, int b)
-{
-	textColor_.setRgb(r,g,b);
-	textPen_.setColor (textColor_);
-}
-
-void TeQtCanvas::setTextStyle (string& family, int size, bool bold, bool italic )
-{
-	textFont_.setFamily (family.c_str());
-	textFont_.setBold (bold);
-	textFont_.setItalic (italic);
-	if(size <= 0)
-		textSize_ = 1;
-	else
-		textSize_ = size;
-
-	if(pixmap0_ && pixmap1_ && (pixmap0_->rect() != pixmap1_->rect()))
-		textSize_ = (int)((double)textSize_ * printerFactor_ + .5);
-
-	textFont_.setPointSize (textSize_);
-}
-
-void TeQtCanvas::setTextSize (int size)
-{
-	if(size <= 0)
-		textSize_ = 1;
-	else
-		textSize_ = size;
-
-	if(pixmap0_ && pixmap1_ && (pixmap0_->rect() != pixmap1_->rect()))
-		textSize_ = (int)((double)textSize_ * printerFactor_ + .5);
-
-	textFont_.setPointSize (textSize_);
-}
-
-
-void TeQtCanvas::plotText (TeCoord2D &pt, string &str, double angle, double /*alignh*/, double /*alignv*/)
-{
-	painter_.setPen(textPen_);
-	painter_.setFont(textFont_);
-	QPoint p = mapDWtoV (pt);
-	if (angle != 0.)
-	{
-		painter_.save ();
-		painter_.translate (p.x(),p.y());
-		painter_.rotate (-angle);
-		painter_.drawText (0,-4,QString(str.c_str()));
-		painter_.restore ();
-	}
-	else
-		painter_.drawText (p,QString(str.c_str()));
-}
-
-void TeQtCanvas::plotXorTextDistance(vector<QPointArray> xorPointArrayVec, double unitConv, string unit)
-{
-	if(xorPointArrayVec.empty())
-		return;
-
-	QPoint a = xorPointArrayVec[0].point(0);
-	QPoint b = xorPointArrayVec[0].point(1);
-	TeCoord2D ppa = mapVtoCW(a);
-	TeCoord2D ppb = mapVtoCW(b);
-	double distance = sqrt((ppa.x()-ppb.x()) * (ppa.x()-ppb.x()) + (ppa.y()-ppb.y()) * (ppa.y()-ppb.y()));
-	string s;
-	if(unit == "Decimal Degrees")
-			s = Te2String(distance/unitConv,6) + "(" + unit + ")";
-	else
-			s = Te2String(distance/unitConv,1) + "(" + unit + ")";
-
-	double dy = (double)(b.y() - a.y());
-	double dx = (double)(b.x() - a.x());
-	distance = sqrt(dx * dx + dy * dy);
-	double txHeight = -7.;
-	double dd = distance / 2.;
-	double alfa = atan(dy/dx);
-	if(dx<0 && dy<0)
-		alfa = alfa - TePI;
-	else if(dy>0 && dx<0)
-		alfa = TePI + alfa;
-	double beta = atan(txHeight/dd);
-	double c = dd * cos(beta);
-
-	double gama = alfa + beta;
-	if((dx<0 && dy<0) || (dy>0 && dx<0))
-		gama = alfa - beta;
-
-	double x = c * cos(gama);
-	x += a.x();
-	double y = c * sin(gama);
-	y += a.y();
-	QPoint p((int)x, (int)y);
-	alfa = -alfa * 180. / TePI;
-	if((dx<0 && dy<0) || (dy>0 && dx<0))
-		alfa = 180. + alfa;
-			
-	QPen pen(QColor(239, 111, 63));
-	QFont font("Terminal", 12);
-	font.setStyleStrategy(QFont::PreferAntialias);
-	font.setBold(true);
-	QFontMetrics fm(font);
-	QRect rect = fm.boundingRect(s.c_str());
-	int xp = - rect.width()/2;
-	int yp = - rect.height()/2;
-
-	plotOnPixmap0();
-	painter_.setRasterOp (Qt::XorROP);
-	painter_.setPen(pen);
-	painter_.setFont(font);
-	if (alfa != 0.)
-	{
-		painter_.save ();
-		painter_.translate (p.x(),p.y());
-		painter_.rotate (-alfa);
-		painter_.drawText(xp, yp, rect.width(), rect.height(), Qt::AlignLeft|Qt::DontClip, s.c_str());
-		painter_.restore ();
-	}
-	else
-	{
-		xp = p.x() - rect.width()/2;
-		yp = p.y() - rect.height()/2;
-		painter_.drawText((int)x, (int)y, rect.width(), rect.height(), Qt::AlignLeft|Qt::DontClip, s.c_str());
-	}
-
-	plotOnWindow();
-	painter_.setRasterOp (Qt::XorROP);
-	painter_.setPen(pen);
-	painter_.setFont(font);
-	painter_.save ();
-	painter_.translate (-offset().x(), -offset().y());
-	if (alfa != 0.)
-	{
-		painter_.translate (p.x(),p.y());
-		painter_.rotate (-alfa);
-		painter_.drawText(xp, yp, rect.width(), rect.height(), Qt::AlignLeft|Qt::DontClip, s.c_str());
-	}
-	else
-	{
-		xp = p.x() - rect.width()/2;
-		yp = p.y() - rect.height()/2;
-		painter_.drawText(xp, yp, rect.width(), rect.height(), Qt::AlignLeft|Qt::DontClip, s.c_str());
-	}
-	painter_.restore ();
-}
-
-void TeQtCanvas::plotText (TeText& tx, TeVisual& visual)
-{
-	if(tx.textValue().empty())
-		return;
-
-	int	x, y;
-
-	TeCoord2D pt = tx.location();
-	QPoint p = mapDWtoV (pt);
-	double angle = tx.angle();
-
-	QRect brect = textRect(tx, visual);
-	painter_.setFont(textFont_);
-	painter_.setPen(textPen_);
-	painter_.setRasterOp (Qt::CopyROP);
-	string st = tx.textValue();
-
-	if (angle != 0.)
-	{
-		x = - brect.width()/2;
-		y = - brect.height()/2;
-		painter_.save ();
-		painter_.translate (p.x(), p.y());
-		painter_.rotate (-angle);
-		painter_.drawText(x, y, brect.width(), brect.height(), Qt::AlignLeft|Qt::DontClip, st.c_str());
-		painter_.restore ();
-	}
-	else
-	{
-		x = p.x() - brect.width()/2;
-		y = p.y() - brect.height()/2;
-		painter_.drawText(x, y, brect.width(), brect.height(), Qt::AlignLeft|Qt::DontClip, st.c_str());
-	}
-}
-
-QRect TeQtCanvas::textRect(TeText& tx, TeVisual visual)
-{
-	QRect rect;
-	if(tx.textValue().empty())
-		return rect;
-
-	int size;
-	int fixedSize = visual.fixedSize(); // font size is fixed
-	if(fixedSize == false && tx.height() > 0.)
-	{
-		TeBox wbox = getDataWorld();
-		TeCoord2D p1(wbox.x1_, wbox.y1_);
-		TeCoord2D p2(double(p1.x() + tx.height()), double(p1.y() + tx.height()));
-		TeBox box(p1, p2);
-		mapDWtoV(box);
-		size = int(box.height());
-		size = (int)((double)size / printerFactor_ + .5);
-	}
-	else
-		size = visual.size(); // font size
-	if(size == 0)
-		size = 1;
-
-	setTextSize(size);
-	textFont_.setFamily (visual.family().c_str());
-
-	TeCoord2D pt = tx.location();
-	QPoint p = mapDWtoV (pt);
-
-	string st = tx.textValue();
-	QFontMetrics fm(textFont_);
-	rect = fm.boundingRect(st.c_str());
-	QPoint cc = rect.center();
-	QPoint tr = p;
-	tr = tr - cc;
-	rect.setRight(rect.right()+tr.x());
-	rect.setLeft(rect.left()+tr.x());
-	rect.setTop(rect.top()+tr.y());
-	rect.setBottom(rect.bottom()+tr.y());
-	return rect;
-}
-
-void TeQtCanvas::plotXorPolyline (QPointArray& PA, bool cdev)
-{
-	QPoint o = offset();
-	QPen pen(QColor("green"));
-
-	plotOnPixmap0();
-	painter_.save ();
-	if(cdev == false)
-		painter_.translate(o.x(), o.y());
-	painter_.setRasterOp (Qt::XorROP);
-	painter_.setPen(pen);
-	painter_.drawPolyline(PA);
-	painter_.restore ();
-
-	plotOnWindow(); // do offset translation on window
-	painter_.save ();
-	if(cdev)
-		painter_.translate(-o.x(), -o.y());
-	painter_.setRasterOp (Qt::XorROP);
-	painter_.setPen(pen);
-	painter_.drawPolyline(PA);
-	painter_.restore ();
-
-	plotOnPixmap0();
-}
-
-void TeQtCanvas::plotTextRects (TeText& tx, TeVisual visual)
-{
-	if(tx.textValue().empty())
-		return;
-
-	QPoint o = offset();
-	QRect rect, l, r, t, b, c;
-
-	TeCoord2D pt = tx.location();
-	plotOnPixmap0();
-	QPoint p = mapDWtoV (pt);
-	double angle = tx.angle();
-
-	rect = textRect(tx, visual);
-	if(angle != 0.)
-	{
-		rect.setTop(rect.top()-p.y());
-		rect.setBottom(rect.bottom()-p.y());
-		rect.setLeft(rect.left()-p.x());
-		rect.setRight(rect.right()-p.x());
-	}
-
-	l = rect;
-	l.setTop(rect.top()+rect.height()/2-3);
-	l.setBottom(rect.top()+rect.height()/2+3);
-	l.setRight(rect.left() + 6);
-
-	r = rect;
-	r.setTop(l.top());
-	r.setBottom(l.bottom());
-	r.setLeft(rect.right() - 6);
-
-	t = rect;
-	t.setLeft(rect.left()+rect.width()/2-3);
-	t.setRight(rect.left()+rect.width()/2+3);
-	t.setBottom(rect.top() + 6);
-
-	b = rect;
-	b.setLeft(t.left());
-	b.setRight(t.right());
-	b.setTop(rect.bottom() - 6);
-
-	c.setLeft(rect.left()+rect.width()/2-3);
-	c.setRight(c.left() + 6);
-	c.setTop(rect.top()+rect.height()/2-3);
-	c.setBottom(c.top() + 6);
-
-	QPointArray parL(4);
-	parL.setPoint(0, l.bottomLeft());
-	parL.setPoint(1, l.bottomRight());
-	parL.setPoint(2, l.topRight());
-	parL.setPoint(3, l.topLeft());
-
-	QPointArray parR(4);
-	parR.setPoint(0, r.bottomRight());
-	parR.setPoint(1, r.bottomLeft());
-	parR.setPoint(2, r.topLeft());
-	parR.setPoint(3, r.topRight());
-
-	QPointArray parT(4);
-	parT.setPoint(0, t.topLeft());
-	parT.setPoint(1, t.bottomLeft());
-	parT.setPoint(2, t.bottomRight());
-	parT.setPoint(3, t.topRight());
-
-	QPointArray parB(4);
-	parB.setPoint(0, b.bottomLeft());
-	parB.setPoint(1, b.topLeft());
-	parB.setPoint(2, b.topRight());
-	parB.setPoint(3, b.bottomRight());
-
-	QBrush	brush(QColor("green"));
-
-	if (angle != 0.)
-	{
-		plotOnPixmap0();
-		painter_.save ();
-		painter_.setRasterOp (Qt::XorROP);
-		painter_.setBrush(Qt::NoBrush);
-		QPen pen(QColor("green"));
-		painter_.setPen(pen);
-		painter_.translate (p.x(), p.y());
-		painter_.rotate (-angle);
-		painter_.drawRect(rect);
-		painter_.drawPolyline(parL);
-		painter_.drawPolyline(parR);
-		painter_.drawPolyline(parT);
-		painter_.drawPolyline(parB);
-		painter_.fillRect(c, brush);
-		painter_.restore ();
-
-		plotOnWindow(); // do offset translation on window
-		painter_.save ();
-		painter_.setRasterOp (Qt::XorROP);
-		painter_.setBrush(Qt::NoBrush);
-		pen = QPen(QColor("green"));
-		painter_.setPen(pen);
-		painter_.translate (p.x()-o.x(), p.y()-o.y());
-		painter_.rotate (-angle);
-		painter_.drawRect(rect);
-		painter_.drawPolyline(parL);
-		painter_.drawPolyline(parR);
-		painter_.drawPolyline(parT);
-		painter_.drawPolyline(parB);
-		painter_.fillRect(c, brush);
-		painter_.restore ();
-	}
-	else
-	{
-		plotOnPixmap0();
-		painter_.save ();
-		painter_.setRasterOp (Qt::XorROP);
-		painter_.setBrush(Qt::NoBrush);
-		QPen pen(QColor("green"));
-		painter_.setPen(pen);
-		painter_.drawRect(rect);
-		painter_.drawPolyline(parL);
-		painter_.drawPolyline(parR);
-		painter_.drawPolyline(parT);
-		painter_.drawPolyline(parB);
-		painter_.fillRect(c, brush);
-		painter_.restore ();
-
-		plotOnWindow(); // do offset translation on window
-		painter_.save ();
-		painter_.setRasterOp (Qt::XorROP);
-		painter_.setBrush(Qt::NoBrush);
-		pen = QPen(QColor("green"));
-		painter_.setPen(pen);
-		painter_.translate (-o.x(), -o.y());
-		painter_.drawRect(rect);
-		painter_.drawPolyline(parL);
-		painter_.drawPolyline(parR);
-		painter_.drawPolyline(parT);
-		painter_.drawPolyline(parB);
-		painter_.fillRect(c, brush);
-		painter_.restore ();
-	}
-	plotOnPixmap0();
-}
-
-void TeQtCanvas::setArcColor (int r, int g, int b)
-{
-	arcColor_.setRgb(r,g,b);
-}
-
-void TeQtCanvas::setArcStyle (int s, int w )
-{
-	arcPen_.setStyle ((Qt::PenStyle)s);
-	arcPen_.setWidth(w);
-}
-
-void TeQtCanvas::setPointColor (int r, int g, int b)
-{
-	pointColor_.setRgb(r,g,b);
-}
-
-void TeQtCanvas::setPointStyle (int s, int w)
-{
-	pointStyle_ = (TePtBasicType) s;
-	pointSize_ = w;
-}
-
-void TeQtCanvas::plotPoint (TeCoord2D &pt)
-{	
-	pointPen_.setColor (pointColor_);
-	painter_.setPen(pointPen_);
-
-	QPoint p = mapDWtoV (pt);
-
-	plotMark(p,pointStyle_, pointSize_);
-}
-
-void TeQtCanvas::setNodeColor (int r, int g, int b)
-{
-	nodeColor_.setRgb(r,g,b);
-}
-
-void TeQtCanvas::setNodeStyle (int s, int w)
-{
-	nodeStyle_ = s;
-	nodeSize_ = w;
-}
-
-void TeQtCanvas::plotNode (TeNode &pt)
-{	
-	nodePen_.setColor (nodeColor_);
-	painter_.setPen(nodePen_);
-
-	QPoint p = mapDWtoV (pt.location());
-	plotMark(p,nodeStyle_, nodeSize_);
-}
-
-
-void TeQtCanvas::plotMark(QPoint &p, int s, int w)
-{
-	painter_.setPen(pointColor_);
-	if (s == TePtTypePlus)
-	{
-		painter_.drawLine (p.x()-w/2,p.y(),p.x()+w/2,p.y());
-		painter_.drawLine (p.x(),p.y()-w/2,p.x(),p.y()+w/2);
-	}
-	else if (s == TePtTypeStar)
-	{
-		painter_.save ();
-		painter_.translate (p.x(),p.y());
-		painter_.drawLine (0,-w/2,0,w/2);
-		painter_.rotate (45);
-		painter_.drawLine (0,-w/2,0,w/2);
-		painter_.rotate (-90);
-		painter_.drawLine (0,-w/2,0,w/2);
-		painter_.restore ();
-	}
-	else if (s == TePtTypeCircle)
-	{
-		painter_.setBrush(pointColor_);
-		painter_.drawChord (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
-	}
-	else if (s == TePtTypeX)
-	{
-		painter_.drawLine (p.x()-w/2,p.y()-w/2,p.x()+w/2,p.y()+w/2);
-		painter_.drawLine (p.x()-w/2,p.y()+w/2,p.x()+w/2,p.y()-w/2);
-	}
-	else if (s == TePtTypeBox)
-	{
-		painter_.fillRect (p.x()-w/2,p.y()-w/2,w,w,pointColor_);
-	}
-	else if (s == TePtTypeDiamond)
-	{
-		QPointArray pa(5);
-		pa.setPoint(0, p.x()-w/2, p.y());
-		pa.setPoint(1, p.x(), p.y()-w/2);
-		pa.setPoint(2, p.x()+w/2, p.y());
-		pa.setPoint(3, p.x(), p.y()+w/2);
- 		pa.setPoint(4, p.x()-w/2, p.y());
-		painter_.setBrush(pointColor_);
-		painter_.drawPolygon(pa);
-	}
-	else if (s == TePtTypeHollowCircle)
-	{
-		painter_.drawArc (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
-	}
-	else if (s == TePtTypeHollowBox)
-	{
-		painter_.setBrush(Qt::NoBrush);
-		painter_.drawRect (p.x()-w/2,p.y()-w/2,w,w);
-	}
-	else if (s == TePtTypeHollowDiamond)
-	{
-		painter_.drawLine (p.x()-w/2,p.y(),p.x(),p.y()-w/2);
-		painter_.drawLine (p.x(),p.y()-w/2,p.x()+w/2,p.y());
-		painter_.drawLine (p.x()+w/2,p.y(),p.x(),p.y()+w/2);
-		painter_.drawLine (p.x(),p.y()+w/2,p.x()-w/2,p.y());
-	}
-}
-
-
-void TeQtCanvas::plotCell (TeCell &cell, const bool& restoreBackground)
-{
-	int w, h;
-	TeBox b = getDataWorld ();
-
-	if (!TeIntersects (b, cell.box ()))
-		return;
-
-	QPoint pfrom, pto;
-
-	pfrom = mapDWtoV (cell.box().lowerLeft());
-	pto   = mapDWtoV (cell.box().upperRight());
-
-	painter_.setBrush(polygonBrush_);
-	painter_.setPen (polygonPen_);
-
-	if(!restoreBackground && 
-		(polygonTransparency_ == 0 || 
-		polygonTransparency_ == 100 && polygonBrush_.style() == Qt::NoBrush))
-	{
-		if(polygonTransparency_ == 100 && polygonBrush_.style() != Qt::NoBrush)
-			painter_.setBrush(Qt::NoBrush);
-
-		if((w = pto.x() - pfrom.x()) <= 1)
-			w = 2;
-		if((h = pfrom.y() - pto.y()) <= 1)
-			h = 2;
-
-		painter_.drawRect( pfrom.x(), pto.y(), w+1, h+1);
-	}
-	else if(polygonBrush_.style() == Qt::HorPattern ||
-	polygonBrush_.style() == Qt::VerPattern ||
-	polygonBrush_.style() == Qt::CrossPattern ||
-	polygonBrush_.style() == Qt::BDiagPattern ||
-	polygonBrush_.style() == Qt::FDiagPattern ||
-	polygonBrush_.style() == Qt::DiagCrossPattern)
-	{
-		if((w = pto.x() - pfrom.x()) <= 1)
-			w = 2;
-		if((h = pfrom.y() - pto.y()) <= 1)
-			h = 2;
-
-		painter_.drawRect( pfrom.x(), pto.y(), w+1, h+1);
-	}
-	else
-	{
-		QRect devRect;
-		if(painter_.device() == viewport())
-			devRect = viewport()->rect();
-		else
-			devRect = pixmap0_->rect();
-
-		TeBox box = cell.box();
-		mapDWtoV(box); // data coordinate to viewport coordinate
-		if((w = (int)box.width()) <= 3)
-			w = 4;
-		if((h = (int)box.height()) <= 3)
-			h = 4;	
-
-		QRect polyRect((int)box.x1_, (int)box.y1_, w+1, h+1);
-		QRect interRect = devRect & polyRect;
-		QPoint pOffset = interRect.topLeft();
-
-		int width = interRect.width();
-		int height = interRect.height();
-
-		int r = width%8;
-		if(r)
-			width += (8-r);
-		r = height%8;
-		if(r)
-			height += (8-r);
-
-		QBitmap	bm;
-		bm.resize(width, height);
-		//Fill bitmap with 0-bits: clipping region
-		bm.fill(Qt::color0);
-		QPainter maskPainter(&bm);
-
-		// Draw cell with 1-bits: drawing region
-		QBrush bs(Qt::color1);
-		maskPainter.setBrush(bs);
-		QPen pen(Qt::color1, polygonPen_.width());
-		maskPainter.setPen(pen);
-		maskPainter.translate(-pOffset.x(), -pOffset.y());
- 		maskPainter.drawRect( interRect );
-		maskPainter.end();
-
-		QRegion clipRegion(bm);
-		clipRegion.translate(pOffset.x(), pOffset.y());
-
-		int transp = 255 - (polygonTransparency_ * 255 / 100);
-		painter_.setClipRegion(clipRegion);
-		if(restoreBackground) // restore background from pixmap2_
-		{
-			painter_.drawPixmap(pOffset.x(), pOffset.y(), *pixmap2_, pOffset.x(),
-				pOffset.y(), interRect.width(), interRect.height());
-		}
-
-		// set alpha buffer and color
-		QImage img(interRect.width(), interRect.height(), 32);
-		unsigned int val = (transp << 24) | (polygonColor_.red() << 16) | (polygonColor_.green() << 8) | polygonColor_.blue();
-		img.fill(val);
-		img.setAlphaBuffer(true);
-
-		// plot transparency
-		painter_.drawPixmap(pOffset.x(), pOffset.y(), img);
-
-
-		// plot contours
-		painter_.setClipping(false);
-		painter_.setBrush(Qt::NoBrush);
-		painter_.drawRect( interRect );
-	}
-}
-//void TeQtCanvas::plotCell (TeCell &cell, const bool& restoreBackground)
-//{
-//	int w, h;
-//	TeBox b = getDataWorld ();
-//
-//	if (!TeIntersects (b, cell.box ()))
-//		return;
-//
-//	QPoint pfrom, pto;
-//
-//	pfrom = mapDWtoV (cell.box().lowerLeft());
-//	pto   = mapDWtoV (cell.box().upperRight());
-//
-//	painter_.setBrush(polygonBrush_);
-//	painter_.setPen (polygonPen_);
-//
-//	if((polygonTransparency_ == 0 && polygonBrush_.style() != Qt::NoBrush) || // 100% opaque or
-//		(polygonTransparency_ == 100 || polygonBrush_.style() == Qt::NoBrush)) // 100% transparent
-//	{
-//		if(polygonTransparency_ == 100 && polygonBrush_.style() != Qt::NoBrush)
-//			painter_.setBrush(Qt::NoBrush);
-//
-//		if((w = pto.x() - pfrom.x()) <= 1)
-//			w = 2;
-//		if((h = pfrom.y() - pto.y()) <= 1)
-//			h = 2;
-//
-//		//painter_.drawRect( pfrom.x()+1, pto.y()+1, w, h);
-//		painter_.drawRect( pfrom.x(), pto.y(), w+1, h+1);
-//	}
-//	else
-//	{
-//		QRect devRect;
-//		if(painter_.device() == viewport())
-//			devRect = viewport()->rect();
-//		else
-//			devRect = pixmap0_->rect();
-//
-//		TeBox box = cell.box();
-//		mapDWtoV(box); // data coordinate to viewport coordinate
-//		if((w = (int)box.width()) <= 3)
-//			w = 4;
-//		if((h = (int)box.height()) <= 3)
-//			h = 4;	
-//
-//		QRect polyRect((int)box.x1_, (int)box.y1_, w+1, h+1);
-//		QRect interRect = devRect & polyRect;
-//		QPoint pOffset = interRect.topLeft();
-//
-//		int width = interRect.width();
-//		int height = interRect.height();
-//
-//		int r = width%8;
-//		if(r)
-//			width += (8-r);
-//		r = height%8;
-//		if(r)
-//			height += (8-r);
-//
-//		QBitmap	bm;
-//		bm.resize(width, height);
-//		//Fill bitmap with 0-bits: clipping region
-//		bm.fill(Qt::color0);
-//		QPainter maskPainter(&bm);
-//
-//		// Draw cell with 1-bits: drawing region
-//		QBrush bs(Qt::color1, polygonBrush_.style());
-//		maskPainter.setBrush(bs);
-//		QPen pen(Qt::color1, polygonPen_.width());
-//		maskPainter.setPen(pen);
-//		maskPainter.translate(-pOffset.x(), -pOffset.y());
-// 		maskPainter.drawRect( interRect );
-//		maskPainter.end();
-//
-//		QRegion clipRegion(bm);
-//		clipRegion.translate(pOffset.x(), pOffset.y());
-//
-//		int transp = 255 - (polygonTransparency_ * 255 / 100);
-//		painter_.setClipRegion(clipRegion);
-//		// restore background from pixmap2_
-//		painter_.drawPixmap(pOffset.x(), pOffset.y(), *pixmap2_, pOffset.x(),
-//			pOffset.y(), interRect.width(), interRect.height());
-//
-//		// set alpha buffer and color
-//		QImage img(interRect.width(), interRect.height(), 32);
-//		unsigned int val = (transp << 24) | (polygonColor_.red() << 16) | (polygonColor_.green() << 8) | polygonColor_.blue();
-//		img.fill(val);
-//		img.setAlphaBuffer(true);
-//
-//		// plot transparency
-//		painter_.drawPixmap(pOffset.x(), pOffset.y(), img);
-//
-//
-//		// plot contours
-//		painter_.setClipping(false);
-//		painter_.setBrush(Qt::NoBrush);
-//		painter_.drawRect( interRect );
-//	}
-//}
-void TeQtCanvas::plotPolygon (const TePolygon &poly, const bool& restoreBackground)
-{
-	if(canvasAndDataProjectionEqual_)
-	{
-		if (!TeIntersects (wc_, poly.box ()))
-			return;
-	}
-	else
-	{
-		TeBox canvasBox = TeRemapBoxPC2Geodetic(wc_, canvasProjection_);
-		TeBox pBox = TeRemapBoxPC2Geodetic(poly.box(), dataProjection_);
-
-		if (!TeIntersects(canvasBox, pBox))
-			return;
-	}
-
-	int		i, k;
- 	QPoint	p;
-	painter_.setBrush(polygonBrush_);
-	painter_.setPen (polygonPen_);
-
-	if(!restoreBackground && poly.size() == 1 && // no holes
-		(polygonTransparency_ == 0 || 
-		polygonBrush_.style() == Qt::NoBrush))
-		//polygonTransparency_ == 100 && polygonBrush_.style() == Qt::NoBrush))
-	{
-		TeLinearRing ring = poly[0];
- 		QPointArray parray = mapDWtoV(ring);
-		painter_.drawPolygon( parray );
-	}
-	else if(polygonBrush_.style() == Qt::HorPattern ||
-	polygonBrush_.style() == Qt::VerPattern ||
-	polygonBrush_.style() == Qt::CrossPattern ||
-	polygonBrush_.style() == Qt::BDiagPattern ||
-	polygonBrush_.style() == Qt::FDiagPattern ||
-	polygonBrush_.style() == Qt::DiagCrossPattern)
-	{
-		TeLinearRing ring = poly[0];
- 		QPointArray parray = mapDWtoV(ring);
-		painter_.drawPolygon( parray );
-	}
-	else
-	{
-		QRect devRect;
-		if(painter_.device() == viewport())
-			devRect = viewport()->rect();
-		else
-			devRect = pixmap0_->rect();
-
-		TeBox box = poly.box();
-		mapDWtoV(box); // data coordinate to viewport coordinate
-		if(box.width() <= 0 || box.height() <= 0)
-			return;
-		int w = (int)box.width();
-		int h = (int)box.height();
-		if(w < 4)
-			w = 4;
-		if(h < 4)
-			h = 4;
-
-		QRect polyRect((int)box.x1_, (int)box.y1_, w, h);
-		if(polyRect.intersects(devRect) == false)
-			return;
-		QRect interRect = devRect & polyRect;
-
-		if(painter_.hasClipping())
-		{
-			QRegion interRegion = QRegion(interRect);
-			QRegion pclip = painter_.clipRegion();
-			interRegion = interRegion.intersect(pclip);
-			interRect = interRegion.boundingRect();
-		}
-
-		QPoint pOffset = interRect.topLeft();
-		int width = interRect.width();
-		int height = interRect.height();
-
-		int r = width%8;
-		if(r)
-			width += (8-r);
-		r = height%8;
-		if(r)
-			height += (8-r);
-
-		if(width == 0)
-			width = 8;
-		if(height == 0)
-			height = 8;
-
-		QBitmap	bm;
-		bm.resize(width, height);
-		//Fill bitmap with 0-bits: clipping region
-		bm.fill(Qt::color0);
-		QPainter maskPainter(&bm);
-
-		TeLinearRing ring = poly[0];
- 		QPointArray parray = mapDWtoV(ring);
-
-		// Draw polygon with 1-bits: drawing region
-		QBrush bs(Qt::color1);
-		maskPainter.setBrush(bs);
-		QPen pen(Qt::color1, polygonPen_.width());
-		maskPainter.setPen(pen);
-		maskPainter.translate(-pOffset.x(), -pOffset.y());
- 		maskPainter.drawPolygon( parray );
-
-  		vector<QPointArray> holeVec;
-		if(poly.size() > 1)
-		{
-			// Draw holes with 0-bits: clipping region
-			maskPainter.setBrush(Qt::color0);
-			pen.setColor(Qt::color0);
-			maskPainter.setPen(pen);
-			for ( k = 1; k < (int)poly.size(); k++ )
-  			{
-  				ring = poly[k];
-  				QPointArray hole = mapDWtoV(ring);
-				holeVec.push_back(hole);
-  				maskPainter.drawPolygon( hole );
-  			}
-		}
-		maskPainter.end();
-
-		QRegion clipRegion(bm);
-		clipRegion.translate(pOffset.x(), pOffset.y());
-
-		painter_.setClipRegion(clipRegion);
-
-		if(restoreBackground && pixmap0_->rect() == pixmap2_->rect())
-		{
-			// restore background from pixmap2_
-			painter_.drawPixmap(pOffset.x(), pOffset.y(), *pixmap2_, pOffset.x(),
-				pOffset.y(), interRect.width(), interRect.height());
-		}
-
-		if(polygonBrush_.style() != Qt::CustomPattern)
-		{
-			if(polygonBrush_.style() == Qt::SolidPattern)
-			{
-				int transp = 255 - (polygonTransparency_ * 255 / 100);
-
-				// set alpha buffer and color
-				QImage img(interRect.width(), interRect.height(), 32);
-				unsigned int val = (transp << 24) | (polygonColor_.red() << 16) | (polygonColor_.green() << 8) | polygonColor_.blue();
-				img.fill(val);
-				img.setAlphaBuffer(true);
-
-				// plot transparency
-				painter_.drawPixmap(pOffset.x(), pOffset.y(), img);
-			}
-		}
-		//else // polygonBrush_.style() == Qt::CustomPattern
-		//{
-		//	QImage imag("c:\\terra2\\aplicativos\\ui\\images\\visual.jpg");
-
-		//	if(imag.depth() != 32)
-		//		imag = imag.convertDepth(32);
-		//	int i, j, k;
-		//	unsigned char* u = imag.bits();
-		//	j = imag.width() * imag.height();
-		//	for(i=0; i<j; ++i)
-		//	{
-		//		k = i * 4;
-		//		// if pattern color is white, transparency is total
-		//		if(u[k] == 255 && u[k+1] == 255 && u[k+2] == 255)
-		//			u[k+3] = 0;
-		//		else
-		//		{
-		//			// if polygonColor_ is black, do not change the color
-		//			if(polygonColor_.blue() != 0 || polygonColor_.green() != 0 || polygonColor_.red() != 0)
-		//			{
-		//				int peso = 1;
-		//				u[k] = (u[k] + peso * polygonColor_.blue()) / (1+peso);
-		//				u[k+1] = (u[k+1] + peso * polygonColor_.green()) / (1+peso);
-		//				u[k+2] = (u[k+2] + peso * polygonColor_.red()) / (1+peso);
-		//			}
-		//			u[k+3] = transp;
-		//		}
-		//	}
-		//	imag.setAlphaBuffer(true);
-
-		//	int xp = pOffset.x() / imag.width() * imag.width();
-		//	int yp = pOffset.y() / imag.height() * imag.height();
-
-		//	for(j=0; j<interRect.height()+imag.height(); j+=imag.height())
-		//	{
-		//		for(i=0; i<interRect.width()+imag.width(); i+=imag.width())
-		//			painter_.drawPixmap(xp+i, yp+j, imag);
-		//	}
-		//}
-
-		// plot contours
-		painter_.setClipping(false);
-		painter_.drawPolyline( parray );
-		for(i = 0; i< (int)holeVec.size(); i++)
-			painter_.drawPolyline( holeVec[i] );
-	}
-}
-
-//void TeQtCanvas::plotPolygon (const TePolygon &poly, const bool& restoreBackground)
-//{
-//	if(canvasAndDataProjectionEqual_)
-//	{
-//		if (!TeIntersects (wc_, poly.box ()))
-//			return;
-//	}
-//	else
-//	{
-//		TeBox canvasBox = TeRemapBoxPC2Geodetic(wc_, canvasProjection_);
-//		TeBox pBox = TeRemapBoxPC2Geodetic(poly.box(), dataProjection_);
-//
-//		if (!TeIntersects(canvasBox, pBox))
-//			return;
-//	}
-//
-//	int		i, k;
-// 	QPoint	p;
-//	painter_.setBrush(polygonBrush_);
-//	painter_.setPen (polygonPen_);
-//
-//	if(polygonTransparency_==100 || polygonBrush_.style() == Qt::NoBrush) // contour
-//	{
-//		TeLinearRing ring = poly[0];
-// 		QPointArray parray = mapDWtoV(ring);
-//		painter_.drawPolyline( parray );
-//
-//		for ( k = 1; k < (int)(poly.size()); k++ )
-//  		{
-//  			ring = poly[k];
-//  			QPointArray hole = mapDWtoV(ring);
-//  			painter_.drawPolyline( hole );
-//  		}
-//	}
-//	else if(!restoreBackground && poly.size() == 1 && // no holes
-//		polygonTransparency_ == 0  && // and is opaque
-//		!(polygonBrush_.style() == Qt::NoBrush || // and not is NOBrush or Pattern
-//		polygonBrush_.style() == Qt::CustomPattern))
-//	{
-//		TeLinearRing ring = poly[0];
-// 		QPointArray parray = mapDWtoV(ring);
-//		painter_.drawPolygon( parray );
-//	}
-//	else
-//	{
-//		QRect devRect;
-//		if(painter_.device() == viewport())
-//			devRect = viewport()->rect();
-//		else
-//			devRect = pixmap0_->rect();
-//
-//		TeBox box = poly.box();
-//		mapDWtoV(box); // data coordinate to viewport coordinate
-//		if(box.width() <= 0 || box.height() <= 0)
-//			return;
-//		int w = (int)box.width();
-//		int h = (int)box.height();
-//		if(w < 4)
-//			w = 4;
-//		if(h < 4)
-//			h = 4;
-//
-//		QRect polyRect((int)box.x1_, (int)box.y1_, w, h);
-//		if(polyRect.intersects(devRect) == false)
-//			return;
-//		QRect interRect = devRect & polyRect;
-//
-//		if(painter_.hasClipping())
-//		{
-//			QRegion interRegion = QRegion(interRect);
-//			QRegion pclip = painter_.clipRegion();
-//			interRegion = interRegion.intersect(pclip);
-//			interRect = interRegion.boundingRect();
-//		}
-//
-//		QPoint pOffset = interRect.topLeft();
-//		int width = interRect.width();
-//		int height = interRect.height();
-//
-//		int r = width%8;
-//		if(r)
-//			width += (8-r);
-//		r = height%8;
-//		if(r)
-//			height += (8-r);
-//
-//		if(width == 0)
-//			width = 8;
-//		if(height == 0)
-//			height = 8;
-//
-//		QBitmap	bm;
-//		bm.resize(width, height);
-//		//Fill bitmap with 0-bits: clipping region
-//		bm.fill(Qt::color0);
-//		QPainter maskPainter(&bm);
-//
-//		TeLinearRing ring = poly[0];
-// 		QPointArray parray = mapDWtoV(ring);
-//
-//		// Draw polygon with 1-bits: drawing region
-//		QBrush bs(Qt::color1);
-//		maskPainter.setBrush(bs);
-//		QPen pen(Qt::color1, polygonPen_.width());
-//		maskPainter.setPen(pen);
-//		maskPainter.translate(-pOffset.x(), -pOffset.y());
-// 		maskPainter.drawPolygon( parray );
-//
-//  		vector<QPointArray> holeVec;
-//		if(poly.size() > 1)
-//		{
-//			// Draw holes with 0-bits: clipping region
-//			maskPainter.setBrush(Qt::color0);
-//			pen.setColor(Qt::color0);
-//			maskPainter.setPen(pen);
-//			for ( k = 1; k < (int)poly.size(); k++ )
-//  			{
-//  				ring = poly[k];
-//  				QPointArray hole = mapDWtoV(ring);
-//				holeVec.push_back(hole);
-//  				maskPainter.drawPolygon( hole );
-//  			}
-//		}
-//		maskPainter.end();
-//
-//		QRegion clipRegion(bm);
-//		clipRegion.translate(pOffset.x(), pOffset.y());
-//
-//		painter_.setClipRegion(clipRegion);
-//
-//		if(restoreBackground)
-//		{
-//			if(pixmap0_->rect() == pixmap2_->rect())
-//			{
-//				// restore background from pixmap2_
-//				painter_.drawPixmap(pOffset.x(), pOffset.y(), *pixmap2_, pOffset.x(),
-//					pOffset.y(), interRect.width(), interRect.height());
-//			}
-//		}
-//
-//		if((polygonTransparency_ == 0 && polygonBrush_.style() == Qt::SolidPattern) || !(polygonBrush_.style() == Qt::SolidPattern || polygonBrush_.style() == Qt::CustomPattern))
-//		{
-//			painter_.drawPolygon( parray );
-//		}
-//		else
-//		{
-//			int transp = 255 - (polygonTransparency_ * 255 / 100);
-//
-//			if(polygonBrush_.style() == Qt::SolidPattern)
-//			{
-//				// set alpha buffer and color
-//				QImage img(interRect.width(), interRect.height(), 32);
-//				unsigned int val = (transp << 24) | (polygonColor_.red() << 16) | (polygonColor_.green() << 8) | polygonColor_.blue();
-//				img.fill(val);
-//				img.setAlphaBuffer(true);
-//
-//				// plot transparency
-//				painter_.drawPixmap(pOffset.x(), pOffset.y(), img);
-//			}
-//			else
-//			{
-//				painter_.drawPolygon( parray );
-//			}
-//			//else // polygonBrush_.style() == Qt::CustomPattern
-//			//{
-//			//	QImage imag("c:\\terra2\\aplicativos\\ui\\images\\visual.jpg");
-//	
-//			//	if(imag.depth() != 32)
-//			//		imag = imag.convertDepth(32);
-//			//	int i, j, k;
-//			//	unsigned char* u = imag.bits();
-//			//	j = imag.width() * imag.height();
-//			//	for(i=0; i<j; ++i)
-//			//	{
-//			//		k = i * 4;
-//			//		// if pattern color is white, transparency is total
-//			//		if(u[k] == 255 && u[k+1] == 255 && u[k+2] == 255)
-//			//			u[k+3] = 0;
-//			//		else
-//			//		{
-//			//			// if polygonColor_ is black, do not change the color
-//			//			if(polygonColor_.blue() != 0 || polygonColor_.green() != 0 || polygonColor_.red() != 0)
-//			//			{
-//			//				int peso = 1;
-//			//				u[k] = (u[k] + peso * polygonColor_.blue()) / (1+peso);
-//			//				u[k+1] = (u[k+1] + peso * polygonColor_.green()) / (1+peso);
-//			//				u[k+2] = (u[k+2] + peso * polygonColor_.red()) / (1+peso);
-//			//			}
-//			//			u[k+3] = transp;
-//			//		}
-//			//	}
-//			//	imag.setAlphaBuffer(true);
-//	
-//			//	int xp = pOffset.x() / imag.width() * imag.width();
-//			//	int yp = pOffset.y() / imag.height() * imag.height();
-//	
-//			//	for(j=0; j<interRect.height()+imag.height(); j+=imag.height())
-//			//	{
-//			//		for(i=0; i<interRect.width()+imag.width(); i+=imag.width())
-//			//			painter_.drawPixmap(xp+i, yp+j, imag);
-//			//	}
-//			//}
-//		}
-//
-//		// plot contours
-//		painter_.setClipping(false);
-//		painter_.drawPolyline( parray );
-//		for(i = 0; i< (int)holeVec.size(); i++)
-//			painter_.drawPolyline( holeVec[i] );
-//	}
-//}
-
-QRect TeQtCanvas::getLegendRect (QPoint p, const QPixmap* pix, string tx)
-{
-	QRect rect;
-	TeVisual visual;
-	TeColor cor(0, 0, 0);
-	visual.size(8);
-	visual.bold(true);
-	visual.color(cor);
-	visual.fixedSize(true);
-	setTextColor (cor.red_, cor.green_, cor.blue_);
-	string fam(visual.family());
-	setTextStyle (fam, visual.size(), visual.bold(), visual.italic());
-
-	if(pix)
-	{
-		int x = (int)(p.x()+pix->width()+3.*printerFactor_);
-		int y = (int)(p.y()+13.*printerFactor_);
-		QFontMetrics fm(textFont_);
-		rect = fm.boundingRect(tx.c_str());
-		rect.setRight(rect.right() + x);
-		rect.setLeft(rect.left() + x);
-		rect.setTop(rect.top() + y);
-		rect.setBottom(rect.bottom() + y);
-		QRect prect = pix->rect();
-		prect.setRight(prect.right() + p.x());
-		prect.setLeft(prect.left() + p.x());
-		prect.setTop(prect.top() + p.y());
-		prect.setBottom(prect.bottom() + p.y());
-		rect |= prect;
-	}
-	else
-	{
-		int x = (int)(p.x()+1.*printerFactor_);
-		int y = (int)(p.y()+13.*printerFactor_);
-		QFontMetrics fm(textFont_);
-		rect = fm.boundingRect(tx.c_str());
-		rect = fm.boundingRect(tx.c_str());
-		rect.setRight(rect.right() + x);
-		rect.setLeft(rect.left() + x);
-		rect.setTop(rect.top() + y);
-		rect.setBottom(rect.bottom() + y);
-	}
-	return rect;
-}
-
-void TeQtCanvas::plotLegend (QPoint p, const QPixmap* pix, string tx)
-{
-	TeVisual visual;
-	TeColor cor(0, 0, 0);
-	visual.fixedSize(true);
-	visual.size(8);
-	visual.bold(true);
-	visual.color(cor);
-	setTextColor (cor.red_, cor.green_, cor.blue_);
-	string fam = visual.family();
-	setTextStyle (fam, visual.size(), visual.bold(), visual.italic());
-	painter_.setFont(textFont_);
-	painter_.setPen(textPen_);
-
-	if(pix)
-	{
-		int x = (int)(p.x()+pix->width()+3.*printerFactor_);
-		int y = (int)(p.y()+13.*printerFactor_);
-		bitBlt (painter_.device(), p.x(), p.y(), pix, 0, 0, pix->width(), pix->height(), Qt::CopyROP, true);
-		painter_.drawText(x, y, tx.c_str());
-	}
-	else
-	{
-		int x = (int)(p.x()+1.*printerFactor_);
-		int y = (int)(p.y()+13.*printerFactor_);
-		painter_.drawText(x, y, tx.c_str());
-	}
-}
-
-bool TeQtCanvas::locateGraphicScale(const QPoint& p)
-{
-	return graphicScaleRect_.contains(p);
-}
-
-void TeQtCanvas::plotLegend (const QPoint& p, const TeColor& cor, const string& tx)
-{
-	TeVisual  v;
-	TeColor c = cor;
-	v.color(c);
-	c.init(0, 0, 0);
-	v.contourColor(c);
-	int	ww = (int)(21. * printerFactor_);
-	int	hh = (int)(16. * printerFactor_);
-
-	drawPolygonRep(p, ww, hh, v);
-
-	QPoint pos = p;
-	pos.setX(pos.x() + ww);
-	pos.setX((int)(pos.x() + 3.*printerFactor_));
-	pos.setY((int)(pos.y()+13.*printerFactor_));
-	painter_.setPen(textPen_);
-	painter_.drawText(pos, tx.c_str());
-}
-
-void TeQtCanvas::plotLegend (const QPoint& p, TeLegendEntry* leg, const string& tx)
-{
-	TeVisual visual;
-	TeColor cor(0, 0, 0);
-	visual.fixedSize(true);
-	visual.size(8);
-	visual.bold(true);
-	visual.color(cor);
-	setTextColor (cor.red_, cor.green_, cor.blue_);
-	string fam = visual.family();
-	setTextStyle (fam, visual.size(), visual.bold(), visual.italic());
-	painter_.setFont(textFont_);
-	painter_.setPen(textPen_);
-	QPoint pos = p;
-
-	int	ww = (int)(21. * printerFactor_);
-	int	hh = (int)(16. * printerFactor_);
-
-	if(leg == 0)
-	{
-		pos.setX(pos.x() + ww);
-		pos.setX((int)(pos.x() + 3.*printerFactor_));
-		pos.setY((int)(p.y()+13.*printerFactor_));
-		painter_.drawText(pos.x(), pos.y(), tx.c_str());
-		return;
-	}
-
-	// TePOLYGONS = 1, TeLINES = 2, TePOINTS = 4, TeCELLS = 256
-	bool hasPolygons = true;
-	bool hasCells = true;
-	bool hasLines = true;
-	bool hasPoints = true;
-
-	string s = leg->to();
-	if(s.find("mean = ") == string::npos)
-	{
-		TeGeomRepVisualMap& vm = leg->getVisualMap();
-		if(vm.find(TePOLYGONS) == vm.end())
-		{
-			hasPolygons = false;
-			hasCells = false;
-		}
-		if(vm.find(TeLINES) == vm.end())
-			hasLines = false;
-		if(vm.find(TePOINTS) == vm.end())
-			hasPoints = false;
-
-		if ((hasPolygons || hasCells) && (hasLines == false) && (hasPoints == false))
-			drawPolygonRep(pos, ww, hh, *(vm[TePOLYGONS]));
-		else if ((hasPolygons || hasCells) && (hasLines == true) && (hasPoints == false))
-		{
-			drawPolygonRep(pos, ww, hh, *(vm[TePOLYGONS]));
-			pos.setX(pos.x() + ww);
-			drawLineRep(pos, *(vm[TeLINES]));
-		}
-		else if ((hasPolygons || hasCells) && (hasLines == false) && (hasPoints == true))
-		{
-			drawPolygonRep(pos, ww, hh, *(vm[TePOLYGONS]));
-			pos.setX(pos.x() + ww);
-			drawPointRep(pos, *(vm[TePOINTS]));
-		}
-		else if ((hasPolygons || hasCells) && (hasLines == true) && (hasPoints == true))
-		{
-			drawPolygonRep(pos, ww, hh, *(vm[TePOLYGONS]));
-			pos.setX(pos.x() + ww);
-			drawLineRep(pos, *(vm[TeLINES]));
-			pos.setX(pos.x() + ww);
-			drawPointRep(pos, *(vm[TePOINTS]));
-		}
-		else if (hasPolygons == false && hasCells == false && hasLines == true && hasPoints == false)
-			drawLineRep(pos, *(vm[TeLINES]));
-		else if (hasPolygons == false && hasCells == false && hasLines == false && hasPoints == true)
-			drawPointRep(pos, *(vm[TePOINTS]));
-		else if (hasPolygons == false && hasCells == false && hasLines == true && hasPoints == true)
-		{
-			drawLineRep(pos, *(vm[TeLINES]));
-			pos.setX(pos.x() + ww);
-			drawPointRep(pos, *(vm[TePOINTS]));
-		}
-	}
-
-	pos.setX(pos.x() + ww);
-	pos.setX((int)(pos.x() + 3.*printerFactor_));
-	pos.setY((int)(p.y()+13.*printerFactor_));
-	painter_.setPen(textPen_);
-	painter_.drawText(pos, tx.c_str());
-}
-
-void TeQtCanvas::drawPolygonRep (QPoint p, int w, int h, TeVisual& v)
-{
-	QBrush brush;
-	brush.setStyle(brushStyleMap_[(TePolyBasicType)v.style()]);
-	QColor bcor(v.color().red_, v.color().green_, v.color().blue_);
-	brush.setColor(bcor);
-	painter_.setBrush(brush);
-
-	QPen pen;
-	pen.setStyle(penStyleMap_[(TeLnBasicType)v.contourStyle()]);
-	QColor pcor(v.contourColor().red_, v.contourColor().green_, v.contourColor().blue_);
-	pen.setColor(pcor);
-	int pwidth = (Qt::PenStyle) v.contourWidth();
-	pen.setWidth (pwidth);
-	painter_.setPen(pen);
-
-	QRect rect(p.x(), (int)(p.y()+2.*printerFactor_), w, (int)(h-2.*printerFactor_));
-
-	// set alpha buffer and color
-    int transp = v.transparency();
-	transp = (int)(2.55 * (double)(100 - transp));
-	QImage img(rect.width(), rect.height(), 32);
-	unsigned int val = (transp << 24) | (bcor.red() << 16) | (bcor.green() << 8) | bcor.blue();
-	img.fill(val);
-	img.setAlphaBuffer(true);
-
-	// plot transparency
-	painter_.drawPixmap(rect.x(), rect.y(), img);
-	painter_.setBrush(Qt::NoBrush);
-	painter_.drawRect(rect);
-}
-
-void TeQtCanvas::drawLineRep (QPoint p, TeVisual& v)
-{
-	QPen		pen;
-	QColor		cor;
-	TeColor		tcor;
-	uint		width;
-
-	tcor = v.color();
-	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
-	pen.setColor(cor);
-	pen.setStyle(penStyleMap_[(TeLnBasicType)v.style()]);
-	width = v.width();
-	pen.setWidth (width);
-	painter_.setPen(pen);
-
-	painter_.moveTo((int)(p.x()+1.*printerFactor_), (int)(p.y()+5.*printerFactor_));
-	painter_.lineTo((int)(p.x()+3.*printerFactor_), (int)(p.y()+5.*printerFactor_));
-	painter_.lineTo((int)(p.x()+6.*printerFactor_), (int)(p.y()+6.*printerFactor_));
-	painter_.lineTo((int)(p.x()+8.*printerFactor_), (int)(p.y()+8.*printerFactor_));
-	painter_.lineTo((int)(p.x()+10.*printerFactor_), (int)(p.y()+9.*printerFactor_));
-	painter_.lineTo((int)(p.x()+14.*printerFactor_), (int)(p.y()+10.*printerFactor_));
-	painter_.lineTo((int)(p.x()+16.*printerFactor_), (int)(p.y()+10.*printerFactor_));
-	painter_.lineTo((int)(p.x()+18.*printerFactor_), (int)(p.y()+9.*printerFactor_));
-	painter_.lineTo((int)(p.x()+19.*printerFactor_), (int)(p.y()+9.*printerFactor_));
-	painter_.moveTo((int)(p.x()+2.*printerFactor_), (int)(p.y()+13.*printerFactor_));
-	painter_.lineTo((int)(p.x()+3.*printerFactor_), (int)(p.y()+12.*printerFactor_));
-	painter_.lineTo((int)(p.x()+5.*printerFactor_), (int)(p.y()+11.*printerFactor_));
-	painter_.lineTo((int)(p.x()+6.*printerFactor_), (int)(p.y()+11.*printerFactor_));
-	painter_.lineTo((int)(p.x()+9.*printerFactor_), (int)(p.y()+10.*printerFactor_));
-	painter_.lineTo((int)(p.x()+10.*printerFactor_), (int)(p.y()+9.*printerFactor_));
-}
-
-void TeQtCanvas::drawPointRep (QPoint pp, TeVisual& v)
-{
-	QColor		cor;
-	TeColor		tcor;
-
-	tcor = v.color();
-	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
-	int s = v.style();
-	double	w = (double)v.size() * printerFactor_;
-
-	QPoint p = pp;
-	QPoint offset((int)(10.*printerFactor_), (int)(7.*printerFactor_));
-	p += offset;
-
-	painter_.setPen(cor);
-	if (s == TePtTypePlus)
-	{
-		painter_.drawLine ((int)(p.x()-w/2),p.y(),(int)(p.x()+w/2.),p.y());
-		painter_.drawLine (p.x(),(int)(p.y()-w/2.),p.x(),(int)(p.y()+w/2.));
-	}
-	else if (s == TePtTypeStar)
-	{
-		painter_.save ();
-		painter_.translate (p.x(),p.y());
-		painter_.drawLine (0,(int)(-w/2.),0,(int)(w/2.));
-		painter_.rotate (45);
-		painter_.drawLine (0,(int)(-w/2.),0,(int)(w/2.));
-		painter_.rotate (-90);
-		painter_.drawLine (0,(int)(-w/2.),0,(int)(w/2.));
-		painter_.restore ();
-	}
-	else if (s == TePtTypeCircle)
-	{
-		painter_.setBrush(cor);
-		painter_.drawChord ((int)(p.x()-w/2.),(int)(p.y()-w/2.),(int)w,(int)w,0,360*16);
-	}
-	else if (s == TePtTypeX)
-	{
-		painter_.drawLine ((int)(p.x()-w/2.),(int)(p.y()-w/2.),(int)(p.x()+w/2.),(int)(p.y()+w/2.));
-		painter_.drawLine ((int)(p.x()-w/2.),(int)(p.y()+w/2.),(int)(p.x()+w/2.),(int)(p.y()-w/2.));
-	}
-	else if (s == TePtTypeBox)
-	{
-		painter_.fillRect ((int)(p.x()-w/2.),(int)(p.y()-w/2.),(int)w,(int)w,cor);
-	}
-	else if (s == TePtTypeDiamond)
-	{
-		QPointArray pa(5);
-		pa.setPoint(0, (int)(p.x()-w/2.), p.y());
-		pa.setPoint(1, p.x(), (int)(p.y()-w/2.));
-		pa.setPoint(2, (int)(p.x()+w/2.), p.y());
-		pa.setPoint(3, p.x(), (int)(p.y()+w/2.));
- 		pa.setPoint(4, (int)(p.x()-w/2.), p.y());
-		painter_.setBrush(cor);
-		painter_.drawPolygon(pa);
-	}
-	else if (s == TePtTypeHollowCircle)
-	{
-		painter_.drawArc ((int)(p.x()-w/2.),(int)(p.y()-w/2.),(int)w,(int)w,0,360*16);
-	}
-	else if (s == TePtTypeHollowBox)
-	{
-		painter_.setBrush(Qt::NoBrush);
-		painter_.drawRect ((int)(p.x()-w/2.),(int)(p.y()-w/2.),(int)w,(int)w);
-	}
-	else if (s == TePtTypeHollowDiamond)
-	{
-		painter_.drawLine ((int)(p.x()-w/2.),p.y(),p.x(),(int)(p.y()-w/2.));
-		painter_.drawLine (p.x(),(int)(p.y()-w/2.),(int)(p.x()+w/2.),p.y());
-		painter_.drawLine ((int)(p.x()+w/2.),p.y(),p.x(),(int)(p.y()+w/2.));
-		painter_.drawLine (p.x(),(int)(p.y()+w/2.),(int)(p.x()-w/2.),p.y());
-	}
-}
-
-void TeQtCanvas::plotLine (TeLine2D &line)
-{
-	TeBox b = getDataWorld ();
-	if (!TeIntersects (b, line.box ()))
-		return;
-	
-	linePen_.setColor (lineColor_);
-	painter_.setPen(linePen_);
-
-	QPointArray a = mapDWtoV(line);
-	painter_.drawPolyline( a );
-}
-
-void TeQtCanvas::plotArc (TeArc &arc)
-{
-	TeBox b = getDataWorld ();
-	if (!TeIntersects (b, arc.box ()))
-		return;
-	
-	arcPen_.setColor (arcColor_);
-	painter_.setPen(arcPen_);
-
-	QPoint pfrom, pto;
-
-	pfrom = mapDWtoV (arc.fromNode().location());
-	pto   = mapDWtoV (arc.toNode().location());
-
-	painter_.drawLine( pfrom, pto );
-
-	double ang = atan2 (double(pfrom.y()-pto.y()), double (pfrom.x()-pto.x()));
-	QPoint pm((int)((pto.x()+pfrom.x())/2.+0.5),(int)((pto.y()+pfrom.y())/2.+0.5));
-	
-	double ang1 = ang + 25.*TeCDR;
-	double ang2 = ang - 25.*TeCDR;
-	QPoint	p1((int)(10.*cos(ang1)+0.5),(int)(10.*sin(ang1)+.5)),
-			p2((int)(10.*cos(ang2)+0.5),(int)(10.*sin(ang2)+.5));
-	p1 += pm;
-	p2 += pm;
-	painter_.drawLine( pm, p1 );
-	painter_.drawLine( pm, p2 );
-	painter_.drawLine( p1, p2 );
-
-}
-
-void TeQtCanvas::plotPie (double x, double y, double w, double h, double a, double alen)
-{
-	int	dx, dy, dw, dh, da, df;
-
-	pieBrush_.setColor (pieColor_);
-	painter_.setBrush(pieBrush_);
-	painter_.setPen(linePen_);
-
-	TeCoord2D p(x, y);
-	QPoint	qp = mapDWtoV(p);
-	dx = qp.x();
-	dy = qp.y();
-
-	TeCoord2D pt(x+w, y+h);
-	QPoint	qpt = mapDWtoV(pt);
-	dw = abs(qpt.x() - dx);
-	dh = abs(qpt.y() - dy);
-
-	da = (int)(a * 16);
-	df = (int)(alen * 16);
-	painter_.drawPie(dx, dy-dh, dw, dh, da, df);
-}
-
-void TeQtCanvas::setPieColor (int r, int g, int b)
-{
-	pieColor_.setRgb(r, g, b);
-	pieBrush_.setStyle(Qt::SolidPattern);
-}
-
-void TeQtCanvas::plotRect (QRect& rect)
-{
-	rectBrush_.setColor (rectColor_);
-	painter_.setBrush(Qt::NoBrush);
-	painter_.setPen(linePen_);
-	painter_.drawRect(rect);
-}
-
-void TeQtCanvas::plotRect (double x, double y, double w, double h, int transp, bool legend)
-{
-	if(pixmap1_ == 0)
-		return;
-
-	int	dx, dy, dw, dh;
-
-	TeCoord2D p(x, y);
-	QPoint	qp;
-	if(legend)
-		qp = QPoint((int)p.x(), (int)p.y());
-	else
-		qp = mapDWtoV(p);
-	dx = qp.x();
-	dy = qp.y();
-
-	TeCoord2D pt(x+w, y+h);
-	QPoint	qpt;
-	if(legend)
-	{
-		qpt = QPoint((int)pt.x(), (int)pt.y());
-		dw = abs(qpt.x() - dx);
-		dh = abs(qpt.y() - dy);
-	}
-	else
-	{	
-//		qpt = mapDWtoV(pt);
-		TeBox b = wc_;
-		mapCWtoDW(b);
-		TeCoord2D center = b.center();
-		TeCoord2D cc = center;
-		cc.x_ += w;
-		dw = abs(mapDWtoV(center).x() - mapDWtoV(cc).x());
-		cc = center;
-		cc.y_ += h;
-		dh = abs(mapDWtoV(center).y() - mapDWtoV(cc).y());
-	}
-
-	if(transp == 0)
-	{
-		rectBrush_.setColor (rectColor_);
-		painter_.setBrush(rectBrush_);
-		painter_.setPen(linePen_);
-		painter_.drawRect(dx, dy-dh, dw, dh);
-	}
-	else
-	{
-		double alpha = transp / 100.;
-		double beta = 1 - alpha;
-		double red = rectColor_.red() * beta;
-		double green = rectColor_.green() * beta;
-		double blue = rectColor_.blue() * beta;
-
-		int r = dw%8;
-		if(r)
-			dw += (8-r);
-		r = dh%8;
-		if(r)
-			dh += (8-r);
-
-		QImage ima = pixmap0_->convertToImage();
-		QImage imap(dw, dh, 32);
-		int i, j;
-		int x = qp.x();
-		int	y = qp.y() - dh;
-		for(i=x; i-x<dw && i<ima.width(); i++)
-		{
-			if(i < 0)
-				continue;
-			for(j=y; j-y<dh && j<ima.height(); j++)
-			{
-				if(j < 0)
-					continue;
-				QRgb v = ima.pixel(i, j);
-				int r = (int)((double)qRed(v) * alpha + red);
-				int g = (int)((double)qGreen(v) * alpha + green);
-				int b = (int)((double)qBlue(v) * alpha + blue);
-				QRgb t = qRgb(r, g, b);
-				imap.setPixel(i-x, j-y, t);
-			}
-		}
-
-		QPixmap pm(dw, dh);
-		pm.convertFromImage(imap);
-		QRect rec = pm.rect();
-		rec &= painter_.viewport();
-		bitBlt (painter_.device(), x, y, &pm, 0, 0, rec.width(), rec.height(), Qt::CopyROP, true);
-	}
-}
-
-void TeQtCanvas::setRectColor (int r, int g, int b)
-{
-	rectColor_.setRgb(r, g, b);
-	rectBrush_.setStyle(Qt::SolidPattern);
-}
-
-static inline int blendComponent( int back, int fore, int falpha )
-{
-	int balpha = 255 - falpha;
-    int a = falpha + balpha -(falpha*balpha)/255;
-    return (falpha*fore + balpha*back -(balpha*falpha*fore)/255)/a;  
-}
-
-int d2dms(double v)
-{
-    double av;
-    int d, m, s;
-    av = fabs(v);
-    d = (int)av;
-    av = av - d;
-    av = av * 60;
-    m = (int)av;
-    av = av - m;
-    av = av * 60;
-    s = (int)av;
-    int gms = d * 10000 + m * 100 + s ;
-	return gms;
-}
-
-double dms2d (int vs)
-{
-	int v = abs(vs);
-	int dd = v/10000;
-	int dm = (v-dd*10000)/100;
-	int ds = v - dd*10000 - dm*100;
-	double d = dd + dm/60. + ds/3600.;
-	if (vs < 0)
-		d = -d;
-	return d;
-}
-
-string buildMosaicName (int x, int y, int delta)
-{
-	int		lad,lam,las,lod,lom,los,dd,dm,ds;
-	char	hemis,hemiss;
-	int		lx1,ly1;
-
-	hemis = 'S';
-	if (y>=0)hemis = 'N';
-	ly1 = abs(y);
-	lad = ly1/3600;
-	lam = (ly1-lad*3600)/60;
-	las = ly1 - lad*3600 - lam*60;
-
-	hemiss = 'O';
-	if (x>=0)hemis = 'E';
-	lx1 = abs(x);
-	lod = lx1/3600;
-	lom = (lx1-lod*3600)/60;
-	los = lx1 - lod*3600 - lom*60;
-
-	dd = delta/10000;
-	dm = (delta-dd*10000)/100;
-	ds = delta - dd*10000 - dm*100;
-
-	char name[128];
-	sprintf(name,"%c%02d%02d%02d%c%02d%02d%02d%02d%02d%02d",
-		hemis,lad,lam,las,hemiss,lod,lom,los,dd,dm,ds);
-	return string(name);
-}
-
-void TeQtCanvas::copyPixmap0ToPrinter()
-{
-	if (pixmap0_)
-	{
-		QPrinter printer;
-		if (printer.setup())
-		{
-			QPainter p(&printer);
-
-			QPaintDevice* dev = painter_.device();
-			if(dev == pixmap0_)
-				painter_.end();
-
-			p.drawPixmap(0, 0, *pixmap0_);
-			p.flush();
-			p.end();
-
-			if(dev && painter_.device() == 0)
-				painter_.begin(dev);
-		}
-	}
-}
-
-void TeQtCanvas::copyPixmapToWindow(QPixmap* p, int ulx, int uly, int w, int h)
-{
-	bitBlt (viewport(),ulx,uly,p,ulx,uly,w,h,Qt::CopyROP,true);
-}
-
-void TeQtCanvas::copyPixmap0To(QPaintDevice* dev)
-{
-	if (pixmap0_)
-	{
-		bitBlt (dev,0,0,pixmap0_,0,0,width_,height_,Qt::CopyROP,true);
-	}
-}
-
-void TeQtCanvas::copyPixmap0ToWindow()
-{
-	if (pixmap0_)
-	{
-		bitBlt (viewport(),0,0,pixmap0_,contentsX(),contentsY(),viewport()->rect().width(),viewport()->rect().height(),Qt::CopyROP,true);
-	}
-}
-
-void TeQtCanvas::copyPixmap1ToWindow()
-{
-	if (pixmap1_)
-	{
-		bitBlt (viewport(),0,0,pixmap1_,contentsX(),contentsY(),viewport()->rect().width(),viewport()->rect().height(),Qt::CopyROP,true);
-	}
-}
-
-void TeQtCanvas::copyPixmap0ToWindow(int ulx, int uly, int w, int h)
-{
-	if (pixmap0_)
-	{
-		bitBlt (viewport(),ulx,uly,pixmap0_,ulx,uly,w,h,Qt::CopyROP,true);
-	}
-}
-
-void TeQtCanvas::copyPanArea(int x, int y)
-{
-	if (pixmap0_)
-	{
-		QPaintDevice* dev = painter_.device();
-		if(dev)
-			painter_.end();
-		painter_.begin(viewport());
-		QRect a, b;
-		int vw = viewport()->width();
-		int vh = viewport()->height();
-
-		int xi = horizontalScrollBar()->value();
-		int yi = verticalScrollBar()->value();
-		bitBlt (viewport(), 0, 0, pixmap1_, xi+x, yi+y, vw, vh, Qt::CopyROP, true);
-
-		if((xi + x + vw) > contentsWidth())
-		{
-			int ww =  (xi + x + vw) - contentsWidth();
-			int xii = vw - ww;
-			QRect a(xii, 0, vw - xii, vh);
-			painter_.fillRect(a, painter_.backgroundColor());
-		}
-		if((xi + x) < 0)
-		{
-			QRect a(0, 0, -(xi + x), vh);
-			painter_.fillRect(a, painter_.backgroundColor());
-		}
-		if((yi + y + vh) > contentsHeight())
-		{
-			int hh =  (yi + y + vh) - contentsHeight();
-			int yii = vh - hh;
-			QRect a(0, yii, vw, vh - yii);
-			painter_.fillRect(a, painter_.backgroundColor());
-		}
-		if((yi + y) < 0)
-		{
-			QRect a(0, 0, vw, -(yi + y));
-			painter_.fillRect(a, painter_.backgroundColor());
-		}
-
-		painter_.end();
-		if(dev)
-			painter_.begin(dev);
-	}
-}
-
-void TeQtCanvas::copyPixmap0ToPixmap1()
-{
-	if (pixmap1_ && pixmap0_)
-		bitBlt (pixmap1_,0,0,pixmap0_,0,0,width_,height_,Qt::CopyROP,true);
-}
-
-void TeQtCanvas::copyPixmap0ToPixmap1(int ulx, int uly, int w, int h)
-{
-	if (pixmap1_ && pixmap0_)
-		bitBlt (pixmap1_,ulx,uly,pixmap0_,ulx,uly,w,h,Qt::CopyROP,true);
-}
-
-void TeQtCanvas::copyPixmap1ToPixmap0()
-{
-	if (pixmap1_ && pixmap0_)
-		bitBlt (pixmap0_,0,0,pixmap1_,0,0,width_,height_,Qt::CopyROP,true);
-}
-
-void TeQtCanvas::copyPixmap1ToPixmap0(int ulx, int uly, int w, int h)
-{
-	if (pixmap1_ && pixmap0_)
-		bitBlt (pixmap0_,ulx,uly,pixmap1_,ulx,uly,w,h,Qt::CopyROP,true);
-}
-
-void TeQtCanvas::copyPixmap1ToPixmap2()
-{
-	if (pixmap1_ && pixmap2_)
-	{
-		bitBlt (pixmap2_,0,0,pixmap1_,0,0,width_,height_,Qt::CopyROP,true);
-		qimage_.reset();
-		qimage_ = pixmap2_->convertToImage();
-	}
-}
-
-void TeQtCanvas::copyPixmap1ToPixmap2(int ulx, int uly, int w, int h)
-{
-	if (pixmap1_ && pixmap2_)
-	{
-		bitBlt (pixmap2_,ulx,uly,pixmap1_,ulx,uly,w,h,Qt::CopyROP,true);
-		qimage_.reset();
-		qimage_ = pixmap2_->convertToImage();
-	}
-}
-
-void TeQtCanvas::copyPixmap2ToPixmap1()
-{
-	if (pixmap1_ && pixmap2_)
-		bitBlt (pixmap1_,0,0,pixmap2_,0,0,width_,height_,Qt::CopyROP,true);
-}
-
-void TeQtCanvas::copyPixmap2ToPixmap1(int ulx, int uly, int w, int h)
-{
-	if (pixmap1_ && pixmap2_)
-		bitBlt (pixmap1_,ulx,uly,pixmap2_,ulx,uly,w,h,Qt::CopyROP,true);
-}
-
-void TeQtCanvas::plotRaster(TeRaster* raster, TeRasterTransform* transf, TeQtProgress *progress)
-{
-	int dt = CLOCKS_PER_SEC/2;
-	int dt2 = CLOCKS_PER_SEC; //* .000001;
-	clock_t	t0, t1, t2;
-	params_.fileName_ = raster->params().fileName_;
-
-	if (buildRaster ())
-	{
-		// Calculate the box of input image that intersects the box of the canvas
-		TeBox bboxBackRaster = backRaster_->params().boundingBox();		
-		TeBox bboxSearched = TeRemapBox(bboxBackRaster, backRaster_->projection(), raster->projection());
-		TeBox bboxIntersection;
-		if (!TeIntersection (raster->params().boundingBox(),bboxSearched,bboxIntersection))
-			return ;			// no intersection 
-
-		// fill QImage with zero (100% of transparency)
-		TeDecoderQtImage* decqt = reinterpret_cast<TeDecoderQtImage*>(backRaster_->decoder());
-		decqt->getImage()->setAlphaBuffer(false);
-		decqt->setAlphaBufferToTransparent();
-
-		// Create a remapping tool to back raster
-		TeRasterRemap remap;
-		if (transf)
-		{
-			remap.setTransformer(transf);
-//			unsigned int tt = transf->getTransparency();
-			decqt->setTransparency(transf->getTransparency());
-		}
-		remap.setOutput(backRaster_);
-		TeBox b = raster->params().boundingBox();
-		remap.setROI(b);
-
-		// Calculates best resolution level to display the input image on this canvas
-		//int res = raster->decoder()->bestResolution(params_.resx_/raster->params().resx_);
-		int res = raster->decoder()->bestResolution(bboxBackRaster, backRaster_->params().ncols_, backRaster_->params().nlines_, backRaster_->params().projection());
-		
-
-		// Check if raster blocks in best level of resolution that intersects the canvas box
-		TeRasterParams parBlock;	
-		if (raster->selectBlocks(bboxIntersection,res,parBlock))        
-		{
-			if (progress)
-				progress->setTotalSteps(raster->numberOfSelectedBlocks());
-			t2 = clock();
-			t0 = t1 = t2;
-			
-			// Process each block as an independent raster decoded in memory
-			TeRaster* block = new TeRaster;
-			remap.setInput(block);
-
-			TeDecoderMemory* decMem = new TeDecoderMemory(parBlock);
-			decMem->init();
-			// Portal of raster block selection behaves as portal of geometries
-			// use the "bool flag - do - while" scheme
-			int numBlockProcessed=0;
-			bool flag = true;
-			do
-			{
-				flag = raster->fetchRasterBlock(decMem);
-				block->setDecoder(decMem);
-				remap.apply();
-				numBlockProcessed++;
-				t2 = clock();
-				if (int(t2-t1) > dt)
-				{
-					t1 = t2;
-					if((int)(t2-t0) > dt2)	
-					{
-						if (progress)
-						{
-							if (progress->wasCancelled())
-								break;
-							else
-								progress->setProgress(numBlockProcessed);
-						}
-					}
-				}
-			} while (flag);
-			if (progress)
-				progress->reset();
-			decMem->clear();
-			delete block;
-			raster->clearBlockSelection();
-		}
-		else		// no blocks found try to remap the whole raster
-		{
-			remap.setInput(raster);
-			remap.apply(true);	
-		}
-		decqt->getImage()->setAlphaBuffer(true);
-		painter_.drawPixmap(0, 0, *(decqt->getImage()));
-	}
-}
-
-bool TeQtCanvas::buildRaster ()
-{
-	if (!backRaster_)
-	{
-		backRaster_ = new TeRaster();
-		params_.mode_ = 'c';
-		params_.useDummy_ = true;
-		params_.setDummy(255);
-		TeDecoderQtImage *dec = new TeDecoderQtImage(params_);
-		backRaster_->setDecoder (dec);
-		backRaster_->init();
-	}
-	return true;
-}
-
-void TeQtCanvas::endPrinting()
-{
-	QPaintDevice* dev = painter_.device();
-	if(dev)
-		painter_.end();
-	if(pixmap0_)
-		painter_.begin(pixmap0_);
-}
-
-void TeQtCanvas::plotGraphicScale(TeVisual& visual, double offsetX, double offsetY, double unitConv, const string& dunit)
-{
-	TeBox	box = getWorld();
-	if(box.isValid() == false)
-		return;
-
-	string unit = dunit;
-	if (dunit.empty())
-		unit = canvasProjection_->units();
-
-	double	w = box.width();
-	double www = w / unitConv;
-	double	dx = www / 9.;
-	long	idx = (long)dx;
-	//long	idx = TeRound(dx);
-	double	f;
-	double	fa = 1.;
-	int		fw, fh;
-
-	int	size = visual.size();
-	if(pixmap0_ && pixmap1_ && (pixmap0_->rect() != pixmap1_->rect()))
-		size = (int)((double)size * printerFactor_ + .5);
-	//	size = TeRound((double)size * printerFactor_);
-
-	int conta = 1000;
-	if(idx > 0)
-	{
-		while(--conta)
-		{
-			dx /= 10.;
-			fa *= 10.;
-			idx = (long)dx;
-	//		idx = TeRound(dx);
-			if(idx == 0)
-			{
-				idx = (long)(dx * 10.);
-				f = idx * fa / 10.;
-	//			idx = TeRound(dx * 10.);
-	//			f = TeRound((double)idx * fa / 10.);
-				break;
-			}
-		}
-	}
-	else
-	{
-		while(--conta)
-		{
-			dx *= 10.;
-			fa /= 10.;
-			idx = (long)dx;
-	//		idx = TeRound(dx);
-			if(idx > 0)
-			{
-				f = idx * fa;
-	//			f = TeRound((double)idx * fa);
-				break;
-			}
-		}
-	}
-	if(conta == 0)
-		return;
-
-	double fff = f * unitConv;
-	double space = fff * 3.;
-	double hini = box.x1_ + (w - space) / 2.;
-
-	TeColor	cor = visual.color();
-	string	family = visual.family();
-	bool	bold = visual.bold();
-	bool	italic = visual.italic();
-	QFont font(family.c_str(), size);
-	font.setBold (bold);
-	font.setItalic (italic);
-	painter_.setFont(font);
-
-	QFontMetrics fm(font);
-	QRect rect;
-	rect = fm.boundingRect(unit.c_str());
-	fh = rect.height();
-	double vini = box.y1_ + mapVtoCW(fh+6);
-
-	TeCoord2D wp(hini, vini);
-	int x = TeRound((wp.x() - xmin_)*f_) + x0_;
-	int y = height_ - y0_ - TeRound((wp.y() - ymin_)*f_);
-	QPoint p1(x, y);
-	correctScrolling (p1);
-
-	wp.x(wp.x() + fff);
-	x = TeRound((wp.x() - xmin_)*f_) + x0_;
-	y = height_ - y0_ - TeRound((wp.y() - ymin_)*f_);
-	QPoint p2(x, y);
-	correctScrolling (p2);
-
-	wp.x(wp.x() + fff);
-	x = TeRound((wp.x() - xmin_)*f_) + x0_;
-	y = height_ - y0_ - TeRound((wp.y() - ymin_)*f_);
-	QPoint p3(x, y);
-	correctScrolling (p3);
-
-	wp.x(wp.x() + fff);
-	x = TeRound((wp.x() - xmin_)*f_) + x0_;
-	y = height_ - y0_ - TeRound((wp.y() - ymin_)*f_);
-	QPoint p4(x, y);
-	correctScrolling (p4);
-
-	rect = fm.boundingRect("0");
-	fw = rect.width();
-	QPoint pp(p1);
-	bool setRect = false;
-	if(graphicScaleRect_.isValid())
-	{
-		x = TeRound((double)graphicScaleRect_.left() * printerFactor_ + (double)fw/2.);
-		y = TeRound((double)graphicScaleRect_.top() * printerFactor_ + (double)rect.height() + 8. * printerFactor_);
-		pp.setX(x);
-		pp.setY(y);
-	}
-	else
-	{
-		setRect = true;
-		offsetX = 0.;
-		offsetY = 0.;
-	}
-
-	x = TeRound((double)pixmap0_->width() * offsetX);
-	y = TeRound((double)pixmap0_->height() * offsetY);
-	if(x!=0 || y!=0)
-	{
-		graphicScaleRect_.setLeft(graphicScaleRect_.left() + x);
-		graphicScaleRect_.setRight(graphicScaleRect_.right() + x);
-		graphicScaleRect_.setTop(graphicScaleRect_.top() + y);
-		graphicScaleRect_.setBottom(graphicScaleRect_.bottom() + y);
-	}
-
-	QPoint offset(x, y);
-	pp += offset;
-
-	QPoint interval = p2 - p1;
-
-	p1 = pp;
-	p2 = p1 + interval;
-	p3 = p2 + interval;
-	p4 = p3 + interval;
-	if(setRect)
-	{
-		x = TeRound(((double)p1.x() - (double)fw/2.) / printerFactor_);
-		graphicScaleRect_.setLeft(x);
-	}
-
-	QPen pen(QColor(cor.red_, cor.green_, cor.blue_));
-	painter_.setPen(pen);
-
-	if(bold == false)
-	{
-		QPoint pa = p2;
-		QPoint pb = p3;
-		painter_.drawLine(pa, pb);
-
-		pa = p1;
-		pb = pa;
-		y = TeRound((double)pa.y() - 5. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() + 4. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-
-		pa = p2; 
-		pb = pa;
-		y = TeRound((double)pa.y() - 5. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() + 4. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-
-		pa = p3; 
-		pb = pa;
-		y = TeRound((double)pa.y() - 5. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() + 4. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-
-		pa = p4; 
-		pb = pa;
-		y = TeRound((double)pa.y() - 5. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() + 4. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-
-		pa = p1;
-		pb = p4;
-		y = TeRound((double)pa.y() - 1. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() - 1. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-		y = TeRound((double)pa.y() + 2. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() + 2. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-	}
-	else
-	{
-		QPoint pa = p2;
-		QPoint pb = p3;
-		painter_.drawLine(pa, pb);
-		y = TeRound((double)pa.y() - 1. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() - 1. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-
-		pa = p1;
-		pb = pa;
-		y = TeRound((double)pa.y() - 5. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() + 4. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-		x = TeRound((double)pa.x() - 1. * printerFactor_);
-		pa.setY(x);
-		x = TeRound((double)pb.x() - 1. * printerFactor_);
-		pb.setY(x);
-		painter_.drawLine(pa, pb);
-
-		pa = p2; 
-		pb = pa;
-		y = TeRound((double)pa.y() - 5. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() + 4. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-		x = TeRound((double)pa.x() - 1. * printerFactor_);
-		pa.setY(x);
-		x = TeRound((double)pb.x() - 1. * printerFactor_);
-		pb.setY(x);
-		painter_.drawLine(pa, pb);
-
-		pa = p3; 
-		pb = pa;
-		y = TeRound((double)pa.y() - 5. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() + 4. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-		x = TeRound((double)pa.x() - 1. * printerFactor_);
-		pa.setY(x);
-		x = TeRound((double)pb.x() - 1. * printerFactor_);
-		pb.setY(x);
-		painter_.drawLine(pa, pb);
-
-		pa = p4; 
-		pb = pa;
-		y = TeRound((double)pa.y() - 5. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() + 4. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-		x = TeRound((double)pa.x() - 1. * printerFactor_);
-		pa.setY(x);
-		x = TeRound((double)pb.x() - 1. * printerFactor_);
-		pb.setY(x);
-		painter_.drawLine(pa, pb);
-
-		pa = p1;
-		pb = p4;
-		y = TeRound((double)pa.y() - 2. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() - 2. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-		y = TeRound((double)pa.y() + 3. * printerFactor_);
-		pa.setY(y);
-		y = TeRound((double)pb.y() + 3. * printerFactor_);
-		pb.setY(y);
-		painter_.drawLine(pa, pb);
-	}
-
-	x = TeRound((double)p1.x()-(double)fw/2.);
-	y = TeRound((double)p1.y()-8.*printerFactor_);
-	painter_.drawText(x, y, "0");
-	if(setRect)
-	{
-		y = TeRound(((double)y - (double)rect.height()) / printerFactor_);
-		graphicScaleRect_.setTop(y);
-	}
-
-	char buf[50];
-	long n = (long)f;
-
-	if(n > 0)
-	{
-		sprintf(buf, "%ld", n);
-		QString s = buf;
-		rect = fm.boundingRect(s);
-		int fw1 = rect.width();
-
-		sprintf(buf, "%ld", n*2);
-		s = buf;
-		rect = fm.boundingRect(s);
-		int fw2 = rect.width();
-
-		sprintf(buf, "%ld", n*3);
-		s = buf;
-		rect = fm.boundingRect(s);
-		int fw3 = rect.width();
-
-		if((fw1 + fw2)/2 < p3.x()-p2.x() &&
-			(fw2 + fw3)/2 < p3.x()-p2.x())
-		{
-			sprintf(buf, "%ld", n);
-			QString s = buf;
-			rect = fm.boundingRect(s);
-			fw = rect.width();
-			x = TeRound((double)p2.x()-(double)fw/2.);
-			y = TeRound((double)p2.y()-8.*printerFactor_);
-			painter_.drawText(x, y, s);
-
-			sprintf(buf, "%ld", n*2);
-			s = buf;
-			rect = fm.boundingRect(s);
-			fw = rect.width();
-			x = TeRound((double)p3.x()-(double)fw/2.);
-			y = TeRound((double)p3.y()-8.*printerFactor_);
-			painter_.drawText(x, y, s);
-		}
-
-		sprintf(buf, "%ld", n*3);
-		s = buf;
-		rect = fm.boundingRect(s);
-		fw = rect.width();
-		x = TeRound((double)p4.x()-(double)fw/2.);
-		y = TeRound((double)p4.y()-8.*printerFactor_);
-		painter_.drawText(x, y, s);
-		if(setRect)
-		{
-			x = TeRound(((double)x + (double)fw) / printerFactor_);
-			graphicScaleRect_.setRight(x);
-		}
-	}
-	else
-	{
-		int nn=0;
-		int fn = (int)fa;
-		while(fn == 0)
-		{
-			fa *= 10.;
-			fn = TeRound(fa);
-			nn++;
-		}
-		sprintf (buf, "%.*f", nn, f);
-		QString s = buf;
-		rect = fm.boundingRect(s);
-		int fw1 = rect.width();
-
-		sprintf (buf, "%.*f", nn, f*2.);
-		s = buf;
-		rect = fm.boundingRect(s);
-		int fw2 = rect.width();
-
-		sprintf (buf, "%.*f", nn, f*3.);
-		s = buf;
-		rect = fm.boundingRect(s);
-		int fw3 = rect.width();
-
-		if((fw1 + fw2)/2 < p3.x()-p2.x() &&
-			(fw2 + fw3)/2 < p3.x()-p2.x())
-		{
-			sprintf (buf, "%.*f", nn, f);
-			QString s = buf;
-			rect = fm.boundingRect(s);
-			fw = rect.width();
-			x = TeRound((double)p2.x()-(double)fw/2.);
-			y = TeRound((double)p2.y()-8.*printerFactor_);
-			painter_.drawText(x, y, s);
-
-			sprintf (buf, "%.*f", nn, f*2.);
-			s = buf;
-			rect = fm.boundingRect(s);
-			fw = rect.width();
-			x = TeRound((double)p3.x()-(double)fw/2.);
-			y = TeRound((double)p3.y()-8.*printerFactor_);
-			painter_.drawText(x, y, s);
-		}
-
-		sprintf (buf, "%.*f", nn, f*3.);
-		s = buf;
-		rect = fm.boundingRect(s);
-		fw = rect.width();
-		x = TeRound((double)p4.x()-(double)fw/2.);
-		y = TeRound((double)p4.y()-8.*printerFactor_);
-		painter_.drawText(x, y, s);
-		x = TeRound((double)x + printerFactor_);
-		graphicScaleRect_.setRight(x);
-	}
-
-	int sw = p4.x() - p1.x();
-	rect = fm.boundingRect(unit.c_str());
-	fw = rect.width();
-	fh = rect.height();
-	int suini = TeRound(((double)(sw - fw)) / 2. + (double)p1.x());
-	y = TeRound((double)p1.y()+(double)fh+2.*printerFactor_);
-	painter_.drawText (suini, y, unit.c_str());
-	if(setRect)
-	{
-		y = TeRound((double)y / printerFactor_);
-		graphicScaleRect_.setBottom(y);
-	}
-}
-
-void TeQtCanvas::setClipRegion(int x, int y, int w, int h)
-{
-	QRegion region(x, y, w, h);
-	if(painter_.device())
-		painter_.setClipRegion(region);
-}
-
-void TeQtCanvas::setClipRegion(QRegion region)
-{
-	if(painter_.device())
-		painter_.setClipRegion(region);
-}
-
-void TeQtCanvas::setClipping(bool enable)
-{
-	if(painter_.device())
-		painter_.setClipping(enable);
-}
-
-void TeQtCanvas::clearRaster()
-{
-	if (backRaster_)
-		delete backRaster_;
-	backRaster_ = 0;
-}
-
-
-void TeQtCanvas::setMode (CursorMode m)
-{
-	cursorMode_ = m;
-	down_ = false;
-}
-
-void TeQtCanvas::clear()
-{
-	int ww, hh;
-	ww = viewport()->width();
-	hh = viewport()->height();
-
-	// Clear the window
-	QPaintDevice* dev = painter_.device();
-	if(dev)
-		painter_.end();
-	painter_.begin(viewport());
-	painter_.eraseRect(0, 0, ww, hh);
-	painter_.end();
-	if(dev)
-		painter_.begin(dev);
-}
-
-void TeQtCanvas::clear(TeBox box)
-{
-	mapCWtoV(box);
-
-	// Clear the window
-	plotOnWindow();
-	painter_.eraseRect((int)box.x1(), (int)box.y1(), (int)box.width(), (int)box.height());
-	plotOnPixmap0();
-}
-
-void TeQtCanvas::clearAll()
-{
-	// Clear the viewport
-	clear();
-
-	// Clear the pixmaps
-	if(pixmap0_)
-		pixmap0_->fill(paletteBackgroundColor());
-	if(pixmap1_)
-		pixmap1_->fill(paletteBackgroundColor());
-	if(pixmap2_)
-		pixmap2_->fill(paletteBackgroundColor());
-
-	if (backRaster_)
-		delete backRaster_;
-	backRaster_ = 0;
-}
-
-void TeQtCanvas::clearAll(TeBox box)
-{
-	// Clear the viewport area corresponding to the given box
-	clear(box);
-
-	// Clear the pixmap
-	mapCWtoV(box);
-
-	QPaintDevice* dev = painter_.device();
-	if(dev)
-		painter_.end();
-
-	if(pixmap0_)
-	{
-		painter_.begin(pixmap0_);
-		painter_.fillRect((int)box.x1(), (int)box.y1(), (int)box.width(), (int)box.height(), backgroundColor());
-		painter_.end();
-	}
-	if(pixmap1_)
-	{
-		painter_.begin(pixmap1_);
-		painter_.fillRect((int)box.x1(), (int)box.y1(), (int)box.width(), (int)box.height(), backgroundColor());
-		painter_.end();
-	}
-	if(pixmap2_)
-	{
-		painter_.begin(pixmap2_);
-		painter_.fillRect((int)box.x1(), (int)box.y1(), (int)box.width(), (int)box.height(), backgroundColor());
-		painter_.end();
-	}
-
-	if(dev)
-		painter_.begin(dev);
-}
-
-
-bool TeQtCanvas::setView(int w, int h, QPaintDevice *pd)
-{
-    int dpix, dpiy, ncolors, wmm, hmm, depth, pdepth;
-	int ww = w, hh = h;
-
-	x0_ = y0_ = 0;
-
-	if (pd == 0)
-	{
-		if (ww == 0)
-			ww = viewport()->width();
-		if (hh == 0)
-			hh = viewport()->height();
-		resizeContents (ww,hh);
-
-		QPaintDevice* dev = painter_.device();
-		if(dev)
-			painter_.end();
-
-		// Build new pixmaps if window has been resized
-		if ((pixmap0_ == 0 || width_ != ww || height_ != hh) ||
-			(pixmap0_ && (pixmap0_->width() != ww || pixmap0_->height() != hh)))
-		{
-			if (pixmap0_)
-				delete pixmap0_;
-			if(numberOfPixmaps_ > 0)
-				pixmap0_ = new QPixmap (ww,hh);
-			else
-				pixmap0_ = new QPixmap (0,0);
-
-			if (pixmap1_)
-				delete pixmap1_;
-			if(numberOfPixmaps_ > 1)
-				pixmap1_ = new QPixmap (ww,hh);
-			else
-				pixmap1_ = new QPixmap (0,0);
-
-			if (pixmap2_)
-				delete pixmap2_;
-			if(numberOfPixmaps_ > 2)
-				pixmap2_ = new QPixmap (ww,hh);
-			else
-				pixmap2_ = new QPixmap (0,0);
-
-			pdepth = pixmap0_->depth ();
-		}
-		painter_.begin(pixmap0_);
-		printerFactor_ = 1.;
-	}
-	else
-	{
-		QPaintDeviceMetrics pdm(pd);
-		if (ww == 0)
-			ww = pdm.width();
-		if (hh == 0)
-			hh = pdm.height ();
-
-		int pw = pixmap0_->rect().width();
-		int ph = pixmap0_->rect().height();
-		if((double)ww/(double)pw < (double)hh/(double)ph)
-			hh = (int)((double)ph * (double)ww/(double)pw);
-		else
-			ww = (int)((double)pw * (double)hh/(double)ph);
-
-		dpix = pdm.logicalDpiX();
-		dpiy = pdm.logicalDpiY();
-		ncolors = pdm.numColors();
-		wmm = pdm.widthMM ();
-		hmm = pdm.heightMM ();
-		depth = pdm.depth ();
-		QPaintDevice* dev = painter_.device();
-		if(dev)
-			painter_.end();
-
-		if (pixmap0_)
-			delete pixmap0_;
-		if(numberOfPixmaps_ > 0)
-			pixmap0_ = new QPixmap (ww,hh);
-		else
-			pixmap0_ = new QPixmap (0,0);
-
-		// plot is made on pixmap0 because printer don�t have transparency
-		painter_.begin(pixmap0_);
-		painter_.setClipRect( x0_, y0_, ww, hh );
-
-		printerFactor_ = (double)ww / (double)widthRef2PrinterFactor_;
-
-		if (pixmap1_)
-			delete pixmap1_;
-		pixmap1_ = new QPixmap (0,0);
-
-		if (pixmap2_)
-			delete pixmap2_;
-		pixmap2_ = new QPixmap (0,0);
-	}
-
-	if(numberOfPixmaps_ > 0 && (pixmap0_->width() == 0 || pixmap0_->height() == 0))
-		return false;
-	else if(numberOfPixmaps_ > 1 && (pixmap1_->width() == 0 || pixmap1_->height() == 0))
-		return false;
-	else if(numberOfPixmaps_ > 2 && (pixmap2_->width() == 0 || pixmap2_->height() == 0))
-		return false;
-
-	width_ = ww;
-	height_ = hh;
-	params_.ncols_ = width_;
-	params_.nlines_ = height_;
-
-	down_ = false;
-	xul_ = xmin_;
-	yul_ = ymax_;
-	xlr_ = xmax_;
-	ylr_ = ymin_;
-
-	if (pd == 0)
-		clearAll();
-	return true;
-}
-
-void TeQtCanvas::correctScrolling (QPoint &p)
-{
-	if(painter_.device() == viewport())
-	{
-		QPoint o (contentsX (), contentsY ());
-		p -= o;
-	}
-}
-
-void TeQtCanvas::initCursorArea(QPoint p)
-{
-	if (!pixmap0_)
-		return;
-
-	down_ = true;
-	TeCoord2D pw = mapVtoCW(p);
-	xul_ = pw.x();
-	yul_ = pw.y();
-	ixul_ = ixlr_ = p.x();
-	iyul_ = iylr_ = p.y();
-}
-
-void TeQtCanvas::contentsMousePressEvent( QMouseEvent* e)
-{
-	if (!pixmap0_)
-		return;
-
-	QPoint m = e->pos();
-	TeCoord2D p = mapVtoCW(m);
-
-	if(e->button() == LeftButton)
-	{
-		if (cursorMode_ == Area || cursorMode_ == Edit)
-		{
-			plotOnWindow();
-			down_ = true;
-			xul_ = p.x();
-			yul_ = p.y();
-			ixul_ = ixlr_ = e->pos().x();
-			iyul_ = iylr_ = e->pos().y();
-			plotOnPixmap0();
-			emit mouseMoved (p, e->state(), m);
-		}
-		else
-			emit mousePressed (p, e->state(), m);
-	}
-	else if(e->button() == RightButton)
-		emit mouseRightButtonPressed (p, e->state(), m);
-}
-
-void TeQtCanvas::contentsMouseMoveEvent ( QMouseEvent* e)
-{
-	if (!pixmap0_)
-		return;
-	plotOnWindow();
-	QPoint m = e->pos();
-	TeCoord2D p = mapVtoCW(m);
-	if (down_)
-	{
-		QPoint o = offset();
-		painter_.setPen (green);
-		painter_.setRasterOp (Qt::XorROP);
-		painter_.drawLine(ixul_-o.x(),iyul_-o.y(),ixlr_-o.x()-1,iyul_-o.y());            
-		painter_.drawLine(ixlr_-o.x(),iyul_-o.y(),ixlr_-o.x(),iylr_-o.y() -1);            
-		painter_.drawLine(ixlr_-o.x(),iylr_-o.y(),ixul_-o.x()-1,iylr_-o.y() );            
-		painter_.drawLine(ixul_-o.x(),iylr_-o.y(),ixul_-o.x(),iyul_-o.y()-1 );            
-		ixlr_ = e->pos().x();
-		iylr_ = e->pos().y();
-		painter_.drawLine(ixul_-o.x(),iyul_-o.y(),ixlr_-o.x()-1,iyul_-o.y());            
-		painter_.drawLine(ixlr_-o.x(),iyul_-o.y(),ixlr_-o.x(),iylr_ -o.y()-1);            
-		painter_.drawLine(ixlr_-o.x(),iylr_-o.y(),ixul_-o.x()-1,iylr_-o.y() );            
-		painter_.drawLine(ixul_-o.x(),iylr_-o.y(),ixul_-o.x(),iyul_-o.y()-1 );            
-		painter_.setRasterOp (Qt::CopyROP);
-	}
-	plotOnPixmap0();
-	emit mouseMoved (p, e->state(), m);
-}
-
-void TeQtCanvas::contentsMouseReleaseEvent( QMouseEvent* e)
-{
-	if (!pixmap0_)
-		return;
-	QPoint m = e->pos();
-	TeCoord2D p = mapVtoCW(m);
-	if (down_)
-	{
-		ixlr_ = e->pos().x();
-		iylr_ = e->pos().y();
-		xlr_ = p.x();
-		ylr_ = p.y();
-		if(xul_ > xlr_)
-		{
-			double a = xlr_;
-			xlr_ = xul_;
-			xul_ = a;
-		}
-		if(ylr_ > yul_)
-		{
-			double a = ylr_;
-			ylr_ = yul_;
-			yul_ = a;
-		}
-		down_ = false;
-
-		emit zoomArea();
-	}
-	emit mouseReleased (p, e->state(), m);
-}
-
-void TeQtCanvas::contentsMouseDoubleClickEvent ( QMouseEvent* e)
-{
-	if (!pixmap0_)
-		return;
-
-	QPoint m = e->pos();
-	TeCoord2D p = mapVtoCW(m);
-
-	if(e->button() == LeftButton)
-		emit mouseDoublePressed (p, e->state(), m);
-}
-
-
-void TeQtCanvas::contentsContextMenuEvent( QContextMenuEvent* e)
-{
-	QMouseEvent *m = (QMouseEvent *)e;
-	emit popupCanvasSignal(m);
-}
-
-
-void TeQtCanvas::leaveEvent ( QEvent * )
-{
-	emit mouseLeave();
-}
-
-void TeQtCanvas::keyPressEvent (QKeyEvent* e)
-{
-	emit keyPressed(e);
-}
-
-void TeQtCanvas::keyReleaseEvent (QKeyEvent* e)
-{
-	emit keyReleased(e);
-}
-
-void TeQtCanvas::viewportPaintEvent (QPaintEvent*)
-{
-	copyPixmapToWindow ();
-	emit paintEvent ();
-}
-
-void TeQtCanvas::resizeEvent ( QResizeEvent * e)
-{
-	QScrollView::resizeEvent(e);
-}
-
-void TeQtCanvas::copyPixmapToWindow()
-{
-	if (pixmap0_)
-	{
-		int cx = contentsX();
-		int cy = contentsY();
-		bitBlt (viewport(),0,0,pixmap0_,cx,cy,viewport()->rect().width(),viewport()->rect().height(),CopyROP,true);
-	}
-}
-
-int TeQtCanvas::mapDWtoV(double a)
-{
-	TeBox dbox = getDataWorld();
-	double dwidth = dbox.width();
-	int	pwidth = viewport()->width();
-
-	int d = (int)((double)pwidth * a / (double)dwidth);
-	return d;
-}
-
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeQtCanvas.h>
+#include <TeDecoderMemory.h>
+#include <TeQtProgress.h>
+#include <TeVectorRemap.h>
+#include <TeGeometryAlgorithms.h>
+#include <TeDefines.h>
+#include <TeRasterRemap.h>
+#include <TeDecoderQtImage.h>
+
+#include <qpaintdevice.h> 
+#include <qpaintdevicemetrics.h> 
+#include <qapplication.h>
+
+#include <string>	
+#include <algorithm>	
+#include <time.h>
+
+
+TeQtCanvas::TeQtCanvas(QWidget *parent, const char *name)
+			: QScrollView(parent,name,WNorthWestGravity)
+{
+	pixmap0_ = 0;
+	pixmap1_ = 0;
+	pixmap2_ = 0;
+	backRaster_ = 0;
+	printerFactor_ = 1.;
+	numberOfPixmaps_ = 3;
+
+	canvasProjection_ = 0;
+	dataProjection_ = 0;
+	pointStyle_ = 0;
+	nodeStyle_ = 0;
+	pointSize_ = 3;
+	nodeSize_ = 4;
+	db_ = 0;
+
+	//Mounting the brushStyleMap
+	brushStyleMap_[TePolyTypeTransparent] = Qt::NoBrush;
+	brushStyleMap_[TePolyTypeFill] = Qt::SolidPattern;
+	brushStyleMap_[TePolyTypeHorizontal] = Qt::HorPattern;
+	brushStyleMap_[TePolyTypeVertical] = Qt::VerPattern;
+	brushStyleMap_[TePolyTypeFDiagonal] = Qt::FDiagPattern;
+	brushStyleMap_[TePolyTypeBDiagonal] = Qt::BDiagPattern;
+	brushStyleMap_[TePolyTypeCross] = Qt::CrossPattern;
+	brushStyleMap_[TePolyTypeDiagonalCross] = Qt::DiagCrossPattern;
+
+	//Mounting the penStyleMap
+	penStyleMap_[TeLnTypeContinuous] = Qt::SolidLine;
+	penStyleMap_[TeLnTypeDashed] = Qt::DashLine;
+	penStyleMap_[TeLnTypeDotted] = Qt::DotLine;
+	penStyleMap_[TeLnTypeDashDot] = Qt::DashDotLine;
+	penStyleMap_[TeLnTypeDashDotDot] = Qt::DashDotDotLine;
+	penStyleMap_[TeLnTypeNone] = Qt::NoPen;
+
+	setVScrollBarMode(QScrollView::Auto);
+	setHScrollBarMode(QScrollView::Auto);
+    viewport()->setMouseTracking(true);
+    viewport()->setFocusPolicy(StrongFocus);
+    viewport()->setBackgroundColor(backgroundColor());
+	setMargin(0);
+
+	width_ = viewport()->width();
+	height_ = viewport()->height();
+	popupCanvas_ = new QPopupMenu(this);
+	_penStyle=TeLnTypeContinuous;
+}
+
+TeQtCanvas::~TeQtCanvas()
+{
+	if (dataProjection_)
+		delete dataProjection_;
+	if (canvasProjection_)
+		delete canvasProjection_;
+
+	if (backRaster_)
+		delete backRaster_;
+	backRaster_ = 0;
+
+	QPaintDevice* dev = painter_.device();
+	if(dev)
+		painter_.end();
+
+	if(pixmap0_)
+		delete pixmap0_;
+	pixmap0_ = 0;
+
+	if(pixmap1_)
+		delete pixmap1_;
+	pixmap1_ = 0;
+
+	if(pixmap2_)
+		delete pixmap2_;
+	pixmap2_ = 0;
+}
+
+void TeQtCanvas::setDataProjection ( TeProjection* proj )
+{	
+	if(dataProjection_)
+		delete dataProjection_;
+
+	if (proj == 0)
+		return;
+	dataProjection_ = TeProjectionFactory::make(proj->params());
+
+	canvasAndDataProjectionEqual_ = true;
+	if (canvasProjection_ && dataProjection_ && !(*canvasProjection_== *dataProjection_))
+	{
+		canvasAndDataProjectionEqual_ = false;
+		dataProjection_->setDestinationProjection(canvasProjection_);
+		canvasProjection_->setDestinationProjection(dataProjection_);
+	}
+}
+
+void TeQtCanvas::setProjection ( TeProjection* proj )
+{	
+	if (canvasProjection_)
+		delete canvasProjection_;
+	canvasProjection_ = TeProjectionFactory::make(proj->params()); 
+	params_.projection(canvasProjection_);
+
+	canvasAndDataProjectionEqual_ = true;
+	if(canvasProjection_ && dataProjection_ && !(*canvasProjection_== *dataProjection_))
+		canvasAndDataProjectionEqual_ = false;
+}
+
+void TeQtCanvas::plotOnWindow ()
+{
+	QPaintDevice* dev = painter_.device();
+	if(dev == viewport())
+		return;
+	if(dev)
+		painter_.end();
+	painter_.begin(viewport());
+}
+
+void TeQtCanvas::plotOnPixmap0 ()
+{
+	QPaintDevice* dev = painter_.device();
+	if(dev == pixmap0_)
+		return;
+	if(dev)
+		painter_.end();
+	painter_.begin(pixmap0_);
+}
+
+void TeQtCanvas::plotOnPixmap1 ()
+{
+	QPaintDevice* dev = painter_.device();
+	if(dev == pixmap1_)
+		return;
+	if(dev)
+		painter_.end();
+	painter_.begin(pixmap1_);
+}
+
+void TeQtCanvas::plotOnPixmap2 ()
+{
+	QPaintDevice* dev = painter_.device();
+	if(dev == pixmap2_)
+		return;
+	if(dev)
+		painter_.end();
+	painter_.begin(pixmap2_);
+}
+
+bool TeQtCanvas::setWorld(TeBox b, int w, int h, QPaintDevice *pd)
+{
+	xmin_= b.x1();
+	xmax_= b.x2();
+	ymin_= b.y1();
+	ymax_= b.y2();
+	if(setView(w, h, pd) == false)
+		return false;
+	bool extend = pd ? false : true;
+	setTransformation(xmin_, xmax_, ymin_, ymax_, extend);
+	params_.nBands(3);
+	double resx = pixelSize();
+	double resy = pixelSize();
+	TeBox box(getWorld());
+	params_.lowerLeftResolutionSize(box.x1_+0.5*resx,box.y1_+0.5*resy,resx,resy,width_,height_);
+	params_.projection();
+	params_.mode_ = 'w';
+	params_.decoderIdentifier_ = "";
+	return true;
+}
+
+void TeQtCanvas::setTransformation(double xmin, double xmax, double ymin, double ymax, bool extend)
+{
+	if (painter_.device() == 0)
+		return;
+	
+	xmin_= xmin;
+	xmax_= xmax;
+	ymin_= ymin;
+	ymax_= ymax;
+
+	double	dxw = xmax_ - xmin_;
+	double	dyw = ymax_ - ymin_;
+	double	dxv = width_;
+	double	dyv = height_;
+					
+	double	fx = dxv/dxw;
+	double	fy = dyv/dyw;
+
+	if (fx > fy)
+	{
+		f_ = fy;
+		if (extend)
+		{
+			dxw = width_/f_;
+			xmax_ = xmin_ + dxw;
+		}
+		else
+			width_ = (int)(f_*dxw + .5);
+	}
+	else
+	{
+		f_ = fx;
+		if (extend)
+		{
+			dyw = height_/f_;
+			ymax_ = ymin_ + dyw;
+		}
+		else
+			height_ = (int)(f_*dyw + .5);
+	}
+
+	wc_ = TeBox (xmin_,ymin_,xmax_,ymax_);
+	params_.boundingBoxResolution(xmin_,ymin_,xmax_,ymax_,params_.resx_,params_.resy_);
+
+	QPaintDeviceMetrics devMetric(viewport());
+	double wpixels = devMetric.width();
+	double wMM = devMetric.widthMM();
+	double wT = wMM;
+	if(canvasProjection_)
+	{
+		string unit = TeConvertToUpperCase(canvasProjection_->units());
+		if(unit == "METERS")
+			wT = wMM / 1000.;
+		else if(unit == "KILOMETERS")
+			wT = wMM / 1000000.;
+		else if(unit == "CENTIMETERS")
+			wT = wMM / 100.;
+		else if(unit == "MILLIMETERS")
+			wT = wMM;
+		else if(unit == "FEET")
+			wT = wMM / (12. * 25.4);
+		else if(unit == "INCHES")
+			wT = wMM / 25.4;
+		else if(unit == "DECIMALDEGREES")
+			wT = wMM / 110000000.;
+	}
+	double wp = wT / wpixels;
+	scaleApx_ = (1. / f_) / wp;
+}
+
+void TeQtCanvas::scaleApx(double scale)
+{
+	QPaintDeviceMetrics devMetric(viewport());
+	double wMM = devMetric.widthMM();
+	double wT = wMM;
+	if(canvasProjection_)
+	{
+		string unit = TeConvertToUpperCase(canvasProjection_->units());
+		if(unit == "METERS")
+			wT = wMM / 1000.;
+		else if(unit == "KILOMETERS")
+			wT = wMM / 1000000.;
+		else if(unit == "CENTIMETERS")
+			wT = wMM / 100.;
+		else if(unit == "MILLIMETERS")
+			wT = wMM;
+		else if(unit == "FEET")
+			wT = wMM / (12. * 25.4);
+		else if(unit == "INCHES")
+			wT = wMM / 25.4;
+		else if(unit == "DECIMALDEGREES")
+			wT = wMM / 110000000.;
+	}
+
+	double ff = scale / scaleApx_;
+	double xmin, ymin, xmax, ymax;
+	if(ff < 1)
+	{
+		double dx = (wc_.width() - (wc_.width() * ff)) / 2.;
+		double dy = (wc_.height() - (wc_.height() * ff)) / 2.;
+		xmin = xmin_ + dx;
+		ymin = ymin_ + dy;
+		xmax = xmax_ - dx;
+		ymax = ymax_ - dy;
+	}
+	else
+	{
+		double dx = ((wc_.width() * ff) - wc_.width()) / 2.;
+		double dy = ((wc_.height() * ff) - wc_.height()) / 2.;
+		xmin = xmin_ - dx;
+		ymin = ymin_ - dy;
+		xmax = xmax_ + dx;
+		ymax = ymax_ + dy;
+	}
+
+	TeBox box(xmin, ymin, xmax, ymax);
+	setWorld(box, contentsWidth(), contentsHeight());
+}
+
+double TeQtCanvas::mapVtoCW(int pixels)
+{
+	TeBox wbox = getDataWorld();
+	TeCoord2D wpc(wbox.x1_ + wbox.width()/2., wbox.y1_ + wbox.height()/2.);
+	QPoint pc = mapDWtoV(wpc);
+	QPoint qp(pc.x()+pixels, pc.y());
+	TeCoord2D wp = mapVtoCW(qp);
+	wpc = mapVtoCW(pc);
+	double d = fabs(wp.x() - wpc.x());
+	return d;
+}
+
+double TeQtCanvas::mapVtoDW(int pixels)
+{
+	TeBox wbox = getDataWorld();
+	TeCoord2D	wpc(wbox.x1_ + wbox.width()/2., wbox.y1_ + wbox.height()/2.);
+	QPoint pc = mapDWtoV(wpc);
+	QPoint qp(pc.x()+pixels, pc.y());
+	TeCoord2D	wp = mapVtoDW(qp);
+	wpc = mapVtoDW(pc);
+	double d = fabs(wp.x() - wpc.x());
+	return d;
+}
+
+TeCoord2D TeQtCanvas::mapVtoCW(const QPoint& p)
+{
+	TeCoord2D w((p.x()-x0_)/f_ + xmin_,
+		(height_ - y0_ - p.y())/f_ + ymin_);
+	return w;
+}
+
+TeCoord2D TeQtCanvas::mapVtoDW(const QPoint& v)
+{
+	TeCoord2D w((v.x()-x0_)/f_ + xmin_,
+		(height_ - y0_ - v.y())/f_ + ymin_);
+
+	if(canvasAndDataProjectionEqual_ == false)
+	{
+		canvasProjection_->setDestinationProjection(dataProjection_);
+		dataProjection_->setDestinationProjection(canvasProjection_);
+		w = canvasProjection_->PC2LL (w);
+		w = dataProjection_->LL2PC (w);
+	}
+	return w;
+}
+
+
+TeBox TeQtCanvas::getDataWorld()
+{
+	if(canvasAndDataProjectionEqual_ == false)
+	{
+		TeBox b = TeRemapBox(wc_, canvasProjection_, dataProjection_);
+		return b;
+	}
+	return wc_ ;
+}
+
+QPoint TeQtCanvas::mapDWtoV(const TeCoord2D& dw)
+{
+	TeCoord2D w = dw;
+	if(canvasAndDataProjectionEqual_ == false)
+	{
+		canvasProjection_->setDestinationProjection(dataProjection_);
+		dataProjection_->setDestinationProjection(canvasProjection_);
+		w = dataProjection_->PC2LL (w);
+		w = canvasProjection_->LL2PC (w);
+	}
+
+	QPoint v((int)((w.x() - xmin_)*f_ + 0.5)+x0_,
+		height_ - y0_ - (int)((w.y() - ymin_)*f_ + 0.5));
+	correctScrolling (v);
+	return v;
+}
+
+QPointArray TeQtCanvas::mapDWtoV(const TeLine2D& line)
+{
+ 	int i;
+	int np = line.size();
+ 	QPointArray parray(np);
+	TeCoord2D p;
+
+	if(canvasAndDataProjectionEqual_ == false)
+	{
+		canvasProjection_->setDestinationProjection(dataProjection_);
+		dataProjection_->setDestinationProjection(canvasProjection_);
+ 		for (i = 0 ; i < np; ++i)
+ 		{
+			p = line[i];
+			p = dataProjection_->PC2LL(p);
+			p = canvasProjection_->LL2PC(p);
+			QPoint v((int)((p.x() - xmin_)*f_ + 0.5)+x0_,
+				height_ - y0_ - (int)((p.y() - ymin_)*f_ + 0.5));
+			correctScrolling (v);
+ 			parray.setPoint(i, v);
+ 		}
+	}
+	else
+	{
+ 		for (i = 0 ; i < np; i++)
+ 		{
+			p = line[i];
+			QPoint v((int)((p.x() - xmin_)*f_ + 0.5)+x0_,
+				height_ - y0_ - (int)((p.y() - ymin_)*f_ + 0.5));
+			correctScrolling (v);
+ 			parray.setPoint(i, v);
+ 		}
+	}
+	return parray;
+}
+
+void TeQtCanvas::mapDWtoV(TeBox& w)
+{
+	TeCoord2D ll, ur;
+	if(canvasAndDataProjectionEqual_ == false)
+		w = TeRemapBox (w, dataProjection_, canvasProjection_);
+
+	ll = w.lowerLeft();
+	ur = w.upperRight();
+
+	QPoint p1((int)((ll.x() - xmin_)*f_ + 0.5)+x0_,
+		height_ - y0_ - (int)((ll.y() - ymin_)*f_ + 0.5));
+	correctScrolling (p1);
+
+	QPoint p2((int)((ur.x() - xmin_)*f_ + 0.5)+x0_,
+		height_ - y0_ - (int)((ur.y() - ymin_)*f_ + 0.5));
+	correctScrolling (p2);
+
+	w.x1_ = p1.x();
+	w.y1_ = p2.y();
+	w.x2_ = p2.x();
+	w.y2_ = p1.y();
+
+	//TeCoord2D ll, lr, ur, ul;
+	//if(canvasAndDataProjectionEqual_ == false)
+	//	TeBox TeRemapBox ( TeBox& box, TeProjection* projFrom, TeProjection* projTo)
+
+	//{
+	//	canvasProjection_->setDestinationProjection(dataProjection_);
+	//	dataProjection_->setDestinationProjection(canvasProjection_);
+	//	ll = dataProjection_->PC2LL (w.lowerLeft());
+	//	lr.x(w.upperRight().x());
+	//	lr.y(w.lowerLeft().y());
+	//	lr = dataProjection_->PC2LL (lr);
+	//	ur = dataProjection_->PC2LL (w.upperRight());
+	//	ul.x(w.lowerLeft().x());
+	//	ul.y(w.upperRight().y());
+	//	ul = dataProjection_->PC2LL (ul);
+
+	//	ll.x(std::min(ll.x(),ul.x()));
+	//	ll.y(std::min(ll.y(),lr.y()));
+	//	lr.x(std::max(lr.x(),ur.x()));
+	//	lr.y(std::min(ll.y(),lr.y()));
+	//	ur.x(std::max(ur.x(),lr.x()));
+	//	ur.y(std::max(ul.y(),ur.y()));
+	//	ul.x(std::min(ll.x(),ul.x()));
+	//	ul.y(std::max(ul.y(),ur.y()));
+
+	//	ll = canvasProjection_->LL2PC (ll);
+	//	lr = canvasProjection_->LL2PC (lr);
+	//	ur = canvasProjection_->LL2PC (ur);
+	//	ul = canvasProjection_->LL2PC (ul);
+	//	ll.x(std::min(ll.x(),ul.x()));
+	//	ll.y(std::min(ll.y(),lr.y()));
+	//	ur.x(std::max(ur.x(),lr.x()));
+	//	ur.y(std::max(ul.y(),ur.y()));
+	//}
+
+	//QPoint p1((int)((ll.x() - xmin_)*f_ + 0.5)+x0_,
+	//	height_ - y0_ - (int)((ll.y() - ymin_)*f_ + 0.5));
+	//correctScrolling (p1);
+
+	//QPoint p2((int)((ur.x() - xmin_)*f_ + 0.5)+x0_,
+	//	height_ - y0_ - (int)((ur.y() - ymin_)*f_ + 0.5));
+	//correctScrolling (p2);
+
+	//w.x1_ = p1.x();
+	//w.y1_ = p2.y();
+	//w.x2_ = p2.x();
+	//w.y2_ = p1.y();
+}
+
+void TeQtCanvas::mapCWtoDW(TeBox& box)
+{
+	TeCoord2D ll, ur;
+	if(canvasAndDataProjectionEqual_ == false)
+		box = TeRemapBox (box, canvasProjection_, dataProjection_);
+
+	//TeCoord2D boxll = box.lowerLeft();
+	//TeCoord2D boxur = box.upperRight();
+
+	//if(canvasAndDataProjectionEqual_ == false)
+	//{
+	//	canvasProjection_->setDestinationProjection(dataProjection_);
+	//	boxll = canvasProjection_->PC2LL(boxll);
+	//	boxll = dataProjection_->LL2PC(boxll);
+	//	boxur = canvasProjection_->PC2LL(boxur);
+	//	boxur = dataProjection_->LL2PC(boxur);
+	//}
+
+	//box = TeBox(boxll, boxur);
+}
+
+void TeQtCanvas::mapDWtoCW(TeBox& box)
+{
+	TeCoord2D ll, ur;
+	if(canvasAndDataProjectionEqual_ == false)
+		box = TeRemapBox (box, dataProjection_, canvasProjection_);
+
+	//TeCoord2D boxll = box.lowerLeft();
+	//TeCoord2D boxur = box.upperRight();
+
+	//if(canvasAndDataProjectionEqual_ == false)
+	//{
+	//	dataProjection_->setDestinationProjection(canvasProjection_);
+	//	boxll = dataProjection_->PC2LL(boxll);
+	//	boxll = canvasProjection_->LL2PC(boxll);
+	//	boxur = dataProjection_->PC2LL(boxur);
+	//	boxur = canvasProjection_->LL2PC(boxur);
+	//}
+
+	//box = TeBox(boxll, boxur);
+}
+
+void TeQtCanvas::mapCWtoV(TeBox& box)
+{
+	QPoint p1((int)((box.x1() - xmin_)*f_ + 0.5)+x0_,
+		height_ - y0_ - (int)((box.y1() - ymin_)*f_ + 0.5));
+	correctScrolling (p1);
+
+	QPoint p2((int)((box.x2() - xmin_)*f_ + 0.5)+x0_,
+		height_ - y0_ - (int)((box.y2() - ymin_)*f_ + 0.5));
+	correctScrolling (p2);
+
+// swap y value
+	box.x1_ = p1.x();
+	box.y1_ = p2.y();
+	box.x2_ = p2.x();
+	box.y2_ = p1.y();
+}
+
+void TeQtCanvas::mapVtoCW(TeBox& box)
+{
+	// swap y value
+	TeCoord2D w1((box.x1()-x0_)/f_ + xmin_,
+		(height_ - y0_ - box.y2())/f_ + ymin_);
+
+	TeCoord2D w2((box.x2()-x0_)/f_ + xmin_,
+		(height_ - y0_ - box.y1())/f_ + ymin_);
+
+	box = TeBox(w1, w2);
+}
+
+QPoint TeQtCanvas::mapCWtoV(const TeCoord2D& c)
+{
+	QPoint p((int)((c.x() - xmin_)*f_ + 0.5)+x0_,
+		height_ - y0_ - (int)((c.y() - ymin_)*f_ + 0.5));
+	correctScrolling (p);
+
+	return p;
+}
+
+void TeQtCanvas::setPolygonColor (int r, int g, int b)
+{
+	QRgb cor = qRgba(r, g, b, 50);
+	polygonColor_.setRgb(cor);
+	polygonBrush_.setColor (polygonColor_);
+}
+
+void TeQtCanvas::setPolygonStyle (int s, int t)
+{
+	polygonBrush_.setStyle(brushStyleMap_[(TePolyBasicType)s]);
+	polygonTransparency_ = t;
+}
+
+void TeQtCanvas::setPolygonLineColor (int r, int g, int b)
+{
+	QColor cor(r, g, b);
+	polygonPen_.setColor (cor);
+}
+
+void TeQtCanvas::setPolygonLineStyle (int s, int w)
+{
+	polygonPen_.setStyle(penStyleMap_[(TeLnBasicType)s]);
+	polygonPen_.setWidth(w);
+}
+
+void TeQtCanvas::setLineColor (int r, int g, int b)
+{
+	lineColor_.setRgb(r,g,b);
+	linePen_.setColor (lineColor_);
+}
+
+void TeQtCanvas::setLineStyle (int s, int w)
+{
+	_penStyle=(TeLnBasicType)s;
+	if((_penStyle == TeLnTypeArrow) || (_penStyle == TeLnTypeMiddleArrow) )		linePen_.setStyle(Qt::SolidLine);
+	else																		linePen_.setStyle(penStyleMap_[(TeLnBasicType)s]);
+	linePen_.setWidth(w);
+}
+
+void TeQtCanvas::setTextColor (int r, int g, int b)
+{
+	textColor_.setRgb(r,g,b);
+	textPen_.setColor (textColor_);
+}
+
+void TeQtCanvas::setTextStyle (string& family, int size, bool bold, bool italic )
+{
+	textFont_.setFamily (family.c_str());
+	textFont_.setBold (bold);
+	textFont_.setItalic (italic);
+	if(size <= 0)
+		textSize_ = 1;
+	else
+		textSize_ = size;
+
+	if(pixmap0_ && pixmap1_ && (pixmap0_->rect() != pixmap1_->rect()))
+		textSize_ = (int)((double)textSize_ * printerFactor_ + .5);
+
+	textFont_.setPointSize (textSize_);
+}
+
+void TeQtCanvas::setTextSize (int size)
+{
+	if(size <= 0)
+		textSize_ = 1;
+	else
+		textSize_ = size;
+
+	if(pixmap0_ && pixmap1_ && (pixmap0_->rect() != pixmap1_->rect()))
+		textSize_ = (int)((double)textSize_ * printerFactor_ + .5);
+
+	textFont_.setPointSize (textSize_);
+}
+
+
+void TeQtCanvas::plotText (const TeCoord2D &pt, const string &str, double angle, double /*alignh*/, double /*alignv*/)
+{
+	painter_.setPen(textPen_);
+	painter_.setFont(textFont_);
+	QPoint p = mapDWtoV (pt);
+	if (angle != 0.)
+	{
+		painter_.save ();
+		painter_.translate (p.x(),p.y());
+		painter_.rotate (-angle);
+		painter_.drawText (0,-4,QString(str.c_str()));
+		painter_.restore ();
+	}
+	else
+		painter_.drawText (p,QString(str.c_str()));
+}
+
+void TeQtCanvas::plotXorTextDistance(vector<QPointArray> xorPointArrayVec, double unitConv, string unit)
+{
+	if(xorPointArrayVec.empty())
+		return;
+
+	QPoint a = xorPointArrayVec[0].point(0);
+	QPoint b = xorPointArrayVec[0].point(1);
+	TeCoord2D ppa = mapVtoCW(a);
+	TeCoord2D ppb = mapVtoCW(b);
+	double distance = sqrt((ppa.x()-ppb.x()) * (ppa.x()-ppb.x()) + (ppa.y()-ppb.y()) * (ppa.y()-ppb.y()));
+	string s;
+	if(unit == "Decimal Degrees")
+			s = Te2String(distance/unitConv,6) + "(" + unit + ")";
+	else
+			s = Te2String(distance/unitConv,1) + "(" + unit + ")";
+
+	double dy = (double)(b.y() - a.y());
+	double dx = (double)(b.x() - a.x());
+	distance = sqrt(dx * dx + dy * dy);
+	double txHeight = -7.;
+	double dd = distance / 2.;
+	double alfa = atan(dy/dx);
+	if(dx<0 && dy<0)
+		alfa = alfa - TePI;
+	else if(dy>0 && dx<0)
+		alfa = TePI + alfa;
+	double beta = atan(txHeight/dd);
+	double c = dd * cos(beta);
+
+	double gama = alfa + beta;
+	if((dx<0 && dy<0) || (dy>0 && dx<0))
+		gama = alfa - beta;
+
+	double x = c * cos(gama);
+	x += a.x();
+	double y = c * sin(gama);
+	y += a.y();
+	QPoint p((int)x, (int)y);
+	alfa = -alfa * 180. / TePI;
+	if((dx<0 && dy<0) || (dy>0 && dx<0))
+		alfa = 180. + alfa;
+			
+	QPen pen(QColor(239, 111, 63));
+	QFont font("Helvetica", 12);
+	font.setStyleStrategy(QFont::PreferAntialias);
+	font.setBold(true);
+	QFontMetrics fm(font);
+	QRect rect = fm.boundingRect(s.c_str());
+	int xp = - rect.width()/2;
+	int yp = - rect.height()/2;
+
+	plotOnPixmap0();
+	painter_.setRasterOp (Qt::XorROP);
+	painter_.setPen(pen);
+	painter_.setFont(font);
+	if (alfa != 0.)
+	{
+		painter_.save ();
+		painter_.translate (p.x(),p.y());
+		painter_.rotate (-alfa);
+		painter_.drawText(xp, yp, rect.width(), rect.height(), Qt::AlignLeft|Qt::DontClip, s.c_str());
+		painter_.restore ();
+	}
+	else
+	{
+		xp = p.x() - rect.width()/2;
+		yp = p.y() - rect.height()/2;
+		painter_.drawText((int)x, (int)y, rect.width(), rect.height(), Qt::AlignLeft|Qt::DontClip, s.c_str());
+	}
+
+	plotOnWindow();
+	painter_.setRasterOp (Qt::XorROP);
+	painter_.setPen(pen);
+	painter_.setFont(font);
+	painter_.save ();
+	painter_.translate (-offset().x(), -offset().y());
+	if (alfa != 0.)
+	{
+		painter_.translate (p.x(),p.y());
+		painter_.rotate (-alfa);
+		painter_.drawText(xp, yp, rect.width(), rect.height(), Qt::AlignLeft|Qt::DontClip, s.c_str());
+	}
+	else
+	{
+		xp = p.x() - rect.width()/2;
+		yp = p.y() - rect.height()/2;
+		painter_.drawText(xp, yp, rect.width(), rect.height(), Qt::AlignLeft|Qt::DontClip, s.c_str());
+	}
+	painter_.restore ();
+}
+
+void TeQtCanvas::plotText (const TeText& tx, const TeVisual& visual)
+{
+	if(tx.textValue().empty())
+		return;
+
+	int	x, y;
+
+	TeCoord2D pt = tx.location();
+	QPoint p = mapDWtoV (pt);
+	double angle = tx.angle();
+
+	QRect brect = textRect(tx, visual);
+	painter_.setFont(textFont_);
+	painter_.setPen(textPen_);
+	painter_.setRasterOp (Qt::CopyROP);
+	string st = tx.textValue();
+
+	if (angle != 0.)
+	{
+		x = - brect.width()/2;
+		y = - brect.height()/2;
+		painter_.save ();
+		painter_.translate (p.x(), p.y());
+		painter_.rotate (-angle);
+		painter_.drawText(x, y, brect.width(), brect.height(), Qt::AlignLeft|Qt::DontClip, st.c_str());
+		painter_.restore ();
+	}
+	else
+	{
+		x = p.x() - brect.width()/2;
+		y = p.y() - brect.height()/2;
+		painter_.drawText(x, y, brect.width(), brect.height(), Qt::AlignLeft|Qt::DontClip, st.c_str());
+	}
+}
+
+QRect TeQtCanvas::textRect(const TeText& tx, TeVisual visual)
+{
+	QRect rect;
+	if(tx.textValue().empty())
+		return rect;
+
+	int size;
+	int fixedSize = visual.fixedSize(); // font size is fixed
+	if(fixedSize == false && tx.height() > 0.)
+	{
+		TeBox wbox = getDataWorld();
+		TeCoord2D p1(wbox.x1_, wbox.y1_);
+		TeCoord2D p2(double(p1.x() + tx.height()), double(p1.y() + tx.height()));
+		TeBox box(p1, p2);
+		mapDWtoV(box);
+		size = int(box.height());
+		size = (int)((double)size / printerFactor_ + .5);
+	}
+	else
+		size = visual.size(); // font size
+	if(size == 0)
+		size = 1;
+
+	setTextSize(size);
+	textFont_.setFamily (visual.family().c_str());
+
+	TeCoord2D pt = tx.location();
+	QPoint p = mapDWtoV (pt);
+
+	string st = tx.textValue();
+	QFontMetrics fm(textFont_);
+	rect = fm.boundingRect(st.c_str());
+	QPoint cc = rect.center();
+	QPoint tr = p;
+	tr = tr - cc;
+	rect.setRight(rect.right()+tr.x());
+	rect.setLeft(rect.left()+tr.x());
+	rect.setTop(rect.top()+tr.y());
+	rect.setBottom(rect.bottom()+tr.y());
+	return rect;
+}
+
+void TeQtCanvas::plotXorPolyline (QPointArray& PA, bool cdev)
+{
+	QPoint o = offset();
+	QPen pen(QColor("green"));
+
+	plotOnPixmap0();
+	painter_.save ();
+	if(cdev == false)
+		painter_.translate(o.x(), o.y());
+	painter_.setRasterOp (Qt::XorROP);
+	painter_.setPen(pen);
+	painter_.drawPolyline(PA);
+	painter_.restore ();
+
+	plotOnWindow(); // do offset translation on window
+	painter_.save ();
+	if(cdev)
+		painter_.translate(-o.x(), -o.y());
+	painter_.setRasterOp (Qt::XorROP);
+	painter_.setPen(pen);
+	painter_.drawPolyline(PA);
+	painter_.restore ();
+
+	plotOnPixmap0();
+}
+
+void TeQtCanvas::plotTextRects (TeText& tx, TeVisual visual)
+{
+	if(tx.textValue().empty())
+		return;
+
+	QPoint o = offset();
+	QRect rect, l, r, t, b, c;
+
+	TeCoord2D pt = tx.location();
+	plotOnPixmap0();
+	QPoint p = mapDWtoV (pt);
+	double angle = tx.angle();
+
+	rect = textRect(tx, visual);
+	if(angle != 0.)
+	{
+		rect.setTop(rect.top()-p.y());
+		rect.setBottom(rect.bottom()-p.y());
+		rect.setLeft(rect.left()-p.x());
+		rect.setRight(rect.right()-p.x());
+	}
+
+	l = rect;
+	l.setTop(rect.top()+rect.height()/2-3);
+	l.setBottom(rect.top()+rect.height()/2+3);
+	l.setRight(rect.left() + 6);
+
+	r = rect;
+	r.setTop(l.top());
+	r.setBottom(l.bottom());
+	r.setLeft(rect.right() - 6);
+
+	t = rect;
+	t.setLeft(rect.left()+rect.width()/2-3);
+	t.setRight(rect.left()+rect.width()/2+3);
+	t.setBottom(rect.top() + 6);
+
+	b = rect;
+	b.setLeft(t.left());
+	b.setRight(t.right());
+	b.setTop(rect.bottom() - 6);
+
+	c.setLeft(rect.left()+rect.width()/2-3);
+	c.setRight(c.left() + 6);
+	c.setTop(rect.top()+rect.height()/2-3);
+	c.setBottom(c.top() + 6);
+
+	QPointArray parL(4);
+	parL.setPoint(0, l.bottomLeft());
+	parL.setPoint(1, l.bottomRight());
+	parL.setPoint(2, l.topRight());
+	parL.setPoint(3, l.topLeft());
+
+	QPointArray parR(4);
+	parR.setPoint(0, r.bottomRight());
+	parR.setPoint(1, r.bottomLeft());
+	parR.setPoint(2, r.topLeft());
+	parR.setPoint(3, r.topRight());
+
+	QPointArray parT(4);
+	parT.setPoint(0, t.topLeft());
+	parT.setPoint(1, t.bottomLeft());
+	parT.setPoint(2, t.bottomRight());
+	parT.setPoint(3, t.topRight());
+
+	QPointArray parB(4);
+	parB.setPoint(0, b.bottomLeft());
+	parB.setPoint(1, b.topLeft());
+	parB.setPoint(2, b.topRight());
+	parB.setPoint(3, b.bottomRight());
+
+	QBrush	brush(QColor("green"));
+
+	if (angle != 0.)
+	{
+		plotOnPixmap0();
+		painter_.save ();
+		painter_.setRasterOp (Qt::XorROP);
+		painter_.setBrush(Qt::NoBrush);
+		QPen pen(QColor("green"));
+		painter_.setPen(pen);
+		painter_.translate (p.x(), p.y());
+		painter_.rotate (-angle);
+		painter_.drawRect(rect);
+		painter_.drawPolyline(parL);
+		painter_.drawPolyline(parR);
+		painter_.drawPolyline(parT);
+		painter_.drawPolyline(parB);
+		painter_.fillRect(c, brush);
+		painter_.restore ();
+
+		plotOnWindow(); // do offset translation on window
+		painter_.save ();
+		painter_.setRasterOp (Qt::XorROP);
+		painter_.setBrush(Qt::NoBrush);
+		pen = QPen(QColor("green"));
+		painter_.setPen(pen);
+		painter_.translate (p.x()-o.x(), p.y()-o.y());
+		painter_.rotate (-angle);
+		painter_.drawRect(rect);
+		painter_.drawPolyline(parL);
+		painter_.drawPolyline(parR);
+		painter_.drawPolyline(parT);
+		painter_.drawPolyline(parB);
+		painter_.fillRect(c, brush);
+		painter_.restore ();
+	}
+	else
+	{
+		plotOnPixmap0();
+		painter_.save ();
+		painter_.setRasterOp (Qt::XorROP);
+		painter_.setBrush(Qt::NoBrush);
+		QPen pen(QColor("green"));
+		painter_.setPen(pen);
+		painter_.drawRect(rect);
+		painter_.drawPolyline(parL);
+		painter_.drawPolyline(parR);
+		painter_.drawPolyline(parT);
+		painter_.drawPolyline(parB);
+		painter_.fillRect(c, brush);
+		painter_.restore ();
+
+		plotOnWindow(); // do offset translation on window
+		painter_.save ();
+		painter_.setRasterOp (Qt::XorROP);
+		painter_.setBrush(Qt::NoBrush);
+		pen = QPen(QColor("green"));
+		painter_.setPen(pen);
+		painter_.translate (-o.x(), -o.y());
+		painter_.drawRect(rect);
+		painter_.drawPolyline(parL);
+		painter_.drawPolyline(parR);
+		painter_.drawPolyline(parT);
+		painter_.drawPolyline(parB);
+		painter_.fillRect(c, brush);
+		painter_.restore ();
+	}
+	plotOnPixmap0();
+}
+
+void TeQtCanvas::setArcColor (int r, int g, int b)
+{
+	arcColor_.setRgb(r,g,b);
+}
+
+void TeQtCanvas::setArcStyle (int s, int w )
+{
+	arcPen_.setStyle ((Qt::PenStyle)s);
+	arcPen_.setWidth(w);
+}
+
+void TeQtCanvas::setPointColor (int r, int g, int b)
+{
+	pointColor_.setRgb(r,g,b);
+}
+
+void TeQtCanvas::setPointStyle (int s, int w)
+{
+	pointStyle_ = (TePtBasicType) s;
+	pointSize_ = w;
+}
+
+void TeQtCanvas::plotPoint (const TeCoord2D &pt)
+{	
+	pointPen_.setColor (pointColor_);
+	painter_.setPen(pointPen_);
+
+	QPoint p = mapDWtoV (pt);
+
+	plotMark(p,pointStyle_, pointSize_);
+}
+
+void TeQtCanvas::setNodeColor (int r, int g, int b)
+{
+	nodeColor_.setRgb(r,g,b);
+}
+
+void TeQtCanvas::setNodeStyle (int s, int w)
+{
+	nodeStyle_ = s;
+	nodeSize_ = w;
+}
+
+void TeQtCanvas::plotNode (TeNode &pt)
+{	
+	nodePen_.setColor (nodeColor_);
+	painter_.setPen(nodePen_);
+
+	QPoint p = mapDWtoV (pt.location());
+	plotMark(p,nodeStyle_, nodeSize_);
+}
+
+
+void TeQtCanvas::plotMark(QPoint &p, int s, int w)
+{
+	painter_.setPen(pointColor_);
+	if (s == TePtTypePlus)
+	{
+		painter_.drawLine (p.x()-w/2,p.y(),p.x()+w/2,p.y());
+		painter_.drawLine (p.x(),p.y()-w/2,p.x(),p.y()+w/2);
+	}
+	else if (s == TePtTypeStar)
+	{
+		painter_.save ();
+		painter_.translate (p.x(),p.y());
+		painter_.drawLine (0,-w/2,0,w/2);
+		painter_.rotate (45);
+		painter_.drawLine (0,-w/2,0,w/2);
+		painter_.rotate (-90);
+		painter_.drawLine (0,-w/2,0,w/2);
+		painter_.restore ();
+	}
+	else if (s == TePtTypeCircle)
+	{
+		painter_.setBrush(pointColor_);
+		painter_.drawChord (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
+	}
+	else if (s == TePtTypeX)
+	{
+		painter_.drawLine (p.x()-w/2,p.y()-w/2,p.x()+w/2,p.y()+w/2);
+		painter_.drawLine (p.x()-w/2,p.y()+w/2,p.x()+w/2,p.y()-w/2);
+	}
+	else if (s == TePtTypeBox)
+	{
+		painter_.fillRect (p.x()-w/2,p.y()-w/2,w,w,pointColor_);
+	}
+	else if (s == TePtTypeDiamond)
+	{
+		QPointArray pa(5);
+		pa.setPoint(0, p.x()-w/2, p.y());
+		pa.setPoint(1, p.x(), p.y()-w/2);
+		pa.setPoint(2, p.x()+w/2, p.y());
+		pa.setPoint(3, p.x(), p.y()+w/2);
+ 		pa.setPoint(4, p.x()-w/2, p.y());
+		painter_.setBrush(pointColor_);
+		painter_.drawPolygon(pa);
+	}
+	else if (s == TePtTypeHollowCircle)
+	{
+		painter_.drawArc (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
+	}
+	else if (s == TePtTypeHollowBox)
+	{
+		painter_.setBrush(Qt::NoBrush);
+		painter_.drawRect (p.x()-w/2,p.y()-w/2,w,w);
+	}
+	else if (s == TePtTypeHollowDiamond)
+	{
+		painter_.drawLine (p.x()-w/2,p.y(),p.x(),p.y()-w/2);
+		painter_.drawLine (p.x(),p.y()-w/2,p.x()+w/2,p.y());
+		painter_.drawLine (p.x()+w/2,p.y(),p.x(),p.y()+w/2);
+		painter_.drawLine (p.x(),p.y()+w/2,p.x()-w/2,p.y());
+	}
+}
+
+
+void TeQtCanvas::plotCell (TeCell &cell, const bool& restoreBackground)
+{
+	int w, h;
+	TeBox b = getDataWorld ();
+
+	if (!TeIntersects (b, cell.box ()))
+		return;
+
+	QPoint pfrom, pto;
+
+	pfrom = mapDWtoV (cell.box().lowerLeft());
+	pto   = mapDWtoV (cell.box().upperRight());
+
+	painter_.setBrush(polygonBrush_);
+	painter_.setPen (polygonPen_);
+
+	if(!restoreBackground && 
+		(polygonTransparency_ == 0 || 
+		polygonTransparency_ == 100 && polygonBrush_.style() == Qt::NoBrush))
+	{
+		if(polygonTransparency_ == 100 && polygonBrush_.style() != Qt::NoBrush)
+			painter_.setBrush(Qt::NoBrush);
+
+		if((w = pto.x() - pfrom.x()) <= 1)
+			w = 2;
+		if((h = pfrom.y() - pto.y()) <= 1)
+			h = 2;
+
+		painter_.drawRect( pfrom.x(), pto.y(), w+1, h+1);
+	}
+	else if(polygonBrush_.style() == Qt::HorPattern ||
+	polygonBrush_.style() == Qt::VerPattern ||
+	polygonBrush_.style() == Qt::CrossPattern ||
+	polygonBrush_.style() == Qt::BDiagPattern ||
+	polygonBrush_.style() == Qt::FDiagPattern ||
+	polygonBrush_.style() == Qt::DiagCrossPattern)
+	{
+		if((w = pto.x() - pfrom.x()) <= 1)
+			w = 2;
+		if((h = pfrom.y() - pto.y()) <= 1)
+			h = 2;
+
+		painter_.drawRect( pfrom.x(), pto.y(), w+1, h+1);
+	}
+	else
+	{
+		QRect devRect;
+		if(painter_.device() == viewport())
+			devRect = viewport()->rect();
+		else
+			devRect = pixmap0_->rect();
+
+		TeBox box = cell.box();
+		mapDWtoV(box); // data coordinate to viewport coordinate
+		if((w = (int)box.width()) <= 3)
+			w = 4;
+		if((h = (int)box.height()) <= 3)
+			h = 4;	
+
+		QRect polyRect((int)box.x1_, (int)box.y1_, w+1, h+1);
+		QRect interRect = devRect & polyRect;
+		QPoint pOffset = interRect.topLeft();
+
+		int width = interRect.width();
+		int height = interRect.height();
+
+		int r = width%8;
+		if(r)
+			width += (8-r);
+		r = height%8;
+		if(r)
+			height += (8-r);
+
+		QBitmap	bm;
+		bm.resize(width, height);
+		//Fill bitmap with 0-bits: clipping region
+		bm.fill(Qt::color0);
+		QPainter maskPainter(&bm);
+
+		// Draw cell with 1-bits: drawing region
+		QBrush bs(Qt::color1);
+		maskPainter.setBrush(bs);
+		QPen pen(Qt::color1, polygonPen_.width());
+		maskPainter.setPen(pen);
+		maskPainter.translate(-pOffset.x(), -pOffset.y());
+ 		maskPainter.drawRect( interRect );
+		maskPainter.end();
+
+		QRegion clipRegion(bm);
+		clipRegion.translate(pOffset.x(), pOffset.y());
+
+		int transp = 255 - (polygonTransparency_ * 255 / 100);
+		painter_.setClipRegion(clipRegion);
+		if(restoreBackground) // restore background from pixmap2_
+		{
+			painter_.drawPixmap(pOffset.x(), pOffset.y(), *pixmap2_, pOffset.x(),
+				pOffset.y(), interRect.width(), interRect.height());
+		}
+
+		// set alpha buffer and color
+		QImage img(interRect.width(), interRect.height(), 32);
+		unsigned int val = (transp << 24) | (polygonColor_.red() << 16) | (polygonColor_.green() << 8) | polygonColor_.blue();
+		img.fill(val);
+		img.setAlphaBuffer(true);
+
+		// plot transparency
+		painter_.drawPixmap(pOffset.x(), pOffset.y(), img);
+
+
+		// plot contours
+		painter_.setClipping(false);
+		painter_.setBrush(Qt::NoBrush);
+		painter_.drawRect( interRect );
+	}
+}
+//void TeQtCanvas::plotCell (TeCell &cell, const bool& restoreBackground)
+//{
+//	int w, h;
+//	TeBox b = getDataWorld ();
+//
+//	if (!TeIntersects (b, cell.box ()))
+//		return;
+//
+//	QPoint pfrom, pto;
+//
+//	pfrom = mapDWtoV (cell.box().lowerLeft());
+//	pto   = mapDWtoV (cell.box().upperRight());
+//
+//	painter_.setBrush(polygonBrush_);
+//	painter_.setPen (polygonPen_);
+//
+//	if((polygonTransparency_ == 0 && polygonBrush_.style() != Qt::NoBrush) || // 100% opaque or
+//		(polygonTransparency_ == 100 || polygonBrush_.style() == Qt::NoBrush)) // 100% transparent
+//	{
+//		if(polygonTransparency_ == 100 && polygonBrush_.style() != Qt::NoBrush)
+//			painter_.setBrush(Qt::NoBrush);
+//
+//		if((w = pto.x() - pfrom.x()) <= 1)
+//			w = 2;
+//		if((h = pfrom.y() - pto.y()) <= 1)
+//			h = 2;
+//
+//		//painter_.drawRect( pfrom.x()+1, pto.y()+1, w, h);
+//		painter_.drawRect( pfrom.x(), pto.y(), w+1, h+1);
+//	}
+//	else
+//	{
+//		QRect devRect;
+//		if(painter_.device() == viewport())
+//			devRect = viewport()->rect();
+//		else
+//			devRect = pixmap0_->rect();
+//
+//		TeBox box = cell.box();
+//		mapDWtoV(box); // data coordinate to viewport coordinate
+//		if((w = (int)box.width()) <= 3)
+//			w = 4;
+//		if((h = (int)box.height()) <= 3)
+//			h = 4;	
+//
+//		QRect polyRect((int)box.x1_, (int)box.y1_, w+1, h+1);
+//		QRect interRect = devRect & polyRect;
+//		QPoint pOffset = interRect.topLeft();
+//
+//		int width = interRect.width();
+//		int height = interRect.height();
+//
+//		int r = width%8;
+//		if(r)
+//			width += (8-r);
+//		r = height%8;
+//		if(r)
+//			height += (8-r);
+//
+//		QBitmap	bm;
+//		bm.resize(width, height);
+//		//Fill bitmap with 0-bits: clipping region
+//		bm.fill(Qt::color0);
+//		QPainter maskPainter(&bm);
+//
+//		// Draw cell with 1-bits: drawing region
+//		QBrush bs(Qt::color1, polygonBrush_.style());
+//		maskPainter.setBrush(bs);
+//		QPen pen(Qt::color1, polygonPen_.width());
+//		maskPainter.setPen(pen);
+//		maskPainter.translate(-pOffset.x(), -pOffset.y());
+// 		maskPainter.drawRect( interRect );
+//		maskPainter.end();
+//
+//		QRegion clipRegion(bm);
+//		clipRegion.translate(pOffset.x(), pOffset.y());
+//
+//		int transp = 255 - (polygonTransparency_ * 255 / 100);
+//		painter_.setClipRegion(clipRegion);
+//		// restore background from pixmap2_
+//		painter_.drawPixmap(pOffset.x(), pOffset.y(), *pixmap2_, pOffset.x(),
+//			pOffset.y(), interRect.width(), interRect.height());
+//
+//		// set alpha buffer and color
+//		QImage img(interRect.width(), interRect.height(), 32);
+//		unsigned int val = (transp << 24) | (polygonColor_.red() << 16) | (polygonColor_.green() << 8) | polygonColor_.blue();
+//		img.fill(val);
+//		img.setAlphaBuffer(true);
+//
+//		// plot transparency
+//		painter_.drawPixmap(pOffset.x(), pOffset.y(), img);
+//
+//
+//		// plot contours
+//		painter_.setClipping(false);
+//		painter_.setBrush(Qt::NoBrush);
+//		painter_.drawRect( interRect );
+//	}
+//}
+void TeQtCanvas::plotPolygon (const TePolygon &poly, const bool& restoreBackground)
+{
+	if(canvasAndDataProjectionEqual_)
+	{
+		if (!TeIntersects (wc_, poly.box ()))
+			return;
+	}
+	else
+	{
+		TeBox canvasBox = TeRemapBoxPC2Geodetic(wc_, canvasProjection_);
+		TeBox pBox = TeRemapBoxPC2Geodetic(poly.box(), dataProjection_);
+
+		if (!TeIntersects(canvasBox, pBox))
+			return;
+	}
+
+	int		i, k;
+ 	QPoint	p;
+	painter_.setBrush(polygonBrush_);
+	painter_.setPen (polygonPen_);
+
+	if(!restoreBackground && poly.size() == 1 && // no holes
+		(polygonTransparency_ == 0 || 
+		polygonBrush_.style() == Qt::NoBrush))
+		//polygonTransparency_ == 100 && polygonBrush_.style() == Qt::NoBrush))
+	{
+		TeLinearRing ring = poly[0];
+ 		QPointArray parray = mapDWtoV(ring);
+		painter_.drawPolygon( parray );
+	}
+	else if(polygonBrush_.style() == Qt::HorPattern ||
+	polygonBrush_.style() == Qt::VerPattern ||
+	polygonBrush_.style() == Qt::CrossPattern ||
+	polygonBrush_.style() == Qt::BDiagPattern ||
+	polygonBrush_.style() == Qt::FDiagPattern ||
+	polygonBrush_.style() == Qt::DiagCrossPattern)
+	{
+		TeLinearRing ring = poly[0];
+ 		QPointArray parray = mapDWtoV(ring);
+		painter_.drawPolygon( parray );
+	}
+	else
+	{
+		QRect devRect;
+		if(painter_.device() == viewport())
+			devRect = viewport()->rect();
+		else
+			devRect = pixmap0_->rect();
+
+		TeBox box = poly.box();
+		mapDWtoV(box); // data coordinate to viewport coordinate
+		if(box.width() <= 0 || box.height() <= 0)
+			return;
+		int w = (int)box.width();
+		int h = (int)box.height();
+		if(w < 4)
+			w = 4;
+		if(h < 4)
+			h = 4;
+
+		QRect polyRect((int)box.x1_, (int)box.y1_, w, h);
+		if(polyRect.intersects(devRect) == false)
+			return;
+		QRect interRect = devRect & polyRect;
+
+		if(painter_.hasClipping())
+		{
+			QRegion interRegion = QRegion(interRect);
+			QRegion pclip = painter_.clipRegion();
+			interRegion = interRegion.intersect(pclip);
+			interRect = interRegion.boundingRect();
+		}
+
+		QPoint pOffset = interRect.topLeft();
+		int width = interRect.width();
+		int height = interRect.height();
+
+		int r = width%8;
+		if(r)
+			width += (8-r);
+		r = height%8;
+		if(r)
+			height += (8-r);
+
+		if(width == 0)
+			width = 8;
+		if(height == 0)
+			height = 8;
+
+		QBitmap	bm;
+		bm.resize(width, height);
+		//Fill bitmap with 0-bits: clipping region
+		bm.fill(Qt::color0);
+		QPainter maskPainter(&bm);
+
+		TeLinearRing ring = poly[0];
+ 		QPointArray parray = mapDWtoV(ring);
+
+		// Draw polygon with 1-bits: drawing region
+		QBrush bs(Qt::color1);
+		maskPainter.setBrush(bs);
+		QPen pen(Qt::color1, polygonPen_.width());
+		maskPainter.setPen(pen);
+		maskPainter.translate(-pOffset.x(), -pOffset.y());
+ 		maskPainter.drawPolygon( parray );
+
+  		vector<QPointArray> holeVec;
+		if(poly.size() > 1)
+		{
+			// Draw holes with 0-bits: clipping region
+			maskPainter.setBrush(Qt::color0);
+			pen.setColor(Qt::color0);
+			maskPainter.setPen(pen);
+			for ( k = 1; k < (int)poly.size(); k++ )
+  			{
+  				ring = poly[k];
+  				QPointArray hole = mapDWtoV(ring);
+				holeVec.push_back(hole);
+  				maskPainter.drawPolygon( hole );
+  			}
+		}
+		maskPainter.end();
+
+		QRegion clipRegion(bm);
+		clipRegion.translate(pOffset.x(), pOffset.y());
+
+		painter_.setClipRegion(clipRegion);
+
+		if(restoreBackground && pixmap0_->rect() == pixmap2_->rect())
+		{
+			// restore background from pixmap2_
+			painter_.drawPixmap(pOffset.x(), pOffset.y(), *pixmap2_, pOffset.x(),
+				pOffset.y(), interRect.width(), interRect.height());
+		}
+
+		if(polygonBrush_.style() != Qt::CustomPattern)
+		{
+			if(polygonBrush_.style() == Qt::SolidPattern)
+			{
+				int transp = 255 - (polygonTransparency_ * 255 / 100);
+
+				// set alpha buffer and color
+				QImage img(interRect.width(), interRect.height(), 32);
+				unsigned int val = (transp << 24) | (polygonColor_.red() << 16) | (polygonColor_.green() << 8) | polygonColor_.blue();
+				img.fill(val);
+				img.setAlphaBuffer(true);
+
+				// plot transparency
+				painter_.drawPixmap(pOffset.x(), pOffset.y(), img);
+			}
+		}
+		//else // polygonBrush_.style() == Qt::CustomPattern
+		//{
+		//	QImage imag("c:\\terra2\\aplicativos\\ui\\images\\visual.jpg");
+
+		//	if(imag.depth() != 32)
+		//		imag = imag.convertDepth(32);
+		//	int i, j, k;
+		//	unsigned char* u = imag.bits();
+		//	j = imag.width() * imag.height();
+		//	for(i=0; i<j; ++i)
+		//	{
+		//		k = i * 4;
+		//		// if pattern color is white, transparency is total
+		//		if(u[k] == 255 && u[k+1] == 255 && u[k+2] == 255)
+		//			u[k+3] = 0;
+		//		else
+		//		{
+		//			// if polygonColor_ is black, do not change the color
+		//			if(polygonColor_.blue() != 0 || polygonColor_.green() != 0 || polygonColor_.red() != 0)
+		//			{
+		//				int peso = 1;
+		//				u[k] = (u[k] + peso * polygonColor_.blue()) / (1+peso);
+		//				u[k+1] = (u[k+1] + peso * polygonColor_.green()) / (1+peso);
+		//				u[k+2] = (u[k+2] + peso * polygonColor_.red()) / (1+peso);
+		//			}
+		//			u[k+3] = transp;
+		//		}
+		//	}
+		//	imag.setAlphaBuffer(true);
+
+		//	int xp = pOffset.x() / imag.width() * imag.width();
+		//	int yp = pOffset.y() / imag.height() * imag.height();
+
+		//	for(j=0; j<interRect.height()+imag.height(); j+=imag.height())
+		//	{
+		//		for(i=0; i<interRect.width()+imag.width(); i+=imag.width())
+		//			painter_.drawPixmap(xp+i, yp+j, imag);
+		//	}
+		//}
+
+		// plot contours
+		painter_.setClipping(false);
+		painter_.drawPolyline( parray );
+		for(i = 0; i< (int)holeVec.size(); i++)
+			painter_.drawPolyline( holeVec[i] );
+	}
+}
+
+//void TeQtCanvas::plotPolygon (const TePolygon &poly, const bool& restoreBackground)
+//{
+//	if(canvasAndDataProjectionEqual_)
+//	{
+//		if (!TeIntersects (wc_, poly.box ()))
+//			return;
+//	}
+//	else
+//	{
+//		TeBox canvasBox = TeRemapBoxPC2Geodetic(wc_, canvasProjection_);
+//		TeBox pBox = TeRemapBoxPC2Geodetic(poly.box(), dataProjection_);
+//
+//		if (!TeIntersects(canvasBox, pBox))
+//			return;
+//	}
+//
+//	int		i, k;
+// 	QPoint	p;
+//	painter_.setBrush(polygonBrush_);
+//	painter_.setPen (polygonPen_);
+//
+//	if(polygonTransparency_==100 || polygonBrush_.style() == Qt::NoBrush) // contour
+//	{
+//		TeLinearRing ring = poly[0];
+// 		QPointArray parray = mapDWtoV(ring);
+//		painter_.drawPolyline( parray );
+//
+//		for ( k = 1; k < (int)(poly.size()); k++ )
+//  		{
+//  			ring = poly[k];
+//  			QPointArray hole = mapDWtoV(ring);
+//  			painter_.drawPolyline( hole );
+//  		}
+//	}
+//	else if(!restoreBackground && poly.size() == 1 && // no holes
+//		polygonTransparency_ == 0  && // and is opaque
+//		!(polygonBrush_.style() == Qt::NoBrush || // and not is NOBrush or Pattern
+//		polygonBrush_.style() == Qt::CustomPattern))
+//	{
+//		TeLinearRing ring = poly[0];
+// 		QPointArray parray = mapDWtoV(ring);
+//		painter_.drawPolygon( parray );
+//	}
+//	else
+//	{
+//		QRect devRect;
+//		if(painter_.device() == viewport())
+//			devRect = viewport()->rect();
+//		else
+//			devRect = pixmap0_->rect();
+//
+//		TeBox box = poly.box();
+//		mapDWtoV(box); // data coordinate to viewport coordinate
+//		if(box.width() <= 0 || box.height() <= 0)
+//			return;
+//		int w = (int)box.width();
+//		int h = (int)box.height();
+//		if(w < 4)
+//			w = 4;
+//		if(h < 4)
+//			h = 4;
+//
+//		QRect polyRect((int)box.x1_, (int)box.y1_, w, h);
+//		if(polyRect.intersects(devRect) == false)
+//			return;
+//		QRect interRect = devRect & polyRect;
+//
+//		if(painter_.hasClipping())
+//		{
+//			QRegion interRegion = QRegion(interRect);
+//			QRegion pclip = painter_.clipRegion();
+//			interRegion = interRegion.intersect(pclip);
+//			interRect = interRegion.boundingRect();
+//		}
+//
+//		QPoint pOffset = interRect.topLeft();
+//		int width = interRect.width();
+//		int height = interRect.height();
+//
+//		int r = width%8;
+//		if(r)
+//			width += (8-r);
+//		r = height%8;
+//		if(r)
+//			height += (8-r);
+//
+//		if(width == 0)
+//			width = 8;
+//		if(height == 0)
+//			height = 8;
+//
+//		QBitmap	bm;
+//		bm.resize(width, height);
+//		//Fill bitmap with 0-bits: clipping region
+//		bm.fill(Qt::color0);
+//		QPainter maskPainter(&bm);
+//
+//		TeLinearRing ring = poly[0];
+// 		QPointArray parray = mapDWtoV(ring);
+//
+//		// Draw polygon with 1-bits: drawing region
+//		QBrush bs(Qt::color1);
+//		maskPainter.setBrush(bs);
+//		QPen pen(Qt::color1, polygonPen_.width());
+//		maskPainter.setPen(pen);
+//		maskPainter.translate(-pOffset.x(), -pOffset.y());
+// 		maskPainter.drawPolygon( parray );
+//
+//  		vector<QPointArray> holeVec;
+//		if(poly.size() > 1)
+//		{
+//			// Draw holes with 0-bits: clipping region
+//			maskPainter.setBrush(Qt::color0);
+//			pen.setColor(Qt::color0);
+//			maskPainter.setPen(pen);
+//			for ( k = 1; k < (int)poly.size(); k++ )
+//  			{
+//  				ring = poly[k];
+//  				QPointArray hole = mapDWtoV(ring);
+//				holeVec.push_back(hole);
+//  				maskPainter.drawPolygon( hole );
+//  			}
+//		}
+//		maskPainter.end();
+//
+//		QRegion clipRegion(bm);
+//		clipRegion.translate(pOffset.x(), pOffset.y());
+//
+//		painter_.setClipRegion(clipRegion);
+//
+//		if(restoreBackground)
+//		{
+//			if(pixmap0_->rect() == pixmap2_->rect())
+//			{
+//				// restore background from pixmap2_
+//				painter_.drawPixmap(pOffset.x(), pOffset.y(), *pixmap2_, pOffset.x(),
+//					pOffset.y(), interRect.width(), interRect.height());
+//			}
+//		}
+//
+//		if((polygonTransparency_ == 0 && polygonBrush_.style() == Qt::SolidPattern) || !(polygonBrush_.style() == Qt::SolidPattern || polygonBrush_.style() == Qt::CustomPattern))
+//		{
+//			painter_.drawPolygon( parray );
+//		}
+//		else
+//		{
+//			int transp = 255 - (polygonTransparency_ * 255 / 100);
+//
+//			if(polygonBrush_.style() == Qt::SolidPattern)
+//			{
+//				// set alpha buffer and color
+//				QImage img(interRect.width(), interRect.height(), 32);
+//				unsigned int val = (transp << 24) | (polygonColor_.red() << 16) | (polygonColor_.green() << 8) | polygonColor_.blue();
+//				img.fill(val);
+//				img.setAlphaBuffer(true);
+//
+//				// plot transparency
+//				painter_.drawPixmap(pOffset.x(), pOffset.y(), img);
+//			}
+//			else
+//			{
+//				painter_.drawPolygon( parray );
+//			}
+//			//else // polygonBrush_.style() == Qt::CustomPattern
+//			//{
+//			//	QImage imag("c:\\terra2\\aplicativos\\ui\\images\\visual.jpg");
+//	
+//			//	if(imag.depth() != 32)
+//			//		imag = imag.convertDepth(32);
+//			//	int i, j, k;
+//			//	unsigned char* u = imag.bits();
+//			//	j = imag.width() * imag.height();
+//			//	for(i=0; i<j; ++i)
+//			//	{
+//			//		k = i * 4;
+//			//		// if pattern color is white, transparency is total
+//			//		if(u[k] == 255 && u[k+1] == 255 && u[k+2] == 255)
+//			//			u[k+3] = 0;
+//			//		else
+//			//		{
+//			//			// if polygonColor_ is black, do not change the color
+//			//			if(polygonColor_.blue() != 0 || polygonColor_.green() != 0 || polygonColor_.red() != 0)
+//			//			{
+//			//				int peso = 1;
+//			//				u[k] = (u[k] + peso * polygonColor_.blue()) / (1+peso);
+//			//				u[k+1] = (u[k+1] + peso * polygonColor_.green()) / (1+peso);
+//			//				u[k+2] = (u[k+2] + peso * polygonColor_.red()) / (1+peso);
+//			//			}
+//			//			u[k+3] = transp;
+//			//		}
+//			//	}
+//			//	imag.setAlphaBuffer(true);
+//	
+//			//	int xp = pOffset.x() / imag.width() * imag.width();
+//			//	int yp = pOffset.y() / imag.height() * imag.height();
+//	
+//			//	for(j=0; j<interRect.height()+imag.height(); j+=imag.height())
+//			//	{
+//			//		for(i=0; i<interRect.width()+imag.width(); i+=imag.width())
+//			//			painter_.drawPixmap(xp+i, yp+j, imag);
+//			//	}
+//			//}
+//		}
+//
+//		// plot contours
+//		painter_.setClipping(false);
+//		painter_.drawPolyline( parray );
+//		for(i = 0; i< (int)holeVec.size(); i++)
+//			painter_.drawPolyline( holeVec[i] );
+//	}
+//}
+
+QRect TeQtCanvas::getLegendRect (QPoint p, const QPixmap* pix, string tx)
+{
+	QRect rect;
+	TeVisual visual;
+	TeColor cor(0, 0, 0);
+	visual.size(8);
+	visual.bold(true);
+	visual.color(cor);
+	visual.fixedSize(true);
+	setTextColor (cor.red_, cor.green_, cor.blue_);
+	string fam(visual.family());
+	setTextStyle (fam, visual.size(), visual.bold(), visual.italic());
+
+	if(pix)
+	{
+		int x = (int)(p.x()+pix->width()+3.*printerFactor_);
+		int y = (int)(p.y()+13.*printerFactor_);
+		QFontMetrics fm(textFont_);
+		rect = fm.boundingRect(tx.c_str());
+		rect.setRight(rect.right() + x);
+		rect.setLeft(rect.left() + x);
+		rect.setTop(rect.top() + y);
+		rect.setBottom(rect.bottom() + y);
+		QRect prect = pix->rect();
+		prect.setRight(prect.right() + p.x());
+		prect.setLeft(prect.left() + p.x());
+		prect.setTop(prect.top() + p.y());
+		prect.setBottom(prect.bottom() + p.y());
+		rect |= prect;
+	}
+	else
+	{
+		int x = (int)(p.x()+1.*printerFactor_);
+		int y = (int)(p.y()+13.*printerFactor_);
+		QFontMetrics fm(textFont_);
+		rect = fm.boundingRect(tx.c_str());
+		rect = fm.boundingRect(tx.c_str());
+		rect.setRight(rect.right() + x);
+		rect.setLeft(rect.left() + x);
+		rect.setTop(rect.top() + y);
+		rect.setBottom(rect.bottom() + y);
+	}
+	return rect;
+}
+
+void TeQtCanvas::plotLegend (QPoint p, const QPixmap* pix, string tx)
+{
+	TeVisual visual;
+	TeColor cor(0, 0, 0);
+	visual.fixedSize(true);
+	visual.size(8);
+	visual.bold(true);
+	visual.color(cor);
+	setTextColor (cor.red_, cor.green_, cor.blue_);
+	string fam = visual.family();
+	setTextStyle (fam, visual.size(), visual.bold(), visual.italic());
+	painter_.setFont(textFont_);
+	painter_.setPen(textPen_);
+
+	if(pix)
+	{
+		int x = (int)(p.x()+pix->width()+3.*printerFactor_);
+		int y = (int)(p.y()+13.*printerFactor_);
+		bitBlt (painter_.device(), p.x(), p.y(), pix, 0, 0, pix->width(), pix->height(), Qt::CopyROP, true);
+		painter_.drawText(x, y, tx.c_str());
+	}
+	else
+	{
+		int x = (int)(p.x()+1.*printerFactor_);
+		int y = (int)(p.y()+13.*printerFactor_);
+		painter_.drawText(x, y, tx.c_str());
+	}
+}
+
+bool TeQtCanvas::locateGraphicScale(const QPoint& p)
+{
+	return graphicScaleRect_.contains(p);
+}
+
+void TeQtCanvas::plotLegend (const QPoint& p, const TeColor& cor, const string& tx)
+{
+	TeVisual  v;
+	TeColor c = cor;
+	v.color(c);
+	c.init(0, 0, 0);
+	v.contourColor(c);
+	int	ww = (int)(21. * printerFactor_);
+	int	hh = (int)(16. * printerFactor_);
+
+	drawPolygonRep(p, ww, hh, v);
+
+	QPoint pos = p;
+	pos.setX(pos.x() + ww);
+	pos.setX((int)(pos.x() + 3.*printerFactor_));
+	pos.setY((int)(pos.y()+13.*printerFactor_));
+	painter_.setPen(textPen_);
+	painter_.drawText(pos, tx.c_str());
+}
+
+void TeQtCanvas::plotLegend (const QPoint& p, TeLegendEntry* leg, const string& tx)
+{
+	TeVisual visual;
+	TeColor cor(0, 0, 0);
+	visual.fixedSize(true);
+	visual.size(8);
+	visual.bold(true);
+	visual.color(cor);
+	setTextColor (cor.red_, cor.green_, cor.blue_);
+	string fam = visual.family();
+	setTextStyle (fam, visual.size(), visual.bold(), visual.italic());
+	painter_.setFont(textFont_);
+	painter_.setPen(textPen_);
+	QPoint pos = p;
+
+	int	ww = (int)(21. * printerFactor_);
+	int	hh = (int)(16. * printerFactor_);
+
+	if(leg == 0)
+	{
+		pos.setX(pos.x() + ww);
+		pos.setX((int)(pos.x() + 3.*printerFactor_));
+		pos.setY((int)(p.y()+13.*printerFactor_));
+		painter_.drawText(pos.x(), pos.y(), tx.c_str());
+		return;
+	}
+
+	// TePOLYGONS = 1, TeLINES = 2, TePOINTS = 4, TeCELLS = 256
+	bool hasPolygons = true;
+	bool hasCells = true;
+	bool hasLines = true;
+	bool hasPoints = true;
+
+	string s = leg->to();
+	if(s.find("mean = ") == string::npos)
+	{
+		TeGeomRepVisualMap& vm = leg->getVisualMap();
+		if(vm.find(TePOLYGONS) == vm.end())
+		{
+			hasPolygons = false;
+			hasCells = false;
+		}
+		if(vm.find(TeLINES) == vm.end())
+			hasLines = false;
+		if(vm.find(TePOINTS) == vm.end())
+			hasPoints = false;
+
+		if ((hasPolygons || hasCells) && (hasLines == false) && (hasPoints == false))
+			drawPolygonRep(pos, ww, hh, *(vm[TePOLYGONS]));
+		else if ((hasPolygons || hasCells) && (hasLines == true) && (hasPoints == false))
+		{
+			drawPolygonRep(pos, ww, hh, *(vm[TePOLYGONS]));
+			pos.setX(pos.x() + ww);
+			drawLineRep(pos, *(vm[TeLINES]));
+		}
+		else if ((hasPolygons || hasCells) && (hasLines == false) && (hasPoints == true))
+		{
+			drawPolygonRep(pos, ww, hh, *(vm[TePOLYGONS]));
+			pos.setX(pos.x() + ww);
+			drawPointRep(pos, *(vm[TePOINTS]));
+		}
+		else if ((hasPolygons || hasCells) && (hasLines == true) && (hasPoints == true))
+		{
+			drawPolygonRep(pos, ww, hh, *(vm[TePOLYGONS]));
+			pos.setX(pos.x() + ww);
+			drawLineRep(pos, *(vm[TeLINES]));
+			pos.setX(pos.x() + ww);
+			drawPointRep(pos, *(vm[TePOINTS]));
+		}
+		else if (hasPolygons == false && hasCells == false && hasLines == true && hasPoints == false)
+			drawLineRep(pos, *(vm[TeLINES]));
+		else if (hasPolygons == false && hasCells == false && hasLines == false && hasPoints == true)
+			drawPointRep(pos, *(vm[TePOINTS]));
+		else if (hasPolygons == false && hasCells == false && hasLines == true && hasPoints == true)
+		{
+			drawLineRep(pos, *(vm[TeLINES]));
+			pos.setX(pos.x() + ww);
+			drawPointRep(pos, *(vm[TePOINTS]));
+		}
+	}
+
+	pos.setX(pos.x() + ww);
+	pos.setX((int)(pos.x() + 3.*printerFactor_));
+	pos.setY((int)(p.y()+13.*printerFactor_));
+	painter_.setPen(textPen_);
+	painter_.drawText(pos, tx.c_str());
+}
+
+void TeQtCanvas::drawPolygonRep (QPoint p, int w, int h, TeVisual& v)
+{
+	QBrush brush;
+	brush.setStyle(brushStyleMap_[(TePolyBasicType)v.style()]);
+	QColor bcor(v.color().red_, v.color().green_, v.color().blue_);
+	brush.setColor(bcor);
+	painter_.setBrush(brush);
+
+	QPen pen;
+	pen.setStyle(penStyleMap_[(TeLnBasicType)v.contourStyle()]);
+	QColor pcor(v.contourColor().red_, v.contourColor().green_, v.contourColor().blue_);
+	pen.setColor(pcor);
+	int pwidth = (Qt::PenStyle) v.contourWidth();
+	pen.setWidth (pwidth);
+	painter_.setPen(pen);
+
+	QRect rect(p.x(), (int)(p.y()+2.*printerFactor_), w, (int)(h-2.*printerFactor_));
+
+
+	// set alpha buffer and color
+    int transp = v.transparency();
+	if( (transp !=0) && ((TePolyBasicType)v.style() == TePolyTypeFill) )
+	{
+		transp = (int)(2.55 * (double)(100 - transp));
+		QImage img(rect.width(), rect.height(), 32);
+		unsigned int val = (transp << 24) | (bcor.red() << 16) | (bcor.green() << 8) | bcor.blue();
+		img.fill(val);
+		img.setAlphaBuffer(true);
+		// plot transparency
+		painter_.drawPixmap(rect.x(), rect.y(), img);
+	}
+	else	painter_.fillRect(rect,brush);
+	painter_.setBrush(Qt::NoBrush);
+	painter_.drawRect(rect);
+}
+
+void TeQtCanvas::drawLineRep (QPoint p, TeVisual& v)
+{
+	QPen		pen;
+	QColor		cor;
+	TeColor		tcor;
+	uint		width;
+
+	tcor = v.color();
+	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
+	pen.setColor(cor);
+	pen.setStyle(penStyleMap_[(TeLnBasicType)v.style()]);
+	width = v.width();
+	pen.setWidth (width);
+	painter_.setPen(pen);
+
+	painter_.moveTo((int)(p.x()+1.*printerFactor_), (int)(p.y()+5.*printerFactor_));
+	painter_.lineTo((int)(p.x()+3.*printerFactor_), (int)(p.y()+5.*printerFactor_));
+	painter_.lineTo((int)(p.x()+6.*printerFactor_), (int)(p.y()+6.*printerFactor_));
+	painter_.lineTo((int)(p.x()+8.*printerFactor_), (int)(p.y()+8.*printerFactor_));
+	painter_.lineTo((int)(p.x()+10.*printerFactor_), (int)(p.y()+9.*printerFactor_));
+	painter_.lineTo((int)(p.x()+14.*printerFactor_), (int)(p.y()+10.*printerFactor_));
+	painter_.lineTo((int)(p.x()+16.*printerFactor_), (int)(p.y()+10.*printerFactor_));
+	painter_.lineTo((int)(p.x()+18.*printerFactor_), (int)(p.y()+9.*printerFactor_));
+	painter_.lineTo((int)(p.x()+19.*printerFactor_), (int)(p.y()+9.*printerFactor_));
+	painter_.moveTo((int)(p.x()+2.*printerFactor_), (int)(p.y()+13.*printerFactor_));
+	painter_.lineTo((int)(p.x()+3.*printerFactor_), (int)(p.y()+12.*printerFactor_));
+	painter_.lineTo((int)(p.x()+5.*printerFactor_), (int)(p.y()+11.*printerFactor_));
+	painter_.lineTo((int)(p.x()+6.*printerFactor_), (int)(p.y()+11.*printerFactor_));
+	painter_.lineTo((int)(p.x()+9.*printerFactor_), (int)(p.y()+10.*printerFactor_));
+	painter_.lineTo((int)(p.x()+10.*printerFactor_), (int)(p.y()+9.*printerFactor_));
+}
+
+void TeQtCanvas::drawPointRep (QPoint pp, TeVisual& v)
+{
+	QColor		cor;
+	TeColor		tcor;
+
+	tcor = v.color();
+	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
+	int s = v.style();
+	double	w = (double)v.size() * printerFactor_;
+
+	QPoint p = pp;
+	QPoint offset((int)(10.*printerFactor_), (int)(7.*printerFactor_));
+	p += offset;
+
+	painter_.setPen(cor);
+	if (s == TePtTypePlus)
+	{
+		painter_.drawLine ((int)(p.x()-w/2),p.y(),(int)(p.x()+w/2.),p.y());
+		painter_.drawLine (p.x(),(int)(p.y()-w/2.),p.x(),(int)(p.y()+w/2.));
+	}
+	else if (s == TePtTypeStar)
+	{
+		painter_.save ();
+		painter_.translate (p.x(),p.y());
+		painter_.drawLine (0,(int)(-w/2.),0,(int)(w/2.));
+		painter_.rotate (45);
+		painter_.drawLine (0,(int)(-w/2.),0,(int)(w/2.));
+		painter_.rotate (-90);
+		painter_.drawLine (0,(int)(-w/2.),0,(int)(w/2.));
+		painter_.restore ();
+	}
+	else if (s == TePtTypeCircle)
+	{
+		painter_.setBrush(cor);
+		painter_.drawChord ((int)(p.x()-w/2.),(int)(p.y()-w/2.),(int)w,(int)w,0,360*16);
+	}
+	else if (s == TePtTypeX)
+	{
+		painter_.drawLine ((int)(p.x()-w/2.),(int)(p.y()-w/2.),(int)(p.x()+w/2.),(int)(p.y()+w/2.));
+		painter_.drawLine ((int)(p.x()-w/2.),(int)(p.y()+w/2.),(int)(p.x()+w/2.),(int)(p.y()-w/2.));
+	}
+	else if (s == TePtTypeBox)
+	{
+		painter_.fillRect ((int)(p.x()-w/2.),(int)(p.y()-w/2.),(int)w,(int)w,cor);
+	}
+	else if (s == TePtTypeDiamond)
+	{
+		QPointArray pa(5);
+		pa.setPoint(0, (int)(p.x()-w/2.), p.y());
+		pa.setPoint(1, p.x(), (int)(p.y()-w/2.));
+		pa.setPoint(2, (int)(p.x()+w/2.), p.y());
+		pa.setPoint(3, p.x(), (int)(p.y()+w/2.));
+ 		pa.setPoint(4, (int)(p.x()-w/2.), p.y());
+		painter_.setBrush(cor);
+		painter_.drawPolygon(pa);
+	}
+	else if (s == TePtTypeHollowCircle)
+	{
+		painter_.drawArc ((int)(p.x()-w/2.),(int)(p.y()-w/2.),(int)w,(int)w,0,360*16);
+	}
+	else if (s == TePtTypeHollowBox)
+	{
+		painter_.setBrush(Qt::NoBrush);
+		painter_.drawRect ((int)(p.x()-w/2.),(int)(p.y()-w/2.),(int)w,(int)w);
+	}
+	else if (s == TePtTypeHollowDiamond)
+	{
+		painter_.drawLine ((int)(p.x()-w/2.),p.y(),p.x(),(int)(p.y()-w/2.));
+		painter_.drawLine (p.x(),(int)(p.y()-w/2.),(int)(p.x()+w/2.),p.y());
+		painter_.drawLine ((int)(p.x()+w/2.),p.y(),p.x(),(int)(p.y()+w/2.));
+		painter_.drawLine (p.x(),(int)(p.y()+w/2.),(int)(p.x()-w/2.),p.y());
+	}
+}
+
+void TeQtCanvas::plotLine (TeLine2D &line)
+{
+	TeBox b = getDataWorld ();
+	if (!TeIntersects (b, line.box ()))
+		return;
+	
+	linePen_.setColor (lineColor_);
+	painter_.setPen(linePen_);
+
+	QPointArray a = mapDWtoV(line);
+	painter_.drawPolyline( a );
+	if(_penStyle == TeLnTypeArrow)
+	{
+		plotArrow(a);
+	}else if(_penStyle == TeLnTypeMiddleArrow)
+	{
+		plotMiddleLineArrow(line,a);
+	}
+}
+
+void TeQtCanvas::plotArrow(QPointArray a)
+{
+	QPoint first=a.point(0);
+	QPoint init=a.point(a.size() - 2);
+	QPoint end=a.point(a.size() - 1);
+
+	if(TeDistance(TeCoord2D(first.x(),first.y()),TeCoord2D(end.x(),end.y()))>10)	
+		{
+			QPointArray a = getArrow(init,end,10);
+			painter_.setBrush(Qt::SolidPattern);
+			painter_.setBrush(lineColor_);
+			painter_.drawPolygon( a );
+		}
+}
+
+void TeQtCanvas::plotMiddleLineArrow(const TeLine2D &lne, QPointArray a)
+{
+		int seg;
+		TeCoord2D	center;
+		TeCoord2D	previousCoord;
+		QPoint		first=a.point(0);
+		QPoint		end=a.point(a.size() - 1);
+		TeLine2D	ln;
+
+		ln.copyElements(lne);
+		TeFindCentroid(lne,center);
+		TeLocateLineSegment(center,ln,seg,1.0);
+		previousCoord=lne[seg];
+		QPoint pCenter=mapDWtoV(center);
+		QPoint pPrevious=mapDWtoV(previousCoord);
+		if(TeDistance(TeCoord2D(first.x(),first.y()),TeCoord2D(end.x(),end.y()))>20)	
+		{
+			plotMiddleLineArrow(pPrevious,pCenter);
+		}
+}
+
+void TeQtCanvas::plotMiddleLineArrow(QPoint ptBegin, QPoint ptEnd)
+{
+	QPointArray a = getArrow(ptBegin,ptEnd,10);
+	painter_.setBrush(Qt::SolidPattern);
+	painter_.setBrush(lineColor_);
+	painter_.drawPolygon( a );
+}
+
+
+QPointArray	TeQtCanvas::getArrow(QPoint ptBegin, QPoint ptEnd, double size)
+{
+  QPointArray	points(4);
+  double	slopy , cosy , siny;
+	
+  
+  slopy = atan2((double)( ptBegin.y() - ptEnd.y() ),(double)( ptBegin.x() - ptEnd.x() ) );
+  cosy = cos( slopy );
+  siny = sin( slopy ); 
+
+  points[0]=QPoint(ptEnd.x(),ptEnd.y());
+  points[1]=QPoint(ptEnd.x() - int(-size*cosy-(size/2.0*siny)),ptEnd.y() - int(-size*siny+(size/2.0*cosy )));
+  points[2]=QPoint(ptEnd.x() - int(-size*cosy+(size/2.0*siny)),ptEnd.y() + int(size/2.0*cosy+size*siny));
+  points[3]=QPoint(ptEnd.x(),ptEnd.y());
+  return points;
+}
+
+void TeQtCanvas::plotArc (TeArc &arc)
+{
+	TeBox b = getDataWorld ();
+	if (!TeIntersects (b, arc.box ()))
+		return;
+	
+	arcPen_.setColor (arcColor_);
+	painter_.setPen(arcPen_);
+
+	QPoint pfrom, pto;
+
+	pfrom = mapDWtoV (arc.fromNode().location());
+	pto   = mapDWtoV (arc.toNode().location());
+
+	painter_.drawLine( pfrom, pto );
+
+	double ang = atan2 (double(pfrom.y()-pto.y()), double (pfrom.x()-pto.x()));
+	QPoint pm((int)((pto.x()+pfrom.x())/2.+0.5),(int)((pto.y()+pfrom.y())/2.+0.5));
+	
+	double ang1 = ang + 25.*TeCDR;
+	double ang2 = ang - 25.*TeCDR;
+	QPoint	p1((int)(10.*cos(ang1)+0.5),(int)(10.*sin(ang1)+.5)),
+			p2((int)(10.*cos(ang2)+0.5),(int)(10.*sin(ang2)+.5));
+	p1 += pm;
+	p2 += pm;
+	painter_.drawLine( pm, p1 );
+	painter_.drawLine( pm, p2 );
+	painter_.drawLine( p1, p2 );
+
+}
+
+void TeQtCanvas::plotPie (double x, double y, double w, double h, double a, double alen)
+{
+	int	dx, dy, dw, dh, da, df;
+
+	pieBrush_.setColor (pieColor_);
+	painter_.setBrush(pieBrush_);
+	painter_.setPen(linePen_);
+
+	TeCoord2D p(x, y);
+	QPoint	qp = mapDWtoV(p);
+	dx = qp.x();
+	dy = qp.y();
+
+	TeCoord2D pt(x+w, y+h);
+	QPoint	qpt = mapDWtoV(pt);
+	dw = abs(qpt.x() - dx);
+	dh = abs(qpt.y() - dy);
+
+	da = (int)(a * 16);
+	df = (int)(alen * 16);
+	painter_.drawPie(dx, dy-dh, dw, dh, da, df);
+}
+
+void TeQtCanvas::setPieColor (int r, int g, int b)
+{
+	pieColor_.setRgb(r, g, b);
+	pieBrush_.setStyle(Qt::SolidPattern);
+}
+
+void TeQtCanvas::plotRect (QRect& rect)
+{
+	rectBrush_.setColor (rectColor_);
+	painter_.setBrush(Qt::NoBrush);
+	painter_.setPen(linePen_);
+	painter_.drawRect(rect);
+}
+
+void TeQtCanvas::plotRect (double x, double y, double w, double h, int transp, bool legend)
+{
+	if(pixmap1_ == 0)
+		return;
+
+	int	dx, dy, dw, dh;
+
+	TeCoord2D p(x, y);
+	QPoint	qp;
+	if(legend)
+		qp = QPoint((int)p.x(), (int)p.y());
+	else
+		qp = mapDWtoV(p);
+	dx = qp.x();
+	dy = qp.y();
+
+	TeCoord2D pt(x+w, y+h);
+	QPoint	qpt;
+	if(legend)
+	{
+		qpt = QPoint((int)pt.x(), (int)pt.y());
+		dw = abs(qpt.x() - dx);
+		dh = abs(qpt.y() - dy);
+	}
+	else
+	{	
+//		qpt = mapDWtoV(pt);
+		TeBox b = wc_;
+		mapCWtoDW(b);
+		TeCoord2D center = b.center();
+		TeCoord2D cc = center;
+		cc.x_ += w;
+		dw = abs(mapDWtoV(center).x() - mapDWtoV(cc).x());
+		cc = center;
+		cc.y_ += h;
+		dh = abs(mapDWtoV(center).y() - mapDWtoV(cc).y());
+	}
+
+	if(transp == 0)
+	{
+		rectBrush_.setColor (rectColor_);
+		painter_.setBrush(rectBrush_);
+		painter_.setPen(linePen_);
+		painter_.drawRect(dx, dy-dh, dw, dh);
+	}
+	else
+	{
+		double alpha = transp / 100.;
+		double beta = 1 - alpha;
+		double red = rectColor_.red() * beta;
+		double green = rectColor_.green() * beta;
+		double blue = rectColor_.blue() * beta;
+
+		int r = dw%8;
+		if(r)
+			dw += (8-r);
+		r = dh%8;
+		if(r)
+			dh += (8-r);
+
+		QImage ima = pixmap0_->convertToImage();
+		QImage imap(dw, dh, 32);
+		int i, j;
+		int x = qp.x();
+		int	y = qp.y() - dh;
+		for(i=x; i-x<dw && i<ima.width(); i++)
+		{
+			if(i < 0)
+				continue;
+			for(j=y; j-y<dh && j<ima.height(); j++)
+			{
+				if(j < 0)
+					continue;
+				QRgb v = ima.pixel(i, j);
+				int r = (int)((double)qRed(v) * alpha + red);
+				int g = (int)((double)qGreen(v) * alpha + green);
+				int b = (int)((double)qBlue(v) * alpha + blue);
+				QRgb t = qRgb(r, g, b);
+				imap.setPixel(i-x, j-y, t);
+			}
+		}
+
+		QPixmap pm(dw, dh);
+		pm.convertFromImage(imap);
+		QRect rec = pm.rect();
+		rec &= painter_.viewport();
+		bitBlt (painter_.device(), x, y, &pm, 0, 0, rec.width(), rec.height(), Qt::CopyROP, true);
+	}
+}
+
+void TeQtCanvas::setRectColor (int r, int g, int b)
+{
+	rectColor_.setRgb(r, g, b);
+	rectBrush_.setStyle(Qt::SolidPattern);
+}
+
+static inline int blendComponent( int back, int fore, int falpha )
+{
+	int balpha = 255 - falpha;
+    int a = falpha + balpha -(falpha*balpha)/255;
+    return (falpha*fore + balpha*back -(balpha*falpha*fore)/255)/a;  
+}
+
+int d2dms(double v)
+{
+    double av;
+    int d, m, s;
+    av = fabs(v);
+    d = (int)av;
+    av = av - d;
+    av = av * 60;
+    m = (int)av;
+    av = av - m;
+    av = av * 60;
+    s = (int)av;
+    int gms = d * 10000 + m * 100 + s ;
+	return gms;
+}
+
+double dms2d (int vs)
+{
+	int v = abs(vs);
+	int dd = v/10000;
+	int dm = (v-dd*10000)/100;
+	int ds = v - dd*10000 - dm*100;
+	double d = dd + dm/60. + ds/3600.;
+	if (vs < 0)
+		d = -d;
+	return d;
+}
+
+string buildMosaicName (int x, int y, int delta)
+{
+	int		lad,lam,las,lod,lom,los,dd,dm,ds;
+	char	hemis,hemiss;
+	int		lx1,ly1;
+
+	hemis = 'S';
+	if (y>=0)hemis = 'N';
+	ly1 = abs(y);
+	lad = ly1/3600;
+	lam = (ly1-lad*3600)/60;
+	las = ly1 - lad*3600 - lam*60;
+
+	hemiss = 'O';
+	if (x>=0)hemis = 'E';
+	lx1 = abs(x);
+	lod = lx1/3600;
+	lom = (lx1-lod*3600)/60;
+	los = lx1 - lod*3600 - lom*60;
+
+	dd = delta/10000;
+	dm = (delta-dd*10000)/100;
+	ds = delta - dd*10000 - dm*100;
+
+	char name[128];
+	sprintf(name,"%c%02d%02d%02d%c%02d%02d%02d%02d%02d%02d",
+		hemis,lad,lam,las,hemiss,lod,lom,los,dd,dm,ds);
+	return string(name);
+}
+
+void TeQtCanvas::copyPixmap0ToPrinter()
+{
+	if (pixmap0_)
+	{
+		QPrinter printer;
+		if (printer.setup())
+		{
+			QPainter p(&printer);
+
+			QPaintDevice* dev = painter_.device();
+			if(dev == pixmap0_)
+				painter_.end();
+
+			p.drawPixmap(0, 0, *pixmap0_);
+			p.flush();
+			p.end();
+
+			if(dev && painter_.device() == 0)
+				painter_.begin(dev);
+		}
+	}
+}
+
+void TeQtCanvas::copyPixmapToWindow(QPixmap* p, int ulx, int uly, int w, int h)
+{
+	bitBlt (viewport(),ulx,uly,p,ulx,uly,w,h,Qt::CopyROP,true);
+}
+
+void TeQtCanvas::copyPixmap0To(QPaintDevice* dev)
+{
+	if (pixmap0_)
+	{
+		bitBlt (dev,0,0,pixmap0_,0,0,width_,height_,Qt::CopyROP,true);
+	}
+}
+
+void TeQtCanvas::copyPixmap0ToWindow()
+{
+	if (pixmap0_)
+	{
+		bitBlt (viewport(),0,0,pixmap0_,contentsX(),contentsY(),viewport()->rect().width(),viewport()->rect().height(),Qt::CopyROP,true);
+	}
+}
+
+void TeQtCanvas::copyPixmap1ToWindow()
+{
+	if (pixmap1_)
+	{
+		bitBlt (viewport(),0,0,pixmap1_,contentsX(),contentsY(),viewport()->rect().width(),viewport()->rect().height(),Qt::CopyROP,true);
+	}
+}
+
+void TeQtCanvas::copyPixmap0ToWindow(int ulx, int uly, int w, int h)
+{
+	if (pixmap0_)
+	{
+		bitBlt (viewport(),ulx,uly,pixmap0_,ulx,uly,w,h,Qt::CopyROP,true);
+	}
+}
+
+void TeQtCanvas::copyPanArea(int x, int y)
+{
+	if (pixmap0_)
+	{
+		QPaintDevice* dev = painter_.device();
+		if(dev)
+			painter_.end();
+		painter_.begin(viewport());
+		QRect a, b;
+		int vw = viewport()->width();
+		int vh = viewport()->height();
+
+		int xi = horizontalScrollBar()->value();
+		int yi = verticalScrollBar()->value();
+		bitBlt (viewport(), 0, 0, pixmap1_, xi+x, yi+y, vw, vh, Qt::CopyROP, true);
+
+		if((xi + x + vw) > contentsWidth())
+		{
+			int ww =  (xi + x + vw) - contentsWidth();
+			int xii = vw - ww;
+			QRect a(xii, 0, vw - xii, vh);
+			painter_.fillRect(a, painter_.backgroundColor());
+		}
+		if((xi + x) < 0)
+		{
+			QRect a(0, 0, -(xi + x), vh);
+			painter_.fillRect(a, painter_.backgroundColor());
+		}
+		if((yi + y + vh) > contentsHeight())
+		{
+			int hh =  (yi + y + vh) - contentsHeight();
+			int yii = vh - hh;
+			QRect a(0, yii, vw, vh - yii);
+			painter_.fillRect(a, painter_.backgroundColor());
+		}
+		if((yi + y) < 0)
+		{
+			QRect a(0, 0, vw, -(yi + y));
+			painter_.fillRect(a, painter_.backgroundColor());
+		}
+
+		painter_.end();
+		if(dev)
+			painter_.begin(dev);
+	}
+}
+
+void TeQtCanvas::copyPixmap0ToPixmap1()
+{
+	if (pixmap1_ && pixmap0_)
+		bitBlt (pixmap1_,0,0,pixmap0_,0,0,width_,height_,Qt::CopyROP,true);
+}
+
+void TeQtCanvas::copyPixmap0ToPixmap1(int ulx, int uly, int w, int h)
+{
+	if (pixmap1_ && pixmap0_)
+		bitBlt (pixmap1_,ulx,uly,pixmap0_,ulx,uly,w,h,Qt::CopyROP,true);
+}
+
+void TeQtCanvas::copyPixmap1ToPixmap0()
+{
+	if (pixmap1_ && pixmap0_)
+		bitBlt (pixmap0_,0,0,pixmap1_,0,0,width_,height_,Qt::CopyROP,true);
+}
+
+void TeQtCanvas::copyPixmap1ToPixmap0(int ulx, int uly, int w, int h)
+{
+	if (pixmap1_ && pixmap0_)
+		bitBlt (pixmap0_,ulx,uly,pixmap1_,ulx,uly,w,h,Qt::CopyROP,true);
+}
+
+void TeQtCanvas::copyPixmap1ToPixmap2()
+{
+	if (pixmap1_ && pixmap2_)
+	{
+		bitBlt (pixmap2_,0,0,pixmap1_,0,0,width_,height_,Qt::CopyROP,true);
+		qimage_.reset();
+		qimage_ = pixmap2_->convertToImage();
+	}
+}
+
+void TeQtCanvas::copyPixmap1ToPixmap2(int ulx, int uly, int w, int h)
+{
+	if (pixmap1_ && pixmap2_)
+	{
+		bitBlt (pixmap2_,ulx,uly,pixmap1_,ulx,uly,w,h,Qt::CopyROP,true);
+		qimage_.reset();
+		qimage_ = pixmap2_->convertToImage();
+	}
+}
+
+void TeQtCanvas::copyPixmap2ToPixmap1()
+{
+	if (pixmap1_ && pixmap2_)
+		bitBlt (pixmap1_,0,0,pixmap2_,0,0,width_,height_,Qt::CopyROP,true);
+}
+
+void TeQtCanvas::copyPixmap2ToPixmap1(int ulx, int uly, int w, int h)
+{
+	if (pixmap1_ && pixmap2_)
+		bitBlt (pixmap1_,ulx,uly,pixmap2_,ulx,uly,w,h,Qt::CopyROP,true);
+}
+
+void TeQtCanvas::plotRaster(TeRaster* raster, TeRasterTransform* transf, TeQtProgress *progress)
+{
+	int dt = CLOCKS_PER_SEC/2;
+	int dt2 = CLOCKS_PER_SEC; //* .000001;
+	clock_t	t0, t1, t2;
+	params_.fileName_ = raster->params().fileName_;
+
+	if (buildRaster ())
+	{
+		// Calculate the box of input image that intersects the box of the canvas
+		TeBox bboxBackRaster = backRaster_->params().boundingBox();		
+		TeBox bboxSearched = TeRemapBox(bboxBackRaster, backRaster_->projection(), raster->projection());
+		TeBox bboxIntersection;
+		if (!TeIntersection (raster->params().boundingBox(),bboxSearched,bboxIntersection))
+			return ;			// no intersection 
+
+		// fill QImage with zero (100% of transparency)
+		TeDecoderQtImage* decqt = reinterpret_cast<TeDecoderQtImage*>(backRaster_->decoder());
+		decqt->getImage()->setAlphaBuffer(false);
+		decqt->setAlphaBufferToTransparent();
+
+		// Create a remapping tool to back raster
+		TeRasterRemap remap;
+		if (transf)
+		{
+			remap.setTransformer(transf);
+//			unsigned int tt = transf->getTransparency();
+			decqt->setTransparency(transf->getTransparency());
+		}
+		remap.setOutput(backRaster_);
+		TeBox b = raster->params().boundingBox();
+		remap.setROI(b);
+
+		// Calculates best resolution level to display the input image on this canvas
+		//int res = raster->decoder()->bestResolution(params_.resx_/raster->params().resx_);
+		int res = raster->decoder()->bestResolution(bboxBackRaster, backRaster_->params().ncols_, backRaster_->params().nlines_, backRaster_->params().projection());
+		
+
+		// Check if raster blocks in best level of resolution that intersects the canvas box
+    
+		TeRasterParams parBlock;	
+		if( /*raster->projection()->operator==( *backRaster_->projection() )
+      && */raster->selectBlocks(bboxIntersection,res,parBlock))       
+		{
+			if (progress)
+				progress->setTotalSteps(raster->numberOfSelectedBlocks());
+			t2 = clock();
+			t0 = t1 = t2;
+			
+			// Process each block as an independent raster decoded in memory
+			TeRaster* block = new TeRaster;
+			remap.setInput(block);
+
+			TeDecoderMemory* decMem = new TeDecoderMemory(parBlock);
+			decMem->init();
+			// Portal of raster block selection behaves as portal of geometries
+			// use the "bool flag - do - while" scheme
+			int numBlockProcessed=0;
+			bool flag = true;
+			do
+			{
+				flag = raster->fetchRasterBlock(decMem);
+				block->setDecoder(decMem);
+				remap.apply();
+				numBlockProcessed++;
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					if((int)(t2-t0) > dt2)	
+					{
+						if (progress)
+						{
+							if (progress->wasCancelled())
+								break;
+							else
+								progress->setProgress(numBlockProcessed);
+						}
+					}
+				}
+			} while (flag);
+			if (progress)
+				progress->reset();
+			decMem->clear();
+			delete block;
+			raster->clearBlockSelection();
+		}
+		else		// no blocks found try to remap the whole raster
+		{
+			remap.setInput(raster);
+			remap.apply(true);	
+		}
+		decqt->getImage()->setAlphaBuffer(true);
+		painter_.drawPixmap(0, 0, *(decqt->getImage()));
+	}
+}
+
+bool TeQtCanvas::buildRaster ()
+{
+	if (!backRaster_)
+	{
+		backRaster_ = new TeRaster();
+		params_.mode_ = 'c';
+		params_.useDummy_ = true;
+		params_.setDummy(255);
+		TeDecoderQtImage *dec = new TeDecoderQtImage(params_);
+		backRaster_->setDecoder (dec);
+		backRaster_->init();
+	}
+	return true;
+}
+
+void TeQtCanvas::endPrinting()
+{
+	QPaintDevice* dev = painter_.device();
+	if(dev)
+		painter_.end();
+	if(pixmap0_)
+		painter_.begin(pixmap0_);
+}
+
+void TeQtCanvas::plotGraphicScale(TeVisual& visual, double offsetX, double offsetY, double unitConv, const string& dunit)
+{
+	TeBox	box = getWorld();
+	if(box.isValid() == false)
+		return;
+
+	string unit = dunit;
+	if (dunit.empty())
+		unit = canvasProjection_->units();
+
+	double	w = box.width();
+	double www = w / unitConv;
+	double	dx = www / 9.;
+	long	idx = (long)dx;
+	//long	idx = TeRound(dx);
+	double	f;
+	double	fa = 1.;
+	int		fw, fh;
+
+	int	size = visual.size();
+	if(pixmap0_ && pixmap1_ && (pixmap0_->rect() != pixmap1_->rect()))
+		size = (int)((double)size * printerFactor_ + .5);
+	//	size = TeRound((double)size * printerFactor_);
+
+	int conta = 1000;
+	if(idx > 0)
+	{
+		while(--conta)
+		{
+			dx /= 10.;
+			fa *= 10.;
+			idx = (long)dx;
+	//		idx = TeRound(dx);
+			if(idx == 0)
+			{
+				idx = (long)(dx * 10.);
+				f = idx * fa / 10.;
+	//			idx = TeRound(dx * 10.);
+	//			f = TeRound((double)idx * fa / 10.);
+				break;
+			}
+		}
+	}
+	else
+	{
+		while(--conta)
+		{
+			dx *= 10.;
+			fa /= 10.;
+			idx = (long)dx;
+	//		idx = TeRound(dx);
+			if(idx > 0)
+			{
+				f = idx * fa;
+	//			f = TeRound((double)idx * fa);
+				break;
+			}
+		}
+	}
+	if(conta == 0)
+		return;
+
+	double fff = f * unitConv;
+	double space = fff * 3.;
+	double hini = box.x1_ + (w - space) / 2.;
+
+	TeColor	cor = visual.color();
+	string	family = visual.family();
+	bool	bold = visual.bold();
+	bool	italic = visual.italic();
+	QFont font(family.c_str(), size);
+	font.setBold (bold);
+	font.setItalic (italic);
+	painter_.setFont(font);
+
+	QFontMetrics fm(font);
+	QRect rect;
+	rect = fm.boundingRect(unit.c_str());
+	fh = rect.height();
+	double vini = box.y1_ + mapVtoCW(fh+6);
+
+	TeCoord2D wp(hini, vini);
+	int x = TeRound((wp.x() - xmin_)*f_) + x0_;
+	int y = height_ - y0_ - TeRound((wp.y() - ymin_)*f_);
+	QPoint p1(x, y);
+	correctScrolling (p1);
+
+	wp.x(wp.x() + fff);
+	x = TeRound((wp.x() - xmin_)*f_) + x0_;
+	y = height_ - y0_ - TeRound((wp.y() - ymin_)*f_);
+	QPoint p2(x, y);
+	correctScrolling (p2);
+
+	wp.x(wp.x() + fff);
+	x = TeRound((wp.x() - xmin_)*f_) + x0_;
+	y = height_ - y0_ - TeRound((wp.y() - ymin_)*f_);
+	QPoint p3(x, y);
+	correctScrolling (p3);
+
+	wp.x(wp.x() + fff);
+	x = TeRound((wp.x() - xmin_)*f_) + x0_;
+	y = height_ - y0_ - TeRound((wp.y() - ymin_)*f_);
+	QPoint p4(x, y);
+	correctScrolling (p4);
+
+	rect = fm.boundingRect("0");
+	fw = rect.width();
+	QPoint pp(p1);
+	bool setRect = false;
+	if(graphicScaleRect_.isValid())
+	{
+		x = TeRound((double)graphicScaleRect_.left() * printerFactor_ + (double)fw/2.);
+		y = TeRound((double)graphicScaleRect_.top() * printerFactor_ + (double)rect.height() + 8. * printerFactor_);
+		pp.setX(x);
+		pp.setY(y);
+	}
+	else
+	{
+		setRect = true;
+		offsetX = 0.;
+		offsetY = 0.;
+	}
+
+	x = TeRound((double)pixmap0_->width() * offsetX);
+	y = TeRound((double)pixmap0_->height() * offsetY);
+	if(x!=0 || y!=0)
+	{
+		graphicScaleRect_.setLeft(graphicScaleRect_.left() + x);
+		graphicScaleRect_.setRight(graphicScaleRect_.right() + x);
+		graphicScaleRect_.setTop(graphicScaleRect_.top() + y);
+		graphicScaleRect_.setBottom(graphicScaleRect_.bottom() + y);
+	}
+
+	QPoint offset(x, y);
+	pp += offset;
+
+	QPoint interval = p2 - p1;
+
+	p1 = pp;
+	p2 = p1 + interval;
+	p3 = p2 + interval;
+	p4 = p3 + interval;
+	if(setRect)
+	{
+		x = TeRound(((double)p1.x() - (double)fw/2.) / printerFactor_);
+		graphicScaleRect_.setLeft(x);
+	}
+
+	QPen pen(QColor(cor.red_, cor.green_, cor.blue_));
+	painter_.setPen(pen);
+
+	if(bold == false)
+	{
+		QPoint pa = p2;
+		QPoint pb = p3;
+		painter_.drawLine(pa, pb);
+
+		pa = p1;
+		pb = pa;
+		y = TeRound((double)pa.y() - 5. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() + 4. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+
+		pa = p2; 
+		pb = pa;
+		y = TeRound((double)pa.y() - 5. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() + 4. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+
+		pa = p3; 
+		pb = pa;
+		y = TeRound((double)pa.y() - 5. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() + 4. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+
+		pa = p4; 
+		pb = pa;
+		y = TeRound((double)pa.y() - 5. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() + 4. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+
+		pa = p1;
+		pb = p4;
+		y = TeRound((double)pa.y() - 1. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() - 1. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+		y = TeRound((double)pa.y() + 2. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() + 2. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+	}
+	else
+	{
+		QPoint pa = p2;
+		QPoint pb = p3;
+		painter_.drawLine(pa, pb);
+		y = TeRound((double)pa.y() - 1. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() - 1. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+
+		pa = p1;
+		pb = pa;
+		y = TeRound((double)pa.y() - 5. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() + 4. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+		x = TeRound((double)pa.x() - 1. * printerFactor_);
+		pa.setY(x);
+		x = TeRound((double)pb.x() - 1. * printerFactor_);
+		pb.setY(x);
+		painter_.drawLine(pa, pb);
+
+		pa = p2; 
+		pb = pa;
+		y = TeRound((double)pa.y() - 5. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() + 4. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+		x = TeRound((double)pa.x() - 1. * printerFactor_);
+		pa.setY(x);
+		x = TeRound((double)pb.x() - 1. * printerFactor_);
+		pb.setY(x);
+		painter_.drawLine(pa, pb);
+
+		pa = p3; 
+		pb = pa;
+		y = TeRound((double)pa.y() - 5. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() + 4. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+		x = TeRound((double)pa.x() - 1. * printerFactor_);
+		pa.setY(x);
+		x = TeRound((double)pb.x() - 1. * printerFactor_);
+		pb.setY(x);
+		painter_.drawLine(pa, pb);
+
+		pa = p4; 
+		pb = pa;
+		y = TeRound((double)pa.y() - 5. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() + 4. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+		x = TeRound((double)pa.x() - 1. * printerFactor_);
+		pa.setY(x);
+		x = TeRound((double)pb.x() - 1. * printerFactor_);
+		pb.setY(x);
+		painter_.drawLine(pa, pb);
+
+		pa = p1;
+		pb = p4;
+		y = TeRound((double)pa.y() - 2. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() - 2. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+		y = TeRound((double)pa.y() + 3. * printerFactor_);
+		pa.setY(y);
+		y = TeRound((double)pb.y() + 3. * printerFactor_);
+		pb.setY(y);
+		painter_.drawLine(pa, pb);
+	}
+
+	x = TeRound((double)p1.x()-(double)fw/2.);
+	y = TeRound((double)p1.y()-8.*printerFactor_);
+	painter_.drawText(x, y, "0");
+	if(setRect)
+	{
+		y = TeRound(((double)y - (double)rect.height()) / printerFactor_);
+		graphicScaleRect_.setTop(y);
+	}
+
+	char buf[50];
+	long n = (long)f;
+
+	if(n > 0)
+	{
+		sprintf(buf, "%ld", n);
+		QString s = buf;
+		rect = fm.boundingRect(s);
+		int fw1 = rect.width();
+
+		sprintf(buf, "%ld", n*2);
+		s = buf;
+		rect = fm.boundingRect(s);
+		int fw2 = rect.width();
+
+		sprintf(buf, "%ld", n*3);
+		s = buf;
+		rect = fm.boundingRect(s);
+		int fw3 = rect.width();
+
+		if((fw1 + fw2)/2 < p3.x()-p2.x() &&
+			(fw2 + fw3)/2 < p3.x()-p2.x())
+		{
+			sprintf(buf, "%ld", n);
+			QString s = buf;
+			rect = fm.boundingRect(s);
+			fw = rect.width();
+			x = TeRound((double)p2.x()-(double)fw/2.);
+			y = TeRound((double)p2.y()-8.*printerFactor_);
+			painter_.drawText(x, y, s);
+
+			sprintf(buf, "%ld", n*2);
+			s = buf;
+			rect = fm.boundingRect(s);
+			fw = rect.width();
+			x = TeRound((double)p3.x()-(double)fw/2.);
+			y = TeRound((double)p3.y()-8.*printerFactor_);
+			painter_.drawText(x, y, s);
+		}
+
+		sprintf(buf, "%ld", n*3);
+		s = buf;
+		rect = fm.boundingRect(s);
+		fw = rect.width();
+		x = TeRound((double)p4.x()-(double)fw/2.);
+		y = TeRound((double)p4.y()-8.*printerFactor_);
+		painter_.drawText(x, y, s);
+		if(setRect)
+		{
+			x = TeRound(((double)x + (double)fw) / printerFactor_);
+			graphicScaleRect_.setRight(x);
+		}
+	}
+	else
+	{
+		int nn=0;
+		int fn = (int)fa;
+		while(fn == 0)
+		{
+			fa *= 10.;
+			fn = TeRound(fa);
+			nn++;
+		}
+		sprintf (buf, "%.*f", nn, f);
+		QString s = buf;
+		rect = fm.boundingRect(s);
+		int fw1 = rect.width();
+
+		sprintf (buf, "%.*f", nn, f*2.);
+		s = buf;
+		rect = fm.boundingRect(s);
+		int fw2 = rect.width();
+
+		sprintf (buf, "%.*f", nn, f*3.);
+		s = buf;
+		rect = fm.boundingRect(s);
+		int fw3 = rect.width();
+
+		if((fw1 + fw2)/2 < p3.x()-p2.x() &&
+			(fw2 + fw3)/2 < p3.x()-p2.x())
+		{
+			sprintf (buf, "%.*f", nn, f);
+			QString s = buf;
+			rect = fm.boundingRect(s);
+			fw = rect.width();
+			x = TeRound((double)p2.x()-(double)fw/2.);
+			y = TeRound((double)p2.y()-8.*printerFactor_);
+			painter_.drawText(x, y, s);
+
+			sprintf (buf, "%.*f", nn, f*2.);
+			s = buf;
+			rect = fm.boundingRect(s);
+			fw = rect.width();
+			x = TeRound((double)p3.x()-(double)fw/2.);
+			y = TeRound((double)p3.y()-8.*printerFactor_);
+			painter_.drawText(x, y, s);
+		}
+
+		sprintf (buf, "%.*f", nn, f*3.);
+		s = buf;
+		rect = fm.boundingRect(s);
+		fw = rect.width();
+		x = TeRound((double)p4.x()-(double)fw/2.);
+		y = TeRound((double)p4.y()-8.*printerFactor_);
+		painter_.drawText(x, y, s);
+		x = TeRound((double)x + printerFactor_);
+		graphicScaleRect_.setRight(x);
+	}
+
+	int sw = p4.x() - p1.x();
+	rect = fm.boundingRect(unit.c_str());
+	fw = rect.width();
+	fh = rect.height();
+	int suini = TeRound(((double)(sw - fw)) / 2. + (double)p1.x());
+	y = TeRound((double)p1.y()+(double)fh+2.*printerFactor_);
+	painter_.drawText (suini, y, unit.c_str());
+	if(setRect)
+	{
+		y = TeRound((double)y / printerFactor_);
+		graphicScaleRect_.setBottom(y);
+	}
+}
+
+void TeQtCanvas::setClipRegion(int x, int y, int w, int h)
+{
+	QRegion region(x, y, w, h);
+	if(painter_.device())
+		painter_.setClipRegion(region);
+}
+
+void TeQtCanvas::setClipRegion(QRegion region)
+{
+	if(painter_.device())
+		painter_.setClipRegion(region);
+}
+
+void TeQtCanvas::setClipping(bool enable)
+{
+	if(painter_.device())
+		painter_.setClipping(enable);
+}
+
+void TeQtCanvas::clearRaster()
+{
+	if (backRaster_)
+		delete backRaster_;
+	backRaster_ = 0;
+}
+
+
+void TeQtCanvas::setMode (CursorMode m)
+{
+	cursorMode_ = m;
+	down_ = false;
+}
+
+void TeQtCanvas::clear()
+{
+	int ww, hh;
+	ww = viewport()->width();
+	hh = viewport()->height();
+
+	// Clear the window
+	QPaintDevice* dev = painter_.device();
+	if(dev)
+		painter_.end();
+	painter_.begin(viewport());
+	painter_.eraseRect(0, 0, ww, hh);
+	painter_.end();
+	if(dev)
+		painter_.begin(dev);
+}
+
+void TeQtCanvas::clear(TeBox box)
+{
+	mapCWtoV(box);
+
+	// Clear the window
+	plotOnWindow();
+	painter_.eraseRect((int)box.x1(), (int)box.y1(), (int)box.width(), (int)box.height());
+	plotOnPixmap0();
+}
+
+void TeQtCanvas::clearAll()
+{
+	// Clear the viewport
+	clear();
+
+	// Clear the pixmaps
+	if(pixmap0_)
+		pixmap0_->fill(paletteBackgroundColor());
+	if(pixmap1_)
+		pixmap1_->fill(paletteBackgroundColor());
+	if(pixmap2_)
+		pixmap2_->fill(paletteBackgroundColor());
+
+	if (backRaster_)
+		delete backRaster_;
+	backRaster_ = 0;
+}
+
+void TeQtCanvas::clearAll(TeBox box)
+{
+	// Clear the viewport area corresponding to the given box
+	clear(box);
+
+	// Clear the pixmap
+	mapCWtoV(box);
+
+	QPaintDevice* dev = painter_.device();
+	if(dev)
+		painter_.end();
+
+	if(pixmap0_)
+	{
+		painter_.begin(pixmap0_);
+		painter_.fillRect((int)box.x1(), (int)box.y1(), (int)box.width(), (int)box.height(), backgroundColor());
+		painter_.end();
+	}
+	if(pixmap1_)
+	{
+		painter_.begin(pixmap1_);
+		painter_.fillRect((int)box.x1(), (int)box.y1(), (int)box.width(), (int)box.height(), backgroundColor());
+		painter_.end();
+	}
+	if(pixmap2_)
+	{
+		painter_.begin(pixmap2_);
+		painter_.fillRect((int)box.x1(), (int)box.y1(), (int)box.width(), (int)box.height(), backgroundColor());
+		painter_.end();
+	}
+
+	if(dev)
+		painter_.begin(dev);
+}
+
+
+bool TeQtCanvas::setView(int w, int h, QPaintDevice *pd)
+{
+    int dpix, dpiy, ncolors, wmm, hmm, depth, pdepth;
+	int ww = w, hh = h;
+
+	x0_ = y0_ = 0;
+
+	if (pd == 0)
+	{
+		if (ww == 0)
+			ww = viewport()->width();
+		if (hh == 0)
+			hh = viewport()->height();
+		resizeContents (ww,hh);
+
+		QPaintDevice* dev = painter_.device();
+		if(dev)
+			painter_.end();
+
+		// Build new pixmaps if window has been resized
+		if ((pixmap0_ == 0 || width_ != ww || height_ != hh) ||
+			(pixmap0_ && (pixmap0_->width() != ww || pixmap0_->height() != hh)))
+		{
+			if (pixmap0_)
+				delete pixmap0_;
+			if(numberOfPixmaps_ > 0)
+				pixmap0_ = new QPixmap (ww,hh);
+			else
+				pixmap0_ = new QPixmap (0,0);
+
+			if (pixmap1_)
+				delete pixmap1_;
+			if(numberOfPixmaps_ > 1)
+				pixmap1_ = new QPixmap (ww,hh);
+			else
+				pixmap1_ = new QPixmap (0,0);
+
+			if (pixmap2_)
+				delete pixmap2_;
+			if(numberOfPixmaps_ > 2)
+				pixmap2_ = new QPixmap (ww,hh);
+			else
+				pixmap2_ = new QPixmap (0,0);
+
+			pdepth = pixmap0_->depth ();
+		}
+		painter_.begin(pixmap0_);
+		printerFactor_ = 1.;
+	}
+	else
+	{
+		QPaintDeviceMetrics pdm(pd);
+		if (ww == 0)
+			ww = pdm.width();
+		if (hh == 0)
+			hh = pdm.height ();
+
+		int pw = pixmap0_->rect().width();
+		int ph = pixmap0_->rect().height();
+		if((double)ww/(double)pw < (double)hh/(double)ph)
+			hh = (int)((double)ph * (double)ww/(double)pw);
+		else
+			ww = (int)((double)pw * (double)hh/(double)ph);
+
+		dpix = pdm.logicalDpiX();
+		dpiy = pdm.logicalDpiY();
+		ncolors = pdm.numColors();
+		wmm = pdm.widthMM ();
+		hmm = pdm.heightMM ();
+		depth = pdm.depth ();
+		QPaintDevice* dev = painter_.device();
+		if(dev)
+			painter_.end();
+
+		if (pixmap0_)
+			delete pixmap0_;
+		if(numberOfPixmaps_ > 0)
+			pixmap0_ = new QPixmap (ww,hh);
+		else
+			pixmap0_ = new QPixmap (0,0);
+
+		// plot is made on pixmap0 because printer don�t have transparency
+		painter_.begin(pixmap0_);
+		painter_.setClipRect( x0_, y0_, ww, hh );
+
+		printerFactor_ = (double)ww / (double)widthRef2PrinterFactor_;
+
+		if (pixmap1_)
+			delete pixmap1_;
+		pixmap1_ = new QPixmap (0,0);
+
+		if (pixmap2_)
+			delete pixmap2_;
+		pixmap2_ = new QPixmap (0,0);
+	}
+
+	if(numberOfPixmaps_ > 0 && (pixmap0_->width() == 0 || pixmap0_->height() == 0))
+		return false;
+	else if(numberOfPixmaps_ > 1 && (pixmap1_->width() == 0 || pixmap1_->height() == 0))
+		return false;
+	else if(numberOfPixmaps_ > 2 && (pixmap2_->width() == 0 || pixmap2_->height() == 0))
+		return false;
+
+	width_ = ww;
+	height_ = hh;
+	params_.ncols_ = width_;
+	params_.nlines_ = height_;
+
+	down_ = false;
+	xul_ = xmin_;
+	yul_ = ymax_;
+	xlr_ = xmax_;
+	ylr_ = ymin_;
+
+	if (pd == 0)
+		clearAll();
+	return true;
+}
+
+void TeQtCanvas::correctScrolling (QPoint &p)
+{
+	if(painter_.device() == viewport())
+	{
+		QPoint o (contentsX (), contentsY ());
+		p -= o;
+	}
+}
+
+void TeQtCanvas::initCursorArea(QPoint p)
+{
+	if (!pixmap0_)
+		return;
+
+	down_ = true;
+	TeCoord2D pw = mapVtoCW(p);
+	xul_ = pw.x();
+	yul_ = pw.y();
+	ixul_ = ixlr_ = p.x();
+	iyul_ = iylr_ = p.y();
+}
+
+void TeQtCanvas::contentsMousePressEvent( QMouseEvent* e)
+{
+	if (!pixmap0_)
+		return;
+
+	QPoint m = e->pos();
+	TeCoord2D p = mapVtoCW(m);
+
+	if(e->button() == LeftButton)
+	{
+		if (cursorMode_ == Area || cursorMode_ == Edit)
+		{
+			plotOnWindow();
+			down_ = true;
+			xul_ = p.x();
+			yul_ = p.y();
+			ixul_ = ixlr_ = e->pos().x();
+			iyul_ = iylr_ = e->pos().y();
+			plotOnPixmap0();
+			emit mouseMoved (p, e->state(), m);
+		}
+		else
+			emit mousePressed (p, e->state(), m);
+	}
+	else if(e->button() == RightButton)
+		emit mouseRightButtonPressed (p, e->state(), m);
+}
+
+void TeQtCanvas::contentsMouseMoveEvent ( QMouseEvent* e)
+{
+	if (!pixmap0_)
+		return;
+	plotOnWindow();
+	QPoint m = e->pos();
+	TeCoord2D p = mapVtoCW(m);
+	if (down_)
+	{
+		QPoint o = offset();
+		painter_.setPen (green);
+		painter_.setRasterOp (Qt::XorROP);
+		painter_.drawLine(ixul_-o.x(),iyul_-o.y(),ixlr_-o.x()-1,iyul_-o.y());            
+		painter_.drawLine(ixlr_-o.x(),iyul_-o.y(),ixlr_-o.x(),iylr_-o.y() -1);            
+		painter_.drawLine(ixlr_-o.x(),iylr_-o.y(),ixul_-o.x()-1,iylr_-o.y() );            
+		painter_.drawLine(ixul_-o.x(),iylr_-o.y(),ixul_-o.x(),iyul_-o.y()-1 );            
+		ixlr_ = e->pos().x();
+		iylr_ = e->pos().y();
+		painter_.drawLine(ixul_-o.x(),iyul_-o.y(),ixlr_-o.x()-1,iyul_-o.y());            
+		painter_.drawLine(ixlr_-o.x(),iyul_-o.y(),ixlr_-o.x(),iylr_ -o.y()-1);            
+		painter_.drawLine(ixlr_-o.x(),iylr_-o.y(),ixul_-o.x()-1,iylr_-o.y() );            
+		painter_.drawLine(ixul_-o.x(),iylr_-o.y(),ixul_-o.x(),iyul_-o.y()-1 );            
+		painter_.setRasterOp (Qt::CopyROP);
+	}
+	plotOnPixmap0();
+	emit mouseMoved (p, e->state(), m);
+}
+
+void TeQtCanvas::contentsMouseReleaseEvent( QMouseEvent* e)
+{
+	if (!pixmap0_)
+		return;
+	QPoint m = e->pos();
+	TeCoord2D p = mapVtoCW(m);
+	if (down_)
+	{
+		ixlr_ = e->pos().x();
+		iylr_ = e->pos().y();
+		xlr_ = p.x();
+		ylr_ = p.y();
+		if(xul_ > xlr_)
+		{
+			double a = xlr_;
+			xlr_ = xul_;
+			xul_ = a;
+		}
+		if(ylr_ > yul_)
+		{
+			double a = ylr_;
+			ylr_ = yul_;
+			yul_ = a;
+		}
+		down_ = false;
+
+		emit zoomArea();
+	}
+	emit mouseReleased (p, e->state(), m);
+}
+
+void TeQtCanvas::contentsMouseDoubleClickEvent ( QMouseEvent* e)
+{
+	if (!pixmap0_)
+		return;
+
+	QPoint m = e->pos();
+	TeCoord2D p = mapVtoCW(m);
+
+	if(e->button() == LeftButton)
+		emit mouseDoublePressed (p, e->state(), m);
+}
+
+
+void TeQtCanvas::contentsContextMenuEvent( QContextMenuEvent* e)
+{
+	QMouseEvent *m = (QMouseEvent *)e;
+	emit popupCanvasSignal(m);
+}
+
+
+void TeQtCanvas::leaveEvent ( QEvent * )
+{
+	emit mouseLeave();
+}
+
+void TeQtCanvas::keyPressEvent (QKeyEvent* e)
+{
+	emit keyPressed(e);
+}
+
+void TeQtCanvas::keyReleaseEvent (QKeyEvent* e)
+{
+	emit keyReleased(e);
+}
+
+void TeQtCanvas::viewportPaintEvent (QPaintEvent*)
+{
+	copyPixmapToWindow ();
+	emit paintEvent ();
+}
+
+void TeQtCanvas::resizeEvent ( QResizeEvent * e)
+{
+	QScrollView::resizeEvent(e);
+}
+
+void TeQtCanvas::copyPixmapToWindow()
+{
+	if (pixmap0_)
+	{
+		int cx = contentsX();
+		int cy = contentsY();
+		bitBlt (viewport(),0,0,pixmap0_,cx,cy,viewport()->rect().width(),viewport()->rect().height(),CopyROP,true);
+	}
+}
+
+int TeQtCanvas::mapDWtoV(double a)
+{
+	TeBox dbox = getDataWorld();
+	double dwidth = dbox.width();
+	int	pwidth = viewport()->width();
+
+	int d = (int)((double)pwidth * a / (double)dwidth);
+	return d;
+}
+
diff --git a/src/terralib/drivers/qt/TeQtCanvas.h b/src/terralib/drivers/qt/TeQtCanvas.h
old mode 100755
new mode 100644
index 0d56a9b..872e270
--- a/src/terralib/drivers/qt/TeQtCanvas.h
+++ b/src/terralib/drivers/qt/TeQtCanvas.h
@@ -1,415 +1,423 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __QTCANVAS_H
-#define  __QTCANVAS_H
-
-#include <TeDatabase.h>
-#include <TeRaster.h>
-
-#include <qpainter.h>
-#include <qbrush.h> 
-#include <qpixmap.h>
-#include <qimage.h>
-#include <qbitmap.h>
-#include <qprinter.h>
-#include <qscrollview.h>   
-#include <qpopupmenu.h>
-
-class TeQtProgress;
-
-#include <string>
-using namespace std;
-
-
-class TeQtCanvas : public QScrollView
-{
-   Q_OBJECT
-
-public:
-    enum CursorMode { Pointer, Area, Pan, Hand, SizeVer, SizeBDiag,
-		 UpArrow, Edit, Distance, Information, ZoomIn, ZoomOut };
-
-	// Constructor
-	TeQtCanvas(QWidget *parent=0, const char *name=0);
-
-	// Destructor
-	~TeQtCanvas();
-
-	// Set the initial position for the area cursor
-	void initCursorArea (QPoint p);
-
-	// Set the cursor type
-	void setMode (CursorMode);
-
-	// Get the cursor type
-	CursorMode getCursorMode() { return cursorMode_;}
-
-	// Get the cursor box in world coordinates
-	TeBox getCursorBox (){ return TeBox (xul_,ylr_,xlr_,yul_); }
-
-	// Copy the pixmap contents to the viewport
-	void copyPixmapToWindow();
-
-	// Set the dimensions of the paint device, according the box 
-	// given in world coordinates
-	bool setWorld(TeBox b, int w = 0, int h = 0, QPaintDevice *pd = 0);
-
-	// Set the dimensions of the paint device, creating or recreating the
-	// pixmaps accordingly
-	virtual bool setView(int w = 0, int h = 0, QPaintDevice* pd = 0);
-
-	// Adjust the box in world coordinates if the extend flag is true or set
-	// the canvas dimensions if the extend flag is false
-	void setTransformation(double xmin, double xmax, double ymin, double ymax, bool extend = true);
-
-	// Get the canvas box in world coordinates
-	TeBox getWorld() {return wc_ ;}
-
-	// Get the data box in world coordinates
-	TeBox getDataWorld();
-
-	// Clear the canvas viewport
-	void clear();
-
-	// Clear the viewport area corresponding to the given box 
-	void clear(TeBox box);
-
-	// Clear the viewport and all the pixmaps
-	void clearAll();
-
-	// Clear the area of the viewport and the area of all of the
-	// pixmaps corresponding to the given box 
-	void clearAll(TeBox box);
-
-	// Get the position of the viewport relative to the total canvas area
-	QPoint offset() {return QPoint(contentsX(), contentsY());}
-
-	// Map the given point in data world coordinates to 
-	// the corresponding point in the viewport
-	QPoint mapDWtoV(const TeCoord2D& dw);
-
-	// Map the given box in data world coordinates to 
-	// the corresponding box in the viewport
-	void mapDWtoV(TeBox& box);
-
-	// Map the points of a line in data world coordinates to
-	// the corresponding points in the viewport
-	QPointArray mapDWtoV(const TeLine2D&);
-
-	// Map the value in data world coordinates to 
-	// the corresponding value in the viewport
-	int mapDWtoV(double);
-
-	// Map the value in pixels in the viewport to 
-	// the corresponding value in the canvas world
-	double mapVtoCW(int);
-
-	// Map the point in the viewport to the 
-	// corresponding point in the canvas world
-	TeCoord2D mapVtoCW(const QPoint&);
-
-	// Map the box in the viewport to the 
-	// corresponding box in the canvas world
-	void mapVtoCW(TeBox& box);
-
-	// Map the value in pixels in the viewport to 
-	// the corresponding value in the data world
-	double mapVtoDW(int);
-
-	// Map the point in the viewport to the 
-	// corresponding point in the data world
-	TeCoord2D mapVtoDW(const QPoint&);
-
-	// Map the box in the canvas world coordinates to 
-	// the corresponding box in the data world coordinates
-	void mapCWtoDW(TeBox& box);
-
-	// Map the box in the data world coordinates to 
-	// the corresponding box in the canvas world coordinates
-	void mapDWtoCW(TeBox& box);
-
-	// Map the box in the canvas world coordinates to 
-	// the corresponding box in the viewport
-	void mapCWtoV(TeBox& box);
-
-	// Map the point in the canvas world coordinates to 
-	// the corresponding point in the viewport
-	QPoint mapCWtoV(const TeCoord2D& c);
-	 
-// Pixel size in world coordinates
-	double pixelSize () { return (xmax_-xmin_)/(double)width_; }
-
-// Set the projection of the next incoming data
-	void  setDataProjection ( TeProjection* proj );
-
-// Set the projection
-	void  setProjection ( TeProjection* proj);
-
-// Retrieve the canvas projection
-	TeProjection* projection() { return canvasProjection_; }
-
-// Retrieve flag that compare canvas projection and data projection
-	bool canvasAndDataProjectionEqual() {return canvasAndDataProjectionEqual_;};
-
-// Plotting primitives
-
-	QPainter* getPainter () {return &painter_;}
-	void plotOnWindow ();
-	void plotOnPixmap0 ();
-	void plotOnPixmap1 ();
-	virtual void copyPixmapToWindow(QPixmap*, int, int, int, int);
-	virtual void copyPixmap0ToPrinter();
-	virtual void copyPixmap0To(QPaintDevice*);
-	virtual void copyPixmap0ToWindow();
-	virtual void copyPixmap1ToWindow();
-	virtual void copyPixmap0ToWindow(int, int, int, int);
-	virtual void copyPixmap0ToPixmap1();
-	virtual void copyPixmap0ToPixmap1(int, int, int, int);
-	virtual void copyPixmap1ToPixmap0();
-	virtual void copyPixmap1ToPixmap0(int, int, int, int);
-	virtual void copyPixmap1ToPixmap2();
-	virtual void copyPixmap1ToPixmap2(int, int, int, int);
-	virtual void copyPixmap2ToPixmap1();
-	virtual void copyPixmap2ToPixmap1(int, int, int, int);
-	virtual void copyPanArea(int, int);
-
-	void plotPoint (TeCoord2D &p);
-	void plotPoint (TePoint &p){ plotPoint(p.location()); }
-
-	void setPointColor (int r, int g, int b);
-	void setPointStyle (int s, int w = 3);
-	void setPointPixmap (char* p);
-
-	void plotCell (TeCell &s, const bool& restoreBackground = false);
-
-	QRect getLegendRect (QPoint p, const QPixmap* pix, string tx);
-	void plotLegend (QPoint p, const QPixmap* pix, string tx);
-
-	void plotPolygon (const TePolygon &p, const bool& restoreBackground = false);
-	void setPolygonColor (int r, int g, int b);
-	void setPolygonStyle (int s, int width = 1);
-	void setPolygonLineColor (int r, int g, int b);
-	void setPolygonLineStyle (int s, int width = 1);
-
-	void plotLine (TeLine2D &l);
-	void setLineColor (int r, int g, int b);
-	void setLineStyle (int s, int w = 1);
-
-	void plotNode (TeNode &n);
-	void setNodeColor (int r, int g, int b);
-	void setNodeStyle (int s, int w = 4);
-	void setNodePixmap (char* p);
-
-	void plotArc (TeArc &a);
-	void setArcColor (int r, int g, int b);
-	void setArcStyle ( int s, int w = 1 );
-
-	void plotPie (double x, double y, double w, double h, double a, double alen);
-	void setPieColor (int r, int g, int b);
-	void plotRect (double x, double y, double w, double h, int transp=0, bool legend=false);
-	void plotRect (QRect&);
-	void setRectColor (int r, int g, int b);
-
-	void plotText (TeCoord2D &p, string &str, double angle = 0., double alignh = 0., double alignv = 0.);
-	void plotText (TeText &tx, TeVisual& visual);
-	QRect textRect (TeText &tx, TeVisual visual);
-	void plotTextRects (TeText &tx, TeVisual visual);
-	void setTextColor (int r, int g, int b);
-	void setTextSize (int size);
-	void setTextStyle (string& family, int size, bool bold, bool italic);
-	void textExtent ( string &str, int &w, int &h, double angle = 0.);
-	void plotXorPolyline (QPointArray& PA, bool cdev=true);
-	void plotXorTextDistance(vector<QPointArray> xorPointArrayVec, double unitConv, string unit);
-
-	void setDB (TeDatabase* db) { db_ = db; }
-	void plotRaster (TeRaster* raster, TeRasterTransform* transf, TeQtProgress *progress);
-	void clearRaster();
-	void endPrinting();
-
-	QPixmap* getPixmap0 () {return pixmap0_; }
-	QPixmap* getPixmap1 () {return pixmap1_; }
-	QPixmap* getPixmap2 () {return pixmap2_; }
-
-	void plotGraphicScale(TeVisual& visual, double offsetX, double offsetY, double unitConv=1, const string& dunit="");
-
-	void setClipRegion(int x, int y, int w, int h);
-	void setClipRegion(QRegion region);
-	void setClipping (bool enable);
-
-	TeRasterParams& getParams()
-	{	return params_; }
-
-	double scaleApx() {return scaleApx_;}
-	void scaleApx(double);
-
-	double printerFactor() {return printerFactor_;}
-	void widthRef2PrinterFactor(int w) {widthRef2PrinterFactor_ = w;}
-	void plotLegend (const QPoint& p, TeLegendEntry* leg, const string& tx);
-	void plotLegend (const QPoint& p, const TeColor& cor, const string& tx);
-	bool locateGraphicScale(const QPoint& p);
-	QRect& graphicScaleRect() { return graphicScaleRect_;}
-	void numberOfPixmaps(int n) {numberOfPixmaps_ = n;}
-	int numberOfPixmaps() {return numberOfPixmaps_;}
-	QPopupMenu* popupCanvas() { return popupCanvas_; }
-
-
-signals:
-	void mousePressed (TeCoord2D&, int, QPoint&);
-	void mouseDoublePressed (TeCoord2D&, int, QPoint&);
-	void mouseRightButtonPressed (TeCoord2D&, int, QPoint&);
-	void mouseMoved (TeCoord2D&, int, QPoint&);
-	void mouseReleased (TeCoord2D&, int, QPoint&);
-	void mouseLeave ();
-	void paintEvent ();
-	void popupCanvasSignal(QMouseEvent*);
-	void keyPressed(QKeyEvent*);
-	void keyReleased(QKeyEvent*);
-	void zoomArea();
-
-protected:
-
-	TeDatabase*	db_;
-
-	QPainter	painter_;
-	QImage		qimage_;
-	QPopupMenu* popupCanvas_;
-	QPixmap*	pixmap0_;
-	QPixmap*	pixmap1_;
-	QPixmap*	pixmap2_;
-	int			numberOfPixmaps_;
-
-	TeProjection*	canvasProjection_;
-	TeProjection*	dataProjection_;
-
-	TeRaster*		backRaster_;
-	TeRasterParams	params_;
-
-	double	printerFactor_;
-	int		widthRef2PrinterFactor_;
-	QRect	graphicScaleRect_;
-	bool	canvasAndDataProjectionEqual_;
-	
-	// Sizes and transformations
-	TeBox	wc_;
-	double 	xmin_;
-	double 	xmax_;
-	double 	ymin_;
-	double 	ymax_;	
-	int		x0_;
-	int		y0_;
-	int		width_;
-	int		height_;
-	double	f_;
-	double	scaleApx_;
-	int		scale_;
-	int		lx1_;
-	int		ly1_;
-	int		lx2_;
-	int		ly2_;
-
-// Area Cursor section
-	CursorMode cursorMode_;
-	bool	down_;
-	double 	xul_; // cursor world coordinates
-	double 	xlr_;
-	double 	yul_;
-	double 	ylr_;
-	int 	ixul_; // cursor screen coordinates
-	int 	ixlr_;
-	int 	iyul_;
-	int 	iylr_;
-
-// Pie
-	QBrush		pieBrush_;
-	QColor		pieColor_;
-	QBrush		rectBrush_;
-	QColor		rectColor_;
-	
-// Polygon
-	int			polygonTransparency_;
-	QBrush		polygonBrush_;
-	QPen		polygonPen_;
-	QColor		polygonColor_;
-	map<TePolyBasicType, Qt::BrushStyle> brushStyleMap_;
-	
-// Line
-	QPen		linePen_;
-	QColor		lineColor_;
-	map<TeLnBasicType, Qt::PenStyle> penStyleMap_;
-	
-// Point
-	int			pointStyle_;
-	int			pointSize_;
-	QPen		pointPen_;
-	QColor		pointColor_;
-	QPixmap*	pointPixmap_;
-
-// Arc
-	QPen		arcPen_;
-	QColor		arcColor_;
-	
-// Node
-	int			nodeStyle_;
-	int			nodeSize_;
-	QPen		nodePen_;
-	QColor		nodeColor_;
-	QPixmap*	nodePixmap_;
-
-// Text
-	QPen		textPen_;
-	QColor		textColor_;
-	QFont		textFont_;
-	int			textSize_;
-
-// Draw Representations
-	void drawPolygonRep (QPoint p, int w, int h, TeVisual& v);
-	void drawLineRep (QPoint p, TeVisual& v);
-	void drawPointRep (QPoint p, TeVisual& v);
-	void plotMark(QPoint &p, int s, int w);
-
-// Mouse events
-	void contentsMousePressEvent( QMouseEvent* );
-	void contentsMouseMoveEvent ( QMouseEvent* );
-	void contentsMouseReleaseEvent ( QMouseEvent* );
-	void contentsMouseDoubleClickEvent ( QMouseEvent* );
-	void contentsContextMenuEvent( QContextMenuEvent* );
-
-// Leave Event
-	void leaveEvent(QEvent*);
-
-// Key events
-	void keyPressEvent(QKeyEvent*);
-	void keyReleaseEvent(QKeyEvent*);
-
-// Other events
-	void viewportPaintEvent(QPaintEvent* e);
-	void resizeEvent(QResizeEvent*);
-
-// Correct scrolling when there are scrollbars
-	void correctScrolling(QPoint &p);
-
-// Build Raster
-	bool buildRaster();
-};
-
-#endif
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __QTCANVAS_H
+#define  __QTCANVAS_H
+
+#include <TeDatabase.h>
+#include <TeRaster.h>
+
+#include <TeAppUtilsDefines.h>
+
+#include <qpainter.h>
+#include <qbrush.h> 
+#include <qpixmap.h>
+#include <qimage.h>
+#include <qbitmap.h>
+#include <qprinter.h>
+#include <qscrollview.h>   
+#include <qpopupmenu.h>
+
+class TeQtProgress;
+
+#include <string>
+using namespace std;
+
+
+class TLAPPUTILS_DLL TeQtCanvas : public QScrollView
+{
+   Q_OBJECT
+
+public:
+    enum CursorMode { Pointer, Area, Pan, Hand, SizeVer, SizeBDiag,
+		 UpArrow, Edit, Distance, Information, ZoomIn, ZoomOut };
+
+	// Constructor
+	TeQtCanvas(QWidget *parent=0, const char *name=0);
+
+	// Destructor
+	~TeQtCanvas();
+
+	// Set the initial position for the area cursor
+	void initCursorArea (QPoint p);
+
+	// Set the cursor type
+	void setMode (CursorMode);
+
+	// Get the cursor type
+	CursorMode getCursorMode() { return cursorMode_;}
+
+	// Get the cursor box in world coordinates
+	TeBox getCursorBox (){ return TeBox (xul_,ylr_,xlr_,yul_); }
+
+	// Copy the pixmap contents to the viewport
+	void copyPixmapToWindow();
+
+	// Set the dimensions of the paint device, according the box 
+	// given in world coordinates
+	bool setWorld(TeBox b, int w = 0, int h = 0, QPaintDevice *pd = 0);
+
+	// Set the dimensions of the paint device, creating or recreating the
+	// pixmaps accordingly
+	virtual bool setView(int w = 0, int h = 0, QPaintDevice* pd = 0);
+
+	// Adjust the box in world coordinates if the extend flag is true or set
+	// the canvas dimensions if the extend flag is false
+	void setTransformation(double xmin, double xmax, double ymin, double ymax, bool extend = true);
+
+	// Get the canvas box in world coordinates
+	TeBox getWorld() {return wc_ ;}
+
+	// Get the data box in world coordinates
+	TeBox getDataWorld();
+
+	// Clear the canvas viewport
+	void clear();
+
+	// Clear the viewport area corresponding to the given box 
+	void clear(TeBox box);
+
+	// Clear the viewport and all the pixmaps
+	void clearAll();
+
+	// Clear the area of the viewport and the area of all of the
+	// pixmaps corresponding to the given box 
+	void clearAll(TeBox box);
+
+	// Get the position of the viewport relative to the total canvas area
+	QPoint offset() {return QPoint(contentsX(), contentsY());}
+
+	// Map the given point in data world coordinates to 
+	// the corresponding point in the viewport
+	QPoint mapDWtoV(const TeCoord2D& dw);
+
+	// Map the given box in data world coordinates to 
+	// the corresponding box in the viewport
+	void mapDWtoV(TeBox& box);
+
+	// Map the points of a line in data world coordinates to
+	// the corresponding points in the viewport
+	QPointArray mapDWtoV(const TeLine2D&);
+
+	// Map the value in data world coordinates to 
+	// the corresponding value in the viewport
+	int mapDWtoV(double);
+
+	// Map the value in pixels in the viewport to 
+	// the corresponding value in the canvas world
+	double mapVtoCW(int);
+
+	// Map the point in the viewport to the 
+	// corresponding point in the canvas world
+	TeCoord2D mapVtoCW(const QPoint&);
+
+	// Map the box in the viewport to the 
+	// corresponding box in the canvas world
+	void mapVtoCW(TeBox& box);
+
+	// Map the value in pixels in the viewport to 
+	// the corresponding value in the data world
+	double mapVtoDW(int);
+
+	// Map the point in the viewport to the 
+	// corresponding point in the data world
+	TeCoord2D mapVtoDW(const QPoint&);
+
+	// Map the box in the canvas world coordinates to 
+	// the corresponding box in the data world coordinates
+	void mapCWtoDW(TeBox& box);
+
+	// Map the box in the data world coordinates to 
+	// the corresponding box in the canvas world coordinates
+	void mapDWtoCW(TeBox& box);
+
+	// Map the box in the canvas world coordinates to 
+	// the corresponding box in the viewport
+	void mapCWtoV(TeBox& box);
+
+	// Map the point in the canvas world coordinates to 
+	// the corresponding point in the viewport
+	QPoint mapCWtoV(const TeCoord2D& c);
+	 
+// Pixel size in world coordinates
+	double pixelSize () { return (xmax_-xmin_)/(double)width_; }
+
+// Set the projection of the next incoming data
+	void  setDataProjection ( TeProjection* proj );
+
+// Set the projection
+	void  setProjection ( TeProjection* proj);
+
+// Retrieve the canvas projection
+	TeProjection* projection() { return canvasProjection_; }
+
+// Retrieve flag that compare canvas projection and data projection
+	bool canvasAndDataProjectionEqual() {return canvasAndDataProjectionEqual_;};
+
+// Plotting primitives
+
+	QPainter* getPainter () {return &painter_;}
+	void plotOnWindow ();
+	void plotOnPixmap0 ();
+	void plotOnPixmap1 ();
+	void plotOnPixmap2 ();
+	virtual void copyPixmapToWindow(QPixmap*, int, int, int, int);
+	virtual void copyPixmap0ToPrinter();
+	virtual void copyPixmap0To(QPaintDevice*);
+	virtual void copyPixmap0ToWindow();
+	virtual void copyPixmap1ToWindow();
+	virtual void copyPixmap0ToWindow(int, int, int, int);
+	virtual void copyPixmap0ToPixmap1();
+	virtual void copyPixmap0ToPixmap1(int, int, int, int);
+	virtual void copyPixmap1ToPixmap0();
+	virtual void copyPixmap1ToPixmap0(int, int, int, int);
+	virtual void copyPixmap1ToPixmap2();
+	virtual void copyPixmap1ToPixmap2(int, int, int, int);
+	virtual void copyPixmap2ToPixmap1();
+	virtual void copyPixmap2ToPixmap1(int, int, int, int);
+	virtual void copyPanArea(int, int);
+
+	void plotPoint (const TeCoord2D &p);
+	void plotPoint (const TePoint &p){ plotPoint(p.location()); }
+
+	void setPointColor (int r, int g, int b);
+	void setPointStyle (int s, int w = 3);
+	void setPointPixmap (char* p);
+
+	void plotCell (TeCell &s, const bool& restoreBackground = false);
+
+	QRect getLegendRect (QPoint p, const QPixmap* pix, string tx);
+	void plotLegend (QPoint p, const QPixmap* pix, string tx);
+
+	void plotPolygon (const TePolygon &p, const bool& restoreBackground = false);
+	void setPolygonColor (int r, int g, int b);
+	void setPolygonStyle (int s, int width = 1);
+	void setPolygonLineColor (int r, int g, int b);
+	void setPolygonLineStyle (int s, int width = 1);
+
+	void plotLine (TeLine2D &l);
+	void plotArrow(QPointArray a);
+	void plotMiddleLineArrow(QPoint ptBegin, QPoint ptEnd);
+	void plotMiddleLineArrow(const TeLine2D &lne, QPointArray a);
+	void setLineColor (int r, int g, int b);
+	void setLineStyle (int s, int w = 1);
+	QPointArray	getArrow(QPoint ptBegin, QPoint ptEnd, double size);
+
+	void plotNode (TeNode &n);
+	void setNodeColor (int r, int g, int b);
+	void setNodeStyle (int s, int w = 4);
+	void setNodePixmap (char* p);
+
+	void plotArc (TeArc &a);
+	void setArcColor (int r, int g, int b);
+	void setArcStyle ( int s, int w = 1 );
+
+	void plotPie (double x, double y, double w, double h, double a, double alen);
+	void setPieColor (int r, int g, int b);
+	void plotRect (double x, double y, double w, double h, int transp=0, bool legend=false);
+	void plotRect (QRect&);
+	void setRectColor (int r, int g, int b);
+
+	void plotText (const TeCoord2D &p, const string &str, double angle = 0., double alignh = 0., double alignv = 0.);
+	void plotText (const TeText &tx, const TeVisual& visual);
+	QRect textRect (const TeText &tx, TeVisual visual);
+	void plotTextRects (TeText &tx, TeVisual visual);
+	void setTextColor (int r, int g, int b);
+	void setTextSize (int size);
+	void setTextStyle (string& family, int size, bool bold, bool italic);
+	void textExtent ( string &str, int &w, int &h, double angle = 0.);
+	void plotXorPolyline (QPointArray& PA, bool cdev=true);
+	void plotXorTextDistance(vector<QPointArray> xorPointArrayVec, double unitConv, string unit);
+
+	void setDB (TeDatabase* db) { db_ = db; }
+	void plotRaster (TeRaster* raster, TeRasterTransform* transf, TeQtProgress *progress);
+	void clearRaster();
+	void endPrinting();
+
+	QPixmap* getPixmap0 () {return pixmap0_; }
+	QPixmap* getPixmap1 () {return pixmap1_; }
+	QPixmap* getPixmap2 () {return pixmap2_; }
+
+	void plotGraphicScale(TeVisual& visual, double offsetX, double offsetY, double unitConv=1, const string& dunit="");
+
+	void setClipRegion(int x, int y, int w, int h);
+	void setClipRegion(QRegion region);
+	void setClipping (bool enable);
+
+	TeRasterParams& getParams()
+	{	return params_; }
+
+	double scaleApx() {return scaleApx_;}
+	void scaleApx(double);
+
+	double printerFactor() {return printerFactor_;}
+	void widthRef2PrinterFactor(int w) {widthRef2PrinterFactor_ = w;}
+	void plotLegend (const QPoint& p, TeLegendEntry* leg, const string& tx);
+	void plotLegend (const QPoint& p, const TeColor& cor, const string& tx);
+	bool locateGraphicScale(const QPoint& p);
+	QRect& graphicScaleRect() { return graphicScaleRect_;}
+	void numberOfPixmaps(int n) {numberOfPixmaps_ = n;}
+	int numberOfPixmaps() {return numberOfPixmaps_;}
+	QPopupMenu* popupCanvas() { return popupCanvas_; }
+
+
+signals:
+	void mousePressed (TeCoord2D&, int, QPoint&);
+	void mouseDoublePressed (TeCoord2D&, int, QPoint&);
+	void mouseRightButtonPressed (TeCoord2D&, int, QPoint&);
+	void mouseMoved (TeCoord2D&, int, QPoint&);
+	void mouseReleased (TeCoord2D&, int, QPoint&);
+	void mouseLeave ();
+	void paintEvent ();
+	void popupCanvasSignal(QMouseEvent*);
+	void keyPressed(QKeyEvent*);
+	void keyReleased(QKeyEvent*);
+	void zoomArea();
+
+protected:
+
+	TeDatabase*	db_;
+
+	QPainter	painter_;
+	QImage		qimage_;
+	QPopupMenu* popupCanvas_;
+	QPixmap*	pixmap0_;
+	QPixmap*	pixmap1_;
+	QPixmap*	pixmap2_;
+	int			numberOfPixmaps_;
+
+	TeProjection*	canvasProjection_;
+	TeProjection*	dataProjection_;
+
+	TeRaster*		backRaster_;
+	TeRasterParams	params_;
+
+	double	printerFactor_;
+	int		widthRef2PrinterFactor_;
+	QRect	graphicScaleRect_;
+	bool	canvasAndDataProjectionEqual_;
+	
+	// Sizes and transformations
+	TeBox	wc_;
+	double 	xmin_;
+	double 	xmax_;
+	double 	ymin_;
+	double 	ymax_;	
+	int		x0_;
+	int		y0_;
+	int		width_;
+	int		height_;
+	double	f_;
+	double	scaleApx_;
+	int		scale_;
+	int		lx1_;
+	int		ly1_;
+	int		lx2_;
+	int		ly2_;
+
+// Area Cursor section
+	CursorMode cursorMode_;
+	bool	down_;
+	double 	xul_; // cursor world coordinates
+	double 	xlr_;
+	double 	yul_;
+	double 	ylr_;
+	int 	ixul_; // cursor screen coordinates
+	int 	ixlr_;
+	int 	iyul_;
+	int 	iylr_;
+
+// Pie
+	QBrush		pieBrush_;
+	QColor		pieColor_;
+	QBrush		rectBrush_;
+	QColor		rectColor_;
+	
+// Polygon
+	int			polygonTransparency_;
+	QBrush		polygonBrush_;
+	QPen		polygonPen_;
+	QColor		polygonColor_;
+	map<TePolyBasicType, Qt::BrushStyle> brushStyleMap_;
+	
+// Line
+	QPen		linePen_;
+	QColor		lineColor_;
+	map<TeLnBasicType, Qt::PenStyle> penStyleMap_;
+	TeLnBasicType	_penStyle;
+	
+// Point
+	int			pointStyle_;
+	int			pointSize_;
+	QPen		pointPen_;
+	QColor		pointColor_;
+	QPixmap*	pointPixmap_;
+
+// Arc
+	QPen		arcPen_;
+	QColor		arcColor_;
+	
+// Node
+	int			nodeStyle_;
+	int			nodeSize_;
+	QPen		nodePen_;
+	QColor		nodeColor_;
+	QPixmap*	nodePixmap_;
+
+// Text
+	QPen		textPen_;
+	QColor		textColor_;
+	QFont		textFont_;
+	int			textSize_;
+
+// Draw Representations
+	void drawPolygonRep (QPoint p, int w, int h, TeVisual& v);
+	void drawLineRep (QPoint p, TeVisual& v);
+	void drawPointRep (QPoint p, TeVisual& v);
+	void plotMark(QPoint &p, int s, int w);
+
+// Mouse events
+	void contentsMousePressEvent( QMouseEvent* );
+	void contentsMouseMoveEvent ( QMouseEvent* );
+	void contentsMouseReleaseEvent ( QMouseEvent* );
+	void contentsMouseDoubleClickEvent ( QMouseEvent* );
+	void contentsContextMenuEvent( QContextMenuEvent* );
+
+// Leave Event
+	void leaveEvent(QEvent*);
+
+// Key events
+	void keyPressEvent(QKeyEvent*);
+	void keyReleaseEvent(QKeyEvent*);
+
+// Other events
+	void viewportPaintEvent(QPaintEvent* e);
+	void resizeEvent(QResizeEvent*);
+
+// Correct scrolling when there are scrollbars
+	void correctScrolling(QPoint &p);
+
+// Build Raster
+	bool buildRaster();
+};
+
+#endif
+
diff --git a/src/terralib/drivers/qt/TeQtChartItem.cpp b/src/terralib/drivers/qt/TeQtChartItem.cpp
old mode 100755
new mode 100644
index 2ffdd14..b040ae2
--- a/src/terralib/drivers/qt/TeQtChartItem.cpp
+++ b/src/terralib/drivers/qt/TeQtChartItem.cpp
@@ -1,87 +1,87 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <TeQtChartItem.h>
-#include <TeQtViewsListView.h>
-
-
-//Chart item constructor
-TeQtChartItem::TeQtChartItem(QListViewItem *parent,
-				QString text, TeColor color)
-	: TeQtCheckListItem(parent, text), color_(color)
-{
-	type_ = CHART;
-	name_ = text.latin1();
-	setRenameEnabled(0,true);
-	setSelected(false);
-	setEnabled(true);
-
-	order_ = parent->childCount();
-
-	//create pixmap
-	int	w = 21;
-	int	h = 16;
-
-	QPixmap pixmap(w, h);
-	pixmap.resize(w, h);
-	pixmap.fill();
-
-	QPainter p(&pixmap);
-	QBrush	 brush;
-	QColor	 qColor;
-
-	qColor.setRgb(color_.red_, color_.green_, color_.blue_);
-	brush.setColor(qColor);
-	brush.setStyle((Qt::BrushStyle)SolidPattern);
-
-	p.fillRect (1, 1, w-2, h-2, brush);
-	p.end();
-
-	setPixmap(0, pixmap);
-}
-
-void TeQtChartItem::changeColor(TeColor color)
-{
-	color_ = color;
-
-	int	w = 21;
-	int	h = 16;
-
-	QPixmap pixmap(w, h);
-	pixmap.resize(w, h);
-	pixmap.fill();
-
-	QPainter p(&pixmap);
-	QBrush	 brush;
-	QColor	 qColor;
-
-	qColor.setRgb(color_.red_, color_.green_, color_.blue_);
-	brush.setColor(qColor);
-	brush.setStyle((Qt::BrushStyle)SolidPattern);
-
-	p.fillRect (1, 1, w-2, h-2, brush);
-	p.end();
-
-	setPixmap(0, pixmap);
-	repaint();
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <qpixmap.h>
+#include <qpainter.h>
+#include <TeQtChartItem.h>
+#include <TeQtViewsListView.h>
+
+
+//Chart item constructor
+TeQtChartItem::TeQtChartItem(QListViewItem *parent,
+				QString text, TeColor color)
+	: TeQtCheckListItem(parent, text), color_(color)
+{
+	type_ = CHART;
+	name_ = text.latin1();
+	setRenameEnabled(0,true);
+	setSelected(false);
+	setEnabled(true);
+
+	order_ = parent->childCount();
+
+	//create pixmap
+	int	w = 21;
+	int	h = 16;
+
+	QPixmap pixmap(w, h);
+	pixmap.resize(w, h);
+	pixmap.fill();
+
+	QPainter p(&pixmap);
+	QBrush	 brush;
+	QColor	 qColor;
+
+	qColor.setRgb(color_.red_, color_.green_, color_.blue_);
+	brush.setColor(qColor);
+	brush.setStyle((Qt::BrushStyle)SolidPattern);
+
+	p.fillRect (1, 1, w-2, h-2, brush);
+	p.end();
+
+	setPixmap(0, pixmap);
+}
+
+void TeQtChartItem::changeColor(TeColor color)
+{
+	color_ = color;
+
+	int	w = 21;
+	int	h = 16;
+
+	QPixmap pixmap(w, h);
+	pixmap.resize(w, h);
+	pixmap.fill();
+
+	QPainter p(&pixmap);
+	QBrush	 brush;
+	QColor	 qColor;
+
+	qColor.setRgb(color_.red_, color_.green_, color_.blue_);
+	brush.setColor(qColor);
+	brush.setStyle((Qt::BrushStyle)SolidPattern);
+
+	p.fillRect (1, 1, w-2, h-2, brush);
+	p.end();
+
+	setPixmap(0, pixmap);
+	repaint();
+}
diff --git a/src/terralib/drivers/qt/TeQtChartItem.h b/src/terralib/drivers/qt/TeQtChartItem.h
old mode 100755
new mode 100644
index db3f876..33ca172
--- a/src/terralib/drivers/qt/TeQtChartItem.h
+++ b/src/terralib/drivers/qt/TeQtChartItem.h
@@ -1,63 +1,63 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTCHARTITEM_H
-#define  __TERRALIB_INTERNAL_QTCHARTITEM_H
-
-#include "TeQtCheckListItem.h"
-#include "TeVisual.h"
-
-
-class TeQtChartItem : public TeQtCheckListItem
-{
-public:
-    TeQtChartItem(QListViewItem *parent, QString text, TeColor color);
-
-	~TeQtChartItem () {}
-
-	TeColor color()
-		{ return color_; }
-
-	void changeColor(TeColor color);
-
-	string name() {return name_;}
-
-protected:
-	TeColor color_;
-	string name_;
-};
-
-
-class TeQtChartTitleItem : public TeQtCheckListItem
-{
-public:
-    TeQtChartTitleItem(QListViewItem *parent, QString text)
-	: TeQtCheckListItem(parent, text)
-	{
-		type_ = CHARTTITLE;
-		order_ = parent->childCount();
-	}
-
-	~TeQtChartTitleItem() {}
-};
-
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTCHARTITEM_H
+#define  __TERRALIB_INTERNAL_QTCHARTITEM_H
+
+#include "TeQtCheckListItem.h"
+#include "TeVisual.h"
+
+
+class TLAPPUTILS_DLL TeQtChartItem : public TeQtCheckListItem
+{
+public:
+    TeQtChartItem(QListViewItem *parent, QString text, TeColor color);
+
+	~TeQtChartItem () {}
+
+	TeColor color()
+		{ return color_; }
+
+	void changeColor(TeColor color);
+
+	string name() {return name_;}
+
+protected:
+	TeColor color_;
+	string name_;
+};
+
+
+class TLAPPUTILS_DLL TeQtChartTitleItem : public TeQtCheckListItem
+{
+public:
+    TeQtChartTitleItem(QListViewItem *parent, QString text)
+	: TeQtCheckListItem(parent, text)
+	{
+		type_ = CHARTTITLE;
+		order_ = parent->childCount();
+	}
+
+	~TeQtChartTitleItem() {}
+};
+
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtCheckListItem.cpp b/src/terralib/drivers/qt/TeQtCheckListItem.cpp
old mode 100755
new mode 100644
index 32bc231..bb4dc54
--- a/src/terralib/drivers/qt/TeQtCheckListItem.cpp
+++ b/src/terralib/drivers/qt/TeQtCheckListItem.cpp
@@ -1,97 +1,97 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtCheckListItem.h>
-#include <TeUtils.h>
-#include <vector>
-#include <cstdlib>
-
-
-int TeQtCheckListItem::compare (QListViewItem *i, int col, bool ascending) const
-{
-	int order1 = atoi(key(col, ascending).latin1());
-	int order2 = atoi(i->key(col, ascending).latin1());
-
-	if (order1 < order2)
-		return -1;
-	else if (order1 == order2)
-		return 0;
-	else 
-		return 1;
-}
-
-
-QString TeQtCheckListItem::key ( int /* col */, bool /* ascending */ ) const
-{
-	return Te2String(order_).c_str();
-}
-
-
-vector<QListViewItem*> TeQtCheckListItem::getChildren()
-{
-	vector<QListViewItem*> childrenVector;
-
-	QListViewItem *child = firstChild();
-    while (child)
-	{
-		childrenVector.push_back(child);
-        child = child->nextSibling();
-	}
-	return childrenVector;
-}
-
-
-void TeQtCheckListItem::unselectChildren()
-{
-	TeQtCheckListItem *item;
-	int n = childCount();
-	int i = 0;
-
-	if (n == 0)
-		return;
-
-	QListViewItemIterator it(this);
-	++it;
-	item = (TeQtCheckListItem*)(it.current());
-	while(item)
-	{
-		if (item->parent() == this)
-		{
-			item->setSelected(false);
-			item->repaint();
-			++i;
-		}
-		if (i == n)
-			break;
-		++it;
-		item = (TeQtCheckListItem*)(it.current());
-	}
-}
-
-
-bool TeQtCheckListItem::isChild(QListViewItem *item)
-{
-	if (item->parent() == this)
-		return true;
-	else
-		return false;
-}
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeQtCheckListItem.h>
+#include <TeUtils.h>
+#include <vector>
+#include <cstdlib>
+
+
+int TeQtCheckListItem::compare (QListViewItem *i, int col, bool ascending) const
+{
+	int order1 = atoi(key(col, ascending).latin1());
+	int order2 = atoi(i->key(col, ascending).latin1());
+
+	if (order1 < order2)
+		return -1;
+	else if (order1 == order2)
+		return 0;
+	else 
+		return 1;
+}
+
+
+QString TeQtCheckListItem::key ( int /* col */, bool /* ascending */ ) const
+{
+	return Te2String(order_).c_str();
+}
+
+
+vector<QListViewItem*> TeQtCheckListItem::getChildren()
+{
+	vector<QListViewItem*> childrenVector;
+
+	QListViewItem *child = firstChild();
+    while (child)
+	{
+		childrenVector.push_back(child);
+        child = child->nextSibling();
+	}
+	return childrenVector;
+}
+
+
+void TeQtCheckListItem::unselectChildren()
+{
+	TeQtCheckListItem *item;
+	int n = childCount();
+	int i = 0;
+
+	if (n == 0)
+		return;
+
+	QListViewItemIterator it(this);
+	++it;
+	item = (TeQtCheckListItem*)(it.current());
+	while(item)
+	{
+		if (item->parent() == this)
+		{
+			item->setSelected(false);
+			item->repaint();
+			++i;
+		}
+		if (i == n)
+			break;
+		++it;
+		item = (TeQtCheckListItem*)(it.current());
+	}
+}
+
+
+bool TeQtCheckListItem::isChild(QListViewItem *item)
+{
+	if (item->parent() == this)
+		return true;
+	else
+		return false;
+}
+
diff --git a/src/terralib/drivers/qt/TeQtCheckListItem.h b/src/terralib/drivers/qt/TeQtCheckListItem.h
old mode 100755
new mode 100644
index f2be92a..b9426e5
--- a/src/terralib/drivers/qt/TeQtCheckListItem.h
+++ b/src/terralib/drivers/qt/TeQtCheckListItem.h
@@ -1,80 +1,82 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTCHECKLISTITEM_H
-#define  __TERRALIB_INTERNAL_QTCHECKLISTITEM_H
-
-#include <qlistview.h>
-#include <vector>
-#include <qpainter.h>
-#include <qpalette.h>
-
-using namespace std;
-
-
-class TeQtCheckListItem : public QCheckListItem
-{
-
-public:
-	enum ItemType {DATABASE, INFOLAYER, VIEW, THEME, LEGENDTITLE, LEGEND, CHARTTITLE, CHART};
-
-    TeQtCheckListItem(QListView *parent, QString text, QCheckListItem::Type ctype = QCheckListItem::Controller)
-		: QCheckListItem(parent, text, ctype) {}
- 
-	TeQtCheckListItem(QListViewItem *parent, QString text, QCheckListItem::Type ctype = QCheckListItem::Controller)
-		: QCheckListItem(parent, text, ctype) {}
-
-	TeQtCheckListItem(QCheckListItem *parent, QString text, QCheckListItem::Type ctype = QCheckListItem::Controller)
-	: QCheckListItem(parent, text, ctype) {}
-	
-	virtual ~TeQtCheckListItem() {}
-
-	ItemType getType() {return type_;}
-	
-	int order()
-		{return order_;}
-
-	void order(int order)
-		{order_ = order;}
-
-	virtual int compare(QListViewItem * i, int col, bool ascending) const;
-
-	virtual QString key(int column, bool ascending) const;
-
-	vector<QListViewItem*> getChildren();
-
-	void unselectChildren();
-
-	bool isChild(QListViewItem *item);
-
-	void cancelRename(int col)
-		{ QListViewItem::cancelRename(col); }
-
-	virtual void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align)
-		{ QCheckListItem::paintCell(p, cg, column, width, align); }
-
-
-protected:
-	ItemType type_;
-	int order_;
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTCHECKLISTITEM_H
+#define  __TERRALIB_INTERNAL_QTCHECKLISTITEM_H
+
+#include <qlistview.h>
+#include <vector>
+#include <qpainter.h>
+#include <qpalette.h>
+
+#include <TeAppUtilsDefines.h>
+
+using namespace std;
+
+
+class TLAPPUTILS_DLL TeQtCheckListItem : public QCheckListItem
+{
+
+public:
+	enum ItemType {DATABASE, INFOLAYER, VIEW, THEME, LEGENDTITLE, LEGEND, CHARTTITLE, CHART};
+
+    TeQtCheckListItem(QListView *parent, QString text, QCheckListItem::Type ctype = QCheckListItem::Controller)
+		: QCheckListItem(parent, text, ctype) {}
+ 
+	TeQtCheckListItem(QListViewItem *parent, QString text, QCheckListItem::Type ctype = QCheckListItem::Controller)
+		: QCheckListItem(parent, text, ctype) {}
+
+	TeQtCheckListItem(QCheckListItem *parent, QString text, QCheckListItem::Type ctype = QCheckListItem::Controller)
+	: QCheckListItem(parent, text, ctype) {}
+	
+	virtual ~TeQtCheckListItem() {}
+
+	ItemType getType() {return type_;}
+	
+	int order()
+		{return order_;}
+
+	void order(int order)
+		{order_ = order;}
+
+	virtual int compare(QListViewItem * i, int col, bool ascending) const;
+
+	virtual QString key(int column, bool ascending) const;
+
+	vector<QListViewItem*> getChildren();
+
+	void unselectChildren();
+
+	bool isChild(QListViewItem *item);
+
+	void cancelRename(int col)
+		{ QListViewItem::cancelRename(col); }
+
+	virtual void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align)
+		{ QCheckListItem::paintCell(p, cg, column, width, align); }
+
+
+protected:
+	ItemType type_;
+	int order_;
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtColorBar.cpp b/src/terralib/drivers/qt/TeQtColorBar.cpp
old mode 100755
new mode 100644
index d91d97f..63916c8
--- a/src/terralib/drivers/qt/TeQtColorBar.cpp
+++ b/src/terralib/drivers/qt/TeQtColorBar.cpp
@@ -1,1100 +1,1100 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-************************************************************************************/
-
-#include <qcolordialog.h>
-#include <TeUtils.h>
-#include <TeColorUtils.h>
-#include <TeQtColorBar.h>
-#include <qcursor.h>
-#include <qpopupmenu.h>
-#include <qpainter.h>
-#include <help.h>
-#include <algorithm>
-
-TeQtColorBar::TeQtColorBar(QWidget* parent, const char* name)
-	:QFrame(parent, name)
-{
-	help_ = 0;
-	vertical_ = true;
-	upDown_ = false;
-	colorEdit_ = 0;
-
-	ftam_ = frameRect().width();
-	if(vertical_)
-		ftam_ = frameRect().height();
-
-	popupMenu_.insertItem(tr("Add Color..."), this, SLOT(addColorSlot()));
-	popupMenu_.insertItem(tr("Change Color..."), this, SLOT(changeColorSlot()));
-	popupMenu_.insertItem(tr("Remove Color"), this, SLOT(removeColorSlot()));
-	popupMenu_.insertItem(tr("Help..."), this, SLOT(helpSlot()));
-}
-
-void TeQtColorBar::setVerticalBar(bool b)
-{
-	vertical_ = b;
-
-	ftam_ = frameRect().width();
-	if(vertical_)
-		ftam_ = frameRect().height();
-}
-
-void TeQtColorBar::setColorBar(const vector<ColorBar>& colorBarVec)
-{
-	inputColorVec_.clear();
-	inputColorVec_ = colorBarVec;
-
-	sort(inputColorVec_.begin(), inputColorVec_.end());
-
-	if((int)inputColorVec_.empty() == false)
-		inputColorVec_[0].distance_ = 0.;
-
-	generateColorMap();
-}
-
-void TeQtColorBar::setColorBar(const vector<TeColor>& colorVec)
-{
-	int	i;
-
-	inputColorVec_.clear();
-	vector<ColorBar> cbVec;
-	ColorBar cb;
-
-	for(i=0; i<(int)colorVec.size(); i++)
-	{
-		cb.color(colorVec[i]);
-		cbVec.push_back(cb);
-	}
-	if(cbVec.size() == 1)
-	{
-		TeColor c = colorVec[0];
-		c.red_ = c.red_ / 5;
-		c.green_ = c.green_ / 5;
-		c.blue_ = c.blue_ / 5;
-
-		cb.color(c);
-		cbVec.push_back(cb);
-	}
-
-	for(i=0; i<(int)cbVec.size(); ++i)
-	{
-		cbVec[i].distance_ = (double)i;
-		inputColorVec_.push_back(cbVec[i]);
-	}
-
-	generateColorMap();
-}
-
-void TeQtColorBar::setColorBarFromNames(string colors)
-{
-	int	i;
-	if(colors.empty())
-		colors = tr("R").latin1();
-
-	vector<string> colorNameVec;
-	QString s = colors.c_str();
-	QStringList ss = QStringList::split("-",s,true);
-
-	for(i = 0; i < (int)ss.size(); i++)
-	{
-		QString a = ss[i];
-		if(tr("R") == a)
-			colorNameVec.push_back("RED");
-		else if(tr("G") == a)
-			colorNameVec.push_back("GREEN");
-		else if(tr("B") == a)
-			colorNameVec.push_back("BLUE");
-		else if(tr("Cy") == a)
-			colorNameVec.push_back("CYAN");
-		else if(tr("Or") == a)
-			colorNameVec.push_back("ORANGE");
-		else if(tr("Mg") == a)
-			colorNameVec.push_back("MAGENTA");
-		else if(tr("Y") == a)
-			colorNameVec.push_back("YELLOW");
-		else
-			colorNameVec.push_back("GRAY");
-	}
-
-	TeColor	RGB;
-	map<string, TeColor> mapcor;
-
-	RGB.name_ = "RED";
-	RGB.red_ = 240;
-	RGB.green_ = 0;
-	RGB.blue_ = 0;
-	mapcor["RED"] = RGB;
-
-	RGB.name_ = "GREEN";
-	RGB.red_ = 0;
-	RGB.green_ = 240;
-	RGB.blue_ = 0;
-	mapcor["GREEN"] = RGB;
-
-	RGB.name_ = "BLUE";
-	RGB.red_ = 0;
-	RGB.green_ = 0;
-	RGB.blue_ = 240;
-	mapcor["BLUE"] = RGB;
-
-	RGB.name_ = "YELLOW";
-	RGB.red_ = 255;
-	RGB.green_ = 255;
-	RGB.blue_ = 100;
-	mapcor["YELLOW"] = RGB;
-
-	RGB.name_ = "CYAN";
-	RGB.red_ = 100;
-	RGB.green_ = 255;
-	RGB.blue_ = 255;
-	mapcor["CYAN"] = RGB;
-
-	RGB.name_ = "MAGENTA";
-	RGB.red_ = 255;
-	RGB.green_ = 100;
-	RGB.blue_ = 255;
-	mapcor["MAGENTA"] = RGB;
-
-	RGB.name_ = "ORANGE";
-	RGB.red_ = 255;
-	RGB.green_ = 140;
-	RGB.blue_ = 0;
-	mapcor["ORANGE"] = RGB;
-
-	RGB.name_ = "GRAY";
-	RGB.red_ = 240;
-	RGB.green_ = 240;
-	RGB.blue_ = 240;
-	mapcor["GRAY"] = RGB;
-
-	RGB.name_ = "BLACK";
-	RGB.red_ = 0;
-	RGB.green_ = 0;
-	RGB.blue_ = 0;
-	mapcor["BLACK"] = RGB;
-
-	vector<ColorBar> cbVec;
-	for(i=0; i<(int)colorNameVec.size(); ++i)
-	{
-		ColorBar cb;
-		cb.color(mapcor[colorNameVec[i]]);
-		cbVec.push_back(cb);
-	}
-	if(inputColorVec_.size() == 1)
-	{
-		ColorBar cb;
-		TeColor c = inputColorVec_[0].cor_;
-
-		c.red_ = c.red_ / 5;
-		c.green_ = c.green_ / 5;
-		c.blue_ = c.blue_ / 5;
-
-		cb.color(c);
-		cbVec.push_back(cb);
-	}
-
-	inputColorVec_.clear();
-	for(i=0; i<(int)cbVec.size(); ++i)
-	{
-		cbVec[i].distance_ = (double)i;
-		inputColorVec_.push_back(cbVec[i]);
-	}
-
-	generateColorMap();
-}
-
-void TeQtColorBar::generateColorMap()
-{
-	sortByDistance();
-	generateColorBarMap(inputColorVec_, ftam_, colorMap_);
-	totalDistance_ = 1.;
-	if(inputColorVec_.empty() == false)
-		totalDistance_ = inputColorVec_[inputColorVec_.size()-1].distance_;
-}
-
-void TeQtColorBar::drawColorBar()
-{
-	if(colorMap_.empty())
-		return;
-
-	int	i, j = 0, size, tsize;
-	QColor cor;
-	map<int, vector<TeColor> > :: iterator it = colorMap_.begin();
-	QRect rect = frameRect();
-	int w = rect.width();
-	int	h = rect.height();
-	changeVec_.clear();
-	changeVec_.push_back(0);
-	QPainter painter(this);
-
-	tsize = w;
-	if(vertical_)
-		tsize = h;
-
-	while(it != colorMap_.end())
-	{
-		vector<TeColor>& colorVec = it->second;
-		size = (int)colorVec.size();
-
-		i = 0;
-		while(i < size)
-		{
-			cor.setRgb(colorVec[i].red_, colorVec[i].green_, colorVec[i].blue_);
-			painter.setPen(cor);
-			if(vertical_)
-			{
-				if(upDown_)
-				{
-					painter.lineTo(0, j);
-					painter.moveTo(w-7, j);
-				}
-				else
-				{
-					painter.lineTo(0, h-j);
-					painter.moveTo(w-7, h-j);
-				}
-			}
-			else
-			{
-				painter.lineTo(j, 7);
-				painter.moveTo(j, h);
-			}
-			i++;
-			j++;
-		}
-		it++;
-		if(it == colorMap_.end())
-		{
-			while(j < tsize)
-			{
-				if(vertical_)
-				{
-					if(upDown_)
-					{
-						painter.lineTo(0, j);
-						painter.moveTo(w-7, j);
-					}
-					else
-					{
-						painter.lineTo(0, h-j);
-						painter.moveTo(w-7, h-j);
-					}
-				}
-				else
-				{
-					painter.lineTo(j, 7);
-					painter.moveTo(j, h);
-				}
-				j++;
-			}
-		}
-		if(j-1 < 0)
-			changeVec_.push_back(0);
-		else if(j >= tsize)
-			changeVec_.push_back(tsize-1);
-		else
-			changeVec_.push_back(j);
-	}
-
-	painter.setPen(QColor(black));
-	painter.setBrush(QColor(white));
-
-	QRect ru(0, 0, w, 7);
-	if(vertical_)
-		ru.setRect(w-7, 0, 7, h);
-	painter.drawRect(ru);
-
-	QPointArray pa(4);
-	if(vertical_)
-	{
-		pa.setPoint(0, 0, 0);
-		pa.setPoint(1, 6, -3);
-		pa.setPoint(2, 6, 3);
-		pa.setPoint(3, 0, 0);
-		painter.drawPolygon(pa);
-		pa.translate(0, h-1);
-		painter.drawPolygon(pa);
-		pa.translate(0, -(h-1));
-		if(!upDown_)
-			pa.translate(0, h);
-
-	}
-	else
-	{
-		pa.setPoint(0, -3, 0);
-		pa.setPoint(1, 3, 0);
-		pa.setPoint(2, 0, 6);
-		pa.setPoint(3, -3, 0);
-		painter.drawPolygon(pa);
-		pa.translate(w-1, 0);
-		painter.drawPolygon(pa);
-		pa.translate(-(w-1), 0);
-	}
-
-	it = colorMap_.begin();
-	while(it != colorMap_.end())
-	{
-		j = it->second.size();
-		it++;
-		if(it != colorMap_.end())
-		{
-			if(vertical_)
-			{
-				if(upDown_)
-					pa.translate(0, j);
-				else
-					pa.translate(0, -j);
-			}
-			else
-				pa.translate(j, 0);
-			painter.drawPolygon(pa);
-		}
-	}
-
-	painter.setBrush(Qt::NoBrush);
-	painter.setPen(QColor(black));
-
-	double pd = (double)tsize / 10.;
-	int	t;
-	for(i=0; i<10; ++i)
-	{
-		t = 5;
-		if(i%2)
-			t = 3;
-
-		int a = TeRound((double)i * pd);
-		if(vertical_)
-		{
-			painter.moveTo(0, a);
-			painter.lineTo(t, a);
-		}
-		else
-		{
-			painter.moveTo(a, h);
-			painter.lineTo(a, h-t);
-		}
-	}
-
-	painter.drawRect(rect);
-}
-
-void TeQtColorBar::paintEvent(QPaintEvent*)
-{
-	drawColorBar();
-}
-
-void TeQtColorBar::mousePressEvent(QMouseEvent* e)
-{
-	if(colorMap_.empty())
-		return;
-	p_ = e->pos();
-	ind_ = getColorIndiceToChange();
-
-	if(e->button() == Qt::RightButton)
-	{
-		if(change_)
-		{
-			popupMenu_.setItemEnabled(popupMenu_.idAt(0), false); // add color
-			popupMenu_.setItemEnabled(popupMenu_.idAt(1), true); // change color
-			if(colorMap_.size() <= 1)
-				popupMenu_.setItemEnabled(popupMenu_.idAt(2), false); // remove color
-			else
-				popupMenu_.setItemEnabled(popupMenu_.idAt(2), true); // remove color
-		}
-		else
-		{
-			popupMenu_.setItemEnabled(popupMenu_.idAt(0), true); // add color
-			popupMenu_.setItemEnabled(popupMenu_.idAt(1), false); // change color
-			popupMenu_.setItemEnabled(popupMenu_.idAt(2), false); // remove color
-		}
-	
-		setCursor(QCursor(Qt::ArrowCursor));
-		QPoint	mp(e->globalPos().x(), e->globalPos().y());
-		popupMenu_.exec(mp);
-	}
-}
-
-void TeQtColorBar::mouseDoubleClickEvent(QMouseEvent* e)
-{
-	ind_ = getColorIndiceToChange();
-
-	if(change_)
-	{
-		if(vertical_)
-		{
-			if(e->pos().x() >= frameRect().width()-7)
-				changeColorSlot();
-			else
-				removeColorSlot();			
-		}
-		else
-		{
-			if(e->pos().y() <= 7)
-				changeColorSlot();
-			else
-				removeColorSlot();
-		}
-	}
-	else
-		addColorSlot();
-}
-
-void TeQtColorBar::mouseMoveEvent(QMouseEvent* e)
-{
-	if(colorMap_.empty())
-		return;
-	pa_ = e->pos();
-	if(e->state() == Qt::NoButton) // set cursor
-	{
-		ind_ = getColorIndiceToChange();
-		QCursor cursor;
-		if(distance_)
-		{
-			if(vertical_)
-				cursor.setShape(Qt::SplitVCursor);
-			else
-				cursor.setShape(Qt::SplitHCursor);
-		}
-		else if(change_ && brightness_)
-		{
-			if(vertical_)
-				cursor.setShape(Qt::SplitHCursor);
-			else
-				cursor.setShape(Qt::SplitVCursor);
-		}
-
-		setCursor(cursor);
-	}
-	else
-	{
-		if(((cursor().shape() == Qt::SplitVCursor) && vertical_) || ((cursor().shape() == Qt::SplitHCursor) && !vertical_))
-			changeDistance();
-		else if(((cursor().shape() == Qt::SplitVCursor) && !vertical_) || ((cursor().shape() == Qt::SplitHCursor) && vertical_))
-		{
-			if(e->state() & Qt::LeftButton)
-			{
-				if(e->state() == Qt::LeftButton)
-					changeBrightness();
-				else
-					changeHue();					
-			}
-			else if(e->state() == Qt::MidButton)
-				changeSaturation();
-		}
-		else
-		{
-			QCursor cursor(Qt::SizeVerCursor);
-			setCursor(cursor);
-
-			if(e->state() == Qt::LeftButton)
-				changeAllBrightness();
-			else if(e->state() == Qt::MidButton)
-				changeAllSaturation();
-		}
-	}
-	p_ = e->pos();
-}
-
-void TeQtColorBar::mouseReleaseEvent(QMouseEvent*)
-{
-	QCursor cursor;
-	setCursor(cursor);
-}
-
-void TeQtColorBar::leaveEvent(QEvent*)
-{
-}
-
-void TeQtColorBar::addColorSlot()
-{
-	int ind = ind_;
-	TeColor cor;
-
-  	bool isOK = false;
-	QColor inputColor(255, 255, 255);
-	QColor outputColor = QColorDialog::getRgba (inputColor.rgb(), &isOK, this);
-	if (isOK)
-	{
-		cor.init(outputColor.red(), outputColor.green(), outputColor.blue());
-		ColorBar cb;
-		double dist = (double)a_ * totalDistance_ / (double)(ftam_-1);
-		cb.color(cor);
-		cb.distance_ = dist;
-
-		vector<ColorBar> bcor = inputColorVec_;
-		inputColorVec_.clear();
-		int i;
-		for(i=0; i<(int)bcor.size(); ++i)
-		{
-			if(i == ind+1)
-				inputColorVec_.push_back(cb);
-			inputColorVec_.push_back(bcor[i]);
-		}
-		generateColorMap();
-		drawColorBar();
-		emit colorChangedSignal();
-	}	
-}
-
-void TeQtColorBar::changeColorSlot()
-{
-	int ind = ind_;
-
-	if((int)inputColorVec_.size() <= ind)
-		return;
-	ColorBar& cb = inputColorVec_[ind];
-	TeColor cor = cb.cor_;
-
-  	bool isOK = false;
-	QColor inputColor(cor.red_, cor.green_, cor.blue_);
-	QColor outputColor = QColorDialog::getRgba (inputColor.rgb(), &isOK, this);
-	if (isOK)
-	{
-		cor.init(outputColor.red(), outputColor.green(), outputColor.blue());
-		cb.color(cor);
-		generateColorMap();
-		drawColorBar();
-		emit colorChangedSignal();
-	}
-}
-
-void TeQtColorBar::removeColorSlot()
-{
-	int i;
-
-	if(ind_ == 0 || ind_ == (int)inputColorVec_.size()-1)
-		return;
-
-	vector<ColorBar> bcor = inputColorVec_;
-	inputColorVec_.clear();
-
-	for(i=0; i<(int)bcor.size(); ++i)
-	{
-		if(i == ind_)
-			continue;
-		inputColorVec_.push_back(bcor[i]);
-	}
-//	if(inputColorVec_.size() == 1)
-//		inputColorVec_.push_back(inputColorVec_[0]);
-
-	QCursor cursor;
-	setCursor(cursor);
-	generateColorMap();
-	drawColorBar();
-	emit colorChangedSignal();
-}
-
-int TeQtColorBar::getColorIndiceToChange()
-{
-	int	i, j, ind;
-	distance_ = false;
-	change_ = false;
-
-	fitMousePosition(p_);
-
-	limit_ = inf_ = sup_ = ind = -1;
-	for(i=0; i<(int)changeVec_.size(); ++i)
-	{
-		j = changeVec_[i];
-		if((a_ >= j-2) && (a_ <= j+2))
-		{
-			ind = i;
-			change_ = true;
-			distance_ = true;
-			break;
-		}
-	}
-
-	if(ind == 0)
-	{
-		for(i=1; i<(int)changeVec_.size()-1; ++i)
-		{
-			j = changeVec_[i];
-			if((a_ >= j-2) && (a_ <= j+2))
-			{
-				ind = i;
-				break;
-			}
-		}
-	}
-
-	if(ind == -1)
-	{
-		int jj;
-		for(i=0; i<(int)changeVec_.size()-1; ++i)
-		{
-			j = changeVec_[i];
-			jj = changeVec_[i+1];
-			if((a_ > j+2) && (a_ < jj-2))
-			{
-				ind = i;
-				break;
-			}
-		}
-	}
-	
-	if(brightness_ || ind == 0 || ind == (int)changeVec_.size() - 2)
-		distance_ = false;
-
-	if(distance_)
-	{
-		limit_ = ind - 1;
-		if((int)changeVec_.size() > limit_+2)
-		{
-			inf_ = changeVec_[limit_];
-			sup_ = changeVec_[limit_+2];
-			colorEdit_ = &(inputColorVec_[limit_+1]);
-		}
-	}
-
-	if(ind < 0)
-		ind = 0;
-	else if(ind > (int)inputColorVec_.size()-1)
-		ind = (int)inputColorVec_.size()-1;
-
-	return ind;
-}
-
-void TeQtColorBar::fitMousePosition(QPoint p)
-{
-	brightness_ = false;
-	QRect rect = frameRect();
-
-	if(vertical_)
-	{
-		ftam_ = rect.height();
-		if(upDown_)
-			a_ = p.y();
-		else
-			a_ = ftam_ - p.y();
-		b_ = p.x();
-
-		if(p.x() >= rect.width() - 7 && p.x() <= rect.width())
-			brightness_ = true;
-	}
-	else
-	{
-		ftam_ = rect.width();
-		a_ = p.x();
-		b_ = p.y();
-		if(p.y() <= 7)
-			brightness_ = true;
-	}
-
-	if(a_ < 0)
-		a_ = 0;
-	else if(a_ > ftam_)
-		a_ = ftam_;
-}
-
-void TeQtColorBar::changeDistance()
-{
-	fitMousePosition(pa_);
-	int nc = changeVec_[changeVec_.size()-1];
-
-	if(colorEdit_ && a_ >= nc) // end of bar
-	{
-		a_ = nc;
-		int t = (int)inputColorVec_.size();
-
-		colorEdit_->distance_ = totalDistance_;
-		double d = inputColorVec_[t-3].distance_;
-		d = d + (totalDistance_ - d) * .8;
-		inputColorVec_[t-1].distance_ = d;
-		QCursor cursor;
-		setCursor(cursor);
-		colorEdit_ = 0;
-	}
-	else if (a_ <= 0)
-	{
-		a_ = 0;
-
-		colorEdit_->distance_ = 0.;
-		int t = changeVec_[2];
-		double dist = .2 * (double)t * totalDistance_ / (double)(ftam_-1);
-		inputColorVec_[0].distance_ = dist;
-		QCursor cursor;
-		setCursor(cursor);
-		colorEdit_ = 0;
-
-	}
-	else
-	{
-		colorEdit_->distance_ = (double)a_ * totalDistance_ / (double)(ftam_-1);
-	}
-	generateColorMap();
-	drawColorBar();
-	emit colorChangedSignal();
-}
-
-void TeQtColorBar::sortByDistance()
-{
-	multimap<double, ColorBar> mMap;
-	typedef pair <double, ColorBar> myPair;	
-	int i;
-	double dist;
-
-	for(i=0; i<(int)inputColorVec_.size(); ++i)
-	{
-		double d = inputColorVec_[i].distance_;
-		if(&(inputColorVec_[i]) == colorEdit_)
-		{
-			dist = inputColorVec_[i].distance_;
-			inputColorVec_[i].distance_ = -1.;
-		}
-		mMap.insert(myPair(d, inputColorVec_[i]));
-	}
-
-	inputColorVec_.clear();
-	multimap<double, ColorBar>::iterator it;
-
-	for(it = mMap.begin(); it!= mMap.end(); it++)
-		inputColorVec_.push_back(it->second);
-
-	for(i=0; i<(int)inputColorVec_.size(); ++i)
-	{
-		ColorBar cb = inputColorVec_[i];
-		if(cb.distance_ == -1)
-		{
-			inputColorVec_[i].distance_ = dist;
-			colorEdit_ = &(inputColorVec_[i]);
-			break;
-		}
-	}
-}
-
-void TeQtColorBar::changeAllBrightness()
-{
-	double	dif;
-	int ind;
-
-	fitMousePosition(pa_);
-
-	if(vertical_)
-		dif = 6.*(double)(p_.x() - b_);
-	else
-		dif = 6.*(double)(p_.y() - b_);
-
-
-	for(ind=0; ind<(int)inputColorVec_.size(); ++ind)
-	{
-		ColorBar cb = inputColorVec_[ind];
-		cb.v_ += (int)dif;
-
-		int v = 1;
-		if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
-			v = 0;
-
-		if(cb.v_ > 255)
-			return;
-		if(cb.v_ < v)
-			return;
-	}
-
-	for(ind=0; ind<(int)inputColorVec_.size(); ++ind)
-	{
-		ColorBar& cb = inputColorVec_[ind];
-		cb.v_ += (int)dif;
-
-		int v = 1;
-		if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
-			v = 0;
-
-		if(cb.v_ > 255)
-			cb.v_ = 255;
-		if(cb.v_ < v)
-			cb.v_ = v;
-
-		QColor cor;
-		cor.setHsv(cb.h_, cb.s_, cb.v_);
-		TeColor tc(cor.red(), cor.green(),cor.blue());
-		cb.color(tc);
-	}
-	generateColorMap();
-	drawColorBar();
-	emit colorChangedSignal();
-}
-
-void TeQtColorBar::changeBrightness()
-{
-	double	dif;
-	int ind = ind_;
-
-	if((int)inputColorVec_.size() <= ind)
-		return;
-
-	ColorBar& cb = inputColorVec_[ind];
-
-	fitMousePosition(pa_);
-
-	if(vertical_)
-		dif = 6.*(double)(p_.x() - b_);
-	else
-		dif = 6.*(double)(p_.y() - b_);
-
-	cb.v_ += (int)dif;
-
-	int v = 1;
-	if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
-		v = 0;
-
-	if(cb.v_ > 255)
-		cb.v_ = 255;
-	if(cb.v_ < v)
-		cb.v_ = v;
-
-	QColor cor;
-	cor.setHsv(cb.h_, cb.s_, cb.v_);
-	TeColor tc(cor.red(), cor.green(),cor.blue());
-	cb.color(tc);
-	
-	generateColorMap();
-	drawColorBar();
-	emit colorChangedSignal();
-}
-
-void TeQtColorBar::changeAllSaturation()
-{
-	double	dif;
-	int ind;
-
-	fitMousePosition(pa_);
-
-	if(vertical_)
-		dif = 6.*(double)(p_.x() - b_);
-	else
-		dif = 6.*(double)(p_.y() - b_);
-
-	for(ind=0; ind<(int)inputColorVec_.size(); ++ind)
-	{
-		ColorBar cb = inputColorVec_[ind];
-
-		if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
-		{
-			cb.v_ += (int)dif;
-			if(cb.v_ > 255)
-				return;
-			if(cb.v_ < 0)
-				return;
-		}
-		else
-		{
-			cb.s_ -= (int)dif;
-			if(cb.s_ > 255)
-				return;
-			if(cb.s_ < 1)
-				return;
-		}
-	}
-
-	for(ind=0; ind<(int)inputColorVec_.size(); ++ind)
-	{
-		ColorBar& cb = inputColorVec_[ind];
-
-		if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
-		{
-			cb.v_ += (int)dif;
-			if(cb.v_ > 255)
-				cb.v_ = 255;
-			if(cb.v_ < 0)
-				cb.v_ = 0;
-		}
-		else
-		{
-			cb.s_ -= (int)dif;
-			if(cb.s_ > 255)
-				cb.s_ = 255;
-			if(cb.s_ < 1)
-				cb.s_ = 1;
-		}
-
-		QColor cor;
-		cor.setHsv(cb.h_, cb.s_, cb.v_);
-		TeColor tc(cor.red(), cor.green(),cor.blue());
-		cb.color(tc);
-	}
-	generateColorMap();
-	drawColorBar();
-	emit colorChangedSignal();
-}
-
-void TeQtColorBar::changeSaturation()
-{
-	double	dif;
-	int ind = ind_;
-
-	if((int)inputColorVec_.size() <= ind)
-		return;
-
-	ColorBar& cb = inputColorVec_[ind];
-
-	fitMousePosition(pa_);
-
-	if(vertical_)
-		dif = 6.*(double)(p_.x() - b_);
-	else
-		dif = 6.*(double)(p_.y() - b_);
-
-	if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
-	{
-		cb.v_ += (int)dif;
-		if(cb.v_ > 255)
-			cb.v_ = 255;
-		if(cb.v_ < 0)
-			cb.v_ = 0;
-	}
-	else
-	{
-		cb.s_ -= (int)dif;
-		if(cb.s_ > 255)
-			cb.s_ = 255;
-		if(cb.s_ < 1)
-			cb.s_ = 1;
-	}
-
-	QColor cor;
-	cor.setHsv(cb.h_, cb.s_, cb.v_);
-	TeColor tc(cor.red(), cor.green(),cor.blue());
-	cb.color(tc);
-	
-	generateColorMap();
-	drawColorBar();
-	emit colorChangedSignal();
-}
-
-void TeQtColorBar::changeHue()
-{
-	double	dif;
-	int ind = ind_;
-
-	if((int)inputColorVec_.size() <= ind)
-		return;
-
-	ColorBar& cb = inputColorVec_[ind];
-
-	fitMousePosition(pa_);
-
-	if(vertical_)
-		dif = (double)(p_.x() - b_);
-	else
-		dif = (double)(p_.y() - b_);
-
-	if(cb.h_ == -1)
-		cb.s_ = cb.v_;
-
-	cb.h_ += (int)dif;
-	if(cb.h_ == -1)
-	{
-		cb.s_ = 0;
-		cb.v_ = cb.cor_.red_;
-	}
-	else if(cb.h_ >= 360)
-		cb.h_ -= 360;
-	else if(cb.h_ < 0)
-		cb.h_ += 360;
-
-	QColor cor;
-	cor.setHsv(cb.h_, cb.s_, cb.v_);
-	TeColor tc(cor.red(), cor.green(),cor.blue());
-	cb.color(tc);
-	
-	generateColorMap();
-	drawColorBar();
-	emit colorChangedSignal();
-}
-
-void TeQtColorBar::invertColorBar()
-{
-	int	i;
-	vector<ColorBar> cbVec = inputColorVec_;
-	inputColorVec_.clear();
-
-	for(i=(int)cbVec.size()-1; i>=0; --i)
-	{
-		cbVec[i].distance_ = totalDistance_ - cbVec[i].distance_;
-		inputColorVec_.push_back(cbVec[i]);
-	}
-	generateColorMap();
-	drawColorBar();
-	emit colorChangedSignal();
-}
-
-void TeQtColorBar::clearColorBar()
-{
-	inputColorVec_.clear();
-	ColorBar cb;
-
-	QColor cor = paletteBackgroundColor();
-	TeColor c(cor.red(), cor.green(), cor.blue());
-	cb.color(c);
-	cb.distance_ = 0.;
-
-	inputColorVec_.push_back(cb);
-	cb.distance_ = 10.;
-	inputColorVec_.push_back(cb);
-
-	generateColorMap();
-	drawColorBar();
-	emit colorChangedSignal();
-}
-
-void TeQtColorBar::setEqualSpace()
-{
-	int i;
-
-	for(i=0; i<(int)inputColorVec_.size(); ++i)
-		inputColorVec_[i].distance_ = (double)i;
-
-	if((int)inputColorVec_.size()-1 >= 0)
-		totalDistance_ = inputColorVec_[inputColorVec_.size()-1].distance_;
-	generateColorMap();
-	drawColorBar();
-	emit colorChangedSignal();
-}
-
-void TeQtColorBar::resizeEvent(QResizeEvent*)
-{
-	ftam_ = frameRect().width();
-	if(vertical_)
-		ftam_ = frameRect().height();
-
-	generateColorMap();
-	drawColorBar();
-}
-
-void TeQtColorBar::helpSlot()
-{
-	if(help_)
-		delete help_;
-
-	help_ = new Help(this, "help", false);
-	help_->init("colorBar.htm");
-	if(help_->erro_ == false)
-	{
-		help_->show();
-		help_->raise();
-	}
-	else
-	{
-		delete help_;
-		help_ = 0;
-	}
-}
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+************************************************************************************/
+
+#include <qcolordialog.h>
+#include <TeUtils.h>
+#include <TeColorUtils.h>
+#include <TeQtColorBar.h>
+#include <qcursor.h>
+#include <qpopupmenu.h>
+#include <qpainter.h>
+#include <help.h>
+#include <algorithm>
+
+TeQtColorBar::TeQtColorBar(QWidget* parent, const char* name)
+	:QFrame(parent, name)
+{
+	help_ = 0;
+	vertical_ = true;
+	upDown_ = false;
+	colorEdit_ = 0;
+
+	ftam_ = frameRect().width();
+	if(vertical_)
+		ftam_ = frameRect().height();
+
+	popupMenu_.insertItem(tr("Add Color..."), this, SLOT(addColorSlot()));
+	popupMenu_.insertItem(tr("Change Color..."), this, SLOT(changeColorSlot()));
+	popupMenu_.insertItem(tr("Remove Color"), this, SLOT(removeColorSlot()));
+	popupMenu_.insertItem(tr("Help..."), this, SLOT(helpSlot()));
+}
+
+void TeQtColorBar::setVerticalBar(bool b)
+{
+	vertical_ = b;
+
+	ftam_ = frameRect().width();
+	if(vertical_)
+		ftam_ = frameRect().height();
+}
+
+void TeQtColorBar::setColorBar(const vector<ColorBar>& colorBarVec)
+{
+	inputColorVec_.clear();
+	inputColorVec_ = colorBarVec;
+
+	sort(inputColorVec_.begin(), inputColorVec_.end());
+
+	if((int)inputColorVec_.empty() == false)
+		inputColorVec_[0].distance_ = 0.;
+
+	generateColorMap();
+}
+
+void TeQtColorBar::setColorBar(const vector<TeColor>& colorVec)
+{
+	int	i;
+
+	inputColorVec_.clear();
+	vector<ColorBar> cbVec;
+	ColorBar cb;
+
+	for(i=0; i<(int)colorVec.size(); i++)
+	{
+		cb.color(colorVec[i]);
+		cbVec.push_back(cb);
+	}
+	if(cbVec.size() == 1)
+	{
+		TeColor c = colorVec[0];
+		c.red_ = c.red_ / 5;
+		c.green_ = c.green_ / 5;
+		c.blue_ = c.blue_ / 5;
+
+		cb.color(c);
+		cbVec.push_back(cb);
+	}
+
+	for(i=0; i<(int)cbVec.size(); ++i)
+	{
+		cbVec[i].distance_ = (double)i;
+		inputColorVec_.push_back(cbVec[i]);
+	}
+
+	generateColorMap();
+}
+
+void TeQtColorBar::setColorBarFromNames(string colors)
+{
+	int	i;
+	if(colors.empty())
+		colors = tr("R").latin1();
+
+	vector<string> colorNameVec;
+	QString s = colors.c_str();
+	QStringList ss = QStringList::split("-",s,true);
+
+	for(i = 0; i < (int)ss.size(); i++)
+	{
+		QString a = ss[i];
+		if(tr("R") == a)
+			colorNameVec.push_back("RED");
+		else if(tr("G") == a)
+			colorNameVec.push_back("GREEN");
+		else if(tr("B") == a)
+			colorNameVec.push_back("BLUE");
+		else if(tr("Cy") == a)
+			colorNameVec.push_back("CYAN");
+		else if(tr("Or") == a)
+			colorNameVec.push_back("ORANGE");
+		else if(tr("Mg") == a)
+			colorNameVec.push_back("MAGENTA");
+		else if(tr("Y") == a)
+			colorNameVec.push_back("YELLOW");
+		else
+			colorNameVec.push_back("GRAY");
+	}
+
+	TeColor	RGB;
+	map<string, TeColor> mapcor;
+
+	RGB.name_ = "RED";
+	RGB.red_ = 240;
+	RGB.green_ = 0;
+	RGB.blue_ = 0;
+	mapcor["RED"] = RGB;
+
+	RGB.name_ = "GREEN";
+	RGB.red_ = 0;
+	RGB.green_ = 240;
+	RGB.blue_ = 0;
+	mapcor["GREEN"] = RGB;
+
+	RGB.name_ = "BLUE";
+	RGB.red_ = 0;
+	RGB.green_ = 0;
+	RGB.blue_ = 240;
+	mapcor["BLUE"] = RGB;
+
+	RGB.name_ = "YELLOW";
+	RGB.red_ = 255;
+	RGB.green_ = 255;
+	RGB.blue_ = 100;
+	mapcor["YELLOW"] = RGB;
+
+	RGB.name_ = "CYAN";
+	RGB.red_ = 100;
+	RGB.green_ = 255;
+	RGB.blue_ = 255;
+	mapcor["CYAN"] = RGB;
+
+	RGB.name_ = "MAGENTA";
+	RGB.red_ = 255;
+	RGB.green_ = 100;
+	RGB.blue_ = 255;
+	mapcor["MAGENTA"] = RGB;
+
+	RGB.name_ = "ORANGE";
+	RGB.red_ = 255;
+	RGB.green_ = 140;
+	RGB.blue_ = 0;
+	mapcor["ORANGE"] = RGB;
+
+	RGB.name_ = "GRAY";
+	RGB.red_ = 240;
+	RGB.green_ = 240;
+	RGB.blue_ = 240;
+	mapcor["GRAY"] = RGB;
+
+	RGB.name_ = "BLACK";
+	RGB.red_ = 0;
+	RGB.green_ = 0;
+	RGB.blue_ = 0;
+	mapcor["BLACK"] = RGB;
+
+	vector<ColorBar> cbVec;
+	for(i=0; i<(int)colorNameVec.size(); ++i)
+	{
+		ColorBar cb;
+		cb.color(mapcor[colorNameVec[i]]);
+		cbVec.push_back(cb);
+	}
+	if(inputColorVec_.size() == 1)
+	{
+		ColorBar cb;
+		TeColor c = inputColorVec_[0].cor_;
+
+		c.red_ = c.red_ / 5;
+		c.green_ = c.green_ / 5;
+		c.blue_ = c.blue_ / 5;
+
+		cb.color(c);
+		cbVec.push_back(cb);
+	}
+
+	inputColorVec_.clear();
+	for(i=0; i<(int)cbVec.size(); ++i)
+	{
+		cbVec[i].distance_ = (double)i;
+		inputColorVec_.push_back(cbVec[i]);
+	}
+
+	generateColorMap();
+}
+
+void TeQtColorBar::generateColorMap()
+{
+	sortByDistance();
+	generateColorBarMap(inputColorVec_, ftam_, colorMap_);
+	totalDistance_ = 1.;
+	if(inputColorVec_.empty() == false)
+		totalDistance_ = inputColorVec_[inputColorVec_.size()-1].distance_;
+}
+
+void TeQtColorBar::drawColorBar()
+{
+	if(colorMap_.empty())
+		return;
+
+	int	i, j = 0, size, tsize;
+	QColor cor;
+	map<int, vector<TeColor> > :: iterator it = colorMap_.begin();
+	QRect rect = frameRect();
+	int w = rect.width();
+	int	h = rect.height();
+	changeVec_.clear();
+	changeVec_.push_back(0);
+	QPainter painter(this);
+
+	tsize = w;
+	if(vertical_)
+		tsize = h;
+
+	while(it != colorMap_.end())
+	{
+		vector<TeColor>& colorVec = it->second;
+		size = (int)colorVec.size();
+
+		i = 0;
+		while(i < size)
+		{
+			cor.setRgb(colorVec[i].red_, colorVec[i].green_, colorVec[i].blue_);
+			painter.setPen(cor);
+			if(vertical_)
+			{
+				if(upDown_)
+				{
+					painter.lineTo(0, j);
+					painter.moveTo(w-7, j);
+				}
+				else
+				{
+					painter.lineTo(0, h-j);
+					painter.moveTo(w-7, h-j);
+				}
+			}
+			else
+			{
+				painter.lineTo(j, 7);
+				painter.moveTo(j, h);
+			}
+			i++;
+			j++;
+		}
+		it++;
+		if(it == colorMap_.end())
+		{
+			while(j < tsize)
+			{
+				if(vertical_)
+				{
+					if(upDown_)
+					{
+						painter.lineTo(0, j);
+						painter.moveTo(w-7, j);
+					}
+					else
+					{
+						painter.lineTo(0, h-j);
+						painter.moveTo(w-7, h-j);
+					}
+				}
+				else
+				{
+					painter.lineTo(j, 7);
+					painter.moveTo(j, h);
+				}
+				j++;
+			}
+		}
+		if(j-1 < 0)
+			changeVec_.push_back(0);
+		else if(j >= tsize)
+			changeVec_.push_back(tsize-1);
+		else
+			changeVec_.push_back(j);
+	}
+
+	painter.setPen(QColor(black));
+	painter.setBrush(QColor(white));
+
+	QRect ru(0, 0, w, 7);
+	if(vertical_)
+		ru.setRect(w-7, 0, 7, h);
+	painter.drawRect(ru);
+
+	QPointArray pa(4);
+	if(vertical_)
+	{
+		pa.setPoint(0, 0, 0);
+		pa.setPoint(1, 6, -3);
+		pa.setPoint(2, 6, 3);
+		pa.setPoint(3, 0, 0);
+		painter.drawPolygon(pa);
+		pa.translate(0, h-1);
+		painter.drawPolygon(pa);
+		pa.translate(0, -(h-1));
+		if(!upDown_)
+			pa.translate(0, h);
+
+	}
+	else
+	{
+		pa.setPoint(0, -3, 0);
+		pa.setPoint(1, 3, 0);
+		pa.setPoint(2, 0, 6);
+		pa.setPoint(3, -3, 0);
+		painter.drawPolygon(pa);
+		pa.translate(w-1, 0);
+		painter.drawPolygon(pa);
+		pa.translate(-(w-1), 0);
+	}
+
+	it = colorMap_.begin();
+	while(it != colorMap_.end())
+	{
+		j = it->second.size();
+		it++;
+		if(it != colorMap_.end())
+		{
+			if(vertical_)
+			{
+				if(upDown_)
+					pa.translate(0, j);
+				else
+					pa.translate(0, -j);
+			}
+			else
+				pa.translate(j, 0);
+			painter.drawPolygon(pa);
+		}
+	}
+
+	painter.setBrush(Qt::NoBrush);
+	painter.setPen(QColor(black));
+
+	double pd = (double)tsize / 10.;
+	int	t;
+	for(i=0; i<10; ++i)
+	{
+		t = 5;
+		if(i%2)
+			t = 3;
+
+		int a = TeRound((double)i * pd);
+		if(vertical_)
+		{
+			painter.moveTo(0, a);
+			painter.lineTo(t, a);
+		}
+		else
+		{
+			painter.moveTo(a, h);
+			painter.lineTo(a, h-t);
+		}
+	}
+
+	painter.drawRect(rect);
+}
+
+void TeQtColorBar::paintEvent(QPaintEvent*)
+{
+	drawColorBar();
+}
+
+void TeQtColorBar::mousePressEvent(QMouseEvent* e)
+{
+	if(colorMap_.empty())
+		return;
+	p_ = e->pos();
+	ind_ = getColorIndiceToChange();
+
+	if(e->button() == Qt::RightButton)
+	{
+		if(change_)
+		{
+			popupMenu_.setItemEnabled(popupMenu_.idAt(0), false); // add color
+			popupMenu_.setItemEnabled(popupMenu_.idAt(1), true); // change color
+			if(colorMap_.size() <= 1)
+				popupMenu_.setItemEnabled(popupMenu_.idAt(2), false); // remove color
+			else
+				popupMenu_.setItemEnabled(popupMenu_.idAt(2), true); // remove color
+		}
+		else
+		{
+			popupMenu_.setItemEnabled(popupMenu_.idAt(0), true); // add color
+			popupMenu_.setItemEnabled(popupMenu_.idAt(1), false); // change color
+			popupMenu_.setItemEnabled(popupMenu_.idAt(2), false); // remove color
+		}
+	
+		setCursor(QCursor(Qt::ArrowCursor));
+		QPoint	mp(e->globalPos().x(), e->globalPos().y());
+		popupMenu_.exec(mp);
+	}
+}
+
+void TeQtColorBar::mouseDoubleClickEvent(QMouseEvent* e)
+{
+	ind_ = getColorIndiceToChange();
+
+	if(change_)
+	{
+		if(vertical_)
+		{
+			if(e->pos().x() >= frameRect().width()-7)
+				changeColorSlot();
+			else
+				removeColorSlot();			
+		}
+		else
+		{
+			if(e->pos().y() <= 7)
+				changeColorSlot();
+			else
+				removeColorSlot();
+		}
+	}
+	else
+		addColorSlot();
+}
+
+void TeQtColorBar::mouseMoveEvent(QMouseEvent* e)
+{
+	if(colorMap_.empty())
+		return;
+	pa_ = e->pos();
+	if(e->state() == Qt::NoButton) // set cursor
+	{
+		ind_ = getColorIndiceToChange();
+		QCursor cursor;
+		if(distance_)
+		{
+			if(vertical_)
+				cursor.setShape(Qt::SplitVCursor);
+			else
+				cursor.setShape(Qt::SplitHCursor);
+		}
+		else if(change_ && brightness_)
+		{
+			if(vertical_)
+				cursor.setShape(Qt::SplitHCursor);
+			else
+				cursor.setShape(Qt::SplitVCursor);
+		}
+
+		setCursor(cursor);
+	}
+	else
+	{
+		if(((cursor().shape() == Qt::SplitVCursor) && vertical_) || ((cursor().shape() == Qt::SplitHCursor) && !vertical_))
+			changeDistance();
+		else if(((cursor().shape() == Qt::SplitVCursor) && !vertical_) || ((cursor().shape() == Qt::SplitHCursor) && vertical_))
+		{
+			if(e->state() & Qt::LeftButton)
+			{
+				if(e->state() == Qt::LeftButton)
+					changeBrightness();
+				else
+					changeHue();					
+			}
+			else if(e->state() == Qt::MidButton)
+				changeSaturation();
+		}
+		else
+		{
+			QCursor cursor(Qt::SizeVerCursor);
+			setCursor(cursor);
+
+			if(e->state() == Qt::LeftButton)
+				changeAllBrightness();
+			else if(e->state() == Qt::MidButton)
+				changeAllSaturation();
+		}
+	}
+	p_ = e->pos();
+}
+
+void TeQtColorBar::mouseReleaseEvent(QMouseEvent*)
+{
+	QCursor cursor;
+	setCursor(cursor);
+}
+
+void TeQtColorBar::leaveEvent(QEvent*)
+{
+}
+
+void TeQtColorBar::addColorSlot()
+{
+	int ind = ind_;
+	TeColor cor;
+
+  	bool isOK = false;
+	QColor inputColor(255, 255, 255);
+	QColor outputColor = QColorDialog::getRgba (inputColor.rgb(), &isOK, this);
+	if (isOK)
+	{
+		cor.init(outputColor.red(), outputColor.green(), outputColor.blue());
+		ColorBar cb;
+		double dist = (double)a_ * totalDistance_ / (double)(ftam_-1);
+		cb.color(cor);
+		cb.distance_ = dist;
+
+		vector<ColorBar> bcor = inputColorVec_;
+		inputColorVec_.clear();
+		int i;
+		for(i=0; i<(int)bcor.size(); ++i)
+		{
+			if(i == ind+1)
+				inputColorVec_.push_back(cb);
+			inputColorVec_.push_back(bcor[i]);
+		}
+		generateColorMap();
+		drawColorBar();
+		emit colorChangedSignal();
+	}	
+}
+
+void TeQtColorBar::changeColorSlot()
+{
+	int ind = ind_;
+
+	if((int)inputColorVec_.size() <= ind)
+		return;
+	ColorBar& cb = inputColorVec_[ind];
+	TeColor cor = cb.cor_;
+
+  	bool isOK = false;
+	QColor inputColor(cor.red_, cor.green_, cor.blue_);
+	QColor outputColor = QColorDialog::getRgba (inputColor.rgb(), &isOK, this);
+	if (isOK)
+	{
+		cor.init(outputColor.red(), outputColor.green(), outputColor.blue());
+		cb.color(cor);
+		generateColorMap();
+		drawColorBar();
+		emit colorChangedSignal();
+	}
+}
+
+void TeQtColorBar::removeColorSlot()
+{
+	int i;
+
+	if(ind_ == 0 || ind_ == (int)inputColorVec_.size()-1)
+		return;
+
+	vector<ColorBar> bcor = inputColorVec_;
+	inputColorVec_.clear();
+
+	for(i=0; i<(int)bcor.size(); ++i)
+	{
+		if(i == ind_)
+			continue;
+		inputColorVec_.push_back(bcor[i]);
+	}
+//	if(inputColorVec_.size() == 1)
+//		inputColorVec_.push_back(inputColorVec_[0]);
+
+	QCursor cursor;
+	setCursor(cursor);
+	generateColorMap();
+	drawColorBar();
+	emit colorChangedSignal();
+}
+
+int TeQtColorBar::getColorIndiceToChange()
+{
+	int	i, j, ind;
+	distance_ = false;
+	change_ = false;
+
+	fitMousePosition(p_);
+
+	limit_ = inf_ = sup_ = ind = -1;
+	for(i=0; i<(int)changeVec_.size(); ++i)
+	{
+		j = changeVec_[i];
+		if((a_ >= j-2) && (a_ <= j+2))
+		{
+			ind = i;
+			change_ = true;
+			distance_ = true;
+			break;
+		}
+	}
+
+	if(ind == 0)
+	{
+		for(i=1; i<(int)changeVec_.size()-1; ++i)
+		{
+			j = changeVec_[i];
+			if((a_ >= j-2) && (a_ <= j+2))
+			{
+				ind = i;
+				break;
+			}
+		}
+	}
+
+	if(ind == -1)
+	{
+		int jj;
+		for(i=0; i<(int)changeVec_.size()-1; ++i)
+		{
+			j = changeVec_[i];
+			jj = changeVec_[i+1];
+			if((a_ > j+2) && (a_ < jj-2))
+			{
+				ind = i;
+				break;
+			}
+		}
+	}
+	
+	if(brightness_ || ind == 0 || ind == (int)changeVec_.size() - 2)
+		distance_ = false;
+
+	if(distance_)
+	{
+		limit_ = ind - 1;
+		if((int)changeVec_.size() > limit_+2)
+		{
+			inf_ = changeVec_[limit_];
+			sup_ = changeVec_[limit_+2];
+			colorEdit_ = &(inputColorVec_[limit_+1]);
+		}
+	}
+
+	if(ind < 0)
+		ind = 0;
+	else if(ind > (int)inputColorVec_.size()-1)
+		ind = (int)inputColorVec_.size()-1;
+
+	return ind;
+}
+
+void TeQtColorBar::fitMousePosition(QPoint p)
+{
+	brightness_ = false;
+	QRect rect = frameRect();
+
+	if(vertical_)
+	{
+		ftam_ = rect.height();
+		if(upDown_)
+			a_ = p.y();
+		else
+			a_ = ftam_ - p.y();
+		b_ = p.x();
+
+		if(p.x() >= rect.width() - 7 && p.x() <= rect.width())
+			brightness_ = true;
+	}
+	else
+	{
+		ftam_ = rect.width();
+		a_ = p.x();
+		b_ = p.y();
+		if(p.y() <= 7)
+			brightness_ = true;
+	}
+
+	if(a_ < 0)
+		a_ = 0;
+	else if(a_ > ftam_)
+		a_ = ftam_;
+}
+
+void TeQtColorBar::changeDistance()
+{
+	fitMousePosition(pa_);
+	int nc = changeVec_[changeVec_.size()-1];
+
+	if(colorEdit_ && a_ >= nc) // end of bar
+	{
+		a_ = nc;
+		int t = (int)inputColorVec_.size();
+
+		colorEdit_->distance_ = totalDistance_;
+		double d = inputColorVec_[t-3].distance_;
+		d = d + (totalDistance_ - d) * .8;
+		inputColorVec_[t-1].distance_ = d;
+		QCursor cursor;
+		setCursor(cursor);
+		colorEdit_ = 0;
+	}
+	else if (a_ <= 0)
+	{
+		a_ = 0;
+
+		colorEdit_->distance_ = 0.;
+		int t = changeVec_[2];
+		double dist = .2 * (double)t * totalDistance_ / (double)(ftam_-1);
+		inputColorVec_[0].distance_ = dist;
+		QCursor cursor;
+		setCursor(cursor);
+		colorEdit_ = 0;
+
+	}
+	else
+	{
+		colorEdit_->distance_ = (double)a_ * totalDistance_ / (double)(ftam_-1);
+	}
+	generateColorMap();
+	drawColorBar();
+	emit colorChangedSignal();
+}
+
+void TeQtColorBar::sortByDistance()
+{
+	multimap<double, ColorBar> mMap;
+	typedef pair <double, ColorBar> myPair;	
+	int i;
+	double dist;
+
+	for(i=0; i<(int)inputColorVec_.size(); ++i)
+	{
+		double d = inputColorVec_[i].distance_;
+		if(&(inputColorVec_[i]) == colorEdit_)
+		{
+			dist = inputColorVec_[i].distance_;
+			inputColorVec_[i].distance_ = -1.;
+		}
+		mMap.insert(myPair(d, inputColorVec_[i]));
+	}
+
+	inputColorVec_.clear();
+	multimap<double, ColorBar>::iterator it;
+
+	for(it = mMap.begin(); it!= mMap.end(); it++)
+		inputColorVec_.push_back(it->second);
+
+	for(i=0; i<(int)inputColorVec_.size(); ++i)
+	{
+		ColorBar cb = inputColorVec_[i];
+		if(cb.distance_ == -1)
+		{
+			inputColorVec_[i].distance_ = dist;
+			colorEdit_ = &(inputColorVec_[i]);
+			break;
+		}
+	}
+}
+
+void TeQtColorBar::changeAllBrightness()
+{
+	double	dif;
+	int ind;
+
+	fitMousePosition(pa_);
+
+	if(vertical_)
+		dif = 6.*(double)(p_.x() - b_);
+	else
+		dif = 6.*(double)(p_.y() - b_);
+
+
+	for(ind=0; ind<(int)inputColorVec_.size(); ++ind)
+	{
+		ColorBar cb = inputColorVec_[ind];
+		cb.v_ += (int)dif;
+
+		int v = 1;
+		if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
+			v = 0;
+
+		if(cb.v_ > 255)
+			return;
+		if(cb.v_ < v)
+			return;
+	}
+
+	for(ind=0; ind<(int)inputColorVec_.size(); ++ind)
+	{
+		ColorBar& cb = inputColorVec_[ind];
+		cb.v_ += (int)dif;
+
+		int v = 1;
+		if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
+			v = 0;
+
+		if(cb.v_ > 255)
+			cb.v_ = 255;
+		if(cb.v_ < v)
+			cb.v_ = v;
+
+		QColor cor;
+		cor.setHsv(cb.h_, cb.s_, cb.v_);
+		TeColor tc(cor.red(), cor.green(),cor.blue());
+		cb.color(tc);
+	}
+	generateColorMap();
+	drawColorBar();
+	emit colorChangedSignal();
+}
+
+void TeQtColorBar::changeBrightness()
+{
+	double	dif;
+	int ind = ind_;
+
+	if((int)inputColorVec_.size() <= ind)
+		return;
+
+	ColorBar& cb = inputColorVec_[ind];
+
+	fitMousePosition(pa_);
+
+	if(vertical_)
+		dif = 6.*(double)(p_.x() - b_);
+	else
+		dif = 6.*(double)(p_.y() - b_);
+
+	cb.v_ += (int)dif;
+
+	int v = 1;
+	if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
+		v = 0;
+
+	if(cb.v_ > 255)
+		cb.v_ = 255;
+	if(cb.v_ < v)
+		cb.v_ = v;
+
+	QColor cor;
+	cor.setHsv(cb.h_, cb.s_, cb.v_);
+	TeColor tc(cor.red(), cor.green(),cor.blue());
+	cb.color(tc);
+	
+	generateColorMap();
+	drawColorBar();
+	emit colorChangedSignal();
+}
+
+void TeQtColorBar::changeAllSaturation()
+{
+	double	dif;
+	int ind;
+
+	fitMousePosition(pa_);
+
+	if(vertical_)
+		dif = 6.*(double)(p_.x() - b_);
+	else
+		dif = 6.*(double)(p_.y() - b_);
+
+	for(ind=0; ind<(int)inputColorVec_.size(); ++ind)
+	{
+		ColorBar cb = inputColorVec_[ind];
+
+		if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
+		{
+			cb.v_ += (int)dif;
+			if(cb.v_ > 255)
+				return;
+			if(cb.v_ < 0)
+				return;
+		}
+		else
+		{
+			cb.s_ -= (int)dif;
+			if(cb.s_ > 255)
+				return;
+			if(cb.s_ < 1)
+				return;
+		}
+	}
+
+	for(ind=0; ind<(int)inputColorVec_.size(); ++ind)
+	{
+		ColorBar& cb = inputColorVec_[ind];
+
+		if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
+		{
+			cb.v_ += (int)dif;
+			if(cb.v_ > 255)
+				cb.v_ = 255;
+			if(cb.v_ < 0)
+				cb.v_ = 0;
+		}
+		else
+		{
+			cb.s_ -= (int)dif;
+			if(cb.s_ > 255)
+				cb.s_ = 255;
+			if(cb.s_ < 1)
+				cb.s_ = 1;
+		}
+
+		QColor cor;
+		cor.setHsv(cb.h_, cb.s_, cb.v_);
+		TeColor tc(cor.red(), cor.green(),cor.blue());
+		cb.color(tc);
+	}
+	generateColorMap();
+	drawColorBar();
+	emit colorChangedSignal();
+}
+
+void TeQtColorBar::changeSaturation()
+{
+	double	dif;
+	int ind = ind_;
+
+	if((int)inputColorVec_.size() <= ind)
+		return;
+
+	ColorBar& cb = inputColorVec_[ind];
+
+	fitMousePosition(pa_);
+
+	if(vertical_)
+		dif = 6.*(double)(p_.x() - b_);
+	else
+		dif = 6.*(double)(p_.y() - b_);
+
+	if(cb.s_ == 0 || cb.h_ == -1) // achromatic (grey)
+	{
+		cb.v_ += (int)dif;
+		if(cb.v_ > 255)
+			cb.v_ = 255;
+		if(cb.v_ < 0)
+			cb.v_ = 0;
+	}
+	else
+	{
+		cb.s_ -= (int)dif;
+		if(cb.s_ > 255)
+			cb.s_ = 255;
+		if(cb.s_ < 1)
+			cb.s_ = 1;
+	}
+
+	QColor cor;
+	cor.setHsv(cb.h_, cb.s_, cb.v_);
+	TeColor tc(cor.red(), cor.green(),cor.blue());
+	cb.color(tc);
+	
+	generateColorMap();
+	drawColorBar();
+	emit colorChangedSignal();
+}
+
+void TeQtColorBar::changeHue()
+{
+	double	dif;
+	int ind = ind_;
+
+	if((int)inputColorVec_.size() <= ind)
+		return;
+
+	ColorBar& cb = inputColorVec_[ind];
+
+	fitMousePosition(pa_);
+
+	if(vertical_)
+		dif = (double)(p_.x() - b_);
+	else
+		dif = (double)(p_.y() - b_);
+
+	if(cb.h_ == -1)
+		cb.s_ = cb.v_;
+
+	cb.h_ += (int)dif;
+	if(cb.h_ == -1)
+	{
+		cb.s_ = 0;
+		cb.v_ = cb.cor_.red_;
+	}
+	else if(cb.h_ >= 360)
+		cb.h_ -= 360;
+	else if(cb.h_ < 0)
+		cb.h_ += 360;
+
+	QColor cor;
+	cor.setHsv(cb.h_, cb.s_, cb.v_);
+	TeColor tc(cor.red(), cor.green(),cor.blue());
+	cb.color(tc);
+	
+	generateColorMap();
+	drawColorBar();
+	emit colorChangedSignal();
+}
+
+void TeQtColorBar::invertColorBar()
+{
+	int	i;
+	vector<ColorBar> cbVec = inputColorVec_;
+	inputColorVec_.clear();
+
+	for(i=(int)cbVec.size()-1; i>=0; --i)
+	{
+		cbVec[i].distance_ = totalDistance_ - cbVec[i].distance_;
+		inputColorVec_.push_back(cbVec[i]);
+	}
+	generateColorMap();
+	drawColorBar();
+	emit colorChangedSignal();
+}
+
+void TeQtColorBar::clearColorBar()
+{
+	inputColorVec_.clear();
+	ColorBar cb;
+
+	QColor cor = paletteBackgroundColor();
+	TeColor c(cor.red(), cor.green(), cor.blue());
+	cb.color(c);
+	cb.distance_ = 0.;
+
+	inputColorVec_.push_back(cb);
+	cb.distance_ = 10.;
+	inputColorVec_.push_back(cb);
+
+	generateColorMap();
+	drawColorBar();
+	emit colorChangedSignal();
+}
+
+void TeQtColorBar::setEqualSpace()
+{
+	int i;
+
+	for(i=0; i<(int)inputColorVec_.size(); ++i)
+		inputColorVec_[i].distance_ = (double)i;
+
+	if((int)inputColorVec_.size()-1 >= 0)
+		totalDistance_ = inputColorVec_[inputColorVec_.size()-1].distance_;
+	generateColorMap();
+	drawColorBar();
+	emit colorChangedSignal();
+}
+
+void TeQtColorBar::resizeEvent(QResizeEvent*)
+{
+	ftam_ = frameRect().width();
+	if(vertical_)
+		ftam_ = frameRect().height();
+
+	generateColorMap();
+	drawColorBar();
+}
+
+void TeQtColorBar::helpSlot()
+{
+	if(help_)
+		delete help_;
+
+	help_ = new Help(this, "help", false);
+	help_->init("colorBar.htm");
+	if(help_->erro_ == false)
+	{
+		help_->show();
+		help_->raise();
+	}
+	else
+	{
+		delete help_;
+		help_ = 0;
+	}
+}
+
diff --git a/src/terralib/drivers/qt/TeQtColorBar.h b/src/terralib/drivers/qt/TeQtColorBar.h
old mode 100755
new mode 100644
index c5a7c93..c0e3153
--- a/src/terralib/drivers/qt/TeQtColorBar.h
+++ b/src/terralib/drivers/qt/TeQtColorBar.h
@@ -1,118 +1,121 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTCOLORBAR_H
-#define  __TERRALIB_INTERNAL_QTCOLORBAR_H
-
-#include <qframe.h>
-#include <TeVisual.h>
-#include <TeColorUtils.h>
-#include <qpopupmenu.h>
-#include <qcursor.h>
-#include <vector>
-#include <map>
-using namespace std;
-
-class Help;
-
-//struct ColorBar {
-//	TeColor icor_;
-//	TeColor cor_;
-//	double	distance_;
-//};
-
-class TeQtColorBar : public QFrame
-{
-	Q_OBJECT
-
-public:
-
-	TeQtColorBar( QWidget* parent, const char* name);
-	~TeQtColorBar() {}
-	void	setColorBar(const vector<TeColor>& colorVec);
-	void	setColorBar(const vector<ColorBar>& colorBarVec);
-	void	setColorBarFromNames(string colors);
-	void	drawColorBar();
-	void	setVerticalBar(bool b);
-	void	setUpDownBar(bool b) {upDown_ = b;}
-	void	invertColorBar();
-	void	clearColorBar();
-	void	setEqualSpace();
-	vector<ColorBar>	getInputColorVec() {return inputColorVec_;}
-
-public slots:
-
-	void	addColorSlot();
-	void	changeColorSlot();
-	void	removeColorSlot();
-	void	helpSlot();
-
-protected:
-
-    void	paintEvent(QPaintEvent*);
-	void	mousePressEvent(QMouseEvent*);
-	void	mouseMoveEvent(QMouseEvent*);
-	void	mouseReleaseEvent(QMouseEvent*);
-	void	mouseDoubleClickEvent(QMouseEvent*);
-	void	leaveEvent(QEvent*);
-	void	resizeEvent(QResizeEvent*);
-	void	generateColorMap();
-	int		getColorIndiceToChange();
-	void	fitMousePosition(QPoint);
-	void	changeDistance();
-	void	changeBrightness();
-	void	changeAllSaturation();
-	void	changeSaturation();
-	void	changeAllBrightness();
-	void	changeHue();
-	void	sortByDistance();
-	ColorBar* colorEdit_;
-//	vector<TeColor>	getColors(TeColor, TeColor, int);
-
-	QPopupMenu popupMenu_;
-	QPoint	p_;
-	QPoint	pa_;
-	int		a_;
-	int		b_;
-	int		ftam_;
-	int		ind_;
-	vector<ColorBar> inputColorVec_;
-	vector<int> changeVec_;
-	map<int, vector<TeColor> > colorMap_;
-	bool	vertical_;
-	bool	upDown_;
-	bool	brightness_;
-	bool	change_;
-	bool	distance_;
-	int		limit_, inf_, sup_;
-	double	totalDistance_;
-	Help*	help_;
-
-signals:
-	void mouseReleaseSignal(QMouseEvent*);
-	void mouseMoveSignal(QMouseEvent*);
-	void colorChangedSignal();
-};
-
-#endif // __TERRALIB_INTERNAL_QTCOLORBAR_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTCOLORBAR_H
+#define  __TERRALIB_INTERNAL_QTCOLORBAR_H
+
+#include <qframe.h>
+#include <TeVisual.h>
+#include <TeColorUtils.h>
+#include <qpopupmenu.h>
+#include <qcursor.h>
+#include <vector>
+#include <map>
+
+#include <TeAppUtilsDefines.h>
+
+using namespace std;
+
+class Help;
+
+//struct ColorBar {
+//	TeColor icor_;
+//	TeColor cor_;
+//	double	distance_;
+//};
+
+class TLAPPUTILS_DLL TeQtColorBar : public QFrame
+{
+	Q_OBJECT
+
+public:
+
+	TeQtColorBar( QWidget* parent, const char* name);
+	~TeQtColorBar() {}
+	void	setColorBar(const vector<TeColor>& colorVec);
+	void	setColorBar(const vector<ColorBar>& colorBarVec);
+	void	setColorBarFromNames(string colors);
+	void	drawColorBar();
+	void	setVerticalBar(bool b);
+	void	setUpDownBar(bool b) {upDown_ = b;}
+	void	invertColorBar();
+	void	clearColorBar();
+	void	setEqualSpace();
+	vector<ColorBar>	getInputColorVec() {return inputColorVec_;}
+
+public slots:
+
+	void	addColorSlot();
+	void	changeColorSlot();
+	void	removeColorSlot();
+	void	helpSlot();
+
+protected:
+
+    void	paintEvent(QPaintEvent*);
+	void	mousePressEvent(QMouseEvent*);
+	void	mouseMoveEvent(QMouseEvent*);
+	void	mouseReleaseEvent(QMouseEvent*);
+	void	mouseDoubleClickEvent(QMouseEvent*);
+	void	leaveEvent(QEvent*);
+	void	resizeEvent(QResizeEvent*);
+	void	generateColorMap();
+	int		getColorIndiceToChange();
+	void	fitMousePosition(QPoint);
+	void	changeDistance();
+	void	changeBrightness();
+	void	changeAllSaturation();
+	void	changeSaturation();
+	void	changeAllBrightness();
+	void	changeHue();
+	void	sortByDistance();
+	ColorBar* colorEdit_;
+//	vector<TeColor>	getColors(TeColor, TeColor, int);
+
+	QPopupMenu popupMenu_;
+	QPoint	p_;
+	QPoint	pa_;
+	int		a_;
+	int		b_;
+	int		ftam_;
+	int		ind_;
+	vector<ColorBar> inputColorVec_;
+	vector<int> changeVec_;
+	map<int, vector<TeColor> > colorMap_;
+	bool	vertical_;
+	bool	upDown_;
+	bool	brightness_;
+	bool	change_;
+	bool	distance_;
+	int		limit_, inf_, sup_;
+	double	totalDistance_;
+	Help*	help_;
+
+signals:
+	void mouseReleaseSignal(QMouseEvent*);
+	void mouseMoveSignal(QMouseEvent*);
+	void colorChangedSignal();
+};
+
+#endif // __TERRALIB_INTERNAL_QTCOLORBAR_H
+
diff --git a/src/terralib/drivers/qt/TeQtDataSource.h b/src/terralib/drivers/qt/TeQtDataSource.h
old mode 100755
new mode 100644
index 0fa84f1..5b00388
--- a/src/terralib/drivers/qt/TeQtDataSource.h
+++ b/src/terralib/drivers/qt/TeQtDataSource.h
@@ -1,24 +1,26 @@
-#ifndef TEQTDATASOURCE_H
-#define TEQTDATASOURCE_H
-
-#include <qobject.h>
-#include <qvariant.h>
-
-class TeQtDataSource : public QObject
-{
-	Q_OBJECT
-public:
-	TeQtDataSource() {}
-	virtual ~TeQtDataSource() {}
-
-	virtual QVariant cell(int row, int col) = 0;
-	virtual void setCell(int row, int col, const QVariant &text) = 0;
-
-	virtual int numRows() const = 0;
-	virtual int numCols() const = 0;
-
-signals:
-	void dataChanged();
-};
-
-#endif
+#ifndef TEQTDATASOURCE_H
+#define TEQTDATASOURCE_H
+
+#include <qobject.h>
+#include <qvariant.h>
+
+#include <TeAppUtilsDefines.h>
+
+class TLAPPUTILS_DLL TeQtDataSource : public QObject
+{
+	Q_OBJECT
+public:
+	TeQtDataSource() {}
+	virtual ~TeQtDataSource() {}
+
+	virtual QVariant cell(int row, int col) = 0;
+	virtual void setCell(int row, int col, const QVariant &text) = 0;
+
+	virtual int numRows() const = 0;
+	virtual int numCols() const = 0;
+
+signals:
+	void dataChanged();
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtDatabaseItem.cpp b/src/terralib/drivers/qt/TeQtDatabaseItem.cpp
old mode 100755
new mode 100644
index fd7f044..bdd8010
--- a/src/terralib/drivers/qt/TeQtDatabaseItem.cpp
+++ b/src/terralib/drivers/qt/TeQtDatabaseItem.cpp
@@ -1,40 +1,40 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <qpixmap.h>
-#include <TeQtDatabaseItem.h>
-#include <images/database.xpm>
-
-
-//Database item constructor
-TeQtDatabaseItem::TeQtDatabaseItem(QListView *parent,
-	QString text, TeDatabase *db)
-	: TeQtCheckListItem(parent,text), db_(db)
-{
-	type_ = DATABASE;
-	QPixmap p(database_xpm);
-	setPixmap(0,p);
-	sortChildItems(0, true);
-	setSelected(false);
-	setEnabled(true);
-}
-
-				
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <qpixmap.h>
+#include <TeQtDatabaseItem.h>
+#include <images/database.xpm>
+
+
+//Database item constructor
+TeQtDatabaseItem::TeQtDatabaseItem(QListView *parent,
+	QString text, TeDatabase *db)
+	: TeQtCheckListItem(parent,text), db_(db)
+{
+	type_ = DATABASE;
+	QPixmap p(database_xpm);
+	setPixmap(0,p);
+	sortChildItems(0, true);
+	setSelected(false);
+	setEnabled(true);
+}
+
+				
diff --git a/src/terralib/drivers/qt/TeQtDatabaseItem.h b/src/terralib/drivers/qt/TeQtDatabaseItem.h
old mode 100755
new mode 100644
index cdbc744..c18d788
--- a/src/terralib/drivers/qt/TeQtDatabaseItem.h
+++ b/src/terralib/drivers/qt/TeQtDatabaseItem.h
@@ -1,51 +1,51 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTDATABASEITEM_H
-#define  __TERRALIB_INTERNAL_QTDATABASEITEM_H
-
-#include <TeQtCheckListItem.h>
-
-class TeDatabase;
-
-
-class TeQtDatabaseItem : public TeQtCheckListItem
-{
-public:
-    TeQtDatabaseItem(QListView *parent, QString text,
-					 TeDatabase *db);
-
-	~TeQtDatabaseItem () {}
-
-	int compare(QListViewItem * i, int col, bool ascending) const
-		{ return QListViewItem::compare(i, col, ascending); }
-
-	QString key(int col, bool ascending) const
-		{ return QListViewItem::key(col, ascending); }
-
-	TeDatabase*	getDatabase()
-		{return db_;}
-
-protected:
-	TeDatabase	*db_;
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTDATABASEITEM_H
+#define  __TERRALIB_INTERNAL_QTDATABASEITEM_H
+
+#include <TeQtCheckListItem.h>
+
+class TeDatabase;
+
+
+class TLAPPUTILS_DLL TeQtDatabaseItem : public TeQtCheckListItem
+{
+public:
+    TeQtDatabaseItem(QListView *parent, QString text,
+					 TeDatabase *db);
+
+	~TeQtDatabaseItem () {}
+
+	int compare(QListViewItem * i, int col, bool ascending) const
+		{ return QListViewItem::compare(i, col, ascending); }
+
+	QString key(int col, bool ascending) const
+		{ return QListViewItem::key(col, ascending); }
+
+	TeDatabase*	getDatabase()
+		{return db_;}
+
+protected:
+	TeDatabase	*db_;
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtDatabaseItemFCT.cpp b/src/terralib/drivers/qt/TeQtDatabaseItemFCT.cpp
deleted file mode 100755
index d5a2cd6..0000000
--- a/src/terralib/drivers/qt/TeQtDatabaseItemFCT.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <qpixmap.h>
-#include <TeQtDatabaseItemFCT.h>
-//#include <../../../../../terraBase/src/ui/images/database.xpm>
-
-
-//Database item constructor
-TeQtDatabaseItem::TeQtDatabaseItem(QListView *parent,
-	QString text, const int& dbIdx)
-	: TeQtCheckListItem(parent,text), dbIdx_(dbIdx)
-{
-	type_ = DATABASE;
-	QPixmap p = QPixmap::fromMimeSource("database.bmp"); //(database_xpm);
-	setPixmap(0,p);
-	sortChildItems(0, true);
-	setSelected(false);
-	setEnabled(true);
-}
-
-				
diff --git a/src/terralib/drivers/qt/TeQtDatabaseItemFCT.h b/src/terralib/drivers/qt/TeQtDatabaseItemFCT.h
deleted file mode 100755
index 570d0e5..0000000
--- a/src/terralib/drivers/qt/TeQtDatabaseItemFCT.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTDATABASEITEM_H
-#define  __TERRALIB_INTERNAL_QTDATABASEITEM_H
-
-#include <TeQtCheckListItem.h>
-
-class TeDatabase;
-
-
-class TeQtDatabaseItem : public TeQtCheckListItem
-{
-public:
-    TeQtDatabaseItem(QListView *parent, QString text,
-					 const int& dbIdx);
-
-	~TeQtDatabaseItem () {}
-
-	int compare(QListViewItem * i, int col, bool ascending) const
-		{ return QListViewItem::compare(i, col, ascending); }
-
-	QString key(int col, bool ascending) const
-		{ return QListViewItem::key(col, ascending); }
-
-	int getDatabaseIdx(){
-		return dbIdx_;
-	};
-
-protected:
-	int dbIdx_;
-};
-
-#endif
diff --git a/src/terralib/drivers/qt/TeQtDatabasesListView.cpp b/src/terralib/drivers/qt/TeQtDatabasesListView.cpp
old mode 100755
new mode 100644
index 9d24624..21210d2
--- a/src/terralib/drivers/qt/TeQtDatabasesListView.cpp
+++ b/src/terralib/drivers/qt/TeQtDatabasesListView.cpp
@@ -1,292 +1,292 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtDatabasesListView.h>
-#include <TeQtCheckListItem.h>
-#include <TeQtDatabaseItem.h>
-#include <TeQtLayerItem.h>
-#include <qpopupmenu.h>
-
-
-TeQtDatabasesListView::TeQtDatabasesListView(QWidget *parent, const char *name)
-		: QListView(parent, name)
-{
-	currentDatabaseItem_ = 0;
-	currentLayerItem_ = 0;
-	popupItem_ = 0;
-	popupMenu_ = 0;
-	rightMouseWasClicked_ = false;
-
-	setSelectionMode(QListView::Multi);
-    setRootIsDecorated( TRUE );
-
-	popupMenu_ = new QPopupMenu(this);
-
-	// rename action
-	setDefaultRenameAction(QListView::Accept);
-
-	connect(this,SIGNAL(clicked(QListViewItem*)),
-			this,SLOT(clicked(QListViewItem*)));
-	connect(this,SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&, int)),
-		    this,SLOT(contextMenuRequested(QListViewItem*,const QPoint&, int)));
-}
-
-
-TeQtDatabasesListView::~TeQtDatabasesListView()
-{
-	if (popupMenu_)
-		delete popupMenu_;
-}
-
-
-void TeQtDatabasesListView::selectItem(QListViewItem *item)
-{
-	rightMouseWasClicked_ = false;
-	clicked(item);
-}
-
-
-void TeQtDatabasesListView::selectLayerItem(TeLayer *layer)
-{
-	if (layer == 0)
-		currentLayerItem_ = 0;
-		//return;
-
-	QListViewItem		*item;
-	TeQtCheckListItem	*checkListItem;
-	TeQtLayerItem		*layerItem;
-	TeQtDatabaseItem	*dbItem;
-
-	unselectAllItems();
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::INFOLAYER)
-		{
-			layerItem = (TeQtLayerItem*)item;
-			if (layerItem->getLayer() == layer)
-			{
-				if (layerItem == currentLayerItem_)
-					break;
-				else
-				{
-					item->setSelected(true);
-					item->repaint();
-					currentLayerItem_ = layerItem;
-
-					dbItem = (TeQtDatabaseItem*)item->parent();
-					dbItem->setSelected(true);
-					dbItem->repaint();
-					currentDatabaseItem_ = dbItem;
-					emit itemChanged(item);
-					return;
-				}
-			}
-		}
-		it++;
-		item = it.current();
-	}
-}
-
-
-void TeQtDatabasesListView::removeItem(QListViewItem *item)
-{
-	if (item == 0)
-		return;
-
-	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-
-	if(checkListItem->getType() == TeQtCheckListItem::DATABASE)
-	{
-		TeQtDatabaseItem* dbItem = (TeQtDatabaseItem*)item;
-
-		vector<QListViewItem*> childrenVector;
-		childrenVector = dbItem->getChildren();
-
-		unsigned int i;
-		TeQtLayerItem *layerItem;
-		for (i = 0; i < childrenVector.size(); ++i)
-		{
-			layerItem = (TeQtLayerItem*)childrenVector[i];
-			delete layerItem;
-			
-			emit( layerItemRemoved() );
-		}
-
-		if (currentDatabaseItem_ == dbItem)
-		{
-			currentDatabaseItem_ = 0;
-			currentLayerItem_ = 0;
-		}
-		delete dbItem;
-		
-		emit( databaseItemRemoved() );
-	}
-	else
-	{
-		// item is a layer
-		TeQtLayerItem *layerItem = (TeQtLayerItem*)item;
-		if (currentLayerItem_ == layerItem)
-			currentLayerItem_ = 0;
-		delete layerItem;
-		
-		emit( layerItemRemoved() );
-	}
-}
-
-
-void TeQtDatabasesListView::clicked(QListViewItem *item)
-{
-	unselectAllItems();
-	if (item == 0 || rightMouseWasClicked_ == true)
-	{
-		if (currentDatabaseItem_ != 0)
-		{
-			currentDatabaseItem_->setSelected(true);
-			currentDatabaseItem_->repaint();
-		}
-
-		if (currentLayerItem_ != 0)
-		{
-			currentLayerItem_->setSelected(true);
-			currentLayerItem_->repaint();
-		}
-
-		rightMouseWasClicked_ = false;
-		return;
-	}
-
-	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-	if (checkListItem->getType() == TeQtCheckListItem::DATABASE)
-	{
-		item->setSelected(true);
-		item->repaint();
-
-		TeQtDatabaseItem* dbItem = (TeQtDatabaseItem*)item;
-		if (dbItem != currentDatabaseItem_)
-		{
-			currentDatabaseItem_ = dbItem;
-			currentLayerItem_ = 0;
-			emit itemChanged(item);
-		}
-		else
-		{
-			if (currentLayerItem_ != 0)
-			{
-				currentLayerItem_->setSelected(true);
-				currentLayerItem_->repaint();
-			}
-		}
-	}
-	else if(checkListItem->getType() == TeQtCheckListItem::INFOLAYER)
-	{
-		TeQtDatabaseItem *dbItem = (TeQtDatabaseItem*)item->parent();
-		if (currentDatabaseItem_ != dbItem)
-		{
-			currentDatabaseItem_ = dbItem;
-			emit itemChanged(item->parent());
-		}
-
-		if (currentLayerItem_ != 0)
-		{
-			currentLayerItem_->setSelected(true);
-			currentLayerItem_->repaint();
-		}
-	}
-}
-
-
-void TeQtDatabasesListView::contextMenuRequested(QListViewItem *item, const QPoint&, int)
-{
-	popupItem_ = (TeQtCheckListItem*)item;
-
-	unselectAllItems();
-	if (currentDatabaseItem_)
-	{
-		currentDatabaseItem_->setSelected(true);
-		currentDatabaseItem_->repaint();
-	}
-
-	if (currentLayerItem_)
-	{
-		currentLayerItem_->setSelected(true);
-		currentLayerItem_->repaint();
-	}
-
-	emit popupSignal();
-}
-
-
-void TeQtDatabasesListView::contentsMousePressEvent(QMouseEvent *e)
-{
-	if (e->button() == Qt::RightButton)
-	{
-		rightMouseWasClicked_ = true;
-		popupMenu_->move(e->globalPos().x(), e->globalPos().y());
-	}
-	QListView::contentsMousePressEvent(e);
-}
-
-
-void TeQtDatabasesListView::unselectAllItems()
-{
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		item->setSelected(false);
-		item->repaint();
-		it++;
-		item = it.current();
-	}
-}
-
-vector<TeQtDatabaseItem*>  TeQtDatabasesListView::getDatabaseItemVec()
-{
-	vector<TeQtDatabaseItem*> databaseItemVec;
-
-	TeQtCheckListItem*	checkListItem;
-	TeQtDatabaseItem*	dbItem;
-
-	QListViewItemIterator it(this);
-	while(it.current())
-	{
-		checkListItem = (TeQtCheckListItem*)it.current();
-		if (checkListItem->getType() == TeQtCheckListItem::DATABASE)
-		{
-			dbItem = (TeQtDatabaseItem*)it.current();
-			databaseItemVec.push_back(dbItem);
-		}
-		++it;
-	}
-
-	return databaseItemVec;
-}
-
-
-
-
-
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeQtDatabasesListView.h>
+#include <TeQtCheckListItem.h>
+#include <TeQtDatabaseItem.h>
+#include <TeQtLayerItem.h>
+#include <qpopupmenu.h>
+
+
+TeQtDatabasesListView::TeQtDatabasesListView(QWidget *parent, const char *name)
+		: QListView(parent, name)
+{
+	currentDatabaseItem_ = 0;
+	currentLayerItem_ = 0;
+	popupItem_ = 0;
+	popupMenu_ = 0;
+	rightMouseWasClicked_ = false;
+
+	setSelectionMode(QListView::Multi);
+    setRootIsDecorated( TRUE );
+
+	popupMenu_ = new QPopupMenu(this);
+
+	// rename action
+	setDefaultRenameAction(QListView::Accept);
+
+	connect(this,SIGNAL(clicked(QListViewItem*)),
+			this,SLOT(clicked(QListViewItem*)));
+	connect(this,SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&, int)),
+		    this,SLOT(contextMenuRequested(QListViewItem*,const QPoint&, int)));
+}
+
+
+TeQtDatabasesListView::~TeQtDatabasesListView()
+{
+	if (popupMenu_)
+		delete popupMenu_;
+}
+
+
+void TeQtDatabasesListView::selectItem(QListViewItem *item)
+{
+	rightMouseWasClicked_ = false;
+	clicked(item);
+}
+
+
+void TeQtDatabasesListView::selectLayerItem(TeLayer *layer)
+{
+	if (layer == 0)
+		currentLayerItem_ = 0;
+		//return;
+
+	QListViewItem		*item;
+	TeQtCheckListItem	*checkListItem;
+	TeQtLayerItem		*layerItem;
+	TeQtDatabaseItem	*dbItem;
+
+	unselectAllItems();
+	QListViewItemIterator it(this);
+	item = it.current();
+	while(item)
+	{
+		checkListItem = (TeQtCheckListItem*)item;
+		if (checkListItem->getType() == TeQtCheckListItem::INFOLAYER)
+		{
+			layerItem = (TeQtLayerItem*)item;
+			if (layerItem->getLayer() == layer)
+			{
+				if (layerItem == currentLayerItem_)
+					break;
+				else
+				{
+					item->setSelected(true);
+					item->repaint();
+					currentLayerItem_ = layerItem;
+
+					dbItem = (TeQtDatabaseItem*)item->parent();
+					dbItem->setSelected(true);
+					dbItem->repaint();
+					currentDatabaseItem_ = dbItem;
+					emit itemChanged(item);
+					return;
+				}
+			}
+		}
+		it++;
+		item = it.current();
+	}
+}
+
+
+void TeQtDatabasesListView::removeItem(QListViewItem *item)
+{
+	if (item == 0)
+		return;
+
+	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
+
+	if(checkListItem->getType() == TeQtCheckListItem::DATABASE)
+	{
+		TeQtDatabaseItem* dbItem = (TeQtDatabaseItem*)item;
+
+		vector<QListViewItem*> childrenVector;
+		childrenVector = dbItem->getChildren();
+
+		unsigned int i;
+		TeQtLayerItem *layerItem;
+		for (i = 0; i < childrenVector.size(); ++i)
+		{
+			layerItem = (TeQtLayerItem*)childrenVector[i];
+			delete layerItem;
+			
+			emit( layerItemRemoved() );
+		}
+
+		if (currentDatabaseItem_ == dbItem)
+		{
+			currentDatabaseItem_ = 0;
+			currentLayerItem_ = 0;
+		}
+		delete dbItem;
+		
+		emit( databaseItemRemoved() );
+	}
+	else
+	{
+		// item is a layer
+		TeQtLayerItem *layerItem = (TeQtLayerItem*)item;
+		if (currentLayerItem_ == layerItem)
+			currentLayerItem_ = 0;
+		delete layerItem;
+		
+		emit( layerItemRemoved() );
+	}
+}
+
+
+void TeQtDatabasesListView::clicked(QListViewItem *item)
+{
+	unselectAllItems();
+	if (item == 0 || rightMouseWasClicked_ == true)
+	{
+		if (currentDatabaseItem_ != 0)
+		{
+			currentDatabaseItem_->setSelected(true);
+			currentDatabaseItem_->repaint();
+		}
+
+		if (currentLayerItem_ != 0)
+		{
+			currentLayerItem_->setSelected(true);
+			currentLayerItem_->repaint();
+		}
+
+		rightMouseWasClicked_ = false;
+		return;
+	}
+
+	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
+	if (checkListItem->getType() == TeQtCheckListItem::DATABASE)
+	{
+		item->setSelected(true);
+		item->repaint();
+
+		TeQtDatabaseItem* dbItem = (TeQtDatabaseItem*)item;
+		if (dbItem != currentDatabaseItem_)
+		{
+			currentDatabaseItem_ = dbItem;
+			currentLayerItem_ = 0;
+			emit itemChanged(item);
+		}
+		else
+		{
+			if (currentLayerItem_ != 0)
+			{
+				currentLayerItem_->setSelected(true);
+				currentLayerItem_->repaint();
+			}
+		}
+	}
+	else if(checkListItem->getType() == TeQtCheckListItem::INFOLAYER)
+	{
+		TeQtDatabaseItem *dbItem = (TeQtDatabaseItem*)item->parent();
+		if (currentDatabaseItem_ != dbItem)
+		{
+			currentDatabaseItem_ = dbItem;
+			emit itemChanged(item->parent());
+		}
+
+		if (currentLayerItem_ != 0)
+		{
+			currentLayerItem_->setSelected(true);
+			currentLayerItem_->repaint();
+		}
+	}
+}
+
+
+void TeQtDatabasesListView::contextMenuRequested(QListViewItem *item, const QPoint&, int)
+{
+	popupItem_ = (TeQtCheckListItem*)item;
+
+	unselectAllItems();
+	if (currentDatabaseItem_)
+	{
+		currentDatabaseItem_->setSelected(true);
+		currentDatabaseItem_->repaint();
+	}
+
+	if (currentLayerItem_)
+	{
+		currentLayerItem_->setSelected(true);
+		currentLayerItem_->repaint();
+	}
+
+	emit popupSignal();
+}
+
+
+void TeQtDatabasesListView::contentsMousePressEvent(QMouseEvent *e)
+{
+	if (e->button() == Qt::RightButton)
+	{
+		rightMouseWasClicked_ = true;
+		popupMenu_->move(e->globalPos().x(), e->globalPos().y());
+	}
+	QListView::contentsMousePressEvent(e);
+}
+
+
+void TeQtDatabasesListView::unselectAllItems()
+{
+	QListViewItem *item;
+
+	QListViewItemIterator it(this);
+	item = it.current();
+	while(item)
+	{
+		item->setSelected(false);
+		item->repaint();
+		it++;
+		item = it.current();
+	}
+}
+
+vector<TeQtDatabaseItem*>  TeQtDatabasesListView::getDatabaseItemVec()
+{
+	vector<TeQtDatabaseItem*> databaseItemVec;
+
+	TeQtCheckListItem*	checkListItem;
+	TeQtDatabaseItem*	dbItem;
+
+	QListViewItemIterator it(this);
+	while(it.current())
+	{
+		checkListItem = (TeQtCheckListItem*)it.current();
+		if (checkListItem->getType() == TeQtCheckListItem::DATABASE)
+		{
+			dbItem = (TeQtDatabaseItem*)it.current();
+			databaseItemVec.push_back(dbItem);
+		}
+		++it;
+	}
+
+	return databaseItemVec;
+}
+
+
+
+
+
+
diff --git a/src/terralib/drivers/qt/TeQtDatabasesListView.h b/src/terralib/drivers/qt/TeQtDatabasesListView.h
old mode 100755
new mode 100644
index f1486f1..6ef8dbc
--- a/src/terralib/drivers/qt/TeQtDatabasesListView.h
+++ b/src/terralib/drivers/qt/TeQtDatabasesListView.h
@@ -1,95 +1,100 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTDATABASESLISTVIEW_H
-#define  __TERRALIB_INTERNAL_QTDATABASESLISTVIEW_H
-
-
-class QPopupMenu;
-class TeQtCheckListItem;
-class TeQtDatabaseItem;
-class TeQtLayerItem;
-class TeLayer;
-
-#include <qlistview.h>
-#include <vector>
-
-
-class TeQtDatabasesListView : public QListView
-{
-	Q_OBJECT
-
-public:
-    TeQtDatabasesListView(QWidget *parent = 0, const char *name = 0);
-
-	~TeQtDatabasesListView();
-
-	TeQtDatabaseItem* currentDatabaseItem() 
-		{ return currentDatabaseItem_; }
-
-	TeQtLayerItem* currentLayerItem() 
-		{ return currentLayerItem_; }
-
-	TeQtCheckListItem *popupItem()
-		{ return popupItem_; }
-
-	QPopupMenu* getPopupMenu()
-		{ return popupMenu_; }
-
-	void selectItem(QListViewItem *item);
-
-	void selectLayerItem(TeLayer *layer);
-
-	void removeItem(QListViewItem *item);
-
-	std::vector<TeQtDatabaseItem*>  getDatabaseItemVec();
-
-
-signals:
-	void itemChanged(QListViewItem*);
-	void popupSignal();
-	
-	/** @brief This signal will be emitted after a database item remotion 
-	  * @note Signals will be emitted for each children layer item removed */
-	void databaseItemRemoved();
-	
-	/** @brief This signal will be emitted after a layer item remotion */
-	void layerItemRemoved();
-
-protected slots:
-	virtual void clicked(QListViewItem *item);
-	void contextMenuRequested(QListViewItem*, const QPoint&, int);
-
-protected:
-	TeQtDatabaseItem	*currentDatabaseItem_;
-	TeQtLayerItem		*currentLayerItem_;
-	bool				rightMouseWasClicked_;
-	TeQtCheckListItem	*popupItem_;
-	QPopupMenu			*popupMenu_;
-
-	void contentsMousePressEvent(QMouseEvent *e);
-
-	void unselectAllItems();
-};
-
-
-#endif
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTDATABASESLISTVIEW_H
+#define  __TERRALIB_INTERNAL_QTDATABASESLISTVIEW_H
+
+
+class QPopupMenu;
+class TeQtCheckListItem;
+class TeQtDatabaseItem;
+class TeQtLayerItem;
+class TeLayer;
+
+#include <TeAppUtilsDefines.h>
+
+#include <qlistview.h>
+#include <vector>
+
+
+class TLAPPUTILS_DLL TeQtDatabasesListView : public QListView
+{
+	Q_OBJECT
+
+public:
+    TeQtDatabasesListView(QWidget *parent = 0, const char *name = 0);
+
+	~TeQtDatabasesListView();
+
+	TeQtDatabaseItem* currentDatabaseItem() 
+		{ return currentDatabaseItem_; }
+
+	TeQtLayerItem* currentLayerItem() 
+		{ return currentLayerItem_; }
+
+	TeQtCheckListItem *popupItem()
+		{ return popupItem_; }
+
+    void setPopupItem(TeQtCheckListItem* item)
+        { popupItem_ = item; }
+
+	QPopupMenu* getPopupMenu()
+		{ return popupMenu_; }
+
+	void selectItem(QListViewItem *item);
+
+	void selectLayerItem(TeLayer *layer);
+
+	void removeItem(QListViewItem *item);
+
+	std::vector<TeQtDatabaseItem*>  getDatabaseItemVec();
+
+
+signals:
+	void itemChanged(QListViewItem*);
+	void popupSignal();
+	
+	/** @brief This signal will be emitted after a database item remotion 
+	  * @note Signals will be emitted for each children layer item removed */
+	void databaseItemRemoved();
+	
+	/** @brief This signal will be emitted after a layer item remotion */
+	void layerItemRemoved();
+
+protected slots:
+	virtual void clicked(QListViewItem *item);
+	void contextMenuRequested(QListViewItem*, const QPoint&, int);
+
+protected:
+	TeQtDatabaseItem	*currentDatabaseItem_;
+	TeQtLayerItem		*currentLayerItem_;
+	bool				rightMouseWasClicked_;
+	TeQtCheckListItem	*popupItem_;
+	QPopupMenu			*popupMenu_;
+
+	void contentsMousePressEvent(QMouseEvent *e);
+
+	void unselectAllItems();
+};
+
+
+#endif
+
diff --git a/src/terralib/drivers/qt/TeQtDatabasesListViewFCT.cpp b/src/terralib/drivers/qt/TeQtDatabasesListViewFCT.cpp
deleted file mode 100755
index ee572f9..0000000
--- a/src/terralib/drivers/qt/TeQtDatabasesListViewFCT.cpp
+++ /dev/null
@@ -1,326 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtDatabasesListViewFCT.h>
-#include <TeQtCheckListItem.h>
-#include <TeQtDatabaseItemFCT.h>
-#include <TeQtLayerItemFCT.h>
-#include <qpopupmenu.h>
-
-#include "TeLayer.h"
-
-
-TeQtDatabasesListView::TeQtDatabasesListView(QWidget *parent, const char *name)
-		: QListView(parent, name)
-{
-	currentDatabaseItem_ = 0;
-	currentLayerItem_ = 0;
-	rightMouseWasClicked_ = false;
-
-	setSelectionMode(QListView::Multi);
-    setRootIsDecorated( TRUE );
-
-	popupDatabase_ = new QPopupMenu(this);
-	popupLayer_ = new QPopupMenu(this);
-	popupOutItem_ = new QPopupMenu(this);
-
-	// rename action
-	setDefaultRenameAction(QListView::Accept);
-
-	connect(this,SIGNAL(clicked(QListViewItem*)),
-			this,SLOT(clicked(QListViewItem*)));
-	connect(this,SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&, int)),
-		    this,SLOT(contextMenuRequested(QListViewItem*,const QPoint&, int)));
-}
-
-
-TeQtDatabasesListView::~TeQtDatabasesListView()
-{
-	if (popupDatabase_)
-		delete popupDatabase_;
-	if (popupLayer_)
-		delete popupLayer_;
-	if (popupOutItem_)
-		delete popupOutItem_;
-}
-
-
-void TeQtDatabasesListView::selectItem(QListViewItem *item)
-{
-	clicked(item);
-}
-
-
-void TeQtDatabasesListView::selectLayerItem(TeLayer *layer)
-{
-	if (layer == 0)
-		return;
-
-	QListViewItem		*item;
-	TeQtCheckListItem	*checkListItem;
-	TeQtLayerItem		*layerItem;
-	TeQtDatabaseItem	*dbItem;
-
-	unselectAllItems();
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::INFOLAYER)
-		{
-			layerItem = (TeQtLayerItem*)item;
-			if (layerItem->getLayer() == layer)
-			{
-				if (layerItem == currentLayerItem_)
-					break;
-				else
-				{
-					item->setSelected(true);
-					item->repaint();
-					currentLayerItem_ = layerItem;
-
-					dbItem = (TeQtDatabaseItem*)item->parent();
-					dbItem->setSelected(true);
-					dbItem->repaint();
-					currentDatabaseItem_ = dbItem;
-					emit itemChanged(item);
-					return;
-				}
-			}
-		}
-		it++;
-		item = it.current();
-	}
-}
-
-
-void TeQtDatabasesListView::removeItem(QListViewItem *item)
-{
-	if (item == 0)
-		return;
-
-	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-
-	if(checkListItem->getType() == TeQtCheckListItem::DATABASE)
-	{
-		TeQtDatabaseItem* dbItem = (TeQtDatabaseItem*)item;
-
-		vector<QListViewItem*> childrenVector;
-		childrenVector = dbItem->getChildren();
-
-		unsigned int i;
-		TeQtLayerItem *layerItem;
-		for (i = 0; i < childrenVector.size(); ++i)
-		{
-			layerItem = (TeQtLayerItem*)childrenVector[i];
-			delete layerItem;
-		}
-
-		if (currentDatabaseItem_ == dbItem)
-		{
-			currentDatabaseItem_ = 0;
-			currentLayerItem_ = 0;
-		}
-		delete dbItem;
-	}
-	else
-	{
-		// item is a layer
-		TeQtLayerItem *layerItem = (TeQtLayerItem*)item;
-		if (currentLayerItem_ == layerItem)
-			currentLayerItem_ = 0;
-		delete layerItem;
-	}
-}
-
-
-void TeQtDatabasesListView::clicked(QListViewItem *item)
-{
-	unselectAllItems();
-	if (item == 0 || rightMouseWasClicked_ == true)
-	{
-		if (currentDatabaseItem_ != 0)
-		{
-			currentDatabaseItem_->setSelected(true);
-			currentDatabaseItem_->repaint();
-		}
-
-		if (currentLayerItem_ != 0)
-		{
-			currentLayerItem_->setSelected(true);
-			currentLayerItem_->repaint();
-		}
-
-		rightMouseWasClicked_ = false;
-		return;
-	}
-
-	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-	if (checkListItem->getType() == TeQtCheckListItem::DATABASE)
-	{
-		item->setSelected(true);
-		item->repaint();
-
-		TeQtDatabaseItem* dbItem = (TeQtDatabaseItem*)item;
-		if (dbItem != currentDatabaseItem_)
-		{
-			currentDatabaseItem_ = dbItem;
-			currentLayerItem_ = 0;
-			emit itemChanged(item);
-		}
-		else
-		{
-			if (currentLayerItem_ != 0)
-			{
-				currentLayerItem_->setSelected(true);
-				currentLayerItem_->repaint();
-			}
-		}
-	}
-	else if(checkListItem->getType() == TeQtCheckListItem::INFOLAYER)
-	{
-		item->parent()->setSelected(true);
-		item->parent()->repaint();
-		item->setSelected(true);
-		item->repaint();
-
-		TeQtDatabaseItem *dbItem = (TeQtDatabaseItem*)item->parent();
-		if (currentDatabaseItem_ != dbItem)
-		{
-			currentDatabaseItem_ = dbItem;
-			emit itemChanged(item->parent());
-		}
-
-		TeQtLayerItem* layerItem = (TeQtLayerItem*)item;
-		if (layerItem != currentLayerItem_)
-		{
-			currentLayerItem_ = layerItem;
-			emit itemChanged(item);
-		}
-	}
-}
-
-
-void TeQtDatabasesListView::contextMenuRequested(QListViewItem *item, const QPoint&, int)
-{
-	popupItem_ = (TeQtCheckListItem*)item;
-
-	unselectAllItems();
-	if (currentDatabaseItem_)
-	{
-		currentDatabaseItem_->setSelected(true);
-		currentDatabaseItem_->repaint();
-	}
-
-	if (currentLayerItem_)
-	{
-		currentLayerItem_->setSelected(true);
-		currentLayerItem_->repaint();
-	}
-
-	emit popupSignal();
-}
-
-
-void TeQtDatabasesListView::contentsMousePressEvent(QMouseEvent *e)
-{
-	if (e->button() == Qt::RightButton)
-	{
-		rightMouseWasClicked_ = true;
-		popupDatabase_->move(e->globalPos().x(), e->globalPos().y());
-		popupLayer_->move(e->globalPos().x(), e->globalPos().y());
-		popupOutItem_->move(e->globalPos().x(), e->globalPos().y());
-	}
-	QListView::contentsMousePressEvent(e);
-}
-
-
-void TeQtDatabasesListView::unselectAllItems()
-{
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		item->setSelected(false);
-		item->repaint();
-		it++;
-		item = it.current();
-	}
-}
-
-TeQtLayerItem* TeQtDatabasesListView::getLayerItem(const int& layerId) {
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if(checkListItem->getType() == TeQtCheckListItem::INFOLAYER) {
-			TeQtLayerItem* layerItem = (TeQtLayerItem*)checkListItem;
-			if (layerItem->getLayer()->id() == layerId)
-				return layerItem;
-		}
-
-		it++;
-		item = it.current();
-	}
-
-	return NULL;
-}
-
-TeQtDatabaseItem* TeQtDatabasesListView::getDbItem(const int& dbIdx) {
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if(checkListItem->getType() == TeQtCheckListItem::DATABASE) {
-			TeQtDatabaseItem* dbItem = (TeQtDatabaseItem*)checkListItem;
-			if (dbItem->getDatabaseIdx() == dbIdx)
-				return dbItem;
-		}
-
-		it++;
-		item = it.current();
-	}
-
-	return NULL;
-}
-
-void TeQtDatabasesListView::reset()
-{
-	unselectAllItems();
-	currentDatabaseItem_ = 0;
-	currentLayerItem_ = 0;
-}
-
-
-
-
-
-
-
diff --git a/src/terralib/drivers/qt/TeQtDatabasesListViewFCT.h b/src/terralib/drivers/qt/TeQtDatabasesListViewFCT.h
deleted file mode 100755
index 1244e86..0000000
--- a/src/terralib/drivers/qt/TeQtDatabasesListViewFCT.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTDATABASESLISTVIEW_H
-#define  __TERRALIB_INTERNAL_QTDATABASESLISTVIEW_H
-
-
-#include <qlistview.h>
-
-class QPopupMenu;
-class TeQtCheckListItem;
-class TeQtDatabaseItem;
-class TeQtLayerItem;
-class TeLayer;
-
-
-class TeQtDatabasesListView : public QListView
-{
-	Q_OBJECT
-
-public:
-    TeQtDatabasesListView(QWidget *parent = 0, const char *name = 0);
-
-	~TeQtDatabasesListView();
-
-	TeQtDatabaseItem* currentDatabaseItem() 
-		{ return currentDatabaseItem_; }
-
-	TeQtLayerItem* currentLayerItem() 
-		{ return currentLayerItem_; }
-
-	TeQtCheckListItem *popupItem()
-		{ return popupItem_; }
-
-	QPopupMenu* popupDatabase()
-		{ return popupDatabase_; }
-
-	QPopupMenu* popupLayer()
-		{ return popupLayer_; }
-
-	QPopupMenu* popupOutItem()
-		{ return popupOutItem_; }
-
-	void selectItem(QListViewItem *item);
-
-	void selectLayerItem(TeLayer *layer);
-
-	void removeItem(QListViewItem *item);
-
-	TeQtLayerItem* getLayerItem(const int& layerId);
-	TeQtDatabaseItem* getDbItem(const int& dbIdx);
-
-    void reset();
-
-signals:
-	void itemChanged(QListViewItem*);
-	void popupSignal();
-
-protected slots:
-	void clicked(QListViewItem *item);
-	void contextMenuRequested(QListViewItem*, const QPoint&, int);
-
-protected:
-	TeQtDatabaseItem	*currentDatabaseItem_;
-	TeQtLayerItem		*currentLayerItem_;
-	bool				rightMouseWasClicked_;
-	TeQtCheckListItem	*popupItem_;
-	QPopupMenu			*popupDatabase_;
-	QPopupMenu			*popupLayer_;
-	QPopupMenu			*popupOutItem_;
-
-	void contentsMousePressEvent(QMouseEvent *e);
-
-	void unselectAllItems();
-};
-
-
-#endif
-
-
diff --git a/src/terralib/drivers/qt/TeQtFrame.cpp b/src/terralib/drivers/qt/TeQtFrame.cpp
old mode 100755
new mode 100644
index 68f26f9..6ffeb0a
--- a/src/terralib/drivers/qt/TeQtFrame.cpp
+++ b/src/terralib/drivers/qt/TeQtFrame.cpp
@@ -1,59 +1,59 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-************************************************************************************/
-
-
-#include <TeQtFrame.h>
-#include <qcursor.h>
-
-TeQtFrame::TeQtFrame(QWidget* parent, const char* name)
-	:QFrame(parent, name)
-{
-}
-
-void TeQtFrame::paintEvent(QPaintEvent*)
-{
-	emit paint2DSignal();
-}
-
-void TeQtFrame::mousePressEvent(QMouseEvent* e)
-{
-	p_ = e->pos();
-	emit setCursorSignal(p_);
-}
-
-void TeQtFrame::mouseMoveEvent(QMouseEvent* e)
-{
-	if(e->state() == Qt::NoButton)
-	{
-		QPoint p = e->pos();
-		emit setCursorSignal(p);
-	}
-	emit mouseMoveSignal(e);
-}
-
-void TeQtFrame::mouseReleaseEvent(QMouseEvent*e)
-{
-	emit mouseReleaseSignal(e);
-	QCursor c(Qt::ArrowCursor);
-	setCursor(c);
-}
-
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+************************************************************************************/
+
+
+#include <TeQtFrame.h>
+#include <qcursor.h>
+
+TeQtFrame::TeQtFrame(QWidget* parent, const char* name)
+	:QFrame(parent, name)
+{
+}
+
+void TeQtFrame::paintEvent(QPaintEvent*)
+{
+	emit paint2DSignal();
+}
+
+void TeQtFrame::mousePressEvent(QMouseEvent* e)
+{
+	p_ = e->pos();
+	emit setCursorSignal(p_);
+}
+
+void TeQtFrame::mouseMoveEvent(QMouseEvent* e)
+{
+	if(e->state() == Qt::NoButton)
+	{
+		QPoint p = e->pos();
+		emit setCursorSignal(p);
+	}
+	emit mouseMoveSignal(e);
+}
+
+void TeQtFrame::mouseReleaseEvent(QMouseEvent*e)
+{
+	emit mouseReleaseSignal(e);
+	QCursor c(Qt::ArrowCursor);
+	setCursor(c);
+}
+
+
diff --git a/src/terralib/drivers/qt/TeQtFrame.h b/src/terralib/drivers/qt/TeQtFrame.h
old mode 100755
new mode 100644
index bdb13ae..fd5fddf
--- a/src/terralib/drivers/qt/TeQtFrame.h
+++ b/src/terralib/drivers/qt/TeQtFrame.h
@@ -1,55 +1,57 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTFRAME_H
-#define  __TERRALIB_INTERNAL_QTFRAME_H
-
-#include <qframe.h>
-
-class TeQtFrame : public QFrame
-{
-	Q_OBJECT
-
-public:
-
-	TeQtFrame( QWidget* parent, const char* name);
-	~TeQtFrame() {}
-
-    QPoint	p_;
-
-protected:
-
-    void	paintEvent(QPaintEvent*);
-	void	mousePressEvent(QMouseEvent*);
-	void	mouseMoveEvent(QMouseEvent*);
-	void	mouseReleaseEvent(QMouseEvent*);
-
-signals:
-	void paint2DSignal();
-	void mouseReleaseSignal(QMouseEvent*);
-	void mouseMoveSignal(QMouseEvent*);
-	void setCursorSignal(const QPoint&);
-};
-
-#endif // __TERRALIB_INTERNAL_QTFRAME_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTFRAME_H
+#define  __TERRALIB_INTERNAL_QTFRAME_H
+
+#include <TeAppUtilsDefines.h>
+
+#include <qframe.h>
+
+class TLAPPUTILS_DLL TeQtFrame : public QFrame
+{
+	Q_OBJECT
+
+public:
+
+	TeQtFrame( QWidget* parent, const char* name);
+	~TeQtFrame() {}
+
+    QPoint	p_;
+
+protected:
+
+    void	paintEvent(QPaintEvent*);
+	void	mousePressEvent(QMouseEvent*);
+	void	mouseMoveEvent(QMouseEvent*);
+	void	mouseReleaseEvent(QMouseEvent*);
+
+signals:
+	void paint2DSignal();
+	void mouseReleaseSignal(QMouseEvent*);
+	void mouseMoveSignal(QMouseEvent*);
+	void setCursorSignal(const QPoint&);
+};
+
+#endif // __TERRALIB_INTERNAL_QTFRAME_H
+
diff --git a/src/terralib/drivers/qt/TeQtGLWidget.cpp b/src/terralib/drivers/qt/TeQtGLWidget.cpp
old mode 100755
new mode 100644
index 220b767..3133129
--- a/src/terralib/drivers/qt/TeQtGLWidget.cpp
+++ b/src/terralib/drivers/qt/TeQtGLWidget.cpp
@@ -1,1403 +1,1403 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-************************************************************************************/
-
-#include "TeQtGLWidget.h"
-#include "qframe.h"
-#include <qpainter.h>
-#include "TeDefines.h"
-#include "math.h"
-#include "TeUtils.h"
-#include <TeQtGrid.h>
-#include <TeExternalTheme.h>
-#include "TeDatabase.h"
-#include "TeDatabaseUtils.h"
-
-#if defined(Q_CC_MSVC)
-#pragma warning(disable:4305) // init: truncation from const double to float
-#endif
-
-TeQtGLWidget::TeQtGLWidget( QWidget* parent, const char* name, TeQtGrid* grid, string xField, string yField, string zField, QPaintDevice* xy, QPaintDevice* zx, QPaintDevice* yz, int selectedObjects, string func)
-    : QGLWidget( parent, name )
-{
-	setFocusPolicy(QWidget::StrongFocus);
-
-	xRot_ = yRot_ = zRot_ = 0.0;		// default object rotation
-    xOff_ = yOff_ = zOff_ = -0.2;		// default object Offset
-    xSize_ = ySize_ = zSize_ = 0.4;		// default object Size
-    scale_ = 1.;						// default object scale_
-	viewAngle_ = 60.;
-	xTranslation_ = 0.;
-	yTranslation_ = 0.;
-	zTranslation_ = -3.5;
-	frontLighting_ = true;
-	drawAxis_ = true;
-	xField_ = xField;
-	yField_ = yField;
-	zField_ = zField;
-	grid_ = grid;
-	theme_ = (TeTheme*)grid_->getTheme()->getTheme();
-
-	if(theme_->type() == TeTHEME)
-		db_ = theme_->layer()->database();
-	else if(theme_->type() == TeEXTERNALTHEME)
-		db_ = ((TeExternalTheme*)theme_)->getRemoteTheme()->layer()->database();
-
-	selectedObjects_ = selectedObjects;
-	function_ = func;
-	quality_ = 12;
-	addSelection_ = false;
-	keyPress_ = 0;
-
-	TeGeomRepVisualMap& vmap = theme_->defaultLegend().getVisualMap();
-	if(vmap.find(TePOLYGONS) != vmap.end())
-		defaultColor_ = QColor(vmap[TePOLYGONS]->color().red_, vmap[TePOLYGONS]->color().green_, vmap[TePOLYGONS]->color().blue_); 
-	else if(vmap.find(TeLINES) != vmap.end())
-		defaultColor_ = QColor(vmap[TeLINES]->color().red_, vmap[TeLINES]->color().green_, vmap[TeLINES]->color().blue_); 
-	else if(vmap.find(TePOINTS) != vmap.end())
-		defaultColor_ = QColor(vmap[TePOINTS]->color().red_, vmap[TePOINTS]->color().green_, vmap[TePOINTS]->color().blue_); 
-
-	TeGeomRepVisualMap& pmap = theme_->pointingLegend().getVisualMap();
-	if(pmap.find(TePOLYGONS) != vmap.end())
-		pointingColor_ = QColor(pmap[TePOLYGONS]->color().red_, pmap[TePOLYGONS]->color().green_, pmap[TePOLYGONS]->color().blue_); 
-	else if(pmap.find(TeLINES) != vmap.end())
-		pointingColor_ = QColor(pmap[TeLINES]->color().red_, pmap[TeLINES]->color().green_, pmap[TeLINES]->color().blue_); 
-	else if(pmap.find(TePOINTS) != vmap.end())
-		pointingColor_ = QColor(pmap[TePOINTS]->color().red_, pmap[TePOINTS]->color().green_, pmap[TePOINTS]->color().blue_); 
-
-	xyDevice_ = xy;
-	zxDevice_ = zx;
-	yzDevice_ = yz;
-}
-
-TeQtGLWidget::~TeQtGLWidget()
-{
-	deleteGLObject();
-}
-
-void TeQtGLWidget::paintGL()
-{
-	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-	glMatrixMode(GL_PROJECTION); 
-	glLoadIdentity(); 
-	int w = width();
-	int h = height();
-
-	if (w <= h) 
-		gluPerspective(viewAngle_ * (GLfloat) h / (GLfloat) w, (GLfloat) h / (GLfloat) w, 1.0, 16.0); 
-	else 
-		gluPerspective(viewAngle_ * (GLfloat) w / (GLfloat) h, (GLfloat) w / (GLfloat) h, 1.0, 18.0); 
-
-	glMatrixMode(GL_MODELVIEW); 
-	glLoadIdentity(); 
-
-	glTranslatef(xTranslation_, yTranslation_, zTranslation_); 
-    glRotatef( xRot_, 1.0, 0.0, 0.0 ); 
-    glRotatef( yRot_, 0.0, 1.0, 0.0 ); 
-    glRotatef( zRot_, 0.0, 0.0, 1.0 );
-
-    glLineWidth( 1.0 );
-    qglColor( magenta );
-    glBegin( GL_LINE_LOOP );
-    glVertex3f( xOff_ + xSize_,  yOff_ + ySize_, zOff_ );
-    glVertex3f( xOff_ + xSize_, yOff_ + ySize_, zOff_ + zSize_ );
-    glVertex3f( xOff_, yOff_ + ySize_, zOff_ + zSize_ );
-    glVertex3f( xOff_, yOff_ + ySize_, zOff_ );
-    glEnd();
-
-    glBegin( GL_LINE_LOOP );
-    glVertex3f( xOff_ + xSize_,  yOff_, zOff_ );
-    glVertex3f( xOff_, yOff_, zOff_ );
-    glVertex3f( xOff_, yOff_, zOff_ + zSize_ );
-    glVertex3f( xOff_ + xSize_, yOff_, zOff_ + zSize_ );
-    glEnd();
-
-    glBegin( GL_LINES );
-    glVertex3f( xOff_ + xSize_,  yOff_ + ySize_, zOff_ );   glVertex3f( xOff_ + xSize_,  yOff_, zOff_ );
-    glVertex3f( xOff_ + xSize_, yOff_ + ySize_, zOff_ + zSize_ );   glVertex3f( xOff_ + xSize_,  yOff_, zOff_ + zSize_ );
-    glVertex3f( xOff_, yOff_ + ySize_, zOff_ + zSize_ );   glVertex3f( xOff_, yOff_, zOff_ + zSize_ );
-    glVertex3f( xOff_,  yOff_ + ySize_, zOff_ );   glVertex3f( xOff_, yOff_, zOff_ );
-    glEnd();
-
-
-	// draw white cube
-    qglColor( white );
-    glBegin( GL_LINE_LOOP );
-    glVertex3f( 1.0,  1.0, -1.0 );
-    glVertex3f( 1.0, 1.0, 1.0 );
-    glVertex3f( -1.0, 1.0, 1.0 );
-    glVertex3f( -1.0,  1.0, -1.0 );
-    glEnd();
-
-    glBegin( GL_LINES );
-	if(!drawAxis_)
-	{
-		glVertex3f( 1.0,  -1.0, -1.0 );	glVertex3f( -1.0, -1.0, -1.0 );
-		glVertex3f( -1.0, -1.0, -1.0 );	glVertex3f( -1.0, -1.0, 1.0 );
-	}
-    glVertex3f( -1.0, -1.0, 1.0 );	glVertex3f( 1.0,  -1.0, 1.0 );
-	glVertex3f( 1.0,  -1.0, 1.0 );	glVertex3f( 1.0,  -1.0, -1.0 );
-    glVertex3f( 1.0,  1.0, -1.0 );   glVertex3f( 1.0,  -1.0, -1.0 );
-    glVertex3f( 1.0, 1.0, 1.0 );   glVertex3f( 1.0,  -1.0, 1.0 );
-    glVertex3f( -1.0, 1.0, 1.0 );   glVertex3f( -1.0, -1.0, 1.0 );
-	if(!drawAxis_)
-		glVertex3f( -1.0,  1.0, -1.0 );   glVertex3f( -1.0, -1.0, -1.0 );
-    glEnd();
-
-
-	GLfloat mat_specular[] = { .1, .1, .1, 1.0 };
-	GLfloat mat_shininess[] = { 30.0 };
-	GLfloat light_Front[] = { 10.0, 10.0, 10.0, 1.0 };
-	GLfloat light_Back[] = { -10.0, -10.0, -10.0, 1.0 };
-	GLfloat lightHigh[] = { 1.0, 1.0, 1.0 };
-	GLfloat lightLow[] = { 0.5, 0.5, 0.5 };
-	GLfloat lmodel_ambient[] = { 0.1, 0.1, 0.1, 1.0 };
-
-	glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
-	glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
-	if(frontLighting_)
-	{
-		glLightfv(GL_LIGHT0, GL_POSITION, light_Front);
-		glLightfv(GL_LIGHT0, GL_DIFFUSE, lightHigh );
-		glLightfv(GL_LIGHT0, GL_SPECULAR, lightHigh );
-		glLightfv(GL_LIGHT1, GL_POSITION, light_Back);
-		glLightfv(GL_LIGHT1, GL_DIFFUSE, lightLow );
-		glLightfv(GL_LIGHT1, GL_SPECULAR, lightLow );
-	}
-	else
-	{
-		glLightfv(GL_LIGHT0, GL_POSITION, light_Front);
-		glLightfv(GL_LIGHT0, GL_DIFFUSE, lightLow );
-		glLightfv(GL_LIGHT0, GL_SPECULAR, lightLow );
-		glLightfv(GL_LIGHT1, GL_POSITION, light_Back);
-		glLightfv(GL_LIGHT1, GL_DIFFUSE, lightHigh );
-		glLightfv(GL_LIGHT1, GL_SPECULAR, lightHigh );
-	}
-	glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
-	glEnable(GL_LIGHT0);
-	glEnable(GL_LIGHT1);
-	glEnable(GL_LIGHTING);
-	glShadeModel (GL_SMOOTH);
-	glEnable(GL_DEPTH_TEST);
-	glEnable(GL_COLOR_MATERIAL);
-
-	if(drawAxis_)
-	{
-		// draw x axis
-		glLineWidth( 2.0 );
-		glBegin( GL_LINES );
-		qglColor( red );
-		glVertex3f( -1.0, -1.0, -1.0 );    glVertex3f( 1.5, -1.0, -1.0 );
-		glVertex3f( 1.4, -1.1, -1.0 );    glVertex3f( 1.5, -1.2, -1.0 );
-		glVertex3f( 1.5, -1.1, -1.0 );    glVertex3f( 1.4, -1.2, -1.0 );
-		glVertex3f( 1.35, -1.22, -1.0 );    glVertex3f( 1.55, -1.22, -1.0 );
-		glEnd();
-		glPushMatrix();
-		glRotatef(90, 0.0, 1.0, 0.0);
-		glTranslatef(1.0, -1.0, 1.4);
-		glCallList(cone_);
-		glPopMatrix();
-
-		// draw y axis
-		glBegin( GL_LINES );
-		qglColor( green );
-		glVertex3f( -1.0, -1.0, -1.0 );    glVertex3f( -1.0, 1.5, -1.0 );
-		glVertex3f( -1.2, 1.5, -1.0 );    glVertex3f( -1.15, 1.45, -1.0 );
-		glVertex3f( -1.1, 1.5, -1.0 );    glVertex3f( -1.2, 1.4, -1.0 );
-		glVertex3f( -1.05, 1.38, -1.0 );    glVertex3f( -1.25, 1.38, -1.0 );
-		glEnd();
-		glPushMatrix();
-		glRotatef(-90, 1.0, 0.0, 0.0);
-		glTranslatef( -1.0, 1.0, 1.4);
-		glCallList(cone_);
-		glPopMatrix();
-
-		// draw z axis
-		glBegin( GL_LINES );
-		qglColor( blue );
-		glVertex3f( -1.0, -1.0, -1.0 );    glVertex3f( -1.0, -1.0, 1.5 );
-		glVertex3f( -1.0, -1.1, 1.5 );    glVertex3f( -1.0, -1.1, 1.4 );
-		glVertex3f( -1.0, -1.1, 1.4 );    glVertex3f( -1.0, -1.2, 1.5 );
-		glVertex3f( -1.0, -1.2, 1.5 );    glVertex3f( -1.0, -1.2, 1.4 );
-		glVertex3f( -1.0, -1.22, 1.55 );    glVertex3f( -1.0, -1.22, 1.35 );
-		glEnd();
-		glPushMatrix();
-		glTranslatef(-1.0, -1.0, 1.4);
-		glCallList(cone_);
-		glPopMatrix();
-	}
-
-	glLineWidth( 1.0 );
-
-	GLfloat rp = (GLfloat)pointingColor_.red()/255.;
- 	GLfloat gp = (GLfloat)pointingColor_.green()/255.;
- 	GLfloat bp = (GLfloat)pointingColor_.blue()/255.;
-
-	GLfloat r = (GLfloat)defaultColor_.red()/255.;
- 	GLfloat g = (GLfloat)defaultColor_.green()/255.;
- 	GLfloat b = (GLfloat)defaultColor_.blue()/255.;
-
-	int i, size = (int)ballVec_.size();
-
-	glColor3f(r, g, b);
-	for(i=0; i<selIni_; ++i)
-	{
-		glPushMatrix();
-		if(ballVec_[i])
-			glCallList(ballVec_[i]);
-		glPopMatrix();
-	}
-
-	glColor3f(rp, gp, bp);
-	for(i=selIni_; i<size; ++i)
-	{
-		glPushMatrix();
-		if(ballVec_[i])
-			glCallList(ballVec_[i]);
-		glPopMatrix();
-	}
-
-	glFlush();
-	glDisable(GL_LIGHTING);
-}
-
-void TeQtGLWidget::initializeGL()
-{
-     makeObject();		// Generate an OpenGL display list
-}
-
-void TeQtGLWidget::resizeGL( int w, int h )
-{
-    glViewport( 0, 0, (GLint)w, (GLint)h );
-}
-
-void TeQtGLWidget::makeObject()
-{
-	deleteGLObject();
-
-	ballVec_.clear();
-	ballMap_.clear();
-	getValues();
-	draw2DPixmaps();
-
-    GLUquadricObj* qobj = gluNewQuadric();
-	//gluQuadricDrawStyle(qobj, GLU_FILL);
-
-	double	x, y, z;
-	double w = (max_ - min_) / 2.;
-	double wm = min_ + w;
-	int i, size = (int)xVec_.size();
-
-	for(i=0; i<size; ++i)
-	{
-		string id = idVec_[i];
-		int k = glGenLists( 1 );
-		ballVec_.push_back(k);
-		ballMap_[id] = k;
-
-		glNewList( k, GL_COMPILE );
-
-		x = xVec_[i];
-		y = yVec_[i];
-		z = zVec_[i];
-
-		glBegin( GL_COMPILE);
-		x = (x-wm)/w;
-		y = (y-wm)/w;
-		z = (z-wm)/w;
-		glPushMatrix();
-		glTranslatef (x, y, z);
-		gluSphere(qobj, /* radius */ .02, /* slices */ quality_, /* stacks */ quality_);
-		glPopMatrix();
-		glEnd();
-		glEndList();
-	}
-
-	cone_ = glGenLists( 1 );
-	glNewList( cone_, GL_COMPILE );
-	glBegin( GL_COMPILE);
-	glPushMatrix();
-	gluCylinder(qobj, .035, 0, .15, 12, 12);
-	glPopMatrix();
-	glEnd();
-	glEndList();
-
-	gluDeleteQuadric(qobj);
-
-	paint2D();
-}
-
-void TeQtGLWidget::getValues()
-{
-	idVec_.clear();
-
-	xVec_.clear();
-	yVec_.clear();
-	zVec_.clear();
-
-	TeDatabasePortal *portal = db_->getPortal();
-	double	a, b, c;
-	string CT, CA, from;
-
-	if(theme_->type() == TeTHEME)
-	{
-		CT = theme_->collectionTable();
-		CA = theme_->collectionAuxTable();
-		from = theme_->sqlGridFrom();
-	}
-	else if(theme_->type() == TeEXTERNALTHEME)
-	{
-		CT = ((TeExternalTheme*)theme_)->getRemoteTheme()->collectionTable();
-		CA = ((TeExternalTheme*)theme_)->getRemoteTheme()->collectionAuxTable();
-		from = ((TeExternalTheme*)theme_)->getRemoteTheme()->sqlGridFrom();
-	}
-
-	string id;
-	string atr;
-	if(function_ != "NONE")
-	{
-		id = CT + ".c_object_id";
-		atr = "MIN(" + id + "), " + function_ + "(" + xField_ + "), " + function_ + "(" + yField_ + "), " + function_ + "(" + zField_ + ")";
-	}
-	else
-	{
-		id = CA + ".unique_id";
-		atr = id + ", " + xField_ + ", " + yField_ + ", " + zField_;
-	}
-
-	if(theme_->type() == TeTHEME)
-	{
-		string query = "SELECT " + atr + from;
-
-		if(function_ == "NONE")
-		{
-			if(selectedObjects_ == TeAll)
-			{
-				query += " WHERE (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
-			}
-			else if(selectedObjects_ == TeSelectedByQuery)
-			{
-				query += " WHERE (grid_status = 2  OR (grid_status is null AND c_object_status = 2))";
-			}
-			else if(selectedObjects_ == TeNotSelectedByQuery)
-			{
-				query += " WHERE (grid_status = 0 OR (grid_status is null AND c_object_status = 0))";
-			}
-			else if(selectedObjects_ == TeGrouped)
-				query += " WHERE ((c_legend_id <> 0) AND (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2))))";
-			else if(selectedObjects_ == TeNotGrouped)
-				query += " WHERE ((c_legend_id = 0) AND (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2))))";
-		}
-		else
-		{
-			if(selectedObjects_ == TeAll)
-			{
-				query += " WHERE (c_object_status = 0 OR c_object_status = 2)";
-			}
-			else if(selectedObjects_ == TeSelectedByQuery)
-			{
-				query += " WHERE (c_object_status = 2)";
-			}
-			else if(selectedObjects_ == TeNotSelectedByQuery)
-			{
-				query += " WHERE (c_object_status = 0)";
-			}
-			else if(selectedObjects_ == TeGrouped)
-				query += " WHERE ((c_legend_id <> 0) AND (c_object_status = 0 OR c_object_status = 2))";
-			else if(selectedObjects_ == TeNotGrouped)
-				query += " WHERE ((c_legend_id = 0) AND (c_object_status = 0 OR c_object_status = 2))";
-		}
-
-		if(function_ != "NONE")
-			query += " GROUP BY " + CT + ".c_object_id";
-		if(portal->query(query) == false)
-		{
-			delete portal;
-			return;
-		}
-
-		min_ = TeMAXFLOAT;
-		max_ = -TeMAXFLOAT;
-		string id, sa, sb, sc;
-		while(portal->fetchRow())
-		{
-			id = portal->getData(0);
-			sa = portal->getData(1);
-			sb = portal->getData(2);
-			sc = portal->getData(3);
-			if(sa.empty()==false && sb.empty()==false && sc.empty()==false)
-			{
-				a = atof(sa.c_str());
-				b = atof(sb.c_str());
-				c = atof(sc.c_str());
-				xVec_.push_back(a);
-				yVec_.push_back(b);
-				zVec_.push_back(c);
-				min_ = MIN(min_, a);
-				min_ = MIN(min_, b);
-				min_ = MIN(min_, c);
-				max_ = MAX(max_, a);
-				max_ = MAX(max_, b);
-				max_ = MAX(max_, c);
-				idVec_.push_back(id);
-			}
-		}
-		selIni_ = (int)xVec_.size();
-
-		query = "SELECT " + atr + from;
-		if(function_ == "NONE")
-		{
-			if(selectedObjects_ == TeAll)
-			{
-				query += " WHERE (grid_status = 1 OR grid_status = 3";
-				query += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3)))";
-			}
-			else if(selectedObjects_ == TeSelectedByQuery)
-			{
-				query += " WHERE (grid_status = 3  OR (grid_status is null AND c_object_status = 3))";
-			}
-			else if(selectedObjects_ == TeNotSelectedByQuery)
-			{
-				query += " WHERE ((grid_status = 1  OR (grid_status is null AND c_object_status = 1)))";
-			}
-			else if(selectedObjects_ == TeGrouped)
-			{
-				query += " WHERE ((c_legend_id <> 0) AND (grid_status = 1 OR grid_status = 3";
-				query += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3))))";
-			}
-			else if(selectedObjects_ == TeNotGrouped)
-			{
-				query += " WHERE ((c_legend_id = 0) AND (grid_status = 1 OR grid_status = 3";
-				query += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3))))";
-			}
-		}
-		else
-		{
-			if(selectedObjects_ == TeAll)
-			{
-				query += " WHERE (c_object_status = 1 OR c_object_status = 3)";
-			}
-			else if(selectedObjects_ == TeSelectedByQuery)
-			{
-				query += " WHERE (c_object_status = 3)";
-			}
-			else if(selectedObjects_ == TeNotSelectedByQuery)
-			{
-				query += " WHERE (c_object_status = 1)";
-			}
-			else if(selectedObjects_ == TeGrouped)
-			{
-				query += " WHERE ((c_legend_id <> 0) AND (c_object_status = 1 OR c_object_status = 3))";
-			}
-			else if(selectedObjects_ == TeNotGrouped)
-			{
-				query += " WHERE ((c_legend_id = 0) AND (c_object_status = 1 OR c_object_status = 3))";
-			}
-		}
-
-		if(function_ != "NONE")
-			query += " GROUP BY " + CT + ".c_object_id";
-
-		portal->freeResult();
-		if(portal->query(query) == false)
-		{
-			delete portal;
-			return;
-		}
-
-		while(portal->fetchRow())
-		{
-			id = portal->getData(0);
-			sa = portal->getData(1);
-			sb = portal->getData(2);
-			sc = portal->getData(3);
-			if(sa.empty()==false && sb.empty()==false && sc.empty()==false)
-			{
-				a = atof(sa.c_str());
-				b = atof(sb.c_str());
-				c = atof(sc.c_str());
-				xVec_.push_back(a);
-				yVec_.push_back(b);
-				zVec_.push_back(c);
-				min_ = MIN(min_, a);
-				min_ = MIN(min_, b);
-				min_ = MIN(min_, c);
-				max_ = MAX(max_, a);
-				max_ = MAX(max_, b);
-				max_ = MAX(max_, c);
-				idVec_.push_back(id);
-			}
-		}
-	}
-	else if(theme_->type() == TeEXTERNALTHEME)
-	{
-		string query = "SELECT " + atr + from;
-
-		string where;
-		if(function_ == "NONE")
-		{
-			if(selectedObjects_ == TeAll)
-			{
-				where = " WHERE (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
-			}
-			else if(selectedObjects_ == TeSelectedByQuery)
-			{
-				where = " WHERE (grid_status = 2  OR (grid_status is null AND c_object_status = 2))";
-			}
-			else if(selectedObjects_ == TeNotSelectedByQuery)
-			{
-				where = " WHERE (grid_status = 0 OR (grid_status is null AND c_object_status = 0))";
-			}
-			else if(selectedObjects_ == TeGrouped)
-				where = " WHERE ((c_legend_id <> 0) AND (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2))))";
-			else if(selectedObjects_ == TeNotGrouped)
-				where = " WHERE ((c_legend_id = 0) AND (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2))))";
-		}
-		else
-		{
-			if(selectedObjects_ == TeAll)
-			{
-				where = " WHERE (c_object_status = 0 OR c_object_status = 2)";
-			}
-			else if(selectedObjects_ == TeSelectedByQuery)
-			{
-				where = " WHERE (c_object_status = 2)";
-			}
-			else if(selectedObjects_ == TeNotSelectedByQuery)
-			{
-				where = " WHERE (c_object_status = 0)";
-			}
-			else if(selectedObjects_ == TeGrouped)
-				where = " WHERE ((c_legend_id <> 0) AND (c_object_status = 0 OR c_object_status = 2))";
-			else if(selectedObjects_ == TeNotGrouped)
-				where = " WHERE ((c_legend_id = 0) AND (c_object_status = 0 OR c_object_status = 2))";
-		}
-
-		vector<string> sv = generateItemsInClauseVec(theme_, where);
-		vector<string>::iterator it;
-
-		min_ = TeMAXFLOAT;
-		max_ = -TeMAXFLOAT;
-		string id, sa, sb, sc;
-		for(it=sv.begin(); it!=sv.end(); ++it)
-		{
-			string sel = query + " WHERE " + CA + ".unique_id IN " + *it;
-
-			if(function_ != "NONE")
-				sel += " GROUP BY " + CT + ".c_object_id";
-
-			if(portal->query(sel) == false)
-			{
-				delete portal;
-				return;
-			}
-
-			while(portal->fetchRow())
-			{
-				id = portal->getData(0);
-				sa = portal->getData(1);
-				sb = portal->getData(2);
-				sc = portal->getData(3);
-				if(sa.empty()==false && sb.empty()==false && sc.empty()==false)
-				{
-					a = atof(sa.c_str());
-					b = atof(sb.c_str());
-					c = atof(sc.c_str());
-					xVec_.push_back(a);
-					yVec_.push_back(b);
-					zVec_.push_back(c);
-					min_ = MIN(min_, a);
-					min_ = MIN(min_, b);
-					min_ = MIN(min_, c);
-					max_ = MAX(max_, a);
-					max_ = MAX(max_, b);
-					max_ = MAX(max_, c);
-					idVec_.push_back(id);
-				}
-			}
-			portal->freeResult();
-		}
-
-		selIni_ = (int)xVec_.size();
-
-		query = "SELECT " + atr + from;
-		if(function_ == "NONE")
-		{
-			if(selectedObjects_ == TeAll)
-			{
-				where = " WHERE (grid_status = 1 OR grid_status = 3";
-				where += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3)))";
-			}
-			else if(selectedObjects_ == TeSelectedByQuery)
-			{
-				where = " WHERE (grid_status = 3  OR (grid_status is null AND c_object_status = 3))";
-			}
-			else if(selectedObjects_ == TeNotSelectedByQuery)
-			{
-				where = " WHERE ((grid_status = 1  OR (grid_status is null AND c_object_status = 1)))";
-			}
-			else if(selectedObjects_ == TeGrouped)
-			{
-				where = " WHERE ((c_legend_id <> 0) AND (grid_status = 1 OR grid_status = 3";
-				where += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3))))";
-			}
-			else if(selectedObjects_ == TeNotGrouped)
-			{
-				where = " WHERE ((c_legend_id = 0) AND (grid_status = 1 OR grid_status = 3";
-				where += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3))))";
-			}
-		}
-		else
-		{
-			if(selectedObjects_ == TeAll)
-			{
-				where = " WHERE (c_object_status = 1 OR c_object_status = 3)";
-			}
-			else if(selectedObjects_ == TeSelectedByQuery)
-			{
-				where = " WHERE (c_object_status = 3)";
-			}
-			else if(selectedObjects_ == TeNotSelectedByQuery)
-			{
-				where = " WHERE (c_object_status = 1)";
-			}
-			else if(selectedObjects_ == TeGrouped)
-			{
-				where = " WHERE ((c_legend_id <> 0) AND (c_object_status = 1 OR c_object_status = 3))";
-			}
-			else if(selectedObjects_ == TeNotGrouped)
-			{
-				where = " WHERE ((c_legend_id = 0) AND (c_object_status = 1 OR c_object_status = 3))";
-			}
-		}
-		
-		sv = generateItemsInClauseVec(theme_, where);
-
-		for(it=sv.begin(); it!=sv.end(); ++it)
-		{
-			string sel = query + " WHERE " + CA + ".unique_id IN " + *it;
-
-			if(function_ != "NONE")
-				sel += " GROUP BY " + CT + ".c_object_id";
-
-			if(portal->query(sel) == false)
-			{
-				delete portal;
-				return;
-			}
-
-			while(portal->fetchRow())
-			{
-				id = portal->getData(0);
-				sa = portal->getData(1);
-				sb = portal->getData(2);
-				sc = portal->getData(3);
-				if(sa.empty()==false && sb.empty()==false && sc.empty()==false)
-				{
-					a = atof(sa.c_str());
-					b = atof(sb.c_str());
-					c = atof(sc.c_str());
-					xVec_.push_back(a);
-					yVec_.push_back(b);
-					zVec_.push_back(c);
-					min_ = MIN(min_, a);
-					min_ = MIN(min_, b);
-					min_ = MIN(min_, c);
-					max_ = MAX(max_, a);
-					max_ = MAX(max_, b);
-					max_ = MAX(max_, c);
-					idVec_.push_back(id);
-				}
-			}
-			portal->freeResult();
-		}
-	}
-	delete portal;
-
-	min_ = min_ - (max_ - min_) * 0.0001;
-	max_ = max_ + (max_ - min_) * 0.0001;
-
-	if(ballVec_.empty() == false)
-	{
-		ballVec_.clear();
-		int i, size = (int)idVec_.size();
-		map<string, GLuint>::iterator it;
-
-		for(i=0; i<size; ++i)
-		{
-			string id = idVec_[i];
-			it = ballMap_.find(id);
-			if(it != ballMap_.end())
-				ballVec_.push_back(it->second);
-		}
-	}
-}
-
-void TeQtGLWidget::selectFromHexaedro()
-{
-	double x1, y1, z1, x2, y2, z2;
-	getCubeCoordinate(x1, y1, z1, x2, y2, z2);
-	string xmin = Te2String(x1, 6);
-	string ymin = Te2String(y1, 6);
-	string zmin = Te2String(z1, 6);
-	string xmax = Te2String(x2, 6);
-	string ymax = Te2String(y2, 6);
-	string zmax = Te2String(z2, 6);
-
-	string CT, CA, from;
-
-	if(theme_->type() == TeTHEME)
-	{
-		CT = theme_->collectionTable();
-		CA = theme_->collectionAuxTable();
-		from = theme_->sqlGridFrom();
-	}
-	else if(theme_->type() == TeEXTERNALTHEME)
-	{
-		CT = ((TeExternalTheme*)theme_)->getRemoteTheme()->collectionTable();
-		CA = ((TeExternalTheme*)theme_)->getRemoteTheme()->collectionAuxTable();
-		from = ((TeExternalTheme*)theme_)->getRemoteTheme()->sqlGridFrom();
-	}
-
-	string obj = CT + ".c_object_id";
-	string sel, atr, where;
-	bool func = false;
-
-	if(function_ != "NONE")
-	{
-		func = true;
-		atr = "MIN(" + obj + ") as objas, " + function_ + "(" + xField_ + ") as xas, ";
-		atr += function_ + "(" + yField_ + ") as yas, " + function_ + "(" + zField_ + ") as zas ";
-	}
-	else
-		atr = xField_ + ", " + yField_ + ", " + zField_;
-
-
-	if(func == false)
-	{
-		if(selectedObjects_ == TeAll)
-			where = " WHERE (grid_status >= 0 OR (grid_status is null AND c_object_status >= 0))";
-		else if(selectedObjects_ == TeSelectedByQuery)
-			where = " WHERE (grid_status >= 2  OR (grid_status is null AND c_object_status >= 2))";
-		else if(selectedObjects_ == TeNotSelectedByQuery)
-			where = " WHERE (grid_status <> 2 OR (grid_status is null AND c_object_status <> 2))";
-		else if(selectedObjects_ == TeGrouped)
-			where = " WHERE ((c_legend_id <> 0) AND (grid_status >= 0 OR (grid_status is null AND c_object_status >= 0)))";
-		else if(selectedObjects_ == TeNotGrouped)
-			where = " WHERE ((c_legend_id = 0) AND (grid_status >= 0 OR (grid_status is null AND c_object_status >= 0)))";
-	}
-	else
-	{
-		if(selectedObjects_ == TeAll)
-			where = " WHERE (c_object_status >= 0)";
-		else if(selectedObjects_ == TeSelectedByQuery)
-			where = " WHERE (c_object_status >= 2)";
-		else if(selectedObjects_ == TeNotSelectedByQuery)
-			where = " WHERE (c_object_status <> 2)";
-		else if(selectedObjects_ == TeGrouped)
-			where = " WHERE (c_legend_id <> 0 AND c_object_status >= 0)";
-		else if(selectedObjects_ == TeNotGrouped)
-			where = " WHERE (c_legend_id = 0 AND c_object_status >= 0)";
-	}
-
-	set<string> uniqueIdSet, objectIdSet;
-	TeDatabasePortal *portal = db_->getPortal();
-	if(theme_->type() == TeTHEME)
-	{
-		if(func)
-		{
-			sel = "SELECT objas, xas, yas, zas FROM (SELECT " + atr + from;
-			sel += where + " GROUP BY " + CT + ".c_object_id)";
-			sel += " WHERE ";
-			sel += "xas > " + xmin + " AND ";
-			sel += "xas < " + xmax + " AND ";
-			sel += "yas > " + ymin + " AND ";
-			sel += "yas < " + ymax + " AND ";
-			sel += "zas > " + zmin + " AND ";
-			sel += "zas < " + zmax;
-		}
-		else
-		{
-			sel = "SELECT " + CA + ".unique_id, " + CT + ".c_object_id, " + atr + from;
-			sel += where + " AND ";
-
-			sel += xField_ + " > " + xmin + " AND ";
-			sel += xField_ + " < " + xmax + " AND ";
-			sel += yField_ + " > " + ymin + " AND ";
-			sel += yField_ + " < " + ymax + " AND ";
-			sel += zField_ + " > " + zmin + " AND ";
-			sel += zField_ + " < " + zmax;
-		}
-
-		string val;
-		if(portal->query(sel))
-		{
-			while(portal->fetchRow())
-			{
-				if(func)
-						objectIdSet.insert(portal->getData(0));
-				else
-				{
-					val = portal->getData(0);
-					if(val.empty())
-						objectIdSet.insert(portal->getData(1));
-					else
-						uniqueIdSet.insert(val);
-				}
-			}
-		}
-	}
-	else if(theme_->type() == TeEXTERNALTHEME)
-	{
-		vector<string> sv = generateItemsInClauseVec(theme_, where);
-		vector<string>::iterator it;
-		string val;
-
-		for(it=sv.begin(); it!=sv.end(); ++it)
-		{
-			if(func)
-			{
-				sel = "SELECT objas, xas, yas, zas FROM (SELECT " + atr + from;
-				sel += " WHERE " + CA + ".unique_id IN " + *it;
-				sel += " GROUP BY " + CT + ".c_object_id)";
-				sel += " WHERE ";
-				sel += "xas > " + xmin + " AND ";
-				sel += "xas < " + xmax + " AND ";
-				sel += "yas > " + ymin + " AND ";
-				sel += "yas < " + ymax + " AND ";
-				sel += "zas > " + zmin + " AND ";
-				sel += "zas < " + zmax;
-			}
-			else
-			{
-				sel = "SELECT " + CA + ".unique_id, " + CT + ".c_object_id, " + atr + from;
-				sel += " WHERE " + CA + ".unique_id IN " + *it;
-				sel += " AND ";
-				sel += xField_ + " > " + xmin + " AND ";
-				sel += xField_ + " < " + xmax + " AND ";
-				sel += yField_ + " > " + ymin + " AND ";
-				sel += yField_ + " < " + ymax + " AND ";
-				sel += zField_ + " > " + zmin + " AND ";
-				sel += zField_ + " < " + zmax;
-			}
-
-			if(portal->query(sel))
-			{
-				while(portal->fetchRow())
-				{
-					if(func)
-							objectIdSet.insert(portal->getData(0));
-					else
-					{
-						val = portal->getData(0);
-						if(val.empty())
-							objectIdSet.insert(portal->getData(1));
-						else
-							uniqueIdSet.insert(val);
-					}
-				}
-			}
-			portal->freeResult();
-		}
-	}
-	delete portal;
-
-	if(addSelection_)
-		grid_->putColorOnGrid(uniqueIdSet, objectIdSet, "addPointing");
-	else
-		grid_->putColorOnGrid(uniqueIdSet, objectIdSet, "newPointing");
-}
-
-void TeQtGLWidget::setXRotation( int degrees )
-{
-	int graus = 360 * degrees / 99;
-    xRot_ = (GLfloat)(graus % 360);
-    updateGL();
-}
-
-void TeQtGLWidget::setYRotation( int degrees )
-{
-	int graus = 360 * degrees / 99;
-    yRot_ = (GLfloat)(graus % 360);
-    updateGL();
-}
-
-void TeQtGLWidget::setZRotation( int degrees )
-{
-	int graus = 360 * degrees / 99;
-    zRot_ = (GLfloat)(graus % 360);
-    updateGL();
-}
-
-void TeQtGLWidget::setXOffset( int offset )
-{
-	xOff_ = 2. * (double)offset / 99. - 1.;
-	if((xSize_ + xOff_) > 1.)
-	{
-		xOff_ = 1. - xSize_;
-		int newOffset = TeRound((xOff_ + 1.) * 99. / 2.);
-		emit setXOffsetSignal(newOffset);
-	}
-    updateGL();
-	paint2D();
-}
-
-void TeQtGLWidget::setYOffset( int offset )
-{
-	yOff_ = 2. * (double)offset / 99. - 1.;
-	if((ySize_ + yOff_) > 1.)
-	{
-		yOff_ = 1. - ySize_;
-		int newOffset = TeRound((yOff_ + 1.) * 99. / 2.);
-		emit setYOffsetSignal(newOffset);
-	}
-    updateGL();
-	paint2D();
-}
-
-void TeQtGLWidget::setZOffset( int offset )
-{
-	zOff_ = 2. * (double)offset / 99. - 1.;
-	if((zSize_ + zOff_) > 1.)
-	{
-		zOff_ = 1. - zSize_;
-		int newOffset = TeRound((zOff_ + 1.) * 99. / 2.);
-		emit setZOffsetSignal(newOffset);
-	}
-    updateGL();
-	paint2D();
-}
-
-
-void TeQtGLWidget::setXSize( int size )
-{
-	xSize_ = 2. * (double)size / 99.;
-	if((xSize_ + xOff_) > 1.)
-	{
-		xSize_ = 1. - xOff_;
-		int newSize = TeRound(xSize_ * 99. / 2.);
-		emit setXSizeSignal(newSize);
-	}
-    updateGL();
-	paint2D();
-}
-
-void TeQtGLWidget::setYSize( int size )
-{
-	ySize_ = 2. * (double)size / 99.;
-	if((ySize_ + yOff_) > 1.)
-	{
-		ySize_ = 1. - yOff_;
-		int newSize = TeRound(ySize_ * 99. / 2.);
-		emit setYSizeSignal(newSize);
-	}
-    updateGL();
-	paint2D();
-}
-
-void TeQtGLWidget::setZSize( int size )
-{
-	zSize_ = 2. * (double)size / 99.;
-	if((zSize_ + zOff_) > 1.)
-	{
-		zSize_ = 1. - zOff_;
-		int newSize = TeRound(zSize_ * 99. / 2.);
-		emit setZSizeSignal(newSize);
-	}
-    updateGL();
-	paint2D();
-}
-
-void TeQtGLWidget::setViewAngle( int a )
-{
-	viewAngle_ = 120. - (double)a;
-    updateGL();
-}
-
-void TeQtGLWidget::setLightingMode( int )
-{
-	frontLighting_ = !frontLighting_;
-    updateGL();
-}
-
-void TeQtGLWidget::mousePressEvent(QMouseEvent* e)
-{
-	mousePosition_ = e->pos();
-}
-
-void TeQtGLWidget::mouseMoveEvent(QMouseEvent* e)
-{
-	if(e->state() == Qt::NoButton)
-		return;
-
-	QPoint p = e->pos();
-	double w = (double)width();
-	double h = (double)height();
-	double dx = (double)(p.x() - mousePosition_.x());
-	double dy = (double)(mousePosition_.y() - p.y());
-
-	if(fabs(dx) <= 3.)
-		dx = 0.;
-	if(fabs(dy) <= 3.)
-		dy = 0.;
-	if(dx == 0. && dy == 0.)
-		return;
-
-	dx = dx * viewAngle_ / 40.;
-	dy = dy * viewAngle_ / 40.;
-
-	if(keyPress_ == 0)
-	{
-		if(e->state() == Qt::LeftButton)  // translation
-		{
-			xTranslation_ += 2. * (dx / w);
-			yTranslation_ += 2. * (dy / h);
-		}
-		else if(e->state() == (Qt::LeftButton | Qt::AltButton))// x and y and z rotation
-		{
-			xRot_ += dx;
-			if(xRot_ > 360.)
-				xRot_ = xRot_ - 360.;
-			else if(xRot_ < 0.)
-				xRot_ = 360. + xRot_;
-			emit setXRotationSignal(int(xRot_));
-	
-			yRot_ += dy;
-			if(yRot_ > 360.)
-				yRot_ = yRot_ - 360.;
-			else if(yRot_ < 0.)
-				yRot_ = 360. + yRot_;
-			emit setYRotationSignal(int(yRot_));
-
-			zRot_ += (dx+dy);
-			if(zRot_ > 360.)
-				zRot_ = zRot_ - 360.;
-			else if(zRot_ < 0.)
-				zRot_ = 360. + zRot_;
-			emit setZRotationSignal(int(zRot_));
-		}
-		else if(e->state() == Qt::MidButton) // zoom
-		{
-			viewAngle_ += dy;
-			if(viewAngle_ < 1.)
-				viewAngle_ = 1;
-			else if(viewAngle_ > 120.)
-				viewAngle_ = 120.;
-
-			int a = (int)(120. - viewAngle_);
-			emit setZoomSignal(a);
-		}
-	}
-	else if(keyPress_ == Qt::Key_X)
-	{
-		xRot_ += dy;
-		if(xRot_ > 360.)
-			xRot_ = xRot_ - 360.;
-		else if(xRot_ < 0.)
-			xRot_ = 360. + xRot_;
-		emit setXRotationSignal(int(xRot_));
-	}
-	else if(keyPress_ == Qt::Key_Y)
-	{
-		yRot_ += dy;
-		if(yRot_ > 360.)
-			yRot_ = yRot_ - 360.;
-		else if(yRot_ < 0.)
-			yRot_ = 360. + yRot_;
-		emit setYRotationSignal(int(yRot_));
-	}
-	else if(keyPress_ == Qt::Key_Z)
-	{
-		zRot_ += dy;
-		if(zRot_ > 360.)
-			zRot_ = zRot_ - 360.;
-		else if(zRot_ < 0.)
-			zRot_ = 360. + zRot_;
-		emit setZRotationSignal(int(zRot_));
-	}
-
-	mousePosition_ = p;
-    updateGL();
-}
-
-void TeQtGLWidget::mouseReleaseEvent(QMouseEvent*)
-{
-}
-
-void TeQtGLWidget::keyPressEvent(QKeyEvent* e)
-{
-	keyPress_ = e->key();
-	if(keyPress_ == Qt::Key_Shift || keyPress_ == Qt::Key_Control || keyPress_ == Qt::Key_Alt)
-		keyPress_ = 0;
-
-	if(keyPress_ == Qt::Key_R)
-	{
-		viewAngle_ = 60.;
-		xTranslation_ = 0.;
-		yTranslation_ = 0.;
-		zTranslation_ = -3.5;
-		xRot_ = yRot_ = zRot_ = 0;
-		emit setXRotationSignal(int(xRot_));
-		emit setYRotationSignal(int(yRot_));
-		emit setZRotationSignal(int(zRot_));
-	}
-}
-
-void TeQtGLWidget::keyReleaseEvent(QKeyEvent*)
-{
-	keyPress_ = 0;
-}
-
-void TeQtGLWidget::draw2DPixmaps()
-{
-	QRect r = ((QFrame*)(xyDevice_))->rect();
-	xyPixmap_.resize(r.width(), r.height());
-	zxPixmap_.resize(r.width(), r.height());
-	yzPixmap_.resize(r.width(), r.height());
-	xyPixmap_.fill(QColor(Qt::black));
-	zxPixmap_.fill(QColor(Qt::black));
-	yzPixmap_.fill(QColor(Qt::black));
-
-	QPainter xyPainter(&xyPixmap_);
-	QPainter zxPainter(&zxPixmap_);
-	QPainter yzPainter(&yzPixmap_);
-	QFont font;
-	int fsize = 10;
-	font.setPointSize(10);
-	font.setBold(true);
-	xyPainter.setFont(font);
-	zxPainter.setFont(font);
-	yzPainter.setFont(font);
-	QPen pen(QColor(red), 2);
-
-	double width = (double)r.width();
-	double w = max_ - min_;
-
-	xyPainter.setPen(pen);
-	xyPainter.drawLine(0, (int)(width - 1), (int)(width - 1), (int)(width - 1));
-	xyPainter.drawText((int)(width - fsize - 2), (int)(width - 5), "X");
-	pen.setColor(QColor(green));
-	xyPainter.setPen(pen);
-	xyPainter.drawLine(0, 0, 0, (int)(width - 1));
-	xyPainter.drawText(4, fsize + 3, "Y");
-
-	pen.setColor(QColor(blue));
-	zxPainter.setPen(pen);
-	zxPainter.drawLine(0, (int)(width - 1), (int)(width - 1), (int)(width - 1));
-	zxPainter.drawText((int)(width - fsize - 2), (int)(width - 5), "Z");
-	pen.setColor(QColor(red));
-	zxPainter.setPen(pen);
-	zxPainter.drawLine(0, 0, 0, (int)(width - 1));
-	zxPainter.drawText(4, fsize + 3, "X");
-
-	pen.setColor(QColor(green));
-	yzPainter.setPen(pen);
-	yzPainter.drawLine(0, (int)(width - 1), (int)(width - 1), (int)(width - 1));
-	yzPainter.drawText((int)(width - fsize - 2), (int)(width - 5), "Y");
-	pen.setColor(QColor(blue));
-	yzPainter.setPen(pen);
-	yzPainter.drawLine(0, 0, 0, (int)(width - 1));
-	yzPainter.drawText(4, fsize + 3, "Z");
-
-	int i, size = (int)xVec_.size();
-	double	v;
-	int	x, y, z;
-	QPointArray xypa(size);
-	QPointArray zxpa(size);
-	QPointArray yzpa(size);
-
-	pen.setColor(defaultColor_);
-	pen.setWidth(5);
-	xyPainter.setPen(pen);
-	zxPainter.setPen(pen);
-	yzPainter.setPen(pen);
-	for(i=0; i<size; ++i)
-	{
-		v = xVec_[i];
-		x = TeRound(width * (v - min_) / w);
-		v = yVec_[i];
-		y = TeRound(width * (v - min_) / w);
-		v = zVec_[i];
-		z = TeRound(width * (v - min_) / w);
-
-		// the vertical axis must be inverted
-		xypa.setPoint(i, x, (int)(width - y));
-		zxpa.setPoint(i, z, (int)(width - x));
-		yzpa.setPoint(i, y, (int)(width - z));
-	}
-	xyPainter.drawPoints(xypa, 0, selIni_);
-	zxPainter.drawPoints(zxpa, 0, selIni_);
-	yzPainter.drawPoints(yzpa, 0, selIni_);
-
-	pen.setColor(pointingColor_);
-	xyPainter.setPen(pen);
-	zxPainter.setPen(pen);
-	yzPainter.setPen(pen);
-
-	xyPainter.drawPoints(xypa, selIni_);
-	zxPainter.drawPoints(zxpa, selIni_);
-	yzPainter.drawPoints(yzpa, selIni_);
-}
-
-void TeQtGLWidget::paint2D()
-{
-	QPainter xyPainter(xyDevice_);
-	QPainter zxPainter(zxDevice_);
-	QPainter yzPainter(yzDevice_);
-	QPen pen(QColor(magenta), 1);
-	xyPainter.setPen(pen);
-	zxPainter.setPen(pen);
-	yzPainter.setPen(pen);
-	QRect r = xyPainter.viewport();
-
-	double width = (double)r.width();
-	double w = max_ - min_;
-	double ww = w / 2.;
-	double	v;
-	int	x1, x2, y1, y2, z1, z2;
-
-	bitBlt(xyDevice_, 0, 0, &xyPixmap_, 0, 0, (int)width, (int)width, Qt::CopyROP);
-	bitBlt(zxDevice_, 0, 0, &zxPixmap_, 0, 0, (int)width, (int)width, Qt::CopyROP);
-	bitBlt(yzDevice_, 0, 0, &yzPixmap_, 0, 0, (int)width, (int)width, Qt::CopyROP);
-
-	v = (xOff_ + 1.) * ww + min_;
-	x1 = TeRound(width * (v - min_) / w);
-	v = (yOff_ + 1.) * ww + min_;
-	y1 = TeRound(width * (v - min_) / w);
-	v = (xOff_ + xSize_ + 1.) * ww + min_;
-	x2 = TeRound(width * (v - min_) / w);
-	v = (yOff_ + ySize_ + 1.) * ww + min_;
-	y2 = TeRound(width * (v - min_) / w);
-	v = (zOff_ + 1.) * ww + min_;
-	z1 = TeRound(width * (v - min_) / w);
-	v = (zOff_ + zSize_ + 1.) * ww + min_;
-	z2 = TeRound(width * (v - min_) / w);
-
-	// the vertical axis must be inverted
-	xyPainter.drawRect(x1, (int)(width - y1 - (y2 - y1)), x2 - x1, y2 - y1);
-	zxPainter.drawRect(z1, (int)(width - x1 - (x2 - x1)), z2 - z1, x2 - x1);
-	yzPainter.drawRect(y1, (int)(width - z1 - (z2 - z1)), y2 - y1, z2 - z1);
-
-	xyPainter.flush();
-	zxPainter.flush();
-	yzPainter.flush();
-}
-
-void TeQtGLWidget::xOffsetReleased()
-{
-	drawSelecteds();
-}
-
-void TeQtGLWidget::yOffsetReleased()
-{
-	drawSelecteds();
-}
-
-void TeQtGLWidget::zOffsetReleased()
-{
-	drawSelecteds();
-}
-
-void TeQtGLWidget::xSizeReleased()
-{
-	drawSelecteds();
-}
-
-void TeQtGLWidget::ySizeReleased()
-{
-	drawSelecteds();
-}
-
-void TeQtGLWidget::zSizeReleased()
-{
-	drawSelecteds();
-}
-
-void TeQtGLWidget::drawSelecteds()
-{
-	selectFromHexaedro();
-	getValues();
-	draw2DPixmaps();
-	paint2D();
-	updateGL();
-}
-
-void TeQtGLWidget::getCubeCoordinate(double& x1, double& y1, double& z1, double& x2, double& y2, double& z2)
-{
-	double w = max_ - min_;
-	double ww = w / 2.;
-
-	x1 = (xOff_ + 1.) * ww + min_;
-	y1 = (yOff_ + 1.) * ww + min_;
-	z1 = (zOff_ + 1.) * ww + min_;
-	x2 = (xOff_ + xSize_ + 1.) * ww + min_;
-	y2 = (yOff_ + ySize_ + 1.) * ww + min_;
-	z2 = (zOff_ + zSize_ + 1.) * ww + min_;
-}
-
-void TeQtGLWidget::paint3D()
-{
-	updateGL();
-}
-
-void TeQtGLWidget::changeFunction(string function)
-{
-	function_ = function;
-	initGLObject();
-}
-
-void TeQtGLWidget::changeInputObjects(int v)
-{
-	selectedObjects_ = v;
-	initGLObject();
-}
-
-void TeQtGLWidget::changeQuality(int v)
-{
-	quality_ = TeRound(30. * (double)v / 99.) + 6;
-	initGLObject();
-}
-
-void TeQtGLWidget::updateSelection()
-{
-	getValues();
-	draw2DPixmaps();
-	paint2D();
-	updateGL();
-	addSelection_ = false;
-}
-
-void TeQtGLWidget::initGLObject()
-{
-	makeObject();
-	updateGL();
-}
-
-void TeQtGLWidget::deleteGLObject()
-{
-	int i, size = (int)ballVec_.size();
-
-	makeCurrent();
-	for(i=0; i<size; ++i)
-		glDeleteLists( ballVec_[i], 1 );
-	ballVec_.clear();
-	glDeleteLists (cone_, 1);
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+************************************************************************************/
+
+#include "TeQtGLWidget.h"
+#include "qframe.h"
+#include <qpainter.h>
+#include "TeDefines.h"
+#include "math.h"
+#include "TeUtils.h"
+#include <TeQtGrid.h>
+#include <TeExternalTheme.h>
+#include "TeDatabase.h"
+#include "TeDatabaseUtils.h"
+
+#if defined(Q_CC_MSVC)
+#pragma warning(disable:4305) // init: truncation from const double to float
+#endif
+
+TeQtGLWidget::TeQtGLWidget( QWidget* parent, const char* name, TeQtGrid* grid, string xField, string yField, string zField, QPaintDevice* xy, QPaintDevice* zx, QPaintDevice* yz, int selectedObjects, string func)
+    : QGLWidget( parent, name )
+{
+	setFocusPolicy(QWidget::StrongFocus);
+
+	xRot_ = yRot_ = zRot_ = 0.0;		// default object rotation
+    xOff_ = yOff_ = zOff_ = -0.2;		// default object Offset
+    xSize_ = ySize_ = zSize_ = 0.4;		// default object Size
+    scale_ = 1.;						// default object scale_
+	viewAngle_ = 60.;
+	xTranslation_ = 0.;
+	yTranslation_ = 0.;
+	zTranslation_ = -3.5;
+	frontLighting_ = true;
+	drawAxis_ = true;
+	xField_ = xField;
+	yField_ = yField;
+	zField_ = zField;
+	grid_ = grid;
+	theme_ = (TeTheme*)grid_->getTheme()->getTheme();
+
+	if(theme_->type() == TeTHEME)
+		db_ = theme_->layer()->database();
+	else if(theme_->type() == TeEXTERNALTHEME)
+		db_ = ((TeExternalTheme*)theme_)->getRemoteTheme()->layer()->database();
+
+	selectedObjects_ = selectedObjects;
+	function_ = func;
+	quality_ = 12;
+	addSelection_ = false;
+	keyPress_ = 0;
+
+	TeGeomRepVisualMap& vmap = theme_->defaultLegend().getVisualMap();
+	if(vmap.find(TePOLYGONS) != vmap.end())
+		defaultColor_ = QColor(vmap[TePOLYGONS]->color().red_, vmap[TePOLYGONS]->color().green_, vmap[TePOLYGONS]->color().blue_); 
+	else if(vmap.find(TeLINES) != vmap.end())
+		defaultColor_ = QColor(vmap[TeLINES]->color().red_, vmap[TeLINES]->color().green_, vmap[TeLINES]->color().blue_); 
+	else if(vmap.find(TePOINTS) != vmap.end())
+		defaultColor_ = QColor(vmap[TePOINTS]->color().red_, vmap[TePOINTS]->color().green_, vmap[TePOINTS]->color().blue_); 
+
+	TeGeomRepVisualMap& pmap = theme_->pointingLegend().getVisualMap();
+	if(pmap.find(TePOLYGONS) != vmap.end())
+		pointingColor_ = QColor(pmap[TePOLYGONS]->color().red_, pmap[TePOLYGONS]->color().green_, pmap[TePOLYGONS]->color().blue_); 
+	else if(pmap.find(TeLINES) != vmap.end())
+		pointingColor_ = QColor(pmap[TeLINES]->color().red_, pmap[TeLINES]->color().green_, pmap[TeLINES]->color().blue_); 
+	else if(pmap.find(TePOINTS) != vmap.end())
+		pointingColor_ = QColor(pmap[TePOINTS]->color().red_, pmap[TePOINTS]->color().green_, pmap[TePOINTS]->color().blue_); 
+
+	xyDevice_ = xy;
+	zxDevice_ = zx;
+	yzDevice_ = yz;
+}
+
+TeQtGLWidget::~TeQtGLWidget()
+{
+	deleteGLObject();
+}
+
+void TeQtGLWidget::paintGL()
+{
+	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+	glMatrixMode(GL_PROJECTION); 
+	glLoadIdentity(); 
+	int w = width();
+	int h = height();
+
+	if (w <= h) 
+		gluPerspective(viewAngle_ * (GLfloat) h / (GLfloat) w, (GLfloat) h / (GLfloat) w, 1.0, 16.0); 
+	else 
+		gluPerspective(viewAngle_ * (GLfloat) w / (GLfloat) h, (GLfloat) w / (GLfloat) h, 1.0, 18.0); 
+
+	glMatrixMode(GL_MODELVIEW); 
+	glLoadIdentity(); 
+
+	glTranslatef(xTranslation_, yTranslation_, zTranslation_); 
+    glRotatef( xRot_, 1.0, 0.0, 0.0 ); 
+    glRotatef( yRot_, 0.0, 1.0, 0.0 ); 
+    glRotatef( zRot_, 0.0, 0.0, 1.0 );
+
+    glLineWidth( 1.0 );
+    qglColor( magenta );
+    glBegin( GL_LINE_LOOP );
+    glVertex3f( xOff_ + xSize_,  yOff_ + ySize_, zOff_ );
+    glVertex3f( xOff_ + xSize_, yOff_ + ySize_, zOff_ + zSize_ );
+    glVertex3f( xOff_, yOff_ + ySize_, zOff_ + zSize_ );
+    glVertex3f( xOff_, yOff_ + ySize_, zOff_ );
+    glEnd();
+
+    glBegin( GL_LINE_LOOP );
+    glVertex3f( xOff_ + xSize_,  yOff_, zOff_ );
+    glVertex3f( xOff_, yOff_, zOff_ );
+    glVertex3f( xOff_, yOff_, zOff_ + zSize_ );
+    glVertex3f( xOff_ + xSize_, yOff_, zOff_ + zSize_ );
+    glEnd();
+
+    glBegin( GL_LINES );
+    glVertex3f( xOff_ + xSize_,  yOff_ + ySize_, zOff_ );   glVertex3f( xOff_ + xSize_,  yOff_, zOff_ );
+    glVertex3f( xOff_ + xSize_, yOff_ + ySize_, zOff_ + zSize_ );   glVertex3f( xOff_ + xSize_,  yOff_, zOff_ + zSize_ );
+    glVertex3f( xOff_, yOff_ + ySize_, zOff_ + zSize_ );   glVertex3f( xOff_, yOff_, zOff_ + zSize_ );
+    glVertex3f( xOff_,  yOff_ + ySize_, zOff_ );   glVertex3f( xOff_, yOff_, zOff_ );
+    glEnd();
+
+
+	// draw white cube
+    qglColor( white );
+    glBegin( GL_LINE_LOOP );
+    glVertex3f( 1.0,  1.0, -1.0 );
+    glVertex3f( 1.0, 1.0, 1.0 );
+    glVertex3f( -1.0, 1.0, 1.0 );
+    glVertex3f( -1.0,  1.0, -1.0 );
+    glEnd();
+
+    glBegin( GL_LINES );
+	if(!drawAxis_)
+	{
+		glVertex3f( 1.0,  -1.0, -1.0 );	glVertex3f( -1.0, -1.0, -1.0 );
+		glVertex3f( -1.0, -1.0, -1.0 );	glVertex3f( -1.0, -1.0, 1.0 );
+	}
+    glVertex3f( -1.0, -1.0, 1.0 );	glVertex3f( 1.0,  -1.0, 1.0 );
+	glVertex3f( 1.0,  -1.0, 1.0 );	glVertex3f( 1.0,  -1.0, -1.0 );
+    glVertex3f( 1.0,  1.0, -1.0 );   glVertex3f( 1.0,  -1.0, -1.0 );
+    glVertex3f( 1.0, 1.0, 1.0 );   glVertex3f( 1.0,  -1.0, 1.0 );
+    glVertex3f( -1.0, 1.0, 1.0 );   glVertex3f( -1.0, -1.0, 1.0 );
+	if(!drawAxis_)
+		glVertex3f( -1.0,  1.0, -1.0 );   glVertex3f( -1.0, -1.0, -1.0 );
+    glEnd();
+
+
+	GLfloat mat_specular[] = { .1, .1, .1, 1.0 };
+	GLfloat mat_shininess[] = { 30.0 };
+	GLfloat light_Front[] = { 10.0, 10.0, 10.0, 1.0 };
+	GLfloat light_Back[] = { -10.0, -10.0, -10.0, 1.0 };
+	GLfloat lightHigh[] = { 1.0, 1.0, 1.0 };
+	GLfloat lightLow[] = { 0.5, 0.5, 0.5 };
+	GLfloat lmodel_ambient[] = { 0.1, 0.1, 0.1, 1.0 };
+
+	glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
+	glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
+	if(frontLighting_)
+	{
+		glLightfv(GL_LIGHT0, GL_POSITION, light_Front);
+		glLightfv(GL_LIGHT0, GL_DIFFUSE, lightHigh );
+		glLightfv(GL_LIGHT0, GL_SPECULAR, lightHigh );
+		glLightfv(GL_LIGHT1, GL_POSITION, light_Back);
+		glLightfv(GL_LIGHT1, GL_DIFFUSE, lightLow );
+		glLightfv(GL_LIGHT1, GL_SPECULAR, lightLow );
+	}
+	else
+	{
+		glLightfv(GL_LIGHT0, GL_POSITION, light_Front);
+		glLightfv(GL_LIGHT0, GL_DIFFUSE, lightLow );
+		glLightfv(GL_LIGHT0, GL_SPECULAR, lightLow );
+		glLightfv(GL_LIGHT1, GL_POSITION, light_Back);
+		glLightfv(GL_LIGHT1, GL_DIFFUSE, lightHigh );
+		glLightfv(GL_LIGHT1, GL_SPECULAR, lightHigh );
+	}
+	glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+	glEnable(GL_LIGHT0);
+	glEnable(GL_LIGHT1);
+	glEnable(GL_LIGHTING);
+	glShadeModel (GL_SMOOTH);
+	glEnable(GL_DEPTH_TEST);
+	glEnable(GL_COLOR_MATERIAL);
+
+	if(drawAxis_)
+	{
+		// draw x axis
+		glLineWidth( 2.0 );
+		glBegin( GL_LINES );
+		qglColor( red );
+		glVertex3f( -1.0, -1.0, -1.0 );    glVertex3f( 1.5, -1.0, -1.0 );
+		glVertex3f( 1.4, -1.1, -1.0 );    glVertex3f( 1.5, -1.2, -1.0 );
+		glVertex3f( 1.5, -1.1, -1.0 );    glVertex3f( 1.4, -1.2, -1.0 );
+		glVertex3f( 1.35, -1.22, -1.0 );    glVertex3f( 1.55, -1.22, -1.0 );
+		glEnd();
+		glPushMatrix();
+		glRotatef(90, 0.0, 1.0, 0.0);
+		glTranslatef(1.0, -1.0, 1.4);
+		glCallList(cone_);
+		glPopMatrix();
+
+		// draw y axis
+		glBegin( GL_LINES );
+		qglColor( green );
+		glVertex3f( -1.0, -1.0, -1.0 );    glVertex3f( -1.0, 1.5, -1.0 );
+		glVertex3f( -1.2, 1.5, -1.0 );    glVertex3f( -1.15, 1.45, -1.0 );
+		glVertex3f( -1.1, 1.5, -1.0 );    glVertex3f( -1.2, 1.4, -1.0 );
+		glVertex3f( -1.05, 1.38, -1.0 );    glVertex3f( -1.25, 1.38, -1.0 );
+		glEnd();
+		glPushMatrix();
+		glRotatef(-90, 1.0, 0.0, 0.0);
+		glTranslatef( -1.0, 1.0, 1.4);
+		glCallList(cone_);
+		glPopMatrix();
+
+		// draw z axis
+		glBegin( GL_LINES );
+		qglColor( blue );
+		glVertex3f( -1.0, -1.0, -1.0 );    glVertex3f( -1.0, -1.0, 1.5 );
+		glVertex3f( -1.0, -1.1, 1.5 );    glVertex3f( -1.0, -1.1, 1.4 );
+		glVertex3f( -1.0, -1.1, 1.4 );    glVertex3f( -1.0, -1.2, 1.5 );
+		glVertex3f( -1.0, -1.2, 1.5 );    glVertex3f( -1.0, -1.2, 1.4 );
+		glVertex3f( -1.0, -1.22, 1.55 );    glVertex3f( -1.0, -1.22, 1.35 );
+		glEnd();
+		glPushMatrix();
+		glTranslatef(-1.0, -1.0, 1.4);
+		glCallList(cone_);
+		glPopMatrix();
+	}
+
+	glLineWidth( 1.0 );
+
+	GLfloat rp = (GLfloat)pointingColor_.red()/255.;
+ 	GLfloat gp = (GLfloat)pointingColor_.green()/255.;
+ 	GLfloat bp = (GLfloat)pointingColor_.blue()/255.;
+
+	GLfloat r = (GLfloat)defaultColor_.red()/255.;
+ 	GLfloat g = (GLfloat)defaultColor_.green()/255.;
+ 	GLfloat b = (GLfloat)defaultColor_.blue()/255.;
+
+	int i, size = (int)ballVec_.size();
+
+	glColor3f(r, g, b);
+	for(i=0; i<selIni_; ++i)
+	{
+		glPushMatrix();
+		if(ballVec_[i])
+			glCallList(ballVec_[i]);
+		glPopMatrix();
+	}
+
+	glColor3f(rp, gp, bp);
+	for(i=selIni_; i<size; ++i)
+	{
+		glPushMatrix();
+		if(ballVec_[i])
+			glCallList(ballVec_[i]);
+		glPopMatrix();
+	}
+
+	glFlush();
+	glDisable(GL_LIGHTING);
+}
+
+void TeQtGLWidget::initializeGL()
+{
+     makeObject();		// Generate an OpenGL display list
+}
+
+void TeQtGLWidget::resizeGL( int w, int h )
+{
+    glViewport( 0, 0, (GLint)w, (GLint)h );
+}
+
+void TeQtGLWidget::makeObject()
+{
+	deleteGLObject();
+
+	ballVec_.clear();
+	ballMap_.clear();
+	getValues();
+	draw2DPixmaps();
+
+    GLUquadricObj* qobj = gluNewQuadric();
+	//gluQuadricDrawStyle(qobj, GLU_FILL);
+
+	double	x, y, z;
+	double w = (max_ - min_) / 2.;
+	double wm = min_ + w;
+	int i, size = (int)xVec_.size();
+
+	for(i=0; i<size; ++i)
+	{
+		string id = idVec_[i];
+		int k = glGenLists( 1 );
+		ballVec_.push_back(k);
+		ballMap_[id] = k;
+
+		glNewList( k, GL_COMPILE );
+
+		x = xVec_[i];
+		y = yVec_[i];
+		z = zVec_[i];
+
+		glBegin( GL_COMPILE);
+		x = (x-wm)/w;
+		y = (y-wm)/w;
+		z = (z-wm)/w;
+		glPushMatrix();
+		glTranslatef (x, y, z);
+		gluSphere(qobj, /* radius */ .02, /* slices */ quality_, /* stacks */ quality_);
+		glPopMatrix();
+		glEnd();
+		glEndList();
+	}
+
+	cone_ = glGenLists( 1 );
+	glNewList( cone_, GL_COMPILE );
+	glBegin( GL_COMPILE);
+	glPushMatrix();
+	gluCylinder(qobj, .035, 0, .15, 12, 12);
+	glPopMatrix();
+	glEnd();
+	glEndList();
+
+	gluDeleteQuadric(qobj);
+
+	paint2D();
+}
+
+void TeQtGLWidget::getValues()
+{
+	idVec_.clear();
+
+	xVec_.clear();
+	yVec_.clear();
+	zVec_.clear();
+
+	TeDatabasePortal *portal = db_->getPortal();
+	double	a, b, c;
+	string CT, CA, from;
+
+	if(theme_->type() == TeTHEME)
+	{
+		CT = theme_->collectionTable();
+		CA = theme_->collectionAuxTable();
+		from = theme_->sqlGridFrom();
+	}
+	else if(theme_->type() == TeEXTERNALTHEME)
+	{
+		CT = ((TeExternalTheme*)theme_)->getRemoteTheme()->collectionTable();
+		CA = ((TeExternalTheme*)theme_)->getRemoteTheme()->collectionAuxTable();
+		from = ((TeExternalTheme*)theme_)->getRemoteTheme()->sqlGridFrom();
+	}
+
+	string id;
+	string atr;
+	if(function_ != "NONE")
+	{
+		id = CT + ".c_object_id";
+		atr = "MIN(" + id + "), " + function_ + "(" + xField_ + "), " + function_ + "(" + yField_ + "), " + function_ + "(" + zField_ + ")";
+	}
+	else
+	{
+		id = CA + ".unique_id";
+		atr = id + ", " + xField_ + ", " + yField_ + ", " + zField_;
+	}
+
+	if(theme_->type() == TeTHEME)
+	{
+		string query = "SELECT " + atr + from;
+
+		if(function_ == "NONE")
+		{
+			if(selectedObjects_ == TeAll)
+			{
+				query += " WHERE (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
+			}
+			else if(selectedObjects_ == TeSelectedByQuery)
+			{
+				query += " WHERE (grid_status = 2  OR (grid_status is null AND c_object_status = 2))";
+			}
+			else if(selectedObjects_ == TeNotSelectedByQuery)
+			{
+				query += " WHERE (grid_status = 0 OR (grid_status is null AND c_object_status = 0))";
+			}
+			else if(selectedObjects_ == TeGrouped)
+				query += " WHERE ((c_legend_id <> 0) AND (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2))))";
+			else if(selectedObjects_ == TeNotGrouped)
+				query += " WHERE ((c_legend_id = 0) AND (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2))))";
+		}
+		else
+		{
+			if(selectedObjects_ == TeAll)
+			{
+				query += " WHERE (c_object_status = 0 OR c_object_status = 2)";
+			}
+			else if(selectedObjects_ == TeSelectedByQuery)
+			{
+				query += " WHERE (c_object_status = 2)";
+			}
+			else if(selectedObjects_ == TeNotSelectedByQuery)
+			{
+				query += " WHERE (c_object_status = 0)";
+			}
+			else if(selectedObjects_ == TeGrouped)
+				query += " WHERE ((c_legend_id <> 0) AND (c_object_status = 0 OR c_object_status = 2))";
+			else if(selectedObjects_ == TeNotGrouped)
+				query += " WHERE ((c_legend_id = 0) AND (c_object_status = 0 OR c_object_status = 2))";
+		}
+
+		if(function_ != "NONE")
+			query += " GROUP BY " + CT + ".c_object_id";
+		if(portal->query(query) == false)
+		{
+			delete portal;
+			return;
+		}
+
+		min_ = TeMAXFLOAT;
+		max_ = -TeMAXFLOAT;
+		string id, sa, sb, sc;
+		while(portal->fetchRow())
+		{
+			id = portal->getData(0);
+			sa = portal->getData(1);
+			sb = portal->getData(2);
+			sc = portal->getData(3);
+			if(sa.empty()==false && sb.empty()==false && sc.empty()==false)
+			{
+				a = atof(sa.c_str());
+				b = atof(sb.c_str());
+				c = atof(sc.c_str());
+				xVec_.push_back(a);
+				yVec_.push_back(b);
+				zVec_.push_back(c);
+				min_ = MIN(min_, a);
+				min_ = MIN(min_, b);
+				min_ = MIN(min_, c);
+				max_ = MAX(max_, a);
+				max_ = MAX(max_, b);
+				max_ = MAX(max_, c);
+				idVec_.push_back(id);
+			}
+		}
+		selIni_ = (int)xVec_.size();
+
+		query = "SELECT " + atr + from;
+		if(function_ == "NONE")
+		{
+			if(selectedObjects_ == TeAll)
+			{
+				query += " WHERE (grid_status = 1 OR grid_status = 3";
+				query += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3)))";
+			}
+			else if(selectedObjects_ == TeSelectedByQuery)
+			{
+				query += " WHERE (grid_status = 3  OR (grid_status is null AND c_object_status = 3))";
+			}
+			else if(selectedObjects_ == TeNotSelectedByQuery)
+			{
+				query += " WHERE ((grid_status = 1  OR (grid_status is null AND c_object_status = 1)))";
+			}
+			else if(selectedObjects_ == TeGrouped)
+			{
+				query += " WHERE ((c_legend_id <> 0) AND (grid_status = 1 OR grid_status = 3";
+				query += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3))))";
+			}
+			else if(selectedObjects_ == TeNotGrouped)
+			{
+				query += " WHERE ((c_legend_id = 0) AND (grid_status = 1 OR grid_status = 3";
+				query += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3))))";
+			}
+		}
+		else
+		{
+			if(selectedObjects_ == TeAll)
+			{
+				query += " WHERE (c_object_status = 1 OR c_object_status = 3)";
+			}
+			else if(selectedObjects_ == TeSelectedByQuery)
+			{
+				query += " WHERE (c_object_status = 3)";
+			}
+			else if(selectedObjects_ == TeNotSelectedByQuery)
+			{
+				query += " WHERE (c_object_status = 1)";
+			}
+			else if(selectedObjects_ == TeGrouped)
+			{
+				query += " WHERE ((c_legend_id <> 0) AND (c_object_status = 1 OR c_object_status = 3))";
+			}
+			else if(selectedObjects_ == TeNotGrouped)
+			{
+				query += " WHERE ((c_legend_id = 0) AND (c_object_status = 1 OR c_object_status = 3))";
+			}
+		}
+
+		if(function_ != "NONE")
+			query += " GROUP BY " + CT + ".c_object_id";
+
+		portal->freeResult();
+		if(portal->query(query) == false)
+		{
+			delete portal;
+			return;
+		}
+
+		while(portal->fetchRow())
+		{
+			id = portal->getData(0);
+			sa = portal->getData(1);
+			sb = portal->getData(2);
+			sc = portal->getData(3);
+			if(sa.empty()==false && sb.empty()==false && sc.empty()==false)
+			{
+				a = atof(sa.c_str());
+				b = atof(sb.c_str());
+				c = atof(sc.c_str());
+				xVec_.push_back(a);
+				yVec_.push_back(b);
+				zVec_.push_back(c);
+				min_ = MIN(min_, a);
+				min_ = MIN(min_, b);
+				min_ = MIN(min_, c);
+				max_ = MAX(max_, a);
+				max_ = MAX(max_, b);
+				max_ = MAX(max_, c);
+				idVec_.push_back(id);
+			}
+		}
+	}
+	else if(theme_->type() == TeEXTERNALTHEME)
+	{
+		string query = "SELECT " + atr + from;
+
+		string where;
+		if(function_ == "NONE")
+		{
+			if(selectedObjects_ == TeAll)
+			{
+				where = " WHERE (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
+			}
+			else if(selectedObjects_ == TeSelectedByQuery)
+			{
+				where = " WHERE (grid_status = 2  OR (grid_status is null AND c_object_status = 2))";
+			}
+			else if(selectedObjects_ == TeNotSelectedByQuery)
+			{
+				where = " WHERE (grid_status = 0 OR (grid_status is null AND c_object_status = 0))";
+			}
+			else if(selectedObjects_ == TeGrouped)
+				where = " WHERE ((c_legend_id <> 0) AND (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2))))";
+			else if(selectedObjects_ == TeNotGrouped)
+				where = " WHERE ((c_legend_id = 0) AND (grid_status = 0 OR grid_status = 2 OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2))))";
+		}
+		else
+		{
+			if(selectedObjects_ == TeAll)
+			{
+				where = " WHERE (c_object_status = 0 OR c_object_status = 2)";
+			}
+			else if(selectedObjects_ == TeSelectedByQuery)
+			{
+				where = " WHERE (c_object_status = 2)";
+			}
+			else if(selectedObjects_ == TeNotSelectedByQuery)
+			{
+				where = " WHERE (c_object_status = 0)";
+			}
+			else if(selectedObjects_ == TeGrouped)
+				where = " WHERE ((c_legend_id <> 0) AND (c_object_status = 0 OR c_object_status = 2))";
+			else if(selectedObjects_ == TeNotGrouped)
+				where = " WHERE ((c_legend_id = 0) AND (c_object_status = 0 OR c_object_status = 2))";
+		}
+
+		vector<string> sv = generateItemsInClauseVec(theme_, where);
+		vector<string>::iterator it;
+
+		min_ = TeMAXFLOAT;
+		max_ = -TeMAXFLOAT;
+		string id, sa, sb, sc;
+		for(it=sv.begin(); it!=sv.end(); ++it)
+		{
+			string sel = query + " WHERE " + CA + ".unique_id IN " + *it;
+
+			if(function_ != "NONE")
+				sel += " GROUP BY " + CT + ".c_object_id";
+
+			if(portal->query(sel) == false)
+			{
+				delete portal;
+				return;
+			}
+
+			while(portal->fetchRow())
+			{
+				id = portal->getData(0);
+				sa = portal->getData(1);
+				sb = portal->getData(2);
+				sc = portal->getData(3);
+				if(sa.empty()==false && sb.empty()==false && sc.empty()==false)
+				{
+					a = atof(sa.c_str());
+					b = atof(sb.c_str());
+					c = atof(sc.c_str());
+					xVec_.push_back(a);
+					yVec_.push_back(b);
+					zVec_.push_back(c);
+					min_ = MIN(min_, a);
+					min_ = MIN(min_, b);
+					min_ = MIN(min_, c);
+					max_ = MAX(max_, a);
+					max_ = MAX(max_, b);
+					max_ = MAX(max_, c);
+					idVec_.push_back(id);
+				}
+			}
+			portal->freeResult();
+		}
+
+		selIni_ = (int)xVec_.size();
+
+		query = "SELECT " + atr + from;
+		if(function_ == "NONE")
+		{
+			if(selectedObjects_ == TeAll)
+			{
+				where = " WHERE (grid_status = 1 OR grid_status = 3";
+				where += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3)))";
+			}
+			else if(selectedObjects_ == TeSelectedByQuery)
+			{
+				where = " WHERE (grid_status = 3  OR (grid_status is null AND c_object_status = 3))";
+			}
+			else if(selectedObjects_ == TeNotSelectedByQuery)
+			{
+				where = " WHERE ((grid_status = 1  OR (grid_status is null AND c_object_status = 1)))";
+			}
+			else if(selectedObjects_ == TeGrouped)
+			{
+				where = " WHERE ((c_legend_id <> 0) AND (grid_status = 1 OR grid_status = 3";
+				where += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3))))";
+			}
+			else if(selectedObjects_ == TeNotGrouped)
+			{
+				where = " WHERE ((c_legend_id = 0) AND (grid_status = 1 OR grid_status = 3";
+				where += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3))))";
+			}
+		}
+		else
+		{
+			if(selectedObjects_ == TeAll)
+			{
+				where = " WHERE (c_object_status = 1 OR c_object_status = 3)";
+			}
+			else if(selectedObjects_ == TeSelectedByQuery)
+			{
+				where = " WHERE (c_object_status = 3)";
+			}
+			else if(selectedObjects_ == TeNotSelectedByQuery)
+			{
+				where = " WHERE (c_object_status = 1)";
+			}
+			else if(selectedObjects_ == TeGrouped)
+			{
+				where = " WHERE ((c_legend_id <> 0) AND (c_object_status = 1 OR c_object_status = 3))";
+			}
+			else if(selectedObjects_ == TeNotGrouped)
+			{
+				where = " WHERE ((c_legend_id = 0) AND (c_object_status = 1 OR c_object_status = 3))";
+			}
+		}
+		
+		sv = generateItemsInClauseVec(theme_, where);
+
+		for(it=sv.begin(); it!=sv.end(); ++it)
+		{
+			string sel = query + " WHERE " + CA + ".unique_id IN " + *it;
+
+			if(function_ != "NONE")
+				sel += " GROUP BY " + CT + ".c_object_id";
+
+			if(portal->query(sel) == false)
+			{
+				delete portal;
+				return;
+			}
+
+			while(portal->fetchRow())
+			{
+				id = portal->getData(0);
+				sa = portal->getData(1);
+				sb = portal->getData(2);
+				sc = portal->getData(3);
+				if(sa.empty()==false && sb.empty()==false && sc.empty()==false)
+				{
+					a = atof(sa.c_str());
+					b = atof(sb.c_str());
+					c = atof(sc.c_str());
+					xVec_.push_back(a);
+					yVec_.push_back(b);
+					zVec_.push_back(c);
+					min_ = MIN(min_, a);
+					min_ = MIN(min_, b);
+					min_ = MIN(min_, c);
+					max_ = MAX(max_, a);
+					max_ = MAX(max_, b);
+					max_ = MAX(max_, c);
+					idVec_.push_back(id);
+				}
+			}
+			portal->freeResult();
+		}
+	}
+	delete portal;
+
+	min_ = min_ - (max_ - min_) * 0.0001;
+	max_ = max_ + (max_ - min_) * 0.0001;
+
+	if(ballVec_.empty() == false)
+	{
+		ballVec_.clear();
+		int i, size = (int)idVec_.size();
+		map<string, GLuint>::iterator it;
+
+		for(i=0; i<size; ++i)
+		{
+			string id = idVec_[i];
+			it = ballMap_.find(id);
+			if(it != ballMap_.end())
+				ballVec_.push_back(it->second);
+		}
+	}
+}
+
+void TeQtGLWidget::selectFromHexaedro()
+{
+	double x1, y1, z1, x2, y2, z2;
+	getCubeCoordinate(x1, y1, z1, x2, y2, z2);
+	string xmin = Te2String(x1, 6);
+	string ymin = Te2String(y1, 6);
+	string zmin = Te2String(z1, 6);
+	string xmax = Te2String(x2, 6);
+	string ymax = Te2String(y2, 6);
+	string zmax = Te2String(z2, 6);
+
+	string CT, CA, from;
+
+	if(theme_->type() == TeTHEME)
+	{
+		CT = theme_->collectionTable();
+		CA = theme_->collectionAuxTable();
+		from = theme_->sqlGridFrom();
+	}
+	else if(theme_->type() == TeEXTERNALTHEME)
+	{
+		CT = ((TeExternalTheme*)theme_)->getRemoteTheme()->collectionTable();
+		CA = ((TeExternalTheme*)theme_)->getRemoteTheme()->collectionAuxTable();
+		from = ((TeExternalTheme*)theme_)->getRemoteTheme()->sqlGridFrom();
+	}
+
+	string obj = CT + ".c_object_id";
+	string sel, atr, where;
+	bool func = false;
+
+	if(function_ != "NONE")
+	{
+		func = true;
+		atr = "MIN(" + obj + ") as objas, " + function_ + "(" + xField_ + ") as xas, ";
+		atr += function_ + "(" + yField_ + ") as yas, " + function_ + "(" + zField_ + ") as zas ";
+	}
+	else
+		atr = xField_ + ", " + yField_ + ", " + zField_;
+
+
+	if(func == false)
+	{
+		if(selectedObjects_ == TeAll)
+			where = " WHERE (grid_status >= 0 OR (grid_status is null AND c_object_status >= 0))";
+		else if(selectedObjects_ == TeSelectedByQuery)
+			where = " WHERE (grid_status >= 2  OR (grid_status is null AND c_object_status >= 2))";
+		else if(selectedObjects_ == TeNotSelectedByQuery)
+			where = " WHERE (grid_status <> 2 OR (grid_status is null AND c_object_status <> 2))";
+		else if(selectedObjects_ == TeGrouped)
+			where = " WHERE ((c_legend_id <> 0) AND (grid_status >= 0 OR (grid_status is null AND c_object_status >= 0)))";
+		else if(selectedObjects_ == TeNotGrouped)
+			where = " WHERE ((c_legend_id = 0) AND (grid_status >= 0 OR (grid_status is null AND c_object_status >= 0)))";
+	}
+	else
+	{
+		if(selectedObjects_ == TeAll)
+			where = " WHERE (c_object_status >= 0)";
+		else if(selectedObjects_ == TeSelectedByQuery)
+			where = " WHERE (c_object_status >= 2)";
+		else if(selectedObjects_ == TeNotSelectedByQuery)
+			where = " WHERE (c_object_status <> 2)";
+		else if(selectedObjects_ == TeGrouped)
+			where = " WHERE (c_legend_id <> 0 AND c_object_status >= 0)";
+		else if(selectedObjects_ == TeNotGrouped)
+			where = " WHERE (c_legend_id = 0 AND c_object_status >= 0)";
+	}
+
+	set<string> uniqueIdSet, objectIdSet;
+	TeDatabasePortal *portal = db_->getPortal();
+	if(theme_->type() == TeTHEME)
+	{
+		if(func)
+		{
+			sel = "SELECT objas, xas, yas, zas FROM (SELECT " + atr + from;
+			sel += where + " GROUP BY " + CT + ".c_object_id)";
+			sel += " WHERE ";
+			sel += "xas > " + xmin + " AND ";
+			sel += "xas < " + xmax + " AND ";
+			sel += "yas > " + ymin + " AND ";
+			sel += "yas < " + ymax + " AND ";
+			sel += "zas > " + zmin + " AND ";
+			sel += "zas < " + zmax;
+		}
+		else
+		{
+			sel = "SELECT " + CA + ".unique_id, " + CT + ".c_object_id, " + atr + from;
+			sel += where + " AND ";
+
+			sel += xField_ + " > " + xmin + " AND ";
+			sel += xField_ + " < " + xmax + " AND ";
+			sel += yField_ + " > " + ymin + " AND ";
+			sel += yField_ + " < " + ymax + " AND ";
+			sel += zField_ + " > " + zmin + " AND ";
+			sel += zField_ + " < " + zmax;
+		}
+
+		string val;
+		if(portal->query(sel))
+		{
+			while(portal->fetchRow())
+			{
+				if(func)
+						objectIdSet.insert(portal->getData(0));
+				else
+				{
+					val = portal->getData(0);
+					if(val.empty())
+						objectIdSet.insert(portal->getData(1));
+					else
+						uniqueIdSet.insert(val);
+				}
+			}
+		}
+	}
+	else if(theme_->type() == TeEXTERNALTHEME)
+	{
+		vector<string> sv = generateItemsInClauseVec(theme_, where);
+		vector<string>::iterator it;
+		string val;
+
+		for(it=sv.begin(); it!=sv.end(); ++it)
+		{
+			if(func)
+			{
+				sel = "SELECT objas, xas, yas, zas FROM (SELECT " + atr + from;
+				sel += " WHERE " + CA + ".unique_id IN " + *it;
+				sel += " GROUP BY " + CT + ".c_object_id)";
+				sel += " WHERE ";
+				sel += "xas > " + xmin + " AND ";
+				sel += "xas < " + xmax + " AND ";
+				sel += "yas > " + ymin + " AND ";
+				sel += "yas < " + ymax + " AND ";
+				sel += "zas > " + zmin + " AND ";
+				sel += "zas < " + zmax;
+			}
+			else
+			{
+				sel = "SELECT " + CA + ".unique_id, " + CT + ".c_object_id, " + atr + from;
+				sel += " WHERE " + CA + ".unique_id IN " + *it;
+				sel += " AND ";
+				sel += xField_ + " > " + xmin + " AND ";
+				sel += xField_ + " < " + xmax + " AND ";
+				sel += yField_ + " > " + ymin + " AND ";
+				sel += yField_ + " < " + ymax + " AND ";
+				sel += zField_ + " > " + zmin + " AND ";
+				sel += zField_ + " < " + zmax;
+			}
+
+			if(portal->query(sel))
+			{
+				while(portal->fetchRow())
+				{
+					if(func)
+							objectIdSet.insert(portal->getData(0));
+					else
+					{
+						val = portal->getData(0);
+						if(val.empty())
+							objectIdSet.insert(portal->getData(1));
+						else
+							uniqueIdSet.insert(val);
+					}
+				}
+			}
+			portal->freeResult();
+		}
+	}
+	delete portal;
+
+	if(addSelection_)
+		grid_->putColorOnGrid(uniqueIdSet, objectIdSet, "addPointing");
+	else
+		grid_->putColorOnGrid(uniqueIdSet, objectIdSet, "newPointing");
+}
+
+void TeQtGLWidget::setXRotation( int degrees )
+{
+	int graus = 360 * degrees / 99;
+    xRot_ = (GLfloat)(graus % 360);
+    updateGL();
+}
+
+void TeQtGLWidget::setYRotation( int degrees )
+{
+	int graus = 360 * degrees / 99;
+    yRot_ = (GLfloat)(graus % 360);
+    updateGL();
+}
+
+void TeQtGLWidget::setZRotation( int degrees )
+{
+	int graus = 360 * degrees / 99;
+    zRot_ = (GLfloat)(graus % 360);
+    updateGL();
+}
+
+void TeQtGLWidget::setXOffset( int offset )
+{
+	xOff_ = 2. * (double)offset / 99. - 1.;
+	if((xSize_ + xOff_) > 1.)
+	{
+		xOff_ = 1. - xSize_;
+		int newOffset = TeRound((xOff_ + 1.) * 99. / 2.);
+		emit setXOffsetSignal(newOffset);
+	}
+    updateGL();
+	paint2D();
+}
+
+void TeQtGLWidget::setYOffset( int offset )
+{
+	yOff_ = 2. * (double)offset / 99. - 1.;
+	if((ySize_ + yOff_) > 1.)
+	{
+		yOff_ = 1. - ySize_;
+		int newOffset = TeRound((yOff_ + 1.) * 99. / 2.);
+		emit setYOffsetSignal(newOffset);
+	}
+    updateGL();
+	paint2D();
+}
+
+void TeQtGLWidget::setZOffset( int offset )
+{
+	zOff_ = 2. * (double)offset / 99. - 1.;
+	if((zSize_ + zOff_) > 1.)
+	{
+		zOff_ = 1. - zSize_;
+		int newOffset = TeRound((zOff_ + 1.) * 99. / 2.);
+		emit setZOffsetSignal(newOffset);
+	}
+    updateGL();
+	paint2D();
+}
+
+
+void TeQtGLWidget::setXSize( int size )
+{
+	xSize_ = 2. * (double)size / 99.;
+	if((xSize_ + xOff_) > 1.)
+	{
+		xSize_ = 1. - xOff_;
+		int newSize = TeRound(xSize_ * 99. / 2.);
+		emit setXSizeSignal(newSize);
+	}
+    updateGL();
+	paint2D();
+}
+
+void TeQtGLWidget::setYSize( int size )
+{
+	ySize_ = 2. * (double)size / 99.;
+	if((ySize_ + yOff_) > 1.)
+	{
+		ySize_ = 1. - yOff_;
+		int newSize = TeRound(ySize_ * 99. / 2.);
+		emit setYSizeSignal(newSize);
+	}
+    updateGL();
+	paint2D();
+}
+
+void TeQtGLWidget::setZSize( int size )
+{
+	zSize_ = 2. * (double)size / 99.;
+	if((zSize_ + zOff_) > 1.)
+	{
+		zSize_ = 1. - zOff_;
+		int newSize = TeRound(zSize_ * 99. / 2.);
+		emit setZSizeSignal(newSize);
+	}
+    updateGL();
+	paint2D();
+}
+
+void TeQtGLWidget::setViewAngle( int a )
+{
+	viewAngle_ = 120. - (double)a;
+    updateGL();
+}
+
+void TeQtGLWidget::setLightingMode( int )
+{
+	frontLighting_ = !frontLighting_;
+    updateGL();
+}
+
+void TeQtGLWidget::mousePressEvent(QMouseEvent* e)
+{
+	mousePosition_ = e->pos();
+}
+
+void TeQtGLWidget::mouseMoveEvent(QMouseEvent* e)
+{
+	if(e->state() == Qt::NoButton)
+		return;
+
+	QPoint p = e->pos();
+	double w = (double)width();
+	double h = (double)height();
+	double dx = (double)(p.x() - mousePosition_.x());
+	double dy = (double)(mousePosition_.y() - p.y());
+
+	if(fabs(dx) <= 3.)
+		dx = 0.;
+	if(fabs(dy) <= 3.)
+		dy = 0.;
+	if(dx == 0. && dy == 0.)
+		return;
+
+	dx = dx * viewAngle_ / 40.;
+	dy = dy * viewAngle_ / 40.;
+
+	if(keyPress_ == 0)
+	{
+		if(e->state() == Qt::LeftButton)  // translation
+		{
+			xTranslation_ += 2. * (dx / w);
+			yTranslation_ += 2. * (dy / h);
+		}
+		else if(e->state() == (Qt::LeftButton | Qt::AltButton))// x and y and z rotation
+		{
+			xRot_ += dx;
+			if(xRot_ > 360.)
+				xRot_ = xRot_ - 360.;
+			else if(xRot_ < 0.)
+				xRot_ = 360. + xRot_;
+			emit setXRotationSignal(int(xRot_));
+	
+			yRot_ += dy;
+			if(yRot_ > 360.)
+				yRot_ = yRot_ - 360.;
+			else if(yRot_ < 0.)
+				yRot_ = 360. + yRot_;
+			emit setYRotationSignal(int(yRot_));
+
+			zRot_ += (dx+dy);
+			if(zRot_ > 360.)
+				zRot_ = zRot_ - 360.;
+			else if(zRot_ < 0.)
+				zRot_ = 360. + zRot_;
+			emit setZRotationSignal(int(zRot_));
+		}
+		else if(e->state() == Qt::MidButton) // zoom
+		{
+			viewAngle_ += dy;
+			if(viewAngle_ < 1.)
+				viewAngle_ = 1;
+			else if(viewAngle_ > 120.)
+				viewAngle_ = 120.;
+
+			int a = (int)(120. - viewAngle_);
+			emit setZoomSignal(a);
+		}
+	}
+	else if(keyPress_ == Qt::Key_X)
+	{
+		xRot_ += dy;
+		if(xRot_ > 360.)
+			xRot_ = xRot_ - 360.;
+		else if(xRot_ < 0.)
+			xRot_ = 360. + xRot_;
+		emit setXRotationSignal(int(xRot_));
+	}
+	else if(keyPress_ == Qt::Key_Y)
+	{
+		yRot_ += dy;
+		if(yRot_ > 360.)
+			yRot_ = yRot_ - 360.;
+		else if(yRot_ < 0.)
+			yRot_ = 360. + yRot_;
+		emit setYRotationSignal(int(yRot_));
+	}
+	else if(keyPress_ == Qt::Key_Z)
+	{
+		zRot_ += dy;
+		if(zRot_ > 360.)
+			zRot_ = zRot_ - 360.;
+		else if(zRot_ < 0.)
+			zRot_ = 360. + zRot_;
+		emit setZRotationSignal(int(zRot_));
+	}
+
+	mousePosition_ = p;
+    updateGL();
+}
+
+void TeQtGLWidget::mouseReleaseEvent(QMouseEvent*)
+{
+}
+
+void TeQtGLWidget::keyPressEvent(QKeyEvent* e)
+{
+	keyPress_ = e->key();
+	if(keyPress_ == Qt::Key_Shift || keyPress_ == Qt::Key_Control || keyPress_ == Qt::Key_Alt)
+		keyPress_ = 0;
+
+	if(keyPress_ == Qt::Key_R)
+	{
+		viewAngle_ = 60.;
+		xTranslation_ = 0.;
+		yTranslation_ = 0.;
+		zTranslation_ = -3.5;
+		xRot_ = yRot_ = zRot_ = 0;
+		emit setXRotationSignal(int(xRot_));
+		emit setYRotationSignal(int(yRot_));
+		emit setZRotationSignal(int(zRot_));
+	}
+}
+
+void TeQtGLWidget::keyReleaseEvent(QKeyEvent*)
+{
+	keyPress_ = 0;
+}
+
+void TeQtGLWidget::draw2DPixmaps()
+{
+	QRect r = ((QFrame*)(xyDevice_))->rect();
+	xyPixmap_.resize(r.width(), r.height());
+	zxPixmap_.resize(r.width(), r.height());
+	yzPixmap_.resize(r.width(), r.height());
+	xyPixmap_.fill(QColor(Qt::black));
+	zxPixmap_.fill(QColor(Qt::black));
+	yzPixmap_.fill(QColor(Qt::black));
+
+	QPainter xyPainter(&xyPixmap_);
+	QPainter zxPainter(&zxPixmap_);
+	QPainter yzPainter(&yzPixmap_);
+	QFont font;
+	int fsize = 10;
+	font.setPointSize(10);
+	font.setBold(true);
+	xyPainter.setFont(font);
+	zxPainter.setFont(font);
+	yzPainter.setFont(font);
+	QPen pen(QColor(red), 2);
+
+	double width = (double)r.width();
+	double w = max_ - min_;
+
+	xyPainter.setPen(pen);
+	xyPainter.drawLine(0, (int)(width - 1), (int)(width - 1), (int)(width - 1));
+	xyPainter.drawText((int)(width - fsize - 2), (int)(width - 5), "X");
+	pen.setColor(QColor(green));
+	xyPainter.setPen(pen);
+	xyPainter.drawLine(0, 0, 0, (int)(width - 1));
+	xyPainter.drawText(4, fsize + 3, "Y");
+
+	pen.setColor(QColor(blue));
+	zxPainter.setPen(pen);
+	zxPainter.drawLine(0, (int)(width - 1), (int)(width - 1), (int)(width - 1));
+	zxPainter.drawText((int)(width - fsize - 2), (int)(width - 5), "Z");
+	pen.setColor(QColor(red));
+	zxPainter.setPen(pen);
+	zxPainter.drawLine(0, 0, 0, (int)(width - 1));
+	zxPainter.drawText(4, fsize + 3, "X");
+
+	pen.setColor(QColor(green));
+	yzPainter.setPen(pen);
+	yzPainter.drawLine(0, (int)(width - 1), (int)(width - 1), (int)(width - 1));
+	yzPainter.drawText((int)(width - fsize - 2), (int)(width - 5), "Y");
+	pen.setColor(QColor(blue));
+	yzPainter.setPen(pen);
+	yzPainter.drawLine(0, 0, 0, (int)(width - 1));
+	yzPainter.drawText(4, fsize + 3, "Z");
+
+	int i, size = (int)xVec_.size();
+	double	v;
+	int	x, y, z;
+	QPointArray xypa(size);
+	QPointArray zxpa(size);
+	QPointArray yzpa(size);
+
+	pen.setColor(defaultColor_);
+	pen.setWidth(5);
+	xyPainter.setPen(pen);
+	zxPainter.setPen(pen);
+	yzPainter.setPen(pen);
+	for(i=0; i<size; ++i)
+	{
+		v = xVec_[i];
+		x = TeRound(width * (v - min_) / w);
+		v = yVec_[i];
+		y = TeRound(width * (v - min_) / w);
+		v = zVec_[i];
+		z = TeRound(width * (v - min_) / w);
+
+		// the vertical axis must be inverted
+		xypa.setPoint(i, x, (int)(width - y));
+		zxpa.setPoint(i, z, (int)(width - x));
+		yzpa.setPoint(i, y, (int)(width - z));
+	}
+	xyPainter.drawPoints(xypa, 0, selIni_);
+	zxPainter.drawPoints(zxpa, 0, selIni_);
+	yzPainter.drawPoints(yzpa, 0, selIni_);
+
+	pen.setColor(pointingColor_);
+	xyPainter.setPen(pen);
+	zxPainter.setPen(pen);
+	yzPainter.setPen(pen);
+
+	xyPainter.drawPoints(xypa, selIni_);
+	zxPainter.drawPoints(zxpa, selIni_);
+	yzPainter.drawPoints(yzpa, selIni_);
+}
+
+void TeQtGLWidget::paint2D()
+{
+	QPainter xyPainter(xyDevice_);
+	QPainter zxPainter(zxDevice_);
+	QPainter yzPainter(yzDevice_);
+	QPen pen(QColor(magenta), 1);
+	xyPainter.setPen(pen);
+	zxPainter.setPen(pen);
+	yzPainter.setPen(pen);
+	QRect r = xyPainter.viewport();
+
+	double width = (double)r.width();
+	double w = max_ - min_;
+	double ww = w / 2.;
+	double	v;
+	int	x1, x2, y1, y2, z1, z2;
+
+	bitBlt(xyDevice_, 0, 0, &xyPixmap_, 0, 0, (int)width, (int)width, Qt::CopyROP);
+	bitBlt(zxDevice_, 0, 0, &zxPixmap_, 0, 0, (int)width, (int)width, Qt::CopyROP);
+	bitBlt(yzDevice_, 0, 0, &yzPixmap_, 0, 0, (int)width, (int)width, Qt::CopyROP);
+
+	v = (xOff_ + 1.) * ww + min_;
+	x1 = TeRound(width * (v - min_) / w);
+	v = (yOff_ + 1.) * ww + min_;
+	y1 = TeRound(width * (v - min_) / w);
+	v = (xOff_ + xSize_ + 1.) * ww + min_;
+	x2 = TeRound(width * (v - min_) / w);
+	v = (yOff_ + ySize_ + 1.) * ww + min_;
+	y2 = TeRound(width * (v - min_) / w);
+	v = (zOff_ + 1.) * ww + min_;
+	z1 = TeRound(width * (v - min_) / w);
+	v = (zOff_ + zSize_ + 1.) * ww + min_;
+	z2 = TeRound(width * (v - min_) / w);
+
+	// the vertical axis must be inverted
+	xyPainter.drawRect(x1, (int)(width - y1 - (y2 - y1)), x2 - x1, y2 - y1);
+	zxPainter.drawRect(z1, (int)(width - x1 - (x2 - x1)), z2 - z1, x2 - x1);
+	yzPainter.drawRect(y1, (int)(width - z1 - (z2 - z1)), y2 - y1, z2 - z1);
+
+	xyPainter.flush();
+	zxPainter.flush();
+	yzPainter.flush();
+}
+
+void TeQtGLWidget::xOffsetReleased()
+{
+	drawSelecteds();
+}
+
+void TeQtGLWidget::yOffsetReleased()
+{
+	drawSelecteds();
+}
+
+void TeQtGLWidget::zOffsetReleased()
+{
+	drawSelecteds();
+}
+
+void TeQtGLWidget::xSizeReleased()
+{
+	drawSelecteds();
+}
+
+void TeQtGLWidget::ySizeReleased()
+{
+	drawSelecteds();
+}
+
+void TeQtGLWidget::zSizeReleased()
+{
+	drawSelecteds();
+}
+
+void TeQtGLWidget::drawSelecteds()
+{
+	selectFromHexaedro();
+	getValues();
+	draw2DPixmaps();
+	paint2D();
+	updateGL();
+}
+
+void TeQtGLWidget::getCubeCoordinate(double& x1, double& y1, double& z1, double& x2, double& y2, double& z2)
+{
+	double w = max_ - min_;
+	double ww = w / 2.;
+
+	x1 = (xOff_ + 1.) * ww + min_;
+	y1 = (yOff_ + 1.) * ww + min_;
+	z1 = (zOff_ + 1.) * ww + min_;
+	x2 = (xOff_ + xSize_ + 1.) * ww + min_;
+	y2 = (yOff_ + ySize_ + 1.) * ww + min_;
+	z2 = (zOff_ + zSize_ + 1.) * ww + min_;
+}
+
+void TeQtGLWidget::paint3D()
+{
+	updateGL();
+}
+
+void TeQtGLWidget::changeFunction(string function)
+{
+	function_ = function;
+	initGLObject();
+}
+
+void TeQtGLWidget::changeInputObjects(int v)
+{
+	selectedObjects_ = v;
+	initGLObject();
+}
+
+void TeQtGLWidget::changeQuality(int v)
+{
+	quality_ = TeRound(30. * (double)v / 99.) + 6;
+	initGLObject();
+}
+
+void TeQtGLWidget::updateSelection()
+{
+	getValues();
+	draw2DPixmaps();
+	paint2D();
+	updateGL();
+	addSelection_ = false;
+}
+
+void TeQtGLWidget::initGLObject()
+{
+	makeObject();
+	updateGL();
+}
+
+void TeQtGLWidget::deleteGLObject()
+{
+	int i, size = (int)ballVec_.size();
+
+	makeCurrent();
+	for(i=0; i<size; ++i)
+		glDeleteLists( ballVec_[i], 1 );
+	ballVec_.clear();
+	glDeleteLists (cone_, 1);
+}
diff --git a/src/terralib/drivers/qt/TeQtGLWidget.h b/src/terralib/drivers/qt/TeQtGLWidget.h
old mode 100755
new mode 100644
index 404a358..ef950e6
--- a/src/terralib/drivers/qt/TeQtGLWidget.h
+++ b/src/terralib/drivers/qt/TeQtGLWidget.h
@@ -1,151 +1,154 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTGLBOX_H
-#define  __TERRALIB_INTERNAL_QTGLBOX_H
-
-#include <qgl.h>
-#include <qpixmap.h>
-#include <TeDataTypes.h>
-#include <vector>
-using namespace std;
-
-class TeTheme;
-class TeDatabase;
-class TeQtGrid;
-
-class TeQtGLWidget : public QGLWidget
-{
-    Q_OBJECT
-
-public:
-
-    TeQtGLWidget( QWidget* parent, const char* name, TeQtGrid* grid, string xField, string yField, string zField, QPaintDevice* xy, QPaintDevice* xz, QPaintDevice* yz, int selectedObjects = TeAll, string func = "NONE");
-    ~TeQtGLWidget();
-	void drawAxis(bool b) {drawAxis_ = b; updateGL();}
-
-    GLfloat xRot_, yRot_, zRot_;
-	GLfloat xTranslation_, yTranslation_, zTranslation_;
-	GLfloat viewAngle_;
-	GLfloat xOff_, yOff_, zOff_;
-	GLfloat xSize_, ySize_, zSize_;
-	string xField_, yField_, zField_;
-	bool frontLighting_;
-	bool addSelection_;
-	TeTheme* theme_;
-	TeDatabase* db_;
-
-public slots:
-
-	// the values of degrees, offset, size, translation and angle are between 0 - 99.
-	// therefore it shoud be conveted to adequate value
-	
-    void	setXRotation( int degrees );
-    void	setYRotation( int degrees );
-    void	setZRotation( int degrees );
-
-    void	setXOffset( int offset );
-    void	setYOffset( int offset );
-    void	setZOffset( int offset );
-
-    void	setXSize( int size );
-    void	setYSize( int size );
-    void	setZSize( int size );
-
-    void	xOffsetReleased();
-    void	yOffsetReleased();
-    void	zOffsetReleased();
-
-    void	xSizeReleased();
-    void	ySizeReleased();
-    void	zSizeReleased();
-
-    void	setViewAngle( int angle );
-
-    void	setLightingMode( int m );
-
-	void	paint2D();
-	void	paint3D();
-	void	getCubeCoordinate(double& x1, double& y1, double& z1, double& x2, double& y2, double& z2);
-	void	drawSelecteds();
-	void	changeFunction(string function);
-	void	changeInputObjects(int v);
-	void	changeQuality(int v);
-	void	updateSelection();
-	void	deleteGLObject();
-	void	initGLObject();
-
-protected:
-
-    void	initializeGL();
-    void	paintGL();
-    void	resizeGL( int w, int h );
-	void	mousePressEvent(QMouseEvent*);
-	void	mouseMoveEvent(QMouseEvent*);
-	void	mouseReleaseEvent(QMouseEvent*);
-	void	keyPressEvent(QKeyEvent*);
-	void	keyReleaseEvent(QKeyEvent*);
-	void	draw2DPixmaps();
-    void	makeObject();
-	void	getValues();
-	void	selectFromHexaedro();
-
-signals:
-	void setXOffsetSignal(int);
-	void setYOffsetSignal(int);
-	void setZOffsetSignal(int);
-	void setXSizeSignal(int);
-	void setYSizeSignal(int);
-	void setZSizeSignal(int);
-	void setXRotationSignal(int);
-	void setYRotationSignal(int);
-	void setZRotationSignal(int);
-	void setZoomSignal(int);
-
-
-private:
-
-	int selIni_;
-	int quality_;
-	GLuint cone_;
-	vector<GLuint> ballVec_;
-	vector<string> idVec_;
-	map<string, GLuint> ballMap_;
-	GLfloat scale_;
-	GLfloat min_, max_;
-	QPoint mousePosition_;
-	vector<double> xVec_, yVec_, zVec_;
-	bool drawAxis_;
-	bool drawSelecteds_;
-	QPaintDevice *xyDevice_, *zxDevice_, *yzDevice_;
-	QPixmap xyPixmap_, zxPixmap_, yzPixmap_;
-	QColor defaultColor_;
-	QColor pointingColor_;
-	string function_;
-	int selectedObjects_;
-	TeQtGrid* grid_;
-	int	keyPress_;
-};
-
-
-#endif // __TERRALIB_INTERNAL_QTGLBOX_H
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTGLBOX_H
+#define  __TERRALIB_INTERNAL_QTGLBOX_H
+
+#include <qgl.h>
+#include <qpixmap.h>
+#include <TeDataTypes.h>
+#include <vector>
+
+#include <TeAppUtilsDefines.h>
+
+using namespace std;
+
+class TeTheme;
+class TeDatabase;
+class TeQtGrid;
+
+class TLAPPUTILS_DLL TeQtGLWidget : public QGLWidget
+{
+    Q_OBJECT
+
+public:
+
+    TeQtGLWidget( QWidget* parent, const char* name, TeQtGrid* grid, string xField, string yField, string zField, QPaintDevice* xy, QPaintDevice* xz, QPaintDevice* yz, int selectedObjects = TeAll, string func = "NONE");
+    ~TeQtGLWidget();
+	void drawAxis(bool b) {drawAxis_ = b; updateGL();}
+
+    GLfloat xRot_, yRot_, zRot_;
+	GLfloat xTranslation_, yTranslation_, zTranslation_;
+	GLfloat viewAngle_;
+	GLfloat xOff_, yOff_, zOff_;
+	GLfloat xSize_, ySize_, zSize_;
+	string xField_, yField_, zField_;
+	bool frontLighting_;
+	bool addSelection_;
+	TeTheme* theme_;
+	TeDatabase* db_;
+
+public slots:
+
+	// the values of degrees, offset, size, translation and angle are between 0 - 99.
+	// therefore it shoud be conveted to adequate value
+	
+    void	setXRotation( int degrees );
+    void	setYRotation( int degrees );
+    void	setZRotation( int degrees );
+
+    void	setXOffset( int offset );
+    void	setYOffset( int offset );
+    void	setZOffset( int offset );
+
+    void	setXSize( int size );
+    void	setYSize( int size );
+    void	setZSize( int size );
+
+    void	xOffsetReleased();
+    void	yOffsetReleased();
+    void	zOffsetReleased();
+
+    void	xSizeReleased();
+    void	ySizeReleased();
+    void	zSizeReleased();
+
+    void	setViewAngle( int angle );
+
+    void	setLightingMode( int m );
+
+	void	paint2D();
+	void	paint3D();
+	void	getCubeCoordinate(double& x1, double& y1, double& z1, double& x2, double& y2, double& z2);
+	void	drawSelecteds();
+	void	changeFunction(string function);
+	void	changeInputObjects(int v);
+	void	changeQuality(int v);
+	void	updateSelection();
+	void	deleteGLObject();
+	void	initGLObject();
+
+protected:
+
+    void	initializeGL();
+    void	paintGL();
+    void	resizeGL( int w, int h );
+	void	mousePressEvent(QMouseEvent*);
+	void	mouseMoveEvent(QMouseEvent*);
+	void	mouseReleaseEvent(QMouseEvent*);
+	void	keyPressEvent(QKeyEvent*);
+	void	keyReleaseEvent(QKeyEvent*);
+	void	draw2DPixmaps();
+    void	makeObject();
+	void	getValues();
+	void	selectFromHexaedro();
+
+signals:
+	void setXOffsetSignal(int);
+	void setYOffsetSignal(int);
+	void setZOffsetSignal(int);
+	void setXSizeSignal(int);
+	void setYSizeSignal(int);
+	void setZSizeSignal(int);
+	void setXRotationSignal(int);
+	void setYRotationSignal(int);
+	void setZRotationSignal(int);
+	void setZoomSignal(int);
+
+
+private:
+
+	int selIni_;
+	int quality_;
+	GLuint cone_;
+	vector<GLuint> ballVec_;
+	vector<string> idVec_;
+	map<string, GLuint> ballMap_;
+	GLfloat scale_;
+	GLfloat min_, max_;
+	QPoint mousePosition_;
+	vector<double> xVec_, yVec_, zVec_;
+	bool drawAxis_;
+	bool drawSelecteds_;
+	QPaintDevice *xyDevice_, *zxDevice_, *yzDevice_;
+	QPixmap xyPixmap_, zxPixmap_, yzPixmap_;
+	QColor defaultColor_;
+	QColor pointingColor_;
+	string function_;
+	int selectedObjects_;
+	TeQtGrid* grid_;
+	int	keyPress_;
+};
+
+
+#endif // __TERRALIB_INTERNAL_QTGLBOX_H
diff --git a/src/terralib/drivers/qt/TeQtGraph.cpp b/src/terralib/drivers/qt/TeQtGraph.cpp
old mode 100755
new mode 100644
index 836266b..95eafb6
--- a/src/terralib/drivers/qt/TeQtGraph.cpp
+++ b/src/terralib/drivers/qt/TeQtGraph.cpp
@@ -1,284 +1,284 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtGraph.h>
-#include <TeCoord2D.h>
-#include <qpaintdevicemetrics.h> 
-#include <qprinter.h>
-
-TeQtGraphPlot::TeQtGraphPlot (QWidget *parent, const char * /* name */)
-{
-	QPaintDevice* dev = painter_.device();
-	if(dev)
-		painter_.end();
-
-// Build a new pixmap
-	widget_ = parent;
-    QPaintDeviceMetrics pdm( widget_ );
-	pixmap_ = new QPixmap (pdm.width(), pdm.height());
-	pixmap_->fill(widget_->paletteBackgroundColor());
-
-	if(dev)
-		painter_.end();
-	painter_.begin(pixmap_);
-
-	pwidth_ = pdm.width();
-	pheight_ = pdm.height();
-
-	//Mounting the brushStyleMap
-	brushStyleMap_[TePolyTypeTransparent] = Qt::NoBrush;
-	brushStyleMap_[TePolyTypeFill] = Qt::SolidPattern;
-	brushStyleMap_[TePolyTypeHorizontal] = Qt::HorPattern;
-	brushStyleMap_[TePolyTypeVertical] = Qt::VerPattern;
-	brushStyleMap_[TePolyTypeFDiagonal] = Qt::FDiagPattern;
-	brushStyleMap_[TePolyTypeBDiagonal] = Qt::BDiagPattern;
-	brushStyleMap_[TePolyTypeCross] = Qt::CrossPattern;
-	brushStyleMap_[TePolyTypeDiagonalCross] = Qt::DiagCrossPattern;
-
-	//Mounting the penStyleMap
-	penStyleMap_[TeLnTypeContinuous] = Qt::SolidLine;
-	penStyleMap_[TeLnTypeDashed] = Qt::DashLine;
-	penStyleMap_[TeLnTypeDotted] = Qt::DotLine;
-	penStyleMap_[TeLnTypeDashDot] = Qt::DashDotLine;
-	penStyleMap_[TeLnTypeDashDotDot] = Qt::DashDotDotLine;
-	penStyleMap_[TeLnTypeNone] = Qt::NoPen;
-
-	QString family;
-#ifdef WIN32
-	family = "Verdana";
-#else
-	family = "Sans";
-#endif
-	QFont font(family);
-	font.setPointSize(10);
-	font.setBold(true);
-	painter_.setFont(font);
-}
-
-TeQtGraphPlot::~TeQtGraphPlot ()
-{
-	if(painter_.device())
-		painter_.end();
-
-	delete pixmap_;
-}
-
-void TeQtGraphPlot::resize (int w, int h)
-{
-	if(painter_.device())
-		painter_.end();
-	delete pixmap_;
-
-	pwidth_ = w;
-	pheight_ = h;
-	pixmap_ = new QPixmap (w, h);
-	pixmap_->fill(widget_->paletteBackgroundColor());
-	painter_.begin(pixmap_);
-}
-
-void TeQtGraphPlot::plot ()
-{
-	plotOnPixmap();
-	polygonBrush_ = QBrush(Qt::white);
-	fillRectangle (0, 0, pwidth_, pheight_);
-	plotCurves ();
-	copyPixmapToWindow();
-}
-
-int TeQtGraphPlot::getWidth ()
-{
-    return pwidth_;
-}
-
-int	TeQtGraphPlot::getHeight ()
-{
-    return pheight_;
-}
-
-void TeQtGraphPlot::setLineAttributes(TeColor c, int /* s */, int w)
-{
-	QColor cor(c.red_, c.green_, c.blue_);
-	linePen_.setColor (cor);
-	linePen_.setStyle(penStyleMap_[(TeLnBasicType)TeLnTypeContinuous]);
-	linePen_.setWidth(w);
-}
-
-void TeQtGraphPlot::setFillAreaColor (TeColor c)
-{
-	QColor cor(c.red_, c.green_, c.blue_);
-	polygonBrush_.setColor (cor);
-	polygonBrush_.setStyle(brushStyleMap_[(TePolyBasicType)TePolyTypeFill]);
-}
-
-void TeQtGraphPlot::setTextColor (TeColor c)
-{
-	QColor cor(c.red_, c.green_, c.blue_);
-	textPen_.setColor (cor);
-}
-
-void TeQtGraphPlot::fillRectangle (int x, int y, int dx, int dy)
-{
-	painter_.fillRect (x,y,dx,dy,polygonBrush_);
-}
-
-void TeQtGraphPlot::drawRectangle (int x, int y, int dx, int dy)
-{
-	painter_.setPen(linePen_);
-	painter_.moveTo(x,y);
-	painter_.lineTo(x+dx,y);
-	painter_.lineTo(x+dx,y+dy);
-	painter_.lineTo(x,y+dy);
-	painter_.lineTo(x,y);
-}
-
-void TeQtGraphPlot::drawLine (int sx, int sy, int dx, int dy)
-{
-	painter_.setPen(linePen_);
-	painter_.drawLine (sx,sy,dx,dy);
-}
-
-void TeQtGraphPlot::drawText (int x, int y, char* t, double angle)
-{
-	painter_.setPen(textPen_);
-
-	if(angle != 0)
-	{
-		painter_.save();
-		painter_.translate(x, y);
-		painter_.rotate(-angle);
-		painter_.drawText(0, 0, t);
-		painter_.restore();
-	}
-	else
-		painter_.drawText(x, y, t);
-}
-
-void TeQtGraphPlot::fillArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c)
-{
-	QColor cor(c.red_, c.green_, c.blue_);
-	painter_.setBrush(cor);
-	painter_.drawPie (xc,yc,w,h,(int)(a1*16),(int)((a2-a1)*16));
-}
-
-void TeQtGraphPlot::drawArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c)
-{
-	QColor cor(c.red_, c.green_, c.blue_);
-	painter_.setBrush(cor);
-	painter_.drawArc (xc,yc,w,h,(int)(a1*16),(int)((a2-a1)*16));
-}
-
-void TeQtGraphPlot::copyPixmapToWindow ()
-{
-	if (pixmap_)
-		bitBlt (widget_,0,0,pixmap_,0,0,pwidth_,pheight_,Qt::CopyROP,true);
-}
-
-void TeQtGraphPlot::copyPixmapToWindow(int ulx, int uly, int w, int h)
-{
-	if (pixmap_)
-		bitBlt (widget_,ulx,uly,pixmap_,ulx,uly,w,h,Qt::CopyROP,true);
-}
-
-void TeQtGraphPlot::plotOnWindow ()
-{
-	QPaintDevice* dev = painter_.device();
-	if(dev == widget_)
-		return;
-	if(dev)
-		painter_.end();
-	painter_.begin(widget_);
-}
-
-void TeQtGraphPlot::plotOnPixmap ()
-{
-	QPaintDevice* dev = painter_.device();
-	if(dev == pixmap_)
-		return;
-	if(dev)
-		painter_.end();
-	painter_.begin(pixmap_);
-}
-
-TePlotWidget::TePlotWidget(QWidget *parent, const char *name):TeQtGraphPlot(parent,name)
-{
-	widget_ = parent;
-}
-
-void TePlotWidget::plot ()
-{
-	TeQtGraphPlot::plot ();
-}
-
-
-void TePlotWidget::erase( int order)
-{
-	kill (order);
-	plot ();
-}
-
-void TeQtGraphPlot::plotRectangle (int x, int y, int dx, int dy)
-{
-	painter_.setPen(linePen_);
-	painter_.moveTo(x,y);
-	painter_.lineTo(x+dx,y);
-	painter_.lineTo(x+dx,y+dy);
-	painter_.lineTo(x,y+dy);
-	painter_.lineTo(x,y);
-}
-
-void TeQtGraphPlot::value_to_pixel(double px, double py, int* x, int* y)
-{
-	TeGraphPlot::value_to_pixel(px, py, x, y);
-}
-
-void TeQtGraphPlot::copyPixmapToPrinter()
-{
-	if (pixmap_)
-	{
-		QPrinter printer;
-		if (printer.setup())
-		{
-			QPainter p(&printer);
-
-			QPaintDevice* dev = painter_.device();
-			if(dev == pixmap_)
-				painter_.end();
-
-			p.drawPixmap(0, 0, *pixmap_);
-			p.flush();
-			p.end();
-
-			if(dev && painter_.device() == 0)
-				painter_.begin(dev);
-		}
-	}
-}
-
-void TeQtGraphPlot::textExtent (string &str, int &w, int &h, double /* angle */)
-{
-	QFont font = painter_.font();
-	QFontMetrics fm(font);
-
-	w = fm.width(str.c_str());
-	h = fm.height();
-
-	//?????????????????? fazer codigo......
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeQtGraph.h>
+#include <TeCoord2D.h>
+#include <qpaintdevicemetrics.h> 
+#include <qprinter.h>
+
+TeQtGraphPlot::TeQtGraphPlot (QWidget *parent, const char * /* name */)
+{
+	QPaintDevice* dev = painter_.device();
+	if(dev)
+		painter_.end();
+
+// Build a new pixmap
+	widget_ = parent;
+    QPaintDeviceMetrics pdm( widget_ );
+	pixmap_ = new QPixmap (pdm.width(), pdm.height());
+	pixmap_->fill(widget_->paletteBackgroundColor());
+
+	if(dev)
+		painter_.end();
+	painter_.begin(pixmap_);
+
+	pwidth_ = pdm.width();
+	pheight_ = pdm.height();
+
+	//Mounting the brushStyleMap
+	brushStyleMap_[TePolyTypeTransparent] = Qt::NoBrush;
+	brushStyleMap_[TePolyTypeFill] = Qt::SolidPattern;
+	brushStyleMap_[TePolyTypeHorizontal] = Qt::HorPattern;
+	brushStyleMap_[TePolyTypeVertical] = Qt::VerPattern;
+	brushStyleMap_[TePolyTypeFDiagonal] = Qt::FDiagPattern;
+	brushStyleMap_[TePolyTypeBDiagonal] = Qt::BDiagPattern;
+	brushStyleMap_[TePolyTypeCross] = Qt::CrossPattern;
+	brushStyleMap_[TePolyTypeDiagonalCross] = Qt::DiagCrossPattern;
+
+	//Mounting the penStyleMap
+	penStyleMap_[TeLnTypeContinuous] = Qt::SolidLine;
+	penStyleMap_[TeLnTypeDashed] = Qt::DashLine;
+	penStyleMap_[TeLnTypeDotted] = Qt::DotLine;
+	penStyleMap_[TeLnTypeDashDot] = Qt::DashDotLine;
+	penStyleMap_[TeLnTypeDashDotDot] = Qt::DashDotDotLine;
+	penStyleMap_[TeLnTypeNone] = Qt::NoPen;
+
+	QString family;
+#ifdef WIN32
+	family = "Verdana";
+#else
+	family = "Sans";
+#endif
+	QFont font(family);
+	font.setPointSize(10);
+	font.setBold(true);
+	painter_.setFont(font);
+}
+
+TeQtGraphPlot::~TeQtGraphPlot ()
+{
+	if(painter_.device())
+		painter_.end();
+
+	delete pixmap_;
+}
+
+void TeQtGraphPlot::resize (int w, int h)
+{
+	if(painter_.device())
+		painter_.end();
+	delete pixmap_;
+
+	pwidth_ = w;
+	pheight_ = h;
+	pixmap_ = new QPixmap (w, h);
+	pixmap_->fill(widget_->paletteBackgroundColor());
+	painter_.begin(pixmap_);
+}
+
+void TeQtGraphPlot::plot ()
+{
+	plotOnPixmap();
+	polygonBrush_ = QBrush(Qt::white);
+	fillRectangle (0, 0, pwidth_, pheight_);
+	plotCurves ();
+	copyPixmapToWindow();
+}
+
+int TeQtGraphPlot::getWidth ()
+{
+    return pwidth_;
+}
+
+int	TeQtGraphPlot::getHeight ()
+{
+    return pheight_;
+}
+
+void TeQtGraphPlot::setLineAttributes(TeColor c, int /* s */, int w)
+{
+	QColor cor(c.red_, c.green_, c.blue_);
+	linePen_.setColor (cor);
+	linePen_.setStyle(penStyleMap_[(TeLnBasicType)TeLnTypeContinuous]);
+	linePen_.setWidth(w);
+}
+
+void TeQtGraphPlot::setFillAreaColor (TeColor c)
+{
+	QColor cor(c.red_, c.green_, c.blue_);
+	polygonBrush_.setColor (cor);
+	polygonBrush_.setStyle(brushStyleMap_[(TePolyBasicType)TePolyTypeFill]);
+}
+
+void TeQtGraphPlot::setTextColor (TeColor c)
+{
+	QColor cor(c.red_, c.green_, c.blue_);
+	textPen_.setColor (cor);
+}
+
+void TeQtGraphPlot::fillRectangle (int x, int y, int dx, int dy)
+{
+	painter_.fillRect (x,y,dx,dy,polygonBrush_);
+}
+
+void TeQtGraphPlot::drawRectangle (int x, int y, int dx, int dy)
+{
+	painter_.setPen(linePen_);
+	painter_.moveTo(x,y);
+	painter_.lineTo(x+dx,y);
+	painter_.lineTo(x+dx,y+dy);
+	painter_.lineTo(x,y+dy);
+	painter_.lineTo(x,y);
+}
+
+void TeQtGraphPlot::drawLine (int sx, int sy, int dx, int dy)
+{
+	painter_.setPen(linePen_);
+	painter_.drawLine (sx,sy,dx,dy);
+}
+
+void TeQtGraphPlot::drawText (int x, int y, char* t, double angle)
+{
+	painter_.setPen(textPen_);
+
+	if(angle != 0)
+	{
+		painter_.save();
+		painter_.translate(x, y);
+		painter_.rotate(-angle);
+		painter_.drawText(0, 0, t);
+		painter_.restore();
+	}
+	else
+		painter_.drawText(x, y, t);
+}
+
+void TeQtGraphPlot::fillArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c)
+{
+	QColor cor(c.red_, c.green_, c.blue_);
+	painter_.setBrush(cor);
+	painter_.drawPie (xc,yc,w,h,(int)(a1*16),(int)((a2-a1)*16));
+}
+
+void TeQtGraphPlot::drawArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c)
+{
+	QColor cor(c.red_, c.green_, c.blue_);
+	painter_.setBrush(cor);
+	painter_.drawArc (xc,yc,w,h,(int)(a1*16),(int)((a2-a1)*16));
+}
+
+void TeQtGraphPlot::copyPixmapToWindow ()
+{
+	if (pixmap_)
+		bitBlt (widget_,0,0,pixmap_,0,0,pwidth_,pheight_,Qt::CopyROP,true);
+}
+
+void TeQtGraphPlot::copyPixmapToWindow(int ulx, int uly, int w, int h)
+{
+	if (pixmap_)
+		bitBlt (widget_,ulx,uly,pixmap_,ulx,uly,w,h,Qt::CopyROP,true);
+}
+
+void TeQtGraphPlot::plotOnWindow ()
+{
+	QPaintDevice* dev = painter_.device();
+	if(dev == widget_)
+		return;
+	if(dev)
+		painter_.end();
+	painter_.begin(widget_);
+}
+
+void TeQtGraphPlot::plotOnPixmap ()
+{
+	QPaintDevice* dev = painter_.device();
+	if(dev == pixmap_)
+		return;
+	if(dev)
+		painter_.end();
+	painter_.begin(pixmap_);
+}
+
+TePlotWidget::TePlotWidget(QWidget *parent, const char *name):TeQtGraphPlot(parent,name)
+{
+	widget_ = parent;
+}
+
+void TePlotWidget::plot ()
+{
+	TeQtGraphPlot::plot ();
+}
+
+
+void TePlotWidget::erase( int order)
+{
+	kill (order);
+	plot ();
+}
+
+void TeQtGraphPlot::plotRectangle (int x, int y, int dx, int dy)
+{
+	painter_.setPen(linePen_);
+	painter_.moveTo(x,y);
+	painter_.lineTo(x+dx,y);
+	painter_.lineTo(x+dx,y+dy);
+	painter_.lineTo(x,y+dy);
+	painter_.lineTo(x,y);
+}
+
+void TeQtGraphPlot::value_to_pixel(double px, double py, int* x, int* y)
+{
+	TeGraphPlot::value_to_pixel(px, py, x, y);
+}
+
+void TeQtGraphPlot::copyPixmapToPrinter()
+{
+	if (pixmap_)
+	{
+		QPrinter printer;
+		if (printer.setup())
+		{
+			QPainter p(&printer);
+
+			QPaintDevice* dev = painter_.device();
+			if(dev == pixmap_)
+				painter_.end();
+
+			p.drawPixmap(0, 0, *pixmap_);
+			p.flush();
+			p.end();
+
+			if(dev && painter_.device() == 0)
+				painter_.begin(dev);
+		}
+	}
+}
+
+void TeQtGraphPlot::textExtent (string &str, int &w, int &h, double /* angle */)
+{
+	QFont font = painter_.font();
+	QFontMetrics fm(font);
+
+	w = fm.width(str.c_str());
+	h = fm.height();
+
+	//?????????????????? fazer codigo......
+}
diff --git a/src/terralib/drivers/qt/TeQtGraph.h b/src/terralib/drivers/qt/TeQtGraph.h
old mode 100755
new mode 100644
index b14a606..5844a70
--- a/src/terralib/drivers/qt/TeQtGraph.h
+++ b/src/terralib/drivers/qt/TeQtGraph.h
@@ -1,83 +1,83 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTGRAPH_H
-#define  __TERRALIB_INTERNAL_QTGRAPH_H
-
-#include <qwidget.h> 
-#include <qpainter.h>
-#include <qpixmap.h>
-#include "TeGraph.h"
-
-class TeQtGraphPlot : public TeGraphPlot
-{
-public :
-	TeQtGraphPlot (QWidget *parent=0, const char *name=0);
-	~TeQtGraphPlot ();
-	virtual void plot ();
-	void plotRectangle (int x, int y, int dx, int dy);
-	void value_to_pixel(double px, double py, int* x, int* y);
-	int	pwidth_;
-	int	pheight_;
-	int	 getWidth ();
-	int	 getHeight ();
-	QPixmap* getPixmap() {return pixmap_;}
-	QWidget* widget_;
-	void plotOnWindow();
-	void plotOnPixmap();
-	void copyPixmapToWindow();
-	void copyPixmapToWindow(int, int, int, int);
-	void copyPixmapToPrinter();
-   	void setLineAttributes (TeColor c, int , int );
-	void setFillAreaColor (TeColor c);
-	void setTextColor (TeColor c);
-	void fillRectangle (int x, int y, int dx, int dy);
-	void drawRectangle (int x, int y, int dx, int dy);
-	void drawLine (int sx, int sy, int dx, int dy);
-	void drawText (int x, int y, char*t, double angle = 0);
-	void fillArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c);
-	void drawArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c);
-	void textExtent ( string &str, int &w, int &h, double angle = 0.);
-	void resize(int, int);
-
-private :
-	QPainter	painter_;
-	QPixmap*	pixmap_;
-	QPen		linePen_;
-	QColor		lineColor_;
-	QBrush		polygonBrush_;
-	QColor		polygonColor_;
-	QPen		textPen_;
-	map<TePolyBasicType, Qt::BrushStyle> brushStyleMap_;
-	map<TeLnBasicType, Qt::PenStyle> penStyleMap_;
-};
-
-class TePlotWidget : public TeQtGraphPlot {
-public:
-
-// Initialization
-	TePlotWidget(QWidget *parent=0, const char *name=0);
-	~TePlotWidget() {}
-	void erase (int order = 0);
-	void plot ();
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTGRAPH_H
+#define  __TERRALIB_INTERNAL_QTGRAPH_H
+
+#include <qwidget.h> 
+#include <qpainter.h>
+#include <qpixmap.h>
+#include "TeGraph.h"
+
+class TeQtGraphPlot : public TeGraphPlot
+{
+public :
+	TeQtGraphPlot (QWidget *parent=0, const char *name=0);
+	~TeQtGraphPlot ();
+	virtual void plot ();
+	void plotRectangle (int x, int y, int dx, int dy);
+	void value_to_pixel(double px, double py, int* x, int* y);
+	int	pwidth_;
+	int	pheight_;
+	int	 getWidth ();
+	int	 getHeight ();
+	QPixmap* getPixmap() {return pixmap_;}
+	QWidget* widget_;
+	void plotOnWindow();
+	void plotOnPixmap();
+	void copyPixmapToWindow();
+	void copyPixmapToWindow(int, int, int, int);
+	void copyPixmapToPrinter();
+   	void setLineAttributes (TeColor c, int , int );
+	void setFillAreaColor (TeColor c);
+	void setTextColor (TeColor c);
+	void fillRectangle (int x, int y, int dx, int dy);
+	void drawRectangle (int x, int y, int dx, int dy);
+	void drawLine (int sx, int sy, int dx, int dy);
+	void drawText (int x, int y, char*t, double angle = 0);
+	void fillArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c);
+	void drawArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c);
+	void textExtent ( string &str, int &w, int &h, double angle = 0.);
+	void resize(int, int);
+
+private :
+	QPainter	painter_;
+	QPixmap*	pixmap_;
+	QPen		linePen_;
+	QColor		lineColor_;
+	QBrush		polygonBrush_;
+	QColor		polygonColor_;
+	QPen		textPen_;
+	map<TePolyBasicType, Qt::BrushStyle> brushStyleMap_;
+	map<TeLnBasicType, Qt::PenStyle> penStyleMap_;
+};
+
+class TePlotWidget : public TeQtGraphPlot {
+public:
+
+// Initialization
+	TePlotWidget(QWidget *parent=0, const char *name=0);
+	~TePlotWidget() {}
+	void erase (int order = 0);
+	void plot ();
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtGrid.cpp b/src/terralib/drivers/qt/TeQtGrid.cpp
old mode 100755
new mode 100644
index e8e9f0e..4ed80ab
--- a/src/terralib/drivers/qt/TeQtGrid.cpp
+++ b/src/terralib/drivers/qt/TeQtGrid.cpp
@@ -1,2941 +1,2942 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-************************************************************************************/
-#include "TeQtGrid.h"
-#include "TeWaitCursor.h"
-#include "TeApplicationUtils.h"
-#include "TeExternalTheme.h"
-#include <qtable.h>
-#include <qcolordialog.h>
-#include <qmessagebox.h>
-#include <qapplication.h>
-#include <qdragobject.h>
-#include <algorithm>
-
-TeQtGrid::TeQtGrid(QWidget* parent, const char* name)
-	: QTable(parent, name)
-{
-	autoPromote_ = true;
-	gridX_ = -1;
-	gridY_ = -1;
-	iLine_ = -1;
-	fLine_ = -1;
-	iCol_ = -1;
-	fCol_ = -1;
-	gridWidth_  = -1;
-	gridHeight_ = -1;
-	portal_ = 0;
-	theme_ = NULL;
-	doRepaint_ = true;
-	doRefresh_ = false;
-	shiftKeyPressed_ = false;
-	lastLinePressed_ = -1;
-	verticalEdition_ = true;
-	rowToEdit_ = -1;
-	colToEdit_ = -1;
-	editing_ = false;
-	showGridInformation_ = true;
-	columnDragEnabled_ = false;
-	mousePressedOnHorizontalHeader_ = false;
-
-	setNumCols(0);
-	setNumRows(0);
-	setSelectionMode(QTable::Multi);
-
-	popupHorizHeader_ = new QPopupMenu;
-	popupVertHeader_ = new QPopupMenu;
-	popupViewport_ = new QPopupMenu;
-
-	horizontalHeader()->setAcceptDrops(true);
-
-	verticalHeader()->installEventFilter(this);
-	horizontalHeader()->installEventFilter(this);
-
-    connect(verticalHeader(), SIGNAL(released(int)),
-	     this, SLOT(mouseReleasedOnVerticalHeaderSlot(int))); // NOTE: QT send the pressed position in your argument
-
-	verticalHeader()->setResizeEnabled(false);
-}
-
-
-TeQtGrid::~TeQtGrid()
-{
-	if (portal_)
-	{
-		portal_->freeResult();
-		delete portal_;
-		portal_ = 0;
-	}
-	if (popupHorizHeader_)
-		delete popupHorizHeader_;
-	if (popupVertHeader_)
-		delete popupVertHeader_;
-	if (popupViewport_)
-		delete popupViewport_;
-}
-
-
-void TeQtGrid::init (TeAppTheme *appTheme)
-{
-	int i, j, numRows, nCols, gs;
-	int collectionNumCols = 0;
-	char buf[20];
-	string oid, uid;
-	hide();
-	clear();
-
-	if ((appTheme == 0) || (appTheme->getTheme()->type() > 2))
-		return;
-
-	TeAttrTableVector attrTables; 
-	
-	TeTheme* theme = appTheme->getSourceTheme();
-	if (theme == 0)
-		return;
-	theme->getAttTables(attrTables);
-	if (attrTables.size() == 0)
-		return;
-
-	TeWaitCursor wait;
-
-	theme_ = appTheme;
-	CT_ = theme->collectionTable();
-	CTE_ = theme->collectionAuxTable();
-	db_ = theme->layer()->database();
-	sqlJoin_ = theme->sqlGridJoin();
-
-	// Mount the vector of indexes (indexName_) from the tables
-	theme->getAttTables(tableVector_);
-	for (i = 0; i < (int)tableVector_.size(); ++i)
-	{
-		TeTable t = tableVector_[i];
-		if(t.tableType() == TeAttrStatic || t.tableType() == TeAttrEvent)
-		{
-			if(tableVector_[i].linkName().empty())
-				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].uniqueName());
-			else
-				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].linkName());
-		}
-		else if(t.tableType() != TeAttrExternal)
-		{
-			if(tableVector_[i].uniqueName().empty() == false)
-				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].uniqueName());
-			if(tableVector_[i].linkName().empty() == false)
-				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].linkName());
-		}
-		else
-		{
-			if(tableVector_[i].uniqueName().empty() == false)
-				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].uniqueName());
-			if(tableVector_[i].linkName().empty() == false)
-				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].linkName());
-			if(tableVector_[i].relatedAttribute().empty() == false)
-				indexVector_.push_back(tableVector_[i].relatedTableName() + "." + tableVector_[i].relatedAttribute());
-		}
-	}
-
-	TeAttributeList collAttrList;
-	db_->getAttributeList(CT_, collAttrList);
-	collectionNumCols = collAttrList.size();
-
-	if (portal_)
-	{
-		portal_->freeResult();
-		delete portal_;
-	}
-	portal_= db_->getPortal();
-
-	//read the objects and their legends
-	//from the collection table
-	orderBy_ = CTE_ + ".unique_id ";
-	sql_ = sqlJoin_ + " ORDER BY " + orderBy_ + "ASC ";
-	if (!portal_->query(sql_))
-	{
-		portal_->freeResult();
-		delete portal_;
-		portal_ = 0;
-		wait.resetWaitCursor();
-		return;
-	}
-
-	TeAttributeList extAttList;
-	db_->getAttributeList(CTE_, extAttList);
-
-	TeAttributeList& attrList = portal_->getAttributeList();
-	TeAttributeList::iterator it = attrList.begin();
-	int index = 0;
-	while(it!=attrList.end())
-	{
-		if(TeConvertToUpperCase((*it).rep_.name_)== TeConvertToUpperCase(CTE_+".unique_id"))
-			uniqueIdPos_ = index;
-		else if (TeConvertToUpperCase((*it).rep_.name_)== "UNIQUE_ID")
-			uniqueIdPos_ = index;
-		else if(TeConvertToUpperCase((*it).rep_.name_)== TeConvertToUpperCase(CTE_+".grid_status"))
-			gridStatusPos_ = index;
-		else if(TeConvertToUpperCase((*it).rep_.name_)== "GRID_STATUS")
-			gridStatusPos_ = index;
-		++it;
-		++index;
-	}
-
-	objectIdPos_ = attrList.size() - extAttList.size() - 6;
-	resultIdPos_ = attrList.size() - extAttList.size() - 1;
-	i = 0;
-	int status;
-	while (portal_->fetchRow())
-	{
-		uid = portal_->getData(uniqueIdPos_);
-		oid = portal_->getData(objectIdPos_);
-
-		//if(theme->getProductId() != TeEXTERNALTHEME)
-		if(appTheme->getTheme()->getProductId() == TeTHEME)
-		{
-			gs = atoi(portal_->getData(gridStatusPos_));
-			status = portal_->getInt(resultIdPos_);
-		}
-		else if(appTheme->getTheme()->getProductId() == TeEXTERNALTHEME)
-		{
-			std::map<std::string, int >::iterator it = theme_->getTheme()->getItemStatusMap().find(uid);
-			if( it != theme_->getTheme()->getItemStatusMap().end())
-				gs = it->second; 
-			else
-				gs = 0;
-
-			//std::map<std::string, int>::iterator it2 = theme_->getTheme()->getObjLegendMap().find(oid);
-			//if( it2 != theme_->getTheme()->getObjLegendMap().end())
-			std::map<std::string, int>::iterator it2 = theme_->getTheme()->getObjStatusMap().find(oid);
-			if( it2 != theme_->getTheme()->getObjStatusMap().end())
-				status = it->second;
-			else
-				status = 0;
-		}
-	
-		if(uid.empty())
-		{
-			unique2ObjectMap_[oid] = oid;
-			ObjectInfo	info;
-			info.status_ = status;
-			objectMap_[oid] = info;
-			portalRow2UniqueIdVector_.push_back(oid);
-		}
-		else
-		{
-			unique2ObjectMap_[uid] = oid;
-
-			if(objectMap_.find(oid) == objectMap_.end())
-			{
-				ObjectInfo	info;
-				info.uniqueMap_[uid] = gs;
-				info.status_ = status;
-				objectMap_[oid] = info;
-			}
-			else
-			{
-				objectMap_[oid].uniqueMap_[uid] = gs;
-
-				if(objectMap_[oid].status_ == 0 && gs > 0)
-					objectMap_[oid].status_ = gs;
-				else if(objectMap_[oid].status_ == 1 && gs == 2)
-					objectMap_[oid].status_ = 3;
-				else if(objectMap_[oid].status_ == 2 && gs == 1)
-					objectMap_[oid].status_ = 3;
-			}
-			portalRow2UniqueIdVector_.push_back(uid);
-		}
-		gridToPortalRowVector_.push_back(i);
-		++i;
-	}
-	numRows = i;
-	
-	//get the column names
-
-	nCols = theme->sqlAttList().size();
-	vector<string> colNamesVector;
-	for (j = 0; j < nCols; ++j)
-		colNamesVector.push_back(theme->sqlAttList()[j].rep_.name_);
-
-	doRepaint_ = false; // don�t repaint
-	setNumRows(numRows);
-	setNumCols(nCols);
-
-	for (i = 0; i < nCols; ++i)
-		horizontalHeader()->setLabel(i, colNamesVector[i].c_str());
-
-	// Set the vector that will contain the order the
-	// grid columns will be shown
-	for (i = 0; i < nCols; i++)
-	{
-		gridToPortalColVector_.push_back(i);
-		gridColVisVector_.push_back(true);
-	}
-
-	// Set the minimum width of the vertical header of the grid
-	sprintf(buf, "%d", numRows);
-	int minw = strlen(buf) + 1;
-	if (minw < 3)
-		minw = 3;
-	verticalHeader()->setMinimumWidth(minw*9); // supposing char width of 9 pixels
-	setLeftMargin(minw*9);
-
-
-	doRepaint_ = true; // do repaint
-	doRefresh_ = true; // do refresh
-
-	refresh();
-	int visibleCols = 0;
-	int scVal = horizontalScrollBar()->value();
-	for(i=0; i<numCols(); i++)
-	{
-		if(visibleWidth() < columnPos(i) - scVal)
-			break;
-		visibleCols++;
-	}
-
-	for (i = 0; i < visibleCols; ++i)
-		adjustColumn(i);
-	refresh();
-	emit gridChangedSignal();
-	show();
-	gridInformation();
-}
-
-
-void TeQtGrid::initPortal()
-{
-	TeWaitCursor wait;
-
-	int i, j;
-	int nCols = numCols();
-
-	doRepaint_ = false; // do not repaint
-
-	for (j = 0; j < nCols; ++j)
-		horizontalHeader()->removeLabel(j);
-
-	TeAttributeList collAttrList;
-	db_->getAttributeList(CT_, collAttrList);
-
-	portal_= db_->getPortal();
-
-	//read the objects and their legends
-	//from the collection table
-	if (!portal_->query(sql_))
-	{
-		portal_->freeResult();
-		delete portal_;
-		portal_ = 0;
-		wait.resetWaitCursor();
-		return;
-	}
-
-	TeAttrTableVector cTableVec = tableVector_;
-	tableVector_.clear();
-	
-	TeTheme* theme = theme_->getSourceTheme();
-	if (theme == 0)
-		return;
-	theme->getAttTables(tableVector_);
-
-	TeAttributeList extAttList;
-	db_->getAttributeList(CTE_, extAttList);
-
-	TeAttributeList& attrList = portal_->getAttributeList();
-	uniqueIdPos_ = attrList.size() - 2;
-	objectIdPos_ = attrList.size() - extAttList.size() - 6;
-	gridStatusPos_ = attrList.size() - 1;
-	resultIdPos_ = attrList.size() - extAttList.size() - 1;
-	
-	//get the column names
-	nCols = theme->sqlAttList().size();
-	vector<string> colNamesVector;
-	for (j = 0; j < nCols; ++j)
-		colNamesVector.push_back(theme->sqlAttList()[j].rep_.name_);
-
-	setNumCols(nCols);
-
-	arrangeColumns(cTableVec);	
-	for(i=0; (unsigned int)i<gridColVisVector_.size(); i++)
-		showColumn(i);
-
-	for (i = 0; i < nCols; ++i)
-	{
-		j = gridToPortalColVector_[i];
-		horizontalHeader()->setLabel(i, colNamesVector[j].c_str());
-	}
-	doRepaint_ = true; // do repaint
-	doRefresh_ = true; // do refresh
-
-	for(i=0; (unsigned int)i<gridColVisVector_.size(); i++)
-	{
-		bool b = gridColVisVector_[i];
-		if(b == false)
-			hideColumn(i);
-	}
-	refresh();
-	int visibleCols = 0;
-	int scVal = horizontalScrollBar()->value();
-	for(i=0; i<numCols(); i++)
-	{
-		if(visibleWidth() < columnPos(i) - scVal)
-			break;
-		visibleCols++;
-	}
-
-	for (i = 0; i < visibleCols; ++i)
-		adjustColumn(i);
-	refresh();
-	emit gridChangedSignal();
-	show();
-	gridInformation();
-}
-
-void TeQtGrid::updatePortalContents()
-{
-	TeWaitCursor wait;
-
-	if (portal_ == 0)
-	{
-		wait.resetWaitCursor();
-		return;
-	}
-
-	portal_->freeResult();
-
-	if (!portal_->query(sql_))
-	{
-		portal_->freeResult();
-		delete portal_;
-		portal_ = 0;
-	}
-}
-
-void TeQtGrid::clear()
-{
-	gridX_ = -1;
-	gridY_ = -1;
-	iLine_ = -1;
-	fLine_ = -1;
-	iCol_ = -1;
-	fCol_ = -1;
-	gridWidth_  = -1;
-	gridHeight_ = -1;
-	rowToEdit_ = -1;
-	colToEdit_ = -1;
-
-	shiftKeyPressed_ = false;
-	lastLinePressed_ = -1;
-
-	gridToPortalRowVector_.clear();
-	gridToPortalColVector_.clear();
-	objectMap_.clear();
-	unique2ObjectMap_.clear();
-	portalRow2UniqueIdVector_.clear();
-	gridColVisVector_.clear();
-	indexVector_.clear();
-	tableVector_.clear();
-
-	if (portal_)
-	{
-		portal_->freeResult();
-		delete portal_;
-		portal_ = 0;
-	}
-	setNumRows(0);
-	setNumCols(0);
-}
-
-void TeQtGrid::clearPortal()
-{
-	if (portal_)
-	{
-		portal_->freeResult();
-		delete portal_;
-		portal_ = 0;
-	}
-}
-
-
-bool TeQtGrid::eventFilter(QObject *o, QEvent *e)
-{
-	if (doRepaint_ == false) // do not repaint
-		return true; // stop event
-	static int stx, sty;
-
-	if(o == horizontalHeader())
-	{
-		QMouseEvent *m = (QMouseEvent *)e;
-		int gridCol = columnAt(m->x() + contentsX());
-		if(portal_)
-		{
-			TeTable table = findTable(gridCol);
-			QString msg = tr("Table:") + " ";
-			msg += table.name().c_str();
-			if(table.tableType() == TeAttrStatic)
-				msg += " - " + tr("Table type: TeAttrStatic");
-			else if(table.tableType() == TeAttrExternal)
-				msg += "  " + tr("Table type: TeAttrExternal");
-			else if(table.tableType() == TeAttrEvent)
-				msg += " - " + tr("Table type: TeAttrEvent");
-			else if(table.tableType() == TeFixedGeomDynAttr)
-				msg += " - " + tr("Table type: TeFixedGeomDynAttr");
-			else if(table.tableType() == TeDynGeomDynAttr)
-				msg += " - " + tr("Table type: TeDynGeomDynAttr");
-
-			TeAttributeList& AL = portal_->getAttributeList();
-			int pcol = gridToPortalColVector_[gridCol];
-			if(AL.size() > (unsigned int)pcol)
-			{
-				msg += " - " + tr("Column:");
-				msg += " ";
-				msg += AL[pcol].rep_.name_.c_str();
-				if(AL[pcol].rep_.type_ == TeSTRING)
-				{
-					msg += " - " + tr("Column type: TeSTRING");
-					msg += " - " + tr("Num char:");
-					msg += " ";
-					msg += Te2String(AL[pcol].rep_.numChar_).c_str();
-				}
-				else if(AL[pcol].rep_.type_ == TeREAL)
-					msg += "  " + tr("Column type: TeREAL");
-				else if(AL[pcol].rep_.type_ == TeINT)
-					msg += " - " + tr("Column type: TeINT");
-				else if(AL[pcol].rep_.type_ == TeDATETIME)
-					msg += " - " + tr("Column type: TeDATETIME");
-				if(isIndex(pcol))
-					msg += " - " + tr("Column is not editable");
-				else
-					msg += " - " + tr("Column is editable");
-			}
-
-			displayGridInformation(msg);
-		}
-		
-		if (e->type() == QEvent::MouseButtonPress)
-		{
-			stx = sty = -1;
-			if (m->button() == RightButton)
-			{
-				if(gridCol < 0)
-					return false;
-
-				int portalColToPopup = gridToPortalColVector_[gridCol];
-				popupHorizHeader_->move(m->globalPos().x(), m->globalPos().y());
-				emit horizHeaderSignal(portalColToPopup);
-				return true;
-			}
-			if (m->button() == LeftButton)
-			{
-				stx = contentsX();
-				sty = contentsY();
-				if(sty != 0)
-					mousePressedOnHorizontalHeader_ = true;
-				int p = horizontalHeader()->sectionPos(gridCol);
-				int ss = horizontalHeader()->sectionSize(gridCol);
-				int x = m->x() + horizontalHeader()->offset();
-				if(abs(x-p) <= 3 || abs(x-(p+ss)) <= 3)
-					return false;
-				columnDragEnabled_ = true;
-				return false;
-			}
-		}
-		else if(e->type() == QEvent::DragEnter) {
-			QDragEnterEvent *dg = (QDragEnterEvent *)e;
-			dg->accept(QTextDrag::canDecode(dg));
-			return true;
-		}
-		else if(e->type() == QEvent::DragMove) {
-			return true;
-		}
-		else if(e->type() == QEvent::MouseMove) {
-			if (columnDragEnabled_)
-			{
-				columnDragEnabled_ = false;
-				clearSelection(true);
-				setSelectionMode(QTable::NoSelection);
-				string t = "swap:" + Te2String(gridCol);
-				QTextDrag* tDrag = new QTextDrag(t.c_str(), this, "gridswap");
-				tDrag->drag();
-			}
-			return false;
-		}
-		else if(e->type() == QEvent::Drop) {
-			QDragEnterEvent *dg = (QDragEnterEvent *)e;
-			dg->accept(QTextDrag::canDecode(dg));
-			QDropEvent *dp = (QDropEvent *)e;
-
-			QString tx;
-			string dragText;
-			if(QTextDrag::decode(dp, tx))
-				dragText = tx.latin1();
-
-			string fName = dragText;
-			int f = fName.find("-fieldName:");
-			if(f >= 0)
-			{
-				fName = fName.substr(f+strlen("-fieldName:"));
-
-				string table = dragText;
-				table = table.substr(0, f);
-				f = table.find("table:");
-				if(f == 0)
-					table = table.substr(strlen("table:"));
-
-				int col = columnAt(dg->pos().x() + contentsX());
-				string dropName;
-				if (col >= 0)				
-					dropName = horizontalHeader()->label(col).latin1();
-				emit linkTable(table, fName, dropName);
-			}
-			else // swap column
-			{
-//				f = fName.find("swap:", string::npos);
-				f = fName.find("swap:");
-				if(f >= 0)
-				{
-					TeWaitCursor wait;
-					string s = fName;
-					s = s.substr(strlen("swap:"));
-					int col1 = atoi(s.c_str());
-					int col2 = columnAt(dg->pos().x() + contentsX());
-					if(col1 < col2)
-						for(int i=col1; i<col2; i++)
-							swapColumns(i, i+1);
-					else
-						for(int i=col1; i>col2; i--)
-							swapColumns(i, i-1);
-					int w1 = columnWidth(col1);
-					int w2 = columnWidth(col2);
-					setColumnWidth(col1, w2);
-					setColumnWidth(col2, w1);
-					refresh();
-					QPoint p = dg->pos();
-					QMouseEvent* e = new QMouseEvent(QEvent::MouseButtonRelease, p, Qt::LeftButton, Qt::LeftButton);
-					QApplication::postEvent(horizontalHeader(), e);
-				}
-			}
-			return true;
-		}
-		else if (e->type() == QEvent::MouseButtonRelease)
-		{
-			columnDragEnabled_ = false;
-			setSelectionMode(QTable::Multi);
-			if(stx > -1 && sty > -1)
-				setContentsPos(stx, sty);
-			return false;
-		}
-	}
-	else if(o == verticalHeader())
-	{
-		if (e->type() == QEvent::MouseButtonDblClick)
-		{
-			QMouseEvent *m = (QMouseEvent *)e;
-			if (m->button() == LeftButton)
-			{
-				int lin = rowAt(m->y() + contentsY());
-				if (lin >= 0)
-				{
-					emit vertHeaderLeftDblClickSignal(lin);
-				}
-			}
-		}
-		else if (e->type() == QEvent::MouseButtonPress)
-		{
-			QMouseEvent *m = (QMouseEvent *)e;
-			if (m->button() == LeftButton)
-			{
-				stx = contentsX();
-				sty = contentsY();
-				return false;
-			}
-			else if (m->button() == RightButton)
-			{
-				int lin = rowAt(m->y() + contentsY());
-				if (lin < 0)
-					return false;
-
-				popupVertHeader_->move(m->globalPos().x(), m->globalPos().y());
-				emit vertHeaderSignal(lin);
-				return true;
-			}
-		}
-		else if (e->type() == QEvent::MouseButtonRelease)
-		{
-			QMouseEvent *m = (QMouseEvent *)e;
-			if (m->button() == LeftButton)
-			{
-				if (m->state() & Qt::ShiftButton)
-					shiftKeyPressed_ = true;
-				else
-					shiftKeyPressed_ = false;
-				int lin = m->y();
-				dragLineReleased_ = rowAt(lin + contentsY());
-				setContentsPos(stx, sty);
-			}
-			return false;
-		}
-	}
-	else if (o == viewport())
-	{
-		if (e->type() == QEvent::MouseButtonPress)
-		{
-			if(rowToEdit_ > -1 && colToEdit_ > -1)
-				endEdit(rowToEdit_, colToEdit_, true, true);
-			rowToEdit_ = -1;
-			colToEdit_ = -1;
-			editing_ = false;
-
-			QMouseEvent *m = (QMouseEvent *)e;
-			if (m->button() == RightButton)
-			{
-				popupViewport_->move(m->globalPos().x(), m->globalPos().y());
-				emit viewportSignal();
-				return true;
-			}
-		}
-		else if (e->type() == QEvent::MouseButtonDblClick)
-		{
-			if(theme_->getTheme()->type() != TeTHEME)
-				return true;
-
-			QMouseEvent *m = (QMouseEvent *)e;
-			if (m->button() == LeftButton)
-			{
-				int col = gridToPortalColVector_[currentColumn()];
-				if(isIndex(col))
-					return true;
-
-				refresh();
-				setEditMode(QTable::Editing, currentRow(), currentColumn());
-				beginEdit(currEditRow(), currEditCol(), false);
-				rowToEdit_ = currEditRow();
-				colToEdit_ = currEditCol();
-				return false;
-			}
-		}
-		else if (e->type() == QEvent::Enter)
-			gridInformation();
-	}
-	else
-	{
-		if (e->type() == QEvent::KeyPress)
-		{
-			if(rowToEdit_ == -1 || colToEdit_ == -1)
-				return true;
-
-			QKeyEvent *k = (QKeyEvent*)e;
-			if (k->state() & Qt::ControlButton)
-			{
-				if(k->key() == Qt::Key_PageDown)
-				{
-					scrollToNextPointedObjectSlot();
-					return true;
-				}
-				else if(k->key() == Qt::Key_PageUp)
-				{
-					scrollToPrevPointedObjectSlot();
-					return true;
-				}
-			}
-#ifdef WIN32
-			else if (k->state() & Qt::AltButton)
-#else
-			else if (k->state() & (Qt::AltButton | Qt::ControlButton))
-#endif
-			{
-				if(k->key() == Qt::Key_PageDown)
-				{
-					scrollToNextQueriedObjectSlot();
-					return true;
-				}
-				else if(k->key() == Qt::Key_PageUp)
-				{
-					scrollToPrevQueriedObjectSlot();
-					return true;
-				}
-			}
-			else if (k->key() == Qt::Key_Return)
-			{
-				editing_ = true;
-				endEdit(rowToEdit_, colToEdit_, true, true);
-				goToEditNewCell();
-				return true;
-			}
-		}
-	}
-
-	return QTable::eventFilter(o, e);
-}
-
-
-void TeQtGrid::mouseReleasedOnVerticalHeaderSlot(int lin)     
-{
-	TeWaitCursor wait;
-	string uid, oid;
-	int i, begin, end;
-	set<string> drawSet;
-	
-	if (shiftKeyPressed_ == false) // single toggle
-	{
-		portal_->fetchRow(gridToPortalRowVector_[lin]);
-		uid = portal_->getData(uniqueIdPos_);
-		oid = portal_->getData(objectIdPos_);
-		drawSet.insert(oid);
-		ObjectInfo& info = objectMap_[oid];
-		changeObjectStatus(info, uid, "pointing");
-	}
-	else	// set or reset grid lines (shift and pointing operation)
-	{
-		if (lastLinePressed_ != -1)
-		{
-			portal_->fetchRow(gridToPortalRowVector_[lastLinePressed_]);
-			uid = portal_->getData(uniqueIdPos_);
-			oid = portal_->getData(objectIdPos_);
-			ObjectInfo& info = objectMap_[oid];
-			int pointed = info.status_  & 0x1;
-			if(uid.empty() == false)
-				pointed = info.uniqueMap_[uid] & 0x1;
-
-			if (lin > lastLinePressed_)
-			{
-				begin = lastLinePressed_ + 1;
-				end = lin;
-			}
-			else if (lin < lastLinePressed_)
-			{
-				begin = lin;
-				end = lastLinePressed_ - 1;
-			}
-			else
-				begin = end = lin;
-
-			for (i = begin ; i <= end; ++i)
-			{
-				portal_->fetchRow(gridToPortalRowVector_[i]);
-				uid = portal_->getData(uniqueIdPos_);
-				oid = portal_->getData(objectIdPos_);
-				ObjectInfo& info = objectMap_[oid];
-				changeObjectStatus(info, uid, "shiftAndPointing", pointed);
-				drawSet.insert(oid);
-			}
-		}
-	}
-
-	if (lin != dragLineReleased_)
-	{
-		if (dragLineReleased_ == -1)
-		{
-			int ini, fim;
-			for (ini = iLine_; ini <= fLine_; ini++)
-				if (isRowSelected(ini, true))
-					break;
-
-			for (fim = fLine_; fim >= iLine_; fim--)
-				if (isRowSelected(fim, true))
-					break;
-
-			if (fim > lin)
-				dragLineReleased_ = fim;
-			else
-				dragLineReleased_ = ini;
-		}
-		portal_->fetchRow(gridToPortalRowVector_[lin]);
-		uid = portal_->getData(uniqueIdPos_);
-		oid = portal_->getData(objectIdPos_);
-		ObjectInfo& info = objectMap_[oid];
-		int pointed = info.status_  & 0x1;
-		if(uid.empty() == false)
-			pointed = info.uniqueMap_[uid] & 0x1;
-
-		if (lin < dragLineReleased_)
-		{
-			begin = lin + 1;
-			end = dragLineReleased_;
-		}
-		else
-		{
-			begin = dragLineReleased_;
-			end = lin - 1;
-		}
-
-		for (i = begin ; i <= end; ++i)
-		{
-			portal_->fetchRow(gridToPortalRowVector_[i]);
-			uid = portal_->getData(uniqueIdPos_);
-			oid = portal_->getData(objectIdPos_);
-			ObjectInfo& info = objectMap_[oid];
-			changeObjectStatus(info, uid, "shiftAndPointing", pointed);
-			drawSet.insert(oid);
-		}
-	}
-
-	lastLinePressed_ = lin;
-	clearSelection(true);
-
-	refresh();
-	if (saveObjectStatus(theme_, drawSet, objectMap_) == false)
-	{
-		QMessageBox::critical(this, tr("Error"),
-			tr("Fail to update the \"c_object_status\" and \"grid_status\" fields in the collection table!"));
-		return;
-	}
-	emit putColorOnObject(theme_, drawSet);
-	gridInformation();
-}
-
-
-void TeQtGrid::putColorOnGrid(set<string> uidSet, set<string> oidSet, string operation, string /* attrQuery */)     
-{
-	//if(uidSet.empty() && oidSet.empty())
-	//	return;
-
-	int	x, y;
-	string oid, uid;
-	set<string> drawSet;
-	set<string>::iterator it, nit;
-	list<string>::iterator vit;
-	map<string, int>::iterator uit;
-	map<string, ObjectInfo>::iterator oit;
-	set<string> auxSet;
-
-	for (it = oidSet.begin(); it != oidSet.end(); ++it)
-	{
-		ObjectInfo& info = objectMap_[*it];
-		if(info.uniqueMap_.size())
-		{
-			for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-				uidSet.insert(uit->first);
-		}
-		else
-			auxSet.insert(*it);
-	}
-	oidSet = auxSet;
-
-	if (operation == "newQuery" || operation == "filterQuery" || operation == "addQuery")
-	{
-		//get the unique ids that were queried before this query
-		list<string> oldUQueriedList, oldOQueriedList;
-		for(oit =  objectMap_.begin(); oit != objectMap_.end(); oit++)
-		{
-			ObjectInfo& info = oit->second;
-			if(info.uniqueMap_.size())
-			{
-				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-				{
-					if(uit->second & 0x2)
-						oldUQueriedList.push_back(uit->first);
-				}
-			}
-			else
-			{
-				if(info.status_ & 0x2)
-					oldOQueriedList.push_back(oit->first);
-			}
-		}
-
-		if(operation == "newQuery")
-		{
-			// remove intersection (new and old set)
-			vit = oldUQueriedList.begin();
-			while(vit != oldUQueriedList.end())
-			{
-				if((nit = uidSet.find(*vit)) != uidSet.end())
-				{
-					vit = oldUQueriedList.erase(vit);
-					uidSet.erase(nit);
-				}
-				else
-					vit++;
-			}
-			vit = oldOQueriedList.begin();
-			while(vit != oldOQueriedList.end())
-			{
-				if((nit = oidSet.find(*vit)) != oidSet.end())
-				{
-					vit = oldOQueriedList.erase(vit);
-					oidSet.erase(nit);
-				}
-				else
-					vit++;
-			}
-
-			// reset old queried
-			for(vit = oldUQueriedList.begin(); vit != oldUQueriedList.end(); vit++)
-			{
-				oid = unique2ObjectMap_[*vit];
-				ObjectInfo& info = objectMap_[oid];
-				info.uniqueMap_[*vit] &= 0x1;
-				drawSet.insert(oid);
-			}
-			for(vit = oldOQueriedList.begin(); vit != oldOQueriedList.end(); vit++)
-			{
-				oid = *vit;
-				ObjectInfo& info = objectMap_[oid];
-				info.status_ &= 0x1;
-				drawSet.insert(oid);
-			}
-
-			// set new queried
-			for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
-			{
-				oid = unique2ObjectMap_[*nit];
-				ObjectInfo& info = objectMap_[oid];
-				info.uniqueMap_[*nit] |= 0x2;
-				drawSet.insert(oid);
-			}
-			for(nit = oidSet.begin(); nit != oidSet.end(); nit++)
-			{
-				oid = *nit;
-				ObjectInfo& info = objectMap_[oid];
-				info.status_ |= 0x2;
-				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-					uit->second |= 0x2;
-				drawSet.insert(oid);
-			}
-		}
-		else if(operation == "filterQuery")
-		{
-			// remove intersection (old set)
-			for (nit = uidSet.begin(); nit != uidSet.end(); nit++)
-				if((vit = std::find(oldUQueriedList.begin(), oldUQueriedList.end(), *nit)) != oldUQueriedList.end())
-					oldUQueriedList.erase(vit);
-			for (nit = oidSet.begin(); nit != oidSet.end(); nit++)
-				if((vit = std::find(oldOQueriedList.begin(), oldOQueriedList.end(), *nit)) != oldOQueriedList.end())
-					oldOQueriedList.erase(vit);
-
-			// reset old queried
-			for(vit = oldUQueriedList.begin(); vit != oldUQueriedList.end(); vit++)
-			{
-				oid = unique2ObjectMap_[*vit];
-				ObjectInfo& info = objectMap_[oid];
-				info.uniqueMap_[*vit] &= 0x1;
-				drawSet.insert(oid);
-			}
-			for(vit = oldOQueriedList.begin(); vit != oldOQueriedList.end(); vit++)
-			{
-				oid = *vit;
-				ObjectInfo& info = objectMap_[oid];
-				info.status_ &= 0x1;
-				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-					uit->second &= 0x1;
-				drawSet.insert(oid);
-			}
-		}
-		else if(operation == "addQuery")
-		{
-			// remove intersection (new set)
-			for (vit = oldUQueriedList.begin(); vit != oldUQueriedList.end(); vit++)
-				if((nit = uidSet.find(*vit)) != uidSet.end())
-					uidSet.erase(nit);
-			for (vit = oldOQueriedList.begin(); vit != oldOQueriedList.end(); vit++)
-				if((nit = oidSet.find(*vit)) != oidSet.end())
-					oidSet.erase(nit);
-
-			// set new queried
-			for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
-			{
-				oid = unique2ObjectMap_[*nit];
-				ObjectInfo& info = objectMap_[oid];
-				info.uniqueMap_[*nit] |= 0x2;
-				drawSet.insert(oid);
-			}
-			for(nit = oidSet.begin(); nit != oidSet.end(); nit++)
-			{
-				oid = *nit;
-				ObjectInfo& info = objectMap_[oid];
-				info.status_ |= 0x2;
-				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-					uit->second |= 0x2;
-				drawSet.insert(oid);
-			}
-		}
-	}
-	else if (operation == "newPointing" || operation == "togglePointing" || operation == "addPointing")
-	{
-		list<string> oldUPointedList, oldOPointedList;
-		if(operation != "togglePointing")
-		{
-			//get the object ids that were pointed before this pointing
-			for(oit =  objectMap_.begin(); oit != objectMap_.end(); oit++)
-			{
-				ObjectInfo& info = oit->second;
-				if(info.uniqueMap_.size())
-				{
-					for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-					{
-						if(uit->second & 0x1)
-							oldUPointedList.push_back(uit->first);
-					}
-				}
-				else
-				{
-					if(info.status_ & 0x1)
-						oldOPointedList.push_back(oit->first);
-				}
-			}
-		}
-
-		if(operation == "newPointing")
-		{
-			// remove intersection (new and old set)
-			vit = oldUPointedList.begin();
-			while(vit != oldUPointedList.end())
-			{
-				if((nit = uidSet.find(*vit)) != uidSet.end())
-					vit = oldUPointedList.erase(vit);
-				else
-					vit++;
-			}
-			vit = oldOPointedList.begin();
-			while(vit != oldOPointedList.end())
-			{
-				if((nit = oidSet.find(*vit)) != oidSet.end())
-					vit = oldOPointedList.erase(vit);
-				else
-					vit++;
-			}
-
-			// reset old pointeds
-			for(vit = oldUPointedList.begin(); vit != oldUPointedList.end(); vit++)
-			{
-				oid = unique2ObjectMap_[*vit];
-				ObjectInfo& info = objectMap_[oid];
-				info.uniqueMap_[*vit] &= 0x2;
-				drawSet.insert(oid);
-			}
-			for(vit = oldOPointedList.begin(); vit != oldOPointedList.end(); vit++)
-			{
-				oid = *vit;
-				ObjectInfo& info = objectMap_[oid];
-				info.status_ &= 0x2;
-				drawSet.insert(oid);
-			}
-
-			// set new pointed
-			for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
-			{
-				oid = unique2ObjectMap_[*nit];
-				ObjectInfo& info = objectMap_[oid];
-				info.uniqueMap_[*nit] |= 0x1;
-				drawSet.insert(oid);
-			}
-			for(nit = oidSet.begin(); nit != oidSet.end(); nit++)
-			{
-				oid = *nit;
-				ObjectInfo& info = objectMap_[oid];
-				info.status_ |= 0x1;
-				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-					uit->second |= 0x1;
-				drawSet.insert(oid);
-			}
-		}
-		else if(operation == "togglePointing")
-		{
-			// toggle status (new pointed ids)
-			nit = oidSet.begin();
-			if(nit != oidSet.end())
-			{
-				oid = *nit;
-				ObjectInfo& info = objectMap_[oid];
-				int status = info.status_;
-
-				if(status & 0x1) // reset new pointed
-				{
-					while(nit != oidSet.end())
-					{
-						oid = *nit;
-						ObjectInfo& info = objectMap_[oid];
-						info.status_ &= 0x2;
-						for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-							uit->second &= 0x2;
-						nit++;
-						drawSet.insert(oid);
-					}
-				}
-				else // set new pointed
-				{
-					while(nit != oidSet.end())
-					{
-						oid = *nit;
-						ObjectInfo& info = objectMap_[oid];
-						info.status_ |= 0x1;
-						for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-							uit->second |= 0x1;
-						nit++;
-						drawSet.insert(oid);
-					}
-				}
-			}
-
-			nit = uidSet.begin();
-			if(nit != uidSet.end())
-			{
-				oid = unique2ObjectMap_[*nit];
-				ObjectInfo& info = objectMap_[oid];
-				int status = info.status_;
-
-				if(status & 0x1) // reset new pointed
-				{
-					for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
-					{
-						oid = unique2ObjectMap_[*nit];
-						ObjectInfo& info = objectMap_[oid];
-						info.uniqueMap_[*nit] &= 0x2;
-						drawSet.insert(oid);
-					}
-				}
-				else // set new pointed
-				{
-					for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
-					{
-						oid = unique2ObjectMap_[*nit];
-						ObjectInfo& info = objectMap_[oid];
-						info.uniqueMap_[*nit] |= 0x1;
-						drawSet.insert(oid);
-					}
-				}
-			}
-		}
-		else if(operation == "addPointing")
-		{
-			// remove intersection (new pointed ids)
- // not erase (not optimize) - graphic plot need selectd objects
-
-			// set new pointeds
-			for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
-			{
-				oid = unique2ObjectMap_[*nit];
-				ObjectInfo& info = objectMap_[oid];
-				info.uniqueMap_[*nit] |= 0x1;
-				drawSet.insert(oid);
-			}
-			for(nit = oidSet.begin(); nit != oidSet.end(); nit++)
-			{
-				oid = *nit;
-				ObjectInfo& info = objectMap_[oid];
-				info.status_ |= 0x1;
-				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-					uit->second |= 0x1;
-				drawSet.insert(oid);
-			}
-		}
-	}
-
-	for(it = drawSet.begin(); it != drawSet.end(); it++)
-	{
-		oid = *it;
-		ObjectInfo& info = objectMap_[oid];
-		if(info.uniqueMap_.size())
-		{
-			set<int> statusSet;
-			uit = info.uniqueMap_.begin();
-			uid = uit->first;
-
-			while(uit != info.uniqueMap_.end())
-				statusSet.insert(uit++->second);
-			if(statusSet.find(3) != statusSet.end())
-				info.status_ = 3;
-			else if(statusSet.find(2) != statusSet.end() && statusSet.find(1) != statusSet.end())
-				info.status_ = 3;
-			else if(statusSet.find(2) != statusSet.end() && statusSet.find(1) == statusSet.end())
-				info.status_ = 2;
-			else if(statusSet.find(2) == statusSet.end() && statusSet.find(1) != statusSet.end())
-				info.status_ = 1;
-			else
-				info.status_ = 0;
-		}
-	}
-
-	// If it is not a query operation (i.e., a pointing operation), scroll the grid if the
-	// single object is not visible in the grid.
-	if (operation == "togglePointing")
-	{
-		vector<string>::iterator itpos;
-		if(uid.empty() == false)
-			itpos = std::find(portalRow2UniqueIdVector_.begin(), portalRow2UniqueIdVector_.end(), uid);
-		else
-			itpos = std::find(portalRow2UniqueIdVector_.begin(), portalRow2UniqueIdVector_.end(), oid);
-		int pos = 0;
-		if(itpos != portalRow2UniqueIdVector_.end())
-			pos = itpos - portalRow2UniqueIdVector_.begin();
-
-		vector<int>::iterator itpos2;
-		itpos2 = std::find(gridToPortalRowVector_.begin(),gridToPortalRowVector_.end(), pos);
-		pos = itpos2 - gridToPortalRowVector_.begin();
-
-		if (pos <= iLine_ || pos >= fLine_)
-		{
-			// if editing, end edit to enable vertical scrolling
-			if(editing_ && (rowToEdit_ > -1 && colToEdit_ > -1))
-			{
-				endEdit(rowToEdit_, colToEdit_, true, true);
-				rowToEdit_ = -1;
-				colToEdit_ = -1;
-				editing_ = false;
-			}
-			doRepaint_ = true;
-			x = contentsX();
-			y = rowPos(pos);
-			setContentsPos(x, y);
-		}
-	}
-
-	clearSelection(true);
-	refresh();
-
-	if (saveObjectStatus(theme_, drawSet, objectMap_) == false)
-	{
-		QMessageBox::critical(this, tr("Error"),
-			tr("Fail to update the \"c_object_status\" and \"grid_status\" fields in the collection table!"));
-		return;
-	}
-
-	emit putColorOnObject(theme_, drawSet);
-
-	if(autoPromote_)
-	{
-		// if editing, end edit to enable vertical scrolling
-		if(editing_ && (rowToEdit_ > -1 && colToEdit_ > -1))
-		{
-			endEdit(rowToEdit_, colToEdit_, true, true);
-			rowToEdit_ = -1;
-			colToEdit_ = -1;
-			editing_ = false;
-		}
-		if (operation == "newPointing" || operation == "addPointing")
-			promotePointedObjectsSlot();
-		else if(operation == "newQuery" || operation == "addQuery" || operation == "filterQuery")
-			promoteQueriedObjectsSlot();
-	}
-
-	gridInformation();
-}
-
-
-void TeQtGrid::drawContents (QPainter *qp, int clipx, int clipy, int clipw, int cliph)
-{
-	if(doRepaint_ == true)
-	{
-		update();
-		QTable :: drawContents(qp, clipx, clipy, clipw, cliph);
-	}
-}
-
-
-void TeQtGrid::update()
-{
-	if(portal_ == 0)
-		return;
-	int ie = currEditRow();
-	int je = currEditCol();
-	QString vale;
-	if(ie >= 0 && je >= 0)
-	{
-		setCellContentFromEditor(ie, je);
-		vale = text(ie, je);
-		if(vale.isEmpty())
-		{
-			int pos = gridToPortalRowVector_[ie];
-			if(portal_->fetchRow(pos))
-			{
-				string s = portal_->getData(gridToPortalColVector_[je]);
-				if(s.empty() == false)
-					vale = s.c_str();
-			}
-		}
-	}
-
-	int	i, j, pos;
-
-	int gridY = contentsY();
-	int gridX = contentsX();
-
-	if(mousePressedOnHorizontalHeader_ && gridY == 0)
-	{
-		setContentsPos(gridX_, gridY_);
-		gridY = gridY_;
-		mousePressedOnHorizontalHeader_ = false;
-	}
-
-	int gridHeight = visibleHeight(); 
-	int gridWidth = visibleWidth(); 
-
-	if (doRefresh_ == false && 
-		gridX_ == gridX && gridY_ == gridY &&
-		gridHeight_ == gridHeight && 
-		gridWidth_ == gridWidth)
-		return;
-
-	gridX_ = gridX;
-	gridY_ = gridY;
-	gridHeight_ = gridHeight;
-	gridWidth_ = gridWidth;
-		
-// clear cells
-	doRepaint_ = false; // do not repaint
-	if (iLine_ >= 0 && iCol_ >= 0)
-	{
-		for (i = iLine_; i <= fLine_; ++i)
-		{
-			for (j = iCol_; j <= fCol_; ++j)
-			{
-				if(item(i, j))
-					clearCell(i, j);
-			}
-		}
-	}
-
-	iLine_ = rowAt(gridY_);
-	iCol_  = columnAt(gridX_);
-	visibleLines_ = rowAt(gridHeight_);
-	if (visibleLines_ == -1)
-		visibleLines_ = numRows();
-
-	visibleCols_ = 0;
-	int scVal = horizontalScrollBar()->value();
-	for(i=iCol_; i<numCols(); i++)
-	{
-		if(gridWidth_ < columnPos(i) - scVal)
-			break;
-		visibleCols_++;
-	}
-
-	if (iLine_ < 0 || iCol_ < 0)
-	{
-		gridX_ = gridY_ = iLine_ = fLine_ = iCol_ = fCol_ = -1;
-		doRepaint_ = true;
-		return;
-	}
-
-	fLine_ = iLine_ + visibleLines_;
-	if (fLine_ > numRows() - 1)
-		fLine_ = numRows() - 1;
-	fCol_ = iCol_ + visibleCols_ - 1;
-
-	int status;
-	string st, oid, uid;
-	QColor qc;
-	TeColor color;
-	for (i = iLine_; i <= fLine_ ; ++i)
-	{
-		pos = gridToPortalRowVector_[i];
-		if (portal_->fetchRow(pos) == false)
-			return;
-
-		oid = portal_->getData(objectIdPos_);
-		uid = portal_->getData(uniqueIdPos_);
-
-		ObjectInfo& info = objectMap_[oid];
-		if(uid.empty() == false)
-			status = info.uniqueMap_[uid];
-		else
-			status = info.status_;
-
-		if (status == 1)
-			color = (theme_->getTheme())->pointingLegend().visual(TePOLYGONS)->color();
-		else if (status == 2)
-			color = (theme_->getTheme())->queryLegend().visual(TePOLYGONS)->color();
-		else if (status == 3)
-			color = (theme_->getTheme())->queryAndPointingLegend().visual(TePOLYGONS)->color();
-		qc = QColor(color.red_,color.green_,color.blue_);
-
-		for (j = iCol_; j <= fCol_; ++j)
-		{
-			if (gridColVisVector_[j] == true)
-			{
-				st = portal_->getData(gridToPortalColVector_[j]);
-				if(status != 0)
-				{
-					TeQtGridItem *ti;
-					if(ie == i && je == j)
-						ti = new TeQtGridItem( this, QTableItem::OnTyping, vale);
-					else
-						ti = new TeQtGridItem( this, QTableItem::OnTyping, st.c_str());
-
-					ti->setColor(qc);
-					setItem(i, j, ti );
-				}
-				else
-				{
-					if(ie == i && je == j)
-						setText(i, j, vale);
-					else
-						setText(i, j, st.c_str());
-				}
-			}
-
-			if(i == fLine_ && j == fCol_- 1)
-			{
-				doRepaint_ = true; // do repaint
-				doRefresh_ = true;
-				updateCell(i, j);
-			}
-		}
-	}
-
-	doRepaint_ = true; // do repaint
-	doRefresh_ = false;
-
-	if(ie >= 0 && je >= 0)
-		endEdit(ie, je, true, true);
-
-	if(rowToEdit_ > -1 && colToEdit_ > -1 && editing_)
-	{
-		setEditMode(QTable::Editing, rowToEdit_, colToEdit_);
-		beginEdit(rowToEdit_, colToEdit_, false);
-	}
-}
-
-
-void TeQtGrid::adjustColumns()
-{
-	int	i;
-	for (i = 0; i < numCols(); ++i)
-		adjustColumn(i);
-	refresh();
-}
-
-
-void TeQtGrid::swapColumns(int col1, int col2)
-{
-	int	nc = numCols();
-	vector<int>	cols;
-	int	n;
-
-	if (col1 == -1 || col2 == -1)
-	{
-		for(n = 0; n < nc; n++)
-			if (isColumnSelected(n, true) == true)
-				cols.push_back(n);
-		if(cols.size() != 2)
-		{
-			QMessageBox::warning(this, tr("Warning"),
-				tr("Select the two grid columns to be exchanged!"));
-			return;
-		}
-		col1 = cols[0];
-		col2 = cols[1];
-	}
-
-	int w1 = columnWidth(col1);
-	int w2 = columnWidth(col2);
-
-	int c1 = gridToPortalColVector_[col1];
-	int c2 = gridToPortalColVector_[col2];
-
-	gridToPortalColVector_[col1] = c2;
-	gridToPortalColVector_[col2] = c1;
-
-	QTable::swapColumns(col1, col2);
-	for (n=0; n<nc; n++)
-	{
-		string st = portal_->getAttribute(gridToPortalColVector_[n]).rep_.name_;
-		horizontalHeader()->setLabel(n, st.c_str());
-	}
-
-	setColumnWidth(col1, w2);
-	setColumnWidth(col2, w1);
-
-	refresh();
-}
-
-
-void TeQtGrid::setVisColumn(bool vis, int col)
-{
-	unsigned int nc = numCols();
-	unsigned int n;
-	vector<int>	cols;
-
-	if (vis == false)
-	{
-		if (col == -1)
-		{
-			for(n=0; n<nc; n++)
-				if (isColumnSelected(n, true) == true)
-					cols.push_back(n);
-			if(cols.size() == 0)
-			{
-				QMessageBox::warning(this, tr("Warning"),
-					tr("Select the grid column(s) to be hidden!"));
-				return;
-			}
-		}
-		else
-			cols.push_back(col);
-
-		for(n=0; n<cols.size(); n++)
-		{
-			showColumn(cols[n]); // it is a BUG in the QT 3.2.0 
-			hideColumn(cols[n]);
-			gridColVisVector_[cols[n]] = false;
-		}
-	}
-	else
-	{
-		for(n=0; n<nc; n++)
-		{
-			if(gridColVisVector_[n] == false)
-			{
-				gridColVisVector_[n] = true;
-				showColumn(n);
-				cols.push_back(n);
-			}
-		}
-	}
-	refresh();
-}
-
-void TeQtGrid::refresh()
-{
-	doRefresh_ = true;
-	repaint();
-	update();
-}
-
-
-void TeQtGrid::promotePointedObjectsSlot()
-{
-	TeWaitCursor	wait;
-	gridToPortalRowVector_.clear();
-	string	oid, uid;
-	TeDatabasePortal* portal = db_->getPortal();
-	vector<int> notByPointingVector;
-
-	unsigned int i=0;
-    int gs;
-	if (portal->query(sql_))
-	{
-		while (portal->fetchRow())
-		{
-			if(theme_->getTheme()->getProductId() == TeTHEME)
-			{
-				gs = atoi(portal->getData(gridStatusPos_));
-				if(gs &= 0x1)
-					gridToPortalRowVector_.push_back(i);
-				else
-					notByPointingVector.push_back(i);
-			}
-			else if(theme_->getTheme()->getProductId() == TeEXTERNALTHEME)
-			{
-				uid = portal->getData(uniqueIdPos_);
-				if(uid.empty() == false)
-				{
-					std::map<std::string, int >::iterator it = theme_->getTheme()->getItemStatusMap().find(uid);
-					if( it != theme_->getTheme()->getItemStatusMap().end())
-					{
-						if(it->second & 1)
-							gridToPortalRowVector_.push_back(i);
-						else
-							notByPointingVector.push_back(i);
-					}
-					else
-					{
-						notByPointingVector.push_back(i);
-					}
-				}
-				else
-				{
-					oid = portal->getData(objectIdPos_);
-					std::map<std::string, int >::iterator it = theme_->getTheme()->getObjStatusMap().find(oid);
-					if( it != theme_->getTheme()->getObjStatusMap().end())
-					{
-						if(it->second & 1)
-							gridToPortalRowVector_.push_back(i);
-						else
-							notByPointingVector.push_back(i);
-					}
-					else
-					{
-						notByPointingVector.push_back(i);
-					}
-				}
-			}		
-			++i;
-		}
-	}
-	delete portal;
-
-	for (i = 0; i < notByPointingVector.size(); ++i)
-		gridToPortalRowVector_.push_back(notByPointingVector[i]);
-	
-	doRepaint_ = true;
-
-	int x = contentsX();
-	int y = rowPos(0);
-	setContentsPos(x, y);
-
-	refresh();
-}
-
-
-void TeQtGrid::promoteQueriedObjectsSlot()
-{
-	TeWaitCursor	wait;
-	gridToPortalRowVector_.clear();
-	string	oid, uid, val;
-	TeDatabasePortal* portal = db_->getPortal();
-	vector<int> notByQueryVector;
-
-	unsigned int i=0;
-    int gs;
-	if (portal->query(sql_))
-	{
-		while (portal->fetchRow())
-		{
-			if(theme_->getTheme()->getProductId() == TeTHEME)
-			{
-				val =  portal->getData(gridStatusPos_);
-				if(val.empty())
-					gs = atoi(portal->getData(resultIdPos_));
-				else
-					gs = atoi(val.c_str());
-
-				if(gs &= 0x2)
-					gridToPortalRowVector_.push_back(i);
-				else
-					notByQueryVector.push_back(i);
-			}
-			else if(theme_->getTheme()->getProductId() == TeEXTERNALTHEME)
-			{
-				uid = portal->getData(uniqueIdPos_);
-				if(uid.empty() == false)
-				{
-					std::map<std::string, int >::iterator it = theme_->getTheme()->getItemStatusMap().find(uid);
-					if( it != theme_->getTheme()->getItemStatusMap().end())
-					{
-						if(it->second & 2)
-							gridToPortalRowVector_.push_back(i);
-						else
-							notByQueryVector.push_back(i);
-					}
-					else
-					{
-						notByQueryVector.push_back(i);
-					}
-				}
-				else
-				{
-					oid = portal->getData(objectIdPos_);
-					std::map<std::string, int >::iterator it = theme_->getTheme()->getObjStatusMap().find(oid);
-					if( it != theme_->getTheme()->getObjStatusMap().end())
-					{
-						if(it->second & 2)
-							gridToPortalRowVector_.push_back(i);
-						else
-							notByQueryVector.push_back(i);
-					}
-					else
-					{
-						notByQueryVector.push_back(i);
-					}
-				}
-			}		
-			++i;
-		}
-	}
-	delete portal;
-
-	for (i = 0; i < notByQueryVector.size(); ++i)
-		gridToPortalRowVector_.push_back(notByQueryVector[i]);
-	
-	doRepaint_ = true;
-
-	int x = contentsX();
-	int y = rowPos(0);
-	setContentsPos(x, y);
-
-	refresh();
-}
-
-
-void TeQtGrid::sortAscOrderSlot()    
-{
-	vector<int>	v;
-
-	sort(v, "ASC");
-}
-
-
-void TeQtGrid::sortDescOrderSlot()    
-{
-	vector<int>	v;
-
-	sort(v, "DESC");
-}
-
-
-void TeQtGrid::sort(vector<int> cols, string order)
-{
-	unsigned int nc = numCols();
-	unsigned int n;
-	string uid, oid;
-
-	if (portal_ == 0)
-		return;
-
-
-	if (cols.size() == 0)
-	{
-		for(n = 0; n < nc; ++n)
-			if (isColumnSelected(n, true) == true)
-				cols.push_back(n);
-	}
-
-	if (cols.size() == 0)
-	{
-		QMessageBox::warning(this, tr("Warning"),
-			tr("Select the grid column(s) to be sorted!"));
-		return;
-	}
-
-	orderBy_.clear();
-	for (n=0; n<cols.size(); n++)
-		orderBy_ += (horizontalHeader()->label(cols[n]) + " ").latin1() + order + ",";
-	orderBy_ = orderBy_.substr(0, orderBy_.size()-1);
-	doRepaint_ = true;
-
-	portal_->freeResult();
-	sql_ = sqlJoin_ + " ORDER BY " + orderBy_;
-	if (portal_->query(sql_) == false)
-	{
-		portal_->freeResult();
-		delete portal_;
-		portal_ = 0;
-		return;
-	}
-
-	gridToPortalRowVector_.clear();
-	portalRow2UniqueIdVector_.clear();
-	int i = 0;
-	while(portal_->fetchRow())
-	{
-		uid = portal_->getData(uniqueIdPos_);
-		if(uid.empty() == false)
-			portalRow2UniqueIdVector_.push_back(uid);
-		else
-		{
-			oid = portal_->getData(objectIdPos_);
-			portalRow2UniqueIdVector_.push_back(oid);
-		}
-		gridToPortalRowVector_.push_back(i);
-		++i;
-	}
-
-	refresh();
-}
-
-
-TeTable& TeQtGrid::findTable(int col) // grid column
-{
-	unsigned int i;
-    int nCols;
-	static	TeTable t;
-
-	int portalCol = gridToPortalColVector_[col];
-	TeAttributeList attrList;
-	
-	nCols = 0;
-	for (i = 0; i < tableVector_.size(); ++i)
-	{
-		attrList = tableVector_[i].attributeList();
-		nCols += attrList.size();
-		if (portalCol < nCols)
-			break;				
-	}
-	if(i == tableVector_.size())
-		return t;
-	return tableVector_[i];	
-}
-
-TeTable& TeQtGrid::findTable(string  colName)
-{
-	int	i;
-	for(i=0; i<numCols(); i++)
-	{
-		string cname = horizontalHeader()->label(i).latin1();
-		if(cname == colName)
-			break;
-	}
-	return findTable(i);
-}
-
-
-void TeQtGrid::setVerticalEdition(bool flag)
-{
-	verticalEdition_ = flag;				
-}
-
-bool TeQtGrid::writeCell()
-{
-	string	val;
-	QString qs;
-	unsigned int i;
-
-	if(rowToEdit_ == -1 || colToEdit_ == -1)
-		return false;
-
-	int portalRowToEdit = gridToPortalRowVector_[rowToEdit_];
-	int portalColToEdit = gridToPortalColVector_[colToEdit_];
-	endEdit(rowToEdit_, colToEdit_, true, false);
-
-	int col = gridToPortalColVector_[colToEdit_];
-	if(isIndex(col))
-		return false;
-
-	string colName = horizontalHeader()->label(colToEdit_).latin1();
-	qs = text(rowToEdit_, colToEdit_);
-//	if(qs.isEmpty() && db_->dbmsName() == "Ado")
-//		return false;
-	if(qs.isEmpty() == false)
-		val = qs.latin1();
-
-	TeAttributeList&	attrList = portal_->getAttributeList();
-	TeAttrDataType type = attrList[portalColToEdit].rep_.type_;
-
-	if (portal_->fetchRow(portalRowToEdit) == false)
-		return false;
-
-	TeWaitCursor wait;
-	TeTable& tableToEdit = findTable(colToEdit_);
-	string tableName = tableToEdit.name();
-	string linkName;
-	if(tableToEdit.tableType() == TeAttrStatic || tableToEdit.tableType() == TeAttrEvent)
-		linkName = tableToEdit.linkName();
-	else
-		linkName = tableToEdit.uniqueName();
-
-	i = linkName.find(".");
-	if(i == string::npos)
-		linkName = tableName + "." + linkName;
-
-	string id = portal_->getData(linkName);
-
-	string qString = "UPDATE " + tableName;
-	if(val.empty())
-	{
-		qString += " SET " + colName + " = null";
-		qString += " WHERE " + linkName + " = '" + id + "'";
-	}
-	else
-	{
-		if (type == TeSTRING || type == TeDATETIME)
-		{
-			qString += " SET " + colName + " = '" + db_->escapeSequence(val);
-			qString += "' WHERE " + linkName + " = '" + id + "'";
-		}
-		else
-		{
-			qString += " SET " + colName + " = " + val;
-			qString += " WHERE " + linkName + " = '" + id + "'";
-		}
-	}
-
-	if (db_->execute(qString) == false)
-		return false;
-
-	if(theme_ != NULL && theme_->getTheme() != NULL && (theme_->getTheme()->type() == TeTHEME || theme_->getTheme()->type() == TeEXTERNALTHEME))
-	{
-		TeTheme* teTheme = dynamic_cast<TeTheme*>(theme_->getTheme());
-		TeLayer* layer = teTheme->layer();
-		if(layer != NULL)
-		{
-			layer->updateLayerEditionTime();
-		}
-	}
-
-	if (db_->dbmsName() != "Ado")
-		arrangeGridToPortalRowVector(col);
-
-	return true;
-}
-
-
-void TeQtGrid::editNextRow()
-{
-	if (rowToEdit_ < numRows()-1)
-		++rowToEdit_;
-	else
-	{
-		rowToEdit_ = 0;
-		editNextColumn();
-	}
-}
-
-
-void TeQtGrid::editNextColumn()
-{
-	bool editavel = false;
-	while(editavel == false)
-	{
-		if (colToEdit_ == numCols()-1)
-		{
-			colToEdit_ = 0;
-			if (rowToEdit_ == numRows()-1)
-				rowToEdit_ = 0;
-			else
-				++rowToEdit_;
-		}
-		else
-			++colToEdit_;
-
-		int col = gridToPortalColVector_[colToEdit_];
-		if(isIndex(col))
-			editavel = false;
-		else
-			editavel = true;
-	}
-}
-
-void TeQtGrid::goToEditNewCell()
-{
-	int	x = contentsX();
-	int y = contentsY();
-
-	if(verticalEdition_ == true)
-		editNextRow();
-	else
-		editNextColumn();
-
-	if(rowToEdit_ >= fLine_)
-		y = rowPos(iLine_+1);
-	if(colToEdit_ >= fCol_)
-		x = columnPos(iCol_+1);
-
-	setContentsPos(x, y);
-	refresh();
-
-	int i = currEditRow();
-	int j = currEditCol();
-	if(i != rowToEdit_ || j != colToEdit_)
-	{
-		if(i > 0 && j > 0)
-			endEdit(i, j, true, true);
-		setEditMode(QTable::Editing, rowToEdit_, colToEdit_);
-		beginEdit(rowToEdit_, colToEdit_, false);
-	}
-}
-
-void TeQtGrid::removeQueryColorSlot()
-{
-	TeWaitCursor wait;
-
-	set<string> drawSet;
-	map<string, int>::iterator uit;
-
-	TeDatabase* db = theme_->getLocalDatabase();
-	
-	map<string, ObjectInfo>::iterator oit;
-	for(oit =  objectMap_.begin(); oit != objectMap_.end(); oit++)
-	{
-		ObjectInfo& info = oit->second;
-		if(info.status_ & 0x2)
-		{
-			for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-				uit->second &= 0x1;
-			info.status_ &= 0x1;
-			drawSet.insert(oit->first);
-		}
-	}
-
-	clearSelection(true);
-	refresh();
-	string s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionTable();
-	s += " SET c_object_status = 0 WHERE c_object_status = 2";
-	db->execute(s);
-
-	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionTable();
-	s += " SET c_object_status = 1 WHERE c_object_status = 3";
-	db->execute(s);
-
-	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionAuxTable();
-	s += " SET grid_status = 0 WHERE grid_status = 2";
-	db->execute(s);
-
-	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionAuxTable();
-	s += " SET grid_status = 1 WHERE grid_status = 3";
-	db->execute(s);
-
-	theme_->getTheme()->removeQueryColor();
-	emit putColorOnObject(theme_, drawSet);
-}
-
-
-void TeQtGrid::removePointingColorSlot()
-{
-	TeWaitCursor wait;
-
-	set<string> drawSet;
-	map<string, int>::iterator uit;
-
-	map<string, ObjectInfo>::iterator oit;
-	for(oit =  objectMap_.begin(); oit != objectMap_.end(); oit++)
-	{
-		ObjectInfo& info = oit->second;
-		if(info.status_ & 0x1)
-		{
-			for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-				uit->second &= 0x2;
-			info.status_ &= 0x2;
-			drawSet.insert(oit->first);
-		}
-	}
-
-	clearSelection(true);
-	refresh();
-
-	TeDatabase* db = theme_->getLocalDatabase();
-
-	string s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionTable();
-	s += " SET c_object_status = 0 WHERE c_object_status = 1";
-	db->execute(s);
-
-	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionTable();
-	s += " SET c_object_status = 2 WHERE c_object_status = 3";
-	db->execute(s);
-
-	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionAuxTable();
-	s += " SET grid_status = 0 WHERE grid_status = 1";
-	db->execute(s);
-
-	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionAuxTable();
-	s += " SET grid_status = 2 WHERE grid_status = 3";
-	db->execute(s);
-
-	theme_->getTheme()->removePointingColor();
-	emit putColorOnObject(theme_, drawSet);
-}
-
-
-void TeQtGrid::scrollToNextPointedObjectSlot()
-{
-	TeWaitCursor wait;
-
-	int	rowpos, portalpos, nrows = numRows();
-	int	x, y;
-	string oid, uid;
-
-	x = contentsX();
-	y = contentsY();
-	rowpos = rowAt(y);
-
-	if(rowpos == numRows() - 1)
-	{
-		wait.resetWaitCursor();
-		return;
-	}
-	rowpos++;
-
-	while(rowpos < nrows)
-	{
-		portalpos = gridToPortalRowVector_[rowpos];
-		portal_->fetchRow(portalpos);
-
-		oid = portal_->getData(objectIdPos_);
-		uid = portal_->getData(uniqueIdPos_);
-
-		ObjectInfo& info = objectMap_[oid];
-		int status = info.status_;
-		if(uid.empty() == false)
-			status = info.uniqueMap_[uid];
-
-
-		if (status & 0x1)
-			break;
-		rowpos++;
-	}
-
-
-	if (rowpos == nrows)
-	{
-		wait.resetWaitCursor();
-		return;
-	}
-
-	y = rowPos(rowpos);
-	setContentsPos (x, y);
-
-	clearSelection(true);
-	refresh();
-}
-
-
-void TeQtGrid::scrollToPrevPointedObjectSlot()
-{
-	TeWaitCursor wait;
-
-	int	rowpos, portalpos;
-	int	x, y;
-	string oid, uid;
-
-	x = contentsX();
-	y = contentsY();
-	rowpos = rowAt(y);
-
-	if(rowpos == 0)
-	{
-		wait.resetWaitCursor();
-		return;
-	}
-	rowpos--;
-
-	while(rowpos >= 0)
-	{
-		portalpos = gridToPortalRowVector_[rowpos];
-		portal_->fetchRow(portalpos);
-
-		oid = portal_->getData(objectIdPos_);
-		uid = portal_->getData(uniqueIdPos_);
-
-		ObjectInfo& info = objectMap_[oid];
-		int status = info.status_;
-		if(uid.empty() == false)
-			status = info.uniqueMap_[uid];
-
-		if (status & 0x1)
-			break;
-		rowpos--;
-	}
-
-
-	if (rowpos < 0)
-	{
-		wait.resetWaitCursor();
-		return;
-	}
-
-	y = rowPos(rowpos);
-	setContentsPos (x, y);
-
-	clearSelection(true);
-	refresh();
-}
-
-
-void TeQtGrid::scrollToNextQueriedObjectSlot()
-{
-	TeWaitCursor wait;
-
-	int	rowpos, portalpos, nrows = numRows();
-	int	x, y;
-	string oid, uid;
-
-	x = contentsX();
-	y = contentsY();
-	rowpos = rowAt(y);
-
-	if(rowpos == numRows() - 1)
-	{
-		wait.resetWaitCursor();
-		return;
-	}
-	rowpos++;
-
-	while(rowpos < nrows)
-	{
-		portalpos = gridToPortalRowVector_[rowpos];
-		portal_->fetchRow(portalpos);
-
-		oid = portal_->getData(objectIdPos_);
-		uid = portal_->getData(uniqueIdPos_);
-
-		ObjectInfo& info = objectMap_[oid];
-		int status = info.status_;
-		if(uid.empty() == false)
-			status = info.uniqueMap_[uid];
-
-		if (status & 0x2)
-			break;
-		rowpos++;
-	}
-
-
-	if (rowpos == nrows)
-	{
-		wait.resetWaitCursor();
-		return;
-	}
-
-	y = rowPos(rowpos);
-	setContentsPos (x, y);
-
-	clearSelection(true);
-	refresh();
-}
-
-
-void TeQtGrid::scrollToPrevQueriedObjectSlot()
-{
-	TeWaitCursor wait;
-
-	int	rowpos, portalpos;
-	int	x, y;
-	string oid, uid;
-
-	x = contentsX();
-	y = contentsY();
-	rowpos = rowAt(y);
-
-	if(rowpos == 0)
-	{
-		wait.resetWaitCursor();
-		return;
-	}
-	rowpos--;
-
-	while(rowpos >= 0)
-	{
-		portalpos = gridToPortalRowVector_[rowpos];
-		portal_->fetchRow(portalpos);
-
-		oid = portal_->getData(objectIdPos_);
-		uid = portal_->getData(uniqueIdPos_);
-
-		ObjectInfo& info = objectMap_[oid];
-		int status = info.status_;
-		if(uid.empty() == false)
-			status = info.uniqueMap_[uid];
-
-		if (status & 0x2)
-			break;
-		rowpos--;
-	}
-
-
-	if (rowpos < 0)
-	{
-		wait.resetWaitCursor();
-		return;
-	}
-
-	y = rowPos(rowpos);
-	setContentsPos (x, y);
-
-	clearSelection(true);
-	refresh();
-}
-
-void TeQtGrid::invertSelectionSlot()
-{
-	TeWaitCursor wait;
-
-	set<string> drawSet;
-	map<string, int>::iterator uit;
-	string oid, uid;
-
-	map<string, ObjectInfo>::iterator oit;
-	for(oit =  objectMap_.begin(); oit != objectMap_.end(); oit++)
-	{
-		ObjectInfo& info = oit->second;
-		if(info.status_ & 0x2)	//queried object -> sets it to selected
-		{
-			for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-				uit->second &= 0x1;
-			info.status_ &= 0x1;
-			for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-				uit->second |= 0x1;
-			info.status_ |= 0x1;
-		}
-		for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
-			uit->second ^= 0x1;
-		info.status_ ^= 0x1;			 
-		drawSet.insert(oit->first);
-	}
-	refresh();
-	if (saveObjectStatus(theme_, drawSet, objectMap_) == false)
-	{
-		QMessageBox::critical(this, tr("Error"),
-			tr("Fail to update the \"c_legend_result\" and \"grid_status\" fields in the collection table!"));
-		return;
-	}
-	emit putColorOnObject(theme_, drawSet);
-}
-
-bool TeQtGrid::getVisColumn(int col)
-{
-	if(col < (int)gridColVisVector_.size())
-		return gridColVisVector_[col];
-	return false;
-}
-
-
-bool TeQtGrid::isIndex(int col) // portal column
-{
-	unsigned int i;
-	string cname = portal_->getAttribute(col).rep_.name_;
-
-	if(cname.find(".") == string::npos)
-	{
-		TeAttributeList attrList;		
-		int nCols = 0;
-		for (i = 0; i < tableVector_.size(); ++i)
-		{
-			attrList = tableVector_[i].attributeList();
-			nCols += attrList.size();
-			if (col < nCols)
-				break;				
-		}
-		
-		cname.insert(0, tableVector_[i].name() + ".");
-//		if(i>0)
-//			cname.insert(0, tableVector_[(i-1)].name() + ".");
-	}
-
-	cname = TeConvertToUpperCase(cname);
-	for(i=0; i<indexVector_.size(); i++)
-	{
-		string s = TeConvertToUpperCase(indexVector_[i]);
-		if(s.find(cname) != string::npos)
-			return true;
-	}
-	return false;
-}
-
-bool TeQtGrid::isDateTimeRegistered(int col) // portal column
-{
-	string cname = portal_->getAttribute(col).rep_.name_;
-	TeTable& t = findTable(cname);
-	string name = cname;
-	int f = name.find(".");
-	if(f >= 0)
-		name = name.substr(f+1);
-	if(t.attInitialTime() == name || t.attFinalTime() == name)
-		return true;
-	return false;
-}
-
-bool TeQtGrid::isSortBy(int col) // portal column
-{
-	string cname = portal_->getAttribute(col).rep_.name_;
-	cname += " ";
-
-//	if(orderBy_.find(cname, string::npos) == string::npos)
-	if(orderBy_.find(cname) == string::npos)
-		return false;
-	return true;
-}
-
-bool TeQtGrid::isExternalTable(int col) // portal column
-{
-	unsigned int c;
-	for(c=0; c<gridToPortalColVector_.size(); c++)
-	{
-		if(gridToPortalColVector_[c] == col)
-			break;
-	}
-
-	TeTable& T = findTable(c);
-	if(T.tableType() == TeAttrExternal)
-		return true;
-	else
-		return false;
-}
-
-string TeQtGrid::getObject(int row)
-{
-	int portalpos = gridToPortalRowVector_[row];
-	portal_->fetchRow(portalpos);
-
-	string oid = portal_->getData(objectIdPos_);
-	return oid;
-}
-
-void TeQtGrid::gridInformation()
-{
-	if(showGridInformation_ == false)
-		return;
-
-	int orows = 0, opointed = 0, oqueried = 0, opqs = 0;
-	int pointed = 0, queried = 0, pqs = 0;
-	int rows = numRows();
-	map<string, ObjectInfo>::iterator it = objectMap_.begin();
-
-	while (it != objectMap_.end())
-	{
-		orows++;
-		ObjectInfo& info = it->second;
-		int leg_res = info.status_;
-		if(leg_res == 1)
-			opointed++;
-		else if(leg_res == 2)
-			oqueried++;
-		else if(leg_res == 3)
-		{
-			opointed++;
-			oqueried++;
-			opqs++;
-		}
-
-		map<string, int> uMap = info.uniqueMap_;
-		if(uMap.size())
-		{
-			map<string, int>::iterator uit = uMap.begin();
-			while(uit != uMap.end())
-			{
-				int gStatus = uit->second;
-				if(gStatus == 1)
-					pointed++;
-				else if(gStatus == 2)
-					queried++;
-				else if(gStatus == 3)
-				{
-					pointed++;
-					queried++;
-					pqs++;
-				}
-				uit++;
-			}
-		}
-		it++;
-	}
-
-	string sorows = Te2String(orows);
-	string sopointed = Te2String(opointed);
-	string soqueried = Te2String(oqueried);
-	string sopqs = Te2String(opqs);
-	string srows = Te2String(rows);
-	string spointed = Te2String(pointed);
-	string squeried = Te2String(queried);
-	string spqs = Te2String(pqs);
-
-	if(orows != rows || opointed != pointed || oqueried != queried || opqs != pqs)
-	{
-		sorows += "/" + srows;
-		sopointed += "/" + spointed;
-		soqueried += "/" + squeried;
-		sopqs += "/" + spqs;
-	}
-
-	QString msg = tr("Number of Rows:") + " " + sorows.c_str() + ", " + tr("Pointed:") + " " + sopointed.c_str();
-	msg += ", " + tr("Queried:") + " " + soqueried.c_str() + ", " + tr("Pointed and Queried:") + " " + sopqs.c_str();
-	emit displayGridInformation(msg);
-}
-
-void TeQtGrid::endEdit(int row, int col, bool accept, bool replace)
-{
-	if(accept && replace)
-		writeCell();
-	else
-		QTable::endEdit(row, col, accept, replace);
-}
-
-
-void TeQtGrid::columnWidthChanged(int col)
-{
-	if(doRepaint_)
-		refresh();
-	QTable::columnWidthChanged(col);
-}
-
-void TeQtGrid::insertObjectIntoCollection(string newId, string newTId)
-{
-	doRepaint_ = false;
-	ObjectInfo	info;
-
-	string oid = newId;
-	string uid = newId;
-	if(newTId.empty() == false)
-	{
-		uid += newTId;
-		info.uniqueMap_[uid] = 1;
-		unique2ObjectMap_[uid] = oid;
-	}
-	else
-	{
-		info.uniqueMap_[oid] = 1;
-		unique2ObjectMap_[oid] = oid;
-	}
-
-	info.status_ = 1;
-	objectMap_[oid] = info;
-
-	portalRow2UniqueIdVector_.push_back(uid);
-
-	int numRows = portalRow2UniqueIdVector_.size();
-	gridToPortalRowVector_.push_back(numRows - 1);
-	doRepaint_ = true;
-	setNumRows(numRows);
-}
-
-void TeQtGrid::deletePointedLines()
-{
-	doRepaint_ = false;
-	unsigned int	i, j;
-	string oid, uid;
-	vector<string> oidVec;
-	map<string, vector<string> > uidMap;
-
-	map<string, ObjectInfo>::iterator it = objectMap_.begin();
-	while(it != objectMap_.end())
-	{
-		ObjectInfo	info = (*it).second;
-		if(info.status_ == 1 || info.status_ == 3)
-		{
-			oid = (*it).first;
-			uid.clear();
-			map<string, int>::iterator uit = info.uniqueMap_.begin();
-			vector<string> uidVec;
-			while(uit != info.uniqueMap_.end())
-			{
-				if((*uit).second == 1 || (*uit).second == 3)
-				{
-					uid = (*uit).first;
-					uidVec.push_back(uid);
-				}
-				uit++;
-			}
-
-			if(uidVec.size() == 0)
-			{
-				uidVec.push_back(oid);
-			}
-			uidMap[oid] = uidVec;
-			oidVec.push_back(oid);
-		}
-		it++;
-	}
-
-	vector<string> iVec;
-	for(i=0; i<oidVec.size(); i++)
-	{
-		oid = oidVec[i];
-		ObjectInfo&	info = objectMap_[oid];
-		vector<string> uidVec = uidMap[oid];
-
-		for(j=0; j<uidVec.size(); j++)
-		{
-			string s = uidVec[j];
-			iVec.push_back(s);
-			info.uniqueMap_.erase(s);
-			unique2ObjectMap_.erase(s);
-		}
-		if(info.uniqueMap_.size() == 0)
-			objectMap_.erase(oid);
-	}
-
-	vector<int> jVec;
-	vector<string> copy1(portalRow2UniqueIdVector_.begin(), portalRow2UniqueIdVector_.end());
-	portalRow2UniqueIdVector_.clear();
-	for(i=0; i<copy1.size(); i++)
-	{
-		string ps = copy1[i];
-		for(j=0; j<iVec.size(); j++)
-		{
-			string s = iVec[j];
-			if(ps == s)
-			{
-				jVec.push_back(i);
-				break;
-			}
-		}
-		if(j == iVec.size())
-			portalRow2UniqueIdVector_.push_back(ps);
-	}
-
-	vector<int> copy2(gridToPortalRowVector_.begin(), gridToPortalRowVector_.end());
-	gridToPortalRowVector_.clear();
-	for(i=0; i<copy2.size(); i++)
-	{
-		int ps = copy2[i];
-		for(j=0; j<jVec.size(); j++)
-		{
-			int s = jVec[j];
-			if(ps == s)
-				break;
-		}
-		if(j == jVec.size())
-			gridToPortalRowVector_.push_back(ps);
-	}
-
-	for(i=jVec.size()-1; (int)i>=0; i--)
-	{
-		int s = jVec[i];
-		for(j=0; j<gridToPortalRowVector_.size(); j++)
-		{
-			int ss = gridToPortalRowVector_[j];
-			if(ss >= s)
-				gridToPortalRowVector_[j] = ss - 1;
-		}
-	}
-
-	int numRows = portalRow2UniqueIdVector_.size();
-	doRepaint_ = true;
-	setNumRows(numRows);
-}
-
-bool TeQtGrid::hasPointedLine()
-{
-	map<string, ObjectInfo>::iterator it = objectMap_.begin();
-
-	while(it != objectMap_.end())
-	{
-		ObjectInfo	info = (*it).second;
-		if(info.status_ == 1 || info.status_ == 3)
-			return true;
-		it++;
-	}
-
-	return false;
-}
-
-void TeQtGrid::goToLastLine()
-{
-	int nRows = numRows();
-	int iniRow = nRows - visibleLines_;
-
-	doRepaint_ = true;
-	int x = columnAt(gridX_);
-	int y = rowPos(iniRow);
-	setContentsPos(x, y);
-	refresh();
-}
-
-void TeQtGrid::goToLastColumn()
-{
-	int x = contentsWidth() - visibleWidth();
-
-	doRepaint_ = true;
-	int y = contentsY();
-	setContentsPos(x, y);
-	refresh();
-}
-
-vector<int> TeQtGrid::getSelectedColumns()
-{
-	int i, j;
-	vector<int> colVec;
-
-	for (i = 0; i < numCols(); i++)
-	{
-		if(gridColVisVector_[i])
-		{
-			if (isColumnSelected(i, true) == true)
-			{
-				j = gridToPortalColVector_[i];
-				colVec.push_back(j);
-			}
-		}
-	}
-	return colVec;
-}
-
-void TeQtGrid::arrangeColumns(TeAttrTableVector cTableVec)
-{
-	int	i, j, k, m;
-	TeAttributeList CAL;
-	TeAttributeList	AL;
-	vector<int> cVec;
-
-	for(i=m=0; (unsigned int)i<cTableVec.size(); i++)
-	{
-		TeTable ct = cTableVec[i];
-		CAL = ct.attributeList();
-
-		TeTable t = tableVector_[i];
-		AL = t.attributeList();
-
-		if(AL.size() > CAL.size())
-		{
-			for(j=0; (unsigned int)j<AL.size(); j++, m++)
-			{
-				TeAttribute a = AL[j];
-				for(k=0; (unsigned int)k<CAL.size(); k++)
-				{
-					TeAttribute ca = CAL[k];
-					if(TeConvertToUpperCase(a.rep_.name_) == TeConvertToUpperCase(ca.rep_.name_))
-						break;
-				}
-				if((unsigned int)k == CAL.size())
-					cVec.push_back(m);
-			}
-		}
-		else if(AL.size() < CAL.size())
-		{
-			for(j=0; (unsigned int)j<CAL.size(); j++, m++)
-			{
-				TeAttribute a = CAL[j];
-				for(k=0; (unsigned int)k<AL.size(); k++)
-				{
-					TeAttribute ca = AL[k];
-					if(TeConvertToUpperCase(a.rep_.name_) == TeConvertToUpperCase(ca.rep_.name_))
-						break;
-				}
-				if((unsigned int)k == AL.size())
-					cVec.push_back(m);
-			}
-		}
-		else
-			m += (int)AL.size();
-	}
-
-//	TeAttributeList& attrList = portal_->getAttributeList();
-	int nCols = numCols();
-	int nOldCols = gridColVisVector_.size();
-	vector<bool> cVisVec(gridColVisVector_.begin(), gridColVisVector_.end());
-	vector<int> cSwapVec(gridToPortalColVector_.begin(), gridToPortalColVector_.end());
-	gridColVisVector_.clear();
-	gridToPortalColVector_.clear();
-
-	bool added = false;
-	if(nCols > nOldCols)
-		added = true;
-
-	std::sort(cVec.begin(), cVec.end());
-	if(cVec.size())
-	{
-		if(added)
-		{
-			for(i=nOldCols; i<nCols; i++)
-				cVisVec.push_back(true);
-			gridColVisVector_ = vector<bool>(cVisVec.begin(), cVisVec.end());
-
-			for(i=0; (unsigned int)i<cVec.size(); i++)
-			{
-				k = cVec[i];
-				for(j=0; (unsigned int)j<cSwapVec.size(); j++)
-				{
-					int v = cSwapVec[j];
-					if(v >= k)
-						cSwapVec[j] = v + 1;
-				}
-				cSwapVec.push_back(k);
-			}
-			gridToPortalColVector_ = vector<int>(cSwapVec.begin(), cSwapVec.end());
-		}
-		else
-		{
-			for(i=j=0; (unsigned int)i<cVec.size(); i++)
-			{
-				k = cVec[i];
-				while(j < k)
-				{
-					bool b = cVisVec[j];
-					gridColVisVector_.push_back(b);
-					j++;
-				}
-				j = k + 1;
-			}
-			while((unsigned int)j < cVisVec.size())
-			{
-				bool b = cVisVec[j];
-				gridColVisVector_.push_back(b);
-				j++;
-			}
-
-			for(i=0; (unsigned int)i<cVec.size(); i++)
-			{
-				k = cVec[i];
-				for(j=0; (unsigned int)j<cSwapVec.size(); j++)
-				{
-					int kk = cSwapVec[j];
-					if(kk != k)
-						gridToPortalColVector_.push_back(kk);
-				}
-				cSwapVec.clear();
-				cSwapVec = vector<int>(gridToPortalColVector_.begin(), gridToPortalColVector_.end());
-				gridToPortalColVector_.clear();
-			}
-
-			for(i = (int)cVec.size() - 1; i>=0; i--)
-			{
-				k = cVec[i];
-				for(j=0; (unsigned int)j<cSwapVec.size(); j++)
-				{
-					int v = cSwapVec[j];
-					if(v >= k)
-						cSwapVec[j] = v - 1;
-				}
-			}
-			gridToPortalColVector_ = vector<int>(cSwapVec.begin(), cSwapVec.end());
-		}
-	}
-	else
-	{
-		// Set the vector that will contain the order the
-		// grid columns will be shown
-		gridToPortalColVector_.clear();
-		gridColVisVector_.clear();
-		for (i = 0; i < nCols; i++)
-		{
-			gridToPortalColVector_.push_back(i);
-			gridColVisVector_.push_back(true);
-		}
-	}
-}
-
-void TeQtGrid::arrangeGridToPortalRowVector(int col)
-{
-	int i, p, pp;
-	string id, s, ss;
-
-	portal_->freeResult();
-	if (!portal_->query(sql_))
-	{
-		portal_->freeResult();
-		delete portal_;
-		portal_ = 0;
-		return;
-	}
-
-	if(isSortBy(col) == false)
-		return;
-
-	vector<int> cGridToPortal(gridToPortalRowVector_.begin(), gridToPortalRowVector_.end());
-	vector<string> cPortalToUnique(portalRow2UniqueIdVector_.begin(), portalRow2UniqueIdVector_.end());
-	gridToPortalRowVector_.clear();
-	portalRow2UniqueIdVector_.clear();
-
-	while (portal_->fetchRow())
-	{
-		id = portal_->getData(uniqueIdPos_);
-		if(id.empty())
-			id = portal_->getData(objectIdPos_);
-		portalRow2UniqueIdVector_.push_back(id);
-	}
-
-	vector<string>::iterator it;
-	for(i=0; (unsigned int)i<cGridToPortal.size(); i++)
-	{
-		p = cGridToPortal[i];
-		s = cPortalToUnique[p];
-		ss = portalRow2UniqueIdVector_[p];
-		if(s == ss)
-			gridToPortalRowVector_.push_back(p);
-		else
-		{
-			it = std::find(portalRow2UniqueIdVector_.begin(), portalRow2UniqueIdVector_.end(), s);
-			if(it != portalRow2UniqueIdVector_.end())
-				pp = it - portalRow2UniqueIdVector_.begin();
-
-			gridToPortalRowVector_.push_back(pp);
-		}
-	}
-}
-
-void TeQtGridItem::paint(QPainter* p, const QColorGroup& cg,
-						 const QRect& cr, bool selected)
-{
-    QColorGroup g(cg);
-	g.setColor( QColorGroup::Base, color_);
-	QTableItem :: paint(p, g, cr, selected);
-}
-
-
-
-
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+************************************************************************************/
+#include "TeQtGrid.h"
+#include "TeWaitCursor.h"
+#include "TeApplicationUtils.h"
+#include "TeExternalTheme.h"
+#include <qtable.h>
+#include <qcolordialog.h>
+#include <qmessagebox.h>
+#include <qapplication.h>
+#include <qdragobject.h>
+#include <algorithm>
+
+TeQtGrid::TeQtGrid(QWidget* parent, const char* name)
+	: QTable(parent, name)
+{
+	autoPromote_ = true;
+	gridX_ = -1;
+	gridY_ = -1;
+	iLine_ = -1;
+	fLine_ = -1;
+	iCol_ = -1;
+	fCol_ = -1;
+	gridWidth_  = -1;
+	gridHeight_ = -1;
+	portal_ = 0;
+	theme_ = NULL;
+	doRepaint_ = true;
+	doRefresh_ = false;
+	shiftKeyPressed_ = false;
+	lastLinePressed_ = -1;
+	verticalEdition_ = true;
+	rowToEdit_ = -1;
+	colToEdit_ = -1;
+	editing_ = false;
+	showGridInformation_ = true;
+	columnDragEnabled_ = false;
+	mousePressedOnHorizontalHeader_ = false;
+
+	setNumCols(0);
+	setNumRows(0);
+	setSelectionMode(QTable::Multi);
+
+	popupHorizHeader_ = new QPopupMenu;
+	popupVertHeader_ = new QPopupMenu;
+	popupViewport_ = new QPopupMenu;
+
+	horizontalHeader()->setAcceptDrops(true);
+
+	verticalHeader()->installEventFilter(this);
+	horizontalHeader()->installEventFilter(this);
+
+    connect(verticalHeader(), SIGNAL(released(int)),
+	     this, SLOT(mouseReleasedOnVerticalHeaderSlot(int))); // NOTE: QT send the pressed position in your argument
+
+	verticalHeader()->setResizeEnabled(false);
+}
+
+
+TeQtGrid::~TeQtGrid()
+{
+	if (portal_)
+	{
+		portal_->freeResult();
+		delete portal_;
+		portal_ = 0;
+	}
+	if (popupHorizHeader_)
+		delete popupHorizHeader_;
+	if (popupVertHeader_)
+		delete popupVertHeader_;
+	if (popupViewport_)
+		delete popupViewport_;
+}
+
+
+void TeQtGrid::init (TeAppTheme *appTheme)
+{
+	int i, j, numRows, nCols, gs;
+	int collectionNumCols = 0;
+	char buf[20];
+	string oid, uid;
+	hide();
+	clear();
+
+	if ((appTheme == 0) || (appTheme->getTheme()->type() > 2))
+		return;
+
+	TeAttrTableVector attrTables; 
+	
+	TeTheme* theme = appTheme->getSourceTheme();
+	if (theme == 0)
+		return;
+	theme->getAttTables(attrTables);
+	if (attrTables.size() == 0)
+		return;
+
+	TeWaitCursor wait;
+
+	theme_ = appTheme;
+	CT_ = theme->collectionTable();
+	CTE_ = theme->collectionAuxTable();
+	db_ = theme->layer()->database();
+	sqlJoin_ = theme->sqlGridJoin();
+
+	// Mount the vector of indexes (indexName_) from the tables
+	theme->getAttTables(tableVector_);
+	for (i = 0; i < (int)tableVector_.size(); ++i)
+	{
+		TeTable t = tableVector_[i];
+		if(t.tableType() == TeAttrStatic || t.tableType() == TeAttrEvent)
+		{
+			if(tableVector_[i].linkName().empty())
+				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].uniqueName());
+			else
+				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].linkName());
+		}
+		else if(t.tableType() != TeAttrExternal)
+		{
+			if(tableVector_[i].uniqueName().empty() == false)
+				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].uniqueName());
+			if(tableVector_[i].linkName().empty() == false)
+				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].linkName());
+		}
+		else
+		{
+			if(tableVector_[i].uniqueName().empty() == false)
+				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].uniqueName());
+			if(tableVector_[i].linkName().empty() == false)
+				indexVector_.push_back(tableVector_[i].name() + "." + tableVector_[i].linkName());
+			if(tableVector_[i].relatedAttribute().empty() == false)
+				indexVector_.push_back(tableVector_[i].relatedTableName() + "." + tableVector_[i].relatedAttribute());
+		}
+	}
+
+	TeAttributeList collAttrList;
+	db_->getAttributeList(CT_, collAttrList);
+	collectionNumCols = collAttrList.size();
+
+	if (portal_)
+	{
+		portal_->freeResult();
+		delete portal_;
+	}
+	portal_= db_->getPortal();
+
+	//read the objects and their legends
+	//from the collection table
+	orderBy_ = CTE_ + ".unique_id ";
+	sql_ = sqlJoin_ + " ORDER BY " + orderBy_ + "ASC ";
+	if (!portal_->query(sql_))
+	{
+		portal_->freeResult();
+		delete portal_;
+		portal_ = 0;
+		wait.resetWaitCursor();
+		return;
+	}
+
+	TeAttributeList extAttList;
+	db_->getAttributeList(CTE_, extAttList);
+
+	TeAttributeList& attrList = portal_->getAttributeList();
+	TeAttributeList::iterator it = attrList.begin();
+	int index = 0;
+	while(it!=attrList.end())
+	{
+		if(TeConvertToUpperCase((*it).rep_.name_)== TeConvertToUpperCase(CTE_+".unique_id"))
+			uniqueIdPos_ = index;
+		else if (TeConvertToUpperCase((*it).rep_.name_)== "UNIQUE_ID")
+			uniqueIdPos_ = index;
+		else if(TeConvertToUpperCase((*it).rep_.name_)== TeConvertToUpperCase(CTE_+".grid_status"))
+			gridStatusPos_ = index;
+		else if(TeConvertToUpperCase((*it).rep_.name_)== "GRID_STATUS")
+			gridStatusPos_ = index;
+		++it;
+		++index;
+	}
+
+	objectIdPos_ = attrList.size() - extAttList.size() - 6;
+	resultIdPos_ = attrList.size() - extAttList.size() - 1;
+	i = 0;
+	int status;
+	while (portal_->fetchRow())
+	{
+		uid = portal_->getData(uniqueIdPos_);
+		oid = portal_->getData(objectIdPos_);
+
+		//if(theme->getProductId() != TeEXTERNALTHEME)
+		if(appTheme->getTheme()->getProductId() == TeTHEME)
+		{
+			gs = atoi(portal_->getData(gridStatusPos_));
+			status = portal_->getInt(resultIdPos_);
+		}
+		else if(appTheme->getTheme()->getProductId() == TeEXTERNALTHEME)
+		{
+			std::map<std::string, int >::iterator it = theme_->getTheme()->getItemStatusMap().find(uid);
+			if( it != theme_->getTheme()->getItemStatusMap().end())
+				gs = it->second; 
+			else
+				gs = 0;
+
+			//std::map<std::string, int>::iterator it2 = theme_->getTheme()->getObjLegendMap().find(oid);
+			//if( it2 != theme_->getTheme()->getObjLegendMap().end())
+			std::map<std::string, int>::iterator it2 = theme_->getTheme()->getObjStatusMap().find(oid);
+			if( it2 != theme_->getTheme()->getObjStatusMap().end())
+				status = it->second;
+			else
+				status = 0;
+		}
+	
+		if(uid.empty())
+		{
+			unique2ObjectMap_[oid] = oid;
+			ObjectInfo	info;
+			info.status_ = status;
+			objectMap_[oid] = info;
+			portalRow2UniqueIdVector_.push_back(oid);
+		}
+		else
+		{
+			unique2ObjectMap_[uid] = oid;
+
+			if(objectMap_.find(oid) == objectMap_.end())
+			{
+				ObjectInfo	info;
+				info.uniqueMap_[uid] = gs;
+				info.status_ = status;
+				objectMap_[oid] = info;
+			}
+			else
+			{
+				objectMap_[oid].uniqueMap_[uid] = gs;
+
+				if(objectMap_[oid].status_ == 0 && gs > 0)
+					objectMap_[oid].status_ = gs;
+				else if(objectMap_[oid].status_ == 1 && gs == 2)
+					objectMap_[oid].status_ = 3;
+				else if(objectMap_[oid].status_ == 2 && gs == 1)
+					objectMap_[oid].status_ = 3;
+			}
+			portalRow2UniqueIdVector_.push_back(uid);
+		}
+		gridToPortalRowVector_.push_back(i);
+		++i;
+	}
+	numRows = i;
+	
+	//get the column names
+
+	nCols = theme->sqlAttList().size();
+	vector<string> colNamesVector;
+	for (j = 0; j < nCols; ++j)
+		colNamesVector.push_back(theme->sqlAttList()[j].rep_.name_);
+
+	doRepaint_ = false; // don�t repaint
+	setNumRows(numRows);
+	setNumCols(nCols);
+
+	for (i = 0; i < nCols; ++i)
+		horizontalHeader()->setLabel(i, colNamesVector[i].c_str());
+
+	// Set the vector that will contain the order the
+	// grid columns will be shown
+	for (i = 0; i < nCols; i++)
+	{
+		gridToPortalColVector_.push_back(i);
+		gridColVisVector_.push_back(true);
+	}
+
+	// Set the minimum width of the vertical header of the grid
+	sprintf(buf, "%d", numRows);
+	int minw = strlen(buf) + 1;
+	if (minw < 3)
+		minw = 3;
+	verticalHeader()->setMinimumWidth(minw*9); // supposing char width of 9 pixels
+	setLeftMargin(minw*9);
+
+
+	doRepaint_ = true; // do repaint
+	doRefresh_ = true; // do refresh
+
+	refresh();
+	int visibleCols = 0;
+	int scVal = horizontalScrollBar()->value();
+	for(i=0; i<numCols(); i++)
+	{
+		if(visibleWidth() < columnPos(i) - scVal)
+			break;
+		visibleCols++;
+	}
+
+	for (i = 0; i < visibleCols; ++i)
+		adjustColumn(i);
+	refresh();
+	emit gridChangedSignal();
+	show();
+	gridInformation();
+}
+
+
+void TeQtGrid::initPortal()
+{
+	TeWaitCursor wait;
+
+	int i, j;
+	int nCols = numCols();
+
+	doRepaint_ = false; // do not repaint
+
+	for (j = 0; j < nCols; ++j)
+		horizontalHeader()->removeLabel(j);
+
+	TeAttributeList collAttrList;
+	db_->getAttributeList(CT_, collAttrList);
+
+	portal_= db_->getPortal();
+
+	//read the objects and their legends
+	//from the collection table
+	if (!portal_->query(sql_))
+	{
+		portal_->freeResult();
+		delete portal_;
+		portal_ = 0;
+		wait.resetWaitCursor();
+		return;
+	}
+
+	TeAttrTableVector cTableVec = tableVector_;
+	tableVector_.clear();
+	
+	TeTheme* theme = theme_->getSourceTheme();
+	if (theme == 0)
+		return;
+	theme->getAttTables(tableVector_);
+
+	TeAttributeList extAttList;
+	db_->getAttributeList(CTE_, extAttList);
+
+	TeAttributeList& attrList = portal_->getAttributeList();
+	uniqueIdPos_ = attrList.size() - 2;
+	objectIdPos_ = attrList.size() - extAttList.size() - 6;
+	gridStatusPos_ = attrList.size() - 1;
+	resultIdPos_ = attrList.size() - extAttList.size() - 1;
+	
+	//get the column names
+	nCols = theme->sqlAttList().size();
+	vector<string> colNamesVector;
+	for (j = 0; j < nCols; ++j)
+		colNamesVector.push_back(theme->sqlAttList()[j].rep_.name_);
+
+	setNumCols(nCols);
+
+	arrangeColumns(cTableVec);	
+	for(i=0; (unsigned int)i<gridColVisVector_.size(); i++)
+		showColumn(i);
+
+	for (i = 0; i < nCols; ++i)
+	{
+		j = gridToPortalColVector_[i];
+		horizontalHeader()->setLabel(i, colNamesVector[j].c_str());
+	}
+	doRepaint_ = true; // do repaint
+	doRefresh_ = true; // do refresh
+
+	for(i=0; (unsigned int)i<gridColVisVector_.size(); i++)
+	{
+		bool b = gridColVisVector_[i];
+		if(b == false)
+			hideColumn(i);
+	}
+	refresh();
+	int visibleCols = 0;
+	int scVal = horizontalScrollBar()->value();
+	for(i=0; i<numCols(); i++)
+	{
+		if(visibleWidth() < columnPos(i) - scVal)
+			break;
+		visibleCols++;
+	}
+
+	for (i = 0; i < visibleCols; ++i)
+		adjustColumn(i);
+	refresh();
+	emit gridChangedSignal();
+	show();
+	gridInformation();
+}
+
+void TeQtGrid::updatePortalContents()
+{
+	TeWaitCursor wait;
+
+	if (portal_ == 0)
+	{
+		wait.resetWaitCursor();
+		return;
+	}
+
+	portal_->freeResult();
+
+	if (!portal_->query(sql_))
+	{
+		portal_->freeResult();
+		delete portal_;
+		portal_ = 0;
+	}
+}
+
+void TeQtGrid::clear()
+{
+	gridX_ = -1;
+	gridY_ = -1;
+	iLine_ = -1;
+	fLine_ = -1;
+	iCol_ = -1;
+	fCol_ = -1;
+	gridWidth_  = -1;
+	gridHeight_ = -1;
+	rowToEdit_ = -1;
+	colToEdit_ = -1;
+
+	shiftKeyPressed_ = false;
+	lastLinePressed_ = -1;
+
+	gridToPortalRowVector_.clear();
+	gridToPortalColVector_.clear();
+	objectMap_.clear();
+	unique2ObjectMap_.clear();
+	portalRow2UniqueIdVector_.clear();
+	gridColVisVector_.clear();
+	indexVector_.clear();
+	tableVector_.clear();
+
+	clearPortal();
+//	if (portal_)
+//	{
+//		portal_->freeResult();
+//		delete portal_;
+//		portal_ = 0;
+//	}
+	setNumRows(0);
+	setNumCols(0);
+}
+
+void TeQtGrid::clearPortal()
+{
+	if (portal_)
+	{
+		portal_->freeResult();
+		delete portal_;
+		portal_ = 0;
+	}
+}
+
+
+bool TeQtGrid::eventFilter(QObject *o, QEvent *e)
+{
+	if (doRepaint_ == false) // do not repaint
+		return true; // stop event
+	static int stx, sty;
+
+	if(o == horizontalHeader())
+	{
+		QMouseEvent *m = (QMouseEvent *)e;
+		int gridCol = columnAt(m->x() + contentsX());
+		if(portal_ && gridCol != -1)
+		{
+			TeTable table = findTable(gridCol);
+			QString msg = tr("Table:") + " ";
+			msg += table.name().c_str();
+			if(table.tableType() == TeAttrStatic)
+				msg += " - " + tr("Table type: TeAttrStatic");
+			else if(table.tableType() == TeAttrExternal)
+				msg += "  " + tr("Table type: TeAttrExternal");
+			else if(table.tableType() == TeAttrEvent)
+				msg += " - " + tr("Table type: TeAttrEvent");
+			else if(table.tableType() == TeFixedGeomDynAttr)
+				msg += " - " + tr("Table type: TeFixedGeomDynAttr");
+			else if(table.tableType() == TeDynGeomDynAttr)
+				msg += " - " + tr("Table type: TeDynGeomDynAttr");
+
+			TeAttributeList& AL = portal_->getAttributeList();
+			int pcol = gridToPortalColVector_[gridCol];
+			if(AL.size() > (unsigned int)pcol)
+			{
+				msg += " - " + tr("Column:");
+				msg += " ";
+				msg += AL[pcol].rep_.name_.c_str();
+				if(AL[pcol].rep_.type_ == TeSTRING)
+				{
+					msg += " - " + tr("Column type: TeSTRING");
+					msg += " - " + tr("Num char:");
+					msg += " ";
+					msg += Te2String(AL[pcol].rep_.numChar_).c_str();
+				}
+				else if(AL[pcol].rep_.type_ == TeREAL)
+					msg += "  " + tr("Column type: TeREAL");
+				else if(AL[pcol].rep_.type_ == TeINT)
+					msg += " - " + tr("Column type: TeINT");
+				else if(AL[pcol].rep_.type_ == TeDATETIME)
+					msg += " - " + tr("Column type: TeDATETIME");
+				if(isIndex(pcol))
+					msg += " - " + tr("Column is not editable");
+				else
+					msg += " - " + tr("Column is editable");
+			}
+
+			displayGridInformation(msg);
+		}
+		
+		if (e->type() == QEvent::MouseButtonPress)
+		{
+			stx = sty = -1;
+			if (m->button() == RightButton)
+			{
+				if(gridCol < 0)
+					return false;
+
+				int portalColToPopup = gridToPortalColVector_[gridCol];
+				popupHorizHeader_->move(m->globalPos().x(), m->globalPos().y());
+				emit horizHeaderSignal(portalColToPopup);
+				return true;
+			}
+			if (m->button() == LeftButton)
+			{
+				stx = contentsX();
+				sty = contentsY();
+				if(sty != 0)
+					mousePressedOnHorizontalHeader_ = true;
+				int p = horizontalHeader()->sectionPos(gridCol);
+				int ss = horizontalHeader()->sectionSize(gridCol);
+				int x = m->x() + horizontalHeader()->offset();
+				if(abs(x-p) <= 3 || abs(x-(p+ss)) <= 3)
+					return false;
+				columnDragEnabled_ = true;
+				return false;
+			}
+		}
+		else if(e->type() == QEvent::DragEnter) {
+			QDragEnterEvent *dg = (QDragEnterEvent *)e;
+			dg->accept(QTextDrag::canDecode(dg));
+			return true;
+		}
+		else if(e->type() == QEvent::DragMove) {
+			return true;
+		}
+		else if(e->type() == QEvent::MouseMove) {
+			if (columnDragEnabled_)
+			{
+				columnDragEnabled_ = false;
+				clearSelection(true);
+				setSelectionMode(QTable::NoSelection);
+				string t = "swap:" + Te2String(gridCol);
+				QTextDrag* tDrag = new QTextDrag(t.c_str(), this, "gridswap");
+				tDrag->drag();
+			}
+			return false;
+		}
+		else if(e->type() == QEvent::Drop) {
+			QDragEnterEvent *dg = (QDragEnterEvent *)e;
+			dg->accept(QTextDrag::canDecode(dg));
+			QDropEvent *dp = (QDropEvent *)e;
+
+			QString tx;
+			string dragText;
+			if(QTextDrag::decode(dp, tx))
+				dragText = tx.latin1();
+
+			string fName = dragText;
+			int f = fName.find("-fieldName:");
+			if(f >= 0)
+			{
+				fName = fName.substr(f+strlen("-fieldName:"));
+
+				string table = dragText;
+				table = table.substr(0, f);
+				f = table.find("table:");
+				if(f == 0)
+					table = table.substr(strlen("table:"));
+
+				int col = columnAt(dg->pos().x() + contentsX());
+				string dropName;
+				if (col >= 0)				
+					dropName = horizontalHeader()->label(col).latin1();
+				emit linkTable(table, fName, dropName);
+			}
+			else // swap column
+			{
+//				f = fName.find("swap:", string::npos);
+				f = fName.find("swap:");
+				if(f >= 0)
+				{
+					TeWaitCursor wait;
+					string s = fName;
+					s = s.substr(strlen("swap:"));
+					int col1 = atoi(s.c_str());
+					int col2 = columnAt(dg->pos().x() + contentsX());
+					if(col1 < col2)
+						for(int i=col1; i<col2; i++)
+							swapColumns(i, i+1);
+					else
+						for(int i=col1; i>col2; i--)
+							swapColumns(i, i-1);
+					int w1 = columnWidth(col1);
+					int w2 = columnWidth(col2);
+					setColumnWidth(col1, w2);
+					setColumnWidth(col2, w1);
+					refresh();
+					QPoint p = dg->pos();
+					QMouseEvent* e = new QMouseEvent(QEvent::MouseButtonRelease, p, Qt::LeftButton, Qt::LeftButton);
+					QApplication::postEvent(horizontalHeader(), e);
+				}
+			}
+			return true;
+		}
+		else if (e->type() == QEvent::MouseButtonRelease)
+		{
+			columnDragEnabled_ = false;
+			setSelectionMode(QTable::Multi);
+			if(stx > -1 && sty > -1)
+				setContentsPos(stx, sty);
+			return false;
+		}
+	}
+	else if(o == verticalHeader())
+	{
+		if (e->type() == QEvent::MouseButtonDblClick)
+		{
+			QMouseEvent *m = (QMouseEvent *)e;
+			if (m->button() == LeftButton)
+			{
+				int lin = rowAt(m->y() + contentsY());
+				if (lin >= 0)
+				{
+					emit vertHeaderLeftDblClickSignal(lin);
+				}
+			}
+		}
+		else if (e->type() == QEvent::MouseButtonPress)
+		{
+			QMouseEvent *m = (QMouseEvent *)e;
+			if (m->button() == LeftButton)
+			{
+				stx = contentsX();
+				sty = contentsY();
+				return false;
+			}
+			else if (m->button() == RightButton)
+			{
+				int lin = rowAt(m->y() + contentsY());
+				if (lin < 0)
+					return false;
+
+				popupVertHeader_->move(m->globalPos().x(), m->globalPos().y());
+				emit vertHeaderSignal(lin);
+				return true;
+			}
+		}
+		else if (e->type() == QEvent::MouseButtonRelease)
+		{
+			QMouseEvent *m = (QMouseEvent *)e;
+			if (m->button() == LeftButton)
+			{
+				if (m->state() & Qt::ShiftButton)
+					shiftKeyPressed_ = true;
+				else
+					shiftKeyPressed_ = false;
+				int lin = m->y();
+				dragLineReleased_ = rowAt(lin + contentsY());
+				setContentsPos(stx, sty);
+			}
+			return false;
+		}
+	}
+	else if (o == viewport())
+	{
+		if (e->type() == QEvent::MouseButtonPress)
+		{
+			if(rowToEdit_ > -1 && colToEdit_ > -1)
+				endEdit(rowToEdit_, colToEdit_, true, true);
+			rowToEdit_ = -1;
+			colToEdit_ = -1;
+			editing_ = false;
+
+			QMouseEvent *m = (QMouseEvent *)e;
+			if (m->button() == RightButton)
+			{
+				popupViewport_->move(m->globalPos().x(), m->globalPos().y());
+				emit viewportSignal();
+				return true;
+			}
+		}
+		else if (e->type() == QEvent::MouseButtonDblClick)
+		{
+			if(theme_->getTheme()->type() != TeTHEME)
+				return true;
+
+			QMouseEvent *m = (QMouseEvent *)e;
+			if (m->button() == LeftButton)
+			{
+				int col = gridToPortalColVector_[currentColumn()];
+				if(isIndex(col))
+					return true;
+
+				refresh();
+				setEditMode(QTable::Editing, currentRow(), currentColumn());
+				beginEdit(currEditRow(), currEditCol(), false);
+				rowToEdit_ = currEditRow();
+				colToEdit_ = currEditCol();
+				return false;
+			}
+		}
+		else if (e->type() == QEvent::Enter)
+			gridInformation();
+	}
+	else
+	{
+		if (e->type() == QEvent::KeyPress)
+		{
+			if(rowToEdit_ == -1 || colToEdit_ == -1)
+				return true;
+
+			QKeyEvent *k = (QKeyEvent*)e;
+			if (k->state() & Qt::ControlButton)
+			{
+				if(k->key() == Qt::Key_PageDown)
+				{
+					scrollToNextPointedObjectSlot();
+					return true;
+				}
+				else if(k->key() == Qt::Key_PageUp)
+				{
+					scrollToPrevPointedObjectSlot();
+					return true;
+				}
+			}
+#ifdef WIN32
+			else if (k->state() & Qt::AltButton)
+#else
+			else if (k->state() & (Qt::AltButton | Qt::ControlButton))
+#endif
+			{
+				if(k->key() == Qt::Key_PageDown)
+				{
+					scrollToNextQueriedObjectSlot();
+					return true;
+				}
+				else if(k->key() == Qt::Key_PageUp)
+				{
+					scrollToPrevQueriedObjectSlot();
+					return true;
+				}
+			}
+			else if (k->key() == Qt::Key_Return)
+			{
+				editing_ = true;
+				endEdit(rowToEdit_, colToEdit_, true, true);
+				goToEditNewCell();
+				return true;
+			}
+		}
+	}
+
+	return QTable::eventFilter(o, e);
+}
+
+
+void TeQtGrid::mouseReleasedOnVerticalHeaderSlot(int lin)     
+{
+	TeWaitCursor wait;
+	string uid, oid;
+	int i, begin, end;
+	set<string> drawSet;
+	
+	if (shiftKeyPressed_ == false) // single toggle
+	{
+		portal_->fetchRow(gridToPortalRowVector_[lin]);
+		uid = portal_->getData(uniqueIdPos_);
+		oid = portal_->getData(objectIdPos_);
+		drawSet.insert(oid);
+		ObjectInfo& info = objectMap_[oid];
+		changeObjectStatus(info, uid, "pointing");
+	}
+	else	// set or reset grid lines (shift and pointing operation)
+	{
+		if (lastLinePressed_ != -1)
+		{
+			portal_->fetchRow(gridToPortalRowVector_[lastLinePressed_]);
+			uid = portal_->getData(uniqueIdPos_);
+			oid = portal_->getData(objectIdPos_);
+			ObjectInfo& info = objectMap_[oid];
+			int pointed = info.status_  & 0x1;
+			if(uid.empty() == false)
+				pointed = info.uniqueMap_[uid] & 0x1;
+
+			if (lin > lastLinePressed_)
+			{
+				begin = lastLinePressed_ + 1;
+				end = lin;
+			}
+			else if (lin < lastLinePressed_)
+			{
+				begin = lin;
+				end = lastLinePressed_ - 1;
+			}
+			else
+				begin = end = lin;
+
+			for (i = begin ; i <= end; ++i)
+			{
+				portal_->fetchRow(gridToPortalRowVector_[i]);
+				uid = portal_->getData(uniqueIdPos_);
+				oid = portal_->getData(objectIdPos_);
+				ObjectInfo& info = objectMap_[oid];
+				changeObjectStatus(info, uid, "shiftAndPointing", pointed);
+				drawSet.insert(oid);
+			}
+		}
+	}
+
+	if (lin != dragLineReleased_)
+	{
+		if (dragLineReleased_ == -1)
+		{
+			int ini, fim;
+			for (ini = iLine_; ini <= fLine_; ini++)
+				if (isRowSelected(ini, true))
+					break;
+
+			for (fim = fLine_; fim >= iLine_; fim--)
+				if (isRowSelected(fim, true))
+					break;
+
+			if (fim > lin)
+				dragLineReleased_ = fim;
+			else
+				dragLineReleased_ = ini;
+		}
+		portal_->fetchRow(gridToPortalRowVector_[lin]);
+		uid = portal_->getData(uniqueIdPos_);
+		oid = portal_->getData(objectIdPos_);
+		ObjectInfo& info = objectMap_[oid];
+		int pointed = info.status_  & 0x1;
+		if(uid.empty() == false)
+			pointed = info.uniqueMap_[uid] & 0x1;
+
+		if (lin < dragLineReleased_)
+		{
+			begin = lin + 1;
+			end = dragLineReleased_;
+		}
+		else
+		{
+			begin = dragLineReleased_;
+			end = lin - 1;
+		}
+
+		for (i = begin ; i <= end; ++i)
+		{
+			portal_->fetchRow(gridToPortalRowVector_[i]);
+			uid = portal_->getData(uniqueIdPos_);
+			oid = portal_->getData(objectIdPos_);
+			ObjectInfo& info = objectMap_[oid];
+			changeObjectStatus(info, uid, "shiftAndPointing", pointed);
+			drawSet.insert(oid);
+		}
+	}
+
+	lastLinePressed_ = lin;
+	clearSelection(true);
+
+	refresh();
+	if (saveObjectStatus(theme_, drawSet, objectMap_) == false)
+	{
+		QMessageBox::critical(this, tr("Error"),
+			tr("Fail to update the \"c_object_status\" and \"grid_status\" fields in the collection table!"));
+		return;
+	}
+	emit putColorOnObject(theme_, drawSet);
+	gridInformation();
+}
+
+
+void TeQtGrid::putColorOnGrid(set<string> uidSet, set<string> oidSet, string operation, string /* attrQuery */)     
+{
+	//if(uidSet.empty() && oidSet.empty())
+	//	return;
+
+	int	x, y;
+	string oid, uid;
+	set<string> drawSet;
+	set<string>::iterator it, nit;
+	list<string>::iterator vit;
+	map<string, int>::iterator uit;
+	map<string, ObjectInfo>::iterator oit;
+	set<string> auxSet;
+
+	for (it = oidSet.begin(); it != oidSet.end(); ++it)
+	{
+		ObjectInfo& info = objectMap_[*it];
+		if(info.uniqueMap_.size())
+		{
+			for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+				uidSet.insert(uit->first);
+		}
+		else
+			auxSet.insert(*it);
+	}
+	oidSet = auxSet;
+
+	if (operation == "newQuery" || operation == "filterQuery" || operation == "addQuery")
+	{
+		//get the unique ids that were queried before this query
+		list<string> oldUQueriedList, oldOQueriedList;
+		for(oit =  objectMap_.begin(); oit != objectMap_.end(); oit++)
+		{
+			ObjectInfo& info = oit->second;
+			if(info.uniqueMap_.size())
+			{
+				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+				{
+					if(uit->second & 0x2)
+						oldUQueriedList.push_back(uit->first);
+				}
+			}
+			else
+			{
+				if(info.status_ & 0x2)
+					oldOQueriedList.push_back(oit->first);
+			}
+		}
+
+		if(operation == "newQuery")
+		{
+			// remove intersection (new and old set)
+			vit = oldUQueriedList.begin();
+			while(vit != oldUQueriedList.end())
+			{
+				if((nit = uidSet.find(*vit)) != uidSet.end())
+				{
+					vit = oldUQueriedList.erase(vit);
+					uidSet.erase(nit);
+				}
+				else
+					vit++;
+			}
+			vit = oldOQueriedList.begin();
+			while(vit != oldOQueriedList.end())
+			{
+				if((nit = oidSet.find(*vit)) != oidSet.end())
+				{
+					vit = oldOQueriedList.erase(vit);
+					oidSet.erase(nit);
+				}
+				else
+					vit++;
+			}
+
+			// reset old queried
+			for(vit = oldUQueriedList.begin(); vit != oldUQueriedList.end(); vit++)
+			{
+				oid = unique2ObjectMap_[*vit];
+				ObjectInfo& info = objectMap_[oid];
+				info.uniqueMap_[*vit] &= 0x1;
+				drawSet.insert(oid);
+			}
+			for(vit = oldOQueriedList.begin(); vit != oldOQueriedList.end(); vit++)
+			{
+				oid = *vit;
+				ObjectInfo& info = objectMap_[oid];
+				info.status_ &= 0x1;
+				drawSet.insert(oid);
+			}
+
+			// set new queried
+			for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
+			{
+				oid = unique2ObjectMap_[*nit];
+				ObjectInfo& info = objectMap_[oid];
+				info.uniqueMap_[*nit] |= 0x2;
+				drawSet.insert(oid);
+			}
+			for(nit = oidSet.begin(); nit != oidSet.end(); nit++)
+			{
+				oid = *nit;
+				ObjectInfo& info = objectMap_[oid];
+				info.status_ |= 0x2;
+				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+					uit->second |= 0x2;
+				drawSet.insert(oid);
+			}
+		}
+		else if(operation == "filterQuery")
+		{
+			// remove intersection (old set)
+			for (nit = uidSet.begin(); nit != uidSet.end(); nit++)
+				if((vit = std::find(oldUQueriedList.begin(), oldUQueriedList.end(), *nit)) != oldUQueriedList.end())
+					oldUQueriedList.erase(vit);
+			for (nit = oidSet.begin(); nit != oidSet.end(); nit++)
+				if((vit = std::find(oldOQueriedList.begin(), oldOQueriedList.end(), *nit)) != oldOQueriedList.end())
+					oldOQueriedList.erase(vit);
+
+			// reset old queried
+			for(vit = oldUQueriedList.begin(); vit != oldUQueriedList.end(); vit++)
+			{
+				oid = unique2ObjectMap_[*vit];
+				ObjectInfo& info = objectMap_[oid];
+				info.uniqueMap_[*vit] &= 0x1;
+				drawSet.insert(oid);
+			}
+			for(vit = oldOQueriedList.begin(); vit != oldOQueriedList.end(); vit++)
+			{
+				oid = *vit;
+				ObjectInfo& info = objectMap_[oid];
+				info.status_ &= 0x1;
+				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+					uit->second &= 0x1;
+				drawSet.insert(oid);
+			}
+		}
+		else if(operation == "addQuery")
+		{
+			// remove intersection (new set)
+			for (vit = oldUQueriedList.begin(); vit != oldUQueriedList.end(); vit++)
+				if((nit = uidSet.find(*vit)) != uidSet.end())
+					uidSet.erase(nit);
+			for (vit = oldOQueriedList.begin(); vit != oldOQueriedList.end(); vit++)
+				if((nit = oidSet.find(*vit)) != oidSet.end())
+					oidSet.erase(nit);
+
+			// set new queried
+			for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
+			{
+				oid = unique2ObjectMap_[*nit];
+				ObjectInfo& info = objectMap_[oid];
+				info.uniqueMap_[*nit] |= 0x2;
+				drawSet.insert(oid);
+			}
+			for(nit = oidSet.begin(); nit != oidSet.end(); nit++)
+			{
+				oid = *nit;
+				ObjectInfo& info = objectMap_[oid];
+				info.status_ |= 0x2;
+				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+					uit->second |= 0x2;
+				drawSet.insert(oid);
+			}
+		}
+	}
+	else if (operation == "newPointing" || operation == "togglePointing" || operation == "addPointing")
+	{
+		list<string> oldUPointedList, oldOPointedList;
+		if(operation != "togglePointing")
+		{
+			//get the object ids that were pointed before this pointing
+			for(oit =  objectMap_.begin(); oit != objectMap_.end(); oit++)
+			{
+				ObjectInfo& info = oit->second;
+				if(info.uniqueMap_.size())
+				{
+					for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+					{
+						if(uit->second & 0x1)
+							oldUPointedList.push_back(uit->first);
+					}
+				}
+				else
+				{
+					if(info.status_ & 0x1)
+						oldOPointedList.push_back(oit->first);
+				}
+			}
+		}
+
+		if(operation == "newPointing")
+		{
+			// remove intersection (new and old set)
+			vit = oldUPointedList.begin();
+			while(vit != oldUPointedList.end())
+			{
+				if((nit = uidSet.find(*vit)) != uidSet.end())
+					vit = oldUPointedList.erase(vit);
+				else
+					vit++;
+			}
+			vit = oldOPointedList.begin();
+			while(vit != oldOPointedList.end())
+			{
+				if((nit = oidSet.find(*vit)) != oidSet.end())
+					vit = oldOPointedList.erase(vit);
+				else
+					vit++;
+			}
+
+			// reset old pointeds
+			for(vit = oldUPointedList.begin(); vit != oldUPointedList.end(); vit++)
+			{
+				oid = unique2ObjectMap_[*vit];
+				ObjectInfo& info = objectMap_[oid];
+				info.uniqueMap_[*vit] &= 0x2;
+				drawSet.insert(oid);
+			}
+			for(vit = oldOPointedList.begin(); vit != oldOPointedList.end(); vit++)
+			{
+				oid = *vit;
+				ObjectInfo& info = objectMap_[oid];
+				info.status_ &= 0x2;
+				drawSet.insert(oid);
+			}
+
+			// set new pointed
+			for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
+			{
+				oid = unique2ObjectMap_[*nit];
+				ObjectInfo& info = objectMap_[oid];
+				info.uniqueMap_[*nit] |= 0x1;
+				drawSet.insert(oid);
+			}
+			for(nit = oidSet.begin(); nit != oidSet.end(); nit++)
+			{
+				oid = *nit;
+				ObjectInfo& info = objectMap_[oid];
+				info.status_ |= 0x1;
+				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+					uit->second |= 0x1;
+				drawSet.insert(oid);
+			}
+		}
+		else if(operation == "togglePointing")
+		{
+			// toggle status (new pointed ids)
+			nit = oidSet.begin();
+			if(nit != oidSet.end())
+			{
+				oid = *nit;
+				ObjectInfo& info = objectMap_[oid];
+				int status = info.status_;
+
+				if(status & 0x1) // reset new pointed
+				{
+					while(nit != oidSet.end())
+					{
+						oid = *nit;
+						ObjectInfo& info = objectMap_[oid];
+						info.status_ &= 0x2;
+						for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+							uit->second &= 0x2;
+						nit++;
+						drawSet.insert(oid);
+					}
+				}
+				else // set new pointed
+				{
+					while(nit != oidSet.end())
+					{
+						oid = *nit;
+						ObjectInfo& info = objectMap_[oid];
+						info.status_ |= 0x1;
+						for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+							uit->second |= 0x1;
+						nit++;
+						drawSet.insert(oid);
+					}
+				}
+			}
+
+			nit = uidSet.begin();
+			if(nit != uidSet.end())
+			{
+				oid = unique2ObjectMap_[*nit];
+				ObjectInfo& info = objectMap_[oid];
+				int status = info.status_;
+
+				if(status & 0x1) // reset new pointed
+				{
+					for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
+					{
+						oid = unique2ObjectMap_[*nit];
+						ObjectInfo& info = objectMap_[oid];
+						info.uniqueMap_[*nit] &= 0x2;
+						drawSet.insert(oid);
+					}
+				}
+				else // set new pointed
+				{
+					for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
+					{
+						oid = unique2ObjectMap_[*nit];
+						ObjectInfo& info = objectMap_[oid];
+						info.uniqueMap_[*nit] |= 0x1;
+						drawSet.insert(oid);
+					}
+				}
+			}
+		}
+		else if(operation == "addPointing")
+		{
+			// remove intersection (new pointed ids)
+ // not erase (not optimize) - graphic plot need selectd objects
+
+			// set new pointeds
+			for(nit = uidSet.begin(); nit != uidSet.end(); nit++)
+			{
+				oid = unique2ObjectMap_[*nit];
+				ObjectInfo& info = objectMap_[oid];
+				info.uniqueMap_[*nit] |= 0x1;
+				drawSet.insert(oid);
+			}
+			for(nit = oidSet.begin(); nit != oidSet.end(); nit++)
+			{
+				oid = *nit;
+				ObjectInfo& info = objectMap_[oid];
+				info.status_ |= 0x1;
+				for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+					uit->second |= 0x1;
+				drawSet.insert(oid);
+			}
+		}
+	}
+
+	for(it = drawSet.begin(); it != drawSet.end(); it++)
+	{
+		oid = *it;
+		ObjectInfo& info = objectMap_[oid];
+		if(info.uniqueMap_.size())
+		{
+			set<int> statusSet;
+			uit = info.uniqueMap_.begin();
+			uid = uit->first;
+
+			while(uit != info.uniqueMap_.end())
+				statusSet.insert(uit++->second);
+			if(statusSet.find(3) != statusSet.end())
+				info.status_ = 3;
+			else if(statusSet.find(2) != statusSet.end() && statusSet.find(1) != statusSet.end())
+				info.status_ = 3;
+			else if(statusSet.find(2) != statusSet.end() && statusSet.find(1) == statusSet.end())
+				info.status_ = 2;
+			else if(statusSet.find(2) == statusSet.end() && statusSet.find(1) != statusSet.end())
+				info.status_ = 1;
+			else
+				info.status_ = 0;
+		}
+	}
+
+	// If it is not a query operation (i.e., a pointing operation), scroll the grid if the
+	// single object is not visible in the grid.
+	if (operation == "togglePointing")
+	{
+		vector<string>::iterator itpos;
+		if(uid.empty() == false)
+			itpos = std::find(portalRow2UniqueIdVector_.begin(), portalRow2UniqueIdVector_.end(), uid);
+		else
+			itpos = std::find(portalRow2UniqueIdVector_.begin(), portalRow2UniqueIdVector_.end(), oid);
+		int pos = 0;
+		if(itpos != portalRow2UniqueIdVector_.end())
+			pos = itpos - portalRow2UniqueIdVector_.begin();
+
+		vector<int>::iterator itpos2;
+		itpos2 = std::find(gridToPortalRowVector_.begin(),gridToPortalRowVector_.end(), pos);
+		pos = itpos2 - gridToPortalRowVector_.begin();
+
+		if (pos <= iLine_ || pos >= fLine_)
+		{
+			// if editing, end edit to enable vertical scrolling
+			if(editing_ && (rowToEdit_ > -1 && colToEdit_ > -1))
+			{
+				endEdit(rowToEdit_, colToEdit_, true, true);
+				rowToEdit_ = -1;
+				colToEdit_ = -1;
+				editing_ = false;
+			}
+			doRepaint_ = true;
+			x = contentsX();
+			y = rowPos(pos);
+			setContentsPos(x, y);
+		}
+	}
+
+	clearSelection(true);
+	refresh();
+
+	if (saveObjectStatus(theme_, drawSet, objectMap_) == false)
+	{
+		//QMessageBox::critical(this, tr("Error"),
+		//	tr("Fail to update the \"c_object_status\" and \"grid_status\" fields in the collection table!"));
+		//return;
+	}
+
+	emit putColorOnObject(theme_, drawSet);
+
+	if(autoPromote_)
+	{
+		// if editing, end edit to enable vertical scrolling
+		if(editing_ && (rowToEdit_ > -1 && colToEdit_ > -1))
+		{
+			endEdit(rowToEdit_, colToEdit_, true, true);
+			rowToEdit_ = -1;
+			colToEdit_ = -1;
+			editing_ = false;
+		}
+		if (operation == "newPointing" || operation == "addPointing")
+			promotePointedObjectsSlot();
+		else if(operation == "newQuery" || operation == "addQuery" || operation == "filterQuery")
+			promoteQueriedObjectsSlot();
+	}
+
+	gridInformation();
+}
+
+
+void TeQtGrid::drawContents (QPainter *qp, int clipx, int clipy, int clipw, int cliph)
+{
+	if(doRepaint_ == true)
+	{
+		update();
+		QTable :: drawContents(qp, clipx, clipy, clipw, cliph);
+	}
+}
+
+
+void TeQtGrid::update()
+{
+	if(portal_ == 0)
+		return;
+	int ie = currEditRow();
+	int je = currEditCol();
+	QString vale;
+	if(ie >= 0 && je >= 0)
+	{
+		setCellContentFromEditor(ie, je);
+		vale = text(ie, je);
+		if(vale.isEmpty())
+		{
+			int pos = gridToPortalRowVector_[ie];
+			if(portal_->fetchRow(pos))
+			{
+				string s = portal_->getData(gridToPortalColVector_[je]);
+				if(s.empty() == false)
+					vale = s.c_str();
+			}
+		}
+	}
+
+	int	i, j, pos;
+
+	int gridY = contentsY();
+	int gridX = contentsX();
+
+	if(mousePressedOnHorizontalHeader_ && gridY == 0)
+	{
+		setContentsPos(gridX_, gridY_);
+		gridY = gridY_;
+		mousePressedOnHorizontalHeader_ = false;
+	}
+
+	int gridHeight = visibleHeight(); 
+	int gridWidth = visibleWidth(); 
+
+	if (doRefresh_ == false && 
+		gridX_ == gridX && gridY_ == gridY &&
+		gridHeight_ == gridHeight && 
+		gridWidth_ == gridWidth)
+		return;
+
+	gridX_ = gridX;
+	gridY_ = gridY;
+	gridHeight_ = gridHeight;
+	gridWidth_ = gridWidth;
+		
+// clear cells
+	doRepaint_ = false; // do not repaint
+	if (iLine_ >= 0 && iCol_ >= 0)
+	{
+		for (i = iLine_; i <= fLine_; ++i)
+		{
+			for (j = iCol_; j <= fCol_; ++j)
+			{
+				if(item(i, j))
+					clearCell(i, j);
+			}
+		}
+	}
+
+	iLine_ = rowAt(gridY_);
+	iCol_  = columnAt(gridX_);
+	visibleLines_ = rowAt(gridHeight_);
+	if (visibleLines_ == -1)
+		visibleLines_ = numRows();
+
+	visibleCols_ = 0;
+	int scVal = horizontalScrollBar()->value();
+	for(i=iCol_; i<numCols(); i++)
+	{
+		if(gridWidth_ < columnPos(i) - scVal)
+			break;
+		visibleCols_++;
+	}
+
+	if (iLine_ < 0 || iCol_ < 0)
+	{
+		gridX_ = gridY_ = iLine_ = fLine_ = iCol_ = fCol_ = -1;
+		doRepaint_ = true;
+		return;
+	}
+
+	fLine_ = iLine_ + visibleLines_;
+	if (fLine_ > numRows() - 1)
+		fLine_ = numRows() - 1;
+	fCol_ = iCol_ + visibleCols_ - 1;
+
+	int status;
+	string st, oid, uid;
+	QColor qc;
+	TeColor color;
+	for (i = iLine_; i <= fLine_ ; ++i)
+	{
+		pos = gridToPortalRowVector_[i];
+		if (portal_->fetchRow(pos) == false)
+			return;
+
+		oid = portal_->getData(objectIdPos_);
+		uid = portal_->getData(uniqueIdPos_);
+
+		ObjectInfo& info = objectMap_[oid];
+		if(uid.empty() == false)
+			status = info.uniqueMap_[uid];
+		else
+			status = info.status_;
+
+		if (status == 1)
+			color = (theme_->getTheme())->pointingLegend().visual(TePOLYGONS)->color();
+		else if (status == 2)
+			color = (theme_->getTheme())->queryLegend().visual(TePOLYGONS)->color();
+		else if (status == 3)
+			color = (theme_->getTheme())->queryAndPointingLegend().visual(TePOLYGONS)->color();
+		qc = QColor(color.red_,color.green_,color.blue_);
+
+		for (j = iCol_; j <= fCol_; ++j)
+		{
+			if (gridColVisVector_[j] == true)
+			{
+				st = portal_->getData(gridToPortalColVector_[j]);
+				if(status != 0)
+				{
+					TeQtGridItem *ti;
+					if(ie == i && je == j)
+						ti = new TeQtGridItem( this, QTableItem::OnTyping, vale);
+					else
+						ti = new TeQtGridItem( this, QTableItem::OnTyping, st.c_str());
+
+					ti->setColor(qc);
+					setItem(i, j, ti );
+				}
+				else
+				{
+					if(ie == i && je == j)
+						setText(i, j, vale);
+					else
+						setText(i, j, st.c_str());
+				}
+			}
+
+			if(i == fLine_ && j == fCol_- 1)
+			{
+				doRepaint_ = true; // do repaint
+				doRefresh_ = true;
+				updateCell(i, j);
+			}
+		}
+	}
+
+	doRepaint_ = true; // do repaint
+	doRefresh_ = false;
+
+	if(ie >= 0 && je >= 0)
+		endEdit(ie, je, true, true);
+
+	if(rowToEdit_ > -1 && colToEdit_ > -1 && editing_)
+	{
+		setEditMode(QTable::Editing, rowToEdit_, colToEdit_);
+		beginEdit(rowToEdit_, colToEdit_, false);
+	}
+}
+
+
+void TeQtGrid::adjustColumns()
+{
+	int	i;
+	for (i = 0; i < numCols(); ++i)
+		adjustColumn(i);
+	refresh();
+}
+
+
+void TeQtGrid::swapColumns(int col1, int col2)
+{
+	int	nc = numCols();
+	vector<int>	cols;
+	int	n;
+
+	if (col1 == -1 || col2 == -1)
+	{
+		for(n = 0; n < nc; n++)
+			if (isColumnSelected(n, true) == true)
+				cols.push_back(n);
+		if(cols.size() != 2)
+		{
+			QMessageBox::warning(this, tr("Warning"),
+				tr("Select the two grid columns to be exchanged!"));
+			return;
+		}
+		col1 = cols[0];
+		col2 = cols[1];
+	}
+
+	int w1 = columnWidth(col1);
+	int w2 = columnWidth(col2);
+
+	int c1 = gridToPortalColVector_[col1];
+	int c2 = gridToPortalColVector_[col2];
+
+	gridToPortalColVector_[col1] = c2;
+	gridToPortalColVector_[col2] = c1;
+
+	QTable::swapColumns(col1, col2);
+	for (n=0; n<nc; n++)
+	{
+		string st = portal_->getAttribute(gridToPortalColVector_[n]).rep_.name_;
+		horizontalHeader()->setLabel(n, st.c_str());
+	}
+
+	setColumnWidth(col1, w2);
+	setColumnWidth(col2, w1);
+
+	refresh();
+}
+
+
+void TeQtGrid::setVisColumn(bool vis, int col)
+{
+	unsigned int nc = numCols();
+	unsigned int n;
+	vector<int>	cols;
+
+	if (vis == false)
+	{
+		if (col == -1)
+		{
+			for(n=0; n<nc; n++)
+				if (isColumnSelected(n, true) == true)
+					cols.push_back(n);
+			if(cols.size() == 0)
+			{
+				QMessageBox::warning(this, tr("Warning"),
+					tr("Select the grid column(s) to be hidden!"));
+				return;
+			}
+		}
+		else
+			cols.push_back(col);
+
+		for(n=0; n<cols.size(); n++)
+		{
+			showColumn(cols[n]); // it is a BUG in the QT 3.2.0 
+			hideColumn(cols[n]);
+			gridColVisVector_[cols[n]] = false;
+		}
+	}
+	else
+	{
+		for(n=0; n<nc; n++)
+		{
+			if(gridColVisVector_[n] == false)
+			{
+				gridColVisVector_[n] = true;
+				showColumn(n);
+				cols.push_back(n);
+			}
+		}
+	}
+	refresh();
+}
+
+void TeQtGrid::refresh()
+{
+	doRefresh_ = true;
+	repaint();
+	update();
+}
+
+
+void TeQtGrid::promotePointedObjectsSlot()
+{
+	TeWaitCursor	wait;
+	gridToPortalRowVector_.clear();
+	string	oid, uid;
+	TeDatabasePortal* portal = db_->getPortal();
+	vector<int> notByPointingVector;
+
+	unsigned int i=0;
+    int gs;
+	if (portal->query(sql_))
+	{
+		while (portal->fetchRow())
+		{
+			if(theme_->getTheme()->getProductId() == TeTHEME)
+			{
+				gs = atoi(portal->getData(gridStatusPos_));
+				if(gs &= 0x1)
+					gridToPortalRowVector_.push_back(i);
+				else
+					notByPointingVector.push_back(i);
+			}
+			else if(theme_->getTheme()->getProductId() == TeEXTERNALTHEME)
+			{
+				uid = portal->getData(uniqueIdPos_);
+				if(uid.empty() == false)
+				{
+					std::map<std::string, int >::iterator it = theme_->getTheme()->getItemStatusMap().find(uid);
+					if( it != theme_->getTheme()->getItemStatusMap().end())
+					{
+						if(it->second & 1)
+							gridToPortalRowVector_.push_back(i);
+						else
+							notByPointingVector.push_back(i);
+					}
+					else
+					{
+						notByPointingVector.push_back(i);
+					}
+				}
+				else
+				{
+					oid = portal->getData(objectIdPos_);
+					std::map<std::string, int >::iterator it = theme_->getTheme()->getObjStatusMap().find(oid);
+					if( it != theme_->getTheme()->getObjStatusMap().end())
+					{
+						if(it->second & 1)
+							gridToPortalRowVector_.push_back(i);
+						else
+							notByPointingVector.push_back(i);
+					}
+					else
+					{
+						notByPointingVector.push_back(i);
+					}
+				}
+			}		
+			++i;
+		}
+	}
+	delete portal;
+
+	for (i = 0; i < notByPointingVector.size(); ++i)
+		gridToPortalRowVector_.push_back(notByPointingVector[i]);
+	
+	doRepaint_ = true;
+
+	int x = contentsX();
+	int y = rowPos(0);
+	setContentsPos(x, y);
+
+	refresh();
+}
+
+
+void TeQtGrid::promoteQueriedObjectsSlot()
+{
+	TeWaitCursor	wait;
+	gridToPortalRowVector_.clear();
+	string	oid, uid, val;
+	TeDatabasePortal* portal = db_->getPortal();
+	vector<int> notByQueryVector;
+
+	unsigned int i=0;
+    int gs;
+	if (portal->query(sql_))
+	{
+		while (portal->fetchRow())
+		{
+			if(theme_->getTheme()->getProductId() == TeTHEME)
+			{
+				val =  portal->getData(gridStatusPos_);
+				if(val.empty())
+					gs = atoi(portal->getData(resultIdPos_));
+				else
+					gs = atoi(val.c_str());
+
+				if(gs &= 0x2)
+					gridToPortalRowVector_.push_back(i);
+				else
+					notByQueryVector.push_back(i);
+			}
+			else if(theme_->getTheme()->getProductId() == TeEXTERNALTHEME)
+			{
+				uid = portal->getData(uniqueIdPos_);
+				if(uid.empty() == false)
+				{
+					std::map<std::string, int >::iterator it = theme_->getTheme()->getItemStatusMap().find(uid);
+					if( it != theme_->getTheme()->getItemStatusMap().end())
+					{
+						if(it->second & 2)
+							gridToPortalRowVector_.push_back(i);
+						else
+							notByQueryVector.push_back(i);
+					}
+					else
+					{
+						notByQueryVector.push_back(i);
+					}
+				}
+				else
+				{
+					oid = portal->getData(objectIdPos_);
+					std::map<std::string, int >::iterator it = theme_->getTheme()->getObjStatusMap().find(oid);
+					if( it != theme_->getTheme()->getObjStatusMap().end())
+					{
+						if(it->second & 2)
+							gridToPortalRowVector_.push_back(i);
+						else
+							notByQueryVector.push_back(i);
+					}
+					else
+					{
+						notByQueryVector.push_back(i);
+					}
+				}
+			}		
+			++i;
+		}
+	}
+	delete portal;
+
+	for (i = 0; i < notByQueryVector.size(); ++i)
+		gridToPortalRowVector_.push_back(notByQueryVector[i]);
+	
+	doRepaint_ = true;
+
+	int x = contentsX();
+	int y = rowPos(0);
+	setContentsPos(x, y);
+
+	refresh();
+}
+
+
+void TeQtGrid::sortAscOrderSlot()    
+{
+	vector<int>	v;
+
+	sort(v, "ASC");
+}
+
+
+void TeQtGrid::sortDescOrderSlot()    
+{
+	vector<int>	v;
+
+	sort(v, "DESC");
+}
+
+
+void TeQtGrid::sort(vector<int> cols, string order)
+{
+	unsigned int nc = numCols();
+	unsigned int n;
+	string uid, oid;
+
+	if (portal_ == 0)
+		return;
+
+
+	if (cols.size() == 0)
+	{
+		for(n = 0; n < nc; ++n)
+			if (isColumnSelected(n, true) == true)
+				cols.push_back(n);
+	}
+
+	if (cols.size() == 0)
+	{
+		QMessageBox::warning(this, tr("Warning"),
+			tr("Select the grid column(s) to be sorted!"));
+		return;
+	}
+
+	orderBy_.clear();
+	for (n=0; n<cols.size(); n++)
+		orderBy_ += (horizontalHeader()->label(cols[n]) + " ").latin1() + order + ",";
+	orderBy_ = orderBy_.substr(0, orderBy_.size()-1);
+	doRepaint_ = true;
+
+	portal_->freeResult();
+	sql_ = sqlJoin_ + " ORDER BY " + orderBy_;
+	if (portal_->query(sql_) == false)
+	{
+		portal_->freeResult();
+		delete portal_;
+		portal_ = 0;
+		return;
+	}
+
+	gridToPortalRowVector_.clear();
+	portalRow2UniqueIdVector_.clear();
+	int i = 0;
+	while(portal_->fetchRow())
+	{
+		uid = portal_->getData(uniqueIdPos_);
+		if(uid.empty() == false)
+			portalRow2UniqueIdVector_.push_back(uid);
+		else
+		{
+			oid = portal_->getData(objectIdPos_);
+			portalRow2UniqueIdVector_.push_back(oid);
+		}
+		gridToPortalRowVector_.push_back(i);
+		++i;
+	}
+
+	refresh();
+}
+
+
+TeTable& TeQtGrid::findTable(int col) // grid column
+{
+	unsigned int i;
+    int nCols;
+	static	TeTable t;
+
+	int portalCol = gridToPortalColVector_[col];
+	TeAttributeList attrList;
+	
+	nCols = 0;
+	for (i = 0; i < tableVector_.size(); ++i)
+	{
+		attrList = tableVector_[i].attributeList();
+		nCols += attrList.size();
+		if (portalCol < nCols)
+			break;				
+	}
+	if(i == tableVector_.size())
+		return t;
+	return tableVector_[i];	
+}
+
+TeTable& TeQtGrid::findTable(string  colName)
+{
+	int	i;
+	for(i=0; i<numCols(); i++)
+	{
+		string cname = horizontalHeader()->label(i).latin1();
+		if(cname == colName)
+			break;
+	}
+	return findTable(i);
+}
+
+
+void TeQtGrid::setVerticalEdition(bool flag)
+{
+	verticalEdition_ = flag;				
+}
+
+bool TeQtGrid::writeCell()
+{
+	string	val;
+	QString qs;
+	unsigned int i;
+
+	if(rowToEdit_ == -1 || colToEdit_ == -1)
+		return false;
+
+	int portalRowToEdit = gridToPortalRowVector_[rowToEdit_];
+	int portalColToEdit = gridToPortalColVector_[colToEdit_];
+	endEdit(rowToEdit_, colToEdit_, true, false);
+
+	int col = gridToPortalColVector_[colToEdit_];
+	if(isIndex(col))
+		return false;
+
+	string colName = horizontalHeader()->label(colToEdit_).latin1();
+	qs = text(rowToEdit_, colToEdit_);
+//	if(qs.isEmpty() && db_->dbmsName() == "Ado")
+//		return false;
+	if(qs.isEmpty() == false)
+		val = qs.latin1();
+
+	TeAttributeList&	attrList = portal_->getAttributeList();
+	TeAttrDataType type = attrList[portalColToEdit].rep_.type_;
+
+	if (portal_->fetchRow(portalRowToEdit) == false)
+		return false;
+
+	TeWaitCursor wait;
+	TeTable& tableToEdit = findTable(colToEdit_);
+	string tableName = tableToEdit.name();
+	string linkName;
+	if(tableToEdit.tableType() == TeAttrStatic || tableToEdit.tableType() == TeAttrEvent)
+		linkName = tableToEdit.linkName();
+	else
+		linkName = tableToEdit.uniqueName();
+
+	i = linkName.find(".");
+	if(i == string::npos)
+		linkName = tableName + "." + linkName;
+
+	string id = portal_->getData(linkName);
+
+	string qString = "UPDATE " + tableName;
+	if(val.empty())
+	{
+		qString += " SET " + colName + " = null";
+		qString += " WHERE " + linkName + " = '" + id + "'";
+	}
+	else
+	{
+		if (type == TeSTRING || type == TeDATETIME)
+		{
+			qString += " SET " + colName + " = '" + db_->escapeSequence(val);
+			qString += "' WHERE " + linkName + " = '" + id + "'";
+		}
+		else
+		{
+			qString += " SET " + colName + " = " + val;
+			qString += " WHERE " + linkName + " = '" + id + "'";
+		}
+	}
+
+	if (db_->execute(qString) == false)
+		return false;
+
+	if(theme_ != NULL && theme_->getTheme() != NULL && (theme_->getTheme()->type() == TeTHEME || theme_->getTheme()->type() == TeEXTERNALTHEME))
+	{
+		TeTheme* teTheme = dynamic_cast<TeTheme*>(theme_->getTheme());
+		TeLayer* layer = teTheme->layer();
+		if(layer != NULL)
+		{
+			layer->updateLayerEditionTime();
+		}
+	}
+
+	if (db_->dbmsName() != "Ado")
+		arrangeGridToPortalRowVector(col);
+
+	return true;
+}
+
+
+void TeQtGrid::editNextRow()
+{
+	if (rowToEdit_ < numRows()-1)
+		++rowToEdit_;
+	else
+	{
+		rowToEdit_ = 0;
+		editNextColumn();
+	}
+}
+
+
+void TeQtGrid::editNextColumn()
+{
+	bool editavel = false;
+	while(editavel == false)
+	{
+		if (colToEdit_ == numCols()-1)
+		{
+			colToEdit_ = 0;
+			if (rowToEdit_ == numRows()-1)
+				rowToEdit_ = 0;
+			else
+				++rowToEdit_;
+		}
+		else
+			++colToEdit_;
+
+		int col = gridToPortalColVector_[colToEdit_];
+		if(isIndex(col))
+			editavel = false;
+		else
+			editavel = true;
+	}
+}
+
+void TeQtGrid::goToEditNewCell()
+{
+	int	x = contentsX();
+	int y = contentsY();
+
+	if(verticalEdition_ == true)
+		editNextRow();
+	else
+		editNextColumn();
+
+	if(rowToEdit_ >= fLine_)
+		y = rowPos(iLine_+1);
+	if(colToEdit_ >= fCol_)
+		x = columnPos(iCol_+1);
+
+	setContentsPos(x, y);
+	refresh();
+
+	int i = currEditRow();
+	int j = currEditCol();
+	if(i != rowToEdit_ || j != colToEdit_)
+	{
+		if(i > 0 && j > 0)
+			endEdit(i, j, true, true);
+		setEditMode(QTable::Editing, rowToEdit_, colToEdit_);
+		beginEdit(rowToEdit_, colToEdit_, false);
+	}
+}
+
+void TeQtGrid::removeQueryColorSlot()
+{
+	TeWaitCursor wait;
+
+	set<string> drawSet;
+	map<string, int>::iterator uit;
+
+	TeDatabase* db = theme_->getLocalDatabase();
+	
+	map<string, ObjectInfo>::iterator oit;
+	for(oit =  objectMap_.begin(); oit != objectMap_.end(); oit++)
+	{
+		ObjectInfo& info = oit->second;
+		if(info.status_ & 0x2)
+		{
+			for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+				uit->second &= 0x1;
+			info.status_ &= 0x1;
+			drawSet.insert(oit->first);
+		}
+	}
+
+	clearSelection(true);
+	refresh();
+	string s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionTable();
+	s += " SET c_object_status = 0 WHERE c_object_status = 2";
+	db->execute(s);
+
+	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionTable();
+	s += " SET c_object_status = 1 WHERE c_object_status = 3";
+	db->execute(s);
+
+	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionAuxTable();
+	s += " SET grid_status = 0 WHERE grid_status = 2";
+	db->execute(s);
+
+	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionAuxTable();
+	s += " SET grid_status = 1 WHERE grid_status = 3";
+	db->execute(s);
+
+	theme_->getTheme()->removeQueryColor();
+	emit putColorOnObject(theme_, drawSet);
+}
+
+
+void TeQtGrid::removePointingColorSlot()
+{
+	TeWaitCursor wait;
+
+	set<string> drawSet;
+	map<string, int>::iterator uit;
+
+	map<string, ObjectInfo>::iterator oit;
+	for(oit =  objectMap_.begin(); oit != objectMap_.end(); oit++)
+	{
+		ObjectInfo& info = oit->second;
+		if(info.status_ & 0x1)
+		{
+			for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+				uit->second &= 0x2;
+			info.status_ &= 0x2;
+			drawSet.insert(oit->first);
+		}
+	}
+
+	clearSelection(true);
+	refresh();
+
+	TeDatabase* db = theme_->getLocalDatabase();
+
+	string s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionTable();
+	s += " SET c_object_status = 0 WHERE c_object_status = 1";
+	db->execute(s);
+
+	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionTable();
+	s += " SET c_object_status = 2 WHERE c_object_status = 3";
+	db->execute(s);
+
+	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionAuxTable();
+	s += " SET grid_status = 0 WHERE grid_status = 1";
+	db->execute(s);
+
+	s = "UPDATE " + ((TeTheme*)theme_->getTheme())->collectionAuxTable();
+	s += " SET grid_status = 2 WHERE grid_status = 3";
+	db->execute(s);
+
+	theme_->getTheme()->removePointingColor();
+	emit putColorOnObject(theme_, drawSet);
+}
+
+
+void TeQtGrid::scrollToNextPointedObjectSlot()
+{
+	TeWaitCursor wait;
+
+	int	rowpos, portalpos, nrows = numRows();
+	int	x, y;
+	string oid, uid;
+
+	x = contentsX();
+	y = contentsY();
+	rowpos = rowAt(y);
+
+	if(rowpos == numRows() - 1)
+	{
+		wait.resetWaitCursor();
+		return;
+	}
+	rowpos++;
+
+	while(rowpos < nrows)
+	{
+		portalpos = gridToPortalRowVector_[rowpos];
+		portal_->fetchRow(portalpos);
+
+		oid = portal_->getData(objectIdPos_);
+		uid = portal_->getData(uniqueIdPos_);
+
+		ObjectInfo& info = objectMap_[oid];
+		int status = info.status_;
+		if(uid.empty() == false)
+			status = info.uniqueMap_[uid];
+
+
+		if (status & 0x1)
+			break;
+		rowpos++;
+	}
+
+
+	if (rowpos == nrows)
+	{
+		wait.resetWaitCursor();
+		return;
+	}
+
+	y = rowPos(rowpos);
+	setContentsPos (x, y);
+
+	clearSelection(true);
+	refresh();
+}
+
+
+void TeQtGrid::scrollToPrevPointedObjectSlot()
+{
+	TeWaitCursor wait;
+
+	int	rowpos, portalpos;
+	int	x, y;
+	string oid, uid;
+
+	x = contentsX();
+	y = contentsY();
+	rowpos = rowAt(y);
+
+	if(rowpos == 0)
+	{
+		wait.resetWaitCursor();
+		return;
+	}
+	rowpos--;
+
+	while(rowpos >= 0)
+	{
+		portalpos = gridToPortalRowVector_[rowpos];
+		portal_->fetchRow(portalpos);
+
+		oid = portal_->getData(objectIdPos_);
+		uid = portal_->getData(uniqueIdPos_);
+
+		ObjectInfo& info = objectMap_[oid];
+		int status = info.status_;
+		if(uid.empty() == false)
+			status = info.uniqueMap_[uid];
+
+		if (status & 0x1)
+			break;
+		rowpos--;
+	}
+
+
+	if (rowpos < 0)
+	{
+		wait.resetWaitCursor();
+		return;
+	}
+
+	y = rowPos(rowpos);
+	setContentsPos (x, y);
+
+	clearSelection(true);
+	refresh();
+}
+
+
+void TeQtGrid::scrollToNextQueriedObjectSlot()
+{
+	TeWaitCursor wait;
+
+	int	rowpos, portalpos, nrows = numRows();
+	int	x, y;
+	string oid, uid;
+
+	x = contentsX();
+	y = contentsY();
+	rowpos = rowAt(y);
+
+	if(rowpos == numRows() - 1)
+	{
+		wait.resetWaitCursor();
+		return;
+	}
+	rowpos++;
+
+	while(rowpos < nrows)
+	{
+		portalpos = gridToPortalRowVector_[rowpos];
+		portal_->fetchRow(portalpos);
+
+		oid = portal_->getData(objectIdPos_);
+		uid = portal_->getData(uniqueIdPos_);
+
+		ObjectInfo& info = objectMap_[oid];
+		int status = info.status_;
+		if(uid.empty() == false)
+			status = info.uniqueMap_[uid];
+
+		if (status & 0x2)
+			break;
+		rowpos++;
+	}
+
+
+	if (rowpos == nrows)
+	{
+		wait.resetWaitCursor();
+		return;
+	}
+
+	y = rowPos(rowpos);
+	setContentsPos (x, y);
+
+	clearSelection(true);
+	refresh();
+}
+
+
+void TeQtGrid::scrollToPrevQueriedObjectSlot()
+{
+	TeWaitCursor wait;
+
+	int	rowpos, portalpos;
+	int	x, y;
+	string oid, uid;
+
+	x = contentsX();
+	y = contentsY();
+	rowpos = rowAt(y);
+
+	if(rowpos == 0)
+	{
+		wait.resetWaitCursor();
+		return;
+	}
+	rowpos--;
+
+	while(rowpos >= 0)
+	{
+		portalpos = gridToPortalRowVector_[rowpos];
+		portal_->fetchRow(portalpos);
+
+		oid = portal_->getData(objectIdPos_);
+		uid = portal_->getData(uniqueIdPos_);
+
+		ObjectInfo& info = objectMap_[oid];
+		int status = info.status_;
+		if(uid.empty() == false)
+			status = info.uniqueMap_[uid];
+
+		if (status & 0x2)
+			break;
+		rowpos--;
+	}
+
+
+	if (rowpos < 0)
+	{
+		wait.resetWaitCursor();
+		return;
+	}
+
+	y = rowPos(rowpos);
+	setContentsPos (x, y);
+
+	clearSelection(true);
+	refresh();
+}
+
+void TeQtGrid::invertSelectionSlot()
+{
+	TeWaitCursor wait;
+
+	set<string> drawSet;
+	map<string, int>::iterator uit;
+	string oid, uid;
+
+	map<string, ObjectInfo>::iterator oit;
+	for(oit =  objectMap_.begin(); oit != objectMap_.end(); oit++)
+	{
+		ObjectInfo& info = oit->second;
+		if(info.status_ & 0x2)	//queried object -> sets it to selected
+		{
+			for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+				uit->second &= 0x1;
+			info.status_ &= 0x1;
+			for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+				uit->second |= 0x1;
+			info.status_ |= 0x1;
+		}
+		for(uit = info.uniqueMap_.begin(); uit != info.uniqueMap_.end(); uit++)
+			uit->second ^= 0x1;
+		info.status_ ^= 0x1;			 
+		drawSet.insert(oit->first);
+	}
+	refresh();
+	if (saveObjectStatus(theme_, drawSet, objectMap_) == false)
+	{
+		QMessageBox::critical(this, tr("Error"),
+			tr("Fail to update the \"c_legend_result\" and \"grid_status\" fields in the collection table!"));
+		return;
+	}
+	emit putColorOnObject(theme_, drawSet);
+}
+
+bool TeQtGrid::getVisColumn(int col)
+{
+	if(col < (int)gridColVisVector_.size())
+		return gridColVisVector_[col];
+	return false;
+}
+
+
+bool TeQtGrid::isIndex(int col) // portal column
+{
+	unsigned int i;
+	string cname = portal_->getAttribute(col).rep_.name_;
+
+	if(cname.find(".") == string::npos)
+	{
+		TeAttributeList attrList;		
+		int nCols = 0;
+		for (i = 0; i < tableVector_.size(); ++i)
+		{
+			attrList = tableVector_[i].attributeList();
+			nCols += attrList.size();
+			if (col < nCols)
+				break;				
+		}
+		
+		cname.insert(0, tableVector_[i].name() + ".");
+//		if(i>0)
+//			cname.insert(0, tableVector_[(i-1)].name() + ".");
+	}
+
+	cname = TeConvertToUpperCase(cname);
+	for(i=0; i<indexVector_.size(); i++)
+	{
+		string s = TeConvertToUpperCase(indexVector_[i]);
+		if(s.find(cname) != string::npos)
+			return true;
+	}
+	return false;
+}
+
+bool TeQtGrid::isDateTimeRegistered(int col) // portal column
+{
+	string cname = portal_->getAttribute(col).rep_.name_;
+	TeTable& t = findTable(cname);
+	string name = cname;
+	int f = name.find(".");
+	if(f >= 0)
+		name = name.substr(f+1);
+	if(t.attInitialTime() == name || t.attFinalTime() == name)
+		return true;
+	return false;
+}
+
+bool TeQtGrid::isSortBy(int col) // portal column
+{
+	string cname = portal_->getAttribute(col).rep_.name_;
+	cname += " ";
+
+//	if(orderBy_.find(cname, string::npos) == string::npos)
+	if(orderBy_.find(cname) == string::npos)
+		return false;
+	return true;
+}
+
+bool TeQtGrid::isExternalTable(int col) // portal column
+{
+	unsigned int c;
+	for(c=0; c<gridToPortalColVector_.size(); c++)
+	{
+		if(gridToPortalColVector_[c] == col)
+			break;
+	}
+
+	TeTable& T = findTable(c);
+	if(T.tableType() == TeAttrExternal)
+		return true;
+	else
+		return false;
+}
+
+string TeQtGrid::getObject(int row)
+{
+	int portalpos = gridToPortalRowVector_[row];
+	portal_->fetchRow(portalpos);
+
+	string oid = portal_->getData(objectIdPos_);
+	return oid;
+}
+
+void TeQtGrid::gridInformation()
+{
+	if(showGridInformation_ == false)
+		return;
+
+	int orows = 0, opointed = 0, oqueried = 0, opqs = 0;
+	int pointed = 0, queried = 0, pqs = 0;
+	int rows = numRows();
+	map<string, ObjectInfo>::iterator it = objectMap_.begin();
+
+	while (it != objectMap_.end())
+	{
+		orows++;
+		ObjectInfo& info = it->second;
+		int leg_res = info.status_;
+		if(leg_res == 1)
+			opointed++;
+		else if(leg_res == 2)
+			oqueried++;
+		else if(leg_res == 3)
+		{
+			opointed++;
+			oqueried++;
+			opqs++;
+		}
+
+		map<string, int> uMap = info.uniqueMap_;
+		if(uMap.size())
+		{
+			map<string, int>::iterator uit = uMap.begin();
+			while(uit != uMap.end())
+			{
+				int gStatus = uit->second;
+				if(gStatus == 1)
+					pointed++;
+				else if(gStatus == 2)
+					queried++;
+				else if(gStatus == 3)
+				{
+					pointed++;
+					queried++;
+					pqs++;
+				}
+				uit++;
+			}
+		}
+		it++;
+	}
+
+	string sorows = Te2String(orows);
+	string sopointed = Te2String(opointed);
+	string soqueried = Te2String(oqueried);
+	string sopqs = Te2String(opqs);
+	string srows = Te2String(rows);
+	string spointed = Te2String(pointed);
+	string squeried = Te2String(queried);
+	string spqs = Te2String(pqs);
+
+	if(orows != rows || opointed != pointed || oqueried != queried || opqs != pqs)
+	{
+		sorows += "/" + srows;
+		sopointed += "/" + spointed;
+		soqueried += "/" + squeried;
+		sopqs += "/" + spqs;
+	}
+
+	QString msg = tr("Number of Rows:") + " " + sorows.c_str() + ", " + tr("Pointed:") + " " + sopointed.c_str();
+	msg += ", " + tr("Queried:") + " " + soqueried.c_str() + ", " + tr("Pointed and Queried:") + " " + sopqs.c_str();
+	emit displayGridInformation(msg);
+}
+
+void TeQtGrid::endEdit(int row, int col, bool accept, bool replace)
+{
+	if(accept && replace)
+		writeCell();
+	else
+		QTable::endEdit(row, col, accept, replace);
+}
+
+
+void TeQtGrid::columnWidthChanged(int col)
+{
+	if(doRepaint_)
+		refresh();
+	QTable::columnWidthChanged(col);
+}
+
+void TeQtGrid::insertObjectIntoCollection(string newId, string newTId)
+{
+	doRepaint_ = false;
+	ObjectInfo	info;
+
+	string oid = newId;
+	string uid = newId;
+	if(newTId.empty() == false)
+	{
+		uid += newTId;
+		info.uniqueMap_[uid] = 1;
+		unique2ObjectMap_[uid] = oid;
+	}
+	else
+	{
+		info.uniqueMap_[oid] = 1;
+		unique2ObjectMap_[oid] = oid;
+	}
+
+	info.status_ = 1;
+	objectMap_[oid] = info;
+
+	portalRow2UniqueIdVector_.push_back(uid);
+
+	int numRows = portalRow2UniqueIdVector_.size();
+	gridToPortalRowVector_.push_back(numRows - 1);
+	doRepaint_ = true;
+	setNumRows(numRows);
+}
+
+void TeQtGrid::deletePointedLines()
+{
+	doRepaint_ = false;
+	unsigned int	i, j;
+	string oid, uid;
+	vector<string> oidVec;
+	map<string, vector<string> > uidMap;
+
+	map<string, ObjectInfo>::iterator it = objectMap_.begin();
+	while(it != objectMap_.end())
+	{
+		ObjectInfo	info = (*it).second;
+		if(info.status_ == 1 || info.status_ == 3)
+		{
+			oid = (*it).first;
+			uid.clear();
+			map<string, int>::iterator uit = info.uniqueMap_.begin();
+			vector<string> uidVec;
+			while(uit != info.uniqueMap_.end())
+			{
+				if((*uit).second == 1 || (*uit).second == 3)
+				{
+					uid = (*uit).first;
+					uidVec.push_back(uid);
+				}
+				uit++;
+			}
+
+			if(uidVec.size() == 0)
+			{
+				uidVec.push_back(oid);
+			}
+			uidMap[oid] = uidVec;
+			oidVec.push_back(oid);
+		}
+		it++;
+	}
+
+	vector<string> iVec;
+	for(i=0; i<oidVec.size(); i++)
+	{
+		oid = oidVec[i];
+		ObjectInfo&	info = objectMap_[oid];
+		vector<string> uidVec = uidMap[oid];
+
+		for(j=0; j<uidVec.size(); j++)
+		{
+			string s = uidVec[j];
+			iVec.push_back(s);
+			info.uniqueMap_.erase(s);
+			unique2ObjectMap_.erase(s);
+		}
+		if(info.uniqueMap_.size() == 0)
+			objectMap_.erase(oid);
+	}
+
+	vector<int> jVec;
+	vector<string> copy1(portalRow2UniqueIdVector_.begin(), portalRow2UniqueIdVector_.end());
+	portalRow2UniqueIdVector_.clear();
+	for(i=0; i<copy1.size(); i++)
+	{
+		string ps = copy1[i];
+		for(j=0; j<iVec.size(); j++)
+		{
+			string s = iVec[j];
+			if(ps == s)
+			{
+				jVec.push_back(i);
+				break;
+			}
+		}
+		if(j == iVec.size())
+			portalRow2UniqueIdVector_.push_back(ps);
+	}
+
+	vector<int> copy2(gridToPortalRowVector_.begin(), gridToPortalRowVector_.end());
+	gridToPortalRowVector_.clear();
+	for(i=0; i<copy2.size(); i++)
+	{
+		int ps = copy2[i];
+		for(j=0; j<jVec.size(); j++)
+		{
+			int s = jVec[j];
+			if(ps == s)
+				break;
+		}
+		if(j == jVec.size())
+			gridToPortalRowVector_.push_back(ps);
+	}
+
+	for(i=jVec.size()-1; (int)i>=0; i--)
+	{
+		int s = jVec[i];
+		for(j=0; j<gridToPortalRowVector_.size(); j++)
+		{
+			int ss = gridToPortalRowVector_[j];
+			if(ss >= s)
+				gridToPortalRowVector_[j] = ss - 1;
+		}
+	}
+
+	int numRows = portalRow2UniqueIdVector_.size();
+	doRepaint_ = true;
+	setNumRows(numRows);
+}
+
+bool TeQtGrid::hasPointedLine()
+{
+	map<string, ObjectInfo>::iterator it = objectMap_.begin();
+
+	while(it != objectMap_.end())
+	{
+		ObjectInfo	info = (*it).second;
+		if(info.status_ == 1 || info.status_ == 3)
+			return true;
+		it++;
+	}
+
+	return false;
+}
+
+void TeQtGrid::goToLastLine()
+{
+	int nRows = numRows();
+	int iniRow = nRows - visibleLines_;
+
+	doRepaint_ = true;
+	int x = columnAt(gridX_);
+	int y = rowPos(iniRow);
+	setContentsPos(x, y);
+	refresh();
+}
+
+void TeQtGrid::goToLastColumn()
+{
+	int x = contentsWidth() - visibleWidth();
+
+	doRepaint_ = true;
+	int y = contentsY();
+	setContentsPos(x, y);
+	refresh();
+}
+
+vector<int> TeQtGrid::getSelectedColumns()
+{
+	int i, j;
+	vector<int> colVec;
+
+	for (i = 0; i < numCols(); i++)
+	{
+		if(gridColVisVector_[i])
+		{
+			if (isColumnSelected(i, true) == true)
+			{
+				j = gridToPortalColVector_[i];
+				colVec.push_back(j);
+			}
+		}
+	}
+	return colVec;
+}
+
+void TeQtGrid::arrangeColumns(TeAttrTableVector cTableVec)
+{
+	int	i, j, k, m;
+	TeAttributeList CAL;
+	TeAttributeList	AL;
+	vector<int> cVec;
+
+	for(i=m=0; (unsigned int)i<cTableVec.size(); i++)
+	{
+		TeTable ct = cTableVec[i];
+		CAL = ct.attributeList();
+
+		TeTable t = tableVector_[i];
+		AL = t.attributeList();
+
+		if(AL.size() > CAL.size())
+		{
+			for(j=0; (unsigned int)j<AL.size(); j++, m++)
+			{
+				TeAttribute a = AL[j];
+				for(k=0; (unsigned int)k<CAL.size(); k++)
+				{
+					TeAttribute ca = CAL[k];
+					if(TeConvertToUpperCase(a.rep_.name_) == TeConvertToUpperCase(ca.rep_.name_))
+						break;
+				}
+				if((unsigned int)k == CAL.size())
+					cVec.push_back(m);
+			}
+		}
+		else if(AL.size() < CAL.size())
+		{
+			for(j=0; (unsigned int)j<CAL.size(); j++, m++)
+			{
+				TeAttribute a = CAL[j];
+				for(k=0; (unsigned int)k<AL.size(); k++)
+				{
+					TeAttribute ca = AL[k];
+					if(TeConvertToUpperCase(a.rep_.name_) == TeConvertToUpperCase(ca.rep_.name_))
+						break;
+				}
+				if((unsigned int)k == AL.size())
+					cVec.push_back(m);
+			}
+		}
+		else
+			m += (int)AL.size();
+	}
+
+//	TeAttributeList& attrList = portal_->getAttributeList();
+	int nCols = numCols();
+	int nOldCols = gridColVisVector_.size();
+	vector<bool> cVisVec(gridColVisVector_.begin(), gridColVisVector_.end());
+	vector<int> cSwapVec(gridToPortalColVector_.begin(), gridToPortalColVector_.end());
+	gridColVisVector_.clear();
+	gridToPortalColVector_.clear();
+
+	bool added = false;
+	if(nCols > nOldCols)
+		added = true;
+
+	std::sort(cVec.begin(), cVec.end());
+	if(cVec.size())
+	{
+		if(added)
+		{
+			for(i=nOldCols; i<nCols; i++)
+				cVisVec.push_back(true);
+			gridColVisVector_ = vector<bool>(cVisVec.begin(), cVisVec.end());
+
+			for(i=0; (unsigned int)i<cVec.size(); i++)
+			{
+				k = cVec[i];
+				for(j=0; (unsigned int)j<cSwapVec.size(); j++)
+				{
+					int v = cSwapVec[j];
+					if(v >= k)
+						cSwapVec[j] = v + 1;
+				}
+				cSwapVec.push_back(k);
+			}
+			gridToPortalColVector_ = vector<int>(cSwapVec.begin(), cSwapVec.end());
+		}
+		else
+		{
+			for(i=j=0; (unsigned int)i<cVec.size(); i++)
+			{
+				k = cVec[i];
+				while(j < k)
+				{
+					bool b = cVisVec[j];
+					gridColVisVector_.push_back(b);
+					j++;
+				}
+				j = k + 1;
+			}
+			while((unsigned int)j < cVisVec.size())
+			{
+				bool b = cVisVec[j];
+				gridColVisVector_.push_back(b);
+				j++;
+			}
+
+			for(i=0; (unsigned int)i<cVec.size(); i++)
+			{
+				k = cVec[i];
+				for(j=0; (unsigned int)j<cSwapVec.size(); j++)
+				{
+					int kk = cSwapVec[j];
+					if(kk != k)
+						gridToPortalColVector_.push_back(kk);
+				}
+				cSwapVec.clear();
+				cSwapVec = vector<int>(gridToPortalColVector_.begin(), gridToPortalColVector_.end());
+				gridToPortalColVector_.clear();
+			}
+
+			for(i = (int)cVec.size() - 1; i>=0; i--)
+			{
+				k = cVec[i];
+				for(j=0; (unsigned int)j<cSwapVec.size(); j++)
+				{
+					int v = cSwapVec[j];
+					if(v >= k)
+						cSwapVec[j] = v - 1;
+				}
+			}
+			gridToPortalColVector_ = vector<int>(cSwapVec.begin(), cSwapVec.end());
+		}
+	}
+	else
+	{
+		// Set the vector that will contain the order the
+		// grid columns will be shown
+		gridToPortalColVector_.clear();
+		gridColVisVector_.clear();
+		for (i = 0; i < nCols; i++)
+		{
+			gridToPortalColVector_.push_back(i);
+			gridColVisVector_.push_back(true);
+		}
+	}
+}
+
+void TeQtGrid::arrangeGridToPortalRowVector(int col)
+{
+	int i, p, pp;
+	string id, s, ss;
+
+	portal_->freeResult();
+	if (!portal_->query(sql_))
+	{
+		portal_->freeResult();
+		delete portal_;
+		portal_ = 0;
+		return;
+	}
+
+	if(isSortBy(col) == false)
+		return;
+
+	vector<int> cGridToPortal(gridToPortalRowVector_.begin(), gridToPortalRowVector_.end());
+	vector<string> cPortalToUnique(portalRow2UniqueIdVector_.begin(), portalRow2UniqueIdVector_.end());
+	gridToPortalRowVector_.clear();
+	portalRow2UniqueIdVector_.clear();
+
+	while (portal_->fetchRow())
+	{
+		id = portal_->getData(uniqueIdPos_);
+		if(id.empty())
+			id = portal_->getData(objectIdPos_);
+		portalRow2UniqueIdVector_.push_back(id);
+	}
+
+	vector<string>::iterator it;
+	for(i=0; (unsigned int)i<cGridToPortal.size(); i++)
+	{
+		p = cGridToPortal[i];
+		s = cPortalToUnique[p];
+		ss = portalRow2UniqueIdVector_[p];
+		if(s == ss)
+			gridToPortalRowVector_.push_back(p);
+		else
+		{
+			it = std::find(portalRow2UniqueIdVector_.begin(), portalRow2UniqueIdVector_.end(), s);
+			if(it != portalRow2UniqueIdVector_.end())
+				pp = it - portalRow2UniqueIdVector_.begin();
+
+			gridToPortalRowVector_.push_back(pp);
+		}
+	}
+}
+
+void TeQtGridItem::paint(QPainter* p, const QColorGroup& cg,
+						 const QRect& cr, bool selected)
+{
+    QColorGroup g(cg);
+	g.setColor( QColorGroup::Base, color_);
+	QTableItem :: paint(p, g, cr, selected);
+}
+
+
+
+
+
diff --git a/src/terralib/drivers/qt/TeQtGrid.h b/src/terralib/drivers/qt/TeQtGrid.h
old mode 100755
new mode 100644
index 454caad..ee17e8b
--- a/src/terralib/drivers/qt/TeQtGrid.h
+++ b/src/terralib/drivers/qt/TeQtGrid.h
@@ -1,253 +1,255 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTGRID_H
-#define  __TERRALIB_INTERNAL_QTGRID_H
-
-#include <qwidget.h>
-#include <qtable.h>
-#include <qcolor.h> 
-#include <qlabel.h>
-#include <qpopupmenu.h>
-#include <vector>
-#include <map>
-#include <set>
-#include <string>
-#include "TeDatabase.h"
-#include "TeAppTheme.h"
-#include "TeApplicationUtils.h"
-
-using namespace std;
-
-class TeQtGrid : public QTable
-{
-	Q_OBJECT
-
-protected:
-	TeDatabase				*db_;
-	TeAppTheme		*theme_;
-	TeDatabasePortal		*portal_;
-	string					sqlJoin_;
-	string					orderBy_;
-	string					sql_;
-	string					CT_;
-	string					CTE_;
-	vector<string>			indexVector_;
-	vector<TeTable>			tableVector_;
-	bool					editing_;
-	bool					doRefresh_;
-	bool					doRepaint_;
-	bool					shiftKeyPressed_;
-	bool					showGridInformation_;
-	int						uniqueIdPos_;
-	int						objectIdPos_;
-	int						resultIdPos_;
-	int						gridStatusPos_;
-	int						gridX_, gridY_;
-	int						iLine_, fLine_;
-	int						iCol_, fCol_;
-	int						gridWidth_, gridHeight_;
-	int						visibleLines_, visibleCols_;
-	long					lastLinePressed_;
-	long					dragLineReleased_;
-	map<string, ObjectInfo>	objectMap_;
-	map<string, string>		unique2ObjectMap_;
-	vector<int>				gridToPortalRowVector_;
-	vector<int>				gridToPortalColVector_;
-	vector<bool>			gridColVisVector_;
-	vector<string>			portalRow2UniqueIdVector_;
-	int						rowToEdit_;
-	int						colToEdit_;
-	bool					verticalEdition_;
-	QPopupMenu				*popupHorizHeader_;
-	QPopupMenu				*popupVertHeader_;
-	QPopupMenu				*popupViewport_;
-	bool					columnDragEnabled_;
-	bool					mousePressedOnHorizontalHeader_;
-
-	virtual bool eventFilter(QObject*, QEvent*);
-
-	virtual void drawContents (QPainter *qp, int clipx, int clipy,
-							   int clipw, int cliph);
-
-	//void sort(vector<int> cols, string order);
-
-	bool writeCell();
-
-	void editNextRow();
-
-	void editNextColumn();
-	
-	void update();
-
-	void goToEditNewCell();
-
-	virtual void endEdit(int row, int col, bool accept, bool replace);
-
-	void arrangeColumns(TeAttrTableVector cTableVec);
-	
-public:
-
-	bool autoPromote_;
-
-	TeQtGrid (QWidget* parent = 0, const char* name = 0);
-
-	~TeQtGrid();
-
-	void init(TeAppTheme *theme);
-
-	void initPortal();
-
-	void updatePortalContents();
-
-	QPopupMenu* popupHorizHeader()
-		{ return popupHorizHeader_; }
-
-	QPopupMenu* popupVertHeader()
-		{ return popupVertHeader_; }
-
-	QPopupMenu* popupViewport()
-		{ return popupViewport_; }
-
-	TeDatabasePortal* getPortal()
-		{ return portal_; }
-	TeAppTheme* getTheme() 
-    {  return theme_;} 
-
-
-	bool isIndex(int col);
-
-	bool isDateTimeRegistered(int col);
-
-	bool isSortBy(int col);
-
-	bool isExternalTable(int col);
-
-	TeTable& findTable(int col);
-
-	TeTable& findTable(string colName);
-
-	void adjustColumns();
-
-	void swapColumns(int col1 = -1, int col2 = -1);
-
-	int	getColumn(int col) {return gridToPortalColVector_[col];}
-
-	void setVisColumn (bool vis, int col=-1);
-
-	bool getVisColumn (int col);
-
-	void putColorOnGrid(set<string> uniqueIdSet, set<string> objectIdSet, string operation, string attrQuery = "");
-
-	void setVerticalEdition(bool flag);
-
-	void refresh();
-
-	void clear();
-
-	void clearPortal();
-
-	string	getObject(int row);
-
-	bool isVerticalEdition() { return verticalEdition_; }
-
-	bool showGridInformation() { return showGridInformation_;}
-
-	void showGridInformation(bool b) { showGridInformation_ = b;}
-
-	void gridInformation ();
-
-	void insertObjectIntoCollection(string newId, string newTId = "");
-
-	void goToLastLine();
-
-	void goToLastColumn();
-
-	bool hasPointedLine();
-
-	void deletePointedLines();
-
-	vector<int> getSelectedColumns();
-
-	void arrangeGridToPortalRowVector(int col);
-
-public slots:
-	void mouseReleasedOnVerticalHeaderSlot(int lin);
-
-	void promotePointedObjectsSlot();
-
-	void promoteQueriedObjectsSlot();
-
-	void sortAscOrderSlot();
-
-	void sortDescOrderSlot();
-
-	void sort(vector<int> cols, string order);
-
-	void removeQueryColorSlot();
-
-	void removePointingColorSlot();
-
-	void scrollToPrevPointedObjectSlot();
-
-	void scrollToNextPointedObjectSlot();
-
-	void scrollToPrevQueriedObjectSlot();
-
-	void scrollToNextQueriedObjectSlot();
-
-	void invertSelectionSlot();
-
-protected slots:
-	void columnWidthChanged(int col);
-
-signals:
-	void putColorOnObject(TeAppTheme*, set<string>&);
-	void horizHeaderSignal(int);
-	void vertHeaderSignal(int);
-	void viewportSignal();
-	void vertHeaderLeftDblClickSignal(int);
-	void linkTable(string, string, string);
-	void gridChangedSignal();
-	void displayGridInformation(QString);
-	void clearGridInformation();
-};
-
-
-
-
-class TeQtGridItem : public QTableItem
-{
-	QColor color_;
-
-public:
-    TeQtGridItem(QTable *t, EditType et, const QString &txt)
-		: QTableItem( t, et, txt )
-	{}
-
-	void setColor(QColor& c)
-	{ color_.setRgb(c.red(), c.green(), c.blue()); }
-
-    void paint(QPainter *p, const QColorGroup &cg,
-		       const QRect &cr, bool selected );
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTGRID_H
+#define  __TERRALIB_INTERNAL_QTGRID_H
+
+#include <qwidget.h>
+#include <qtable.h>
+#include <qcolor.h> 
+#include <qlabel.h>
+#include <qpopupmenu.h>
+#include <vector>
+#include <map>
+#include <set>
+#include <string>
+#include "TeDatabase.h"
+#include "TeAppTheme.h"
+#include "TeApplicationUtils.h"
+
+#include <TeAppUtilsDefines.h>
+
+using namespace std;
+
+class TLAPPUTILS_DLL TeQtGrid : public QTable
+{
+	Q_OBJECT
+
+protected:
+	TeDatabase				*db_;
+	TeAppTheme		*theme_;
+	TeDatabasePortal		*portal_;
+	string					sqlJoin_;
+	string					orderBy_;
+	string					sql_;
+	string					CT_;
+	string					CTE_;
+	vector<string>			indexVector_;
+	vector<TeTable>			tableVector_;
+	bool					editing_;
+	bool					doRefresh_;
+	bool					doRepaint_;
+	bool					shiftKeyPressed_;
+	bool					showGridInformation_;
+	int						uniqueIdPos_;
+	int						objectIdPos_;
+	int						resultIdPos_;
+	int						gridStatusPos_;
+	int						gridX_, gridY_;
+	int						iLine_, fLine_;
+	int						iCol_, fCol_;
+	int						gridWidth_, gridHeight_;
+	int						visibleLines_, visibleCols_;
+	long					lastLinePressed_;
+	long					dragLineReleased_;
+	map<string, ObjectInfo>	objectMap_;
+	map<string, string>		unique2ObjectMap_;
+	vector<int>				gridToPortalRowVector_;
+	vector<int>				gridToPortalColVector_;
+	vector<bool>			gridColVisVector_;
+	vector<string>			portalRow2UniqueIdVector_;
+	int						rowToEdit_;
+	int						colToEdit_;
+	bool					verticalEdition_;
+	QPopupMenu				*popupHorizHeader_;
+	QPopupMenu				*popupVertHeader_;
+	QPopupMenu				*popupViewport_;
+	bool					columnDragEnabled_;
+	bool					mousePressedOnHorizontalHeader_;
+
+	virtual bool eventFilter(QObject*, QEvent*);
+
+	virtual void drawContents (QPainter *qp, int clipx, int clipy,
+							   int clipw, int cliph);
+
+	//void sort(vector<int> cols, string order);
+
+	bool writeCell();
+
+	void editNextRow();
+
+	void editNextColumn();
+	
+	void update();
+
+	void goToEditNewCell();
+
+	virtual void endEdit(int row, int col, bool accept, bool replace);
+
+	void arrangeColumns(TeAttrTableVector cTableVec);
+	
+public:
+
+	bool autoPromote_;
+
+	TeQtGrid (QWidget* parent = 0, const char* name = 0);
+
+	~TeQtGrid();
+
+	void init(TeAppTheme *theme);
+
+	void initPortal();
+
+	void updatePortalContents();
+
+	QPopupMenu* popupHorizHeader()
+		{ return popupHorizHeader_; }
+
+	QPopupMenu* popupVertHeader()
+		{ return popupVertHeader_; }
+
+	QPopupMenu* popupViewport()
+		{ return popupViewport_; }
+
+	TeDatabasePortal* getPortal()
+		{ return portal_; }
+	TeAppTheme* getTheme() 
+    {  return theme_;} 
+
+
+	bool isIndex(int col);
+
+	bool isDateTimeRegistered(int col);
+
+	bool isSortBy(int col);
+
+	bool isExternalTable(int col);
+
+	TeTable& findTable(int col);
+
+	TeTable& findTable(string colName);
+
+	void adjustColumns();
+
+	void swapColumns(int col1 = -1, int col2 = -1);
+
+	int	getColumn(int col) {return gridToPortalColVector_[col];}
+
+	void setVisColumn (bool vis, int col=-1);
+
+	bool getVisColumn (int col);
+
+	void putColorOnGrid(set<string> uniqueIdSet, set<string> objectIdSet, string operation, string attrQuery = "");
+
+	void setVerticalEdition(bool flag);
+
+	void refresh();
+
+	void clear();
+
+	void clearPortal();
+
+	string	getObject(int row);
+
+	bool isVerticalEdition() { return verticalEdition_; }
+
+	bool showGridInformation() { return showGridInformation_;}
+
+	void showGridInformation(bool b) { showGridInformation_ = b;}
+
+	void gridInformation ();
+
+	void insertObjectIntoCollection(string newId, string newTId = "");
+
+	void goToLastLine();
+
+	void goToLastColumn();
+
+	bool hasPointedLine();
+
+	void deletePointedLines();
+
+	vector<int> getSelectedColumns();
+
+	void arrangeGridToPortalRowVector(int col);
+
+public slots:
+	void mouseReleasedOnVerticalHeaderSlot(int lin);
+
+	void promotePointedObjectsSlot();
+
+	void promoteQueriedObjectsSlot();
+
+	void sortAscOrderSlot();
+
+	void sortDescOrderSlot();
+
+	void sort(vector<int> cols, string order);
+
+	void removeQueryColorSlot();
+
+	void removePointingColorSlot();
+
+	void scrollToPrevPointedObjectSlot();
+
+	void scrollToNextPointedObjectSlot();
+
+	void scrollToPrevQueriedObjectSlot();
+
+	void scrollToNextQueriedObjectSlot();
+
+	void invertSelectionSlot();
+
+protected slots:
+	void columnWidthChanged(int col);
+
+signals:
+	void putColorOnObject(TeAppTheme*, set<string>&);
+	void horizHeaderSignal(int);
+	void vertHeaderSignal(int);
+	void viewportSignal();
+	void vertHeaderLeftDblClickSignal(int);
+	void linkTable(string, string, string);
+	void gridChangedSignal();
+	void displayGridInformation(QString);
+	void clearGridInformation();
+};
+
+
+
+
+class TLAPPUTILS_DLL TeQtGridItem : public QTableItem
+{
+	QColor color_;
+
+public:
+    TeQtGridItem(QTable *t, EditType et, const QString &txt)
+		: QTableItem( t, et, txt )
+	{}
+
+	void setColor(QColor& c)
+	{ color_.setRgb(c.red(), c.green(), c.blue()); }
+
+    void paint(QPainter *p, const QColorGroup &cg,
+		       const QRect &cr, bool selected );
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtGridSource.cpp b/src/terralib/drivers/qt/TeQtGridSource.cpp
old mode 100755
new mode 100644
index 954d69e..af77ed0
--- a/src/terralib/drivers/qt/TeQtGridSource.cpp
+++ b/src/terralib/drivers/qt/TeQtGridSource.cpp
@@ -1,632 +1,632 @@
-#include <TeQtGridSource.h>
-#include <TeAppTheme.h>
-
-
-bool TeQtGridSource::setPortal(TeAppTheme* theme)
-{
-	if (theme == 0)
-	{
-		errorMessage_ = "A theme must be passed to the setPortal function";
-		return false;
-	}
-
-	unsigned int i;
-	int k = 0;
-	string uid;
-
-	clearPortal();
-	uid2PortalRowMap_.clear();
-	grid2PortalRowVec_.clear();
-	portal2GridRowVec_.clear();
-	grid2PortalColVec_.clear();
-
-	theme_ = theme;
-
-	TeDatabase* db = ((TeTheme*)theme_->getTheme())->layer()->database();
-	portal_ = db->getPortal();
-
-	// Get the theme tables
-	vector<TeTable> tableVec;
-	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
-
-	orderBy_ = " ORDER BY ";
-	for (i = 0; i < tableVec.size(); ++i)
-	{
-		if (i != 0)
-			orderBy_ += ",";
-		orderBy_ += tableVec[i].name() + "." + tableVec[i].uniqueName();
-	}
-
-	string whereClause;
-//	string whereClause = ((TeTheme*)theme_->getTheme())->getWhereClause();
-	if (whereClause.empty() == false)
-		whereClause = " WHERE " + whereClause;
-	string q = ((TeTheme*)theme_->getTheme())->sqlJoin() + whereClause + orderBy_;
-
-	if (portal_->query(q) == false)
-	{
-		errorMessage_ = portal_->getDatabase()->errorMessage();
-		delete portal_;
-		portal_ = 0;
-		return false;
-	}
-
-	nRows_ = portal_->numRows();
-	nCols_ = portal_->numFields();
-
-	while (portal_->fetchRow())
-	{
-		uid = portal_->getData(tableVec[0].uniqueName());
-		for (i = 1; i < tableVec.size(); ++i)
-		{
-			string s = portal_->getData(tableVec[i].uniqueName());
-			if (s.empty() == true)
-				s = " ";
-
-			uid += s;
-		}
-		uid2PortalRowMap_[uid] = k;
-
-		grid2PortalRowVec_.push_back(k);
-		portal2GridRowVec_.push_back(k++);
-	}
-
-	// Initialize the relation between the grid columns and the portal columns
-	for (k = 0; k < nCols_; ++k)
-		grid2PortalColVec_.push_back(k);
-
-	// Set the grid colors vector
-	setGridColorsVec();
-
-	emit dataChanged();
-	emit setColNamesSignal();
-	return true;
-}
-
-
-bool TeQtGridSource::reloadPortal(bool updateGrid2PortalColRelation)
-{
-	if (portal_ != 0)
-		portal_->freeResult();
-	else
-	{
-		portal_ = ((TeTheme*)theme_->getTheme())->layer()->database()->getPortal();
-		if (portal_ == 0)
-		{
-			errorMessage_ = portal_->getDatabase()->errorMessage();
-			return false;
-		}
-	}
-
-	// Reload portal
-	string whereClause;
-//	string whereClause = ((TeTheme*)theme_->getTheme())->getWhereClause();
-	if (whereClause.empty() == false)
-		whereClause = " WHERE " + whereClause;
-
-	string q = ((TeTheme*)theme_->getTheme())->sqlJoin() + whereClause + orderBy_;
-	if (portal_->query(q) == false)
-	{
-		errorMessage_ = portal_->getDatabase()->errorMessage();
-		delete portal_;
-		portal_ = 0;
-		return false;
-	}
-
-	nRows_ = portal_->numRows();
-	nCols_ = portal_->numFields();
-
-	if (updateGrid2PortalColRelation == true)
-	{
-		grid2PortalColVec_.clear();
-		for (int i = 0; i < nCols_; ++i)
-			grid2PortalColVec_.push_back(i);
-	}
-
-	// Set the grid colors vector
-	setGridColorsVec();
-
-	emit dataChanged();
-	emit setColNamesSignal();
-	return true;
-}
-
-void TeQtGridSource::clearPortal()
-{
-	if (portal_)
-	{
-		delete portal_;
-		portal_ = 0;
-	}
-
-	errorMessage_.clear();
-	gridColorsVec_.clear();
-
-	nRows_ = nCols_ = 0;
-}
-
-
-bool TeQtGridSource::changePortalQuery(const string& orderBy)
-{
-	if (orderBy.empty() == true)
-	{
-		errorMessage_ = "The string that specifies the order must not be empty"; 
-		return false;
-	}
-
-	orderBy_ = orderBy;
-
-	portal_->freeResult();
-	string queryStr = ((TeTheme*)theme_->getTheme())->sqlJoin() + orderBy_;
-	if (portal_->query(queryStr) == false)
-	{
-		errorMessage_ = portal_->getDatabase()->errorMessage();
-		delete portal_;
-		portal_ = 0;
-		return false;
-	}
-
-	// Get the theme tables
-	vector<TeTable> tableVec;
-	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
-
-	unsigned int i;
-	int k = 0;
-	string uid;
-	while (portal_->fetchRow())
-	{
-		uid = portal_->getData(tableVec[0].uniqueName());
-		for (i = 1; i < tableVec.size(); ++i)
-			uid += portal_->getData(tableVec[i].uniqueName());
-		uid2PortalRowMap_[uid] = k;
-
-		grid2PortalRowVec_.push_back(k);
-		portal2GridRowVec_.push_back(k++);
-	}
-
-	// Initialize the relation between the grid columns and the portal columns
-	for (k = 0; k < nCols_; ++k)
-		grid2PortalColVec_.push_back(k);
-
-	// Set the grid colors vector
-	setGridColorsVec();
-
-	emit dataChanged();
-	return true;
-}
-
-QVariant TeQtGridSource::cell(int row, int col)
-{
-	QVariant v;
-	int portalRow = grid2PortalRowVec_[row];
-	int portalCol = grid2PortalColVec_[col];
-
-	if (portal_->fetchRow(portalRow))
-		v = portal_->getData(portalCol);
-
-	return v;
-}
-
-
-void TeQtGridSource::setCell(int row, int col, const QVariant &v)
-{
-	int portalRow = grid2PortalRowVec_[row];
-	int portalCol = grid2PortalColVec_[col];
-
-	// Get the name of the attribute that was edited
-	string attrNameEdited = ((TeTheme*)theme_->getTheme())->getAttribute(portalCol);
-
-	// Get the name of the theme table whose contents will be changed
-	string tableNameToEdit = ((TeTheme*)theme_->getTheme())->getTableName(attrNameEdited);
-
-	string newValue = v.toString().latin1();
-
-	// Find the unique name(primary key) of the table
-	TeTable table;
-	bool b = ((TeTheme*)theme_->getTheme())->getTable(table, tableNameToEdit);
-	if (b == false)
-	{
-		errorMessage_ = "There is no table with this name";
-		return;
-	}
-	string uniqueName = table.uniqueName();
-
-	// Check if the attribute to be edited is a primary key
-	// If positive, do not allow to edit this attribute
-	string attr;
-	size_t pos = attrNameEdited.find(".");
-	if (pos != string::npos)
-		attr = attrNameEdited.substr(pos + 1);
-	if (attr == uniqueName)
-	{
-		errorMessage_ = "This attribute cannot be edited because it is a primary key";
-		return;
-	}
-
-	// Find the name of the register corresponding to the unique name
-	string uniqueValue;
-	if (portal_->fetchRow(portalRow) == true)
-		uniqueValue = portal_->getData(uniqueName);
-
-	// Update the table in the database
-	TeDatabase* db = ((TeTheme*)theme_->getTheme())->layer()->database();
-	string q = "UPDATE " + tableNameToEdit + " SET " + attrNameEdited + " = '";
-	q += newValue + "' WHERE " + uniqueName + " = '" + uniqueValue + "'";
-	if (db->execute(q) == false)
-	{
-		errorMessage_ = db->errorMessage();
-		return;
-	}
-
-	// Update the portal due the changes in the database
-	portal_->freeResult();
-	string sqlJoin = ((TeTheme*)theme_->getTheme())->sqlJoin() + orderBy_;
-	if (portal_->query(sqlJoin) == false)
-	{
-		errorMessage_ = db->errorMessage();
-		delete portal_;
-		return;
-	}
-
-	emit dataChanged();
-}
-
-string TeQtGridSource::getUniqueId(int gridRow)
-{
-	string uid;
-	unsigned int i;
-
-	vector<TeTable> tableVec;
-	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
-
-	int portalRow = grid2PortalRowVec_[gridRow];
-	if (portal_->fetchRow(portalRow))
-	{
-		for (i = 0; i < tableVec.size(); ++i)
-		{
-			string s = portal_->getData(tableVec[i].uniqueName());
-			if (s.empty() == true)
-				s = " ";
-
-			uid += s;
-		}
-	}
-	return uid;
-}
-
-string TeQtGridSource::getObjectId(int gridRow)
-{
-	string objectId;
-
-	vector<TeTable> tableVec;
-	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
-
-	int portalRow = grid2PortalRowVec_[gridRow];
-	if (portal_->fetchRow(portalRow))
-		objectId = portal_->getData(tableVec[0].uniqueName());
-
-	return objectId;
-}
-
-void TeQtGridSource::setGridColorsVec()
-{
-	if (theme_ == 0)
-		return;
-
-	TeColor c;
-	QColor qc;
-
-	gridColorsVec_.clear();
-	gridColorsVec_.push_back(Qt::white);
-
-	c = ((TeTheme*)theme_->getTheme())->pointingLegend().visual(TePOLYGONS)->color();
-	qc = QColor(c.red_,c.green_,c.blue_);
-	gridColorsVec_.push_back(qc);
-
-	c = ((TeTheme*)theme_->getTheme())->queryLegend().visual(TePOLYGONS)->color();
-	qc = QColor(c.red_,c.green_,c.blue_);
-	gridColorsVec_.push_back(qc);
-
-	c = ((TeTheme*)theme_->getTheme())->queryAndPointingLegend().visual(TePOLYGONS)->color();
-	qc = QColor(c.red_,c.green_,c.blue_);
-	gridColorsVec_.push_back(qc);
-
-//	emit cellColorChanged();
-}
-
-QString TeQtGridSource::getPortalInfo(int gridCol)
-{
-	// Get the portal column relative to the given grid column
-	if (gridCol < 0)
-		return QString();
-
-	unsigned int portalCol = grid2PortalColVec_[gridCol];
-
-	// Get the attribute name and the table name associated to the portal column
-	string attrName = ((TeTheme*)theme_->getTheme())->getAttribute(portalCol);
-	string tableName = ((TeTheme*)theme_->getTheme())->getTableName(attrName);
-
-	// Get the representation of a table given an attribute name
-	TeTable table;
-
-	if (((TeTheme*)theme_->getTheme())->getTable(table, tableName) == false)
-		return QString();
-
-	QString qStr = tr("Table:") + " ";
-	qStr += tableName.c_str();
-	if(table.tableType() == TeAttrStatic)
-		qStr += " - " + tr("Table type: TeAttrStatic");
-	else if(table.tableType() == TeAttrExternal)
-		qStr += "  " + tr("Table type: TeAttrExternal");
-	else if(table.tableType() == TeAttrEvent)
-		qStr += " - " + tr("Table type: TeAttrEvent");
-	else if(table.tableType() == TeFixedGeomDynAttr)
-		qStr += " - " + tr("Table type: TeFixedGeomDynAttr");
-	else if(table.tableType() == TeDynGeomDynAttr)
-		qStr += " - " + tr("Table type: TeDynGeomDynAttr");
-
-	vector<TeAttribute>& attrVec = portal_->getAttributeList();
-	if(attrVec.size() > portalCol)
-	{
-		qStr += " - " + tr("Column:");
-		qStr += " ";
-		qStr += attrVec[portalCol].rep_.name_.c_str();
-
-		if(attrVec[portalCol].rep_.type_ == TeSTRING)
-		{
-			qStr += " - " + tr("Column type: TeSTRING");
-			qStr += " - " + tr("Num char:");
-			qStr += " ";
-			qStr += Te2String(attrVec[portalCol].rep_.numChar_).c_str();
-		}
-		else if(attrVec[portalCol].rep_.type_ == TeREAL)
-			qStr += "  " + tr("Column type: TeREAL");
-		else if(attrVec[portalCol].rep_.type_ == TeINT)
-			qStr += " - " + tr("Column type: TeINT");
-		else if(attrVec[portalCol].rep_.type_ == TeDATETIME)
-			qStr += " - " + tr("Column type: TeDATETIME");
-
-		// Get the single name of attrName
-		size_t pos = attrName.find(".");
-		if (pos != string::npos)
-			attrName = attrName.substr(pos + 1);
-
-		// Check if the attribute is editable
-		if(table.uniqueName() == attrName)
-			qStr += " - " + tr("Column is not editable");
-		else
-			qStr += " - " + tr("Column is editable");
-	}
-
-	return qStr;
-}
-
-
-vector<string> TeQtGridSource::getItemsToggled(int begin, int end)
-{
-	string item;
-	vector<string> itemVec;
-
-	// Get the theme tables
-	vector<TeTable> tableVec;
-	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
-
-	for (int i = begin; i <= end; ++i)
-	{
-		if (portal_->fetchRow(grid2PortalRowVec_[i]))
-		{
-			item = portal_->getData(tableVec[0].uniqueName());
-			for (unsigned j = 1; j < tableVec.size(); ++j)
-			{
-				string s = portal_->getData(tableVec[j].uniqueName());
-				if (s.empty() == true)
-					s = " ";
-
-				item += s;
-			}
-			itemVec.push_back(item);
-		}
-	}
-
-	return itemVec;
-}
-
-
-bool TeQtGridSource::isDateTimeRegistered(int gridCol)
-{
-	int portalCol = grid2PortalColVec_[gridCol];
-	string fullAttrName = ((TeTheme*)theme_->getTheme())->getAttribute(portalCol);
-
-	size_t pos = fullAttrName.find(".");
-	string tableName = fullAttrName.substr(0, pos);
-	string attrName = fullAttrName.substr(pos + 1);
-
-	// Get the representation of a table given an attribute name
-	TeTable table;
-	if (((TeTheme*)theme_->getTheme())->getTable(table, tableName) == false)
-		return false;
-
-	if(table.attInitialTime() == attrName || table.attFinalTime() == attrName)
-		return true;
-	return false;
-}
-
-
-void TeQtGridSource::sortColumns(const vector<int>& gridColsVec, const string& order)
-{
-	unsigned int i;
-	int portalCol;
-	string fullAttrName;
-
-	orderBy_ = " ORDER BY ";
-
-	for (i = 0; i < gridColsVec.size(); ++i)
-	{
-		portalCol = grid2PortalColVec_[gridColsVec[i]];
-		fullAttrName = ((TeTheme*)theme_->getTheme())->getAttribute(portalCol);
-
-		if (i != 0)
-			orderBy_ += ",";
-
-		orderBy_ += fullAttrName + " " + order;
-	}
-
-	reloadPortal();
-
-	// Update the relationships between the grid and portal rows
-	for (i = 0; i < grid2PortalRowVec_.size(); ++i)
-		grid2PortalRowVec_[i] = i;
-
-	for (i = 0; i < grid2PortalRowVec_.size(); ++i)
-		portal2GridRowVec_[i] = i;
-}
-
-
-/*
-void TeQtGridSource::sortColumns(const vector<int>& colsVec, const string& order)
-{
-	unsigned int i;
-	int portalCol;
-	string fullAttrName;
-
-	string orderBy = " ORDER BY ";
-
-	for (i = 0; i < colsVec.size(); ++i)
-	{
-		portalCol = grid2PortalColVec_[colsVec[i]];
-		fullAttrName = theme_->getAttribute(portalCol);
-
-		if (i != 0)
-			orderBy += ",";
-
-		orderBy += fullAttrName + " " + order;
-	}
-
-	changePortalQuery(orderBy);
-}
-*/
-
-
-
-
-int TeQtGridSource::getNextGridRowPointed(int gridRow)
-{
-	int i;
-	unsigned int j;
-	string oid, uid;
-	map<string, int>& uidStatusMap = ((TeTheme*)theme_->getTheme())->getItemStatusMap();
-
-	// Get the theme tables
-	vector<TeTable> tableVec;
-	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
-
-	for (i = gridRow; i < nRows_; ++i)
-	{
-		if (portal_->fetchRow(grid2PortalRowVec_[i]))
-		{
-			uid = oid = portal_->getData(tableVec[0].uniqueName());
-			for (j = 1; j < tableVec.size(); ++j)
-				uid += portal_->getData(tableVec[j].uniqueName());
-		}
-
-		int& uidStatus = uidStatusMap[uid];
-		if (uidStatus == TePOINTED || uidStatus == TePOINTED_QUERIED)
-			break;
-		else if (uidStatus == TeDEFAULT)
-			uidStatusMap.erase(uid);
-	}
-
-	return i;
-}
-
-
-int TeQtGridSource::getPrevGridRowPointed(int gridRow)
-{
-	int i;
-	unsigned int j;
-	string oid, uid;
-	map<string, int>& uidStatusMap = ((TeTheme*)theme_->getTheme())->getItemStatusMap();
-
-	// Get the theme tables
-	vector<TeTable> tableVec;
-	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
-
-	for (i = gridRow; i >= 0; --i)
-	{
-		if (portal_->fetchRow(grid2PortalRowVec_[i]))
-		{
-			uid = oid = portal_->getData(tableVec[0].uniqueName());
-			for (j = 1; j < tableVec.size(); ++j)
-				uid += portal_->getData(tableVec[j].uniqueName());
-		}
-
-		int& uidStatus = uidStatusMap[uid];
-		if (uidStatus == TePOINTED || uidStatus == TePOINTED_QUERIED)
-			break;
-		else if (uidStatus == TeDEFAULT)
-			uidStatusMap.erase(uid);
-	}
-
-	return i;
-}
-
-
-int TeQtGridSource::getNextGridRowQueried(int gridRow)
-{
-	int i;
-	unsigned int j;
-	string oid, uid;
-	map<string, int>& uidStatusMap = ((TeTheme*)theme_->getTheme())->getItemStatusMap();
-
-	// Get the theme tables
-	vector<TeTable> tableVec;
-	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
-
-	for (i = gridRow; i < nRows_; ++i)
-	{
-		if (portal_->fetchRow(grid2PortalRowVec_[i]))
-		{
-			uid = oid = portal_->getData(tableVec[0].uniqueName());
-			for (j = 1; j < tableVec.size(); ++j)
-				uid += portal_->getData(tableVec[j].uniqueName());
-		}
-
-		int& uidStatus = uidStatusMap[uid];
-		if (uidStatus == TeQUERIED || uidStatus == TePOINTED_QUERIED)
-			break;
-		else if (uidStatus == TeDEFAULT)
-			uidStatusMap.erase(uid);
-	}
-
-	return i;
-}
-
-int TeQtGridSource::getPrevGridRowQueried(int gridRow)
-{
-	int i;
-	unsigned int j;
-	string oid, uid;
-	map<string, int>& uidStatusMap = ((TeTheme*)theme_->getTheme())->getItemStatusMap();
-
-	// Get the theme tables
-	vector<TeTable> tableVec;
-	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
-
-	for (i = gridRow; i >= 0; --i)
-	{
-		if (portal_->fetchRow(grid2PortalRowVec_[i]))
-		{
-			uid = oid = portal_->getData(tableVec[0].uniqueName());
-			for (j = 1; j < tableVec.size(); ++j)
-				uid += portal_->getData(tableVec[j].uniqueName());
-		}
-
-		int& uidStatus = uidStatusMap[uid];
-		if (uidStatus == TeQUERIED || uidStatus == TePOINTED_QUERIED)
-			break;
-		else if (uidStatus == TeDEFAULT)
-			uidStatusMap.erase(uid);
-	}
-
-	return i;
-}
+#include <TeQtGridSource.h>
+#include <TeAppTheme.h>
+
+
+bool TeQtGridSource::setPortal(TeAppTheme* theme)
+{
+	if (theme == 0)
+	{
+		errorMessage_ = "A theme must be passed to the setPortal function";
+		return false;
+	}
+
+	unsigned int i;
+	int k = 0;
+	string uid;
+
+	clearPortal();
+	uid2PortalRowMap_.clear();
+	grid2PortalRowVec_.clear();
+	portal2GridRowVec_.clear();
+	grid2PortalColVec_.clear();
+
+	theme_ = theme;
+
+	TeDatabase* db = ((TeTheme*)theme_->getTheme())->layer()->database();
+	portal_ = db->getPortal();
+
+	// Get the theme tables
+	vector<TeTable> tableVec;
+	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
+
+	orderBy_ = " ORDER BY ";
+	for (i = 0; i < tableVec.size(); ++i)
+	{
+		if (i != 0)
+			orderBy_ += ",";
+		orderBy_ += tableVec[i].name() + "." + tableVec[i].uniqueName();
+	}
+
+	string whereClause;
+//	string whereClause = ((TeTheme*)theme_->getTheme())->getWhereClause();
+	if (whereClause.empty() == false)
+		whereClause = " WHERE " + whereClause;
+	string q = ((TeTheme*)theme_->getTheme())->sqlJoin() + whereClause + orderBy_;
+
+	if (portal_->query(q) == false)
+	{
+		errorMessage_ = portal_->getDatabase()->errorMessage();
+		delete portal_;
+		portal_ = 0;
+		return false;
+	}
+
+	nRows_ = portal_->numRows();
+	nCols_ = portal_->numFields();
+
+	while (portal_->fetchRow())
+	{
+		uid = portal_->getData(tableVec[0].uniqueName());
+		for (i = 1; i < tableVec.size(); ++i)
+		{
+			string s = portal_->getData(tableVec[i].uniqueName());
+			if (s.empty() == true)
+				s = " ";
+
+			uid += s;
+		}
+		uid2PortalRowMap_[uid] = k;
+
+		grid2PortalRowVec_.push_back(k);
+		portal2GridRowVec_.push_back(k++);
+	}
+
+	// Initialize the relation between the grid columns and the portal columns
+	for (k = 0; k < nCols_; ++k)
+		grid2PortalColVec_.push_back(k);
+
+	// Set the grid colors vector
+	setGridColorsVec();
+
+	emit dataChanged();
+	emit setColNamesSignal();
+	return true;
+}
+
+
+bool TeQtGridSource::reloadPortal(bool updateGrid2PortalColRelation)
+{
+	if (portal_ != 0)
+		portal_->freeResult();
+	else
+	{
+		portal_ = ((TeTheme*)theme_->getTheme())->layer()->database()->getPortal();
+		if (portal_ == 0)
+		{
+			errorMessage_ = portal_->getDatabase()->errorMessage();
+			return false;
+		}
+	}
+
+	// Reload portal
+	string whereClause;
+//	string whereClause = ((TeTheme*)theme_->getTheme())->getWhereClause();
+	if (whereClause.empty() == false)
+		whereClause = " WHERE " + whereClause;
+
+	string q = ((TeTheme*)theme_->getTheme())->sqlJoin() + whereClause + orderBy_;
+	if (portal_->query(q) == false)
+	{
+		errorMessage_ = portal_->getDatabase()->errorMessage();
+		delete portal_;
+		portal_ = 0;
+		return false;
+	}
+
+	nRows_ = portal_->numRows();
+	nCols_ = portal_->numFields();
+
+	if (updateGrid2PortalColRelation == true)
+	{
+		grid2PortalColVec_.clear();
+		for (int i = 0; i < nCols_; ++i)
+			grid2PortalColVec_.push_back(i);
+	}
+
+	// Set the grid colors vector
+	setGridColorsVec();
+
+	emit dataChanged();
+	emit setColNamesSignal();
+	return true;
+}
+
+void TeQtGridSource::clearPortal()
+{
+	if (portal_)
+	{
+		delete portal_;
+		portal_ = 0;
+	}
+
+	errorMessage_.clear();
+	gridColorsVec_.clear();
+
+	nRows_ = nCols_ = 0;
+}
+
+
+bool TeQtGridSource::changePortalQuery(const string& orderBy)
+{
+	if (orderBy.empty() == true)
+	{
+		errorMessage_ = "The string that specifies the order must not be empty"; 
+		return false;
+	}
+
+	orderBy_ = orderBy;
+
+	portal_->freeResult();
+	string queryStr = ((TeTheme*)theme_->getTheme())->sqlJoin() + orderBy_;
+	if (portal_->query(queryStr) == false)
+	{
+		errorMessage_ = portal_->getDatabase()->errorMessage();
+		delete portal_;
+		portal_ = 0;
+		return false;
+	}
+
+	// Get the theme tables
+	vector<TeTable> tableVec;
+	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
+
+	unsigned int i;
+	int k = 0;
+	string uid;
+	while (portal_->fetchRow())
+	{
+		uid = portal_->getData(tableVec[0].uniqueName());
+		for (i = 1; i < tableVec.size(); ++i)
+			uid += portal_->getData(tableVec[i].uniqueName());
+		uid2PortalRowMap_[uid] = k;
+
+		grid2PortalRowVec_.push_back(k);
+		portal2GridRowVec_.push_back(k++);
+	}
+
+	// Initialize the relation between the grid columns and the portal columns
+	for (k = 0; k < nCols_; ++k)
+		grid2PortalColVec_.push_back(k);
+
+	// Set the grid colors vector
+	setGridColorsVec();
+
+	emit dataChanged();
+	return true;
+}
+
+QVariant TeQtGridSource::cell(int row, int col)
+{
+	QVariant v;
+	int portalRow = grid2PortalRowVec_[row];
+	int portalCol = grid2PortalColVec_[col];
+
+	if (portal_->fetchRow(portalRow))
+		v = portal_->getData(portalCol);
+
+	return v;
+}
+
+
+void TeQtGridSource::setCell(int row, int col, const QVariant &v)
+{
+	int portalRow = grid2PortalRowVec_[row];
+	int portalCol = grid2PortalColVec_[col];
+
+	// Get the name of the attribute that was edited
+	string attrNameEdited = ((TeTheme*)theme_->getTheme())->getAttribute(portalCol);
+
+	// Get the name of the theme table whose contents will be changed
+	string tableNameToEdit = ((TeTheme*)theme_->getTheme())->getTableName(attrNameEdited);
+
+	string newValue = v.toString().latin1();
+
+	// Find the unique name(primary key) of the table
+	TeTable table;
+	bool b = ((TeTheme*)theme_->getTheme())->getTable(table, tableNameToEdit);
+	if (b == false)
+	{
+		errorMessage_ = "There is no table with this name";
+		return;
+	}
+	string uniqueName = table.uniqueName();
+
+	// Check if the attribute to be edited is a primary key
+	// If positive, do not allow to edit this attribute
+	string attr;
+	size_t pos = attrNameEdited.find(".");
+	if (pos != string::npos)
+		attr = attrNameEdited.substr(pos + 1);
+	if (attr == uniqueName)
+	{
+		errorMessage_ = "This attribute cannot be edited because it is a primary key";
+		return;
+	}
+
+	// Find the name of the register corresponding to the unique name
+	string uniqueValue;
+	if (portal_->fetchRow(portalRow) == true)
+		uniqueValue = portal_->getData(uniqueName);
+
+	// Update the table in the database
+	TeDatabase* db = ((TeTheme*)theme_->getTheme())->layer()->database();
+	string q = "UPDATE " + tableNameToEdit + " SET " + attrNameEdited + " = '";
+	q += newValue + "' WHERE " + uniqueName + " = '" + uniqueValue + "'";
+	if (db->execute(q) == false)
+	{
+		errorMessage_ = db->errorMessage();
+		return;
+	}
+
+	// Update the portal due the changes in the database
+	portal_->freeResult();
+	string sqlJoin = ((TeTheme*)theme_->getTheme())->sqlJoin() + orderBy_;
+	if (portal_->query(sqlJoin) == false)
+	{
+		errorMessage_ = db->errorMessage();
+		delete portal_;
+		return;
+	}
+
+	emit dataChanged();
+}
+
+string TeQtGridSource::getUniqueId(int gridRow)
+{
+	string uid;
+	unsigned int i;
+
+	vector<TeTable> tableVec;
+	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
+
+	int portalRow = grid2PortalRowVec_[gridRow];
+	if (portal_->fetchRow(portalRow))
+	{
+		for (i = 0; i < tableVec.size(); ++i)
+		{
+			string s = portal_->getData(tableVec[i].uniqueName());
+			if (s.empty() == true)
+				s = " ";
+
+			uid += s;
+		}
+	}
+	return uid;
+}
+
+string TeQtGridSource::getObjectId(int gridRow)
+{
+	string objectId;
+
+	vector<TeTable> tableVec;
+	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
+
+	int portalRow = grid2PortalRowVec_[gridRow];
+	if (portal_->fetchRow(portalRow))
+		objectId = portal_->getData(tableVec[0].uniqueName());
+
+	return objectId;
+}
+
+void TeQtGridSource::setGridColorsVec()
+{
+	if (theme_ == 0)
+		return;
+
+	TeColor c;
+	QColor qc;
+
+	gridColorsVec_.clear();
+	gridColorsVec_.push_back(Qt::white);
+
+	c = ((TeTheme*)theme_->getTheme())->pointingLegend().visual(TePOLYGONS)->color();
+	qc = QColor(c.red_,c.green_,c.blue_);
+	gridColorsVec_.push_back(qc);
+
+	c = ((TeTheme*)theme_->getTheme())->queryLegend().visual(TePOLYGONS)->color();
+	qc = QColor(c.red_,c.green_,c.blue_);
+	gridColorsVec_.push_back(qc);
+
+	c = ((TeTheme*)theme_->getTheme())->queryAndPointingLegend().visual(TePOLYGONS)->color();
+	qc = QColor(c.red_,c.green_,c.blue_);
+	gridColorsVec_.push_back(qc);
+
+//	emit cellColorChanged();
+}
+
+QString TeQtGridSource::getPortalInfo(int gridCol)
+{
+	// Get the portal column relative to the given grid column
+	if (gridCol < 0)
+		return QString();
+
+	unsigned int portalCol = grid2PortalColVec_[gridCol];
+
+	// Get the attribute name and the table name associated to the portal column
+	string attrName = ((TeTheme*)theme_->getTheme())->getAttribute(portalCol);
+	string tableName = ((TeTheme*)theme_->getTheme())->getTableName(attrName);
+
+	// Get the representation of a table given an attribute name
+	TeTable table;
+
+	if (((TeTheme*)theme_->getTheme())->getTable(table, tableName) == false)
+		return QString();
+
+	QString qStr = tr("Table:") + " ";
+	qStr += tableName.c_str();
+	if(table.tableType() == TeAttrStatic)
+		qStr += " - " + tr("Table type: TeAttrStatic");
+	else if(table.tableType() == TeAttrExternal)
+		qStr += "  " + tr("Table type: TeAttrExternal");
+	else if(table.tableType() == TeAttrEvent)
+		qStr += " - " + tr("Table type: TeAttrEvent");
+	else if(table.tableType() == TeFixedGeomDynAttr)
+		qStr += " - " + tr("Table type: TeFixedGeomDynAttr");
+	else if(table.tableType() == TeDynGeomDynAttr)
+		qStr += " - " + tr("Table type: TeDynGeomDynAttr");
+
+	vector<TeAttribute>& attrVec = portal_->getAttributeList();
+	if(attrVec.size() > portalCol)
+	{
+		qStr += " - " + tr("Column:");
+		qStr += " ";
+		qStr += attrVec[portalCol].rep_.name_.c_str();
+
+		if(attrVec[portalCol].rep_.type_ == TeSTRING)
+		{
+			qStr += " - " + tr("Column type: TeSTRING");
+			qStr += " - " + tr("Num char:");
+			qStr += " ";
+			qStr += Te2String(attrVec[portalCol].rep_.numChar_).c_str();
+		}
+		else if(attrVec[portalCol].rep_.type_ == TeREAL)
+			qStr += "  " + tr("Column type: TeREAL");
+		else if(attrVec[portalCol].rep_.type_ == TeINT)
+			qStr += " - " + tr("Column type: TeINT");
+		else if(attrVec[portalCol].rep_.type_ == TeDATETIME)
+			qStr += " - " + tr("Column type: TeDATETIME");
+
+		// Get the single name of attrName
+		size_t pos = attrName.find(".");
+		if (pos != string::npos)
+			attrName = attrName.substr(pos + 1);
+
+		// Check if the attribute is editable
+		if(table.uniqueName() == attrName)
+			qStr += " - " + tr("Column is not editable");
+		else
+			qStr += " - " + tr("Column is editable");
+	}
+
+	return qStr;
+}
+
+
+vector<string> TeQtGridSource::getItemsToggled(int begin, int end)
+{
+	string item;
+	vector<string> itemVec;
+
+	// Get the theme tables
+	vector<TeTable> tableVec;
+	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
+
+	for (int i = begin; i <= end; ++i)
+	{
+		if (portal_->fetchRow(grid2PortalRowVec_[i]))
+		{
+			item = portal_->getData(tableVec[0].uniqueName());
+			for (unsigned j = 1; j < tableVec.size(); ++j)
+			{
+				string s = portal_->getData(tableVec[j].uniqueName());
+				if (s.empty() == true)
+					s = " ";
+
+				item += s;
+			}
+			itemVec.push_back(item);
+		}
+	}
+
+	return itemVec;
+}
+
+
+bool TeQtGridSource::isDateTimeRegistered(int gridCol)
+{
+	int portalCol = grid2PortalColVec_[gridCol];
+	string fullAttrName = ((TeTheme*)theme_->getTheme())->getAttribute(portalCol);
+
+	size_t pos = fullAttrName.find(".");
+	string tableName = fullAttrName.substr(0, pos);
+	string attrName = fullAttrName.substr(pos + 1);
+
+	// Get the representation of a table given an attribute name
+	TeTable table;
+	if (((TeTheme*)theme_->getTheme())->getTable(table, tableName) == false)
+		return false;
+
+	if(table.attInitialTime() == attrName || table.attFinalTime() == attrName)
+		return true;
+	return false;
+}
+
+
+void TeQtGridSource::sortColumns(const vector<int>& gridColsVec, const string& order)
+{
+	unsigned int i;
+	int portalCol;
+	string fullAttrName;
+
+	orderBy_ = " ORDER BY ";
+
+	for (i = 0; i < gridColsVec.size(); ++i)
+	{
+		portalCol = grid2PortalColVec_[gridColsVec[i]];
+		fullAttrName = ((TeTheme*)theme_->getTheme())->getAttribute(portalCol);
+
+		if (i != 0)
+			orderBy_ += ",";
+
+		orderBy_ += fullAttrName + " " + order;
+	}
+
+	reloadPortal();
+
+	// Update the relationships between the grid and portal rows
+	for (i = 0; i < grid2PortalRowVec_.size(); ++i)
+		grid2PortalRowVec_[i] = i;
+
+	for (i = 0; i < grid2PortalRowVec_.size(); ++i)
+		portal2GridRowVec_[i] = i;
+}
+
+
+/*
+void TeQtGridSource::sortColumns(const vector<int>& colsVec, const string& order)
+{
+	unsigned int i;
+	int portalCol;
+	string fullAttrName;
+
+	string orderBy = " ORDER BY ";
+
+	for (i = 0; i < colsVec.size(); ++i)
+	{
+		portalCol = grid2PortalColVec_[colsVec[i]];
+		fullAttrName = theme_->getAttribute(portalCol);
+
+		if (i != 0)
+			orderBy += ",";
+
+		orderBy += fullAttrName + " " + order;
+	}
+
+	changePortalQuery(orderBy);
+}
+*/
+
+
+
+
+int TeQtGridSource::getNextGridRowPointed(int gridRow)
+{
+	int i;
+	unsigned int j;
+	string oid, uid;
+	map<string, int>& uidStatusMap = ((TeTheme*)theme_->getTheme())->getItemStatusMap();
+
+	// Get the theme tables
+	vector<TeTable> tableVec;
+	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
+
+	for (i = gridRow; i < nRows_; ++i)
+	{
+		if (portal_->fetchRow(grid2PortalRowVec_[i]))
+		{
+			uid = oid = portal_->getData(tableVec[0].uniqueName());
+			for (j = 1; j < tableVec.size(); ++j)
+				uid += portal_->getData(tableVec[j].uniqueName());
+		}
+
+		int& uidStatus = uidStatusMap[uid];
+		if (uidStatus == TePOINTED || uidStatus == TePOINTED_QUERIED)
+			break;
+		else if (uidStatus == TeDEFAULT)
+			uidStatusMap.erase(uid);
+	}
+
+	return i;
+}
+
+
+int TeQtGridSource::getPrevGridRowPointed(int gridRow)
+{
+	int i;
+	unsigned int j;
+	string oid, uid;
+	map<string, int>& uidStatusMap = ((TeTheme*)theme_->getTheme())->getItemStatusMap();
+
+	// Get the theme tables
+	vector<TeTable> tableVec;
+	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
+
+	for (i = gridRow; i >= 0; --i)
+	{
+		if (portal_->fetchRow(grid2PortalRowVec_[i]))
+		{
+			uid = oid = portal_->getData(tableVec[0].uniqueName());
+			for (j = 1; j < tableVec.size(); ++j)
+				uid += portal_->getData(tableVec[j].uniqueName());
+		}
+
+		int& uidStatus = uidStatusMap[uid];
+		if (uidStatus == TePOINTED || uidStatus == TePOINTED_QUERIED)
+			break;
+		else if (uidStatus == TeDEFAULT)
+			uidStatusMap.erase(uid);
+	}
+
+	return i;
+}
+
+
+int TeQtGridSource::getNextGridRowQueried(int gridRow)
+{
+	int i;
+	unsigned int j;
+	string oid, uid;
+	map<string, int>& uidStatusMap = ((TeTheme*)theme_->getTheme())->getItemStatusMap();
+
+	// Get the theme tables
+	vector<TeTable> tableVec;
+	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
+
+	for (i = gridRow; i < nRows_; ++i)
+	{
+		if (portal_->fetchRow(grid2PortalRowVec_[i]))
+		{
+			uid = oid = portal_->getData(tableVec[0].uniqueName());
+			for (j = 1; j < tableVec.size(); ++j)
+				uid += portal_->getData(tableVec[j].uniqueName());
+		}
+
+		int& uidStatus = uidStatusMap[uid];
+		if (uidStatus == TeQUERIED || uidStatus == TePOINTED_QUERIED)
+			break;
+		else if (uidStatus == TeDEFAULT)
+			uidStatusMap.erase(uid);
+	}
+
+	return i;
+}
+
+int TeQtGridSource::getPrevGridRowQueried(int gridRow)
+{
+	int i;
+	unsigned int j;
+	string oid, uid;
+	map<string, int>& uidStatusMap = ((TeTheme*)theme_->getTheme())->getItemStatusMap();
+
+	// Get the theme tables
+	vector<TeTable> tableVec;
+	((TeTheme*)theme_->getTheme())->getAttTables(tableVec);
+
+	for (i = gridRow; i >= 0; --i)
+	{
+		if (portal_->fetchRow(grid2PortalRowVec_[i]))
+		{
+			uid = oid = portal_->getData(tableVec[0].uniqueName());
+			for (j = 1; j < tableVec.size(); ++j)
+				uid += portal_->getData(tableVec[j].uniqueName());
+		}
+
+		int& uidStatus = uidStatusMap[uid];
+		if (uidStatus == TeQUERIED || uidStatus == TePOINTED_QUERIED)
+			break;
+		else if (uidStatus == TeDEFAULT)
+			uidStatusMap.erase(uid);
+	}
+
+	return i;
+}
diff --git a/src/terralib/drivers/qt/TeQtGridSource.h b/src/terralib/drivers/qt/TeQtGridSource.h
old mode 100755
new mode 100644
index 695d6f5..0f336f8
--- a/src/terralib/drivers/qt/TeQtGridSource.h
+++ b/src/terralib/drivers/qt/TeQtGridSource.h
@@ -1,87 +1,88 @@
-#ifndef TEQTGRIDSOURCE_H
-#define TEQTGRIDSOURCE_H
-
-#include <TeQtDataSource.h>
-#include <TeDatabase.h>
-#include <string>
-
-#include <qcolor.h>
-
-class TeAppTheme;
-
-using namespace std;
-
-
-class TeQtGridSource : public TeQtDataSource
-{
-	Q_OBJECT
-
-public:
-	TeQtGridSource() : theme_(0), portal_(0), nRows_(0), nCols_(0)
-	{ }
-
-	~TeQtGridSource() {}
-
-	bool setPortal(TeAppTheme* theme);
-	bool reloadPortal(bool updateGrid2PortalColRelation = false);
-
-	TeAppTheme* getTheme() const { return theme_; }
-
-	bool changePortalQuery(const string& orderBy);
-
-	string& getOrderBy()
-	{ return orderBy_; }
-
-	void clearPortal();
-
-	QVariant cell(int row, int col);
-	void setCell(int row, int col, const QVariant &text);
-		
-	string getErrorMessage() const { return errorMessage_; }
-
-	int numRows() const { return nRows_; }
-	int numCols() const { return nCols_; }
-
-	string getUniqueId(int gridRow);
-	string getObjectId(int gridRow);
-	QString getPortalInfo(int gridCol);
-
-	vector<QColor>& gridColorsVec() { return gridColorsVec_; }
-
-	map<string, int>& uid2PortalRowMap() { return uid2PortalRowMap_; }
-	vector<int>& grid2PortalRowVec() { return grid2PortalRowVec_; }
-	vector<int>& portal2GridRowVec() { return portal2GridRowVec_; }
-	vector<int>& grid2PortalColVec() { return grid2PortalColVec_; }
-
-	vector<string> getItemsToggled(int begin, int end);
-	bool isDateTimeRegistered(int gridCol);
-	void sortColumns(const vector<int>& gridColsVec, const string& order);
-
-	int getNextGridRowPointed(int gridRow);
-	int getPrevGridRowPointed(int gridRow);
-	int getNextGridRowQueried(int gridRow);
-	int getPrevGridRowQueried(int gridRow);
-
-signals:
-	void setColNamesSignal();
-
-protected slots:
-	void setGridColorsVec();
-
-protected:
-	TeAppTheme* theme_;
-	TeDatabasePortal* portal_;
-	mutable string errorMessage_;
-	vector<QColor> gridColorsVec_;
-	map<string, int> uid2PortalRowMap_;
-	vector<int> grid2PortalRowVec_;
-	vector<int>	portal2GridRowVec_;
-	vector<int> grid2PortalColVec_;
-	string orderBy_;
-
-	int nRows_;
-	int nCols_;
-};
-
-
-#endif
+#ifndef TEQTGRIDSOURCE_H
+#define TEQTGRIDSOURCE_H
+
+#include <TeQtDataSource.h>
+#include <TeDatabase.h>
+
+#include <string>
+
+#include <qcolor.h>
+
+class TeAppTheme;
+
+using namespace std;
+
+
+class TLAPPUTILS_DLL TeQtGridSource : public TeQtDataSource
+{
+	Q_OBJECT
+
+public:
+	TeQtGridSource() : theme_(0), portal_(0), nRows_(0), nCols_(0)
+	{ }
+
+	~TeQtGridSource() {}
+
+	bool setPortal(TeAppTheme* theme);
+	bool reloadPortal(bool updateGrid2PortalColRelation = false);
+
+	TeAppTheme* getTheme() const { return theme_; }
+
+	bool changePortalQuery(const string& orderBy);
+
+	string& getOrderBy()
+	{ return orderBy_; }
+
+	void clearPortal();
+
+	QVariant cell(int row, int col);
+	void setCell(int row, int col, const QVariant &text);
+		
+	string getErrorMessage() const { return errorMessage_; }
+
+	int numRows() const { return nRows_; }
+	int numCols() const { return nCols_; }
+
+	string getUniqueId(int gridRow);
+	string getObjectId(int gridRow);
+	QString getPortalInfo(int gridCol);
+
+	vector<QColor>& gridColorsVec() { return gridColorsVec_; }
+
+	map<string, int>& uid2PortalRowMap() { return uid2PortalRowMap_; }
+	vector<int>& grid2PortalRowVec() { return grid2PortalRowVec_; }
+	vector<int>& portal2GridRowVec() { return portal2GridRowVec_; }
+	vector<int>& grid2PortalColVec() { return grid2PortalColVec_; }
+
+	vector<string> getItemsToggled(int begin, int end);
+	bool isDateTimeRegistered(int gridCol);
+	void sortColumns(const vector<int>& gridColsVec, const string& order);
+
+	int getNextGridRowPointed(int gridRow);
+	int getPrevGridRowPointed(int gridRow);
+	int getNextGridRowQueried(int gridRow);
+	int getPrevGridRowQueried(int gridRow);
+
+signals:
+	void setColNamesSignal();
+
+protected slots:
+	void setGridColorsVec();
+
+protected:
+	TeAppTheme* theme_;
+	TeDatabasePortal* portal_;
+	mutable string errorMessage_;
+	vector<QColor> gridColorsVec_;
+	map<string, int> uid2PortalRowMap_;
+	vector<int> grid2PortalRowVec_;
+	vector<int>	portal2GridRowVec_;
+	vector<int> grid2PortalColVec_;
+	string orderBy_;
+
+	int nRows_;
+	int nCols_;
+};
+
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtLatEdit.cpp b/src/terralib/drivers/qt/TeQtLatEdit.cpp
old mode 100755
new mode 100644
index b187d97..082c9ef
--- a/src/terralib/drivers/qt/TeQtLatEdit.cpp
+++ b/src/terralib/drivers/qt/TeQtLatEdit.cpp
@@ -1,131 +1,131 @@
-#include <qregexp.h>
-#include <qstringlist.h> 
-#include <math.h>
-
-#include "TeQtLatEdit.h"
-
-TeQtLatEdit::TeQtLatEdit(QWidget* parent, const char *name)
-	:QLineEdit(parent, name)
-{}
-
-bool
-TeQtLatEdit::decode(QString lado, short& dg, short& mn, float& sc, double& grauDec)
-{
-	short  	posat,lim = 90;
-
-	double	dd,pi;			
-	posat = 0;
-	pi = 4.*atan((double)1.);
-
-	// Longitude 
-	if(dg < 0 || dg > lim)	
-		return false;
-
-	if(mn < 0 || mn > 60)
-		return false;
-
-	if(sc < 0. || sc > 60.)
-		return false;
-
-	if(lado == "s" || lado == "S")
-	{
-		if(dg > 0) dg = dg * -1;
-		else if(mn > 0) mn = mn * -1;
-		     else sc = sc * -1.;
-	}
-
-	dd = (double)(abs(dg)) + ((double)abs(mn)/60.) + fabs(sc)/3600.;
-	if (dg < 0 || mn < 0 || (int)sc < 0)
-		dd = -dd;
-
-//	dd = dd*pi/180.;
-	grauDec = dd;
-	return true;
-}
-
-
-void TeQtLatEdit::focusOutEvent( QFocusEvent *e )
-{
-	int mat;
-    QString str = text();
-	QStringList myList;
-	QRegExp exp1("^[nNsS][ ]\\d\\d?\\d?[ ]?\\d?\\d?[ ]?\\d?\\d?\\.?[0-9]?" );
-	QRegExp exp2("^[nNsS][;]\\d\\d?\\d?[;]?\\d?\\d?[;]?\\d?\\d?\\.?[0-9]?" ); 
-	QRegExp exp3("^[nNsS][:]\\d\\d?\\d?[:]?\\d?\\d?[:]?\\d?\\d?\\.?[0-9]?" ); 
-	QRegExp exp4("^[+-]?\\d\\d?\\d?\\.?[0-9]?" ); 
-	QString echo_;
-
-	double grauDec;
-
-    if ( (mat=exp1.match( str )) != -1 )
-	{
-		myList = QStringList::split(" ",str);
-	}
-	else if ((mat=exp2.match( str )) != -1 )
-	{
-		myList = QStringList::split(";",str);
-	}
-	else if ((mat=exp3.match( str )) != -1 )
-	{
-		myList = QStringList::split(":",str);
-	}
-	else if ((mat=exp4.match( str )) != -1 )
-	{
-		grauDec = str.toDouble();
-		if ((grauDec >= -90.0 && grauDec <=90.0))
-		{
-			echo_.sprintf("%3.10f",grauDec);
-			setText(echo_);
-			emit coordValidator(grauDec);
-			return;
-		}
-		else
-		{
-			setSelection( 0, text().length() );
-			emit coordValidator(TeLATINVALID);
-			return;
-		}
-	}
-	else
-	{
-		setSelection( 0, text().length() );
-		emit coordValidator(TeLATINVALID);
-		return;
-	}
-
-	int nelementos = myList.count();
-	short graus, minutos = 0;
-	float segundos = 0.0;
-	
-	graus = myList[1].toShort();
-
-	if (nelementos > 2)
-		minutos = myList[2].toShort();
-	
-	if (nelementos > 3)
-		segundos = myList[3].toFloat();
-
-	bool dec = decode(myList[0],graus, minutos, segundos, grauDec);
-	if (dec)
-	{
-		echo_.sprintf("%s %d %d %2.2f",(const char*) myList[0], abs(graus), minutos, segundos);
-		setText(echo_);
-		emit coordValidator(grauDec);
-		return;
-	}
-	else
-	{
-		setSelection( 0, text().length() );
-		emit coordValidator(TeLATINVALID);
-		return;
-	}
-}
-
-void TeQtLatEdit::keyPressEvent( QKeyEvent *e )
-{
-    QLineEdit::keyPressEvent( e );
-    if ( e->key() == Key_Enter || e->key() == Key_Return )
-    {
-        emit focusOutEvent(0);
-    }
+#include <qregexp.h>
+#include <qstringlist.h> 
+#include <math.h>
+
+#include "TeQtLatEdit.h"
+
+TeQtLatEdit::TeQtLatEdit(QWidget* parent, const char *name)
+	:QLineEdit(parent, name)
+{}
+
+bool
+TeQtLatEdit::decode(QString lado, short& dg, short& mn, float& sc, double& grauDec)
+{
+	short  	posat,lim = 90;
+
+	double	dd,pi;			
+	posat = 0;
+	pi = 4.*atan((double)1.);
+
+	// Longitude 
+	if(dg < 0 || dg > lim)	
+		return false;
+
+	if(mn < 0 || mn > 60)
+		return false;
+
+	if(sc < 0. || sc > 60.)
+		return false;
+
+	if(lado == "s" || lado == "S")
+	{
+		if(dg > 0) dg = dg * -1;
+		else if(mn > 0) mn = mn * -1;
+		     else sc = sc * -1.;
+	}
+
+	dd = (double)(abs(dg)) + ((double)abs(mn)/60.) + fabs(sc)/3600.;
+	if (dg < 0 || mn < 0 || (int)sc < 0)
+		dd = -dd;
+
+//	dd = dd*pi/180.;
+	grauDec = dd;
+	return true;
+}
+
+
+void TeQtLatEdit::focusOutEvent( QFocusEvent *e )
+{
+	int mat;
+    QString str = text();
+	QStringList myList;
+	QRegExp exp1("^[nNsS][ ]\\d\\d?\\d?[ ]?\\d?\\d?[ ]?\\d?\\d?\\.?[0-9]?" );
+	QRegExp exp2("^[nNsS][;]\\d\\d?\\d?[;]?\\d?\\d?[;]?\\d?\\d?\\.?[0-9]?" ); 
+	QRegExp exp3("^[nNsS][:]\\d\\d?\\d?[:]?\\d?\\d?[:]?\\d?\\d?\\.?[0-9]?" ); 
+	QRegExp exp4("^[+-]?\\d\\d?\\d?\\.?[0-9]?" ); 
+	QString echo_;
+
+	double grauDec;
+
+    if ( (mat=exp1.match( str )) != -1 )
+	{
+		myList = QStringList::split(" ",str);
+	}
+	else if ((mat=exp2.match( str )) != -1 )
+	{
+		myList = QStringList::split(";",str);
+	}
+	else if ((mat=exp3.match( str )) != -1 )
+	{
+		myList = QStringList::split(":",str);
+	}
+	else if ((mat=exp4.match( str )) != -1 )
+	{
+		grauDec = str.toDouble();
+		if ((grauDec >= -90.0 && grauDec <=90.0))
+		{
+			echo_.sprintf("%3.10f",grauDec);
+			setText(echo_);
+			emit coordValidator(grauDec);
+			return;
+		}
+		else
+		{
+			setSelection( 0, text().length() );
+			emit coordValidator(TeLATINVALID);
+			return;
+		}
+	}
+	else
+	{
+		setSelection( 0, text().length() );
+		emit coordValidator(TeLATINVALID);
+		return;
+	}
+
+	int nelementos = myList.count();
+	short graus, minutos = 0;
+	float segundos = 0.0;
+	
+	graus = myList[1].toShort();
+
+	if (nelementos > 2)
+		minutos = myList[2].toShort();
+	
+	if (nelementos > 3)
+		segundos = myList[3].toFloat();
+
+	bool dec = decode(myList[0],graus, minutos, segundos, grauDec);
+	if (dec)
+	{
+		echo_.sprintf("%s %d %d %2.2f",(const char*) myList[0], abs(graus), minutos, segundos);
+		setText(echo_);
+		emit coordValidator(grauDec);
+		return;
+	}
+	else
+	{
+		setSelection( 0, text().length() );
+		emit coordValidator(TeLATINVALID);
+		return;
+	}
+}
+
+void TeQtLatEdit::keyPressEvent( QKeyEvent *e )
+{
+    QLineEdit::keyPressEvent( e );
+    if ( e->key() == Key_Enter || e->key() == Key_Return )
+    {
+        emit focusOutEvent(0);
+    }
 }
\ No newline at end of file
diff --git a/src/terralib/drivers/qt/TeQtLatEdit.h b/src/terralib/drivers/qt/TeQtLatEdit.h
old mode 100755
new mode 100644
index 2b02b2a..df122da
--- a/src/terralib/drivers/qt/TeQtLatEdit.h
+++ b/src/terralib/drivers/qt/TeQtLatEdit.h
@@ -1,24 +1,24 @@
-#ifndef TEQTLATEDIT_H
-#define TEQTLATEDIT_H
-
-#include <qlineedit.h>
-#include <qstring.h> 
-#include <qwidget.h>
-
-#define TeLATINVALID -99.99
-
-class TeQtLatEdit : public QLineEdit
-{
-    Q_OBJECT
-public:
-	TeQtLatEdit(QWidget * parent, const char* name);
-	bool decode(QString lado, short& dg, short& mn, float& sc, double& grauDec);
-
-protected:
-    void focusOutEvent( QFocusEvent *e );
-    void keyPressEvent( QKeyEvent *e );
-
-signals:
-    void coordValidator(const double&);
-};
+#ifndef TEQTLATEDIT_H
+#define TEQTLATEDIT_H
+
+#include <qlineedit.h>
+#include <qstring.h> 
+#include <qwidget.h>
+
+#define TeLATINVALID -99.99
+
+class TeQtLatEdit : public QLineEdit
+{
+    Q_OBJECT
+public:
+	TeQtLatEdit(QWidget * parent, const char* name);
+	bool decode(QString lado, short& dg, short& mn, float& sc, double& grauDec);
+
+protected:
+    void focusOutEvent( QFocusEvent *e );
+    void keyPressEvent( QKeyEvent *e );
+
+signals:
+    void coordValidator(const double&);
+};
 #endif
\ No newline at end of file
diff --git a/src/terralib/drivers/qt/TeQtLayerItem.cpp b/src/terralib/drivers/qt/TeQtLayerItem.cpp
old mode 100755
new mode 100644
index 1621dcd..d64fda4
--- a/src/terralib/drivers/qt/TeQtLayerItem.cpp
+++ b/src/terralib/drivers/qt/TeQtLayerItem.cpp
@@ -1,43 +1,43 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtLayerItem.h>
-#include <qpixmap.h>
-#include <images/infolayer.xpm>
-
-
-//Layer item constructor
-TeQtLayerItem::TeQtLayerItem(QListViewItem *parent, 
-		QString name, TeLayer* layer)
-		: TeQtCheckListItem(parent,name), layer_(layer) 
-{
-	type_ = INFOLAYER;
-	QPixmap p(infolayer_xpm);
-	setPixmap(0,p);
-	setRenameEnabled(0,true);
-	sortChildItems(0, true);
-	setSelected(false);
-	setEnabled(true);
-}
-
-
-
-				
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeQtLayerItem.h>
+#include <qpixmap.h>
+#include <images/infolayer.xpm>
+
+
+//Layer item constructor
+TeQtLayerItem::TeQtLayerItem(QListViewItem *parent, 
+		QString name, TeLayer* layer)
+		: TeQtCheckListItem(parent,name), layer_(layer) 
+{
+	type_ = INFOLAYER;
+	QPixmap p(infolayer_xpm);
+	setPixmap(0,p);
+	setRenameEnabled(0,true);
+	sortChildItems(0, true);
+	setSelected(false);
+	setEnabled(true);
+}
+
+
+
+				
diff --git a/src/terralib/drivers/qt/TeQtLayerItem.h b/src/terralib/drivers/qt/TeQtLayerItem.h
old mode 100755
new mode 100644
index 178f4d6..cba44c6
--- a/src/terralib/drivers/qt/TeQtLayerItem.h
+++ b/src/terralib/drivers/qt/TeQtLayerItem.h
@@ -1,49 +1,49 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTLAYERITEM_H
-#define  __TERRALIB_INTERNAL_QTLAYERITEM_H
-
-#include <TeQtCheckListItem.h>
-
-class TeLayer;
-
-
-class TeQtLayerItem : public TeQtCheckListItem
-{
-public:
-    TeQtLayerItem(QListViewItem *parent, QString text, TeLayer* layer);
-
-	~TeQtLayerItem () {}
-
-	int compare(QListViewItem * i, int col, bool ascending) const
-		{ return QListViewItem::compare(i, col, ascending); }
-
-	QString key(int col, bool ascending) const
-		{ return QListViewItem::key(col, ascending); }
-
-	TeLayer* getLayer() {return layer_;}
-
-protected:
-	TeLayer	*layer_;
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTLAYERITEM_H
+#define  __TERRALIB_INTERNAL_QTLAYERITEM_H
+
+#include <TeQtCheckListItem.h>
+
+class TeLayer;
+
+
+class TLAPPUTILS_DLL TeQtLayerItem : public TeQtCheckListItem
+{
+public:
+    TeQtLayerItem(QListViewItem *parent, QString text, TeLayer* layer);
+
+	~TeQtLayerItem () {}
+
+	int compare(QListViewItem * i, int col, bool ascending) const
+		{ return QListViewItem::compare(i, col, ascending); }
+
+	QString key(int col, bool ascending) const
+		{ return QListViewItem::key(col, ascending); }
+
+	TeLayer* getLayer() {return layer_;}
+
+protected:
+	TeLayer	*layer_;
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtLayerItemFCT.cpp b/src/terralib/drivers/qt/TeQtLayerItemFCT.cpp
deleted file mode 100755
index 0f8392b..0000000
--- a/src/terralib/drivers/qt/TeQtLayerItemFCT.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtLayerItemFCT.h>
-#include <qpixmap.h>
-//#include <../../../../../terraBase/src/ui/images/infolayer.xpm>
-
-
-//Layer item constructor
-TeQtLayerItem::TeQtLayerItem(QListViewItem *parent, 
-		QString name, TeLayer* layer)
-		: TeQtCheckListItem(parent,name), layer_(layer) 
-{
-	type_ = INFOLAYER;
-//	QPixmap p(infolayer_xpm);
-	QPixmap p = QPixmap::fromMimeSource("infolayer.bmp"); //(database_xpm);
-	setPixmap(0,p);
-	setRenameEnabled(0,true);
-	sortChildItems(0, true);
-	setSelected(false);
-	setEnabled(true);
-}
-
-
-
-				
diff --git a/src/terralib/drivers/qt/TeQtLayerItemFCT.h b/src/terralib/drivers/qt/TeQtLayerItemFCT.h
deleted file mode 100755
index 178f4d6..0000000
--- a/src/terralib/drivers/qt/TeQtLayerItemFCT.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTLAYERITEM_H
-#define  __TERRALIB_INTERNAL_QTLAYERITEM_H
-
-#include <TeQtCheckListItem.h>
-
-class TeLayer;
-
-
-class TeQtLayerItem : public TeQtCheckListItem
-{
-public:
-    TeQtLayerItem(QListViewItem *parent, QString text, TeLayer* layer);
-
-	~TeQtLayerItem () {}
-
-	int compare(QListViewItem * i, int col, bool ascending) const
-		{ return QListViewItem::compare(i, col, ascending); }
-
-	QString key(int col, bool ascending) const
-		{ return QListViewItem::key(col, ascending); }
-
-	TeLayer* getLayer() {return layer_;}
-
-protected:
-	TeLayer	*layer_;
-};
-
-#endif
diff --git a/src/terralib/drivers/qt/TeQtLegendItem.cpp b/src/terralib/drivers/qt/TeQtLegendItem.cpp
old mode 100755
new mode 100644
index c58085f..04aec56
--- a/src/terralib/drivers/qt/TeQtLegendItem.cpp
+++ b/src/terralib/drivers/qt/TeQtLegendItem.cpp
@@ -1,351 +1,351 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtLegendItem.h>
-#include <TeQtViewsListView.h>
-#include <TeLegendEntry.h>
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qbitmap.h>
-#include <qimage.h>
-#include <qfontmetrics.h>
-
-
-//Legend item constructor
-TeQtLegendItem::TeQtLegendItem(QListViewItem *parent,
-				QString text, TeLegendEntry *legendEntry)
-	: TeQtCheckListItem(parent, text), legendEntry_(legendEntry)
-{
-	type_ = LEGEND;
-	setRenameEnabled(0,true);
-	setSelected(false);
-	setEnabled(true);
-
-	order_ = parent->childCount();
-
-//	if (legendEntry_ != 0)
-//		createPixmap();
-}
-
-
-QPixmap TeQtLegendItem::createPixmap()
-{
-	int	ww = 21;
-	int	pixh = 16;
-	int	pixw = ww;
-
-	QPixmap	pixmap(ww, pixh);
-	pixmap.fill();
-
-// TePOLYGONS = 1, TeLINES = 2, TePOINTS = 4, TeCELLS = 256
-	bool hasPolygons = true;
-	bool hasCells = true;
-	bool hasLines = true;
-	bool hasPoints = true;
-
-	if(legendEntry_->to().find("mean = ") == string::npos)
-	{
-		TeGeomRepVisualMap& vm = legendEntry_->getVisualMap();
-		if(vm.find(TePOLYGONS) == vm.end())
-		{
-			hasPolygons = false;
-			hasCells = false;
-		}
-		if(vm.find(TeLINES) == vm.end())
-			hasLines = false;
-		if(vm.find(TePOINTS) == vm.end())
-			hasPoints = false;
-
-		if ((hasPolygons || hasCells) && (hasLines == false) && (hasPoints == false))
-			drawPolygonRep(pixw, pixh, 0, &pixmap);
-		else if ((hasPolygons || hasCells) && (hasLines == true) && (hasPoints == false))
-		{
-			pixmap.resize(2*ww, pixh);
-			pixmap.fill();
-			drawPolygonRep(pixw, pixh, 0, &pixmap);
-			drawLineRep(ww, &pixmap);
-		}
-		else if ((hasPolygons || hasCells) && (hasLines == false) && (hasPoints == true))
-		{
-			pixmap.resize(2*ww, pixh);
-			pixmap.fill();
-			drawPolygonRep(pixw, pixh, 0, &pixmap);
-			drawPointRep(pixw, pixh, ww, &pixmap);
-		}
-		else if ((hasPolygons || hasCells) && (hasLines == true) && (hasPoints == true))
-		{
-			pixmap.resize(3*ww, pixh);
-			pixmap.fill();
-			drawPolygonRep(pixw, pixh, 0, &pixmap);
-			drawLineRep(ww, &pixmap);
-			drawPointRep(pixw, pixh, 2*ww, &pixmap);
-		}
-		else if (hasPolygons == false && hasCells == false && hasLines == true && hasPoints == false)
-			drawLineRep(0, &pixmap);
-		else if (hasPolygons == false && hasCells == false && hasLines == false && hasPoints == true)
-			drawPointRep(pixw, pixh, 0, &pixmap);
-		else if (hasPolygons == false && hasCells == false && hasLines == true && hasPoints == true)
-		{
-			pixmap.resize(2*ww, pixh);
-			pixmap.fill();
-			drawLineRep(0, &pixmap);
-			drawPointRep(pixw, pixh, ww, &pixmap);
-		}
-	}
-//	setPixmap(0, pixmap);
-	return pixmap;
-}
-
-
-void TeQtLegendItem::changeVisual(TeLegendEntry *legendEntry)
-{
-	legendEntry_ = legendEntry;
-//	createPixmap();
-}
-
-void TeQtLegendItem::paintCell(QPainter* p, const QColorGroup& /* cg */, int /* column */, int width , int align)
-{
-//	TeQtCheckListItem::paintCell(p, cg, column, width, align);
-	QPixmap pixmap = createPixmap();
-	QRect r(QPoint(0, 0), QPoint(width - 1, height() - 1));
-	p->fillRect(r, QBrush(Qt::white));
-
-	p->drawPixmap(0, 0, pixmap);
-	
-	QRect r1(QPoint(pixmap.width(), 0), QPoint(width - 1, height() - 1));
-	p->drawText(r1, align, text());
-
-	QListView* lv = listView();
-	QFontMetrics fm = lv->fontMetrics();
-	int w1 = lv->treeStepSize() * ( depth() + ( lv->rootIsDecorated() ? 1 : 0) ) + lv->itemMargin();
-	int w = pixmap.width() + fm.width(text()) + w1;
-	lv->setColumnWidth(0, QMAX(lv->columnWidth(0), w));
-}
-
-
-void TeQtLegendItem::drawPolygonRep(int w, int h, int offset, QPixmap *pixmap)
-{
-	QPainter p(pixmap);
-	QBrush	 brush;
-	QColor	 cor;
-	TeColor	 tcor;
-	Qt::BrushStyle	style;
-
-	TeVisual* visual = legendEntry_->visual(TePOLYGONS);
-	int transp = 255 - (visual->transparency() * 255 / 100);
-	tcor = visual->color();
-	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
-	TeQtViewsListView* viewsListView = (TeQtViewsListView*) listView();
-	map<TePolyBasicType, Qt::BrushStyle>& brushMap = viewsListView->getBrushStyleMap();
-
-	style = brushMap[(TePolyBasicType)(legendEntry_->visual(TePOLYGONS)->style())];
-	brush.setStyle(style);
-	brush.setColor(cor);
-
-	QRect trect(offset+1, 1, w-2, h-2);
-	QRect rect(0, 0, offset+w-1, h-1);
-
-	int width = rect.width();
-	int height = rect.height();
-
-	int r = width%8;
-	if(r)
-		width += (8-r);
-	r = height%8;
-	if(r)
-		height += (8-r);
-
-	if(width == 0)
-		width = 8;
-	if(height == 0)
-		height = 8;
-
-	QBitmap	bm;
-	bm.resize(width, height);
-	//Fill bitmap with 0-bits: clipping region
-	bm.fill(Qt::color0);
-	QPainter maskPainter(&bm);
-
-	// Draw bitmap with 1-bits: drawing region
-	QBrush bs(Qt::color1, style);
-	QPen pen(Qt::color1, 1);
-	maskPainter.setPen(pen);
- 	maskPainter.fillRect(trect, bs);
-	maskPainter.end();
-
-	QRegion clipRegion(bm);
-	p.setClipRegion(clipRegion);
-
-	if(visual->transparency() == 0)
-		p.fillRect(trect, brush);
-	else
-	{
-		// set alpha buffer and color
-		QImage img(rect.width(), rect.height(), 32);
-		unsigned int val = (transp << 24) | (cor.red() << 16) | (cor.green() << 8) | cor.blue();
-		img.fill(val);
-		img.setAlphaBuffer(true);
-
-		// plot transparency
-		p.drawPixmap(trect.x(), trect.y(), img);
-	}
-	p.setClipping(false);
-
-	Qt::PenStyle pstyle;
-	uint		pwidth;
-
-	tcor = visual->contourColor();
-	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
-	pen.setColor(cor);
-
-	map<TeLnBasicType, Qt::PenStyle>& penMap = viewsListView->getPenStyleMap();
-	pstyle = penMap[(TeLnBasicType)(visual->contourStyle())];
-	pen.setStyle(pstyle);
-
-	pwidth = (Qt::PenStyle) visual->contourWidth();
-	pen.setWidth (pwidth);
-
-	p.setPen(pen);
-	p.drawRect (offset+1+pwidth/2,1+pwidth/2,w-2-pwidth/2,h-2-pwidth/2);
-
-	p.end();
-}
-
-void TeQtLegendItem::drawLineRep(int offset, QPixmap *pixmap)
-{
-	QPainter	p(pixmap);
-	QPen		pen;
-	QColor		cor;
-	TeColor		tcor;
-	Qt::PenStyle style;
-	uint		width;
-
-	TeVisual* visual = legendEntry_->visual(TeLINES);
-
-	tcor = visual->color();
-	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
-	pen.setColor(cor);
-
-	TeQtViewsListView* viewsListView = (TeQtViewsListView*) listView();
-	map<TeLnBasicType, Qt::PenStyle>& penMap = viewsListView->getPenStyleMap();
-
-	style = penMap[(TeLnBasicType)(legendEntry_->visual(TeLINES)->style())];
-	pen.setStyle(style);
-
-	width = (Qt::PenStyle) legendEntry_->visual(TeLINES)->width();
-	pen.setWidth (width);
-
-	p.setPen(pen);
-	p.moveTo(offset+1, 5);
-	p.lineTo(offset+3, 5);
-	p.lineTo(offset+6, 6);
-	p.lineTo(offset+8, 8);
-	p.lineTo(offset+10, 9);
-	p.lineTo(offset+14, 10);
-	p.lineTo(offset+16, 10);
-	p.lineTo(offset+18, 9);
-	p.lineTo(offset+19, 9);
-	p.moveTo(offset+2, 13);
-	p.lineTo(offset+3, 12);
-	p.lineTo(offset+5, 11);
-	p.lineTo(offset+6, 11);
-	p.lineTo(offset+9, 10);
-	p.lineTo(offset+10, 9);
-	p.end();
-}
-
-
-void TeQtLegendItem::drawPointRep( int pw, int ph, int offset, QPixmap *pixmap)
-{
-	QPainter	painter(pixmap);
-	QColor		cor;
-	TeColor		tcor;
-
-	TeVisual* visual = legendEntry_->visual(TePOINTS);
-	tcor = visual->color();
-	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
-	int s = visual->style();
-
-	int	w = visual->size();
-	QPoint	p;
-	p.setX(offset+pw/2);
-	p.setY(ph/2-1);
-
-	painter.setPen(cor);
-	if (s == TePtTypePlus)
-	{
-		painter.drawLine (p.x()-w/2,p.y(),p.x()+w/2,p.y());
-		painter.drawLine (p.x(),p.y()-w/2,p.x(),p.y()+w/2);
-	}
-	else if (s == TePtTypeStar)
-	{
-		painter.save ();
-		painter.translate (p.x(),p.y());
-		painter.drawLine (0,-w/2,0,w/2);
-		painter.rotate (45);
-		painter.drawLine (0,-w/2,0,w/2);
-		painter.rotate (-90);
-		painter.drawLine (0,-w/2,0,w/2);
-		painter.restore ();
-	}
-	else if (s == TePtTypeCircle)
-	{
-		painter.setBrush(cor);
-		painter.drawChord (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
-	}
-	else if (s == TePtTypeX)
-	{
-		painter.drawLine (p.x()-w/2,p.y()-w/2,p.x()+w/2,p.y()+w/2);
-		painter.drawLine (p.x()-w/2,p.y()+w/2,p.x()+w/2,p.y()-w/2);
-	}
-	else if (s == TePtTypeBox)
-	{
-		painter.fillRect (p.x()-w/2,p.y()-w/2,w,w,cor);
-	}
-	else if (s == TePtTypeDiamond)
-	{
-		QPointArray pa(5);
-		pa.setPoint(0, p.x()-w/2, p.y());
-		pa.setPoint(1, p.x(), p.y()-w/2);
-		pa.setPoint(2, p.x()+w/2, p.y());
-		pa.setPoint(3, p.x(), p.y()+w/2);
- 		pa.setPoint(4, p.x()-w/2, p.y());
-		painter.setBrush(cor);
-		painter.drawPolygon(pa);
-	}
-	else if (s == TePtTypeHollowCircle)
-	{
-		painter.drawArc (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
-	}
-	else if (s == TePtTypeHollowBox)
-	{
-		painter.setBrush(Qt::NoBrush);
-		painter.drawRect (p.x()-w/2,p.y()-w/2,w,w);
-	}
-	else if (s == TePtTypeHollowDiamond)
-	{
-		painter.drawLine (p.x()-w/2,p.y(),p.x(),p.y()-w/2);
-		painter.drawLine (p.x(),p.y()-w/2,p.x()+w/2,p.y());
-		painter.drawLine (p.x()+w/2,p.y(),p.x(),p.y()+w/2);
-		painter.drawLine (p.x(),p.y()+w/2,p.x()-w/2,p.y());
-	}
-	painter.end();
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeQtLegendItem.h>
+#include <TeQtViewsListView.h>
+#include <TeLegendEntry.h>
+#include <qpixmap.h>
+#include <qpainter.h>
+#include <qbitmap.h>
+#include <qimage.h>
+#include <qfontmetrics.h>
+
+
+//Legend item constructor
+TeQtLegendItem::TeQtLegendItem(QListViewItem *parent,
+				QString text, TeLegendEntry *legendEntry)
+	: TeQtCheckListItem(parent, text), legendEntry_(legendEntry)
+{
+	type_ = LEGEND;
+	setRenameEnabled(0,true);
+	setSelected(false);
+	setEnabled(true);
+
+	order_ = parent->childCount();
+
+//	if (legendEntry_ != 0)
+//		createPixmap();
+}
+
+
+QPixmap TeQtLegendItem::createPixmap()
+{
+	int	ww = 21;
+	int	pixh = 16;
+	int	pixw = ww;
+
+	QPixmap	pixmap(ww, pixh);
+	pixmap.fill();
+
+// TePOLYGONS = 1, TeLINES = 2, TePOINTS = 4, TeCELLS = 256
+	bool hasPolygons = true;
+	bool hasCells = true;
+	bool hasLines = true;
+	bool hasPoints = true;
+
+	if(legendEntry_->to().find("mean = ") == string::npos)
+	{
+		TeGeomRepVisualMap& vm = legendEntry_->getVisualMap();
+		if(vm.find(TePOLYGONS) == vm.end())
+		{
+			hasPolygons = false;
+			hasCells = false;
+		}
+		if(vm.find(TeLINES) == vm.end())
+			hasLines = false;
+		if(vm.find(TePOINTS) == vm.end())
+			hasPoints = false;
+
+		if ((hasPolygons || hasCells) && (hasLines == false) && (hasPoints == false))
+			drawPolygonRep(pixw, pixh, 0, &pixmap);
+		else if ((hasPolygons || hasCells) && (hasLines == true) && (hasPoints == false))
+		{
+			pixmap.resize(2*ww, pixh);
+			pixmap.fill();
+			drawPolygonRep(pixw, pixh, 0, &pixmap);
+			drawLineRep(ww, &pixmap);
+		}
+		else if ((hasPolygons || hasCells) && (hasLines == false) && (hasPoints == true))
+		{
+			pixmap.resize(2*ww, pixh);
+			pixmap.fill();
+			drawPolygonRep(pixw, pixh, 0, &pixmap);
+			drawPointRep(pixw, pixh, ww, &pixmap);
+		}
+		else if ((hasPolygons || hasCells) && (hasLines == true) && (hasPoints == true))
+		{
+			pixmap.resize(3*ww, pixh);
+			pixmap.fill();
+			drawPolygonRep(pixw, pixh, 0, &pixmap);
+			drawLineRep(ww, &pixmap);
+			drawPointRep(pixw, pixh, 2*ww, &pixmap);
+		}
+		else if (hasPolygons == false && hasCells == false && hasLines == true && hasPoints == false)
+			drawLineRep(0, &pixmap);
+		else if (hasPolygons == false && hasCells == false && hasLines == false && hasPoints == true)
+			drawPointRep(pixw, pixh, 0, &pixmap);
+		else if (hasPolygons == false && hasCells == false && hasLines == true && hasPoints == true)
+		{
+			pixmap.resize(2*ww, pixh);
+			pixmap.fill();
+			drawLineRep(0, &pixmap);
+			drawPointRep(pixw, pixh, ww, &pixmap);
+		}
+	}
+//	setPixmap(0, pixmap);
+	return pixmap;
+}
+
+
+void TeQtLegendItem::changeVisual(TeLegendEntry *legendEntry)
+{
+	legendEntry_ = legendEntry;
+//	createPixmap();
+}
+
+void TeQtLegendItem::paintCell(QPainter* p, const QColorGroup& /* cg */, int /* column */, int width , int align)
+{
+//	TeQtCheckListItem::paintCell(p, cg, column, width, align);
+	QPixmap pixmap = createPixmap();
+	QRect r(QPoint(0, 0), QPoint(width - 1, height() - 1));
+	p->fillRect(r, QBrush(Qt::white));
+
+	p->drawPixmap(0, 0, pixmap);
+	
+	QRect r1(QPoint(pixmap.width(), 0), QPoint(width - 1, height() - 1));
+	p->drawText(r1, align, text());
+
+	QListView* lv = listView();
+	QFontMetrics fm = lv->fontMetrics();
+	int w1 = lv->treeStepSize() * ( depth() + ( lv->rootIsDecorated() ? 1 : 0) ) + lv->itemMargin();
+	int w = pixmap.width() + fm.width(text()) + w1;
+	lv->setColumnWidth(0, QMAX(lv->columnWidth(0), w));
+}
+
+
+void TeQtLegendItem::drawPolygonRep(int w, int h, int offset, QPixmap *pixmap)
+{
+	QPainter p(pixmap);
+	QBrush	 brush;
+	QColor	 cor;
+	TeColor	 tcor;
+	Qt::BrushStyle	style;
+
+	TeVisual* visual = legendEntry_->visual(TePOLYGONS);
+	int transp = 255 - (visual->transparency() * 255 / 100);
+	tcor = visual->color();
+	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
+	TeQtViewsListView* viewsListView = (TeQtViewsListView*) listView();
+	map<TePolyBasicType, Qt::BrushStyle>& brushMap = viewsListView->getBrushStyleMap();
+
+	style = brushMap[(TePolyBasicType)(legendEntry_->visual(TePOLYGONS)->style())];
+	brush.setStyle(style);
+	brush.setColor(cor);
+
+	QRect trect(offset+1, 1, w-2, h-2);
+	QRect rect(0, 0, offset+w-1, h-1);
+
+	int width = rect.width();
+	int height = rect.height();
+
+	int r = width%8;
+	if(r)
+		width += (8-r);
+	r = height%8;
+	if(r)
+		height += (8-r);
+
+	if(width == 0)
+		width = 8;
+	if(height == 0)
+		height = 8;
+
+	QBitmap	bm;
+	bm.resize(width, height);
+	//Fill bitmap with 0-bits: clipping region
+	bm.fill(Qt::color0);
+	QPainter maskPainter(&bm);
+
+	// Draw bitmap with 1-bits: drawing region
+	QBrush bs(Qt::color1, style);
+	QPen pen(Qt::color1, 1);
+	maskPainter.setPen(pen);
+ 	maskPainter.fillRect(trect, bs);
+	maskPainter.end();
+
+	QRegion clipRegion(bm);
+	p.setClipRegion(clipRegion);
+
+	if(visual->transparency() == 0)
+		p.fillRect(trect, brush);
+	else
+	{
+		// set alpha buffer and color
+		QImage img(rect.width(), rect.height(), 32);
+		unsigned int val = (transp << 24) | (cor.red() << 16) | (cor.green() << 8) | cor.blue();
+		img.fill(val);
+		img.setAlphaBuffer(true);
+
+		// plot transparency
+		p.drawPixmap(trect.x(), trect.y(), img);
+	}
+	p.setClipping(false);
+
+	Qt::PenStyle pstyle;
+	uint		pwidth;
+
+	tcor = visual->contourColor();
+	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
+	pen.setColor(cor);
+
+	map<TeLnBasicType, Qt::PenStyle>& penMap = viewsListView->getPenStyleMap();
+	pstyle = penMap[(TeLnBasicType)(visual->contourStyle())];
+	pen.setStyle(pstyle);
+
+	pwidth = (Qt::PenStyle) visual->contourWidth();
+	pen.setWidth (pwidth);
+
+	p.setPen(pen);
+	p.drawRect (offset+1+pwidth/2,1+pwidth/2,w-2-pwidth/2,h-2-pwidth/2);
+
+	p.end();
+}
+
+void TeQtLegendItem::drawLineRep(int offset, QPixmap *pixmap)
+{
+	QPainter	p(pixmap);
+	QPen		pen;
+	QColor		cor;
+	TeColor		tcor;
+	Qt::PenStyle style;
+	uint		width;
+
+	TeVisual* visual = legendEntry_->visual(TeLINES);
+
+	tcor = visual->color();
+	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
+	pen.setColor(cor);
+
+	TeQtViewsListView* viewsListView = (TeQtViewsListView*) listView();
+	map<TeLnBasicType, Qt::PenStyle>& penMap = viewsListView->getPenStyleMap();
+
+	style = penMap[(TeLnBasicType)(legendEntry_->visual(TeLINES)->style())];
+	pen.setStyle(style);
+
+	width = (Qt::PenStyle) legendEntry_->visual(TeLINES)->width();
+	pen.setWidth (width);
+
+	p.setPen(pen);
+	p.moveTo(offset+1, 5);
+	p.lineTo(offset+3, 5);
+	p.lineTo(offset+6, 6);
+	p.lineTo(offset+8, 8);
+	p.lineTo(offset+10, 9);
+	p.lineTo(offset+14, 10);
+	p.lineTo(offset+16, 10);
+	p.lineTo(offset+18, 9);
+	p.lineTo(offset+19, 9);
+	p.moveTo(offset+2, 13);
+	p.lineTo(offset+3, 12);
+	p.lineTo(offset+5, 11);
+	p.lineTo(offset+6, 11);
+	p.lineTo(offset+9, 10);
+	p.lineTo(offset+10, 9);
+	p.end();
+}
+
+
+void TeQtLegendItem::drawPointRep( int pw, int ph, int offset, QPixmap *pixmap)
+{
+	QPainter	painter(pixmap);
+	QColor		cor;
+	TeColor		tcor;
+
+	TeVisual* visual = legendEntry_->visual(TePOINTS);
+	tcor = visual->color();
+	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
+	int s = visual->style();
+
+	int	w = visual->size();
+	QPoint	p;
+	p.setX(offset+pw/2);
+	p.setY(ph/2-1);
+
+	painter.setPen(cor);
+	if (s == TePtTypePlus)
+	{
+		painter.drawLine (p.x()-w/2,p.y(),p.x()+w/2,p.y());
+		painter.drawLine (p.x(),p.y()-w/2,p.x(),p.y()+w/2);
+	}
+	else if (s == TePtTypeStar)
+	{
+		painter.save ();
+		painter.translate (p.x(),p.y());
+		painter.drawLine (0,-w/2,0,w/2);
+		painter.rotate (45);
+		painter.drawLine (0,-w/2,0,w/2);
+		painter.rotate (-90);
+		painter.drawLine (0,-w/2,0,w/2);
+		painter.restore ();
+	}
+	else if (s == TePtTypeCircle)
+	{
+		painter.setBrush(cor);
+		painter.drawChord (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
+	}
+	else if (s == TePtTypeX)
+	{
+		painter.drawLine (p.x()-w/2,p.y()-w/2,p.x()+w/2,p.y()+w/2);
+		painter.drawLine (p.x()-w/2,p.y()+w/2,p.x()+w/2,p.y()-w/2);
+	}
+	else if (s == TePtTypeBox)
+	{
+		painter.fillRect (p.x()-w/2,p.y()-w/2,w,w,cor);
+	}
+	else if (s == TePtTypeDiamond)
+	{
+		QPointArray pa(5);
+		pa.setPoint(0, p.x()-w/2, p.y());
+		pa.setPoint(1, p.x(), p.y()-w/2);
+		pa.setPoint(2, p.x()+w/2, p.y());
+		pa.setPoint(3, p.x(), p.y()+w/2);
+ 		pa.setPoint(4, p.x()-w/2, p.y());
+		painter.setBrush(cor);
+		painter.drawPolygon(pa);
+	}
+	else if (s == TePtTypeHollowCircle)
+	{
+		painter.drawArc (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
+	}
+	else if (s == TePtTypeHollowBox)
+	{
+		painter.setBrush(Qt::NoBrush);
+		painter.drawRect (p.x()-w/2,p.y()-w/2,w,w);
+	}
+	else if (s == TePtTypeHollowDiamond)
+	{
+		painter.drawLine (p.x()-w/2,p.y(),p.x(),p.y()-w/2);
+		painter.drawLine (p.x(),p.y()-w/2,p.x()+w/2,p.y());
+		painter.drawLine (p.x()+w/2,p.y(),p.x(),p.y()+w/2);
+		painter.drawLine (p.x(),p.y()+w/2,p.x()-w/2,p.y());
+	}
+	painter.end();
+}
diff --git a/src/terralib/drivers/qt/TeQtLegendItem.h b/src/terralib/drivers/qt/TeQtLegendItem.h
old mode 100755
new mode 100644
index 07fcbd6..6c3f768
--- a/src/terralib/drivers/qt/TeQtLegendItem.h
+++ b/src/terralib/drivers/qt/TeQtLegendItem.h
@@ -1,73 +1,73 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTLEGENDITEM_H
-#define  __TERRALIB_INTERNAL_QTLEGENDITEM_H
-
-#include <TeQtCheckListItem.h>
-
-class TeLegendEntry;
-
-
-class TeQtLegendItem : public TeQtCheckListItem
-{
-public:
-    TeQtLegendItem(QListViewItem *parent, QString text, TeLegendEntry *legendEntry);
-
-	~TeQtLegendItem() {}
-
-	TeLegendEntry* legendEntry()
-		{ return legendEntry_; }
-
-	void changeVisual(TeLegendEntry *legendEntry);
-
-	void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align);
-
-protected:
-	TeLegendEntry *legendEntry_;
-
-	QPixmap createPixmap();
-
-	void drawPolygonRep(int w, int h, int offset, QPixmap *pixmap);
-
-	void drawLineRep(int offset, QPixmap *pixmap);
-
-	void drawPointRep(int w, int h, int offset, QPixmap *pixmap);
-};
-
-
-class TeQtLegendTitleItem : public TeQtCheckListItem
-{
-public:
-    TeQtLegendTitleItem(QListViewItem *parent, QString text)
-	: TeQtCheckListItem(parent, text)
-	{
-		type_ = LEGENDTITLE;
-		setRenameEnabled(0,true);
-		order_ = parent->childCount();
-	}
-
-	~TeQtLegendTitleItem() {}
-};
-
-
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTLEGENDITEM_H
+#define  __TERRALIB_INTERNAL_QTLEGENDITEM_H
+
+#include <TeQtCheckListItem.h>
+
+class TeLegendEntry;
+
+
+class TLAPPUTILS_DLL TeQtLegendItem : public TeQtCheckListItem
+{
+public:
+    TeQtLegendItem(QListViewItem *parent, QString text, TeLegendEntry *legendEntry);
+
+	~TeQtLegendItem() {}
+
+	TeLegendEntry* legendEntry()
+		{ return legendEntry_; }
+
+	void changeVisual(TeLegendEntry *legendEntry);
+
+	void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align);
+
+protected:
+	TeLegendEntry *legendEntry_;
+
+	QPixmap createPixmap();
+
+	void drawPolygonRep(int w, int h, int offset, QPixmap *pixmap);
+
+	void drawLineRep(int offset, QPixmap *pixmap);
+
+	void drawPointRep(int w, int h, int offset, QPixmap *pixmap);
+};
+
+
+class TLAPPUTILS_DLL TeQtLegendTitleItem : public TeQtCheckListItem
+{
+public:
+    TeQtLegendTitleItem(QListViewItem *parent, QString text)
+	: TeQtCheckListItem(parent, text)
+	{
+		type_ = LEGENDTITLE;
+		setRenameEnabled(0,true);
+		order_ = parent->childCount();
+	}
+
+	~TeQtLegendTitleItem() {}
+};
+
+
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtLegendSource.cpp b/src/terralib/drivers/qt/TeQtLegendSource.cpp
old mode 100755
new mode 100644
index df7edcc..13bff9f
--- a/src/terralib/drivers/qt/TeQtLegendSource.cpp
+++ b/src/terralib/drivers/qt/TeQtLegendSource.cpp
@@ -1,848 +1,848 @@
-#include <TeQtLegendSource.h>
-#include <TeLayer.h>
-#include <TeTheme.h>
-#include <TeColorUtils.h>
-#include <TeDataTypes.h>
-#include <TeGroupingAlgorithms.h>
-
-#include <qpixmap.h>
-#include <qbitmap.h>
-#include <qimage.h>
-#include <qpainter.h>
-
-
-TeQtLegendSource::TeQtLegendSource() : nRows_(0), nCols_(0)
-{
-	brushStyleMap_[TePolyTypeTransparent] = Qt::NoBrush;
-	brushStyleMap_[TePolyTypeFill] = Qt::SolidPattern;
-	brushStyleMap_[TePolyTypeHorizontal] = Qt::HorPattern;
-	brushStyleMap_[TePolyTypeVertical] = Qt::VerPattern;
-	brushStyleMap_[TePolyTypeFDiagonal] = Qt::FDiagPattern;
-	brushStyleMap_[TePolyTypeBDiagonal] = Qt::BDiagPattern;
-	brushStyleMap_[TePolyTypeCross] = Qt::CrossPattern;
-	brushStyleMap_[TePolyTypeDiagonalCross] = Qt::DiagCrossPattern;
-
-	//Mounting the penStyleMap
-	penStyleMap_[TeLnTypeContinuous] = Qt::SolidLine;
-	penStyleMap_[TeLnTypeDashed] = Qt::DashLine;
-	penStyleMap_[TeLnTypeDotted] = Qt::DotLine;
-	penStyleMap_[TeLnTypeDashDot] = Qt::DashDotLine;
-	penStyleMap_[TeLnTypeDashDotDot] = Qt::DashDotDotLine;
-	penStyleMap_[TeLnTypeNone] = Qt::NoPen;
-}
-
-
-void TeQtLegendSource::copyAppThemeContents(const TeAppTheme& appTheme)
-{
-	appTheme_ = appTheme;  // Make a copy of the theme	
-	db_ = appTheme_.getLocalDatabase();
-
-	// Set the number of lines
-	nRows_ = ((TeTheme*)appTheme_.getTheme())->legend().size();
-
-	// Set the number of columns
-	TeGroupingMode groupingMode = ((TeTheme*)appTheme_.getTheme())->grouping().groupMode_;
-	if (groupingMode == TeUniqueValue)
-		nCols_ = 4;
-	else
-		nCols_ = 5;
-}
-
-QVariant TeQtLegendSource::cell(int row, int col)
-{
-	QVariant v;
-	QString qs;
-
-	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
-
-	if(legVec.size() == 0)
-		return v;
-
-	TeGrouping& groupingParams = ((TeTheme*)appTheme_.getTheme())->grouping();
-	TeGroupingMode groupingMode = groupingParams.groupMode_;
-
-	if (col == 0)   // Create a pixmap in this column
-	{
-		QPixmap p;
-		p = createPixmap(row);
-		return p;
-	}
-
-	if (col == 1)
-	{
-		qs = legVec[row].slice().from_.c_str();
-		return qs;
-	}
-
-	if (col == 2)
-	{
-		if (groupingMode == TeUniqueValue)
-			qs = legVec[row].label().c_str();
-		else
-			qs = legVec[row].to().c_str();
-		return qs;
-	}
-	
-	if (col == 3)
-	{
-		if (groupingMode == TeUniqueValue)
-			qs = Te2String(legVec[row].slice().count_).c_str();
-		else
-			qs = legVec[row].label().c_str();
-		return qs;
-	}
-
-	if (col == 4)
-	{
-		qs = Te2String(legVec[row].slice().count_).c_str();
-		return qs;
-	}
-
-	return v;
-}
-
-QPixmap TeQtLegendSource::createPixmap(int row)
-{	
-	int		ww   = 21;		// individual width
-	int		tw   = 0;		// total width
-	int		pixh = 16;		
-	int		pixw = ww;
-
-	QPixmap	pixmap(ww, pixh);
-
-	bool hasPolygons = true;
-	bool hasLines = true;
-	bool hasPoints = true;
-
-	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
-	TeGeomRepVisualMap& vm = legVec[row].getVisualMap();
-	
-	if (vm.find(TePOLYGONS) == vm.end() && vm.find(TeCELLS) == vm.end())
-		hasPolygons = false;
-	else 
-		tw += ww;
-
-	if (vm.find(TeLINES) == vm.end())
-		hasLines = false;
-	else
-		tw += ww;
-
-	if (vm.find(TePOINTS) == vm.end())
-		hasPoints = false;
-	else
-		tw += ww;
-
-	pixmap.resize(tw, pixh);
-	pixmap.fill();
-
-	int wi = 0;
-	if (hasPolygons)
-	{
-		drawPolygonRep(pixw, pixh, wi, row, &pixmap);
-		wi	+= ww;
-	}
-	if (hasLines)
-	{
-		drawLineRep(wi, row,  &pixmap);
-		wi	+= ww;
-	}
-	if (hasPoints)
-	{
-		drawPointRep(pixw, pixh, wi, row, &pixmap);
-		wi	+= ww;
-	}
-	return pixmap;
-}
-
-void TeQtLegendSource::drawPolygonRep(int w, int h, int offset, int row, QPixmap *pixmap)
-{
-	QPainter p(pixmap);
-	QBrush	 brush;
-	QColor	 cor;
-	TeColor	 tcor;
-	Qt::BrushStyle	style;
-
-	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
-	TeGeomRepVisualMap& vm = legVec[row].getVisualMap();
-
-	int transp = 255 - (vm[TePOLYGONS]->transparency() * 255 / 100);
-	tcor = vm[TePOLYGONS]->color();
-	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
-
-	style = brushStyleMap_[(TePolyBasicType)(vm[TePOLYGONS]->style())];
-	brush.setStyle(style);
-	brush.setColor(cor);
-
-	QRect trect(offset+1, 1, w-2, h-2);
-	QRect rect(0, 0, offset+w-1, h-1);
-
-	int width = rect.width();
-	int height = rect.height();
-
-	int r = width%8;
-	if(r)
-		width += (8-r);
-	r = height%8;
-	if(r)
-		height += (8-r);
-
-	if(width == 0)
-		width = 8;
-	if(height == 0)
-		height = 8;
-
-	QBitmap	bm;
-	bm.resize(width, height);
-	//Fill bitmap with 0-bits: clipping region
-	bm.fill(Qt::color0);
-	QPainter maskPainter(&bm);
-
-	// Draw bitmap with 1-bits: drawing region
-	QBrush bs(Qt::color1, style);
-	QPen pen(Qt::color1, 1);
-	maskPainter.setPen(pen);
- 	maskPainter.fillRect(trect, bs);
-	maskPainter.end();
-
-	QRegion clipRegion(bm);
-	p.setClipRegion(clipRegion);
-
-	if(vm[TePOLYGONS]->transparency() == 0)
-		p.fillRect(trect, brush);
-	else
-	{
-		// set alpha buffer and color
-		QImage img(rect.width(), rect.height(), 32);
-		unsigned int val = (transp << 24) | (cor.red() << 16) | (cor.green() << 8) | cor.blue();
-		img.fill(val);
-		img.setAlphaBuffer(true);
-
-		// plot transparency
-		p.drawPixmap(trect.x(), trect.y(), img);
-	}
-	p.setClipping(false);
-
-	Qt::PenStyle pstyle;
-	uint		pwidth;
-
-	tcor = vm[TePOLYGONS]->contourColor();
-	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
-	pen.setColor(cor);
-
-	pstyle = penStyleMap_[(TeLnBasicType)(vm[TePOLYGONS]->contourStyle())];
-	pen.setStyle(pstyle);
-
-	pwidth = (Qt::PenStyle) vm[TePOLYGONS]->contourWidth();
-	pen.setWidth (pwidth);
-
-	p.setPen(pen);
-	p.drawRect (offset+1+pwidth/2,1+pwidth/2,w-2-pwidth/2,h-2-pwidth/2);
-
-	p.end();
-}
-
-void TeQtLegendSource::drawLineRep(int offset, int row, QPixmap *pixmap)
-{
-	QPainter	p(pixmap);
-	QPen		pen;
-	QColor		cor;
-	TeColor		tcor;
-	Qt::PenStyle style;
-	uint		width;
-
-	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
-	TeGeomRepVisualMap& vm = legVec[row].getVisualMap();
-
-	tcor = vm[TeLINES]->color();
-	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
-	pen.setColor(cor);
-
-	style = penStyleMap_[(TeLnBasicType)(vm[TeLINES]->style())];
-	pen.setStyle(style);
-
-	width = (Qt::PenStyle) vm[TeLINES]->width();
-	pen.setWidth (width);
-
-	p.setPen(pen);
-	p.moveTo(offset+1, 5);
-	p.lineTo(offset+3, 5);
-	p.lineTo(offset+6, 6);
-	p.lineTo(offset+8, 8);
-	p.lineTo(offset+10, 9);
-	p.lineTo(offset+14, 10);
-	p.lineTo(offset+16, 10);
-	p.lineTo(offset+18, 9);
-	p.lineTo(offset+19, 9);
-	p.moveTo(offset+2, 13);
-	p.lineTo(offset+3, 12);
-	p.lineTo(offset+5, 11);
-	p.lineTo(offset+6, 11);
-	p.lineTo(offset+9, 10);
-	p.lineTo(offset+10, 9);
-	p.end();
-}
-
-
-void TeQtLegendSource::drawPointRep(int pw, int ph, int offset, int row, QPixmap *pixmap)
-{
-	QPainter	painter(pixmap);
-	QColor		cor;
-	TeColor		tcor;
-
-	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
-	TeGeomRepVisualMap& vm = legVec[row].getVisualMap();
-
-	tcor = vm[TePOINTS]->color();
-	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
-	int s = vm[TePOINTS]->style();
-	int	w = vm[TePOINTS]->size();
-	QPoint	p;
-	p.setX(offset+pw/2);
-	p.setY(ph/2-1);
-
-	painter.setPen(cor);
-	if (s == TePtTypePlus)
-	{
-		painter.drawLine (p.x()-w/2,p.y(),p.x()+w/2,p.y());
-		painter.drawLine (p.x(),p.y()-w/2,p.x(),p.y()+w/2);
-	}
-	else if (s == TePtTypeStar)
-	{
-		painter.save ();
-		painter.translate (p.x(),p.y());
-		painter.drawLine (0,-w/2,0,w/2);
-		painter.rotate (45);
-		painter.drawLine (0,-w/2,0,w/2);
-		painter.rotate (-90);
-		painter.drawLine (0,-w/2,0,w/2);
-		painter.restore ();
-	}
-	else if (s == TePtTypeCircle)
-	{
-		painter.setBrush(cor);
-		painter.drawChord (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
-	}
-	else if (s == TePtTypeX)
-	{
-		painter.drawLine (p.x()-w/2,p.y()-w/2,p.x()+w/2,p.y()+w/2);
-		painter.drawLine (p.x()-w/2,p.y()+w/2,p.x()+w/2,p.y()-w/2);
-	}
-	else if (s == TePtTypeBox)
-	{
-		painter.fillRect (p.x()-w/2,p.y()-w/2,w,w,cor);
-	}
-	else if (s == TePtTypeDiamond)
-	{
-		QPointArray pa(5);
-		pa.setPoint(0, p.x()-w/2, p.y());
-		pa.setPoint(1, p.x(), p.y()-w/2);
-		pa.setPoint(2, p.x()+w/2, p.y());
-		pa.setPoint(3, p.x(), p.y()+w/2);
- 		pa.setPoint(4, p.x()-w/2, p.y());
-		painter.setBrush(cor);
-		painter.drawPolygon(pa);
-	}
-	else if (s == TePtTypeHollowCircle)
-	{
-		painter.drawArc (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
-	}
-	else if (s == TePtTypeHollowBox)
-	{
-		painter.setBrush(Qt::NoBrush);
-		painter.drawRect (p.x()-w/2,p.y()-w/2,w,w);
-	}
-	else if (s == TePtTypeHollowDiamond)
-	{
-		painter.drawLine (p.x()-w/2,p.y(),p.x(),p.y()-w/2);
-		painter.drawLine (p.x(),p.y()-w/2,p.x()+w/2,p.y());
-		painter.drawLine (p.x()+w/2,p.y(),p.x(),p.y()+w/2);
-		painter.drawLine (p.x(),p.y()+w/2,p.x()-w/2,p.y());
-	}
-	painter.end();
-}
-
-
-void TeQtLegendSource::setCell(int row, int col, const QVariant &v)
-{
-	// col = 0 (Color)
-	// col = 1 (From) mode != UniqueValue; (Value) mode = UniqueValue
-	// col = 2 (To) mode != UniqueValue; (Label) mode = UniqueValue
-	// col = 3 (Label) mode != UniqueValue; (Count) mode = UniqueValue
-	// col = 4 (Count) mode != UniqueValue 
-
-	if (col == 0)
-	{
-		emit dataChanged();
-		return;
-	}
-
-	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
-
-	TeGrouping& groupingParams = ((TeTheme*)appTheme_.getTheme())->grouping();
-	TeGroupingMode groupingMode = groupingParams.groupMode_;
-
-	if (groupingMode == TeUniqueValue)
-	{
-		if (legVec[row].label() == "Missing Data" && col == 2)
-			return;
-	}
-	else
-	{
-		if (legVec[row].from() == "Missing Data" && col == 1 ||
-			legVec[row].label() == "Missing Data" && col == 3 ||
-			legVec[row].to() == "" && col == 2)
-			return;
-	}
-
-	if (groupingMode == TeStdDeviation)
-	{
-		if (legVec[row].from().find("mean =") != string::npos  && col == 1 ||
-			legVec[row].label().find("mean =") != string::npos  && col == 3 ||
-			legVec[row].to() == "" && col == 2)
-			return;
-	}
-
-	// Check if the value changed is numeric
-	if(groupingMode != TeUniqueValue && (col == 1 || col == 2))
-	{
-		bool ok;
-		QString qs = v.toString();
-		qs.toDouble(&ok);
-		if(ok == false)
-			return;
-	}
-
-	QString qs = v.toString();
-	string newValue = qs.latin1();
-
-	// Check if the label was the value that was edited,
-	// in this case set it to the new value
-	if((groupingMode != TeUniqueValue && col == 3) ||
-		(groupingMode == TeUniqueValue && col == 2))
-	{
-		legVec[row].label(newValue);
-		return;
-	}
-
-	// The column edited is the "from" or "to" column for
-	// a grouping mode that is different of the "Unique Value" mode
-	vector<TeLegendEntry> tempLegVec = legVec;
-	dValuesVec_.clear();
-	((TeTheme*)appTheme_.getTheme())->buildGrouping(((TeTheme*)appTheme_.getTheme())->grouping(), TeAll, &dValuesVec_);
-	legVec = tempLegVec;
-	
-	if (col == 1)
-		legVec[row].from(newValue);
-	else if (col == 2)
-		legVec[row].to(newValue);
-
-	// Make the label value to be the same as (from ~ to)
-	if (col == 1 || col == 2)
-	{
-		string oldLabel = legVec[row].label();
-		string newLabel = legVec[row].slice().from_;
-		newLabel += " ~ ";
-		newLabel += legVec[row].slice().to_;
-		if ((newLabel != oldLabel) && (oldLabel.find(" ~ ") != string::npos))
-			legVec[row].label(newLabel);
-	}
-
-	// Recalculate the new count value
-	vector<TeSlice> sliceVec;
-	TeSlice slice(legVec[row].from(), legVec[row].to());
-	sliceVec.push_back(slice);
-	TeElemCountingBySlice(dValuesVec_.begin(), dValuesVec_.end(), sliceVec);
-	legVec[row].count(sliceVec[0].count_);
-
-	emit dataChanged();
-}
-    
-bool TeQtLegendSource::generateLegends(const TeGrouping& groupingParams, double minValue, double maxValue)
-{
-	((TeTheme*)appTheme_.getTheme())->grouping(groupingParams);
-
-	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
-
-	legVec.clear();	
-	dValuesVec_.clear();
-	mapObjValVec_.clear();
-
-	bool ret;
-	TeChronon chronon = groupingParams.groupChronon_;
-	if (chronon == TeNOCHRONON)
-		ret = ((TeTheme*)appTheme_.getTheme())->buildGrouping(groupingParams, TeAll, &dValuesVec_);
-	else
-		ret = ((TeTheme*)appTheme_.getTheme())->buildGrouping(groupingParams, chronon, mapObjValVec_);
-
-	if (ret == false)
-	{
-		errorMessage_ = tr("Fail to generate the legends");
-		nRows_ = 0;
-		return false;
-	}
-
-	// Set the number of rows
-	nRows_ = legVec.size();
-
-	// Set the number of columns
-	TeGroupingMode groupingMode = groupingParams.groupMode_;
-	if (groupingMode == TeUniqueValue)
-		nCols_ = 4;
-	else
-		nCols_ = 5;
-
-	// Change the legends if the minValue and maxValue are 
-	// different of zero
-
-	if (groupingMode == TeEqualSteps && (minValue == 0. && maxValue == 0.) == false)
-	{
-		double slice = (maxValue - minValue)/double(groupingParams.groupNumSlices_);
-		int i;
-		for (i = 0; i < groupingParams.groupNumSlices_; ++i)
-		{
-			string from = Te2String(minValue + double(i)*slice, groupingParams.groupPrecision_);
-			legVec[i].from(from);
-			string to = Te2String(minValue + double(i+1)*slice, groupingParams.groupPrecision_);
-			legVec[i].to(to);
-			string label = legVec[i].from() + " ~ " + legVec[i].to();
-			legVec[i].label(label);
-		}
-
-		// Recalculate the new count value
-		vector<TeSlice> sliceVec;
-		for (i = 0; i < groupingParams.groupNumSlices_; ++i)
-		{
-			TeSlice slice(legVec[i].from(), legVec[i].to());
-			sliceVec.push_back(slice);
-		}
-		TeElemCountingBySlice(dValuesVec_.begin(), dValuesVec_.end(), sliceVec);
-		for (unsigned int j = 0; j < sliceVec.size(); ++j)
-			legVec[j].count(sliceVec[j].count_);
-	}
-
-	return true;
-}
-
-void TeQtLegendSource::putColorOnLegend(vector<ColorBar>& iColorVec, vector<ColorBar>& iColorBVec)
-{
-	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
-	if(legVec.size() == 0)
-		return;
-
-	unsigned int i;
-	bool hasMissingData = false;
-
-	// Update the grouping colors of the theme
-	string groupingColors = getColors(iColorVec, iColorBVec, ((TeTheme*)appTheme_.getTheme())->grouping().groupMode_);
-	appTheme_.groupColor(groupingColors);
-
-//	vector<string> colorNameVec;
-//	getColorNameVector(groupingColors, colorNameVec);
-	vector<TeColor> colorVec;
-
-	int nColors = (int)legVec.size();
-	string s = legVec[legVec.size()-1].from();
-	if(s == "Missing Data")
-	{
-		hasMissingData = true;
-		nColors--;
-	}
-
-	TeGrouping& groupingParams = ((TeTheme*)appTheme_.getTheme())->grouping();
-	if (groupingParams.groupMode_ != TeStdDeviation)
-	{
-//		getColors(colorNameVec, nColors, colorVec);
-		colorVec = getColors(iColorVec, nColors);
-//		if (colorNameVec.size() == 1 && invertColor == true)
-//		{
-//			vector<TeColor> cVec;
-//			for (int k = colorVec.size() - 1; k >= 0; --k)
-//				cVec.push_back(colorVec[k]);
-//			colorVec = cVec;
-//		}
-	}
-	else
-	{
-		int leftColors = 0, rightColors = 0;
-
-		for(i = 0; i < legVec.size(); ++i)
-		{
-			string vv = legVec[i].label();
-			if (legVec[i].label().find("mean = ") != string::npos)
-				break;
-		}
-		leftColors = i;
-		rightColors = legVec.size() - i - 1;
-		if(hasMissingData)
-			rightColors--;
-
-		vector<TeColor> leftColorVec, rightColorVec;
-//		vector<string> leftColorNameVec, rightColorNameVec;
-//		if ((colorNameVec.size() % 2) == 0)
-//		{
-//			unsigned int a = colorNameVec.size()/2;
-//			for (i = 0; i < a; ++i)
-//				leftColorNameVec.push_back(colorNameVec[i]);
-//			for (; i < colorNameVec.size(); ++i)
-//				rightColorNameVec.push_back(colorNameVec[i]);
-//		}
-//		else
-//		{
-//			unsigned int a = colorNameVec.size()/2 + 1;
-//			for (i = 0; i < a; ++i)
-//				leftColorNameVec.push_back(colorNameVec[i]);
-//			for (i = a-1; i < colorNameVec.size(); ++i)
-//				rightColorNameVec.push_back(colorNameVec[i]);
-//		}
-//
-//		getColors(leftColorNameVec, leftColors, leftColorVec);
-//		getColors(rightColorNameVec, rightColors, rightColorVec);
-		leftColorVec = getColors(iColorVec, leftColors);
-		rightColorVec = getColors(iColorBVec, rightColors);
-
-//		if (leftColorNameVec.size() == 1 && invertColor == true)
-//		{
-//			vector<TeColor> cVec;
-//			for (int k = leftColorVec.size() - 1; k >= 0; --k)
-//				cVec.push_back(leftColorVec[k]);
-//			leftColorVec = cVec;
-//		}
-//
-//		if (rightColorNameVec.size() == 1 && invertColor == false)
-//		{
-//			vector<TeColor> cVec;
-//			for (int k = rightColorVec.size() - 1; k >= 0; --k)
-//				cVec.push_back(rightColorVec[k]);
-//			rightColorVec = cVec;
-//		}
-
-		for (i = 0; i < leftColorVec.size(); ++i)
-			colorVec.push_back(leftColorVec[i]);
-		colorVec.push_back(leftColorVec[i-1]);
-		for (i = 0; i < rightColorVec.size(); ++i)
-			colorVec.push_back(rightColorVec[i]);
-	}
-
-	if(hasMissingData)
-	{
-		TeColor	cor(255, 255, 255);
-		colorVec.push_back(cor);
-	}
-
-	int visRep = appTheme_.getTheme()->visibleRep();
-	for(i = 0; i < legVec.size(); i++)
-	{
-		string vv = legVec[i].label();
-		if (groupingParams.groupMode_ == TeStdDeviation &&
-			legVec[i].label().find("mean = ") != string::npos)
-			continue;
-
-		TeColor	cor = colorVec[i];
-		if (visRep & TePOINTS)
-		{
-			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TePOINTS);	
-			v->color(cor);
-			legVec[i].setVisual(v->copy(), TePOINTS); 
-		}
-
-		if (visRep & TeLINES)
-		{
-			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TeLINES);	
-			v->color(cor);
-			legVec[i].setVisual(v->copy(), TeLINES); 
-		}
-
-		if ((visRep & TePOLYGONS) || (visRep & TeCELLS))
-		{
-			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TePOLYGONS);	
-			v->color(cor);
-			legVec[i].setVisual(v->copy(), TePOLYGONS); 
-		}
-	}
-}
-
-void TeQtLegendSource::putColorOnLegend(string& groupingColors, bool invertColor)
-{
-	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
-	if(legVec.size() == 0)
-		return;
-
-	unsigned int i;
-	bool hasMissingData = false;
-
-	// Update the grouping colors of the theme
-	appTheme_.groupColor(groupingColors);
-
-	vector<string> colorNameVec;
-	getColorNameVector(groupingColors, colorNameVec);
-	vector<TeColor> colorVec;
-
-	int nColors = (int)legVec.size();
-	string s = legVec[legVec.size()-1].from();
-	if(s == "Missing Data")
-	{
-		hasMissingData = true;
-		nColors--;
-	}
-
-	TeGrouping& groupingParams = ((TeTheme*)appTheme_.getTheme())->grouping();
-	if (groupingParams.groupMode_ != TeStdDeviation)
-	{
-		getColors(colorNameVec, nColors, colorVec);
-		if (colorNameVec.size() == 1 && invertColor == true)
-		{
-			vector<TeColor> cVec;
-			for (int k = colorVec.size() - 1; k >= 0; --k)
-				cVec.push_back(colorVec[k]);
-			colorVec = cVec;
-		}
-	}
-	else
-	{
-		int leftColors = 0, rightColors = 0;
-
-		for(i = 0; i < legVec.size(); ++i)
-		{
-			string vv = legVec[i].label();
-			if (legVec[i].label().find("mean = ") != string::npos)
-				break;
-		}
-		leftColors = i;
-		rightColors = legVec.size() - i - 1;
-		if(hasMissingData)
-			rightColors--;
-
-		vector<TeColor> leftColorVec, rightColorVec;
-		vector<string> leftColorNameVec, rightColorNameVec;
-		if ((colorNameVec.size() % 2) == 0)
-		{
-			unsigned int a = colorNameVec.size()/2;
-			for (i = 0; i < a; ++i)
-				leftColorNameVec.push_back(colorNameVec[i]);
-			for (; i < colorNameVec.size(); ++i)
-				rightColorNameVec.push_back(colorNameVec[i]);
-		}
-		else
-		{
-			unsigned int a = colorNameVec.size()/2 + 1;
-			for (i = 0; i < a; ++i)
-				leftColorNameVec.push_back(colorNameVec[i]);
-			for (i = a-1; i < colorNameVec.size(); ++i)
-				rightColorNameVec.push_back(colorNameVec[i]);
-		}
-
-		getColors(leftColorNameVec, leftColors, leftColorVec);
-		getColors(rightColorNameVec, rightColors, rightColorVec);
-
-		if (leftColorNameVec.size() == 1 && invertColor == true)
-		{
-			vector<TeColor> cVec;
-			for (int k = leftColorVec.size() - 1; k >= 0; --k)
-				cVec.push_back(leftColorVec[k]);
-			leftColorVec = cVec;
-		}
-
-		if (rightColorNameVec.size() == 1 && invertColor == false)
-		{
-			vector<TeColor> cVec;
-			for (int k = rightColorVec.size() - 1; k >= 0; --k)
-				cVec.push_back(rightColorVec[k]);
-			rightColorVec = cVec;
-		}
-
-		for (i = 0; i < leftColorVec.size(); ++i)
-			colorVec.push_back(leftColorVec[i]);
-		colorVec.push_back(leftColorVec[i-1]);
-		for (i = 0; i < rightColorVec.size(); ++i)
-			colorVec.push_back(rightColorVec[i]);
-	}
-
-	if(hasMissingData)
-	{
-		TeColor	cor(255, 255, 255);
-		colorVec.push_back(cor);
-	}
-
-	for(i = 0; i < legVec.size(); i++)
-	{
-		string vv = legVec[i].label();
-		if (groupingParams.groupMode_ == TeStdDeviation &&
-			legVec[i].label().find("mean = ") != string::npos)
-			continue;
-
-		TeColor	cor = colorVec[i];
-		if(((TeTheme*)appTheme_.getTheme())->visibleRep() & TePOINTS)
-		{
-			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TePOINTS);	
-			v->color(cor);
-			legVec[i].setVisual(v->copy(), TePOINTS); 
-		}
-		if(((TeTheme*)appTheme_.getTheme())->visibleRep() & TeLINES)
-		{
-			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TeLINES);	
-			v->color(cor);
-			legVec[i].setVisual(v->copy(), TeLINES); 
-		}
-		if((((TeTheme*)appTheme_.getTheme())->visibleRep() & TePOLYGONS) || (((TeTheme*)appTheme_.getTheme())->visibleRep() & TeCELLS))
-		{
-			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TePOLYGONS);	
-			v->color(cor);
-			legVec[i].setVisual(v->copy(), TePOLYGONS); 
-		}
-	}
-}
-
-void TeQtLegendSource::getColorNameVector(string& groupingColors, vector<string>& colorNameVec)
-{
-	if(groupingColors.empty())
-		groupingColors = tr("R").latin1();
-
-	QString s = groupingColors.c_str();
-	QStringList ss = QStringList::split("-",s,true);
-
-	for(unsigned int i = 0; i < ss.size(); i++)
-	{
-		QString a = ss[i];
-		if(tr("R") == a)
-			colorNameVec.push_back("RED");
-		else if(tr("G") == a)
-			colorNameVec.push_back("GREEN");
-		else if(tr("B") == a)
-			colorNameVec.push_back("BLUE");
-		else if(tr("Cy") == a)
-			colorNameVec.push_back("CYAN");
-		else if(tr("Or") == a)
-			colorNameVec.push_back("ORANGE");
-		else if(tr("Mg") == a)
-			colorNameVec.push_back("MAGENTA");
-		else if(tr("Y") == a)
-			colorNameVec.push_back("YELLOW");
-		else
-			colorNameVec.push_back("GRAY");
-	}
-}
-
-void TeQtLegendSource::setLegends(const vector<TeLegendEntry>& inLegVec)
-{
-	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
-	legVec.clear();
-	legVec = inLegVec;
-	nRows_ = legVec.size();
-}
-
-void TeQtLegendSource::setGroupingParams(const TeGrouping& gParams)
-{
-	TeGrouping& groupingParams = ((TeTheme*)appTheme_.getTheme())->grouping();
-	groupingParams = gParams;
-
-	// Set the number of columns
-	TeGroupingMode groupingMode = groupingParams.groupMode_;
-	if (groupingMode == TeUniqueValue)
-		nCols_ = 4;
-	else
-		nCols_ = 5;
-}
-
-
-
-
+#include <TeQtLegendSource.h>
+#include <TeLayer.h>
+#include <TeTheme.h>
+#include <TeColorUtils.h>
+#include <TeDataTypes.h>
+#include <TeGroupingAlgorithms.h>
+
+#include <qpixmap.h>
+#include <qbitmap.h>
+#include <qimage.h>
+#include <qpainter.h>
+
+
+TeQtLegendSource::TeQtLegendSource() : nRows_(0), nCols_(0)
+{
+	brushStyleMap_[TePolyTypeTransparent] = Qt::NoBrush;
+	brushStyleMap_[TePolyTypeFill] = Qt::SolidPattern;
+	brushStyleMap_[TePolyTypeHorizontal] = Qt::HorPattern;
+	brushStyleMap_[TePolyTypeVertical] = Qt::VerPattern;
+	brushStyleMap_[TePolyTypeFDiagonal] = Qt::FDiagPattern;
+	brushStyleMap_[TePolyTypeBDiagonal] = Qt::BDiagPattern;
+	brushStyleMap_[TePolyTypeCross] = Qt::CrossPattern;
+	brushStyleMap_[TePolyTypeDiagonalCross] = Qt::DiagCrossPattern;
+
+	//Mounting the penStyleMap
+	penStyleMap_[TeLnTypeContinuous] = Qt::SolidLine;
+	penStyleMap_[TeLnTypeDashed] = Qt::DashLine;
+	penStyleMap_[TeLnTypeDotted] = Qt::DotLine;
+	penStyleMap_[TeLnTypeDashDot] = Qt::DashDotLine;
+	penStyleMap_[TeLnTypeDashDotDot] = Qt::DashDotDotLine;
+	penStyleMap_[TeLnTypeNone] = Qt::NoPen;
+}
+
+
+void TeQtLegendSource::copyAppThemeContents(const TeAppTheme& appTheme)
+{
+	appTheme_ = appTheme;  // Make a copy of the theme	
+	db_ = appTheme_.getLocalDatabase();
+
+	// Set the number of lines
+	nRows_ = ((TeTheme*)appTheme_.getTheme())->legend().size();
+
+	// Set the number of columns
+	TeGroupingMode groupingMode = ((TeTheme*)appTheme_.getTheme())->grouping().groupMode_;
+	if (groupingMode == TeUniqueValue)
+		nCols_ = 4;
+	else
+		nCols_ = 5;
+}
+
+QVariant TeQtLegendSource::cell(int row, int col)
+{
+	QVariant v;
+	QString qs;
+
+	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
+
+	if(legVec.size() == 0)
+		return v;
+
+	TeGrouping& groupingParams = ((TeTheme*)appTheme_.getTheme())->grouping();
+	TeGroupingMode groupingMode = groupingParams.groupMode_;
+
+	if (col == 0)   // Create a pixmap in this column
+	{
+		QPixmap p;
+		p = createPixmap(row);
+		return p;
+	}
+
+	if (col == 1)
+	{
+		qs = legVec[row].slice().from_.c_str();
+		return qs;
+	}
+
+	if (col == 2)
+	{
+		if (groupingMode == TeUniqueValue)
+			qs = legVec[row].label().c_str();
+		else
+			qs = legVec[row].to().c_str();
+		return qs;
+	}
+	
+	if (col == 3)
+	{
+		if (groupingMode == TeUniqueValue)
+			qs = Te2String(legVec[row].slice().count_).c_str();
+		else
+			qs = legVec[row].label().c_str();
+		return qs;
+	}
+
+	if (col == 4)
+	{
+		qs = Te2String(legVec[row].slice().count_).c_str();
+		return qs;
+	}
+
+	return v;
+}
+
+QPixmap TeQtLegendSource::createPixmap(int row)
+{	
+	int		ww   = 21;		// individual width
+	int		tw   = 0;		// total width
+	int		pixh = 16;		
+	int		pixw = ww;
+
+	QPixmap	pixmap(ww, pixh);
+
+	bool hasPolygons = true;
+	bool hasLines = true;
+	bool hasPoints = true;
+
+	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
+	TeGeomRepVisualMap& vm = legVec[row].getVisualMap();
+	
+	if (vm.find(TePOLYGONS) == vm.end() && vm.find(TeCELLS) == vm.end())
+		hasPolygons = false;
+	else 
+		tw += ww;
+
+	if (vm.find(TeLINES) == vm.end())
+		hasLines = false;
+	else
+		tw += ww;
+
+	if (vm.find(TePOINTS) == vm.end())
+		hasPoints = false;
+	else
+		tw += ww;
+
+	pixmap.resize(tw, pixh);
+	pixmap.fill();
+
+	int wi = 0;
+	if (hasPolygons)
+	{
+		drawPolygonRep(pixw, pixh, wi, row, &pixmap);
+		wi	+= ww;
+	}
+	if (hasLines)
+	{
+		drawLineRep(wi, row,  &pixmap);
+		wi	+= ww;
+	}
+	if (hasPoints)
+	{
+		drawPointRep(pixw, pixh, wi, row, &pixmap);
+		wi	+= ww;
+	}
+	return pixmap;
+}
+
+void TeQtLegendSource::drawPolygonRep(int w, int h, int offset, int row, QPixmap *pixmap)
+{
+	QPainter p(pixmap);
+	QBrush	 brush;
+	QColor	 cor;
+	TeColor	 tcor;
+	Qt::BrushStyle	style;
+
+	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
+	TeGeomRepVisualMap& vm = legVec[row].getVisualMap();
+
+	int transp = 255 - (vm[TePOLYGONS]->transparency() * 255 / 100);
+	tcor = vm[TePOLYGONS]->color();
+	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
+
+	style = brushStyleMap_[(TePolyBasicType)(vm[TePOLYGONS]->style())];
+	brush.setStyle(style);
+	brush.setColor(cor);
+
+	QRect trect(offset+1, 1, w-2, h-2);
+	QRect rect(0, 0, offset+w-1, h-1);
+
+	int width = rect.width();
+	int height = rect.height();
+
+	int r = width%8;
+	if(r)
+		width += (8-r);
+	r = height%8;
+	if(r)
+		height += (8-r);
+
+	if(width == 0)
+		width = 8;
+	if(height == 0)
+		height = 8;
+
+	QBitmap	bm;
+	bm.resize(width, height);
+	//Fill bitmap with 0-bits: clipping region
+	bm.fill(Qt::color0);
+	QPainter maskPainter(&bm);
+
+	// Draw bitmap with 1-bits: drawing region
+	QBrush bs(Qt::color1, style);
+	QPen pen(Qt::color1, 1);
+	maskPainter.setPen(pen);
+ 	maskPainter.fillRect(trect, bs);
+	maskPainter.end();
+
+	QRegion clipRegion(bm);
+	p.setClipRegion(clipRegion);
+
+	if(vm[TePOLYGONS]->transparency() == 0)
+		p.fillRect(trect, brush);
+	else
+	{
+		// set alpha buffer and color
+		QImage img(rect.width(), rect.height(), 32);
+		unsigned int val = (transp << 24) | (cor.red() << 16) | (cor.green() << 8) | cor.blue();
+		img.fill(val);
+		img.setAlphaBuffer(true);
+
+		// plot transparency
+		p.drawPixmap(trect.x(), trect.y(), img);
+	}
+	p.setClipping(false);
+
+	Qt::PenStyle pstyle;
+	uint		pwidth;
+
+	tcor = vm[TePOLYGONS]->contourColor();
+	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
+	pen.setColor(cor);
+
+	pstyle = penStyleMap_[(TeLnBasicType)(vm[TePOLYGONS]->contourStyle())];
+	pen.setStyle(pstyle);
+
+	pwidth = (Qt::PenStyle) vm[TePOLYGONS]->contourWidth();
+	pen.setWidth (pwidth);
+
+	p.setPen(pen);
+	p.drawRect (offset+1+pwidth/2,1+pwidth/2,w-2-pwidth/2,h-2-pwidth/2);
+
+	p.end();
+}
+
+void TeQtLegendSource::drawLineRep(int offset, int row, QPixmap *pixmap)
+{
+	QPainter	p(pixmap);
+	QPen		pen;
+	QColor		cor;
+	TeColor		tcor;
+	Qt::PenStyle style;
+	uint		width;
+
+	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
+	TeGeomRepVisualMap& vm = legVec[row].getVisualMap();
+
+	tcor = vm[TeLINES]->color();
+	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
+	pen.setColor(cor);
+
+	style = penStyleMap_[(TeLnBasicType)(vm[TeLINES]->style())];
+	pen.setStyle(style);
+
+	width = (Qt::PenStyle) vm[TeLINES]->width();
+	pen.setWidth (width);
+
+	p.setPen(pen);
+	p.moveTo(offset+1, 5);
+	p.lineTo(offset+3, 5);
+	p.lineTo(offset+6, 6);
+	p.lineTo(offset+8, 8);
+	p.lineTo(offset+10, 9);
+	p.lineTo(offset+14, 10);
+	p.lineTo(offset+16, 10);
+	p.lineTo(offset+18, 9);
+	p.lineTo(offset+19, 9);
+	p.moveTo(offset+2, 13);
+	p.lineTo(offset+3, 12);
+	p.lineTo(offset+5, 11);
+	p.lineTo(offset+6, 11);
+	p.lineTo(offset+9, 10);
+	p.lineTo(offset+10, 9);
+	p.end();
+}
+
+
+void TeQtLegendSource::drawPointRep(int pw, int ph, int offset, int row, QPixmap *pixmap)
+{
+	QPainter	painter(pixmap);
+	QColor		cor;
+	TeColor		tcor;
+
+	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
+	TeGeomRepVisualMap& vm = legVec[row].getVisualMap();
+
+	tcor = vm[TePOINTS]->color();
+	cor.setRgb(tcor.red_, tcor.green_, tcor.blue_);
+	int s = vm[TePOINTS]->style();
+	int	w = vm[TePOINTS]->size();
+	QPoint	p;
+	p.setX(offset+pw/2);
+	p.setY(ph/2-1);
+
+	painter.setPen(cor);
+	if (s == TePtTypePlus)
+	{
+		painter.drawLine (p.x()-w/2,p.y(),p.x()+w/2,p.y());
+		painter.drawLine (p.x(),p.y()-w/2,p.x(),p.y()+w/2);
+	}
+	else if (s == TePtTypeStar)
+	{
+		painter.save ();
+		painter.translate (p.x(),p.y());
+		painter.drawLine (0,-w/2,0,w/2);
+		painter.rotate (45);
+		painter.drawLine (0,-w/2,0,w/2);
+		painter.rotate (-90);
+		painter.drawLine (0,-w/2,0,w/2);
+		painter.restore ();
+	}
+	else if (s == TePtTypeCircle)
+	{
+		painter.setBrush(cor);
+		painter.drawChord (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
+	}
+	else if (s == TePtTypeX)
+	{
+		painter.drawLine (p.x()-w/2,p.y()-w/2,p.x()+w/2,p.y()+w/2);
+		painter.drawLine (p.x()-w/2,p.y()+w/2,p.x()+w/2,p.y()-w/2);
+	}
+	else if (s == TePtTypeBox)
+	{
+		painter.fillRect (p.x()-w/2,p.y()-w/2,w,w,cor);
+	}
+	else if (s == TePtTypeDiamond)
+	{
+		QPointArray pa(5);
+		pa.setPoint(0, p.x()-w/2, p.y());
+		pa.setPoint(1, p.x(), p.y()-w/2);
+		pa.setPoint(2, p.x()+w/2, p.y());
+		pa.setPoint(3, p.x(), p.y()+w/2);
+ 		pa.setPoint(4, p.x()-w/2, p.y());
+		painter.setBrush(cor);
+		painter.drawPolygon(pa);
+	}
+	else if (s == TePtTypeHollowCircle)
+	{
+		painter.drawArc (p.x()-w/2,p.y()-w/2,w,w,0,360*16);
+	}
+	else if (s == TePtTypeHollowBox)
+	{
+		painter.setBrush(Qt::NoBrush);
+		painter.drawRect (p.x()-w/2,p.y()-w/2,w,w);
+	}
+	else if (s == TePtTypeHollowDiamond)
+	{
+		painter.drawLine (p.x()-w/2,p.y(),p.x(),p.y()-w/2);
+		painter.drawLine (p.x(),p.y()-w/2,p.x()+w/2,p.y());
+		painter.drawLine (p.x()+w/2,p.y(),p.x(),p.y()+w/2);
+		painter.drawLine (p.x(),p.y()+w/2,p.x()-w/2,p.y());
+	}
+	painter.end();
+}
+
+
+void TeQtLegendSource::setCell(int row, int col, const QVariant &v)
+{
+	// col = 0 (Color)
+	// col = 1 (From) mode != UniqueValue; (Value) mode = UniqueValue
+	// col = 2 (To) mode != UniqueValue; (Label) mode = UniqueValue
+	// col = 3 (Label) mode != UniqueValue; (Count) mode = UniqueValue
+	// col = 4 (Count) mode != UniqueValue 
+
+	if (col == 0)
+	{
+		emit dataChanged();
+		return;
+	}
+
+	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
+
+	TeGrouping& groupingParams = ((TeTheme*)appTheme_.getTheme())->grouping();
+	TeGroupingMode groupingMode = groupingParams.groupMode_;
+
+	if (groupingMode == TeUniqueValue)
+	{
+		if (legVec[row].label() == "Missing Data" && col == 2)
+			return;
+	}
+	else
+	{
+		if (legVec[row].from() == "Missing Data" && col == 1 ||
+			legVec[row].label() == "Missing Data" && col == 3 ||
+			legVec[row].to() == "" && col == 2)
+			return;
+	}
+
+	if (groupingMode == TeStdDeviation)
+	{
+		if (legVec[row].from().find("mean =") != string::npos  && col == 1 ||
+			legVec[row].label().find("mean =") != string::npos  && col == 3 ||
+			legVec[row].to() == "" && col == 2)
+			return;
+	}
+
+	// Check if the value changed is numeric
+	if(groupingMode != TeUniqueValue && (col == 1 || col == 2))
+	{
+		bool ok;
+		QString qs = v.toString();
+		qs.toDouble(&ok);
+		if(ok == false)
+			return;
+	}
+
+	QString qs = v.toString();
+	string newValue = qs.latin1();
+
+	// Check if the label was the value that was edited,
+	// in this case set it to the new value
+	if((groupingMode != TeUniqueValue && col == 3) ||
+		(groupingMode == TeUniqueValue && col == 2))
+	{
+		legVec[row].label(newValue);
+		return;
+	}
+
+	// The column edited is the "from" or "to" column for
+	// a grouping mode that is different of the "Unique Value" mode
+	vector<TeLegendEntry> tempLegVec = legVec;
+	dValuesVec_.clear();
+	((TeTheme*)appTheme_.getTheme())->buildGrouping(((TeTheme*)appTheme_.getTheme())->grouping(), TeAll, &dValuesVec_);
+	legVec = tempLegVec;
+	
+	if (col == 1)
+		legVec[row].from(newValue);
+	else if (col == 2)
+		legVec[row].to(newValue);
+
+	// Make the label value to be the same as (from ~ to)
+	if (col == 1 || col == 2)
+	{
+		string oldLabel = legVec[row].label();
+		string newLabel = legVec[row].slice().from_;
+		newLabel += " ~ ";
+		newLabel += legVec[row].slice().to_;
+		if ((newLabel != oldLabel) && (oldLabel.find(" ~ ") != string::npos))
+			legVec[row].label(newLabel);
+	}
+
+	// Recalculate the new count value
+	vector<TeSlice> sliceVec;
+	TeSlice slice(legVec[row].from(), legVec[row].to());
+	sliceVec.push_back(slice);
+	TeElemCountingBySlice(dValuesVec_.begin(), dValuesVec_.end(), sliceVec);
+	legVec[row].count(sliceVec[0].count_);
+
+	emit dataChanged();
+}
+    
+bool TeQtLegendSource::generateLegends(const TeGrouping& groupingParams, double minValue, double maxValue)
+{
+	((TeTheme*)appTheme_.getTheme())->grouping(groupingParams);
+
+	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
+
+	legVec.clear();	
+	dValuesVec_.clear();
+	mapObjValVec_.clear();
+
+	bool ret;
+	TeChronon chronon = groupingParams.groupChronon_;
+	if (chronon == TeNOCHRONON)
+		ret = ((TeTheme*)appTheme_.getTheme())->buildGrouping(groupingParams, TeAll, &dValuesVec_);
+	else
+		ret = ((TeTheme*)appTheme_.getTheme())->buildGrouping(groupingParams, chronon, mapObjValVec_);
+
+	if (ret == false)
+	{
+		errorMessage_ = tr("Fail to generate the legends");
+		nRows_ = 0;
+		return false;
+	}
+
+	// Set the number of rows
+	nRows_ = legVec.size();
+
+	// Set the number of columns
+	TeGroupingMode groupingMode = groupingParams.groupMode_;
+	if (groupingMode == TeUniqueValue)
+		nCols_ = 4;
+	else
+		nCols_ = 5;
+
+	// Change the legends if the minValue and maxValue are 
+	// different of zero
+
+	if (groupingMode == TeEqualSteps && (minValue == 0. && maxValue == 0.) == false)
+	{
+		double slice = (maxValue - minValue)/double(groupingParams.groupNumSlices_);
+		int i;
+		for (i = 0; i < groupingParams.groupNumSlices_; ++i)
+		{
+			string from = Te2String(minValue + double(i)*slice, groupingParams.groupPrecision_);
+			legVec[i].from(from);
+			string to = Te2String(minValue + double(i+1)*slice, groupingParams.groupPrecision_);
+			legVec[i].to(to);
+			string label = legVec[i].from() + " ~ " + legVec[i].to();
+			legVec[i].label(label);
+		}
+
+		// Recalculate the new count value
+		vector<TeSlice> sliceVec;
+		for (i = 0; i < groupingParams.groupNumSlices_; ++i)
+		{
+			TeSlice slice(legVec[i].from(), legVec[i].to());
+			sliceVec.push_back(slice);
+		}
+		TeElemCountingBySlice(dValuesVec_.begin(), dValuesVec_.end(), sliceVec);
+		for (unsigned int j = 0; j < sliceVec.size(); ++j)
+			legVec[j].count(sliceVec[j].count_);
+	}
+
+	return true;
+}
+
+void TeQtLegendSource::putColorOnLegend(vector<ColorBar>& iColorVec, vector<ColorBar>& iColorBVec)
+{
+	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
+	if(legVec.size() == 0)
+		return;
+
+	unsigned int i;
+	bool hasMissingData = false;
+
+	// Update the grouping colors of the theme
+	string groupingColors = getColors(iColorVec, iColorBVec, ((TeTheme*)appTheme_.getTheme())->grouping().groupMode_);
+	appTheme_.groupColor(groupingColors);
+
+//	vector<string> colorNameVec;
+//	getColorNameVector(groupingColors, colorNameVec);
+	vector<TeColor> colorVec;
+
+	int nColors = (int)legVec.size();
+	string s = legVec[legVec.size()-1].from();
+	if(s == "Missing Data")
+	{
+		hasMissingData = true;
+		nColors--;
+	}
+
+	TeGrouping& groupingParams = ((TeTheme*)appTheme_.getTheme())->grouping();
+	if (groupingParams.groupMode_ != TeStdDeviation)
+	{
+//		getColors(colorNameVec, nColors, colorVec);
+		colorVec = getColors(iColorVec, nColors);
+//		if (colorNameVec.size() == 1 && invertColor == true)
+//		{
+//			vector<TeColor> cVec;
+//			for (int k = colorVec.size() - 1; k >= 0; --k)
+//				cVec.push_back(colorVec[k]);
+//			colorVec = cVec;
+//		}
+	}
+	else
+	{
+		int leftColors = 0, rightColors = 0;
+
+		for(i = 0; i < legVec.size(); ++i)
+		{
+			string vv = legVec[i].label();
+			if (legVec[i].label().find("mean = ") != string::npos)
+				break;
+		}
+		leftColors = i;
+		rightColors = legVec.size() - i - 1;
+		if(hasMissingData)
+			rightColors--;
+
+		vector<TeColor> leftColorVec, rightColorVec;
+//		vector<string> leftColorNameVec, rightColorNameVec;
+//		if ((colorNameVec.size() % 2) == 0)
+//		{
+//			unsigned int a = colorNameVec.size()/2;
+//			for (i = 0; i < a; ++i)
+//				leftColorNameVec.push_back(colorNameVec[i]);
+//			for (; i < colorNameVec.size(); ++i)
+//				rightColorNameVec.push_back(colorNameVec[i]);
+//		}
+//		else
+//		{
+//			unsigned int a = colorNameVec.size()/2 + 1;
+//			for (i = 0; i < a; ++i)
+//				leftColorNameVec.push_back(colorNameVec[i]);
+//			for (i = a-1; i < colorNameVec.size(); ++i)
+//				rightColorNameVec.push_back(colorNameVec[i]);
+//		}
+//
+//		getColors(leftColorNameVec, leftColors, leftColorVec);
+//		getColors(rightColorNameVec, rightColors, rightColorVec);
+		leftColorVec = getColors(iColorVec, leftColors);
+		rightColorVec = getColors(iColorBVec, rightColors);
+
+//		if (leftColorNameVec.size() == 1 && invertColor == true)
+//		{
+//			vector<TeColor> cVec;
+//			for (int k = leftColorVec.size() - 1; k >= 0; --k)
+//				cVec.push_back(leftColorVec[k]);
+//			leftColorVec = cVec;
+//		}
+//
+//		if (rightColorNameVec.size() == 1 && invertColor == false)
+//		{
+//			vector<TeColor> cVec;
+//			for (int k = rightColorVec.size() - 1; k >= 0; --k)
+//				cVec.push_back(rightColorVec[k]);
+//			rightColorVec = cVec;
+//		}
+
+		for (i = 0; i < leftColorVec.size(); ++i)
+			colorVec.push_back(leftColorVec[i]);
+		colorVec.push_back(leftColorVec[i-1]);
+		for (i = 0; i < rightColorVec.size(); ++i)
+			colorVec.push_back(rightColorVec[i]);
+	}
+
+	if(hasMissingData)
+	{
+		TeColor	cor(255, 255, 255);
+		colorVec.push_back(cor);
+	}
+
+	int visRep = appTheme_.getTheme()->visibleRep();
+	for(i = 0; i < legVec.size(); i++)
+	{
+		string vv = legVec[i].label();
+		if (groupingParams.groupMode_ == TeStdDeviation &&
+			legVec[i].label().find("mean = ") != string::npos)
+			continue;
+
+		TeColor	cor = colorVec[i];
+		if (visRep & TePOINTS)
+		{
+			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TePOINTS);	
+			v->color(cor);
+			legVec[i].setVisual(v->copy(), TePOINTS); 
+		}
+
+		if (visRep & TeLINES)
+		{
+			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TeLINES);	
+			v->color(cor);
+			legVec[i].setVisual(v->copy(), TeLINES); 
+		}
+
+		if ((visRep & TePOLYGONS) || (visRep & TeCELLS))
+		{
+			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TePOLYGONS);	
+			v->color(cor);
+			legVec[i].setVisual(v->copy(), TePOLYGONS); 
+		}
+	}
+}
+
+void TeQtLegendSource::putColorOnLegend(string& groupingColors, bool invertColor)
+{
+	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
+	if(legVec.size() == 0)
+		return;
+
+	unsigned int i;
+	bool hasMissingData = false;
+
+	// Update the grouping colors of the theme
+	appTheme_.groupColor(groupingColors);
+
+	vector<string> colorNameVec;
+	getColorNameVector(groupingColors, colorNameVec);
+	vector<TeColor> colorVec;
+
+	int nColors = (int)legVec.size();
+	string s = legVec[legVec.size()-1].from();
+	if(s == "Missing Data")
+	{
+		hasMissingData = true;
+		nColors--;
+	}
+
+	TeGrouping& groupingParams = ((TeTheme*)appTheme_.getTheme())->grouping();
+	if (groupingParams.groupMode_ != TeStdDeviation)
+	{
+		getColors(colorNameVec, nColors, colorVec);
+		if (colorNameVec.size() == 1 && invertColor == true)
+		{
+			vector<TeColor> cVec;
+			for (int k = colorVec.size() - 1; k >= 0; --k)
+				cVec.push_back(colorVec[k]);
+			colorVec = cVec;
+		}
+	}
+	else
+	{
+		int leftColors = 0, rightColors = 0;
+
+		for(i = 0; i < legVec.size(); ++i)
+		{
+			string vv = legVec[i].label();
+			if (legVec[i].label().find("mean = ") != string::npos)
+				break;
+		}
+		leftColors = i;
+		rightColors = legVec.size() - i - 1;
+		if(hasMissingData)
+			rightColors--;
+
+		vector<TeColor> leftColorVec, rightColorVec;
+		vector<string> leftColorNameVec, rightColorNameVec;
+		if ((colorNameVec.size() % 2) == 0)
+		{
+			unsigned int a = colorNameVec.size()/2;
+			for (i = 0; i < a; ++i)
+				leftColorNameVec.push_back(colorNameVec[i]);
+			for (; i < colorNameVec.size(); ++i)
+				rightColorNameVec.push_back(colorNameVec[i]);
+		}
+		else
+		{
+			unsigned int a = colorNameVec.size()/2 + 1;
+			for (i = 0; i < a; ++i)
+				leftColorNameVec.push_back(colorNameVec[i]);
+			for (i = a-1; i < colorNameVec.size(); ++i)
+				rightColorNameVec.push_back(colorNameVec[i]);
+		}
+
+		getColors(leftColorNameVec, leftColors, leftColorVec);
+		getColors(rightColorNameVec, rightColors, rightColorVec);
+
+		if (leftColorNameVec.size() == 1 && invertColor == true)
+		{
+			vector<TeColor> cVec;
+			for (int k = leftColorVec.size() - 1; k >= 0; --k)
+				cVec.push_back(leftColorVec[k]);
+			leftColorVec = cVec;
+		}
+
+		if (rightColorNameVec.size() == 1 && invertColor == false)
+		{
+			vector<TeColor> cVec;
+			for (int k = rightColorVec.size() - 1; k >= 0; --k)
+				cVec.push_back(rightColorVec[k]);
+			rightColorVec = cVec;
+		}
+
+		for (i = 0; i < leftColorVec.size(); ++i)
+			colorVec.push_back(leftColorVec[i]);
+		colorVec.push_back(leftColorVec[i-1]);
+		for (i = 0; i < rightColorVec.size(); ++i)
+			colorVec.push_back(rightColorVec[i]);
+	}
+
+	if(hasMissingData)
+	{
+		TeColor	cor(255, 255, 255);
+		colorVec.push_back(cor);
+	}
+
+	for(i = 0; i < legVec.size(); i++)
+	{
+		string vv = legVec[i].label();
+		if (groupingParams.groupMode_ == TeStdDeviation &&
+			legVec[i].label().find("mean = ") != string::npos)
+			continue;
+
+		TeColor	cor = colorVec[i];
+		if(((TeTheme*)appTheme_.getTheme())->visibleRep() & TePOINTS)
+		{
+			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TePOINTS);	
+			v->color(cor);
+			legVec[i].setVisual(v->copy(), TePOINTS); 
+		}
+		if(((TeTheme*)appTheme_.getTheme())->visibleRep() & TeLINES)
+		{
+			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TeLINES);	
+			v->color(cor);
+			legVec[i].setVisual(v->copy(), TeLINES); 
+		}
+		if((((TeTheme*)appTheme_.getTheme())->visibleRep() & TePOLYGONS) || (((TeTheme*)appTheme_.getTheme())->visibleRep() & TeCELLS))
+		{
+			TeVisual* v = ((TeTheme*)appTheme_.getTheme())->defaultLegend().visual(TePOLYGONS);	
+			v->color(cor);
+			legVec[i].setVisual(v->copy(), TePOLYGONS); 
+		}
+	}
+}
+
+void TeQtLegendSource::getColorNameVector(string& groupingColors, vector<string>& colorNameVec)
+{
+	if(groupingColors.empty())
+		groupingColors = tr("R").latin1();
+
+	QString s = groupingColors.c_str();
+	QStringList ss = QStringList::split("-",s,true);
+
+	for(unsigned int i = 0; i < ss.size(); i++)
+	{
+		QString a = ss[i];
+		if(tr("R") == a)
+			colorNameVec.push_back("RED");
+		else if(tr("G") == a)
+			colorNameVec.push_back("GREEN");
+		else if(tr("B") == a)
+			colorNameVec.push_back("BLUE");
+		else if(tr("Cy") == a)
+			colorNameVec.push_back("CYAN");
+		else if(tr("Or") == a)
+			colorNameVec.push_back("ORANGE");
+		else if(tr("Mg") == a)
+			colorNameVec.push_back("MAGENTA");
+		else if(tr("Y") == a)
+			colorNameVec.push_back("YELLOW");
+		else
+			colorNameVec.push_back("GRAY");
+	}
+}
+
+void TeQtLegendSource::setLegends(const vector<TeLegendEntry>& inLegVec)
+{
+	vector<TeLegendEntry>& legVec = ((TeTheme*)appTheme_.getTheme())->legend();
+	legVec.clear();
+	legVec = inLegVec;
+	nRows_ = legVec.size();
+}
+
+void TeQtLegendSource::setGroupingParams(const TeGrouping& gParams)
+{
+	TeGrouping& groupingParams = ((TeTheme*)appTheme_.getTheme())->grouping();
+	groupingParams = gParams;
+
+	// Set the number of columns
+	TeGroupingMode groupingMode = groupingParams.groupMode_;
+	if (groupingMode == TeUniqueValue)
+		nCols_ = 4;
+	else
+		nCols_ = 5;
+}
+
+
+
+
diff --git a/src/terralib/drivers/qt/TeQtLegendSource.h b/src/terralib/drivers/qt/TeQtLegendSource.h
old mode 100755
new mode 100644
index a15f9cd..c888e6c
--- a/src/terralib/drivers/qt/TeQtLegendSource.h
+++ b/src/terralib/drivers/qt/TeQtLegendSource.h
@@ -1,64 +1,66 @@
-#ifndef TEQTLEGENDSOURCE_H
-#define TEQTLEGENDSOURCE_H
-
-#include <TeQtDataSource.h>
-#include <TeAppTheme.h>
-#include <TeColorUtils.h>
-#include <string>
-
-class TeDatabase;
-
-using namespace std;
-
-
-class TeQtLegendSource : public TeQtDataSource
-{
-	Q_OBJECT
-
-	public:
-	TeQtLegendSource();
-	~TeQtLegendSource() {}
-
-	QVariant cell(int row, int col);
-	void setCell(int row, int col, const QVariant &v);
-
-	bool generateLegends(const TeGrouping& groupingParams, double minValue = 0., double maxValue = 0.);
-	void putColorOnLegend(string& groupingColors, bool invertColor);
-	void putColorOnLegend(vector<ColorBar>& colorVec, vector<ColorBar>& colorBVec);
-	void getColorNameVector(string& groupingColors, vector<string>& colorNameVec);
-
-	QPixmap createPixmap(int row);
-	void drawPolygonRep(int w, int h, int offset, int row, QPixmap *pixmap);
-	void drawLineRep(int offset, int row, QPixmap *pixmap);
-	void drawPointRep(int pw, int ph, int offset, int row, QPixmap *pixmap);
-
-	void copyAppThemeContents(const TeAppTheme& appTheme);
-	TeAppTheme& getAppTheme() { return appTheme_; }
-	vector<map<string, string> >& mapObjValVec() { return mapObjValVec_; }
-	void setGroupingColors(const QString& gc)
-		{ appTheme_.groupColor(gc.latin1()); }
-
-	void setLegends(const vector<TeLegendEntry>& legVec);
-	void setGroupingParams(const TeGrouping& gParams);
-
-	int numRows() const { return nRows_; }
-	int numCols() const { return nCols_; }
-
-private:
-	TeDatabase* db_;
-	TeAppTheme	appTheme_;
-
-    vector<double> dValuesVec_;
-    vector<map<string, string> >mapObjValVec_;
-    map<TePolyBasicType, Qt::BrushStyle> brushStyleMap_;
-    map<TeLnBasicType, Qt::PenStyle> penStyleMap_;
-
-	QString errorMessage_;
-	QString groupingColors_;
-
-	int nRows_;
-	int nCols_;
-};
-
-
-#endif
+#ifndef TEQTLEGENDSOURCE_H
+#define TEQTLEGENDSOURCE_H
+
+#include <TeQtDataSource.h>
+#include <TeAppTheme.h>
+#include <TeColorUtils.h>
+#include <string>
+
+#include <TeAppUtilsDefines.h>
+
+class TeDatabase;
+
+using namespace std;
+
+
+class TLAPPUTILS_DLL TeQtLegendSource : public TeQtDataSource
+{
+	Q_OBJECT
+
+	public:
+	TeQtLegendSource();
+	~TeQtLegendSource() {}
+
+	QVariant cell(int row, int col);
+	void setCell(int row, int col, const QVariant &v);
+
+	bool generateLegends(const TeGrouping& groupingParams, double minValue = 0., double maxValue = 0.);
+	void putColorOnLegend(string& groupingColors, bool invertColor);
+	void putColorOnLegend(vector<ColorBar>& colorVec, vector<ColorBar>& colorBVec);
+	void getColorNameVector(string& groupingColors, vector<string>& colorNameVec);
+
+	QPixmap createPixmap(int row);
+	void drawPolygonRep(int w, int h, int offset, int row, QPixmap *pixmap);
+	void drawLineRep(int offset, int row, QPixmap *pixmap);
+	void drawPointRep(int pw, int ph, int offset, int row, QPixmap *pixmap);
+
+	void copyAppThemeContents(const TeAppTheme& appTheme);
+	TeAppTheme& getAppTheme() { return appTheme_; }
+	vector<map<string, string> >& mapObjValVec() { return mapObjValVec_; }
+	void setGroupingColors(const QString& gc)
+		{ appTheme_.groupColor(gc.latin1()); }
+
+	void setLegends(const vector<TeLegendEntry>& legVec);
+	void setGroupingParams(const TeGrouping& gParams);
+
+	int numRows() const { return nRows_; }
+	int numCols() const { return nCols_; }
+
+private:
+	TeDatabase* db_;
+	TeAppTheme	appTheme_;
+
+    vector<double> dValuesVec_;
+    vector<map<string, string> >mapObjValVec_;
+    map<TePolyBasicType, Qt::BrushStyle> brushStyleMap_;
+    map<TeLnBasicType, Qt::PenStyle> penStyleMap_;
+
+	QString errorMessage_;
+	QString groupingColors_;
+
+	int nRows_;
+	int nCols_;
+};
+
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtLongEdit.cpp b/src/terralib/drivers/qt/TeQtLongEdit.cpp
old mode 100755
new mode 100644
index 12be58b..dec9a4e
--- a/src/terralib/drivers/qt/TeQtLongEdit.cpp
+++ b/src/terralib/drivers/qt/TeQtLongEdit.cpp
@@ -1,130 +1,130 @@
-#include <qregexp.h>
-#include <qstringlist.h> 
-#include <math.h>
-
-#include "TeQtLongEdit.h"
-
-TeQtLongEdit::TeQtLongEdit(QWidget * parent, const char *name)
-	:QLineEdit(parent, name)
-{}
-
-bool
-TeQtLongEdit::decode(QString lado, short& dg, short& mn, float& sc, double& grauDec)
-{
-	short  	posat,lim = 180;
-
-	double	dd,pi;			
-	posat = 0;
-	pi = 4.*atan((double)1.);
-
-	// Longitude 
-	if(dg < 0 || dg > lim)	
-		return false;
-
-	if(mn < 0 || mn > 60)
-		return false;
-
-	if(sc < 0. || sc > 60.)
-		return false;
-
-	if(lado == "W" || lado == "w"|| lado == "O"|| lado == "o")
-	{
-		if(dg > 0) dg = dg * -1;
-		else if(mn > 0) mn = mn * -1;
-		     else sc = sc * -1.;
-	}
-
-	dd = (double)(abs(dg)) + ((double)abs(mn)/60.) + fabs(sc)/3600.;
-	if (dg < 0 || mn < 0 || (int)sc < 0)
-		dd = -dd;
-
-//	dd = dd*pi/180.;
-	grauDec = dd;
-	return true;
-}
-
-
-void TeQtLongEdit::focusOutEvent( QFocusEvent *e )
-{
-	int mat;
-    QString str = text();
-	QStringList myList;
-	QRegExp exp1("^[oOwWeElL][ ]\\d\\d?\\d?[ ]?\\d\\d?[ ]?\\d?\\d?\\.?[0-9]?" );
-	QRegExp exp2("^[oOwWeElL][;]\\d\\d?\\d?[;]?\\d\\d?[;]?\\d?\\d?\\.?[0-9]?" ); 
-	QRegExp exp3("^[oOwWeElL][:]\\d\\d?\\d?[:]?\\d\\d?[:]?\\d?\\d?\\.?[0-9]?" ); 
-	QRegExp exp4("^[+-]?\\d\\d?\\d?\\.?[0-9]?" ); 
-
-	double grauDec;
-	QString echo_;
-
-    if ( (mat=exp1.match( str )) != -1 )
-	{
-		myList = QStringList::split(" ",str);
-	}
-	else if ((mat=exp2.match( str )) != -1 )
-	{
-		myList = QStringList::split(";",str);
-	}
-	else if ((mat=exp3.match( str )) != -1 )
-	{
-		myList = QStringList::split(":",str);
-	}
-	else if ((mat=exp4.match( str )) != -1 )
-	{
-		grauDec = str.toDouble();
-		if ((grauDec >= -180.0 && grauDec <=180.0))
-		{
-			echo_.sprintf("%3.10f",grauDec);
-			setText(echo_);
-			emit coordValidator(grauDec);
-			return;
-		}
-		else
-		{
-			setSelection( 0, text().length() );
-			emit coordValidator(TeLONGINVALID);
-			return;
-		}
-	}
-	else
-	{
-		setSelection( 0, text().length() );
-		emit coordValidator(TeLONGINVALID);
-		return;
-	}
-	int nelementos = myList.count();
-	short graus, minutos = 0;
-	float segundos = 0.0;
-	
-	graus = myList[1].toShort();
-
-	if (nelementos > 2)
-		minutos = myList[2].toShort();
-	
-	if (nelementos > 3)
-		segundos = myList[3].toFloat();
-
-	bool dec = decode(myList[0],graus, minutos, segundos, grauDec);
-	if (dec)
-	{
-		echo_.sprintf("%s %d %d %2.2f",(const char*) myList[0], abs(graus), minutos, segundos);
-		setText(echo_);
-		emit coordValidator(grauDec);
-		return;
-	}
-	else
-	{
-		setSelection( 0, text().length() );
-		emit coordValidator(TeLONGINVALID);
-		return;
-	}
-}
-
-void TeQtLongEdit::keyPressEvent( QKeyEvent *e )
-{
-    QLineEdit::keyPressEvent( e );
-    if ( e->key() == Key_Enter || e->key() == Key_Return )
-    {
-        emit focusOutEvent(0);
-    }
+#include <qregexp.h>
+#include <qstringlist.h> 
+#include <math.h>
+
+#include "TeQtLongEdit.h"
+
+TeQtLongEdit::TeQtLongEdit(QWidget * parent, const char *name)
+	:QLineEdit(parent, name)
+{}
+
+bool
+TeQtLongEdit::decode(QString lado, short& dg, short& mn, float& sc, double& grauDec)
+{
+	short  	posat,lim = 180;
+
+	double	dd,pi;			
+	posat = 0;
+	pi = 4.*atan((double)1.);
+
+	// Longitude 
+	if(dg < 0 || dg > lim)	
+		return false;
+
+	if(mn < 0 || mn > 60)
+		return false;
+
+	if(sc < 0. || sc > 60.)
+		return false;
+
+	if(lado == "W" || lado == "w"|| lado == "O"|| lado == "o")
+	{
+		if(dg > 0) dg = dg * -1;
+		else if(mn > 0) mn = mn * -1;
+		     else sc = sc * -1.;
+	}
+
+	dd = (double)(abs(dg)) + ((double)abs(mn)/60.) + fabs(sc)/3600.;
+	if (dg < 0 || mn < 0 || (int)sc < 0)
+		dd = -dd;
+
+//	dd = dd*pi/180.;
+	grauDec = dd;
+	return true;
+}
+
+
+void TeQtLongEdit::focusOutEvent( QFocusEvent *e )
+{
+	int mat;
+    QString str = text();
+	QStringList myList;
+	QRegExp exp1("^[oOwWeElL][ ]\\d\\d?\\d?[ ]?\\d\\d?[ ]?\\d?\\d?\\.?[0-9]?" );
+	QRegExp exp2("^[oOwWeElL][;]\\d\\d?\\d?[;]?\\d\\d?[;]?\\d?\\d?\\.?[0-9]?" ); 
+	QRegExp exp3("^[oOwWeElL][:]\\d\\d?\\d?[:]?\\d\\d?[:]?\\d?\\d?\\.?[0-9]?" ); 
+	QRegExp exp4("^[+-]?\\d\\d?\\d?\\.?[0-9]?" ); 
+
+	double grauDec;
+	QString echo_;
+
+    if ( (mat=exp1.match( str )) != -1 )
+	{
+		myList = QStringList::split(" ",str);
+	}
+	else if ((mat=exp2.match( str )) != -1 )
+	{
+		myList = QStringList::split(";",str);
+	}
+	else if ((mat=exp3.match( str )) != -1 )
+	{
+		myList = QStringList::split(":",str);
+	}
+	else if ((mat=exp4.match( str )) != -1 )
+	{
+		grauDec = str.toDouble();
+		if ((grauDec >= -180.0 && grauDec <=180.0))
+		{
+			echo_.sprintf("%3.10f",grauDec);
+			setText(echo_);
+			emit coordValidator(grauDec);
+			return;
+		}
+		else
+		{
+			setSelection( 0, text().length() );
+			emit coordValidator(TeLONGINVALID);
+			return;
+		}
+	}
+	else
+	{
+		setSelection( 0, text().length() );
+		emit coordValidator(TeLONGINVALID);
+		return;
+	}
+	int nelementos = myList.count();
+	short graus, minutos = 0;
+	float segundos = 0.0;
+	
+	graus = myList[1].toShort();
+
+	if (nelementos > 2)
+		minutos = myList[2].toShort();
+	
+	if (nelementos > 3)
+		segundos = myList[3].toFloat();
+
+	bool dec = decode(myList[0],graus, minutos, segundos, grauDec);
+	if (dec)
+	{
+		echo_.sprintf("%s %d %d %2.2f",(const char*) myList[0], abs(graus), minutos, segundos);
+		setText(echo_);
+		emit coordValidator(grauDec);
+		return;
+	}
+	else
+	{
+		setSelection( 0, text().length() );
+		emit coordValidator(TeLONGINVALID);
+		return;
+	}
+}
+
+void TeQtLongEdit::keyPressEvent( QKeyEvent *e )
+{
+    QLineEdit::keyPressEvent( e );
+    if ( e->key() == Key_Enter || e->key() == Key_Return )
+    {
+        emit focusOutEvent(0);
+    }
 }
\ No newline at end of file
diff --git a/src/terralib/drivers/qt/TeQtLongEdit.h b/src/terralib/drivers/qt/TeQtLongEdit.h
old mode 100755
new mode 100644
index 04cfb13..5786350
--- a/src/terralib/drivers/qt/TeQtLongEdit.h
+++ b/src/terralib/drivers/qt/TeQtLongEdit.h
@@ -1,24 +1,24 @@
-#ifndef TEQTLONGEDIT_H
-#define TEQTLONGEDIT_H
-
-#include <qlineedit.h>
-#include <qstring.h>
-#include <qwidget.h>
-
-#define TeLONGINVALID -999.99
-
-class TeQtLongEdit : public QLineEdit
-{
-    Q_OBJECT
-public:
-	TeQtLongEdit(QWidget *parent, const char* name);
-	bool decode(QString lado, short& dg, short& mn, float& sc, double& grauDec);
-
-protected:
-    void focusOutEvent( QFocusEvent *e );
-    void keyPressEvent( QKeyEvent *e );
-
-signals:
-    void coordValidator(const double&);
-};
+#ifndef TEQTLONGEDIT_H
+#define TEQTLONGEDIT_H
+
+#include <qlineedit.h>
+#include <qstring.h>
+#include <qwidget.h>
+
+#define TeLONGINVALID -999.99
+
+class TeQtLongEdit : public QLineEdit
+{
+    Q_OBJECT
+public:
+	TeQtLongEdit(QWidget *parent, const char* name);
+	bool decode(QString lado, short& dg, short& mn, float& sc, double& grauDec);
+
+protected:
+    void focusOutEvent( QFocusEvent *e );
+    void keyPressEvent( QKeyEvent *e );
+
+signals:
+    void coordValidator(const double&);
+};
 #endif
\ No newline at end of file
diff --git a/src/terralib/drivers/qt/TeQtMethods.cpp b/src/terralib/drivers/qt/TeQtMethods.cpp
old mode 100755
new mode 100644
index 820be8c..aa41505
--- a/src/terralib/drivers/qt/TeQtMethods.cpp
+++ b/src/terralib/drivers/qt/TeQtMethods.cpp
@@ -1,453 +1,453 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-
-#include "TeSTElementSet.h"
-#include "TeQtMethods.h"
-#include "TeSkaterFunctions.h"
-#include "TeQtTerraStat.h"
-#include "TeQtGrid.h"
-#include "TeSTEFunctionsDB.h"
-#include "TeDatabaseUtils.h"
-#include <qobject.h>
-#include <qapplication.h>
-
-/////////////////////////////////////////////////////////////////////////////////////
-
-
-bool TeSkaterMethod::apply(vector<double>& het) 
-{
-  if (this->hasPop_) 
-  {
-    this->attrVector_.push_back(this->attrPop_);
-  }
-
-  //add the aggregate attribute in the attribute vetor
-  if(!aggrAttr_.empty())
-	  attrVector_.push_back(aggrAttr_);
-    
-  TeSTElementSet stoSet(regTheme_);
-
-	if(TeProgress::instance())
-	{
-		string caption = tr("Skater function").latin1();
-		TeProgress::instance()->setCaption(caption.c_str());
-	}
-
-  //verify if the theme has external table
-  TeAttrTableVector tables;
-  if(regTheme_->getAttTables(tables, TeAttrExternal))
-  {
-	  TeGroupingAttr grouping;
-	  for(unsigned int j=0; j<attrVector_.size(); ++j)
-	  { 
-		  	TeAttributeRep attrRep(attrVector_[j]);
-			pair<TeAttributeRep, TeStatisticType> attr(attrRep, TeMEAN);
-			grouping.push_back(attr);
-	  }
-
-	  if (!TeSTOSetBuildDB(&stoSet, grouping, true)) 
-	  {
-			QMessageBox::critical(NULL, tr("Error"), 
-				tr("Unexpected: Regions and attributes could not be loaded!"));
-			return false;
-	  }
-  }
-  else
-  {
-	  if (!TeSTOSetBuildDB(&stoSet, true, false, attrVector_)) 
-	  {
-			QMessageBox::critical(NULL, tr("Error"), 
-				tr("Unexpected: Regions and attributes could not be loaded!"));
-			return false;
-	  }
-  }
-
-	//containers to store information when the data will be aggregate by an attribute
-	map<string, TeSTElementSet* >	aggrAttrToElemSet;
-  
-	//get the distinct values of the attribute value
-	if(!aggrAttr_.empty())
-	{
-		TeSTElementSet::iterator it = stoSet.begin();
-		int index = stoSet.getAttributeIndex(aggrAttr_);
-		if(index<0)
-		{
-			QMessageBox::critical(NULL, tr("Error"), 
-				tr("It is no possible aggregate objects by attribute!"));
-			return false;
-		}
-
-		map<string, TeSTElementSet* >::iterator it2;
-		while(it!=stoSet.end())
-		{
-			//get the aggregate attribute
-			string val;
-			it->getPropertyValue(val, index);
-			it2 = aggrAttrToElemSet.find(val);
-			if( it2 == aggrAttrToElemSet.end()) 
-			{
-				TeSTElementSet* elemSet = new TeSTElementSet(regTheme_);
-				TeAttributeList fromAttList = stoSet.getAttributeList();
-				TeAttributeList toAttList;
-				for(unsigned int i=0; i< fromAttList.size(); ++i)
-				{
-					if((int)i == index)
-						continue;
-					toAttList.push_back (fromAttList[i]);
-				}
-
-				elemSet->setAttributeList(toAttList);
-				it->removePropertyValue(index);
-				elemSet->insertSTInstance(*it);
-				aggrAttrToElemSet[val] = elemSet;				
-			}
-			else
-			{
-				it->removePropertyValue(index);
-				it2->second->insertSTInstance(*it);
-			}
-
-			++it;
-		}
-	}
-	
-	double tol = TeGetPrecision(regTheme_->layer()->projection());
-	TePrecision::instance().setPrecision(tol);
-
-	//load prox matrix or construct one
-	TeGeneralizedProxMatrix<TeSTElementSet>*			proxMat=0;
-	TeProxMatrixConstructionStrategy<TeSTElementSet>*	constStrategy=0;
-
-	if(TeProgress::instance())
-	{
-		string msg = tr("Loading Proximity Matrix. Please, wait!").latin1();
-		TeProgress::instance()->setMessage(msg);
-	}
-	//-------------- Load prox matrix or create new
-	if(!loadDefaultGPM(regTheme_->layer()->database(), regTheme_->id(), proxMat))
-	{
-		TeGeomRep geomRep = TeGEOMETRYNONE;
-		if(regTheme_->layer()->hasGeometry (TePOLYGONS))
-			geomRep = TePOLYGONS;
-		else if (regTheme_->layer()->hasGeometry (TeCELLS))
-			geomRep = TeCELLS;
-
-		if(geomRep==TeGEOMETRYNONE)
-		{
-			QString msg = tr("The theme must have a geometric representation of polygons") + "\n";
-			msg += tr("or cells to create contiguity matrix!");
-			QMessageBox::warning(this, tr("Warning"), msg);
-			map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
-			while(itSTElemSets != aggrAttrToElemSet.end())
-			{
-
-				if(itSTElemSets->second)
-					delete itSTElemSets->second;
-				++itSTElemSets;
-			}
-
-			aggrAttrToElemSet.clear();
-			return false;
-		}
-		
-		if(TeProgress::instance())
-		{
-			string msg = tr("Building the Proximity Matrix. Please, wait!").latin1();
-			TeProgress::instance()->setMessage(msg);
-		}
-		
-		//create matrix and save in the database
-		constStrategy = new TeProxMatrixLocalAdjacencyStrategy (&stoSet, geomRep); 
-		TeProxMatrixNoWeightsStrategy sw_no;
-		TeProxMatrixNoSlicingStrategy ss_no;
-		proxMat = new TeGeneralizedProxMatrix<TeSTElementSet>(constStrategy, &sw_no, &ss_no);
-		
-		if (!proxMat->constructMatrix())
-		{
-			QMessageBox::critical(this, tr("Error"), tr("Fail building the proximity matrix!"));
-			if(proxMat)
-				delete proxMat;
-			map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
-			while(itSTElemSets != aggrAttrToElemSet.end())
-			{
-
-				if(itSTElemSets->second)
-					delete itSTElemSets->second;
-				++itSTElemSets;
-			}
-			aggrAttrToElemSet.clear();
-			return false;
-		}
-
-		//save in the database
-		bool savedMatrix = true;
-		if(!regTheme_->layer()->database()->tableExist("te_gpm"))
-		{
-			if(!createGPMMetadataTable(regTheme_->layer()->database()))
-			{
-				QMessageBox::warning(this, tr("Error"), 
-					tr("It was not possible to save proximity matrix in database!"));
-				savedMatrix = false;
-			}
-		}
-
-		string tableName = "te_neighbourhood_"+ Te2String(regTheme_->id());
-		string tempTable = tableName;
-		int count = 1;
-		while(savedMatrix && regTheme_->layer()->database()->tableExist(tempTable))
-		{
-			tempTable = tableName+"_"+Te2String(count);
-			++count;
-		}
-
-		if(savedMatrix && (!createNeighbourhoodTable(regTheme_->layer()->database(), tempTable)))
-		{
-			QMessageBox::warning(this, tr("Error"), 
-					tr("It was not possible to save proximity matrix in database!"));
-				savedMatrix = false;
-		}
-
-		proxMat->neighbourhood_table_=tempTable;
-		//load object ids
-		vector<string> objIds;
-		TeSTElementSet::iterator itAux = stoSet.begin();
-		while(itAux!=stoSet.end())
-		{
-			objIds.push_back(itAux->objectId());
-			++itAux;
-		}
-
-		if(savedMatrix && (!insertGPM(regTheme_->layer()->database(), proxMat, objIds)))
-		{
-			QMessageBox::warning(this, tr("Error"), 
-					tr("It was not possible to save proximity matrix in database!"));
-				savedMatrix = false;
-		}
-	}
-
-	//if the data must be aggregated by an attribute 
-	int numGroups = this->nClusters_;
-	if(!aggrAttr_.empty())
-	{
-		int step = 0;
-		if(TeProgress::instance())
-		{
-			TeProgress::instance()->reset();
-			string msg = tr("Calculating skater... Please, wait!").latin1();
-			TeProgress::instance()->setMessage(msg);
-			TeProgress::instance()->setTotalSteps(aggrAttrToElemSet.size());
-		}
-		
-		map<string, TeSTElementSet* >::iterator it = aggrAttrToElemSet.begin();
-		while(it != aggrAttrToElemSet.end())
-		{
-			this->nClusters_ = numGroups;
-			TeSTElementSet* elSet = it->second;
-			TeGeneralizedProxMatrix<TeSTElementSet>	tempGPM;
-			TeSTElementSet::iterator itSet = elSet->begin();
-			string v = it->first;
-			
-			//! Build the prox matrix only for the objects in each element set
-			bool objectWithoutNeig = false;
-			while(itSet != elSet->end())
-			{
-				TeNeighboursMap neigs = proxMat->getMapNeighbours(itSet->objectId());
-				TeNeighboursMap::iterator itN = neigs.begin();
-				while(itN != neigs.end())
-				{
-					string obj1 = itN->first;
-					string obj2 = itSet->objectId();
-					if(elSet->hasElement(itN->first))
-						tempGPM.connectObjects(itSet->objectId(), itN->first, itN->second);
-					++itN;
-				}
-				
-				if((tempGPM.getNeighbours(itSet->objectId()).size())<1)
-				{
-					objectWithoutNeig = true;
-					itSet = elSet->end();
-					continue;
-				}
-
-				++itSet;
-			}
-			
-			int numObjs = tempGPM.numberOfObjects(); 
-			if(objectWithoutNeig || numObjs<2)
-			{
-				++it;
-				continue;
-			}
-
-			if(numObjs < this->nClusters_)
-				this->nClusters_ = numObjs;
-
-			//! Skater function
-			if (!TeSkaterFunction(this->hasPop_, this->type_, this->nClusters_, this->minPop_, *elSet, &tempGPM, this->resName_, het) ) 
-			{
-				QMessageBox::critical(NULL, tr("Error"), tr("Choose a connected graph!"));
-				if(proxMat)
-					delete proxMat;
-			
-				map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
-				while(itSTElemSets != aggrAttrToElemSet.end())
-				{
-
-					if(itSTElemSets->second)
-						delete itSTElemSets->second;
-					++itSTElemSets;
-				}
-				aggrAttrToElemSet.clear();
-				return false;
-			}
-
-			if (!insertPropertyColumn(*elSet, tableName_, resName_) ) 
-			{
-				QMessageBox::critical(NULL, tr("Error"), tr("Error storing results. Check result column name!"));
-				if(proxMat)
-					delete proxMat;
-
-				map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
-				while(itSTElemSets != aggrAttrToElemSet.end())
-				{
-
-					if(itSTElemSets->second)
-						delete itSTElemSets->second;
-					++itSTElemSets;
-				}
-				aggrAttrToElemSet.clear();
-				return false;
-			}
-			
-			if(TeProgress::instance())
-			{
-				if (TeProgress::instance()->wasCancelled())
-				{
-					TeProgress::instance()->reset();
-					if(proxMat)
-						delete proxMat;
-
-					map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
-					while(itSTElemSets != aggrAttrToElemSet.end())
-					{
-
-						if(itSTElemSets->second)
-							delete itSTElemSets->second;
-						++itSTElemSets;
-					}
-					aggrAttrToElemSet.clear();
-					return false;
-				}
-				else
-					TeProgress::instance()->setProgress(step);
-			}	
-			++step;
-			++it;
-		}
-		if (TeProgress::instance())
-			TeProgress::instance()->reset();
-	}
-	else
-	{
-		if (!TeSkaterFunction(this->hasPop_, this->type_, this->nClusters_, this->minPop_, stoSet, proxMat, this->resName_, het) ) 
-		{
-			QMessageBox::critical(NULL, tr("Error"), tr("Choose a connected graph!"));
-			if(proxMat)
-				delete proxMat;
-			map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
-			while(itSTElemSets != aggrAttrToElemSet.end())
-			{
-
-				if(itSTElemSets->second)
-					delete itSTElemSets->second;
-				++itSTElemSets;
-			}
-			aggrAttrToElemSet.clear();
-			return false;
-		}
-
-		double h;
-		for(unsigned int i = 0; i < het.size(); i++) 
-		{
-			h = het[i];
-		}
-
-		if (!insertPropertyColumn(stoSet, tableName_, resName_) ) 
-		{
-			QMessageBox::critical(NULL, tr("Error"), tr("Error storing results. Check result column name!"));
-			if(proxMat)
-				delete proxMat;
-			map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
-			while(itSTElemSets != aggrAttrToElemSet.end())
-			{
-
-				if(itSTElemSets->second)
-					delete itSTElemSets->second;
-				++itSTElemSets;
-			}
-			aggrAttrToElemSet.clear();
-			return false;
-		}
-	}
-
-  // ---------------------------------------------- load updated table from database 
-	// Update all the themes that uses this table
-	TeViewMap& viewMap = regTheme_->layer()->database()->viewMap();
-	TeViewMap::iterator it;
-	set<TeLayer*> layerSet;
-	for (it = viewMap.begin(); it != viewMap.end(); ++it)
-	{
-		TeView *view = it->second;
-		vector<TeViewNode*>& themesVector = view->themes();
-		for (unsigned int i = 0; i < themesVector.size(); ++i)
-		{
-			TeTheme* theme = (TeTheme*)themesVector[i];
-			if (theme->type() != TeTHEME)
-				continue;
-			if (theme->isThemeTable(tableName_) == true)
-			{
-				theme->loadThemeTables();
-				layerSet.insert(theme->layer());
-			}
-		}
-	}
-
-	// Update the layer tables affected
-	set<TeLayer*>::iterator setIt;
-	for (setIt = layerSet.begin(); setIt != layerSet.end(); ++setIt)
-		(*setIt)->loadLayerTables();
-
-	//delete pointers
-	map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
-	while(itSTElemSets != aggrAttrToElemSet.end())
-	{
-
-		if(itSTElemSets->second)
-			delete itSTElemSets->second;
-		++itSTElemSets;
-	}
-	aggrAttrToElemSet.clear();
-	if(proxMat)
-		delete proxMat;
-	return true;
-}
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+
+#include "TeSTElementSet.h"
+#include "TeQtMethods.h"
+#include "TeSkaterFunctions.h"
+#include "TeQtTerraStat.h"
+#include "TeQtGrid.h"
+#include "TeSTEFunctionsDB.h"
+#include "TeDatabaseUtils.h"
+#include <qobject.h>
+#include <qapplication.h>
+
+/////////////////////////////////////////////////////////////////////////////////////
+
+
+bool TeSkaterMethod::apply(vector<double>& het) 
+{
+  if (this->hasPop_) 
+  {
+    this->attrVector_.push_back(this->attrPop_);
+  }
+
+  //add the aggregate attribute in the attribute vetor
+  if(!aggrAttr_.empty())
+	  attrVector_.push_back(aggrAttr_);
+    
+  TeSTElementSet stoSet(regTheme_);
+
+	if(TeProgress::instance())
+	{
+		string caption = tr("Skater function").latin1();
+		TeProgress::instance()->setCaption(caption.c_str());
+	}
+
+  //verify if the theme has external table
+  TeAttrTableVector tables;
+  if(regTheme_->getAttTables(tables, TeAttrExternal))
+  {
+	  TeGroupingAttr grouping;
+	  for(unsigned int j=0; j<attrVector_.size(); ++j)
+	  { 
+		  	TeAttributeRep attrRep(attrVector_[j]);
+			pair<TeAttributeRep, TeStatisticType> attr(attrRep, TeMEAN);
+			grouping.push_back(attr);
+	  }
+
+	  if (!TeSTOSetBuildDB(&stoSet, grouping, true)) 
+	  {
+			QMessageBox::critical(NULL, tr("Error"), 
+				tr("Unexpected: Regions and attributes could not be loaded!"));
+			return false;
+	  }
+  }
+  else
+  {
+	  if (!TeSTOSetBuildDB(&stoSet, true, false, attrVector_)) 
+	  {
+			QMessageBox::critical(NULL, tr("Error"), 
+				tr("Unexpected: Regions and attributes could not be loaded!"));
+			return false;
+	  }
+  }
+
+	//containers to store information when the data will be aggregate by an attribute
+	map<string, TeSTElementSet* >	aggrAttrToElemSet;
+  
+	//get the distinct values of the attribute value
+	if(!aggrAttr_.empty())
+	{
+		TeSTElementSet::iterator it = stoSet.begin();
+		int index = stoSet.getAttributeIndex(aggrAttr_);
+		if(index<0)
+		{
+			QMessageBox::critical(NULL, tr("Error"), 
+				tr("It is no possible aggregate objects by attribute!"));
+			return false;
+		}
+
+		map<string, TeSTElementSet* >::iterator it2;
+		while(it!=stoSet.end())
+		{
+			//get the aggregate attribute
+			string val;
+			it->getPropertyValue(val, index);
+			it2 = aggrAttrToElemSet.find(val);
+			if( it2 == aggrAttrToElemSet.end()) 
+			{
+				TeSTElementSet* elemSet = new TeSTElementSet(regTheme_);
+				TeAttributeList fromAttList = stoSet.getAttributeList();
+				TeAttributeList toAttList;
+				for(unsigned int i=0; i< fromAttList.size(); ++i)
+				{
+					if((int)i == index)
+						continue;
+					toAttList.push_back (fromAttList[i]);
+				}
+
+				elemSet->setAttributeList(toAttList);
+				it->removePropertyValue(index);
+				elemSet->insertSTInstance(*it);
+				aggrAttrToElemSet[val] = elemSet;				
+			}
+			else
+			{
+				it->removePropertyValue(index);
+				it2->second->insertSTInstance(*it);
+			}
+
+			++it;
+		}
+	}
+	
+	double tol = TeGetPrecision(regTheme_->layer()->projection());
+	TePrecision::instance().setPrecision(tol);
+
+	//load prox matrix or construct one
+	TeGeneralizedProxMatrix<TeSTElementSet>*			proxMat=0;
+	TeProxMatrixConstructionStrategy<TeSTElementSet>*	constStrategy=0;
+
+	if(TeProgress::instance())
+	{
+		string msg = tr("Loading Proximity Matrix. Please, wait!").latin1();
+		TeProgress::instance()->setMessage(msg);
+	}
+	//-------------- Load prox matrix or create new
+	if(!loadDefaultGPM(regTheme_->layer()->database(), regTheme_->id(), proxMat))
+	{
+		TeGeomRep geomRep = TeGEOMETRYNONE;
+		if(regTheme_->layer()->hasGeometry (TePOLYGONS))
+			geomRep = TePOLYGONS;
+		else if (regTheme_->layer()->hasGeometry (TeCELLS))
+			geomRep = TeCELLS;
+
+		if(geomRep==TeGEOMETRYNONE)
+		{
+			QString msg = tr("The theme must have a geometric representation of polygons") + "\n";
+			msg += tr("or cells to create contiguity matrix!");
+			QMessageBox::warning(this, tr("Warning"), msg);
+			map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
+			while(itSTElemSets != aggrAttrToElemSet.end())
+			{
+
+				if(itSTElemSets->second)
+					delete itSTElemSets->second;
+				++itSTElemSets;
+			}
+
+			aggrAttrToElemSet.clear();
+			return false;
+		}
+		
+		if(TeProgress::instance())
+		{
+			string msg = tr("Building the Proximity Matrix. Please, wait!").latin1();
+			TeProgress::instance()->setMessage(msg);
+		}
+		
+		//create matrix and save in the database
+		constStrategy = new TeProxMatrixLocalAdjacencyStrategy (&stoSet, geomRep); 
+		TeProxMatrixNoWeightsStrategy sw_no;
+		TeProxMatrixNoSlicingStrategy ss_no;
+		proxMat = new TeGeneralizedProxMatrix<TeSTElementSet>(constStrategy, &sw_no, &ss_no);
+		
+		if (!proxMat->constructMatrix())
+		{
+			QMessageBox::critical(this, tr("Error"), tr("Fail building the proximity matrix!"));
+			if(proxMat)
+				delete proxMat;
+			map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
+			while(itSTElemSets != aggrAttrToElemSet.end())
+			{
+
+				if(itSTElemSets->second)
+					delete itSTElemSets->second;
+				++itSTElemSets;
+			}
+			aggrAttrToElemSet.clear();
+			return false;
+		}
+
+		//save in the database
+		bool savedMatrix = true;
+		if(!regTheme_->layer()->database()->tableExist("te_gpm"))
+		{
+			if(!createGPMMetadataTable(regTheme_->layer()->database()))
+			{
+				QMessageBox::warning(this, tr("Error"), 
+					tr("It was not possible to save proximity matrix in database!"));
+				savedMatrix = false;
+			}
+		}
+
+		string tableName = "te_neighbourhood_"+ Te2String(regTheme_->id());
+		string tempTable = tableName;
+		int count = 1;
+		while(savedMatrix && regTheme_->layer()->database()->tableExist(tempTable))
+		{
+			tempTable = tableName+"_"+Te2String(count);
+			++count;
+		}
+
+		if(savedMatrix && (!createNeighbourhoodTable(regTheme_->layer()->database(), tempTable)))
+		{
+			QMessageBox::warning(this, tr("Error"), 
+					tr("It was not possible to save proximity matrix in database!"));
+				savedMatrix = false;
+		}
+
+		proxMat->neighbourhood_table_=tempTable;
+		//load object ids
+		vector<string> objIds;
+		TeSTElementSet::iterator itAux = stoSet.begin();
+		while(itAux!=stoSet.end())
+		{
+			objIds.push_back(itAux->objectId());
+			++itAux;
+		}
+
+		if(savedMatrix && (!insertGPM(regTheme_->layer()->database(), proxMat, objIds)))
+		{
+			QMessageBox::warning(this, tr("Error"), 
+					tr("It was not possible to save proximity matrix in database!"));
+				savedMatrix = false;
+		}
+	}
+
+	//if the data must be aggregated by an attribute 
+	int numGroups = this->nClusters_;
+	if(!aggrAttr_.empty())
+	{
+		int step = 0;
+		if(TeProgress::instance())
+		{
+			TeProgress::instance()->reset();
+			string msg = tr("Calculating skater... Please, wait!").latin1();
+			TeProgress::instance()->setMessage(msg);
+			TeProgress::instance()->setTotalSteps(aggrAttrToElemSet.size());
+		}
+		
+		map<string, TeSTElementSet* >::iterator it = aggrAttrToElemSet.begin();
+		while(it != aggrAttrToElemSet.end())
+		{
+			this->nClusters_ = numGroups;
+			TeSTElementSet* elSet = it->second;
+			TeGeneralizedProxMatrix<TeSTElementSet>	tempGPM;
+			TeSTElementSet::iterator itSet = elSet->begin();
+			string v = it->first;
+			
+			//! Build the prox matrix only for the objects in each element set
+			bool objectWithoutNeig = false;
+			while(itSet != elSet->end())
+			{
+				TeNeighboursMap neigs = proxMat->getMapNeighbours(itSet->objectId());
+				TeNeighboursMap::iterator itN = neigs.begin();
+				while(itN != neigs.end())
+				{
+					string obj1 = itN->first;
+					string obj2 = itSet->objectId();
+					if(elSet->hasElement(itN->first))
+						tempGPM.connectObjects(itSet->objectId(), itN->first, itN->second);
+					++itN;
+				}
+				
+				if((tempGPM.getNeighbours(itSet->objectId()).size())<1)
+				{
+					objectWithoutNeig = true;
+					itSet = elSet->end();
+					continue;
+				}
+
+				++itSet;
+			}
+			
+			int numObjs = tempGPM.numberOfObjects(); 
+			if(objectWithoutNeig || numObjs<2)
+			{
+				++it;
+				continue;
+			}
+
+			if(numObjs < this->nClusters_)
+				this->nClusters_ = numObjs;
+
+			//! Skater function
+			if (!TeSkaterFunction(this->hasPop_, this->type_, this->nClusters_, this->minPop_, *elSet, &tempGPM, this->resName_, het) ) 
+			{
+				QMessageBox::critical(NULL, tr("Error"), tr("Choose a connected graph!"));
+				if(proxMat)
+					delete proxMat;
+			
+				map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
+				while(itSTElemSets != aggrAttrToElemSet.end())
+				{
+
+					if(itSTElemSets->second)
+						delete itSTElemSets->second;
+					++itSTElemSets;
+				}
+				aggrAttrToElemSet.clear();
+				return false;
+			}
+
+			if (!insertPropertyColumn(*elSet, tableName_, resName_) ) 
+			{
+				QMessageBox::critical(NULL, tr("Error"), tr("Error storing results. Check result column name!"));
+				if(proxMat)
+					delete proxMat;
+
+				map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
+				while(itSTElemSets != aggrAttrToElemSet.end())
+				{
+
+					if(itSTElemSets->second)
+						delete itSTElemSets->second;
+					++itSTElemSets;
+				}
+				aggrAttrToElemSet.clear();
+				return false;
+			}
+			
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+				{
+					TeProgress::instance()->reset();
+					if(proxMat)
+						delete proxMat;
+
+					map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
+					while(itSTElemSets != aggrAttrToElemSet.end())
+					{
+
+						if(itSTElemSets->second)
+							delete itSTElemSets->second;
+						++itSTElemSets;
+					}
+					aggrAttrToElemSet.clear();
+					return false;
+				}
+				else
+					TeProgress::instance()->setProgress(step);
+			}	
+			++step;
+			++it;
+		}
+		if (TeProgress::instance())
+			TeProgress::instance()->reset();
+	}
+	else
+	{
+		if (!TeSkaterFunction(this->hasPop_, this->type_, this->nClusters_, this->minPop_, stoSet, proxMat, this->resName_, het) ) 
+		{
+			QMessageBox::critical(NULL, tr("Error"), tr("Choose a connected graph!"));
+			if(proxMat)
+				delete proxMat;
+			map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
+			while(itSTElemSets != aggrAttrToElemSet.end())
+			{
+
+				if(itSTElemSets->second)
+					delete itSTElemSets->second;
+				++itSTElemSets;
+			}
+			aggrAttrToElemSet.clear();
+			return false;
+		}
+
+		double h;
+		for(unsigned int i = 0; i < het.size(); i++) 
+		{
+			h = het[i];
+		}
+
+		if (!insertPropertyColumn(stoSet, tableName_, resName_) ) 
+		{
+			QMessageBox::critical(NULL, tr("Error"), tr("Error storing results. Check result column name!"));
+			if(proxMat)
+				delete proxMat;
+			map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
+			while(itSTElemSets != aggrAttrToElemSet.end())
+			{
+
+				if(itSTElemSets->second)
+					delete itSTElemSets->second;
+				++itSTElemSets;
+			}
+			aggrAttrToElemSet.clear();
+			return false;
+		}
+	}
+
+  // ---------------------------------------------- load updated table from database 
+	// Update all the themes that uses this table
+	TeViewMap& viewMap = regTheme_->layer()->database()->viewMap();
+	TeViewMap::iterator it;
+	set<TeLayer*> layerSet;
+	for (it = viewMap.begin(); it != viewMap.end(); ++it)
+	{
+		TeView *view = it->second;
+		vector<TeViewNode*>& themesVector = view->themes();
+		for (unsigned int i = 0; i < themesVector.size(); ++i)
+		{
+			TeTheme* theme = (TeTheme*)themesVector[i];
+			if (theme->type() != TeTHEME)
+				continue;
+			if (theme->isThemeTable(tableName_) == true)
+			{
+				theme->loadThemeTables();
+				layerSet.insert(theme->layer());
+			}
+		}
+	}
+
+	// Update the layer tables affected
+	set<TeLayer*>::iterator setIt;
+	for (setIt = layerSet.begin(); setIt != layerSet.end(); ++setIt)
+		(*setIt)->loadLayerTables();
+
+	//delete pointers
+	map<string, TeSTElementSet* >::iterator itSTElemSets = aggrAttrToElemSet.begin();
+	while(itSTElemSets != aggrAttrToElemSet.end())
+	{
+
+		if(itSTElemSets->second)
+			delete itSTElemSets->second;
+		++itSTElemSets;
+	}
+	aggrAttrToElemSet.clear();
+	if(proxMat)
+		delete proxMat;
+	return true;
+}
+
diff --git a/src/terralib/drivers/qt/TeQtMethods.h b/src/terralib/drivers/qt/TeQtMethods.h
old mode 100755
new mode 100644
index 331dc57..f2b7515
--- a/src/terralib/drivers/qt/TeQtMethods.h
+++ b/src/terralib/drivers/qt/TeQtMethods.h
@@ -1,76 +1,78 @@
-#ifndef  __TERRALIB_INTERNAL_QTTERRAMETHODS_H
-#define  __TERRALIB_INTERNAL_QTTERRAMETHODS_H
-/***
- * Implementa suporte para as funcoes do TerraStat
- * Objetivo -- soh nao manter a parte de geracao de eventos,
- * etc no ui, que podera ser reaproveitado.
- ****/
-
-#include "TeDatabase.h"
-#include "TeKernelParams.h"
-#include <qapplication.h>
-
-/////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////
-class TeAppTheme;
-class TeQtGrid;
-
-class TeSkaterMethod : public QWidget {
-
-	Q_OBJECT
-
-protected:
-  //Method params
-  TeTheme*			regTheme_;    //Tema de regioes
-  vector<string>	attrVector_;  //Atributos a serem utilizados
-  bool				hasPop_;       //Usa populacao
-  string			attrPop_;     //Atributo de populacao
-  int				type_;
-  int				minPop_;
-  int				nClusters_;
-  string			tableName_;
-  string			resName_;
-
-  string			aggrAttr_;	//aggregate attribute
-
-public:
-
-	//! Constructor
-	TeSkaterMethod():  regTheme_(0), hasPop_(false), attrPop_(""), 
-		nClusters_(0), tableName_(""), resName_(""), aggrAttr_("")
-	{ }
-		
-	bool setTheme(string name, TeView* view) {
-    regTheme_ = view->get(name);
-    return (regTheme_ != NULL);
-  }
-
-  void setAttrVector(const vector<string>& vec) {
-    attrVector_ = vec;
-  }
-
-  void setAggrAttr(const string& attrName) 
-  {
-    aggrAttr_ = attrName;
-  }
-
-  void setHasPop(bool hp, const string& pop) {
-    hasPop_ = hp;
-    attrPop_ = pop;
-  }
-
-  void setType(int t, int mp, int nc) {
-    type_ = t; minPop_= mp; nClusters_= nc;
-  }
-
-  void setResName(string r, string t) {
-    resName_ = r;
-    tableName_ = t;
-  }
-
-  //Aplica o metodo skater
-  bool apply(vector<double>& het);
-
-};
-
-#endif
+#ifndef  __TERRALIB_INTERNAL_QTTERRAMETHODS_H
+#define  __TERRALIB_INTERNAL_QTTERRAMETHODS_H
+/***
+ * Implementa suporte para as funcoes do TerraStat
+ * Objetivo -- soh nao manter a parte de geracao de eventos,
+ * etc no ui, que podera ser reaproveitado.
+ ****/
+
+#include "TeDatabase.h"
+#include "TeKernelParams.h"
+#include <qapplication.h>
+
+#include "TViewDefines.h"
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+class TeAppTheme;
+class TeQtGrid;
+
+class TVIEW_DLL TeSkaterMethod : public QWidget {
+
+	Q_OBJECT
+
+protected:
+  //Method params
+  TeTheme*			regTheme_;    //Tema de regioes
+  vector<string>	attrVector_;  //Atributos a serem utilizados
+  bool				hasPop_;       //Usa populacao
+  string			attrPop_;     //Atributo de populacao
+  int				type_;
+  int				minPop_;
+  int				nClusters_;
+  string			tableName_;
+  string			resName_;
+
+  string			aggrAttr_;	//aggregate attribute
+
+public:
+
+	//! Constructor
+	TeSkaterMethod():  regTheme_(0), hasPop_(false), attrPop_(""), 
+		nClusters_(0), tableName_(""), resName_(""), aggrAttr_("")
+	{ }
+		
+	bool setTheme(string name, TeView* view) {
+    regTheme_ = view->get(name);
+    return (regTheme_ != NULL);
+  }
+
+  void setAttrVector(const vector<string>& vec) {
+    attrVector_ = vec;
+  }
+
+  void setAggrAttr(const string& attrName) 
+  {
+    aggrAttr_ = attrName;
+  }
+
+  void setHasPop(bool hp, const string& pop) {
+    hasPop_ = hp;
+    attrPop_ = pop;
+  }
+
+  void setType(int t, int mp, int nc) {
+    type_ = t; minPop_= mp; nClusters_= nc;
+  }
+
+  void setResName(string r, string t) {
+    resName_ = r;
+    tableName_ = t;
+  }
+
+  //Aplica o metodo skater
+  bool apply(vector<double>& het);
+
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtProgress.h b/src/terralib/drivers/qt/TeQtProgress.h
old mode 100755
new mode 100644
index 114ce84..c0a4aaa
--- a/src/terralib/drivers/qt/TeQtProgress.h
+++ b/src/terralib/drivers/qt/TeQtProgress.h
@@ -1,138 +1,140 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTPROGRESS_H
-#define  __TERRALIB_INTERNAL_QTPROGRESS_H
-
-#include <qprogressdialog.h>
-#include <qapplication.h>
-#include <qcursor.h>
-#include <qaction.h>
-#include "TeProgress.h"
-#include <qeventloop.h>
-
-class TeQtProgress : public QProgressDialog, public TeProgressBase
-{
-	Q_OBJECT
-
-protected:
-	int		numberOfCursors_;	//<! Number of cursors that were pushed on application stack.
-
-	void enterEvent ( QEvent * )
-	{
-		if(QApplication::overrideCursor())
-		{
-			if(QApplication::overrideCursor()->shape() != Qt::ArrowCursor)
-			{
-				QApplication::setOverrideCursor( Qt::ArrowCursor );
-				numberOfCursors_++;
-			}
-		}
-	}
-
-	void leaveEvent ( QEvent * )
-	{
-		if(QApplication::overrideCursor())
-		{
-			if(QApplication::overrideCursor()->shape() == Qt::ArrowCursor)
-			{
-				QApplication::restoreOverrideCursor();
-				numberOfCursors_--;
-			}
-		}
-	}
-
-public:
-	TeQtProgress( QWidget * creator = 0, const char * name = 0, bool modal = FALSE, WFlags f = 0)
-		: QProgressDialog(creator, name, modal, f)	
-	{
-		numberOfCursors_ = 0;
-	}
-
-	~TeQtProgress() {}
-
-	void reset()
-	{
-		int i;
-		QProgressDialog::reset();
-		QProgressDialog::setLabelText("");
-		QProgressDialog::setCaption("");
-
-		//Restore all cursors that were set by TeQtProgress.
-		for (i=0; i<numberOfCursors_; i++)
-		{
-			if(QApplication::overrideCursor())
-				QApplication::restoreOverrideCursor();
-		}
-		numberOfCursors_ = 0;
-	}
-
-	void setTotalSteps (int steps)
-	{
-		QProgressDialog::setTotalSteps(steps);
-		if(QApplication::overrideCursor())
-		{
-			if(QApplication::overrideCursor()->shape() != Qt::WaitCursor)
-			{
-				QApplication::setOverrideCursor( Qt::WaitCursor );
-				numberOfCursors_++;
-			}
-		}
-		else
-		{
-			QApplication::setOverrideCursor( Qt::WaitCursor );
-			numberOfCursors_++;
-		}
-	}
-
-	void setMessage(const string& text)
-	{
-		QProgressDialog::setLabelText(text.c_str());
-	}
-
-	string getMessage()
-	{
-		return QProgressDialog::labelText().latin1();
-	}
-
-	void setProgress(int steps)
-	{
-		QProgressDialog::setProgress(steps);
-	}
-
-	 bool wasCancelled()
-	 {
-		 hasMouse();
-		 return QProgressDialog::wasCancelled();
-	 }
-
-	 void setCaption(const string& cap)
-	 {
-		 QProgressDialog::setCaption(cap.c_str());
-	 }
-
-	 void cancel() 
-	 {
-		 QProgressDialog::cancel();
-	 }
-
-};
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTPROGRESS_H
+#define  __TERRALIB_INTERNAL_QTPROGRESS_H
+
+#include <qprogressdialog.h>
+#include <qapplication.h>
+#include <qcursor.h>
+#include <qaction.h>
+#include "TeProgress.h"
+#include <qeventloop.h>
+
+#include <TeAppUtilsDefines.h>
+
+class TLAPPUTILS_DLL TeQtProgress : public QProgressDialog, public TeProgressBase
+{
+	Q_OBJECT
+
+protected:
+	int		numberOfCursors_;	//<! Number of cursors that were pushed on application stack.
+
+	void enterEvent ( QEvent * )
+	{
+		if(QApplication::overrideCursor())
+		{
+			if(QApplication::overrideCursor()->shape() != Qt::ArrowCursor)
+			{
+				QApplication::setOverrideCursor( Qt::ArrowCursor );
+				numberOfCursors_++;
+			}
+		}
+	}
+
+	void leaveEvent ( QEvent * )
+	{
+		if(QApplication::overrideCursor())
+		{
+			if(QApplication::overrideCursor()->shape() == Qt::ArrowCursor)
+			{
+				QApplication::restoreOverrideCursor();
+				numberOfCursors_--;
+			}
+		}
+	}
+
+public:
+	TeQtProgress( QWidget * creator = 0, const char * name = 0, bool modal = FALSE, WFlags f = 0)
+		: QProgressDialog(creator, name, modal, f)	
+	{
+		numberOfCursors_ = 0;
+	}
+
+	~TeQtProgress() {}
+
+	void reset()
+	{
+		int i;
+		QProgressDialog::reset();
+		QProgressDialog::setLabelText("");
+		QProgressDialog::setCaption("");
+
+		//Restore all cursors that were set by TeQtProgress.
+		for (i=0; i<numberOfCursors_; i++)
+		{
+			if(QApplication::overrideCursor())
+				QApplication::restoreOverrideCursor();
+		}
+		numberOfCursors_ = 0;
+	}
+
+	void setTotalSteps (int steps)
+	{
+		QProgressDialog::setTotalSteps(steps);
+		if(QApplication::overrideCursor())
+		{
+			if(QApplication::overrideCursor()->shape() != Qt::WaitCursor)
+			{
+				QApplication::setOverrideCursor( Qt::WaitCursor );
+				numberOfCursors_++;
+			}
+		}
+		else
+		{
+			QApplication::setOverrideCursor( Qt::WaitCursor );
+			numberOfCursors_++;
+		}
+	}
+
+	void setMessage(const string& text)
+	{
+		QProgressDialog::setLabelText(text.c_str());
+	}
+
+	string getMessage()
+	{
+		return QProgressDialog::labelText().latin1();
+	}
+
+	void setProgress(int steps)
+	{
+		QProgressDialog::setProgress(steps);
+	}
+
+	 bool wasCancelled()
+	 {
+		 hasMouse();
+		 return QProgressDialog::wasCancelled();
+	 }
+
+	 void setCaption(const string& cap)
+	 {
+		 QProgressDialog::setCaption(cap.c_str());
+	 }
+
+	 void cancel() 
+	 {
+		 QProgressDialog::cancel();
+	 }
+
+};
+#endif
diff --git a/src/terralib/drivers/qt/TeQtShowMedia.cpp b/src/terralib/drivers/qt/TeQtShowMedia.cpp
old mode 100755
new mode 100644
index 3aaea01..191b957
--- a/src/terralib/drivers/qt/TeQtShowMedia.cpp
+++ b/src/terralib/drivers/qt/TeQtShowMedia.cpp
@@ -1,1983 +1,2096 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtShowMedia.h>
-#include <TeAttribute.h>
-#include <qfiledialog.h> 
-#include <qlineedit.h> 
-#include <qstring.h> 
-#include <qtextedit.h> 
-#include <qmessagebox.h>
-#include <qfile.h>
-#include <errno.h>
-#include <qprocess.h>
-#include <qapplication.h>
-
-#ifdef WIN32
-#include <windows.h>
-#include <process.h>
-#include <io.h>
-#include <direct.h>
-#else
-#include <unistd.h>
-#endif
-
-
-TeQtShowMedia :: TeQtShowMedia(QWidget* parent, const char* name)
-	: QTable(2, 2, parent, name)
-{
-	layer_ = 0;
-	db_ = 0;
-	cmdLocal_ = false;
-	row_ = -1;
-	popup_ = new QPopupMenu(this);
-	popup_->insertItem(tr("Show Media..."), this, SLOT(slotShow()));
-	popup_->insertItem(tr("Insert Media..."), this, SLOT(slotInsert(QString&)));
-	popup_->insertItem(tr("Insert URL..."), this, SLOT(slotInsertURL()));
-	popup_->insertItem(tr("Remove..."), this, SLOT(slotRemove()));
-	popup_->insertItem(tr("Set the Default Media"), this, SLOT(slotSetDefault()));
-	popup_->insertItem(tr("Description..."), this, SLOT(slotDescription()));
-
-	connect(this, SIGNAL(pressed(int, int, int, const QPoint&)),
-		 this, SLOT(slotpressed(int, int, int, const QPoint&)));
-
-	connect(this, SIGNAL(doubleClicked(int, int, int, const QPoint&)),
-		 this, SLOT(slotDoubleClicked(int, int, int, const QPoint&)));
-}
-
-TeQtShowMedia :: ~TeQtShowMedia()
-{
-}
-
-void TeQtShowMedia :: init(string objId, TeAppTheme* theme, TeQtGrid* grid)
-{
-	setNumRows(0);
-	id_ = objId;
-	nattrs_ = grid->numCols();
-	layer_ = ((TeTheme*)theme->getTheme())->layer();
-	table_ = layer_->mediaTable();
-	db_ = layer_->database();
-	TeDatabasePortal* portal = db_->getPortal();
-	row_ = -1;
-	
-	TeAttributeList	colAttrList;
-	db_->getAttributeList(((TeTheme*)theme->getTheme())->collectionTable(), colAttrList);
-
-	horizontalHeader()->setLabel(0, tr("Attribute"));
-	horizontalHeader()->setLabel(1, tr("Value"));
-
-	int	i, nMidias = 0;
-	if(table_.empty() == false)
-	{
-		string q = "SELECT COUNT(*) FROM " + table_;
-		q += " WHERE object_id = '" + id_ + "'";
-		if(portal->query(q))
-		{
-			if(portal->fetchRow())
-				nMidias = atoi(portal->getData(0));
-		}
-	}
-
-	string sel = ((TeTheme*)theme->getTheme())->sqlJoin() + " WHERE c_object_id = '" + id_ + "'";
-
-	portal->freeResult();
-	if(portal->query(sel))
-	{
-		int ncol = portal->getAttributeList().size() - colAttrList.size() + nMidias;
-
-		setNumRows(ncol);
-
-		if(portal->fetchRow())
-		{
-			for(i=0; i<grid->numCols(); i++)
-			{
-				string fname = portal->getAttribute(i).rep_.name_;
-				string data = portal->getData(i);
-				setText(i, 0, fname.c_str());
-				setText(i, 1, data.c_str());
-			}
-		}
-
-		if(table_.empty() == false)
-		{
-			string q = "SELECT media_name, media_table, show_default FROM " + table_;
-			q += " WHERE object_id = '" + id_ + "'";
-			portal->freeResult();
-			if(portal->query(q))
-			{
-				TeDatabasePortal* portal2 = db_->getPortal();
-				while(portal->fetchRow())
-				{
-					string type;
-					string mediaName = portal->getData(0);
-					string mediaTable = portal->getData(1);
-					bool showDefault = atoi(portal->getData(2));
-
-					string q = "SELECT media_type FROM " + mediaTable;
-					q += " WHERE media_name = '" + mediaName + "'";
-					portal2->freeResult();
-					if(portal2->query(q))
-					{
-						if(portal2->fetchRow())
-							type = portal2->getData(0);
-					}
-
-					string ss;
-					if(showDefault)
-						ss = "*media: "; // + type;
-					else
-						ss = "media: "; // + type;
-
-					setText(i, 0, ss.c_str());
-					setText(i, 1, mediaName.c_str());
-					i++;
-				}
-				delete portal2;
-			}
-		}
-		show();
-		moveDown();
-	}
-	delete portal;
-}
-
-bool TeQtShowMedia :: eventFilter(QObject* o, QEvent* e)
-{
-//	if (e->type() == QEvent::MouseButtonDblClick)
-//		return true;
-	return QTable::eventFilter(o, e);    // standard event processing
-}
-
-void TeQtShowMedia :: slotpressed( int row, int /* col */, int button, const QPoint & mousePos )
-{
-	if(button == RightButton)
-	{
-		cmdLocal_ = true;
-		row_ = row;
-		popup_->move(mousePos.x() + x() - contentsX(), mousePos.y() + y() - contentsY());
-		popup_->exec();
-		cmdLocal_ = false;
-	}
-}
-
-void TeQtShowMedia :: slotDoubleClicked( int row, int /* col */, int button, const QPoint & /*mousePos */)
-{
-	if(button == LeftButton)
-	{
-		row_ = row;
-		slotShow();
-	}
-}
-
-//void TeQtShowMedia :: slotShow()
-//{
-//	if(row_ > 0 && nattrs_ > row_)
-//		return;
-//
-//	string name;
-//	if(row_ >= 0)
-//		name = text(row_, 1).latin1();
-//
-//    size_t  pos;
-//    char    buf[300];
-//	vector<string>	varg;
-//    string  cmd, arg, sname;
-//	string	swdir;
-//	string	mediaTable;
-//	string	type;
-//
-//// load media data to archive from database
-//	TeDatabasePortal *portal = db_->getPortal();
-//	string query = "SELECT media_table, media_name FROM " + table_;
-//	if(row_ >= 0)
-//		query += " WHERE object_id = '" + id_ + "' AND media_name = '" + name + "'";
-//	else
-//		query += " WHERE object_id = '" + id_ + "' AND show_default = 1";
-//	if(portal->query(query))
-//	{
-//		if(portal->fetchRow())
-//		{
-//			mediaTable = portal->getData(0);
-//			name = portal->getData(1);
-//		}
-//	}
-//
-//	if(mediaTable.empty())
-//	{
-//		QMessageBox::warning(this, tr("Warning"),
-//			tr("There is no media to show!\nInsert one first."));
-//		delete portal;
-//		return;
-//	}
-//
-//	query = "SELECT * FROM " + mediaTable + " WHERE media_name = '" + name + "'";
-//	portal->freeResult();
-//	if(portal->query(query))
-//		if(portal->fetchRow())
-//			type = portal->getData("media_type");
-//
-//	if(type.empty())
-//	{
-//		QMessageBox::warning(this, tr("Warning"),
-//			tr("There is no media in the table!"));
-//		delete portal;
-//		return;
-//	}
-//
-//	string tempName =  name;
-//	if(type != "url")
-//	{
-//        size_t f;
-//#ifdef WIN32
-//		char wdir[100];
-//		GetWindowsDirectory((LPTSTR)wdir, 100);
-//		swdir = wdir;
-//		f = swdir.find(":\\");
-//		if(f != string::npos)
-//			swdir = swdir.substr(0, f);
-//		swdir.append(":\\TERRAVIEW_TEMP");
-//		if( access (swdir.c_str(), 06) == -1 ) // test if directory exists
-//		{
-//			if( errno == ENOENT )  // directory does not exist so create it
-//			{
-//				if ( _mkdir(swdir.c_str()) == -1)
-//				{
-//                    QString msg = tr("The directory ");
-//                    msg += swdir.c_str();
-//                    msg += tr(" could not be created");
-//            		QMessageBox::critical(this, tr("Error"),
-//            		    tr("The directory /tmp/TERRAVIEW_TEMP could not be created!"));
-//					delete portal;
-//					return;
-//				}
-//			}
-//		}
-//		swdir.append("\\");
-//#else
-//    	swdir = "/tmp/TERRAVIEW_TEMP";
-//		if( access (swdir.c_str(), F_OK) == -1 ) // test if directory exists
-//		{
-//			if( errno == ENOENT )  // directory does not exist so create it
-//			{
-//                char buf[20];
-//                sprintf(buf, "mkdir %s", swdir.c_str());
-//				if (system(buf) != 0)
-//				{
-//            		QMessageBox::critical(this, tr("Error"),
-//            		    tr("The directory /tmp/TERRAVIEW_TEMP could not be created!"));
-//            		delete portal;
-//            		return;
-//				}
-//			}
-//		}        
-//		swdir.append("/");
-//#endif
-//		f = tempName.rfind("/");
-//		if(f == string::npos)
-//			f = tempName.rfind("\\");
-//		if(f != string::npos)
-//			tempName = tempName.substr(f+1);
-//		tempName.insert(0, swdir);
-//
-//		pos = tempName.rfind(".");
-//		if (pos == string::npos)
-//		{
-//			tempName.append(".");
-//			tempName.append(type);
-//		}
-//		unsigned char *data = 0;
-//		long size;
-////		string description;
-////		string type;
-//		if((portal->getBlob("media_blob", data, size)) == false)
-//		{
-//			delete portal;
-//			return;
-//		}
-//		FILE *fp = fopen(tempName.c_str(), "wb");
-//		if(fp == 0)
-//		{
-//			delete portal;
-//			return;
-//		}
-//		if(fwrite(data, sizeof(unsigned char), size, fp) < (unsigned long)size)
-//		{
-//			delete portal;
-//			return;
-//		}
-//		if(data)
-//			delete []data;
-//		fclose(fp);
-//
-//		pos = tempName.rfind(".");
-//		if (pos == string::npos)
-//		{
-//			delete portal;
-//			return;
-//		}
-//
-//		memset (buf, 0, 300);
-//		tempName.copy (buf, tempName.size()-pos, pos);
-//	}
-//	else
-//		strcpy(buf, ".html");
-//
-//	delete portal;
-//
-//#ifdef WIN32
-//	if (TeConvertToUpperCase (buf) == ".EXE")
-//	{
-//		_spawnl (P_NOWAIT, tempName.c_str(), tempName.c_str(), NULL);
-//		return;
-//	}
-//	// if application is user defined find current application
-//	// else use default application
-//	string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\";
-//	key += buf;
-//
-//	string keycmd = getSystemKeyValue(HKEY_CURRENT_USER, key, "Application");
-//	if(keycmd.empty() == false)
-//	{
-//		string com = keycmd;
-//		key = "Applications\\" + com + "\\SHELL\\PLAY\\COMMAND";
-//		keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
-//		if(keycmd.empty())
-//		{
-//			key = "Applications\\" + com + "\\SHELL\\OPEN\\COMMAND";
-//			keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
-//			if(keycmd.empty())
-//			{
-//				key = "Applications\\" + com + "\\SHELL\\EDIT\\COMMAND";
-//				keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
-//			}
-//		}
-//	}
-//	else
-//	{
-//		key = buf;
-//		keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
-//		if(keycmd.size() <= 1)
-//		{
-//			key += "\\SHELL\\PLAY\\COMMAND";
-//			keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
-//			if(keycmd.empty())
-//			{
-//				key = buf;
-//				key += "\\SHELL\\OPEN\\COMMAND";
-//				keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
-//				if(keycmd.empty())
-//				{
-//					key = buf;
-//					key += "\\SHELL\\EDIT\\COMMAND";
-//					keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
-//				}
-//			}
-//		}
-//		else
-//		{
-//			memset (buf, 0, 300);
-//			strcpy(buf, keycmd.c_str());
-//
-//			key = buf;
-//			key += "\\SHELL\\PLAY\\COMMAND";
-//			keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
-//			if(keycmd.empty())
-//			{
-//				key = buf;
-//				key += "\\SHELL\\OPEN\\COMMAND";
-//				keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
-//				if(keycmd.empty())
-//				{
-//					key = buf;
-//					key += "\\SHELL\\EDIT\\COMMAND";
-//					keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
-//				}
-//			}
-//		}
-//	}
-//
-//	if(keycmd.empty())
-//	{
-//		QMessageBox::warning(this, tr("Warning"),
-//			tr("The media cannot be shown!\nCheck if there is a program defined to open it."));
-//		return;
-//	}
-//
-//// get command and arguments from keycmd
-//    getCommand(keycmd, cmd, varg);
-//	if((pos = tempName.find(" ")) != string::npos)
-//		tempName = "\"" + tempName + "\"";
-//
-//	char curdir[256];
-//	_getcwd(curdir, 256);
-//	_chdir(swdir.c_str());
-//
-//	if (varg.size() == 0)
-//		_spawnl (P_NOWAIT, cmd.c_str(), tempName.c_str(), NULL);
-//	else if (varg.size() == 1)
-//        _spawnl (P_NOWAIT, cmd.c_str(), varg[0].c_str(), tempName.c_str(), NULL);
-//	else if (varg.size() == 2)
-//	{
-//		const char* p = varg[1].c_str();
-//		if(varg[1] == "%L" || varg[1] == "%1")
-//			_spawnl (P_NOWAIT, cmd.c_str(), varg[0].c_str(), tempName.c_str(), NULL);
-//		else
-//			_spawnl (P_NOWAIT, cmd.c_str(), varg[0].c_str(), p, tempName.c_str(), NULL);
-//	}
-//	else if (varg.size() == 3)
-//	{
-//		const char* p = varg[1].c_str();
-//		const char* p1 = varg[2].c_str();
-//		size_t f = varg[0].find("/prefetch:");
-//		if(f != string::npos && (varg[2] == "%L" || varg[2] == "%1"))
-//			_spawnl (P_NOWAIT, cmd.c_str(), p, tempName.c_str(), NULL);
-//		else
-//			_spawnl (P_NOWAIT, cmd.c_str(), varg[0].c_str(), p, p1, tempName.c_str(), NULL);
-//
-//
-//	}
-//
-//	_chdir(curdir);
-//#else
-//    string command;
-//    //Mount the vector of directory paths that are
-//    //stored in the PATH environment variable
-//    string path =  getenv("PATH");
-//    vector<string> dirVector;
-//    string dirPath;
-//    size_t idx = 0;
-//    size_t len = path.find(':', idx);
-//    while (len != string::npos)
-//    {
-//        dirPath = path.substr(idx, len-idx);
-//        dirVector.push_back(dirPath);
-//        idx = len+1;
-//        len = path.find(':', idx);
-//    }
-//
-//
-//    // get the last directory path
-//    idx = path.rfind(':', path.size());
-//    dirPath = path.substr(idx+1, path.size());
-//    dirVector.push_back(dirPath);
-//       
-//	string fs; 
-//    if(type != "url")
-//	{
-//        bool exists = false;
-//        for (unsigned int i = 0; i < dirVector.size(); ++i)
-//        {
-//			QString qfs = dirVector[i].c_str();
-//			qfs += "/konqueror";
-//            QFile file(qfs);
-//            if (file.exists() == true)
-//            {
-//                exists = true;
-//                break;
-//            }
-//        }
-//        if (exists == true)
-//            command = "konqueror " + tempName + " &";
-//        else
-//        {
-//			QString msg = tr("The program konqueror used to display your media is not") + "\n";
-//			msg += tr("present in your PATH environment variable or KDE is not installed!");
-//            QMessageBox::warning(this, tr("Warning"), msg);
-//            return;
-//        }      
-//    }
-//    else
-//    {
-//        unsigned int i;
-//        for (i = 0; i < dirVector.size(); ++i)
-//        {
-//			QString qfs = dirVector[i].c_str();
-//			qfs += "/netscape";
-//            QFile file(qfs);
-//            if (file.exists() == true)
-//            {
-//                command = "netscape -remote 'openURL(" + tempName + ")' &";              
-//                break;
-//            }
-//        }
-//
-//        if (command.empty() == true)
-//        {
-//            for (i = 0; i < dirVector.size(); ++i)
-//            {
-//				QString qfs = dirVector[i].c_str();
-//				qfs += "/mozilla";
-//                QFile file(qfs);
-//                if (file.exists() == true)
-//                {
-//                    command = "mozilla -remote 'openURL(" + tempName + ")' &";
-//                    break;
-//                }
-//            }
-//        }
-//         
-//        if (command.empty() == true)
-//        {
-//            for (i = 0; i < dirVector.size(); ++i)
-//            {
-//				QString qfs = dirVector[i].c_str();
-//				qfs += "/konqueror";
-//				QFile file(qfs);
-//                if (file.exists() == true)
-//                {
-//                    command = "konqueror " + tempName + " &";
-//                    break;
-//                }
-//           }
-//        }
-//        
-//        if (command.empty() == true)
-//        {
-// 			QString msg = tr("The program konqueror used to display your media is not") + "\n";
-//			msg += tr("present in your PATH environment variable or KDE is not installed!");
-//            QMessageBox::warning(this, tr("Warning"), msg);
-//             return;
-//        }
-//    }
-//    
-//    system(command.c_str());
-//#endif
-//}
-
-void TeQtShowMedia :: slotShow()
-{
-	if(row_ > 0 && nattrs_ > row_)
-		return;
-
-	string name;
-	if(row_ >= 0)
-		name = text(row_, 1).latin1();
-
-    size_t  pos;
-    char    buf[300];
-	vector<string>	varg;
-    string  cmd, arg, sname;
-	string	swdir;
-	string	mediaTable;
-	string	type;
-
-// load media data to archive from database
-	TeDatabasePortal *portal = db_->getPortal();
-	string query = "SELECT media_table, media_name FROM " + table_;
-	if(row_ >= 0)
-		query += " WHERE object_id = '" + id_ + "' AND media_name = '" + name + "'";
-	else
-		query += " WHERE object_id = '" + id_ + "' AND show_default = 1";
-	if(portal->query(query))
-	{
-		if(portal->fetchRow())
-		{
-			mediaTable = portal->getData(0);
-			name = portal->getData(1);
-		}
-	}
-
-	if(mediaTable.empty())
-	{
-		QMessageBox::warning(this, tr("Warning"),
-			tr("There is no media to show!\nInsert one first."));
-		delete portal;
-		return;
-	}
-
-	query = "SELECT * FROM " + mediaTable + " WHERE media_name = '" + name + "'";
-	portal->freeResult();
-	if(portal->query(query))
-		if(portal->fetchRow())
-			type = portal->getData("media_type");
-
-	if(type.empty())
-	{
-		QMessageBox::warning(this, tr("Warning"),
-			tr("There is no media in the table!"));
-		delete portal;
-		return;
-	}
-
-	string tempName =  name;
-	if(type != "url")
-	{
-        size_t f;
-#ifdef WIN32
-		char wdir[100];
-		GetWindowsDirectory((LPTSTR)wdir, 100);
-		swdir = wdir;
-		f = swdir.find(":\\");
-		if(f != string::npos)
-			swdir = swdir.substr(0, f);
-		swdir.append(":\\TERRAVIEW_TEMP");
-		if( access (swdir.c_str(), 06) == -1 ) // test if directory exists
-		{
-			if( errno == ENOENT )  // directory does not exist so create it
-			{
-				if ( _mkdir(swdir.c_str()) == -1)
-				{
-                    QString msg = tr("The directory ");
-                    msg += swdir.c_str();
-                    msg += tr(" could not be created");
-            		QMessageBox::critical(this, tr("Error"),
-            		    tr("The directory /tmp/TERRAVIEW_TEMP could not be created!"));
-					delete portal;
-					return;
-				}
-			}
-		}
-		swdir.append("\\");
-#else
-    	swdir = "/tmp/TERRAVIEW_TEMP";
-		if( access (swdir.c_str(), F_OK) == -1 ) // test if directory exists
-		{
-			if( errno == ENOENT )  // directory does not exist so create it
-			{
-                char buf[20];
-                sprintf(buf, "mkdir %s", swdir.c_str());
-				if (system(buf) != 0)
-				{
-            		QMessageBox::critical(this, tr("Error"),
-            		    tr("The directory /tmp/TERRAVIEW_TEMP could not be created!"));
-            		delete portal;
-            		return;
-				}
-			}
-		}        
-		swdir.append("/");
-#endif
-		f = tempName.rfind("/");
-		if(f == string::npos)
-			f = tempName.rfind("\\");
-		if(f != string::npos)
-			tempName = tempName.substr(f+1);
-		tempName.insert(0, swdir);
-
-		pos = tempName.rfind(".");
-		if (pos == string::npos)
-		{
-			tempName.append(".");
-			tempName.append(type);
-		}
-		unsigned char *data = 0;
-		long size;
-//		string description;
-//		string type;
-		if((portal->getBlob("media_blob", data, size)) == false)
-		{
-			delete portal;
-			return;
-		}
-		FILE *fp = fopen(tempName.c_str(), "wb");
-		if(fp == 0)
-		{
-			delete portal;
-			return;
-		}
-		if(fwrite(data, sizeof(unsigned char), size, fp) < (unsigned long)size)
-		{
-			delete portal;
-			return;
-		}
-		if(data)
-			delete []data;
-		fclose(fp);
-
-		pos = tempName.rfind(".");
-		if (pos == string::npos)
-		{
-			delete portal;
-			return;
-		}
-
-		memset (buf, 0, 300);
-		tempName.copy (buf, tempName.size()-pos, pos);
-	}
-	else
-		strcpy(buf, ".html");
-
-	delete portal;
-
-#ifdef WIN32
-
-	if(isVistaOperatingSystem() == false)
-	{
-		//converte ASCII to UNICODE
-		wchar_t fName[256]; // file name
-		wchar_t dName[256]; // dir name
-		size_t tt = tempName.rfind("\\");
-		if(tt == string::npos)
-			tt = tempName.rfind("/");
-		if(tt == string::npos)
-			tt = 0;
-		int i;
-		for(i=0; i<(int)tt; ++i)
-			dName[i] = tempName.c_str()[i];
-		dName[i] = '\0';
-		for(i=(int)tt+1; i<(int)tempName.length(); ++i)
-			fName[i-((int)tt+1)] = tempName.c_str()[i];
-		fName[i-((int)tt+1)] = '\0';
-
-		//HINSTANCE hhhh = ShellExecute(NULL, L"open", fName , L"/Play", dName, SW_SHOWNORMAL);
-		SHELLEXECUTEINFO shExecInfo;
-		shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
-		shExecInfo.fMask = NULL;
-		shExecInfo.hwnd = NULL;
-		shExecInfo.lpVerb = L"open";
-		shExecInfo.lpFile = fName;
-		shExecInfo.lpParameters = L"/Open";
-		shExecInfo.lpDirectory = dName;
-		shExecInfo.nShow = SW_SHOWNORMAL;
-		shExecInfo.hInstApp = NULL;
-
-		ShellExecuteEx(&shExecInfo);
-	}
-	else // windows VISTA
-	{
-		QProcess proc( this );
-		string cmdName;
-		if (TeConvertToUpperCase (buf) == ".EXE")
-		{
-			cmdName = tempName;
-			proc.addArgument(cmdName.c_str());
-			proc.start();
-			return;
-		}
-		// find user defined current application
-		string fileType = buf;
-		string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\";
-
-		key += fileType + "\\UserChoice"; // para vista dever ser essa opcao (testar)
-		string keyFile = getSystemKeyValue(HKEY_CURRENT_USER, key, "Progid"); // para vista dever ser essa opcao (testar)
-		if(keyFile.empty()) // para vista dever ser essa opcao (testar)
-			keyFile = getKeyFileFromProgId(fileType); // para vista dever ser essa opcao (testar)
-
-		keyFile += "\\shell\\open\\command";		
-		string keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, keyFile, "");
-		if(keycmd.size() <= 1)
-        {
- 			QString msg = tr("Sorry! Problem to display midia.\nPlease verify if exist default program associated with this type of midia.");
-            QMessageBox::warning(this, tr("Warning"), msg);
-             return;
-		}
-
-		getCommandToQtProcess(keycmd, cmd);
-		cmdName = cmd;
-		size_t ft;
-		ft = cmdName.find("%");
-		if(ft != string::npos)
-			cmdName.replace(ft, 2, tempName);
-		else
-			cmdName += " " + tempName;
-
-		QString qCmd(cmdName.c_str());
-		qCmd = qCmd.simplifyWhiteSpace();
-		proc.addArgument(qCmd);
-		proc.start();
-
-		//proc.clearArguments();
-		//proc.addArgument( "\"C:\\Program Files\\Adobe\\Photoshop Album Starter Edition\\3.2\\Apps\\ComponentLauncher.exe\" module=jpegviewer bg params \"filepath=c:\\TERRAVIEW_TEMP\\winter.jpg\"" );
-		////proc.addArgument( "\"C:\\Program Files\\Adobe\\Photoshop Album Starter Edition\\3.2\\Apps\\ComponentLauncher.exe\" module=jpegviewer bg params filepath=c:\\TERRAVIEW_TEMP\\winter.jpg" );
-		//proc.start();
-
-	}
-  
-#else
-    string command;
-    //Mount the vector of directory paths that are
-    //stored in the PATH environment variable
-    string path =  getenv("PATH");
-    vector<string> dirVector;
-    string dirPath;
-    size_t idx = 0;
-    size_t len = path.find(':', idx);
-    while (len != string::npos)
-    {
-        dirPath = path.substr(idx, len-idx);
-        dirVector.push_back(dirPath);
-        idx = len+1;
-        len = path.find(':', idx);
-    }
-
-
-    // get the last directory path
-    idx = path.rfind(':', path.size());
-    dirPath = path.substr(idx+1, path.size());
-    dirVector.push_back(dirPath);
-       
-	string fs; 
-    if(type != "url")
-	{
-        bool exists = false;
-        for (unsigned int i = 0; i < dirVector.size(); ++i)
-        {
-			QString qfs = dirVector[i].c_str();
-			qfs += "/konqueror";
-            QFile file(qfs);
-            if (file.exists() == true)
-            {
-                exists = true;
-                break;
-            }
-        }
-        if (exists == true)
-            command = "konqueror " + tempName + " &";
-        else
-        {
-			QString msg = tr("The program konqueror used to display your media is not") + "\n";
-			msg += tr("present in your PATH environment variable or KDE is not installed!");
-            QMessageBox::warning(this, tr("Warning"), msg);
-            return;
-        }      
-    }
-    else
-    {
-        unsigned int i;
-        for (i = 0; i < dirVector.size(); ++i)
-        {
-			QString qfs = dirVector[i].c_str();
-			qfs += "/netscape";
-            QFile file(qfs);
-            if (file.exists() == true)
-            {
-                command = "netscape -remote 'openURL(" + tempName + ")' &";              
-                break;
-            }
-        }
-
-        if (command.empty() == true)
-        {
-            for (i = 0; i < dirVector.size(); ++i)
-            {
-				QString qfs = dirVector[i].c_str();
-				qfs += "/mozilla";
-                QFile file(qfs);
-                if (file.exists() == true)
-                {
-                    command = "mozilla -remote 'openURL(" + tempName + ")' &";
-                    break;
-                }
-            }
-        }
-         
-        if (command.empty() == true)
-        {
-            for (i = 0; i < dirVector.size(); ++i)
-            {
-				QString qfs = dirVector[i].c_str();
-				qfs += "/konqueror";
-				QFile file(qfs);
-                if (file.exists() == true)
-                {
-                    command = "konqueror " + tempName + " &";
-                    break;
-                }
-           }
-        }
-        
-        if (command.empty() == true)
-        {
- 			QString msg = tr("The program konqueror used to display your media is not") + "\n";
-			msg += tr("present in your PATH environment variable or KDE is not installed!");
-            QMessageBox::warning(this, tr("Warning"), msg);
-             return;
-        }
-    }
-    
-    system(command.c_str());
-#endif
-
-}
-
-void TeQtShowMedia :: slotInsert(QString& dir)
-{
-	if(cmdLocal_ == false)
-		hide();
-	QFileDialog filed(dir, QString::null, 0, 0, true);
-	QString qfile = filed.getOpenFileName (QString::null, QString::null, 0, 0);
-
-	if(qfile.isEmpty())
-	{
-		QMessageBox::warning(this, tr("Warning"), tr("No media was selected!"));
-		show();
-		return;
-	}
-
-	string file = qfile.latin1();
-	dir = TeGetPath(file.c_str()).c_str();
-
-	string type;
-	size_t f = file.rfind(".");
-	if (f != string::npos)
-	{
-		type = file;
-		type = type.substr(f+1);
-	}
-
-	string mTable = "media_table_" + Te2String(layer_->id());
-	if(table_.empty())
-	{
-		string tname = "media_layer_" + Te2String(layer_->id());
-		if(createLayerMediaTable(db_, layer_->id(), tname) == false)
-		{
-			QMessageBox::critical(this, tr("Error"),
-				tr("Fail to create the table that will store media names!"));
-			return;
-		}
-		table_ = layer_->mediaTable();
-		if(createMediaTable(db_, mTable) == false)
-		{
-			QMessageBox::critical(this, tr("Error"),
-				tr("Fail to create the media table!"));
-			return;
-		}
-	}
-
-	int response = 1;
-
-	TeDatabasePortal *portal = db_->getPortal();
-	string sel = "SELECT media_name, object_id FROM "  + table_ + " WHERE media_table = '" + mTable + "'";
-	if(portal->query(sel))
-	{
-		while(portal->fetchRow())
-		{
-			string s = portal->getData(0);
-			if(s == file)
-			{
-				response = QMessageBox::question(this, tr("Question"),
-				tr("The media already exists! Do you wish to use it even so?"), tr("Yes"), tr("No"));
-				if(response == 1)
-				{
-					QMessageBox::warning(this, tr("Warning"),
-						tr("Rename the file and try again!"));
-					delete portal;
-					return;
-				}
-				else
-				{
-					string s = portal->getData(1);
-					if(s == id_)
-					{
-						QMessageBox::warning(this, tr("Warning"),
-							tr("There is already a media associated to this object!"));
-						delete portal;
-						return;
-					}
-				}
-				break;
-			}
-		}
-	}
-
-	if(response == 1)
-	{
-		if(insertMedia(db_, mTable, file, "", type) == false)
-		{
-			QString msg = tr("Fail to insert media:") + " ";
-			msg += db_->errorMessage().c_str();
-			QMessageBox::critical(this, tr("Error"), msg);
-			delete portal;
-			return;
-		}
-	}
-	if(insertMediaObjLayer(db_, layer_, id_, file, mTable) == false)
-	{
-		QMessageBox::critical(this, tr("Error"),
-			tr("Fail to insert the \"media_name\" field in the table!"));
-		delete portal;
-		return;
-	}
-
-	setNumRows(numRows() + 1);
-	setText(numRows()-1, 1, file.c_str());
-
-	int nmidias = 0;
-	string conta = "SELECT COUNT(*) FROM "  + table_ + " WHERE object_id = '" + id_ + "'";
-	portal->freeResult();
-	if(portal->query(conta))
-	{
-		if(portal->fetchRow())
-			nmidias = atoi(portal->getData(0));
-	}
-
-	string title = "media: ";
-
-	if(nmidias <= 1)
-	{
-		title = "*media: "; // + type;
-		string up = "UPDATE " + table_ + " SET show_default = 1 WHERE object_id = '" + id_ + "'";
-		db_->execute(up);
-	}
-	delete portal;
-	setText(numRows()-1, 0, title.c_str());
-
-	if(cmdLocal_ == false)
-		hide();
-	else
-	{
-		moveDown();
-		show();
-		raise();
-
-	}
-}
-
-void TeQtShowMedia :: moveDown()
-{
-	int x = contentsX();
-	int height = visibleHeight(); 
-	int nlins = rowAt(height);
-	int y = rowPos(numRows()-nlins);
-	setContentsPos(x, y);
-	adjustColumn(0);
-	adjustColumn(1);
-}
-
-void TeQtShowMedia :: slotRemove()
-{
-	if(nattrs_ > row_)
-		return;
-
-	int x = contentsX();
-	int y = contentsY();
-
-	vector<string> atr;
-	vector<string> val;
-	int	i;
-
-	for(i=0; i<numRows(); i++)
-	{
-		string a = text(i, 0).latin1();
-		atr.push_back(a);
-		string b = text(i, 1).latin1();
-		val.push_back(b);
-	}
-
-	string	name = val[row_];
-	vector<string>::iterator ait = atr.begin();
-	ait += row_;
-	atr.erase(ait, ait+1);
-	vector<string>::iterator vit = val.begin();
-	vit += row_;
-	val.erase(vit, vit+1);
-
-	setNumRows(0);
-	string mTable = "media_table_" + Te2String(layer_->id());
-	string remover = "DELETE FROM " + table_ + " WHERE object_id = '" + id_ + "'";
-	remover += " AND media_name = '" + name + "'" + " AND media_table = '" + mTable + "'";
-	db_->execute(remover);
-
-	bool aindaUsa = false;
-	TeDatabasePortal* portal = db_->getPortal();
-	string sel = "SELECT * FROM " + table_ + " WHERE media_name = '" + name + "'";
-	sel += " AND media_table = '" +  mTable + "'";
-	if(portal->query(sel))
-		if(portal->fetchRow())
-			aindaUsa = true;
-
-	if(aindaUsa == false)
-	{
-		string remover = "DELETE FROM " + mTable + " WHERE media_name = '" + name + "'";
-		db_->execute(remover);
-	}
-
-	string defname;
-	bool defshow = false;
-	sel = "SELECT media_name, show_default FROM " + table_ + " WHERE object_id = '" + id_ + "'";
-	portal->freeResult();
-	if(portal->query(sel))
-	{
-		while(portal->fetchRow())
-		{
-			defname = portal->getData(0);
-			defshow = atoi(portal->getData(1));
-			if(defshow)
-				break;
-		}
-	}
-	delete portal;
-
-	if(defshow ==  false && defname.empty() == false)
-	{
-		string up = "UPDATE " + table_ + " SET show_default = 1 WHERE media_name = '" + defname + "'";
-		db_->execute(up);
-	}
-
-	setNumRows(atr.size());
-
-	unsigned int k;
-	for(k=0; k<atr.size(); k++)
-	{
-		if(defshow ==  false && defname.empty() == false)
-		{
-			if(val[k] == defname)
-				atr[k].insert(0, "*");
-		}
-		setText(k, 0, atr[k].c_str());
-		setText(k, 1, val[k].c_str());
-	}
-	setContentsPos(x, y);
-	raise();
-}
-
-void TeQtShowMedia :: slotInsertURL()
-{
-	if(cmdLocal_ == false)
-		hide();
-
-	urlWindow_ = new URLWindow(this, "urlInsertion", true);
-	if (urlWindow_->exec() == QDialog::Rejected)
-	{
-		delete urlWindow_;
-		return;
-	}
-	QString qsite = urlWindow_->URLLineEdit->text();
-	delete urlWindow_;
-	if(qsite.isNull() || qsite.isEmpty())
-		return;
-
-	string site = qsite.latin1();
-	string type = "url";
-
-
-	string mTable = "media_table_" + Te2String(layer_->id());
-	if(table_.empty())
-	{
-		string tname = "media_layer_" + Te2String(layer_->id());
-		if(createLayerMediaTable(db_, layer_->id(), tname) == false)
-		{
-			QMessageBox::critical(this,tr("Error"),
-				tr("Fail to create the table to store media names!"));
-			return;
-		}
-		if(createMediaTable(db_, mTable) == false)
-		{
-			QMessageBox::critical(this, tr("Error"), tr("Fail to create the media tables!"));
-			return;
-		}
-	}
-
-
-	bool jatem = false;
-
-	TeDatabasePortal *portal = db_->getPortal();
-	string sel = "SELECT media_name, object_id FROM "  + table_ + " WHERE media_table = '" + mTable + "'";
-	if(portal->query(sel))
-	{
-		while(portal->fetchRow())
-		{
-			string s = portal->getData(0);
-			if(s == site)
-			{
-				jatem = true;
-				string ss = portal->getData(1);
-				if(ss == id_)
-				{
-					QMessageBox::warning(this, tr("Warning"),
-						tr("This URL is already associated to this object!"));
-					delete portal;
-					return;
-				}
-				break;
-			}
-		}
-	}
-
-	if(jatem == false)
-	{
-		if(insertMedia(db_, mTable, site, "", type, false) == false)
-		{
-			QMessageBox::critical(this, tr("Error"),
-				tr("Fail to insert the \"media_blob\" field in the table!"));
-			delete portal;
-			return;
-		}
-	}
-	if(insertMediaObjLayer(db_, layer_, id_, site, mTable) == false)
-	{
-		QMessageBox::critical(this, tr("Error"),
-			tr("Fail to insert the \"media_name\" field in the table!"));
-		delete portal;
-		return;
-	}
-
-	setNumRows(numRows() + 1);
-	setText(numRows()-1, 1, site.c_str());
-
-	int nmidias = 0;
-	string conta = "SELECT COUNT(*) FROM "  + table_ + " WHERE object_id = '" + id_ + "'";
-	portal->freeResult();
-	if(portal->query(conta))
-	{
-		if(portal->fetchRow())
-			nmidias = atoi(portal->getData(0));
-	}
-
-	string title;
-
-	if(nmidias <= 1)
-	{
-		title = "*media: "; // + type;
-		string up = "UPDATE " + table_ + " SET show_default = 1 WHERE object_id = '" + id_ + "'";
-		db_->execute(up);
-	}
-
-	delete portal;
-	setText(numRows()-1, 0, title.c_str());
-
-	if(cmdLocal_ == false)
-		hide();
-	else
-	{
-		moveDown();
-		show();
-		raise();
-	}
-}
-
-void TeQtShowMedia :: slotSetDefault()
-{
-	if(nattrs_ > row_)
-		return;
-
-	string media_name = text(row_, 1).latin1();
-	string mTable = "media_table_" + Te2String(layer_->id());
-	setDefaultMedia(db_, layer_, id_, media_name, mTable);
-
-	string type = text(row_, 0).latin1();
-//	int f = type.find("*", string::npos);
-	size_t f = type.find("*");
-	if(f != string::npos)
-		return;
-	else
-	{
-		int i;
-		for(i = nattrs_; i<numRows(); i++)
-		{
-			string s = text(i, 0).latin1();
-			f = s.find("*", 0);
-			if(f != string::npos)
-			{
-
-				setText(i, 0, "media:");
-				break;
-			}
-		}
-		setText(row_, 0, "*media:");
-	}
-
-	if(cmdLocal_ == false)
-		hide();
-	else
-		raise();
-}
-
-void TeQtShowMedia :: slotDescription()
-{
-	if(row_ > 0 && nattrs_ > row_)
-		return;
-
-	string mTable = "media_table_" + Te2String(layer_->id());
-	TeDatabasePortal *ptal = db_->getPortal();
-	string name;
-
-	if(row_ < 0)
-	{
-		if(table_.empty() == false)
-		{
-			string s = "SELECT media_name FROM " + table_ + " WHERE object_id = '" + id_ + "'";
-			s += " AND show_default = 1";
-			if(ptal->query(s))
-			{
-				if(ptal->fetchRow())
-					name = ptal->getData(0);
-			}
-		}
-	}
-	else
-		name = text(row_, 1).latin1();
-
-	string q = "SELECT * FROM " + mTable + " WHERE media_name = '" + name + "'";
-
-	string description = "";
-	ptal->freeResult();
-
-	if(db_->tableExist(mTable))
-	{
-		if(ptal->query(q))
-		{
-			if(ptal->fetchRow())
-				description = ptal->getData("description");
-		}
-	}
-	delete ptal;
-	descriptionWindow_ = new MediaDescription(this, "mediaDescription", true);
-	QString qdesc;
-	qdesc.setLatin1(description.c_str(), description.size());
-	descriptionWindow_->descriptionTextEdit->setText(qdesc);
-	descriptionWindow_->exec();
-
-	QString qtext = descriptionWindow_->descriptionTextEdit->text();
-	if(qtext.isEmpty() || qtext.isNull())
-		description.clear();
-	else
-		description = qtext.latin1();
-	if(description.size() > 255)
-	{
-		QMessageBox::warning(this, tr("Warning"),
-			tr("The description is longer than 255 caracteres!\nIt will be truncated."));
-		description = description.substr(0, 255);
-	}
-	if(description.empty() == false)
-		updateMediaDescription(db_, name, mTable, description);
-
-	delete descriptionWindow_;
-
-	if(cmdLocal_ == false)
-		hide();
-	else
-		raise();
-}
-
-#ifdef WIN32
-void TeQtShowMedia :: getCommand(string keycom, string& cmd, vector<string>& varg)
-{
-    string  s = keycom;
-    string  ss = keycom;
-    string  S = TeConvertToUpperCase(keycom);
-    unsigned int i;
-    size_t  pos, n;
-	string	arg;
-	bool	isDll = false;
-
-	varg.clear();
-    cmd.clear();
-    arg.clear();
-
-// find command
-	if((pos=s.find(".")) != string::npos)
-	{
-		if((n=s.find(" ", pos)) != string::npos)
-		{
-			s = s.substr(0, n);
-			S = S.substr(0, n);
-			ss = ss.substr(n);
-		}
-	}
-
-// remove ""
-	while((pos=s.find("\"")) != string::npos)
-	{
-		string cs = s, CS = S;
-		s = cs.substr(0, pos) + cs.substr(pos+1);
-		S = CS.substr(0, pos) + CS.substr(pos+1);
-	}
-// replace %SystemRoot%
-	if((pos=S.find("%SYSTEMROOT%")) != string::npos)
-	{
-		int len = strlen("%SystemRoot%");
-		string systemRoot = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot");
-		s.replace(pos, len, systemRoot);
-		S.replace(pos, len, systemRoot);
-	}
-
-// replace %ProgramFiles%
-	if((pos=S.find("%PROGRAMFILES%")) != string::npos)
-	{
-		int len = strlen("%ProgramFiles%");
-		string programFiles = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir");
-		s.replace(pos, len, programFiles);
-		S.replace(pos, len, programFiles);
-	}
-
-// replace %CommonProgramFiles%
-	if((pos=S.find("%COMMOMFILES%")) != string::npos)
-	{
-		int len = strlen("%CommonFiles%");
-		string commonFiles = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "CommonFilesDir");
-		s.replace(pos, len, commonFiles);
-		S.replace(pos, len, commonFiles);
-	}
-
-// rundll32.exe
-	if((pos=S.find("RUNDLL32")) == 0)
-	{
-		string dllDirectory = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"System\\ControlSet001\\Control\\Session Manager\\KnownDLLs", "DllDirectory");
-		string  DIR = TeConvertToUpperCase(dllDirectory);
-		if((pos=DIR.find("%SYSTEMROOT%")) != string::npos)
-		{
-
-			int len = strlen("%SystemRoot%");
-			string systemRoot = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot");
-			dllDirectory.replace(pos, len, systemRoot);
-		}
-		cmd = dllDirectory + "\\rundll32.exe";
-		isDll = true;
-	}
-	else
-		cmd = s;
-
-	string command = TeConvertToUpperCase(cmd);
-	bool percentOut = false;
-	if((pos=command.find("MSACCESS.EXE")) != string::npos)
-
-		percentOut = true;
-	if((pos=command.find("POWERPNT.EXE")) != string::npos)
-		percentOut = true;
-
-	s = ss; // arguments
-	if(isDll)
-	{
-		varg.push_back("rundll32.exe");
-		S = TeConvertToUpperCase(s);
-		if((pos=S.find("%SYSTEMROOT%")) != string::npos)
-		{
-			int len = strlen("%SystemRoot%");
-			string systemRoot = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot");
-			s.replace(pos, len, systemRoot);
-		}
-		if(s[0] == ' ')
-			s = s.substr(1);
-
-		for(i=0; i<s.size(); i++)
-			if(s[i] == '/' || s[i] == '-' || s[i]=='%')
-				break;
-		string arg = s;
-		arg = arg.substr(0, i-1);
-		varg.push_back(arg);
-		s = s.substr(i-1);
-	}
-
-// if runddl32 the option has "/" or "-" and termineted with " " 
-// else the option has "/", "-" or "%" and termineted with " "
-	if(s.find("=") == string::npos)
-	{
-		for(i=0; i<s.size(); i++)
-		{
-			if(isDll || percentOut)
-			{
-				if(s[i] == '/' || s[i] == '-')
-				{
-					if((pos=s.find(" ", i)) != string::npos)
-					{
-						string arg = s;
-
-						arg = arg.substr(0, pos);
-						arg = arg.substr(i, s.size() - i);
-						// remove ""
-						while((n=arg.find("\"")) != string::npos)
-						{
-							string carg = arg;
-							arg = carg.substr(0, n) + carg.substr(n+1);
-						}
-
-						varg.push_back(arg);
-						i = pos;
-					}
-					else
-					{
-						string arg = s;
-						arg = arg.substr(i);
-						// remove ""
-						while((n=arg.find("\"")) != string::npos)
-						{
-							string carg = arg;
-							arg = carg.substr(0, n) + carg.substr(n+1);
-						}
-
-						varg.push_back(arg);
-						break;
-					}
-				}
-			}
-			else
-			{
-				if(s[i] == '/' || s[i] == '-' || s[i] == '%')
-				{
-					if((pos=s.find(" ", i)) != string::npos)
-					{
-						string arg = s;
-						arg = arg.substr(0, pos);
-						arg = arg.substr(i);
-						// remove ""
-						while((n=arg.find("\"")) != string::npos)
-						{
-							string carg = arg;
-							arg = carg.substr(0, n) + carg.substr(n+1);
-						}
-
-						varg.push_back(arg);
-						i = pos;
-					}
-					else
-					{
-						string arg = s;
-						arg = arg.substr(i);
-						// remove ""
-						while((n=arg.find("\"")) != string::npos)
-						{
-							string carg = arg;
-							arg = carg.substr(0, n) + carg.substr(n+1);
-						}
-
-						varg.push_back(arg);
-						break;
-					}
-				}
-			}
-		}
-	}
-	else
-	{
-		int p = s.find("%1");
-		if(p != string::npos)
-		{
-		}
-	}
-}
-
-void TeQtShowMedia :: getCommandToQtProcess(string keycom, string& cmd)
-{
-    string  s = keycom;
-    string  S = TeConvertToUpperCase(keycom);
-    int		len;
-    size_t  pos;
-
-    cmd.clear();
-
-// replace %SystemRoot%
-	if((pos=S.find("%SYSTEMROOT%")) != string::npos)
-	{
-		len = strlen("%SystemRoot%");
-		string systemRoot = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot");
-		s.replace(pos, len, systemRoot);
-		S.replace(pos, len, systemRoot);
-	}
-
-// replace %ProgramFiles%
-	if((pos=S.find("%PROGRAMFILES%")) != string::npos)
-	{
-		len = strlen("%ProgramFiles%");
-		string programFiles = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir");
-		s.replace(pos, len, programFiles);
-		S.replace(pos, len, programFiles);
-	}
-
-// replace %CommonProgramFiles%
-	if((pos=S.find("%COMMOMFILES%")) != string::npos)
-	{
-		len = strlen("%CommonFiles%");
-		string commonFiles = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "CommonFilesDir");
-		s.replace(pos, len, commonFiles);
-		S.replace(pos, len, commonFiles);
-	}
-
-// rundll32.exe
-	if((pos=S.find("RUNDLL32")) == 0) // se for no inicio
-	{
-		string dllDirectory = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"System\\ControlSet001\\Control\\Session Manager\\KnownDLLs", "DllDirectory");
-		string  DIR = TeConvertToUpperCase(dllDirectory);
-		if((pos=DIR.find("%SYSTEMROOT%")) != string::npos)
-		{
-			len = strlen("%SystemRoot%");
-			string systemRoot = getSystemKeyValue(HKEY_LOCAL_MACHINE,
-			"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot");
-			dllDirectory.replace(pos, len, systemRoot);
-		}
-		cmd = dllDirectory + "\\rundll32.exe";
-		len = strlen("RUNDLL32.EXE");
-		s.replace(0, len, cmd);
-	}
-	cmd = s;
-}
-
-string TeQtShowMedia :: getString(TCHAR* u, DWORD size)
-{
-	int	i;
-	char buf[512];
-
-	for(i = 0; i < (int)size; ++i)
-		buf[i] = u[i];
-	buf[i] = '\0';
-
-	string ret = buf;
-	return ret;
-}
-
-void TeQtShowMedia :: charToUnicode(const char* c, TCHAR* u)
-{
-	int i;
-	int len = strlen(c);
-	for(i=0; i < len; ++i)
-		u[i] = c[i];
-	u[i] = '\0';
-}
-
-string TeQtShowMedia :: QueryKey(HKEY hKey) 
-{ 
-	string ret;
-
-    TCHAR    achKey[512];   // buffer for subkey name
-    DWORD    cbName;                   // size of name string 
-    TCHAR    achClass[512] = TEXT("");  // buffer for class name 
-    DWORD    cchClassName = 512;  // size of class string 
-    DWORD    cSubKeys=0;               // number of subkeys 
-    DWORD    cbMaxSubKey;              // longest subkey size 
-    DWORD    cchMaxClass;              // longest class string 
-    DWORD    cValues;              // number of values for key 
-    DWORD    cchMaxValue;          // longest value name 
-    DWORD    cbMaxValueData;       // longest value data 
-    DWORD    cbSecurityDescriptor; // size of security descriptor 
-    FILETIME ftLastWriteTime;      // last write time 
- 
-    DWORD i, retCode; 
- 
-    TCHAR  achValue[512]; 
-    DWORD cchValue = 512; 
- 
-    // Get the class name and the value count. 
-    retCode = RegQueryInfoKey(
-        hKey,                    // key handle 
-        achClass,                // buffer for class name 
-        &cchClassName,           // size of class string 
-        NULL,                    // reserved 
-        &cSubKeys,               // number of subkeys 
-        &cbMaxSubKey,            // longest subkey size 
-        &cchMaxClass,            // longest class string 
-        &cValues,                // number of values for this key 
-        &cchMaxValue,            // longest value name 
-        &cbMaxValueData,         // longest value data 
-        &cbSecurityDescriptor,   // security descriptor 
-        &ftLastWriteTime);       // last write time 
- 
-    // Enumerate the subkeys, until RegEnumKeyEx fails.
-    
-    if (cSubKeys)
-    {
-		for (i=0; i<cSubKeys; i++) 
-		{ 
-			cbName = 512;
-			retCode = RegEnumKeyEx(hKey, i, achKey, &cbName, NULL, NULL, NULL, &ftLastWriteTime); 
-			if (retCode != ERROR_SUCCESS) 
-				return ret;
-		}
-    } 
- 
-    // Enumerate the key values. 
-    if (cValues) 
-    {
-        cchValue = 512; 
-        achValue[0] = '\0'; 
-        retCode = RegEnumValue(hKey, cValues-1, achValue, &cchValue, NULL, NULL, NULL, NULL);
-
-        if (retCode == ERROR_SUCCESS ) 
-			ret = getString(achValue, cchValue);
-    }
-	return ret; 
-}
-
-string TeQtShowMedia :: getKeyFileFromProgId(string& fileType)
-{
-	string ret;
-	DWORD retCode;
-	TCHAR tkey[512];
-	string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\" + fileType + "\\OpenWithProgids";
-	charToUnicode(key.c_str(), tkey);
-
-	HKEY hTestKey;
-
-	retCode = RegOpenKeyEx(HKEY_CURRENT_USER, tkey, 0, KEY_READ, &hTestKey);
-	if(retCode == ERROR_SUCCESS)
-		ret = QueryKey(hTestKey);
-	RegCloseKey(hTestKey);
-	return ret;
-}
-
-string TeQtShowMedia :: getSystemKeyValue(HKEY hkey, string key, string value)
-{
-	HKEY    hk;
-	DWORD	DataSize = 1024;
-    DWORD   Type = REG_SZ;
-    char    buf[1024];
-    string  keycmd;
-
-    if (RegOpenKeyExA(hkey, key.c_str(), 0, KEY_READ, &hk) == ERROR_SUCCESS)
-	{
-		memset (buf, 0, 1024);
-		if (RegQueryValueExA(hk, value.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
-
-			keycmd = buf;
-	}
-	if(hk)
-		RegCloseKey (hk);
-	return keycmd;
-}
-
-bool TeQtShowMedia :: isVistaOperatingSystem()
-{
-   OSVERSIONINFO osvi;
-
-   ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
-   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-
-   GetVersionEx(&osvi);
-   if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
-	   return true;
-
-	return false;
-}
-
-#endif
-
-void TeQtShowMedia :: slotShowFile(string file)
-{
-    size_t			pos;
-    string			cmd;
-
-	string tempName = file;
-
-	string type;
-	pos = file.rfind(".");
-	if (pos != string::npos)
-	{
-		type = file;
-		type = type.substr(pos);
-		type = TeConvertToUpperCase(type);
-	}
-
-#ifdef WIN32
-
-	if(type != ".URL")
-	{
-		pos = tempName.find("/");
-		while(pos != string::npos)
-		{
-			tempName.replace(pos, 1, "\\");
-			pos = tempName.find("/");
-		}
-	}
-	else
-	{
-		tempName = tempName.substr(0, tempName.size()-4);
-		type = ".HTM";
-	}
-
-	if(isVistaOperatingSystem() == false)
-	{
-		//converte ASCII to UNICODE
-		wchar_t fName[256]; // file name
-		wchar_t dName[256]; // dir name
-		size_t tt = tempName.rfind("\\");
-		if(tt == string::npos)
-			tt = tempName.rfind("/");
-		if(tt == string::npos)
-			tt = 0;
-		int i;
-		for(i=0; i<(int)tt; ++i)
-			dName[i] = tempName.c_str()[i];
-		dName[i] = '\0';
-		for(i=(int)tt+1; i<(int)tempName.length(); ++i)
-			fName[i-((int)tt+1)] = tempName.c_str()[i];
-		fName[i-((int)tt+1)] = '\0';
-
-		//HINSTANCE hhhh = ShellExecute(NULL, L"open", fName , L"/Play", dName, SW_SHOWNORMAL);
-		SHELLEXECUTEINFO shExecInfo;
-		shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
-		shExecInfo.fMask = NULL;
-		shExecInfo.hwnd = NULL;
-		shExecInfo.lpVerb = L"open";
-		shExecInfo.lpFile = fName;
-		shExecInfo.lpParameters = L"/Open";
-		shExecInfo.lpDirectory = dName;
-		shExecInfo.nShow = SW_SHOWNORMAL;
-		shExecInfo.hInstApp = NULL;
-
-		ShellExecuteEx(&shExecInfo);
-	}
-	else // windows VISTA
-	{
-		QProcess proc( this );
-		string cmdName;
-		if (TeConvertToUpperCase (type) == ".EXE")
-		{
-			cmdName = tempName;
-			proc.addArgument(cmdName.c_str());
-			proc.start();
-			return;
-		}
-		// find user defined current application
-		string fileType = type;
-		string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\";
-
-		key += fileType + "\\UserChoice"; // para vista dever ser essa opcao (testar)
-		string keyFile = getSystemKeyValue(HKEY_CURRENT_USER, key, "Progid"); // para vista dever ser essa opcao (testar)
-		if(keyFile.empty()) // para vista dever ser essa opcao (testar)
-			keyFile = getKeyFileFromProgId(fileType); // para vista dever ser essa opcao (testar)
-
-		keyFile += "\\shell\\open\\command";		
-		string keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, keyFile, "");
-		if(keycmd.size() <= 1)
-        {
- 			QString msg = tr("Sorry! Problem to display midia.\nPlease verify if exist default program associated with this type of midia.");
-            QMessageBox::warning(this, tr("Warning"), msg);
-             return;
-		}
-
-		getCommandToQtProcess(keycmd, cmd);
-		cmdName = cmd;
-		size_t ft;
-		ft = cmdName.find("%");
-		if(ft != string::npos)
-			cmdName.replace(ft, 2, tempName);
-		else
-			cmdName += " " + tempName;
-
-		QString qCmd(cmdName.c_str());
-		qCmd = qCmd.simplifyWhiteSpace();
-		proc.addArgument(qCmd);
-		proc.start();
-
-		//proc.clearArguments();
-		//proc.addArgument( "\"C:\\Program Files\\Adobe\\Photoshop Album Starter Edition\\3.2\\Apps\\ComponentLauncher.exe\" module=jpegviewer bg params \"filepath=c:\\TERRAVIEW_TEMP\\winter.jpg\"" );
-		////proc.addArgument( "\"C:\\Program Files\\Adobe\\Photoshop Album Starter Edition\\3.2\\Apps\\ComponentLauncher.exe\" module=jpegviewer bg params filepath=c:\\TERRAVIEW_TEMP\\winter.jpg" );
-		//proc.start();
-
-	}
-
-#else
-    string command;
-    string name = file;
-    //Mount the vector of directory paths that are
-    //stored in the PATH environment variable
-    string path =  getenv("PATH");
-    vector<string> dirVector;
-    string dirPath;
-    size_t idx = 0;
-    size_t len = path.find(':', idx);
-    while (len != string::npos)
-    {
-        dirPath = path.substr(idx, len-idx);
-        dirVector.push_back(dirPath);
-        idx = len+1;
-        len = path.find(':', idx);
-    }
-
-
-    // get the last directory path
-    idx = path.rfind(':', path.size());
-    dirPath = path.substr(idx+1, path.size());
-    dirVector.push_back(dirPath);
-       
-	string fs; 
-    if(type != ".URL")
-	{
-        bool exists = false;
-        for (unsigned int i = 0; i < dirVector.size(); ++i)
-        {
-			fs = dirVector[i] + "/konqueror";
-            QFile file(fs.c_str());
-            if (file.exists() == true)
-            {
-                exists = true;
-                break;
-            }
-        }
-        if (exists == true)
-            command = "konqueror " + name + " &";
-        else
-        {
-			QString msg = tr("The program konqueror used to display your media is not") + "\n";
-			msg += tr("present in your PATH environment variable or KDE is not installed!");
-            QMessageBox::warning(this, tr("Warning"), msg);
-             return;
-        }      
-    }
-    else
-    {
-		tempName = tempName.substr(0, tempName.size()-4);
-		name = tempName;
-
-        unsigned int i;
-        for (i = 0; i < dirVector.size(); ++i)
-        {
-			QString qfs = dirVector[i].c_str();
-			qfs += "/netscape";
-            QFile file(qfs);
-            if (file.exists() == true)
-            {
-                command = "netscape -remote 'openURL(" + name + ")' &";              
-                break;
-            }
-        }
-
-        if (command.empty() == true)
-        {
-            for (i = 0; i < dirVector.size(); ++i)
-            {
-				QString qfs = dirVector[i].c_str();
-				qfs += "/mozilla";
-                QFile file(qfs);
-                if (file.exists() == true)
-                {
-                    command = "mozilla -remote 'openURL(" + name + ")' &";
-                    break;
-                }
-            }
-        }
-         
-        if (command.empty() == true)
-        {
-            for (i = 0; i < dirVector.size(); ++i)
-            {
-				QString qfs = dirVector[i].c_str();
-				qfs += "/konqueror";
-				QFile file(qfs);
-                if (file.exists() == true)
-                {
-                    command = "konqueror " + name + " &";
-                    break;
-                }
-           }
-        }
-        
-        if (command.empty() == true)
-        {
-			QString msg = tr("The program konqueror used to display your media is not") + "\n";
-			msg += tr("present in your PATH environment variable or KDE is not installed!");
-            QMessageBox::warning(this, tr("Warning"), msg);
-             return;
-        }
-    }
-    
-    system(command.c_str());
-#endif
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeQtShowMedia.h>
+#include <TeAttribute.h>
+#include <qfiledialog.h> 
+#include <qlineedit.h> 
+#include <qstring.h> 
+#include <qtextedit.h> 
+#include <qmessagebox.h>
+#include <qfile.h>
+#include <errno.h>
+#include <qprocess.h>
+#include <qapplication.h>
+
+#ifdef WIN32
+#include <windows.h>
+#include <process.h>
+#include <io.h>
+#include <direct.h>
+#else
+#include <unistd.h>
+#endif
+
+
+TeQtShowMedia :: TeQtShowMedia(QWidget* parent, const char* name)
+	: QTable(2, 2, parent, name)
+{
+	layer_ = 0;
+	db_ = 0;
+	cmdLocal_ = false;
+	row_ = -1;
+	popup_ = new QPopupMenu(this);
+	popup_->insertItem(tr("Show Media..."), this, SLOT(slotShow()));
+	popup_->insertItem(tr("Insert Media..."), this, SLOT(slotInsert(QString&)));
+	popup_->insertItem(tr("Insert URL..."), this, SLOT(slotInsertURL()));
+	popup_->insertItem(tr("Remove..."), this, SLOT(slotRemove()));
+	popup_->insertItem(tr("Set the Default Media"), this, SLOT(slotSetDefault()));
+	popup_->insertItem(tr("Description..."), this, SLOT(slotDescription()));
+
+	connect(this, SIGNAL(pressed(int, int, int, const QPoint&)),
+		 this, SLOT(slotpressed(int, int, int, const QPoint&)));
+
+	connect(this, SIGNAL(doubleClicked(int, int, int, const QPoint&)),
+		 this, SLOT(slotDoubleClicked(int, int, int, const QPoint&)));
+}
+
+TeQtShowMedia :: ~TeQtShowMedia()
+{
+}
+
+void TeQtShowMedia :: init(string objId, TeAppTheme* theme, TeQtGrid* grid)
+{
+	setNumRows(0);
+	id_ = objId;
+	nattrs_ = grid->numCols();
+	layer_ = ((TeTheme*)theme->getTheme())->layer();
+	table_ = layer_->mediaTable();
+	db_ = layer_->database();
+	TeDatabasePortal* portal = db_->getPortal();
+	row_ = -1;
+	
+	TeAttributeList	colAttrList;
+	db_->getAttributeList(((TeTheme*)theme->getTheme())->collectionTable(), colAttrList);
+
+	horizontalHeader()->setLabel(0, tr("Attribute"));
+	horizontalHeader()->setLabel(1, tr("Value"));
+
+	int	i, nMidias = 0;
+	if(table_.empty() == false)
+	{
+		string q = "SELECT COUNT(*) FROM " + table_;
+		q += " WHERE object_id = '" + id_ + "'";
+		if(portal->query(q))
+		{
+			if(portal->fetchRow())
+				nMidias = atoi(portal->getData(0));
+		}
+	}
+
+	string sel = ((TeTheme*)theme->getTheme())->sqlJoin() + " WHERE c_object_id = '" + id_ + "'";
+
+	portal->freeResult();
+	if(portal->query(sel))
+	{
+		int ncol = portal->getAttributeList().size() - colAttrList.size() + nMidias;
+
+		setNumRows(ncol);
+
+		if(portal->fetchRow())
+		{
+			for(i=0; i<grid->numCols(); i++)
+			{
+				string fname = portal->getAttribute(i).rep_.name_;
+				string data = portal->getData(i);
+				setText(i, 0, fname.c_str());
+				setText(i, 1, data.c_str());
+			}
+		}
+
+		if(table_.empty() == false)
+		{
+			string q = "SELECT media_name, media_table, show_default FROM " + table_;
+			q += " WHERE object_id = '" + id_ + "'";
+			portal->freeResult();
+			if(portal->query(q))
+			{
+				TeDatabasePortal* portal2 = db_->getPortal();
+				while(portal->fetchRow())
+				{
+					string type;
+					string mediaName = portal->getData(0);
+					string mediaTable = portal->getData(1);
+					bool showDefault = atoi(portal->getData(2));
+
+					string q = "SELECT media_type FROM " + mediaTable;
+					q += " WHERE media_name = '" + mediaName + "'";
+					portal2->freeResult();
+					if(portal2->query(q))
+					{
+						if(portal2->fetchRow())
+							type = portal2->getData(0);
+					}
+
+					string ss;
+					if(showDefault)
+						ss = "*media: "; // + type;
+					else
+						ss = "media: "; // + type;
+
+					setText(i, 0, ss.c_str());
+					setText(i, 1, mediaName.c_str());
+					i++;
+				}
+				delete portal2;
+			}
+		}
+		show();
+		moveDown();
+	}
+	delete portal;
+}
+
+bool TeQtShowMedia :: eventFilter(QObject* o, QEvent* e)
+{
+//	if (e->type() == QEvent::MouseButtonDblClick)
+//		return true;
+	return QTable::eventFilter(o, e);    // standard event processing
+}
+
+void TeQtShowMedia :: slotpressed( int row, int /* col */, int button, const QPoint & mousePos )
+{
+	if(button == RightButton)
+	{
+		cmdLocal_ = true;
+		row_ = row;
+		popup_->move(mousePos.x() + x() - contentsX(), mousePos.y() + y() - contentsY());
+		popup_->exec();
+		cmdLocal_ = false;
+	}
+}
+
+void TeQtShowMedia :: slotDoubleClicked( int row, int /* col */, int button, const QPoint & /*mousePos */)
+{
+	if(button == LeftButton)
+	{
+		row_ = row;
+		slotShow();
+	}
+}
+
+//void TeQtShowMedia :: slotShow()
+//{
+//	if(row_ > 0 && nattrs_ > row_)
+//		return;
+//
+//	string name;
+//	if(row_ >= 0)
+//		name = text(row_, 1).latin1();
+//
+//    size_t  pos;
+//    char    buf[300];
+//	vector<string>	varg;
+//    string  cmd, arg, sname;
+//	string	swdir;
+//	string	mediaTable;
+//	string	type;
+//
+//// load media data to archive from database
+//	TeDatabasePortal *portal = db_->getPortal();
+//	string query = "SELECT media_table, media_name FROM " + table_;
+//	if(row_ >= 0)
+//		query += " WHERE object_id = '" + id_ + "' AND media_name = '" + name + "'";
+//	else
+//		query += " WHERE object_id = '" + id_ + "' AND show_default = 1";
+//	if(portal->query(query))
+//	{
+//		if(portal->fetchRow())
+//		{
+//			mediaTable = portal->getData(0);
+//			name = portal->getData(1);
+//		}
+//	}
+//
+//	if(mediaTable.empty())
+//	{
+//		QMessageBox::warning(this, tr("Warning"),
+//			tr("There is no media to show!\nInsert one first."));
+//		delete portal;
+//		return;
+//	}
+//
+//	query = "SELECT * FROM " + mediaTable + " WHERE media_name = '" + name + "'";
+//	portal->freeResult();
+//	if(portal->query(query))
+//		if(portal->fetchRow())
+//			type = portal->getData("media_type");
+//
+//	if(type.empty())
+//	{
+//		QMessageBox::warning(this, tr("Warning"),
+//			tr("There is no media in the table!"));
+//		delete portal;
+//		return;
+//	}
+//
+//	string tempName =  name;
+//	if(type != "url")
+//	{
+//        size_t f;
+//#ifdef WIN32
+//		char wdir[100];
+//		GetWindowsDirectory((LPTSTR)wdir, 100);
+//		swdir = wdir;
+//		f = swdir.find(":\\");
+//		if(f != string::npos)
+//			swdir = swdir.substr(0, f);
+//		swdir.append(":\\TERRAVIEW_TEMP");
+//		if( access (swdir.c_str(), 06) == -1 ) // test if directory exists
+//		{
+//			if( errno == ENOENT )  // directory does not exist so create it
+//			{
+//				if ( _mkdir(swdir.c_str()) == -1)
+//				{
+//                    QString msg = tr("The directory ");
+//                    msg += swdir.c_str();
+//                    msg += tr(" could not be created");
+//            		QMessageBox::critical(this, tr("Error"),
+//            		    tr("The directory /tmp/TERRAVIEW_TEMP could not be created!"));
+//					delete portal;
+//					return;
+//				}
+//			}
+//		}
+//		swdir.append("\\");
+//#else
+//    	swdir = "/tmp/TERRAVIEW_TEMP";
+//		if( access (swdir.c_str(), F_OK) == -1 ) // test if directory exists
+//		{
+//			if( errno == ENOENT )  // directory does not exist so create it
+//			{
+//                char buf[20];
+//                sprintf(buf, "mkdir %s", swdir.c_str());
+//				if (system(buf) != 0)
+//				{
+//            		QMessageBox::critical(this, tr("Error"),
+//            		    tr("The directory /tmp/TERRAVIEW_TEMP could not be created!"));
+//            		delete portal;
+//            		return;
+//				}
+//			}
+//		}        
+//		swdir.append("/");
+//#endif
+//		f = tempName.rfind("/");
+//		if(f == string::npos)
+//			f = tempName.rfind("\\");
+//		if(f != string::npos)
+//			tempName = tempName.substr(f+1);
+//		tempName.insert(0, swdir);
+//
+//		pos = tempName.rfind(".");
+//		if (pos == string::npos)
+//		{
+//			tempName.append(".");
+//			tempName.append(type);
+//		}
+//		unsigned char *data = 0;
+//		long size;
+////		string description;
+////		string type;
+//		if((portal->getBlob("media_blob", data, size)) == false)
+//		{
+//			delete portal;
+//			return;
+//		}
+//		FILE *fp = fopen(tempName.c_str(), "wb");
+//		if(fp == 0)
+//		{
+//			delete portal;
+//			return;
+//		}
+//		if(fwrite(data, sizeof(unsigned char), size, fp) < (unsigned long)size)
+//		{
+//			delete portal;
+//			return;
+//		}
+//		if(data)
+//			delete []data;
+//		fclose(fp);
+//
+//		pos = tempName.rfind(".");
+//		if (pos == string::npos)
+//		{
+//			delete portal;
+//			return;
+//		}
+//
+//		memset (buf, 0, 300);
+//		tempName.copy (buf, tempName.size()-pos, pos);
+//	}
+//	else
+//		strcpy(buf, ".html");
+//
+//	delete portal;
+//
+//#ifdef WIN32
+//	if (TeConvertToUpperCase (buf) == ".EXE")
+//	{
+//		_spawnl (P_NOWAIT, tempName.c_str(), tempName.c_str(), NULL);
+//		return;
+//	}
+//	// if application is user defined find current application
+//	// else use default application
+//	string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\";
+//	key += buf;
+//
+//	string keycmd = getSystemKeyValue(HKEY_CURRENT_USER, key, "Application");
+//	if(keycmd.empty() == false)
+//	{
+//		string com = keycmd;
+//		key = "Applications\\" + com + "\\SHELL\\PLAY\\COMMAND";
+//		keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
+//		if(keycmd.empty())
+//		{
+//			key = "Applications\\" + com + "\\SHELL\\OPEN\\COMMAND";
+//			keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
+//			if(keycmd.empty())
+//			{
+//				key = "Applications\\" + com + "\\SHELL\\EDIT\\COMMAND";
+//				keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
+//			}
+//		}
+//	}
+//	else
+//	{
+//		key = buf;
+//		keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
+//		if(keycmd.size() <= 1)
+//		{
+//			key += "\\SHELL\\PLAY\\COMMAND";
+//			keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
+//			if(keycmd.empty())
+//			{
+//				key = buf;
+//				key += "\\SHELL\\OPEN\\COMMAND";
+//				keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
+//				if(keycmd.empty())
+//				{
+//					key = buf;
+//					key += "\\SHELL\\EDIT\\COMMAND";
+//					keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
+//				}
+//			}
+//		}
+//		else
+//		{
+//			memset (buf, 0, 300);
+//			strcpy(buf, keycmd.c_str());
+//
+//			key = buf;
+//			key += "\\SHELL\\PLAY\\COMMAND";
+//			keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
+//			if(keycmd.empty())
+//			{
+//				key = buf;
+//				key += "\\SHELL\\OPEN\\COMMAND";
+//				keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
+//				if(keycmd.empty())
+//				{
+//					key = buf;
+//					key += "\\SHELL\\EDIT\\COMMAND";
+//					keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, key, "");
+//				}
+//			}
+//		}
+//	}
+//
+//	if(keycmd.empty())
+//	{
+//		QMessageBox::warning(this, tr("Warning"),
+//			tr("The media cannot be shown!\nCheck if there is a program defined to open it."));
+//		return;
+//	}
+//
+//// get command and arguments from keycmd
+//    getCommand(keycmd, cmd, varg);
+//	if((pos = tempName.find(" ")) != string::npos)
+//		tempName = "\"" + tempName + "\"";
+//
+//	char curdir[256];
+//	_getcwd(curdir, 256);
+//	_chdir(swdir.c_str());
+//
+//	if (varg.size() == 0)
+//		_spawnl (P_NOWAIT, cmd.c_str(), tempName.c_str(), NULL);
+//	else if (varg.size() == 1)
+//        _spawnl (P_NOWAIT, cmd.c_str(), varg[0].c_str(), tempName.c_str(), NULL);
+//	else if (varg.size() == 2)
+//	{
+//		const char* p = varg[1].c_str();
+//		if(varg[1] == "%L" || varg[1] == "%1")
+//			_spawnl (P_NOWAIT, cmd.c_str(), varg[0].c_str(), tempName.c_str(), NULL);
+//		else
+//			_spawnl (P_NOWAIT, cmd.c_str(), varg[0].c_str(), p, tempName.c_str(), NULL);
+//	}
+//	else if (varg.size() == 3)
+//	{
+//		const char* p = varg[1].c_str();
+//		const char* p1 = varg[2].c_str();
+//		size_t f = varg[0].find("/prefetch:");
+//		if(f != string::npos && (varg[2] == "%L" || varg[2] == "%1"))
+//			_spawnl (P_NOWAIT, cmd.c_str(), p, tempName.c_str(), NULL);
+//		else
+//			_spawnl (P_NOWAIT, cmd.c_str(), varg[0].c_str(), p, p1, tempName.c_str(), NULL);
+//
+//
+//	}
+//
+//	_chdir(curdir);
+//#else
+//    string command;
+//    //Mount the vector of directory paths that are
+//    //stored in the PATH environment variable
+//    string path =  getenv("PATH");
+//    vector<string> dirVector;
+//    string dirPath;
+//    size_t idx = 0;
+//    size_t len = path.find(':', idx);
+//    while (len != string::npos)
+//    {
+//        dirPath = path.substr(idx, len-idx);
+//        dirVector.push_back(dirPath);
+//        idx = len+1;
+//        len = path.find(':', idx);
+//    }
+//
+//
+//    // get the last directory path
+//    idx = path.rfind(':', path.size());
+//    dirPath = path.substr(idx+1, path.size());
+//    dirVector.push_back(dirPath);
+//       
+//	string fs; 
+//    if(type != "url")
+//	{
+//        bool exists = false;
+//        for (unsigned int i = 0; i < dirVector.size(); ++i)
+//        {
+//			QString qfs = dirVector[i].c_str();
+//			qfs += "/konqueror";
+//            QFile file(qfs);
+//            if (file.exists() == true)
+//            {
+//                exists = true;
+//                break;
+//            }
+//        }
+//        if (exists == true)
+//            command = "konqueror " + tempName + " &";
+//        else
+//        {
+//			QString msg = tr("The program konqueror used to display your media is not") + "\n";
+//			msg += tr("present in your PATH environment variable or KDE is not installed!");
+//            QMessageBox::warning(this, tr("Warning"), msg);
+//            return;
+//        }      
+//    }
+//    else
+//    {
+//        unsigned int i;
+//        for (i = 0; i < dirVector.size(); ++i)
+//        {
+//			QString qfs = dirVector[i].c_str();
+//			qfs += "/netscape";
+//            QFile file(qfs);
+//            if (file.exists() == true)
+//            {
+//                command = "netscape -remote 'openURL(" + tempName + ")' &";              
+//                break;
+//            }
+//        }
+//
+//        if (command.empty() == true)
+//        {
+//            for (i = 0; i < dirVector.size(); ++i)
+//            {
+//				QString qfs = dirVector[i].c_str();
+//				qfs += "/mozilla";
+//                QFile file(qfs);
+//                if (file.exists() == true)
+//                {
+//                    command = "mozilla -remote 'openURL(" + tempName + ")' &";
+//                    break;
+//                }
+//            }
+//        }
+//         
+//        if (command.empty() == true)
+//        {
+//            for (i = 0; i < dirVector.size(); ++i)
+//            {
+//				QString qfs = dirVector[i].c_str();
+//				qfs += "/konqueror";
+//				QFile file(qfs);
+//                if (file.exists() == true)
+//                {
+//                    command = "konqueror " + tempName + " &";
+//                    break;
+//                }
+//           }
+//        }
+//        
+//        if (command.empty() == true)
+//        {
+// 			QString msg = tr("The program konqueror used to display your media is not") + "\n";
+//			msg += tr("present in your PATH environment variable or KDE is not installed!");
+//            QMessageBox::warning(this, tr("Warning"), msg);
+//             return;
+//        }
+//    }
+//    
+//    system(command.c_str());
+//#endif
+//}
+
+void TeQtShowMedia :: slotShow()
+{
+	if(row_ > 0 && nattrs_ > row_)
+		return;
+
+	string name;
+	if(row_ >= 0)
+		name = text(row_, 1).latin1();
+
+    size_t  pos;
+    char    buf[300];
+	vector<string>	varg;
+    string  cmd, arg, sname;
+	string	swdir;
+	string	mediaTable;
+	string	type;
+
+// load media data to archive from database
+	TeDatabasePortal *portal = db_->getPortal();
+	string query = "SELECT media_table, media_name FROM " + table_;
+	if(row_ >= 0)
+		query += " WHERE object_id = '" + id_ + "' AND media_name = '" + name + "'";
+	else
+		query += " WHERE object_id = '" + id_ + "' AND show_default = 1";
+	if(portal->query(query))
+	{
+		if(portal->fetchRow())
+		{
+			mediaTable = portal->getData(0);
+			name = portal->getData(1);
+		}
+	}
+
+	if(mediaTable.empty())
+	{
+		QMessageBox::warning(this, tr("Warning"),
+			tr("There is no media to show!\nInsert one first."));
+		delete portal;
+		return;
+	}
+
+	query = "SELECT * FROM " + mediaTable + " WHERE media_name = '" + name + "'";
+	portal->freeResult();
+	if(portal->query(query))
+		if(portal->fetchRow())
+			type = portal->getData("media_type");
+
+	if(type.empty())
+	{
+		QMessageBox::warning(this, tr("Warning"),
+			tr("There is no media in the table!"));
+		delete portal;
+		return;
+	}
+
+	string tempName =  name;
+	if(type != "url")
+	{
+        size_t f;
+#ifdef WIN32
+		char wdir[100];
+		GetWindowsDirectory((LPTSTR)wdir, 100);
+		swdir = wdir;
+		f = swdir.find(":\\");
+		if(f != string::npos)
+			swdir = swdir.substr(0, f);
+		swdir.append(":\\TERRAVIEW_TEMP");
+		if( access (swdir.c_str(), 06) == -1 ) // test if directory exists
+		{
+			if( errno == ENOENT )  // directory does not exist so create it
+			{
+				if ( _mkdir(swdir.c_str()) == -1)
+				{
+                    QString msg = tr("The directory ");
+                    msg += swdir.c_str();
+                    msg += tr(" could not be created");
+            		QMessageBox::critical(this, tr("Error"),
+            		    tr("The directory /tmp/TERRAVIEW_TEMP could not be created!"));
+					delete portal;
+					return;
+				}
+			}
+		}
+		swdir.append("\\");
+#else
+    	swdir = "/tmp/TERRAVIEW_TEMP";
+		if( access (swdir.c_str(), F_OK) == -1 ) // test if directory exists
+		{
+			if( errno == ENOENT )  // directory does not exist so create it
+			{
+                char buf[20];
+                sprintf(buf, "mkdir %s", swdir.c_str());
+				if (system(buf) != 0)
+				{
+            		QMessageBox::critical(this, tr("Error"),
+            		    tr("The directory /tmp/TERRAVIEW_TEMP could not be created!"));
+            		delete portal;
+            		return;
+				}
+			}
+		}        
+		swdir.append("/");
+#endif
+		f = tempName.rfind("/");
+		if(f == string::npos)
+			f = tempName.rfind("\\");
+		if(f != string::npos)
+			tempName = tempName.substr(f+1);
+		tempName.insert(0, swdir);
+
+		pos = tempName.rfind(".");
+		if (pos == string::npos)
+		{
+			tempName.append(".");
+			tempName.append(type);
+		}
+		unsigned char *data = 0;
+		long size;
+//		string description;
+//		string type;
+		if((portal->getBlob("media_blob", data, size)) == false)
+		{
+			delete portal;
+			return;
+		}
+		FILE *fp = fopen(tempName.c_str(), "wb");
+		if(fp == 0)
+		{
+			delete portal;
+			return;
+		}
+		if(fwrite(data, sizeof(unsigned char), size, fp) < (unsigned long)size)
+		{
+			delete portal;
+			return;
+		}
+		if(data)
+			delete []data;
+		fclose(fp);
+
+		pos = tempName.rfind(".");
+		if (pos == string::npos)
+		{
+			delete portal;
+			return;
+		}
+
+		memset (buf, 0, 300);
+		tempName.copy (buf, tempName.size()-pos, pos);
+	}
+	else
+		strcpy(buf, ".html");
+
+	delete portal;
+
+#ifdef WIN32
+
+	if(isVistaOperatingSystem() == false)
+	{
+		//converte ASCII to UNICODE
+		int	nextPos=0;
+
+		wchar_t fName[256]; // file name
+		wchar_t dName[256]; // dir name
+		size_t tt = tempName.rfind("\\");
+		if(tt == string::npos)
+			tt = tempName.rfind("/");
+		if(tt == string::npos)
+			tt = 0;
+		else nextPos=1;
+		int i;
+		for(i=0; i<(int)tt; ++i)
+			dName[i] = tempName.c_str()[i];
+		dName[i] = '\0';
+		for(i=(int)tt + nextPos; i<(int)tempName.length(); ++i)
+			fName[i-((int)tt+nextPos)] = tempName.c_str()[i];
+		fName[i-((int)tt+nextPos)] = '\0';
+		
+		
+		if(this->isIPAddress(tempName))
+		{
+			std::string completeIP;
+			completeIP=this->getCompleteIPAddress(tempName);
+			for(i=0;i<(int)completeIP.length();i++)
+			{
+				fName[i]=completeIP.c_str()[i];
+			}
+			fName[i]=0;
+		}else if( this->isHTTPS(tempName)|| this->isURLFile(tempName) )
+		{
+			for(i=0;i<(int)tempName.length();i++)
+			{
+				fName[i]=tempName.c_str()[i];
+			}
+			fName[i]=0;
+		}
+
+		//HINSTANCE hhhh = ShellExecute(NULL, L"open", fName , L"/Play", dName, SW_SHOWNORMAL);
+		SHELLEXECUTEINFO shExecInfo;
+		shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+		shExecInfo.fMask = NULL;
+		shExecInfo.hwnd = NULL;
+		shExecInfo.lpVerb = L"open";
+		shExecInfo.lpFile = fName;
+		shExecInfo.lpParameters = L"/Open";
+		shExecInfo.lpDirectory = dName;
+		shExecInfo.nShow = SW_SHOWNORMAL;
+		shExecInfo.hInstApp = NULL;
+
+		ShellExecuteEx(&shExecInfo);
+	}
+	else // windows VISTA
+	{
+		QProcess proc( this );
+		string cmdName;
+		if (TeConvertToUpperCase (buf) == ".EXE")
+		{
+			cmdName = tempName;
+			proc.addArgument(cmdName.c_str());
+			proc.start();
+			return;
+		}
+		// find user defined current application
+		string fileType = buf;
+		string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\";
+
+		key += fileType + "\\UserChoice"; // para vista dever ser essa opcao (testar)
+		string keyFile = getSystemKeyValue(HKEY_CURRENT_USER, key, "Progid"); // para vista dever ser essa opcao (testar)
+		if(keyFile.empty()) // para vista dever ser essa opcao (testar)
+			keyFile = getKeyFileFromProgId(fileType); // para vista dever ser essa opcao (testar)
+
+		keyFile += "\\shell\\open\\command";		
+		string keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, keyFile, "");
+		if(keycmd.size() <= 1)
+        {
+ 			QString msg = tr("Sorry! Problem to display midia.\nPlease verify if exist default program associated with this type of midia.");
+            QMessageBox::warning(this, tr("Warning"), msg);
+             return;
+		}
+
+		getCommandToQtProcess(keycmd, cmd);
+		cmdName = cmd;
+		size_t ft;
+		ft = cmdName.find("%");
+		if(ft != string::npos)
+			cmdName.replace(ft, 2, tempName);
+		else
+			cmdName += " " + tempName;
+
+		QString qCmd(cmdName.c_str());
+		qCmd = qCmd.simplifyWhiteSpace();
+		proc.addArgument(qCmd);
+		proc.start();
+
+		//proc.clearArguments();
+		//proc.addArgument( "\"C:\\Program Files\\Adobe\\Photoshop Album Starter Edition\\3.2\\Apps\\ComponentLauncher.exe\" module=jpegviewer bg params \"filepath=c:\\TERRAVIEW_TEMP\\winter.jpg\"" );
+		////proc.addArgument( "\"C:\\Program Files\\Adobe\\Photoshop Album Starter Edition\\3.2\\Apps\\ComponentLauncher.exe\" module=jpegviewer bg params filepath=c:\\TERRAVIEW_TEMP\\winter.jpg" );
+		//proc.start();
+
+	}
+  
+#else
+    string command;
+    //Mount the vector of directory paths that are
+    //stored in the PATH environment variable
+    string path =  getenv("PATH");
+    vector<string> dirVector;
+    string dirPath;
+    size_t idx = 0;
+    size_t len = path.find(':', idx);
+    while (len != string::npos)
+    {
+        dirPath = path.substr(idx, len-idx);
+        dirVector.push_back(dirPath);
+        idx = len+1;
+        len = path.find(':', idx);
+    }
+
+
+    // get the last directory path
+    idx = path.rfind(':', path.size());
+    dirPath = path.substr(idx+1, path.size());
+    dirVector.push_back(dirPath);
+       
+	string fs; 
+    if(type != "url")
+	{
+        bool exists = false;
+        for (unsigned int i = 0; i < dirVector.size(); ++i)
+        {
+			QString qfs = dirVector[i].c_str();
+			qfs += "/konqueror";
+            QFile file(qfs);
+            if (file.exists() == true)
+            {
+                exists = true;
+                break;
+            }
+        }
+        if (exists == true)
+            command = "konqueror " + tempName + " &";
+        else
+        {
+			QString msg = tr("The program konqueror used to display your media is not") + "\n";
+			msg += tr("present in your PATH environment variable or KDE is not installed!");
+            QMessageBox::warning(this, tr("Warning"), msg);
+            return;
+        }      
+    }
+    else
+    {
+        unsigned int i;
+        for (i = 0; i < dirVector.size(); ++i)
+        {
+			QString qfs = dirVector[i].c_str();
+			qfs += "/netscape";
+            QFile file(qfs);
+            if (file.exists() == true)
+            {
+                command = "netscape -remote 'openURL(" + tempName + ")' &";              
+                break;
+            }
+        }
+
+        if (command.empty() == true)
+        {
+            for (i = 0; i < dirVector.size(); ++i)
+            {
+				QString qfs = dirVector[i].c_str();
+				qfs += "/mozilla";
+                QFile file(qfs);
+                if (file.exists() == true)
+                {
+                    command = "mozilla -remote 'openURL(" + tempName + ")' &";
+                    break;
+                }
+            }
+        }
+         
+        if (command.empty() == true)
+        {
+            for (i = 0; i < dirVector.size(); ++i)
+            {
+				QString qfs = dirVector[i].c_str();
+				qfs += "/konqueror";
+				QFile file(qfs);
+                if (file.exists() == true)
+                {
+                    command = "konqueror " + tempName + " &";
+                    break;
+                }
+           }
+        }
+        
+        if (command.empty() == true)
+        {
+ 			QString msg = tr("The program konqueror used to display your media is not") + "\n";
+			msg += tr("present in your PATH environment variable or KDE is not installed!");
+            QMessageBox::warning(this, tr("Warning"), msg);
+             return;
+        }
+    }
+    
+    system(command.c_str());
+#endif
+
+}
+
+void TeQtShowMedia :: slotInsert(QString& dir)
+{
+	if(cmdLocal_ == false)
+		hide();
+	QFileDialog filed(dir, QString::null, 0, 0, true);
+	QString qfile = filed.getOpenFileName (QString::null, QString::null, 0, 0);
+
+	if(qfile.isEmpty())
+	{
+		QMessageBox::warning(this, tr("Warning"), tr("No media was selected!"));
+		show();
+		return;
+	}
+
+	string file = qfile.latin1();
+	dir = TeGetPath(file.c_str()).c_str();
+
+	string type;
+	size_t f = file.rfind(".");
+	if (f != string::npos)
+	{
+		type = file;
+		type = type.substr(f+1);
+	}
+
+	string mTable = "media_table_" + Te2String(layer_->id());
+	if(table_.empty())
+	{
+		string tname = "media_layer_" + Te2String(layer_->id());
+		if(createLayerMediaTable(db_, layer_->id(), tname) == false)
+		{
+			QMessageBox::critical(this, tr("Error"),
+				tr("Fail to create the table that will store media names!"));
+			return;
+		}
+		table_ = layer_->mediaTable();
+		if(createMediaTable(db_, mTable) == false)
+		{
+			QMessageBox::critical(this, tr("Error"),
+				tr("Fail to create the media table!"));
+			return;
+		}
+	}
+
+	int response = 1;
+
+	TeDatabasePortal *portal = db_->getPortal();
+	string sel = "SELECT media_name, object_id FROM "  + table_ + " WHERE media_table = '" + mTable + "'";
+	if(portal->query(sel))
+	{
+		while(portal->fetchRow())
+		{
+			string s = portal->getData(0);
+			if(s == file)
+			{
+				response = QMessageBox::question(this, tr("Question"),
+				tr("The media already exists! Do you wish to use it even so?"), tr("Yes"), tr("No"));
+				if(response == 1)
+				{
+					QMessageBox::warning(this, tr("Warning"),
+						tr("Rename the file and try again!"));
+					delete portal;
+					return;
+				}
+				else
+				{
+					string s = portal->getData(1);
+					if(s == id_)
+					{
+						QMessageBox::warning(this, tr("Warning"),
+							tr("There is already a media associated to this object!"));
+						delete portal;
+						return;
+					}
+				}
+				break;
+			}
+		}
+	}
+
+	if(response == 1)
+	{
+		if(insertMedia(db_, mTable, file, "", type) == false)
+		{
+			QString msg = tr("Fail to insert media:") + " ";
+			msg += db_->errorMessage().c_str();
+			QMessageBox::critical(this, tr("Error"), msg);
+			delete portal;
+			return;
+		}
+	}
+	if(insertMediaObjLayer(db_, layer_, id_, file, mTable) == false)
+	{
+		QMessageBox::critical(this, tr("Error"),
+			tr("Fail to insert the \"media_name\" field in the table!"));
+		delete portal;
+		return;
+	}
+
+	setNumRows(numRows() + 1);
+	setText(numRows()-1, 1, file.c_str());
+
+	int nmidias = 0;
+	string conta = "SELECT COUNT(*) FROM "  + table_ + " WHERE object_id = '" + id_ + "'";
+	portal->freeResult();
+	if(portal->query(conta))
+	{
+		if(portal->fetchRow())
+			nmidias = atoi(portal->getData(0));
+	}
+
+	string title = "media: ";
+
+	if(nmidias <= 1)
+	{
+		title = "*media: "; // + type;
+		string up = "UPDATE " + table_ + " SET show_default = 1 WHERE object_id = '" + id_ + "'";
+		db_->execute(up);
+	}
+	delete portal;
+	setText(numRows()-1, 0, title.c_str());
+
+	if(cmdLocal_ == false)
+		hide();
+	else
+	{
+		moveDown();
+		show();
+		raise();
+
+	}
+}
+
+void TeQtShowMedia :: moveDown()
+{
+	int x = contentsX();
+	int height = visibleHeight(); 
+	int nlins = rowAt(height);
+	int y = rowPos(numRows()-nlins);
+	setContentsPos(x, y);
+	adjustColumn(0);
+	adjustColumn(1);
+}
+
+void TeQtShowMedia :: slotRemove()
+{
+	if(nattrs_ > row_)
+		return;
+
+	int x = contentsX();
+	int y = contentsY();
+
+	vector<string> atr;
+	vector<string> val;
+	int	i;
+
+	for(i=0; i<numRows(); i++)
+	{
+		string a = text(i, 0).latin1();
+		atr.push_back(a);
+		string b = text(i, 1).latin1();
+		val.push_back(b);
+	}
+
+	string	name = val[row_];
+	vector<string>::iterator ait = atr.begin();
+	ait += row_;
+	atr.erase(ait, ait+1);
+	vector<string>::iterator vit = val.begin();
+	vit += row_;
+	val.erase(vit, vit+1);
+
+	setNumRows(0);
+	string mTable = "media_table_" + Te2String(layer_->id());
+	string remover = "DELETE FROM " + table_ + " WHERE object_id = '" + id_ + "'";
+	remover += " AND media_name = '" + name + "'" + " AND media_table = '" + mTable + "'";
+	db_->execute(remover);
+
+	bool aindaUsa = false;
+	TeDatabasePortal* portal = db_->getPortal();
+	string sel = "SELECT * FROM " + table_ + " WHERE media_name = '" + name + "'";
+	sel += " AND media_table = '" +  mTable + "'";
+	if(portal->query(sel))
+		if(portal->fetchRow())
+			aindaUsa = true;
+
+	if(aindaUsa == false)
+	{
+		string remover = "DELETE FROM " + mTable + " WHERE media_name = '" + name + "'";
+		db_->execute(remover);
+	}
+
+	string defname;
+	bool defshow = false;
+	sel = "SELECT media_name, show_default FROM " + table_ + " WHERE object_id = '" + id_ + "'";
+	portal->freeResult();
+	if(portal->query(sel))
+	{
+		while(portal->fetchRow())
+		{
+			defname = portal->getData(0);
+			defshow = atoi(portal->getData(1));
+			if(defshow)
+				break;
+		}
+	}
+	delete portal;
+
+	if(defshow ==  false && defname.empty() == false)
+	{
+		string up = "UPDATE " + table_ + " SET show_default = 1 WHERE media_name = '" + defname + "'";
+		db_->execute(up);
+	}
+
+	setNumRows(atr.size());
+
+	unsigned int k;
+	for(k=0; k<atr.size(); k++)
+	{
+		if(defshow ==  false && defname.empty() == false)
+		{
+			if(val[k] == defname)
+				atr[k].insert(0, "*");
+		}
+		setText(k, 0, atr[k].c_str());
+		setText(k, 1, val[k].c_str());
+	}
+	setContentsPos(x, y);
+	raise();
+}
+
+void TeQtShowMedia :: slotInsertURL()
+{
+	if(cmdLocal_ == false)
+		hide();
+
+	urlWindow_ = new URLWindow(this, "urlInsertion", true);
+	if (urlWindow_->exec() == QDialog::Rejected)
+	{
+		delete urlWindow_;
+		return;
+	}
+	QString qsite = urlWindow_->URLLineEdit->text();
+	delete urlWindow_;
+	if(qsite.isNull() || qsite.isEmpty())
+		return;
+
+	string site = qsite.latin1();
+	string type = "url";
+
+
+	string mTable = "media_table_" + Te2String(layer_->id());
+	if(table_.empty())
+	{
+		string tname = "media_layer_" + Te2String(layer_->id());
+		if(createLayerMediaTable(db_, layer_->id(), tname) == false)
+		{
+			QMessageBox::critical(this,tr("Error"),
+				tr("Fail to create the table to store media names!"));
+			return;
+		}
+		if(createMediaTable(db_, mTable) == false)
+		{
+			QMessageBox::critical(this, tr("Error"), tr("Fail to create the media tables!"));
+			return;
+		}
+	}
+
+
+	bool jatem = false;
+
+	TeDatabasePortal *portal = db_->getPortal();
+	string sel = "SELECT media_name, object_id FROM "  + table_ + " WHERE media_table = '" + mTable + "'";
+	if(portal->query(sel))
+	{
+		while(portal->fetchRow())
+		{
+			string s = portal->getData(0);
+			if(s == site)
+			{
+				jatem = true;
+				string ss = portal->getData(1);
+				if(ss == id_)
+				{
+					QMessageBox::warning(this, tr("Warning"),
+						tr("This URL is already associated to this object!"));
+					delete portal;
+					return;
+				}
+				break;
+			}
+		}
+	}
+
+	if(jatem == false)
+	{
+		if(insertMedia(db_, mTable, site, "", type, false) == false)
+		{
+			QMessageBox::critical(this, tr("Error"),
+				tr("Fail to insert the \"media_blob\" field in the table!"));
+			delete portal;
+			return;
+		}
+	}
+	if(insertMediaObjLayer(db_, layer_, id_, site, mTable) == false)
+	{
+		QMessageBox::critical(this, tr("Error"),
+			tr("Fail to insert the \"media_name\" field in the table!"));
+		delete portal;
+		return;
+	}
+
+	setNumRows(numRows() + 1);
+	setText(numRows()-1, 1, site.c_str());
+
+	int nmidias = 0;
+	string conta = "SELECT COUNT(*) FROM "  + table_ + " WHERE object_id = '" + id_ + "'";
+	portal->freeResult();
+	if(portal->query(conta))
+	{
+		if(portal->fetchRow())
+			nmidias = atoi(portal->getData(0));
+	}
+
+	string title;
+
+	if(nmidias <= 1)
+	{
+		title = "*media: "; // + type;
+		string up = "UPDATE " + table_ + " SET show_default = 1 WHERE object_id = '" + id_ + "'";
+		db_->execute(up);
+	}
+
+	delete portal;
+	setText(numRows()-1, 0, title.c_str());
+
+	if(cmdLocal_ == false)
+		hide();
+	else
+	{
+		moveDown();
+		show();
+		raise();
+	}
+}
+
+void TeQtShowMedia :: slotSetDefault()
+{
+	if(nattrs_ > row_)
+		return;
+
+	string media_name = text(row_, 1).latin1();
+	string mTable = "media_table_" + Te2String(layer_->id());
+	setDefaultMedia(db_, layer_, id_, media_name, mTable);
+
+	string type = text(row_, 0).latin1();
+//	int f = type.find("*", string::npos);
+	size_t f = type.find("*");
+	if(f != string::npos)
+		return;
+	else
+	{
+		int i;
+		for(i = nattrs_; i<numRows(); i++)
+		{
+			string s = text(i, 0).latin1();
+			f = s.find("*", 0);
+			if(f != string::npos)
+			{
+
+				setText(i, 0, "media:");
+				break;
+			}
+		}
+		setText(row_, 0, "*media:");
+	}
+
+	if(cmdLocal_ == false)
+		hide();
+	else
+		raise();
+}
+
+void TeQtShowMedia :: slotDescription()
+{
+	if(row_ > 0 && nattrs_ > row_)
+		return;
+
+	string mTable = "media_table_" + Te2String(layer_->id());
+	TeDatabasePortal *ptal = db_->getPortal();
+	string name;
+
+	if(row_ < 0)
+	{
+		if(table_.empty() == false)
+		{
+			string s = "SELECT media_name FROM " + table_ + " WHERE object_id = '" + id_ + "'";
+			s += " AND show_default = 1";
+			if(ptal->query(s))
+			{
+				if(ptal->fetchRow())
+					name = ptal->getData(0);
+			}
+		}
+	}
+	else
+		name = text(row_, 1).latin1();
+
+	string q = "SELECT * FROM " + mTable + " WHERE media_name = '" + name + "'";
+
+	string description = "";
+	ptal->freeResult();
+
+	if(db_->tableExist(mTable))
+	{
+		if(ptal->query(q))
+		{
+			if(ptal->fetchRow())
+				description = ptal->getData("description");
+		}
+	}
+	delete ptal;
+	descriptionWindow_ = new MediaDescription(this, "mediaDescription", true);
+	QString qdesc;
+	qdesc.setLatin1(description.c_str(), description.size());
+	descriptionWindow_->descriptionTextEdit->setText(qdesc);
+	descriptionWindow_->exec();
+
+	QString qtext = descriptionWindow_->descriptionTextEdit->text();
+	if(qtext.isEmpty() || qtext.isNull())
+		description.clear();
+	else
+		description = qtext.latin1();
+	if(description.size() > 255)
+	{
+		QMessageBox::warning(this, tr("Warning"),
+			tr("The description is longer than 255 caracteres!\nIt will be truncated."));
+		description = description.substr(0, 255);
+	}
+	if(description.empty() == false)
+		updateMediaDescription(db_, name, mTable, description);
+
+	delete descriptionWindow_;
+
+	if(cmdLocal_ == false)
+		hide();
+	else
+		raise();
+}
+
+#ifdef WIN32
+void TeQtShowMedia :: getCommand(string keycom, string& cmd, vector<string>& varg)
+{
+    string  s = keycom;
+    string  ss = keycom;
+    string  S = TeConvertToUpperCase(keycom);
+    unsigned int i;
+    size_t  pos, n;
+	string	arg;
+	bool	isDll = false;
+
+	varg.clear();
+    cmd.clear();
+    arg.clear();
+
+// find command
+	if((pos=s.find(".")) != string::npos)
+	{
+		if((n=s.find(" ", pos)) != string::npos)
+		{
+			s = s.substr(0, n);
+			S = S.substr(0, n);
+			ss = ss.substr(n);
+		}
+	}
+
+// remove ""
+	while((pos=s.find("\"")) != string::npos)
+	{
+		string cs = s, CS = S;
+		s = cs.substr(0, pos) + cs.substr(pos+1);
+		S = CS.substr(0, pos) + CS.substr(pos+1);
+	}
+// replace %SystemRoot%
+	if((pos=S.find("%SYSTEMROOT%")) != string::npos)
+	{
+		int len = strlen("%SystemRoot%");
+		string systemRoot = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot");
+		s.replace(pos, len, systemRoot);
+		S.replace(pos, len, systemRoot);
+	}
+
+// replace %ProgramFiles%
+	if((pos=S.find("%PROGRAMFILES%")) != string::npos)
+	{
+		int len = strlen("%ProgramFiles%");
+		string programFiles = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir");
+		s.replace(pos, len, programFiles);
+		S.replace(pos, len, programFiles);
+	}
+
+// replace %CommonProgramFiles%
+	if((pos=S.find("%COMMOMFILES%")) != string::npos)
+	{
+		int len = strlen("%CommonFiles%");
+		string commonFiles = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "CommonFilesDir");
+		s.replace(pos, len, commonFiles);
+		S.replace(pos, len, commonFiles);
+	}
+
+// rundll32.exe
+	if((pos=S.find("RUNDLL32")) == 0)
+	{
+		string dllDirectory = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"System\\ControlSet001\\Control\\Session Manager\\KnownDLLs", "DllDirectory");
+		string  DIR = TeConvertToUpperCase(dllDirectory);
+		if((pos=DIR.find("%SYSTEMROOT%")) != string::npos)
+		{
+
+			int len = strlen("%SystemRoot%");
+			string systemRoot = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot");
+			dllDirectory.replace(pos, len, systemRoot);
+		}
+		cmd = dllDirectory + "\\rundll32.exe";
+		isDll = true;
+	}
+	else
+		cmd = s;
+
+	string command = TeConvertToUpperCase(cmd);
+	bool percentOut = false;
+	if((pos=command.find("MSACCESS.EXE")) != string::npos)
+
+		percentOut = true;
+	if((pos=command.find("POWERPNT.EXE")) != string::npos)
+		percentOut = true;
+
+	s = ss; // arguments
+	if(isDll)
+	{
+		varg.push_back("rundll32.exe");
+		S = TeConvertToUpperCase(s);
+		if((pos=S.find("%SYSTEMROOT%")) != string::npos)
+		{
+			int len = strlen("%SystemRoot%");
+			string systemRoot = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot");
+			s.replace(pos, len, systemRoot);
+		}
+		if(s[0] == ' ')
+			s = s.substr(1);
+
+		for(i=0; i<s.size(); i++)
+			if(s[i] == '/' || s[i] == '-' || s[i]=='%')
+				break;
+		string arg = s;
+		arg = arg.substr(0, i-1);
+		varg.push_back(arg);
+		s = s.substr(i-1);
+	}
+
+// if runddl32 the option has "/" or "-" and termineted with " " 
+// else the option has "/", "-" or "%" and termineted with " "
+	if(s.find("=") == string::npos)
+	{
+		for(i=0; i<s.size(); i++)
+		{
+			if(isDll || percentOut)
+			{
+				if(s[i] == '/' || s[i] == '-')
+				{
+					if((pos=s.find(" ", i)) != string::npos)
+					{
+						string arg = s;
+
+						arg = arg.substr(0, pos);
+						arg = arg.substr(i, s.size() - i);
+						// remove ""
+						while((n=arg.find("\"")) != string::npos)
+						{
+							string carg = arg;
+							arg = carg.substr(0, n) + carg.substr(n+1);
+						}
+
+						varg.push_back(arg);
+						i = pos;
+					}
+					else
+					{
+						string arg = s;
+						arg = arg.substr(i);
+						// remove ""
+						while((n=arg.find("\"")) != string::npos)
+						{
+							string carg = arg;
+							arg = carg.substr(0, n) + carg.substr(n+1);
+						}
+
+						varg.push_back(arg);
+						break;
+					}
+				}
+			}
+			else
+			{
+				if(s[i] == '/' || s[i] == '-' || s[i] == '%')
+				{
+					if((pos=s.find(" ", i)) != string::npos)
+					{
+						string arg = s;
+						arg = arg.substr(0, pos);
+						arg = arg.substr(i);
+						// remove ""
+						while((n=arg.find("\"")) != string::npos)
+						{
+							string carg = arg;
+							arg = carg.substr(0, n) + carg.substr(n+1);
+						}
+
+						varg.push_back(arg);
+						i = pos;
+					}
+					else
+					{
+						string arg = s;
+						arg = arg.substr(i);
+						// remove ""
+						while((n=arg.find("\"")) != string::npos)
+						{
+							string carg = arg;
+							arg = carg.substr(0, n) + carg.substr(n+1);
+						}
+
+						varg.push_back(arg);
+						break;
+					}
+				}
+			}
+		}
+	}
+	else
+	{
+		int p = s.find("%1");
+		if(p != string::npos)
+		{
+		}
+	}
+}
+
+void TeQtShowMedia :: getCommandToQtProcess(string keycom, string& cmd)
+{
+    string  s = keycom;
+    string  S = TeConvertToUpperCase(keycom);
+    int		len;
+    size_t  pos;
+
+    cmd.clear();
+
+// replace %SystemRoot%
+	if((pos=S.find("%SYSTEMROOT%")) != string::npos)
+	{
+		len = strlen("%SystemRoot%");
+		string systemRoot = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot");
+		s.replace(pos, len, systemRoot);
+		S.replace(pos, len, systemRoot);
+	}
+
+// replace %ProgramFiles%
+	if((pos=S.find("%PROGRAMFILES%")) != string::npos)
+	{
+		len = strlen("%ProgramFiles%");
+		string programFiles = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir");
+		s.replace(pos, len, programFiles);
+		S.replace(pos, len, programFiles);
+	}
+
+// replace %CommonProgramFiles%
+	if((pos=S.find("%COMMOMFILES%")) != string::npos)
+	{
+		len = strlen("%CommonFiles%");
+		string commonFiles = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "CommonFilesDir");
+		s.replace(pos, len, commonFiles);
+		S.replace(pos, len, commonFiles);
+	}
+
+// rundll32.exe
+	if((pos=S.find("RUNDLL32")) == 0) // se for no inicio
+	{
+		string dllDirectory = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"System\\ControlSet001\\Control\\Session Manager\\KnownDLLs", "DllDirectory");
+		string  DIR = TeConvertToUpperCase(dllDirectory);
+		if((pos=DIR.find("%SYSTEMROOT%")) != string::npos)
+		{
+			len = strlen("%SystemRoot%");
+			string systemRoot = getSystemKeyValue(HKEY_LOCAL_MACHINE,
+			"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot");
+			dllDirectory.replace(pos, len, systemRoot);
+		}
+		cmd = dllDirectory + "\\rundll32.exe";
+		len = strlen("RUNDLL32.EXE");
+		s.replace(0, len, cmd);
+	}
+	cmd = s;
+}
+
+string TeQtShowMedia :: getString(TCHAR* u, DWORD size)
+{
+	int	i;
+	char buf[512];
+
+	for(i = 0; i < (int)size; ++i)
+		buf[i] = u[i];
+	buf[i] = '\0';
+
+	string ret = buf;
+	return ret;
+}
+
+void TeQtShowMedia :: charToUnicode(const char* c, TCHAR* u)
+{
+	int i;
+	int len = strlen(c);
+	for(i=0; i < len; ++i)
+		u[i] = c[i];
+	u[i] = '\0';
+}
+
+string TeQtShowMedia :: QueryKey(HKEY hKey) 
+{ 
+	string ret;
+
+    TCHAR    achKey[512];   // buffer for subkey name
+    DWORD    cbName;                   // size of name string 
+    TCHAR    achClass[512] = TEXT("");  // buffer for class name 
+    DWORD    cchClassName = 512;  // size of class string 
+    DWORD    cSubKeys=0;               // number of subkeys 
+    DWORD    cbMaxSubKey;              // longest subkey size 
+    DWORD    cchMaxClass;              // longest class string 
+    DWORD    cValues;              // number of values for key 
+    DWORD    cchMaxValue;          // longest value name 
+    DWORD    cbMaxValueData;       // longest value data 
+    DWORD    cbSecurityDescriptor; // size of security descriptor 
+    FILETIME ftLastWriteTime;      // last write time 
+ 
+    DWORD i, retCode; 
+ 
+    TCHAR  achValue[512]; 
+    DWORD cchValue = 512; 
+ 
+    // Get the class name and the value count. 
+    retCode = RegQueryInfoKey(
+        hKey,                    // key handle 
+        achClass,                // buffer for class name 
+        &cchClassName,           // size of class string 
+        NULL,                    // reserved 
+        &cSubKeys,               // number of subkeys 
+        &cbMaxSubKey,            // longest subkey size 
+        &cchMaxClass,            // longest class string 
+        &cValues,                // number of values for this key 
+        &cchMaxValue,            // longest value name 
+        &cbMaxValueData,         // longest value data 
+        &cbSecurityDescriptor,   // security descriptor 
+        &ftLastWriteTime);       // last write time 
+ 
+    // Enumerate the subkeys, until RegEnumKeyEx fails.
+    
+    if (cSubKeys)
+    {
+		for (i=0; i<cSubKeys; i++) 
+		{ 
+			cbName = 512;
+			retCode = RegEnumKeyEx(hKey, i, achKey, &cbName, NULL, NULL, NULL, &ftLastWriteTime); 
+			if (retCode != ERROR_SUCCESS) 
+				return ret;
+		}
+    } 
+ 
+    // Enumerate the key values. 
+    if (cValues) 
+    {
+        cchValue = 512; 
+        achValue[0] = '\0'; 
+        retCode = RegEnumValue(hKey, cValues-1, achValue, &cchValue, NULL, NULL, NULL, NULL);
+
+        if (retCode == ERROR_SUCCESS ) 
+			ret = getString(achValue, cchValue);
+    }
+	return ret; 
+}
+
+string TeQtShowMedia :: getKeyFileFromProgId(string& fileType)
+{
+	string ret;
+	DWORD retCode;
+	TCHAR tkey[512];
+	string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\" + fileType + "\\OpenWithProgids";
+	charToUnicode(key.c_str(), tkey);
+
+	HKEY hTestKey;
+
+	retCode = RegOpenKeyEx(HKEY_CURRENT_USER, tkey, 0, KEY_READ, &hTestKey);
+	if(retCode == ERROR_SUCCESS)
+		ret = QueryKey(hTestKey);
+	RegCloseKey(hTestKey);
+	return ret;
+}
+
+string TeQtShowMedia :: getSystemKeyValue(HKEY hkey, string key, string value)
+{
+	HKEY    hk;
+	DWORD	DataSize = 1024;
+    DWORD   Type = REG_SZ;
+    char    buf[1024];
+    string  keycmd;
+
+    if (RegOpenKeyExA(hkey, key.c_str(), 0, KEY_READ, &hk) == ERROR_SUCCESS)
+	{
+		memset (buf, 0, 1024);
+		if (RegQueryValueExA(hk, value.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
+
+			keycmd = buf;
+	}
+	if(hk)
+		RegCloseKey (hk);
+	return keycmd;
+}
+
+bool TeQtShowMedia :: isVistaOperatingSystem()
+{
+   OSVERSIONINFO osvi;
+
+   ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+   GetVersionEx(&osvi);
+   if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
+	   return true;
+
+	return false;
+}
+
+#endif
+
+
+bool TeQtShowMedia::isHTTPS(const std::string &value)
+{
+	size_t			pos;
+	std::string		newValue;
+
+	newValue=TeConvertToUpperCase(value);
+	pos=newValue.find("HTTPS://");
+	if(pos!=std::string::npos)
+		return true;
+	return false;
+}
+bool TeQtShowMedia::isURLFile(const std::string &value)
+{
+	size_t			pos;
+	std::string		newValue;
+
+	newValue=TeConvertToUpperCase(value);
+	pos=newValue.find("FILE://");
+	if(pos!=std::string::npos)
+		return true;
+	return false;
+}
+
+std::string TeQtShowMedia::removeURLHead(const std::string &value)
+{
+	std::string		newValue;
+	std::string		cutedValue;
+	size_t			pos;
+	basic_string <char>::iterator it;
+
+
+
+	newValue=TeConvertToUpperCase(value);
+	pos=newValue.find("HTTP://");
+	if(pos!=std::string::npos)
+	{
+		cutedValue=newValue.substr(7,newValue.size() - 7);
+		return cutedValue;
+	}else
+	{
+		pos=newValue.find("HTTPS://");
+		if(pos!=std::string::npos)
+		{
+			cutedValue=newValue.substr(8,newValue.size() - 8);
+			return cutedValue;
+		}
+	}
+	return newValue;
+}
+
+bool	TeQtShowMedia ::isIPAddress(const std::string &value)
+{
+	unsigned int		i;
+	short				count=0;
+	char				number[255];
+	QString				qValue;
+	bool				ok;
+	std::string			newValue;
+	
+	newValue=removeURLHead(value);
+
+	for(i=0;i<newValue.size();i++)
+	{
+		if(newValue[i] == '.') count++;
+	}
+	if(count<3)	return false;// um ip no minimo tem que ter 3 "."
+
+	//verifico se antes do primeiro ponto existe  3 caracteres
+	// e se estes caracteres são numericos
+	for(i=0;(i<newValue.size()) && (i<255);i++)
+	{
+		if(newValue[i] == '.') break;
+		number[i]=newValue[i];
+	}
+	if(i != 3) return false;
+	number[3]=0;
+	qValue=QString(number);
+	qValue.toInt(&ok);
+	return ok;
+}
+
+std::string TeQtShowMedia ::getCompleteIPAddress(const std::string &value)
+{
+	std::string		cplIP;
+	
+	if(isHTTPS(value))	cplIP="https://" + removeURLHead(value); 
+	else				cplIP="http://" + removeURLHead(value); 
+	return cplIP;
+}
+
+void TeQtShowMedia :: slotShowFile(string file)
+{
+    size_t			pos;
+    string			cmd;
+
+	string tempName = file;
+
+	string type;
+	pos = file.rfind(".");
+	if (pos != string::npos)
+	{
+		type = file;
+		type = type.substr(pos);
+		type = TeConvertToUpperCase(type);
+	}
+
+#ifdef WIN32
+
+	if(type != ".URL")
+	{
+		pos = tempName.find("/");
+		while(pos != string::npos)
+		{
+			tempName.replace(pos, 1, "\\");
+			pos = tempName.find("/");
+		}
+	}
+	else
+	{
+		tempName = tempName.substr(0, tempName.size()-4);
+		type = ".HTM";
+	}
+
+	if(isVistaOperatingSystem() == false)
+	{
+		//converte ASCII to UNICODE
+		wchar_t fName[256]; // file name
+		wchar_t dName[256]; // dir name
+		size_t tt = tempName.rfind("\\");
+		if(tt == string::npos)
+			tt = tempName.rfind("/");
+		if(tt == string::npos)
+			tt = 0;
+		int i;
+		for(i=0; i<(int)tt; ++i)
+			dName[i] = tempName.c_str()[i];
+		dName[i] = '\0';
+		for(i=(int)tt+1; i<(int)tempName.length(); ++i)
+			fName[i-((int)tt+1)] = tempName.c_str()[i];
+		fName[i-((int)tt+1)] = '\0';
+
+		//HINSTANCE hhhh = ShellExecute(NULL, L"open", fName , L"/Play", dName, SW_SHOWNORMAL);
+		SHELLEXECUTEINFO shExecInfo;
+		shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+		shExecInfo.fMask = NULL;
+		shExecInfo.hwnd = NULL;
+		shExecInfo.lpVerb = L"open";
+		shExecInfo.lpFile = fName;
+		shExecInfo.lpParameters = L"/Open";
+		shExecInfo.lpDirectory = dName;
+		shExecInfo.nShow = SW_SHOWNORMAL;
+		shExecInfo.hInstApp = NULL;
+
+		ShellExecuteEx(&shExecInfo);
+	}
+	else // windows VISTA
+	{
+		QProcess proc( this );
+		string cmdName;
+		if (TeConvertToUpperCase (type) == ".EXE")
+		{
+			cmdName = tempName;
+			proc.addArgument(cmdName.c_str());
+			proc.start();
+			return;
+		}
+		// find user defined current application
+		string fileType = type;
+		string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\";
+
+		key += fileType + "\\UserChoice"; // para vista dever ser essa opcao (testar)
+		string keyFile = getSystemKeyValue(HKEY_CURRENT_USER, key, "Progid"); // para vista dever ser essa opcao (testar)
+		if(keyFile.empty()) // para vista dever ser essa opcao (testar)
+			keyFile = getKeyFileFromProgId(fileType); // para vista dever ser essa opcao (testar)
+
+		keyFile += "\\shell\\open\\command";		
+		string keycmd = getSystemKeyValue(HKEY_CLASSES_ROOT, keyFile, "");
+		if(keycmd.size() <= 1)
+        {
+ 			QString msg = tr("Sorry! Problem to display midia.\nPlease verify if exist default program associated with this type of midia.");
+            QMessageBox::warning(this, tr("Warning"), msg);
+             return;
+		}
+
+		getCommandToQtProcess(keycmd, cmd);
+		cmdName = cmd;
+		size_t ft;
+		ft = cmdName.find("%");
+		if(ft != string::npos)
+			cmdName.replace(ft, 2, tempName);
+		else
+			cmdName += " " + tempName;
+
+		QString qCmd(cmdName.c_str());
+		qCmd = qCmd.simplifyWhiteSpace();
+		proc.addArgument(qCmd);
+		proc.start();
+
+		//proc.clearArguments();
+		//proc.addArgument( "\"C:\\Program Files\\Adobe\\Photoshop Album Starter Edition\\3.2\\Apps\\ComponentLauncher.exe\" module=jpegviewer bg params \"filepath=c:\\TERRAVIEW_TEMP\\winter.jpg\"" );
+		////proc.addArgument( "\"C:\\Program Files\\Adobe\\Photoshop Album Starter Edition\\3.2\\Apps\\ComponentLauncher.exe\" module=jpegviewer bg params filepath=c:\\TERRAVIEW_TEMP\\winter.jpg" );
+		//proc.start();
+
+	}
+
+#else
+    string command;
+    string name = file;
+    //Mount the vector of directory paths that are
+    //stored in the PATH environment variable
+    string path =  getenv("PATH");
+    vector<string> dirVector;
+    string dirPath;
+    size_t idx = 0;
+    size_t len = path.find(':', idx);
+    while (len != string::npos)
+    {
+        dirPath = path.substr(idx, len-idx);
+        dirVector.push_back(dirPath);
+        idx = len+1;
+        len = path.find(':', idx);
+    }
+
+
+    // get the last directory path
+    idx = path.rfind(':', path.size());
+    dirPath = path.substr(idx+1, path.size());
+    dirVector.push_back(dirPath);
+       
+	string fs; 
+    if(type != ".URL")
+	{
+        bool exists = false;
+        for (unsigned int i = 0; i < dirVector.size(); ++i)
+        {
+			fs = dirVector[i] + "/konqueror";
+            QFile file(fs.c_str());
+            if (file.exists() == true)
+            {
+                exists = true;
+                break;
+            }
+        }
+        if (exists == true)
+            command = "konqueror " + name + " &";
+        else
+        {
+			QString msg = tr("The program konqueror used to display your media is not") + "\n";
+			msg += tr("present in your PATH environment variable or KDE is not installed!");
+            QMessageBox::warning(this, tr("Warning"), msg);
+             return;
+        }      
+    }
+    else
+    {
+		tempName = tempName.substr(0, tempName.size()-4);
+		name = tempName;
+
+        unsigned int i;
+        for (i = 0; i < dirVector.size(); ++i)
+        {
+			QString qfs = dirVector[i].c_str();
+			qfs += "/netscape";
+            QFile file(qfs);
+            if (file.exists() == true)
+            {
+                command = "netscape -remote 'openURL(" + name + ")' &";              
+                break;
+            }
+        }
+
+        if (command.empty() == true)
+        {
+            for (i = 0; i < dirVector.size(); ++i)
+            {
+				QString qfs = dirVector[i].c_str();
+				qfs += "/mozilla";
+                QFile file(qfs);
+                if (file.exists() == true)
+                {
+                    command = "mozilla -remote 'openURL(" + name + ")' &";
+                    break;
+                }
+            }
+        }
+         
+        if (command.empty() == true)
+        {
+            for (i = 0; i < dirVector.size(); ++i)
+            {
+				QString qfs = dirVector[i].c_str();
+				qfs += "/konqueror";
+				QFile file(qfs);
+                if (file.exists() == true)
+                {
+                    command = "konqueror " + name + " &";
+                    break;
+                }
+           }
+        }
+        
+        if (command.empty() == true)
+        {
+			QString msg = tr("The program konqueror used to display your media is not") + "\n";
+			msg += tr("present in your PATH environment variable or KDE is not installed!");
+            QMessageBox::warning(this, tr("Warning"), msg);
+             return;
+        }
+    }
+    
+    system(command.c_str());
+#endif
+}
diff --git a/src/terralib/drivers/qt/TeQtShowMedia.h b/src/terralib/drivers/qt/TeQtShowMedia.h
old mode 100755
new mode 100644
index 649234c..d308a9e
--- a/src/terralib/drivers/qt/TeQtShowMedia.h
+++ b/src/terralib/drivers/qt/TeQtShowMedia.h
@@ -1,83 +1,97 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTSHOWMEDIA_H
-#define  __TERRALIB_INTERNAL_QTSHOWMEDIA_H
-
-#ifdef WIN32
-#include <windows.h>
-#endif
-#include <TeDatabase.h>
-#include <qtable.h>
-#include <urlWindow.h> 
-#include <mediaDescription.h> 
-#include <qpopupmenu.h>
-#include <TeDatabaseUtils.h>
-#include <TeQtGrid.h>
-#include <string>
-using namespace std;
-
-class TeQtShowMedia : public QTable
-{
-	Q_OBJECT
-	QPopupMenu*			popup_;
-	URLWindow*			urlWindow_;
-	MediaDescription*	descriptionWindow_;
-
-public:
-	int				row_;
-	string			id_;
-	string			table_;
-	TeDatabase*		db_;
-	TeLayer*		layer_;
-	int				nattrs_;
-	bool			cmdLocal_;
-	TeQtShowMedia(QWidget* parent = 0, const char* name = 0);
-
-	~TeQtShowMedia();
-	void moveDown();
-	void init(string objId, TeAppTheme* theme, TeQtGrid* grid);
-
-protected:
-	bool eventFilter(QObject*, QEvent*);
-#ifdef WIN32
-	void getCommand(string keycom, string& cmd, vector<string>& varg);
-	void getCommandToQtProcess(string keycom, string& cmd);
-	string getSystemKeyValue(HKEY hkey, string key, string value);
-	string TeQtShowMedia :: getString(TCHAR* u, DWORD size);
-	void charToUnicode(const char* c, TCHAR* u);
-	string QueryKey(HKEY hKey); 
-	string getKeyFileFromProgId(string& fileType);
-	bool isVistaOperatingSystem();
-#endif
-
-public slots:
-	void slotpressed(int, int, int, const QPoint&);
-	void slotDoubleClicked(int, int, int, const QPoint&);
-	void slotShow();
-	void slotShowFile(string file);
-	void slotInsert(QString& dir);
-	void slotInsertURL();
-	void slotRemove();
-	void slotSetDefault();
-	void slotDescription();
-};
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTSHOWMEDIA_H
+#define  __TERRALIB_INTERNAL_QTSHOWMEDIA_H
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+#include <TeDatabase.h>
+#include <qtable.h>
+#include <urlWindow.h> 
+#include <mediaDescription.h> 
+#include <qpopupmenu.h>
+#include <TeDatabaseUtils.h>
+#include <TeQtGrid.h>
+
+#include <TeAppUtilsDefines.h>
+
+#include <string>
+using namespace std;
+
+class TLAPPUTILS_DLL TeQtShowMedia : public QTable
+{
+	Q_OBJECT
+	QPopupMenu*			popup_;
+	URLWindow*			urlWindow_;
+	MediaDescription*	descriptionWindow_;
+
+public:
+	int				row_;
+	string			id_;
+	string			table_;
+	TeDatabase*		db_;
+	TeLayer*		layer_;
+	int				nattrs_;
+	bool			cmdLocal_;
+	TeQtShowMedia(QWidget* parent = 0, const char* name = 0);
+
+	~TeQtShowMedia();
+	void moveDown();
+	void init(string objId, TeAppTheme* theme, TeQtGrid* grid);
+
+protected:
+	bool eventFilter(QObject*, QEvent*);
+#ifdef WIN32
+	void getCommand(string keycom, string& cmd, vector<string>& varg);
+	void getCommandToQtProcess(string keycom, string& cmd);
+	string getSystemKeyValue(HKEY hkey, string key, string value);
+	string getString(TCHAR* u, DWORD size);
+	void charToUnicode(const char* c, TCHAR* u);
+	string QueryKey(HKEY hKey); 
+	string getKeyFileFromProgId(string& fileType);
+	bool isVistaOperatingSystem();
+#endif
+
+	virtual bool	isIPAddress(const std::string &value);
+
+	virtual std::string getCompleteIPAddress(const std::string &value);
+
+	virtual std::string removeURLHead(const std::string &value);
+
+	virtual bool isHTTPS(const std::string &value);
+
+	virtual bool isURLFile(const std::string &value);
+
+
+public slots:
+	void slotpressed(int, int, int, const QPoint&);
+	void slotDoubleClicked(int, int, int, const QPoint&);
+	void slotShow();
+	void slotShowFile(string file);
+	void slotInsert(QString& dir);
+	void slotInsertURL();
+	void slotRemove();
+	void slotSetDefault();
+	void slotDescription();
+};
+#endif
diff --git a/src/terralib/drivers/qt/TeQtTable.cpp b/src/terralib/drivers/qt/TeQtTable.cpp
old mode 100755
new mode 100644
index 9ab1954..c342e2c
--- a/src/terralib/drivers/qt/TeQtTable.cpp
+++ b/src/terralib/drivers/qt/TeQtTable.cpp
@@ -1,314 +1,314 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-************************************************************************************/
-#include "TeQtTable.h"
-#include <qmessagebox.h>
-#include <qapplication.h>
-#include <TeDatabase.h>
-
-TeQtTable::TeQtTable(QWidget* parent, QString name)
-	: QTable(parent, name)
-{
-	gridX_ = -1;
-	gridY_ = -1;
-	iLine_ = -1;
-	fLine_ = -1;
-	iCol_ = -1;
-	fCol_ = -1;
-	gridWidth_  = -1;
-	gridHeight_ = -1;
-	portal_ = 0;
-	db_ = 0;
-	doRepaint_ = true;
-
-	setNumCols(0);
-	setNumRows(0);
-	setSelectionMode(QTable::NoSelection);
-}
-
-TeQtTable::~TeQtTable()
-{
-	if (portal_)
-	{
-		delete portal_;
-		portal_ = 0;
-	}
-}
-
-
-void TeQtTable::openTable (TeDatabase* db, string& table)
-{
-	int i, numRows, nCols;
-
-	doRepaint_ = false; // don�t repaint
-
-	if (table.empty() || db == 0)
-		return;
-
-	db_ = db;
-
-	if (portal_)
-		delete portal_;
-	portal_= db_->getPortal();
-
-	string s = "SELECT COUNT(*) FROM " + table;
-	if (portal_->query(s) && portal_->fetchRow())
-		numRows = atoi(portal_->getData(0));
-
-	s = "SELECT * FROM " + table;
-	portal_->freeResult();
-	if (!portal_->query(s))
-	{
-		delete portal_;
-		portal_ = 0;
-		return;
-	}
-
-	TeAttributeList& attrList = portal_->getAttributeList();
-	
-	//get the column names
-	nCols = attrList.size();
-	setNumRows(numRows);
-	setNumCols(nCols);
-
-	for (i = 0; i < nCols; ++i)
-		horizontalHeader()->setLabel(i, attrList[i].rep_.name_.c_str());
-
-	// Set the minimum width of the vertical header of the grid
-	char buf[10];
-	sprintf(buf, "%d", numRows);
-	int minw = strlen(buf) + 1;
-	if (minw < 3)
-		minw = 3;
-	verticalHeader()->setMinimumWidth(minw*9); // supposing char width of 9 pixels
-	setLeftMargin(minw*9);
-
-
-	doRepaint_ = true; // do repaint
-
-	int visibleCols = 0;
-	int scVal = horizontalScrollBar()->value();
-	for(i=0; i<numCols(); i++)
-	{
-		if(visibleWidth() < columnPos(i) - scVal)
-			break;
-		visibleCols++;
-	}
-
-	repaint();
-}
-
-
-void TeQtTable::openSql(TeDatabase* db, string& sql)
-{
-	int i, numRows, nCols;
-
-	doRepaint_ = false; // don�t repaint
-
-	if (sql.empty() || db == 0)
-		return;
-
-	db_ = db;
-
-	if (portal_)
-		delete portal_;
-	portal_= db_->getPortal();
-
-	string s = sql;
-
-	if (!portal_->query(s))
-	{
-		delete portal_;
-		portal_ = 0;
-		return;
-	}
-
-	TeAttributeList& attrList = portal_->getAttributeList();
-	numRows = portal_->numRows();
-
-	if(numRows <= 0)
-	{
-		numRows = 0;
-		while (portal_->fetchRow())
-			++numRows;
-	}
-	
-	//get the column names
-	nCols = attrList.size();
-	setNumRows(numRows);
-	setNumCols(nCols);
-
-	for (i = 0; i < nCols; ++i)
-		horizontalHeader()->setLabel(i, attrList[i].rep_.name_.c_str());
-
-	// Set the minimum width of the vertical header of the grid
-	char buf[10];
-	sprintf(buf, "%d", numRows);
-	int minw = strlen(buf) + 1;
-	if (minw < 3)
-		minw = 3;
-	verticalHeader()->setMinimumWidth(minw*9); // supposing char width of 9 pixels
-	setLeftMargin(minw*9);
-
-
-	doRepaint_ = true; // do repaint
-
-	int visibleCols = 0;
-	int scVal = horizontalScrollBar()->value();
-	for(i=0; i<numCols(); i++)
-	{
-		if(visibleWidth() < columnPos(i) - scVal)
-			break;
-		visibleCols++;
-	}
-
-	repaint();
-}
-
-void TeQtTable::freePortal()
-{
-	gridX_ = -1;
-	gridY_ = -1;
-	iLine_ = -1;
-	fLine_ = -1;
-	iCol_ = -1;
-	fCol_ = -1;
-	gridWidth_  = -1;
-	gridHeight_ = -1;
-	portal_ = 0;
-	db_ = 0;
-	doRepaint_ = true;
-
-	if (portal_)
-	{
-		delete portal_;
-		portal_ = 0;
-	}
-
-	setNumRows(0);
-	setNumCols(0);
-}
-
-void TeQtTable::deletePortal()
-{
-	if (portal_)
-		delete portal_;
-	portal_ = 0;
-}
-
-void TeQtTable::drawContents (QPainter *qp, int clipx, int clipy, int clipw, int cliph)
-{
-	if(doRepaint_ == false)
-		return;
-
-	update();
-	QTable :: drawContents(qp, clipx, clipy, clipw, cliph);
-}
-
-void TeQtTable::update ()
-{
-	if(portal_ == 0)
-		return;
-
-	int	i, j;
-
-	int gridY = contentsY();
-	int gridX = contentsX();
-
-	int gridHeight = visibleHeight(); 
-	int gridWidth = visibleWidth(); 
-
-	if (gridX_ == gridX && gridY_ == gridY &&
-		gridHeight_ == gridHeight && 
-		gridWidth_ == gridWidth)
-		return;
-
-	gridX_ = gridX;
-	gridY_ = gridY;
-	gridHeight_ = gridHeight;
-	gridWidth_ = gridWidth;
-		
-// clear cells
-	doRepaint_ = false; // do not repaint
-	if (iLine_ >= 0 && iCol_ >= 0)
-	{
-		for (i = iLine_; i <= fLine_; ++i)
-		{
-			for (j = iCol_; j <= fCol_; ++j)
-			{
-				if(item(i, j))
-					clearCell(i, j);
-			}
-		}
-	}
-
-	iLine_ = rowAt(gridY_);
-	iCol_  = columnAt(gridX_);
-	int visibleLines = rowAt(gridHeight_);
-	if (visibleLines == -1)
-		visibleLines = numRows();
-
-	int visibleCols = 0;
-	int scVal = horizontalScrollBar()->value();
-	for(i=iCol_; i<numCols(); i++)
-	{
-		if(gridWidth_ < columnPos(i) - scVal)
-			break;
-		visibleCols++;
-	}
-
-	if (iLine_ < 0 || iCol_ < 0)
-	{
-		gridX_ = gridY_ = iLine_ = fLine_ = iCol_ = fCol_ = -1;
-		doRepaint_ = true;
-		return;
-	}
-
-	fLine_ = iLine_ + visibleLines;
-	if (fLine_ > numRows() - 1)
-		fLine_ = numRows() - 1;
-	fCol_ = iCol_ + visibleCols - 1;
-
-	for (i = iLine_; i <= fLine_ ; ++i)
-	{
-		if (!portal_->fetchRow(i))
-			return;
-
-		string s;
-		for (j = iCol_; j <= fCol_; ++j)
-		{
-			s = portal_->getData(j);
-			setText(i, j, s.c_str());
-
-			if(i == fLine_ && j == fCol_- 1)
-			{
-				doRepaint_ = true; // do repaint
-				updateCell(i, j);
-			}
-		}
-	}
-
-	doRepaint_ = true; // do repaint
-}
-
-
-
-
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+************************************************************************************/
+#include "TeQtTable.h"
+#include <qmessagebox.h>
+#include <qapplication.h>
+#include <TeDatabase.h>
+
+TeQtTable::TeQtTable(QWidget* parent, QString name)
+	: QTable(parent, name)
+{
+	gridX_ = -1;
+	gridY_ = -1;
+	iLine_ = -1;
+	fLine_ = -1;
+	iCol_ = -1;
+	fCol_ = -1;
+	gridWidth_  = -1;
+	gridHeight_ = -1;
+	portal_ = 0;
+	db_ = 0;
+	doRepaint_ = true;
+
+	setNumCols(0);
+	setNumRows(0);
+	setSelectionMode(QTable::NoSelection);
+}
+
+TeQtTable::~TeQtTable()
+{
+	if (portal_)
+	{
+		delete portal_;
+		portal_ = 0;
+	}
+}
+
+
+void TeQtTable::openTable (TeDatabase* db, string& table)
+{
+	int i, numRows, nCols;
+
+	doRepaint_ = false; // don�t repaint
+
+	if (table.empty() || db == 0)
+		return;
+
+	db_ = db;
+
+	if (portal_)
+		delete portal_;
+	portal_= db_->getPortal();
+
+	string s = "SELECT COUNT(*) FROM " + table;
+	if (portal_->query(s) && portal_->fetchRow())
+		numRows = atoi(portal_->getData(0));
+
+	s = "SELECT * FROM " + table;
+	portal_->freeResult();
+	if (!portal_->query(s))
+	{
+		delete portal_;
+		portal_ = 0;
+		return;
+	}
+
+	TeAttributeList& attrList = portal_->getAttributeList();
+	
+	//get the column names
+	nCols = attrList.size();
+	setNumRows(numRows);
+	setNumCols(nCols);
+
+	for (i = 0; i < nCols; ++i)
+		horizontalHeader()->setLabel(i, attrList[i].rep_.name_.c_str());
+
+	// Set the minimum width of the vertical header of the grid
+	char buf[10];
+	sprintf(buf, "%d", numRows);
+	int minw = strlen(buf) + 1;
+	if (minw < 3)
+		minw = 3;
+	verticalHeader()->setMinimumWidth(minw*9); // supposing char width of 9 pixels
+	setLeftMargin(minw*9);
+
+
+	doRepaint_ = true; // do repaint
+
+	int visibleCols = 0;
+	int scVal = horizontalScrollBar()->value();
+	for(i=0; i<numCols(); i++)
+	{
+		if(visibleWidth() < columnPos(i) - scVal)
+			break;
+		visibleCols++;
+	}
+
+	repaint();
+}
+
+
+void TeQtTable::openSql(TeDatabase* db, string& sql)
+{
+	int i, numRows, nCols;
+
+	doRepaint_ = false; // don�t repaint
+
+	if (sql.empty() || db == 0)
+		return;
+
+	db_ = db;
+
+	if (portal_)
+		delete portal_;
+	portal_= db_->getPortal();
+
+	string s = sql;
+
+	if (!portal_->query(s))
+	{
+		delete portal_;
+		portal_ = 0;
+		return;
+	}
+
+	TeAttributeList& attrList = portal_->getAttributeList();
+	numRows = portal_->numRows();
+
+	if(numRows <= 0)
+	{
+		numRows = 0;
+		while (portal_->fetchRow())
+			++numRows;
+	}
+	
+	//get the column names
+	nCols = attrList.size();
+	setNumRows(numRows);
+	setNumCols(nCols);
+
+	for (i = 0; i < nCols; ++i)
+		horizontalHeader()->setLabel(i, attrList[i].rep_.name_.c_str());
+
+	// Set the minimum width of the vertical header of the grid
+	char buf[10];
+	sprintf(buf, "%d", numRows);
+	int minw = strlen(buf) + 1;
+	if (minw < 3)
+		minw = 3;
+	verticalHeader()->setMinimumWidth(minw*9); // supposing char width of 9 pixels
+	setLeftMargin(minw*9);
+
+
+	doRepaint_ = true; // do repaint
+
+	int visibleCols = 0;
+	int scVal = horizontalScrollBar()->value();
+	for(i=0; i<numCols(); i++)
+	{
+		if(visibleWidth() < columnPos(i) - scVal)
+			break;
+		visibleCols++;
+	}
+
+	repaint();
+}
+
+void TeQtTable::freePortal()
+{
+	gridX_ = -1;
+	gridY_ = -1;
+	iLine_ = -1;
+	fLine_ = -1;
+	iCol_ = -1;
+	fCol_ = -1;
+	gridWidth_  = -1;
+	gridHeight_ = -1;
+	portal_ = 0;
+	db_ = 0;
+	doRepaint_ = true;
+
+	if (portal_)
+	{
+		delete portal_;
+		portal_ = 0;
+	}
+
+	setNumRows(0);
+	setNumCols(0);
+}
+
+void TeQtTable::deletePortal()
+{
+	if (portal_)
+		delete portal_;
+	portal_ = 0;
+}
+
+void TeQtTable::drawContents (QPainter *qp, int clipx, int clipy, int clipw, int cliph)
+{
+	if(doRepaint_ == false)
+		return;
+
+	update();
+	QTable :: drawContents(qp, clipx, clipy, clipw, cliph);
+}
+
+void TeQtTable::update ()
+{
+	if(portal_ == 0)
+		return;
+
+	int	i, j;
+
+	int gridY = contentsY();
+	int gridX = contentsX();
+
+	int gridHeight = visibleHeight(); 
+	int gridWidth = visibleWidth(); 
+
+	if (gridX_ == gridX && gridY_ == gridY &&
+		gridHeight_ == gridHeight && 
+		gridWidth_ == gridWidth)
+		return;
+
+	gridX_ = gridX;
+	gridY_ = gridY;
+	gridHeight_ = gridHeight;
+	gridWidth_ = gridWidth;
+		
+// clear cells
+	doRepaint_ = false; // do not repaint
+	if (iLine_ >= 0 && iCol_ >= 0)
+	{
+		for (i = iLine_; i <= fLine_; ++i)
+		{
+			for (j = iCol_; j <= fCol_; ++j)
+			{
+				if(item(i, j))
+					clearCell(i, j);
+			}
+		}
+	}
+
+	iLine_ = rowAt(gridY_);
+	iCol_  = columnAt(gridX_);
+	int visibleLines = rowAt(gridHeight_);
+	if (visibleLines == -1)
+		visibleLines = numRows();
+
+	int visibleCols = 0;
+	int scVal = horizontalScrollBar()->value();
+	for(i=iCol_; i<numCols(); i++)
+	{
+		if(gridWidth_ < columnPos(i) - scVal)
+			break;
+		visibleCols++;
+	}
+
+	if (iLine_ < 0 || iCol_ < 0)
+	{
+		gridX_ = gridY_ = iLine_ = fLine_ = iCol_ = fCol_ = -1;
+		doRepaint_ = true;
+		return;
+	}
+
+	fLine_ = iLine_ + visibleLines;
+	if (fLine_ > numRows() - 1)
+		fLine_ = numRows() - 1;
+	fCol_ = iCol_ + visibleCols - 1;
+
+	for (i = iLine_; i <= fLine_ ; ++i)
+	{
+		if (!portal_->fetchRow(i))
+			return;
+
+		string s;
+		for (j = iCol_; j <= fCol_; ++j)
+		{
+			s = portal_->getData(j);
+			setText(i, j, s.c_str());
+
+			if(i == fLine_ && j == fCol_- 1)
+			{
+				doRepaint_ = true; // do repaint
+				updateCell(i, j);
+			}
+		}
+	}
+
+	doRepaint_ = true; // do repaint
+}
+
+
+
+
+
diff --git a/src/terralib/drivers/qt/TeQtTable.h b/src/terralib/drivers/qt/TeQtTable.h
old mode 100755
new mode 100644
index f690bf1..77a139e
--- a/src/terralib/drivers/qt/TeQtTable.h
+++ b/src/terralib/drivers/qt/TeQtTable.h
@@ -1,69 +1,71 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef TEQTTABLE_H
-#define TEQTTABLE_H
-
-#include <qtable.h>
-#include <string>
-using namespace std;
-
-class TeDatabase;
-class TeDatabasePortal;
-
-class TeQtTable : public QTable
-{
-protected:
-	TeDatabase			*db_;
-	TeDatabasePortal	*portal_;
-	int					gridX_, gridY_;
-	int					iLine_, fLine_;
-	int					iCol_, fCol_;
-	int					gridWidth_, gridHeight_;
-	bool				doRepaint_;
-
-	virtual void drawContents (QPainter *qp, int clipx, int clipy, int clipw, int cliph);
-
-	void update();
-
-public:
-
-    TeQtTable(QWidget *parent, QString name);
-
-	virtual ~TeQtTable();
-
-	virtual void endEdit(int row, int col, bool accept, bool replace)
-	{
-		QTable::endEdit(row, col, accept, replace);
-	}
-
-	void openTable(TeDatabase* db, string& table);
-
-	void openSql(TeDatabase* db, string& sql);
-
-	void freePortal();
-
-	void deletePortal();
-
-	TeDatabasePortal* getPortal() {return portal_;}
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef TEQTTABLE_H
+#define TEQTTABLE_H
+
+#include <TeAppUtilsDefines.h>
+
+#include <qtable.h>
+#include <string>
+using namespace std;
+
+class TeDatabase;
+class TeDatabasePortal;
+
+class TLAPPUTILS_DLL TeQtTable : public QTable
+{
+protected:
+	TeDatabase			*db_;
+	TeDatabasePortal	*portal_;
+	int					gridX_, gridY_;
+	int					iLine_, fLine_;
+	int					iCol_, fCol_;
+	int					gridWidth_, gridHeight_;
+	bool				doRepaint_;
+
+	virtual void drawContents (QPainter *qp, int clipx, int clipy, int clipw, int cliph);
+
+	void update();
+
+public:
+
+    TeQtTable(QWidget *parent, QString name);
+
+	virtual ~TeQtTable();
+
+	virtual void endEdit(int row, int col, bool accept, bool replace)
+	{
+		QTable::endEdit(row, col, accept, replace);
+	}
+
+	void openTable(TeDatabase* db, string& table);
+
+	void openSql(TeDatabase* db, string& sql);
+
+	void freePortal();
+
+	void deletePortal();
+
+	TeDatabasePortal* getPortal() {return portal_;}
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtTerraStat.cpp b/src/terralib/drivers/qt/TeQtTerraStat.cpp
old mode 100755
new mode 100644
index e02fc77..5fedb1d
--- a/src/terralib/drivers/qt/TeQtTerraStat.cpp
+++ b/src/terralib/drivers/qt/TeQtTerraStat.cpp
@@ -1,1276 +1,1276 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-
-#include "TeSTElementSet.h"
-#include "TeKernelParams.h"
-#include "TeQtTerraStat.h"
-#include "TeKernelFunctions.h"
-#include "TeStatDataStructures.h"
-#include "TeQtDatabasesListView.h"
-///#include "TeImportRaster.h"
-#include "TeDecoderDatabase.h"
-#include "TeQtViewsListView.h"
-#include "TeQtGrid.h"
-#include "TeSTEFunctionsDB.h"
-#include "TeWaitCursor.h"
-#include "TeColorUtils.h"
-#include "TeDatabaseUtils.h"
-#include "TeKernelParams.h"
-#include "TeQtLayerItem.h"
-#include "TeQtViewItem.h"
-#include "TeQtThemeItem.h"
-#include <qobject.h>
-#include <qapplication.h>
-
-
-string getKernelFunction (TeKernelFunctionType t)
-{
-	string result;
-
-	switch (t)
-	{
-		case TeKQuartic:
-      result = QObject::tr("Quartic").latin1();
-			break;
-		case TeKNormal:
-			result = QObject::tr("Normal").latin1();
-			break;
-		case TeKUniform:
-			result = QObject::tr("Uniform").latin1();
-			break;
-		case TeKTriangular:
-			result = QObject::tr("Triangular").latin1();
-			break;
-		case TeKNegExponential:
-			result = QObject::tr("NegExponential").latin1();
-			break;
-	}
-	return result;
-}
-
-string getKernelComputeType (TeKernelComputeType t)
-{
-	string result;
-
-	switch (t)
-	{
-		case TeKDensity:
-			result = QObject::tr("Density").latin1();
-			break;
-		case TeKProbability:
-			result = QObject::tr("Probability").latin1();
-			break;
-		case TeKMovingAverage:
-			result = QObject::tr("Spatial Moving Average").latin1();
-			break;
-	}
-	return result;
-}
-
-string getCombinationType (TeKernelCombinationType /* t */)
-{
-	string result;
-	result = "DESCONHECIDO";
-	return result;
-}
-
-
-/**
- * Retorna legenda para kernel
- **/
-bool getKernelLegend(TeKernelParams& par, vector<string>& result)
-{
-	string legend = QObject::tr("Kernel parameters").latin1();
-	result.push_back(legend); 
-	string numb = "";
-	
-	legend = QObject::tr("Event theme").ascii()+ numb +" : "+ par.eventThemeName1_ ;
-	result.push_back(legend);
-	
-	if(!par.intensityAttrName1_.empty())
-	{
-		legend = QObject::tr("Attribute name").ascii()+ numb +" : "+ par.intensityAttrTable1_+"."+ par.intensityAttrName1_;
-		result.push_back(legend);
-	}
-
-  if (par.radiusValue1_ > 0) {
-	  legend = QObject::tr("Radius value").ascii()+ numb +" : "+ Te2String(par.radiusValue1_);
-  }
-  else {
-    legend = QObject::tr("Adaptive radius").ascii();
-  }
-  result.push_back(legend);
-
-  legend = QObject::tr("Compute: ").ascii()+getKernelComputeType(par.computeType1_);
-  result.push_back(legend);
-
-  legend = QObject::tr("Function: ").ascii()+getKernelFunction(par.kernelFunction1_);
-  result.push_back(legend);
-
-  return true;
-}
-
-
-/**
- * Grava uma coluna na tabela de atributos associada a um STOSet.
- * Nome da coluna eh o mesmo nome da propriedade
- **/
-bool insertPropertyColumn(TeSTElementSet& stoSet,
-                          const string& tableName,
-                          const string&  columnName) 
-{
-	
-	
- 	vector<int> index;
-	int ind = stoSet.getAttributeIndex(columnName);
-	if(ind<0)
-	{
-		ind = stoSet.getAttributeIndex(tableName+"."+columnName);
-		if(ind>-1)
-			index.push_back (ind);
-	}
-	else
-		index.push_back (ind);
-  
-	if(!index.empty())
-	{
-		if (!TeUpdateDBFromSet (&stoSet, tableName, &index)) 
-			return false;
-	}
-	else
-	{
-		if (!TeUpdateDBFromSet (&stoSet, tableName)) 
-			return false;
-	}
-	return true;
-}
-
-/**
- * Grava uma coluna na tabela de atributos associada a um STOSet.
- * Nome da coluna eh o mesmo nome da propriedade
- **/
-bool insertPropertyColumn(TeSTStatInstanceSet& stSet,
-                          int idxDoubleProp,
-                          TeTheme* theme,
-                          const string& tableName,
-                          const string& columnName) {
-
-  TeProperty prop;
-
-  prop.attr_.rep_.name_ = columnName;
-  prop.attr_.rep_.type_ = TeREAL;
-  double value;
-  TePropertyVector pVect;
-  pVect.push_back(prop);
-
-  //Constroi um de outro
-  TeSTElementSet rs(theme);
-  rs.addProperty(prop.attr_);
-
-  TeSTStatInstanceSet::iterator ito = stSet.begin();
-  while (ito != stSet.end()) {
-
-    //Cria uma nova propriedade no objeto
-    (*ito).getDoubleProperty(idxDoubleProp, value);
-    pVect[0].value_ = Te2String(value, STAT_PRECISION);
-    (*ito).properties(pVect);
-    rs.insertSTInstance(*ito);
-    ++ito;
-  }
-
-  return insertPropertyColumn(rs, tableName, columnName) ;
-}
-
-
-/***
- * Cria um STOSet a partir de um tema e um conjunto de atributos,
- * colocando todas as tabelas do TEMA
- ***/
-bool createSTOSetFromTheme(TeTheme* theme, 
-                              vector<string>& attributes,
-                              TeSTElementSet* rs) 
-{
-	rs->setTheme(theme);
-	return TeSTOSetBuildDB(rs, true, false, attributes);
-}
-
-
-/***
- * Cria um STOSet a partir de um tema e um conjunto de atributos,
- * colocando todas as tabelas do TEMA
- ***/
-bool createSTOStatSetFromTheme(TeTheme* theme, 
-                               vector<string>& attributes,
-                               int additionalDouble,
-                               TeSTStatInstanceSet* rs) {
-
-  TeSTElementSet stoSet(theme);
-   if (!TeSTOSetBuildDB(&stoSet, true, false, attributes))
-     return false;
-   rs->Copy(stoSet, attributes.size(), additionalDouble);
-   return true;
-
-}
-
-TeKernelMethod::~TeKernelMethod()
-{
-	if (evSet1_)
-		delete (TePointTInstanceSet *)evSet1_;
-	
-	if (evSet2_)
-		delete (TePointTInstanceSet *)evSet2_;
-	
-	if(regSet_ && (isGridEv_ || isGridReg_))
-	{
-		delete (TeKernelGridSupport*)regSet_ ;
-	}
-	else if (regSet_)
-	{
-		delete (TeSTStatInstanceSet*)regSet_;
-	}
-	regSet_=0;
-	evSet2_=0;
-	evSet1_=0;
-}
-
-void TeKernelMethod::error(TeKernelErrorType type, string message, QWidget* parent) {
-
-  QString title;
-  switch (type) {
-  case Uerror:
-	  title = tr("Unexpected Error");
-    break;
-  case Error:
-		title = tr("Error");
-    break;
-  case Warning:
-		title = tr("Warning");
-    break;
-  }
-
-  if (parent) {
-	  QMessageBox::information(parent, title, tr(message.c_str()));
-  }
-  else {
-    QMessageBox::information(0, (title), tr(message.c_str())); 
-  }
-
-}
-
-/**
- * Defines name, theme pointer and id for a given theme 
- * id = 0 -- support theme
- * id = 1,2 -- first and second event theme
- **/
-bool TeKernelMethod::setTheme(string name, int id, TeView* view) {
-  if (id == 0) {
-    params_.supportThemeName_ = name;
-    regTheme_ = view->get(params_.supportThemeName_);
-    if (evTheme1_ == NULL) {
-      return false;
-    }
-	params_.supportThemeId_ = regTheme_->id(); 
-  }
-  else if (id == 1) {
-    params_.eventThemeName1_ = name;
-
-    evTheme1_ = view->get(params_.eventThemeName1_);
-    if (evTheme1_ == NULL) {
-      return false;
-    }
-    params_.eventThemeId1_ = evTheme1_->id();
-    
-  }
-  else if (id == 2) {
-    params_.eventThemeName2_ = name;
-
-    evTheme2_ = view->get(params_.eventThemeName2_);
-    if (evTheme2_ == NULL) {
-      return false;
-    }
-    params_.eventThemeId2_ = evTheme2_->id();
-    
-  }
-  return true;
-}
-
-
-enum TeGridType {GridFromSupport, GridFromEvent, GridFromBoth};
-
-
-/**
- * Generates support set from parameters
- *   If grid, generate box
- *   If theme, generate column
- **/
-bool TeKernelMethod::generateSupportSet() {
- 
-  
-  bool isGrid = isGridReg_ || isGridEv_;
-  bool isRatio = (params_.eventThemeId2_ > 0);
-
-  justOnePolygon_ = false;
-
-  //support set is from type TeKernelGridSupport
-  if (isGrid) 
-  {
-
-    //Computes grid boundary and defines if just one set.
-    TeGridType t;
-    TeBox      gridBound;
-
-    if (isGridEv_)
-    {
-      if (isRatio)
-        t = GridFromBoth;
-      else
-        t = GridFromEvent;
-    }
-    else
-      t = GridFromSupport;
- 
-    if (db_ == NULL) {
-      error(Uerror, tr("There is no database. Please, contact support!").latin1());
-      return false;
-    }
-
-    TeBox bound1;
-    TeBox bound2;
-    
-    switch(t) {
-    case GridFromSupport:
-      if (regTheme_ == NULL) {
-		error(Uerror, tr("There is no support theme. Please, contact support!").latin1());
-        return false;
-      }
-	  gridBound = regTheme_->getThemeBox();
-      break;
-    case GridFromEvent:
-      if (evTheme1_ == NULL) {
-		error(Uerror, tr("There is no event theme. Please, contact support!").latin1());
-        return false;
-      }
-	  gridBound = evTheme1_->getThemeBox();
-      break;
-    case GridFromBoth:
-      if ((evTheme1_ == NULL) || (evTheme2_ == NULL)) {
-		error(Uerror, tr("There is no event theme. Please, contact support!").latin1());
-        return false;
-      }
-
-      bound1 = evTheme1_->getThemeBox();
-      bound2 = evTheme2_->getThemeBox();
-    
-      //Box is the rectangle that envolves both boxes
-      gridBound.x1_ = (bound1.x1_ < bound2.x1_) ? bound1.x1_ : bound2.x1_;
-      gridBound.y1_ = (bound1.y1_ < bound2.y1_) ? bound1.y1_ : bound2.y1_;
-      gridBound.x2_ = (bound1.x2_ > bound2.x2_) ? bound1.x2_ : bound2.x2_;
-      gridBound.y2_ = (bound1.y2_ < bound2.y2_) ? bound1.y2_ : bound2.y2_;
-
-      break;
-
-    default:
-		error(Uerror, tr("Invalid type. Please, contact support!").latin1());
-      return false;
-      break;
-    }
-    
-    
-    if (!gridBound.isValid()) {
-		error(Uerror, tr("Invalid grid box. Please, contact support!").latin1());
-        return false;
-    }
-
-
-    //Verifies if it has just one polygon
-    if (t == GridFromSupport) {
-
-      TeDatabasePortal* portal = this->db_->getPortal();
-
-      TeLayer* l = regTheme_->layer();
-
-      if (l->hasGeometry(TePOLYGONS))
-      {
-        string count = "SELECT COUNT(*) FROM " + l->tableName(TePOLYGONS);
-        count += ", " + regTheme_->collectionTable() + " WHERE ";
-        count += l->tableName(TePOLYGONS) + ".object_id = ";
-        count += regTheme_->collectionTable() + ".c_object_id";
-        portal->freeResult();
-        if(portal->query(count))
-        {
-          if(portal->fetchRow())
-          {
-            count = portal->getData(0);		
-          }
-          else {
- 			error(Uerror, tr("There is no polygons. Please, contact support!").latin1());
-          }
-        }
-
-        int nPol = atoi(count.c_str());
-        this->justOnePolygon_ = (nPol == 1);
-		delete portal;
-      }
-    }
-
-    TeProjection* proj = db_->loadProjection(this->evTheme1_->layer()->projection()->id());
-
-    if (proj == NULL) {
- 			error(Uerror, tr("There is no projection. Please, contact support!").latin1());
-       return false;
-    }
-	if (this->params_.eventThemeId2_ > 0) // if it is kernel ratio
-		regSet_ = new TeKernelGridSupport(gridBound, gridCols_, proj, 2);   
-	else
-		regSet_ = new TeKernelGridSupport(gridBound, gridCols_, proj);   
-  }
-  //Gera grid irregular a partir de poligonos do layer
-  else {
-    
-    //Define regioes a partir de tema -- aplicar restricao
-    if (regTheme_ == NULL) {
- 		error(Uerror, tr("There is no support theme. Please, contact support!").latin1());
-      return false;
-    }
-
-	//Generates set from theme
-    vector<string> empty;
-    //TeSTStatInstanceSet* rs = new TeSTStatInstanceSet();
-	regSet_ = new TeSTStatInstanceSet();
-    createSTOStatSetFromTheme(regTheme_, empty, 2, (TeSTStatInstanceSet*)regSet_);
-    resName_ = string(this->params_.supportThemeAttr_);
-    //regSet_ = rs;
-  }
-  return true;
-}
-
-
-/**
- * Generates event set from theme. If there is an attribute, set is initialize with it.
- * Otherwise, just geometries are loaded. Geometries may be points or polygons
- **/
-bool TeKernelMethod::generateEventSet(int which) {
-
-  bool     isPoint;
-  TeTheme* theme;
-  TeLayer* layer;
-  string   table;
-  string   column;
-    
-  if (which == 1) {
-    isPoint = this->isPoint1_;
-    theme = this->evTheme1_;
-    if (this->evTheme1_ == NULL) {
- 		error(Uerror, tr("There is no event set for the kernel. Please, contact support!").latin1());
-      return false;
-    }
-    layer = this->evTheme1_->layer();
-    if (layer == NULL) {
- 		error(Uerror, tr("There is no layer for the theme. Please, contact support!").latin1());
-      return false;
-    }
-    table = this->params_.intensityAttrTable1_;
-    column = this->params_.intensityAttrName1_;
-  }
-  else if (which == 2) {
-    isPoint = this->isPoint2_;
-    theme = this->evTheme2_;
-    if (this->evTheme2_ == NULL) {
- 		error(Uerror, tr("There is no event set for the kernel. Please, contact support!").latin1());
-      return false;
-    }
-    layer = this->evTheme2_->layer();
-    if (layer == NULL) {
- 		error(Uerror, tr("There is no layer for the theme. Please, contact support!").latin1());
-      return false;
-    }
-    table = this->params_.intensityAttrTable2_;
-    column = this->params_.intensityAttrName2_;
-  }
-  else {
- 		error(Uerror, tr("Invalid event set. Please, contact support!").latin1());
-    return false;
-  }
-  
-  TeWaitCursor wait;
-
-  bool done;
-  vector<string> vecAttr;
-  if (column.compare("")) {
-      vecAttr.push_back(table+"."+column);
-  }
- if (isPoint) {
-
-    //Generates set from theme
-    TePointTInstanceSet* evs = new TePointTInstanceSet();
-    if (vecAttr.size() == 0) {
-      done =  createSTOStatSetFromTheme(theme, vecAttr, 1, evs);
-      //Deve inicializar com 1 toda a propriedade
-      TePointTInstanceSet::iterator itev = evs->begin();
-      while (itev != evs->end()) {
-        (*itev).setDoubleProperty(0, 1.0);
-        ++itev;
-      }
-    }
-    else {
-      done = createSTOStatSetFromTheme(theme, vecAttr, 0, evs);
-    }
-
-    if (!done)
-      return false;
-    if (which == 1) {
-      evSet1_ = evs;
-    }
-    else {
-      evSet2_ = evs;
-    }
-
-  }
-  else {
-
-      //Generates set from theme
-    TePointTInstanceSet* evs = new TePointTInstanceSet();
-    if (vecAttr.size() == 0) {
-      done =  createSTOStatSetFromTheme(theme, vecAttr, 1, evs);
-      //Deve inicializar com 1 toda a propriedade
-      TePointTInstanceSet::iterator itev = evs->begin();
-      while (itev != evs->end()) {
-        (*itev).setDoubleProperty(0, 1.0);
-        ++itev;
-      }
-  }
-  else {
-      done = createSTOStatSetFromTheme(theme, vecAttr, 0, evs);
-    }
-    if (!done)
-      return false;
-    if (which == 1) {
-      evSet1_ = evs;
-    }
-    else {
-      evSet2_ = evs;
-    }
-  }
-  return true;
-}
-
-
-bool TeKernelMethod::call() 
-{
-  bool isGrid = this->isGridEv_ || this->isGridReg_;
-  bool isRatio = this->params_.eventThemeName2_.compare("");
-
-//  bool justOnePolygon = false;
-
-  double totalArea;
-  if (isGrid)  {
-    totalArea = ((TeKernelGridSupport *)regSet_)->totalArea();
-  }
-  else {
-    //SUBSTITUIR
-	  totalArea = TeGeometryArea(regTheme_->getThemeBox());
-  }
-
-  int  totalRegions;
-  if (isGrid) {
-      totalRegions = ((TeKernelGridSupport *)regSet_)->numObjects();
-  }
-  else {
-      totalRegions = ((TeSTStatInstanceSet *)regSet_)->numObjects();
-  }
-
-  if (TeProgress::instance())
-  {
-		TeProgress::instance()->setTotalSteps(totalRegions);
-  }
-
-  //Kernel de razao
-  if (isRatio) {
-   
-   
-    TeStatKernelRatio kerRatio;
-    kerRatio.numReg_ = totalRegions;
-    kerRatio.kComb_ = params_.combinationType_;
-    kerRatio.ktype_ = params_.computeType1_;
-    kerRatio.kfunc1_ = params_.kernelFunction1_;
-    kerRatio.radius1_ = params_.radiusValue1_;
-    kerRatio.kfunc2_ = params_.kernelFunction2_;
-    kerRatio.radius2_ = params_.radiusValue2_;
-    kerRatio.totalArea_ = totalArea;
-
-
-    //Colocar janela com parametros para o usuario confirmar
-
-    if (isGrid) {
-      //Verifica se o iterador eh para um unico poligono
-      if (justOnePolygon_) {
-        TeDatabasePortal* portal = db_->getPortal();
-
-        string count = "SELECT c_object_id FROM " + regTheme_->layer()->tableName(TePOLYGONS)+",";
-        count += regTheme_->collectionTable() + " WHERE ";
-        count += regTheme_->layer()->tableName(TePOLYGONS) + ".object_id = ";
-        count += regTheme_->collectionTable() + ".c_object_id";
-        portal->freeResult();
-        if(portal->query(count))
-        {
-          if(portal->fetchRow())
-          {
-            count = portal->getData(0);		
-          }
-          else {
- 			      error(Uerror, tr("There is no polygons. Please, contact support!").latin1());
-            return false;
-          }
-        }
-		    delete portal;
-        TePolygonSet polygon;
-        if (!regTheme_->layer()->loadGeometrySet(count, polygon)) {
- 		    	error(Uerror, tr("There is no polygon boundary. Please, contact support!").latin1());
-          return false;
-        }
-        boundary_ = polygon.first();
-        if (boundary_.empty()) {
- 		    	error(Uerror, tr("There is no polygon boundary. Please, contact support!").latin1());
-          return false;
-        }
-        return kerRatio.apply(*((TePointTInstanceSet *)evSet1_),
-            *((TePointTInstanceSet *)evSet2_),
-            (*((TeKernelGridSupport *)regSet_)).begin(boundary_), 
-            (*((TeKernelGridSupport *)regSet_)).end(boundary_));
-      }
-      else {
-        return kerRatio.apply(*((TePointTInstanceSet *)evSet1_),
-            *((TePointTInstanceSet *)evSet2_),
-            (*((TeKernelGridSupport *)regSet_)).begin(), 
-            (*((TeKernelGridSupport *)regSet_)).end());
-      }
-    }
-    else {
-       return kerRatio.apply(*((TePointTInstanceSet *)evSet1_), 
-         *((TePointTInstanceSet *)evSet2_),
-          (*((TeSTStatInstanceSet *)regSet_)).begin(), 
-          (*((TeSTStatInstanceSet *)regSet_)).end());
-    }
-  }  
-  //Kernel normal com um unico conjunto
-  else {
-   
-    TeStatKernel kernel;
-    kernel.radius_ = params_.radiusValue1_;
-    kernel.kfunc_ =  params_.kernelFunction1_;
-    kernel.ktype_ = params_.computeType1_;
-    kernel.totalArea_ = totalArea;
-    kernel.numReg_ = totalRegions;
-
-    //Colocar janela com parametros para o usuario confirmar
-
-    if (isGrid) {
-      //Verifica se o iterador eh para um unico poligono
-      if (justOnePolygon_) {
-        TeDatabasePortal* portal = db_->getPortal();
-
-        string count = "SELECT c_object_id FROM " + regTheme_->layer()->tableName(TePOLYGONS)+",";
-        count += regTheme_->collectionTable() + " WHERE ";
-        count += regTheme_->layer()->tableName(TePOLYGONS) + ".object_id = ";
-        count += regTheme_->collectionTable() + ".c_object_id";
-        portal->freeResult();
-        if(portal->query(count))
-        {
-          if(portal->fetchRow())
-          {
-            count = portal->getData(0);		
-          }
-          else {
- 			      error(Uerror, tr("There is no polygons. Please, contact support!").latin1());
-            return false;
-          }
-        }
-		    delete portal;
-        TePolygonSet polygon;
-        if (!regTheme_->layer()->loadGeometrySet(count, polygon)) {
- 		    	error(Uerror, tr("There is no polygon boundary. Please, contact support!").latin1());
-          return false;
-        }
-        boundary_ = polygon.first();
-        if (boundary_.empty()) {
- 		    	error(Uerror, tr("There is no polygon boundary. Please, contact support!").latin1());
-          return false;
-        }
-        return kernel.apply(*((TePointTInstanceSet *)evSet1_),
-            (*((TeKernelGridSupport *)regSet_)).begin(boundary_), 
-            (*((TeKernelGridSupport *)regSet_)).end(boundary_));
-      }
-      else {
-        return kernel.apply(*((TePointTInstanceSet *)evSet1_),
-            (*((TeKernelGridSupport *)regSet_)).begin(), 
-            (*((TeKernelGridSupport *)regSet_)).end());
-      }
-    }
-    else {
-       return kernel.apply(*((TePointTInstanceSet *)evSet1_), 
-          (*((TeSTStatInstanceSet *)regSet_)).begin(), 
-          (*((TeSTStatInstanceSet *)regSet_)).end());
-    }
-  }  
-  return true;
-}
-
- 
-
-/**
- * Apply kernel method based on parameters definition
- *   Create event(s) set
- *   Create support set
- *   Execute suitable kernel method (basic, adaptive, ratio)
- *   Returns support set region
- **/
-bool TeKernelMethod::apply(void*& supportSet, QWidget* parent) 
-{
-	precision_ = -1;
-
-	//Verifies if there is an event theme
-	if (this->evTheme1_ == NULL) {
-		error(Uerror, tr("There is no event set for the kernel. Please, contact support!").latin1());
-		return false;
-	}
-
-	//Verifies if this theme has objects without geometries
-	TeGeomRep rep1 = TePOINTS;
-	if(!isPoint1_)
-		rep1 = TePOLYGONS;
-	if(this->evTheme1_->hasObjectsWithoutGeometries(rep1))
-	{
-		string errorMessage = tr("The theme ").latin1();
-		errorMessage += " - "+ this->evTheme1_->name() +" - "; 
-		errorMessage += tr("\n has occurrences/events without location. ").latin1();
-		errorMessage += tr("\n These occurrences should be removed to generate a valid kernel map.").latin1();  
-		errorMessage += tr("\n Would you like to remove them now? ").latin1();
-		
-		int response = QMessageBox::question(this, tr("Question"), QString(errorMessage.c_str()), tr("Yes"), tr("No")); 
-		if(response == 0)
-		{
-			//remove objetcs without geometries
-			if(!this->evTheme1_->removeObjectsWithoutGeometries(rep1))
-			{
-				QMessageBox::information(this, tr("Information"), 
-					tr("Occurrences/events without location could not be removed.\nTry to generate the theme again."));
-				return false;
-			}
-			
-			QMessageBox::information(this, tr("Information"), 
-					tr("Occurrences/events without location were removed from the theme."));
-		}
-		else
-		{
-			return false;
-		}
-	}
-
-	//Verifies if all themes are in the same projection
-	TeProjection* ev1 = this->evTheme1_->getThemeProjection();
-	if (this->regTheme_ != NULL) 
-	{
-		TeProjection* reg = regTheme_->getThemeProjection();
-		if (!(*reg == *ev1)) {
-			error(Warning,tr("All of the themes should be in the same projection!").latin1(),parent);
-			return false;
-		}
-	}
-
-	if (this->evTheme2_ != NULL) 
-	{
-		TeProjection* ev2 = this->evTheme2_->getThemeProjection();
-		if (!(*ev1 == *ev2)) {
-			error(Warning,tr("All of the themes should be in the same projection!").latin1(),parent);
-			return false;
-		}
-
-		//Verifies if this theme has objects without geometries
-		TeGeomRep rep2 = TePOINTS;
-		if(!isPoint2_)
-			rep2 = TePOLYGONS;
-		if(this->evTheme2_->hasObjectsWithoutGeometries(rep2))
-		{
-			string errorMessage = tr("The theme ").latin1();
-			errorMessage += " - "+ this->evTheme1_->name() +" - "; 
-			errorMessage += tr("\n has occurrences/events without location. ").latin1();
-			errorMessage += tr("\n These occurrences should be removed to generate a valid kernel map.").latin1();  
-			errorMessage += tr("\n Would you like to remove them now? ").latin1();
-			
-			int response = QMessageBox::question(this, tr("Question"), QString(errorMessage.c_str()), tr("Yes"), tr("No")); 
-			if(response == 0)
-			{
-				//remove objetcs without geometries
-				if(!this->evTheme2_->removeObjectsWithoutGeometries(rep2))
-				{
-					QMessageBox::information(this, tr("Information"), 
-					tr("Occurrences/events without location could not be removed.\nTry to generate the theme again."));
-					return false;
-				}
-				QMessageBox::information(this, tr("Information"), 
-					tr("Occurrences/events without location were removed from the theme."));
-			}
-		}
-	}
-
-	if (TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(4);
-		TeProgress::instance()->setMessage(tr("Generating the support set...").latin1());
-		TeProgress::instance()->setProgress(1);
-	}
-	
-	// Generates support set
-	if (!this->generateSupportSet() ) {
-		if (TeProgress::instance())
-			TeProgress::instance()->reset();
-		error(Error, tr("It was not possible to create the support set!").latin1(), parent);
-		return false;
-	}
-	if (TeProgress::instance()) {
-		if (TeProgress::instance()->wasCancelled() ) {
-			TeProgress::instance()->reset();
-			return false;
-		}
-		else 
-		{
-			TeProgress::instance()->setMessage(tr("Generating the event set...").latin1());
-			TeProgress::instance()->setProgress(2);
-		}
-	}
-
-	// Generates first event set
-	if (!this->generateEventSet(1)) {
-		if (TeProgress::instance())
-			TeProgress::instance()->reset();
-		error(Error, tr("It was not possible to create the event set!").latin1(),parent);
-		return false;
-	}
-
-	if (TeProgress::instance()) {
-		if (TeProgress::instance()->wasCancelled()) {
-			TeProgress::instance()->reset();
-			return false;
-		}
-		else
-			TeProgress::instance()->setTotalSteps(4);
-	}
-
-
-	// Generates second event set
-	if (this->evTheme2_ != NULL) {
-		if (TeProgress::instance())
-		{
-			TeProgress::instance()->setTotalSteps(5);
-			TeProgress::instance()->setMessage(tr("Generating second event set...").latin1());
-			TeProgress::instance()->setProgress(3);
-		}
-		if (!this->generateEventSet(2)) {
-			if (TeProgress::instance())
-				TeProgress::instance()->reset();
-			error(Error, tr("It was not possible to create the event set 2!").latin1(),parent);
-			return false;
-		}
-	}
-
-	if (TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(5);
-		TeProgress::instance()->setMessage(tr("Calculating Kernel Map...").latin1());
-		TeProgress::instance()->setProgress(4);
-	}
-
-	// Calls kernel functions
-	bool okKernel = this->call();
-	if (okKernel) 
-		supportSet = this->regSet_;
-
-  //Deallocate temporary values
-   if (this->evSet1_)
-  {
-      delete (TePointTInstanceSet *)this->evSet1_;
-	  evSet1_=0;
-  }
-
-  if (this->evSet2_)
-  {
-     delete (TePointTInstanceSet *)this->evSet2_;
-	 evSet2_=0;
-  }
-//    delete this->evSet2_;
-
-	return okKernel;
-}
-
-
-
-bool TeKernelMethod::getPrecision(int& prec) {
-
-  //Precisao ja foi calculada
-  if (precision_ >= 0) {
-    prec= precision_;
-    return true;
-  }
-
-  bool isGrid = isGridReg_ || isGridEv_;
-  if (isGrid) {
-    if (justOnePolygon_) {
-      if (this->getPrecision((*((TeKernelGridSupport *)regSet_)).begin(boundary_), 
-        (*((TeKernelGridSupport *)regSet_)).end(boundary_))) {
-        prec = precision_;
-        return true;
-      }
-      else
-        return false;
-    }
-    else {
-      if (this->getPrecision((*((TeKernelGridSupport *)regSet_)).begin(), 
-        (*((TeKernelGridSupport *)regSet_)).end())) {
-        prec = precision_;
-        return true;
-      }
-      else
-        return false;
-    }
-  }
-  if (this->getPrecision((*((TeSTStatInstanceSet *)regSet_)).begin(), 
-    (*((TeSTStatInstanceSet *)regSet_)).end())) {
-    prec = precision_;
-    return true;
-  }
-  else {
-    return false;
-  }
-
-}
-
-bool TeKernelMethod::setGridLayer(string name) {
-
-  this->resName_ = name;
-  this->gridLayer_ = NULL;
-
-  // Check whether there is a layer with this name in the database
-  TeLayerMap& layerMap = db_->layerMap();
-  TeLayerMap::iterator it;
-  for (it = layerMap.begin(); it != layerMap.end(); ++it)
-  {
-    if (it->second->name() == name)
-    {
-      this->gridLayer_ = it->second;
-      this->params_.generatedLayerId_ = it->second->id();
-      break;
-    }
-  }
-
-  //Vai criar uma nova -- verifica se nome esta ok
-  if (!gridLayer_)
-  {
-//    size_t pos = name.find("-",string::npos,1);
-    size_t pos = name.find("-", 0, 1);
-   if (pos != string::npos)
-    {
-		QMessageBox::warning( NULL, tr("Error"), 
-			tr("The layer name cannot have the \"-\" character!"));
-      return false;
-    }
-    char ch = name.at(0);
-    if (isdigit(ch))
-    {
-		QMessageBox::information( NULL, tr("Error"),
-			tr("The layer name cannot have numerical characters!"));
-      return false;
-    }
-  }
-
-  return true;
-}
-
-
-bool TeKernelMethod::createLayer(TeRaster* raster,
-                                 TerraViewBase* mWindow)
-{
- 
-  TeQtDatabasesListView* dbView = mWindow->getDatabasesListView();
-  if (!isNewLayer())  {
-
-    //Recupera item associado ao layer para poder remover 
-    TeQtLayerItem* lItPrev = dbView->currentLayerItem();
-    dbView->selectLayerItem(gridLayer_);
-    TeQtLayerItem* layerItem = dbView->currentLayerItem();
-    if (lItPrev != layerItem) {
-      mWindow->removeItem((TeQtCheckListItem*)layerItem);
-      if (lItPrev != NULL)
-        dbView->selectLayerItem(lItPrev->getLayer());
-    }
-    else {
-      mWindow->removeItem(layerItem);
-    }
-  }
-  TeLayer* l = new TeLayer(resName_, db_, raster->projection());
-  int bw, bh;
-  if (raster->params().ncols_ > 512)
-  {
-	  bw = 256;
-	  bh = 256;
-  }
-  else
-  {
-	  bw = raster->params().ncols_;
-	  bh = raster->params().nlines_;
-  }
-
-  	// create a raster geometry in a TerraLib database
-	TeRasterParams pDB = raster->params();
-	pDB.fileName_ = "rasterkernel" + Te2String(l->id()); // the name of the raster table that will contain the blob's
-	pDB.nBands(1);
-	pDB.setDataType(TeDOUBLE);
-	pDB.setDummy(raster->params().dummy_[0]);
-	pDB.mode_ = 'c';
-	// parameters specific of the database decoder
-	pDB.decoderIdentifier_ = "DB";			// a database decoder 
-	pDB.database_ = db_;					// pointer to the database
-	pDB.tiling_type_ = TeRasterParams::TeNoExpansible;      
-	pDB.blockHeight_ = bh;					// we are storing the entire raster in one block
-	pDB.blockWidth_ = bw;
-	pDB.setPhotometric(TeRasterParams::TeMultiBand);	// the photometric interpretation of the raster
-	TeRaster rstDb(pDB);
-	rstDb.init();
-	if (rstDb.params().status_ == TeRasterParams::TeReadyToWrite)
-	{
-		double val;
-		int col, lin;
-		for (lin=0;lin<rstDb.params().nlines_;++lin)
-			for (col=0;col<rstDb.params().ncols_;++col)
-			{
-				raster->getElement(col,lin,val,0);
-				rstDb.setElement(col,lin,val,0);
-			}
-	}
-    l->addRasterGeometry(&rstDb,"O1");	
-	rstDb.clear();
-	l->raster(0);
- 
-  params_.generatedLayerId_ = l->id();
-  
-  TeQtDatabaseItem *dbItem = dbView->currentDatabaseItem();
-  
-  TeQtLayerItem *layerItem = 
-    new TeQtLayerItem((QListViewItem*)dbItem,l->name().c_str(), l);
-  layerItem->setEnabled(true);
-  if (!dbView->isOpen(layerItem->parent()))
-				dbView->setOpen(layerItem->parent(),true);
-  mWindow->checkWidgetEnabling();
-
-  //Verifica se existe tema com mesmo nome e remove
-	TeQtViewItem* curViewItem = mWindow->getViewsListView()->currentViewItem();
-	vector<TeQtThemeItem*> themeItemVec = curViewItem->getThemeItemVec();
-	unsigned int i;
-	for (i = 0; i < themeItemVec.size(); ++i)
-	{
-		TeAppTheme* appTheme = themeItemVec[i]->getAppTheme();
-		TeTheme* theme = (TeTheme*)appTheme->getTheme();
-		if (theme && !resName_.compare(theme->name()))
-		{
-			TeQtViewsListView* viewList = mWindow->getViewsListView();
-			TeQtThemeItem* themeItem = viewList->getThemeItem(appTheme);
-			if (themeItem != NULL)
-				mWindow->removeItem((TeQtCheckListItem*)themeItem);
-		}
-	}
-	TeAttrTableVector ATV;
-  if (! mWindow->createTheme(resName_, mWindow->currentView(), l, "", ATV))
-    return false;
-
-
-  //Recupera apontador para o tema criado
-	themeItemVec = curViewItem->getThemeItemVec();
-	for (i = 0; i < themeItemVec.size(); i++)
-	{
-		TeAppTheme* appTheme = themeItemVec[i]->getAppTheme();
-		TeTheme* theme = (TeTheme*)appTheme->getTheme();
-		if (!resName_.compare(theme->name()))
-		{
-			this->rasterTheme_ = theme;
-		}
-	}
-
-
-  if (this->rasterTheme_ == NULL) {
-      QMessageBox::information( NULL, tr("Error"),
-		  tr("There is no theme with the raster representation!"));
-      return false;
-  }
-  return true;
-}
-
-bool TeKernelMethod::createColumn(TeAppTheme* currTheme,
-                         TeQtGrid* grid) 
-{
-
-	grid->clear();
-	if(!insertPropertyColumn(*((TeSTStatInstanceSet *)this->regSet_),
-      0, regTheme_, params_.supportThemeTable_, params_.supportThemeAttr_))
-	  return false;
-
-	 // ---------------------------------------------- load updated table from database 
-	// Update all the themes that uses this table
-
-	TeViewMap& viewMap = this->db_->viewMap();
-	TeViewMap::iterator it;
-	set<TeLayer*> layerSet;
-	for (it = viewMap.begin(); it != viewMap.end(); ++it)
-	{
-		TeView *view = it->second;
-		vector<TeViewNode*>& themesVector = view->themes();
-		for (unsigned int i = 0; i < themesVector.size(); ++i)
-		{
-			if(themesVector[i]->type() == TeTHEME)
-			{
-				TeTheme* theme = (TeTheme*)themesVector[i];
-				if (theme->isThemeTable(params_.supportThemeTable_) == true)
-				{
-					theme->loadThemeTables();
-					layerSet.insert(theme->layer());
-				}
-			}
-		}
-	}
-
-	// Update the layer tables affected
-	set<TeLayer*>::iterator setIt;
-	for (setIt = layerSet.begin(); setIt != layerSet.end(); ++setIt)
-		(*setIt)->loadLayerTables();
-
-	// ---------------------------------------------- grid 
-	if(currTheme!= NULL)
-	{
-		grid->init(currTheme);
-		grid->refresh();
-		grid->goToLastColumn();
-	}
-
-	return true;
-}
-
-//Alterando pois soh precisa internamente
-bool TeKernelMethod::createKernelLegends(int nColors, bool /* color */, TeAppTheme* appTheme)
-{
-  	int precision;
-	if (!getPrecision(precision)) 
-	{
-		QMessageBox::critical(NULL, tr("Error"), 
-		tr("Unexpected error in the evaluation of the kernel precision!"));
-		return false;
-	}
-	
-	precision=15; //teste
-  
-	// recupera o tema sobre o qual foi calculado kernel
-	TeTheme* theme = 0;
-	if (this->rasterTheme_ != NULL)
-		theme = this->rasterTheme_;
-	else
-		theme = this->regTheme_;
-
-	TeAttributeRep rep;				  
-	rep.type_ = TeREAL;
-
-	TeGrouping groupKernel;
-	groupKernel.groupNumSlices_ = nColors;
-	groupKernel.groupPrecision_ = precision;
-
-	if (theme->layer()->geomRep() & TeRASTER)    // suporte foi grade
-	{
-		groupKernel.groupMode_ = TeRasterSlicing;
-		rep.name_ = "0";
-	}
-	else										// suporte foi regioes
-	{
-		groupKernel.groupMode_ = TeEqualSteps;
-		rep.name_ = this->params_.supportThemeTable_ + "." + this->params_.supportThemeAttr_;
-	}
-	groupKernel.groupAttribute_ = rep;
-
-	if (!theme->buildGrouping(groupKernel))
-		return false;
-  
-	vector<string> colorRamp;
-	colorRamp.push_back("CYAN");
-	colorRamp.push_back("GREEN");
-	colorRamp.push_back("YELLOW");
-	colorRamp.push_back("ORANGE");
-	colorRamp.push_back("RED");
-
-	// cria rampa de cores default para dados de kernel e define visual de cada fatia
-	vector<TeColor> colorGrad;
-	getColors(colorRamp,10, colorGrad);
-	for (int g=0; g<theme->grouping().groupNumSlices_; g++)
-	{
-		TeVisual visual(TePOLYGONS);            
-		visual.color(colorGrad[g]);
-		if((theme->layer()->geomRep() & TePOLYGONS) || 
-		   (theme->layer()->geomRep() & TeCELLS) || 
-		   (theme->layer()->geomRep() & TeRASTER))
-		{
-			visual.transparency(theme->defaultLegend().visual(TePOLYGONS)->transparency());
-			visual.contourStyle(theme->defaultLegend().visual(TePOLYGONS)->contourStyle());
-			visual.contourWidth(theme->defaultLegend().visual(TePOLYGONS)->contourWidth());
-			visual.contourColor(theme->defaultLegend().visual(TePOLYGONS)->contourColor());	
-			theme->setGroupingVisual(g+1,visual.copy(),TePOLYGONS);
-		}
-		if(theme->layer()->geomRep() & TeLINES)
-		{
-			visual.style(theme->defaultLegend().visual(TeLINES)->style());
-			visual.width(theme->defaultLegend().visual(TeLINES)->width());
-			theme->setGroupingVisual(g+1,visual.copy(),TeLINES);
-		}
-		else if(theme->layer()->geomRep() & TePOINTS)
-		{
-			visual.style(theme->defaultLegend().visual(TePOINTS)->style());
-			visual.size(theme->defaultLegend().visual(TePOINTS)->size());
-			theme->setGroupingVisual(g+1,visual.copy(),TePOINTS);
-		}
-	}
-	colorGrad.clear();
-
-	// acrescenta algumas informacoes relativas ao theme application
-
-	std::string scores("Cy-G-Y-Or-R");
-	vector<ColorBar> bg =  getColorBarVector(scores, true);
- 	string groupingColors = getColors(bg, bg,TeEqualSteps);
-	appTheme->groupColor(groupingColors);
-	appTheme->countObj(false);
-	appTheme->mixColor(true);
-	appTheme->groupColorDir(TeColorAscSatBegin);
-	if (!theme->saveGrouping())
-		return false;
-	if (!(theme->layer()->geomRep() & TeRASTER)  && !theme->saveLegendInCollection())
-		return false;
-	
-	theme->visibleRep(theme->visibleRep() | 0x40000000);
-	updateAppTheme(this->db_,appTheme);
-
-	if (this->rasterTheme_ != NULL)
-		appTheme->setAlias("0",tr("Kernel Values").latin1());
-	return true;
-}
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+
+#include "TeSTElementSet.h"
+#include "TeKernelParams.h"
+#include "TeQtTerraStat.h"
+#include "TeKernelFunctions.h"
+#include "TeStatDataStructures.h"
+#include "TeQtDatabasesListView.h"
+///#include "TeImportRaster.h"
+#include "TeDecoderDatabase.h"
+#include "TeQtViewsListView.h"
+#include "TeQtGrid.h"
+#include "TeSTEFunctionsDB.h"
+#include "TeWaitCursor.h"
+#include "TeColorUtils.h"
+#include "TeDatabaseUtils.h"
+#include "TeKernelParams.h"
+#include "TeQtLayerItem.h"
+#include "TeQtViewItem.h"
+#include "TeQtThemeItem.h"
+#include <qobject.h>
+#include <qapplication.h>
+
+
+string getKernelFunction (TeKernelFunctionType t)
+{
+	string result;
+
+	switch (t)
+	{
+		case TeKQuartic:
+      result = QObject::tr("Quartic").latin1();
+			break;
+		case TeKNormal:
+			result = QObject::tr("Normal").latin1();
+			break;
+		case TeKUniform:
+			result = QObject::tr("Uniform").latin1();
+			break;
+		case TeKTriangular:
+			result = QObject::tr("Triangular").latin1();
+			break;
+		case TeKNegExponential:
+			result = QObject::tr("NegExponential").latin1();
+			break;
+	}
+	return result;
+}
+
+string getKernelComputeType (TeKernelComputeType t)
+{
+	string result;
+
+	switch (t)
+	{
+		case TeKDensity:
+			result = QObject::tr("Density").latin1();
+			break;
+		case TeKProbability:
+			result = QObject::tr("Probability").latin1();
+			break;
+		case TeKMovingAverage:
+			result = QObject::tr("Spatial Moving Average").latin1();
+			break;
+	}
+	return result;
+}
+
+string getCombinationType (TeKernelCombinationType /* t */)
+{
+	string result;
+	result = "DESCONHECIDO";
+	return result;
+}
+
+
+/**
+ * Retorna legenda para kernel
+ **/
+bool getKernelLegend(TeKernelParams& par, vector<string>& result)
+{
+	string legend = QObject::tr("Kernel parameters").latin1();
+	result.push_back(legend); 
+	string numb = "";
+	
+	legend = QObject::tr("Event theme").ascii()+ numb +" : "+ par.eventThemeName1_ ;
+	result.push_back(legend);
+	
+	if(!par.intensityAttrName1_.empty())
+	{
+		legend = QObject::tr("Attribute name").ascii()+ numb +" : "+ par.intensityAttrTable1_+"."+ par.intensityAttrName1_;
+		result.push_back(legend);
+	}
+
+  if (par.radiusValue1_ > 0) {
+	  legend = QObject::tr("Radius value").ascii()+ numb +" : "+ Te2String(par.radiusValue1_);
+  }
+  else {
+    legend = QObject::tr("Adaptive radius").ascii();
+  }
+  result.push_back(legend);
+
+  legend = QObject::tr("Compute: ").ascii()+getKernelComputeType(par.computeType1_);
+  result.push_back(legend);
+
+  legend = QObject::tr("Function: ").ascii()+getKernelFunction(par.kernelFunction1_);
+  result.push_back(legend);
+
+  return true;
+}
+
+
+/**
+ * Grava uma coluna na tabela de atributos associada a um STOSet.
+ * Nome da coluna eh o mesmo nome da propriedade
+ **/
+bool insertPropertyColumn(TeSTElementSet& stoSet,
+                          const string& tableName,
+                          const string&  columnName) 
+{
+	
+	
+ 	vector<int> index;
+	int ind = stoSet.getAttributeIndex(columnName);
+	if(ind<0)
+	{
+		ind = stoSet.getAttributeIndex(tableName+"."+columnName);
+		if(ind>-1)
+			index.push_back (ind);
+	}
+	else
+		index.push_back (ind);
+  
+	if(!index.empty())
+	{
+		if (!TeUpdateDBFromSet (&stoSet, tableName, &index)) 
+			return false;
+	}
+	else
+	{
+		if (!TeUpdateDBFromSet (&stoSet, tableName)) 
+			return false;
+	}
+	return true;
+}
+
+/**
+ * Grava uma coluna na tabela de atributos associada a um STOSet.
+ * Nome da coluna eh o mesmo nome da propriedade
+ **/
+bool insertPropertyColumn(TeSTStatInstanceSet& stSet,
+                          int idxDoubleProp,
+                          TeTheme* theme,
+                          const string& tableName,
+                          const string& columnName) {
+
+  TeProperty prop;
+
+  prop.attr_.rep_.name_ = columnName;
+  prop.attr_.rep_.type_ = TeREAL;
+  double value;
+  TePropertyVector pVect;
+  pVect.push_back(prop);
+
+  //Constroi um de outro
+  TeSTElementSet rs(theme);
+  rs.addProperty(prop.attr_);
+
+  TeSTStatInstanceSet::iterator ito = stSet.begin();
+  while (ito != stSet.end()) {
+
+    //Cria uma nova propriedade no objeto
+    (*ito).getDoubleProperty(idxDoubleProp, value);
+    pVect[0].value_ = Te2String(value, STAT_PRECISION);
+    (*ito).properties(pVect);
+    rs.insertSTInstance(*ito);
+    ++ito;
+  }
+
+  return insertPropertyColumn(rs, tableName, columnName) ;
+}
+
+
+/***
+ * Cria um STOSet a partir de um tema e um conjunto de atributos,
+ * colocando todas as tabelas do TEMA
+ ***/
+bool createSTOSetFromTheme(TeTheme* theme, 
+                              vector<string>& attributes,
+                              TeSTElementSet* rs) 
+{
+	rs->setTheme(theme);
+	return TeSTOSetBuildDB(rs, true, false, attributes);
+}
+
+
+/***
+ * Cria um STOSet a partir de um tema e um conjunto de atributos,
+ * colocando todas as tabelas do TEMA
+ ***/
+bool createSTOStatSetFromTheme(TeTheme* theme, 
+                               vector<string>& attributes,
+                               int additionalDouble,
+                               TeSTStatInstanceSet* rs) {
+
+  TeSTElementSet stoSet(theme);
+   if (!TeSTOSetBuildDB(&stoSet, true, false, attributes))
+     return false;
+   rs->Copy(stoSet, attributes.size(), additionalDouble);
+   return true;
+
+}
+
+TeKernelMethod::~TeKernelMethod()
+{
+	if (evSet1_)
+		delete (TePointTInstanceSet *)evSet1_;
+	
+	if (evSet2_)
+		delete (TePointTInstanceSet *)evSet2_;
+	
+	if(regSet_ && (isGridEv_ || isGridReg_))
+	{
+		delete (TeKernelGridSupport*)regSet_ ;
+	}
+	else if (regSet_)
+	{
+		delete (TeSTStatInstanceSet*)regSet_;
+	}
+	regSet_=0;
+	evSet2_=0;
+	evSet1_=0;
+}
+
+void TeKernelMethod::error(TeKernelErrorType type, string message, QWidget* parent) {
+
+  QString title;
+  switch (type) {
+  case Uerror:
+	  title = tr("Unexpected Error");
+    break;
+  case Error:
+		title = tr("Error");
+    break;
+  case Warning:
+		title = tr("Warning");
+    break;
+  }
+
+  if (parent) {
+	  QMessageBox::information(parent, title, tr(message.c_str()));
+  }
+  else {
+    QMessageBox::information(0, (title), tr(message.c_str())); 
+  }
+
+}
+
+/**
+ * Defines name, theme pointer and id for a given theme 
+ * id = 0 -- support theme
+ * id = 1,2 -- first and second event theme
+ **/
+bool TeKernelMethod::setTheme(string name, int id, TeView* view) {
+  if (id == 0) {
+    params_.supportThemeName_ = name;
+    regTheme_ = view->get(params_.supportThemeName_);
+    if (evTheme1_ == NULL) {
+      return false;
+    }
+	params_.supportThemeId_ = regTheme_->id(); 
+  }
+  else if (id == 1) {
+    params_.eventThemeName1_ = name;
+
+    evTheme1_ = view->get(params_.eventThemeName1_);
+    if (evTheme1_ == NULL) {
+      return false;
+    }
+    params_.eventThemeId1_ = evTheme1_->id();
+    
+  }
+  else if (id == 2) {
+    params_.eventThemeName2_ = name;
+
+    evTheme2_ = view->get(params_.eventThemeName2_);
+    if (evTheme2_ == NULL) {
+      return false;
+    }
+    params_.eventThemeId2_ = evTheme2_->id();
+    
+  }
+  return true;
+}
+
+
+enum TeGridType {GridFromSupport, GridFromEvent, GridFromBoth};
+
+
+/**
+ * Generates support set from parameters
+ *   If grid, generate box
+ *   If theme, generate column
+ **/
+bool TeKernelMethod::generateSupportSet() {
+ 
+  
+  bool isGrid = isGridReg_ || isGridEv_;
+  bool isRatio = (params_.eventThemeId2_ > 0);
+
+  justOnePolygon_ = false;
+
+  //support set is from type TeKernelGridSupport
+  if (isGrid) 
+  {
+
+    //Computes grid boundary and defines if just one set.
+    TeGridType t;
+    TeBox      gridBound;
+
+    if (isGridEv_)
+    {
+      if (isRatio)
+        t = GridFromBoth;
+      else
+        t = GridFromEvent;
+    }
+    else
+      t = GridFromSupport;
+ 
+    if (db_ == NULL) {
+      error(Uerror, tr("There is no database. Please, contact support!").latin1());
+      return false;
+    }
+
+    TeBox bound1;
+    TeBox bound2;
+    
+    switch(t) {
+    case GridFromSupport:
+      if (regTheme_ == NULL) {
+		error(Uerror, tr("There is no support theme. Please, contact support!").latin1());
+        return false;
+      }
+	  gridBound = regTheme_->getThemeBox();
+      break;
+    case GridFromEvent:
+      if (evTheme1_ == NULL) {
+		error(Uerror, tr("There is no event theme. Please, contact support!").latin1());
+        return false;
+      }
+	  gridBound = evTheme1_->getThemeBox();
+      break;
+    case GridFromBoth:
+      if ((evTheme1_ == NULL) || (evTheme2_ == NULL)) {
+		error(Uerror, tr("There is no event theme. Please, contact support!").latin1());
+        return false;
+      }
+
+      bound1 = evTheme1_->getThemeBox();
+      bound2 = evTheme2_->getThemeBox();
+    
+      //Box is the rectangle that envolves both boxes
+      gridBound.x1_ = (bound1.x1_ < bound2.x1_) ? bound1.x1_ : bound2.x1_;
+      gridBound.y1_ = (bound1.y1_ < bound2.y1_) ? bound1.y1_ : bound2.y1_;
+      gridBound.x2_ = (bound1.x2_ > bound2.x2_) ? bound1.x2_ : bound2.x2_;
+      gridBound.y2_ = (bound1.y2_ < bound2.y2_) ? bound1.y2_ : bound2.y2_;
+
+      break;
+
+    default:
+		error(Uerror, tr("Invalid type. Please, contact support!").latin1());
+      return false;
+      break;
+    }
+    
+    
+    if (!gridBound.isValid()) {
+		error(Uerror, tr("Invalid grid box. Please, contact support!").latin1());
+        return false;
+    }
+
+
+    //Verifies if it has just one polygon
+    if (t == GridFromSupport) {
+
+      TeDatabasePortal* portal = this->db_->getPortal();
+
+      TeLayer* l = regTheme_->layer();
+
+      if (l->hasGeometry(TePOLYGONS))
+      {
+        string count = "SELECT COUNT(*) FROM " + l->tableName(TePOLYGONS);
+        count += ", " + regTheme_->collectionTable() + " WHERE ";
+        count += l->tableName(TePOLYGONS) + ".object_id = ";
+        count += regTheme_->collectionTable() + ".c_object_id";
+        portal->freeResult();
+        if(portal->query(count))
+        {
+          if(portal->fetchRow())
+          {
+            count = portal->getData(0);		
+          }
+          else {
+ 			error(Uerror, tr("There is no polygons. Please, contact support!").latin1());
+          }
+        }
+
+        int nPol = atoi(count.c_str());
+        this->justOnePolygon_ = (nPol == 1);
+		delete portal;
+      }
+    }
+
+    TeProjection* proj = db_->loadProjection(this->evTheme1_->layer()->projection()->id());
+
+    if (proj == NULL) {
+ 			error(Uerror, tr("There is no projection. Please, contact support!").latin1());
+       return false;
+    }
+	if (this->params_.eventThemeId2_ > 0) // if it is kernel ratio
+		regSet_ = new TeKernelGridSupport(gridBound, gridCols_, proj, 2);   
+	else
+		regSet_ = new TeKernelGridSupport(gridBound, gridCols_, proj);   
+  }
+  //Gera grid irregular a partir de poligonos do layer
+  else {
+    
+    //Define regioes a partir de tema -- aplicar restricao
+    if (regTheme_ == NULL) {
+ 		error(Uerror, tr("There is no support theme. Please, contact support!").latin1());
+      return false;
+    }
+
+	//Generates set from theme
+    vector<string> empty;
+    //TeSTStatInstanceSet* rs = new TeSTStatInstanceSet();
+	regSet_ = new TeSTStatInstanceSet();
+    createSTOStatSetFromTheme(regTheme_, empty, 2, (TeSTStatInstanceSet*)regSet_);
+    resName_ = string(this->params_.supportThemeAttr_);
+    //regSet_ = rs;
+  }
+  return true;
+}
+
+
+/**
+ * Generates event set from theme. If there is an attribute, set is initialize with it.
+ * Otherwise, just geometries are loaded. Geometries may be points or polygons
+ **/
+bool TeKernelMethod::generateEventSet(int which) {
+
+  bool     isPoint;
+  TeTheme* theme;
+  TeLayer* layer;
+  string   table;
+  string   column;
+    
+  if (which == 1) {
+    isPoint = this->isPoint1_;
+    theme = this->evTheme1_;
+    if (this->evTheme1_ == NULL) {
+ 		error(Uerror, tr("There is no event set for the kernel. Please, contact support!").latin1());
+      return false;
+    }
+    layer = this->evTheme1_->layer();
+    if (layer == NULL) {
+ 		error(Uerror, tr("There is no layer for the theme. Please, contact support!").latin1());
+      return false;
+    }
+    table = this->params_.intensityAttrTable1_;
+    column = this->params_.intensityAttrName1_;
+  }
+  else if (which == 2) {
+    isPoint = this->isPoint2_;
+    theme = this->evTheme2_;
+    if (this->evTheme2_ == NULL) {
+ 		error(Uerror, tr("There is no event set for the kernel. Please, contact support!").latin1());
+      return false;
+    }
+    layer = this->evTheme2_->layer();
+    if (layer == NULL) {
+ 		error(Uerror, tr("There is no layer for the theme. Please, contact support!").latin1());
+      return false;
+    }
+    table = this->params_.intensityAttrTable2_;
+    column = this->params_.intensityAttrName2_;
+  }
+  else {
+ 		error(Uerror, tr("Invalid event set. Please, contact support!").latin1());
+    return false;
+  }
+  
+  TeWaitCursor wait;
+
+  bool done;
+  vector<string> vecAttr;
+  if (column.compare("")) {
+      vecAttr.push_back(table+"."+column);
+  }
+ if (isPoint) {
+
+    //Generates set from theme
+    TePointTInstanceSet* evs = new TePointTInstanceSet();
+    if (vecAttr.size() == 0) {
+      done =  createSTOStatSetFromTheme(theme, vecAttr, 1, evs);
+      //Deve inicializar com 1 toda a propriedade
+      TePointTInstanceSet::iterator itev = evs->begin();
+      while (itev != evs->end()) {
+        (*itev).setDoubleProperty(0, 1.0);
+        ++itev;
+      }
+    }
+    else {
+      done = createSTOStatSetFromTheme(theme, vecAttr, 0, evs);
+    }
+
+    if (!done)
+      return false;
+    if (which == 1) {
+      evSet1_ = evs;
+    }
+    else {
+      evSet2_ = evs;
+    }
+
+  }
+  else {
+
+      //Generates set from theme
+    TePointTInstanceSet* evs = new TePointTInstanceSet();
+    if (vecAttr.size() == 0) {
+      done =  createSTOStatSetFromTheme(theme, vecAttr, 1, evs);
+      //Deve inicializar com 1 toda a propriedade
+      TePointTInstanceSet::iterator itev = evs->begin();
+      while (itev != evs->end()) {
+        (*itev).setDoubleProperty(0, 1.0);
+        ++itev;
+      }
+  }
+  else {
+      done = createSTOStatSetFromTheme(theme, vecAttr, 0, evs);
+    }
+    if (!done)
+      return false;
+    if (which == 1) {
+      evSet1_ = evs;
+    }
+    else {
+      evSet2_ = evs;
+    }
+  }
+  return true;
+}
+
+
+bool TeKernelMethod::call() 
+{
+  bool isGrid = this->isGridEv_ || this->isGridReg_;
+  bool isRatio = this->params_.eventThemeName2_.compare("");
+
+//  bool justOnePolygon = false;
+
+  double totalArea;
+  if (isGrid)  {
+    totalArea = ((TeKernelGridSupport *)regSet_)->totalArea();
+  }
+  else {
+    //SUBSTITUIR
+	  totalArea = TeGeometryArea(regTheme_->getThemeBox());
+  }
+
+  int  totalRegions;
+  if (isGrid) {
+      totalRegions = ((TeKernelGridSupport *)regSet_)->numObjects();
+  }
+  else {
+      totalRegions = ((TeSTStatInstanceSet *)regSet_)->numObjects();
+  }
+
+  if (TeProgress::instance())
+  {
+		TeProgress::instance()->setTotalSteps(totalRegions);
+  }
+
+  //Kernel de razao
+  if (isRatio) {
+   
+   
+    TeStatKernelRatio kerRatio;
+    kerRatio.numReg_ = totalRegions;
+    kerRatio.kComb_ = params_.combinationType_;
+    kerRatio.ktype_ = params_.computeType1_;
+    kerRatio.kfunc1_ = params_.kernelFunction1_;
+    kerRatio.radius1_ = params_.radiusValue1_;
+    kerRatio.kfunc2_ = params_.kernelFunction2_;
+    kerRatio.radius2_ = params_.radiusValue2_;
+    kerRatio.totalArea_ = totalArea;
+
+
+    //Colocar janela com parametros para o usuario confirmar
+
+    if (isGrid) {
+      //Verifica se o iterador eh para um unico poligono
+      if (justOnePolygon_) {
+        TeDatabasePortal* portal = db_->getPortal();
+
+        string count = "SELECT c_object_id FROM " + regTheme_->layer()->tableName(TePOLYGONS)+",";
+        count += regTheme_->collectionTable() + " WHERE ";
+        count += regTheme_->layer()->tableName(TePOLYGONS) + ".object_id = ";
+        count += regTheme_->collectionTable() + ".c_object_id";
+        portal->freeResult();
+        if(portal->query(count))
+        {
+          if(portal->fetchRow())
+          {
+            count = portal->getData(0);		
+          }
+          else {
+ 			      error(Uerror, tr("There is no polygons. Please, contact support!").latin1());
+            return false;
+          }
+        }
+		    delete portal;
+        TePolygonSet polygon;
+        if (!regTheme_->layer()->loadGeometrySet(count, polygon)) {
+ 		    	error(Uerror, tr("There is no polygon boundary. Please, contact support!").latin1());
+          return false;
+        }
+        boundary_ = polygon.first();
+        if (boundary_.empty()) {
+ 		    	error(Uerror, tr("There is no polygon boundary. Please, contact support!").latin1());
+          return false;
+        }
+        return kerRatio.apply(*((TePointTInstanceSet *)evSet1_),
+            *((TePointTInstanceSet *)evSet2_),
+            (*((TeKernelGridSupport *)regSet_)).begin(boundary_), 
+            (*((TeKernelGridSupport *)regSet_)).end(boundary_));
+      }
+      else {
+        return kerRatio.apply(*((TePointTInstanceSet *)evSet1_),
+            *((TePointTInstanceSet *)evSet2_),
+            (*((TeKernelGridSupport *)regSet_)).begin(), 
+            (*((TeKernelGridSupport *)regSet_)).end());
+      }
+    }
+    else {
+       return kerRatio.apply(*((TePointTInstanceSet *)evSet1_), 
+         *((TePointTInstanceSet *)evSet2_),
+          (*((TeSTStatInstanceSet *)regSet_)).begin(), 
+          (*((TeSTStatInstanceSet *)regSet_)).end());
+    }
+  }  
+  //Kernel normal com um unico conjunto
+  else {
+   
+    TeStatKernel kernel;
+    kernel.radius_ = params_.radiusValue1_;
+    kernel.kfunc_ =  params_.kernelFunction1_;
+    kernel.ktype_ = params_.computeType1_;
+    kernel.totalArea_ = totalArea;
+    kernel.numReg_ = totalRegions;
+
+    //Colocar janela com parametros para o usuario confirmar
+
+    if (isGrid) {
+      //Verifica se o iterador eh para um unico poligono
+      if (justOnePolygon_) {
+        TeDatabasePortal* portal = db_->getPortal();
+
+        string count = "SELECT c_object_id FROM " + regTheme_->layer()->tableName(TePOLYGONS)+",";
+        count += regTheme_->collectionTable() + " WHERE ";
+        count += regTheme_->layer()->tableName(TePOLYGONS) + ".object_id = ";
+        count += regTheme_->collectionTable() + ".c_object_id";
+        portal->freeResult();
+        if(portal->query(count))
+        {
+          if(portal->fetchRow())
+          {
+            count = portal->getData(0);		
+          }
+          else {
+ 			      error(Uerror, tr("There is no polygons. Please, contact support!").latin1());
+            return false;
+          }
+        }
+		    delete portal;
+        TePolygonSet polygon;
+        if (!regTheme_->layer()->loadGeometrySet(count, polygon)) {
+ 		    	error(Uerror, tr("There is no polygon boundary. Please, contact support!").latin1());
+          return false;
+        }
+        boundary_ = polygon.first();
+        if (boundary_.empty()) {
+ 		    	error(Uerror, tr("There is no polygon boundary. Please, contact support!").latin1());
+          return false;
+        }
+        return kernel.apply(*((TePointTInstanceSet *)evSet1_),
+            (*((TeKernelGridSupport *)regSet_)).begin(boundary_), 
+            (*((TeKernelGridSupport *)regSet_)).end(boundary_));
+      }
+      else {
+        return kernel.apply(*((TePointTInstanceSet *)evSet1_),
+            (*((TeKernelGridSupport *)regSet_)).begin(), 
+            (*((TeKernelGridSupport *)regSet_)).end());
+      }
+    }
+    else {
+       return kernel.apply(*((TePointTInstanceSet *)evSet1_), 
+          (*((TeSTStatInstanceSet *)regSet_)).begin(), 
+          (*((TeSTStatInstanceSet *)regSet_)).end());
+    }
+  }  
+  return true;
+}
+
+ 
+
+/**
+ * Apply kernel method based on parameters definition
+ *   Create event(s) set
+ *   Create support set
+ *   Execute suitable kernel method (basic, adaptive, ratio)
+ *   Returns support set region
+ **/
+bool TeKernelMethod::apply(void*& supportSet, QWidget* parent) 
+{
+	precision_ = -1;
+
+	//Verifies if there is an event theme
+	if (this->evTheme1_ == NULL) {
+		error(Uerror, tr("There is no event set for the kernel. Please, contact support!").latin1());
+		return false;
+	}
+
+	//Verifies if this theme has objects without geometries
+	TeGeomRep rep1 = TePOINTS;
+	if(!isPoint1_)
+		rep1 = TePOLYGONS;
+	if(this->evTheme1_->hasObjectsWithoutGeometries(rep1))
+	{
+		string errorMessage = tr("The theme ").latin1();
+		errorMessage += " - "+ this->evTheme1_->name() +" - "; 
+		errorMessage += tr("\n has occurrences/events without location. ").latin1();
+		errorMessage += tr("\n These occurrences should be removed to generate a valid kernel map.").latin1();  
+		errorMessage += tr("\n Would you like to remove them now? ").latin1();
+		
+		int response = QMessageBox::question(this, tr("Question"), QString(errorMessage.c_str()), tr("Yes"), tr("No")); 
+		if(response == 0)
+		{
+			//remove objetcs without geometries
+			if(!this->evTheme1_->removeObjectsWithoutGeometries(rep1))
+			{
+				QMessageBox::information(this, tr("Information"), 
+					tr("Occurrences/events without location could not be removed.\nTry to generate the theme again."));
+				return false;
+			}
+			
+			QMessageBox::information(this, tr("Information"), 
+					tr("Occurrences/events without location were removed from the theme."));
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//Verifies if all themes are in the same projection
+	TeProjection* ev1 = this->evTheme1_->getThemeProjection();
+	if (this->regTheme_ != NULL) 
+	{
+		TeProjection* reg = regTheme_->getThemeProjection();
+		if (!(*reg == *ev1)) {
+			error(Warning,tr("All of the themes should be in the same projection!").latin1(),parent);
+			return false;
+		}
+	}
+
+	if (this->evTheme2_ != NULL) 
+	{
+		TeProjection* ev2 = this->evTheme2_->getThemeProjection();
+		if (!(*ev1 == *ev2)) {
+			error(Warning,tr("All of the themes should be in the same projection!").latin1(),parent);
+			return false;
+		}
+
+		//Verifies if this theme has objects without geometries
+		TeGeomRep rep2 = TePOINTS;
+		if(!isPoint2_)
+			rep2 = TePOLYGONS;
+		if(this->evTheme2_->hasObjectsWithoutGeometries(rep2))
+		{
+			string errorMessage = tr("The theme ").latin1();
+			errorMessage += " - "+ this->evTheme1_->name() +" - "; 
+			errorMessage += tr("\n has occurrences/events without location. ").latin1();
+			errorMessage += tr("\n These occurrences should be removed to generate a valid kernel map.").latin1();  
+			errorMessage += tr("\n Would you like to remove them now? ").latin1();
+			
+			int response = QMessageBox::question(this, tr("Question"), QString(errorMessage.c_str()), tr("Yes"), tr("No")); 
+			if(response == 0)
+			{
+				//remove objetcs without geometries
+				if(!this->evTheme2_->removeObjectsWithoutGeometries(rep2))
+				{
+					QMessageBox::information(this, tr("Information"), 
+					tr("Occurrences/events without location could not be removed.\nTry to generate the theme again."));
+					return false;
+				}
+				QMessageBox::information(this, tr("Information"), 
+					tr("Occurrences/events without location were removed from the theme."));
+			}
+		}
+	}
+
+	if (TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(4);
+		TeProgress::instance()->setMessage(tr("Generating the support set...").latin1());
+		TeProgress::instance()->setProgress(1);
+	}
+	
+	// Generates support set
+	if (!this->generateSupportSet() ) {
+		if (TeProgress::instance())
+			TeProgress::instance()->reset();
+		error(Error, tr("It was not possible to create the support set!").latin1(), parent);
+		return false;
+	}
+	if (TeProgress::instance()) {
+		if (TeProgress::instance()->wasCancelled() ) {
+			TeProgress::instance()->reset();
+			return false;
+		}
+		else 
+		{
+			TeProgress::instance()->setMessage(tr("Generating the event set...").latin1());
+			TeProgress::instance()->setProgress(2);
+		}
+	}
+
+	// Generates first event set
+	if (!this->generateEventSet(1)) {
+		if (TeProgress::instance())
+			TeProgress::instance()->reset();
+		error(Error, tr("It was not possible to create the event set!").latin1(),parent);
+		return false;
+	}
+
+	if (TeProgress::instance()) {
+		if (TeProgress::instance()->wasCancelled()) {
+			TeProgress::instance()->reset();
+			return false;
+		}
+		else
+			TeProgress::instance()->setTotalSteps(4);
+	}
+
+
+	// Generates second event set
+	if (this->evTheme2_ != NULL) {
+		if (TeProgress::instance())
+		{
+			TeProgress::instance()->setTotalSteps(5);
+			TeProgress::instance()->setMessage(tr("Generating second event set...").latin1());
+			TeProgress::instance()->setProgress(3);
+		}
+		if (!this->generateEventSet(2)) {
+			if (TeProgress::instance())
+				TeProgress::instance()->reset();
+			error(Error, tr("It was not possible to create the event set 2!").latin1(),parent);
+			return false;
+		}
+	}
+
+	if (TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(5);
+		TeProgress::instance()->setMessage(tr("Calculating Kernel Map...").latin1());
+		TeProgress::instance()->setProgress(4);
+	}
+
+	// Calls kernel functions
+	bool okKernel = this->call();
+	if (okKernel) 
+		supportSet = this->regSet_;
+
+  //Deallocate temporary values
+   if (this->evSet1_)
+  {
+      delete (TePointTInstanceSet *)this->evSet1_;
+	  evSet1_=0;
+  }
+
+  if (this->evSet2_)
+  {
+     delete (TePointTInstanceSet *)this->evSet2_;
+	 evSet2_=0;
+  }
+//    delete this->evSet2_;
+
+	return okKernel;
+}
+
+
+
+bool TeKernelMethod::getPrecision(int& prec) {
+
+  //Precisao ja foi calculada
+  if (precision_ >= 0) {
+    prec= precision_;
+    return true;
+  }
+
+  bool isGrid = isGridReg_ || isGridEv_;
+  if (isGrid) {
+    if (justOnePolygon_) {
+      if (this->getPrecision((*((TeKernelGridSupport *)regSet_)).begin(boundary_), 
+        (*((TeKernelGridSupport *)regSet_)).end(boundary_))) {
+        prec = precision_;
+        return true;
+      }
+      else
+        return false;
+    }
+    else {
+      if (this->getPrecision((*((TeKernelGridSupport *)regSet_)).begin(), 
+        (*((TeKernelGridSupport *)regSet_)).end())) {
+        prec = precision_;
+        return true;
+      }
+      else
+        return false;
+    }
+  }
+  if (this->getPrecision((*((TeSTStatInstanceSet *)regSet_)).begin(), 
+    (*((TeSTStatInstanceSet *)regSet_)).end())) {
+    prec = precision_;
+    return true;
+  }
+  else {
+    return false;
+  }
+
+}
+
+bool TeKernelMethod::setGridLayer(string name) {
+
+  this->resName_ = name;
+  this->gridLayer_ = NULL;
+
+  // Check whether there is a layer with this name in the database
+  TeLayerMap& layerMap = db_->layerMap();
+  TeLayerMap::iterator it;
+  for (it = layerMap.begin(); it != layerMap.end(); ++it)
+  {
+    if (it->second->name() == name)
+    {
+      this->gridLayer_ = it->second;
+      this->params_.generatedLayerId_ = it->second->id();
+      break;
+    }
+  }
+
+  //Vai criar uma nova -- verifica se nome esta ok
+  if (!gridLayer_)
+  {
+//    size_t pos = name.find("-",string::npos,1);
+    size_t pos = name.find("-", 0, 1);
+   if (pos != string::npos)
+    {
+		QMessageBox::warning( NULL, tr("Error"), 
+			tr("The layer name cannot have the \"-\" character!"));
+      return false;
+    }
+    char ch = name.at(0);
+    if (isdigit(ch))
+    {
+		QMessageBox::information( NULL, tr("Error"),
+			tr("The layer name cannot have numerical characters!"));
+      return false;
+    }
+  }
+
+  return true;
+}
+
+
+bool TeKernelMethod::createLayer(TeRaster* raster,
+                                 TerraViewBase* mWindow)
+{
+ 
+  TeQtDatabasesListView* dbView = mWindow->getDatabasesListView();
+  if (!isNewLayer())  {
+
+    //Recupera item associado ao layer para poder remover 
+    TeQtLayerItem* lItPrev = dbView->currentLayerItem();
+    dbView->selectLayerItem(gridLayer_);
+    TeQtLayerItem* layerItem = dbView->currentLayerItem();
+    if (lItPrev != layerItem) {
+      mWindow->removeItem((TeQtCheckListItem*)layerItem);
+      if (lItPrev != NULL)
+        dbView->selectLayerItem(lItPrev->getLayer());
+    }
+    else {
+      mWindow->removeItem(layerItem);
+    }
+  }
+  TeLayer* l = new TeLayer(resName_, db_, raster->projection());
+  int bw, bh;
+  if (raster->params().ncols_ > 512)
+  {
+	  bw = 256;
+	  bh = 256;
+  }
+  else
+  {
+	  bw = raster->params().ncols_;
+	  bh = raster->params().nlines_;
+  }
+
+  	// create a raster geometry in a TerraLib database
+	TeRasterParams pDB = raster->params();
+	pDB.fileName_ = "rasterkernel" + Te2String(l->id()); // the name of the raster table that will contain the blob's
+	pDB.nBands(1);
+	pDB.setDataType(TeDOUBLE);
+	pDB.setDummy(raster->params().dummy_[0]);
+	pDB.mode_ = 'c';
+	// parameters specific of the database decoder
+	pDB.decoderIdentifier_ = "DB";			// a database decoder 
+	pDB.database_ = db_;					// pointer to the database
+	pDB.tiling_type_ = TeRasterParams::TeNoExpansible;      
+	pDB.blockHeight_ = bh;					// we are storing the entire raster in one block
+	pDB.blockWidth_ = bw;
+	pDB.setPhotometric(TeRasterParams::TeMultiBand);	// the photometric interpretation of the raster
+	TeRaster rstDb(pDB);
+	rstDb.init();
+	if (rstDb.params().status_ == TeRasterParams::TeReadyToWrite)
+	{
+		double val;
+		int col, lin;
+		for (lin=0;lin<rstDb.params().nlines_;++lin)
+			for (col=0;col<rstDb.params().ncols_;++col)
+			{
+				raster->getElement(col,lin,val,0);
+				rstDb.setElement(col,lin,val,0);
+			}
+	}
+    l->addRasterGeometry(&rstDb,"O1");	
+	rstDb.clear();
+	l->raster(0);
+ 
+  params_.generatedLayerId_ = l->id();
+  
+  TeQtDatabaseItem *dbItem = dbView->currentDatabaseItem();
+  
+  TeQtLayerItem *layerItem = 
+    new TeQtLayerItem((QListViewItem*)dbItem,l->name().c_str(), l);
+  layerItem->setEnabled(true);
+  if (!dbView->isOpen(layerItem->parent()))
+				dbView->setOpen(layerItem->parent(),true);
+  mWindow->checkWidgetEnabling();
+
+  //Verifica se existe tema com mesmo nome e remove
+	TeQtViewItem* curViewItem = mWindow->getViewsListView()->currentViewItem();
+	vector<TeQtThemeItem*> themeItemVec = curViewItem->getThemeItemVec();
+	unsigned int i;
+	for (i = 0; i < themeItemVec.size(); ++i)
+	{
+		TeAppTheme* appTheme = themeItemVec[i]->getAppTheme();
+		TeTheme* theme = (TeTheme*)appTheme->getTheme();
+		if (theme && !resName_.compare(theme->name()))
+		{
+			TeQtViewsListView* viewList = mWindow->getViewsListView();
+			TeQtThemeItem* themeItem = viewList->getThemeItem(appTheme);
+			if (themeItem != NULL)
+				mWindow->removeItem((TeQtCheckListItem*)themeItem);
+		}
+	}
+	TeAttrTableVector ATV;
+  if (! mWindow->createTheme(resName_, mWindow->currentView(), l, "", ATV))
+    return false;
+
+
+  //Recupera apontador para o tema criado
+	themeItemVec = curViewItem->getThemeItemVec();
+	for (i = 0; i < themeItemVec.size(); i++)
+	{
+		TeAppTheme* appTheme = themeItemVec[i]->getAppTheme();
+		TeTheme* theme = (TeTheme*)appTheme->getTheme();
+		if (!resName_.compare(theme->name()))
+		{
+			this->rasterTheme_ = theme;
+		}
+	}
+
+
+  if (this->rasterTheme_ == NULL) {
+      QMessageBox::information( NULL, tr("Error"),
+		  tr("There is no theme with the raster representation!"));
+      return false;
+  }
+  return true;
+}
+
+bool TeKernelMethod::createColumn(TeAppTheme* currTheme,
+                         TeQtGrid* grid) 
+{
+
+	grid->clear();
+	if(!insertPropertyColumn(*((TeSTStatInstanceSet *)this->regSet_),
+      0, regTheme_, params_.supportThemeTable_, params_.supportThemeAttr_))
+	  return false;
+
+	 // ---------------------------------------------- load updated table from database 
+	// Update all the themes that uses this table
+
+	TeViewMap& viewMap = this->db_->viewMap();
+	TeViewMap::iterator it;
+	set<TeLayer*> layerSet;
+	for (it = viewMap.begin(); it != viewMap.end(); ++it)
+	{
+		TeView *view = it->second;
+		vector<TeViewNode*>& themesVector = view->themes();
+		for (unsigned int i = 0; i < themesVector.size(); ++i)
+		{
+			if(themesVector[i]->type() == TeTHEME)
+			{
+				TeTheme* theme = (TeTheme*)themesVector[i];
+				if (theme->isThemeTable(params_.supportThemeTable_) == true)
+				{
+					theme->loadThemeTables();
+					layerSet.insert(theme->layer());
+				}
+			}
+		}
+	}
+
+	// Update the layer tables affected
+	set<TeLayer*>::iterator setIt;
+	for (setIt = layerSet.begin(); setIt != layerSet.end(); ++setIt)
+		(*setIt)->loadLayerTables();
+
+	// ---------------------------------------------- grid 
+	if(currTheme!= NULL)
+	{
+		grid->init(currTheme);
+		grid->refresh();
+		grid->goToLastColumn();
+	}
+
+	return true;
+}
+
+//Alterando pois soh precisa internamente
+bool TeKernelMethod::createKernelLegends(int nColors, bool /* color */, TeAppTheme* appTheme)
+{
+  	int precision;
+	if (!getPrecision(precision)) 
+	{
+		QMessageBox::critical(NULL, tr("Error"), 
+		tr("Unexpected error in the evaluation of the kernel precision!"));
+		return false;
+	}
+	
+	precision=15; //teste
+  
+	// recupera o tema sobre o qual foi calculado kernel
+	TeTheme* theme = 0;
+	if (this->rasterTheme_ != NULL)
+		theme = this->rasterTheme_;
+	else
+		theme = this->regTheme_;
+
+	TeAttributeRep rep;				  
+	rep.type_ = TeREAL;
+
+	TeGrouping groupKernel;
+	groupKernel.groupNumSlices_ = nColors;
+	groupKernel.groupPrecision_ = precision;
+
+	if (theme->layer()->geomRep() & TeRASTER)    // suporte foi grade
+	{
+		groupKernel.groupMode_ = TeRasterSlicing;
+		rep.name_ = "0";
+	}
+	else										// suporte foi regioes
+	{
+		groupKernel.groupMode_ = TeEqualSteps;
+		rep.name_ = this->params_.supportThemeTable_ + "." + this->params_.supportThemeAttr_;
+	}
+	groupKernel.groupAttribute_ = rep;
+
+	if (!theme->buildGrouping(groupKernel))
+		return false;
+  
+	vector<string> colorRamp;
+	colorRamp.push_back("CYAN");
+	colorRamp.push_back("GREEN");
+	colorRamp.push_back("YELLOW");
+	colorRamp.push_back("ORANGE");
+	colorRamp.push_back("RED");
+
+	// cria rampa de cores default para dados de kernel e define visual de cada fatia
+	vector<TeColor> colorGrad;
+	getColors(colorRamp,10, colorGrad);
+	for (int g=0; g<theme->grouping().groupNumSlices_; g++)
+	{
+		TeVisual visual(TePOLYGONS);            
+		visual.color(colorGrad[g]);
+		if((theme->layer()->geomRep() & TePOLYGONS) || 
+		   (theme->layer()->geomRep() & TeCELLS) || 
+		   (theme->layer()->geomRep() & TeRASTER))
+		{
+			visual.transparency(theme->defaultLegend().visual(TePOLYGONS)->transparency());
+			visual.contourStyle(theme->defaultLegend().visual(TePOLYGONS)->contourStyle());
+			visual.contourWidth(theme->defaultLegend().visual(TePOLYGONS)->contourWidth());
+			visual.contourColor(theme->defaultLegend().visual(TePOLYGONS)->contourColor());	
+			theme->setGroupingVisual(g+1,visual.copy(),TePOLYGONS);
+		}
+		if(theme->layer()->geomRep() & TeLINES)
+		{
+			visual.style(theme->defaultLegend().visual(TeLINES)->style());
+			visual.width(theme->defaultLegend().visual(TeLINES)->width());
+			theme->setGroupingVisual(g+1,visual.copy(),TeLINES);
+		}
+		else if(theme->layer()->geomRep() & TePOINTS)
+		{
+			visual.style(theme->defaultLegend().visual(TePOINTS)->style());
+			visual.size(theme->defaultLegend().visual(TePOINTS)->size());
+			theme->setGroupingVisual(g+1,visual.copy(),TePOINTS);
+		}
+	}
+	colorGrad.clear();
+
+	// acrescenta algumas informacoes relativas ao theme application
+
+	std::string scores("Cy-G-Y-Or-R");
+	vector<ColorBar> bg =  getColorBarVector(scores, true);
+ 	string groupingColors = getColors(bg, bg,TeEqualSteps);
+	appTheme->groupColor(groupingColors);
+	appTheme->countObj(false);
+	appTheme->mixColor(true);
+	appTheme->groupColorDir(TeColorAscSatBegin);
+	if (!theme->saveGrouping())
+		return false;
+	if (!(theme->layer()->geomRep() & TeRASTER)  && !theme->saveLegendInCollection())
+		return false;
+	
+	theme->visibleRep(theme->visibleRep() | 0x40000000);
+	updateAppTheme(this->db_,appTheme);
+
+	if (this->rasterTheme_ != NULL)
+		appTheme->setAlias("0",tr("Kernel Values").latin1());
+	return true;
+}
+
diff --git a/src/terralib/drivers/qt/TeQtTerraStat.h b/src/terralib/drivers/qt/TeQtTerraStat.h
old mode 100755
new mode 100644
index 97fc4b8..71fb532
--- a/src/terralib/drivers/qt/TeQtTerraStat.h
+++ b/src/terralib/drivers/qt/TeQtTerraStat.h
@@ -1,209 +1,210 @@
-#ifndef  __TERRALIB_INTERNAL_QTTERRASTAT_H
-#define  __TERRALIB_INTERNAL_QTTERRASTAT_H
-/***
- * Implementa suporte para as funcoes do TerraStat
- * Objetivo -- soh nao manter a parte de geracao de eventos,
- * etc no ui, que podera ser reaproveitado.
- ****/
-
-#include "TeDatabase.h"
-#include "TeKernelParams.h"
-#include <qmessagebox.h>
-#include <terraViewBase.h>
-
-
-#define STAT_PRECISION   12
-/////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////
-
-class TeSTElementSet;
-class TeSTStatInstanceSet;
-
-/**
- * Grava uma coluna na tabela de atributos associada a um STOSet.
- * Nome da coluna eh o mesmo nome da propriedade
- **/
-bool insertPropertyColumn(TeSTElementSet& stoSet,
-                          const string& tableName,
-                          const string& columnName);
-
-bool insertPropertyColumn(TeSTStatInstanceSet& stSet,
-                          int idxDoubleProp,
-                          TeTheme* theme,
-                          const string& tableName,
-                          const string& columnName);
-
-/***
- * Cria um STOSet a partir de um tema e um conjunto de atributos,
- * colocando todas as tabelas do TEMA
- ***/
-bool createSTOSetFromTheme(TeTheme* theme, 
-                              vector<string>& attributes,
-                              TeSTElementSet* rs);
-
-
-/***
- * Cria um STOSet a partir de um tema e um conjunto de atributos,
- * colocando todas as tabelas do TEMA
- ***/
-bool createSTOStatSetFromTheme(TeTheme* theme, 
-                               vector<string>& attributes,
-                               int additionalDouble,
-                               TeSTStatInstanceSet* rs);
-
- 
-enum TeKernelErrorType {Uerror, Error, Warning};
-
-
-///Retorna legenda do kernel
-bool getKernelLegend(TeKernelParams& par, vector<string>& legend);
-
-/** Classe para aplicar o metodo de Kernel **/
-class TeKernelMethod : public QWidget {
-
-	Q_OBJECT
-
-protected:
-    TeTheme*       evTheme1_;
-    TeTheme*       evTheme2_;
-    TeTheme*       regTheme_;
-    TeTheme*       rasterTheme_;
-
-
-    /**
-     * Pointers to containers -- void since different types may apply
-     * should dispose them
-     **/
-    void*          evSet1_;
-    void*          evSet2_;
-    void*          regSet_;
-    int            precision_;
-    TeLayer*       gridLayer_;
-    bool           justOnePolygon_;
-    TePolygon      boundary_;
-
-    bool           call();
-    bool           generateEventSet(int which);
-    bool           generateSupportSet();
-    void           error(TeKernelErrorType type, string message, 
-						QWidget* parent = 0);
-
-
-    //Calcula a precisao para um conjunto de valores
-    template<typename SetIt> 
-    bool           getPrecision(SetIt itBegin, SetIt itEnd) {
-      
-      
-      SetIt it = itBegin;
-      
-      double max = -TeMAXFLOAT;
-      double min = TeMAXFLOAT;
-      
-      double kValue;
-      while (it != itEnd) {
-        
-        if ((*it).getDoubleProperty(0, kValue)) {
-          if (kValue > max)
-            max = kValue;
-          if ((kValue > 0) && (kValue < min))
-            min = kValue;
-        }
-        ++it;
-      }
-      
-      if (min == TeMAXFLOAT)
-        return false;
-      if (max == -TeMAXFLOAT)
-        return false;
-
-      double diff = max - min;
-
-      double prec = log10(diff);
-      //Diferenca esta antes da virgula
-      if (prec > 0) {
-        precision_ = 2;
-      }
-      else {
-        precision_ = (int)(ceil(fabs(prec)) + 3);
-      }
-      return true;
-    }
-    
-
-public:
-
-    TeKernelParams params_;
-
-    /** Geracao de conjuntos **/
-    bool           isPoint1_;
-    bool           isPoint2_;
-
-    bool			isGridEv_;
-    bool			isGridReg_;
-    int				gridCols_;
-	TeDatabase*		db_;
-    string			resName_; //Nome do layer ou da coluna gerada
-
-    TeKernelMethod():
-		evTheme1_(0),
-		evTheme2_(0),
-		regTheme_(0),
-		rasterTheme_(0),
-		evSet1_(0),
-		evSet2_(0),
-		regSet_(0),
-		precision_(-1),
-		isPoint1_(true),
-		isPoint2_(true),
-		isGridEv_(false),
-		isGridReg_(false),
-		gridCols_(0),
-		db_(0)
-		{}
-
-	~TeKernelMethod();
-
-    //Recupera tema e inicializa os parametros necessarios
-    bool setTheme(string name, int id, TeView* view); 
-
-    //Define nome de layer para criacao de grid
-    bool setGridLayer(string name);
-
-    //Verifica se layer eh nova
-    bool isNewLayer() {
-      return gridLayer_ == NULL;
-    }
-
-    //Cria layer de grid para criar uma nova
-    bool createLayer(TeRaster* raster, TerraViewBase* mWindow);
-
-    bool createColumn(TeAppTheme* currTheme, TeQtGrid* grid);
-
-    //Aplica o metodo de kernel
-    bool apply(void*& regSet, QWidget* parent);
-
-    //Recupera precisao dos dados
-    //Definida como prec(max - min) + 3
-    bool getPrecision(int& prec);
-
-    TeTheme* getTheme(int id) {
-      if (id == 0)
-        return (TeTheme *)regTheme_;
-      if (id == 1)
-        return evTheme1_;
-      if (id == 2)
-        return evTheme2_;
-      return NULL;
-    }
-
-    bool createKernelLegends(int nColors, bool color, TeAppTheme* appTheme);
-
-	TeTheme* regTheme()
-	{	return regTheme_; }
-
-	TeTheme* rasterTheme()
-	{	return rasterTheme_; }
-
-};
-
-#endif
+#ifndef  __TERRALIB_INTERNAL_QTTERRASTAT_H
+#define  __TERRALIB_INTERNAL_QTTERRASTAT_H
+/***
+ * Implementa suporte para as funcoes do TerraStat
+ * Objetivo -- soh nao manter a parte de geracao de eventos,
+ * etc no ui, que podera ser reaproveitado.
+ ****/
+
+#include "TeDatabase.h"
+#include "TeKernelParams.h"
+#include <qmessagebox.h>
+#include <terraViewBase.h>
+
+#include "TViewDefines.h"
+
+#define STAT_PRECISION   12
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+
+class TeSTElementSet;
+class TeSTStatInstanceSet;
+
+/**
+ * Grava uma coluna na tabela de atributos associada a um STOSet.
+ * Nome da coluna eh o mesmo nome da propriedade
+ **/
+TVIEW_DLL bool insertPropertyColumn(TeSTElementSet& stoSet,
+                          const string& tableName,
+                          const string& columnName);
+
+TVIEW_DLL bool insertPropertyColumn(TeSTStatInstanceSet& stSet,
+                          int idxDoubleProp,
+                          TeTheme* theme,
+                          const string& tableName,
+                          const string& columnName);
+
+/***
+ * Cria um STOSet a partir de um tema e um conjunto de atributos,
+ * colocando todas as tabelas do TEMA
+ ***/
+TVIEW_DLL bool createSTOSetFromTheme(TeTheme* theme, 
+                              vector<string>& attributes,
+                              TeSTElementSet* rs);
+
+
+/***
+ * Cria um STOSet a partir de um tema e um conjunto de atributos,
+ * colocando todas as tabelas do TEMA
+ ***/
+TVIEW_DLL bool createSTOStatSetFromTheme(TeTheme* theme, 
+                               vector<string>& attributes,
+                               int additionalDouble,
+                               TeSTStatInstanceSet* rs);
+
+ 
+enum TeKernelErrorType {Uerror, Error, Warning};
+
+
+///Retorna legenda do kernel
+TVIEW_DLL bool getKernelLegend(TeKernelParams& par, vector<string>& legend);
+
+/** Classe para aplicar o metodo de Kernel **/
+class TVIEW_DLL TeKernelMethod : public QWidget {
+
+	Q_OBJECT
+
+protected:
+    TeTheme*       evTheme1_;
+    TeTheme*       evTheme2_;
+    TeTheme*       regTheme_;
+    TeTheme*       rasterTheme_;
+
+
+    /**
+     * Pointers to containers -- void since different types may apply
+     * should dispose them
+     **/
+    void*          evSet1_;
+    void*          evSet2_;
+    void*          regSet_;
+    int            precision_;
+    TeLayer*       gridLayer_;
+    bool           justOnePolygon_;
+    TePolygon      boundary_;
+
+    bool           call();
+    bool           generateEventSet(int which);
+    bool           generateSupportSet();
+    void           error(TeKernelErrorType type, string message, 
+						QWidget* parent = 0);
+
+
+    //Calcula a precisao para um conjunto de valores
+    template<typename SetIt> 
+    bool           getPrecision(SetIt itBegin, SetIt itEnd) {
+      
+      
+      SetIt it = itBegin;
+      
+      double max = -TeMAXFLOAT;
+      double min = TeMAXFLOAT;
+      
+      double kValue;
+      while (it != itEnd) {
+        
+        if ((*it).getDoubleProperty(0, kValue)) {
+          if (kValue > max)
+            max = kValue;
+          if ((kValue > 0) && (kValue < min))
+            min = kValue;
+        }
+        ++it;
+      }
+      
+      if (min == TeMAXFLOAT)
+        return false;
+      if (max == -TeMAXFLOAT)
+        return false;
+
+      double diff = max - min;
+
+      double prec = log10(diff);
+      //Diferenca esta antes da virgula
+      if (prec > 0) {
+        precision_ = 2;
+      }
+      else {
+        precision_ = (int)(ceil(fabs(prec)) + 3);
+      }
+      return true;
+    }
+    
+
+public:
+
+    TeKernelParams params_;
+
+    /** Geracao de conjuntos **/
+    bool           isPoint1_;
+    bool           isPoint2_;
+
+    bool			isGridEv_;
+    bool			isGridReg_;
+    int				gridCols_;
+	TeDatabase*		db_;
+    string			resName_; //Nome do layer ou da coluna gerada
+
+    TeKernelMethod():
+		evTheme1_(0),
+		evTheme2_(0),
+		regTheme_(0),
+		rasterTheme_(0),
+		evSet1_(0),
+		evSet2_(0),
+		regSet_(0),
+		precision_(-1),
+		isPoint1_(true),
+		isPoint2_(true),
+		isGridEv_(false),
+		isGridReg_(false),
+		gridCols_(0),
+		db_(0)
+		{}
+
+	~TeKernelMethod();
+
+    //Recupera tema e inicializa os parametros necessarios
+    bool setTheme(string name, int id, TeView* view); 
+
+    //Define nome de layer para criacao de grid
+    bool setGridLayer(string name);
+
+    //Verifica se layer eh nova
+    bool isNewLayer() {
+      return gridLayer_ == NULL;
+    }
+
+    //Cria layer de grid para criar uma nova
+    bool createLayer(TeRaster* raster, TerraViewBase* mWindow);
+
+    bool createColumn(TeAppTheme* currTheme, TeQtGrid* grid);
+
+    //Aplica o metodo de kernel
+    bool apply(void*& regSet, QWidget* parent);
+
+    //Recupera precisao dos dados
+    //Definida como prec(max - min) + 3
+    bool getPrecision(int& prec);
+
+    TeTheme* getTheme(int id) {
+      if (id == 0)
+        return (TeTheme *)regTheme_;
+      if (id == 1)
+        return evTheme1_;
+      if (id == 2)
+        return evTheme2_;
+      return NULL;
+    }
+
+    bool createKernelLegends(int nColors, bool color, TeAppTheme* appTheme);
+
+	TeTheme* regTheme()
+	{	return regTheme_; }
+
+	TeTheme* rasterTheme()
+	{	return rasterTheme_; }
+
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtTextEdit.cpp b/src/terralib/drivers/qt/TeQtTextEdit.cpp
old mode 100755
new mode 100644
index f739597..4dc9b64
--- a/src/terralib/drivers/qt/TeQtTextEdit.cpp
+++ b/src/terralib/drivers/qt/TeQtTextEdit.cpp
@@ -1,862 +1,862 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtTextEdit.h>
-#include <TeDefines.h>
-
-TeQtTextEdit::TeQtTextEdit()
-{
-	canvas_ = 0;
-	edit_ = false;
-	mode_ = 0;
-}
-
-TeQtTextEdit::TeQtTextEdit(TeText& tx, TeVisual v, TeQtCanvas* canvas)
-{
-	edit_ = true;
-	mode_ = 0;
-	canvas_ = canvas;
-	text_ = tx;
-	visual_ = v;
-	change();
-}
-
-TeQtTextEdit::~TeQtTextEdit ()
-{
-}
-
-void 
-TeQtTextEdit::change(QPoint p, bool apxAngle)
-{
-	double angle, dx, dy;
-
-	if(mode_ == 1) // change angle from left
-	{
-		dx = -(p.x() - pCenter_.x());
-		dy = p.y() - pCenter_.y();
-
-		if(apxAngle)
-		{
-			double fdx = fabs(dx);
-			double fdy = fabs(dy);
-			if(fdx < fdy)
-			{
-				if(4*fdx < fdy)
-					dx = 0.;
-				else
-				{
-					fdx = fdy;
-					if(dx >= 0)
-						dx = fdx;
-					else
-						dx = -fdx;
-				}
-			}
-			else
-			{
-				if(4*fdy < fdx)
-					dy = 0.;
-				else
-				{
-					fdy = fdx;
-					if(dy >= 0)
-						dy = fdy;
-					else
-						dy = -fdy;
-				}
-			}
-		}
-		if(dx == 0)
-		{
-			if(dy > 0)
-				angle = 90;
-			else
-				angle = 270;
-		}
-		else
-		{
-			if(dx > 0)
-				angle = atan(dy/dx) * 180. / TePI;
-			else
-				angle = atan(dy/dx) * 180. / TePI + 180;
-		}
-		text_.setAngle(angle);
-	}
-	else if(mode_ == 2) // change angle from right
-	{
-		dx = p.x() - pCenter_.x();
-		dy = -(p.y() - pCenter_.y());
-
-		if(apxAngle)
-		{
-			double fdx = fabs(dx);
-			double fdy = fabs(dy);
-			if(fdx < fdy)
-			{
-				if(4*fdx < fdy)
-					dx = 0.;
-				else
-				{
-					fdx = fdy;
-					if(dx >= 0)
-						dx = fdx;
-					else
-						dx = -fdx;
-				}
-			}
-			else
-			{
-				if(4*fdy < fdx)
-					dy = 0.;
-				else
-				{
-					fdy = fdx;
-					if(dy >= 0)
-						dy = fdy;
-					else
-						dy = -fdy;
-				}
-			}
-		}
-		if(dx == 0)
-		{
-			if(dy > 0)
-				angle = 90;
-			else
-				angle = 270;
-		}
-		else
-		{
-			if(dx > 0)
-				angle = atan(dy/dx) * 180. / TePI;
-			else
-				angle = atan(dy/dx) * 180. / TePI + 180;
-		}
-		text_.setAngle(angle);
-	}
-	else if(mode_ == 3 || mode_ == 4) // change size
-	{
-		if(visual_.fixedSize() == false)
-		{
-			double dx = fabs(double(pCenter_.x() - p.x()));
-			double dy = fabs(double(pCenter_.y() - p.y()));
-			int h = apx(sqrt(dx*dx + dy*dy));
-
-			double dh, hc, c = 1.;
-
-			hc = h * c;
-			dh = canvas_->mapVtoDW((int)hc);
-			text_.setHeight(dh);
-			QRect r = canvas_->textRect (text_, visual_);
-			while(r.height()/2 <= h-1)
-			{
-				c *= 1.01;
-				hc = h * c;
-				dh = canvas_->mapVtoDW((int)hc);
-				text_.setHeight(dh);
-				r = canvas_->textRect (text_, visual_);
-			}
-		}
-	}
-	else if(mode_ == 5) // change position
-	{
-		TeCoord2D pt = canvas_->mapVtoDW(p);
-		text_.add(pt);
-	}
-	change();
-}
-
-void 
-TeQtTextEdit::init(TeText& tx, TeVisual v, TeQtCanvas* canvas)
-{
-	edit_ = true;
-	mode_ = 0;
-	canvas_ = canvas;
-	text_ = tx;
-	visual_ = v;
-	change();
-}
-
-void 
-TeQtTextEdit::change()
-{
-	QRect rect = canvas_->textRect(text_, visual_);
-
-	pCenter_ = rect.center();
-
-	pLeft_ = rect.center();
-	pLeft_.setX(rect.left()+3);
-
-	pRight_ = rect.center();
-	pRight_.setX(rect.right()-3);
-
-	pTop_ = rect.center();
-	pTop_.setY(rect.top()+3);
-
-	pBottom_ = rect.center();
-	pBottom_.setY(rect.bottom()-3);
-
-	double angle = text_.angle();
-	if(angle == 0)
-	{
-//		canvas_->plotOnWindow();
-//		canvas_->plotTextRects(text_, visual_);
-//		canvas_->plotOnPixmap0();
-		return;
-	}
-
-	int	nx, ny;
-	double	d;
-
-	d = fabs(double(pRight_.x() - pCenter_.x()));
-	nx = pCenter_.x() + apx(cos(angle*TePI/180.) * d);
-	ny = pCenter_.y() - apx(sin(angle*TePI/180.) * d);
-	pRight_ = QPoint(nx, ny);
-
-	d = fabs(double(pLeft_.x() - pCenter_.x()));
-	nx = pCenter_.x() + apx(cos((180.+angle)*TePI/180.) * d);
-	ny = pCenter_.y() - apx(sin((180.+angle)*TePI/180.) * d);
-	pLeft_ = QPoint(nx, ny);
-
-	d = fabs(double(pTop_.y() - pCenter_.y()));
-	nx = pCenter_.x() + apx(cos((90.+angle)*TePI/180.) * d);
-	ny = pCenter_.y() - apx(sin((90.+angle)*TePI/180.) * d);
-	pTop_ = QPoint(nx, ny);
-
-	d = fabs(double(pBottom_.y() - pCenter_.y()));
-	nx = pCenter_.x() + apx(cos((270.+angle)*TePI/180.) * d);
-	ny = pCenter_.y() - apx(sin((270.+angle)*TePI/180.) * d);
-	pBottom_ = QPoint(nx, ny);
-
-//	canvas_->plotTextRects(text_, visual_);
-}
-
-int
-TeQtTextEdit::apx(double d)
-{
-	if(d >= 0)
-		return (int)(d+.5);
-	else
-		return (int)(d-.5);
-}
-
-int
-TeQtTextEdit::located(QPoint& p)
-{
-	QRect rLeft(0, 0, 6, 6), rRight(0, 0, 6, 6), rTop(0, 0, 6, 6), rBottom(0, 0, 6, 6), rCenter(0, 0, 6, 6);
-	rLeft.moveCenter(pLeft_);
-	rRight.moveCenter(pRight_);
-	rTop.moveCenter(pTop_);
-	rBottom.moveCenter(pBottom_);
-	rCenter.moveCenter(pCenter_);
-
-	mode_ = 0;
-	double d, m = TeMAXFLOAT;
-
-	if(rLeft.contains(p))
-	{
-		QPoint a(rLeft.left() + rLeft.width()/2, rLeft.left() + rLeft.height()/2);
-		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
-		m = MIN(m, d);
-		if(m == d)
-			mode_ = 1;
-	}
-	if(rRight.contains(p))
-	{
-		QPoint a(rRight.left() + rRight.width()/2, rRight.left() + rRight.height()/2);
-		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
-		m = MIN(m, d);
-		if(m == d)
-			mode_ = 2;
-	}
-	if(rTop.contains(p))
-	{
-		QPoint a(rTop.left() + rTop.width()/2, rTop.left() + rTop.height()/2);
-		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
-		m = MIN(m, d);
-		if(m == d)
-			mode_ = 3;
-	}
-	if(rBottom.contains(p))
-	{
-		QPoint a(rBottom.left() + rBottom.width()/2, rBottom.left() + rBottom.height()/2);
-		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
-		m = MIN(m, d);
-		if(m == d)
-			mode_ = 4;
-	}
-	if(rCenter.contains(p))
-	{
-		QPoint a(rCenter.left() + rCenter.width()/2, rCenter.left() + rCenter.height()/2);
-		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
-		m = MIN(m, d);
-		mode_ = 5;
-	}
-
-	if(mode_ == 1)
-		pLeft_ = p;
-	else if(mode_ == 2)
-		pRight_ = p;
-	else if(mode_ == 3)
-		pTop_ = p;
-	else if(mode_ == 4)
-		pBottom_ = p;
-	else if(mode_ == 5)
-		pCenter_ = p;
-
-	return mode_;
-}
-
-bool
-TeQtTextEdit::isHotPoint(QPoint& p)
-{
-	QRect rLeft(0, 0, 6, 6), rRight(0, 0, 6, 6), rTop(0, 0, 6, 6), rBottom(0, 0, 6, 6), rCenter(0, 0, 6, 6);
-	rLeft.moveCenter(pLeft_);
-	rRight.moveCenter(pRight_);
-	rTop.moveCenter(pTop_);
-	rBottom.moveCenter(pBottom_);
-	rCenter.moveCenter(pCenter_);
-
-	mode_ = 0;
-	double d, m = TeMAXFLOAT;
-
-	if(rLeft.contains(p))
-	{
-		QPoint a(rLeft.left() + rLeft.width()/2, rLeft.left() + rLeft.height()/2);
-		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
-		m = MIN(m, d);
-		if(m == d)
-			mode_ = 1;
-	}
-	if(rRight.contains(p))
-	{
-		QPoint a(rRight.left() + rRight.width()/2, rRight.left() + rRight.height()/2);
-		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
-		m = MIN(m, d);
-		if(m == d)
-			mode_ = 2;
-	}
-	if(rTop.contains(p))
-	{
-		QPoint a(rTop.left() + rTop.width()/2, rTop.left() + rTop.height()/2);
-		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
-		m = MIN(m, d);
-		if(m == d)
-			mode_ = 3;
-	}
-	if(rBottom.contains(p))
-	{
-		QPoint a(rBottom.left() + rBottom.width()/2, rBottom.left() + rBottom.height()/2);
-		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
-		m = MIN(m, d);
-		if(m == d)
-			mode_ = 4;
-	}
-	if(rCenter.contains(p))
-	{
-		QPoint a(rCenter.left() + rCenter.width()/2, rCenter.left() + rCenter.height()/2);
-		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
-		m = MIN(m, d);
-		mode_ = 5;
-	}
-
-	if(mode_ > 0)
-		return true;
-	return false;
-}
-
-void
-TeQtTextEdit::endEdit()
-{
-	edit_ = false;
-	mode_ = 0;
-}
-
-int
-TeQtTextEdit::mode()
-{
-	return mode_;
-}
-
-void
-TeQtTextEdit::mode(int mode)
-{
-	mode_ = mode;
-}
-
-bool
-TeQtTextEdit::edit()
-{
-	return edit_;
-}
-
-TeText
-TeQtTextEdit::text()
-{
-	return text_;
-}
-
-void
-TeQtTextEdit::text(TeText t)
-{
-	text_ = t;
-}
-
-void
-TeQtTextEdit::height(double h)
-{
-	text_.setHeight(h);
-}
-
-void
-TeQtTextEdit::angle(double a)
-{
-	text_.setAngle(a);
-}
-
-void
-TeQtTextEdit::addPosition(TeCoord2D p)
-{
-	TeCoord2D tp = text_.location();
-	tp += p;
-	text_.add(tp);
-}
-
-TeQtCanvas*
-TeQtTextEdit::canvas()
-{
-	return canvas_;
-}
-
-QRect
-TeQtTextEdit::getRect()
-{
-	QRect rect = canvas_->textRect(text_, visual_);
-	int	x1 = rect.left();
-	int	y1 = rect.top();
-	int	x2 = rect.right();
-	int	y2 = rect.bottom();
-
-	double angle = text_.angle() * -1;
-	if(!(angle == 0 || angle == 90 || angle == 180 || angle == 270))
-	{
-		double d, dx, dy, alfa, beta;
-		QPoint c = rect.center();
-		QPoint p, p1, p2, p3, p4;
-
-		p = QPoint(x1, y1);
-		dx = p.x() - c.x();
-		dy = p.y() - c.y();
-		alfa = atan(dy/dx) * 180. / TePI;
-		if(dx<0)
-			alfa = 180. + alfa;
-		else if(dx>=0 && dy<0)
-			alfa = 360. + alfa;
-		beta = alfa + angle;
-		d = sqrt(double((p.x()-c.x()) * (p.x()-c.x()) + (p.y()-c.y()) * (p.y()-c.y())));
-		p1.setX(c.x() + TeRound(cos(beta*TePI/180.) * d));
-		p1.setY(c.y() + TeRound(sin(beta*TePI/180.) * d));
-
-		p = QPoint(x1, y2);
-		dx = p.x() - c.x();
-		dy = p.y() - c.y();
-		alfa = atan(dy/dx) * 180. / TePI;
-		if(dx<0)
-			alfa = 180. + alfa;
-		else if(dx>=0 && dy<0)
-			alfa = 360. + alfa;
-		beta = alfa + angle;
-		d = sqrt(double((p.x()-c.x()) * (p.x()-c.x()) + (p.y()-c.y()) * (p.y()-c.y())));
-		p2.setX(c.x() + TeRound(cos(beta*TePI/180.) * d));
-		p2.setY(c.y() + TeRound(sin(beta*TePI/180.) * d));
-
-		p = QPoint(x2, y1);
-		dx = p.x() - c.x();
-		dy = p.y() - c.y();
-		alfa = atan(dy/dx) * 180. / TePI;
-		if(dx<0)
-			alfa = 180. + alfa;
-		else if(dx>=0 && dy<0)
-			alfa = 360. + alfa;
-		beta = alfa + angle;
-		d = sqrt(double((p.x()-c.x()) * (p.x()-c.x()) + (p.y()-c.y()) * (p.y()-c.y())));
-		p3.setX(c.x() + TeRound(cos(beta*TePI/180.) * d));
-		p3.setY(c.y() + TeRound(sin(beta*TePI/180.) * d));
-
-		p = QPoint(x2, y2);
-		dx = p.x() - c.x();
-		dy = p.y() - c.y();
-		alfa = atan(dy/dx) * 180. / TePI;
-		if(dx<0)
-			alfa = 180. + alfa;
-		else if(dx>=0 && dy<0)
-			alfa = 360. + alfa;
-		beta = alfa + angle;
-		d = sqrt(double((p.x()-c.x()) * (p.x()-c.x()) + (p.y()-c.y()) * (p.y()-c.y())));
-		p4.setX(c.x() + TeRound(cos(beta*TePI/180.) * d));
-		p4.setY(c.y() + TeRound(sin(beta*TePI/180.) * d));
-
-		x1 = MIN(p1.x(), p2.x());
-		x1 = MIN(x1, p3.x());
-		x1 = MIN(x1, p4.x());
-		y1 = MIN(p1.y(), p2.y());
-		y1 = MIN(y1, p3.y());
-		y1 = MIN(y1, p4.y());
-		x2 = MAX(p1.x(), p2.x());
-		x2 = MAX(x2, p3.x());
-		x2 = MAX(x2, p4.x());
-		y2 = MAX(p1.y(), p2.y());
-		y2 = MAX(y2, p3.y());
-		y2 = MAX(y2, p4.y());
-
-		rect.setLeft(x1);
-		rect.setTop(y1);
-		rect.setRight(x2);
-		rect.setBottom(y2);
-	}
-	return rect;
-//	QRect rect;
-//	int	x1, y1, x2, y2;
-
-//	x1 = pLeft_.x();
-//	x1 = MIN(x1, pRight_.x());
-//	x1 = MIN(x1, pTop_.x());
-//	x1 = MIN(x1, pBottom_.x());
-
-//	y1 = pLeft_.y();
-//	y1 = MIN(y1, pRight_.y());
-//	y1 = MIN(y1, pTop_.y());
-//	y1 = MIN(y1, pBottom_.y());
-
-//	x2 = pLeft_.x();
-//	x2 = MAX(x2, pRight_.x());
-//	x2 = MAX(x2, pTop_.x());
-//	x2 = MAX(x2, pBottom_.x());
-
-//	y2 = pLeft_.y();
-//	y2 = MAX(y2, pRight_.y());
-//	y2 = MAX(y2, pTop_.y());
-//	y2 = MAX(y2, pBottom_.y());
-
-//	if(text_.angle() == 0 || text_.angle() == 90 || text_.angle() == 180 || text_.angle() == 270)
-//		rect = QRect(x1-3, y1-3, x2-x1+7, y2-y1+7);
-//	else
-//	{
-//		int h = y2 - y1;
-//		int w = x2 - x1;
-//		int	d = h;
-//		if(w < h)
-//			d = w;
-//		x1 -= d;
-//		y1 -= d;
-//		x2 += d;
-//		y2 += d;
-//		rect = QRect(x1, y1, x2-x1, y2-y1);
-//	}
-//	return rect;
-}
-
-QRect
-TeQtTextEdit::getHRect()
-{
-	return canvas_->textRect(text_, visual_);
-}
-
-TeQtMultiTextEdit::TeQtMultiTextEdit()
-{
-	current_ = -1;
-	selMode_ = false;
-}
-
-TeQtMultiTextEdit::~TeQtMultiTextEdit()
-{
-}
-
-int
-TeQtMultiTextEdit::size()
-{
-	return textVec_.size();
-}
-
-void
-TeQtMultiTextEdit::push(TeQtTextEdit t)
-{
-	int geomId = t.text().geomId();
-	if(geomIdSet_.find(geomId) == geomIdSet_.end())
-	{
-		geomIdSet_.insert(geomId);
-		textVec_.push_back(t);
-		current_ = textVec_.size() - 1;
-	}
-}
-
-void
-TeQtMultiTextEdit::change()
-{
-	if(current_ == -1 || textVec_.empty())
-		return;
-
-//	canvas->plotOnWindow();
-	unsigned int i;
-	for(i=0; i<textVec_.size(); i++)
-	{
-		TeQtTextEdit& t = textVec_[i];
-		t.change();
-	}
-}
-
-void
-TeQtMultiTextEdit::change(QPoint p, bool apxAngle)
-{
-	if(current_ == -1 || textVec_.empty())
-		return;
-
-	TeQtTextEdit& t = textVec_[current_];
-	TeCoord2D pa = t.text().location();
-	t.change(p, apxAngle);
-	TeCoord2D pb = t.text().location();
-	TeCoord2D poffset(pb.x()-pa.x(), pb.y()-pa.y());
-
-	if(t.mode()==1 || t.mode()==2)
-		angle(t.text().angle());
-	else if(t.mode()==3 || t.mode()==4)
-		height(t.text().height());
-	else if(t.mode() == 5)
-		addPosition(poffset);
-	change();
-}
-
-int 
-TeQtMultiTextEdit::located(QPoint& p)
-{
-	unsigned int i;
-	int mode = 0;
-	for(i=0; i<textVec_.size(); i++)
-	{
-		TeQtTextEdit& t = textVec_[i];
-		mode = t.located(p);
-		if(mode)
-		{
-			current_ = i;
-			break;
-		}
-	}
-	return mode;
-}
-
-bool
-TeQtMultiTextEdit::isHotPoint(QPoint& p)
-{
-	if(textVec_.size() == 0)
-		return false;
-
-	unsigned int i;
-	for(i=0; i<textVec_.size(); i++)
-	{
-		TeQtTextEdit& t = textVec_[i];
-		if(t.isHotPoint(p))
-		{
-			current_ = i;
-			break;
-		}
-	}
-	if(i < textVec_.size())
-		return true;
-	return false;
-}
-
-void
-TeQtMultiTextEdit::endEdit()
-{
-	unsigned int i;
-	for(i=0; i<textVec_.size(); i++)
-	{
-		TeQtTextEdit& t = textVec_[i];
-		t.endEdit();
-	}
-	textVec_.clear();
-	geomIdSet_.clear();
-}
-
-int
-TeQtMultiTextEdit::mode()
-{
-	if(current_ >= 0 && textVec_.empty() == false)
-		return textVec_[current_].mode();
-	return 0;
-}
-
-void
-TeQtMultiTextEdit::mode(int m)
-{
-	if(current_ >= 0 && textVec_.empty() == false)
-		textVec_[current_].mode(m);
-}
-
-bool
-TeQtMultiTextEdit::selMode()
-{
-	return selMode_;
-}
-
-void
-TeQtMultiTextEdit::selMode(bool m)
-{
-	selMode_ = m;
-}
-
-bool
-TeQtMultiTextEdit::edit()
-{
-	if(current_ >= 0 && textVec_.empty() == false)
-		return textVec_[current_].edit();
-	return false;
-}
-
-TeText
-TeQtMultiTextEdit::text(int i)
-{
-	TeText t;
-	if(i<(int)textVec_.size())
-		return textVec_[i].text();
-	else
-		return t;
-}
-
-TeVisual
-TeQtMultiTextEdit::visual(int i)
-{
-	TeVisual v;
-	if(i<(int)textVec_.size())
-		return textVec_[i].visual();
-	else
-		return v;
-}
-
-void
-TeQtMultiTextEdit::height(double h)
-{
-	int i;
-	for(i=0; i<(int)textVec_.size(); i++)
-	{
-		if(i == current_)
-			continue;
-		TeQtTextEdit& t = textVec_[i];
-		t.height(h);
-	}
-}
-
-void
-TeQtMultiTextEdit::angle(double a)
-{
-	int i;
-	for(i=0; i<(int)textVec_.size(); i++)
-	{
-		if(i == current_)
-			continue;
-		TeQtTextEdit& t = textVec_[i];
-		t.angle(a);
-	}
-}
-
-void
-TeQtMultiTextEdit::addPosition(TeCoord2D p)
-{
-	int i;
-	for(i=0; i<(int)textVec_.size(); i++)
-	{
-		if(i == current_)
-			continue;
-		TeQtTextEdit& t = textVec_[i];
-		t.addPosition(p);
-	}
-}
-
-QRect
-TeQtMultiTextEdit::getRect()
-{
-	QRect	rect;
-	int i;
-	for(i=0; i<(int)textVec_.size(); i++)
-	{
-		TeQtTextEdit& t = textVec_[i];
-		rect = rect | t.getRect();
-	}
-	return rect;
-}
-
-int
-TeQtMultiTextEdit::getTextIndex(QPoint p)
-{
-	int i;
-	for(i=0; i<(int)textVec_.size(); i++)
-	{
-		TeQtTextEdit& t = textVec_[i];
-		QRect rect = t.getHRect();
-		TeText tx = t.text();
-		double angle = tx.angle() * -1;
-
-		if(angle == 0)
-		{
-			if(rect.contains(p, true))
-				return i;
-		}
-		else
-		{
-			double d, dx, dy, alfa, beta;
-			QPoint c = rect.center();
-
-			dx = p.x() - c.x();
-			dy = p.y() - c.y();
-			alfa = atan(dy/dx) * 180. / TePI;
-			if(dx<0)
-				alfa = 180. + alfa;
-			else if(dx>=0 && dy<0)
-				alfa = 360. + alfa;
-			beta = alfa - angle;
-			d = sqrt(double((p.x()-c.x()) * (p.x()-c.x()) + (p.y()-c.y()) * (p.y()-c.y())));
-			int x = c.x() + TeRound(cos(beta*TePI/180.) * d);
-			int y = c.y() + TeRound(sin(beta*TePI/180.) * d);
-
-			QPoint pp(x, y);
-			if(rect.contains(pp))
-				return i;
-		}
-	}
-	return -1;
-}
-
-void
-TeQtMultiTextEdit::updateText(int index, string t)
-{
-	TeText tx = textVec_[index].text();
-	tx.setTextValue(t);
-	textVec_[index].text(tx);
-	textVec_[index].change();
-}
-
-void
-TeQtMultiTextEdit::visual(const TeVisual& visual)
-{
-	unsigned int i;
-	for(i=0; i<textVec_.size(); i++)
-		textVec_[i].visual(visual);
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeQtTextEdit.h>
+#include <TeDefines.h>
+
+TeQtTextEdit::TeQtTextEdit()
+{
+	canvas_ = 0;
+	edit_ = false;
+	mode_ = 0;
+}
+
+TeQtTextEdit::TeQtTextEdit(TeText& tx, TeVisual v, TeQtCanvas* canvas)
+{
+	edit_ = true;
+	mode_ = 0;
+	canvas_ = canvas;
+	text_ = tx;
+	visual_ = v;
+	change();
+}
+
+TeQtTextEdit::~TeQtTextEdit ()
+{
+}
+
+void 
+TeQtTextEdit::change(QPoint p, bool apxAngle)
+{
+	double angle, dx, dy;
+
+	if(mode_ == 1) // change angle from left
+	{
+		dx = -(p.x() - pCenter_.x());
+		dy = p.y() - pCenter_.y();
+
+		if(apxAngle)
+		{
+			double fdx = fabs(dx);
+			double fdy = fabs(dy);
+			if(fdx < fdy)
+			{
+				if(4*fdx < fdy)
+					dx = 0.;
+				else
+				{
+					fdx = fdy;
+					if(dx >= 0)
+						dx = fdx;
+					else
+						dx = -fdx;
+				}
+			}
+			else
+			{
+				if(4*fdy < fdx)
+					dy = 0.;
+				else
+				{
+					fdy = fdx;
+					if(dy >= 0)
+						dy = fdy;
+					else
+						dy = -fdy;
+				}
+			}
+		}
+		if(dx == 0)
+		{
+			if(dy > 0)
+				angle = 90;
+			else
+				angle = 270;
+		}
+		else
+		{
+			if(dx > 0)
+				angle = atan(dy/dx) * 180. / TePI;
+			else
+				angle = atan(dy/dx) * 180. / TePI + 180;
+		}
+		text_.setAngle(angle);
+	}
+	else if(mode_ == 2) // change angle from right
+	{
+		dx = p.x() - pCenter_.x();
+		dy = -(p.y() - pCenter_.y());
+
+		if(apxAngle)
+		{
+			double fdx = fabs(dx);
+			double fdy = fabs(dy);
+			if(fdx < fdy)
+			{
+				if(4*fdx < fdy)
+					dx = 0.;
+				else
+				{
+					fdx = fdy;
+					if(dx >= 0)
+						dx = fdx;
+					else
+						dx = -fdx;
+				}
+			}
+			else
+			{
+				if(4*fdy < fdx)
+					dy = 0.;
+				else
+				{
+					fdy = fdx;
+					if(dy >= 0)
+						dy = fdy;
+					else
+						dy = -fdy;
+				}
+			}
+		}
+		if(dx == 0)
+		{
+			if(dy > 0)
+				angle = 90;
+			else
+				angle = 270;
+		}
+		else
+		{
+			if(dx > 0)
+				angle = atan(dy/dx) * 180. / TePI;
+			else
+				angle = atan(dy/dx) * 180. / TePI + 180;
+		}
+		text_.setAngle(angle);
+	}
+	else if(mode_ == 3 || mode_ == 4) // change size
+	{
+		if(visual_.fixedSize() == false)
+		{
+			double dx = fabs(double(pCenter_.x() - p.x()));
+			double dy = fabs(double(pCenter_.y() - p.y()));
+			int h = apx(sqrt(dx*dx + dy*dy));
+
+			double dh, hc, c = 1.;
+
+			hc = h * c;
+			dh = canvas_->mapVtoDW((int)hc);
+			text_.setHeight(dh);
+			QRect r = canvas_->textRect (text_, visual_);
+			while(r.height()/2 <= h-1)
+			{
+				c *= 1.01;
+				hc = h * c;
+				dh = canvas_->mapVtoDW((int)hc);
+				text_.setHeight(dh);
+				r = canvas_->textRect (text_, visual_);
+			}
+		}
+	}
+	else if(mode_ == 5) // change position
+	{
+		TeCoord2D pt = canvas_->mapVtoDW(p);
+		text_.add(pt);
+	}
+	change();
+}
+
+void 
+TeQtTextEdit::init(TeText& tx, TeVisual v, TeQtCanvas* canvas)
+{
+	edit_ = true;
+	mode_ = 0;
+	canvas_ = canvas;
+	text_ = tx;
+	visual_ = v;
+	change();
+}
+
+void 
+TeQtTextEdit::change()
+{
+	QRect rect = canvas_->textRect(text_, visual_);
+
+	pCenter_ = rect.center();
+
+	pLeft_ = rect.center();
+	pLeft_.setX(rect.left()+3);
+
+	pRight_ = rect.center();
+	pRight_.setX(rect.right()-3);
+
+	pTop_ = rect.center();
+	pTop_.setY(rect.top()+3);
+
+	pBottom_ = rect.center();
+	pBottom_.setY(rect.bottom()-3);
+
+	double angle = text_.angle();
+	if(angle == 0)
+	{
+//		canvas_->plotOnWindow();
+//		canvas_->plotTextRects(text_, visual_);
+//		canvas_->plotOnPixmap0();
+		return;
+	}
+
+	int	nx, ny;
+	double	d;
+
+	d = fabs(double(pRight_.x() - pCenter_.x()));
+	nx = pCenter_.x() + apx(cos(angle*TePI/180.) * d);
+	ny = pCenter_.y() - apx(sin(angle*TePI/180.) * d);
+	pRight_ = QPoint(nx, ny);
+
+	d = fabs(double(pLeft_.x() - pCenter_.x()));
+	nx = pCenter_.x() + apx(cos((180.+angle)*TePI/180.) * d);
+	ny = pCenter_.y() - apx(sin((180.+angle)*TePI/180.) * d);
+	pLeft_ = QPoint(nx, ny);
+
+	d = fabs(double(pTop_.y() - pCenter_.y()));
+	nx = pCenter_.x() + apx(cos((90.+angle)*TePI/180.) * d);
+	ny = pCenter_.y() - apx(sin((90.+angle)*TePI/180.) * d);
+	pTop_ = QPoint(nx, ny);
+
+	d = fabs(double(pBottom_.y() - pCenter_.y()));
+	nx = pCenter_.x() + apx(cos((270.+angle)*TePI/180.) * d);
+	ny = pCenter_.y() - apx(sin((270.+angle)*TePI/180.) * d);
+	pBottom_ = QPoint(nx, ny);
+
+//	canvas_->plotTextRects(text_, visual_);
+}
+
+int
+TeQtTextEdit::apx(double d)
+{
+	if(d >= 0)
+		return (int)(d+.5);
+	else
+		return (int)(d-.5);
+}
+
+int
+TeQtTextEdit::located(QPoint& p)
+{
+	QRect rLeft(0, 0, 6, 6), rRight(0, 0, 6, 6), rTop(0, 0, 6, 6), rBottom(0, 0, 6, 6), rCenter(0, 0, 6, 6);
+	rLeft.moveCenter(pLeft_);
+	rRight.moveCenter(pRight_);
+	rTop.moveCenter(pTop_);
+	rBottom.moveCenter(pBottom_);
+	rCenter.moveCenter(pCenter_);
+
+	mode_ = 0;
+	double d, m = TeMAXFLOAT;
+
+	if(rLeft.contains(p))
+	{
+		QPoint a(rLeft.left() + rLeft.width()/2, rLeft.left() + rLeft.height()/2);
+		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
+		m = MIN(m, d);
+		if(m == d)
+			mode_ = 1;
+	}
+	if(rRight.contains(p))
+	{
+		QPoint a(rRight.left() + rRight.width()/2, rRight.left() + rRight.height()/2);
+		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
+		m = MIN(m, d);
+		if(m == d)
+			mode_ = 2;
+	}
+	if(rTop.contains(p))
+	{
+		QPoint a(rTop.left() + rTop.width()/2, rTop.left() + rTop.height()/2);
+		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
+		m = MIN(m, d);
+		if(m == d)
+			mode_ = 3;
+	}
+	if(rBottom.contains(p))
+	{
+		QPoint a(rBottom.left() + rBottom.width()/2, rBottom.left() + rBottom.height()/2);
+		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
+		m = MIN(m, d);
+		if(m == d)
+			mode_ = 4;
+	}
+	if(rCenter.contains(p))
+	{
+		QPoint a(rCenter.left() + rCenter.width()/2, rCenter.left() + rCenter.height()/2);
+		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
+		m = MIN(m, d);
+		mode_ = 5;
+	}
+
+	if(mode_ == 1)
+		pLeft_ = p;
+	else if(mode_ == 2)
+		pRight_ = p;
+	else if(mode_ == 3)
+		pTop_ = p;
+	else if(mode_ == 4)
+		pBottom_ = p;
+	else if(mode_ == 5)
+		pCenter_ = p;
+
+	return mode_;
+}
+
+bool
+TeQtTextEdit::isHotPoint(QPoint& p)
+{
+	QRect rLeft(0, 0, 6, 6), rRight(0, 0, 6, 6), rTop(0, 0, 6, 6), rBottom(0, 0, 6, 6), rCenter(0, 0, 6, 6);
+	rLeft.moveCenter(pLeft_);
+	rRight.moveCenter(pRight_);
+	rTop.moveCenter(pTop_);
+	rBottom.moveCenter(pBottom_);
+	rCenter.moveCenter(pCenter_);
+
+	mode_ = 0;
+	double d, m = TeMAXFLOAT;
+
+	if(rLeft.contains(p))
+	{
+		QPoint a(rLeft.left() + rLeft.width()/2, rLeft.left() + rLeft.height()/2);
+		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
+		m = MIN(m, d);
+		if(m == d)
+			mode_ = 1;
+	}
+	if(rRight.contains(p))
+	{
+		QPoint a(rRight.left() + rRight.width()/2, rRight.left() + rRight.height()/2);
+		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
+		m = MIN(m, d);
+		if(m == d)
+			mode_ = 2;
+	}
+	if(rTop.contains(p))
+	{
+		QPoint a(rTop.left() + rTop.width()/2, rTop.left() + rTop.height()/2);
+		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
+		m = MIN(m, d);
+		if(m == d)
+			mode_ = 3;
+	}
+	if(rBottom.contains(p))
+	{
+		QPoint a(rBottom.left() + rBottom.width()/2, rBottom.left() + rBottom.height()/2);
+		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
+		m = MIN(m, d);
+		if(m == d)
+			mode_ = 4;
+	}
+	if(rCenter.contains(p))
+	{
+		QPoint a(rCenter.left() + rCenter.width()/2, rCenter.left() + rCenter.height()/2);
+		d = (p.x()-a.x())*(p.x()-a.x()) + (p.y()-a.y())*(p.y()-a.y());
+		m = MIN(m, d);
+		mode_ = 5;
+	}
+
+	if(mode_ > 0)
+		return true;
+	return false;
+}
+
+void
+TeQtTextEdit::endEdit()
+{
+	edit_ = false;
+	mode_ = 0;
+}
+
+int
+TeQtTextEdit::mode()
+{
+	return mode_;
+}
+
+void
+TeQtTextEdit::mode(int mode)
+{
+	mode_ = mode;
+}
+
+bool
+TeQtTextEdit::edit()
+{
+	return edit_;
+}
+
+TeText
+TeQtTextEdit::text()
+{
+	return text_;
+}
+
+void
+TeQtTextEdit::text(TeText t)
+{
+	text_ = t;
+}
+
+void
+TeQtTextEdit::height(double h)
+{
+	text_.setHeight(h);
+}
+
+void
+TeQtTextEdit::angle(double a)
+{
+	text_.setAngle(a);
+}
+
+void
+TeQtTextEdit::addPosition(TeCoord2D p)
+{
+	TeCoord2D tp = text_.location();
+	tp += p;
+	text_.add(tp);
+}
+
+TeQtCanvas*
+TeQtTextEdit::canvas()
+{
+	return canvas_;
+}
+
+QRect
+TeQtTextEdit::getRect()
+{
+	QRect rect = canvas_->textRect(text_, visual_);
+	int	x1 = rect.left();
+	int	y1 = rect.top();
+	int	x2 = rect.right();
+	int	y2 = rect.bottom();
+
+	double angle = text_.angle() * -1;
+	if(!(angle == 0 || angle == 90 || angle == 180 || angle == 270))
+	{
+		double d, dx, dy, alfa, beta;
+		QPoint c = rect.center();
+		QPoint p, p1, p2, p3, p4;
+
+		p = QPoint(x1, y1);
+		dx = p.x() - c.x();
+		dy = p.y() - c.y();
+		alfa = atan(dy/dx) * 180. / TePI;
+		if(dx<0)
+			alfa = 180. + alfa;
+		else if(dx>=0 && dy<0)
+			alfa = 360. + alfa;
+		beta = alfa + angle;
+		d = sqrt(double((p.x()-c.x()) * (p.x()-c.x()) + (p.y()-c.y()) * (p.y()-c.y())));
+		p1.setX(c.x() + TeRound(cos(beta*TePI/180.) * d));
+		p1.setY(c.y() + TeRound(sin(beta*TePI/180.) * d));
+
+		p = QPoint(x1, y2);
+		dx = p.x() - c.x();
+		dy = p.y() - c.y();
+		alfa = atan(dy/dx) * 180. / TePI;
+		if(dx<0)
+			alfa = 180. + alfa;
+		else if(dx>=0 && dy<0)
+			alfa = 360. + alfa;
+		beta = alfa + angle;
+		d = sqrt(double((p.x()-c.x()) * (p.x()-c.x()) + (p.y()-c.y()) * (p.y()-c.y())));
+		p2.setX(c.x() + TeRound(cos(beta*TePI/180.) * d));
+		p2.setY(c.y() + TeRound(sin(beta*TePI/180.) * d));
+
+		p = QPoint(x2, y1);
+		dx = p.x() - c.x();
+		dy = p.y() - c.y();
+		alfa = atan(dy/dx) * 180. / TePI;
+		if(dx<0)
+			alfa = 180. + alfa;
+		else if(dx>=0 && dy<0)
+			alfa = 360. + alfa;
+		beta = alfa + angle;
+		d = sqrt(double((p.x()-c.x()) * (p.x()-c.x()) + (p.y()-c.y()) * (p.y()-c.y())));
+		p3.setX(c.x() + TeRound(cos(beta*TePI/180.) * d));
+		p3.setY(c.y() + TeRound(sin(beta*TePI/180.) * d));
+
+		p = QPoint(x2, y2);
+		dx = p.x() - c.x();
+		dy = p.y() - c.y();
+		alfa = atan(dy/dx) * 180. / TePI;
+		if(dx<0)
+			alfa = 180. + alfa;
+		else if(dx>=0 && dy<0)
+			alfa = 360. + alfa;
+		beta = alfa + angle;
+		d = sqrt(double((p.x()-c.x()) * (p.x()-c.x()) + (p.y()-c.y()) * (p.y()-c.y())));
+		p4.setX(c.x() + TeRound(cos(beta*TePI/180.) * d));
+		p4.setY(c.y() + TeRound(sin(beta*TePI/180.) * d));
+
+		x1 = MIN(p1.x(), p2.x());
+		x1 = MIN(x1, p3.x());
+		x1 = MIN(x1, p4.x());
+		y1 = MIN(p1.y(), p2.y());
+		y1 = MIN(y1, p3.y());
+		y1 = MIN(y1, p4.y());
+		x2 = MAX(p1.x(), p2.x());
+		x2 = MAX(x2, p3.x());
+		x2 = MAX(x2, p4.x());
+		y2 = MAX(p1.y(), p2.y());
+		y2 = MAX(y2, p3.y());
+		y2 = MAX(y2, p4.y());
+
+		rect.setLeft(x1);
+		rect.setTop(y1);
+		rect.setRight(x2);
+		rect.setBottom(y2);
+	}
+	return rect;
+//	QRect rect;
+//	int	x1, y1, x2, y2;
+
+//	x1 = pLeft_.x();
+//	x1 = MIN(x1, pRight_.x());
+//	x1 = MIN(x1, pTop_.x());
+//	x1 = MIN(x1, pBottom_.x());
+
+//	y1 = pLeft_.y();
+//	y1 = MIN(y1, pRight_.y());
+//	y1 = MIN(y1, pTop_.y());
+//	y1 = MIN(y1, pBottom_.y());
+
+//	x2 = pLeft_.x();
+//	x2 = MAX(x2, pRight_.x());
+//	x2 = MAX(x2, pTop_.x());
+//	x2 = MAX(x2, pBottom_.x());
+
+//	y2 = pLeft_.y();
+//	y2 = MAX(y2, pRight_.y());
+//	y2 = MAX(y2, pTop_.y());
+//	y2 = MAX(y2, pBottom_.y());
+
+//	if(text_.angle() == 0 || text_.angle() == 90 || text_.angle() == 180 || text_.angle() == 270)
+//		rect = QRect(x1-3, y1-3, x2-x1+7, y2-y1+7);
+//	else
+//	{
+//		int h = y2 - y1;
+//		int w = x2 - x1;
+//		int	d = h;
+//		if(w < h)
+//			d = w;
+//		x1 -= d;
+//		y1 -= d;
+//		x2 += d;
+//		y2 += d;
+//		rect = QRect(x1, y1, x2-x1, y2-y1);
+//	}
+//	return rect;
+}
+
+QRect
+TeQtTextEdit::getHRect()
+{
+	return canvas_->textRect(text_, visual_);
+}
+
+TeQtMultiTextEdit::TeQtMultiTextEdit()
+{
+	current_ = -1;
+	selMode_ = false;
+}
+
+TeQtMultiTextEdit::~TeQtMultiTextEdit()
+{
+}
+
+int
+TeQtMultiTextEdit::size()
+{
+	return textVec_.size();
+}
+
+void
+TeQtMultiTextEdit::push(TeQtTextEdit t)
+{
+	int geomId = t.text().geomId();
+	if(geomIdSet_.find(geomId) == geomIdSet_.end())
+	{
+		geomIdSet_.insert(geomId);
+		textVec_.push_back(t);
+		current_ = textVec_.size() - 1;
+	}
+}
+
+void
+TeQtMultiTextEdit::change()
+{
+	if(current_ == -1 || textVec_.empty())
+		return;
+
+//	canvas->plotOnWindow();
+	unsigned int i;
+	for(i=0; i<textVec_.size(); i++)
+	{
+		TeQtTextEdit& t = textVec_[i];
+		t.change();
+	}
+}
+
+void
+TeQtMultiTextEdit::change(QPoint p, bool apxAngle)
+{
+	if(current_ == -1 || textVec_.empty())
+		return;
+
+	TeQtTextEdit& t = textVec_[current_];
+	TeCoord2D pa = t.text().location();
+	t.change(p, apxAngle);
+	TeCoord2D pb = t.text().location();
+	TeCoord2D poffset(pb.x()-pa.x(), pb.y()-pa.y());
+
+	if(t.mode()==1 || t.mode()==2)
+		angle(t.text().angle());
+	else if(t.mode()==3 || t.mode()==4)
+		height(t.text().height());
+	else if(t.mode() == 5)
+		addPosition(poffset);
+	change();
+}
+
+int 
+TeQtMultiTextEdit::located(QPoint& p)
+{
+	unsigned int i;
+	int mode = 0;
+	for(i=0; i<textVec_.size(); i++)
+	{
+		TeQtTextEdit& t = textVec_[i];
+		mode = t.located(p);
+		if(mode)
+		{
+			current_ = i;
+			break;
+		}
+	}
+	return mode;
+}
+
+bool
+TeQtMultiTextEdit::isHotPoint(QPoint& p)
+{
+	if(textVec_.size() == 0)
+		return false;
+
+	unsigned int i;
+	for(i=0; i<textVec_.size(); i++)
+	{
+		TeQtTextEdit& t = textVec_[i];
+		if(t.isHotPoint(p))
+		{
+			current_ = i;
+			break;
+		}
+	}
+	if(i < textVec_.size())
+		return true;
+	return false;
+}
+
+void
+TeQtMultiTextEdit::endEdit()
+{
+	unsigned int i;
+	for(i=0; i<textVec_.size(); i++)
+	{
+		TeQtTextEdit& t = textVec_[i];
+		t.endEdit();
+	}
+	textVec_.clear();
+	geomIdSet_.clear();
+}
+
+int
+TeQtMultiTextEdit::mode()
+{
+	if(current_ >= 0 && textVec_.empty() == false)
+		return textVec_[current_].mode();
+	return 0;
+}
+
+void
+TeQtMultiTextEdit::mode(int m)
+{
+	if(current_ >= 0 && textVec_.empty() == false)
+		textVec_[current_].mode(m);
+}
+
+bool
+TeQtMultiTextEdit::selMode()
+{
+	return selMode_;
+}
+
+void
+TeQtMultiTextEdit::selMode(bool m)
+{
+	selMode_ = m;
+}
+
+bool
+TeQtMultiTextEdit::edit()
+{
+	if(current_ >= 0 && textVec_.empty() == false)
+		return textVec_[current_].edit();
+	return false;
+}
+
+TeText
+TeQtMultiTextEdit::text(int i)
+{
+	TeText t;
+	if(i<(int)textVec_.size())
+		return textVec_[i].text();
+	else
+		return t;
+}
+
+TeVisual
+TeQtMultiTextEdit::visual(int i)
+{
+	TeVisual v;
+	if(i<(int)textVec_.size())
+		return textVec_[i].visual();
+	else
+		return v;
+}
+
+void
+TeQtMultiTextEdit::height(double h)
+{
+	int i;
+	for(i=0; i<(int)textVec_.size(); i++)
+	{
+		if(i == current_)
+			continue;
+		TeQtTextEdit& t = textVec_[i];
+		t.height(h);
+	}
+}
+
+void
+TeQtMultiTextEdit::angle(double a)
+{
+	int i;
+	for(i=0; i<(int)textVec_.size(); i++)
+	{
+		if(i == current_)
+			continue;
+		TeQtTextEdit& t = textVec_[i];
+		t.angle(a);
+	}
+}
+
+void
+TeQtMultiTextEdit::addPosition(TeCoord2D p)
+{
+	int i;
+	for(i=0; i<(int)textVec_.size(); i++)
+	{
+		if(i == current_)
+			continue;
+		TeQtTextEdit& t = textVec_[i];
+		t.addPosition(p);
+	}
+}
+
+QRect
+TeQtMultiTextEdit::getRect()
+{
+	QRect	rect;
+	int i;
+	for(i=0; i<(int)textVec_.size(); i++)
+	{
+		TeQtTextEdit& t = textVec_[i];
+		rect = rect | t.getRect();
+	}
+	return rect;
+}
+
+int
+TeQtMultiTextEdit::getTextIndex(QPoint p)
+{
+	int i;
+	for(i=0; i<(int)textVec_.size(); i++)
+	{
+		TeQtTextEdit& t = textVec_[i];
+		QRect rect = t.getHRect();
+		TeText tx = t.text();
+		double angle = tx.angle() * -1;
+
+		if(angle == 0)
+		{
+			if(rect.contains(p, true))
+				return i;
+		}
+		else
+		{
+			double d, dx, dy, alfa, beta;
+			QPoint c = rect.center();
+
+			dx = p.x() - c.x();
+			dy = p.y() - c.y();
+			alfa = atan(dy/dx) * 180. / TePI;
+			if(dx<0)
+				alfa = 180. + alfa;
+			else if(dx>=0 && dy<0)
+				alfa = 360. + alfa;
+			beta = alfa - angle;
+			d = sqrt(double((p.x()-c.x()) * (p.x()-c.x()) + (p.y()-c.y()) * (p.y()-c.y())));
+			int x = c.x() + TeRound(cos(beta*TePI/180.) * d);
+			int y = c.y() + TeRound(sin(beta*TePI/180.) * d);
+
+			QPoint pp(x, y);
+			if(rect.contains(pp))
+				return i;
+		}
+	}
+	return -1;
+}
+
+void
+TeQtMultiTextEdit::updateText(int index, string t)
+{
+	TeText tx = textVec_[index].text();
+	tx.setTextValue(t);
+	textVec_[index].text(tx);
+	textVec_[index].change();
+}
+
+void
+TeQtMultiTextEdit::visual(const TeVisual& visual)
+{
+	unsigned int i;
+	for(i=0; i<textVec_.size(); i++)
+		textVec_[i].visual(visual);
+}
diff --git a/src/terralib/drivers/qt/TeQtTextEdit.h b/src/terralib/drivers/qt/TeQtTextEdit.h
old mode 100755
new mode 100644
index fdc7472..009b0c9
--- a/src/terralib/drivers/qt/TeQtTextEdit.h
+++ b/src/terralib/drivers/qt/TeQtTextEdit.h
@@ -1,150 +1,153 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTTEXTEDIT_H
-#define  __TERRALIB_INTERNAL_QTTEXTEDIT_H
-
-#include "TeCoord2D.h"
-#include "TeQtCanvas.h"
-#include "TeTheme.h"
-#include <qpoint.h>
-#include <set>
-
-class TeQtTextEdit
-{
-	QPoint				pLeft_;
-	QPoint				pRight_;
-	QPoint				pTop_;
-	QPoint				pBottom_;
-	QPoint				pCenter_;
-	bool				edit_;
-	int					mode_;
-	TeQtCanvas*			canvas_;
-	TeTheme*			theme_;
-	TeVisual			visual_;
-	TeText				text_;
-
-public:
-
-    TeQtTextEdit();
-    TeQtTextEdit(TeText& tx, TeVisual v, TeQtCanvas* canvas);
-
-	~TeQtTextEdit ();
-
-	void init(TeText& tx, TeVisual v, TeQtCanvas* canvas);
-
-	void change();
-
-	void change(QPoint p, bool apxAngle=false);
-
-	int	apx(double d);
-
-	int located(QPoint& p);
-
-	bool isHotPoint(QPoint& p);
-
-	void endEdit();
-
-	int mode();
-
-	void mode(int m);
-
-	bool edit();
-
-	TeText text();
-
-	void text(TeText t);
-
-	void height(double h);
-
-	void angle(double a);
-
-	void addPosition(TeCoord2D p);
-
-	TeQtCanvas*	canvas();
-
-	TeVisual	visual() {return visual_;}
-
-	void	visual(const TeVisual& visual) {visual_ = visual;}
-
-	QRect	getRect();
-
-	QRect	getHRect();
-};
-
-
-class TeQtMultiTextEdit
-{
-	vector<TeQtTextEdit> textVec_;
-	set<int>			 geomIdSet_;
-	int					 current_;
-	bool				 selMode_;
-
-public:
-
-    TeQtMultiTextEdit();
-	~TeQtMultiTextEdit();
-
-	int size();
-
-	void push(TeQtTextEdit t);
-
-	void change();
-
-	void change(QPoint p, bool apxAngle=false);
-
-	int located(QPoint& p);
-
-	bool isHotPoint(QPoint& p);
-
-	void endEdit();
-
-	int mode();
-
-	void mode(int m);
-
-	bool selMode();
-
-	void selMode(bool m);
-
-	bool edit();
-
-	TeText text(int i);
-
-	TeVisual visual(int i);
-
-	void visual(const TeVisual&);
-
-	void height(double h);
-
-	void angle(double a);
-
-	void addPosition(TeCoord2D p);
-
-	void clear() {textVec_.clear(); geomIdSet_.clear();}
-
-	QRect	getRect();
-
-	int getTextIndex(QPoint p);
-
-	void updateText(int index, string t);
-};
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTTEXTEDIT_H
+#define  __TERRALIB_INTERNAL_QTTEXTEDIT_H
+
+#include "TeCoord2D.h"
+#include "TeQtCanvas.h"
+#include "TeTheme.h"
+
+#include <TeAppUtilsDefines.h>
+
+#include <qpoint.h>
+#include <set>
+
+class TLAPPUTILS_DLL TeQtTextEdit
+{
+	QPoint				pLeft_;
+	QPoint				pRight_;
+	QPoint				pTop_;
+	QPoint				pBottom_;
+	QPoint				pCenter_;
+	bool				edit_;
+	int					mode_;
+	TeQtCanvas*			canvas_;
+	TeTheme*			theme_;
+	TeVisual			visual_;
+	TeText				text_;
+
+public:
+
+    TeQtTextEdit();
+    TeQtTextEdit(TeText& tx, TeVisual v, TeQtCanvas* canvas);
+
+	~TeQtTextEdit ();
+
+	void init(TeText& tx, TeVisual v, TeQtCanvas* canvas);
+
+	void change();
+
+	void change(QPoint p, bool apxAngle=false);
+
+	int	apx(double d);
+
+	int located(QPoint& p);
+
+	bool isHotPoint(QPoint& p);
+
+	void endEdit();
+
+	int mode();
+
+	void mode(int m);
+
+	bool edit();
+
+	TeText text();
+
+	void text(TeText t);
+
+	void height(double h);
+
+	void angle(double a);
+
+	void addPosition(TeCoord2D p);
+
+	TeQtCanvas*	canvas();
+
+	TeVisual	visual() {return visual_;}
+
+	void	visual(const TeVisual& visual) {visual_ = visual;}
+
+	QRect	getRect();
+
+	QRect	getHRect();
+};
+
+
+class TLAPPUTILS_DLL TeQtMultiTextEdit
+{
+	vector<TeQtTextEdit> textVec_;
+	set<int>			 geomIdSet_;
+	int					 current_;
+	bool				 selMode_;
+
+public:
+
+    TeQtMultiTextEdit();
+	~TeQtMultiTextEdit();
+
+	int size();
+
+	void push(TeQtTextEdit t);
+
+	void change();
+
+	void change(QPoint p, bool apxAngle=false);
+
+	int located(QPoint& p);
+
+	bool isHotPoint(QPoint& p);
+
+	void endEdit();
+
+	int mode();
+
+	void mode(int m);
+
+	bool selMode();
+
+	void selMode(bool m);
+
+	bool edit();
+
+	TeText text(int i);
+
+	TeVisual visual(int i);
+
+	void visual(const TeVisual&);
+
+	void height(double h);
+
+	void angle(double a);
+
+	void addPosition(TeCoord2D p);
+
+	void clear() {textVec_.clear(); geomIdSet_.clear();}
+
+	QRect	getRect();
+
+	int getTextIndex(QPoint p);
+
+	void updateText(int index, string t);
+};
+#endif
diff --git a/src/terralib/drivers/qt/TeQtThemeItem.cpp b/src/terralib/drivers/qt/TeQtThemeItem.cpp
old mode 100755
new mode 100644
index 23c0d4e..d1da3aa
--- a/src/terralib/drivers/qt/TeQtThemeItem.cpp
+++ b/src/terralib/drivers/qt/TeQtThemeItem.cpp
@@ -1,212 +1,212 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtThemeItem.h>
-#include <TeQtViewsListView.h>
-#include <TeAppTheme.h>
-#include <TeQtLegendItem.h>
-#include <TeQtChartItem.h>
-#include <TeDatabase.h>
-#include <qpixmap.h>
-#include <images/theme.xpm>
-#include <images/fileTheme.xpm>
-#include <images/externalTheme.xpm>
-#include <images/invalidExternalTheme.xpm>
-#include <qimage.h>
-
-//Database item constructor
-TeQtThemeItem::TeQtThemeItem(QListViewItem *parent,
-	QString text, TeAppTheme* appTheme)
-	: TeQtCheckListItem(parent,text,CheckBox), appTheme_(appTheme)
-{
-	type_ = THEME;
-	TeAbstractTheme* absTheme = appTheme_->getTheme();
-
-	if (absTheme->type() == TeTHEME)
-		setPixmap(0, QPixmap(theme_xpm));
-	else if (absTheme->type() == TeFILETHEME)
-		setPixmap(0, QPixmap(fileTheme_xpm));
-	else if (absTheme->type() == TeEXTERNALTHEME)
-		setPixmap(0, QPixmap(externalTheme_xpm));
-
-	invalidThemeItem_ = false;
-	setRenameEnabled(0,true);
-	setSelected(false);
-	setEnabled(true);
-
-	order_ = absTheme->priority();
-}
-
-
-void TeQtThemeItem::setThemeItemAsInvalid()
-{
-	invalidThemeItem_ = true;
-	TeAbstractTheme* absTheme = appTheme_->getTheme();
-	if (absTheme->type() == TeEXTERNALTHEME)
-		setPixmap(0, QPixmap(invalidExternalTheme_xpm));
-}
-
-
-void TeQtThemeItem::stateChange(bool visible)
-{
-	TeQtViewsListView *lView = (TeQtViewsListView*)listView();
-	lView->checkItemStateChanged(this, visible);
-}
-
-
-void TeQtThemeItem::removeLegends()
-{
-	vector<QListViewItem*> legendVector = getChildren();
-	unsigned int i;
-	for (i = 0; i < legendVector.size(); ++i)
-	{
-		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
-		if (checkItem->getType() == TeQtCheckListItem::LEGEND ||
-			checkItem->getType() == TeQtCheckListItem::LEGENDTITLE)
-			delete checkItem;
-	}
-}
-
-
-void TeQtThemeItem::removeCharts()
-{
-	vector<QListViewItem*> legendVector = getChildren();
-	unsigned int i;
-	for (i = 0; i < legendVector.size(); ++i)
-	{
-		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
-		if (checkItem->getType() == TeQtCheckListItem::CHART ||
-			checkItem->getType() == TeQtCheckListItem::CHARTTITLE)
-			delete checkItem;
-	}
-}
-
-
-void TeQtThemeItem::getLegends(vector<const QPixmap*>& pixmapVector, vector<string>& labelVector, string& title)
-{
-	vector<QListViewItem*> legendVector = getChildren();
-	unsigned int i;
-	for (i = 0; i < legendVector.size(); ++i)
-	{
-		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
-
-		if (checkItem->getType() == TeQtCheckListItem::LEGENDTITLE)
-		{
-			title = checkItem->text().latin1();
-		}
-		else if (checkItem->getType() == TeQtCheckListItem::LEGEND)
-		{
-			TeQtLegendItem *legendItem = (TeQtLegendItem*)checkItem;
-			pixmapVector.push_back(legendItem->pixmap(0));
-			labelVector.push_back(legendItem->text().latin1());
-		}
-	}
-}
-				
-TeQtCheckListItem* TeQtThemeItem::getLegendItem(TeLegendEntry* leg)
-{
-	vector<QListViewItem*> legendVector = getChildren();
-	unsigned int i;
-	for (i = 0; i < legendVector.size(); ++i)
-	{
-		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
-
-		if (checkItem->getType() == TeQtCheckListItem::LEGEND)
-		{
-			TeQtLegendItem *legendItem = (TeQtLegendItem*)checkItem;
-			if(legendItem->legendEntry()->id() == leg->id())
-				return legendItem;
-		}
-	}
-	return (TeQtCheckListItem*)0;
-}
-
-void TeQtThemeItem::updateAlias()
-{
-	TeTheme* baseTheme = (TeTheme*)appTheme_->getTheme();
-	if(baseTheme->type() != TeTHEME)
-		return;
-
-	TeDatabase* db = baseTheme->layer()->database();
-	map<int, map<string, string> >& mapThemeAlias = db->mapThemeAlias();
-	map<string, string>& mapAA = mapThemeAlias[baseTheme->id()];
-
-	vector<QListViewItem*> itemVec = getChildren();
-
-	unsigned int i;
-	for (i = 0; i < itemVec.size(); ++i)
-	{
-		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)itemVec[i];
-
-		if (checkItem->getType() == TeQtCheckListItem::LEGENDTITLE)
-		{
-			string attr, nattr;
-			if(baseTheme->grouping().groupMode_ != TeNoGrouping)
-			{
-				attr = baseTheme->grouping().groupAttribute_.name_;
-				nattr = baseTheme->grouping().groupNormAttribute_;
-			}
-
-			if(nattr.empty() || nattr == "NONE")
-			{
-				map<string, string>::iterator it = mapAA.find(attr);
-				if(it != mapAA.end())
-				{
-					string alias = it->second;
-					if(alias.empty())
-						checkItem->setText(0, attr.c_str());
-					else
-						checkItem->setText(0, alias.c_str());
-				}
-				else
-					checkItem->setText(0, attr.c_str());
-			}
-			else
-			{
-				string alias = attr;
-				map<string, string>::iterator it = mapAA.find(attr);
-				if(it != mapAA.end())
-					alias = it->second;
-
-				it = mapAA.find(nattr);
-				if(it != mapAA.end())
-					alias += "/" + it->second;
-				else
-					alias += "/" + nattr;
-
-				checkItem->setText(0, alias.c_str());
-			}
-		}
-		else if (checkItem->getType() == TeQtCheckListItem::CHART)
-		{
-			string attr = ((TeQtChartItem*)checkItem)->name();
-			map<string, string>::iterator it = mapAA.find(attr);
-			if(it != mapAA.end())
-			{
-				string alias = it->second;
-				checkItem->setText(0, alias.c_str());
-			}
-			else
-				checkItem->setText(0, attr.c_str());
-		}
-	}
-}
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeQtThemeItem.h>
+#include <TeQtViewsListView.h>
+#include <TeAppTheme.h>
+#include <TeQtLegendItem.h>
+#include <TeQtChartItem.h>
+#include <TeDatabase.h>
+#include <qpixmap.h>
+#include <images/theme.xpm>
+#include <images/fileTheme.xpm>
+#include <images/externalTheme.xpm>
+#include <images/invalidExternalTheme.xpm>
+#include <qimage.h>
+
+//Database item constructor
+TeQtThemeItem::TeQtThemeItem(QListViewItem *parent,
+	QString text, TeAppTheme* appTheme)
+	: TeQtCheckListItem(parent,text,CheckBox), appTheme_(appTheme)
+{
+	type_ = THEME;
+	TeAbstractTheme* absTheme = appTheme_->getTheme();
+
+	if (absTheme->type() == TeTHEME)
+		setPixmap(0, QPixmap(theme_xpm));
+	else if (absTheme->type() == TeFILETHEME)
+		setPixmap(0, QPixmap(fileTheme_xpm));
+	else if (absTheme->type() == TeEXTERNALTHEME)
+		setPixmap(0, QPixmap(externalTheme_xpm));
+
+	invalidThemeItem_ = false;
+	setRenameEnabled(0,true);
+	setSelected(false);
+	setEnabled(true);
+
+	order_ = absTheme->priority();
+}
+
+
+void TeQtThemeItem::setThemeItemAsInvalid()
+{
+	invalidThemeItem_ = true;
+	TeAbstractTheme* absTheme = appTheme_->getTheme();
+	if (absTheme->type() == TeEXTERNALTHEME)
+		setPixmap(0, QPixmap(invalidExternalTheme_xpm));
+}
+
+
+void TeQtThemeItem::stateChange(bool visible)
+{
+	TeQtViewsListView *lView = (TeQtViewsListView*)listView();
+	lView->checkItemStateChanged(this, visible);
+}
+
+
+void TeQtThemeItem::removeLegends()
+{
+	vector<QListViewItem*> legendVector = getChildren();
+	unsigned int i;
+	for (i = 0; i < legendVector.size(); ++i)
+	{
+		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
+		if (checkItem->getType() == TeQtCheckListItem::LEGEND ||
+			checkItem->getType() == TeQtCheckListItem::LEGENDTITLE)
+			delete checkItem;
+	}
+}
+
+
+void TeQtThemeItem::removeCharts()
+{
+	vector<QListViewItem*> legendVector = getChildren();
+	unsigned int i;
+	for (i = 0; i < legendVector.size(); ++i)
+	{
+		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
+		if (checkItem->getType() == TeQtCheckListItem::CHART ||
+			checkItem->getType() == TeQtCheckListItem::CHARTTITLE)
+			delete checkItem;
+	}
+}
+
+
+void TeQtThemeItem::getLegends(vector<const QPixmap*>& pixmapVector, vector<string>& labelVector, string& title)
+{
+	vector<QListViewItem*> legendVector = getChildren();
+	unsigned int i;
+	for (i = 0; i < legendVector.size(); ++i)
+	{
+		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
+
+		if (checkItem->getType() == TeQtCheckListItem::LEGENDTITLE)
+		{
+			title = checkItem->text().latin1();
+		}
+		else if (checkItem->getType() == TeQtCheckListItem::LEGEND)
+		{
+			TeQtLegendItem *legendItem = (TeQtLegendItem*)checkItem;
+			pixmapVector.push_back(legendItem->pixmap(0));
+			labelVector.push_back(legendItem->text().latin1());
+		}
+	}
+}
+				
+TeQtCheckListItem* TeQtThemeItem::getLegendItem(TeLegendEntry* leg)
+{
+	vector<QListViewItem*> legendVector = getChildren();
+	unsigned int i;
+	for (i = 0; i < legendVector.size(); ++i)
+	{
+		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
+
+		if (checkItem->getType() == TeQtCheckListItem::LEGEND)
+		{
+			TeQtLegendItem *legendItem = (TeQtLegendItem*)checkItem;
+			if(legendItem->legendEntry()->id() == leg->id())
+				return legendItem;
+		}
+	}
+	return (TeQtCheckListItem*)0;
+}
+
+void TeQtThemeItem::updateAlias()
+{
+	TeTheme* baseTheme = (TeTheme*)appTheme_->getTheme();
+	if(baseTheme->type() != TeTHEME)
+		return;
+
+	TeDatabase* db = baseTheme->layer()->database();
+	map<int, map<string, string> >& mapThemeAlias = db->mapThemeAlias();
+	map<string, string>& mapAA = mapThemeAlias[baseTheme->id()];
+
+	vector<QListViewItem*> itemVec = getChildren();
+
+	unsigned int i;
+	for (i = 0; i < itemVec.size(); ++i)
+	{
+		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)itemVec[i];
+
+		if (checkItem->getType() == TeQtCheckListItem::LEGENDTITLE)
+		{
+			string attr, nattr;
+			if(baseTheme->grouping().groupMode_ != TeNoGrouping)
+			{
+				attr = baseTheme->grouping().groupAttribute_.name_;
+				nattr = baseTheme->grouping().groupNormAttribute_;
+			}
+
+			if(nattr.empty() || nattr == "NONE")
+			{
+				map<string, string>::iterator it = mapAA.find(attr);
+				if(it != mapAA.end())
+				{
+					string alias = it->second;
+					if(alias.empty())
+						checkItem->setText(0, attr.c_str());
+					else
+						checkItem->setText(0, alias.c_str());
+				}
+				else
+					checkItem->setText(0, attr.c_str());
+			}
+			else
+			{
+				string alias = attr;
+				map<string, string>::iterator it = mapAA.find(attr);
+				if(it != mapAA.end())
+					alias = it->second;
+
+				it = mapAA.find(nattr);
+				if(it != mapAA.end())
+					alias += "/" + it->second;
+				else
+					alias += "/" + nattr;
+
+				checkItem->setText(0, alias.c_str());
+			}
+		}
+		else if (checkItem->getType() == TeQtCheckListItem::CHART)
+		{
+			string attr = ((TeQtChartItem*)checkItem)->name();
+			map<string, string>::iterator it = mapAA.find(attr);
+			if(it != mapAA.end())
+			{
+				string alias = it->second;
+				checkItem->setText(0, alias.c_str());
+			}
+			else
+				checkItem->setText(0, attr.c_str());
+		}
+	}
+}
+
diff --git a/src/terralib/drivers/qt/TeQtThemeItem.h b/src/terralib/drivers/qt/TeQtThemeItem.h
old mode 100755
new mode 100644
index 41665d9..d00d959
--- a/src/terralib/drivers/qt/TeQtThemeItem.h
+++ b/src/terralib/drivers/qt/TeQtThemeItem.h
@@ -1,64 +1,64 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTTHEMEITEM_H
-#define  __TERRALIB_INTERNAL_QTTHEMEITEM_H
-
-#include <TeQtCheckListItem.h>
-
-class TeAppTheme;
-class TeLegendEntry;
-
-
-class TeQtThemeItem : public TeQtCheckListItem
-{
-
-public:
-    TeQtThemeItem(QListViewItem *parent, QString text, TeAppTheme* appTheme);
-
-	~TeQtThemeItem () {}
-
-	void setThemeItemAsInvalid();
-
-	bool isThemeItemInvalid()
-	{ return invalidThemeItem_; }
-
-	TeAppTheme* getAppTheme()
-		{return appTheme_;}
-
-	void removeLegends();
-
-	void removeCharts();
-
-	void getLegends(vector<const QPixmap*>& pixmapVector, vector<string>& labels, string& title);
-
-	TeQtCheckListItem* getLegendItem(TeLegendEntry* leg);
-
-	void updateAlias();
-
-protected:
-	TeAppTheme *appTheme_;
-	bool invalidThemeItem_;
-
-	virtual void stateChange(bool);
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTTHEMEITEM_H
+#define  __TERRALIB_INTERNAL_QTTHEMEITEM_H
+
+#include <TeQtCheckListItem.h>
+
+class TeAppTheme;
+class TeLegendEntry;
+
+
+class TLAPPUTILS_DLL TeQtThemeItem : public TeQtCheckListItem
+{
+
+public:
+    TeQtThemeItem(QListViewItem *parent, QString text, TeAppTheme* appTheme);
+
+	~TeQtThemeItem () {}
+
+	void setThemeItemAsInvalid();
+
+	bool isThemeItemInvalid()
+	{ return invalidThemeItem_; }
+
+	TeAppTheme* getAppTheme()
+		{return appTheme_;}
+
+	void removeLegends();
+
+	void removeCharts();
+
+	void getLegends(vector<const QPixmap*>& pixmapVector, vector<string>& labels, string& title);
+
+	TeQtCheckListItem* getLegendItem(TeLegendEntry* leg);
+
+	void updateAlias();
+
+protected:
+	TeAppTheme *appTheme_;
+	bool invalidThemeItem_;
+
+	virtual void stateChange(bool);
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtThemeItemFCT.cpp b/src/terralib/drivers/qt/TeQtThemeItemFCT.cpp
deleted file mode 100755
index b55116c..0000000
--- a/src/terralib/drivers/qt/TeQtThemeItemFCT.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtThemeItemFCT.h>
-#include <TeQtViewsListViewFCT.h>
-#include <TeQtLegendItem.h>
-#include <TeQtChartItem.h>
-#include <TeDatabase.h>
-#include <qpixmap.h>
-//#include <../../../../../terraBase/src/ui/images/theme.xpm>
-#include <qimage.h>
-
-//Database item constructor
-TeQtThemeItem::TeQtThemeItem(QListViewItem *parent,
-	QString text, TeTheme *theme)
-	: TeQtCheckListItem(parent,text,CheckBox), theme_(theme)
-{
-	type_ = THEME;
-//	QPixmap p(theme_xpm);
-	QPixmap p = QPixmap::fromMimeSource("theme.bmp"); //(database_xpm);
-	setPixmap(0,p);
-	setRenameEnabled(0,true);
-	setSelected(false);
-	setEnabled(true);
-
-	order_ = theme->priority();
-}
-
-
-void TeQtThemeItem::stateChange(bool visible)
-{
-	TeQtViewsListView *lView = (TeQtViewsListView*)listView();
-	lView->checkItemStateChanged(this, visible);
-}
-
-
-void TeQtThemeItem::removeLegends()
-{
-	vector<QListViewItem*> legendVector = getChildren();
-	unsigned int i;
-	for (i = 0; i < legendVector.size(); ++i)
-	{
-		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
-		if (checkItem->getType() == TeQtCheckListItem::LEGEND ||
-			checkItem->getType() == TeQtCheckListItem::LEGENDTITLE)
-			delete checkItem;
-	}
-}
-
-
-void TeQtThemeItem::removeCharts()
-{
-	vector<QListViewItem*> legendVector = getChildren();
-	unsigned int i;
-	for (i = 0; i < legendVector.size(); ++i)
-	{
-		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
-		if (checkItem->getType() == TeQtCheckListItem::CHART ||
-			checkItem->getType() == TeQtCheckListItem::CHARTTITLE)
-			delete checkItem;
-	}
-}
-
-
-void TeQtThemeItem::getLegends(vector<const QPixmap*>& pixmapVector, vector<string>& labelVector, string& title)
-{
-	vector<QListViewItem*> legendVector = getChildren();
-	unsigned int i;
-	for (i = 0; i < legendVector.size(); ++i)
-	{
-		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
-
-		if (checkItem->getType() == TeQtCheckListItem::LEGENDTITLE)
-		{
-			title = checkItem->text().latin1();
-		}
-		else if (checkItem->getType() == TeQtCheckListItem::LEGEND)
-		{
-			TeQtLegendItem *legendItem = (TeQtLegendItem*)checkItem;
-			pixmapVector.push_back(legendItem->pixmap(0));
-			labelVector.push_back(legendItem->text().latin1());
-		}
-	}
-}
-				
-TeQtCheckListItem* TeQtThemeItem::getLegendItem(TeLegendEntry* leg)
-{
-	vector<QListViewItem*> legendVector = getChildren();
-	unsigned int i;
-	for (i = 0; i < legendVector.size(); ++i)
-	{
-		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)legendVector[i];
-
-		if (checkItem->getType() == TeQtCheckListItem::LEGEND)
-		{
-			TeQtLegendItem *legendItem = (TeQtLegendItem*)checkItem;
-			if(legendItem->legendEntry()->id() == leg->id())
-				return legendItem;
-		}
-	}
-	return (TeQtCheckListItem*)0;
-}
-
-void TeQtThemeItem::updateAlias()
-{
-	TeDatabase* db = theme_->layer()->database();
-	map<int, map<string, string> >& mapThemeAlias = db->mapThemeAlias();
-	map<string, string>& mapAA = mapThemeAlias[theme_->id()];
-
-	vector<QListViewItem*> itemVec = getChildren();
-
-	unsigned int i;
-	for (i = 0; i < itemVec.size(); ++i)
-	{
-		TeQtCheckListItem *checkItem = (TeQtCheckListItem*)itemVec[i];
-
-		if (checkItem->getType() == TeQtCheckListItem::LEGENDTITLE)
-		{
-			string attr, nattr;
-			if(theme_->grouping().groupMode_ != TeNoGrouping)
-			{
-				attr = theme_->grouping().groupAttribute_.name_;
-				nattr = theme_->grouping().groupNormAttribute_;
-			}
-
-			if(nattr.empty() || nattr == "NONE")
-			{
-				map<string, string>::iterator it = mapAA.find(attr);
-				if(it != mapAA.end())
-				{
-					string alias = it->second;
-					if(alias.empty())
-						checkItem->setText(0, attr.c_str());
-					else
-						checkItem->setText(0, alias.c_str());
-				}
-				else
-					checkItem->setText(0, attr.c_str());
-			}
-			else
-			{
-				string alias = attr;
-				map<string, string>::iterator it = mapAA.find(attr);
-				if(it != mapAA.end())
-					alias = it->second;
-
-				it = mapAA.find(nattr);
-				if(it != mapAA.end())
-					alias += "/" + it->second;
-				else
-					alias += "/" + nattr;
-
-				checkItem->setText(0, alias.c_str());
-			}
-		}
-		else if (checkItem->getType() == TeQtCheckListItem::CHART)
-		{
-			string attr = ((TeQtChartItem*)checkItem)->name();
-			map<string, string>::iterator it = mapAA.find(attr);
-			if(it != mapAA.end())
-			{
-				string alias = it->second;
-				checkItem->setText(0, alias.c_str());
-			}
-			else
-				checkItem->setText(0, attr.c_str());
-		}
-	}
-}
-
-void TeQtThemeItem::setTheme(TeTheme* theme) {
-	if(theme_ != NULL)
-		delete theme_;
-
-	theme_ = theme;
-}
-
-
-
diff --git a/src/terralib/drivers/qt/TeQtThemeItemFCT.h b/src/terralib/drivers/qt/TeQtThemeItemFCT.h
deleted file mode 100755
index 144a679..0000000
--- a/src/terralib/drivers/qt/TeQtThemeItemFCT.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTTHEMEITEM_H
-#define  __TERRALIB_INTERNAL_QTTHEMEITEM_H
-
-#include <TeQtCheckListItem.h>
-
-class TeTheme;
-class TeLegendEntry;
-
-
-class TeQtThemeItem : public TeQtCheckListItem
-{
-public:
-    TeQtThemeItem(QListViewItem *parent, QString text, TeTheme* theme);
-
-	~TeQtThemeItem () {}
-
-	TeTheme* getTheme()
-		{return theme_;}
-
-	void removeLegends();
-
-	void removeCharts();
-
-	void getLegends(vector<const QPixmap*>& pixmapVector, vector<string>& labels, string& title);
-
-	TeQtCheckListItem* getLegendItem(TeLegendEntry* leg);
-
-	void updateAlias();
-
-	void setTheme(TeTheme* theme);
-
-protected:
-	TeTheme *theme_;
-
-	virtual void stateChange(bool);
-};
-
-#endif
diff --git a/src/terralib/drivers/qt/TeQtViewItem.cpp b/src/terralib/drivers/qt/TeQtViewItem.cpp
old mode 100755
new mode 100644
index 87815e9..440469f
--- a/src/terralib/drivers/qt/TeQtViewItem.cpp
+++ b/src/terralib/drivers/qt/TeQtViewItem.cpp
@@ -1,75 +1,75 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtViewItem.h>
-#include <TeQtThemeItem.h>
-#include <qpixmap.h>
-#include <images/view.xpm>
-
-
-//Database item constructor
-TeQtViewItem::TeQtViewItem(QListView *parent,
-	QString text, TeView *view)
-	: TeQtCheckListItem(parent,text), view_(view)
-{
-	type_ = VIEW;
-//	QPixmap p("images/view.bmp");
-	QPixmap p((const char**)view_xpm);
-	setPixmap(0,p);
-	setRenameEnabled(0,true);
-	setSelected(false);
-	setEnabled(true);
-	setDragEnabled(false);
-}
-
-void	
-TeQtViewItem::resetAll()
-{
-	vector<QListViewItem*> childrenVector = this->getChildren();
-	for (int i = 0; i < (int)childrenVector.size(); ++i)
-		((TeQtThemeItem*)childrenVector[i])->setOn(false);
-}
-
-vector<TeQtThemeItem*> TeQtViewItem::getThemeItemVec()
-{
-	vector<TeQtThemeItem*> themeItemVec;
-
-	TeQtCheckListItem*	checkListItem;
-	TeQtThemeItem*	themeItem;
-
-	QListViewItemIterator it(this);
-	++it; // Lauro
-	while(it.current())
-	{
-		checkListItem = (TeQtCheckListItem*)it.current();
-		if (checkListItem->getType() == TeQtCheckListItem::THEME)
-		{
-			themeItem = (TeQtThemeItem*)it.current();
-			themeItemVec.push_back(themeItem);
-		}
-		else if(checkListItem->getType() == TeQtCheckListItem::VIEW) // Lauro
-			break; // Lauro
-
-		++it;
-	}
-
-	return themeItemVec;
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeQtViewItem.h>
+#include <TeQtThemeItem.h>
+#include <qpixmap.h>
+#include <images/view.xpm>
+
+
+//Database item constructor
+TeQtViewItem::TeQtViewItem(QListView *parent,
+	QString text, TeView *view)
+	: TeQtCheckListItem(parent,text), view_(view)
+{
+	type_ = VIEW;
+//	QPixmap p("images/view.bmp");
+	QPixmap p((const char**)view_xpm);
+	setPixmap(0,p);
+	setRenameEnabled(0,true);
+	setSelected(false);
+	setEnabled(true);
+	setDragEnabled(false);
+}
+
+void	
+TeQtViewItem::resetAll()
+{
+	vector<QListViewItem*> childrenVector = this->getChildren();
+	for (int i = 0; i < (int)childrenVector.size(); ++i)
+		((TeQtThemeItem*)childrenVector[i])->setOn(false);
+}
+
+vector<TeQtThemeItem*> TeQtViewItem::getThemeItemVec()
+{
+	vector<TeQtThemeItem*> themeItemVec;
+
+	TeQtCheckListItem*	checkListItem;
+	TeQtThemeItem*	themeItem;
+
+	QListViewItemIterator it(this);
+	++it; // Lauro
+	while(it.current())
+	{
+		checkListItem = (TeQtCheckListItem*)it.current();
+		if (checkListItem->getType() == TeQtCheckListItem::THEME)
+		{
+			themeItem = (TeQtThemeItem*)it.current();
+			themeItemVec.push_back(themeItem);
+		}
+		else if(checkListItem->getType() == TeQtCheckListItem::VIEW) // Lauro
+			break; // Lauro
+
+		++it;
+	}
+
+	return themeItemVec;
+}
diff --git a/src/terralib/drivers/qt/TeQtViewItem.h b/src/terralib/drivers/qt/TeQtViewItem.h
old mode 100755
new mode 100644
index 21bdd40..15987a0
--- a/src/terralib/drivers/qt/TeQtViewItem.h
+++ b/src/terralib/drivers/qt/TeQtViewItem.h
@@ -1,58 +1,58 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTVIEWITEM_H
-#define  __TERRALIB_INTERNAL_QQTVIEWITEM_H
-
-#include <TeQtCheckListItem.h>
-
-class TeQtThemeItem;
-
-class TeView;
-
-class TeQtViewItem : public TeQtCheckListItem
-{
-public:
-    TeQtViewItem(QListView *parent, QString text,
-				 TeView *view);
-
-	~TeQtViewItem () {}
-
-	int compare(QListViewItem * i, int col, bool ascending) const
-		{ return QListViewItem::compare(i, col, ascending); }
-
-	QString key(int col, bool ascending) const
-		{ return QListViewItem::key(col, ascending); }
-
-	TeView*	getView() {return view_;}
-
-	void setView(TeView *view)
-		{ view_ = view; }
-
-	void resetAll();
-
-	vector<TeQtThemeItem*> getThemeItemVec();
-
-protected:
-	TeView	*view_;
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTVIEWITEM_H
+#define  __TERRALIB_INTERNAL_QTVIEWITEM_H
+
+#include <TeQtCheckListItem.h>
+
+class TeQtThemeItem;
+
+class TeView;
+
+class TLAPPUTILS_DLL TeQtViewItem : public TeQtCheckListItem
+{
+public:
+    TeQtViewItem(QListView *parent, QString text,
+				 TeView *view);
+
+	~TeQtViewItem () {}
+
+	int compare(QListViewItem * i, int col, bool ascending) const
+		{ return QListViewItem::compare(i, col, ascending); }
+
+	QString key(int col, bool ascending) const
+		{ return QListViewItem::key(col, ascending); }
+
+	TeView*	getView() {return view_;}
+
+	void setView(TeView *view)
+		{ view_ = view; }
+
+	void resetAll();
+
+	vector<TeQtThemeItem*> getThemeItemVec();
+
+protected:
+	TeView	*view_;
+};
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtViewItemFCT.cpp b/src/terralib/drivers/qt/TeQtViewItemFCT.cpp
deleted file mode 100755
index 22137db..0000000
--- a/src/terralib/drivers/qt/TeQtViewItemFCT.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeQtViewItemFCT.h>
-#include <TeQtThemeItemFCT.h>
-#include <qpixmap.h>
-//#include <../../../../../terraBase/src/ui/images/view.xpm>
-
-
-//Database item constructor
-TeQtViewItem::TeQtViewItem(QListView *parent,
-	QString text, TeView *view)
-	: TeQtCheckListItem(parent,text), view_(view)
-{
-	type_ = VIEW;
-//	QPixmap p("images/view.bmp");
-//	QPixmap p((const char**)view_xpm);
-	QPixmap p = QPixmap::fromMimeSource("view.bmp"); //(database_xpm);
-	setPixmap(0,p);
-	setRenameEnabled(0,true);
-	setSelected(false);
-	setEnabled(true);
-	setDragEnabled(false);
-}
-
-void	
-TeQtViewItem::resetAll()
-{
-	vector<QListViewItem*> childrenVector = this->getChildren();
-	for (int i = 0; i < (int)childrenVector.size(); ++i)
-		((TeQtThemeItem*)childrenVector[i])->setOn(false);
-}
diff --git a/src/terralib/drivers/qt/TeQtViewItemFCT.h b/src/terralib/drivers/qt/TeQtViewItemFCT.h
deleted file mode 100755
index 16651c9..0000000
--- a/src/terralib/drivers/qt/TeQtViewItemFCT.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTVIEWITEM_H
-#define  __TERRALIB_INTERNAL_QQTVIEWITEM_H
-
-#include <TeQtCheckListItem.h>
-
-class TeView;
-
-class TeQtViewItem : public TeQtCheckListItem
-{
-public:
-    TeQtViewItem(QListView *parent, QString text,
-				 TeView *view);
-
-	~TeQtViewItem () {}
-
-	int compare(QListViewItem * i, int col, bool ascending) const
-		{ return QListViewItem::compare(i, col, ascending); }
-
-	QString key(int col, bool ascending) const
-		{ return QListViewItem::key(col, ascending); }
-
-	TeView*	getView() {return view_;}
-
-	void setView(TeView *view)
-		{ view_ = view; }
-
-	void resetAll();
-
-protected:
-	TeView	*view_;
-};
-
-#endif
diff --git a/src/terralib/drivers/qt/TeQtViewsListView.cpp b/src/terralib/drivers/qt/TeQtViewsListView.cpp
old mode 100755
new mode 100644
index 973e23a..1a4cc73
--- a/src/terralib/drivers/qt/TeQtViewsListView.cpp
+++ b/src/terralib/drivers/qt/TeQtViewsListView.cpp
@@ -1,921 +1,921 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright ? 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include "TeQtViewsListView.h"
-#include "TeQtCheckListItem.h"
-#include "TeQtViewItem.h"
-#include "TeQtThemeItem.h"
-#include "TeAppTheme.h"
-#include "TeWaitCursor.h"
-#include <qapplication.h>
-#include <qpopupmenu.h>
-#include <qdragobject.h>
-#include <list>
-
-TeQtViewsListView::TeQtViewsListView(QWidget *parent, const char *name)
-		: QListView(parent, name)
-{
-	pressedThemeItem_ = 0;
-	currentViewItem_ = 0;
-	currentThemeItem_ = 0;
-	refThemeItemForVis_ = 0;
-	rightMouseWasClicked_ = false;
-	checkItemStateChanged_ = false;
-	leftButtonPressed_ = false;
-	drag_ = false;
-
-	setSelectionMode(QListView::Multi);
-    setRootIsDecorated( TRUE );
-//	setAcceptDrops(true);
-	viewport()->setAcceptDrops(true);
-
-	popupMenu_ = new QPopupMenu(this);
-
-	//Mounting the brushStyleMap
-	brushStyleMap_[TePolyTypeTransparent] = Qt::NoBrush;
-	brushStyleMap_[TePolyTypeFill] = Qt::SolidPattern;
-	brushStyleMap_[TePolyTypeHorizontal] = Qt::HorPattern;
-	brushStyleMap_[TePolyTypeVertical] = Qt::VerPattern;
-	brushStyleMap_[TePolyTypeFDiagonal] = Qt::FDiagPattern;
-	brushStyleMap_[TePolyTypeBDiagonal] = Qt::BDiagPattern;
-	brushStyleMap_[TePolyTypeCross] = Qt::CrossPattern;
-	brushStyleMap_[TePolyTypeDiagonalCross] = Qt::DiagCrossPattern;
-
-	//Mounting the penStyleMap
-	penStyleMap_[TeLnTypeContinuous] = Qt::SolidLine;
-	penStyleMap_[TeLnTypeDashed] = Qt::DashLine;
-	penStyleMap_[TeLnTypeDotted] = Qt::DotLine;
-	penStyleMap_[TeLnTypeDashDot] = Qt::DashDotLine;
-	penStyleMap_[TeLnTypeDashDotDot] = Qt::DashDotDotLine;
-	penStyleMap_[TeLnTypeNone] = Qt::NoPen;
-
-	// rename action
-	setDefaultRenameAction(QListView::Accept);
-
-	connect(this,SIGNAL(clicked(QListViewItem*)),
-			this,SLOT(clicked(QListViewItem*)));
-	connect(this,SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&, int)),
-		    this,SLOT(contextMenuRequested(QListViewItem*,const QPoint&, int)));
-}
-
-
-TeQtViewsListView::~TeQtViewsListView()
-{
-	if (popupMenu_)
-		delete popupMenu_;
-}
-
-
-void TeQtViewsListView::selectItem(QListViewItem *item)
-{
-	checkItemStateChanged_ = false;
-	rightMouseWasClicked_ = false;
-	clicked(item);
-}
-
-
-void TeQtViewsListView::selectViewItem(TeView *view)
-{
-	if (view == 0)
-		return;
-
-	QListViewItem *child = firstChild();
-    while (child)
-	{
-		TeQtViewItem *viewItem = (TeQtViewItem*)child;
-		if (viewItem->getView() == view)
-		{
-			if (viewItem == currentViewItem_)
-				break;
-			else
-			{
-				unselectAllItems();
-				child->setSelected(true);
-				child->repaint();
-				currentViewItem_ = viewItem;
-				currentThemeItem_ = 0;
-				emit itemChanged(child);
-				return;
-			}
-		}
-        child = child->nextSibling();
-	}
-}
-
-
-TeQtViewItem* TeQtViewsListView::getViewItem(TeView *view)
-{
-	if (view == 0)
-		return 0;
-
-	QListViewItem *child = firstChild();
-    while (child)
-	{
-		TeQtViewItem *viewItem = (TeQtViewItem*)child;
-		if (viewItem->getView() == view)
-			return viewItem;
-		else
-			child = child->nextSibling();
-	}
-	return 0;
-}
-
-TeQtViewItem* TeQtViewsListView::getViewItem(TeQtThemeItem *themeItem)
-{
-	if (themeItem == 0)
-		return 0;
-
-	TeQtViewItem *viewItem = (TeQtViewItem*)themeItem->parent();
-
-	return viewItem;
-}
-
-
-TeQtThemeItem* TeQtViewsListView::getThemeItem(TeAppTheme* appTheme)
-{
-	if (appTheme == 0)
-		return 0;
-
-	QListViewItem *item;
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
-			if (themeItem->getAppTheme() == appTheme)
-					return themeItem;
-		}
-		it++;
-		item = it.current();
-	}
-	return 0;
-}
-
-TeQtThemeItem* TeQtViewsListView::getThemeItem(int themeId)
-{
-	QListViewItem *item;
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
-			if (themeItem->getAppTheme()->getTheme()->id() == themeId)
-					return themeItem;
-		}
-		it++;
-		item = it.current();
-	}
-	return 0;
-}
-
-
-void TeQtViewsListView::removeViewItem(TeView *view)
-{
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::VIEW)
-		{
-			TeQtViewItem* viewItem = (TeQtViewItem*)item;
-			if (viewItem->getView() == view)
-			{
-				if (viewItem == currentViewItem_)
-					currentViewItem_ = 0;
-				removeItem(item);
-				break;
-			}
-		}
-		it++;
-		item = it.current();
-	}	
-}
-
-
-void TeQtViewsListView::removeThemeItem(TeAppTheme* appTheme)
-{
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
-			if (themeItem->getAppTheme() == appTheme)
-			{
-				if (themeItem == currentThemeItem_)
-					currentThemeItem_ = 0;
-				removeItem(item);
-				break;
-			}
-		}
-		it++;
-		item = it.current();
-	}	
-}
-
-void TeQtViewsListView::removeThemeItem(int themeId)
-{
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
-			if (themeItem->getAppTheme()->getTheme()->id() == themeId)
-			{
-				if (themeItem == currentThemeItem_)
-					currentThemeItem_ = 0;
-				removeItem(item);
-				break;
-			}
-		}
-		it++;
-		item = it.current();
-	}	
-}
-
-void TeQtViewsListView::removeItem(QListViewItem *item)
-{
-	if (item == 0)
-		return;
-
-	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-
-	if(checkListItem->getType() == TeQtCheckListItem::VIEW)
-	{
-		TeQtViewItem* viewItem = (TeQtViewItem*)item;
-
-		vector<QListViewItem*> childrenVector;
-		childrenVector = viewItem->getChildren();
-
-		int i;
-		TeQtThemeItem *themeItem;
-		for (i = 0; i < (int)childrenVector.size(); ++i)
-		{
-			themeItem = (TeQtThemeItem*)childrenVector[i];
-			delete themeItem;
-		}
-
-		if (currentViewItem_ == viewItem)
-		{
-			currentViewItem_ = 0;
-			currentThemeItem_ = 0;
-		}
-		delete viewItem;
-	}
-	else if (checkListItem->getType() == TeQtCheckListItem::THEME)
-	{
-		TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
-		if (currentThemeItem_ == themeItem)
-			currentThemeItem_ = 0;
-		delete themeItem;
-	}
-	else
-		delete item;
-}
-
-
-void TeQtViewsListView::checkItemStateChanged(QCheckListItem *checkListItem, bool visible)
-{
-	checkItemStateChanged_ = true;
-	emit checkListItemVisChanged(checkListItem, visible);
-}
-
-
-void TeQtViewsListView::openViewItems()
-{
-	QListViewItem *child = firstChild();
-	while (child)
-	{
-		setOpen(child, true);
-		child = child->nextSibling();
-	}
-}
-
-
-void TeQtViewsListView::reset()
-{
-	unselectAllItems();
-	currentViewItem_ = 0;
-	currentThemeItem_ = 0;
-}
-
-
-void TeQtViewsListView::setOn(QCheckListItem *item, bool visible)
-{
-	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-	if (checkListItem->getType() == TeQtCheckListItem::THEME)
-	{
-		TeQtThemeItem *themeItem = (TeQtThemeItem*)item;
-		themeItem->setOn(visible);
-		checkItemStateChanged_ = false;
-		emit checkListItemVisChanged(checkListItem, visible);
-	}
-}
-
-
-void TeQtViewsListView::clicked(QListViewItem *item)
-{
-	if(item == 0)
-		return;
-	if(drag_ && pressedThemeItem_)
-		return;
-
-	unselectAllItems();
-
-	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-
-	if(	checkItemStateChanged_ && (checkListItem->getType() == TeQtCheckListItem::THEME))
-	{
-		checkItemStateChanged_ = false;
-		TeQtThemeItem* themeItem = (TeQtThemeItem*)checkListItem;
-		if(themeItem->isThemeItemInvalid())
-			themeItem->setOn(false);
-
-		if(currentThemeItem_)
-		{
-			currentThemeItem_->parent()->setSelected(true);
-			currentThemeItem_->parent()->repaint();
-			currentThemeItem_->setSelected(true);
-			currentThemeItem_->repaint();
-			return;
-		}
-	}
-
-	if(checkListItem->getType() != TeQtCheckListItem::THEME)
-	{
-		if (rightMouseWasClicked_ == true || checkItemStateChanged_ == true ||
-			drag_ == true || checkListItem->getType() == TeQtCheckListItem::LEGEND ||
-			checkListItem->getType() == TeQtCheckListItem::CHART)
-		{
-			if (checkListItem->getType() == TeQtCheckListItem::LEGEND ||
-				checkListItem->getType() == TeQtCheckListItem::CHART)
-			{
-				checkListItem->setSelected(false);
-				checkListItem->repaint();
-			}
-
-			if (currentViewItem_ != 0)
-			{
-				currentViewItem_->setSelected(true);
-				currentViewItem_->repaint();
-			}
-
-			if (currentThemeItem_ != 0)
-			{
-				currentThemeItem_->setSelected(true);
-				currentThemeItem_->repaint();
-			}
-			rightMouseWasClicked_ = false;
-			checkItemStateChanged_ = false;
-			return;
-		}
-	}
-
-	if (checkListItem->getType() == TeQtCheckListItem::VIEW)
-	{
-		item->setSelected(true);
-		item->repaint();
-
-		TeQtViewItem *viewItem = (TeQtViewItem*)item;
-		if (viewItem != currentViewItem_)
-		{
-			currentViewItem_ = viewItem;
-			currentThemeItem_ = 0;
-			emit itemChanged(item);
-		}
-		else
-		{
-			if (currentThemeItem_ != 0)
-			{
-				currentThemeItem_->setSelected(true);
-				currentThemeItem_->repaint();
-			}
-		}
-	}
-	else if(checkListItem->getType() == TeQtCheckListItem::THEME)
-	{
-		TeQtThemeItem* themeItem = (TeQtThemeItem*)checkListItem;
-		if(themeItem->isThemeItemInvalid())
-			return;
-		item->parent()->setSelected(true);
-		item->parent()->repaint();
-		item->setSelected(true);
-		item->repaint();
-
-		TeQtViewItem *viewItem = (TeQtViewItem*)item->parent();
-		if (currentViewItem_ != viewItem && rightMouseWasClicked_ == false)
-		{
-			currentViewItem_ = viewItem;
-			emit itemChanged(item->parent());
-		}
-
-		themeItem = (TeQtThemeItem*)item;
-		if (themeItem != currentThemeItem_ && rightMouseWasClicked_ == false)
-		{
-			currentThemeItem_ = themeItem;
-			emit itemChanged(item);
-		}
-	}
-	rightMouseWasClicked_ = false;
-	checkItemStateChanged_ = false;
-}
-
-
-void TeQtViewsListView::contextMenuRequested(QListViewItem *item, const QPoint&, int)
-{
-	popupItem_ = (TeQtCheckListItem*)item;
-
-	unselectAllItems();
-	if (currentViewItem_)
-	{
-		currentViewItem_->setSelected(true);
-		currentViewItem_->repaint();
-	}
-
-	if (currentThemeItem_)
-	{
-		currentThemeItem_->setSelected(true);
-		currentThemeItem_->repaint();
-	}
-
-	emit popupSignal();	
-}
-
-void TeQtViewsListView::contentsMousePressEvent(QMouseEvent *e)
-{
-	rightMouseWasClicked_ = false;;
-	if (e->button() == RightButton)
-	{
-		rightMouseWasClicked_ = true;
-		popupMenu_->move(e->globalPos().x(), e->globalPos().y());
-	}
-	else if (e->button() == LeftButton)
-	{
-		QPoint p( contentsToViewport( e->pos() ) );
-		pressedPosition_ = p;
-		TeQtCheckListItem *item = (TeQtCheckListItem*)itemAt(p);
-		if (item != 0)
-		{
-			if(item->getType() == TeQtCheckListItem::THEME)
-			{
-				// don?t drag, if the user clicked into the root decoration of the item
-				int x = p.x();
-				int len = treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin();
-				if (x > len)
-//				if (p.x() > treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin())
-				{
-					pressedThemeItem_ = (TeQtThemeItem*)item;
-					themeOpen_ = isOpen(item);
-				}
-	
-				// Item was pressed inside the visibility box
-				if (x > len && x < len + 10)
-				{
-					if (e->state() & Qt::ShiftButton)
-					{
-						if (refThemeItemForVis_ == 0)
-							refThemeItemForVis_ = (TeQtThemeItem*)item;
-						else
-						{
-							TeQtThemeItem *themeItem = (TeQtThemeItem*)item;
-							if ((themeItem == refThemeItemForVis_) ||
-								(themeItem->parent() != refThemeItemForVis_->parent()))
-								return;
-
-							list<TeQtCheckListItem*> themeItemList;
-							list<TeQtCheckListItem*>::iterator it;
-							// find if the item pressed is below the reference item
-							TeQtCheckListItem *itemBelow = (TeQtCheckListItem*)refThemeItemForVis_->itemBelow();
-							while((itemBelow != 0) && (itemBelow->getType() == TeQtCheckListItem::THEME))
-							{
-								themeItemList.push_back(itemBelow);
-								if (itemBelow == themeItem)
-								{
-									for (it = themeItemList.begin(); it != themeItemList.end(); ++it)
-									{
-										TeQtCheckListItem *thItem = *it;
-										bool visible = refThemeItemForVis_->isOn();
-										setOn(thItem, visible);
-									}
-									refThemeItemForVis_ = 0;
-									return;
-								}
-								itemBelow = (TeQtCheckListItem*)itemBelow->itemBelow();
-							}
-
-							// find if the item pressed is above the reference item
-							themeItemList.clear();
-							TeQtCheckListItem *itemAbove = (TeQtCheckListItem*)refThemeItemForVis_->itemAbove();
-							while((itemAbove != 0) && (itemAbove->getType() == TeQtCheckListItem::THEME))
-							{
-								themeItemList.push_back(itemAbove);
-								if (itemAbove == themeItem)
-								{
-									for (it = themeItemList.begin(); it != themeItemList.end(); ++it)
-									{
-										TeQtCheckListItem* thItem = *it;
-										bool visible = refThemeItemForVis_->isOn();
-										setOn(thItem, visible);
-									}
-									refThemeItemForVis_ = 0;
-									return;
-								}
-								itemAbove = (TeQtCheckListItem*)itemAbove->itemAbove();
-							}
-						}
-					}
-					else
-						refThemeItemForVis_ = 0;
-				}
-			}
-			else
-			{
-				item->setSelected(false);
-				item->repaint();
-				pressedThemeItem_ = 0;
-			}
-			leftButtonPressed_ = true;
-		}
-	}
-
-	QListView::contentsMousePressEvent(e);
-}
-
-
-void TeQtViewsListView::contentsMouseReleaseEvent(QMouseEvent *e)
-{
-	leftButtonPressed_ = false;
-	QListView::contentsMouseReleaseEvent(e);
-
-	if(currentThemeItem_)
-	{
-		unselectAllItems();
-		currentThemeItem_->parent()->setSelected(true);
-		currentThemeItem_->parent()->repaint();
-		currentThemeItem_->setSelected(true);
-		repaint();
-	}
-	drag_ = false;
-}
-
-
-void TeQtViewsListView::unselectAllItems()
-{
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		setSelected(item,false);
-		item->repaint();
-		it++;
-		item = it.current();
-	}
-}
-
-
-void TeQtViewsListView::contentsMouseMoveEvent(QMouseEvent* e)
-{
-	QPoint p( contentsToViewport( e->pos() ) );
-    if (leftButtonPressed_)
-	{
-		QPoint pdif = pressedPosition_ - p;
-		if(abs(pdif.x()) > 2 || abs(pdif.y()) > 2)
-		{
-			drag_ = true;
-			leftButtonPressed_ = false;
-			if(pressedThemeItem_)
-			{
-				TeQtCheckListItem *item = (TeQtCheckListItem*)itemAt(p);
-				if (item && item->getType() == TeQtCheckListItem::THEME)
-				{
-	//				clicked(item);
-					QUriDrag* ud = new QUriDrag(viewport());
-					ud->drag();
-				}
-			}
-		}
-    }
-	if(drag_ && pressedThemeItem_)
-		pressedThemeItem_->setOpen(themeOpen_);
-}
-
-
-void TeQtViewsListView::contentsDragMoveEvent(QDragMoveEvent *e)
-{
-	if(pressedThemeItem_)
-		pressedThemeItem_->setOpen(themeOpen_);
-
-	if(e->source() != viewport())
-	{
-		e->ignore();
-		e->acceptAction(false);
-		return;
-	}
-
-    QPoint p = contentsToViewport(((QDragMoveEvent*)e)->pos());
-    TeQtCheckListItem *item = (TeQtCheckListItem*)itemAt(p);
-    if (item)
-	{
-		if (p.x() < treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin())
-		{
-			e->ignore();
-			e->acceptAction(false);
-		}
-		else
-		{
-			if(item->getType() == TeQtCheckListItem::THEME || item->getType() == TeQtCheckListItem::VIEW)
-			{
-				e->accept();
-				e->acceptAction();
-			}
-			else
-			{
-				e->ignore();
-				e->acceptAction(false);
-				if(currentThemeItem_)
-				{
-					unselectAllItems();
-					currentThemeItem_->parent()->setSelected(true);
-					currentThemeItem_->parent()->repaint();
-					currentThemeItem_->setSelected(true);
-					repaint();
-				}
-			}
-		}
-    }
-	else
-	{
-		e->ignore();
-		e->acceptAction(false);
-	}
-}
-
-
-void TeQtViewsListView::contentsDropEvent(QDropEvent *e)
-{
-	if(e->source() != viewport())
-	{
-		e->ignore();
-		e->acceptAction(false);
-		pressedThemeItem_ = 0;
-		if(currentThemeItem_)
-		{
-			unselectAllItems();
-			currentThemeItem_->parent()->setSelected(true);
-			currentThemeItem_->parent()->repaint();
-			currentThemeItem_->setSelected(true);
-			repaint();
-		}
-		return;
-	}
-
-	int itemPriority;
-	TeQtThemeItem *themeItem;
-	bool viewChanged = false;
-
-    QPoint p = contentsToViewport(((QDragMoveEvent*)e)->pos());
-	TeQtCheckListItem *dropItem = (TeQtCheckListItem*)itemAt(p);
-
-	if (dropItem == 0)
-	{
-		e->ignore();
-		e->acceptAction(false);
-		pressedThemeItem_ = 0;
-		if(currentThemeItem_)
-		{
-			unselectAllItems();
-			currentThemeItem_->parent()->setSelected(true);
-			currentThemeItem_->parent()->repaint();
-			currentThemeItem_->setSelected(true);
-			repaint();
-		}
-		return;
-	}
-
-	if (dropItem == pressedThemeItem_)
-	{
-		e->ignore();
-		e->acceptAction(false);
-		pressedThemeItem_ = 0;
-		if(currentThemeItem_)
-		{
-			unselectAllItems();
-			currentThemeItem_->parent()->setSelected(true);
-			currentThemeItem_->parent()->repaint();
-			currentThemeItem_->setSelected(true);
-			repaint();
-		}
-		return;
-	}
-
-	e->accept();
-	e->acceptAction();
-
-	//Set the view item of the pressed item and the drop item
-	TeQtViewItem *pressedViewItem = (TeQtViewItem*)pressedThemeItem_->parent();
-	TeQtViewItem *dropViewItem;
-	if(dropItem->getType() == TeQtCheckListItem::THEME)
-		dropViewItem = (TeQtViewItem*)dropItem->parent();
-	else
-		dropViewItem = (TeQtViewItem*)dropItem;
-
-	//set a flag to indicate whether there was a view change
-	if (pressedViewItem != dropViewItem)
-		viewChanged = true;
-
-	//update the priorities and move the items accordingly
-	if (viewChanged)
-	{
-		vector<QListViewItem*> themeItemVector = dropViewItem->getChildren();
-		for (unsigned int i = 0; i < themeItemVector.size(); ++i)
-		{
-			themeItem = (TeQtThemeItem*)themeItemVector[i];
-			if(pressedThemeItem_->text(0) == themeItem->text(0))
-			{
-				emit dragDropItems(0, 0, 0);
-				pressedThemeItem_ = 0;
-				return;
-			}
-		}
-
-		if (dropItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem *dropThemeItem = (TeQtThemeItem*)dropItem;
-			itemPriority = dropThemeItem->order();
-			pressedThemeItem_->order(itemPriority);
-			themeItem = dropThemeItem;
-		}
-		else
-		{
-			itemPriority = 0;
-			pressedThemeItem_->order(itemPriority);
-			themeItem = (TeQtThemeItem*)dropViewItem->firstChild();
-		}
-
-		while (themeItem)
-		{
-			themeItem->order(++itemPriority);
-			themeItem = (TeQtThemeItem*)themeItem->nextSibling();
-		}
-		pressedViewItem->takeItem(pressedThemeItem_);
-		dropViewItem->insertItem(pressedThemeItem_);
-	}
-	else
-	{
-		if (dropItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem *dropThemeItem = (TeQtThemeItem*)dropItem;
-			int pressedItemPriority = pressedThemeItem_->order();
-			int droppedItemPriority = dropThemeItem->order();
-			if (pressedItemPriority < droppedItemPriority)
-			{
-				itemPriority = pressedItemPriority;
-				pressedThemeItem_->order(droppedItemPriority);
-				themeItem = (TeQtThemeItem*)pressedThemeItem_->nextSibling();
-				while (themeItem != dropThemeItem)
-				{
-					themeItem->order(itemPriority++);
-					themeItem = (TeQtThemeItem*)themeItem->nextSibling();
-				}
-				dropThemeItem->order(itemPriority);
-			}
-			else
-			{
-				itemPriority = droppedItemPriority;
-				pressedThemeItem_->order(itemPriority);
-				themeItem = (TeQtThemeItem*)dropThemeItem;
-
-				while (themeItem != pressedThemeItem_)
-				{
-					themeItem->order(++itemPriority);
-					themeItem = (TeQtThemeItem*)themeItem->nextSibling();
-				}
-			}
-			pressedThemeItem_->moveItem(dropThemeItem);
-		}
-		else
-		{
-			itemPriority = 0;
-			pressedThemeItem_->order(itemPriority);
-			themeItem = (TeQtThemeItem*)dropItem->firstChild();
-			while (themeItem != pressedThemeItem_)
-			{
-				themeItem->order(++itemPriority);
-				themeItem = (TeQtThemeItem*)themeItem->nextSibling();
-			}
-			pressedViewItem->takeItem(pressedThemeItem_);
-			pressedViewItem->insertItem(pressedThemeItem_);
-			dropViewItem->setOpen(true);
-		}
-	}
-
-	if (pressedViewItem != dropViewItem)
-	{
-		// the drag and drop theme items belong to different views
-		if (pressedThemeItem_ == currentThemeItem_)
-		{
-			currentViewItem_ = dropViewItem;
-			clicked(pressedThemeItem_);
-		}
-	}
-
-//	emit dragDropItems(pressedViewItem, dropViewItem);
-	emit dragDropItems(pressedThemeItem_, pressedViewItem, dropViewItem);
-	pressedThemeItem_->setOpen(themeOpen_);
-
-	pressedThemeItem_ = 0;
-
-	if(currentThemeItem_)
-	{
-		unselectAllItems();
-		currentThemeItem_->parent()->setSelected(true);
-		currentThemeItem_->parent()->repaint();
-		currentThemeItem_->setSelected(true);
-		repaint();
-	}
-}
-
-vector<TeQtViewItem*> TeQtViewsListView::getViewItemVec()
-{
-	vector<TeQtViewItem*> viewItemVec;
-
-	TeQtCheckListItem*	checkListItem;
-	TeQtViewItem*		viewItem;
-
-	QListViewItemIterator it(this);
-	while(it.current())
-	{
-		checkListItem = (TeQtCheckListItem*)it.current();
-		if (checkListItem->getType() == TeQtCheckListItem::VIEW)
-		{
-			viewItem = (TeQtViewItem*)it.current();
-			viewItemVec.push_back(viewItem);
-		}
-		++it;
-	}
-
-	return viewItemVec;
-}
-
-vector<TeQtThemeItem*> TeQtViewsListView::getThemeItemVec()
-{
-	vector<TeQtThemeItem*> themeItemVec;
-
-	TeQtCheckListItem*	checkListItem;
-	TeQtThemeItem*		themeItem;
-
-	QListViewItemIterator it(this);
-	while(it.current())
-	{
-		checkListItem = (TeQtCheckListItem*)it.current();
-		if (checkListItem->getType() == TeQtCheckListItem::THEME)
-		{
-			themeItem = (TeQtThemeItem*)it.current();
-			themeItemVec.push_back(themeItem);
-		}
-		++it;
-	}
-
-	return themeItemVec;
-}
-
-
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright ? 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include "TeQtViewsListView.h"
+#include "TeQtCheckListItem.h"
+#include "TeQtViewItem.h"
+#include "TeQtThemeItem.h"
+#include "TeAppTheme.h"
+#include "TeWaitCursor.h"
+#include <qapplication.h>
+#include <qpopupmenu.h>
+#include <qdragobject.h>
+#include <list>
+
+TeQtViewsListView::TeQtViewsListView(QWidget *parent, const char *name)
+		: QListView(parent, name)
+{
+	pressedThemeItem_ = 0;
+	currentViewItem_ = 0;
+	currentThemeItem_ = 0;
+	refThemeItemForVis_ = 0;
+	rightMouseWasClicked_ = false;
+	checkItemStateChanged_ = false;
+	leftButtonPressed_ = false;
+	drag_ = false;
+
+	setSelectionMode(QListView::Multi);
+    setRootIsDecorated( TRUE );
+//	setAcceptDrops(true);
+	viewport()->setAcceptDrops(true);
+
+	popupMenu_ = new QPopupMenu(this);
+
+	//Mounting the brushStyleMap
+	brushStyleMap_[TePolyTypeTransparent] = Qt::NoBrush;
+	brushStyleMap_[TePolyTypeFill] = Qt::SolidPattern;
+	brushStyleMap_[TePolyTypeHorizontal] = Qt::HorPattern;
+	brushStyleMap_[TePolyTypeVertical] = Qt::VerPattern;
+	brushStyleMap_[TePolyTypeFDiagonal] = Qt::FDiagPattern;
+	brushStyleMap_[TePolyTypeBDiagonal] = Qt::BDiagPattern;
+	brushStyleMap_[TePolyTypeCross] = Qt::CrossPattern;
+	brushStyleMap_[TePolyTypeDiagonalCross] = Qt::DiagCrossPattern;
+
+	//Mounting the penStyleMap
+	penStyleMap_[TeLnTypeContinuous] = Qt::SolidLine;
+	penStyleMap_[TeLnTypeDashed] = Qt::DashLine;
+	penStyleMap_[TeLnTypeDotted] = Qt::DotLine;
+	penStyleMap_[TeLnTypeDashDot] = Qt::DashDotLine;
+	penStyleMap_[TeLnTypeDashDotDot] = Qt::DashDotDotLine;
+	penStyleMap_[TeLnTypeNone] = Qt::NoPen;
+
+	// rename action
+	setDefaultRenameAction(QListView::Accept);
+
+	connect(this,SIGNAL(clicked(QListViewItem*)),
+			this,SLOT(clicked(QListViewItem*)));
+	connect(this,SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&, int)),
+		    this,SLOT(contextMenuRequested(QListViewItem*,const QPoint&, int)));
+}
+
+
+TeQtViewsListView::~TeQtViewsListView()
+{
+	if (popupMenu_)
+		delete popupMenu_;
+}
+
+
+void TeQtViewsListView::selectItem(QListViewItem *item)
+{
+	checkItemStateChanged_ = false;
+	rightMouseWasClicked_ = false;
+	clicked(item);
+}
+
+
+void TeQtViewsListView::selectViewItem(TeView *view)
+{
+	if (view == 0)
+		return;
+
+	QListViewItem *child = firstChild();
+    while (child)
+	{
+		TeQtViewItem *viewItem = (TeQtViewItem*)child;
+		if (viewItem->getView() == view)
+		{
+			if (viewItem == currentViewItem_)
+				break;
+			else
+			{
+				unselectAllItems();
+				child->setSelected(true);
+				child->repaint();
+				currentViewItem_ = viewItem;
+				currentThemeItem_ = 0;
+				emit itemChanged(child);
+				return;
+			}
+		}
+        child = child->nextSibling();
+	}
+}
+
+
+TeQtViewItem* TeQtViewsListView::getViewItem(TeView *view)
+{
+	if (view == 0)
+		return 0;
+
+	QListViewItem *child = firstChild();
+    while (child)
+	{
+		TeQtViewItem *viewItem = (TeQtViewItem*)child;
+		if (viewItem->getView() == view)
+			return viewItem;
+		else
+			child = child->nextSibling();
+	}
+	return 0;
+}
+
+TeQtViewItem* TeQtViewsListView::getViewItem(TeQtThemeItem *themeItem)
+{
+	if (themeItem == 0)
+		return 0;
+
+	TeQtViewItem *viewItem = (TeQtViewItem*)themeItem->parent();
+
+	return viewItem;
+}
+
+
+TeQtThemeItem* TeQtViewsListView::getThemeItem(TeAppTheme* appTheme)
+{
+	if (appTheme == 0)
+		return 0;
+
+	QListViewItem *item;
+	QListViewItemIterator it(this);
+	item = it.current();
+	while(item)
+	{
+		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
+		if (checkListItem->getType() == TeQtCheckListItem::THEME)
+		{
+			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
+			if (themeItem->getAppTheme() == appTheme)
+					return themeItem;
+		}
+		it++;
+		item = it.current();
+	}
+	return 0;
+}
+
+TeQtThemeItem* TeQtViewsListView::getThemeItem(int themeId)
+{
+	QListViewItem *item;
+	QListViewItemIterator it(this);
+	item = it.current();
+	while(item)
+	{
+		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
+		if (checkListItem->getType() == TeQtCheckListItem::THEME)
+		{
+			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
+			if (themeItem->getAppTheme()->getTheme()->id() == themeId)
+					return themeItem;
+		}
+		it++;
+		item = it.current();
+	}
+	return 0;
+}
+
+
+void TeQtViewsListView::removeViewItem(TeView *view)
+{
+	QListViewItem *item;
+
+	QListViewItemIterator it(this);
+	item = it.current();
+	while(item)
+	{
+		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
+		if (checkListItem->getType() == TeQtCheckListItem::VIEW)
+		{
+			TeQtViewItem* viewItem = (TeQtViewItem*)item;
+			if (viewItem->getView() == view)
+			{
+				if (viewItem == currentViewItem_)
+					currentViewItem_ = 0;
+				removeItem(item);
+				break;
+			}
+		}
+		it++;
+		item = it.current();
+	}	
+}
+
+
+void TeQtViewsListView::removeThemeItem(TeAppTheme* appTheme)
+{
+	QListViewItem *item;
+
+	QListViewItemIterator it(this);
+	item = it.current();
+	while(item)
+	{
+		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
+		if (checkListItem->getType() == TeQtCheckListItem::THEME)
+		{
+			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
+			if (themeItem->getAppTheme() == appTheme)
+			{
+				if (themeItem == currentThemeItem_)
+					currentThemeItem_ = 0;
+				removeItem(item);
+				break;
+			}
+		}
+		it++;
+		item = it.current();
+	}	
+}
+
+void TeQtViewsListView::removeThemeItem(int themeId)
+{
+	QListViewItem *item;
+
+	QListViewItemIterator it(this);
+	item = it.current();
+	while(item)
+	{
+		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
+		if (checkListItem->getType() == TeQtCheckListItem::THEME)
+		{
+			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
+			if (themeItem->getAppTheme()->getTheme()->id() == themeId)
+			{
+				if (themeItem == currentThemeItem_)
+					currentThemeItem_ = 0;
+				removeItem(item);
+				break;
+			}
+		}
+		it++;
+		item = it.current();
+	}	
+}
+
+void TeQtViewsListView::removeItem(QListViewItem *item)
+{
+	if (item == 0)
+		return;
+
+	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
+
+	if(checkListItem->getType() == TeQtCheckListItem::VIEW)
+	{
+		TeQtViewItem* viewItem = (TeQtViewItem*)item;
+
+		vector<QListViewItem*> childrenVector;
+		childrenVector = viewItem->getChildren();
+
+		int i;
+		TeQtThemeItem *themeItem;
+		for (i = 0; i < (int)childrenVector.size(); ++i)
+		{
+			themeItem = (TeQtThemeItem*)childrenVector[i];
+			delete themeItem;
+		}
+
+		if (currentViewItem_ == viewItem)
+		{
+			currentViewItem_ = 0;
+			currentThemeItem_ = 0;
+		}
+		delete viewItem;
+	}
+	else if (checkListItem->getType() == TeQtCheckListItem::THEME)
+	{
+		TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
+		if (currentThemeItem_ == themeItem)
+			currentThemeItem_ = 0;
+		delete themeItem;
+	}
+	else
+		delete item;
+}
+
+
+void TeQtViewsListView::checkItemStateChanged(QCheckListItem *checkListItem, bool visible)
+{
+	checkItemStateChanged_ = true;
+	emit checkListItemVisChanged(checkListItem, visible);
+}
+
+
+void TeQtViewsListView::openViewItems()
+{
+	QListViewItem *child = firstChild();
+	while (child)
+	{
+		setOpen(child, true);
+		child = child->nextSibling();
+	}
+}
+
+
+void TeQtViewsListView::reset()
+{
+	unselectAllItems();
+	currentViewItem_ = 0;
+	currentThemeItem_ = 0;
+}
+
+
+void TeQtViewsListView::setOn(QCheckListItem *item, bool visible)
+{
+	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
+	if (checkListItem->getType() == TeQtCheckListItem::THEME)
+	{
+		TeQtThemeItem *themeItem = (TeQtThemeItem*)item;
+		themeItem->setOn(visible);
+		checkItemStateChanged_ = false;
+		emit checkListItemVisChanged(checkListItem, visible);
+	}
+}
+
+
+void TeQtViewsListView::clicked(QListViewItem *item)
+{
+	if(item == 0)
+		return;
+	if(drag_ && pressedThemeItem_)
+		return;
+
+	unselectAllItems();
+
+	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
+
+	if(	checkItemStateChanged_ && (checkListItem->getType() == TeQtCheckListItem::THEME))
+	{
+		checkItemStateChanged_ = false;
+		TeQtThemeItem* themeItem = (TeQtThemeItem*)checkListItem;
+		if(themeItem->isThemeItemInvalid())
+			themeItem->setOn(false);
+
+		if(currentThemeItem_)
+		{
+			currentThemeItem_->parent()->setSelected(true);
+			currentThemeItem_->parent()->repaint();
+			currentThemeItem_->setSelected(true);
+			currentThemeItem_->repaint();
+			return;
+		}
+	}
+
+	if(checkListItem->getType() != TeQtCheckListItem::THEME)
+	{
+		if (rightMouseWasClicked_ == true || checkItemStateChanged_ == true ||
+			drag_ == true || checkListItem->getType() == TeQtCheckListItem::LEGEND ||
+			checkListItem->getType() == TeQtCheckListItem::CHART)
+		{
+			if (checkListItem->getType() == TeQtCheckListItem::LEGEND ||
+				checkListItem->getType() == TeQtCheckListItem::CHART)
+			{
+				checkListItem->setSelected(false);
+				checkListItem->repaint();
+			}
+
+			if (currentViewItem_ != 0)
+			{
+				currentViewItem_->setSelected(true);
+				currentViewItem_->repaint();
+			}
+
+			if (currentThemeItem_ != 0)
+			{
+				currentThemeItem_->setSelected(true);
+				currentThemeItem_->repaint();
+			}
+			rightMouseWasClicked_ = false;
+			checkItemStateChanged_ = false;
+			return;
+		}
+	}
+
+	if (checkListItem->getType() == TeQtCheckListItem::VIEW)
+	{
+		item->setSelected(true);
+		item->repaint();
+
+		TeQtViewItem *viewItem = (TeQtViewItem*)item;
+		if (viewItem != currentViewItem_)
+		{
+			currentViewItem_ = viewItem;
+			currentThemeItem_ = 0;
+			emit itemChanged(item);
+		}
+		else
+		{
+			if (currentThemeItem_ != 0)
+			{
+				currentThemeItem_->setSelected(true);
+				currentThemeItem_->repaint();
+			}
+		}
+	}
+	else if(checkListItem->getType() == TeQtCheckListItem::THEME)
+	{
+		TeQtThemeItem* themeItem = (TeQtThemeItem*)checkListItem;
+		if(themeItem->isThemeItemInvalid())
+			return;
+		item->parent()->setSelected(true);
+		item->parent()->repaint();
+		item->setSelected(true);
+		item->repaint();
+
+		TeQtViewItem *viewItem = (TeQtViewItem*)item->parent();
+		if (currentViewItem_ != viewItem && rightMouseWasClicked_ == false)
+		{
+			currentViewItem_ = viewItem;
+			emit itemChanged(item->parent());
+		}
+
+		themeItem = (TeQtThemeItem*)item;
+		if (themeItem != currentThemeItem_ && rightMouseWasClicked_ == false)
+		{
+			currentThemeItem_ = themeItem;
+			emit itemChanged(item);
+		}
+	}
+	rightMouseWasClicked_ = false;
+	checkItemStateChanged_ = false;
+}
+
+
+void TeQtViewsListView::contextMenuRequested(QListViewItem *item, const QPoint&, int)
+{
+	popupItem_ = (TeQtCheckListItem*)item;
+
+	unselectAllItems();
+	if (currentViewItem_)
+	{
+		currentViewItem_->setSelected(true);
+		currentViewItem_->repaint();
+	}
+
+	if (currentThemeItem_)
+	{
+		currentThemeItem_->setSelected(true);
+		currentThemeItem_->repaint();
+	}
+
+	emit popupSignal();	
+}
+
+void TeQtViewsListView::contentsMousePressEvent(QMouseEvent *e)
+{
+	rightMouseWasClicked_ = false;;
+	if (e->button() == RightButton)
+	{
+		rightMouseWasClicked_ = true;
+		popupMenu_->move(e->globalPos().x(), e->globalPos().y());
+	}
+	else if (e->button() == LeftButton)
+	{
+		QPoint p( contentsToViewport( e->pos() ) );
+		pressedPosition_ = p;
+		TeQtCheckListItem *item = (TeQtCheckListItem*)itemAt(p);
+		if (item != 0)
+		{
+			if(item->getType() == TeQtCheckListItem::THEME)
+			{
+				// don?t drag, if the user clicked into the root decoration of the item
+				int x = p.x();
+				int len = treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin();
+				if (x > len)
+//				if (p.x() > treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin())
+				{
+					pressedThemeItem_ = (TeQtThemeItem*)item;
+					themeOpen_ = isOpen(item);
+				}
+	
+				// Item was pressed inside the visibility box
+				if (x > len && x < len + 10)
+				{
+					if (e->state() & Qt::ShiftButton)
+					{
+						if (refThemeItemForVis_ == 0)
+							refThemeItemForVis_ = (TeQtThemeItem*)item;
+						else
+						{
+							TeQtThemeItem *themeItem = (TeQtThemeItem*)item;
+							if ((themeItem == refThemeItemForVis_) ||
+								(themeItem->parent() != refThemeItemForVis_->parent()))
+								return;
+
+							list<TeQtCheckListItem*> themeItemList;
+							list<TeQtCheckListItem*>::iterator it;
+							// find if the item pressed is below the reference item
+							TeQtCheckListItem *itemBelow = (TeQtCheckListItem*)refThemeItemForVis_->itemBelow();
+							while((itemBelow != 0) && (itemBelow->getType() == TeQtCheckListItem::THEME))
+							{
+								themeItemList.push_back(itemBelow);
+								if (itemBelow == themeItem)
+								{
+									for (it = themeItemList.begin(); it != themeItemList.end(); ++it)
+									{
+										TeQtCheckListItem *thItem = *it;
+										bool visible = refThemeItemForVis_->isOn();
+										setOn(thItem, visible);
+									}
+									refThemeItemForVis_ = 0;
+									return;
+								}
+								itemBelow = (TeQtCheckListItem*)itemBelow->itemBelow();
+							}
+
+							// find if the item pressed is above the reference item
+							themeItemList.clear();
+							TeQtCheckListItem *itemAbove = (TeQtCheckListItem*)refThemeItemForVis_->itemAbove();
+							while((itemAbove != 0) && (itemAbove->getType() == TeQtCheckListItem::THEME))
+							{
+								themeItemList.push_back(itemAbove);
+								if (itemAbove == themeItem)
+								{
+									for (it = themeItemList.begin(); it != themeItemList.end(); ++it)
+									{
+										TeQtCheckListItem* thItem = *it;
+										bool visible = refThemeItemForVis_->isOn();
+										setOn(thItem, visible);
+									}
+									refThemeItemForVis_ = 0;
+									return;
+								}
+								itemAbove = (TeQtCheckListItem*)itemAbove->itemAbove();
+							}
+						}
+					}
+					else
+						refThemeItemForVis_ = 0;
+				}
+			}
+			else
+			{
+				item->setSelected(false);
+				item->repaint();
+				pressedThemeItem_ = 0;
+			}
+			leftButtonPressed_ = true;
+		}
+	}
+
+	QListView::contentsMousePressEvent(e);
+}
+
+
+void TeQtViewsListView::contentsMouseReleaseEvent(QMouseEvent *e)
+{
+	leftButtonPressed_ = false;
+	QListView::contentsMouseReleaseEvent(e);
+
+	if(currentThemeItem_)
+	{
+		unselectAllItems();
+		currentThemeItem_->parent()->setSelected(true);
+		currentThemeItem_->parent()->repaint();
+		currentThemeItem_->setSelected(true);
+		repaint();
+	}
+	drag_ = false;
+}
+
+
+void TeQtViewsListView::unselectAllItems()
+{
+	QListViewItem *item;
+
+	QListViewItemIterator it(this);
+	item = it.current();
+	while(item)
+	{
+		setSelected(item,false);
+		item->repaint();
+		it++;
+		item = it.current();
+	}
+}
+
+
+void TeQtViewsListView::contentsMouseMoveEvent(QMouseEvent* e)
+{
+	QPoint p( contentsToViewport( e->pos() ) );
+    if (leftButtonPressed_)
+	{
+		QPoint pdif = pressedPosition_ - p;
+		if(abs(pdif.x()) > 2 || abs(pdif.y()) > 2)
+		{
+			drag_ = true;
+			leftButtonPressed_ = false;
+			if(pressedThemeItem_)
+			{
+				TeQtCheckListItem *item = (TeQtCheckListItem*)itemAt(p);
+				if (item && item->getType() == TeQtCheckListItem::THEME)
+				{
+	//				clicked(item);
+					QUriDrag* ud = new QUriDrag(viewport());
+					ud->drag();
+				}
+			}
+		}
+    }
+	if(drag_ && pressedThemeItem_)
+		pressedThemeItem_->setOpen(themeOpen_);
+}
+
+
+void TeQtViewsListView::contentsDragMoveEvent(QDragMoveEvent *e)
+{
+	if(pressedThemeItem_)
+		pressedThemeItem_->setOpen(themeOpen_);
+
+	if(e->source() != viewport())
+	{
+		e->ignore();
+		e->acceptAction(false);
+		return;
+	}
+
+    QPoint p = contentsToViewport(((QDragMoveEvent*)e)->pos());
+    TeQtCheckListItem *item = (TeQtCheckListItem*)itemAt(p);
+    if (item)
+	{
+		if (p.x() < treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin())
+		{
+			e->ignore();
+			e->acceptAction(false);
+		}
+		else
+		{
+			if(item->getType() == TeQtCheckListItem::THEME || item->getType() == TeQtCheckListItem::VIEW)
+			{
+				e->accept();
+				e->acceptAction();
+			}
+			else
+			{
+				e->ignore();
+				e->acceptAction(false);
+				if(currentThemeItem_)
+				{
+					unselectAllItems();
+					currentThemeItem_->parent()->setSelected(true);
+					currentThemeItem_->parent()->repaint();
+					currentThemeItem_->setSelected(true);
+					repaint();
+				}
+			}
+		}
+    }
+	else
+	{
+		e->ignore();
+		e->acceptAction(false);
+	}
+}
+
+
+void TeQtViewsListView::contentsDropEvent(QDropEvent *e)
+{
+	if(e->source() != viewport())
+	{
+		e->ignore();
+		e->acceptAction(false);
+		pressedThemeItem_ = 0;
+		if(currentThemeItem_)
+		{
+			unselectAllItems();
+			currentThemeItem_->parent()->setSelected(true);
+			currentThemeItem_->parent()->repaint();
+			currentThemeItem_->setSelected(true);
+			repaint();
+		}
+		return;
+	}
+
+	int itemPriority;
+	TeQtThemeItem *themeItem;
+	bool viewChanged = false;
+
+    QPoint p = contentsToViewport(((QDragMoveEvent*)e)->pos());
+	TeQtCheckListItem *dropItem = (TeQtCheckListItem*)itemAt(p);
+
+	if (dropItem == 0)
+	{
+		e->ignore();
+		e->acceptAction(false);
+		pressedThemeItem_ = 0;
+		if(currentThemeItem_)
+		{
+			unselectAllItems();
+			currentThemeItem_->parent()->setSelected(true);
+			currentThemeItem_->parent()->repaint();
+			currentThemeItem_->setSelected(true);
+			repaint();
+		}
+		return;
+	}
+
+	if (dropItem == pressedThemeItem_)
+	{
+		e->ignore();
+		e->acceptAction(false);
+		pressedThemeItem_ = 0;
+		if(currentThemeItem_)
+		{
+			unselectAllItems();
+			currentThemeItem_->parent()->setSelected(true);
+			currentThemeItem_->parent()->repaint();
+			currentThemeItem_->setSelected(true);
+			repaint();
+		}
+		return;
+	}
+
+	e->accept();
+	e->acceptAction();
+
+	//Set the view item of the pressed item and the drop item
+	TeQtViewItem *pressedViewItem = (TeQtViewItem*)pressedThemeItem_->parent();
+	TeQtViewItem *dropViewItem;
+	if(dropItem->getType() == TeQtCheckListItem::THEME)
+		dropViewItem = (TeQtViewItem*)dropItem->parent();
+	else
+		dropViewItem = (TeQtViewItem*)dropItem;
+
+	//set a flag to indicate whether there was a view change
+	if (pressedViewItem != dropViewItem)
+		viewChanged = true;
+
+	//update the priorities and move the items accordingly
+	if (viewChanged)
+	{
+		vector<QListViewItem*> themeItemVector = dropViewItem->getChildren();
+		for (unsigned int i = 0; i < themeItemVector.size(); ++i)
+		{
+			themeItem = (TeQtThemeItem*)themeItemVector[i];
+			if(pressedThemeItem_->text(0) == themeItem->text(0))
+			{
+				emit dragDropItems(0, 0, 0);
+				pressedThemeItem_ = 0;
+				return;
+			}
+		}
+
+		if (dropItem->getType() == TeQtCheckListItem::THEME)
+		{
+			TeQtThemeItem *dropThemeItem = (TeQtThemeItem*)dropItem;
+			itemPriority = dropThemeItem->order();
+			pressedThemeItem_->order(itemPriority);
+			themeItem = dropThemeItem;
+		}
+		else
+		{
+			itemPriority = 0;
+			pressedThemeItem_->order(itemPriority);
+			themeItem = (TeQtThemeItem*)dropViewItem->firstChild();
+		}
+
+		while (themeItem)
+		{
+			themeItem->order(++itemPriority);
+			themeItem = (TeQtThemeItem*)themeItem->nextSibling();
+		}
+		pressedViewItem->takeItem(pressedThemeItem_);
+		dropViewItem->insertItem(pressedThemeItem_);
+	}
+	else
+	{
+		if (dropItem->getType() == TeQtCheckListItem::THEME)
+		{
+			TeQtThemeItem *dropThemeItem = (TeQtThemeItem*)dropItem;
+			int pressedItemPriority = pressedThemeItem_->order();
+			int droppedItemPriority = dropThemeItem->order();
+			if (pressedItemPriority < droppedItemPriority)
+			{
+				itemPriority = pressedItemPriority;
+				pressedThemeItem_->order(droppedItemPriority);
+				themeItem = (TeQtThemeItem*)pressedThemeItem_->nextSibling();
+				while (themeItem != dropThemeItem)
+				{
+					themeItem->order(itemPriority++);
+					themeItem = (TeQtThemeItem*)themeItem->nextSibling();
+				}
+				dropThemeItem->order(itemPriority);
+			}
+			else
+			{
+				itemPriority = droppedItemPriority;
+				pressedThemeItem_->order(itemPriority);
+				themeItem = (TeQtThemeItem*)dropThemeItem;
+
+				while (themeItem != pressedThemeItem_)
+				{
+					themeItem->order(++itemPriority);
+					themeItem = (TeQtThemeItem*)themeItem->nextSibling();
+				}
+			}
+			pressedThemeItem_->moveItem(dropThemeItem);
+		}
+		else
+		{
+			itemPriority = 0;
+			pressedThemeItem_->order(itemPriority);
+			themeItem = (TeQtThemeItem*)dropItem->firstChild();
+			while (themeItem != pressedThemeItem_)
+			{
+				themeItem->order(++itemPriority);
+				themeItem = (TeQtThemeItem*)themeItem->nextSibling();
+			}
+			pressedViewItem->takeItem(pressedThemeItem_);
+			pressedViewItem->insertItem(pressedThemeItem_);
+			dropViewItem->setOpen(true);
+		}
+	}
+
+	if (pressedViewItem != dropViewItem)
+	{
+		// the drag and drop theme items belong to different views
+		if (pressedThemeItem_ == currentThemeItem_)
+		{
+			currentViewItem_ = dropViewItem;
+			clicked(pressedThemeItem_);
+		}
+	}
+
+//	emit dragDropItems(pressedViewItem, dropViewItem);
+	emit dragDropItems(pressedThemeItem_, pressedViewItem, dropViewItem);
+	pressedThemeItem_->setOpen(themeOpen_);
+
+	pressedThemeItem_ = 0;
+
+	if(currentThemeItem_)
+	{
+		unselectAllItems();
+		currentThemeItem_->parent()->setSelected(true);
+		currentThemeItem_->parent()->repaint();
+		currentThemeItem_->setSelected(true);
+		repaint();
+	}
+}
+
+vector<TeQtViewItem*> TeQtViewsListView::getViewItemVec()
+{
+	vector<TeQtViewItem*> viewItemVec;
+
+	TeQtCheckListItem*	checkListItem;
+	TeQtViewItem*		viewItem;
+
+	QListViewItemIterator it(this);
+	while(it.current())
+	{
+		checkListItem = (TeQtCheckListItem*)it.current();
+		if (checkListItem->getType() == TeQtCheckListItem::VIEW)
+		{
+			viewItem = (TeQtViewItem*)it.current();
+			viewItemVec.push_back(viewItem);
+		}
+		++it;
+	}
+
+	return viewItemVec;
+}
+
+vector<TeQtThemeItem*> TeQtViewsListView::getThemeItemVec()
+{
+	vector<TeQtThemeItem*> themeItemVec;
+
+	TeQtCheckListItem*	checkListItem;
+	TeQtThemeItem*		themeItem;
+
+	QListViewItemIterator it(this);
+	while(it.current())
+	{
+		checkListItem = (TeQtCheckListItem*)it.current();
+		if (checkListItem->getType() == TeQtCheckListItem::THEME)
+		{
+			themeItem = (TeQtThemeItem*)it.current();
+			themeItemVec.push_back(themeItem);
+		}
+		++it;
+	}
+
+	return themeItemVec;
+}
+
+
+
diff --git a/src/terralib/drivers/qt/TeQtViewsListView.h b/src/terralib/drivers/qt/TeQtViewsListView.h
old mode 100755
new mode 100644
index b19d451..c6b4dbc
--- a/src/terralib/drivers/qt/TeQtViewsListView.h
+++ b/src/terralib/drivers/qt/TeQtViewsListView.h
@@ -1,135 +1,140 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTVIEWSLISTVIEW_H
-#define  __TERRALIB_INTERNAL_QTVIEWSLISTVIEW_H
-
-#include <qlistview.h>
-#include <TeDataTypes.h>
-
-class QPopupMenu;
-class TeView;
-class TeQtThemeItem;
-class TeQtViewItem;
-class TeQtCheckListItem;
-class TeAppTheme;
-
-class TeQtViewsListView : public QListView
-{
-	Q_OBJECT
-
-public:
-
-    TeQtViewsListView(QWidget *parent = 0, const char *name = 0);
-
-	~TeQtViewsListView();
-
-	TeQtViewItem* currentViewItem() 
-	{ return currentViewItem_; }
-
-	TeQtThemeItem* currentThemeItem() 
-	{ return currentThemeItem_; }
-
-	TeQtCheckListItem *popupItem()
-		{ return popupItem_; }
-
-	QPopupMenu* getPopupMenu()
-		{ return popupMenu_; }
-
-	void selectItem(QListViewItem *item);
-
-	void selectViewItem(TeView *view);
-
-	TeQtViewItem* getViewItem(TeView *view);
-
-	TeQtViewItem* getViewItem(TeQtThemeItem* themeItem);
-
-	TeQtThemeItem* getThemeItem(TeAppTheme* appTheme);
-
-	TeQtThemeItem* getThemeItem(int themeId);
-
-	void removeViewItem(TeView *view);
-
-	void removeThemeItem(TeAppTheme* appTheme);
-
-	void removeThemeItem(int themeId);
-
-	void removeItem(QListViewItem *item);
-
-	void checkItemStateChanged(QCheckListItem*, bool);
-
-	void setOpenViewItem(QCheckListItem *checkListItem, bool visible)
-		{ setOpen(checkListItem, visible); }
-
-	void openViewItems();
-
-	void reset();
-
-	void setOn(QCheckListItem*, bool);
-
-	vector<TeQtViewItem*> getViewItemVec();
-
-	vector<TeQtThemeItem*> getThemeItemVec();
-
-	map<TePolyBasicType, Qt::BrushStyle>& getBrushStyleMap() {return brushStyleMap_;}
-	map<TeLnBasicType, Qt::PenStyle>& getPenStyleMap() {return penStyleMap_;}
-
-signals:
-	void itemChanged(QListViewItem*);
-	void popupSignal();
-	void checkListItemVisChanged(QCheckListItem*, bool);
-	void dragDropItems(TeQtThemeItem*, TeQtViewItem*, TeQtViewItem*);
-
-protected slots:
-	void clicked(QListViewItem *item);
-	void contextMenuRequested(QListViewItem*, const QPoint&, int);
-
-protected:
-	TeQtViewItem		*currentViewItem_;
-	TeQtThemeItem		*currentThemeItem_;
-	bool				rightMouseWasClicked_;
-	bool				checkItemStateChanged_;
-	bool				drag_;
-	bool				themeOpen_;
-	bool				leftButtonPressed_;
-	QPoint				pressedPosition_;
-	TeQtCheckListItem*	popupItem_;
-	QPopupMenu*			popupMenu_;
-	map<TePolyBasicType, Qt::BrushStyle>	brushStyleMap_;
-	map<TeLnBasicType, Qt::PenStyle>		penStyleMap_;
-	TeQtThemeItem		*pressedThemeItem_;
-	TeQtCheckListItem	*refThemeItemForVis_;  //reference theme item for visibility of another one
-
-	void contentsMousePressEvent(QMouseEvent *e);
-
-	void contentsMouseReleaseEvent(QMouseEvent *e);
-
-	void contentsMouseMoveEvent(QMouseEvent* e);
-
-	void contentsDragMoveEvent(QDragMoveEvent *e);
-
-	void contentsDropEvent(QDropEvent *e);
-
-	void unselectAllItems();
-};
-
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_QTVIEWSLISTVIEW_H
+#define  __TERRALIB_INTERNAL_QTVIEWSLISTVIEW_H
+
+#include <qlistview.h>
+#include <TeDataTypes.h>
+
+#include <TeAppUtilsDefines.h>
+
+class QPopupMenu;
+class TeView;
+class TeQtThemeItem;
+class TeQtViewItem;
+class TeQtCheckListItem;
+class TeAppTheme;
+
+class TLAPPUTILS_DLL TeQtViewsListView : public QListView
+{
+	Q_OBJECT
+
+public:
+
+    TeQtViewsListView(QWidget *parent = 0, const char *name = 0);
+
+	~TeQtViewsListView();
+
+	TeQtViewItem* currentViewItem() 
+	{ return currentViewItem_; }
+
+	TeQtThemeItem* currentThemeItem() 
+	{ return currentThemeItem_; }
+
+	TeQtCheckListItem *popupItem()
+		{ return popupItem_; }
+
+    void setPopupItem(TeQtCheckListItem* item)
+        { popupItem_ = item; }
+
+	QPopupMenu* getPopupMenu()
+		{ return popupMenu_; }
+
+	void selectItem(QListViewItem *item);
+
+	void selectViewItem(TeView *view);
+
+	TeQtViewItem* getViewItem(TeView *view);
+
+	TeQtViewItem* getViewItem(TeQtThemeItem* themeItem);
+
+	TeQtThemeItem* getThemeItem(TeAppTheme* appTheme);
+
+	TeQtThemeItem* getThemeItem(int themeId);
+
+	void removeViewItem(TeView *view);
+
+	void removeThemeItem(TeAppTheme* appTheme);
+
+	void removeThemeItem(int themeId);
+
+	void removeItem(QListViewItem *item);
+
+	void checkItemStateChanged(QCheckListItem*, bool);
+
+	void setOpenViewItem(QCheckListItem *checkListItem, bool visible)
+		{ setOpen(checkListItem, visible); }
+
+	void openViewItems();
+
+	void reset();
+
+	void setOn(QCheckListItem*, bool);
+
+	vector<TeQtViewItem*> getViewItemVec();
+
+	vector<TeQtThemeItem*> getThemeItemVec();
+
+	map<TePolyBasicType, Qt::BrushStyle>& getBrushStyleMap() {return brushStyleMap_;}
+	map<TeLnBasicType, Qt::PenStyle>& getPenStyleMap() {return penStyleMap_;}
+
+signals:
+	void itemChanged(QListViewItem*);
+	void popupSignal();
+	void checkListItemVisChanged(QCheckListItem*, bool);
+	void dragDropItems(TeQtThemeItem*, TeQtViewItem*, TeQtViewItem*);
+
+protected slots:
+	void clicked(QListViewItem *item);
+	void contextMenuRequested(QListViewItem*, const QPoint&, int);
+
+protected:
+	TeQtViewItem		*currentViewItem_;
+	TeQtThemeItem		*currentThemeItem_;
+	bool				rightMouseWasClicked_;
+	bool				checkItemStateChanged_;
+	bool				drag_;
+	bool				themeOpen_;
+	bool				leftButtonPressed_;
+	QPoint				pressedPosition_;
+	TeQtCheckListItem*	popupItem_;
+	QPopupMenu*			popupMenu_;
+	map<TePolyBasicType, Qt::BrushStyle>	brushStyleMap_;
+	map<TeLnBasicType, Qt::PenStyle>		penStyleMap_;
+	TeQtThemeItem		*pressedThemeItem_;
+	TeQtCheckListItem	*refThemeItemForVis_;  //reference theme item for visibility of another one
+
+	void contentsMousePressEvent(QMouseEvent *e);
+
+	void contentsMouseReleaseEvent(QMouseEvent *e);
+
+	void contentsMouseMoveEvent(QMouseEvent* e);
+
+	void contentsDragMoveEvent(QDragMoveEvent *e);
+
+	void contentsDropEvent(QDropEvent *e);
+
+	void unselectAllItems();
+};
+
+
+#endif
diff --git a/src/terralib/drivers/qt/TeQtViewsListViewFCT.cpp b/src/terralib/drivers/qt/TeQtViewsListViewFCT.cpp
deleted file mode 100755
index 57f65e1..0000000
--- a/src/terralib/drivers/qt/TeQtViewsListViewFCT.cpp
+++ /dev/null
@@ -1,885 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include "TeQtViewsListViewFCT.h"
-#include "TeQtCheckListItem.h"
-#include "TeQtViewItemFCT.h"
-#include "TeQtThemeItemFCT.h"
-#include "TeWaitCursor.h"
-#include <qapplication.h>
-#include <qpopupmenu.h>
-#include <qdragobject.h>
-#include <list>
-
-#include "TeView.h"
-
-TeQtViewsListView::TeQtViewsListView(QWidget *parent, const char *name)
-		: QListView(parent, name)
-{
-	pressedThemeItem_ = 0;
-	currentViewItem_ = 0;
-	currentThemeItem_ = 0;
-	refThemeItemForVis_ = 0;
-	rightMouseWasClicked_ = false;
-	checkItemStateChanged_ = false;
-	leftButtonPressed_ = false;
-	drag_ = false;
-
-	setSelectionMode(QListView::Multi);
-    setRootIsDecorated( TRUE );
-//	setAcceptDrops(true);
-	viewport()->setAcceptDrops(true);
-
-	popupView_ = new QPopupMenu(this);
-	popupTheme_ = new QPopupMenu(this);
-	popupLegendTitle_ = new QPopupMenu(this);
-	popupLegend_ = new QPopupMenu(this);
-	popupChartTitle_ = new QPopupMenu(this);
-	popupChart_ = new QPopupMenu(this);
-	popupOutItem_ = new QPopupMenu(this);
-
-	//Mounting the brushStyleMap
-	brushStyleMap_[TePolyTypeTransparent] = Qt::NoBrush;
-	brushStyleMap_[TePolyTypeFill] = Qt::SolidPattern;
-	brushStyleMap_[TePolyTypeHorizontal] = Qt::HorPattern;
-	brushStyleMap_[TePolyTypeVertical] = Qt::VerPattern;
-	brushStyleMap_[TePolyTypeFDiagonal] = Qt::FDiagPattern;
-	brushStyleMap_[TePolyTypeBDiagonal] = Qt::BDiagPattern;
-	brushStyleMap_[TePolyTypeCross] = Qt::CrossPattern;
-	brushStyleMap_[TePolyTypeDiagonalCross] = Qt::DiagCrossPattern;
-
-	//Mounting the penStyleMap
-	penStyleMap_[TeLnTypeContinuous] = Qt::SolidLine;
-	penStyleMap_[TeLnTypeDashed] = Qt::DashLine;
-	penStyleMap_[TeLnTypeDotted] = Qt::DotLine;
-	penStyleMap_[TeLnTypeDashDot] = Qt::DashDotLine;
-	penStyleMap_[TeLnTypeDashDotDot] = Qt::DashDotDotLine;
-	penStyleMap_[TeLnTypeNone] = Qt::NoPen;
-
-	// rename action
-	setDefaultRenameAction(QListView::Accept);
-
-	connect(this,SIGNAL(clicked(QListViewItem*)),
-			this,SLOT(clicked(QListViewItem*)));
-	connect(this,SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&, int)),
-		    this,SLOT(contextMenuRequested(QListViewItem*,const QPoint&, int)));
-}
-
-
-TeQtViewsListView::~TeQtViewsListView()
-{
-	if (popupView_)
-		delete popupView_;
-	if (popupTheme_)
-		delete popupTheme_;
-	if (popupLegendTitle_)
-		delete popupLegendTitle_;
-	if (popupLegend_)
-		delete popupLegend_;
-	if (popupChartTitle_)
-		delete popupChartTitle_;
-	if (popupChart_)
-		delete popupChart_;
-	if (popupOutItem_)
-		delete popupOutItem_;
-}
-
-
-void TeQtViewsListView::selectItem(QListViewItem *item)
-{
-	checkItemStateChanged_ = false;
-	clicked(item);
-}
-
-
-void TeQtViewsListView::selectViewItem(TeView *view)
-{
-	if (view == 0)
-		return;
-
-	QListViewItem *child = firstChild();
-    while (child)
-	{
-		TeQtViewItem *viewItem = (TeQtViewItem*)child;
-		if (viewItem->getView() == view)
-		{
-			if (viewItem == currentViewItem_)
-				break;
-			else
-			{
-				unselectAllItems();
-				child->setSelected(true);
-				child->repaint();
-				currentViewItem_ = viewItem;
-				currentThemeItem_ = 0;
-				emit itemChanged(child);
-				return;
-			}
-		}
-        child = child->nextSibling();
-	}
-}
-
-
-TeQtViewItem* TeQtViewsListView::getViewItem(TeView *view)
-{
-	if (view == 0)
-		return 0;
-
-	QListViewItem *child = firstChild();
-    while (child)
-	{
-		TeQtViewItem *viewItem = (TeQtViewItem*)child;
-		if (viewItem->getView() == view)
-			return viewItem;
-		else
-			child = child->nextSibling();
-	}
-	return 0;
-}
-
-
-TeQtThemeItem* TeQtViewsListView::getThemeItem(TeTheme *theme)
-{
-	if (theme == 0)
-		return 0;
-
-	QListViewItem *item;
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
-			if (themeItem->getTheme()->id() == theme->id())
-					return themeItem;
-		}
-		it++;
-		item = it.current();
-	}
-	return 0;
-}
-
-
-TeQtThemeItem* TeQtViewsListView::getThemeItem(const int& themeId)
-{
-	QListViewItem *item;
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
-			if (themeItem->getTheme()->id() == themeId)
-					return themeItem;
-		}
-		it++;
-		item = it.current();
-	}
-	return 0;
-}
-
-TeQtViewItem* TeQtViewsListView::getViewItem(const int& viewId) 
-{
-	QListViewItem *item;
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-        if (checkListItem->getType() == TeQtCheckListItem::VIEW)
-		{
-			TeQtViewItem* viewItem = (TeQtViewItem*)item;
-            if (viewItem->getView()->id() == viewId)
-            {
-				return viewItem;
-            }
-		}
-		it++;
-		item = it.current();
-	}
-
-    item = NULL;
-	return 0;
-}
-
-
-void TeQtViewsListView::removeViewItem(TeView *view)
-{
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::VIEW)
-		{
-			TeQtViewItem* viewItem = (TeQtViewItem*)item;
-			if (viewItem->getView() == view)
-			{
-				if (viewItem == currentViewItem_)
-					currentViewItem_ = 0;
-				removeItem(item);
-				break;
-			}
-		}
-		it++;
-		item = it.current();
-	}	
-}
-
-
-void TeQtViewsListView::removeThemeItem(TeTheme *theme)
-{
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-		if (checkListItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
-			if (themeItem->getTheme() == theme)
-			{
-				if (themeItem == currentThemeItem_)
-					currentThemeItem_ = 0;
-				removeItem(item);
-				break;
-			}
-		}
-		it++;
-		item = it.current();
-	}	
-}
-
-
-void TeQtViewsListView::removeItem(QListViewItem *item)
-{
-	if (item == 0)
-		return;
-
-	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-
-	if(checkListItem->getType() == TeQtCheckListItem::VIEW)
-	{
-		TeQtViewItem* viewItem = (TeQtViewItem*)item;
-
-		vector<QListViewItem*> childrenVector;
-		childrenVector = viewItem->getChildren();
-
-		int i;
-		TeQtThemeItem *themeItem;
-		for (i = 0; i < (int)childrenVector.size(); ++i)
-		{
-			themeItem = (TeQtThemeItem*)childrenVector[i];
-			delete themeItem;
-		}
-
-		if (currentViewItem_ == viewItem)
-		{
-			currentViewItem_ = 0;
-			currentThemeItem_ = 0;
-		}
-		delete viewItem;
-	}
-	else if (checkListItem->getType() == TeQtCheckListItem::THEME)
-	{
-		TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
-		if (currentThemeItem_ == themeItem)
-			currentThemeItem_ = 0;
-		delete themeItem;
-	}
-	else
-		delete item;
-}
-
-
-void TeQtViewsListView::checkItemStateChanged(QCheckListItem *checkListItem, bool visible)
-{
-	checkItemStateChanged_ = true;
-	emit checkListItemVisChanged(checkListItem, visible);
-}
-
-
-void TeQtViewsListView::openViewItems()
-{
-	QListViewItem *child = firstChild();
-	while (child)
-	{
-		setOpen(child, true);
-		child = child->nextSibling();
-	}
-}
-
-
-void TeQtViewsListView::reset()
-{
-	unselectAllItems();
-	currentViewItem_ = 0;
-	currentThemeItem_ = 0;
-}
-
-
-void TeQtViewsListView::setOn(QCheckListItem *item, bool visible)
-{
-	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-	if (checkListItem->getType() == TeQtCheckListItem::THEME)
-	{
-		TeQtThemeItem *themeItem = (TeQtThemeItem*)item;
-		themeItem->setOn(visible);
-		checkItemStateChanged_ = false;
-		emit checkListItemVisChanged(checkListItem, visible);
-	}
-}
-
-
-void TeQtViewsListView::clicked(QListViewItem *item)
-{
-	if(item == 0)
-		return;
-	if(drag_ && pressedThemeItem_)
-		return;
-
-	unselectAllItems();
-
-	TeQtCheckListItem *checkListItem = (TeQtCheckListItem*)item;
-
-	if(	checkItemStateChanged_ && (checkListItem->getType() == TeQtCheckListItem::THEME))
-	{
-		checkItemStateChanged_ = false;
-		if(currentThemeItem_)
-		{
-			currentThemeItem_->parent()->setSelected(true);
-			currentThemeItem_->parent()->repaint();
-			currentThemeItem_->setSelected(true);
-			currentThemeItem_->repaint();
-			return;
-		}
-	}
-
-	if(checkListItem->getType() != TeQtCheckListItem::THEME)
-	{
-		if (rightMouseWasClicked_ == true || checkItemStateChanged_ == true ||
-			drag_ == true || checkListItem->getType() == TeQtCheckListItem::LEGEND ||
-			checkListItem->getType() == TeQtCheckListItem::CHART)
-		{
-			if (checkListItem->getType() == TeQtCheckListItem::LEGEND ||
-				checkListItem->getType() == TeQtCheckListItem::CHART)
-			{
-				checkListItem->setSelected(false);
-				checkListItem->repaint();
-			}
-
-			if (currentViewItem_ != 0)
-			{
-				currentViewItem_->setSelected(true);
-				currentViewItem_->repaint();
-			}
-
-			if (currentThemeItem_ != 0)
-			{
-				currentThemeItem_->setSelected(true);
-				currentThemeItem_->repaint();
-			}
-			rightMouseWasClicked_ = false;
-			checkItemStateChanged_ = false;
-			return;
-		}
-	}
-
-	if (checkListItem->getType() == TeQtCheckListItem::VIEW)
-	{
-		item->setSelected(true);
-		item->repaint();
-
-		TeQtViewItem *viewItem = (TeQtViewItem*)item;
-		if (viewItem != currentViewItem_)
-		{
-			currentViewItem_ = viewItem;
-			currentThemeItem_ = 0;
-			emit itemChanged(item);
-		}
-		else
-		{
-			if (currentThemeItem_ != 0)
-			{
-				currentThemeItem_->setSelected(true);
-				currentThemeItem_->repaint();
-			}
-		}
-	}
-	else if(checkListItem->getType() == TeQtCheckListItem::THEME)
-	{
-		item->parent()->setSelected(true);
-		item->parent()->repaint();
-		item->setSelected(true);
-		item->repaint();
-
-		TeQtViewItem *viewItem = (TeQtViewItem*)item->parent();
-		if (currentViewItem_ != viewItem && rightMouseWasClicked_ == false)
-		{
-			currentViewItem_ = viewItem;
-			emit itemChanged(item->parent());
-		}
-
-		TeQtThemeItem* themeItem = (TeQtThemeItem*)item;
-		if (themeItem != currentThemeItem_ && rightMouseWasClicked_ == false)
-		{
-			currentThemeItem_ = themeItem;
-			emit itemChanged(item);
-		}
-	}
-	rightMouseWasClicked_ = false;
-	checkItemStateChanged_ = false;
-}
-
-
-void TeQtViewsListView::contextMenuRequested(QListViewItem *item, const QPoint&, int)
-{
-	popupItem_ = (TeQtCheckListItem*)item;
-
-	unselectAllItems();
-	if (currentViewItem_)
-	{
-		currentViewItem_->setSelected(true);
-		currentViewItem_->repaint();
-	}
-
-	if (currentThemeItem_)
-	{
-		currentThemeItem_->setSelected(true);
-		currentThemeItem_->repaint();
-	}
-
-	emit popupSignal();	
-}
-
-void TeQtViewsListView::contentsMousePressEvent(QMouseEvent *e)
-{
-	rightMouseWasClicked_ = false;;
-	if (e->button() == RightButton)
-	{
-		rightMouseWasClicked_ = true;
-		popupView_->move(e->globalPos().x(), e->globalPos().y());
-		popupTheme_->move(e->globalPos().x(), e->globalPos().y());
-		popupLegendTitle_->move(e->globalPos().x(), e->globalPos().y());
-		popupLegend_->move(e->globalPos().x(), e->globalPos().y());
-		popupChartTitle_->move(e->globalPos().x(), e->globalPos().y());
-		popupChart_->move(e->globalPos().x(), e->globalPos().y());
-		popupOutItem_->move(e->globalPos().x(), e->globalPos().y());
-	}
-	else if (e->button() == LeftButton)
-	{
-		QPoint p( contentsToViewport( e->pos() ) );
-		pressedPosition_ = p;
-		TeQtCheckListItem *item = (TeQtCheckListItem*)itemAt(p);
-		if (item != 0)
-		{
-			if(item->getType() == TeQtCheckListItem::THEME)
-			{
-				// don�t drag, if the user clicked into the root decoration of the item
-				int x = p.x();
-				int len = treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin();
-				if (x > len)
-//				if (p.x() > treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin())
-				{
-					pressedThemeItem_ = (TeQtThemeItem*)item;
-					themeOpen_ = isOpen(item);
-				}
-	
-				// Item was pressed inside the visibility box
-				if (x > len && x < len + 10)
-				{
-					if (e->state() & Qt::ShiftButton)
-					{
-						if (refThemeItemForVis_ == 0)
-							refThemeItemForVis_ = (TeQtThemeItem*)item;
-						else
-						{
-							TeQtThemeItem *themeItem = (TeQtThemeItem*)item;
-							if ((themeItem == refThemeItemForVis_) ||
-								(themeItem->parent() != refThemeItemForVis_->parent()))
-								return;
-
-							list<TeQtCheckListItem*> themeItemList;
-							list<TeQtCheckListItem*>::iterator it;
-							// find if the item pressed is below the reference item
-							TeQtCheckListItem *itemBelow = (TeQtCheckListItem*)refThemeItemForVis_->itemBelow();
-							while((itemBelow != 0) && (itemBelow->getType() == TeQtCheckListItem::THEME))
-							{
-								themeItemList.push_back(itemBelow);
-								if (itemBelow == themeItem)
-								{
-									for (it = themeItemList.begin(); it != themeItemList.end(); ++it)
-									{
-										TeQtCheckListItem *thItem = *it;
-										bool visible = refThemeItemForVis_->isOn();
-										setOn(thItem, visible);
-									}
-									refThemeItemForVis_ = 0;
-									return;
-								}
-								itemBelow = (TeQtCheckListItem*)itemBelow->itemBelow();
-							}
-
-							// find if the item pressed is above the reference item
-							themeItemList.clear();
-							TeQtCheckListItem *itemAbove = (TeQtCheckListItem*)refThemeItemForVis_->itemAbove();
-							while((itemAbove != 0) && (itemAbove->getType() == TeQtCheckListItem::THEME))
-							{
-								themeItemList.push_back(itemAbove);
-								if (itemAbove == themeItem)
-								{
-									for (it = themeItemList.begin(); it != themeItemList.end(); ++it)
-									{
-										TeQtCheckListItem* thItem = *it;
-										bool visible = refThemeItemForVis_->isOn();
-										setOn(thItem, visible);
-									}
-									refThemeItemForVis_ = 0;
-									return;
-								}
-								itemAbove = (TeQtCheckListItem*)itemAbove->itemAbove();
-							}
-						}
-					}
-					else
-						refThemeItemForVis_ = 0;
-				}
-			}
-			else
-			{
-				item->setSelected(false);
-				item->repaint();
-				pressedThemeItem_ = 0;
-			}
-			leftButtonPressed_ = true;
-		}
-	}
-
-	QListView::contentsMousePressEvent(e);
-}
-
-
-void TeQtViewsListView::contentsMouseReleaseEvent(QMouseEvent *e)
-{
-	leftButtonPressed_ = false;
-	QListView::contentsMouseReleaseEvent(e);
-
-	if(currentThemeItem_)
-	{
-		unselectAllItems();
-		currentThemeItem_->parent()->setSelected(true);
-		currentThemeItem_->parent()->repaint();
-		currentThemeItem_->setSelected(true);
-		repaint();
-	}
-	drag_ = false;
-}
-
-
-void TeQtViewsListView::unselectAllItems()
-{
-	QListViewItem *item;
-
-	QListViewItemIterator it(this);
-	item = it.current();
-	while(item)
-	{
-		setSelected(item,false);
-		item->repaint();
-		it++;
-		item = it.current();
-	}
-}
-
-
-void TeQtViewsListView::contentsMouseMoveEvent(QMouseEvent* e)
-{
-	QPoint p( contentsToViewport( e->pos() ) );
-    if (leftButtonPressed_)
-	{
-		QPoint pdif = pressedPosition_ - p;
-		if(abs(pdif.x()) > 2 || abs(pdif.y()) > 2)
-		{
-			drag_ = true;
-			leftButtonPressed_ = false;
-			if(pressedThemeItem_)
-			{
-				TeQtCheckListItem *item = (TeQtCheckListItem*)itemAt(p);
-				if (item && item->getType() == TeQtCheckListItem::THEME)
-				{
-	//				clicked(item);
-					QUriDrag* ud = new QUriDrag(viewport());
-					ud->drag();
-				}
-			}
-		}
-    }
-	if(drag_ && pressedThemeItem_)
-		pressedThemeItem_->setOpen(themeOpen_);
-}
-
-
-void TeQtViewsListView::contentsDragMoveEvent(QDragMoveEvent *e)
-{
-	if(pressedThemeItem_)
-		pressedThemeItem_->setOpen(themeOpen_);
-
-	if(e->source() != viewport())
-	{
-		e->ignore();
-		e->acceptAction(false);
-		return;
-	}
-
-    QPoint p = contentsToViewport(((QDragMoveEvent*)e)->pos());
-    TeQtCheckListItem *item = (TeQtCheckListItem*)itemAt(p);
-    if (item)
-	{
-		if (p.x() < treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin())
-		{
-			e->ignore();
-			e->acceptAction(false);
-		}
-		else
-		{
-			if(item->getType() == TeQtCheckListItem::THEME || item->getType() == TeQtCheckListItem::VIEW)
-			{
-				e->accept();
-				e->acceptAction();
-			}
-			else
-			{
-				e->ignore();
-				e->acceptAction(false);
-				if(currentThemeItem_)
-				{
-					unselectAllItems();
-					currentThemeItem_->parent()->setSelected(true);
-					currentThemeItem_->parent()->repaint();
-					currentThemeItem_->setSelected(true);
-					repaint();
-				}
-			}
-		}
-    }
-	else
-	{
-		e->ignore();
-		e->acceptAction(false);
-	}
-}
-
-
-void TeQtViewsListView::contentsDropEvent(QDropEvent *e)
-{
-	if(e->source() != viewport())
-	{
-		e->ignore();
-		e->acceptAction(false);
-		pressedThemeItem_ = 0;
-		if(currentThemeItem_)
-		{
-			unselectAllItems();
-			currentThemeItem_->parent()->setSelected(true);
-			currentThemeItem_->parent()->repaint();
-			currentThemeItem_->setSelected(true);
-			repaint();
-		}
-		return;
-	}
-
-	int itemPriority;
-	TeQtThemeItem *themeItem;
-	bool viewChanged = false;
-
-    QPoint p = contentsToViewport(((QDragMoveEvent*)e)->pos());
-	TeQtCheckListItem *dropItem = (TeQtCheckListItem*)itemAt(p);
-
-	if (dropItem == 0)
-	{
-		e->ignore();
-		e->acceptAction(false);
-		pressedThemeItem_ = 0;
-		if(currentThemeItem_)
-		{
-			unselectAllItems();
-			currentThemeItem_->parent()->setSelected(true);
-			currentThemeItem_->parent()->repaint();
-			currentThemeItem_->setSelected(true);
-			repaint();
-		}
-		return;
-	}
-
-	if (dropItem == pressedThemeItem_)
-	{
-		e->ignore();
-		e->acceptAction(false);
-		pressedThemeItem_ = 0;
-		if(currentThemeItem_)
-		{
-			unselectAllItems();
-			currentThemeItem_->parent()->setSelected(true);
-			currentThemeItem_->parent()->repaint();
-			currentThemeItem_->setSelected(true);
-			repaint();
-		}
-		return;
-	}
-
-	e->accept();
-	e->acceptAction();
-
-	//Set the view item of the pressed item and the drop item
-	TeQtViewItem *pressedViewItem = (TeQtViewItem*)pressedThemeItem_->parent();
-	TeQtViewItem *dropViewItem;
-	if(dropItem->getType() == TeQtCheckListItem::THEME)
-		dropViewItem = (TeQtViewItem*)dropItem->parent();
-	else
-		dropViewItem = (TeQtViewItem*)dropItem;
-
-	//set a flag to indicate whether there was a view change
-	if (pressedViewItem != dropViewItem)
-		viewChanged = true;
-
-	//update the priorities and move the items accordingly
-	if (viewChanged)
-	{
-		vector<QListViewItem*> themeItemVector = dropViewItem->getChildren();
-		for (unsigned int i = 0; i < themeItemVector.size(); ++i)
-		{
-			themeItem = (TeQtThemeItem*)themeItemVector[i];
-			if(pressedThemeItem_->text(0) == themeItem->text(0))
-			{
-				emit dragDropItems(0, 0, 0);
-				pressedThemeItem_ = 0;
-				return;
-			}
-		}
-
-		if (dropItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem *dropThemeItem = (TeQtThemeItem*)dropItem;
-			itemPriority = dropThemeItem->order();
-			pressedThemeItem_->order(itemPriority);
-			themeItem = dropThemeItem;
-		}
-		else
-		{
-			itemPriority = 0;
-			pressedThemeItem_->order(itemPriority);
-			themeItem = (TeQtThemeItem*)dropViewItem->firstChild();
-		}
-
-		while (themeItem)
-		{
-			themeItem->order(++itemPriority);
-			themeItem = (TeQtThemeItem*)themeItem->nextSibling();
-		}
-		pressedViewItem->takeItem(pressedThemeItem_);
-		dropViewItem->insertItem(pressedThemeItem_);
-	}
-	else
-	{
-		if (dropItem->getType() == TeQtCheckListItem::THEME)
-		{
-			TeQtThemeItem *dropThemeItem = (TeQtThemeItem*)dropItem;
-			int pressedItemPriority = pressedThemeItem_->order();
-			int droppedItemPriority = dropThemeItem->order();
-			if (pressedItemPriority < droppedItemPriority)
-			{
-				itemPriority = pressedItemPriority;
-				pressedThemeItem_->order(droppedItemPriority);
-				themeItem = (TeQtThemeItem*)pressedThemeItem_->nextSibling();
-				while (themeItem != dropThemeItem)
-				{
-					themeItem->order(itemPriority++);
-					themeItem = (TeQtThemeItem*)themeItem->nextSibling();
-				}
-				dropThemeItem->order(itemPriority);
-			}
-			else
-			{
-				itemPriority = droppedItemPriority;
-				pressedThemeItem_->order(itemPriority);
-				themeItem = (TeQtThemeItem*)dropThemeItem;
-
-				while (themeItem != pressedThemeItem_)
-				{
-					themeItem->order(++itemPriority);
-					themeItem = (TeQtThemeItem*)themeItem->nextSibling();
-				}
-			}
-			pressedThemeItem_->moveItem(dropThemeItem);
-		}
-		else
-		{
-			itemPriority = 0;
-			pressedThemeItem_->order(itemPriority);
-			themeItem = (TeQtThemeItem*)dropItem->firstChild();
-			while (themeItem != pressedThemeItem_)
-			{
-				themeItem->order(++itemPriority);
-				themeItem = (TeQtThemeItem*)themeItem->nextSibling();
-			}
-			pressedViewItem->takeItem(pressedThemeItem_);
-			pressedViewItem->insertItem(pressedThemeItem_);
-			dropViewItem->setOpen(true);
-		}
-	}
-
-	if (pressedViewItem != dropViewItem)
-	{
-		// the drag and drop theme items belong to different views
-		if (pressedThemeItem_ == currentThemeItem_)
-		{
-			currentViewItem_ = dropViewItem;
-			clicked(pressedThemeItem_);
-		}
-	}
-
-//	emit dragDropItems(pressedViewItem, dropViewItem);
-	emit dragDropItems(pressedThemeItem_, pressedViewItem, dropViewItem);
-	pressedThemeItem_->setOpen(themeOpen_);
-
-	pressedThemeItem_ = 0;
-
-	if(currentThemeItem_)
-	{
-		unselectAllItems();
-		currentThemeItem_->parent()->setSelected(true);
-		currentThemeItem_->parent()->repaint();
-		currentThemeItem_->setSelected(true);
-		repaint();
-	}
-}
-
-
-
diff --git a/src/terralib/drivers/qt/TeQtViewsListViewFCT.h b/src/terralib/drivers/qt/TeQtViewsListViewFCT.h
deleted file mode 100755
index d14221f..0000000
--- a/src/terralib/drivers/qt/TeQtViewsListViewFCT.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_QTVIEWSLISTVIEW_H
-#define  __TERRALIB_INTERNAL_QTVIEWSLISTVIEW_H
-
-#include <qlistview.h>
-#include <TeDataTypes.h>
-#include "TeTheme.h"
-
-class QPopupMenu;
-class TeView;
-class TeQtThemeItem;
-class TeQtViewItem;
-class TeQtCheckListItem;
-//class TeTheme;
-
-class TeQtViewsListView : public QListView
-{
-	Q_OBJECT
-
-public:
-
-    TeQtViewsListView(QWidget *parent = 0, const char *name = 0);
-
-	~TeQtViewsListView();
-
-	TeQtViewItem* currentViewItem() 
-	{ return currentViewItem_; }
-
-	TeQtThemeItem* currentThemeItem() 
-	{ return currentThemeItem_; }
-
-	TeQtCheckListItem *popupItem()
-		{ return popupItem_; }
-
-	QPopupMenu* popupView()
-		{ return popupView_; }
-
-	QPopupMenu* popupTheme()
-		{ return popupTheme_; }
-
-	QPopupMenu* popupLegendTitle()
-		{ return popupLegendTitle_; }
-
-	QPopupMenu* popupLegend()
-		{ return popupLegend_; }
-
-	QPopupMenu* popupChartTitle()
-		{ return popupChartTitle_; }
-
-	QPopupMenu* popupChart()
-		{ return popupChart_; }
-
-	QPopupMenu* popupOutItem()
-		{ return popupOutItem_; }
-
-	void selectItem(QListViewItem *item);
-
-	void selectViewItem(TeView *view);
-
-	TeQtViewItem* getViewItem(TeView *view);
-
-	TeQtThemeItem* getThemeItem(TeTheme *theme);
-
-	TeQtThemeItem* getThemeItem(const int& themeId);
-
-	TeQtViewItem* getViewItem(const int& viewId);
-
-    void removeViewItem(TeView *view);
-
-	void removeThemeItem(TeTheme *theme);
-
-	void removeItem(QListViewItem *item);
-
-	void checkItemStateChanged(QCheckListItem*, bool);
-
-	void setOpenViewItem(QCheckListItem *checkListItem, bool visible)
-		{ setOpen(checkListItem, visible); }
-
-	void openViewItems();
-
-	void reset();
-
-	void setOn(QCheckListItem*, bool);
-
-	map<TePolyBasicType, Qt::BrushStyle>& getBrushStyleMap() {return brushStyleMap_;}
-	map<TeLnBasicType, Qt::PenStyle>& getPenStyleMap() {return penStyleMap_;}
-
-signals:
-	void itemChanged(QListViewItem*);
-	void popupSignal();
-	void checkListItemVisChanged(QCheckListItem*, bool);
-	void dragDropItems(TeQtThemeItem*, TeQtViewItem*, TeQtViewItem*);
-
-protected slots:
-	void clicked(QListViewItem *item);
-	void contextMenuRequested(QListViewItem*, const QPoint&, int);
-
-protected:
-	TeQtViewItem		*currentViewItem_;
-	TeQtThemeItem		*currentThemeItem_;
-	bool				rightMouseWasClicked_;
-	bool				checkItemStateChanged_;
-	bool				drag_;
-	bool				themeOpen_;
-	bool				leftButtonPressed_;
-	QPoint				pressedPosition_;
-	TeQtCheckListItem	*popupItem_;
-	QPopupMenu			*popupView_;
-	QPopupMenu			*popupTheme_;
-	QPopupMenu			*popupLegendTitle_;
-	QPopupMenu			*popupLegend_;
-	QPopupMenu			*popupChartTitle_;
-	QPopupMenu			*popupChart_;
-	QPopupMenu			*popupOutItem_;
-	map<TePolyBasicType, Qt::BrushStyle>	brushStyleMap_;
-	map<TeLnBasicType, Qt::PenStyle>		penStyleMap_;
-	TeQtThemeItem		*pressedThemeItem_;
-	TeQtCheckListItem	*refThemeItemForVis_;  //reference theme item for visibility of another one
-
-	void contentsMousePressEvent(QMouseEvent *e);
-
-	void contentsMouseReleaseEvent(QMouseEvent *e);
-
-	void contentsMouseMoveEvent(QMouseEvent* e);
-
-	void contentsDragMoveEvent(QDragMoveEvent *e);
-
-	void contentsDropEvent(QDropEvent *e);
-
-	void unselectAllItems();
-};
-
-
-#endif
diff --git a/src/terralib/drivers/qt/TeWaitCursor.cpp b/src/terralib/drivers/qt/TeWaitCursor.cpp
old mode 100755
new mode 100644
index ea8d896..5131993
--- a/src/terralib/drivers/qt/TeWaitCursor.cpp
+++ b/src/terralib/drivers/qt/TeWaitCursor.cpp
@@ -1,59 +1,59 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include "TeWaitCursor.h"
-#include <qapplication.h>
-
-TeWaitCursor::TeWaitCursor ()
-{
-	if(QApplication::overrideCursor())
-	{
-		if(QApplication::overrideCursor()->shape() != Qt::WaitCursor)
-			QApplication::setOverrideCursor( Qt::WaitCursor );
-	}
-	else
-		QApplication::setOverrideCursor( Qt::WaitCursor );
-}
-
-TeWaitCursor::~TeWaitCursor ()
-{
-	if(QApplication::overrideCursor())
-		QApplication::restoreOverrideCursor();
-}
-
-
-void TeWaitCursor::setWaitCursor ()
-{
-	if(QApplication::overrideCursor())
-	{
-		if(QApplication::overrideCursor()->shape() != Qt::WaitCursor)
-			QApplication::setOverrideCursor( Qt::WaitCursor );
-	}
-	else
-		QApplication::setOverrideCursor( Qt::WaitCursor );
-}
-
-void TeWaitCursor::resetWaitCursor ()
-{
-	if(QApplication::overrideCursor())
-		QApplication::restoreOverrideCursor();
-}
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include "TeWaitCursor.h"
+#include <qapplication.h>
+
+TeWaitCursor::TeWaitCursor ()
+{
+	if(QApplication::overrideCursor())
+	{
+		if(QApplication::overrideCursor()->shape() != Qt::WaitCursor)
+			QApplication::setOverrideCursor( Qt::WaitCursor );
+	}
+	else
+		QApplication::setOverrideCursor( Qt::WaitCursor );
+}
+
+TeWaitCursor::~TeWaitCursor ()
+{
+	if(QApplication::overrideCursor())
+		QApplication::restoreOverrideCursor();
+}
+
+
+void TeWaitCursor::setWaitCursor ()
+{
+	if(QApplication::overrideCursor())
+	{
+		if(QApplication::overrideCursor()->shape() != Qt::WaitCursor)
+			QApplication::setOverrideCursor( Qt::WaitCursor );
+	}
+	else
+		QApplication::setOverrideCursor( Qt::WaitCursor );
+}
+
+void TeWaitCursor::resetWaitCursor ()
+{
+	if(QApplication::overrideCursor())
+		QApplication::restoreOverrideCursor();
+}
+
diff --git a/src/terralib/drivers/qt/TeWaitCursor.h b/src/terralib/drivers/qt/TeWaitCursor.h
old mode 100755
new mode 100644
index c984ea5..8072287
--- a/src/terralib/drivers/qt/TeWaitCursor.h
+++ b/src/terralib/drivers/qt/TeWaitCursor.h
@@ -1,52 +1,54 @@
-/************************************************************************************
- TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeWaitCursor.h
-    \brief This file supports the definition of a waiting cursor using the Qt toolkit
-*/
-#ifndef  __TERRALIB_INTERNAL_WAITCURSOR_H
-#define  __TERRALIB_INTERNAL_WAITCURSOR_H
-
-#include <qcursor.h>
-
-/** @defgroup QtDriver Interfaces to Qt Toolkit
-	@ingroup Drivers
-	TerraLib routines build on top of Qt Toolkit
-	@{
-*/
-//! A waiting cursor
-class TeWaitCursor : public QCursor  {
-public: 
-	//! Constructor
-	TeWaitCursor();
-	
-	//! Destructor
-	~TeWaitCursor();
-
-	//! Instantiate a waiting cursor
-	void setWaitCursor();
-
-	//! Reset the waiting cursor
-	void resetWaitCursor();
-};
-/** @} */
-#endif
+/************************************************************************************
+ TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeWaitCursor.h
+    \brief This file supports the definition of a waiting cursor using the Qt toolkit
+*/
+#ifndef  __TERRALIB_INTERNAL_WAITCURSOR_H
+#define  __TERRALIB_INTERNAL_WAITCURSOR_H
+
+#include <TeAppUtilsDefines.h>
+
+#include <qcursor.h>
+
+/** @defgroup QtDriver Interfaces to Qt Toolkit
+	@ingroup Drivers
+	TerraLib routines build on top of Qt Toolkit
+	@{
+*/
+//! A waiting cursor
+class TLAPPUTILS_DLL TeWaitCursor : public QCursor  {
+public: 
+	//! Constructor
+	TeWaitCursor();
+	
+	//! Destructor
+	~TeWaitCursor();
+
+	//! Instantiate a waiting cursor
+	void setWaitCursor();
+
+	//! Reset the waiting cursor
+	void resetWaitCursor();
+};
+/** @} */
+#endif
diff --git a/src/terralib/drivers/qt/resultVisual.h b/src/terralib/drivers/qt/resultVisual.h
old mode 100755
new mode 100644
index be1a875..f561270
--- a/src/terralib/drivers/qt/resultVisual.h
+++ b/src/terralib/drivers/qt/resultVisual.h
@@ -1,37 +1,37 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef RESULTVISUAL_H
-#define RESULTVISUAL_H
-
-
-#include <qwidget.h>
-
-class ResultVisual : public QWidget
-{
-public:
-	ResultVisual(QWidget *parent=0, const char *name=0)
-		:QWidget(parent,name) {}
-
-	~ResultVisual() {}
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef RESULTVISUAL_H
+#define RESULTVISUAL_H
+
+
+#include <qwidget.h>
+
+class ResultVisual : public QWidget
+{
+public:
+	ResultVisual(QWidget *parent=0, const char *name=0)
+		:QWidget(parent,name) {}
+
+	~ResultVisual() {}
+};
+
+#endif
diff --git a/src/terralib/drivers/qwt/TeQwtDefines.h b/src/terralib/drivers/qwt/TeQwtDefines.h
new file mode 100644
index 0000000..541bd98
--- /dev/null
+++ b/src/terralib/drivers/qwt/TeQwtDefines.h
@@ -0,0 +1,56 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeQwtDefines.h
+    \brief Provides a set of general definitions used by te_qwt project
+*/
+#ifndef  __TEQWT_INTERNAL_DEFINES_H
+#define  __TEQWT_INTERNAL_DEFINES_H
+
+#include <string> 
+
+/** @defgroup Defines Defines and constants
+  @{
+ */
+
+/** @defgroup TLQWT_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLQWT_AS_DLL
+#define TLQWT_DLL __declspec(dllexport)
+#else
+#define TLQWT_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TLQWT_DLL
+#endif
+/** @} */ 
+
+#endif //__TEQWT_INTERNAL_DEFINES_H
+
diff --git a/src/terralib/drivers/qwt/TeQwtPlot.cpp b/src/terralib/drivers/qwt/TeQwtPlot.cpp
old mode 100755
new mode 100644
index f5c79bc..cfb0a32
--- a/src/terralib/drivers/qwt/TeQwtPlot.cpp
+++ b/src/terralib/drivers/qwt/TeQwtPlot.cpp
@@ -1,41 +1,41 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include "TeQwtPlot.h"
-#include <qcursor.h>
-
-TeQwtPlot::TeQwtPlot(QWidget *p)
-:QwtPlot(p)
-{
-	cursor_ = new TeQwtPlotPicker(canvas());
-
-	QCursor cursorShape(Qt::ArrowCursor);
-	canvas()->setCursor(cursorShape);
-}
-
-TeQwtPlot::TeQwtPlot(const QwtText &title, QWidget *p)
-:QwtPlot(title, p)
-{
-	cursor_ = new TeQwtPlotPicker(canvas());
-
-	QCursor cursorShape(Qt::ArrowCursor);
-	canvas()->setCursor(cursorShape);
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include "TeQwtPlot.h"
+#include <qcursor.h>
+
+TeQwtPlot::TeQwtPlot(QWidget *p)
+:QwtPlot(p)
+{
+	cursor_ = new TeQwtPlotPicker(canvas());
+
+	QCursor cursorShape(Qt::ArrowCursor);
+	canvas()->setCursor(cursorShape);
+}
+
+TeQwtPlot::TeQwtPlot(const QwtText &title, QWidget *p)
+:QwtPlot(title, p)
+{
+	cursor_ = new TeQwtPlotPicker(canvas());
+
+	QCursor cursorShape(Qt::ArrowCursor);
+	canvas()->setCursor(cursorShape);
+}
diff --git a/src/terralib/drivers/qwt/TeQwtPlot.h b/src/terralib/drivers/qwt/TeQwtPlot.h
old mode 100755
new mode 100644
index a7aca8f..76ddee8
--- a/src/terralib/drivers/qwt/TeQwtPlot.h
+++ b/src/terralib/drivers/qwt/TeQwtPlot.h
@@ -1,50 +1,52 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef TEQWTPLOT_H
-#define TEQWTPLOT_H
-
-#include <qwt_plot.h>
-#include <qevent.h>
-#include <qpainter.h>
-#include "TeQwtPlotPicker.h"
-
-class TeQwtPlot:public QwtPlot
-{
-    Q_OBJECT
-
-public:
-
-	TeQwtPlot(QWidget *p = 0);
-	TeQwtPlot(const QwtText &title, QWidget *p = NULL);
-
-	virtual ~TeQwtPlot() {delete cursor_;}
-
-	void showCursor(bool b) {cursor_->show(b);}
-	void zoomActive(bool b) {cursor_->zoomActive(b);}
-	void cursorMode(int m) {cursor_->mode(m);}
-	TeQwtPlotPicker* cursor() {return cursor_;}
-
-private:
-	TeQwtPlotPicker* cursor_;
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef TEQWTPLOT_H
+#define TEQWTPLOT_H
+
+#include "TeQwtDefines.h"
+
+#include <qwt_plot.h>
+#include <qevent.h>
+#include <qpainter.h>
+#include "TeQwtPlotPicker.h"
+
+class TLQWT_DLL TeQwtPlot:public QwtPlot
+{
+    Q_OBJECT
+
+public:
+
+	TeQwtPlot(QWidget *p = 0);
+	TeQwtPlot(const QwtText &title, QWidget *p = NULL);
+
+	virtual ~TeQwtPlot() {delete cursor_;}
+
+	void showCursor(bool b) {cursor_->show(b);}
+	void zoomActive(bool b) {cursor_->zoomActive(b);}
+	void cursorMode(int m) {cursor_->mode(m);}
+	TeQwtPlotPicker* cursor() {return cursor_;}
+
+private:
+	TeQwtPlotPicker* cursor_;
+};
+
+#endif
diff --git a/src/terralib/drivers/qwt/TeQwtPlotCurve.cpp b/src/terralib/drivers/qwt/TeQwtPlotCurve.cpp
old mode 100755
new mode 100644
index 7dc3e3b..0bf54a4
--- a/src/terralib/drivers/qwt/TeQwtPlotCurve.cpp
+++ b/src/terralib/drivers/qwt/TeQwtPlotCurve.cpp
@@ -1,53 +1,53 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include "TeQwtPlotCurve.h"
-#include <qwt_scale_map.h>
-#include <qwt_painter.h>
-#include <qpainter.h>
-
-
-void TeQwtPlotCurve::drawCurve(QPainter *p, int style,
-        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
-        int from, int to) const
-{
-	if(style == UserCurve)
-	{
-		int y0 = yMap.transform(baseline());
-		QRect rect;
-		int w = xMap.transform(x(1)) - xMap.transform(x(0));
-		int w2 = w/2;
-
-		for (int i = from; i <= to; i++)
-		{
-			const int xi = xMap.transform(x(i));
-			const int yi = yMap.transform(y(i));
-			if(y0 < yi)
-				rect = QRect(xi-w2, y0, w, yi-y0);
-			else
-				rect = QRect(xi-w2, yi, w, y0-yi);
-			p->fillRect(rect, brush());
-			p->drawRect(rect);
-		}
-	}
-	else
-		QwtPlotCurve::drawCurve(p, style, xMap, yMap, from, to);
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include "TeQwtPlotCurve.h"
+#include <qwt_scale_map.h>
+#include <qwt_painter.h>
+#include <qpainter.h>
+
+
+void TeQwtPlotCurve::drawCurve(QPainter *p, int style,
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        int from, int to) const
+{
+	if(style == UserCurve)
+	{
+		int y0 = yMap.transform(baseline());
+		QRect rect;
+		int w = xMap.transform(x(1)) - xMap.transform(x(0));
+		int w2 = w/2;
+
+		for (int i = from; i <= to; i++)
+		{
+			const int xi = xMap.transform(x(i));
+			const int yi = yMap.transform(y(i));
+			if(y0 < yi)
+				rect = QRect(xi-w2, y0, w, yi-y0);
+			else
+				rect = QRect(xi-w2, yi, w, y0-yi);
+			p->fillRect(rect, brush());
+			p->drawRect(rect);
+		}
+	}
+	else
+		QwtPlotCurve::drawCurve(p, style, xMap, yMap, from, to);
+}
diff --git a/src/terralib/drivers/qwt/TeQwtPlotCurve.h b/src/terralib/drivers/qwt/TeQwtPlotCurve.h
old mode 100755
new mode 100644
index 18af2b8..622297e
--- a/src/terralib/drivers/qwt/TeQwtPlotCurve.h
+++ b/src/terralib/drivers/qwt/TeQwtPlotCurve.h
@@ -1,46 +1,48 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef TEQWTPLOTCURVE_H
-#define TEQWTPLOTCURVE_H
-
-#include <qwt_plot_curve.h>
-#include <qbrush.h>
-
-class TeQwtPlotCurve : public QwtPlotCurve
-{
-public:
-
-	explicit TeQwtPlotCurve():QwtPlotCurve(){}
-	explicit TeQwtPlotCurve(const QwtText &title):QwtPlotCurve(title){}
-	explicit TeQwtPlotCurve(const QString &title):QwtPlotCurve(title){}
-	explicit TeQwtPlotCurve(const QwtPlotCurve &c):QwtPlotCurve(c){}
-
-	virtual ~TeQwtPlotCurve(){}
-
-protected:
-
-    void drawCurve(QPainter *p, int style,
-        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
-        int from, int to) const;
-};
-
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef TEQWTPLOTCURVE_H
+#define TEQWTPLOTCURVE_H
+
+#include "TeQwtDefines.h"
+
+#include <qwt_plot_curve.h>
+#include <qbrush.h>
+
+class TLQWT_DLL TeQwtPlotCurve : public QwtPlotCurve
+{
+public:
+
+	explicit TeQwtPlotCurve():QwtPlotCurve(){}
+	explicit TeQwtPlotCurve(const QwtText &title):QwtPlotCurve(title){}
+	explicit TeQwtPlotCurve(const QString &title):QwtPlotCurve(title){}
+	explicit TeQwtPlotCurve(const QwtPlotCurve &c):QwtPlotCurve(c){}
+
+	virtual ~TeQwtPlotCurve(){}
+
+protected:
+
+    void drawCurve(QPainter *p, int style,
+        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+        int from, int to) const;
+};
+
+#endif
diff --git a/src/terralib/drivers/qwt/TeQwtPlotPicker.cpp b/src/terralib/drivers/qwt/TeQwtPlotPicker.cpp
old mode 100755
new mode 100644
index 76e1e74..173c7ee
--- a/src/terralib/drivers/qwt/TeQwtPlotPicker.cpp
+++ b/src/terralib/drivers/qwt/TeQwtPlotPicker.cpp
@@ -1,225 +1,225 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include "TeQwtPlotPicker.h"
-#include <qcursor.h>
-
-TeQwtPlotPicker::TeQwtPlotPicker(QwtPlotCanvas *c)
-	: QwtPlotPicker(c)
-{
-	rect_ = QRect(0, 0, 10, 10);
-	restoreArea_ = false;
-	show_ = false;
-	zoomActive_ = false;
-	mode_ = scatter;
-	histoCursorH_ = 5;
-	QPen pen(Qt::red);
-	painter_.begin(c);
-	QRect r = c->frameRect();
-	painter_.setPen(pen);
-	c->setCursor(QCursor(Qt::ArrowCursor));
-	setTrackerMode(QwtPlotPicker::AlwaysOn);
-}
-
-TeQwtPlotPicker::TeQwtPlotPicker(int xAxis, int yAxis, QwtPlotCanvas *c)
-	: QwtPlotPicker(xAxis, yAxis, c)
-{
-	rect_ = QRect(0, 0, 10, 10);
-	restoreArea_ = false;
-	show_ = false;
-	zoomActive_ = false;
-	mode_ = scatter;
-	histoCursorH_ = 5;
-	QPen pen(Qt::red);
-	painter_.begin(c);
-	QRect r = c->frameRect();
-	painter_.setPen(pen);
-	c->setCursor(QCursor(Qt::ArrowCursor));
-	setTrackerMode(QwtPlotPicker::AlwaysOn);
-}
-
-TeQwtPlotPicker::TeQwtPlotPicker(int xAxis, int yAxis, int selectionFlags, DisplayMode trackerMode, QwtPlotCanvas *c)
-	: QwtPlotPicker(xAxis, yAxis, selectionFlags, NoRubberBand, trackerMode, c)
-{
-	rect_ = QRect(0, 0, 10, 10);
-	restoreArea_ = false;
-	show_ = false;
-	zoomActive_ = false;
-	mode_ = scatter;
-	histoCursorH_ = 5;
-	QPen pen(Qt::red);
-	painter_.begin(c);
-	QRect r = c->frameRect();
-	painter_.setPen(pen);
-	c->setCursor(QCursor(Qt::ArrowCursor));
-}
-
-void TeQwtPlotPicker::widgetMousePressEvent(QMouseEvent *e)
-{
-	if(show_ == false)
-		return;
-
-	p_ = e->pos();
-
-	QwtDoubleRect dr = invTransform(rect_);
-
-	int buttom = e->button();
-	int state = e->state();
-		
-	emit mousePressedSignal(buttom, state, dr);
-}
-
-void TeQwtPlotPicker::widgetMouseReleaseEvent(QMouseEvent *e)
-{
-	if(show_ == false)
-		return;
-
-	p_ = e->pos();
-}
-
-void TeQwtPlotPicker::widgetMouseMoveEvent(QMouseEvent *e)
-{
-	const int cursor = canvas()->cursor().shape();
-
-	if(zoomActive_)
-	{
-		if(cursor != (int)Qt::CrossCursor)
-			canvas()->setCursor(QCursor(Qt::CrossCursor));
-	}
-	else
-	{
-		if(cursor != (int)Qt::ArrowCursor)
-			canvas()->setCursor(QCursor(Qt::ArrowCursor));
-	}
-
-	if(show_ == false)
-		return;
-
-	int d = histoCursorH_;
-
-	QPixmap *pixmap = canvas()->paintCache();
-
-	if(restoreArea_ && pixmap)
-	{
-		if(mode_ == scatter)
-			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height(), Qt::CopyROP);
-		else
-		{
-			int y = rect_.center().y();
-			rect_.setRect(rect_.left(), y-d, rect_.width(), d+d);
-			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height()+1, Qt::CopyROP);
-		}
-	}
-
-//#ifdef WIN32
-	if(e->state() == Qt::AltButton)
-//#else
-//	if(e->state() == (Qt::AltButton | Qt::ControlButton))
-//#endif
-	{
-		if(p_ != e->pos())
-		{
-			int dx = e->pos().x() - p_.x();
-			int dy = e->pos().y() - p_.y();
-			rect_.setWidth(rect_.width() + dx);
-			if(rect_.width() < 3)
-				rect_.setWidth(3);
-
-			rect_.setHeight(rect_.height() + dy);
-			if(rect_.height() < 3)
-				rect_.setHeight(3);
-
-			int y = rect_.center().y();
-			if(mode_ == histog)
-				rect_.setRect(rect_.left(), y-d, rect_.width(), d+d);
-		}
-	}
-
-	p_ = e->pos();
-	if(mode_ == histog)
-		rect_.setRect(rect_.left(), p_.y()-d, rect_.width(), d+d);
-
-	rect_.moveCenter(p_);
-	QRect rc = canvas()->rect();
-	rc.setRect(2, 2, rc.right()-3, rc.bottom()-3);
-	QRect rec = rc.intersect(rect_);
-	painter_.setClipping(false);
-	if(mode_ == scatter)
-		painter_.drawRect(rec);
-	else
-	{
-		int xi = rec.left();
-		int xf = rec.right();
-		int cy = rec.center().y();
-		painter_.drawLine(xi, cy, xf, cy);
-		painter_.drawLine(xi, cy-d, xi, cy+d);
-		painter_.drawLine(xf, cy-d, xf, cy+d);		
-	}
-	restoreArea_ = true;
-}
-
-void TeQwtPlotPicker::show(bool b)
-{
-	int d = histoCursorH_;
-
-	QPixmap *pixmap = canvas()->paintCache();
-	if(show_ && restoreArea_ && pixmap)
-	{
-		if(mode_ == scatter)
-			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height(), Qt::CopyROP);
-		else
-		{
-			int y = rect_.center().y();
-			rect_.setRect(rect_.left(), y-d, rect_.width(), d+d);
-			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height()+1, Qt::CopyROP);
-		}
-	}
-
-	restoreArea_ = false;
-	show_ = b;
-
-	if(b)
-		canvas()->setCursor(QCursor(Qt::ArrowCursor));
-	else
-		canvas()->setCursor(QCursor(Qt::crossCursor));
-	setEnabled(b);
-}
-
-void TeQwtPlotPicker::mode(int m)
-{
-	int d = histoCursorH_;
-
-	QPixmap *pixmap = canvas()->paintCache();
-	if(restoreArea_ && show_ && pixmap)
-	{
-		if(mode_ == scatter)
-			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height(), Qt::CopyROP);
-		else
-		{
-			int y = rect_.center().y();
-			rect_.setRect(rect_.left(), y-d, rect_.width(), d+d);
-			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height()+1, Qt::CopyROP);
-		}
-	}
-
-	restoreArea_ = false;
-	mode_ = m;
-}
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include "TeQwtPlotPicker.h"
+#include <qcursor.h>
+
+TeQwtPlotPicker::TeQwtPlotPicker(QwtPlotCanvas *c)
+	: QwtPlotPicker(c)
+{
+	rect_ = QRect(0, 0, 10, 10);
+	restoreArea_ = false;
+	show_ = false;
+	zoomActive_ = false;
+	mode_ = scatter;
+	histoCursorH_ = 5;
+	QPen pen(Qt::red);
+	painter_.begin(c);
+	QRect r = c->frameRect();
+	painter_.setPen(pen);
+	c->setCursor(QCursor(Qt::ArrowCursor));
+	setTrackerMode(QwtPlotPicker::AlwaysOn);
+}
+
+TeQwtPlotPicker::TeQwtPlotPicker(int xAxis, int yAxis, QwtPlotCanvas *c)
+	: QwtPlotPicker(xAxis, yAxis, c)
+{
+	rect_ = QRect(0, 0, 10, 10);
+	restoreArea_ = false;
+	show_ = false;
+	zoomActive_ = false;
+	mode_ = scatter;
+	histoCursorH_ = 5;
+	QPen pen(Qt::red);
+	painter_.begin(c);
+	QRect r = c->frameRect();
+	painter_.setPen(pen);
+	c->setCursor(QCursor(Qt::ArrowCursor));
+	setTrackerMode(QwtPlotPicker::AlwaysOn);
+}
+
+TeQwtPlotPicker::TeQwtPlotPicker(int xAxis, int yAxis, int selectionFlags, DisplayMode trackerMode, QwtPlotCanvas *c)
+	: QwtPlotPicker(xAxis, yAxis, selectionFlags, NoRubberBand, trackerMode, c)
+{
+	rect_ = QRect(0, 0, 10, 10);
+	restoreArea_ = false;
+	show_ = false;
+	zoomActive_ = false;
+	mode_ = scatter;
+	histoCursorH_ = 5;
+	QPen pen(Qt::red);
+	painter_.begin(c);
+	QRect r = c->frameRect();
+	painter_.setPen(pen);
+	c->setCursor(QCursor(Qt::ArrowCursor));
+}
+
+void TeQwtPlotPicker::widgetMousePressEvent(QMouseEvent *e)
+{
+	if(show_ == false)
+		return;
+
+	p_ = e->pos();
+
+	QwtDoubleRect dr = invTransform(rect_);
+
+	int buttom = e->button();
+	int state = e->state();
+		
+	emit mousePressedSignal(buttom, state, dr);
+}
+
+void TeQwtPlotPicker::widgetMouseReleaseEvent(QMouseEvent *e)
+{
+	if(show_ == false)
+		return;
+
+	p_ = e->pos();
+}
+
+void TeQwtPlotPicker::widgetMouseMoveEvent(QMouseEvent *e)
+{
+	const int cursor = canvas()->cursor().shape();
+
+	if(zoomActive_)
+	{
+		if(cursor != (int)Qt::CrossCursor)
+			canvas()->setCursor(QCursor(Qt::CrossCursor));
+	}
+	else
+	{
+		if(cursor != (int)Qt::ArrowCursor)
+			canvas()->setCursor(QCursor(Qt::ArrowCursor));
+	}
+
+	if(show_ == false)
+		return;
+
+	int d = histoCursorH_;
+
+	QPixmap *pixmap = canvas()->paintCache();
+
+	if(restoreArea_ && pixmap)
+	{
+		if(mode_ == scatter)
+			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height(), Qt::CopyROP);
+		else
+		{
+			int y = rect_.center().y();
+			rect_.setRect(rect_.left(), y-d, rect_.width(), d+d);
+			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height()+1, Qt::CopyROP);
+		}
+	}
+
+//#ifdef WIN32
+	if(e->state() == Qt::AltButton)
+//#else
+//	if(e->state() == (Qt::AltButton | Qt::ControlButton))
+//#endif
+	{
+		if(p_ != e->pos())
+		{
+			int dx = e->pos().x() - p_.x();
+			int dy = e->pos().y() - p_.y();
+			rect_.setWidth(rect_.width() + dx);
+			if(rect_.width() < 3)
+				rect_.setWidth(3);
+
+			rect_.setHeight(rect_.height() + dy);
+			if(rect_.height() < 3)
+				rect_.setHeight(3);
+
+			int y = rect_.center().y();
+			if(mode_ == histog)
+				rect_.setRect(rect_.left(), y-d, rect_.width(), d+d);
+		}
+	}
+
+	p_ = e->pos();
+	if(mode_ == histog)
+		rect_.setRect(rect_.left(), p_.y()-d, rect_.width(), d+d);
+
+	rect_.moveCenter(p_);
+	QRect rc = canvas()->rect();
+	rc.setRect(2, 2, rc.right()-3, rc.bottom()-3);
+	QRect rec = rc.intersect(rect_);
+	painter_.setClipping(false);
+	if(mode_ == scatter)
+		painter_.drawRect(rec);
+	else
+	{
+		int xi = rec.left();
+		int xf = rec.right();
+		int cy = rec.center().y();
+		painter_.drawLine(xi, cy, xf, cy);
+		painter_.drawLine(xi, cy-d, xi, cy+d);
+		painter_.drawLine(xf, cy-d, xf, cy+d);		
+	}
+	restoreArea_ = true;
+}
+
+void TeQwtPlotPicker::show(bool b)
+{
+	int d = histoCursorH_;
+
+	QPixmap *pixmap = canvas()->paintCache();
+	if(show_ && restoreArea_ && pixmap)
+	{
+		if(mode_ == scatter)
+			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height(), Qt::CopyROP);
+		else
+		{
+			int y = rect_.center().y();
+			rect_.setRect(rect_.left(), y-d, rect_.width(), d+d);
+			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height()+1, Qt::CopyROP);
+		}
+	}
+
+	restoreArea_ = false;
+	show_ = b;
+
+	if(b)
+		canvas()->setCursor(QCursor(Qt::ArrowCursor));
+	else
+		canvas()->setCursor(QCursor(Qt::crossCursor));
+	setEnabled(b);
+}
+
+void TeQwtPlotPicker::mode(int m)
+{
+	int d = histoCursorH_;
+
+	QPixmap *pixmap = canvas()->paintCache();
+	if(restoreArea_ && show_ && pixmap)
+	{
+		if(mode_ == scatter)
+			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height(), Qt::CopyROP);
+		else
+		{
+			int y = rect_.center().y();
+			rect_.setRect(rect_.left(), y-d, rect_.width(), d+d);
+			bitBlt(canvas(), rect_.left(), rect_.top(), pixmap, rect_.left()-2, rect_.top()-2, rect_.width(), rect_.height()+1, Qt::CopyROP);
+		}
+	}
+
+	restoreArea_ = false;
+	mode_ = m;
+}
diff --git a/src/terralib/drivers/qwt/TeQwtPlotPicker.h b/src/terralib/drivers/qwt/TeQwtPlotPicker.h
old mode 100755
new mode 100644
index 6d5b9c9..7b52a99
--- a/src/terralib/drivers/qwt/TeQwtPlotPicker.h
+++ b/src/terralib/drivers/qwt/TeQwtPlotPicker.h
@@ -1,72 +1,74 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#ifndef TEQWTPLOTPICKER_H
-#define TEQWTPLOTPICKER_H
-
-#include <qwt_plot_picker.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-
-class TeQwtPlotPicker:public QwtPlotPicker
-{
-    Q_OBJECT
-
-public:
-
-	enum CursorMode
-    {
-        scatter,
-        histog
-	};
-
-	TeQwtPlotPicker(QwtPlotCanvas *c);
-	TeQwtPlotPicker(int xAxis, int yAxis, QwtPlotCanvas *c);
-	TeQwtPlotPicker(int xAxis, int yAxis, int selectionFlags, DisplayMode trackerMode, QwtPlotCanvas *c);
-
-	virtual ~TeQwtPlotPicker() {}
-
-	void setRect(const QRect& r) {rect_ = r;}
-	QRect& getRect() {return rect_;}
-	void setPen(QPen p) {painter_.setPen(p);}
-	void show(bool b);
-	void mode(int m);
-	void zoomActive(bool b) {zoomActive_ = b;}
-
-protected:
-
-    void widgetMousePressEvent(QMouseEvent *);
-    void widgetMouseReleaseEvent(QMouseEvent *);
-    void widgetMouseMoveEvent(QMouseEvent *); 
-
-	QRect rect_;
-    QPoint p_;
-	QPainter painter_;
-	bool restoreArea_;
-	bool show_;
-	bool zoomActive_;
-	int mode_;
-	int histoCursorH_;
-
-signals:
-	void mousePressedSignal(int, int, QwtDoubleRect);
-};
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef TEQWTPLOTPICKER_H
+#define TEQWTPLOTPICKER_H
+
+#include "TeQwtDefines.h"
+
+#include <qwt_plot_picker.h>
+#include <qpainter.h>
+#include <qpixmap.h>
+
+class TLQWT_DLL TeQwtPlotPicker:public QwtPlotPicker
+{
+    Q_OBJECT
+
+public:
+
+	enum CursorMode
+    {
+        scatter,
+        histog
+	};
+
+	TeQwtPlotPicker(QwtPlotCanvas *c);
+	TeQwtPlotPicker(int xAxis, int yAxis, QwtPlotCanvas *c);
+	TeQwtPlotPicker(int xAxis, int yAxis, int selectionFlags, DisplayMode trackerMode, QwtPlotCanvas *c);
+
+	virtual ~TeQwtPlotPicker() {}
+
+	void setRect(const QRect& r) {rect_ = r;}
+	QRect& getRect() {return rect_;}
+	void setPen(QPen p) {painter_.setPen(p);}
+	void show(bool b);
+	void mode(int m);
+	void zoomActive(bool b) {zoomActive_ = b;}
+
+protected:
+
+    void widgetMousePressEvent(QMouseEvent *);
+    void widgetMouseReleaseEvent(QMouseEvent *);
+    void widgetMouseMoveEvent(QMouseEvent *); 
+
+	QRect rect_;
+    QPoint p_;
+	QPainter painter_;
+	bool restoreArea_;
+	bool show_;
+	bool zoomActive_;
+	int mode_;
+	int histoCursorH_;
+
+signals:
+	void mousePressedSignal(int, int, QwtDoubleRect);
+};
+#endif
diff --git a/src/terralib/drivers/qwt/TeQwtPlotZoomer.cpp b/src/terralib/drivers/qwt/TeQwtPlotZoomer.cpp
old mode 100755
new mode 100644
index 835e48b..9ae61e9
--- a/src/terralib/drivers/qwt/TeQwtPlotZoomer.cpp
+++ b/src/terralib/drivers/qwt/TeQwtPlotZoomer.cpp
@@ -1,192 +1,192 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include "TeQwtPlotZoomer.h"
-#include "TeQwtPlot.h"
-#include "TeUtils.h"
-#include <qcursor.h>
-#include <math.h>
-
-TeQwtPlotZoomer::TeQwtPlotZoomer(QwtPlotCanvas *c)
-	:QwtPlotZoomer(c)
-{
-}
-
-TeQwtPlotZoomer::TeQwtPlotZoomer(int xAxis, int yAxis, QwtPlotCanvas *c)
-	:QwtPlotZoomer(xAxis, yAxis, c)
-{
-}
-
-TeQwtPlotZoomer::TeQwtPlotZoomer(int xAxis, int yAxis, int selectionFlags,
-        DisplayMode trackerMode, QwtPlotCanvas *c)
-    :QwtPlotZoomer(xAxis, yAxis, selectionFlags, trackerMode, c)
-{
-}
-
-TeQwtPlotZoomer::~TeQwtPlotZoomer()
-{
-}
-    
-void TeQwtPlotZoomer::widgetKeyPressEvent(QKeyEvent *e)
-{
-	int key = e->key();
-	uint i = zoomRectIndex();
-	if(i > 0)
-	{
-		QwtDoubleRect zr = zoomStack()[0];
-		QwtDoubleRect r = zoomStack()[i];
-		QwtDoublePoint c = r.center();
-		QwtDoublePoint dh(0., r.height()/10.);
-		QwtDoublePoint dw(r.width()/10., 0.);
-
-		if(key == Qt::Key_Left)
-			c -= dw;
-		else if(key == Qt::Key_Right)
-			c += dw;
-		else if(key == Qt::Key_Up) // inverted
-			c += dh;
-		else if(key == Qt::Key_Down) // inverted
-			c -= dh;
-
-		QwtDoubleRect rr = r;
-		r.moveCenter(c);
-		if(zr.contains(r) == false)
-		{
-			if(key == Qt::Key_Left)
-				r.setRect(zr.left(), rr.top(), rr.width(), rr.height());
-			else if(key == Qt::Key_Right)
-				r.setRect(zr.right()-rr.width(), rr.top(), rr.width(), rr.height());
-			else if(key == Qt::Key_Up) // inverted
-				r.setRect(rr.left(), zr.bottom()-rr.height(), rr.width(), rr.height());
-			else if(key == Qt::Key_Down) // inverted
-				r.setRect(rr.left(), zr.top(), rr.width(), rr.height());
-		}
-
-		zoom(r);
-		emit enableNextZoomSignal(false);
-	}
-
-	QwtPlotZoomer::widgetKeyPressEvent(e);
-	if(key == Qt::Key_Escape)
-		emit enablePreviousZoomSignal(false);
-}
-
-void TeQwtPlotZoomer::backward()
-{
-	uint i = zoomRectIndex();
-	if (i > 0)
-		zoom(-1);
-}
-
-void TeQwtPlotZoomer::forward()
-{
-	uint i = zoomRectIndex();
-	if (i < zoomStack().size() - 1 )
-		zoom(+1);
-}
-
-
-void TeQwtPlotZoomer::setEnabledSlot(bool b)
-{
-	QwtPlotZoomer::setEnabled(b);
-
-	QCursor cursor;
-	if (b)
-		cursor.setShape(Qt::CrossCursor);
-	else
-		cursor.setShape(Qt::ArrowCursor);
-
-	canvas()->setCursor(cursor);
-}
-
-void TeQwtPlotZoomer::widgetMouseReleaseEvent(QMouseEvent* e)
-{
-	QwtPlotZoomer::widgetMouseReleaseEvent(e);
-	emit enableNextZoomSignal(false);
-
-	uint i = zoomRectIndex();
-	if(i == 1)
-		emit enablePreviousZoomSignal(true);	
-}
-
-QwtDoubleRect TeQwtPlotZoomer::adjustRect(const QwtDoubleRect& r)
-{
-	QwtDoubleRect rec;
-	double dx = r.width();
-	double ldx = log10(dx);
-	int idx = (int)ldx;
-	double dy = r.height();
-	double ldy = log10(dy);
-	int idy = (int)ldy;
-	
-	if(ldx < 0)
-		idx--;
-	if(ldy < 0)
-		idy--;
-
-	double k = pow(10., double(idx));
-	double v = r.left();
-	int a = TeRound(v / k);
-	double v2 = (double)a * k;
-	if(v2 > v)
-	{
-		a = TeRound(v / k - .5);
-		v2 = (double)a * k;
-	}
-	rec.setLeft(v2);
-
-	v = r.right();
-	a = TeRound(v / k);
-	v2 = (double)a * k;
-	if(v2 < v)
-	{
-		a = TeRound(v / k + .5);
-		v2 = (double)a * k;
-	}
-	rec.setRight(v2);
-
-	k = pow(10., double(idy));
-	v = r.bottom();
-	a = TeRound(v / k);
-	v2 = (double)a * k;
-	if(v2 < v)
-	{
-		a = TeRound(v / k + .5);
-		v2 = (double)a * k;
-	}
-	rec.setBottom(v2);
-
-	v = r.top();
-	a = TeRound(v / k);
-	v2 = (double)a * k;
-	if(v2 > v)
-	{
-		a = TeRound(v / k - .5);
-		v2 = (double)a * k;
-	}
-	rec.setTop(v2);
-
-	return rec;
-}
-
-
-
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include "TeQwtPlotZoomer.h"
+#include "TeQwtPlot.h"
+#include "TeUtils.h"
+#include <qcursor.h>
+#include <math.h>
+
+TeQwtPlotZoomer::TeQwtPlotZoomer(QwtPlotCanvas *c)
+	:QwtPlotZoomer(c)
+{
+}
+
+TeQwtPlotZoomer::TeQwtPlotZoomer(int xAxis, int yAxis, QwtPlotCanvas *c)
+	:QwtPlotZoomer(xAxis, yAxis, c)
+{
+}
+
+TeQwtPlotZoomer::TeQwtPlotZoomer(int xAxis, int yAxis, int selectionFlags,
+        DisplayMode trackerMode, QwtPlotCanvas *c)
+    :QwtPlotZoomer(xAxis, yAxis, selectionFlags, trackerMode, c)
+{
+}
+
+TeQwtPlotZoomer::~TeQwtPlotZoomer()
+{
+}
+    
+void TeQwtPlotZoomer::widgetKeyPressEvent(QKeyEvent *e)
+{
+	int key = e->key();
+	uint i = zoomRectIndex();
+	if(i > 0)
+	{
+		QwtDoubleRect zr = zoomStack()[0];
+		QwtDoubleRect r = zoomStack()[i];
+		QwtDoublePoint c = r.center();
+		QwtDoublePoint dh(0., r.height()/10.);
+		QwtDoublePoint dw(r.width()/10., 0.);
+
+		if(key == Qt::Key_Left)
+			c -= dw;
+		else if(key == Qt::Key_Right)
+			c += dw;
+		else if(key == Qt::Key_Up) // inverted
+			c += dh;
+		else if(key == Qt::Key_Down) // inverted
+			c -= dh;
+
+		QwtDoubleRect rr = r;
+		r.moveCenter(c);
+		if(zr.contains(r) == false)
+		{
+			if(key == Qt::Key_Left)
+				r.setRect(zr.left(), rr.top(), rr.width(), rr.height());
+			else if(key == Qt::Key_Right)
+				r.setRect(zr.right()-rr.width(), rr.top(), rr.width(), rr.height());
+			else if(key == Qt::Key_Up) // inverted
+				r.setRect(rr.left(), zr.bottom()-rr.height(), rr.width(), rr.height());
+			else if(key == Qt::Key_Down) // inverted
+				r.setRect(rr.left(), zr.top(), rr.width(), rr.height());
+		}
+
+		zoom(r);
+		emit enableNextZoomSignal(false);
+	}
+
+	QwtPlotZoomer::widgetKeyPressEvent(e);
+	if(key == Qt::Key_Escape)
+		emit enablePreviousZoomSignal(false);
+}
+
+void TeQwtPlotZoomer::backward()
+{
+	uint i = zoomRectIndex();
+	if (i > 0)
+		zoom(-1);
+}
+
+void TeQwtPlotZoomer::forward()
+{
+	uint i = zoomRectIndex();
+	if (i < zoomStack().size() - 1 )
+		zoom(+1);
+}
+
+
+void TeQwtPlotZoomer::setEnabledSlot(bool b)
+{
+	QwtPlotZoomer::setEnabled(b);
+
+	QCursor cursor;
+	if (b)
+		cursor.setShape(Qt::CrossCursor);
+	else
+		cursor.setShape(Qt::ArrowCursor);
+
+	canvas()->setCursor(cursor);
+}
+
+void TeQwtPlotZoomer::widgetMouseReleaseEvent(QMouseEvent* e)
+{
+	QwtPlotZoomer::widgetMouseReleaseEvent(e);
+	emit enableNextZoomSignal(false);
+
+	uint i = zoomRectIndex();
+	if(i == 1)
+		emit enablePreviousZoomSignal(true);	
+}
+
+QwtDoubleRect TeQwtPlotZoomer::adjustRect(const QwtDoubleRect& r)
+{
+	QwtDoubleRect rec;
+	double dx = r.width();
+	double ldx = log10(dx);
+	int idx = (int)ldx;
+	double dy = r.height();
+	double ldy = log10(dy);
+	int idy = (int)ldy;
+	
+	if(ldx < 0)
+		idx--;
+	if(ldy < 0)
+		idy--;
+
+	double k = pow(10., double(idx));
+	double v = r.left();
+	int a = TeRound(v / k);
+	double v2 = (double)a * k;
+	if(v2 > v)
+	{
+		a = TeRound(v / k - .5);
+		v2 = (double)a * k;
+	}
+	rec.setLeft(v2);
+
+	v = r.right();
+	a = TeRound(v / k);
+	v2 = (double)a * k;
+	if(v2 < v)
+	{
+		a = TeRound(v / k + .5);
+		v2 = (double)a * k;
+	}
+	rec.setRight(v2);
+
+	k = pow(10., double(idy));
+	v = r.bottom();
+	a = TeRound(v / k);
+	v2 = (double)a * k;
+	if(v2 < v)
+	{
+		a = TeRound(v / k + .5);
+		v2 = (double)a * k;
+	}
+	rec.setBottom(v2);
+
+	v = r.top();
+	a = TeRound(v / k);
+	v2 = (double)a * k;
+	if(v2 > v)
+	{
+		a = TeRound(v / k - .5);
+		v2 = (double)a * k;
+	}
+	rec.setTop(v2);
+
+	return rec;
+}
+
+
+
+
diff --git a/src/terralib/drivers/qwt/TeQwtPlotZoomer.h b/src/terralib/drivers/qwt/TeQwtPlotZoomer.h
old mode 100755
new mode 100644
index 396b387..e068a47
--- a/src/terralib/drivers/qwt/TeQwtPlotZoomer.h
+++ b/src/terralib/drivers/qwt/TeQwtPlotZoomer.h
@@ -1,58 +1,60 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-// vim: expandtab
-
-#ifndef TEQWTPLOTZOOMER_H
-#define TEQWTPLOTZOOMER_H
-
-#include <qwt_plot_zoomer.h>
-
-class TeQwtPlotZoomer: public QwtPlotZoomer
-{
-	Q_OBJECT
-
-public:
-    TeQwtPlotZoomer(QwtPlotCanvas *);
-    TeQwtPlotZoomer(int xAxis, int yAxis, QwtPlotCanvas *);
-    TeQwtPlotZoomer(int xAxis, int yAxis, int selectionFlags,
-        DisplayMode trackerMode, QwtPlotCanvas *);
-	virtual ~TeQwtPlotZoomer();
-
-	QwtDoubleRect adjustRect(const QwtDoubleRect&);
-
-signals:
-	void enablePreviousZoomSignal(bool);
-	void enableNextZoomSignal(bool);
-
-public slots:
-    void forward();
-    void backward();
-	void setEnabledSlot(bool);
-
-protected:
-    void widgetKeyPressEvent(QKeyEvent *);
-	void widgetMouseReleaseEvent(QMouseEvent *);
-
-};
-
-            
-#endif
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+// vim: expandtab
+
+#ifndef TEQWTPLOTZOOMER_H
+#define TEQWTPLOTZOOMER_H
+
+#include "TeQwtDefines.h"
+
+#include <qwt_plot_zoomer.h>
+
+class TLQWT_DLL TeQwtPlotZoomer: public QwtPlotZoomer
+{
+	Q_OBJECT
+
+public:
+    TeQwtPlotZoomer(QwtPlotCanvas *);
+    TeQwtPlotZoomer(int xAxis, int yAxis, QwtPlotCanvas *);
+    TeQwtPlotZoomer(int xAxis, int yAxis, int selectionFlags,
+        DisplayMode trackerMode, QwtPlotCanvas *);
+	virtual ~TeQwtPlotZoomer();
+
+	QwtDoubleRect adjustRect(const QwtDoubleRect&);
+
+signals:
+	void enablePreviousZoomSignal(bool);
+	void enableNextZoomSignal(bool);
+
+public slots:
+    void forward();
+    void backward();
+	void setEnabledSlot(bool);
+
+protected:
+    void widgetKeyPressEvent(QKeyEvent *);
+	void widgetMouseReleaseEvent(QMouseEvent *);
+
+};
+
+            
+#endif
diff --git a/src/terralib/drivers/shapelib/TeDriverSHPDBF.cpp b/src/terralib/drivers/shapelib/TeDriverSHPDBF.cpp
old mode 100755
new mode 100644
index e183f3c..7cee03c
--- a/src/terralib/drivers/shapelib/TeDriverSHPDBF.cpp
+++ b/src/terralib/drivers/shapelib/TeDriverSHPDBF.cpp
@@ -1,2413 +1,2598 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-// STL 
-#include <string>
-#include <iostream>
-#include <vector>
-#include <list>
-#include <map>
-using namespace std;
-
-#include <assert.h>
-
-#ifdef WIN32
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-
-
-// TerraLib
-
-#include "TeDriverSHPDBF.h"
-#include "TeTable.h"
-#include "TeException.h"
-#include "TeUtils.h"
-#include "TeGeometry.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeLayer.h"
-#include "TeProgress.h"
-#include "TeDatabase.h"
-#include "TeAsciiFile.h"
-
-// from SHAPELIB
-#include "shapefil.h" 
-
-bool
-TeGetSHPInfo(std::string shpfileName, unsigned int& nShapes, TeBox& box, TeGeomRep& rep)
-{
-	nShapes = 0;
-	rep = TeGEOMETRYNONE;
-	box = TeBox();
-
-	SHPHandle	hSHP;
-	hSHP = SHPOpen( shpfileName.c_str(), "rb" );
-
-	if( hSHP == 0 )
-		return false;
-
-	int		nShapeType, nentities=0;
-	double 	adfMinBound[4], adfMaxBound[4];
-
-	SHPGetInfo(hSHP, &nentities, &nShapeType, adfMinBound, adfMaxBound);
-	nShapes = nentities;
-	
-	box.x1_ = adfMinBound[0];
-	box.y1_ = adfMinBound[1];
-	box.x2_ = adfMaxBound[0];
-	box.y2_ = adfMaxBound[1];
-
-	switch (nShapeType) 
-	{
-		case SHPT_NULL:
-			rep = TeGEOMETRYNONE;
-		break;
-		// --- point geometries ---
-		case SHPT_POINTZ:	
-		case SHPT_MULTIPOINTZ:
-		case SHPT_POINTM:
-		case SHPT_MULTIPOINTM:
-		case SHPT_POINT:
-		case SHPT_MULTIPOINT:
-			rep = TePOINTS;
-		break;
-		// --- line geometries ---
-		case SHPT_ARCZ:
-		case SHPT_ARCM:
-		case SHPT_ARC:
-			rep = TeLINES;
-		break;
-		// --- polygon geometries ---
-		case SHPT_POLYGON:
-		case SHPT_POLYGONM:
-		case SHPT_POLYGONZ:
-			rep = TePOLYGONS;
-	}
-	SHPClose(hSHP);
-	return true;
-}
-
-bool
-TeSTOSetBuildSHP(TeSTElementSet& stoset, const string& fileName)
-{
-	// Read some information about the shapefile
-	string filePrefix = TeGetName(fileName.c_str());
-	string shpfileName = filePrefix + ".shp";
-
-	SHPHandle	hSHP;
-	hSHP = SHPOpen( shpfileName.c_str(), "rb" );
-
-	if( hSHP == 0 )
-		return false;
-
-	int		nShapeType, nEntities;
-	double 	adfMinBound[4], adfMaxBound[4];
-
-	SHPGetInfo(hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound);
-
-	string dbffileName = filePrefix + ".dbf";
-    	DBFHandle hDBF = DBFOpen( dbffileName.c_str(), "rb" );
-    	if( hDBF == 0  || DBFGetFieldCount(hDBF) == 0)
-		return false;
-    
-	int natt = DBFGetFieldCount(hDBF);
-	TeAttributeList attList;
-	TeReadDBFAttributeList(shpfileName, attList);
-
-	TeAttributeRep repobjid;
-	repobjid.name_ = "object_id";
-	repobjid.numChar_ = 16;
-
-	TeAttribute attobjid;
-	attobjid.rep_ = repobjid;
-
-	TeProperty propobjid;
-	propobjid.attr_ = attobjid;
-	
-	int i,n;
-	SHPObject* psShape;
-	for (i=0; i<nEntities; i++)
-	{
-		string objectid = Te2String(i);
-		TeSTInstance curObj;
-		curObj.objectId(objectid);
-
-		TePropertyVector prop;
-		psShape = SHPReadObject(hSHP,i);
-		if (TeDecodeShape(psShape,curObj.geometries(),objectid))
-		{
-			propobjid.value_ = objectid;
-			prop.push_back(propobjid);
-			for(n=0;n<natt;n++)
-			{
-				string value = DBFReadStringAttribute(hDBF,i,n);
-				TeProperty p;
-				p.attr_ = attList[n];
-				p.value_ = value;
-				prop.push_back(p);
-			}
-			curObj.properties(prop);
-			stoset.insertSTInstance(curObj);
-			curObj.theme(0);
-		}
-		SHPDestroyObject(psShape);
-	}
-	return true;
-} 
-
-TeLayer* TeImportShape(const string& shpFileName, TeDatabase* db, const string& layerName)
-{
-	if (!db || shpFileName.empty()) 
-		return 0;
-
-	// check if format is complete (SHP, SHX e DBF files exist)
-	string filePrefix = TeGetName(shpFileName.c_str());
-	string ftest = filePrefix + ".dbf";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".DBF";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-	ftest = filePrefix + ".shx";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".SHX";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-
-	// found a valid layer name
-	string lName;
-	string baseName = TeGetBaseName(shpFileName.c_str());
-	if (layerName.empty())
-		lName = baseName;
-	else
-		lName = layerName;
-
-	string newLayerName = lName;
-	TeLayerMap& layerMap = db->layerMap();
-	TeLayerMap::iterator it;
-	bool flag = true;
-	int n = 1;
-	while (flag)
-	{
-		for (it = layerMap.begin(); it != layerMap.end(); ++it)
-		{
-			if (TeStringCompare(it->second->name(),newLayerName))
-				break;
-		}
-		if (it == layerMap.end())
-			flag = 0;
-		else
-			newLayerName = lName + "_" +Te2String(n);
-		n++;	
-	}
-
-	// find projection
-	TeLayer* newLayer = new TeLayer(newLayerName,db);
-	if (newLayer->id() <= 0 )
-		return 0;				// couldn�t create new layer
-
-	bool res = TeImportShape(newLayer,shpFileName);
-	if (res)
-		return newLayer;
-	else
-	{
-		db->deleteLayer(newLayer->id());
-		delete newLayer;
-		return 0;
-	}
-}
-
-bool TeImportShape (TeLayer* layer, const string& shpFileName, string attrTableName,  
-					string objectIdAtt, int unsigned chunkSize )
-{
-	double oldPrec = TePrecision::instance().precision();
-
-	if(layer)
-	{
-		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
-	}
-	else
-	{
-		TePrecision::instance().setPrecision(TeGetPrecision(0));
-	}
-
-	string filePrefix = TeGetName(shpFileName.c_str());
-	string shpFileN = filePrefix + ".shp";
-	string dbfFileN = filePrefix + ".dbf";
-
-	SHPHandle	hSHP = SHPOpen(shpFileN.c_str(),"rb");
-	if (hSHP == 0)
-	{
-		TePrecision::instance().setPrecision(oldPrec);
-		return false;
-	}
-
-    DBFHandle hDBF = DBFOpen(dbfFileN.c_str(), "rb");
-    if (hDBF == 0)
-    {
-		TePrecision::instance().setPrecision(oldPrec);
-		SHPClose(hSHP);
-		return false;
-    }
-
-	// Read some information about the shapefile
-	int nShapeType, nEntities;
-	// --- get the shape and decode it
-	double 	adfMinBound[4], adfMaxBound[4];
-	SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
-	string shpName = SHPTypeName( nShapeType );
-	if (shpName == "UnknownShapeType")
-	{
-		TePrecision::instance().setPrecision(oldPrec);
-		SHPClose(hSHP);
-		DBFClose(hDBF);
-		return false;
-	}
-
-	if (attrTableName.empty())
-	{
-		if (layer->name().empty())
-		{
-			TePrecision::instance().setPrecision(oldPrec);
-			return false;
-		}
-		else
-			attrTableName = layer->name();
-	}
-	
-	int linkCol=-1;
-    unsigned int j=0;
-	bool autoIndex = false;
-	int indexOffset = 0;  
-	
-	if (!layer->database()->beginTransaction())  
-		return false;
-
-	//read the attribute list information 
-	TeAttributeList attList;
-	TeReadDBFAttributeList(shpFileName, attList);
-
-	// if no geometry link name is given, creates one called 'object_id_'
-	string ext = "";
-	int count = 0;
-	if (objectIdAtt.empty())
-	{
-		objectIdAtt = "object_id_" + Te2String(layer->id());
-		string s2 = TeConvertToUpperCase(objectIdAtt);
-		while (true)
-		{
-			for (j=0; j<attList.size(); j++)
-			{
-				string s0 = attList[j].rep_.name_;
-				string s1 = TeConvertToUpperCase(s0);
-				if ( s1 == s2)
-					break;
-			}
-			if (j < attList.size())
-			{
-				++count;
-				objectIdAtt = "object_id_" + Te2String(count);
-			}
-			else
-				break;
-		}
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;
-		at.rep_.numChar_ = 16;
-		at.rep_.name_ = objectIdAtt;
-		at.rep_.isPrimaryKey_ = true;
-		attList.push_back(at);
-		linkCol = attList.size()-1;
-		autoIndex = true;
-	}
-	else
-	{
-		// check if given index is valid
-		TeAttributeList::iterator it = attList.begin();
-		while (it != attList.end())
-		{
-			if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(objectIdAtt))		// index found
-			{
-				if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
-				{
-					(*it).rep_.type_ = TeSTRING;
-					(*it).rep_.numChar_ = 16;
-				}
-				(*it).rep_.isPrimaryKey_ = true;
-				linkCol=j;
-				break;
-			}
-			++it;
-			++j;
-		}
-		if (it == attList.end())			// index not found
-		{
-			objectIdAtt = "object_id_" + Te2String(layer->id());;
-			while (true)
-			{
-				for (j=0; j<attList.size(); j++)
-				{
-					if (TeConvertToUpperCase(attList[j].rep_.name_) == TeConvertToUpperCase(objectIdAtt))
-						break;
-				}
-				if (j < attList.size())
-				{
-					++count;
-					objectIdAtt = "object_id_" + Te2String(count);
-				}
-				else
-					break;
-			}
-			TeAttribute at;
-			at.rep_.type_ = TeSTRING;
-			at.rep_.numChar_ = 16;
-			at.rep_.name_ = objectIdAtt;
-			at.rep_.isPrimaryKey_ = true;
-			attList.push_back(at);
-			autoIndex = true;
-		}
-	}
-	if (autoIndex)
-	{
-	    linkCol = attList.size()-1;
-        indexOffset = layer->getNewObjectId(); 
-    }
-
-	TeTable attTable (attrTableName,attList,objectIdAtt,objectIdAtt,TeAttrStatic);
-	if (!layer->createAttributeTable(attTable))			// create the table in the database
-	{
-		SHPClose(hSHP);  
-		DBFClose(hDBF);  
-		layer->database()->rollbackTransaction();  
-		TePrecision::instance().setPrecision(oldPrec);
-		return false;
-	}
-	
-	string objid, value;
-	TePointSet points;
-	TeLineSet lines;
-	TePolygonSet polygons;
-	TeTableRow row;
-	SHPObject* psShape;
-
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(nEntities);
-		TeProgress::instance()->setProgress(j+1);
-	}
-
-	// OBS1: we discard Z and M values when available, because TerraLib
-	// doesn�t have the concept of 3D or measured geometries
-	// OBS2: non identified geometries are mapped to a object_id_
-	// "te_nulo"
-	switch (nShapeType) 
-	{
-		// --- null geometries ---
-	  case SHPT_NULL:							// read only the attributes
-		for (j=0; j<(unsigned int)nEntities; j++)
-		{
-		  row.clear();
-		  TeDBFRowDecode(hDBF,j,row);
-		  if (autoIndex)	// --- create automatic index if needed
-			  row.push_back(Te2String(j));
-		  if (row[linkCol].empty())
-			 row[linkCol] = "te_nulo";
-		  objid = row[linkCol];
-		  attTable.add(row);
-		  if ((j%chunkSize) == 0)
-		  {
-			  layer->saveAttributeTable(attTable);
-			  attTable.clear();
-			  if(TeProgress::instance())
-			  {
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(j+1);
-			  }	
-		  }
-		}
-		break;
-		// --- point geometries ---
-	  case SHPT_POINTZ:	
-	  case SHPT_MULTIPOINTZ:
-	  case SHPT_POINTM:
-	  case SHPT_MULTIPOINTM:
-	  case SHPT_POINT:
-	  case SHPT_MULTIPOINT:
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-				  row.push_back(Te2String(j));
-			  if (row[linkCol].empty())
-				 row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-			  attTable.add(row);
-			  psShape = SHPReadObject(hSHP,j);
-              TeSHPPointDecode(psShape,points,objid);
-     		  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-				  layer->addPoints(points);
-				  points.clear();
-				  layer->saveAttributeTable(attTable);
-				  attTable.clear();
-				  if(TeProgress::instance())
-				  {
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }	
-			  }
-		  }
-		  break;
-		// --- line geometries ---
-	  case SHPT_ARCZ:
-	  case SHPT_ARCM:
-	  case SHPT_ARC:
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-				  row.push_back(Te2String(j));
-			  if (row[linkCol].empty())
-				 row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-			  attTable.add(row);
-			  psShape = SHPReadObject(hSHP,j);
-			  TeSHPPolyLineDecode(psShape,lines,objid);
-     		  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-			 	  layer->addLines(lines);
-				  lines.clear();
-				  layer->saveAttributeTable(attTable);
-				  attTable.clear();
-				  if(TeProgress::instance())
-				  {
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }	
-			  }
-		  }
-		  break;
-	// --- polygon geometries ---
-	  case SHPT_POLYGON:
-	  case SHPT_POLYGONM:
-	  case SHPT_POLYGONZ:
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-				  row.push_back(Te2String(j));
-			  if (row[linkCol].empty())
-				 row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-			  attTable.add(row);
-			  psShape = SHPReadObject(hSHP,j);
-			  TeSHPPolygonDecode(psShape,polygons,objid);
-			  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-				  layer->addPolygons(polygons);
-				  polygons.clear();
-				  layer->saveAttributeTable(attTable);
-				  attTable.clear();
-				  if(TeProgress::instance())
-				  {
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }
-			  }
-
-		  }
-		  break;
-	  default:
-		  /* todo: handle multipatch geometries */
-		  throw TeException ( UNHANDLED_SHP_TYPE );
-	}
-	if (points.size() > 0)
-	{
-		layer->addPoints(points);
-		points.clear();
-	}
-	if (lines.size() > 0)
-	{
-		layer->addLines(lines);
-		lines.clear();
-	}
-	if (polygons.size() > 0)
-	{
-		layer->addPolygons(polygons);
-		polygons.clear();
-	}
-	if (attTable.size() > 0)
-	{
-		layer->saveAttributeTable(attTable);
-		attTable.clear();
-	}
-	if(TeProgress::instance())
-		TeProgress::instance()->cancel();
-
-	SHPClose(hSHP);
-	DBFClose(hDBF);
-	
-	if (!layer->database()->commitTransaction())  
-		return false;
-
-	// Create the spatial indexes
-	int rep = layer->geomRep();
-	if (rep & TePOINTS)
-	{
-		layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE);
-	}
-	if (rep & TeLINES)
-	{
-		layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE);
-	}
-	if (rep & TePOLYGONS)
-	{
-		layer->database()->insertMetadata(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), (TeSpatialIndexType)TeRTREE);
-	}
-
-	TePrecision::instance().setPrecision(oldPrec);
-
-	return true;
-}
-
-bool TeImportShapeGeometry (TeLayer* layer, const string& shpFileName, string attrTableName,  
-					string objectIdAtt, int unsigned chunkSize )
-{
-
-	string filePrefix = TeGetName(shpFileName.c_str());
-	string shpFileN = filePrefix + ".shp";
-	string dbfFileN = filePrefix + ".dbf";
-
-	SHPHandle	hSHP = SHPOpen(shpFileN.c_str(),"rb");
-	if (hSHP == 0)
-		return false;
-
-    DBFHandle hDBF = DBFOpen(dbfFileN.c_str(), "rb");
-    if (hDBF == 0)
-    {
-		SHPClose(hSHP);
-		return false;
-    }
-
-	// Read some information about the shapefile
-	int nShapeType, nEntities;
-	// --- get the shape and decode it
-	double 	adfMinBound[4], adfMaxBound[4];
-	SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
-	string shpName = SHPTypeName( nShapeType );
-	if (shpName == "UnknownShapeType")
-	{
-		SHPClose(hSHP);
-		return false;
-	}
-
-	if (attrTableName.empty())
-	{
-		if (layer->name().empty())
-			return false;
-		else
-			attrTableName = layer->name();
-	}
-	
-	int linkCol=-1;
-    unsigned int j=0;
-	bool autoIndex = false;
-    int indexOffset = 0;
-
-	if (!layer->database()->beginTransaction())
-		return false;
-
-	//read the attribute list information 
-	TeAttributeList attList;
-  TeReadDBFAttributeList(shpFileName, attList);
-
-	// if no geometry link name is given, creates one called 'object_id_'
-	string ext = "";
-	int count = 0;
-	if (objectIdAtt.empty())
-	{
-		objectIdAtt = "object_id_" + Te2String(layer->id());
-		string s2 = TeConvertToUpperCase(objectIdAtt);
-		while (true)
-		{
-			for (j=0; j<attList.size(); j++)
-			{
-				string s0 = attList[j].rep_.name_;
-				string s1 = TeConvertToUpperCase(s0);
-				if ( s1 == s2)
-					break;
-			}
-			if (j < attList.size())
-			{
-				++count;
-				objectIdAtt = "object_id_" + Te2String(count);
-			}
-			else
-				break;
-		}
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;
-		at.rep_.numChar_ = 16;
-		at.rep_.name_ = objectIdAtt;
-		at.rep_.isPrimaryKey_ = true;
-		attList.push_back(at);
-		linkCol = attList.size()-1;
-		autoIndex = true;
-	}
-	else
-	{
-		// check if given index is valid
-		TeAttributeList::iterator it = attList.begin();
-		while (it != attList.end())
-		{
-			if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(objectIdAtt))		// index found
-			{
-				if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
-				{
-					(*it).rep_.type_ = TeSTRING;
-					(*it).rep_.numChar_ = 16;
-				}
-				(*it).rep_.isPrimaryKey_ = true;
-				linkCol=j;
-				break;
-			}
-			++it;
-			++j;
-		}
-		if (it == attList.end())			// index not found
-		{
-			objectIdAtt = "object_id_" + Te2String(layer->id());;
-			while (true)
-			{
-				for (j=0; j<attList.size(); j++)
-				{
-					if (TeConvertToUpperCase(attList[j].rep_.name_) == TeConvertToUpperCase(objectIdAtt))
-						break;
-				}
-				if (j < attList.size())
-				{
-					++count;
-					objectIdAtt = "object_id_" + Te2String(count);
-				}
-				else
-					break;
-			}
-			TeAttribute at;
-			at.rep_.type_ = TeSTRING;
-			at.rep_.numChar_ = 16;
-			at.rep_.name_ = objectIdAtt;
-			at.rep_.isPrimaryKey_ = true;
-			attList.push_back(at);
-			autoIndex = true;
-		}
-	}
-	if (autoIndex)
-    {
-		linkCol = attList.size()-1;
-		indexOffset = layer->getNewObjectId();
-    }
-
-	TeTable attTable (attrTableName,attList,objectIdAtt,objectIdAtt,TeAttrStatic);
-
-	string objid, value;
-	TePointSet points;
-	TeLineSet lines;
-	TePolygonSet polygons;
-	TeTableRow row;
-	SHPObject* psShape;
-
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(nEntities);
-		TeProgress::instance()->setProgress(j+1);
-	}
-
-	// OBS1: we discard Z and M values when available, because TerraLib
-	// doesn�t have the concept of 3D or measured geometries
-	// OBS2: non identified geometries are mapped to a object_id_
-	// "te_nulo"
-	switch (nShapeType) 
-	{
-		// --- null geometries ---
-	  case SHPT_NULL:							// read only the attributes
-		for (j=0; j<(unsigned int)nEntities; j++)
-		{
-		  row.clear();
-		  TeDBFRowDecode(hDBF,j,row);
-		  if (autoIndex)	// --- create automatic index if needed
-			  row.push_back(Te2String(j + indexOffset));
-		  if (row[linkCol].empty())
-			 row[linkCol] = "te_nulo";
-		  objid = row[linkCol];
-
-		  if ((j%chunkSize) == 0)
-		  {
-			  if(TeProgress::instance())
-			  {
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(j+1);
-			  }	
-		  }
-		}
-		break;
-		// --- point geometries ---
-	  case SHPT_POINTZ:	
-	  case SHPT_MULTIPOINTZ:
-	  case SHPT_POINTM:
-	  case SHPT_MULTIPOINTM:
-	  case SHPT_POINT:
-	  case SHPT_MULTIPOINT:
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-				  row.push_back(Te2String(j + indexOffset));
-			  if (row[linkCol].empty())
-				 row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-
-			  psShape = SHPReadObject(hSHP,j);
-
-			  TeSHPPointDecode(psShape,points,objid);
-     		  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-				  if (!layer->addPoints(points))
-				  {
-					  SHPClose(hSHP);
-					  layer->database()->rollbackTransaction(); 
-					  return false;
-				  }
-				  points.clear();
-
-				  if(TeProgress::instance())
-				  {
-					  if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }	
-			  }
-		  }
-		  break;
-		// --- line geometries ---
-	  case SHPT_ARCZ:
-	  case SHPT_ARCM:
-	  case SHPT_ARC:
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-				  row.push_back(Te2String(j + indexOffset));
-			  if (row[linkCol].empty())
-				 row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-
-			  psShape = SHPReadObject(hSHP,j);
-
-			  TeSHPPolyLineDecode(psShape,lines,objid);
-		  
-			  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-				  if (!layer->addLines(lines))
-				  {
-					  SHPClose(hSHP);
-					  layer->database()->rollbackTransaction(); 
-					  return false;
-				  }
-				  lines.clear();
-
-				  if(TeProgress::instance())
-				  {
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }	
-			  }
-		  }
-		  break;
-	// --- polygon geometries ---
-	  case SHPT_POLYGON:
-	  case SHPT_POLYGONM:
-	  case SHPT_POLYGONZ:
-
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-			    row.push_back(Te2String(j + indexOffset));
-			  if (row[linkCol].empty())
-				  row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-			  
-			  psShape = SHPReadObject(hSHP,j);
-
-			  TeSHPPolygonDecode(psShape,polygons,objid);
-
-			  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-
-				  if (!layer->addPolygons(polygons))
-				  {
-					  SHPClose(hSHP);
-					  layer->database()->rollbackTransaction(); 
-					  return false;
-				  }
-
-				  polygons.clear();
-
-				  if(TeProgress::instance())
-				  {
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }
-			  }
-
-		  }
-		  break;
-	  default:
-		  // todo: handle multipatch geometries 
-		  throw TeException ( UNHANDLED_SHP_TYPE );
-	}
-	if (points.size() > 0)
-	{
-		if (!layer->addPoints(points))
-		{
-			SHPClose(hSHP);
-			layer->database()->rollbackTransaction(); 
-			return false;
-		}
-
-		points.clear();
-	}
-	if (lines.size() > 0)
-	{
-		if (!layer->addLines(lines))
-		{
-			SHPClose(hSHP);
-			layer->database()->rollbackTransaction();
-			return false;
-		}
-
-		lines.clear();
-	}
-	if (polygons.size() > 0)
-	{
-		if (!layer->addPolygons(polygons))
-		{
-			SHPClose(hSHP);
-			layer->database()->rollbackTransaction();
-			return false;
-		}
-		polygons.clear();
-	}
-	if(TeProgress::instance())
-		TeProgress::instance()->cancel();
-
-	SHPClose(hSHP);
-
-	if (!layer->database()->commitTransaction())
-		return false;
-
-	return true;
-}
-
-DBFHandle TeCreateDBFFile (const string& dbfFilename, TeAttributeList& attList)
-{
-	DBFHandle hDBF = DBFCreate( dbfFilename.c_str() );
-	if( hDBF == 0 )
-		return 0;
-	
-	int i =0;
-	TeAttributeList::iterator it=attList.begin();
-
-	while ( it != attList.end() )
-	{
-		TeAttribute at = (*it);
-		string atName = at.rep_.name_;
-
-		if (atName.size() > 10)
-		{
-			int extra = (int)(atName.size() - 10)/2;
-			int middle = (int)(atName.size()/2);
-			string str = atName.substr(0,middle-extra-1);
-			str += atName.substr(middle+extra);
-			atName = str;
-		}
-		if (at.rep_.type_ == TeSTRING )
-		{
-			if (DBFAddField( hDBF, atName.c_str(), FTString, at.rep_.numChar_, 0 ) == -1 )
-				return 0;
-		}
-		else if (at.rep_.type_ == TeINT)
-		{
-			if (DBFAddField( hDBF, atName.c_str(), FTInteger, 32, 0 ) == -1 )
-				return 0;
-		}
-		else if (at.rep_.type_ == TeREAL)
-		{
-			if (DBFAddField( hDBF, atName.c_str(), FTDouble, 40, 15 ) == -1 )
-				return 0;
-		}
-		// OBS: shapelib doesn�t deal with xBase field type for Date 
-		// we are transforming it to string
-		else if (at.rep_.type_ == TeDATETIME)
-		{
-			if (DBFAddField( hDBF, atName.c_str(), FTDate, 8, 0 ) == -1 )
-				return 0;
-		}
-		++i;
-		++it;
-	}
-	return hDBF;
-}
-
-bool TeExportPolygonSet2SHP( const TePolygonSet& ps,const std::string& base_file_name  )
-{
-    // creating files names
-    std::string dbfFilename = base_file_name + ".dbf";
-    std::string shpFilename = base_file_name + ".shp";
-
-    // creating polygons attribute list ( max attribute size == 25 )
-    TeAttributeList attList;
-    TeAttribute at;
-    at.rep_.type_ = TeSTRING;               //the id of the cell
-    at.rep_.numChar_ = 25;
-    at.rep_.name_ = "object_id_";
-    at.rep_.isPrimaryKey_ = true;
-	attList.push_back(at);
-    
-    /* DBF output file handle creation */
-	DBFHandle hDBF = TeCreateDBFFile (dbfFilename, attList);
-	if ( hDBF == 0 )
-		return false;
-    
-    /* SHP output file handle creation */
-    SHPHandle hSHP = SHPCreate( shpFilename.c_str(), SHPT_POLYGON );
-    if( hSHP == 0 ) 
-	{
-      DBFClose( hDBF );
-      return false;
-    }
-    
-    /* Writing polygons */
-    int iRecord = 0;
-    int totpoints = 0;
-    double  *padfX, *padfY;
-    SHPObject       *psObject;
-    int posXY, npoints, nelem;
-    int nVertices;
-    int* panParts;
-
-    TePolygonSet::iterator itps;
-    TePolygon poly;
-
-    for (itps = ps.begin() ; itps != ps.end() ; itps++ ) {
-      poly=(*itps);
-      totpoints = 0;
-      nVertices = poly.size();
-      for (unsigned int n=0; n<poly.size();n++) {
-        totpoints += poly[n].size();
-      }
-
-      panParts = (int *) malloc(sizeof(int) * nVertices);
-      padfX = (double *) malloc(sizeof(double) * totpoints);
-      padfY = (double *) malloc(sizeof(double) * totpoints);
-      posXY = 0;
-      nelem = 0;
-      
-      for (unsigned int l=0; l<poly.size(); ++l) {
-        if (l==0) {
-          if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) {
-            TeReverseLine(poly[l]);
-          }
-        } else {
-          if (TeOrientation(poly[l]) == TeCLOCKWISE) {
-            TeReverseLine(poly[l]);
-          }
-        }
-        
-        npoints = poly[l].size();
-        panParts[nelem]=posXY;
-        
-        for (int m=0; m<npoints; m++ ) {
-          padfX[posXY] = poly[l][m].x_;
-          padfY[posXY] = poly[l][m].y_;
-          posXY++;
-        }
-        nelem++;
-      }
-                
-      psObject = SHPCreateObject( SHPT_POLYGON, -1, nelem, panParts, NULL,
-        posXY, padfX, padfY, NULL, NULL );
-        
-      int shpRes = SHPWriteObject( hSHP, -1, psObject );
-      if (shpRes == -1 )
-	  {
-	      DBFClose( hDBF );
-		  SHPClose( hSHP );
-		  return false;
-	  }
-        
-      SHPDestroyObject( psObject );
-      free( panParts );
-      free( padfX );
-      free( padfY );
-
-      // writing attributes - same creation order
-      DBFWriteStringAttribute(hDBF, iRecord, 0, poly.objectId().c_str() );
-            
-      iRecord++;
-    }
-    
-    DBFClose( hDBF );
-    SHPClose( hSHP );
-    return true;  
-}
-
-
-bool
-TeExportQuerierToShapefile(TeQuerier* querier, const std::string& base)
-{
-	// check initial conditions
-	if (!querier)
-		return false;
-
-	if (!querier->loadInstances())
-		return false;
-
-	// Get the list of attributes defined by the input querier
-	bool onlyObjId = false;
-	TeAttributeList qAttList = querier->getAttrList();
-	if (qAttList.empty())
-	{
-		TeAttributeList qAttList;
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;               
-		at.rep_.numChar_ = 100;
-		at.rep_.name_ = "ID";
-		at.rep_.isPrimaryKey_ = true;
-		qAttList.push_back(at);
-		onlyObjId = true;
-	}
-
-	// Handles to each type of geometries that will be created if necessary
-	DBFHandle hDBFPol = 0;
-	SHPHandle hSHPPol = 0;
-	DBFHandle hDBFLin = 0;
-	SHPHandle hSHPLin = 0;
-	DBFHandle hDBFPt = 0;
-	SHPHandle hSHPPt = 0;
-
-	// Some auxiliary variables
-    int totpoints;
-    double*	padfX;
-	double*	padfY;
-    unsigned int nVertices;
-    int* panPart;
-    SHPObject *psObject;
-    unsigned int posXY, npoints, nelem;
-	int shpRes;
-
-	// progress information
-	if (TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-	int dt = CLOCKS_PER_SEC/2;
-	int dt2 = CLOCKS_PER_SEC; //* .000001;
-
-	// Loop through the instances writting their geometries and attributes
-	unsigned int iRecPol=0, iRecLin=0, iRecPt=0;
-	unsigned int n, l, m;
-	unsigned int nIProcessed = 0;
-	TeSTInstance st;
-	while(querier->fetchInstance(st))
-	{
-		totpoints = 0;
-		nVertices = 0;
-		if (st.hasPolygons())
-		{
-			TePolygonSet& polSet = st.getPolygons();
-			TePolygonSet::iterator itps;
-			int nVerticesCount = 0;
-			for (itps = polSet.begin(); itps != polSet.end(); ++itps) 
-			{
-				nVertices = (*itps).size();
-				nVerticesCount += nVertices;
-				for (n=0; n<nVertices;++n) 
-					totpoints += (*itps)[n].size();
-			}
-
-			panPart = (int *) malloc(sizeof(int) * nVerticesCount);
-			padfX = (double *) malloc(sizeof(double) * totpoints);
-			padfY = (double *) malloc(sizeof(double) * totpoints);
-
-			posXY = 0;
-			nelem = 0;
-			for (itps = polSet.begin(); itps != polSet.end(); ++itps) 
-			{
-				TePolygon poly = *itps;
-				for (l=0; l<poly.size(); ++l) 
-				{
-					if (l==0) 
-					{
-						if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) 
-							TeReverseLine(poly[l]);
-					}
-					else 
-					{
-						if (TeOrientation(poly[l]) == TeCLOCKWISE)
-							TeReverseLine(poly[l]);
-					}
-					npoints = poly[l].size();
-					panPart[nelem]=posXY;
-        
-					for (m=0; m<npoints; ++m) 
-					{
-						padfX[posXY] = poly[l][m].x_;
-						padfY[posXY] = poly[l][m].y_;
-						posXY++;
-					}
-					nelem++;
-				}
-			}
-			psObject = SHPCreateObject(SHPT_POLYGON, -1, nelem, panPart, NULL, posXY, padfX, padfY, NULL, NULL);
-			if (hSHPPol == 0)
-			{
-				string fname = base + "_pol.shp";
-				hSHPPol = SHPCreate(fname.c_str(), SHPT_POLYGON);
-   				assert (hSHPPol != 0);
-			}	
-			shpRes = SHPWriteObject(hSHPPol, -1, psObject);
-			SHPDestroyObject(psObject);
-			free(panPart);
-			free(padfX);
-			free(padfY);
-			assert(shpRes != -1);   
-			if (hDBFPol == 0)
-			{
-				hDBFPol = TeCreateDBFFile(base + "_pol.dbf", qAttList);
-				assert (hDBFPol != 0);
-			}
-			if (onlyObjId)
-			{
-				DBFWriteStringAttribute(hDBFPol, iRecPol, 0, st.objectId().c_str());
-			}
-			else
-			{
-				string val;
-				for (n=0; n<qAttList.size();++n) 
-				{
-					st.getPropertyValue(val,n);
-					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
-					{
-						DBFWriteStringAttribute(hDBFPol, iRecPol, n, val.c_str());
-					}
-					else if (qAttList[n].rep_.type_ == TeINT)
-					{
-						DBFWriteIntegerAttribute(hDBFPol, iRecPol, n, atoi(val.c_str()));
-					}
-					else if (qAttList[n].rep_.type_ == TeREAL)
-					{
-						DBFWriteDoubleAttribute(hDBFPol, iRecPol, n, atof(val.c_str()));
-					}
-				}
-			}
-			++iRecPol;
-		}
-		if (st.hasCells())
-		{
-			TeCellSet& cellSet = st.getCells();
-			nVertices = cellSet.size();
-			totpoints = nVertices*5;
-			panPart = (int *) malloc(sizeof(int) * nVertices);
-			padfX = (double *) malloc(sizeof(double) * totpoints);
-			padfY = (double *) malloc(sizeof(double) * totpoints);
-			posXY = 0;
-			nelem = 0;
-			TeCellSet::iterator itcs;
-			for (itcs=cellSet.begin(); itcs!=cellSet.end(); ++itcs)
-			{
-				panPart[nelem]=posXY;
-				padfX[posXY] = (*itcs).box().lowerLeft().x();
-				padfY[posXY] = (*itcs).box().lowerLeft().y();
-				posXY++;		
-				padfX[posXY] = (*itcs).box().upperRight().x();
-				padfY[posXY] = (*itcs).box().lowerLeft().y();
-				posXY++;		
-				padfX[posXY] = (*itcs).box().upperRight().x();
-				padfY[posXY] = (*itcs).box().upperRight().y();
-				posXY++;		
-				padfX[posXY] = (*itcs).box().lowerLeft().x();
-				padfY[posXY] = (*itcs).box().upperRight().y();
-				posXY++;		
-				padfX[posXY] = (*itcs).box().lowerLeft().x();
-				padfY[posXY] = (*itcs).box().lowerLeft().y();
-				++posXY;	
-				++nelem;
-			} 
-			psObject = SHPCreateObject(SHPT_POLYGON, -1, nelem, panPart, NULL,posXY, padfX, padfY, NULL, NULL);
-			if (hSHPPol == 0)
-			{
-				string fname = base + "_pol.shp";
-				hSHPPol = SHPCreate(fname.c_str(), SHPT_POLYGON);
-   				assert (hSHPPol != 0);
-			}	
-			shpRes = SHPWriteObject(hSHPPol, -1, psObject);
-			SHPDestroyObject(psObject);
-			free(panPart);
-			free(padfX);
-			free(padfY);
-			assert(shpRes != -1);
-			if (hDBFPol == 0)
-			{
-				hDBFPol = TeCreateDBFFile(base + "_pol.dbf", qAttList);
-				assert (hDBFPol != 0);
-			}
-
-			if (onlyObjId)
-			{
-				DBFWriteStringAttribute(hDBFPol, iRecPol, 0, st.objectId().c_str());
-			}
-			else
-			{
-				string val;
-				for (n=0; n<qAttList.size();++n) 
-				{
-					st.getPropertyValue(val,n);
-					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
-					{
-						DBFWriteStringAttribute(hDBFPol, iRecPol, n, val.c_str());
-					}
-					else if (qAttList[n].rep_.type_ == TeINT)
-					{
-						DBFWriteIntegerAttribute(hDBFPol, iRecPol, n, atoi(val.c_str()));
-					}
-					else if (qAttList[n].rep_.type_ == TeREAL)
-					{
-						DBFWriteDoubleAttribute(hDBFPol, iRecPol, n, atof(val.c_str()));
-					}
-				}
-			}
-			++iRecPol;
-		}
-		if (st.hasLines())
-		{
-			TeLineSet& lineSet = st.getLines();
-			nVertices = lineSet.size();
-			TeLineSet::iterator itls;
-			for (itls=lineSet.begin(); itls!=lineSet.end(); ++itls)
-				totpoints += (*itls).size();
-			panPart = (int *) malloc(sizeof(int) * nVertices);
-			padfX = (double *) malloc(sizeof(double) * totpoints);
-			padfY = (double *) malloc(sizeof(double) * totpoints);
-			posXY = 0;
-			nelem = 0;
-			for (itls=lineSet.begin(); itls!=lineSet.end(); ++itls)
-			{
-				panPart[nelem]=posXY;
-				for (l=0; l<(*itls).size(); ++l)
-				{
-					padfX[posXY] = (*itls)[l].x();
-					padfY[posXY] = (*itls)[l].y();
-					++posXY;
-				}
-				++nelem;
-			}
-			psObject = SHPCreateObject(SHPT_ARC, -1, nVertices, panPart, NULL,	posXY, padfX, padfY, NULL, NULL);
-			if (hSHPLin == 0)
-			{
-				string fname = base + "_lin.shp"; 
-				hSHPLin = SHPCreate(fname.c_str(), SHPT_ARC);
-   				assert (hSHPLin != 0);
-			}		
-			shpRes = SHPWriteObject(hSHPLin, -1, psObject);
-			SHPDestroyObject(psObject);
-			free(panPart);
-			free(padfX);
-			free(padfY);
-			assert(shpRes != -1);
-			if (hDBFLin == 0)
-			{
-				hDBFLin = TeCreateDBFFile(base + "_lin.dbf", qAttList);
-				assert (hDBFLin != 0);
-			}
-			if (onlyObjId)
-			{
-				DBFWriteStringAttribute(hDBFLin, iRecLin, 0, st.objectId().c_str());
-			}
-			else
-			{
-				string val;
-				for (n=0; n<qAttList.size();++n) 
-				{
-					st.getPropertyValue(val,n);
-					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
-					{
-						DBFWriteStringAttribute(hDBFLin, iRecLin, n, val.c_str());
-					}
-					else if (qAttList[n].rep_.type_ == TeINT)
-					{
-						DBFWriteIntegerAttribute(hDBFLin, iRecLin, n, atoi(val.c_str()));
-					}
-					else if (qAttList[n].rep_.type_ == TeREAL)
-					{
-						DBFWriteDoubleAttribute(hDBFLin, iRecLin, n, atof(val.c_str()));
-					}
-				}
-			}
-			++iRecLin;
-		}
-		if (st.hasPoints())
-		{
-			TePointSet& pointSet = st.getPoints();
-			nVertices = pointSet.size();
-			panPart = (int *) malloc(sizeof(int) * nVertices);
-			padfX = (double *) malloc(sizeof(double) * nVertices);
-			padfY = (double *) malloc(sizeof(double) * nVertices);
-			nelem = 0;
-			TePointSet::iterator itpts;
-			for (itpts=pointSet.begin(); itpts!=pointSet.end(); ++itpts)
-			{
-				panPart[nelem] = nelem;
-				padfX[nelem] = (*itpts).location().x();
-				padfY[nelem] = (*itpts).location().y();
-				++nelem;
-			}
-			psObject = SHPCreateObject(SHPT_POINT, -1, nVertices, panPart, NULL, nVertices, padfX, padfY, NULL, NULL );
-			if (hSHPPt == 0)
-			{
-				string fname = base + "_pt.shp";
-				hSHPPt = SHPCreate(fname.c_str(), SHPT_POINT);
-   				assert (hSHPPt != 0);
-			}		
-			shpRes = SHPWriteObject(hSHPPt, -1, psObject);
-			SHPDestroyObject(psObject);
-			free(panPart);
-			free(padfX);
-			free(padfY);
-			assert(shpRes != -1);
-			if (hDBFPt == 0)
-			{
-				hDBFPt = TeCreateDBFFile(base + "_pt.dbf", qAttList);
-				assert (hDBFPt != 0);
-			}
-			if (onlyObjId)
-			{
-				DBFWriteStringAttribute(hDBFPt, iRecPt, 0, st.objectId().c_str());
-			}
-			else
-			{
-				string val;
-				for (n=0; n<qAttList.size();++n) 
-				{
-					st.getPropertyValue(val,n);
-						if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
-					{
-						DBFWriteStringAttribute(hDBFPt, iRecPt, n, val.c_str());
-					}
-					else if (qAttList[n].rep_.type_ == TeINT)
-					{
-						DBFWriteIntegerAttribute(hDBFPt, iRecPt, n, atoi(val.c_str()));
-					}
-					else if (qAttList[n].rep_.type_ == TeREAL)
-					{
-						DBFWriteDoubleAttribute(hDBFPt, iRecPt, n, atof(val.c_str()));
-					}
-				}
-			}
-			++iRecPt;
-		}
-		++nIProcessed;
-		if (TeProgress::instance() && int(t2-t1) > dt)
-		{
-			t1 = t2;
-			if(((int)(t2-t0) > dt2))
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(nIProcessed);
-			}
-		}
-
-	}
-	if (hDBFPol != 0)
-		DBFClose(hDBFPol);
-	if (hSHPPol != 0)
-        SHPClose(hSHPPol);
-	if (hDBFLin != 0)
-		DBFClose(hDBFLin);
-	if (hSHPLin != 0)
-        SHPClose(hSHPLin);
-	if (hDBFPt != 0)
-		DBFClose(hDBFPt);
-	if (hSHPPt != 0)
-        SHPClose(hSHPPt);
-
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-
-bool
-TeExportShapefile(TeLayer* layer, const string& shpFileName, const string& tableName, const string& restriction)
-{
-  	if (!layer || shpFileName.empty())
-		return false;
-
-	// check if asked table exist
-	TeAttrTableVector& vTables = layer->attrTables();
-	TeAttrTableVector::iterator it = vTables.begin();
-	while (it != vTables.end())
-	{
-		if (it->name() == tableName) 
-			break;
-		++it;
-	}
-	if (it == vTables.end())
-		return false;
-	TeAttrTableVector askedTable;
-	askedTable.push_back(*it);
-
-	TeTheme* tempTheme = new TeTheme();
-	tempTheme->attributeRest(restriction);
-	tempTheme->layer(layer);
-	tempTheme->collectionTable("");
-	tempTheme->collectionAuxTable("");
-	tempTheme->setAttTables(askedTable);
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(tempTheme);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToShapefile(tQuerier, shpFileName);
-	delete tQuerier;
-	delete tempTheme;
-    return res ;
-}
-
-bool 
-TeExportLayerToShapefile(TeLayer* layer, const string& baseName)
-{
-  	if (!layer)
-		return false;
-
-	string fbase = baseName;
-	if (baseName.empty())
-		fbase = layer->name();
-
-	TeTheme* tempTheme = new TeTheme();
-	tempTheme->layer(layer);
-	tempTheme->collectionTable("");
-	tempTheme->collectionAuxTable("");
-	tempTheme->setAttTables(layer->attrTables());
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(tempTheme);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToShapefile(tQuerier, baseName);
-	delete tQuerier;
-	delete tempTheme;
-    return res ;
-}
-
-
-bool 
-TeExportThemeToShapefile(TeTheme* theme, TeSelectedObjects selOb, const std::string& baseName)
-{
-	if (!theme)
-		return false;
-
-	string fbase = baseName;
-	if (baseName.empty())
-		fbase = theme->name();
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(theme);
-	qPar.setSelecetObjs(selOb);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToShapefile(tQuerier, fbase);
-	delete tQuerier;
-	return res;
-}
-
-void TeDBFRowDecode(DBFHandle& hDBF, int nr, TeTableRow& row)
-{
-	string value;
-	int i;
-	for (i = 0; i < DBFGetFieldCount(hDBF); i++)
-	{
-		value =  DBFReadStringAttribute(hDBF,nr,i);
-		row.push_back(value); 
-	}
-}
-
-bool TeDecodeShape(SHPObject* psShape, TeMultiGeometry& geomestries, string& objectId)
-{
-	int shpType = psShape->nSHPType;
-	switch (shpType)
-	{
-		case SHPT_POLYGON:
-		case SHPT_POLYGONZ:
-			TeSHPPolygonDecode(psShape,geomestries.polygons_,objectId);
-			return true;
-		case SHPT_ARC:
-		case SHPT_ARCZ:
-			TeSHPPolyLineDecode(psShape,geomestries.lines_,objectId);
-			return true;
-		case SHPT_POINT:
-		case SHPT_POINTZ:
-		case SHPT_MULTIPOINT:
-		case SHPT_MULTIPOINTZ:
-			TeSHPPointDecode(psShape,geomestries.points_,objectId);
-			return true;
-	}
-	return false;
-}
-
-void TeSHPPointDecode(SHPObject* psShape, TePointSet& points, string& objid)
-{
-	int nv = psShape->nVertices;
-	for (int i = 0; i<nv; i++)
-	{
-		TePoint point(psShape->padfX[i], psShape->padfY[i]);
-		point.objectId(objid);
-		points.add(point);
-	}
-}
-
-
-void TeSHPPolyLineDecode(SHPObject* psShape, TeLineSet& lines, string& objid)
-{
-	int iPart,j=0,nextStart=0; 
-	for (iPart = 0; iPart < psShape->nParts; iPart++)
-	{
-		if (iPart == psShape->nParts-1)
-			nextStart = psShape->nVertices;
-		else 
-			nextStart = psShape->panPartStart[iPart+1];
-
-		TeLine2D line;
-		while (j<nextStart)
-		{
-			TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
-			line.add ( pt );
-			j++;
-		}
-		line.objectId (objid);	
-		lines.add ( line );
-	}
-}
-
-void
-TeSHPPolygonDecode(SHPObject* psShape, TePolygonSet& polys, string& objid)
-{
-	int iPart = 0;
-	vector<int> partStart;
-
-	// Build an array whose components point to the starting point
-	// of the rings that compose the polygon shape
-	for ( iPart = 0; iPart < psShape->nParts; iPart++ )
-		partStart.push_back ( psShape->panPartStart[iPart] );
-	partStart.push_back ( psShape->nVertices ); // point to the end
-
-	vector<TePolygon> pList;
-	vector<TeLinearRing> holes;
-	int j = 0;
-	iPart = 0;
-	while (j < psShape->nVertices)
-	{
-		TeLine2D line;
-		iPart++;						// while it doesn�t reach the start of next part
-		while ( j < partStart[iPart] )	// build a line from the coordinates
-		{
-			TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
-			line.add ( pt );
-			j++;
-		}								
-		if (!line.isRing())				// force the closing of opened rings
-			line.add(line[0]);
-
-		// decide if a ring is an outter ring or an inner ring based on its orientation
-		TeLinearRing ring(line);
-		short orient = TeOrientation(ring);
-		if(orient == TeCLOCKWISE)	// outter ring: start a new polygon
-		{
-			TePolygon p;
-			p.add(ring);
-			p.objectId(objid);
-			pList.push_back(p);
-		}
-		else	// COUNTERCLOCKWISE => inner ring: put on the list of holes
-			holes.push_back(ring);
-	} // read all vertices
-
-
-	// even though there are rings that are in counter clockwise orientation, 
-	// there aren't any clockwise orientation rings to be possible parents of 
-	// these inner rings. The decision here: treat all of them as outter rings...
-	if (pList.empty() && !holes.empty())
-	{
-		for (unsigned int i=0; i<holes.size(); ++i)
-		{
-			TePolygon p;
-			p.add(holes[i]);
-			p.objectId(objid);
-			polys.add(p);
-		}
-		return;
-	}
-
-	if (pList.size() == 1)	// shape has only one polygon that should
-	{						// contain all the inner rings
-		for(unsigned int i = 0; i < holes.size(); ++i)
-			pList[0].add(holes[i]);
-	}
-	else
-	{	// shape has multiple outter ring and inner rings
-		// we have to find a parent to each inner ring 
-		for(unsigned int i = 0; i < holes.size(); ++i)
-		{
-			vector<TePolygon> candidates;
-			TeLinearRing ring = holes[i];
-			
-			// step 1: consider as a inner ring parent candidate every polygon 
-			// that intercepts the ring MBR
-			unsigned int j = 0;
-			for(j = 0; j < pList.size(); ++j)
-			{
-				if(TeWithinOrCoveredByOrEquals(ring.box(), pList[j].box()))
-					candidates.push_back(pList[j]);
-			}
-
-			// if there is only one candidate this is the parent
-			if(candidates.size() == 1)
-			{
-				candidates[0].add(ring);
-				continue;
-			}
-
-			// step 2: refine the candidates to parent: consider only those 
-			// that contains the ring (not just its MBR)
-			vector<TePolygon> newCandidates;
-			for(j = 0; j < candidates.size(); ++j)
-			{
-				short rel = TeBOUNDARY;
-				bool inside = false;
-
-				unsigned int nthVert = ring.size();
-				unsigned int iVert = 0u;
-
-				while(iVert < nthVert)
-				{
-					rel = TeRelation(ring[iVert], candidates[j][0]);
-
-					if(rel & TeINSIDE)
-					{
-						inside = true;
-						newCandidates.push_back(candidates[j]);
-						break;
-					}
-					else if(rel & TeOUTSIDE)
-						break;
-					++iVert;
-				}
-
-				if(iVert == nthVert)	
-					break;
-			}
-			
-			// sort the new candidates according to their areas
-			int idxMinArea = 0;
-			double minArea = TeMAXFLOAT;
-			for(j = 0; j < newCandidates.size(); ++j)
-			{
-				if(TeGeometryArea(newCandidates[j].box()) < minArea)
-				{
-					idxMinArea = j;
-					minArea = TeGeometryArea(newCandidates[j].box());
-				}
-			}
-			// choose as parent the candidate that has the smaller area
-			if (!newCandidates.empty())
-				newCandidates[idxMinArea].add(ring);
-		}
-	}
-
-	// add polygons to the list passed as parameter
-	vector<TePolygon>::iterator it = pList.begin();
-	while (it != pList.end())
-	{
-		polys.add(*it);
-		++it;
-	}
-}
-
-//! Fills a vector with the values of choosen column named , to be used as object identifications
-/*!
-	\param dbfFileName DBF file name
-	\param indexes a vector that has the identification of the objects
-	\param objectIdAttr name of the attribute that has the identification of objects
-	\note if no objectIdAttr is provided or there is no column with this name return
-	an incremental sequence of numbers.
-*/
-void TeReadDBFIndexes(const string& dbfFileName, vector<string>& indexes, const string objectIdAttr="");
-
-
-bool TeReadDBFAttributeList ( const string& dbfFileName, TeAttributeList& attList )
-{
-	string filePrefix = TeGetName (dbfFileName.c_str()) ;
-	string fileName = filePrefix + ".dbf";
-
-/* -------------------------------------------------------------------- */
-/*      Open the file.                                                  */
-/* -------------------------------------------------------------------- */
-    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
-    if( hDBF == NULL )
-    {
-			throw TeException ( UNABLE_TO_OPEN_DBF_FILE );
-    }
-    
-/* -------------------------------------------------------------------- */
-/*	If there is no data in this file let the user know.		*/
-/* -------------------------------------------------------------------- */
-    if( DBFGetFieldCount(hDBF) == 0 )
-    {
-			throw TeException ( NO_DATA_IN_DBF_FILE );
-    }
-
-/* -------------------------------------------------------------------- */
-/*	Get Attributes header definitions.									*/
-/* -------------------------------------------------------------------- */
-	TeAttribute attribute;
-    
-	char	szTitle[12];
-	int		nWidth, nDecimals;
-	int 	i;
-
-	vector<string> names;
-
-	for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
-    {
-		DBFFieldType	eType = DBFGetFieldInfo( hDBF, i, szTitle, &nWidth, &nDecimals );
-
-		string atname = TeConvertToUpperCase(szTitle);
-	
-		vector<string>::iterator it = find(names.begin(),names.end(),atname);
-		if (it != names.end())
-		{
-			string newname = atname + "_" + Te2String(i);
-			int c = i+1;
-			while (true)
-			{
-				it = find(names.begin(),names.end(),newname);
-				if (it == names.end())
-					break;
-				newname = atname + "_" + Te2String(c);
-				++c;
-			}
-			atname = newname;
-		}
-		names.push_back(atname);
-		attribute.rep_.name_ = atname;
-
-        if( eType == FTDate )
-		{
-			attribute.rep_.type_     = TeDATETIME;
-			attribute.dateChronon_   = TeDAY;
-			attribute.dateTimeFormat_ = "YYYYMMDD";
-			attribute.dateSeparator_ = 'c';
-		}
-        else if( eType == FTString )
-		{
-			attribute.rep_.type_     = TeSTRING;
-			attribute.rep_.numChar_  = nWidth;
-		}
-		else if( eType == FTInteger )
-		{
-			if (nWidth > 9)
-			{
-				attribute.rep_.type_ = TeREAL;
-				attribute.rep_.numChar_ = nWidth;
-				attribute.rep_.decimals_ = 0;
-			}
-			else
-			{
-				attribute.rep_.type_ = TeINT;
-				attribute.rep_.numChar_ = nWidth;
-			}
-		}
-        else if( eType == FTDouble )
-		{
-            attribute.rep_.type_ = TeREAL;
-			attribute.rep_.numChar_ = nWidth;
-			attribute.rep_.decimals_ = nDecimals;
-		}
-
-		// keep track of the index name
-
-		attList.push_back ( attribute );
-    }
-	names.clear();
-    DBFClose( hDBF );
-	return true;
-}
-
-
-bool TeImportDBFTable(const string& dbFileName,TeDatabase* db, TeLayer* layer,TeAttrTableType tableType, string objectIdAtt)
-{
-	if (!db || dbFileName.empty())
-		return false;
-
-    DBFHandle hDBF = DBFOpen(dbFileName.c_str(), "rb" );
-    if( hDBF == NULL )
-		return false;
-
-	string tabName = TeGetBaseName(dbFileName.c_str());
-	int n=0;
-	while (db->tableExist(tabName))
-	{
-		tabName = TeGetBaseName(dbFileName.c_str()) + "_" + Te2String(n);
-		n++;
-	}
-	TeAttributeList attList;
-	TeReadDBFAttributeList (dbFileName, attList);
-
-	if (objectIdAtt.empty())
-		objectIdAtt = "object_id_";
-
-	// check if object id column is already in the list
-	unsigned int j;
-	for (j=0; j<attList.size(); j++)
-	{
-		if ( TeConvertToUpperCase(objectIdAtt) ==  TeConvertToUpperCase(attList[j].rep_.name_))
-		{
-			objectIdAtt = TeConvertToUpperCase(attList[j].rep_.name_);
-			attList[j].rep_.name_ =  objectIdAtt;
-			if (attList[j].rep_.type_ != TeSTRING)
-			{
-				attList[j].rep_.type_ = TeSTRING;
-				attList[j].rep_.numChar_ = 255;
-			}
-			attList[j].rep_.isPrimaryKey_ = true;
-			break;
-		}
-	}
-
-	// if not found create one automatically
-	bool createObjId = false;
-	if (j==attList.size())
-	{
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;
-		at.rep_.numChar_ = 16;
-		at.rep_.name_ = objectIdAtt;
-		at.rep_.isPrimaryKey_ = true;
-		attList.push_back(at);
-		createObjId = true;
-	}
-
-	if (!db->createTable(tabName,attList))
-	{
-	    DBFClose(hDBF);
-		return false;
-	}
-
-	TeTable table(tabName);
-	table.setAttributeList(attList);
-	table.setUniqueName(objectIdAtt);
-	if (layer)
-		table.setTableType(tableType);
-	else
-		table.setTableType(TeAttrExternal);
-
-	int nrec = DBFGetRecordCount(hDBF);
-	if (TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(nrec);
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-	int iRecord;
-	for (iRecord = 0; iRecord < nrec; iRecord++)
-    {
-		TeTableRow row;
-		int i;
-		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
-		{
-			string value =  DBFReadStringAttribute(hDBF, iRecord, i);
-			row.push_back ( value ); // inserts a value into the row
-		}
-		if (createObjId)
-			row.push_back(Te2String(iRecord));
-		table.add(row); 
-		if ((iRecord+1 % 100) == 0)
-		{
-			if (!db->insertTable(table))
-			{
-				DBFClose( hDBF );
-				table.clear();
-				if (TeProgress::instance())
-					TeProgress::instance()->reset();		
-				return false;
-			}
-			table.clear();
-			if (TeProgress::instance())
-			{
-				t2 = clock();
-				if (int(t2-t1) > dt)
-				{
-					t1 = t2;
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					if ((int)(t2-t0) > dt2)
-						TeProgress::instance()->setProgress(iRecord);
-				}
-			}
-		}
-    }
-	if (table.size() > 0)
-	{
-		db->insertTable(table);
-		table.clear();
-	}
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();		
-    DBFClose( hDBF );
-	if (iRecord == 0)
-		return false;
-	if (layer)
-		db->insertTableInfo(layer->id(),table);
-	else
-		db->insertTableInfo(0,table);
-
-	return true;
-}
-
-void TeReadSHPAttributes (const string& dbfFileName, TeTable& table)
-{
-	string filePrefix = TeGetName (dbfFileName.c_str()) ;
-	string fileName = filePrefix + ".dbf";
-
-/* -------------------------------------------------------------------- */
-/*	Get Attributes definitions.											*/
-/* -------------------------------------------------------------------- */
-	TeAttributeList attList;
-	TeReadDBFAttributeList ( fileName, attList );
-	table.setAttributeList( attList );
-
-/* -------------------------------------------------------------------- */
-/*      Open the file.                                                  */
-/* -------------------------------------------------------------------- */
-    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
-    if( hDBF == NULL )
-    {
-			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
-    }
-    
-/* -------------------------------------------------------------------- */
-/*	If there is no data in this file let the user know.		*/
-/* -------------------------------------------------------------------- */
-    if( DBFGetFieldCount(hDBF) == 0 )
-    {
-			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
-    }
-
-/* -------------------------------------------------------------------- */
-/*	Read all the records 						                        */
-/* -------------------------------------------------------------------- */
-	for( int iRecord = 0; iRecord < DBFGetRecordCount(hDBF); iRecord++ )
-    {
-		TeTableRow row;
-		int 	i;
-
-		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
-		{
-			string value =  DBFReadStringAttribute( hDBF, iRecord, i ) ;
-			row.push_back ( value ); // inserts a value into the row
-		}
-		table.add ( row ); // adds a row to a table
-    }
-    DBFClose( hDBF );
-}
-
-
-bool TeReadDBFAttributes (const string& dbfFileName, TeTable& table, 
-						  int nrecords, int rinitial, bool createAuto)
-{
-	string filePrefix = TeGetName (dbfFileName.c_str()) ;
-	string fileName = filePrefix + ".dbf";
-
-// -------------------------------------------------------------------- 
-//      Open the file.                                                  
-// -------------------------------------------------------------------- 
-    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
-    if( hDBF == NULL )
-    {
-			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
-    }
-    
-// -------------------------------------------------------------------- 
-//	If there is no data in this file let the user know.		
-// -------------------------------------------------------------------- 
-    if( DBFGetFieldCount(hDBF) == 0 )
-    {
-			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
-    }
-
-	if (rinitial >= DBFGetRecordCount(hDBF))
-		return false;
-
-	if (nrecords < 1 || nrecords > DBFGetRecordCount(hDBF))
-		nrecords = DBFGetRecordCount(hDBF);
-
-// -------------------------------------------------------------------- 
-//	Read all the records 						                        
-// -------------------------------------------------------------------- 
-	int count = 0;
-	for( int iRecord = rinitial; (iRecord < DBFGetRecordCount(hDBF) && count < nrecords); iRecord++ )
-    {
-		TeTableRow row;
-		int 	i;
-		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
-		{
-			string value =  DBFReadStringAttribute( hDBF, iRecord, i ) ;
-			row.push_back ( value ); // inserts a value into the row
-		}
-		
-		// if asked create a auto number extra column at the end
-		if (createAuto)
-			row.push_back(Te2String(iRecord));
-
-		table.add ( row ); // adds a row to a table
-		count++;
-    }
-    DBFClose( hDBF );
-	if (count > 0)
-		return true;
-	return false;
-}
-
-void
-TeImportDBFIndexes(const string& shpFileName, vector<string>& indexVect, const string objectIdAttr )
-{
-	string filePrefix = TeGetName(shpFileName.c_str());
-	string fileName = filePrefix + ".dbf";
-
-/* -------------------------------------------------------------------- */
-/*	Get index position.													*/
-/* -------------------------------------------------------------------- */
-	int i=0, indexPos=-1;
-
-	if (!objectIdAttr.empty())
-	{
-		TeAttributeList attList;
-		TeReadDBFAttributeList ( fileName, attList );
-		TeAttributeList::iterator it = attList.begin();
-		while ( it != attList.end() )
-		{
-			TeAttribute att = *it;
-			if (TeConvertToUpperCase(att.rep_.name_) == TeConvertToUpperCase(objectIdAttr))
-			{
-				indexPos = i;
-				break;
-			}
-			it++;
-			i++;
-		}
-	}
-
-/* -------------------------------------------------------------------- */
-/*      Open the file.                                                  */
-/* -------------------------------------------------------------------- */
-    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
-    if( hDBF == NULL )
-    {
-			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
-    }
-    
-/* -------------------------------------------------------------------- */
-/*	If there is no data in this file let the user know.		*/
-/* -------------------------------------------------------------------- */
-	int nRecords = DBFGetFieldCount(hDBF);
-    if( nRecords  == 0 )
-    {
-			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
-    }
-
-/* -------------------------------------------------------------------- */
-/*	Read all the records 						                        */
-/* -------------------------------------------------------------------- */
-    
-	for( int iRecord = 0; iRecord < nRecords; iRecord++ )
-	{
-		if (indexPos == -1)
-			indexVect.push_back (Te2String(iRecord+1)); 
-		else
-			indexVect.push_back ( DBFReadStringAttribute( hDBF, iRecord, indexPos ) );
-	}
-
-    DBFClose( hDBF );
-}
-
-TeShapefileDriver::TeShapefileDriver(std::string fileName):
-	hSHP_(0),
-	hDBF_(0)
-{
-	// check if format is complete (SHP, SHX e DBF files exist)
-	string filePrefix = TeGetName(fileName.c_str());
-
-	shpFileName_ = filePrefix + ".shp";
-	if (access(shpFileName_.c_str(),04) == -1)
-	{
-		shpFileName_ = filePrefix + ".SHP";
-		if (access(shpFileName_.c_str(),04) == -1)
-			return;
-	}
-	dbfFileName_ = filePrefix + ".dbf";
-	if (access(dbfFileName_.c_str(),04) == -1)
-	{
-		dbfFileName_ = filePrefix + ".DBF";
-		if (access(dbfFileName_.c_str(),04) == -1)
-			return;
-	}
-	string ftest = filePrefix + ".shx";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".SHX";
-		if (access(ftest.c_str(),04) == -1)
-			return;
-	}
-	hSHP_ = SHPOpen(shpFileName_.c_str(),"rb");
-	if (hSHP_==0)
-		return;
-
-    hDBF_ = DBFOpen(dbfFileName_.c_str(), "rb");
-    if (hDBF_==0)
-    {
-		SHPClose(hSHP_);
-		return ;
-    }
-}
-
-std::string
-TeShapefileDriver::getFileName()
-{
-	return shpFileName_;
-}
-
-TeShapefileDriver::~TeShapefileDriver()
-{
-	close();
-}
-
-bool
-TeShapefileDriver::isDataAccessible()
-{
-	return (hSHP_!=0 && hDBF_!=0);
-}
-
-TeProjection*
-TeShapefileDriver::getDataProjection()
-{
-	string filePrefix = TeGetName(shpFileName_.c_str());
-	string prjFileName_ = filePrefix + ".prj";
-	if (access(prjFileName_.c_str(),04) == -1)
-	{
-		prjFileName_ = filePrefix + ".PRJ";
-		if (access(prjFileName_.c_str(),04) == -1)
-		{
-			TeProjection* proj = new TeNoProjection();
-			return proj;
-		}
-	}
-	TeAsciiFile prjFile(prjFileName_);
-	string prjdesc = prjFile.readAll();
-	TeProjection* proj = TeGetTeProjectionFromWKT(prjdesc);
-	if (!proj)
-		proj = new TeNoProjection();
-	return proj;
-}
-
-bool 
-TeShapefileDriver::getDataInfo(unsigned int& nObjects , TeBox& ext, TeGeomRep& repres)
-{
-	if (!hSHP_)
-		return false;
-
-	int		nShapeType, nentities=0;
-	double 	adfMinBound[4], adfMaxBound[4];
-	SHPGetInfo(hSHP_, &nentities, &nShapeType, adfMinBound, adfMaxBound);
-	nObjects = nentities;
-	
-	ext.x1_ = adfMinBound[0];
-	ext.y1_ = adfMinBound[1];
-	ext.x2_ = adfMaxBound[0];
-	ext.y2_ = adfMaxBound[1];
-
-	switch (nShapeType) 
-	{
-		case SHPT_NULL:
-			repres = TeGEOMETRYNONE;
-		break;
-		// --- point geometries ---
-		case SHPT_POINTZ:	
-		case SHPT_MULTIPOINTZ:
-		case SHPT_POINTM:
-		case SHPT_MULTIPOINTM:
-		case SHPT_POINT:
-		case SHPT_MULTIPOINT:
-			repres = TePOINTS;
-		break;
-		// --- line geometries ---
-		case SHPT_ARCZ:
-		case SHPT_ARCM:
-		case SHPT_ARC:
-			repres = TeLINES;
-		break;
-		// --- polygon geometries ---
-		case SHPT_POLYGON:
-		case SHPT_POLYGONM:
-		case SHPT_POLYGONZ:
-			repres = TePOLYGONS;
-	}
-	return true;
-}
-
-bool 
-TeShapefileDriver::loadData(TeSTElementSet* dataSet)
-{
-	int		nShapeType, nentities=0;
-	double 	adfMinBound[4], adfMaxBound[4];
-	SHPGetInfo(hSHP_, &nentities, &nShapeType, adfMinBound, adfMaxBound);
-    
-	int natt = DBFGetFieldCount(hDBF_);
-	TeAttributeList attList;
-	TeReadDBFAttributeList(dbfFileName_, attList);
-
-	TeAttributeRep repobjid;
-	repobjid.name_ = "object_id";
-	repobjid.numChar_ = 16;
-
-	TeAttribute attobjid;
-	attobjid.rep_ = repobjid;
-
-	TeProperty propobjid;
-	propobjid.attr_ = attobjid;
-	
-	int i,n;
-	SHPObject* psShape;
-	for (i=0; i<nentities; ++i)
-	{
-		string objectid = Te2String(i);
-		TeSTInstance curObj;
-		curObj.objectId(objectid);
-
-		TePropertyVector prop;
-		psShape = SHPReadObject(hSHP_,i);
-		if (TeDecodeShape(psShape,curObj.geometries(),objectid))
-		{
-			propobjid.value_ = objectid;
-			prop.push_back(propobjid);
-			for(n=0;n<natt;++n)
-			{
-				string value = DBFReadStringAttribute(hDBF_,i,n);
-				TeProperty p;
-				p.attr_ = attList[n];
-				p.value_ = value;
-				prop.push_back(p);
-			}
-			curObj.properties(prop);
-			dataSet->insertSTInstance(curObj);
-			curObj.theme(0);
-		}
-		SHPDestroyObject(psShape);
-	}
-	return true;
-}
-
-bool 
-TeShapefileDriver::getDataAttributesList(TeAttributeList& attList)
-{
-	attList.clear();
-	TeReadDBFAttributeList(dbfFileName_,attList);
-	return (!attList.empty());
-}
-
-void 
-TeShapefileDriver::close()
-{	
-	if (hSHP_)
-	{
-		SHPClose(hSHP_);
-		hSHP_ = 0;
-	}
-	if (hDBF_)
-	{
-		DBFClose(hDBF_);
-		hDBF_ = 0;
-	}
-	shpFileName_.clear();
-	dbfFileName_.clear();
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+// STL 
+#include <string>
+#include <iostream>
+#include <vector>
+#include <list>
+#include <map>
+using namespace std;
+
+#include <assert.h>
+
+#ifdef WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+
+// TerraLib
+
+#include "TeDriverSHPDBF.h"
+#include "TeTable.h"
+#include "TeException.h"
+#include "TeUtils.h"
+#include "TeGeometry.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeLayer.h"
+#include "TeProgress.h"
+#include "TeDatabase.h"
+#include "TeAsciiFile.h"
+
+// from SHAPELIB
+#include "shapefil.h" 
+
+bool
+TeGetSHPInfo(std::string shpfileName, unsigned int& nShapes, TeBox& box, TeGeomRep& rep)
+{
+	nShapes = 0;
+	rep = TeGEOMETRYNONE;
+	box = TeBox();
+
+	SHPHandle	hSHP;
+	hSHP = SHPOpen( shpfileName.c_str(), "rb" );
+
+	if( hSHP == 0 )
+		return false;
+
+	int		nShapeType, nentities=0;
+	double 	adfMinBound[4], adfMaxBound[4];
+
+	SHPGetInfo(hSHP, &nentities, &nShapeType, adfMinBound, adfMaxBound);
+	nShapes = nentities;
+	
+	box.x1_ = adfMinBound[0];
+	box.y1_ = adfMinBound[1];
+	box.x2_ = adfMaxBound[0];
+	box.y2_ = adfMaxBound[1];
+
+	switch (nShapeType) 
+	{
+		case SHPT_NULL:
+			rep = TeGEOMETRYNONE;
+		break;
+		// --- point geometries ---
+		case SHPT_POINTZ:	
+		case SHPT_MULTIPOINTZ:
+		case SHPT_POINTM:
+		case SHPT_MULTIPOINTM:
+		case SHPT_POINT:
+		case SHPT_MULTIPOINT:
+			rep = TePOINTS;
+		break;
+		// --- line geometries ---
+		case SHPT_ARCZ:
+		case SHPT_ARCM:
+		case SHPT_ARC:
+			rep = TeLINES;
+		break;
+		// --- polygon geometries ---
+		case SHPT_POLYGON:
+		case SHPT_POLYGONM:
+		case SHPT_POLYGONZ:
+			rep = TePOLYGONS;
+	}
+	SHPClose(hSHP);
+	return true;
+}
+
+bool
+TeSTOSetBuildSHP(TeSTElementSet& stoset, const string& fileName)
+{
+	// Read some information about the shapefile
+	string filePrefix = TeGetName(fileName.c_str());
+	string shpfileName = filePrefix + ".shp";
+
+	SHPHandle	hSHP;
+	hSHP = SHPOpen( shpfileName.c_str(), "rb" );
+
+	if( hSHP == 0 )
+		return false;
+
+	int		nShapeType, nEntities;
+	double 	adfMinBound[4], adfMaxBound[4];
+
+	SHPGetInfo(hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound);
+
+	string dbffileName = filePrefix + ".dbf";
+    	DBFHandle hDBF = DBFOpen( dbffileName.c_str(), "rb" );
+    	if( hDBF == 0  || DBFGetFieldCount(hDBF) == 0)
+		return false;
+    
+	int natt = DBFGetFieldCount(hDBF);
+	TeAttributeList attList;
+	TeReadDBFAttributeList(shpfileName, attList);
+	
+	stoset.setAttributeList( attList );
+
+	TeAttributeRep repobjid;
+	repobjid.name_ = "object_id";
+	repobjid.numChar_ = 16;
+
+	TeAttribute attobjid;
+	attobjid.rep_ = repobjid;
+
+	TeProperty propobjid;
+	propobjid.attr_ = attobjid;
+	
+	int i,n;
+	SHPObject* psShape;
+	for (i=0; i<nEntities; i++)
+	{
+		string objectid = Te2String(i);
+		TeSTInstance curObj;
+		curObj.objectId(objectid);
+
+		TePropertyVector prop;
+		psShape = SHPReadObject(hSHP,i);
+		if (TeDecodeShape(psShape,curObj.geometries(),objectid))
+		{
+			propobjid.value_ = objectid;
+			prop.push_back(propobjid);
+			for(n=0;n<natt;n++)
+			{
+				string value = DBFReadStringAttribute(hDBF,i,n);
+				TeProperty p;
+				p.attr_ = attList[n];
+				p.value_ = value;
+				prop.push_back(p);
+			}
+			curObj.properties(prop);
+			stoset.insertSTInstance(curObj);
+			curObj.theme(0);
+		}
+		SHPDestroyObject(psShape);
+	}
+	return true;
+} 
+
+TeLayer* TeImportShape(const string& shpFileName, TeDatabase* db, const string& layerName)
+{
+	if (!db || shpFileName.empty()) 
+		return 0;
+
+	// check if format is complete (SHP, SHX e DBF files exist)
+	string filePrefix = TeGetName(shpFileName.c_str());
+	string ftest = filePrefix + ".dbf";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".DBF";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+	ftest = filePrefix + ".shx";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".SHX";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+
+	// found a valid layer name
+	string lName;
+	string baseName = TeGetBaseName(shpFileName.c_str());
+	if (layerName.empty())
+		lName = baseName;
+	else
+		lName = layerName;
+
+	string newLayerName = lName;
+	TeLayerMap& layerMap = db->layerMap();
+	TeLayerMap::iterator it;
+	bool flag = true;
+	int n = 1;
+	while (flag)
+	{
+		for (it = layerMap.begin(); it != layerMap.end(); ++it)
+		{
+			if (TeStringCompare(it->second->name(),newLayerName))
+				break;
+		}
+		if (it == layerMap.end())
+			flag = 0;
+		else
+			newLayerName = lName + "_" +Te2String(n);
+		n++;	
+	}
+
+	// find projection
+	TeLayer* newLayer = new TeLayer(newLayerName,db);
+	if (newLayer->id() <= 0 )
+		return 0;				// couldn�t create new layer
+
+	bool res = TeImportShape(newLayer,shpFileName);
+	if (res)
+		return newLayer;
+	else
+	{
+		db->deleteLayer(newLayer->id());
+		delete newLayer;
+		return 0;
+	}
+}
+
+bool TeImportShape (TeLayer* layer, const string& shpFileName, string attrTableName,  
+					string objectIdAtt, unsigned int chunkSize , const bool& useTransaction )
+{
+	double oldPrec = TePrecision::instance().precision();
+
+	if(layer)
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
+	}
+	else
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(0));
+	}
+
+	string filePrefix = TeGetName(shpFileName.c_str());
+	string shpFileN = filePrefix + ".shp";
+	string dbfFileN = filePrefix + ".dbf";
+
+	SHPHandle	hSHP = SHPOpen(shpFileN.c_str(),"rb");
+	if (hSHP == 0)
+	{
+		TePrecision::instance().setPrecision(oldPrec);
+		return false;
+	}
+
+    DBFHandle hDBF = DBFOpen(dbfFileN.c_str(), "rb");
+    if (hDBF == 0)
+    {
+		TePrecision::instance().setPrecision(oldPrec);
+		SHPClose(hSHP);
+		return false;
+    }
+
+	// Read some information about the shapefile
+	int nShapeType, nEntities;
+	// --- get the shape and decode it
+	double 	adfMinBound[4], adfMaxBound[4];
+	SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
+	string shpName = SHPTypeName( nShapeType );
+	if (shpName == "UnknownShapeType")
+	{
+		TePrecision::instance().setPrecision(oldPrec);
+		SHPClose(hSHP);
+		DBFClose(hDBF);
+		return false;
+	}
+
+	if (attrTableName.empty())
+	{
+		if (layer->name().empty())
+		{
+			TePrecision::instance().setPrecision(oldPrec);
+			return false;
+		}
+		else
+			attrTableName = layer->name();
+	}
+	
+	int linkCol=-1;
+    unsigned int j=0;
+	bool autoIndex = false;
+	int indexOffset = 0;  
+	
+	if(useTransaction == true)
+	{
+		if (!layer->database()->beginTransaction())  
+			return false;
+	}
+
+	//read the attribute list information 
+	TeAttributeList attList;
+	TeReadDBFAttributeList(shpFileName, attList);
+	TeRenameInvalidFieldName(attList);
+
+	// if no geometry link name is given, creates one called 'object_id_'
+	string ext = "";
+	int count = 0;
+	if (objectIdAtt.empty())
+	{
+		objectIdAtt = "object_id_" + Te2String(layer->id());
+		string s2 = TeConvertToUpperCase(objectIdAtt);
+		while (true)
+		{
+			for (j=0; j<attList.size(); j++)
+			{
+				string s0 = attList[j].rep_.name_;
+				string s1 = TeConvertToUpperCase(s0);
+				if ( s1 == s2)
+					break;
+			}
+			if (j < attList.size())
+			{
+				++count;
+				objectIdAtt = "object_id_" + Te2String(count);
+			}
+			else
+				break;
+		}
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;
+		at.rep_.numChar_ = 16;
+		at.rep_.name_ = objectIdAtt;
+		at.rep_.isPrimaryKey_ = true;
+		attList.push_back(at);
+		linkCol = attList.size()-1;
+		autoIndex = true;
+	}
+	else
+	{
+		// check if given index is valid
+		TeAttributeList::iterator it = attList.begin();
+		while (it != attList.end())
+		{
+			if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(objectIdAtt))		// index found
+			{
+				if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
+				{
+					(*it).rep_.type_ = TeSTRING;
+					(*it).rep_.numChar_ = 16;
+				}
+				(*it).rep_.isPrimaryKey_ = true;
+				linkCol=j;
+				break;
+			}
+			++it;
+			++j;
+		}
+		if (it == attList.end())			// index not found
+		{
+			objectIdAtt = "object_id_" + Te2String(layer->id());;
+			while (true)
+			{
+				for (j=0; j<attList.size(); j++)
+				{
+					if (TeConvertToUpperCase(attList[j].rep_.name_) == TeConvertToUpperCase(objectIdAtt))
+						break;
+				}
+				if (j < attList.size())
+				{
+					++count;
+					objectIdAtt = "object_id_" + Te2String(count);
+				}
+				else
+					break;
+			}
+			TeAttribute at;
+			at.rep_.type_ = TeSTRING;
+			at.rep_.numChar_ = 16;
+			at.rep_.name_ = objectIdAtt;
+			at.rep_.isPrimaryKey_ = true;
+			attList.push_back(at);
+			autoIndex = true;
+		}
+	}
+	if (autoIndex)
+	{
+	    linkCol = attList.size()-1;
+        indexOffset = layer->getNewObjectId(); 
+    }
+
+	TeTable attTable (attrTableName,attList,objectIdAtt,objectIdAtt,TeAttrStatic);
+	if (!layer->createAttributeTable(attTable))			// create the table in the database
+	{
+		SHPClose(hSHP);  
+		DBFClose(hDBF);
+		if(useTransaction == true)
+		{
+			layer->database()->rollbackTransaction();  
+		}
+		TePrecision::instance().setPrecision(oldPrec);
+		return false;
+	}
+	
+	string objid, value;
+	TePointSet points;
+	TeLineSet lines;
+	TePolygonSet polygons;
+	TeTableRow row;
+	SHPObject* psShape;
+
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nEntities);
+		TeProgress::instance()->setProgress(j+1);
+	}
+
+	// OBS1: we discard Z and M values when available, because TerraLib
+	// doesn�t have the concept of 3D or measured geometries
+	// OBS2: non identified geometries are mapped to a object_id_
+	// "te_nulo"
+	switch (nShapeType) 
+	{
+		// --- null geometries ---
+	  case SHPT_NULL:							// read only the attributes
+		for (j=0; j<(unsigned int)nEntities; j++)
+		{
+			try
+			{
+				row.clear();
+				TeDBFRowDecode(hDBF,j,row);
+				if (autoIndex)	// --- create automatic index if needed
+					row.push_back(Te2String(j+indexOffset));
+				if (row[linkCol].empty())
+					row[linkCol] = "te_nulo";
+				objid = row[linkCol];
+				attTable.add(row);
+				if ((j%chunkSize) == 0)
+				{
+					if(layer->saveAttributeTable(attTable) == false)
+					{
+						throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+					}
+					attTable.clear();
+					if(TeProgress::instance())
+					{
+						if (TeProgress::instance()->wasCancelled())
+							break;
+						else
+							TeProgress::instance()->setProgress(j+1);
+					}	
+				}
+			}
+			catch(TeException& e)
+			{
+				if(useTransaction == true)
+				{
+					layer->database()->rollbackTransaction();
+					SHPClose(hSHP);
+					DBFClose(hDBF);
+				}
+				throw e;
+			}
+			catch(...)
+			{
+				if(useTransaction == true)
+				{
+					layer->database()->rollbackTransaction();
+					SHPClose(hSHP);
+					DBFClose(hDBF);
+				}
+				throw TeException(UNKNOWN_ERROR_TYPE);
+			}
+		}
+		break;
+		// --- point geometries ---
+	  case SHPT_POINTZ:	
+	  case SHPT_MULTIPOINTZ:
+	  case SHPT_POINTM:
+	  case SHPT_MULTIPOINTM:
+	  case SHPT_POINT:
+	  case SHPT_MULTIPOINT:
+			for (j=0; j<(unsigned int)nEntities; j++)
+			{
+				try
+				{
+					row.clear();
+					TeDBFRowDecode(hDBF,j,row);
+					if (autoIndex)	// --- create automatic index if needed
+						row.push_back(Te2String(j+indexOffset));
+					if (row[linkCol].empty())
+						row[linkCol] = "te_nulo";
+					objid = row[linkCol];
+					attTable.add(row);
+					psShape = SHPReadObject(hSHP,j);
+					TeSHPPointDecode(psShape,points,objid);
+					SHPDestroyObject(psShape);
+					if ((j%chunkSize) == 0)
+					{
+						if(layer->addPoints(points) == false)
+						{
+							throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+						}
+						points.clear();
+						if(layer->saveAttributeTable(attTable) == false)
+						{
+							throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+						}						
+						attTable.clear();
+						if(TeProgress::instance())
+						{
+							if (TeProgress::instance()->wasCancelled())
+								break;
+							else
+								TeProgress::instance()->setProgress(j+1);
+						}	
+					}
+				}
+				catch(TeException& e)
+				{
+					if(useTransaction == true)
+					{
+						layer->database()->rollbackTransaction();
+						SHPClose(hSHP);
+						DBFClose(hDBF);
+					}
+					throw e;
+				}
+				catch(...)
+				{
+					if(useTransaction == true)
+					{
+						layer->database()->rollbackTransaction();
+						SHPClose(hSHP);
+						DBFClose(hDBF);
+					}
+					throw TeException(UNKNOWN_ERROR_TYPE);
+				}
+			}
+			break;
+		// --- line geometries ---
+	  case SHPT_ARCZ:
+	  case SHPT_ARCM:
+	  case SHPT_ARC:
+			for (j=0; j<(unsigned int)nEntities; j++)
+			{
+				try
+				{
+					row.clear();
+					TeDBFRowDecode(hDBF,j,row);
+					if (autoIndex)	// --- create automatic index if needed
+						row.push_back(Te2String(j+indexOffset));
+					if (row[linkCol].empty())
+						row[linkCol] = "te_nulo";
+					objid = row[linkCol];
+					attTable.add(row);
+					psShape = SHPReadObject(hSHP,j);
+					TeSHPPolyLineDecode(psShape,lines,objid);
+					SHPDestroyObject(psShape);
+					if ((j%chunkSize) == 0)
+					{
+						if(layer->addLines(lines) == false)
+						{
+							throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+						}
+						lines.clear();
+						if(layer->saveAttributeTable(attTable) == false)
+						{
+							throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+						}						
+						attTable.clear();
+						if(TeProgress::instance())
+						{
+							if (TeProgress::instance()->wasCancelled())
+								break;
+							else
+								TeProgress::instance()->setProgress(j+1);
+						}
+					}
+				}
+				catch(TeException& e)
+			  {
+					if(useTransaction == true)
+					{
+						layer->database()->rollbackTransaction();
+						SHPClose(hSHP);
+						DBFClose(hDBF);
+					}
+					throw e;
+			  }
+			  catch(...)
+			  {
+					if(useTransaction == true)
+					{
+						layer->database()->rollbackTransaction();
+						SHPClose(hSHP);
+						DBFClose(hDBF);
+					}
+					throw TeException(UNKNOWN_ERROR_TYPE);
+			  }
+			}
+			break;
+	// --- polygon geometries ---
+	  case SHPT_POLYGON:
+	  case SHPT_POLYGONM:
+	  case SHPT_POLYGONZ:
+		  for (j=0; j<(unsigned int)nEntities; j++)
+		  {
+			  try
+			  {
+				row.clear();
+				TeDBFRowDecode(hDBF,j,row);
+				if (autoIndex)	// --- create automatic index if needed
+					row.push_back(Te2String(j+indexOffset));
+				if (row[linkCol].empty())
+					row[linkCol] = "te_nulo";
+				objid = row[linkCol];
+				attTable.add(row);
+				psShape = SHPReadObject(hSHP,j);
+				TeSHPPolygonDecode(psShape,polygons,objid);
+				SHPDestroyObject(psShape);
+				if ((j%chunkSize) == 0)
+				{
+					if(layer->addPolygons(polygons) == false)
+					{
+						throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+					}
+					polygons.clear();
+					if(layer->saveAttributeTable(attTable) == false)
+					{
+						throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+					}
+					attTable.clear();
+					if(TeProgress::instance())
+					{
+						if (TeProgress::instance()->wasCancelled())
+							break;
+						else
+							TeProgress::instance()->setProgress(j+1);
+					}
+				}
+			  }
+			  catch(TeException& e)
+			  {
+					if(useTransaction == true)
+					{
+						layer->database()->rollbackTransaction();
+						SHPClose(hSHP);
+						DBFClose(hDBF);
+					}
+					throw e;
+			  }
+			  catch(...)
+			  {
+					if(useTransaction == true)
+					{
+						layer->database()->rollbackTransaction();
+						SHPClose(hSHP);
+						DBFClose(hDBF);
+					}
+					throw TeException(UNKNOWN_ERROR_TYPE);
+			  }
+		  }
+		  break;
+	  default:
+			/* todo: handle multipatch geometries */
+			{
+				if(useTransaction == true)
+				{
+					layer->database()->rollbackTransaction();
+				}
+				throw TeException ( UNHANDLED_SHP_TYPE );
+			}
+	}
+
+	SHPClose(hSHP);
+	DBFClose(hDBF);
+
+	try
+	{
+		if (points.size() > 0)
+		{
+			if(layer->addPoints(points) == false)
+			{
+				throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+			}
+			points.clear();
+		}
+		if (lines.size() > 0)
+		{
+			if(layer->addLines(lines) == false)
+			{
+				throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+			}
+			lines.clear();
+		}
+		if (polygons.size() > 0)
+		{
+			if(layer->addPolygons(polygons) == false)
+			{
+				throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+			}
+			polygons.clear();
+		}
+		if (attTable.size() > 0)
+		{
+			if(layer->saveAttributeTable(attTable) == false)
+			{
+				throw TeException(UNKNOWN_ERROR_TYPE, layer->database()->errorMessage());
+			}
+			attTable.clear();
+		}
+	}
+	catch(...)
+	{
+		if(useTransaction == true)
+		{
+			layer->database()->rollbackTransaction();
+		}
+		throw TeException(UNKNOWN_ERROR_TYPE);
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->cancel();
+	
+	if(useTransaction == true)
+	{
+		if (!layer->database()->commitTransaction())  
+			return false;
+	}
+
+	// Create the spatial indexes
+	int rep = layer->geomRep();
+	if (rep & TePOINTS)
+	{
+		layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE);
+	}
+	if (rep & TeLINES)
+	{
+		layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE);
+	}
+	if (rep & TePOLYGONS)
+	{
+		layer->database()->insertMetadata(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), (TeSpatialIndexType)TeRTREE);
+	}
+
+	TePrecision::instance().setPrecision(oldPrec);
+
+	return true;
+}
+
+bool TeImportShapeGeometry (TeLayer* layer, const string& shpFileName, string attrTableName,  
+					string objectIdAtt, int unsigned chunkSize )
+{
+
+	string filePrefix = TeGetName(shpFileName.c_str());
+	string shpFileN = filePrefix + ".shp";
+	string dbfFileN = filePrefix + ".dbf";
+
+	SHPHandle	hSHP = SHPOpen(shpFileN.c_str(),"rb");
+	if (hSHP == 0)
+		return false;
+
+    DBFHandle hDBF = DBFOpen(dbfFileN.c_str(), "rb");
+    if (hDBF == 0)
+    {
+		SHPClose(hSHP);
+		return false;
+    }
+
+	// Read some information about the shapefile
+	int nShapeType, nEntities;
+	// --- get the shape and decode it
+	double 	adfMinBound[4], adfMaxBound[4];
+	SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
+	string shpName = SHPTypeName( nShapeType );
+	if (shpName == "UnknownShapeType")
+	{
+		SHPClose(hSHP);
+		return false;
+	}
+
+	if (attrTableName.empty())
+	{
+		if (layer->name().empty())
+			return false;
+		else
+			attrTableName = layer->name();
+	}
+	
+	int linkCol=-1;
+    unsigned int j=0;
+	bool autoIndex = false;
+    int indexOffset = 0;
+
+	if (!layer->database()->beginTransaction())
+		return false;
+
+	//read the attribute list information 
+	TeAttributeList attList;
+  TeReadDBFAttributeList(shpFileName, attList);
+
+	// if no geometry link name is given, creates one called 'object_id_'
+	string ext = "";
+	int count = 0;
+	if (objectIdAtt.empty())
+	{
+		objectIdAtt = "object_id_" + Te2String(layer->id());
+		string s2 = TeConvertToUpperCase(objectIdAtt);
+		while (true)
+		{
+			for (j=0; j<attList.size(); j++)
+			{
+				string s0 = attList[j].rep_.name_;
+				string s1 = TeConvertToUpperCase(s0);
+				if ( s1 == s2)
+					break;
+			}
+			if (j < attList.size())
+			{
+				++count;
+				objectIdAtt = "object_id_" + Te2String(count);
+			}
+			else
+				break;
+		}
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;
+		at.rep_.numChar_ = 16;
+		at.rep_.name_ = objectIdAtt;
+		at.rep_.isPrimaryKey_ = true;
+		attList.push_back(at);
+		linkCol = attList.size()-1;
+		autoIndex = true;
+	}
+	else
+	{
+		// check if given index is valid
+		TeAttributeList::iterator it = attList.begin();
+		while (it != attList.end())
+		{
+			if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(objectIdAtt))		// index found
+			{
+				if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
+				{
+					(*it).rep_.type_ = TeSTRING;
+					(*it).rep_.numChar_ = 16;
+				}
+				(*it).rep_.isPrimaryKey_ = true;
+				linkCol=j;
+				break;
+			}
+			++it;
+			++j;
+		}
+		if (it == attList.end())			// index not found
+		{
+			objectIdAtt = "object_id_" + Te2String(layer->id());;
+			while (true)
+			{
+				for (j=0; j<attList.size(); j++)
+				{
+					if (TeConvertToUpperCase(attList[j].rep_.name_) == TeConvertToUpperCase(objectIdAtt))
+						break;
+				}
+				if (j < attList.size())
+				{
+					++count;
+					objectIdAtt = "object_id_" + Te2String(count);
+				}
+				else
+					break;
+			}
+			TeAttribute at;
+			at.rep_.type_ = TeSTRING;
+			at.rep_.numChar_ = 16;
+			at.rep_.name_ = objectIdAtt;
+			at.rep_.isPrimaryKey_ = true;
+			attList.push_back(at);
+			autoIndex = true;
+		}
+	}
+	if (autoIndex)
+    {
+		linkCol = attList.size()-1;
+		indexOffset = layer->getNewObjectId();
+    }
+
+	TeTable attTable (attrTableName,attList,objectIdAtt,objectIdAtt,TeAttrStatic);
+
+	string objid, value;
+	TePointSet points;
+	TeLineSet lines;
+	TePolygonSet polygons;
+	TeTableRow row;
+	SHPObject* psShape;
+
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nEntities);
+		TeProgress::instance()->setProgress(j+1);
+	}
+
+	// OBS1: we discard Z and M values when available, because TerraLib
+	// doesn�t have the concept of 3D or measured geometries
+	// OBS2: non identified geometries are mapped to a object_id_
+	// "te_nulo"
+	switch (nShapeType) 
+	{
+		// --- null geometries ---
+	  case SHPT_NULL:							// read only the attributes
+		for (j=0; j<(unsigned int)nEntities; j++)
+		{
+		  row.clear();
+		  TeDBFRowDecode(hDBF,j,row);
+		  if (autoIndex)	// --- create automatic index if needed
+			  row.push_back(Te2String(j + indexOffset));
+		  if (row[linkCol].empty())
+			 row[linkCol] = "te_nulo";
+		  objid = row[linkCol];
+
+		  if ((j%chunkSize) == 0)
+		  {
+			  if(TeProgress::instance())
+			  {
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(j+1);
+			  }	
+		  }
+		}
+		break;
+		// --- point geometries ---
+	  case SHPT_POINTZ:	
+	  case SHPT_MULTIPOINTZ:
+	  case SHPT_POINTM:
+	  case SHPT_MULTIPOINTM:
+	  case SHPT_POINT:
+	  case SHPT_MULTIPOINT:
+		  for (j=0; j<(unsigned int)nEntities; j++)
+		  {
+			  row.clear();
+			  TeDBFRowDecode(hDBF,j,row);
+			  if (autoIndex)	// --- create automatic index if needed
+				  row.push_back(Te2String(j + indexOffset));
+			  if (row[linkCol].empty())
+				 row[linkCol] = "te_nulo";
+			  objid = row[linkCol];
+
+			  psShape = SHPReadObject(hSHP,j);
+
+			  TeSHPPointDecode(psShape,points,objid);
+     		  SHPDestroyObject(psShape);
+			  if ((j%chunkSize) == 0)
+			  {
+				  if (!layer->addPoints(points))
+				  {
+					  SHPClose(hSHP);
+					  layer->database()->rollbackTransaction(); 
+					  return false;
+				  }
+				  points.clear();
+
+				  if(TeProgress::instance())
+				  {
+					  if (TeProgress::instance()->wasCancelled())
+						break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+				  }	
+			  }
+		  }
+		  break;
+		// --- line geometries ---
+	  case SHPT_ARCZ:
+	  case SHPT_ARCM:
+	  case SHPT_ARC:
+		  for (j=0; j<(unsigned int)nEntities; j++)
+		  {
+			  row.clear();
+			  TeDBFRowDecode(hDBF,j,row);
+			  if (autoIndex)	// --- create automatic index if needed
+				  row.push_back(Te2String(j + indexOffset));
+			  if (row[linkCol].empty())
+				 row[linkCol] = "te_nulo";
+			  objid = row[linkCol];
+
+			  psShape = SHPReadObject(hSHP,j);
+
+			  TeSHPPolyLineDecode(psShape,lines,objid);
+		  
+			  SHPDestroyObject(psShape);
+			  if ((j%chunkSize) == 0)
+			  {
+				  if (!layer->addLines(lines))
+				  {
+					  SHPClose(hSHP);
+					  layer->database()->rollbackTransaction(); 
+					  return false;
+				  }
+				  lines.clear();
+
+				  if(TeProgress::instance())
+				  {
+					if (TeProgress::instance()->wasCancelled())
+						break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+				  }	
+			  }
+		  }
+		  break;
+	// --- polygon geometries ---
+	  case SHPT_POLYGON:
+	  case SHPT_POLYGONM:
+	  case SHPT_POLYGONZ:
+
+		  for (j=0; j<(unsigned int)nEntities; j++)
+		  {
+			  row.clear();
+
+			  TeDBFRowDecode(hDBF,j,row);
+			  if (autoIndex)	// --- create automatic index if needed
+			    row.push_back(Te2String(j + indexOffset));
+			  if (row[linkCol].empty())
+				  row[linkCol] = "te_nulo";
+			  objid = row[linkCol];
+			  
+			  psShape = SHPReadObject(hSHP,j);
+
+			  TeSHPPolygonDecode(psShape,polygons,objid);
+
+			  SHPDestroyObject(psShape);
+			  if ((j%chunkSize) == 0)
+			  {
+
+				  if (!layer->addPolygons(polygons))
+				  {
+					  SHPClose(hSHP);
+					  layer->database()->rollbackTransaction(); 
+					  return false;
+				  }
+
+				  polygons.clear();
+
+				  if(TeProgress::instance())
+				  {
+					if (TeProgress::instance()->wasCancelled())
+						break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+				  }
+			  }
+
+		  }
+		  break;
+	  default:
+		  // todo: handle multipatch geometries 
+		  throw TeException ( UNHANDLED_SHP_TYPE );
+	}
+	if (points.size() > 0)
+	{
+		if (!layer->addPoints(points))
+		{
+			SHPClose(hSHP);
+			layer->database()->rollbackTransaction(); 
+			return false;
+		}
+
+		points.clear();
+	}
+	if (lines.size() > 0)
+	{
+		if (!layer->addLines(lines))
+		{
+			SHPClose(hSHP);
+			layer->database()->rollbackTransaction();
+			return false;
+		}
+
+		lines.clear();
+	}
+	if (polygons.size() > 0)
+	{
+		if (!layer->addPolygons(polygons))
+		{
+			SHPClose(hSHP);
+			layer->database()->rollbackTransaction();
+			return false;
+		}
+		polygons.clear();
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->cancel();
+
+	SHPClose(hSHP);
+
+	if (!layer->database()->commitTransaction())
+		return false;
+
+	return true;
+}
+
+DBFHandle TeCreateDBFFile (const string& dbfFilename, TeAttributeList& attList)
+{
+	DBFHandle hDBF = DBFCreate( dbfFilename.c_str() );
+	if( hDBF == 0 )
+		return 0;
+	
+	int i =0;
+	TeAttributeList::iterator it=attList.begin();
+
+	while ( it != attList.end() )
+	{
+		TeAttribute at = (*it);
+		string atName = at.rep_.name_;
+
+		if (atName.size() > 10)
+		{
+			int extra = (int)(atName.size() - 10)/2;
+			int middle = (int)(atName.size()/2);
+			string str = atName.substr(0,middle-extra-1);
+			str += atName.substr(middle+extra);
+			atName = str;
+		}
+
+		basic_string <char>::size_type	index;
+		if((index=atName.find(".")) !=string::npos)
+		{
+			atName.replace(index,1,"_");
+		}
+
+		if (at.rep_.type_ == TeSTRING )
+		{
+			int numChar = at.rep_.numChar_;
+			if(numChar == 0)
+			{
+				numChar = 255;
+			}
+			if (DBFAddField( hDBF, atName.c_str(), FTString, numChar, 0 ) == -1 )
+				return 0;
+		}
+		else if (at.rep_.type_ == TeINT)
+		{
+			if (DBFAddField( hDBF, atName.c_str(), FTInteger, 32, 0 ) == -1 )
+				return 0;
+		}
+		else if (at.rep_.type_ == TeREAL)
+		{
+			if (DBFAddField( hDBF, atName.c_str(), FTDouble, 40, 15 ) == -1 )
+				return 0;
+		}
+		// OBS: shapelib doesn�t deal with xBase field type for Date 
+		// we are transforming it to string
+		else if (at.rep_.type_ == TeDATETIME)
+		{
+			if (DBFAddField( hDBF, atName.c_str(), FTDate, 8, 0 ) == -1 )
+				return 0;
+		}
+		++i;
+		++it;
+	}
+	return hDBF;
+}
+
+bool TeExportPolygonSet2SHP( const TePolygonSet& ps,const std::string& base_file_name  )
+{
+    // creating files names
+    std::string dbfFilename = base_file_name + ".dbf";
+    std::string shpFilename = base_file_name + ".shp";
+
+    // creating polygons attribute list ( max attribute size == 25 )
+    TeAttributeList attList;
+    TeAttribute at;
+    at.rep_.type_ = TeSTRING;               //the id of the cell
+    at.rep_.numChar_ = 25;
+    at.rep_.name_ = "object_id_";
+    at.rep_.isPrimaryKey_ = true;
+	attList.push_back(at);
+    
+    /* DBF output file handle creation */
+	DBFHandle hDBF = TeCreateDBFFile (dbfFilename, attList);
+	if ( hDBF == 0 )
+		return false;
+    
+    /* SHP output file handle creation */
+    SHPHandle hSHP = SHPCreate( shpFilename.c_str(), SHPT_POLYGON );
+    if( hSHP == 0 ) 
+	{
+      DBFClose( hDBF );
+      return false;
+    }
+    
+    /* Writing polygons */
+    int iRecord = 0;
+    int totpoints = 0;
+    double  *padfX, *padfY;
+    SHPObject       *psObject;
+    int posXY, npoints, nelem;
+    int nVertices;
+    int* panParts;
+
+    TePolygonSet::iterator itps;
+    TePolygon poly;
+
+    for (itps = ps.begin() ; itps != ps.end() ; itps++ ) {
+      poly=(*itps);
+      totpoints = 0;
+      nVertices = poly.size();
+      for (unsigned int n=0; n<poly.size();n++) {
+        totpoints += poly[n].size();
+      }
+
+      panParts = (int *) malloc(sizeof(int) * nVertices);
+      padfX = (double *) malloc(sizeof(double) * totpoints);
+      padfY = (double *) malloc(sizeof(double) * totpoints);
+      posXY = 0;
+      nelem = 0;
+      
+      for (unsigned int l=0; l<poly.size(); ++l) {
+        if (l==0) {
+          if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) {
+            TeReverseLine(poly[l]);
+          }
+        } else {
+          if (TeOrientation(poly[l]) == TeCLOCKWISE) {
+            TeReverseLine(poly[l]);
+          }
+        }
+        
+        npoints = poly[l].size();
+        panParts[nelem]=posXY;
+        
+        for (int m=0; m<npoints; m++ ) {
+          padfX[posXY] = poly[l][m].x_;
+          padfY[posXY] = poly[l][m].y_;
+          posXY++;
+        }
+        nelem++;
+      }
+                
+      psObject = SHPCreateObject( SHPT_POLYGON, -1, nelem, panParts, NULL,
+        posXY, padfX, padfY, NULL, NULL );
+        
+      int shpRes = SHPWriteObject( hSHP, -1, psObject );
+      if (shpRes == -1 )
+	  {
+	      DBFClose( hDBF );
+		  SHPClose( hSHP );
+		  return false;
+	  }
+        
+      SHPDestroyObject( psObject );
+      free( panParts );
+      free( padfX );
+      free( padfY );
+
+      // writing attributes - same creation order
+      DBFWriteStringAttribute(hDBF, iRecord, 0, poly.objectId().c_str() );
+            
+      iRecord++;
+    }
+    
+    DBFClose( hDBF );
+    SHPClose( hSHP );
+    return true;  
+}
+
+
+bool
+TeExportQuerierToShapefile(TeQuerier* querier, const std::string& base)
+{
+	// check initial conditions
+	if (!querier)
+		return false;
+
+	if (!querier->loadInstances())
+		return false;
+
+	// Get the list of attributes defined by the input querier
+	bool onlyObjId = false;
+	TeAttributeList qAttList = querier->getAttrList();
+	if (qAttList.empty())
+	{
+		TeAttributeList qAttList;
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;               
+		at.rep_.numChar_ = 100;
+		at.rep_.name_ = "ID";
+		at.rep_.isPrimaryKey_ = true;
+		qAttList.push_back(at);
+		onlyObjId = true;
+	}
+
+	// Handles to each type of geometries that will be created if necessary
+	DBFHandle hDBFPol = 0;
+	SHPHandle hSHPPol = 0;
+	DBFHandle hDBFLin = 0;
+	SHPHandle hSHPLin = 0;
+	DBFHandle hDBFPt = 0;
+	SHPHandle hSHPPt = 0;
+
+	// Some auxiliary variables
+    int totpoints;
+    double*	padfX;
+	double*	padfY;
+    unsigned int nVertices;
+    int* panPart;
+    SHPObject *psObject;
+    unsigned int posXY, npoints, nelem;
+	int shpRes;
+
+	// progress information
+	if (TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+	int dt = CLOCKS_PER_SEC/2;
+	int dt2 = CLOCKS_PER_SEC; //* .000001;
+
+	// Loop through the instances writting their geometries and attributes
+	unsigned int iRecPol=0, iRecLin=0, iRecPt=0;
+	unsigned int n, l, m;
+	unsigned int nIProcessed = 0;
+	TeSTInstance st;
+	while(querier->fetchInstance(st))
+	{
+		totpoints = 0;
+		nVertices = 0;
+		if (st.hasPolygons())
+		{
+			TePolygonSet& polSet = st.getPolygons();
+			TePolygonSet::iterator itps;
+			int nVerticesCount = 0;
+			for (itps = polSet.begin(); itps != polSet.end(); ++itps) 
+			{
+				nVertices = (*itps).size();
+				nVerticesCount += nVertices;
+				for (n=0; n<nVertices;++n) 
+					totpoints += (*itps)[n].size();
+			}
+
+			panPart = (int *) malloc(sizeof(int) * nVerticesCount);
+			padfX = (double *) malloc(sizeof(double) * totpoints);
+			padfY = (double *) malloc(sizeof(double) * totpoints);
+
+			posXY = 0;
+			nelem = 0;
+			for (itps = polSet.begin(); itps != polSet.end(); ++itps) 
+			{
+				TePolygon poly = *itps;
+				for (l=0; l<poly.size(); ++l) 
+				{
+					if (l==0) 
+					{
+						if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) 
+							TeReverseLine(poly[l]);
+					}
+					else 
+					{
+						if (TeOrientation(poly[l]) == TeCLOCKWISE)
+							TeReverseLine(poly[l]);
+					}
+					npoints = poly[l].size();
+					panPart[nelem]=posXY;
+        
+					for (m=0; m<npoints; ++m) 
+					{
+						padfX[posXY] = poly[l][m].x_;
+						padfY[posXY] = poly[l][m].y_;
+						posXY++;
+					}
+					nelem++;
+				}
+			}
+			psObject = SHPCreateObject(SHPT_POLYGON, -1, nelem, panPart, NULL, posXY, padfX, padfY, NULL, NULL);
+			if (hSHPPol == 0)
+			{
+				string fname = base + "_pol.shp";
+				hSHPPol = SHPCreate(fname.c_str(), SHPT_POLYGON);
+   				assert (hSHPPol != 0);
+			}	
+			shpRes = SHPWriteObject(hSHPPol, -1, psObject);
+			SHPDestroyObject(psObject);
+			free(panPart);
+			free(padfX);
+			free(padfY);
+			assert(shpRes != -1);   
+			if (hDBFPol == 0)
+			{
+				hDBFPol = TeCreateDBFFile(base + "_pol.dbf", qAttList);
+				if(hDBFPol == 0)
+				{
+					return false;
+				}
+				assert (hDBFPol != 0);
+			}
+			if (onlyObjId)
+			{
+				DBFWriteStringAttribute(hDBFPol, iRecPol, 0, st.objectId().c_str());
+			}
+			else
+			{
+				string val;
+				for (n=0; n<qAttList.size();++n) 
+				{
+					st.getPropertyValue(val,n);
+					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
+					{
+						DBFWriteStringAttribute(hDBFPol, iRecPol, n, val.c_str());
+					}
+					else if (qAttList[n].rep_.type_ == TeINT)
+					{
+						DBFWriteIntegerAttribute(hDBFPol, iRecPol, n, atoi(val.c_str()));
+					}
+					else if (qAttList[n].rep_.type_ == TeREAL)
+					{
+						DBFWriteDoubleAttribute(hDBFPol, iRecPol, n, atof(val.c_str()));
+					}
+				}
+			}
+			++iRecPol;
+		}
+		if (st.hasCells())
+		{
+			TeCellSet& cellSet = st.getCells();
+			nVertices = cellSet.size();
+			totpoints = nVertices*5;
+			panPart = (int *) malloc(sizeof(int) * nVertices);
+			padfX = (double *) malloc(sizeof(double) * totpoints);
+			padfY = (double *) malloc(sizeof(double) * totpoints);
+			posXY = 0;
+			nelem = 0;
+			TeCellSet::iterator itcs;
+			for (itcs=cellSet.begin(); itcs!=cellSet.end(); ++itcs)
+			{
+				panPart[nelem]=posXY;
+				padfX[posXY] = (*itcs).box().lowerLeft().x();
+				padfY[posXY] = (*itcs).box().lowerLeft().y();
+				posXY++;		
+				padfX[posXY] = (*itcs).box().upperRight().x();
+				padfY[posXY] = (*itcs).box().lowerLeft().y();
+				posXY++;		
+				padfX[posXY] = (*itcs).box().upperRight().x();
+				padfY[posXY] = (*itcs).box().upperRight().y();
+				posXY++;		
+				padfX[posXY] = (*itcs).box().lowerLeft().x();
+				padfY[posXY] = (*itcs).box().upperRight().y();
+				posXY++;		
+				padfX[posXY] = (*itcs).box().lowerLeft().x();
+				padfY[posXY] = (*itcs).box().lowerLeft().y();
+				++posXY;	
+				++nelem;
+			} 
+			psObject = SHPCreateObject(SHPT_POLYGON, -1, nelem, panPart, NULL,posXY, padfX, padfY, NULL, NULL);
+			if (hSHPPol == 0)
+			{
+				string fname = base + "_pol.shp";
+				hSHPPol = SHPCreate(fname.c_str(), SHPT_POLYGON);
+   				assert (hSHPPol != 0);
+			}	
+			shpRes = SHPWriteObject(hSHPPol, -1, psObject);
+			SHPDestroyObject(psObject);
+			free(panPart);
+			free(padfX);
+			free(padfY);
+			assert(shpRes != -1);
+			if (hDBFPol == 0)
+			{
+				hDBFPol = TeCreateDBFFile(base + "_pol.dbf", qAttList);
+				assert (hDBFPol != 0);
+			}
+
+			if (onlyObjId)
+			{
+				DBFWriteStringAttribute(hDBFPol, iRecPol, 0, st.objectId().c_str());
+			}
+			else
+			{
+				string val;
+				for (n=0; n<qAttList.size();++n) 
+				{
+					st.getPropertyValue(val,n);
+					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
+					{
+						DBFWriteStringAttribute(hDBFPol, iRecPol, n, val.c_str());
+					}
+					else if (qAttList[n].rep_.type_ == TeINT)
+					{
+						DBFWriteIntegerAttribute(hDBFPol, iRecPol, n, atoi(val.c_str()));
+					}
+					else if (qAttList[n].rep_.type_ == TeREAL)
+					{
+						DBFWriteDoubleAttribute(hDBFPol, iRecPol, n, atof(val.c_str()));
+					}
+				}
+			}
+			++iRecPol;
+		}
+		if (st.hasLines())
+		{
+			TeLineSet& lineSet = st.getLines();
+			nVertices = lineSet.size();
+			TeLineSet::iterator itls;
+			for (itls=lineSet.begin(); itls!=lineSet.end(); ++itls)
+				totpoints += (*itls).size();
+			panPart = (int *) malloc(sizeof(int) * nVertices);
+			padfX = (double *) malloc(sizeof(double) * totpoints);
+			padfY = (double *) malloc(sizeof(double) * totpoints);
+			posXY = 0;
+			nelem = 0;
+			for (itls=lineSet.begin(); itls!=lineSet.end(); ++itls)
+			{
+				panPart[nelem]=posXY;
+				for (l=0; l<(*itls).size(); ++l)
+				{
+					padfX[posXY] = (*itls)[l].x();
+					padfY[posXY] = (*itls)[l].y();
+					++posXY;
+				}
+				++nelem;
+			}
+			psObject = SHPCreateObject(SHPT_ARC, -1, nVertices, panPart, NULL,	posXY, padfX, padfY, NULL, NULL);
+			if (hSHPLin == 0)
+			{
+				string fname = base + "_lin.shp"; 
+				hSHPLin = SHPCreate(fname.c_str(), SHPT_ARC);
+   				assert (hSHPLin != 0);
+			}		
+			shpRes = SHPWriteObject(hSHPLin, -1, psObject);
+			SHPDestroyObject(psObject);
+			free(panPart);
+			free(padfX);
+			free(padfY);
+			assert(shpRes != -1);
+			if (hDBFLin == 0)
+			{
+				hDBFLin = TeCreateDBFFile(base + "_lin.dbf", qAttList);
+				assert (hDBFLin != 0);
+			}
+			if (onlyObjId)
+			{
+				DBFWriteStringAttribute(hDBFLin, iRecLin, 0, st.objectId().c_str());
+			}
+			else
+			{
+				string val;
+				for (n=0; n<qAttList.size();++n) 
+				{
+					st.getPropertyValue(val,n);
+					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
+					{
+						DBFWriteStringAttribute(hDBFLin, iRecLin, n, val.c_str());
+					}
+					else if (qAttList[n].rep_.type_ == TeINT)
+					{
+						DBFWriteIntegerAttribute(hDBFLin, iRecLin, n, atoi(val.c_str()));
+					}
+					else if (qAttList[n].rep_.type_ == TeREAL)
+					{
+						DBFWriteDoubleAttribute(hDBFLin, iRecLin, n, atof(val.c_str()));
+					}
+				}
+			}
+			++iRecLin;
+		}
+		if (st.hasPoints())
+		{
+			TePointSet& pointSet = st.getPoints();
+			nVertices = pointSet.size();
+			panPart = (int *) malloc(sizeof(int) * nVertices);
+			padfX = (double *) malloc(sizeof(double) * nVertices);
+			padfY = (double *) malloc(sizeof(double) * nVertices);
+			nelem = 0;
+			TePointSet::iterator itpts;
+			for (itpts=pointSet.begin(); itpts!=pointSet.end(); ++itpts)
+			{
+				panPart[nelem] = nelem;
+				padfX[nelem] = (*itpts).location().x();
+				padfY[nelem] = (*itpts).location().y();
+				++nelem;
+			}
+			psObject = SHPCreateObject(SHPT_POINT, -1, nVertices, panPart, NULL, nVertices, padfX, padfY, NULL, NULL );
+			if (hSHPPt == 0)
+			{
+				string fname = base + "_pt.shp";
+				hSHPPt = SHPCreate(fname.c_str(), SHPT_POINT);
+   				assert (hSHPPt != 0);
+			}		
+			shpRes = SHPWriteObject(hSHPPt, -1, psObject);
+			SHPDestroyObject(psObject);
+			free(panPart);
+			free(padfX);
+			free(padfY);
+			assert(shpRes != -1);
+			if (hDBFPt == 0)
+			{
+				hDBFPt = TeCreateDBFFile(base + "_pt.dbf", qAttList);
+				assert (hDBFPt != 0);
+			}
+			if (onlyObjId)
+			{
+				DBFWriteStringAttribute(hDBFPt, iRecPt, 0, st.objectId().c_str());
+			}
+			else
+			{
+				string val;
+				for (n=0; n<qAttList.size();++n) 
+				{
+					st.getPropertyValue(val,n);
+						if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
+					{
+						DBFWriteStringAttribute(hDBFPt, iRecPt, n, val.c_str());
+					}
+					else if (qAttList[n].rep_.type_ == TeINT)
+					{
+						DBFWriteIntegerAttribute(hDBFPt, iRecPt, n, atoi(val.c_str()));
+					}
+					else if (qAttList[n].rep_.type_ == TeREAL)
+					{
+						DBFWriteDoubleAttribute(hDBFPt, iRecPt, n, atof(val.c_str()));
+					}
+				}
+			}
+			++iRecPt;
+		}
+		++nIProcessed;
+		if (TeProgress::instance() && int(t2-t1) > dt)
+		{
+			t1 = t2;
+			if(((int)(t2-t0) > dt2))
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(nIProcessed);
+			}
+		}
+
+	}
+	if (hDBFPol != 0)
+		DBFClose(hDBFPol);
+	if (hSHPPol != 0)
+        SHPClose(hSHPPol);
+	if (hDBFLin != 0)
+		DBFClose(hDBFLin);
+	if (hSHPLin != 0)
+        SHPClose(hSHPLin);
+	if (hDBFPt != 0)
+		DBFClose(hDBFPt);
+	if (hSHPPt != 0)
+        SHPClose(hSHPPt);
+
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+
+bool
+TeExportShapefile(TeLayer* layer, const string& shpFileName, const string& tableName, const string& restriction)
+{
+  	if (!layer || shpFileName.empty())
+		return false;
+
+	// check if asked table exist
+	TeAttrTableVector& vTables = layer->attrTables();
+	TeAttrTableVector::iterator it = vTables.begin();
+	while (it != vTables.end())
+	{
+		if (it->name() == tableName) 
+			break;
+		++it;
+	}
+	if (it == vTables.end())
+		return false;
+	TeAttrTableVector askedTable;
+	askedTable.push_back(*it);
+
+	TeTheme* tempTheme = new TeTheme();
+	tempTheme->attributeRest(restriction);
+	tempTheme->layer(layer);
+	tempTheme->collectionTable("");
+	tempTheme->collectionAuxTable("");
+	tempTheme->setAttTables(askedTable);
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(tempTheme);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToShapefile(tQuerier, shpFileName);
+	delete tQuerier;
+	delete tempTheme;
+    return res ;
+}
+
+bool 
+TeExportLayerToShapefile(TeLayer* layer, const string& baseName)
+{
+  	if (!layer)
+		return false;
+
+	string fbase = baseName;
+	if (baseName.empty())
+		fbase = layer->name();
+
+	TeTheme* tempTheme = new TeTheme();
+	tempTheme->layer(layer);
+	tempTheme->collectionTable("");
+	tempTheme->collectionAuxTable("");
+	tempTheme->setAttTables(layer->attrTables());
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(tempTheme);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToShapefile(tQuerier, baseName);
+	delete tQuerier;
+	delete tempTheme;
+    return res ;
+}
+
+
+bool 
+TeExportThemeToShapefile(TeTheme* theme, TeSelectedObjects selOb, const std::string& baseName, const std::vector<std::string> attributes)
+{
+	if (!theme)
+		return false;
+
+	string fbase = baseName;
+	if (baseName.empty())
+		fbase = theme->name();
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(theme);
+	qPar.setSelecetObjs(selOb);
+
+	if(!attributes.empty())
+	{
+		qPar.setFillParams(true, false, attributes);		
+	}
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToShapefile(tQuerier, fbase);
+	delete tQuerier;
+	return res;
+}
+
+void TeDBFRowDecode(DBFHandle& hDBF, int nr, TeTableRow& row)
+{
+	string value;
+	int i;
+	for (i = 0; i < DBFGetFieldCount(hDBF); i++)
+	{
+		if(DBFIsAttributeNULL(hDBF, nr, i) == true)
+		{
+			value = "";
+		}
+		else
+		{
+			value =  DBFReadStringAttribute(hDBF,nr,i);
+		}
+		row.push_back(value); 
+	}
+}
+
+bool TeDecodeShape(SHPObject* psShape, TeMultiGeometry& geomestries, string& objectId)
+{
+	int shpType = psShape->nSHPType;
+	switch (shpType)
+	{
+		case SHPT_POLYGON:
+		case SHPT_POLYGONZ:
+			TeSHPPolygonDecode(psShape,geomestries.polygons_,objectId);
+			return true;
+		case SHPT_ARC:
+		case SHPT_ARCZ:
+			TeSHPPolyLineDecode(psShape,geomestries.lines_,objectId);
+			return true;
+		case SHPT_POINT:
+		case SHPT_POINTZ:
+		case SHPT_MULTIPOINT:
+		case SHPT_MULTIPOINTZ:
+			TeSHPPointDecode(psShape,geomestries.points_,objectId);
+			return true;
+	}
+	return false;
+}
+
+void TeSHPPointDecode(SHPObject* psShape, TePointSet& points, string& objid)
+{
+	int nv = psShape->nVertices;
+	for (int i = 0; i<nv; i++)
+	{
+		TePoint point(psShape->padfX[i], psShape->padfY[i]);
+		point.objectId(objid);
+		points.add(point);
+	}
+}
+
+
+void TeSHPPolyLineDecode(SHPObject* psShape, TeLineSet& lines, string& objid)
+{
+	int iPart,j=0,nextStart=0; 
+	for (iPart = 0; iPart < psShape->nParts; iPart++)
+	{
+		if (iPart == psShape->nParts-1)
+			nextStart = psShape->nVertices;
+		else 
+			nextStart = psShape->panPartStart[iPart+1];
+
+		TeLine2D line;
+		while (j<nextStart)
+		{
+			TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
+			line.add ( pt );
+			j++;
+		}
+		line.objectId (objid);	
+		lines.add ( line );
+	}
+}
+
+void
+TeSHPPolygonDecode(SHPObject* psShape, TePolygonSet& polys, string& objid)
+{
+	int iPart = 0;
+	vector<int> partStart;
+
+	// Build an array whose components point to the starting point
+	// of the rings that compose the polygon shape
+	for ( iPart = 0; iPart < psShape->nParts; iPart++ )
+		partStart.push_back ( psShape->panPartStart[iPart] );
+	partStart.push_back ( psShape->nVertices ); // point to the end
+
+	vector<TePolygon> pList;
+	vector<TeLinearRing> holes;
+	int j = 0;
+	iPart = 0;
+	while (j < psShape->nVertices)
+	{
+		TeLine2D line;
+		iPart++;						// while it doesn�t reach the start of next part
+		while ( j < partStart[iPart] )	// build a line from the coordinates
+		{
+			TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
+			line.add ( pt );
+			j++;
+		}								
+		if (!line.isRing())				// force the closing of opened rings
+			line.add(line[0]);
+
+		// decide if a ring is an outter ring or an inner ring based on its orientation
+		TeLinearRing ring(line);
+		short orient = TeOrientation(ring);
+		if(orient == TeCLOCKWISE)	// outter ring: start a new polygon
+		{
+			TePolygon p;
+			p.add(ring);
+			p.objectId(objid);
+			pList.push_back(p);
+		}
+		else	// COUNTERCLOCKWISE => inner ring: put on the list of holes
+			holes.push_back(ring);
+	} // read all vertices
+
+
+	// even though there are rings that are in counter clockwise orientation, 
+	// there aren't any clockwise orientation rings to be possible parents of 
+	// these inner rings. The decision here: treat all of them as outter rings...
+	if (pList.empty() && !holes.empty())
+	{
+		for (unsigned int i=0; i<holes.size(); ++i)
+		{
+			TePolygon p;
+			p.add(holes[i]);
+			p.objectId(objid);
+			polys.add(p);
+		}
+		return;
+	}
+
+	if (pList.size() == 1)	// shape has only one polygon that should
+	{						// contain all the inner rings
+		for(unsigned int i = 0; i < holes.size(); ++i)
+			pList[0].add(holes[i]);
+	}
+	else
+	{	// shape has multiple outter ring and inner rings
+		// we have to find a parent to each inner ring 
+		for(unsigned int i = 0; i < holes.size(); ++i)
+		{
+			vector<TePolygon> candidates;
+			TeLinearRing ring = holes[i];
+			
+			// step 1: consider as a inner ring parent candidate every polygon 
+			// that intercepts the ring MBR
+			unsigned int j = 0;
+			for(j = 0; j < pList.size(); ++j)
+			{
+				if(TeWithinOrCoveredByOrEquals(ring.box(), pList[j].box()))
+					candidates.push_back(pList[j]);
+			}
+
+			// if there is only one candidate this is the parent
+			if(candidates.size() == 1)
+			{
+				candidates[0].add(ring);
+				continue;
+			}
+
+			// step 2: refine the candidates to parent: consider only those 
+			// that contains the ring (not just its MBR)
+			vector<TePolygon> newCandidates;
+			for(j = 0; j < candidates.size(); ++j)
+			{
+				short rel = TeBOUNDARY;
+				bool inside = false;
+
+				unsigned int nthVert = ring.size();
+				unsigned int iVert = 0u;
+
+				while(iVert < nthVert)
+				{
+					rel = TeRelation(ring[iVert], candidates[j][0]);
+
+					if(rel & TeINSIDE)
+					{
+						inside = true;
+						newCandidates.push_back(candidates[j]);
+						break;
+					}
+					else if(rel & TeOUTSIDE)
+						break;
+					++iVert;
+				}
+
+				if(iVert == nthVert)	
+					break;
+			}
+			
+			// sort the new candidates according to their areas
+			int idxMinArea = 0;
+			double minArea = TeMAXFLOAT;
+			for(j = 0; j < newCandidates.size(); ++j)
+			{
+				if(TeGeometryArea(newCandidates[j].box()) < minArea)
+				{
+					idxMinArea = j;
+					minArea = TeGeometryArea(newCandidates[j].box());
+				}
+			}
+			// choose as parent the candidate that has the smaller area
+			if (!newCandidates.empty())
+				newCandidates[idxMinArea].add(ring);
+		}
+	}
+
+	// add polygons to the list passed as parameter
+	vector<TePolygon>::iterator it = pList.begin();
+	while (it != pList.end())
+	{
+		polys.add(*it);
+		++it;
+	}
+}
+
+//! Fills a vector with the values of choosen column named , to be used as object identifications
+/*!
+	\param dbfFileName DBF file name
+	\param indexes a vector that has the identification of the objects
+	\param objectIdAttr name of the attribute that has the identification of objects
+	\note if no objectIdAttr is provided or there is no column with this name return
+	an incremental sequence of numbers.
+*/
+void TeReadDBFIndexes(const string& dbfFileName, vector<string>& indexes, const string objectIdAttr="");
+
+
+bool TeReadDBFAttributeList ( const string& dbfFileName, TeAttributeList& attList )
+{
+	string filePrefix = TeGetName (dbfFileName.c_str()) ;
+	string fileName = filePrefix + ".dbf";
+
+/* -------------------------------------------------------------------- */
+/*      Open the file.                                                  */
+/* -------------------------------------------------------------------- */
+    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
+    if( hDBF == NULL )
+    {
+			throw TeException ( UNABLE_TO_OPEN_DBF_FILE );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*	If there is no data in this file let the user know.		*/
+/* -------------------------------------------------------------------- */
+    if( DBFGetFieldCount(hDBF) == 0 )
+    {
+			throw TeException ( NO_DATA_IN_DBF_FILE );
+    }
+
+/* -------------------------------------------------------------------- */
+/*	Get Attributes header definitions.									*/
+/* -------------------------------------------------------------------- */
+	TeAttribute attribute;
+    
+	char	szTitle[12];
+	int		nWidth, nDecimals;
+	int 	i;
+
+	vector<string> names;
+
+	for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
+    {
+		DBFFieldType	eType = DBFGetFieldInfo( hDBF, i, szTitle, &nWidth, &nDecimals );
+
+		string atname = TeConvertToUpperCase(szTitle);
+	
+		vector<string>::iterator it = find(names.begin(),names.end(),atname);
+		if (it != names.end())
+		{
+			string newname = atname + "_" + Te2String(i);
+			int c = i+1;
+			while (true)
+			{
+				it = find(names.begin(),names.end(),newname);
+				if (it == names.end())
+					break;
+				newname = atname + "_" + Te2String(c);
+				++c;
+			}
+			atname = newname;
+		}
+		names.push_back(atname);
+		attribute.rep_.name_ = atname;
+
+        if( eType == FTDate )
+		{
+			attribute.rep_.type_     = TeDATETIME;
+			attribute.dateChronon_   = TeDAY;
+			attribute.dateTimeFormat_ = "YYYYMMDD";
+			attribute.dateSeparator_ = 'c';
+		}
+        else if( eType == FTString )
+		{
+			attribute.rep_.type_     = TeSTRING;
+			attribute.rep_.numChar_  = nWidth;
+		}
+		else if( eType == FTInteger )
+		{
+			if (nWidth > 9)
+			{
+				attribute.rep_.type_ = TeREAL;
+				attribute.rep_.numChar_ = nWidth;
+				attribute.rep_.decimals_ = 0;
+			}
+			else
+			{
+				attribute.rep_.type_ = TeINT;
+				attribute.rep_.numChar_ = nWidth;
+			}
+		}
+        else if( eType == FTDouble )
+		{
+            attribute.rep_.type_ = TeREAL;
+			attribute.rep_.numChar_ = nWidth;
+			attribute.rep_.decimals_ = nDecimals;
+		}
+
+		// keep track of the index name 
+
+		attribute.rep_.name_ = TeReplaceSpecialChars(attribute.rep_.name_);
+		attribute.rep_.name_ = TeConvertToUpperCase(attribute.rep_.name_);
+
+		attList.push_back ( attribute );
+    }
+	names.clear();
+    DBFClose( hDBF );
+	return true;
+}
+
+
+bool TeImportDBFTable(const string& dbFileName,TeDatabase* db, TeLayer* layer,TeAttrTableType tableType, string objectIdAtt)
+{
+	if (!db || dbFileName.empty())
+		return false;
+
+    DBFHandle hDBF = DBFOpen(dbFileName.c_str(), "rb" );
+    if( hDBF == NULL )
+		return false;
+
+	string tabName = TeGetBaseName(dbFileName.c_str());
+	int n=0;
+	while (db->tableExist(tabName))
+	{
+		tabName = TeGetBaseName(dbFileName.c_str()) + "_" + Te2String(n);
+		n++;
+	}
+	TeAttributeList attList;
+	TeReadDBFAttributeList (dbFileName, attList);
+
+	if (objectIdAtt.empty())
+		objectIdAtt = "object_id_";
+
+	// check if object id column is already in the list
+	unsigned int j;
+	for (j=0; j<attList.size(); j++)
+	{
+		if ( TeConvertToUpperCase(objectIdAtt) ==  TeConvertToUpperCase(attList[j].rep_.name_))
+		{
+			objectIdAtt = TeConvertToUpperCase(attList[j].rep_.name_);
+			attList[j].rep_.name_ =  objectIdAtt;
+			if (attList[j].rep_.type_ != TeSTRING)
+			{
+				attList[j].rep_.type_ = TeSTRING;
+				attList[j].rep_.numChar_ = 255;
+			}
+			attList[j].rep_.isPrimaryKey_ = true;
+			break;
+		}
+	}
+
+	// if not found create one automatically
+	bool createObjId = false;
+	if (j==attList.size())
+	{
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;
+		at.rep_.numChar_ = 16;
+		at.rep_.name_ = objectIdAtt;
+		at.rep_.isPrimaryKey_ = true;
+		attList.push_back(at);
+		createObjId = true;
+	}
+
+	if (!db->createTable(tabName,attList))
+	{
+	    DBFClose(hDBF);
+		return false;
+	}
+
+	TeTable table(tabName);
+	table.setAttributeList(attList);
+	table.setUniqueName(objectIdAtt);
+	if (layer)
+		table.setTableType(tableType);
+	else
+		table.setTableType(TeAttrExternal);
+
+	int nrec = DBFGetRecordCount(hDBF);
+	if (TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(nrec);
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+	int iRecord;
+	for (iRecord = 0; iRecord < nrec; iRecord++)
+    {
+		TeTableRow row;
+		int i;
+		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
+		{
+			string value =  DBFReadStringAttribute(hDBF, iRecord, i);
+			row.push_back ( value ); // inserts a value into the row
+		}
+		if (createObjId)
+			row.push_back(Te2String(iRecord));
+		table.add(row); 
+		if ((iRecord+1 % 100) == 0)
+		{
+			if (!db->insertTable(table))
+			{
+				DBFClose( hDBF );
+				table.clear();
+				if (TeProgress::instance())
+					TeProgress::instance()->reset();		
+				return false;
+			}
+			table.clear();
+			if (TeProgress::instance())
+			{
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					if (TeProgress::instance()->wasCancelled())
+						break;
+					if ((int)(t2-t0) > dt2)
+						TeProgress::instance()->setProgress(iRecord);
+				}
+			}
+		}
+    }
+	if (table.size() > 0)
+	{
+		db->insertTable(table);
+		table.clear();
+	}
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();		
+    DBFClose( hDBF );
+	if (iRecord == 0)
+		return false;
+	if (layer)
+		db->insertTableInfo(layer->id(),table);
+	else
+		db->insertTableInfo(0,table);
+
+	return true;
+}
+
+void TeReadSHPAttributes (const string& dbfFileName, TeTable& table)
+{
+	string filePrefix = TeGetName (dbfFileName.c_str()) ;
+	string fileName = filePrefix + ".dbf";
+
+/* -------------------------------------------------------------------- */
+/*	Get Attributes definitions.											*/
+/* -------------------------------------------------------------------- */
+	TeAttributeList attList;
+	TeReadDBFAttributeList ( fileName, attList );
+	table.setAttributeList( attList );
+
+/* -------------------------------------------------------------------- */
+/*      Open the file.                                                  */
+/* -------------------------------------------------------------------- */
+    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
+    if( hDBF == NULL )
+    {
+			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*	If there is no data in this file let the user know.		*/
+/* -------------------------------------------------------------------- */
+    if( DBFGetFieldCount(hDBF) == 0 )
+    {
+			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
+    }
+
+/* -------------------------------------------------------------------- */
+/*	Read all the records 						                        */
+/* -------------------------------------------------------------------- */
+	for( int iRecord = 0; iRecord < DBFGetRecordCount(hDBF); iRecord++ )
+    {
+		TeTableRow row;
+		int 	i;
+
+		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
+		{
+			string value =  DBFReadStringAttribute( hDBF, iRecord, i ) ;
+			row.push_back ( value ); // inserts a value into the row
+		}
+		table.add ( row ); // adds a row to a table
+    }
+    DBFClose( hDBF );
+}
+
+
+bool TeReadDBFAttributes (const string& dbfFileName, TeTable& table, 
+						  int nrecords, int rinitial, bool createAuto)
+{
+	string filePrefix = TeGetName (dbfFileName.c_str()) ;
+	string fileName = filePrefix + ".dbf";
+
+// -------------------------------------------------------------------- 
+//      Open the file.                                                  
+// -------------------------------------------------------------------- 
+    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
+    if( hDBF == NULL )
+    {
+			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
+    }
+    
+// -------------------------------------------------------------------- 
+//	If there is no data in this file let the user know.		
+// -------------------------------------------------------------------- 
+    if( DBFGetFieldCount(hDBF) == 0 )
+    {
+			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
+    }
+
+	if (rinitial >= DBFGetRecordCount(hDBF))
+		return false;
+
+	if (nrecords < 1 || nrecords > DBFGetRecordCount(hDBF))
+		nrecords = DBFGetRecordCount(hDBF);
+
+// -------------------------------------------------------------------- 
+//	Read all the records 						                        
+// -------------------------------------------------------------------- 
+	int count = 0;
+	for( int iRecord = rinitial; (iRecord < DBFGetRecordCount(hDBF) && count < nrecords); iRecord++ )
+    {
+		TeTableRow row;
+		int 	i;
+		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
+		{
+			string value =  DBFReadStringAttribute( hDBF, iRecord, i ) ;
+			row.push_back ( value ); // inserts a value into the row
+		}
+		
+		// if asked create a auto number extra column at the end
+		if (createAuto)
+			row.push_back(Te2String(iRecord));
+
+		table.add ( row ); // adds a row to a table
+		count++;
+    }
+    DBFClose( hDBF );
+	if (count > 0)
+		return true;
+	return false;
+}
+
+void
+TeImportDBFIndexes(const string& shpFileName, vector<string>& indexVect, const string objectIdAttr )
+{
+	string filePrefix = TeGetName(shpFileName.c_str());
+	string fileName = filePrefix + ".dbf";
+
+/* -------------------------------------------------------------------- */
+/*	Get index position.													*/
+/* -------------------------------------------------------------------- */
+	int i=0, indexPos=-1;
+
+	if (!objectIdAttr.empty())
+	{
+		TeAttributeList attList;
+		TeReadDBFAttributeList ( fileName, attList );
+		TeAttributeList::iterator it = attList.begin();
+		while ( it != attList.end() )
+		{
+			TeAttribute att = *it;
+			if (TeConvertToUpperCase(att.rep_.name_) == TeConvertToUpperCase(objectIdAttr))
+			{
+				indexPos = i;
+				break;
+			}
+			it++;
+			i++;
+		}
+	}
+
+/* -------------------------------------------------------------------- */
+/*      Open the file.                                                  */
+/* -------------------------------------------------------------------- */
+    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
+    if( hDBF == NULL )
+    {
+			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*	If there is no data in this file let the user know.		*/
+/* -------------------------------------------------------------------- */
+	int nRecords = DBFGetFieldCount(hDBF);
+    if( nRecords  == 0 )
+    {
+			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
+    }
+
+/* -------------------------------------------------------------------- */
+/*	Read all the records 						                        */
+/* -------------------------------------------------------------------- */
+    
+	for( int iRecord = 0; iRecord < nRecords; iRecord++ )
+	{
+		if (indexPos == -1)
+			indexVect.push_back (Te2String(iRecord+1)); 
+		else
+			indexVect.push_back ( DBFReadStringAttribute( hDBF, iRecord, indexPos ) );
+	}
+
+    DBFClose( hDBF );
+}
+
+TeShapefileDriver::TeShapefileDriver(std::string fileName):
+	hSHP_(0),
+	hDBF_(0)
+{
+	// check if format is complete (SHP, SHX e DBF files exist)
+	string filePrefix = TeGetName(fileName.c_str());
+
+	shpFileName_ = filePrefix + ".shp";
+	if (access(shpFileName_.c_str(),04) == -1)
+	{
+		shpFileName_ = filePrefix + ".SHP";
+		if (access(shpFileName_.c_str(),04) == -1)
+			return;
+	}
+	dbfFileName_ = filePrefix + ".dbf";
+	if (access(dbfFileName_.c_str(),04) == -1)
+	{
+		dbfFileName_ = filePrefix + ".DBF";
+		if (access(dbfFileName_.c_str(),04) == -1)
+			return;
+	}
+	string ftest = filePrefix + ".shx";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".SHX";
+		if (access(ftest.c_str(),04) == -1)
+			return;
+	}
+	hSHP_ = SHPOpen(shpFileName_.c_str(),"rb");
+	if (hSHP_==0)
+		return;
+
+    hDBF_ = DBFOpen(dbfFileName_.c_str(), "rb");
+    if (hDBF_==0)
+    {
+		SHPClose(hSHP_);
+		return ;
+    }
+}
+
+std::string
+TeShapefileDriver::getFileName()
+{
+	return shpFileName_;
+}
+
+TeShapefileDriver::~TeShapefileDriver()
+{
+	close();
+}
+
+bool
+TeShapefileDriver::isDataAccessible()
+{
+	return (hSHP_!=0 && hDBF_!=0);
+}
+
+TeProjection*
+TeShapefileDriver::getDataProjection()
+{
+	string filePrefix = TeGetName(shpFileName_.c_str());
+	string prjFileName_ = filePrefix + ".prj";
+	if (access(prjFileName_.c_str(),04) == -1)
+	{
+		prjFileName_ = filePrefix + ".PRJ";
+		if (access(prjFileName_.c_str(),04) == -1)
+		{
+			TeProjection* proj = new TeNoProjection();
+			return proj;
+		}
+	}
+	TeAsciiFile prjFile(prjFileName_);
+	string prjdesc = prjFile.readAll();
+	TeProjection* proj = TeGetTeProjectionFromWKT(prjdesc);
+	if (!proj)
+		proj = new TeNoProjection();
+	return proj;
+}
+
+bool 
+TeShapefileDriver::getDataInfo(unsigned int& nObjects , TeBox& ext, TeGeomRep& repres)
+{
+	if (!hSHP_)
+		return false;
+
+	int		nShapeType, nentities=0;
+	double 	adfMinBound[4], adfMaxBound[4];
+	SHPGetInfo(hSHP_, &nentities, &nShapeType, adfMinBound, adfMaxBound);
+	nObjects = nentities;
+	
+	ext.x1_ = adfMinBound[0];
+	ext.y1_ = adfMinBound[1];
+	ext.x2_ = adfMaxBound[0];
+	ext.y2_ = adfMaxBound[1];
+
+	switch (nShapeType) 
+	{
+		case SHPT_NULL:
+			repres = TeGEOMETRYNONE;
+		break;
+		// --- point geometries ---
+		case SHPT_POINTZ:	
+		case SHPT_MULTIPOINTZ:
+		case SHPT_POINTM:
+		case SHPT_MULTIPOINTM:
+		case SHPT_POINT:
+		case SHPT_MULTIPOINT:
+			repres = TePOINTS;
+		break;
+		// --- line geometries ---
+		case SHPT_ARCZ:
+		case SHPT_ARCM:
+		case SHPT_ARC:
+			repres = TeLINES;
+		break;
+		// --- polygon geometries ---
+		case SHPT_POLYGON:
+		case SHPT_POLYGONM:
+		case SHPT_POLYGONZ:
+			repres = TePOLYGONS;
+	}
+	return true;
+}
+
+bool 
+TeShapefileDriver::loadData(TeSTElementSet* dataSet)
+{
+	int		nShapeType, nentities=0;
+	double 	adfMinBound[4], adfMaxBound[4];
+	SHPGetInfo(hSHP_, &nentities, &nShapeType, adfMinBound, adfMaxBound);
+    
+	int natt = DBFGetFieldCount(hDBF_);
+	TeAttributeList attList;
+	TeReadDBFAttributeList(dbfFileName_, attList);
+
+	TeAttributeRep repobjid;
+	repobjid.name_ = "object_id";
+	repobjid.numChar_ = 16;
+
+	TeAttribute attobjid;
+	attobjid.rep_ = repobjid;
+
+	TeProperty propobjid;
+	propobjid.attr_ = attobjid;
+	
+	int i,n;
+	SHPObject* psShape;
+	for (i=0; i<nentities; ++i)
+	{
+		string objectid = Te2String(i);
+		TeSTInstance curObj;
+		curObj.objectId(objectid);
+
+		TePropertyVector prop;
+		psShape = SHPReadObject(hSHP_,i);
+		if (TeDecodeShape(psShape,curObj.geometries(),objectid))
+		{
+			propobjid.value_ = objectid;
+			prop.push_back(propobjid);
+			for(n=0;n<natt;++n)
+			{
+				string value = DBFReadStringAttribute(hDBF_,i,n);
+				TeProperty p;
+				p.attr_ = attList[n];
+				p.value_ = value;
+				prop.push_back(p);
+			}
+			curObj.properties(prop);
+			dataSet->insertSTInstance(curObj);
+			curObj.theme(0);
+		}
+		SHPDestroyObject(psShape);
+	}
+	return true;
+}
+
+bool 
+TeShapefileDriver::getDataAttributesList(TeAttributeList& attList)
+{
+	attList.clear();
+	TeReadDBFAttributeList(dbfFileName_,attList);
+	return (!attList.empty());
+}
+
+void 
+TeShapefileDriver::close()
+{	
+	if (hSHP_)
+	{
+		SHPClose(hSHP_);
+		hSHP_ = 0;
+	}
+	if (hDBF_)
+	{
+		DBFClose(hDBF_);
+		hDBF_ = 0;
+	}
+	shpFileName_.clear();
+	dbfFileName_.clear();
+}
+
+
diff --git a/src/terralib/drivers/shapelib/TeDriverSHPDBF.h b/src/terralib/drivers/shapelib/TeDriverSHPDBF.h
old mode 100755
new mode 100644
index 443094f..a29fd00
--- a/src/terralib/drivers/shapelib/TeDriverSHPDBF.h
+++ b/src/terralib/drivers/shapelib/TeDriverSHPDBF.h
@@ -1,277 +1,284 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSHPDBFDriver.h
-    \brief This file contains the header of the functions that deal with shapefile and dbf formats
-	using the shapelib library
-*/
-#ifndef __TERRALIB_INTERNAL_DBFSHPDRIVER_H
-#define __TERRALIB_INTERNAL_DBFSHPDRIVER_H
-
-#include <TeTable.h>
-#include <TeSTElementSet.h>
-#include <TeDataTypes.h>
-#include <TeMultiGeometry.h>
-#include <shapefil.h>
-
-#include <string>
-using namespace std;
-
-class TeLayer;
-class TeAsciiFile;
-class TeProjection;
-class TeDatabase;
-class TePolygonSet;
-class TeQuerier;
-class TeTheme;
-
-
-/** @defgroup Formats Geographical data formats
- *  @ingroup Formats
- *  Functions related to encoding/decoding of files in the formats supported by TerraLib
- *  @{
- */
-
-/** @defgroup DBF DBF tables
- *  @ingroup Formats
- *  Functions related to DBF table format
- *  @{
- */
-
-/** Reads the list of attributes specified in DBF file 
-   \param dbfFileName	DBF input file name
-   \param attList		returns the DBF list of attributes
-   \return TRUE if the list of attributes were was successfully read and FALSE otherwise
-*/
-bool TeReadDBFAttributeList(const string& dbfFileName, TeAttributeList& attList);
-
-/** Reads a set of records from a shapelib to a structure in memory
-	\param dbfFileName	DBF file name
-	\param table		to return the set of records in memory
-	\param nrecords		number of records to be read
-	\param rinitial		number of the initial record
-	\param createAuto	flag used to indicate if an auto number columns should be added to each record
-*/
-bool TeReadDBFAttributes (const string& dbfFileName, TeTable& table, 
-						  int nrecords=-1, int rinitial=0, bool createAuto=false);
-
-/** Imports a DBF table to a TerraLib database
-	This function imports a DBF to a TerraLib database. An attribute table can be associated to a
-	particular layer, or as an external table that will be linked to any layer when genereated a 
-	theme. A column called object_id_ will be added with unique values automatically generated.
-	\param dbfFileName	DBF file name
-	\param db			pointer to a TerraLib database
-	\param layer		pointer to a layer to which the table will associated
-	\param tableType	type of the attribute table
-*/
-bool TeImportDBFTable(const string& dbfFileName, TeDatabase* db, TeLayer* layer=0,TeAttrTableType tableType=TeAttrExternal, string objectIdAtt = "object_id_");
-
-//! Decodify a row of a DBF into a TeTableRow structure 
-/*! 
-	\param dbfHandle pointer to a DBF handler
-	\param nr number of the row
-	\param row reference to a row that will store the data
-*/
-void TeDBFRowDecode		(DBFHandle& dbfHandle, int nr, TeTableRow& row);
-/** @} */ // End of subgroup DBF format
-
-/** @defgroup Shape decode 
- *  @ingroup SHP
- *  Auxiliary functions to decode one shape using shapelib
- *  @{
- */
-//! Decodify a ShapeObject into a TerraLib point set
-/*! 
-	\param psShape pointer to a shapelib shape object 
-	\param ps TerraLib point set to receive the geometries
-	\param objectId TerraLib identifier to this object
-*/
-void TeSHPPointDecode	(SHPObject* psShape, TePointSet& ps, string& objectId);
-
-//! Decodify a ShapeObject into a TerraLib line set
-/*! 
-	\param psShape pointer to a shapelib shape object 
-	\param ps TerraLib line set to receive the geometries
-	\param objectId TerraLib identifier to this object
-*/
-void TeSHPPolyLineDecode(SHPObject* psShape, TeLineSet& ls, string& objectId);
-
-//! Decodify a ShapeObject into a TerraLib polygon set
-/*! 
-	\param psShape pointer to a shapelib shape object 
-	\param ps TerraLib polygon set to receive the geometries
-	\param objectId TerraLib identifier to this object
-*/
-void TeSHPPolygonDecode	(SHPObject* psShape, TePolygonSet& pols, string& objectId);
-
-//! Decodify a ShapeObject into a TerraLib multigeometry set
-/*! 
-	\param psShape pointer to a shapelib shape object 
-	\param geometries TerraLib multi geometry set to receive the geometries
-	\param objectId TerraLib identifier to this object
-*/
-bool TeDecodeShape(SHPObject* psShape, TeMultiGeometry& geomestries, string& objectId);
-/** @} */ // End of Shape decode group
-
-
-/** @defgroup SHP Shapefile format
- *  @ingroup Formats
- *  Functions related to Shapefile format. Uses some functions related to DBF attribute table format.
- *  @{
- */ 
-
-/** Get the metadata information of a shapefile
-	\param shpFileName	Shapefile name
-	\param nShapes		to return the number of shapes in the shapefile
-	\param box			to return the boundary box of the shapes contained in the shapefile
-	\param rep			to return the type of geometry exist in the shapefile
-	\return true if succeeds and and false otherwise
-*/
-bool
-TeGetSHPInfo(std::string shpfileName, unsigned int& nShapes, TeBox& box, TeGeomRep& rep);
-
-
-/** Imports a geo data in a shapefile format to a TerraLib database
-	\param shpFileName	Shapefile name
-	\param db			pointer to a TerraLib database
-	\param layerName	name of the layer that will contain the data (optional)
-	\return a pointer to created layer if the data was imported successfully and 0 otherwise
-*/
-TeLayer* TeImportShape(const string& shpFileName, TeDatabase* db, const string& layerName="");
-
-/** Imports a shapefile to a layer TerraLib
-	\param layer			pointer to a layer
-	\param shpFileName		shapefile file name
-	\param attrTableName	the name that the attribute table will be saved
-	\param objectIdAttr		name of the attribute that has the identification of objects
-	\param chunkSize		the number of objects in memory before save them in the layer
-*/
-bool TeImportShape (TeLayer* layer, const string& shpFileName, string attrTableName="",  
-					string objectIdAttr="", unsigned int  chunkSize = 60);
-
-/** Exports a querier to a shapefile
-	\param	querier		pointer to a valid querier
-	\param baseName		name of the output shapefile
-	\return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportQuerierToShapefile(TeQuerier* querier, const std::string& baseName);
-
-/** Exports a theme in a TerraLib database to a shapefile
-	\param theme		pointer to the layer
-	\param selOb		the objetct selection: TeALL, TePOINTED, TeQUERIED...
-	\param baseName		name of the output shapefile. If empty, the file will have the same name as the Theme.
-	\return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportThemeToShapefile(TeTheme* theme, TeSelectedObjects selOb = TeAll, const std::string& baseName="");
-
-/** Exports a layer in a TerraLib database to a shapefile
-   \param layer			pointer to the layer
-   \param baseName		name of the output shapefile. If empty, the file will have the same name as the Layer.
-   \return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportLayerToShapefile(TeLayer* layer, const string& baseName="");
-
-/** Exports a layer in a TerraLib database to a file in MID/MIF format
-   \deprecated This is an overloaded function, provided for compatibility. It behaves essentially like the above function.
-*/
-bool TeExportShapefile(TeLayer* layer, const string& shpFileName, const string& tableName, const string& restriction = "");
-
-/** Exports a TerraLib polygon set to a shapefile
-	Each polygon will be a shape. Only one attribute will be created: the object id of the polygon.
-   \param ps				the polygon set
-   \param base_file_name	the base file name used to build the shapefile
-   \return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportPolygonSet2SHP( const TePolygonSet& ps,const string& base_file_name  );
-
-//! Builds the spatial object set from database according to the restrictions previously defined
-/*! 
-	\param stoset the STOSet that will be filled 
-	\param fileName shape file name
-*/
-bool TeSTOSetBuildSHP(TeSTElementSet& stoset, const string& fileName);
-
-/** @} */ // End of subgroup SHAPEFILE format
-
-
-#include <TeGeoDataDriver.h>
-
-//! Concrete implementation of a driver shapefiles
-class TeShapefileDriver: public TeGeoDataDriver
-{
-	std::string shpFileName_;
-	std::string dbfFileName_;
-	SHPHandle	hSHP_;
-	DBFHandle	hDBF_;
-
-public:
-
-	//! Constructor from a file name
-	TeShapefileDriver(std::string fileName);
-
-	//! Destructor
-	~TeShapefileDriver();
-
-	std::string getFileName();
-
-	//! Returns true or false whether the data file is accessible
-	bool isDataAccessible();
-
-	//! Returns the spatial reference associated to the data as an instance of TeProjection 
-	TeProjection* getDataProjection();
-
-	//! Loads the minimum metadata information about the data
-	/*
-		\param nObjects to return the number of objects accessible in the data set
-		\param ext	to return the spatial extension of the geometries in the data set
-		\param repres to return the type of geometries in the file
-		\return true if or false whether it can retrieve the information or not
-	*/
-	bool getDataInfo(unsigned int& nObjects , TeBox& ext, TeGeomRep& repres);
-
-	//! Loads the list of descriptive attributes of the objetcts represented in the file
-	bool getDataAttributesList(TeAttributeList& attList);
-
-	//! Loads the data into an TeSTElementSet structure in memory
-	/*
-		\param dataSet to return data set
-		\return true if or false whether it can retrieve the information or not
-	*/
-	bool loadData(TeSTElementSet* dataSet);
-
-	//! Releases internal structures and invalidate the access to the data file
-	void close();
-};
-
-
-/** \example importShape.cpp
- Shows how to import geographical data in shapefile format
- */
-
-/** \example importDBF.cpp
- Shows how to import a DBF table
- */
-
-/** @} */ // End of group ImpExp format
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSHPDBFDriver.h
+    \brief This file contains the header of the functions that deal with shapefile and dbf formats
+	using the shapelib library
+*/
+#ifndef __TERRALIB_INTERNAL_DBFSHPDRIVER_H
+#define __TERRALIB_INTERNAL_DBFSHPDRIVER_H
+
+#include <TeTable.h>
+#include <TeSTElementSet.h>
+#include <TeDataTypes.h>
+#include <TeMultiGeometry.h>
+#include <shapefil.h>
+
+#include "TeSHPDefines.h"
+
+#include <string>
+using namespace std;
+
+class TeLayer;
+class TeAsciiFile;
+class TeProjection;
+class TeDatabase;
+class TePolygonSet;
+class TeQuerier;
+class TeTheme;
+
+
+/** @defgroup Formats Geographical data formats
+ *  @ingroup Formats
+ *  Functions related to encoding/decoding of files in the formats supported by TerraLib
+ *  @{
+ */
+
+/** @defgroup DBF DBF tables
+ *  @ingroup Formats
+ *  Functions related to DBF table format
+ *  @{
+ */
+
+/** Reads the list of attributes specified in DBF file 
+   \param dbfFileName	DBF input file name
+   \param attList		returns the DBF list of attributes
+   \return TRUE if the list of attributes were was successfully read and FALSE otherwise
+*/
+SHP_DLL bool TeReadDBFAttributeList(const string& dbfFileName, TeAttributeList& attList);
+
+/** Reads a set of records from a shapelib to a structure in memory
+	\param dbfFileName	DBF file name
+	\param table		to return the set of records in memory
+	\param nrecords		number of records to be read
+	\param rinitial		number of the initial record
+	\param createAuto	flag used to indicate if an auto number columns should be added to each record
+*/
+SHP_DLL bool TeReadDBFAttributes (const string& dbfFileName, TeTable& table, 
+						  int nrecords=-1, int rinitial=0, bool createAuto=false);
+
+/** Imports a DBF table to a TerraLib database
+	This function imports a DBF to a TerraLib database. An attribute table can be associated to a
+	particular layer, or as an external table that will be linked to any layer when genereated a 
+	theme. A column called object_id_ will be added with unique values automatically generated.
+	\param dbfFileName	DBF file name
+	\param db			pointer to a TerraLib database
+	\param layer		pointer to a layer to which the table will associated
+	\param tableType	type of the attribute table
+*/
+SHP_DLL bool TeImportDBFTable(const string& dbfFileName, TeDatabase* db, TeLayer* layer=0,TeAttrTableType tableType=TeAttrExternal, string objectIdAtt = "object_id_");
+
+//! Decodify a row of a DBF into a TeTableRow structure 
+/*! 
+	\param dbfHandle pointer to a DBF handler
+	\param nr number of the row
+	\param row reference to a row that will store the data
+*/
+SHP_DLL void TeDBFRowDecode		(DBFHandle& dbfHandle, int nr, TeTableRow& row);
+/** @} */ // End of subgroup DBF format
+
+/** @defgroup Shape decode 
+ *  @ingroup SHP
+ *  Auxiliary functions to decode one shape using shapelib
+ *  @{
+ */
+//! Decodify a ShapeObject into a TerraLib point set
+/*! 
+	\param psShape pointer to a shapelib shape object 
+	\param ps TerraLib point set to receive the geometries
+	\param objectId TerraLib identifier to this object
+*/
+SHP_DLL void TeSHPPointDecode	(SHPObject* psShape, TePointSet& ps, string& objectId);
+
+//! Decodify a ShapeObject into a TerraLib line set
+/*! 
+	\param psShape pointer to a shapelib shape object 
+	\param ps TerraLib line set to receive the geometries
+	\param objectId TerraLib identifier to this object
+*/
+SHP_DLL void TeSHPPolyLineDecode(SHPObject* psShape, TeLineSet& ls, string& objectId);
+
+//! Decodify a ShapeObject into a TerraLib polygon set
+/*! 
+	\param psShape pointer to a shapelib shape object 
+	\param ps TerraLib polygon set to receive the geometries
+	\param objectId TerraLib identifier to this object
+*/
+SHP_DLL void TeSHPPolygonDecode	(SHPObject* psShape, TePolygonSet& pols, string& objectId);
+
+//! Decodify a ShapeObject into a TerraLib multigeometry set
+/*! 
+	\param psShape pointer to a shapelib shape object 
+	\param geometries TerraLib multi geometry set to receive the geometries
+	\param objectId TerraLib identifier to this object
+*/
+SHP_DLL bool TeDecodeShape(SHPObject* psShape, TeMultiGeometry& geomestries, string& objectId);
+/** @} */ // End of Shape decode group
+
+
+/** @defgroup SHP Shapefile format
+ *  @ingroup Formats
+ *  Functions related to Shapefile format. Uses some functions related to DBF attribute table format.
+ *  @{
+ */ 
+
+/** Get the metadata information of a shapefile
+	\param shpFileName	Shapefile name
+	\param nShapes		to return the number of shapes in the shapefile
+	\param box			to return the boundary box of the shapes contained in the shapefile
+	\param rep			to return the type of geometry exist in the shapefile
+	\return true if succeeds and and false otherwise
+*/
+SHP_DLL bool
+TeGetSHPInfo(std::string shpfileName, unsigned int& nShapes, TeBox& box, TeGeomRep& rep);
+
+
+/** Imports a geo data in a shapefile format to a TerraLib database
+	\param shpFileName	Shapefile name
+	\param db			pointer to a TerraLib database
+	\param layerName	name of the layer that will contain the data (optional)
+	\return a pointer to created layer if the data was imported successfully and 0 otherwise
+*/
+SHP_DLL TeLayer* TeImportShape(const string& shpFileName, TeDatabase* db, const string& layerName="");
+
+/** Imports a shapefile to a layer TerraLib
+	\param layer			pointer to a layer
+	\param shpFileName		shapefile file name
+	\param attrTableName	the name that the attribute table will be saved
+	\param objectIdAttr		name of the attribute that has the identification of objects
+	\param chunkSize		the number of objects in memory before save them in the layer
+*/
+SHP_DLL bool TeImportShape (TeLayer* layer, const string& shpFileName, string attrTableName="",  
+					string objectIdAttr="", unsigned int  chunkSize = 60, const bool& useTransaction = true);
+
+/** Exports a querier to a shapefile
+	\param	querier		pointer to a valid querier
+	\param baseName		name of the output shapefile
+	\return TRUE if the data was successfully exported and FALSE otherwise
+*/
+SHP_DLL bool TeExportQuerierToShapefile(TeQuerier* querier, const std::string& baseName);
+
+/** Exports a theme in a TerraLib database to a shapefile
+	\param theme		pointer to the layer
+	\param selOb		the objetct selection: TeALL, TePOINTED, TeQUERIED...
+	\param baseName		name of the output shapefile. If empty, the file will have the same name as the Theme.
+	\param attributes	list of attributes to be exported. If empty, the file will have all the attributes.
+	\return TRUE if the data was successfully exported and FALSE otherwise
+*/
+SHP_DLL bool TeExportThemeToShapefile(TeTheme* theme, TeSelectedObjects selOb = TeAll, const std::string& baseName="", 
+									  const std::vector<std::string> attributes = std::vector<std::string>());
+
+/** Exports a layer in a TerraLib database to a shapefile
+   \param layer			pointer to the layer
+   \param baseName		name of the output shapefile. If empty, the file will have the same name as the Layer.
+   \return TRUE if the data was successfully exported and FALSE otherwise
+*/
+SHP_DLL bool TeExportLayerToShapefile(TeLayer* layer, const string& baseName="");
+
+/** Exports a layer in a TerraLib database to a file in MID/MIF format
+   \deprecated This is an overloaded function, provided for compatibility. It behaves essentially like the above function.
+*/
+SHP_DLL bool TeExportShapefile(TeLayer* layer, const string& shpFileName, const string& tableName, const string& restriction = "");
+
+/** Exports a TerraLib polygon set to a shapefile
+	Each polygon will be a shape. Only one attribute will be created: the object id of the polygon.
+   \param ps				the polygon set
+   \param base_file_name	the base file name used to build the shapefile
+   \return TRUE if the data was successfully exported and FALSE otherwise
+*/
+SHP_DLL bool TeExportPolygonSet2SHP( const TePolygonSet& ps,const string& base_file_name  );
+
+//! Builds the spatial object set from database according to the restrictions previously defined
+/*! 
+	\param stoset the STOSet that will be filled 
+	\param fileName shape file name
+*/
+SHP_DLL bool TeSTOSetBuildSHP(TeSTElementSet& stoset, const string& fileName);
+
+SHP_DLL DBFHandle TeCreateDBFFile (const string& dbfFilename, TeAttributeList& attList);
+
+
+/** @} */ // End of subgroup SHAPEFILE format
+
+
+#include <TeGeoDataDriver.h>
+
+//! Concrete implementation of a driver shapefiles
+class SHP_DLL TeShapefileDriver: public TeGeoDataDriver
+{
+	std::string shpFileName_;
+	std::string dbfFileName_;
+	SHPHandle	hSHP_;
+	DBFHandle	hDBF_;
+
+public:
+
+	//! Constructor from a file name
+	TeShapefileDriver(std::string fileName);
+
+	//! Destructor
+	~TeShapefileDriver();
+
+	std::string getFileName();
+
+	//! Returns true or false whether the data file is accessible
+	bool isDataAccessible();
+
+	//! Returns the spatial reference associated to the data as an instance of TeProjection 
+	TeProjection* getDataProjection();
+
+	//! Loads the minimum metadata information about the data
+	/*
+		\param nObjects to return the number of objects accessible in the data set
+		\param ext	to return the spatial extension of the geometries in the data set
+		\param repres to return the type of geometries in the file
+		\return true if or false whether it can retrieve the information or not
+	*/
+	bool getDataInfo(unsigned int& nObjects , TeBox& ext, TeGeomRep& repres);
+
+	//! Loads the list of descriptive attributes of the objetcts represented in the file
+	bool getDataAttributesList(TeAttributeList& attList);
+
+	//! Loads the data into an TeSTElementSet structure in memory
+	/*
+		\param dataSet to return data set
+		\return true if or false whether it can retrieve the information or not
+	*/
+	bool loadData(TeSTElementSet* dataSet);
+
+	//! Releases internal structures and invalidate the access to the data file
+	void close();
+};
+
+
+/** \example importShape.cpp
+ Shows how to import geographical data in shapefile format
+ */
+
+/** \example importDBF.cpp
+ Shows how to import a DBF table
+ */
+
+/** @} */ // End of group ImpExp format
+
+#endif
+
diff --git a/src/terralib/drivers/shapelib/TeExportDBF.cpp b/src/terralib/drivers/shapelib/TeExportDBF.cpp
old mode 100755
new mode 100644
index b3f5027..ae76034
--- a/src/terralib/drivers/shapelib/TeExportDBF.cpp
+++ b/src/terralib/drivers/shapelib/TeExportDBF.cpp
@@ -1,286 +1,286 @@
-#include "shapefil.h"
-#include "TeImportExport.h"
-#include "TeTable.h"
-#include "TeException.h"
-#include "TeUtils.h"
-#include "TeLayer.h"
-#include "TeDatabase.h"
-
-bool
-TeExportShapefile(TeLayer& layer)
-{
-    DBFHandle	hDBF;
-    SHPHandle	hSHP;
-
-	string filename = layer.name();
-	string indexName = layer.indexName();
-	int nrepres = 0;
-	int rep = 0;
-    int	nShapeType;
-	if (layer.hasGeometry(TePOINTS))
-	{
-		nShapeType = SHPT_POINT;
-		rep = TePOINTS;
-		nrepres++;
-	}
-	if (layer.hasGeometry(TePOLYGONS))
-	{
-		nShapeType = SHPT_POLYGON;
-		rep = TePOLYGONS;
-		nrepres++;
-	}
-	if (layer.hasGeometry(TeLINES))
-	{
-		nShapeType = SHPT_ARC;
-		rep = TeLINES;
-		nrepres++;
-	}
-	if (nrepres == 0 || nrepres>1)
-	{
-		return false;
-	}
-
-	string dbfFilename = filename + ".dbf";
-    hDBF = DBFCreate( dbfFilename.c_str() );
-    if( hDBF == 0 )
-		return false;
-
-	string shpFilename = filename + ".shp";
-    hSHP = SHPCreate( shpFilename.c_str(), nShapeType );
-    if( hSHP == 0 )
-		return false;
-
-	TeDatabasePortal* portalObjs = layer.database()->getPortal();
-	TeDatabasePortal* portalGeoms = layer.database()->getPortal();
-
-	string sql1 = "SELECT * FROM " + layer.attributeTable();
-	if (!portalObjs->query(sql1))
-	{
-		delete portalObjs;
-		delete portalGeoms;
-		return false;
-	}
-
-	int i = portalObjs->numFields();
-	vector<int> fieldsTypes;
-	fieldsTypes.resize(i);
-	i=0;
-	TeAttributeList attList=portalObjs->AttributeList();
-	TeAttributeList::iterator it=attList.begin();
-
-	while ( it != attList.end() )
-    {
-		TeAttribute at = (*it);
-		fieldsTypes[i] = at.rep_.type_;
-
-		if (at.rep_.type_ == TeSTRING )
-		{
-			if (DBFAddField( hDBF, at.rep_.name_.c_str(), FTString, at.rep_.numChar_, 0 ) == -1 )
-			{
-				delete portalObjs;
-				delete portalGeoms;
-				return false;
-			}
-		}
-		else if (at.rep_.type_ == TeDATETIME)
-		{
-			if (DBFAddField( hDBF, at.rep_.name_.c_str(), FTDate, 8, 0 ) == -1 )
-			{
-				delete portalObjs;
-				delete portalGeoms;
-				return false;
-			}
-		}
-		else if (at.rep_.type_ == TeINT)
-		{
-			if (DBFAddField( hDBF, at.rep_.name_.c_str(), FTInteger, 10, 0 ) == -1 )
-			{
-				delete portalObjs;
-				delete portalGeoms;
-				return false;
-			}
-		}
-		else if (at.rep_.type_ == TeREAL)
-			if (DBFAddField( hDBF, at.rep_.name_.c_str(), FTDouble, 10, 5 ) == -1 )
-			{
-				delete portalObjs;
-				delete portalGeoms;
-				return false;
-			}
-		i++;
-		it++;
-	}
-    int iRecord = DBFGetRecordCount( hDBF );
-	string geoid, sql2;
-	bool ok;
-
-    int	 nVertices, nParts, *panParts;
-    double	*padfX, *padfY;
-    SHPObject	*psObject;
-
-	TePointSet pos;
-	TeLineSet lis;
-	TePolygonSet pols;
-	while (portalObjs->fetchRow())
-	{
-		geoid = portalObjs->getData(indexName);
-		nVertices = 0;
-		switch (rep)
-		{
-		case TePOINTS:
-			sql2 = "SELECT * FROM " + layer.tableName(TePOINTS) + " WHERE id='" + geoid + "'";
-			ok = false;
-			if (portalGeoms->query(sql2))
-			{
-				while (portalGeoms->fetchRow())
-				{
-					TePoint point = portalGeoms->getPoint();
-					pos.add(point);
-					ok = true;
-				}
-				portalGeoms->freeResult();
-				nVertices = nParts = pos.size();
-				panParts = (int *) malloc(sizeof(int) * nParts);
-				padfX = (double *) malloc(sizeof(double) * nParts);
-				padfY = (double *) malloc(sizeof(double) * nParts);
-				for (int k=0;k<nParts;k++)
-				{
-					panParts[k] = k;
-					padfX[k] = pos[k].location().x();
-					padfY[k] = pos[k].location().y();
-				}
-				psObject = SHPCreateObject( nShapeType, -1, nParts, panParts, NULL,
-											nVertices, padfX, padfY, NULL, NULL );
-				SHPWriteObject( hSHP, -1, psObject );
-
-				SHPDestroyObject( psObject );
-				free( panParts );
-				free( padfX );
-				free( padfY );
-				pos.clear();
-			}
-			break;
-		case TeLINES:
-			sql2 = "SELECT * FROM " + layer.tableName(TeLINES) + " WHERE id='" + geoid + "'";
-			ok = false;
-			int npoints;
-			if (portalGeoms->query(sql2))
-			{
-				npoints = 0;
-				while (portalGeoms->fetchRow())
-				{
-					TeLine2D line = portalGeoms->getLine();
-					lis.add(line);
-					ok = true;
-					npoints += line.size();
-				}
-				portalGeoms->freeResult();
-				nVertices = lis.size();
-				panParts = (int *) malloc(sizeof(int) * nVertices);
-				padfX = (double *) malloc(sizeof(double) * npoints);
-				padfY = (double *) malloc(sizeof(double) * npoints);
-				
-				int posXY = 0;
-				for (int k=0; k<nVertices; k++)
-				{
-					int lineSize = lis[k].size();
-					panParts[k]=posXY;
-					for (int l=0; l<lineSize; l++ )
-					{
-						padfX[posXY] = lis[k][l].x();
-						padfY[posXY] = lis[k][l].y();
-						posXY++;
-					}
-				}
-				lis.clear();
-				psObject = SHPCreateObject( nShapeType, -1, nVertices, panParts, NULL,
-											posXY, padfX, padfY, NULL, NULL );
-				SHPWriteObject( hSHP, -1, psObject );
-
-				SHPDestroyObject( psObject );
-				free( panParts );
-				free( padfX );
-				free( padfY );
-			}
-			break;
-		case TePOLYGONS:
-			sql2 = "SELECT * FROM " + layer.tableName(TePOLYGONS) + " WHERE id='" + geoid + "'";
-			ok = false;
-			int totpoints;
-			nVertices = 0;
-			if (portalGeoms->query(sql2))
-			{
-				totpoints = 0;
-				while (portalGeoms->fetchRow())
-				{
-					TePolygon poly = portalGeoms->getPolygon();
-					pols.add(poly);
-					ok = true;
-					nVertices += poly.size();
-					for (int n=0; n<poly.size();n++)
-						totpoints += poly[n].size();
-				}
-				portalGeoms->freeResult();
-				panParts = (int *) malloc(sizeof(int) * nVertices);
-				padfX = (double *) malloc(sizeof(double) * totpoints);
-				padfY = (double *) malloc(sizeof(double) * totpoints);
-				
-				int posXY = 0;
-				int npolygons, nrings, npoints, nelem = 0;
-				npolygons = pols.size();
-				for (int k=0; k<npolygons; k++)
-				{
-					nrings = pols[k].size();
-					for (int l=0; l<nrings; l++)
-					{
-						npoints = pols[k][l].size();
-						panParts[nelem]=posXY;
-						for (int m=0; m<npoints; m++ )
-						{
-							padfX[posXY] = pols[k][l][m].x();
-							padfY[posXY] = pols[k][l][m].y();
-							posXY++;
-						}
-						nelem++;
-					}
-				}
-				pols.clear();
-				psObject = SHPCreateObject( nShapeType, -1, nelem, panParts, NULL,
-											posXY, padfX, padfY, NULL, NULL );
-				SHPWriteObject( hSHP, -1, psObject );
-
-				SHPDestroyObject( psObject );
-				free( panParts );
-				free( padfX );
-				free( padfY );
-			}
-			break;
-		}
-		
-		if (!ok)
-			continue;
-
-		for (int j = 0; j < portalObjs->numFields(); j++)
-		{
-			int c = fieldsTypes[j];
-			if ( c == TeSTRING )
-			{
-				DBFWriteStringAttribute(hDBF, iRecord, j, portalObjs->getData(j) );
-			}
-			else if (c == TeINT)
-			{
-				DBFWriteIntegerAttribute(hDBF, iRecord, j, atoi(portalObjs->getData(j)) );
-			}
-			else if (c == TeREAL)
-			{
-				DBFWriteDoubleAttribute(hDBF, iRecord, j, atof(portalObjs->getData(j)) );
-			}
-		}
-		iRecord++;
-	}
-	DBFClose( hDBF );
-    SHPClose( hSHP );
-	delete portalObjs;
-	delete portalGeoms;
-    return true ;
+#include "shapefil.h"
+#include "TeImportExport.h"
+#include "TeTable.h"
+#include "TeException.h"
+#include "TeUtils.h"
+#include "TeLayer.h"
+#include "TeDatabase.h"
+
+bool
+TeExportShapefile(TeLayer& layer)
+{
+    DBFHandle	hDBF;
+    SHPHandle	hSHP;
+
+	string filename = layer.name();
+	string indexName = layer.indexName();
+	int nrepres = 0;
+	int rep = 0;
+    int	nShapeType;
+	if (layer.hasGeometry(TePOINTS))
+	{
+		nShapeType = SHPT_POINT;
+		rep = TePOINTS;
+		nrepres++;
+	}
+	if (layer.hasGeometry(TePOLYGONS))
+	{
+		nShapeType = SHPT_POLYGON;
+		rep = TePOLYGONS;
+		nrepres++;
+	}
+	if (layer.hasGeometry(TeLINES))
+	{
+		nShapeType = SHPT_ARC;
+		rep = TeLINES;
+		nrepres++;
+	}
+	if (nrepres == 0 || nrepres>1)
+	{
+		return false;
+	}
+
+	string dbfFilename = filename + ".dbf";
+    hDBF = DBFCreate( dbfFilename.c_str() );
+    if( hDBF == 0 )
+		return false;
+
+	string shpFilename = filename + ".shp";
+    hSHP = SHPCreate( shpFilename.c_str(), nShapeType );
+    if( hSHP == 0 )
+		return false;
+
+	TeDatabasePortal* portalObjs = layer.database()->getPortal();
+	TeDatabasePortal* portalGeoms = layer.database()->getPortal();
+
+	string sql1 = "SELECT * FROM " + layer.attributeTable();
+	if (!portalObjs->query(sql1))
+	{
+		delete portalObjs;
+		delete portalGeoms;
+		return false;
+	}
+
+	int i = portalObjs->numFields();
+	vector<int> fieldsTypes;
+	fieldsTypes.resize(i);
+	i=0;
+	TeAttributeList attList=portalObjs->AttributeList();
+	TeAttributeList::iterator it=attList.begin();
+
+	while ( it != attList.end() )
+    {
+		TeAttribute at = (*it);
+		fieldsTypes[i] = at.rep_.type_;
+
+		if (at.rep_.type_ == TeSTRING )
+		{
+			if (DBFAddField( hDBF, at.rep_.name_.c_str(), FTString, at.rep_.numChar_, 0 ) == -1 )
+			{
+				delete portalObjs;
+				delete portalGeoms;
+				return false;
+			}
+		}
+		else if (at.rep_.type_ == TeDATETIME)
+		{
+			if (DBFAddField( hDBF, at.rep_.name_.c_str(), FTDate, 8, 0 ) == -1 )
+			{
+				delete portalObjs;
+				delete portalGeoms;
+				return false;
+			}
+		}
+		else if (at.rep_.type_ == TeINT)
+		{
+			if (DBFAddField( hDBF, at.rep_.name_.c_str(), FTInteger, 10, 0 ) == -1 )
+			{
+				delete portalObjs;
+				delete portalGeoms;
+				return false;
+			}
+		}
+		else if (at.rep_.type_ == TeREAL)
+			if (DBFAddField( hDBF, at.rep_.name_.c_str(), FTDouble, 10, 5 ) == -1 )
+			{
+				delete portalObjs;
+				delete portalGeoms;
+				return false;
+			}
+		i++;
+		it++;
+	}
+    int iRecord = DBFGetRecordCount( hDBF );
+	string geoid, sql2;
+	bool ok;
+
+    int	 nVertices, nParts, *panParts;
+    double	*padfX, *padfY;
+    SHPObject	*psObject;
+
+	TePointSet pos;
+	TeLineSet lis;
+	TePolygonSet pols;
+	while (portalObjs->fetchRow())
+	{
+		geoid = portalObjs->getData(indexName);
+		nVertices = 0;
+		switch (rep)
+		{
+		case TePOINTS:
+			sql2 = "SELECT * FROM " + layer.tableName(TePOINTS) + " WHERE id='" + geoid + "'";
+			ok = false;
+			if (portalGeoms->query(sql2))
+			{
+				while (portalGeoms->fetchRow())
+				{
+					TePoint point = portalGeoms->getPoint();
+					pos.add(point);
+					ok = true;
+				}
+				portalGeoms->freeResult();
+				nVertices = nParts = pos.size();
+				panParts = (int *) malloc(sizeof(int) * nParts);
+				padfX = (double *) malloc(sizeof(double) * nParts);
+				padfY = (double *) malloc(sizeof(double) * nParts);
+				for (int k=0;k<nParts;k++)
+				{
+					panParts[k] = k;
+					padfX[k] = pos[k].location().x();
+					padfY[k] = pos[k].location().y();
+				}
+				psObject = SHPCreateObject( nShapeType, -1, nParts, panParts, NULL,
+											nVertices, padfX, padfY, NULL, NULL );
+				SHPWriteObject( hSHP, -1, psObject );
+
+				SHPDestroyObject( psObject );
+				free( panParts );
+				free( padfX );
+				free( padfY );
+				pos.clear();
+			}
+			break;
+		case TeLINES:
+			sql2 = "SELECT * FROM " + layer.tableName(TeLINES) + " WHERE id='" + geoid + "'";
+			ok = false;
+			int npoints;
+			if (portalGeoms->query(sql2))
+			{
+				npoints = 0;
+				while (portalGeoms->fetchRow())
+				{
+					TeLine2D line = portalGeoms->getLine();
+					lis.add(line);
+					ok = true;
+					npoints += line.size();
+				}
+				portalGeoms->freeResult();
+				nVertices = lis.size();
+				panParts = (int *) malloc(sizeof(int) * nVertices);
+				padfX = (double *) malloc(sizeof(double) * npoints);
+				padfY = (double *) malloc(sizeof(double) * npoints);
+				
+				int posXY = 0;
+				for (int k=0; k<nVertices; k++)
+				{
+					int lineSize = lis[k].size();
+					panParts[k]=posXY;
+					for (int l=0; l<lineSize; l++ )
+					{
+						padfX[posXY] = lis[k][l].x();
+						padfY[posXY] = lis[k][l].y();
+						posXY++;
+					}
+				}
+				lis.clear();
+				psObject = SHPCreateObject( nShapeType, -1, nVertices, panParts, NULL,
+											posXY, padfX, padfY, NULL, NULL );
+				SHPWriteObject( hSHP, -1, psObject );
+
+				SHPDestroyObject( psObject );
+				free( panParts );
+				free( padfX );
+				free( padfY );
+			}
+			break;
+		case TePOLYGONS:
+			sql2 = "SELECT * FROM " + layer.tableName(TePOLYGONS) + " WHERE id='" + geoid + "'";
+			ok = false;
+			int totpoints;
+			nVertices = 0;
+			if (portalGeoms->query(sql2))
+			{
+				totpoints = 0;
+				while (portalGeoms->fetchRow())
+				{
+					TePolygon poly = portalGeoms->getPolygon();
+					pols.add(poly);
+					ok = true;
+					nVertices += poly.size();
+					for (int n=0; n<poly.size();n++)
+						totpoints += poly[n].size();
+				}
+				portalGeoms->freeResult();
+				panParts = (int *) malloc(sizeof(int) * nVertices);
+				padfX = (double *) malloc(sizeof(double) * totpoints);
+				padfY = (double *) malloc(sizeof(double) * totpoints);
+				
+				int posXY = 0;
+				int npolygons, nrings, npoints, nelem = 0;
+				npolygons = pols.size();
+				for (int k=0; k<npolygons; k++)
+				{
+					nrings = pols[k].size();
+					for (int l=0; l<nrings; l++)
+					{
+						npoints = pols[k][l].size();
+						panParts[nelem]=posXY;
+						for (int m=0; m<npoints; m++ )
+						{
+							padfX[posXY] = pols[k][l][m].x();
+							padfY[posXY] = pols[k][l][m].y();
+							posXY++;
+						}
+						nelem++;
+					}
+				}
+				pols.clear();
+				psObject = SHPCreateObject( nShapeType, -1, nelem, panParts, NULL,
+											posXY, padfX, padfY, NULL, NULL );
+				SHPWriteObject( hSHP, -1, psObject );
+
+				SHPDestroyObject( psObject );
+				free( panParts );
+				free( padfX );
+				free( padfY );
+			}
+			break;
+		}
+		
+		if (!ok)
+			continue;
+
+		for (int j = 0; j < portalObjs->numFields(); j++)
+		{
+			int c = fieldsTypes[j];
+			if ( c == TeSTRING )
+			{
+				DBFWriteStringAttribute(hDBF, iRecord, j, portalObjs->getData(j) );
+			}
+			else if (c == TeINT)
+			{
+				DBFWriteIntegerAttribute(hDBF, iRecord, j, atoi(portalObjs->getData(j)) );
+			}
+			else if (c == TeREAL)
+			{
+				DBFWriteDoubleAttribute(hDBF, iRecord, j, atof(portalObjs->getData(j)) );
+			}
+		}
+		iRecord++;
+	}
+	DBFClose( hDBF );
+    SHPClose( hSHP );
+	delete portalObjs;
+	delete portalGeoms;
+    return true ;
 }
\ No newline at end of file
diff --git a/src/terralib/drivers/shapelib/TeExportSHP.cpp b/src/terralib/drivers/shapelib/TeExportSHP.cpp
old mode 100755
new mode 100644
index ac55d82..ccb6faf
--- a/src/terralib/drivers/shapelib/TeExportSHP.cpp
+++ b/src/terralib/drivers/shapelib/TeExportSHP.cpp
@@ -1,663 +1,663 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeDriverSHPDBF.h"
-#include "TeTable.h"
-#include "TeException.h"
-#include "TeUtils.h"
-#include "TeLayer.h"
-#include "TeDatabase.h"
-#include "TeQuerier.h"
-
-#include <assert.h>
-#include <vector>
-
-DBFHandle TeCreateDBFFile (const string& dbfFilename, TeAttributeList& attList)
-{
-	DBFHandle hDBF = DBFCreate( dbfFilename.c_str() );
-	if( hDBF == 0 )
-		return 0;
-	
-	int i =0;
-	TeAttributeList::iterator it=attList.begin();
-
-	while ( it != attList.end() )
-	{
-		TeAttribute at = (*it);
-		string atName = at.rep_.name_;
-
-		if (atName.size() > 10)
-		{
-			int extra = (int)(atName.size() - 10)/2;
-			int middle = (int)(atName.size()/2);
-			string str = atName.substr(0,middle-extra-1);
-			str += atName.substr(middle+extra);
-			atName = str;
-		}
-		if (at.rep_.type_ == TeSTRING )
-		{
-			if (DBFAddField( hDBF, atName.c_str(), FTString, at.rep_.numChar_, 0 ) == -1 )
-				return 0;
-		}
-		else if (at.rep_.type_ == TeINT)
-		{
-			if (DBFAddField( hDBF, atName.c_str(), FTInteger, 32, 0 ) == -1 )
-				return 0;
-		}
-		else if (at.rep_.type_ == TeREAL)
-		{
-			if (DBFAddField( hDBF, atName.c_str(), FTDouble, 40, 15 ) == -1 )
-				return 0;
-		}
-		// OBS: shapelib doesn�t deal with xBase field type for Date 
-		// we are transforming it to string
-		else if (at.rep_.type_ == TeDATETIME)
-		{
-			if (DBFAddField( hDBF, atName.c_str(), FTDate, 8, 0 ) == -1 )
-				return 0;
-		}
-		++i;
-		++it;
-	}
-	return hDBF;
-}
-
-bool TeExportPolygonSet2SHP( const TePolygonSet& ps,const std::string& base_file_name  )
-{
-    // creating files names
-    std::string dbfFilename = base_file_name + ".dbf";
-    std::string shpFilename = base_file_name + ".shp";
-
-    // creating polygons attribute list ( max attribute size == 25 )
-    TeAttributeList attList;
-    TeAttribute at;
-    at.rep_.type_ = TeSTRING;               //the id of the cell
-    at.rep_.numChar_ = 25;
-    at.rep_.name_ = "object_id_";
-    at.rep_.isPrimaryKey_ = true;
-	attList.push_back(at);
-    
-    /* DBF output file handle creation */
-	DBFHandle hDBF = TeCreateDBFFile (dbfFilename, attList);
-	if ( hDBF == 0 )
-		return false;
-    
-    /* SHP output file handle creation */
-    SHPHandle hSHP = SHPCreate( shpFilename.c_str(), SHPT_POLYGON );
-    if( hSHP == 0 ) 
-	{
-      DBFClose( hDBF );
-      return false;
-    }
-    
-    /* Writing polygons */
-    int iRecord = 0;
-    int totpoints = 0;
-    double  *padfX, *padfY;
-    SHPObject       *psObject;
-    int posXY, npoints, nelem;
-    int nVertices;
-    int* panParts;
-
-    TePolygonSet::iterator itps;
-    TePolygon poly;
-
-    for (itps = ps.begin() ; itps != ps.end() ; itps++ ) {
-      poly=(*itps);
-      totpoints = 0;
-      nVertices = poly.size();
-      for (unsigned int n=0; n<poly.size();n++) {
-        totpoints += poly[n].size();
-      }
-
-      panParts = (int *) malloc(sizeof(int) * nVertices);
-      padfX = (double *) malloc(sizeof(double) * totpoints);
-      padfY = (double *) malloc(sizeof(double) * totpoints);
-      posXY = 0;
-      nelem = 0;
-      
-      for (unsigned int l=0; l<poly.size(); ++l) {
-        if (l==0) {
-          if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) {
-            TeReverseLine(poly[l]);
-          }
-        } else {
-          if (TeOrientation(poly[l]) == TeCLOCKWISE) {
-            TeReverseLine(poly[l]);
-          }
-        }
-        
-        npoints = poly[l].size();
-        panParts[nelem]=posXY;
-        
-        for (int m=0; m<npoints; m++ ) {
-          padfX[posXY] = poly[l][m].x_;
-          padfY[posXY] = poly[l][m].y_;
-          posXY++;
-        }
-        nelem++;
-      }
-                
-      psObject = SHPCreateObject( SHPT_POLYGON, -1, nelem, panParts, NULL,
-        posXY, padfX, padfY, NULL, NULL );
-        
-      int shpRes = SHPWriteObject( hSHP, -1, psObject );
-      if (shpRes == -1 )
-	  {
-	      DBFClose( hDBF );
-		  SHPClose( hSHP );
-		  return false;
-	  }
-        
-      SHPDestroyObject( psObject );
-      free( panParts );
-      free( padfX );
-      free( padfY );
-
-      // writing attributes - same creation order
-      DBFWriteStringAttribute(hDBF, iRecord, 0, poly.objectId().c_str() );
-            
-      iRecord++;
-    }
-    
-    DBFClose( hDBF );
-    SHPClose( hSHP );
-    return true;  
-}
-
-
-bool
-TeExportQuerierToShapefile(TeQuerier* querier, const std::string& base)
-{
-	// check initial conditions
-	if (!querier)
-		return false;
-
-	if (!querier->loadInstances())
-		return false;
-
-	// Get the list of attributes defined by the input querier
-	bool onlyObjId = false;
-	TeAttributeList qAttList = querier->getAttrList();
-	if (qAttList.empty())
-	{
-		TeAttributeList qAttList;
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;               
-		at.rep_.numChar_ = 100;
-		at.rep_.name_ = "ID";
-		at.rep_.isPrimaryKey_ = true;
-		qAttList.push_back(at);
-		onlyObjId = true;
-	}
-
-	// Handles to each type of geometries that will be created if necessary
-	DBFHandle hDBFPol = 0;
-	SHPHandle hSHPPol = 0;
-	DBFHandle hDBFLin = 0;
-	SHPHandle hSHPLin = 0;
-	DBFHandle hDBFPt = 0;
-	SHPHandle hSHPPt = 0;
-
-	// Some auxiliary variables
-    int totpoints;
-    double*	padfX;
-	double*	padfY;
-    unsigned int nVertices;
-    int* panPart;
-    SHPObject *psObject;
-    unsigned int posXY, npoints, nelem;
-	int shpRes;
-
-	// progress information
-	if (TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-	int dt = CLOCKS_PER_SEC/2;
-	int dt2 = CLOCKS_PER_SEC; //* .000001;
-
-	// Loop through the instances writting their geometries and attributes
-	unsigned int iRecPol=0, iRecLin=0, iRecPt=0;
-	unsigned int n, l, m;
-	unsigned int nIProcessed = 0;
-	TeSTInstance st;
-	while(querier->fetchInstance(st))
-	{
-		totpoints = 0;
-		nVertices = 0;
-		if (st.hasPolygons())
-		{
-			TePolygonSet& polSet = st.getPolygons();
-			TePolygonSet::iterator itps;
-			int nVerticesCount = 0;
-			for (itps = polSet.begin(); itps != polSet.end(); ++itps) 
-			{
-				nVertices = (*itps).size();
-				nVerticesCount += nVertices;
-				for (n=0; n<nVertices;++n) 
-					totpoints += (*itps)[n].size();
-			}
-
-			panPart = (int *) malloc(sizeof(int) * nVerticesCount);
-			padfX = (double *) malloc(sizeof(double) * totpoints);
-			padfY = (double *) malloc(sizeof(double) * totpoints);
-
-			posXY = 0;
-			nelem = 0;
-			for (itps = polSet.begin(); itps != polSet.end(); ++itps) 
-			{
-				TePolygon poly = *itps;
-				for (l=0; l<poly.size(); ++l) 
-				{
-					if (l==0) 
-					{
-						if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) 
-							TeReverseLine(poly[l]);
-					}
-					else 
-					{
-						if (TeOrientation(poly[l]) == TeCLOCKWISE)
-							TeReverseLine(poly[l]);
-					}
-					npoints = poly[l].size();
-					panPart[nelem]=posXY;
-        
-					for (m=0; m<npoints; ++m) 
-					{
-						padfX[posXY] = poly[l][m].x_;
-						padfY[posXY] = poly[l][m].y_;
-						posXY++;
-					}
-					nelem++;
-				}
-			}
-			psObject = SHPCreateObject(SHPT_POLYGON, -1, nelem, panPart, NULL, posXY, padfX, padfY, NULL, NULL);
-			if (hSHPPol == 0)
-			{
-				string fname = base + "_pol.shp";
-				hSHPPol = SHPCreate(fname.c_str(), SHPT_POLYGON);
-   				assert (hSHPPol != 0);
-			}	
-			shpRes = SHPWriteObject(hSHPPol, -1, psObject);
-			SHPDestroyObject(psObject);
-			free(panPart);
-			free(padfX);
-			free(padfY);
-			assert(shpRes != -1);   
-			if (hDBFPol == 0)
-			{
-				hDBFPol = TeCreateDBFFile(base + "_pol.dbf", qAttList);
-				assert (hDBFPol != 0);
-			}
-			if (onlyObjId)
-			{
-				DBFWriteStringAttribute(hDBFPol, iRecPol, 0, st.objectId().c_str());
-			}
-			else
-			{
-				string val;
-				for (n=0; n<qAttList.size();++n) 
-				{
-					st.getPropertyValue(val,n);
-					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
-					{
-						DBFWriteStringAttribute(hDBFPol, iRecPol, n, val.c_str());
-					}
-					else if (qAttList[n].rep_.type_ == TeINT)
-					{
-						DBFWriteIntegerAttribute(hDBFPol, iRecPol, n, atoi(val.c_str()));
-					}
-					else if (qAttList[n].rep_.type_ == TeREAL)
-					{
-						DBFWriteDoubleAttribute(hDBFPol, iRecPol, n, atof(val.c_str()));
-					}
-				}
-			}
-			++iRecPol;
-		}
-		if (st.hasCells())
-		{
-			TeCellSet& cellSet = st.getCells();
-			nVertices = cellSet.size();
-			totpoints = nVertices*5;
-			panPart = (int *) malloc(sizeof(int) * nVertices);
-			padfX = (double *) malloc(sizeof(double) * totpoints);
-			padfY = (double *) malloc(sizeof(double) * totpoints);
-			posXY = 0;
-			nelem = 0;
-			TeCellSet::iterator itcs;
-			for (itcs=cellSet.begin(); itcs!=cellSet.end(); ++itcs)
-			{
-				panPart[nelem]=posXY;
-				padfX[posXY] = (*itcs).box().lowerLeft().x();
-				padfY[posXY] = (*itcs).box().lowerLeft().y();
-				posXY++;		
-				padfX[posXY] = (*itcs).box().upperRight().x();
-				padfY[posXY] = (*itcs).box().lowerLeft().y();
-				posXY++;		
-				padfX[posXY] = (*itcs).box().upperRight().x();
-				padfY[posXY] = (*itcs).box().upperRight().y();
-				posXY++;		
-				padfX[posXY] = (*itcs).box().lowerLeft().x();
-				padfY[posXY] = (*itcs).box().upperRight().y();
-				posXY++;		
-				padfX[posXY] = (*itcs).box().lowerLeft().x();
-				padfY[posXY] = (*itcs).box().lowerLeft().y();
-				++posXY;	
-				++nelem;
-			} 
-			psObject = SHPCreateObject(SHPT_POLYGON, -1, nelem, panPart, NULL,posXY, padfX, padfY, NULL, NULL);
-			if (hSHPPol == 0)
-			{
-				string fname = base + "_pol.shp";
-				hSHPPol = SHPCreate(fname.c_str(), SHPT_POLYGON);
-   				assert (hSHPPol != 0);
-			}	
-			shpRes = SHPWriteObject(hSHPPol, -1, psObject);
-			SHPDestroyObject(psObject);
-			free(panPart);
-			free(padfX);
-			free(padfY);
-			assert(shpRes != -1);
-			if (hDBFPol == 0)
-			{
-				hDBFPol = TeCreateDBFFile(base + "_pol.dbf", qAttList);
-				assert (hDBFPol != 0);
-			}
-
-			if (onlyObjId)
-			{
-				DBFWriteStringAttribute(hDBFPol, iRecPol, 0, st.objectId().c_str());
-			}
-			else
-			{
-				string val;
-				for (n=0; n<qAttList.size();++n) 
-				{
-					st.getPropertyValue(val,n);
-					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
-					{
-						DBFWriteStringAttribute(hDBFPol, iRecPol, n, val.c_str());
-					}
-					else if (qAttList[n].rep_.type_ == TeINT)
-					{
-						DBFWriteIntegerAttribute(hDBFPol, iRecPol, n, atoi(val.c_str()));
-					}
-					else if (qAttList[n].rep_.type_ == TeREAL)
-					{
-						DBFWriteDoubleAttribute(hDBFPol, iRecPol, n, atof(val.c_str()));
-					}
-				}
-			}
-			++iRecPol;
-		}
-		if (st.hasLines())
-		{
-			TeLineSet& lineSet = st.getLines();
-			nVertices = lineSet.size();
-			TeLineSet::iterator itls;
-			for (itls=lineSet.begin(); itls!=lineSet.end(); ++itls)
-				totpoints += (*itls).size();
-			panPart = (int *) malloc(sizeof(int) * nVertices);
-			padfX = (double *) malloc(sizeof(double) * totpoints);
-			padfY = (double *) malloc(sizeof(double) * totpoints);
-			posXY = 0;
-			nelem = 0;
-			for (itls=lineSet.begin(); itls!=lineSet.end(); ++itls)
-			{
-				panPart[nelem]=posXY;
-				for (l=0; l<(*itls).size(); ++l)
-				{
-					padfX[posXY] = (*itls)[l].x();
-					padfY[posXY] = (*itls)[l].y();
-					++posXY;
-				}
-				++nelem;
-			}
-			psObject = SHPCreateObject(SHPT_ARC, -1, nVertices, panPart, NULL,	posXY, padfX, padfY, NULL, NULL);
-			if (hSHPLin == 0)
-			{
-				string fname = base + "_lin.shp"; 
-				hSHPLin = SHPCreate(fname.c_str(), SHPT_ARC);
-   				assert (hSHPLin != 0);
-			}		
-			shpRes = SHPWriteObject(hSHPLin, -1, psObject);
-			SHPDestroyObject(psObject);
-			free(panPart);
-			free(padfX);
-			free(padfY);
-			assert(shpRes != -1);
-			if (hDBFLin == 0)
-			{
-				hDBFLin = TeCreateDBFFile(base + "_lin.dbf", qAttList);
-				assert (hDBFLin != 0);
-			}
-			if (onlyObjId)
-			{
-				DBFWriteStringAttribute(hDBFLin, iRecLin, 0, st.objectId().c_str());
-			}
-			else
-			{
-				string val;
-				for (n=0; n<qAttList.size();++n) 
-				{
-					st.getPropertyValue(val,n);
-					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
-					{
-						DBFWriteStringAttribute(hDBFLin, iRecLin, n, val.c_str());
-					}
-					else if (qAttList[n].rep_.type_ == TeINT)
-					{
-						DBFWriteIntegerAttribute(hDBFLin, iRecLin, n, atoi(val.c_str()));
-					}
-					else if (qAttList[n].rep_.type_ == TeREAL)
-					{
-						DBFWriteDoubleAttribute(hDBFLin, iRecLin, n, atof(val.c_str()));
-					}
-				}
-			}
-			++iRecLin;
-		}
-		if (st.hasPoints())
-		{
-			TePointSet& pointSet = st.getPoints();
-			nVertices = pointSet.size();
-			panPart = (int *) malloc(sizeof(int) * nVertices);
-			padfX = (double *) malloc(sizeof(double) * nVertices);
-			padfY = (double *) malloc(sizeof(double) * nVertices);
-			nelem = 0;
-			TePointSet::iterator itpts;
-			for (itpts=pointSet.begin(); itpts!=pointSet.end(); ++itpts)
-			{
-				panPart[nelem] = nelem;
-				padfX[nelem] = (*itpts).location().x();
-				padfY[nelem] = (*itpts).location().y();
-				++nelem;
-			}
-			psObject = SHPCreateObject(SHPT_POINT, -1, nVertices, panPart, NULL, nVertices, padfX, padfY, NULL, NULL );
-			if (hSHPPt == 0)
-			{
-				string fname = base + "_pt.shp";
-				hSHPPt = SHPCreate(fname.c_str(), SHPT_POINT);
-   				assert (hSHPPt != 0);
-			}		
-			shpRes = SHPWriteObject(hSHPPt, -1, psObject);
-			SHPDestroyObject(psObject);
-			free(panPart);
-			free(padfX);
-			free(padfY);
-			assert(shpRes != -1);
-			if (hDBFPt == 0)
-			{
-				hDBFPt = TeCreateDBFFile(base + "_pt.dbf", qAttList);
-				assert (hDBFPt != 0);
-			}
-			if (onlyObjId)
-			{
-				DBFWriteStringAttribute(hDBFPt, iRecPt, 0, st.objectId().c_str());
-			}
-			else
-			{
-				string val;
-				for (n=0; n<qAttList.size();++n) 
-				{
-					st.getPropertyValue(val,n);
-						if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
-					{
-						DBFWriteStringAttribute(hDBFPt, iRecPt, n, val.c_str());
-					}
-					else if (qAttList[n].rep_.type_ == TeINT)
-					{
-						DBFWriteIntegerAttribute(hDBFPt, iRecPt, n, atoi(val.c_str()));
-					}
-					else if (qAttList[n].rep_.type_ == TeREAL)
-					{
-						DBFWriteDoubleAttribute(hDBFPt, iRecPt, n, atof(val.c_str()));
-					}
-				}
-			}
-			++iRecPt;
-		}
-		++nIProcessed;
-		if (TeProgress::instance() && int(t2-t1) > dt)
-		{
-			t1 = t2;
-			if(((int)(t2-t0) > dt2))
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(nIProcessed);
-			}
-		}
-
-	}
-	if (hDBFPol != 0)
-		DBFClose(hDBFPol);
-	if (hSHPPol != 0)
-        SHPClose(hSHPPol);
-	if (hDBFLin != 0)
-		DBFClose(hDBFLin);
-	if (hSHPLin != 0)
-        SHPClose(hSHPLin);
-	if (hDBFPt != 0)
-		DBFClose(hDBFPt);
-	if (hSHPPt != 0)
-        SHPClose(hSHPPt);
-
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-
-bool
-TeExportShapefile(TeLayer* layer, const string& shpFileName, const string& tableName, const string& restriction)
-{
-  	if (!layer || shpFileName.empty())
-		return false;
-
-	// check if asked table exist
-	TeAttrTableVector& vTables = layer->attrTables();
-	TeAttrTableVector::iterator it = vTables.begin();
-	while (it != vTables.end())
-	{
-		if (it->name() == tableName) 
-			break;
-		++it;
-	}
-	if (it == vTables.end())
-		return false;
-	TeAttrTableVector askedTable;
-	askedTable.push_back(*it);
-
-	TeTheme* tempTheme = new TeTheme();
-	tempTheme->attributeRest(restriction);
-	tempTheme->layer(layer);
-	tempTheme->collectionTable("");
-	tempTheme->collectionAuxTable("");
-	tempTheme->setAttTables(askedTable);
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(tempTheme);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToShapefile(tQuerier, shpFileName);
-	delete tQuerier;
-	delete tempTheme;
-    return res ;
-}
-
-bool 
-TeExportLayerToShapefile(TeLayer* layer, const string& baseName)
-{
-  	if (!layer)
-		return false;
-
-	string fbase = baseName;
-	if (baseName.empty())
-		fbase = layer->name();
-
-	TeTheme* tempTheme = new TeTheme();
-	tempTheme->layer(layer);
-	tempTheme->collectionTable("");
-	tempTheme->collectionAuxTable("");
-	tempTheme->setAttTables(layer->attrTables());
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(tempTheme);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToShapefile(tQuerier, baseName);
-	delete tQuerier;
-	delete tempTheme;
-    return res ;
-}
-
-
-bool 
-TeExportThemeToShapefile(TeTheme* theme, TeSelectedObjects selOb, const std::string& baseName)
-{
-	if (!theme)
-		return false;
-
-	string fbase = baseName;
-	if (baseName.empty())
-		fbase = theme->name();
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(theme);
-	qPar.setSelecetObjs(selOb);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToShapefile(tQuerier, fbase);
-	delete tQuerier;
-	return res;
-}
-
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeDriverSHPDBF.h"
+#include "TeTable.h"
+#include "TeException.h"
+#include "TeUtils.h"
+#include "TeLayer.h"
+#include "TeDatabase.h"
+#include "TeQuerier.h"
+
+#include <assert.h>
+#include <vector>
+
+DBFHandle TeCreateDBFFile (const string& dbfFilename, TeAttributeList& attList)
+{
+	DBFHandle hDBF = DBFCreate( dbfFilename.c_str() );
+	if( hDBF == 0 )
+		return 0;
+	
+	int i =0;
+	TeAttributeList::iterator it=attList.begin();
+
+	while ( it != attList.end() )
+	{
+		TeAttribute at = (*it);
+		string atName = at.rep_.name_;
+
+		if (atName.size() > 10)
+		{
+			int extra = (int)(atName.size() - 10)/2;
+			int middle = (int)(atName.size()/2);
+			string str = atName.substr(0,middle-extra-1);
+			str += atName.substr(middle+extra);
+			atName = str;
+		}
+		if (at.rep_.type_ == TeSTRING )
+		{
+			if (DBFAddField( hDBF, atName.c_str(), FTString, at.rep_.numChar_, 0 ) == -1 )
+				return 0;
+		}
+		else if (at.rep_.type_ == TeINT)
+		{
+			if (DBFAddField( hDBF, atName.c_str(), FTInteger, 32, 0 ) == -1 )
+				return 0;
+		}
+		else if (at.rep_.type_ == TeREAL)
+		{
+			if (DBFAddField( hDBF, atName.c_str(), FTDouble, 40, 15 ) == -1 )
+				return 0;
+		}
+		// OBS: shapelib doesn�t deal with xBase field type for Date 
+		// we are transforming it to string
+		else if (at.rep_.type_ == TeDATETIME)
+		{
+			if (DBFAddField( hDBF, atName.c_str(), FTDate, 8, 0 ) == -1 )
+				return 0;
+		}
+		++i;
+		++it;
+	}
+	return hDBF;
+}
+
+bool TeExportPolygonSet2SHP( const TePolygonSet& ps,const std::string& base_file_name  )
+{
+    // creating files names
+    std::string dbfFilename = base_file_name + ".dbf";
+    std::string shpFilename = base_file_name + ".shp";
+
+    // creating polygons attribute list ( max attribute size == 25 )
+    TeAttributeList attList;
+    TeAttribute at;
+    at.rep_.type_ = TeSTRING;               //the id of the cell
+    at.rep_.numChar_ = 25;
+    at.rep_.name_ = "object_id_";
+    at.rep_.isPrimaryKey_ = true;
+	attList.push_back(at);
+    
+    /* DBF output file handle creation */
+	DBFHandle hDBF = TeCreateDBFFile (dbfFilename, attList);
+	if ( hDBF == 0 )
+		return false;
+    
+    /* SHP output file handle creation */
+    SHPHandle hSHP = SHPCreate( shpFilename.c_str(), SHPT_POLYGON );
+    if( hSHP == 0 ) 
+	{
+      DBFClose( hDBF );
+      return false;
+    }
+    
+    /* Writing polygons */
+    int iRecord = 0;
+    int totpoints = 0;
+    double  *padfX, *padfY;
+    SHPObject       *psObject;
+    int posXY, npoints, nelem;
+    int nVertices;
+    int* panParts;
+
+    TePolygonSet::iterator itps;
+    TePolygon poly;
+
+    for (itps = ps.begin() ; itps != ps.end() ; itps++ ) {
+      poly=(*itps);
+      totpoints = 0;
+      nVertices = poly.size();
+      for (unsigned int n=0; n<poly.size();n++) {
+        totpoints += poly[n].size();
+      }
+
+      panParts = (int *) malloc(sizeof(int) * nVertices);
+      padfX = (double *) malloc(sizeof(double) * totpoints);
+      padfY = (double *) malloc(sizeof(double) * totpoints);
+      posXY = 0;
+      nelem = 0;
+      
+      for (unsigned int l=0; l<poly.size(); ++l) {
+        if (l==0) {
+          if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) {
+            TeReverseLine(poly[l]);
+          }
+        } else {
+          if (TeOrientation(poly[l]) == TeCLOCKWISE) {
+            TeReverseLine(poly[l]);
+          }
+        }
+        
+        npoints = poly[l].size();
+        panParts[nelem]=posXY;
+        
+        for (int m=0; m<npoints; m++ ) {
+          padfX[posXY] = poly[l][m].x_;
+          padfY[posXY] = poly[l][m].y_;
+          posXY++;
+        }
+        nelem++;
+      }
+                
+      psObject = SHPCreateObject( SHPT_POLYGON, -1, nelem, panParts, NULL,
+        posXY, padfX, padfY, NULL, NULL );
+        
+      int shpRes = SHPWriteObject( hSHP, -1, psObject );
+      if (shpRes == -1 )
+	  {
+	      DBFClose( hDBF );
+		  SHPClose( hSHP );
+		  return false;
+	  }
+        
+      SHPDestroyObject( psObject );
+      free( panParts );
+      free( padfX );
+      free( padfY );
+
+      // writing attributes - same creation order
+      DBFWriteStringAttribute(hDBF, iRecord, 0, poly.objectId().c_str() );
+            
+      iRecord++;
+    }
+    
+    DBFClose( hDBF );
+    SHPClose( hSHP );
+    return true;  
+}
+
+
+bool
+TeExportQuerierToShapefile(TeQuerier* querier, const std::string& base)
+{
+	// check initial conditions
+	if (!querier)
+		return false;
+
+	if (!querier->loadInstances())
+		return false;
+
+	// Get the list of attributes defined by the input querier
+	bool onlyObjId = false;
+	TeAttributeList qAttList = querier->getAttrList();
+	if (qAttList.empty())
+	{
+		TeAttributeList qAttList;
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;               
+		at.rep_.numChar_ = 100;
+		at.rep_.name_ = "ID";
+		at.rep_.isPrimaryKey_ = true;
+		qAttList.push_back(at);
+		onlyObjId = true;
+	}
+
+	// Handles to each type of geometries that will be created if necessary
+	DBFHandle hDBFPol = 0;
+	SHPHandle hSHPPol = 0;
+	DBFHandle hDBFLin = 0;
+	SHPHandle hSHPLin = 0;
+	DBFHandle hDBFPt = 0;
+	SHPHandle hSHPPt = 0;
+
+	// Some auxiliary variables
+    int totpoints;
+    double*	padfX;
+	double*	padfY;
+    unsigned int nVertices;
+    int* panPart;
+    SHPObject *psObject;
+    unsigned int posXY, npoints, nelem;
+	int shpRes;
+
+	// progress information
+	if (TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+	int dt = CLOCKS_PER_SEC/2;
+	int dt2 = CLOCKS_PER_SEC; //* .000001;
+
+	// Loop through the instances writting their geometries and attributes
+	unsigned int iRecPol=0, iRecLin=0, iRecPt=0;
+	unsigned int n, l, m;
+	unsigned int nIProcessed = 0;
+	TeSTInstance st;
+	while(querier->fetchInstance(st))
+	{
+		totpoints = 0;
+		nVertices = 0;
+		if (st.hasPolygons())
+		{
+			TePolygonSet& polSet = st.getPolygons();
+			TePolygonSet::iterator itps;
+			int nVerticesCount = 0;
+			for (itps = polSet.begin(); itps != polSet.end(); ++itps) 
+			{
+				nVertices = (*itps).size();
+				nVerticesCount += nVertices;
+				for (n=0; n<nVertices;++n) 
+					totpoints += (*itps)[n].size();
+			}
+
+			panPart = (int *) malloc(sizeof(int) * nVerticesCount);
+			padfX = (double *) malloc(sizeof(double) * totpoints);
+			padfY = (double *) malloc(sizeof(double) * totpoints);
+
+			posXY = 0;
+			nelem = 0;
+			for (itps = polSet.begin(); itps != polSet.end(); ++itps) 
+			{
+				TePolygon poly = *itps;
+				for (l=0; l<poly.size(); ++l) 
+				{
+					if (l==0) 
+					{
+						if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) 
+							TeReverseLine(poly[l]);
+					}
+					else 
+					{
+						if (TeOrientation(poly[l]) == TeCLOCKWISE)
+							TeReverseLine(poly[l]);
+					}
+					npoints = poly[l].size();
+					panPart[nelem]=posXY;
+        
+					for (m=0; m<npoints; ++m) 
+					{
+						padfX[posXY] = poly[l][m].x_;
+						padfY[posXY] = poly[l][m].y_;
+						posXY++;
+					}
+					nelem++;
+				}
+			}
+			psObject = SHPCreateObject(SHPT_POLYGON, -1, nelem, panPart, NULL, posXY, padfX, padfY, NULL, NULL);
+			if (hSHPPol == 0)
+			{
+				string fname = base + "_pol.shp";
+				hSHPPol = SHPCreate(fname.c_str(), SHPT_POLYGON);
+   				assert (hSHPPol != 0);
+			}	
+			shpRes = SHPWriteObject(hSHPPol, -1, psObject);
+			SHPDestroyObject(psObject);
+			free(panPart);
+			free(padfX);
+			free(padfY);
+			assert(shpRes != -1);   
+			if (hDBFPol == 0)
+			{
+				hDBFPol = TeCreateDBFFile(base + "_pol.dbf", qAttList);
+				assert (hDBFPol != 0);
+			}
+			if (onlyObjId)
+			{
+				DBFWriteStringAttribute(hDBFPol, iRecPol, 0, st.objectId().c_str());
+			}
+			else
+			{
+				string val;
+				for (n=0; n<qAttList.size();++n) 
+				{
+					st.getPropertyValue(val,n);
+					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
+					{
+						DBFWriteStringAttribute(hDBFPol, iRecPol, n, val.c_str());
+					}
+					else if (qAttList[n].rep_.type_ == TeINT)
+					{
+						DBFWriteIntegerAttribute(hDBFPol, iRecPol, n, atoi(val.c_str()));
+					}
+					else if (qAttList[n].rep_.type_ == TeREAL)
+					{
+						DBFWriteDoubleAttribute(hDBFPol, iRecPol, n, atof(val.c_str()));
+					}
+				}
+			}
+			++iRecPol;
+		}
+		if (st.hasCells())
+		{
+			TeCellSet& cellSet = st.getCells();
+			nVertices = cellSet.size();
+			totpoints = nVertices*5;
+			panPart = (int *) malloc(sizeof(int) * nVertices);
+			padfX = (double *) malloc(sizeof(double) * totpoints);
+			padfY = (double *) malloc(sizeof(double) * totpoints);
+			posXY = 0;
+			nelem = 0;
+			TeCellSet::iterator itcs;
+			for (itcs=cellSet.begin(); itcs!=cellSet.end(); ++itcs)
+			{
+				panPart[nelem]=posXY;
+				padfX[posXY] = (*itcs).box().lowerLeft().x();
+				padfY[posXY] = (*itcs).box().lowerLeft().y();
+				posXY++;		
+				padfX[posXY] = (*itcs).box().upperRight().x();
+				padfY[posXY] = (*itcs).box().lowerLeft().y();
+				posXY++;		
+				padfX[posXY] = (*itcs).box().upperRight().x();
+				padfY[posXY] = (*itcs).box().upperRight().y();
+				posXY++;		
+				padfX[posXY] = (*itcs).box().lowerLeft().x();
+				padfY[posXY] = (*itcs).box().upperRight().y();
+				posXY++;		
+				padfX[posXY] = (*itcs).box().lowerLeft().x();
+				padfY[posXY] = (*itcs).box().lowerLeft().y();
+				++posXY;	
+				++nelem;
+			} 
+			psObject = SHPCreateObject(SHPT_POLYGON, -1, nelem, panPart, NULL,posXY, padfX, padfY, NULL, NULL);
+			if (hSHPPol == 0)
+			{
+				string fname = base + "_pol.shp";
+				hSHPPol = SHPCreate(fname.c_str(), SHPT_POLYGON);
+   				assert (hSHPPol != 0);
+			}	
+			shpRes = SHPWriteObject(hSHPPol, -1, psObject);
+			SHPDestroyObject(psObject);
+			free(panPart);
+			free(padfX);
+			free(padfY);
+			assert(shpRes != -1);
+			if (hDBFPol == 0)
+			{
+				hDBFPol = TeCreateDBFFile(base + "_pol.dbf", qAttList);
+				assert (hDBFPol != 0);
+			}
+
+			if (onlyObjId)
+			{
+				DBFWriteStringAttribute(hDBFPol, iRecPol, 0, st.objectId().c_str());
+			}
+			else
+			{
+				string val;
+				for (n=0; n<qAttList.size();++n) 
+				{
+					st.getPropertyValue(val,n);
+					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
+					{
+						DBFWriteStringAttribute(hDBFPol, iRecPol, n, val.c_str());
+					}
+					else if (qAttList[n].rep_.type_ == TeINT)
+					{
+						DBFWriteIntegerAttribute(hDBFPol, iRecPol, n, atoi(val.c_str()));
+					}
+					else if (qAttList[n].rep_.type_ == TeREAL)
+					{
+						DBFWriteDoubleAttribute(hDBFPol, iRecPol, n, atof(val.c_str()));
+					}
+				}
+			}
+			++iRecPol;
+		}
+		if (st.hasLines())
+		{
+			TeLineSet& lineSet = st.getLines();
+			nVertices = lineSet.size();
+			TeLineSet::iterator itls;
+			for (itls=lineSet.begin(); itls!=lineSet.end(); ++itls)
+				totpoints += (*itls).size();
+			panPart = (int *) malloc(sizeof(int) * nVertices);
+			padfX = (double *) malloc(sizeof(double) * totpoints);
+			padfY = (double *) malloc(sizeof(double) * totpoints);
+			posXY = 0;
+			nelem = 0;
+			for (itls=lineSet.begin(); itls!=lineSet.end(); ++itls)
+			{
+				panPart[nelem]=posXY;
+				for (l=0; l<(*itls).size(); ++l)
+				{
+					padfX[posXY] = (*itls)[l].x();
+					padfY[posXY] = (*itls)[l].y();
+					++posXY;
+				}
+				++nelem;
+			}
+			psObject = SHPCreateObject(SHPT_ARC, -1, nVertices, panPart, NULL,	posXY, padfX, padfY, NULL, NULL);
+			if (hSHPLin == 0)
+			{
+				string fname = base + "_lin.shp"; 
+				hSHPLin = SHPCreate(fname.c_str(), SHPT_ARC);
+   				assert (hSHPLin != 0);
+			}		
+			shpRes = SHPWriteObject(hSHPLin, -1, psObject);
+			SHPDestroyObject(psObject);
+			free(panPart);
+			free(padfX);
+			free(padfY);
+			assert(shpRes != -1);
+			if (hDBFLin == 0)
+			{
+				hDBFLin = TeCreateDBFFile(base + "_lin.dbf", qAttList);
+				assert (hDBFLin != 0);
+			}
+			if (onlyObjId)
+			{
+				DBFWriteStringAttribute(hDBFLin, iRecLin, 0, st.objectId().c_str());
+			}
+			else
+			{
+				string val;
+				for (n=0; n<qAttList.size();++n) 
+				{
+					st.getPropertyValue(val,n);
+					if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
+					{
+						DBFWriteStringAttribute(hDBFLin, iRecLin, n, val.c_str());
+					}
+					else if (qAttList[n].rep_.type_ == TeINT)
+					{
+						DBFWriteIntegerAttribute(hDBFLin, iRecLin, n, atoi(val.c_str()));
+					}
+					else if (qAttList[n].rep_.type_ == TeREAL)
+					{
+						DBFWriteDoubleAttribute(hDBFLin, iRecLin, n, atof(val.c_str()));
+					}
+				}
+			}
+			++iRecLin;
+		}
+		if (st.hasPoints())
+		{
+			TePointSet& pointSet = st.getPoints();
+			nVertices = pointSet.size();
+			panPart = (int *) malloc(sizeof(int) * nVertices);
+			padfX = (double *) malloc(sizeof(double) * nVertices);
+			padfY = (double *) malloc(sizeof(double) * nVertices);
+			nelem = 0;
+			TePointSet::iterator itpts;
+			for (itpts=pointSet.begin(); itpts!=pointSet.end(); ++itpts)
+			{
+				panPart[nelem] = nelem;
+				padfX[nelem] = (*itpts).location().x();
+				padfY[nelem] = (*itpts).location().y();
+				++nelem;
+			}
+			psObject = SHPCreateObject(SHPT_POINT, -1, nVertices, panPart, NULL, nVertices, padfX, padfY, NULL, NULL );
+			if (hSHPPt == 0)
+			{
+				string fname = base + "_pt.shp";
+				hSHPPt = SHPCreate(fname.c_str(), SHPT_POINT);
+   				assert (hSHPPt != 0);
+			}		
+			shpRes = SHPWriteObject(hSHPPt, -1, psObject);
+			SHPDestroyObject(psObject);
+			free(panPart);
+			free(padfX);
+			free(padfY);
+			assert(shpRes != -1);
+			if (hDBFPt == 0)
+			{
+				hDBFPt = TeCreateDBFFile(base + "_pt.dbf", qAttList);
+				assert (hDBFPt != 0);
+			}
+			if (onlyObjId)
+			{
+				DBFWriteStringAttribute(hDBFPt, iRecPt, 0, st.objectId().c_str());
+			}
+			else
+			{
+				string val;
+				for (n=0; n<qAttList.size();++n) 
+				{
+					st.getPropertyValue(val,n);
+						if (qAttList[n].rep_.type_ == TeSTRING || qAttList[n].rep_.type_ == TeDATETIME)
+					{
+						DBFWriteStringAttribute(hDBFPt, iRecPt, n, val.c_str());
+					}
+					else if (qAttList[n].rep_.type_ == TeINT)
+					{
+						DBFWriteIntegerAttribute(hDBFPt, iRecPt, n, atoi(val.c_str()));
+					}
+					else if (qAttList[n].rep_.type_ == TeREAL)
+					{
+						DBFWriteDoubleAttribute(hDBFPt, iRecPt, n, atof(val.c_str()));
+					}
+				}
+			}
+			++iRecPt;
+		}
+		++nIProcessed;
+		if (TeProgress::instance() && int(t2-t1) > dt)
+		{
+			t1 = t2;
+			if(((int)(t2-t0) > dt2))
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(nIProcessed);
+			}
+		}
+
+	}
+	if (hDBFPol != 0)
+		DBFClose(hDBFPol);
+	if (hSHPPol != 0)
+        SHPClose(hSHPPol);
+	if (hDBFLin != 0)
+		DBFClose(hDBFLin);
+	if (hSHPLin != 0)
+        SHPClose(hSHPLin);
+	if (hDBFPt != 0)
+		DBFClose(hDBFPt);
+	if (hSHPPt != 0)
+        SHPClose(hSHPPt);
+
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+
+bool
+TeExportShapefile(TeLayer* layer, const string& shpFileName, const string& tableName, const string& restriction)
+{
+  	if (!layer || shpFileName.empty())
+		return false;
+
+	// check if asked table exist
+	TeAttrTableVector& vTables = layer->attrTables();
+	TeAttrTableVector::iterator it = vTables.begin();
+	while (it != vTables.end())
+	{
+		if (it->name() == tableName) 
+			break;
+		++it;
+	}
+	if (it == vTables.end())
+		return false;
+	TeAttrTableVector askedTable;
+	askedTable.push_back(*it);
+
+	TeTheme* tempTheme = new TeTheme();
+	tempTheme->attributeRest(restriction);
+	tempTheme->layer(layer);
+	tempTheme->collectionTable("");
+	tempTheme->collectionAuxTable("");
+	tempTheme->setAttTables(askedTable);
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(tempTheme);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToShapefile(tQuerier, shpFileName);
+	delete tQuerier;
+	delete tempTheme;
+    return res ;
+}
+
+bool 
+TeExportLayerToShapefile(TeLayer* layer, const string& baseName)
+{
+  	if (!layer)
+		return false;
+
+	string fbase = baseName;
+	if (baseName.empty())
+		fbase = layer->name();
+
+	TeTheme* tempTheme = new TeTheme();
+	tempTheme->layer(layer);
+	tempTheme->collectionTable("");
+	tempTheme->collectionAuxTable("");
+	tempTheme->setAttTables(layer->attrTables());
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(tempTheme);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToShapefile(tQuerier, baseName);
+	delete tQuerier;
+	delete tempTheme;
+    return res ;
+}
+
+
+bool 
+TeExportThemeToShapefile(TeTheme* theme, TeSelectedObjects selOb, const std::string& baseName)
+{
+	if (!theme)
+		return false;
+
+	string fbase = baseName;
+	if (baseName.empty())
+		fbase = theme->name();
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(theme);
+	qPar.setSelecetObjs(selOb);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToShapefile(tQuerier, fbase);
+	delete tQuerier;
+	return res;
+}
+
+
+
+
+
diff --git a/src/terralib/drivers/shapelib/TeImportDBF.cpp b/src/terralib/drivers/shapelib/TeImportDBF.cpp
old mode 100755
new mode 100644
index bb3f89c..423c517
--- a/src/terralib/drivers/shapelib/TeImportDBF.cpp
+++ b/src/terralib/drivers/shapelib/TeImportDBF.cpp
@@ -1,441 +1,441 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <string>
-#include <iostream>
-
-#include "TeDriverSHPDBF.h"
-#include "TeTable.h"
-#include "TeException.h"
-#include "TeUtils.h"
-#include "TeLayer.h"
-#include "TeProgress.h"
-#include "TeDatabase.h"
-
-//! Fills a vector with the values of choosen column named , to be used as object identifications
-/*!
-	\param dbfFileName DBF file name
-	\param indexes a vector that has the identification of the objects
-	\param objectIdAttr name of the attribute that has the identification of objects
-	\note if no objectIdAttr is provided or there is no column with this name return
-	an incremental sequence of numbers.
-*/
-void TeReadDBFIndexes(const string& dbfFileName, vector<string>& indexes, const string objectIdAttr="");
-
-
-bool TeReadDBFAttributeList ( const string& dbfFileName, TeAttributeList& attList )
-{
-	string filePrefix = TeGetName (dbfFileName.c_str()) ;
-	string fileName = filePrefix + ".dbf";
-
-/* -------------------------------------------------------------------- */
-/*      Open the file.                                                  */
-/* -------------------------------------------------------------------- */
-    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
-    if( hDBF == NULL )
-    {
-			throw TeException ( UNABLE_TO_OPEN_DBF_FILE );
-    }
-    
-/* -------------------------------------------------------------------- */
-/*	If there is no data in this file let the user know.		*/
-/* -------------------------------------------------------------------- */
-    if( DBFGetFieldCount(hDBF) == 0 )
-    {
-			throw TeException ( NO_DATA_IN_DBF_FILE );
-    }
-
-/* -------------------------------------------------------------------- */
-/*	Get Attributes header definitions.									*/
-/* -------------------------------------------------------------------- */
-	TeAttribute attribute;
-    
-	char	szTitle[12];
-	int		nWidth, nDecimals;
-	int 	i;
-
-	vector<string> names;
-
-	for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
-    {
-		DBFFieldType	eType = DBFGetFieldInfo( hDBF, i, szTitle, &nWidth, &nDecimals );
-
-		string atname = TeConvertToUpperCase(szTitle);
-	
-		vector<string>::iterator it = find(names.begin(),names.end(),atname);
-		if (it != names.end())
-		{
-			string newname = atname + "_" + Te2String(i);
-			int c = i+1;
-			while (true)
-			{
-				it = find(names.begin(),names.end(),newname);
-				if (it == names.end())
-					break;
-				newname = atname + "_" + Te2String(c);
-				++c;
-			}
-			atname = newname;
-		}
-		names.push_back(atname);
-		attribute.rep_.name_ = atname;
-
-        if( eType == FTDate )
-		{
-			attribute.rep_.type_     = TeDATETIME;
-			attribute.dateChronon_   = TeDAY;
-			attribute.dateTimeFormat_ = "YYYYMMDD";
-			attribute.dateSeparator_ = 'c';
-		}
-        else if( eType == FTString )
-		{
-			attribute.rep_.type_     = TeSTRING;
-			attribute.rep_.numChar_  = nWidth;
-		}
-		else if( eType == FTInteger )
-		{
-			if (nWidth > 9)
-			{
-				attribute.rep_.type_ = TeREAL;
-				attribute.rep_.numChar_ = nWidth;
-				attribute.rep_.decimals_ = 0;
-			}
-			else
-			{
-				attribute.rep_.type_ = TeINT;
-				attribute.rep_.numChar_ = nWidth;
-			}
-		}
-        else if( eType == FTDouble )
-		{
-            attribute.rep_.type_ = TeREAL;
-			attribute.rep_.numChar_ = nWidth;
-			attribute.rep_.decimals_ = nDecimals;
-		}
-
-		// keep track of the index name
-
-		attList.push_back ( attribute );
-    }
-	names.clear();
-    DBFClose( hDBF );
-	return true;
-}
-
-
-bool TeImportDBFTable(const string& dbFileName,TeDatabase* db, TeLayer* layer,TeAttrTableType tableType, string objectIdAtt)
-{
-	if (!db || dbFileName.empty())
-		return false;
-
-    DBFHandle hDBF = DBFOpen(dbFileName.c_str(), "rb" );
-    if( hDBF == NULL )
-		return false;
-
-	string tabName = TeGetBaseName(dbFileName.c_str());
-	int n=0;
-	while (db->tableExist(tabName))
-	{
-		tabName = TeGetBaseName(dbFileName.c_str()) + "_" + Te2String(n);
-		n++;
-	}
-	TeAttributeList attList;
-	TeReadDBFAttributeList (dbFileName, attList);
-
-	if (objectIdAtt.empty())
-		objectIdAtt = "object_id_";
-
-	// check if object id column is already in the list
-	unsigned int j;
-	for (j=0; j<attList.size(); j++)
-	{
-		if ( TeConvertToUpperCase(objectIdAtt) ==  TeConvertToUpperCase(attList[j].rep_.name_))
-		{
-			objectIdAtt = TeConvertToUpperCase(attList[j].rep_.name_);
-			attList[j].rep_.name_ =  objectIdAtt;
-			if (attList[j].rep_.type_ != TeSTRING)
-			{
-				attList[j].rep_.type_ = TeSTRING;
-				attList[j].rep_.numChar_ = 255;
-			}
-			attList[j].rep_.isPrimaryKey_ = true;
-			break;
-		}
-	}
-
-	// if not found create one automatically
-	bool createObjId = false;
-	if (j==attList.size())
-	{
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;
-		at.rep_.numChar_ = 16;
-		at.rep_.name_ = objectIdAtt;
-		at.rep_.isPrimaryKey_ = true;
-		attList.push_back(at);
-		createObjId = true;
-	}
-
-	if (!db->createTable(tabName,attList))
-	{
-	    DBFClose(hDBF);
-		return false;
-	}
-
-	TeTable table(tabName);
-	table.setAttributeList(attList);
-	table.setUniqueName(objectIdAtt);
-	if (layer)
-		table.setTableType(tableType);
-	else
-		table.setTableType(TeAttrExternal);
-
-	int nrec = DBFGetRecordCount(hDBF);
-	if (TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(nrec);
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-	int iRecord;
-	for (iRecord = 0; iRecord < nrec; iRecord++)
-    {
-		TeTableRow row;
-		int i;
-		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
-		{
-			string value =  DBFReadStringAttribute(hDBF, iRecord, i);
-			row.push_back ( value ); // inserts a value into the row
-		}
-		if (createObjId)
-			row.push_back(Te2String(iRecord));
-		table.add(row); 
-		if ((iRecord+1 % 100) == 0)
-		{
-			if (!db->insertTable(table))
-			{
-				DBFClose( hDBF );
-				table.clear();
-				if (TeProgress::instance())
-					TeProgress::instance()->reset();		
-				return false;
-			}
-			table.clear();
-			if (TeProgress::instance())
-			{
-				t2 = clock();
-				if (int(t2-t1) > dt)
-				{
-					t1 = t2;
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					if ((int)(t2-t0) > dt2)
-						TeProgress::instance()->setProgress(iRecord);
-				}
-			}
-		}
-    }
-	if (table.size() > 0)
-	{
-		db->insertTable(table);
-		table.clear();
-	}
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();		
-    DBFClose( hDBF );
-	if (iRecord == 0)
-		return false;
-	if (layer)
-		db->insertTableInfo(layer->id(),table);
-	else
-		db->insertTableInfo(0,table);
-
-	return true;
-}
-
-void TeReadSHPAttributes (const string& dbfFileName, TeTable& table)
-{
-	string filePrefix = TeGetName (dbfFileName.c_str()) ;
-	string fileName = filePrefix + ".dbf";
-
-/* -------------------------------------------------------------------- */
-/*	Get Attributes definitions.											*/
-/* -------------------------------------------------------------------- */
-	TeAttributeList attList;
-	TeReadDBFAttributeList ( fileName, attList );
-	table.setAttributeList( attList );
-
-/* -------------------------------------------------------------------- */
-/*      Open the file.                                                  */
-/* -------------------------------------------------------------------- */
-    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
-    if( hDBF == NULL )
-    {
-			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
-    }
-    
-/* -------------------------------------------------------------------- */
-/*	If there is no data in this file let the user know.		*/
-/* -------------------------------------------------------------------- */
-    if( DBFGetFieldCount(hDBF) == 0 )
-    {
-			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
-    }
-
-/* -------------------------------------------------------------------- */
-/*	Read all the records 						                        */
-/* -------------------------------------------------------------------- */
-	for( int iRecord = 0; iRecord < DBFGetRecordCount(hDBF); iRecord++ )
-    {
-		TeTableRow row;
-		int 	i;
-
-		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
-		{
-			string value =  DBFReadStringAttribute( hDBF, iRecord, i ) ;
-			row.push_back ( value ); // inserts a value into the row
-		}
-		table.add ( row ); // adds a row to a table
-    }
-    DBFClose( hDBF );
-}
-
-
-bool TeReadDBFAttributes (const string& dbfFileName, TeTable& table, 
-						  int nrecords, int rinitial, bool createAuto)
-{
-	string filePrefix = TeGetName (dbfFileName.c_str()) ;
-	string fileName = filePrefix + ".dbf";
-
-// -------------------------------------------------------------------- 
-//      Open the file.                                                  
-// -------------------------------------------------------------------- 
-    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
-    if( hDBF == NULL )
-    {
-			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
-    }
-    
-// -------------------------------------------------------------------- 
-//	If there is no data in this file let the user know.		
-// -------------------------------------------------------------------- 
-    if( DBFGetFieldCount(hDBF) == 0 )
-    {
-			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
-    }
-
-	if (rinitial >= DBFGetRecordCount(hDBF))
-		return false;
-
-	if (nrecords < 1 || nrecords > DBFGetRecordCount(hDBF))
-		nrecords = DBFGetRecordCount(hDBF);
-
-// -------------------------------------------------------------------- 
-//	Read all the records 						                        
-// -------------------------------------------------------------------- 
-	int count = 0;
-	for( int iRecord = rinitial; (iRecord < DBFGetRecordCount(hDBF) && count < nrecords); iRecord++ )
-    {
-		TeTableRow row;
-		int 	i;
-		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
-		{
-			string value =  DBFReadStringAttribute( hDBF, iRecord, i ) ;
-			row.push_back ( value ); // inserts a value into the row
-		}
-		
-		// if asked create a auto number extra column at the end
-		if (createAuto)
-			row.push_back(Te2String(iRecord));
-
-		table.add ( row ); // adds a row to a table
-		count++;
-    }
-    DBFClose( hDBF );
-	if (count > 0)
-		return true;
-	return false;
-}
-
-void
-TeImportDBFIndexes(const string& shpFileName, vector<string>& indexVect, const string objectIdAttr )
-{
-	string filePrefix = TeGetName(shpFileName.c_str());
-	string fileName = filePrefix + ".dbf";
-
-/* -------------------------------------------------------------------- */
-/*	Get index position.													*/
-/* -------------------------------------------------------------------- */
-	int i=0, indexPos=-1;
-
-	if (!objectIdAttr.empty())
-	{
-		TeAttributeList attList;
-		TeReadDBFAttributeList ( fileName, attList );
-		TeAttributeList::iterator it = attList.begin();
-		while ( it != attList.end() )
-		{
-			TeAttribute att = *it;
-			if (TeConvertToUpperCase(att.rep_.name_) == TeConvertToUpperCase(objectIdAttr))
-			{
-				indexPos = i;
-				break;
-			}
-			it++;
-			i++;
-		}
-	}
-
-/* -------------------------------------------------------------------- */
-/*      Open the file.                                                  */
-/* -------------------------------------------------------------------- */
-    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
-    if( hDBF == NULL )
-    {
-			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
-    }
-    
-/* -------------------------------------------------------------------- */
-/*	If there is no data in this file let the user know.		*/
-/* -------------------------------------------------------------------- */
-	int nRecords = DBFGetFieldCount(hDBF);
-    if( nRecords  == 0 )
-    {
-			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
-    }
-
-/* -------------------------------------------------------------------- */
-/*	Read all the records 						                        */
-/* -------------------------------------------------------------------- */
-    
-	for( int iRecord = 0; iRecord < nRecords; iRecord++ )
-	{
-		if (indexPos == -1)
-			indexVect.push_back (Te2String(iRecord+1)); 
-		else
-			indexVect.push_back ( DBFReadStringAttribute( hDBF, iRecord, indexPos ) );
-	}
-
-    DBFClose( hDBF );
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <string>
+#include <iostream>
+
+#include "TeDriverSHPDBF.h"
+#include "TeTable.h"
+#include "TeException.h"
+#include "TeUtils.h"
+#include "TeLayer.h"
+#include "TeProgress.h"
+#include "TeDatabase.h"
+
+//! Fills a vector with the values of choosen column named , to be used as object identifications
+/*!
+	\param dbfFileName DBF file name
+	\param indexes a vector that has the identification of the objects
+	\param objectIdAttr name of the attribute that has the identification of objects
+	\note if no objectIdAttr is provided or there is no column with this name return
+	an incremental sequence of numbers.
+*/
+void TeReadDBFIndexes(const string& dbfFileName, vector<string>& indexes, const string objectIdAttr="");
+
+
+bool TeReadDBFAttributeList ( const string& dbfFileName, TeAttributeList& attList )
+{
+	string filePrefix = TeGetName (dbfFileName.c_str()) ;
+	string fileName = filePrefix + ".dbf";
+
+/* -------------------------------------------------------------------- */
+/*      Open the file.                                                  */
+/* -------------------------------------------------------------------- */
+    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
+    if( hDBF == NULL )
+    {
+			throw TeException ( UNABLE_TO_OPEN_DBF_FILE );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*	If there is no data in this file let the user know.		*/
+/* -------------------------------------------------------------------- */
+    if( DBFGetFieldCount(hDBF) == 0 )
+    {
+			throw TeException ( NO_DATA_IN_DBF_FILE );
+    }
+
+/* -------------------------------------------------------------------- */
+/*	Get Attributes header definitions.									*/
+/* -------------------------------------------------------------------- */
+	TeAttribute attribute;
+    
+	char	szTitle[12];
+	int		nWidth, nDecimals;
+	int 	i;
+
+	vector<string> names;
+
+	for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
+    {
+		DBFFieldType	eType = DBFGetFieldInfo( hDBF, i, szTitle, &nWidth, &nDecimals );
+
+		string atname = TeConvertToUpperCase(szTitle);
+	
+		vector<string>::iterator it = find(names.begin(),names.end(),atname);
+		if (it != names.end())
+		{
+			string newname = atname + "_" + Te2String(i);
+			int c = i+1;
+			while (true)
+			{
+				it = find(names.begin(),names.end(),newname);
+				if (it == names.end())
+					break;
+				newname = atname + "_" + Te2String(c);
+				++c;
+			}
+			atname = newname;
+		}
+		names.push_back(atname);
+		attribute.rep_.name_ = atname;
+
+        if( eType == FTDate )
+		{
+			attribute.rep_.type_     = TeDATETIME;
+			attribute.dateChronon_   = TeDAY;
+			attribute.dateTimeFormat_ = "YYYYMMDD";
+			attribute.dateSeparator_ = 'c';
+		}
+        else if( eType == FTString )
+		{
+			attribute.rep_.type_     = TeSTRING;
+			attribute.rep_.numChar_  = nWidth;
+		}
+		else if( eType == FTInteger )
+		{
+			if (nWidth > 9)
+			{
+				attribute.rep_.type_ = TeREAL;
+				attribute.rep_.numChar_ = nWidth;
+				attribute.rep_.decimals_ = 0;
+			}
+			else
+			{
+				attribute.rep_.type_ = TeINT;
+				attribute.rep_.numChar_ = nWidth;
+			}
+		}
+        else if( eType == FTDouble )
+		{
+            attribute.rep_.type_ = TeREAL;
+			attribute.rep_.numChar_ = nWidth;
+			attribute.rep_.decimals_ = nDecimals;
+		}
+
+		// keep track of the index name
+
+		attList.push_back ( attribute );
+    }
+	names.clear();
+    DBFClose( hDBF );
+	return true;
+}
+
+
+bool TeImportDBFTable(const string& dbFileName,TeDatabase* db, TeLayer* layer,TeAttrTableType tableType, string objectIdAtt)
+{
+	if (!db || dbFileName.empty())
+		return false;
+
+    DBFHandle hDBF = DBFOpen(dbFileName.c_str(), "rb" );
+    if( hDBF == NULL )
+		return false;
+
+	string tabName = TeGetBaseName(dbFileName.c_str());
+	int n=0;
+	while (db->tableExist(tabName))
+	{
+		tabName = TeGetBaseName(dbFileName.c_str()) + "_" + Te2String(n);
+		n++;
+	}
+	TeAttributeList attList;
+	TeReadDBFAttributeList (dbFileName, attList);
+
+	if (objectIdAtt.empty())
+		objectIdAtt = "object_id_";
+
+	// check if object id column is already in the list
+	unsigned int j;
+	for (j=0; j<attList.size(); j++)
+	{
+		if ( TeConvertToUpperCase(objectIdAtt) ==  TeConvertToUpperCase(attList[j].rep_.name_))
+		{
+			objectIdAtt = TeConvertToUpperCase(attList[j].rep_.name_);
+			attList[j].rep_.name_ =  objectIdAtt;
+			if (attList[j].rep_.type_ != TeSTRING)
+			{
+				attList[j].rep_.type_ = TeSTRING;
+				attList[j].rep_.numChar_ = 255;
+			}
+			attList[j].rep_.isPrimaryKey_ = true;
+			break;
+		}
+	}
+
+	// if not found create one automatically
+	bool createObjId = false;
+	if (j==attList.size())
+	{
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;
+		at.rep_.numChar_ = 16;
+		at.rep_.name_ = objectIdAtt;
+		at.rep_.isPrimaryKey_ = true;
+		attList.push_back(at);
+		createObjId = true;
+	}
+
+	if (!db->createTable(tabName,attList))
+	{
+	    DBFClose(hDBF);
+		return false;
+	}
+
+	TeTable table(tabName);
+	table.setAttributeList(attList);
+	table.setUniqueName(objectIdAtt);
+	if (layer)
+		table.setTableType(tableType);
+	else
+		table.setTableType(TeAttrExternal);
+
+	int nrec = DBFGetRecordCount(hDBF);
+	if (TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(nrec);
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+	int iRecord;
+	for (iRecord = 0; iRecord < nrec; iRecord++)
+    {
+		TeTableRow row;
+		int i;
+		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
+		{
+			string value =  DBFReadStringAttribute(hDBF, iRecord, i);
+			row.push_back ( value ); // inserts a value into the row
+		}
+		if (createObjId)
+			row.push_back(Te2String(iRecord));
+		table.add(row); 
+		if ((iRecord+1 % 100) == 0)
+		{
+			if (!db->insertTable(table))
+			{
+				DBFClose( hDBF );
+				table.clear();
+				if (TeProgress::instance())
+					TeProgress::instance()->reset();		
+				return false;
+			}
+			table.clear();
+			if (TeProgress::instance())
+			{
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					if (TeProgress::instance()->wasCancelled())
+						break;
+					if ((int)(t2-t0) > dt2)
+						TeProgress::instance()->setProgress(iRecord);
+				}
+			}
+		}
+    }
+	if (table.size() > 0)
+	{
+		db->insertTable(table);
+		table.clear();
+	}
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();		
+    DBFClose( hDBF );
+	if (iRecord == 0)
+		return false;
+	if (layer)
+		db->insertTableInfo(layer->id(),table);
+	else
+		db->insertTableInfo(0,table);
+
+	return true;
+}
+
+void TeReadSHPAttributes (const string& dbfFileName, TeTable& table)
+{
+	string filePrefix = TeGetName (dbfFileName.c_str()) ;
+	string fileName = filePrefix + ".dbf";
+
+/* -------------------------------------------------------------------- */
+/*	Get Attributes definitions.											*/
+/* -------------------------------------------------------------------- */
+	TeAttributeList attList;
+	TeReadDBFAttributeList ( fileName, attList );
+	table.setAttributeList( attList );
+
+/* -------------------------------------------------------------------- */
+/*      Open the file.                                                  */
+/* -------------------------------------------------------------------- */
+    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
+    if( hDBF == NULL )
+    {
+			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*	If there is no data in this file let the user know.		*/
+/* -------------------------------------------------------------------- */
+    if( DBFGetFieldCount(hDBF) == 0 )
+    {
+			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
+    }
+
+/* -------------------------------------------------------------------- */
+/*	Read all the records 						                        */
+/* -------------------------------------------------------------------- */
+	for( int iRecord = 0; iRecord < DBFGetRecordCount(hDBF); iRecord++ )
+    {
+		TeTableRow row;
+		int 	i;
+
+		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
+		{
+			string value =  DBFReadStringAttribute( hDBF, iRecord, i ) ;
+			row.push_back ( value ); // inserts a value into the row
+		}
+		table.add ( row ); // adds a row to a table
+    }
+    DBFClose( hDBF );
+}
+
+
+bool TeReadDBFAttributes (const string& dbfFileName, TeTable& table, 
+						  int nrecords, int rinitial, bool createAuto)
+{
+	string filePrefix = TeGetName (dbfFileName.c_str()) ;
+	string fileName = filePrefix + ".dbf";
+
+// -------------------------------------------------------------------- 
+//      Open the file.                                                  
+// -------------------------------------------------------------------- 
+    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
+    if( hDBF == NULL )
+    {
+			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
+    }
+    
+// -------------------------------------------------------------------- 
+//	If there is no data in this file let the user know.		
+// -------------------------------------------------------------------- 
+    if( DBFGetFieldCount(hDBF) == 0 )
+    {
+			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
+    }
+
+	if (rinitial >= DBFGetRecordCount(hDBF))
+		return false;
+
+	if (nrecords < 1 || nrecords > DBFGetRecordCount(hDBF))
+		nrecords = DBFGetRecordCount(hDBF);
+
+// -------------------------------------------------------------------- 
+//	Read all the records 						                        
+// -------------------------------------------------------------------- 
+	int count = 0;
+	for( int iRecord = rinitial; (iRecord < DBFGetRecordCount(hDBF) && count < nrecords); iRecord++ )
+    {
+		TeTableRow row;
+		int 	i;
+		for( i = 0; i < DBFGetFieldCount(hDBF); i++ )
+		{
+			string value =  DBFReadStringAttribute( hDBF, iRecord, i ) ;
+			row.push_back ( value ); // inserts a value into the row
+		}
+		
+		// if asked create a auto number extra column at the end
+		if (createAuto)
+			row.push_back(Te2String(iRecord));
+
+		table.add ( row ); // adds a row to a table
+		count++;
+    }
+    DBFClose( hDBF );
+	if (count > 0)
+		return true;
+	return false;
+}
+
+void
+TeImportDBFIndexes(const string& shpFileName, vector<string>& indexVect, const string objectIdAttr )
+{
+	string filePrefix = TeGetName(shpFileName.c_str());
+	string fileName = filePrefix + ".dbf";
+
+/* -------------------------------------------------------------------- */
+/*	Get index position.													*/
+/* -------------------------------------------------------------------- */
+	int i=0, indexPos=-1;
+
+	if (!objectIdAttr.empty())
+	{
+		TeAttributeList attList;
+		TeReadDBFAttributeList ( fileName, attList );
+		TeAttributeList::iterator it = attList.begin();
+		while ( it != attList.end() )
+		{
+			TeAttribute att = *it;
+			if (TeConvertToUpperCase(att.rep_.name_) == TeConvertToUpperCase(objectIdAttr))
+			{
+				indexPos = i;
+				break;
+			}
+			it++;
+			i++;
+		}
+	}
+
+/* -------------------------------------------------------------------- */
+/*      Open the file.                                                  */
+/* -------------------------------------------------------------------- */
+    DBFHandle hDBF = DBFOpen( fileName.c_str(), "rb" );
+    if( hDBF == NULL )
+    {
+			throw TeException ( UNABLE_TO_OPEN_DBF_FILE, fileName, true );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*	If there is no data in this file let the user know.		*/
+/* -------------------------------------------------------------------- */
+	int nRecords = DBFGetFieldCount(hDBF);
+    if( nRecords  == 0 )
+    {
+			throw TeException ( NO_DATA_IN_DBF_FILE, fileName );
+    }
+
+/* -------------------------------------------------------------------- */
+/*	Read all the records 						                        */
+/* -------------------------------------------------------------------- */
+    
+	for( int iRecord = 0; iRecord < nRecords; iRecord++ )
+	{
+		if (indexPos == -1)
+			indexVect.push_back (Te2String(iRecord+1)); 
+		else
+			indexVect.push_back ( DBFReadStringAttribute( hDBF, iRecord, indexPos ) );
+	}
+
+    DBFClose( hDBF );
+}
diff --git a/src/terralib/drivers/shapelib/TeImportSHP.cpp b/src/terralib/drivers/shapelib/TeImportSHP.cpp
old mode 100755
new mode 100644
index 07d13dc..ee3324a
--- a/src/terralib/drivers/shapelib/TeImportSHP.cpp
+++ b/src/terralib/drivers/shapelib/TeImportSHP.cpp
@@ -1,1370 +1,1370 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-// STL 
-#include <string>
-#include <iostream>
-#include <vector>
-#include <list>
-#include <map>
-
-#ifdef WIN32
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-
-using namespace std;
-
-// TerraLib
-
-#include "TeDriverSHPDBF.h"
-#include "TeTable.h"
-#include "TeStdFile.h"
-#include "TeException.h"
-#include "TeUtils.h"
-#include "TeGeometry.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeLayer.h"
-#include "TeProgress.h"
-#include "TeDatabase.h"
-
-
-// from SHAPELIB
-#include "shapefil.h" 
- 
-// Internal functions
-bool TeImportSHPGeometries (TeLayer* layer,const string& shpFileName, vector<string> &indexes, unsigned int chunckSize);
-void TeSHPPointDecode    (TeLayer*, SHPHandle, vector<string>&, unsigned int);
-void TeSHPPolyLineDecode (TeLayer*, SHPHandle, vector<string>&, unsigned int);
-void TeSHPPolygonDecode  (TeLayer*, SHPHandle, vector<string>&, unsigned int);
-
-TeLayer* TeImportShape(const string& shpFileName, TeDatabase* db, const string& layerName)
-{
-	if (!db || shpFileName.empty()) 
-		return 0;
-
-	// check if format is complete (SHP, SHX e DBF files exist)
-	string filePrefix = TeGetName(shpFileName.c_str());
-	string ftest = filePrefix + ".dbf";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".DBF";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-	ftest = filePrefix + ".shx";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".SHX";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-
-	// found a valid layer name
-	string lName;
-	string baseName = TeGetBaseName(shpFileName.c_str());
-	if (layerName.empty())
-		lName = baseName;
-	else
-		lName = layerName;
-
-	string newLayerName = lName;
-	TeLayerMap& layerMap = db->layerMap();
-	TeLayerMap::iterator it;
-	bool flag = true;
-	int n = 1;
-	while (flag)
-	{
-		for (it = layerMap.begin(); it != layerMap.end(); ++it)
-		{
-			if (TeStringCompare(it->second->name(),newLayerName))
-				break;
-		}
-		if (it == layerMap.end())
-			flag = 0;
-		else
-			newLayerName = lName + "_" +Te2String(n);
-		n++;	
-	}
-
-	// find projection
-	TeLayer* newLayer = new TeLayer(newLayerName,db);
-	if (newLayer->id() <= 0 )
-		return 0;				// couldn�t create new layer
-
-	bool res = TeImportShape(newLayer,shpFileName);
-	if (res)
-		return newLayer;
-	else
-	{
-		db->deleteLayer(newLayer->id());
-		delete newLayer;
-		return 0;
-	}
-}
-
-bool TeImportShape (TeLayer* layer, const string& shpFileName, string attrTableName,  
-					string objectIdAtt, int unsigned chunkSize )
-{
-	double oldPrec = TePrecision::instance().precision();
-
-	if(layer)
-	{
-		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
-	}
-	else
-	{
-		TePrecision::instance().setPrecision(TeGetPrecision(0));
-	}
-
-
-	string filePrefix = TeGetName(shpFileName.c_str());
-	string ftest = filePrefix + ".dbf";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".DBF";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-	string dbfFileN = ftest;
-
-	ftest = filePrefix + ".shx";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".SHX";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-
-	ftest = filePrefix + ".shp";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".SHP";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-	string shpFileN = ftest;
-
-	SHPHandle	hSHP = SHPOpen(shpFileN.c_str(),"rb");
-	if (hSHP == 0)
-	{
-		TePrecision::instance().setPrecision(oldPrec);
-		return false;
-	}
-
-    	DBFHandle hDBF = DBFOpen(dbfFileN.c_str(), "rb");
-    	if (hDBF == 0)
-    	{
-		TePrecision::instance().setPrecision(oldPrec);
-		SHPClose(hSHP);
-		return false;
-    	}
-
-	// Read some information about the shapefile
-	int nShapeType, nEntities;
-	// --- get the shape and decode it
-	double 	adfMinBound[4], adfMaxBound[4];
-	SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
-	string shpName = SHPTypeName( nShapeType );
-	if (shpName == "UnknownShapeType")
-	{
-		TePrecision::instance().setPrecision(oldPrec);
-		SHPClose(hSHP);
-		DBFClose(hDBF);
-		return false;
-	}
-
-	if (attrTableName.empty())
-	{
-		if (layer->name().empty())
-		{
-			TePrecision::instance().setPrecision(oldPrec);
-			return false;
-		}
-		else
-			attrTableName = layer->name();
-	}
-	
-	int linkCol=-1;
-    	unsigned int j=0;
-	bool autoIndex = false;
-	int indexOffset = 0;  
-	
-	if (!layer->database()->beginTransaction())  
-		return false;
-
-	//read the attribute list information 
-	TeAttributeList attList;
-	TeReadDBFAttributeList(shpFileName, attList);
-
-	// if no geometry link name is given, creates one called 'object_id_'
-	string ext = "";
-	int count = 0;
-	if (objectIdAtt.empty())
-	{
-		objectIdAtt = "object_id_" + Te2String(layer->id());
-		string s2 = TeConvertToUpperCase(objectIdAtt);
-		while (true)
-		{
-			for (j=0; j<attList.size(); j++)
-			{
-				string s0 = attList[j].rep_.name_;
-				string s1 = TeConvertToUpperCase(s0);
-				if ( s1 == s2)
-					break;
-			}
-			if (j < attList.size())
-			{
-				++count;
-				objectIdAtt = "object_id_" + Te2String(count);
-			}
-			else
-				break;
-		}
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;
-		at.rep_.numChar_ = 16;
-		at.rep_.name_ = objectIdAtt;
-		at.rep_.isPrimaryKey_ = true;
-		attList.push_back(at);
-		linkCol = attList.size()-1;
-		autoIndex = true;
-	}
-	else
-	{
-		// check if given index is valid
-		TeAttributeList::iterator it = attList.begin();
-		while (it != attList.end())
-		{
-			if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(objectIdAtt))		// index found
-			{
-				if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
-				{
-					(*it).rep_.type_ = TeSTRING;
-					(*it).rep_.numChar_ = 16;
-				}
-				(*it).rep_.isPrimaryKey_ = true;
-				linkCol=j;
-				break;
-			}
-			++it;
-			++j;
-		}
-		if (it == attList.end())			// index not found
-		{
-			objectIdAtt = "object_id_" + Te2String(layer->id());;
-			while (true)
-			{
-				for (j=0; j<attList.size(); j++)
-				{
-					if (TeConvertToUpperCase(attList[j].rep_.name_) == TeConvertToUpperCase(objectIdAtt))
-						break;
-				}
-				if (j < attList.size())
-				{
-					++count;
-					objectIdAtt = "object_id_" + Te2String(count);
-				}
-				else
-					break;
-			}
-			TeAttribute at;
-			at.rep_.type_ = TeSTRING;
-			at.rep_.numChar_ = 16;
-			at.rep_.name_ = objectIdAtt;
-			at.rep_.isPrimaryKey_ = true;
-			attList.push_back(at);
-			autoIndex = true;
-		}
-	}
-	if (autoIndex)
-	{
-		linkCol = attList.size()-1;
-		indexOffset = layer->getNewObjectId(); 
-    	}
-
-	TeTable attTable (attrTableName,attList,objectIdAtt,objectIdAtt,TeAttrStatic);
-	if (!layer->createAttributeTable(attTable))			// create the table in the database
-	{
-		SHPClose(hSHP);  
-		DBFClose(hDBF);  
-		layer->database()->rollbackTransaction();  
-		TePrecision::instance().setPrecision(oldPrec);
-		return false;
-	}
-	
-	string objid, value;
-	TePointSet points;
-	TeLineSet lines;
-	TePolygonSet polygons;
-	TeTableRow row;
-	SHPObject* psShape;
-
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(nEntities);
-		TeProgress::instance()->setProgress(j+1);
-	}
-
-	// OBS1: we discard Z and M values when available, because TerraLib
-	// doesn�t have the concept of 3D or measured geometries
-	// OBS2: non identified geometries are mapped to a object_id_
-	// "te_nulo"
-	switch (nShapeType) 
-	{
-		// --- null geometries ---
-	  case SHPT_NULL:							// read only the attributes
-		for (j=0; j<(unsigned int)nEntities; j++)
-		{
-		  row.clear();
-		  TeDBFRowDecode(hDBF,j,row);
-		  if (autoIndex)	// --- create automatic index if needed
-			  row.push_back(Te2String(j));
-		  if (row[linkCol].empty())
-			 row[linkCol] = "te_nulo";
-		  objid = row[linkCol];
-		  attTable.add(row);
-		  if ((j%chunkSize) == 0)
-		  {
-			  layer->saveAttributeTable(attTable);
-			  attTable.clear();
-			  if(TeProgress::instance())
-			  {
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(j+1);
-			  }	
-		  }
-		}
-		break;
-		// --- point geometries ---
-	  case SHPT_POINTZ:	
-	  case SHPT_MULTIPOINTZ:
-	  case SHPT_POINTM:
-	  case SHPT_MULTIPOINTM:
-	  case SHPT_POINT:
-	  case SHPT_MULTIPOINT:
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-				  row.push_back(Te2String(j));
-			  if (row[linkCol].empty())
-				 row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-			  attTable.add(row);
-			  psShape = SHPReadObject(hSHP,j);
-              TeSHPPointDecode(psShape,points,objid);
-     		  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-				  layer->addPoints(points);
-				  points.clear();
-				  layer->saveAttributeTable(attTable);
-				  attTable.clear();
-				  if(TeProgress::instance())
-				  {
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }	
-			  }
-		  }
-		  break;
-		// --- line geometries ---
-	  case SHPT_ARCZ:
-	  case SHPT_ARCM:
-	  case SHPT_ARC:
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-				  row.push_back(Te2String(j));
-			  if (row[linkCol].empty())
-				 row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-			  attTable.add(row);
-			  psShape = SHPReadObject(hSHP,j);
-			  TeSHPPolyLineDecode(psShape,lines,objid);
-     		  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-			 	  layer->addLines(lines);
-				  lines.clear();
-				  layer->saveAttributeTable(attTable);
-				  attTable.clear();
-				  if(TeProgress::instance())
-				  {
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }	
-			  }
-		  }
-		  break;
-	// --- polygon geometries ---
-	  case SHPT_POLYGON:
-	  case SHPT_POLYGONM:
-	  case SHPT_POLYGONZ:
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-				  row.push_back(Te2String(j));
-			  if (row[linkCol].empty())
-				 row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-			  attTable.add(row);
-			  psShape = SHPReadObject(hSHP,j);
-			  TeSHPPolygonDecode(psShape,polygons,objid);
-			  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-				  layer->addPolygons(polygons);
-				  polygons.clear();
-				  layer->saveAttributeTable(attTable);
-				  attTable.clear();
-				  if(TeProgress::instance())
-				  {
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }
-			  }
-
-		  }
-		  break;
-	  default:
-		  /* todo: handle multipatch geometries */
-		  throw TeException ( UNHANDLED_SHP_TYPE );
-	}
-	if (points.size() > 0)
-	{
-		layer->addPoints(points);
-		points.clear();
-	}
-	if (lines.size() > 0)
-	{
-		layer->addLines(lines);
-		lines.clear();
-	}
-	if (polygons.size() > 0)
-	{
-		layer->addPolygons(polygons);
-		polygons.clear();
-	}
-	if (attTable.size() > 0)
-	{
-		layer->saveAttributeTable(attTable);
-		attTable.clear();
-	}
-	if(TeProgress::instance())
-		TeProgress::instance()->cancel();
-
-	SHPClose(hSHP);
-	DBFClose(hDBF);
-	
-	if (!layer->database()->commitTransaction())  
-		return false;
-
-	// Create the spatial indexes
-	int rep = layer->geomRep();
-	if (rep & TePOINTS)
-	{
-		layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE);
-	}
-	if (rep & TeLINES)
-	{
-		layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE);
-	}
-	if (rep & TePOLYGONS)
-	{
-		layer->database()->insertMetadata(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), (TeSpatialIndexType)TeRTREE);
-	}
-
-	TePrecision::instance().setPrecision(oldPrec);
-
-	return true;
-}
-
-bool
-TeImportSHPGeometries(TeLayer* layer,const string& shpFileName, 
-					  vector<string> &indexes, unsigned int chunckSize)
-{
-
-	string filePrefix = TeGetName(shpFileName.c_str());
-	string fileName = filePrefix + ".shp";
-	//Open the        shapefile.                                      
-	SHPHandle	hSHP;
-	hSHP = SHPOpen( fileName.c_str(), "rb" );
-
-	if( hSHP == 0 )
-		return false;
-
-
-//    Get information about the file              
-	int		nShapeType, nEntities;
-	double 	adfMinBound[4], adfMaxBound[4];
-
-	SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
-
-//	choose the appropriate decoding function
-
-	string name  = SHPTypeName( nShapeType );
-
-	if ( name == "Arc" || name == "ArcZ" )
-	{
-		TeSHPPolyLineDecode ( layer, hSHP,indexes,chunckSize );
-	}
-	else if ( name == "Point" || name == "PointZ" ) 
-	{
-		TeSHPPointDecode ( layer, hSHP,indexes,chunckSize );
-    }
-	else if ( name == "Polygon" )
-	{
-		TeSHPPolygonDecode ( layer, hSHP,indexes,chunckSize );
-	}
-#if 0  // todo...
-	else if ( name ==  "MultiPoint" ) {}
-	else if ( name ==  "PolyLineZ") {}
-	else if ( name ==  "PolygonZ")  {}
-	else if ( name ==  "MultiPointZ") {}
-	else if ( name ==  "PointM"  ) {}
-	else if ( name ==  "PolyLineM" ) {}
-	else if ( name ==  "PolygonM") {}
-	else if ( name ==  "MultiPointM") {}
-#endif
-	else
-		throw TeException ( UNHANDLED_SHP_TYPE );
-
-    SHPClose( hSHP );
-	return true;
-
-
-}
-
-bool TeImportShapeGeometry (TeLayer* layer, const string& shpFileName, string attrTableName,  
-					string objectIdAtt, int unsigned chunkSize )
-{
-
-	string filePrefix = TeGetName(shpFileName.c_str());
-	string shpFileN = filePrefix + ".shp";
-	string dbfFileN = filePrefix + ".dbf";
-
-	SHPHandle	hSHP = SHPOpen(shpFileN.c_str(),"rb");
-	if (hSHP == 0)
-		return false;
-
-    DBFHandle hDBF = DBFOpen(dbfFileN.c_str(), "rb");
-    if (hDBF == 0)
-    {
-		SHPClose(hSHP);
-		return false;
-    }
-
-	// Read some information about the shapefile
-	int nShapeType, nEntities;
-	// --- get the shape and decode it
-	double 	adfMinBound[4], adfMaxBound[4];
-	SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
-	string shpName = SHPTypeName( nShapeType );
-	if (shpName == "UnknownShapeType")
-	{
-		SHPClose(hSHP);
-		return false;
-	}
-
-	if (attrTableName.empty())
-	{
-		if (layer->name().empty())
-			return false;
-		else
-			attrTableName = layer->name();
-	}
-	
-	int linkCol=-1;
-    unsigned int j=0;
-	bool autoIndex = false;
-    int indexOffset = 0;
-
-	if (!layer->database()->beginTransaction())
-		return false;
-
-	//read the attribute list information 
-	TeAttributeList attList;
-  TeReadDBFAttributeList(shpFileName, attList);
-
-	// if no geometry link name is given, creates one called 'object_id_'
-	string ext = "";
-	int count = 0;
-	if (objectIdAtt.empty())
-	{
-		objectIdAtt = "object_id_" + Te2String(layer->id());
-		string s2 = TeConvertToUpperCase(objectIdAtt);
-		while (true)
-		{
-			for (j=0; j<attList.size(); j++)
-			{
-				string s0 = attList[j].rep_.name_;
-				string s1 = TeConvertToUpperCase(s0);
-				if ( s1 == s2)
-					break;
-			}
-			if (j < attList.size())
-			{
-				++count;
-				objectIdAtt = "object_id_" + Te2String(count);
-			}
-			else
-				break;
-		}
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;
-		at.rep_.numChar_ = 16;
-		at.rep_.name_ = objectIdAtt;
-		at.rep_.isPrimaryKey_ = true;
-		attList.push_back(at);
-		linkCol = attList.size()-1;
-		autoIndex = true;
-	}
-	else
-	{
-		// check if given index is valid
-		TeAttributeList::iterator it = attList.begin();
-		while (it != attList.end())
-		{
-			if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(objectIdAtt))		// index found
-			{
-				if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
-				{
-					(*it).rep_.type_ = TeSTRING;
-					(*it).rep_.numChar_ = 16;
-				}
-				(*it).rep_.isPrimaryKey_ = true;
-				linkCol=j;
-				break;
-			}
-			++it;
-			++j;
-		}
-		if (it == attList.end())			// index not found
-		{
-			objectIdAtt = "object_id_" + Te2String(layer->id());;
-			while (true)
-			{
-				for (j=0; j<attList.size(); j++)
-				{
-					if (TeConvertToUpperCase(attList[j].rep_.name_) == TeConvertToUpperCase(objectIdAtt))
-						break;
-				}
-				if (j < attList.size())
-				{
-					++count;
-					objectIdAtt = "object_id_" + Te2String(count);
-				}
-				else
-					break;
-			}
-			TeAttribute at;
-			at.rep_.type_ = TeSTRING;
-			at.rep_.numChar_ = 16;
-			at.rep_.name_ = objectIdAtt;
-			at.rep_.isPrimaryKey_ = true;
-			attList.push_back(at);
-			autoIndex = true;
-		}
-	}
-	if (autoIndex)
-    {
-		linkCol = attList.size()-1;
-		indexOffset = layer->getNewObjectId();
-    }
-
-	TeTable attTable (attrTableName,attList,objectIdAtt,objectIdAtt,TeAttrStatic);
-
-	string objid, value;
-	TePointSet points;
-	TeLineSet lines;
-	TePolygonSet polygons;
-	TeTableRow row;
-	SHPObject* psShape;
-
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(nEntities);
-		TeProgress::instance()->setProgress(j+1);
-	}
-
-	// OBS1: we discard Z and M values when available, because TerraLib
-	// doesn�t have the concept of 3D or measured geometries
-	// OBS2: non identified geometries are mapped to a object_id_
-	// "te_nulo"
-	switch (nShapeType) 
-	{
-		// --- null geometries ---
-	  case SHPT_NULL:							// read only the attributes
-		for (j=0; j<(unsigned int)nEntities; j++)
-		{
-		  row.clear();
-		  TeDBFRowDecode(hDBF,j,row);
-		  if (autoIndex)	// --- create automatic index if needed
-			  row.push_back(Te2String(j + indexOffset));
-		  if (row[linkCol].empty())
-			 row[linkCol] = "te_nulo";
-		  objid = row[linkCol];
-
-		  if ((j%chunkSize) == 0)
-		  {
-			  if(TeProgress::instance())
-			  {
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(j+1);
-			  }	
-		  }
-		}
-		break;
-		// --- point geometries ---
-	  case SHPT_POINTZ:	
-	  case SHPT_MULTIPOINTZ:
-	  case SHPT_POINTM:
-	  case SHPT_MULTIPOINTM:
-	  case SHPT_POINT:
-	  case SHPT_MULTIPOINT:
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-				  row.push_back(Te2String(j + indexOffset));
-			  if (row[linkCol].empty())
-				 row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-
-			  psShape = SHPReadObject(hSHP,j);
-
-			  TeSHPPointDecode(psShape,points,objid);
-     		  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-				  if (!layer->addPoints(points))
-				  {
-					  SHPClose(hSHP);
-					  layer->database()->rollbackTransaction(); 
-					  return false;
-				  }
-				  points.clear();
-
-				  if(TeProgress::instance())
-				  {
-					  if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }	
-			  }
-		  }
-		  break;
-		// --- line geometries ---
-	  case SHPT_ARCZ:
-	  case SHPT_ARCM:
-	  case SHPT_ARC:
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-				  row.push_back(Te2String(j + indexOffset));
-			  if (row[linkCol].empty())
-				 row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-
-			  psShape = SHPReadObject(hSHP,j);
-
-			  TeSHPPolyLineDecode(psShape,lines,objid);
-		  
-			  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-				  if (!layer->addLines(lines))
-				  {
-					  SHPClose(hSHP);
-					  layer->database()->rollbackTransaction(); 
-					  return false;
-				  }
-				  lines.clear();
-
-				  if(TeProgress::instance())
-				  {
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }	
-			  }
-		  }
-		  break;
-	// --- polygon geometries ---
-	  case SHPT_POLYGON:
-	  case SHPT_POLYGONM:
-	  case SHPT_POLYGONZ:
-
-		  for (j=0; j<(unsigned int)nEntities; j++)
-		  {
-			  row.clear();
-
-			  TeDBFRowDecode(hDBF,j,row);
-			  if (autoIndex)	// --- create automatic index if needed
-			    row.push_back(Te2String(j + indexOffset));
-			  if (row[linkCol].empty())
-				  row[linkCol] = "te_nulo";
-			  objid = row[linkCol];
-			  
-			  psShape = SHPReadObject(hSHP,j);
-
-			  TeSHPPolygonDecode(psShape,polygons,objid);
-
-			  SHPDestroyObject(psShape);
-			  if ((j%chunkSize) == 0)
-			  {
-
-				  if (!layer->addPolygons(polygons))
-				  {
-					  SHPClose(hSHP);
-					  layer->database()->rollbackTransaction(); 
-					  return false;
-				  }
-
-				  polygons.clear();
-
-				  if(TeProgress::instance())
-				  {
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					else
-						TeProgress::instance()->setProgress(j+1);
-				  }
-			  }
-
-		  }
-		  break;
-	  default:
-		  // todo: handle multipatch geometries 
-		  throw TeException ( UNHANDLED_SHP_TYPE );
-	}
-	if (points.size() > 0)
-	{
-		if (!layer->addPoints(points))
-		{
-			SHPClose(hSHP);
-			layer->database()->rollbackTransaction(); 
-			return false;
-		}
-
-		points.clear();
-	}
-	if (lines.size() > 0)
-	{
-		if (!layer->addLines(lines))
-		{
-			SHPClose(hSHP);
-			layer->database()->rollbackTransaction();
-			return false;
-		}
-
-		lines.clear();
-	}
-	if (polygons.size() > 0)
-	{
-		if (!layer->addPolygons(polygons))
-		{
-			SHPClose(hSHP);
-			layer->database()->rollbackTransaction();
-			return false;
-		}
-		polygons.clear();
-	}
-	if(TeProgress::instance())
-		TeProgress::instance()->cancel();
-
-	SHPClose(hSHP);
-
-	if (!layer->database()->commitTransaction())
-		return false;
-
-	return true;
-}
-
-
-void TeDBFRowDecode(DBFHandle& hDBF, int nr, TeTableRow& row)
-{
-	string value;
-	int i;
-	for (i = 0; i < DBFGetFieldCount(hDBF); i++)
-	{
-		value =  DBFReadStringAttribute(hDBF,nr,i);
-		row.push_back(value); 
-	}
-}
-
-void TeSHPPointDecode(SHPObject* psShape, TePointSet& points, string& objid)
-{
-	int nv = psShape->nVertices;
-	for (int i = 0; i<nv; i++)
-	{
-		TePoint point(psShape->padfX[i], psShape->padfY[i]);
-		point.objectId(objid);
-		points.add(point);
-	}
-}
-
-
-void TeSHPPolyLineDecode(SHPObject* psShape, TeLineSet& lines, string& objid)
-{
-	int iPart,j=0,nextStart=0; 
-	for (iPart = 0; iPart < psShape->nParts; iPart++)
-	{
-		if (iPart == psShape->nParts-1)
-			nextStart = psShape->nVertices;
-		else 
-			nextStart = psShape->panPartStart[iPart+1];
-
-		TeLine2D line;
-		while (j<nextStart)
-		{
-			TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
-			line.add ( pt );
-			j++;
-		}
-		line.objectId (objid);	
-		lines.add ( line );
-	}
-}
-
-void
-TeSHPPolygonDecode(SHPObject* psShape, TePolygonSet& polys, string& objid)
-{
-	int iPart = 0;
-	vector<int> partStart;
-
-	// Build an array whose components point to the starting point
-	// of the rings that compose the polygon shape
-	for ( iPart = 0; iPart < psShape->nParts; iPart++ )
-		partStart.push_back ( psShape->panPartStart[iPart] );
-	partStart.push_back ( psShape->nVertices ); // point to the end
-
-	vector<TePolygon> pList;
-	vector<TeLinearRing> holes;
-	int j = 0;
-	iPart = 0;
-	while (j < psShape->nVertices)
-	{
-		TeLine2D line;
-		iPart++;						// while it doesn�t reach the start of next part
-		while ( j < partStart[iPart] )	// build a line from the coordinates
-		{
-			TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
-			line.add ( pt );
-			j++;
-		}								
-		if (!line.isRing())				// force the closing of opened rings
-			line.add(line[0]);
-
-		// decide if a ring is an outter ring or an inner ring based on its orientation
-		TeLinearRing ring(line);
-		short orient = TeOrientation(ring);
-		if(orient == TeCLOCKWISE)	// outter ring: start a new polygon
-		{
-			TePolygon p;
-			p.add(ring);
-			p.objectId(objid);
-			pList.push_back(p);
-		}
-		else	// COUNTERCLOCKWISE => inner ring: put on the list of holes
-			holes.push_back(ring);
-	} // read all vertices
-
-
-	// even though there are rings that are in counter clockwise orientation, 
-	// there aren't any clockwise orientation rings to be possible parents of 
-	// these inner rings. The decision here: treat all of them as outter rings...
-	if (pList.empty() && !holes.empty())
-	{
-		for (unsigned int i=0; i<holes.size(); ++i)
-		{
-			TePolygon p;
-			p.add(holes[i]);
-			p.objectId(objid);
-			polys.add(p);
-		}
-		return;
-	}
-
-	if (pList.size() == 1)	// shape has only one polygon that should
-	{						// contain all the inner rings
-		for(unsigned int i = 0; i < holes.size(); ++i)
-			pList[0].add(holes[i]);
-	}
-	else
-	{	// shape has multiple outter ring and inner rings
-		// we have to find a parent to each inner ring 
-		for(unsigned int i = 0; i < holes.size(); ++i)
-		{
-			vector<TePolygon> candidates;
-			TeLinearRing ring = holes[i];
-			
-			// step 1: consider as a inner ring parent candidate every polygon 
-			// that intercepts the ring MBR
-			unsigned int j = 0;
-			for(j = 0; j < pList.size(); ++j)
-			{
-				if(TeWithinOrCoveredByOrEquals(ring.box(), pList[j].box()))
-					candidates.push_back(pList[j]);
-			}
-
-			// if there is only one candidate this is the parent
-			if(candidates.size() == 1)
-			{
-				candidates[0].add(ring);
-				continue;
-			}
-
-			// step 2: refine the candidates to parent: consider only those 
-			// that contains the ring (not just its MBR)
-			vector<TePolygon> newCandidates;
-			for(j = 0; j < candidates.size(); ++j)
-			{
-				short rel = TeBOUNDARY;
-				bool inside = false;
-
-				unsigned int nthVert = ring.size();
-				unsigned int iVert = 0u;
-
-				while(iVert < nthVert)
-				{
-					rel = TeRelation(ring[iVert], candidates[j][0]);
-
-					if(rel & TeINSIDE)
-					{
-						inside = true;
-						newCandidates.push_back(candidates[j]);
-						break;
-					}
-					else if(rel & TeOUTSIDE)
-						break;
-					++iVert;
-				}
-
-				if(iVert == nthVert)	
-					break;
-			}
-			
-			// sort the new candidates according to their areas
-			int idxMinArea = 0;
-			double minArea = TeMAXFLOAT;
-			for(j = 0; j < newCandidates.size(); ++j)
-			{
-				if(TeGeometryArea(newCandidates[j].box()) < minArea)
-				{
-					idxMinArea = j;
-					minArea = TeGeometryArea(newCandidates[j].box());
-				}
-			}
-			// choose as parent the candidate that has the smaller area
-			if (!newCandidates.empty())
-				newCandidates[idxMinArea].add(ring);
-		}
-	}
-
-	// add polygons to the list passed as parameter
-	vector<TePolygon>::iterator it = pList.begin();
-	while (it != pList.end())
-	{
-		polys.add(*it);
-		++it;
-	}
-}
-
-void
-TeSHPPointDecode( TeLayer* layer, SHPHandle hSHP, vector<string>& indexVect, unsigned int chunckSize  )
-{
-	int nEntities = hSHP->nRecords; // indicates how many point sets are there
-	TePointSet points;
-
-/* -------------------------------------------------------------------- */
-/*	Skim over the list of shapes, reading all the vertices.	            */
-/* -------------------------------------------------------------------- */
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(nEntities);
-
-    int j;
-	for(j= 0; j < nEntities; j++ )
-    {
-        SHPObject* psShape = SHPReadObject( hSHP, j );
-		
-		int i;
-		for (i = 0; i < ( psShape->nVertices ); i++ )
-		{
-			TePoint point;
-			TeCoord2D xy ( psShape->padfX[i], psShape->padfY[i] );
-			point.add ( xy );
-			point.objectId ( indexVect[j] );
-			points.add ( point );
-		}
-		// check if there is a chunk of points to be inserted into the database
-		if ( points.size() >= chunckSize )
-		{
-			layer->addPoints( points ); 
-			points.clear();
-			if(TeProgress::instance())
-			{
-				if (TeProgress::instance()->wasCancelled())
-						break;
-				else
-					TeProgress::instance()->setProgress(j+1);
-			}
-		}	
-		SHPDestroyObject( psShape );
-	}
-	layer->addPoints( points ); 
-	points.clear();
-	if(TeProgress::instance())
-		TeProgress::instance()->setProgress(j+1);
-}
-
-void
-TeSHPPolyLineDecode ( TeLayer*layer, SHPHandle hSHP, vector<string>& indexVect, unsigned int chunckSize )
-{
-	int nEntities = hSHP->nRecords; // indicates how many regions are there
-	TeLineSet lines;
-
-/* -------------------------------------------------------------------- */
-/*	Skim over the list of shapes, reading all the vertices.	            */
-/* -------------------------------------------------------------------- */
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(nEntities);
-
-	int i;
-    for(i = 0; i < nEntities; i++ )
-    {
-        SHPObject* psShape = SHPReadObject( hSHP, i );
-
-		// Build an array whose components point to the starting point
-		// of the rings that compose the shapepoly
-		int iPart;
-		vector<int> partStart;
-
-		// Build an array whose components point to the starting point
-		// of the segments that compose the shapeline
-		//
-		for ( iPart = 0; iPart < psShape->nParts; iPart++ )
-		{
-			partStart.push_back ( psShape->panPartStart[iPart] );
-		}
-		partStart.push_back ( psShape->nVertices ); // point to the end
-
-		iPart = 0;
-
-		int j = 0; 
-
-		while ( j < psShape->nVertices )
-		{
-			TeLine2D line;
-
-			iPart++;  // indicates the different segments of the line
-			// Read each segment
-			while ( j < partStart[iPart] )
-			{
-				TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
-				line.add ( pt );
-				j++;
-			}
-			// set the geometry Id for the line 
-			line.objectId ( indexVect[i] ); // set the object index
-			
-			lines.add ( line );
-		}
-		
-		// check if there is a chunk of lines to be inserted into the database
-		if ( lines.size() >= chunckSize )
-		{
-			layer->addLines( lines ); 
-			lines.clear();
-			if(TeProgress::instance())
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(i+1);
-			}
-		}		
-		SHPDestroyObject( psShape );
-	}
-	
-	// saves the remaining lines into the database
-	layer->addLines( lines ); 
-	lines.clear();
-	if(TeProgress::instance())
-		TeProgress::instance()->setProgress(i+1);
-}
-
-void
-TeSHPPolygonDecode ( TeLayer* layer, SHPHandle hSHP, vector<string>& indexVect, unsigned int chunckSize )
-{
-
-	int nEntities = hSHP->nRecords; // indicates how many regions are there
-	TePolygonSet polys;
-
-/* -------------------------------------------------------------------- */
-/*	Skim over the list of shapes, reading all the vertices.	            */
-/* -------------------------------------------------------------------- */
-	if(TeProgress::instance())
-		TeProgress::instance()->setMessage("Importando poligonos, aguarde...      ");
-
-	int i;
-    for(i = 0; i < nEntities; i++ )
-    {
-		SHPObject* psShape = SHPReadObject( hSHP, i );
-
-		int iPart;
-		vector<int> partStart;
-
-		// Auxiliary variables
-
-		list<TePolygon> pList;
-
-		// Build an array whose components point to the starting point
-		// of the rings that compose the shapepoly
-		//
-		for ( iPart = 0; iPart < psShape->nParts; iPart++ )
-		{
-			partStart.push_back ( psShape->panPartStart[iPart] );
-		}
-		partStart.push_back ( psShape->nVertices ); // point to the end
-
-		iPart = 0;
-
-		int j = 0;
-
-		while ( j < psShape->nVertices )
-		{
-			iPart++;  // indicates the different rings of the shapepoly
-			TeLine2D line;
-
-			// Read each ring
-			while ( j < partStart[iPart] )
-			{
-				TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
-				line.add ( pt );
-				j++;
-			}
-			// end of a ring
-
-			if (!line.isRing())
-			{
-				line.add(line[0]);
-//				throw TeException ( POLYSHAPE_IS_NOT_RING );
-			}
-
-			TeLinearRing ring ( line );
-
-			// Is it an OUTER or an INNER RING ?
-
-			bool inside = false;
-
-			list<TePolygon>::iterator it = pList.begin();
-
-
-			// Each ring is assigned to a polygon
-			// Each ring and polygon have a unique "geometrical index"
-			//
-			// All rings and polygons that are part of a same object
-			// have the same "object index"
-
-			while ( it != pList.end() )
-			{
-				TePolygon aux;
-				aux.add(ring);
-				if ( TeWithin ( aux, (*it)))
-				{
-					inside = true;
-					ring.objectId ( (*it)[0].objectId() ); // sets the object index
-					(*it).add ( ring );// add a closed region
-					break;
-				}
-				++it;
-			}
-			if ( ! inside )
-			{
-				TePolygon poly;
-				ring.objectId (indexVect[i]);
-				
-				// add a pair (objectId, geometryId) to the layer
-				poly.add ( ring ); // add an outer region
-				poly.objectId ( indexVect[i] ); // set the object index
-
-				pList.push_back ( poly );
-			}
-		} // read all vertices
-
-		list<TePolygon>::iterator it = pList.begin();
-
-		while ( it != pList.end() )
-		{
-			polys.add(*it);
-			++it;
-		}
-		if ( polys.size() >= chunckSize )
-		{
-			layer->addPolygons( polys ); 
-			polys.clear();
-			if(TeProgress::instance())
-			{
-				if (TeProgress::instance()->wasCancelled())
-						break;
-				else
-					TeProgress::instance()->setProgress(i+1);
-			}
-		}
-		SHPDestroyObject( psShape );
-	} // read all entities
-
-	// save the remaining polygons
-	layer->addPolygons( polys ); 
-	polys.clear();
-	if(TeProgress::instance())
-		TeProgress::instance()->setProgress(i+1);
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+// STL 
+#include <string>
+#include <iostream>
+#include <vector>
+#include <list>
+#include <map>
+
+#ifdef WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+using namespace std;
+
+// TerraLib
+
+#include "TeDriverSHPDBF.h"
+#include "TeTable.h"
+#include "TeStdFile.h"
+#include "TeException.h"
+#include "TeUtils.h"
+#include "TeGeometry.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeLayer.h"
+#include "TeProgress.h"
+#include "TeDatabase.h"
+
+
+// from SHAPELIB
+#include "shapefil.h" 
+ 
+// Internal functions
+bool TeImportSHPGeometries (TeLayer* layer,const string& shpFileName, vector<string> &indexes, unsigned int chunckSize);
+void TeSHPPointDecode    (TeLayer*, SHPHandle, vector<string>&, unsigned int);
+void TeSHPPolyLineDecode (TeLayer*, SHPHandle, vector<string>&, unsigned int);
+void TeSHPPolygonDecode  (TeLayer*, SHPHandle, vector<string>&, unsigned int);
+
+TeLayer* TeImportShape(const string& shpFileName, TeDatabase* db, const string& layerName)
+{
+	if (!db || shpFileName.empty()) 
+		return 0;
+
+	// check if format is complete (SHP, SHX e DBF files exist)
+	string filePrefix = TeGetName(shpFileName.c_str());
+	string ftest = filePrefix + ".dbf";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".DBF";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+	ftest = filePrefix + ".shx";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".SHX";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+
+	// found a valid layer name
+	string lName;
+	string baseName = TeGetBaseName(shpFileName.c_str());
+	if (layerName.empty())
+		lName = baseName;
+	else
+		lName = layerName;
+
+	string newLayerName = lName;
+	TeLayerMap& layerMap = db->layerMap();
+	TeLayerMap::iterator it;
+	bool flag = true;
+	int n = 1;
+	while (flag)
+	{
+		for (it = layerMap.begin(); it != layerMap.end(); ++it)
+		{
+			if (TeStringCompare(it->second->name(),newLayerName))
+				break;
+		}
+		if (it == layerMap.end())
+			flag = 0;
+		else
+			newLayerName = lName + "_" +Te2String(n);
+		n++;	
+	}
+
+	// find projection
+	TeLayer* newLayer = new TeLayer(newLayerName,db);
+	if (newLayer->id() <= 0 )
+		return 0;				// couldn�t create new layer
+
+	bool res = TeImportShape(newLayer,shpFileName);
+	if (res)
+		return newLayer;
+	else
+	{
+		db->deleteLayer(newLayer->id());
+		delete newLayer;
+		return 0;
+	}
+}
+
+bool TeImportShape (TeLayer* layer, const string& shpFileName, string attrTableName,  
+					string objectIdAtt, int unsigned chunkSize )
+{
+	double oldPrec = TePrecision::instance().precision();
+
+	if(layer)
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
+	}
+	else
+	{
+		TePrecision::instance().setPrecision(TeGetPrecision(0));
+	}
+
+
+	string filePrefix = TeGetName(shpFileName.c_str());
+	string ftest = filePrefix + ".dbf";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".DBF";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+	string dbfFileN = ftest;
+
+	ftest = filePrefix + ".shx";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".SHX";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+
+	ftest = filePrefix + ".shp";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".SHP";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+	string shpFileN = ftest;
+
+	SHPHandle	hSHP = SHPOpen(shpFileN.c_str(),"rb");
+	if (hSHP == 0)
+	{
+		TePrecision::instance().setPrecision(oldPrec);
+		return false;
+	}
+
+    	DBFHandle hDBF = DBFOpen(dbfFileN.c_str(), "rb");
+    	if (hDBF == 0)
+    	{
+		TePrecision::instance().setPrecision(oldPrec);
+		SHPClose(hSHP);
+		return false;
+    	}
+
+	// Read some information about the shapefile
+	int nShapeType, nEntities;
+	// --- get the shape and decode it
+	double 	adfMinBound[4], adfMaxBound[4];
+	SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
+	string shpName = SHPTypeName( nShapeType );
+	if (shpName == "UnknownShapeType")
+	{
+		TePrecision::instance().setPrecision(oldPrec);
+		SHPClose(hSHP);
+		DBFClose(hDBF);
+		return false;
+	}
+
+	if (attrTableName.empty())
+	{
+		if (layer->name().empty())
+		{
+			TePrecision::instance().setPrecision(oldPrec);
+			return false;
+		}
+		else
+			attrTableName = layer->name();
+	}
+	
+	int linkCol=-1;
+    	unsigned int j=0;
+	bool autoIndex = false;
+	int indexOffset = 0;  
+	
+	if (!layer->database()->beginTransaction())  
+		return false;
+
+	//read the attribute list information 
+	TeAttributeList attList;
+	TeReadDBFAttributeList(shpFileName, attList);
+
+	// if no geometry link name is given, creates one called 'object_id_'
+	string ext = "";
+	int count = 0;
+	if (objectIdAtt.empty())
+	{
+		objectIdAtt = "object_id_" + Te2String(layer->id());
+		string s2 = TeConvertToUpperCase(objectIdAtt);
+		while (true)
+		{
+			for (j=0; j<attList.size(); j++)
+			{
+				string s0 = attList[j].rep_.name_;
+				string s1 = TeConvertToUpperCase(s0);
+				if ( s1 == s2)
+					break;
+			}
+			if (j < attList.size())
+			{
+				++count;
+				objectIdAtt = "object_id_" + Te2String(count);
+			}
+			else
+				break;
+		}
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;
+		at.rep_.numChar_ = 16;
+		at.rep_.name_ = objectIdAtt;
+		at.rep_.isPrimaryKey_ = true;
+		attList.push_back(at);
+		linkCol = attList.size()-1;
+		autoIndex = true;
+	}
+	else
+	{
+		// check if given index is valid
+		TeAttributeList::iterator it = attList.begin();
+		while (it != attList.end())
+		{
+			if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(objectIdAtt))		// index found
+			{
+				if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
+				{
+					(*it).rep_.type_ = TeSTRING;
+					(*it).rep_.numChar_ = 16;
+				}
+				(*it).rep_.isPrimaryKey_ = true;
+				linkCol=j;
+				break;
+			}
+			++it;
+			++j;
+		}
+		if (it == attList.end())			// index not found
+		{
+			objectIdAtt = "object_id_" + Te2String(layer->id());;
+			while (true)
+			{
+				for (j=0; j<attList.size(); j++)
+				{
+					if (TeConvertToUpperCase(attList[j].rep_.name_) == TeConvertToUpperCase(objectIdAtt))
+						break;
+				}
+				if (j < attList.size())
+				{
+					++count;
+					objectIdAtt = "object_id_" + Te2String(count);
+				}
+				else
+					break;
+			}
+			TeAttribute at;
+			at.rep_.type_ = TeSTRING;
+			at.rep_.numChar_ = 16;
+			at.rep_.name_ = objectIdAtt;
+			at.rep_.isPrimaryKey_ = true;
+			attList.push_back(at);
+			autoIndex = true;
+		}
+	}
+	if (autoIndex)
+	{
+		linkCol = attList.size()-1;
+		indexOffset = layer->getNewObjectId(); 
+    	}
+
+	TeTable attTable (attrTableName,attList,objectIdAtt,objectIdAtt,TeAttrStatic);
+	if (!layer->createAttributeTable(attTable))			// create the table in the database
+	{
+		SHPClose(hSHP);  
+		DBFClose(hDBF);  
+		layer->database()->rollbackTransaction();  
+		TePrecision::instance().setPrecision(oldPrec);
+		return false;
+	}
+	
+	string objid, value;
+	TePointSet points;
+	TeLineSet lines;
+	TePolygonSet polygons;
+	TeTableRow row;
+	SHPObject* psShape;
+
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nEntities);
+		TeProgress::instance()->setProgress(j+1);
+	}
+
+	// OBS1: we discard Z and M values when available, because TerraLib
+	// doesn�t have the concept of 3D or measured geometries
+	// OBS2: non identified geometries are mapped to a object_id_
+	// "te_nulo"
+	switch (nShapeType) 
+	{
+		// --- null geometries ---
+	  case SHPT_NULL:							// read only the attributes
+		for (j=0; j<(unsigned int)nEntities; j++)
+		{
+		  row.clear();
+		  TeDBFRowDecode(hDBF,j,row);
+		  if (autoIndex)	// --- create automatic index if needed
+			  row.push_back(Te2String(j));
+		  if (row[linkCol].empty())
+			 row[linkCol] = "te_nulo";
+		  objid = row[linkCol];
+		  attTable.add(row);
+		  if ((j%chunkSize) == 0)
+		  {
+			  layer->saveAttributeTable(attTable);
+			  attTable.clear();
+			  if(TeProgress::instance())
+			  {
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(j+1);
+			  }	
+		  }
+		}
+		break;
+		// --- point geometries ---
+	  case SHPT_POINTZ:	
+	  case SHPT_MULTIPOINTZ:
+	  case SHPT_POINTM:
+	  case SHPT_MULTIPOINTM:
+	  case SHPT_POINT:
+	  case SHPT_MULTIPOINT:
+		  for (j=0; j<(unsigned int)nEntities; j++)
+		  {
+			  row.clear();
+			  TeDBFRowDecode(hDBF,j,row);
+			  if (autoIndex)	// --- create automatic index if needed
+				  row.push_back(Te2String(j));
+			  if (row[linkCol].empty())
+				 row[linkCol] = "te_nulo";
+			  objid = row[linkCol];
+			  attTable.add(row);
+			  psShape = SHPReadObject(hSHP,j);
+              TeSHPPointDecode(psShape,points,objid);
+     		  SHPDestroyObject(psShape);
+			  if ((j%chunkSize) == 0)
+			  {
+				  layer->addPoints(points);
+				  points.clear();
+				  layer->saveAttributeTable(attTable);
+				  attTable.clear();
+				  if(TeProgress::instance())
+				  {
+					if (TeProgress::instance()->wasCancelled())
+						break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+				  }	
+			  }
+		  }
+		  break;
+		// --- line geometries ---
+	  case SHPT_ARCZ:
+	  case SHPT_ARCM:
+	  case SHPT_ARC:
+		  for (j=0; j<(unsigned int)nEntities; j++)
+		  {
+			  row.clear();
+			  TeDBFRowDecode(hDBF,j,row);
+			  if (autoIndex)	// --- create automatic index if needed
+				  row.push_back(Te2String(j));
+			  if (row[linkCol].empty())
+				 row[linkCol] = "te_nulo";
+			  objid = row[linkCol];
+			  attTable.add(row);
+			  psShape = SHPReadObject(hSHP,j);
+			  TeSHPPolyLineDecode(psShape,lines,objid);
+     		  SHPDestroyObject(psShape);
+			  if ((j%chunkSize) == 0)
+			  {
+			 	  layer->addLines(lines);
+				  lines.clear();
+				  layer->saveAttributeTable(attTable);
+				  attTable.clear();
+				  if(TeProgress::instance())
+				  {
+					if (TeProgress::instance()->wasCancelled())
+						break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+				  }	
+			  }
+		  }
+		  break;
+	// --- polygon geometries ---
+	  case SHPT_POLYGON:
+	  case SHPT_POLYGONM:
+	  case SHPT_POLYGONZ:
+		  for (j=0; j<(unsigned int)nEntities; j++)
+		  {
+			  row.clear();
+			  TeDBFRowDecode(hDBF,j,row);
+			  if (autoIndex)	// --- create automatic index if needed
+				  row.push_back(Te2String(j));
+			  if (row[linkCol].empty())
+				 row[linkCol] = "te_nulo";
+			  objid = row[linkCol];
+			  attTable.add(row);
+			  psShape = SHPReadObject(hSHP,j);
+			  TeSHPPolygonDecode(psShape,polygons,objid);
+			  SHPDestroyObject(psShape);
+			  if ((j%chunkSize) == 0)
+			  {
+				  layer->addPolygons(polygons);
+				  polygons.clear();
+				  layer->saveAttributeTable(attTable);
+				  attTable.clear();
+				  if(TeProgress::instance())
+				  {
+					if (TeProgress::instance()->wasCancelled())
+						break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+				  }
+			  }
+
+		  }
+		  break;
+	  default:
+		  /* todo: handle multipatch geometries */
+		  throw TeException ( UNHANDLED_SHP_TYPE );
+	}
+	if (points.size() > 0)
+	{
+		layer->addPoints(points);
+		points.clear();
+	}
+	if (lines.size() > 0)
+	{
+		layer->addLines(lines);
+		lines.clear();
+	}
+	if (polygons.size() > 0)
+	{
+		layer->addPolygons(polygons);
+		polygons.clear();
+	}
+	if (attTable.size() > 0)
+	{
+		layer->saveAttributeTable(attTable);
+		attTable.clear();
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->cancel();
+
+	SHPClose(hSHP);
+	DBFClose(hDBF);
+	
+	if (!layer->database()->commitTransaction())  
+		return false;
+
+	// Create the spatial indexes
+	int rep = layer->geomRep();
+	if (rep & TePOINTS)
+	{
+		layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE);
+	}
+	if (rep & TeLINES)
+	{
+		layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE);
+	}
+	if (rep & TePOLYGONS)
+	{
+		layer->database()->insertMetadata(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), (TeSpatialIndexType)TeRTREE);
+	}
+
+	TePrecision::instance().setPrecision(oldPrec);
+
+	return true;
+}
+
+bool
+TeImportSHPGeometries(TeLayer* layer,const string& shpFileName, 
+					  vector<string> &indexes, unsigned int chunckSize)
+{
+
+	string filePrefix = TeGetName(shpFileName.c_str());
+	string fileName = filePrefix + ".shp";
+	//Open the        shapefile.                                      
+	SHPHandle	hSHP;
+	hSHP = SHPOpen( fileName.c_str(), "rb" );
+
+	if( hSHP == 0 )
+		return false;
+
+
+//    Get information about the file              
+	int		nShapeType, nEntities;
+	double 	adfMinBound[4], adfMaxBound[4];
+
+	SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
+
+//	choose the appropriate decoding function
+
+	string name  = SHPTypeName( nShapeType );
+
+	if ( name == "Arc" || name == "ArcZ" )
+	{
+		TeSHPPolyLineDecode ( layer, hSHP,indexes,chunckSize );
+	}
+	else if ( name == "Point" || name == "PointZ" ) 
+	{
+		TeSHPPointDecode ( layer, hSHP,indexes,chunckSize );
+    }
+	else if ( name == "Polygon" )
+	{
+		TeSHPPolygonDecode ( layer, hSHP,indexes,chunckSize );
+	}
+#if 0  // todo...
+	else if ( name ==  "MultiPoint" ) {}
+	else if ( name ==  "PolyLineZ") {}
+	else if ( name ==  "PolygonZ")  {}
+	else if ( name ==  "MultiPointZ") {}
+	else if ( name ==  "PointM"  ) {}
+	else if ( name ==  "PolyLineM" ) {}
+	else if ( name ==  "PolygonM") {}
+	else if ( name ==  "MultiPointM") {}
+#endif
+	else
+		throw TeException ( UNHANDLED_SHP_TYPE );
+
+    SHPClose( hSHP );
+	return true;
+
+
+}
+
+bool TeImportShapeGeometry (TeLayer* layer, const string& shpFileName, string attrTableName,  
+					string objectIdAtt, int unsigned chunkSize )
+{
+
+	string filePrefix = TeGetName(shpFileName.c_str());
+	string shpFileN = filePrefix + ".shp";
+	string dbfFileN = filePrefix + ".dbf";
+
+	SHPHandle	hSHP = SHPOpen(shpFileN.c_str(),"rb");
+	if (hSHP == 0)
+		return false;
+
+    DBFHandle hDBF = DBFOpen(dbfFileN.c_str(), "rb");
+    if (hDBF == 0)
+    {
+		SHPClose(hSHP);
+		return false;
+    }
+
+	// Read some information about the shapefile
+	int nShapeType, nEntities;
+	// --- get the shape and decode it
+	double 	adfMinBound[4], adfMaxBound[4];
+	SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
+	string shpName = SHPTypeName( nShapeType );
+	if (shpName == "UnknownShapeType")
+	{
+		SHPClose(hSHP);
+		return false;
+	}
+
+	if (attrTableName.empty())
+	{
+		if (layer->name().empty())
+			return false;
+		else
+			attrTableName = layer->name();
+	}
+	
+	int linkCol=-1;
+    unsigned int j=0;
+	bool autoIndex = false;
+    int indexOffset = 0;
+
+	if (!layer->database()->beginTransaction())
+		return false;
+
+	//read the attribute list information 
+	TeAttributeList attList;
+  TeReadDBFAttributeList(shpFileName, attList);
+
+	// if no geometry link name is given, creates one called 'object_id_'
+	string ext = "";
+	int count = 0;
+	if (objectIdAtt.empty())
+	{
+		objectIdAtt = "object_id_" + Te2String(layer->id());
+		string s2 = TeConvertToUpperCase(objectIdAtt);
+		while (true)
+		{
+			for (j=0; j<attList.size(); j++)
+			{
+				string s0 = attList[j].rep_.name_;
+				string s1 = TeConvertToUpperCase(s0);
+				if ( s1 == s2)
+					break;
+			}
+			if (j < attList.size())
+			{
+				++count;
+				objectIdAtt = "object_id_" + Te2String(count);
+			}
+			else
+				break;
+		}
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;
+		at.rep_.numChar_ = 16;
+		at.rep_.name_ = objectIdAtt;
+		at.rep_.isPrimaryKey_ = true;
+		attList.push_back(at);
+		linkCol = attList.size()-1;
+		autoIndex = true;
+	}
+	else
+	{
+		// check if given index is valid
+		TeAttributeList::iterator it = attList.begin();
+		while (it != attList.end())
+		{
+			if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(objectIdAtt))		// index found
+			{
+				if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
+				{
+					(*it).rep_.type_ = TeSTRING;
+					(*it).rep_.numChar_ = 16;
+				}
+				(*it).rep_.isPrimaryKey_ = true;
+				linkCol=j;
+				break;
+			}
+			++it;
+			++j;
+		}
+		if (it == attList.end())			// index not found
+		{
+			objectIdAtt = "object_id_" + Te2String(layer->id());;
+			while (true)
+			{
+				for (j=0; j<attList.size(); j++)
+				{
+					if (TeConvertToUpperCase(attList[j].rep_.name_) == TeConvertToUpperCase(objectIdAtt))
+						break;
+				}
+				if (j < attList.size())
+				{
+					++count;
+					objectIdAtt = "object_id_" + Te2String(count);
+				}
+				else
+					break;
+			}
+			TeAttribute at;
+			at.rep_.type_ = TeSTRING;
+			at.rep_.numChar_ = 16;
+			at.rep_.name_ = objectIdAtt;
+			at.rep_.isPrimaryKey_ = true;
+			attList.push_back(at);
+			autoIndex = true;
+		}
+	}
+	if (autoIndex)
+    {
+		linkCol = attList.size()-1;
+		indexOffset = layer->getNewObjectId();
+    }
+
+	TeTable attTable (attrTableName,attList,objectIdAtt,objectIdAtt,TeAttrStatic);
+
+	string objid, value;
+	TePointSet points;
+	TeLineSet lines;
+	TePolygonSet polygons;
+	TeTableRow row;
+	SHPObject* psShape;
+
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nEntities);
+		TeProgress::instance()->setProgress(j+1);
+	}
+
+	// OBS1: we discard Z and M values when available, because TerraLib
+	// doesn�t have the concept of 3D or measured geometries
+	// OBS2: non identified geometries are mapped to a object_id_
+	// "te_nulo"
+	switch (nShapeType) 
+	{
+		// --- null geometries ---
+	  case SHPT_NULL:							// read only the attributes
+		for (j=0; j<(unsigned int)nEntities; j++)
+		{
+		  row.clear();
+		  TeDBFRowDecode(hDBF,j,row);
+		  if (autoIndex)	// --- create automatic index if needed
+			  row.push_back(Te2String(j + indexOffset));
+		  if (row[linkCol].empty())
+			 row[linkCol] = "te_nulo";
+		  objid = row[linkCol];
+
+		  if ((j%chunkSize) == 0)
+		  {
+			  if(TeProgress::instance())
+			  {
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(j+1);
+			  }	
+		  }
+		}
+		break;
+		// --- point geometries ---
+	  case SHPT_POINTZ:	
+	  case SHPT_MULTIPOINTZ:
+	  case SHPT_POINTM:
+	  case SHPT_MULTIPOINTM:
+	  case SHPT_POINT:
+	  case SHPT_MULTIPOINT:
+		  for (j=0; j<(unsigned int)nEntities; j++)
+		  {
+			  row.clear();
+			  TeDBFRowDecode(hDBF,j,row);
+			  if (autoIndex)	// --- create automatic index if needed
+				  row.push_back(Te2String(j + indexOffset));
+			  if (row[linkCol].empty())
+				 row[linkCol] = "te_nulo";
+			  objid = row[linkCol];
+
+			  psShape = SHPReadObject(hSHP,j);
+
+			  TeSHPPointDecode(psShape,points,objid);
+     		  SHPDestroyObject(psShape);
+			  if ((j%chunkSize) == 0)
+			  {
+				  if (!layer->addPoints(points))
+				  {
+					  SHPClose(hSHP);
+					  layer->database()->rollbackTransaction(); 
+					  return false;
+				  }
+				  points.clear();
+
+				  if(TeProgress::instance())
+				  {
+					  if (TeProgress::instance()->wasCancelled())
+						break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+				  }	
+			  }
+		  }
+		  break;
+		// --- line geometries ---
+	  case SHPT_ARCZ:
+	  case SHPT_ARCM:
+	  case SHPT_ARC:
+		  for (j=0; j<(unsigned int)nEntities; j++)
+		  {
+			  row.clear();
+			  TeDBFRowDecode(hDBF,j,row);
+			  if (autoIndex)	// --- create automatic index if needed
+				  row.push_back(Te2String(j + indexOffset));
+			  if (row[linkCol].empty())
+				 row[linkCol] = "te_nulo";
+			  objid = row[linkCol];
+
+			  psShape = SHPReadObject(hSHP,j);
+
+			  TeSHPPolyLineDecode(psShape,lines,objid);
+		  
+			  SHPDestroyObject(psShape);
+			  if ((j%chunkSize) == 0)
+			  {
+				  if (!layer->addLines(lines))
+				  {
+					  SHPClose(hSHP);
+					  layer->database()->rollbackTransaction(); 
+					  return false;
+				  }
+				  lines.clear();
+
+				  if(TeProgress::instance())
+				  {
+					if (TeProgress::instance()->wasCancelled())
+						break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+				  }	
+			  }
+		  }
+		  break;
+	// --- polygon geometries ---
+	  case SHPT_POLYGON:
+	  case SHPT_POLYGONM:
+	  case SHPT_POLYGONZ:
+
+		  for (j=0; j<(unsigned int)nEntities; j++)
+		  {
+			  row.clear();
+
+			  TeDBFRowDecode(hDBF,j,row);
+			  if (autoIndex)	// --- create automatic index if needed
+			    row.push_back(Te2String(j + indexOffset));
+			  if (row[linkCol].empty())
+				  row[linkCol] = "te_nulo";
+			  objid = row[linkCol];
+			  
+			  psShape = SHPReadObject(hSHP,j);
+
+			  TeSHPPolygonDecode(psShape,polygons,objid);
+
+			  SHPDestroyObject(psShape);
+			  if ((j%chunkSize) == 0)
+			  {
+
+				  if (!layer->addPolygons(polygons))
+				  {
+					  SHPClose(hSHP);
+					  layer->database()->rollbackTransaction(); 
+					  return false;
+				  }
+
+				  polygons.clear();
+
+				  if(TeProgress::instance())
+				  {
+					if (TeProgress::instance()->wasCancelled())
+						break;
+					else
+						TeProgress::instance()->setProgress(j+1);
+				  }
+			  }
+
+		  }
+		  break;
+	  default:
+		  // todo: handle multipatch geometries 
+		  throw TeException ( UNHANDLED_SHP_TYPE );
+	}
+	if (points.size() > 0)
+	{
+		if (!layer->addPoints(points))
+		{
+			SHPClose(hSHP);
+			layer->database()->rollbackTransaction(); 
+			return false;
+		}
+
+		points.clear();
+	}
+	if (lines.size() > 0)
+	{
+		if (!layer->addLines(lines))
+		{
+			SHPClose(hSHP);
+			layer->database()->rollbackTransaction();
+			return false;
+		}
+
+		lines.clear();
+	}
+	if (polygons.size() > 0)
+	{
+		if (!layer->addPolygons(polygons))
+		{
+			SHPClose(hSHP);
+			layer->database()->rollbackTransaction();
+			return false;
+		}
+		polygons.clear();
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->cancel();
+
+	SHPClose(hSHP);
+
+	if (!layer->database()->commitTransaction())
+		return false;
+
+	return true;
+}
+
+
+void TeDBFRowDecode(DBFHandle& hDBF, int nr, TeTableRow& row)
+{
+	string value;
+	int i;
+	for (i = 0; i < DBFGetFieldCount(hDBF); i++)
+	{
+		value =  DBFReadStringAttribute(hDBF,nr,i);
+		row.push_back(value); 
+	}
+}
+
+void TeSHPPointDecode(SHPObject* psShape, TePointSet& points, string& objid)
+{
+	int nv = psShape->nVertices;
+	for (int i = 0; i<nv; i++)
+	{
+		TePoint point(psShape->padfX[i], psShape->padfY[i]);
+		point.objectId(objid);
+		points.add(point);
+	}
+}
+
+
+void TeSHPPolyLineDecode(SHPObject* psShape, TeLineSet& lines, string& objid)
+{
+	int iPart,j=0,nextStart=0; 
+	for (iPart = 0; iPart < psShape->nParts; iPart++)
+	{
+		if (iPart == psShape->nParts-1)
+			nextStart = psShape->nVertices;
+		else 
+			nextStart = psShape->panPartStart[iPart+1];
+
+		TeLine2D line;
+		while (j<nextStart)
+		{
+			TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
+			line.add ( pt );
+			j++;
+		}
+		line.objectId (objid);	
+		lines.add ( line );
+	}
+}
+
+void
+TeSHPPolygonDecode(SHPObject* psShape, TePolygonSet& polys, string& objid)
+{
+	int iPart = 0;
+	vector<int> partStart;
+
+	// Build an array whose components point to the starting point
+	// of the rings that compose the polygon shape
+	for ( iPart = 0; iPart < psShape->nParts; iPart++ )
+		partStart.push_back ( psShape->panPartStart[iPart] );
+	partStart.push_back ( psShape->nVertices ); // point to the end
+
+	vector<TePolygon> pList;
+	vector<TeLinearRing> holes;
+	int j = 0;
+	iPart = 0;
+	while (j < psShape->nVertices)
+	{
+		TeLine2D line;
+		iPart++;						// while it doesn�t reach the start of next part
+		while ( j < partStart[iPart] )	// build a line from the coordinates
+		{
+			TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
+			line.add ( pt );
+			j++;
+		}								
+		if (!line.isRing())				// force the closing of opened rings
+			line.add(line[0]);
+
+		// decide if a ring is an outter ring or an inner ring based on its orientation
+		TeLinearRing ring(line);
+		short orient = TeOrientation(ring);
+		if(orient == TeCLOCKWISE)	// outter ring: start a new polygon
+		{
+			TePolygon p;
+			p.add(ring);
+			p.objectId(objid);
+			pList.push_back(p);
+		}
+		else	// COUNTERCLOCKWISE => inner ring: put on the list of holes
+			holes.push_back(ring);
+	} // read all vertices
+
+
+	// even though there are rings that are in counter clockwise orientation, 
+	// there aren't any clockwise orientation rings to be possible parents of 
+	// these inner rings. The decision here: treat all of them as outter rings...
+	if (pList.empty() && !holes.empty())
+	{
+		for (unsigned int i=0; i<holes.size(); ++i)
+		{
+			TePolygon p;
+			p.add(holes[i]);
+			p.objectId(objid);
+			polys.add(p);
+		}
+		return;
+	}
+
+	if (pList.size() == 1)	// shape has only one polygon that should
+	{						// contain all the inner rings
+		for(unsigned int i = 0; i < holes.size(); ++i)
+			pList[0].add(holes[i]);
+	}
+	else
+	{	// shape has multiple outter ring and inner rings
+		// we have to find a parent to each inner ring 
+		for(unsigned int i = 0; i < holes.size(); ++i)
+		{
+			vector<TePolygon> candidates;
+			TeLinearRing ring = holes[i];
+			
+			// step 1: consider as a inner ring parent candidate every polygon 
+			// that intercepts the ring MBR
+			unsigned int j = 0;
+			for(j = 0; j < pList.size(); ++j)
+			{
+				if(TeWithinOrCoveredByOrEquals(ring.box(), pList[j].box()))
+					candidates.push_back(pList[j]);
+			}
+
+			// if there is only one candidate this is the parent
+			if(candidates.size() == 1)
+			{
+				candidates[0].add(ring);
+				continue;
+			}
+
+			// step 2: refine the candidates to parent: consider only those 
+			// that contains the ring (not just its MBR)
+			vector<TePolygon> newCandidates;
+			for(j = 0; j < candidates.size(); ++j)
+			{
+				short rel = TeBOUNDARY;
+				bool inside = false;
+
+				unsigned int nthVert = ring.size();
+				unsigned int iVert = 0u;
+
+				while(iVert < nthVert)
+				{
+					rel = TeRelation(ring[iVert], candidates[j][0]);
+
+					if(rel & TeINSIDE)
+					{
+						inside = true;
+						newCandidates.push_back(candidates[j]);
+						break;
+					}
+					else if(rel & TeOUTSIDE)
+						break;
+					++iVert;
+				}
+
+				if(iVert == nthVert)	
+					break;
+			}
+			
+			// sort the new candidates according to their areas
+			int idxMinArea = 0;
+			double minArea = TeMAXFLOAT;
+			for(j = 0; j < newCandidates.size(); ++j)
+			{
+				if(TeGeometryArea(newCandidates[j].box()) < minArea)
+				{
+					idxMinArea = j;
+					minArea = TeGeometryArea(newCandidates[j].box());
+				}
+			}
+			// choose as parent the candidate that has the smaller area
+			if (!newCandidates.empty())
+				newCandidates[idxMinArea].add(ring);
+		}
+	}
+
+	// add polygons to the list passed as parameter
+	vector<TePolygon>::iterator it = pList.begin();
+	while (it != pList.end())
+	{
+		polys.add(*it);
+		++it;
+	}
+}
+
+void
+TeSHPPointDecode( TeLayer* layer, SHPHandle hSHP, vector<string>& indexVect, unsigned int chunckSize  )
+{
+	int nEntities = hSHP->nRecords; // indicates how many point sets are there
+	TePointSet points;
+
+/* -------------------------------------------------------------------- */
+/*	Skim over the list of shapes, reading all the vertices.	            */
+/* -------------------------------------------------------------------- */
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(nEntities);
+
+    int j;
+	for(j= 0; j < nEntities; j++ )
+    {
+        SHPObject* psShape = SHPReadObject( hSHP, j );
+		
+		int i;
+		for (i = 0; i < ( psShape->nVertices ); i++ )
+		{
+			TePoint point;
+			TeCoord2D xy ( psShape->padfX[i], psShape->padfY[i] );
+			point.add ( xy );
+			point.objectId ( indexVect[j] );
+			points.add ( point );
+		}
+		// check if there is a chunk of points to be inserted into the database
+		if ( points.size() >= chunckSize )
+		{
+			layer->addPoints( points ); 
+			points.clear();
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+						break;
+				else
+					TeProgress::instance()->setProgress(j+1);
+			}
+		}	
+		SHPDestroyObject( psShape );
+	}
+	layer->addPoints( points ); 
+	points.clear();
+	if(TeProgress::instance())
+		TeProgress::instance()->setProgress(j+1);
+}
+
+void
+TeSHPPolyLineDecode ( TeLayer*layer, SHPHandle hSHP, vector<string>& indexVect, unsigned int chunckSize )
+{
+	int nEntities = hSHP->nRecords; // indicates how many regions are there
+	TeLineSet lines;
+
+/* -------------------------------------------------------------------- */
+/*	Skim over the list of shapes, reading all the vertices.	            */
+/* -------------------------------------------------------------------- */
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(nEntities);
+
+	int i;
+    for(i = 0; i < nEntities; i++ )
+    {
+        SHPObject* psShape = SHPReadObject( hSHP, i );
+
+		// Build an array whose components point to the starting point
+		// of the rings that compose the shapepoly
+		int iPart;
+		vector<int> partStart;
+
+		// Build an array whose components point to the starting point
+		// of the segments that compose the shapeline
+		//
+		for ( iPart = 0; iPart < psShape->nParts; iPart++ )
+		{
+			partStart.push_back ( psShape->panPartStart[iPart] );
+		}
+		partStart.push_back ( psShape->nVertices ); // point to the end
+
+		iPart = 0;
+
+		int j = 0; 
+
+		while ( j < psShape->nVertices )
+		{
+			TeLine2D line;
+
+			iPart++;  // indicates the different segments of the line
+			// Read each segment
+			while ( j < partStart[iPart] )
+			{
+				TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
+				line.add ( pt );
+				j++;
+			}
+			// set the geometry Id for the line 
+			line.objectId ( indexVect[i] ); // set the object index
+			
+			lines.add ( line );
+		}
+		
+		// check if there is a chunk of lines to be inserted into the database
+		if ( lines.size() >= chunckSize )
+		{
+			layer->addLines( lines ); 
+			lines.clear();
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(i+1);
+			}
+		}		
+		SHPDestroyObject( psShape );
+	}
+	
+	// saves the remaining lines into the database
+	layer->addLines( lines ); 
+	lines.clear();
+	if(TeProgress::instance())
+		TeProgress::instance()->setProgress(i+1);
+}
+
+void
+TeSHPPolygonDecode ( TeLayer* layer, SHPHandle hSHP, vector<string>& indexVect, unsigned int chunckSize )
+{
+
+	int nEntities = hSHP->nRecords; // indicates how many regions are there
+	TePolygonSet polys;
+
+/* -------------------------------------------------------------------- */
+/*	Skim over the list of shapes, reading all the vertices.	            */
+/* -------------------------------------------------------------------- */
+	if(TeProgress::instance())
+		TeProgress::instance()->setMessage("Importando poligonos, aguarde...      ");
+
+	int i;
+    for(i = 0; i < nEntities; i++ )
+    {
+		SHPObject* psShape = SHPReadObject( hSHP, i );
+
+		int iPart;
+		vector<int> partStart;
+
+		// Auxiliary variables
+
+		list<TePolygon> pList;
+
+		// Build an array whose components point to the starting point
+		// of the rings that compose the shapepoly
+		//
+		for ( iPart = 0; iPart < psShape->nParts; iPart++ )
+		{
+			partStart.push_back ( psShape->panPartStart[iPart] );
+		}
+		partStart.push_back ( psShape->nVertices ); // point to the end
+
+		iPart = 0;
+
+		int j = 0;
+
+		while ( j < psShape->nVertices )
+		{
+			iPart++;  // indicates the different rings of the shapepoly
+			TeLine2D line;
+
+			// Read each ring
+			while ( j < partStart[iPart] )
+			{
+				TeCoord2D pt ( psShape->padfX[j], psShape->padfY[j] );
+				line.add ( pt );
+				j++;
+			}
+			// end of a ring
+
+			if (!line.isRing())
+			{
+				line.add(line[0]);
+//				throw TeException ( POLYSHAPE_IS_NOT_RING );
+			}
+
+			TeLinearRing ring ( line );
+
+			// Is it an OUTER or an INNER RING ?
+
+			bool inside = false;
+
+			list<TePolygon>::iterator it = pList.begin();
+
+
+			// Each ring is assigned to a polygon
+			// Each ring and polygon have a unique "geometrical index"
+			//
+			// All rings and polygons that are part of a same object
+			// have the same "object index"
+
+			while ( it != pList.end() )
+			{
+				TePolygon aux;
+				aux.add(ring);
+				if ( TeWithin ( aux, (*it)))
+				{
+					inside = true;
+					ring.objectId ( (*it)[0].objectId() ); // sets the object index
+					(*it).add ( ring );// add a closed region
+					break;
+				}
+				++it;
+			}
+			if ( ! inside )
+			{
+				TePolygon poly;
+				ring.objectId (indexVect[i]);
+				
+				// add a pair (objectId, geometryId) to the layer
+				poly.add ( ring ); // add an outer region
+				poly.objectId ( indexVect[i] ); // set the object index
+
+				pList.push_back ( poly );
+			}
+		} // read all vertices
+
+		list<TePolygon>::iterator it = pList.begin();
+
+		while ( it != pList.end() )
+		{
+			polys.add(*it);
+			++it;
+		}
+		if ( polys.size() >= chunckSize )
+		{
+			layer->addPolygons( polys ); 
+			polys.clear();
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+						break;
+				else
+					TeProgress::instance()->setProgress(i+1);
+			}
+		}
+		SHPDestroyObject( psShape );
+	} // read all entities
+
+	// save the remaining polygons
+	layer->addPolygons( polys ); 
+	polys.clear();
+	if(TeProgress::instance())
+		TeProgress::instance()->setProgress(i+1);
+}
+
diff --git a/src/terralib/drivers/shapelib/TeQuerierSHP.cpp b/src/terralib/drivers/shapelib/TeQuerierSHP.cpp
old mode 100755
new mode 100644
index 0fd8576..6ed5352
--- a/src/terralib/drivers/shapelib/TeQuerierSHP.cpp
+++ b/src/terralib/drivers/shapelib/TeQuerierSHP.cpp
@@ -1,105 +1,105 @@
-
-#include "TeQuerierSHP.h"
-#include "TeSTEFunctionsSHP.h"
-#include "TeSTInstance.h"
-
-bool 
-TeQuerierSHP::loadInstances(TeTSEntry* ) 
-{ 
-	// Read some information about the shapefile
-	string filePrefix = TeGetName(params_->fileName().c_str());
-	string shpfileName = filePrefix + ".shp";
-
-	hSHP = SHPOpen( shpfileName.c_str(), "rb" );
-	
-	if( hSHP == 0 )
-		return false;
-
-	double 	adfMinBound[4], adfMaxBound[4];
-	SHPGetInfo(hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound);
-	
-	TeBox b(adfMinBound[0], adfMinBound[1], adfMaxBound[0], adfMaxBound[1]);
-	params_->box(b);
-
-	string dbffileName = filePrefix + ".dbf";
-    hDBF = DBFOpen( dbffileName.c_str(), "rb" );
-    if( hDBF == 0  || DBFGetFieldCount(hDBF) == 0)
-		return false;
-    
-	//load attribute list
-	TeReadDBFAttributeList(shpfileName, (*attrList_));
-
-	TeAttributeRep repobjid;
-	repobjid.name_ = "object_id";
-	repobjid.numChar_ = 16;
-
-	TeAttribute attobjid;
-	attobjid.rep_ = repobjid;
-
-	//insert objectId attribute in attribute list
-	attrList_->push_back(attobjid); 
-    curEntity = 0;
-	return true;
-}
-		
-bool 
-TeQuerierSHP::fetchInstance(TeSTInstance& stoi ) 
-{
-	if(curEntity>(nEntities-1))
-		return false;
-
-	//clear stoi
-	stoi.clear();
-
-	TeAttributeRep repobjid;
-	repobjid.name_ = "object_id";
-	repobjid.numChar_ = 16;
-	TeAttribute attobjid;
-	attobjid.rep_ = repobjid;
-	
-	TeProperty propobjid;
-	propobjid.attr_ = attobjid;
-	
-	SHPObject* psShape;
-	
-	string objectid = Te2String(curEntity);
-	stoi.objectId(objectid);
-	propobjid.value_ = objectid;
-		
-	TePropertyVector prop;
-	psShape = SHPReadObject(hSHP,curEntity);
-		
-	if (TeDecodeShape(psShape,stoi.geometries(),objectid))
-	{
-		int numCols = attrList_->size()-1; //the last column is the object id
-		for(int n=0;n<numCols;n++)
-		{
-			string value = DBFReadStringAttribute(hDBF,curEntity,n);
-			TeProperty p;
-			p.attr_ = (*attrList_)[n];
-			p.value_ = value;
-			prop.push_back(p);
-		}
-		prop.push_back(propobjid); // add the object id
-		stoi.properties(prop);
-		stoi.theme(0);
-	}
-	SHPDestroyObject(psShape);
-	++curEntity;
-	return true; 
-} 
-
-bool 
-TeQuerierSHP::loadGeometries(TeMultiGeometry&, unsigned int&) 
-{ 
-	return false; 
-}
-
-bool 
-TeQuerierSHP::loadGeometries(TeMultiGeometry&) 
-{ 
-	return false; 
-}
-
-
-
+
+#include "TeQuerierSHP.h"
+#include "TeSTEFunctionsSHP.h"
+#include "TeSTInstance.h"
+
+bool 
+TeQuerierSHP::loadInstances(TeTSEntry* ) 
+{ 
+	// Read some information about the shapefile
+	string filePrefix = TeGetName(params_->fileName().c_str());
+	string shpfileName = filePrefix + ".shp";
+
+	hSHP = SHPOpen( shpfileName.c_str(), "rb" );
+	
+	if( hSHP == 0 )
+		return false;
+
+	double 	adfMinBound[4], adfMaxBound[4];
+	SHPGetInfo(hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound);
+	
+	TeBox b(adfMinBound[0], adfMinBound[1], adfMaxBound[0], adfMaxBound[1]);
+	params_->box(b);
+
+	string dbffileName = filePrefix + ".dbf";
+    hDBF = DBFOpen( dbffileName.c_str(), "rb" );
+    if( hDBF == 0  || DBFGetFieldCount(hDBF) == 0)
+		return false;
+    
+	//load attribute list
+	TeReadDBFAttributeList(shpfileName, (*attrList_));
+
+	TeAttributeRep repobjid;
+	repobjid.name_ = "object_id";
+	repobjid.numChar_ = 16;
+
+	TeAttribute attobjid;
+	attobjid.rep_ = repobjid;
+
+	//insert objectId attribute in attribute list
+	attrList_->push_back(attobjid); 
+    curEntity = 0;
+	return true;
+}
+		
+bool 
+TeQuerierSHP::fetchInstance(TeSTInstance& stoi ) 
+{
+	if(curEntity>(nEntities-1))
+		return false;
+
+	//clear stoi
+	stoi.clear();
+
+	TeAttributeRep repobjid;
+	repobjid.name_ = "object_id";
+	repobjid.numChar_ = 16;
+	TeAttribute attobjid;
+	attobjid.rep_ = repobjid;
+	
+	TeProperty propobjid;
+	propobjid.attr_ = attobjid;
+	
+	SHPObject* psShape;
+	
+	string objectid = Te2String(curEntity);
+	stoi.objectId(objectid);
+	propobjid.value_ = objectid;
+		
+	TePropertyVector prop;
+	psShape = SHPReadObject(hSHP,curEntity);
+		
+	if (TeDecodeShape(psShape,stoi.geometries(),objectid))
+	{
+		int numCols = attrList_->size()-1; //the last column is the object id
+		for(int n=0;n<numCols;n++)
+		{
+			string value = DBFReadStringAttribute(hDBF,curEntity,n);
+			TeProperty p;
+			p.attr_ = (*attrList_)[n];
+			p.value_ = value;
+			prop.push_back(p);
+		}
+		prop.push_back(propobjid); // add the object id
+		stoi.properties(prop);
+		stoi.theme(0);
+	}
+	SHPDestroyObject(psShape);
+	++curEntity;
+	return true; 
+} 
+
+bool 
+TeQuerierSHP::loadGeometries(TeMultiGeometry&, unsigned int&) 
+{ 
+	return false; 
+}
+
+bool 
+TeQuerierSHP::loadGeometries(TeMultiGeometry&) 
+{ 
+	return false; 
+}
+
+
+
diff --git a/src/terralib/drivers/shapelib/TeQuerierSHP.h b/src/terralib/drivers/shapelib/TeQuerierSHP.h
old mode 100755
new mode 100644
index d75cc69..d21abda
--- a/src/terralib/drivers/shapelib/TeQuerierSHP.h
+++ b/src/terralib/drivers/shapelib/TeQuerierSHP.h
@@ -1,118 +1,118 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeQuerierSHP.h
-	\brief This file contains a mechanism named "TeQuerierSHP" that is 
-	responsible for loading geometries and its attributes from a shapefile. 
-*/
-
-#ifndef  __TERRALIB_INTERNAL_QUERIER_SHP_H
-#define  __TERRALIB_INTERNAL_QUERIER_SHP_H
-
-#include "TeQuerierImpl.h"
-#include <shapefil.h>
-
-/*! \class TeQuerierSHP
-	\brief A class responsible for loading geometries and its attributes from a shape file.
-
-	This class implements a mechanism that is responsible for loading
-	geometries and its attributes from a shape file (.shp file). 
-	Each entity (geometries and attributes) of the shape file is 
-	represented through the TeSTInstance class.  
-
-	\sa
-	TeQuerierImpl TeQuerierParams TeSTInstance 
-*/
-class TeQuerierSHP : public TeQuerierImpl
-{
-	
-protected:
-
-	SHPHandle	hSHP;			//!< handle to the file that stores geometries (.shp) of the shapefile format 
-	DBFHandle	hDBF;			//!< handle to the file that stores attributes (.dbf) of the shapefile format 
-	int			nEntities;		//!< number of entities in the shape file
-	int			curEntity;		//!< current entity index used to traverse all entities of the shape file
-	int			nShapeType;		//!< geometry type of the shape file  
-	
-public:
-
-		//! Constructor from a set of parameters
-		TeQuerierSHP(TeQuerierParams* params): 
-			TeQuerierImpl(params),
-			nEntities(0),
-			curEntity(0),
-			nShapeType()
-		{ }
-
-		
-		//! Returns the file name 
-		string fileName () { return params_->fileName(); }
-
-		//! Load information about the geometries and attributes of the shape file 
-		bool loadInstances(TeTSEntry* ent = 0); 
-		
-		//! Gets the current entity and moves to the next one. Returns if there is a next entity. 
-		bool fetchInstance(TeSTInstance& stoi); 
-
-		//! Loads all geometries of the index-th geometry representation 
-		bool loadGeometries(TeMultiGeometry& geometries, unsigned int& index); 
-		
-		//! Loads all geometries 
-		bool loadGeometries(TeMultiGeometry& geometries); 
-};
-
-
-/*! \class TeQuerierSHPFactory
-	\brief A class that define a factory to build a querier strategy from shape file.
-
-	\sa
-	TeQuerierImplFactory TeQuerierSHP
-*/
-class TeQuerierSHPFactory : public TeQuerierImplFactory
-{
-public:
-
-	//! Constructor
-	TeQuerierSHPFactory(const string& name) : TeQuerierImplFactory(name) {}
-
-	//! Builds a shapefile querier
-	virtual TeQuerierImpl* build (const TeQuerierParams& arg)
-	{  
-		TeQuerierParams* tempArg = new TeQuerierParams();
-		*tempArg = arg;
-		return new TeQuerierSHP(tempArg); 
-	}
-};
- 
-/** \example createSTElementSetFromShapeFile.cpp
-	Shows how to create a new Spatial Temporal Element Set (STElementSet) from a shapefile
-*/
-
-namespace 
-{
-  static TeQuerierSHPFactory querierSHP("querierSHP");
-};
-
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeQuerierSHP.h
+	\brief This file contains a mechanism named "TeQuerierSHP" that is 
+	responsible for loading geometries and its attributes from a shapefile. 
+*/
+
+#ifndef  __TERRALIB_INTERNAL_QUERIER_SHP_H
+#define  __TERRALIB_INTERNAL_QUERIER_SHP_H
+
+#include "TeQuerierImpl.h"
+#include <shapefil.h>
+
+/*! \class TeQuerierSHP
+	\brief A class responsible for loading geometries and its attributes from a shape file.
+
+	This class implements a mechanism that is responsible for loading
+	geometries and its attributes from a shape file (.shp file). 
+	Each entity (geometries and attributes) of the shape file is 
+	represented through the TeSTInstance class.  
+
+	\sa
+	TeQuerierImpl TeQuerierParams TeSTInstance 
+*/
+class TeQuerierSHP : public TeQuerierImpl
+{
+	
+protected:
+
+	SHPHandle	hSHP;			//!< handle to the file that stores geometries (.shp) of the shapefile format 
+	DBFHandle	hDBF;			//!< handle to the file that stores attributes (.dbf) of the shapefile format 
+	int			nEntities;		//!< number of entities in the shape file
+	int			curEntity;		//!< current entity index used to traverse all entities of the shape file
+	int			nShapeType;		//!< geometry type of the shape file  
+	
+public:
+
+		//! Constructor from a set of parameters
+		TeQuerierSHP(TeQuerierParams* params): 
+			TeQuerierImpl(params),
+			nEntities(0),
+			curEntity(0),
+			nShapeType()
+		{ }
+
+		
+		//! Returns the file name 
+		string fileName () { return params_->fileName(); }
+
+		//! Load information about the geometries and attributes of the shape file 
+		bool loadInstances(TeTSEntry* ent = 0); 
+		
+		//! Gets the current entity and moves to the next one. Returns if there is a next entity. 
+		bool fetchInstance(TeSTInstance& stoi); 
+
+		//! Loads all geometries of the index-th geometry representation 
+		bool loadGeometries(TeMultiGeometry& geometries, unsigned int& index); 
+		
+		//! Loads all geometries 
+		bool loadGeometries(TeMultiGeometry& geometries); 
+};
+
+
+/*! \class TeQuerierSHPFactory
+	\brief A class that define a factory to build a querier strategy from shape file.
+
+	\sa
+	TeQuerierImplFactory TeQuerierSHP
+*/
+class TeQuerierSHPFactory : public TeQuerierImplFactory
+{
+public:
+
+	//! Constructor
+	TeQuerierSHPFactory(const string& name) : TeQuerierImplFactory(name) {}
+
+	//! Builds a shapefile querier
+	virtual TeQuerierImpl* build (const TeQuerierParams& arg)
+	{  
+		TeQuerierParams* tempArg = new TeQuerierParams();
+		*tempArg = arg;
+		return new TeQuerierSHP(tempArg); 
+	}
+};
+ 
+/** \example createSTElementSetFromShapeFile.cpp
+	Shows how to create a new Spatial Temporal Element Set (STElementSet) from a shapefile
+*/
+
+namespace 
+{
+  static TeQuerierSHPFactory querierSHP("querierSHP");
+};
+
+
+#endif
+
+
diff --git a/src/terralib/drivers/shapelib/TeSHPDefines.h b/src/terralib/drivers/shapelib/TeSHPDefines.h
new file mode 100644
index 0000000..4eb23de
--- /dev/null
+++ b/src/terralib/drivers/shapelib/TeSHPDefines.h
@@ -0,0 +1,56 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDefines.h
+    \brief Provides a set of general definitions used by Terralib
+*/
+#ifndef  __TESHP_INTERNAL_DEFINES_H
+#define  __TESHP_INTERNAL_DEFINES_H
+
+#include <string> 
+
+/** @defgroup Defines Defines and constants
+  @{
+ */
+
+/** @defgroup TLSHP_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLSHP_AS_DLL
+#define SHP_DLL __declspec(dllexport)
+#else
+#define SHP_DLL __declspec(dllimport)
+#endif
+
+#else
+#define SHP_DLL
+#endif
+/** @} */ 
+
+#endif
+
diff --git a/src/terralib/drivers/shapelib/TeSHPDriverFactory.cpp b/src/terralib/drivers/shapelib/TeSHPDriverFactory.cpp
new file mode 100644
index 0000000..6454bd2
--- /dev/null
+++ b/src/terralib/drivers/shapelib/TeSHPDriverFactory.cpp
@@ -0,0 +1,36 @@
+#include "TeSHPDriverFactory.h"
+#include "TeGeoDataDriver.h"
+#include "TeDriverSHPDBF.h"
+
+TeSHPDriverFactory::TeSHPDriverFactory() :
+TeGDriverFactory("SHP")
+{
+  // Bouml preserved body begin 0005C282
+  // Bouml preserved body end 0005C282
+}
+
+TeSHPDriverFactory::~TeSHPDriverFactory() 
+{
+  // Bouml preserved body begin 0005C302
+  // Bouml preserved body end 0005C302
+}
+
+TeGeoDataDriver * TeSHPDriverFactory::build(TeGDriverParams * params) 
+{
+  // Bouml preserved body begin 0005C202
+	TeShapefileDriver* driver = NULL;
+
+	if(params != NULL && !params->fileName_.empty())
+		driver = new TeShapefileDriver(params->fileName_);
+
+	return driver;
+  // Bouml preserved body end 0005C202
+}
+
+TeGeoDataDriver * TeSHPDriverFactory::build() 
+{
+  // Bouml preserved body begin 0005C382
+	return NULL;
+  // Bouml preserved body end 0005C382
+}
+
diff --git a/src/terralib/drivers/shapelib/TeSHPDriverFactory.h b/src/terralib/drivers/shapelib/TeSHPDriverFactory.h
new file mode 100644
index 0000000..2e13d96
--- /dev/null
+++ b/src/terralib/drivers/shapelib/TeSHPDriverFactory.h
@@ -0,0 +1,27 @@
+
+#ifndef _TESHPDRIVERFACTORY_H
+#define _TESHPDRIVERFACTORY_H
+
+#include "TeGDriverFactory.h"
+
+#include "TeSHPDefines.h"
+
+class TeGeoDataDriver;
+struct TeGDriverParams;
+class TeShapefileDriver;
+
+class SHP_DLL TeSHPDriverFactory : public TeGDriverFactory 
+{
+  public:
+    TeSHPDriverFactory();
+
+    ~TeSHPDriverFactory();
+
+
+  protected:
+    //!  Builds a new product from a set of parameters (should be implemented by descendants)
+    TeGeoDataDriver * build(TeGDriverParams * params);
+    //!  Builds a new product without parameters (should be implemented by descendants)
+    TeGeoDataDriver * build();
+};
+#endif
diff --git a/src/terralib/drivers/shapelib/TeSTEFunctionsSHP.cpp b/src/terralib/drivers/shapelib/TeSTEFunctionsSHP.cpp
old mode 100755
new mode 100644
index 4ea17e1..91ca3c6
--- a/src/terralib/drivers/shapelib/TeSTEFunctionsSHP.cpp
+++ b/src/terralib/drivers/shapelib/TeSTEFunctionsSHP.cpp
@@ -1,126 +1,126 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include "TeSTEFunctionsSHP.h"
-#include "TeSTElementSet.h"
-#include <vector>
-
-bool TeDecodeShape(SHPObject* psShape, TeMultiGeometry& geomestries, string& objectId)
-{
-	int shpType = psShape->nSHPType;
-	switch (shpType)
-	{
-		case SHPT_POLYGON:
-		case SHPT_POLYGONZ:
-			TeSHPPolygonDecode(psShape,geomestries.polygons_,objectId);
-			return true;
-		case SHPT_ARC:
-		case SHPT_ARCZ:
-			TeSHPPolyLineDecode(psShape,geomestries.lines_,objectId);
-			return true;
-		case SHPT_POINT:
-		case SHPT_POINTZ:
-		case SHPT_MULTIPOINT:
-		case SHPT_MULTIPOINTZ:
-			TeSHPPointDecode(psShape,geomestries.points_,objectId);
-			return true;
-	}
-	return false;
-}
-
-bool
-TeSTOSetBuildSHP(TeSTElementSet& stoset, const string& fileName)
-{
-	// Read some information about the shapefile
-	string filePrefix = TeGetName(fileName.c_str());
-	string shpfileName = filePrefix + ".shp";
-
-	SHPHandle	hSHP;
-	hSHP = SHPOpen( shpfileName.c_str(), "rb" );
-
-	if( hSHP == 0 )
-		return false;
-
-	int		nShapeType, nEntities;
-	double 	adfMinBound[4], adfMaxBound[4];
-
-	SHPGetInfo(hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound);
-
-	string dbffileName = filePrefix + ".dbf";
-  DBFHandle hDBF = DBFOpen( dbffileName.c_str(), "rb" );
-  if( hDBF == 0  || DBFGetFieldCount(hDBF) == 0) {
-    SHPClose( hSHP );
-  
-		return false;
-	}
-    
-	int natt = DBFGetFieldCount(hDBF);
-	TeAttributeList attList;
-	TeReadDBFAttributeList(shpfileName, attList);
-
-	TeAttributeRep repobjid;
-	repobjid.name_ = "object_id";
-	repobjid.numChar_ = 16;
-
-	TeAttribute attobjid;
-	attobjid.rep_ = repobjid;
-
-	TeProperty propobjid;
-	propobjid.attr_ = attobjid;
-	
-	TeAttributeList attrs; 
-	attrs.push_back (attobjid);
-	for(unsigned int j=0; j<attList.size(); ++j)
-	  attrs.push_back(attList[j]);
-	 
-	stoset.setAttributeList(attrs); 	
-	
-	int i,n;
-	SHPObject* psShape;
-	for (i=0; i<nEntities; i++)
-	{
-		string objectid = Te2String(i);
-		TeSTInstance curObj;
-		curObj.objectId(objectid);
-
-		vector<string> prop; //values of the attributes
-		psShape = SHPReadObject(hSHP,i);
-		if (TeDecodeShape(psShape,curObj.geometries(),objectid))
-		{
-			prop.push_back(objectid);
-			for(n=0;n<natt;n++)
-			{
-				string value = DBFReadStringAttribute(hDBF,i,n);
-				prop.push_back(value);
-			}
-			curObj.setProperties(prop);
-			stoset.insertSTInstance(curObj);
-			curObj.theme(0);
-		}
-		SHPDestroyObject(psShape);
-	}
-	
-	DBFClose( hDBF );
-	SHPClose( hSHP );
-	
-	return true;
-} 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include "TeSTEFunctionsSHP.h"
+#include "TeSTElementSet.h"
+#include <vector>
+
+bool TeDecodeShape(SHPObject* psShape, TeMultiGeometry& geomestries, string& objectId)
+{
+	int shpType = psShape->nSHPType;
+	switch (shpType)
+	{
+		case SHPT_POLYGON:
+		case SHPT_POLYGONZ:
+			TeSHPPolygonDecode(psShape,geomestries.polygons_,objectId);
+			return true;
+		case SHPT_ARC:
+		case SHPT_ARCZ:
+			TeSHPPolyLineDecode(psShape,geomestries.lines_,objectId);
+			return true;
+		case SHPT_POINT:
+		case SHPT_POINTZ:
+		case SHPT_MULTIPOINT:
+		case SHPT_MULTIPOINTZ:
+			TeSHPPointDecode(psShape,geomestries.points_,objectId);
+			return true;
+	}
+	return false;
+}
+
+bool
+TeSTOSetBuildSHP(TeSTElementSet& stoset, const string& fileName)
+{
+	// Read some information about the shapefile
+	string filePrefix = TeGetName(fileName.c_str());
+	string shpfileName = filePrefix + ".shp";
+
+	SHPHandle	hSHP;
+	hSHP = SHPOpen( shpfileName.c_str(), "rb" );
+
+	if( hSHP == 0 )
+		return false;
+
+	int		nShapeType, nEntities;
+	double 	adfMinBound[4], adfMaxBound[4];
+
+	SHPGetInfo(hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound);
+
+	string dbffileName = filePrefix + ".dbf";
+  DBFHandle hDBF = DBFOpen( dbffileName.c_str(), "rb" );
+  if( hDBF == 0  || DBFGetFieldCount(hDBF) == 0) {
+    SHPClose( hSHP );
+  
+		return false;
+	}
+    
+	int natt = DBFGetFieldCount(hDBF);
+	TeAttributeList attList;
+	TeReadDBFAttributeList(shpfileName, attList);
+
+	TeAttributeRep repobjid;
+	repobjid.name_ = "object_id";
+	repobjid.numChar_ = 16;
+
+	TeAttribute attobjid;
+	attobjid.rep_ = repobjid;
+
+	TeProperty propobjid;
+	propobjid.attr_ = attobjid;
+	
+	TeAttributeList attrs; 
+	attrs.push_back (attobjid);
+	for(unsigned int j=0; j<attList.size(); ++j)
+	  attrs.push_back(attList[j]);
+	 
+	stoset.setAttributeList(attrs); 	
+	
+	int i,n;
+	SHPObject* psShape;
+	for (i=0; i<nEntities; i++)
+	{
+		string objectid = Te2String(i);
+		TeSTInstance curObj;
+		curObj.objectId(objectid);
+
+		vector<string> prop; //values of the attributes
+		psShape = SHPReadObject(hSHP,i);
+		if (TeDecodeShape(psShape,curObj.geometries(),objectid))
+		{
+			prop.push_back(objectid);
+			for(n=0;n<natt;n++)
+			{
+				string value = DBFReadStringAttribute(hDBF,i,n);
+				prop.push_back(value);
+			}
+			curObj.setProperties(prop);
+			stoset.insertSTInstance(curObj);
+			curObj.theme(0);
+		}
+		SHPDestroyObject(psShape);
+	}
+	
+	DBFClose( hDBF );
+	SHPClose( hSHP );
+	
+	return true;
+} 
diff --git a/src/terralib/drivers/shapelib/TeSTEFunctionsSHP.h b/src/terralib/drivers/shapelib/TeSTEFunctionsSHP.h
old mode 100755
new mode 100644
index b9ffaf8..83d108d
--- a/src/terralib/drivers/shapelib/TeSTEFunctionsSHP.h
+++ b/src/terralib/drivers/shapelib/TeSTEFunctionsSHP.h
@@ -1,88 +1,88 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSTEFunctionsSHP.h
-    This file is a wrapper aroun shapelib to provide funcions to decodify shapefiles
-*/
-#ifndef  __TERRALIB_INTERNAL_TeSTEFUNCTIONSSHP_H
-#define  __TERRALIB_INTERNAL_TeSTEFUNCTIONSSHP_H
-
-#include <string>
-#include <TeAttribute.h>
-#include <shapefil.h>
-
-class TeSTElementSet; 
-class TeLineSet; 
-class TePolygonSet; 
-class TePointSet; 
-class TeMultiGeometry; 
-
-using namespace std;
-
-//! Builds the spatial object set from database according to the restrictions previously defined
-/*! 
-	\param stoset the STOSet that will be filled 
-	\param fileName shape file name
-*/
-bool TeSTOSetBuildSHP(TeSTElementSet& stoset, const string& fileName);
-
-
-//! Decodify a ShapeObject into a TerraLib point set
-/*! 
-	\param psShape pointer to a shapelib shape object 
-	\param ps TerraLib point set to receive the geometries
-	\param objectId TerraLib identifier to this object
-*/
-void TeSHPPointDecode	(SHPObject* psShape, TePointSet& ps, string& objectId);
-
-//! Decodify a ShapeObject into a TerraLib line set
-/*! 
-	\param psShape pointer to a shapelib shape object 
-	\param ps TerraLib line set to receive the geometries
-	\param objectId TerraLib identifier to this object
-*/
-void TeSHPPolyLineDecode(SHPObject* psShape, TeLineSet& ls, string& objectId);
-
-//! Decodify a ShapeObject into a TerraLib polygon set
-/*! 
-	\param psShape pointer to a shapelib shape object 
-	\param ps TerraLib polygon set to receive the geometries
-	\param objectId TerraLib identifier to this object
-*/
-void TeSHPPolygonDecode	(SHPObject* psShape, TePolygonSet& pols, string& objectId);
-
-//! Decodify a ShapeObject into a TerraLib multigeometry set
-/*! 
-	\param psShape pointer to a shapelib shape object 
-	\param geomestries TerraLib multi geometry set to receive the geometries
-	\param objectId TerraLib identifier to this object
-*/
-bool TeDecodeShape(SHPObject* psShape, TeMultiGeometry& geomestries, string& objectId);
-
-//! Decodify the attribute list definition from a dbf file into a TerraLib attribute list
-/*! 
-	\param dbfFilename name of the DBF file 
-	\param attList to return the list of attributes
-*/
-bool TeReadDBFAttributeList(const string& dbfFileName, TeAttributeList& attList);
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSTEFunctionsSHP.h
+    This file is a wrapper aroun shapelib to provide funcions to decodify shapefiles
+*/
+#ifndef  __TERRALIB_INTERNAL_TeSTEFUNCTIONSSHP_H
+#define  __TERRALIB_INTERNAL_TeSTEFUNCTIONSSHP_H
+
+#include <string>
+#include <TeAttribute.h>
+#include <shapefil.h>
+
+class TeSTElementSet; 
+class TeLineSet; 
+class TePolygonSet; 
+class TePointSet; 
+class TeMultiGeometry; 
+
+using namespace std;
+
+//! Builds the spatial object set from database according to the restrictions previously defined
+/*! 
+	\param stoset the STOSet that will be filled 
+	\param fileName shape file name
+*/
+bool TeSTOSetBuildSHP(TeSTElementSet& stoset, const string& fileName);
+
+
+//! Decodify a ShapeObject into a TerraLib point set
+/*! 
+	\param psShape pointer to a shapelib shape object 
+	\param ps TerraLib point set to receive the geometries
+	\param objectId TerraLib identifier to this object
+*/
+void TeSHPPointDecode	(SHPObject* psShape, TePointSet& ps, string& objectId);
+
+//! Decodify a ShapeObject into a TerraLib line set
+/*! 
+	\param psShape pointer to a shapelib shape object 
+	\param ps TerraLib line set to receive the geometries
+	\param objectId TerraLib identifier to this object
+*/
+void TeSHPPolyLineDecode(SHPObject* psShape, TeLineSet& ls, string& objectId);
+
+//! Decodify a ShapeObject into a TerraLib polygon set
+/*! 
+	\param psShape pointer to a shapelib shape object 
+	\param ps TerraLib polygon set to receive the geometries
+	\param objectId TerraLib identifier to this object
+*/
+void TeSHPPolygonDecode	(SHPObject* psShape, TePolygonSet& pols, string& objectId);
+
+//! Decodify a ShapeObject into a TerraLib multigeometry set
+/*! 
+	\param psShape pointer to a shapelib shape object 
+	\param geomestries TerraLib multi geometry set to receive the geometries
+	\param objectId TerraLib identifier to this object
+*/
+bool TeDecodeShape(SHPObject* psShape, TeMultiGeometry& geomestries, string& objectId);
+
+//! Decodify the attribute list definition from a dbf file into a TerraLib attribute list
+/*! 
+	\param dbfFilename name of the DBF file 
+	\param attList to return the list of attributes
+*/
+bool TeReadDBFAttributeList(const string& dbfFileName, TeAttributeList& attList);
+#endif
+
diff --git a/src/terralib/drivers/spl/PluginInfo.h b/src/terralib/drivers/spl/PluginInfo.h
new file mode 100644
index 0000000..fc9d511
--- /dev/null
+++ b/src/terralib/drivers/spl/PluginInfo.h
@@ -0,0 +1,119 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef PLUGININFO_H
+  #define PLUGININFO_H
+  
+  #include <string>
+
+  #include "TeSPLDefines.h"
+  
+  /**
+   * @brief A class to deal with plugin information.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   */
+  class TLSPL_DLL PluginInfo
+  {
+    public :
+    
+      /**
+       * Plugin name.
+       */
+      std::string plugin_name_;
+      
+      /**
+       * Plugin type (UUID).
+       */
+      std::string plugin_type_;
+      
+      /**
+       * Plugin interface version.
+       */
+      std::string plugin_interface_version_;
+      
+      /**
+       * Plugin build number.
+       */
+      std::string plugin_build_number_;      
+
+      /**
+       * Plugin major version.
+       */
+      std::string plugin_major_version_;      
+      
+      /**
+       * Plugin minor version.
+       */
+      std::string plugin_minor_version_;           
+      
+      /**
+       * Plugin general description.
+       */
+      std::string plugin_description_;           
+
+      /**
+       * Plugin vendor.
+       */
+      std::string plugin_vendor_;      
+      
+      /**
+       * Plugin vendor e-mail.
+       */
+      std::string plugin_vendor_email_;              
+
+      /**
+       * Plugin URL.
+       */
+      std::string plugin_url_;           
+
+      /**
+       * Default Constructor.
+       */
+      PluginInfo() {};
+      
+      /**
+       * @brief operator== overload.
+       * @param external External reference.
+       * @return true if equal.
+       */
+      bool operator==( const PluginInfo& external ) const
+      {
+        if( 
+            ( plugin_name_ == external.plugin_name_ ) &&
+            ( plugin_type_ == external.plugin_type_ ) &&
+            ( plugin_interface_version_ == 
+              external.plugin_interface_version_ ) &&
+            ( plugin_build_number_ == external.plugin_build_number_ ) &&
+            ( plugin_major_version_ == external.plugin_major_version_ ) &&
+            ( plugin_minor_version_ == external.plugin_minor_version_ ) &&
+            ( plugin_description_ == external.plugin_description_ ) &&
+            ( plugin_vendor_ == external.plugin_vendor_ ) &&
+            ( plugin_vendor_email_ == external.plugin_vendor_email_ ) &&
+            ( plugin_url_ == external.plugin_url_ ) ) {
+          
+          return true;          
+        } else {
+          return false;        
+        }
+      };
+  };
+
+#endif
diff --git a/src/terralib/drivers/spl/PluginMetadata.cpp b/src/terralib/drivers/spl/PluginMetadata.cpp
new file mode 100644
index 0000000..b227ae5
--- /dev/null
+++ b/src/terralib/drivers/spl/PluginMetadata.cpp
@@ -0,0 +1,9 @@
+#include <PluginMetadata.h>
+
+PluginMetadata::PluginMetadata()
+{
+}
+
+PluginMetadata::~PluginMetadata()
+{
+}
\ No newline at end of file
diff --git a/src/terralib/drivers/spl/PluginMetadata.h b/src/terralib/drivers/spl/PluginMetadata.h
new file mode 100644
index 0000000..10b0d5c
--- /dev/null
+++ b/src/terralib/drivers/spl/PluginMetadata.h
@@ -0,0 +1,66 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+/** \file PluginsSignal.h
+  * \brief This file contains a base class in order to send signals in TerraView.
+  * \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+  * \author Emiliano Castejon <castejon at dpi.inpe.br>
+  */
+
+#ifndef  __TERRALIB_INTERNAL_PLUGINMETADATA_H
+#define  __TERRALIB_INTERNAL_PLUGINMETADATA_H
+
+#include <vector>
+#include <string>
+
+#include <TeSPLDefines.h>
+
+/** \class PluginsSignal
+  * \brief An instance of this class represents
+  *        a signal, that can be emitted by someone
+  *        using PluginsEmitter singleton.
+  *        When sending a signal, whe can
+  *        add some data with the signal.
+  *        See addData and getData methods.
+  *
+  * \sa PluginsEmitter
+  * \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+  * \author Emiliano Castejon <castejon at dpi.inpe.br>
+  */
+class TLSPL_DLL PluginMetadata
+{
+public:
+	
+	std::vector<std::string> _vecPluginNames;
+	std::vector<std::string> _vecTranslatedNames;
+	std::vector<std::string> _vecHintTexts;
+
+public:
+
+	/** \brief Constructor.
+		* \param signalType Signal type. (Input)
+		*/
+	PluginMetadata();
+
+	virtual ~PluginMetadata();
+};
+
+#endif	// __TERRALIB_INTERNAL_PLUGINSSIGNAL_H
+
diff --git a/src/terralib/drivers/spl/PluginParameters.cpp b/src/terralib/drivers/spl/PluginParameters.cpp
new file mode 100644
index 0000000..5dcb633
--- /dev/null
+++ b/src/terralib/drivers/spl/PluginParameters.cpp
@@ -0,0 +1,225 @@
+#include "PluginParameters.h"
+
+PluginParameters::PluginParameters()
+{
+  init();
+}
+
+
+PluginParameters::PluginParameters(
+  QMainWindow* qtmain_widget_ptr,
+  TeProgressBase* teprogressbase_ptr,
+  TeQtDatabasesListView* teqtdatabaseslistview_ptr,
+  TeQtViewsListView* teqtviewslistview_ptr,
+  TeQtGrid* teqtgrid_ptr,
+  TeQtCanvas* teqtcanvas_ptr,
+  TeDatabase* current_database_ptr,
+  TeLayer* current_layer_ptr,
+  TeView* current_view_ptr,
+  TeAppTheme* current_theme_ptr,
+  TeCommunicator<PluginsSignal>* signal_emitter,
+  bool use_collection,
+  std::string currentPluginName,
+  std::string currentUser,
+  getCurrentDatabasePtrFPT getCurrentDatabasePtrFP,
+  getCurrentLayerPtrFPT getCurrentLayerPtrFP,
+  getCurrentViewPtrFPT getCurrentViewPtrFP,
+  getCurrentThemeAppPtrFPT getCurrentThemeAppPtrFP,
+  setCurrentThemeAppPtrFPT setCurrentThemeAppPtrFP,
+  updateTVInterfaceFPT updateTVInterfaceFP,
+  loadTranslationFileFPT loadTranslationFileFP,
+  updatePluginParametersFPT updatePluginParametersFP,
+  plotTVDataFPT plotTVDataFP,
+  setPluginMetadataFPT setPluginMetadataFP,
+  getCurrentUserPtrFPT getCurrentUserPtrFP
+  )
+{
+  init();
+
+  qtmain_widget_ptr_ = qtmain_widget_ptr;
+  teprogressbase_ptr_ = teprogressbase_ptr;
+  teqtdatabaseslistview_ptr_ = teqtdatabaseslistview_ptr;
+  teqtviewslistview_ptr_ = teqtviewslistview_ptr;
+  teqtgrid_ptr_ = teqtgrid_ptr;
+  teqtcanvas_ptr_ = teqtcanvas_ptr;
+  signal_emitter_ = signal_emitter;
+  use_collection_ = use_collection;
+  currentPluginName_ = currentPluginName;
+  currentUser_ = currentUser;
+  
+	getCurrentDatabasePtrFP_ = getCurrentDatabasePtrFP;
+	getCurrentLayerPtrFP_ = getCurrentLayerPtrFP;
+	getCurrentViewPtrFP_ = getCurrentViewPtrFP;
+	getCurrentThemeAppPtrFP_ = getCurrentThemeAppPtrFP;
+	setCurrentThemeAppPtrFP_ = setCurrentThemeAppPtrFP;
+	updateTVInterfaceFP_ = updateTVInterfaceFP;
+	plotTVDataFP_ = plotTVDataFP;
+	loadTranslationFileFP_ = loadTranslationFileFP;
+	setPluginMetadataFP_ = setPluginMetadataFP;
+	getCurrentUserPtrFP_ = getCurrentUserPtrFP;
+	
+	/* The following variables are DEPRECATED */
+	
+  current_database_ptr_ = current_database_ptr;
+  current_layer_ptr_ = current_layer_ptr;
+  current_view_ptr_ = current_view_ptr;
+  current_theme_ptr_ = current_theme_ptr;
+  updatePluginParametersFP_ = updatePluginParametersFP;  
+}   
+        
+
+PluginParameters::~PluginParameters()
+{
+}
+
+
+void PluginParameters::init()
+{
+  qtmain_widget_ptr_ = 0;
+  teprogressbase_ptr_ = 0;
+  teqtdatabaseslistview_ptr_ = 0;
+  teqtviewslistview_ptr_ = 0;
+  teqtgrid_ptr_ = 0;
+  teqtcanvas_ptr_ = 0;
+  signal_emitter_ = 0;
+  
+	getCurrentDatabasePtrFP_ = 0;
+	getCurrentLayerPtrFP_ = 0;
+	getCurrentViewPtrFP_ = 0;
+	getCurrentThemeAppPtrFP_ = 0;
+	setCurrentThemeAppPtrFP_ = 0;
+	updateTVInterfaceFP_ = 0;
+	plotTVDataFP_ = 0;
+	loadTranslationFileFP_ = 0;
+	setPluginMetadataFP_ = 0;
+	getCurrentUserPtrFP_ = 0;
+
+	use_collection_ = true;
+	currentPluginName_ = "";
+	
+	/* The following variables are DEPRECATED */
+	
+  current_database_ptr_ = 0;
+  current_layer_ptr_ =0;
+  current_view_ptr_ =0;
+  current_theme_ptr_ =0;
+  updatePluginParametersFP_ = 0;	
+}
+
+std::string PluginParameters::getCurrentUserPtr() const
+{
+  if( getCurrentUserPtrFP_ ) {
+    return ( getCurrentUserPtrFP_( *this ) );
+  } else {
+    return "";
+  }
+}
+
+TeDatabase* PluginParameters::getCurrentDatabasePtr() const
+{
+  if( getCurrentDatabasePtrFP_ ) {
+    return ( getCurrentDatabasePtrFP_( *this ) );
+  } else {
+    return 0;
+  }
+}
+
+
+TeLayer* PluginParameters::getCurrentLayerPtr() const
+{
+  if( getCurrentLayerPtrFP_ ) {
+    return ( getCurrentLayerPtrFP_( *this ) );
+  } else {
+    return 0;
+  }
+}
+
+
+TeView* PluginParameters::getCurrentViewPtr() const
+{
+  if( getCurrentViewPtrFP_ ) {
+    return ( getCurrentViewPtrFP_( *this ) );
+  } else {
+    return 0;
+  }
+}
+
+
+TeAppTheme* PluginParameters::getCurrentThemeAppPtr() const
+{
+  if( getCurrentThemeAppPtrFP_ ) {
+    return ( getCurrentThemeAppPtrFP_( *this ) );
+  } else {
+    return 0;
+  }
+}
+
+void PluginParameters::setCurrentThemeAppPtr(TeAppTheme* appTheme)
+{
+  if( setCurrentThemeAppPtrFP_ ) {
+    ( setCurrentThemeAppPtrFP_( appTheme, *this ) );
+  }
+}
+
+
+void PluginParameters::updateTVInterface( const PluginParameters& ) const
+{
+  if( updateTVInterfaceFP_ ) {
+    updateTVInterfaceFP_( *this );
+  }
+}
+
+void PluginParameters::updateTVInterface() const
+{
+  if( updateTVInterfaceFP_ ) {
+    updateTVInterfaceFP_( *this );
+  }
+}
+
+void PluginParameters::plotTVData() const
+{
+  if( plotTVDataFP_ ) {
+    plotTVDataFP_( *this );
+  }
+}
+
+void PluginParameters::setPluginMetadata(const PluginMetadata& pluginMetadata) const
+{
+  if( setPluginMetadataFP_ ) {
+    setPluginMetadataFP_( *this, pluginMetadata );
+  }
+}
+
+bool PluginParameters::loadTranslationFile( const PluginParameters&,
+  const std::string& filename ) const
+{
+  if( loadTranslationFileFP_ ) {
+    return loadTranslationFileFP_( *this, filename );
+  } else {
+    return false;
+  }
+}
+
+
+bool PluginParameters::loadTranslationFile( const std::string& filename ) const
+{
+  if( loadTranslationFileFP_ ) {
+    return loadTranslationFileFP_( *this, filename );
+  } else {
+    return false;
+  }
+}
+
+
+void PluginParameters::updatePluginParameters( PluginParameters& pp ) const
+{
+  if( updatePluginParametersFP_ ) {
+    updatePluginParametersFP_( pp );
+  }
+}
+
+bool PluginParameters::useCollection() const
+{
+	return use_collection_;
+}
+
diff --git a/src/terralib/drivers/spl/PluginParameters.h b/src/terralib/drivers/spl/PluginParameters.h
new file mode 100644
index 0000000..648d8ce
--- /dev/null
+++ b/src/terralib/drivers/spl/PluginParameters.h
@@ -0,0 +1,555 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef PLUGINPARAMETERS_H
+  #define PLUGINPARAMETERS_H
+  
+  #define PLUGINPARAMETERS_VERSION "PLUGINPARAMETERS_VERSION_201010210938" \
+    "_TERRALIB_VERSION_" TERRALIB_VERSION \
+    "_QT_VERSION_" QT_VERSION_STR
+  
+//  #include <TeQtDatabasesListView.h>
+//  #include <TeQtViewsListView.h>
+//  #include <TeQtGrid.h>
+//  #include <TeQtCanvas.h>
+//
+//  #include <TeDatabase.h>
+//  #include <TeLayer.h>
+//  #include <TeView.h>
+//  #include <TeAppTheme.h>
+//  #include <TeProgress.h>
+//  #include <TeDatabaseFactory.h>
+//  #include <TeVersion.h>
+//  #include "PluginsSignal.h"
+//  #include <PluginMetadata.h>
+//
+//  #include <qmainwindow.h>
+#include <TeCommunicator.h>
+#include <TeVersion.h>
+  #include <TeSPLDefines.h>
+
+//Qt include files
+#include <qglobal.h>
+
+//STL include files
+#include <string>
+
+//Forward declarations
+class TeQtDatabasesListView;
+class TeQtViewsListView;
+class TeQtGrid;
+class TeQtCanvas;
+class TeDatabase;
+class TeLayer;
+class TeView;
+class TeAppTheme;
+class TeProgressBase;
+class TeDatabaseFactory;
+class TeVersion;
+class PluginsSignal;
+class PluginMetadata;
+class QMainWindow;
+
+  /**
+   * @brief A class to deal with plugin parameters.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   */  
+  class TLSPL_DLL PluginParameters
+  {
+    public :
+    
+      /* DO NOT MOVE THIS FUNCTION FROM THE CLASS BEGINNING -------------- */
+      
+      /**
+       * @brief A function to get the parameters version.
+       * @note This must be the first declared method  
+       * for the correct pointer alignment when calling methods
+       * from plugin parameters with different versions.
+       */      
+      static std::string getVersion()
+      {
+        return  PLUGINPARAMETERS_VERSION;
+      };
+      
+      /* DO NOT MOVE THIS FUNCTION FROM THE CLASS BEGINNING -------------- */
+      
+      /**
+       * @name Function pointers type definitions.
+       * 
+       * @brief Type definitions for pointers to internal TerraView plugin 
+       * support functions.
+       */      
+      
+		/**
+       * @brief A type definition to a function to get the 
+       * current database pointer.
+       */ 
+	  typedef std::string (*getCurrentUserPtrFPT)( 
+        const PluginParameters& ); 
+
+      /**
+       * @brief A type definition to a function to get the 
+       * current database pointer.
+       */ 
+      typedef TeDatabase* (*getCurrentDatabasePtrFPT)( 
+        const PluginParameters& ); 
+      
+      /**
+       * @brief A type definition to a function to get the 
+       * current layer pointer.
+       */ 
+      typedef TeLayer* (*getCurrentLayerPtrFPT)( 
+        const PluginParameters& );          
+    
+      /**
+       * @brief A type definition to a function to get the 
+       * current view pointer.
+       */ 
+      typedef TeView* (*getCurrentViewPtrFPT)( 
+        const PluginParameters& );     
+        
+      /**
+       * @brief A type definition to a function to get the 
+       * current theme application pointer.
+       */ 
+      typedef TeAppTheme* (*getCurrentThemeAppPtrFPT)( 
+        const PluginParameters& );
+
+	  /**
+       * @brief A type definition to a function to get the 
+       * current theme application pointer.
+       */ 
+      typedef void (*setCurrentThemeAppPtrFPT)( 
+        TeAppTheme*, const PluginParameters& );
+        
+      /**
+       * @brief A type definition to a function to reload the database 
+       * and update the TerraView interface (terraViewBase).
+       */ 
+      typedef void (*updateTVInterfaceFPT)( 
+        const PluginParameters& );
+
+	  /**
+       * @brief A type definition to a function to plot data
+       * in TerraView interface (terraViewBase).
+       */ 
+      typedef void (*plotTVDataFPT)( 
+        const PluginParameters& );
+
+	  /**
+       * @brief A type definition to a function set the plugin metadata
+       * in TerraView interface (terraViewBase).
+       */ 
+	  typedef void (*setPluginMetadataFPT)( 
+        const PluginParameters&, const PluginMetadata& );
+        
+      /**
+       * @brief A type definition to a function to load the translation 
+       * file dictionary into TerraView translation tables.
+       */ 
+      typedef bool (*loadTranslationFileFPT)( 
+        const PluginParameters&, const std::string& );         
+
+      /**
+       * @brief DEPRECATED - A pointer to a function to update the supllied 
+       * parameters with the current TerraView interface state.
+       *
+       * @note DEPRECATED - WILL BE REMOVED IN THE FUTURE.
+       */ 
+      typedef void (*updatePluginParametersFPT)( PluginParameters& );
+    
+      /**
+       * @name Object instance pointers
+       * 
+       * @brief Pointers to internal TerraView object instances.
+       */
+        
+      /**
+       * @brief A pointer to the current main widget instance (always valid).
+       * @note This is a casted pointer to TerraView main window and can be 
+       * used as parent widget for all plugin QT derived windows.
+       * @note This pointer is always valid.
+       */    
+      QMainWindow* qtmain_widget_ptr_;
+    
+      /**
+       * @brief The current progress base active instance pointer ( always 
+       * valid ).
+       */
+      TeProgressBase* teprogressbase_ptr_;
+      
+      /**
+       * @brief The current databases list view pointer ( always valid ).
+       */
+      TeQtDatabasesListView* teqtdatabaseslistview_ptr_;          
+
+      /**
+       * @brief The current views list view pointer ( always valid ).
+       */
+      TeQtViewsListView* teqtviewslistview_ptr_;          
+      
+      /**
+       * @brief The current grid instance pointer ( always valid ).
+       */      
+      TeQtGrid* teqtgrid_ptr_;
+
+      /**
+       * @brief The current theme application instance pointer ( always 
+       * valid ).
+       */      
+      TeQtCanvas* teqtcanvas_ptr_;      
+            
+      /**
+       * @brief DEPRECATED - The current database instance pointer.
+       *
+       * @note This pointer will be valid only for modal plugins. For
+       * non-modal plugins use the TeQtDatabasesListView pointer to
+       * get the current active database.
+       * @note DEPRECATED - WILL BE REMOVED IN THE FUTURE - 
+       * Use getCurrentDatabasePtr() instead.
+       */      
+      TeDatabase* current_database_ptr_;
+      
+      /**
+       * @brief DEPRECATED - The current layer instance pointer.
+       *
+       * @note This pointer will be valid only for modal plugins. For
+       * non-modal plugins use the TeQtViewsListView pointer to
+       * get the current active layer.
+       * @note DEPRECATED - WILL BE REMOVED IN THE FUTURE - 
+       * Use getCurrentLayerPtr() instead.       
+       */      
+      TeLayer* current_layer_ptr_;      
+
+      /**
+       * @brief DEPRECATED - The current view instance pointer.
+       *
+       * @note This pointer will be valid only for modal plugins. For
+       * non-modal plugins use the TeQtViewsListView pointer to
+       * get the current active view.   
+       * @note DEPRECATED - WILL BE REMOVED IN THE FUTURE - 
+       * Use getCurrentViewPtr() instead.              
+       */      
+      TeView* current_view_ptr_;
+      
+      /**
+       * @brief DEPRECATED - The current theme application instance pointer  ( always 
+       * valid ).
+       * @note DEPRECATED - WILL BE REMOVED IN THE FUTURE - 
+       * Use getCurrentThemeAppPtr() instead.        
+       */      
+      TeAppTheme* current_theme_ptr_;
+  
+	    /**
+       * @brief A pointer to plugins emitter singleton ( always 
+       * valid ).
+       */      
+      TeCommunicator<PluginsSignal>* signal_emitter_;
+
+	    /**
+       * @brief If TRUE, the theme must be draw using the collection. If FALSE, 
+	   * it will be draw using its only restrictions clauses.
+       */
+	  bool	use_collection_;
+
+	  /**
+       * @brief Stores the name of the plugin that is currently being loaded. Used to request the current plugin information.
+       */
+	  std::string currentPluginName_;
+
+	  /**
+       * @brief Stores the name of the current user. Views must be loaded for this given user.
+       */
+	  std::string currentUser_;
+      
+      /**
+       * @name Class constructors/destructor.
+       * 
+       * @brief Class constructors/destructor.
+       */      
+      
+      /**
+       * @brief Default constructor.
+       */    
+      PluginParameters();
+      
+      /**
+       * @brief Alternative constructor.
+       * @param qtmain_widget_ptr A pointer to the current main 
+       * widget instance.
+       * @param teprogressbase_ptr The current progress base 
+       * active instance pointer.
+       * @param teqtdatabaseslistview_ptr The current databases list 
+       * view pointer.
+       * @param teqtviewslistview_ptr The current views list view pointer.
+       * @param teqtgrid_ptr The current grid instance pointer.
+       * @param teqtcanvas_ptr The current theme application instance pointer.
+       * @param current_database_ptr The current database instance pointer.
+       * @param current_layer_ptr The current layer instance pointer.
+       * @param current_view_ptr The current view instance pointer.
+       * @param current_theme_ptr The current theme application instance 
+       * pointer.
+       * @param signal_emitter A pointer to plugins emitter singleton.
+	   * @param use_collection If TRUE, use collection to draw theme. Othewise, dont use it.
+	   * @param currentPluginName The name of the plugin that is currently being loaded.
+	   * @param currentUser The name of the user that is connected. Views must be loaded for this given user.
+       * @param getCurrentDatabasePtrFP A pointer to a function to get the 
+       * current database pointer.
+       * @param getCurrentLayerPtrFP A pointer to a function to get the 
+       * current layer pointer.
+       * @param getCurrentViewPtrFP A pointer to a function to get the 
+       * current view pointer.
+       * @param getCurrentThemeAppPtrFP A pointer to a function to get the 
+       * current theme application pointer. 
+       * @param updateTVInterfaceFP A pointer to a function to reload the database 
+       * and update the TerraView interface (terraViewBase).
+	   * @param plotTVDataFP A pointer to a function to plot data 
+       * in TerraView interface (terraViewBase).
+       * @param loadTranslationFileFP A pointer to a function to load the translation 
+       * file dictionary into TerraView translation tables.
+       * @param updatePluginParametersFP A pointer to a function to 
+       * update the supllied  parameters with the current TerraView 
+       * interface state.
+       */    
+      PluginParameters(
+        QMainWindow* qtmain_widget_ptr,
+        TeProgressBase* teprogressbase_ptr,
+        TeQtDatabasesListView* teqtdatabaseslistview_ptr,
+        TeQtViewsListView* teqtviewslistview_ptr,
+        TeQtGrid* teqtgrid_ptr,
+        TeQtCanvas* teqtcanvas_ptr,
+        TeDatabase* current_database_ptr,
+        TeLayer* current_layer_ptr,
+        TeView* current_view_ptr,
+        TeAppTheme* current_theme_ptr,
+        TeCommunicator<PluginsSignal>* signal_emitter,
+		bool use_collection,
+		std::string currentPluginName,
+		std::string currentUser,
+        getCurrentDatabasePtrFPT getCurrentDatabasePtrFP,
+        getCurrentLayerPtrFPT getCurrentLayerPtrFP,
+        getCurrentViewPtrFPT getCurrentViewPtrFP,
+        getCurrentThemeAppPtrFPT getCurrentThemeAppPtrFP,
+		setCurrentThemeAppPtrFPT setCurrentThemeAppPtrFP,
+        updateTVInterfaceFPT updateTVInterfaceFP,
+        loadTranslationFileFPT loadTranslationFileFP,
+        updatePluginParametersFPT updatePluginParametersFP,
+		plotTVDataFPT plotTVDataFP,
+		setPluginMetadataFPT setPluginMetadataFP,
+		getCurrentUserPtrFPT getCurrentUserPtrFP
+        );      
+        
+      /**
+       * @brief Default destructor.
+       */      
+      ~PluginParameters();
+      
+      /**
+       * @name TerraView interaction Methods.
+       * 
+       * @brief Methods to interact with TerraView main widget.
+       */
+
+	   /**
+      * @brief Returns the current user.
+      * @return The current user or "" if 
+      * there are no current user.
+      */
+	  std::string getCurrentUserPtr() const;   
+       
+      /**
+      * @brief Returns the current database pointer.
+      * @return The current database pointer or zero if 
+      * there are no current database.
+      */
+      TeDatabase* getCurrentDatabasePtr() const;    
+      
+      /**
+      * @brief Returns the current layer pointer.
+      * @return The current layer pointer or zero if 
+      * there are no current layer.
+      */
+      TeLayer* getCurrentLayerPtr() const;      
+      
+      /**
+      * @brief Returns the current view pointer.
+      * @return The current view pointer or zero if 
+      * there are no current view.
+      */
+      TeView* getCurrentViewPtr() const;
+      
+      /**
+      * @brief Returns the current theme application pointer.
+      * @return The current theme application pointer or zero if 
+      * there are no current theme application.
+      */
+      TeAppTheme* getCurrentThemeAppPtr() const;
+
+	  /**
+      * @brief Returns the current theme application pointer.
+      * @return The current theme application pointer or zero if 
+      * there are no current theme application.
+      */
+      void setCurrentThemeAppPtr(TeAppTheme*);
+      
+      /**
+       * @brief DEPRECATED - A function to reload the database and update the 
+       * TerraView interface (terraViewBase)  ( always valid ).
+       * @note DEPRECATED - WILL BE REMOVED IN THE FUTURE - Use
+       * the updateTVInterface() function instead.
+       * @param pp Plugin parameters reference.
+       */        
+      void updateTVInterface( const PluginParameters& pp ) const;
+      
+      /**
+       * @brief A function to reload the database and 
+       * update the TerraView interface (terraViewBase).
+       * 
+       */        
+      void updateTVInterface() const;      
+
+	  /**
+       * @brief A function to plot data  
+       * on TerraView interface (terraViewBase).
+       * 
+       */        
+      void plotTVData() const;
+
+	  /**
+      * @brief Used by the plugin to set its metadata to the application.
+      * @param pluginMetadata The plugin metadata.
+      */
+	  void setPluginMetadata(const PluginMetadata& pluginMetadata) const;
+      
+      /**
+       * @brief DEPRECATED - A pointer to a function to load the translation file 
+       * dictionary into TerraView translation tables ( always valid ).
+       * @param pp Plugin parameters reference.
+       * @return true if OK, false on errors.
+       * @note DEPRECATED - WILL BE REMOVED IN THE FUTURE - Use
+       * the loadTranslationFile( const std::string& filename ) 
+       * function instead.       
+       */        
+      bool loadTranslationFile( const PluginParameters& pp,
+        const std::string& filename ) const; 
+      
+      /**
+       * @brief A pointer to a function to load the translation file 
+       * dictionary into TerraView translation tables ( always valid ).
+       * @param filename The translation file name.
+       * @return true if OK, false on errors.
+       */        
+      bool loadTranslationFile( const std::string& filename ) const;        
+
+      /**
+       * @brief DEPRECATED - A function to update the supllied 
+       * parameters with the current TerraView interface state.
+       * @param pp Plugin parameters reference.
+       * @note DEPRECATED - WILL BE REMOVED IN THE FUTURE.
+       */ 
+      void updatePluginParameters( PluginParameters& pp ) const; 
+
+	    /**
+       * @brief If TRUE, collection must be used to draw the theme. 
+       * @return true if collection must be used to draw the collection.
+       */  
+	  bool useCollection() const;
+      
+    protected :
+    
+      /**
+       * @name PluginParameters protected data/methods.
+       */   
+            
+
+		/**
+       * @brief A pointer to a function to get the 
+       * current user.
+       */         
+      getCurrentUserPtrFPT getCurrentUserPtrFP_;
+
+      /**
+       * @brief A pointer to a function to get the 
+       * current database pointer.
+       */         
+      getCurrentDatabasePtrFPT getCurrentDatabasePtrFP_;
+      
+      /**
+       * @brief A pointer to a function to get the 
+       * current layer pointer.
+       */       
+      getCurrentLayerPtrFPT getCurrentLayerPtrFP_;
+      
+      /**
+       * @brief A pointer to a function to get the 
+       * current view pointer.
+       */       
+      getCurrentViewPtrFPT getCurrentViewPtrFP_;
+    
+      /**
+       * @brief A pointer to a function to get the 
+       * current theme application pointer.
+       */     
+      getCurrentThemeAppPtrFPT getCurrentThemeAppPtrFP_;
+
+	  /**
+       * @brief A pointer to a function to get the 
+       * current theme application pointer.
+       */     
+      setCurrentThemeAppPtrFPT setCurrentThemeAppPtrFP_;
+      
+      /**
+       * @brief A pointer to a function to reload the database 
+       * and update the TerraView interface (terraViewBase).
+       */     
+      updateTVInterfaceFPT updateTVInterfaceFP_;
+      
+      /**
+       * @brief A pointer to a function to load the translation 
+       * file dictionary into TerraView translation tables.
+       */     
+      loadTranslationFileFPT loadTranslationFileFP_;   
+      
+      /**
+       * @brief A pointer to a function to update the supllied 
+       * parameters with the current TerraView interface state
+       */        
+      updatePluginParametersFPT updatePluginParametersFP_;
+
+	  /**
+       * @brief A pointer to a function to plot data 
+       * in Terra View using display window pointer
+       */        
+      plotTVDataFPT plotTVDataFP_;
+
+	   /**
+       * @brief A pointer to a function used bay the plugin to set its metadata to Terraview
+       */ 
+	  setPluginMetadataFPT setPluginMetadataFP_;
+      
+      /**
+       * @brief Initiate the internal state variables.
+       */    
+      void init();             
+    
+  };
+
+#endif
diff --git a/src/terralib/drivers/spl/PluginsManager.cpp b/src/terralib/drivers/spl/PluginsManager.cpp
new file mode 100644
index 0000000..f5a1d37
--- /dev/null
+++ b/src/terralib/drivers/spl/PluginsManager.cpp
@@ -0,0 +1,213 @@
+#include "PluginsManager.h"
+
+#include <TeUtils.h>
+
+#include <algorithm>
+
+PluginsManager::PluginsManager()
+{
+  pluginServerHandlerPtr_ = 0;
+}
+
+
+PluginsManager::~PluginsManager()
+{
+  unloadPlugins();
+}
+
+
+void PluginsManager::setDefaultPluginsParameters( const PluginParameters& pp )
+{
+  default_pp_ = pp;
+}
+
+
+unsigned int PluginsManager::loadPlugins( const std::string& path )
+{
+  unloadPlugins();
+  
+  /* Creating the new plugins server instance */
+  
+  pluginServerHandlerPtr_ = (void*) new slcPluginServer;
+  
+  slcPluginServer* pluginServerPtr = 
+    ( slcPluginServer* ) pluginServerHandlerPtr_;
+    
+  /* Creating the loading time plugin parameters pointer using the current 
+     internal parameters */
+     
+  slcPluginArgs pargs;
+  long arg_index = -1;
+  arg_index = pargs.SetArg( (void*)( &default_pp_ ) );    
+  
+  long loaded_dlls = 0;
+
+  #if SPL_PLATFORM == SPL_PLATFORM_WIN32
+    loaded_dlls = pluginServerPtr->LoadAllPlugins( path.c_str(), "*.dll",
+      false, &pargs );
+  #elif SPL_PLATFORM == SPL_PLATFORM_LINUX
+    loaded_dlls = pluginServerPtr->LoadAllPlugins( path.c_str(), "*.so",
+      false, &pargs );
+    
+    #ifndef NDEBUG
+      const char* plugins_load_error_str = dlerror();
+      if( plugins_load_error_str != 0 ) {
+        std::cout << std::endl << "TerraView: Error loading plugins - " <<
+          plugins_load_error_str << std::endl;
+      }
+    #endif
+  #else
+    #error "Unsuported Plataform"
+  #endif
+  
+  if( loaded_dlls > 0 ) {
+    pluginServerPtr->GetAllPluginInfos();
+    
+    for( long plugin_index = 0 ; plugin_index < loaded_dlls ; 
+        ++plugin_index ) {
+         
+      slcPluginInfo pluginInfo = 
+        pluginServerPtr->GetSafedPluginInfo( plugin_index );
+        
+      SPLPluginInfoT pinfo;
+      pinfo.first.plugin_name_ =  pluginInfo.GetName();
+      pinfo.first.plugin_type_ = pluginInfo.GetUUID();
+      pinfo.first.plugin_interface_version_ = pluginInfo.GetInfo();
+      pinfo.first.plugin_build_number_ = 
+        Te2String( pluginInfo.GetBuildVersion() );
+      pinfo.first.plugin_major_version_ = 
+        Te2String( pluginInfo.GetMajorVersion() );
+      pinfo.first.plugin_minor_version_ = 
+        Te2String( pluginInfo.GetMinorVersion() );
+      pinfo.first.plugin_description_ = pluginInfo.GetDescription();
+      pinfo.first.plugin_vendor_ = pluginInfo.GetVendor();
+      pinfo.first.plugin_vendor_email_ = pluginInfo.GetEmail();
+      pinfo.first.plugin_url_ = pluginInfo.GetHomepage();
+      pinfo.second = plugin_index;
+        
+      std::vector< std::string > plugin_menu_entries;
+      TeSplitString( pinfo.first.plugin_type_, ".", plugin_menu_entries );
+        
+      if( plugin_menu_entries.size() > 0 ) {
+        if( plugin_menu_entries[ 0 ] == "TerraViewPlugin" ) {
+          if( pinfo.first.plugin_interface_version_ == 
+            PLUGINPARAMETERS_VERSION ) {
+            
+            if( pluginServerPtr->RunPluginInit( plugin_index, &pargs ) ) {
+              valid_plugins_.push_back( pinfo );
+            } else {
+              invalid_plugins_.push_back( pinfo );
+            }
+          } else {
+            invalid_plugins_.push_back( pinfo );
+          }
+        }
+      }
+    }
+  }
+  
+  return loaded_dlls;
+}
+
+
+void PluginsManager::unloadPlugins()
+{
+  if( pluginServerHandlerPtr_ != 0 ) {
+    /* Casting back the plugin server pointer */
+    
+    slcPluginServer* pluginServerPtr = 
+      ( slcPluginServer* ) pluginServerHandlerPtr_;
+      
+    /* Creating the unloading time plugin parameters pointer using the current 
+      internal parameters */
+       
+    slcPluginArgs pargs;
+    long arg_index = -1;
+    arg_index = pargs.SetArg( (void*)( &default_pp_ ) );       
+    
+    /* Unloading valid plugins */
+    
+    std::vector< SPLPluginInfoT >::iterator it = valid_plugins_.begin();
+    std::vector< SPLPluginInfoT >::iterator it_end = valid_plugins_.end();
+    
+    while( it != it_end ) {
+      pluginServerPtr->UnloadPlugin( it->second, true, &pargs );
+      ++it;
+    }
+  
+    /* Unloading invalid plugins */
+    
+    it = invalid_plugins_.begin();
+    it_end = invalid_plugins_.end();
+    
+    while( it != it_end ) {
+      pluginServerPtr->UnloadPlugin( it->second, false, &pargs );
+      ++it;
+    }
+    
+    /* Releasing memory */
+  
+    delete pluginServerPtr;
+    
+    pluginServerHandlerPtr_ = 0;
+    
+    valid_plugins_.clear();
+    invalid_plugins_.clear();
+  }
+}
+
+
+void PluginsManager::getValidPluginsList( 
+  std::vector< PluginInfo >& plist ) const
+{
+  std::vector< SPLPluginInfoT >::const_iterator it = valid_plugins_.begin();
+  std::vector< SPLPluginInfoT >::const_iterator it_end = valid_plugins_.end();
+  
+  plist.clear();
+  
+  while( it != it_end ) {
+    plist.push_back( it->first );
+  
+    ++it;
+  }
+}
+
+
+void PluginsManager::getInvalidPluginsList( 
+  std::vector< PluginInfo >& plist ) const
+{
+  std::vector< SPLPluginInfoT >::const_iterator it = invalid_plugins_.begin();
+  std::vector< SPLPluginInfoT >::const_iterator it_end = 
+    invalid_plugins_.end();
+  
+  plist.clear();
+  
+  while( it != it_end ) {
+    plist.push_back( it->first );
+  
+    ++it;
+  }
+}
+
+
+bool PluginsManager::runPlugin( const PluginInfo& pinfo ) const
+{
+  if( pluginServerHandlerPtr_ != 0 ) {
+    slcPluginServer* pluginServerPtr = 
+      ( slcPluginServer* ) pluginServerHandlerPtr_;
+  
+    for( unsigned int index = 0 ; index < valid_plugins_.size() ; ++index ) {
+      if( valid_plugins_[ index ].first == pinfo ) {
+      
+        slcPluginArgs pargs;
+        long arg_index = -1;
+        arg_index = pargs.SetArg( (void*)( &default_pp_ ) );
+        
+        return pluginServerPtr->RunPlugin( 
+          valid_plugins_[ index ].second, &pargs );
+      }
+    }
+  }
+
+  return false;
+}
diff --git a/src/terralib/drivers/spl/PluginsManager.h b/src/terralib/drivers/spl/PluginsManager.h
new file mode 100644
index 0000000..87e4968
--- /dev/null
+++ b/src/terralib/drivers/spl/PluginsManager.h
@@ -0,0 +1,133 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#ifndef PLUGINSMANAGER_H
+  #define PLUGINSMANAGER_H
+  
+  #include <spl.h>
+  #include <PluginInfo.h>
+  #include <PluginParameters.h>
+  
+  #include <string>
+  #include <vector>
+
+  #include "TeSPLDefines.h"
+
+/* This is to enable the error messages when loading plugins for debug mode  */
+#ifndef NDEBUG
+  #if SPL_PLATFORM == SPL_PLATFORM_WIN32
+    #include <windows.h>
+  #elif SPL_PLATFORM == SPL_PLATFORM_LINUX
+    #include <dlfcn.h>
+  #else
+    #error "Unsuported Plataform"
+  #endif
+#endif
+
+  /**
+   * @brief A class to deal with dynamic plugin loading/unloading.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   */
+  class TLSPL_DLL PluginsManager
+  {
+    public :
+    
+      /**
+       * Default constructor.
+       */    
+      PluginsManager();
+
+      /**
+       * Default destructor.
+       */       
+      virtual ~PluginsManager();
+      
+      /**
+       * Set the default plugins parameters that will be used when 
+       * calling the runPlugin function.
+       */    
+      virtual void setDefaultPluginsParameters( const PluginParameters& pp );      
+      
+      /**
+       * Load all plugins from the supplied directory path.
+       *
+       * @param path The directory path.
+       * @return The number of loaded plugins (including invalid/incompatible).
+       */       
+      virtual unsigned int loadPlugins( const std::string& path );
+      
+      /**
+       * Unload all plugins.
+       */       
+      virtual void unloadPlugins();      
+
+      /**
+       * Execute a plugin code.
+       *
+       * @param pinf The plugin's info.
+       */       
+      virtual bool runPlugin( const PluginInfo& pinfo ) const;
+      
+      /**
+       * Build a vector of the currently loaded valid plugins info.
+       *
+       * @param plist A output vector reference.
+       */       
+      virtual void getValidPluginsList( std::vector< PluginInfo >& plist ) const;
+      
+      /**
+       * Build a vector of the currently loaded invalid plugins info.
+       *
+       * @param plist A output vector reference.
+       */       
+      virtual void getInvalidPluginsList( std::vector< PluginInfo >& plist ) const;      
+      
+    protected :
+      
+      /**
+       * A definition of loaded plugins info mapping to SPL internal
+       * list indexes.
+       */       
+      typedef std::pair< PluginInfo, long > SPLPluginInfoT;
+      
+      /**
+       * A pointer to the SPL server.
+       */        
+      void* pluginServerHandlerPtr_;
+
+      /**
+       * A vector holding information of all loaded plugins.
+       */        
+      std::vector< SPLPluginInfoT > valid_plugins_;
+      
+      /**
+       * A vector holding information of all loaded plugins.
+       */        
+      std::vector< SPLPluginInfoT > invalid_plugins_;      
+      
+      /**
+       * The default plugins parameters that will be used when calling
+       * the plugins run function.
+       */        
+      PluginParameters default_pp_;
+  };
+
+#endif
diff --git a/src/terralib/drivers/spl/PluginsParametersContainer.h b/src/terralib/drivers/spl/PluginsParametersContainer.h
new file mode 100644
index 0000000..b3bf104
--- /dev/null
+++ b/src/terralib/drivers/spl/PluginsParametersContainer.h
@@ -0,0 +1,462 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+/*! \file PluginsParametersContainer.h
+   \brief A container class to store multiple types os object copies.
+*/
+
+
+#ifndef PLUGINPARAMETERSCONTAINER_H
+  #define PLUGINPARAMETERSCONTAINER_H
+
+  #include <TeSharedPtr.h>
+  #include <TeMutex.h>
+
+#include "TeSPLDefines.h"
+  
+  #include <time.h>
+  #include <vector>
+
+  /**
+    * @brief Node interface.
+    * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+    */    
+  class TLSPL_DLL PPCNodeInterface {
+    public :
+    
+      /**
+        * @brief Default Constructor.
+        */        
+      PPCNodeInterface() {};
+      
+      /**
+        * @brief Default Destructor.
+        */        
+      virtual ~PPCNodeInterface() {};
+      
+      /**
+        * @brief Copies the the current node instance by calling
+        * the operator= from the contained object instance.
+        * @return A pointer to the new node copy.
+        */            
+      virtual TeSharedPtr< PPCNodeInterface > clone() const = 0;
+      
+    private :
+    
+      /**
+      * @brief operator= overload.
+      *
+      * @param ext_instance External instance reference.
+      * @return The external instance reference.
+      */
+      const PPCNodeInterface& operator=( 
+        const PPCNodeInterface& ext_instance );        
+  };
+
+
+  /**
+    * @brief node class.
+    * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+    */       
+  template< typename ObjectT >
+  class PPCNode : public PPCNodeInterface {
+    public :
+    
+      /**
+        * @brief Default Constructor.
+        */        
+      PPCNode() {};
+      
+      /**
+        * @brief Default Destructor.
+        */        
+      ~PPCNode() {};
+      
+      /**
+        * @brief Copies the the current node instance by calling
+        * the operator= from the contained object instance.
+        * @return A pointer to the new node copy.
+        */              
+      TeSharedPtr< PPCNodeInterface > clone() const
+      {
+        PPCNode< ObjectT >* new_node_ptr =
+          new PPCNode< ObjectT >;
+          
+        TeSharedPtr< ObjectT > new_obj_ptr( new ObjectT );
+        ( *new_obj_ptr )= ( *obj_ptr_ );
+        
+        new_node_ptr->setObjPtr( new_obj_ptr );
+        
+        TeSharedPtr< PPCNodeInterface > new_nodei_ptr(
+          new_node_ptr );
+        
+        return new_nodei_ptr;
+      };
+      
+      /**
+        * @brief Set the internal object pointer.
+        * @param ptr Object pointer.
+        */        
+      void setObjPtr( const TeSharedPtr< ObjectT >& ptr ) 
+      { 
+        obj_ptr_ = ptr;
+      };
+      
+      /**
+        * @brief Get the internal object pointer.
+        * @return The object pointer.
+        */        
+      TeSharedPtr< ObjectT > getObjPtr() const
+      { 
+        return obj_ptr_; 
+      };
+      
+    protected :
+      
+      /**
+        * @brief The internal object pointer.
+        */
+      TeSharedPtr< ObjectT > obj_ptr_;
+
+  }; 
+
+ /**
+  * @brief A container class to store multiple types os object copies.
+  * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+  * @note This is a thread-safe class.
+  */
+  template< typename PluginsParametersContainerKeyT >
+  class PluginsParametersContainer {
+  
+    public :
+    
+      /** @typedef TeSharedPtr< PluginsParametersContainer< PluginsParametersContainerKeyT > > pointer 
+          Type definition for a instance pointer */
+      typedef TeSharedPtr< PluginsParametersContainer< PluginsParametersContainerKeyT > > pointer;
+      
+      /** @typedef const TeSharedPtr< PluginsParametersContainer< PluginsParametersContainerKeyT > > const_pointer 
+          Type definition for a const instance pointer */
+      typedef const TeSharedPtr< PluginsParametersContainer< PluginsParametersContainerKeyT > > const_pointer;
+      
+      /**
+       * @brief Default Constructor
+       */
+      PluginsParametersContainer();
+      
+      /**
+       * @brief Alternative Constructor
+       * @param external External reference.
+       */
+      PluginsParametersContainer( 
+        const PluginsParametersContainer< PluginsParametersContainerKeyT >& external );      
+
+      /**
+       * @brief  Default Destructor
+       */
+      ~PluginsParametersContainer();
+                           
+      /**
+       * @brief Operator == overload.
+       *
+       * @param ext_instance External instance reference.
+       * @return true if this instance have the same internal
+       * update time that the external instance.
+       */
+      bool operator==( 
+        const PluginsParametersContainer< PluginsParametersContainerKeyT >& ext_instance ) const;
+      
+      /**
+       * @brief Operator != overload.
+       *
+       * @param ext_instance External instance reference.
+       * @return true if this instance don't have the same internal
+       * update time that the external instance.
+       */
+      bool operator!=( 
+        const PluginsParametersContainer< PluginsParametersContainerKeyT >& ext_instance ) const;
+      
+      /**
+       * @brief operator= overload.
+       *
+       * @param ext_instance External instance reference.
+       * @return The external instance reference.
+       */
+      const PluginsParametersContainer< PluginsParametersContainerKeyT >& operator=( 
+        const PluginsParametersContainer< PluginsParametersContainerKeyT >& ext_instance );
+      
+      /**
+       * @brief Clear all contents.
+       *
+       */
+      void clear();
+                         
+      /**
+       * @brief Store a object copy.
+       *
+       * @param obj_key Object key.
+       * @param obj_reference Object instance.
+       */                         
+      template< typename ObjectT >
+      void store( const PluginsParametersContainerKeyT& obj_key,
+                         const ObjectT& obj_reference );
+      
+      /**
+       * @brief Retrive a copy of a stored object.
+       *
+       * @param obj_key Object key.
+       * @param obj_reference Object instance.
+       * @return true if OK, false if the parameter was no found or error.
+       */      
+      template< typename ObjectT >
+      bool retrive( const PluginsParametersContainerKeyT& obj_key,
+        ObjectT& obj_reference ) const;
+        
+    protected :
+        
+      /** @typedef typename std::pair< PluginsParametersContainerKeyT, TeSharedPtr< PPCNodeInterface > > VectorKeyT
+        Internal vector key type definition. */
+      typedef typename std::pair< PluginsParametersContainerKeyT, 
+        TeSharedPtr< PPCNodeInterface > > VectorKeyT;
+
+      /** @typedef typename std::vector< VectorKeyT > VectorT
+        Internal vector type definition. */
+      typedef typename std::vector< VectorKeyT > VectorT;
+      
+      /** @brief The internal vector instance. */
+      VectorT objects_vector_;    
+      
+      /**
+       * @brief The last update time.
+       */
+      time_t last_up_time_;
+      
+      /**
+       * @brief This instance locking mutex.
+       */    
+      mutable TeMutex this_lock_instance_;      
+
+      /**
+       * @brief Updates the internal last update time.
+       *
+       * @note Needed by comparison between two multi containers.
+       */
+      void update_time();            
+
+};
+
+
+template< typename PluginsParametersContainerKeyT >
+PluginsParametersContainer< PluginsParametersContainerKeyT >::PluginsParametersContainer()
+{
+  last_up_time_ = 0;
+}
+
+
+template< typename PluginsParametersContainerKeyT >
+PluginsParametersContainer< PluginsParametersContainerKeyT >::PluginsParametersContainer( 
+  const PluginsParametersContainer< PluginsParametersContainerKeyT >& external )
+{
+  last_up_time_ = 0;
+  
+  operator=( external );
+}
+
+
+template< typename PluginsParametersContainerKeyT >
+PluginsParametersContainer< PluginsParametersContainerKeyT >::~PluginsParametersContainer()
+{
+  clear();
+}
+
+
+template< typename PluginsParametersContainerKeyT >
+void PluginsParametersContainer< PluginsParametersContainerKeyT >::clear()
+{
+  this_lock_instance_.lock();
+  
+  objects_vector_.clear();
+  
+  this_lock_instance_.unLock();
+}
+
+
+template< typename PluginsParametersContainerKeyT >
+bool PluginsParametersContainer< PluginsParametersContainerKeyT >::operator==( 
+  const PluginsParametersContainer< PluginsParametersContainerKeyT >& ext_instance ) const
+{
+  if( last_up_time_ == ext_instance.last_up_time_ ) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+
+template< typename PluginsParametersContainerKeyT >
+bool PluginsParametersContainer< PluginsParametersContainerKeyT >::operator!=( 
+  const PluginsParametersContainer< PluginsParametersContainerKeyT >& ext_instance ) const
+{
+  if( last_up_time_ == ext_instance.last_up_time_ ) {
+    return false;
+  } else {
+    return true;
+  }
+}
+
+
+template< typename PluginsParametersContainerKeyT >
+const PluginsParametersContainer< PluginsParametersContainerKeyT >& 
+PluginsParametersContainer< PluginsParametersContainerKeyT >::operator=( 
+  const PluginsParametersContainer< PluginsParametersContainerKeyT >& ext_instance )
+{
+  if( ( &ext_instance ) != this ) {
+    this_lock_instance_.lock();
+  
+    objects_vector_.clear();
+    
+    ext_instance.this_lock_instance_.lock();
+  
+    typename VectorT::const_iterator objects_vector_it = 
+      ext_instance.objects_vector_.begin();
+    typename VectorT::const_iterator objects_vector_it_end = 
+      ext_instance.objects_vector_.end();
+    
+    VectorKeyT auxkey;
+          
+    while( objects_vector_it != objects_vector_it_end ) {
+      auxkey.first = objects_vector_it->first;
+      auxkey.second = objects_vector_it->second->clone();
+      
+      objects_vector_.push_back( auxkey );
+          
+      ++objects_vector_it;
+    }
+  
+    last_up_time_ = ext_instance.last_up_time_;
+  
+    ext_instance.this_lock_instance_.unLock();
+    
+    this_lock_instance_.unLock();
+  }
+
+  return *this;
+}
+
+
+template< typename PluginsParametersContainerKeyT >
+void PluginsParametersContainer< PluginsParametersContainerKeyT >::update_time()
+{
+  last_up_time_ = time( 0 );
+}
+
+
+template< typename PluginsParametersContainerKeyT >
+template< typename ObjectT >
+void PluginsParametersContainer< PluginsParametersContainerKeyT >::store( 
+  const PluginsParametersContainerKeyT& obj_key, const ObjectT& obj_reference )
+{
+  this_lock_instance_.lock();
+  
+  typename VectorT::iterator objects_vector_it = 
+    objects_vector_.begin();
+  typename VectorT::iterator objects_vector_it_end = 
+    objects_vector_.end();
+  
+  PPCNode< ObjectT >* node_ptr = 0;
+  
+  while( objects_vector_it != objects_vector_it_end ) {
+    if( objects_vector_it->first == obj_key ) {
+      node_ptr = (PPCNode< ObjectT >*)
+        objects_vector_it->second.nakedPointer();
+    
+      break;
+    }
+  
+    ++objects_vector_it;
+  }
+  
+  if( node_ptr == 0 ) {
+    TeSharedPtr< ObjectT > new_obj_ptr( new ObjectT );
+    (*new_obj_ptr) = obj_reference;
+  
+    node_ptr = new PPCNode< ObjectT >;
+    node_ptr->setObjPtr( new_obj_ptr );
+    
+    VectorKeyT auxkey;
+    auxkey.first = obj_key;
+    auxkey.second = 
+      TeSharedPtr< PPCNodeInterface >( 
+        (PPCNodeInterface*)node_ptr );
+  
+    objects_vector_.push_back( auxkey );
+  } else {
+    (*( node_ptr->getObjPtr() ) ) = obj_reference;
+  }
+  
+  update_time();
+  
+  this_lock_instance_.unLock();
+}
+
+
+template< typename PluginsParametersContainerKeyT >
+template< typename ObjectT >
+bool PluginsParametersContainer< PluginsParametersContainerKeyT >::retrive(
+  const PluginsParametersContainerKeyT& obj_key, ObjectT& obj_reference ) const
+{
+  this_lock_instance_.lock();
+  
+  typename VectorT::const_iterator objects_vector_it = 
+    objects_vector_.begin();
+  typename VectorT::const_iterator objects_vector_it_end = 
+    objects_vector_.end();
+  
+  PPCNode< ObjectT >* node_ptr = 0;
+  
+  while( objects_vector_it != objects_vector_it_end ) {
+    if( objects_vector_it->first == obj_key ) {
+      node_ptr = (PPCNode< ObjectT >*)
+        objects_vector_it->second.nakedPointer();
+    
+      break;
+    }
+  
+    ++objects_vector_it;
+  }
+  
+  if( node_ptr == 0 ) {
+    TEAGN_LOGWARN( "Trying to retrive an object not stored" );
+    
+    this_lock_instance_.unLock();
+      
+    return false;
+  } else {
+    obj_reference = ( *( node_ptr->getObjPtr() ) );
+    
+    this_lock_instance_.unLock();
+    
+    return true;
+  }
+}
+
+
+#endif
+
diff --git a/src/terralib/drivers/spl/PluginsSignal.cpp b/src/terralib/drivers/spl/PluginsSignal.cpp
new file mode 100644
index 0000000..c575da2
--- /dev/null
+++ b/src/terralib/drivers/spl/PluginsSignal.cpp
@@ -0,0 +1,7 @@
+#include "PluginsSignal.h"
+
+PluginsSignal::PluginsSignal(const PluginsSignalType& signalType)
+	: signalType_(signalType)
+{
+}
+
diff --git a/src/terralib/drivers/spl/PluginsSignal.h b/src/terralib/drivers/spl/PluginsSignal.h
new file mode 100644
index 0000000..c03e335
--- /dev/null
+++ b/src/terralib/drivers/spl/PluginsSignal.h
@@ -0,0 +1,78 @@
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+/** \file PluginsSignal.h
+  * \brief This file contains a base class in order to send signals in TerraView.
+  * \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+  * \author Emiliano Castejon <castejon at dpi.inpe.br>
+  */
+
+#ifndef  __TERRALIB_INTERNAL_PLUGINSSIGNAL_H
+#define  __TERRALIB_INTERNAL_PLUGINSSIGNAL_H
+
+#include <TeCommunicator.h>
+#include "PluginsParametersContainer.h"
+
+#include <TeSPLDefines.h>
+
+/** \class PluginsSignal
+  * \brief An instance of this class represents
+  *        a signal, that can be emitted by someone
+  *        using PluginsEmitter singleton.
+  *        When sending a signal, whe can
+  *        add some data with the signal.
+  *        See addData and getData methods.
+  *
+  * \sa PluginsEmitter
+  * \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+  * \author Emiliano Castejon <castejon at dpi.inpe.br>
+  */
+class TLSPL_DLL PluginsSignal
+{
+    public :
+
+		/** \enum PluginsSignalType
+		  * \brief Type of signal.
+		  */
+		enum PluginsSignalType { S_INACTIVE, S_DRAW_THEME, S_CREATE_THEME_ITEM, S_SET_DATABASE, S_POINT_QUERY, S_SHOW_THEME_POPUP, S_SET_QTTHEMEICON, S_REQUEST_PLUGIN_METADATA };
+
+		/** \enum PluginsSignalDatatype
+		  * \brief Type of data informed on a signal.
+		  */
+		enum PluginsSignalDatatype { D_QT_CANVAS, D_QT_VIEWS, D_ABSTRACT_THEME, D_DATABASE, D_COORD2D, D_QT_THEMEITEM, D_STRING, D_PLUGIN_PARAMS, D_THEMETYPE };
+
+		/** \brief Constructor.
+		  * \param signalType Signal type. (Input)
+		  */
+		PluginsSignal(const PluginsSignalType& signalType);
+
+	public:
+
+		PluginsSignalType signalType_;							//!< Signal type.
+		PluginsParametersContainer<PluginsSignalDatatype> signalData_;	//!< Signal data.
+};
+
+/** \typedef TeSingleton<TeCommunicator<PluginsSignal> > PluginsEmitter
+  * \brief This class is a singleton that can be used to send signals to registered communicator instances.
+  */
+typedef TeSingleton<TeCommunicator<PluginsSignal> > PluginsEmitter;
+
+#endif	// __TERRALIB_INTERNAL_PLUGINSSIGNAL_H
+
diff --git a/src/terralib/drivers/spl/TeSPLDefines.h b/src/terralib/drivers/spl/TeSPLDefines.h
new file mode 100644
index 0000000..aec19b7
--- /dev/null
+++ b/src/terralib/drivers/spl/TeSPLDefines.h
@@ -0,0 +1,54 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSPLDefines.h
+    \brief Provides a set of general definitions used by te_spl project.
+*/
+#ifndef  __TESPL_INTERNAL_DEFINES_H
+#define  __TESPL_INTERNAL_DEFINES_H
+
+/** @defgroup Defines Defines and constants
+  @{
+ */
+
+/** @defgroup TLSPL_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLSPL_AS_DLL
+#define TLSPL_DLL __declspec(dllexport)
+#else
+#define TLSPL_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TLSPL_DLL
+#endif
+/** @} */ 
+
+#endif
+
diff --git a/src/terralib/dtm/TeDTMAlgorithm.cpp b/src/terralib/dtm/TeDTMAlgorithm.cpp
old mode 100755
new mode 100644
index aa943a2..97276bf
--- a/src/terralib/dtm/TeDTMAlgorithm.cpp
+++ b/src/terralib/dtm/TeDTMAlgorithm.cpp
@@ -1,73 +1,73 @@
-#include "TeDTMAlgorithm.h"
-
-#include <TeAgnostic.h>
-
-TeDTMAlgorithm::TeDTMAlgorithm()
-{
-  progress_enabled_ = true;
-}
-
-
-TeDTMAlgorithm::~TeDTMAlgorithm()
-{
-}
-
-
-bool TeDTMAlgorithm::reset( const TeDTMParameters& params )
-{
-  if( checkParameters( params ) ) {
-    resetState( params );
-
-    /* This line must come after the ResetState line, because some algorithms
-       checks the difference between the current internal parameters and the
-       new supplied parameters */
-    params_.clear();
-    params_ = params;
-
-    return true;
-  } else {
-    TEAGN_LOG_AND_RETURN( "Invalid supplied parameters" );
-  }
-}
-
-
-bool TeDTMAlgorithm::apply()
-{
-  bool return_value = false;
-  
-  if( checkInternalParameters() ) {
-    return_value = runImplementation();
-  } else {
-    TEAGN_LOG_AND_RETURN( "Invalid supplied parameters" );
-  }
-  
-  return return_value;
-}
-
-
-const TeDTMParameters& TeDTMAlgorithm::getParameters() const
-{
-  return params_;
-}
-
-
-bool TeDTMAlgorithm::checkInternalParameters() const
-{
-  return checkParameters( params_ );
-}
-
-
-const TeDTMAlgorithm& TeDTMAlgorithm::operator=( 
-  const TeDTMAlgorithm& external )
-{
-  TEAGN_LOG_AND_THROW( "Algorithms cannot be copied" );  
-  
-  return external;
-}
-
-
-void TeDTMAlgorithm::toggleProgInt( bool enabled )
-{
-  progress_enabled_ = enabled;
-}
-
+#include "TeDTMAlgorithm.h"
+
+#include <TeAgnostic.h>
+
+TeDTMAlgorithm::TeDTMAlgorithm()
+{
+  progress_enabled_ = true;
+}
+
+
+TeDTMAlgorithm::~TeDTMAlgorithm()
+{
+}
+
+
+bool TeDTMAlgorithm::reset( const TeDTMParameters& params )
+{
+  if( checkParameters( params ) ) {
+    resetState( params );
+
+    /* This line must come after the ResetState line, because some algorithms
+       checks the difference between the current internal parameters and the
+       new supplied parameters */
+    params_.clear();
+    params_ = params;
+
+    return true;
+  } else {
+    TEAGN_LOG_AND_RETURN( "Invalid supplied parameters" );
+  }
+}
+
+
+bool TeDTMAlgorithm::apply()
+{
+  bool return_value = false;
+  
+  if( checkInternalParameters() ) {
+    return_value = runImplementation();
+  } else {
+    TEAGN_LOG_AND_RETURN( "Invalid supplied parameters" );
+  }
+  
+  return return_value;
+}
+
+
+const TeDTMParameters& TeDTMAlgorithm::getParameters() const
+{
+  return params_;
+}
+
+
+bool TeDTMAlgorithm::checkInternalParameters() const
+{
+  return checkParameters( params_ );
+}
+
+
+const TeDTMAlgorithm& TeDTMAlgorithm::operator=( 
+  const TeDTMAlgorithm& external )
+{
+  TEAGN_LOG_AND_THROW( "Algorithms cannot be copied" );  
+  
+  return external;
+}
+
+
+void TeDTMAlgorithm::toggleProgInt( bool enabled )
+{
+  progress_enabled_ = enabled;
+}
+
diff --git a/src/terralib/dtm/TeDTMAlgorithm.h b/src/terralib/dtm/TeDTMAlgorithm.h
old mode 100755
new mode 100644
index 7d1d1f9..131de1d
--- a/src/terralib/dtm/TeDTMAlgorithm.h
+++ b/src/terralib/dtm/TeDTMAlgorithm.h
@@ -1,147 +1,147 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEDTMALGORITHM_HPP
-  #define TEDTMALGORITHM_HPP
-
-  #include "TeDTMParameters.h"
-
-/**
- * @brief This is the base class for DTM algorithms.
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- * @ingroup TeDTMGeneralAlgoGroup
- */
-  class DTM_DLL TeDTMAlgorithm
-  {
-    public :
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TeDTMAlgorithm();
-
-      /**
-       * @brief Applies the algorithm following the current state and
-       * internal stored parameters.
-       *
-       * @return true if OK. false on error.
-       */
-      bool apply();
-
-      /**
-       * @brief Reset the internal state with new supplied parameters.
-       *
-       * @param params The new supplied parameters.
-       * @return true if parameters OK, false on error.
-       */
-      bool reset( const TeDTMParameters& params );
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * DTM algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      virtual bool checkParameters( 
-        const TeDTMParameters& parameters ) const = 0;
-
-      /**
-       * @brief Returns a reference to the current internal parameters.
-       *
-       * @return A reference to the current internal parameters.
-       */
-      const TeDTMParameters& getParameters() const;
-      
-      /**
-       * @brief Enable / Disable the progress interface.
-       *
-       * @param enabled Flag to enable ( true ) or disable ( false ).
-       */
-      void toggleProgInt( bool enabled );        
-
-    protected :
-      /**
-       * @brief Internal parameters reference
-       */
-      mutable TeDTMParameters params_;
-      
-      /**
-       * @brief The internal progress interface enabled state.
-       */
-      bool progress_enabled_;
- 
-      /**
-       * @brief Default Constructor
-       */
-      TeDTMAlgorithm();
-
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      virtual bool runImplementation() = 0;
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      virtual void resetState( const TeDTMParameters& params ) = 0;
-      
-      /**
-       * @brief Checks if current internal parameters fits the requirements of each
-       * DTM algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @return true if the internal parameters are OK. false if not.
-       */
-      bool checkInternalParameters() const;
-                
-    private :
-    
-      /**
-       * @brief Alternative constructor.
-       *
-       * @note Algorithms cannot be copied.
-       */    
-      TeDTMAlgorithm( const TeDTMAlgorithm& ) {};
-    
-      /**
-       * @brief Operator = overload.
-       *
-       * @note Algorithms cannot be copied.
-       *
-       * @param external External algorithm reference.
-       * @return A const Algorithm reference.
-       */
-      const TeDTMAlgorithm& operator=( 
-        const TeDTMAlgorithm& external );
-  };
-
-#endif //TEDTMALGORITHM_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEDTMALGORITHM_HPP
+  #define TEDTMALGORITHM_HPP
+
+  #include "TeDTMParameters.h"
+
+/**
+ * @brief This is the base class for DTM algorithms.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup TeDTMGeneralAlgoGroup
+ */
+  class DTM_DLL TeDTMAlgorithm
+  {
+    public :
+      
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TeDTMAlgorithm();
+
+      /**
+       * @brief Applies the algorithm following the current state and
+       * internal stored parameters.
+       *
+       * @return true if OK. false on error.
+       */
+      bool apply();
+
+      /**
+       * @brief Reset the internal state with new supplied parameters.
+       *
+       * @param params The new supplied parameters.
+       * @return true if parameters OK, false on error.
+       */
+      bool reset( const TeDTMParameters& params );
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * DTM algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      virtual bool checkParameters( 
+        const TeDTMParameters& parameters ) const = 0;
+
+      /**
+       * @brief Returns a reference to the current internal parameters.
+       *
+       * @return A reference to the current internal parameters.
+       */
+      const TeDTMParameters& getParameters() const;
+      
+      /**
+       * @brief Enable / Disable the progress interface.
+       *
+       * @param enabled Flag to enable ( true ) or disable ( false ).
+       */
+      void toggleProgInt( bool enabled );        
+
+    protected :
+      /**
+       * @brief Internal parameters reference
+       */
+      mutable TeDTMParameters params_;
+      
+      /**
+       * @brief The internal progress interface enabled state.
+       */
+      bool progress_enabled_;
+ 
+      /**
+       * @brief Default Constructor
+       */
+      TeDTMAlgorithm();
+
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      virtual bool runImplementation() = 0;
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      virtual void resetState( const TeDTMParameters& params ) = 0;
+      
+      /**
+       * @brief Checks if current internal parameters fits the requirements of each
+       * DTM algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @return true if the internal parameters are OK. false if not.
+       */
+      bool checkInternalParameters() const;
+                
+    private :
+    
+      /**
+       * @brief Alternative constructor.
+       *
+       * @note Algorithms cannot be copied.
+       */    
+      TeDTMAlgorithm( const TeDTMAlgorithm& ) {};
+    
+      /**
+       * @brief Operator = overload.
+       *
+       * @note Algorithms cannot be copied.
+       *
+       * @param external External algorithm reference.
+       * @return A const Algorithm reference.
+       */
+      const TeDTMAlgorithm& operator=( 
+        const TeDTMAlgorithm& external );
+  };
+
+#endif //TEDTMALGORITHM_HPP
diff --git a/src/terralib/dtm/TeDTMDefines.h b/src/terralib/dtm/TeDTMDefines.h
old mode 100755
new mode 100644
index f0a04fa..787b820
--- a/src/terralib/dtm/TeDTMDefines.h
+++ b/src/terralib/dtm/TeDTMDefines.h
@@ -1,73 +1,73 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-/**
- * @defgroup DTMModule DTM Processing.
- */  
- 
-/**
- * @defgroup DTMAlgorithms DTM Processing Algorithms.
- * @ingroup DTMModule
- */ 
- 
-/**
- * @defgroup TeDTMGeneralAlgoGroup General purpose DTM algorithms.
- * @ingroup DTMAlgorithms
- */ 
- 
-/**
- * @defgroup DTMAux DTM auxiliary classes/methods.
- * @ingroup DTMModule
- */    
-
-/**
- * @file TeDTMDefines.hpp
- * @brief This file contains a set of definitions used by DTM module.
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- */
-
-#ifndef TEDTMDEFINES_HPP
-  #define TEDTMDEFINES_HPP
-
-/** @defgroup DTM_AS_DLL macros.
-  @{
- */
-#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
-
-#if defined(_MSC_VER) /* MSVC Compiler */
-#pragma warning(disable: 4251)
-#endif
-
-#ifdef DTM_AS_DLL
-#define DTM_DLL __declspec(dllexport)
-#else
-#define DTM_DLL __declspec(dllimport)
-#endif
-
-#else
-#define DTM_DLL
-#endif
-/** @} */ 
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+/**
+ * @defgroup DTMModule DTM Processing.
+ */  
+ 
+/**
+ * @defgroup DTMAlgorithms DTM Processing Algorithms.
+ * @ingroup DTMModule
+ */ 
+ 
+/**
+ * @defgroup TeDTMGeneralAlgoGroup General purpose DTM algorithms.
+ * @ingroup DTMAlgorithms
+ */ 
+ 
+/**
+ * @defgroup DTMAux DTM auxiliary classes/methods.
+ * @ingroup DTMModule
+ */    
+
+/**
+ * @file TeDTMDefines.hpp
+ * @brief This file contains a set of definitions used by DTM module.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ */
+
+#ifndef TEDTMDEFINES_HPP
+  #define TEDTMDEFINES_HPP
+
+/** @defgroup DTM_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef DTM_AS_DLL
+#define DTM_DLL __declspec(dllexport)
+#else
+#define DTM_DLL __declspec(dllimport)
+#endif
+
+#else
+#define DTM_DLL
+#endif
+/** @} */ 
+
+#endif
diff --git a/src/terralib/dtm/TeDTMParameters.cpp b/src/terralib/dtm/TeDTMParameters.cpp
old mode 100755
new mode 100644
index f5a500e..d3a7edc
--- a/src/terralib/dtm/TeDTMParameters.cpp
+++ b/src/terralib/dtm/TeDTMParameters.cpp
@@ -1,12 +1,12 @@
-#include "TeDTMParameters.h"
-
-
-TeDTMParameters::TeDTMParameters()
-{
-}
-
-
-TeDTMParameters::~TeDTMParameters()
-{
-}
-
+#include "TeDTMParameters.h"
+
+
+TeDTMParameters::TeDTMParameters()
+{
+}
+
+
+TeDTMParameters::~TeDTMParameters()
+{
+}
+
diff --git a/src/terralib/dtm/TeDTMParameters.h b/src/terralib/dtm/TeDTMParameters.h
old mode 100755
new mode 100644
index 6073cd5..5828816
--- a/src/terralib/dtm/TeDTMParameters.h
+++ b/src/terralib/dtm/TeDTMParameters.h
@@ -1,64 +1,64 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-/**
- *  @brief This file contains the class of structures and definitions
- *   to deal with parameters used by all DTM classes.
- */
-
-#ifndef TEDTMPARAMETERS_HPP
-  #define TEDTMPARAMETERS_HPP
-
-  #include <TeDTMDefines.h>
-  #include <TeMultiContainer.h>
-  
-  #include <string>
-
-  /**
-  * @brief This is the class to deal with parameters used by all DTM classes.
-  * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-  * @ingroup DTMAux
-  @note Do not use this class with polymorphic types !!
-  */
-  class DTM_DLL TeDTMParameters : public 
-    TeMultiContainer< std::string >
-  {
-    public :
-    
-      /**
-       * @brief Default Constructor
-       */
-      TeDTMParameters();
-      
-      /**
-       * @brief  Default Destructor
-       */
-      ~TeDTMParameters();
-  };
-
-/** @example TeDTMParameters_test.cpp
- *    Shows how to use this class.
- */  
-
-#endif //TEDTMPARAMETERS_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+/**
+ *  @brief This file contains the class of structures and definitions
+ *   to deal with parameters used by all DTM classes.
+ */
+
+#ifndef TEDTMPARAMETERS_HPP
+  #define TEDTMPARAMETERS_HPP
+
+  #include <TeDTMDefines.h>
+  #include <TeMultiContainer.h>
+  
+  #include <string>
+
+  /**
+  * @brief This is the class to deal with parameters used by all DTM classes.
+  * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+  * @ingroup DTMAux
+  @note Do not use this class with polymorphic types !!
+  */
+  class DTM_DLL TeDTMParameters : public 
+    TeMultiContainer< std::string >
+  {
+    public :
+    
+      /**
+       * @brief Default Constructor
+       */
+      TeDTMParameters();
+      
+      /**
+       * @brief  Default Destructor
+       */
+      ~TeDTMParameters();
+  };
+
+/** @example TeDTMParameters_test.cpp
+ *    Shows how to use this class.
+ */  
+
+#endif //TEDTMPARAMETERS_HPP
diff --git a/src/terralib/functions/TeAddressLocator.cpp b/src/terralib/functions/TeAddressLocator.cpp
old mode 100755
new mode 100644
index 20b0e06..f596c22
--- a/src/terralib/functions/TeAddressLocator.cpp
+++ b/src/terralib/functions/TeAddressLocator.cpp
@@ -1,3357 +1,3357 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*
- * TODO: 1. Usar os 5 primeiros d�gitos do CEP para desempatar, pois eles levam 
- *          ao bairro.
- */
-
-#include "TeAddressLocator.h"
-#include "TeUtils.h"
-
-#include "TeProgress.h"
-#include "TeAsciiFile.h"
-#include "TeVectorRemap.h"
-
-#include <string>
-
-using namespace std;
-
-double TeSimilarity(const char* streetname, const char* rotuloname);
-
-void validColumnName(TeAttributeRep& rep, TeAttributeList& attrList)
-{
-	unsigned int nStep = attrList.size();
-
-	string repName = TeConvertToUpperCase(rep.name_);
-
-	bool alter = true;
-
-	while(alter)
-	{
-		alter = false;
-
-		for(unsigned int i = 0; i < nStep; ++i)
-		{
-			if(TeConvertToUpperCase(attrList[i].rep_.name_) == repName)
-			{
-				rep.name_ += "_";
-				alter = true;
-				repName = TeConvertToUpperCase(rep.name_);
-			}
-		}
-	}
-}
-
-void tokenize(const string& name, vector<string>& tokens)
-{
-	unsigned int nStep = name.size();
-
-	string token = "";
-
-	unsigned int i = 0;
-
-	for(i = 0; i < nStep; ++i)
-	{
-		if(name[i] != ' ')
-			token += name[i];
-		else
-		{
-			if(!token.empty())
-			{
-				tokens.push_back(token);
-				token = "";
-			}
-		}		
-	}
-
-	if(!token.empty())
-		tokens.push_back(token);
-}
-
-//---- TeAddressLocator methods
-
-bool TeAddressLocator::createAddressMetadataTable(void)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	if(db_->tableExist("te_address_locator"))
-	{
-		// Verificar se a coluna com o nome completo existe.
-		// Nas vers�es anteriores essa coluna n�o era usada.
-
-		TeAttribute attr;
-
-		if(!db_->columnExist("te_address_locator", "location_full_name", attr))
-		{
-			// Se a coluna n�o existe, tenta adicionar a coluna � tabela de metadado
-			TeAttribute at10;
-			at10.rep_.type_ = TeSTRING;
-			at10.rep_.name_ = "location_full_name";
-			at10.rep_.numChar_ = 255;
-
-			if(!db_->addColumn("te_address_locator", at10.rep_))
-			{
-				errMsg_ = "Couldn't add location_full_name column to te_address_locator table!";
-
-				return false;
-			}			
-		}
-
-
-		errMsg_ = "The te_address_locator table already exist!";
-
-		return false;
-	}
-	
-	TeAttributeList attList;
-
-	TeAttribute at1;
-	at1.rep_.type_ = TeINT;
-	at1.rep_.name_ = "table_id";
-	at1.rep_.isPrimaryKey_ = true;
-	at1.rep_.isAutoNumber_ = false;
-	attList.push_back(at1);	
-
-	TeAttribute at2;
-	at2.rep_.type_ = TeSTRING;
-	at2.rep_.name_ = "initial_left_number";
-	at2.rep_.numChar_ = 255;
-	attList.push_back(at2);	
-
-	TeAttribute at3;
-	at3.rep_.type_ = TeSTRING;
-	at3.rep_.name_ = "final_left_number";
-	at3.rep_.numChar_ = 255;
-	attList.push_back(at3);	
-
-	TeAttribute at4;
-	at4.rep_.type_ = TeSTRING;
-	at4.rep_.name_ = "initial_right_number";
-	at4.rep_.numChar_ = 255;
-	attList.push_back(at4);	
-
-	TeAttribute at5;
-	at5.rep_.type_ = TeSTRING;
-	at5.rep_.name_ = "final_right_number";
-	at5.rep_.numChar_ = 255;
-	attList.push_back(at5);
-
-	TeAttribute at6;
-	at6.rep_.type_ = TeSTRING;
-	at6.rep_.name_ = "location_type";
-	at6.rep_.numChar_ = 255;
-	attList.push_back(at6);
-
-	TeAttribute at7;
-	at7.rep_.type_ = TeSTRING;
-	at7.rep_.name_ = "location_title";
-	at7.rep_.numChar_ = 255;
-	attList.push_back(at7);
-
-	TeAttribute at8;
-	at8.rep_.type_ = TeSTRING;
-	at8.rep_.name_ = "location_preposition";
-	at8.rep_.numChar_ = 255;
-	attList.push_back(at8);
-
-	TeAttribute at9;
-	at9.rep_.type_ = TeSTRING;
-	at9.rep_.name_ = "location_name";
-	at9.rep_.numChar_ = 255;
-	attList.push_back(at9);
-
-	TeAttribute at10;
-	at10.rep_.type_ = TeSTRING;
-	at10.rep_.name_ = "location_full_name";
-	at10.rep_.numChar_ = 255;
-	attList.push_back(at10);
-
-
-	TeAttribute at11;
-	at11.rep_.type_ = TeSTRING;
-	at11.rep_.name_ = "left_neighborhood";
-	at11.rep_.numChar_ = 255;
-	attList.push_back(at11);
-
-	TeAttribute at12;
-	at12.rep_.type_ = TeSTRING;
-	at12.rep_.name_ = "right_neighborhood";
-	at12.rep_.numChar_ = 255;
-	attList.push_back(at12);
-
-	TeAttribute at13;
-	at13.rep_.type_ = TeSTRING;
-	at13.rep_.name_ = "left_zip_code";
-	at13.rep_.numChar_ = 255;
-	attList.push_back(at13);
-
-	TeAttribute at14;
-	at14.rep_.type_ = TeSTRING;
-	at14.rep_.name_ = "right_zip_code";
-	at14.rep_.numChar_ = 255;
-	attList.push_back(at14);
-
-	if(!db_->createTable("te_address_locator", attList))
-	{
-		errMsg_ = "Could not create te_address_locator table!";
-
-		return false;
-	}
-
-	if(!db_->createRelation("address_locator_relation", "te_address_locator", "table_id", "te_layer_table", "table_id", true))
-	{
-		errMsg_ = "Referential integrity could not be stabilished beteween te_address_locator and te_layer_table tables!";
-	
-		return false;
-	}
-
-	return true;
-}
-
-bool TeAddressLocator::insertAddressMetadata(const TeAddressMetadata& metadata)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	string sql  = "INSERT INTO te_address_locator (table_id, initial_left_number, ";
-	       sql += "final_left_number, initial_right_number, final_right_number, ";
-		   sql += "location_type, location_title, location_preposition, location_name, location_full_name, left_neighborhood, right_neighborhood, ";
-		   sql += "left_zip_code, right_zip_code) VALUES(";
-		   sql += Te2String(metadata.tableId_);
-		   sql += ", '";
-		   sql += metadata.initialLeftNumber_;
-		   sql += "', '";
-		   sql += metadata.finalLeftNumber_;
-		   sql += "', '";
-		   sql += metadata.initialRightNumber_;
-		   sql += "', '";
-		   sql += metadata.finalRightNumber_;
-		   sql += "', '";
-		   sql += metadata.locationType_;
-		   sql += "', '";
-		   sql += metadata.locationTitle_;
-		   sql += "', '";
-		   sql += metadata.locationPreposition_;
-		   sql += "', '";
-		   sql += metadata.locationName_;
-		   sql += "', '";
-		   sql += metadata.locationCompleteName_;
-		   sql += "', '";
-		   sql += metadata.leftNeighborhood_;
-		   sql += "', '";
-		   sql += metadata.rightNeighborhood_;
-		   sql += "', '";
-		   sql += metadata.leftZipCode_;
-		   sql += "', '";
-		   sql += metadata.rightZipCode_;
-		   sql += "')";
-
-	if(!db_->execute(sql))
-	{
-		errMsg_ = "Could not insert metadata information about geocoding base table!";
-
-		return false;
-	}	
-
-	return loadAddressMetadata(metadata.tableId_);
-	
-	//if(!metadata.leftZipCode_.empty())
-	//	removeHifen_ = verifyHifen(metadata_.tableName_, metadata.leftZipCode_);
-
-	//return true;
-}
-
-bool TeAddressLocator::updateAddressMetadata(const TeAddressMetadata& metadata)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	//if(metadata_.tableId_ != metadata.tableId_)
-	//	return false;	// Doesn't update a diferent attribute table....
-
-	string sql  = "UPDATE te_address_locator SET initial_left_number = '";
-	       sql += metadata.initialLeftNumber_;
-		   sql += "', final_left_number = '";
-		   sql += metadata.finalLeftNumber_;
-		   sql += "', initial_right_number = '";
-		   sql += metadata.initialRightNumber_;
-		   sql += "', final_right_number = '";
-		   sql += metadata.finalRightNumber_;
-		   sql += "', location_type = '";
-		   sql += metadata.locationType_;
-		   sql += "', location_title = '";
-		   sql += metadata.locationTitle_;
-		   sql += "', location_preposition = '";
-		   sql += metadata.locationPreposition_;
-		   sql += "', location_name = '";
-		   sql += metadata.locationName_;
-		   sql += "', location_full_name = '";
-		   sql += metadata.locationCompleteName_;
-		   sql += "', left_neighborhood = '";
-		   sql += metadata.leftNeighborhood_;
-		   sql += "', right_neighborhood = '";
-		   sql += metadata.rightNeighborhood_;
-		   sql += "', left_zip_code = '";
-		   sql += metadata.leftZipCode_;
-		   sql += "', right_zip_code = '";
-		   sql += metadata.rightZipCode_;
-		   sql += "' WHERE table_id = ";
-		   sql += Te2String(metadata.tableId_);	
-
-	if(!db_->execute(sql))
-	{
-		errMsg_ = "Could not update metadata information about geocoding base table!";
-
-		return false;
-	}
-
-	return loadAddressMetadata(metadata.tableId_);
-
-	//if(!metadata.leftZipCode_.empty())
-	//	removeHifen_ = verifyHifen(metadata_.tableName_, metadata.leftZipCode_);	
-
-	//return true;
-}
-
-bool TeAddressLocator::deleteAddressMetadata(const int& tableId)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	string sql  = "DELETE FROM te_address_locator WHERE table_id = ";
-	       sql += Te2String(tableId);
-
-	if(db_->execute(sql))
-		return true;
-	else
-	{
-		errMsg_ = "Could not remove metadata information about geocoding base table!";
-
-		return false;
-	}
-}
-
-bool TeAddressLocator::loadAddressMetadata(const int& tableId)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	isMetadataLoaded_ = false;
-
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return false;
-
-	string sql  = "SELECT te_address_locator.*, te_layer_table.attr_table, te_layer_table.attr_link, te_layer.layer_id";
-		   sql += "  FROM te_address_locator, te_layer_table, te_layer ";
-		   sql += " WHERE  te_layer_table.layer_id = te_layer.layer_id ";
-		   sql += "        AND ";
-		   sql += "        te_address_locator.table_id = te_layer_table.table_id ";
-		   sql += "        AND ";
-		   sql += "        te_address_locator.table_id = ";
-	       sql += Te2String(tableId);
-
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-
-		errMsg_ = "Could not find metadata for geocoding base table!";
-
-		return false;
-	}
-
-	fillAddressMetadata(metadata_, portal);
-
-	int layerId = portal->getInt("layer_id");
-
-	referenceLayer_ = db_->layerMap()[layerId];
-
-	delete portal;
-
-	if(referenceLayer_ == 0)
-	{
-		errMsg_ = "Could not find infolayer to be used as base for geocoding!";
-				
-		return false;
-	}
-
-	isMetadataLoaded_ = true;
-
-
-	if(!metadata_.leftZipCode_.empty())
-		removeHifen_ = !verifyHifen(metadata_.tableName_, metadata_.leftZipCode_);
-
-	return true;
-}
-
-bool TeAddressLocator::setAddressLocatorMetadata(const TeAddressMetadata& m)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return false;
-
-	string sql  = "SELECT te_layer.layer_id";
-		   sql += "  FROM te_layer_table, te_layer ";
-		   sql += " WHERE te_layer_table.layer_id = te_layer.layer_id ";
-		   sql += "       AND ";
-		   sql += "       te_layer_table.table_id = ";
-	       sql += Te2String(m.tableId_);
-
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-
-		errMsg_ = "Could not find layer for geocoding base table!";
-
-		return false;
-	}
-
-	int layerId = portal->getInt("layer_id");
-
-	referenceLayer_ = db_->layerMap()[layerId];
-
-	if(referenceLayer_ == 0)
-	{
-		errMsg_ = "Could not find infolayer to be used as base for geocoding!";
-				
-		return false;
-	}
-
-	metadata_ = m;
-
-	isMetadataLoaded_ = true;
-
-	if(!metadata_.leftZipCode_.empty())
-		removeHifen_ = !verifyHifen(metadata_.tableName_, metadata_.leftZipCode_);
-
-	return true;
-}
-
-bool TeAddressLocator::getAllAddressMetadataLayer(const int& layerId, vector<TeAddressMetadata>& addVec)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return false;
-
-	string sql  = "SELECT te_address_locator.*, te_layer_table.attr_table, te_layer_table.attr_link, te_layer.layer_id ";
-		   sql += "  FROM te_address_locator, te_layer_table, te_layer ";
-		   sql += " WHERE te_layer_table.layer_id = te_layer.layer_id ";
-		   sql += "       AND ";
-		   sql += "       te_address_locator.table_id = te_layer_table.table_id ";
-		   sql += "       AND ";
-		   sql += "       te_layer_table.layer_id = "; 
-	       sql += Te2String(layerId);
-		   sql += " ORDER BY te_layer_table.table_id";
-
-	if(!portal->query(sql))
-	{
-		delete portal;
-
-		return false;
-	}
-
-	while(portal->fetchRow())
-	{
-		TeAddressMetadata m;
-
-		this->fillAddressMetadata(m, portal);		
-
-		addVec.push_back(m);
-	}
-
-	delete portal;
-
-	return true;
-}
-
-bool TeAddressLocator::getAllAddressMetadataTheme(const int& themeId, vector<TeAddressMetadata>& addVec)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return false;
-
-	string sql  = "SELECT te_address_locator.*, te_layer_table.attr_table, te_layer_table.attr_link, te_layer.layer_id";
-	       sql += "  FROM te_theme_table, te_layer_table, te_address_locator, te_layer ";
-		   sql += " WHERE te_layer_table.layer_id = te_layer.layer_id ";
-		   sql += "       AND ";
-		   sql += "       te_layer_table.table_id = te_address_locator.table_id ";
-		   sql += "       AND ";
-		   sql += "       te_theme_table.table_id = te_layer_table.table_id "; 
-		   sql += "       AND ";
-		   sql += "       te_theme_table.theme_id = ";
-	       sql += Te2String(themeId);
-		   sql += " ORDER BY te_theme_table.table_id";
-
-	if(!portal->query(sql))
-	{
-		delete portal;
-
-		return false;
-	}
-
-	while(portal->fetchRow())
-	{
-		TeAddressMetadata m;
-
-		this->fillAddressMetadata(m, portal);		
-
-		addVec.push_back(m);
-	}
-
-	delete portal;
-
-	return true;
-}
-
-bool TeAddressLocator::getAddressLocatorLayers(vector<pair<int, string> >& layerNameVec)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return false;
-
-	string sql  = "SELECT DISTINCT te_layer.layer_id, te_layer.name ";
-	       sql += "  FROM te_address_locator, te_layer_table, te_layer ";
-		   sql += " WHERE te_layer.layer_id = te_layer_table.layer_id ";
-		   sql += "       AND ";
-		   sql += "       te_address_locator.table_id = te_layer_table.table_id "; 
-		   sql += " ORDER BY te_layer.name ASC";
-
-	if(!portal->query(sql))
-	{
-		delete portal;
-
-		return false;
-	}
-
-	while(portal->fetchRow())
-	{
-		pair<int, string> d(atoi(portal->getData(0)), portal->getData(1));
-		layerNameVec.push_back(d);
-	}
-
-	delete portal;
-
-	return true;
-}
-
-bool TeAddressLocator::getAddressLocatorLayerTables(vector<pair<int, string> >& tableNameVec, const int& layerId)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return false;
-
-	string sql  = "SELECT te_layer_table.table_id, te_layer_table.attr_table ";
-	       sql += "  FROM te_address_locator, te_layer_table ";
-		   sql += " WHERE te_layer_table.table_id = te_address_locator.table_id";
-		   sql += "       AND ";
-		   sql += "       te_layer_table.layer_id = ";
-		   sql += Te2String(layerId);
-		   sql += " ORDER BY te_layer_table.attr_table ASC";
-
-	if(!portal->query(sql))
-	{
-		delete portal;
-
-		return false;
-	}
-
-	while(portal->fetchRow())
-	{
-		pair<int, string> d(atoi(portal->getData(0)), portal->getData(1));
-		tableNameVec.push_back(d);
-	}
-
-	delete portal;
-
-	return true;
-}
-
-bool TeAddressLocator::findGeocodingTables(vector<pair<int, string> >& tableNames)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	string sql  = "SELECT * FROM te_layer_table WHERE attr_table_type = ";
-	       sql += Te2String(TeGeocodingData);
-		   sql += " ORDER BY attr_table";
-
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return false;	
-
-	if(!portal->query(sql))
-	{
-		delete portal;
-
-		return false;
-	}
-
-	while(portal->fetchRow())
-	{
-		pair<int, string> d(atoi(portal->getData("table_id")), portal->getData("attr_table"));
-		tableNames.push_back(d);
-	}
-
-	delete portal;
-
-	return true;
-}
-
-
-// 8    -> Found by similar search
-// 9    -> Found by neighborhood or zip code
-
-// 10	 -> Found by name location and number without type
-// 11	 -> Found multiples by name location and number  without type
-// 12	 -> Found by name location without number and type
-// 13	 -> Found multiples by name location without number and type
-
-// 14	 -> Found by name location and number without type and title
-// 15	 -> Found multiples by name location and number  without type and title
-// 16	 -> Found by name location without number and type and title
-// 17	 -> Found multiples by name location without number and type and title
-
-// 18	 -> Found by name location and number without type, title and preposition
-// 19	 -> Found multiples by name location and number  without type, title and preposition
-// 20	 -> Found by name location without number and type, title and preposition
-// 21	 -> Found multiples by name location without number and type, title and preposition
-
-
-
-int TeAddressLocator::findAddress(const TeAddress& address, vector<TeAddressDescription>& addressesFound, const bool& doExaustiveSearch)
-{
-	TeAddress addAux = address;
-
-	string fullName = "";
-
-	normalizeAddress(addAux, fullName);
-
-	if(fullName.empty())
-		return 2;
-
-	// Encontra exato com n�mero
-	int result = findExact(addAux, fullName, true, addressesFound);
-
-	if(result > 3)
-		return result;
-
-	// Encontra exato sem n�mero
-	result = findExact(addAux, fullName, false, addressesFound);
-
-	if(result > 3)
-		return result;
-
-	// Encontrar com a ajuda do dicion�rio sem n�mero
-	if(!dictionary_.empty())
-	{
-		// Dicion�rio com n�mero
-		result = findWithDictionary(addAux, fullName, true, addressesFound);
-
-		if(result > 3)
-			return result;
-
-
-		// Dicion�rio sem n�mero
-		result = findWithDictionary(addAux, fullName, false, addressesFound);
-
-		if(result > 3)
-			return result;
-	}
-
-	// ***********************************
-	// * Try to search by a similar name *
-	// ***********************************
-	TeAddressDescription descript;
-
-	if((addAux.locationNumber_ != 0) && findSimilarAddress(addAux, fullName, descript))
-	{
-		addressesFound.clear();
-		addressesFound.push_back(descript);
-
-		return 8;
-	}
-
-	if(doExaustiveSearch)
-	{
-		// Tenta remover o tipo
-		if(!typesVector_.empty())
-		{
-			result = findWithoutAllName(addAux, fullName, addressesFound, true);
-
-			switch(result)
-			{
-				case 4 :	return 10;
-				case 5 :	return 11;
-				case 6 :    return 12;
-				case 7 :    return 13;
-			}
-		}
-
-
-		// Tenta remover titulo
-		if(!titlesVector_.empty())
-		{
-			result = findWithoutAllName(addAux, fullName, addressesFound, true, true);
-
-			switch(result)
-			{
-				case 4 :	return 14;
-				case 5 :	return 15;
-				case 6 :    return 16;
-				case 7 :    return 17;
-			}
-		}
-
-
-		// Tenta remover preposicao
-		if(!prepositionsVector_.empty())
-		{
-			result = findWithoutAllName(addAux, fullName, addressesFound, true, true, true);
-
-			switch(result)
-			{
-				case 4 :	return 18;
-				case 5 :	return 19;
-				case 6 :    return 20;
-				case 7 :    return 21;
-			}
-		}
-	}
-
-	
-	// *****************************************
-	// * Try to match zip code or neighborhood *
-	// *****************************************
-	if(cmetadata_.centroidLayer_)
-	{
-		if(findByCentroid(addAux, addressesFound))
-		{
-			if(addressesFound.size() > 1)
-				return 1;
-			else
-				return 9;
-		}
-	}
-
-	return result;
-}
-
-
-int TeAddressLocator::findWithDictionary(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound)
-{
-	// Quebrar o nome em tokens
-	vector<string> tokens;
-	tokenize(fullName, tokens);
-
-
-	// Para cada token, procurar um sin�nimo
-	for(unsigned int i = 0; i < tokens.size(); ++i)
-	{
-		pair<TeGeocoderDictionary::iterator, TeGeocoderDictionary::iterator> itRange = dictionary_.equal_range(tokens[i]);
-
-		while(itRange.first != itRange.second)
-		{
-			// Monta o nome para pesquisa
-			string str = "";
-
-			for(unsigned int j = 0; j < tokens.size(); ++j)
-			{
-				if(j != 0)
-					str += " ";
-
-				if(j == i)
-					str += (itRange.first)->second;
-				else
-					str += tokens[j];
-			}
-
-			// Fazer a pesquisa exata
-			int res = findExact(address, str, withNumber, addressesFound);
-
-			if(res > 3)
-				return res;
-
-			++(itRange.first);
-		}
-	}
-
-	return 1;
-}
-
-int TeAddressLocator::findWithoutAllName(const TeAddress& address, const string& fullName, vector<TeAddressDescription>& addressesFound, const bool& disabletype, const bool& disabletitle, const bool& disablepreposition)
-{
-	// Quebrar o nome em tokens
-	vector<string> tokens;
-	tokenize(fullName, tokens);
-
-	string str = "";
-
-	bool typeYetDisabled = false;
-	bool titleYetDisabled = false;
-	bool prepositionYetDisabled = false;
-
-	unsigned int i = 0;
-
-	// Ve se precisa eliminar algum token e j� tenta sem usar dicion�rio
-	for(i = 0; i < tokens.size(); ++i)
-	{
-		string aux = tokens[i];
-
-		// verifica se o string ser� eliminado caso o tipo esteja desabilitado
-		if(disabletype)
-		{
-			if(binary_search(typesVector_.begin(), typesVector_.end(), aux))
-			{
-				aux = "";
-				typeYetDisabled = true;
-				continue;
-			}
-		}
-
-		if(disabletitle)
-		{
-			if(binary_search(titlesVector_.begin(), titlesVector_.end(), aux))
-			{
-				aux = "";
-				titleYetDisabled = true;
-				continue;
-			}
-
-		}
-
-		if(disablepreposition && !prepositionYetDisabled)
-		{
-			if(binary_search(prepositionsVector_.begin(), prepositionsVector_.end(), aux))
-			{
-				aux = "";
-				prepositionYetDisabled = true;
-				continue;
-			}
-		}
-
-		if(!str.empty())
-			str += " ";
-
-		str += aux;
-	}
-
-	int res = 1;
-
-	if(typeYetDisabled || titleYetDisabled || prepositionYetDisabled)
-	{
-		res = findPattern(address, str, true, addressesFound, disabletype, disabletitle, disablepreposition);
-
-		if(res > 3)
-			return res;
-	}
-
-	if(typeYetDisabled || titleYetDisabled || prepositionYetDisabled)
-	{
-		res = findPattern(address, str, false, addressesFound, disabletype, disabletitle, disablepreposition);
-
-		if(res > 3)
-			return res;
-	}
-
-	if(dictionary_.empty())
-		return 1;
-
-	// Para cada token, procurar um sin�nimo
-	for(i = 0; i < tokens.size(); ++i)
-	{
-		pair<TeGeocoderDictionary::iterator, TeGeocoderDictionary::iterator> itRange = dictionary_.equal_range(tokens[i]);
-
-
-		while(itRange.first != itRange.second)
-		{
-			// Monta o nome para pesquisa
-			str = "";
-			typeYetDisabled = false;
-			titleYetDisabled = false;
-			prepositionYetDisabled = false;
-
-
-			for(unsigned int j = 0; j < tokens.size(); ++j)
-			{
-				string aux = "";
-
-				if(j == i)
-				{
-					aux = (itRange.first)->second;
-				}
-				else
-				{
-					aux = tokens[j];
-				}
-
-				// verifica se o string ser� eliminado caso o tipo esteja desabilitado
-				if(disabletype)
-				{
-					if(binary_search(typesVector_.begin(), typesVector_.end(), aux))
-					{
-						aux = "";
-						typeYetDisabled = true;
-						continue;
-					}
-				}
-
-				if(disabletitle)
-				{
-					if(binary_search(titlesVector_.begin(), titlesVector_.end(), aux))
-					{
-						aux = "";
-						titleYetDisabled = true;
-						continue;
-					}
-
-				}
-
-				if(disablepreposition && !prepositionYetDisabled)
-				{
-					if(binary_search(prepositionsVector_.begin(), prepositionsVector_.end(), aux))
-					{
-						aux = "";
-						prepositionYetDisabled = true;
-						continue;
-					}
-				}
-
-				if(!str.empty())
-					str += " ";
-
-				str += aux;
-			}
-
-			if(typeYetDisabled || titleYetDisabled || prepositionYetDisabled)
-			{
-				res = findPattern(address, str, true, addressesFound, disabletype, disabletitle, disablepreposition);
-
-				if(res > 3)
-					return res;
-			}
-
-			if(typeYetDisabled || titleYetDisabled || prepositionYetDisabled)
-			{
-				res = findPattern(address, str, false, addressesFound, disabletype, disabletitle, disablepreposition);
-
-				if(res > 3)
-					return res;
-			}
-
-			++(itRange.first);
-		}
-	}
-
-	return 1;
-}
-
-// 0	 -> Database connection problem
-// 1     -> Address not found
-// 3     -> Error on query the database
-// 4	 -> Found by name location and number
-// 5	 -> Found multiples by name location and number
-// 6	 -> Found by name location without number 
-// 7	 -> Found multiples by name location without number
-int TeAddressLocator::findExact(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound)
-{
-	TeAddress addressToFind = address;
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return 0;
-	}
-
-	// The status of a query
-	bool executeQuery = false;
-
-	// String with the result query expression
-	string strSQL = "";
-
-	// String with the select...from clause
-	string strSelect  = "SELECT * FROM ";
-	       strSelect += metadata_.tableName_;
-		   
-	// String with the where clause;
-	string strWhere = " WHERE ";
-
-	// **************************************************
-	// * Try to match name an number                    *
-	// **************************************************		
-	{
-		int auxNumber = addressToFind.locationNumber_ ;
-
-		if(!withNumber)
-			addressToFind.locationNumber_ = 0;
-
-		strWhere += mountExactWhereSQL(addressToFind, fullName);
-
-		strSQL = strSelect + strWhere;
-
-		queryAddresses(strSQL, executeQuery, addressesFound);
-
-		if(addressesFound.size() > 0)
-		{
-			if((addressesFound.size() > 1) && (!addressToFind.zipCode_.empty()))
-				this->refineFoundedLocationsByZipCode(addressToFind, addressesFound);
-
-			if((addressesFound.size() > 1) && (!addressToFind.neighborhood_.empty()))
-				this->refineFoundedLocationsByNeighBorhood(addressToFind, addressesFound);
-
-			if((addressesFound.size() > 1) && (!metadata_.leftZipCode_.empty() || !metadata_.rightZipCode_.empty()) && (addressToFind.locationNumber_ == 0))
-			{
-				addressToFind.locationNumber_ = auxNumber;
-
-				refineFoundedLocationsByNumberZipCode(addressToFind, addressesFound);
-
-				addressToFind.locationNumber_ = 0;
-			}
-			else if((addressesFound.size() > 1) && (addressToFind.locationNumber_ == 0))
-			{
-				addressToFind.locationNumber_ = auxNumber;
-
-				refineFoundedLocationsByNumberNeighboor(addressToFind, addressesFound);
-
-				addressToFind.locationNumber_ = 0;
-			}
-
-	
-			if(addressesFound.size() > 1)
-			{
-				if(addressToFind.locationNumber_ == 0)
-					return 7;
-				else
-					return 5;							
-			}
-			else
-			{
-				if(addressToFind.locationNumber_ == 0)
-					return 6;
-				else
-					return 4;
-			}
-		}
-	}
-
-	// ***************************************************************************
-	// * If we are here so we did not find any address or the queries were wrong *
-	// ***************************************************************************
-	if(executeQuery)
-		return 1;	// If at leat one query was executed, return not found any address
-	else
-		return 3;	// Otherwise return an error on all queries
-}
-
-int TeAddressLocator::findPattern(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound, const bool& disabletype, const bool& disabletitle, const bool& disablepreposition)
-{
-	TeAddress addressToFind = address;
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return 0;
-	}
-
-	// The status of a query
-	bool executeQuery = false;
-
-	// String with the result query expression
-	string strSQL = "";
-
-	// String with the select...from clause
-	string strSelect  = "SELECT * FROM ";
-	       strSelect += metadata_.tableName_;
-		   
-	// String with the where clause;
-	string strWhere = " WHERE ";
-
-	// **************************************************
-	// * Try to match name an number                    *
-	// **************************************************		
-	{
-		int auxNumber = addressToFind.locationNumber_ ;
-
-		if(!withNumber)
-			addressToFind.locationNumber_ = 0;
-
-		if(!metadata_.locationType_.empty() || !metadata_.locationTitle_.empty() || !metadata_.locationPreposition_.empty())
-			strWhere += mountPatternWhereSQL(addressToFind, fullName, disabletype, disabletitle, disablepreposition);
-		else
-			strWhere += mountLikeWhereSQL(addressToFind, fullName);
-
-		strSQL = strSelect + strWhere;
-
-		queryAddresses(strSQL, executeQuery, addressesFound);
-
-		if(addressesFound.size() > 0)
-		{
-			if(!metadata_.locationType_.empty() || !metadata_.locationTitle_.empty() || !metadata_.locationPreposition_.empty())
-				cleanAddressesFound(fullName, addressesFound, disabletype, disabletitle, disablepreposition);
-
-			if(addressesFound.size() > 0)
-			{
-				if((addressesFound.size() > 1) && (!addressToFind.zipCode_.empty()))
-					this->refineFoundedLocationsByZipCode(addressToFind, addressesFound);
-
-				if((addressesFound.size() > 1) && (!addressToFind.neighborhood_.empty()))
-					this->refineFoundedLocationsByNeighBorhood(addressToFind, addressesFound);
-
-				if((addressesFound.size() > 1) && (!metadata_.leftZipCode_.empty() || !metadata_.rightZipCode_.empty()) && (addressToFind.locationNumber_ == 0))
-				{
-					addressToFind.locationNumber_ = auxNumber;
-
-					refineFoundedLocationsByNumberZipCode(addressToFind, addressesFound);
-
-					addressToFind.locationNumber_ = 0;
-				}
-				else if((addressesFound.size() > 1) && (addressToFind.locationNumber_ == 0))
-				{
-					addressToFind.locationNumber_ = auxNumber;
-
-					refineFoundedLocationsByNumberNeighboor(addressToFind, addressesFound);
-
-					addressToFind.locationNumber_ = 0;
-				}
-
-		
-				if(addressesFound.size() > 1)
-				{
-					if(addressToFind.locationNumber_ == 0)
-						return 7;
-					else
-						return 5;							
-				}
-				else
-				{
-					if(addressToFind.locationNumber_ == 0)
-						return 6;
-					else
-						return 4;
-				}
-			}
-		}
-	}
-
-	// ***************************************************************************
-	// * If we are here so we did not find any address or the queries were wrong *
-	// ***************************************************************************
-	if(executeQuery)
-		return 1;	// If at leat one query was executed, return not found any address
-	else
-		return 3;	// Otherwise return an error on all queries
-}
-
-
-bool TeAddressLocator::addressGeocode(TeGeocodeTableMetadata& tableMetadata, 
-									  const string& newLayerName, 
-									  const string& reportName, 
-									  const string& reportDir, 
-									  const bool& doExaustive, 
-									  TeAbstractAddressNotifyFunctor* /* notifyFunction */)
-{
-	errMsg_ = "";
-
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return 0;
-	}
-
-	if(tableMetadata.locationNameColumnName_.empty())
-	{
-		errMsg_ = "The name field must be filled!";
-		
-		return false;
-	}
-
-	// Verifica se o metadado para o processo de espacializa��o foi previamente carregado
-	if(!isMetadataLoaded())
-	{
-		errMsg_ = "Load metadata for geocoding layer before!";
-		
-		return false;
-	}
-
-	// Verifica se o metadado para o processo de espacializa��o foi previamente carregado
-	if(metadata_.locationCompleteName_.empty())
-	{
-		errMsg_ = "Please, check the configuration for geocoding layer before! The complete name is empty!";
-		
-		return false;
-	}
-
-
-
-	// Carrega os tipos, preposi��es e t�tulos existentes na base para poder 
-	// realizar substitui��es nos nomes de endere�os no caso da pesquisa alternativa
-	if(!loadAddressCompoundNames())
-	{	
-		return false;
-	}	
-
-	// Verifica se os metadados dos layers foram carregados
-	if(db_->layerMap().empty())
-	{
-		if(!db_->loadLayerSet())
-		{
-			errMsg_ = "Could not load infolayers metadata!";
-		
-			return false;
-		}
-	}
-
-	// Verifica se j� existe um layer com o nome escolhido
-	if(db_->layerExist(newLayerName))
-	{
-		errMsg_ = "There is another infolayer with the same name!";
-		
-		return false;
-	}
-
-	// Tenta acrescentar as duas colunas de relat�rio
-	pair<string, string> newCols;
-	if(!addReportColumn(tableMetadata, newCols))
-		return false;	
-
-	// Recupera as informa��es da tabela a ser geocodificada
-	if(!findTableMetadata(tableMetadata))
-		return false;
-	
-	// Tenta pegar o portal para a tabela a ser geocodificada
-	int nlo = 0;
-	TeDatabasePortal* portal = getAddressTablePortal(tableMetadata, nlo);
-
-	if(!portal)
-		return false;
-
-	// Cria um novo layer baseado no layer selecionado
-	TeLayer* newLayer = new TeLayer(newLayerName, db_, referenceLayer_->box(), referenceLayer_->projection());
-
-	// Se n�o conseguir criar a representa��o de pontos, aborta a opera��o.
-	if(!newLayer->addGeometry(TePOINTS))
-	{
-		errMsg_ = "Could not add point representation for new layer!";
-
-		db_->deleteLayer(newLayer->id());
-
-		//delete newLayer;
-
-		delete portal;
-		
-		return false;
-	}
-
-	// Navega pelos registros da tabela a ser espacializada determinando os endere�os
-	TePointSet pSet;
-
-	int lo = 0;
-
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(nlo);
-		TeProgress::instance()->setCaption("Address Geocoding");
-		TeProgress::instance()->setMessage("Geocoding addresses...      ");
-	}
-
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-
-	string reportText  = "===> FINAL REPORT OF ADDRESS GEOCODING PROCESS <===\n";
-	       reportText += "     =========================================     \n";
-		   reportText += "\n\n\n";		   
-
-		   reportText += "     ---------------------------------\n\n";
-		   reportText += "SEARCHED ADDRESS|FOUND ADDRESS\n";
-		   reportText += "--------------------------------------------------------------------------------\n";
-		   reportText += "GEOCODING RESULT|UNIQUE ID|TYPE|TITLE|PREPOSITION|LOCATION NAME|NUMBER|NEIGHBOR|ZIPCODE|FOUND ADDRESS====>|UNIQUE ID|TYPE|TITLE|PREPOSITION|LOCATION NAME|INITIAL LEFT|FINAL LEFT|INITIAL RIGHT|FINAL RIGHT|FOUND LEFT NEIGHBOOR|FOUND RIGHT NEIGHBOR|FOUND LEFT ZIPCODE|FOUND RIGHT ZIPCODE\n";
-
-	string reportSummary  = "===> FINAL REPORT OF ADDRESS GEOCODING PROCESS <===\n";
-	       reportSummary += "     =========================================     \n";
-		   reportSummary += "\n\n\n";		   
-
-
-	string reportFileSummary = reportDir + "/" + reportName + "_summary.txt";
-	string reportFile        = reportDir + "/" + reportName + ".txt";	
-
-	TeWriteToFile(reportFile, reportText, "w");
-	TeWriteToFile(reportFileSummary, reportSummary, "w");
-
-	vector<int> summarySum;
-	unsigned int summaryLen = 22;
-	for(unsigned int i = 0; i < summaryLen; ++i)
-		summarySum.push_back(0);
-
-
-	do
-	{
-		if(TeProgress::instance()->wasCancelled())
-		{
-			TeProgress::instance()->reset();
-			errMsg_ = "The process was canceled by user!";
-
-			db_->deleteLayer(newLayer->id());
-
-			delete portal;
-
-			return false;
-		}
-
-		TeAddress add;
-
-		fillAddress(add, tableMetadata, portal);
-
-		++lo;
-
-		vector<TeAddressDescription> addressesFound;
-
-		int status = findAddress(add, addressesFound, doExaustive);
-
-		summarySum[status] = summarySum[status] + 1;
-
-		string reportLine  = Te2String(status);
-		       reportLine += "|";
-
-		// SEARCHED LOCATION
-		reportLine += add.locationLink_;
-		reportLine += "|";
-		reportLine += add.locationType_;
-		reportLine += "|";
-		reportLine += add.locationTitle_;
-		reportLine += "|";
-		reportLine += add.locationPreposition_;
-		reportLine += "|";
-		reportLine += add.locationName_;
-		reportLine += "|";
-		reportLine += Te2String(add.locationNumber_);			
-		reportLine += "|";			
-		reportLine += add.neighborhood_;
-		reportLine += "|";
-		reportLine += add.zipCode_;
-		reportLine += "|***********|";
-
-			
-		if(status >= 4)	// Encontrou algum endere�o?
-		{
-			TeAddressDescription addDescSimilar = addressesFound[0];
-			
-			if(status != 9)
-				findCoordinate(add, addDescSimilar);
-
-			// REPORT LINE
-
-
-			// FOUNDED LOCATION
-			reportLine += addDescSimilar.locationLink_;
-		    reportLine += "|";
-		    reportLine += addDescSimilar.locationType_;
-			reportLine += "|";
-			reportLine += addDescSimilar.locationTitle_;
-			reportLine += "|";
-			reportLine += addDescSimilar.locationPreposition_;
-			reportLine += "|";
-			reportLine += (addDescSimilar.locationName_.empty()) ? addDescSimilar.locationCompleteName_ : addDescSimilar.locationName_ ;
-			reportLine += "|";
-			reportLine += Te2String(addDescSimilar.initialLeftNumber_);
-			reportLine += "|";
-			reportLine += Te2String(addDescSimilar.finalLeftNumber_);
-			reportLine += "|";
-			reportLine += Te2String(addDescSimilar.initialRightNumber_);
-			reportLine += "|";
-			reportLine += Te2String(addDescSimilar.finalRightNumber_);
-			reportLine += "|";
-			reportLine += addDescSimilar.leftNeighborhood_;
-			reportLine += "|";
-			reportLine += addDescSimilar.rightNeighborhood_;
-			reportLine += "|";
-			reportLine += addDescSimilar.leftZipCode_;
-			reportLine += "|";
-			reportLine += addDescSimilar.rightZipCode_;
-			reportLine += "\n";						
-
-			if(addDescSimilar.isValid_)
-			{
-				// Cria um ponto e o adiciona no pointset
-				TePoint	pt;
-				pt.add(addDescSimilar.pt_);
-				pt.objectId(add.locationLink_);
-				pSet.add(pt);
-			}
-			else
-				status = -1;
-		}
-		else
-		{
-			reportLine += " | | | | | | | | | | | | \n";
-		}
-		
-		TeWriteToFile(reportFile, reportLine, "a");
-
-		this->updateAddressTable(newCols.first, status, tableMetadata, add.locationLink_);
-
-		if(pSet.size() > 100)
-		{
-			if(!newLayer->addPoints(pSet))
-			{
-				errMsg_ = "Could not insert generated points!";
-
-				db_->deleteLayer(newLayer->id());
-
-				delete portal;
-
-				return false;
-			}
-
-			pSet.clear();
-		}
-
-		if(TeProgress::instance())
-		{
-			t2 = clock();
-			if(int(t2-t1) > dt)
-			{
-				t1 = t2;
-				
-				if((int)(t2-t0) > dt2)
-					TeProgress::instance()->setProgress(lo);
-			}
-		}
-	}while(portal->fetchRow());	// Vai para o pr�ximo registro
-
-	if((pSet.size() > 0) && !newLayer->addPoints(pSet))
-	{
-		errMsg_ = "Could not insert generated points!";
-
-		db_->deleteLayer(newLayer->id());
-
-		delete portal;
-
-		return false;
-	}
-
-
-	delete portal;
-
-	string summary  = "\n=================";
-		   summary += "\n===> SUMMARY <===";
-		   summary += "\n=================\n";
-		   summary += "\nNumber of ocurrences of each code:\n";
-
-	int sum = 0;
-	for(unsigned int j = 0; j < summarySum.size(); ++j)
-	{
-		summary += "CODE " + Te2String(j);
-		summary += " => ";
-		summary += Te2String(summarySum[j]);
-		summary += " - ";
-		summary += Te2String((double(summarySum[j]) / double(lo)) * 100.0);
-		summary += "\n";
-
-		if(j > 3)
-			sum = sum + summarySum[j];
-	}
-
-	summary += "=================\n";
-	summary += "TOTAL DE ENDERECOS: " + Te2String(lo) + "\n";
-	summary += "TOTAL DE ENCONTRADOS: " + Te2String(sum) + "\n";
-	summary += "Resultado = " + Te2String((double(sum) / double(lo)) * 100.0) + "\n\n";
-	summary += "LEGEND:\n";
-	summary += "0  -> Database connection problem\n";
-	summary += "1  -> Address not found\n";
-	summary += "2  -> full name empty\n";
-	summary += "3  -> Error on query the database\n";
-	summary += "4  -> Found by name location and number\n";
-	summary += "5  -> Found multiples by name location and number\n";
-	summary += "6  -> Found by name location without number\n";
-	summary += "7  -> Found multiples by name location without number\n";
-	summary += "8  -> Found by similar search\n";
-	summary += "9  -> Found by neighborhood or zip code\n";
-	summary += "10 -> Found by name location and number without type\n";
-	summary += "11 -> Found multiples by name location and number  without type\n";
-	summary += "12 -> Found by name location without number and type\n";
-	summary += "13 -> Found multiples by name location without number and type\n";
-	summary += "14 -> Found by name location and number without type and title\n";
-	summary += "15 -> Found multiples by name location and number  without type and title\n";
-	summary += "16 -> Found by name location without number and type and title\n";
-	summary += "17 -> Found multiples by name location without number and type and title\n";
-	summary += "18 -> Found by name location and number without type, title and preposition\n";
-	summary += "19 -> Found multiples by name location and number  without type, title and preposition\n";
-	summary += "20 -> Found by name location without number and type, title and preposition\n";
-	summary += "21 -> Found multiples by name location without number and type, title and preposition\n";
-
-
-	TeWriteToFile(reportFileSummary, summary, "a");
-
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	// If the table is registered as an geocoding table, so we remove its information from te_layer_table
-	string deleteGeocodingTable  = "DELETE FROM te_layer_table WHERE (layer_id IS NULL) AND table_id = ";
-	       deleteGeocodingTable += Te2String(tableMetadata.tableId_);
-
-	db_->execute(deleteGeocodingTable);
-
-	// Tenta registrar a tabela selecionada no metadado do novo layer
-	TeTable attTable(tableMetadata.tableName_);
-	
-	attTable.setTableType(TeAttrStatic);
-	attTable.setLinkName(tableMetadata.linkColumnName_);
-	attTable.setUniqueName(tableMetadata.keyColumnName_);
-
-	if(!newLayer->createAttributeTable(attTable))
-	{
-		errMsg_ = "N�o foi poss�vel atualizar as informa��es da tabela de atributos para o novo layer";
-
-		db_->deleteLayer(newLayer->id());
-
-		return false;
-	}
-
-	delete newLayer;
-
-	return true;
-}
-
-bool TeAddressLocator::loadDictionary(const string& dictionaryFileName)
-{	
-	errMsg_ = "";
-
-	dictionary_.clear();
-
-	if(dictionaryFileName.empty())
-	{
-		errMsg_ = "Enter with a valid dictionary file name and location!";
-
-		return false;	
-	}
-
-	try
-	{
-		TeAsciiFile dicFile(dictionaryFileName);
-
-		while(dicFile.isNotAtEOF())
-		{
-			vector<string> strList;
-
-			dicFile.readStringListCSV(strList, ',');
-
-			dicFile.findNewLine();
-
-			if(strList.size() <= 1)
-				continue;
-			
-			string str1 = TeConvertToUpperCase(strList[0]);
-
-			str1 = str1.substr(1);
-			str1 = str1.substr(0, str1.size() - 1);
-
-			for(unsigned int i = 1; i < strList.size(); ++i)
-			{
-				string str2 = TeConvertToUpperCase(strList[i]);
-				str2 = str2.substr(1);
-				str2 = str2.substr(0, str2.size() - 1);
-
-				dictionary_.insert(TeGeocoderDictionary::value_type(str2, str1));
-			}
-		}
-
-	}
-	catch(...)
-	{
-		errMsg_ = "Could open file: " + dictionaryFileName;
-
-		return false;
-	}
-	
-	return true;
-}
-
-
-
-//PROTECTED MEMBERS
-bool TeAddressLocator::findSimilarAddress(const TeAddress& address, const string& fullName, TeAddressDescription& descript)
-{
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return 0;
-	}
-
-	// String with the result query expression
-	string strSQL = "";
-
-	// String with the select...from clause
-	string strSelect  = "SELECT * FROM ";
-	       strSelect += metadata_.tableName_;
-		   
-	// Order by of the result query
-	string strOrderBy  = " ORDER BY ";
-		   strOrderBy += metadata_.linkColumnName_;
-
-	// String with the where clause;
-	string strWhere = " WHERE ";
-
-	strWhere += mountSimilarWhereSQL(address);
-
-	strSQL = strSelect + strWhere + strOrderBy;
-
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return false;
-
-	bool found = false;
-
-	// Check if there is a segment that satisfies the clause
-	if(portal->query(strSQL))
-	{
-		double simil, similmax = 75.0;		
-
-		while(portal->fetchRow() && similmax < 100.0)
-		{
-
-			string label = portal->getData(metadata_.locationCompleteName_);
-
-			simil = TeSimilarity(fullName.c_str(), label.c_str());
-		
-			if(simil > similmax)
-			{
-				found = true;
-
-				fillAddressDescription(descript, portal);
-
-				similmax = simil;
-			}
-		}
-	}
-
-	delete portal;
-
-	portal = 0;
-
-	return found;
-}
-
-
-
-bool TeAddressLocator::findByCentroid(const TeAddress& addressToFind, vector<TeAddressDescription>& addressesFound)
-{
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	if(!cmetadata_.centroidLayer_ || cmetadata_.centroidName_.empty() || cmetadata_.attributeTableName_.empty())
-		return false;	
-
-	string strValue = (cmetadata_.fieldType_ == TeNEIGHBORHOOD) ? (addressToFind.neighborhood_)  : (addressToFind.zipCode_);
-
-	if(strValue.empty())
-		return false;
-
-	strValue = TeConvertToUpperCase(strValue);
-	
-	if(removeHifenFromCentroid_ && cmetadata_.fieldType_ == TeZIPCODE)
-		removeHifen(strValue);
-	else if(!removeHifenFromCentroid_ && cmetadata_.fieldType_ == TeZIPCODE)
-		insertHifen(strValue);
-
-
-	string likeSQL = " = '";
-	       likeSQL += strValue;
-		   likeSQL += "'";
-
-	TeTable table;
-	
-	if(!cmetadata_.centroidLayer_->getAttrTablesByName(cmetadata_.attributeTableName_, table))
-		return false;
-	       
-	// String with the result query expression
-	string strSQL  = "SELECT ";
-		   strSQL += table.linkName();
-		   strSQL += ", ";
-	       strSQL += cmetadata_.centroidName_;
-		   strSQL += " FROM ";
-		   strSQL += cmetadata_.attributeTableName_;
-		   strSQL += " WHERE ";
-		   strSQL += db_->toUpper(cmetadata_.centroidName_);
-		   strSQL += likeSQL;
-
-	TeDatabasePortal* p = db_->getPortal();
-
-	if(!p)
-		return false;
-
-	if(!p->query(strSQL))
-	{
-		delete p;
-
-		return false;
-	}
-
-	while(p->fetchRow())
-	{
-		TeAddressDescription add;
-
-		if(cmetadata_.centroidLayer_->hasGeometry(TePOINTS))
-		{
-			TePointSet pset;
-
-			if(cmetadata_.centroidLayer_->loadGeometrySet(p->getData(0), pset))
-			{
-				add.pt_ = TeFindCentroid(pset);
-				add.isValid_ = true;
-			}
-			else
-				continue;
-		}
-		else if(cmetadata_.centroidLayer_->hasGeometry(TeLINES))
-		{
-			TeLineSet lset;
-
-			if(cmetadata_.centroidLayer_->loadGeometrySet(p->getData(0), lset))
-			{
-				add.pt_ = TeFindCentroid(lset);
-				add.isValid_ = true;
-			}
-			else
-				continue;
-		}
-		else if(cmetadata_.centroidLayer_->hasGeometry(TePOLYGONS))
-		{
-			TePolygonSet pset;
-
-			if(cmetadata_.centroidLayer_->loadGeometrySet(p->getData(0), pset))
-			{
-				add.pt_ = TeFindCentroid(pset);
-				add.isValid_ = true;
-			}
-			else
-				continue;
-
-		}
-		else if(cmetadata_.centroidLayer_->hasGeometry(TeCELLS))
-		{
-			TeCellSet cset;
-
-			if(cmetadata_.centroidLayer_->loadGeometrySet(p->getData(0), cset))
-			{
-				add.pt_ = TeFindCentroid(cset);
-				add.isValid_ = true;
-			}
-			else
-				continue;
-		}
-		else
-			continue;
-
-		TeVectorRemap(add.pt_, cmetadata_.centroidLayer_->projection(), add.pt_, referenceLayer_->projection());
-
-		if(cmetadata_.fieldType_ == TeZIPCODE)
-		{
-			add.leftZipCode_ = p->getData(1);
-			add.rightZipCode_ = p->getData(1);
-		}
-		else
-		{
-			add.leftNeighborhood_ = p->getData(1);
-			add.rightNeighborhood_ = p->getData(1);
-		}
-
-		addressesFound.push_back(add);
-	}
-
-	return addressesFound.size() > 0;
-}
-
-
-void TeAddressLocator::fillAddressMetadata(TeAddressMetadata& metadata, TeDatabasePortal* p)
-{
-	metadata.tableId_ = atoi(p->getData("table_id"));
-	metadata.initialLeftNumber_ = p->getData("initial_left_number");
-	metadata.finalLeftNumber_ = p->getData("final_left_number");
-	metadata.initialRightNumber_ = p->getData("initial_right_number");
-	metadata.finalRightNumber_ = p->getData("final_right_number");
-	metadata.locationType_ = p->getData("location_type");
-	metadata.locationTitle_ = p->getData("location_title");
-	metadata.locationPreposition_ = p->getData("location_preposition");
-	metadata.locationName_ = p->getData("location_name");
-	metadata.locationCompleteName_ = p->getData("location_full_name");
-	metadata.leftNeighborhood_ = p->getData("left_neighborhood");
-	metadata.rightNeighborhood_ = p->getData("right_neighborhood");
-	metadata.leftZipCode_ = p->getData("left_zip_code");
-	metadata.rightZipCode_ = p->getData("right_zip_code");
-	metadata.tableName_ = p->getData("attr_table");
-	metadata.linkColumnName_ = p->getData("attr_link");
-	return;
-}
-
-void TeAddressLocator::fillAddress(TeAddress& add, const TeGeocodeTableMetadata& tableMetadata, TeDatabasePortal* p)
-{
-	add.locationLink_ = p->getData(tableMetadata.linkColumnName_);
-
-	add.locationType_ = (tableMetadata.locationTypeColumnName_.empty()) ? "" : p->getData(tableMetadata.locationTypeColumnName_);
-	TeTrim(add.locationType_);
-
-	add.locationTitle_ = (tableMetadata.locationTitleColumnName_.empty()) ? "" : p->getData(tableMetadata.locationTitleColumnName_);
-	TeTrim(add.locationTitle_);
-	
-	add.locationPreposition_ = (tableMetadata.locationPrepositionColumnName_.empty()) ? "" : p->getData(tableMetadata.locationPrepositionColumnName_);
-	TeTrim(add.locationPreposition_);
-
-	add.locationName_ = p->getData(tableMetadata.locationNameColumnName_);		
-	TeTrim(add.locationName_);
-
-	add.neighborhood_ = (tableMetadata.neighborhoodColumnName_.empty()) ? "" : p->getData(tableMetadata.neighborhoodColumnName_);
-	TeTrim(add.neighborhood_);
-
-	add.zipCode_ = (tableMetadata.zipCodeColumnName_.empty()) ? "" : p->getData(tableMetadata.zipCodeColumnName_);
-	TeTrim(add.zipCode_);
-
-	if(!tableMetadata.locationNumberColumnName_.empty())
-		add.locationNumber_ = atoi(p->getData(tableMetadata.locationNumberColumnName_));	
-	else
-		splitAddress(add);
-
-	return;
-}
-
-string TeAddressLocator::mountSimilarWhereSQL(const TeAddress& address)
-{	
-	string sql = metadata_.locationName_ + " <> '' ";
-	
-	if(address.locationNumber_ != 0)
-	{
-		string snumber = Te2String(address.locationNumber_);
-
-		if(!sql.empty())
-			sql += " AND ";
-
-		if((address.locationNumber_ % 2) == 0)
-			sql += metadata_.initialRightNumber_ + " <= " + snumber + " AND " + metadata_.finalRightNumber_ + " >= " + snumber;
-		else
-			sql += metadata_.initialLeftNumber_ + " <= " + snumber +" AND " + metadata_.finalLeftNumber_ + " >= " + snumber;
-	}
-
-	return sql;
-}
-
-string TeAddressLocator::mountExactWhereSQL(const TeAddress& address, const string& fullName)
-{
-	vector<string> fields;
-	string values = "";
-	string sql = "";
-
-	if(address.locationNumber_ != 0)
-	{
-		string snumber = Te2String(address.locationNumber_);
-
-		// Se for endere�os pares
-		if((address.locationNumber_ % 2) == 0)
-			sql += " ( " + metadata_.initialRightNumber_ +" <= " + snumber + " AND " + metadata_.finalRightNumber_ +" >= " + snumber + ") ";
-		else	// Sen�o, se for �mpares
-			sql += " ( " + metadata_.initialLeftNumber_ + " <= " + snumber + " AND " + metadata_.finalLeftNumber_ + " >= " + snumber + ") ";
-	}
-
-	if(sql.empty())
-		sql += " ( " + metadata_.locationCompleteName_ + " = '";
-	else
-		sql += " AND (" + metadata_.locationCompleteName_ + " = '";
-
-	sql += db_->escapeSequence(fullName);
-
-	sql += "') ";
-
-	return sql;
-}
-
-string TeAddressLocator::mountLikeWhereSQL(const TeAddress& address, const string& fullName)
-{
-	vector<string> fields;
-	string values = db_->escapeSequence(fullName);
-	string sql  = " ( " + metadata_.locationCompleteName_ + " LIKE '%";
-           sql += values;
-		   sql += "') ";
-
-	if(address.locationNumber_ != 0)
-	{
-		string snumber = Te2String(address.locationNumber_);
-
-		// Se for endere�os pares
-		if((address.locationNumber_ % 2) == 0)
-			sql += " AND ( " + metadata_.initialRightNumber_ +" <= " + snumber + " AND " + metadata_.finalRightNumber_ +" >= " + snumber + ") ";
-		else	// Sen�o, se for �mpares
-			sql += " AND ( " + metadata_.initialLeftNumber_ + " <= " + snumber + " AND " + metadata_.finalLeftNumber_ + " >= " + snumber + ") ";
-	}
-	
-	return sql;
-
-}
-
-string TeAddressLocator::mountPatternWhereSQL(const TeAddress& address, const string& fullName, const bool& disabletype, const bool& disabletitle, const bool& disablepreposition)
-{
-	vector<string> fields;
-	string values = "";
-	string sql = "(";
-
-	if(!metadata_.locationType_.empty() && !disabletype)
-		fields.push_back(db_->toUpper(metadata_.locationType_));
-
-	if(!metadata_.locationTitle_.empty() && !disabletitle)
-		fields.push_back(db_->toUpper(metadata_.locationTitle_));
-
-	if(!metadata_.locationPreposition_.empty() && !disablepreposition)
-		fields.push_back(db_->toUpper(metadata_.locationPreposition_));
-
-	if(!metadata_.locationName_.empty())
-		fields.push_back(db_->toUpper(metadata_.locationName_));
-
-	sql += db_->concatValues(fields, "");
-	sql += ") LIKE '";
-
-	values += db_->escapeSequence(fullName);
-	
-	sql += makeLikeExpression(values);
-	sql += "' ";
-
-	if(address.locationNumber_ != 0)
-	{
-		string snumber = Te2String(address.locationNumber_);
-
-		// Se for endere�os pares
-		if((address.locationNumber_ % 2) == 0)
-			sql += " AND ( " + metadata_.initialRightNumber_ +" <= " + snumber + " AND " + metadata_.finalRightNumber_ +" >= " + snumber + ") ";
-		else	// Sen�o, se for �mpares
-			sql += " AND ( " + metadata_.initialLeftNumber_ + " <= " + snumber + " AND " + metadata_.finalLeftNumber_ + " >= " + snumber + ") ";
-	}
-	
-	return sql;
-}
-
-void TeAddressLocator::findCoordinates(const TeAddress& add, vector<TeAddressDescription>& addresses)
-{
-	for(unsigned int i = 0; i < addresses.size(); ++i)
-		findCoordinate(add, addresses[i]);
-}
-
-void TeAddressLocator::findCoordinate(const TeAddress& add, TeAddressDescription& desc)
-{
-	// Evaluate the relative position of "number" (relativePosition) between initial and final numbers
-	// If number is zero, point to begin of line
-
-	int initialLeft, initialRight, finalLeft, finalRight;
-
-	double relativePosition = 0.0;
-
-	if(add.locationNumber_ != 0)
-	{
-		if((add.locationNumber_ % 2) == 0)
-		{
-			initialRight = desc.initialRightNumber_;
-			finalRight = desc.finalRightNumber_;
-				
-			if(initialRight != finalRight)
-				relativePosition = double(add.locationNumber_ - initialRight) / double(finalRight - initialRight);
-		}
-		else
-		{
-			initialLeft = desc.initialLeftNumber_;
-			finalLeft = desc.finalLeftNumber_;
-				
-			if(initialLeft != finalLeft)
-				relativePosition = double(add.locationNumber_ - initialLeft) / double(finalLeft - initialLeft);
-		}
-
-		if(relativePosition > 1.0)
-			relativePosition = 1.0;
-		else if(relativePosition < 0.0)
-			relativePosition = 0.0;
-	}
-
-	// Retrieve street segment geometry
-	TeLineSet ls;
-
-	if(!referenceLayer_->loadGeometrySet(desc.locationLink_, ls))	// Recupero a linha geom�trica do trecho que cont�m o endere�o em quest�o
-		return;
-
-	// Find the actual position of number on the street
-	if(ls.size() >= 1)
-	{
-		TeLine2D line = ls[0];
-
-		TeCoord2D pt1, pt2;
-
-		pt1 = line[0];
-		pt2 = line[1];
-
-		double x, y;
-
-		if(relativePosition <= 0.0)
-		{
-			x = pt1.x();
-			y = pt1.y();
-		}
-		else if(relativePosition >= 1.0)
-		{
-			pt1 = line[line.size() - 1];
-
-			x = pt1.x();
-			y = pt1.y();
-		}		
-		else
-		{
-			if(line.size () > 2)
-			{
-
-				// Find the distance from number to the begin of street based on the relative position
-				double targetLen = TeLength(line) * relativePosition;
-				double acumLen = 0.0;
-				double segLen;
-
-				// Find in which segment number is comprised
-				for(unsigned int i = 1 ; i < line.size(); ++i)
-				{
-					pt2 = line[i];
-
-					segLen = TeDistance(pt2, pt1);	//sqrt((pt2.x() - pt1.x()) * (pt2.x() - pt1.x()) + (pt2.y() - pt1.y()) * (pt2.y() - pt1.y()));
-					
-					acumLen += segLen;
-
-					if(acumLen >= targetLen)
-					{
-						double targetLenInSeg = targetLen - (acumLen - segLen);
-
-						relativePosition = targetLenInSeg / segLen;
-
-						break;
-					}
-
-					pt1 = pt2;
-				}
-			}
-
-			x = pt1.x() + (pt2.x() - pt1.x()) * relativePosition;
-			y = pt1.y() + (pt2.y() - pt1.y()) * relativePosition;
-		}
-		
-
-		desc.pt_ = TeCoord2D (x,y);
-
-		desc.isValid_ = true;
-	}
-	else
-		desc.isValid_ = false;	// A linha pertencente ao trecho n�o foi encontrada... problemas s�rios na base de dados!
-}
-
-
-void TeAddressLocator::fillAddressesDescription(vector<TeAddressDescription>& addresses, TeDatabasePortal* p)
-{
-	addresses.clear();
-
-	if(p == 0)
-		return;
-
-	while(p->fetchRow())
-	{
-		TeAddressDescription descript;
-
-		fillAddressDescription(descript, p);
-
-		addresses.push_back(descript);
-	}
-
-	return;
-}
-
-void TeAddressLocator::fillAddressDescription(TeAddressDescription& descript, TeDatabasePortal* p)
-{
-	descript.locationLink_ = p->getData(metadata_.linkColumnName_);
-	descript.locationType_ = (metadata_.locationType_.empty()) ? "" : p->getData(metadata_.locationType_);
-	descript.locationTitle_ = (metadata_.locationTitle_.empty()) ? "" : p->getData(metadata_.locationTitle_);
-	descript.locationPreposition_ = (metadata_.locationPreposition_.empty()) ? "" : p->getData(metadata_.locationPreposition_);
-	descript.locationName_ = (metadata_.locationName_.empty()) ? "" : p->getData(metadata_.locationName_);		
-	descript.locationCompleteName_ = p->getData(metadata_.locationCompleteName_);
-	descript.initialLeftNumber_ = (metadata_.initialLeftNumber_.empty()) ? 0 : atoi(p->getData(metadata_.initialLeftNumber_));
-	descript.finalLeftNumber_ = (metadata_.finalLeftNumber_.empty()) ? 0 : atoi(p->getData(metadata_.finalLeftNumber_));
-	descript.initialRightNumber_ = (metadata_.initialRightNumber_.empty()) ? 0 : atoi(p->getData(metadata_.initialRightNumber_));
-	descript.finalRightNumber_ = (metadata_.finalRightNumber_.empty()) ? 0 : atoi(p->getData(metadata_.finalRightNumber_));
-	descript.leftNeighborhood_ = (metadata_.leftNeighborhood_.empty()) ? "" : p->getData(metadata_.leftNeighborhood_);
-	descript.rightNeighborhood_ = (metadata_.rightNeighborhood_.empty()) ? "" : p->getData(metadata_.rightNeighborhood_);
-	descript.leftZipCode_ = (metadata_.leftZipCode_.empty()) ? "" : p->getData(metadata_.leftZipCode_);
-	descript.rightZipCode_ = (metadata_.rightZipCode_.empty()) ? "" : p->getData(metadata_.rightZipCode_);
-
-	return;
-}
-
-void TeAddressLocator::normalizeAddress(TeAddress& address, string& completeName)
-{
-	completeName = "";
-
-	if(!address.locationType_.empty())
-	{
-		TeTrim(address.locationType_);
-
-		if(changeSpecialChars_)
-			removeSpecialCharacters(address.locationType_);
-
-		address.locationType_ = TeConvertToUpperCase(address.locationType_);
-
-		completeName = address.locationType_;
-	}
-
-	if(!address.locationTitle_.empty())
-	{
-		TeTrim(address.locationTitle_);
-
-		if(changeSpecialChars_)
-			removeSpecialCharacters(address.locationTitle_);
-
-		address.locationTitle_ = TeConvertToUpperCase(address.locationTitle_);
-
-		if(!completeName.empty())
-			completeName += " ";
-
-		completeName += address.locationTitle_;
-	}
-
-	if(!address.locationPreposition_.empty())
-	{
-		TeTrim(address.locationPreposition_);
-
-		if(changeSpecialChars_)
-			removeSpecialCharacters(address.locationPreposition_);
-
-		address.locationPreposition_ = TeConvertToUpperCase(address.locationPreposition_);
-
-		if(!completeName.empty())
-			completeName += " ";
-
-		completeName += address.locationPreposition_;
-	}
-	
-	if(!address.locationName_.empty())
-	{
-		TeTrim(address.locationName_);
-		
-		if(changeSpecialChars_)
-			removeSpecialCharacters(address.locationName_);
-
-		address.locationName_ = TeConvertToUpperCase(address.locationName_);
-
-		if(!completeName.empty())
-			completeName += " ";
-
-		completeName += address.locationName_;
-	}
-
-	if(!address.neighborhood_.empty())
-	{
-		TeTrim(address.neighborhood_);
-
-		if(changeSpecialChars_)
-			removeSpecialCharacters(address.neighborhood_);
-
-		address.neighborhood_ = TeConvertToUpperCase(address.neighborhood_);		
-	}
-
-	if(!address.zipCode_.empty())
-	{
-		TeTrim(address.zipCode_);
-
-		if(removeHifen_)
-			removeHifen(address.zipCode_);
-		else
-			insertHifen(address.zipCode_);
-	}
-
-	return;
-}
-
-void TeAddressLocator::removeHifen(string& zipCode) const
-{
-	if(zipCode.size() == 9)
-	{
-		unsigned int i = 0;
-
-		string newZipCode = "";
-
-		for(i = 0; i < 5; ++i)
-			newZipCode += zipCode[i];
-
-		for(i = 6; i < 9; ++i)
-			newZipCode += zipCode[i];
-
-		zipCode = newZipCode;
-	}	
-	
-	return;
-}
-
-void TeAddressLocator::insertHifen(string& zipCode) const
-{
-	if(zipCode.size() == 8)
-	{
-		unsigned int i = 0;
-
-		string newZipCode = "";
-
-		for(i = 0; i < 5; ++i)
-			newZipCode += zipCode[i];
-
-		newZipCode += hifen_;
-
-		for(i = 5; i < 8; ++i)
-			newZipCode += zipCode[i];
-
-		zipCode = newZipCode;
-	}	
-	
-	return;
-}
-
-string TeAddressLocator::makeLikeExpression(const string& str) const
-{
-	string aux = "";
-
-	for(unsigned int i = 0; i < str.size(); ++i)
-		aux += (str[i] == ' ') ? ('%') : str[i];
-
-	return aux;
-}
-
-void TeAddressLocator::removeSpecialCharacters(string& str) const
-{
-	string newStr = "";
-
-	unsigned int nStep = str.size();
-
-	for(unsigned int i = 0; i < nStep; ++i)
-	{
-		switch(str[i])
-		{
-			case '�' :  newStr += "A"; break;
-			case '�' :  newStr += "a"; break;
-			case '�' :  newStr += "A"; break;
-			case '�' :  newStr += "a"; break;
-			case '�' :  newStr += "A"; break;
-			case '�' :  newStr += "a"; break;
-			case '�' :  newStr += "A"; break;
-			case '�' :	newStr += "a"; break;
-
-			case '�' :  newStr += "E"; break;
-			case '�' :  newStr += "e"; break;
-			case '�' :  newStr += "E"; break;
-			case '�' :  newStr += "e"; break;
-
-			case '�' :  newStr += "I"; break;
-			case '�' :  newStr += "i"; break;
-
-			case '�' :  newStr += "O"; break;
-			case '�' :  newStr += "o"; break;
-			case '�' :  newStr += "O"; break;
-			case '�' :  newStr += "o"; break;
-
-			case '�' :  newStr += "U"; break;
-			case '�' :  newStr += "u"; break;
-			case '�' :  newStr += "U"; break;
-			case '�' :  newStr += "u"; break;
-
-			case '�' :  newStr += "c"; break;
-			case '�' :  newStr += "C"; break;
-
-			//case '.' :	break;
-
-			default  :  newStr += str[i];
-		}
-	}
-
-	str = newStr;
-}
-
-bool TeAddressLocator::verifyHifen(const string& tableName, const string& columnName)
-{
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return 0;
-	}
-
-	TeDatabasePortal* p = db_->getPortal();
-
-	if(!p || columnName.empty() || tableName.empty())
-		return false;
-
-	string q  = "SELECT MAX(";
-	       q += columnName;
-		   q += ") FROM ";
-		   q += tableName;
-
-	if(!p->query(q) && !p->fetchRow())
-	{
-		delete p;
-
-		return false;
-	}
-
-	string zipCode = p->getData(0);
-
-	delete p;
-
-	if(zipCode.size() == 9)
-	{
-		hifen_ = zipCode[5];
-
-		return true;
-	}
-
-	return false;
-}
-
-bool TeAddressLocator::addReportColumn(TeGeocodeTableMetadata& tableMetadata, pair<string, string>& newColumns)
-{
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-	
-	// Adiciona as colunas para relat�rio de acerto dos pontos
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return false;
-
-	string allFieldQuery  = "SELECT * FROM ";
-	       allFieldQuery += tableMetadata.tableName_;
-		   allFieldQuery += " WHERE 1 = 2";
-
-	if(!portal->query(allFieldQuery))
-	{
-		errMsg_ = "Could not find column names for the table to be geocoding!";
-
-		delete portal;
-
-		return false;
-	}
-
-	TeAttributeRep rep1;
-	rep1.name_ = "geocoding_result_id";
-	rep1.type_ = TeINT;
-	rep1.isPrimaryKey_ = false;
-	rep1.isAutoNumber_ = false;
-
-	TeAttributeList& attrList = portal->getAttributeList();
-	validColumnName(rep1, attrList);
-
-	TeAttributeRep rep2;
-	rep2.name_ = "geocoding_result_description";
-	rep2.type_ = TeSTRING;
-	rep2.numChar_ = 255;
-	rep2.isPrimaryKey_ = false;
-	rep2.isAutoNumber_ = false;
-
-	validColumnName(rep2, attrList);
-
-	delete portal;
-
-	portal = 0;
-
-	if(!db_->addColumn(tableMetadata.tableName_, rep1))
-	{
-		errMsg_ = "Could not add a column to do the report!";
-
-		delete portal;
-
-		return false;
-	}	
-
-	//if(!db_->addColumn(tableMetadata.tableName_, rep2))
-	//{
-	//	errMsg_ = "Could not add a column to do the report!";
-
-	//	delete portal;
-
-	//	return false;
-	//}
-
-	newColumns.first = rep1.name_;
-	newColumns.second = rep2.name_;
-
-	return true;
-}
-
-bool TeAddressLocator::findTableMetadata(TeGeocodeTableMetadata& tableMetadata)
-{
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-	
-	// Adiciona as colunas para relat�rio de acerto dos pontos
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return false;
-
-
-	// Procura o nome do campo chave da tabela a ser geocodificada
-	string sql  = "SELECT * FROM te_layer_table WHERE table_id = ";
-	       sql += Te2String(tableMetadata.tableId_);	
-
-	portal = db_->getPortal();
-
-	if(!portal)
-		return false;
-
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		errMsg_ = "Could not read te_layer_table table for geocoding base table!";
-
-		delete portal;
-
-		return false;
-	}
-
-	tableMetadata.keyColumnName_ = portal->getData("unique_id");
-	tableMetadata.linkColumnName_ = portal->getData("attr_link");
-	tableMetadata.tableName_ = portal->getData("attr_table");
-
-	delete portal;
-
-	portal = 0;
-
-	return true;
-}
-
-bool TeAddressLocator::updateAddressTable(const string& c1, const int& v1, TeGeocodeTableMetadata& tableMetadata, const string& objectId)
-{
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return false;
-	}
-
-	string sql  = "UPDATE ";
-	       sql += tableMetadata.tableName_;
-		   sql += " SET ";
-		   sql += c1;
-		   sql += " = ";
-		   sql += Te2String(v1);
-		   sql += " WHERE ";
-		   sql += tableMetadata.linkColumnName_;
-		   sql += " = '";
-		   sql += objectId;
-		   sql += "'";
-
-	return db_->execute(sql);
-}
-
-TeDatabasePortal* TeAddressLocator::getAddressTablePortal(TeGeocodeTableMetadata& tableMetadata, int& numRows)
-{
-	if(!db_)
-	{
-		errMsg_ = "You should connect to a database first!";
-
-		return 0;
-	}
-
-	string sql = "SELECT count(*) FROM " + tableMetadata.tableName_;
-
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-	{
-		errMsg_ = "Could not get a portal to query database!";
-
-		return 0;
-	}
-
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		errMsg_ = "Could not count the number of records in the geocoding base table!";
-
-		return 0;
-	}
-
-	numRows = portal->getInt(0);
-
-	portal->freeResult();
-
-	// Recupera um portal para a tabela a ser espacializada e verifica se a tabela tem conte�do
-	sql  = "SELECT ";
-	sql += tableMetadata.linkColumnName_;
-	sql += ", ";
-	sql += tableMetadata.locationNameColumnName_;
-
-	if(!tableMetadata.locationNumberColumnName_.empty())
-	{
-	       sql += ", ";
-	       sql += tableMetadata.locationNumberColumnName_;
-	}
-
-	if(!tableMetadata.neighborhoodColumnName_.empty())
-	{
-		sql += ", ";
-		sql += tableMetadata.neighborhoodColumnName_;
-	}
-
-	if(!tableMetadata.zipCodeColumnName_.empty())
-	{
-		sql += ", ";
-		sql += tableMetadata.zipCodeColumnName_;
-	}
-
-	if(!tableMetadata.locationTypeColumnName_.empty())
-	{
-		sql += ", ";
-		sql += tableMetadata.locationTypeColumnName_;
-	}
-
-	if(!tableMetadata.locationTitleColumnName_.empty())
-	{
-		sql += ", ";
-		sql += tableMetadata.locationTitleColumnName_;
-	}
-
-	if(!tableMetadata.locationPrepositionColumnName_.empty())
-	{
-		sql += ", ";
-		sql += tableMetadata.locationPrepositionColumnName_;
-	}
-
-	sql += " FROM ";
-	sql += tableMetadata.tableName_;
-
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		errMsg_ = "Could not read the geocoding base table!";
-
-		delete portal;
-
-		return 0;
-	}
-
-	return portal;
-}
-
-
-
-void TeAddressLocator::refineFoundedLocationsByNeighBorhood(const TeAddress& address, vector<TeAddressDescription>& addressesFound)
-{
-	unsigned int nStep = addressesFound.size();
-
-	vector<TeAddressDescription> newAdds;
-
-	for(unsigned int i = 0; i < nStep; ++i)
-	{
-		TeAddressDescription& addFound = addressesFound[i];
-
-		if(address.neighborhood_ == TeConvertToUpperCase(addFound.leftNeighborhood_) || address.neighborhood_ == TeConvertToUpperCase(addFound.rightNeighborhood_))
-			newAdds.push_back(addFound);
-	}
-
-	if(newAdds.size() > 0)
-	{
-		addressesFound.clear();
-
-		addressesFound = newAdds;
-	}
-
-	return;
-}
-
-void TeAddressLocator::refineFoundedLocationsByZipCode(const TeAddress& address, vector<TeAddressDescription>& addressesFound)
-{
-	unsigned int nStep = addressesFound.size();
-
-	vector<TeAddressDescription> newAdds;
-
-	for(unsigned int i = 0; i < nStep; ++i)
-	{
-		TeAddressDescription& addFound = addressesFound[i];
-
-		if(address.zipCode_ == addFound.leftZipCode_ || address.zipCode_ == addFound.rightZipCode_)
-			newAdds.push_back(addFound);
-	}
-
-	if(newAdds.size() > 0)
-	{
-		addressesFound.clear();
-
-		addressesFound = newAdds;
-	}
-
-	return;
-}
-
-void TeAddressLocator::refineFoundedLocationsByNumberNeighboor(const TeAddress& address, vector<TeAddressDescription>& addressesFound)
-{
-	unsigned int nStep = addressesFound.size();
-
-	// id/dist
-	typedef pair<unsigned int, int> nearestItem; 
-
-	map<string, nearestItem> nearestMap;
-
-	bool par = ((address.locationNumber_ % 2) == 0);
-
-	for(unsigned int i = 0; i < nStep; ++i)
-	{
-		TeAddressDescription& addFound = addressesFound[i];
-		
-		int distBegin = 0;
-		int distEnd = 0;
-
-		int dist = 0;
-
-		if(par)
-		{	
-
-			distBegin = abs(address.locationNumber_ - addFound.initialRightNumber_);
-			distEnd = abs(address.locationNumber_ - addFound.finalRightNumber_);
-
-			dist = MIN(distBegin, distEnd);
-		}
-		else
-		{
-			distBegin = abs(address.locationNumber_ - addFound.initialLeftNumber_);
-			distEnd = abs(address.locationNumber_ - addFound.finalLeftNumber_);
-
-			dist = MIN(distBegin, distEnd);
-		}
-
-
-		map<string, nearestItem>::iterator itLeft = nearestMap.find(addFound.leftNeighborhood_);
-
-		if(itLeft != nearestMap.end())
-		{
-			if(dist < itLeft->second.second)
-				nearestMap[addFound.leftNeighborhood_] = nearestItem(i, dist);
-		}
-		else
-		{
-			nearestMap[addFound.leftNeighborhood_] = nearestItem(i, dist);
-		}
-
-		if(addFound.leftNeighborhood_ != addFound.rightNeighborhood_)
-		{
-			map<string, nearestItem>::iterator itRight = nearestMap.find(addFound.rightNeighborhood_);
-
-			if(itRight != nearestMap.end())
-			{
-				if(dist < itRight->second.second)
-					nearestMap[addFound.rightNeighborhood_] = nearestItem(i, dist);					
-			}
-			else
-			{
-				nearestMap[addFound.rightNeighborhood_] = nearestItem(i, dist);
-			}
-		}		
-	}
-
-	if(!nearestMap.empty())
-	{
-		map<string, nearestItem>::iterator it = nearestMap.begin();
-		vector<TeAddressDescription> newAdds;
-		set<unsigned int> alreadyPushed;
-
-		while(it != nearestMap.end())
-		{
-			set<unsigned int>::iterator itaux = alreadyPushed.find(it->second.first);
-
-			// Se o endere�o j� n�o tiver sido colocado na lista, inclui, caso contr�rio n�o faz nada
-			if(itaux == alreadyPushed.end())
-				newAdds.push_back(addressesFound[it->second.first]);			
-
-			alreadyPushed.insert(it->second.first);
-
-			++it;
-		}
-
-		addressesFound.clear();
-		addressesFound = newAdds;
-	
-	}
-
-	return;
-}
-
-void TeAddressLocator::refineFoundedLocationsByNumberZipCode(const TeAddress& address, vector<TeAddressDescription>& addressesFound)
-{
-	unsigned int nStep = addressesFound.size();
-
-	// id/dist
-	typedef pair<unsigned int, int> nearestItem; 
-
-	map<string, nearestItem> nearestMap;
-
-	bool par = ((address.locationNumber_ % 2) == 0);
-
-	for(unsigned int i = 0; i < nStep; ++i)
-	{
-		TeAddressDescription& addFound = addressesFound[i];
-		
-		int distBegin = 0;
-		int distEnd = 0;
-
-		int dist = 0;
-
-		if(par)
-		{	
-
-			distBegin = abs(address.locationNumber_ - addFound.initialRightNumber_);
-			distEnd = abs(address.locationNumber_ - addFound.finalRightNumber_);
-
-			dist = MIN(distBegin, distEnd);
-		}
-		else
-		{
-			distBegin = abs(address.locationNumber_ - addFound.initialLeftNumber_);
-			distEnd = abs(address.locationNumber_ - addFound.finalLeftNumber_);
-
-			dist = MIN(distBegin, distEnd);
-		}
-
-
-		map<string, nearestItem>::iterator itLeft = nearestMap.find(addFound.leftZipCode_);
-
-		if(itLeft != nearestMap.end())
-		{
-			if(dist < itLeft->second.second)
-				nearestMap[addFound.leftZipCode_] = nearestItem(i, dist);
-		}
-		else
-		{
-			nearestMap[addFound.leftZipCode_] = nearestItem(i, dist);
-		}
-
-		if(addFound.leftZipCode_ != addFound.rightZipCode_)
-		{
-			map<string, nearestItem>::iterator itRight = nearestMap.find(addFound.rightZipCode_);
-
-			if(itRight != nearestMap.end())
-			{
-				if(dist < itRight->second.second)
-					nearestMap[addFound.rightZipCode_] = nearestItem(i, dist);
-			}
-			else
-			{
-				nearestMap[addFound.rightZipCode_] = nearestItem(i, dist);
-			}
-		}		
-	}
-
-	if(!nearestMap.empty())
-	{
-		map<string, nearestItem>::iterator it = nearestMap.begin();
-		vector<TeAddressDescription> newAdds;
-		set<unsigned int> alreadyPushed;
-
-		while(it != nearestMap.end())
-		{
-			set<unsigned int>::iterator itaux = alreadyPushed.find(it->second.first);
-
-			// Se o endere�o j� n�o tiver sido colocado na lista, inclui, caso contr�rio n�o faz nada
-			if(itaux == alreadyPushed.end())
-				newAdds.push_back(addressesFound[it->second.first]);			
-
-			alreadyPushed.insert(it->second.first);
-
-			++it;
-		}
-
-		addressesFound.clear();
-		addressesFound = newAdds;
-	
-	}
-
-	return;
-}
-
-void TeAddressLocator::splitAddress(TeAddress& add)
-{
-	unsigned int i;
-	string aux = add.locationName_;
-
-	add.locationName_ = "";
-	add.locationNumber_ = 0;
-
-	string number = "";
-
-	if(!splitChar_.empty())
-	{
-		unsigned int nChars = aux.size();
-
-		for(i = 0; i < nChars; ++i)
-		{
-			if(splitChar_[0] == aux[i])
-			{
-				++i;
-				break;
-			}
-
-			add.locationName_ += aux[i];
-		}
-
-		number = "";
-
-		for(; i < nChars; ++i)
-		{
-			if((aux[i] >= '0') && (aux[i] <= '9'))
-				number += aux[i];
-		}
-		
-	}
-	else
-	{
-		unsigned int nChars = aux.size();
-
-		for(i = 0; i < nChars; ++i)
-		{
-			if(aux[i] >= '0' && aux[i] <= '9')
-				break;
-
-			add.locationName_ += aux[i];
-		}		
-
-		for(; i < nChars; ++i)
-		{
-			if(aux[i] < '0' || aux[i] > '9')
-				break;
-
-			number += aux[i];
-		}
-	}
-
-	TeTrim(add.locationName_);
-	TeTrim(number);
-	add.locationNumber_ = atoi(number.c_str());
-}
-
-
-void TeAddressLocator::queryAddresses(const string& strSQL, bool& queryExecuted, vector<TeAddressDescription>& addressesFound)
-{
-	TeDatabasePortal* portal = db_->getPortal();
-
-	if(!portal)
-		return;
-
-	// Check if there is a segment that satisfies the clause
-	if(portal->query(strSQL))
-	{
-		queryExecuted = true;
-
-		fillAddressesDescription(addressesFound, portal);
-	}
-
-	delete portal;
-}
-
-
-bool TeAddressLocator::loadAddressCompoundNames()
-{
-	typesVector_.clear();
-	titlesVector_.clear();
-	prepositionsVector_.clear();
-
-	if(!metadata_.locationType_.empty())
-	{
-		TeDatabasePortal *p = db_->getPortal();
-
-		if(!p)
-		{
-			errMsg_ = "Could not get portal to find types in base table!";
-
-			return false;
-		}
-
-
-		string sql  = "SELECT DISTINCT ";
-		       sql += metadata_.locationType_;
-			   sql += " FROM ";
-			   sql += metadata_.tableName_;
-			   sql += " ORDER BY ";
-			   sql += metadata_.locationType_;
-
-		if(p->query(sql))
-		{
-			while(p->fetchRow())
-			{
-				string aux = p->getData(metadata_.locationType_);
-
-				TeTrim(aux);
-
-				if(aux.empty())
-					continue;
-
-				typesVector_.push_back(aux);
-			}
-		}
-
-		delete p;
-	}
-
-	// T�tulo
-	if(!metadata_.locationTitle_.empty())
-	{
-		TeDatabasePortal *p = db_->getPortal();
-
-		if(!p)
-		{
-			errMsg_ = "Could not get portal to find titles in base table!";
-
-			return false;
-		}
-
-
-		string sql  = "SELECT DISTINCT ";
-		       sql += metadata_.locationTitle_;
-			   sql += " FROM ";
-			   sql += metadata_.tableName_;
-			   sql += " ORDER BY ";
-			   sql += metadata_.locationTitle_;
-
-		if(p->query(sql))
-		{
-			while(p->fetchRow())
-			{
-				string aux = p->getData(metadata_.locationTitle_);
-
-				TeTrim(aux);
-
-				if(aux.empty())
-					continue;
-
-				titlesVector_.push_back(aux);
-			}
-		}
-
-		delete p;
-	}
-
-	// Preposi��o
-	if(!metadata_.locationPreposition_.empty())
-	{
-		TeDatabasePortal *p = db_->getPortal();
-
-		if(!p)
-		{
-			errMsg_ = "Could not get portal to find prepositions in base table!";
-
-			return false;
-		}
-
-
-		string sql  = "SELECT DISTINCT ";
-		       sql += metadata_.locationPreposition_;
-			   sql += " FROM ";
-			   sql += metadata_.tableName_;
-			   sql += " ORDER BY ";
-			   sql += metadata_.locationPreposition_;
-
-		if(p->query(sql))
-		{
-			while(p->fetchRow())
-			{
-				string aux = p->getData(metadata_.locationPreposition_);
-
-				TeTrim(aux);
-
-				if(aux.empty())
-					continue;
-
-				prepositionsVector_.push_back(aux);
-			}
-		}
-
-		delete p;
-	}
-
-	return true;
-}
-
-
-bool TeAddressLocator::convertColumnNameToUpper()
-{
-	errMsg_ = "";
-	
-	if(!db_)
-	{
-		errMsg_ = "Connect to a database first!";
-
-		return false;
-	}
-
-	string sql  = "UPDATE ";
-		   sql += metadata_.tableName_;
-		   sql += " SET ";
-		   sql += metadata_.locationCompleteName_;
-		   sql += " = ";
-		   sql += db_->toUpper(metadata_.locationCompleteName_);
-
-	if(!db_->execute(sql))
-	{
-		errMsg_ = "Couldn't convert to uppercase name column!";
-
-		return false;
-	}
-
-	return true;
-}
-
-bool TeAddressLocator::addCompleteNameColumn()
-{
-	errMsg_ = "";
-	
-	if(!db_)
-	{
-		errMsg_ = "Connect to a database first!";
-
-		return false;
-	}
-
-	TeAttribute attr;
-
-	if(db_->columnExist(metadata_.tableName_, metadata_.locationCompleteName_, attr))
-	{
-		errMsg_ = "The specified column name already exist!";
-
-		return false;
-	}
-
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.name_ = metadata_.locationCompleteName_;
-	at.rep_.numChar_ = 255;
-
-	if(!db_->addColumn(metadata_.tableName_, at.rep_))
-	{
-		errMsg_ = "Couldn't add specified column!";
-
-		return false;
-	}
-
-	TeDatabasePortal* p = db_->getPortal();
-
-	if(!p)
-	{
-		errMsg_ = "Couldn't get portal!";
-		
-		return false;
-	}
-
-	string sql = "SELECT count(*) FROM " + metadata_.tableName_;
-
-	if(!p->query(sql) && !p->fetchRow())
-	{
-		errMsg_ = "Couldn't get number of lines to update!";
-
-		delete p;
-		
-		return false;
-	}
-
-	int lo = 0;
-	int nlo = p->getInt(0);
-
-	p->freeResult();
-
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(nlo);
-		TeProgress::instance()->setCaption("Address Geocoding Config");
-		TeProgress::instance()->setMessage("Creating new column...");
-	}
-
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-
-
-	sql = "SELECT * FROM " + metadata_.tableName_;
-
-	if(!p->query(sql))
-	{
-		errMsg_ = "Couldn't query address reference table!";
-
-		delete p;
-		
-		return false;
-	}
-
-	while(p->fetchRow())
-	{
-		if(TeProgress::instance()->wasCancelled())
-		{
-			TeProgress::instance()->reset();
-			
-			errMsg_ = "The process was canceled by user!";
-
-			delete p;
-
-			return false;
-		}
-
-
-		++lo;
-
-		string completeName = "";
-
-		if(!metadata_.locationType_.empty())
-			completeName = TeConvertToUpperCase(p->getData(metadata_.locationType_));
-
-		if(!metadata_.locationTitle_.empty())
-		{
-			string aux = TeConvertToUpperCase(p->getData(metadata_.locationTitle_));
-
-			if(!completeName.empty() && !aux.empty())
-				completeName += " ";
-
-			completeName += aux;			
-		}
-
-		if(!metadata_.locationPreposition_.empty())
-		{
-			string aux = TeConvertToUpperCase(p->getData(metadata_.locationPreposition_));
-
-			if(!completeName.empty() && !aux.empty())
-				completeName += " ";
-
-			completeName += aux;			
-		}
-
-		if(!metadata_.locationName_.empty())
-		{
-			string aux = TeConvertToUpperCase(p->getData(metadata_.locationName_));
-
-			if(!completeName.empty() && !aux.empty())
-				completeName += " ";
-
-			completeName += aux;			
-		}
-
-		string value = p->getData(metadata_.linkColumnName_);
-
-		sql  = "UPDATE " + metadata_.tableName_ + " SET ";
-		sql += metadata_.locationCompleteName_ + " = '" + db_->escapeSequence(completeName) + "' WHERE ";
-		sql += metadata_.linkColumnName_ + " = '" + value + "'";
-		
-		if(!db_->execute(sql))
-		{
-			delete p;
-
-			errMsg_ = "Couldn't update complete name column!";
-		
-			return false;
-		}
-
-		if(TeProgress::instance())
-		{
-			t2 = clock();
-			if(int(t2-t1) > dt)
-			{
-				t1 = t2;
-				
-				if((int)(t2-t0) > dt2)
-					TeProgress::instance()->setProgress(lo);
-			}
-		}
-	}
-
-	delete p;
-
-	if(TeProgress::instance())
-		TeProgress::instance()->reset();
-
-
-	return true;
-}
-
-
-void TeAddressLocator::cleanAddressesFound(const string& locName, vector<TeAddressDescription>& addressesFound, const bool& disabletype, const bool& disabletitle, const bool& disablepreposition)
-{
-	vector<TeAddressDescription> newAddresses;
-
-	for(unsigned int i = 0; i < addressesFound.size(); ++i)
-	{
-		TeAddressDescription add = addressesFound[i];
-		
-		string name = "";
-
-		if(!add.locationType_.empty() && !disabletype)
-		{
-			TeTrim(add.locationType_);
-
-			add.locationType_ = TeConvertToUpperCase(add.locationType_);
-
-			name = add.locationType_;
-		}
-
-		if(!add.locationTitle_.empty() && !disabletitle)
-		{
-			TeTrim(add.locationTitle_);
-
-			add.locationTitle_ = TeConvertToUpperCase(add.locationTitle_);
-
-			if(!name.empty() && !add.locationTitle_.empty())
-				name += " ";
-
-			name += add.locationTitle_;
-		}
-
-		if(!add.locationPreposition_.empty() && !disablepreposition)
-		{
-			TeTrim(add.locationPreposition_);
-
-
-			add.locationPreposition_ = TeConvertToUpperCase(add.locationPreposition_);
-
-			if(!name.empty() && !add.locationPreposition_.empty())
-				name += " ";
-
-			name += add.locationPreposition_;
-		}
-		
-		if(!add.locationName_.empty())
-		{
-			TeTrim(add.locationName_);
-			
-			add.locationName_ = TeConvertToUpperCase(add.locationName_);
-
-			if(!name.empty() && !add.locationName_.empty())
-				name += " ";
-
-			name += add.locationName_;
-		}
-
-		if(name == locName)
-			newAddresses.push_back(addressesFound[i]);
-	}
-
-	addressesFound = newAddresses;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*
+ * TODO: 1. Usar os 5 primeiros d�gitos do CEP para desempatar, pois eles levam 
+ *          ao bairro.
+ */
+
+#include "TeAddressLocator.h"
+#include "TeUtils.h"
+
+#include "TeProgress.h"
+#include "TeAsciiFile.h"
+#include "TeVectorRemap.h"
+
+#include <string>
+
+using namespace std;
+
+double TeSimilarity(const char* streetname, const char* rotuloname);
+
+void validColumnName(TeAttributeRep& rep, TeAttributeList& attrList)
+{
+	unsigned int nStep = attrList.size();
+
+	string repName = TeConvertToUpperCase(rep.name_);
+
+	bool alter = true;
+
+	while(alter)
+	{
+		alter = false;
+
+		for(unsigned int i = 0; i < nStep; ++i)
+		{
+			if(TeConvertToUpperCase(attrList[i].rep_.name_) == repName)
+			{
+				rep.name_ += "_";
+				alter = true;
+				repName = TeConvertToUpperCase(rep.name_);
+			}
+		}
+	}
+}
+
+void tokenize(const string& name, vector<string>& tokens)
+{
+	unsigned int nStep = name.size();
+
+	string token = "";
+
+	unsigned int i = 0;
+
+	for(i = 0; i < nStep; ++i)
+	{
+		if(name[i] != ' ')
+			token += name[i];
+		else
+		{
+			if(!token.empty())
+			{
+				tokens.push_back(token);
+				token = "";
+			}
+		}		
+	}
+
+	if(!token.empty())
+		tokens.push_back(token);
+}
+
+//---- TeAddressLocator methods
+
+bool TeAddressLocator::createAddressMetadataTable(void)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	if(db_->tableExist("te_address_locator"))
+	{
+		// Verificar se a coluna com o nome completo existe.
+		// Nas vers�es anteriores essa coluna n�o era usada.
+
+		TeAttribute attr;
+
+		if(!db_->columnExist("te_address_locator", "location_full_name", attr))
+		{
+			// Se a coluna n�o existe, tenta adicionar a coluna � tabela de metadado
+			TeAttribute at10;
+			at10.rep_.type_ = TeSTRING;
+			at10.rep_.name_ = "location_full_name";
+			at10.rep_.numChar_ = 255;
+
+			if(!db_->addColumn("te_address_locator", at10.rep_))
+			{
+				errMsg_ = "Couldn't add location_full_name column to te_address_locator table!";
+
+				return false;
+			}			
+		}
+
+
+		errMsg_ = "The te_address_locator table already exist!";
+
+		return false;
+	}
+	
+	TeAttributeList attList;
+
+	TeAttribute at1;
+	at1.rep_.type_ = TeINT;
+	at1.rep_.name_ = "table_id";
+	at1.rep_.isPrimaryKey_ = true;
+	at1.rep_.isAutoNumber_ = false;
+	attList.push_back(at1);	
+
+	TeAttribute at2;
+	at2.rep_.type_ = TeSTRING;
+	at2.rep_.name_ = "initial_left_number";
+	at2.rep_.numChar_ = 255;
+	attList.push_back(at2);	
+
+	TeAttribute at3;
+	at3.rep_.type_ = TeSTRING;
+	at3.rep_.name_ = "final_left_number";
+	at3.rep_.numChar_ = 255;
+	attList.push_back(at3);	
+
+	TeAttribute at4;
+	at4.rep_.type_ = TeSTRING;
+	at4.rep_.name_ = "initial_right_number";
+	at4.rep_.numChar_ = 255;
+	attList.push_back(at4);	
+
+	TeAttribute at5;
+	at5.rep_.type_ = TeSTRING;
+	at5.rep_.name_ = "final_right_number";
+	at5.rep_.numChar_ = 255;
+	attList.push_back(at5);
+
+	TeAttribute at6;
+	at6.rep_.type_ = TeSTRING;
+	at6.rep_.name_ = "location_type";
+	at6.rep_.numChar_ = 255;
+	attList.push_back(at6);
+
+	TeAttribute at7;
+	at7.rep_.type_ = TeSTRING;
+	at7.rep_.name_ = "location_title";
+	at7.rep_.numChar_ = 255;
+	attList.push_back(at7);
+
+	TeAttribute at8;
+	at8.rep_.type_ = TeSTRING;
+	at8.rep_.name_ = "location_preposition";
+	at8.rep_.numChar_ = 255;
+	attList.push_back(at8);
+
+	TeAttribute at9;
+	at9.rep_.type_ = TeSTRING;
+	at9.rep_.name_ = "location_name";
+	at9.rep_.numChar_ = 255;
+	attList.push_back(at9);
+
+	TeAttribute at10;
+	at10.rep_.type_ = TeSTRING;
+	at10.rep_.name_ = "location_full_name";
+	at10.rep_.numChar_ = 255;
+	attList.push_back(at10);
+
+
+	TeAttribute at11;
+	at11.rep_.type_ = TeSTRING;
+	at11.rep_.name_ = "left_neighborhood";
+	at11.rep_.numChar_ = 255;
+	attList.push_back(at11);
+
+	TeAttribute at12;
+	at12.rep_.type_ = TeSTRING;
+	at12.rep_.name_ = "right_neighborhood";
+	at12.rep_.numChar_ = 255;
+	attList.push_back(at12);
+
+	TeAttribute at13;
+	at13.rep_.type_ = TeSTRING;
+	at13.rep_.name_ = "left_zip_code";
+	at13.rep_.numChar_ = 255;
+	attList.push_back(at13);
+
+	TeAttribute at14;
+	at14.rep_.type_ = TeSTRING;
+	at14.rep_.name_ = "right_zip_code";
+	at14.rep_.numChar_ = 255;
+	attList.push_back(at14);
+
+	if(!db_->createTable("te_address_locator", attList))
+	{
+		errMsg_ = "Could not create te_address_locator table!";
+
+		return false;
+	}
+
+	if(!db_->createRelation("address_locator_relation", "te_address_locator", "table_id", "te_layer_table", "table_id", true))
+	{
+		errMsg_ = "Referential integrity could not be stabilished beteween te_address_locator and te_layer_table tables!";
+	
+		return false;
+	}
+
+	return true;
+}
+
+bool TeAddressLocator::insertAddressMetadata(const TeAddressMetadata& metadata)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	string sql  = "INSERT INTO te_address_locator (table_id, initial_left_number, ";
+	       sql += "final_left_number, initial_right_number, final_right_number, ";
+		   sql += "location_type, location_title, location_preposition, location_name, location_full_name, left_neighborhood, right_neighborhood, ";
+		   sql += "left_zip_code, right_zip_code) VALUES(";
+		   sql += Te2String(metadata.tableId_);
+		   sql += ", '";
+		   sql += metadata.initialLeftNumber_;
+		   sql += "', '";
+		   sql += metadata.finalLeftNumber_;
+		   sql += "', '";
+		   sql += metadata.initialRightNumber_;
+		   sql += "', '";
+		   sql += metadata.finalRightNumber_;
+		   sql += "', '";
+		   sql += metadata.locationType_;
+		   sql += "', '";
+		   sql += metadata.locationTitle_;
+		   sql += "', '";
+		   sql += metadata.locationPreposition_;
+		   sql += "', '";
+		   sql += metadata.locationName_;
+		   sql += "', '";
+		   sql += metadata.locationCompleteName_;
+		   sql += "', '";
+		   sql += metadata.leftNeighborhood_;
+		   sql += "', '";
+		   sql += metadata.rightNeighborhood_;
+		   sql += "', '";
+		   sql += metadata.leftZipCode_;
+		   sql += "', '";
+		   sql += metadata.rightZipCode_;
+		   sql += "')";
+
+	if(!db_->execute(sql))
+	{
+		errMsg_ = "Could not insert metadata information about geocoding base table!";
+
+		return false;
+	}	
+
+	return loadAddressMetadata(metadata.tableId_);
+	
+	//if(!metadata.leftZipCode_.empty())
+	//	removeHifen_ = verifyHifen(metadata_.tableName_, metadata.leftZipCode_);
+
+	//return true;
+}
+
+bool TeAddressLocator::updateAddressMetadata(const TeAddressMetadata& metadata)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	//if(metadata_.tableId_ != metadata.tableId_)
+	//	return false;	// Doesn't update a diferent attribute table....
+
+	string sql  = "UPDATE te_address_locator SET initial_left_number = '";
+	       sql += metadata.initialLeftNumber_;
+		   sql += "', final_left_number = '";
+		   sql += metadata.finalLeftNumber_;
+		   sql += "', initial_right_number = '";
+		   sql += metadata.initialRightNumber_;
+		   sql += "', final_right_number = '";
+		   sql += metadata.finalRightNumber_;
+		   sql += "', location_type = '";
+		   sql += metadata.locationType_;
+		   sql += "', location_title = '";
+		   sql += metadata.locationTitle_;
+		   sql += "', location_preposition = '";
+		   sql += metadata.locationPreposition_;
+		   sql += "', location_name = '";
+		   sql += metadata.locationName_;
+		   sql += "', location_full_name = '";
+		   sql += metadata.locationCompleteName_;
+		   sql += "', left_neighborhood = '";
+		   sql += metadata.leftNeighborhood_;
+		   sql += "', right_neighborhood = '";
+		   sql += metadata.rightNeighborhood_;
+		   sql += "', left_zip_code = '";
+		   sql += metadata.leftZipCode_;
+		   sql += "', right_zip_code = '";
+		   sql += metadata.rightZipCode_;
+		   sql += "' WHERE table_id = ";
+		   sql += Te2String(metadata.tableId_);	
+
+	if(!db_->execute(sql))
+	{
+		errMsg_ = "Could not update metadata information about geocoding base table!";
+
+		return false;
+	}
+
+	return loadAddressMetadata(metadata.tableId_);
+
+	//if(!metadata.leftZipCode_.empty())
+	//	removeHifen_ = verifyHifen(metadata_.tableName_, metadata.leftZipCode_);	
+
+	//return true;
+}
+
+bool TeAddressLocator::deleteAddressMetadata(const int& tableId)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	string sql  = "DELETE FROM te_address_locator WHERE table_id = ";
+	       sql += Te2String(tableId);
+
+	if(db_->execute(sql))
+		return true;
+	else
+	{
+		errMsg_ = "Could not remove metadata information about geocoding base table!";
+
+		return false;
+	}
+}
+
+bool TeAddressLocator::loadAddressMetadata(const int& tableId)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	isMetadataLoaded_ = false;
+
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return false;
+
+	string sql  = "SELECT te_address_locator.*, te_layer_table.attr_table, te_layer_table.attr_link, te_layer.layer_id";
+		   sql += "  FROM te_address_locator, te_layer_table, te_layer ";
+		   sql += " WHERE  te_layer_table.layer_id = te_layer.layer_id ";
+		   sql += "        AND ";
+		   sql += "        te_address_locator.table_id = te_layer_table.table_id ";
+		   sql += "        AND ";
+		   sql += "        te_address_locator.table_id = ";
+	       sql += Te2String(tableId);
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+
+		errMsg_ = "Could not find metadata for geocoding base table!";
+
+		return false;
+	}
+
+	fillAddressMetadata(metadata_, portal);
+
+	int layerId = portal->getInt("layer_id");
+
+	referenceLayer_ = db_->layerMap()[layerId];
+
+	delete portal;
+
+	if(referenceLayer_ == 0)
+	{
+		errMsg_ = "Could not find infolayer to be used as base for geocoding!";
+				
+		return false;
+	}
+
+	isMetadataLoaded_ = true;
+
+
+	if(!metadata_.leftZipCode_.empty())
+		removeHifen_ = !verifyHifen(metadata_.tableName_, metadata_.leftZipCode_);
+
+	return true;
+}
+
+bool TeAddressLocator::setAddressLocatorMetadata(const TeAddressMetadata& m)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return false;
+
+	string sql  = "SELECT te_layer.layer_id";
+		   sql += "  FROM te_layer_table, te_layer ";
+		   sql += " WHERE te_layer_table.layer_id = te_layer.layer_id ";
+		   sql += "       AND ";
+		   sql += "       te_layer_table.table_id = ";
+	       sql += Te2String(m.tableId_);
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+
+		errMsg_ = "Could not find layer for geocoding base table!";
+
+		return false;
+	}
+
+	int layerId = portal->getInt("layer_id");
+
+	referenceLayer_ = db_->layerMap()[layerId];
+
+	if(referenceLayer_ == 0)
+	{
+		errMsg_ = "Could not find infolayer to be used as base for geocoding!";
+				
+		return false;
+	}
+
+	metadata_ = m;
+
+	isMetadataLoaded_ = true;
+
+	if(!metadata_.leftZipCode_.empty())
+		removeHifen_ = !verifyHifen(metadata_.tableName_, metadata_.leftZipCode_);
+
+	return true;
+}
+
+bool TeAddressLocator::getAllAddressMetadataLayer(const int& layerId, vector<TeAddressMetadata>& addVec)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return false;
+
+	string sql  = "SELECT te_address_locator.*, te_layer_table.attr_table, te_layer_table.attr_link, te_layer.layer_id ";
+		   sql += "  FROM te_address_locator, te_layer_table, te_layer ";
+		   sql += " WHERE te_layer_table.layer_id = te_layer.layer_id ";
+		   sql += "       AND ";
+		   sql += "       te_address_locator.table_id = te_layer_table.table_id ";
+		   sql += "       AND ";
+		   sql += "       te_layer_table.layer_id = "; 
+	       sql += Te2String(layerId);
+		   sql += " ORDER BY te_layer_table.table_id";
+
+	if(!portal->query(sql))
+	{
+		delete portal;
+
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		TeAddressMetadata m;
+
+		this->fillAddressMetadata(m, portal);		
+
+		addVec.push_back(m);
+	}
+
+	delete portal;
+
+	return true;
+}
+
+bool TeAddressLocator::getAllAddressMetadataTheme(const int& themeId, vector<TeAddressMetadata>& addVec)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return false;
+
+	string sql  = "SELECT te_address_locator.*, te_layer_table.attr_table, te_layer_table.attr_link, te_layer.layer_id";
+	       sql += "  FROM te_theme_table, te_layer_table, te_address_locator, te_layer ";
+		   sql += " WHERE te_layer_table.layer_id = te_layer.layer_id ";
+		   sql += "       AND ";
+		   sql += "       te_layer_table.table_id = te_address_locator.table_id ";
+		   sql += "       AND ";
+		   sql += "       te_theme_table.table_id = te_layer_table.table_id "; 
+		   sql += "       AND ";
+		   sql += "       te_theme_table.theme_id = ";
+	       sql += Te2String(themeId);
+		   sql += " ORDER BY te_theme_table.table_id";
+
+	if(!portal->query(sql))
+	{
+		delete portal;
+
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		TeAddressMetadata m;
+
+		this->fillAddressMetadata(m, portal);		
+
+		addVec.push_back(m);
+	}
+
+	delete portal;
+
+	return true;
+}
+
+bool TeAddressLocator::getAddressLocatorLayers(vector<pair<int, string> >& layerNameVec)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return false;
+
+	string sql  = "SELECT DISTINCT te_layer.layer_id, te_layer.name ";
+	       sql += "  FROM te_address_locator, te_layer_table, te_layer ";
+		   sql += " WHERE te_layer.layer_id = te_layer_table.layer_id ";
+		   sql += "       AND ";
+		   sql += "       te_address_locator.table_id = te_layer_table.table_id "; 
+		   sql += " ORDER BY te_layer.name ASC";
+
+	if(!portal->query(sql))
+	{
+		delete portal;
+
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		pair<int, string> d(atoi(portal->getData(0)), portal->getData(1));
+		layerNameVec.push_back(d);
+	}
+
+	delete portal;
+
+	return true;
+}
+
+bool TeAddressLocator::getAddressLocatorLayerTables(vector<pair<int, string> >& tableNameVec, const int& layerId)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return false;
+
+	string sql  = "SELECT te_layer_table.table_id, te_layer_table.attr_table ";
+	       sql += "  FROM te_address_locator, te_layer_table ";
+		   sql += " WHERE te_layer_table.table_id = te_address_locator.table_id";
+		   sql += "       AND ";
+		   sql += "       te_layer_table.layer_id = ";
+		   sql += Te2String(layerId);
+		   sql += " ORDER BY te_layer_table.attr_table ASC";
+
+	if(!portal->query(sql))
+	{
+		delete portal;
+
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		pair<int, string> d(atoi(portal->getData(0)), portal->getData(1));
+		tableNameVec.push_back(d);
+	}
+
+	delete portal;
+
+	return true;
+}
+
+bool TeAddressLocator::findGeocodingTables(vector<pair<int, string> >& tableNames)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	string sql  = "SELECT * FROM te_layer_table WHERE attr_table_type = ";
+	       sql += Te2String(TeGeocodingData);
+		   sql += " ORDER BY attr_table";
+
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return false;	
+
+	if(!portal->query(sql))
+	{
+		delete portal;
+
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		pair<int, string> d(atoi(portal->getData("table_id")), portal->getData("attr_table"));
+		tableNames.push_back(d);
+	}
+
+	delete portal;
+
+	return true;
+}
+
+
+// 8    -> Found by similar search
+// 9    -> Found by neighborhood or zip code
+
+// 10	 -> Found by name location and number without type
+// 11	 -> Found multiples by name location and number  without type
+// 12	 -> Found by name location without number and type
+// 13	 -> Found multiples by name location without number and type
+
+// 14	 -> Found by name location and number without type and title
+// 15	 -> Found multiples by name location and number  without type and title
+// 16	 -> Found by name location without number and type and title
+// 17	 -> Found multiples by name location without number and type and title
+
+// 18	 -> Found by name location and number without type, title and preposition
+// 19	 -> Found multiples by name location and number  without type, title and preposition
+// 20	 -> Found by name location without number and type, title and preposition
+// 21	 -> Found multiples by name location without number and type, title and preposition
+
+
+
+int TeAddressLocator::findAddress(const TeAddress& address, vector<TeAddressDescription>& addressesFound, const bool& doExaustiveSearch)
+{
+	TeAddress addAux = address;
+
+	string fullName = "";
+
+	normalizeAddress(addAux, fullName);
+
+	if(fullName.empty())
+		return 2;
+
+	// Encontra exato com n�mero
+	int result = findExact(addAux, fullName, true, addressesFound);
+
+	if(result > 3)
+		return result;
+
+	// Encontra exato sem n�mero
+	result = findExact(addAux, fullName, false, addressesFound);
+
+	if(result > 3)
+		return result;
+
+	// Encontrar com a ajuda do dicion�rio sem n�mero
+	if(!dictionary_.empty())
+	{
+		// Dicion�rio com n�mero
+		result = findWithDictionary(addAux, fullName, true, addressesFound);
+
+		if(result > 3)
+			return result;
+
+
+		// Dicion�rio sem n�mero
+		result = findWithDictionary(addAux, fullName, false, addressesFound);
+
+		if(result > 3)
+			return result;
+	}
+
+	// ***********************************
+	// * Try to search by a similar name *
+	// ***********************************
+	TeAddressDescription descript;
+
+	if((addAux.locationNumber_ != 0) && findSimilarAddress(addAux, fullName, descript))
+	{
+		addressesFound.clear();
+		addressesFound.push_back(descript);
+
+		return 8;
+	}
+
+	if(doExaustiveSearch)
+	{
+		// Tenta remover o tipo
+		if(!typesVector_.empty())
+		{
+			result = findWithoutAllName(addAux, fullName, addressesFound, true);
+
+			switch(result)
+			{
+				case 4 :	return 10;
+				case 5 :	return 11;
+				case 6 :    return 12;
+				case 7 :    return 13;
+			}
+		}
+
+
+		// Tenta remover titulo
+		if(!titlesVector_.empty())
+		{
+			result = findWithoutAllName(addAux, fullName, addressesFound, true, true);
+
+			switch(result)
+			{
+				case 4 :	return 14;
+				case 5 :	return 15;
+				case 6 :    return 16;
+				case 7 :    return 17;
+			}
+		}
+
+
+		// Tenta remover preposicao
+		if(!prepositionsVector_.empty())
+		{
+			result = findWithoutAllName(addAux, fullName, addressesFound, true, true, true);
+
+			switch(result)
+			{
+				case 4 :	return 18;
+				case 5 :	return 19;
+				case 6 :    return 20;
+				case 7 :    return 21;
+			}
+		}
+	}
+
+	
+	// *****************************************
+	// * Try to match zip code or neighborhood *
+	// *****************************************
+	if(cmetadata_.centroidLayer_)
+	{
+		if(findByCentroid(addAux, addressesFound))
+		{
+			if(addressesFound.size() > 1)
+				return 1;
+			else
+				return 9;
+		}
+	}
+
+	return result;
+}
+
+
+int TeAddressLocator::findWithDictionary(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound)
+{
+	// Quebrar o nome em tokens
+	vector<string> tokens;
+	tokenize(fullName, tokens);
+
+
+	// Para cada token, procurar um sin�nimo
+	for(unsigned int i = 0; i < tokens.size(); ++i)
+	{
+		pair<TeGeocoderDictionary::iterator, TeGeocoderDictionary::iterator> itRange = dictionary_.equal_range(tokens[i]);
+
+		while(itRange.first != itRange.second)
+		{
+			// Monta o nome para pesquisa
+			string str = "";
+
+			for(unsigned int j = 0; j < tokens.size(); ++j)
+			{
+				if(j != 0)
+					str += " ";
+
+				if(j == i)
+					str += (itRange.first)->second;
+				else
+					str += tokens[j];
+			}
+
+			// Fazer a pesquisa exata
+			int res = findExact(address, str, withNumber, addressesFound);
+
+			if(res > 3)
+				return res;
+
+			++(itRange.first);
+		}
+	}
+
+	return 1;
+}
+
+int TeAddressLocator::findWithoutAllName(const TeAddress& address, const string& fullName, vector<TeAddressDescription>& addressesFound, const bool& disabletype, const bool& disabletitle, const bool& disablepreposition)
+{
+	// Quebrar o nome em tokens
+	vector<string> tokens;
+	tokenize(fullName, tokens);
+
+	string str = "";
+
+	bool typeYetDisabled = false;
+	bool titleYetDisabled = false;
+	bool prepositionYetDisabled = false;
+
+	unsigned int i = 0;
+
+	// Ve se precisa eliminar algum token e j� tenta sem usar dicion�rio
+	for(i = 0; i < tokens.size(); ++i)
+	{
+		string aux = tokens[i];
+
+		// verifica se o string ser� eliminado caso o tipo esteja desabilitado
+		if(disabletype)
+		{
+			if(binary_search(typesVector_.begin(), typesVector_.end(), aux))
+			{
+				aux = "";
+				typeYetDisabled = true;
+				continue;
+			}
+		}
+
+		if(disabletitle)
+		{
+			if(binary_search(titlesVector_.begin(), titlesVector_.end(), aux))
+			{
+				aux = "";
+				titleYetDisabled = true;
+				continue;
+			}
+
+		}
+
+		if(disablepreposition && !prepositionYetDisabled)
+		{
+			if(binary_search(prepositionsVector_.begin(), prepositionsVector_.end(), aux))
+			{
+				aux = "";
+				prepositionYetDisabled = true;
+				continue;
+			}
+		}
+
+		if(!str.empty())
+			str += " ";
+
+		str += aux;
+	}
+
+	int res = 1;
+
+	if(typeYetDisabled || titleYetDisabled || prepositionYetDisabled)
+	{
+		res = findPattern(address, str, true, addressesFound, disabletype, disabletitle, disablepreposition);
+
+		if(res > 3)
+			return res;
+	}
+
+	if(typeYetDisabled || titleYetDisabled || prepositionYetDisabled)
+	{
+		res = findPattern(address, str, false, addressesFound, disabletype, disabletitle, disablepreposition);
+
+		if(res > 3)
+			return res;
+	}
+
+	if(dictionary_.empty())
+		return 1;
+
+	// Para cada token, procurar um sin�nimo
+	for(i = 0; i < tokens.size(); ++i)
+	{
+		pair<TeGeocoderDictionary::iterator, TeGeocoderDictionary::iterator> itRange = dictionary_.equal_range(tokens[i]);
+
+
+		while(itRange.first != itRange.second)
+		{
+			// Monta o nome para pesquisa
+			str = "";
+			typeYetDisabled = false;
+			titleYetDisabled = false;
+			prepositionYetDisabled = false;
+
+
+			for(unsigned int j = 0; j < tokens.size(); ++j)
+			{
+				string aux = "";
+
+				if(j == i)
+				{
+					aux = (itRange.first)->second;
+				}
+				else
+				{
+					aux = tokens[j];
+				}
+
+				// verifica se o string ser� eliminado caso o tipo esteja desabilitado
+				if(disabletype)
+				{
+					if(binary_search(typesVector_.begin(), typesVector_.end(), aux))
+					{
+						aux = "";
+						typeYetDisabled = true;
+						continue;
+					}
+				}
+
+				if(disabletitle)
+				{
+					if(binary_search(titlesVector_.begin(), titlesVector_.end(), aux))
+					{
+						aux = "";
+						titleYetDisabled = true;
+						continue;
+					}
+
+				}
+
+				if(disablepreposition && !prepositionYetDisabled)
+				{
+					if(binary_search(prepositionsVector_.begin(), prepositionsVector_.end(), aux))
+					{
+						aux = "";
+						prepositionYetDisabled = true;
+						continue;
+					}
+				}
+
+				if(!str.empty())
+					str += " ";
+
+				str += aux;
+			}
+
+			if(typeYetDisabled || titleYetDisabled || prepositionYetDisabled)
+			{
+				res = findPattern(address, str, true, addressesFound, disabletype, disabletitle, disablepreposition);
+
+				if(res > 3)
+					return res;
+			}
+
+			if(typeYetDisabled || titleYetDisabled || prepositionYetDisabled)
+			{
+				res = findPattern(address, str, false, addressesFound, disabletype, disabletitle, disablepreposition);
+
+				if(res > 3)
+					return res;
+			}
+
+			++(itRange.first);
+		}
+	}
+
+	return 1;
+}
+
+// 0	 -> Database connection problem
+// 1     -> Address not found
+// 3     -> Error on query the database
+// 4	 -> Found by name location and number
+// 5	 -> Found multiples by name location and number
+// 6	 -> Found by name location without number 
+// 7	 -> Found multiples by name location without number
+int TeAddressLocator::findExact(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound)
+{
+	TeAddress addressToFind = address;
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return 0;
+	}
+
+	// The status of a query
+	bool executeQuery = false;
+
+	// String with the result query expression
+	string strSQL = "";
+
+	// String with the select...from clause
+	string strSelect  = "SELECT * FROM ";
+	       strSelect += metadata_.tableName_;
+		   
+	// String with the where clause;
+	string strWhere = " WHERE ";
+
+	// **************************************************
+	// * Try to match name an number                    *
+	// **************************************************		
+	{
+		int auxNumber = addressToFind.locationNumber_ ;
+
+		if(!withNumber)
+			addressToFind.locationNumber_ = 0;
+
+		strWhere += mountExactWhereSQL(addressToFind, fullName);
+
+		strSQL = strSelect + strWhere;
+
+		queryAddresses(strSQL, executeQuery, addressesFound);
+
+		if(addressesFound.size() > 0)
+		{
+			if((addressesFound.size() > 1) && (!addressToFind.zipCode_.empty()))
+				this->refineFoundedLocationsByZipCode(addressToFind, addressesFound);
+
+			if((addressesFound.size() > 1) && (!addressToFind.neighborhood_.empty()))
+				this->refineFoundedLocationsByNeighBorhood(addressToFind, addressesFound);
+
+			if((addressesFound.size() > 1) && (!metadata_.leftZipCode_.empty() || !metadata_.rightZipCode_.empty()) && (addressToFind.locationNumber_ == 0))
+			{
+				addressToFind.locationNumber_ = auxNumber;
+
+				refineFoundedLocationsByNumberZipCode(addressToFind, addressesFound);
+
+				addressToFind.locationNumber_ = 0;
+			}
+			else if((addressesFound.size() > 1) && (addressToFind.locationNumber_ == 0))
+			{
+				addressToFind.locationNumber_ = auxNumber;
+
+				refineFoundedLocationsByNumberNeighboor(addressToFind, addressesFound);
+
+				addressToFind.locationNumber_ = 0;
+			}
+
+	
+			if(addressesFound.size() > 1)
+			{
+				if(addressToFind.locationNumber_ == 0)
+					return 7;
+				else
+					return 5;							
+			}
+			else
+			{
+				if(addressToFind.locationNumber_ == 0)
+					return 6;
+				else
+					return 4;
+			}
+		}
+	}
+
+	// ***************************************************************************
+	// * If we are here so we did not find any address or the queries were wrong *
+	// ***************************************************************************
+	if(executeQuery)
+		return 1;	// If at leat one query was executed, return not found any address
+	else
+		return 3;	// Otherwise return an error on all queries
+}
+
+int TeAddressLocator::findPattern(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound, const bool& disabletype, const bool& disabletitle, const bool& disablepreposition)
+{
+	TeAddress addressToFind = address;
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return 0;
+	}
+
+	// The status of a query
+	bool executeQuery = false;
+
+	// String with the result query expression
+	string strSQL = "";
+
+	// String with the select...from clause
+	string strSelect  = "SELECT * FROM ";
+	       strSelect += metadata_.tableName_;
+		   
+	// String with the where clause;
+	string strWhere = " WHERE ";
+
+	// **************************************************
+	// * Try to match name an number                    *
+	// **************************************************		
+	{
+		int auxNumber = addressToFind.locationNumber_ ;
+
+		if(!withNumber)
+			addressToFind.locationNumber_ = 0;
+
+		if(!metadata_.locationType_.empty() || !metadata_.locationTitle_.empty() || !metadata_.locationPreposition_.empty())
+			strWhere += mountPatternWhereSQL(addressToFind, fullName, disabletype, disabletitle, disablepreposition);
+		else
+			strWhere += mountLikeWhereSQL(addressToFind, fullName);
+
+		strSQL = strSelect + strWhere;
+
+		queryAddresses(strSQL, executeQuery, addressesFound);
+
+		if(addressesFound.size() > 0)
+		{
+			if(!metadata_.locationType_.empty() || !metadata_.locationTitle_.empty() || !metadata_.locationPreposition_.empty())
+				cleanAddressesFound(fullName, addressesFound, disabletype, disabletitle, disablepreposition);
+
+			if(addressesFound.size() > 0)
+			{
+				if((addressesFound.size() > 1) && (!addressToFind.zipCode_.empty()))
+					this->refineFoundedLocationsByZipCode(addressToFind, addressesFound);
+
+				if((addressesFound.size() > 1) && (!addressToFind.neighborhood_.empty()))
+					this->refineFoundedLocationsByNeighBorhood(addressToFind, addressesFound);
+
+				if((addressesFound.size() > 1) && (!metadata_.leftZipCode_.empty() || !metadata_.rightZipCode_.empty()) && (addressToFind.locationNumber_ == 0))
+				{
+					addressToFind.locationNumber_ = auxNumber;
+
+					refineFoundedLocationsByNumberZipCode(addressToFind, addressesFound);
+
+					addressToFind.locationNumber_ = 0;
+				}
+				else if((addressesFound.size() > 1) && (addressToFind.locationNumber_ == 0))
+				{
+					addressToFind.locationNumber_ = auxNumber;
+
+					refineFoundedLocationsByNumberNeighboor(addressToFind, addressesFound);
+
+					addressToFind.locationNumber_ = 0;
+				}
+
+		
+				if(addressesFound.size() > 1)
+				{
+					if(addressToFind.locationNumber_ == 0)
+						return 7;
+					else
+						return 5;							
+				}
+				else
+				{
+					if(addressToFind.locationNumber_ == 0)
+						return 6;
+					else
+						return 4;
+				}
+			}
+		}
+	}
+
+	// ***************************************************************************
+	// * If we are here so we did not find any address or the queries were wrong *
+	// ***************************************************************************
+	if(executeQuery)
+		return 1;	// If at leat one query was executed, return not found any address
+	else
+		return 3;	// Otherwise return an error on all queries
+}
+
+
+bool TeAddressLocator::addressGeocode(TeGeocodeTableMetadata& tableMetadata, 
+									  const string& newLayerName, 
+									  const string& reportName, 
+									  const string& reportDir, 
+									  const bool& doExaustive, 
+									  TeAbstractAddressNotifyFunctor* /* notifyFunction */)
+{
+	errMsg_ = "";
+
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return 0;
+	}
+
+	if(tableMetadata.locationNameColumnName_.empty())
+	{
+		errMsg_ = "The name field must be filled!";
+		
+		return false;
+	}
+
+	// Verifica se o metadado para o processo de espacializa��o foi previamente carregado
+	if(!isMetadataLoaded())
+	{
+		errMsg_ = "Load metadata for geocoding layer before!";
+		
+		return false;
+	}
+
+	// Verifica se o metadado para o processo de espacializa��o foi previamente carregado
+	if(metadata_.locationCompleteName_.empty())
+	{
+		errMsg_ = "Please, check the configuration for geocoding layer before! The complete name is empty!";
+		
+		return false;
+	}
+
+
+
+	// Carrega os tipos, preposi��es e t�tulos existentes na base para poder 
+	// realizar substitui��es nos nomes de endere�os no caso da pesquisa alternativa
+	if(!loadAddressCompoundNames())
+	{	
+		return false;
+	}	
+
+	// Verifica se os metadados dos layers foram carregados
+	if(db_->layerMap().empty())
+	{
+		if(!db_->loadLayerSet())
+		{
+			errMsg_ = "Could not load infolayers metadata!";
+		
+			return false;
+		}
+	}
+
+	// Verifica se j� existe um layer com o nome escolhido
+	if(db_->layerExist(newLayerName))
+	{
+		errMsg_ = "There is another infolayer with the same name!";
+		
+		return false;
+	}
+
+	// Tenta acrescentar as duas colunas de relat�rio
+	pair<string, string> newCols;
+	if(!addReportColumn(tableMetadata, newCols))
+		return false;	
+
+	// Recupera as informa��es da tabela a ser geocodificada
+	if(!findTableMetadata(tableMetadata))
+		return false;
+	
+	// Tenta pegar o portal para a tabela a ser geocodificada
+	int nlo = 0;
+	TeDatabasePortal* portal = getAddressTablePortal(tableMetadata, nlo);
+
+	if(!portal)
+		return false;
+
+	// Cria um novo layer baseado no layer selecionado
+	TeLayer* newLayer = new TeLayer(newLayerName, db_, referenceLayer_->box(), referenceLayer_->projection());
+
+	// Se n�o conseguir criar a representa��o de pontos, aborta a opera��o.
+	if(!newLayer->addGeometry(TePOINTS))
+	{
+		errMsg_ = "Could not add point representation for new layer!";
+
+		db_->deleteLayer(newLayer->id());
+
+		//delete newLayer;
+
+		delete portal;
+		
+		return false;
+	}
+
+	// Navega pelos registros da tabela a ser espacializada determinando os endere�os
+	TePointSet pSet;
+
+	int lo = 0;
+
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nlo);
+		TeProgress::instance()->setCaption("Address Geocoding");
+		TeProgress::instance()->setMessage("Geocoding addresses...      ");
+	}
+
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+
+	string reportText  = "===> FINAL REPORT OF ADDRESS GEOCODING PROCESS <===\n";
+	       reportText += "     =========================================     \n";
+		   reportText += "\n\n\n";		   
+
+		   reportText += "     ---------------------------------\n\n";
+		   reportText += "SEARCHED ADDRESS|FOUND ADDRESS\n";
+		   reportText += "--------------------------------------------------------------------------------\n";
+		   reportText += "GEOCODING RESULT|UNIQUE ID|TYPE|TITLE|PREPOSITION|LOCATION NAME|NUMBER|NEIGHBOR|ZIPCODE|FOUND ADDRESS====>|UNIQUE ID|TYPE|TITLE|PREPOSITION|LOCATION NAME|INITIAL LEFT|FINAL LEFT|INITIAL RIGHT|FINAL RIGHT|FOUND LEFT NEIGHBOOR|FOUND RIGHT NEIGHBOR|FOUND LEFT ZIPCODE|FOUND RIGHT ZIPCODE\n";
+
+	string reportSummary  = "===> FINAL REPORT OF ADDRESS GEOCODING PROCESS <===\n";
+	       reportSummary += "     =========================================     \n";
+		   reportSummary += "\n\n\n";		   
+
+
+	string reportFileSummary = reportDir + "/" + reportName + "_summary.txt";
+	string reportFile        = reportDir + "/" + reportName + ".txt";	
+
+	TeWriteToFile(reportFile, reportText, "w");
+	TeWriteToFile(reportFileSummary, reportSummary, "w");
+
+	vector<int> summarySum;
+	unsigned int summaryLen = 22;
+	for(unsigned int i = 0; i < summaryLen; ++i)
+		summarySum.push_back(0);
+
+
+	do
+	{
+		if(TeProgress::instance() && TeProgress::instance()->wasCancelled())
+		{
+			TeProgress::instance()->reset();
+			errMsg_ = "The process was canceled by user!";
+
+			db_->deleteLayer(newLayer->id());
+
+			delete portal;
+
+			return false;
+		}
+
+		TeAddress add;
+
+		fillAddress(add, tableMetadata, portal);
+
+		++lo;
+
+		vector<TeAddressDescription> addressesFound;
+
+		int status = findAddress(add, addressesFound, doExaustive);
+
+		summarySum[status] = summarySum[status] + 1;
+
+		string reportLine  = Te2String(status);
+		       reportLine += "|";
+
+		// SEARCHED LOCATION
+		reportLine += add.locationLink_;
+		reportLine += "|";
+		reportLine += add.locationType_;
+		reportLine += "|";
+		reportLine += add.locationTitle_;
+		reportLine += "|";
+		reportLine += add.locationPreposition_;
+		reportLine += "|";
+		reportLine += add.locationName_;
+		reportLine += "|";
+		reportLine += Te2String(add.locationNumber_);			
+		reportLine += "|";			
+		reportLine += add.neighborhood_;
+		reportLine += "|";
+		reportLine += add.zipCode_;
+		reportLine += "|***********|";
+
+			
+		if(status >= 4)	// Encontrou algum endere�o?
+		{
+			TeAddressDescription addDescSimilar = addressesFound[0];
+			
+			if(status != 9)
+				findCoordinate(add, addDescSimilar);
+
+			// REPORT LINE
+
+
+			// FOUNDED LOCATION
+			reportLine += addDescSimilar.locationLink_;
+		    reportLine += "|";
+		    reportLine += addDescSimilar.locationType_;
+			reportLine += "|";
+			reportLine += addDescSimilar.locationTitle_;
+			reportLine += "|";
+			reportLine += addDescSimilar.locationPreposition_;
+			reportLine += "|";
+			reportLine += (addDescSimilar.locationName_.empty()) ? addDescSimilar.locationCompleteName_ : addDescSimilar.locationName_ ;
+			reportLine += "|";
+			reportLine += Te2String(addDescSimilar.initialLeftNumber_);
+			reportLine += "|";
+			reportLine += Te2String(addDescSimilar.finalLeftNumber_);
+			reportLine += "|";
+			reportLine += Te2String(addDescSimilar.initialRightNumber_);
+			reportLine += "|";
+			reportLine += Te2String(addDescSimilar.finalRightNumber_);
+			reportLine += "|";
+			reportLine += addDescSimilar.leftNeighborhood_;
+			reportLine += "|";
+			reportLine += addDescSimilar.rightNeighborhood_;
+			reportLine += "|";
+			reportLine += addDescSimilar.leftZipCode_;
+			reportLine += "|";
+			reportLine += addDescSimilar.rightZipCode_;
+			reportLine += "\n";						
+
+			if(addDescSimilar.isValid_)
+			{
+				// Cria um ponto e o adiciona no pointset
+				TePoint	pt;
+				pt.add(addDescSimilar.pt_);
+				pt.objectId(add.locationLink_);
+				pSet.add(pt);
+			}
+			else
+				status = -1;
+		}
+		else
+		{
+			reportLine += " | | | | | | | | | | | | \n";
+		}
+		
+		TeWriteToFile(reportFile, reportLine, "a");
+
+		this->updateAddressTable(newCols.first, status, tableMetadata, add.locationLink_);
+
+		if(pSet.size() > 100)
+		{
+			if(!newLayer->addPoints(pSet))
+			{
+				errMsg_ = "Could not insert generated points!";
+
+				db_->deleteLayer(newLayer->id());
+
+				delete portal;
+
+				return false;
+			}
+
+			pSet.clear();
+		}
+
+		if(TeProgress::instance())
+		{
+			t2 = clock();
+			if(int(t2-t1) > dt)
+			{
+				t1 = t2;
+				
+				if((int)(t2-t0) > dt2)
+					TeProgress::instance()->setProgress(lo);
+			}
+		}
+	}while(portal->fetchRow());	// Vai para o pr�ximo registro
+
+	if((pSet.size() > 0) && !newLayer->addPoints(pSet))
+	{
+		errMsg_ = "Could not insert generated points!";
+
+		db_->deleteLayer(newLayer->id());
+
+		delete portal;
+
+		return false;
+	}
+
+
+	delete portal;
+
+	string summary  = "\n=================";
+		   summary += "\n===> SUMMARY <===";
+		   summary += "\n=================\n";
+		   summary += "\nNumber of ocurrences of each code:\n";
+
+	int sum = 0;
+	for(unsigned int j = 0; j < summarySum.size(); ++j)
+	{
+		summary += "CODE " + Te2String(j);
+		summary += " => ";
+		summary += Te2String(summarySum[j]);
+		summary += " - ";
+		summary += Te2String((double(summarySum[j]) / double(lo)) * 100.0);
+		summary += "\n";
+
+		if(j > 3)
+			sum = sum + summarySum[j];
+	}
+
+	summary += "=================\n";
+	summary += "TOTAL DE ENDERECOS: " + Te2String(lo) + "\n";
+	summary += "TOTAL DE ENCONTRADOS: " + Te2String(sum) + "\n";
+	summary += "Resultado = " + Te2String((double(sum) / double(lo)) * 100.0) + "\n\n";
+	summary += "LEGEND:\n";
+	summary += "0  -> Database connection problem\n";
+	summary += "1  -> Address not found\n";
+	summary += "2  -> full name empty\n";
+	summary += "3  -> Error on query the database\n";
+	summary += "4  -> Found by name location and number\n";
+	summary += "5  -> Found multiples by name location and number\n";
+	summary += "6  -> Found by name location without number\n";
+	summary += "7  -> Found multiples by name location without number\n";
+	summary += "8  -> Found by similar search\n";
+	summary += "9  -> Found by neighborhood or zip code\n";
+	summary += "10 -> Found by name location and number without type\n";
+	summary += "11 -> Found multiples by name location and number  without type\n";
+	summary += "12 -> Found by name location without number and type\n";
+	summary += "13 -> Found multiples by name location without number and type\n";
+	summary += "14 -> Found by name location and number without type and title\n";
+	summary += "15 -> Found multiples by name location and number  without type and title\n";
+	summary += "16 -> Found by name location without number and type and title\n";
+	summary += "17 -> Found multiples by name location without number and type and title\n";
+	summary += "18 -> Found by name location and number without type, title and preposition\n";
+	summary += "19 -> Found multiples by name location and number  without type, title and preposition\n";
+	summary += "20 -> Found by name location without number and type, title and preposition\n";
+	summary += "21 -> Found multiples by name location without number and type, title and preposition\n";
+
+
+	TeWriteToFile(reportFileSummary, summary, "a");
+
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	// If the table is registered as an geocoding table, so we remove its information from te_layer_table
+	string deleteGeocodingTable  = "DELETE FROM te_layer_table WHERE (layer_id IS NULL) AND table_id = ";
+	       deleteGeocodingTable += Te2String(tableMetadata.tableId_);
+
+	db_->execute(deleteGeocodingTable);
+
+	// Tenta registrar a tabela selecionada no metadado do novo layer
+	TeTable attTable(tableMetadata.tableName_);
+	
+	attTable.setTableType(TeAttrStatic);
+	attTable.setLinkName(tableMetadata.linkColumnName_);
+	attTable.setUniqueName(tableMetadata.keyColumnName_);
+
+	if(!newLayer->createAttributeTable(attTable))
+	{
+		errMsg_ = "N�o foi poss�vel atualizar as informa��es da tabela de atributos para o novo layer";
+
+		db_->deleteLayer(newLayer->id());
+
+		return false;
+	}
+
+	delete newLayer;
+
+	return true;
+}
+
+bool TeAddressLocator::loadDictionary(const string& dictionaryFileName)
+{	
+	errMsg_ = "";
+
+	dictionary_.clear();
+
+	if(dictionaryFileName.empty())
+	{
+		errMsg_ = "Enter with a valid dictionary file name and location!";
+
+		return false;	
+	}
+
+	try
+	{
+		TeAsciiFile dicFile(dictionaryFileName);
+
+		while(dicFile.isNotAtEOF())
+		{
+			vector<string> strList;
+
+			dicFile.readStringListCSV(strList, ',');
+
+			dicFile.findNewLine();
+
+			if(strList.size() <= 1)
+				continue;
+			
+			string str1 = TeConvertToUpperCase(strList[0]);
+
+			str1 = str1.substr(1);
+			str1 = str1.substr(0, str1.size() - 1);
+
+			for(unsigned int i = 1; i < strList.size(); ++i)
+			{
+				string str2 = TeConvertToUpperCase(strList[i]);
+				str2 = str2.substr(1);
+				str2 = str2.substr(0, str2.size() - 1);
+
+				dictionary_.insert(TeGeocoderDictionary::value_type(str2, str1));
+			}
+		}
+
+	}
+	catch(...)
+	{
+		errMsg_ = "Could open file: " + dictionaryFileName;
+
+		return false;
+	}
+	
+	return true;
+}
+
+
+
+//PROTECTED MEMBERS
+bool TeAddressLocator::findSimilarAddress(const TeAddress& address, const string& fullName, TeAddressDescription& descript)
+{
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return 0;
+	}
+
+	// String with the result query expression
+	string strSQL = "";
+
+	// String with the select...from clause
+	string strSelect  = "SELECT * FROM ";
+	       strSelect += metadata_.tableName_;
+		   
+	// Order by of the result query
+	string strOrderBy  = " ORDER BY ";
+		   strOrderBy += metadata_.linkColumnName_;
+
+	// String with the where clause;
+	string strWhere = " WHERE ";
+
+	strWhere += mountSimilarWhereSQL(address);
+
+	strSQL = strSelect + strWhere + strOrderBy;
+
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return false;
+
+	bool found = false;
+
+	// Check if there is a segment that satisfies the clause
+	if(portal->query(strSQL))
+	{
+		double simil, similmax = 75.0;		
+
+		while(portal->fetchRow() && similmax < 100.0)
+		{
+
+			string label = portal->getData(metadata_.locationCompleteName_);
+
+			simil = TeSimilarity(fullName.c_str(), label.c_str());
+		
+			if(simil > similmax)
+			{
+				found = true;
+
+				fillAddressDescription(descript, portal);
+
+				similmax = simil;
+			}
+		}
+	}
+
+	delete portal;
+
+	portal = 0;
+
+	return found;
+}
+
+
+
+bool TeAddressLocator::findByCentroid(const TeAddress& addressToFind, vector<TeAddressDescription>& addressesFound)
+{
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	if(!cmetadata_.centroidLayer_ || cmetadata_.centroidName_.empty() || cmetadata_.attributeTableName_.empty())
+		return false;	
+
+	string strValue = (cmetadata_.fieldType_ == TeNEIGHBORHOOD) ? (addressToFind.neighborhood_)  : (addressToFind.zipCode_);
+
+	if(strValue.empty())
+		return false;
+
+	strValue = TeConvertToUpperCase(strValue);
+	
+	if(removeHifenFromCentroid_ && cmetadata_.fieldType_ == TeZIPCODE)
+		removeHifen(strValue);
+	else if(!removeHifenFromCentroid_ && cmetadata_.fieldType_ == TeZIPCODE)
+		insertHifen(strValue);
+
+
+	string likeSQL = " = '";
+	       likeSQL += strValue;
+		   likeSQL += "'";
+
+	TeTable table;
+	
+	if(!cmetadata_.centroidLayer_->getAttrTablesByName(cmetadata_.attributeTableName_, table))
+		return false;
+	       
+	// String with the result query expression
+	string strSQL  = "SELECT ";
+		   strSQL += table.linkName();
+		   strSQL += ", ";
+	       strSQL += cmetadata_.centroidName_;
+		   strSQL += " FROM ";
+		   strSQL += cmetadata_.attributeTableName_;
+		   strSQL += " WHERE ";
+		   strSQL += db_->toUpper(cmetadata_.centroidName_);
+		   strSQL += likeSQL;
+
+	TeDatabasePortal* p = db_->getPortal();
+
+	if(!p)
+		return false;
+
+	if(!p->query(strSQL))
+	{
+		delete p;
+
+		return false;
+	}
+
+	while(p->fetchRow())
+	{
+		TeAddressDescription add;
+
+		if(cmetadata_.centroidLayer_->hasGeometry(TePOINTS))
+		{
+			TePointSet pset;
+
+			if(cmetadata_.centroidLayer_->loadGeometrySet(p->getData(0), pset))
+			{
+				add.pt_ = TeFindCentroid(pset);
+				add.isValid_ = true;
+			}
+			else
+				continue;
+		}
+		else if(cmetadata_.centroidLayer_->hasGeometry(TeLINES))
+		{
+			TeLineSet lset;
+
+			if(cmetadata_.centroidLayer_->loadGeometrySet(p->getData(0), lset))
+			{
+				add.pt_ = TeFindCentroid(lset);
+				add.isValid_ = true;
+			}
+			else
+				continue;
+		}
+		else if(cmetadata_.centroidLayer_->hasGeometry(TePOLYGONS))
+		{
+			TePolygonSet pset;
+
+			if(cmetadata_.centroidLayer_->loadGeometrySet(p->getData(0), pset))
+			{
+				add.pt_ = TeFindCentroid(pset);
+				add.isValid_ = true;
+			}
+			else
+				continue;
+
+		}
+		else if(cmetadata_.centroidLayer_->hasGeometry(TeCELLS))
+		{
+			TeCellSet cset;
+
+			if(cmetadata_.centroidLayer_->loadGeometrySet(p->getData(0), cset))
+			{
+				add.pt_ = TeFindCentroid(cset);
+				add.isValid_ = true;
+			}
+			else
+				continue;
+		}
+		else
+			continue;
+
+		TeVectorRemap(add.pt_, cmetadata_.centroidLayer_->projection(), add.pt_, referenceLayer_->projection());
+
+		if(cmetadata_.fieldType_ == TeZIPCODE)
+		{
+			add.leftZipCode_ = p->getData(1);
+			add.rightZipCode_ = p->getData(1);
+		}
+		else
+		{
+			add.leftNeighborhood_ = p->getData(1);
+			add.rightNeighborhood_ = p->getData(1);
+		}
+
+		addressesFound.push_back(add);
+	}
+
+	return addressesFound.size() > 0;
+}
+
+
+void TeAddressLocator::fillAddressMetadata(TeAddressMetadata& metadata, TeDatabasePortal* p)
+{
+	metadata.tableId_ = atoi(p->getData("table_id"));
+	metadata.initialLeftNumber_ = p->getData("initial_left_number");
+	metadata.finalLeftNumber_ = p->getData("final_left_number");
+	metadata.initialRightNumber_ = p->getData("initial_right_number");
+	metadata.finalRightNumber_ = p->getData("final_right_number");
+	metadata.locationType_ = p->getData("location_type");
+	metadata.locationTitle_ = p->getData("location_title");
+	metadata.locationPreposition_ = p->getData("location_preposition");
+	metadata.locationName_ = p->getData("location_name");
+	metadata.locationCompleteName_ = p->getData("location_full_name");
+	metadata.leftNeighborhood_ = p->getData("left_neighborhood");
+	metadata.rightNeighborhood_ = p->getData("right_neighborhood");
+	metadata.leftZipCode_ = p->getData("left_zip_code");
+	metadata.rightZipCode_ = p->getData("right_zip_code");
+	metadata.tableName_ = p->getData("attr_table");
+	metadata.linkColumnName_ = p->getData("attr_link");
+	return;
+}
+
+void TeAddressLocator::fillAddress(TeAddress& add, const TeGeocodeTableMetadata& tableMetadata, TeDatabasePortal* p)
+{
+	add.locationLink_ = p->getData(tableMetadata.linkColumnName_);
+
+	add.locationType_ = (tableMetadata.locationTypeColumnName_.empty()) ? "" : p->getData(tableMetadata.locationTypeColumnName_);
+	TeTrim(add.locationType_);
+
+	add.locationTitle_ = (tableMetadata.locationTitleColumnName_.empty()) ? "" : p->getData(tableMetadata.locationTitleColumnName_);
+	TeTrim(add.locationTitle_);
+	
+	add.locationPreposition_ = (tableMetadata.locationPrepositionColumnName_.empty()) ? "" : p->getData(tableMetadata.locationPrepositionColumnName_);
+	TeTrim(add.locationPreposition_);
+
+	add.locationName_ = p->getData(tableMetadata.locationNameColumnName_);		
+	TeTrim(add.locationName_);
+
+	add.neighborhood_ = (tableMetadata.neighborhoodColumnName_.empty()) ? "" : p->getData(tableMetadata.neighborhoodColumnName_);
+	TeTrim(add.neighborhood_);
+
+	add.zipCode_ = (tableMetadata.zipCodeColumnName_.empty()) ? "" : p->getData(tableMetadata.zipCodeColumnName_);
+	TeTrim(add.zipCode_);
+
+	if(!tableMetadata.locationNumberColumnName_.empty())
+		add.locationNumber_ = atoi(p->getData(tableMetadata.locationNumberColumnName_));	
+	else
+		splitAddress(add);
+
+	return;
+}
+
+string TeAddressLocator::mountSimilarWhereSQL(const TeAddress& address)
+{	
+	string sql = metadata_.locationName_ + " <> '' ";
+	
+	if(address.locationNumber_ != 0)
+	{
+		string snumber = Te2String(address.locationNumber_);
+
+		if(!sql.empty())
+			sql += " AND ";
+
+		if((address.locationNumber_ % 2) == 0)
+			sql += metadata_.initialRightNumber_ + " <= " + snumber + " AND " + metadata_.finalRightNumber_ + " >= " + snumber;
+		else
+			sql += metadata_.initialLeftNumber_ + " <= " + snumber +" AND " + metadata_.finalLeftNumber_ + " >= " + snumber;
+	}
+
+	return sql;
+}
+
+string TeAddressLocator::mountExactWhereSQL(const TeAddress& address, const string& fullName)
+{
+	vector<string> fields;
+	string values = "";
+	string sql = "";
+
+	if(address.locationNumber_ != 0)
+	{
+		string snumber = Te2String(address.locationNumber_);
+
+		// Se for endere�os pares
+		if((address.locationNumber_ % 2) == 0)
+			sql += " ( " + metadata_.initialRightNumber_ +" <= " + snumber + " AND " + metadata_.finalRightNumber_ +" >= " + snumber + ") ";
+		else	// Sen�o, se for �mpares
+			sql += " ( " + metadata_.initialLeftNumber_ + " <= " + snumber + " AND " + metadata_.finalLeftNumber_ + " >= " + snumber + ") ";
+	}
+
+	if(sql.empty())
+		sql += " ( " + metadata_.locationCompleteName_ + " = '";
+	else
+		sql += " AND (" + metadata_.locationCompleteName_ + " = '";
+
+	sql += db_->escapeSequence(fullName);
+
+	sql += "') ";
+
+	return sql;
+}
+
+string TeAddressLocator::mountLikeWhereSQL(const TeAddress& address, const string& fullName)
+{
+	vector<string> fields;
+	string values = db_->escapeSequence(fullName);
+	string sql  = " ( " + metadata_.locationCompleteName_ + " LIKE '%";
+           sql += values;
+		   sql += "') ";
+
+	if(address.locationNumber_ != 0)
+	{
+		string snumber = Te2String(address.locationNumber_);
+
+		// Se for endere�os pares
+		if((address.locationNumber_ % 2) == 0)
+			sql += " AND ( " + metadata_.initialRightNumber_ +" <= " + snumber + " AND " + metadata_.finalRightNumber_ +" >= " + snumber + ") ";
+		else	// Sen�o, se for �mpares
+			sql += " AND ( " + metadata_.initialLeftNumber_ + " <= " + snumber + " AND " + metadata_.finalLeftNumber_ + " >= " + snumber + ") ";
+	}
+	
+	return sql;
+
+}
+
+string TeAddressLocator::mountPatternWhereSQL(const TeAddress& address, const string& fullName, const bool& disabletype, const bool& disabletitle, const bool& disablepreposition)
+{
+	vector<string> fields;
+	string values = "";
+	string sql = "(";
+
+	if(!metadata_.locationType_.empty() && !disabletype)
+		fields.push_back(db_->toUpper(metadata_.locationType_));
+
+	if(!metadata_.locationTitle_.empty() && !disabletitle)
+		fields.push_back(db_->toUpper(metadata_.locationTitle_));
+
+	if(!metadata_.locationPreposition_.empty() && !disablepreposition)
+		fields.push_back(db_->toUpper(metadata_.locationPreposition_));
+
+	if(!metadata_.locationName_.empty())
+		fields.push_back(db_->toUpper(metadata_.locationName_));
+
+	sql += db_->concatValues(fields, "");
+	sql += ") LIKE '";
+
+	values += db_->escapeSequence(fullName);
+	
+	sql += makeLikeExpression(values);
+	sql += "' ";
+
+	if(address.locationNumber_ != 0)
+	{
+		string snumber = Te2String(address.locationNumber_);
+
+		// Se for endere�os pares
+		if((address.locationNumber_ % 2) == 0)
+			sql += " AND ( " + metadata_.initialRightNumber_ +" <= " + snumber + " AND " + metadata_.finalRightNumber_ +" >= " + snumber + ") ";
+		else	// Sen�o, se for �mpares
+			sql += " AND ( " + metadata_.initialLeftNumber_ + " <= " + snumber + " AND " + metadata_.finalLeftNumber_ + " >= " + snumber + ") ";
+	}
+	
+	return sql;
+}
+
+void TeAddressLocator::findCoordinates(const TeAddress& add, vector<TeAddressDescription>& addresses)
+{
+	for(unsigned int i = 0; i < addresses.size(); ++i)
+		findCoordinate(add, addresses[i]);
+}
+
+void TeAddressLocator::findCoordinate(const TeAddress& add, TeAddressDescription& desc)
+{
+	// Evaluate the relative position of "number" (relativePosition) between initial and final numbers
+	// If number is zero, point to begin of line
+
+	int initialLeft, initialRight, finalLeft, finalRight;
+
+	double relativePosition = 0.0;
+
+	if(add.locationNumber_ != 0)
+	{
+		if((add.locationNumber_ % 2) == 0)
+		{
+			initialRight = desc.initialRightNumber_;
+			finalRight = desc.finalRightNumber_;
+				
+			if(initialRight != finalRight)
+				relativePosition = double(add.locationNumber_ - initialRight) / double(finalRight - initialRight);
+		}
+		else
+		{
+			initialLeft = desc.initialLeftNumber_;
+			finalLeft = desc.finalLeftNumber_;
+				
+			if(initialLeft != finalLeft)
+				relativePosition = double(add.locationNumber_ - initialLeft) / double(finalLeft - initialLeft);
+		}
+
+		if(relativePosition > 1.0)
+			relativePosition = 1.0;
+		else if(relativePosition < 0.0)
+			relativePosition = 0.0;
+	}
+
+	// Retrieve street segment geometry
+	TeLineSet ls;
+
+	if(!referenceLayer_->loadGeometrySet(desc.locationLink_, ls))	// Recupero a linha geom�trica do trecho que cont�m o endere�o em quest�o
+		return;
+
+	// Find the actual position of number on the street
+	if(ls.size() >= 1)
+	{
+		TeLine2D line = ls[0];
+
+		TeCoord2D pt1, pt2;
+
+		pt1 = line[0];
+		pt2 = line[1];
+
+		double x, y;
+
+		if(relativePosition <= 0.0)
+		{
+			x = pt1.x();
+			y = pt1.y();
+		}
+		else if(relativePosition >= 1.0)
+		{
+			pt1 = line[line.size() - 1];
+
+			x = pt1.x();
+			y = pt1.y();
+		}		
+		else
+		{
+			if(line.size () > 2)
+			{
+
+				// Find the distance from number to the begin of street based on the relative position
+				double targetLen = TeLength(line) * relativePosition;
+				double acumLen = 0.0;
+				double segLen;
+
+				// Find in which segment number is comprised
+				for(unsigned int i = 1 ; i < line.size(); ++i)
+				{
+					pt2 = line[i];
+
+					segLen = TeDistance(pt2, pt1);	//sqrt((pt2.x() - pt1.x()) * (pt2.x() - pt1.x()) + (pt2.y() - pt1.y()) * (pt2.y() - pt1.y()));
+					
+					acumLen += segLen;
+
+					if(acumLen >= targetLen)
+					{
+						double targetLenInSeg = targetLen - (acumLen - segLen);
+
+						relativePosition = targetLenInSeg / segLen;
+
+						break;
+					}
+
+					pt1 = pt2;
+				}
+			}
+
+			x = pt1.x() + (pt2.x() - pt1.x()) * relativePosition;
+			y = pt1.y() + (pt2.y() - pt1.y()) * relativePosition;
+		}
+		
+
+		desc.pt_ = TeCoord2D (x,y);
+
+		desc.isValid_ = true;
+	}
+	else
+		desc.isValid_ = false;	// A linha pertencente ao trecho n�o foi encontrada... problemas s�rios na base de dados!
+}
+
+
+void TeAddressLocator::fillAddressesDescription(vector<TeAddressDescription>& addresses, TeDatabasePortal* p)
+{
+	addresses.clear();
+
+	if(p == 0)
+		return;
+
+	while(p->fetchRow())
+	{
+		TeAddressDescription descript;
+
+		fillAddressDescription(descript, p);
+
+		addresses.push_back(descript);
+	}
+
+	return;
+}
+
+void TeAddressLocator::fillAddressDescription(TeAddressDescription& descript, TeDatabasePortal* p)
+{
+	descript.locationLink_ = p->getData(metadata_.linkColumnName_);
+	descript.locationType_ = (metadata_.locationType_.empty()) ? "" : p->getData(metadata_.locationType_);
+	descript.locationTitle_ = (metadata_.locationTitle_.empty()) ? "" : p->getData(metadata_.locationTitle_);
+	descript.locationPreposition_ = (metadata_.locationPreposition_.empty()) ? "" : p->getData(metadata_.locationPreposition_);
+	descript.locationName_ = (metadata_.locationName_.empty()) ? "" : p->getData(metadata_.locationName_);		
+	descript.locationCompleteName_ = p->getData(metadata_.locationCompleteName_);
+	descript.initialLeftNumber_ = (metadata_.initialLeftNumber_.empty()) ? 0 : atoi(p->getData(metadata_.initialLeftNumber_));
+	descript.finalLeftNumber_ = (metadata_.finalLeftNumber_.empty()) ? 0 : atoi(p->getData(metadata_.finalLeftNumber_));
+	descript.initialRightNumber_ = (metadata_.initialRightNumber_.empty()) ? 0 : atoi(p->getData(metadata_.initialRightNumber_));
+	descript.finalRightNumber_ = (metadata_.finalRightNumber_.empty()) ? 0 : atoi(p->getData(metadata_.finalRightNumber_));
+	descript.leftNeighborhood_ = (metadata_.leftNeighborhood_.empty()) ? "" : p->getData(metadata_.leftNeighborhood_);
+	descript.rightNeighborhood_ = (metadata_.rightNeighborhood_.empty()) ? "" : p->getData(metadata_.rightNeighborhood_);
+	descript.leftZipCode_ = (metadata_.leftZipCode_.empty()) ? "" : p->getData(metadata_.leftZipCode_);
+	descript.rightZipCode_ = (metadata_.rightZipCode_.empty()) ? "" : p->getData(metadata_.rightZipCode_);
+
+	return;
+}
+
+void TeAddressLocator::normalizeAddress(TeAddress& address, string& completeName)
+{
+	completeName = "";
+
+	if(!address.locationType_.empty())
+	{
+		TeTrim(address.locationType_);
+
+		if(changeSpecialChars_)
+			removeSpecialCharacters(address.locationType_);
+
+		address.locationType_ = TeConvertToUpperCase(address.locationType_);
+
+		completeName = address.locationType_;
+	}
+
+	if(!address.locationTitle_.empty())
+	{
+		TeTrim(address.locationTitle_);
+
+		if(changeSpecialChars_)
+			removeSpecialCharacters(address.locationTitle_);
+
+		address.locationTitle_ = TeConvertToUpperCase(address.locationTitle_);
+
+		if(!completeName.empty())
+			completeName += " ";
+
+		completeName += address.locationTitle_;
+	}
+
+	if(!address.locationPreposition_.empty())
+	{
+		TeTrim(address.locationPreposition_);
+
+		if(changeSpecialChars_)
+			removeSpecialCharacters(address.locationPreposition_);
+
+		address.locationPreposition_ = TeConvertToUpperCase(address.locationPreposition_);
+
+		if(!completeName.empty())
+			completeName += " ";
+
+		completeName += address.locationPreposition_;
+	}
+	
+	if(!address.locationName_.empty())
+	{
+		TeTrim(address.locationName_);
+		
+		if(changeSpecialChars_)
+			removeSpecialCharacters(address.locationName_);
+
+		address.locationName_ = TeConvertToUpperCase(address.locationName_);
+
+		if(!completeName.empty())
+			completeName += " ";
+
+		completeName += address.locationName_;
+	}
+
+	if(!address.neighborhood_.empty())
+	{
+		TeTrim(address.neighborhood_);
+
+		if(changeSpecialChars_)
+			removeSpecialCharacters(address.neighborhood_);
+
+		address.neighborhood_ = TeConvertToUpperCase(address.neighborhood_);		
+	}
+
+	if(!address.zipCode_.empty())
+	{
+		TeTrim(address.zipCode_);
+
+		if(removeHifen_)
+			removeHifen(address.zipCode_);
+		else
+			insertHifen(address.zipCode_);
+	}
+
+	return;
+}
+
+void TeAddressLocator::removeHifen(string& zipCode) const
+{
+	if(zipCode.size() == 9)
+	{
+		unsigned int i = 0;
+
+		string newZipCode = "";
+
+		for(i = 0; i < 5; ++i)
+			newZipCode += zipCode[i];
+
+		for(i = 6; i < 9; ++i)
+			newZipCode += zipCode[i];
+
+		zipCode = newZipCode;
+	}	
+	
+	return;
+}
+
+void TeAddressLocator::insertHifen(string& zipCode) const
+{
+	if(zipCode.size() == 8)
+	{
+		unsigned int i = 0;
+
+		string newZipCode = "";
+
+		for(i = 0; i < 5; ++i)
+			newZipCode += zipCode[i];
+
+		newZipCode += hifen_;
+
+		for(i = 5; i < 8; ++i)
+			newZipCode += zipCode[i];
+
+		zipCode = newZipCode;
+	}	
+	
+	return;
+}
+
+string TeAddressLocator::makeLikeExpression(const string& str) const
+{
+	string aux = "";
+
+	for(unsigned int i = 0; i < str.size(); ++i)
+		aux += (str[i] == ' ') ? ('%') : str[i];
+
+	return aux;
+}
+
+void TeAddressLocator::removeSpecialCharacters(string& str) const
+{
+	string newStr = "";
+
+	unsigned int nStep = str.size();
+
+	for(unsigned int i = 0; i < nStep; ++i)
+	{
+		switch(str[i])
+		{
+			case '�' :  newStr += "A"; break;
+			case '�' :  newStr += "a"; break;
+			case '�' :  newStr += "A"; break;
+			case '�' :  newStr += "a"; break;
+			case '�' :  newStr += "A"; break;
+			case '�' :  newStr += "a"; break;
+			case '�' :  newStr += "A"; break;
+			case '�' :	newStr += "a"; break;
+
+			case '�' :  newStr += "E"; break;
+			case '�' :  newStr += "e"; break;
+			case '�' :  newStr += "E"; break;
+			case '�' :  newStr += "e"; break;
+
+			case '�' :  newStr += "I"; break;
+			case '�' :  newStr += "i"; break;
+
+			case '�' :  newStr += "O"; break;
+			case '�' :  newStr += "o"; break;
+			case '�' :  newStr += "O"; break;
+			case '�' :  newStr += "o"; break;
+
+			case '�' :  newStr += "U"; break;
+			case '�' :  newStr += "u"; break;
+			case '�' :  newStr += "U"; break;
+			case '�' :  newStr += "u"; break;
+
+			case '�' :  newStr += "c"; break;
+			case '�' :  newStr += "C"; break;
+
+			//case '.' :	break;
+
+			default  :  newStr += str[i];
+		}
+	}
+
+	str = newStr;
+}
+
+bool TeAddressLocator::verifyHifen(const string& tableName, const string& columnName)
+{
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return 0;
+	}
+
+	TeDatabasePortal* p = db_->getPortal();
+
+	if(!p || columnName.empty() || tableName.empty())
+		return false;
+
+	string q  = "SELECT MAX(";
+	       q += columnName;
+		   q += ") FROM ";
+		   q += tableName;
+
+	if(!p->query(q) && !p->fetchRow())
+	{
+		delete p;
+
+		return false;
+	}
+
+	string zipCode = p->getData(0);
+
+	delete p;
+
+	if(zipCode.size() == 9)
+	{
+		hifen_ = zipCode[5];
+
+		return true;
+	}
+
+	return false;
+}
+
+bool TeAddressLocator::addReportColumn(TeGeocodeTableMetadata& tableMetadata, pair<string, string>& newColumns)
+{
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+	
+	// Adiciona as colunas para relat�rio de acerto dos pontos
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return false;
+
+	string allFieldQuery  = "SELECT * FROM ";
+	       allFieldQuery += tableMetadata.tableName_;
+		   allFieldQuery += " WHERE 1 = 2";
+
+	if(!portal->query(allFieldQuery))
+	{
+		errMsg_ = "Could not find column names for the table to be geocoding!";
+
+		delete portal;
+
+		return false;
+	}
+
+	TeAttributeRep rep1;
+	rep1.name_ = "geocoding_result_id";
+	rep1.type_ = TeINT;
+	rep1.isPrimaryKey_ = false;
+	rep1.isAutoNumber_ = false;
+
+	TeAttributeList& attrList = portal->getAttributeList();
+	validColumnName(rep1, attrList);
+
+	TeAttributeRep rep2;
+	rep2.name_ = "geocoding_result_description";
+	rep2.type_ = TeSTRING;
+	rep2.numChar_ = 255;
+	rep2.isPrimaryKey_ = false;
+	rep2.isAutoNumber_ = false;
+
+	validColumnName(rep2, attrList);
+
+	delete portal;
+
+	portal = 0;
+
+	if(!db_->addColumn(tableMetadata.tableName_, rep1))
+	{
+		errMsg_ = "Could not add a column to do the report!";
+
+		delete portal;
+
+		return false;
+	}	
+
+	//if(!db_->addColumn(tableMetadata.tableName_, rep2))
+	//{
+	//	errMsg_ = "Could not add a column to do the report!";
+
+	//	delete portal;
+
+	//	return false;
+	//}
+
+	newColumns.first = rep1.name_;
+	newColumns.second = rep2.name_;
+
+	return true;
+}
+
+bool TeAddressLocator::findTableMetadata(TeGeocodeTableMetadata& tableMetadata)
+{
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+	
+	// Adiciona as colunas para relat�rio de acerto dos pontos
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return false;
+
+
+	// Procura o nome do campo chave da tabela a ser geocodificada
+	string sql  = "SELECT * FROM te_layer_table WHERE table_id = ";
+	       sql += Te2String(tableMetadata.tableId_);	
+
+	portal = db_->getPortal();
+
+	if(!portal)
+		return false;
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		errMsg_ = "Could not read te_layer_table table for geocoding base table!";
+
+		delete portal;
+
+		return false;
+	}
+
+	tableMetadata.keyColumnName_ = portal->getData("unique_id");
+	tableMetadata.linkColumnName_ = portal->getData("attr_link");
+	tableMetadata.tableName_ = portal->getData("attr_table");
+
+	delete portal;
+
+	portal = 0;
+
+	return true;
+}
+
+bool TeAddressLocator::updateAddressTable(const string& c1, const int& v1, TeGeocodeTableMetadata& tableMetadata, const string& objectId)
+{
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return false;
+	}
+
+	string sql  = "UPDATE ";
+	       sql += tableMetadata.tableName_;
+		   sql += " SET ";
+		   sql += c1;
+		   sql += " = ";
+		   sql += Te2String(v1);
+		   sql += " WHERE ";
+		   sql += tableMetadata.linkColumnName_;
+		   sql += " = '";
+		   sql += objectId;
+		   sql += "'";
+
+	return db_->execute(sql);
+}
+
+TeDatabasePortal* TeAddressLocator::getAddressTablePortal(TeGeocodeTableMetadata& tableMetadata, int& numRows)
+{
+	if(!db_)
+	{
+		errMsg_ = "You should connect to a database first!";
+
+		return 0;
+	}
+
+	string sql = "SELECT count(*) FROM " + tableMetadata.tableName_;
+
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+	{
+		errMsg_ = "Could not get a portal to query database!";
+
+		return 0;
+	}
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		errMsg_ = "Could not count the number of records in the geocoding base table!";
+
+		return 0;
+	}
+
+	numRows = portal->getInt(0);
+
+	portal->freeResult();
+
+	// Recupera um portal para a tabela a ser espacializada e verifica se a tabela tem conte�do
+	sql  = "SELECT ";
+	sql += tableMetadata.linkColumnName_;
+	sql += ", ";
+	sql += tableMetadata.locationNameColumnName_;
+
+	if(!tableMetadata.locationNumberColumnName_.empty())
+	{
+	       sql += ", ";
+	       sql += tableMetadata.locationNumberColumnName_;
+	}
+
+	if(!tableMetadata.neighborhoodColumnName_.empty())
+	{
+		sql += ", ";
+		sql += tableMetadata.neighborhoodColumnName_;
+	}
+
+	if(!tableMetadata.zipCodeColumnName_.empty())
+	{
+		sql += ", ";
+		sql += tableMetadata.zipCodeColumnName_;
+	}
+
+	if(!tableMetadata.locationTypeColumnName_.empty())
+	{
+		sql += ", ";
+		sql += tableMetadata.locationTypeColumnName_;
+	}
+
+	if(!tableMetadata.locationTitleColumnName_.empty())
+	{
+		sql += ", ";
+		sql += tableMetadata.locationTitleColumnName_;
+	}
+
+	if(!tableMetadata.locationPrepositionColumnName_.empty())
+	{
+		sql += ", ";
+		sql += tableMetadata.locationPrepositionColumnName_;
+	}
+
+	sql += " FROM ";
+	sql += tableMetadata.tableName_;
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		errMsg_ = "Could not read the geocoding base table!";
+
+		delete portal;
+
+		return 0;
+	}
+
+	return portal;
+}
+
+
+
+void TeAddressLocator::refineFoundedLocationsByNeighBorhood(const TeAddress& address, vector<TeAddressDescription>& addressesFound)
+{
+	unsigned int nStep = addressesFound.size();
+
+	vector<TeAddressDescription> newAdds;
+
+	for(unsigned int i = 0; i < nStep; ++i)
+	{
+		TeAddressDescription& addFound = addressesFound[i];
+
+		if(address.neighborhood_ == TeConvertToUpperCase(addFound.leftNeighborhood_) || address.neighborhood_ == TeConvertToUpperCase(addFound.rightNeighborhood_))
+			newAdds.push_back(addFound);
+	}
+
+	if(newAdds.size() > 0)
+	{
+		addressesFound.clear();
+
+		addressesFound = newAdds;
+	}
+
+	return;
+}
+
+void TeAddressLocator::refineFoundedLocationsByZipCode(const TeAddress& address, vector<TeAddressDescription>& addressesFound)
+{
+	unsigned int nStep = addressesFound.size();
+
+	vector<TeAddressDescription> newAdds;
+
+	for(unsigned int i = 0; i < nStep; ++i)
+	{
+		TeAddressDescription& addFound = addressesFound[i];
+
+		if(address.zipCode_ == addFound.leftZipCode_ || address.zipCode_ == addFound.rightZipCode_)
+			newAdds.push_back(addFound);
+	}
+
+	if(newAdds.size() > 0)
+	{
+		addressesFound.clear();
+
+		addressesFound = newAdds;
+	}
+
+	return;
+}
+
+void TeAddressLocator::refineFoundedLocationsByNumberNeighboor(const TeAddress& address, vector<TeAddressDescription>& addressesFound)
+{
+	unsigned int nStep = addressesFound.size();
+
+	// id/dist
+	typedef pair<unsigned int, int> nearestItem; 
+
+	map<string, nearestItem> nearestMap;
+
+	bool par = ((address.locationNumber_ % 2) == 0);
+
+	for(unsigned int i = 0; i < nStep; ++i)
+	{
+		TeAddressDescription& addFound = addressesFound[i];
+		
+		int distBegin = 0;
+		int distEnd = 0;
+
+		int dist = 0;
+
+		if(par)
+		{	
+
+			distBegin = abs(address.locationNumber_ - addFound.initialRightNumber_);
+			distEnd = abs(address.locationNumber_ - addFound.finalRightNumber_);
+
+			dist = MIN(distBegin, distEnd);
+		}
+		else
+		{
+			distBegin = abs(address.locationNumber_ - addFound.initialLeftNumber_);
+			distEnd = abs(address.locationNumber_ - addFound.finalLeftNumber_);
+
+			dist = MIN(distBegin, distEnd);
+		}
+
+
+		map<string, nearestItem>::iterator itLeft = nearestMap.find(addFound.leftNeighborhood_);
+
+		if(itLeft != nearestMap.end())
+		{
+			if(dist < itLeft->second.second)
+				nearestMap[addFound.leftNeighborhood_] = nearestItem(i, dist);
+		}
+		else
+		{
+			nearestMap[addFound.leftNeighborhood_] = nearestItem(i, dist);
+		}
+
+		if(addFound.leftNeighborhood_ != addFound.rightNeighborhood_)
+		{
+			map<string, nearestItem>::iterator itRight = nearestMap.find(addFound.rightNeighborhood_);
+
+			if(itRight != nearestMap.end())
+			{
+				if(dist < itRight->second.second)
+					nearestMap[addFound.rightNeighborhood_] = nearestItem(i, dist);					
+			}
+			else
+			{
+				nearestMap[addFound.rightNeighborhood_] = nearestItem(i, dist);
+			}
+		}		
+	}
+
+	if(!nearestMap.empty())
+	{
+		map<string, nearestItem>::iterator it = nearestMap.begin();
+		vector<TeAddressDescription> newAdds;
+		set<unsigned int> alreadyPushed;
+
+		while(it != nearestMap.end())
+		{
+			set<unsigned int>::iterator itaux = alreadyPushed.find(it->second.first);
+
+			// Se o endere�o j� n�o tiver sido colocado na lista, inclui, caso contr�rio n�o faz nada
+			if(itaux == alreadyPushed.end())
+				newAdds.push_back(addressesFound[it->second.first]);			
+
+			alreadyPushed.insert(it->second.first);
+
+			++it;
+		}
+
+		addressesFound.clear();
+		addressesFound = newAdds;
+	
+	}
+
+	return;
+}
+
+void TeAddressLocator::refineFoundedLocationsByNumberZipCode(const TeAddress& address, vector<TeAddressDescription>& addressesFound)
+{
+	unsigned int nStep = addressesFound.size();
+
+	// id/dist
+	typedef pair<unsigned int, int> nearestItem; 
+
+	map<string, nearestItem> nearestMap;
+
+	bool par = ((address.locationNumber_ % 2) == 0);
+
+	for(unsigned int i = 0; i < nStep; ++i)
+	{
+		TeAddressDescription& addFound = addressesFound[i];
+		
+		int distBegin = 0;
+		int distEnd = 0;
+
+		int dist = 0;
+
+		if(par)
+		{	
+
+			distBegin = abs(address.locationNumber_ - addFound.initialRightNumber_);
+			distEnd = abs(address.locationNumber_ - addFound.finalRightNumber_);
+
+			dist = MIN(distBegin, distEnd);
+		}
+		else
+		{
+			distBegin = abs(address.locationNumber_ - addFound.initialLeftNumber_);
+			distEnd = abs(address.locationNumber_ - addFound.finalLeftNumber_);
+
+			dist = MIN(distBegin, distEnd);
+		}
+
+
+		map<string, nearestItem>::iterator itLeft = nearestMap.find(addFound.leftZipCode_);
+
+		if(itLeft != nearestMap.end())
+		{
+			if(dist < itLeft->second.second)
+				nearestMap[addFound.leftZipCode_] = nearestItem(i, dist);
+		}
+		else
+		{
+			nearestMap[addFound.leftZipCode_] = nearestItem(i, dist);
+		}
+
+		if(addFound.leftZipCode_ != addFound.rightZipCode_)
+		{
+			map<string, nearestItem>::iterator itRight = nearestMap.find(addFound.rightZipCode_);
+
+			if(itRight != nearestMap.end())
+			{
+				if(dist < itRight->second.second)
+					nearestMap[addFound.rightZipCode_] = nearestItem(i, dist);
+			}
+			else
+			{
+				nearestMap[addFound.rightZipCode_] = nearestItem(i, dist);
+			}
+		}		
+	}
+
+	if(!nearestMap.empty())
+	{
+		map<string, nearestItem>::iterator it = nearestMap.begin();
+		vector<TeAddressDescription> newAdds;
+		set<unsigned int> alreadyPushed;
+
+		while(it != nearestMap.end())
+		{
+			set<unsigned int>::iterator itaux = alreadyPushed.find(it->second.first);
+
+			// Se o endere�o j� n�o tiver sido colocado na lista, inclui, caso contr�rio n�o faz nada
+			if(itaux == alreadyPushed.end())
+				newAdds.push_back(addressesFound[it->second.first]);			
+
+			alreadyPushed.insert(it->second.first);
+
+			++it;
+		}
+
+		addressesFound.clear();
+		addressesFound = newAdds;
+	
+	}
+
+	return;
+}
+
+void TeAddressLocator::splitAddress(TeAddress& add)
+{
+	unsigned int i;
+	string aux = add.locationName_;
+
+	add.locationName_ = "";
+	add.locationNumber_ = 0;
+
+	string number = "";
+
+	if(!splitChar_.empty())
+	{
+		unsigned int nChars = aux.size();
+
+		for(i = 0; i < nChars; ++i)
+		{
+			if(splitChar_[0] == aux[i])
+			{
+				++i;
+				break;
+			}
+
+			add.locationName_ += aux[i];
+		}
+
+		number = "";
+
+		for(; i < nChars; ++i)
+		{
+			if((aux[i] >= '0') && (aux[i] <= '9'))
+				number += aux[i];
+		}
+		
+	}
+	else
+	{
+		unsigned int nChars = aux.size();
+
+		for(i = 0; i < nChars; ++i)
+		{
+			if(aux[i] >= '0' && aux[i] <= '9')
+				break;
+
+			add.locationName_ += aux[i];
+		}		
+
+		for(; i < nChars; ++i)
+		{
+			if(aux[i] < '0' || aux[i] > '9')
+				break;
+
+			number += aux[i];
+		}
+	}
+
+	TeTrim(add.locationName_);
+	TeTrim(number);
+	add.locationNumber_ = atoi(number.c_str());
+}
+
+
+void TeAddressLocator::queryAddresses(const string& strSQL, bool& queryExecuted, vector<TeAddressDescription>& addressesFound)
+{
+	TeDatabasePortal* portal = db_->getPortal();
+
+	if(!portal)
+		return;
+
+	// Check if there is a segment that satisfies the clause
+	if(portal->query(strSQL))
+	{
+		queryExecuted = true;
+
+		fillAddressesDescription(addressesFound, portal);
+	}
+
+	delete portal;
+}
+
+
+bool TeAddressLocator::loadAddressCompoundNames()
+{
+	typesVector_.clear();
+	titlesVector_.clear();
+	prepositionsVector_.clear();
+
+	if(!metadata_.locationType_.empty())
+	{
+		TeDatabasePortal *p = db_->getPortal();
+
+		if(!p)
+		{
+			errMsg_ = "Could not get portal to find types in base table!";
+
+			return false;
+		}
+
+
+		string sql  = "SELECT DISTINCT ";
+		       sql += metadata_.locationType_;
+			   sql += " FROM ";
+			   sql += metadata_.tableName_;
+			   sql += " ORDER BY ";
+			   sql += metadata_.locationType_;
+
+		if(p->query(sql))
+		{
+			while(p->fetchRow())
+			{
+				string aux = p->getData(metadata_.locationType_);
+
+				TeTrim(aux);
+
+				if(aux.empty())
+					continue;
+
+				typesVector_.push_back(aux);
+			}
+		}
+
+		delete p;
+	}
+
+	// T�tulo
+	if(!metadata_.locationTitle_.empty())
+	{
+		TeDatabasePortal *p = db_->getPortal();
+
+		if(!p)
+		{
+			errMsg_ = "Could not get portal to find titles in base table!";
+
+			return false;
+		}
+
+
+		string sql  = "SELECT DISTINCT ";
+		       sql += metadata_.locationTitle_;
+			   sql += " FROM ";
+			   sql += metadata_.tableName_;
+			   sql += " ORDER BY ";
+			   sql += metadata_.locationTitle_;
+
+		if(p->query(sql))
+		{
+			while(p->fetchRow())
+			{
+				string aux = p->getData(metadata_.locationTitle_);
+
+				TeTrim(aux);
+
+				if(aux.empty())
+					continue;
+
+				titlesVector_.push_back(aux);
+			}
+		}
+
+		delete p;
+	}
+
+	// Preposi��o
+	if(!metadata_.locationPreposition_.empty())
+	{
+		TeDatabasePortal *p = db_->getPortal();
+
+		if(!p)
+		{
+			errMsg_ = "Could not get portal to find prepositions in base table!";
+
+			return false;
+		}
+
+
+		string sql  = "SELECT DISTINCT ";
+		       sql += metadata_.locationPreposition_;
+			   sql += " FROM ";
+			   sql += metadata_.tableName_;
+			   sql += " ORDER BY ";
+			   sql += metadata_.locationPreposition_;
+
+		if(p->query(sql))
+		{
+			while(p->fetchRow())
+			{
+				string aux = p->getData(metadata_.locationPreposition_);
+
+				TeTrim(aux);
+
+				if(aux.empty())
+					continue;
+
+				prepositionsVector_.push_back(aux);
+			}
+		}
+
+		delete p;
+	}
+
+	return true;
+}
+
+
+bool TeAddressLocator::convertColumnNameToUpper()
+{
+	errMsg_ = "";
+	
+	if(!db_)
+	{
+		errMsg_ = "Connect to a database first!";
+
+		return false;
+	}
+
+	string sql  = "UPDATE ";
+		   sql += metadata_.tableName_;
+		   sql += " SET ";
+		   sql += metadata_.locationCompleteName_;
+		   sql += " = ";
+		   sql += db_->toUpper(metadata_.locationCompleteName_);
+
+	if(!db_->execute(sql))
+	{
+		errMsg_ = "Couldn't convert to uppercase name column!";
+
+		return false;
+	}
+
+	return true;
+}
+
+bool TeAddressLocator::addCompleteNameColumn()
+{
+	errMsg_ = "";
+	
+	if(!db_)
+	{
+		errMsg_ = "Connect to a database first!";
+
+		return false;
+	}
+
+	TeAttribute attr;
+
+	if(db_->columnExist(metadata_.tableName_, metadata_.locationCompleteName_, attr))
+	{
+		errMsg_ = "The specified column name already exist!";
+
+		return false;
+	}
+
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = metadata_.locationCompleteName_;
+	at.rep_.numChar_ = 255;
+
+	if(!db_->addColumn(metadata_.tableName_, at.rep_))
+	{
+		errMsg_ = "Couldn't add specified column!";
+
+		return false;
+	}
+
+	TeDatabasePortal* p = db_->getPortal();
+
+	if(!p)
+	{
+		errMsg_ = "Couldn't get portal!";
+		
+		return false;
+	}
+
+	string sql = "SELECT count(*) FROM " + metadata_.tableName_;
+
+	if(!p->query(sql) && !p->fetchRow())
+	{
+		errMsg_ = "Couldn't get number of lines to update!";
+
+		delete p;
+		
+		return false;
+	}
+
+	int lo = 0;
+	int nlo = p->getInt(0);
+
+	p->freeResult();
+
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nlo);
+		TeProgress::instance()->setCaption("Address Geocoding Config");
+		TeProgress::instance()->setMessage("Creating new column...");
+	}
+
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+
+
+	sql = "SELECT * FROM " + metadata_.tableName_;
+
+	if(!p->query(sql))
+	{
+		errMsg_ = "Couldn't query address reference table!";
+
+		delete p;
+		
+		return false;
+	}
+
+	while(p->fetchRow())
+	{
+		if(TeProgress::instance() && TeProgress::instance()->wasCancelled())
+		{
+			TeProgress::instance()->reset();
+			
+			errMsg_ = "The process was canceled by user!";
+
+			delete p;
+
+			return false;
+		}
+
+
+		++lo;
+
+		string completeName = "";
+
+		if(!metadata_.locationType_.empty())
+			completeName = TeConvertToUpperCase(p->getData(metadata_.locationType_));
+
+		if(!metadata_.locationTitle_.empty())
+		{
+			string aux = TeConvertToUpperCase(p->getData(metadata_.locationTitle_));
+
+			if(!completeName.empty() && !aux.empty())
+				completeName += " ";
+
+			completeName += aux;			
+		}
+
+		if(!metadata_.locationPreposition_.empty())
+		{
+			string aux = TeConvertToUpperCase(p->getData(metadata_.locationPreposition_));
+
+			if(!completeName.empty() && !aux.empty())
+				completeName += " ";
+
+			completeName += aux;			
+		}
+
+		if(!metadata_.locationName_.empty())
+		{
+			string aux = TeConvertToUpperCase(p->getData(metadata_.locationName_));
+
+			if(!completeName.empty() && !aux.empty())
+				completeName += " ";
+
+			completeName += aux;			
+		}
+
+		string value = p->getData(metadata_.linkColumnName_);
+
+		sql  = "UPDATE " + metadata_.tableName_ + " SET ";
+		sql += metadata_.locationCompleteName_ + " = '" + db_->escapeSequence(completeName) + "' WHERE ";
+		sql += metadata_.linkColumnName_ + " = '" + value + "'";
+		
+		if(!db_->execute(sql))
+		{
+			delete p;
+
+			errMsg_ = "Couldn't update complete name column!";
+		
+			return false;
+		}
+
+		if(TeProgress::instance())
+		{
+			t2 = clock();
+			if(int(t2-t1) > dt)
+			{
+				t1 = t2;
+				
+				if((int)(t2-t0) > dt2)
+					TeProgress::instance()->setProgress(lo);
+			}
+		}
+	}
+
+	delete p;
+
+	if(TeProgress::instance())
+		TeProgress::instance()->reset();
+
+
+	return true;
+}
+
+
+void TeAddressLocator::cleanAddressesFound(const string& locName, vector<TeAddressDescription>& addressesFound, const bool& disabletype, const bool& disabletitle, const bool& disablepreposition)
+{
+	vector<TeAddressDescription> newAddresses;
+
+	for(unsigned int i = 0; i < addressesFound.size(); ++i)
+	{
+		TeAddressDescription add = addressesFound[i];
+		
+		string name = "";
+
+		if(!add.locationType_.empty() && !disabletype)
+		{
+			TeTrim(add.locationType_);
+
+			add.locationType_ = TeConvertToUpperCase(add.locationType_);
+
+			name = add.locationType_;
+		}
+
+		if(!add.locationTitle_.empty() && !disabletitle)
+		{
+			TeTrim(add.locationTitle_);
+
+			add.locationTitle_ = TeConvertToUpperCase(add.locationTitle_);
+
+			if(!name.empty() && !add.locationTitle_.empty())
+				name += " ";
+
+			name += add.locationTitle_;
+		}
+
+		if(!add.locationPreposition_.empty() && !disablepreposition)
+		{
+			TeTrim(add.locationPreposition_);
+
+
+			add.locationPreposition_ = TeConvertToUpperCase(add.locationPreposition_);
+
+			if(!name.empty() && !add.locationPreposition_.empty())
+				name += " ";
+
+			name += add.locationPreposition_;
+		}
+		
+		if(!add.locationName_.empty())
+		{
+			TeTrim(add.locationName_);
+			
+			add.locationName_ = TeConvertToUpperCase(add.locationName_);
+
+			if(!name.empty() && !add.locationName_.empty())
+				name += " ";
+
+			name += add.locationName_;
+		}
+
+		if(name == locName)
+			newAddresses.push_back(addressesFound[i]);
+	}
+
+	addressesFound = newAddresses;
+}
diff --git a/src/terralib/functions/TeAddressLocator.h b/src/terralib/functions/TeAddressLocator.h
old mode 100755
new mode 100644
index 279bdce..9639dc2
--- a/src/terralib/functions/TeAddressLocator.h
+++ b/src/terralib/functions/TeAddressLocator.h
@@ -1,424 +1,426 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeAddressLocator.h
-    \brief This file contains algorithms for address location generation.
-*/
-
-/**
-  *@author Gilberto Ribeiro de Queiroz and Ricardo Cartaxo
-  */
-
-#ifndef  __TERRALIB_INTERNAL_ADDRESSLOCATOR_H
-#define  __TERRALIB_INTERNAL_ADDRESSLOCATOR_H
-
-#include <TeDatabase.h>
-#include <TeLayer.h>
-
-#include <string>
-#include <map>
-
-using namespace std;
-
-/** @defgroup GeoCod Geocoding 
-    @{
-	Structures and classes supporting geocoding operations.
- */
-
-//! A dictionary of geocoding parameters
-typedef multimap<string, string> TeGeocoderDictionary;
-
-
-/*! \struct TeAddressMetadata
-	Metadata for a table used as a base for geocoding
-*/
-struct TeAddressMetadata
-{
-	int tableId_;					//!< This value is a foreign key from te_layer_table indicates the table wich will be used for the address locator
-	string tableName_;				//!< The table to use for geocoding process
-	string linkColumnName_;			//!< The column used as link to line geometry
-	string initialLeftNumber_;		//!< The field name with the initial location left number
-	string finalLeftNumber_;		//!< The field name with the final location left number
-	string initialRightNumber_;		//!< The field name with the initial location right number
-	string finalRightNumber_;		//!< The field name with the final location right number
-	string locationType_;			//!< The field name with location type (Av., Rua, R., Pr., Jz., Pres. ...)
-	string locationTitle_;			//!< The field name with location title (Dr., Dra., PRF ...)
-	string locationPreposition_;	//!< The field name with the preposition used to form the location name (Dos, Das, De, 
-	string locationName_;			//!< The field name with the location name
-	string locationCompleteName_;	//!< The field name with composed location name
-	string leftNeighborhood_;		//!< The field name for the left location neighborhood 
-	string rightNeighborhood_;		//!< The field name for the right location neighborhood
-	string leftZipCode_;			//!< The field name for the left location zip code
-	string rightZipCode_;			//!< The field name for the right location zip code
-};
-
-//!  Types for centroid field name finding
-enum TeCentroidFieldType { TeNEIGHBORHOOD, TeZIPCODE };
-
-/*! \struct TeCentroidAddressMetadata
-	Metadata for a table used as a base for geocoding when an address is not found and a centroid for the zip code or neighborhood exists
-*/
-struct TeCentroidAddressMetadata
-{
-	string centroidName_;			//!< This field may be the neighborhood name or zip code name
-
-	TeCentroidFieldType fieldType_;	//!< Field type
-
-	string attributeTableName_;		//!< Attribute table name
-
-	TeLayer* centroidLayer_;		//!< Polygon or point layer to extract centroid from
-
-	TeCentroidAddressMetadata()
-		: centroidLayer_(0)
-	{
-	}
-};
-
-/*! \struct TeGeocodeTableMetadata
-	Metadata for the table that contains address to be geocode
-*/
-struct TeGeocodeTableMetadata
-{
-	string tableName_;						//!< The table to be geocoding
-	string linkColumnName_;					//!< The column used as link column in geocoding
-	string keyColumnName_;					//!< The column with index
-	int tableId_;							//!< The id of the table for geocoding
-	string locationTypeColumnName_;			//!< The field name with location type (Av., Rua, R., Pr., Jz., Pres. ...)
-	string locationTitleColumnName_;		//!< The field name with location title (Dr., Dra., PRF ...)
-	string locationPrepositionColumnName_;	//!< The field name with the preposition used to form the location name (Dos, Das, De, 
-	string locationNameColumnName_;			//!< The field name with the location name
-	string locationNumberColumnName_;		//!< The field name with the ocation number
-	string neighborhoodColumnName_;			//!< The field name for the location neighborhood
-	string zipCodeColumnName_;				//!< The field name for the location zip code	
-};
-
-
-/*! \struct TeAddress
-	Information of an address that will be geocoded
-*/
-struct TeAddress
-{
-	string locationLink_;			//!< The value that unique identifies the location	
-	string locationType_;			//!< Location type
-	string locationTitle_;			//!< Location title
-	string locationPreposition_;	//!< Location preposition
-	string locationName_;			//!< Location name
-	int locationNumber_;			//!< Location number
-	string neighborhood_;			//!< Location neighborhood
-	string zipCode_;				//!< Location zip code
-};
-
-
-/* \struct TeAddressDescription
-	Information about a found address
- */
-struct TeAddressDescription
-{
-	string locationLink_;			//!< The value that unique identifies the location
-	int initialLeftNumber_;			//!< The initial location left number
-	int finalLeftNumber_;			//!< The final location left number
-	int initialRightNumber_;		//!< The initial location right number
-	int finalRightNumber_;			//!< The final location right number
-	string locationType_;			//!< The location type (Av., Rua, R., Pr., Jz., Pres. ...)
-	string locationTitle_;			//!< The location title (Dr., Dra., PRF ...)
-	string locationPreposition_;	//!< The preposition used to form the location name (Dos, Das, De, 
-	string locationName_;			//!< The location name
-	string locationCompleteName_;		//!< The complete location name
-	string leftNeighborhood_;		//!< The left location neighborhood 
-	string rightNeighborhood_;		//!< The right location neighborhood
-	string leftZipCode_;			//!< The eft location zip code
-	string rightZipCode_;			//!< The right location zip code
-	TeCoord2D pt_;					//!< point location of the address
-	bool isValid_;					//!< Tells if pt_ is a valid coordinate or the segment range was not found
-
-	TeAddressDescription()
-		: locationLink_(""), initialLeftNumber_(0), finalLeftNumber_(0),
-		  initialRightNumber_(0), finalRightNumber_(0), locationType_(""),
-		  locationTitle_(""), locationPreposition_(""), locationName_(""), locationCompleteName_(""), 
-		  leftNeighborhood_(""), rightNeighborhood_(""), leftZipCode_(""),
-		  rightZipCode_(""), isValid_(false)
-	{
-	}
-};
-
-
-//! An abstract class to support interactivity in geocoding
-/*!
-	Subclasses of this class must implement the "operator()" method
-*/
-class TeAbstractAddressNotifyFunctor
-{
-	public:
-
-		virtual int operator()(const TeAddress& searchedAddress, vector<TeAddressDescription>& foundAddresses) = 0;
-
-		virtual ~TeAbstractAddressNotifyFunctor()
-		{
-		}
-};
-
-//! A class to handle the geocoder support
-/*!
-	Instances of this class contains information about
-	a table that can be used for geocoding and methods
-	to geocode a given address.
-*/
-class TeAddressLocator
-{
-	protected:
-
-		TeDatabase* db_;							//!< Database connection
-		TeAddressMetadata metadata_;				//!< Metadata information for a geocoding base table
-		TeLayer* referenceLayer_;					//!< Ther layer used as reference for geocoding 
-		TeCentroidAddressMetadata cmetadata_;		//!< Centroid metadata
-		bool isMetadataLoaded_;						//!< Flag to indicate if the metadata is loaded
-		string errMsg_;								//!< Error message description
-		TeGeocoderDictionary dictionary_;			//!< Use a geocoder dictionary
-		bool changeSpecialChars_;					//!< If true should replace special characters
-		bool removeHifen_;							//!< If true the hifen is removed in zip code
-		bool removeHifenFromCentroid_;				//!< If true the hifen is removed in zip code from the centroid table
-		char hifen_;
-		string splitChar_;							//!< Used to split address name and number
-		
-		vector<string> typesVector_;				//!< Vector with default types for street names
-		vector<string> titlesVector_;				//!< Vector with default titles for street names
-		vector<string> prepositionsVector_;			//!< Vector with default prepositions for street names
-
-	public:
-
-		//! Constructor
-		TeAddressLocator(TeDatabase* db)
-			: db_(db), referenceLayer_(0), isMetadataLoaded_(false), errMsg_(""), changeSpecialChars_(false), removeHifen_(false), removeHifenFromCentroid_(false)
-		{
-		}
-
-		//! Virtual destructor
-		virtual ~TeAddressLocator()
-		{
-		}
-		
-		//! Creates the table to store metadata for geocoding tables
-		bool createAddressMetadataTable(void);
-
-		//! Inserts a new metadata for an attribute table layer and saves in the database
-		bool insertAddressMetadata(const TeAddressMetadata& metadata);
-
-		//! Updates the metadata of an attribute table layer and saves in the database
-		bool updateAddressMetadata(const TeAddressMetadata& metadata);
-
-		//! Removes the metadata for the attribute table layer on the database an clear memory
-		bool deleteAddressMetadata(const int& tableId);
-		
-		//! Loads a metadata for an attribute table layer
-		bool loadAddressMetadata(const int& tableId);
-
-		//! Returns true if metadata was loaded
-		bool isMetadataLoaded() const
-		{
-			return isMetadataLoaded_;
-		}
-
-		//! Returns the metadata of the geocode base table
-		TeAddressMetadata getAddressLocatorMetadata() const
-		{
-			return metadata_;
-		}
-
-		//! Set the metadata
-		bool setAddressLocatorMetadata(const TeAddressMetadata& m);
-
-		//! Returns the error message
-		string errorMessage() const
-		{
-			return errMsg_;
-		}
-
-		//! Information about a layer to be used as an alternative for geocoding
-		void setCentroidAddressMetadata(const TeCentroidAddressMetadata& cMetadata)
-		{
-			removeHifenFromCentroid_ = false;
-
-			cmetadata_ = cMetadata;
-
-			if(cmetadata_.fieldType_ == TeZIPCODE && !cmetadata_.centroidName_.empty() && !cmetadata_.attributeTableName_.empty())
-				removeHifenFromCentroid_ = !verifyHifen(cmetadata_.attributeTableName_, cmetadata_.centroidName_);
-		}
-
-		void setReplaceSpecialChars(const bool& r)
-		{
-			changeSpecialChars_ = r;
-		}
-
-		bool getReplaceSpecialChars(void) const
-		{
-			return changeSpecialChars_;
-		}
-
-		void setSplitChar(const string& splitChar)
-		{
-			splitChar_ = splitChar;
-		}
-		
-		//! Retrieves all metadata for a layer
-		bool getAllAddressMetadataLayer(const int& layerId, vector<TeAddressMetadata>& addVec);
-
-		//! Retrieves all metadata for a theme
-		bool getAllAddressMetadataTheme(const int& themeId, vector<TeAddressMetadata>& addVec);
-
-		//! Retrieves all layer name that has an address location table
-		bool getAddressLocatorLayers(vector<pair<int, string> >& layerNameVec);
-
-		//! Retrieves all layer table names that is register as an address find table for a given layerId
-		bool getAddressLocatorLayerTables(vector<pair<int, string> >& tableNameVec, const int& layerId);
-
-		//! Finds all geocoding table in a TerraLib database
-		bool findGeocodingTables(vector<pair<int, string> >& tableNames);
-		
-		//! Looks the attribute description to transform a name location on an address
-		int findAddress(const TeAddress& address, vector<TeAddressDescription>& addressesFound, const bool& doExaustiveSearch = false);
-
-		//! Finds segment and does an interpolation
-		void findCoordinates(const TeAddress& add, vector<TeAddressDescription>& addresses);
-
-		//! Finds segment and does an interpolation
-		void findCoordinate(const TeAddress& add, TeAddressDescription& address);
-
-		//! Spatialize a table based on the indicated fields
-		bool addressGeocode(TeGeocodeTableMetadata& tableMetadata,
-							const string& newLayerName,
-							const string& reportName,
-							const string& reportDir,
-							const bool& doExaustive = false,
-							TeAbstractAddressNotifyFunctor* notifyFunction = 0);
-
-		//! Load a dictionary to change words in the searched addresses 
-		bool loadDictionary(const string& dictionaryFileName);
-
-		//! 
-		bool loadAddressCompoundNames();
-
-		//! Used to make columns in upper case
-		bool convertColumnNameToUpper();
-
-		//! Used to join columns in one field
-		bool addCompleteNameColumn();
-
-	protected:
-
-		//! Looks the attribute description to transform a name location on an address
-		int findExact(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound);
-
-		//! Looks the attribute description to transform a name location on an address
-		int findPattern(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound, const bool& disabletype = false, const bool& disabletitle = false, const bool& disablepreposition = false);
-
-
-		//! Looks the attribute description to transform a name location on an address
-		int findWithDictionary(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound);
-
-		//! Looks the attribute description to transform a name location on an address
-		int findWithoutAllName(const TeAddress& address, const string& fullName, vector<TeAddressDescription>& addressesFound, const bool& disabletype = false, const bool& disabletitle = false, const bool& disablepreposition = false);
-
-		//! Looks the attribute description to transform a name location on an address
-		bool findSimilarAddress(const TeAddress& address, const string& fullName, TeAddressDescription& descript);
-
-		//! Try to find a centroid for zip code or neighborhood
-		bool findByCentroid(const TeAddress& addressToFind, vector<TeAddressDescription>& addressesFound);
-
-		//! Fill the metadata parameter
-		void fillAddressMetadata(TeAddressMetadata& metadata, TeDatabasePortal* p);
-
-		//! Fill address descriptions
-		void fillAddressesDescription(vector<TeAddressDescription>& addresses, TeDatabasePortal* p);
-
-		//!
-		void fillAddressDescription(TeAddressDescription& descript, TeDatabasePortal* p);
-
-		//! Fill address information
-		void fillAddress(TeAddress& add, const TeGeocodeTableMetadata& tableMetadata, TeDatabasePortal* p);
-
-		//! Mount a SQL to look for an address
-		string mountExactWhereSQL(const TeAddress& address, const string& fullName);
-
-		string mountLikeWhereSQL(const TeAddress& address, const string& fullName);
-
-		string mountPatternWhereSQL(const TeAddress& address, const string& fullName, const bool& disabletype = false, const bool& disabletitle = false, const bool& disablepreposition = false);
-
-		//!
-		string mountSimilarWhereSQL(const TeAddress& address);
-
-		//! Do some conversions in address fields
-		void normalizeAddress(TeAddress& address, string& completeName);
-
-		//! Removes hifen if remove flag is true
-		void removeHifen(string& zipCode) const;
-
-		//! Removes hifen if remove flag is true
-		void insertHifen(string& zipCode) const;
-
-		//! Inserts a special character in string for Like comparasion
-		string makeLikeExpression(const string& str) const;
-
-		//! Remove caracteres como ponto e troca acentuados por n�o acentuados
-		void removeSpecialCharacters(string& str) const;
-
-		//!
-		bool verifyHifen(const string& tableName, const string& columnName);
-
-		//!
-		bool addReportColumn(TeGeocodeTableMetadata& tableMetadata, pair<string, string>& newColumns);
-
-		//!
-		bool findTableMetadata(TeGeocodeTableMetadata& tableMetadata);
-
-		//! Update the table that contains address to be geocoded with the code returned by the geocoding process and a description of the process match
-		bool updateAddressTable(const string& c1, const int& v1, TeGeocodeTableMetadata& tableMetadata, const string& objectId);
-
-		//! Returns a portal to the address table
-		TeDatabasePortal* getAddressTablePortal(TeGeocodeTableMetadata& tableMetadata, int& numRows);
-
-		//! 
-		void refineFoundedLocationsByNeighBorhood(const TeAddress& address, vector<TeAddressDescription>& addressesFound);
-
-		//! 
-		void refineFoundedLocationsByZipCode(const TeAddress& address, vector<TeAddressDescription>& addressesFound);		
-
-		//! 
-		void refineFoundedLocationsByNumberNeighboor(const TeAddress& address, vector<TeAddressDescription>& addressesFound);
-
-		//! 
-		void refineFoundedLocationsByNumberZipCode(const TeAddress& address, vector<TeAddressDescription>& addressesFound);
-
-		void cleanAddressesFound(const string& locName, vector<TeAddressDescription>& addressesFound, const bool& disabletype = false, const bool& disabletitle = false, const bool& disablepreposition = false);
-
-		//! Split address name and number
-		void splitAddress(TeAddress& add);
-
-		//! Only to query addresses and fill result
-		void queryAddresses(const string& strSQL, bool& queryExecuted, vector<TeAddressDescription>& addressesFound);
-
-		//! No copy allowed
-		TeAddressLocator(const TeAddressLocator& other);
-		TeAddressLocator& operator=(const TeAddressLocator& other);
-};
-/** @} */
-#endif	// __TERRALIB_INTERNAL_ADDRESSLOCATOR_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAddressLocator.h
+    \brief This file contains algorithms for address location generation.
+*/
+
+/**
+  *@author Gilberto Ribeiro de Queiroz and Ricardo Cartaxo
+  */
+
+#ifndef  __TERRALIB_INTERNAL_ADDRESSLOCATOR_H
+#define  __TERRALIB_INTERNAL_ADDRESSLOCATOR_H
+
+#include <TeDatabase.h>
+#include <TeLayer.h>
+
+#include "TeFunctionsDefines.h"
+
+#include <string>
+#include <map>
+
+using namespace std;
+
+/** @defgroup GeoCod Geocoding 
+    @{
+	Structures and classes supporting geocoding operations.
+ */
+
+//! A dictionary of geocoding parameters
+typedef multimap<string, string> TeGeocoderDictionary;
+
+
+/*! \struct TeAddressMetadata
+	Metadata for a table used as a base for geocoding
+*/
+struct TLFUNCTIONS_DLL TeAddressMetadata
+{
+	int tableId_;					//!< This value is a foreign key from te_layer_table indicates the table wich will be used for the address locator
+	string tableName_;				//!< The table to use for geocoding process
+	string linkColumnName_;			//!< The column used as link to line geometry
+	string initialLeftNumber_;		//!< The field name with the initial location left number
+	string finalLeftNumber_;		//!< The field name with the final location left number
+	string initialRightNumber_;		//!< The field name with the initial location right number
+	string finalRightNumber_;		//!< The field name with the final location right number
+	string locationType_;			//!< The field name with location type (Av., Rua, R., Pr., Jz., Pres. ...)
+	string locationTitle_;			//!< The field name with location title (Dr., Dra., PRF ...)
+	string locationPreposition_;	//!< The field name with the preposition used to form the location name (Dos, Das, De, 
+	string locationName_;			//!< The field name with the location name
+	string locationCompleteName_;	//!< The field name with composed location name
+	string leftNeighborhood_;		//!< The field name for the left location neighborhood 
+	string rightNeighborhood_;		//!< The field name for the right location neighborhood
+	string leftZipCode_;			//!< The field name for the left location zip code
+	string rightZipCode_;			//!< The field name for the right location zip code
+};
+
+//!  Types for centroid field name finding
+TLFUNCTIONS_DLL enum TeCentroidFieldType { TeNEIGHBORHOOD, TeZIPCODE };
+
+/*! \struct TeCentroidAddressMetadata
+	Metadata for a table used as a base for geocoding when an address is not found and a centroid for the zip code or neighborhood exists
+*/
+struct TLFUNCTIONS_DLL TeCentroidAddressMetadata
+{
+	string centroidName_;			//!< This field may be the neighborhood name or zip code name
+
+	TeCentroidFieldType fieldType_;	//!< Field type
+
+	string attributeTableName_;		//!< Attribute table name
+
+	TeLayer* centroidLayer_;		//!< Polygon or point layer to extract centroid from
+
+	TeCentroidAddressMetadata()
+		: centroidLayer_(0)
+	{
+	}
+};
+
+/*! \struct TeGeocodeTableMetadata
+	Metadata for the table that contains address to be geocode
+*/
+struct TLFUNCTIONS_DLL TeGeocodeTableMetadata
+{
+	string tableName_;						//!< The table to be geocoding
+	string linkColumnName_;					//!< The column used as link column in geocoding
+	string keyColumnName_;					//!< The column with index
+	int tableId_;							//!< The id of the table for geocoding
+	string locationTypeColumnName_;			//!< The field name with location type (Av., Rua, R., Pr., Jz., Pres. ...)
+	string locationTitleColumnName_;		//!< The field name with location title (Dr., Dra., PRF ...)
+	string locationPrepositionColumnName_;	//!< The field name with the preposition used to form the location name (Dos, Das, De, 
+	string locationNameColumnName_;			//!< The field name with the location name
+	string locationNumberColumnName_;		//!< The field name with the ocation number
+	string neighborhoodColumnName_;			//!< The field name for the location neighborhood
+	string zipCodeColumnName_;				//!< The field name for the location zip code	
+};
+
+
+/*! \struct TeAddress
+	Information of an address that will be geocoded
+*/
+struct TLFUNCTIONS_DLL TeAddress
+{
+	string locationLink_;			//!< The value that unique identifies the location	
+	string locationType_;			//!< Location type
+	string locationTitle_;			//!< Location title
+	string locationPreposition_;	//!< Location preposition
+	string locationName_;			//!< Location name
+	int locationNumber_;			//!< Location number
+	string neighborhood_;			//!< Location neighborhood
+	string zipCode_;				//!< Location zip code
+};
+
+
+/* \struct TeAddressDescription
+	Information about a found address
+ */
+struct TLFUNCTIONS_DLL TeAddressDescription
+{
+	string locationLink_;			//!< The value that unique identifies the location
+	int initialLeftNumber_;			//!< The initial location left number
+	int finalLeftNumber_;			//!< The final location left number
+	int initialRightNumber_;		//!< The initial location right number
+	int finalRightNumber_;			//!< The final location right number
+	string locationType_;			//!< The location type (Av., Rua, R., Pr., Jz., Pres. ...)
+	string locationTitle_;			//!< The location title (Dr., Dra., PRF ...)
+	string locationPreposition_;	//!< The preposition used to form the location name (Dos, Das, De, 
+	string locationName_;			//!< The location name
+	string locationCompleteName_;		//!< The complete location name
+	string leftNeighborhood_;		//!< The left location neighborhood 
+	string rightNeighborhood_;		//!< The right location neighborhood
+	string leftZipCode_;			//!< The eft location zip code
+	string rightZipCode_;			//!< The right location zip code
+	TeCoord2D pt_;					//!< point location of the address
+	bool isValid_;					//!< Tells if pt_ is a valid coordinate or the segment range was not found
+
+	TeAddressDescription()
+		: locationLink_(""), initialLeftNumber_(0), finalLeftNumber_(0),
+		  initialRightNumber_(0), finalRightNumber_(0), locationType_(""),
+		  locationTitle_(""), locationPreposition_(""), locationName_(""), locationCompleteName_(""), 
+		  leftNeighborhood_(""), rightNeighborhood_(""), leftZipCode_(""),
+		  rightZipCode_(""), isValid_(false)
+	{
+	}
+};
+
+
+//! An abstract class to support interactivity in geocoding
+/*!
+	Subclasses of this class must implement the "operator()" method
+*/
+class TLFUNCTIONS_DLL TeAbstractAddressNotifyFunctor
+{
+	public:
+
+		virtual int operator()(const TeAddress& searchedAddress, vector<TeAddressDescription>& foundAddresses) = 0;
+
+		virtual ~TeAbstractAddressNotifyFunctor()
+		{
+		}
+};
+
+//! A class to handle the geocoder support
+/*!
+	Instances of this class contains information about
+	a table that can be used for geocoding and methods
+	to geocode a given address.
+*/
+class TLFUNCTIONS_DLL TeAddressLocator
+{
+	protected:
+
+		TeDatabase* db_;							//!< Database connection
+		TeAddressMetadata metadata_;				//!< Metadata information for a geocoding base table
+		TeLayer* referenceLayer_;					//!< Ther layer used as reference for geocoding 
+		TeCentroidAddressMetadata cmetadata_;		//!< Centroid metadata
+		bool isMetadataLoaded_;						//!< Flag to indicate if the metadata is loaded
+		string errMsg_;								//!< Error message description
+		TeGeocoderDictionary dictionary_;			//!< Use a geocoder dictionary
+		bool changeSpecialChars_;					//!< If true should replace special characters
+		bool removeHifen_;							//!< If true the hifen is removed in zip code
+		bool removeHifenFromCentroid_;				//!< If true the hifen is removed in zip code from the centroid table
+		char hifen_;
+		string splitChar_;							//!< Used to split address name and number
+		
+		vector<string> typesVector_;				//!< Vector with default types for street names
+		vector<string> titlesVector_;				//!< Vector with default titles for street names
+		vector<string> prepositionsVector_;			//!< Vector with default prepositions for street names
+
+	public:
+
+		//! Constructor
+		TeAddressLocator(TeDatabase* db)
+			: db_(db), referenceLayer_(0), isMetadataLoaded_(false), errMsg_(""), changeSpecialChars_(false), removeHifen_(false), removeHifenFromCentroid_(false)
+		{
+		}
+
+		//! Virtual destructor
+		virtual ~TeAddressLocator()
+		{
+		}
+		
+		//! Creates the table to store metadata for geocoding tables
+		bool createAddressMetadataTable(void);
+
+		//! Inserts a new metadata for an attribute table layer and saves in the database
+		bool insertAddressMetadata(const TeAddressMetadata& metadata);
+
+		//! Updates the metadata of an attribute table layer and saves in the database
+		bool updateAddressMetadata(const TeAddressMetadata& metadata);
+
+		//! Removes the metadata for the attribute table layer on the database an clear memory
+		bool deleteAddressMetadata(const int& tableId);
+		
+		//! Loads a metadata for an attribute table layer
+		bool loadAddressMetadata(const int& tableId);
+
+		//! Returns true if metadata was loaded
+		bool isMetadataLoaded() const
+		{
+			return isMetadataLoaded_;
+		}
+
+		//! Returns the metadata of the geocode base table
+		TeAddressMetadata getAddressLocatorMetadata() const
+		{
+			return metadata_;
+		}
+
+		//! Set the metadata
+		bool setAddressLocatorMetadata(const TeAddressMetadata& m);
+
+		//! Returns the error message
+		string errorMessage() const
+		{
+			return errMsg_;
+		}
+
+		//! Information about a layer to be used as an alternative for geocoding
+		void setCentroidAddressMetadata(const TeCentroidAddressMetadata& cMetadata)
+		{
+			removeHifenFromCentroid_ = false;
+
+			cmetadata_ = cMetadata;
+
+			if(cmetadata_.fieldType_ == TeZIPCODE && !cmetadata_.centroidName_.empty() && !cmetadata_.attributeTableName_.empty())
+				removeHifenFromCentroid_ = !verifyHifen(cmetadata_.attributeTableName_, cmetadata_.centroidName_);
+		}
+
+		void setReplaceSpecialChars(const bool& r)
+		{
+			changeSpecialChars_ = r;
+		}
+
+		bool getReplaceSpecialChars(void) const
+		{
+			return changeSpecialChars_;
+		}
+
+		void setSplitChar(const string& splitChar)
+		{
+			splitChar_ = splitChar;
+		}
+		
+		//! Retrieves all metadata for a layer
+		bool getAllAddressMetadataLayer(const int& layerId, vector<TeAddressMetadata>& addVec);
+
+		//! Retrieves all metadata for a theme
+		bool getAllAddressMetadataTheme(const int& themeId, vector<TeAddressMetadata>& addVec);
+
+		//! Retrieves all layer name that has an address location table
+		bool getAddressLocatorLayers(vector<pair<int, string> >& layerNameVec);
+
+		//! Retrieves all layer table names that is register as an address find table for a given layerId
+		bool getAddressLocatorLayerTables(vector<pair<int, string> >& tableNameVec, const int& layerId);
+
+		//! Finds all geocoding table in a TerraLib database
+		bool findGeocodingTables(vector<pair<int, string> >& tableNames);
+		
+		//! Looks the attribute description to transform a name location on an address
+		int findAddress(const TeAddress& address, vector<TeAddressDescription>& addressesFound, const bool& doExaustiveSearch = false);
+
+		//! Finds segment and does an interpolation
+		void findCoordinates(const TeAddress& add, vector<TeAddressDescription>& addresses);
+
+		//! Finds segment and does an interpolation
+		void findCoordinate(const TeAddress& add, TeAddressDescription& address);
+
+		//! Spatialize a table based on the indicated fields
+		bool addressGeocode(TeGeocodeTableMetadata& tableMetadata,
+							const string& newLayerName,
+							const string& reportName,
+							const string& reportDir,
+							const bool& doExaustive = false,
+							TeAbstractAddressNotifyFunctor* notifyFunction = 0);
+
+		//! Load a dictionary to change words in the searched addresses 
+		bool loadDictionary(const string& dictionaryFileName);
+
+		//! 
+		bool loadAddressCompoundNames();
+
+		//! Used to make columns in upper case
+		bool convertColumnNameToUpper();
+
+		//! Used to join columns in one field
+		bool addCompleteNameColumn();
+
+	protected:
+
+		//! Looks the attribute description to transform a name location on an address
+		int findExact(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound);
+
+		//! Looks the attribute description to transform a name location on an address
+		int findPattern(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound, const bool& disabletype = false, const bool& disabletitle = false, const bool& disablepreposition = false);
+
+
+		//! Looks the attribute description to transform a name location on an address
+		int findWithDictionary(const TeAddress& address, const string& fullName, const bool& withNumber, vector<TeAddressDescription>& addressesFound);
+
+		//! Looks the attribute description to transform a name location on an address
+		int findWithoutAllName(const TeAddress& address, const string& fullName, vector<TeAddressDescription>& addressesFound, const bool& disabletype = false, const bool& disabletitle = false, const bool& disablepreposition = false);
+
+		//! Looks the attribute description to transform a name location on an address
+		bool findSimilarAddress(const TeAddress& address, const string& fullName, TeAddressDescription& descript);
+
+		//! Try to find a centroid for zip code or neighborhood
+		bool findByCentroid(const TeAddress& addressToFind, vector<TeAddressDescription>& addressesFound);
+
+		//! Fill the metadata parameter
+		void fillAddressMetadata(TeAddressMetadata& metadata, TeDatabasePortal* p);
+
+		//! Fill address descriptions
+		void fillAddressesDescription(vector<TeAddressDescription>& addresses, TeDatabasePortal* p);
+
+		//!
+		void fillAddressDescription(TeAddressDescription& descript, TeDatabasePortal* p);
+
+		//! Fill address information
+		void fillAddress(TeAddress& add, const TeGeocodeTableMetadata& tableMetadata, TeDatabasePortal* p);
+
+		//! Mount a SQL to look for an address
+		string mountExactWhereSQL(const TeAddress& address, const string& fullName);
+
+		string mountLikeWhereSQL(const TeAddress& address, const string& fullName);
+
+		string mountPatternWhereSQL(const TeAddress& address, const string& fullName, const bool& disabletype = false, const bool& disabletitle = false, const bool& disablepreposition = false);
+
+		//!
+		string mountSimilarWhereSQL(const TeAddress& address);
+
+		//! Do some conversions in address fields
+		void normalizeAddress(TeAddress& address, string& completeName);
+
+		//! Removes hifen if remove flag is true
+		void removeHifen(string& zipCode) const;
+
+		//! Removes hifen if remove flag is true
+		void insertHifen(string& zipCode) const;
+
+		//! Inserts a special character in string for Like comparasion
+		string makeLikeExpression(const string& str) const;
+
+		//! Remove caracteres como ponto e troca acentuados por n�o acentuados
+		void removeSpecialCharacters(string& str) const;
+
+		//!
+		bool verifyHifen(const string& tableName, const string& columnName);
+
+		//!
+		bool addReportColumn(TeGeocodeTableMetadata& tableMetadata, pair<string, string>& newColumns);
+
+		//!
+		bool findTableMetadata(TeGeocodeTableMetadata& tableMetadata);
+
+		//! Update the table that contains address to be geocoded with the code returned by the geocoding process and a description of the process match
+		bool updateAddressTable(const string& c1, const int& v1, TeGeocodeTableMetadata& tableMetadata, const string& objectId);
+
+		//! Returns a portal to the address table
+		TeDatabasePortal* getAddressTablePortal(TeGeocodeTableMetadata& tableMetadata, int& numRows);
+
+		//! 
+		void refineFoundedLocationsByNeighBorhood(const TeAddress& address, vector<TeAddressDescription>& addressesFound);
+
+		//! 
+		void refineFoundedLocationsByZipCode(const TeAddress& address, vector<TeAddressDescription>& addressesFound);		
+
+		//! 
+		void refineFoundedLocationsByNumberNeighboor(const TeAddress& address, vector<TeAddressDescription>& addressesFound);
+
+		//! 
+		void refineFoundedLocationsByNumberZipCode(const TeAddress& address, vector<TeAddressDescription>& addressesFound);
+
+		void cleanAddressesFound(const string& locName, vector<TeAddressDescription>& addressesFound, const bool& disabletype = false, const bool& disabletitle = false, const bool& disablepreposition = false);
+
+		//! Split address name and number
+		void splitAddress(TeAddress& add);
+
+		//! Only to query addresses and fill result
+		void queryAddresses(const string& strSQL, bool& queryExecuted, vector<TeAddressDescription>& addressesFound);
+
+		//! No copy allowed
+		TeAddressLocator(const TeAddressLocator& other);
+		TeAddressLocator& operator=(const TeAddressLocator& other);
+};
+/** @} */
+#endif	// __TERRALIB_INTERNAL_ADDRESSLOCATOR_H
+
diff --git a/src/terralib/functions/TeCellAlgorithms.cpp b/src/terralib/functions/TeCellAlgorithms.cpp
old mode 100755
new mode 100644
index 90a8fa4..cc80853
--- a/src/terralib/functions/TeCellAlgorithms.cpp
+++ b/src/terralib/functions/TeCellAlgorithms.cpp
@@ -1,1828 +1,1847 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeCellAlgorithms.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeDatabase.h"
-#include "TeProgress.h"
-#include "TeRepresentation.h"
-#include "TeGeneralizedProxMatrix.h"
-#include "TeOverlay.h"
-#include <TeDatabase.h>
-#include <TeQuerier.h>
-#include <TeQuerierParams.h>
-#include <TeSTEFunctionsDB.h>
-
-using namespace TeOVERLAY;
-
-// functions for working with the progress bar
-
-void TeFillCellStepLoadingData()
-{
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(2);
-		TeProgress::instance()->setMessage("Step 1/3: Loading data");
-		TeProgress::instance()->setProgress(1);
-	}
-	return;
-}
-
-void TeFillCellStepStartProcessing(int steps)
-{
-	if (TeProgress::instance())
-	{
-		TeProgress::instance()->reset();
-		TeProgress::instance()->setTotalSteps(steps);
-		TeProgress::instance()->setMessage("Step 2/3: Processing");
-	}
-}
-
-bool TeFillCellStepNextStep(int step)
-{
-	if(TeProgress::instance())
-	{
-		if (TeProgress::instance()->wasCancelled())
-		{
-			TeProgress::instance()->reset();
-			return false;
-		}
-		else
-			TeProgress::instance()->setProgress(step);
-	}
-	return true;
-}
-
-void TeFillCellStepWriting()
-{
-	if (TeProgress::instance())
-	{
-		TeProgress::instance()->reset();
-		TeProgress::instance()->setMessage("Step 3/3: Writing results");
-	}
-}
-
-// TeBoxRasterIterator functions
-TeBoxRasterIterator::TeBoxRasterIterator(TeRaster* raster_, TeBox box) 
-{ 
-	raster = raster_;
-	TeCoord2D l = raster->coord2Index(box.lowerLeft());
-	TeCoord2D r = raster->coord2Index(box.upperRight());
-
-	xo = (int)floor(l.x()); if(xo < 0) xo = 0;
-	yo = (int)floor(r.y()); if(yo < 0) yo = 0;
-	xf = (int)floor(r.x()); if(xf >= raster->params().ncols_)   xf = raster->params().ncols_ - 1;
-	yf = (int)floor(l.y()); if(yf >= raster->params().nlines_)  yf = raster->params().nlines_  - 1;
-
-	// in the case where the cell does not have intersection with any pixel of the raster
-	end_ = false;
-	if(xo >= raster->params().ncols_)  end_ = true;
-	if(yo >= raster->params().nlines_) end_ = true;
-	if(xf <= 0)                        end_ = true;
-	if(yf <= 0)                        end_ = true;
-}
-
-
-TeBoxRasterIterator&
-TeBoxRasterIterator::operator++() 
-{ 
-	x++;
-	if(x > xf)
-	{
-		x = xo;
-		y++;
-	}
-	return *this;
-}
-
-
-TeBoxRasterIterator 
-TeBoxRasterIterator::operator++(int) 
-{
-	x++;
-	if(x >= xf)
-	{
-		x = xo;
-		y++;
-	}
-	return *this;
-}
-
-double 
-TeBoxRasterIterator::operator*() 
-{ 
-	double value;
-	raster->getElement (x, y, value, 0);
-	return value;
-}
-
-bool 
-TeBoxRasterIterator::operator==(const TeBoxRasterIterator& rhs) const
-{
-	return (this->x == rhs.x && this->y == rhs.y);
-}
-
-bool 
-TeBoxRasterIterator::operator!=(const TeBoxRasterIterator& rhs) const
-{
-    return (this->x != rhs.x || this->y != rhs.y);
-}
-
-bool 
-TeBoxRasterIterator::getProperty(TeProperty& prop) 
-{
-	double value = 0.0;
-    prop.attr_.rep_.type_ = TeREAL;
-    prop.attr_.rep_.name_ = raster->params().fileName_;
-    prop.value_ = Te2String (value);
-
-	raster->getElement (x, y, value, 0);
-	prop.value_ = Te2String(value);
-    return true;
-}
-
-TeBoxRasterIterator 
-TeBoxRasterIterator::begin()
-{
-	if(end_) 
-		return end();
-	x = xo;
-	y = yo;
-	return *this;
-}
-
-TeBoxRasterIterator 
-TeBoxRasterIterator::end()
-{
-	y = yf+1;
-	x = xo;
-	return *this;
-}
-
-TeLayer* 
-TeCreateCells( const string& layerName, TeLayer* layerBase, 
-			   double resX, double resY, TeBox& box, bool mask)
-{
-	if (!layerBase || layerName.empty())
-		return 0;
-
-	TeDatabase* db = layerBase->database();
-	if (!db)
-		return 0;
-
-	TeDatabasePortal* portal = db->getPortal();
-	if (!portal)
-		return 0;
-
-	TeProjection* proj = layerBase->projection();
-
-	string newLayerName = layerName;
-	TeLayerMap& layerMap = db->layerMap();
-	TeLayerMap::iterator it;
-	bool flag = true;
-	int n = 1;
-	while (flag)
-	{
-		for (it = layerMap.begin(); it != layerMap.end(); ++it)
-		{
-			if (TeStringCompare(it->second->name(),newLayerName))
-				break;
-		}
-		if (it == layerMap.end())
-			flag = 0;
-		else
-			newLayerName = layerName + "_" +Te2String(n);
-		n++;	
-	}
-
-	string polTableName;
-	if (mask)
-	{
-		TeRepresentation* repp = layerBase->getRepresentation(TePOLYGONS);
-		if (repp)
-		{
-			if (!box.isValid())
-				box = adjustToCut(repp->box_,resX,resY);
-			polTableName = repp->tableName_;
-		}
-		else
-			mask = false;
-	}
-	else 
-	{
-		if (!box.isValid())
-			box = adjustToCut(layerBase->box(),resX,resY);
-	}
-
-	TeBox newBox = adjustToCut(box,resX,resY);
-	double x,y,x1,x2,y1,y2;
-	x1 = newBox.x1_;
-	y1 = newBox.y1_;
-	x2 = newBox.x2_;
-	y2 = newBox.y2_;
-
-	int maxcols, maxlines;
-	maxlines = TeRound((y2-y1)/resY);
-	maxcols = TeRound((x2-x1)/resX);
-
-	TeAttribute attribute;
-	TeAttributeList attList;
-	attribute.rep_.name_ = "object_id";
-	attribute.rep_.type_ = TeSTRING;
-	attribute.rep_.numChar_ = 48;
-	attribute.rep_.isPrimaryKey_ = true;
-	attList.push_back ( attribute );
-	attribute.rep_.name_ = "Col";
-	attribute.rep_.type_ = TeINT;
-	attribute.rep_.isPrimaryKey_ = false;
-	attList.push_back ( attribute );
-	attribute.rep_.name_ = "Lin";
-	attribute.rep_.type_ = TeINT;
-	attribute.rep_.isPrimaryKey_ = false;
-	attList.push_back ( attribute );	
-
-	TeLayer* newLayer = new TeLayer(layerName,db,newBox,proj);
-	if (!newLayer || newLayer->id() <= 0)
-	{
-		delete portal;
-		return 0;
-	}
-	newLayer->addGeometry(TeCELLS);
-	TeRepresentation* repp = newLayer->getRepresentation(TeCELLS);
-	if (!repp)
-	{
-		db->deleteLayer(newLayer->id());
-		delete portal;
-		return 0;
-	}
-	repp->box_ = newBox;
-	repp->resX_ = resX;
-	repp->resY_ = resY;
-	repp->nCols_ = maxcols;
-	repp->nLins_ = maxlines;
-	db->updateRepresentation(newLayer->id(),*repp);
-
-	TeTable attTable (layerName,attList,"object_id","object_id",TeAttrStatic);
-	
-	newLayer->createAttributeTable(attTable);
-
-	TeCellSet cells;
-	cells.resX(resX);
-	cells.resY(resY);
-
-	int col,lin,ncels=0;
-	bool status;
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(maxlines);
-
-	TePolygon curPol;
-	bool found = false;
-
-	TePrecision::instance().setPrecision(TeGetPrecision(proj));
-	
-	y=y2;
-	for (lin=0; lin<maxlines; ++lin) 
-	{	
-		double yu = y;
-		y=y-resY;
-		x=x1;
-
-		for (col=0; col<maxcols; ++col)
-		{
-			TeBox box(x,y,x+resX,yu);
-			found = false;
-			// check if there should be used the polygon representation as a mask
-			if (mask) 
-			{
-				TePolygon polBox = polygonFromBox(box);
-				// check if the cell intersects the current polygon
-				if (TeIntersects(polBox,curPol))
-					found = true;
-				else
-				{
-					if (db->spatialRelation(polTableName, TePOLYGONS, 
-						(TePolygon*)&polBox, portal, TeINTERSECTS))
-					{
-						curPol.clear();
-						portal->fetchGeometry(curPol);
-						found = true;
-					}
-					portal->freeResult();
-				}
-			}
-
-			if (!mask || found)
-			{
-				// build geometry
-				TeCell cell(box,col,lin);
-				char celId[32];
-				sprintf(celId,"C%02dL%02d",col,lin);
-				cell.objectId(string(celId));
-				cells.add(cell);
-				
-				// build default attributes
-				TeTableRow row;
-				row.push_back(cell.objectId()); 
-				row.push_back(Te2String(col)); 
-				row.push_back(Te2String(lin)); 
-				attTable.add(row);
-				ncels++;
-			}
-			x=x+resX;
-		}
-		if (attTable.size() > 0)	// if there is some attributes in this line
-		{
-			status = newLayer->saveAttributeTable(attTable);
-			attTable.clear();
-			status = newLayer->addCells(cells);
-			cells.clear();
-			if(TeProgress::instance())
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(lin);
-			}			
-		}
-	}
-	delete portal;
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	if (ncels > 0)
-		return newLayer;
-	else
-	{
-		db->deleteLayer(newLayer->id());
-		return 0;
-	}
-}
-
-
-
-	
-TeLayer*
-TeCreateCells(const string& layerName,TeTheme* theme, double resX, double resY, TeBox& box)
-{
-	TeLayer* inputLayer = theme->layer();
-	TeRepresentation* pp = inputLayer->getRepresentation(TePOLYGONS);
-	if (!pp)
-		return 0;
-
-	TeDatabase* db = inputLayer->database();
-	TeDatabasePortal* portal = db->getPortal();
-	if (!portal)
-		return 0;
-
-	string newLayerName = layerName;
-	TeLayerMap& layerMap = db->layerMap();
-	TeLayerMap::iterator it;
-	bool flag = true;
-	int n = 1;
-	while (flag)
-	{
-		for (it = layerMap.begin(); it != layerMap.end(); ++it)
-		{
-			if (TeStringCompare(it->second->name(),newLayerName))
-				break;
-		}
-		if (it == layerMap.end())
-			flag = 0;
-		else
-			newLayerName = layerName + "_" +Te2String(n);
-		n++;	
-	}
-
-	if (!box.isValid())
-		box = pp->box_;
-
-	TeBox newBox = adjustToCut(box,resX,resY);
-	double x,y,x1,x2,y1,y2;
-	x1 = newBox.x1_;
-	y1 = newBox.y1_;
-	x2 = newBox.x2_;
-	y2 = newBox.y2_;
-
-	int maxcols, maxlines;
-	maxlines = TeRound((y2-y1)/resY);
-	maxcols = TeRound((x2-x1)/resX);
-
-	TeAttribute attribute;
-	TeAttributeList attList;
-	attribute.rep_.name_ = "object_id";
-	attribute.rep_.type_ = TeSTRING;
-	attribute.rep_.isPrimaryKey_ = true;
-	attribute.rep_.numChar_ = 48;
-	attList.push_back ( attribute );
-
-	attribute.rep_.name_ = "Col";
-	attribute.rep_.type_ = TeINT;
-	attribute.rep_.isPrimaryKey_ = false;
-	attList.push_back ( attribute );
-
-	attribute.rep_.name_ = "Lin";
-	attribute.rep_.type_ = TeINT;
-	attribute.rep_.isPrimaryKey_ = false;
-	attList.push_back ( attribute );	
-
-	TeLayer* newLayer = new TeLayer(layerName,db,newBox,inputLayer->projection());
-	if (!newLayer || newLayer->id() <= 0)
-	{
-		return 0;
-		delete portal;
-	}
-	newLayer->addGeometry(TeCELLS);
-	TeRepresentation* repp = newLayer->getRepresentation(TeCELLS);
-	if (!repp)
-	{
-		db->deleteLayer(newLayer->id());
-		delete portal;
-		return 0;
-	}
-	repp->box_ = newBox;
-	repp->resX_ = resX;
-	repp->resY_ = resY;
-	repp->nCols_ = maxcols;
-	repp->nLins_ = maxlines;
-	db->updateRepresentation(newLayer->id(),*repp);
-
-	TeTable attTable (layerName,attList,"object_id","object_id",TeAttrStatic);
-	newLayer->createAttributeTable(attTable);
-
-	string polTableName = inputLayer->tableName(TePOLYGONS);
-
-	TeCellSet cells;
-	cells.resX(resX);
-	cells.resY(resY);
-
-	TePolygon curPol;
-	int col,lin;
-	bool status;
-	int ncels = 0;
-
-	TePrecision::instance().setPrecision(TeGetPrecision(newLayer->projection()));
-
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(maxlines);
-
-	bool found;
-	y=y2;
-	for (lin=0; lin<maxlines; ++lin) 
-	{	
-		double yu = y;
-		y=y-resY;
-		x=x1;
-		for (col=0; col<maxcols; ++col)
-		{
-			found = false;
-			TeBox box(x,y,x+resX,yu);
-
-			TePolygon polBox = polygonFromBox(box);
-			// check if the cell intersects the current polygon
-			if (TeIntersects(polBox,curPol))
-				found = true;
-			else
-			{
-				if (db->spatialRelation(polTableName, TePOLYGONS, 
-					(TePolygon*)&polBox, portal, TeINTERSECTS, theme->collectionTable()))
-				{
-					curPol.clear();
-					portal->fetchGeometry(curPol);
-					found = true;
-				}
-				portal->freeResult();
-			}
-			if (found)
-			{
-				TeCell cell(box,col,lin);
-				char celId[32];
-				sprintf(celId,"C%02dL%02d",col,lin);
-				cell.objectId(string(celId));
-				cells.add(cell);
-
-				TeTableRow row;
-				row.push_back(cell.objectId()); 
-				row.push_back(Te2String(col)); 
-				row.push_back(Te2String(lin)); 
-				attTable.add(row);
-				++ncels;		
-			}
-			x=x+resX;
-		}
-		if (attTable.size() > 0)	// if there is some attributes in this line
-		{
-			status = newLayer->saveAttributeTable(attTable);
-			attTable.clear();
-			status = newLayer->addCells(cells);
-			cells.clear();
-			if(TeProgress::instance())
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(lin);
-			}	
-		}
-	}
-	delete portal;
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	if (ncels > 0)
-		return newLayer;
-	else
-	{
-		db->deleteLayer(newLayer->id());
-		return 0;
-	}
-}
-
-
-bool 
-TeCellStatistics(TeTheme* themeOut, TeTable& newAttrTable, TeGroupingAttr& stat, 
-				 TeTheme* themeIn, TeDatabase* db)
-{
-
-	TeGroupingAttr tempStat = stat;
-	string sqlResut = db->getSQLStatistics (tempStat);
-
-	bool dbStat = true;
-	TeGroupingAttr::iterator it = tempStat.begin();
-	while(it!= tempStat.end())
-	{
-		if(it->second != TeNOSTATISTIC)
-		{
-			dbStat = false;
-			break;
-		}
-		++it;
-	}
-		
-	if((!dbStat) || (sqlResut.empty()))
-		return false; 
-
-	TeDatabasePortal* portal = db->getPortal();
-
-	// mount sql 
-	//geom and collection tables from cell layer (cell)
-	string tableGeomOut = themeOut->layer()->tableName (TeCELLS);
-	string tableCollOut; 
-	if(themeOut->hasRestriction())
-		tableCollOut = themeOut->collectionTable();
-
-	//geom and collection tables from in layer (point or cell)
-	string tableGeomIn = themeIn->layer()->tableName (TePOINTS);
-	TeGeomRep geomRepIn = TePOINTS;
-	if(tableGeomIn.empty())
-	{
-		geomRepIn = TeCELLS;
-		tableGeomIn = themeIn->layer()->tableName (TeCELLS);
-	}
-
-	string tableCollIn; 
-	if(themeIn->hasRestriction())
-		tableCollIn = themeIn->collectionTable();
-
-	//sql from database
-	string sql = " SELECT " + tableGeomOut + ".object_id,  ";
-	sql += 	sqlResut;
-	sql += " FROM " + tableGeomOut +","+ tableGeomIn;
-
-	//for each point attr table 
-	string sqlWhere ="";
-	TeAttrTableVector vec = themeIn->attrTables();
-	for(unsigned int index=0; index<vec.size(); ++index)
-	{
-		if( (vec[index].tableType() != TeAttrStatic) && 
-			(vec[index].tableType() != TeAttrEvent)  &&
-			(vec[index].tableType() != TeFixedGeomDynAttr)) //only to static attribute table
-			continue;
-
-		//from clause
-		sql += ","+ vec[index].name();
-
-		//where clause
-		if(!sqlWhere.empty())
-			sqlWhere += " AND ";
-		sqlWhere += vec[index].name() +"."+ vec[index].linkName() +" = "+ tableGeomIn +".object_id ";
-	}
-
-	if(!tableCollIn.empty())
-	{
-		sql += ", "+ tableCollIn;
-		if(!sqlWhere.empty())
-			sqlWhere += " AND ";
-	
-		sqlWhere = tableGeomIn +".object_id = "+ tableCollIn +".c_object_id ";
-	}
-	if(!tableCollOut.empty())
-	{
-		sql += ", "+ tableCollOut;
-		if(!sqlWhere.empty())
-			sqlWhere += " AND ";
-	
-		sqlWhere += tableGeomOut +".object_id = "+ tableCollOut +".c_object_id ";
-	}
-
-	//box where
-	if(!sqlWhere.empty())
-		sqlWhere += " AND ";
-	
-	sqlWhere += db->getSQLBoxWhere (tableGeomOut, tableGeomIn, geomRepIn);
-
-	sql += " WHERE "+ sqlWhere; 
-	sql += " GROUP BY "+ tableGeomOut +".object_id";
-
-	if(!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-	
-	//Keep statistics in the tableAttrCell table   
-	if(!TeKeepStatistics(newAttrTable, portal))
-	{
-		delete portal;
-		return false;
-	}
-	
-	delete portal;
-	return true;
-}
-
-
-bool	
-TeKeepStatistics(TeTable& tableAttrCell, TeDatabasePortal* portal)
-{
-	
-	TeAttributeList attr = portal->getAttributeList();
-
-	//Mount the update sql from portal
-	string insert = "INSERT INTO "+ tableAttrCell.name() +" VALUES ( ";
-	while(portal->fetchRow())
-	{
-		string insert2 = "";
-		for(unsigned int i=0; i<attr.size(); ++i)
-		{
-			if(i>0)
-				insert2 += ",";
-			
-			string val = portal->getData(i);
-			if (attr[i].rep_.type_ == TeSTRING) 
-				insert2 += "'"+ val +"'";
-			else
-				insert2 += val;
-		}
-
-		string result = insert + insert2 +" )";
-		
-		if(!portal->getDatabase()->execute(result))
-			return false;
-	}
-		
-	return true;
-}	
-
-
-//////////////////////////////////////////////////////////////////////
-//
-//				Fill Cell Auxiliary Funcions
-//
-/////////////////////////////////////////////////////////////////////
-
-
-bool TeFillCellInitLoad (TeLayer* cell_layer, const string& cell_tablename, TeCellSet& cells)
-{
-	if (!cell_layer) return false;
-
-	// get cells
-	if (!cell_layer->getCells (cells)) return false;
-
-	// if dynamic table was not created, create it
-	TeTable table;
-	if (!cell_layer->getAttrTablesByName(cell_tablename, table, TeFixedGeomDynAttr))
-		if (!TeCreateBasicDynamicCellTable (cell_layer, cell_tablename))
-			return false;
-
-	return true;
-}
-
-
-void TeFillCellInitSTO (const TeCell& cell, TePropertyVector& result, TeSTElementSet& cellObjSet, TeAttrTableType atttype, TeTimeInterval& t)
-{
-	TeSTInstance cellObj;
-	cellObj.objectId (cell.objectId());
-	string uniqueId = cell.objectId();
-	cellObj.addUniqueId (uniqueId); 
-	
-	if(atttype != TeAttrStatic)
-	{
-		uniqueId += t.getInitialDate() + t.getInitialTime();
-		uniqueId += t.getFinalDate()   + t.getFinalTime  ();
-
-		cellObj.addUniqueId (uniqueId);
-		cellObj.timeInterval (t);
-	}
-
-	TePropertyVector::iterator itProp = result.begin();
-	while (itProp != result.end())
-	{
-		cellObj.addPropertyValue (itProp->value_);
-		itProp++;
-	}
-	cellObjSet.insertSTInstance (cellObj);
-	return;
-}
-
-
-void TeFillCellInitSTO (const TeCell& cell, vector<string>& result, TeSTElementSet& cellObjSet, TeAttrTableType atttype, TeTimeInterval& t)
-{
-	TeSTInstance cellObj;
-	cellObj.objectId (cell.objectId());
-	string uniqueId = cell.objectId();
-	cellObj.addUniqueId (uniqueId); 
-
-	if(atttype != TeAttrStatic)
-	{
-		uniqueId += t.getInitialDate() + t.getInitialTime();
-		uniqueId += t.getFinalDate()   + t.getFinalTime  ();
-
-		cellObj.addUniqueId (uniqueId);
-		cellObj.timeInterval (t);
-	}
-
-	cellObj.setProperties(result);
-	cellObjSet.insertSTInstance (cellObj);
-	return;
-}
-
-
-bool
-TeCreateBasicDynamicCellTable (TeLayer* cell_layer, const string cell_tablename)
-{
-	if (!cell_layer) return false;
-
-	TeAttribute		attribute;
-	TeAttributeList attList;
-	TeAttributeList keyList;
-
-	// attr_id
-	attribute.rep_.name_ = "attr_id";
-	attribute.rep_.type_ = TeSTRING;
-	attribute.rep_.numChar_ = 48;
-	attribute.rep_.isPrimaryKey_ = true;
-	attList.push_back (attribute);
-	keyList.push_back(attribute);
-
-	// object_id
-	attribute.rep_.name_ = "object_id";
-	attribute.rep_.type_ = TeSTRING;
-	attribute.rep_.isPrimaryKey_ = false;
-	attribute.rep_.numChar_ = 48;
-	attList.push_back ( attribute );
-	
-	//  initial_time
-	attribute.rep_.name_ = "initial_time";
-	attribute.rep_.type_ = TeDATETIME;   
-	attribute.dateTimeFormat_ = "YYYYsMMsDDsHHsmmsSS";
-	attribute.dateChronon_ = TeSECOND;
-	attribute.rep_.numChar_ = 48;
-	attList.push_back ( attribute );
-
-	//  final_time
-	attribute.rep_.name_ = "final_time";
- 	attribute.rep_.type_ = TeDATETIME;  
-	attribute.dateTimeFormat_ = "YYYYsMMsDDsHHsmmsSS";
-	attribute.dateChronon_ = TeSECOND;
-	attribute.rep_.numChar_ = 48;
-	attList.push_back ( attribute );
-		
-	// Create table and initialize attributes
-	TeTable cells_attTable (cell_tablename);       
-	cells_attTable.setAttributeList(attList);
-	cells_attTable.setTableType(TeFixedGeomDynAttr);
-	cells_attTable.setLinkName("object_id");
-	cells_attTable.setUniqueName("attr_id");
-	cells_attTable.attInitialTime ("initial_time"); 
-	cells_attTable.attFinalTime ("final_time"); 
-	cells_attTable.attTimeUnit (TeSECOND); 
-			
-	if (!cell_layer->createAttributeTable(cells_attTable))
-		return false;
-
-	TeAttributeList attr; 
-	cell_layer->database ()->getAttributeList (cell_tablename, attr);
-
-	return true;
-}
-
-//////////////////////////////////////////////////////////////////////
-//
-//					Fill Cell Operations
-//
-/////////////////////////////////////////////////////////////////////
-
-struct cellDist
-{
-	double distance;
-	TeCellSet::iterator ref;
-	bool done;
-	bool valid;
-};
-
-
-vector<vector<cellDist> > BuildNeighbors(TeCellSet cells)
-{
-	vector<vector<cellDist> > result;
-	int line = 0, column = 0;
-
-	// look for the number of lines and columns of the set
-	for(TeCellSet::iterator cell_it = cells.begin(); cell_it != cells.end(); cell_it++)
-	{
-		if( (*cell_it).column() > column) column = (*cell_it).column();
-		if( (*cell_it).line  () > line)   line   = (*cell_it).line  ();
-	} 
-	
-	line++;
-	column++;
-
-	// initialize the neighbors	
-	result.resize(line);
-	for(int i = 0; i < line; i++)
-	{
-		result[i].resize(column);
-		for(int j = 0; j < column; j++)
-		{
-			result[i][j].valid    = false;
-			result[i][j].done     = false;
-		    result[i][j].distance = 0;
-		}
-	}
-
-	// set the values for the ones that have a cell
-	for(TeCellSet::iterator cell_it = cells.begin(); cell_it != cells.end(); cell_it++)
-	{
-		result[ (*cell_it).line() ][ (*cell_it).column() ].ref   = cell_it;
-		result[ (*cell_it).line() ][ (*cell_it).column() ].valid = true;
-	} 
-	
-	return result;
-}
-
-struct procDist
-{
-	int line;
-	int column;
-	TeBox box;
-};
-
-
-bool CalculateDistance(unsigned int line, unsigned int column, TeBox box, TeTheme* theme, double r, TeGeomRep rep, vector<vector<cellDist> >& Neighbors, list<procDist>& procList)
-{
-	if( Neighbors[line][column].done || !Neighbors[line][column].valid )
-	{
-		return false;
-	}
-
-	TeCellSet::iterator cell_it = Neighbors[line][column].ref; 
-	
-	TeQuerierParams params(true, false);
-	params.setParams (theme);
-    params.setSpatialRest(box, TeWITHIN, rep);
-
-	TeQuerier querier(params);
-
-    querier.loadInstances();
-	int quant = querier.numElemInstances();
-	TeCoord2D p1 = (*cell_it).box().center();
-
-	double dist = TeMAXFLOAT;
-
-	if(rep == TePOINTS)
-	{
-		for(int i = 0; i < quant; i++)
-		{
-		    TeSTInstance sti;
-		    querier.fetchInstance(sti);
-			TeMultiGeometry mg = sti.geometries();
-	
-			double x = TeDistance(p1, mg.getPoints()[0].location());
-			if (dist > x) dist = x;
-		}
-	}
-	if(rep == TeLINES)
-	{
-		for(int i = 0; i < quant; i++)
-		{
-		    TeSTInstance sti;
-		    querier.fetchInstance(sti);
-			TeMultiGeometry mg = sti.geometries();
-
-			TeLineSet ls = mg.getLines();
-
-    		int line_index;
-		    TeCoord2D pinter;
-			double x;
-    		TeNearest (p1, ls, line_index, pinter, x);
-            if (dist > x) dist = x;
-		}
-	}
-	if(rep == TePOLYGONS)
-	{
-		for(int i = 0; i < quant; i++)
-		{
-		    TeSTInstance sti;
-		    querier.fetchInstance(sti);
-			TeMultiGeometry mg = sti.geometries();
-			TePolygonSet ps = mg.getPolygons();
-
-		    TePolygonSet box_ps, intersect;
-		    TePolygon pol = polygonFromBox((*cell_it).box());
-		    box_ps.add(pol);
-
-		    TeOverlay(box_ps, ps, intersect, TeINTERSECTION);
-			unsigned int kk = 0;
-		    if(!intersect.empty()) { dist = 0; kk = ps.size(); }
-		   
-			for (; kk < ps.size(); kk++)
-			{
-				TePolygon p = ps[kk];
-				for (unsigned int j = 0; j < p.size(); j++)
-				{
-					TeLinearRing l = p[j];
-					for (unsigned int k = 0; k < l.size(); k++)
-					{
-						double d = 	TeDistance (p1, l[k]);
-						if (dist > d) dist = d;
-					}
-				}
-			}
-		}
-	}
-
-	Neighbors[line][column].done     = true; 
-	Neighbors[line][column].distance = dist; 
-
-	TeBox searchbox(p1.x() - dist - 1.001*r, p1.y() - dist - 1.001*r,
-                    p1.x() + dist + 1.001*r, p1.y() + dist + 1.001*r);
-
-	procDist pd;
-	pd.box = searchbox;
-	if(line > 0)                         { pd.line = line-1; pd.column = column;   procList.push_back(pd); }
-	if(column > 0)                       { pd.line = line;   pd.column = column-1; procList.push_back(pd); }
-    if(line < Neighbors.size() - 1)      { pd.line = line+1; pd.column = column;   procList.push_back(pd); }
-	if(column < Neighbors[0].size() - 1) { pd.line = line;   pd.column = column+1; procList.push_back(pd); }
-	
-	return true;
-}
-
-bool TeFillCellDistanceOperation(TeTheme* theme,
-								 TeGeomRep rep,
-								 TeLayer* cell_layer,
-								 const string& cell_tablename,
-								 const string& output_columnName,
-								 TeTimeInterval t)
-{
-	TeFillCellStepLoadingData();
-
-	TeCellSet cells;
-	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
-
-	list<procDist> procList;
-	vector<vector<cellDist> > Neighbors = BuildNeighbors(cells);
-
-	TeFillCellStepStartProcessing(cells.size()*2);
-
-	TePropertyVector result;
-	TeCellSet::iterator cell_it = cells.begin();
-
-	double res = cells.resX();
-	if( res < cells.resY () ) res = cells.resY();
-	
-	procDist pd;
-
-	pd.line   = (*cell_it).line();
-	pd.column = (*cell_it).column();
-	pd.box    = theme->getThemeBox();
-
-	procList.push_back(pd);
-	int count = 0; // counting the progress
-
-	while(!procList.empty())
-	{
-		pd = procList.front();
-		procList.pop_front();
-		if(CalculateDistance(pd.line, pd.column, pd.box, theme, res, rep, Neighbors, procList))
-			if(!TeFillCellStepNextStep(++count)) return false;
-	}
-
-	TeTable table(cell_tablename);
-	cell_layer->database()->loadTableInfo(table);
-
-	TeSTElementSet cellObjSet (cell_layer);
-	//include the attribute description
-	TeAttribute attr;
-	attr.rep_.type_ = TeREAL;
-	attr.rep_.name_ = output_columnName;
-	cellObjSet.addProperty(attr);
-
-	while (cell_it != cells.end())
-	{
-	    string value_ = Te2String(Neighbors[(*cell_it).line()][(*cell_it).column()].distance);
-		vector<string> attrValues;
-		attrValues.push_back(value_);
-	    
-		TeFillCellInitSTO ((*cell_it), attrValues, cellObjSet, table.tableType(), t);
-		cell_it++;
-
-		if(!TeFillCellStepNextStep(++count)) return false;
-	}
-	
-	TeFillCellStepWriting();
-
-	if (!TeUpdateDBFromSet(&cellObjSet, cell_tablename))
-			return  false;
-
-	return true;
-}
-
-#include <sstream>
-
-bool TeFillCellSpatialOperation(TeDatabase* db,
-								TeComputeSpatialStrategy* operation,
-								const string& cell_layername,
-								const string& cell_tablename,
-								const string& output_columnName,
-								TeTimeInterval t)
-{
-	if (!db) return false;
-
-	TeFillCellStepLoadingData();
-
-	// Load input layer
-	TeLayer* cell_layer = new TeLayer (cell_layername);
-	if (!db->loadLayer (cell_layer))
-	{
-		 db->close();
-		 return false;
-	}
-
-	TeTable table(cell_tablename);
-	db->loadTableInfo(table);
-
-	TeCellSet cells;
-	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
-
-	TeSTElementSet cellObjSet (cell_layer);
-	//adds the new attribute description 
-	TeAttribute attr;
-	attr.rep_.name_ = output_columnName;
-	attr.rep_.type_ = operation->Type();
-	cellObjSet.addProperty(attr);
-
-	TeFillCellStepStartProcessing(cells.size());
-	TeCellSet::iterator cell_it = cells.begin();
-
-	int count = 0;
-	while (cell_it != cells.end())
-	{
-	    string value_ = operation->compute ((*cell_it).box());
-	    vector<string> attrValues;
-		attrValues.push_back (value_);
-	   
-		TeFillCellInitSTO ((*cell_it), attrValues, cellObjSet, table.tableType(), t);
-		cell_it++;
-
-		if(!TeFillCellStepNextStep(++count)) return false;
-	} 
-
-	TeFillCellStepWriting();
-	bool result = TeUpdateDBFromSet(&cellObjSet, cell_tablename);
-	cell_layer->loadLayerTables();
-
-	return result;
-}
-
-
-bool TeFillCellCategoryCountPercentageRasterOperation(TeDatabase* db,
-													  string raster_layername,
-													  string cell_layername,
-													  const string& cell_tablename,
-													  const string attrName,
-													  TeTimeInterval t)
-{
-	TeFillCellStepLoadingData();
-
-	map<string, string> classesMap;
-	vector< string > atts;
-	string value;
-
-	TeLayer* input_layer = new TeLayer (raster_layername);
-	if (!db->loadLayer (input_layer))
-	{
-		 db->close();
-		 return false;
-	}
-
-	atts.push_back(attrName);
-
-	vector<double> values;
-	bool found;
-	unsigned int i;
-	TeRaster* raster = input_layer->raster();
-	TeRaster::iterator rasterItBegin = raster->begin();
-	TeRaster::iterator rasterItEnd   = raster->end();
-
-	TeTable table(cell_tablename);
-	db->loadTableInfo(table);
-
-	TeLayer* cell_layer = new TeLayer (cell_layername);
-	if (!db->loadLayer (cell_layer))
-	{
-		 db->close();
-		 return false;
-	}
-
-	// Initialize cell set
-	TeCellSet cells;
-	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
-
-	// Initialize object set to store cell properties
-	TeSTElementSet cellObjSet (cell_layer);
-
-	// looking for the unique values in all the raster
-	TeFillCellStepStartProcessing(raster->params().nlines_ * raster->params().ncols_ + cells.size());
-
-	int count = 0;
-	while(rasterItBegin != rasterItEnd)
-	{
-		found = false;
-		for(i = 0; i < values.size(); ++i)
-			if(values[i] == (*rasterItBegin)[0])
-				found = true;
-		if(!found) 
-			values.push_back((*rasterItBegin)[0]);
-		++rasterItBegin;
-
-		if(!TeFillCellStepNextStep(++count)) return false;
-	}
-
-	// Process
-	TePropertyVector result;
-	map<double, int> counter;
-
-	// set the propertyvector of the cell object set
-	for(i = 0; i < values.size(); i++)
-	{
-		stringstream str;
-
-		str << values[i];
-        string value_ =  str.str();
-        for (unsigned j = 0; j < value_.size(); j++)
-            if(value_[j] == '.' || value_[j] == '+')
-                value_[j] = '_';
-
-        TeProperty prop;
-        prop.attr_.rep_.name_ = attrName + value_;
-        prop.attr_.rep_.type_ = TeREAL;
-        prop.attr_.rep_.numChar_ = 48;
-
-        cellObjSet.addProperty(prop.attr_);
-	}
-
-	TeCellSet::iterator cell_it = cells.begin();
-	vector<string> vprop;
-
-	while (cell_it != cells.end())
-	{
-		double total = 0.0;
-		TePolygon p = polygonFromBox((*cell_it).box());
-		TeRaster::iteratorPoly rasterItBegin(raster);
-		rasterItBegin = raster->begin(p, TeBBoxPixelInters, 0);
-		TeRaster::iteratorPoly rasterItEnd(raster);
-		rasterItEnd = raster->end(p, TeBBoxPixelInters, 0);
-
-		for(i = 0; i < values.size(); i++)
-			counter[values[i]] = 0;
-
-		while(rasterItBegin != rasterItEnd)
-		{
-			double pixel = (*rasterItBegin);
-			counter[pixel]++;
-			++rasterItBegin;
-			total++;
-		}		
-
-		//add the attribute values in the object set
-		vprop.clear();
-		for(i = 0; i < values.size(); i++)
-		{
-			stringstream str;
-			str << counter[values[i]] / total;
-			vprop.push_back(str.str());
-		}
-
-		TeFillCellInitSTO ((*cell_it), vprop, cellObjSet, table.tableType(), t);
-		cell_it++;
-
-		if(!TeFillCellStepNextStep(++count)) return false;
-	} 
-
-	TeFillCellStepWriting();
-	// Update DB
-	if (!TeUpdateDBFromSet (&cellObjSet, cell_tablename))
-		return  false;
-	return  true;
-}
-
-
-bool TeFillCellCategoryAreaPercentageOperation(TeTheme* theme,
-											   const string attrName,
-								 			   TeLayer* cell_layer,
-											   const string& cell_tablename,
-											   TeTimeInterval t)
-{
-	map<string, string> classesMap;
-	vector< string > atts;
-	string value;
-	TeQuerier* querier;
-	TeSTInstance sti;
-
-	atts.push_back(attrName);
-
- 	TeQuerierParams params (false, atts);
-	params.setParams (theme);
-
-	querier = new TeQuerier(params);
-
-	querier->loadInstances();
-
-	while( querier->fetchInstance(sti) )
-	{
-		value = sti.getPropertyVector()[0].value_;
-		classesMap[value] = value;
-
-	}
-	delete querier;
-
-	return TeFillCellCategoryAreaPercentageOperation(theme, attrName, cell_layer, cell_tablename, classesMap, t);
-}
-
-
-bool TeFillCellCategoryAreaPercentageOperation(TeTheme* theme,
-											   const string attrName,
-								 			   TeLayer* cell_layer,
-											   const string& cell_tablename,
-											   map<string, string>& classesMap,
-											   TeTimeInterval t)
-{
-	TeFillCellStepLoadingData();
-
-	TeCellSet cells;
-	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
-
-	TeSTElementSet cellObjSet (cell_layer);
-
-	TeTable table(cell_tablename);
-	cell_layer->database()->loadTableInfo(table);
-
-	TeCellSet::iterator cell_it = cells.begin();
-
-	TeFillCellStepStartProcessing(cells.size());
-	int count = 0;
-	while (cell_it != cells.end())
-	{
-	    TeProperty  prop;
-
-		// COMPUTE
-    // convert input box to a polygonset
-	    TePolygonSet box_ps;
-	    TePolygon pol = polygonFromBox((*cell_it).box());
-	    box_ps.add(pol);
-	    map<string, double>  areaMap;
-	    double partial_area = 0.0;
-
-	    // Build stoset
-	    TeSTElementSet stos (theme);
-	    vector<string> attrNames;
-	    attrNames.push_back (attrName); 
-	    if (TeSTOSetBuildDB (&stos, true, false, attrNames))
-        {   
-        
-            // initialize areMap
-            map<string, string>::iterator itMap = classesMap.begin();
-            while (itMap != classesMap.end())
-            {
-                areaMap[(*itMap).second] = 0;
-                ++itMap;
-            }
-            partial_area = 0.0;
-            // iterate over all objects that intercept the box
-            TeSTElementSet::iterator it = stos.begin();
-            while (it != stos.end())
-            {
-                string category;
-                if ((*it).getPropertyValue (attrName, category))
-                {   
-                    TePolygonSet objGeom;  
-                    if ((*it).getGeometry(objGeom))
-                    {
-                        TePolygonSet intersect;
-                        TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
-                        double intersectArea = TeGeometryArea (intersect);
-                        partial_area += intersectArea;
-                        areaMap[classesMap[category]] +=  intersectArea; // suppose objects are disjoint
-                    }
-                }
-                ++it;
-            }
-        }
-
-	    double areaTot = TeGeometryArea (box_ps);
-	    double perc_total = 0.0;
-	    double corrected_perc_total = 0.0;
-	    vector<double> vec_percent;
-
-		map <string, double>:: iterator areaIt = areaMap.begin();
-	    while(areaIt != areaMap.end())  
-	    {
-	        double percent = 0.0;
-	        if (areaTot != 0) percent = (*areaIt).second/areaTot;
-	        perc_total += percent;
-	        vec_percent.push_back (percent);
-			
-			//attribute list
-			TeAttribute at;
-			at.rep_.name_ = attrName + (*areaIt).first;
-			at.rep_.type_ = TeREAL;
-			cellObjSet.addProperty(at);
-	        ++areaIt;
-	    }
-
-		//fill the object set
-		int i= 0;
-	    areaIt = areaMap.begin();
-	    while(areaIt != areaMap.end())  
-	    {
-	        vector<string> values;
-			double percent = vec_percent[i];
-	        corrected_perc_total += percent;
-	        values.push_back(Te2String (percent));
-	        ++areaIt;
-	        i++;
-			TeFillCellInitSTO ((*cell_it), values, cellObjSet, table.tableType(), t);
-	    }
-
-		cell_it++;
-		if(!TeFillCellStepNextStep(++count)) return false;
-	} 
-
-	TeFillCellStepWriting();
-	bool result = TeUpdateDBFromSet(&cellObjSet, cell_tablename);
-	cell_layer->loadLayerTables();
-
-	return result;
-}
-
-bool TeFillCellNonSpatialOperation (TeTheme* theme,
-									TeGeomRep rep,
-									const string& input_attrname,
-									TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
-									TeLayer* cell_layer,
-									const string& cell_tablename, 
-									const string& output_columnName,
-									TeTimeInterval t)
-{
-	TeFillCellStepLoadingData();
-
-	if (!theme)      return false;
-	if (!cell_layer) return false;
-	if (!operation)  return false;
-
-	string s = theme->name();
-	// Initialize cell set
-	TeCellSet cells;
-	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
-
-	TeTable table(cell_tablename);
-	cell_layer->database()->loadTableInfo(table);
-
-	// Initialize object set to store cell properties
-	TeSTElementSet cellObjSet (cell_layer);
-
-	// Process
-	TePropertyVector result;
-	TeCellSet::iterator cell_it = cells.begin();
-	bool firstIteration = true;
-	vector<string> attrNames;
-	attrNames.push_back (input_attrname);	
-	
-	TeSTElementSet stos (theme);
-	if (!TeSTOSetBuildDB (&stos, true, false, attrNames))
-		return false;
-    
-	TeFillCellStepStartProcessing(cells.size());
-	int count = 0;	
-	while (cell_it != cells.end())
-	{
-		vector<TeSTInstance*> boxResult;
-		stos.search((*cell_it).box(), boxResult);
-
-		TeSTElementSet elemSetTemp(theme, stos.getAttributeList());
-		for(unsigned int i=0; i<boxResult.size(); ++i)
-		{
-            bool intersects = true;
-			if(rep==TePOLYGONS) 
-			{
-				intersects = false;
-				TePolygonSet	pSet;
-				boxResult[i]->getGeometry(pSet);
-				for(unsigned int j=0; j<pSet.size(); ++j)
-				{
-					if(TeIntersects(pSet[j],TeMakePolygon((*cell_it).box())))
-					{
-						intersects = true;
-						j = pSet.size();
-					}
-				}
-			}
-			else if(rep==TeLINES) 
-			{
-				intersects = false;
-				TeLineSet		lSet;
-				boxResult[i]->getGeometry(lSet);
-				for(unsigned int j=0; j<lSet.size(); ++j)
-				{
-					if(TeIntersects(lSet[j],TeMakePolygon((*cell_it).box())))
-					{
-						intersects = true;
-						j = lSet.size();
-					}
-				}
-			}
-						
-			if(intersects)
-				elemSetTemp.insertSTInstance(*(boxResult[i]));
-		}
-		
-		result = operation->compute (elemSetTemp.begin(0), elemSetTemp.end(0), output_columnName);
-		
-		// if property not found, stos iterator will return zero to operation. 
-		// To check this, have to be less general and use getProperty inside the compute method.		
-		if(firstIteration)
-		{
-			//add the attribute definitions in the object set, only once
-			TePropertyVector::iterator it = result.begin();
-			while(it!=result.end())
-			{
-                cellObjSet.addProperty(it->attr_);
-				++it;
-			}
-		}
-
-		//add the attribute values in the object set
-		TePropertyVector::iterator it = result.begin();
-		vector<string> values;
-		while(it!=result.end())
-		{
-			values.push_back(it->value_);
-			++it;
-		}
-
-		TeFillCellInitSTO ((*cell_it), values, cellObjSet, table.tableType(), t);
-		cell_it++;
-		firstIteration = false;
-
-		if(!TeFillCellStepNextStep(++count)) return false;
-	} 
-
-	TeFillCellStepWriting();
-	// Update DB
-	if (!TeUpdateDBFromSet (&cellObjSet, cell_tablename))
-		return  false;
-	return  true;
-}
-
-bool TeFillCellNonSpatialOperation (TeDatabase* db,
-										const string& input_layername, 
-										TeGeomRep rep,
-										const string& input_tablename, 
-										const string& input_attrname,
-										TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
-										const string& cell_layername, 
-										const string& cell_tablename, 
-										const string& output_columnName,
-										TeTimeInterval t)
-{
-	if (!db) return false;
-
-	// Load input layers
-	TeLayer* input_layer = new TeLayer (input_layername);
-	if (!db->loadLayer (input_layer))
-	{
-		 db->close();
-		 return false;
-	}
-
-	// Load output cells layer with geometry previously created
-	TeLayer* cell_layer = new TeLayer (cell_layername);
-	if (!db->loadLayer (cell_layer))
-	{
-		 db->close();
-		 return false;
-	}
-
-	// Initialize theme
-	TeTheme* theme = new TeTheme ("", input_layer);
-	vector<string> attrTableNames;
-	attrTableNames.push_back (input_tablename);
-	TeAttrTableVector atts;
-	if (!input_layer->getAttrTablesByName(attrTableNames, atts)) return false;
-	theme->setAttTables (atts);
-
-	bool ret = TeFillCellNonSpatialOperation (theme,
-											  rep,
-											  input_attrname,
-											  operation,
-											  cell_layer,
-											  cell_tablename, 
-											  output_columnName,
-											  t);
-
-	return ret;
-}
-
-
-bool TeFillCellNonSpatialRasterOperation (TeDatabase* db,
-										  const string& input_raster_layername, 
-										  TeComputeAttrStrategy<TeBoxRasterIterator>* operation,
-										  const string& cell_layername, 
-										  const string& cell_tablename, 
-										  const string& output_columnName,
-										  TeTimeInterval t)
-{
-	TeFillCellStepLoadingData();
-
-	if (!db) return false;
-
-	// Load input layers
-	TeLayer* input_layer = new TeLayer (input_raster_layername);
-	if (!db->loadLayer (input_layer))
-	{
-		 db->close();
-		 return false;
-	}
-
-	TeTable table(cell_tablename);
-	db->loadTableInfo(table);
-
-	TeRaster* raster = input_layer->raster();
-	if (!raster) return false;
-
-	// Load output cells layer with geometry previously created
-	TeLayer* cell_layer = new TeLayer (cell_layername);
-	if (!db->loadLayer (cell_layer))
-	{
-		 db->close();
-		 return false;
-	}
-
-	// Initialize cell set
-	TeCellSet cells;
-	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
-
-	// Initialize object set to store cell properties
-	TeSTElementSet cellObjSet (cell_layer);
-	//include the attribute description
-	TeAttribute attr;
-	attr.rep_.type_ = TeREAL;
-	attr.rep_.name_ = output_columnName;
-	cellObjSet.addProperty(attr);
-
-	TeFillCellStepStartProcessing(cells.size());
-
-	// Process
-	TePropertyVector result;
-	TeCellSet::iterator cell_it = cells.begin();
-
-	int count = 0;
-	while (cell_it != cells.end())
-	{
-		TeBoxRasterIterator rasterItBegin(raster, (*cell_it).box());
-		rasterItBegin.begin();
-		TeBoxRasterIterator rasterItEnd(raster, (*cell_it).box());
-		rasterItEnd.end();
-		result = operation->compute (rasterItBegin, rasterItEnd, output_columnName);										
-		TeFillCellInitSTO ((*cell_it), result, cellObjSet, table.tableType(), t);
-		cell_it++;
-
-		if(!TeFillCellStepNextStep(++count)) return false;
-	} 
-
-	TeFillCellStepWriting();
-	// Update DB
-	if (!TeUpdateDBFromSet (&cellObjSet, cell_tablename))
-		return  false;
-	return  true;
-}
-
-
-bool TeFillCellAggregateOperation ( TeDatabase* db,
-									const string& input_layername, 
-									const string& input_tablename, 
-									TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
-									vector<string>& attrNames,
-									const string& cell_layername, 
-									const string& cell_tablename, 
-									TeTimeInterval t)
-{
-	if (!db) return false;
-
-	// Load input layers
-	TeLayer* input_layer = new TeLayer (input_layername);
-	if (!db->loadLayer (input_layer))
-	{
-		 db->close();
-		 return false;
-	}
-
-	// Load output cells layer with geometry previously created
-	TeLayer* cell_layer = new TeLayer (cell_layername);
-
-	if (!db->loadLayer (cell_layer))
-	{
-		 db->close();
-		 return false;
-	}
-
-	// Initialize cell set
-	TeCellSet cells;
-	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
-
-	// Initialize object set to store cell properties
-	TeSTElementSet cellObjSet (cell_layer);
-
-	// Initialize theme
-	TeTheme* theme = new TeTheme ("", input_layer);
-	vector<string> attrTableNames;
-	attrTableNames.push_back (input_tablename);
-	TeAttrTableVector atts;
-	if (!input_layer->getAttrTablesByName(attrTableNames, atts)) return false;
-	theme->setAttTables (atts);
-
-
-	// Process
-	TeCellSet::iterator cell_it = cells.begin();
-	while (cell_it != cells.end())
-	{
-		TeSTInstance cellObj;
-		cellObj.objectId ((*cell_it).objectId());
-		string uniqueId = (*cell_it).objectId();
-		cellObj.addUniqueId (uniqueId); 
-		uniqueId += t.getInitialDate() + t.getInitialTime();
-		uniqueId += t.getFinalDate() + t.getFinalTime() ;
-		cellObj.addUniqueId (uniqueId);
-		cellObj.timeInterval (t);
-		
-		// Set restrictions on a theme and create stoset
-		theme->setSpatialRest((*cell_it).box(), TeCELLS); //????? TeWITHIN 	
-		TeSTElementSet stos (theme);
-		TeSTOSetBuildDB (&stos, true, false, attrNames);
-			
-		// Create stoset based on input layer
-		TePropertyVector result;
-		vector<string>::iterator attIt = attrNames.begin();
-		while (attIt != attrNames.end())
-		{
-			result = operation->compute (stos.begin(*attIt), stos.end(*attIt), (*attIt));
-            // if property not found, stos iterator will return zero to operation. 
-            // To check this, have to be less general and use getProperty inside the compute method.		
-			TePropertyVector::iterator itProp = result.begin();
-			while (itProp != result.end())
-			{
-				cellObj.addProperty (*itProp);
-				itProp++;
-			}
-			attIt++;
-		}
-		cellObjSet.insertSTInstance (cellObj);
-
-		cell_it++;
-	}
-
-	// Update DB
-	if (!TeUpdateDBFromSet (&cellObjSet, cell_tablename)) return  false;
-
-	return  true;
-}
-
-
-bool TeFillCellConnectionOperation (	TeDatabase* db,
-										TeSTElementSet objects,
-										TeGeomRep rep,
-										TeGraphNetwork* net,
-										const string& /*input_attrName*/,
-
-										TeTimeInterval t,
-										const string& cell_layername, 
-										const string& cell_tablename, 
-										const string& /*output_columnName*/,
-										
-								
-										TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
-										double /*local_distance_factor*/,
-										double /*net_distance_factor*/,
-										double /*net_conn_factor*/,
-										double /*mult_factor*/)
-{
-
-	if (!operation) return false;
-	if (!net) return false;
-	if (!db) return false;
-
-	// Load output cells layer with geometry previously created
-
-	TeLayer* cell_layer = new TeLayer (cell_layername);
-
-	if (!db->loadLayer (cell_layer))
-	{
-		 db->close();
-		 return false;
-	}
-
-	TeTable table(cell_tablename);
-	db->loadTableInfo(table);
-
-	// Initialize cell set
-	TeCellSet cells;
-	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
-
-	// Initialize object set to store cell properties
-	TeSTElementSet cellObjSet (cell_layer);
-
-	// Process
-	TePropertyVector result;
-	TeCellSet::iterator cell_it = cells.begin();
-	while (cell_it != cells.end())
-	{
-		TeSTInstance cellObj;
-		cellObj.objectId ((*cell_it).objectId());
-		string uniqueId = (*cell_it).objectId();
-		cellObj.addUniqueId (uniqueId);
-		uniqueId += t.getInitialDate() + t.getInitialTime();
-		uniqueId += t.getFinalDate() + t.getFinalTime() ;
-		cellObj.addUniqueId (uniqueId);
-		cellObj.timeInterval (t);	
-		cellObjSet.insertSTInstance (cellObj);
-		cell_it++;
-	} 
-
-	TeProxMatrixOpenNetworkStrategy2    sc_net (&cellObjSet, TeCELLS, &objects, rep, 0, TeMAXFLOAT, TeMAXFLOAT, net);
- //	TeProxMatrixConnectionStrenghtStrategy sw(4, 0.0, false);
-
-/* TODO: recolocar!!!
-	TeProxMatrixInverseDistanceStrategy sw (local_distance_factor, net_distance_factor, net_conn_factor, mult_factor, false);
-	TeProxMatrixNoSlicingStrategy ss_no;
-	TeGeneralizedProxMatrix<TeSTElementSet> mat (&sc_net, &sw, &ss_no);
-
-	// initialize object set to store cell properties
-	TeSTElementSet cellObjSet2 (cell_layer);
-	TeCellSet::iterator cell_it2 = cells.begin();
-	while (cell_it2 != cells.end())
-	{
-		TeSTElementSet neigh = mat.getSTENeighbours((*cell_it2).objectId());	
-
-		result = operation->compute (neigh.begin(input_attrName), neigh.end(input_attrName), output_columnName); 	// if property not found, stos iterator will return zero to operation. To check this, have to be less general and use getProperty inside the compute method.		
-		TeFillCellInitSTO ((*cell_it), propvec, cellObjSet2, table.tableType(), t);
-		cell_it2++;
-	} 
-
-
-// Update DB
-	if (!TeUpdateDBFromSet (&cellObjSet2, cell_tablename))
-			return  false;
-*/
-	return  true;
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeCellAlgorithms.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeDatabase.h"
+#include "TeProgress.h"
+#include "TeRepresentation.h"
+#include "TeGeneralizedProxMatrix.h"
+#include "TeOverlay.h"
+#include <TeDatabase.h>
+#include <TeQuerier.h>
+#include <TeQuerierParams.h>
+#include <TeSTEFunctionsDB.h>
+#include <TeUtils.h>
+
+using namespace TeOVERLAY;
+
+// functions for working with the progress bar
+
+void TeFillCellStepLoadingData()
+{
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(2);
+		TeProgress::instance()->setMessage("Step 1/3: Loading data");
+		TeProgress::instance()->setProgress(1);
+	}
+	return;
+}
+
+void TeFillCellStepStartProcessing(int steps)
+{
+	if (TeProgress::instance())
+	{
+		TeProgress::instance()->reset();
+		TeProgress::instance()->setTotalSteps(steps);
+		TeProgress::instance()->setMessage("Step 2/3: Processing");
+	}
+}
+
+bool TeFillCellStepNextStep(int step)
+{
+	if(TeProgress::instance())
+	{
+		if (TeProgress::instance()->wasCancelled())
+		{
+			TeProgress::instance()->reset();
+			return false;
+		}
+		else
+			TeProgress::instance()->setProgress(step);
+	}
+	return true;
+}
+
+void TeFillCellStepWriting()
+{
+	if (TeProgress::instance())
+	{
+		TeProgress::instance()->reset();
+		TeProgress::instance()->setMessage("Step 3/3: Writing results");
+	}
+}
+
+// TeBoxRasterIterator functions
+TeBoxRasterIterator::TeBoxRasterIterator(TeRaster* raster_, TeBox box) 
+{ 
+	raster = raster_;
+	TeCoord2D l = raster->coord2Index(box.lowerLeft());
+	TeCoord2D r = raster->coord2Index(box.upperRight());
+
+	xo = (int)floor(l.x()); if(xo < 0) xo = 0;
+	yo = (int)floor(r.y()); if(yo < 0) yo = 0;
+	xf = (int)floor(r.x()); if(xf >= raster->params().ncols_)   xf = raster->params().ncols_ - 1;
+	yf = (int)floor(l.y()); if(yf >= raster->params().nlines_)  yf = raster->params().nlines_  - 1;
+
+	// in the case where the cell does not have intersection with any pixel of the raster
+	end_ = false;
+	if(xo >= raster->params().ncols_)  end_ = true;
+	if(yo >= raster->params().nlines_) end_ = true;
+	if(xf <= 0)                        end_ = true;
+	if(yf <= 0)                        end_ = true;
+}
+
+
+TeBoxRasterIterator&
+TeBoxRasterIterator::operator++() 
+{ 
+	x++;
+	if(x > xf)
+	{
+		x = xo;
+		y++;
+	}
+	return *this;
+}
+
+
+TeBoxRasterIterator 
+TeBoxRasterIterator::operator++(int) 
+{
+	x++;
+	if(x >= xf)
+	{
+		x = xo;
+		y++;
+	}
+	return *this;
+}
+
+double 
+TeBoxRasterIterator::operator*() 
+{ 
+	double value;
+	raster->getElement (x, y, value, 0);
+	return value;
+}
+
+bool 
+TeBoxRasterIterator::operator==(const TeBoxRasterIterator& rhs) const
+{
+	return (this->x == rhs.x && this->y == rhs.y);
+}
+
+bool 
+TeBoxRasterIterator::operator!=(const TeBoxRasterIterator& rhs) const
+{
+    return (this->x != rhs.x || this->y != rhs.y);
+}
+
+bool 
+TeBoxRasterIterator::getProperty(TeProperty& prop) 
+{
+	double value = 0.0;
+    prop.attr_.rep_.type_ = TeREAL;
+    prop.attr_.rep_.name_ = raster->params().fileName_;
+    prop.value_ = Te2String (value);
+
+	raster->getElement (x, y, value, 0);
+	prop.value_ = Te2String(value);
+    return true;
+}
+
+TeBoxRasterIterator 
+TeBoxRasterIterator::begin()
+{
+	if(end_) 
+		return end();
+	x = xo;
+	y = yo;
+	return *this;
+}
+
+TeBoxRasterIterator 
+TeBoxRasterIterator::end()
+{
+	y = yf+1;
+	x = xo;
+	return *this;
+}
+
+TeLayer* 
+TeCreateCells( const string& layerName, TeLayer* layerBase, 
+			   double resX, double resY, TeBox& box, bool mask)
+{
+	if (!layerBase || layerName.empty())
+		return 0;
+
+	TeDatabase* db = layerBase->database();
+	if (!db)
+		return 0;
+
+	TeDatabasePortal* portal = db->getPortal();
+	if (!portal)
+		return 0;
+
+	TeProjection* proj = layerBase->projection();
+
+	string newLayerName = layerName;
+	TeLayerMap& layerMap = db->layerMap();
+	TeLayerMap::iterator it;
+	bool flag = true;
+	int n = 1;
+	while (flag)
+	{
+		for (it = layerMap.begin(); it != layerMap.end(); ++it)
+		{
+			if (TeStringCompare(it->second->name(),newLayerName))
+				break;
+		}
+		if (it == layerMap.end())
+			flag = 0;
+		else
+			newLayerName = layerName + "_" +Te2String(n);
+		n++;	
+	}
+
+	string polTableName;
+	if (mask)
+	{
+		TeRepresentation* repp = layerBase->getRepresentation(TePOLYGONS);
+		if (repp)
+		{
+			if (!box.isValid())
+				box = adjustToCut(repp->box_,resX,resY);
+			polTableName = repp->tableName_;
+		}
+		else
+			mask = false;
+	}
+	else 
+	{
+		if (!box.isValid())
+			box = adjustToCut(layerBase->box(),resX,resY);
+	}
+
+	TeBox newBox = adjustToCut(box,resX,resY);
+	double x,y,x1,x2,y1,y2;
+	x1 = newBox.x1_;
+	y1 = newBox.y1_;
+	x2 = newBox.x2_;
+	y2 = newBox.y2_;
+
+	int maxcols, maxlines;
+	maxlines = TeRound((y2-y1)/resY);
+	maxcols = TeRound((x2-x1)/resX);
+
+	TeAttribute attribute;
+	TeAttributeList attList;
+	attribute.rep_.name_ = "object_id";
+	attribute.rep_.type_ = TeSTRING;
+	attribute.rep_.numChar_ = 48;
+	attribute.rep_.isPrimaryKey_ = true;
+	attList.push_back ( attribute );
+	attribute.rep_.name_ = "Col";
+	attribute.rep_.type_ = TeINT;
+	attribute.rep_.isPrimaryKey_ = false;
+	attList.push_back ( attribute );
+	attribute.rep_.name_ = "Lin";
+	attribute.rep_.type_ = TeINT;
+	attribute.rep_.isPrimaryKey_ = false;
+	attList.push_back ( attribute );	
+
+	TeLayer* newLayer = new TeLayer(layerName,db,newBox,proj);
+	if (!newLayer || newLayer->id() <= 0)
+	{
+		delete portal;
+		return 0;
+	}
+	newLayer->addGeometry(TeCELLS);
+	TeRepresentation* repp = newLayer->getRepresentation(TeCELLS);
+	if (!repp)
+	{
+		db->deleteLayer(newLayer->id());
+		delete portal;
+		return 0;
+	}
+	repp->box_ = newBox;
+	repp->resX_ = resX;
+	repp->resY_ = resY;
+	repp->nCols_ = maxcols;
+	repp->nLins_ = maxlines;
+	db->updateRepresentation(newLayer->id(),*repp);
+
+	TeTable attTable (layerName,attList,"object_id","object_id",TeAttrStatic);
+	
+	newLayer->createAttributeTable(attTable);
+
+	TeCellSet cells;
+	cells.resX(resX);
+	cells.resY(resY);
+
+	int col,lin,ncels=0;
+	bool status;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(maxlines);
+
+	TePolygon curPol;
+	bool found = false;
+
+	TePrecision::instance().setPrecision(TeGetPrecision(proj));
+	
+	y=y2;
+	for (lin=0; lin<maxlines; ++lin) 
+	{	
+		double yu = y;
+		y=y-resY;
+		x=x1;
+
+		for (col=0; col<maxcols; ++col)
+		{
+			TeBox box(x,y,x+resX,yu);
+			found = false;
+			// check if there should be used the polygon representation as a mask
+			if (mask) 
+			{
+				TePolygon polBox = polygonFromBox(box);
+				// check if the cell intersects the current polygon
+				if (TeIntersects(polBox,curPol))
+					found = true;
+				else
+				{
+					if (db->spatialRelation(polTableName, TePOLYGONS, 
+						(TePolygon*)&polBox, portal, TeINTERSECTS))
+					{
+						curPol.clear();
+						portal->fetchGeometry(curPol);
+						found = true;
+					}
+					portal->freeResult();
+				}
+			}
+
+			if (!mask || found)
+			{
+				// build geometry
+				TeCell cell(box,col,lin);
+				char celId[32];
+				sprintf(celId,"C%02dL%02d",col,lin);
+				cell.objectId(string(celId));
+				cells.add(cell);
+				
+				// build default attributes
+				TeTableRow row;
+				row.push_back(cell.objectId()); 
+				row.push_back(Te2String(col)); 
+				row.push_back(Te2String(lin)); 
+				attTable.add(row);
+				ncels++;
+			}
+			x=x+resX;
+		}
+		if (attTable.size() > 0)	// if there is some attributes in this line
+		{
+			status = newLayer->saveAttributeTable(attTable);
+			attTable.clear();
+			status = newLayer->addCells(cells);
+			cells.clear();
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(lin);
+			}			
+		}
+	}
+	delete portal;
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	if (ncels > 0)
+		return newLayer;
+	else
+	{
+		db->deleteLayer(newLayer->id());
+		return 0;
+	}
+}
+
+
+
+	
+TeLayer*
+TeCreateCells(const string& layerName,TeTheme* theme, double resX, double resY, TeBox& box)
+{
+	TeLayer* inputLayer = theme->layer();
+	TeRepresentation* pp = inputLayer->getRepresentation(TePOLYGONS);
+	if (!pp)
+		return 0;
+
+	TeDatabase* db = inputLayer->database();
+	TeDatabasePortal* portal = db->getPortal();
+	if (!portal)
+		return 0;
+
+	string newLayerName = layerName;
+	TeLayerMap& layerMap = db->layerMap();
+	TeLayerMap::iterator it;
+	bool flag = true;
+	int n = 1;
+	while (flag)
+	{
+		for (it = layerMap.begin(); it != layerMap.end(); ++it)
+		{
+			if (TeStringCompare(it->second->name(),newLayerName))
+				break;
+		}
+		if (it == layerMap.end())
+			flag = 0;
+		else
+			newLayerName = layerName + "_" +Te2String(n);
+		n++;	
+	}
+
+	if (!box.isValid())
+		box = pp->box_;
+
+	TeBox newBox = adjustToCut(box,resX,resY);
+	double x,y,x1,x2,y1,y2;
+	x1 = newBox.x1_;
+	y1 = newBox.y1_;
+	x2 = newBox.x2_;
+	y2 = newBox.y2_;
+
+	int maxcols, maxlines;
+	maxlines = TeRound((y2-y1)/resY);
+	maxcols = TeRound((x2-x1)/resX);
+
+	TeAttribute attribute;
+	TeAttributeList attList;
+	attribute.rep_.name_ = "object_id";
+	attribute.rep_.type_ = TeSTRING;
+	attribute.rep_.isPrimaryKey_ = true;
+	attribute.rep_.numChar_ = 48;
+	attList.push_back ( attribute );
+
+	attribute.rep_.name_ = "Col";
+	attribute.rep_.type_ = TeINT;
+	attribute.rep_.isPrimaryKey_ = false;
+	attList.push_back ( attribute );
+
+	attribute.rep_.name_ = "Lin";
+	attribute.rep_.type_ = TeINT;
+	attribute.rep_.isPrimaryKey_ = false;
+	attList.push_back ( attribute );	
+
+	TeLayer* newLayer = new TeLayer(layerName,db,newBox,inputLayer->projection());
+	if (!newLayer || newLayer->id() <= 0)
+	{
+		return 0;
+		delete portal;
+	}
+	newLayer->addGeometry(TeCELLS);
+	TeRepresentation* repp = newLayer->getRepresentation(TeCELLS);
+	if (!repp)
+	{
+		db->deleteLayer(newLayer->id());
+		delete portal;
+		return 0;
+	}
+	repp->box_ = newBox;
+	repp->resX_ = resX;
+	repp->resY_ = resY;
+	repp->nCols_ = maxcols;
+	repp->nLins_ = maxlines;
+	db->updateRepresentation(newLayer->id(),*repp);
+
+	TeTable attTable (layerName,attList,"object_id","object_id",TeAttrStatic);
+	newLayer->createAttributeTable(attTable);
+
+	string polTableName = inputLayer->tableName(TePOLYGONS);
+
+	TeCellSet cells;
+	cells.resX(resX);
+	cells.resY(resY);
+
+	TePolygon curPol;
+	int col,lin;
+	bool status;
+	int ncels = 0;
+
+	TePrecision::instance().setPrecision(TeGetPrecision(newLayer->projection()));
+
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(maxlines);
+
+	bool found;
+	y=y2;
+	for (lin=0; lin<maxlines; ++lin) 
+	{	
+		double yu = y;
+		y=y-resY;
+		x=x1;
+		for (col=0; col<maxcols; ++col)
+		{
+			found = false;
+			TeBox box(x,y,x+resX,yu);
+
+			TePolygon polBox = polygonFromBox(box);
+			// check if the cell intersects the current polygon
+			if (TeIntersects(polBox,curPol))
+				found = true;
+			else
+			{
+				if (db->spatialRelation(polTableName, TePOLYGONS, 
+					(TePolygon*)&polBox, portal, TeINTERSECTS, theme->collectionTable()))
+				{
+					curPol.clear();
+					portal->fetchGeometry(curPol);
+					found = true;
+				}
+				portal->freeResult();
+			}
+			if (found)
+			{
+				TeCell cell(box,col,lin);
+				char celId[32];
+				sprintf(celId,"C%02dL%02d",col,lin);
+				cell.objectId(string(celId));
+				cells.add(cell);
+
+				TeTableRow row;
+				row.push_back(cell.objectId()); 
+				row.push_back(Te2String(col)); 
+				row.push_back(Te2String(lin)); 
+				attTable.add(row);
+				++ncels;		
+			}
+			x=x+resX;
+		}
+		if (attTable.size() > 0)	// if there is some attributes in this line
+		{
+			status = newLayer->saveAttributeTable(attTable);
+			attTable.clear();
+			status = newLayer->addCells(cells);
+			cells.clear();
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(lin);
+			}	
+		}
+	}
+	delete portal;
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	if (ncels > 0)
+		return newLayer;
+	else
+	{
+		db->deleteLayer(newLayer->id());
+		return 0;
+	}
+}
+
+
+bool 
+TeCellStatistics(TeTheme* themeOut, TeTable& newAttrTable, TeGroupingAttr& stat, 
+				 TeTheme* themeIn, TeDatabase* db)
+{
+
+	TeGroupingAttr tempStat = stat;
+	string sqlResut = db->getSQLStatistics (tempStat);
+
+	bool dbStat = true;
+	TeGroupingAttr::iterator it = tempStat.begin();
+	while(it!= tempStat.end())
+	{
+		if(it->second != TeNOSTATISTIC)
+		{
+			dbStat = false;
+			break;
+		}
+		++it;
+	}
+		
+	if((!dbStat) || (sqlResut.empty()))
+		return false; 
+
+	TeDatabasePortal* portal = db->getPortal();
+
+	// mount sql 
+	//geom and collection tables from cell layer (cell)
+	string tableGeomOut = themeOut->layer()->tableName (TeCELLS);
+	string tableCollOut; 
+	if(themeOut->hasRestriction())
+		tableCollOut = themeOut->collectionTable();
+
+	//geom and collection tables from in layer (point or cell)
+	string tableGeomIn = themeIn->layer()->tableName (TePOINTS);
+	TeGeomRep geomRepIn = TePOINTS;
+	if(tableGeomIn.empty())
+	{
+		geomRepIn = TeCELLS;
+		tableGeomIn = themeIn->layer()->tableName (TeCELLS);
+	}
+
+	string tableCollIn; 
+	if(themeIn->hasRestriction())
+		tableCollIn = themeIn->collectionTable();
+
+	//sql from database
+	string sql = " SELECT " + tableGeomOut + ".object_id,  ";
+	sql += 	sqlResut;
+	sql += " FROM " + tableGeomOut +","+ tableGeomIn;
+
+	//for each point attr table 
+	string sqlWhere ="";
+	TeAttrTableVector vec = themeIn->attrTables();
+	for(unsigned int index=0; index<vec.size(); ++index)
+	{
+		if( (vec[index].tableType() != TeAttrStatic) && 
+			(vec[index].tableType() != TeAttrEvent)  &&
+			(vec[index].tableType() != TeFixedGeomDynAttr)) //only to static attribute table
+			continue;
+
+		//from clause
+		sql += ","+ vec[index].name();
+
+		//where clause
+		if(!sqlWhere.empty())
+			sqlWhere += " AND ";
+		sqlWhere += vec[index].name() +"."+ vec[index].linkName() +" = "+ tableGeomIn +".object_id ";
+	}
+
+	if(!tableCollIn.empty())
+	{
+		sql += ", "+ tableCollIn;
+		if(!sqlWhere.empty())
+			sqlWhere += " AND ";
+	
+		sqlWhere = tableGeomIn +".object_id = "+ tableCollIn +".c_object_id ";
+	}
+	if(!tableCollOut.empty())
+	{
+		sql += ", "+ tableCollOut;
+		if(!sqlWhere.empty())
+			sqlWhere += " AND ";
+	
+		sqlWhere += tableGeomOut +".object_id = "+ tableCollOut +".c_object_id ";
+	}
+
+	//box where
+	if(!sqlWhere.empty())
+		sqlWhere += " AND ";
+	
+	sqlWhere += db->getSQLBoxWhere (tableGeomOut, tableGeomIn, geomRepIn);
+
+	sql += " WHERE "+ sqlWhere; 
+	sql += " GROUP BY "+ tableGeomOut +".object_id";
+
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	
+	//Keep statistics in the tableAttrCell table   
+	if(!TeKeepStatistics(newAttrTable, portal))
+	{
+		delete portal;
+		return false;
+	}
+	
+	delete portal;
+	return true;
+}
+
+
+bool	
+TeKeepStatistics(TeTable& tableAttrCell, TeDatabasePortal* portal)
+{
+	
+	TeAttributeList attr = portal->getAttributeList();
+
+	//Mount the update sql from portal
+	string insert = "INSERT INTO "+ tableAttrCell.name() +" VALUES ( ";
+	while(portal->fetchRow())
+	{
+		string insert2 = "";
+		for(unsigned int i=0; i<attr.size(); ++i)
+		{
+			if(i>0)
+				insert2 += ",";
+			
+			string val = portal->getData(i);
+			if (attr[i].rep_.type_ == TeSTRING) 
+				insert2 += "'"+ val +"'";
+			else
+				insert2 += val;
+		}
+
+		string result = insert + insert2 +" )";
+		
+		if(!portal->getDatabase()->execute(result))
+			return false;
+	}
+		
+	return true;
+}	
+
+
+//////////////////////////////////////////////////////////////////////
+//
+//				Fill Cell Auxiliary Funcions
+//
+/////////////////////////////////////////////////////////////////////
+
+
+bool TeFillCellInitLoad (TeLayer* cell_layer, const string& cell_tablename, TeCellSet& cells)
+{
+	if (!cell_layer) return false;
+
+	// get cells
+	if (!cell_layer->getCells (cells)) return false;
+
+	// if dynamic table was not created, create it
+	TeTable table;
+	if (!cell_layer->getAttrTablesByName(cell_tablename, table, TeFixedGeomDynAttr))
+		if (!TeCreateBasicDynamicCellTable (cell_layer, cell_tablename))
+			return false;
+
+	return true;
+}
+
+
+void TeFillCellInitSTO (const TeCell& cell, TePropertyVector& result, TeSTElementSet& cellObjSet, TeAttrTableType atttype, TeTimeInterval& t)
+{
+	TeSTInstance cellObj;
+	cellObj.objectId (cell.objectId());
+	string uniqueId = cell.objectId();
+	cellObj.addUniqueId (uniqueId); 
+	
+	if(atttype != TeAttrStatic)
+	{
+		uniqueId += t.getInitialDate() + t.getInitialTime();
+		uniqueId += t.getFinalDate()   + t.getFinalTime  ();
+
+		cellObj.addUniqueId (uniqueId);
+		cellObj.timeInterval (t);
+	}
+
+	TePropertyVector::iterator itProp = result.begin();
+	while (itProp != result.end())
+	{
+		cellObj.addPropertyValue (itProp->value_);
+		itProp++;
+	}
+	cellObjSet.insertSTInstance (cellObj);
+	return;
+}
+
+
+void TeFillCellInitSTO (const TeCell& cell, vector<string>& result, TeSTElementSet& cellObjSet, TeAttrTableType atttype, TeTimeInterval& t)
+{
+	TeSTInstance cellObj;
+	cellObj.objectId (cell.objectId());
+	string uniqueId = cell.objectId();
+	cellObj.addUniqueId (uniqueId); 
+
+	if(atttype != TeAttrStatic)
+	{
+		uniqueId += t.getInitialDate() + t.getInitialTime();
+		uniqueId += t.getFinalDate()   + t.getFinalTime  ();
+
+		cellObj.addUniqueId (uniqueId);
+		cellObj.timeInterval (t);
+	}
+
+	cellObj.setProperties(result);
+	cellObjSet.insertSTInstance (cellObj);
+	return;
+}
+
+
+bool
+TeCreateBasicDynamicCellTable (TeLayer* cell_layer, const string cell_tablename)
+{
+	if (!cell_layer) return false;
+
+	TeAttribute		attribute;
+	TeAttributeList attList;
+	TeAttributeList keyList;
+
+	// attr_id
+	attribute.rep_.name_ = "attr_id";
+	attribute.rep_.type_ = TeSTRING;
+	attribute.rep_.numChar_ = 48;
+	attribute.rep_.isPrimaryKey_ = true;
+	attList.push_back (attribute);
+	keyList.push_back(attribute);
+
+	// object_id
+	attribute.rep_.name_ = "object_id";
+	attribute.rep_.type_ = TeSTRING;
+	attribute.rep_.isPrimaryKey_ = false;
+	attribute.rep_.numChar_ = 48;
+	attList.push_back ( attribute );
+	
+	//  initial_time
+	attribute.rep_.name_ = "initial_time";
+	attribute.rep_.type_ = TeDATETIME;   
+	attribute.dateTimeFormat_ = "YYYYsMMsDDsHHsmmsSS";
+	attribute.dateChronon_ = TeSECOND;
+	attribute.rep_.numChar_ = 48;
+	attList.push_back ( attribute );
+
+	//  final_time
+	attribute.rep_.name_ = "final_time";
+ 	attribute.rep_.type_ = TeDATETIME;  
+	attribute.dateTimeFormat_ = "YYYYsMMsDDsHHsmmsSS";
+	attribute.dateChronon_ = TeSECOND;
+	attribute.rep_.numChar_ = 48;
+	attList.push_back ( attribute );
+		
+	// Create table and initialize attributes
+	TeTable cells_attTable (cell_tablename);       
+	cells_attTable.setAttributeList(attList);
+	cells_attTable.setTableType(TeFixedGeomDynAttr);
+	cells_attTable.setLinkName("object_id");
+	cells_attTable.setUniqueName("attr_id");
+	cells_attTable.attInitialTime ("initial_time"); 
+	cells_attTable.attFinalTime ("final_time"); 
+	cells_attTable.attTimeUnit (TeSECOND); 
+			
+	if (!cell_layer->createAttributeTable(cells_attTable))
+		return false;
+
+	TeAttributeList attr; 
+	cell_layer->database ()->getAttributeList (cell_tablename, attr);
+
+	return true;
+}
+
+//////////////////////////////////////////////////////////////////////
+//
+//					Fill Cell Operations
+//
+/////////////////////////////////////////////////////////////////////
+
+struct cellDist
+{
+	double distance;
+	TeCellSet::iterator ref;
+	bool done;
+	bool valid;
+};
+
+
+vector<vector<cellDist> > BuildNeighbors(TeCellSet cells)
+{
+	vector<vector<cellDist> > result;
+	int line = 0, column = 0;
+
+	// look for the number of lines and columns of the set
+	for(TeCellSet::iterator cell_it = cells.begin(); cell_it != cells.end(); cell_it++)
+	{
+		if( (*cell_it).column() > column) column = (*cell_it).column();
+		if( (*cell_it).line  () > line)   line   = (*cell_it).line  ();
+	} 
+	
+	line++;
+	column++;
+
+	// initialize the neighbors	
+	result.resize(line);
+	for(int i = 0; i < line; i++)
+	{
+		result[i].resize(column);
+		for(int j = 0; j < column; j++)
+		{
+			result[i][j].valid    = false;
+			result[i][j].done     = false;
+		    result[i][j].distance = 0;
+		}
+	}
+
+	// set the values for the ones that have a cell
+	for(TeCellSet::iterator cell_it = cells.begin(); cell_it != cells.end(); cell_it++)
+	{
+		result[ (*cell_it).line() ][ (*cell_it).column() ].ref   = cell_it;
+		result[ (*cell_it).line() ][ (*cell_it).column() ].valid = true;
+	} 
+	
+	return result;
+}
+
+struct procDist
+{
+	int line;
+	int column;
+	TeBox box;
+};
+
+
+bool CalculateDistance(unsigned int line, unsigned int column, TeBox box, TeTheme* theme, double r, TeGeomRep rep, vector<vector<cellDist> >& Neighbors, list<procDist>& procList)
+{
+	if( Neighbors[line][column].done || !Neighbors[line][column].valid )
+	{
+		return false;
+	}
+
+	TeCellSet::iterator cell_it = Neighbors[line][column].ref; 
+	
+	TeQuerierParams params(true, false);
+	params.setParams (theme);
+    params.setSpatialRest(box, TeWITHIN, rep);
+
+	TeQuerier querier(params);
+
+    querier.loadInstances();
+	int quant = querier.numElemInstances();
+	TeCoord2D p1 = (*cell_it).box().center();
+
+	double dist = TeMAXFLOAT;
+
+	if(rep == TePOINTS)
+	{
+		for(int i = 0; i < quant; i++)
+		{
+		    TeSTInstance sti;
+		    querier.fetchInstance(sti);
+			TeMultiGeometry mg = sti.geometries();
+	
+			double x = TeDistance(p1, mg.getPoints()[0].location());
+			if (dist > x) dist = x;
+		}
+	}
+	if(rep == TeLINES)
+	{
+		for(int i = 0; i < quant; i++)
+		{
+		    TeSTInstance sti;
+		    querier.fetchInstance(sti);
+			TeMultiGeometry mg = sti.geometries();
+
+			TeLineSet ls = mg.getLines();
+
+    		int line_index;
+		    TeCoord2D pinter;
+			double x;
+    		TeNearest (p1, ls, line_index, pinter, x);
+            if (dist > x) dist = x;
+		}
+	}
+	if(rep == TePOLYGONS)
+	{
+		for(int i = 0; i < quant; i++)
+		{
+		    TeSTInstance sti;
+		    querier.fetchInstance(sti);
+			TeMultiGeometry mg = sti.geometries();
+			TePolygonSet ps = mg.getPolygons();
+
+		    TePolygonSet box_ps, intersect;
+		    TePolygon pol = polygonFromBox((*cell_it).box());
+		    box_ps.add(pol);
+
+		    TeOverlay(box_ps, ps, intersect, TeINTERSECTION);
+			unsigned int kk = 0;
+		    if(!intersect.empty()) { dist = 0; kk = ps.size(); }
+		   
+			for (; kk < ps.size(); kk++)
+			{
+				TePolygon p = ps[kk];
+				for (unsigned int j = 0; j < p.size(); j++)
+				{
+					TeLinearRing l = p[j];
+					for (unsigned int k = 0; k < l.size(); k++)
+					{
+						double d = 	TeDistance (p1, l[k]);
+						if (dist > d) dist = d;
+					}
+				}
+			}
+		}
+	}
+
+	Neighbors[line][column].done     = true; 
+	Neighbors[line][column].distance = dist; 
+
+	TeBox searchbox(p1.x() - dist - 1.001*r, p1.y() - dist - 1.001*r,
+                    p1.x() + dist + 1.001*r, p1.y() + dist + 1.001*r);
+
+	procDist pd;
+	pd.box = searchbox;
+	if(line > 0)                         { pd.line = line-1; pd.column = column;   procList.push_back(pd); }
+	if(column > 0)                       { pd.line = line;   pd.column = column-1; procList.push_back(pd); }
+    if(line < Neighbors.size() - 1)      { pd.line = line+1; pd.column = column;   procList.push_back(pd); }
+	if(column < Neighbors[0].size() - 1) { pd.line = line;   pd.column = column+1; procList.push_back(pd); }
+	
+	return true;
+}
+
+bool TeFillCellDistanceOperation(TeTheme* theme,
+								 TeGeomRep rep,
+								 TeLayer* cell_layer,
+								 const string& cell_tablename,
+								 const string& output_columnName,
+								 TeTimeInterval t)
+{
+	TeFillCellStepLoadingData();
+
+	TeCellSet cells;
+	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
+
+	list<procDist> procList;
+	vector<vector<cellDist> > Neighbors = BuildNeighbors(cells);
+
+	TeFillCellStepStartProcessing(cells.size()*2);
+
+	TePropertyVector result;
+	TeCellSet::iterator cell_it = cells.begin();
+
+	double res = cells.resX();
+	if( res < cells.resY () ) res = cells.resY();
+	
+	procDist pd;
+
+	pd.line   = (*cell_it).line();
+	pd.column = (*cell_it).column();
+	pd.box    = theme->getThemeBox();
+
+	procList.push_back(pd);
+	int count = 0; // counting the progress
+
+	while(!procList.empty())
+	{
+		pd = procList.front();
+		procList.pop_front();
+		if(CalculateDistance(pd.line, pd.column, pd.box, theme, res, rep, Neighbors, procList))
+			if(!TeFillCellStepNextStep(++count)) return false;
+	}
+
+	TeTable table(cell_tablename);
+	cell_layer->database()->loadTableInfo(table);
+
+	TeSTElementSet cellObjSet (cell_layer);
+	//include the attribute description
+	TeAttribute attr;
+	attr.rep_.type_ = TeREAL;
+	attr.rep_.decimals_ = 10;
+	attr.rep_.name_ = output_columnName;
+	cellObjSet.addProperty(attr);
+
+	while (cell_it != cells.end())
+	{
+	    string value_ = Te2String(Neighbors[(*cell_it).line()][(*cell_it).column()].distance);
+		vector<string> attrValues;
+		attrValues.push_back(value_);
+	    
+		TeFillCellInitSTO ((*cell_it), attrValues, cellObjSet, table.tableType(), t);
+		cell_it++;
+
+		if(!TeFillCellStepNextStep(++count)) return false;
+	}
+	
+	TeFillCellStepWriting();
+
+	if (!TeUpdateDBFromSet(&cellObjSet, cell_tablename))
+			return  false;
+
+	return true;
+}
+
+#include <sstream>
+
+bool TeFillCellSpatialOperation(TeDatabase* db,
+								TeComputeSpatialStrategy* operation,
+								const string& cell_layername,
+								const string& cell_tablename,
+								const string& output_columnName,
+								TeTimeInterval t)
+{
+	if (!db) return false;
+
+	TeFillCellStepLoadingData();
+
+	// Load input layer
+	TeLayer* cell_layer = new TeLayer (cell_layername);
+	if (!db->loadLayer (cell_layer))
+	{
+		 db->close();
+		 return false;
+	}
+
+	TeTable table(cell_tablename);
+	db->loadTableInfo(table);
+
+	TeCellSet cells;
+	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
+
+	TeSTElementSet cellObjSet (cell_layer);
+	//adds the new attribute description 
+	TeAttribute attr;
+	attr.rep_.type_ = TeREAL;
+	attr.rep_.decimals_ = 10;
+	attr.rep_.name_ = output_columnName;
+
+	cellObjSet.addProperty(attr);
+
+	TeFillCellStepStartProcessing(cells.size());
+	TeCellSet::iterator cell_it = cells.begin();
+
+	int count = 0;
+	while (cell_it != cells.end())
+	{
+	    string value_ = operation->compute ((*cell_it).box());
+	    vector<string> attrValues;
+		attrValues.push_back (value_);
+	   
+		TeFillCellInitSTO ((*cell_it), attrValues, cellObjSet, table.tableType(), t);
+		cell_it++;
+
+		if(!TeFillCellStepNextStep(++count)) return false;
+	} 
+
+	TeFillCellStepWriting();
+	bool result = TeUpdateDBFromSet(&cellObjSet, cell_tablename);
+	cell_layer->loadLayerTables();
+
+	return result;
+}
+
+
+bool TeFillCellCategoryCountPercentageRasterOperation(TeDatabase* db,
+													  string raster_layername,
+													  string cell_layername,
+													  const string& cell_tablename,
+													  const string attrName,
+													  TeTimeInterval t)
+{
+	TeFillCellStepLoadingData();
+
+	map<string, string> classesMap;
+	vector< string > atts;
+	string value;
+
+	TeLayer* input_layer = new TeLayer (raster_layername);
+	if (!db->loadLayer (input_layer))
+	{
+		 db->close();
+		 return false;
+	}
+
+	atts.push_back(attrName);
+
+	vector<double> values;
+	bool found;
+	unsigned int i;
+	TeRaster* raster = input_layer->raster();
+	TeRaster::iterator rasterItBegin = raster->begin();
+	TeRaster::iterator rasterItEnd   = raster->end();
+
+	TeTable table(cell_tablename);
+	db->loadTableInfo(table);
+
+	TeLayer* cell_layer = new TeLayer (cell_layername);
+	if (!db->loadLayer (cell_layer))
+	{
+		 db->close();
+		 return false;
+	}
+
+	// Initialize cell set
+	TeCellSet cells;
+	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
+
+	// Initialize object set to store cell properties
+	TeSTElementSet cellObjSet (cell_layer);
+
+	// looking for the unique values in all the raster
+	TeFillCellStepStartProcessing(raster->params().nlines_ * raster->params().ncols_ + cells.size());
+
+	int count = 0;
+	while(rasterItBegin != rasterItEnd)
+	{
+		found = false;
+		for(i = 0; i < values.size(); ++i)
+			if(values[i] == (*rasterItBegin)[0])
+				found = true;
+		if(!found) 
+			values.push_back((*rasterItBegin)[0]);
+		++rasterItBegin;
+
+		if(!TeFillCellStepNextStep(++count)) return false;
+	}
+
+	// Process
+	TePropertyVector result;
+	map<double, int> counter;
+
+	// set the propertyvector of the cell object set
+	for(i = 0; i < values.size(); i++)
+	{
+		stringstream str;
+
+		str << values[i];
+        string value_ =  str.str();
+        for (unsigned j = 0; j < value_.size(); j++)
+            if(value_[j] == '.' || value_[j] == '+')
+                value_[j] = '_';
+
+        TeProperty prop;
+        prop.attr_.rep_.name_ = attrName + value_;
+        prop.attr_.rep_.type_ = TeREAL;
+        prop.attr_.rep_.numChar_ = 48;
+		prop.attr_.rep_.decimals_ = 10;
+
+        cellObjSet.addProperty(prop.attr_);
+	}
+
+	TeCellSet::iterator cell_it = cells.begin();
+	vector<string> vprop;
+
+	while (cell_it != cells.end())
+	{
+		double total = 0.0;
+		TePolygon p = polygonFromBox((*cell_it).box());
+		TeRaster::iteratorPoly rasterItBegin(raster);
+		rasterItBegin = raster->begin(p, TeBBoxPixelInters, 0);
+		TeRaster::iteratorPoly rasterItEnd(raster);
+		rasterItEnd = raster->end(p, TeBBoxPixelInters, 0);
+
+		for(i = 0; i < values.size(); i++)
+			counter[values[i]] = 0;
+
+		while(rasterItBegin != rasterItEnd)
+		{
+			double pixel = (*rasterItBegin);
+			counter[pixel]++;
+			++rasterItBegin;
+			total++;
+		}		
+
+		//add the attribute values in the object set
+		vprop.clear();
+		for(i = 0; i < values.size(); i++)
+		{
+			stringstream str;
+			if (total > 0)
+				str << counter[values[i]] / total;
+			else
+				str << "0.0";
+
+			vprop.push_back(str.str());
+		}
+
+		TeFillCellInitSTO ((*cell_it), vprop, cellObjSet, table.tableType(), t);
+		cell_it++;
+
+		if(!TeFillCellStepNextStep(++count)) return false;
+	} 
+
+	TeFillCellStepWriting();
+	// Update DB
+	if (!TeUpdateDBFromSet (&cellObjSet, cell_tablename))
+		return  false;
+	return  true;
+}
+
+
+bool TeFillCellCategoryAreaPercentageOperation(TeTheme* theme,
+											   const string attrName,
+								 			   TeLayer* cell_layer,
+											   const string& cell_tablename,
+											   TeTimeInterval t)
+{
+	map<string, string> classesMap;
+	vector< string > atts;
+	TeQuerier* querier;
+	TeSTInstance sti;
+
+	atts.push_back(attrName);
+
+ 	TeQuerierParams params (false, atts);
+	params.setParams (theme);
+
+	querier = new TeQuerier(params);
+
+	querier->loadInstances();
+
+	while( querier->fetchInstance(sti) )
+	{
+		std::string value = sti.getPropertyVector()[0].value_;
+
+		std::string replaceChars = TeReplaceSpecialChars(value);
+
+		std::string removeChars = TeRemoveSpecialChars(replaceChars);
+
+		classesMap[sti.getPropertyVector()[0].value_] = removeChars;
+
+	}
+	delete querier;
+
+	return TeFillCellCategoryAreaPercentageOperation(theme, attrName, cell_layer, cell_tablename, classesMap, t);
+}
+
+
+bool TeFillCellCategoryAreaPercentageOperation(TeTheme* theme,
+											   const string attrName,
+								 			   TeLayer* cell_layer,
+											   const string& cell_tablename,
+											   map<string, string>& classesMap,
+											   TeTimeInterval t)
+{
+	TeFillCellStepLoadingData();
+
+	TeCellSet cells;
+	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
+
+	TeSTElementSet cellObjSet (cell_layer);
+
+	TeTable table(cell_tablename);
+	cell_layer->database()->loadTableInfo(table);
+
+	TeCellSet::iterator cell_it = cells.begin();
+
+	TeFillCellStepStartProcessing(cells.size());
+	int count = 0;
+	while (cell_it != cells.end())
+	{
+	    TeProperty  prop;
+
+		// COMPUTE
+    // convert input box to a polygonset
+	    TePolygonSet box_ps;
+	    TePolygon pol = polygonFromBox((*cell_it).box());
+	    box_ps.add(pol);
+	    map<string, double>  areaMap;
+	    double partial_area = 0.0;
+
+	    // Build stoset
+	    TeSTElementSet stos (theme);
+	    vector<string> attrNames;
+	    attrNames.push_back (attrName); 
+	    if (TeSTOSetBuildDB (&stos, true, false, attrNames))
+        {   
+        
+            // initialize areMap
+            map<string, string>::iterator itMap = classesMap.begin();
+            while (itMap != classesMap.end())
+            {
+                areaMap[(*itMap).second] = 0;
+                ++itMap;
+            }
+            partial_area = 0.0;
+            // iterate over all objects that intercept the box
+            TeSTElementSet::iterator it = stos.begin();
+            while (it != stos.end())
+            {
+                string category;
+                if ((*it).getPropertyValue (attrName, category))
+                {   
+                    TePolygonSet objGeom;  
+                    if ((*it).getGeometry(objGeom))
+                    {
+                        TePolygonSet intersect;
+                        TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
+                        double intersectArea = TeGeometryArea (intersect);
+                        partial_area += intersectArea;
+                        areaMap[classesMap[category]] +=  intersectArea; // suppose objects are disjoint
+                    }
+                }
+                ++it;
+            }
+        }
+
+	    double areaTot = TeGeometryArea (box_ps);
+	    double perc_total = 0.0;
+	    double corrected_perc_total = 0.0;
+	    vector<double> vec_percent;
+
+		map <string, double>:: iterator areaIt = areaMap.begin();
+	    while(areaIt != areaMap.end())  
+	    {
+	        double percent = 0.0;
+	        if (areaTot != 0) percent = (*areaIt).second/areaTot;
+	        perc_total += percent;
+	        vec_percent.push_back (percent);
+			
+			//attribute list
+			TeAttribute at;
+			at.rep_.name_ = attrName + (*areaIt).first;
+			at.rep_.type_ = TeREAL;
+			at.rep_.decimals_ = 10;
+			cellObjSet.addProperty(at);
+	        ++areaIt;
+	    }
+
+		//fill the object set
+		int i= 0;
+	    areaIt = areaMap.begin();
+
+		vector<string> values;
+
+	    while(areaIt != areaMap.end())  
+	    {
+	        
+			double percent = vec_percent[i];
+	        corrected_perc_total += percent;
+	        values.push_back(Te2String (percent));
+	        ++areaIt;
+	        i++;
+	    }
+
+		TeFillCellInitSTO ((*cell_it), values, cellObjSet, table.tableType(), t);
+
+		cell_it++;
+		if(!TeFillCellStepNextStep(++count)) return false;
+	} 
+
+	TeFillCellStepWriting();
+	bool result = TeUpdateDBFromSet(&cellObjSet, cell_tablename);
+	cell_layer->loadLayerTables();
+
+	return result;
+}
+
+bool TeFillCellNonSpatialOperation (TeTheme* theme,
+									TeGeomRep rep,
+									const string& input_attrname,
+									TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
+									TeLayer* cell_layer,
+									const string& cell_tablename, 
+									const string& output_columnName,
+									TeTimeInterval t)
+{
+	TeFillCellStepLoadingData();
+
+	if (!theme)      return false;
+	if (!cell_layer) return false;
+	if (!operation)  return false;
+
+	string s = theme->name();
+	// Initialize cell set
+	TeCellSet cells;
+	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
+
+	TeTable table(cell_tablename);
+	cell_layer->database()->loadTableInfo(table);
+
+	// Initialize object set to store cell properties
+	TeSTElementSet cellObjSet (cell_layer);
+
+	// Process
+	TePropertyVector result;
+	TeCellSet::iterator cell_it = cells.begin();
+	bool firstIteration = true;
+	vector<string> attrNames;
+	attrNames.push_back (input_attrname);	
+	
+	TeSTElementSet stos (theme);
+	if (!TeSTOSetBuildDB (&stos, true, false, attrNames))
+		return false;
+    
+	TeFillCellStepStartProcessing(cells.size());
+	int count = 0;	
+	while (cell_it != cells.end())
+	{
+		vector<TeSTInstance*> boxResult;
+		stos.search((*cell_it).box(), boxResult);
+
+		TeSTElementSet elemSetTemp(theme, stos.getAttributeList());
+		for(unsigned int i=0; i<boxResult.size(); ++i)
+		{
+            bool intersects = true;
+			if(rep==TePOLYGONS) 
+			{
+				intersects = false;
+				TePolygonSet	pSet;
+				boxResult[i]->getGeometry(pSet);
+				for(unsigned int j=0; j<pSet.size(); ++j)
+				{
+					if(TeIntersects(pSet[j],TeMakePolygon((*cell_it).box())))
+					{
+						intersects = true;
+						j = pSet.size();
+					}
+				}
+			}
+			else if(rep==TeLINES) 
+			{
+				intersects = false;
+				TeLineSet		lSet;
+				boxResult[i]->getGeometry(lSet);
+				for(unsigned int j=0; j<lSet.size(); ++j)
+				{
+					if(TeIntersects(lSet[j],TeMakePolygon((*cell_it).box())))
+					{
+						intersects = true;
+						j = lSet.size();
+					}
+				}
+			}
+						
+			if(intersects)
+				elemSetTemp.insertSTInstance(*(boxResult[i]));
+		}
+		
+		result = operation->compute (elemSetTemp.begin(0), elemSetTemp.end(0), output_columnName);
+		
+		// if property not found, stos iterator will return zero to operation. 
+		// To check this, have to be less general and use getProperty inside the compute method.		
+		if(firstIteration)
+		{
+			//add the attribute definitions in the object set, only once
+			TePropertyVector::iterator it = result.begin();
+			while(it!=result.end())
+			{
+                cellObjSet.addProperty(it->attr_);
+				++it;
+			}
+		}
+
+		//add the attribute values in the object set
+		TePropertyVector::iterator it = result.begin();
+		vector<string> values;
+		while(it!=result.end())
+		{
+			values.push_back(it->value_);
+			++it;
+		}
+
+		TeFillCellInitSTO ((*cell_it), values, cellObjSet, table.tableType(), t);
+		cell_it++;
+		firstIteration = false;
+
+		if(!TeFillCellStepNextStep(++count)) return false;
+	} 
+
+	TeFillCellStepWriting();
+	// Update DB
+	if (!TeUpdateDBFromSet (&cellObjSet, cell_tablename))
+		return  false;
+	return  true;
+}
+
+bool TeFillCellNonSpatialOperation (TeDatabase* db,
+										const string& input_layername, 
+										TeGeomRep rep,
+										const string& input_tablename, 
+										const string& input_attrname,
+										TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
+										const string& cell_layername, 
+										const string& cell_tablename, 
+										const string& output_columnName,
+										TeTimeInterval t)
+{
+	if (!db) return false;
+
+	// Load input layers
+	TeLayer* input_layer = new TeLayer (input_layername);
+	if (!db->loadLayer (input_layer))
+	{
+		 db->close();
+		 return false;
+	}
+
+	// Load output cells layer with geometry previously created
+	TeLayer* cell_layer = new TeLayer (cell_layername);
+	if (!db->loadLayer (cell_layer))
+	{
+		 db->close();
+		 return false;
+	}
+
+	// Initialize theme
+	TeTheme* theme = new TeTheme ("", input_layer);
+	vector<string> attrTableNames;
+	attrTableNames.push_back (input_tablename);
+	TeAttrTableVector atts;
+	if (!input_layer->getAttrTablesByName(attrTableNames, atts)) return false;
+	theme->setAttTables (atts);
+
+	bool ret = TeFillCellNonSpatialOperation (theme,
+											  rep,
+											  input_attrname,
+											  operation,
+											  cell_layer,
+											  cell_tablename, 
+											  output_columnName,
+											  t);
+
+	return ret;
+}
+
+
+bool TeFillCellNonSpatialRasterOperation (TeDatabase* db,
+										  const string& input_raster_layername, 
+										  TeComputeAttrStrategy<TeBoxRasterIterator>* operation,
+										  const string& cell_layername, 
+										  const string& cell_tablename, 
+										  const string& output_columnName,
+										  TeTimeInterval t)
+{
+	TeFillCellStepLoadingData();
+
+	if (!db) return false;
+
+	// Load input layers
+	TeLayer* input_layer = new TeLayer (input_raster_layername);
+	if (!db->loadLayer (input_layer))
+	{
+		 db->close();
+		 return false;
+	}
+
+	TeTable table(cell_tablename);
+	db->loadTableInfo(table);
+
+	TeRaster* raster = input_layer->raster();
+	if (!raster) return false;
+
+	// Load output cells layer with geometry previously created
+	TeLayer* cell_layer = new TeLayer (cell_layername);
+	if (!db->loadLayer (cell_layer))
+	{
+		 db->close();
+		 return false;
+	}
+
+	// Initialize cell set
+	TeCellSet cells;
+	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
+
+	// Initialize object set to store cell properties
+	TeSTElementSet cellObjSet (cell_layer);
+	//include the attribute description
+	TeAttribute attr;
+	attr.rep_.type_ = TeREAL;
+	attr.rep_.name_ = output_columnName;
+	attr.rep_.decimals_ = 10;
+	cellObjSet.addProperty(attr);
+
+	TeFillCellStepStartProcessing(cells.size());
+
+	// Process
+	TePropertyVector result;
+	TeCellSet::iterator cell_it = cells.begin();
+
+	int count = 0;
+	while (cell_it != cells.end())
+	{
+		TeBoxRasterIterator rasterItBegin(raster, (*cell_it).box());
+		rasterItBegin.begin();
+		TeBoxRasterIterator rasterItEnd(raster, (*cell_it).box());
+		rasterItEnd.end();
+		result = operation->compute (rasterItBegin, rasterItEnd, output_columnName);										
+		TeFillCellInitSTO ((*cell_it), result, cellObjSet, table.tableType(), t);
+		cell_it++;
+
+		if(!TeFillCellStepNextStep(++count)) return false;
+	} 
+
+	TeFillCellStepWriting();
+	// Update DB
+	if (!TeUpdateDBFromSet (&cellObjSet, cell_tablename))
+		return  false;
+	return  true;
+}
+
+
+bool TeFillCellAggregateOperation ( TeDatabase* db,
+									const string& input_layername, 
+									const string& input_tablename, 
+									TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
+									vector<string>& attrNames,
+									const string& cell_layername, 
+									const string& cell_tablename, 
+									TeTimeInterval t)
+{
+	if (!db) return false;
+
+	// Load input layers
+	TeLayer* input_layer = new TeLayer (input_layername);
+	if (!db->loadLayer (input_layer))
+	{
+		 db->close();
+		 return false;
+	}
+
+	// Load output cells layer with geometry previously created
+	TeLayer* cell_layer = new TeLayer (cell_layername);
+
+	if (!db->loadLayer (cell_layer))
+	{
+		 db->close();
+		 return false;
+	}
+
+	// Initialize cell set
+	TeCellSet cells;
+	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
+
+	// Initialize object set to store cell properties
+	TeSTElementSet cellObjSet (cell_layer);
+
+	// Initialize theme
+	TeTheme* theme = new TeTheme ("", input_layer);
+	vector<string> attrTableNames;
+	attrTableNames.push_back (input_tablename);
+	TeAttrTableVector atts;
+	if (!input_layer->getAttrTablesByName(attrTableNames, atts)) return false;
+	theme->setAttTables (atts);
+
+
+	// Process
+	TeCellSet::iterator cell_it = cells.begin();
+	while (cell_it != cells.end())
+	{
+		TeSTInstance cellObj;
+		cellObj.objectId ((*cell_it).objectId());
+		string uniqueId = (*cell_it).objectId();
+		cellObj.addUniqueId (uniqueId); 
+		uniqueId += t.getInitialDate() + t.getInitialTime();
+		uniqueId += t.getFinalDate() + t.getFinalTime() ;
+		cellObj.addUniqueId (uniqueId);
+		cellObj.timeInterval (t);
+		
+		// Set restrictions on a theme and create stoset
+		theme->setSpatialRest((*cell_it).box(), TeCELLS); //????? TeWITHIN 	
+		TeSTElementSet stos (theme);
+		TeSTOSetBuildDB (&stos, true, false, attrNames);
+			
+		// Create stoset based on input layer
+		TePropertyVector result;
+		vector<string>::iterator attIt = attrNames.begin();
+		while (attIt != attrNames.end())
+		{
+			result = operation->compute (stos.begin(*attIt), stos.end(*attIt), (*attIt));
+            // if property not found, stos iterator will return zero to operation. 
+            // To check this, have to be less general and use getProperty inside the compute method.		
+			TePropertyVector::iterator itProp = result.begin();
+			while (itProp != result.end())
+			{
+				cellObj.addProperty (*itProp);
+				itProp++;
+			}
+			attIt++;
+		}
+		cellObjSet.insertSTInstance (cellObj);
+
+		cell_it++;
+	}
+
+	// Update DB
+	if (!TeUpdateDBFromSet (&cellObjSet, cell_tablename)) return  false;
+
+	return  true;
+}
+
+
+bool TeFillCellConnectionOperation (	TeDatabase* db,
+										TeSTElementSet objects,
+										TeGeomRep rep,
+										TeGraphNetwork* net,
+										const string& /*input_attrName*/,
+
+										TeTimeInterval t,
+										const string& cell_layername, 
+										const string& cell_tablename, 
+										const string& /*output_columnName*/,
+										
+								
+										TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
+										double /*local_distance_factor*/,
+										double /*net_distance_factor*/,
+										double /*net_conn_factor*/,
+										double /*mult_factor*/)
+{
+
+	if (!operation) return false;
+	if (!net) return false;
+	if (!db) return false;
+
+	// Load output cells layer with geometry previously created
+
+	TeLayer* cell_layer = new TeLayer (cell_layername);
+
+	if (!db->loadLayer (cell_layer))
+	{
+		 db->close();
+		 return false;
+	}
+
+	TeTable table(cell_tablename);
+	db->loadTableInfo(table);
+
+	// Initialize cell set
+	TeCellSet cells;
+	if (!TeFillCellInitLoad (cell_layer, cell_tablename, cells)) return false;
+
+	// Initialize object set to store cell properties
+	TeSTElementSet cellObjSet (cell_layer);
+
+	// Process
+	TePropertyVector result;
+	TeCellSet::iterator cell_it = cells.begin();
+	while (cell_it != cells.end())
+	{
+		TeSTInstance cellObj;
+		cellObj.objectId ((*cell_it).objectId());
+		string uniqueId = (*cell_it).objectId();
+		cellObj.addUniqueId (uniqueId);
+		uniqueId += t.getInitialDate() + t.getInitialTime();
+		uniqueId += t.getFinalDate() + t.getFinalTime() ;
+		cellObj.addUniqueId (uniqueId);
+		cellObj.timeInterval (t);	
+		cellObjSet.insertSTInstance (cellObj);
+		cell_it++;
+	} 
+
+	TeProxMatrixOpenNetworkStrategy2    sc_net (&cellObjSet, TeCELLS, &objects, rep, 0, TeMAXFLOAT, TeMAXFLOAT, net);
+ //	TeProxMatrixConnectionStrenghtStrategy sw(4, 0.0, false);
+
+/* TODO: recolocar!!!
+	TeProxMatrixInverseDistanceStrategy sw (local_distance_factor, net_distance_factor, net_conn_factor, mult_factor, false);
+	TeProxMatrixNoSlicingStrategy ss_no;
+	TeGeneralizedProxMatrix<TeSTElementSet> mat (&sc_net, &sw, &ss_no);
+
+	// initialize object set to store cell properties
+	TeSTElementSet cellObjSet2 (cell_layer);
+	TeCellSet::iterator cell_it2 = cells.begin();
+	while (cell_it2 != cells.end())
+	{
+		TeSTElementSet neigh = mat.getSTENeighbours((*cell_it2).objectId());	
+
+		result = operation->compute (neigh.begin(input_attrName), neigh.end(input_attrName), output_columnName); 	// if property not found, stos iterator will return zero to operation. To check this, have to be less general and use getProperty inside the compute method.		
+		TeFillCellInitSTO ((*cell_it), propvec, cellObjSet2, table.tableType(), t);
+		cell_it2++;
+	} 
+
+
+// Update DB
+	if (!TeUpdateDBFromSet (&cellObjSet2, cell_tablename))
+			return  false;
+*/
+	return  true;
+}
+
+
diff --git a/src/terralib/functions/TeCellAlgorithms.h b/src/terralib/functions/TeCellAlgorithms.h
old mode 100755
new mode 100644
index 652fa5b..328e758
--- a/src/terralib/functions/TeCellAlgorithms.h
+++ b/src/terralib/functions/TeCellAlgorithms.h
@@ -1,374 +1,376 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeCellAlgorithms.h
-    This file contains algorithms and operations to deal with on cell geometry
-*/
-
-#ifndef  __TERRALIB_INTERNAL_CELLALGORITHMS_H
-#define  __TERRALIB_INTERNAL_CELLALGORITHMS_H
-
-#include "TeSTElementSet.h"
-#include "TeComputeAttributeStrategies.h"
-#include <TeRaster.h>
-
-class TeDatabase; 
-class TeDatabasePortal;
-class TeLayer;
-class TeGraphNetwork;
-class TeTable;
-
-using namespace std;
-
-//! This class represents a raster iterator using a box as spatial restriction
-class TeBoxRasterIterator
-{
-	public:
-		//! Constructor
-		TeBoxRasterIterator(TeRaster* raster_, TeBox box); 
-
-	    //! Prefix move forward operator
-	    TeBoxRasterIterator& operator++();
-
-	    //! Prefix move forward operator
-	    TeBoxRasterIterator operator++(int);
-
-	    //! Dereferencing operator
-	    double operator*();
-
-		//! Equal operator
-        bool operator==(const TeBoxRasterIterator& rhs) const;
-
-		//! Differ operator
-        bool operator!=(const TeBoxRasterIterator& rhs) const; 
-
-		//! getProperty
-		bool getProperty(TeProperty& prop);
-        
-		//! Returns an iterator that points to the first position of the raster inside the box
-		TeBoxRasterIterator begin(); 
-		
-		//! Returns an iterator that points to the last position of the raster inside the box
-		TeBoxRasterIterator end();
-
-	private:
-		int xo, yo, xf, yf, x, y;
-		bool end_;
-		TeRaster* raster;
-};
-
-/** @defgroup CellSpaces Cell Spaces 
-  @{
- */
-
-/** @defgroup CreateCells Cells generation
-    @ingroup CellSpaces
-  @{
- */
-//! Creates a new layer with the cells that covers the polygons of a theme  
-/*	\param layerName	name of the new layer with cell representations
-	\param theme		pointer to the theme that has the polygons
-	\param resX			X resolution of each cell
-	\param resY			Y resolution of each cell
-	\param box			bounding box of interest
-	\return a pointer to the new layer created if success or null if fail
-*/
-TeLayer* TeCreateCells(const string& layerName,TeTheme* theme, double resX, double resY, TeBox& box);
-
-//! Creates a new layer with the cells that covers the entire bounding box, or the polygons  of a layer 
-/*	\param layerName	name of the new layer with cell representations
-	\param layerBase	pointer to the base layer
-	\param resX			X resolution of each cell
-	\param resY			Y resolution of each cell
-	\param mask			flag that indicates if the cells should be created only over the polygons of the layer
-	\param box			bounding box of interest
-	\return a pointer to the new layer created if success or null if fail
-*/
-TeLayer* TeCreateCells( const string& layerName, TeLayer* layerBase, 
-			   double resX, double resY, TeBox& box, bool mask = true);
-
-/** @} */ 
-
-/** @defgroup CellStatistics Cells statistics 
-    @ingroup CellSpaces
-  @{
- */
-//! Calculates a set of statistics of cells of a theme 
-/*	\param themeOut			cell theme 
-	\param newAttrTable		new attribute table where the generated statistics will be kept 
-	\param stat				the structure that contains the statistics which will be generated 
-	\param themeIn			point or cell theme
-	\param db				a pointer to the database
-	\return true if the operation was successfully done  
-*/
-bool 
-TeCellStatistics(TeTheme* themeOut, TeTable& newAttrTable, TeGroupingAttr& stat, 
-				 TeTheme* themeIn, TeDatabase* db);
-
-//! Saves the statistics accessible through a TeDatabasePortal in a database table 
-/*	\param tableAttrCell	attribute table name where the generated statistics will be kept 
-	\param portal			a pointer to the database portal that contains the generated statistics  
-	\return true if the operation was successfully done  
-*/
-bool TeKeepStatistics(TeTable& tableAttrCell, TeDatabasePortal* portal);
-
-/** @} */ 
-
-/** @defgroup FillCellAlg Cells attributes generation
-    @ingroup CellSpaces
-	Fill one attribute (or group of related attributes) for all cells in the output layer 
-	based on a single input layer attribute for a given time interval. Specific operation to be applied is a parameter (Strategy pattern).
-  @{
- */
-
-//! Calculates an attribute based on the exact Euclidean distance. This strategy is separated from the others because it 
-//! calculates the distance using an already calculated distance of one of its neighbours.
-/*	\param input_theme				a pointer to the input theme to calculate the distances
-	\param rep						input theme representation to be used
-	\param cell_layer				a pointer to the output cell layer  
-	\param cell_tablename			output cell attribute dynamic table; if does not exist, the table will be created by the function  
-	\param output_columnname		output attribute name   
-	\param time_interval			time interval of output cells attributes
-	\return true if the operation was successfully done  
-*/
-bool TeFillCellDistanceOperation(TeTheme* input_theme,
-								 TeGeomRep rep,
-								 TeLayer* cell_layer,
-								 const string& cell_tablename,
-								 const string& output_columnname,
-								 TeTimeInterval time_interval = TeTimeInterval());
-
-//! suppose that each cell is completely filled by the used geometry, and there is no overlapping geometries. Creates one attribute 
-//! for each unique value, and this values are used in the name of the created attributes, in the form attrName concatenated 
-//! with the value
-/*	\param input_theme				a pointer to the input theme to calculate the distances
-	\param rep						input theme representation to be used
-	\param cell_layer				a pointer to the output cell layer  
-	\param cell_tablename			output cell attribute table; if does not exist, the table will be created by the function  
-	\param output_columnName		output attribute name   
-	\param time_interval			time interval of output cells attributes
-	\return true if the operation was successfully done  
-*/
-
-bool TeFillCellCategoryCountPercentageRasterOperation(TeDatabase* database,
-													  string raster_layername,
-													  string cell_layername,
-													  const string& cell_tablename,
-													  const string attrName,
-													  TeTimeInterval t);
-
-
-
-bool TeFillCellCategoryAreaPercentageOperation(TeTheme* theme,
-											   const string attrName,
-								 			   TeLayer* cell_layer,
-											   const string& cell_tablename,
-											   TeTimeInterval t = TeTimeInterval());
-
-
-bool TeFillCellCategoryAreaPercentageOperation(TeTheme* input_theme,
-											   const string attr_name,
-								 			   TeLayer* cell_layer,
-											   const string& cell_tablename,
-											   map<string, string>& classesMap,
-											   TeTimeInterval time_interval = TeTimeInterval());
-
-//! Computes an attribute based on a TeComputeSpatialStrategy 
-/*	\param db						the database which contains the layer of cells
-	\patam operation				the operation used to compute the attribute
-	\param cell_layername			the name of the layer of cells
-	\param cell_tablename			output cell attribute table; if does not exist, the table will be created by the function  
-	\param output_columnname		output attribute name
-	\param time_interval			time interval of output cells attributes
-	\return true if the operation was successfully done  
-*/
-bool TeFillCellSpatialOperation(TeDatabase* db,
-                        		TeComputeSpatialStrategy* operation,
-								const string& cell_layername,
-                        		const string& cell_tablename,
-                        		const string& output_columnname,
-								TeTimeInterval time_interval = TeTimeInterval());
-
-//! Computes the cell attribute based on a non-spatial operation (TeComputeAttrStrategy) over a vector or cell input layer.
-/*	\param db						a pointer to the database in which input and output layers are stored
-	\param input_layername			name of input layer 
-	\param rep						input layer representation to be used
-	\param input_tablename			input layer attribute table to be used  
-	\param input_attrname			input layer attribute to be used to compute output attribute
-	\param operation				operation to be applied (see TeComputeAttrStrategy hierarchy)  
-	\param cell_layername			output cell layer  
-	\param cell_tablename			output cell attribute dynamic table; if does not exist, the table will be created by the function  
-	\param output_columnName		output attribute name   
-	\param time_interval			time interval of output cells attributes
-	\return true if the operation was successfully done  
-*/
-bool TeFillCellNonSpatialOperation(TeDatabase* db,
-									const string& input_layername, 
-									TeGeomRep rep,
-									const string& input_tablename, 
-									const string& input_attrname,
-									TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
-									const string& cell_layername, 
-									const string& cell_tablename, 
-									const string& output_columnName,
-									TeTimeInterval time_interval = TeTimeInterval());
-
-//! Computes the cell attribute based on a non-spatial operation (TeComputeAttrStrategy) over a vector or cell input layer.
-/*	\param theme					a pointer to an input theme
-	\param rep						input theme representation to be used
-	\param input_tablename			input theme attribute table to be used  
-	\param input_attrname			input theme attribute to be used to compute output attribute
-	\param operation				operation to be applied (see TeComputeAttrStrategy hierarchy)  
-	\param cell_layername			output cell layer  
-	\param cell_tablename			output cell attribute dynamic table; if does not exist, the table will be created by the function  
-	\param output_columnName		output attribute name   
-	\param time_interval			time interval of output cells attributes
-	\return true if the operation was successfully done  
-*/
-bool TeFillCellNonSpatialOperation (TeTheme* theme,
-									TeGeomRep rep,
-									const string& input_attrname,
-									TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
-									TeLayer* cell_layer,
-									const string& cell_tablename, 
-									const string& output_columnName,
-									TeTimeInterval time_interval = TeTimeInterval());
-
-//! Computes the cell attribute based on a non-spatial operation (TeComputeSpatialStrategy) over a raster input layer.
-/*	\param db						a pointer to the database in which input and output layers are stored
-	\param input_raster_layername	name of input layer that contains a raster representation 
-	\param operation				operation to be applied (see TeComputeAttrStrategy hierarchy)  
-	\param cell_layername			output cell layer  
-	\param cell_tablename			output cell attribute dynamic table; if does not exist, the table will be created by the function  
-	\param output_columnName		output attribute name   
-	\param time_interval			time interval of output cells attributes
-	\return true if the operation was successfully done  
-*/
-bool TeFillCellNonSpatialRasterOperation(TeDatabase* db,
-										const string& input_raster_layername, 
-										TeComputeAttrStrategy<TeBoxRasterIterator>* operation,
-										const string& cell_layername, 
-										const string& cell_tablename, 
-										const string& output_columnName,
-										TeTimeInterval time_interval = TeTimeInterval());
-
-//! Computes the cell attribute based on a non-spatial operation (TeComputeSpatialStrategy) over a certain attribute of a set of objects connected to each cell by a network.
-//! This function will change in the next version of TerraLib
-/*  \param db                       a pointer to the database in which input and output layers are stored
-    \param objects                  set of objects (e.g., ports) 
-    \param rep                      objects representation type
-    \param net                      netork to be used to verify and quantify cell connectivity to each cell
-    \param input_attrname           connected objects attribute to be used to compute output attribute
-    \param t                        time interval of output cells attributes
-    \param cell_layername           output cell layer  
-    \param cell_tablename           output cell attribute dynamic table; if does not exist, the table will be created by the function  
-    \param output_columnName        output attribute name   
-    \param operation                operation to be applied (see TeComputeAttrStrategy hierarchy)  
-    \param local_distance_factor    multiplier used to compute connection strenght weights: local distance factor (see GPM documentation) 
-    \param net_distance_factor      multiplier used to compute connection strenght weights: distance to network factor (see GPM documentation) 
-    \param net_conn_factor          multiplier used to compute connection strenght weights: connection through network factor (see GPM documentation) 
-    \param mult_factor              multiplier used to compute connection strenght weights: weight multiplier factor (see GPM documentation) 
-*/
-bool TeFillCellConnectionOperation (TeDatabase* db,
-                                    TeSTElementSet objects,
-                                    TeGeomRep rep,
-                                    TeGraphNetwork* net,
-                                    const string& /*input_attrName*/,
-                                    TeTimeInterval t,
-                                    const string& cell_layername,
-                                    const string& cell_tablename,
-                                    const string& /*output_columnName*/,
-                                    TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
-                                    double /*local_distance_factor = 0.0*/,
-                                    double /*net_distance_factor = 0.25*/,
-                                    double /*net_conn_factor = 1.0*/,
-                                    double /*mult_factor = 1000000.0*/);
-
-
-
-//! Computes a set of attributes for the output cell layer based on a non-spatial operation (TeComputeAttrSpatialStrategy) over an input cell layer.
-/*	\param db						a pointer to the database in which input and output layers are stored
-	\param input_layername			name of input cell layer 
-	\param input_tablename			input layer attribute table to be used  
-	\param operation				operation to be applied (see TeComputeAttrStrategy hierarchy)  
-	\param attrNames				names of input/output attribute names to be aggregated   
-	\param cell_layername			output cell layer  
-	\param cell_tablename			output cell attribute dynamic table; if does not exist, the table will be created by the function  
-	\param time_interval			time interval of output cells attributes
-	\return true if the operation was successfully done  
-*/
-bool TeFillCellAggregateOperation(TeDatabase* db,
-									const string& input_layername, 
-									const string& input_tablename, 
-									TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
-									vector<string>& attrNames,
-									const string& cell_layername, 
-									const string& cell_tablename, 
-									TeTimeInterval time_interval = TeTimeInterval());
-/** @} */ 
-
-/** @defgroup FillCellAux Fill cells auxiliary functions
-    @ingroup FillCellAlg
-*  @{
-*/
-//! Load cells geometries and verify/create dynamic attribute table if does not exists
-/*	\param cell_layer		a pointer to a layer of cells
-	\param cell_tablename	the name of the table in the layer of cells
-	\param cells			the object to be filled
-	\return if the function was successfully executed
-*/
-bool TeFillCellInitLoad (TeLayer* cell_layer, const string& cell_tablename, TeCellSet& cells);
-
-
-//! Fills the cell object set for a temporal table 
-/*	\param cell			the cell which owns the attribute(s)
-	\param result		the result of an operation to be used to fill the set
-	\param cellObjSet	the set to be filled
-	\param atttype		the type of the table to be filled
-	\patam t			the time interval of the attribute(s)
-	\return if the function was successfully executed
-*/
-void TeFillCellInitSTO (const TeCell& cell, TePropertyVector& result, TeSTElementSet& cellObjSet, TeAttrTableType atttype, TeTimeInterval& t);
-
-
-//! Fills the cell object set for a temporal table 
-/*	\param cell			the cell which owns the attribute(s)
-	\param result		the result of an operation to be used to fill the set
-	\param cellObjSet	the set to be filled
-	\param atttype		the type of the table to be filled
-	\patam t			the time interval of the attribute(s)
-	\return if the function was successfully executed
-*/
-void TeFillCellInitSTO (const TeCell& cell, vector<string>& result, TeSTElementSet& cellObjSet, TeAttrTableType atttype, TeTimeInterval& t);
-
-
-//! Creates dymanic table
-/*	\param cell_layer			the layer where the table will be created
-	\param cell_table_name		the name of the new table
-	\return if the function was successfully executed
-*/
-bool TeCreateBasicDynamicCellTable (TeLayer* cell_layer, const string cell_tablename);
-
-/** @} */
-/** @} */
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeCellAlgorithms.h
+    This file contains algorithms and operations to deal with on cell geometry
+*/
+
+#ifndef  __TERRALIB_INTERNAL_CELLALGORITHMS_H
+#define  __TERRALIB_INTERNAL_CELLALGORITHMS_H
+
+#include "TeSTElementSet.h"
+#include "TeComputeAttributeStrategies.h"
+#include <TeRaster.h>
+
+#include "TeFunctionsDefines.h"
+
+class TeDatabase; 
+class TeDatabasePortal;
+class TeLayer;
+class TeGraphNetwork;
+class TeTable;
+
+using namespace std;
+
+//! This class represents a raster iterator using a box as spatial restriction
+class TLFUNCTIONS_DLL TeBoxRasterIterator
+{
+	public:
+		//! Constructor
+		TeBoxRasterIterator(TeRaster* raster_, TeBox box); 
+
+	    //! Prefix move forward operator
+	    TeBoxRasterIterator& operator++();
+
+	    //! Prefix move forward operator
+	    TeBoxRasterIterator operator++(int);
+
+	    //! Dereferencing operator
+	    double operator*();
+
+		//! Equal operator
+        bool operator==(const TeBoxRasterIterator& rhs) const;
+
+		//! Differ operator
+        bool operator!=(const TeBoxRasterIterator& rhs) const; 
+
+		//! getProperty
+		bool getProperty(TeProperty& prop);
+        
+		//! Returns an iterator that points to the first position of the raster inside the box
+		TeBoxRasterIterator begin(); 
+		
+		//! Returns an iterator that points to the last position of the raster inside the box
+		TeBoxRasterIterator end();
+
+	private:
+		int xo, yo, xf, yf, x, y;
+		bool end_;
+		TeRaster* raster;
+};
+
+/** @defgroup CellSpaces Cell Spaces 
+  @{
+ */
+
+/** @defgroup CreateCells Cells generation
+    @ingroup CellSpaces
+  @{
+ */
+//! Creates a new layer with the cells that covers the polygons of a theme  
+/*	\param layerName	name of the new layer with cell representations
+	\param theme		pointer to the theme that has the polygons
+	\param resX			X resolution of each cell
+	\param resY			Y resolution of each cell
+	\param box			bounding box of interest
+	\return a pointer to the new layer created if success or null if fail
+*/
+TLFUNCTIONS_DLL TeLayer* TeCreateCells(const string& layerName,TeTheme* theme, double resX, double resY, TeBox& box);
+
+//! Creates a new layer with the cells that covers the entire bounding box, or the polygons  of a layer 
+/*	\param layerName	name of the new layer with cell representations
+	\param layerBase	pointer to the base layer
+	\param resX			X resolution of each cell
+	\param resY			Y resolution of each cell
+	\param mask			flag that indicates if the cells should be created only over the polygons of the layer
+	\param box			bounding box of interest
+	\return a pointer to the new layer created if success or null if fail
+*/
+TLFUNCTIONS_DLL TeLayer* TeCreateCells( const string& layerName, TeLayer* layerBase, 
+			   double resX, double resY, TeBox& box, bool mask = true);
+
+/** @} */ 
+
+/** @defgroup CellStatistics Cells statistics 
+    @ingroup CellSpaces
+  @{
+ */
+//! Calculates a set of statistics of cells of a theme 
+/*	\param themeOut			cell theme 
+	\param newAttrTable		new attribute table where the generated statistics will be kept 
+	\param stat				the structure that contains the statistics which will be generated 
+	\param themeIn			point or cell theme
+	\param db				a pointer to the database
+	\return true if the operation was successfully done  
+*/
+TLFUNCTIONS_DLL bool 
+TeCellStatistics(TeTheme* themeOut, TeTable& newAttrTable, TeGroupingAttr& stat, 
+				 TeTheme* themeIn, TeDatabase* db);
+
+//! Saves the statistics accessible through a TeDatabasePortal in a database table 
+/*	\param tableAttrCell	attribute table name where the generated statistics will be kept 
+	\param portal			a pointer to the database portal that contains the generated statistics  
+	\return true if the operation was successfully done  
+*/
+TLFUNCTIONS_DLL bool TeKeepStatistics(TeTable& tableAttrCell, TeDatabasePortal* portal);
+
+/** @} */ 
+
+/** @defgroup FillCellAlg Cells attributes generation
+    @ingroup CellSpaces
+	Fill one attribute (or group of related attributes) for all cells in the output layer 
+	based on a single input layer attribute for a given time interval. Specific operation to be applied is a parameter (Strategy pattern).
+  @{
+ */
+
+//! Calculates an attribute based on the exact Euclidean distance. This strategy is separated from the others because it 
+//! calculates the distance using an already calculated distance of one of its neighbours.
+/*	\param input_theme				a pointer to the input theme to calculate the distances
+	\param rep						input theme representation to be used
+	\param cell_layer				a pointer to the output cell layer  
+	\param cell_tablename			output cell attribute dynamic table; if does not exist, the table will be created by the function  
+	\param output_columnname		output attribute name   
+	\param time_interval			time interval of output cells attributes
+	\return true if the operation was successfully done  
+*/
+TLFUNCTIONS_DLL bool TeFillCellDistanceOperation(TeTheme* input_theme,
+								 TeGeomRep rep,
+								 TeLayer* cell_layer,
+								 const string& cell_tablename,
+								 const string& output_columnname,
+								 TeTimeInterval time_interval = TeTimeInterval());
+
+//! suppose that each cell is completely filled by the used geometry, and there is no overlapping geometries. Creates one attribute 
+//! for each unique value, and this values are used in the name of the created attributes, in the form attrName concatenated 
+//! with the value
+/*	\param input_theme				a pointer to the input theme to calculate the distances
+	\param rep						input theme representation to be used
+	\param cell_layer				a pointer to the output cell layer  
+	\param cell_tablename			output cell attribute table; if does not exist, the table will be created by the function  
+	\param output_columnName		output attribute name   
+	\param time_interval			time interval of output cells attributes
+	\return true if the operation was successfully done  
+*/
+
+TLFUNCTIONS_DLL bool TeFillCellCategoryCountPercentageRasterOperation(TeDatabase* database,
+													  string raster_layername,
+													  string cell_layername,
+													  const string& cell_tablename,
+													  const string attrName,
+													  TeTimeInterval t);
+
+
+
+TLFUNCTIONS_DLL bool TeFillCellCategoryAreaPercentageOperation(TeTheme* theme,
+											   const string attrName,
+								 			   TeLayer* cell_layer,
+											   const string& cell_tablename,
+											   TeTimeInterval t = TeTimeInterval());
+
+
+TLFUNCTIONS_DLL bool TeFillCellCategoryAreaPercentageOperation(TeTheme* input_theme,
+											   const string attr_name,
+								 			   TeLayer* cell_layer,
+											   const string& cell_tablename,
+											   map<string, string>& classesMap,
+											   TeTimeInterval time_interval = TeTimeInterval());
+
+//! Computes an attribute based on a TeComputeSpatialStrategy 
+/*	\param db						the database which contains the layer of cells
+	\patam operation				the operation used to compute the attribute
+	\param cell_layername			the name of the layer of cells
+	\param cell_tablename			output cell attribute table; if does not exist, the table will be created by the function  
+	\param output_columnname		output attribute name
+	\param time_interval			time interval of output cells attributes
+	\return true if the operation was successfully done  
+*/
+TLFUNCTIONS_DLL bool TeFillCellSpatialOperation(TeDatabase* db,
+                        		TeComputeSpatialStrategy* operation,
+								const string& cell_layername,
+                        		const string& cell_tablename,
+                        		const string& output_columnname,
+								TeTimeInterval time_interval = TeTimeInterval());
+
+//! Computes the cell attribute based on a non-spatial operation (TeComputeAttrStrategy) over a vector or cell input layer.
+/*	\param db						a pointer to the database in which input and output layers are stored
+	\param input_layername			name of input layer 
+	\param rep						input layer representation to be used
+	\param input_tablename			input layer attribute table to be used  
+	\param input_attrname			input layer attribute to be used to compute output attribute
+	\param operation				operation to be applied (see TeComputeAttrStrategy hierarchy)  
+	\param cell_layername			output cell layer  
+	\param cell_tablename			output cell attribute dynamic table; if does not exist, the table will be created by the function  
+	\param output_columnName		output attribute name   
+	\param time_interval			time interval of output cells attributes
+	\return true if the operation was successfully done  
+*/
+TLFUNCTIONS_DLL bool TeFillCellNonSpatialOperation(TeDatabase* db,
+									const string& input_layername, 
+									TeGeomRep rep,
+									const string& input_tablename, 
+									const string& input_attrname,
+									TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
+									const string& cell_layername, 
+									const string& cell_tablename, 
+									const string& output_columnName,
+									TeTimeInterval time_interval = TeTimeInterval());
+
+//! Computes the cell attribute based on a non-spatial operation (TeComputeAttrStrategy) over a vector or cell input layer.
+/*	\param theme					a pointer to an input theme
+	\param rep						input theme representation to be used
+	\param input_tablename			input theme attribute table to be used  
+	\param input_attrname			input theme attribute to be used to compute output attribute
+	\param operation				operation to be applied (see TeComputeAttrStrategy hierarchy)  
+	\param cell_layername			output cell layer  
+	\param cell_tablename			output cell attribute dynamic table; if does not exist, the table will be created by the function  
+	\param output_columnName		output attribute name   
+	\param time_interval			time interval of output cells attributes
+	\return true if the operation was successfully done  
+*/
+TLFUNCTIONS_DLL bool TeFillCellNonSpatialOperation (TeTheme* theme,
+									TeGeomRep rep,
+									const string& input_attrname,
+									TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
+									TeLayer* cell_layer,
+									const string& cell_tablename, 
+									const string& output_columnName,
+									TeTimeInterval time_interval = TeTimeInterval());
+
+//! Computes the cell attribute based on a non-spatial operation (TeComputeSpatialStrategy) over a raster input layer.
+/*	\param db						a pointer to the database in which input and output layers are stored
+	\param input_raster_layername	name of input layer that contains a raster representation 
+	\param operation				operation to be applied (see TeComputeAttrStrategy hierarchy)  
+	\param cell_layername			output cell layer  
+	\param cell_tablename			output cell attribute dynamic table; if does not exist, the table will be created by the function  
+	\param output_columnName		output attribute name   
+	\param time_interval			time interval of output cells attributes
+	\return true if the operation was successfully done  
+*/
+TLFUNCTIONS_DLL bool TeFillCellNonSpatialRasterOperation(TeDatabase* db,
+										const string& input_raster_layername, 
+										TeComputeAttrStrategy<TeBoxRasterIterator>* operation,
+										const string& cell_layername, 
+										const string& cell_tablename, 
+										const string& output_columnName,
+										TeTimeInterval time_interval = TeTimeInterval());
+
+//! Computes the cell attribute based on a non-spatial operation (TeComputeSpatialStrategy) over a certain attribute of a set of objects connected to each cell by a network.
+//! This function will change in the next version of TerraLib
+/*  \param db                       a pointer to the database in which input and output layers are stored
+    \param objects                  set of objects (e.g., ports) 
+    \param rep                      objects representation type
+    \param net                      netork to be used to verify and quantify cell connectivity to each cell
+    \param input_attrname           connected objects attribute to be used to compute output attribute
+    \param t                        time interval of output cells attributes
+    \param cell_layername           output cell layer  
+    \param cell_tablename           output cell attribute dynamic table; if does not exist, the table will be created by the function  
+    \param output_columnName        output attribute name   
+    \param operation                operation to be applied (see TeComputeAttrStrategy hierarchy)  
+    \param local_distance_factor    multiplier used to compute connection strenght weights: local distance factor (see GPM documentation) 
+    \param net_distance_factor      multiplier used to compute connection strenght weights: distance to network factor (see GPM documentation) 
+    \param net_conn_factor          multiplier used to compute connection strenght weights: connection through network factor (see GPM documentation) 
+    \param mult_factor              multiplier used to compute connection strenght weights: weight multiplier factor (see GPM documentation) 
+*/
+TLFUNCTIONS_DLL bool TeFillCellConnectionOperation (TeDatabase* db,
+                                    TeSTElementSet objects,
+                                    TeGeomRep rep,
+                                    TeGraphNetwork* net,
+                                    const string& /*input_attrName*/,
+                                    TeTimeInterval t,
+                                    const string& cell_layername,
+                                    const string& cell_tablename,
+                                    const string& /*output_columnName*/,
+                                    TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
+                                    double /*local_distance_factor = 0.0*/,
+                                    double /*net_distance_factor = 0.25*/,
+                                    double /*net_conn_factor = 1.0*/,
+                                    double /*mult_factor = 1000000.0*/);
+
+
+
+//! Computes a set of attributes for the output cell layer based on a non-spatial operation (TeComputeAttrSpatialStrategy) over an input cell layer.
+/*	\param db						a pointer to the database in which input and output layers are stored
+	\param input_layername			name of input cell layer 
+	\param input_tablename			input layer attribute table to be used  
+	\param operation				operation to be applied (see TeComputeAttrStrategy hierarchy)  
+	\param attrNames				names of input/output attribute names to be aggregated   
+	\param cell_layername			output cell layer  
+	\param cell_tablename			output cell attribute dynamic table; if does not exist, the table will be created by the function  
+	\param time_interval			time interval of output cells attributes
+	\return true if the operation was successfully done  
+*/
+TLFUNCTIONS_DLL bool TeFillCellAggregateOperation(TeDatabase* db,
+									const string& input_layername, 
+									const string& input_tablename, 
+									TeComputeAttrStrategy<TeSTElementSet::propertyIterator>* operation,
+									vector<string>& attrNames,
+									const string& cell_layername, 
+									const string& cell_tablename, 
+									TeTimeInterval time_interval = TeTimeInterval());
+/** @} */ 
+
+/** @defgroup FillCellAux Fill cells auxiliary functions
+    @ingroup FillCellAlg
+*  @{
+*/
+//! Load cells geometries and verify/create dynamic attribute table if does not exists
+/*	\param cell_layer		a pointer to a layer of cells
+	\param cell_tablename	the name of the table in the layer of cells
+	\param cells			the object to be filled
+	\return if the function was successfully executed
+*/
+TLFUNCTIONS_DLL bool TeFillCellInitLoad (TeLayer* cell_layer, const string& cell_tablename, TeCellSet& cells);
+
+
+//! Fills the cell object set for a temporal table 
+/*	\param cell			the cell which owns the attribute(s)
+	\param result		the result of an operation to be used to fill the set
+	\param cellObjSet	the set to be filled
+	\param atttype		the type of the table to be filled
+	\patam t			the time interval of the attribute(s)
+	\return if the function was successfully executed
+*/
+TLFUNCTIONS_DLL void TeFillCellInitSTO (const TeCell& cell, TePropertyVector& result, TeSTElementSet& cellObjSet, TeAttrTableType atttype, TeTimeInterval& t);
+
+
+//! Fills the cell object set for a temporal table 
+/*	\param cell			the cell which owns the attribute(s)
+	\param result		the result of an operation to be used to fill the set
+	\param cellObjSet	the set to be filled
+	\param atttype		the type of the table to be filled
+	\patam t			the time interval of the attribute(s)
+	\return if the function was successfully executed
+*/
+TLFUNCTIONS_DLL void TeFillCellInitSTO (const TeCell& cell, vector<string>& result, TeSTElementSet& cellObjSet, TeAttrTableType atttype, TeTimeInterval& t);
+
+
+//! Creates dymanic table
+/*	\param cell_layer			the layer where the table will be created
+	\param cell_table_name		the name of the new table
+	\return if the function was successfully executed
+*/
+TLFUNCTIONS_DLL bool TeCreateBasicDynamicCellTable (TeLayer* cell_layer, const string cell_tablename);
+
+/** @} */
+/** @} */
+#endif
+
diff --git a/src/terralib/functions/TeCoordAlgorithms.cpp b/src/terralib/functions/TeCoordAlgorithms.cpp
old mode 100755
new mode 100644
index 2298f64..17007d0
--- a/src/terralib/functions/TeCoordAlgorithms.cpp
+++ b/src/terralib/functions/TeCoordAlgorithms.cpp
@@ -1,100 +1,100 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeCoordAlgorithms.h"
-#include <math.h>
-#include <cstdlib>
-
-bool TeLongDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec)
-{
-	short  	posat,lim = 180;
-
-	double	dd,pi;			
-	posat = 0;
-	pi = 4.*atan((double)1.);
-
-	// Longitude 
-	if(dg < 0 || dg > lim)	
-		return false;
-
-	if(mn < 0 || mn > 60)
-		return false;
-
-	if(sc < 0. || sc > 60.)
-		return false;
-
-	if(hem == 'W' || hem == 'w'|| hem == 'O'|| hem == 'o')
-	{
-		if(dg > 0)
-			dg = dg * -1;
-		else if(mn > 0)
-			mn = mn * -1;
-		else
-			sc = (float)(sc * -1.);
-	}
-
-	dd = (double)(abs(dg)) + ((double)abs(mn)/60.) + fabs(sc)/3600.;
-	if (dg < 0 || mn < 0 || (int)sc < 0)
-		dd = -dd;
-	grauDec = dd;
-	return true;
-}
-
-
-bool
-TeLatDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec)
-{
-	short  	posat,lim = 90;
-
-	double	dd,pi;			
-	posat = 0;
-	pi = 4.*atan((double)1.);
-
-	// Longitude 
-	if(dg < 0 || dg > lim)	
-		return false;
-
-	if(mn < 0 || mn > 60)
-		return false;
-
-	if(sc < 0. || sc > 60.)
-		return false;
-
-	if(hem == 's' || hem == 'S')
-	{
-		if(dg > 0)
-			dg = dg * -1;
-		else if(mn > 0)
-			mn = mn * -1;
-		else
-			sc = (float)(sc * -1.);
-	}
-
-	dd = (double)(abs(dg)) + ((double)abs(mn)/60.) + fabs(sc)/3600.;
-	if (dg < 0 || mn < 0 || (int)sc < 0)
-		dd = -dd;
-
-//	dd = dd*pi/180.;
-	grauDec = dd;
-	return true;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeCoordAlgorithms.h"
+#include <math.h>
+#include <cstdlib>
+
+bool TeLongDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec)
+{
+	short  	posat,lim = 180;
+
+	double	dd,pi;			
+	posat = 0;
+	pi = 4.*atan((double)1.);
+
+	// Longitude 
+	if(dg < 0 || dg > lim)	
+		return false;
+
+	if(mn < 0 || mn > 60)
+		return false;
+
+	if(sc < 0. || sc > 60.)
+		return false;
+
+	if(hem == 'W' || hem == 'w'|| hem == 'O'|| hem == 'o')
+	{
+		if(dg > 0)
+			dg = dg * -1;
+		else if(mn > 0)
+			mn = mn * -1;
+		else
+			sc = (float)(sc * -1.);
+	}
+
+	dd = (double)(abs(dg)) + ((double)abs(mn)/60.) + fabs(sc)/3600.;
+	if (dg < 0 || mn < 0 || (int)sc < 0)
+		dd = -dd;
+	grauDec = dd;
+	return true;
+}
+
+
+bool
+TeLatDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec)
+{
+	short  	posat,lim = 90;
+
+	double	dd,pi;			
+	posat = 0;
+	pi = 4.*atan((double)1.);
+
+	// Longitude 
+	if(dg < 0 || dg > lim)	
+		return false;
+
+	if(mn < 0 || mn > 60)
+		return false;
+
+	if(sc < 0. || sc > 60.)
+		return false;
+
+	if(hem == 's' || hem == 'S')
+	{
+		if(dg > 0)
+			dg = dg * -1;
+		else if(mn > 0)
+			mn = mn * -1;
+		else
+			sc = (float)(sc * -1.);
+	}
+
+	dd = (double)(abs(dg)) + ((double)abs(mn)/60.) + fabs(sc)/3600.;
+	if (dg < 0 || mn < 0 || (int)sc < 0)
+		dd = -dd;
+
+//	dd = dd*pi/180.;
+	grauDec = dd;
+	return true;
+}
diff --git a/src/terralib/functions/TeCoordAlgorithms.h b/src/terralib/functions/TeCoordAlgorithms.h
old mode 100755
new mode 100644
index cb1b045..7700766
--- a/src/terralib/functions/TeCoordAlgorithms.h
+++ b/src/terralib/functions/TeCoordAlgorithms.h
@@ -1,55 +1,57 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeCoordAlgorithms.h
-    \brief This file contains algorithms to deal with geographical coordinates
-*/
-#ifndef  __TERRALIB_INTERNAL_COORDALGORITHMS_H
-#define  __TERRALIB_INTERNAL_COORDALGORITHMS_H
-
-#include <string>
-using namespace std;
-/*! 
-   \fn bool TeLongDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec) 
-   \brief Transform a Longitude Coordinate in degrees, minutes and seconds to decimal degrees
-   \param hem a character that indicates North or South hemisphere
-   \param dg dregrees value
-   \param mn minutes value
-   \param sc seconds value
-   \param grauDec returns the decimal degree value
-   \return TRUE if input is a valid longitude coordinate
-*/
-bool TeLongDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec);
-
-/*! 
-   \fn bool TeLatDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec) 
-   \brief Transform a Latitude Coordinate in degrees, minutes and seconds to decimal degrees
-   \param hem a character that indicates West or East
-   \param dg dregrees value
-   \param mn minutes value
-   \param sc seconds value
-   \param grauDec returns the decimal degree value
-   \return TRUE if input is a valid latitude coordinate
-*/
-bool TeLatDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec);
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeCoordAlgorithms.h
+    \brief This file contains algorithms to deal with geographical coordinates
+*/
+#ifndef  __TERRALIB_INTERNAL_COORDALGORITHMS_H
+#define  __TERRALIB_INTERNAL_COORDALGORITHMS_H
+
+#include "TeFunctionsDefines.h"
+
+#include <string>
+using namespace std;
+/*! 
+   \fn bool TeLongDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec) 
+   \brief Transform a Longitude Coordinate in degrees, minutes and seconds to decimal degrees
+   \param hem a character that indicates North or South hemisphere
+   \param dg dregrees value
+   \param mn minutes value
+   \param sc seconds value
+   \param grauDec returns the decimal degree value
+   \return TRUE if input is a valid longitude coordinate
+*/
+TLFUNCTIONS_DLL bool TeLongDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec);
+
+/*! 
+   \fn bool TeLatDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec) 
+   \brief Transform a Latitude Coordinate in degrees, minutes and seconds to decimal degrees
+   \param hem a character that indicates West or East
+   \param dg dregrees value
+   \param mn minutes value
+   \param sc seconds value
+   \param grauDec returns the decimal degree value
+   \return TRUE if input is a valid latitude coordinate
+*/
+TLFUNCTIONS_DLL bool TeLatDMS2DD(char hem, short& dg, short& mn, float& sc, double& grauDec);
+
+#endif
diff --git a/src/terralib/functions/TeDriverBNA.h b/src/terralib/functions/TeDriverBNA.h
index 5e675d9..0811758 100644
--- a/src/terralib/functions/TeDriverBNA.h
+++ b/src/terralib/functions/TeDriverBNA.h
@@ -1,78 +1,80 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeBNADriver.h
-    \brief This file contains functions to deal with the BNA format
-*/
-#ifndef __TERRALIB_INTERNAL_BNADRIVER_H
-#define __TERRALIB_INTERNAL_BNADRIVER_H
-
-#include "TeTable.h"
-#include "TeBox.h"
-#include "TeDataTypes.h"
-#include "TeGeometry.h" 
-
-#include <string>
-using namespace std;
-
-class TeLayer;
-class TeAsciiFile;
-class TeProjection;
-class TeDatabase;
-
-
-/** @defgroup BNA BNA format
- *  @ingroup Formats
- *  Functions related to BNA format (Atlas GIS BNA)
- *  @{
- */
- 
-/** Imports a geo data in BNA format to a TerraLib database
-	\param bnaFileName	BNA file name
-	\param db			pointer to a TerraLib database
-	\param layerName	name of the layer that will contain the data (optional)
-	\return a pointer to created layer if the data was imported successfully and 0 otherwise
-*/
-TeLayer* TeImportBNA(const string& bnaFileName, TeDatabase* db, const string& layerName="");
-
-/** Imports a BNA file to a specific layer TerraLib
-	\param layer			pointer to a layer
-	\param bnaFileName		BNA file name
-	\param attrTableName	the name that the attribute table will be saved
-	\param attList			to return the list of attributes defined in the bna file, used only to name the fields
-	\param chunkSize		the number of objects in memory before save them to the layer
-	\param linkCol			name of the column that will contain the link to geometries
-	\return TRUE if the data was imported successfully and FALSE otherwise
-*/
-bool TeImportBNA(TeLayer* layer, const string& bnaFileName, string attrTableName,  
-				 TeAttributeList& attList, int unsigned chunkSize, const string& linkCol = "");
-
-/** Reads the attributes definition of a data in BNA format 
-	\param bnaFileName	BNA file name
-	\param attList		to return the attribute list
-	\return TRUE if the attribute list is successfully read and FALSE otherwise
-*/
-bool TeReadBNAAttributeList(const string& bnaFileName, TeAttributeList& attList);
-
-/** @} */ // End of subgroup BNA format
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeBNADriver.h
+    \brief This file contains functions to deal with the BNA format
+*/
+#ifndef __TERRALIB_INTERNAL_BNADRIVER_H
+#define __TERRALIB_INTERNAL_BNADRIVER_H
+
+#include "TeTable.h"
+#include "TeBox.h"
+#include "TeDataTypes.h"
+#include "TeGeometry.h" 
+
+#include "TeFunctionsDefines.h"
+
+#include <string>
+using namespace std;
+
+class TeLayer;
+class TeAsciiFile;
+class TeProjection;
+class TeDatabase;
+
+
+/** @defgroup BNA BNA format
+ *  @ingroup Formats
+ *  Functions related to BNA format (Atlas GIS BNA)
+ *  @{
+ */
+ 
+/** Imports a geo data in BNA format to a TerraLib database
+	\param bnaFileName	BNA file name
+	\param db			pointer to a TerraLib database
+	\param layerName	name of the layer that will contain the data (optional)
+	\return a pointer to created layer if the data was imported successfully and 0 otherwise
+*/
+TLFUNCTIONS_DLL TeLayer* TeImportBNA(const string& bnaFileName, TeDatabase* db, const string& layerName="");
+
+/** Imports a BNA file to a specific layer TerraLib
+	\param layer			pointer to a layer
+	\param bnaFileName		BNA file name
+	\param attrTableName	the name that the attribute table will be saved
+	\param attList			to return the list of attributes defined in the bna file, used only to name the fields
+	\param chunkSize		the number of objects in memory before save them to the layer
+	\param linkCol			name of the column that will contain the link to geometries
+	\return TRUE if the data was imported successfully and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeImportBNA(TeLayer* layer, const string& bnaFileName, string attrTableName,  
+				 TeAttributeList& attList, int unsigned chunkSize, const string& linkCol = "");
+
+/** Reads the attributes definition of a data in BNA format 
+	\param bnaFileName	BNA file name
+	\param attList		to return the attribute list
+	\return TRUE if the attribute list is successfully read and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeReadBNAAttributeList(const string& bnaFileName, TeAttributeList& attList);
+
+/** @} */ // End of subgroup BNA format
+#endif
+
diff --git a/src/terralib/functions/TeDriverCSV.h b/src/terralib/functions/TeDriverCSV.h
index dc3bc5e..3c81782 100644
--- a/src/terralib/functions/TeDriverCSV.h
+++ b/src/terralib/functions/TeDriverCSV.h
@@ -1,115 +1,117 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDriverCSV.h
-    \brief This file contains functions to deal with a file in CSV format
-*/
-#ifndef __TERRALIB_INTERNAL_DRIVERCSV_H
-#define __TERRALIB_INTERNAL_DRIVERCSV_H
-
-#include "TeTable.h"
-#include "TeBox.h"
-#include "TeDataTypes.h"
-
-#include <string>
-using namespace std;
-
-class TeLayer;
-class TeAsciiFile;
-class TeProjection;
-class TeDatabase;
-class TeQuerier;
-class TeTheme;
-
-/** @defgroup CSV format
- *  @ingroup Formats
- *  Functions related to CSV format
- *  @{
- */
-/** Creates an attribute table in a TerraLib database and imports a CSV file to this table 
-	\param csvFileName			CSV file name
-	\param attrTable			attribute table specifications
-	\param db					pointer to a TerraLib database
-	\param layer				pointer to a layer to which the table will associated
-	\param separator			character used to separate the data in the CSV file 
-	\param firstLineIsHeader	indicates if the first line is a header
-	\param chunkSize			number of objects in memory before save them in the database
-	\param createAutoNum		indicates if the table first attribute is an autonumber which must be generated  
-	\return TRUE if the data was imported successfully and FALSE otherwise
-*/
-bool TeImportCSVFile(const string& csvFileName, TeTable& attrTable, TeDatabase* db, TeLayer* layer=0, 
-					 const char& separator=',', const bool& firstLineIsHeader=false,   
-					 const unsigned int& chunkSize=100, const bool& createAutoNum = false);
-
-/** Imports a CSV file to a layer in a TerraLib database, its geometries (points) and attributes
-	\param csvFileName			CSV file name pointer to a layer
-	\param attributeX			attribute index which provides the coordinate X
-	\param attributeY			attribute index which provides the coordinate Y
-	\param attrTable			attribute table specifications
-	\param db					pointer to a TerraLib database
-	\param layer				pointer to an empty layer which will be filled from CSV file
-	\param separator			character used to separate the data in the CSV file 
-	\param firstLineIsHeader	indicates if the first line is a header
-	\param chunkSize			number of objects in memory before save them in the database
-	\param createAutoNum		indicates if the table first attribute is an autonumber which must be generated  
-	\return TRUE if the data was imported successfully and FALSE otherwise
-*/
-bool TeImportCSVFile(const string& csvFileName, const int& attributeX, const int& attributeY, 
-					 TeTable& attrTable, TeDatabase* db, TeLayer* layer, 
-					 const char& separator=',', const bool& firstLineIsHeader=false,   
-					 const unsigned int& chunkSize=100, const bool& createAutoNum = false);
-
-/** Exports a querier to a Comma-Separated Values data file
-	\param querier		pointer to a valid querier
-	\param filename		name of the output CSV file
-	\param sep			separator to be used
-	\return TRUE if the data was successfully exported and FALSE otherwise
-	This function can be used only when the querier access point representation data. First line contains the name
-	of the attributes.
-*/
-bool TeExportQuerierToCSV(TeQuerier* querier, const std::string& filename, const char& sep=';');
-
-/** Exports a layer in a TerraLib database to a file in ASCII CSV format
-	This function can be used only when the layers contains POINT representation. First line contains the name
-	of the attributes.
-   \param layer			pointer to the layer
-   \param filename		name of the output MID/MIF file
-   \param sep			separator to be used
-   \return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportLayerToCSV(TeLayer* layer, const string& filename="", const char& sep=';');
-
-/** Exports a theme in a TerraLib database to a file in ASCII CSV format
- 	This function can be used only when the theme acontains POINT representation. First line contains the name
-	of the attributes.
-   \param theme			pointer to the theme
-   \param filename		name of the output MID/MIF file
-   \param selOb			selection of the objects that should be exported
-   \param sep			separator to be used
-   \return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportThemeToCSV(TeTheme* theme, TeSelectedObjects selOb, const std::string& filename="", const char& sep=';');
-
-/** @} */ // End of subgroup CSV format
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDriverCSV.h
+    \brief This file contains functions to deal with a file in CSV format
+*/
+#ifndef __TERRALIB_INTERNAL_DRIVERCSV_H
+#define __TERRALIB_INTERNAL_DRIVERCSV_H
+
+#include "TeTable.h"
+#include "TeBox.h"
+#include "TeDataTypes.h"
+
+#include "TeFunctionsDefines.h"
+
+#include <string>
+using namespace std;
+
+class TeLayer;
+class TeAsciiFile;
+class TeProjection;
+class TeDatabase;
+class TeQuerier;
+class TeTheme;
+
+/** @defgroup CSV format
+ *  @ingroup Formats
+ *  Functions related to CSV format
+ *  @{
+ */
+/** Creates an attribute table in a TerraLib database and imports a CSV file to this table 
+	\param csvFileName			CSV file name
+	\param attrTable			attribute table specifications
+	\param db					pointer to a TerraLib database
+	\param layer				pointer to a layer to which the table will associated
+	\param separator			character used to separate the data in the CSV file 
+	\param firstLineIsHeader	indicates if the first line is a header
+	\param chunkSize			number of objects in memory before save them in the database
+	\param createAutoNum		indicates if the table first attribute is an autonumber which must be generated  
+	\return TRUE if the data was imported successfully and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeImportCSVFile(const string& csvFileName, TeTable& attrTable, TeDatabase* db, TeLayer* layer=0, 
+					 const char& separator=',', const bool& firstLineIsHeader=false,   
+					 const unsigned int& chunkSize=100, const bool& createAutoNum = false);
+
+/** Imports a CSV file to a layer in a TerraLib database, its geometries (points) and attributes
+	\param csvFileName			CSV file name pointer to a layer
+	\param attributeX			attribute index which provides the coordinate X
+	\param attributeY			attribute index which provides the coordinate Y
+	\param attrTable			attribute table specifications
+	\param db					pointer to a TerraLib database
+	\param layer				pointer to an empty layer which will be filled from CSV file
+	\param separator			character used to separate the data in the CSV file 
+	\param firstLineIsHeader	indicates if the first line is a header
+	\param chunkSize			number of objects in memory before save them in the database
+	\param createAutoNum		indicates if the table first attribute is an autonumber which must be generated  
+	\return TRUE if the data was imported successfully and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeImportCSVFile(const string& csvFileName, const int& attributeX, const int& attributeY, 
+					 TeTable& attrTable, TeDatabase* db, TeLayer* layer, 
+					 const char& separator=',', const bool& firstLineIsHeader=false,   
+					 const unsigned int& chunkSize=100, const bool& createAutoNum = false);
+
+/** Exports a querier to a Comma-Separated Values data file
+	\param querier		pointer to a valid querier
+	\param filename		name of the output CSV file
+	\param sep			separator to be used
+	\return TRUE if the data was successfully exported and FALSE otherwise
+	This function can be used only when the querier access point representation data. First line contains the name
+	of the attributes.
+*/
+TLFUNCTIONS_DLL bool TeExportQuerierToCSV(TeQuerier* querier, const std::string& filename, const char& sep=';');
+
+/** Exports a layer in a TerraLib database to a file in ASCII CSV format
+	This function can be used only when the layers contains POINT representation. First line contains the name
+	of the attributes.
+   \param layer			pointer to the layer
+   \param filename		name of the output MID/MIF file
+   \param sep			separator to be used
+   \return TRUE if the data was successfully exported and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeExportLayerToCSV(TeLayer* layer, const string& filename="", const char& sep=';');
+
+/** Exports a theme in a TerraLib database to a file in ASCII CSV format
+ 	This function can be used only when the theme acontains POINT representation. First line contains the name
+	of the attributes.
+   \param theme			pointer to the theme
+   \param filename		name of the output MID/MIF file
+   \param selOb			selection of the objects that should be exported
+   \param sep			separator to be used
+   \return TRUE if the data was successfully exported and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeExportThemeToCSV(TeTheme* theme, TeSelectedObjects selOb, const std::string& filename="", const char& sep=';');
+
+/** @} */ // End of subgroup CSV format
+
+#endif
+
diff --git a/src/terralib/functions/TeDriverMIDMIF.h b/src/terralib/functions/TeDriverMIDMIF.h
index 070867b..567d802 100644
--- a/src/terralib/functions/TeDriverMIDMIF.h
+++ b/src/terralib/functions/TeDriverMIDMIF.h
@@ -1,119 +1,121 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMIDMIFDriver.h
-    \brief This file contains functions to deal with the MID MIF data format
-*/
-#ifndef __TERRALIB_INTERNAL_TeMIDMIFDriver_H
-#define __TERRALIB_INTERNAL_TeMIDMIFDriver_H
-
-#include "TeTable.h"
-#include "TeBox.h"
-#include "TeDataTypes.h"
-#include "TeGeometry.h" 
-
-#include <string>
-using namespace std;
-
-class TeLayer;
-class TeAsciiFile;
-class TeProjection;
-class TeDatabase;
-class TePolygonSet;
-class TeQuerier;
-class TeTheme;
-
-/** @defgroup MIDMIF MID/MIF format
- *  @ingroup Formats
- *  Functions related to MID MIF format
- *  @{
- */
- /** Imports a geo data in MID/MIF format to a TerraLib database
-	\param mifFileName	MIF file name
-	\param db			pointer to a TerraLib database
-	\param layerName	name of the layer that will contain the data (optional)
-	\return a pointer to created layer if the data was imported successfully and 0 otherwise
-*/
-TeLayer* TeImportMIF(const string& mifFileName, TeDatabase* db, const string& layerName="");
-
-/** Imports a MID/MIF file to a specific layer TerraLib
-	\param layer			pointer to a layer
-	\param mifFileName		MIF file name
-	\param attrTableName	the name that the attribute table will be saved
-	\param objectIdAttr		name of the attribute that has the identification of objects
-	\param chunkSize		the number of objects in memory before save them in the layer
-	\return TRUE if the data was imported successfully and FALSE otherwise
-*/
-bool TeImportMIF(TeLayer* layer, const string& mifFileName, string attrTableName="",  
-				 string objectIdAttr="", int unsigned chunkSize = 60);
-
-/** Reads the attributes definition of a data in MID/MIF format
-	\param mifFileName		MIF file name
-	\param attList			to return the list of attributes defined in the file
-*/
-void TeReadMIFAttributeList(const string& mifFileName, TeAttributeList& attList);
-
-/** Reads the geographical projection of a data in MID/MIF format
-	\param mifFileName		MIF file name
-	\return a pointer to a TeProjection
-*/
-TeProjection* TeReadMIFProjection(const string& mifFileName);
-
-/** Exports a querier to a MID/MIF file
-	\param	querier		pointer to a valid querier
-	\param baseName		name of the output MID/MIF file
-	\param proj			pointer to the projection of the geometries retrieved by the querier
-	\return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportQuerierToMIF(TeQuerier* querier, const std::string& base, TeProjection* proj);
-
-/** Exports a layer in a TerraLib database to a file in MID/MIF format
-   \param layer			pointer to the layer
-   \param baseName		name of the output MID/MIF file
-   \return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportLayerToMIF(TeLayer* layer, const string& baseName="");
-
-/** Exports a theme in a TerraLib database to a file in MID/MIF format
-   \param theme			pointer to the theme
-   \param baseName		name of the output MID/MIF file
-   \param selOb			selection of the objects that should be exported
-   \return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportThemeToMIF(TeTheme* theme, TeSelectedObjects selOb = TeAll, const string& baseName="");
-
-/** Exports a layer in a TerraLib database to a file in MID/MIF format
-   \param layer			pointer to the layer
-   \param mifFileName	name of the output MID/MIF file
-   \param tableName		name of the attribute table to be exported
-   \return true if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportMIF(TeLayer* layer, const string& mifFileName, const string& tableName, const string& restriction = "");
-
-/** @} */ // End of subgroup MID/MIF format
-
-/** \example importMIDMIF.cpp
- Shows how to import geographical data in MID/MIF format
- */
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMIDMIFDriver.h
+    \brief This file contains functions to deal with the MID MIF data format
+*/
+#ifndef __TERRALIB_INTERNAL_TeMIDMIFDriver_H
+#define __TERRALIB_INTERNAL_TeMIDMIFDriver_H
+
+#include "TeTable.h"
+#include "TeBox.h"
+#include "TeDataTypes.h"
+#include "TeGeometry.h" 
+
+#include "TeFunctionsDefines.h"
+
+#include <string>
+using namespace std;
+
+class TeLayer;
+class TeAsciiFile;
+class TeProjection;
+class TeDatabase;
+class TePolygonSet;
+class TeQuerier;
+class TeTheme;
+
+/** @defgroup MIDMIF MID/MIF format
+ *  @ingroup Formats
+ *  Functions related to MID MIF format
+ *  @{
+ */
+ /** Imports a geo data in MID/MIF format to a TerraLib database
+	\param mifFileName	MIF file name
+	\param db			pointer to a TerraLib database
+	\param layerName	name of the layer that will contain the data (optional)
+	\return a pointer to created layer if the data was imported successfully and 0 otherwise
+*/
+TLFUNCTIONS_DLL TeLayer* TeImportMIF(const string& mifFileName, TeDatabase* db, const string& layerName="");
+
+/** Imports a MID/MIF file to a specific layer TerraLib
+	\param layer			pointer to a layer
+	\param mifFileName		MIF file name
+	\param attrTableName	the name that the attribute table will be saved
+	\param objectIdAttr		name of the attribute that has the identification of objects
+	\param chunkSize		the number of objects in memory before save them in the layer
+	\return TRUE if the data was imported successfully and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeImportMIF(TeLayer* layer, const string& mifFileName, string attrTableName="",  
+				 string objectIdAttr="", int unsigned chunkSize = 60);
+
+/** Reads the attributes definition of a data in MID/MIF format
+	\param mifFileName		MIF file name
+	\param attList			to return the list of attributes defined in the file
+*/
+TLFUNCTIONS_DLL void TeReadMIFAttributeList(const string& mifFileName, TeAttributeList& attList);
+
+/** Reads the geographical projection of a data in MID/MIF format
+	\param mifFileName		MIF file name
+	\return a pointer to a TeProjection
+*/
+TLFUNCTIONS_DLL TeProjection* TeReadMIFProjection(const string& mifFileName);
+
+/** Exports a querier to a MID/MIF file
+	\param	querier		pointer to a valid querier
+	\param baseName		name of the output MID/MIF file
+	\param proj			pointer to the projection of the geometries retrieved by the querier
+	\return TRUE if the data was successfully exported and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeExportQuerierToMIF(TeQuerier* querier, const std::string& base, TeProjection* proj);
+
+/** Exports a layer in a TerraLib database to a file in MID/MIF format
+   \param layer			pointer to the layer
+   \param baseName		name of the output MID/MIF file
+   \return TRUE if the data was successfully exported and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeExportLayerToMIF(TeLayer* layer, const string& baseName="");
+
+/** Exports a theme in a TerraLib database to a file in MID/MIF format
+   \param theme			pointer to the theme
+   \param baseName		name of the output MID/MIF file
+   \param selOb			selection of the objects that should be exported
+   \return TRUE if the data was successfully exported and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeExportThemeToMIF(TeTheme* theme, TeSelectedObjects selOb = TeAll, const string& baseName="");
+
+/** Exports a layer in a TerraLib database to a file in MID/MIF format
+   \param layer			pointer to the layer
+   \param mifFileName	name of the output MID/MIF file
+   \param tableName		name of the attribute table to be exported
+   \return true if the data was successfully exported and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeExportMIF(TeLayer* layer, const string& mifFileName, const string& tableName, const string& restriction = "");
+
+/** @} */ // End of subgroup MID/MIF format
+
+/** \example importMIDMIF.cpp
+ Shows how to import geographical data in MID/MIF format
+ */
+
+#endif
+
diff --git a/src/terralib/functions/TeDriverSPRING.h b/src/terralib/functions/TeDriverSPRING.h
index 2626aa8..ec07804 100644
--- a/src/terralib/functions/TeDriverSPRING.h
+++ b/src/terralib/functions/TeDriverSPRING.h
@@ -1,116 +1,118 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSPRINGDriver.h
-    \brief This file contains functions to deal with the SPRING GEO/TAB format
-*/
-#ifndef __TERRALIB_INTERNAL_SPRINGDriver_H
-#define __TERRALIB_INTERNAL_SPRINGDriver_H
-
-#include "TeTable.h"
-#include "TeBox.h"
-#include "TeDataTypes.h"
-#include "TeGeometry.h" 
-
-#include <string>
-using namespace std;
-
-class TeLayer;
-class TeSPRFile;
-class TeAsciiFile;
-class TeProjection;
-class TeDatabase;
-class TeTheme;
-class TeQuerier;
-
-/** @defgroup SPR SPRING GEO/TAB format
-   @ingroup Formats
-   Functions related to SPRING format
-   @{
- */ 
-/** Imports a geo data in SPRING geo/tab format to a TerraLib database
-	\param geoFileName	GEO/TAB file name
-	\param db			pointer to a TerraLib database
-	\param layerName	name of the layer that will contain the data (optional)
-	\return a pointer to created layer if the data was imported successfully and 0 otherwise
-*/
-TeLayer* TeImportGEO(const string& geoFileName, TeDatabase* db, const string& layerName="");
-
-/** Imports a GEO/TAB data to a layer TerraLib
-    \param layer			pointer to a layer
-	\param geoFileName		GEO/TAB file name
-	\param attrTableName	the name that the attribute table will be saved
-	\param chunkSize the number of objects in memory before save them in the layer
-*/
-bool TeImportGEO(TeLayer* layer, const string& geoFileName, string attrTableName="", unsigned int chunkSize=60);
-
-/** Reads the list of attributes  of GEO/TAB file
-	\param geoFileName	DBF input file name
-	\param attList		to return the DBF list of attributes
-	\param labelName	to return the name of the column that is the link with geometries
-	\return true if the list of attributes were was successfully read and false otherwise
-*/
-void TeReadGeoAttributeList(const string& geoFileName, TeAttributeList& attList, string& labelName);
-
-/** Exports a layer in a TerraLib database to a file in ASCII SPRING format
-    \param layer		pointer to the layer
-    \param sprFileName	name of the output SPRING file
-    \param tableName	name of the attribute table to be exported
-    \param cat			Spring's category
-	\param name			name of the column that has the object identifier or class indication
-    \return TRUE if the data was successfully exported and FALSE otherwise
-    \note Parameter 'name' is the Object name if exporting to categories Cadastral or Network .
-   Is the name of the column that has the quote value if Numeric category or the name
-   of the column that has the class information if category Thematic.
-*/
-bool TeExportSPR(TeLayer* layer, const string& sprFileName, const string& tableName, 
-			 TeSpringModels cat, const string& name);
-
-/** Exports a theme in a TerraLib database to a file in MID/MIF format
-	\param theme			pointer to the theme
-	\param cat			Spring's category
-	\param name			name of the column that has the object identifier or class indication
-	\param selOb			selection of the objects that should be exported
-	\param baseName		name of the output MID/MIF file
-   \return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportThemeToSPRING(TeTheme* theme, TeSpringModels cat, const string& name, TeSelectedObjects selOb = TeAll, const string& baseName="");
-
-
-/** Exports a querier to a SCII Spring file
-	\param querier		pointer to a valid querier
-	\param baseName		name of the output SPRING file
-    \param cat			Spring's category
-	\param name			name of the column that has the object identifier or class indication
-	\param proj			projection of the data
-	\param objname		name of object category
-	\return TRUE if the data was successfully exported and FALSE otherwise
-*/
-bool TeExportQuerierToSPRING(TeQuerier* querier, const std::string& base, TeSpringModels cat, const string& name, TeProjection* proj=0);
-/** @} */ // End of subgroup SPRING format
-
-/** \example importGeoTab.cpp
- Shows how to import geographical data in SPRING GEO/TAB format
- */
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSPRINGDriver.h
+    \brief This file contains functions to deal with the SPRING GEO/TAB format
+*/
+#ifndef __TERRALIB_INTERNAL_SPRINGDriver_H
+#define __TERRALIB_INTERNAL_SPRINGDriver_H
+
+#include "TeTable.h"
+#include "TeBox.h"
+#include "TeDataTypes.h"
+#include "TeGeometry.h" 
+
+#include "TeFunctionsDefines.h"
+
+#include <string>
+using namespace std;
+
+class TeLayer;
+class TeSPRFile;
+class TeAsciiFile;
+class TeProjection;
+class TeDatabase;
+class TeTheme;
+class TeQuerier;
+
+/** @defgroup SPR SPRING GEO/TAB format
+   @ingroup Formats
+   Functions related to SPRING format
+   @{
+ */ 
+/** Imports a geo data in SPRING geo/tab format to a TerraLib database
+	\param geoFileName	GEO/TAB file name
+	\param db			pointer to a TerraLib database
+	\param layerName	name of the layer that will contain the data (optional)
+	\return a pointer to created layer if the data was imported successfully and 0 otherwise
+*/
+TLFUNCTIONS_DLL TeLayer* TeImportGEO(const string& geoFileName, TeDatabase* db, const string& layerName="");
+
+/** Imports a GEO/TAB data to a layer TerraLib
+    \param layer			pointer to a layer
+	\param geoFileName		GEO/TAB file name
+	\param attrTableName	the name that the attribute table will be saved
+	\param chunkSize the number of objects in memory before save them in the layer
+*/
+TLFUNCTIONS_DLL bool TeImportGEO(TeLayer* layer, const string& geoFileName, string attrTableName="", unsigned int chunkSize=60);
+
+/** Reads the list of attributes  of GEO/TAB file
+	\param geoFileName	DBF input file name
+	\param attList		to return the DBF list of attributes
+	\param labelName	to return the name of the column that is the link with geometries
+	\return true if the list of attributes were was successfully read and false otherwise
+*/
+TLFUNCTIONS_DLL void TeReadGeoAttributeList(const string& geoFileName, TeAttributeList& attList, string& labelName);
+
+/** Exports a layer in a TerraLib database to a file in ASCII SPRING format
+    \param layer		pointer to the layer
+    \param sprFileName	name of the output SPRING file
+    \param tableName	name of the attribute table to be exported
+    \param cat			Spring's category
+	\param name			name of the column that has the object identifier or class indication
+    \return TRUE if the data was successfully exported and FALSE otherwise
+    \note Parameter 'name' is the Object name if exporting to categories Cadastral or Network .
+   Is the name of the column that has the quote value if Numeric category or the name
+   of the column that has the class information if category Thematic.
+*/
+TLFUNCTIONS_DLL bool TeExportSPR(TeLayer* layer, const string& sprFileName, const string& tableName, 
+			 TeSpringModels cat, const string& name);
+
+/** Exports a theme in a TerraLib database to a file in MID/MIF format
+	\param theme			pointer to the theme
+	\param cat			Spring's category
+	\param name			name of the column that has the object identifier or class indication
+	\param selOb			selection of the objects that should be exported
+	\param baseName		name of the output MID/MIF file
+   \return TRUE if the data was successfully exported and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeExportThemeToSPRING(TeTheme* theme, TeSpringModels cat, const string& name, TeSelectedObjects selOb = TeAll, const string& baseName="");
+
+
+/** Exports a querier to a SCII Spring file
+	\param querier		pointer to a valid querier
+	\param baseName		name of the output SPRING file
+    \param cat			Spring's category
+	\param name			name of the column that has the object identifier or class indication
+	\param proj			projection of the data
+	\param objname		name of object category
+	\return TRUE if the data was successfully exported and FALSE otherwise
+*/
+TLFUNCTIONS_DLL bool TeExportQuerierToSPRING(TeQuerier* querier, const std::string& base, TeSpringModels cat, const string& name, TeProjection* proj=0);
+/** @} */ // End of subgroup SPRING format
+
+/** \example importGeoTab.cpp
+ Shows how to import geographical data in SPRING GEO/TAB format
+ */
+
+#endif
+
diff --git a/src/terralib/functions/TeExportCSV.cpp b/src/terralib/functions/TeExportCSV.cpp
index ab08b23..4a77aa3 100644
--- a/src/terralib/functions/TeExportCSV.cpp
+++ b/src/terralib/functions/TeExportCSV.cpp
@@ -1,183 +1,183 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeException.h"
-#include "TeDriverCSV.h"
-#include "TeAsciiFile.h"
-
-#include "TeUtils.h"
-#include "TeLayer.h"
-#include "TeQuerier.h"
-
-bool TeExportQuerierToCSV(TeQuerier* querier, const std::string& filename, const char& sep)
-{
-	// check initial conditions
-	if (!querier || filename.empty())
-		return false;
-
-	if (!querier->loadInstances())
-		return false;
-	
-	// Get the list of attributes defined by the input querier
-	bool onlyObjId = false;
-	TeAttributeList qAttList = querier->getAttrList();
-	if (qAttList.empty())
-	{
-		TeAttributeList qAttList;
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;               
-		at.rep_.numChar_ = 100;
-		at.rep_.name_ = "ID";
-		at.rep_.isPrimaryKey_ = true;
-		qAttList.push_back(at);
-		onlyObjId = true;
-	}
-	string line = "COORD_X";
-	line += sep;
-	line += "COORD_Y";
-	line += sep;
-	line += qAttList[0].rep_.name_;
-	unsigned int i=0;
-	TeAsciiFile csv(filename, "w+");
-	for (i=1;i<qAttList.size();++i)
-	{
-		line += sep;
-		line += qAttList[i].rep_.name_;
-	}
-	csv.writeString(line);
-	csv.writeNewLine();
-
-	TePointSet		objectPoints;	// points of the region
-
-	// progress information
-	if (TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-	int dt = CLOCKS_PER_SEC/2;
-	int dt2 = CLOCKS_PER_SEC; //* .000001;
-	unsigned int nIProcessed = 0;
-	char aux[50];
-	TeSTInstance st;
-	while(querier->fetchInstance(st))
-	{
-		if (!st.hasPoints())
-			continue;
-
-		objectPoints = st.getPoints();
-		for (i=0;i<objectPoints.size();++i)
-		{
-			TeCoord2D xy = objectPoints[i].location();
-			sprintf(aux,"%.6f%c%.6f", xy.x(),sep, xy.y());
-			line = aux;
-			if (onlyObjId)
-			{
-				line += sep;
-				line += st.objectId();
-			}	
-			else
-			{
-				unsigned int aa = 0;
-				string val;
-				for (aa=0; aa<qAttList.size(); ++aa)
-				{
-					st.getPropertyValue(val,aa);
-					line += sep;
-					line += val;
-				}
-			}
-			csv.writeString(line);
-			csv.writeNewLine();
-		}
-		++nIProcessed;
-		t2 = clock();
-		if (TeProgress::instance() && int(t2-t1) > dt)
-		{
-			t1 = t2;
-			if(((int)(t2-t0) > dt2))
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(nIProcessed);
-			}
-		}
-	}
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-
-bool 
-TeExportThemeToCSV(TeTheme* theme, TeSelectedObjects selOb, const std::string& filename, const char& sep)
-{
-	if (!theme)
-		return false;
-
-	if (!(theme->visibleGeoRep() & TePOINTS))
-		return false;
-
-	string fbase = filename;
-	if (filename.empty())
-		fbase = theme->name();
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(theme);
-	qPar.setSelecetObjs(selOb);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToCSV(tQuerier, filename, sep);
-	delete tQuerier;
-	return res;
-}
-
-bool 
-TeExportLayerToCSV(TeLayer* layer, const string& filename, const char& sep)
-{
-	if (!layer)
-		return false;
-
-	if (!layer->hasGeometry(TePOINTS))
-		return false;
-
-	string fbase = filename;
-	if (filename.empty())
-		fbase = layer->name();
-
-	TeTheme* tempTheme = new TeTheme();
-	tempTheme->layer(layer);
-	tempTheme->collectionTable("");
-	tempTheme->collectionAuxTable("");
-	tempTheme->setAttTables(layer->attrTables());
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(tempTheme);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToCSV(tQuerier, filename, sep);
-	delete tQuerier;
-	delete tempTheme;
-    return res ;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeException.h"
+#include "TeDriverCSV.h"
+#include "TeAsciiFile.h"
+
+#include "TeUtils.h"
+#include "TeLayer.h"
+#include "TeQuerier.h"
+
+bool TeExportQuerierToCSV(TeQuerier* querier, const std::string& filename, const char& sep)
+{
+	// check initial conditions
+	if (!querier || filename.empty())
+		return false;
+
+	if (!querier->loadInstances())
+		return false;
+	
+	// Get the list of attributes defined by the input querier
+	bool onlyObjId = false;
+	TeAttributeList qAttList = querier->getAttrList();
+	if (qAttList.empty())
+	{
+		TeAttributeList qAttList;
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;               
+		at.rep_.numChar_ = 100;
+		at.rep_.name_ = "ID";
+		at.rep_.isPrimaryKey_ = true;
+		qAttList.push_back(at);
+		onlyObjId = true;
+	}
+	string line = "COORD_X";
+	line += sep;
+	line += "COORD_Y";
+	line += sep;
+	line += qAttList[0].rep_.name_;
+	unsigned int i=0;
+	TeAsciiFile csv(filename, "w+");
+	for (i=1;i<qAttList.size();++i)
+	{
+		line += sep;
+		line += qAttList[i].rep_.name_;
+	}
+	csv.writeString(line);
+	csv.writeNewLine();
+
+	TePointSet		objectPoints;	// points of the region
+
+	// progress information
+	if (TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+	int dt = CLOCKS_PER_SEC/2;
+	int dt2 = CLOCKS_PER_SEC; //* .000001;
+	unsigned int nIProcessed = 0;
+	char aux[50];
+	TeSTInstance st;
+	while(querier->fetchInstance(st))
+	{
+		if (!st.hasPoints())
+			continue;
+
+		objectPoints = st.getPoints();
+		for (i=0;i<objectPoints.size();++i)
+		{
+			TeCoord2D xy = objectPoints[i].location();
+			sprintf(aux,"%.6f%c%.6f", xy.x(),sep, xy.y());
+			line = aux;
+			if (onlyObjId)
+			{
+				line += sep;
+				line += st.objectId();
+			}	
+			else
+			{
+				unsigned int aa = 0;
+				string val;
+				for (aa=0; aa<qAttList.size(); ++aa)
+				{
+					st.getPropertyValue(val,aa);
+					line += sep;
+					line += val;
+				}
+			}
+			csv.writeString(line);
+			csv.writeNewLine();
+		}
+		++nIProcessed;
+		t2 = clock();
+		if (TeProgress::instance() && int(t2-t1) > dt)
+		{
+			t1 = t2;
+			if(((int)(t2-t0) > dt2))
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(nIProcessed);
+			}
+		}
+	}
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+
+bool 
+TeExportThemeToCSV(TeTheme* theme, TeSelectedObjects selOb, const std::string& filename, const char& sep)
+{
+	if (!theme)
+		return false;
+
+	if (!(theme->visibleGeoRep() & TePOINTS))
+		return false;
+
+	string fbase = filename;
+	if (filename.empty())
+		fbase = theme->name();
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(theme);
+	qPar.setSelecetObjs(selOb);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToCSV(tQuerier, filename, sep);
+	delete tQuerier;
+	return res;
+}
+
+bool 
+TeExportLayerToCSV(TeLayer* layer, const string& filename, const char& sep)
+{
+	if (!layer)
+		return false;
+
+	if (!layer->hasGeometry(TePOINTS))
+		return false;
+
+	string fbase = filename;
+	if (filename.empty())
+		fbase = layer->name();
+
+	TeTheme* tempTheme = new TeTheme();
+	tempTheme->layer(layer);
+	tempTheme->collectionTable("");
+	tempTheme->collectionAuxTable("");
+	tempTheme->setAttTables(layer->attrTables());
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(tempTheme);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToCSV(tQuerier, filename, sep);
+	delete tQuerier;
+	delete tempTheme;
+    return res ;
+}
diff --git a/src/terralib/functions/TeExportMIF.cpp b/src/terralib/functions/TeExportMIF.cpp
old mode 100755
new mode 100644
index 8107618..8733d64
--- a/src/terralib/functions/TeExportMIF.cpp
+++ b/src/terralib/functions/TeExportMIF.cpp
@@ -1,564 +1,564 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeException.h"
-#include "TeDriverMIDMIF.h"
-#include "TeAsciiFile.h"
-
-#include "TeUtils.h"
-#include "TeLayer.h"
-#include "TeQuerier.h"
-
-int TeExportMIFLineSet ( TeAsciiFile& mifFile, TeLineSet& ls);
-int TeExportMIFPointSet ( TeAsciiFile& mifFile, TePointSet& ps, bool isMulti=false);
-int TeExportMIFPolygonSet ( TeAsciiFile& mifFile, TePolygonSet& ps);
-int TeExportMIFCellSet (TeAsciiFile& mifFile, TeCellSet& cells, bool isMulti=false);
-void TeExportMIFProjection ( TeProjection* proj, TeAsciiFile& mifFile);
-void TeExportMIFAttributeList (TeAttributeList& attList, TeAsciiFile& mifFile);
-void TeExportMIFRow(TeTableRow& row, TeAsciiFile& midFile);
-TeProjInfo TeMIFProjectionInfo (const string& projName );
-
-
-bool
-TeExportQuerierToMIF(TeQuerier* querier, const std::string& base, TeProjection* proj)
-{
-	// check initial conditions
-	if (!querier || base.empty())
-		return false;
-
-	if (!querier->loadInstances())
-		return false;
-	
-	// Get the list of attributes defined by the input querier
-	bool onlyObjId = false;
-	TeAttributeList qAttList = querier->getAttrList();
-	if (qAttList.empty())
-	{
-		TeAttributeList qAttList;
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;               
-		at.rep_.numChar_ = 100;
-		at.rep_.name_ = "ID";
-		at.rep_.isPrimaryKey_ = true;
-		qAttList.push_back(at);
-		onlyObjId = true;
-	}
-
-	TeAsciiFile mifFile(base+".MIF", "w+");
-	TeAsciiFile midFile(base+".MID", "w+");
-	
-	// write header;
-	mifFile.writeString("Version 300\n");
-	mifFile.writeString("Charset \"WindowsLatin1\" \n");
-	mifFile.writeString("Delimiter \";\"\n");
-	if (proj)
-	{
-		TeBox box = querier->getBox();
-		char txt[300];
-		sprintf(txt,"Bounds (%.5f, %5f) (%.5f, %5f)\n",box.x1_,box.y1_,box.x2_,box.y2_);
-		if (proj->name() == "NoProjection")
-		{
-			mifFile.writeString("CoordSys Nonearth\n");
-			mifFile.writeString("Units ");
-			mifFile.writeString(proj->units());
-			mifFile.writeNewLine();
-			mifFile.writeString(string(txt));
-		}
-		else if (proj->name() == "LatLong")
-		{
-			mifFile.writeString("CoordSys Earth Projection 1, 0 ");
-			mifFile.writeString(string(txt));
-		}
-		else
-		{
-			TeExportMIFProjection(proj, mifFile);
-			mifFile.writeString(" ");
-			mifFile.writeString(string(txt));
-		}
-	}
-	TeExportMIFAttributeList(qAttList,mifFile);
-	mifFile.writeString("Data\n");
-
-	TeTableRow row;
-	TePolygonSet	objectPols;		// polygons of the region
-	TeLineSet		objectLines;		// lines of the region
-	TePointSet		objectPoints;	// points of the region
-	TeCellSet		objectCells;	// points of the region
-
-	// progress information
-	if (TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-	int dt = CLOCKS_PER_SEC/2;
-	int dt2 = CLOCKS_PER_SEC; //* .000001;
-	unsigned int nIProcessed = 0;
-	TeSTInstance st;
-	while(querier->fetchInstance(st))
-	{
-		if (st.hasPolygons())
-			objectPols = st.getPolygons();
-		if (st.hasCells())
-			objectCells = st.getCells();
-		if (st.hasLines())
-			objectLines = st.getLines();
-		if (st.hasPoints())
-			objectPoints = st.getPoints();
-		
-		int col = 0;
-		if (objectPoints.size() > 0)
-			col++;
-		if (objectLines.size() > 0)
-			col++;
-		if (objectPols.size() > 0)
-			col++;
-		if (objectCells.size() > 0)
-			col++;
-		if (col == 0)
-		{
-			mifFile.writeString("NONE\n");
-		}
-		else
-		{
-			if (col > 1)	// it is a collection
-				mifFile.writeString("Collection " + Te2String(col) + "\n");
-
-			if (objectPols.size() > 0)
-				TeExportMIFPolygonSet(mifFile,objectPols);
-
-			if (objectLines.size() > 0)
-				TeExportMIFLineSet(mifFile,objectLines);
-
-			if (objectPoints.size() > 0)
-				TeExportMIFPointSet(mifFile,objectPoints,(col>1));
-
-			if (objectCells.size() > 0)
-				TeExportMIFCellSet(mifFile,objectCells,(col>1));
-				
-			objectCells.clear();
-			objectPols.clear();
-			objectPoints.clear();
-			objectLines.clear();
-		}
-
-		row.clear();	// export attributes
-		if (onlyObjId)
-		{
-			row.push_back(st.objectId());
-		}	
-		else
-		{
-			unsigned int aa = 0;
-			string val;
-			for (aa=0; aa<qAttList.size(); ++aa)
-			{
-				st.getPropertyValue(val,aa);
-				row.push_back(val);
-			}
-			TeExportMIFRow(row,midFile);
-		}
-		++nIProcessed;
-		t2 = clock();
-		if (TeProgress::instance() && int(t2-t1) > dt)
-		{
-			t1 = t2;
-			if(((int)(t2-t0) > dt2))
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(nIProcessed);
-			}
-		}
-	}
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	return true;
-}
-
-
-bool 
-TeExportThemeToMIF(TeTheme* theme, TeSelectedObjects selOb, const std::string& baseName)
-{
-	if (!theme)
-		return false;
-
-	string fbase = baseName;
-	if (baseName.empty())
-		fbase = theme->name();
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(theme);
-	qPar.setSelecetObjs(selOb);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToMIF(tQuerier, fbase, theme->layer()->projection());
-	delete tQuerier;
-	return res;
-}
-
-bool 
-TeExportLayerToMIF(TeLayer* layer, const string& baseName)
-{
-  	if (!layer)
-		return false;
-
-	string fbase = baseName;
-	if (baseName.empty())
-		fbase = layer->name();
-
-	TeTheme* tempTheme = new TeTheme();
-	tempTheme->layer(layer);
-	tempTheme->collectionTable("");
-	tempTheme->collectionAuxTable("");
-	tempTheme->setAttTables(layer->attrTables());
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(tempTheme);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToMIF(tQuerier, baseName, layer->projection());
-	delete tQuerier;
-	delete tempTheme;
-    return res ;
-}
-
-bool
-TeExportMIF( TeLayer* layer, const string& mifFileName, const string& tableName, const string& restriction)
-{
-	if (!layer || mifFileName.empty() || tableName.empty())
-		return false;
-	
-	// check if asked table exist
-	TeAttrTableVector& vTables = layer->attrTables();
-	TeAttrTableVector::iterator it = vTables.begin();
-	while (it != vTables.end())
-	{
-		if (it->name() == tableName) 
-			break;
-		++it;
-	}
-	if (it == vTables.end())
-		return false;
-	TeAttrTableVector askedTable;
-	askedTable.push_back(*it);
-
-	TeTheme* tempTheme = new TeTheme();
-	tempTheme->attributeRest(restriction);
-	tempTheme->layer(layer);
-	tempTheme->collectionTable("");
-	tempTheme->collectionAuxTable("");
-	tempTheme->setAttTables(askedTable);
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(tempTheme);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToMIF(tQuerier, mifFileName, layer->projection());
-	delete tQuerier;
-	delete tempTheme;
-    return res ;
-	return true;
-}
-
-void
-TeExportMIFRow(TeTableRow& row, TeAsciiFile& midFile)
-{
-	TeTableRow::iterator it = row.begin();
-	if (it != row.end())
-	{
-		midFile.writeString((*it));
-		++it;
-	}
-
-	while ( it!= row.end())
-	{
-		midFile.writeString(";"+(*it));
-		++it;
-	}
-	midFile.writeNewLine();
-}
-
-void
-TeExportMIFProjection ( TeProjection* proj, TeAsciiFile& mifFile)
-{
-	if (!proj)
-		return ;
-
-	map<string,string> mifProjCode;
-	mifProjCode["LambertConformal"] = "3";
-	mifProjCode["UTM"] = "8";
-	mifProjCode["Albers"] = "9";
-	mifProjCode["Mercator"] = "10";
-	mifProjCode["Miller"] = "11";
-	mifProjCode["Polyconic"] = "27";
-	
-	map<string,string> mifDatumCode;
-	mifDatumCode["Spherical"]="0";
-	mifDatumCode["Astro-Chua"]="23";
-	mifDatumCode["CorregoAlegre"]="24";
-	mifDatumCode["Indian"]="40";
-	mifDatumCode["NAD27"]="62";
-	mifDatumCode["SAD69"]="92";
-	mifDatumCode["WGS84"]="104";
-
-	TeProjInfo pjInfo;
-	try
-	{
-		pjInfo = TeMIFProjectionInfo (proj->name());
-	}
-	catch(...)
-	{
-		return;
-	}
-
-	mifFile.writeString("CoordSys Earth Projection ");
-	mifFile.writeString(mifProjCode[proj->name()]);
-	mifFile.writeString(", " + mifDatumCode[proj->datum().name()]);
-	
-	string mess;
-
-	if (pjInfo.hasUnits)
-		mess = ", " + proj->units();
-		
-	if ( pjInfo.hasLon0 )
-	{
-		if (!mess.empty())
-			mess += ", ";
-		mess +=  Te2String(proj->lon0()*TeCRD);
-	}
-
-	if ( pjInfo.hasLat0 )
-	{
-		if (!mess.empty())
-			mess += ", ";
-		mess += Te2String(proj->lat0()*TeCRD);
-	}
-
-	if ( pjInfo.hasStlat1 )
-	{
-		if (!mess.empty())
-			mess += ", ";
-		mess += Te2String(proj->stLat1()*TeCRD);
-	}
-
-	if ( pjInfo.hasStlat2 )
-	{
-		if (!mess.empty())
-			mess += ", ";
-		mess += Te2String(proj->stLat2()*TeCRD);
-	}
-
-	if ( pjInfo.hasScale )
-	{
-		if (!mess.empty())
-			mess += ", ";
-		mess += Te2String(proj->scale());
-	}
-
-	if ( pjInfo.hasOffx )
-	{
-		if (!mess.empty())
-			mess += ", ";
-		mess += Te2String(proj->offX());
-	}
-
-	if ( pjInfo.hasOffy )
-	{
-		if (!mess.empty())
-			mess += ", ";
-		mess += Te2String(proj->offY());
-	}
-	if (!mess.empty())
-		mifFile.writeString(mess);
-}
-
-void
-TeExportMIFAttributeList (TeAttributeList& attList, TeAsciiFile& mifFile)
-{
-	int n = attList.size();
-	mifFile.writeString("Columns " + Te2String(n));
-	mifFile.writeNewLine();
-
-	TeAttributeList::iterator it = attList.begin();
-	while ( it != attList.end())
-	{
-		TeAttribute att = *it;
-		mifFile.writeString("  "+att.rep_.name_ + " ");
-		if ( att.rep_.type_ == TeINT )
-			mifFile.writeString("Integer");
-		else if ( att.rep_.type_ == TeREAL )
-			mifFile.writeString("Float");
-		else if ( att.rep_.type_ == TeDATETIME )
-			mifFile.writeString("Char(25)"); 
-		else if ( att.rep_.type_ == TeSTRING )
-			mifFile.writeString("Char(" + Te2String(att.rep_.numChar_) + ")"); 
-		mifFile.writeNewLine();
-		++it;
-	}
-}
-
-
-int
-TeExportMIFLineSet (TeAsciiFile& mifFile, TeLineSet& lines)
-{
-	if (lines.size() == 0)
-		return 0;
-	
-	mifFile.writeString("Pline ");
-	char aux[100];
-	int n = lines.size();
-	if (n > 1)
-	{
-		sprintf(aux,"Multiple %d\n",n);
-		mifFile.writeString(string(aux));
-	}
-	for ( int i = 0; i < n; i++ )
-	{
-		TeLine2D line = lines[i];
-		sprintf(aux,"%d\n",line.size());
-		mifFile.writeString(string(aux));
-		for (unsigned int k = 0; k < line.size(); k++ )
-		{
-			sprintf(aux,"%.6f  %.6f \n", line[k].x(),line[k].y());
-			mifFile.writeString(string(aux));
-		}
-	}
-	return lines.size();
-}
-
-int 
-TeExportMIFPointSet (TeAsciiFile& mifFile, TePointSet& points, bool isMulti)
-{
-	if ( points.size() == 0 ) // layer has points
-		return 0;
-
-	int n = points.size();
-	char aux[50];
-	if (n == 1)
-	{
-		if (isMulti)
-			mifFile.writeString("Multipoint 1\n");
-		else
-			mifFile.writeString("Point ");
-		TePoint pt = points [0];
-		TeCoord2D xy = pt.location();
-		sprintf(aux,"%.6f  %.6f \n", xy.x(), xy.y());
-		mifFile.writeString(string(aux));
-	}
-	else
-	{
-		mifFile.writeString("Multipoint ");
-		sprintf(aux,"%d\n",n);
-		mifFile.writeString(string(aux));
-		unsigned int i;
-		for ( i = 0; i < points.size(); i++ )
-		{
-			TePoint pt = points [i];
-			TeCoord2D xy = pt.location();
-			sprintf(aux,"%.6f  %.6f \n", xy.x(), xy.y());
-			mifFile.writeString(string(aux));
-		}
-	}
-	return points.size();
-}
- 
-int
-TeExportMIFPolygonSet (TeAsciiFile& mifFile, TePolygonSet& polygons)
-{
-	if (polygons.size() == 0)
-		return 0;
-	char aux[50];
-
-	unsigned int nrings = 0;
-
-	for(unsigned int j = 0; j < polygons.size(); ++j)
-	{
-		nrings += polygons[j].size();
-	}
-
-	sprintf(aux,"Region %d\n",nrings);
-	mifFile.writeString(string(aux));
-	unsigned int i;
-	for (i = 0; i < polygons.size(); i++ )
-	{
-		TePolygon poly = polygons[i];
-		unsigned int k;
-		for (k = 0; k < poly.size(); k++ )
-		{
-			TeLinearRing ring = poly[k]; 
-			sprintf(aux,"%d\n",ring.size());
-			mifFile.writeString(string(aux));
-			unsigned int l;
-			for (l = 0 ; l < ring.size(); l++)
-			{
-				sprintf(aux,"%.6f  %.6f \n", ring[l].x(), ring[l].y());
-				mifFile.writeString(string(aux));
-			}
-		}
-	}
-	return polygons.size();
-}
-
-int
-TeExportMIFCellSet (TeAsciiFile& mifFile, TeCellSet& cells, bool isColl)
-{
-	if (cells.size() == 0)
-		return 0;
-	char aux[250];
-
-	if (cells.size() > 1 || isColl)
-	{
-		sprintf(aux,"Region %d\n",cells.size());
-		mifFile.writeString(string(aux));
-		unsigned int i;
-		for (i = 0; i < cells.size(); i++ )
-		{
-			TeCell cell = cells[i];
-			TeCoord2D ll = cell.box().lowerLeft();
-			TeCoord2D ur = cell.box().upperRight();
-			mifFile.writeString("5");
-			sprintf(aux,"%.6f  %.6f \n", ll.x(), ll.y());
-			mifFile.writeString(string(aux));
-			sprintf(aux,"%.6f  %.6f \n", ur.x(), ll.y());
-			mifFile.writeString(string(aux));
-			sprintf(aux,"%.6f  %.6f \n", ur.x(), ur.y());
-			mifFile.writeString(string(aux));
-			sprintf(aux,"%.6f  %.6f \n", ll.x(), ur.y());
-			mifFile.writeString(string(aux));
-			sprintf(aux,"%.6f  %.6f \n", ll.x(), ll.y());
-			mifFile.writeString(string(aux));
-		}
-		return cells.size();
-	}
-	else
-	{
-		sprintf(aux,"Rect %.6f  %.6f %.6f  %.6f\n",
-				cells[0].box().lowerLeft().x(), cells[0].box().lowerLeft().y(),
-				cells[0].box().upperRight().x(), cells[0].box().upperRight().y());
-		mifFile.writeString(string(aux));
-		return 1;
-	}
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeException.h"
+#include "TeDriverMIDMIF.h"
+#include "TeAsciiFile.h"
+
+#include "TeUtils.h"
+#include "TeLayer.h"
+#include "TeQuerier.h"
+
+int TeExportMIFLineSet ( TeAsciiFile& mifFile, TeLineSet& ls);
+int TeExportMIFPointSet ( TeAsciiFile& mifFile, TePointSet& ps, bool isMulti=false);
+int TeExportMIFPolygonSet ( TeAsciiFile& mifFile, TePolygonSet& ps);
+int TeExportMIFCellSet (TeAsciiFile& mifFile, TeCellSet& cells, bool isMulti=false);
+void TeExportMIFProjection ( TeProjection* proj, TeAsciiFile& mifFile);
+void TeExportMIFAttributeList (TeAttributeList& attList, TeAsciiFile& mifFile);
+void TeExportMIFRow(TeTableRow& row, TeAsciiFile& midFile);
+TeProjInfo TeMIFProjectionInfo (const string& projName );
+
+
+bool
+TeExportQuerierToMIF(TeQuerier* querier, const std::string& base, TeProjection* proj)
+{
+	// check initial conditions
+	if (!querier || base.empty())
+		return false;
+
+	if (!querier->loadInstances())
+		return false;
+	
+	// Get the list of attributes defined by the input querier
+	bool onlyObjId = false;
+	TeAttributeList qAttList = querier->getAttrList();
+	if (qAttList.empty())
+	{
+		TeAttributeList qAttList;
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;               
+		at.rep_.numChar_ = 100;
+		at.rep_.name_ = "ID";
+		at.rep_.isPrimaryKey_ = true;
+		qAttList.push_back(at);
+		onlyObjId = true;
+	}
+
+	TeAsciiFile mifFile(base+".MIF", "w+");
+	TeAsciiFile midFile(base+".MID", "w+");
+	
+	// write header;
+	mifFile.writeString("Version 300\n");
+	mifFile.writeString("Charset \"WindowsLatin1\" \n");
+	mifFile.writeString("Delimiter \";\"\n");
+	if (proj)
+	{
+		TeBox box = querier->getBox();
+		char txt[300];
+		sprintf(txt,"Bounds (%.5f, %5f) (%.5f, %5f)\n",box.x1_,box.y1_,box.x2_,box.y2_);
+		if (proj->name() == "NoProjection")
+		{
+			mifFile.writeString("CoordSys Nonearth\n");
+			mifFile.writeString("Units ");
+			mifFile.writeString(proj->units());
+			mifFile.writeNewLine();
+			mifFile.writeString(string(txt));
+		}
+		else if (proj->name() == "LatLong")
+		{
+			mifFile.writeString("CoordSys Earth Projection 1, 0 ");
+			mifFile.writeString(string(txt));
+		}
+		else
+		{
+			TeExportMIFProjection(proj, mifFile);
+			mifFile.writeString(" ");
+			mifFile.writeString(string(txt));
+		}
+	}
+	TeExportMIFAttributeList(qAttList,mifFile);
+	mifFile.writeString("Data\n");
+
+	TeTableRow row;
+	TePolygonSet	objectPols;		// polygons of the region
+	TeLineSet		objectLines;		// lines of the region
+	TePointSet		objectPoints;	// points of the region
+	TeCellSet		objectCells;	// points of the region
+
+	// progress information
+	if (TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+	int dt = CLOCKS_PER_SEC/2;
+	int dt2 = CLOCKS_PER_SEC; //* .000001;
+	unsigned int nIProcessed = 0;
+	TeSTInstance st;
+	while(querier->fetchInstance(st))
+	{
+		if (st.hasPolygons())
+			objectPols = st.getPolygons();
+		if (st.hasCells())
+			objectCells = st.getCells();
+		if (st.hasLines())
+			objectLines = st.getLines();
+		if (st.hasPoints())
+			objectPoints = st.getPoints();
+		
+		int col = 0;
+		if (objectPoints.size() > 0)
+			col++;
+		if (objectLines.size() > 0)
+			col++;
+		if (objectPols.size() > 0)
+			col++;
+		if (objectCells.size() > 0)
+			col++;
+		if (col == 0)
+		{
+			mifFile.writeString("NONE\n");
+		}
+		else
+		{
+			if (col > 1)	// it is a collection
+				mifFile.writeString("Collection " + Te2String(col) + "\n");
+
+			if (objectPols.size() > 0)
+				TeExportMIFPolygonSet(mifFile,objectPols);
+
+			if (objectLines.size() > 0)
+				TeExportMIFLineSet(mifFile,objectLines);
+
+			if (objectPoints.size() > 0)
+				TeExportMIFPointSet(mifFile,objectPoints,(col>1));
+
+			if (objectCells.size() > 0)
+				TeExportMIFCellSet(mifFile,objectCells,(col>1));
+				
+			objectCells.clear();
+			objectPols.clear();
+			objectPoints.clear();
+			objectLines.clear();
+		}
+
+		row.clear();	// export attributes
+		if (onlyObjId)
+		{
+			row.push_back(st.objectId());
+		}	
+		else
+		{
+			unsigned int aa = 0;
+			string val;
+			for (aa=0; aa<qAttList.size(); ++aa)
+			{
+				st.getPropertyValue(val,aa);
+				row.push_back(val);
+			}
+			TeExportMIFRow(row,midFile);
+		}
+		++nIProcessed;
+		t2 = clock();
+		if (TeProgress::instance() && int(t2-t1) > dt)
+		{
+			t1 = t2;
+			if(((int)(t2-t0) > dt2))
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(nIProcessed);
+			}
+		}
+	}
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	return true;
+}
+
+
+bool 
+TeExportThemeToMIF(TeTheme* theme, TeSelectedObjects selOb, const std::string& baseName)
+{
+	if (!theme)
+		return false;
+
+	string fbase = baseName;
+	if (baseName.empty())
+		fbase = theme->name();
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(theme);
+	qPar.setSelecetObjs(selOb);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToMIF(tQuerier, fbase, theme->layer()->projection());
+	delete tQuerier;
+	return res;
+}
+
+bool 
+TeExportLayerToMIF(TeLayer* layer, const string& baseName)
+{
+  	if (!layer)
+		return false;
+
+	string fbase = baseName;
+	if (baseName.empty())
+		fbase = layer->name();
+
+	TeTheme* tempTheme = new TeTheme();
+	tempTheme->layer(layer);
+	tempTheme->collectionTable("");
+	tempTheme->collectionAuxTable("");
+	tempTheme->setAttTables(layer->attrTables());
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(tempTheme);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToMIF(tQuerier, baseName, layer->projection());
+	delete tQuerier;
+	delete tempTheme;
+    return res ;
+}
+
+bool
+TeExportMIF( TeLayer* layer, const string& mifFileName, const string& tableName, const string& restriction)
+{
+	if (!layer || mifFileName.empty() || tableName.empty())
+		return false;
+	
+	// check if asked table exist
+	TeAttrTableVector& vTables = layer->attrTables();
+	TeAttrTableVector::iterator it = vTables.begin();
+	while (it != vTables.end())
+	{
+		if (it->name() == tableName) 
+			break;
+		++it;
+	}
+	if (it == vTables.end())
+		return false;
+	TeAttrTableVector askedTable;
+	askedTable.push_back(*it);
+
+	TeTheme* tempTheme = new TeTheme();
+	tempTheme->attributeRest(restriction);
+	tempTheme->layer(layer);
+	tempTheme->collectionTable("");
+	tempTheme->collectionAuxTable("");
+	tempTheme->setAttTables(askedTable);
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(tempTheme);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToMIF(tQuerier, mifFileName, layer->projection());
+	delete tQuerier;
+	delete tempTheme;
+    return res ;
+	return true;
+}
+
+void
+TeExportMIFRow(TeTableRow& row, TeAsciiFile& midFile)
+{
+	TeTableRow::iterator it = row.begin();
+	if (it != row.end())
+	{
+		midFile.writeString((*it));
+		++it;
+	}
+
+	while ( it!= row.end())
+	{
+		midFile.writeString(";"+(*it));
+		++it;
+	}
+	midFile.writeNewLine();
+}
+
+void
+TeExportMIFProjection ( TeProjection* proj, TeAsciiFile& mifFile)
+{
+	if (!proj)
+		return ;
+
+	map<string,string> mifProjCode;
+	mifProjCode["LambertConformal"] = "3";
+	mifProjCode["UTM"] = "8";
+	mifProjCode["Albers"] = "9";
+	mifProjCode["Mercator"] = "10";
+	mifProjCode["Miller"] = "11";
+	mifProjCode["Polyconic"] = "27";
+	
+	map<string,string> mifDatumCode;
+	mifDatumCode["Spherical"]="0";
+	mifDatumCode["Astro-Chua"]="23";
+	mifDatumCode["CorregoAlegre"]="24";
+	mifDatumCode["Indian"]="40";
+	mifDatumCode["NAD27"]="62";
+	mifDatumCode["SAD69"]="92";
+	mifDatumCode["WGS84"]="104";
+
+	TeProjInfo pjInfo;
+	try
+	{
+		pjInfo = TeMIFProjectionInfo (proj->name());
+	}
+	catch(...)
+	{
+		return;
+	}
+
+	mifFile.writeString("CoordSys Earth Projection ");
+	mifFile.writeString(mifProjCode[proj->name()]);
+	mifFile.writeString(", " + mifDatumCode[proj->datum().name()]);
+	
+	string mess;
+
+	if (pjInfo.hasUnits)
+		mess = ", " + proj->units();
+		
+	if ( pjInfo.hasLon0 )
+	{
+		if (!mess.empty())
+			mess += ", ";
+		mess +=  Te2String(proj->lon0()*TeCRD);
+	}
+
+	if ( pjInfo.hasLat0 )
+	{
+		if (!mess.empty())
+			mess += ", ";
+		mess += Te2String(proj->lat0()*TeCRD);
+	}
+
+	if ( pjInfo.hasStlat1 )
+	{
+		if (!mess.empty())
+			mess += ", ";
+		mess += Te2String(proj->stLat1()*TeCRD);
+	}
+
+	if ( pjInfo.hasStlat2 )
+	{
+		if (!mess.empty())
+			mess += ", ";
+		mess += Te2String(proj->stLat2()*TeCRD);
+	}
+
+	if ( pjInfo.hasScale )
+	{
+		if (!mess.empty())
+			mess += ", ";
+		mess += Te2String(proj->scale());
+	}
+
+	if ( pjInfo.hasOffx )
+	{
+		if (!mess.empty())
+			mess += ", ";
+		mess += Te2String(proj->offX());
+	}
+
+	if ( pjInfo.hasOffy )
+	{
+		if (!mess.empty())
+			mess += ", ";
+		mess += Te2String(proj->offY());
+	}
+	if (!mess.empty())
+		mifFile.writeString(mess);
+}
+
+void
+TeExportMIFAttributeList (TeAttributeList& attList, TeAsciiFile& mifFile)
+{
+	int n = attList.size();
+	mifFile.writeString("Columns " + Te2String(n));
+	mifFile.writeNewLine();
+
+	TeAttributeList::iterator it = attList.begin();
+	while ( it != attList.end())
+	{
+		TeAttribute att = *it;
+		mifFile.writeString("  "+att.rep_.name_ + " ");
+		if ( att.rep_.type_ == TeINT )
+			mifFile.writeString("Integer");
+		else if ( att.rep_.type_ == TeREAL )
+			mifFile.writeString("Float");
+		else if ( att.rep_.type_ == TeDATETIME )
+			mifFile.writeString("Char(25)"); 
+		else if ( att.rep_.type_ == TeSTRING )
+			mifFile.writeString("Char(" + Te2String(att.rep_.numChar_) + ")"); 
+		mifFile.writeNewLine();
+		++it;
+	}
+}
+
+
+int
+TeExportMIFLineSet (TeAsciiFile& mifFile, TeLineSet& lines)
+{
+	if (lines.size() == 0)
+		return 0;
+	
+	mifFile.writeString("Pline ");
+	char aux[100];
+	int n = lines.size();
+	if (n > 1)
+	{
+		sprintf(aux,"Multiple %d\n",n);
+		mifFile.writeString(string(aux));
+	}
+	for ( int i = 0; i < n; i++ )
+	{
+		TeLine2D line = lines[i];
+		sprintf(aux,"%d\n",line.size());
+		mifFile.writeString(string(aux));
+		for (unsigned int k = 0; k < line.size(); k++ )
+		{
+			sprintf(aux,"%.6f  %.6f \n", line[k].x(),line[k].y());
+			mifFile.writeString(string(aux));
+		}
+	}
+	return lines.size();
+}
+
+int 
+TeExportMIFPointSet (TeAsciiFile& mifFile, TePointSet& points, bool isMulti)
+{
+	if ( points.size() == 0 ) // layer has points
+		return 0;
+
+	int n = points.size();
+	char aux[50];
+	if (n == 1)
+	{
+		if (isMulti)
+			mifFile.writeString("Multipoint 1\n");
+		else
+			mifFile.writeString("Point ");
+		TePoint pt = points [0];
+		TeCoord2D xy = pt.location();
+		sprintf(aux,"%.6f  %.6f \n", xy.x(), xy.y());
+		mifFile.writeString(string(aux));
+	}
+	else
+	{
+		mifFile.writeString("Multipoint ");
+		sprintf(aux,"%d\n",n);
+		mifFile.writeString(string(aux));
+		unsigned int i;
+		for ( i = 0; i < points.size(); i++ )
+		{
+			TePoint pt = points [i];
+			TeCoord2D xy = pt.location();
+			sprintf(aux,"%.6f  %.6f \n", xy.x(), xy.y());
+			mifFile.writeString(string(aux));
+		}
+	}
+	return points.size();
+}
+ 
+int
+TeExportMIFPolygonSet (TeAsciiFile& mifFile, TePolygonSet& polygons)
+{
+	if (polygons.size() == 0)
+		return 0;
+	char aux[50];
+
+	unsigned int nrings = 0;
+
+	for(unsigned int j = 0; j < polygons.size(); ++j)
+	{
+		nrings += polygons[j].size();
+	}
+
+	sprintf(aux,"Region %d\n",nrings);
+	mifFile.writeString(string(aux));
+	unsigned int i;
+	for (i = 0; i < polygons.size(); i++ )
+	{
+		TePolygon poly = polygons[i];
+		unsigned int k;
+		for (k = 0; k < poly.size(); k++ )
+		{
+			TeLinearRing ring = poly[k]; 
+			sprintf(aux,"%d\n",ring.size());
+			mifFile.writeString(string(aux));
+			unsigned int l;
+			for (l = 0 ; l < ring.size(); l++)
+			{
+				sprintf(aux,"%.6f  %.6f \n", ring[l].x(), ring[l].y());
+				mifFile.writeString(string(aux));
+			}
+		}
+	}
+	return polygons.size();
+}
+
+int
+TeExportMIFCellSet (TeAsciiFile& mifFile, TeCellSet& cells, bool isColl)
+{
+	if (cells.size() == 0)
+		return 0;
+	char aux[250];
+
+	if (cells.size() > 1 || isColl)
+	{
+		sprintf(aux,"Region %d\n",cells.size());
+		mifFile.writeString(string(aux));
+		unsigned int i;
+		for (i = 0; i < cells.size(); i++ )
+		{
+			TeCell cell = cells[i];
+			TeCoord2D ll = cell.box().lowerLeft();
+			TeCoord2D ur = cell.box().upperRight();
+			mifFile.writeString("5");
+			sprintf(aux,"%.6f  %.6f \n", ll.x(), ll.y());
+			mifFile.writeString(string(aux));
+			sprintf(aux,"%.6f  %.6f \n", ur.x(), ll.y());
+			mifFile.writeString(string(aux));
+			sprintf(aux,"%.6f  %.6f \n", ur.x(), ur.y());
+			mifFile.writeString(string(aux));
+			sprintf(aux,"%.6f  %.6f \n", ll.x(), ur.y());
+			mifFile.writeString(string(aux));
+			sprintf(aux,"%.6f  %.6f \n", ll.x(), ll.y());
+			mifFile.writeString(string(aux));
+		}
+		return cells.size();
+	}
+	else
+	{
+		sprintf(aux,"Rect %.6f  %.6f %.6f  %.6f\n",
+				cells[0].box().lowerLeft().x(), cells[0].box().lowerLeft().y(),
+				cells[0].box().upperRight().x(), cells[0].box().upperRight().y());
+		mifFile.writeString(string(aux));
+		return 1;
+	}
+}
diff --git a/src/terralib/functions/TeExportSPR.cpp b/src/terralib/functions/TeExportSPR.cpp
old mode 100755
new mode 100644
index 95af712..1a3cf08
--- a/src/terralib/functions/TeExportSPR.cpp
+++ b/src/terralib/functions/TeExportSPR.cpp
@@ -1,492 +1,492 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeException.h"
-#include "TeDriverSPRING.h"
-#include "TeSPRFile.h"
-
-#include "TeDataTypes.h"
-#include "TeUtils.h"
-#include "TeLayer.h"
-#include "TeTable.h"
-#include "TeGeometry.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeDatabase.h"
-#include "TeProgress.h"
-#include "TeQuerier.h"
-#include <time.h>
-#include <stdio.h>
-
-// --- Spring
-
-bool TeExportQuerierToSPRING(TeQuerier* querier, const std::string& base, TeSpringModels cat, const string& name, 
-							 TeProjection* proj)
-{
-	// check initial conditions
-	if (!querier || base.empty())
-		return false;
-
-	if (!querier->loadInstances())
-		return false;
-	
-	// try to open the files
-	std::string baseFileName = TeGetName(base.c_str());
-	TeSPRFile* sprFileSamp = 0;
-	TeSPRFile* sprFileLin = 0;
-	TeSPRFile* sprFilePt = 0;
-	TeSPRFile* sprFileLab = 0;
-	TeSPRFile* sprFileTab = 0;
-	TeSPRFile* sprFileNet = 0;
-	TeSPRFile* sprFileNetObj = 0;
-	try
-	{
-		sprFileSamp = new TeSPRFile(baseFileName+"_L3D.spr", "w+");
-		sprFileLin = new TeSPRFile(baseFileName+"_L2D.spr", "w+");
-		sprFileLab = new TeSPRFile(baseFileName+"_LAB.spr", "w+");
-		sprFilePt = new TeSPRFile(baseFileName+"_P2D.spr", "w+");
-		sprFileTab = new TeSPRFile(baseFileName+"_TAB.spr", "w+");
-		sprFileNet = new TeSPRFile(baseFileName+"_NET.spr", "w+");
-		sprFileNetObj = new TeSPRFile(baseFileName+"_NETOBJ.spr", "w+");
-	}
-	catch (...)
-	{
-		return false;
-	}
-
-	// verify if the specific column is present
-	unsigned int qpos = 0;
-	unsigned int aa = 0;
-	unsigned int nattr;
-	TeAttributeList qAttList = querier->getAttrList();
-	nattr = qAttList.size();
-	for (aa=0; aa<nattr; ++aa)
-	{
-		if (qAttList[aa].rep_.name_ == name)
-		{
-			qpos = aa;
-			break;
-		}
-	}	
-	if (cat != TeSPRNetwork && cat != TeSPRThematic && qpos == nattr)
-		return false;	
-	
-	// write headers
-	sprFileNet->writeString("NETWORK\n");
-	sprFileSamp->writeString("SAMPLE\n");
-	sprFileLin->writeString("LINES\n");
-	sprFilePt->writeString("POINT2D\n");
-	sprFileLab->writeString("POINTS\n");
-	sprFileNetObj->writeString("NETWORK_OBJECTS\n");
-
-	sprFileNet->writeString("INFO\n");
-	sprFileSamp->writeString("INFO\n");
-	sprFileLin->writeString("INFO\n");
-	sprFilePt->writeString("INFO\n");
-	sprFileLab->writeString("INFO\n");	
-	sprFileNetObj->writeString("INFO\n");
-	if (proj)
-	{
-		string projs = "// " + proj->name() + " " + proj->describe() + " DATUM "+ proj->datum().name() + "\n";
-		sprFileSamp->writeString(projs);
-		sprFileLin->writeString(projs);
-		sprFilePt->writeString(projs);
-		sprFileLab->writeString(projs);
-		sprFileNet->writeString(projs);
-		sprFileNetObj->writeString(projs);
-	}
-	TeBox bb = querier->getBox();
-	if (bb.isValid())
-	{
-		sprFileSamp->writeBox(bb);
-		sprFileLin->writeBox(bb);
-		sprFilePt->writeBox(bb);
-		sprFileLab->writeBox(bb);
-		sprFileNet->writeBox(bb);
-		sprFileNetObj->writeBox(bb);
-	}
-	sprFileLab->writeString("SEPARATOR ;\n");
-	sprFileNetObj->writeString("SEPARATOR ;\n");
-	if (cat == TeSPRThematic || cat == TeSPRNetwork || cat == TeSPRCadastral)
-		sprFilePt->writeString("SEPARATOR ;\n");
-
-	sprFileSamp->writeInfoEnd();
-	sprFileLin->writeInfoEnd();
-	sprFilePt->writeInfoEnd();
-	sprFileLab->writeInfoEnd();
-	sprFileNet->writeInfoEnd();
-	sprFileNetObj->writeInfoEnd();
-
-	if (cat == TeSPRNetwork || cat == TeSPRCadastral)
-	{
-		sprFileTab->writeTableHeader(cat);
-		sprFileTab->writeString("CATEGORY_OBJ "); 	
-		sprFileTab->writeString(name); 
-		sprFileTab->writeString("\n"); 
-		sprFileTab->writeString("T_KEY ; TEXT; 50; 0\n");
-		sprFileTab->writeString("T_NAME ; TEXT; 50; 0\n");
-		TeAttributeList::iterator it = qAttList.begin();
-		for ( ;it != qAttList.end();++it )
-		{
-			switch ((*it).rep_.type_)
-			{
-				case TeSTRING:
-					sprFileTab->writeTextParameterInfo((*it).rep_.name_, (*it).rep_.numChar_);
-					break;
-				case TeREAL:
-					sprFileTab->writeRealParameterInfo((*it).rep_.name_);
-					break;
-				case TeINT:
-					sprFileTab->writeIntParameterInfo((*it).rep_.name_);
-					break;
-				case TeCHARACTER:
-					sprFileTab->writeTextParameterInfo((*it).rep_.name_,1);
-					break;
-				case TeDATETIME:
-					sprFileTab->writeTextParameterInfo((*it).rep_.name_,25);
-				default:
-					break;
-			}
-		}  
-		sprFileTab->writeInfoEnd();
-	}
-    
-	// variaveis auxiliares
-	TePolygonSet	objectPols;		// polygons of the region
-	TeLineSet		objectLines;	// lines of the region
-	TePointSet		objectPoints;	// points of the region
-	TeCellSet		objectCells;	// points of the region
-	unsigned int nlines2d=0, npoints2d=0, nsamps=0, nlabs=0, ntabs=0, nnetlines=1, nnetlabs=0;
-
-	bool writePointHeader = true;
-	bool endPointHeader = false;
-	unsigned int k, l;
-	unsigned int nIProcessed = 0;
-	TeSTInstance st;
-	string val;
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-	int dt = CLOCKS_PER_SEC/2;
-	int dt2 = CLOCKS_PER_SEC; //* .000001;
-	while(querier->fetchInstance(st))
-	{
-		if (st.hasPolygons())
-			objectPols = st.getPolygons();
-		if (st.hasCells())
-			objectCells = st.getCells();
-		if (st.hasLines())
-			objectLines = st.getLines();
-		if (st.hasPoints())
-			objectPoints = st.getPoints();
-
-		if (cat == TeSPRMNT ) 
-		{
-			st.getPropertyValue(val,qpos);
-			if (!objectLines.empty() && endPointHeader)
-			{
-				sprFileSamp->writeEnd();
-				endPointHeader = false;
-			}
-
-			for (aa=0; aa<objectLines.size(); ++aa)
-			{
-				sprFileSamp->writeLine3DHeader();
-				sprFileSamp->writeString("HEIGHT ");
-				sprFileSamp->writeString(val);
-				sprFileSamp->writeString("\n");
-				for (l=0; l<objectLines[aa].size(); ++l)
-					sprFileSamp->writePoint(objectLines[aa][l]);
-				sprFileSamp->writeEnd();
-				++nsamps;
-			}
-			if (!objectPoints.empty() && writePointHeader)
-			{
-				sprFileSamp->writeString("POINT3D\n");
-				writePointHeader = false;
-				endPointHeader = true;
-			}
-			for (aa=0; aa<objectPoints.size(); ++aa)
-			{
-				sprFileSamp->writePoint3D(objectPoints[aa].location().x(), objectPoints[aa].location().y(), atof(val.c_str()));
-				++nsamps;
-			}
-		}
-		else if (cat == TeSPRThematic)
-		{
-			st.getPropertyValue(val,qpos);
-			for (aa=0; aa<objectLines.size(); ++aa)
-			{
-				for (l=0; l<objectLines[aa].size(); ++l)
-					sprFileLin->writePoint(objectLines[aa][l]);
-				sprFileLin->writeString("END\n");	
-				TeCoord2D pt = TeFindCentroid(objectLines[aa]);
-				sprFileLab->writeThematicLabel(pt.x(), pt.y(),val);
-				++nlines2d;
-				++nlabs;
-			}
-			for (aa=0; aa<objectPols.size(); ++aa)
-			{
-				for (l=0; l<objectPols[aa].size(); ++l)
-				{
-					for (k=0; k<objectPols[aa][l].size(); ++k)
-						sprFileLin->writePoint(objectPols[aa][l][k]);
-					sprFileLin->writeString("END\n");
-				}
-				TeCoord2D pt = TeFindCentroid(objectPols[aa]);
-				sprFileLab->writeThematicLabel(pt.x(),pt.y(),val);
-				++nlines2d;
-				++nlabs;
-			}
-			for (aa=0; aa<objectPoints.size(); ++aa)
-			{
-				sprFilePt->writeThematicLabel(objectPoints[aa].location().x(), objectPoints[aa].location().y(),val);
-				++npoints2d;
-			}
-
-			for (aa=0; aa<objectCells.size(); ++aa)
-			{
-				TeCoord2D ll = objectCells[aa].box().lowerLeft();
-				TeCoord2D ur = objectCells[aa].box().upperRight();
-				sprFileLin->writePoint (ll);
-                TeCoord2D p1(ur.x(), ll.y());
-				sprFileLin->writePoint (p1);
-				sprFileLin->writePoint (ur);
-                TeCoord2D p2(ll.x(),ur.y());                   
-				sprFileLin->writePoint (p2);
-				sprFileLin->writePoint (ll);
-				sprFileLin->writeEnd();
-				TeCoord2D pt = TeFindCentroid(objectCells[aa]);
-				sprFileLab->writeThematicLabel(pt.x(),pt.y(),val);
-				++nlines2d;
-				++nlabs;
-			}
-		}
-		else if (cat == TeSPRNetwork)
-		{
-			for (aa=0; aa<objectLines.size(); ++aa)
-			{
-				sprFileNet->writeNetworkLineHeader(nnetlines);
-				for (l=0; l<objectLines[aa].size(); ++l)
-					sprFileNet->writePoint(objectLines[aa][l]);
-				sprFileNet->writeString("END\n");	
-				TeCoord2D pt = TeFindCentroid(objectLines[aa]);
-				sprFileNetObj->writeNetworkLabel(st.objectId(),pt.x(), pt.y(),name);
-				++nnetlines;
-				++nnetlabs;
-			}
-			
-			for (aa=0; aa<objectPoints.size(); ++aa)
-			{
-				sprFileNetObj->writeNetworkLabel(st.objectId(),objectPoints[aa].location().x(), objectPoints[aa].location().y(),name,false);
-				++nnetlabs;
-			}
-		}
-		else 
-		{
-			for (aa=0; aa<objectLines.size(); ++aa)
-			{
-				for (l=0; l<objectLines[aa].size(); ++l)
-					sprFileLin->writePoint(objectLines[aa][l]);
-				sprFileLin->writeString("END\n");	
-				TeCoord2D pt = TeFindCentroid(objectLines[aa]);
-				sprFileLab->writeCadastralLabel(st.objectId(),pt.x(), pt.y(),name);
-				++nlines2d;
-				++nlabs;
-			}
-			for (aa=0; aa<objectPols.size(); ++aa)
-			{
-				for (l=0; l<objectPols[aa].size(); ++l)
-				{
-					for (k=0; k<objectPols[aa][l].size(); ++k)
-						sprFileLin->writePoint(objectPols[aa][l][k]);
-					sprFileLin->writeString("END\n");
-				}
-				TeCoord2D pt = TeFindCentroid(objectPols[aa]);
-				sprFileLab->writeCadastralLabel(st.objectId(),pt.x(), pt.y(),name);
-				++nlines2d;
-				++nlabs;
-			}
-			for (aa=0; aa<objectPoints.size(); ++aa)
-			{
-				sprFilePt->writeCadastralLabel(st.objectId(),objectPoints[aa].location().x(), objectPoints[aa].location().y(),name);
-				++npoints2d;
-			}
-
-			for (aa=0; aa<objectCells.size(); ++aa)
-			{
-				TeCoord2D ll = objectCells[aa].box().lowerLeft();
-				TeCoord2D ur = objectCells[aa].box().upperRight();
-				sprFileLin->writePoint (ll);
-                TeCoord2D p1(ur.x(), ll.y());
-				sprFileLin->writePoint (p1);
-				sprFileLin->writePoint (ur);
-                TeCoord2D p2(ll.x(),ur.y());                   
-				sprFileLin->writePoint (p2);
-				sprFileLin->writePoint (ll);
-				sprFileLin->writeEnd();
-				TeCoord2D pt = TeFindCentroid(objectCells[aa]);
-				sprFileLab->writeCadastralLabel(st.objectId(),pt.x(), pt.y(),name);
-				++nlines2d;
-				++nlabs;
-			}
-		}
-		if (cat == TeSPRNetwork || cat == TeSPRCadastral)
-		{
-			string attline = st.objectId() + "; " + st.objectId();
-			for (aa=0; aa<nattr; ++aa)
-			{		
-				st.getPropertyValue(val,aa);
-				attline += "; ";
-				attline += val;
-			}
-			sprFileTab->writeString(attline);
-			sprFileTab->writeNewLine();
-			++ntabs;
-		}
-		++nIProcessed;
-		t2 = clock();
-		if (TeProgress::instance() && int(t2-t1) > dt)
-		{
-			t1 = t2;
-			if(((int)(t2-t0) > dt2))
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(nIProcessed);
-			}
-		}
-	}
-
-	if (endPointHeader)
-		sprFileSamp->writeString("END\n");
-
-	vector<string> filesToDelete;
-	if (nnetlines == 1)
-		filesToDelete.push_back(sprFileNet->name());
-	else
-		sprFileNet->writeEnd();
-
-	if (nnetlabs == 0)
-		filesToDelete.push_back(sprFileNetObj->name());
-	else
-		sprFileNetObj->writeEnd();
-
-	if (nlines2d == 0)
-		filesToDelete.push_back(sprFileLin->name());
-	else
-		sprFileLin->writeEnd();
-
-	if (npoints2d==0)
-		filesToDelete.push_back(sprFilePt->name());
-	else
-		sprFilePt->writeEnd();
-
-	if (nsamps==0)
-		filesToDelete.push_back(sprFileSamp->name());
-	else
-		sprFileSamp->writeEnd();
-
-	if (ntabs==0)
-		filesToDelete.push_back(sprFileTab->name());
-	else
-		sprFileTab->writeEnd();
-
-	if (nlabs==0)
-		filesToDelete.push_back(sprFileLab->name());
-	else
-		sprFileLab->writeEnd();
-
-	delete sprFileLab;
-	delete sprFilePt;
-	delete sprFileLin;
-	delete sprFileTab;
-	delete sprFileSamp;
-	delete sprFileNet;
-	delete sprFileNetObj;
-
-	for (unsigned s=0; s<filesToDelete.size();++s)
-		remove(filesToDelete[s].c_str());
-
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-bool
-TeExportSPR (TeLayer* layer, const string& sprFileName, const string& tableName, TeSpringModels cat, const string& name)
-{
-	if (tableName.empty() || sprFileName.empty())
-		return false;
-
-  	if (!layer)
-		return false;
-
-	string fbase = sprFileName;
-	if (sprFileName.empty())
-		fbase = layer->name();
-
-	TeTheme* tempTheme = new TeTheme();
-	tempTheme->layer(layer);
-	tempTheme->collectionTable("");
-	tempTheme->collectionAuxTable("");
-	TeAttrTableVector& layerTables = layer->attrTables();
-	TeAttrTableVector aTable;
-	for (unsigned int nn=0; nn<layerTables.size(); ++nn)
-	{
-		if (layerTables[nn].name() == tableName)
-		{
-			aTable.push_back(layerTables[nn]);
-			break;
-		}
-	}
-	tempTheme->setAttTables(aTable);
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(tempTheme);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToSPRING(tQuerier,fbase,cat,name,layer->projection());
-	delete tQuerier;
-	delete tempTheme;
-    return res ;
-}
-
-bool 
-TeExportThemeToSPRING(TeTheme* theme, TeSpringModels cat, const string& name, TeSelectedObjects selOb, const string& baseName)
-{
-	if (!theme)
-		return false;
-
-	string fbase = baseName;
-	if (baseName.empty())
-		fbase = theme->name();
-
-	TeQuerierParams qPar(true, true);
-	qPar.setParams(theme);
-	qPar.setSelecetObjs(selOb);
-
-	TeQuerier* tQuerier = new TeQuerier(qPar);
-	bool res = TeExportQuerierToSPRING(tQuerier,fbase,cat,name,theme->layer()->projection());
-	delete tQuerier;
-	return res;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeException.h"
+#include "TeDriverSPRING.h"
+#include "TeSPRFile.h"
+
+#include "TeDataTypes.h"
+#include "TeUtils.h"
+#include "TeLayer.h"
+#include "TeTable.h"
+#include "TeGeometry.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeDatabase.h"
+#include "TeProgress.h"
+#include "TeQuerier.h"
+#include <time.h>
+#include <stdio.h>
+
+// --- Spring
+
+bool TeExportQuerierToSPRING(TeQuerier* querier, const std::string& base, TeSpringModels cat, const string& name, 
+							 TeProjection* proj)
+{
+	// check initial conditions
+	if (!querier || base.empty())
+		return false;
+
+	if (!querier->loadInstances())
+		return false;
+	
+	// try to open the files
+	std::string baseFileName = TeGetName(base.c_str());
+	TeSPRFile* sprFileSamp = 0;
+	TeSPRFile* sprFileLin = 0;
+	TeSPRFile* sprFilePt = 0;
+	TeSPRFile* sprFileLab = 0;
+	TeSPRFile* sprFileTab = 0;
+	TeSPRFile* sprFileNet = 0;
+	TeSPRFile* sprFileNetObj = 0;
+	try
+	{
+		sprFileSamp = new TeSPRFile(baseFileName+"_L3D.spr", "w+");
+		sprFileLin = new TeSPRFile(baseFileName+"_L2D.spr", "w+");
+		sprFileLab = new TeSPRFile(baseFileName+"_LAB.spr", "w+");
+		sprFilePt = new TeSPRFile(baseFileName+"_P2D.spr", "w+");
+		sprFileTab = new TeSPRFile(baseFileName+"_TAB.spr", "w+");
+		sprFileNet = new TeSPRFile(baseFileName+"_NET.spr", "w+");
+		sprFileNetObj = new TeSPRFile(baseFileName+"_NETOBJ.spr", "w+");
+	}
+	catch (...)
+	{
+		return false;
+	}
+
+	// verify if the specific column is present
+	unsigned int qpos = 0;
+	unsigned int aa = 0;
+	unsigned int nattr;
+	TeAttributeList qAttList = querier->getAttrList();
+	nattr = qAttList.size();
+	for (aa=0; aa<nattr; ++aa)
+	{
+		if (qAttList[aa].rep_.name_ == name)
+		{
+			qpos = aa;
+			break;
+		}
+	}	
+	if (cat != TeSPRNetwork && cat != TeSPRThematic && qpos == nattr)
+		return false;	
+	
+	// write headers
+	sprFileNet->writeString("NETWORK\n");
+	sprFileSamp->writeString("SAMPLE\n");
+	sprFileLin->writeString("LINES\n");
+	sprFilePt->writeString("POINT2D\n");
+	sprFileLab->writeString("POINTS\n");
+	sprFileNetObj->writeString("NETWORK_OBJECTS\n");
+
+	sprFileNet->writeString("INFO\n");
+	sprFileSamp->writeString("INFO\n");
+	sprFileLin->writeString("INFO\n");
+	sprFilePt->writeString("INFO\n");
+	sprFileLab->writeString("INFO\n");	
+	sprFileNetObj->writeString("INFO\n");
+	if (proj)
+	{
+		string projs = "// " + proj->name() + " " + proj->describe() + " DATUM "+ proj->datum().name() + "\n";
+		sprFileSamp->writeString(projs);
+		sprFileLin->writeString(projs);
+		sprFilePt->writeString(projs);
+		sprFileLab->writeString(projs);
+		sprFileNet->writeString(projs);
+		sprFileNetObj->writeString(projs);
+	}
+	TeBox bb = querier->getBox();
+	if (bb.isValid())
+	{
+		sprFileSamp->writeBox(bb);
+		sprFileLin->writeBox(bb);
+		sprFilePt->writeBox(bb);
+		sprFileLab->writeBox(bb);
+		sprFileNet->writeBox(bb);
+		sprFileNetObj->writeBox(bb);
+	}
+	sprFileLab->writeString("SEPARATOR ;\n");
+	sprFileNetObj->writeString("SEPARATOR ;\n");
+	if (cat == TeSPRThematic || cat == TeSPRNetwork || cat == TeSPRCadastral)
+		sprFilePt->writeString("SEPARATOR ;\n");
+
+	sprFileSamp->writeInfoEnd();
+	sprFileLin->writeInfoEnd();
+	sprFilePt->writeInfoEnd();
+	sprFileLab->writeInfoEnd();
+	sprFileNet->writeInfoEnd();
+	sprFileNetObj->writeInfoEnd();
+
+	if (cat == TeSPRNetwork || cat == TeSPRCadastral)
+	{
+		sprFileTab->writeTableHeader(cat);
+		sprFileTab->writeString("CATEGORY_OBJ "); 	
+		sprFileTab->writeString(name); 
+		sprFileTab->writeString("\n"); 
+		sprFileTab->writeString("T_KEY ; TEXT; 50; 0\n");
+		sprFileTab->writeString("T_NAME ; TEXT; 50; 0\n");
+		TeAttributeList::iterator it = qAttList.begin();
+		for ( ;it != qAttList.end();++it )
+		{
+			switch ((*it).rep_.type_)
+			{
+				case TeSTRING:
+					sprFileTab->writeTextParameterInfo((*it).rep_.name_, (*it).rep_.numChar_);
+					break;
+				case TeREAL:
+					sprFileTab->writeRealParameterInfo((*it).rep_.name_);
+					break;
+				case TeINT:
+					sprFileTab->writeIntParameterInfo((*it).rep_.name_);
+					break;
+				case TeCHARACTER:
+					sprFileTab->writeTextParameterInfo((*it).rep_.name_,1);
+					break;
+				case TeDATETIME:
+					sprFileTab->writeTextParameterInfo((*it).rep_.name_,25);
+				default:
+					break;
+			}
+		}  
+		sprFileTab->writeInfoEnd();
+	}
+    
+	// variaveis auxiliares
+	TePolygonSet	objectPols;		// polygons of the region
+	TeLineSet		objectLines;	// lines of the region
+	TePointSet		objectPoints;	// points of the region
+	TeCellSet		objectCells;	// points of the region
+	unsigned int nlines2d=0, npoints2d=0, nsamps=0, nlabs=0, ntabs=0, nnetlines=1, nnetlabs=0;
+
+	bool writePointHeader = true;
+	bool endPointHeader = false;
+	unsigned int k, l;
+	unsigned int nIProcessed = 0;
+	TeSTInstance st;
+	string val;
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+	int dt = CLOCKS_PER_SEC/2;
+	int dt2 = CLOCKS_PER_SEC; //* .000001;
+	while(querier->fetchInstance(st))
+	{
+		if (st.hasPolygons())
+			objectPols = st.getPolygons();
+		if (st.hasCells())
+			objectCells = st.getCells();
+		if (st.hasLines())
+			objectLines = st.getLines();
+		if (st.hasPoints())
+			objectPoints = st.getPoints();
+
+		if (cat == TeSPRMNT ) 
+		{
+			st.getPropertyValue(val,qpos);
+			if (!objectLines.empty() && endPointHeader)
+			{
+				sprFileSamp->writeEnd();
+				endPointHeader = false;
+			}
+
+			for (aa=0; aa<objectLines.size(); ++aa)
+			{
+				sprFileSamp->writeLine3DHeader();
+				sprFileSamp->writeString("HEIGHT ");
+				sprFileSamp->writeString(val);
+				sprFileSamp->writeString("\n");
+				for (l=0; l<objectLines[aa].size(); ++l)
+					sprFileSamp->writePoint(objectLines[aa][l]);
+				sprFileSamp->writeEnd();
+				++nsamps;
+			}
+			if (!objectPoints.empty() && writePointHeader)
+			{
+				sprFileSamp->writeString("POINT3D\n");
+				writePointHeader = false;
+				endPointHeader = true;
+			}
+			for (aa=0; aa<objectPoints.size(); ++aa)
+			{
+				sprFileSamp->writePoint3D(objectPoints[aa].location().x(), objectPoints[aa].location().y(), atof(val.c_str()));
+				++nsamps;
+			}
+		}
+		else if (cat == TeSPRThematic)
+		{
+			st.getPropertyValue(val,qpos);
+			for (aa=0; aa<objectLines.size(); ++aa)
+			{
+				for (l=0; l<objectLines[aa].size(); ++l)
+					sprFileLin->writePoint(objectLines[aa][l]);
+				sprFileLin->writeString("END\n");	
+				TeCoord2D pt = TeFindCentroid(objectLines[aa]);
+				sprFileLab->writeThematicLabel(pt.x(), pt.y(),val);
+				++nlines2d;
+				++nlabs;
+			}
+			for (aa=0; aa<objectPols.size(); ++aa)
+			{
+				for (l=0; l<objectPols[aa].size(); ++l)
+				{
+					for (k=0; k<objectPols[aa][l].size(); ++k)
+						sprFileLin->writePoint(objectPols[aa][l][k]);
+					sprFileLin->writeString("END\n");
+				}
+				TeCoord2D pt = TeFindCentroid(objectPols[aa]);
+				sprFileLab->writeThematicLabel(pt.x(),pt.y(),val);
+				++nlines2d;
+				++nlabs;
+			}
+			for (aa=0; aa<objectPoints.size(); ++aa)
+			{
+				sprFilePt->writeThematicLabel(objectPoints[aa].location().x(), objectPoints[aa].location().y(),val);
+				++npoints2d;
+			}
+
+			for (aa=0; aa<objectCells.size(); ++aa)
+			{
+				TeCoord2D ll = objectCells[aa].box().lowerLeft();
+				TeCoord2D ur = objectCells[aa].box().upperRight();
+				sprFileLin->writePoint (ll);
+                TeCoord2D p1(ur.x(), ll.y());
+				sprFileLin->writePoint (p1);
+				sprFileLin->writePoint (ur);
+                TeCoord2D p2(ll.x(),ur.y());                   
+				sprFileLin->writePoint (p2);
+				sprFileLin->writePoint (ll);
+				sprFileLin->writeEnd();
+				TeCoord2D pt = TeFindCentroid(objectCells[aa]);
+				sprFileLab->writeThematicLabel(pt.x(),pt.y(),val);
+				++nlines2d;
+				++nlabs;
+			}
+		}
+		else if (cat == TeSPRNetwork)
+		{
+			for (aa=0; aa<objectLines.size(); ++aa)
+			{
+				sprFileNet->writeNetworkLineHeader(nnetlines);
+				for (l=0; l<objectLines[aa].size(); ++l)
+					sprFileNet->writePoint(objectLines[aa][l]);
+				sprFileNet->writeString("END\n");	
+				TeCoord2D pt = TeFindCentroid(objectLines[aa]);
+				sprFileNetObj->writeNetworkLabel(st.objectId(),pt.x(), pt.y(),name);
+				++nnetlines;
+				++nnetlabs;
+			}
+			
+			for (aa=0; aa<objectPoints.size(); ++aa)
+			{
+				sprFileNetObj->writeNetworkLabel(st.objectId(),objectPoints[aa].location().x(), objectPoints[aa].location().y(),name,false);
+				++nnetlabs;
+			}
+		}
+		else 
+		{
+			for (aa=0; aa<objectLines.size(); ++aa)
+			{
+				for (l=0; l<objectLines[aa].size(); ++l)
+					sprFileLin->writePoint(objectLines[aa][l]);
+				sprFileLin->writeString("END\n");	
+				TeCoord2D pt = TeFindCentroid(objectLines[aa]);
+				sprFileLab->writeCadastralLabel(st.objectId(),pt.x(), pt.y(),name);
+				++nlines2d;
+				++nlabs;
+			}
+			for (aa=0; aa<objectPols.size(); ++aa)
+			{
+				for (l=0; l<objectPols[aa].size(); ++l)
+				{
+					for (k=0; k<objectPols[aa][l].size(); ++k)
+						sprFileLin->writePoint(objectPols[aa][l][k]);
+					sprFileLin->writeString("END\n");
+				}
+				TeCoord2D pt = TeFindCentroid(objectPols[aa]);
+				sprFileLab->writeCadastralLabel(st.objectId(),pt.x(), pt.y(),name);
+				++nlines2d;
+				++nlabs;
+			}
+			for (aa=0; aa<objectPoints.size(); ++aa)
+			{
+				sprFilePt->writeCadastralLabel(st.objectId(),objectPoints[aa].location().x(), objectPoints[aa].location().y(),name);
+				++npoints2d;
+			}
+
+			for (aa=0; aa<objectCells.size(); ++aa)
+			{
+				TeCoord2D ll = objectCells[aa].box().lowerLeft();
+				TeCoord2D ur = objectCells[aa].box().upperRight();
+				sprFileLin->writePoint (ll);
+                TeCoord2D p1(ur.x(), ll.y());
+				sprFileLin->writePoint (p1);
+				sprFileLin->writePoint (ur);
+                TeCoord2D p2(ll.x(),ur.y());                   
+				sprFileLin->writePoint (p2);
+				sprFileLin->writePoint (ll);
+				sprFileLin->writeEnd();
+				TeCoord2D pt = TeFindCentroid(objectCells[aa]);
+				sprFileLab->writeCadastralLabel(st.objectId(),pt.x(), pt.y(),name);
+				++nlines2d;
+				++nlabs;
+			}
+		}
+		if (cat == TeSPRNetwork || cat == TeSPRCadastral)
+		{
+			string attline = st.objectId() + "; " + st.objectId();
+			for (aa=0; aa<nattr; ++aa)
+			{		
+				st.getPropertyValue(val,aa);
+				attline += "; ";
+				attline += val;
+			}
+			sprFileTab->writeString(attline);
+			sprFileTab->writeNewLine();
+			++ntabs;
+		}
+		++nIProcessed;
+		t2 = clock();
+		if (TeProgress::instance() && int(t2-t1) > dt)
+		{
+			t1 = t2;
+			if(((int)(t2-t0) > dt2))
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(nIProcessed);
+			}
+		}
+	}
+
+	if (endPointHeader)
+		sprFileSamp->writeString("END\n");
+
+	vector<string> filesToDelete;
+	if (nnetlines == 1)
+		filesToDelete.push_back(sprFileNet->name());
+	else
+		sprFileNet->writeEnd();
+
+	if (nnetlabs == 0)
+		filesToDelete.push_back(sprFileNetObj->name());
+	else
+		sprFileNetObj->writeEnd();
+
+	if (nlines2d == 0)
+		filesToDelete.push_back(sprFileLin->name());
+	else
+		sprFileLin->writeEnd();
+
+	if (npoints2d==0)
+		filesToDelete.push_back(sprFilePt->name());
+	else
+		sprFilePt->writeEnd();
+
+	if (nsamps==0)
+		filesToDelete.push_back(sprFileSamp->name());
+	else
+		sprFileSamp->writeEnd();
+
+	if (ntabs==0)
+		filesToDelete.push_back(sprFileTab->name());
+	else
+		sprFileTab->writeEnd();
+
+	if (nlabs==0)
+		filesToDelete.push_back(sprFileLab->name());
+	else
+		sprFileLab->writeEnd();
+
+	delete sprFileLab;
+	delete sprFilePt;
+	delete sprFileLin;
+	delete sprFileTab;
+	delete sprFileSamp;
+	delete sprFileNet;
+	delete sprFileNetObj;
+
+	for (unsigned s=0; s<filesToDelete.size();++s)
+		remove(filesToDelete[s].c_str());
+
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+bool
+TeExportSPR (TeLayer* layer, const string& sprFileName, const string& tableName, TeSpringModels cat, const string& name)
+{
+	if (tableName.empty() || sprFileName.empty())
+		return false;
+
+  	if (!layer)
+		return false;
+
+	string fbase = sprFileName;
+	if (sprFileName.empty())
+		fbase = layer->name();
+
+	TeTheme* tempTheme = new TeTheme();
+	tempTheme->layer(layer);
+	tempTheme->collectionTable("");
+	tempTheme->collectionAuxTable("");
+	TeAttrTableVector& layerTables = layer->attrTables();
+	TeAttrTableVector aTable;
+	for (unsigned int nn=0; nn<layerTables.size(); ++nn)
+	{
+		if (layerTables[nn].name() == tableName)
+		{
+			aTable.push_back(layerTables[nn]);
+			break;
+		}
+	}
+	tempTheme->setAttTables(aTable);
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(tempTheme);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToSPRING(tQuerier,fbase,cat,name,layer->projection());
+	delete tQuerier;
+	delete tempTheme;
+    return res ;
+}
+
+bool 
+TeExportThemeToSPRING(TeTheme* theme, TeSpringModels cat, const string& name, TeSelectedObjects selOb, const string& baseName)
+{
+	if (!theme)
+		return false;
+
+	string fbase = baseName;
+	if (baseName.empty())
+		fbase = theme->name();
+
+	TeQuerierParams qPar(true, true);
+	qPar.setParams(theme);
+	qPar.setSelecetObjs(selOb);
+
+	TeQuerier* tQuerier = new TeQuerier(qPar);
+	bool res = TeExportQuerierToSPRING(tQuerier,fbase,cat,name,theme->layer()->projection());
+	delete tQuerier;
+	return res;
+}
diff --git a/src/terralib/functions/TeFunctionsDefines.h b/src/terralib/functions/TeFunctionsDefines.h
new file mode 100644
index 0000000..8431410
--- /dev/null
+++ b/src/terralib/functions/TeFunctionsDefines.h
@@ -0,0 +1,49 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeFunctionsDefines.h
+    \brief Provides a set of general definitions used by te_functions project.
+*/
+#ifndef  __TERRALIB_INTERNAL_FUNCTIONSDEFINES_H
+#define  __TERRALIB_INTERNAL_FUNCTIONSDEFINES_H
+
+/** @defgroup TeFunctions_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLFUNCTIONS_AS_DLL
+#define TLFUNCTIONS_DLL __declspec(dllexport)
+#else
+#define TLFUNCTIONS_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TLFUNCTIONS_DLL
+#endif
+/** @} */ 
+
+#endif //__TERRALIB_INTERNAL_FUNCTIONSDEFINES_H
diff --git a/src/terralib/functions/TeGeoProcessingFunctions.cpp b/src/terralib/functions/TeGeoProcessingFunctions.cpp
old mode 100755
new mode 100644
index 6e7b58f..ceed7d5
--- a/src/terralib/functions/TeGeoProcessingFunctions.cpp
+++ b/src/terralib/functions/TeGeoProcessingFunctions.cpp
@@ -1,3612 +1,3621 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases
-using TerraLib.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include "TeGeoProcessingFunctions.h"
-#include "TeQuerier.h"
-#include "TeQuerierParams.h"
-#include "TeOverlay.h"
-#include "TeProgress.h"
-#include "TeVectorRemap.h"
-#include "TeDatabase.h"
-#include "TeCellAlgorithms.h"
-#include "TeAsciiFile.h"
-
-
-//-------------------------------- Auxiliary functions
-inline string getStringFromStatistic(TeStatisticType sType)
-{
-	string ss;
-
-	if(sType == TeSUM)
-		ss = "SUM";
-	else if(sType == TeMAXVALUE)
-		ss = "MAXVALUE";
-	else if(sType == TeMINVALUE)
-		ss = "MINVALUE";
-	else if(sType == TeCOUNT)
-		ss = "COUNT";
-	else if(sType == TeVALIDCOUNT)
-		ss = "VALIDCOUNT";
-	else if(sType == TeSTANDARDDEVIATION)
-		ss = "STANDARDDEVIATION";
-	else if(sType == TeKERNEL)
-		ss = "KERNEL";
-	else if(sType == TeMEAN)
-		ss = "MEAN";
-	else if(sType == TeVARIANCE)
-		ss = "VARIANCE";
-	else if(sType == TeSKEWNESS)
-		ss = "SKEWNESS";
-	else if(sType == TeKURTOSIS)
-		ss = "KURTOSIS";
-	else if(sType == TeAMPLITUDE)
-		ss = "AMPLITUDE";
-	else if(sType == TeMEDIAN)
-		ss = "MEDIAN";
-	else if(sType == TeVARCOEFF)
-		ss = "VARCOEFF";
-	else if(sType == TeMODE)
-		ss = "MODE";
-	else if(sType == TeNOSTATISTIC)
-		ss = "VALUE";
-	return ss;
-}
-
-
-inline int countNumGeometries(TeTheme* theme, TeSelectedObjects selOb)
-{
-	TeDatabase* db = theme->layer()->database();
-
-	string count;
-	TeGeomRep gRep = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
-
-    if(gRep == TePOLYGONS)
-	{
-		string tableName = theme->layer()->tableName(TePOLYGONS);
-
-		//Calculate the number of polygons to be drawn
-		string selectPolyCount; 
-
-		if(db->dbmsName()=="SqlServerAdo")
-			selectPolyCount="SELECT COUNT(DISTINCT(parent_id)) FROM ";
-		else if(db->dbmsName() != "OracleSpatial" && db->dbmsName() != "PostGIS")
-			selectPolyCount = "SELECT DISTINCT parent_id FROM ";
-		else
-			selectPolyCount = "SELECT DISTINCT geom_id FROM ";
-
-		selectPolyCount += tableName + ", " + theme->collectionTable() + " WHERE c_object_id = object_id";
-
-		if(selOb == TeSelectedByPointing)
-		{
-			selectPolyCount += " AND (c_object_status = 1 OR c_object_status = 3)";
-
-		}
-		else if(selOb == TeSelectedByQuery)
-		{
-			selectPolyCount += " AND (c_object_status = 2 OR c_object_status = 3)";
-		}
-		
-		if(db->dbmsName() =="SqlServerAdo")
-			count = selectPolyCount;
-		else if(db->dbmsName() == "PostgreSQL" || db->dbmsName() == "PostGIS")
-			count = "SELECT COUNT(*) FROM (" + selectPolyCount + ") AS r";		
-		else 
-			count = "SELECT COUNT(*) FROM (" + selectPolyCount + ")";		
-	}
-	else if(gRep == TeLINES)
-	{
-		string tableName = theme->layer()->tableName(TeLINES);
-
-		count = "SELECT COUNT(*) FROM " + tableName + ", " + theme->collectionTable();
-		count += " WHERE object_id = c_object_id";
-
-		if(selOb == TeSelectedByPointing)
-		{
-			count += " AND (c_object_status = 1 OR c_object_status = 3)";
-
-		}
-		else if(selOb == TeSelectedByQuery)
-		{
-			count += " AND (c_object_status = 2 OR c_object_status = 3)";
-		}
-	}
-	else if(gRep == TePOINTS)
-	{
-		string tableName = theme->layer()->tableName(TePOINTS);
-
-		count = "SELECT COUNT(*) FROM " + tableName + ", " + theme->collectionTable();
-		count += " WHERE object_id = c_object_id";
-
-		if(selOb == TeSelectedByPointing)
-		{
-			count += " AND (c_object_status = 1 OR c_object_status = 3)";
-
-		}
-		else if(selOb == TeSelectedByQuery)
-		{
-			count += " AND (c_object_status = 2 OR c_object_status = 3)";
-		}
-	}
-	else if(gRep == TeCELLS)
-	{
-		string tableName = theme->layer()->tableName(TeCELLS);
-
-		count = "SELECT COUNT(*) FROM " + tableName + ", " + theme->collectionTable();
-		count += " WHERE object_id = c_object_id";
-
-		if(selOb == TeSelectedByPointing)
-		{
-			count += " AND (c_object_status = 1 OR c_object_status = 3)";
-
-		}
-		else if(selOb == TeSelectedByQuery)
-		{
-			count += " AND (c_object_status = 2 OR c_object_status = 3)";
-		}
-	}
-	else
-		return -1;
-
-	TeDatabasePortal* p = db->getPortal();
-
-	if(p && p->query(count) && p->fetchRow())
-	{
-		int result = p->getInt(0);
-
-		delete p;
-		
-		return result;
-
-	}
-	
-	if(p)
-		delete p;
-
-	return -1;			
-}
-
-// objectid cell, <objectid polygon, itersection area>
-inline void insertArea(const string& cellId, const string& polId, const double& area, map<string, map<string, double> >& cellMap)
-{
-	map<string, map<string, double> >::iterator it = cellMap.find(cellId);
-
-	if(it != cellMap.end())
-	{
-// inserts into an existing entry
-		map<string, double>::iterator itpol = it->second.find(polId);
-
-		if(itpol != it->second.end())
-		{
-// polid already in index... add area
-			itpol->second = itpol->second + area;
-		}
-		else
-		{
-// inserts polid and area
-			(it->second)[polId] = area;
-		}
-
-	}
-	else
-	{
-// inserts a new entry
-		map<string, double> polMap;
-		polMap.insert(pair<string, double>(polId, area));
-		cellMap[cellId] = polMap;
-	}
-}
-
-// objectid cell, <objectid polygon, itersection area>
-inline string getMaxIntersectionArea(map<string, double>& polMap)
-{
-	string strMax;
-	double maxArea = 0.0;
-
-	map<string, double>::iterator it = polMap.begin();
-
-	if(it != polMap.end())
-	{
-		strMax = it->first;
-		maxArea = it->second;
-
-		++it;
-
-		while(it != polMap.end())
-		{
-			if(it->second > maxArea)
-			{
-				strMax = it->first;
-				maxArea = it->second;
-			}
-
-			++it;
-		}
-	}
-
-    return strMax;
-}
-
-bool insertBoundaryCells(int newId, TeLayer* outPutLayer, map<string, map<string, double> >& cellMap, TeTheme* cellTheme, TeTheme* themeTrim = 0)
-{
-	int step = 0;
-	TeTable& attTable = outPutLayer->attrTables()[0];
-	TeCellSet outputCellSet;
-
-	outputCellSet.resX(cellTheme->layer()->getRepresentation(TeCELLS)->resX_);
-	outputCellSet.resY(cellTheme->layer()->getRepresentation(TeCELLS)->resY_);
-
-	attTable.clear();
-
-	if(TeProgress::instance())
-	{
-		string caption = "Overlay Intersection";
-		string msg = "Saving Boundary. Please, wait!";
-		TeProgress::instance()->setCaption(caption.c_str());
-		TeProgress::instance()->setMessage(msg);
-		TeProgress::instance()->setTotalSteps(cellMap.size());
-	}
-	map<string, map<string, double> >::iterator it = cellMap.begin();
-
-	while(it != cellMap.end())
-	{
-		++newId;
-		step++;
-
-		string newObjId = Te2String(newId);
-
-// get cell data
-		TeQuerierParams cellParams(true, true);
-		cellParams.setParams(cellTheme, it->first);
-
-		TeQuerier cellQuerier(cellParams);
-
-		if(!cellQuerier.loadInstances())
-			return  false;
-
-		TeSTInstance cellInst;
-
-		if(!cellQuerier.fetchInstance(cellInst))
-			return false;
-		
-		TeCellSet cs;
-
-		cellInst.getGeometry(cs);
-
-		cs[0].objectId(newObjId);
-
-		outputCellSet.add(cs[0]);		
-
-// monta a linha com os valores das colunas da celula
-		TeTableRow row;
-
-		row.push_back(newObjId);
-
-		vector<string>& attrs = cellInst.getProperties();
-
-		for(int p = 0; p < (int)attrs.size(); ++p)
-			row.push_back(attrs[p]);
-
-		if(themeTrim)
-		{
-			string polId = getMaxIntersectionArea(it->second);
-
-			if(polId.empty())
-				return false;
-
-
-			TeQuerierParams trimParams(false, true);
-			trimParams.setParams(themeTrim, polId);
-
-			TeQuerier trimQuerier(trimParams);
-
-			if(!trimQuerier.loadInstances())
-				return  false;
-
-			TeSTInstance trimInst;
-
-			if(!trimQuerier.fetchInstance(trimInst))
-				return false;
-
-			vector<string>& attrstrim = trimInst.getProperties();
-
-			for(int p = 0; p < (int)attrstrim.size(); ++p)
-				row.push_back(attrstrim[p]);
-		}
-
-		attTable.add(row);
-// salva a celula e os atributos
-
-		if((newId % 100) == 0)
-		{
-			outPutLayer->addCells(outputCellSet);
-			outputCellSet.clear();
-
-			outPutLayer->saveAttributeTable(attTable);
-			attTable.clear();
-
-			if(TeProgress::instance())
-			{
-				if(TeProgress::instance()->wasCancelled())
-				{
-					TeProgress::instance()->reset();
-					return false;
-				}
-				TeProgress::instance()->setProgress(step);
-			}
-		}
-       
-		++it;
-	}
-
-	if(outputCellSet.size() > 0)
-	{
-        outPutLayer->addCells(outputCellSet);
-		outputCellSet.clear();
-	}
-
-
-	if(attTable.size() > 0)
-	{
-        outPutLayer->saveAttributeTable(attTable);
-		attTable.clear();
-	}
-
-	if(TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	return true;
-}
-
-
-
-inline bool changeAttrList(TeAttributeList& attrList)
-{
-	bool change = false;
-	
-	for(int i=0; i<(int)attrList.size(); ++i) 
-	{
-		string& nameOr = attrList[i].rep_.name_;
-	
-		attrList[i].rep_.isAutoNumber_ = false;
-		attrList[i].rep_.isPrimaryKey_ = false;
-		
-		//replace "." for "_"
-		string::size_type f = nameOr.find(".");
-		if(f != string::npos)
-		{
-			nameOr.replace(f, 1, "_");
-			change = true;
-		}
-
-		string nameTemp = TeConvertToUpperCase(nameOr);
-
-		int count = 1;
-		int j = i+1;
-		while(j<(int)attrList.size())
-		{
-			if((nameTemp == TeConvertToUpperCase(attrList[j].rep_.name_)) && (i!=j))
-			{
-				nameTemp = nameTemp +"_"+ Te2String(count);
-				nameOr = nameOr +"_"+ Te2String(count);
-
-				j = 0;
-				change = true;
-				++count;
-			}
-			++j;
-		}
-	}
-
-	return change;
-}
-
-
-inline bool multiGeometryToLayer(TeMultiGeometry& mGeom, const string& newId, TeLayer* newLayer, TeProjection* proj=0, TeGeomRep geomRep=TeGEOMETRYNONE)
-{
-	bool flag = true;
-	TeProjection* projLayer = newLayer->projection();
-	
-	if(mGeom.hasPolygons() && (geomRep==TeGEOMETRYNONE || geomRep==TePOLYGONS))  
-	{
-		TePolygonSet polSet, polSetTemp;
-		mGeom.getGeometry (polSetTemp);
-
-		if((proj) && (!((*proj) == (*projLayer))))
-		{
-			for(int i=0; i<(int)polSetTemp.size(); ++i)
-			{
-				TePolygon poly = polSetTemp[i];
-				TePolygon pout;
-				TeVectorRemap (poly, proj, pout, projLayer);
-				pout.objectId(poly.objectId());
-				polSet.add (pout);
-			}
-		}
-		else
-			polSet = polSetTemp;
-
-
-		polSet.objectId(newId);
-		flag = newLayer->addPolygons(polSet);
-	} 
-	else if (mGeom.hasLines() && (geomRep==TeGEOMETRYNONE || geomRep==TeLINES))
-	{
-		TeLineSet lineSet, lineSetTemp;
-		mGeom.getGeometry (lineSetTemp);
-
-		if((proj) && (!((*proj) == (*projLayer))))
-		{
-			for(int i=0; i<(int)lineSetTemp.size(); ++i)
-			{
-				TeLine2D line = lineSetTemp[i];
-				TeLine2D lout;
-				TeVectorRemap (line, proj, lout, projLayer);
-				lout.objectId(line.objectId());
-				lineSet.add (lout);
-			}
-		}
-		else
-			lineSet = lineSetTemp;
-
-		lineSet.objectId (newId);
-		flag = newLayer->addLines(lineSet);
-	}
-	else if (mGeom.hasPoints() && (geomRep==TeGEOMETRYNONE || geomRep==TePOINTS))
-	{
-		TePointSet pointSet, pointSetTemp;
-		mGeom.getGeometry (pointSetTemp);
-
-		if((proj) && (!((*proj) == (*projLayer))))
-		{
-			for(int i=0; i<(int)pointSetTemp.size(); ++i)
-			{
-				TePoint point = pointSetTemp[i];
-				TePoint pout;
-				TeVectorRemap (point, proj, pout, projLayer);
-				pout.objectId(point.objectId());
-				pointSet.add (pout);
-			}
-		}
-		else
-			pointSet = pointSetTemp;
-
-		pointSet.objectId (newId);
-		flag = newLayer->addPoints(pointSet);
-	}
-	else if (mGeom.hasCells() && (geomRep==TeGEOMETRYNONE || geomRep==TeCELLS))
-	{
-		TeCellSet cellSet, cellSetTemp;
-		mGeom.getGeometry (cellSetTemp);
-	
-		if((proj) && (!((*proj) == (*projLayer))))
-		{
-			for(int i=0; i<(int)cellSetTemp.size(); ++i)
-			{
-				TeCell cell = cellSetTemp[i];
-				TeCell cellout;
-				TeVectorRemap (cell, proj, cellout, projLayer);
-				cellout.objectId(cell.objectId());
-				cellSet.add (cellout);
-			}
-		}
-		else
-			cellSet = cellSetTemp;
-
-		cellSet.objectId (newId);
-		flag = newLayer->addCells(cellSet);
-	}
-//	else 
-//		return false;
-
-	return flag;
-}
-
-//-------------------------------- Main functions
-
-bool TeGeoOpAggregation(TeLayer* newLayer, TeTheme* theme, vector<string>& agregAttrVec, 
-						TeGroupingAttr& attrMM, TeSelectedObjects selOb, TeAsciiFile* logFile)		
-{
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	unsigned int i, j;
-	int	offset, steps = 0;
-	TeStatisticValMap stat;
-	TeStatisticStringValMap sstat;
-	vector<string> valVec;
-	map<int, vector<string> > stringMap;
-	map<int, vector<double> > doubleMap;
-	string geoName, query;
-	string layerName = newLayer->name();
-	TeLayer* layer = theme->layer();
-	TeDatabase* db = layer->database();
-	string CT = theme->collectionTable();
-	string OID = CT + ".c_object_id";
-
-	TeGeomRep geomRepTheme = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
-
-	TeAttributeList aList = theme->sqlAttList();
-	TeAttribute agregTeAttribute;
-	agregTeAttribute.rep_.type_ = TeSTRING;
-	agregTeAttribute.rep_.numChar_ = 200;
-	agregTeAttribute.rep_.isPrimaryKey_ = false;
-	agregTeAttribute.rep_.isAutoNumber_ = false;
-
-	map<int, string> legendLabelMap;
-	int legIndex = -1;
-
-	map<int, int> attrSQLPositionMap;	// dado o id do vetor attrMM ele devolve a posicao no portal. 
-
-/* acha o nome para a coluna (agregTeAttribute) que sempre eh acrescentada
-   ao layer de saida: a coluna formada pelos atributos usados para agrupar
- */
-	for(j=0; j<agregAttrVec.size(); ++j)
-	{
-		string name;
-		if(agregAttrVec[j] == "CURRENT LEGEND")
-		{
-			agregAttrVec[j] = CT + ".c_legend_id";
-			name = "agreg_leg_";
-			legIndex = j;
-		}
-		else
-		{	
-			for(i=0; i<aList.size(); ++i)
-			{
-				name = aList[i].rep_.name_;
-				if(name == agregAttrVec[j])
-				{
-					int f = name.find(".");
-					if(f >= 0)
-						name.replace(f, 1, "_");
-					break;
-				}
-			}
-		}
-		if(j==0)
-			agregTeAttribute.rep_.name_ += name;
-		else
-			agregTeAttribute.rep_.name_ += "_" + name;
-	}
-
-	if(agregTeAttribute.rep_.name_.size() > 30)
-		agregTeAttribute.rep_.name_ = agregTeAttribute.rep_.name_.substr(0, 30);
-
-/* o usuario quer agrupar pela legenda?
-   - se sim, montamos o legendLabelMap
- */
-	if(legIndex > -1)
-	{
-		TeLegendEntryVector& legVec = theme->legend();
-		for(i=0; i<legVec.size(); ++i)
-			legendLabelMap[legVec[i].id()] = legVec[i].label();
-	}
-
-/* montagem da lista de atributos do novo layer
- */
-	TeAttributeList attList;
-
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.name_ = "object_id_";
-	at.rep_.numChar_ = 255;
-	at.rep_.isPrimaryKey_ = true;
-	at.rep_.isAutoNumber_ = false;
-	attList.push_back(at);
-
-	attList.push_back(agregTeAttribute);
-	
-	at.rep_.type_ = TeINT;
-	at.rep_.name_ = "agreg_count_";
-	at.rep_.numChar_ = 0;
-	at.rep_.isPrimaryKey_ = false;
-	attList.push_back(at);	
-
-	TeGroupingAttr::iterator it;
-	string ss;
-	for(it=attrMM.begin(); it!=attrMM.end(); ++it)
-	{
-		string s = it->first.name_;
-		TeStatisticType sType = it->second;
-
-		ss = getStringFromStatistic(sType);
-		string sss = s + "_" + ss;
-
-		at.rep_ = it->first;
-		at.rep_.isPrimaryKey_ = false;
-
-		if(((db->dbmsName()=="OracleAdo") || 
-			(db->dbmsName()=="OracleSpatial") ) &&
-			(sss.size() > 30))
-		{
-			int s = sss.size(); 
-			at.rep_.name_ = sss.substr(s-30, s-1);
-		}
-		else
-			at.rep_.name_ = sss;
-
-		
-		if(at.rep_.type_ == TeINT)
-			at.rep_.type_ = TeREAL;
-		attList.push_back(at);	
-	}
-	
-/* faz as alteracaoes necessarias nos nomes de campos, para evitar duplicacao de nomes
-   e cria a tabela de dados
- */
-	changeAttrList(attList);
-	TeTable attTable(newLayer->name(), attList, "object_id_", "object_id_");
-
-	if(!newLayer->createAttributeTable(attTable))
-        return false;
-
-/* monta a query de selecao dos atributos nao espaciais
- */
-	string queryAtr  = "SELECT " + OID;
-
-	unsigned int lastAttrPos = 0;
-
-	for(i=0; i<agregAttrVec.size(); ++i)
-	{
-		lastAttrPos = i;
-		queryAtr += ", " + agregAttrVec[i];		
-	}
-
-	ss = "";
-
-	for(j=0; j<attrMM.size(); ++j)
-	{
-		string s = attrMM[j].first.name_;
-
-/* verifica se o atributo jah foi incluido no SELECT
- */
-		bool existedName = false;
-		
-		for(i=0; i<agregAttrVec.size(); ++i)
-		{
-			if(s == agregAttrVec[i])
-			{
-				attrSQLPositionMap[j] = i;
-				existedName=true;
-				break;
-			}
-		}
-
-		if((!existedName) && (s != ss))
-		{
-			queryAtr += ", " + s;
-			++lastAttrPos;
-			attrSQLPositionMap[j] = lastAttrPos;
-		}
-
-		ss = s;
-	}
-
-	queryAtr += theme->sqlFrom();
-
-	if(selOb == TeSelectedByPointing)
-		queryAtr += " WHERE (" + CT + ".c_object_status = 1 OR " + CT + ".c_object_status = 3)";
-	else if(selOb == TeSelectedByQuery)
-		queryAtr += " WHERE (" + CT + ".c_object_status = 2 OR " + CT + ".c_object_status = 3)";
-	queryAtr += " ORDER BY ";
-	for(i=0; i<agregAttrVec.size(); ++i)
-	{
-		queryAtr += agregAttrVec[i];
-		if (i<agregAttrVec.size()-1)
-			queryAtr += ", ";
-	}
-
-/* monta outra query para os atributos espaciais
- */
-	if(geomRepTheme == TePOLYGONS)
-		geoName = layer->tableName(TePOLYGONS);
-	else if(geomRepTheme == TeLINES)
-		geoName = layer->tableName(TeLINES);
-	else if(geomRepTheme == TePOINTS)
-		geoName = layer->tableName(TePOINTS);
-	else
-		geoName = layer->tableName(TeCELLS);
-
-	TeAttributeList geoAtList;
-	db->getAttributeList(geoName, geoAtList);
-	offset = geoAtList.size();
-
-	if((db->dbmsName()=="OracleAdo") || (db->dbmsName()=="OracleSpatial"))
-		query = "SELECT " + geoName + ".*, ATR.* FROM " + geoName + ", (" + queryAtr + ") ATR ";
-	else
-		query = "SELECT " + geoName + ".*, ATR.* FROM " + geoName + ", (" + queryAtr + ") AS ATR ";
-
-	string newOID = TeGetExtension(OID.c_str());
-
-	if(newOID.empty())
-		newOID = OID;
-
-	query += "WHERE ATR." + newOID + " = " + geoName + ".object_id";
-	query += " ORDER BY ";
-	for(i=0; i<agregAttrVec.size(); ++i)
-	{
-		string newagre = TeGetExtension(agregAttrVec[i].c_str());
-
-		if(newagre.empty())
-			newagre = agregAttrVec[i];
-
-		query += "ATR." + newagre;
-		if(i<agregAttrVec.size()-1)
-			query += ", ";
-	}
-	query += ", " + geoName + ".object_id";
-
-
-	if(geomRepTheme == TePOLYGONS)
-	{
-		if(db->dbmsName() != "OracleSpatial" && db->dbmsName() != "PostGIS")
-			query += ", " + geoName + ".parent_id, " + geoName + ".num_holes DESC";
-	}
-
-	TeDatabasePortal* portal = db->getPortal();
-
-	int total;
-	string qc = "SELECT COUNT(*) FROM " + CT;
-	if(selOb == TeSelectedByPointing)
-		qc += " WHERE " + CT + ".c_object_status = 1 OR " + CT + ".c_object_status = 3";
-	else if(selOb == TeSelectedByQuery)
-		qc += " WHERE " + CT + ".c_object_status = 2 OR " + CT + ".c_object_status = 3";
-	if(portal->query(qc) && portal->fetchRow())
-		total = atoi(portal->getData(0));
-
-	portal->freeResult();
-	if(portal->query(query) && portal->fetchRow())
-	{
-		TeAttributeList& portalAttList = portal->getAttributeList();
-
-		if(geomRepTheme == TePOLYGONS)
-			newLayer->addGeometry(TePOLYGONS);
-		else if(geomRepTheme == TeLINES)
-			newLayer->addGeometry(TeLINES);
-		else if(geomRepTheme == TePOINTS)
-			newLayer->addGeometry(TePOINTS);
-		else
-			newLayer->addGeometry(TeCELLS);
-
-		bool flag = false;
-		int count = 0;			
-		int objectId = 1;
-		string lastOid = portal->getData(offset);
-		lastOid += "aaa";
-		string lastVal;
-
-		for(i=0; i<agregAttrVec.size(); ++i)
-		{
-			string s = portal->getData(agregAttrVec[i]);
-			if(legIndex == (int)i)
-				s = legendLabelMap[atoi(s.c_str())];
-			lastVal += s;
-			if(i<agregAttrVec.size() - 1)
-				lastVal += "_";
-		}
-		
-		TePolygonSet ps;
-		TeMultiGeometry multGeom; 
-
-		if(TeProgress::instance())
-		{
-			string caption = "Aggregation";
-			TeProgress::instance()->setCaption(caption.c_str());
-			string msg = "Executing aggregation. Please, wait!";
-			TeProgress::instance()->setMessage(msg);
-			TeProgress::instance()->setTotalSteps(total);
-			t2 = clock();
-			t0 = t1 = t2;
-		}
-
-		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
-
-		do
-		{	
-			string oid = portal->getData(offset);
-			string currVal;
-			for(i=0; i<agregAttrVec.size(); ++i)
-			{
-				string s = portal->getData(agregAttrVec[i]);
-				if (legIndex == (int)i)
-					s = legendLabelMap[atoi(s.c_str())];
-				currVal += s;
-				if (i<agregAttrVec.size() - 1)
-					currVal += "_";
-			}
-
-			TePolygon p;
-			TeLine2D  l;
-			TePoint	  pt;
-			TeCell    c;
-			double	  dval;
-
-			if(lastVal == currVal)
-			{				
-				if(oid != lastOid)
-				{
-					count++;
-					//for(j=3, i=offset+(int)agregAttrVec.size()+1; i<(int)portalAttList.size(); ++i, ++j)
-					//offset + 1 = atributos da tabela de geometria + c_object_id
-					for(j=0, i=offset+1; i<portalAttList.size(); ++i, ++j)
-					{
-						string s = portal->getData(i);
-						TeAttrDataType aType = portalAttList[i].rep_.type_;
-						if(aType != TeREAL && aType != TeINT)
-							stringMap[j].push_back(s);
-						else
-						{
-							if(s.empty())
-								dval = TeMAXFLOAT;
-							else
-								dval = atof(s.c_str());
-							doubleMap[j].push_back(dval);
-						}
-					}
-				}
-
-				if(geomRepTheme == TePOLYGONS)
-				{
-					flag = portal->fetchGeometry(p);
-					multGeom.addGeometry(p);					
-				}
-				else if(geomRepTheme == TeLINES)
-				{
-					flag = portal->fetchGeometry(l);
-					multGeom.addGeometry(l);
-				}
-				else if(geomRepTheme == TePOINTS)
-				{
-					flag = portal->fetchGeometry(pt);
-					multGeom.addGeometry(pt);
-				}
-				else
-				{
-					flag = portal->fetchGeometry(c);
-					multGeom.addGeometry(c);
-				}
-			}
-			else  
-			{
-				if(multGeom.hasPolygons())
-				{
-					TePolygonSet polSetValidHoles;
-			
-					if(!TeOVERLAY::TeValidPolygonHoles(multGeom.getPolygons(), polSetValidHoles))
-					{
-						if(TeProgress::instance())
-							TeProgress::instance()->reset();
-
-						delete portal;
-						return false; 
-					}
-
-					TePolygonSet psetOut;
-
-					if(!TeOVERLAY::TeUnion(polSetValidHoles, psetOut))
-					{
-						// when the operation returns false, write in the log a possible
-						// inconsistency in the data
-						if (logFile)
-						{
-							string mess = "Possivel inconsistencia na uniao dos objetos da classe: ";
-							mess += lastVal;
-							logFile->writeString(mess);
-							logFile->writeNewLine();
-						}
-					}
-
-					multGeom.setGeometry(psetOut);
-				}
-
-				if(!multiGeometryToLayer(multGeom, Te2String(objectId), newLayer))
-				{
-					if(TeProgress::instance())
-						TeProgress::instance()->reset();
-
-					delete portal;
-					return false; 
-				}
-
-
-				std::map<int, TeStatisticValMap> statAux;
-				std::map<int, TeStatisticStringValMap> sstatAux;
-
-				valVec.push_back(Te2String(objectId));
-				valVec.push_back(lastVal);
-				valVec.push_back(Te2String(count));
-
-				string currAttr = "";
-				int attPos = 0;
-				for(i=0; i<attrMM.size(); ++i)
-				{
-					if (currAttr != attrMM[i].first.name_)
-					{
-						stat.clear();
-						sstat.clear();
-						attPos = attrSQLPositionMap[i];		
-						currAttr = attrMM[i].first.name_;
-					}
-
-					if(attrMM[i].first.type_ == TeREAL || attrMM[i].first.type_ == TeINT)
-					{
-						std::map<int, TeStatisticValMap>::iterator it = statAux.find(attPos);
-
-						if(it != statAux.end())
-						{
-							double d = (it->second)[attrMM[i].second];
-							valVec.push_back(Te2String(d, 16));
-						}
-						else
-						{
-							TeCalculateStatistics(doubleMap[attPos].begin(), doubleMap[attPos].end(), stat);
-							statAux[attPos] = stat;
-							double d = stat[attrMM[i].second];
-							valVec.push_back(Te2String(d, 16));
-						}
-					}
-					else
-					{
-						std::map<int, TeStatisticStringValMap>::iterator it = sstatAux.find(attPos);
-
-						if(it != sstatAux.end())
-						{
-							string s = (it->second)[attrMM[i].second];
-							valVec.push_back(s);
-						}
-						else
-						{
-							TeCalculateStatistics(stringMap[attPos].begin(), stringMap[attPos].end(), sstat);
-							sstatAux[attPos] = sstat;
-							string s = sstat[attrMM[i].second];
-							valVec.push_back(s);
-						}						
-					}
-				}
-
-				TeTableRow row;
-				for(i=0; i<valVec.size(); ++i)
-					row.push_back(valVec[i]);
-				attTable.add(row);
-
-				valVec.clear();
-				stringMap.clear();
-				doubleMap.clear();
-				count = 0;
-				ps.clear();
-				multGeom.clear();
-				
-				if(oid != lastOid)	// poderia ser igual???? Veja que aqui estamos no else do bloco oid == lastOid!!!!
-				{
-					count++;
-					for(j=0, i=offset+1; i<portalAttList.size(); ++i, ++j)
-					{
-						string s = portal->getData(i);
-						TeAttrDataType aType = portalAttList[i].rep_.type_;
-						if(aType != TeREAL && aType != TeINT)
-							stringMap[j].push_back(s);
-						else
-						{
-							if(s.empty())
-								dval = TeMAXFLOAT;
-							else
-								dval = atof(s.c_str());
-							doubleMap[j].push_back(dval);
-						}
-					}
-				}
-
-				if(geomRepTheme == TePOLYGONS)
-				{
-					flag = portal->fetchGeometry(p);
-					multGeom.addGeometry(p);					
-				}
-				else if(geomRepTheme == TeLINES)
-				{
-					flag = portal->fetchGeometry(l);
-					multGeom.addGeometry(l);
-				}
-				else if(geomRepTheme == TePOINTS)
-				{
-					flag = portal->fetchGeometry(pt);
-					multGeom.addGeometry(pt);
-				}
-				else
-				{
-					flag = portal->fetchGeometry(c);
-					multGeom.addGeometry(c);
-				}
-
-				++objectId;
-			}
-
-			if((oid != lastOid) && TeProgress::instance())
-			{
-				steps++;
-				t2 = clock();
-				if (int(t2-t1) > dt)
-				{
-					t1 = t2;
-					if(TeProgress::instance()->wasCancelled())
-					{
-						TeProgress::instance()->reset();
-						delete portal;
-						return false;
-					}
-					
-					if((int)(t2-t0) > dt2)
-						TeProgress::instance()->setProgress(steps);
-				}
-			}
-			lastOid = oid;
-			lastVal = currVal;
-
-		}while(flag);
-		if(TeProgress::instance())
-			TeProgress::instance()->reset();
-
-		if(!multGeom.empty())  
-		{
-			if(multGeom.hasPolygons())
-			{
-					TePolygonSet polSetValidHoles;
-					
-					if(!TeOVERLAY::TeValidPolygonHoles(multGeom.getPolygons(), polSetValidHoles))
-					{
-						if(TeProgress::instance())
-							TeProgress::instance()->reset();
-
-						delete portal;
-						return false; 
-					}
-
-					TePolygonSet psetOut;
-
-					if(!TeOVERLAY::TeUnion(polSetValidHoles, psetOut))
-					{
-						// when the operation returns false, write in the log a possible
-						// inconsistency in the data
-						if (logFile)
-						{
-							string mess = "Possivel inconsistencia na uniao dos objetos da classe: ";
-							mess += lastVal;
-							logFile->writeString(mess);
-							logFile->writeNewLine();
-						}
-					}
-
-					multGeom.setGeometry(psetOut);
-			}
-
-			if(!multiGeometryToLayer(multGeom, Te2String(objectId), newLayer))
-			{
-				if(TeProgress::instance())
-					TeProgress::instance()->reset();
-
-				delete portal;
-				return false; 
-			}
-
-			std::map<int, TeStatisticValMap> statAux;
-			std::map<int, TeStatisticStringValMap> sstatAux;
-
-			valVec.push_back(Te2String(objectId));
-			valVec.push_back(lastVal);
-			valVec.push_back(Te2String(count));
-			string currAttr = "";
-			int attPos = 0;
-			for(i = 0; i <attrMM.size(); ++i)
-			{
-				if (currAttr != attrMM[i].first.name_)
-				{
-					stat.clear();
-					sstat.clear();
-					attPos = attrSQLPositionMap[i];		
-					currAttr = attrMM[i].first.name_;
-				}
-				if(attrMM[i].first.type_ == TeREAL || attrMM[i].first.type_ == TeINT)
-				{
-					std::map<int, TeStatisticValMap>::iterator it = statAux.find(attPos);
-
-					if(it != statAux.end())
-					{
-						double d = (it->second)[attrMM[i].second];
-						valVec.push_back(Te2String(d, 16));
-					}
-					else
-					{
-                        TeCalculateStatistics(doubleMap[attPos].begin(), doubleMap[attPos].end(), stat);
-						statAux[attPos] = stat;
-						double d = stat[attrMM[i].second];
-						valVec.push_back(Te2String(d, 16));
-					}
-				}
-				else
-				{
-					std::map<int, TeStatisticStringValMap>::iterator it = sstatAux.find(attPos);
-
-					if(it != sstatAux.end())
-					{
-						string s = (it->second)[attrMM[i].second];
-						valVec.push_back(s);
-					}
-					else
-					{
-                        TeCalculateStatistics(stringMap[attPos].begin(), stringMap[attPos].end(), sstat);
-						sstatAux[attPos] = sstat;
-						string s = sstat[attrMM[i].second];
-						valVec.push_back(s);
-					}						
-				}
-			}	
-
-			TeTableRow row;
-			for(i=0; i<valVec.size(); ++i)
-				row.push_back(valVec[i]);
-			attTable.add(row);
-
-			valVec.clear();
-			stringMap.clear();
-			doubleMap.clear();
-			count = 0;
-			ps.clear();
-			multGeom.clear();
-		}			
-
-		newLayer->saveAttributeTable(attTable);
-	}
-	else
-	{
-		delete portal;
-		return false;
-	}
-
-	delete portal;
-	return true;
-}
-
-
-bool TeGeoOpAdd(TeLayer* newLayer, TeTheme* theme, vector<TeTheme*> themeVec, 
-				TeSelectedObjects selOb,TeAsciiFile* /* logFile */)
-{
-	
-	bool insertAttr = false;
-	
-	// create attribute table from main theme
-	TeAttributeList attrList;
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.name_ = "object_id_"+ Te2String(newLayer->id());
-	at.rep_.numChar_ = 255;
-	at.rep_.isPrimaryKey_ = true;
-	at.rep_.isAutoNumber_ = false;
-	attrList.push_back(at);
-
-	//main theme
-	TeQuerierParams mainParams(true, true);
-	mainParams.setParams(theme);
-	mainParams.setSelecetObjs(selOb);
-	TeQuerier* mainQuerier = new TeQuerier(mainParams);
-
-	TeGeomRep themeGeomRep = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
-
-	if(!mainQuerier->loadInstances())
-		return false;
-
-	//get attribute list from querier
-	TeAttributeList attribs = mainQuerier->getAttrList();
-	TeAttributeList::iterator it = attribs.begin();
-	while(it != attribs.end())
-	{
-		attrList.push_back (*it);
-		++it;
-	}
-
-	//verify if there are duplicate names
-	changeAttrList(attrList);
-	attrList[0].rep_.isPrimaryKey_ = true;  //link attribute is primary key
-		
-	// --------- create table 
-	TeTable attrTable (newLayer->name(), attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
-
-	if(!newLayer->createAttributeTable(attrTable))
-        return false;
-
-	int newId = 0;
-
-	// ---------------------------------- Begin main theme
-	TeSTInstance st;
-	while(mainQuerier->fetchInstance(st))
-	{
-		TeTableRow row;
-		vector<string>& vect = st.getProperties();
-		row.push_back(Te2String(++newId));
-
-		//insert os valores do tema principal
-		for(int p=0; p<(int)vect.size();++p)
-			row.push_back(vect[p]);
-
-		attrTable.add(row);
-				
-		//insert in this layer only the visible geometries of the theme 
-		if(!multiGeometryToLayer(st.geometries(), Te2String(newId), newLayer, 0, themeGeomRep))
-			return false; 
-		
-		if((newId%100)==0)
-		{
-			//insert attributes
-			newLayer->saveAttributeTable(attrTable); //save 100 records!!!
-			if(attrTable.size()>0)
-				insertAttr = true;
-			attrTable.clear();
-		}
-	} 	//while fetchInstance no querier
-
-	
-	// save the last records 
-	newLayer->saveAttributeTable(attrTable); 
-	if(attrTable.size()>0)
-		insertAttr = true;
-	attrTable.clear();
-	st.clear();
-	delete mainQuerier;
-
-	// ---------------------------------- End main theme
-
-	for(int i=0; i<(int)themeVec.size(); ++i)
-	{
-		TeTheme* temp = themeVec[i];
-		TeProjection* projTemp = temp->layer()->projection();
-		
-		TeQuerierParams params(true, true);
-
-		params.setParams(temp);
-		params.setSelecetObjs (selOb);
-		TeQuerier* querier = new TeQuerier(params);
-
-		TeGeomRep tempGeomRep = (TeGeomRep)(temp->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
-
-		if(!querier->loadInstances())
-			return false;
-
-		attribs.clear();
-		attribs = querier->getAttrList();
-		vector<int> indexVec;
-
-		for(int k=0; k<(int)attrList.size(); ++k)
-		{
-			string name = attrList[k].rep_.name_;
-			int ind = -1;
-			
-			for(int p=0; p<(int)attribs.size();++p)
-			{
-				if(TeConvertToUpperCase(name) == TeConvertToUpperCase(attribs[p].rep_.name_))
-				{
-					ind = p;
-					break;
-				}
-			}
-
-			indexVec.push_back(ind);
-		}
-					
-		while(querier->fetchInstance(st))
-		{
-			TeTableRow row;
-			vector<string>& vect = st.getProperties();
-			row.push_back(Te2String(++newId));
-
-			//insert the values when the names are equals
-			for(int p=1; p<(int)attrList.size();++p)
-			{
-				int s = indexVec[p];
-				if(s<0)
-					row.push_back("");
-				else
-					row.push_back(vect[s]);
-			}
-
-			attrTable.add(row);
-					
-			if(!multiGeometryToLayer(st.geometries(), Te2String(newId), newLayer, projTemp, tempGeomRep))
-				return false; 
-										
-			if((newId%100)==0)
-			{
-				//insert attributes
-				newLayer->saveAttributeTable(attrTable); //save 100 records!!!
-				if(attrTable.size()>0)
-					insertAttr = true;
-				attrTable.clear();
-			}
-		}  //while fetchInstance no querier
-	
-		newLayer->saveAttributeTable(attrTable); //save the last records!!!
-		if(attrTable.size()>0)
-			insertAttr = true;
-		attrTable.clear();
-		st.clear();
-	}
-
-	if(!newLayer->box().isValid())
-		return false;
-
-	if(!insertAttr)
-		return false; 
-
-	return true;
-}
-
-bool TeGeoOpOverlayIntersection(TeLayer* newLayer, TeTheme* theme, TeTheme* themeTrim, 
-								TeSelectedObjects selOb, TeSelectedObjects selObTrim, 
-								bool attrTrim, TeAsciiFile* logFile)
-{
-	if((!newLayer) || (!theme) || (!themeTrim))
-		return false;
-
-// check the theme with less polygons
-	bool invert = false;
-
-	TeGeomRep geomRepTheme = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
-	TeGeomRep geomRepThemeTrim = (TeGeomRep)(themeTrim->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
-
-	if((geomRepTheme == TePOLYGONS) && (geomRepThemeTrim==TePOLYGONS))
-	{
-		int themeCount = countNumGeometries(theme, selOb);
-		int themeTrimCount = countNumGeometries(themeTrim, selObTrim);
-
-		if(themeTrimCount > themeCount)
-		{
-			if(geomRepTheme == TePOLYGONS)
-			{
-				invert = true;
-
-				TeTheme* aux = theme;
-				theme = themeTrim;
-				themeTrim = aux;
-			}
-		}
-	}
-
-	bool insertAttr = false;
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-		
-	// ----------------- begin create attribute table
-
-	TeAttributeList attrList;
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.name_ = "object_id_"+ Te2String(newLayer->id());
-	at.rep_.numChar_ = 255;
-	at.rep_.isPrimaryKey_ = true;
-	at.rep_.isAutoNumber_ = false;
-	attrList.push_back(at);
-
-	TeAttrTableVector attrTablesAux;
-
-	if(invert)
-		themeTrim->getAttTables(attrTablesAux, TeAttrStatic);		
-	else
-		theme->getAttTables(attrTablesAux, TeAttrStatic);		
-
-	for(unsigned int idx = 0; idx < attrTablesAux.size(); ++idx)
-	{
-		TeAttributeList& attlistAux = attrTablesAux[idx].attributeList();
-
-		TeAttributeList::iterator it = attlistAux.begin();
-
-		while(it != attlistAux.end())
-		{
-			TeAttribute at = *it;
-			at.rep_.isPrimaryKey_ = false;
-
-			attrList.push_back(at);
-			++it;
-		}
-	}
-
-	attrTablesAux.clear();
-
-	if(attrTrim)
-	{
-		if(invert)
-			theme->getAttTables(attrTablesAux, TeAttrStatic);	
-		else
-			themeTrim->getAttTables(attrTablesAux, TeAttrStatic);	
-
-		for(unsigned int idx = 0; idx < attrTablesAux.size(); ++idx)
-		{
-			TeAttributeList& attlistAux = attrTablesAux[idx].attributeList();
-
-			TeAttributeList::iterator it = attlistAux.begin();
-
-			while(it != attlistAux.end())
-			{
-				TeAttribute at = *it;
-				at.rep_.isPrimaryKey_ = false;
-
-				attrList.push_back(at);
-				++it;
-			}
-		}
-	}	
-
-	changeAttrList(attrList);
-
-	attrList[0].rep_.isPrimaryKey_ = true;  //link attribute is primary key
-	
-	TeTable attrTable(newLayer->name(), attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
-
-	if(!newLayer->createAttributeTable(attrTable))
-        return false;
-
-// query geometries
-
-	TeLayer* layer = theme->layer();
-	TeLayer* layerTrim = themeTrim->layer();
-
-	TeProjection* proj = layer->projection();
-	TeProjection* projTrim = layerTrim->projection();
-
-	//Querier Trim
-	TeQuerierParams paramsTrim(true, true);
-	paramsTrim.setParams(themeTrim);
-
-	if(invert)
-		paramsTrim.setSelecetObjs(selOb);
-	else
-		paramsTrim.setSelecetObjs(selObTrim);
-
-	TeQuerier  querierTrim(paramsTrim); 
-
-	if(!querierTrim.loadInstances())
-		return  false;
-	
-	// ----------------- End create attribute table
-	int numPolygonsTrim = querierTrim.numElemInstances();
-	// set progress bar
-	if(TeProgress::instance())
-	{
-		string caption = "Overlay Intersection";
-		string msg = "Executing Overlay Intersection. Please, wait!";
-		TeProgress::instance()->setCaption(caption.c_str());
-		TeProgress::instance()->setMessage(msg);
-		TeProgress::instance()->setTotalSteps(numPolygonsTrim);
-		t2 = clock();
-		t0 = t1 = t2;
-	}
-
-	double tol = TeGetPrecision(proj);
-	TePrecision::instance().setPrecision(tol);
-
-	int steps = 0;
-	TeSTInstance trim;
-	int newId = 0;
-
-// this map stores the id of boundary cells, that we need to decide atribute value
-	map<string, map<string, double> > cellMap;
-
-	while(querierTrim.fetchInstance(trim))
-	{
-		TePolygonSet polSet;
-		if(!trim.getGeometry(polSet))
-			continue;
-
-		TeTableRow rowTrim;
-		if(invert || attrTrim)
-		{
-			//fill attribute values from trim
-			vector<string>& vecTrim = trim.getProperties();
-
-			for(int p=0; p<(int)vecTrim.size();++p)
-				rowTrim.push_back(vecTrim[p]);
-		}
-
-		TePolygonSet ps;
-		TeLineSet	ls;
-		TePointSet pts;
-		TeCellSet cs;
-
-		for(int i=0; i<(int)polSet.size(); ++i)
-		{
-			TePolygon polyTrim = polSet[i];
-						
-			if(!((*proj) == (*projTrim)))
-			{
-				TePolygon pout;
-				TeVectorRemap (polyTrim, projTrim, pout, proj);
-				polyTrim = pout;
-				polyTrim.objectId(polSet[i].objectId());
-			}
-
-			// before intersection, valid polygon holes (union of holes)
-			TePolygonSet polyTrimSet;
-			if(!TeOVERLAY::TeValidPolygonHoles(polyTrim, polyTrimSet))
-			{
-				// when the operation returns false, write in the log a possible
-				// inconsistency in the data
-				if (logFile)
-				{
-					string mess = "Nao foi possivel realizar a consistencia dos aneis internos ";
-					mess += polyTrim.objectId();
-					mess += " do tema " + themeTrim->name() + ".";
-					logFile->writeString(mess);
-					logFile->writeNewLine();
-				}
-
-				continue;
-			}
-
-			TeBox boxTrim = polyTrim.box();
-
-			//Querier - theme that will be clip
-			TeQuerierParams params(true, true);
-			params.setParams(theme);
-
-			if(invert)
-				params.setSelecetObjs(selObTrim);
-			else
-				params.setSelecetObjs(selOb);
-
-			params.setSpatialRest(boxTrim, TeINTERSECTS, geomRepTheme);
-
-			TeQuerier querier(params);
-
-			if(!querier.loadInstances())
-				continue;
-			
-			TeSTInstance sti;
-			while(querier.fetchInstance(sti))
-			{
-				TeTableRow row;
-				vector<string>& vect = sti.getProperties();
-				row.push_back("");
-
-				if(invert)
-				{
-					for(int i=0; i<(int)rowTrim.size(); ++i)
-						row.push_back(rowTrim[i]);
-
-					if(attrTrim)
-					{
-						//insert values of the theme that is been clip 
-						for(int p=0; p<(int)vect.size();++p)
-							row.push_back(vect[p]);
-					}
-				}
-				else
-				{
-					//insert values of the theme that is been clip 
-					for(int p=0; p<(int)vect.size();++p)
-						row.push_back(vect[p]);
-
-					if(attrTrim)
-					{
-						for(int i=0; i<(int)rowTrim.size(); ++i)
-							row.push_back(rowTrim[i]);
-					}
-				}	
-				
-				if(sti.hasPolygons() && (geomRepTheme==TePOLYGONS))
-				{
-					TePolygonSet polSetTheme;
-					sti.getGeometry (polSetTheme);
-					TePolygonSet polSetAux;
-					TePolygonSet resultPS;
-
-					for(int j=0; j<(int)polSetTheme.size(); ++j)
-					{
-						if(TeIntersects(polSetTheme[j].box(), polyTrim.box()))
-							polSetAux.add(polSetTheme[j]);
-					}
-
-					// before intersection, valid polygon holes (union of holes)
-					TePolygonSet polSetValidHoles;
-					if(!TeOVERLAY::TeValidPolygonHoles(polSetAux, polSetValidHoles))
-					{
-						// when the operation returns false, write in the log a possible
-						// inconsistency in the data
-						if (logFile)
-						{
-							string mess = "Nao foi possivel realizar a consistencia dos aneis internos ";
-							mess += polyTrim.objectId();
-							mess += " do tema " + themeTrim->name() + " e ";
-							mess += polSetTheme[0].objectId();
-							mess += theme->name();
-							logFile->writeString(mess);
-							logFile->writeNewLine();
-						}
-
-						continue;
-					}
-
-					if(!TeOVERLAY::TeIntersection(polyTrimSet, polSetValidHoles, resultPS))
-					{
-						// when the operation returns false, write in the log a possible
-						// inconsistency in the data
-						if (logFile)
-						{
-							string mess = "Possivel inconsistencia na interseccao do objeto ";
-							mess += polyTrim.objectId();
-							mess += " do tema " + themeTrim->name() + " e ";
-							mess += polSetTheme[0].objectId();
-							mess += theme->name();
-							logFile->writeString(mess);
-							logFile->writeNewLine();
-						}
-					}
-
-					if(resultPS.empty())
-						continue;
-
-					newId++;
-					string strnewid = Te2String(newId);
-					row[0] = strnewid;
-					attrTable.add(row);
-
-					for(int c=0; c<(int)resultPS.size(); ++c)
-					{							
-						resultPS[c].objectId(strnewid);
-						ps.add(resultPS[c]);
-					}
-				}
-				else if (sti.hasLines() && (geomRepTheme==TeLINES))
-				{
-					TeLineSet lineSet;
-					sti.getGeometry (lineSet);
-
-					for(int j=0; j<(int)lineSet.size(); ++j)
-					{
-						TeLineSet lsAux, resultLS;
-						TeMultiGeometry resultMGEOM;
-						lsAux.add(lineSet[j]);
-						resultMGEOM = TeOVERLAY::TeIntersection(lsAux, polyTrimSet);
-
-						resultMGEOM.getGeometry(resultLS);
-						
-						for(int c=0; c<(int)resultLS.size(); ++c)
-						{
-							newId++;
-							TeLine2D laux = resultLS[c];
-							laux.objectId(Te2String(newId));
-
-							ls.add(laux);
-							row[0] = Te2String(newId);
-							attrTable.add(row);
-						}
-					}
-				}
-				else if (sti.hasPoints() && (geomRepTheme==TePOINTS))
-				{
-					TePointSet pointSet;
-					sti.getGeometry (pointSet);
-
-					for(int j=0; j<(int)pointSet.size(); ++j)
-					{
-						if(TeWithin(pointSet[j], polyTrim))
-						{
-							newId++;
-							pointSet[j].objectId(Te2String(newId));
-							pts.add(pointSet[j]);
-							row[0] = Te2String(newId);
-							attrTable.add(row);
-						}
-					}
-				}
-				else if (sti.hasCells() && (geomRepTheme==TeCELLS))
-				{
-					TeCellSet cellSet;
-					sti.getGeometry (cellSet);					
-
-					for(int j=0; j<(int)cellSet.size(); ++j)
-					{
-						TePolygon pCell = TeMakePolygon(cellSet[j].box());
-						
-						short rel = TeRelation(pCell, polyTrim);
-
-						if((rel & TeWITHIN) || (rel & TeCOVEREDBY))
-						{
-							newId++;
-							cellSet[j].objectId(Te2String(newId));
-							cs.add(cellSet[j]);
-							row[0] = Te2String(newId);
-							attrTable.add(row);
-						}
-						else
-						{							
-							TePolygonSet pCells;
-							pCells.add(pCell);
-							TePolygonSet resultPS;
-
-							if(!TeOVERLAY::TeIntersection(pCells, polyTrimSet, resultPS))
-							{
-								// when the operation returns false, write in the log a possible
-								// inconsistency in the data
-								if(logFile)
-								{
-									string mess = "Possivel inconsistencia na interseccao do objeto ";
-									mess += polyTrim.objectId();
-									mess += " do tema " + themeTrim->name() + " e ";
-									mess += cellSet[j].objectId();
-									mess += theme->name();
-									logFile->writeString(mess);
-									logFile->writeNewLine();
-								}
-
-								continue;
-							}
-
-							if(resultPS.empty())
-								continue;
-
-							double area = TeGeometryArea(resultPS);
-
-							insertArea(cellSet[j].objectId(), polyTrim.objectId(), area, cellMap);
-						}
-					}
-
-				}
-			} //while fetchInstance 
-		}//for each polygon of the Trim theme
-
-		//inserir a geometria no banco
-		if(geomRepTheme == TePOLYGONS && ps.size())
-			newLayer->addPolygons(ps);
-		else if(geomRepTheme == TeLINES && ls.size())
-			newLayer->addLines(ls);
-		else if(geomRepTheme == TePOINTS && pts.size())
-			newLayer->addPoints(pts);
-		else if(cs.size())
-		{
-			cs.resX(theme->layer()->getRepresentation(TeCELLS)->resX_);
-			cs.resY(theme->layer()->getRepresentation(TeCELLS)->resY_);
-			newLayer->addCells(cs);
-		}
-
-		trim.clear();
-
-		steps++;
-		t2 = clock();
-		if ((TeProgress::instance()) && (int(t2-t1) > dt))
-		{
-			t1 = t2;
-			if(TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			if((int)(t2-t0) > dt2)
-				TeProgress::instance()->setProgress(steps);
-		}
-
-		if((steps%100)==0)
-		{
-			newLayer->saveAttributeTable(attrTable); //save 100 records!!!
-			if(attrTable.size()>0)
-				insertAttr = true;
-			attrTable.clear();
-		}
-	} //while fetch instance querier Trim
-
-	newLayer->saveAttributeTable(attrTable); //save the last records!!!
-	if(attrTable.size()>0)
-		insertAttr = true;
-
-	if(TeProgress::instance())
-			TeProgress::instance()->reset();
-
-	if(!cellMap.empty())
-	{
-		bool res = false;
-		if(attrTrim)
-			res = insertBoundaryCells(newId, newLayer, cellMap, theme, themeTrim);
-		else
-			res = insertBoundaryCells(newId, newLayer, cellMap, theme, 0);
-
-		if(!res)
-		{
-			if(TeProgress::instance())
-				TeProgress::instance()->reset();
-
-			return false;
-		}
-	}
-
-	if(!newLayer->box().isValid())
-		return false;
-
-	if(!insertAttr)
-		return false; 
-
-	return true;
-}
-
-bool TeGeoOpAssignDataLocationDistribute(TeTheme* themeMod, TeTheme* theme, const string& tableName, 
-										 const int& spatialRelation, const vector<string>& attributes)
-{
-	if((!themeMod) || (!themeMod->layer()) ||  (!theme))
-		return false;
-
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-
-	TeLayer* layerMod = themeMod->layer();	
-	TeProjection* projMod = layerMod->projection();
-	TeProjection* proj = theme->layer()->projection();
-	
-	TeGeomRep geomRepThemeMod = (TeGeomRep)(themeMod->visibleGeoRep() & ~TeTEXT);
-	TeGeomRep geomRepTheme = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT);
-
-	//Querier from theme 
-	TeQuerierParams params(true, true);
-	params.setParams(theme);
-	if (!attributes.empty())
-		params.setFillParams(true,false,attributes);
-	TeQuerier  querier(params); 
-
-	if(!querier.loadInstances())
-		return  false;
-
-	// ----------------- begin create attribute table
-
-	TeAttributeList attrList;
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.name_ = "object_id_";
-	at.rep_.numChar_ = 255;
-	at.rep_.isPrimaryKey_ = true;
-	at.rep_.isAutoNumber_ = false;
-	attrList.push_back(at);
-
-	//get attribute list from querier
-	TeAttributeList attribs = querier.getAttrList();
-	TeAttributeList::iterator it = attribs.begin();
-	while(it != attribs.end())
-	{
-		attrList.push_back (*it);
-		++it;
-	}
-						
-	changeAttrList(attrList);
-	attrList[0].rep_.isPrimaryKey_ = true;  //link attribute is primary key
-	
-	TeTable attrTable (tableName, attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
-
-	if(!layerMod->createAttributeTable(attrTable))
-        return false;
-
-	//empty rows
-	TeTable updateAttrTable (tableName, attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
-	
-	// ----------------- End create attribute table
-	vector<string> objIds;
-	if( (geomRepTheme == TePOLYGONS) || 
-		(geomRepTheme == TeCELLS)    ||
-		((geomRepThemeMod == TeLINES) && (geomRepTheme == TeLINES))) 
-	{
-		int numElem = querier.numElemInstances();
-		
-		// set progress bar
-		if(TeProgress::instance())
-		{
-			string caption = "Spatial Join";
-			string msg = "Executing Spatial Join. Please, wait!";
-			TeProgress::instance()->setCaption(caption.c_str());
-			TeProgress::instance()->setMessage(msg);
-			TeProgress::instance()->setTotalSteps(numElem);
-			t2 = clock();
-			t0 = t1 = t2;
-		}
-	
-		int steps = 0;
-		TeSTInstance sti;
-
-		double tol = TeGetPrecision(projMod);
-		TePrecision::instance().setPrecision(tol);	
-
-		while(querier.fetchInstance(sti))
-		{
-			// Get attributes
-			TeTableRow row;
-			TeTableRow emptyRow;
-
-			row.push_back("");
-			emptyRow.push_back("");
-
-			vector<string>& vec = sti.getProperties();
-			for(int p=0; p<(int)vec.size();++p)
-			{
-				row.push_back(vec[p]);
-				emptyRow.push_back ("");
-			}
-			
-			//Get geometry
-			TeMultiGeometry mGeom;
-			sti.getGeometry(mGeom);
-
-			vector<TeGeometry*> geoms;
-			mGeom.getGeometry(geoms);
-
-			for(int i=0; i<(int)geoms.size(); ++i)
-			{
-				if(!((*proj) == (*projMod)))
-				{
-					TeGeometry* gout; 
-					if(geoms[i]->elemType()==TePOLYGONS && geomRepTheme==TePOLYGONS)
-					{
-						gout = new TePolygon;
-						TeVectorRemap (*((TePolygon*)geoms[i]), proj, *((TePolygon*)gout), projMod);
-					}
-					else if (geoms[i]->elemType() == TeCELLS && geomRepTheme==TeCELLS)
-					{
-						gout = new TeCell;
-						TeVectorRemap (*((TeCell*)geoms[i]), proj, *((TeCell*)gout), projMod);
-					}
-					else
-					{
-						gout = new TeLine2D;
-						TeVectorRemap (*((TeLine2D*)geoms[i]), proj, *((TeLine2D*)gout), projMod);
-					}
-					gout->objectId(geoms[i]->objectId());
-					delete geoms[i];
-					geoms[i] = gout;
-				}
-				
-				//querier that will be modified
-				TeQuerierParams paramsMod(false, false);
-				paramsMod.setParams(themeMod);
-				paramsMod.setSpatialRest(geoms[i], spatialRelation, geomRepThemeMod);
-				TeQuerier querierMod(paramsMod);
-
-				if(!querierMod.loadInstances())
-					continue;
-				
-				TeSTInstance stMod;
-				while(querierMod.fetchInstance(stMod))
-				{
-					string obj = stMod.objectId();
-					if( find(objIds.begin(), objIds.end(), obj) == objIds.end())
-					{
-						objIds.push_back (obj);
-						row[0] = obj;
-						attrTable.add(row);
-					}
-					else 
-					{
-						emptyRow[0] = obj;
-						updateAttrTable.add(emptyRow);
-					}
-				}
-				
-				if(attrTable.size()>100)
-				{
-					layerMod->saveAttributeTable(attrTable); //save 100 records!!!
-					layerMod->database()->updateTable(updateAttrTable);
-					attrTable.clear();
-					updateAttrTable.clear();
-				}
-			} // for
-			
-			for(int j=0; j<(int)geoms.size(); ++j)
-				delete (geoms[j]);  //delete allocated geometries 
-
-			steps++;
-			t2 = clock();
-			if ((TeProgress::instance()) && (int(t2-t1) > dt))
-			{
-				t1 = t2;
-				if(TeProgress::instance()->wasCancelled())
-				{
-					TeProgress::instance()->reset();
-					return false;
-				}
-				if((int)(t2-t0) > dt2)
-					TeProgress::instance()->setProgress(steps);
-			}
-
-		} //while 
-	} //if geometry type
-	else 
-	{
-		return false;  //use nearest neighbor
-	}
-				
-	if(TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	layerMod->saveAttributeTable(attrTable); //save the last records!!!
-	layerMod->database()->updateTable(updateAttrTable);
-	
-	return true;
-}
-
-
-bool TeGeoOpOverlayUnion(TeLayer* newLayer, TeTheme* theme, TeTheme* themeOverlay, 
-						 TeSelectedObjects selOb, TeSelectedObjects selObOverlay, TeAsciiFile* logFile)
-{
-///////////////////////////////////////////////////////////////////
-return false;
-// verifivar se vai trabalhar com celulas
-// se vai, modificar a interface.....
-///////////////////////////////////////////////////////////////////
-	if((!newLayer) || (!theme) || (!themeOverlay))
-		return false;
-
-	bool insertAttr = false;
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-		
-	TeLayer* layer = theme->layer();
-	TeLayer* layerOverlay = themeOverlay->layer();
-
-	TeGeomRep geomRepTheme = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT);
-	
-	TeProjection* proj = layer->projection();
-	TeProjection* projOverlay = layerOverlay->projection();
-
-	//Querier Overlay
-	TeQuerierParams paramsOverlay(true, true);
-	paramsOverlay.setParams(themeOverlay);
-	paramsOverlay.setSelecetObjs(selObOverlay);
-	TeQuerier  querierOverlay(paramsOverlay); 
-
-	if(!querierOverlay.loadInstances())
-		return  false;
-
-	// ----------------- begin create attribute table
-
-	TeAttributeList attrList;
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.name_ = "object_id_"+ Te2String(newLayer->id());
-	at.rep_.numChar_ = 255;
-	at.rep_.isPrimaryKey_ = true;
-	at.rep_.isAutoNumber_ = false;
-	attrList.push_back(at);
-
-	//theme
-	TeQuerierParams paramsTemp(false, true);
-	paramsTemp.setParams(theme);
-	TeQuerier* querierTemp = new TeQuerier(paramsTemp);
-
-	if(!querierTemp->loadInstances())
-		return false;
-
-	//get attribute list from querier
-	TeAttributeList attribs = querierTemp->getAttrList();
-	TeAttributeList::iterator it = attribs.begin();
-	while(it != attribs.end())
-	{
-		attrList.push_back (*it);
-		++it;
-	}
-						
-	delete querierTemp;
-
-	//overlay
-	attribs.clear();
-	attribs = querierOverlay.getAttrList(); 
-
-	//fill attributes from Overlay theme 
-	it = attribs.begin();
-	while(it != attribs.end())
-	{
-		attrList.push_back (*it);
-		++it;
-	}
-
-	changeAttrList(attrList);
-	attrList[0].rep_.isPrimaryKey_ = true;  //link attribute is primary key
-	
-	TeTable attrTable (newLayer->name(), attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
-
-	if(!newLayer->createAttributeTable(attrTable))
-        return false;
-	
-	// ----------------- End create attribute table
-	int numPolygonsOverlay = querierOverlay.numElemInstances();
-	// set progress bar
-	if(TeProgress::instance())
-	{
-		string caption = "Overlay Union";
-		string msg = "Executing Overlay Union. Please, wait!";
-		TeProgress::instance()->setCaption(caption.c_str());
-		TeProgress::instance()->setMessage(msg);
-		TeProgress::instance()->setTotalSteps(numPolygonsOverlay);
-		t2 = clock();
-		t0 = t1 = t2;
-	}
-
-	double tol = TeGetPrecision(layer->projection());
-	TePrecision::instance().setPrecision(tol);	
-
-	int steps = 0;
-	TeSTInstance Overlay;
-	int newId = 0;
-
-	while(querierOverlay.fetchInstance(Overlay))
-	{
-		TePolygonSet polSet;
-		if(!Overlay.getGeometry(polSet))
-			continue;
-
-		TeTableRow rowOverlay;
-		//fill attribute values from Overlay
-		vector<string>& vecOverlay = Overlay.getProperties();
-
-		for(int p=0; p<(int)vecOverlay.size();++p)
-			rowOverlay.push_back(vecOverlay[p]);
-
-		TePolygonSet ps;
-//		TeCellSet cs;
-
-		for(int i=0; i<(int)polSet.size(); ++i)
-		{
-			TePolygon polyOverlay = polSet[i];
-						
-			if(!((*proj) == (*projOverlay)))
-			{
-				TePolygon pout;
-				TeVectorRemap (polyOverlay, projOverlay, pout, proj);
-				pout.objectId(polyOverlay.objectId());
-				polyOverlay = pout;
-			}
-
-			TePolygonSet polyOverlaySet;
-			polyOverlaySet.add(polyOverlay);
-
-			TeBox boxOverlay = polyOverlay.box();
-
-			//Querier - theme that will be clip
-			TeQuerierParams params(true, true);
-			params.setParams(theme);
-			params.setSelecetObjs(selOb);
-			params.setSpatialRest(boxOverlay, TeINTERSECTS, geomRepTheme);
-
-			TeQuerier querier(params);
-
-			if(!querier.loadInstances())
-				continue;
-			
-			TeSTInstance sti;
-			while(querier.fetchInstance(sti))
-			{
-				TeTableRow row;
-				vector<string>& vect = sti.getProperties();
-				row.push_back("");
-
-				//insert values of the theme that is been clip 
-				for(int p=0; p<(int)vect.size();++p)
-					row.push_back(vect[p]);
-
-				for(int i=0; i<(int)rowOverlay.size(); ++i)
-					row.push_back(rowOverlay[i]);
-				
-				if(sti.hasPolygons() && (geomRepTheme==TePOLYGONS))
-				{
-					TePolygonSet polSet;
-					sti.getGeometry (polSet);
-
-					for(int j=0; j<(int)polSet.size(); ++j)
-					{
-						TePolygonSet psAux, resultPS;
-						psAux.add(polSet[j]);
-						if(!TeOVERLAY::TeIntersection(polyOverlaySet, psAux, resultPS))
-						{
-							// when the operation returns false, write in the log a possible
-							// inconsistency in the data
-							if (logFile)
-							{
-								string mess = "Possivel inconsistencia na interseccao do objeto ";
-								mess += polyOverlay.objectId();
-								mess += " e ";
-								mess += polSet[j].objectId();
-								logFile->writeString(mess);
-								logFile->writeNewLine();
-							}
-						}
-						
-						for(int c=0; c<(int)resultPS.size(); ++c)
-						{
-							newId++;
-							TePolygon paux = resultPS[c];
-							paux.objectId(Te2String(newId));
-							ps.add(paux);
-							row[0] = Te2String(newId);
-							attrTable.add(row);
-						}
-					}
-				}
-//				else if (sti.hasCells())
-//				{
-//					TeCellSet cellSet;
-//					sti.getGeometry (cellSet);
-//
-//					for(int j=0; j<(int)cellSet.size(); ++j)
-//					{
-//						if(TeIntersects(cellSet[j], polyOverlay))
-//						{
-//							newId++;
-//							cellSet[j].objectId(Te2String(newId));
-//							cs.add(cellSet[j]);
-//							row[0] = Te2String(newId);
-//							attrTable.add(row);
-//						}
-//					}
-//				}
-			} //while fetchInstance 
-		}//for each polygon of the Overlay theme
-
-		//inserir a geometria no banco
-		if(geomRepTheme==TePOLYGONS && ps.size())
-			newLayer->addPolygons(ps);
-//		else if(cs.size())
-//			newLayer->addCells(cs);
-
-		Overlay.clear();
-
-		steps++;
-		t2 = clock();
-		if ((TeProgress::instance()) && (int(t2-t1) > dt))
-		{
-			t1 = t2;
-			if(TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			if((int)(t2-t0) > dt2)
-				TeProgress::instance()->setProgress(steps);
-		}
-
-		if((steps%100)==0)
-		{
-			newLayer->saveAttributeTable(attrTable); //save 100 records!!!
-			if(attrTable.size()>0)
-				insertAttr = true;
-			attrTable.clear();
-		}
-	} //while fetch instance querier Overlay
-
-	if(TeProgress::instance())
-			TeProgress::instance()->reset();
-
-	newLayer->saveAttributeTable(attrTable); //save the last records!!!
-	if(attrTable.size()>0)
-		insertAttr = true;
-
-	if(!newLayer->box().isValid())
-		return false;
-
-	if(!insertAttr)
-		return false; 
-
-	return true;
-}
-
-
-bool TeGeoOpAssignByLocationCollect(TeTheme* restrTheme, TeTheme* srcTheme, 
-									const string& newTableName, TeGroupingAttr& measuresColl, 
-									const int& spatialRelation)
-{
-	if(!restrTheme || !restrTheme->layer() ||		// no spatial restriction theme
-	   !srcTheme ||									// no source theme
-	   newTableName.empty() ||						// no output table name 
-	   measuresColl.empty())
-	   return false;
-
-	// verifies if the souce and restriction themes are compatible
-	TeGeomRep restrRep = (TeGeomRep)(restrTheme->visibleGeoRep() & ~TeTEXT);
-	TeGeomRep srcRep =  (TeGeomRep)(srcTheme->visibleGeoRep() & ~TeTEXT);
-	TeRaster* rst = 0;
-	if (srcRep == TeRASTER)
-	{
-		if (restrRep != TePOINTS)
-			return false;
-		rst = srcTheme->layer()->raster();
-		if (!rst)
-			return false;
-	}
-	else
-	{
-		if (restrRep != TePOLYGONS && restrRep != TeCELLS)	// no set of measures to collect
-			return false;
-	}
-
-	TeProjection* restrProj = restrTheme->layer()->projection();
-	TeProjection* srcProj	= srcTheme->layer()->projection();
-	bool doRemap = !(*restrProj == *srcProj);
-
-	// try to retrieve the geometries of the spatial restriction theme
-	TeQuerierParams params(true, false);
-	params.setParams(restrTheme);
-	TeQuerier spatialRestrictions(params); 
-	if(!spatialRestrictions.loadInstances())
-		return false;
-
-	// there is at least one restriction geometry, so create the output table
-	// defines its attribute list
-
-	TeAttributeList attrList;
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.name_ = "object_id_";
-	at.rep_.numChar_ = 255;
-	attrList.push_back(at);
-	vector<int>  countAttr;
-	int attrNum = 1;
-	vector<int> bandCollection;
-
-	TeGroupingAttr::iterator it = measuresColl.begin();		// for each different measure
-	while (it != measuresColl.end())						// create a new attribute
-	{
-		at.rep_ = it->first;
-		at.rep_.isPrimaryKey_ = false;
-		string nameTemp = it->first.name_ + "_" + getStringFromStatistic(it->second);
-		if(((restrTheme->layer()->database()->dbmsName()=="OracleAdo") || 
-			(restrTheme->layer()->database()->dbmsName()=="OracleSpatial") ) &&
-			(nameTemp.size() > 30))
-		{
-			int s = nameTemp.size(); 
-			at.rep_.name_ = nameTemp.substr(s-30, s-1);
-		}
-		else
-			at.rep_.name_ = nameTemp;
-
-		if (srcRep == TeRASTER)
-		{
-			int nn = at.rep_.name_.find("_");
-			int b = atoi(at.rep_.name_.substr(4,nn-4).c_str());
-			bandCollection.push_back(b);
-			if (rst->params().dataType_[b]== TeFLOAT || 
-				rst->params().dataType_[b]== TeDOUBLE)
-				at.rep_.type_ = TeREAL;
-			else
-				at.rep_.type_ = TeINT;
-			attrList.push_back(at);
-			++it;
-			continue;
-		}
-			
-		if (it->second == TeCOUNT || it->second == TeVALIDCOUNT)
-		{
-			at.rep_.type_ = TeINT;
-			countAttr.push_back (attrNum);
-		}
-		else if (at.rep_.type_ == TeINT)
-			at.rep_.type_ = TeREAL;
-
-		attrList.push_back(at);
-		++it;
-		++attrNum;
-	}	
-
-	changeAttrList(attrList);	// validates attribute list						
-	attrList[0].rep_.isPrimaryKey_ = true;
-	attrList[0].rep_.isAutoNumber_ = false;
-
-	TeTable measuresTable (newTableName, attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
-	if(!restrTheme->layer()->createAttributeTable(measuresTable)) // creates the new attribute table
-        return false;
-
-	//use function to point and cell
-	TeDatabase* db = restrTheme->layer()->database();
-	int spatialRes = TeOVERLAPS | TeWITHIN | TeCOVEREDBY | TeCROSSES;
-	bool sqlGroup = false;
-	
-	if( (*restrProj==*srcProj) && 
-		(((restrRep==TeCELLS) && (srcRep==TePOINTS)) ||
-		((restrRep==TeCELLS) && (srcRep==TeCELLS) && ((spatialRelation==TeINTERSECTS) || 
-		(spatialRelation==spatialRes)))))
-	{
-		if(TeCellStatistics(restrTheme, measuresTable, measuresColl, srcTheme, restrTheme->layer()->database()))
-			sqlGroup = db->insertTableInfo(restrTheme->layer()->id(),measuresTable);
-	}
-
-	if(sqlGroup)
-		return true;
-
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	if(TeProgress::instance())								// sets the progress bar
-	{
-		string caption = "Assign Data By Location";
-		string msg = "Executing collecting. Please, wait!";
-		TeProgress::instance()->setCaption(caption.c_str());
-		TeProgress::instance()->setMessage(msg);
-		TeProgress::instance()->setTotalSteps(spatialRestrictions.numElemInstances());
-		t2 = clock();
-		t0 = t1 = t2;
-	}
-
-	double tol = TeGetPrecision(srcProj);
-	TePrecision::instance().setPrecision(tol);	
-
-	unsigned int nregions = 0;
-	TeSTInstance restrInstance;
-
-	// a special case is when the source theme has a raster representation
-	if (srcRep == TeRASTER && restrRep == TePOINTS)
-	{
-		TePointSet restrPoints;
-		unsigned int npt;
-		unsigned int nbs;
-		while (spatialRestrictions.fetchInstance(restrInstance)) 
-		{
-			restrPoints.clear();
-			TeMultiGeometry mGeom;
-			restrInstance.getGeometry(mGeom);
-			restrPoints = mGeom.getPoints();
-			if (doRemap)
-			{
-				TePointSet restrPointAux;
-				TeVectorRemap(restrPoints,restrProj,restrPointAux,srcProj);
-				restrPoints.clear();
-				restrPoints = restrPointAux;
-			}
-			TeCoord2D lc;
-			double val;
-			string sval;
-
-			TeTableRow row;
-			int nrows = 0;
-			for (npt=0; npt<restrPoints.size(); ++npt)
-			{
-				row.clear();
-				row.push_back(restrInstance.objectId());	// identify the instance
-				for (nbs=0; nbs<bandCollection.size();++nbs)
-				{
-					TeCoord2D loc = restrPoints[npt].location();
-					lc = rst->params().coord2Index(loc);
-					if (rst->getElement(TeRoundRasterIndex(lc.x()),TeRoundRasterIndex(lc.y()),val,nbs))
-					{
-						if (rst->params().dataType_[0] == TeUNSIGNEDCHAR ||
-						    rst->params().dataType_[0] == TeCHAR)
-							sval = Te2String(static_cast<int>(val));
-						else
-							sval = Te2String(val,5);
-						row.push_back(sval);
-					}	
-					else
-						row.push_back("");
-				}
-			}
-			measuresTable.add(row);
-			row.clear();
-			nrows++;	
-			if (measuresTable.size()>100)	// saves chunks of 100 records
-			{
-				restrTheme->layer()->saveAttributeTable(measuresTable); 
-				measuresTable.clear();
-			}
-			++nregions;
-			t2 = clock();
-			if ( int(t2-t1) > dt && TeProgress::instance())
-			{
-				t1 = t2;
-				if(TeProgress::instance()->wasCancelled())
-				{
-					TeProgress::instance()->reset();
-					return false;
-				}
-				if((int)(t2-t0) > dt2)
-					TeProgress::instance()->setProgress(nregions);
-			}
-		}
-		if (measuresTable.size() > 0)	// saves remaining records
-		{
-			restrTheme->layer()->saveAttributeTable(measuresTable); 
-			measuresTable.clear();
-		}
-		if (TeProgress::instance())
-			TeProgress::instance()->reset();
-		return true;
-	}
-
-	TePolygonSet restrPols;
-	TeCellSet restrCells;
-	while(spatialRestrictions.fetchInstance(restrInstance)) // collect data for each geometry
-	{	
-		// of the spatial restriction set
-		// defines a querier to select measures from objects that
-		// are delimited by the a geometry and a spatial restriction
-		TeQuerierParams par2(false,measuresColl);
-		par2.setParams(srcTheme);
-		restrCells.clear();
-		restrPols.clear();
-		TeMultiGeometry mGeom;
-		restrInstance.getGeometry(mGeom);
-		// get the geometry of the instance
-		if (restrRep == TeCELLS)						// restriction is given by a cell set geometry
-		{
-			mGeom.getGeometry(restrCells);
-			if (doRemap)						// bring it to the source projection
-			{									// if necessary
-				TeCellSet restrCellsAux;
-				TeVectorRemap(restrCells,restrProj,restrCellsAux,srcProj);
-				restrCells.clear();
-				restrCells = restrCellsAux;
-			}
-			par2.setSpatialRest(&restrCells,spatialRelation,srcRep);
-		}
-		else									// restriction is given by a cell set geometry
-		{
-			mGeom.getGeometry(restrPols);
-			if (doRemap)						// bring it to the source projection
-			{									// if necessary
-				TePolygonSet restrPolsAux;
-				TeVectorRemap(restrPols,restrProj,restrPolsAux,srcProj);
-				restrPols.clear();
-				restrPols = restrPolsAux;
-			}
-			par2.setSpatialRest(&restrPols,spatialRelation,srcRep);
-		}
-		// creates a querier to retrieve the desired measures of the objects inside the 
-		// spatial restriction
-		TeQuerier sourceMeasures(par2);
-
-		// process each source within the spatial restriction geometry
-		TeTableRow row;
-		int nrows = 0;
-		row.push_back(restrInstance.objectId());	// identify the instance
-		
-		if (sourceMeasures.loadInstances())
-		{
-			TeSTInstance sourceInstance;
-			unsigned int p;								// get the calculated attributes
-			sourceMeasures.fetchInstance(sourceInstance);
-			vector<string>& vec = sourceInstance.getProperties();
-			for(p=0; p<vec.size();++p)
-				row.push_back(vec[p]);
-		}
-		else 
-		{
-			//insert null or zero attribute value
-			for(int p=1; p<(int)attrList.size();++p)
-			{
-				if(find(countAttr.begin(), countAttr.end(), p) != countAttr.end())
-					row.push_back(Te2String(0));
-				else
-					row.push_back("");
-			}
-		}
-	
-		measuresTable.add(row);
-		row.clear();
-		nrows++;
-			
-		if(measuresTable.size()>100)	// saves chunks of 100 records
-		{
-			restrTheme->layer()->saveAttributeTable(measuresTable); 
-			measuresTable.clear();
-		}
-
-		++nregions;
-		t2 = clock();
-		if ( int(t2-t1) > dt && TeProgress::instance())
-		{
-			t1 = t2;
-			if(TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			if((int)(t2-t0) > dt2)
-				TeProgress::instance()->setProgress(nregions);
-		}
-	}
-	if (measuresTable.size() > 0)	// saves remaining records
-	{
-		restrTheme->layer()->saveAttributeTable(measuresTable); 
-		measuresTable.clear();
-	}
-
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-
-bool TeGeoOpOverlayDifference(TeLayer* newLayer, TeTheme* theme1, 
-							  TeTheme* theme2, TeSelectedObjects selOb1, 
-							  TeSelectedObjects selOb2, TeAsciiFile* logFile)
-{
-	if((!newLayer) || (!theme1) || (!theme2))
-		return false;
-
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-		
-	TeLayer* layer1 = theme1->layer();
-	TeLayer* layer2 = theme2->layer();
-
-	unsigned int t;
-	vector<string> linkNames;
-	TeAttrTableVector vetTables;
-	if (layer1->getAttrTables(vetTables,TeAttrStatic))
-	{
-		for (t=0; t<vetTables.size(); ++t)
-			linkNames.push_back(TeConvertToUpperCase(vetTables[t].linkName()));
-	}
-	vetTables.clear();
-	if (layer1->getAttrTables(vetTables,TeAttrEvent))
-	{
-		for (t=0; t<vetTables.size(); ++t)
-			linkNames.push_back(TeConvertToUpperCase(vetTables[t].linkName()));
-	}
-
-	TeProjection* proj1 = layer1->projection();
-	TeProjection* proj2 = layer2->projection();
-
-	// querier to get the objects from theme 1
-	TeQuerierParams params1(true, true);
-	params1.setParams(theme1);
-	params1.setSelecetObjs(selOb1);
-	TeQuerier  querier1(params1); 
-
-	if(!querier1.loadInstances())
-		return false;				// there aren't objects on theme 1
-
-	// create the new attribute table with the attributes from theme 1 
-	// preserving the same link attribute
-	TeAttributeList attrList;
-	int npk=-1, aux1=0;
-	TeAttributeList theme1AttrList = querier1.getAttrList();
-	TeAttributeList::iterator it = theme1AttrList.begin();
-	while (it != theme1AttrList.end())
-	{
-		attrList.push_back(*it);
-		vector<string>::iterator it2 = find(linkNames.begin(), linkNames.end(), TeConvertToUpperCase((*it).rep_.name_));
-		if (it2 != linkNames.end())
-			npk = aux1;
-		++it;
-		++aux1;
-	}
-
-	// change attribute names if necessary and create a new attribute table
-	changeAttrList(attrList);
-	attrList[npk].rep_.isPrimaryKey_ = true;
-	TeTable attrTable (newLayer->name(), attrList, attrList[npk].rep_.name_, attrList[npk].rep_.name_);
-	if(!newLayer->createAttributeTable(attrTable))
-       return false;
-
-	// ----- 
-
-	int numPolygons1 = querier1.numElemInstances();
-	if(TeProgress::instance())
-	{
-		string caption = "Overlay Difference";
-		string msg = "Executing Overlay Difference. Please, wait!";
-		TeProgress::instance()->setCaption(caption.c_str());
-		TeProgress::instance()->setMessage(msg);
-		TeProgress::instance()->setTotalSteps(numPolygons1);
-		t2 = clock();
-		t0 = t1 = t2;
-	}
-
-	double tol = TeGetPrecision(proj1);
-	TePrecision::instance().setPrecision(tol);
-
-	int steps = 0;
-	TeSTInstance elem1;
-	while(querier1.fetchInstance(elem1))	// for each object of theme 1
-	{
-		TePolygonSet polSet1Aux;
-		if(!elem1.getGeometry(polSet1Aux))
-			continue;
-		
-		TePolygonSet polSet1;
-		if(!TeOVERLAY::TeValidPolygonHoles(polSet1Aux, polSet1))
-			return false;
-
-		TePolygonSet resultAux;
-
-		// querier to the theme 2
-		TeGeomRep gRepTheme2 = (TeGeomRep)(theme2->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
-		TeQuerierParams params2(true,false);
-		params2.setParams(theme2);
-		params2.setSelecetObjs(selOb2);
-		params2.setSpatialRest(polSet1.box(), TeINTERSECTS, gRepTheme2);
-
-		TeQuerier querier2(params2);
-		if(!querier2.loadInstances())
-		{
-			// there is no intersection between this object and the objects from theme 2
-			// so include the entire geometry of the object in the result
-			for (unsigned int i=0; i<polSet1.size(); ++i)
-				resultAux.add(polSet1[i]);
-		}
-		else
-		{
-			unsigned int m;
-			TePolygonSet polSet2;
-			TeSTInstance sti2;
-			vector<string> oids;
-			// build a polygon set with the representation of all objetcs from theme 2
-			// that intercepts current object of theme 1
-			while(querier2.fetchInstance(sti2))  
-			{
-				if(sti2.hasPolygons())
-				{
-					TePolygonSet polSetAux2;
-					sti2.getGeometry (polSetAux2);
-					if (!((*proj1) == (*proj2)))
-					{
-						TePolygonSet polySet2Out;
-						TeVectorRemap (polSetAux2, proj2, polySet2Out, proj1);
-						for (m=0; m<polySet2Out.size(); m++)
-							polSet2.add(polySet2Out[m]);
-					}
-					else
-					{
-						for (m=0; m<polSetAux2.size(); m++)
-							polSet2.add(polSetAux2[m]);
-					}
-					// keep track of the object ids for logging
-					oids.push_back(sti2.objectId());
-				}
-			}// for each intersection object of theme 2 
-
-			// before union, valid polygon holes (union of holes)
-			TePolygonSet polSetAux;
-			if(!TeOVERLAY::TeValidPolygonHoles(polSet2, polSetAux))
-				return false;
-
-			// Make union of all objects from theme 2 that intersects objects from theme 1
-			TePolygonSet bluePols;
-
-			if(!TeOVERLAY::TeUnion(polSetAux, bluePols))
-			{
-				if(logFile)
-				{
-					string mess = "Possivel inconsistencia na uniao dos obejtos do tema 2 que interceptam o objeto ";
-					mess += polSet1[0].objectId();
-					mess += " do tema " + theme1->name();
-					logFile->writeString(mess);
-					logFile->writeNewLine();
-				}
-			}
-
-			// try to recover the difference between the geometry of the current object
-			// from theme 1 and the geometries of the objects from theme 2 that intercept
-			// current object from theme 1
-			if(!TeOVERLAY::TeDifference(polSet1, bluePols, resultAux))
-			{
-				// when the operation returns false, writes in the error log file a possible
-				// inconsistency in the data
-				if (logFile)
-				{
-					string mess = "Possivel inconsistencia na diferenca do objeto ";
-					mess += polSet1[0].objectId();
-					mess += " do tema " + theme1->name() + " e ";
-					if (!oids.empty())
-						mess += oids[0];
-					for (m=1;m<oids.size();++m)
-						mess += ", " + oids[m];
-					mess += " do tema " + theme2->name();
-					logFile->writeString(mess);
-					logFile->writeNewLine();
-				}
-			} 
-		}
-		// save partial results
-		if (!resultAux.empty())
-		{
-			TeTableRow row;
-			vector<string>& vecOverlay = elem1.getProperties();
-
-			for (unsigned int p=0; p<vecOverlay.size();++p)
-				row.push_back(vecOverlay[p]);
-			attrTable.add(row);
-			row.clear();
-			for (unsigned int l=0; l <resultAux.size(); l++)
-				resultAux[l].objectId(vecOverlay[npk]);
-			newLayer->addPolygons(resultAux);
-		}
-		steps++;
-		t2 = clock();
-		if ((TeProgress::instance()) && (int(t2-t1) > dt))
-		{
-			t1 = t2;
-			if(TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			if((int)(t2-t0) > dt2)
-				TeProgress::instance()->setProgress(steps);
-		}
-		if((steps%100)==0)
-		{
-			newLayer->saveAttributeTable(attrTable); 
-			attrTable.clear();
-		}
-	} // for each object of theme 1
-
-	if(TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	if(attrTable.size()>0)
-		newLayer->saveAttributeTable(attrTable); 
-
-	if(!newLayer->box().isValid())
-		return false;
-	return true;
-}
-
-bool TeGeoOpBuffer(TeLayer* newLayer, TeTheme* themeIn, const TeSelectedObjects& selOb, const TeBUFFERREGION::TeBufferType& bufferType, const double& bufferDistance, 
-				   const unsigned int& bufferLevels, const unsigned int& numPoints, const bool& doUnion, const string& tableName, const string& attrName,
-				   TeAsciiFile* logFile)
-{
-	if(!newLayer || !themeIn)
-		return false;
-	
-	vector<string> attrs;
-	bool	distBasedOnAttr = false;
-	double	dist = bufferDistance;
-
-	//Verify if the distance is based on an attribute
-	if(!tableName.empty() && !attrName.empty())
-	{
-		attrs.push_back (tableName+"."+attrName);
-		distBasedOnAttr = true;
-	}
-	
-	TePrecision::instance().setPrecision(TeGetPrecision(newLayer->projection()) / 10.0);
-		
-	//define a list of attributes
-	TeAttributeList attList;
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.numChar_ = 16;
-	at.rep_.name_ = "object_id_";
-	at.rep_.isPrimaryKey_ = true;
-	attList.push_back(at);
-
-	at.rep_.type_ = TeINT;       
-	at.rep_.name_ = "bufferLevel";
-	at.rep_.isPrimaryKey_ = false;
-	attList.push_back(at);  
-
-	if(!distBasedOnAttr || !doUnion)
-	{
-		at.rep_.type_ = TeREAL;       
-		at.rep_.name_ = "bufferDistance";
-		at.rep_.isPrimaryKey_ = false;
-		attList.push_back(at);  
-	}
-
-	TeTable attTable(newLayer->name()+"_Attr", attList, "object_id_", "object_id_");	
-
-	//create attribute table 
-	if (!newLayer->createAttributeTable(attTable))
-	{
-		// when the operation returns false, write in the log a possible
-		// inconsistency in the data
-		if (logFile)
-		{
-			string mess = "Error creating attribute table! ";
-			logFile->writeString(mess);
-			logFile->writeNewLine();
-		}
-		return false;
-	}
-
-	//insert a polygon representation in the new layer 		
-	if(!newLayer->addGeometry(TePOLYGONS, newLayer->name()+"_pols"))
-	{
-		// when the operation returns false, write in the log a possible
-		// inconsistency in the data
-		if (logFile)
-		{
-			string mess = "Error adding polygon table! ";
-			logFile->writeString(mess);
-			logFile->writeNewLine();
-		}
-		return false;
-	}
-   		
-	//querier to load all objects from database	
-	TeQuerierParams params(true,attrs);
-	params.setParams(themeIn);
-	params.setSelecetObjs(selOb);
-	TeQuerier querier(params);
-
-	if(!querier.loadInstances())
-	{
-		// when the operation returns false, write in the log a possible
-		// inconsistency in the data
-		if (logFile)
-		{
-			string mess = "Error loading objects from database! ";
-			logFile->writeString(mess);
-			logFile->writeNewLine();
-		}
-		return false;
-	}
-
-	//progress bar
-	int total = querier.numElemInstances();
-	if(TeProgress::instance())
-	{
-		string caption = "Buffer operation";
-		string msg;
-		if(doUnion)
-			msg = "Executing buffer operation. Please, wait!";
-		else
-			msg = "Executing buffer operation and saving the \n results in the database. Please, wait!";
-		TeProgress::instance()->setCaption(caption.c_str());
-		TeProgress::instance()->setMessage(msg);
-		TeProgress::instance()->setTotalSteps(total);
-	}
-	
-	vector<TePolygonSet>	result;
-	for(unsigned int j=0; j<bufferLevels; ++j)
-		result.push_back (TePolygonSet());
-
-	TeTableRow		row;
-	TeSTInstance	sti;
-	int count = 0;
-	while(querier.fetchInstance(sti))
-	{
-		TePolygonSet	polSetIn;
-		TeLineSet		lineSetIn;
-		TePointSet		pointSetIn;
-		TeCellSet		cellSetIn;
-		vector<TePolygonSet>	bufferResult;
-		
-		//progress bar
-		if(TeProgress::instance())
-		{
-			if(TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			TeProgress::instance()->setProgress(count);
-		}
-
-		//get the distance
-		if(distBasedOnAttr)
-		{
-			dist = sti[0];
-			if(dist==0) //if there is no distance to this instance, continue
-			{
-				++count;
-				continue;
-			}
-		}
-		
-		bool bufferOperation = false;
-		if(sti.hasPolygons())
-		{
-			sti.getGeometry(polSetIn);
-			// generate the buffers of each polygon of the set (polSetIn) and do the union
-			// of the same distance buffers for each object
-			bufferOperation = TeBUFFERREGION::TeBufferRegion(polSetIn, dist, numPoints, bufferLevels, bufferType, bufferResult);
-		}
-		else if(sti.hasLines())
-		{
-			sti.getGeometry(lineSetIn);
-			// generate the buffers of each line of the set (lineSetIn) and do the union
-			// of the same distance buffers 
-			bufferOperation = TeBUFFERREGION::TeBufferRegion(lineSetIn, dist, numPoints, bufferLevels, bufferResult);
-		}
-		else if(sti.hasPoints())
-		{
-			sti.getGeometry(pointSetIn);
-			// generate the buffers of each point of the set (pointSetIn) and do the union
-			// of the same distance buffers 
-			bufferOperation = TeBUFFERREGION::TeBufferRegion(pointSetIn, dist, numPoints, bufferLevels, bufferResult);
-		}
-		else if(sti.hasCells())
-		{
-			sti.getGeometry(cellSetIn);
-			// generate the buffers of each cell of the set (cellSetIn) and do the union
-			// of the same distance buffers 
-			bufferOperation = TeBUFFERREGION::TeBufferRegion(cellSetIn, dist, numPoints, bufferLevels, bufferType, bufferResult);
-		}
-		else
-		{
-			if(TeProgress::instance())
-				TeProgress::instance()->reset();
-			return false;
-		}
-		
-		if(!bufferOperation)
-		{
-			if (logFile)
-			{	
-				string mess = "Error in the buffer operation over object_id:  ";
-				mess += sti.objectId();
-				logFile->writeString(mess);
-				logFile->writeNewLine();
-			}
-			++count;
-			continue;
-		}
-		
-		//Stores the buffer to do the union of each level 
-		if(doUnion) 
-		{
-			for(unsigned int level=0; level<bufferResult.size(); ++level)
-			{
-				for(unsigned int pol=0; pol<bufferResult[level].size(); ++pol)
-					result[level].add(bufferResult[level][pol]);
-			}
-		}
-		else
-		{
-			for(unsigned int level=0; level<bufferResult.size(); ++level)
-			{
-				string slevel = Te2String(level+1);
-				bufferResult[level].objectId(sti.objectId()+"_"+slevel);
-				//attribute
-				row.clear();
-				row.push_back(sti.objectId()+"_"+slevel);
-				row.push_back(slevel);
-				row.push_back(Te2String(dist*(level+1)));
-				attTable.add(row);
-				//geometry
-				for(unsigned int pol=0; pol<bufferResult[level].size(); ++pol)
-					result[level].add(bufferResult[level][pol]);
-			}
-
-			if(count%100==0)
-			{
-				//store buffer attribute and geometries
-				//saves attributes
-				if (!newLayer->saveAttributeTable(attTable))
-				{
-					if(logFile)
-					{
-						string mess = "Error saving attributes in the attribute table! ";
-						logFile->writeString(mess);
-						logFile->writeNewLine();
-					}
-					if(TeProgress::instance())
-						TeProgress::instance()->reset();
-					return false;
-				}
-				attTable.clear();
-				
-				//saves geometries
-				for(unsigned int level=0; level<bufferResult.size(); ++level)
-				{
-					if(!newLayer->addPolygons(result[level]))
-					{
-						if(logFile)
-						{
-							string mess = "Error saving buffers in the geometric table! ";
-							logFile->writeString(mess);
-							logFile->writeNewLine();
-						}
-						if(TeProgress::instance())
-						{
-							TeProgress::instance()->reset();
-						}
-						return false;
-					}
-					result[level].clear();
-				}
-				
-			}
-		}
-		++count;
-	}
-
-	if(doUnion)
-	{
-		//progress bar
-		if(TeProgress::instance())
-		{
-			string caption = "Dissolve operation";
-			TeProgress::instance()->setCaption(caption.c_str());
-			string msg = "Executing dissolve operation and saving the \n results in the database. Please, wait!";
-			TeProgress::instance()->setMessage(msg);
-			TeProgress::instance()->setTotalSteps((int)bufferLevels);
-		}
-			
-		//do the union for each level
-		int objId = 0;
-		TePolygonSet prevLevelPolSet;
-		for(unsigned int level=0; level<result.size(); ++level)
-		{
-			TePolygonSet curLevelPolSet;
-			if(!TeOVERLAY::TePairUnion(result[level], curLevelPolSet))
-			{
-				if(logFile)
-				{
-					string mess = "Error in the union of the buffers of the level ";
-					mess += Te2String(level+1) +" !";
-					logFile->writeString(mess);
-					logFile->writeNewLine();
-				}
-				if(TeProgress::instance())
-				{
-					TeProgress::instance()->reset();
-				}
-				return false;
-			}
-
-			if(level>0)
-			{
-				TePolygonSet auxPolSet;
-				//Difference between current level union and union of previous levels 
-				if(!TeOVERLAY::TeDifference (curLevelPolSet, prevLevelPolSet, auxPolSet))
-				{
-					if(logFile)
-					{
-						string mess = "Error in the difference between buffers of the level ";
-						mess += Te2String(level+1) +" and buffers of the level ";
-						mess += Te2String(level) +" !";
-						logFile->writeString(mess);
-						logFile->writeNewLine();
-					}
-					if(TeProgress::instance())
-					{
-						TeProgress::instance()->reset();
-					}
-					return false;
-				}
-
-				curLevelPolSet.clear();
-				for(unsigned int j=0; j< auxPolSet.size(); ++j)
-                    curLevelPolSet.add(auxPolSet[j]);
-
-				//Do the union between current level and previous levels
-				auxPolSet.clear();
-				if((level+1)<result.size())
-				{
-					if(!TeOVERLAY::TeUnion (curLevelPolSet, prevLevelPolSet, auxPolSet))
-					{
-						if(logFile)
-						{
-							string mess = "Error in the union between buffers of the level ";
-							mess += Te2String(level+1) +" and buffers of the level ";
-							mess += Te2String(level) +" !";
-							logFile->writeString(mess);
-							logFile->writeNewLine();
-						}
-
-						if(TeProgress::instance())
-						{
-							TeProgress::instance()->reset();
-						}
-
-						return false;
-					}
-
-					prevLevelPolSet.clear();
-					for(unsigned int j=0; j< auxPolSet.size(); ++j)
-						prevLevelPolSet.add(auxPolSet[j]);
-				}
-			}
-			else
-			{
-				for(unsigned int j=0; j< curLevelPolSet.size(); ++j)
-                    prevLevelPolSet.add(curLevelPolSet[j]);
-			}
-
-			for(unsigned int k=0; k<curLevelPolSet.size(); ++k)
-			{
-				string objectId = Te2String(objId);
-				++objId;
-				curLevelPolSet[k].objectId(objectId);
-				//attribute
-				row.clear();
-				row.push_back(objectId);
-				row.push_back(Te2String(level+1));
-				if(!distBasedOnAttr)
-					row.push_back(Te2String(dist*(level+1)));
-				attTable.add(row);
-			}
-			
-			//saves attributes
-			if (!newLayer->saveAttributeTable(attTable))
-			{
-				if(logFile)
-				{
-					string mess = "Error saving attributes in the attribute table! ";
-					logFile->writeString(mess);
-					logFile->writeNewLine();
-				}
-				if(TeProgress::instance())
-					TeProgress::instance()->reset();
-				return false;
-			}
-			attTable.clear();
-				
-			//saves geometries
-			if(!newLayer->addPolygons(curLevelPolSet))
-			{
-				if(logFile)
-				{
-					string mess = "Error saving buffers in the geometric table! ";
-					logFile->writeString(mess);
-					logFile->writeNewLine();
-				}
-				if(TeProgress::instance())
-					TeProgress::instance()->reset();
-				return false;
-			}
-
-			//progress bar
-			if(TeProgress::instance())
-			{
-				if(TeProgress::instance()->wasCancelled())
-				{
-					TeProgress::instance()->reset();
-					return false;
-				}
-				TeProgress::instance()->setProgress(level+1);
-			}
-		} //for
-	}
-	else
-	{
-		//saves attributes
-		if (!newLayer->saveAttributeTable(attTable))
-		{
-			if(logFile)
-			{
-				string mess = "Error saving attributes in the attribute table! ";
-				logFile->writeString(mess);
-				logFile->writeNewLine();
-			}
-			if(TeProgress::instance())
-				TeProgress::instance()->reset();
-			return false;
-		}
-		
-		//saves geometries
-		for(unsigned int level=0; level<result.size(); ++level)
-		{
-			if(!newLayer->addPolygons(result[level]))
-			{
-				if(logFile)
-				{
-					string mess = "Error saving buffers in the geometric table! ";
-					logFile->writeString(mess);
-					logFile->writeNewLine();
-				}
-				if(TeProgress::instance())
-					TeProgress::instance()->reset();
-				return false;
-			}
-			result[level].clear();
-		}
-	}
-	if(TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-bool 
-TeGeoOpOverlayIntersection(TeLayer* newLayer, TeTheme* theme, TeTheme* themeTrim, TeSelectedObjects selObTrim, double backValue, TeAsciiFile* logFile)
-{
-	// check if the input parameters are valid
-	if((!newLayer) || (!theme) || (!themeTrim))
-		return false;
-
-	// check if the theme to be clipped has a raster geometry valid
-	TeRaster* rst = theme->layer()->raster();
-	if (!rst) 
-		return false;
-
-	//Querier Trim
-	TeQuerierParams paramsTrim(true, true);
-	paramsTrim.setParams(themeTrim);
-	paramsTrim.setSelecetObjs(selObTrim);
-	TeQuerier  querierTrim(paramsTrim); 
-	if(!querierTrim.loadInstances())
-		return  false;
-	
-	TeSTInstance trim;
-	TePolygonSet ps;
-	while(querierTrim.fetchInstance(trim))
-	{
-		TePolygonSet polSet;
-		if(!trim.getGeometry(polSet))
-			continue;
-		for(int i=0; i<(int)polSet.size(); ++i)
-		{
-			TePolygon polyTrim = polSet[i];
-			// before intersection, valid polygon holes (union of holes)
-			TePolygonSet polyTrimSet;
-			if(!TeOVERLAY::TeValidPolygonHoles(polyTrim, polyTrimSet))
-			{
-				// when the operation returns false, write in the log a possible
-				// inconsistency in the data
-				if (logFile)
-				{
-					string mess = "Nao foi possivel realizar a consistencia dos aneis internos ";
-					mess += polyTrim.objectId();
-					mess += " do tema " + themeTrim->name() + ".";
-					logFile->writeString(mess);
-					logFile->writeNewLine();
-				}
-				continue;
-			}
-			ps.add(polSet[i]);
-		}//for each polygon of the Trim theme
-	}
-
-	// there are no valid polygons to be used as mask to clip raster representation
-	if (ps.empty())
-		return false;
-
-	// finds a valid name for the table that contains the raster geometry
-	string rasterTableName = "RasterLayer" + Te2String(newLayer->id())+"_R_O1";
-	rasterTableName = newLayer->database()->getNewTableName(rasterTableName);
-
-	// tries to execute the clipping
-	TeRaster* rstClip = TeRasterClipping(rst, ps, themeTrim->layer()->projection(), rasterTableName, backValue, "DB");
-	newLayer->addRasterGeometry(rstClip,"O1");
-    return true;
-}
-
-bool TeGeoOpNearestNeighbour(TeTheme* inputTheme, TeSelectedObjects iselObj, 
-							 TeTheme* neighTheme, TeSelectedObjects nnselObj, 
-							 const string& distColName, const string& NNIDColName)
-{
-	if (!inputTheme || !neighTheme)
-		return false;
-
-	// retrieve the the centroids of all objects candidates to be the nearest neighbour
-	TeQuerierParams qPar(true, false);
-	qPar.setParams(neighTheme);
-	qPar.setSelecetObjs(iselObj);
-	TeQuerier* querier = new TeQuerier(qPar);
-	if (!querier->loadInstances())
-	{
-		delete querier;
-		return false;
-	}
-
-	TeProjection* pInput = inputTheme->layer()->projection();
-	TeProjection* pNeigh = neighTheme->layer()->projection();
-
-	bool doReproj = false;
-	if (!(*pInput == *pNeigh))
-	{
-		pNeigh->setDestinationProjection(pInput);
-		doReproj = true;
-	}
-		
-	string newDistCol = distColName;
-	if (newDistCol.empty())
-		newDistCol = "DIST";
-
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
-		t2 = clock();
-		t0 = t1 = t2;
-	}
-	unsigned int step=0;
-	std::vector<std::pair<TeCoord2D, TePoint> > dataSet;
-	TeSTInstance st;
-	TeMultiGeometry multigeo;
-	string lastOID;
-	while(querier->fetchInstance(st))
-	{
-		TeCoord2D cc;
-		st.centroid(cc);
-		if (doReproj)
-		{
-			TeCoord2D ll = pNeigh->PC2LL(cc);
-			cc = pInput->LL2PC(cc);
-		}
-		TePoint pt(cc);
-		pt.objectId(st.objectId());
-		dataSet.push_back(std::pair<TeCoord2D, TePoint>(cc, pt)); 
-		t2 = clock();
-		if (((int(t2-t1) > dt) && TeProgress::instance()))
-		{
-			t1 = t2;
-			if(TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			if((int)(t2-t0) > dt2)
-				TeProgress::instance()->setProgress(step);
-		}
-		++step;
-	}
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	step = 0;
-	TeBox candExt = querier->getBox();
-	delete querier;
-
-// create a spatial index of the centroids of the candidates
-	typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, std::vector<TePoint>, TePoint> KDNODE;
-	typedef TeSAM::TeAdaptativeKdTree<KDNODE> KDTREE;
-
-	unsigned int bucketSize = 3 * 1; //
-	KDTREE tree(candExt, bucketSize); 
-	tree.build(dataSet); 
-	dataSet.clear(); 
-
-//	verifies how to save the results
-	bool updateNNId = false;
-	TeAttribute attr;	
-	TeAttrTableVector attTables;
-	inputTheme->getAttTables(attTables, TeAttrStatic);
-
-	// always save the distance column
-	string tableName = "";
-	string dcolName = distColName;
-	unsigned int pos = distColName.find('.');
-	if (pos != std::string::npos)
-	{
-		tableName = distColName.substr(0,pos);
-		unsigned int nchars = distColName.size()-1;
-		dcolName = distColName.substr(pos+1,nchars);
-	}
-
-	string objectIdCol;
-	if (tableName.empty())
-	{
-		tableName = attTables[0].name();
-		objectIdCol = attTables[0].linkName();
-	}
-	else
-	{
-		TeAttrTableVector::iterator it = attTables.begin();
-		while (it != attTables.end())
-		{
-			if ((*it).name() == tableName)
-			{
-				objectIdCol = (*it).linkName();
-				break;
-			}
-			++it;
-		}
-	}
-
-	if (inputTheme->layer()->database()->columnExist(tableName,dcolName,attr))
-	{
-		if (attr.rep_.type_!= TeREAL)
-		{
-			inputTheme->layer()->database()->deleteColumn(tableName,dcolName);
-			attr.rep_.type_ = TeREAL;
-			if (!inputTheme->layer()->database()->addColumn(tableName,attr.rep_))
-			{
-				// can not create the distance column
-				delete querier;
-				return false;
-			}
-		}
-	}
-	else
-	{
-		attr.rep_.type_ = TeREAL;
-		attr.rep_.name_ = dcolName;
-		if (!inputTheme->layer()->database()->addColumn(tableName,attr.rep_))
-		{
-			// can not create the distance column
-			delete querier;
-			return false;
-		}
-	}
-
-	// save nn id only when requested
-	string nnidcol;
-	if (!NNIDColName.empty())
-	{
-		updateNNId = true;
-		nnidcol = NNIDColName;
-		pos = NNIDColName.find('.');
-		if (pos != std::string::npos)
-			nnidcol = NNIDColName.substr(pos+1,NNIDColName.size());
-
-		if (inputTheme->layer()->database()->columnExist(tableName,nnidcol,attr))
-		{
-			if (attr.rep_.type_!= TeSTRING)
-			{
-				inputTheme->layer()->database()->deleteColumn(tableName,nnidcol);
-				attr.rep_.type_ = TeSTRING;
-				attr.rep_.numChar_ = 100;
-				if (!inputTheme->layer()->database()->addColumn(tableName,attr.rep_))
-					updateNNId = false;
-			}
-		}
-		else
-		{
-			attr.rep_.type_ = TeSTRING;
-			attr.rep_.name_ = nnidcol;
-			attr.rep_.numChar_ = 100;
-			if (!inputTheme->layer()->database()->addColumn(tableName,attr.rep_))
-				updateNNId = false;
-		}
-	}
-
-// retrieve the objects to find the nearest neighbour 
-	qPar.setParams(inputTheme);
-	qPar.setSelecetObjs(nnselObj);
-	querier = new TeQuerier(qPar);
-	if (!querier->loadInstances())
-	{
-		delete querier;
-		return false;
-	}
-
-	std::vector<TePoint> report;
-	report.push_back(TePoint(TeMAXFLOAT, TeMAXFLOAT));
-	std::vector<double> sqrDists;
-	multigeo.clear();
-	lastOID = "";
-	string sql;
-
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
-		t2 = clock();
-		t0 = t1 = t2;
-	}
-
-	while(querier->fetchInstance(st))
-	{
-		TeCoord2D cc;
-		st.centroid(cc);
-		tree.nearestNeighborSearch(cc, report, sqrDists, 1);
-		if (updateNNId)
-			sql = "UPDATE " + tableName + " SET " + nnidcol + "='" + report[0].objectId() + "', " + dcolName + "=" + Te2String(sqrt(sqrDists[0]),4);
-		else
-			sql = "UPDATE " + tableName + " SET " + dcolName + "=" + Te2String(sqrt(sqrDists[0]),4);
-		sql += " WHERE " + objectIdCol + "='" + st.objectId().c_str() + "'";
-		if (!inputTheme->layer()->database()->execute(sql))
-		{
-			delete querier;
-			return false;
-		}
-		if (((t2-t1) > dt) && (TeProgress::instance()))
-		{
-			t1 = t2;
-			if(TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			if ((t2-t0) > dt2)
-				TeProgress::instance()->setProgress(step);
-		}
-		++step;
-	}
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	delete querier;
-	return true;
-}
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases
+using TerraLib.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include "TeGeoProcessingFunctions.h"
+#include "TeQuerier.h"
+#include "TeQuerierParams.h"
+#include "TeOverlay.h"
+#include "TeProgress.h"
+#include "TeVectorRemap.h"
+#include "TeDatabase.h"
+#include "TeCellAlgorithms.h"
+#include "TeAsciiFile.h"
+
+
+//-------------------------------- Auxiliary functions
+inline string getStringFromStatistic(TeStatisticType sType)
+{
+	string ss;
+
+	if(sType == TeSUM)
+		ss = "SUM";
+	else if(sType == TeMAXVALUE)
+		ss = "MAXVALUE";
+	else if(sType == TeMINVALUE)
+		ss = "MINVALUE";
+	else if(sType == TeCOUNT)
+		ss = "COUNT";
+	else if(sType == TeVALIDCOUNT)
+		ss = "VALIDCOUNT";
+	else if(sType == TeSTANDARDDEVIATION)
+		ss = "STANDARDDEVIATION";
+	else if(sType == TeKERNEL)
+		ss = "KERNEL";
+	else if(sType == TeMEAN)
+		ss = "MEAN";
+	else if(sType == TeVARIANCE)
+		ss = "VARIANCE";
+	else if(sType == TeSKEWNESS)
+		ss = "SKEWNESS";
+	else if(sType == TeKURTOSIS)
+		ss = "KURTOSIS";
+	else if(sType == TeAMPLITUDE)
+		ss = "AMPLITUDE";
+	else if(sType == TeMEDIAN)
+		ss = "MEDIAN";
+	else if(sType == TeVARCOEFF)
+		ss = "VARCOEFF";
+	else if(sType == TeMODE)
+		ss = "MODE";
+	else if(sType == TeNOSTATISTIC)
+		ss = "VALUE";
+	return ss;
+}
+
+
+inline int countNumGeometries(TeTheme* theme, TeSelectedObjects selOb)
+{
+	TeDatabase* db = theme->layer()->database();
+
+	string count;
+	TeGeomRep gRep = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
+
+    if(gRep == TePOLYGONS)
+	{
+		string tableName = theme->layer()->tableName(TePOLYGONS);
+
+		//Calculate the number of polygons to be drawn
+		string selectPolyCount; 
+
+		if(db->dbmsName()=="SqlServerAdo")
+			selectPolyCount="SELECT COUNT(DISTINCT(parent_id)) FROM ";
+		else if(db->dbmsName() != "OracleSpatial" && db->dbmsName() != "PostGIS")
+			selectPolyCount = "SELECT DISTINCT parent_id FROM ";
+		else
+			selectPolyCount = "SELECT DISTINCT geom_id FROM ";
+
+		selectPolyCount += tableName + ", " + theme->collectionTable() + " WHERE c_object_id = object_id";
+
+		if(selOb == TeSelectedByPointing)
+		{
+			selectPolyCount += " AND (c_object_status = 1 OR c_object_status = 3)";
+
+		}
+		else if(selOb == TeSelectedByQuery)
+		{
+			selectPolyCount += " AND (c_object_status = 2 OR c_object_status = 3)";
+		}
+		
+		if(db->dbmsName() =="SqlServerAdo")
+			count = selectPolyCount;
+		else if(db->dbmsName() == "PostgreSQL" || db->dbmsName() == "PostGIS")
+			count = "SELECT COUNT(*) FROM (" + selectPolyCount + ") AS r";		
+		else 
+			count = "SELECT COUNT(*) FROM (" + selectPolyCount + ")";		
+	}
+	else if(gRep == TeLINES)
+	{
+		string tableName = theme->layer()->tableName(TeLINES);
+
+		count = "SELECT COUNT(*) FROM " + tableName + ", " + theme->collectionTable();
+		count += " WHERE object_id = c_object_id";
+
+		if(selOb == TeSelectedByPointing)
+		{
+			count += " AND (c_object_status = 1 OR c_object_status = 3)";
+
+		}
+		else if(selOb == TeSelectedByQuery)
+		{
+			count += " AND (c_object_status = 2 OR c_object_status = 3)";
+		}
+	}
+	else if(gRep == TePOINTS)
+	{
+		string tableName = theme->layer()->tableName(TePOINTS);
+
+		count = "SELECT COUNT(*) FROM " + tableName + ", " + theme->collectionTable();
+		count += " WHERE object_id = c_object_id";
+
+		if(selOb == TeSelectedByPointing)
+		{
+			count += " AND (c_object_status = 1 OR c_object_status = 3)";
+
+		}
+		else if(selOb == TeSelectedByQuery)
+		{
+			count += " AND (c_object_status = 2 OR c_object_status = 3)";
+		}
+	}
+	else if(gRep == TeCELLS)
+	{
+		string tableName = theme->layer()->tableName(TeCELLS);
+
+		count = "SELECT COUNT(*) FROM " + tableName + ", " + theme->collectionTable();
+		count += " WHERE object_id = c_object_id";
+
+		if(selOb == TeSelectedByPointing)
+		{
+			count += " AND (c_object_status = 1 OR c_object_status = 3)";
+
+		}
+		else if(selOb == TeSelectedByQuery)
+		{
+			count += " AND (c_object_status = 2 OR c_object_status = 3)";
+		}
+	}
+	else
+		return -1;
+
+	TeDatabasePortal* p = db->getPortal();
+
+	if(p && p->query(count) && p->fetchRow())
+	{
+		int result = p->getInt(0);
+
+		delete p;
+		
+		return result;
+
+	}
+	
+	if(p)
+		delete p;
+
+	return -1;			
+}
+
+// objectid cell, <objectid polygon, itersection area>
+inline void insertArea(const string& cellId, const string& polId, const double& area, map<string, map<string, double> >& cellMap)
+{
+	map<string, map<string, double> >::iterator it = cellMap.find(cellId);
+
+	if(it != cellMap.end())
+	{
+// inserts into an existing entry
+		map<string, double>::iterator itpol = it->second.find(polId);
+
+		if(itpol != it->second.end())
+		{
+// polid already in index... add area
+			itpol->second = itpol->second + area;
+		}
+		else
+		{
+// inserts polid and area
+			(it->second)[polId] = area;
+		}
+
+	}
+	else
+	{
+// inserts a new entry
+		map<string, double> polMap;
+		polMap.insert(pair<string, double>(polId, area));
+		cellMap[cellId] = polMap;
+	}
+}
+
+// objectid cell, <objectid polygon, itersection area>
+inline string getMaxIntersectionArea(map<string, double>& polMap)
+{
+	string strMax;
+	double maxArea = 0.0;
+
+	map<string, double>::iterator it = polMap.begin();
+
+	if(it != polMap.end())
+	{
+		strMax = it->first;
+		maxArea = it->second;
+
+		++it;
+
+		while(it != polMap.end())
+		{
+			if(it->second > maxArea)
+			{
+				strMax = it->first;
+				maxArea = it->second;
+			}
+
+			++it;
+		}
+	}
+
+    return strMax;
+}
+
+bool insertBoundaryCells(int newId, TeLayer* outPutLayer, map<string, map<string, double> >& cellMap, TeTheme* cellTheme, TeTheme* themeTrim = 0)
+{
+	int step = 0;
+	TeTable& attTable = outPutLayer->attrTables()[0];
+	TeCellSet outputCellSet;
+
+	outputCellSet.resX(cellTheme->layer()->getRepresentation(TeCELLS)->resX_);
+	outputCellSet.resY(cellTheme->layer()->getRepresentation(TeCELLS)->resY_);
+
+	attTable.clear();
+
+	if(TeProgress::instance())
+	{
+		string caption = "Overlay Intersection";
+		string msg = "Saving Boundary. Please, wait!";
+		TeProgress::instance()->setCaption(caption.c_str());
+		TeProgress::instance()->setMessage(msg);
+		TeProgress::instance()->setTotalSteps(cellMap.size());
+	}
+	map<string, map<string, double> >::iterator it = cellMap.begin();
+
+	while(it != cellMap.end())
+	{
+		++newId;
+		step++;
+
+		string newObjId = Te2String(newId);
+
+// get cell data
+		TeQuerierParams cellParams(true, true);
+		cellParams.setParams(cellTheme, it->first);
+
+		TeQuerier cellQuerier(cellParams);
+
+		if(!cellQuerier.loadInstances())
+			return  false;
+
+		TeSTInstance cellInst;
+
+		if(!cellQuerier.fetchInstance(cellInst))
+			return false;
+		
+		TeCellSet cs;
+
+		cellInst.getGeometry(cs);
+
+		cs[0].objectId(newObjId);
+
+		outputCellSet.add(cs[0]);		
+
+// monta a linha com os valores das colunas da celula
+		TeTableRow row;
+
+		row.push_back(newObjId);
+
+		vector<string>& attrs = cellInst.getProperties();
+
+		for(int p = 0; p < (int)attrs.size(); ++p)
+			row.push_back(attrs[p]);
+
+		if(themeTrim)
+		{
+			string polId = getMaxIntersectionArea(it->second);
+
+			if(polId.empty())
+				return false;
+
+
+			TeQuerierParams trimParams(false, true);
+			trimParams.setParams(themeTrim, polId);
+
+			TeQuerier trimQuerier(trimParams);
+
+			if(!trimQuerier.loadInstances())
+				return  false;
+
+			TeSTInstance trimInst;
+
+			if(!trimQuerier.fetchInstance(trimInst))
+				return false;
+
+			vector<string>& attrstrim = trimInst.getProperties();
+
+			for(int p = 0; p < (int)attrstrim.size(); ++p)
+				row.push_back(attrstrim[p]);
+		}
+
+		attTable.add(row);
+// salva a celula e os atributos
+
+		if((newId % 100) == 0)
+		{
+			outPutLayer->addCells(outputCellSet);
+			outputCellSet.clear();
+
+			outPutLayer->saveAttributeTable(attTable);
+			attTable.clear();
+
+			if(TeProgress::instance())
+			{
+				if(TeProgress::instance()->wasCancelled())
+				{
+					TeProgress::instance()->reset();
+					return false;
+				}
+				TeProgress::instance()->setProgress(step);
+			}
+		}
+       
+		++it;
+	}
+
+	if(outputCellSet.size() > 0)
+	{
+        outPutLayer->addCells(outputCellSet);
+		outputCellSet.clear();
+	}
+
+
+	if(attTable.size() > 0)
+	{
+        outPutLayer->saveAttributeTable(attTable);
+		attTable.clear();
+	}
+
+	if(TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	return true;
+}
+
+
+
+inline bool changeAttrList(TeAttributeList& attrList)
+{
+	bool change = false;
+	
+	for(int i=0; i<(int)attrList.size(); ++i) 
+	{
+		string& nameOr = attrList[i].rep_.name_;
+	
+		attrList[i].rep_.isAutoNumber_ = false;
+		attrList[i].rep_.isPrimaryKey_ = false;
+		
+		//replace "." for "_"
+		string::size_type f = nameOr.find(".");
+		if(f != string::npos)
+		{
+			nameOr.replace(f, 1, "_");
+			change = true;
+		}
+
+		string nameTemp = TeConvertToUpperCase(nameOr);
+
+		int count = 1;
+		int j = i+1;
+		while(j<(int)attrList.size())
+		{
+			if((nameTemp == TeConvertToUpperCase(attrList[j].rep_.name_)) && (i!=j))
+			{
+				nameTemp = nameTemp +"_"+ Te2String(count);
+				nameOr = nameOr +"_"+ Te2String(count);
+
+				j = 0;
+				change = true;
+				++count;
+			}
+			++j;
+		}
+	}
+
+	return change;
+}
+
+
+inline bool multiGeometryToLayer(TeMultiGeometry& mGeom, const string& newId, TeLayer* newLayer, TeProjection* proj=0, TeGeomRep geomRep=TeGEOMETRYNONE)
+{
+	bool flag = true;
+	TeProjection* projLayer = newLayer->projection();
+	
+	if(mGeom.hasPolygons() && (geomRep==TeGEOMETRYNONE || geomRep==TePOLYGONS))  
+	{
+		TePolygonSet polSet, polSetTemp;
+		mGeom.getGeometry (polSetTemp);
+
+		if((proj) && (!((*proj) == (*projLayer))))
+		{
+			for(int i=0; i<(int)polSetTemp.size(); ++i)
+			{
+				TePolygon poly = polSetTemp[i];
+				TePolygon pout;
+				TeVectorRemap (poly, proj, pout, projLayer);
+				pout.objectId(poly.objectId());
+				polSet.add (pout);
+			}
+		}
+		else
+			polSet = polSetTemp;
+
+
+		polSet.objectId(newId);
+		flag = newLayer->addPolygons(polSet);
+	} 
+	else if (mGeom.hasLines() && (geomRep==TeGEOMETRYNONE || geomRep==TeLINES))
+	{
+		TeLineSet lineSet, lineSetTemp;
+		mGeom.getGeometry (lineSetTemp);
+
+		if((proj) && (!((*proj) == (*projLayer))))
+		{
+			for(int i=0; i<(int)lineSetTemp.size(); ++i)
+			{
+				TeLine2D line = lineSetTemp[i];
+				TeLine2D lout;
+				TeVectorRemap (line, proj, lout, projLayer);
+				lout.objectId(line.objectId());
+				lineSet.add (lout);
+			}
+		}
+		else
+			lineSet = lineSetTemp;
+
+		lineSet.objectId (newId);
+		flag = newLayer->addLines(lineSet);
+	}
+	else if (mGeom.hasPoints() && (geomRep==TeGEOMETRYNONE || geomRep==TePOINTS))
+	{
+		TePointSet pointSet, pointSetTemp;
+		mGeom.getGeometry (pointSetTemp);
+
+		if((proj) && (!((*proj) == (*projLayer))))
+		{
+			for(int i=0; i<(int)pointSetTemp.size(); ++i)
+			{
+				TePoint point = pointSetTemp[i];
+				TePoint pout;
+				TeVectorRemap (point, proj, pout, projLayer);
+				pout.objectId(point.objectId());
+				pointSet.add (pout);
+			}
+		}
+		else
+			pointSet = pointSetTemp;
+
+		pointSet.objectId (newId);
+		flag = newLayer->addPoints(pointSet);
+	}
+	else if (mGeom.hasCells() && (geomRep==TeGEOMETRYNONE || geomRep==TeCELLS))
+	{
+		TeCellSet cellSet, cellSetTemp;
+		mGeom.getGeometry (cellSetTemp);
+	
+		if((proj) && (!((*proj) == (*projLayer))))
+		{
+			for(int i=0; i<(int)cellSetTemp.size(); ++i)
+			{
+				TeCell cell = cellSetTemp[i];
+				TeCell cellout;
+				TeVectorRemap (cell, proj, cellout, projLayer);
+				cellout.objectId(cell.objectId());
+				cellSet.add (cellout);
+			}
+		}
+		else
+			cellSet = cellSetTemp;
+
+		cellSet.objectId (newId);
+		flag = newLayer->addCells(cellSet);
+	}
+//	else 
+//		return false;
+
+	return flag;
+}
+
+//-------------------------------- Main functions
+
+bool TeGeoOpAggregation(TeLayer* newLayer, TeTheme* theme, vector<string>& agregAttrVec, 
+						TeGroupingAttr& attrMM, TeSelectedObjects selOb, TeAsciiFile* logFile)		
+{
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	unsigned int i, j;
+	int	offset, steps = 0;
+	TeStatisticValMap stat;
+	TeStatisticStringValMap sstat;
+	vector<string> valVec;
+	map<int, vector<string> > stringMap;
+	map<int, vector<double> > doubleMap;
+	string geoName, query;
+	string layerName = newLayer->name();
+	TeLayer* layer = theme->layer();
+	TeDatabase* db = layer->database();
+	string CT = theme->collectionTable();
+	string OID = CT + ".c_object_id";
+
+	TeGeomRep geomRepTheme = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
+
+	TeAttributeList aList = theme->sqlAttList();
+	TeAttribute agregTeAttribute;
+	agregTeAttribute.rep_.type_ = TeSTRING;
+	agregTeAttribute.rep_.numChar_ = 200;
+	agregTeAttribute.rep_.isPrimaryKey_ = false;
+	agregTeAttribute.rep_.isAutoNumber_ = false;
+
+	map<int, string> legendLabelMap;
+	int legIndex = -1;
+
+	map<int, int> attrSQLPositionMap;	// dado o id do vetor attrMM ele devolve a posicao no portal. 
+
+/* acha o nome para a coluna (agregTeAttribute) que sempre eh acrescentada
+   ao layer de saida: a coluna formada pelos atributos usados para agrupar
+ */
+	for(j=0; j<agregAttrVec.size(); ++j)
+	{
+		string name;
+		if(agregAttrVec[j] == "CURRENT LEGEND")
+		{
+			agregAttrVec[j] = CT + ".c_legend_id";
+			name = "agreg_leg_";
+			legIndex = j;
+		}
+		else
+		{	
+			for(i=0; i<aList.size(); ++i)
+			{
+				name = aList[i].rep_.name_;
+				if(name == agregAttrVec[j])
+				{
+					int f = name.find(".");
+					if(f >= 0)
+						name.replace(f, 1, "_");
+					break;
+				}
+			}
+		}
+		if(j==0)
+			agregTeAttribute.rep_.name_ += name;
+		else
+			agregTeAttribute.rep_.name_ += "_" + name;
+	}
+
+	if(agregTeAttribute.rep_.name_.size() > 30)
+		agregTeAttribute.rep_.name_ = agregTeAttribute.rep_.name_.substr(0, 30);
+
+/* o usuario quer agrupar pela legenda?
+   - se sim, montamos o legendLabelMap
+ */
+	if(legIndex > -1)
+	{
+		TeLegendEntryVector& legVec = theme->legend();
+		for(i=0; i<legVec.size(); ++i)
+			legendLabelMap[legVec[i].id()] = legVec[i].label();
+	}
+
+/* montagem da lista de atributos do novo layer
+ */
+	TeAttributeList attList;
+
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "object_id_";
+	at.rep_.numChar_ = 255;
+	at.rep_.isPrimaryKey_ = true;
+	at.rep_.isAutoNumber_ = false;
+	attList.push_back(at);
+
+	attList.push_back(agregTeAttribute);
+	
+	at.rep_.type_ = TeINT;
+	at.rep_.name_ = "agreg_count_";
+	at.rep_.numChar_ = 0;
+	at.rep_.isPrimaryKey_ = false;
+	attList.push_back(at);	
+
+	TeGroupingAttr::iterator it;
+	string ss;
+	for(it=attrMM.begin(); it!=attrMM.end(); ++it)
+	{
+		string s = it->first.name_;
+		TeStatisticType sType = it->second;
+
+		ss = getStringFromStatistic(sType);
+		string sss = s + "_" + ss;
+
+		at.rep_ = it->first;
+		at.rep_.isPrimaryKey_ = false;
+
+		if(((db->dbmsName()=="OracleAdo") || 
+			(db->dbmsName()=="OracleSpatial") ) &&
+			(sss.size() > 30))
+		{
+			int s = sss.size(); 
+			at.rep_.name_ = sss.substr(s-30, s-1);
+		}
+		else
+			at.rep_.name_ = sss;
+
+		
+		if(at.rep_.type_ == TeINT)
+			at.rep_.type_ = TeREAL;
+		attList.push_back(at);	
+	}
+	
+/* faz as alteracaoes necessarias nos nomes de campos, para evitar duplicacao de nomes
+   e cria a tabela de dados
+ */
+	changeAttrList(attList);
+	TeTable attTable(newLayer->name(), attList, "object_id_", "object_id_");
+
+	if(!newLayer->createAttributeTable(attTable))
+        return false;
+
+/* monta a query de selecao dos atributos nao espaciais
+ */
+	string queryAtr  = "SELECT " + OID;
+
+	unsigned int lastAttrPos = 0;
+
+	for(i=0; i<agregAttrVec.size(); ++i)
+	{
+		lastAttrPos = i;
+		queryAtr += ", " + agregAttrVec[i];		
+	}
+
+	ss = "";
+
+	for(j=0; j<attrMM.size(); ++j)
+	{
+		string s = attrMM[j].first.name_;
+
+/* verifica se o atributo jah foi incluido no SELECT
+ */
+		bool existedName = false;
+		
+		for(i=0; i<agregAttrVec.size(); ++i)
+		{
+			if(s == agregAttrVec[i])
+			{
+				attrSQLPositionMap[j] = i;
+				existedName=true;
+				break;
+			}
+		}
+
+		if((!existedName) && (s != ss))
+		{
+			queryAtr += ", " + s;
+			++lastAttrPos;
+			attrSQLPositionMap[j] = lastAttrPos;
+		}
+
+		ss = s;
+	}
+
+	queryAtr += theme->sqlFrom();
+
+	if(selOb == TeSelectedByPointing)
+		queryAtr += " WHERE (" + CT + ".c_object_status = 1 OR " + CT + ".c_object_status = 3)";
+	else if(selOb == TeSelectedByQuery)
+		queryAtr += " WHERE (" + CT + ".c_object_status = 2 OR " + CT + ".c_object_status = 3)";
+	queryAtr += " ORDER BY ";
+	for(i=0; i<agregAttrVec.size(); ++i)
+	{
+		queryAtr += agregAttrVec[i];
+		if (i<agregAttrVec.size()-1)
+			queryAtr += ", ";
+	}
+
+/* monta outra query para os atributos espaciais
+ */
+	if(geomRepTheme == TePOLYGONS)
+		geoName = layer->tableName(TePOLYGONS);
+	else if(geomRepTheme == TeLINES)
+		geoName = layer->tableName(TeLINES);
+	else if(geomRepTheme == TePOINTS)
+		geoName = layer->tableName(TePOINTS);
+	else
+		geoName = layer->tableName(TeCELLS);
+
+	TeAttributeList geoAtList;
+	db->getAttributeList(geoName, geoAtList);
+	offset = geoAtList.size();
+
+	if((db->dbmsName()=="OracleAdo") || (db->dbmsName()=="OracleSpatial"))
+		query = "SELECT " + geoName + ".*, ATR.* FROM " + geoName + ", (" + queryAtr + ") ATR ";
+	else
+		query = "SELECT " + geoName + ".*, ATR.* FROM " + geoName + ", (" + queryAtr + ") AS ATR ";
+
+	string newOID = TeGetExtension(OID.c_str());
+
+	if(newOID.empty())
+		newOID = OID;
+
+	query += "WHERE ATR." + newOID + " = " + geoName + ".object_id";
+	query += " ORDER BY ";
+	for(i=0; i<agregAttrVec.size(); ++i)
+	{
+		string newagre = TeGetExtension(agregAttrVec[i].c_str());
+
+		if(newagre.empty())
+			newagre = agregAttrVec[i];
+
+		query += "ATR." + newagre;
+		if(i<agregAttrVec.size()-1)
+			query += ", ";
+	}
+	query += ", " + geoName + ".object_id";
+
+
+	if(geomRepTheme == TePOLYGONS)
+	{
+		if(db->dbmsName() != "OracleSpatial" && db->dbmsName() != "PostGIS")
+			query += ", " + geoName + ".parent_id, " + geoName + ".num_holes DESC";
+	}
+
+	TeDatabasePortal* portal = db->getPortal();
+
+	int total;
+	string qc = "SELECT COUNT(*) FROM " + CT;
+	if(selOb == TeSelectedByPointing)
+		qc += " WHERE " + CT + ".c_object_status = 1 OR " + CT + ".c_object_status = 3";
+	else if(selOb == TeSelectedByQuery)
+		qc += " WHERE " + CT + ".c_object_status = 2 OR " + CT + ".c_object_status = 3";
+	if(portal->query(qc) && portal->fetchRow())
+		total = atoi(portal->getData(0));
+
+	portal->freeResult();
+	if(portal->query(query) && portal->fetchRow())
+	{
+		TeAttributeList& portalAttList = portal->getAttributeList();
+
+		if(geomRepTheme == TePOLYGONS)
+			newLayer->addGeometry(TePOLYGONS);
+		else if(geomRepTheme == TeLINES)
+			newLayer->addGeometry(TeLINES);
+		else if(geomRepTheme == TePOINTS)
+			newLayer->addGeometry(TePOINTS);
+		else
+			newLayer->addGeometry(TeCELLS);
+
+		bool flag = false;
+		int count = 0;			
+		int objectId = 1;
+		string lastOid = portal->getData(offset);
+		lastOid += "aaa";
+		string lastVal;
+
+		for(i=0; i<agregAttrVec.size(); ++i)
+		{
+			string s = portal->getData(agregAttrVec[i]);
+			if(legIndex == (int)i)
+				s = legendLabelMap[atoi(s.c_str())];
+			lastVal += s;
+			if(i<agregAttrVec.size() - 1)
+				lastVal += "_";
+		}
+		
+		TePolygonSet ps;
+		TeMultiGeometry multGeom; 
+
+		if(TeProgress::instance())
+		{
+			string caption = "Aggregation";
+			TeProgress::instance()->setCaption(caption.c_str());
+			string msg = "Executing aggregation. Please, wait!";
+			TeProgress::instance()->setMessage(msg);
+			TeProgress::instance()->setTotalSteps(total);
+			t2 = clock();
+			t0 = t1 = t2;
+		}
+
+		TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
+
+		do
+		{	
+			string oid = portal->getData(offset);
+			string currVal;
+			for(i=0; i<agregAttrVec.size(); ++i)
+			{
+				string s = portal->getData(agregAttrVec[i]);
+				if (legIndex == (int)i)
+					s = legendLabelMap[atoi(s.c_str())];
+				currVal += s;
+				if (i<agregAttrVec.size() - 1)
+					currVal += "_";
+			}
+
+			TePolygon p;
+			TeLine2D  l;
+			TePoint	  pt;
+			TeCell    c;
+			double	  dval;
+
+			if(lastVal == currVal)
+			{				
+				if(oid != lastOid)
+				{
+					count++;
+					//for(j=3, i=offset+(int)agregAttrVec.size()+1; i<(int)portalAttList.size(); ++i, ++j)
+					//offset + 1 = atributos da tabela de geometria + c_object_id
+					for(j=0, i=offset+1; i<portalAttList.size(); ++i, ++j)
+					{
+						string s = portal->getData(i);
+						TeAttrDataType aType = portalAttList[i].rep_.type_;
+						if(aType != TeREAL && aType != TeINT)
+							stringMap[j].push_back(s);
+						else
+						{
+							if(s.empty())
+								dval = TeMAXFLOAT;
+							else
+								dval = atof(s.c_str());
+							doubleMap[j].push_back(dval);
+						}
+					}
+				}
+
+				if(geomRepTheme == TePOLYGONS)
+				{
+					flag = portal->fetchGeometry(p);
+					multGeom.addGeometry(p);					
+				}
+				else if(geomRepTheme == TeLINES)
+				{
+					flag = portal->fetchGeometry(l);
+					multGeom.addGeometry(l);
+				}
+				else if(geomRepTheme == TePOINTS)
+				{
+					flag = portal->fetchGeometry(pt);
+					multGeom.addGeometry(pt);
+				}
+				else
+				{
+					flag = portal->fetchGeometry(c);
+					multGeom.addGeometry(c);
+				}
+			}
+			else  
+			{
+				if(multGeom.hasPolygons())
+				{
+					TePolygonSet polSetValidHoles;
+			
+					if(!TeOVERLAY::TeValidPolygonHoles(multGeom.getPolygons(), polSetValidHoles))
+					{
+						if(TeProgress::instance())
+							TeProgress::instance()->reset();
+
+						delete portal;
+						return false; 
+					}
+
+					TePolygonSet psetOut;
+
+					if(!TeOVERLAY::TeUnion(polSetValidHoles, psetOut))
+					{
+						// when the operation returns false, write in the log a possible
+						// inconsistency in the data
+						if (logFile)
+						{
+							string mess = "Possivel inconsistencia na uniao dos objetos da classe: ";
+							mess += lastVal;
+							logFile->writeString(mess);
+							logFile->writeNewLine();
+						}
+					}
+
+					multGeom.setGeometry(psetOut);
+				}
+
+				if(!multiGeometryToLayer(multGeom, Te2String(objectId), newLayer))
+				{
+					if(TeProgress::instance())
+						TeProgress::instance()->reset();
+
+					delete portal;
+					return false; 
+				}
+
+
+				std::map<int, TeStatisticValMap> statAux;
+				std::map<int, TeStatisticStringValMap> sstatAux;
+
+				valVec.push_back(Te2String(objectId));
+				valVec.push_back(lastVal);
+				valVec.push_back(Te2String(count));
+
+				string currAttr = "";
+				int attPos = 0;
+				for(i=0; i<attrMM.size(); ++i)
+				{
+					if (currAttr != attrMM[i].first.name_)
+					{
+						stat.clear();
+						sstat.clear();
+						attPos = attrSQLPositionMap[i];		
+						currAttr = attrMM[i].first.name_;
+					}
+
+					if(attrMM[i].first.type_ == TeREAL || attrMM[i].first.type_ == TeINT)
+					{
+						std::map<int, TeStatisticValMap>::iterator it = statAux.find(attPos);
+
+						if(it != statAux.end())
+						{
+							double d = (it->second)[attrMM[i].second];
+							valVec.push_back(Te2String(d, 16));
+						}
+						else
+						{
+							TeCalculateStatistics(doubleMap[attPos].begin(), doubleMap[attPos].end(), stat);
+							statAux[attPos] = stat;
+							double d = stat[attrMM[i].second];
+							valVec.push_back(Te2String(d, 16));
+						}
+					}
+					else
+					{
+						std::map<int, TeStatisticStringValMap>::iterator it = sstatAux.find(attPos);
+
+						if(it != sstatAux.end())
+						{
+							string s = (it->second)[attrMM[i].second];
+							valVec.push_back(s);
+						}
+						else
+						{
+							TeCalculateStatistics(stringMap[attPos].begin(), stringMap[attPos].end(), sstat);
+							sstatAux[attPos] = sstat;
+							string s = sstat[attrMM[i].second];
+							valVec.push_back(s);
+						}						
+					}
+				}
+
+				TeTableRow row;
+				for(i=0; i<valVec.size(); ++i)
+					row.push_back(valVec[i]);
+				attTable.add(row);
+
+				valVec.clear();
+				stringMap.clear();
+				doubleMap.clear();
+				count = 0;
+				ps.clear();
+				multGeom.clear();
+				
+				if(oid != lastOid)	// poderia ser igual???? Veja que aqui estamos no else do bloco oid == lastOid!!!!
+				{
+					count++;
+					for(j=0, i=offset+1; i<portalAttList.size(); ++i, ++j)
+					{
+						string s = portal->getData(i);
+						TeAttrDataType aType = portalAttList[i].rep_.type_;
+						if(aType != TeREAL && aType != TeINT)
+							stringMap[j].push_back(s);
+						else
+						{
+							if(s.empty())
+								dval = TeMAXFLOAT;
+							else
+								dval = atof(s.c_str());
+							doubleMap[j].push_back(dval);
+						}
+					}
+				}
+
+				if(geomRepTheme == TePOLYGONS)
+				{
+					flag = portal->fetchGeometry(p);
+					multGeom.addGeometry(p);					
+				}
+				else if(geomRepTheme == TeLINES)
+				{
+					flag = portal->fetchGeometry(l);
+					multGeom.addGeometry(l);
+				}
+				else if(geomRepTheme == TePOINTS)
+				{
+					flag = portal->fetchGeometry(pt);
+					multGeom.addGeometry(pt);
+				}
+				else
+				{
+					flag = portal->fetchGeometry(c);
+					multGeom.addGeometry(c);
+				}
+
+				++objectId;
+			}
+
+			if((oid != lastOid) && TeProgress::instance())
+			{
+				steps++;
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					if(TeProgress::instance()->wasCancelled())
+					{
+						TeProgress::instance()->reset();
+						delete portal;
+						return false;
+					}
+					
+					if((int)(t2-t0) > dt2)
+						TeProgress::instance()->setProgress(steps);
+				}
+			}
+			lastOid = oid;
+			lastVal = currVal;
+
+		}while(flag);
+		if(TeProgress::instance())
+			TeProgress::instance()->reset();
+
+		if(!multGeom.empty())  
+		{
+			if(multGeom.hasPolygons())
+			{
+					TePolygonSet polSetValidHoles;
+					
+					if(!TeOVERLAY::TeValidPolygonHoles(multGeom.getPolygons(), polSetValidHoles))
+					{
+						if(TeProgress::instance())
+							TeProgress::instance()->reset();
+
+						delete portal;
+						return false; 
+					}
+
+					TePolygonSet psetOut;
+
+					if(!TeOVERLAY::TeUnion(polSetValidHoles, psetOut))
+					{
+						// when the operation returns false, write in the log a possible
+						// inconsistency in the data
+						if (logFile)
+						{
+							string mess = "Possivel inconsistencia na uniao dos objetos da classe: ";
+							mess += lastVal;
+							logFile->writeString(mess);
+							logFile->writeNewLine();
+						}
+					}
+
+					multGeom.setGeometry(psetOut);
+			}
+
+			if(!multiGeometryToLayer(multGeom, Te2String(objectId), newLayer))
+			{
+				if(TeProgress::instance())
+					TeProgress::instance()->reset();
+
+				delete portal;
+				return false; 
+			}
+
+			std::map<int, TeStatisticValMap> statAux;
+			std::map<int, TeStatisticStringValMap> sstatAux;
+
+			valVec.push_back(Te2String(objectId));
+			valVec.push_back(lastVal);
+			valVec.push_back(Te2String(count));
+			string currAttr = "";
+			int attPos = 0;
+			for(i = 0; i <attrMM.size(); ++i)
+			{
+				if (currAttr != attrMM[i].first.name_)
+				{
+					stat.clear();
+					sstat.clear();
+					attPos = attrSQLPositionMap[i];		
+					currAttr = attrMM[i].first.name_;
+				}
+				if(attrMM[i].first.type_ == TeREAL || attrMM[i].first.type_ == TeINT)
+				{
+					std::map<int, TeStatisticValMap>::iterator it = statAux.find(attPos);
+
+					if(it != statAux.end())
+					{
+						double d = (it->second)[attrMM[i].second];
+						valVec.push_back(Te2String(d, 16));
+					}
+					else
+					{
+                        TeCalculateStatistics(doubleMap[attPos].begin(), doubleMap[attPos].end(), stat);
+						statAux[attPos] = stat;
+						double d = stat[attrMM[i].second];
+						valVec.push_back(Te2String(d, 16));
+					}
+				}
+				else
+				{
+					std::map<int, TeStatisticStringValMap>::iterator it = sstatAux.find(attPos);
+
+					if(it != sstatAux.end())
+					{
+						string s = (it->second)[attrMM[i].second];
+						valVec.push_back(s);
+					}
+					else
+					{
+                        TeCalculateStatistics(stringMap[attPos].begin(), stringMap[attPos].end(), sstat);
+						sstatAux[attPos] = sstat;
+						string s = sstat[attrMM[i].second];
+						valVec.push_back(s);
+					}						
+				}
+			}	
+
+			TeTableRow row;
+			for(i=0; i<valVec.size(); ++i)
+				row.push_back(valVec[i]);
+			attTable.add(row);
+
+			valVec.clear();
+			stringMap.clear();
+			doubleMap.clear();
+			count = 0;
+			ps.clear();
+			multGeom.clear();
+		}			
+
+		newLayer->saveAttributeTable(attTable);
+	}
+	else
+	{
+		delete portal;
+		return false;
+	}
+
+	delete portal;
+	return true;
+}
+
+
+bool TeGeoOpAdd(TeLayer* newLayer, TeTheme* theme, vector<TeTheme*> themeVec, 
+				TeSelectedObjects selOb,TeAsciiFile* /* logFile */)
+{
+	
+	bool insertAttr = false;
+	
+	// create attribute table from main theme
+	TeAttributeList attrList;
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "object_id_"+ Te2String(newLayer->id());
+	at.rep_.numChar_ = 255;
+	at.rep_.isPrimaryKey_ = true;
+	at.rep_.isAutoNumber_ = false;
+	attrList.push_back(at);
+
+	//main theme
+	TeQuerierParams mainParams(true, true);
+	mainParams.setParams(theme);
+	mainParams.setSelecetObjs(selOb);
+	TeQuerier* mainQuerier = new TeQuerier(mainParams);
+
+	TeGeomRep themeGeomRep = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
+
+	if(!mainQuerier->loadInstances())
+		return false;
+
+	//get attribute list from querier
+	TeAttributeList attribs = mainQuerier->getAttrList();
+	TeAttributeList::iterator it = attribs.begin();
+	while(it != attribs.end())
+	{
+		attrList.push_back (*it);
+		++it;
+	}
+
+	//verify if there are duplicate names
+	changeAttrList(attrList);
+	attrList[0].rep_.isPrimaryKey_ = true;  //link attribute is primary key
+		
+	// --------- create table 
+	TeTable attrTable (newLayer->name(), attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
+
+	if(!newLayer->createAttributeTable(attrTable))
+        return false;
+
+	int newId = 0;
+
+	// ---------------------------------- Begin main theme
+	TeSTInstance st;
+	while(mainQuerier->fetchInstance(st))
+	{
+		TeTableRow row;
+		vector<string>& vect = st.getProperties();
+		row.push_back(Te2String(++newId));
+
+		//insert os valores do tema principal
+		for(int p=0; p<(int)vect.size();++p)
+			row.push_back(vect[p]);
+
+		attrTable.add(row);
+				
+		//insert in this layer only the visible geometries of the theme 
+		if(!multiGeometryToLayer(st.geometries(), Te2String(newId), newLayer, 0, themeGeomRep))
+			return false; 
+		
+		if((newId%100)==0)
+		{
+			//insert attributes
+			newLayer->saveAttributeTable(attrTable); //save 100 records!!!
+			if(attrTable.size()>0)
+				insertAttr = true;
+			attrTable.clear();
+		}
+	} 	//while fetchInstance no querier
+
+	
+	// save the last records 
+	newLayer->saveAttributeTable(attrTable); 
+	if(attrTable.size()>0)
+		insertAttr = true;
+	attrTable.clear();
+	st.clear();
+	delete mainQuerier;
+
+	// ---------------------------------- End main theme
+
+	for(int i=0; i<(int)themeVec.size(); ++i)
+	{
+		TeTheme* temp = themeVec[i];
+		TeProjection* projTemp = temp->layer()->projection();
+		
+		TeQuerierParams params(true, true);
+
+		params.setParams(temp);
+		params.setSelecetObjs (selOb);
+		TeQuerier* querier = new TeQuerier(params);
+
+		TeGeomRep tempGeomRep = (TeGeomRep)(temp->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
+
+		if(!querier->loadInstances())
+			return false;
+
+		attribs.clear();
+		attribs = querier->getAttrList();
+		vector<int> indexVec;
+
+		for(int k=0; k<(int)attrList.size(); ++k)
+		{
+			string name = attrList[k].rep_.name_;
+			int ind = -1;
+			
+			for(int p=0; p<(int)attribs.size();++p)
+			{
+				if(TeConvertToUpperCase(name) == TeConvertToUpperCase(attribs[p].rep_.name_))
+				{
+					ind = p;
+					break;
+				}
+			}
+
+			indexVec.push_back(ind);
+		}
+					
+		while(querier->fetchInstance(st))
+		{
+			TeTableRow row;
+			vector<string>& vect = st.getProperties();
+			row.push_back(Te2String(++newId));
+
+			//insert the values when the names are equals
+			for(int p=1; p<(int)attrList.size();++p)
+			{
+				int s = indexVec[p];
+				if(s<0)
+					row.push_back("");
+				else
+					row.push_back(vect[s]);
+			}
+
+			attrTable.add(row);
+					
+			if(!multiGeometryToLayer(st.geometries(), Te2String(newId), newLayer, projTemp, tempGeomRep))
+				return false; 
+										
+			if((newId%100)==0)
+			{
+				//insert attributes
+				newLayer->saveAttributeTable(attrTable); //save 100 records!!!
+				if(attrTable.size()>0)
+					insertAttr = true;
+				attrTable.clear();
+			}
+		}  //while fetchInstance no querier
+	
+		newLayer->saveAttributeTable(attrTable); //save the last records!!!
+		if(attrTable.size()>0)
+			insertAttr = true;
+		attrTable.clear();
+		st.clear();
+	}
+
+	if(!newLayer->box().isValid())
+		return false;
+
+	if(!insertAttr)
+		return false; 
+
+	return true;
+}
+
+bool TeGeoOpOverlayIntersection(TeLayer* newLayer, TeTheme* theme, TeTheme* themeTrim, 
+								TeSelectedObjects selOb, TeSelectedObjects selObTrim, 
+								bool attrTrim, TeAsciiFile* logFile)
+{
+	if((!newLayer) || (!theme) || (!themeTrim))
+		return false;
+
+// check the theme with less polygons
+	bool invert = false;
+
+	TeGeomRep geomRepTheme = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
+	TeGeomRep geomRepThemeTrim = (TeGeomRep)(themeTrim->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
+
+	if((geomRepTheme == TePOLYGONS) && (geomRepThemeTrim==TePOLYGONS))
+	{
+		int themeCount = countNumGeometries(theme, selOb);
+		int themeTrimCount = countNumGeometries(themeTrim, selObTrim);
+
+		if(themeTrimCount > themeCount)
+		{
+			if(geomRepTheme == TePOLYGONS)
+			{
+				invert = true;
+
+				TeTheme* aux = theme;
+				theme = themeTrim;
+				themeTrim = aux;
+			}
+		}
+	}
+
+	bool insertAttr = false;
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+		
+	// ----------------- begin create attribute table
+
+	TeAttributeList attrList;
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "object_id_"+ Te2String(newLayer->id());
+	at.rep_.numChar_ = 255;
+	at.rep_.isPrimaryKey_ = true;
+	at.rep_.isAutoNumber_ = false;
+	attrList.push_back(at);
+
+	TeAttrTableVector attrTablesAux;
+
+	if(invert)
+		themeTrim->getAttTables(attrTablesAux, TeAttrStatic);		
+	else
+		theme->getAttTables(attrTablesAux, TeAttrStatic);		
+
+	for(unsigned int idx = 0; idx < attrTablesAux.size(); ++idx)
+	{
+		TeAttributeList& attlistAux = attrTablesAux[idx].attributeList();
+
+		TeAttributeList::iterator it = attlistAux.begin();
+
+		while(it != attlistAux.end())
+		{
+			TeAttribute at = *it;
+			at.rep_.isPrimaryKey_ = false;
+
+			attrList.push_back(at);
+			++it;
+		}
+	}
+
+	attrTablesAux.clear();
+
+	if(attrTrim)
+	{
+		if(invert)
+			theme->getAttTables(attrTablesAux, TeAttrStatic);	
+		else
+			themeTrim->getAttTables(attrTablesAux, TeAttrStatic);	
+
+		for(unsigned int idx = 0; idx < attrTablesAux.size(); ++idx)
+		{
+			TeAttributeList& attlistAux = attrTablesAux[idx].attributeList();
+
+			TeAttributeList::iterator it = attlistAux.begin();
+
+			while(it != attlistAux.end())
+			{
+				TeAttribute at = *it;
+				at.rep_.isPrimaryKey_ = false;
+
+				attrList.push_back(at);
+				++it;
+			}
+		}
+	}	
+
+	changeAttrList(attrList);
+
+	attrList[0].rep_.isPrimaryKey_ = true;  //link attribute is primary key
+	
+	TeTable attrTable(newLayer->name(), attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
+
+	if(!newLayer->createAttributeTable(attrTable))
+        return false;
+
+// query geometries
+
+	TeLayer* layer = theme->layer();
+	TeLayer* layerTrim = themeTrim->layer();
+
+	TeProjection* proj = layer->projection();
+	TeProjection* projTrim = layerTrim->projection();
+
+	//Querier Trim
+	TeQuerierParams paramsTrim(true, true);
+	paramsTrim.setParams(themeTrim);
+
+	if(invert)
+		paramsTrim.setSelecetObjs(selOb);
+	else
+		paramsTrim.setSelecetObjs(selObTrim);
+
+	TeQuerier  querierTrim(paramsTrim); 
+
+	if(!querierTrim.loadInstances())
+		return  false;
+	
+	// ----------------- End create attribute table
+	int numPolygonsTrim = querierTrim.numElemInstances();
+	// set progress bar
+	if(TeProgress::instance())
+	{
+		string caption = "Overlay Intersection";
+		string msg = "Executing Overlay Intersection. Please, wait!";
+		TeProgress::instance()->setCaption(caption.c_str());
+		TeProgress::instance()->setMessage(msg);
+		TeProgress::instance()->setTotalSteps(numPolygonsTrim);
+		t2 = clock();
+		t0 = t1 = t2;
+	}
+
+	double tol = TeGetPrecision(proj);
+	TePrecision::instance().setPrecision(tol);
+
+	int steps = 0;
+	TeSTInstance trim;
+	int newId = 0;
+
+// this map stores the id of boundary cells, that we need to decide atribute value
+	map<string, map<string, double> > cellMap;
+
+	while(querierTrim.fetchInstance(trim))
+	{
+		TePolygonSet polSet;
+		if(!trim.getGeometry(polSet))
+			continue;
+
+		TeTableRow rowTrim;
+		if(invert || attrTrim)
+		{
+			//fill attribute values from trim
+			vector<string>& vecTrim = trim.getProperties();
+
+			for(int p=0; p<(int)vecTrim.size();++p)
+				rowTrim.push_back(vecTrim[p]);
+		}
+
+		TePolygonSet ps;
+		TeLineSet	ls;
+		TePointSet pts;
+		TeCellSet cs;
+
+		for(int i=0; i<(int)polSet.size(); ++i)
+		{
+			TePolygon polyTrim = polSet[i];
+						
+			if(!((*proj) == (*projTrim)))
+			{
+				TePolygon pout;
+				TeVectorRemap (polyTrim, projTrim, pout, proj);
+				polyTrim = pout;
+				polyTrim.objectId(polSet[i].objectId());
+			}
+
+			// before intersection, valid polygon holes (union of holes)
+			TePolygonSet polyTrimSet;
+			if(!TeOVERLAY::TeValidPolygonHoles(polyTrim, polyTrimSet))
+			{
+				// when the operation returns false, write in the log a possible
+				// inconsistency in the data
+				if (logFile)
+				{
+					string mess = "Nao foi possivel realizar a consistencia dos aneis internos ";
+					mess += polyTrim.objectId();
+					mess += " do tema " + themeTrim->name() + ".";
+					logFile->writeString(mess);
+					logFile->writeNewLine();
+				}
+
+				continue;
+			}
+
+			TeBox boxTrim = polyTrim.box();
+
+			//Querier - theme that will be clip
+			TeQuerierParams params(true, true);
+			params.setParams(theme);
+
+			if(invert)
+				params.setSelecetObjs(selObTrim);
+			else
+				params.setSelecetObjs(selOb);
+
+			params.setSpatialRest(boxTrim, TeINTERSECTS, geomRepTheme);
+
+			TeQuerier querier(params);
+
+			if(!querier.loadInstances())
+				continue;
+			
+			TeSTInstance sti;
+			while(querier.fetchInstance(sti))
+			{
+				TeTableRow row;
+				vector<string>& vect = sti.getProperties();
+				row.push_back("");
+
+				if(invert)
+				{
+					for(int i=0; i<(int)rowTrim.size(); ++i)
+						row.push_back(rowTrim[i]);
+
+					if(attrTrim)
+					{
+						//insert values of the theme that is been clip 
+						for(int p=0; p<(int)vect.size();++p)
+							row.push_back(vect[p]);
+					}
+				}
+				else
+				{
+					//insert values of the theme that is been clip 
+					for(int p=0; p<(int)vect.size();++p)
+						row.push_back(vect[p]);
+
+					if(attrTrim)
+					{
+						for(int i=0; i<(int)rowTrim.size(); ++i)
+							row.push_back(rowTrim[i]);
+					}
+				}	
+				
+				if(sti.hasPolygons() && (geomRepTheme==TePOLYGONS))
+				{
+					TePolygonSet polSetTheme;
+					sti.getGeometry (polSetTheme);
+					TePolygonSet polSetAux;
+					TePolygonSet resultPS;
+
+					for(int j=0; j<(int)polSetTheme.size(); ++j)
+					{
+						if(TeIntersects(polSetTheme[j].box(), polyTrim.box()))
+							polSetAux.add(polSetTheme[j]);
+					}
+
+					// before intersection, valid polygon holes (union of holes)
+					TePolygonSet polSetValidHoles;
+					if(!TeOVERLAY::TeValidPolygonHoles(polSetAux, polSetValidHoles))
+					{
+						// when the operation returns false, write in the log a possible
+						// inconsistency in the data
+						if (logFile)
+						{
+							string mess = "Nao foi possivel realizar a consistencia dos aneis internos ";
+							mess += polyTrim.objectId();
+							mess += " do tema " + themeTrim->name() + " e ";
+							mess += polSetTheme[0].objectId();
+							mess += theme->name();
+							logFile->writeString(mess);
+							logFile->writeNewLine();
+						}
+
+						continue;
+					}
+
+					if(!TeOVERLAY::TeIntersection(polyTrimSet, polSetValidHoles, resultPS))
+					{
+						// when the operation returns false, write in the log a possible
+						// inconsistency in the data
+						if (logFile)
+						{
+							string mess = "Possivel inconsistencia na interseccao do objeto ";
+							mess += polyTrim.objectId();
+							mess += " do tema " + themeTrim->name() + " e ";
+							mess += polSetTheme[0].objectId();
+							mess += theme->name();
+							logFile->writeString(mess);
+							logFile->writeNewLine();
+						}
+					}
+
+					if(resultPS.empty())
+						continue;
+
+					newId++;
+					string strnewid = Te2String(newId);
+					row[0] = strnewid;
+					attrTable.add(row);
+
+					for(int c=0; c<(int)resultPS.size(); ++c)
+					{							
+						resultPS[c].objectId(strnewid);
+						ps.add(resultPS[c]);
+					}
+				}
+				else if (sti.hasLines() && (geomRepTheme==TeLINES))
+				{
+					TeLineSet lineSet;
+					sti.getGeometry (lineSet);
+
+					for(int j=0; j<(int)lineSet.size(); ++j)
+					{
+						TeLineSet lsAux, resultLS;
+						TeMultiGeometry resultMGEOM;
+						lsAux.add(lineSet[j]);
+						resultMGEOM = TeOVERLAY::TeIntersection(lsAux, polyTrimSet);
+
+						resultMGEOM.getGeometry(resultLS);
+						
+						for(int c=0; c<(int)resultLS.size(); ++c)
+						{
+							newId++;
+							TeLine2D laux = resultLS[c];
+							laux.objectId(Te2String(newId));
+
+							ls.add(laux);
+							row[0] = Te2String(newId);
+							attrTable.add(row);
+						}
+					}
+				}
+				else if (sti.hasPoints() && (geomRepTheme==TePOINTS))
+				{
+					TePointSet pointSet;
+					sti.getGeometry (pointSet);
+
+					for(int j=0; j<(int)pointSet.size(); ++j)
+					{
+						if(TeWithin(pointSet[j], polyTrim))
+						{
+							newId++;
+							pointSet[j].objectId(Te2String(newId));
+							pts.add(pointSet[j]);
+							row[0] = Te2String(newId);
+							attrTable.add(row);
+						}
+					}
+				}
+				else if (sti.hasCells() && (geomRepTheme==TeCELLS))
+				{
+					TeCellSet cellSet;
+					sti.getGeometry (cellSet);					
+
+					for(int j=0; j<(int)cellSet.size(); ++j)
+					{
+						TePolygon pCell = TeMakePolygon(cellSet[j].box());
+						
+						short rel = TeRelation(pCell, polyTrim);
+
+						if((rel & TeWITHIN) || (rel & TeCOVEREDBY))
+						{
+							newId++;
+							cellSet[j].objectId(Te2String(newId));
+							cs.add(cellSet[j]);
+							row[0] = Te2String(newId);
+							attrTable.add(row);
+						}
+						else
+						{							
+							TePolygonSet pCells;
+							pCells.add(pCell);
+							TePolygonSet resultPS;
+
+							if(!TeOVERLAY::TeIntersection(pCells, polyTrimSet, resultPS))
+							{
+								// when the operation returns false, write in the log a possible
+								// inconsistency in the data
+								if(logFile)
+								{
+									string mess = "Possivel inconsistencia na interseccao do objeto ";
+									mess += polyTrim.objectId();
+									mess += " do tema " + themeTrim->name() + " e ";
+									mess += cellSet[j].objectId();
+									mess += theme->name();
+									logFile->writeString(mess);
+									logFile->writeNewLine();
+								}
+
+								continue;
+							}
+
+							if(resultPS.empty())
+								continue;
+
+							double area = TeGeometryArea(resultPS);
+
+							insertArea(cellSet[j].objectId(), polyTrim.objectId(), area, cellMap);
+						}
+					}
+
+				}
+			} //while fetchInstance 
+		}//for each polygon of the Trim theme
+
+		//inserir a geometria no banco
+		if(geomRepTheme == TePOLYGONS && ps.size())
+			newLayer->addPolygons(ps);
+		else if(geomRepTheme == TeLINES && ls.size())
+			newLayer->addLines(ls);
+		else if(geomRepTheme == TePOINTS && pts.size())
+			newLayer->addPoints(pts);
+		else if(cs.size())
+		{
+			cs.resX(theme->layer()->getRepresentation(TeCELLS)->resX_);
+			cs.resY(theme->layer()->getRepresentation(TeCELLS)->resY_);
+			newLayer->addCells(cs);
+		}
+
+		trim.clear();
+
+		steps++;
+		t2 = clock();
+		if ((TeProgress::instance()) && (int(t2-t1) > dt))
+		{
+			t1 = t2;
+			if(TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			if((int)(t2-t0) > dt2)
+				TeProgress::instance()->setProgress(steps);
+		}
+
+		if((steps%100)==0)
+		{
+			newLayer->saveAttributeTable(attrTable); //save 100 records!!!
+			if(attrTable.size()>0)
+				insertAttr = true;
+			attrTable.clear();
+		}
+	} //while fetch instance querier Trim
+
+	newLayer->saveAttributeTable(attrTable); //save the last records!!!
+	if(attrTable.size()>0)
+		insertAttr = true;
+
+	if(TeProgress::instance())
+			TeProgress::instance()->reset();
+
+	if(!cellMap.empty())
+	{
+		bool res = false;
+		if(attrTrim)
+			res = insertBoundaryCells(newId, newLayer, cellMap, theme, themeTrim);
+		else
+			res = insertBoundaryCells(newId, newLayer, cellMap, theme, 0);
+
+		if(!res)
+		{
+			if(TeProgress::instance())
+				TeProgress::instance()->reset();
+
+			return false;
+		}
+	}
+
+	if(!newLayer->box().isValid())
+		return false;
+
+	if(!insertAttr)
+		return false; 
+
+	return true;
+}
+
+bool TeGeoOpAssignDataLocationDistribute(TeTheme* themeMod, TeTheme* theme, const string& tableName, 
+										 const int& spatialRelation, const vector<string>& attributes, TeAsciiFile* logFile)
+{
+	if((!themeMod) || (!themeMod->layer()) ||  (!theme))
+		return false;
+
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+
+	TeLayer* layerMod = themeMod->layer();	
+	TeProjection* projMod = layerMod->projection();
+	TeProjection* proj = theme->layer()->projection();
+	
+	TeGeomRep geomRepThemeMod = (TeGeomRep)(themeMod->visibleGeoRep() & ~TeTEXT);
+	TeGeomRep geomRepTheme = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT);
+
+	//Querier from theme 
+	TeQuerierParams params(true, true);
+	params.setParams(theme);
+	if (!attributes.empty())
+		params.setFillParams(true,false,attributes);
+	TeQuerier  querier(params); 
+
+	if(!querier.loadInstances())
+		return  false;
+
+	// ----------------- begin create attribute table
+
+	TeAttributeList attrList;
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "object_id_";
+	at.rep_.numChar_ = 255;
+	at.rep_.isPrimaryKey_ = true;
+	at.rep_.isAutoNumber_ = false;
+	attrList.push_back(at);
+
+	//get attribute list from querier
+	TeAttributeList attribs = querier.getAttrList();
+	TeAttributeList::iterator it = attribs.begin();
+	while(it != attribs.end())
+	{
+		attrList.push_back (*it);
+		++it;
+	}
+						
+	changeAttrList(attrList);
+	attrList[0].rep_.isPrimaryKey_ = true;  //link attribute is primary key
+	
+	TeTable attrTable (tableName, attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
+
+	if(!layerMod->createAttributeTable(attrTable))
+        return false;
+
+	//empty rows
+	TeTable updateAttrTable (tableName, attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
+	
+	// ----------------- End create attribute table
+	vector<string> objIds;
+	if( (geomRepTheme == TePOLYGONS) || 
+		(geomRepTheme == TeCELLS)    ||
+		((geomRepThemeMod == TeLINES) && (geomRepTheme == TeLINES))) 
+	{
+		int numElem = querier.numElemInstances();
+		
+		// set progress bar
+		if(TeProgress::instance())
+		{
+			string caption = "Spatial Join";
+			string msg = "Executing Spatial Join. Please, wait!";
+			TeProgress::instance()->setCaption(caption.c_str());
+			TeProgress::instance()->setMessage(msg);
+			TeProgress::instance()->setTotalSteps(numElem);
+			t2 = clock();
+			t0 = t1 = t2;
+		}
+	
+		int steps = 0;
+		TeSTInstance sti;
+
+		double tol = TeGetPrecision(projMod);
+		TePrecision::instance().setPrecision(tol);	
+
+		while(querier.fetchInstance(sti))
+		{
+			// Get attributes
+			TeTableRow row;
+			TeTableRow emptyRow;
+
+			row.push_back("");
+			emptyRow.push_back("");
+
+			vector<string>& vec = sti.getProperties();
+			for(int p=0; p<(int)vec.size();++p)
+			{
+				row.push_back(vec[p]);
+				emptyRow.push_back ("");
+			}
+			
+			//Get geometry
+			TeMultiGeometry mGeom;
+			sti.getGeometry(mGeom);
+
+			vector<TeGeometry*> geoms;
+			mGeom.getGeometry(geoms);
+
+			for(int i=0; i<(int)geoms.size(); ++i)
+			{
+				if(!((*proj) == (*projMod)))
+				{
+					TeGeometry* gout; 
+					if(geoms[i]->elemType()==TePOLYGONS && geomRepTheme==TePOLYGONS)
+					{
+						gout = new TePolygon;
+						TeVectorRemap (*((TePolygon*)geoms[i]), proj, *((TePolygon*)gout), projMod);
+					}
+					else if (geoms[i]->elemType() == TeCELLS && geomRepTheme==TeCELLS)
+					{
+						gout = new TeCell;
+						TeVectorRemap (*((TeCell*)geoms[i]), proj, *((TeCell*)gout), projMod);
+					}
+					else
+					{
+						gout = new TeLine2D;
+						TeVectorRemap (*((TeLine2D*)geoms[i]), proj, *((TeLine2D*)gout), projMod);
+					}
+					gout->objectId(geoms[i]->objectId());
+					delete geoms[i];
+					geoms[i] = gout;
+				}
+				
+				//querier that will be modified
+				TeQuerierParams paramsMod(false, false);
+				paramsMod.setParams(themeMod);
+				paramsMod.setSpatialRest(geoms[i], spatialRelation, geomRepThemeMod);
+				TeQuerier querierMod(paramsMod);
+
+				if(!querierMod.loadInstances())
+					continue;
+				
+				TeSTInstance stMod;
+				while(querierMod.fetchInstance(stMod))
+				{
+					string obj = stMod.objectId();
+					if( find(objIds.begin(), objIds.end(), obj) == objIds.end())
+					{
+						objIds.push_back (obj);
+						row[0] = obj;
+						attrTable.add(row);
+					}
+					else 
+					{
+						emptyRow[0] = obj;
+						updateAttrTable.add(emptyRow);
+
+						if (logFile)
+						{
+							std::string mess = "O ponto [" + obj + "] se relaciona com mais de um poligono.";
+							logFile->writeString(mess);
+							logFile->writeNewLine();
+						}
+					}
+				}
+				
+				if(attrTable.size()>100)
+				{
+					layerMod->saveAttributeTable(attrTable); //save 100 records!!!
+					layerMod->database()->updateTable(updateAttrTable);
+					attrTable.clear();
+					updateAttrTable.clear();
+				}
+			} // for
+			
+			for(int j=0; j<(int)geoms.size(); ++j)
+				delete (geoms[j]);  //delete allocated geometries 
+
+			steps++;
+			t2 = clock();
+			if ((TeProgress::instance()) && (int(t2-t1) > dt))
+			{
+				t1 = t2;
+				if(TeProgress::instance()->wasCancelled())
+				{
+					TeProgress::instance()->reset();
+					return false;
+				}
+				if((int)(t2-t0) > dt2)
+					TeProgress::instance()->setProgress(steps);
+			}
+
+		} //while 
+	} //if geometry type
+	else 
+	{
+		return false;  //use nearest neighbor
+	}
+				
+	if(TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	layerMod->saveAttributeTable(attrTable); //save the last records!!!
+	layerMod->database()->updateTable(updateAttrTable);
+	
+	return true;
+}
+
+
+bool TeGeoOpOverlayUnion(TeLayer* newLayer, TeTheme* theme, TeTheme* themeOverlay, 
+						 TeSelectedObjects selOb, TeSelectedObjects selObOverlay, TeAsciiFile* logFile)
+{
+///////////////////////////////////////////////////////////////////
+return false;
+// verifivar se vai trabalhar com celulas
+// se vai, modificar a interface.....
+///////////////////////////////////////////////////////////////////
+	if((!newLayer) || (!theme) || (!themeOverlay))
+		return false;
+
+	bool insertAttr = false;
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+		
+	TeLayer* layer = theme->layer();
+	TeLayer* layerOverlay = themeOverlay->layer();
+
+	TeGeomRep geomRepTheme = (TeGeomRep)(theme->visibleGeoRep() & ~TeTEXT);
+	
+	TeProjection* proj = layer->projection();
+	TeProjection* projOverlay = layerOverlay->projection();
+
+	//Querier Overlay
+	TeQuerierParams paramsOverlay(true, true);
+	paramsOverlay.setParams(themeOverlay);
+	paramsOverlay.setSelecetObjs(selObOverlay);
+	TeQuerier  querierOverlay(paramsOverlay); 
+
+	if(!querierOverlay.loadInstances())
+		return  false;
+
+	// ----------------- begin create attribute table
+
+	TeAttributeList attrList;
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "object_id_"+ Te2String(newLayer->id());
+	at.rep_.numChar_ = 255;
+	at.rep_.isPrimaryKey_ = true;
+	at.rep_.isAutoNumber_ = false;
+	attrList.push_back(at);
+
+	//theme
+	TeQuerierParams paramsTemp(false, true);
+	paramsTemp.setParams(theme);
+	TeQuerier* querierTemp = new TeQuerier(paramsTemp);
+
+	if(!querierTemp->loadInstances())
+		return false;
+
+	//get attribute list from querier
+	TeAttributeList attribs = querierTemp->getAttrList();
+	TeAttributeList::iterator it = attribs.begin();
+	while(it != attribs.end())
+	{
+		attrList.push_back (*it);
+		++it;
+	}
+						
+	delete querierTemp;
+
+	//overlay
+	attribs.clear();
+	attribs = querierOverlay.getAttrList(); 
+
+	//fill attributes from Overlay theme 
+	it = attribs.begin();
+	while(it != attribs.end())
+	{
+		attrList.push_back (*it);
+		++it;
+	}
+
+	changeAttrList(attrList);
+	attrList[0].rep_.isPrimaryKey_ = true;  //link attribute is primary key
+	
+	TeTable attrTable (newLayer->name(), attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
+
+	if(!newLayer->createAttributeTable(attrTable))
+        return false;
+	
+	// ----------------- End create attribute table
+	int numPolygonsOverlay = querierOverlay.numElemInstances();
+	// set progress bar
+	if(TeProgress::instance())
+	{
+		string caption = "Overlay Union";
+		string msg = "Executing Overlay Union. Please, wait!";
+		TeProgress::instance()->setCaption(caption.c_str());
+		TeProgress::instance()->setMessage(msg);
+		TeProgress::instance()->setTotalSteps(numPolygonsOverlay);
+		t2 = clock();
+		t0 = t1 = t2;
+	}
+
+	double tol = TeGetPrecision(layer->projection());
+	TePrecision::instance().setPrecision(tol);	
+
+	int steps = 0;
+	TeSTInstance Overlay;
+	int newId = 0;
+
+	while(querierOverlay.fetchInstance(Overlay))
+	{
+		TePolygonSet polSet;
+		if(!Overlay.getGeometry(polSet))
+			continue;
+
+		TeTableRow rowOverlay;
+		//fill attribute values from Overlay
+		vector<string>& vecOverlay = Overlay.getProperties();
+
+		for(int p=0; p<(int)vecOverlay.size();++p)
+			rowOverlay.push_back(vecOverlay[p]);
+
+		TePolygonSet ps;
+//		TeCellSet cs;
+
+		for(int i=0; i<(int)polSet.size(); ++i)
+		{
+			TePolygon polyOverlay = polSet[i];
+						
+			if(!((*proj) == (*projOverlay)))
+			{
+				TePolygon pout;
+				TeVectorRemap (polyOverlay, projOverlay, pout, proj);
+				pout.objectId(polyOverlay.objectId());
+				polyOverlay = pout;
+			}
+
+			TePolygonSet polyOverlaySet;
+			polyOverlaySet.add(polyOverlay);
+
+			TeBox boxOverlay = polyOverlay.box();
+
+			//Querier - theme that will be clip
+			TeQuerierParams params(true, true);
+			params.setParams(theme);
+			params.setSelecetObjs(selOb);
+			params.setSpatialRest(boxOverlay, TeINTERSECTS, geomRepTheme);
+
+			TeQuerier querier(params);
+
+			if(!querier.loadInstances())
+				continue;
+			
+			TeSTInstance sti;
+			while(querier.fetchInstance(sti))
+			{
+				TeTableRow row;
+				vector<string>& vect = sti.getProperties();
+				row.push_back("");
+
+				//insert values of the theme that is been clip 
+				for(int p=0; p<(int)vect.size();++p)
+					row.push_back(vect[p]);
+
+				for(int i=0; i<(int)rowOverlay.size(); ++i)
+					row.push_back(rowOverlay[i]);
+				
+				if(sti.hasPolygons() && (geomRepTheme==TePOLYGONS))
+				{
+					TePolygonSet polSet;
+					sti.getGeometry (polSet);
+
+					for(int j=0; j<(int)polSet.size(); ++j)
+					{
+						TePolygonSet psAux, resultPS;
+						psAux.add(polSet[j]);
+						if(!TeOVERLAY::TeIntersection(polyOverlaySet, psAux, resultPS))
+						{
+							// when the operation returns false, write in the log a possible
+							// inconsistency in the data
+							if (logFile)
+							{
+								string mess = "Possivel inconsistencia na interseccao do objeto ";
+								mess += polyOverlay.objectId();
+								mess += " e ";
+								mess += polSet[j].objectId();
+								logFile->writeString(mess);
+								logFile->writeNewLine();
+							}
+						}
+						
+						for(int c=0; c<(int)resultPS.size(); ++c)
+						{
+							newId++;
+							TePolygon paux = resultPS[c];
+							paux.objectId(Te2String(newId));
+							ps.add(paux);
+							row[0] = Te2String(newId);
+							attrTable.add(row);
+						}
+					}
+				}
+//				else if (sti.hasCells())
+//				{
+//					TeCellSet cellSet;
+//					sti.getGeometry (cellSet);
+//
+//					for(int j=0; j<(int)cellSet.size(); ++j)
+//					{
+//						if(TeIntersects(cellSet[j], polyOverlay))
+//						{
+//							newId++;
+//							cellSet[j].objectId(Te2String(newId));
+//							cs.add(cellSet[j]);
+//							row[0] = Te2String(newId);
+//							attrTable.add(row);
+//						}
+//					}
+//				}
+			} //while fetchInstance 
+		}//for each polygon of the Overlay theme
+
+		//inserir a geometria no banco
+		if(geomRepTheme==TePOLYGONS && ps.size())
+			newLayer->addPolygons(ps);
+//		else if(cs.size())
+//			newLayer->addCells(cs);
+
+		Overlay.clear();
+
+		steps++;
+		t2 = clock();
+		if ((TeProgress::instance()) && (int(t2-t1) > dt))
+		{
+			t1 = t2;
+			if(TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			if((int)(t2-t0) > dt2)
+				TeProgress::instance()->setProgress(steps);
+		}
+
+		if((steps%100)==0)
+		{
+			newLayer->saveAttributeTable(attrTable); //save 100 records!!!
+			if(attrTable.size()>0)
+				insertAttr = true;
+			attrTable.clear();
+		}
+	} //while fetch instance querier Overlay
+
+	if(TeProgress::instance())
+			TeProgress::instance()->reset();
+
+	newLayer->saveAttributeTable(attrTable); //save the last records!!!
+	if(attrTable.size()>0)
+		insertAttr = true;
+
+	if(!newLayer->box().isValid())
+		return false;
+
+	if(!insertAttr)
+		return false; 
+
+	return true;
+}
+
+
+bool TeGeoOpAssignByLocationCollect(TeTheme* restrTheme, TeTheme* srcTheme, 
+									const string& newTableName, TeGroupingAttr& measuresColl, 
+									const int& spatialRelation)
+{
+	if(!restrTheme || !restrTheme->layer() ||		// no spatial restriction theme
+	   !srcTheme ||									// no source theme
+	   newTableName.empty() ||						// no output table name 
+	   measuresColl.empty())
+	   return false;
+
+	// verifies if the souce and restriction themes are compatible
+	TeGeomRep restrRep = (TeGeomRep)(restrTheme->visibleGeoRep() & ~TeTEXT);
+	TeGeomRep srcRep =  (TeGeomRep)(srcTheme->visibleGeoRep() & ~TeTEXT);
+	TeRaster* rst = 0;
+	if (srcRep == TeRASTER)
+	{
+		if (restrRep != TePOINTS)
+			return false;
+		rst = srcTheme->layer()->raster();
+		if (!rst)
+			return false;
+	}
+	else
+	{
+		if (restrRep != TePOLYGONS && restrRep != TeCELLS)	// no set of measures to collect
+			return false;
+	}
+
+	TeProjection* restrProj = restrTheme->layer()->projection();
+	TeProjection* srcProj	= srcTheme->layer()->projection();
+	bool doRemap = !(*restrProj == *srcProj);
+
+	// try to retrieve the geometries of the spatial restriction theme
+	TeQuerierParams params(true, false);
+	params.setParams(restrTheme);
+	TeQuerier spatialRestrictions(params); 
+	if(!spatialRestrictions.loadInstances())
+		return false;
+
+	// there is at least one restriction geometry, so create the output table
+	// defines its attribute list
+
+	TeAttributeList attrList;
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.name_ = "object_id_";
+	at.rep_.numChar_ = 255;
+	attrList.push_back(at);
+	vector<int>  countAttr;
+	int attrNum = 1;
+	vector<int> bandCollection;
+
+	TeGroupingAttr::iterator it = measuresColl.begin();		// for each different measure
+	while (it != measuresColl.end())						// create a new attribute
+	{
+		at.rep_ = it->first;
+		at.rep_.isPrimaryKey_ = false;
+		string nameTemp = it->first.name_ + "_" + getStringFromStatistic(it->second);
+		if(((restrTheme->layer()->database()->dbmsName()=="OracleAdo") || 
+			(restrTheme->layer()->database()->dbmsName()=="OracleSpatial") ) &&
+			(nameTemp.size() > 30))
+		{
+			int s = nameTemp.size(); 
+			at.rep_.name_ = nameTemp.substr(s-30, s-1);
+		}
+		else
+			at.rep_.name_ = nameTemp;
+
+		if (srcRep == TeRASTER)
+		{
+			int nn = at.rep_.name_.find("_");
+			int b = atoi(at.rep_.name_.substr(4,nn-4).c_str());
+			bandCollection.push_back(b);
+			if (rst->params().dataType_[b]== TeFLOAT || 
+				rst->params().dataType_[b]== TeDOUBLE)
+				at.rep_.type_ = TeREAL;
+			else
+				at.rep_.type_ = TeINT;
+			attrList.push_back(at);
+			++it;
+			continue;
+		}
+			
+		if (it->second == TeCOUNT || it->second == TeVALIDCOUNT)
+		{
+			at.rep_.type_ = TeINT;
+			countAttr.push_back (attrNum);
+		}
+		else if (at.rep_.type_ == TeINT)
+			at.rep_.type_ = TeREAL;
+
+		attrList.push_back(at);
+		++it;
+		++attrNum;
+	}	
+
+	changeAttrList(attrList);	// validates attribute list						
+	attrList[0].rep_.isPrimaryKey_ = true;
+	attrList[0].rep_.isAutoNumber_ = false;
+
+	TeTable measuresTable (newTableName, attrList, attrList[0].rep_.name_, attrList[0].rep_.name_);
+	if(!restrTheme->layer()->createAttributeTable(measuresTable)) // creates the new attribute table
+        return false;
+
+	//use function to point and cell
+	TeDatabase* db = restrTheme->layer()->database();
+	int spatialRes = TeOVERLAPS | TeWITHIN | TeCOVEREDBY | TeCROSSES;
+	bool sqlGroup = false;
+	
+	if( (*restrProj==*srcProj) && 
+		(((restrRep==TeCELLS) && (srcRep==TePOINTS)) ||
+		((restrRep==TeCELLS) && (srcRep==TeCELLS) && ((spatialRelation==TeINTERSECTS) || 
+		(spatialRelation==spatialRes)))))
+	{
+		if(TeCellStatistics(restrTheme, measuresTable, measuresColl, srcTheme, restrTheme->layer()->database()))
+			sqlGroup = db->insertTableInfo(restrTheme->layer()->id(),measuresTable);
+	}
+
+	if(sqlGroup)
+		return true;
+
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	if(TeProgress::instance())								// sets the progress bar
+	{
+		string caption = "Assign Data By Location";
+		string msg = "Executing collecting. Please, wait!";
+		TeProgress::instance()->setCaption(caption.c_str());
+		TeProgress::instance()->setMessage(msg);
+		TeProgress::instance()->setTotalSteps(spatialRestrictions.numElemInstances());
+		t2 = clock();
+		t0 = t1 = t2;
+	}
+
+	double tol = TeGetPrecision(srcProj);
+	TePrecision::instance().setPrecision(tol);	
+
+	unsigned int nregions = 0;
+	TeSTInstance restrInstance;
+
+	// a special case is when the source theme has a raster representation
+	if (srcRep == TeRASTER && restrRep == TePOINTS)
+	{
+		TePointSet restrPoints;
+		unsigned int npt;
+		unsigned int nbs;
+		while (spatialRestrictions.fetchInstance(restrInstance)) 
+		{
+			restrPoints.clear();
+			TeMultiGeometry mGeom;
+			restrInstance.getGeometry(mGeom);
+			restrPoints = mGeom.getPoints();
+			if (doRemap)
+			{
+				TePointSet restrPointAux;
+				TeVectorRemap(restrPoints,restrProj,restrPointAux,srcProj);
+				restrPoints.clear();
+				restrPoints = restrPointAux;
+			}
+			TeCoord2D lc;
+			double val;
+			string sval;
+
+			TeTableRow row;
+			int nrows = 0;
+			for (npt=0; npt<restrPoints.size(); ++npt)
+			{
+				row.clear();
+				row.push_back(restrInstance.objectId());	// identify the instance
+				for (nbs=0; nbs<bandCollection.size();++nbs)
+				{
+					TeCoord2D loc = restrPoints[npt].location();
+					lc = rst->params().coord2Index(loc);
+					if (rst->getElement(TeRoundRasterIndex(lc.x()),TeRoundRasterIndex(lc.y()),val,nbs))
+					{
+						if (rst->params().dataType_[0] == TeUNSIGNEDCHAR ||
+						    rst->params().dataType_[0] == TeCHAR)
+							sval = Te2String(static_cast<int>(val));
+						else
+							sval = Te2String(val,5);
+						row.push_back(sval);
+					}	
+					else
+						row.push_back("");
+				}
+			}
+			measuresTable.add(row);
+			row.clear();
+			nrows++;	
+			if (measuresTable.size()>100)	// saves chunks of 100 records
+			{
+				restrTheme->layer()->saveAttributeTable(measuresTable); 
+				measuresTable.clear();
+			}
+			++nregions;
+			t2 = clock();
+			if ( int(t2-t1) > dt && TeProgress::instance())
+			{
+				t1 = t2;
+				if(TeProgress::instance()->wasCancelled())
+				{
+					TeProgress::instance()->reset();
+					return false;
+				}
+				if((int)(t2-t0) > dt2)
+					TeProgress::instance()->setProgress(nregions);
+			}
+		}
+		if (measuresTable.size() > 0)	// saves remaining records
+		{
+			restrTheme->layer()->saveAttributeTable(measuresTable); 
+			measuresTable.clear();
+		}
+		if (TeProgress::instance())
+			TeProgress::instance()->reset();
+		return true;
+	}
+
+	TePolygonSet restrPols;
+	TeCellSet restrCells;
+	while(spatialRestrictions.fetchInstance(restrInstance)) // collect data for each geometry
+	{	
+		// of the spatial restriction set
+		// defines a querier to select measures from objects that
+		// are delimited by the a geometry and a spatial restriction
+		TeQuerierParams par2(false,measuresColl);
+		par2.setParams(srcTheme);
+		restrCells.clear();
+		restrPols.clear();
+		TeMultiGeometry mGeom;
+		restrInstance.getGeometry(mGeom);
+		// get the geometry of the instance
+		if (restrRep == TeCELLS)						// restriction is given by a cell set geometry
+		{
+			mGeom.getGeometry(restrCells);
+			if (doRemap)						// bring it to the source projection
+			{									// if necessary
+				TeCellSet restrCellsAux;
+				TeVectorRemap(restrCells,restrProj,restrCellsAux,srcProj);
+				restrCells.clear();
+				restrCells = restrCellsAux;
+			}
+			par2.setSpatialRest(&restrCells,spatialRelation,srcRep);
+		}
+		else									// restriction is given by a cell set geometry
+		{
+			mGeom.getGeometry(restrPols);
+			if (doRemap)						// bring it to the source projection
+			{									// if necessary
+				TePolygonSet restrPolsAux;
+				TeVectorRemap(restrPols,restrProj,restrPolsAux,srcProj);
+				restrPols.clear();
+				restrPols = restrPolsAux;
+			}
+			par2.setSpatialRest(&restrPols,spatialRelation,srcRep);
+		}
+		// creates a querier to retrieve the desired measures of the objects inside the 
+		// spatial restriction
+		TeQuerier sourceMeasures(par2);
+
+		// process each source within the spatial restriction geometry
+		TeTableRow row;
+		int nrows = 0;
+		row.push_back(restrInstance.objectId());	// identify the instance
+		
+		if (sourceMeasures.loadInstances())
+		{
+			TeSTInstance sourceInstance;
+			unsigned int p;								// get the calculated attributes
+			sourceMeasures.fetchInstance(sourceInstance);
+			vector<string>& vec = sourceInstance.getProperties();
+			for(p=0; p<vec.size();++p)
+				row.push_back(vec[p]);
+		}
+		else 
+		{
+			//insert null or zero attribute value
+			for(int p=1; p<(int)attrList.size();++p)
+			{
+				if(find(countAttr.begin(), countAttr.end(), p) != countAttr.end())
+					row.push_back(Te2String(0));
+				else
+					row.push_back("");
+			}
+		}
+	
+		measuresTable.add(row);
+		row.clear();
+		nrows++;
+			
+		if(measuresTable.size()>100)	// saves chunks of 100 records
+		{
+			restrTheme->layer()->saveAttributeTable(measuresTable); 
+			measuresTable.clear();
+		}
+
+		++nregions;
+		t2 = clock();
+		if ( int(t2-t1) > dt && TeProgress::instance())
+		{
+			t1 = t2;
+			if(TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			if((int)(t2-t0) > dt2)
+				TeProgress::instance()->setProgress(nregions);
+		}
+	}
+	if (measuresTable.size() > 0)	// saves remaining records
+	{
+		restrTheme->layer()->saveAttributeTable(measuresTable); 
+		measuresTable.clear();
+	}
+
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+
+bool TeGeoOpOverlayDifference(TeLayer* newLayer, TeTheme* theme1, 
+							  TeTheme* theme2, TeSelectedObjects selOb1, 
+							  TeSelectedObjects selOb2, TeAsciiFile* logFile)
+{
+	if((!newLayer) || (!theme1) || (!theme2))
+		return false;
+
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+		
+	TeLayer* layer1 = theme1->layer();
+	TeLayer* layer2 = theme2->layer();
+
+	unsigned int t;
+	vector<string> linkNames;
+	TeAttrTableVector vetTables;
+	if (layer1->getAttrTables(vetTables,TeAttrStatic))
+	{
+		for (t=0; t<vetTables.size(); ++t)
+			linkNames.push_back(TeConvertToUpperCase(vetTables[t].linkName()));
+	}
+	vetTables.clear();
+	if (layer1->getAttrTables(vetTables,TeAttrEvent))
+	{
+		for (t=0; t<vetTables.size(); ++t)
+			linkNames.push_back(TeConvertToUpperCase(vetTables[t].linkName()));
+	}
+
+	TeProjection* proj1 = layer1->projection();
+	TeProjection* proj2 = layer2->projection();
+
+	// querier to get the objects from theme 1
+	TeQuerierParams params1(true, true);
+	params1.setParams(theme1);
+	params1.setSelecetObjs(selOb1);
+	TeQuerier  querier1(params1); 
+
+	if(!querier1.loadInstances())
+		return false;				// there aren't objects on theme 1
+
+	// create the new attribute table with the attributes from theme 1 
+	// preserving the same link attribute
+	TeAttributeList attrList;
+	int npk=-1, aux1=0;
+	TeAttributeList theme1AttrList = querier1.getAttrList();
+	TeAttributeList::iterator it = theme1AttrList.begin();
+	while (it != theme1AttrList.end())
+	{
+		attrList.push_back(*it);
+		vector<string>::iterator it2 = find(linkNames.begin(), linkNames.end(), TeConvertToUpperCase((*it).rep_.name_));
+		if (it2 != linkNames.end())
+			npk = aux1;
+		++it;
+		++aux1;
+	}
+
+	// change attribute names if necessary and create a new attribute table
+	changeAttrList(attrList);
+	attrList[npk].rep_.isPrimaryKey_ = true;
+	TeTable attrTable (newLayer->name(), attrList, attrList[npk].rep_.name_, attrList[npk].rep_.name_);
+	if(!newLayer->createAttributeTable(attrTable))
+       return false;
+
+	// ----- 
+
+	int numPolygons1 = querier1.numElemInstances();
+	if(TeProgress::instance())
+	{
+		string caption = "Overlay Difference";
+		string msg = "Executing Overlay Difference. Please, wait!";
+		TeProgress::instance()->reset();
+		TeProgress::instance()->setCaption(caption.c_str());
+		TeProgress::instance()->setMessage(msg);
+		TeProgress::instance()->setTotalSteps(numPolygons1);
+		t2 = clock();
+		t0 = t1 = t2;
+	}
+
+	double tol = TeGetPrecision(proj1);
+	TePrecision::instance().setPrecision(tol);
+
+	int steps = 0;
+	TeSTInstance elem1;
+	while(querier1.fetchInstance(elem1))	// for each object of theme 1
+	{
+		TePolygonSet polSet1Aux;
+		if(!elem1.getGeometry(polSet1Aux))
+			continue;
+		
+		TePolygonSet polSet1;
+		if(!TeOVERLAY::TeValidPolygonHoles(polSet1Aux, polSet1))
+			return false;
+
+		TePolygonSet resultAux;
+
+		// querier to the theme 2
+		TeGeomRep gRepTheme2 = (TeGeomRep)(theme2->visibleGeoRep() & ~TeTEXT); // TeTEXT not is considered;
+		TeQuerierParams params2(true,false);
+		params2.setParams(theme2);
+		params2.setSelecetObjs(selOb2);
+		params2.setSpatialRest(polSet1.box(), TeINTERSECTS, gRepTheme2);
+
+		TeQuerier querier2(params2);
+		if(!querier2.loadInstances())
+		{
+			// there is no intersection between this object and the objects from theme 2
+			// so include the entire geometry of the object in the result
+			for (unsigned int i=0; i<polSet1.size(); ++i)
+				resultAux.add(polSet1[i]);
+		}
+		else
+		{
+			unsigned int m;
+			TePolygonSet polSet2;
+			TeSTInstance sti2;
+			vector<string> oids;
+			// build a polygon set with the representation of all objetcs from theme 2
+			// that intercepts current object of theme 1
+			while(querier2.fetchInstance(sti2))  
+			{
+				if(sti2.hasPolygons())
+				{
+					TePolygonSet polSetAux2;
+					sti2.getGeometry (polSetAux2);
+					if (!((*proj1) == (*proj2)))
+					{
+						TePolygonSet polySet2Out;
+						TeVectorRemap (polSetAux2, proj2, polySet2Out, proj1);
+						for (m=0; m<polySet2Out.size(); m++)
+							polSet2.add(polySet2Out[m]);
+					}
+					else
+					{
+						for (m=0; m<polSetAux2.size(); m++)
+							polSet2.add(polSetAux2[m]);
+					}
+					// keep track of the object ids for logging
+					oids.push_back(sti2.objectId());
+				}
+			}// for each intersection object of theme 2 
+
+			// before union, valid polygon holes (union of holes)
+			TePolygonSet polSetAux;
+			if(!TeOVERLAY::TeValidPolygonHoles(polSet2, polSetAux))
+				return false;
+
+			// Make union of all objects from theme 2 that intersects objects from theme 1
+			TePolygonSet bluePols;
+
+			if(!TeOVERLAY::TeUnion(polSetAux, bluePols))
+			{
+				if(logFile)
+				{
+					string mess = "Possivel inconsistencia na uniao dos obejtos do tema 2 que interceptam o objeto ";
+					mess += polSet1[0].objectId();
+					mess += " do tema " + theme1->name();
+					logFile->writeString(mess);
+					logFile->writeNewLine();
+				}
+			}
+
+			// try to recover the difference between the geometry of the current object
+			// from theme 1 and the geometries of the objects from theme 2 that intercept
+			// current object from theme 1
+			if(!TeOVERLAY::TeDifference(polSet1, bluePols, resultAux))
+			{
+				// when the operation returns false, writes in the error log file a possible
+				// inconsistency in the data
+				if (logFile)
+				{
+					string mess = "Possivel inconsistencia na diferenca do objeto ";
+					mess += polSet1[0].objectId();
+					mess += " do tema " + theme1->name() + " e ";
+					if (!oids.empty())
+						mess += oids[0];
+					for (m=1;m<oids.size();++m)
+						mess += ", " + oids[m];
+					mess += " do tema " + theme2->name();
+					logFile->writeString(mess);
+					logFile->writeNewLine();
+				}
+			} 
+		}
+		// save partial results
+		if (!resultAux.empty())
+		{
+			TeTableRow row;
+			vector<string>& vecOverlay = elem1.getProperties();
+
+			for (unsigned int p=0; p<vecOverlay.size();++p)
+				row.push_back(vecOverlay[p]);
+			attrTable.add(row);
+			row.clear();
+			for (unsigned int l=0; l <resultAux.size(); l++)
+				resultAux[l].objectId(vecOverlay[npk]);
+			newLayer->addPolygons(resultAux);
+		}
+		steps++;
+		t2 = clock();
+		if ((TeProgress::instance()) && (int(t2-t1) > dt))
+		{
+			t1 = t2;
+			if(TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			if((int)(t2-t0) > dt2)
+				TeProgress::instance()->setProgress(steps);
+		}
+		if((steps%100)==0)
+		{
+			newLayer->saveAttributeTable(attrTable); 
+			attrTable.clear();
+		}
+	} // for each object of theme 1
+
+	if(TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	if(attrTable.size()>0)
+		newLayer->saveAttributeTable(attrTable); 
+
+	if(!newLayer->box().isValid())
+		return false;
+	return true;
+}
+
+bool TeGeoOpBuffer(TeLayer* newLayer, TeTheme* themeIn, const TeSelectedObjects& selOb, const TeBUFFERREGION::TeBufferType& bufferType, const double& bufferDistance, 
+				   const unsigned int& bufferLevels, const unsigned int& numPoints, const bool& doUnion, const string& tableName, const string& attrName,
+				   TeAsciiFile* logFile)
+{
+	if(!newLayer || !themeIn)
+		return false;
+	
+	vector<string> attrs;
+	bool	distBasedOnAttr = false;
+	double	dist = bufferDistance;
+
+	//Verify if the distance is based on an attribute
+	if(!tableName.empty() && !attrName.empty())
+	{
+		attrs.push_back (tableName+"."+attrName);
+		distBasedOnAttr = true;
+	}
+	
+	TePrecision::instance().setPrecision(TeGetPrecision(newLayer->projection()) / 10.0);
+		
+	//define a list of attributes
+	TeAttributeList attList;
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.numChar_ = 16;
+	at.rep_.name_ = "object_id_";
+	at.rep_.isPrimaryKey_ = true;
+	attList.push_back(at);
+
+	at.rep_.type_ = TeINT;       
+	at.rep_.name_ = "bufferLevel";
+	at.rep_.isPrimaryKey_ = false;
+	attList.push_back(at);  
+
+	if(!distBasedOnAttr || !doUnion)
+	{
+		at.rep_.type_ = TeREAL;       
+		at.rep_.name_ = "bufferDistance";
+		at.rep_.isPrimaryKey_ = false;
+		attList.push_back(at);  
+	}
+
+	TeTable attTable(newLayer->name()+"_Attr", attList, "object_id_", "object_id_");	
+
+	//create attribute table 
+	if (!newLayer->createAttributeTable(attTable))
+	{
+		// when the operation returns false, write in the log a possible
+		// inconsistency in the data
+		if (logFile)
+		{
+			string mess = "Error creating attribute table! ";
+			logFile->writeString(mess);
+			logFile->writeNewLine();
+		}
+		return false;
+	}
+
+	//insert a polygon representation in the new layer 		
+	if(!newLayer->addGeometry(TePOLYGONS, newLayer->name()+"_pols"))
+	{
+		// when the operation returns false, write in the log a possible
+		// inconsistency in the data
+		if (logFile)
+		{
+			string mess = "Error adding polygon table! ";
+			logFile->writeString(mess);
+			logFile->writeNewLine();
+		}
+		return false;
+	}
+   		
+	//querier to load all objects from database	
+	TeQuerierParams params(true,attrs);
+	params.setParams(themeIn);
+	params.setSelecetObjs(selOb);
+	TeQuerier querier(params);
+
+	if(!querier.loadInstances())
+	{
+		// when the operation returns false, write in the log a possible
+		// inconsistency in the data
+		if (logFile)
+		{
+			string mess = "Error loading objects from database! ";
+			logFile->writeString(mess);
+			logFile->writeNewLine();
+		}
+		return false;
+	}
+
+	//progress bar
+	int total = querier.numElemInstances();
+	if(TeProgress::instance())
+	{
+		string caption = "Buffer operation";
+		string msg;
+		if(doUnion)
+			msg = "Executing buffer operation. Please, wait!";
+		else
+			msg = "Executing buffer operation and saving the \n results in the database. Please, wait!";
+		TeProgress::instance()->setCaption(caption.c_str());
+		TeProgress::instance()->setMessage(msg);
+		TeProgress::instance()->setTotalSteps(total);
+	}
+	
+	vector<TePolygonSet>	result;
+	for(unsigned int j=0; j<bufferLevels; ++j)
+		result.push_back (TePolygonSet());
+
+	TeTableRow		row;
+	TeSTInstance	sti;
+	int count = 0;
+	while(querier.fetchInstance(sti))
+	{
+		TePolygonSet	polSetIn;
+		TeLineSet		lineSetIn;
+		TePointSet		pointSetIn;
+		TeCellSet		cellSetIn;
+		vector<TePolygonSet>	bufferResult;
+		
+		//progress bar
+		if(TeProgress::instance())
+		{
+			if(TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			TeProgress::instance()->setProgress(count);
+		}
+
+		//get the distance
+		if(distBasedOnAttr)
+		{
+			dist = sti[0];
+			if(dist==0) //if there is no distance to this instance, continue
+			{
+				++count;
+				continue;
+			}
+		}
+		
+		bool bufferOperation = false;
+		if(sti.hasPolygons())
+		{
+			sti.getGeometry(polSetIn);
+			// generate the buffers of each polygon of the set (polSetIn) and do the union
+			// of the same distance buffers for each object
+			bufferOperation = TeBUFFERREGION::TeBufferRegion(polSetIn, dist, numPoints, bufferLevels, bufferType, bufferResult);
+		}
+		else if(sti.hasLines())
+		{
+			sti.getGeometry(lineSetIn);
+			// generate the buffers of each line of the set (lineSetIn) and do the union
+			// of the same distance buffers 
+			bufferOperation = TeBUFFERREGION::TeBufferRegion(lineSetIn, dist, numPoints, bufferLevels, bufferResult);
+		}
+		else if(sti.hasPoints())
+		{
+			sti.getGeometry(pointSetIn);
+			// generate the buffers of each point of the set (pointSetIn) and do the union
+			// of the same distance buffers 
+			bufferOperation = TeBUFFERREGION::TeBufferRegion(pointSetIn, dist, numPoints, bufferLevels, bufferResult);
+		}
+		else if(sti.hasCells())
+		{
+			sti.getGeometry(cellSetIn);
+			// generate the buffers of each cell of the set (cellSetIn) and do the union
+			// of the same distance buffers 
+			bufferOperation = TeBUFFERREGION::TeBufferRegion(cellSetIn, dist, numPoints, bufferLevels, bufferType, bufferResult);
+		}
+		else
+		{
+			if(TeProgress::instance())
+				TeProgress::instance()->reset();
+			return false;
+		}
+		
+		if(!bufferOperation)
+		{
+			if (logFile)
+			{	
+				string mess = "Error in the buffer operation over object_id:  ";
+				mess += sti.objectId();
+				logFile->writeString(mess);
+				logFile->writeNewLine();
+			}
+			++count;
+			continue;
+		}
+		
+		//Stores the buffer to do the union of each level 
+		if(doUnion) 
+		{
+			for(unsigned int level=0; level<bufferResult.size(); ++level)
+			{
+				for(unsigned int pol=0; pol<bufferResult[level].size(); ++pol)
+					result[level].add(bufferResult[level][pol]);
+			}
+		}
+		else
+		{
+			for(unsigned int level=0; level<bufferResult.size(); ++level)
+			{
+				string slevel = Te2String(level+1);
+				bufferResult[level].objectId(sti.objectId()+"_"+slevel);
+				//attribute
+				row.clear();
+				row.push_back(sti.objectId()+"_"+slevel);
+				row.push_back(slevel);
+				row.push_back(Te2String(dist*(level+1)));
+				attTable.add(row);
+				//geometry
+				for(unsigned int pol=0; pol<bufferResult[level].size(); ++pol)
+					result[level].add(bufferResult[level][pol]);
+			}
+
+			if(count%100==0)
+			{
+				//store buffer attribute and geometries
+				//saves attributes
+				if (!newLayer->saveAttributeTable(attTable))
+				{
+					if(logFile)
+					{
+						string mess = "Error saving attributes in the attribute table! ";
+						logFile->writeString(mess);
+						logFile->writeNewLine();
+					}
+					if(TeProgress::instance())
+						TeProgress::instance()->reset();
+					return false;
+				}
+				attTable.clear();
+				
+				//saves geometries
+				for(unsigned int level=0; level<bufferResult.size(); ++level)
+				{
+					if(!newLayer->addPolygons(result[level]))
+					{
+						if(logFile)
+						{
+							string mess = "Error saving buffers in the geometric table! ";
+							logFile->writeString(mess);
+							logFile->writeNewLine();
+						}
+						if(TeProgress::instance())
+						{
+							TeProgress::instance()->reset();
+						}
+						return false;
+					}
+					result[level].clear();
+				}
+				
+			}
+		}
+		++count;
+	}
+
+	if(doUnion)
+	{
+		//progress bar
+		if(TeProgress::instance())
+		{
+			string caption = "Dissolve operation";
+			TeProgress::instance()->setCaption(caption.c_str());
+			string msg = "Executing dissolve operation and saving the \n results in the database. Please, wait!";
+			TeProgress::instance()->setMessage(msg);
+			TeProgress::instance()->setTotalSteps((int)bufferLevels);
+		}
+			
+		//do the union for each level
+		int objId = 0;
+		TePolygonSet prevLevelPolSet;
+		for(unsigned int level=0; level<result.size(); ++level)
+		{
+			TePolygonSet curLevelPolSet;
+			if(!TeOVERLAY::TePairUnion(result[level], curLevelPolSet))
+			{
+				if(logFile)
+				{
+					string mess = "Error in the union of the buffers of the level ";
+					mess += Te2String(level+1) +" !";
+					logFile->writeString(mess);
+					logFile->writeNewLine();
+				}
+				if(TeProgress::instance())
+				{
+					TeProgress::instance()->reset();
+				}
+				return false;
+			}
+
+			if(level>0)
+			{
+				TePolygonSet auxPolSet;
+				//Difference between current level union and union of previous levels 
+				if(!TeOVERLAY::TeDifference (curLevelPolSet, prevLevelPolSet, auxPolSet))
+				{
+					if(logFile)
+					{
+						string mess = "Error in the difference between buffers of the level ";
+						mess += Te2String(level+1) +" and buffers of the level ";
+						mess += Te2String(level) +" !";
+						logFile->writeString(mess);
+						logFile->writeNewLine();
+					}
+					if(TeProgress::instance())
+					{
+						TeProgress::instance()->reset();
+					}
+					return false;
+				}
+
+				curLevelPolSet.clear();
+				for(unsigned int j=0; j< auxPolSet.size(); ++j)
+                    curLevelPolSet.add(auxPolSet[j]);
+
+				//Do the union between current level and previous levels
+				auxPolSet.clear();
+				if((level+1)<result.size())
+				{
+					if(!TeOVERLAY::TeUnion (curLevelPolSet, prevLevelPolSet, auxPolSet))
+					{
+						if(logFile)
+						{
+							string mess = "Error in the union between buffers of the level ";
+							mess += Te2String(level+1) +" and buffers of the level ";
+							mess += Te2String(level) +" !";
+							logFile->writeString(mess);
+							logFile->writeNewLine();
+						}
+
+						if(TeProgress::instance())
+						{
+							TeProgress::instance()->reset();
+						}
+
+						return false;
+					}
+
+					prevLevelPolSet.clear();
+					for(unsigned int j=0; j< auxPolSet.size(); ++j)
+						prevLevelPolSet.add(auxPolSet[j]);
+				}
+			}
+			else
+			{
+				for(unsigned int j=0; j< curLevelPolSet.size(); ++j)
+                    prevLevelPolSet.add(curLevelPolSet[j]);
+			}
+
+			for(unsigned int k=0; k<curLevelPolSet.size(); ++k)
+			{
+				string objectId = Te2String(objId);
+				++objId;
+				curLevelPolSet[k].objectId(objectId);
+				//attribute
+				row.clear();
+				row.push_back(objectId);
+				row.push_back(Te2String(level+1));
+				if(!distBasedOnAttr)
+					row.push_back(Te2String(dist*(level+1)));
+				attTable.add(row);
+			}
+			
+			//saves attributes
+			if (!newLayer->saveAttributeTable(attTable))
+			{
+				if(logFile)
+				{
+					string mess = "Error saving attributes in the attribute table! ";
+					logFile->writeString(mess);
+					logFile->writeNewLine();
+				}
+				if(TeProgress::instance())
+					TeProgress::instance()->reset();
+				return false;
+			}
+			attTable.clear();
+				
+			//saves geometries
+			if(!newLayer->addPolygons(curLevelPolSet))
+			{
+				if(logFile)
+				{
+					string mess = "Error saving buffers in the geometric table! ";
+					logFile->writeString(mess);
+					logFile->writeNewLine();
+				}
+				if(TeProgress::instance())
+					TeProgress::instance()->reset();
+				return false;
+			}
+
+			//progress bar
+			if(TeProgress::instance())
+			{
+				if(TeProgress::instance()->wasCancelled())
+				{
+					TeProgress::instance()->reset();
+					return false;
+				}
+				TeProgress::instance()->setProgress(level+1);
+			}
+		} //for
+	}
+	else
+	{
+		//saves attributes
+		if (!newLayer->saveAttributeTable(attTable))
+		{
+			if(logFile)
+			{
+				string mess = "Error saving attributes in the attribute table! ";
+				logFile->writeString(mess);
+				logFile->writeNewLine();
+			}
+			if(TeProgress::instance())
+				TeProgress::instance()->reset();
+			return false;
+		}
+		
+		//saves geometries
+		for(unsigned int level=0; level<result.size(); ++level)
+		{
+			if(!newLayer->addPolygons(result[level]))
+			{
+				if(logFile)
+				{
+					string mess = "Error saving buffers in the geometric table! ";
+					logFile->writeString(mess);
+					logFile->writeNewLine();
+				}
+				if(TeProgress::instance())
+					TeProgress::instance()->reset();
+				return false;
+			}
+			result[level].clear();
+		}
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+bool 
+TeGeoOpOverlayIntersection(TeLayer* newLayer, TeTheme* theme, TeTheme* themeTrim, TeSelectedObjects selObTrim, double backValue, TeAsciiFile* logFile)
+{
+	// check if the input parameters are valid
+	if((!newLayer) || (!theme) || (!themeTrim))
+		return false;
+
+	// check if the theme to be clipped has a raster geometry valid
+	TeRaster* rst = theme->layer()->raster();
+	if (!rst) 
+		return false;
+
+	//Querier Trim
+	TeQuerierParams paramsTrim(true, true);
+	paramsTrim.setParams(themeTrim);
+	paramsTrim.setSelecetObjs(selObTrim);
+	TeQuerier  querierTrim(paramsTrim); 
+	if(!querierTrim.loadInstances())
+		return  false;
+	
+	TeSTInstance trim;
+	TePolygonSet ps;
+	while(querierTrim.fetchInstance(trim))
+	{
+		TePolygonSet polSet;
+		if(!trim.getGeometry(polSet))
+			continue;
+		for(int i=0; i<(int)polSet.size(); ++i)
+		{
+			TePolygon polyTrim = polSet[i];
+			// before intersection, valid polygon holes (union of holes)
+			TePolygonSet polyTrimSet;
+			if(!TeOVERLAY::TeValidPolygonHoles(polyTrim, polyTrimSet))
+			{
+				// when the operation returns false, write in the log a possible
+				// inconsistency in the data
+				if (logFile)
+				{
+					string mess = "Nao foi possivel realizar a consistencia dos aneis internos ";
+					mess += polyTrim.objectId();
+					mess += " do tema " + themeTrim->name() + ".";
+					logFile->writeString(mess);
+					logFile->writeNewLine();
+				}
+				continue;
+			}
+			ps.add(polSet[i]);
+		}//for each polygon of the Trim theme
+	}
+
+	// there are no valid polygons to be used as mask to clip raster representation
+	if (ps.empty())
+		return false;
+
+	// finds a valid name for the table that contains the raster geometry
+	string rasterTableName = "RasterLayer" + Te2String(newLayer->id())+"_R_O1";
+	rasterTableName = newLayer->database()->getNewTableName(rasterTableName);
+
+	// tries to execute the clipping
+	TeRaster* rstClip = TeRasterClipping(rst, ps, themeTrim->layer()->projection(), rasterTableName, backValue, "DB");
+	newLayer->addRasterGeometry(rstClip,"O1");
+	delete rstClip;
+    return true;
+}
+
+bool TeGeoOpNearestNeighbour(TeTheme* inputTheme, TeSelectedObjects iselObj, 
+							 TeTheme* neighTheme, TeSelectedObjects nnselObj, 
+							 const string& distColName, const string& NNIDColName)
+{
+	if (!inputTheme || !neighTheme)
+		return false;
+
+	// retrieve the the centroids of all objects candidates to be the nearest neighbour
+	TeQuerierParams qPar(true, false);
+	qPar.setParams(neighTheme);
+	qPar.setSelecetObjs(iselObj);
+	TeQuerier* querier = new TeQuerier(qPar);
+	if (!querier->loadInstances())
+	{
+		delete querier;
+		return false;
+	}
+
+	TeProjection* pInput = inputTheme->layer()->projection();
+	TeProjection* pNeigh = neighTheme->layer()->projection();
+
+	bool doReproj = false;
+	if (!(*pInput == *pNeigh))
+	{
+		pNeigh->setDestinationProjection(pInput);
+		doReproj = true;
+	}
+		
+	string newDistCol = distColName;
+	if (newDistCol.empty())
+		newDistCol = "DIST";
+
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
+		t2 = clock();
+		t0 = t1 = t2;
+	}
+	unsigned int step=0;
+	std::vector<std::pair<TeCoord2D, TePoint> > dataSet;
+	TeSTInstance st;
+	TeMultiGeometry multigeo;
+	string lastOID;
+	while(querier->fetchInstance(st))
+	{
+		TeCoord2D cc;
+		st.centroid(cc);
+		if (doReproj)
+		{
+			TeCoord2D ll = pNeigh->PC2LL(cc);
+			cc = pInput->LL2PC(cc);
+		}
+		TePoint pt(cc);
+		pt.objectId(st.objectId());
+		dataSet.push_back(std::pair<TeCoord2D, TePoint>(cc, pt)); 
+		t2 = clock();
+		if (((int(t2-t1) > dt) && TeProgress::instance()))
+		{
+			t1 = t2;
+			if(TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			if((int)(t2-t0) > dt2)
+				TeProgress::instance()->setProgress(step);
+		}
+		++step;
+	}
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	step = 0;
+	TeBox candExt = querier->getBox();
+	delete querier;
+
+// create a spatial index of the centroids of the candidates
+	typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, std::vector<TePoint>, TePoint> KDNODE;
+	typedef TeSAM::TeAdaptativeKdTree<KDNODE> KDTREE;
+
+	unsigned int bucketSize = 3 * 1; //
+	KDTREE tree(candExt, bucketSize); 
+	tree.build(dataSet); 
+	dataSet.clear(); 
+
+//	verifies how to save the results
+	bool updateNNId = false;
+	TeAttribute attr;	
+	TeAttrTableVector attTables;
+	inputTheme->getAttTables(attTables, TeAttrStatic);
+
+	// always save the distance column
+	string tableName = "";
+	string dcolName = distColName;
+	unsigned int pos = distColName.find('.');
+	if (pos != std::string::npos)
+	{
+		tableName = distColName.substr(0,pos);
+		unsigned int nchars = distColName.size()-1;
+		dcolName = distColName.substr(pos+1,nchars);
+	}
+
+	string objectIdCol;
+	if (tableName.empty())
+	{
+		tableName = attTables[0].name();
+		objectIdCol = attTables[0].linkName();
+	}
+	else
+	{
+		TeAttrTableVector::iterator it = attTables.begin();
+		while (it != attTables.end())
+		{
+			if ((*it).name() == tableName)
+			{
+				objectIdCol = (*it).linkName();
+				break;
+			}
+			++it;
+		}
+	}
+
+	if (inputTheme->layer()->database()->columnExist(tableName,dcolName,attr))
+	{
+		if (attr.rep_.type_!= TeREAL)
+		{
+			inputTheme->layer()->database()->deleteColumn(tableName,dcolName);
+			attr.rep_.type_ = TeREAL;
+			if (!inputTheme->layer()->database()->addColumn(tableName,attr.rep_))
+			{
+				// can not create the distance column
+				delete querier;
+				return false;
+			}
+		}
+	}
+	else
+	{
+		attr.rep_.type_ = TeREAL;
+		attr.rep_.name_ = dcolName;
+		if (!inputTheme->layer()->database()->addColumn(tableName,attr.rep_))
+		{
+			// can not create the distance column
+			delete querier;
+			return false;
+		}
+	}
+
+	// save nn id only when requested
+	string nnidcol;
+	if (!NNIDColName.empty())
+	{
+		updateNNId = true;
+		nnidcol = NNIDColName;
+		pos = NNIDColName.find('.');
+		if (pos != std::string::npos)
+			nnidcol = NNIDColName.substr(pos+1,NNIDColName.size());
+
+		if (inputTheme->layer()->database()->columnExist(tableName,nnidcol,attr))
+		{
+			if (attr.rep_.type_!= TeSTRING)
+			{
+				inputTheme->layer()->database()->deleteColumn(tableName,nnidcol);
+				attr.rep_.type_ = TeSTRING;
+				attr.rep_.numChar_ = 100;
+				if (!inputTheme->layer()->database()->addColumn(tableName,attr.rep_))
+					updateNNId = false;
+			}
+		}
+		else
+		{
+			attr.rep_.type_ = TeSTRING;
+			attr.rep_.name_ = nnidcol;
+			attr.rep_.numChar_ = 100;
+			if (!inputTheme->layer()->database()->addColumn(tableName,attr.rep_))
+				updateNNId = false;
+		}
+	}
+
+// retrieve the objects to find the nearest neighbour 
+	qPar.setParams(inputTheme);
+	qPar.setSelecetObjs(nnselObj);
+	querier = new TeQuerier(qPar);
+	if (!querier->loadInstances())
+	{
+		delete querier;
+		return false;
+	}
+
+	std::vector<TePoint> report;
+	report.push_back(TePoint(TeMAXFLOAT, TeMAXFLOAT));
+	std::vector<double> sqrDists;
+	multigeo.clear();
+	lastOID = "";
+	string sql;
+
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(querier->numElemInstances());
+		t2 = clock();
+		t0 = t1 = t2;
+	}
+
+	while(querier->fetchInstance(st))
+	{
+		TeCoord2D cc;
+		st.centroid(cc);
+		tree.nearestNeighborSearch(cc, report, sqrDists, 1);
+		if (updateNNId)
+			sql = "UPDATE " + tableName + " SET " + nnidcol + "='" + report[0].objectId() + "', " + dcolName + "=" + Te2String(sqrt(sqrDists[0]),4);
+		else
+			sql = "UPDATE " + tableName + " SET " + dcolName + "=" + Te2String(sqrt(sqrDists[0]),4);
+		sql += " WHERE " + objectIdCol + "='" + st.objectId().c_str() + "'";
+		if (!inputTheme->layer()->database()->execute(sql))
+		{
+			delete querier;
+			return false;
+		}
+		if (((t2-t1) > dt) && (TeProgress::instance()))
+		{
+			t1 = t2;
+			if(TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			if ((t2-t0) > dt2)
+				TeProgress::instance()->setProgress(step);
+		}
+		++step;
+	}
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	delete querier;
+	return true;
+}
+
diff --git a/src/terralib/functions/TeGeoProcessingFunctions.h b/src/terralib/functions/TeGeoProcessingFunctions.h
old mode 100755
new mode 100644
index 3035e5b..fa43975
--- a/src/terralib/functions/TeGeoProcessingFunctions.h
+++ b/src/terralib/functions/TeGeoProcessingFunctions.h
@@ -1,169 +1,172 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeGeoProcessingFunctions.h
-    \brief This file contains functions to generate new layers from spatial operations among themes 
-*/
-
-#ifndef __TERRALIB_INTERNAL_GEOPROCESSING_H
-#define __TERRALIB_INTERNAL_GEOPROCESSING_H 
-
-#include <vector>
-#include <string>
-
-using std::vector;
-using std::string;
-
-#include <TeDataTypes.h>
-#include <TeAttribute.h>
-#include <TeBufferRegion.h>
-
-class TeAsciiFile;
-class TeTheme;
-class TeLayer;
-
-/** @defgroup GeoOp GeoProcessing functions
-	A set of functions that execute some common operations when dealing with geographical data
- *  @{
- */
-/** Agreggates the objects of a theme generating a new layer
-	\param newLayer			pointer to a valid layer already created in the database to store the result of the operation
-	\param theme			pointer to the theme being aggregated
-	\param agregAttrVect	a vector with the names of the attributes that should have the same value in order to aggregate two objects.
-	\param attrMM			the definition of the attributes (with the measures over it) that should passed to the new layer
-	\param selOb			a selection of the objects of the theme that should be aggregated
-	\param logFile			Optional: a pointer to a text file where error messages will be saved
-	\return true if it succeed and false otherwise
-*/
-bool TeGeoOpAggregation(TeLayer* newLayer, TeTheme* theme, vector<string>& agregAttrVec, TeGroupingAttr& attrMM, TeSelectedObjects selOb, TeAsciiFile* logFile=0);		
-
-/** Adds a set of themes generating a new layer
-	\param newLayer			pointer to a valid layer already created in the database to store the result of the operation
-	\param theme			pointer to the first theme being added: the new layer will have the same attributes as the this theme
-	\param themeVec			a vector of themes that should be added to the first one
-	\param selOb			a selection of the objects of the theme that should be added
-	\param logFile			Optional: a pointer to a text file where error messages will be saved
-	\return true if it succeed and false otherwise
-*/
-bool TeGeoOpAdd(TeLayer* newLayer, TeTheme* theme, vector<TeTheme*> themeVec, TeSelectedObjects selObj = TeAll, TeAsciiFile* logFile=0);
-
-/** Clips a theme generating a new layer
-	\param newLayer			pointer to a valid layer already created in the database to store the result of the operation
-	\param theme			pointer to the theme being clipped
-	\param themeTrim		pointer to the theme that has objects with polygon geometry that will be used as the mask for the clipping
-	\param selOb			a selection of the objects of the theme that should be clipped
-	\param selObTrim		a selection of the objects of the theme that should be used as mask
-	\param attrTrim			flag to indicate that the attributes of the mask theme should be included in the new layer
-	\param logFile			Optional: a pointer to a text file where error messages will be saved
-	\return true if it succeed and false otherwise
-*/
-bool TeGeoOpOverlayIntersection(TeLayer* newLayer, TeTheme* theme, TeTheme* themeTrim, TeSelectedObjects selOb, TeSelectedObjects selObTrim, bool attrTrim, TeAsciiFile* logFile=0);
-
-/** Clips a theme generated from a layer with raster representation generating a new layer
-	\param newLayer			pointer to a valid layer already created in the database to store the result of the operation
-	\param theme			pointer to the theme being clipped
-	\param themeTrim		pointer to the theme that has objects with polygon geometry that will be used as the mask for the clipping
-	\param selObTrim		a selection of the objects of the theme that should be used as mask
-	\param backValue		the value that should be used as the background
-	\param logFile			Optional: a pointer to a text file where error messages will be saved
-	\return true if it succeed and false otherwise
-*/
-bool TeGeoOpOverlayIntersection(TeLayer* newLayer, TeTheme* theme, TeTheme* themeTrim, TeSelectedObjects selObTrim, double backValue, TeAsciiFile* logFile=0);
-
-
-
-/** Generates the geometrical difference between two themes (t1 - t2), generating a new layer
-	\param newLayer			pointer to a valid layer already created in the database to store the result of the operation
-	\param theme1			pointer to the first theme
-	\param theme2		    pointer to the second theme 
-	\param selOb			a selection of the objects of the first theme
-	\param selOb			a selection of the objects of the second theme
-	\param logFile			Optional: a pointer to a text file where error messages will be saved
-	\return true if it succeed and false otherwise
-*/
-bool TeGeoOpOverlayDifference(TeLayer* newLayer, TeTheme* theme1, TeTheme* theme2, TeSelectedObjects selOb1, TeSelectedObjects selOb2, TeAsciiFile* logFile=0);
-
-/** Assign Data By Location - Distribute: passes the attributes of the objects of a theme to the objects of a second theme based on a spatial relation
-	\param themeMod			pointer to theme that has the attributes that will be passed
-	\param theme			pointer to the theme that will receive the attributes
-	\param tableName		name of the table that will store the attributes passed from the first theme
-	\param spatialRelation	a spatial relation (or a combination of) that will be used as the criteria to pass the attributes between the themes
-	\param attributes		a list of attributes from the first theme that should be distributes to the second theme
-	\return true if it succeed and false otherwise
-*/
-bool TeGeoOpAssignDataLocationDistribute(TeTheme* themeMod, TeTheme* theme, const string& tableName, const int& spatialRelation, const vector<string>& attributes = vector<string>());
-
-/** Assign Data By Location - Collect: collects the attributes of the objects of a theme and assign it to second theme based on a spatial relation
-	\param restrTheme		pointer to theme that has the attributes that will be passed
-	\param srcTheme			pointer to the theme that has the attributes that will be collected 
-	\param newTableName		name of the table that will store the attributes collected
-	\param measuresColl		the definition of the attributes (with the measures over it) that should passed to first theme
-	\param spatialRelation	a spatial relation (or a combination of) that will be used as the criteria to pass the attributes between the themes
-	\return true if it succeed and false otherwise
-*/
-bool TeGeoOpAssignByLocationCollect(TeTheme* restrTheme, TeTheme* srcTheme, const string& newTableName, TeGroupingAttr& measuresColl, const int& spatialRelation);
-
-/** Generates a new layer with the buffers of the objects of a theme
-	\param newLayer			pointer to a new layer that will receive the buffers generated
-	\param themeIn			pointer to a source theme that will provide the objects to generate the buffers  
-	\param selOb			define which objects of the themeIn will be used
-	\param bufferType		define the buffer type: inside/outside/inside+outside
-	\param bufferDistance	the buffer distance in the same unit of the object geometries 
-	\param bufferLevels		the number of buffer rings
-	\param numPoints		the number of points that should be used to describe the curved corners of the buffer zone
-	\param doUnion			a flag to indicate if this function will dissolve barries among buffers
-	\param tableName		name of the attribute table that will provide an attribute that defines the buffer distance for each object
-	\param attrName			attribute name of the attribute table "tableName" that will provide the buffer distance for each object
-	\param logFile			Optional: a pointer to a text file where error messages will be saved
-	\return true if it succeed and false otherwise
-*/
-bool TeGeoOpBuffer(TeLayer* newLayer, TeTheme* themeIn, const TeSelectedObjects& selOb, const TeBUFFERREGION::TeBufferType& bufferType, const double& bufferDistance, 
-				   const unsigned int& bufferLevels, const unsigned int& numPoints, const bool& doUnion=false, const string& tableName="", const string& attrName="", 
-				   TeAsciiFile* logFile=0);
-
-/** \brief Calculates the distance to the nearest neighbour (NN)
-	This function calculates the distance of objetcs in the input theme to the nearest object in a neighbour candidates theme.
-	For complex geometries such as polygons, cells, lines, sets of geometries or multigeometries the NN is found
-	based on thedistance between the centroids of the geometries (for both input and for neighbour candidates objects).
-	If themes have different projections the distance will be computed using input theme projection.
-	
-	\param inputTheme		pointer to the theme that contains the objects to which the nearest neighbour are being searched
-	\param iselObj			a specific selection of the input theme  
-	\param neighTheme		pointer to the theme that contains the candidates to NN
-	\param nnselObj			a specific selection of NN theme
-	\param distColName		the name of the column that will contain the distance to the NN object. If empty, the name "DIST" will be used. If
-	the column should be created in a specific table, use the convention "tableName.colName", otherwise the first static table will be
-	sued. If the column exists its values will be updated, if it don't the column will be created.
-	\param NNIDColName		the name of the column that will contain the identification of the NN object. If empty the column won't be generated.
-	\return true if it succeed and false otherwise
-*/
-bool TeGeoOpNearestNeighbour(TeTheme* inputTheme, TeSelectedObjects iselObj, 
-							 TeTheme* neighTheme, TeSelectedObjects nnselObj, 
-							 const string& distColName = "", const string& NNIDColName = "");
-
-
-/** \internal */
-bool TeGeoOpOverlayUnion(TeLayer* newLayer, TeTheme* theme, TeTheme* themeOverlay, TeSelectedObjects selOb, TeSelectedObjects selObOverlay, TeAsciiFile* logFile=0);
-/** @} */ // End of group GeoOp 
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGeoProcessingFunctions.h
+    \brief This file contains functions to generate new layers from spatial operations among themes 
+*/
+
+#ifndef __TERRALIB_INTERNAL_GEOPROCESSING_H
+#define __TERRALIB_INTERNAL_GEOPROCESSING_H 
+
+#include <vector>
+#include <string>
+
+using std::vector;
+using std::string;
+
+#include <TeDataTypes.h>
+#include <TeAttribute.h>
+#include <TeBufferRegion.h>
+
+#include "TeFunctionsDefines.h"
+
+class TeAsciiFile;
+class TeTheme;
+class TeLayer;
+
+/** @defgroup GeoOp GeoProcessing functions
+	A set of functions that execute some common operations when dealing with geographical data
+ *  @{
+ */
+/** Agreggates the objects of a theme generating a new layer
+	\param newLayer			pointer to a valid layer already created in the database to store the result of the operation
+	\param theme			pointer to the theme being aggregated
+	\param agregAttrVect	a vector with the names of the attributes that should have the same value in order to aggregate two objects.
+	\param attrMM			the definition of the attributes (with the measures over it) that should passed to the new layer
+	\param selOb			a selection of the objects of the theme that should be aggregated
+	\param logFile			Optional: a pointer to a text file where error messages will be saved
+	\return true if it succeed and false otherwise
+*/
+TLFUNCTIONS_DLL bool TeGeoOpAggregation(TeLayer* newLayer, TeTheme* theme, vector<string>& agregAttrVec, TeGroupingAttr& attrMM, TeSelectedObjects selOb, TeAsciiFile* logFile=0);		
+
+/** Adds a set of themes generating a new layer
+	\param newLayer			pointer to a valid layer already created in the database to store the result of the operation
+	\param theme			pointer to the first theme being added: the new layer will have the same attributes as the this theme
+	\param themeVec			a vector of themes that should be added to the first one
+	\param selOb			a selection of the objects of the theme that should be added
+	\param logFile			Optional: a pointer to a text file where error messages will be saved
+	\return true if it succeed and false otherwise
+*/
+TLFUNCTIONS_DLL bool TeGeoOpAdd(TeLayer* newLayer, TeTheme* theme, vector<TeTheme*> themeVec, TeSelectedObjects selObj = TeAll, TeAsciiFile* logFile=0);
+
+/** Clips a theme generating a new layer
+	\param newLayer			pointer to a valid layer already created in the database to store the result of the operation
+	\param theme			pointer to the theme being clipped
+	\param themeTrim		pointer to the theme that has objects with polygon geometry that will be used as the mask for the clipping
+	\param selOb			a selection of the objects of the theme that should be clipped
+	\param selObTrim		a selection of the objects of the theme that should be used as mask
+	\param attrTrim			flag to indicate that the attributes of the mask theme should be included in the new layer
+	\param logFile			Optional: a pointer to a text file where error messages will be saved
+	\return true if it succeed and false otherwise
+*/
+TLFUNCTIONS_DLL bool TeGeoOpOverlayIntersection(TeLayer* newLayer, TeTheme* theme, TeTheme* themeTrim, TeSelectedObjects selOb, TeSelectedObjects selObTrim, bool attrTrim, TeAsciiFile* logFile=0);
+
+/** Clips a theme generated from a layer with raster representation generating a new layer
+	\param newLayer			pointer to a valid layer already created in the database to store the result of the operation
+	\param theme			pointer to the theme being clipped
+	\param themeTrim		pointer to the theme that has objects with polygon geometry that will be used as the mask for the clipping
+	\param selObTrim		a selection of the objects of the theme that should be used as mask
+	\param backValue		the value that should be used as the background
+	\param logFile			Optional: a pointer to a text file where error messages will be saved
+	\return true if it succeed and false otherwise
+*/
+TLFUNCTIONS_DLL bool TeGeoOpOverlayIntersection(TeLayer* newLayer, TeTheme* theme, TeTheme* themeTrim, TeSelectedObjects selObTrim, double backValue, TeAsciiFile* logFile=0);
+
+
+
+/** Generates the geometrical difference between two themes (t1 - t2), generating a new layer
+	\param newLayer			pointer to a valid layer already created in the database to store the result of the operation
+	\param theme1			pointer to the first theme
+	\param theme2		    pointer to the second theme 
+	\param selOb			a selection of the objects of the first theme
+	\param selOb			a selection of the objects of the second theme
+	\param logFile			Optional: a pointer to a text file where error messages will be saved
+	\return true if it succeed and false otherwise
+*/
+TLFUNCTIONS_DLL bool TeGeoOpOverlayDifference(TeLayer* newLayer, TeTheme* theme1, TeTheme* theme2, TeSelectedObjects selOb1, TeSelectedObjects selOb2, TeAsciiFile* logFile=0);
+
+/** Assign Data By Location - Distribute: passes the attributes of the objects of a theme to the objects of a second theme based on a spatial relation
+	\param themeMod			pointer to theme that has the attributes that will be passed
+	\param theme			pointer to the theme that will receive the attributes
+	\param tableName		name of the table that will store the attributes passed from the first theme
+	\param spatialRelation	a spatial relation (or a combination of) that will be used as the criteria to pass the attributes between the themes
+	\param attributes		a list of attributes from the first theme that should be distributes to the second theme
+	\param logFile			Optional: a pointer to a text file where error messages will be saved
+	\return true if it succeed and false otherwise
+*/
+TLFUNCTIONS_DLL bool TeGeoOpAssignDataLocationDistribute(TeTheme* themeMod, TeTheme* theme, const string& tableName, const int& spatialRelation, const vector<string>& attributes = vector<string>(), TeAsciiFile* logFile=0);
+
+/** Assign Data By Location - Collect: collects the attributes of the objects of a theme and assign it to second theme based on a spatial relation
+	\param restrTheme		pointer to theme that has the attributes that will be passed
+	\param srcTheme			pointer to the theme that has the attributes that will be collected 
+	\param newTableName		name of the table that will store the attributes collected
+	\param measuresColl		the definition of the attributes (with the measures over it) that should passed to first theme
+	\param spatialRelation	a spatial relation (or a combination of) that will be used as the criteria to pass the attributes between the themes
+	\return true if it succeed and false otherwise
+*/
+TLFUNCTIONS_DLL bool TeGeoOpAssignByLocationCollect(TeTheme* restrTheme, TeTheme* srcTheme, const string& newTableName, TeGroupingAttr& measuresColl, const int& spatialRelation);
+
+/** Generates a new layer with the buffers of the objects of a theme
+	\param newLayer			pointer to a new layer that will receive the buffers generated
+	\param themeIn			pointer to a source theme that will provide the objects to generate the buffers  
+	\param selOb			define which objects of the themeIn will be used
+	\param bufferType		define the buffer type: inside/outside/inside+outside
+	\param bufferDistance	the buffer distance in the same unit of the object geometries 
+	\param bufferLevels		the number of buffer rings
+	\param numPoints		the number of points that should be used to describe the curved corners of the buffer zone
+	\param doUnion			a flag to indicate if this function will dissolve barries among buffers
+	\param tableName		name of the attribute table that will provide an attribute that defines the buffer distance for each object
+	\param attrName			attribute name of the attribute table "tableName" that will provide the buffer distance for each object
+	\param logFile			Optional: a pointer to a text file where error messages will be saved
+	\return true if it succeed and false otherwise
+*/
+TLFUNCTIONS_DLL bool TeGeoOpBuffer(TeLayer* newLayer, TeTheme* themeIn, const TeSelectedObjects& selOb, const TeBUFFERREGION::TeBufferType& bufferType, const double& bufferDistance, 
+				   const unsigned int& bufferLevels, const unsigned int& numPoints, const bool& doUnion=false, const string& tableName="", const string& attrName="", 
+				   TeAsciiFile* logFile=0);
+
+/** \brief Calculates the distance to the nearest neighbour (NN)
+	This function calculates the distance of objetcs in the input theme to the nearest object in a neighbour candidates theme.
+	For complex geometries such as polygons, cells, lines, sets of geometries or multigeometries the NN is found
+	based on thedistance between the centroids of the geometries (for both input and for neighbour candidates objects).
+	If themes have different projections the distance will be computed using input theme projection.
+	
+	\param inputTheme		pointer to the theme that contains the objects to which the nearest neighbour are being searched
+	\param iselObj			a specific selection of the input theme  
+	\param neighTheme		pointer to the theme that contains the candidates to NN
+	\param nnselObj			a specific selection of NN theme
+	\param distColName		the name of the column that will contain the distance to the NN object. If empty, the name "DIST" will be used. If
+	the column should be created in a specific table, use the convention "tableName.colName", otherwise the first static table will be
+	sued. If the column exists its values will be updated, if it don't the column will be created.
+	\param NNIDColName		the name of the column that will contain the identification of the NN object. If empty the column won't be generated.
+	\return true if it succeed and false otherwise
+*/
+TLFUNCTIONS_DLL bool TeGeoOpNearestNeighbour(TeTheme* inputTheme, TeSelectedObjects iselObj, 
+							 TeTheme* neighTheme, TeSelectedObjects nnselObj, 
+							 const string& distColName = "", const string& NNIDColName = "");
+
+
+/** \internal */
+TLFUNCTIONS_DLL bool TeGeoOpOverlayUnion(TeLayer* newLayer, TeTheme* theme, TeTheme* themeOverlay, TeSelectedObjects selOb, TeSelectedObjects selObOverlay, TeAsciiFile* logFile=0);
+/** @} */ // End of group GeoOp 
+
+#endif
+
diff --git a/src/terralib/functions/TeImportBNA.cpp b/src/terralib/functions/TeImportBNA.cpp
old mode 100755
new mode 100644
index 0b50f7d..c7eba54
--- a/src/terralib/functions/TeImportBNA.cpp
+++ b/src/terralib/functions/TeImportBNA.cpp
@@ -1,515 +1,515 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <string>
-#include <iostream>
-#include <list>
-
-#ifdef WIN32
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-
-using namespace std;
-
-#include "TeDriverBNA.h"
-#include "TeTable.h"
-#include "TeGeometry.h"
-#include "TeAsciiFile.h"
-#include "TeException.h"
-#include "TeProjection.h"
-#include "TeAttribute.h"
-#include "TeTable.h"
-#include "TeAssertions.h"
-#include "TeUtils.h"
-#include "TeLayer.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeDatabase.h"
-
-bool TeReadBNAObjects(TeAsciiFile& bnaFile, TeTable& attTable, TePointSet& ptSet,
-					  TeLineSet& lnSet, TePolygonSet& pSet, 
-					  int ncolumns, int nrecords, int delta, int attLinkColumnIndex);
-
-bool TeBNARegionDecode(TeAsciiFile& bnaFile, TePolygonSet& temp, string& index, const int& npoints);
-
-bool TeBNALineDecode(TeAsciiFile& bnaFile, TeLineSet& temp, string& index, const int& npoints);
-
-bool TeBNAPointDecode(TeAsciiFile& bnaFile, TePointSet& temp, string& index);
-
-
-
-TeLayer* TeImportBNA(const string& bnaFileName, TeDatabase* db, const string& layerName)
-{
-	if(!db || bnaFileName.empty()) 
-		return 0;
-
-	// check if format is complete (BNA file exist)
-	string filePrefix = TeGetName(bnaFileName.c_str());
-	string ftest = filePrefix + ".bna";
-	if(access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".BNA";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-
-	// found a valid layer name
-	string lName = layerName;
-
-	if(layerName.empty())
-		lName = TeGetBaseName(bnaFileName.c_str());	
-
-	string newLayerName = lName;
-
-	TeLayerMap& layerMap = db->layerMap();
-	TeLayerMap::iterator it;
-
-	bool flag = true;
-
-	int n = 1;
-
-	while(flag)
-	{
-		for(it = layerMap.begin(); it != layerMap.end(); ++it)
-		{
-			if(TeStringCompare(it->second->name(), newLayerName))
-				break;
-		}
-
-		if(it == layerMap.end())
-			flag = 0;
-		else
-			newLayerName = lName + "_" + Te2String(n);
-
-		n++;	
-	}
-
-	// Use no projection
-	TeLayer* newLayer = new TeLayer(newLayerName, db);
-
-	if(newLayer->id() <= 0)
-		return 0;				// couldn�t create new layer
-
-	TeAttributeList attList;
-
-	bool res = TeImportBNA(newLayer, bnaFileName, "", attList, 60);
-
-	if (res)
-		return newLayer;
-	else
-	{
-		db->deleteLayer(newLayer->id());
-
-		delete newLayer;
-
-		return 0;
-	}
-}
-
-bool TeImportBNA(TeLayer* layer, const string& bnaFileName, string attrTableName,
-				 TeAttributeList& attList, int unsigned chunkSize, const string& linkCol)
-{
-	if(chunkSize <= 0)
-		chunkSize = 1;
-
-	//-- Step 1: Read any adicional information (ex. projection) 
-	char separator = ',';
-
-
-	if(!TeReadBNAAttributeList(bnaFileName, attList))
-		return false;	// Attributelist read error
-
-
-	string linkColName = linkCol;
-
-	if(linkColName.empty())
-		linkColName = attList[0].rep_.name_;
-
-	int attLinkColumnIndex = 0;
-
-	for(unsigned int i = 0; i < attList.size(); ++i)
-	{
-		if(attList[i].rep_.name_ == linkColName)
-		{
-			attLinkColumnIndex = (int)i;
-			break;
-		}
-	}
-		
-
-	// define a TeAttributeTable
-	if (attrTableName.empty())
-	{
-		if (layer->name().empty())
-			return false;
-		else
-			attrTableName = layer->name();
-	}
-	
-	TeTable attTable(attrTableName, attList, linkColName, linkColName, TeAttrStatic);
-
-	attTable.setSeparator(separator);
-
-	// insert the table into the database
-	if(!layer->createAttributeTable(attTable))
-		return false;
-
-	int ncol = attList.size();
-
-	TeAsciiFile bnaFile(bnaFileName);
-
-	int delta = 0;
-
-	TePointSet ptSet;
-	TeLineSet lnSet;
-	TePolygonSet pSet;
-
-	while(TeReadBNAObjects(bnaFile, attTable, ptSet, lnSet, pSet, ncol, chunkSize, delta, attLinkColumnIndex))
-	{
-		// save table
-		if (!layer->saveAttributeTable( attTable ))
-		{
-			attTable.clear();
-			break;
-		}
-
-		// save the remaining geometries
-		if(ptSet.size() > 0)
-		{
-			layer->addPoints(ptSet); 
-			ptSet.clear();
-		}
-
-		if(lnSet.size() > 0)
-		{
-			layer->addLines(lnSet);
-			lnSet.clear();
-		}
-
-		if(pSet.size() > 0)
-		{
-			layer->addPolygons(pSet); 
-			pSet.clear();
-		}
-
-		delta += attTable.size();
-		
-		attTable.clear();
-	}	
-
-	// Create the spatial indexes
-	int rep = layer->geomRep();
-	if (rep & TePOINTS)
-	{
-		layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE);
-	}
-	if (rep & TeLINES)
-	{
-		layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE);
-	}
-	if (rep & TePOLYGONS)
-	{
-		layer->database()->insertMetadata(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), (TeSpatialIndexType)TeRTREE);
-	}
-	return true;
-}
-
-
-bool TeReadBNAAttributeList(const string& bnaFileName, TeAttributeList& attList)
-{
-	TeAsciiFile bnaFile(bnaFileName);
-
-	if(!bnaFile.isNotAtEOF())
-		 return false;
-
-	vector<string> strList;
-
-	bnaFile.readStringListCSV(strList, ',');
-
-	unsigned int nFields = (strList.size() - 1u);
-
-	if(nFields <= 0)
-		return false;
-
-	if(attList.size() > 0u)	// Has already defined attributes, only check the number
-	{
-		if(attList.size() != nFields)
-			return false;
-		else
-			return true;
-	}
-
-	// In future, look for a better way to find the field name
-	// see in the specification of file format there is something about the field names!
-
-	TeAttribute at1;
-	at1.rep_.type_ = TeSTRING;
-	at1.rep_.numChar_ = 255;		
-	at1.rep_.name_ = "IBGE_CODE";
-	at1.rep_.isPrimaryKey_ = false;
-	attList.push_back(at1);
-
-	if(nFields > 1)
-	{
-		TeAttribute at2;
-		at2.rep_.type_ = TeSTRING;
-		at2.rep_.numChar_ = 255;		
-		at2.rep_.name_ = "IBGE_NAME";
-		at2.rep_.isPrimaryKey_ = false;
-		attList.push_back(at2);
-	}
-
-	for(unsigned int i = 2; i < nFields; ++i)
-	{
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;
-		at.rep_.numChar_ = 255;		
-		at.rep_.name_ = string("FIELD_") + Te2String(i);
-		at.rep_.isPrimaryKey_ = false;
-		attList.push_back(at);
-	}
-
-	return true;
-}
-
-
-bool TeReadBNAObjects(TeAsciiFile& bnaFile, TeTable& attTable, TePointSet& ptSet,
-					  TeLineSet& lnSet, TePolygonSet& pSet, 
-					  int ncolumns, int nrecords, int /* delta */, int attLinkColumnIndex)
-{
-	if (!bnaFile.isNotAtEOF() || nrecords <=0 || ncolumns <= 0)
-		return false;
-
-	char separator = attTable.separator();
-
-	int count;
-
-	for(count=0; count < nrecords; ++count)
-	{
-		if(!bnaFile.isNotAtEOF())
-			 break;
-
-		// Ler os atributos do objeto e o tipo/tamanho da geometria
-
-		TeTableRow row;
-
-
-		for(int n = 0; n < ncolumns; ++n)
-		{
-			string value;
-
-			try 
-			{
-				value = bnaFile.readStringCSVNoQuote(separator);
-			}
-			catch(...)
-			{
-				if(count > 0)
-					return true;
-				else
-					return false;
-			}
-
-			row.push_back (value);
-		}
-
-		attTable.add(row);
-
-		string bnaGeometryTypeLen = bnaFile.readStringCSVNoQuote(separator);
-
-		int bnaGTypeLen = atoi(bnaGeometryTypeLen.c_str());
-
-		string index = row[attLinkColumnIndex];
-
-		// Go to the geometry line begin
-		bnaFile.findNewLine();
-
-		if(bnaGTypeLen > 2)
-		{
-			if(!TeBNARegionDecode(bnaFile, pSet, index, bnaGTypeLen))
-				return false;
-		}
-		else if(bnaGTypeLen < -1)
-		{
-			if(!TeBNALineDecode(bnaFile, lnSet, index, -bnaGTypeLen))
-				return false;
-		}
-		else if(bnaGTypeLen == 1)
-		{
-			if(!TeBNAPointDecode(bnaFile, ptSet, index))
-				return false;
-		}
-		else
-			return false;
-
-		bnaFile.findNewLine();
-	}
-
-	return true;
-}
-
-bool TeBNARegionDecode(TeAsciiFile& bnaFile, TePolygonSet& temp, string& index, const int& npoints)
-{
-	int i;
-	unsigned int j;
-
-	vector<TePolygon> pVec;
-	TeLine2D l;
-
-	TeCoord2D coordMainArea;
-	TeCoord2D firstCoord;
-	bool first = false;
-
-	for(i = 0; i < npoints; ++i)
-	{
-		if(!bnaFile.isNotAtEOF())
-			return false;
-
-		double x = bnaFile.readFloat();
-		bnaFile.readChar();
-		double y = bnaFile.readFloat();
-
-		//bnaFile.findNewLine();
-
-		TeCoord2D c(x, y);
-
-		if(i == 0)
-		{
-			coordMainArea.setXY(x, y);
-			firstCoord = coordMainArea;
-			first = false;
-			l.add(c);
-		}
-		else
-		{
-			if(c == firstCoord)
-			{
-				l.add(c);
-				l.objectId(index);
-				TeLinearRing r(l);
-				r.objectId(index);
-				TePolygon p;
-				p.add(r);
-				p.objectId(index);
-
-				if(pVec.size() == 0)
-					pVec.push_back(p);
-				else
-				{
-					for(j = 0; j < pVec.size(); ++j)
-					{	
-						TePolygon paux = 	pVec[j];				
-						if(TeWithin(p, paux))
-						{
-							pVec[j].add(p[0]);
-							break;
-						}		
-						
-					}
-
-					if(j == pVec.size())
-						pVec.push_back(p);
-				}
-
-				// Make new line - Don't clear!
-				l = TeLine2D();
-
-				first = true;
-
-			}
-			else if(c == coordMainArea)
-			{
-				continue;
-			}
-			else
-			{
-				if(first)
-				{
-					firstCoord = c;
-					first = false;
-				}
-
-				l.add(c);
-			}
-		}
-	}
-
-	for(unsigned int k = 0; k < pVec.size(); ++k)
-		temp.add(pVec[k]);
-
-
-	return true;
-}
-
-bool TeBNALineDecode(TeAsciiFile& bnaFile, TeLineSet& temp, string& index, const int& npoints)
-{
-	TeLine2D l;
-
-	l.objectId(index);
-
-	for(int i = 0; i < npoints; ++i)
-	{
-		if(!bnaFile.isNotAtEOF())
-			return false;
-
-		double x = bnaFile.readFloat();
-		bnaFile.readChar();
-		double y = bnaFile.readFloat();
-
-		//bnaFile.findNewLine();
-
-		TeCoord2D c(x, y);
-
-		l.add(c);
-	}
-
-	temp.add(l);
-
-	return true;
-}
-
-bool TeBNAPointDecode(TeAsciiFile& bnaFile, TePointSet& temp, string& index)
-{
-	if(!bnaFile.isNotAtEOF())
-		return false;
-
-	double x = bnaFile.readFloat();
-	bnaFile.readChar();
-	double y = bnaFile.readFloat();
-
-	//bnaFile.findNewLine();
-
-	TeCoord2D c(x, y);
-
-	TePoint pt(c);
-
-	pt.objectId(index);
-
-	temp.add(pt);
-
-	return true;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <string>
+#include <iostream>
+#include <list>
+
+#ifdef WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+using namespace std;
+
+#include "TeDriverBNA.h"
+#include "TeTable.h"
+#include "TeGeometry.h"
+#include "TeAsciiFile.h"
+#include "TeException.h"
+#include "TeProjection.h"
+#include "TeAttribute.h"
+#include "TeTable.h"
+#include "TeAssertions.h"
+#include "TeUtils.h"
+#include "TeLayer.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeDatabase.h"
+
+bool TeReadBNAObjects(TeAsciiFile& bnaFile, TeTable& attTable, TePointSet& ptSet,
+					  TeLineSet& lnSet, TePolygonSet& pSet, 
+					  int ncolumns, int nrecords, int delta, int attLinkColumnIndex);
+
+bool TeBNARegionDecode(TeAsciiFile& bnaFile, TePolygonSet& temp, string& index, const int& npoints);
+
+bool TeBNALineDecode(TeAsciiFile& bnaFile, TeLineSet& temp, string& index, const int& npoints);
+
+bool TeBNAPointDecode(TeAsciiFile& bnaFile, TePointSet& temp, string& index);
+
+
+
+TeLayer* TeImportBNA(const string& bnaFileName, TeDatabase* db, const string& layerName)
+{
+	if(!db || bnaFileName.empty()) 
+		return 0;
+
+	// check if format is complete (BNA file exist)
+	string filePrefix = TeGetName(bnaFileName.c_str());
+	string ftest = filePrefix + ".bna";
+	if(access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".BNA";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+
+	// found a valid layer name
+	string lName = layerName;
+
+	if(layerName.empty())
+		lName = TeGetBaseName(bnaFileName.c_str());	
+
+	string newLayerName = lName;
+
+	TeLayerMap& layerMap = db->layerMap();
+	TeLayerMap::iterator it;
+
+	bool flag = true;
+
+	int n = 1;
+
+	while(flag)
+	{
+		for(it = layerMap.begin(); it != layerMap.end(); ++it)
+		{
+			if(TeStringCompare(it->second->name(), newLayerName))
+				break;
+		}
+
+		if(it == layerMap.end())
+			flag = 0;
+		else
+			newLayerName = lName + "_" + Te2String(n);
+
+		n++;	
+	}
+
+	// Use no projection
+	TeLayer* newLayer = new TeLayer(newLayerName, db);
+
+	if(newLayer->id() <= 0)
+		return 0;				// couldn�t create new layer
+
+	TeAttributeList attList;
+
+	bool res = TeImportBNA(newLayer, bnaFileName, "", attList, 60);
+
+	if (res)
+		return newLayer;
+	else
+	{
+		db->deleteLayer(newLayer->id());
+
+		delete newLayer;
+
+		return 0;
+	}
+}
+
+bool TeImportBNA(TeLayer* layer, const string& bnaFileName, string attrTableName,
+				 TeAttributeList& attList, int unsigned chunkSize, const string& linkCol)
+{
+	if(chunkSize <= 0)
+		chunkSize = 1;
+
+	//-- Step 1: Read any adicional information (ex. projection) 
+	char separator = ',';
+
+
+	if(!TeReadBNAAttributeList(bnaFileName, attList))
+		return false;	// Attributelist read error
+
+
+	string linkColName = linkCol;
+
+	if(linkColName.empty())
+		linkColName = attList[0].rep_.name_;
+
+	int attLinkColumnIndex = 0;
+
+	for(unsigned int i = 0; i < attList.size(); ++i)
+	{
+		if(attList[i].rep_.name_ == linkColName)
+		{
+			attLinkColumnIndex = (int)i;
+			break;
+		}
+	}
+		
+
+	// define a TeAttributeTable
+	if (attrTableName.empty())
+	{
+		if (layer->name().empty())
+			return false;
+		else
+			attrTableName = layer->name();
+	}
+	
+	TeTable attTable(attrTableName, attList, linkColName, linkColName, TeAttrStatic);
+
+	attTable.setSeparator(separator);
+
+	// insert the table into the database
+	if(!layer->createAttributeTable(attTable))
+		return false;
+
+	int ncol = attList.size();
+
+	TeAsciiFile bnaFile(bnaFileName);
+
+	int delta = 0;
+
+	TePointSet ptSet;
+	TeLineSet lnSet;
+	TePolygonSet pSet;
+
+	while(TeReadBNAObjects(bnaFile, attTable, ptSet, lnSet, pSet, ncol, chunkSize, delta, attLinkColumnIndex))
+	{
+		// save table
+		if (!layer->saveAttributeTable( attTable ))
+		{
+			attTable.clear();
+			break;
+		}
+
+		// save the remaining geometries
+		if(ptSet.size() > 0)
+		{
+			layer->addPoints(ptSet); 
+			ptSet.clear();
+		}
+
+		if(lnSet.size() > 0)
+		{
+			layer->addLines(lnSet);
+			lnSet.clear();
+		}
+
+		if(pSet.size() > 0)
+		{
+			layer->addPolygons(pSet); 
+			pSet.clear();
+		}
+
+		delta += attTable.size();
+		
+		attTable.clear();
+	}	
+
+	// Create the spatial indexes
+	int rep = layer->geomRep();
+	if (rep & TePOINTS)
+	{
+		layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE);
+	}
+	if (rep & TeLINES)
+	{
+		layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE);
+	}
+	if (rep & TePOLYGONS)
+	{
+		layer->database()->insertMetadata(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), (TeSpatialIndexType)TeRTREE);
+	}
+	return true;
+}
+
+
+bool TeReadBNAAttributeList(const string& bnaFileName, TeAttributeList& attList)
+{
+	TeAsciiFile bnaFile(bnaFileName);
+
+	if(!bnaFile.isNotAtEOF())
+		 return false;
+
+	vector<string> strList;
+
+	bnaFile.readStringListCSV(strList, ',');
+
+	unsigned int nFields = (strList.size() - 1u);
+
+	if(nFields <= 0)
+		return false;
+
+	if(attList.size() > 0u)	// Has already defined attributes, only check the number
+	{
+		if(attList.size() != nFields)
+			return false;
+		else
+			return true;
+	}
+
+	// In future, look for a better way to find the field name
+	// see in the specification of file format there is something about the field names!
+
+	TeAttribute at1;
+	at1.rep_.type_ = TeSTRING;
+	at1.rep_.numChar_ = 255;		
+	at1.rep_.name_ = "IBGE_CODE";
+	at1.rep_.isPrimaryKey_ = false;
+	attList.push_back(at1);
+
+	if(nFields > 1)
+	{
+		TeAttribute at2;
+		at2.rep_.type_ = TeSTRING;
+		at2.rep_.numChar_ = 255;		
+		at2.rep_.name_ = "IBGE_NAME";
+		at2.rep_.isPrimaryKey_ = false;
+		attList.push_back(at2);
+	}
+
+	for(unsigned int i = 2; i < nFields; ++i)
+	{
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;
+		at.rep_.numChar_ = 255;		
+		at.rep_.name_ = string("FIELD_") + Te2String(i);
+		at.rep_.isPrimaryKey_ = false;
+		attList.push_back(at);
+	}
+
+	return true;
+}
+
+
+bool TeReadBNAObjects(TeAsciiFile& bnaFile, TeTable& attTable, TePointSet& ptSet,
+					  TeLineSet& lnSet, TePolygonSet& pSet, 
+					  int ncolumns, int nrecords, int /* delta */, int attLinkColumnIndex)
+{
+	if (!bnaFile.isNotAtEOF() || nrecords <=0 || ncolumns <= 0)
+		return false;
+
+	char separator = attTable.separator();
+
+	int count;
+
+	for(count=0; count < nrecords; ++count)
+	{
+		if(!bnaFile.isNotAtEOF())
+			 break;
+
+		// Ler os atributos do objeto e o tipo/tamanho da geometria
+
+		TeTableRow row;
+
+
+		for(int n = 0; n < ncolumns; ++n)
+		{
+			string value;
+
+			try 
+			{
+				value = bnaFile.readStringCSVNoQuote(separator);
+			}
+			catch(...)
+			{
+				if(count > 0)
+					return true;
+				else
+					return false;
+			}
+
+			row.push_back (value);
+		}
+
+		attTable.add(row);
+
+		string bnaGeometryTypeLen = bnaFile.readStringCSVNoQuote(separator);
+
+		int bnaGTypeLen = atoi(bnaGeometryTypeLen.c_str());
+
+		string index = row[attLinkColumnIndex];
+
+		// Go to the geometry line begin
+		bnaFile.findNewLine();
+
+		if(bnaGTypeLen > 2)
+		{
+			if(!TeBNARegionDecode(bnaFile, pSet, index, bnaGTypeLen))
+				return false;
+		}
+		else if(bnaGTypeLen < -1)
+		{
+			if(!TeBNALineDecode(bnaFile, lnSet, index, -bnaGTypeLen))
+				return false;
+		}
+		else if(bnaGTypeLen == 1)
+		{
+			if(!TeBNAPointDecode(bnaFile, ptSet, index))
+				return false;
+		}
+		else
+			return false;
+
+		bnaFile.findNewLine();
+	}
+
+	return true;
+}
+
+bool TeBNARegionDecode(TeAsciiFile& bnaFile, TePolygonSet& temp, string& index, const int& npoints)
+{
+	int i;
+	unsigned int j;
+
+	vector<TePolygon> pVec;
+	TeLine2D l;
+
+	TeCoord2D coordMainArea;
+	TeCoord2D firstCoord;
+	bool first = false;
+
+	for(i = 0; i < npoints; ++i)
+	{
+		if(!bnaFile.isNotAtEOF())
+			return false;
+
+		double x = bnaFile.readFloat();
+		bnaFile.readChar();
+		double y = bnaFile.readFloat();
+
+		//bnaFile.findNewLine();
+
+		TeCoord2D c(x, y);
+
+		if(i == 0)
+		{
+			coordMainArea.setXY(x, y);
+			firstCoord = coordMainArea;
+			first = false;
+			l.add(c);
+		}
+		else
+		{
+			if(c == firstCoord)
+			{
+				l.add(c);
+				l.objectId(index);
+				TeLinearRing r(l);
+				r.objectId(index);
+				TePolygon p;
+				p.add(r);
+				p.objectId(index);
+
+				if(pVec.size() == 0)
+					pVec.push_back(p);
+				else
+				{
+					for(j = 0; j < pVec.size(); ++j)
+					{	
+						TePolygon paux = 	pVec[j];				
+						if(TeWithin(p, paux))
+						{
+							pVec[j].add(p[0]);
+							break;
+						}		
+						
+					}
+
+					if(j == pVec.size())
+						pVec.push_back(p);
+				}
+
+				// Make new line - Don't clear!
+				l = TeLine2D();
+
+				first = true;
+
+			}
+			else if(c == coordMainArea)
+			{
+				continue;
+			}
+			else
+			{
+				if(first)
+				{
+					firstCoord = c;
+					first = false;
+				}
+
+				l.add(c);
+			}
+		}
+	}
+
+	for(unsigned int k = 0; k < pVec.size(); ++k)
+		temp.add(pVec[k]);
+
+
+	return true;
+}
+
+bool TeBNALineDecode(TeAsciiFile& bnaFile, TeLineSet& temp, string& index, const int& npoints)
+{
+	TeLine2D l;
+
+	l.objectId(index);
+
+	for(int i = 0; i < npoints; ++i)
+	{
+		if(!bnaFile.isNotAtEOF())
+			return false;
+
+		double x = bnaFile.readFloat();
+		bnaFile.readChar();
+		double y = bnaFile.readFloat();
+
+		//bnaFile.findNewLine();
+
+		TeCoord2D c(x, y);
+
+		l.add(c);
+	}
+
+	temp.add(l);
+
+	return true;
+}
+
+bool TeBNAPointDecode(TeAsciiFile& bnaFile, TePointSet& temp, string& index)
+{
+	if(!bnaFile.isNotAtEOF())
+		return false;
+
+	double x = bnaFile.readFloat();
+	bnaFile.readChar();
+	double y = bnaFile.readFloat();
+
+	//bnaFile.findNewLine();
+
+	TeCoord2D c(x, y);
+
+	TePoint pt(c);
+
+	pt.objectId(index);
+
+	temp.add(pt);
+
+	return true;
+}
diff --git a/src/terralib/functions/TeImportCSV.cpp b/src/terralib/functions/TeImportCSV.cpp
old mode 100755
new mode 100644
index 2422a2e..a017311
--- a/src/terralib/functions/TeImportCSV.cpp
+++ b/src/terralib/functions/TeImportCSV.cpp
@@ -1,252 +1,314 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <string>
-#include <iostream>
-
-#include "TeDriverCSV.h"
-#include "TeTable.h"
-#include "TeException.h"
-#include "TeUtils.h"
-#include "TeLayer.h"
-#include "TeProgress.h"
-#include "TeDatabase.h"
-#include "TeAsciiFile.h"
-
-
-inline bool TeReadCSVFile(const string& csvFileName, TeTable& attrTable, TeDatabase* db, TeLayer* layer, 
-					 const int& attributeX, const int& attributeY, const char& separator, 
-					 const bool& firstLineIsHeader, const unsigned int& chunkSize, 
-					 const bool& createAutoNum)
-{
-
-	//Get the indexes. There is already an attribute autoNumber.
-	int indexUniqueId, indexLink;
-	indexUniqueId = indexLink = -1;
-	indexLink = attrTable.attrLinkPosition();
-	indexUniqueId = attrTable.attrUniquePosition();
-	
-	//insert the data from csvFile
-	vector<string> row;
-	TeAsciiFile* csvFile = new TeAsciiFile(csvFileName);
-
-	unsigned int totalSteps = 0;
-	while(csvFile->isNotAtEOF())
-	{
-		csvFile->findNewLine();
-		++totalSteps;
-	}
-
-	csvFile->rewind();
-
-	if (TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(totalSteps);
-		
-	// discard header row;
-	if (firstLineIsHeader && csvFile->isNotAtEOF())
-	{
-		csvFile->readStringListCSV(row,separator);
-		csvFile->findNewLine();
-		row.clear();
-	}
-
-	attrTable.clear();
-	
-	unsigned int nattr = attrTable.attributeList().size();
-	unsigned int nn=0;
-	vector<int> numCharsField;
-	for (nn=0; nn<nattr; ++nn)
-	{
-		if (attrTable.attributeList()[nn].rep_.type_ == TeSTRING)
-			numCharsField.push_back(attrTable.attributeList()[nn].rep_.numChar_);
-		else
-			numCharsField.push_back(-1);
-	}
-	if (createAutoNum)
-		--nattr;
-
-	unsigned int count = 0;
-	bool endOfFile = false;
-	while(!endOfFile)
-	{
-		unsigned int nrec = 0;
-
-		TePointSet ps;
-		//Gets chunkSize rows 
-		while (nrec < chunkSize && csvFile->isNotAtEOF())
-		{
-			TeTableRow trow;
-			csvFile->readStringListCSV(trow,separator);
-			if (trow.empty())
-			{
-				if(csvFile->isNotAtEOF())
-				{
-					csvFile->findNewLine();
-				}
-
-				break;
-			}
-			
-			for (nn=0; nn<nattr;++nn)
-			{
-				if (numCharsField[nn] > -1)
-				{
-					int nc = numCharsField[nn];
-					string aux = trow[nn].substr(0,nc);
-					trow[nn] = aux;
-				}
-			}
-
-			//if the first attribute is autonumber
-			if(createAutoNum)
-				trow.push_back (Te2String(count));
-            
-			//fill attributes 
-			attrTable.add(trow);
-
-			//fill points
-			if(attributeX>=0 && attributeY>=0 && layer)
-			{
-				TePoint p(atof(trow[attributeX].c_str()), atof(trow[attributeY].c_str()));
-				p.objectId(trow[indexLink]);
-				p.geomId(count);
-				ps.add(p);
-			}
-			csvFile->findNewLine();
-			trow.clear();
-			++nrec;
-			++count;
-		}
-		
-		endOfFile = !csvFile->isNotAtEOF();
-		//insert into attribute table
-		if (!db->insertTable(attrTable))
-		{
-			if (TeProgress::instance())
-				TeProgress::instance()->reset();
-			return false;
-		}
-		
-		//insert into point table
-		if(attributeX>=0 && attributeY>=0 && layer)
-		{
-			if(!layer->addPoints(ps))
-			{
-				if (TeProgress::instance())
-					TeProgress::instance()->reset();
-				return false;
-			}
-		}
-		attrTable.clear();
-		ps.clear();
-
-		if (TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-				break;
-			else
-				TeProgress::instance()->setProgress(count);
-		}
-	}
-	if (csvFile)
-	{
-		delete csvFile;
-		csvFile = 0; 
-	}
-
-
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	
-	//insert metadata : te_layer_table
-	int layerId = -1; //external table
-	if(layer)
-		layerId = layer->id();
-	
-	//attribute table metadata 
-	if(!db->insertTableInfo(layerId, attrTable))
-		return false;
-	
-	if(layer)
-		layer->addAttributeTable(attrTable);
-
-	//point table metadata 
-	if(attributeX>=0 && attributeY>=0 && layer)
-	{
-		 if(!db->insertMetadata(layer->tableName(TePOINTS),db->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box()))
-			return false;
-
-		 if(!db->createSpatialIndex(layer->tableName(TePOINTS),db->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE))
-			return false;
-	}
-	return true;
-}
-
-
-bool TeImportCSVFile(const string& csvFileName, TeTable& attrTable, TeDatabase* db, TeLayer* layer, 
-					 const char& separator, const bool& firstLineIsHeader,  const unsigned int& chunkSize, 
-					 const bool& createAutoNum)
-{
-	//test database pointer
-	if(!db)
-		return false;
-	
-	//create attribute table
-	if(!db->createTable(attrTable.name(), attrTable.attributeList()))
-		return false;
-
-	//insert data
-	if(!TeReadCSVFile(csvFileName, attrTable, db, layer, -1, -1, separator, firstLineIsHeader, chunkSize, createAutoNum))
-	{
-		db->deleteTable(attrTable.name());
-		return false;
-	}
-	return true;
-}
-
-
-bool TeImportCSVFile(const string& csvFileName, const int& attributeX, const int& attributeY, 
-					 TeTable& attrTable, TeDatabase* db, TeLayer* layer, const char& separator, 
-					 const bool& firstLineIsHeader,  const unsigned int& chunkSize,  const bool& createAutoNum)
-{
-
-	//test database pointer
-	if(!db || !layer)
-		return false;
-	
-	//create attribute table
-	if(!db->createTable(attrTable.name(), attrTable.attributeList()))
-		return false;
-
-	//create geometry table
-	if(!layer->addGeometry(TePOINTS))
-		return false;
-		
-	//insert data
-	if(!TeReadCSVFile(csvFileName, attrTable, db, layer, attributeX, attributeY, separator, firstLineIsHeader, chunkSize, createAutoNum))
-	{
-		db->deleteTable(attrTable.name());
-		return false;
-	}
-	return true;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <string>
+#include <iostream>
+
+#include "TeDriverCSV.h"
+#include "TeTable.h"
+#include "TeException.h"
+#include "TeUtils.h"
+#include "TeLayer.h"
+#include "TeProgress.h"
+#include "TeDatabase.h"
+#include "TeAsciiFile.h"
+
+
+bool decoderCoordinate( const std::string &value, double &retValue )
+{
+	int								degree;
+	int								minute;
+	float							second;
+	int								signal=1;
+	int								status;
+	basic_string <char>::size_type	index;
+	std::string						strCoordinate;
+	std::string						strFinalCoordinate;
+
+
+	if(value.empty())	return false;
+
+	strCoordinate=TeConvertToUpperCase(value);
+	if((index=strCoordinate.find("O")) !=string::npos)	
+	{
+		signal=-1;
+		strCoordinate.replace(index,1,"");
+	}
+	if((index=strCoordinate.find("W")) !=string::npos)	
+	{
+		signal=-1;
+		strCoordinate.replace(index,1,"");
+	}
+	if((index=strCoordinate.find("S")) !=string::npos)	
+	{
+		signal=-1;
+		strCoordinate.replace(index,1,"");
+	}
+	if((index=strCoordinate.find("-")) !=string::npos)	
+	{
+		signal=-1;
+		strCoordinate.replace(index,1,"");
+	}
+	if(strCoordinate[0] == '""') strCoordinate.replace(index,1,"");
+
+
+	for(unsigned i=0;i<strCoordinate.size();i++)
+	{
+		if(strCoordinate[i]==',')										strFinalCoordinate+=".";
+		else if((strCoordinate[i]!=34) && (strCoordinate[i]!=39))		strFinalCoordinate+=strCoordinate[i];
+	}
+
+
+	status=sscanf(strFinalCoordinate.c_str(),"%d %d %f",&degree,&minute,&second);
+	if(status!=3)	return false;
+	retValue=abs(degree) + fabs(minute/60.0) + fabs(second/3600.0);
+	retValue*=signal;
+	return true;
+}
+
+inline bool TeReadCSVFile(const string& csvFileName, TeTable& attrTable, TeDatabase* db, TeLayer* layer, 
+					 const int& attributeX, const int& attributeY, const char& separator, 
+					 const bool& firstLineIsHeader, const unsigned int& chunkSize, 
+					 const bool& createAutoNum)
+{
+
+	//Get the indexes. There is already an attribute autoNumber.
+	int indexUniqueId, indexLink;
+	indexUniqueId = indexLink = -1;
+	indexLink = attrTable.attrLinkPosition();
+	indexUniqueId = attrTable.attrUniquePosition();
+	
+	//insert the data from csvFile
+	vector<string> row;
+	TeAsciiFile* csvFile = new TeAsciiFile(csvFileName);
+
+	unsigned int totalSteps = 0;
+	while(csvFile->isNotAtEOF())
+	{
+		csvFile->findNewLine();
+		++totalSteps;
+	}
+
+	csvFile->rewind();
+
+	if (TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(totalSteps);
+		
+	// discard header row;
+	if (firstLineIsHeader && csvFile->isNotAtEOF())
+	{
+		csvFile->readStringListCSV(row,separator);
+		csvFile->findNewLine();
+		row.clear();
+	}
+
+	attrTable.clear();
+	
+	unsigned int nattr = attrTable.attributeList().size();
+	unsigned int nn=0;
+	vector<int> numCharsField;
+	for (nn=0; nn<nattr; ++nn)
+	{
+		if (attrTable.attributeList()[nn].rep_.type_ == TeSTRING)
+			numCharsField.push_back(attrTable.attributeList()[nn].rep_.numChar_);
+		else
+			numCharsField.push_back(-1);
+	}
+	if (createAutoNum)
+		--nattr;
+
+	unsigned int count = 0;
+	bool endOfFile = false;
+	while(!endOfFile)
+	{
+		unsigned int nrec = 0;
+
+		TePointSet ps;
+		//Gets chunkSize rows 
+		while (nrec < chunkSize && csvFile->isNotAtEOF())
+		{
+			TeTableRow trow;
+			csvFile->readStringListCSV(trow,separator);
+			if (trow.empty())
+			{
+				if(csvFile->isNotAtEOF())
+				{
+					csvFile->findNewLine();
+				}
+
+				break;
+			}
+			
+			for (nn=0; nn<nattr;++nn)
+			{
+				if (numCharsField[nn] > -1)
+				{
+					int nc = numCharsField[nn];
+					string aux = trow[nn].substr(0,nc);
+					trow[nn] = aux;
+				}
+			}
+
+			//if the first attribute is autonumber
+			if(createAutoNum)
+				trow.push_back (Te2String(count));
+            
+			//fill attributes 
+			attrTable.add(trow);
+
+			//fill points
+			if(attributeX>=0 && attributeY>=0 && layer)
+			{
+				double x;
+				double y;
+				TePoint p;
+
+				if(decoderCoordinate(trow[attributeX].c_str(),x) && decoderCoordinate(trow[attributeY].c_str(),y))
+					p=TePoint(x,y);
+				else 
+					p=TePoint(atof(trow[attributeX].c_str()), atof(trow[attributeY].c_str()));
+
+				p.objectId(trow[indexLink]);
+				p.geomId(count);
+				ps.add(p);
+			}
+			csvFile->findNewLine();
+			trow.clear();
+			++nrec;
+			++count;
+		}
+		
+		endOfFile = !csvFile->isNotAtEOF();
+		//insert into attribute table
+		if (!db->insertTable(attrTable))
+		{
+			if (TeProgress::instance())
+				TeProgress::instance()->reset();
+			return false;
+		}
+		
+		//insert into point table
+		if(attributeX>=0 && attributeY>=0 && layer)
+		{
+			if(!layer->addPoints(ps))
+			{
+				if (TeProgress::instance())
+					TeProgress::instance()->reset();
+				return false;
+			}
+		}
+		attrTable.clear();
+		ps.clear();
+
+		if (TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+				break;
+			else
+				TeProgress::instance()->setProgress(count);
+		}
+	}
+	if (csvFile)
+	{
+		delete csvFile;
+		csvFile = 0; 
+	}
+
+
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	
+	//insert metadata : te_layer_table
+	int layerId = -1; //external table
+	if(layer)
+		layerId = layer->id();
+	
+	//attribute table metadata 
+	if(!db->insertTableInfo(layerId, attrTable))
+		return false;
+	
+	if(layer)
+		layer->addAttributeTable(attrTable);
+
+	//point table metadata 
+	if(attributeX>=0 && attributeY>=0 && layer)
+	{
+		 if(!db->insertMetadata(layer->tableName(TePOINTS),db->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box()))
+			return false;
+
+		 if(!db->createSpatialIndex(layer->tableName(TePOINTS),db->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE))
+			return false;
+	}
+	return true;
+}
+
+
+bool TeImportCSVFile(const string& csvFileName, TeTable& attrTable, TeDatabase* db, TeLayer* layer, 
+					 const char& separator, const bool& firstLineIsHeader,  const unsigned int& chunkSize, 
+					 const bool& createAutoNum)
+{
+	//test database pointer
+	if(!db)
+		return false;
+	
+	//create attribute table
+	if(!db->createTable(attrTable.name(), attrTable.attributeList()))
+		return false;
+
+	//insert data
+	if(!TeReadCSVFile(csvFileName, attrTable, db, layer, -1, -1, separator, firstLineIsHeader, chunkSize, createAutoNum))
+	{
+		db->deleteTable(attrTable.name());
+		return false;
+	}
+	return true;
+}
+
+
+bool TeImportCSVFile(const string& csvFileName, const int& attributeX, const int& attributeY, 
+					 TeTable& attrTable, TeDatabase* db, TeLayer* layer, const char& separator, 
+					 const bool& firstLineIsHeader,  const unsigned int& chunkSize,  const bool& createAutoNum)
+{
+
+	//test database pointer
+	if(!db || !layer)
+		return false;
+	
+	//create attribute table
+	if(!db->createTable(attrTable.name(), attrTable.attributeList()))
+		return false;
+
+	//create geometry table
+	if(!layer->addGeometry(TePOINTS))
+		return false;
+		
+	//insert data
+	if(!TeReadCSVFile(csvFileName, attrTable, db, layer, attributeX, attributeY, separator, firstLineIsHeader, chunkSize, createAutoNum))
+	{
+		db->deleteTable(attrTable.name());
+		return false;
+	}
+	return true;
+}
+
+
diff --git a/src/terralib/functions/TeImportExport.h b/src/terralib/functions/TeImportExport.h
old mode 100755
new mode 100644
index 430f948..61a9f8a
--- a/src/terralib/functions/TeImportExport.h
+++ b/src/terralib/functions/TeImportExport.h
@@ -1,38 +1,38 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeImportExport.h
-    \brief This file contains functions to deal with the importing/exporting of geographical data to and from a TerraLib database
-	\deprecaded This is a deprecated file kept for compatibility reasons. You should use some of the files bellow instead.
-*/
-#ifndef __TERRALIB_INTERNAL_IMPORTEXPORT_H
-#define __TERRALIB_INTERNAL_IMPORTEXPORT_H
-
-// This is a deprecated file kept for compatibility reasons. You should use some of the files bellow instead.
-
-#include "TeDriverBNA.h"
-#include "TeDriverMIDMIF.h"
-#include "TeDriverCSV.h"
-#include "TeDriverSPRING.h"
-#include "TeDriverSHPDBF.h"
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeImportExport.h
+    \brief This file contains functions to deal with the importing/exporting of geographical data to and from a TerraLib database
+	\deprecaded This is a deprecated file kept for compatibility reasons. You should use some of the files bellow instead.
+*/
+#ifndef __TERRALIB_INTERNAL_IMPORTEXPORT_H
+#define __TERRALIB_INTERNAL_IMPORTEXPORT_H
+
+// This is a deprecated file kept for compatibility reasons. You should use some of the files bellow instead.
+
+#include "TeDriverBNA.h"
+#include "TeDriverMIDMIF.h"
+#include "TeDriverCSV.h"
+#include "TeDriverSPRING.h"
+#include "TeDriverSHPDBF.h"
+#endif
+
diff --git a/src/terralib/functions/TeImportGeo.cpp b/src/terralib/functions/TeImportGeo.cpp
old mode 100755
new mode 100644
index 6d842e6..ac8f71f
--- a/src/terralib/functions/TeImportGeo.cpp
+++ b/src/terralib/functions/TeImportGeo.cpp
@@ -1,476 +1,476 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-// STL 
-#include <string>
-#include <iostream>
-#include <vector>
-#include <list>
-#include <map>
-
-using namespace std;
-
-#ifdef WIN32
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-
-// TerraLib
-
-#include "TeDriverSPRING.h"
-
-#include "TeAsciiFile.h"
-#include "TeBox.h"
-#include "TeLayer.h"
-#include "TeException.h"
-#include "TeUtils.h"
-#include "TeDatabase.h"
-
-//! Import only the attributes of a GEO/TAB data to a layer TerraLib
-/*!
-	\param layer pointer to a layer
-	\param geoFileName GEO/TAB file name
-	\param attrTableName the name that the attribute table will be saved
-	\param objectIdAttr name of the attribute that has the identification of objects
-	\param chunckSize the number of objects in memory before save them in the layer
-*/
-bool TeImportGeoAttributes(TeLayer* layer, const string& geoFileName, string attrTableName="", unsigned int chunckSize=60);
-
-//! Import only the geometries of a GEO/TAB data to a layer TerraLib
-/*!
-	\param layer pointer to a layer
-	\param geoFileName GEO/TAB file name
-	\param chunckSize the number of objects in memory before save them in the layer
-*/
-bool TeImportGeoGeometries(TeLayer* layer, const string& geoFileName, unsigned int chunckSize=60);
-
-TeLayer* 
-TeImportGEO(const string& geoFileName, TeDatabase* db, const string& layerName)
-{
-	if (!db || geoFileName.empty()) 
-		return 0;
-
-	// check if format is complete (GEO e TAB files exist)
-	string filePrefix = TeGetName(geoFileName.c_str());
-	string ftest = filePrefix + ".geo";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".GEO";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-	ftest = filePrefix + ".tab";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".TAB";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-
-	// found a valid layer name
-	string lName;
-	string baseName = TeGetBaseName(geoFileName.c_str());
-	if (layerName.empty())
-		lName = baseName;
-	else
-		lName = layerName;
-
-	string newLayerName = lName;
-	TeLayerMap& layerMap = db->layerMap();
-	TeLayerMap::iterator it;
-	bool flag = true;
-	int n = 1;
-	while (flag)
-	{
-		for (it = layerMap.begin(); it != layerMap.end(); ++it)
-		{
-			if (TeStringCompare(it->second->name(),newLayerName))
-				break;
-		}
-		if (it == layerMap.end())
-			flag = 0;
-		else
-			newLayerName = lName + "_" +Te2String(n);
-		n++;	
-	}
-
-	// find projection
-	TeLayer* newLayer = new TeLayer(newLayerName,db);
-	if (newLayer->id() <= 0 )
-		return 0;				// couldn�t create new layer
-
-	bool res = TeImportGEO(newLayer,geoFileName);
-	if (res)
-		return newLayer;
-	else
-	{
-		db->deleteLayer(newLayer->id());
-		delete newLayer;
-		return 0;
-	}
-}
-
-bool 
-TeImportGEO(TeLayer* layer, const string& geoFileName, string attrTableName, unsigned int chunckSize)
-{
-	// Import the attribute table in chuncks
-	if (!TeImportGeoAttributes (layer,geoFileName,attrTableName,chunckSize))
-		return false;
-
-	//Import the geometries
-	if (!TeImportGeoGeometries (layer,geoFileName,chunckSize))
-		return false;
-
-	// Create the spatial indexes
-	int rep = layer->geomRep();
-	if (rep & TePOINTS)
-	{
-		layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE);
-	}
-	if (rep & TeLINES)
-	{
-		layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE);
-	}
-	if (rep & TePOLYGONS)
-	{
-		layer->database()->insertMetadata(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), (TeSpatialIndexType)TeRTREE);
-	}
-
-	return true;
-}
-
-void
-TeReadGeoAttributeList(const string& geoFileName,TeAttributeList& attList, string& labelName )
-{
-	string filePrefix = TeGetName (geoFileName.c_str()) ;
-	string fileName = filePrefix + ".tab";
-	try
-	{
-		TeAsciiFile	pFile (fileName);
-		string name ;
-
-		name = pFile.readString();	// "LABEL"
-		pFile.findNewLine();
-		name = pFile.readString();	// Spring category
-		labelName = pFile.readString();	// label name
-
-		while ( pFile.isNotAtEOF() && name != "SEPARATOR" )
-			name = pFile.readString ();
-
-		char separator = ',';
-		if ( name == "SEPARATOR" )
-		{
-			separator = pFile.readString ().c_str()[0];
-		}
-		pFile.findNewLine();
-
-		TeAttribute attribute;
-		while (pFile.isNotAtEOF())
-		{
-			name = pFile.readStringCSVNoSpace (separator);
-			if ( name == "INFO_END" )
-				break;
-
-			attribute.rep_.name_ = name;
-
-			name = pFile.readStringCSVNoSpace (separator);
-			if (name == "TEXT")
-				attribute.rep_.type_ = TeSTRING;
-			else if (name == "INTEGER")
-				attribute.rep_.type_ = TeINT;
-			else if (name == "TeDATETIME")
-					attribute.rep_.type_  = TeDATETIME;
-			else if (name == "REAL")
-				attribute.rep_.type_  = TeREAL;
-			else
-				attribute.rep_.type_  = TeUNKNOWN;
-
-			int size = pFile.readIntCSV (separator);
-			attribute.rep_.numChar_ = size;
-
-			attList.push_back ( attribute );
-			pFile.findNewLine();
-		}
-	}
-	catch(...)
-	{
-		return;
-	}
-}
-
-bool 
-TeImportGeoAttributes(TeLayer* layer,const string& geoFileName, string attrTableName, unsigned  int chunckSize)
-{
-	string filePrefix = TeGetName (geoFileName.c_str()) ;
-	string fileName = filePrefix + ".tab";
-
-	// Read attribute list information and key field name
-	TeAttributeList attList;
-	string linkName;
-	TeReadGeoAttributeList(geoFileName,attList,linkName);
-
-	if (attrTableName.empty())
-	{
-		if (layer->name().empty())
-			return false;
-		else
-			attrTableName = layer->name();
-	}
-
-	// check if given index is valid
-	TeAttributeList::iterator it = attList.begin();
-	int i = -1, j=0;
-	while (it != attList.end())
-	{
-		if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(linkName))		// index found
-		{
-			if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
-			{
-				(*it).rep_.type_ = TeSTRING;
-				(*it).rep_.numChar_ = 16;
-			}
-			(*it).rep_.isPrimaryKey_ = true;
-			i=j;
-			break;
-		}
-		++it;
-		j++;
-	}
-	if (it == attList.end())
-		return false;
-
-	TeAsciiFile	pFile (fileName);
-	string name = pFile.readString ();
-	pFile.findNewLine();
-
-	if (name != "TABLE")
-		return false;
-
-	TeTable attTable (attrTableName,attList,linkName,linkName,TeAttrStatic);
-	if (!layer->createAttributeTable(attTable))
-		return false;
-
-
-	int nAtt = attList.size();
-
-	// Identify the separator again
-	while ( pFile.isNotAtEOF() && name != "SEPARATOR" )
-		name = pFile.readString ();
-
-	char separator = ',';
-	if ( name == "SEPARATOR" )
-	{
-		separator = pFile.readString ().c_str()[0];
-	}
-	pFile.findNewLine();
-
-	// Skip the information lines
-	while ( pFile.isNotAtEOF() && name != "INFO_END" )
-		name = pFile.readString ();
-
-	if (name != "INFO_END")
-		return false;
-
-	pFile.findNewLine();
-	string value = pFile.readStringCSVNoQuote(separator);
-	try {
-		// Read the attribute lines
-		while (pFile.isNotAtEOF())
-		{
-			TeTableRow row;
-			for (int n=0; n<nAtt; n++)
-			{
-				row.push_back ( value ); 
-				if(pFile.isNotAtEOF())
-					value = pFile.readStringCSVNoQuote(separator);
-			}
-			attTable.add( row );
-
-			if ( attTable.size() == chunckSize )
-			{
-				layer->saveAttributeTable( attTable );
-				attTable.clear();
-			}
-			pFile.findNewLine();
-			value = pFile.readStringCSVNoQuote(separator);
-		}
-	}
-	catch (...)
-	{
-//		int a = 0;  end of file reached
-	}
-	// save the remaining rows
-	if (attTable.size() > 0 )
-		layer->saveAttributeTable( attTable );
-	attTable.clear();
-	return true;
-}
-
-bool 
-TeImportGeoGeometries ( TeLayer* layer, const string& geoFileName, unsigned int chunckSize)
-{
-	string filePrefix = TeGetName (geoFileName.c_str()) ;
-	string fileName = filePrefix + ".geo";
-
-	TePointSet pointSet;
-	TeLineSet lineSet;
-	TePolygonSet polySet;
-	TeTextSet textSet;
-
-
-/* -------------------------------------------------------------------- */
-/*      Open the  file.                                                 */
-/* -------------------------------------------------------------------- */
-
-	TeAsciiFile	pFile (fileName);
-
-	int size,nrings;
-	string geoId;
-
-/* -------------------------------------------------------------------- */
-/*      Get information about the file                                  */
-/* -------------------------------------------------------------------- */
-  try
-  {
-	while (pFile.isNotAtEOF())
-	{
-		string repType = pFile.readString ();
-		pFile.findNewLine();
-		if (repType == "POLIGONOS")
-		{
-			while ( 1 )
-			{
-				TePolygon poly;
-				string rings = pFile.readString ();
-				if (rings == "END" )
-					break;
-				nrings = atoi(rings.c_str());
-				if (!pFile.isNotAtEOF())
-					break;
-				geoId = pFile.readString ();
-				pFile.findNewLine();
-				poly.objectId ( geoId );
-				int i,j;
-				for (j=0;j<nrings;j++)
-				{
-					TeLine2D line;
-					size = pFile.readInt ();
-					pFile.findNewLine();
-					for (i=0;i<size;i++)
-					{
-	// Build the polygon
-						TeCoord2D xy = pFile.readCoord2D ();
-						line.add ( xy );
-					}
-					TeLinearRing ring (line);
-					poly.add ( ring );
-				}
-				polySet.add ( poly );
-				if ( polySet.size() == chunckSize )
-				{
-					layer->addPolygons( polySet ); 
-					polySet.clear();
-				}
-			}
-		}
-		if (repType == "LINHAS")
-		{
-			while ( 1 )
-			{
-				geoId = pFile.readStringCSVNoQuote (',');
-				pFile.findNewLine();
-				if (!pFile.isNotAtEOF() || geoId == "END")
-					break;
-				int i;
-				TeLine2D line;
-				size = pFile.readInt ();
-				pFile.findNewLine();
-				for (i=0;i<size;i++)
-				{
-	// Build the line
-					TeCoord2D xy = pFile.readCoord2D ();
-					line.add ( xy );
-				}
-				line.objectId ( geoId );
-				lineSet.add ( line );
-				if ( lineSet.size() == chunckSize )
-				{
-					layer->addLines( lineSet ); 
-					lineSet.clear();
-				}
-				pFile.findNewLine();
-			}
-		}
-		if (repType == "PONTOS")
-		{
-			while ( 1 )
-			{
-				geoId = pFile.readString ();
-				if (!pFile.isNotAtEOF() || geoId == "END" )
-					break;
-				TePoint point;
-	// Build the point
-				TeCoord2D xy = pFile.readCoord2D ();
-				point.add ( xy );
-				point.objectId ( geoId );
-				pointSet.add ( point );
-				if ( pointSet.size() == chunckSize )
-				{
-					layer->addPoints( pointSet ); 
-					pointSet.clear();
-				}
-				pFile.findNewLine();
-			}
-			if (repType.empty())
-				break;
-		}
-	}
-  }
-  catch(...)
-  {
-//	  int a = 0;
-  }
-	// save the remaining geometries
-	if (pointSet.size() > 0)
-	{
-		layer->addPoints( pointSet ); 
-		pointSet.clear();
-	}
-
-	if (lineSet.size() > 0 )
-	{
-		layer->addLines( lineSet ); 
-		lineSet.clear();
-	}
-
-	if (polySet.size() > 0)
-	{
-		layer->addPolygons( polySet ); 
-		polySet.clear();
-	}
-	return true;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+// STL 
+#include <string>
+#include <iostream>
+#include <vector>
+#include <list>
+#include <map>
+
+using namespace std;
+
+#ifdef WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+// TerraLib
+
+#include "TeDriverSPRING.h"
+
+#include "TeAsciiFile.h"
+#include "TeBox.h"
+#include "TeLayer.h"
+#include "TeException.h"
+#include "TeUtils.h"
+#include "TeDatabase.h"
+
+//! Import only the attributes of a GEO/TAB data to a layer TerraLib
+/*!
+	\param layer pointer to a layer
+	\param geoFileName GEO/TAB file name
+	\param attrTableName the name that the attribute table will be saved
+	\param objectIdAttr name of the attribute that has the identification of objects
+	\param chunckSize the number of objects in memory before save them in the layer
+*/
+bool TeImportGeoAttributes(TeLayer* layer, const string& geoFileName, string attrTableName="", unsigned int chunckSize=60);
+
+//! Import only the geometries of a GEO/TAB data to a layer TerraLib
+/*!
+	\param layer pointer to a layer
+	\param geoFileName GEO/TAB file name
+	\param chunckSize the number of objects in memory before save them in the layer
+*/
+bool TeImportGeoGeometries(TeLayer* layer, const string& geoFileName, unsigned int chunckSize=60);
+
+TeLayer* 
+TeImportGEO(const string& geoFileName, TeDatabase* db, const string& layerName)
+{
+	if (!db || geoFileName.empty()) 
+		return 0;
+
+	// check if format is complete (GEO e TAB files exist)
+	string filePrefix = TeGetName(geoFileName.c_str());
+	string ftest = filePrefix + ".geo";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".GEO";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+	ftest = filePrefix + ".tab";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".TAB";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+
+	// found a valid layer name
+	string lName;
+	string baseName = TeGetBaseName(geoFileName.c_str());
+	if (layerName.empty())
+		lName = baseName;
+	else
+		lName = layerName;
+
+	string newLayerName = lName;
+	TeLayerMap& layerMap = db->layerMap();
+	TeLayerMap::iterator it;
+	bool flag = true;
+	int n = 1;
+	while (flag)
+	{
+		for (it = layerMap.begin(); it != layerMap.end(); ++it)
+		{
+			if (TeStringCompare(it->second->name(),newLayerName))
+				break;
+		}
+		if (it == layerMap.end())
+			flag = 0;
+		else
+			newLayerName = lName + "_" +Te2String(n);
+		n++;	
+	}
+
+	// find projection
+	TeLayer* newLayer = new TeLayer(newLayerName,db);
+	if (newLayer->id() <= 0 )
+		return 0;				// couldn�t create new layer
+
+	bool res = TeImportGEO(newLayer,geoFileName);
+	if (res)
+		return newLayer;
+	else
+	{
+		db->deleteLayer(newLayer->id());
+		delete newLayer;
+		return 0;
+	}
+}
+
+bool 
+TeImportGEO(TeLayer* layer, const string& geoFileName, string attrTableName, unsigned int chunckSize)
+{
+	// Import the attribute table in chuncks
+	if (!TeImportGeoAttributes (layer,geoFileName,attrTableName,chunckSize))
+		return false;
+
+	//Import the geometries
+	if (!TeImportGeoGeometries (layer,geoFileName,chunckSize))
+		return false;
+
+	// Create the spatial indexes
+	int rep = layer->geomRep();
+	if (rep & TePOINTS)
+	{
+		layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE);
+	}
+	if (rep & TeLINES)
+	{
+		layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE);
+	}
+	if (rep & TePOLYGONS)
+	{
+		layer->database()->insertMetadata(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), (TeSpatialIndexType)TeRTREE);
+	}
+
+	return true;
+}
+
+void
+TeReadGeoAttributeList(const string& geoFileName,TeAttributeList& attList, string& labelName )
+{
+	string filePrefix = TeGetName (geoFileName.c_str()) ;
+	string fileName = filePrefix + ".tab";
+	try
+	{
+		TeAsciiFile	pFile (fileName);
+		string name ;
+
+		name = pFile.readString();	// "LABEL"
+		pFile.findNewLine();
+		name = pFile.readString();	// Spring category
+		labelName = pFile.readString();	// label name
+
+		while ( pFile.isNotAtEOF() && name != "SEPARATOR" )
+			name = pFile.readString ();
+
+		char separator = ',';
+		if ( name == "SEPARATOR" )
+		{
+			separator = pFile.readString ().c_str()[0];
+		}
+		pFile.findNewLine();
+
+		TeAttribute attribute;
+		while (pFile.isNotAtEOF())
+		{
+			name = pFile.readStringCSVNoSpace (separator);
+			if ( name == "INFO_END" )
+				break;
+
+			attribute.rep_.name_ = name;
+
+			name = pFile.readStringCSVNoSpace (separator);
+			if (name == "TEXT")
+				attribute.rep_.type_ = TeSTRING;
+			else if (name == "INTEGER")
+				attribute.rep_.type_ = TeINT;
+			else if (name == "TeDATETIME")
+					attribute.rep_.type_  = TeDATETIME;
+			else if (name == "REAL")
+				attribute.rep_.type_  = TeREAL;
+			else
+				attribute.rep_.type_  = TeUNKNOWN;
+
+			int size = pFile.readIntCSV (separator);
+			attribute.rep_.numChar_ = size;
+
+			attList.push_back ( attribute );
+			pFile.findNewLine();
+		}
+	}
+	catch(...)
+	{
+		return;
+	}
+}
+
+bool 
+TeImportGeoAttributes(TeLayer* layer,const string& geoFileName, string attrTableName, unsigned  int chunckSize)
+{
+	string filePrefix = TeGetName (geoFileName.c_str()) ;
+	string fileName = filePrefix + ".tab";
+
+	// Read attribute list information and key field name
+	TeAttributeList attList;
+	string linkName;
+	TeReadGeoAttributeList(geoFileName,attList,linkName);
+
+	if (attrTableName.empty())
+	{
+		if (layer->name().empty())
+			return false;
+		else
+			attrTableName = layer->name();
+	}
+
+	// check if given index is valid
+	TeAttributeList::iterator it = attList.begin();
+	int i = -1, j=0;
+	while (it != attList.end())
+	{
+		if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(linkName))		// index found
+		{
+			if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
+			{
+				(*it).rep_.type_ = TeSTRING;
+				(*it).rep_.numChar_ = 16;
+			}
+			(*it).rep_.isPrimaryKey_ = true;
+			i=j;
+			break;
+		}
+		++it;
+		j++;
+	}
+	if (it == attList.end())
+		return false;
+
+	TeAsciiFile	pFile (fileName);
+	string name = pFile.readString ();
+	pFile.findNewLine();
+
+	if (name != "TABLE")
+		return false;
+
+	TeTable attTable (attrTableName,attList,linkName,linkName,TeAttrStatic);
+	if (!layer->createAttributeTable(attTable))
+		return false;
+
+
+	int nAtt = attList.size();
+
+	// Identify the separator again
+	while ( pFile.isNotAtEOF() && name != "SEPARATOR" )
+		name = pFile.readString ();
+
+	char separator = ',';
+	if ( name == "SEPARATOR" )
+	{
+		separator = pFile.readString ().c_str()[0];
+	}
+	pFile.findNewLine();
+
+	// Skip the information lines
+	while ( pFile.isNotAtEOF() && name != "INFO_END" )
+		name = pFile.readString ();
+
+	if (name != "INFO_END")
+		return false;
+
+	pFile.findNewLine();
+	string value = pFile.readStringCSVNoQuote(separator);
+	try {
+		// Read the attribute lines
+		while (pFile.isNotAtEOF())
+		{
+			TeTableRow row;
+			for (int n=0; n<nAtt; n++)
+			{
+				row.push_back ( value ); 
+				if(pFile.isNotAtEOF())
+					value = pFile.readStringCSVNoQuote(separator);
+			}
+			attTable.add( row );
+
+			if ( attTable.size() == chunckSize )
+			{
+				layer->saveAttributeTable( attTable );
+				attTable.clear();
+			}
+			pFile.findNewLine();
+			value = pFile.readStringCSVNoQuote(separator);
+		}
+	}
+	catch (...)
+	{
+//		int a = 0;  end of file reached
+	}
+	// save the remaining rows
+	if (attTable.size() > 0 )
+		layer->saveAttributeTable( attTable );
+	attTable.clear();
+	return true;
+}
+
+bool 
+TeImportGeoGeometries ( TeLayer* layer, const string& geoFileName, unsigned int chunckSize)
+{
+	string filePrefix = TeGetName (geoFileName.c_str()) ;
+	string fileName = filePrefix + ".geo";
+
+	TePointSet pointSet;
+	TeLineSet lineSet;
+	TePolygonSet polySet;
+	TeTextSet textSet;
+
+
+/* -------------------------------------------------------------------- */
+/*      Open the  file.                                                 */
+/* -------------------------------------------------------------------- */
+
+	TeAsciiFile	pFile (fileName);
+
+	int size,nrings;
+	string geoId;
+
+/* -------------------------------------------------------------------- */
+/*      Get information about the file                                  */
+/* -------------------------------------------------------------------- */
+  try
+  {
+	while (pFile.isNotAtEOF())
+	{
+		string repType = pFile.readString ();
+		pFile.findNewLine();
+		if (repType == "POLIGONOS")
+		{
+			while ( 1 )
+			{
+				TePolygon poly;
+				string rings = pFile.readString ();
+				if (rings == "END" )
+					break;
+				nrings = atoi(rings.c_str());
+				if (!pFile.isNotAtEOF())
+					break;
+				geoId = pFile.readString ();
+				pFile.findNewLine();
+				poly.objectId ( geoId );
+				int i,j;
+				for (j=0;j<nrings;j++)
+				{
+					TeLine2D line;
+					size = pFile.readInt ();
+					pFile.findNewLine();
+					for (i=0;i<size;i++)
+					{
+	// Build the polygon
+						TeCoord2D xy = pFile.readCoord2D ();
+						line.add ( xy );
+					}
+					TeLinearRing ring (line);
+					poly.add ( ring );
+				}
+				polySet.add ( poly );
+				if ( polySet.size() == chunckSize )
+				{
+					layer->addPolygons( polySet ); 
+					polySet.clear();
+				}
+			}
+		}
+		if (repType == "LINHAS")
+		{
+			while ( 1 )
+			{
+				geoId = pFile.readStringCSVNoQuote (',');
+				pFile.findNewLine();
+				if (!pFile.isNotAtEOF() || geoId == "END")
+					break;
+				int i;
+				TeLine2D line;
+				size = pFile.readInt ();
+				pFile.findNewLine();
+				for (i=0;i<size;i++)
+				{
+	// Build the line
+					TeCoord2D xy = pFile.readCoord2D ();
+					line.add ( xy );
+				}
+				line.objectId ( geoId );
+				lineSet.add ( line );
+				if ( lineSet.size() == chunckSize )
+				{
+					layer->addLines( lineSet ); 
+					lineSet.clear();
+				}
+				pFile.findNewLine();
+			}
+		}
+		if (repType == "PONTOS")
+		{
+			while ( 1 )
+			{
+				geoId = pFile.readString ();
+				if (!pFile.isNotAtEOF() || geoId == "END" )
+					break;
+				TePoint point;
+	// Build the point
+				TeCoord2D xy = pFile.readCoord2D ();
+				point.add ( xy );
+				point.objectId ( geoId );
+				pointSet.add ( point );
+				if ( pointSet.size() == chunckSize )
+				{
+					layer->addPoints( pointSet ); 
+					pointSet.clear();
+				}
+				pFile.findNewLine();
+			}
+			if (repType.empty())
+				break;
+		}
+	}
+  }
+  catch(...)
+  {
+//	  int a = 0;
+  }
+	// save the remaining geometries
+	if (pointSet.size() > 0)
+	{
+		layer->addPoints( pointSet ); 
+		pointSet.clear();
+	}
+
+	if (lineSet.size() > 0 )
+	{
+		layer->addLines( lineSet ); 
+		lineSet.clear();
+	}
+
+	if (polySet.size() > 0)
+	{
+		layer->addPolygons( polySet ); 
+		polySet.clear();
+	}
+	return true;
+}
diff --git a/src/terralib/functions/TeImportMIF.cpp b/src/terralib/functions/TeImportMIF.cpp
old mode 100755
new mode 100644
index e342436..4c5952b
--- a/src/terralib/functions/TeImportMIF.cpp
+++ b/src/terralib/functions/TeImportMIF.cpp
@@ -1,914 +1,914 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <string>
-#include <iostream>
-#include <list>
-
-#ifdef WIN32
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-
-using namespace std;
-
-#include "TeTable.h"
-#include "TeGeometry.h"
-#include "TeAsciiFile.h"
-#include "TeMIFProjection.h"
-#include "TeException.h"
-#include "TeProjection.h"
-#include "TeAttribute.h"
-#include "TeTable.h"
-#include "TeAssertions.h"
-#include "TeUtils.h"
-#include "TeLayer.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeDatabase.h"
-
-#include "TeDriverMIDMIF.h"
-
-void TeMIFRegionDecode ( TeAsciiFile& mifFile, TePolygonSet& temp, string& index);
-
-void TeMIFLineDecode (TeAsciiFile& mifFile, TeLineSet& temp, string& index);
-
-void TeMIFPlineDecode (TeAsciiFile& mifFile, TeLineSet& temp, string& index);
-
-void TeMIFPointDecode (TeAsciiFile& mifFile, TePointSet& temp, string& index);
-
-void TeMIFMultiPointDecode (TeAsciiFile& mifFile, TePointSet& temp, string& index);
-
-void TeMIFTextDecode (TeAsciiFile& mifFile, TeTextSet& temp, string& index);
-
-void TeMIFCollectionDecode(TeAsciiFile& mifFile, TePointSet& ps, TeLineSet& ls, TePolygonSet& pols, string& index);
-
-void TeMIFRectDecode (TeAsciiFile& mifFile, TePolygonSet& temp, string& index);
-
-void TeMIFOthersDecode    ( TeAsciiFile& );
-
-void TeMIFTransformDecode ( TeAsciiFile& );
-
-bool TeReadMIFAttributes(TeAsciiFile& midFile, TeTable& attTable, 
-						 int ncolumns, int nrecords=-1, int delta = 0, bool createAuto=false);
-
-bool TeImportMIFGeometries(TeLayer* layer,const string& mifFileName, 
-						   vector<string> &indexes, unsigned int chunckSize);
-
-char TeReadMIFSeparator(const string& mifFileName);
-
-double glXmulti = 1., glYmulti = 1;
-
-TeCoord2D glAdd (0., 0. );
-
-
-TeLayer* TeImportMIF(const string& mifFileName, TeDatabase* db, const string& layerName)
-{
-	if (!db || mifFileName.empty()) 
-		return 0;
-
-	// check if format is complete (MID and MIF files exist)
-	string filePrefix = TeGetName(mifFileName.c_str());
-	string ftest = filePrefix + ".mid";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".MID";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-
-	ftest = filePrefix + ".mif";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".MIF";
-		if (access(ftest.c_str(),04) == -1)
-			return 0;
-	}
-
-	// found a valid layer name
-	string lName;
-	string baseName = TeGetBaseName(mifFileName.c_str());
-	if (layerName.empty())
-		lName = baseName;
-	else
-		lName = layerName;
-
-	string newLayerName = lName;
-	TeLayerMap& layerMap = db->layerMap();
-	TeLayerMap::iterator it;
-	bool flag = true;
-	int n = 1;
-	while (flag)
-	{
-		for (it = layerMap.begin(); it != layerMap.end(); ++it)
-		{
-			if (TeStringCompare(it->second->name(),newLayerName))
-				break;
-		}
-		if (it == layerMap.end())
-			flag = 0;
-		else
-			newLayerName = lName + "_" +Te2String(n);
-		n++;	
-	}
-
-	// find projection
-	TeProjection* mifProj = TeReadMIFProjection(ftest);
-	TeLayer* newLayer = new TeLayer(newLayerName,db,mifProj);
-	if (newLayer->id() <= 0 )
-		return 0;				// couldn�t create new layer
-
-	bool res = TeImportMIF(newLayer,ftest);
-	delete mifProj;
-	if (res)
-		return newLayer;
-	else
-	{
-		db->deleteLayer(newLayer->id());
-		delete newLayer;
-		return 0;
-	}
-}
-
-bool 
-TeImportMIF(TeLayer* layer, const string& mifFileName, string attrTableName, 
-			string objectIdAttr, unsigned int chunkSize)
-{
-	// check if format is complete (MID and MIF files exist)
-	string filePrefix = TeGetName(mifFileName.c_str());
-	string ftest = filePrefix + ".mid";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".MID";
-		if (access(ftest.c_str(),04) == -1)
-			return false;
-	}
-	string midfilename = ftest;
-
-	ftest = filePrefix + ".mif";
-	if (access(ftest.c_str(),04) == -1)
-	{
-		ftest = filePrefix + ".MIF";
-		if (access(ftest.c_str(),04) == -1)
-			return false;
-	}
-	string miffilename = ftest;
-	
-
-	//-- Step 1: Read any adicional information (ex. projection) 
-	if (!layer->projection())
-	{
-		TeProjection* mifProj = TeReadMIFProjection(miffilename);
-		if (mifProj)
-			layer->setProjection(mifProj);
-	}
-
-	char separator = TeReadMIFSeparator(miffilename);
-
-	//read the attribute list information 
-	TeAttributeList attList;
-	TeReadMIFAttributeList(miffilename, attList);
-
-	// define a TeAttributeTable
-	if (attrTableName.empty())
-	{
-		if (layer->name().empty())
-			return false;
-		else
-			attrTableName = layer->name();
-	}
-	string aux = attrTableName;
-	int c = 1;
-	while (layer->database()->tableExist(aux))
-	{
-		aux = attrTableName + "_" + Te2String(c);
-		++c;
-	}
-	attrTableName = aux;
-	
-	int linkCol=-1, j=0;
-	bool autoIndex = false;
-
-	// if no geometry link name is given, creates one called 'object_id'
-	if (objectIdAttr.empty())
-	{
-		objectIdAttr = "object_id_"+Te2String(layer->id());
-		TeAttribute at;
-		at.rep_.type_ = TeSTRING;
-		at.rep_.numChar_ = 16;
-		at.rep_.name_ = objectIdAttr;
-		at.rep_.isPrimaryKey_ = true;
-		attList.push_back(at);
-		autoIndex = true;
-	}
-	else
-	{
-		// check if given index is valid
-		TeAttributeList::iterator it = attList.begin();
-		while (it != attList.end())
-		{
-			if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(objectIdAttr))		// index found
-			{
-				if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
-				{
-					(*it).rep_.type_ = TeSTRING;
-					(*it).rep_.numChar_ = 16;
-				}
-				linkCol=j;
-				(*it).rep_.isPrimaryKey_ = true;
-				break;
-			}
-			it++;
-			j++;
-		}
-		if (it == attList.end())			// index not found
-		{
-			TeAttribute at;
-			at.rep_.type_ = TeSTRING;
-			at.rep_.numChar_ = 16;
-			at.rep_.name_ = objectIdAttr;
-			at.rep_.isPrimaryKey_ = true;
-			attList.push_back(at);
-			autoIndex = true;
-		}
-	}
-
-	if (autoIndex)
-		linkCol = attList.size()-1;
-
-	TeTable attTable (attrTableName,attList,objectIdAttr,objectIdAttr,TeAttrStatic);
-	attTable.setSeparator(separator);
-
-	// insert the table into the database
-	if (!layer->createAttributeTable(attTable))
-		return false;
-
-	vector<string> objectIds;
-	int ncol = attList.size();
-	if (autoIndex)
-		ncol--;
-
-	TeAsciiFile midFile(midfilename);
-	int delta = 0;
-	while (TeReadMIFAttributes(midFile,attTable,ncol,chunkSize,delta, autoIndex))
-	{
-		for (unsigned int n=0; n<attTable.size();++n)
-			objectIds.push_back(attTable.operator ()(n,linkCol));
-
-		// save table
-		if (!layer->saveAttributeTable( attTable ))
-		{
-			attTable.clear();
-			break;
-		}
-		delta += attTable.size();
-		attTable.clear();
-	}
-
-	// Import the geometries
-	bool res = TeImportMIFGeometries(layer,miffilename,objectIds,chunkSize);
-	
-	// Create the spatial indexes
-	int rep = layer->geomRep();
-	if (rep & TePOINTS)
-	{
-		layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE);
-	}
-	if (rep & TeLINES)
-	{
-		layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE);
-	}
-	if (rep & TePOLYGONS)
-	{
-		layer->database()->insertMetadata(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), 0.0005,0.0005,layer->box());
-		layer->database()->createSpatialIndex(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), (TeSpatialIndexType)TeRTREE);
-	}
-	return res;
-}
-
-bool TeReadMIFAttributes(TeAsciiFile& midFile, TeTable& attTable, 
-						 int ncolumns, int nrecords, int delta, bool createAuto )
-{
-	if (!midFile.isNotAtEOF() || nrecords <=0 || ncolumns <= 0)
-		return false;
-	char separator = attTable.separator();
-
-	int count;
-	for (count=0; count<nrecords; count++)
-	{
-		if (!midFile.isNotAtEOF())
-			 break;
-
-		TeTableRow row;
-		for (int n=0; n<ncolumns; n++)
-		{
-			string value;
-			try 
-			{
-				value = midFile.readStringCSVNoQuote(separator);
-			}
-			catch(...)
-			{
-				if (count > 0)
-					return true;
-				else
-					return false;
-			}
-			row.push_back ( value ); 
-		}
-
-		if (createAuto)
-			row.push_back(Te2String(count+delta));
-
-		attTable.add(row);
-		midFile.findNewLine();
-	}
-	return true;
-}
-
-char 
-TeReadMIFSeparator(const string& mifFileName)
-{
-	TeAsciiFile mifFile(mifFileName);
-	string name = mifFile.readString ();
-
-	while ( mifFile.isNotAtEOF() && !TeStringCompare(name,"Delimiter"))
-		name = mifFile.readString ();
-
-	if (mifFile.isNotAtEOF())
-		return mifFile.readQuotedChar();
-	else 
-		return '\t';
-}
-
-
-TeProjection* 
-TeReadMIFProjection(const string& mifFileName)
-{
-	TeProjection* proj = 0;
-
-	TeAsciiFile mifFile(mifFileName);
-	string name = mifFile.readString ();
-
-	while ( mifFile.isNotAtEOF() && !TeStringCompare(name,"CoordSys")
-		                         && !TeStringCompare(name,"Columns"))
-		name = mifFile.readString ();
-	
-	if (mifFile.isNotAtEOF() && TeStringCompare(name,"CoordSys"))  
-	{
-		string option = mifFile.readString();
-
-		vector<string> argList;
-
-		if (TeStringCompare(option,"Earth"))	// expect Projection clause
-		{
-			string projRef =  mifFile.readString ();
-			if (!TeStringCompare(projRef,"Projection"))
-			{
-				proj = new TeNoProjection();
-				return proj;
-			}
-			mifFile.readStringListCSV(argList,',');
-			proj = TeMIFProjectionFactory::make ( argList );	// create projection from parameters
-		}
-		else if (TeStringCompare(option,"Nonearth"))	// non earth
-		{
-			// look for units specification
-			while (mifFile.isNotAtEOF() && !TeStringCompare(name,"Units")
-		                                && !TeStringCompare(name,"Columns"))
-				name = mifFile.readString ();
-			if (TeStringCompare(name,"Units"))
-			{
-				name = mifFile.readString();
-				proj = new TeNoProjection(name);
-			}
-			else
-				proj = new TeNoProjection(name);
-		}
-	}
-	else	// no CoordSys clause specified 
-	{		// it should be assumed that the data is stored in Lat Long
-		TeDatum  datum = TeDatumFactory::make("Spherical");
-		proj = new TeLatLong(datum);
-	}
-	return proj;
-}
-
-void
-TeReadMIFAttributeList ( const string& mifFileName, TeAttributeList& attList )
-{
-	TeAsciiFile mifFile(mifFileName);
-	string name = mifFile.readString ();
-	
-	while ( mifFile.isNotAtEOF() && !TeStringCompare(name,"Columns"))
-		name = mifFile.readString ();
-
-	if (mifFile.isNotAtEOF()) 
-	{
-		int ncol = mifFile.readInt();
-		mifFile.findNewLine();
-		TeAttribute attribute;
-
-		for ( int i = 0; i< ncol; i++ )
-		{
-			attribute.rep_.name_  = mifFile.readString();
-			string attType = mifFile.readStringCSVNoSpace ('(');
-			if ( TeStringCompare(attType,"Integer") || TeStringCompare(attType,"Smallint") 
-				 || TeStringCompare(attType,"Logical") )
-			{
-				attribute.rep_.type_ = TeINT;
-			}
-			else if (TeStringCompare(attType,"Float"))
-			{
-				attribute.rep_.type_ = TeREAL;
-				attribute.rep_.numChar_ = 20;
-				attribute.rep_.decimals_ = 1;
-			}
-			else if (TeStringCompare(attType,"Date"))
-			{
-				attribute.rep_.type_ = TeDATETIME;
-				attribute.dateTimeFormat_="YYYYMMDD";
-			}
-			else if (TeStringCompare(attType,"Decimal"))
-			{
-				attribute.rep_.type_  = TeREAL;
-				attribute.rep_.numChar_ = mifFile.readIntCSV();
-				attribute.rep_.decimals_ = mifFile.readIntCSV(')');
-			}
-			else
-			{
-				attribute.rep_.type_  = TeSTRING;
-				attribute.rep_.numChar_  = mifFile.readIntCSV(')');
-			}
-			attList.push_back ( attribute );
-			mifFile.findNewLine();
-		}
-	}
-}
-
-bool
-TeImportMIFGeometries(TeLayer* layer,const string& mifFileName, 
-					  vector<string> &indexes, unsigned int chunckSize)
-{
-	TePointSet pointSet;
-	TeLineSet lineSet;
-	TePolygonSet polySet;
-	TeTextSet textSet;
-	string textTableName = layer->name() + "Texto";
-
-	double oldPrec = TePrecision::instance().precision();
-	try
-	{
-		if(layer)
-		{
-			TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
-		}
-		else
-		{
-			TePrecision::instance().setPrecision(TeGetPrecision(0));
-		}
-
-		TeAsciiFile mifFile(mifFileName);
-		int n = 0;
-		while ( mifFile.isNotAtEOF()  )
-		{
-			string name = mifFile.readString ();
-			if (TeStringCompare(name,"Region"))
-			{
-				TeMIFRegionDecode ( mifFile, polySet, indexes[n]);
-				n++;
-				if ( polySet.size() == chunckSize )
-				{
-					layer->addPolygons( polySet ); 
-					polySet.clear();
-				}
-			} 
-			else if (TeStringCompare(name,"Pline"))
-			{
-				TeMIFPlineDecode ( mifFile, lineSet, indexes[n] );
-				n++;
-				if ( lineSet.size() == chunckSize )
-				{
-					layer->addLines( lineSet ); 
-					lineSet.clear();
-				}
-			}
-			else if (TeStringCompare(name,"Line"))
-			{
-				TeMIFLineDecode ( mifFile, lineSet, indexes[n] );
-				n++;
-				if ( lineSet.size() == chunckSize )
-				{
-					layer->addLines( lineSet ); 
-					lineSet.clear();
-				}
-			}
-			else if (TeStringCompare(name,"Point"))
-			{
-				TeMIFPointDecode ( mifFile, pointSet, indexes[n] );
-				n++;
-				if ( pointSet.size() == chunckSize )
-				{
-					layer->addPoints( pointSet ); 
-					pointSet.clear();
-				}
-			}
-			else if (TeStringCompare(name,"Multipoint"))
-			{
-				TeMIFMultiPointDecode ( mifFile, pointSet, indexes[n] );
-				n++;
-				if ( pointSet.size() == chunckSize )
-				{
-					layer->addPoints( pointSet ); 
-					pointSet.clear();
-				}
-			}
-			else if (TeStringCompare(name,"Text"))
-			{
-				TeMIFTextDecode ( mifFile, textSet,indexes[n]);
-				n++;
-				if ( textSet.size() == chunckSize )
-				{
-					layer->addText( textSet,textTableName ); 
-					textSet.clear();
-				}
-			}
-			else if (TeStringCompare(name,"Rect"))
-			{
-				TeMIFRectDecode(mifFile,polySet,indexes[n]);
-				n++;
-				if (polySet.size() == chunckSize )
-				{
-					layer->addPolygons(polySet); 
-					polySet.clear();
-				}
-			}
-			else if (TeStringCompare(name,"Collection"))
-			{
-				TeMIFCollectionDecode(mifFile,pointSet,lineSet, polySet,indexes[n]);
-				n++;
-				if (lineSet.size() == chunckSize )
-				{
-					layer->addLines(lineSet); 
-					lineSet.clear();
-				}
-				if (polySet.size() == chunckSize )
-				{
-					layer->addPolygons(polySet); 
-					polySet.clear();
-				}
-				if (pointSet.size() == chunckSize )
-				{
-					layer->addPoints(pointSet); 
-					pointSet.clear();
-				}
-			}
-			else if (TeStringCompare(name,"Transform"))
-				TeMIFTransformDecode ( mifFile );			
-			else if (TeStringCompare(name,"NONE"))
-				n++;
-			else
-				TeMIFOthersDecode ( mifFile );
-		}
-		
-		// save the remaining geometries
-		if (pointSet.size() > 0 )
-		{
-			layer->addPoints( pointSet ); 
-			pointSet.clear();
-		}
-
-		if (lineSet.size() > 0 )
-		{
-			layer->addLines( lineSet ); 
-			lineSet.clear();
-		}
-
-		if (polySet.size() > 0 )
-		{
-			layer->addPolygons( polySet ); 
-			polySet.clear();
-		}
-		
-		if (textSet.size() > 0)
-		{
-			layer->addText( textSet,textTableName ); 
-			textSet.clear();
-		}
-	}
-	catch(...)
-	{
-		TePrecision::instance().setPrecision(oldPrec);
-		return false;
-	}
-
-	TePrecision::instance().setPrecision(oldPrec);
-	return true;
-}
-
-void 
-TeMIFRectDecode (TeAsciiFile& mifFile, TePolygonSet& temp, string& index)
-{
-	if (index.empty())
-		index = "te_nulo";
-	TeCoord2D ll = mifFile.readCoord2D();
-	TeCoord2D ur = mifFile.readCoord2D();
-
-	TeBox rec(ll.x_,ll.y_,ur.x_,ur.y_);
-	TePolygon pol = polygonFromBox(rec);
-	pol.objectId(index);
-	temp.add(pol);
-}
-
-void
-TeMIFRegionDecode ( TeAsciiFile& mifFile, TePolygonSet& temp, string& index)
-{
-	if (index.empty())
-		index = "te_nulo";
-
-	int npolyg = mifFile.readInt();
-	mifFile.findNewLine();
-
-	TeCoord2D pt;
-	TePolygon pol; 
-	typedef list<TePolygon> PolyList;
-	PolyList pList;
-	for ( int i = 0; i < npolyg; i++ )
-	{
-		TeLine2D line;
-
-		int ncoord = mifFile.readInt();
-		mifFile.findNewLine();
-
-		for ( int j = 0; j < ncoord; j++ )
-		{
-			pt = mifFile.readCoord2D();
-			pt.scale( glXmulti, glYmulti);
-			pt += glAdd;
-			mifFile.findNewLine();
-			line.add ( pt );
-
-		}
-		if ( line.size() <= 3 ) continue; // to avoid dangling rings
-		if ( !line.isRing() )		//close the ring
-		{
-			line.add(line[0]);
-//			throw TeException ( MIF_REGION_CLOSE );
-		}
-
-		TeLinearRing ring (line);
-		
-		bool inside = false;
-
-		PolyList::iterator it = pList.begin();
-
-		while ( it != pList.end() )
-		{
-			TePolygon p1;
-			p1.add(ring);
-			TePolygon p2 = (*it);
-			short rel = TeRelation(p1, p2);
-
-			if((rel & TeWITHIN) || (rel & TeCOVEREDBY))
-			{
-				inside = true;
-				ring.objectId(p2[0].objectId());
-				p2.add ( ring );// add a closed region
-			}
-			++it;
-		}
-		if ( !inside )
-		{
-			TePolygon poly;
-			ring.objectId(index);
-			poly.add ( ring ); // add an outer region
-			poly.objectId(index);
-			pList.push_back ( poly );
-		}
-	}
-
-	PolyList::iterator it = pList.begin();
-	while ( it != pList.end() )
-	{
-		temp.add ( *it ); // add a polygon to a layer
-		++it;
-	}
-}	
-
-void
-TeMIFLineDecode (TeAsciiFile& mifFile, TeLineSet& temp, string& index)
-{
-	if (index.empty())
-		index = "te_nulo";
-
-	TeLine2D line;
-	TeCoord2D pt;
-
-	for ( int i= 0; i < 2; i++ )
-	{
-		pt = mifFile.readCoord2D();
-		pt.scale( glXmulti, glYmulti);
-		pt += glAdd;
-		line.add ( pt );
-	}
-
-	line.objectId( index );
-	temp.add ( line );
-	mifFile.findNewLine();
-}
-
-void
-TeMIFPlineDecode (TeAsciiFile& mifFile, TeLineSet& temp, string& index)
-{
-	if (index.empty())
-		index = "te_nulo";
-
-	int numSections = 1; 
-	int ncoord = 0;
-
-	// Read the Pline parameters
-	vector<string>  strList;
-	mifFile.readStringList ( strList );
-	
-	// Are we dealing with MULTIPLE sections ??
-	// If there are two parameters for the pline,
-	// the first MUST be a "Multiple" keyword
-	
-	bool hasMultiple = false;
-
-	if ( strList.size() == 2 )
-	{
-		hasMultiple = true;
-		ensure (TeStringCompare(strList[0],"Multiple"));
-		numSections = atoi ( strList[1].c_str() );
-	}
-	else
-		ncoord = atoi ( strList[0].c_str());
-
-	mifFile.findNewLine(); // go to the next line
-	// If there is a single PLine, there is a single
-	// section ( numSections = 1 ) and will read
-	// the number of points within the loop
-
-
-	for ( int i= 0;  i < numSections; i++ )
-	{
-		TeLine2D line;	
-		TeCoord2D pt;
-		if ( hasMultiple == true )
-		{
-			ncoord = mifFile.readInt();
-			mifFile.findNewLine(); // go to the next line
-		}
-
-		for ( int j = 0; j < ncoord; j++ )
-		{
-			pt = mifFile.readCoord2D();
-			pt.scale( glXmulti, glYmulti);
-			pt += glAdd;
-			mifFile.findNewLine();
-			line.add ( pt );
-		}
-		line.objectId( index );
-		temp.add ( line );
-	}
-}
-
-void
-TeMIFPointDecode (TeAsciiFile& mifFile, TePointSet& temp, string& index)
-{
-	if (index.empty())
-		index = "te_nulo";
-
-	TePoint point;
-	
-	// Read the coordinates
-
-	TeCoord2D pt = mifFile.readCoord2D();
-	pt.scale( glXmulti, glYmulti);
-	pt += glAdd;
-	point.add ( pt );
-	point.objectId( index );
-
-	// Add a point to the Point Set
-			
-	temp.add ( point );
-
-	mifFile.findNewLine();
-}
-
-void
-TeMIFMultiPointDecode (TeAsciiFile& mifFile, TePointSet& temp, string& index)
-{
-	if (index.empty())
-		index = "te_nulo";
-
-	int	npts = mifFile.readInt();
-	mifFile.findNewLine();
-	for (int i=0; i<npts;i++)
-	{
-		// Read points
-		TePoint point;
-		TeCoord2D pt = mifFile.readCoord2D();
-		pt.scale( glXmulti, glYmulti);
-		pt += glAdd;
-		point.add ( pt );
-		point.objectId( index );
-
-		// Add a point to the Point Set		
-		temp.add ( point );
-	}
-	mifFile.findNewLine();
-}
-
-void
-TeMIFTransformDecode ( TeAsciiFile& mifFile )
-{
-	// read the tansformation params
-
-	double param = mifFile.readFloatCSV();
-
-	if ( param != 0. )
-		glXmulti = param;
-
-	param = mifFile.readFloatCSV();
-
-	if ( param != 0. )
-		glYmulti = param;
-
-	double x = mifFile.readFloatCSV();
-
-	double y  = mifFile.readFloatCSV();
-
-	TeCoord2D pt ( x, y );
-
-	glAdd =  pt;
-	
-	// Go to the next line
-	mifFile.findNewLine ();
-	
-}
-
-void
-TeMIFTextDecode (TeAsciiFile& mifFile, TeTextSet& temp, string& index)
-{
-	string txt = mifFile.readQuotedString(); // read the text string
-	mifFile.findNewLine ();
-	TeBox box = mifFile.readBox();			// read the text box 
-
-	TeCoord2D lowerLeft = box.lowerLeft();
-	TeText text(lowerLeft,txt);
-	text.setBox(box);
-	text.objectId(index);
-	text.setHeight(box.height());
-	temp.add(text);
-	mifFile.findNewLine ();					// go to the next line
-}
-
-void
-TeMIFOthersDecode ( TeAsciiFile& mifFile )
-{
-	// Simply go to the next line
-	mifFile.findNewLine ();
-}
-
-void 
-TeMIFCollectionDecode(TeAsciiFile& mifFile, TePointSet& ps, TeLineSet& ls, TePolygonSet& pols, string& index)
-{
-	int	nparts = mifFile.readInt();
-	if (nparts == 0)
-		nparts = 3;
-	mifFile.findNewLine();
-	for (int i=0; i<nparts; i++)
-	{
-		string part = mifFile.readString ();
-		if (TeStringCompare(part,"Region"))
-			TeMIFRegionDecode (mifFile, pols, index);
-		else if(TeStringCompare(part,"Pline"))
-			TeMIFPlineDecode (mifFile, ls, index);
-		else if (TeStringCompare(part,"Multipoint"))
-			TeMIFMultiPointDecode (mifFile,ps, index);
-	}
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <string>
+#include <iostream>
+#include <list>
+
+#ifdef WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+using namespace std;
+
+#include "TeTable.h"
+#include "TeGeometry.h"
+#include "TeAsciiFile.h"
+#include "TeMIFProjection.h"
+#include "TeException.h"
+#include "TeProjection.h"
+#include "TeAttribute.h"
+#include "TeTable.h"
+#include "TeAssertions.h"
+#include "TeUtils.h"
+#include "TeLayer.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeDatabase.h"
+
+#include "TeDriverMIDMIF.h"
+
+void TeMIFRegionDecode ( TeAsciiFile& mifFile, TePolygonSet& temp, string& index);
+
+void TeMIFLineDecode (TeAsciiFile& mifFile, TeLineSet& temp, string& index);
+
+void TeMIFPlineDecode (TeAsciiFile& mifFile, TeLineSet& temp, string& index);
+
+void TeMIFPointDecode (TeAsciiFile& mifFile, TePointSet& temp, string& index);
+
+void TeMIFMultiPointDecode (TeAsciiFile& mifFile, TePointSet& temp, string& index);
+
+void TeMIFTextDecode (TeAsciiFile& mifFile, TeTextSet& temp, string& index);
+
+void TeMIFCollectionDecode(TeAsciiFile& mifFile, TePointSet& ps, TeLineSet& ls, TePolygonSet& pols, string& index);
+
+void TeMIFRectDecode (TeAsciiFile& mifFile, TePolygonSet& temp, string& index);
+
+void TeMIFOthersDecode    ( TeAsciiFile& );
+
+void TeMIFTransformDecode ( TeAsciiFile& );
+
+bool TeReadMIFAttributes(TeAsciiFile& midFile, TeTable& attTable, 
+						 int ncolumns, int nrecords=-1, int delta = 0, bool createAuto=false);
+
+bool TeImportMIFGeometries(TeLayer* layer,const string& mifFileName, 
+						   vector<string> &indexes, unsigned int chunckSize);
+
+char TeReadMIFSeparator(const string& mifFileName);
+
+double glXmulti = 1., glYmulti = 1;
+
+TeCoord2D glAdd (0., 0. );
+
+
+TeLayer* TeImportMIF(const string& mifFileName, TeDatabase* db, const string& layerName)
+{
+	if (!db || mifFileName.empty()) 
+		return 0;
+
+	// check if format is complete (MID and MIF files exist)
+	string filePrefix = TeGetName(mifFileName.c_str());
+	string ftest = filePrefix + ".mid";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".MID";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+
+	ftest = filePrefix + ".mif";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".MIF";
+		if (access(ftest.c_str(),04) == -1)
+			return 0;
+	}
+
+	// found a valid layer name
+	string lName;
+	string baseName = TeGetBaseName(mifFileName.c_str());
+	if (layerName.empty())
+		lName = baseName;
+	else
+		lName = layerName;
+
+	string newLayerName = lName;
+	TeLayerMap& layerMap = db->layerMap();
+	TeLayerMap::iterator it;
+	bool flag = true;
+	int n = 1;
+	while (flag)
+	{
+		for (it = layerMap.begin(); it != layerMap.end(); ++it)
+		{
+			if (TeStringCompare(it->second->name(),newLayerName))
+				break;
+		}
+		if (it == layerMap.end())
+			flag = 0;
+		else
+			newLayerName = lName + "_" +Te2String(n);
+		n++;	
+	}
+
+	// find projection
+	TeProjection* mifProj = TeReadMIFProjection(ftest);
+	TeLayer* newLayer = new TeLayer(newLayerName,db,mifProj);
+	if (newLayer->id() <= 0 )
+		return 0;				// couldn�t create new layer
+
+	bool res = TeImportMIF(newLayer,ftest);
+	delete mifProj;
+	if (res)
+		return newLayer;
+	else
+	{
+		db->deleteLayer(newLayer->id());
+		delete newLayer;
+		return 0;
+	}
+}
+
+bool 
+TeImportMIF(TeLayer* layer, const string& mifFileName, string attrTableName, 
+			string objectIdAttr, unsigned int chunkSize)
+{
+	// check if format is complete (MID and MIF files exist)
+	string filePrefix = TeGetName(mifFileName.c_str());
+	string ftest = filePrefix + ".mid";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".MID";
+		if (access(ftest.c_str(),04) == -1)
+			return false;
+	}
+	string midfilename = ftest;
+
+	ftest = filePrefix + ".mif";
+	if (access(ftest.c_str(),04) == -1)
+	{
+		ftest = filePrefix + ".MIF";
+		if (access(ftest.c_str(),04) == -1)
+			return false;
+	}
+	string miffilename = ftest;
+	
+
+	//-- Step 1: Read any adicional information (ex. projection) 
+	if (!layer->projection())
+	{
+		TeProjection* mifProj = TeReadMIFProjection(miffilename);
+		if (mifProj)
+			layer->setProjection(mifProj);
+	}
+
+	char separator = TeReadMIFSeparator(miffilename);
+
+	//read the attribute list information 
+	TeAttributeList attList;
+	TeReadMIFAttributeList(miffilename, attList);
+
+	// define a TeAttributeTable
+	if (attrTableName.empty())
+	{
+		if (layer->name().empty())
+			return false;
+		else
+			attrTableName = layer->name();
+	}
+	string aux = attrTableName;
+	int c = 1;
+	while (layer->database()->tableExist(aux))
+	{
+		aux = attrTableName + "_" + Te2String(c);
+		++c;
+	}
+	attrTableName = aux;
+	
+	int linkCol=-1, j=0;
+	bool autoIndex = false;
+
+	// if no geometry link name is given, creates one called 'object_id'
+	if (objectIdAttr.empty())
+	{
+		objectIdAttr = "object_id_"+Te2String(layer->id());
+		TeAttribute at;
+		at.rep_.type_ = TeSTRING;
+		at.rep_.numChar_ = 16;
+		at.rep_.name_ = objectIdAttr;
+		at.rep_.isPrimaryKey_ = true;
+		attList.push_back(at);
+		autoIndex = true;
+	}
+	else
+	{
+		// check if given index is valid
+		TeAttributeList::iterator it = attList.begin();
+		while (it != attList.end())
+		{
+			if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(objectIdAttr))		// index found
+			{
+				if ((*it).rep_.type_ != TeSTRING)	// make sure it is a String type
+				{
+					(*it).rep_.type_ = TeSTRING;
+					(*it).rep_.numChar_ = 16;
+				}
+				linkCol=j;
+				(*it).rep_.isPrimaryKey_ = true;
+				break;
+			}
+			it++;
+			j++;
+		}
+		if (it == attList.end())			// index not found
+		{
+			TeAttribute at;
+			at.rep_.type_ = TeSTRING;
+			at.rep_.numChar_ = 16;
+			at.rep_.name_ = objectIdAttr;
+			at.rep_.isPrimaryKey_ = true;
+			attList.push_back(at);
+			autoIndex = true;
+		}
+	}
+
+	if (autoIndex)
+		linkCol = attList.size()-1;
+
+	TeTable attTable (attrTableName,attList,objectIdAttr,objectIdAttr,TeAttrStatic);
+	attTable.setSeparator(separator);
+
+	// insert the table into the database
+	if (!layer->createAttributeTable(attTable))
+		return false;
+
+	vector<string> objectIds;
+	int ncol = attList.size();
+	if (autoIndex)
+		ncol--;
+
+	TeAsciiFile midFile(midfilename);
+	int delta = 0;
+	while (TeReadMIFAttributes(midFile,attTable,ncol,chunkSize,delta, autoIndex))
+	{
+		for (unsigned int n=0; n<attTable.size();++n)
+			objectIds.push_back(attTable.operator ()(n,linkCol));
+
+		// save table
+		if (!layer->saveAttributeTable( attTable ))
+		{
+			attTable.clear();
+			break;
+		}
+		delta += attTable.size();
+		attTable.clear();
+	}
+
+	// Import the geometries
+	bool res = TeImportMIFGeometries(layer,miffilename,objectIds,chunkSize);
+	
+	// Create the spatial indexes
+	int rep = layer->geomRep();
+	if (rep & TePOINTS)
+	{
+		layer->database()->insertMetadata(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TePOINTS),layer->database()->getSpatialIdxColumn(TePOINTS), (TeSpatialIndexType)TeRTREE);
+	}
+	if (rep & TeLINES)
+	{
+		layer->database()->insertMetadata(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TeLINES),layer->database()->getSpatialIdxColumn(TeLINES), (TeSpatialIndexType)TeRTREE);
+	}
+	if (rep & TePOLYGONS)
+	{
+		layer->database()->insertMetadata(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), 0.0005,0.0005,layer->box());
+		layer->database()->createSpatialIndex(layer->tableName(TePOLYGONS),layer->database()->getSpatialIdxColumn(TePOLYGONS), (TeSpatialIndexType)TeRTREE);
+	}
+	return res;
+}
+
+bool TeReadMIFAttributes(TeAsciiFile& midFile, TeTable& attTable, 
+						 int ncolumns, int nrecords, int delta, bool createAuto )
+{
+	if (!midFile.isNotAtEOF() || nrecords <=0 || ncolumns <= 0)
+		return false;
+	char separator = attTable.separator();
+
+	int count;
+	for (count=0; count<nrecords; count++)
+	{
+		if (!midFile.isNotAtEOF())
+			 break;
+
+		TeTableRow row;
+		for (int n=0; n<ncolumns; n++)
+		{
+			string value;
+			try 
+			{
+				value = midFile.readStringCSVNoQuote(separator);
+			}
+			catch(...)
+			{
+				if (count > 0)
+					return true;
+				else
+					return false;
+			}
+			row.push_back ( value ); 
+		}
+
+		if (createAuto)
+			row.push_back(Te2String(count+delta));
+
+		attTable.add(row);
+		midFile.findNewLine();
+	}
+	return true;
+}
+
+char 
+TeReadMIFSeparator(const string& mifFileName)
+{
+	TeAsciiFile mifFile(mifFileName);
+	string name = mifFile.readString ();
+
+	while ( mifFile.isNotAtEOF() && !TeStringCompare(name,"Delimiter"))
+		name = mifFile.readString ();
+
+	if (mifFile.isNotAtEOF())
+		return mifFile.readQuotedChar();
+	else 
+		return '\t';
+}
+
+
+TeProjection* 
+TeReadMIFProjection(const string& mifFileName)
+{
+	TeProjection* proj = 0;
+
+	TeAsciiFile mifFile(mifFileName);
+	string name = mifFile.readString ();
+
+	while ( mifFile.isNotAtEOF() && !TeStringCompare(name,"CoordSys")
+		                         && !TeStringCompare(name,"Columns"))
+		name = mifFile.readString ();
+	
+	if (mifFile.isNotAtEOF() && TeStringCompare(name,"CoordSys"))  
+	{
+		string option = mifFile.readString();
+
+		vector<string> argList;
+
+		if (TeStringCompare(option,"Earth"))	// expect Projection clause
+		{
+			string projRef =  mifFile.readString ();
+			if (!TeStringCompare(projRef,"Projection"))
+			{
+				proj = new TeNoProjection();
+				return proj;
+			}
+			mifFile.readStringListCSV(argList,',');
+			proj = TeMIFProjectionFactory::make ( argList );	// create projection from parameters
+		}
+		else if (TeStringCompare(option,"Nonearth"))	// non earth
+		{
+			// look for units specification
+			while (mifFile.isNotAtEOF() && !TeStringCompare(name,"Units")
+		                                && !TeStringCompare(name,"Columns"))
+				name = mifFile.readString ();
+			if (TeStringCompare(name,"Units"))
+			{
+				name = mifFile.readString();
+				proj = new TeNoProjection(name);
+			}
+			else
+				proj = new TeNoProjection(name);
+		}
+	}
+	else	// no CoordSys clause specified 
+	{		// it should be assumed that the data is stored in Lat Long
+		TeDatum  datum = TeDatumFactory::make("Spherical");
+		proj = new TeLatLong(datum);
+	}
+	return proj;
+}
+
+void
+TeReadMIFAttributeList ( const string& mifFileName, TeAttributeList& attList )
+{
+	TeAsciiFile mifFile(mifFileName);
+	string name = mifFile.readString ();
+	
+	while ( mifFile.isNotAtEOF() && !TeStringCompare(name,"Columns"))
+		name = mifFile.readString ();
+
+	if (mifFile.isNotAtEOF()) 
+	{
+		int ncol = mifFile.readInt();
+		mifFile.findNewLine();
+		TeAttribute attribute;
+
+		for ( int i = 0; i< ncol; i++ )
+		{
+			attribute.rep_.name_  = mifFile.readString();
+			string attType = mifFile.readStringCSVNoSpace ('(');
+			if ( TeStringCompare(attType,"Integer") || TeStringCompare(attType,"Smallint") 
+				 || TeStringCompare(attType,"Logical") )
+			{
+				attribute.rep_.type_ = TeINT;
+			}
+			else if (TeStringCompare(attType,"Float"))
+			{
+				attribute.rep_.type_ = TeREAL;
+				attribute.rep_.numChar_ = 20;
+				attribute.rep_.decimals_ = 1;
+			}
+			else if (TeStringCompare(attType,"Date"))
+			{
+				attribute.rep_.type_ = TeDATETIME;
+				attribute.dateTimeFormat_="YYYYMMDD";
+			}
+			else if (TeStringCompare(attType,"Decimal"))
+			{
+				attribute.rep_.type_  = TeREAL;
+				attribute.rep_.numChar_ = mifFile.readIntCSV();
+				attribute.rep_.decimals_ = mifFile.readIntCSV(')');
+			}
+			else
+			{
+				attribute.rep_.type_  = TeSTRING;
+				attribute.rep_.numChar_  = mifFile.readIntCSV(')');
+			}
+			attList.push_back ( attribute );
+			mifFile.findNewLine();
+		}
+	}
+}
+
+bool
+TeImportMIFGeometries(TeLayer* layer,const string& mifFileName, 
+					  vector<string> &indexes, unsigned int chunckSize)
+{
+	TePointSet pointSet;
+	TeLineSet lineSet;
+	TePolygonSet polySet;
+	TeTextSet textSet;
+	string textTableName = layer->name() + "Texto";
+
+	double oldPrec = TePrecision::instance().precision();
+	try
+	{
+		if(layer)
+		{
+			TePrecision::instance().setPrecision(TeGetPrecision(layer->projection()));
+		}
+		else
+		{
+			TePrecision::instance().setPrecision(TeGetPrecision(0));
+		}
+
+		TeAsciiFile mifFile(mifFileName);
+		int n = 0;
+		while ( mifFile.isNotAtEOF()  )
+		{
+			string name = mifFile.readString ();
+			if (TeStringCompare(name,"Region"))
+			{
+				TeMIFRegionDecode ( mifFile, polySet, indexes[n]);
+				n++;
+				if ( polySet.size() == chunckSize )
+				{
+					layer->addPolygons( polySet ); 
+					polySet.clear();
+				}
+			} 
+			else if (TeStringCompare(name,"Pline"))
+			{
+				TeMIFPlineDecode ( mifFile, lineSet, indexes[n] );
+				n++;
+				if ( lineSet.size() == chunckSize )
+				{
+					layer->addLines( lineSet ); 
+					lineSet.clear();
+				}
+			}
+			else if (TeStringCompare(name,"Line"))
+			{
+				TeMIFLineDecode ( mifFile, lineSet, indexes[n] );
+				n++;
+				if ( lineSet.size() == chunckSize )
+				{
+					layer->addLines( lineSet ); 
+					lineSet.clear();
+				}
+			}
+			else if (TeStringCompare(name,"Point"))
+			{
+				TeMIFPointDecode ( mifFile, pointSet, indexes[n] );
+				n++;
+				if ( pointSet.size() == chunckSize )
+				{
+					layer->addPoints( pointSet ); 
+					pointSet.clear();
+				}
+			}
+			else if (TeStringCompare(name,"Multipoint"))
+			{
+				TeMIFMultiPointDecode ( mifFile, pointSet, indexes[n] );
+				n++;
+				if ( pointSet.size() == chunckSize )
+				{
+					layer->addPoints( pointSet ); 
+					pointSet.clear();
+				}
+			}
+			else if (TeStringCompare(name,"Text"))
+			{
+				TeMIFTextDecode ( mifFile, textSet,indexes[n]);
+				n++;
+				if ( textSet.size() == chunckSize )
+				{
+					layer->addText( textSet,textTableName ); 
+					textSet.clear();
+				}
+			}
+			else if (TeStringCompare(name,"Rect"))
+			{
+				TeMIFRectDecode(mifFile,polySet,indexes[n]);
+				n++;
+				if (polySet.size() == chunckSize )
+				{
+					layer->addPolygons(polySet); 
+					polySet.clear();
+				}
+			}
+			else if (TeStringCompare(name,"Collection"))
+			{
+				TeMIFCollectionDecode(mifFile,pointSet,lineSet, polySet,indexes[n]);
+				n++;
+				if (lineSet.size() == chunckSize )
+				{
+					layer->addLines(lineSet); 
+					lineSet.clear();
+				}
+				if (polySet.size() == chunckSize )
+				{
+					layer->addPolygons(polySet); 
+					polySet.clear();
+				}
+				if (pointSet.size() == chunckSize )
+				{
+					layer->addPoints(pointSet); 
+					pointSet.clear();
+				}
+			}
+			else if (TeStringCompare(name,"Transform"))
+				TeMIFTransformDecode ( mifFile );			
+			else if (TeStringCompare(name,"NONE"))
+				n++;
+			else
+				TeMIFOthersDecode ( mifFile );
+		}
+		
+		// save the remaining geometries
+		if (pointSet.size() > 0 )
+		{
+			layer->addPoints( pointSet ); 
+			pointSet.clear();
+		}
+
+		if (lineSet.size() > 0 )
+		{
+			layer->addLines( lineSet ); 
+			lineSet.clear();
+		}
+
+		if (polySet.size() > 0 )
+		{
+			layer->addPolygons( polySet ); 
+			polySet.clear();
+		}
+		
+		if (textSet.size() > 0)
+		{
+			layer->addText( textSet,textTableName ); 
+			textSet.clear();
+		}
+	}
+	catch(...)
+	{
+		TePrecision::instance().setPrecision(oldPrec);
+		return false;
+	}
+
+	TePrecision::instance().setPrecision(oldPrec);
+	return true;
+}
+
+void 
+TeMIFRectDecode (TeAsciiFile& mifFile, TePolygonSet& temp, string& index)
+{
+	if (index.empty())
+		index = "te_nulo";
+	TeCoord2D ll = mifFile.readCoord2D();
+	TeCoord2D ur = mifFile.readCoord2D();
+
+	TeBox rec(ll.x_,ll.y_,ur.x_,ur.y_);
+	TePolygon pol = polygonFromBox(rec);
+	pol.objectId(index);
+	temp.add(pol);
+}
+
+void
+TeMIFRegionDecode ( TeAsciiFile& mifFile, TePolygonSet& temp, string& index)
+{
+	if (index.empty())
+		index = "te_nulo";
+
+	int npolyg = mifFile.readInt();
+	mifFile.findNewLine();
+
+	TeCoord2D pt;
+	TePolygon pol; 
+	typedef list<TePolygon> PolyList;
+	PolyList pList;
+	for ( int i = 0; i < npolyg; i++ )
+	{
+		TeLine2D line;
+
+		int ncoord = mifFile.readInt();
+		mifFile.findNewLine();
+
+		for ( int j = 0; j < ncoord; j++ )
+		{
+			pt = mifFile.readCoord2D();
+			pt.scale( glXmulti, glYmulti);
+			pt += glAdd;
+			mifFile.findNewLine();
+			line.add ( pt );
+
+		}
+		if ( line.size() <= 3 ) continue; // to avoid dangling rings
+		if ( !line.isRing() )		//close the ring
+		{
+			line.add(line[0]);
+//			throw TeException ( MIF_REGION_CLOSE );
+		}
+
+		TeLinearRing ring (line);
+		
+		bool inside = false;
+
+		PolyList::iterator it = pList.begin();
+
+		while ( it != pList.end() )
+		{
+			TePolygon p1;
+			p1.add(ring);
+			TePolygon p2 = (*it);
+			short rel = TeRelation(p1, p2);
+
+			if((rel & TeWITHIN) || (rel & TeCOVEREDBY))
+			{
+				inside = true;
+				ring.objectId(p2[0].objectId());
+				p2.add ( ring );// add a closed region
+			}
+			++it;
+		}
+		if ( !inside )
+		{
+			TePolygon poly;
+			ring.objectId(index);
+			poly.add ( ring ); // add an outer region
+			poly.objectId(index);
+			pList.push_back ( poly );
+		}
+	}
+
+	PolyList::iterator it = pList.begin();
+	while ( it != pList.end() )
+	{
+		temp.add ( *it ); // add a polygon to a layer
+		++it;
+	}
+}	
+
+void
+TeMIFLineDecode (TeAsciiFile& mifFile, TeLineSet& temp, string& index)
+{
+	if (index.empty())
+		index = "te_nulo";
+
+	TeLine2D line;
+	TeCoord2D pt;
+
+	for ( int i= 0; i < 2; i++ )
+	{
+		pt = mifFile.readCoord2D();
+		pt.scale( glXmulti, glYmulti);
+		pt += glAdd;
+		line.add ( pt );
+	}
+
+	line.objectId( index );
+	temp.add ( line );
+	mifFile.findNewLine();
+}
+
+void
+TeMIFPlineDecode (TeAsciiFile& mifFile, TeLineSet& temp, string& index)
+{
+	if (index.empty())
+		index = "te_nulo";
+
+	int numSections = 1; 
+	int ncoord = 0;
+
+	// Read the Pline parameters
+	vector<string>  strList;
+	mifFile.readStringList ( strList );
+	
+	// Are we dealing with MULTIPLE sections ??
+	// If there are two parameters for the pline,
+	// the first MUST be a "Multiple" keyword
+	
+	bool hasMultiple = false;
+
+	if ( strList.size() == 2 )
+	{
+		hasMultiple = true;
+		ensure (TeStringCompare(strList[0],"Multiple"));
+		numSections = atoi ( strList[1].c_str() );
+	}
+	else
+		ncoord = atoi ( strList[0].c_str());
+
+	mifFile.findNewLine(); // go to the next line
+	// If there is a single PLine, there is a single
+	// section ( numSections = 1 ) and will read
+	// the number of points within the loop
+
+
+	for ( int i= 0;  i < numSections; i++ )
+	{
+		TeLine2D line;	
+		TeCoord2D pt;
+		if ( hasMultiple == true )
+		{
+			ncoord = mifFile.readInt();
+			mifFile.findNewLine(); // go to the next line
+		}
+
+		for ( int j = 0; j < ncoord; j++ )
+		{
+			pt = mifFile.readCoord2D();
+			pt.scale( glXmulti, glYmulti);
+			pt += glAdd;
+			mifFile.findNewLine();
+			line.add ( pt );
+		}
+		line.objectId( index );
+		temp.add ( line );
+	}
+}
+
+void
+TeMIFPointDecode (TeAsciiFile& mifFile, TePointSet& temp, string& index)
+{
+	if (index.empty())
+		index = "te_nulo";
+
+	TePoint point;
+	
+	// Read the coordinates
+
+	TeCoord2D pt = mifFile.readCoord2D();
+	pt.scale( glXmulti, glYmulti);
+	pt += glAdd;
+	point.add ( pt );
+	point.objectId( index );
+
+	// Add a point to the Point Set
+			
+	temp.add ( point );
+
+	mifFile.findNewLine();
+}
+
+void
+TeMIFMultiPointDecode (TeAsciiFile& mifFile, TePointSet& temp, string& index)
+{
+	if (index.empty())
+		index = "te_nulo";
+
+	int	npts = mifFile.readInt();
+	mifFile.findNewLine();
+	for (int i=0; i<npts;i++)
+	{
+		// Read points
+		TePoint point;
+		TeCoord2D pt = mifFile.readCoord2D();
+		pt.scale( glXmulti, glYmulti);
+		pt += glAdd;
+		point.add ( pt );
+		point.objectId( index );
+
+		// Add a point to the Point Set		
+		temp.add ( point );
+	}
+	mifFile.findNewLine();
+}
+
+void
+TeMIFTransformDecode ( TeAsciiFile& mifFile )
+{
+	// read the tansformation params
+
+	double param = mifFile.readFloatCSV();
+
+	if ( param != 0. )
+		glXmulti = param;
+
+	param = mifFile.readFloatCSV();
+
+	if ( param != 0. )
+		glYmulti = param;
+
+	double x = mifFile.readFloatCSV();
+
+	double y  = mifFile.readFloatCSV();
+
+	TeCoord2D pt ( x, y );
+
+	glAdd =  pt;
+	
+	// Go to the next line
+	mifFile.findNewLine ();
+	
+}
+
+void
+TeMIFTextDecode (TeAsciiFile& mifFile, TeTextSet& temp, string& index)
+{
+	string txt = mifFile.readQuotedString(); // read the text string
+	mifFile.findNewLine ();
+	TeBox box = mifFile.readBox();			// read the text box 
+
+	TeCoord2D lowerLeft = box.lowerLeft();
+	TeText text(lowerLeft,txt);
+	text.setBox(box);
+	text.objectId(index);
+	text.setHeight(box.height());
+	temp.add(text);
+	mifFile.findNewLine ();					// go to the next line
+}
+
+void
+TeMIFOthersDecode ( TeAsciiFile& mifFile )
+{
+	// Simply go to the next line
+	mifFile.findNewLine ();
+}
+
+void 
+TeMIFCollectionDecode(TeAsciiFile& mifFile, TePointSet& ps, TeLineSet& ls, TePolygonSet& pols, string& index)
+{
+	int	nparts = mifFile.readInt();
+	if (nparts == 0)
+		nparts = 3;
+	mifFile.findNewLine();
+	for (int i=0; i<nparts; i++)
+	{
+		string part = mifFile.readString ();
+		if (TeStringCompare(part,"Region"))
+			TeMIFRegionDecode (mifFile, pols, index);
+		else if(TeStringCompare(part,"Pline"))
+			TeMIFPlineDecode (mifFile, ls, index);
+		else if (TeStringCompare(part,"Multipoint"))
+			TeMIFMultiPointDecode (mifFile,ps, index);
+	}
+}
diff --git a/src/terralib/functions/TeImportSPR.cpp b/src/terralib/functions/TeImportSPR.cpp
old mode 100755
new mode 100644
index 7a0fdd5..08db222
--- a/src/terralib/functions/TeImportSPR.cpp
+++ b/src/terralib/functions/TeImportSPR.cpp
@@ -1,224 +1,224 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-// STL 
-#include <string>
-#include <iostream>
-#include <vector>
-#include <list>
-#include <map>
-
-using namespace std;
-
-// TerraLib
-
-#include "TeImportSPR.h"
-
-#include "TeAsciiFile.h"
-#include "TeBox.h"
-#include "TeLayer.h"
-#include "TeException.h"
-#include "TeUtils.h"
-
-
-void 
-TeImportSPR ( TeLayer& layer, const string& fileName )
-{
-
-	TePolygonSet& regions	= layer.polygonSet();
-	TeLineSet& lines		= layer.lineSet();
-	TePointSet& points		= layer.pointSet();
-	TeTextSet& textos		= layer.textSet();
-
-/* -------------------------------------------------------------------- */
-/*      Open the  file.                                                 */
-/* -------------------------------------------------------------------- */
-
-	TeAsciiFile	pFile (fileName);
-
-	int geomId = 1;
-	int size,nrings;
-
-	string geoId;
-
-/* -------------------------------------------------------------------- */
-/*      Get information about the file                                  */
-/* -------------------------------------------------------------------- */
-	string repType = pFile.readString ();
-	pFile.findNewLine();
-
-	if (repType == "POLIGONOS")
-	{
-		layer.addGeometry ( TePOLYGONS );
-		while ( 1 )
-		{
-			TePolygon poly;
-			nrings = pFile.readInt ();
-			if (!pFile.isNotAtEOF())
-				break;
-			geoId = pFile.readString ();
-			poly.objectId ( geoId );
-			int i,j;
-			for (j=0;j<nrings;j++)
-			{
-				TeLine2D line;
-				size = pFile.readInt ();
-				pFile.findNewLine();
-				for (i=0;i<size;i++)
-				{
-// Build the polygon
-					TeCoord2D xy = pFile.readCoord2D ();
-					line.add ( xy );
-				}
-				TeLinearRing ring (line);
-				ring.geomId ( geomId );
-				poly.add ( ring );
-				geomId++;
-			}
-			regions.add ( poly );
-		}
-		layer.setBox ( regions.box() );
-	}
-	if (repType == "LINHAS" || repType == "LINES")
-	{
-		TeDatum sad69 = TeDatumFactory::make("SAD69");
-		TeProjection* proj = new TeUtm ( sad69 , -39.*TeCDR);
-		layer.setProjection(proj);
-		string infoend;
-		char separator = ';';
-		while (infoend != "INFO_END" && pFile.isNotAtEOF())
-			infoend = pFile.readString ();
-		layer.addGeometry ( TeLINES );
-		while ( 1 )
-		{
-			geoId = pFile.readString ();
-			if (!pFile.isNotAtEOF())
-				break;
-			int i;
-			TeLine2D line;
-			size = pFile.readInt ();
-			pFile.findNewLine();
-			for (i=0;i<size;i++)
-			{
-// Build the line
-				TeCoord2D xy = pFile.readCoord2D ();
-				line.add ( xy );
-			}
-			line.objectId ( geoId );
-			line.geomId ( geomId );
-			geomId++;
-			lines.add ( line );
-		}
-		layer.setBox ( lines.box() );
-	}
-	if (repType == "POINT2D")
-	{
-		TeDatum sad69 = TeDatumFactory::make("SAD69");
-		TeProjection* proj = new TeUtm ( sad69 , -39.*TeCDR);
-		layer.addGeometry ( TePOINTS );
-		string infoend;
-		char separator = ';';
-		while (infoend != "INFO_END" && pFile.isNotAtEOF())
-			infoend = pFile.readString ();
-		pFile.findNewLine();
-		try
-		{
-			while ( pFile.isNotAtEOF() )
-			{
-				double x,y;
-				char rotulo [128], lixo[4];
-				string input = pFile.readLine();
-				if (!pFile.isNotAtEOF() || input == "END")
-					break;
-				sscanf (input.c_str (), "%lf %s %lf %s %s",&x, lixo, &y, lixo, rotulo);
-				geoId = rotulo;
-
-// Build the point
-				TePoint point;
-				TeCoord2D xy (x,y);
-//				xy = proj->PC2LL (xy);
-//				TeCoord2D xyd (xy.x()*TeCRD,xy.y()*TeCRD);
-				point.add ( xy );
-				point.objectId ( geoId );
-//				point.geomId ( geomId );	
-				points.add ( point );
-				geomId++;
-			}
-		}
-		catch (...)
-		{
-		}
-		layer.setBox ( points.box() );
-	}
-	if (repType == "TEXT")
-	{
-		TeDatum sad69 = TeDatumFactory::make("SAD69");
-		TeProjection* proj = new TeUtm ( sad69 , -39.*TeCDR);
-		layer.setProjection(proj);
-		layer.addGeometry ( TeTEXT );
-		string infoend;
-		char separator = ';';
-		while (infoend != "INFO_END" && pFile.isNotAtEOF())
-			infoend = pFile.readString ();
-		pFile.findNewLine();
-		try
-		{
-			while ( pFile.isNotAtEOF() )
-			{
-				double x,y,ang,exp,hgt;
-//				char rotulo [128], lixo[4];
-//				string input = pFile.readLine();
-//				if (!pFile.isNotAtEOF() || input == "END")
-//					break;
-//				sscanf (input.c_str (), "%lf %s %lf %1s %s %s %lf %s %lf %s %lf %s",
-//					&x, lixo, &y, lixo, rotulo, lixo, &ang, lixo, &exp, lixo, &hgt);
-				x = pFile.readFloatCSV(separator);
-				if (!pFile.isNotAtEOF() || x == 0.0)
-					break;
-				y = pFile.readFloatCSV(separator);
-				string rotulo = pFile.readStringCSV(separator);
-				ang = pFile.readFloatCSV(separator);
-				exp = pFile.readFloatCSV(separator);
-				hgt = pFile.readFloatCSV(separator);
-
-// Build the point
-				TeText texto;
-				TeCoord2D xy (x,y);
-//				xy = proj->PC2LL (xy);
-//				TeCoord2D xyd (xy.x()*TeCRD,xy.y()*TeCRD);
-				TeCoord2D xyd (x,y);
-				texto.add ( xyd );
-				texto.objectId ( geoId );
-				texto.setText ( rotulo );	
-				texto.setAngle ( ang );	
-				texto.setHeight ( hgt );	
-				textos.add ( texto );
-				pFile.findNewLine();
-			}
-		}
-		catch (...)
-		{
-		}
-		layer.setBox ( textos.box() );
-	}
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+// STL 
+#include <string>
+#include <iostream>
+#include <vector>
+#include <list>
+#include <map>
+
+using namespace std;
+
+// TerraLib
+
+#include "TeImportSPR.h"
+
+#include "TeAsciiFile.h"
+#include "TeBox.h"
+#include "TeLayer.h"
+#include "TeException.h"
+#include "TeUtils.h"
+
+
+void 
+TeImportSPR ( TeLayer& layer, const string& fileName )
+{
+
+	TePolygonSet& regions	= layer.polygonSet();
+	TeLineSet& lines		= layer.lineSet();
+	TePointSet& points		= layer.pointSet();
+	TeTextSet& textos		= layer.textSet();
+
+/* -------------------------------------------------------------------- */
+/*      Open the  file.                                                 */
+/* -------------------------------------------------------------------- */
+
+	TeAsciiFile	pFile (fileName);
+
+	int geomId = 1;
+	int size,nrings;
+
+	string geoId;
+
+/* -------------------------------------------------------------------- */
+/*      Get information about the file                                  */
+/* -------------------------------------------------------------------- */
+	string repType = pFile.readString ();
+	pFile.findNewLine();
+
+	if (repType == "POLIGONOS")
+	{
+		layer.addGeometry ( TePOLYGONS );
+		while ( 1 )
+		{
+			TePolygon poly;
+			nrings = pFile.readInt ();
+			if (!pFile.isNotAtEOF())
+				break;
+			geoId = pFile.readString ();
+			poly.objectId ( geoId );
+			int i,j;
+			for (j=0;j<nrings;j++)
+			{
+				TeLine2D line;
+				size = pFile.readInt ();
+				pFile.findNewLine();
+				for (i=0;i<size;i++)
+				{
+// Build the polygon
+					TeCoord2D xy = pFile.readCoord2D ();
+					line.add ( xy );
+				}
+				TeLinearRing ring (line);
+				ring.geomId ( geomId );
+				poly.add ( ring );
+				geomId++;
+			}
+			regions.add ( poly );
+		}
+		layer.setBox ( regions.box() );
+	}
+	if (repType == "LINHAS" || repType == "LINES")
+	{
+		TeDatum sad69 = TeDatumFactory::make("SAD69");
+		TeProjection* proj = new TeUtm ( sad69 , -39.*TeCDR);
+		layer.setProjection(proj);
+		string infoend;
+		char separator = ';';
+		while (infoend != "INFO_END" && pFile.isNotAtEOF())
+			infoend = pFile.readString ();
+		layer.addGeometry ( TeLINES );
+		while ( 1 )
+		{
+			geoId = pFile.readString ();
+			if (!pFile.isNotAtEOF())
+				break;
+			int i;
+			TeLine2D line;
+			size = pFile.readInt ();
+			pFile.findNewLine();
+			for (i=0;i<size;i++)
+			{
+// Build the line
+				TeCoord2D xy = pFile.readCoord2D ();
+				line.add ( xy );
+			}
+			line.objectId ( geoId );
+			line.geomId ( geomId );
+			geomId++;
+			lines.add ( line );
+		}
+		layer.setBox ( lines.box() );
+	}
+	if (repType == "POINT2D")
+	{
+		TeDatum sad69 = TeDatumFactory::make("SAD69");
+		TeProjection* proj = new TeUtm ( sad69 , -39.*TeCDR);
+		layer.addGeometry ( TePOINTS );
+		string infoend;
+		char separator = ';';
+		while (infoend != "INFO_END" && pFile.isNotAtEOF())
+			infoend = pFile.readString ();
+		pFile.findNewLine();
+		try
+		{
+			while ( pFile.isNotAtEOF() )
+			{
+				double x,y;
+				char rotulo [128], lixo[4];
+				string input = pFile.readLine();
+				if (!pFile.isNotAtEOF() || input == "END")
+					break;
+				sscanf (input.c_str (), "%lf %s %lf %s %s",&x, lixo, &y, lixo, rotulo);
+				geoId = rotulo;
+
+// Build the point
+				TePoint point;
+				TeCoord2D xy (x,y);
+//				xy = proj->PC2LL (xy);
+//				TeCoord2D xyd (xy.x()*TeCRD,xy.y()*TeCRD);
+				point.add ( xy );
+				point.objectId ( geoId );
+//				point.geomId ( geomId );	
+				points.add ( point );
+				geomId++;
+			}
+		}
+		catch (...)
+		{
+		}
+		layer.setBox ( points.box() );
+	}
+	if (repType == "TEXT")
+	{
+		TeDatum sad69 = TeDatumFactory::make("SAD69");
+		TeProjection* proj = new TeUtm ( sad69 , -39.*TeCDR);
+		layer.setProjection(proj);
+		layer.addGeometry ( TeTEXT );
+		string infoend;
+		char separator = ';';
+		while (infoend != "INFO_END" && pFile.isNotAtEOF())
+			infoend = pFile.readString ();
+		pFile.findNewLine();
+		try
+		{
+			while ( pFile.isNotAtEOF() )
+			{
+				double x,y,ang,exp,hgt;
+//				char rotulo [128], lixo[4];
+//				string input = pFile.readLine();
+//				if (!pFile.isNotAtEOF() || input == "END")
+//					break;
+//				sscanf (input.c_str (), "%lf %s %lf %1s %s %s %lf %s %lf %s %lf %s",
+//					&x, lixo, &y, lixo, rotulo, lixo, &ang, lixo, &exp, lixo, &hgt);
+				x = pFile.readFloatCSV(separator);
+				if (!pFile.isNotAtEOF() || x == 0.0)
+					break;
+				y = pFile.readFloatCSV(separator);
+				string rotulo = pFile.readStringCSV(separator);
+				ang = pFile.readFloatCSV(separator);
+				exp = pFile.readFloatCSV(separator);
+				hgt = pFile.readFloatCSV(separator);
+
+// Build the point
+				TeText texto;
+				TeCoord2D xy (x,y);
+//				xy = proj->PC2LL (xy);
+//				TeCoord2D xyd (xy.x()*TeCRD,xy.y()*TeCRD);
+				TeCoord2D xyd (x,y);
+				texto.add ( xyd );
+				texto.objectId ( geoId );
+				texto.setText ( rotulo );	
+				texto.setAngle ( ang );	
+				texto.setHeight ( hgt );	
+				textos.add ( texto );
+				pFile.findNewLine();
+			}
+		}
+		catch (...)
+		{
+		}
+		layer.setBox ( textos.box() );
+	}
+}
diff --git a/src/terralib/functions/TeImportSPR.h b/src/terralib/functions/TeImportSPR.h
old mode 100755
new mode 100644
index 64e3608..68c9fc7
--- a/src/terralib/functions/TeImportSPR.h
+++ b/src/terralib/functions/TeImportSPR.h
@@ -1,18 +1,18 @@
-/***************************************************************************
-*                                                                         *
-*   This program is free software; you can redistribute it and/or modify  *
-*   it under the terms of the GNU General Public License as published by  *
-*   the Free Software Foundation; either version 2 of the License, or     *
-*   (at your option) any later version.                                   *
-*                                                                         *
-***************************************************************************/
-#ifndef Te_SPR_H
-#define Te_SPR_H
-#include <string>
-using namespace std;
-
-class TeLayer;
-
-void TeImportSPR ( TeLayer& layer, const string& fileName );
-
+/***************************************************************************
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+*                                                                         *
+***************************************************************************/
+#ifndef Te_SPR_H
+#define Te_SPR_H
+#include <string>
+using namespace std;
+
+class TeLayer;
+
+void TeImportSPR ( TeLayer& layer, const string& fileName );
+
 #endif
\ No newline at end of file
diff --git a/src/terralib/functions/TeInterpolation.cpp b/src/terralib/functions/TeInterpolation.cpp
old mode 100755
new mode 100644
index 5287a5f..942ee5f
--- a/src/terralib/functions/TeInterpolation.cpp
+++ b/src/terralib/functions/TeInterpolation.cpp
@@ -1,369 +1,369 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeInterpolation.h"
-
-#include "TeKdTree.h"
-#include "TeSTElementSet.h"
-#include "TeSTEFunctionsDB.h"
-#include "TeQuerierParams.h"
-#include "TeQuerier.h"
-#include "TeVectorRemap.h"
-
-
-//! Builds a KDTree from a theme with samples: the theme must have a point representation
-/*
-		\param sampleTheme          The theme with samples
-		\param sampleAttrTableName  Theme table with samples
-		\param sampleColumnName     Table column with sample values
-		\param tree				    The tree to store samples
-		\param destProjection		Destination projection
-		\return TRUE if the tree is built correct, otherwise returns FALSE
- */
-template<class KDTREE> bool TeBuildKDTree(TeTheme* sampleTheme, const string& sampleAttrTableName,
-										  const string& sampleColumnName, KDTREE& tree, TeProjection* destProjection)
-{
-// verifies if we need to reproject the samples
-	bool doReprojection = false;
-
-	TeProjection* sampleProj = sampleTheme->layer()->projection();
-
-	if(sampleProj && destProjection && (!((*sampleProj) == (*destProjection))))
-		doReprojection = true;
-
-// if it is necessary to reproject, reproject the tree's box first
-    if(doReprojection)
-	{
-		TeBox baux = tree.getBox();
-		TeBox b = TeRemapBox(baux, sampleProj, destProjection);
-
-		tree.setBox(b);
-	}
-
-
-	vector<pair<TeCoord2D, TeSample> > dataSet;
-
-// load sample points
-	bool loadGeometries = true;
-
-    vector<string> attributes;
-
-	string attName = sampleAttrTableName + "." + sampleColumnName;
-
-    attributes.push_back(attName);
-
-	TeQuerierParams querierParams(loadGeometries, attributes);
-
-	querierParams.setParams(sampleTheme);
-
-	TeQuerier querier(querierParams);
-
-// load instances from theme based in the querier parameters
-	if(!querier.loadInstances())
-		return false;
-	
-	TeSTInstance sti;	
-
-// traverse all the instances
-	while(querier.fetchInstance(sti))	
-	{
-		TeProperty prop;
-
-// retrieves sample values
-		sti.getProperty(prop, attName);    
-		
-		if(sti.hasPoints())
-		{
-			TePointSet pointSet;
-
-			sti.getGeometry(pointSet);
-
-			TeCoord2D c = pointSet[0].location();
-
-// if it is necessary, do reprojection
-			if(doReprojection)
-			{
-				TeCoord2D caux;
-				TeVectorRemap(c, sampleProj, caux, destProjection);
-				c = caux;
-			}
-
-			TeSample sample(c, atof(prop.value_.c_str()));
-
-// put samples into auxiliary vector to build the tree
-			dataSet.push_back(pair<TeCoord2D, TeSample>(sample.location(), sample));
-		}
-	}
-
-	tree.build(dataSet);
-
-	return true;
-}
-
-bool TeCellInterpolate(TeTheme* inputTheme, const string& inputAttrTableName, const string& sampleColumnName,
-                       TeTheme* outputTheme, const string& outputAttrTableName, const string& outputColumnName,
-				       const TeInterpolationAlgorithm& algorithm,
-                       const unsigned int& numberOfNeighbors, const int& powValue, const double& boxRatio)
-{
-	if((inputTheme == 0) || (outputTheme == 0))
-		return false;
-
-	if(inputAttrTableName.empty() || outputAttrTableName.empty())
-		return false;
-
-	if(sampleColumnName.empty() || outputColumnName.empty())
-		return false;	
-
-// load the tree with samples
-	typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, vector<TeSample>, TeSample> KDNODE;
-	typedef TeSAM::TeAdaptativeKdTree<KDNODE> KDTREE;
-
-	unsigned int bucketSize = 2 * numberOfNeighbors;
-
-	TeBox mbr = inputTheme->layer()->box();
-
-	KDTREE tree(mbr, bucketSize);
-
-	if(!TeBuildKDTree(inputTheme, inputAttrTableName, sampleColumnName, tree, outputTheme->layer()->projection()))
-		return false;
-
-	if(tree.size() == 0)
-		return false;
-	
-	else if(outputTheme->visibleRep() & TeCELLS)
-	{
-		TeInterpolationAlgorithms<KDTREE> interpolationObj(tree);
-
-// load cells to be interpolated
-
-		bool loadGeometries = true;
-
-		vector<string> attributes;
-
-		TeQuerierParams querierParams(loadGeometries);
-
-		querierParams.setParams(outputTheme);
-
-		TeQuerier querier(querierParams);
-
-// load theme instances
-		querier.loadInstances();	
-		
-		TeSTInstance sti;	
-
-		TeSTElementSet elemSet(outputTheme);	
-
-// traverse all the instances
-		while(querier.fetchInstance(sti))	
-		{
-			TeProperty prop;
-
-			if(sti.hasCells())
-			{
-				TeCellSet cellSet;
-
-				sti.getGeometry(cellSet);
-
-				double value = -TeMAXFLOAT;
-
-// if the cell has more than one geometry, so emit an error!!!!!!
-				if((cellSet.size() > 1) || (cellSet.size() == 0))
-					return false;
-
-// do interpolation with the informed algorithm
-				if(algorithm == TeNNInterpolation)
-				{
-					value = interpolationObj.nearestNeighbor(cellSet[0].box().center());
-				}
-				else if(algorithm == TeAvgInterpolation)
-				{
-					value = interpolationObj.avgNearestNeighbor(cellSet[0].box().center(), numberOfNeighbors);
-				}
-				else if(algorithm == TeDistWeightAvgInterpolation)
-				{
-					value = interpolationObj.distWeightAvgNearestNeighbor(cellSet[0].box().center(), numberOfNeighbors, powValue);
-				}
-				else if(algorithm == TeAvgInBoxInterpolation)
-				{
-					TeCoord2D center = cellSet[0].box().center();
-
-					TeBox b(center.x_ - boxRatio, center.y_ - boxRatio, center.x_ + boxRatio, center.y_ + boxRatio);
-
-					value = interpolationObj.boxAvg(b);
-				}
-				else if(algorithm == TeDistWeightAvgInBoxInterpolation)
-				{
-					TeCoord2D center = cellSet[0].box().center();
-
-					TeBox b(center.x_ - boxRatio, center.y_ - boxRatio, center.x_ + boxRatio, center.y_ + boxRatio);
-
-					value = interpolationObj.boxDistWeightAvg(center, b, powValue);
-				}
-				else
-					return false;
-
-// stores the interpolated values
-				TeSTInstance inst;
-
-				inst.objectId(sti.objectId());
-				inst.uniqueId(sti.uniqueId());
-				inst.theme(outputTheme);
-
-				TeProperty prop;
-				prop.attr_.rep_.name_ = outputColumnName;
-				prop.attr_.rep_.type_ = TeREAL;
-				prop.value_ = Te2String(value, 15);
-
-				inst.addProperty(prop);
-
-				elemSet.insertSTInstance(inst);
-			}
-		}
-
-// store the interpolated values
-		return TeUpdateDBFromSet(&elemSet, outputAttrTableName);	
-	}	
-	
-	return false;
-}
-
-bool TeRasterInterpolate(TeTheme* inputTheme, const string& inputAttrTableName, const string& sampleColumnName,
-                         TeRaster* outputRaster, const int& band,
-				         const TeInterpolationAlgorithm& algorithm,
-                         const unsigned int& numberOfNeighbors, const int& powValue, const double& boxRatio)
-{
-	if((inputTheme == 0) || (outputRaster == 0))
-		return false;
-
-	if(inputAttrTableName.empty())
-		return false;
-
-	if(sampleColumnName.empty())
-		return false;	
-
-// load tree with samaples
-	typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, vector<TeSample>, TeSample> KDNODE;
-	typedef TeSAM::TeAdaptativeKdTree<KDNODE> KDTREE;
-
-// A minimum of MINBUCKETSIZE elements in each bucket
-	unsigned int bucketSize = 2 * numberOfNeighbors;
-
-	TeBox mbr = inputTheme->layer()->box();
-
-	KDTREE tree(mbr, bucketSize);
-
-	if(!TeBuildKDTree(inputTheme, inputAttrTableName, sampleColumnName, tree, outputRaster->projection()))
-		return false;
-
-	if(tree.size() == 0)
-		return false;
-
-	TeInterpolationAlgorithms<KDTREE> interpolationObj(tree);
-	
-	int nLines = outputRaster->params().nlines_;
-	int nCols = outputRaster->params().ncols_;
-
-	double value = -TeMAXFLOAT;
-
-	if(algorithm == TeNNInterpolation)
-	{
-		for(int i = 0; i < nLines; ++i)
-			for(int j = 0; j < nCols; ++j)
-			{
-				TeCoord2D cl(j, i);
-
-				TeCoord2D c = outputRaster->index2Coord(cl);
-
-				value = interpolationObj.nearestNeighbor(c);
-
-                outputRaster->setElement(j, i, value, band);
-			}		
-	}
-	else if(algorithm == TeAvgInterpolation)
-	{
-		for(int i = 0; i < nLines; ++i)
-		{
-			for(int j = 0; j < nCols; ++j)
-			{
-				TeCoord2D cl(j, i);
-
-				TeCoord2D c = outputRaster->index2Coord(cl);
-
-				value = interpolationObj.avgNearestNeighbor(c, numberOfNeighbors);
-
-                outputRaster->setElement(j, i, value, band);
-			}	
-		}
-	}
-	else if(algorithm == TeDistWeightAvgInterpolation)
-	{
-		for(int i = 0; i < nLines; ++i)
-			for(int j = 0; j < nCols; ++j)
-			{
-				TeCoord2D cl(j, i);
-
-				TeCoord2D c = outputRaster->index2Coord(cl);
-
-				value = interpolationObj.distWeightAvgNearestNeighbor(c, numberOfNeighbors, powValue);
-
-                outputRaster->setElement(j, i, value, band);
-			}
-	}
-	else if(algorithm == TeAvgInBoxInterpolation)
-	{
-		for(int i = 0; i < nLines; ++i)
-			for(int j = 0; j < nCols; ++j)
-			{
-				TeCoord2D cl(j, i);
-
-				TeCoord2D c = outputRaster->index2Coord(cl);
-
-				TeBox b(c.x_ - boxRatio, c.y_ - boxRatio, c.x_ + boxRatio, c.y_ + boxRatio);
-
-				value = interpolationObj.boxAvg(b);
-
-                outputRaster->setElement(j, i, value, band);
-			}
-	}
-	else if(algorithm == TeDistWeightAvgInBoxInterpolation)
-	{
-		for(int i = 0; i < nLines; ++i)
-			for(int j = 0; j < nCols; ++j)
-			{
-				TeCoord2D cl(j, i);
-
-				TeCoord2D c = outputRaster->index2Coord(cl);
-
-				TeBox b(c.x_ - boxRatio, c.y_ - boxRatio, c.x_ + boxRatio, c.y_ + boxRatio);
-
-				value = interpolationObj.boxDistWeightAvg(c, b, powValue);
-
-                outputRaster->setElement(j, i, value, band);
-			}
-	}
-	else
-		return false;
-
-
-    return true;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeInterpolation.h"
+
+#include "TeKdTree.h"
+#include "TeSTElementSet.h"
+#include "TeSTEFunctionsDB.h"
+#include "TeQuerierParams.h"
+#include "TeQuerier.h"
+#include "TeVectorRemap.h"
+
+
+//! Builds a KDTree from a theme with samples: the theme must have a point representation
+/*
+		\param sampleTheme          The theme with samples
+		\param sampleAttrTableName  Theme table with samples
+		\param sampleColumnName     Table column with sample values
+		\param tree				    The tree to store samples
+		\param destProjection		Destination projection
+		\return TRUE if the tree is built correct, otherwise returns FALSE
+ */
+template<class KDTREE> bool TeBuildKDTree(TeTheme* sampleTheme, const string& sampleAttrTableName,
+										  const string& sampleColumnName, KDTREE& tree, TeProjection* destProjection)
+{
+// verifies if we need to reproject the samples
+	bool doReprojection = false;
+
+	TeProjection* sampleProj = sampleTheme->layer()->projection();
+
+	if(sampleProj && destProjection && (!((*sampleProj) == (*destProjection))))
+		doReprojection = true;
+
+// if it is necessary to reproject, reproject the tree's box first
+    if(doReprojection)
+	{
+		TeBox baux = tree.getBox();
+		TeBox b = TeRemapBox(baux, sampleProj, destProjection);
+
+		tree.setBox(b);
+	}
+
+
+	vector<pair<TeCoord2D, TeSample> > dataSet;
+
+// load sample points
+	bool loadGeometries = true;
+
+    vector<string> attributes;
+
+	string attName = sampleAttrTableName + "." + sampleColumnName;
+
+    attributes.push_back(attName);
+
+	TeQuerierParams querierParams(loadGeometries, attributes);
+
+	querierParams.setParams(sampleTheme);
+
+	TeQuerier querier(querierParams);
+
+// load instances from theme based in the querier parameters
+	if(!querier.loadInstances())
+		return false;
+	
+	TeSTInstance sti;	
+
+// traverse all the instances
+	while(querier.fetchInstance(sti))	
+	{
+		TeProperty prop;
+
+// retrieves sample values
+		sti.getProperty(prop, attName);    
+		
+		if(sti.hasPoints())
+		{
+			TePointSet pointSet;
+
+			sti.getGeometry(pointSet);
+
+			TeCoord2D c = pointSet[0].location();
+
+// if it is necessary, do reprojection
+			if(doReprojection)
+			{
+				TeCoord2D caux;
+				TeVectorRemap(c, sampleProj, caux, destProjection);
+				c = caux;
+			}
+
+			TeSample sample(c, atof(prop.value_.c_str()));
+
+// put samples into auxiliary vector to build the tree
+			dataSet.push_back(pair<TeCoord2D, TeSample>(sample.location(), sample));
+		}
+	}
+
+	tree.build(dataSet);
+
+	return true;
+}
+
+bool TeCellInterpolate(TeTheme* inputTheme, const string& inputAttrTableName, const string& sampleColumnName,
+                       TeTheme* outputTheme, const string& outputAttrTableName, const string& outputColumnName,
+				       const TeInterpolationAlgorithm& algorithm,
+                       const unsigned int& numberOfNeighbors, const int& powValue, const double& boxRatio)
+{
+	if((inputTheme == 0) || (outputTheme == 0))
+		return false;
+
+	if(inputAttrTableName.empty() || outputAttrTableName.empty())
+		return false;
+
+	if(sampleColumnName.empty() || outputColumnName.empty())
+		return false;	
+
+// load the tree with samples
+	typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, vector<TeSample>, TeSample> KDNODE;
+	typedef TeSAM::TeAdaptativeKdTree<KDNODE> KDTREE;
+
+	unsigned int bucketSize = 2 * numberOfNeighbors;
+
+	TeBox mbr = inputTheme->layer()->box();
+
+	KDTREE tree(mbr, bucketSize);
+
+	if(!TeBuildKDTree(inputTheme, inputAttrTableName, sampleColumnName, tree, outputTheme->layer()->projection()))
+		return false;
+
+	if(tree.size() == 0)
+		return false;
+	
+	else if(outputTheme->visibleRep() & TeCELLS)
+	{
+		TeInterpolationAlgorithms<KDTREE> interpolationObj(tree);
+
+// load cells to be interpolated
+
+		bool loadGeometries = true;
+
+		vector<string> attributes;
+
+		TeQuerierParams querierParams(loadGeometries);
+
+		querierParams.setParams(outputTheme);
+
+		TeQuerier querier(querierParams);
+
+// load theme instances
+		querier.loadInstances();	
+		
+		TeSTInstance sti;	
+
+		TeSTElementSet elemSet(outputTheme);	
+
+// traverse all the instances
+		while(querier.fetchInstance(sti))	
+		{
+			TeProperty prop;
+
+			if(sti.hasCells())
+			{
+				TeCellSet cellSet;
+
+				sti.getGeometry(cellSet);
+
+				double value = -TeMAXFLOAT;
+
+// if the cell has more than one geometry, so emit an error!!!!!!
+				if((cellSet.size() > 1) || (cellSet.size() == 0))
+					return false;
+
+// do interpolation with the informed algorithm
+				if(algorithm == TeNNInterpolation)
+				{
+					value = interpolationObj.nearestNeighbor(cellSet[0].box().center());
+				}
+				else if(algorithm == TeAvgInterpolation)
+				{
+					value = interpolationObj.avgNearestNeighbor(cellSet[0].box().center(), numberOfNeighbors);
+				}
+				else if(algorithm == TeDistWeightAvgInterpolation)
+				{
+					value = interpolationObj.distWeightAvgNearestNeighbor(cellSet[0].box().center(), numberOfNeighbors, powValue);
+				}
+				else if(algorithm == TeAvgInBoxInterpolation)
+				{
+					TeCoord2D center = cellSet[0].box().center();
+
+					TeBox b(center.x_ - boxRatio, center.y_ - boxRatio, center.x_ + boxRatio, center.y_ + boxRatio);
+
+					value = interpolationObj.boxAvg(b);
+				}
+				else if(algorithm == TeDistWeightAvgInBoxInterpolation)
+				{
+					TeCoord2D center = cellSet[0].box().center();
+
+					TeBox b(center.x_ - boxRatio, center.y_ - boxRatio, center.x_ + boxRatio, center.y_ + boxRatio);
+
+					value = interpolationObj.boxDistWeightAvg(center, b, powValue);
+				}
+				else
+					return false;
+
+// stores the interpolated values
+				TeSTInstance inst;
+
+				inst.objectId(sti.objectId());
+				inst.uniqueId(sti.uniqueId());
+				inst.theme(outputTheme);
+
+				TeProperty prop;
+				prop.attr_.rep_.name_ = outputColumnName;
+				prop.attr_.rep_.type_ = TeREAL;
+				prop.value_ = Te2String(value, 15);
+
+				inst.addProperty(prop);
+
+				elemSet.insertSTInstance(inst);
+			}
+		}
+
+// store the interpolated values
+		return TeUpdateDBFromSet(&elemSet, outputAttrTableName);	
+	}	
+	
+	return false;
+}
+
+bool TeRasterInterpolate(TeTheme* inputTheme, const string& inputAttrTableName, const string& sampleColumnName,
+                         TeRaster* outputRaster, const int& band,
+				         const TeInterpolationAlgorithm& algorithm,
+                         const unsigned int& numberOfNeighbors, const int& powValue, const double& boxRatio)
+{
+	if((inputTheme == 0) || (outputRaster == 0))
+		return false;
+
+	if(inputAttrTableName.empty())
+		return false;
+
+	if(sampleColumnName.empty())
+		return false;	
+
+// load tree with samaples
+	typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, vector<TeSample>, TeSample> KDNODE;
+	typedef TeSAM::TeAdaptativeKdTree<KDNODE> KDTREE;
+
+// A minimum of MINBUCKETSIZE elements in each bucket
+	unsigned int bucketSize = 2 * numberOfNeighbors;
+
+	TeBox mbr = inputTheme->layer()->box();
+
+	KDTREE tree(mbr, bucketSize);
+
+	if(!TeBuildKDTree(inputTheme, inputAttrTableName, sampleColumnName, tree, outputRaster->projection()))
+		return false;
+
+	if(tree.size() == 0)
+		return false;
+
+	TeInterpolationAlgorithms<KDTREE> interpolationObj(tree);
+	
+	int nLines = outputRaster->params().nlines_;
+	int nCols = outputRaster->params().ncols_;
+
+	double value = -TeMAXFLOAT;
+
+	if(algorithm == TeNNInterpolation)
+	{
+		for(int i = 0; i < nLines; ++i)
+			for(int j = 0; j < nCols; ++j)
+			{
+				TeCoord2D cl(j, i);
+
+				TeCoord2D c = outputRaster->index2Coord(cl);
+
+				value = interpolationObj.nearestNeighbor(c);
+
+                outputRaster->setElement(j, i, value, band);
+			}		
+	}
+	else if(algorithm == TeAvgInterpolation)
+	{
+		for(int i = 0; i < nLines; ++i)
+		{
+			for(int j = 0; j < nCols; ++j)
+			{
+				TeCoord2D cl(j, i);
+
+				TeCoord2D c = outputRaster->index2Coord(cl);
+
+				value = interpolationObj.avgNearestNeighbor(c, numberOfNeighbors);
+
+                outputRaster->setElement(j, i, value, band);
+			}	
+		}
+	}
+	else if(algorithm == TeDistWeightAvgInterpolation)
+	{
+		for(int i = 0; i < nLines; ++i)
+			for(int j = 0; j < nCols; ++j)
+			{
+				TeCoord2D cl(j, i);
+
+				TeCoord2D c = outputRaster->index2Coord(cl);
+
+				value = interpolationObj.distWeightAvgNearestNeighbor(c, numberOfNeighbors, powValue);
+
+                outputRaster->setElement(j, i, value, band);
+			}
+	}
+	else if(algorithm == TeAvgInBoxInterpolation)
+	{
+		for(int i = 0; i < nLines; ++i)
+			for(int j = 0; j < nCols; ++j)
+			{
+				TeCoord2D cl(j, i);
+
+				TeCoord2D c = outputRaster->index2Coord(cl);
+
+				TeBox b(c.x_ - boxRatio, c.y_ - boxRatio, c.x_ + boxRatio, c.y_ + boxRatio);
+
+				value = interpolationObj.boxAvg(b);
+
+                outputRaster->setElement(j, i, value, band);
+			}
+	}
+	else if(algorithm == TeDistWeightAvgInBoxInterpolation)
+	{
+		for(int i = 0; i < nLines; ++i)
+			for(int j = 0; j < nCols; ++j)
+			{
+				TeCoord2D cl(j, i);
+
+				TeCoord2D c = outputRaster->index2Coord(cl);
+
+				TeBox b(c.x_ - boxRatio, c.y_ - boxRatio, c.x_ + boxRatio, c.y_ + boxRatio);
+
+				value = interpolationObj.boxDistWeightAvg(c, b, powValue);
+
+                outputRaster->setElement(j, i, value, band);
+			}
+	}
+	else
+		return false;
+
+
+    return true;
+}
diff --git a/src/terralib/functions/TeInterpolation.h b/src/terralib/functions/TeInterpolation.h
old mode 100755
new mode 100644
index 6e57fa5..96e2d42
--- a/src/terralib/functions/TeInterpolation.h
+++ b/src/terralib/functions/TeInterpolation.h
@@ -1,356 +1,356 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*! \file TeInterpolation.h
-    This file contains routines for interpolation of cell themes and raster themes.	
-*/
-
-#ifndef  __TERRALIB_INTERNAL_INTERPOLATION_H
-#define  __TERRALIB_INTERNAL_INTERPOLATION_H
-
-#include "TeTheme.h"
-
-
-/*
- * NOTE: You should call TeCellInterpolate or TeRasterInterpolate with the required parameters. Don't use
- *       the class TeInterpolationAlgorithms, it is for internal use only!
- *
- */
-
-
-/** @defgroup InterpolationDataStructure Interpolation Algorithms and Data Structures
- *  TerraLib Interpolation Data Structure.
- *  @{
- */
-
-/*! \enum TeInterpolationAlgorithm
-
-	Methods of interpolation, may be:
-    - TeNNInterpolation                  Interpolation that uses the nearest neighbor value
-	- TeAvgInterpolation                 Interpolation that uses the average of k-nearest neighbors values
-	- TeDistWeightAvgInterpolation       Interpolation with weight average (inverse of square distance or other) of k-nearest neighbors values
-	- TeAvgInBoxInterpolation			 Interpolation with simple average of elements in box
-	- TeDistWeightAvgInBoxInterpolation  Interpolation with weight average of elements in box
-*/ 
-enum TeInterpolationAlgorithm { TeNNInterpolation, TeAvgInterpolation, TeDistWeightAvgInterpolation,
-                                TeAvgInBoxInterpolation, TeDistWeightAvgInBoxInterpolation };
-
-//! Class that supports several types of interpolation methods
-/*!
-	Given a KdTree and a key, choose a method of interpolation.
-	
-	WARNING:	1. This class MUST BE USED ONLY BY in the routines below (TeCellInterpolate and TeRasterInterpolate) 
-	               and should NOT be used by anyone because the support and interfaces can be changed in future.
-				   THIS IS FOR INTERNAL USE ONLY.
-	
-				2. As in simple average as in weight average, if all neighbours aren't find the calculus considerates 
-	               the number of found neighbours.
-
-			    3. If an unexpected situation occurs so -TeMAXFLOAT is returned.
-
-				4. If a sample exist in the same position of a key, so the sample value is returned, i.e.,
-				   not all neighbours are considered.
- */
-template<class ADAPTATIVEKDTREE> class TeInterpolationAlgorithms
-{
-	protected:
-
-		typedef typename ADAPTATIVEKDTREE::kdKey kdKey;
-		typedef typename ADAPTATIVEKDTREE::kdDataItem kdDataItem;
-		typedef typename ADAPTATIVEKDTREE::kdNode kdNode;
-
-		//! reference to an adptative kdtree 
-		const ADAPTATIVEKDTREE& kd_;
-
-	public:		
-
-		//! Constructor
-		TeInterpolationAlgorithms(const ADAPTATIVEKDTREE& kd)
-			: kd_(kd)
-		{
-		}
-
-		//! Destructor
-		~TeInterpolationAlgorithms()
-		{
-		}
-
-		//! Returns the nearest neighbor value
-		double nearestNeighbor(const kdKey& key)
-		{
-			vector<kdDataItem> report;
-			vector<double> sqrDists;
-
-			fillNNVector(report, 1);
-
-			kd_.nearestNeighborSearch(key, report, sqrDists, 1);
-
-			if(sqrDists[0] >= TeMAXFLOAT)
-				return -TeMAXFLOAT;
-			else
-				return report[0].value();
-		}
-
-		//! Simple Average of Nearest Neighbors. If an error occur returns -TeMAXFLOAT
-		double avgNearestNeighbor(const kdKey& key, const unsigned int& numberOfNeighbors)
-		{
-			vector<kdDataItem> report;
-			vector<double> sqrDists;
-
-			fillNNVector(report, numberOfNeighbors);
-
-			kd_.nearestNeighborSearch(key, report, sqrDists, numberOfNeighbors);
-
-			double numElements = numberOfNeighbors;
-
-			double sum = 0.0;
-
-			for(unsigned int i = 0; i < numberOfNeighbors; ++i)
-			{
-				if(sqrDists[i] >= TeMAXFLOAT)
-				{
-					--numElements;
-					continue;
-				}
-
-				if(sqrDists[i] == 0.0)
-					return report[i].value();
-
-				sum += report[i].value();
-			}
-
-			if(numElements > 0.0)
-                return sum / numElements;
-			else
-				return -TeMAXFLOAT;
-		}
-
-		//! Weight Average of Nearest Neighbors. If an error occur returns -TeMAXFLOAT
-		double distWeightAvgNearestNeighbor(const kdKey& key, const unsigned int& numberOfNeighbors, const int& powValue)
-		{
-			vector<kdDataItem> report;
-			vector<double> sqrDists;
-
-			fillNNVector(report, numberOfNeighbors);
-
-			kd_.nearestNeighborSearch(key, report, sqrDists, numberOfNeighbors);
-
-			double num = 0.0;
-			double den = 0.0;
-
-			if(powValue == 1.0)
-			{
-				for(unsigned int i = 0; i < numberOfNeighbors; ++i)
-				{
-					if(sqrDists[i] >= TeMAXFLOAT)
-						continue;
-
-					if(sqrDists[i] == 0.0)
-						return report[i].value();
-
-					double wi = 1.0 / (sqrt(sqrDists[i]));
-
-					num += (wi * report[i].value());
-					den += wi;
-				}
-			}
-			else if(powValue == 2.0)
-			{
-				for(unsigned int i = 0; i < numberOfNeighbors; ++i)
-				{
-					if(sqrDists[i] >= TeMAXFLOAT)
-						continue;
-
-					if(sqrDists[i] == 0.0)
-						return report[i].value();
-
-					double wi = 1.0 / (sqrDists[i]);
-
-					num += (wi * report[i].value());
-					den += wi;
-				}
-			}
-			else
-			{
-				for(unsigned int i = 0; i < numberOfNeighbors; ++i)
-				{
-					if(sqrDists[i] >= TeMAXFLOAT)
-						continue;
-
-					if(sqrDists[i] == 0.0)
-						return report[i].value();
-
-					double wi = 1.0 / pow(sqrt(sqrDists[i]), powValue);
-
-					num += (wi * report[i].value());
-					den += wi;
-				}
-			}
-
-			if(den != 0.0)
-                return num / den;
-			else
-				return -TeMAXFLOAT;
-		}
-
-		//! Simple Average of Elements in Box. If an error occur returns -TeMAXFLOAT
-		double boxAvg(const TeBox& box)
-		{
-			vector<kdNode*> report;
-
-			kd_.search(box, report);
-
-			unsigned int numberOfNodes = report.size();
-
-			unsigned int numElements = 0;
-
-			double sum = 0.0;
-
-			for(unsigned int i = 0; i < numberOfNodes; ++i)
-			{
-				unsigned int nodeSize = report[i]->getData().size();
-
-				for(unsigned int j = 0; j < nodeSize; ++j)
-				{
-					if(TeIntersects(report[i]->getData()[j].location(), box))
-					{
-                        sum += report[i]->getData()[j].value();
-						++numElements;
-					}
-				}				
-			}
-
-			if(numElements > 0)
-                return sum / double(numElements);
-			else
-				return -TeMAXFLOAT;
-		}
-
-		//! Distance Weight Average of Elements in Box. If an error occur returns -TeMAXFLOAT
-		double boxDistWeightAvg(const kdKey& key, const TeBox& box, const int& powValue)
-		{
-			vector<kdNode*> report;
-
-			kd_.search(box, report);
-
-			unsigned int numberOfNodes = report.size();
-
-			double num = 0.0;
-			double den = 0.0;
-
-			for(unsigned int i = 0; i < numberOfNodes; ++i)
-			{
-				unsigned int nodeSize = report[i]->getData().size();
-
-				for(unsigned int j = 0; j < nodeSize; ++j)
-				{
-					if(TeIntersects(report[i]->getData()[j].location(), box))
-					{
-						double wi = 1 / pow(TeDistance(key, report[i]->getData()[j].location()), powValue);
-						
-						num += wi * report[i]->getData()[j].value();
-						den += wi;
-					}
-				}				
-			}
-
-			if(den != 0.0)
-                return num / den;
-			else
-				return -TeMAXFLOAT;
-		}
-
-	protected:
-
-		//! Fills the nearest neighbour vector with default values
-		void fillNNVector(vector<kdDataItem>& report, const unsigned int& numberOfNeighbors) const
-		{
-			for(unsigned int i = 0; i < numberOfNeighbors; ++i)
-			{
-				TeCoord2D c(TeMAXFLOAT, TeMAXFLOAT);
-				kdDataItem item(c, -TeMAXFLOAT);
-
-				report.push_back(item);
-			}
-		}
-
-	private:
-
-		//! No copy allowed
-		TeInterpolationAlgorithms(const TeInterpolationAlgorithms& rhs);
-
-		//! No copy allowed
-		TeInterpolationAlgorithms& operator=(const TeInterpolationAlgorithms& rhs);		
-};
-
-
-
-//! Interpolates a cell theme
-/*
-		\param inputTheme			The theme with samples to be used: samples are treated as a layer of points with a column with a value (double or integer)
-		\param inputAttrTableName   Theme table with samples
-		\param sampleColumnName     Table column with sample values: must be int or double values
-		\param outputTheme          The theme where output will be stored: this theme must already exist
-		\param outputAttrTableName  Theme table where output will be stored: this table must already exist
-		\param outputColumnName     Table column where data will be stored: this column must already exist
-		\param algorithm		    Type of algorithm to be used: see enum TeInterpolationAlgorithm
-		\param numberOfNeighbors    Number of nearest neighbor to be used in interpolation
-		\param powValue			    Pow parameter for inverse distance function
-		\param boxRatio				Ratio of the box used to search samples
-		\return TRUE if there isn't an error during interpolation otherwise return FALSE
- */
-bool TeCellInterpolate(TeTheme* inputTheme, const string& inputAttrTableName, const string& sampleColumnName,
-                       TeTheme* outputTheme, const string& outputAttrTableName, const string& outputColumnName,
-				       const TeInterpolationAlgorithm& algorithm = TeNNInterpolation,
-                       const unsigned int& numberOfNeighbors = 1, const int& powValue = 1, const double& boxRatio = 1.0);
-
-//! Interpolates a a raster
-/*
-		\param inputTheme			The theme with samples to be used: samples are treated as a layer of points with a column with a value (double or integer)
-		\param inputAttrTableName   Theme table with samples
-		\param sampleColumnName     Table column with sample values
-		\param outputRaster         A pointer to a raster where interpolated data will be stored: this raster mus already exist
-		\param band                 The band to be interpolated
-		\param algorithm		    Type of algorithm to be used: see enum TeInterpolationAlgorithm
-		\param numberOfNeighbors    Number of nearest neighbor to be used in interpolation
-		\param powValue			    Pow parameter for inverse distance function
-		\param boxRatio				Ratio of the box used to search samples
-		\return TRUE if there isn't an error during interpolation otherwise return FALSE
- */
-bool TeRasterInterpolate(TeTheme* inputTheme, const string& inputAttrTableName, const string& sampleColumnName,
-                         TeRaster* outputRaster, const int& band = 0,
-				         const TeInterpolationAlgorithm& algorithm = TeNNInterpolation,
-                         const unsigned int& numberOfNeighbors = 1, const int& powValue = 1, const double& boxRatio = 1.0);
-
-		
-
-/** @} */ 
-
-
-
-
-#endif	// __TERRALIB_INTERNAL_INTERPOLATION_H
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*! \file TeInterpolation.h
+    This file contains routines for interpolation of cell themes and raster themes.	
+*/
+
+#ifndef  __TERRALIB_INTERNAL_INTERPOLATION_H
+#define  __TERRALIB_INTERNAL_INTERPOLATION_H
+
+#include "TeTheme.h"
+
+
+/*
+ * NOTE: You should call TeCellInterpolate or TeRasterInterpolate with the required parameters. Don't use
+ *       the class TeInterpolationAlgorithms, it is for internal use only!
+ *
+ */
+
+
+/** @defgroup InterpolationDataStructure Interpolation Algorithms and Data Structures
+ *  TerraLib Interpolation Data Structure.
+ *  @{
+ */
+
+/*! \enum TeInterpolationAlgorithm
+
+	Methods of interpolation, may be:
+    - TeNNInterpolation                  Interpolation that uses the nearest neighbor value
+	- TeAvgInterpolation                 Interpolation that uses the average of k-nearest neighbors values
+	- TeDistWeightAvgInterpolation       Interpolation with weight average (inverse of square distance or other) of k-nearest neighbors values
+	- TeAvgInBoxInterpolation			 Interpolation with simple average of elements in box
+	- TeDistWeightAvgInBoxInterpolation  Interpolation with weight average of elements in box
+*/ 
+enum TeInterpolationAlgorithm { TeNNInterpolation, TeAvgInterpolation, TeDistWeightAvgInterpolation,
+                                TeAvgInBoxInterpolation, TeDistWeightAvgInBoxInterpolation };
+
+//! Class that supports several types of interpolation methods
+/*!
+	Given a KdTree and a key, choose a method of interpolation.
+	
+	WARNING:	1. This class MUST BE USED ONLY BY in the routines below (TeCellInterpolate and TeRasterInterpolate) 
+	               and should NOT be used by anyone because the support and interfaces can be changed in future.
+				   THIS IS FOR INTERNAL USE ONLY.
+	
+				2. As in simple average as in weight average, if all neighbours aren't find the calculus considerates 
+	               the number of found neighbours.
+
+			    3. If an unexpected situation occurs so -TeMAXFLOAT is returned.
+
+				4. If a sample exist in the same position of a key, so the sample value is returned, i.e.,
+				   not all neighbours are considered.
+ */
+template<class ADAPTATIVEKDTREE> class TeInterpolationAlgorithms
+{
+	protected:
+
+		typedef typename ADAPTATIVEKDTREE::kdKey kdKey;
+		typedef typename ADAPTATIVEKDTREE::kdDataItem kdDataItem;
+		typedef typename ADAPTATIVEKDTREE::kdNode kdNode;
+
+		//! reference to an adptative kdtree 
+		const ADAPTATIVEKDTREE& kd_;
+
+	public:		
+
+		//! Constructor
+		TeInterpolationAlgorithms(const ADAPTATIVEKDTREE& kd)
+			: kd_(kd)
+		{
+		}
+
+		//! Destructor
+		~TeInterpolationAlgorithms()
+		{
+		}
+
+		//! Returns the nearest neighbor value
+		double nearestNeighbor(const kdKey& key)
+		{
+			vector<kdDataItem> report;
+			vector<double> sqrDists;
+
+			fillNNVector(report, 1);
+
+			kd_.nearestNeighborSearch(key, report, sqrDists, 1);
+
+			if(sqrDists[0] >= TeMAXFLOAT)
+				return -TeMAXFLOAT;
+			else
+				return report[0].value();
+		}
+
+		//! Simple Average of Nearest Neighbors. If an error occur returns -TeMAXFLOAT
+		double avgNearestNeighbor(const kdKey& key, const unsigned int& numberOfNeighbors)
+		{
+			vector<kdDataItem> report;
+			vector<double> sqrDists;
+
+			fillNNVector(report, numberOfNeighbors);
+
+			kd_.nearestNeighborSearch(key, report, sqrDists, numberOfNeighbors);
+
+			double numElements = numberOfNeighbors;
+
+			double sum = 0.0;
+
+			for(unsigned int i = 0; i < numberOfNeighbors; ++i)
+			{
+				if(sqrDists[i] >= TeMAXFLOAT)
+				{
+					--numElements;
+					continue;
+				}
+
+				if(sqrDists[i] == 0.0)
+					return report[i].value();
+
+				sum += report[i].value();
+			}
+
+			if(numElements > 0.0)
+                return sum / numElements;
+			else
+				return -TeMAXFLOAT;
+		}
+
+		//! Weight Average of Nearest Neighbors. If an error occur returns -TeMAXFLOAT
+		double distWeightAvgNearestNeighbor(const kdKey& key, const unsigned int& numberOfNeighbors, const int& powValue)
+		{
+			vector<kdDataItem> report;
+			vector<double> sqrDists;
+
+			fillNNVector(report, numberOfNeighbors);
+
+			kd_.nearestNeighborSearch(key, report, sqrDists, numberOfNeighbors);
+
+			double num = 0.0;
+			double den = 0.0;
+
+			if(powValue == 1.0)
+			{
+				for(unsigned int i = 0; i < numberOfNeighbors; ++i)
+				{
+					if(sqrDists[i] >= TeMAXFLOAT)
+						continue;
+
+					if(sqrDists[i] == 0.0)
+						return report[i].value();
+
+					double wi = 1.0 / (sqrt(sqrDists[i]));
+
+					num += (wi * report[i].value());
+					den += wi;
+				}
+			}
+			else if(powValue == 2.0)
+			{
+				for(unsigned int i = 0; i < numberOfNeighbors; ++i)
+				{
+					if(sqrDists[i] >= TeMAXFLOAT)
+						continue;
+
+					if(sqrDists[i] == 0.0)
+						return report[i].value();
+
+					double wi = 1.0 / (sqrDists[i]);
+
+					num += (wi * report[i].value());
+					den += wi;
+				}
+			}
+			else
+			{
+				for(unsigned int i = 0; i < numberOfNeighbors; ++i)
+				{
+					if(sqrDists[i] >= TeMAXFLOAT)
+						continue;
+
+					if(sqrDists[i] == 0.0)
+						return report[i].value();
+
+					double wi = 1.0 / pow(sqrt(sqrDists[i]), powValue);
+
+					num += (wi * report[i].value());
+					den += wi;
+				}
+			}
+
+			if(den != 0.0)
+                return num / den;
+			else
+				return -TeMAXFLOAT;
+		}
+
+		//! Simple Average of Elements in Box. If an error occur returns -TeMAXFLOAT
+		double boxAvg(const TeBox& box)
+		{
+			vector<kdNode*> report;
+
+			kd_.search(box, report);
+
+			unsigned int numberOfNodes = report.size();
+
+			unsigned int numElements = 0;
+
+			double sum = 0.0;
+
+			for(unsigned int i = 0; i < numberOfNodes; ++i)
+			{
+				unsigned int nodeSize = report[i]->getData().size();
+
+				for(unsigned int j = 0; j < nodeSize; ++j)
+				{
+					if(TeIntersects(report[i]->getData()[j].location(), box))
+					{
+                        sum += report[i]->getData()[j].value();
+						++numElements;
+					}
+				}				
+			}
+
+			if(numElements > 0)
+                return sum / double(numElements);
+			else
+				return -TeMAXFLOAT;
+		}
+
+		//! Distance Weight Average of Elements in Box. If an error occur returns -TeMAXFLOAT
+		double boxDistWeightAvg(const kdKey& key, const TeBox& box, const int& powValue)
+		{
+			vector<kdNode*> report;
+
+			kd_.search(box, report);
+
+			unsigned int numberOfNodes = report.size();
+
+			double num = 0.0;
+			double den = 0.0;
+
+			for(unsigned int i = 0; i < numberOfNodes; ++i)
+			{
+				unsigned int nodeSize = report[i]->getData().size();
+
+				for(unsigned int j = 0; j < nodeSize; ++j)
+				{
+					if(TeIntersects(report[i]->getData()[j].location(), box))
+					{
+						double wi = 1 / pow(TeDistance(key, report[i]->getData()[j].location()), powValue);
+						
+						num += wi * report[i]->getData()[j].value();
+						den += wi;
+					}
+				}				
+			}
+
+			if(den != 0.0)
+                return num / den;
+			else
+				return -TeMAXFLOAT;
+		}
+
+	protected:
+
+		//! Fills the nearest neighbour vector with default values
+		void fillNNVector(vector<kdDataItem>& report, const unsigned int& numberOfNeighbors) const
+		{
+			for(unsigned int i = 0; i < numberOfNeighbors; ++i)
+			{
+				TeCoord2D c(TeMAXFLOAT, TeMAXFLOAT);
+				kdDataItem item(c, -TeMAXFLOAT);
+
+				report.push_back(item);
+			}
+		}
+
+	private:
+
+		//! No copy allowed
+		TeInterpolationAlgorithms(const TeInterpolationAlgorithms& rhs);
+
+		//! No copy allowed
+		TeInterpolationAlgorithms& operator=(const TeInterpolationAlgorithms& rhs);		
+};
+
+
+
+//! Interpolates a cell theme
+/*
+		\param inputTheme			The theme with samples to be used: samples are treated as a layer of points with a column with a value (double or integer)
+		\param inputAttrTableName   Theme table with samples
+		\param sampleColumnName     Table column with sample values: must be int or double values
+		\param outputTheme          The theme where output will be stored: this theme must already exist
+		\param outputAttrTableName  Theme table where output will be stored: this table must already exist
+		\param outputColumnName     Table column where data will be stored: this column must already exist
+		\param algorithm		    Type of algorithm to be used: see enum TeInterpolationAlgorithm
+		\param numberOfNeighbors    Number of nearest neighbor to be used in interpolation
+		\param powValue			    Pow parameter for inverse distance function
+		\param boxRatio				Ratio of the box used to search samples
+		\return TRUE if there isn't an error during interpolation otherwise return FALSE
+ */
+bool TeCellInterpolate(TeTheme* inputTheme, const string& inputAttrTableName, const string& sampleColumnName,
+                       TeTheme* outputTheme, const string& outputAttrTableName, const string& outputColumnName,
+				       const TeInterpolationAlgorithm& algorithm = TeNNInterpolation,
+                       const unsigned int& numberOfNeighbors = 1, const int& powValue = 1, const double& boxRatio = 1.0);
+
+//! Interpolates a a raster
+/*
+		\param inputTheme			The theme with samples to be used: samples are treated as a layer of points with a column with a value (double or integer)
+		\param inputAttrTableName   Theme table with samples
+		\param sampleColumnName     Table column with sample values
+		\param outputRaster         A pointer to a raster where interpolated data will be stored: this raster mus already exist
+		\param band                 The band to be interpolated
+		\param algorithm		    Type of algorithm to be used: see enum TeInterpolationAlgorithm
+		\param numberOfNeighbors    Number of nearest neighbor to be used in interpolation
+		\param powValue			    Pow parameter for inverse distance function
+		\param boxRatio				Ratio of the box used to search samples
+		\return TRUE if there isn't an error during interpolation otherwise return FALSE
+ */
+bool TeRasterInterpolate(TeTheme* inputTheme, const string& inputAttrTableName, const string& sampleColumnName,
+                         TeRaster* outputRaster, const int& band = 0,
+				         const TeInterpolationAlgorithm& algorithm = TeNNInterpolation,
+                         const unsigned int& numberOfNeighbors = 1, const int& powValue = 1, const double& boxRatio = 1.0);
+
+		
+
+/** @} */ 
+
+
+
+
+#endif	// __TERRALIB_INTERNAL_INTERPOLATION_H
+
+
+
+
diff --git a/src/terralib/functions/TeLayerFunctions.cpp b/src/terralib/functions/TeLayerFunctions.cpp
old mode 100755
new mode 100644
index 9172ea4..82f37ca
--- a/src/terralib/functions/TeLayerFunctions.cpp
+++ b/src/terralib/functions/TeLayerFunctions.cpp
@@ -1,1103 +1,1187 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeLayerFunctions.h"
-#include "TeImportRaster.h"
-#include "TeProgress.h"
-#include "TeRaster.h"
-#include "TeExternalTheme.h"
-#include "TeDatabaseUtils.h"
-
-
-bool TeCopyThemeToLayer(TeTheme* inTheme, TeLayer* outLayer, 
-							int selObj, map<string,string> *txtTable)
-{
-	if (!inTheme || !outLayer)
-		return false;
-
-	TeLayer* inLayer = inTheme->layer();
-	// both projection should be valid
-	// do not allow only one NoProjection 
-	TeProjection* pfrom = TeProjectionFactory::make(inTheme->layer()->projection()->params());
-	TeProjection* pto = TeProjectionFactory::make(outLayer->projection()->params());
-
-	if (!(*pfrom == *pto))
-	{
-		if (pfrom->name() == "NoProjection" || pto->name() == "NoProjection")
-		{
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-	}
-
-	TeDatabasePortal* portal = inLayer->database()->getPortal();
-	if (!portal)
-		return false;
-
-	string sql;
-	TeGeomRep rep = static_cast<TeGeomRep>(inLayer->geomRep());
-	if (rep & TeRASTER)
-	{
-		TeRepresentation* rep = inLayer->getRepresentation(TeRASTER);
-		sql = "SELECT object_id FROM " + rep->tableName_;
-		if (portal->query(sql))
-		{
-			string objid;
-			TeRasterParams par;
-			TeRaster* rst;
-			while (portal->fetchRow())
-			{
-				objid = portal->getData(0);
-				rst = inLayer->raster(objid);
-				par = rst->params();
-				if (!TeImportRaster(outLayer,rst,par.blockWidth_,par.blockHeight_,par.compression_[0],
-									 objid,par.dummy_[0],par.useDummy_,par.tiling_type_))
-				{
-					delete pfrom;
-					delete pto;
-					delete portal;
-					return false;
-				}
-			}
-		}
-		// build the spatial index in the raster table
-		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeRASTER);
-		outLayer->database()->insertMetadata(outLayer->tableName(TeRASTER), spatialColumn, 0.0005,0.0005,outLayer->box());
-		outLayer->database()->createSpatialIndex(outLayer->tableName(TeRASTER), spatialColumn, (TeSpatialIndexType)TeRTREE);
-		portal->freeResult();
-	}
-
-	if (rep & TeRASTERFILE)
-	{
-		TeRepresentation* rep = inLayer->getRepresentation(TeRASTERFILE);
-		if (rep)
-		{
-			string inRepTableName = rep->tableName_;
-			rep->tableName_ = "RasterLayer" + Te2String(outLayer->id());
-			if (outLayer->database()->insertRepresentation(outLayer->id(),*rep))
-			{
-				sql = "INSERT INTO " + rep->tableName_ + " (object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type) ";
-				sql += " SELECT object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type FROM " + inRepTableName;
-				outLayer->database()->execute(sql);
-			}
-		}
-	}
-	
-	// check if there is any other vectorial representation
-	if (!((rep & TePOLYGONS) || (rep & TeLINES) || 
-		  (rep & TePOINTS)   || (rep & TeCELLS) ||
-		  (rep & TeTEXT)))
-	{
-		delete pfrom;
-		delete pto;
-		delete portal;
-		return true;
-	}
-
-	// this SQL selects instances of objects according to input, so it uses te_collection_aux
-	string inputInst;
-	// this SQL selects objects according to input, so it uses te_collection
-	string inputObj; 
-	if(selObj == 1) // queried
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 2";
-		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 2";
-		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
-	}
-	else if(selObj == 2) // pointed
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 1";
-		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 1";
-		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
-	}
-	else if(selObj == 3) // not queried
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status <> 2";
-		inputObj += " AND " + inTheme->collectionTable() + ".c_object_status <> 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status <> 2";
-		inputInst += " AND " + inTheme->collectionAuxTable() + ".grid_status <> 3)";
-	}
-	else if(selObj == 4) // not pointed
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status <> 1";
-		inputObj += " AND " + inTheme->collectionTable() + ".c_object_status <> 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status <> 1";
-		inputInst += " AND " + inTheme->collectionAuxTable() + ".grid_status <> 3)";
-	}
-	else if(selObj == 5) // pointed and queried
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 3)";
-	}
-	else if(selObj == 6) // pointed or queried
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 2";
-		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 1";
-		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 2";
-		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 1";
-		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
-	}
-	// Initally test if there is any object selected
-	sql = "SELECT c_object_id FROM " + inTheme->collectionTable();
-	if (!inputObj.empty())
-		sql += " WHERE " + inputObj;
-	if (!portal->query(sql))
-	{
-		delete portal;
-		delete pfrom;
-		delete pto;
-		return false; // error!
-	}
-	if (!portal->fetchRow())
-	{
-		delete portal;
-		delete pfrom;
-		delete pto;
-		return true; // there is no object selected
-	}
-	portal->freeResult();
-
-	unsigned int n = 1;
-	if (inLayer->hasGeometry(TePOINTS))
-	{
-		sql = "SELECT " + inLayer->tableName(TePOINTS) + ".* FROM ";
-		sql += inLayer->tableName(TePOINTS) + ", " + inTheme->collectionTable();
-		sql += " WHERE object_id = c_object_id";
-		if (!inputObj.empty())
-			sql += " AND " + inputObj;
-
-		if (!portal->query(sql))
-		{
-			delete portal;
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-		if (portal->fetchRow())
-			TeCopyPortalGeometriesToLayer<TePointSet>(portal,pfrom,outLayer);
-		portal->freeResult(); 
-
-		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TePOINTS);
-		outLayer->database()->insertMetadata(outLayer->tableName(TePOINTS), spatialColumn, 0.0005,0.0005,outLayer->box());
-		outLayer->database()->createSpatialIndex(outLayer->tableName(TePOINTS), spatialColumn, (TeSpatialIndexType)TeRTREE);
-	}
-	
-	if (inLayer->hasGeometry(TeLINES))
-	{
-		sql = "SELECT " + inLayer->tableName(TeLINES) + ".* FROM ";
-		sql += inLayer->tableName(TeLINES) + ", " + inTheme->collectionTable();
-		sql += " WHERE object_id = c_object_id";
-		if (!inputObj.empty())
-			sql += " AND " + inputObj;
-		sql += " ORDER BY ext_max DESC";
-
-		if (!portal->query(sql))
-		{
-			delete portal;
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-		if (portal->fetchRow())
-			TeCopyPortalGeometriesToLayer<TeLineSet>(portal,pfrom,outLayer);
-		portal->freeResult(); 
-
-		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeLINES);
-		outLayer->database()->insertMetadata(outLayer->tableName(TeLINES), spatialColumn, 0.0005,0.0005,outLayer->box());
-		outLayer->database()->createSpatialIndex(outLayer->tableName(TeLINES), spatialColumn, (TeSpatialIndexType)TeRTREE);
-	}
-	if (inLayer->hasGeometry(TePOLYGONS))
-	{
-		sql = "SELECT " + inLayer->tableName(TePOLYGONS) + ".* FROM ";
-		sql += inLayer->tableName(TePOLYGONS) + ", " + inTheme->collectionTable();
-		sql += " WHERE object_id = c_object_id";
-		if (!inputObj.empty())
-			sql += " AND " + inputObj;
-
-		if (inLayer->database()->dbmsName() != "OracleSpatial" && inLayer->database()->dbmsName() != "PostGIS")
-			sql += " ORDER BY object_id ASC, parent_id ASC, num_holes DESC";
-		else
-			sql += " ORDER BY object_id ASC"; 
-
-		if (!portal->query(sql))
-		{
-			delete portal;
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-		if (portal->fetchRow())
-			TeCopyPortalGeometriesToLayer<TePolygonSet>(portal,pfrom,outLayer);
-		portal->freeResult(); 
-
-		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TePOLYGONS);
-		outLayer->database()->insertMetadata(outLayer->tableName(TePOLYGONS), spatialColumn, 0.0005,0.0005,outLayer->box());
-		outLayer->database()->createSpatialIndex(outLayer->tableName(TePOLYGONS), spatialColumn, (TeSpatialIndexType)TeRTREE);
-	}
-
-	if (inLayer->hasGeometry(TeCELLS))
-	{
-		sql = "SELECT " + inLayer->tableName(TeCELLS) + ".* FROM ";
-		sql += inLayer->tableName(TeCELLS) + ", " + inTheme->collectionTable();
-		sql += " WHERE object_id = c_object_id";
-		if (!inputObj.empty())
-			sql += " AND " + inputObj;
-
-		if (!portal->query(sql))
-		{
-			delete portal;
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-		if (portal->fetchRow())
-			TeCopyPortalGeometriesToLayer<TeCellSet>(portal,pfrom,outLayer);
-		portal->freeResult(); 
-
-		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeCELLS);
-		outLayer->database()->insertMetadata(outLayer->tableName(TeCELLS), spatialColumn, 0.0005,0.0005,outLayer->box());
-		outLayer->database()->createSpatialIndex(outLayer->tableName(TeCELLS), spatialColumn, (TeSpatialIndexType)TeRTREE);
-		
-	}
-
-	if (inLayer->hasGeometry(TeTEXT))
-	{
-		unsigned int j;
-		vector<string> textTables;
-		vector<string> textDescr;
-		string selrep = "SELECT geom_table, description FROM te_representation WHERE layer_id = " + Te2String(inLayer->id());
-		selrep += " AND geom_type = " + Te2String(TeTEXT);
-		if (portal->query(selrep))
-		{
-			while(portal->fetchRow())
-			{
-				textTables.push_back(portal->getData(0));
-				textDescr.push_back(portal->getData(1));
-			}
-		}
-		portal->freeResult();
-
-		int k=1;
-		for (j=0; j<textTables.size(); j++)
-		{
-			string newTextTable = textTables[j] + "_1";
-			while (inLayer->database()->tableExist(newTextTable))
-			{
-				k++;
-				newTextTable = textTables[j] + "_" + Te2String(k);
-			}
-			sql = "SELECT DISTINCT " + textTables[j] + ".* FROM ";
-			sql += textTables[j] + ", " + inTheme->collectionTable();
-			sql += " WHERE object_id = c_object_id OR object_id = 'TE_NONE_ID'";
-			if(inputObj.empty() == false)
-				sql += " AND " + inputObj;
-			if (!portal->query(sql))
-			{
-				delete portal;
-				delete pfrom;
-				delete pto;
-				return false;
-			}
-			if (portal->fetchRow())
-			{
-				if (!outLayer->addGeometry(TeTEXT,newTextTable,textDescr[j]))
-				{
-					delete portal;
-					delete pfrom;
-					delete pto;
-					return false;
-				}
-				TeCopyPortalGeometriesToLayer<TeTextSet>(portal,pfrom,outLayer,newTextTable);
-				if (txtTable)
-				{
-					(*txtTable)[textTables[j]] = newTextTable;
-				}
-			}
-			portal->freeResult();
-		}
-	}
-	delete pfrom;
-	delete pto;
-	portal->freeResult();
-
-	TeAttrTableVector attributeTables;
-	inTheme->getAttTables(attributeTables);
-	sql = "SELECT table_id FROM te_theme_table WHERE theme_id = ";
-	bool hasExternal = false;
-	sql += Te2String(inTheme->id()) + " AND relation_id > 0";
-	if (portal->query(sql) && portal->fetchRow())
-		hasExternal = true;
-	portal->freeResult();
-
-	for (unsigned int i=0; i<attributeTables.size(); i++)
-	{
-		TeTable table = attributeTables[i];
-		if ((table.tableType() == TeAttrExternal) || table.attributeList().size() <= 0)
-			continue;
-
-		TeAttributeList attListIn = table.attributeList();
-		table.setId(-1);
-		n = 1;
-		string tname = table.name();
-		string tlinkqueattr = table.linkName();
-		while (true)
-		{
-			if (!outLayer->database()->tableExist(tname))
-				break;
-			n++;
-			tname = table.name() + "_" + Te2String(n);
-		}
-		string tfrom = table.name();
-		table.name(tname);
-		if (!outLayer->createAttributeTable(table))
-		{
-			delete portal;
-			return false;
-		}
-		string fieldsIn;
-		string fieldsOut;
-		vector<string> attNamesIn;
-		vector<string> attNamesOut;
-		table.attributeNames(attNamesOut);
-		for (n=0;n<attNamesOut.size()-1; n++)
-		{
-			fieldsOut += attNamesOut[n] + ",";
-			fieldsIn += tfrom + "." + attListIn[n].rep_.name_ + ",";
-		}
-		fieldsOut += attNamesOut[n];
-		fieldsIn += tfrom + "." + attListIn[n].rep_.name_;
-
-		if (!hasExternal)	// table might have temporal instances 
-		{
-			sql = "SELECT " + fieldsIn + " ";
-			sql += inTheme->sqlGridFrom();
-			if (!inputInst.empty())
-				sql += " WHERE " + inputInst;
-		}
-		else				// table doesn�t have temporal instances 
-		{
-			sql = "SELECT " + fieldsIn + " FROM " +  tfrom;
-			sql += ", " + inTheme->collectionTable() + " WHERE ";
-			sql += tfrom + "." + tlinkqueattr + "=" + inTheme->collectionTable() + ".c_object_id";
-			if (!inputObj.empty())
-				sql += " AND " + inputObj;
-		}
-
-		if (inLayer->database() == outLayer->database())
-		{
-			string popule = "INSERT INTO " + table.name() + " ( " + fieldsOut + ") " + sql;
-			inLayer->database()->execute(popule);
-		}
-		else
-		{
-			if (portal->query(sql))
-			{
-				int nr = 0;
-				while (portal->fetchRow())
-				{
-					TeTableRow row;
-					for(int i = 0; i < portal->numFields(); i++)
-						row.push_back(portal->getData(i));
-					table.add(row);
-					nr++;
-					if (nr % 100)
-					{
-						if (!outLayer->saveAttributeTable(table))
-						{
-							delete portal;							
-							return false;
-						}
-						table.clear();
-						nr = 0;
-					}
-				}
-				if (table.size() >0)
-				{
-					if (!outLayer->saveAttributeTable(table))
-					{
-						delete portal;							
-						return false;
-					}
-				}
-				table.clear();
-			}
-		}
-		portal->freeResult();
-	}
-	delete portal;
-	return true;
-}
-
-bool TeCopyLayerToLayer(TeLayer* inLayer, TeLayer* outLayer, map<string,string> *txtTable)
-{
-	if (!inLayer || !outLayer)
-		return false;
-
-	// both projection should be valid
-	// do not allow only one NoProjection 
-	TeProjection* pfrom = TeProjectionFactory::make(inLayer->projection()->params());
-	TeProjection* pto   = TeProjectionFactory::make(outLayer->projection()->params());
-	if (!(*pfrom == *pto))
-	{
-		if (pfrom->name() == "NoProjection" || pto->name() == "NoProjection")
-		{
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-	}
-
-	TeDatabasePortal* portal = inLayer->database()->getPortal();
-	if (!portal)
-	{
-		delete pfrom;
-		delete pto;
-		return false;
-	}
-
-	string sql;
-	bool res;
-	if (inLayer->hasGeometry(TeRASTER))
-	{
-		TeRepresentation* rep = inLayer->getRepresentation(TeRASTER);
-		sql = "SELECT object_id FROM " + rep->tableName_;
-		if (portal->query(sql))
-		{
-			string objid;
-			TeRasterParams par;
-			TeRaster* rst;
-			while (portal->fetchRow())
-			{
-				objid = portal->getData(0);
-				rst = inLayer->raster(objid);
-				par = rst->params();
-				res = TeImportRaster(outLayer,rst,par.blockWidth_,par.blockHeight_,par.compression_[0],
-									 objid,par.dummy_[0],par.useDummy_,par.tiling_type_);
-			}
-		}
-		portal->freeResult();
-	}
-
-	if (inLayer->hasGeometry(TeRASTERFILE)) // TODO : check the case when the databases are in different DBMS
-	{
-		TeRepresentation* rep = inLayer->getRepresentation(TeRASTERFILE);
-		if (rep)
-		{
-			string inRepTableName = rep->tableName_;
-			rep->tableName_ = "RasterLayer" + Te2String(outLayer->id());
-			if (outLayer->database()->insertRepresentation(outLayer->id(),*rep))
-			{
-				sql = "INSERT INTO " + rep->tableName_ + " (object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type) ";
-				sql += " SELECT object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type FROM " + inRepTableName;
-				outLayer->database()->execute(sql);
-			}
-		}
-	}
-
-	unsigned int	n = 1;
-	if (inLayer->hasGeometry(TePOINTS))
-	{
-		sql = "SELECT " + inLayer->tableName(TePOINTS) + ".* FROM ";
-		sql += inLayer->tableName(TePOINTS);
-		if (!portal->query(sql))
-		{
-			delete portal;
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-		if (portal->fetchRow())
-				TeCopyPortalGeometriesToLayer<TePointSet>(portal,pfrom,outLayer);
-		portal->freeResult(); 
-	}
-	
-	if (inLayer->hasGeometry(TeLINES))
-	{
-		sql = "SELECT " + inLayer->tableName(TeLINES) + ".* FROM ";
-		sql += inLayer->tableName(TeLINES);
-		sql += " ORDER BY ext_max DESC";
-
-		if (!portal->query(sql))
-		{
-			delete portal;
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-		if (portal->fetchRow())
-			TeCopyPortalGeometriesToLayer<TeLineSet>(portal,pfrom,outLayer);
-		portal->freeResult(); 
-	}
-	if (inLayer->hasGeometry(TePOLYGONS))
-	{
-		sql = "SELECT " + inLayer->tableName(TePOLYGONS) + ".* FROM ";
-		sql += inLayer->tableName(TePOLYGONS);
-		if (inLayer->database()->dbmsName() != "OracleSpatial" && inLayer->database()->dbmsName() != "PostGIS")
-			sql += " ORDER BY object_id ASC, parent_id ASC, num_holes DESC";
-		else
-			sql += " ORDER BY object_id ASC"; 
-
-		if (!portal->query(sql))
-		{
-			delete portal;
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-		if (portal->fetchRow())
-			TeCopyPortalGeometriesToLayer<TePolygonSet>(portal,pfrom,outLayer);
-		portal->freeResult(); 
-	}
-
-	if (inLayer->hasGeometry(TeCELLS))
-	{
-		sql = "SELECT " + inLayer->tableName(TeCELLS) + ".* FROM ";
-		sql += inLayer->tableName(TeCELLS) ;
-
-		if (!portal->query(sql))
-		{
-			delete portal;
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-		if (portal->fetchRow())
-			TeCopyPortalGeometriesToLayer<TeCellSet>(portal,pfrom,outLayer);
-		portal->freeResult(); 
-	}
-	if (inLayer->hasGeometry(TeTEXT))
-	{
-		unsigned int j;
-		vector<string> textTables;
-		vector<string> textDescr;
-		string selrep = "SELECT geom_table, description FROM te_representation WHERE layer_id = " + Te2String(inLayer->id());
-		selrep += " AND geom_type = " + Te2String(TeTEXT);
-		if (portal->query(selrep))
-		{
-			while(portal->fetchRow())
-			{
-				textTables.push_back(portal->getData(0));
-				textDescr.push_back(portal->getData(1));
-			}
-		}
-		portal->freeResult();
-
-		int k=1;
-		for (j=0; j<textTables.size(); j++)
-		{
-			string newTextTable = textTables[j] + "_1";
-			while (inLayer->database()->tableExist(newTextTable))
-			{
-				k++;
-				newTextTable = textTables[j] + "_" + Te2String(k);
-			}
-			sql = "SELECT " + textTables[j] + ".* FROM ";
-			sql += textTables[j] ;
-			if (!portal->query(sql))
-			{
-				delete portal;
-				delete pfrom;
-				delete pto;
-				return false;
-			}
-			
-			if (portal->fetchRow())
-			{
-				if (!outLayer->addGeometry(TeTEXT,newTextTable,textDescr[j]))
-				{
-					delete portal;
-					delete pfrom;
-					delete pto;
-					return false;
-				}
-				TeCopyPortalGeometriesToLayer<TeTextSet>(portal,pfrom,outLayer,newTextTable);
-				if (txtTable)
-				{
-					(*txtTable)[textTables[j]] = newTextTable;
-				}
-			}
-			portal->freeResult();
-		}
-	}
-	delete pfrom;
-	delete pto;
-	portal->freeResult();
-
-	vector<TeTable> attributeTables;
-	inLayer->getAttrTables(attributeTables);
-	for (unsigned int i=0; i<attributeTables.size(); i++)
-	{
-		TeTable table = attributeTables[i];
-		if (table.attributeList().size() <= 0)
-			continue;
-
-		TeAttributeList attListIn = table.attributeList();
-		table.setId(-1);
-		n = 1;
-		string tname = table.name();
-		while (true)
-		{
-			if (!outLayer->database()->tableExist(tname))
-				break;
-			n++;
-			tname = table.name() + "_" + Te2String(n);
-		}
-		string tfrom = table.name();
-		table.name(tname);
-		if (outLayer->createAttributeTable(table))
-		{
-			if (inLayer->database() == outLayer->database())
-			{
-				string fieldsIn;
-				string fieldsOut;
-				vector<string> attNamesIn;
-				vector<string> attNamesOut;
-				table.attributeNames(attNamesOut);
-				for (n=0;n<attNamesOut.size()-1; n++)
-				{
-					fieldsOut += "`" + attNamesOut[n] + "`,";
-					fieldsIn += attListIn[n].rep_.name_ + ",";
-				}
-				fieldsOut += "`" + attNamesOut[n]+ "`";
-				fieldsIn += attListIn[n].rep_.name_;
-
-				sql = "SELECT " + fieldsIn + " FROM " + tfrom;
-				string popule = "INSERT INTO " + table.name() + " ( " + fieldsOut + ") " + sql;
-				inLayer->database()->execute(popule);
-			}
-			else
-			{
-				portal->freeResult();
-				sql = "SELECT * FROM " + tfrom;
-				if (portal->query(sql))
-				{
-					int nr = 0;
-					while (portal->fetchRow())
-					{
-						TeTableRow row;
-						for(int i = 0; i < portal->numFields(); i++)
-						{
-							if (table.attributeList()[i].rep_.type_== TeDATETIME)
-							{
-								TeTime t = portal->getDate(i);
-								string temp = t.getDateTime(table.attributeList()[i].dateTimeFormat_,table.attributeList()[i].dateSeparator_, table.attributeList()[i].timeSeparator_);
-								row.push_back(temp);
-							}
-							else
-								row.push_back(portal->getData(i));
-						}
-						table.add(row);
-						nr++;
-						if (nr % 100)
-						{
-							outLayer->saveAttributeTable(table);
-							table.clear();
-							nr = 0;
-						}
-					}
-					if (table.size() >0)
-						outLayer->saveAttributeTable(table);
-					table.clear();
-				}
-			}
-			portal->freeResult();
-		}
-	}	
-	delete portal;
-	return true;
-}
-
-bool TeCopyExternThemeToLayer(TeTheme* inTheme, TeLayer* outLayer, 
-							int selObj, map<string,string>*)
-{
-	if (!inTheme || !outLayer)
-		return false;
-
-	TeLayer* inLayer = ((TeExternalTheme*)(inTheme))->getRemoteTheme()->layer();
-	// both projection should be valid
-	// do not allow only one NoProjection 
-	TeProjection* pfrom = TeProjectionFactory::make(inLayer->projection()->params());
-	TeProjection* pto = TeProjectionFactory::make(outLayer->projection()->params());
-
-	if (!(*pfrom == *pto))
-	{
-		if (pfrom->name() == "NoProjection" || pto->name() == "NoProjection")
-		{
-			delete pfrom;
-			delete pto;
-			return false;
-		}
-	}
-
-	TeDatabasePortal* inPortal = inLayer->database()->getPortal();
-	if (!inPortal)
-		return false;
-
-	string sql;
-	TeGeomRep rep = static_cast<TeGeomRep>(inLayer->geomRep());
-	if (rep & TeRASTER)
-	{
-		TeRepresentation* rep = inLayer->getRepresentation(TeRASTER);
-		sql = "SELECT object_id FROM " + rep->tableName_;
-		if (inPortal->query(sql))
-		{
-			string objid;
-			TeRasterParams par;
-			TeRaster* rst;
-			while (inPortal->fetchRow())
-			{
-				objid = inPortal->getData(0);
-				rst = inLayer->raster(objid);
-				par = rst->params();
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-				if (!TeImportRaster(outLayer,rst,par.blockWidth_,par.blockHeight_,par.compression_[0],
-									 objid,par.dummy_[0],par.useDummy_,par.tiling_type_))
-				{
-					delete pfrom;
-					delete pto;
-					delete inPortal;
-					return false;
-				}
-			}
-		}
-		// build the spatial index in the raster table
-		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeRASTER);
-		outLayer->database()->insertMetadata(outLayer->tableName(TeRASTER), spatialColumn, 0.0005,0.0005,outLayer->box());
-		outLayer->database()->createSpatialIndex(outLayer->tableName(TeRASTER), spatialColumn, (TeSpatialIndexType)TeRTREE);
-		inPortal->freeResult();
-	}
-
-	if (rep & TeRASTERFILE)
-	{
-		TeRepresentation* rep = inLayer->getRepresentation(TeRASTERFILE);
-		if (rep)
-		{
-			string inRepTableName = rep->tableName_;
-			rep->tableName_ = "RasterLayer" + Te2String(outLayer->id());
-			if (outLayer->database()->insertRepresentation(outLayer->id(),*rep))
-			{
-				sql = "INSERT INTO " + rep->tableName_ + " (object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type) ";
-				sql += " SELECT object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type FROM " + inRepTableName;
-				outLayer->database()->execute(sql);
-			}
-		}
-	}
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-	
-	// check if there is any other vectorial representation
-	if (!((rep & TePOLYGONS) || (rep & TeLINES) || 
-		  (rep & TePOINTS)   || (rep & TeCELLS) ||
-		  (rep & TeTEXT)))
-	{
-		delete pfrom;
-		delete pto;
-		delete inPortal;
-		return true;
-	}
-
-	// this SQL selects instances of objects according to input, so it uses te_collection_aux
-	string inputInst;
-	// this SQL selects objects according to input, so it uses te_collection
-	string inputObj; 
-	vector<string> objectVec;
-	vector<string> itemVec;
-	map<string, int>::iterator it;
-	string extCollTable = ((TeExternalTheme*)(inTheme))->getRemoteTheme()->collectionTable();
-	string not_string;
-
-	if(selObj == 0) // all collection
-	{
-		objectVec = getObjects(inTheme, TeAll);
-		itemVec = getItems(inTheme, TeAll);
-	}
-	else if(selObj == 1) // queried
-	{
-		objectVec = getObjects(inTheme, TeSelectedByQuery);
-		itemVec = getItems(inTheme, TeSelectedByQuery);
-	}
-	else if(selObj == 2) // pointed
-	{
-		objectVec = getObjects(inTheme, TeSelectedByPointing);
-		itemVec = getItems(inTheme, TeSelectedByPointing);
-	}
-	else if(selObj == 3) // not queried
-	{
-		objectVec = getObjects(inTheme, TeNotSelectedByQuery);
-		itemVec = getItems(inTheme, TeNotSelectedByQuery);
-	}
-	else if(selObj == 4) // not pointed
-	{
-		objectVec = getObjects(inTheme, TeNotSelectedByPointing);
-		itemVec = getItems(inTheme, TeNotSelectedByPointing);
-	}
-	else if(selObj == 5) // pointed and queried
-	{
-		objectVec = getObjects(inTheme, TeSelectedByPointingAndQuery);
-		itemVec = getItems(inTheme, TeSelectedByPointingAndQuery);
-	}
-	else if(selObj == 6) // pointed or queried
-	{
-		objectVec = getObjects(inTheme, TeSelectedByPointingOrQuery);
-		itemVec = getItems(inTheme, TeSelectedByPointingOrQuery);
-	}
-	if (objectVec.empty())
-	{
-		delete inPortal;
-		delete pfrom;
-		delete pto;
-		return true; // there is no object selected
-	}
-  
-  std::vector< std::string >::iterator it_begin = objectVec.begin();
-  std::vector< std::string >::iterator it_end = objectVec.end();
-
-	vector<string> svec = generateInClauses(it_begin, it_end, inLayer->database());
-	unsigned int n = 1;
-	vector<string>::iterator sit;
-	inPortal->freeResult();
-
-	if (inLayer->hasGeometry(TePOINTS))
-	{
-		sql = "SELECT " + inLayer->tableName(TePOINTS) + ".* FROM ";
-		sql += inLayer->tableName(TePOINTS);
-		for(sit=svec.begin(); sit!=svec.end(); ++sit)
-		{
-			string s = sql + " WHERE object_id " + not_string + " IN " + *sit;
-		
-			if (!inPortal->query(s))
-			{
-				delete inPortal;
-				delete pfrom;
-				delete pto;
-				return false;
-			}
-			if (inPortal->fetchRow())
-				TeCopyPortalGeometriesToLayer<TePointSet>(inPortal,pfrom,outLayer);
-			inPortal->freeResult(); 
-		}
-
-		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TePOINTS);
-		outLayer->database()->insertMetadata(outLayer->tableName(TePOINTS), spatialColumn, 0.0005,0.0005,outLayer->box());
-		outLayer->database()->createSpatialIndex(outLayer->tableName(TePOINTS), spatialColumn, (TeSpatialIndexType)TeRTREE);
-	}
-	
-	if (inLayer->hasGeometry(TeLINES))
-	{
-		sql = "SELECT " + inLayer->tableName(TeLINES) + ".* FROM ";
-		sql += inLayer->tableName(TeLINES);
-		for(sit=svec.begin(); sit!=svec.end(); ++sit)
-		{
-			string s = sql + " WHERE object_id IN " + *sit;
-			s += " ORDER BY ext_max DESC";
-
-			if (!inPortal->query(s))
-			{
-				delete inPortal;
-				delete pfrom;
-				delete pto;
-				return false;
-			}
-			if (inPortal->fetchRow())
-				TeCopyPortalGeometriesToLayer<TeLineSet>(inPortal,pfrom,outLayer);
-			inPortal->freeResult(); 
-		}
-
-		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeLINES);
-		outLayer->database()->insertMetadata(outLayer->tableName(TeLINES), spatialColumn, 0.0005,0.0005,outLayer->box());
-		outLayer->database()->createSpatialIndex(outLayer->tableName(TeLINES), spatialColumn, (TeSpatialIndexType)TeRTREE);
-	}
-	if (inLayer->hasGeometry(TePOLYGONS))
-	{
-		sql = "SELECT " + inLayer->tableName(TePOLYGONS) + ".* FROM ";
-		sql += inLayer->tableName(TePOLYGONS);
-		for(sit=svec.begin(); sit!=svec.end(); ++sit)
-		{
-			string s = sql + " WHERE object_id IN " + *sit;
-			if (inLayer->database()->dbmsName() != "OracleSpatial" && inLayer->database()->dbmsName() != "PostGIS")
-				s += " ORDER BY object_id ASC, parent_id ASC, num_holes DESC";
-			else
-				s += " ORDER BY object_id ASC"; 
-
-			if (!inPortal->query(s))
-			{
-				delete inPortal;
-				delete pfrom;
-				delete pto;
-				return false;
-			}
-			if (inPortal->fetchRow())
-				TeCopyPortalGeometriesToLayer<TePolygonSet>(inPortal,pfrom,outLayer);
-			inPortal->freeResult(); 
-		}
-
-		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TePOLYGONS);
-		outLayer->database()->insertMetadata(outLayer->tableName(TePOLYGONS), spatialColumn, 0.0005,0.0005,outLayer->box());
-		outLayer->database()->createSpatialIndex(outLayer->tableName(TePOLYGONS), spatialColumn, (TeSpatialIndexType)TeRTREE);
-	}
-
-	if (inLayer->hasGeometry(TeCELLS))
-	{
-		sql = "SELECT " + inLayer->tableName(TeCELLS) + ".* FROM ";
-		sql += inLayer->tableName(TeCELLS);
-		for(sit=svec.begin(); sit!=svec.end(); ++sit)
-		{
-			string s = sql + " WHERE object_id IN " + *sit;
-
-			if (!inPortal->query(s))
-			{
-				delete inPortal;
-				delete pfrom;
-				delete pto;
-				return false;
-			}
-			if (inPortal->fetchRow())
-				TeCopyPortalGeometriesToLayer<TeCellSet>(inPortal,pfrom,outLayer);
-			inPortal->freeResult(); 
-		}
-
-		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeCELLS);
-		outLayer->database()->insertMetadata(outLayer->tableName(TeCELLS), spatialColumn, 0.0005,0.0005,outLayer->box());
-		outLayer->database()->createSpatialIndex(outLayer->tableName(TeCELLS), spatialColumn, (TeSpatialIndexType)TeRTREE);
-	}
-
-	inPortal->freeResult();
-
-	TeAttrTableVector attributeTables;
-	((TeExternalTheme*)(inTheme))->getRemoteTheme()->getAttTables(attributeTables);
-	sql = "SELECT table_id FROM te_theme_table WHERE theme_id = ";
-	bool hasExternal = false;
-	sql += Te2String(((TeExternalTheme*)(inTheme))->getRemoteTheme()->id()) + " AND relation_id > 0";
-	if (inPortal->query(sql) && inPortal->fetchRow())
-		hasExternal = true;
-
-	for (unsigned int i=0; i<attributeTables.size(); i++)
-	{
-		TeTable table = attributeTables[i];
-		if ((table.tableType() == TeAttrExternal) || table.attributeList().size() <= 0)
-			continue;
-
-		TeAttributeList attListIn = table.attributeList();
-		table.setId(-1);
-		n = 1;
-		string tname = table.name();
-		string tlinkqueattr = table.linkName();
-		while (true)
-		{
-			if (!outLayer->database()->tableExist(tname))
-				break;
-			n++;
-			tname = table.name() + "_" + Te2String(n);
-		}
-		string tfrom = table.name();
-		table.name(tname);
-		if (!outLayer->createAttributeTable(table))
-		{
-			delete inPortal;
-			return false;
-		}
-		string fieldsIn;
-		string fieldsOut;
-		vector<string> attNamesIn;
-		vector<string> attNamesOut;
-		table.attributeNames(attNamesOut);
-		for (n=0;n<attNamesOut.size()-1; n++)
-		{
-			fieldsOut += attNamesOut[n] + ",";
-			fieldsIn += tfrom + "." + attListIn[n].rep_.name_ + ",";
-		}
-		fieldsOut += attNamesOut[n];
-		fieldsIn += tfrom + "." + attListIn[n].rep_.name_;
-
-		if (hasExternal)	// table might have temporal instances 
-		{
-      std::vector< std::string >::iterator it_begin = itemVec.begin();
-      std::vector< std::string >::iterator it_end = itemVec.end();    
-    
-			svec = generateInClauses(it_begin, it_end, inLayer->database(), false);
-
-			sql = "SELECT " + fieldsIn;
-			sql += ((TeExternalTheme*)(inTheme))->getRemoteTheme()->sqlGridFrom();
-			sql += " WHERE unique_id IN ";
-		}
-		else				// table doesn�t have temporal instances 
-		{
-			sql = "SELECT " + fieldsIn;
-			sql += ((TeExternalTheme*)(inTheme))->getRemoteTheme()->sqlFrom();
-			sql += " WHERE " + tlinkqueattr + " IN " ;
-		}
-
-		for(sit=svec.begin(); sit!=svec.end(); ++sit)
-		{
-			string s = sql + *sit;
-
-			inPortal->freeResult();
-			if (inPortal->query(s))
-			{
-				int nr = 0;
-				while (inPortal->fetchRow())
-				{
-					TeTableRow row;
-					for(int i = 0; i < inPortal->numFields(); i++)
-						row.push_back(inPortal->getData(i));
-					table.add(row);
-					nr++;
-					if (nr % 100)
-					{
-						if (!outLayer->saveAttributeTable(table))
-						{
-							delete inPortal;							
-							return false;
-						}
-						table.clear();
-						nr = 0;
-					}
-				}
-				if (table.size() >0)
-				{
-					if (!outLayer->saveAttributeTable(table))
-					{
-						delete inPortal;							
-						return false;
-					}
-				}
-				table.clear();
-			}
-		}
-		inPortal->freeResult();
-	}
-	delete inPortal;
-	return true;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeLayerFunctions.h"
+#include "TeImportRaster.h"
+#include "TeProgress.h"
+#include "TeRaster.h"
+#include "TeExternalTheme.h"
+#include "TeThemeFunctions.h"
+
+
+void TeStartProcessing(int steps, const char* message)
+{
+	if (TeProgress::instance())
+		{
+			TeProgress::instance()->reset();
+			TeProgress::instance()->setTotalSteps(steps);
+			TeProgress::instance()->setMessage(message);
+		}
+}
+
+bool TeNextStep(int step)
+{
+	if(TeProgress::instance())
+	{
+		if (TeProgress::instance()->wasCancelled())
+		{
+			TeProgress::instance()->reset();
+			return false;
+		}
+		else
+			TeProgress::instance()->setProgress(step);
+	}
+	return true;
+}
+
+bool TeCopyThemeToLayer(TeTheme* inTheme, TeLayer* outLayer, 
+							int selObj, map<string,string> *txtTable)
+{
+	if (!inTheme || !outLayer)
+		return false;
+
+	TeLayer* inLayer = inTheme->layer();
+	// both projection should be valid
+	// do not allow only one NoProjection 
+	TeProjection* pfrom = TeProjectionFactory::make(inTheme->layer()->projection()->params());
+	TeProjection* pto = TeProjectionFactory::make(outLayer->projection()->params());
+
+	if (!(*pfrom == *pto))
+	{
+		if (pfrom->name() == "NoProjection" || pto->name() == "NoProjection")
+		{
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+	}
+
+	TeDatabasePortal* portal = inLayer->database()->getPortal();
+	if (!portal)
+		return false;
+
+	string sql;
+	TeGeomRep rep = static_cast<TeGeomRep>(inLayer->geomRep());
+	if (rep & TeRASTER)
+	{
+		TeRepresentation* rep = inLayer->getRepresentation(TeRASTER);
+		sql = "SELECT object_id FROM " + rep->tableName_;
+		if (portal->query(sql))
+		{
+			string objid;
+			TeRasterParams par;
+			TeRaster* rst;
+			while (portal->fetchRow())
+			{
+				objid = portal->getData(0);
+				rst = inLayer->raster(objid);
+				par = rst->params();
+				if (!TeImportRaster(outLayer,rst,par.blockWidth_,par.blockHeight_,par.compression_[0],
+									 objid,par.dummy_[0],par.useDummy_,par.tiling_type_))
+				{
+					delete pfrom;
+					delete pto;
+					delete portal;
+					return false;
+				}
+			}
+		}
+		// build the spatial index in the raster table
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeRASTER);
+		outLayer->database()->insertMetadata(outLayer->tableName(TeRASTER), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TeRASTER), spatialColumn, (TeSpatialIndexType)TeRTREE);
+		portal->freeResult();
+	}
+
+	if (rep & TeRASTERFILE)
+	{
+		TeRepresentation* rep = inLayer->getRepresentation(TeRASTERFILE);
+		if (rep)
+		{
+			string inRepTableName = rep->tableName_;
+			rep->tableName_ = "RasterLayer" + Te2String(outLayer->id());
+			if (outLayer->database()->insertRepresentation(outLayer->id(),*rep))
+			{
+				sql = "INSERT INTO " + rep->tableName_ + " (object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type) ";
+				sql += " SELECT object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type FROM " + inRepTableName;
+				outLayer->database()->execute(sql);
+			}
+		}
+	}
+	
+	// check if there is any other vectorial representation
+	if (!((rep & TePOLYGONS) || (rep & TeLINES) || 
+		  (rep & TePOINTS)   || (rep & TeCELLS) ||
+		  (rep & TeTEXT)))
+	{
+		delete pfrom;
+		delete pto;
+		delete portal;
+		return true;
+	}
+
+	// this SQL selects instances of objects according to input, so it uses te_collection_aux
+	string inputInst;
+	// this SQL selects objects according to input, so it uses te_collection
+	string inputObj; 
+	if(selObj == 1) // queried
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 2";
+		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 2";
+		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
+	}
+	else if(selObj == 2) // pointed
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 1";
+		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 1";
+		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
+	}
+	else if(selObj == 3) // not queried
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status <> 2";
+		inputObj += " AND " + inTheme->collectionTable() + ".c_object_status <> 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status <> 2";
+		inputInst += " AND " + inTheme->collectionAuxTable() + ".grid_status <> 3)";
+	}
+	else if(selObj == 4) // not pointed
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status <> 1";
+		inputObj += " AND " + inTheme->collectionTable() + ".c_object_status <> 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status <> 1";
+		inputInst += " AND " + inTheme->collectionAuxTable() + ".grid_status <> 3)";
+	}
+	else if(selObj == 5) // pointed and queried
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 3)";
+	}
+	else if(selObj == 6) // pointed or queried
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 2";
+		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 1";
+		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 2";
+		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 1";
+		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
+	}
+	// Initally test if there is any object selected
+	sql = "SELECT c_object_id FROM " + inTheme->collectionTable();
+	if (!inputObj.empty())
+		sql += " WHERE " + inputObj;
+	if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+	{
+		delete portal;
+		delete pfrom;
+		delete pto;
+		return false; // error!
+	}
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		delete pfrom;
+		delete pto;
+		return true; // there is no object selected
+	}
+	portal->freeResult();
+
+	unsigned int n = 1;
+	if (inLayer->hasGeometry(TePOINTS))
+	{
+		sql = "SELECT " + inLayer->tableName(TePOINTS) + ".* FROM ";
+		sql += inLayer->tableName(TePOINTS) + ", " + inTheme->collectionTable();
+		sql += " WHERE object_id = c_object_id";
+		if (!inputObj.empty())
+			sql += " AND " + inputObj;
+
+		if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+		{
+			delete portal;
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+		if (portal->fetchRow())
+			TeCopyPortalGeometriesToLayer<TePointSet>(portal,pfrom,outLayer);
+		portal->freeResult(); 
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TePOINTS);
+		outLayer->database()->insertMetadata(outLayer->tableName(TePOINTS), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TePOINTS), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+	
+	if (inLayer->hasGeometry(TeLINES))
+	{
+		sql = "SELECT " + inLayer->tableName(TeLINES) + ".* FROM ";
+		sql += inLayer->tableName(TeLINES) + ", " + inTheme->collectionTable();
+		sql += " WHERE object_id = c_object_id";
+		if (!inputObj.empty())
+			sql += " AND " + inputObj;
+		sql += " ORDER BY ext_max DESC";
+
+		if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+		{
+			delete portal;
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+		if (portal->fetchRow())
+			TeCopyPortalGeometriesToLayer<TeLineSet>(portal,pfrom,outLayer);
+		portal->freeResult(); 
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeLINES);
+		outLayer->database()->insertMetadata(outLayer->tableName(TeLINES), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TeLINES), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+	if (inLayer->hasGeometry(TePOLYGONS))
+	{
+		sql = "SELECT " + inLayer->tableName(TePOLYGONS) + ".* FROM ";
+		sql += inLayer->tableName(TePOLYGONS) + ", " + inTheme->collectionTable();
+		sql += " WHERE object_id = c_object_id";
+		if (!inputObj.empty())
+			sql += " AND " + inputObj;
+
+		/*if (inLayer->database()->dbmsName() != "OracleSpatial" && inLayer->database()->dbmsName() != "PostGIS")
+			sql += " ORDER BY object_id ASC, parent_id ASC, num_holes DESC";
+		else
+			sql += " ORDER BY object_id ASC";*/
+		sql += " ORDER BY " + inLayer->database()->getSQLOrderBy(TePOLYGONS);
+
+		if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+		{
+			delete portal;
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+		if (portal->fetchRow())
+			TeCopyPortalGeometriesToLayer<TePolygonSet>(portal,pfrom,outLayer);
+		portal->freeResult(); 
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TePOLYGONS);
+		outLayer->database()->insertMetadata(outLayer->tableName(TePOLYGONS), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TePOLYGONS), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+
+	if (inLayer->hasGeometry(TeCELLS))
+	{
+		sql = "SELECT " + inLayer->tableName(TeCELLS) + ".* FROM ";
+		sql += inLayer->tableName(TeCELLS) + ", " + inTheme->collectionTable();
+		sql += " WHERE object_id = c_object_id";
+		if (!inputObj.empty())
+			sql += " AND " + inputObj;
+
+		if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+		{
+			delete portal;
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+		if (portal->fetchRow())
+			TeCopyPortalGeometriesToLayer<TeCellSet>(portal,pfrom,outLayer);
+		portal->freeResult(); 
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeCELLS);
+		outLayer->database()->insertMetadata(outLayer->tableName(TeCELLS), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TeCELLS), spatialColumn, (TeSpatialIndexType)TeRTREE);
+		
+	}
+
+	if (inLayer->hasGeometry(TeTEXT))
+	{
+		unsigned int j;
+		vector<string> textTables;
+		vector<string> textDescr;
+		string selrep = "SELECT geom_table, description FROM te_representation WHERE layer_id = " + Te2String(inLayer->id());
+		selrep += " AND geom_type = " + Te2String(TeTEXT);
+		if (portal->query(selrep))
+		{
+			while(portal->fetchRow())
+			{
+				textTables.push_back(portal->getData(0));
+				textDescr.push_back(portal->getData(1));
+			}
+		}
+		portal->freeResult();
+
+		int k=1;
+		for (j=0; j<textTables.size(); j++)
+		{
+			string newTextTable = textTables[j] + "_1";
+			while (inLayer->database()->tableExist(newTextTable))
+			{
+				k++;
+				newTextTable = textTables[j] + "_" + Te2String(k);
+			}
+			sql = "SELECT DISTINCT " + textTables[j] + ".* FROM ";
+			sql += textTables[j] + ", " + inTheme->collectionTable();
+			sql += " WHERE object_id = c_object_id OR object_id = 'TE_NONE_ID'";
+			if(inputObj.empty() == false)
+				sql += " AND " + inputObj;
+			if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+			{
+				delete portal;
+				delete pfrom;
+				delete pto;
+				return false;
+			}
+			if (portal->fetchRow())
+			{
+				if (!outLayer->addGeometry(TeTEXT,newTextTable,textDescr[j]))
+				{
+					delete portal;
+					delete pfrom;
+					delete pto;
+					return false;
+				}
+				TeCopyPortalGeometriesToLayer<TeTextSet>(portal,pfrom,outLayer,newTextTable);
+				if (txtTable)
+				{
+					(*txtTable)[textTables[j]] = newTextTable;
+				}
+			}
+			portal->freeResult();
+		}
+	}
+	delete pfrom;
+	delete pto;
+	portal->freeResult();
+
+	TeAttrTableVector attributeTables;
+	inTheme->getAttTables(attributeTables);
+	sql = "SELECT table_id FROM te_theme_table WHERE theme_id = ";
+	bool hasExternal = false;
+	sql += Te2String(inTheme->id()) + " AND relation_id > 0";
+	if (portal->query(sql) && portal->fetchRow())
+		hasExternal = true;
+	portal->freeResult();
+
+	for (unsigned int i=0; i<attributeTables.size(); i++)
+	{
+		TeTable table = attributeTables[i];
+		if ((table.tableType() == TeAttrExternal) || table.attributeList().size() <= 0)
+			continue;
+
+		TeAttributeList attListIn = table.attributeList();
+		table.setId(-1);
+		n = 1;
+		string tname = table.name();
+		string tlinkqueattr = table.linkName();
+		while (true)
+		{
+			if (!outLayer->database()->tableExist(tname))
+				break;
+			n++;
+			tname = table.name() + "_" + Te2String(n);
+		}
+		string tfrom = table.name();
+		table.name(tname);
+		if (!outLayer->createAttributeTable(table))
+		{
+			delete portal;
+			return false;
+		}
+		string fieldsIn;
+		string fieldsOut;
+		vector<string> attNamesIn;
+		vector<string> attNamesOut;
+		table.attributeNames(attNamesOut);
+		for (n=0;n<attNamesOut.size()-1; n++)
+		{
+			fieldsOut += attNamesOut[n] + ",";
+			fieldsIn += tfrom + "." + attListIn[n].rep_.name_ + ",";
+		}
+		fieldsOut += attNamesOut[n];
+		fieldsIn += tfrom + "." + attListIn[n].rep_.name_;
+
+		if (!hasExternal)	// table might have temporal instances 
+		{
+			sql = "SELECT " + fieldsIn + " ";
+			sql += inTheme->sqlGridFrom();
+			if (!inputInst.empty())
+				sql += " WHERE " + inputInst;
+		}
+		else				// table doesn�t have temporal instances 
+		{
+			sql = "SELECT " + fieldsIn + " FROM " +  tfrom;
+			sql += ", " + inTheme->collectionTable() + " WHERE ";
+			sql += tfrom + "." + tlinkqueattr + "=" + inTheme->collectionTable() + ".c_object_id";
+			if (!inputObj.empty())
+				sql += " AND " + inputObj;
+		}
+
+		if (inLayer->database() == outLayer->database())
+		{
+			string popule = "INSERT INTO " + table.name() + " ( " + fieldsOut + ") " + sql;
+			inLayer->database()->execute(popule);
+		}
+		else
+		{
+			if (portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+			{
+				int nr = 0;
+				int count = 0;
+			
+				TeStartProcessing((portal->numRows() * portal->numFields()),"saving table ...");
+
+
+				while (portal->fetchRow())
+				{
+					TeTableRow row;
+					for(int i = 0; i < portal->numFields(); i++)
+					{
+						row.push_back(portal->getData(i));
+						count++;
+						TeNextStep(count);
+					}
+
+					table.add(row);
+					nr++;
+					if (nr % 100 == 0)
+					{
+						if (!outLayer->saveAttributeTable(table))
+						{
+							delete portal;							
+							return false;
+						}
+						table.clear();
+						nr = 0;
+					}
+				}
+				if (table.size() >0)
+				{
+					if (!outLayer->saveAttributeTable(table))
+					{
+						delete portal;							
+						return false;
+					}
+				}
+				table.clear();
+			}
+		}
+		portal->freeResult();
+	}
+	delete portal;
+	TeProgress::instance()->reset();
+	return true;
+}
+
+bool TeCopyLayerToLayer(TeLayer* inLayer, TeLayer* outLayer, map<string,string> *txtTable)
+{
+	if (!inLayer || !outLayer)
+		return false;
+
+	// both projection should be valid
+	// do not allow only one NoProjection 
+	TeProjection* pfrom = TeProjectionFactory::make(inLayer->projection()->params());
+	TeProjection* pto   = TeProjectionFactory::make(outLayer->projection()->params());
+	if (!(*pfrom == *pto))
+	{
+		if (pfrom->name() == "NoProjection" || pto->name() == "NoProjection")
+		{
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+	}
+
+	TeDatabasePortal* portal = inLayer->database()->getPortal();
+	if (!portal)
+	{
+		delete pfrom;
+		delete pto;
+		return false;
+	}
+
+	string sql;
+	bool res;
+	if (inLayer->hasGeometry(TeRASTER))
+	{
+		TeRepresentation* rep = inLayer->getRepresentation(TeRASTER);
+		sql = "SELECT object_id FROM " + rep->tableName_;
+		if (portal->query(sql))
+		{
+			string objid;
+			TeRasterParams par;
+			TeRaster* rst;
+			while (portal->fetchRow())
+			{
+				objid = portal->getData(0);
+				rst = inLayer->raster(objid);
+				par = rst->params();
+				res = TeImportRaster(outLayer,rst,par.blockWidth_,par.blockHeight_,par.compression_[0],
+									 objid,par.dummy_[0],par.useDummy_,par.tiling_type_);
+			}
+		}
+		portal->freeResult();
+	}
+
+	if (inLayer->hasGeometry(TeRASTERFILE)) // TODO : check the case when the databases are in different DBMS
+	{
+		TeRepresentation* rep = inLayer->getRepresentation(TeRASTERFILE);
+		if (rep)
+		{
+			string inRepTableName = rep->tableName_;
+			rep->tableName_ = "RasterLayer" + Te2String(outLayer->id());
+			if (outLayer->database()->insertRepresentation(outLayer->id(),*rep))
+			{
+				sql = "INSERT INTO " + rep->tableName_ + " (object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type) ";
+				sql += " SELECT object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type FROM " + inRepTableName;
+				outLayer->database()->execute(sql);
+			}
+		}
+	}
+
+	unsigned int	n = 1;
+	if (inLayer->hasGeometry(TePOINTS))
+	{
+		sql = "SELECT " + inLayer->tableName(TePOINTS) + ".* FROM ";
+		sql += inLayer->tableName(TePOINTS);
+		if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+		{
+			delete portal;
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+		if (portal->fetchRow())
+				TeCopyPortalGeometriesToLayer<TePointSet>(portal,pfrom,outLayer);
+		portal->freeResult();
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TePOINTS);
+		outLayer->database()->insertMetadata(outLayer->tableName(TePOINTS), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TePOINTS), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+	
+	if (inLayer->hasGeometry(TeLINES))
+	{
+		sql = "SELECT " + inLayer->tableName(TeLINES) + ".* FROM ";
+		sql += inLayer->tableName(TeLINES);
+		sql += " ORDER BY ext_max DESC";
+
+		if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+		{
+			delete portal;
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+		if (portal->fetchRow())
+			TeCopyPortalGeometriesToLayer<TeLineSet>(portal,pfrom,outLayer);
+		portal->freeResult();
+	
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeLINES);
+		outLayer->database()->insertMetadata(outLayer->tableName(TeLINES), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TeLINES), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+	if (inLayer->hasGeometry(TePOLYGONS))
+	{
+		sql = "SELECT " + inLayer->tableName(TePOLYGONS) + ".* FROM ";
+		sql += inLayer->tableName(TePOLYGONS);
+		/*if (inLayer->database()->dbmsName() != "OracleSpatial" && inLayer->database()->dbmsName() != "PostGIS")
+			sql += " ORDER BY object_id ASC, parent_id ASC, num_holes DESC";
+		else
+			sql += " ORDER BY object_id ASC";*/
+		sql += " ORDER BY " + inLayer->database()->getSQLOrderBy(TePOLYGONS);
+
+		if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+		{
+			delete portal;
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+		if (portal->fetchRow())
+			TeCopyPortalGeometriesToLayer<TePolygonSet>(portal,pfrom,outLayer);
+		portal->freeResult();
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TePOLYGONS);
+		outLayer->database()->insertMetadata(outLayer->tableName(TePOLYGONS), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TePOLYGONS), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+
+	if (inLayer->hasGeometry(TeCELLS))
+	{
+		sql = "SELECT " + inLayer->tableName(TeCELLS) + ".* FROM ";
+		sql += inLayer->tableName(TeCELLS) ;
+
+		if (!portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+		{
+			delete portal;
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+		if (portal->fetchRow())
+			TeCopyPortalGeometriesToLayer<TeCellSet>(portal,pfrom,outLayer);
+		portal->freeResult();
+
+		TeRepresentation* repIn = inLayer->getRepresentation(TeCELLS);
+		if(repIn != 0)
+		{
+			TeRepresentation* repOut = outLayer->getRepresentation(TeCELLS);
+			if(repOut != 0)
+			{
+				repOut->resX_ = repIn->resX_;
+				repOut->resY_ = repIn->resY_;
+
+				outLayer->database()->updateRepresentation(outLayer->id(), *repOut);
+			}
+		}
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeCELLS);
+		outLayer->database()->insertMetadata(outLayer->tableName(TeCELLS), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TeCELLS), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+	if (inLayer->hasGeometry(TeTEXT))
+	{
+		unsigned int j;
+		vector<string> textTables;
+		vector<string> textDescr;
+		string selrep = "SELECT geom_table, description FROM te_representation WHERE layer_id = " + Te2String(inLayer->id());
+		selrep += " AND geom_type = " + Te2String(TeTEXT);
+		if (portal->query(selrep, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+		{
+			while(portal->fetchRow())
+			{
+				textTables.push_back(portal->getData(0));
+				textDescr.push_back(portal->getData(1));
+			}
+		}
+		portal->freeResult();
+
+		int k=1;
+		for (j=0; j<textTables.size(); j++)
+		{
+			string newTextTable = textTables[j] + "_1";
+			while (inLayer->database()->tableExist(newTextTable))
+			{
+				k++;
+				newTextTable = textTables[j] + "_" + Te2String(k);
+			}
+			sql = "SELECT " + textTables[j] + ".* FROM ";
+			sql += textTables[j] ;
+			if (!portal->query(sql))
+			{
+				delete portal;
+				delete pfrom;
+				delete pto;
+				return false;
+			}
+			
+			if (portal->fetchRow())
+			{
+				if (!outLayer->addGeometry(TeTEXT,newTextTable,textDescr[j]))
+				{
+					delete portal;
+					delete pfrom;
+					delete pto;
+					return false;
+				}
+				TeCopyPortalGeometriesToLayer<TeTextSet>(portal,pfrom,outLayer,newTextTable);
+				if (txtTable)
+				{
+					(*txtTable)[textTables[j]] = newTextTable;
+				}
+			}
+			portal->freeResult();
+		}
+	}
+	delete pfrom;
+	delete pto;
+	portal->freeResult();
+
+	vector<TeTable> attributeTables;
+	inLayer->getAttrTables(attributeTables);
+	for (unsigned int i=0; i<attributeTables.size(); i++)
+	{
+		TeTable table = attributeTables[i];
+		if (table.attributeList().size() <= 0)
+			continue;
+
+		TeAttributeList attListIn = table.attributeList();
+		table.setId(-1);
+
+		string tname = outLayer->name();
+		if(outLayer->database()->tableExist(tname))
+		{
+			n = 1;
+			tname = table.name();
+			while (true)
+			{
+				if (!outLayer->database()->tableExist(tname))
+					break;
+				n++;
+				tname = table.name() + "_" + Te2String(n);
+			}	
+		}		
+		
+		string tfrom = table.name();
+		table.name(tname);
+		if (outLayer->createAttributeTable(table))
+		{
+			if (inLayer->database() == outLayer->database())
+			{
+				string fieldsIn;
+				string fieldsOut;
+				vector<string> attNamesIn;
+				vector<string> attNamesOut;
+				table.attributeNames(attNamesOut);
+				for (n=0;n<attNamesOut.size()-1; n++)
+				{
+					fieldsOut += attNamesOut[n] + ",";
+					fieldsIn += attListIn[n].rep_.name_ + ",";
+				}
+				fieldsOut += attNamesOut[n];
+				fieldsIn += attListIn[n].rep_.name_;
+
+				sql = "SELECT " + fieldsIn + " FROM " + tfrom;
+				string popule = "INSERT INTO " + table.name() + " ( " + fieldsOut + ") " + sql;
+				inLayer->database()->execute(popule);
+			}
+			else
+			{
+				portal->freeResult();
+
+				std::string columnNames = "";
+				for (unsigned int i = 0; i < table.attributeList().size(); ++i)
+				{
+					if(!columnNames.empty())
+					{
+						columnNames += ",";
+					}
+					columnNames += table.attributeList()[i].rep_.name_;
+				}
+				sql = "SELECT " + columnNames + " FROM " + tfrom;
+				if (portal->query(sql, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+				{
+					int nr = 0;
+					while (portal->fetchRow())
+					{
+						TeTableRow row;
+						for(int i = 0; i < portal->numFields(); i++)
+						{
+							if (table.attributeList()[i].rep_.type_== TeDATETIME)
+							{
+								TeTime t = portal->getDate(i);
+								string temp = t.getDateTime(table.attributeList()[i].dateTimeFormat_,table.attributeList()[i].dateSeparator_, table.attributeList()[i].timeSeparator_);
+								row.push_back(temp);
+							}
+							else
+								row.push_back(portal->getData(i));
+						}
+						table.add(row);
+						nr++;
+						if (nr % 100 == 0)
+						{
+							outLayer->saveAttributeTable(table);
+							table.clear();
+							nr = 0;
+						}
+					}
+					if (table.size() >0)
+						outLayer->saveAttributeTable(table);
+					table.clear();
+				}
+			}
+			portal->freeResult();
+		}
+	}	
+	delete portal;
+	return true;
+}
+
+bool TeCopyExternThemeToLayer(TeTheme* inTheme, TeLayer* outLayer, 
+							int selObj, map<string,string>*)
+{
+	if (!inTheme || !outLayer)
+		return false;
+
+	TeLayer* inLayer = ((TeExternalTheme*)(inTheme))->getRemoteTheme()->layer();
+	// both projection should be valid
+	// do not allow only one NoProjection 
+	TeProjection* pfrom = TeProjectionFactory::make(inLayer->projection()->params());
+	TeProjection* pto = TeProjectionFactory::make(outLayer->projection()->params());
+
+	if (!(*pfrom == *pto))
+	{
+		if (pfrom->name() == "NoProjection" || pto->name() == "NoProjection")
+		{
+			delete pfrom;
+			delete pto;
+			return false;
+		}
+	}
+
+	TeDatabasePortal* inPortal = inLayer->database()->getPortal();
+	if (!inPortal)
+		return false;
+
+	string sql;
+	TeGeomRep rep = static_cast<TeGeomRep>(inLayer->geomRep());
+	if (rep & TeRASTER)
+	{
+		TeRepresentation* rep = inLayer->getRepresentation(TeRASTER);
+		sql = "SELECT object_id FROM " + rep->tableName_;
+		if (inPortal->query(sql))
+		{
+			string objid;
+			TeRasterParams par;
+			TeRaster* rst;
+			while (inPortal->fetchRow())
+			{
+				objid = inPortal->getData(0);
+				rst = inLayer->raster(objid);
+				par = rst->params();
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+				if (!TeImportRaster(outLayer,rst,par.blockWidth_,par.blockHeight_,par.compression_[0],
+									 objid,par.dummy_[0],par.useDummy_,par.tiling_type_))
+				{
+					delete pfrom;
+					delete pto;
+					delete inPortal;
+					return false;
+				}
+			}
+		}
+		// build the spatial index in the raster table
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeRASTER);
+		outLayer->database()->insertMetadata(outLayer->tableName(TeRASTER), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TeRASTER), spatialColumn, (TeSpatialIndexType)TeRTREE);
+		inPortal->freeResult();
+	}
+
+	if (rep & TeRASTERFILE)
+	{
+		TeRepresentation* rep = inLayer->getRepresentation(TeRASTERFILE);
+		if (rep)
+		{
+			string inRepTableName = rep->tableName_;
+			rep->tableName_ = "RasterLayer" + Te2String(outLayer->id());
+			if (outLayer->database()->insertRepresentation(outLayer->id(),*rep))
+			{
+				sql = "INSERT INTO " + rep->tableName_ + " (object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type) ";
+				sql += " SELECT object_id, raster_table, lut_table, res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, lower_x, lower_y, upper_x, upper_y, tiling_type FROM " + inRepTableName;
+				outLayer->database()->execute(sql);
+			}
+		}
+	}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	
+	// check if there is any other vectorial representation
+	if (!((rep & TePOLYGONS) || (rep & TeLINES) || 
+		  (rep & TePOINTS)   || (rep & TeCELLS) ||
+		  (rep & TeTEXT)))
+	{
+		delete pfrom;
+		delete pto;
+		delete inPortal;
+		return true;
+	}
+
+	// this SQL selects instances of objects according to input, so it uses te_collection_aux
+	string inputInst;
+	// this SQL selects objects according to input, so it uses te_collection
+	string inputObj; 
+	vector<string> objectVec;
+	vector<string> itemVec;
+	map<string, int>::iterator it;
+	string extCollTable = ((TeExternalTheme*)(inTheme))->getRemoteTheme()->collectionTable();
+	string not_string;
+
+	if(selObj == 0) // all collection
+	{
+		objectVec = getObjects(inTheme, TeAll);
+		itemVec = getItems(inTheme, TeAll);
+	}
+	else if(selObj == 1) // queried
+	{
+		objectVec = getObjects(inTheme, TeSelectedByQuery);
+		itemVec = getItems(inTheme, TeSelectedByQuery);
+	}
+	else if(selObj == 2) // pointed
+	{
+		objectVec = getObjects(inTheme, TeSelectedByPointing);
+		itemVec = getItems(inTheme, TeSelectedByPointing);
+	}
+	else if(selObj == 3) // not queried
+	{
+		objectVec = getObjects(inTheme, TeNotSelectedByQuery);
+		itemVec = getItems(inTheme, TeNotSelectedByQuery);
+	}
+	else if(selObj == 4) // not pointed
+	{
+		objectVec = getObjects(inTheme, TeNotSelectedByPointing);
+		itemVec = getItems(inTheme, TeNotSelectedByPointing);
+	}
+	else if(selObj == 5) // pointed and queried
+	{
+		objectVec = getObjects(inTheme, TeSelectedByPointingAndQuery);
+		itemVec = getItems(inTheme, TeSelectedByPointingAndQuery);
+	}
+	else if(selObj == 6) // pointed or queried
+	{
+		objectVec = getObjects(inTheme, TeSelectedByPointingOrQuery);
+		itemVec = getItems(inTheme, TeSelectedByPointingOrQuery);
+	}
+	if (objectVec.empty())
+	{
+		delete inPortal;
+		delete pfrom;
+		delete pto;
+		return true; // there is no object selected
+	}
+  
+  std::vector< std::string >::iterator it_begin = objectVec.begin();
+  std::vector< std::string >::iterator it_end = objectVec.end();
+
+	vector<string> svec = generateInClauses(it_begin, it_end, inLayer->database());
+	unsigned int n = 1;
+	vector<string>::iterator sit;
+	inPortal->freeResult();
+
+	if (inLayer->hasGeometry(TePOINTS))
+	{
+		sql = "SELECT " + inLayer->tableName(TePOINTS) + ".* FROM ";
+		sql += inLayer->tableName(TePOINTS);
+		for(sit=svec.begin(); sit!=svec.end(); ++sit)
+		{
+			string s = sql + " WHERE object_id " + not_string + " IN " + *sit;
+		
+			if (!inPortal->query(s, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+			{
+				delete inPortal;
+				delete pfrom;
+				delete pto;
+				return false;
+			}
+			if (inPortal->fetchRow())
+				TeCopyPortalGeometriesToLayer<TePointSet>(inPortal,pfrom,outLayer);
+			inPortal->freeResult(); 
+		}
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TePOINTS);
+		outLayer->database()->insertMetadata(outLayer->tableName(TePOINTS), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TePOINTS), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+	
+	if (inLayer->hasGeometry(TeLINES))
+	{
+		sql = "SELECT " + inLayer->tableName(TeLINES) + ".* FROM ";
+		sql += inLayer->tableName(TeLINES);
+		for(sit=svec.begin(); sit!=svec.end(); ++sit)
+		{
+			string s = sql + " WHERE object_id IN " + *sit;
+			s += " ORDER BY ext_max DESC";
+
+			if (!inPortal->query(s, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+			{
+				delete inPortal;
+				delete pfrom;
+				delete pto;
+				return false;
+			}
+			if (inPortal->fetchRow())
+				TeCopyPortalGeometriesToLayer<TeLineSet>(inPortal,pfrom,outLayer);
+			inPortal->freeResult(); 
+		}
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeLINES);
+		outLayer->database()->insertMetadata(outLayer->tableName(TeLINES), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TeLINES), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+	if (inLayer->hasGeometry(TePOLYGONS))
+	{
+		sql = "SELECT " + inLayer->tableName(TePOLYGONS) + ".* FROM ";
+		sql += inLayer->tableName(TePOLYGONS);
+		for(sit=svec.begin(); sit!=svec.end(); ++sit)
+		{
+			string s = sql + " WHERE object_id IN " + *sit;
+			/*if (inLayer->database()->dbmsName() != "OracleSpatial" && inLayer->database()->dbmsName() != "PostGIS")
+				s += " ORDER BY object_id ASC, parent_id ASC, num_holes DESC";
+			else
+				s += " ORDER BY object_id ASC"; */
+			s += " ORDER BY " + inLayer->database()->getSQLOrderBy(TePOLYGONS);
+
+			if (!inPortal->query(s, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+			{
+				delete inPortal;
+				delete pfrom;
+				delete pto;
+				return false;
+			}
+			if (inPortal->fetchRow())
+				TeCopyPortalGeometriesToLayer<TePolygonSet>(inPortal,pfrom,outLayer);
+			inPortal->freeResult(); 
+		}
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TePOLYGONS);
+		outLayer->database()->insertMetadata(outLayer->tableName(TePOLYGONS), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TePOLYGONS), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+
+	if (inLayer->hasGeometry(TeCELLS))
+	{
+		sql = "SELECT " + inLayer->tableName(TeCELLS) + ".* FROM ";
+		sql += inLayer->tableName(TeCELLS);
+		for(sit=svec.begin(); sit!=svec.end(); ++sit)
+		{
+			string s = sql + " WHERE object_id IN " + *sit;
+
+			if (!inPortal->query(s, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+			{
+				delete inPortal;
+				delete pfrom;
+				delete pto;
+				return false;
+			}
+			if (inPortal->fetchRow())
+				TeCopyPortalGeometriesToLayer<TeCellSet>(inPortal,pfrom,outLayer);
+			inPortal->freeResult(); 
+		}
+
+		std::string spatialColumn = outLayer->database()->getSpatialIdxColumn(TeCELLS);
+		outLayer->database()->insertMetadata(outLayer->tableName(TeCELLS), spatialColumn, 0.0005,0.0005,outLayer->box());
+		outLayer->database()->createSpatialIndex(outLayer->tableName(TeCELLS), spatialColumn, (TeSpatialIndexType)TeRTREE);
+	}
+
+	inPortal->freeResult();
+
+	TeAttrTableVector attributeTables;
+	((TeExternalTheme*)(inTheme))->getRemoteTheme()->getAttTables(attributeTables);
+	sql = "SELECT table_id FROM te_theme_table WHERE theme_id = ";
+	bool hasExternal = false;
+	sql += Te2String(((TeExternalTheme*)(inTheme))->getRemoteTheme()->id()) + " AND relation_id > 0";
+	if (inPortal->query(sql) && inPortal->fetchRow())
+		hasExternal = true;
+
+	for (unsigned int i=0; i<attributeTables.size(); i++)
+	{
+		TeTable table = attributeTables[i];
+		if ((table.tableType() == TeAttrExternal) || table.attributeList().size() <= 0)
+			continue;
+
+		TeAttributeList attListIn = table.attributeList();
+		table.setId(-1);
+		n = 1;
+		string tname = table.name();
+		string tlinkqueattr = table.linkName();
+		while (true)
+		{
+			if (!outLayer->database()->tableExist(tname))
+				break;
+			n++;
+			tname = table.name() + "_" + Te2String(n);
+		}
+		string tfrom = table.name();
+		table.name(tname);
+		if (!outLayer->createAttributeTable(table))
+		{
+			delete inPortal;
+			return false;
+		}
+		string fieldsIn;
+		string fieldsOut;
+		vector<string> attNamesIn;
+		vector<string> attNamesOut;
+		table.attributeNames(attNamesOut);
+		for (n=0;n<attNamesOut.size()-1; n++)
+		{
+			fieldsOut += attNamesOut[n] + ",";
+			fieldsIn += tfrom + "." + attListIn[n].rep_.name_ + ",";
+		}
+		fieldsOut += attNamesOut[n];
+		fieldsIn += tfrom + "." + attListIn[n].rep_.name_;
+
+		if (hasExternal)	// table might have temporal instances 
+		{
+      std::vector< std::string >::iterator it_begin = itemVec.begin();
+      std::vector< std::string >::iterator it_end = itemVec.end();    
+    
+			svec = generateInClauses(it_begin, it_end, inLayer->database(), false);
+
+			sql = "SELECT " + fieldsIn;
+			sql += ((TeExternalTheme*)(inTheme))->getRemoteTheme()->sqlGridFrom();
+			sql += " WHERE unique_id IN ";
+		}
+		else				// table doesn�t have temporal instances 
+		{
+			sql = "SELECT " + fieldsIn;
+			sql += ((TeExternalTheme*)(inTheme))->getRemoteTheme()->sqlFrom();
+			sql += " WHERE " + tlinkqueattr + " IN " ;
+		}
+
+		for(sit=svec.begin(); sit!=svec.end(); ++sit)
+		{
+			string s = sql + *sit;
+
+			inPortal->freeResult();
+			if (inPortal->query(s, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR))
+			{
+				int nr = 0;
+				while (inPortal->fetchRow())
+				{
+					TeTableRow row;
+					for(int i = 0; i < inPortal->numFields(); i++)
+						row.push_back(inPortal->getData(i));
+					table.add(row);
+					nr++;
+					if (nr % 100 == 0)
+					{
+						if (!outLayer->saveAttributeTable(table))
+						{
+							delete inPortal;							
+							return false;
+						}
+						table.clear();
+						nr = 0;
+					}
+				}
+				if (table.size() >0)
+				{
+					if (!outLayer->saveAttributeTable(table))
+					{
+						delete inPortal;							
+						return false;
+					}
+				}
+				table.clear();
+			}
+		}
+		inPortal->freeResult();
+	}
+	delete inPortal;
+	return true;
+}
+
diff --git a/src/terralib/functions/TeLayerFunctions.h b/src/terralib/functions/TeLayerFunctions.h
old mode 100755
new mode 100644
index 716bdfe..af805e4
--- a/src/terralib/functions/TeLayerFunctions.h
+++ b/src/terralib/functions/TeLayerFunctions.h
@@ -1,208 +1,209 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeLayerFunctions.h
-    \brief This file contains functions to manipulate layers 
-*/
-#ifndef  __TERRALIB_INTERNAL_LAYERFUNCTIONS_H
-#define  __TERRALIB_INTERNAL_LAYERFUNCTIONS_H
-
-#include "TeLayer.h"
-#include "TeVectorRemap.h"
-#include "TeTheme.h"
-#include "TeDatabase.h"
-#include "TeProgress.h"
-
-
-/** Imports a geometry set to a layer, creating an empty attribute table
-	This function imports a geometry set to a layer.
-	An attribute table is automatically created with only the object_id field.
-	If geometries don�t have object ids a unique identification will be automatically generated
-	\param layer pointer to a layer previously created 
-    \param geomSet the geometry set
-    \return TRUE or FALSE whether the geometry set was imported successfully
-*/
-template <class G>
-bool TeImportGeometriesToLayer(TeLayer* layer, G& geomSet)
-{
-	if (!layer)
-
-		return false;
-
-	TeDatabase* db = layer->database();
-	int nTab = 0;
-	TeAttrTableVector attTables;
-	if (layer->getAttrTables(attTables))
-		nTab = attTables.size();
-	
-	string tabName = "AttributeTable_" + Te2String(layer->id()) + "_" + Te2String(nTab); 
-	TeAttributeList attList;
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.numChar_ = 16;
-	at.rep_.name_ = "object_id";
-	at.rep_.isPrimaryKey_ = true;
-	attList.push_back(at);
-
-	TeTable attTable(tabName,attList,"object_id", "object_id",TeAttrStatic);
-
-	TeTableRow row;
-	for (int i=0; i<geomSet.size(); i++)
-	{
-		row.clear();
-		string id = geomSet[i].objectId();
-		if (id.empty())
-		{
-			id = Te2String(i);
-			geomSet[i].objectId(id);
-		}
-		row.push_back(id);
-		attTable.add(row);
-	}
-	
-	if (!layer->addGeometrySet(geomSet))
-	{
-		attTable.clear();
-		db->deleteLayer(layer->id());
-		return false;
-	}
-	
-	if (!layer->createAttributeTable(attTable))
-	{
-		attTable.clear();
-		db->deleteLayer(layer->id());
-		return false;
-	}
-
-	if (!layer->saveAttributeTable(attTable))
-	{
-		attTable.clear();
-		db->deleteLayer(layer->id());
-		return false;
-	}
-	
-	attTable.clear();
-	return true;
-}
-
-/** Copy the geometries retrieved in a portal to layer
-	\param portal pointer to a portal that has executed a query for geometries
-	\param proj pointer to the projection associated to the geometries
-	\param layer pointer to the destination layer 
-	\param tname optional parameter indicating the name of a table to store the geometries
-*/
-template<typename GS>
-GS* 
-TeCopyPortalGeometriesToLayer(TeDatabasePortal* portal, TeProjection* proj, TeLayer* layer, const string& tName="")
-{
-	if (!portal ||!layer)
-		return 0;
-
-	TeProjection* pfrom = TeProjectionFactory::make(proj->params());
-	TeProjection* pto = TeProjectionFactory::make(layer->projection()->params());
-	bool doRemap;
-	if (!pfrom || !pto || (pfrom->name() == "NoProjection" ||  pto->name() == "NoProjection") && 
-		!(pfrom->name() == pto->name()))
-		doRemap = false;
-	else
-		doRemap= !(*pfrom == *pto);
-
-	if (doRemap)
-		pfrom->setDestinationProjection(pto);
-	
-	if (TeProgress::instance())
-			TeProgress::instance()->setTotalSteps(portal->numRows());
-
-	GS set1;
-	int n = 1; 
-	bool flag=false;
-	do
-	{
-		typename GS::value_type elemI;
-		flag = portal->fetchGeometry(elemI);
-		if (doRemap)
-		{
-			typename GS::value_type elemO;
-			TeVectorRemap(elemI,pfrom,elemO,pto);
-			elemO.objectId(elemI.objectId());
-			set1.add(elemO);
-		}
-		else
-		{
-			set1.add(elemI);
-			set1[set1.size()-1].objectId(elemI.objectId()); 
-		}
-
-		if (((n%100) == 0) || !flag)
-		{	
-			layer->addGeometrySet(set1,tName);
-			set1.clear();
-			if(TeProgress::instance())
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				else
-					TeProgress::instance()->setProgress(n);
-			}	
-		}
-		n++;
-	} while (flag);
-	delete pfrom;
-	delete pto;
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	return 0;
-}
-
-/** This function fills a layer with the objects selected in a theme
-	\param inTheme pointer to the source theme
-	\param outLayer pointer to the destination layer (already created)
-	\param selObj flag to indicate with objects of the theme should be copied.
-	\param txtTable pointer to a map<string,string> to return the old and
-	new names of the text tables
-*/
-bool TeCopyThemeToLayer(TeTheme* inTheme, TeLayer* outLayer, 
-							int selObj, map<string,string> *txtTable=0);
-
-/** This function fills a layer with the objects selected in a theme
-	\param inTheme pointer to the source theme
-	\param outLayer pointer to the destination layer (already created)
-	\param selObj flag to indicate with objects of the theme should be copied.
-	\param txtTable pointer to a map<string,string> to return the old and
-	new names of the text tables
-*/
-bool TeCopyExternThemeToLayer(TeTheme* inTheme, TeLayer* outLayer, 
-							int selObj, map<string,string> *txtTable=0);
-
-/** This function copies a extern layer to another local
-	\param inLayer pointer to the source theme
-	\param outLayer pointer to the destination layer (already created)
-	\param txtTable pointer to a map<string,string> to return the old and
-	new names of the text tables
-*/
-bool TeCopyLayerToLayer(TeLayer* inLayer, TeLayer* outLayer, map<string,string> *txtTable=0);
-
-/** \example copyLayer.cpp
-	Shows how to duplicate a layer changing its projection.
- */
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeLayerFunctions.h
+    \brief This file contains functions to manipulate layers 
+*/
+#ifndef  __TERRALIB_INTERNAL_LAYERFUNCTIONS_H
+#define  __TERRALIB_INTERNAL_LAYERFUNCTIONS_H
+
+#include "TeLayer.h"
+#include "TeVectorRemap.h"
+#include "TeTheme.h"
+#include "TeDatabase.h"
+#include "TeProgress.h"
+
+#include "TeFunctionsDefines.h"
+
+/** Imports a geometry set to a layer, creating an empty attribute table
+	This function imports a geometry set to a layer.
+	An attribute table is automatically created with only the object_id field.
+	If geometries don�t have object ids a unique identification will be automatically generated
+	\param layer pointer to a layer previously created 
+    \param geomSet the geometry set
+    \return TRUE or FALSE whether the geometry set was imported successfully
+*/
+template <class G>
+bool TeImportGeometriesToLayer(TeLayer* layer, G& geomSet)
+{
+	if (!layer)
+
+		return false;
+
+	TeDatabase* db = layer->database();
+	int nTab = 0;
+	TeAttrTableVector attTables;
+	if (layer->getAttrTables(attTables))
+		nTab = attTables.size();
+	
+	string tabName = "AttributeTable_" + Te2String(layer->id()) + "_" + Te2String(nTab); 
+	TeAttributeList attList;
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.numChar_ = 16;
+	at.rep_.name_ = "object_id";
+	at.rep_.isPrimaryKey_ = true;
+	attList.push_back(at);
+
+	TeTable attTable(tabName,attList,"object_id", "object_id",TeAttrStatic);
+
+	TeTableRow row;
+	for (int i=0; i<geomSet.size(); i++)
+	{
+		row.clear();
+		string id = geomSet[i].objectId();
+		if (id.empty())
+		{
+			id = Te2String(i);
+			geomSet[i].objectId(id);
+		}
+		row.push_back(id);
+		attTable.add(row);
+	}
+	
+	if (!layer->addGeometrySet(geomSet))
+	{
+		attTable.clear();
+		db->deleteLayer(layer->id());
+		return false;
+	}
+	
+	if (!layer->createAttributeTable(attTable))
+	{
+		attTable.clear();
+		db->deleteLayer(layer->id());
+		return false;
+	}
+
+	if (!layer->saveAttributeTable(attTable))
+	{
+		attTable.clear();
+		db->deleteLayer(layer->id());
+		return false;
+	}
+	
+	attTable.clear();
+	return true;
+}
+
+/** Copy the geometries retrieved in a portal to layer
+	\param portal pointer to a portal that has executed a query for geometries
+	\param proj pointer to the projection associated to the geometries
+	\param layer pointer to the destination layer 
+	\param tname optional parameter indicating the name of a table to store the geometries
+*/
+template<typename GS>
+GS* 
+TeCopyPortalGeometriesToLayer(TeDatabasePortal* portal, TeProjection* proj, TeLayer* layer, const string& tName="")
+{
+	if (!portal ||!layer)
+		return 0;
+
+	TeProjection* pfrom = TeProjectionFactory::make(proj->params());
+	TeProjection* pto = TeProjectionFactory::make(layer->projection()->params());
+	bool doRemap;
+	if (!pfrom || !pto || (pfrom->name() == "NoProjection" ||  pto->name() == "NoProjection") && 
+		!(pfrom->name() == pto->name()))
+		doRemap = false;
+	else
+		doRemap= !(*pfrom == *pto);
+
+	if (doRemap)
+		pfrom->setDestinationProjection(pto);
+	
+	if (TeProgress::instance())
+			TeProgress::instance()->setTotalSteps(portal->numRows());
+
+	GS set1;
+	int n = 1; 
+	bool flag=false;
+	do
+	{
+		typename GS::value_type elemI;
+		flag = portal->fetchGeometry(elemI);
+		if (doRemap)
+		{
+			typename GS::value_type elemO;
+			TeVectorRemap(elemI,pfrom,elemO,pto);
+			elemO.objectId(elemI.objectId());
+			set1.add(elemO);
+		}
+		else
+		{
+			set1.add(elemI);
+			set1[set1.size()-1].objectId(elemI.objectId()); 
+		}
+
+		if (((n%100) == 0) || !flag)
+		{	
+			layer->addGeometrySet(set1,tName);
+			set1.clear();
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				else
+					TeProgress::instance()->setProgress(n);
+			}	
+		}
+		n++;
+	} while (flag);
+	delete pfrom;
+	delete pto;
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	return 0;
+}
+
+/** This function fills a layer with the objects selected in a theme
+	\param inTheme pointer to the source theme
+	\param outLayer pointer to the destination layer (already created)
+	\param selObj flag to indicate with objects of the theme should be copied.
+	\param txtTable pointer to a map<string,string> to return the old and
+	new names of the text tables
+*/
+TLFUNCTIONS_DLL bool TeCopyThemeToLayer(TeTheme* inTheme, TeLayer* outLayer, 
+							int selObj, map<string,string> *txtTable=0);
+
+/** This function fills a layer with the objects selected in a theme
+	\param inTheme pointer to the source theme
+	\param outLayer pointer to the destination layer (already created)
+	\param selObj flag to indicate with objects of the theme should be copied.
+	\param txtTable pointer to a map<string,string> to return the old and
+	new names of the text tables
+*/
+TLFUNCTIONS_DLL bool TeCopyExternThemeToLayer(TeTheme* inTheme, TeLayer* outLayer, 
+							int selObj, map<string,string> *txtTable=0);
+
+/** This function copies a extern layer to another local
+	\param inLayer pointer to the source theme
+	\param outLayer pointer to the destination layer (already created)
+	\param txtTable pointer to a map<string,string> to return the old and
+	new names of the text tables
+*/
+TLFUNCTIONS_DLL bool TeCopyLayerToLayer(TeLayer* inLayer, TeLayer* outLayer, map<string,string> *txtTable=0);
+
+/** \example copyLayer.cpp
+	Shows how to duplicate a layer changing its projection.
+ */
+#endif
diff --git a/src/terralib/functions/TeMIFProjection.cpp b/src/terralib/functions/TeMIFProjection.cpp
old mode 100755
new mode 100644
index 34a815b..c785160
--- a/src/terralib/functions/TeMIFProjection.cpp
+++ b/src/terralib/functions/TeMIFProjection.cpp
@@ -1,341 +1,341 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32 
-#pragma warning ( disable: 4786 ) 
-#endif 
-
-#include <map>
-#include <string>
-#include "TeMIFProjection.h"
-#include "TeDatum.h"
-#include "TeProjection.h"
-#include "TeException.h"
-#include "TeUtils.h"
-#include <cstdlib>
-
-using namespace std;
-/*--- 
-Projection Information
-
-contains information about the parameters
-needed by each projection
-
-parameters are:
-
-- Name
-- Datum 
-- Units 
-- Origin Longitude,
-- Origin Latitude,
-- Standard Paralel 1
-- Standard Paralel 2
-- Scale Factor
-- False Easting
-- False Northing 
-- Range
-
----*/
-
-const int NUM_MIF_PROJ = 7;
-const int NUM_MIF_DATUM = 19;
-const int NUM_MIF_UNITS = 13;
-
-
-// Name            Units  Long  Lat  Par1  Par2	Sca  Eas  Nor 
-char* mifProjInfo[]= {
-"LatLong",          "0",  "0",  "0", "0",  "0",	"0", "0", "0", 
-"Albers",           "1",  "1",  "1", "1",  "1",	"0", "1", "1", 
-"LambertConformal", "1",  "1",  "1", "1",  "1",	"0", "1", "1", 
-"Mercator",         "1",  "1",  "0", "0",  "0",	"0", "0", "0", 
-"Miller",           "1",  "1",  "0", "0",  "0",	"0", "0", "0", 
-"UTM",              "1",  "1",  "1", "0",  "0",	"1", "1", "1", 
-"Polyconic",        "1",  "1",  "1", "1",  "0",	"0", "1", "1"
-};
-
-char* mifProjCode[]= {
-"1", "LatLong",
-"3",  "LambertConformal",
-"8",  "UTM",
-"9",  "Albers",
-"10", "Mercator", 
-"11", "Miller",
-"27", "Polyconic"
-};
-
-char* mifDatumCode[] = {
-"0",   "Spherical",
-"23",  "Astro-Chua",	
-"24",  "CorregoAlegre",
-"40",  "Indian",
-"41",  "Indian",
-"62",  "NAD27",
-"63",  "NAD27",
-"64",  "NAD27",
-"65",  "NAD27",
-"66",  "NAD27",
-"67",  "NAD27",
-"68",  "NAD27",
-"69",  "NAD27",
-"70",  "NAD27",
-"71",  "NAD27",
-"72",  "NAD27",
-"74",  "NAD83",
-"92",  "SAD69",
-"104", "WGS84"
-};
-
-char* mifUnitsCode[] = {
-"6",  "Centimeters",
-"31", "Chains",
-"3",  "Feet",
-"2",  "Inches",
-"1",  "Kilometers",
-"30", "Links",
-"7",  "Meters",
-"0",  "Miles",
-"5",  "Millimeters",
-"9",  "Nautical Miles",
-"32", "Rods",
-"8",  "US Survey Feet",
-"4",  "Yards"
-};
-
-
-
-// Definitions for types used
-typedef map<int,string> NameMap;
-typedef map<int, string> MIFCodeMap;
-
-// Prototypes for aux functions
-
-TeProjInfo TeMIFProjectionInfo  ( const string& projName  );
-TeDatum TeMIFProjectionDatum    ( const int&  datCode );
-string TeMIFProjectionName      ( const int&  prjCode );
-string TeMIFProjectionUnits	( const int& unitsCode );
-
-
-TeProjection*
-TeMIFProjectionFactory::make ( vector<string>& argList )
-{
-	// Create a TerraLib projection from MIF information]
-	// INPUT - a list of parameters
-
-	int argInd = 0;
-
-	TeProjectionParams params;
-	params.hemisphere = TeSOUTH_HEM;
-
-	// Step 1 - read the projection name
-	
-	int projCode = atoi( argList[argInd++].c_str() );
-
-	params.name = TeMIFProjectionName ( projCode );
-
-	// Step 2 - read the datum
-
-	int datumCode = atoi( argList[argInd++].c_str() );
-	TeProjInfo pjInfo;
-	try 
-	{    
-		params.datum = TeMIFProjectionDatum ( datumCode );
-		// Step 3 - Build a map of Projection info
-		pjInfo = TeMIFProjectionInfo ( params.name );
-	}
-	catch (...)
-	{
-		TeProjection* nproj = new TeNoProjection();
-		return nproj;
-	}
-
-	// Step 4 - Read the appropriate parameters
-
-	if ( pjInfo.hasUnits ) 
-	{
-		string unitsName = argList[argInd++];
-		string unitsName2 = TeRemoveSpecialChars(unitsName);
-		if (unitsName2 == "m" || unitsName2 == "M")
-			unitsName2 = "Meters";
-		params.units = unitsName2;
-	}
-	else
-		params.units = "DecimalDegrees"; 
-
-	string val; 
-	if ( pjInfo.hasLon0 )
-	{
-		val = argList[argInd++].c_str();
-		params.lon0 = atof(val.c_str())*TeCDR;
-	}
-
-	if ( pjInfo.hasLat0 )
-	{
-		val = argList[argInd++].c_str();
-		params.lat0 = atof(val.c_str())*TeCDR;
-	}
-
-	if ( pjInfo.hasStlat1 )
-	{
-		val = argList[argInd++].c_str();
-		params.stlat1 = atof(val.c_str())*TeCDR;
-	}
-
-	if ( pjInfo.hasStlat2 )
-	{
-		val = argList[argInd++].c_str();
-		params.stlat2 = atof(val.c_str())*TeCDR;
-	}
-
-	if ( pjInfo.hasScale )
-	{
-		val = argList[argInd++].c_str();
-		params.scale = atof(val.c_str());
-	}
-
-	if ( pjInfo.hasOffx )
-	{
-		val = argList[argInd++].c_str();
-		params.offx = atof(val.c_str());
-	}
-
-	if ( pjInfo.hasOffy )
-	{
-		val = argList[argInd++].c_str();
-		params.offy = atof(val.c_str());
-	}
-
-	// Step 4 - create the projection
-
-	return TeProjectionFactory::make ( params );
-}
-
-
-TeProjInfo
-TeMIFProjectionInfo ( const string& projName  )
-{
-
-	TeProjInfoMap pjMap;
-	TeProjInfo pjInfo;
-
-	int k = 0;
-
-	for ( int i = 0; i < NUM_MIF_PROJ; i++ )
-	{
-		string name = mifProjInfo [k++];
-			
-	    pjInfo.hasUnits  = atoi ( mifProjInfo [k++] );
-	    pjInfo.hasLon0   = atoi ( mifProjInfo [k++] );
-	    pjInfo.hasLat0   = atoi ( mifProjInfo [k++] );
-	    pjInfo.hasStlat1 = atoi ( mifProjInfo [k++] );
-		pjInfo.hasStlat2 = atoi ( mifProjInfo [k++] );
-		pjInfo.hasScale  = atoi ( mifProjInfo [k++] );
-		pjInfo.hasOffx   = atoi ( mifProjInfo [k++] );
-	    pjInfo.hasOffy   = atoi ( mifProjInfo [k++] );
-
-		pjMap [ name ] = pjInfo;
-	}
-
-
-	TeProjInfoMap::iterator it = pjMap.find ( projName );
-
-	if ( it == pjMap.end() )
-		throw TeException ( PROJECTION_NOT_AVAILABLE );
-
-return (*it).second;
-}
-
-TeDatum
-TeMIFProjectionDatum ( const int& datCode )
-{
-
-	MIFCodeMap datumCode;
-
-	int k= 0;
-
-	for ( int i = 0; i < NUM_MIF_DATUM; i++ )
-	{
-		int code    = atoi ( mifDatumCode [k++] );
-		string name = mifDatumCode [k++];
-
-		datumCode [ code ] = name;
-	}
-
-	MIFCodeMap::iterator it = datumCode.find ( datCode );
-
-	if ( it == datumCode.end() )
-		throw TeException ( DATUM_ERROR );			
-		
-    string datName = (*it).second;
-
-	return TeDatumFactory::make ( datName );
-
-}
-
-string
-TeMIFProjectionName ( const int& prjCode )
-{
-
-	MIFCodeMap projCode;
-	
-	int k= 0;
-
-	for ( int i = 0; i < NUM_MIF_PROJ; i++ )
-	{
-		int code    = atoi ( mifProjCode [k++] );
-		string name = mifProjCode [k++];
-
-		projCode [ code ] = name;
-	}
-
-	MIFCodeMap::iterator it = projCode.find ( prjCode );
-
-	if ( it == projCode.end() )
-		throw TeException ( PROJECTION_NOT_AVAILABLE );
-
-return (*it).second;
-
-}
-
-string 
-TeMIFProjectionUnits ( const int& code )
-{
-	MIFCodeMap unitsCode;
-	
-	int k= 0;
-
-	for ( int i = 0; i < NUM_MIF_UNITS; i++ )
-	{
-		int code    = atoi ( mifUnitsCode [k++] );
-		string name = mifUnitsCode [k++];
-
-		unitsCode [ code ] = name;
-	}
-
-	MIFCodeMap::iterator it = unitsCode.find ( code );
-
-	if ( it == unitsCode.end() )
-		return "Meters";
-
-return (*it).second;
-
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32 
+#pragma warning ( disable: 4786 ) 
+#endif 
+
+#include <map>
+#include <string>
+#include "TeMIFProjection.h"
+#include "TeDatum.h"
+#include "TeProjection.h"
+#include "TeException.h"
+#include "TeUtils.h"
+#include <cstdlib>
+
+using namespace std;
+/*--- 
+Projection Information
+
+contains information about the parameters
+needed by each projection
+
+parameters are:
+
+- Name
+- Datum 
+- Units 
+- Origin Longitude,
+- Origin Latitude,
+- Standard Paralel 1
+- Standard Paralel 2
+- Scale Factor
+- False Easting
+- False Northing 
+- Range
+
+---*/
+
+const int NUM_MIF_PROJ = 7;
+const int NUM_MIF_DATUM = 19;
+const int NUM_MIF_UNITS = 13;
+
+
+// Name            Units  Long  Lat  Par1  Par2	Sca  Eas  Nor 
+char* mifProjInfo[]= {
+"LatLong",          "0",  "0",  "0", "0",  "0",	"0", "0", "0", 
+"Albers",           "1",  "1",  "1", "1",  "1",	"0", "1", "1", 
+"LambertConformal", "1",  "1",  "1", "1",  "1",	"0", "1", "1", 
+"Mercator",         "1",  "1",  "0", "0",  "0",	"0", "0", "0", 
+"Miller",           "1",  "1",  "0", "0",  "0",	"0", "0", "0", 
+"UTM",              "1",  "1",  "1", "0",  "0",	"1", "1", "1", 
+"Polyconic",        "1",  "1",  "1", "1",  "0",	"0", "1", "1"
+};
+
+char* mifProjCode[]= {
+"1", "LatLong",
+"3",  "LambertConformal",
+"8",  "UTM",
+"9",  "Albers",
+"10", "Mercator", 
+"11", "Miller",
+"27", "Polyconic"
+};
+
+char* mifDatumCode[] = {
+"0",   "Spherical",
+"23",  "Astro-Chua",	
+"24",  "CorregoAlegre",
+"40",  "Indian",
+"41",  "Indian",
+"62",  "NAD27",
+"63",  "NAD27",
+"64",  "NAD27",
+"65",  "NAD27",
+"66",  "NAD27",
+"67",  "NAD27",
+"68",  "NAD27",
+"69",  "NAD27",
+"70",  "NAD27",
+"71",  "NAD27",
+"72",  "NAD27",
+"74",  "NAD83",
+"92",  "SAD69",
+"104", "WGS84"
+};
+
+char* mifUnitsCode[] = {
+"6",  "Centimeters",
+"31", "Chains",
+"3",  "Feet",
+"2",  "Inches",
+"1",  "Kilometers",
+"30", "Links",
+"7",  "Meters",
+"0",  "Miles",
+"5",  "Millimeters",
+"9",  "Nautical Miles",
+"32", "Rods",
+"8",  "US Survey Feet",
+"4",  "Yards"
+};
+
+
+
+// Definitions for types used
+typedef map<int,string> NameMap;
+typedef map<int, string> MIFCodeMap;
+
+// Prototypes for aux functions
+
+TeProjInfo TeMIFProjectionInfo  ( const string& projName  );
+TeDatum TeMIFProjectionDatum    ( const int&  datCode );
+string TeMIFProjectionName      ( const int&  prjCode );
+string TeMIFProjectionUnits	( const int& unitsCode );
+
+
+TeProjection*
+TeMIFProjectionFactory::make ( vector<string>& argList )
+{
+	// Create a TerraLib projection from MIF information]
+	// INPUT - a list of parameters
+
+	int argInd = 0;
+
+	TeProjectionParams params;
+	params.hemisphere = TeSOUTH_HEM;
+
+	// Step 1 - read the projection name
+	
+	int projCode = atoi( argList[argInd++].c_str() );
+
+	params.name = TeMIFProjectionName ( projCode );
+
+	// Step 2 - read the datum
+
+	int datumCode = atoi( argList[argInd++].c_str() );
+	TeProjInfo pjInfo;
+	try 
+	{    
+		params.datum = TeMIFProjectionDatum ( datumCode );
+		// Step 3 - Build a map of Projection info
+		pjInfo = TeMIFProjectionInfo ( params.name );
+	}
+	catch (...)
+	{
+		TeProjection* nproj = new TeNoProjection();
+		return nproj;
+	}
+
+	// Step 4 - Read the appropriate parameters
+
+	if ( pjInfo.hasUnits ) 
+	{
+		string unitsName = argList[argInd++];
+		string unitsName2 = TeRemoveSpecialChars(unitsName);
+		if (unitsName2 == "m" || unitsName2 == "M")
+			unitsName2 = "Meters";
+		params.units = unitsName2;
+	}
+	else
+		params.units = "DecimalDegrees"; 
+
+	string val; 
+	if ( pjInfo.hasLon0 )
+	{
+		val = argList[argInd++].c_str();
+		params.lon0 = atof(val.c_str())*TeCDR;
+	}
+
+	if ( pjInfo.hasLat0 )
+	{
+		val = argList[argInd++].c_str();
+		params.lat0 = atof(val.c_str())*TeCDR;
+	}
+
+	if ( pjInfo.hasStlat1 )
+	{
+		val = argList[argInd++].c_str();
+		params.stlat1 = atof(val.c_str())*TeCDR;
+	}
+
+	if ( pjInfo.hasStlat2 )
+	{
+		val = argList[argInd++].c_str();
+		params.stlat2 = atof(val.c_str())*TeCDR;
+	}
+
+	if ( pjInfo.hasScale )
+	{
+		val = argList[argInd++].c_str();
+		params.scale = atof(val.c_str());
+	}
+
+	if ( pjInfo.hasOffx )
+	{
+		val = argList[argInd++].c_str();
+		params.offx = atof(val.c_str());
+	}
+
+	if ( pjInfo.hasOffy )
+	{
+		val = argList[argInd++].c_str();
+		params.offy = atof(val.c_str());
+	}
+
+	// Step 4 - create the projection
+
+	return TeProjectionFactory::make ( params );
+}
+
+
+TeProjInfo
+TeMIFProjectionInfo ( const string& projName  )
+{
+
+	TeProjInfoMap pjMap;
+	TeProjInfo pjInfo;
+
+	int k = 0;
+
+	for ( int i = 0; i < NUM_MIF_PROJ; i++ )
+	{
+		string name = mifProjInfo [k++];
+			
+	    pjInfo.hasUnits  = atoi ( mifProjInfo [k++] );
+	    pjInfo.hasLon0   = atoi ( mifProjInfo [k++] );
+	    pjInfo.hasLat0   = atoi ( mifProjInfo [k++] );
+	    pjInfo.hasStlat1 = atoi ( mifProjInfo [k++] );
+		pjInfo.hasStlat2 = atoi ( mifProjInfo [k++] );
+		pjInfo.hasScale  = atoi ( mifProjInfo [k++] );
+		pjInfo.hasOffx   = atoi ( mifProjInfo [k++] );
+	    pjInfo.hasOffy   = atoi ( mifProjInfo [k++] );
+
+		pjMap [ name ] = pjInfo;
+	}
+
+
+	TeProjInfoMap::iterator it = pjMap.find ( projName );
+
+	if ( it == pjMap.end() )
+		throw TeException ( PROJECTION_NOT_AVAILABLE );
+
+return (*it).second;
+}
+
+TeDatum
+TeMIFProjectionDatum ( const int& datCode )
+{
+
+	MIFCodeMap datumCode;
+
+	int k= 0;
+
+	for ( int i = 0; i < NUM_MIF_DATUM; i++ )
+	{
+		int code    = atoi ( mifDatumCode [k++] );
+		string name = mifDatumCode [k++];
+
+		datumCode [ code ] = name;
+	}
+
+	MIFCodeMap::iterator it = datumCode.find ( datCode );
+
+	if ( it == datumCode.end() )
+		throw TeException ( DATUM_ERROR );			
+		
+    string datName = (*it).second;
+
+	return TeDatumFactory::make ( datName );
+
+}
+
+string
+TeMIFProjectionName ( const int& prjCode )
+{
+
+	MIFCodeMap projCode;
+	
+	int k= 0;
+
+	for ( int i = 0; i < NUM_MIF_PROJ; i++ )
+	{
+		int code    = atoi ( mifProjCode [k++] );
+		string name = mifProjCode [k++];
+
+		projCode [ code ] = name;
+	}
+
+	MIFCodeMap::iterator it = projCode.find ( prjCode );
+
+	if ( it == projCode.end() )
+		throw TeException ( PROJECTION_NOT_AVAILABLE );
+
+return (*it).second;
+
+}
+
+string 
+TeMIFProjectionUnits ( const int& code )
+{
+	MIFCodeMap unitsCode;
+	
+	int k= 0;
+
+	for ( int i = 0; i < NUM_MIF_UNITS; i++ )
+	{
+		int code    = atoi ( mifUnitsCode [k++] );
+		string name = mifUnitsCode [k++];
+
+		unitsCode [ code ] = name;
+	}
+
+	MIFCodeMap::iterator it = unitsCode.find ( code );
+
+	if ( it == unitsCode.end() )
+		return "Meters";
+
+return (*it).second;
+
+}
diff --git a/src/terralib/functions/TeMIFProjection.h b/src/terralib/functions/TeMIFProjection.h
old mode 100755
new mode 100644
index 1bfad7d..e9cd7c5
--- a/src/terralib/functions/TeMIFProjection.h
+++ b/src/terralib/functions/TeMIFProjection.h
@@ -1,41 +1,43 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMIFProjection.h
-    \brief This file contains the support to decode projection definitions in MID/MIF formats 
-*/
-#ifndef  __TERRALIB_INTERNAL_MIFPROJECTION_H
-#define  __TERRALIB_INTERNAL_MIFPROJECTION_H
-
-#include <vector>
-#include <string>
-using namespace std;
-
-class TeProjection;
-//! A factory to build projection from some MIF parameters stored in a vector of strings
-class TeMIFProjectionFactory
-{
-public:
-	static TeProjection* make ( vector<string>& );
-};
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMIFProjection.h
+    \brief This file contains the support to decode projection definitions in MID/MIF formats 
+*/
+#ifndef  __TERRALIB_INTERNAL_MIFPROJECTION_H
+#define  __TERRALIB_INTERNAL_MIFPROJECTION_H
+
+#include <vector>
+#include <string>
+using namespace std;
+
+#include "TeFunctionsDefines.h"
+
+class TeProjection;
+//! A factory to build projection from some MIF parameters stored in a vector of strings
+class TLFUNCTIONS_DLL TeMIFProjectionFactory
+{
+public:
+	static TeProjection* make ( vector<string>& );
+};
+#endif
+
diff --git a/src/terralib/functions/TeMemoryZonal.cpp b/src/terralib/functions/TeMemoryZonal.cpp
index c5e02a4..888c43e 100644
--- a/src/terralib/functions/TeMemoryZonal.cpp
+++ b/src/terralib/functions/TeMemoryZonal.cpp
@@ -1,90 +1,90 @@
-
-#include "TeMemoryZonal.h"
-#include "TeRasterIteratorSet.h"
-
-bool TeMemoryZonal(TeRaster* raster, TePolygon& poly, TeStatisticsDimensionVect& result)
-{
-  TeRaster::iteratorPoly itBegin = raster->begin(poly, TeBoxPixelIn);
-  TeRaster::iteratorPoly itEnd = raster->end(poly, TeBoxPixelIn);
-  if (itBegin == itEnd)  // try an approximation for the special case it is a special case
-  {
-    TeCoord2D pll = raster->coord2Index(TeCoord2D(poly.box().lowerLeft()));
-    TeCoord2D pur = raster->coord2Index(TeCoord2D(poly.box().upperRight()));
-
-    TeCoord2D ii(TeRoundRasterIndex(pll.x()),TeRoundRasterIndex(pll.y()));
-    TeCoord2D jj(TeRoundRasterIndex(pur.x()),TeRoundRasterIndex(pur.y()));
-
-    TeCoord2D ll = raster->index2Coord(pll);
-    TeCoord2D ur = raster->index2Coord(pur);
-
-    ll.x_-= raster->params().resx_/2.;
-    ll.y_-= raster->params().resy_/2.;
-    
-    ur.x_+= raster->params().resx_/2.;
-    ur.y_+= raster->params().resy_/2.;
-
-    TeBox bb(ll,ur);
-    TePolygon pol = polygonFromBox(bb);
-    itBegin = raster->begin(pol, TeBoxPixelIn);
-    itEnd = raster->end(pol, TeBoxPixelIn);
-    if (itBegin == itEnd)
-      return false;
-  }
-  if(!TeCalculateStatistics (itBegin, itEnd, result))
-    return false;
-
-  return true;
-}
-
-
-bool TePolygonSetMemoryZonal(TeRaster* raster, TePolygonSet& ps, TeStatisticsDimensionVect& result)
-{
-  RasterIteratorSet<TeRaster::iteratorPoly> iset;
-
-  // Inclui em iset pares de iteradores para cada poligono do conjunto
-  for(int i=0, size=ps.size(); i<size; i++)
-  {
-    TePolygon& poly = ps[i];
-    TeRaster::iteratorPoly itBegin = raster->begin(poly, TeBoxPixelIn);
-    TeRaster::iteratorPoly itEnd   = raster->end(poly, TeBoxPixelIn);
-    if(itBegin == itEnd)  // try an approximation for the special case it is a special case
-    {
-      TeCoord2D pll = raster->coord2Index(TeCoord2D(poly.box().lowerLeft()));
-      TeCoord2D pur = raster->coord2Index(TeCoord2D(poly.box().upperRight()));
-
-      TeCoord2D ii(TeRoundRasterIndex(pll.x()),TeRoundRasterIndex(pll.y()));
-      TeCoord2D jj(TeRoundRasterIndex(pur.x()),TeRoundRasterIndex(pur.y()));
-
-      TeCoord2D ll = raster->index2Coord(pll);
-      TeCoord2D ur = raster->index2Coord(pur);
-
-      ll.x_-= raster->params().resx_/2.;
-      ll.y_-= raster->params().resy_/2.;
-    
-      ur.x_+= raster->params().resx_/2.;
-      ur.y_+= raster->params().resy_/2.;
-
-      TeBox bb(ll,ur);
-      TePolygon pol = polygonFromBox(bb);
-      itBegin = raster->begin(pol, TeBoxPixelIn);
-      itEnd = raster->end(pol, TeBoxPixelIn);
-      if(itBegin == itEnd)
-        continue;
-    }
-    iset.addIterator(itBegin, itEnd);
-  }
-  
-  // Calcula estt�sticas passando iterador que percorre todos os poligonos 
-  // recebidos.  
-  // Obs: typedef abaixo necess�rio para o gcc se entender com os tipos
-  typedef RasterIteratorSet<TeRaster::iteratorPoly>::iterator setIterator;
-  setIterator begin = iset.begin(); 
-  setIterator end   = iset.end(); 
-  if(!TeCalculateStatistics (begin, end, result))
-    return false;
-
-  return true;
-}                     
-
-
-
+
+#include "TeMemoryZonal.h"
+#include "TeRasterIteratorSet.h"
+
+bool TeMemoryZonal(TeRaster* raster, TePolygon& poly, TeStatisticsDimensionVect& result)
+{
+  TeRaster::iteratorPoly itBegin = raster->begin(poly, TeBoxPixelIn);
+  TeRaster::iteratorPoly itEnd = raster->end(poly, TeBoxPixelIn);
+  if (itBegin == itEnd)  // try an approximation for the special case it is a special case
+  {
+    TeCoord2D pll = raster->coord2Index(TeCoord2D(poly.box().lowerLeft()));
+    TeCoord2D pur = raster->coord2Index(TeCoord2D(poly.box().upperRight()));
+
+    TeCoord2D ii(TeRoundRasterIndex(pll.x()),TeRoundRasterIndex(pll.y()));
+    TeCoord2D jj(TeRoundRasterIndex(pur.x()),TeRoundRasterIndex(pur.y()));
+
+    TeCoord2D ll = raster->index2Coord(pll);
+    TeCoord2D ur = raster->index2Coord(pur);
+
+    ll.x_-= raster->params().resx_/2.;
+    ll.y_-= raster->params().resy_/2.;
+    
+    ur.x_+= raster->params().resx_/2.;
+    ur.y_+= raster->params().resy_/2.;
+
+    TeBox bb(ll,ur);
+    TePolygon pol = polygonFromBox(bb);
+    itBegin = raster->begin(pol, TeBoxPixelIn);
+    itEnd = raster->end(pol, TeBoxPixelIn);
+    if (itBegin == itEnd)
+      return false;
+  }
+  if(!TeCalculateStatistics (itBegin, itEnd, result))
+    return false;
+
+  return true;
+}
+
+
+bool TePolygonSetMemoryZonal(TeRaster* raster, TePolygonSet& ps, TeStatisticsDimensionVect& result)
+{
+  RasterIteratorSet<TeRaster::iteratorPoly> iset;
+
+  // Inclui em iset pares de iteradores para cada poligono do conjunto
+  for(int i=0, size=ps.size(); i<size; i++)
+  {
+    TePolygon& poly = ps[i];
+    TeRaster::iteratorPoly itBegin = raster->begin(poly, TeBoxPixelIn);
+    TeRaster::iteratorPoly itEnd   = raster->end(poly, TeBoxPixelIn);
+    if(itBegin == itEnd)  // try an approximation for the special case it is a special case
+    {
+      TeCoord2D pll = raster->coord2Index(TeCoord2D(poly.box().lowerLeft()));
+      TeCoord2D pur = raster->coord2Index(TeCoord2D(poly.box().upperRight()));
+
+      TeCoord2D ii(TeRoundRasterIndex(pll.x()),TeRoundRasterIndex(pll.y()));
+      TeCoord2D jj(TeRoundRasterIndex(pur.x()),TeRoundRasterIndex(pur.y()));
+
+      TeCoord2D ll = raster->index2Coord(pll);
+      TeCoord2D ur = raster->index2Coord(pur);
+
+      ll.x_-= raster->params().resx_/2.;
+      ll.y_-= raster->params().resy_/2.;
+    
+      ur.x_+= raster->params().resx_/2.;
+      ur.y_+= raster->params().resy_/2.;
+
+      TeBox bb(ll,ur);
+      TePolygon pol = polygonFromBox(bb);
+      itBegin = raster->begin(pol, TeBoxPixelIn);
+      itEnd = raster->end(pol, TeBoxPixelIn);
+      if(itBegin == itEnd)
+        continue;
+    }
+    iset.addIterator(itBegin, itEnd);
+  }
+  
+  // Calcula estt�sticas passando iterador que percorre todos os poligonos 
+  // recebidos.  
+  // Obs: typedef abaixo necess�rio para o gcc se entender com os tipos
+  typedef RasterIteratorSet<TeRaster::iteratorPoly>::iterator setIterator;
+  setIterator begin = iset.begin(); 
+  setIterator end   = iset.end(); 
+  if(!TeCalculateStatistics (begin, end, result))
+    return false;
+
+  return true;
+}                     
+
+
+
diff --git a/src/terralib/functions/TeMemoryZonal.h b/src/terralib/functions/TeMemoryZonal.h
index edf52d9..958cca4 100644
--- a/src/terralib/functions/TeMemoryZonal.h
+++ b/src/terralib/functions/TeMemoryZonal.h
@@ -1,49 +1,49 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMemoryZonal.h
-    \brief This file contains functions for calculate statistics  
-*/
-
-#ifndef _MEMORY_ZONAL_H_
-#define _MEMORY_ZONAL_H_
-
-#include <TeRaster.h>
-#include <TeStatistics.h>
-
-/*! Returns the statistics about raster overed by polygon
-
-\param raster  Raster loaded to memory
-\param ps	   Polygon to define the statistic area 
-\param result  Statistic struct to return
-*/
-bool TeMemoryZonal(TeRaster* raster, TePolygon& poly, TeStatisticsDimensionVect& result);
-
-
-/*! Returns the statistics about raster overed by a polygon list
-\param raster Raster loaded to memory
-\param ps     Polygon list to define the statistic area
-\param result Statistic struct to return
-*/
-bool TePolygonSetMemoryZonal(TeRaster* raster, TePolygonSet& ps, TeStatisticsDimensionVect& result);
-                     
-#endif                     
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMemoryZonal.h
+    \brief This file contains functions for calculate statistics  
+*/
+
+#ifndef _MEMORY_ZONAL_H_
+#define _MEMORY_ZONAL_H_
+
+#include <TeRaster.h>
+#include <TeStatistics.h>
+
+/*! Returns the statistics about raster overed by polygon
+
+\param raster  Raster loaded to memory
+\param ps	   Polygon to define the statistic area 
+\param result  Statistic struct to return
+*/
+bool TeMemoryZonal(TeRaster* raster, TePolygon& poly, TeStatisticsDimensionVect& result);
+
+
+/*! Returns the statistics about raster overed by a polygon list
+\param raster Raster loaded to memory
+\param ps     Polygon list to define the statistic area
+\param result Statistic struct to return
+*/
+bool TePolygonSetMemoryZonal(TeRaster* raster, TePolygonSet& ps, TeStatisticsDimensionVect& result);
+                     
+#endif                     
diff --git a/src/terralib/functions/TeRasterIteratorSet.h b/src/terralib/functions/TeRasterIteratorSet.h
index 230b69e..6618cd0 100644
--- a/src/terralib/functions/TeRasterIteratorSet.h
+++ b/src/terralib/functions/TeRasterIteratorSet.h
@@ -1,106 +1,106 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeRasterIteratorSet.h
-*/
-
-#ifndef _RASTER_ITERATOR_SET_H_
-#define _RASTER_ITERATOR_SET_H_
-
-#include <vector>
-
-/*! Classe respons�vel por gerar um iterador que percorre em sequ�ncia
-    todos os pontos retornados por um conjunto de iteradores raster.
-
-Implementada para ser utilizada apenas com tipos descendentes de 
-TeRaster::iterator.
-
-Para utiliz�-la, use a fun��o addIterator para incluir no conjunto 
-iteradores para os pol�gonos a serem percorridos. Utilize as fun��es
-begin() e end() para obter um novo conjunto de iteradores que percorre
-os pontos dos poligonos, na ordem em que eles foram inseridos no conjunto.
-
-N�o faz nenhuma verifica��o de sobreposi��o entre os pontos retornados
-pelos iteradores de cada pol�gono.  Se houver, o novo iterador ir�
-passar mais de uma vez por cada ponto.
-*/    
-template <class It> 
-class RasterIteratorSet
-{
-public:
-
-  class iterator : public It
-	{
-	  public:
-	  
-	    iterator()
-	      : _set(NULL), _currIndex(0) {}
-	  
-	    iterator(RasterIteratorSet<It>* set, unsigned index, It current)
-	      : It(current), _set(set), _currIndex(index) {}
-
-			iterator& operator++()
-			{
-			  if(It::operator++() == _set->_endSet.at(_currIndex) && 
-			     _currIndex < (_set->_endSet.size()-1))
-			  {   
-			    _currIndex++;
-			    // Altera estado para aquele do novo iterador
-    			It* ptr = (It*)this;
-		  	  *ptr = _set->_beginSet.at(_currIndex);
-			  }  
-			  return *this;
-			}
-
-			bool operator==(const iterator& rhs) const
-			{
-			  return (It::operator==(rhs) && _set == rhs._set && _currIndex == rhs._currIndex);
-			}
-
-			bool operator!=(const iterator& rhs) const
-			{
-			  return (It::operator!=(rhs) || _set != rhs._set || _currIndex != rhs._currIndex);
-			}
-	  
-	  private:
-	    RasterIteratorSet<It>* _set;
-	    unsigned               _currIndex;
-	};
-		
-	RasterIteratorSet() {}
-			
-	void addIterator(It begin, It end)
-	{
-	  _beginSet.push_back(begin);
-	  _endSet.push_back(end);
-	}
-
-	iterator begin() { return _beginSet.size() ? iterator(this, 0, _beginSet.at(0)) : iterator(); }
-	iterator end()	 { int i = _endSet.size()-1; return i >= 0 ? iterator(this, i, _endSet.at(i)) : iterator(); }
-
-private:
-  std::vector<It> _beginSet;
-  std::vector<It> _endSet;	
-};			
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeRasterIteratorSet.h
+*/
+
+#ifndef _RASTER_ITERATOR_SET_H_
+#define _RASTER_ITERATOR_SET_H_
+
+#include <vector>
+
+/*! Classe respons�vel por gerar um iterador que percorre em sequ�ncia
+    todos os pontos retornados por um conjunto de iteradores raster.
+
+Implementada para ser utilizada apenas com tipos descendentes de 
+TeRaster::iterator.
+
+Para utiliz�-la, use a fun��o addIterator para incluir no conjunto 
+iteradores para os pol�gonos a serem percorridos. Utilize as fun��es
+begin() e end() para obter um novo conjunto de iteradores que percorre
+os pontos dos poligonos, na ordem em que eles foram inseridos no conjunto.
+
+N�o faz nenhuma verifica��o de sobreposi��o entre os pontos retornados
+pelos iteradores de cada pol�gono.  Se houver, o novo iterador ir�
+passar mais de uma vez por cada ponto.
+*/    
+template <class It> 
+class RasterIteratorSet
+{
+public:
+
+  class iterator : public It
+	{
+	  public:
+	  
+	    iterator()
+	      : _set(NULL), _currIndex(0) {}
+	  
+	    iterator(RasterIteratorSet<It>* set, unsigned index, It current)
+	      : It(current), _set(set), _currIndex(index) {}
+
+			iterator& operator++()
+			{
+			  if(It::operator++() == _set->_endSet.at(_currIndex) && 
+			     _currIndex < (_set->_endSet.size()-1))
+			  {   
+			    _currIndex++;
+			    // Altera estado para aquele do novo iterador
+    			It* ptr = (It*)this;
+		  	  *ptr = _set->_beginSet.at(_currIndex);
+			  }  
+			  return *this;
+			}
+
+			bool operator==(const iterator& rhs) const
+			{
+			  return (It::operator==(rhs) && _set == rhs._set && _currIndex == rhs._currIndex);
+			}
+
+			bool operator!=(const iterator& rhs) const
+			{
+			  return (It::operator!=(rhs) || _set != rhs._set || _currIndex != rhs._currIndex);
+			}
+	  
+	  private:
+	    RasterIteratorSet<It>* _set;
+	    unsigned               _currIndex;
+	};
+		
+	RasterIteratorSet() {}
+			
+	void addIterator(It begin, It end)
+	{
+	  _beginSet.push_back(begin);
+	  _endSet.push_back(end);
+	}
+
+	iterator begin() { return _beginSet.size() ? iterator(this, 0, _beginSet.at(0)) : iterator(); }
+	iterator end()	 { int i = _endSet.size()-1; return i >= 0 ? iterator(this, i, _endSet.at(i)) : iterator(); }
+
+private:
+  std::vector<It> _beginSet;
+  std::vector<It> _endSet;	
+};			
+
+#endif
+
diff --git a/src/terralib/functions/TeSPRFile.cpp b/src/terralib/functions/TeSPRFile.cpp
old mode 100755
new mode 100644
index 2913f3d..5c97f72
--- a/src/terralib/functions/TeSPRFile.cpp
+++ b/src/terralib/functions/TeSPRFile.cpp
@@ -1,311 +1,311 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
- 
-#ifdef WIN32 
-#pragma warning ( disable: 4786 ) 
-#endif
-
-#include "TeSPRFile.h" 
-#include "TeAssertions.h" 
-#include "TeDefines.h"
-#include "TeProjection.h"
-#include "TeDatum.h"
-#include "TeUtils.h"
-#include "TeDataTypes.h"
-
-#include <cstdlib>
-  
-TeSPRFile::TeSPRFile ( const string& name, const char* mode, char separator): 	
-	TeAsciiFile ( name, mode  ),
-	separator_(separator)
-{}
-
-
-void
-TeSPRFile::writeLabelHeader ( const int& option )	 
-{
-	if (option == TeSPRNetwork) 
-		fprintf(file_,"%s\n", "NETWORK_OBJECTS" );
-	else 
-		fprintf(file_,"%s\n", "POINTS" ); 	
-	fprintf(file_,"%s\n", "INFO");
-	fprintf(file_,"%s %c \n", "SEPARATOR ",  separator_  );
-	fprintf(file_,"%s\n", "// SPRING Interchange File" );
-	
-	if (option == TeSPRThematic)
-		fprintf(file_,"%s \n", "// Format coordx ; coordy ; classe");	
-	else 
-		fprintf(file_,"%s \n", "// Format coordx ; coordy  ; label ; name ; category_obj");	
-	fprintf(file_,"%s\n", "INFO_END"); 
-}
-
- 
-void  
-TeSPRFile::writeCadastralLabel ( const string& geoid, const double& x, const double& y,
-					   const string& objectCategory) 
-{
-	if (geoid != "")
-	{
-		fprintf ( file_, "%.6f %c %.6f %c %s %c %s %c %s \n", 
-		(float)x, separator_, (float)y, separator_, geoid.c_str(), separator_, geoid.c_str(), separator_, objectCategory.c_str() );  
-	}
-}
-
-void 
-TeSPRFile::writeThematicLabel( const double& x, const double& y, const string& theme )
-{
-	if ( theme != "")
-		fprintf ( file_, "%.6f %c %.6f %c %s \n", 
-		(float)x, separator_, (float)y, separator_, theme.c_str() );  
-}
-
-void  
-TeSPRFile::writeNetworkLabel ( const string& geoid, const double& x, const double& y,
-					   const string& objectCategory, bool isL) 
-{
-	if (geoid != "")
-	{
-		if (isL)
-			fprintf ( file_, "%.6f %c %.6f %c %s %c %s %c %s %c LINES\n", 
-			(float)x, separator_, (float)y, separator_, geoid.c_str(), separator_, geoid.c_str(), separator_, objectCategory.c_str(), separator_ );  
-		else
-			fprintf ( file_, "%.6f %c %.6f %c %s %c %s %c %s %c NODES\n", 
-			(float)x, separator_, (float)y, separator_, geoid.c_str(), separator_, geoid.c_str(), separator_, objectCategory.c_str(), separator_ );  
-	}
-
-}
-
-
-void 
-TeSPRFile::writeThematicPoint( const double& x, const double& y, const string& theme )
-{
-	if ( theme != "")
-		fprintf ( file_, "%.6f %c %.6f %c %s \n", 
-		(float)x, separator_, (float)y, separator_, theme.c_str() );  
-	else
-		fprintf ( file_, "%.6f %c %.6f %c Nenhuma \n", 
-		(float)x, separator_, (float)y, separator_ );  
-
-}
-
-
-void 
-TeSPRFile::writeProjection( TeProjection* proj ) 
-{
-	if (proj)
-	{
-		fprintf ( file_, "PROJECTION %s/%s\n", proj->name().c_str(),proj->datum().name().c_str());
-	}
-}
-
-void 
-TeSPRFile::writeBox( TeBox& box ) 
-{
-	TeCoord2D pt1 = box.lowerLeft();
-	TeCoord2D pt2 = box.upperRight();
-
-	fprintf ( file_, "%s %.6f %.6f %.6f %.6f \n", "BOX", pt1.x(), pt1.y(), pt2.x(),  pt2.y());
-	fprintf ( file_, "%s\n", "// " );
-}
-  
-//===================================================
-//
-//  Write lines header information
-//
-//===================================================
-
-void
-TeSPRFile::writeLinesHeader ()  
-{
-	fprintf(file_,"%s\n", "LINES" );
-	fprintf(file_,"%s\n", "INFO");
-	fprintf(file_,"%s\n", "// SPRING Interchange File" );
-}
-
-
-
-//===================================================
-//
-//  TeSPRPoints- Write points header information
-//
-//===================================================
-
-void
-TeSPRFile::writePointsHeader ()  
-{
-	fprintf(file_,"%s\n", "POINT2D" );
-	fprintf(file_,"%s\n", "INFO");
-	fprintf(file_,"%s %c \n", "SEPARATOR ",  separator_  );
-	fprintf(file_,"%s\n", "// SPRING Interchange File" );
-}
-
-//===================================================
-//
-//  TeSPRTable - Write TABLE information
-//
-//===================================================
-
-void
-TeSPRFile::writeTableHeader (const int& /* dType */)  
-{
-	fprintf(file_,"%s\n", "TABLE" );
-	fprintf(file_,"%s\n", "INFO");
-	fprintf(file_,"%s %c\n", "SEPARATOR ", separator_ );
-	fprintf(file_,"%s\n", "UNFORMATED ");	
- } 
- 
-void 
-TeSPRFile::writeAttributeInfo( TeAttributeList& attList, const string& objCategory,
-							   const string& indexName ) 
-{
-	fprintf (file_, "%s %s \n", "CATEGORY_OBJ", objCategory.c_str() ); 	
-	fprintf (file_, "%s%c%s%c%s%c%s \n", "T_KEY", separator_, "TEXT", separator_, "32", separator_, "0"); 	
-
-	TeAttributeList::iterator it = attList.begin();
-	for ( ;it != attList.end();++it )
-	{
-		string name = (*it).rep_.name_;
-		if ( TeConvertToUpperCase(name) == TeConvertToUpperCase(indexName) ) continue; // skip the index name
-		switch ((*it).rep_.type_)
-		{
-			case TeSTRING:
-				this->writeTextParameterInfo(name, (*it).rep_.numChar_);
-				break;
-			case TeREAL:
-				this->writeRealParameterInfo(name);
-				break;
-			case TeINT:
-				this->writeIntParameterInfo(name);
-				break;
-			case TeCHARACTER:
-				this->writeTextParameterInfo(name,1);
-				break;
-			case TeDATETIME:
-				this->writeTextParameterInfo(name,25);
-            default:
-                break;
-		}
-	}  
-} 
-void
-TeSPRFile::writeTextParameterInfo ( const string& name, int w )
-{
-
-	char sprName [TeNAME_LENGTH];
-
-	int width = w;
-	if ( w == 0 )
-		width = name.size();
-
-	TeConvertToUpperCase ( name, sprName );
-
-	fprintf ( file_, "%s%c%s%c%d%c%d \n", sprName, separator_, "TEXT", separator_, width, separator_, 0 );
-}
-
-void
-TeSPRFile::writeRealParameterInfo ( const string& name )
-{
-	char sprName [TeNAME_LENGTH];
-
-	TeConvertToUpperCase ( name, sprName );
-
-	fprintf ( file_, "%s%c%s%c%d%c%d \n", sprName, separator_, "REAL", separator_, 17, separator_,8 );
-}
-
-void
-TeSPRFile::writeIntParameterInfo ( const string& name )
-{
-	char sprName [TeNAME_LENGTH];
-
-	TeConvertToUpperCase ( name, sprName );
-
-	fprintf ( file_, "%s%c%s%c%d%c%d \n", sprName, separator_, "INTEGER", separator_, 10, separator_, 0 );
-}
-
-void
-TeSPRFile::writeValue ( const string& value, TeAttrDataType type )
-{
-	switch ( type )
-	{
-		case TeINT :
-			writeValue ( atoi ( value.c_str())  ); 
-			break;
-		case TeREAL :
-			writeValue ( atof ( value.c_str())  ); 
-			break;
-		default :
-			writeValue ( value );
-	}
-
-}
-
-
-//===================================================
-//
-//  Write SAMPLE information
-//
-//===================================================
-
-void
-TeSPRFile::writeSampleHeader ()
-{
-	fprintf(file_,"%s\n", "SAMPLE" );
-	fprintf(file_,"%s\n", "INFO");
-	fprintf(file_,"%s %c \n", "SEPARATOR ",  separator_  );
-	fprintf(file_,"%s\n", "// SPRING Interchange File" );
-}
-
-
-void
-TeSPRFile::writeSample( const string& /* geoid */, const double& x, 
- 						  const double& y, const string& value) 
-{
-	fprintf ( file_, "%s \n", "POINT3D" );
-	fprintf ( file_, "%.6f %c %.6f %c %s \n", x, separator_, y, separator_, value.c_str() ); 
-	fprintf ( file_, "%s \n", "END" );
-}
-
-//===================================================
-//
-//  Write NETWORK information
-//
-//===================================================
-
-
-void 
-TeSPRFile::writeNetworkHeader()
-{
-	fprintf(file_,"%s\n", "NETWORK" );
-	fprintf(file_,"%s\n", "INFO");
-	fprintf(file_,"%s\n", "// SPRING Interchange File" );
-}
-
-
-void
-TeSPRFile::writeArcHeader ( const string& geoid, const double& posImp, 
-		const double& negImp, const double& demand)
-{
-	fprintf ( file_, "%s %.6f %.6f %.6f \n", geoid.c_str(), posImp, negImp, demand ); 
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+ 
+#ifdef WIN32 
+#pragma warning ( disable: 4786 ) 
+#endif
+
+#include "TeSPRFile.h" 
+#include "TeAssertions.h" 
+#include "TeDefines.h"
+#include "TeProjection.h"
+#include "TeDatum.h"
+#include "TeUtils.h"
+#include "TeDataTypes.h"
+
+#include <cstdlib>
+  
+TeSPRFile::TeSPRFile ( const string& name, const char* mode, char separator): 	
+	TeAsciiFile ( name, mode  ),
+	separator_(separator)
+{}
+
+
+void
+TeSPRFile::writeLabelHeader ( const int& option )	 
+{
+	if (option == TeSPRNetwork) 
+		fprintf(file_,"%s\n", "NETWORK_OBJECTS" );
+	else 
+		fprintf(file_,"%s\n", "POINTS" ); 	
+	fprintf(file_,"%s\n", "INFO");
+	fprintf(file_,"%s %c \n", "SEPARATOR ",  separator_  );
+	fprintf(file_,"%s\n", "// SPRING Interchange File" );
+	
+	if (option == TeSPRThematic)
+		fprintf(file_,"%s \n", "// Format coordx ; coordy ; classe");	
+	else 
+		fprintf(file_,"%s \n", "// Format coordx ; coordy  ; label ; name ; category_obj");	
+	fprintf(file_,"%s\n", "INFO_END"); 
+}
+
+ 
+void  
+TeSPRFile::writeCadastralLabel ( const string& geoid, const double& x, const double& y,
+					   const string& objectCategory) 
+{
+	if (geoid != "")
+	{
+		fprintf ( file_, "%.6f %c %.6f %c %s %c %s %c %s \n", 
+		(float)x, separator_, (float)y, separator_, geoid.c_str(), separator_, geoid.c_str(), separator_, objectCategory.c_str() );  
+	}
+}
+
+void 
+TeSPRFile::writeThematicLabel( const double& x, const double& y, const string& theme )
+{
+	if ( theme != "")
+		fprintf ( file_, "%.6f %c %.6f %c %s \n", 
+		(float)x, separator_, (float)y, separator_, theme.c_str() );  
+}
+
+void  
+TeSPRFile::writeNetworkLabel ( const string& geoid, const double& x, const double& y,
+					   const string& objectCategory, bool isL) 
+{
+	if (geoid != "")
+	{
+		if (isL)
+			fprintf ( file_, "%.6f %c %.6f %c %s %c %s %c %s %c LINES\n", 
+			(float)x, separator_, (float)y, separator_, geoid.c_str(), separator_, geoid.c_str(), separator_, objectCategory.c_str(), separator_ );  
+		else
+			fprintf ( file_, "%.6f %c %.6f %c %s %c %s %c %s %c NODES\n", 
+			(float)x, separator_, (float)y, separator_, geoid.c_str(), separator_, geoid.c_str(), separator_, objectCategory.c_str(), separator_ );  
+	}
+
+}
+
+
+void 
+TeSPRFile::writeThematicPoint( const double& x, const double& y, const string& theme )
+{
+	if ( theme != "")
+		fprintf ( file_, "%.6f %c %.6f %c %s \n", 
+		(float)x, separator_, (float)y, separator_, theme.c_str() );  
+	else
+		fprintf ( file_, "%.6f %c %.6f %c Nenhuma \n", 
+		(float)x, separator_, (float)y, separator_ );  
+
+}
+
+
+void 
+TeSPRFile::writeProjection( TeProjection* proj ) 
+{
+	if (proj)
+	{
+		fprintf ( file_, "PROJECTION %s/%s\n", proj->name().c_str(),proj->datum().name().c_str());
+	}
+}
+
+void 
+TeSPRFile::writeBox( TeBox& box ) 
+{
+	TeCoord2D pt1 = box.lowerLeft();
+	TeCoord2D pt2 = box.upperRight();
+
+	fprintf ( file_, "%s %.6f %.6f %.6f %.6f \n", "BOX", pt1.x(), pt1.y(), pt2.x(),  pt2.y());
+	fprintf ( file_, "%s\n", "// " );
+}
+  
+//===================================================
+//
+//  Write lines header information
+//
+//===================================================
+
+void
+TeSPRFile::writeLinesHeader ()  
+{
+	fprintf(file_,"%s\n", "LINES" );
+	fprintf(file_,"%s\n", "INFO");
+	fprintf(file_,"%s\n", "// SPRING Interchange File" );
+}
+
+
+
+//===================================================
+//
+//  TeSPRPoints- Write points header information
+//
+//===================================================
+
+void
+TeSPRFile::writePointsHeader ()  
+{
+	fprintf(file_,"%s\n", "POINT2D" );
+	fprintf(file_,"%s\n", "INFO");
+	fprintf(file_,"%s %c \n", "SEPARATOR ",  separator_  );
+	fprintf(file_,"%s\n", "// SPRING Interchange File" );
+}
+
+//===================================================
+//
+//  TeSPRTable - Write TABLE information
+//
+//===================================================
+
+void
+TeSPRFile::writeTableHeader (const int& /* dType */)  
+{
+	fprintf(file_,"%s\n", "TABLE" );
+	fprintf(file_,"%s\n", "INFO");
+	fprintf(file_,"%s %c\n", "SEPARATOR ", separator_ );
+	fprintf(file_,"%s\n", "UNFORMATED ");	
+ } 
+ 
+void 
+TeSPRFile::writeAttributeInfo( TeAttributeList& attList, const string& objCategory,
+							   const string& indexName ) 
+{
+	fprintf (file_, "%s %s \n", "CATEGORY_OBJ", objCategory.c_str() ); 	
+	fprintf (file_, "%s%c%s%c%s%c%s \n", "T_KEY", separator_, "TEXT", separator_, "32", separator_, "0"); 	
+
+	TeAttributeList::iterator it = attList.begin();
+	for ( ;it != attList.end();++it )
+	{
+		string name = (*it).rep_.name_;
+		if ( TeConvertToUpperCase(name) == TeConvertToUpperCase(indexName) ) continue; // skip the index name
+		switch ((*it).rep_.type_)
+		{
+			case TeSTRING:
+				this->writeTextParameterInfo(name, (*it).rep_.numChar_);
+				break;
+			case TeREAL:
+				this->writeRealParameterInfo(name);
+				break;
+			case TeINT:
+				this->writeIntParameterInfo(name);
+				break;
+			case TeCHARACTER:
+				this->writeTextParameterInfo(name,1);
+				break;
+			case TeDATETIME:
+				this->writeTextParameterInfo(name,25);
+            default:
+                break;
+		}
+	}  
+} 
+void
+TeSPRFile::writeTextParameterInfo ( const string& name, int w )
+{
+
+	char sprName [TeNAME_LENGTH];
+
+	int width = w;
+	if ( w == 0 )
+		width = name.size();
+
+	TeConvertToUpperCase ( name, sprName );
+
+	fprintf ( file_, "%s%c%s%c%d%c%d \n", sprName, separator_, "TEXT", separator_, width, separator_, 0 );
+}
+
+void
+TeSPRFile::writeRealParameterInfo ( const string& name )
+{
+	char sprName [TeNAME_LENGTH];
+
+	TeConvertToUpperCase ( name, sprName );
+
+	fprintf ( file_, "%s%c%s%c%d%c%d \n", sprName, separator_, "REAL", separator_, 17, separator_,8 );
+}
+
+void
+TeSPRFile::writeIntParameterInfo ( const string& name )
+{
+	char sprName [TeNAME_LENGTH];
+
+	TeConvertToUpperCase ( name, sprName );
+
+	fprintf ( file_, "%s%c%s%c%d%c%d \n", sprName, separator_, "INTEGER", separator_, 10, separator_, 0 );
+}
+
+void
+TeSPRFile::writeValue ( const string& value, TeAttrDataType type )
+{
+	switch ( type )
+	{
+		case TeINT :
+			writeValue ( atoi ( value.c_str())  ); 
+			break;
+		case TeREAL :
+			writeValue ( atof ( value.c_str())  ); 
+			break;
+		default :
+			writeValue ( value );
+	}
+
+}
+
+
+//===================================================
+//
+//  Write SAMPLE information
+//
+//===================================================
+
+void
+TeSPRFile::writeSampleHeader ()
+{
+	fprintf(file_,"%s\n", "SAMPLE" );
+	fprintf(file_,"%s\n", "INFO");
+	fprintf(file_,"%s %c \n", "SEPARATOR ",  separator_  );
+	fprintf(file_,"%s\n", "// SPRING Interchange File" );
+}
+
+
+void
+TeSPRFile::writeSample( const string& /* geoid */, const double& x, 
+ 						  const double& y, const string& value) 
+{
+	fprintf ( file_, "%s \n", "POINT3D" );
+	fprintf ( file_, "%.6f %c %.6f %c %s \n", x, separator_, y, separator_, value.c_str() ); 
+	fprintf ( file_, "%s \n", "END" );
+}
+
+//===================================================
+//
+//  Write NETWORK information
+//
+//===================================================
+
+
+void 
+TeSPRFile::writeNetworkHeader()
+{
+	fprintf(file_,"%s\n", "NETWORK" );
+	fprintf(file_,"%s\n", "INFO");
+	fprintf(file_,"%s\n", "// SPRING Interchange File" );
+}
+
+
+void
+TeSPRFile::writeArcHeader ( const string& geoid, const double& posImp, 
+		const double& negImp, const double& demand)
+{
+	fprintf ( file_, "%s %.6f %.6f %.6f \n", geoid.c_str(), posImp, negImp, demand ); 
+}
+
+
diff --git a/src/terralib/functions/TeSPRFile.h b/src/terralib/functions/TeSPRFile.h
old mode 100755
new mode 100644
index 58d4103..3cc877f
--- a/src/terralib/functions/TeSPRFile.h
+++ b/src/terralib/functions/TeSPRFile.h
@@ -1,186 +1,188 @@
-/************************************************************************************
- TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSPRFile.h
-    \brief This file contains the support to manipulate geographical data in ASCII SPRING format
-*/
-#ifndef  __TERRALIB_INTERNAL_SPRFILE_H
-#define  __TERRALIB_INTERNAL_SPRFILE_H
-
-#include "TeAsciiFile.h"
-#include "TeDataTypes.h"
-#include "TeCoord2D.h"
-#include "TeAttribute.h"
-#include "TeProjection.h"
-
-#include <string>
-#include <stdio.h>
-using namespace std;
-
-//! Provides support for writing SPRING/ASCII files
-class TeSPRFile : public TeAsciiFile
-{
-public:
-
-	//! Contructors
-
-	TeSPRFile(const string& fileName, const char* mode, char separator = ';');
-
-	//! Destructor
-
-	virtual ~TeSPRFile() {} //! base class
-
-	//! LINES - write header
-	void writeLinesHeader ();
-
-	//! LINES 3D - write header
-	void writeLine3DHeader()
-	{ fprintf ( file_,"LINE3D\n"); }
-
-	//! LINES - write Coord
-	void writeCoord ( const double& x, const double& y)
-{ 	fprintf ( file_," %.6f %.6f\n", x, y ); }
-
-	//! LABELS - write Header
-	void writeLabelHeader ( const int& option );
-
-	//! LABELS - write Value
-	void  writeCadastralLabel ( const string& geoid, const double& x, const double& y,
-			const string& objectCategory = ""); 
-
-	//! NETWORK - write labels
-	void writeNetworkLabel ( const string& geoid, const double& x, const double& y,
-					   const string& objectCategory, bool isL=true); 
-
-	//! LABELS - write Theme
-	void writeThematicLabel( const double& x, const double& y, const string& theme );
-
-	//! POINTS - write a classified point
-	void writeThematicPoint( const double& x, const double& y, const string& theme );
-
-	//! POINTS - write Header
-	void writePointsHeader();
-
-	//! POINTS 3D - write Header
-	void writePoint3DHeader()
-	{ fprintf ( file_,"POINT3D\n"); }
-
-	//! POINTS 3D - write Value
-	void writePoint3D( const double& x, const double& y, const double& quote )
-	{ fprintf ( file_," %.6f %.6f %.10E\n", x, y, quote ); }
-
-	//! POINTS - write Value
-	void writePoint ( TeCoord2D& p )
-	{ this->writeCoord ( p.x(), p.y() ); }
-
-	//! NETWORK - write Header
-	void writeNetworkHeader();
-
-	//! NETWORK - write arc header
-	void writeArcHeader ( const string& geoid, const double& posImp = 0., 
-		const double& negImp= 0., const double& demand = 0. ); 
-				   
- 	//! NETWORK - write Lines Header
-	void writeNetworkLineHeader(int id )
-	{ fprintf ( file_,"%d 1 1 0.0\n", id ); }
-
- 	//! NETWORK - write Label Header
-	void writeNetworkLabelHeader();
-	
-	//! TABLE - write Header
-	void writeTableHeader( const int& dType );
-
-	//! TABLE - write attribute information
-	void writeAttributeInfo ( TeAttributeList&, const string&, const string& indexName = "" );
-
-	//! TABLE - write text parameter
-	void writeTextParameterInfo ( const string& name, int w = 0);
-	
-	//! TABLE - write real parameter
-	void writeRealParameterInfo ( const string& );
-	
-	//! TABLE - write int parameter
-	void writeIntParameterInfo  ( const string& );
-
-	//! TABLE - write geoId
-	void writeGeoId ( const string& geoid )
-	{ fprintf ( file_, "%s%c%s", geoid.c_str(), separator_, geoid.c_str() ); }
-
-	//! TABLE - write attribute name
-	void writeValue ( const string& attrName, TeAttrDataType type );
-
-	//! TABLE - write int value
-	void writeValue ( const int& value )
-	{ fprintf ( file_, "%c%d", separator_, value ); } 
-
-	//! TABLE - write double value
-	void writeValue ( const double& value )
-	{ fprintf ( file_, "%c%.10E", separator_, (float)value ); }
-
-	//! TABLE - write string 
-	void writeValue ( const string& value )
-	{ fprintf ( file_, "%c%s", separator_,value.c_str() ); }
-
-	//! SAMPLE - write Header
-	void writeSampleHeader();
-	
-	//! SAMPLE - write value
-	void writeSample ( const string& index, const double& x, const double& y,
-		const string& value);
-	
-	//! SAMPLE - write quote
-	void writeSampleQuote( double quote )
-	{ fprintf ( file_,"HEIGHT %.10E\n", quote ); }
-
-	//! INFO - write projection
-	void writeProjection ( TeProjection* );
-
-	//! INFO - write Box
-	void writeBox ( TeBox& );
-
-	//! INFO - write InfoEND
-	void writeInfoEnd ()
-	{ fprintf ( file_, "%s\n", "INFO_END"); }
-
-	//! GENERAL - write END
-	void writeEnd ()
-	{ fprintf ( file_, "%s \n", "END" ); }
-
-	//! Sets the separator
-	void setSeparator ( const char& c )
-	{ separator_ = c ; }
-
-	//! Returns the separator
-	char separator ()
-	{ return separator_; } 
-
-//! No copy allowed
-
-private:
-
-	TeSPRFile(const TeSPRFile&);
-	TeSPRFile& operator=(const TeSPRFile&){return *this;}
-	char	separator_;
-};
-
-#endif
-
+/************************************************************************************
+ TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSPRFile.h
+    \brief This file contains the support to manipulate geographical data in ASCII SPRING format
+*/
+#ifndef  __TERRALIB_INTERNAL_SPRFILE_H
+#define  __TERRALIB_INTERNAL_SPRFILE_H
+
+#include "TeAsciiFile.h"
+#include "TeDataTypes.h"
+#include "TeCoord2D.h"
+#include "TeAttribute.h"
+#include "TeProjection.h"
+
+#include "TeFunctionsDefines.h"
+
+#include <string>
+#include <stdio.h>
+using namespace std;
+
+//! Provides support for writing SPRING/ASCII files
+class TLFUNCTIONS_DLL TeSPRFile : public TeAsciiFile
+{
+public:
+
+	//! Contructors
+
+	TeSPRFile(const string& fileName, const char* mode, char separator = ';');
+
+	//! Destructor
+
+	virtual ~TeSPRFile() {} //! base class
+
+	//! LINES - write header
+	void writeLinesHeader ();
+
+	//! LINES 3D - write header
+	void writeLine3DHeader()
+	{ fprintf ( file_,"LINE3D\n"); }
+
+	//! LINES - write Coord
+	void writeCoord ( const double& x, const double& y)
+{ 	fprintf ( file_," %.6f %.6f\n", x, y ); }
+
+	//! LABELS - write Header
+	void writeLabelHeader ( const int& option );
+
+	//! LABELS - write Value
+	void  writeCadastralLabel ( const string& geoid, const double& x, const double& y,
+			const string& objectCategory = ""); 
+
+	//! NETWORK - write labels
+	void writeNetworkLabel ( const string& geoid, const double& x, const double& y,
+					   const string& objectCategory, bool isL=true); 
+
+	//! LABELS - write Theme
+	void writeThematicLabel( const double& x, const double& y, const string& theme );
+
+	//! POINTS - write a classified point
+	void writeThematicPoint( const double& x, const double& y, const string& theme );
+
+	//! POINTS - write Header
+	void writePointsHeader();
+
+	//! POINTS 3D - write Header
+	void writePoint3DHeader()
+	{ fprintf ( file_,"POINT3D\n"); }
+
+	//! POINTS 3D - write Value
+	void writePoint3D( const double& x, const double& y, const double& quote )
+	{ fprintf ( file_," %.6f %.6f %.10E\n", x, y, quote ); }
+
+	//! POINTS - write Value
+	void writePoint ( TeCoord2D& p )
+	{ this->writeCoord ( p.x(), p.y() ); }
+
+	//! NETWORK - write Header
+	void writeNetworkHeader();
+
+	//! NETWORK - write arc header
+	void writeArcHeader ( const string& geoid, const double& posImp = 0., 
+		const double& negImp= 0., const double& demand = 0. ); 
+				   
+ 	//! NETWORK - write Lines Header
+	void writeNetworkLineHeader(int id )
+	{ fprintf ( file_,"%d 1 1 0.0\n", id ); }
+
+ 	//! NETWORK - write Label Header
+	void writeNetworkLabelHeader();
+	
+	//! TABLE - write Header
+	void writeTableHeader( const int& dType );
+
+	//! TABLE - write attribute information
+	void writeAttributeInfo ( TeAttributeList&, const string&, const string& indexName = "" );
+
+	//! TABLE - write text parameter
+	void writeTextParameterInfo ( const string& name, int w = 0);
+	
+	//! TABLE - write real parameter
+	void writeRealParameterInfo ( const string& );
+	
+	//! TABLE - write int parameter
+	void writeIntParameterInfo  ( const string& );
+
+	//! TABLE - write geoId
+	void writeGeoId ( const string& geoid )
+	{ fprintf ( file_, "%s%c%s", geoid.c_str(), separator_, geoid.c_str() ); }
+
+	//! TABLE - write attribute name
+	void writeValue ( const string& attrName, TeAttrDataType type );
+
+	//! TABLE - write int value
+	void writeValue ( const int& value )
+	{ fprintf ( file_, "%c%d", separator_, value ); } 
+
+	//! TABLE - write double value
+	void writeValue ( const double& value )
+	{ fprintf ( file_, "%c%.10E", separator_, (float)value ); }
+
+	//! TABLE - write string 
+	void writeValue ( const string& value )
+	{ fprintf ( file_, "%c%s", separator_,value.c_str() ); }
+
+	//! SAMPLE - write Header
+	void writeSampleHeader();
+	
+	//! SAMPLE - write value
+	void writeSample ( const string& index, const double& x, const double& y,
+		const string& value);
+	
+	//! SAMPLE - write quote
+	void writeSampleQuote( double quote )
+	{ fprintf ( file_,"HEIGHT %.10E\n", quote ); }
+
+	//! INFO - write projection
+	void writeProjection ( TeProjection* );
+
+	//! INFO - write Box
+	void writeBox ( TeBox& );
+
+	//! INFO - write InfoEND
+	void writeInfoEnd ()
+	{ fprintf ( file_, "%s\n", "INFO_END"); }
+
+	//! GENERAL - write END
+	void writeEnd ()
+	{ fprintf ( file_, "%s \n", "END" ); }
+
+	//! Sets the separator
+	void setSeparator ( const char& c )
+	{ separator_ = c ; }
+
+	//! Returns the separator
+	char separator ()
+	{ return separator_; } 
+
+//! No copy allowed
+
+private:
+
+	TeSPRFile(const TeSPRFile&);
+	TeSPRFile& operator=(const TeSPRFile&){return *this;}
+	char	separator_;
+};
+
+#endif
+
diff --git a/src/terralib/functions/TeSimilarity.cpp b/src/terralib/functions/TeSimilarity.cpp
old mode 100755
new mode 100644
index 17ffa7c..678d5da
--- a/src/terralib/functions/TeSimilarity.cpp
+++ b/src/terralib/functions/TeSimilarity.cpp
@@ -1,73 +1,73 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeMatrix.h"
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-double
-SmallestOf (double a, double b, double c)
-{
-	double	smallest = a;
-	
-	if (b < smallest) smallest = b;
-	if (c < smallest) smallest = c;
-	return smallest;
-}
-
-double
-TeSimilarity (const char *streetname, const char *rotuloname)
-{
-	short	Del = 1, Ins = 1, Sub = 1;
-	double		a, b, c;
-	short	i, j;
-	int	m = strlen(streetname) + 1;
-	int n = strlen(rotuloname) + 1;
-	TeMatrix	T;
-	if( T.Init(m,n) == false)
-		return -1.;
-
-	T(0,0) = 0;
-
-	for (j = 1; j<n; j++)
-		T(0,j) = T(0, j-1) + Ins;
-
-	for (i = 1; i<m; i++)
-		T(i,0) = T(i-1,0) + Del;
-
-	for (i = 1; i<m; i++)
-		for (j = 1; j<n; j++)
-		{
-			if (toupper(streetname[i-1]) == toupper(rotuloname[j-1]))
-				a = T(i-1,j-1);
-			else
-				a = T(i-1,j-1) + Sub;
-			b = T(i,j-1) + Ins;
-			c = T(i-1,j) + Del;
-			T(i,j) = SmallestOf(a, b, c);
-		}
-		
-	double perc = (1.0 - (T(m-1,n-1) / (double)(n-1))) * 100.0;
-	return	perc;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeMatrix.h"
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+double
+SmallestOf (double a, double b, double c)
+{
+	double	smallest = a;
+	
+	if (b < smallest) smallest = b;
+	if (c < smallest) smallest = c;
+	return smallest;
+}
+
+double
+TeSimilarity (const char *streetname, const char *rotuloname)
+{
+	short	Del = 1, Ins = 1, Sub = 1;
+	double		a, b, c;
+	short	i, j;
+	int	m = strlen(streetname) + 1;
+	int n = strlen(rotuloname) + 1;
+	TeMatrix	T;
+	if( T.Init(m,n) == false)
+		return -1.;
+
+	T(0,0) = 0;
+
+	for (j = 1; j<n; j++)
+		T(0,j) = T(0, j-1) + Ins;
+
+	for (i = 1; i<m; i++)
+		T(i,0) = T(i-1,0) + Del;
+
+	for (i = 1; i<m; i++)
+		for (j = 1; j<n; j++)
+		{
+			if (toupper(streetname[i-1]) == toupper(rotuloname[j-1]))
+				a = T(i-1,j-1);
+			else
+				a = T(i-1,j-1) + Sub;
+			b = T(i,j-1) + Ins;
+			c = T(i-1,j) + Del;
+			T(i,j) = SmallestOf(a, b, c);
+		}
+		
+	double perc = (1.0 - (T(m-1,n-1) / (double)(n-1))) * 100.0;
+	return	perc;
+}
diff --git a/src/terralib/functions/TeThemeFunctions.cpp b/src/terralib/functions/TeThemeFunctions.cpp
old mode 100755
new mode 100644
index 07a00f2..39a1ce9
--- a/src/terralib/functions/TeThemeFunctions.cpp
+++ b/src/terralib/functions/TeThemeFunctions.cpp
@@ -1,160 +1,364 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include "TeTheme.h"
-#include "TeDatabase.h"
-
-
-bool TeCreateThemeFromTheme(TeTheme* inTheme, const string& newThemeName, int selObj, TeTheme* newTheme)
-{
-	// if no source theme or not a name for the new theme
-	if (!inTheme || newThemeName.empty())
-		return false;
-
-	// if there no pointer theme was passed create a new instance
-	if (!newTheme)
-		newTheme = new TeTheme();
-
-	// builds a valid theme name
-	TeDatabase* curDb = inTheme->layer()->database();
-	string validThemeName = newThemeName;
-	int i=1;
-	while (curDb->themeExist(validThemeName))
-	{
-		validThemeName = newThemeName + "_" + Te2String(i);
-		i++;
-	}
-
-	// create new theme with the same definitions of the input theme
-	newTheme->id(0);
-	newTheme->name(validThemeName);
-	newTheme->layer(inTheme->layer());
-	newTheme->setAttTables(inTheme->attrTables());
-	curDb->viewMap()[inTheme->view()]->add(newTheme);
-	newTheme->visibleRep(inTheme->visibleRep());
-
-	// save its definition in the database
-	// creates collection and collection_aux table
-	if (!newTheme->save())
-	{
-		delete newTheme;
-		newTheme = 0;
-	}
-
-	// if its a theme of raster data there's nothing else to be done
-	if (inTheme->layer()->hasGeometry(TeRASTER) || inTheme->layer()->hasGeometry(TeRASTERFILE))
-	{
-		TeBox tbox = curDb->getThemeBox(newTheme);
-		newTheme->setThemeBox(tbox);
-		curDb->updateTheme(newTheme);
-		return true;
-	}
-
-	// this SQL selects instances of objects according to input, so it uses te_collection_aux
-	string inputInst;
-
-	// this SQL selects objects according to input, so it uses te_collection
-	string inputObj; 
-	if(selObj == TeSelectedByPointing) // queried
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 2";
-		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 2";
-		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
-	}
-	else if(selObj == 2) // pointed
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 1";
-		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 1";
-		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
-	}
-	else if(selObj == 3) // not queried
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status <> 2";
-		inputObj += " AND " + inTheme->collectionTable() + ".c_object_status <> 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status <> 2";
-		inputInst += " AND " + inTheme->collectionAuxTable() + ".grid_status <> 3)";
-	}
-	else if(selObj == 4) // not pointed
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status <> 1";
-		inputObj += " AND " + inTheme->collectionTable() + ".c_object_status <> 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status <> 1";
-		inputInst += " AND " + inTheme->collectionAuxTable() + ".grid_status <> 3)";
-	}
-	else if(selObj == 5) // pointed and queried
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 3)";
-	}
-	else if(selObj == 6) // pointed or queried
-	{
-		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 2";
-		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 1";
-		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
-		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 2";
-		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 1";
-		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
-	}
-
-	// fills collection table from the selection requested
-	string sql = "INSERT INTO " + newTheme->collectionTable() + " ( ";
-	sql += " c_object_id, c_legend_id, label_x, label_y, c_legend_own, c_object_status ) ";
-	sql += " SELECT * FROM " + inTheme->collectionTable();
-	
-	if(inputObj.empty() == false)
-		sql += " WHERE " + inputObj;
-	if (!curDb->execute(sql))
-	{
-		curDb->deleteTheme(newTheme->id());
-		return false;
-	}
-	// sets theme objects settings to default
-	sql = "UPDATE " + newTheme->collectionTable() + " SET c_legend_id = 0";
-	if (!curDb->execute(sql))
-	{
-		curDb->deleteTheme(newTheme->id());
-		return false;
-	}
-	sql = "UPDATE " + newTheme->collectionTable() + " SET c_object_status = 0";
-	if (!curDb->execute(sql))
-	{
-		curDb->deleteTheme(newTheme->id());
-		return false;
-	}
-
-	//fills collectin aux
-	if(!newTheme->populateCollectionAux())
-	{
-		curDb->deleteTheme(newTheme->id());
-		return false;
-	}
-
-	TeBox tbox = curDb->getThemeBox(newTheme);
-	newTheme->setThemeBox(tbox);
-	curDb->updateTheme(newTheme);
-
-	return true;
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include <TeExternalTheme.h>
+#include "TeDatabase.h"
+
+#include "TeThemeFunctions.h"
+
+bool TeCreateThemeFromTheme(TeTheme* inTheme, const string& newThemeName, int selObj, TeTheme* newTheme)
+{
+	// if no source theme or not a name for the new theme
+	if (!inTheme || newThemeName.empty())
+		return false;
+
+	// if there no pointer theme was passed create a new instance
+	if (!newTheme)
+		newTheme = new TeTheme();
+
+	// builds a valid theme name
+	TeDatabase* curDb = inTheme->layer()->database();
+	string validThemeName = newThemeName;
+	int i=1;
+	while (curDb->themeExist(validThemeName))
+	{
+		validThemeName = newThemeName + "_" + Te2String(i);
+		i++;
+	}
+
+	// create new theme with the same definitions of the input theme
+	newTheme->id(0);
+	newTheme->name(validThemeName);
+	newTheme->layer(inTheme->layer());
+	newTheme->setAttTables(inTheme->attrTables());
+	curDb->viewMap()[inTheme->view()]->add(newTheme);
+	newTheme->visibleRep(inTheme->visibleRep());
+
+	// save its definition in the database
+	// creates collection and collection_aux table
+	if (!newTheme->save())
+	{
+		delete newTheme;
+		newTheme = 0;
+	}
+
+	// if its a theme of raster data there's nothing else to be done
+	if (inTheme->layer()->hasGeometry(TeRASTER) || inTheme->layer()->hasGeometry(TeRASTERFILE))
+	{
+		TeBox tbox = curDb->getThemeBox(newTheme);
+		newTheme->setThemeBox(tbox);
+		curDb->updateTheme(newTheme);
+		return true;
+	}
+
+	// this SQL selects instances of objects according to input, so it uses te_collection_aux
+	string inputInst;
+
+	// this SQL selects objects according to input, so it uses te_collection
+	string inputObj; 
+	if(selObj == TeSelectedByPointing) // queried
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 2";
+		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 2";
+		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
+	}
+	else if(selObj == 2) // pointed
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 1";
+		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 1";
+		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
+	}
+	else if(selObj == 3) // not queried
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status <> 2";
+		inputObj += " AND " + inTheme->collectionTable() + ".c_object_status <> 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status <> 2";
+		inputInst += " AND " + inTheme->collectionAuxTable() + ".grid_status <> 3)";
+	}
+	else if(selObj == 4) // not pointed
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status <> 1";
+		inputObj += " AND " + inTheme->collectionTable() + ".c_object_status <> 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status <> 1";
+		inputInst += " AND " + inTheme->collectionAuxTable() + ".grid_status <> 3)";
+	}
+	else if(selObj == 5) // pointed and queried
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 3)";
+	}
+	else if(selObj == 6) // pointed or queried
+	{
+		inputObj = "(" + inTheme->collectionTable() + ".c_object_status = 2";
+		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 1";
+		inputObj += " OR " + inTheme->collectionTable() + ".c_object_status = 3)";
+		inputInst = "(" + inTheme->collectionAuxTable() + ".grid_status = 2";
+		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 1";
+		inputInst += " OR " + inTheme->collectionAuxTable() + ".grid_status = 3)";
+	}
+
+	// fills collection table from the selection requested
+	string sql = "INSERT INTO " + newTheme->collectionTable() + " ( ";
+	sql += " c_object_id, c_legend_id, label_x, label_y, c_legend_own, c_object_status ) ";
+	sql += " SELECT * FROM " + inTheme->collectionTable();
+	
+	if(inputObj.empty() == false)
+		sql += " WHERE " + inputObj;
+	if (!curDb->execute(sql))
+	{
+		curDb->deleteTheme(newTheme->id());
+		return false;
+	}
+	// sets theme objects settings to default
+	sql = "UPDATE " + newTheme->collectionTable() + " SET c_legend_id = 0";
+	if (!curDb->execute(sql))
+	{
+		curDb->deleteTheme(newTheme->id());
+		return false;
+	}
+	sql = "UPDATE " + newTheme->collectionTable() + " SET c_object_status = 0";
+	if (!curDb->execute(sql))
+	{
+		curDb->deleteTheme(newTheme->id());
+		return false;
+	}
+
+	//fills collectin aux
+	if(!newTheme->populateCollectionAux())
+	{
+		curDb->deleteTheme(newTheme->id());
+		return false;
+	}
+
+	TeBox tbox = curDb->getThemeBox(newTheme);
+	newTheme->setThemeBox(tbox);
+	curDb->updateTheme(newTheme);
+
+	return true;
+}
+
+vector<string> getObjects(TeTheme* theme, vector<string>& itens)
+{
+	vector<string> svec;
+	if(!theme)
+		return svec;
+
+	TeDatabase* db = 0;
+	if(theme->getProductId() == TeEXTERNALTHEME)
+		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
+	else if(theme->getProductId() == TeTHEME)
+		db = static_cast<TeTheme*>(theme)->layer()->database();
+
+	if(db == 0)
+		return svec;
+
+	TeDatabasePortal* portal = db->getPortal();
+	string C = theme->collectionTable();
+	string CA = theme->collectionAuxTable();
+
+	string query = "SELECT " + C + ".c_object_id FROM " + C + " LEFT JOIN " + CA;
+	query += " ON " + C + ".c_object_id = " + CA + ".object_id";
+	query += " WHERE " + CA + ".unique_id IN ";
+
+	set<string> idSet;
+  
+  vector< string >::iterator it_begin = itens.begin();
+  vector< string >::iterator it_end = itens.end();
+  
+	vector<string> inVec = generateInClauses(it_begin, it_end, db, false);
+	vector<string>::iterator it;
+	for(it=inVec.begin(); it!=inVec.end(); ++it)
+	{
+		if((*it).empty() == false)
+		{
+			string sel = query + *it;
+			if (portal->query(sel) == false)
+			{
+				delete portal;
+				return svec;
+			}
+			while (portal->fetchRow())
+				idSet.insert(portal->getData(0));
+			portal->freeResult();
+		}
+	}
+	delete portal;
+
+	set<string>::iterator sit;
+	for(sit=idSet.begin(); sit!=idSet.end(); ++sit)
+		svec.push_back(*sit);
+	return svec;
+}
+
+
+vector<string> getObjects(TeTheme* theme, int sel)
+{
+	vector<string> svec;
+	if(!theme)
+		return svec;
+
+	TeDatabase* db = 0;
+	if(theme->getProductId() == TeEXTERNALTHEME)
+		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
+	else if(theme->getProductId() == TeTHEME)
+		db = static_cast<TeTheme*>(theme)->layer()->database();
+
+	if(db == 0)
+		return svec;
+
+	string C = theme->collectionTable();
+	string CA = theme->collectionAuxTable();
+	string input;
+
+	if(sel == TeSelectedByPointing)
+		input += " WHERE " + C + ".c_object_status = 1 OR " + C + ".c_object_status = 3";
+	else if(sel == TeNotSelectedByPointing)
+		input += " WHERE " + C + ".c_object_status = 0 OR " + C + ".c_object_status = 2";
+	else if(sel == TeSelectedByQuery)
+		input += " WHERE " + C + ".c_object_status = 2 OR " + C + ".c_object_status = 3";
+	else if(sel == TeNotSelectedByQuery)
+		input += " WHERE " + C + ".c_object_status = 0 OR " + C + ".c_object_status = 1";
+	else if(sel == TeSelectedByPointingAndQuery)
+		input += " WHERE " + C + ".c_object_status = 3";
+	else if(sel == TeSelectedByPointingOrQuery)
+		input += " WHERE " + C + ".c_object_status <> 0";
+	else if(sel == TeGrouped)
+		input += " WHERE " + C + ".c_legend_id <> 0";
+	else if(sel == TeNotGrouped)
+		input += " WHERE " + C + ".c_legend_id = 0";
+
+	string query = "SELECT " + C + ".c_object_id FROM " + C + " LEFT JOIN " + CA;
+	query += " ON " + C + ".c_object_id = " + CA + ".object_id" + input;
+
+	TeDatabasePortal* portal = db->getPortal();
+	if (portal->query(query) == false)
+	{
+		delete portal;
+		return svec;
+	}
+	while (portal->fetchRow())
+		svec.push_back(portal->getData(0));
+
+	delete portal;
+	return svec;
+}
+
+vector<string> getItems(TeTheme* theme, vector<string>& objects)
+{
+	vector<string> svec;
+	if(!theme)
+		return svec;
+
+	TeDatabase* db = 0;
+	if(theme->getProductId() == TeEXTERNALTHEME)
+		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
+	else if(theme->getProductId() == TeTHEME)
+		db = static_cast<TeTheme*>(theme)->layer()->database();
+
+	if(db == 0)
+		return svec;
+
+	TeDatabasePortal* portal = db->getPortal();
+	string C = theme->collectionTable();
+	string CA = theme->collectionAuxTable();
+
+	string query = "SELECT " + CA + ".unique_id FROM " + C + " LEFT JOIN " + CA;
+	query += " ON " + C + ".c_object_id = " + CA + ".object_id";
+	query += " WHERE " + C + ".c_object_id IN ";
+  
+  vector< string >::iterator it_begin = objects.begin();
+  vector< string >::iterator it_end = objects.end();  
+
+	vector<string> inVec = generateInClauses(it_begin, it_end, db);
+	vector<string>::iterator it;
+	for(it=inVec.begin(); it!=inVec.end(); ++it)
+	{
+		if((*it).empty() == false)
+		{
+			string sel = query + *it;
+			if (portal->query(sel) == false)
+			{
+				delete portal;
+				return svec;
+			}
+			while (portal->fetchRow())
+				svec.push_back(portal->getData(0));
+			portal->freeResult();
+		}
+	}
+	delete portal;
+	return svec;
+}
+
+vector<string> getItems(TeTheme* theme, int sel)
+{
+	vector<string> svec;
+	if(!theme)
+		return svec;
+
+	TeDatabase* db = 0;
+	if(theme->getProductId() == TeEXTERNALTHEME)
+		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
+	else if(theme->getProductId() == TeTHEME)
+		db = static_cast<TeTheme*>(theme)->layer()->database();
+
+	if(db == 0)
+		return svec;
+
+	string C = theme->collectionTable();
+	string CA = theme->collectionAuxTable();
+	string input;
+
+	if(sel == TeSelectedByPointing)
+		input += " WHERE " + CA + ".grid_status = 1 OR " + CA + ".grid_status = 3";
+	else if(sel == TeNotSelectedByPointing)
+		input += " WHERE " + CA + ".grid_status = 0 OR " + CA + ".grid_status = 2";
+	else if(sel == TeSelectedByQuery)
+		input += " WHERE " + CA + ".grid_status = 2 OR " + CA + ".grid_status = 3";
+	else if(sel == TeNotSelectedByQuery)
+		input += " WHERE " + CA + ".grid_status = 0 OR " + CA + ".grid_status = 1";
+	else if(sel == TeSelectedByPointingAndQuery)
+		input += " WHERE " + CA + ".grid_status = 3";
+	else if(sel == TeSelectedByPointingOrQuery)
+		input += " WHERE " + CA + ".grid_status <> 0";
+	else if(sel == TeGrouped)
+		input += " WHERE " + C + ".c_legend_id <> 0";
+	else if(sel == TeNotGrouped)
+		input += " WHERE " + C + ".c_legend_id = 0";
+
+	string query = "SELECT " + CA + ".unique_id FROM " + C + " LEFT JOIN " + CA;
+	query += " ON " + C + ".c_object_id = " + CA + ".object_id" + input;
+
+	TeDatabasePortal* portal = db->getPortal();
+	if (portal->query(query) == false)
+	{
+		delete portal;
+		return svec;
+	}
+	while (portal->fetchRow())
+		svec.push_back(portal->getData(0));
+
+	delete portal;
+	return svec;
+}
diff --git a/src/terralib/functions/TeThemeFunctions.h b/src/terralib/functions/TeThemeFunctions.h
old mode 100755
new mode 100644
index cec422f..eb644c9
--- a/src/terralib/functions/TeThemeFunctions.h
+++ b/src/terralib/functions/TeThemeFunctions.h
@@ -1,43 +1,56 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*! \file TeThemeFunctions.h
-    This file contains functions to deal with themes 
-*/
-#ifndef  __TERRALIB_INTERNAL_THEMEFUNCTIONS_H
-#define  __TERRALIB_INTERNAL_THEMEFUNCTIONS_H
-
-class TeTheme;
-
-#include <string>
-
-//! Creates a new theme from the objects of an existing theme
-/*!
-	\param inTheme input theme 
-    \param newThemeName the name of the new theme
-	\param selObj the criteria to include objects of the existing theme in the new one
-    \param newTheme pointer to the new theme created if it succeed and null otherwise
-*/
-bool TeCreateThemeFromTheme(TeTheme* inTheme, const string& newThemeName, int selObj=0, TeTheme* newTheme=0);
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*! \file TeThemeFunctions.h
+    This file contains functions to deal with themes 
+*/
+#ifndef  __TERRALIB_INTERNAL_THEMEFUNCTIONS_H
+#define  __TERRALIB_INTERNAL_THEMEFUNCTIONS_H
+
+#include "TeFunctionsDefines.h"
+
+class TeTheme;
+
+#include <vector>
+#include <string>
+
+using namespace std;
+
+//! Creates a new theme from the objects of an existing theme
+/*!
+	\param inTheme input theme 
+    \param newThemeName the name of the new theme
+	\param selObj the criteria to include objects of the existing theme in the new one
+    \param newTheme pointer to the new theme created if it succeed and null otherwise
+*/
+TLFUNCTIONS_DLL bool TeCreateThemeFromTheme(TeTheme* inTheme, const string& newThemeName, int selObj=0, TeTheme* newTheme=0);
+
+TLFUNCTIONS_DLL vector<string> getObjects(TeTheme* theme, int sel);
+
+TLFUNCTIONS_DLL vector<string> getItems(TeTheme* theme, int sel);
+
+TLFUNCTIONS_DLL vector<string> getObjects(TeTheme* theme, vector<string>& itens);
+
+TLFUNCTIONS_DLL vector<string> getItems(TeTheme* theme, vector<string>& objcts);
+
+#endif
diff --git a/src/terralib/image_processing/.cvsignore b/src/terralib/image_processing/.cvsignore
new file mode 100644
index 0000000..288891d
--- /dev/null
+++ b/src/terralib/image_processing/.cvsignore
@@ -0,0 +1,4 @@
+Makefile
+*.o
+*.obj
+
diff --git a/src/terralib/image_processing/TePDIAlgorithm.cpp b/src/terralib/image_processing/TePDIAlgorithm.cpp
old mode 100755
new mode 100644
index 1ac8d69..88d92b6
--- a/src/terralib/image_processing/TePDIAlgorithm.cpp
+++ b/src/terralib/image_processing/TePDIAlgorithm.cpp
@@ -1,143 +1,165 @@
-#include "TePDIAlgorithm.hpp"
-
-#include <TeAgnostic.h>
-
-TePDIAlgorithm::TePDIAlgorithm()
-{
-  progress_enabled_ = true;
-}
-
-
-TePDIAlgorithm::~TePDIAlgorithm()
-{
-}
-
-
-bool TePDIAlgorithm::Reset( const TePDIParameters& params )
-{
-  if( CheckParameters( params ) ) {
-    ResetState( params );
-
-    /* This line must come after the ResetState line, because some algorithms
-       checks the difference between the current internal parameters and the
-       new supplied parameters */
-    params_.Clear();
-    params_ = params;
-
-    return true;
-  } else {
-    TEAGN_LOG_AND_RETURN( "Invalid supplied parameters" );
-  }
-}
-
-
-bool TePDIAlgorithm::Apply()
-{
-  bool return_value = false;
-  
-  if( CheckInternalParameters() ) {
-    #ifdef NDEBUG
-      try
-      {
-        return_value = RunImplementation();
-      }
-      catch( const TeException& exc )
-      {
-        TEAGN_LOGERR( "Exception raised from algorithm - " +
-          exc.message() );
-      }
-      catch(...)
-      {
-        TEAGN_LOGERR( "Unhandled exception raised from algorithm" );
-      }
-    #else
-      return_value = RunImplementation();
-    #endif
-    
-    StopProgInt();
-  } else {
-    TEAGN_LOG_AND_RETURN( "Invalid supplied parameters" );
-  }
-  
-  return return_value;
-}
-
-
-bool TePDIAlgorithm::Apply( const TePDIParameters& params )
-{
-  if( Reset( params ) )
-  {
-    return Apply();
-  }
-  
-  return false;
-}
-
-
-const TePDIParameters& TePDIAlgorithm::GetParameters() const
-{
-  return params_;
-}
-
-
-bool TePDIAlgorithm::CheckInternalParameters() const
-{
-  return CheckParameters( params_ );
-}
-
-
-const TePDIAlgorithm& TePDIAlgorithm::operator=( 
-  const TePDIAlgorithm& external )
-{
-  TEAGN_LOG_AND_THROW( "Algorithms cannot be copied" );  
-  
-  return external;
-}
-
-TePDIAlgorithm* TePDIAlgorithm::DefaultObject( const TePDIParameters& params )
-{
-  TEAGN_LOG_AND_THROW( "Trying to create an invalid algorithm instance" );
-  
-  TePDIParameters dummy_params = params;
-
-  return 0;
-}
-
-
-void TePDIAlgorithm::ToggleProgInt( bool enabled )
-{
-  progress_enabled_ = enabled;
-  
-  if( ! enabled ) {
-    pi_manager_.Toggle( false );
-  }
-}
-
-
-void TePDIAlgorithm::StartProgInt( const std::string& message, 
-  unsigned int steps )
-{
-  if( progress_enabled_ ) {
-    pi_manager_.Reset( message, steps );
-    pi_manager_.Toggle( true );
-  }
-}
-
-
-bool TePDIAlgorithm::UpdateProgInt( unsigned int step )
-{
-  return pi_manager_.Update( step );
-}
-
-
-bool TePDIAlgorithm::IncProgInt()
-{
-  return pi_manager_.Increment();
-}
-
-
-void TePDIAlgorithm::StopProgInt()
-{
-  pi_manager_.Toggle( false );
-}
-
+#include "TePDIAlgorithm.hpp"
+
+#include <TeAgnostic.h>
+
+TePDIAlgorithm::TePDIAlgorithm()
+{
+  progress_enabled_ = true;
+}
+
+
+TePDIAlgorithm::~TePDIAlgorithm()
+{
+}
+
+
+bool TePDIAlgorithm::Reset( const TePDIParameters& params )
+{
+  if( CheckParameters( params ) ) {
+    ResetState( params );
+
+    /* This line must come after the ResetState line, because some algorithms
+       checks the difference between the current internal parameters and the
+       new supplied parameters */
+    params_.Clear();
+    params_ = params;
+
+    return true;
+  } else {
+    TEAGN_LOG_AND_RETURN( "Invalid supplied parameters" );
+  }
+}
+
+
+bool TePDIAlgorithm::Apply()
+{
+  bool return_value = false;
+  
+  if( CheckInternalParameters() ) {
+    #ifdef NDEBUG
+      try
+      {
+        return_value = RunImplementation();
+      }
+      catch( const TeException& exc )
+      {
+        TEAGN_LOGERR( "Exception raised from algorithm - " +
+          exc.message() );
+      }
+      catch(...)
+      {
+        TEAGN_LOGERR( "Unhandled exception raised from algorithm" );
+      }
+    #else
+      return_value = RunImplementation();
+    #endif
+    
+    StopProgInt();
+  } else {
+    TEAGN_LOG_AND_RETURN( "Invalid supplied parameters" );
+  }
+  
+  return return_value;
+}
+
+
+bool TePDIAlgorithm::Apply( const TePDIParameters& params )
+{
+  TEAGN_TRUE_OR_RETURN( CheckParameters( params ),
+    "Invalid parameters" )
+    
+  ResetState( params );
+
+  /* This line must come after the ResetState line, because some algorithms
+     checks the difference between the current internal parameters and the
+     new supplied parameters */
+  params_.Clear();
+  params_ = params;
+  
+  #ifdef NDEBUG
+    try
+    {
+      return RunImplementation();
+    }
+    catch( const TeException& exc )
+    {
+      TEAGN_LOG_AND_RETURN( "Exception raised from algorithm - " +
+        exc.message() );
+    }
+    catch(...)
+    {
+      TEAGN_LOG_AND_RETURN( "Unhandled exception raised from algorithm" );
+    }
+  #else
+    return RunImplementation();
+  #endif    
+}
+
+
+const TePDIParameters& TePDIAlgorithm::GetParameters() const
+{
+  return params_;
+}
+
+
+bool TePDIAlgorithm::CheckInternalParameters() const
+{
+  return CheckParameters( params_ );
+}
+
+
+const TePDIAlgorithm& TePDIAlgorithm::operator=( 
+  const TePDIAlgorithm& external )
+{
+  TEAGN_LOG_AND_THROW( "Algorithms cannot be copied" );  
+  
+  return external;
+}
+
+TePDIAlgorithm* TePDIAlgorithm::DefaultObject( const TePDIParameters& params )
+{
+  TEAGN_LOG_AND_THROW( "Trying to create an invalid algorithm instance" );
+  
+  TePDIParameters dummy_params = params;
+
+  return 0;
+}
+
+
+void TePDIAlgorithm::ToggleProgInt( bool enabled )
+{
+  progress_enabled_ = enabled;
+  
+  if( ! enabled ) {
+    pi_manager_.Toggle( false );
+  }
+}
+
+
+void TePDIAlgorithm::StartProgInt( const std::string& message, 
+  unsigned int steps )
+{
+  if( progress_enabled_ ) {
+    pi_manager_.Reset( message, steps );
+    pi_manager_.Toggle( true );
+  }
+}
+
+
+bool TePDIAlgorithm::UpdateProgInt( unsigned int step )
+{
+  return pi_manager_.Update( step );
+}
+
+
+bool TePDIAlgorithm::IncProgInt()
+{
+  return pi_manager_.Increment();
+}
+
+
+void TePDIAlgorithm::StopProgInt()
+{
+  pi_manager_.Toggle( false );
+}
+
diff --git a/src/terralib/image_processing/TePDIAlgorithm.hpp b/src/terralib/image_processing/TePDIAlgorithm.hpp
old mode 100755
new mode 100644
index 968135c..b29e6cf
--- a/src/terralib/image_processing/TePDIAlgorithm.hpp
+++ b/src/terralib/image_processing/TePDIAlgorithm.hpp
@@ -1,216 +1,231 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIALGORITHM_HPP
-  #define TEPDIALGORITHM_HPP
-
-  #include "TePDIParameters.hpp"
-  #include "TePDIPIManager.hpp"
-  #include "TePDIDefines.hpp"
-  
-  #include <TeSharedPtr.h>
-  #include <TeProgress.h>
-
-/**
- * @brief This is the base class for digital image processing
- * algorithms.
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- * @ingroup TePDIGeneralAlgoGroup
- */
-  class PDI_DLL TePDIAlgorithm
-  {
-    public :
-      /** @typedef TeSharedPtr< TePDIAlgorithm > pointer
-       * Type definition for an algorithm instance pointer. 
-       */
-      typedef TeSharedPtr< TePDIAlgorithm > pointer;
-      
-      /** @typedef const TeSharedPtr< TePDIAlgorithm > const_pointer
-       * Type definition for a const algorithm instance pointer. 
-       */
-      typedef const TeSharedPtr< TePDIAlgorithm > const_pointer;
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIAlgorithm();
-
-      /**
-       * @brief Applies the algorithm following the current state and
-       * internal stored parameters.
-       *
-       * @return true if OK. false on error.
-       */
-      bool Apply();
-      
-      /**
-       * @brief Applies the algorithm following the state defined by
-       * the supplied parameters.
-       * @param params The new supplied parameters.
-       * @return true if OK. false on error.
-       */
-      bool Apply( const TePDIParameters& params );      
-
-      /**
-       * @brief Reset the internal state with new supplied parameters.
-       *
-       * @param params The new supplied parameters.
-       * @return true if parameters OK, false on error.
-       */
-      bool Reset( const TePDIParameters& params );
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      virtual bool CheckParameters( 
-        const TePDIParameters& parameters ) const = 0;
-
-      /**
-       * @brief Returns a reference to the current internal parameters.
-       *
-       * @return A reference to the current internal parameters.
-       */
-      const TePDIParameters& GetParameters() const;
-      
-      /**
-       * @brief Returns a default object.
-       *
-       * @return A default object.
-       */
-      static TePDIAlgorithm* DefaultObject( const TePDIParameters& params );
-      
-      /**
-       * @brief Enable / Disable the progress interface.
-       *
-       * @param enabled Flag to enable ( true ) or disable ( false ).
-       */
-      void ToggleProgInt( bool enabled );        
-
-    protected :
-      /**
-       * @brief Internal parameters reference
-       */
-      mutable TePDIParameters params_;
-      
-      /**
-       * @brief The internal progress interface enabled state.
-       */
-      bool progress_enabled_;
-       
-      /**
-       * @brief The internal progress interface.
-       *
-       * @note Algorithms cannot be copied.
-       *
-       * @param external External algorithm reference.
-       * @return A const Algorithm reference.
-       */    
-      TePDIPIManager pi_manager_;      
-        
-      /**
-       * @brief Default Constructor
-       */
-      TePDIAlgorithm();
-
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      virtual bool RunImplementation() = 0;
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      virtual void ResetState( const TePDIParameters& params ) = 0;
-      
-      /**
-       * @brief Checks if current internal parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @return true if the internal parameters are OK. false if not.
-       */
-      bool CheckInternalParameters() const;
-      
-      /**
-       * @brief Start the progress interface.
-       *
-       * @param message Progress window message.
-       * @param steps Progress window total steps.
-       */
-      void StartProgInt( const std::string& message, 
-        unsigned int steps );
-        
-      /**
-       * @brief Update the current progress interface to the current step.
-       *
-       * @param step Current step.
-       * @return true if the interface was canceled, false otherwise.
-       */
-      bool UpdateProgInt( unsigned int step );
-      
-      /**
-       * @brief Increments the the current progress by one step.
-       * @return true if the interface was canceled, false otherwise.
-       */
-      bool IncProgInt();
-                
-      /**
-       * @brief Stop the progress interface.
-       *
-       */      
-      void StopProgInt();
-      
-    private :
-    
-      /**
-       * @brief Alternative constructor.
-       *
-       * @note Algorithms cannot be copied.
-       */    
-      TePDIAlgorithm( const TePDIAlgorithm& ) {};
-    
-      /**
-       * @brief Operator = overload.
-       *
-       * @note Algorithms cannot be copied.
-       *
-       * @param external External algorithm reference.
-       * @return A const Algorithm reference.
-       */
-      const TePDIAlgorithm& operator=( 
-        const TePDIAlgorithm& external );
-  };
-
-#endif //TEPDIALGORITHM_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIALGORITHM_HPP
+  #define TEPDIALGORITHM_HPP
+
+  #include "TePDIParameters.hpp"
+  #include "TePDIPIManager.hpp"
+  #include "TePDIDefines.hpp"
+  
+  #include <TeSharedPtr.h>
+  #include <TeProgress.h>
+
+/**
+ * @class TePDIAlgorithm
+ * @brief The base class for digital image processing algorithms.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup TePDIGeneralAlgoGroup
+ */
+  class PDI_DLL TePDIAlgorithm
+  {
+    public :
+      /** @typedef TeSharedPtr< TePDIAlgorithm > pointer
+       * Type definition for an algorithm instance pointer. 
+       */
+      typedef TeSharedPtr< TePDIAlgorithm > pointer;
+      
+      /** @typedef const TeSharedPtr< TePDIAlgorithm > const_pointer
+       * Type definition for a const algorithm instance pointer. 
+       */
+      typedef const TeSharedPtr< TePDIAlgorithm > const_pointer;
+      
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TePDIAlgorithm();
+
+      /**
+       * @brief Applies the algorithm following the current state and
+       * internal stored parameters.
+       *
+       * @return true if OK. false on error.
+       */
+      bool Apply();
+      
+      /**
+       * @brief Applies the algorithm following the state defined by
+       * the supplied parameters.
+       * @param params The new supplied parameters.
+       * @return true if OK. false on error.
+       */
+      bool Apply( const TePDIParameters& params );      
+
+      /**
+       * @brief Reset the internal state with new supplied parameters.
+       *
+       * @param params The new supplied parameters.
+       * @return true if parameters OK, false on error.
+       */
+      bool Reset( const TePDIParameters& params );
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      virtual bool CheckParameters( 
+        const TePDIParameters& parameters ) const = 0;
+
+      /**
+       * @brief Returns a reference to the current internal parameters.
+       *
+       * @return A reference to the current internal parameters.
+       */
+      const TePDIParameters& GetParameters() const;
+      
+      /**
+       * @brief Returns a default object.
+       *
+       * @return A default object.
+       */
+      static TePDIAlgorithm* DefaultObject( const TePDIParameters& params );
+      
+      /**
+       * @brief Enable / Disable the progress interface.
+       * @param enabled Flag to enable ( true ) or disable ( false ).
+       */
+      void ToggleProgInt( bool enabled );        
+
+    protected :
+      /**
+       * @brief Internal parameters reference
+       */
+      mutable TePDIParameters params_;
+      
+      /**
+       * @brief A flag to indicate when the algorithm should initiate
+       * a progress interface.
+       */
+      bool progress_enabled_;
+       
+      /**
+       * @brief The internal progress interface.
+       * @deprecated DEPRECATED - This object will be removed in the future 
+       * (each algorithm must check the variable 
+       * TePDIAlgorithm::progress_enabled_ and instantiate its own 
+       * TePDIPIManager when necessary).
+       */    
+      TePDIPIManager pi_manager_;      
+        
+      /**
+       * @brief Default Constructor
+       */
+      TePDIAlgorithm();
+
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      virtual bool RunImplementation() = 0;
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      virtual void ResetState( const TePDIParameters& params ) = 0;
+      
+      /**
+       * @brief Checks if current internal parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @return true if the internal parameters are OK. false if not.
+       */
+      bool CheckInternalParameters() const;
+      
+      /**
+       * @brief Start the progress interface.
+       *
+       * @param message Progress window message.
+       * @param steps Progress window total steps.
+       * @deprecated DEPRECATED - This method will be removed in the future 
+       * (each algorithm must check the variable 
+       * TePDIAlgorithm::progress_enabled_ and instantiate its own 
+       * TePDIPIManager when necessary).       
+       */
+      void StartProgInt( const std::string& message, 
+        unsigned int steps );
+        
+      /**
+       * @brief Update the current progress interface to the current step.
+       *
+       * @param step Current step.
+       * @return true if the interface was canceled, false otherwise.
+       * @deprecated DEPRECATED - This method will be removed in the future 
+       * (each algorithm must check the variable 
+       * TePDIAlgorithm::progress_enabled_ and instantiate its own 
+       * TePDIPIManager when necessary).       
+       */
+      bool UpdateProgInt( unsigned int step );
+      
+      /**
+       * @brief Increments the the current progress by one step.
+       * @return true if the interface was canceled, false otherwise.
+       * @deprecated DEPRECATED - This method will be removed in the future 
+       * (each algorithm must check the variable 
+       * TePDIAlgorithm::progress_enabled_ and instantiate its own 
+       * TePDIPIManager when necessary).       
+       */
+      bool IncProgInt();
+                
+      /**
+       * @brief Stop the progress interface.
+       * @deprecated DEPRECATED - This method will be removed in the future 
+       * (each algorithm must check the variable 
+       * TePDIAlgorithm::progress_enabled_ and instantiate its own 
+       * TePDIPIManager when necessary).       
+       *
+       */      
+      void StopProgInt();
+      
+    private :
+    
+      /**
+       * @brief Alternative constructor.
+       *
+       * @note Algorithms cannot be copied.
+       */    
+      TePDIAlgorithm( const TePDIAlgorithm& ) {};
+    
+      /**
+       * @brief Operator = overload.
+       *
+       * @note Algorithms cannot be copied.
+       *
+       * @param external External algorithm reference.
+       * @return A const Algorithm reference.
+       */
+      const TePDIAlgorithm& operator=( 
+        const TePDIAlgorithm& external );
+  };
+
+#endif //TEPDIALGORITHM_HPP
diff --git a/src/terralib/image_processing/TePDIAlgorithmFactory.cpp b/src/terralib/image_processing/TePDIAlgorithmFactory.cpp
old mode 100755
new mode 100644
index 9410587..d5a127b
--- a/src/terralib/image_processing/TePDIAlgorithmFactory.cpp
+++ b/src/terralib/image_processing/TePDIAlgorithmFactory.cpp
@@ -1,11 +1,11 @@
- 
-#include "TePDIAlgorithmFactory.hpp"
-
-TePDIAlgorithmFactory::TePDIAlgorithmFactory( const std::string& factoryName )
-: TeFactory< TePDIAlgorithm, TePDIParameters >( factoryName )
-{
-};      
-
-TePDIAlgorithmFactory::~TePDIAlgorithmFactory()
-{
-};
+ 
+#include "TePDIAlgorithmFactory.hpp"
+
+TePDIAlgorithmFactory::TePDIAlgorithmFactory( const std::string& factoryName )
+: TeFactory< TePDIAlgorithm, TePDIParameters >( factoryName )
+{
+};      
+
+TePDIAlgorithmFactory::~TePDIAlgorithmFactory()
+{
+};
diff --git a/src/terralib/image_processing/TePDIAlgorithmFactory.hpp b/src/terralib/image_processing/TePDIAlgorithmFactory.hpp
old mode 100755
new mode 100644
index 4d4683e..fcb5643
--- a/src/terralib/image_processing/TePDIAlgorithmFactory.hpp
+++ b/src/terralib/image_processing/TePDIAlgorithmFactory.hpp
@@ -1,95 +1,91 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef PDI_ALGORITHM_FACTORIES_REGISTERED
-  #define PDI_ALGORITHM_FACTORIES_REGISTERED
-
-  #include "TePDIArithmeticFactory.hpp"
-  #include "TePDIBDFilterFactory.hpp"
-  #include "TePDIColorTransformFactory.hpp"
-  #include "TePDIContrastFactory.hpp"
-  #include "TePDIMorfFilterFactory.hpp"
-  #include "TePDILinearFilterFactory.hpp"
-  #include "TePDIPrincipalComponentsFactory.hpp"
-  #include "TePDIRadarFrostFilterFactory.hpp"
-  #include "TePDIRadarKuanFilterFactory.hpp"
-  #include "TePDIRadarLeeFilterFactory.hpp"
-  #include "TePDIRaster2VectorFactory.hpp"
-  #include "TePDIRegGrowSegFactory.hpp"
-  #include "TePDIGeoMosaicFactory.hpp"
-  #include "TePDIBatchGeoMosaicFactory.hpp"
-  #include "TePDIFusionFactory.hpp"
-  #include "TePDIRegisterFactory.hpp"
-  #include "TePDIBlendingFactory.hpp"
-  #include "TePDIIsosegClasFactory.hpp"
-  #include "TePDIMixModelFactory.hpp"
-  #include "TePDIKMeansClasFactory.hpp"
-  #include "TePDIEMClasFactory.hpp"
-  #include "TePDISensorSimulator.hpp"
-  
-#endif 
-
-#ifndef TEPDIALGORITHMFACTORY_HPP
-  #define TEPDIALGORITHMFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIParameters.hpp"
-  #include "TePDIDefines.hpp"
-  
-  #include <TeFactory.h>
-  
-  #include <string>
-  
-  /**
-   * @brief This is the class for digital image processing algorithms factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIAlgorithmFactory : 
-    public TeFactory< TePDIAlgorithm, TePDIParameters >
-  {
-    public :
-      typedef TeSharedPtr< TePDIAlgorithmFactory > pointer;
-      typedef const TeSharedPtr< TePDIAlgorithmFactory > const_pointer;
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIAlgorithmFactory();
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIAlgorithmFactory( const std::string& factoryName );
-  };
-  
-#endif
-
-
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef PDI_ALGORITHM_FACTORIES_REGISTERED
+  #define PDI_ALGORITHM_FACTORIES_REGISTERED
+
+  #include "TePDIArithmeticFactory.hpp"
+  #include "TePDIBDFilterFactory.hpp"
+  #include "TePDIColorTransformFactory.hpp"
+  #include "TePDIContrastFactory.hpp"
+  #include "TePDIMorfFilterFactory.hpp"
+  #include "TePDILinearFilterFactory.hpp"
+  #include "TePDIPrincipalComponentsFactory.hpp"
+  #include "TePDIRadarFrostFilterFactory.hpp"
+  #include "TePDIRadarKuanFilterFactory.hpp"
+  #include "TePDIRadarLeeFilterFactory.hpp"
+  #include "TePDIRaster2VectorFactory.hpp"
+  #include "TePDIRegGrowSegFactory.hpp"
+  #include "TePDIRegisterFactory.hpp"
+  #include "TePDIIsosegClasFactory.hpp"
+  #include "TePDIMixModelFactory.hpp"
+  #include "TePDIKMeansClasFactory.hpp"
+  #include "TePDIEMClasFactory.hpp"
+  #include "TePDISensorSimulator.hpp"
+  
+#endif 
+
+#ifndef TEPDIALGORITHMFACTORY_HPP
+  #define TEPDIALGORITHMFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIParameters.hpp"
+  #include "TePDIDefines.hpp"
+  
+  #include <TeFactory.h>
+  
+  #include <string>
+  
+  /**
+   * @brief This is the class for digital image processing algorithms factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIAlgorithmFactory : 
+    public TeFactory< TePDIAlgorithm, TePDIParameters >
+  {
+    public :
+      typedef TeSharedPtr< TePDIAlgorithmFactory > pointer;
+      typedef const TeSharedPtr< TePDIAlgorithmFactory > const_pointer;
+      
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TePDIAlgorithmFactory();
+      
+    protected :
+      
+      /**
+       * @brief Default constructor
+       *
+       * @param factoryName Factory name.
+       */
+      TePDIAlgorithmFactory( const std::string& factoryName );
+  };
+  
+#endif
+
+
+
diff --git a/src/terralib/image_processing/TePDIArithmetic.cpp b/src/terralib/image_processing/TePDIArithmetic.cpp
old mode 100755
new mode 100644
index 6c40c18..203eb65
--- a/src/terralib/image_processing/TePDIArithmetic.cpp
+++ b/src/terralib/image_processing/TePDIArithmetic.cpp
@@ -1,280 +1,1053 @@
-#include "TePDIArithmetic.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-
-
-TePDIArithmetic::TePDIArithmetic()
-{
-}
-
-
-TePDIArithmetic::~TePDIArithmetic()
-{
-}
-
-
-void TePDIArithmetic::ResetState( const TePDIParameters& params )
-{
-  TePDILevelRemap::ResetState( params );
-}
-
-
-bool TePDIArithmetic::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking for the correct allowed algorithm types */
-
-  TePDIArithmetic::TePDIArithmeticType arithmetic_type;
-  if( ! parameters.GetParameter( "arithmetic_type", arithmetic_type ) ) {
-    TEAGN_LOGERR( "Missing parameter: arithmetic_type" );
-    return false;
-  }
-  if( ( arithmetic_type != TePDIAType1 ) &&
-      ( arithmetic_type != TePDIAType2 ) &&
-      ( arithmetic_type != TePDIAType3 ) &&
-      ( arithmetic_type != TePDIAType4 ) &&
-      ( arithmetic_type != TePDIAType5 ) ) {
-
-    TEAGN_LOGERR( "Invalid parameter: arithmetic_type" );
-    return false;
-  }
-
-  /* Checking input_image1 */
-
-  TePDITypes::TePDIRasterPtrType inRaster1;
-  if( ! parameters.GetParameter( "input_image1", inRaster1 ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: input_image1" );
-    return false;
-  }
-  if( ! inRaster1.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image1 inactive" );
-    return false;
-  }
-  if( inRaster1->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image1 not ready" );
-    return false;
-  }
-  
-  /* Checking output_image */
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: output_image" );
-    return false;
-  }
-  if( ! outRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
-    return false;
-  }
-  if( outRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
-    return false;
-  }
-  
-  /* Checking input_image2 */
-
-  TePDITypes::TePDIRasterPtrType inRaster2;
-  if( arithmetic_type != TePDIAType1 ) {
-    if( ! parameters.GetParameter( "input_image2", inRaster2 ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: input_image2" );
-      return false;
-    }
-    if( ! inRaster2.isActive() ) {
-
-      TEAGN_LOGERR( "Invalid parameter: input_image2 inactive" );
-      return false;
-    }
-    if( inRaster2->params().status_ == TeRasterParams::TeNotReady ) {
-
-      TEAGN_LOGERR( "Invalid parameter: input_image2 not ready" );
-      return false;
-    }
-  }
-
-  if( arithmetic_type != TePDIAType1 ) {
-    TeRasterParams params1 = inRaster1->params();
-    TeRasterParams params2 = inRaster2->params();
-
-    TEAGN_TRUE_OR_RETURN( params1.ncols_ == params2.ncols_,
-      "Image1 and Imaga2 have different columns number" );
-    TEAGN_TRUE_OR_RETURN( params1.nlines_ == params2.nlines_,
-      "Image1 and Imaga2 have different lines number" );
-  }
-
-  /* channel parameters checking */
-
-  int img1_chan;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "img1_chan", img1_chan ),
-    "Missing parameter: img1_chan" );
-  TEAGN_TRUE_OR_RETURN( ( img1_chan < inRaster1->nBands() ) &&
-    ( img1_chan >= 0 ), "Invalid parameter: img1_chan" );
-
-  int img2_chan;
-  if( arithmetic_type != TePDIAType1 ) {
-    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "img2_chan", img2_chan ),
-        "Missing parameter: img2_chan" );
-    TEAGN_TRUE_OR_RETURN( ( img2_chan < inRaster2->nBands() ) &&
-      ( img2_chan >= 0 ), "Invalid parameter: img2_chan" );
-  }
-
-  /* Checking for gain and offset */
-
-  TEAGN_TRUE_OR_RETURN(
-    parameters.CheckParameter< double >( "gain" ),
-    "Missing parameter: gain" );
-
-  TEAGN_TRUE_OR_RETURN(
-    parameters.CheckParameter< double >( "offset" ),
-    "Missing parameter: offset" );
-    
-  /* Checking photometric interpretation */
-  
-  TEAGN_TRUE_OR_RETURN( ( 
-    ( inRaster1->params().photometric_[ img1_chan ] == 
-      TeRasterParams::TeRGB ) ||
-    ( inRaster1->params().photometric_[ img1_chan ] == 
-      TeRasterParams::TeMultiBand ) ),
-    "Invalid paramter - input_image1 (invalid photometric interpretation)" );
-    
-  if( inRaster2.isActive() ) {
-    TEAGN_TRUE_OR_RETURN( ( 
-      ( inRaster2->params().photometric_[ img2_chan ] == 
-        TeRasterParams::TeRGB ) ||
-      ( inRaster2->params().photometric_[ img2_chan ] == 
-        TeRasterParams::TeMultiBand ) ),
-      "Invalid parameter - input_image2 (invalid photometric interpretation)" );    
-  }
-
-  return true;
-}
-
-
-bool TePDIArithmetic::RunImplementation()
-{
-  /* Parameters aquirement */
-
-  TePDIArithmeticType arithmetic_type;
-  params_.GetParameter( "arithmetic_type", arithmetic_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster1;
-  params_.GetParameter( "input_image1", inRaster1 );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  TePDITypes::TePDIRasterPtrType inRaster2;
-  if( arithmetic_type != TePDIAType1 ) {
-    params_.GetParameter( "input_image2", inRaster2 );
-  }
-
-  int img1_chan;
-  params_.GetParameter( "img1_chan", img1_chan );
-
-  int img2_chan;
-  if( arithmetic_type != TePDIAType1 ) {
-   params_.GetParameter( "img2_chan", img2_chan );
-  }
-
-  double gain;
-  params_.GetParameter( "gain", gain );
-
-  double offset;
-  params_.GetParameter( "offset", offset );
-  
-  bool normalize_output_flag = false;
-  if( params_.CheckParameter< int >( "normalize_output" ) ) {
-    
-    int temp_int = 0;
-    params_.GetParameter( "normalize_output", temp_int );
-    if( temp_int == 1 ) {
-      normalize_output_flag = true;
-    }
-  }
-
-  /* Setting the output raster */
-  
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( 1 );
-  if( inRaster1->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster1->projection()->params() ) );
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  
-  const TeBox bbox = inRaster1->params().boundingBox();
-  
-  outRaster_params.boundingBoxLinesColumns( bbox.x1(), bbox.y1(),
-    bbox.x2(), bbox.y2(), inRaster1->params().nlines_,
-    inRaster1->params().ncols_, TeBox::TeUPPERLEFT );
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );
-
-  /* Switching the arithmetic function pointer */
-
-  remap_func_3_ptr_type remap_func_3 = 0;
-  remap_func_4_ptr_type remap_func_4 = 0;
-
-  switch( arithmetic_type ) {
-    case TePDIAType1 :
-    {
-      remap_func_3 = &type1_arith;
-      break;
-    }
-    case TePDIAType2 :
-    {
-      remap_func_4 = &type2_arith;
-      break;
-    }
-    case TePDIAType3 :
-    {
-      remap_func_4 = &type3_arith;
-      break;
-    }
-    case TePDIAType4 :
-    {
-      remap_func_4 = &type4_arith;
-      break;
-    }
-    case TePDIAType5 :
-    {
-      remap_func_4 = &type5_arith;
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_RETURN( "Invalid arithmetic type" );
-    }
-  }
-
-  /* Running remapping function */
-
-  if( remap_func_3 != 0 ) {
-    TEAGN_TRUE_OR_RETURN( RemapLevels( inRaster1, remap_func_3, img1_chan, 0, 
-      gain, offset, 
-      normalize_output_flag, outRaster ), "Level remapping error" );
-  } else if( remap_func_4 != 0 ) {
-    TEAGN_TRUE_OR_RETURN( RemapLevels( inRaster1, inRaster2, remap_func_4, 
-      img1_chan, img2_chan, 0,
-      gain, offset, normalize_output_flag, outRaster ), 
-      "Level remapping error" );
-  } else {
-    TEAGN_LOG_AND_RETURN( "Invalid remap function" );
-  }
-
-  return true;
-}
-
-
-
-
+#include "TePDIArithmetic.hpp"
+#include "TePDIPIManager.hpp"
+#include "TePDIUtils.hpp"
+
+#include <TeUtils.h>
+#include <TeAgnostic.h>
+
+#include <stack>
+
+
+TePDIArithmetic::TePDIArithmetic()
+{
+}
+
+
+TePDIArithmetic::~TePDIArithmetic()
+{
+}
+
+
+void TePDIArithmetic::ResetState( const TePDIParameters& )
+{
+  progress_.Reset();
+}
+
+
+bool TePDIArithmetic::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking input rasters */
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "input_rasters", input_rasters ),
+    "Missing parameter: input_rasters" );
+    
+  TEAGN_TRUE_OR_RETURN( input_rasters.size() > 0, "Invalid number of rasters" );
+    
+  for( unsigned int index = 0 ; index < input_rasters.size() ; ++index ) 
+  {
+    TEAGN_TRUE_OR_RETURN( input_rasters[ index ].isActive(),
+      "Invalid parameter: raster " + 
+      Te2String( index ) + " inactive" );
+      
+    TEAGN_TRUE_OR_RETURN( 
+      input_rasters[ index ]->params().status_ != TeRasterParams::TeNotReady,
+      "Invalid parameter: raster " + 
+      Te2String( index ) + " not ready" );
+      
+    /* Checking the number of lines */
+    
+    TEAGN_TRUE_OR_RETURN( 
+      input_rasters[ index ]->params().nlines_ == 
+      input_rasters[ 0 ]->params().nlines_,
+      "All rasters must have the same number of lines" ); 
+    TEAGN_TRUE_OR_RETURN( 
+      input_rasters[ index ]->params().ncols_ == 
+      input_rasters[ 0 ]->params().ncols_,
+      "All rasters must have the same number of columns" );         
+         
+  }
+  
+  /* Checking output_image */
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  if( ! parameters.GetParameter( "output_raster", output_raster ) ) 
+  {
+    TEAGN_LOGERR( "Missing parameter: output_raster" );
+    return false;
+  }
+  if( ! output_raster.isActive() ) 
+  {
+    TEAGN_LOGERR( "Invalid parameter: output_raster inactive" );
+    return false;
+  }
+  if( output_raster->params().status_ == TeRasterParams::TeNotReady ) 
+  {
+    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
+    return false;
+  }
+  
+  // Checking arithmetic_string
+  
+  std::string arithmetic_string;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "arithmetic_string", 
+    arithmetic_string ), "Missing parameter: arithmetic_string" );
+    
+  TePDITypes::TePDIRasterPtrType auxRaster;
+  TEAGN_TRUE_OR_RETURN( executeString( arithmetic_string, input_rasters, 
+    auxRaster, false ),
+    "Invalid parameter: arithmetic_string" );
+
+  return true;
+}
+
+bool TePDIArithmetic::RunImplementation()
+{
+  /* Parameters aquirement */
+
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  params_.GetParameter( "input_rasters", input_rasters );
+
+  std::string arithmetic_string;
+  params_.GetParameter( "arithmetic_string", arithmetic_string );
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter( "output_raster", output_raster );
+  
+  bool normalize_output = false;
+  if( params_.CheckParameter< int >( "normalize_output" ) )
+  {
+    normalize_output = true;
+  }
+  
+  /* Configuring the output raster */
+  
+  TeRasterParams outRaster_params = output_raster->params();
+  
+  outRaster_params.nBands( 1 );
+  outRaster_params.projection( input_rasters[ 0 ]->projection() );
+  outRaster_params.boundingBoxLinesColumns( 
+    input_rasters[ 0 ]->params().boundingBox().x1(), 
+    input_rasters[ 0 ]->params().boundingBox().y1(),
+    input_rasters[ 0 ]->params().boundingBox().x2(), 
+    input_rasters[ 0 ]->params().boundingBox().y2(), 
+    input_rasters[ 0 ]->params().nlines_,
+    input_rasters[ 0 ]->params().ncols_, 
+    TeBox::TeUPPERLEFT );
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+
+  TEAGN_TRUE_OR_RETURN( output_raster->init( outRaster_params ),
+    "Output raster reset error" );
+  
+  // Counting the number of operations to be done
+    
+  unsigned int operationsNumber = 0;
+  {
+    for( unsigned sIdx = 0 ; sIdx < arithmetic_string.size() ; ++sIdx )
+    { 
+      std::string auxStr;
+      auxStr.push_back( arithmetic_string[ sIdx ] );
+      
+      if( isOperator( auxStr ) ) ++operationsNumber;
+    }
+  }
+    
+  // Creating the progress instance
+  
+  progress_.Reset( "Processing", (unsigned int)( 
+    input_rasters[ 0 ]->params().nlines_ * ( operationsNumber + 
+    ( normalize_output ? 2 : 1 ) ) ) );
+  progress_.Toggle( progress_enabled_ );
+    
+  // Executing the arithmetic string
+  
+  TePDITypes::TePDIRasterPtrType auxRaster;
+  TEAGN_TRUE_OR_RETURN( executeString( arithmetic_string, input_rasters, 
+    auxRaster, true ), 
+    "Arithmetic string execution error" );
+    
+  // Copy result data to output raster
+  
+  const unsigned int nLines = (unsigned int)auxRaster->params().nlines_;
+  const unsigned int nCols = (unsigned int)auxRaster->params().ncols_;
+  unsigned int line = 0;
+  unsigned int col = 0;
+  double value = 0;
+  TeRaster& auxRasterRef = *auxRaster;
+  TeRaster& outRasterRef = *output_raster;    
+  
+  if( normalize_output && ( output_raster->params().dataType_[ 0 ] !=
+    TeDOUBLE ) )
+  {
+    // Calculating the output gain and offset
+    
+    double auxMin = DBL_MAX;
+    double auxMax = -1.0 * auxMin;  
+    
+    for( line = 0 ; line < nLines ; ++line )
+    {
+      for( col = 0 ; col < nCols ; ++col )
+      {
+        auxRasterRef.getElement( col, line, value, 0 );
+        
+        if( auxMin > value ) auxMin = value;
+        if( auxMax < value ) auxMax = value;
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+    } 
+    
+    double outAllowedMin = 0;
+    double outAllowedMax = 0;
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds( output_raster,
+      0, outAllowedMin, outAllowedMax ), "Execution error" );
+      
+    double outputGain = ( auxMax != auxMin ) ?
+      ( ( outAllowedMax - outAllowedMin ) / ( auxMax - auxMin ) ) : 1.0;       
+      
+    for( line = 0 ; line < nLines ; ++line )
+    {
+      for( col = 0 ; col < nCols ; ++col )
+      {
+        auxRasterRef.getElement( col, line, value, 0 );
+        
+        value -= auxMin;
+        value *= outputGain;
+        
+        value = MIN( value, outAllowedMax );
+        value = MAX( value, outAllowedMin );
+        
+        outRasterRef.setElement( col, line, value, 0 );
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+    }        
+  }
+  else
+  {
+    for( line = 0 ; line < nLines ; ++line )
+    {
+      for( col = 0 ; col < nCols ; ++col )
+      {
+        auxRasterRef.getElement( col, line, value, 0 );
+        outRasterRef.setElement( col, line, value, 0 );
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+    }  
+  }
+
+  return true;
+}
+
+bool TePDIArithmetic::executeString( const std::string& aStr, 
+  const TePDITypes::TePDIRasterVectorType& inRasters,
+  TePDITypes::TePDIRasterPtrType& outRaster,
+  bool generateOutput ) const
+{
+  std::vector< std::string > infixTokensVec;
+  getTokensStrs( aStr, infixTokensVec );
+//  printTokens( infixTokensVec );
+  
+  if( infixTokensVec.size() )
+  {
+    std::vector< std::string > postfixTokensVec;
+    
+//    printTokens( infixTokensVec );
+    inFix2PostFix( infixTokensVec, postfixTokensVec );
+//    printTokens( postfixTokensVec );
+    
+    ExecStackT execStack;
+    unsigned int auxRasterIdx = 0;
+    unsigned int auxBandIdx = 0;
+    double auxRealValue = 0;
+    
+    for( unsigned int tIdx = 0 ; tIdx < postfixTokensVec.size() ; ++tIdx )
+    {
+      const std::string& curToken = postfixTokensVec[ tIdx ];
+      
+      if( isRasterBandToken( curToken, auxRasterIdx, auxBandIdx ) )
+      {
+        TEAGN_TRUE_OR_RETURN( auxRasterIdx < inRasters.size(), 
+          "Invalid raster index found at " + curToken );
+        TEAGN_TRUE_OR_RETURN( (int)auxBandIdx < 
+          inRasters[ auxRasterIdx ]->params().nBands(), 
+          "Invalid band index" );
+      
+        ExecStackElement auxEle;
+        auxEle.isRaster_ = true;
+        auxEle.rasterPtr_ = inRasters[ auxRasterIdx ];
+        auxEle.rasterBand_ = auxBandIdx;
+          
+        execStack.push( auxEle );
+      }
+      else if( isRealNumberToken( curToken, auxRealValue ) )
+      {
+        ExecStackElement auxEle;
+        auxEle.isRealNumber_ = true;
+        auxEle.realNumberValue_ = auxRealValue;
+          
+        execStack.push( auxEle );
+      }      
+      else if( isBinaryOperator( curToken ) )
+      {
+        TEAGN_TRUE_OR_RETURN( execBinaryOperator( curToken, execStack,
+          generateOutput ),
+          "Operator " + curToken + " execution error" );
+      }
+      else if( isUnaryOperator( curToken ) )
+      {
+        TEAGN_TRUE_OR_RETURN( execUnaryOperator( curToken, execStack,
+          generateOutput ),
+          "Operator " + curToken + " execution error" );
+      }
+      else
+      {
+        TEAGN_LOG_AND_RETURN( "Invalid operator found: " + curToken );
+      }
+    }
+    
+    TEAGN_TRUE_OR_RETURN( execStack.size() == 1, "Invalid stack size" );
+    TEAGN_TRUE_OR_RETURN( execStack.top().isRaster_, "Stack result error" );
+      
+    outRaster = execStack.top().rasterPtr_;
+  }
+  
+  return true;
+}
+
+void TePDIArithmetic::inFix2PostFix( const std::vector< std::string >& input, 
+  std::vector< std::string >& output ) const
+{
+  output.clear();
+  
+  std::stack< std::string > auxStack;
+  const unsigned int inputSize = (unsigned int)input.size();
+  
+  for( unsigned int inIdx = 0 ; inIdx < inputSize ; ++inIdx )
+  {
+    const std::string& currInToken = input[ inIdx ];
+    
+    if( isOperator( currInToken ) )
+    {
+      while( ( ! auxStack.empty() ) && ( auxStack.top() != "(" ) )
+      {
+        if ( op1HasGreaterOrEqualPrecedence( auxStack.top(), currInToken ) )
+        {
+          output.push_back( auxStack.top() );
+          
+          auxStack.pop();
+        }
+        else 
+        {
+          break;
+        }
+      }
+      
+      auxStack.push( currInToken );
+    }
+    else if( currInToken == "(" )
+    {
+      auxStack.push( currInToken );
+    }
+    else if( currInToken == ")" )
+    {
+      while ( ( ! auxStack.empty() ) && ( auxStack.top() != "(" ) )
+      {
+        output.push_back( auxStack.top() );
+        
+        auxStack.pop();
+      }
+      
+      if ( ! auxStack.empty() ) 
+      {
+        auxStack.pop();
+      }
+    }    
+    else
+    {
+      output.push_back( currInToken );
+    }
+  }
+  
+  while ( ! auxStack.empty() )
+  {
+    output.push_back( auxStack.top() );
+    
+    auxStack.pop();
+  }  
+}
+
+void TePDIArithmetic::printTokens( const std::vector< std::string >& input ) 
+  const
+{
+  std::cout << std::endl;
+  
+  for( unsigned int idx = 0 ; idx < input.size() ; ++idx )
+  {
+    std::cout << "[" << input[ idx ] << "]";
+  }
+  
+  std::cout << std::endl;
+}
+
+bool TePDIArithmetic::isOperator( const std::string& inputToken ) const
+{
+  return ( isBinaryOperator( inputToken ) || 
+    isUnaryOperator( inputToken ) );
+}  
+
+bool TePDIArithmetic::isBinaryOperator( const std::string& inputToken ) const
+{
+  return ( ( inputToken == "+" ) || ( inputToken == "-" ) || 
+    ( inputToken == "*" ) || ( inputToken == "/" ) ) ? 
+    true : false;
+}
+
+bool TePDIArithmetic::isUnaryOperator( const std::string& ) const
+{
+  return false;
+}
+
+bool TePDIArithmetic::op1HasGreaterOrEqualPrecedence( const std::string& 
+  operator1, const std::string& operator2 ) const
+{
+ if( ( operator1 == "*" ) || ( operator1 == "/" ) )
+  {
+    return true;
+  }
+  else
+  {
+    if( ( operator2 == "+" ) || ( operator2 == "-" ) )
+    {
+      return true;
+    }
+  }
+  
+  return false; 
+}
+
+bool TePDIArithmetic::isRasterBandToken( const std::string& token,
+  unsigned int& rasterIdx, unsigned int& bandIdx ) const
+{
+  if( token.size() < 4 ) return false;
+  if( token[ 0 ] != 'R' ) return false;
+  
+  std::string rasterIdxStr;
+  unsigned int tIdx = 1;
+  
+  while( ( tIdx < token.size() ) && isdigit( token[ tIdx ] ) )
+  {
+    rasterIdxStr.push_back( token[ tIdx ] );
+    ++tIdx;
+  }
+  
+  if( token[ tIdx ] != ':' ) return false;
+  ++tIdx;
+  
+  std::string bandIdxStr;
+  
+  while( ( tIdx < token.size() ) && isdigit( token[ tIdx ] ) )
+  {
+    bandIdxStr.push_back( token[ tIdx ] );
+    ++tIdx;
+  }
+  
+  if( ( rasterIdxStr.size() ) && ( bandIdxStr.size() ) )
+  {
+    rasterIdx = (unsigned int)atoi( rasterIdxStr.c_str() );
+    bandIdx = (unsigned int)atoi( bandIdxStr.c_str() );
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+bool TePDIArithmetic::execBinaryOperator( const std::string& token, 
+  ExecStackT& execStack, bool generateOutput ) const
+{
+  if( execStack.size() < 2 )
+  {
+    return false;
+  }
+  else
+  {
+    ExecStackElement sElem1 = execStack.top();
+    execStack.pop();
+    
+    ExecStackElement sElem2 = execStack.top();
+    execStack.pop();    
+    
+    if( token == "+" )
+    {
+      if( ( sElem1.isRaster_ ) && ( sElem2.isRaster_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem1.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem1.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster1Ref = *sElem1.rasterPtr_;
+        TeRaster& inRaster2Ref = *sElem2.rasterPtr_;  
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value1 = 0;
+          double value2 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster1Ref.getElement( col, line, value1, sElem1.rasterBand_ );
+              inRaster2Ref.getElement( col, line, value2, sElem2.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, value1 + value2, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }
+      else if( ( sElem1.isRaster_ ) && ( sElem2.isRealNumber_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem1.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem1.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster1Ref = *sElem1.rasterPtr_;
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value1 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster1Ref.getElement( col, line, value1, sElem1.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, value1 + 
+                sElem2.realNumberValue_, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }   
+      else if( ( sElem1.isRealNumber_ ) && ( sElem2.isRaster_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem2.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem2.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster2Ref = *sElem2.rasterPtr_;
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value2 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster2Ref.getElement( col, line, value2, sElem2.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, value2 + 
+                sElem1.realNumberValue_, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }          
+      else
+      {
+        TEAGN_LOG_AND_RETURN( "Invalid operation" );
+      }
+    }
+    else if( token == "-" )
+    {
+      if( ( sElem1.isRaster_ ) && ( sElem2.isRaster_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem1.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem1.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster1Ref = *sElem1.rasterPtr_;
+        TeRaster& inRaster2Ref = *sElem2.rasterPtr_;  
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value1 = 0;
+          double value2 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster1Ref.getElement( col, line, value1, sElem1.rasterBand_ );
+              inRaster2Ref.getElement( col, line, value2, sElem2.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, value2 - value1, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }
+      else if( ( sElem1.isRaster_ ) && ( sElem2.isRealNumber_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem1.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem1.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster1Ref = *sElem1.rasterPtr_;
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value1 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster1Ref.getElement( col, line, value1, sElem1.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, sElem2.realNumberValue_ - 
+                value1, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }   
+      else if( ( sElem1.isRealNumber_ ) && ( sElem2.isRaster_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem2.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem2.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster2Ref = *sElem2.rasterPtr_;
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value2 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster2Ref.getElement( col, line, value2, sElem2.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, value2 -
+                sElem1.realNumberValue_, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }       
+      else
+      {
+        TEAGN_LOG_AND_RETURN( "Invalid operation" );
+      }    
+    }
+    else if( token == "*" )
+    {
+      if( ( sElem1.isRaster_ ) && ( sElem2.isRaster_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem1.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem1.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster1Ref = *sElem1.rasterPtr_;
+        TeRaster& inRaster2Ref = *sElem2.rasterPtr_;  
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value1 = 0;
+          double value2 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster1Ref.getElement( col, line, value1, sElem1.rasterBand_ );
+              inRaster2Ref.getElement( col, line, value2, sElem2.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, value1 * value2, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }
+      else if( ( sElem1.isRaster_ ) && ( sElem2.isRealNumber_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem1.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem1.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster1Ref = *sElem1.rasterPtr_;
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value1 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster1Ref.getElement( col, line, value1, sElem1.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, value1 * 
+                sElem2.realNumberValue_, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }   
+      else if( ( sElem1.isRealNumber_ ) && ( sElem2.isRaster_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem2.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem2.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster2Ref = *sElem2.rasterPtr_;
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value2 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster2Ref.getElement( col, line, value2, sElem2.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, value2 * 
+                sElem1.realNumberValue_, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }        
+      else
+      {
+        TEAGN_LOG_AND_RETURN( "Invalid operation" );
+      }    
+    }
+    else if( token == "/" )
+    {
+      if( ( sElem1.isRaster_ ) && ( sElem2.isRaster_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem1.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem1.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster1Ref = *sElem1.rasterPtr_;
+        TeRaster& inRaster2Ref = *sElem2.rasterPtr_;  
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value1 = 0;
+          double value2 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster1Ref.getElement( col, line, value1, sElem1.rasterBand_ );
+              inRaster2Ref.getElement( col, line, value2, sElem2.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, value2 / value1, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }
+      else if( ( sElem1.isRaster_ ) && ( sElem2.isRealNumber_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem1.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem1.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster1Ref = *sElem1.rasterPtr_;
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value1 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster1Ref.getElement( col, line, value1, sElem1.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, sElem2.realNumberValue_ / 
+                value1, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }   
+      else if( ( sElem1.isRealNumber_ ) && ( sElem2.isRaster_ ) )
+      {
+        const unsigned int nLines = (unsigned int)
+          sElem2.rasterPtr_->params().nlines_;
+        const unsigned int nCols = (unsigned int)
+          sElem2.rasterPtr_->params().ncols_;
+        
+        ExecStackElement outElement;
+        outElement.isRaster_ = true;
+        TEAGN_TRUE_OR_RETURN( allocResultRaster( nLines, nCols, 
+          outElement.rasterPtr_ ), "Raster allocation error" );
+          
+        TeRaster& outRasterRef = *outElement.rasterPtr_;
+        TeRaster& inRaster2Ref = *sElem2.rasterPtr_;
+              
+        if( generateOutput )
+        {
+          unsigned int line = 0;
+          unsigned int col = 0;
+          double value2 = 0;
+          
+          for( line = 0 ; line < nLines ; ++line )
+          {
+            for( col = 0 ; col < nCols ; ++col )
+            {
+              inRaster2Ref.getElement( col, line, value2, sElem2.rasterBand_ );
+              
+              outRasterRef.setElement( col, line, value2 /
+                sElem1.realNumberValue_, 0 );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress_.Increment(), "Canceled by the user" );
+          }
+        }
+           
+        execStack.push( outElement );
+      }       
+      else
+      {
+        TEAGN_LOG_AND_RETURN( "Invalid operation" );
+      }
+    }
+    else
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid operator" );
+    }
+  }
+  
+  return true;
+}
+
+bool TePDIArithmetic::execUnaryOperator( const std::string& , 
+  ExecStackT& , bool ) const
+{
+  return false;
+}
+
+bool TePDIArithmetic::isRealNumberToken( const std::string& token,
+  double& realValue ) const
+{
+  if( token.size() == 0 ) return false;
+  bool hasDot = false;
+  
+  for( unsigned int tIdx = 0 ; tIdx < token.size() ; ++tIdx )
+  {
+    if( token[ tIdx ] == '.' )
+    {
+      if( hasDot ) return false;
+      hasDot = true;
+    }
+    else if( ! isdigit( token[ tIdx ] ) ) return false;
+  }
+  
+  realValue = atof( token.c_str() );
+  
+  return true;
+}
+
+bool TePDIArithmetic::allocResultRaster( unsigned int nLines, unsigned int nCols,
+  TePDITypes::TePDIRasterPtrType& rasterPtr ) const
+{
+  TeRasterParams pars;
+  pars.mode_ = 'c';
+  pars.setDataType( TeDOUBLE, -1 );
+  pars.setNLinesNColumns( nLines, nCols );
+  pars.decoderIdentifier_ = "SMARTMEM";
+
+  rasterPtr.reset( new TeRaster( pars ) );
+  if( rasterPtr->init() )
+  {
+    return true;
+  }
+  else
+  {
+    rasterPtr.reset();
+    return false;
+  }
+}
+
+void TePDIArithmetic::getTokensStrs( const std::string& inputStr, 
+  std::vector< std::string >& outTokens ) const
+{
+  outTokens.clear();
+  
+  const unsigned int inputStrSize = (unsigned int)inputStr.size();
+  std::string bufferStr;
+  
+  for( unsigned int inputStrIdx = 0 ; inputStrIdx < inputStrSize ;
+    ++inputStrIdx )
+  {
+    if( inputStr[ inputStrIdx ] == ' ' )
+    {
+      if( bufferStr.size() )
+      {
+        outTokens.push_back( bufferStr );
+        bufferStr.clear();
+      }
+    }
+    else if( ( inputStr[ inputStrIdx ] == ')' ) ||
+      ( inputStr[ inputStrIdx ] == '(' ) ||
+      isOperator( inputStr.substr( inputStrIdx, 1 ) ) )
+    {
+      if( bufferStr.size() )
+      {
+        outTokens.push_back( bufferStr );
+        bufferStr.clear();
+      }
+      
+      outTokens.push_back( inputStr.substr( inputStrIdx, 1 ) );
+    }    
+    else
+    {
+      bufferStr.append( inputStr.substr( inputStrIdx, 1 ) );
+    }
+  }
+  
+  if( bufferStr.size() )
+  {
+    outTokens.push_back( bufferStr );
+  }  
+}
diff --git a/src/terralib/image_processing/TePDIArithmetic.hpp b/src/terralib/image_processing/TePDIArithmetic.hpp
old mode 100755
new mode 100644
index 1621953..ff0c62f
--- a/src/terralib/image_processing/TePDIArithmetic.hpp
+++ b/src/terralib/image_processing/TePDIArithmetic.hpp
@@ -1,184 +1,241 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIARITHMETIC_HPP
-  #define TEPDIARITHMETIC_HPP
-
-  #include "TePDILevelRemap.hpp"
-  #include "TePDIParameters.hpp"
-  #include "TePDITypes.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief  This is the base class for level remapping algorithms.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   *
-   * @note The general required parameters are:
-   *
-   * @param arithmetic_type ( TePDIArithmetic::TePDIArithmeticType) - 
-   * Arithmetic type.
-   * @param input_image1 (TePDITypes::TePDIRasterPtrType).
-   * @param input_image2 (TePDITypes::TePDIRasterPtrType) - Not used by 
-   * TePDIAType1.
-   * @param img1_chan (int) - Band to process for image 1.
-   * @param img2_chan (int) - Band to process for image 2 - Not used by 
-   * TePDIAType1.
-   * @param gain ( double ).
-   * @param offset ( double ).
-   * @param output_image (TePDITypes::TePDIRasterPtrType).
-   *
-   * @note The following paramters are optional and will be used if present.
-   *
-   * @param normalize_output ( int = 1 ) - If present ( and with value 1 )
-   * output level normalization will be activated.
-   *
-   * @ingroup TePDIGeneralAlgoGroup
-   */
-  class PDI_DLL TePDIArithmetic : public TePDILevelRemap {
-    public :
-
-      /**
-       * @enum TePDIArithmeticType Arithmetic Types.
-       */       
-      enum TePDIArithmeticType{
-        /** @brief Gain * A + Offset */
-        TePDIAType1 = 1,
-        /** @brief Gain * ( A - B ) + Offset */
-        TePDIAType2 = 2,
-        /** @brief Gain * ( A + B ) + Offset */
-        TePDIAType3 = 3,
-        /** @brief Gain * ( A / B ) + Offset */
-        TePDIAType4 = 4,
-        /** @brief ( Gain * ( A - B ) / ( A + B ) ) + Offset */
-        TePDIAType5 = 5
-      };
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIArithmetic();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIArithmetic();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-
-      /**
-       * @brief Optmized binding function.
-       *
-       * @param level Input pixel level.
-       * @param gain Input gain.
-       * @param offset Input offset.
-       * @return Resultant value.
-       */      
-      inline static double type1_arith( double level, double gain, 
-        double offset ) { return ( gain * level ) + offset; };
-
-      /**
-       * @brief Optmized binding function.
-       *
-       * @param level1 Input pixel level 1.
-       * @param level2 Input pixel level 2.
-       * @param gain Input gain.
-       * @param offset Input offset.
-       * @return Resultant value.
-       */      
-      inline static double type2_arith( double level1, double level2, 
-        double gain,  double offset )
-        { return ( gain * ( level1 - level2 ) ) + offset; };
-
-      /**
-       * @brief Optmized binding function.
-       *
-       * @param level1 Input pixel level 1.
-       * @param level2 Input pixel level 2.
-       * @param gain Input gain.
-       * @param offset Input offset.
-       * @return Resultant value.
-       */      
-      inline static double type3_arith( double level1, double level2, 
-        double gain, double offset )
-        { return ( gain * ( level1 + level2 ) ) + offset; };
-
-      /**
-       * @brief Optmized binding function.
-       *
-       * @param level1 Input pixel level 1.
-       * @param level2 Input pixel level 2.
-       * @param gain Input gain.
-       * @param offset Input offset.
-       * @return Resultant value.
-       */      
-      inline static double type4_arith( double level1, double level2, 
-        double gain, double offset )
-        { return ( gain * ( level1 / level2 ) ) + offset; };
-
-      /**
-       * @brief Optmized binding function.
-       *
-       * @param level1 Input pixel level 1.
-       * @param level2 Input pixel level 2.
-       * @param gain Input gain.
-       * @param offset Input offset.
-       * @return Resultant value.
-       */      
-      inline static double type5_arith( double level1, double level2, 
-        double gain, double offset )
-        { return ( gain * ( level1 - level2 ) / ( level1 + level2 ) ) + 
-        offset; };
-
-  };
-
-/** @example TePDIArithmetic_test.cpp
- *    Shows how to use this class.
- */  
-  
-#endif //TEPDIARITHMETIC_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIARITHMETIC_HPP
+  #define TEPDIARITHMETIC_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  
+  #include <vector>
+  #include <string>
+
+  /**
+   * @class TePDIArithmetic
+   * @brief  Performs arithmetic operation over raster data.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIGeneralAlgoGroup
+   *
+   * @note The general required parameters are:
+   *
+   * @param input_rasters ( TePDITypes::TePDIRasterVectorType ) - A vector of all used 
+   * rasters pointers ( NOTE: All rasters must have the same number of lines/columns ).   
+   * @param arithmetic_string ( std::string ) - Arithmetic string 
+   * to execute. It must be formed by a combination of the folowing elements:
+   * * Operators: +, -, *, /
+   * * Real Numbers
+   * * Raster bands: R0:1, R0:1, R1:0, .... (R0:1 is a reference to the first raster - with index 0 - from input_rasters, second band - with index 1).
+   * An example of an arithmetic string: "( R0:0 + 1.0 ) / R1:0".
+   * @param output_raster (TePDITypes::TePDIRasterPtrType) - The output
+   * raster pointer.
+   *
+   * @note The following parameters are optional:
+   * 
+   * @param normalize_output (int) - If present(with any value) an output
+   * values normalization will be performed to fit the allowed values range 
+   * dictated by the output_raster data type (default:no normalization performed).
+   *
+   * @note The input raster with index 0 will be used as reference for
+   * projection, number of lines, number of columns and pixel resolution.
+   *
+   * @example TePDIArithmetic_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIArithmetic : public TePDIAlgorithm 
+  {
+    public :
+
+      TePDIArithmetic();
+
+      ~TePDIArithmetic();
+
+      //overloaded
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+    
+      /**
+      * @class ExecStackElement
+      * @brief Execution stack element.
+      */    
+      class PDI_DLL ExecStackElement
+      {
+        public :
+        
+          /** true if this is a raster pointer element. */
+          bool isRaster_;
+          
+          /** true if this is a real number element. */
+          bool isRealNumber_;
+          
+          /** Real number value. */
+          double realNumberValue_;
+          
+          /** Raster band index. */
+          unsigned int rasterBand_;
+          
+          /** Raster pointer. */
+          TePDITypes::TePDIRasterPtrType rasterPtr_;
+        
+          ExecStackElement()
+          : isRaster_( false ), isRealNumber_( false ), realNumberValue_( 0 ),
+            rasterBand_( 0 )
+          {};
+          
+          ~ExecStackElement() {};
+        
+      };
+      
+      /** @typedef Execution stack type definition. */
+      typedef std::stack< ExecStackElement > ExecStackT;
+      
+      /** Internal progress manager instance. */
+      mutable TePDIPIManager progress_;
+      
+      //overloaded
+      bool RunImplementation();
+
+      //overloaded
+      void ResetState( const TePDIParameters& params );
+      
+      /**
+      * @brief Execute the automata parsing the given input string.
+      * @param aStr The input arithmetic expression string.
+      * @param inRasters Input rasters pointers.
+      * @param outRaster Output raster pointer (pre-initiated).
+      * @param generateOutput If true, the output raster data will be generated,
+      * if false only the automata execution will be performed..
+      */      
+      bool executeString( const std::string& aStr, 
+        const TePDITypes::TePDIRasterVectorType& inRasters,
+        TePDITypes::TePDIRasterPtrType& outRaster,
+        bool generateOutput ) const;
+        
+      /**
+      * @brief Convert the input tokens vector from the infix notation
+      * to postfix notation.
+      * @param input The input tokens vector.
+      * @param output The output tokens vector.
+      */         
+      void inFix2PostFix( const std::vector< std::string >& input, 
+        std::vector< std::string >& output ) const;
+        
+      /**
+      * @brief Print tokens to stout.
+      * @param input The input tokens vector.
+      */        
+      void printTokens( const std::vector< std::string >& input ) const;        
+        
+      /**
+      * @brief Returns true if the given token is an operator.
+      * @param inputToken Input token.
+      * @return Returns true if the given token is an operator.
+      */         
+      bool isOperator( const std::string& inputToken ) const;
+      
+      /**
+      * @brief Returns true if the given token is a binary operator.
+      * @param inputToken Input token.
+      * @return Returns true if the given token is a binary operator.
+      */               
+      bool isBinaryOperator( const std::string& inputToken ) const;
+      
+      /**
+      * @brief Returns true if the given token is a unary operator.
+      * @param inputToken Input token.
+      * @return Returns true if the given token is a unary operator.
+      */            
+      bool isUnaryOperator( const std::string& inputToken ) const;
+      
+      /**
+      * @brief Returns true if operator1 has greater of equal precedence
+      * over operator2.
+      * @param operator1 Operator1 input token.
+      * @param operator2 Operator2 input token.
+      * @return Returns true if operator1 has greater of equal precedence
+      * over operator2.
+      */      
+      bool op1HasGreaterOrEqualPrecedence( const std::string& operator1, 
+        const std::string& operator2 ) const;
+        
+      /**
+      * @brief Returns true if the given token is a raster data token.
+      * @param token Input token.
+      * @param rasterIdx The output converted raster index value.
+      * @param bandIdx The output converted band index value.
+      * @return Returns true if the given token is a raster data token.
+      */           
+      bool isRasterBandToken( const std::string& token, unsigned int& rasterIdx,
+        unsigned int& bandIdx ) const;
+      
+      /**
+      * @brief Execute the given binary operator using the current given
+      * execution stack.
+      * @param token Operator token.
+      * @param execStack Execution stack.
+      * @param generateOutput if true the execution will generate valid
+      * output data, if false only dummy stack elements will be generated.
+      * @return true if OK, false on errors..
+      */       
+      bool execBinaryOperator( const std::string& token, ExecStackT& 
+        execStack, bool generateOutput ) const;
+      
+      /**
+      * @brief Execute the given unary operator using the current given
+      * execution stack.
+      * @param token Operator token.
+      * @param execStack Execution stack.
+      * @param generateOutput if true the execution will generate valid
+      * output data, if false only dummy stack elements will be generated.
+      * @return true if OK, false on errors..
+      */         
+      bool execUnaryOperator( const std::string& token, ExecStackT& 
+        execStack, bool generateOutput ) const;
+        
+      /**
+      * @brief Returns true if the given token is a real number.
+      * @param token Input token.
+      * @param realValue The output converted value.
+      * @return Returns true if the given token is a real number.
+      */         
+      bool isRealNumberToken( const std::string& token, double& realValue ) const;
+      
+      /**
+      * @brief Allocate a new RAM memory raster.
+      * @param nLines Number of raster lines.
+      * @param nCols Number of raster columns.
+      * @param rasterPtr The output raster pointer.
+      * @return Returns true if OK, false on errors.
+      */        
+      bool allocResultRaster( unsigned int nLines, unsigned int nCols,
+        TePDITypes::TePDIRasterPtrType& rasterPtr ) const;
+        
+      /**
+      * @brief Split the input string into a vector of token strings
+      * @param inputStr The input string.
+      * @param outTokens The generated output tokens vector.
+      */         
+      void getTokensStrs( const std::string& inputStr,
+        std::vector< std::string >& outTokens ) const;
+  };
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIArithmeticFactory.cpp b/src/terralib/image_processing/TePDIArithmeticFactory.cpp
old mode 100755
new mode 100644
index d4736be..206d77a
--- a/src/terralib/image_processing/TePDIArithmeticFactory.cpp
+++ b/src/terralib/image_processing/TePDIArithmeticFactory.cpp
@@ -1,25 +1,25 @@
- 
-#include "TePDIArithmeticFactory.hpp"
-#include "TePDIArithmetic.hpp"
-#include <TeAgnostic.h>
-
-TePDIArithmeticFactory::TePDIArithmeticFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIArithmetic" ) )
-{
-};      
-
-TePDIArithmeticFactory::~TePDIArithmeticFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIArithmeticFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIArithmetic();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
-
+ 
+#include "TePDIArithmeticFactory.hpp"
+#include "TePDIArithmetic.hpp"
+#include <TeAgnostic.h>
+
+TePDIArithmeticFactory::TePDIArithmeticFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIArithmetic" ) )
+{
+};      
+
+TePDIArithmeticFactory::~TePDIArithmeticFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIArithmeticFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIArithmetic();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
+
diff --git a/src/terralib/image_processing/TePDIArithmeticFactory.hpp b/src/terralib/image_processing/TePDIArithmeticFactory.hpp
old mode 100755
new mode 100644
index aec16d0..285f5c9
--- a/src/terralib/image_processing/TePDIArithmeticFactory.hpp
+++ b/src/terralib/image_processing/TePDIArithmeticFactory.hpp
@@ -1,69 +1,69 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIARITHMETICFACTORY_HPP
-  #define TEPDIARITHMETICFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for arithmetic algorithms factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIArithmeticFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIArithmeticFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIArithmeticFactory();
-      
-    protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace
-  {  
-    static TePDIArithmeticFactory TePDIArithmeticFactory_instance;
-  };
-
-#endif
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIARITHMETICFACTORY_HPP
+  #define TEPDIARITHMETICFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for arithmetic algorithms factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIArithmeticFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIArithmeticFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIArithmeticFactory();
+      
+    protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace
+  {  
+    static TePDIArithmeticFactory TePDIArithmeticFactory_instance;
+  };
+
+#endif
+
diff --git a/src/terralib/image_processing/TePDIBDFilter.cpp b/src/terralib/image_processing/TePDIBDFilter.cpp
old mode 100755
new mode 100644
index 26de8d2..9a8882b
--- a/src/terralib/image_processing/TePDIBDFilter.cpp
+++ b/src/terralib/image_processing/TePDIBDFilter.cpp
@@ -1,454 +1,454 @@
-#include "TePDIBDFilter.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-
-#include "math.h"
-
-TePDIBDFilter::TePDIBDFilter()
-{
-}
-
-
-TePDIBDFilter::~TePDIBDFilter()
-{
-}
-
-
-bool TePDIBDFilter::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking for general required parameters */
-
-  TePDITypes::TePDIRasterPtrType inRaster;
-  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: input_image" );
-    return false;
-  }
-  if( ! inRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
-    return false;
-  }
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: output_image" );
-    return false;
-  }
-  if( ! outRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
-    return false;
-  }
-
-  /* Filter type checking */
-  TePDIBDType filter_type;
-  if( ! parameters.GetParameter( "filter_type", filter_type ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: filter_type" );
-    return false;
-  }
-  if( ( filter_type != TePDISobel ) &&
-      ( filter_type != TePDIRoberts ) ) {
-
-    TEAGN_LOGERR( "Invalid parameter: filter_type" );
-    return false;
-  }
-
-  /* channels parameter checking */
-
-  std::vector< int > channels;
-  if( ! parameters.GetParameter( "channels", channels ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: channels" );
-    return false;
-  }
-  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
-    if( channels[ index ] >= inRaster->nBands() ) {
-      TEAGN_LOGERR( "Invalid parameter: channels" );
-      return false;
-    }
-  }
-
-  /* Checking for number of iterations */
-  int iterations = 0;
-  if( ! parameters.GetParameter( "iterations", iterations ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: iterations" );
-    return false;
-  }
-  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
-
-  /* Checking photometric interpretation */
-  
-  for( unsigned int channel = 0 ; channel < channels.size() ; ++channel ) {
-    TEAGN_TRUE_OR_RETURN( ( 
-      ( inRaster->params().photometric_[ channel ] == 
-        TeRasterParams::TeRGB ) ||
-      ( inRaster->params().photometric_[ channel ] == 
-        TeRasterParams::TeMultiBand ) ),
-    "Invalid parameter - input_image (invalid photometric interpretation)" );
-  }
-    
-  return true;
-}
-
-
-bool TePDIBDFilter::RunImplementation()
-{
-  TePDIBDType filter_type;
-  params_.GetParameter( "filter_type", filter_type );
-
-  switch( filter_type ) {
-    case TePDISobel :
-    {
-      return RunSobel();
-    }
-    case TePDIRoberts :
-    {
-      return RunRoberts();
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_RETURN( "Invalid algorithm type" );
-    }
-  }
-}
-
-
-bool TePDIBDFilter::RunSobel()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-
-  /* Setting the output raster */
-
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );  
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ );  
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-  if( inRaster->params().useDummy_ ) {
-    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
-  } else {
-    outRaster_params.setDummy( 0, -1 );
-  }
-    
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );    
-    
-  /* Creating the temporary rasters */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster1, 
-    outRaster->params(), TePDIUtils::TePDIUtilsAutoMemPol ),
-    "Unable to create auxiliary raster 1" );
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;  
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster2, 
-    outRaster->params(), TePDIUtils::TePDIUtilsAutoMemPol ),
-    "Unable to create auxiliary raster 2" );
-    
-  /* Setting the convolution buffer initial state */
-
-  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  reset_conv_buf( 3, raster_columns );
-
-  /* Convolution Loop */
-
-  double output_level;
-  double vx, vy;
-
-  unsigned int conv_column_bound = raster_columns - 2;
-  unsigned int conv_line_bound = raster_lines - 2;
-
-  unsigned int raster_line;
-  unsigned int conv_buf_column;
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-
-  double channel_min_level;
-  double channel_max_level;
-  
-  StartProgInt( "Sobel filter", channels.size() * iterations *
-     conv_line_bound );
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-
-    TEAGN_TRUE_OR_THROW(
-      TePDIUtils::TeCopyRasterPixels( inRaster, channels[ channels_index ],
-      aux_raster1, 0, false, false ), "Auxiliar Raster fill error" );
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels[ channels_index ], channel_min_level,
-      channel_max_level ), "Unable to get raster channel level bounds" );
-
-    for( unsigned int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-      /* Switching from input and output raster for more than 1 iteration */
-
-      if( iteration % 2 == 0 ) {
-        source_raster = aux_raster1;
-        target_raster = aux_raster2;
-      } else {
-        source_raster = aux_raster2;
-        target_raster = aux_raster1;
-      }
-
-      /* Fills the convolution buffer with the first "mask_lines" from the raster */
-
-      for( unsigned int line = 0 ; line < 2 ; ++line ) {
-        up_conv_buf( source_raster, line, 0 );
-      }
-
-      /* raster convolution */
-
-      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-        
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
-          conv_line_bound ) + ( iteration * conv_line_bound ) + raster_line ),
-          "Canceled by the user" );
-
-        up_conv_buf( source_raster, raster_line + 2, 0 );
-
-        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
-             ++conv_buf_column ) {
-
-          vx = conv_buf_[ 2 ][ conv_buf_column ] +
-            ( 2 * conv_buf_[ 2 ][ conv_buf_column + 1 ] ) +
-            conv_buf_[ 2 ][ conv_buf_column + 2 ] -
-            conv_buf_[ 0 ][ conv_buf_column ] -
-            ( 2 * conv_buf_[ 0 ][ conv_buf_column + 1 ] ) -
-            conv_buf_[ 0 ][ conv_buf_column + 2 ];
-
-          vy = conv_buf_[ 0 ][ conv_buf_column + 2 ] +
-            ( 2 * conv_buf_[ 1 ][ conv_buf_column + 2 ] ) +
-            conv_buf_[ 2 ][ conv_buf_column + 2 ] -
-            conv_buf_[ 0 ][ conv_buf_column ] -
-            ( 2 * conv_buf_[ 1 ][ conv_buf_column ] ) -
-            conv_buf_[ 2 ][ conv_buf_column ];
-
-          output_level = sqrt( ( vx * vx ) + ( vy * vy ) );
-
-          /* Level range filtering */
-
-          if( output_level < channel_min_level ) {
-            output_level = channel_min_level;
-          } else if( output_level > channel_max_level ) {
-            output_level = channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            conv_buf_column + 1, raster_line +  1, output_level, 0 ),
-            "Pixel mapping error" );
-        }
-
-      }
-    }
-
-    /* Content copy from the target raster to the output raster */
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeCopyRasterPixels( target_raster, 0,
-      outRaster, channels_index, false, false ), "Output raster fill error" );
-  }
-
-  return true;
-}
-
-
-bool TePDIBDFilter::RunRoberts()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-
-  /* Setting the output raster */
-    
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ );
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );    
-  if( inRaster->params().useDummy_ ) {
-    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
-  } else {
-    outRaster_params.setDummy( 0, -1 );
-  }
-  
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );     
-    
-  /* Creating the temporary rasters */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster1, 
-    outRaster->params(), TePDIUtils::TePDIUtilsAutoMemPol ),
-    "Unable to create auxiliary raster 1" );
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;  
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster2, 
-    outRaster->params(), TePDIUtils::TePDIUtilsAutoMemPol ),
-    "Unable to create auxiliary raster 2" );    
-
-  /* Setting the convolution buffer initial state */
-
-  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  reset_conv_buf( 3, raster_columns );
-
-  /* Convolution Loop */
-
-  double output_level;
-  double diff1, diff2;
-
-  unsigned int conv_column_bound = raster_columns - 2;
-  unsigned int conv_line_bound = raster_lines - 2;
-
-  unsigned int raster_line;
-  unsigned int conv_buf_column;
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-  
-  StartProgInt( "Roberts filter", channels.size() * iterations *
-     conv_line_bound );  
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-
-    TEAGN_TRUE_OR_THROW(
-      TePDIUtils::TeCopyRasterPixels( inRaster, channels[ channels_index ],
-      aux_raster1, 0, false, false ), "Auxiliar Raster fill error" );
-
-    double channel_min_level;
-    double channel_max_level;
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels[ channels_index ], channel_min_level,
-      channel_max_level ), "Unable to get raster channel level bounds" );
-
-    for( unsigned int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-      /* Switching from input and output raster for more than 1 iteration */
-
-      if( iteration % 2 == 0 ) {
-        source_raster = aux_raster1;
-        target_raster = aux_raster2;
-      } else {
-        source_raster = aux_raster2;
-        target_raster = aux_raster1;
-      }
-
-      /* Fills the convolution buffer with the first "mask_lines" from the raster */
-
-      for( unsigned int line = 0 ; line < 2 ; ++line ) {
-        up_conv_buf( source_raster, line, 0 );
-      }
-
-      /* raster convolution */
-
-      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-        
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
-          conv_line_bound ) + ( iteration * conv_line_bound ) + raster_line ),
-          "Canceled by the user" );
-
-        up_conv_buf( source_raster, raster_line + 2, 0 );
-
-        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
-             ++conv_buf_column ) {
-
-          output_level = 0;
-
-          diff1 = conv_buf_[ 1 ][ conv_buf_column + 1 ] -
-            conv_buf_[ 2 ][ conv_buf_column + 2 ];
-
-          diff2 = conv_buf_[ 2 ][ conv_buf_column + 1 ] -
-            conv_buf_[ 1 ][ conv_buf_column + 2 ];
-
-          output_level = sqrt( ( diff1 * diff1 ) + ( diff2 * diff2 ) );
-
-          /* Level range filtering */
-
-          if( output_level < channel_min_level ) {
-            output_level = channel_min_level;
-          } else if( output_level > channel_max_level ) {
-            output_level = channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            conv_buf_column + 1, raster_line +  1, output_level, 0 ),
-            "Pixel mapping error" );
-        }
-      }
-    }
-
-    /* Content copy from the target raster to the output raster */
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeCopyRasterPixels( target_raster, 0,
-      outRaster, channels_index, false, false ), "Output raster fill error" );
-  }
-
-  return true;
-}
-
-
-void TePDIBDFilter::ResetState( const TePDIParameters& params )
-{
-  TePDIBufferedFilter::ResetState( params );
-}
-
-
+#include "TePDIBDFilter.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+
+#include "math.h"
+
+TePDIBDFilter::TePDIBDFilter()
+{
+}
+
+
+TePDIBDFilter::~TePDIBDFilter()
+{
+}
+
+
+bool TePDIBDFilter::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking for general required parameters */
+
+  TePDITypes::TePDIRasterPtrType inRaster;
+  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: input_image" );
+    return false;
+  }
+  if( ! inRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
+    return false;
+  }
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: output_image" );
+    return false;
+  }
+  if( ! outRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
+    return false;
+  }
+
+  /* Filter type checking */
+  TePDIBDType filter_type;
+  if( ! parameters.GetParameter( "filter_type", filter_type ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: filter_type" );
+    return false;
+  }
+  if( ( filter_type != TePDISobel ) &&
+      ( filter_type != TePDIRoberts ) ) {
+
+    TEAGN_LOGERR( "Invalid parameter: filter_type" );
+    return false;
+  }
+
+  /* channels parameter checking */
+
+  std::vector< int > channels;
+  if( ! parameters.GetParameter( "channels", channels ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: channels" );
+    return false;
+  }
+  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
+    if( channels[ index ] >= inRaster->nBands() ) {
+      TEAGN_LOGERR( "Invalid parameter: channels" );
+      return false;
+    }
+  }
+
+  /* Checking for number of iterations */
+  int iterations = 0;
+  if( ! parameters.GetParameter( "iterations", iterations ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: iterations" );
+    return false;
+  }
+  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
+
+  /* Checking photometric interpretation */
+  
+  for( unsigned int channel = 0 ; channel < channels.size() ; ++channel ) {
+    TEAGN_TRUE_OR_RETURN( ( 
+      ( inRaster->params().photometric_[ channel ] == 
+        TeRasterParams::TeRGB ) ||
+      ( inRaster->params().photometric_[ channel ] == 
+        TeRasterParams::TeMultiBand ) ),
+    "Invalid parameter - input_image (invalid photometric interpretation)" );
+  }
+    
+  return true;
+}
+
+
+bool TePDIBDFilter::RunImplementation()
+{
+  TePDIBDType filter_type;
+  params_.GetParameter( "filter_type", filter_type );
+
+  switch( filter_type ) {
+    case TePDISobel :
+    {
+      return RunSobel();
+    }
+    case TePDIRoberts :
+    {
+      return RunRoberts();
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid algorithm type" );
+    }
+  }
+}
+
+
+bool TePDIBDFilter::RunSobel()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+
+  /* Setting the output raster */
+
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );  
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+  if( inRaster->params().useDummy_ ) {
+    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
+  } else {
+    outRaster_params.setDummy( 0, -1 );
+  }
+    
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );    
+    
+  /* Creating the temporary rasters */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster1, 
+    outRaster->params(), TePDIUtils::TePDIUtilsAutoMemPol ),
+    "Unable to create auxiliary raster 1" );
+
+  TePDITypes::TePDIRasterPtrType aux_raster2;  
+  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster2, 
+    outRaster->params(), TePDIUtils::TePDIUtilsAutoMemPol ),
+    "Unable to create auxiliary raster 2" );
+    
+  /* Setting the convolution buffer initial state */
+
+  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( 3, raster_columns );
+
+  /* Convolution Loop */
+
+  double output_level;
+  double vx, vy;
+
+  unsigned int conv_column_bound = raster_columns - 2;
+  unsigned int conv_line_bound = raster_lines - 2;
+
+  unsigned int raster_line;
+  unsigned int conv_buf_column;
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+
+  double channel_min_level;
+  double channel_max_level;
+  
+  StartProgInt( "Sobel filter", channels.size() * iterations *
+     conv_line_bound );
+
+  for( unsigned int channels_index = 0 ;
+       channels_index < channels.size() ;
+       ++channels_index ) {
+
+    TEAGN_TRUE_OR_THROW(
+      TePDIUtils::TeCopyRasterPixels( inRaster, channels[ channels_index ],
+      aux_raster1, 0, false, false ), "Auxiliar Raster fill error" );
+
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+      aux_raster1, 0, channel_min_level,
+      channel_max_level ), "Unable to get raster channel level bounds" );
+
+    for( unsigned int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
+      /* Switching from input and output raster for more than 1 iteration */
+
+      if( iteration % 2 == 0 ) {
+        source_raster = aux_raster1;
+        target_raster = aux_raster2;
+      } else {
+        source_raster = aux_raster2;
+        target_raster = aux_raster1;
+      }
+
+      /* Fills the convolution buffer with the first "mask_lines" from the raster */
+
+      for( unsigned int line = 0 ; line < 2 ; ++line ) {
+        up_conv_buf( source_raster, line, 0 );
+      }
+
+      /* raster convolution */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) + ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+
+        up_conv_buf( source_raster, raster_line + 2, 0 );
+
+        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
+             ++conv_buf_column ) {
+
+          vx = conv_buf_[ 2 ][ conv_buf_column ] +
+            ( 2 * conv_buf_[ 2 ][ conv_buf_column + 1 ] ) +
+            conv_buf_[ 2 ][ conv_buf_column + 2 ] -
+            conv_buf_[ 0 ][ conv_buf_column ] -
+            ( 2 * conv_buf_[ 0 ][ conv_buf_column + 1 ] ) -
+            conv_buf_[ 0 ][ conv_buf_column + 2 ];
+
+          vy = conv_buf_[ 0 ][ conv_buf_column + 2 ] +
+            ( 2 * conv_buf_[ 1 ][ conv_buf_column + 2 ] ) +
+            conv_buf_[ 2 ][ conv_buf_column + 2 ] -
+            conv_buf_[ 0 ][ conv_buf_column ] -
+            ( 2 * conv_buf_[ 1 ][ conv_buf_column ] ) -
+            conv_buf_[ 2 ][ conv_buf_column ];
+
+          output_level = sqrt( ( vx * vx ) + ( vy * vy ) );
+
+          /* Level range filtering */
+
+          if( output_level < channel_min_level ) {
+            output_level = channel_min_level;
+          } else if( output_level > channel_max_level ) {
+            output_level = channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            conv_buf_column + 1, raster_line +  1, output_level, 0 ),
+            "Pixel mapping error" );
+        }
+
+      }
+    }
+
+    /* Content copy from the target raster to the output raster */
+
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeCopyRasterPixels( target_raster, 0,
+      outRaster, channels_index, false, false ), "Output raster fill error" );
+  }
+
+  return true;
+}
+
+
+bool TePDIBDFilter::RunRoberts()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+
+  /* Setting the output raster */
+    
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );    
+  if( inRaster->params().useDummy_ ) {
+    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
+  } else {
+    outRaster_params.setDummy( 0, -1 );
+  }
+  
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );     
+    
+  /* Creating the temporary rasters */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster1, 
+    outRaster->params(), TePDIUtils::TePDIUtilsAutoMemPol ),
+    "Unable to create auxiliary raster 1" );
+
+  TePDITypes::TePDIRasterPtrType aux_raster2;  
+  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster2, 
+    outRaster->params(), TePDIUtils::TePDIUtilsAutoMemPol ),
+    "Unable to create auxiliary raster 2" );    
+
+  /* Setting the convolution buffer initial state */
+
+  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( 3, raster_columns );
+
+  /* Convolution Loop */
+
+  double output_level;
+  double diff1, diff2;
+
+  unsigned int conv_column_bound = raster_columns - 2;
+  unsigned int conv_line_bound = raster_lines - 2;
+
+  unsigned int raster_line;
+  unsigned int conv_buf_column;
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+  
+  StartProgInt( "Roberts filter", channels.size() * iterations *
+     conv_line_bound );  
+
+  for( unsigned int channels_index = 0 ;
+       channels_index < channels.size() ;
+       ++channels_index ) {
+
+    TEAGN_TRUE_OR_THROW(
+      TePDIUtils::TeCopyRasterPixels( inRaster, channels[ channels_index ],
+      aux_raster1, 0, false, false ), "Auxiliar Raster fill error" );
+
+    double channel_min_level;
+    double channel_max_level;
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+      aux_raster1, 0, channel_min_level,
+      channel_max_level ), "Unable to get raster channel level bounds" );
+
+    for( unsigned int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
+      /* Switching from input and output raster for more than 1 iteration */
+
+      if( iteration % 2 == 0 ) {
+        source_raster = aux_raster1;
+        target_raster = aux_raster2;
+      } else {
+        source_raster = aux_raster2;
+        target_raster = aux_raster1;
+      }
+
+      /* Fills the convolution buffer with the first "mask_lines" from the raster */
+
+      for( unsigned int line = 0 ; line < 2 ; ++line ) {
+        up_conv_buf( source_raster, line, 0 );
+      }
+
+      /* raster convolution */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) + ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+
+        up_conv_buf( source_raster, raster_line + 2, 0 );
+
+        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
+             ++conv_buf_column ) {
+
+          output_level = 0;
+
+          diff1 = conv_buf_[ 1 ][ conv_buf_column + 1 ] -
+            conv_buf_[ 2 ][ conv_buf_column + 2 ];
+
+          diff2 = conv_buf_[ 2 ][ conv_buf_column + 1 ] -
+            conv_buf_[ 1 ][ conv_buf_column + 2 ];
+
+          output_level = sqrt( ( diff1 * diff1 ) + ( diff2 * diff2 ) );
+
+          /* Level range filtering */
+
+          if( output_level < channel_min_level ) {
+            output_level = channel_min_level;
+          } else if( output_level > channel_max_level ) {
+            output_level = channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            conv_buf_column + 1, raster_line +  1, output_level, 0 ),
+            "Pixel mapping error" );
+        }
+      }
+    }
+
+    /* Content copy from the target raster to the output raster */
+
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeCopyRasterPixels( target_raster, 0,
+      outRaster, channels_index, false, false ), "Output raster fill error" );
+  }
+
+  return true;
+}
+
+
+void TePDIBDFilter::ResetState( const TePDIParameters& params )
+{
+  TePDIBufferedFilter::ResetState( params );
+}
+
+
diff --git a/src/terralib/image_processing/TePDIBDFilter.hpp b/src/terralib/image_processing/TePDIBDFilter.hpp
old mode 100755
new mode 100644
index d682d39..fcae03f
--- a/src/terralib/image_processing/TePDIBDFilter.hpp
+++ b/src/terralib/image_processing/TePDIBDFilter.hpp
@@ -1,116 +1,116 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIBDFILTER_HPP
-  #define TEPDIBDFILTER_HPP
-
-  #include "TePDIBufferedFilter.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for border detection filter.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   *
-   * @note The general required parameters are:
-   *
-   * @param filter_type ( TePDIBDType ) - Edge detection type.
-   * @param input_image (TePDITypes::TePDIRasterPtrType) - Input image.
-   * @param output_image (TePDITypes::TePDIRasterPtrType) - Output image.
-   * @param channels (std::vector<int>) - Band(s) to process. For
-   * @param iterations (int) - Iterations number.
-   *
-   * @ingroup TePDIFiltersGroup
-   */
-  class PDI_DLL TePDIBDFilter : public TePDIBufferedFilter{
-    public :
-
-      /**
-       * @brief Edge detection types.
-       */  
-      enum TePDIBDType{
-        /** Sobel edge detector */
-        TePDISobel = 1,
-        /** Roberts edge detector */
-        TePDIRoberts = 2
-      };
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIBDFilter();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIBDFilter();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-
-      /**
-       * @brief Runs the Sobel algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunSobel();
-
-      /**
-       * @brief Runs the Roberts algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunRoberts();
-  };
-  
-/** @example TePDIBDFilter_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDIBDFILTER_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIBDFILTER_HPP
+  #define TEPDIBDFILTER_HPP
+
+  #include "TePDIBufferedFilter.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the class for border detection filter.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   *
+   * @note The general required parameters are:
+   *
+   * @param filter_type ( TePDIBDType ) - Edge detection type.
+   * @param input_image (TePDITypes::TePDIRasterPtrType) - Input image.
+   * @param output_image (TePDITypes::TePDIRasterPtrType) - Output image.
+   * @param channels (std::vector<int>) - Band(s) to process. For
+   * @param iterations (int) - Iterations number.
+   *
+   * @ingroup TePDIFiltersGroup
+   */
+  class PDI_DLL TePDIBDFilter : public TePDIBufferedFilter{
+    public :
+
+      /**
+       * @brief Edge detection types.
+       */  
+      enum TePDIBDType{
+        /** Sobel edge detector */
+        TePDISobel = 1,
+        /** Roberts edge detector */
+        TePDIRoberts = 2
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIBDFilter();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIBDFilter();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+
+      /**
+       * @brief Runs the Sobel algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunSobel();
+
+      /**
+       * @brief Runs the Roberts algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunRoberts();
+  };
+  
+/** @example TePDIBDFilter_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDIBDFILTER_HPP
diff --git a/src/terralib/image_processing/TePDIBDFilterFactory.cpp b/src/terralib/image_processing/TePDIBDFilterFactory.cpp
old mode 100755
new mode 100644
index 5c83fa8..fa0b524
--- a/src/terralib/image_processing/TePDIBDFilterFactory.cpp
+++ b/src/terralib/image_processing/TePDIBDFilterFactory.cpp
@@ -1,24 +1,24 @@
- 
-#include "TePDIBDFilterFactory.hpp"
-#include "TePDIBDFilter.hpp"
-#include <TeAgnostic.h>
-
-TePDIBDFilterFactory::TePDIBDFilterFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIBDFilter" ) )
-{
-};      
-
-TePDIBDFilterFactory::~TePDIBDFilterFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIBDFilterFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIBDFilter();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIBDFilterFactory.hpp"
+#include "TePDIBDFilter.hpp"
+#include <TeAgnostic.h>
+
+TePDIBDFilterFactory::TePDIBDFilterFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIBDFilter" ) )
+{
+};      
+
+TePDIBDFilterFactory::~TePDIBDFilterFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIBDFilterFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIBDFilter();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIBDFilterFactory.hpp b/src/terralib/image_processing/TePDIBDFilterFactory.hpp
old mode 100755
new mode 100644
index e9cd9ee..314e7ec
--- a/src/terralib/image_processing/TePDIBDFilterFactory.hpp
+++ b/src/terralib/image_processing/TePDIBDFilterFactory.hpp
@@ -1,67 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIBDFILTERFACTORY_HPP
-  #define TEPDIBDFILTERFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for border detection algorithms factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIBDFilterFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIBDFilterFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIBDFilterFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIBDFilterFactory TePDIBDFilterFactory_instance;
-  };  
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIBDFILTERFACTORY_HPP
+  #define TEPDIBDFILTERFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for border detection algorithms factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIBDFilterFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIBDFilterFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIBDFilterFactory();
+      
+      protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace {
+    static TePDIBDFilterFactory TePDIBDFilterFactory_instance;
+  };  
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIBaatz.cpp b/src/terralib/image_processing/TePDIBaatz.cpp
index 9d7539c..fe1f18e 100644
--- a/src/terralib/image_processing/TePDIBaatz.cpp
+++ b/src/terralib/image_processing/TePDIBaatz.cpp
@@ -1,1373 +1,1462 @@
-#define MAX_FLT 3.4e38 /* maximum float value */
-
-// Internal includes
-#include <cstdlib>
-#include <iostream>
-#include <iomanip>
-#include <fstream>
-#include <time.h>
-#include <math.h>
-
-// TerraLib includes
-#include "TePDIBaatz.hpp"
-#include "TePDIRaster2Vector.hpp"
-#include "TePDIUtils.hpp"
-
-using namespace std;
-
-/**********************************************************************************/
-/* TerraLib main implementation for Baatz Segmentation                            */
-/**********************************************************************************/
-
-TePDIBaatz::TePDIBaatz()
-{
-}
-
-bool TePDIBaatz::CheckParameters( const TePDIParameters& parameters ) const
-{
-	// checking input_image
-    TePDITypes::TePDIRasterPtrType input_image;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "input_image", input_image ),
-		"Missing parameter: input_image");
-	TEAGN_TRUE_OR_RETURN(input_image.isActive(),
-		"Invalid parameter: input_image inactive");
-	TEAGN_TRUE_OR_RETURN(input_image->params().status_ != TeRasterParams::TeNotReady ,
-		"Invalid parameter: input_image not ready");
-	vector<float> input_weights;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "input_weights", input_weights ),
-    "Missing parameter: input_weights");
-  TEAGN_TRUE_OR_RETURN(input_weights.size() <= (unsigned) input_image->params().nBands() && input_weights.size() > 0,
-    "Input weights different from number of bands");
-  vector<unsigned> input_bands;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "input_bands", input_bands ),
-    "Missing parameter: input_bands");
-  TEAGN_TRUE_OR_RETURN(input_bands.size() == input_weights.size(),
-    "Input bands with different size from input weights");
-  
-	// checking output_image
-    TePDITypes::TePDIRasterPtrType output_image;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "output_image", output_image ),
-		"Missing parameter: output_image");
-
-	// checking thresholds
-	float scale;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "scale", scale ),
-		"Missing parameter: scale");
-	TEAGN_TRUE_OR_RETURN(scale > 0,
-		"Parameter scale is > 0");
-	float compactness;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "compactness", compactness ),
-		"Missing parameter: compactness");
-	TEAGN_TRUE_OR_RETURN(compactness > 0 && compactness <= 1,
-		"Parameter compactness is > 0 and <= 1");
-	float color;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "color", color ),
-		"Missing parameter: color");
-	TEAGN_TRUE_OR_RETURN(color > 0 && color <= 1,
-		"Parameter color is > 0 and <= 1");
-
-	return true;
-}
-
-void TePDIBaatz::ResetState( const TePDIParameters& )
-{
-}
-     
-bool TePDIBaatz::RunImplementation()
-{
-    TePDITypes::TePDIRasterPtrType input_image;
-	params_.GetParameter( "input_image", input_image );
-
-  vector<float> input_weights;
-  params_.GetParameter( "input_weights", input_weights );
-
-  vector<unsigned> input_bands;
-  params_.GetParameter( "input_bands", input_bands );
-
-	/* retrieve input_image parameters */
-	int H = input_image->params().nlines_,
-		W = input_image->params().ncols_,
-		B = input_bands.size();
-
-	/* retrieve algorithm parameters */
-	float scale;
-	params_.GetParameter( "scale", scale );
-	float compactness;
-	params_.GetParameter( "compactness", compactness );
-	float color;
-	params_.GetParameter( "color", color );
-
-  struct segment **segments_ptr_vector = NULL;
-  struct segment *initial_segment = NULL;
-  struct segment *final_segment = NULL;
-  struct segmentation_parameters seg_parameters;
-
-	seg_parameters.sp = scale;
-	seg_parameters.wcmpt = compactness;
-	seg_parameters.wcolor = color;
-	seg_parameters.bands = B;
-	for (int i = 0; i < B; i++)
-		seg_parameters.wband[i] = input_weights[i];
-
-	/* run segmentation */
-/*
-	initialize_segments(&segments_ptr_vector, 
-		&initial_segment, &final_segment, input_image, H, W, progress_enabled_);
-	segmentation(segments_ptr_vector, 
-		initial_segment, final_segment, H, W, seg_parameters, progress_enabled_);
-*/
-/*
-	float **float_input_image = (float **) malloc( B * sizeof(float) );
-	for (int i = 0; i < B; i++)
-		float_input_image[i] = (float *) malloc( H * W * sizeof(float) );
-
-	int p = 0;
-	cout << "H: " << H << " W: " << W << " B: " << B << endl;
-	for (int i = 0; i < H; i++)
-		for (int j = 0; j < W; j++)
-		{
-			for (int k = 0; k < B; k++)
-			{
-				double pixel;
-				input_image->getElement(j, i, pixel, k);
-				float_input_image[k][p] = (float) pixel;
-			}
-			p++;
-		}
-*/
-	initialize_segments(&segments_ptr_vector, 
-		&initial_segment, &final_segment, input_image, input_bands, H, W, progress_enabled_);
-	segmentation(segments_ptr_vector, 
-		initial_segment, final_segment, H, W, seg_parameters, progress_enabled_);
-
-	/* write results */
-	TePDITypes::TePDIRasterPtrType output_image;
-	params_.GetParameter( "output_image", output_image );
-	TeRasterParams output_image_params = output_image->params();
-	output_image_params.nBands( 1 );
-	output_image_params.setDataType( TeUNSIGNEDLONG );
-	output_image_params.setNLinesNColumns( H, W );
-	output_image->init(output_image_params);
-	write_segments(output_image, initial_segment, 0, progress_enabled_); 
-/*
-	p = 0;
-	for (int i = 0; i < H; i++)
-		for (int j = 0; j < W; j++)
-		{
-			double pixel = (double) float_input_image[0][p++];
-			output_image->setElement(j, i, pixel);
-		}
-*/
-
-	/* generate output polygonset */
-	TePDITypes::TePDIPolSetMapPtrType output_polsets( 
-		new TePDITypes::TePDIPolSetMapType );
-	params_.GetParameter( "output_polsets", output_polsets );
-
-	TePDIParameters params_output;
-	params_output.SetParameter( "rotulated_image", output_image );
-	params_output.SetParameter( "channel", (unsigned int) 0 );
-	params_output.SetParameter( "output_polsets", output_polsets );
-
-	TePDIRaster2Vector raster2Vector;  
-
-	TEAGN_TRUE_OR_THROW( raster2Vector.Reset(params_output),
-		"Invalid Parameters for raster2Vector" );
-
-	TEAGN_TRUE_OR_THROW( raster2Vector.Apply(), 
-		"Apply error" );
-  
-  return true;
-}
-
-/**********************************************************************************/
-/* Internal main implementation for Baatz Segmentation                            */
-/**********************************************************************************/
-
-/* remove segment from list and conects segment list neighbours */
-void remove_segment(struct segment *aux_segment, 
-          struct segment **first_segment, 
-          struct segment **last_segment);
-
-/* merge neighbor with current_segment and removes neighbor segment */
-int merge_segment(struct segment_neighbor *curr_neighbor, 
-          struct segment *curr_segment, 
-          struct segment **first_segment, 
-          struct segment **last_segment,
-          struct segment **segments_ptr_vector, 
-          long int nrows, 
-          long int ncols); 
-
-/* identifies borderline pixels and change segment_matrix */
-void reset_pixels(struct segment_neighbor *curr_neighbor, 
-          struct segment *curr_segment, 
-          struct segment **segments_ptr_vector, 
-          long int nrows, 
-          long int ncols);
- 
-/* creates list of segment's image neighbours */
-struct segment_neighbor* find_neighbors(struct segment *curr_segment, 
-                    struct segment **segments_ptr_vector, 
-                    long int nrows, 
-                    long int ncols); 
-
-/* finds the 4 neighbors of a pixel */
-void find_neighbor_pixels(unsigned long int pixel_id, 
-              long int nrows, 
-              long int ncols, 
-              long int *n0, 
-              long int *n1, 
-              long int *n2, 
-              long int *n3);
- 
-/* frees list of segment's neighbors from memory */
-void free_neighbor_list(struct segment_neighbor **first_neighbor); 
-
-/* calcs mean and stddev of merging of curr_segment and curr_neighbor */
-float calc_color_stats (struct segment_neighbor *curr_neighbor, 
-            struct segment *curr_segment, 
-            // float **input_image, 
-            struct segmentation_parameters parameters);
- 
-/* calcs spatial heterogeneity of merging of curr_segment and curr_neighbor */
-float calc_spatial_stats(struct segment_neighbor *curr_neighbor, 
-             struct segment *curr_segment, 
-             struct segment *segments_ptr_vector, 
-             long int nrows, 
-             long int ncols, 
-             struct segmentation_parameters parameters);
- 
-/* calcs perimeter of merging of curr_segment and curr_neighbor */
-void calc_perimeter(struct segment_neighbor *curr_neighbor, 
-          struct segment *curr_segment, 
-          struct segment **segments_ptr_vector, 
-          long int nrows, 
-          long int ncols); 
-
-/* calcs bounding box of merging of curr_segment and curr_neighbor */
-void calc_bounding_box(struct segment_neighbor *curr_neighbor, 
-             struct segment *curr_segment); 
-
-/* mark all segments as unused */
-void reset_unused_segments_list(unsigned long int num_segments, 
-                 struct segment *first_segment); 
-
-/* search unused segment using a dither matrix */
-struct segment* find_unused_by_dither(struct segment **segments_ptr_vector, 
-                    int num_bits, 
-                    long int nrows, 
-                    long int ncols,
-                    unsigned long int *cell_count);
-
-/* finds col and row from a pixel id */
-void convert_pixel_id(unsigned long int pixel_id, 
-            long int ncols, 
-            long int *row, 
-            long int *col); 
-
-/**********************************************************************************/
-/* ranval: random number generator                                                */
-/**********************************************************************************/
-
-float ranval(float low, 
-       float high)
-{
-  float val;
-
-  val = (((float) rand())/RAND_MAX) * (high - low) + low;
-
-  return(val);
-}
-
-/**********************************************************************************/
-/* function dither_matrix_bits: calculate number of bits necessary to hold a      */
-/*                              coordinate subscript of dither (square) matrix    */
-/**********************************************************************************/
-unsigned long int dither_matrix_dimension(long int nrows,
-                      long int ncols,
-                      int *dither_bits)
-{
-  int num_bits;
-  unsigned long int max_dimension;
-  unsigned long int dither_dimension;
-  
-  if (nrows>ncols)
-    max_dimension=nrows*nrows;
-  else
-    max_dimension=ncols*ncols;
-
-  num_bits=0;
-  dither_dimension=1;
-
-  while (dither_dimension < max_dimension)
-  {
-    dither_dimension = dither_dimension*2;
-    num_bits++;
-  }
-
-  if (num_bits%2)
-  {
-    num_bits++;
-    dither_dimension = dither_dimension*2;
-  }
-
-  *dither_bits = num_bits;
-
-  return(dither_dimension);
-}
-
-/**********************************************************************************/
-/* function dither_matrix_conversion: converts an pixel index into a dither       */
-/*                                    matrix index                                */
-/**********************************************************************************/
-unsigned long int dither_matrix_conversion(int num_bits, 
-                       long int nrows, 
-                       long int ncols,
-                       unsigned long int *cell_count)
-{
-  long int row, col, irow, icol;
-  unsigned long int pixel_id;
-  unsigned long int aux_cell_count;
-  int i, j, k;
-  bool found;
-
-  aux_cell_count = *cell_count;
-  found = false;
-
-  while (!found) 
-  {
-    irow = icol = 0;
-    j = k = 1;
-    for (i=0;i<num_bits;i++)
-    {
-      if (i % 2)
-      {
-        icol = icol+(aux_cell_count&j)/k;
-      }
-      else
-      {
-        irow = irow+(aux_cell_count&j)/k;
-        k = k * 2;
-      }
-      j = j * 2;
-    }
-
-    row = col = 0;
-    j = 1;
-    for (i=0;i<(num_bits/2);i++)
-    {
-      k = k / 2;
-      if (irow & j) row = row+k;
-      if (icol & j) col = col+k;
-      j = j * 2;
-    }
-    
-    if ((col >= ncols)||(row >= nrows))
-    {
-      found = false;
-      aux_cell_count++;
-    }
-    else
-    {
-      pixel_id = (ncols*row)+col;
-      found = true;
-    }
-  }
-
-  *cell_count = aux_cell_count;
-  return(pixel_id);
-}
-
-/**********************************************************************************/
-/* function create_initial_segments: creates initial segment list                 */
-/**********************************************************************************/
-
-int initialize_segments(struct segment ***segments_ptr_vector, 
-            struct segment **first_segment, 
-            struct segment **last_segment, 
-            // float **input_image, 
-            TePDITypes::TePDIRasterPtrType input_image,
-            vector<unsigned> input_bands, 
-            long int nrows, 
-            long int ncols,
-            bool progress_enabled_)
-{
-  struct segment *aux_segment = 0;
-  struct segment *prev_segment;
-  struct segment_pixel *body_pixel;
-  unsigned long int id_pixel;
-  int row, col;
-  int allocate_memory, error;
-
-  error = 0;
-
-  /* allocate memory for segments matrix if it has not been created yet */
-  if (*segments_ptr_vector == NULL)
-  {
-  allocate_memory = true;
-  *segments_ptr_vector = (struct segment **) malloc(nrows*ncols * sizeof(struct segment *));
-  }
-  else
-  allocate_memory = false;
-
-  if(*segments_ptr_vector == NULL) error = 1;
-
-  row = 0;
-  col = 0;
-  id_pixel=0;
-  prev_segment = NULL;
-
-  TePDIPIManager pim("Initializing Data", nrows * ncols, progress_enabled_);
-  while ((id_pixel<(unsigned long)(nrows*ncols)) && (error!=1))
-  {
-
-  if (allocate_memory)
-  {
-      aux_segment = (struct segment*) malloc(sizeof(struct segment));
-    if(aux_segment == NULL) error = 1;
-    
-    body_pixel = (struct segment_pixel*) malloc(sizeof(struct segment_pixel));
-    if(body_pixel == NULL) error = 1;
-
-    aux_segment->next_original_segment = NULL;
-    aux_segment->original_pixel = body_pixel;
-  }
-  else
-  {
-    if (id_pixel==0)
-      aux_segment = *first_segment;
-    else
-      aux_segment = aux_segment->next_original_segment;
-    
-    body_pixel = aux_segment->original_pixel;
-  }
-
-  if (error!=1)
-  {
-    (*segments_ptr_vector)[id_pixel] = aux_segment;
-
-    aux_segment->id = id_pixel;
-    aux_segment->area = 1;
-    aux_segment->perimeter = 4;
-    aux_segment->b_box[0] = (float)row;
-    aux_segment->b_box[1] = (float)col;
-    aux_segment->b_box[2] = 1;
-    aux_segment->b_box[3] = 1;
-
-    for(unsigned b = 0; b < input_bands.size(); b++)
-    {
-      double pixel;
-      input_image->getElement(col, row, pixel, input_bands[b]);
-      aux_segment->avg_color[b] = (float) pixel;
-      aux_segment->std_color[b] = 0;
-      aux_segment->avg_color_square[b] = (float) (pixel * pixel);
-      aux_segment->color_sum[b] = (float) pixel;
-    }
-/*
-    for(int b = 0; b < NUM_BANDS; b++)
-    {
-      aux_segment->avg_color[b] = input_image[b][id_pixel];
-      aux_segment->std_color[b] = 0;
-      aux_segment->avg_color_square[b] = (float)(input_image[b][id_pixel])*(input_image[b][id_pixel]);
-      aux_segment->color_sum[b] = input_image[b][id_pixel];
-    }
-*/
-    aux_segment->used = false;
-
-    body_pixel->pixel_id = id_pixel;
-    body_pixel->borderline = true;
-    body_pixel->next_pixel = NULL;
-    aux_segment->pixel_list = body_pixel;
-    aux_segment->last_pixel = body_pixel;
-    
-    aux_segment->next_segment = NULL;
-    aux_segment->previous_segment = prev_segment;
-
-    if (prev_segment)
-    {
-      prev_segment->next_segment = aux_segment;
-      prev_segment->next_original_segment = aux_segment;
-
-      *last_segment = aux_segment;
-    }
-    else
-    {
-      *first_segment = aux_segment;
-    }
-
-    prev_segment = aux_segment;
-    
-    col++;
-    if (col==ncols)
-    {
-      col = 0;
-      row++;
-    }
-    
-      id_pixel++;
-    pim.Increment();
-  }
-  }
-  pim.Toggle(false);
-  if(error)
-  {
-    /* out of memory space */
-    return(1);
-  }
-  return(0);
-}
-
-/**********************************************************************************/
-/* function find_unused_by_dither : finds segment using dither matrix             */
-/**********************************************************************************/
-
-struct segment* find_unused_by_dither(struct segment **segments_ptr_vector, 
-                    int num_bits, 
-                    long int nrows, 
-                    long int ncols,
-                    unsigned long int *cell_count)
-
-{
-  struct segment *aux_segment;
-  unsigned long int pixel_id;
-  bool found;
-
-  found = false;
-
-  while (!found)
-  {
-  pixel_id=dither_matrix_conversion(num_bits, nrows, ncols, cell_count);
-  aux_segment = segments_ptr_vector[pixel_id];
-
-    if (aux_segment->used)
-    *cell_count=*cell_count+1;
-  else
-    found = true;
-  }
-  
-  return(aux_segment);
-}
-
-/**********************************************************************************/
-/* function convert_pixel_id: finds col and row from pixel id                     */
-/**********************************************************************************/
-
-void convert_pixel_id(unsigned long int pixel_id, 
-            long int ncols, 
-            long int *row, 
-            long int *col)
-{
-  *row = (long)floor((double)pixel_id / (double)ncols);
-  *col = pixel_id % ncols;
-}
-
-/**********************************************************************************/
-/* function free_neighbor_list: frees list of segment's neighbors from memory     */
-/**********************************************************************************/
-
-void free_neighbor_list(struct segment_neighbor **first_neighbor)
-{
-  struct segment_neighbor *aux_neighbor;
-  
-  while (*first_neighbor!=NULL)
-  {
-    aux_neighbor = (*first_neighbor)->next_neighbor;
-    free(*first_neighbor);
-    *first_neighbor = aux_neighbor;
-  }
-}
-
-/**********************************************************************************/
-/* function find_neighbors: creates list of segment's image neighbors             */
-/**********************************************************************************/
-
-struct segment_neighbor* find_neighbors(struct segment *curr_segment, 
-                    struct segment **segments_ptr_vector, 
-                    long int nrows, long int ncols)
-{
-  int i, not_in_neighbors_list;
-  long int neighbor_pixel[4][2]; /* first col contain pixel id, second contains segment id */
-  struct segment_neighbor *first_neighbor;
-  struct segment_neighbor *aux_neighbor;
-  struct segment_neighbor *new_neighbor;
-  struct segment_pixel *aux_pixel;
-  struct segment *aux_segment;
-   
-  aux_pixel = curr_segment->pixel_list;
-  first_neighbor = NULL;
-
-  /* for each outline pixel */
-  while (aux_pixel!=NULL)
-  {
-    if (aux_pixel->borderline==true)
-    {
-      find_neighbor_pixels(aux_pixel->pixel_id, nrows, ncols, 
-      neighbor_pixel[0], neighbor_pixel[1], neighbor_pixel[2], neighbor_pixel[3]);
-      /* finds segments to which pixel belongs to */
-      for (i=0;i<4;i++)
-      {
-        if (neighbor_pixel[i][0]!=-1)
-        {
-          aux_segment = segments_ptr_vector[neighbor_pixel[i][0]];
-          neighbor_pixel[i][1] = aux_segment->id;
-
-          if (neighbor_pixel[i][1] == (int) curr_segment->id)
-            neighbor_pixel[i][1]=-1;
-        }
-        else
-        {
-          neighbor_pixel[i][1]=-1;
-        }
-        /* if pixel segment is not yet in the list of segment neighbors, includes it */
-        if (neighbor_pixel[i][1]>-1)
-        {
-          not_in_neighbors_list = true;
-          aux_neighbor = first_neighbor;
-          while ((aux_neighbor!=NULL)&&(not_in_neighbors_list))
-          {
-            if (aux_neighbor->neighbor_id == (unsigned) neighbor_pixel[i][1])
-            {
-              not_in_neighbors_list = false;
-            }
-            else
-            {
-              aux_neighbor = aux_neighbor->next_neighbor;
-            }
-          }
-          if (not_in_neighbors_list)
-          {
-            new_neighbor = (struct segment_neighbor*) malloc(sizeof(struct segment_neighbor));
-            new_neighbor->neighbor_id = neighbor_pixel[i][1];
-            new_neighbor->neighbor = segments_ptr_vector[neighbor_pixel[i][1]];
-
-            if (first_neighbor==NULL)
-            {
-              new_neighbor->next_neighbor = NULL;
-            }
-            else
-            {
-              new_neighbor->next_neighbor = first_neighbor;
-            }
-            first_neighbor = new_neighbor;
-          }
-        }
-      }
-    }
-    aux_pixel = aux_pixel->next_pixel;
-  }
-  return (first_neighbor);
-}
-
-/**********************************************************************************/
-/* function find_neighbor_pixels: returns the ids of the (4) neighbors of a pixel */
-/**********************************************************************************/
-
-void find_neighbor_pixels(unsigned long int pixel_id, 
-              long int nrows, 
-              long int ncols, 
-              long int *n0, 
-              long int *n1, 
-              long int *n2, 
-              long int *n3)
-{
-  long int row, col;
-
-  convert_pixel_id(pixel_id, ncols, &row, &col);
-
-  *n0 = *n1 = *n2 = *n3 = -1;
-  
-  if (row>0)         *n0=((row-1)*ncols) + col;      
-
-  if (col>0)         *n1=(row*ncols) + (col-1);
-
-  if (row<(nrows-1)) *n2=((row+1)*ncols) + col;
-
-  if (col<(ncols-1)) *n3=(row*ncols) + (col+1);
-}
-
-/**********************************************************************************/
-/* function calc_color_stats: calculate the mean color and the standard deviation */
-/*           of the merging of two segments and writes it to the current neighbor */
-/**********************************************************************************/
-
-float calc_color_stats (struct segment_neighbor *curr_neighbor, 
-            struct segment *curr_segment, 
-            //float **input_image, 
-            struct segmentation_parameters parameters)
-{
-  float mean[NUM_BANDS], colorSum[NUM_BANDS];
-  float squarePixels[NUM_BANDS];
-  float stddev[NUM_BANDS];
-  float stddevNew[NUM_BANDS];
-  float sum_wband, wband_norm[NUM_BANDS];
-  float color_f[NUM_BANDS];
-  float color_h;
-  int b;
-  long int count;
-  count = 0;
-  float a_current, a_neighbor, a_sum;
-  struct segment *neighbor;
-
-  neighbor = curr_neighbor->neighbor;
-
-  a_current = curr_segment->area;
-  a_neighbor = neighbor->area;
-  a_sum = a_current+a_neighbor;
-  sum_wband = 0;
-
-  for (b = 0; b < parameters.bands; b++)
-  {
-    mean[b] = ((curr_segment->avg_color[b]*a_current)+(neighbor->avg_color[b]*a_neighbor))/a_sum;
-  squarePixels[b] = (curr_segment->avg_color_square[b])+(neighbor->avg_color_square[b]);
-  colorSum[b] = curr_segment->color_sum[b] + neighbor->color_sum[b];
-    stddev[b] = 0;
-  stddevNew[b] = 0;
-  sum_wband = sum_wband + parameters.wband[b];
-  }
-
-  for(b = 0; b < parameters.bands; b++)
-  {
-    stddevNew[b] = squarePixels[b] - 2*mean[b]*colorSum[b] + a_sum*mean[b]*mean[b];
-  }
-
-  /* stores stddev and mean in neighbor */
-  /* calculates color factor per band and total */
-  color_h = 0;
-  for (b = 0; b < parameters.bands; b++)
-  {
-    stddev[b] = sqrt(stddevNew[b]/a_sum);
-  wband_norm[b] = parameters.wband[b]; /* new implementation, bands already weighted */
-
-    color_f[b] = (a_current*curr_segment->std_color[b]) + 
-    (a_neighbor*neighbor->std_color[b]);
-    color_f[b] = wband_norm[b] * ((a_sum*stddev[b])-color_f[b]);
-    color_h = color_h + color_f[b];
-    
-    curr_neighbor->avg_color[b] = mean[b];
-    curr_neighbor->std_color[b] = stddev[b];
-  curr_neighbor->avg_color_square[b] = squarePixels[b];
-  curr_neighbor->color_sum[b] = colorSum[b];
-  }
-  return(color_h);
-}
-
-/**********************************************************************************/
-/* function calc_spatial_stats: calcs spatial heterogeneity of merging of         */
-/*                              curr_segment and curr_neighbor                    */
-/**********************************************************************************/
-
-float calc_spatial_stats(struct segment_neighbor *curr_neighbor, 
-             struct segment *curr_segment, 
-             struct segment **segments_ptr_vector, 
-             long int nrows, 
-             long int ncols, 
-             struct segmentation_parameters parameters)
-{
-  struct segment *neighbor;  
-  float spatial_h, smooth_f, compact_f;
-  float area[3], perimeter[3], b_box_len[3]; /* 0-current segment; 
-                          1-neighbor segment; 
-                        2-merged (new) segment */
-
-  neighbor = curr_neighbor->neighbor;
-
-  /* area */
-  area[0] = curr_segment->area;
-  area[1] = neighbor->area;
-  area[2] = area[0]+area[1];
-  curr_neighbor->area = area[2];
-  
-  /* perimeter */
-  perimeter[0] = curr_segment->perimeter;
-  perimeter[1] = neighbor->perimeter;
-  if (area[2]<4) /* valid only if pixel neighborhood==4 */
-  {
-    if (area[2]==2)
-    curr_neighbor->perimeter = 6;
-  else
-    curr_neighbor->perimeter = 8; 
-  }
-  else
-  {
-    calc_perimeter(curr_neighbor, curr_segment, segments_ptr_vector, nrows, ncols);
-  }
-  perimeter[2] = curr_neighbor->perimeter;
-  
-  /* bounding box lenght */
-  calc_bounding_box(curr_neighbor, curr_segment);
-  b_box_len[0] = curr_segment->b_box[2]*2 + curr_segment->b_box[3]*2;
-  b_box_len[1] = neighbor->b_box[2]*2 + neighbor->b_box[3]*2;
-  b_box_len[2] = curr_neighbor->b_box[2]*2 + curr_neighbor->b_box[3]*2;
-
-  /* smoothness factor */
-  smooth_f = (area[2]*perimeter[2]/b_box_len[2] - 
-    (area[1]*perimeter[1]/b_box_len[1] + area[0]*perimeter[0]/b_box_len[0]));
-  
-  /* compactness factor */
-  compact_f = (area[2]*perimeter[2]/sqrt(area[2]) - 
-    (area[1]*perimeter[1]/sqrt(area[1]) + area[0]*perimeter[0]/sqrt(area[0])));
-
-  /* spatial heterogeneity */
-  spatial_h = parameters.wcmpt*compact_f + (1-parameters.wcmpt)*smooth_f;
-  return(spatial_h);
-}
-
-/**********************************************************************************/
-/* function calc_perimeter: calculates the perimeter of merging of curr_segment   */
-/*                          and curr_neighbor                                     */
-/**********************************************************************************/
-
-void calc_perimeter(struct segment_neighbor *curr_neighbor, 
-          struct segment *curr_segment, 
-          struct segment **segments_ptr_vector, 
-          long int nrows, 
-          long int ncols)
-{
-  int i, j, k;
-  float perimeter_total;
-  unsigned long int neighbor_id, segment_id;
-  long int neighbor_pixel[4][2]; /* first col contain pixel id, second contains segment id */
-  struct segment_pixel *aux_pixel;
-  struct segment *aux_segment; 
-
-  perimeter_total = 0;
-
-  for (j=0;j<2;j++) /* once for the current segment, once for the neighbor segment */
-  {
-    neighbor_id = curr_neighbor->neighbor_id;
-    segment_id = curr_segment->id;
-    if (j==1)
-    {
-      aux_pixel = curr_segment->pixel_list;
-    }
-    else
-    {
-      aux_pixel = curr_neighbor->neighbor->pixel_list;
-    }
-    /* for each outline pixel */
-    while (aux_pixel!=NULL)
-    {
-      if (aux_pixel->borderline==true)
-      {
-        find_neighbor_pixels(aux_pixel->pixel_id, nrows, ncols, 
-      &neighbor_pixel[0][0], &neighbor_pixel[1][0], &neighbor_pixel[2][0], &neighbor_pixel[3][0]);
-        /* count how many of the surrounding pixels are from the own segment or neighbor */
-        k = 0;
-    for (i=0; i<4; i++)
-          if (neighbor_pixel[i][0]==-1) /* image limit */
-      k++;
-          else
-          {
-            aux_segment = segments_ptr_vector[neighbor_pixel[i][0]];
-            neighbor_pixel[i][1] = aux_segment->id;
-
-            if ((neighbor_pixel[i][1] != (int) segment_id)&&(neighbor_pixel[i][1] != (int) neighbor_id))
-              k++;
-          }
-        perimeter_total=perimeter_total+k; 
-      }
-      aux_pixel = aux_pixel->next_pixel;
-    }
-  }
-  curr_neighbor->perimeter = perimeter_total;
-
-
-}
-
-/**********************************************************************************/
-/* function calc_bounding_box: calcs bounding box of merging of curr_segment      */
-/*   and curr_neighbor                                                            */
-/**********************************************************************************/
-
-void calc_bounding_box(struct segment_neighbor *curr_neighbor, 
-             struct segment *curr_segment)
-{
-  float min_row[3], max_row[3], min_col[3], max_col[3];
-
-  min_row[0] = curr_segment->b_box[0];
-  max_row[0] = curr_segment->b_box[0]+curr_segment->b_box[2];
-  min_col[0] = curr_segment->b_box[1];
-  max_col[0] = curr_segment->b_box[1]+curr_segment->b_box[3];
-  
-  min_row[1] = curr_neighbor->neighbor->b_box[0];
-  max_row[1] = curr_neighbor->neighbor->b_box[0]+curr_neighbor->neighbor->b_box[2];
-  min_col[1] = curr_neighbor->neighbor->b_box[1];
-  max_col[1] = curr_neighbor->neighbor->b_box[1]+curr_neighbor->neighbor->b_box[3];
-
-  if (min_row[0]<min_row[1]) min_row[2]=min_row[0]; else min_row[2]=min_row[1];
-  if (min_col[0]<min_col[1]) min_col[2]=min_col[0]; else min_col[2]=min_col[1];
-  if (max_row[0]>max_row[1]) max_row[2]=max_row[0]; else max_row[2]=max_row[1];
-  if (max_col[0]>max_col[1]) max_col[2]=max_col[0]; else max_col[2]=max_col[1];
-
-  curr_neighbor->b_box[0] = min_row[2];
-  curr_neighbor->b_box[1] = min_col[2];
-  curr_neighbor->b_box[2] = max_row[2]-min_row[2];
-  curr_neighbor->b_box[3] = max_col[2]-min_col[2];
-}
-
-/**********************************************************************************/
-/* function reset_pixels: sets pixels from neighbor as belonging to current      */
-/*                         segment and corrects its outline                       */
-/**********************************************************************************/
-
-void reset_pixels(struct segment_neighbor *curr_neighbor, 
-          struct segment *curr_segment, 
-          struct segment **segments_ptr_vector, 
-          long int nrows, 
-          long int ncols)
-{
-  int i;
-  unsigned long int neighbor_id, segment_id;
-  long int neighbor_pixel[4][2]; /* first col contain pixel id, second col contains segment id */
-  struct segment_pixel *aux_pixel;
-  struct segment *aux_segment;
-
-  neighbor_id = curr_neighbor->neighbor_id;
-  segment_id = curr_segment->id;
-
-  /* for each pixel of the neighbor segment to be merged */
-  aux_pixel = curr_neighbor->neighbor->pixel_list;
-  while (aux_pixel!=NULL)
-  {
-    /* changes the value of the pixel in the segment matrix (assign it to the current segment) */
-    segments_ptr_vector[aux_pixel->pixel_id] = curr_segment;
-
-    /* if it is outline pixel, check if that must be changed */
-    if ((aux_pixel->borderline==true)&&(curr_segment->area>6)) /* curr_segment->area>6, 
-                                  only valid for pixel neighborhood==4 */
-    {
-      find_neighbor_pixels(aux_pixel->pixel_id, nrows, ncols, 
-      neighbor_pixel[0], neighbor_pixel[1], neighbor_pixel[2], neighbor_pixel[3]);
-      /* if pixel is surrounded by pixels of the same segment or of the merged neighbor, 
-       it's no longer a border pixel */
-      i=0;
-      while ((i<4)&&(i>-1))
-      {
-        if (neighbor_pixel[i][0]==-1) /* image limit */
-        {
-          i=-1;
-        }
-        else
-        {
-      aux_segment = segments_ptr_vector[neighbor_pixel[i][0]];
-          neighbor_pixel[i][1] = aux_segment->id;
-
-          if ((neighbor_pixel[i][1] != (int) segment_id)&&(neighbor_pixel[i][1] != (int) neighbor_id))
-          {
-            i=-1;
-          }
-          else
-          {
-            i++;
-          }
-        }
-      }
-      if (i!=-1) /* no longer outline pixel */
-      {
-        aux_pixel->borderline=false;
-      }
-    }
-    aux_pixel = aux_pixel->next_pixel;
-  }
-  
-  if (curr_segment->area>6) /* curr_segment->area>6, only valid for pixel neighborhood==4 */
-  {
-    /* for each outline pixel of the current segment */
-    aux_pixel = curr_segment->pixel_list;
-    while (aux_pixel!=NULL)
-    {
-      if (aux_pixel->borderline==true)
-      {
-        find_neighbor_pixels(aux_pixel->pixel_id, nrows, ncols, 
-      neighbor_pixel[0], neighbor_pixel[1], neighbor_pixel[2], neighbor_pixel[3]);
-        /* if pixel is surrounded by pixels of the same segment or of the merged neighbor, 
-       it's no longer a border pixel */
-        i=0;
-        while ((i<4)&&(i>-1))
-        {
-          if (neighbor_pixel[i][0]==-1) /* image limit */
-          {
-            i=-1;
-          }
-          else
-          {
-            aux_segment = segments_ptr_vector[neighbor_pixel[i][0]];
-            neighbor_pixel[i][1] = aux_segment->id;
-
-            if ((neighbor_pixel[i][1] != (int) segment_id)&&(neighbor_pixel[i][1] != (int) neighbor_id))
-            {
-              i=-1;
-            }
-            else
-            {
-              i++;
-            }
-          }
-        }
-        if (i!=-1) /* no longer outline pixel */
-        {
-          aux_pixel->borderline=false;
-        }
-      }
-      aux_pixel = aux_pixel->next_pixel;
-    }
-  }
-
-  /* include pixel list of neighbor in the list of curr_segment */
-  curr_segment->last_pixel->next_pixel = curr_neighbor->neighbor->pixel_list;
-  curr_segment->last_pixel = curr_neighbor->neighbor->last_pixel;
-  curr_neighbor->neighbor->pixel_list = NULL;
-}
-
-/**********************************************************************************/
-/* function remove_segment: remove segment from list                              */
-/**********************************************************************************/
-
-void remove_segment(struct segment *aux_segment, 
-          struct segment **first_segment, 
-          struct segment **last_segment)
-{
-  if (aux_segment==*first_segment)
-  {
-    *first_segment = aux_segment->next_segment;
-    (*first_segment)->previous_segment = NULL;
-  }
-  else
-  {
-    if (aux_segment==*last_segment)
-    {
-      *last_segment = aux_segment->previous_segment;
-      (*last_segment)->next_segment = NULL;
-    }
-    else
-    {
-      aux_segment->previous_segment->next_segment = aux_segment->next_segment;
-      aux_segment->next_segment->previous_segment = aux_segment->previous_segment;
-    }
-  }
-}
-
-
-/**********************************************************************************/
-/* function merge_segment: merge neighbor with current_segment and removes        */
-/*                         neighbor segment. Returns 0 if merged segment has been */
-/*                         used before, 1 otherwise.                              */
-/**********************************************************************************/
-
-int merge_segment(struct segment_neighbor *curr_neighbor, 
-          struct segment *curr_segment, 
-          struct segment **first_segment, 
-          struct segment **last_segment, 
-          struct segment **segments_ptr_vector, 
-          long int nrows, 
-          long int ncols)
-{
-  int i, not_used;
-  struct segment *neighbor;
-
-  neighbor = curr_neighbor->neighbor;
-
-  /* check if selected neighbor had already been used, if not set it as used */
-  if (neighbor->used)
-  {
-    not_used = false;
-  }
-  else
-  {
-    not_used = true;
-    neighbor->used = true;
-  }
-  
-  /* copy data from curr_neighbor to curr_seg */
-  curr_segment->area = curr_neighbor->area;
-  curr_segment->perimeter = curr_neighbor->perimeter;
-  for (i=0;i<4;i++)
-  {
-    curr_segment->b_box[i] = curr_neighbor->b_box[i];   
-  }
-  for (i=0;i<NUM_BANDS;i++)
-  {
-    curr_segment->avg_color[i] = curr_neighbor->avg_color[i];
-    curr_segment->std_color[i] = curr_neighbor->std_color[i];
-  curr_segment->avg_color_square[i] = curr_neighbor->avg_color_square[i];
-  curr_segment->color_sum[i] = curr_neighbor->color_sum[i];
-  }
-
-  /* sets pixels from neighbor as belonging to current segment and corrects outline */
-  reset_pixels(curr_neighbor, curr_segment, segments_ptr_vector, nrows, ncols);
-  
-  /* remove neighbor segment from list */
-  remove_segment(neighbor, first_segment, last_segment);
-
-  return(not_used);
-}
-
-/**********************************************************************************/
-/* function free_segment_list: remove all segment list and frees memory         */
-/**********************************************************************************/
-
-void free_segment_list(struct segment **initial_segment, 
-             struct segment ***segments_ptr_vector)
-{
-  struct segment *aux_segment;
-  struct segment *next_segment;
-  struct segment_pixel *aux_pixel;
-  struct segment_pixel *next_pixel;
-
-  /* frees segment list */
-  aux_segment=*initial_segment;
-  while (aux_segment!=NULL)
-  {
-    /* frees pixels lists */
-    aux_pixel = aux_segment->pixel_list;
-    while (aux_pixel!=NULL)
-    {
-      next_pixel = aux_pixel->next_pixel;
-      free(aux_pixel);
-      aux_pixel = next_pixel;
-    }
-    next_segment=aux_segment->next_original_segment;
-    free(aux_segment);
-    aux_segment=next_segment;
-  }
-  initial_segment=NULL;
-
-  /* frees segment vector */
-  if (segments_ptr_vector!=NULL)
-  {
-    free(*segments_ptr_vector);
-    *segments_ptr_vector=NULL;
-  }
-}
-
-/**********************************************************************************/
-/* function reset_unused_segments_list: mark all segments as unused                */
-/**********************************************************************************/
-
-void reset_unused_segments_list(unsigned long int num_segments, 
-                 struct segment *first_segment)
-{
-  unsigned long int i;
-  struct segment *aux_segment;
-
-  aux_segment = first_segment;
-
-  /* mark all segments as unused */
-  for (i=0; i<num_segments; i++)
-  {
-    aux_segment->used = false;
-    aux_segment = aux_segment->next_segment;
-  }
-}
-
-/**********************************************************************************/
-/* function write_segments: write output image                                    */
-/**********************************************************************************/
-
-void write_segments(// float **input_image, 
-          TePDITypes::TePDIRasterPtrType output_image,
-          struct segment *first_segment, 
-          int write_type,
-          bool progress_enabled_)
-{
-  int color[NUM_BANDS];
-  struct segment_pixel *aux_pixel;
-  struct segment *aux_segment;
-  long  ncols = output_image->params().ncols_,
-      nrows = output_image->params().nlines_,
-    col, row;
-
-  /* searches for first segment with a pixel list */
-  aux_segment = first_segment;
-  while (aux_segment->pixel_list==NULL)
-  {
-    aux_segment = aux_segment->next_original_segment;
-  }
-
-  /* for each segment */
-  TePDIPIManager pim("Writing segments", nrows * ncols, progress_enabled_);
-  while (aux_segment!=NULL)
-  {
-    /* define segment color */
-    switch (write_type)
-    {
-      case 0: /* random colors */
-        color[0] = (int) floor(ranval(0, 256));
-        //color[1] = (int) floor(ranval(0, 256));
-        //color[2] = (int) floor(ranval(0, 256));
-        break;
-      case 3: /* encoded segment id */
-        color[0] = (int) floor((double)aux_segment->id / 256.0);
-        //color[1] = ((int) aux_segment->id) % 256;
-        //color[2] = 0;
-        break;
-      default: /* average colors */
-        color[0] = (int) floor(aux_segment->avg_color[0]);
-        //color[1] = (int) floor(aux_segment->avg_color[1]);
-        //color[2] = (int) floor(aux_segment->avg_color[2]);
-        break;      
-    }
-
-    /* for each pixel of the segment */
-    aux_pixel = aux_segment->pixel_list;
-    while (aux_pixel!=NULL)
-    {
-   convert_pixel_id(aux_pixel->pixel_id, ncols, &row, &col);
-   output_image->setElement(col, row, color[0]);
-   // input_image[0][aux_pixel->pixel_id] = (unsigned char) color[0];
-     //input_image[1][aux_pixel->pixel_id] = (unsigned char) color[1];
-     //input_image[2][aux_pixel->pixel_id] = (unsigned char) color[2];
-     if (aux_pixel->borderline)
-      {
-        if (write_type==2)
-        {
-      convert_pixel_id(aux_pixel->pixel_id, ncols, &row, &col);
-      output_image->setElement(col, row, OUTLINE_COLOR_0);
-          // input_image[0][aux_pixel->pixel_id] = (unsigned char) OUTLINE_COLOR_0;
-          //input_image[1][aux_pixel->pixel_id] = (unsigned char) OUTLINE_COLOR_1;
-          //input_image[2][aux_pixel->pixel_id] = (unsigned char) OUTLINE_COLOR_2;
-        }
-        if (write_type==3)
-        {
-          //input_image[2][aux_pixel->pixel_id] = (unsigned char) 255;
-        }
-      }
-      aux_pixel = aux_pixel->next_pixel;
-    }
-    aux_segment=aux_segment->next_segment;
-  pim.Increment();
-  }
-  pim.Toggle(false);
-}
-
-/**********************************************************************************/
-/* function segmentation: performs the region growing segmentation                */
-/**********************************************************************************/
-
-float segmentation(//float **input_image, 
-           struct segment **segments_ptr_vector, 
-           struct segment *initial_segment, 
-           struct segment *final_segment, 
-           long int nrows, 
-           long int ncols, 
-           struct segmentation_parameters parameters,
-           bool progress_enabled_)
-{
-  int curr_step;
-  bool no_merges_prev_step = false;
-  float spectral_h, spatial_h;
-  float spectral_f, spatial_f;
-  float min_fusion_f, fusion_f, ssp;
-  long int num_segments, num_segments_unused;
-  unsigned long int num_pixels;
-  int dither_bits;
-  unsigned long int num_dither_cells, dither_cell_count;
-  struct segment *first_original_segment; /* first segment in segment list */
-  struct segment *first_segment; /* first not deleted segment in segment list */
-  struct segment *last_segment; /* last not deleted segment in segment list */
-  struct segment *curr_segment; /* current segment */
-  struct segment_neighbor *curr_neighbor; /* current neighbor */
-  struct segment_neighbor *first_neighbor; /* root of neighbor segment list */
-  struct segment_neighbor *best_neighbor = 0; /* lowest fusion factor to current segment */
-  float result;
-
-  /* initializes variables */
-  num_segments = num_pixels = nrows * ncols;
-  first_segment = initial_segment;
-  first_original_segment = initial_segment;
-  last_segment = final_segment;
- 
-  /* square of scale parameter */
-  ssp = parameters.sp*parameters.sp;
-
-  /* calculate dimensions of dither matrix */
-  num_dither_cells = dither_matrix_dimension(nrows, ncols, &dither_bits);
-
-  cout<<endl;
-  curr_step = 0;
-
-  /* segmentation step */
-  TePDIPIManager pim("Segmenting image", MAX_STEPS, progress_enabled_);
-  while ((curr_step<MAX_STEPS) && (no_merges_prev_step!=true))
-  {
-    /* flag that indicates if there were merges in the step */
-    no_merges_prev_step = true;
-
-    /* mark all segments as not used */
-    num_segments_unused = num_segments;
-
-    /* initialize cell count for dither search */
-  dither_cell_count = 0;
-
-  /* while there are segments not used (num_segments_unused>0)*/
-    while (num_segments_unused>0)
-    {
-      /* select one segment and mark that segment as used */
-      curr_segment = find_unused_by_dither(segments_ptr_vector, 
-      dither_bits, nrows, ncols, &dither_cell_count);
-    dither_cell_count++;
-    
-    curr_segment->used = true;
-      num_segments_unused--;
-
-      first_neighbor = curr_neighbor = NULL;
-
-      /* find segment neighbors */
-      first_neighbor = find_neighbors(curr_segment, segments_ptr_vector, nrows, ncols);
-      curr_neighbor = first_neighbor;
-
-      /* calculate heterogeinity factors for each neighbor */
-      min_fusion_f =  (float) MAX_FLT;
-      while (curr_neighbor != NULL)
-      {
-        /* calculates spectral heterogeneity */
-        spectral_h = calc_color_stats(curr_neighbor, curr_segment, /* input_image, */ parameters);
-    spectral_f = parameters.wcolor * spectral_h;
-
-        if (spectral_f<ssp)
-    {
-      /* calculates spatial heterogeneity */
-      spatial_h = calc_spatial_stats(curr_neighbor, curr_segment, 
-        segments_ptr_vector, nrows, ncols, parameters);
-      spatial_f = (1-parameters.wcolor) * spatial_h;
-
-      /* calculates fusion factor and identify best neighbor */
-      fusion_f = spectral_f + spatial_f;
-      if (fusion_f<min_fusion_f)
-      {
-        min_fusion_f = fusion_f;
-        best_neighbor = curr_neighbor;  
-      }
-    }
-        curr_neighbor = curr_neighbor->next_neighbor; 
-      }
-
-      /* checks if merge of current segment with best neighbor is possible */
-      if (min_fusion_f<ssp)
-      {
-        /* merges current segment with best neighbor and removes best neighbor */
-        num_segments_unused = num_segments_unused - 
-      merge_segment(best_neighbor, curr_segment, &first_segment, &last_segment, 
-          segments_ptr_vector, nrows, ncols);
-        num_segments--;
-        no_merges_prev_step = false;
-      }
-      free_neighbor_list(&first_neighbor);
-    }
-    reset_unused_segments_list(num_segments, first_segment);
-    
-  curr_step++;
-  pim.Increment();
-    
-  //cout<<".";
-  }
-  pim.Toggle(false);
-  //cout<<"acabou" << endl;
-  /* returns (num.segments + segmentation steps/100) */
-  //result = (float)curr_step;
-  //result = num_segments+(result/100);
-  result=1;
-  //cout<<"acabou2" << endl;
-  return(result);
-}
-
+#define MAX_FLT 3.4e38 /* maximum float value */
+
+// Internal includes
+#include <cstdlib>
+#include <iostream>
+#include <iomanip>
+#include <fstream>
+#include <time.h>
+#include <math.h>
+
+// TerraLib includes
+#include "TePDIBaatz.hpp"
+#include "TePDIRaster2Vector.hpp"
+#include "TePDIUtils.hpp"
+
+using namespace std;
+
+/**********************************************************************************/
+/* TerraLib main implementation for Baatz Segmentation                            */
+/**********************************************************************************/
+
+TePDIBaatz::TePDIBaatz()
+{
+}
+
+bool TePDIBaatz::CheckParameters( const TePDIParameters& parameters ) const
+{
+	// checking input_image
+    TePDITypes::TePDIRasterPtrType input_image;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "input_image", input_image ),
+		"Missing parameter: input_image");
+	TEAGN_TRUE_OR_RETURN(input_image.isActive(),
+		"Invalid parameter: input_image inactive");
+	TEAGN_TRUE_OR_RETURN(input_image->params().status_ != TeRasterParams::TeNotReady ,
+		"Invalid parameter: input_image not ready");
+	vector<float> input_weights;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "input_weights", input_weights ),
+    "Missing parameter: input_weights");
+  TEAGN_TRUE_OR_RETURN(input_weights.size() <= (unsigned) input_image->params().nBands() && input_weights.size() > 0,
+    "Input weights different from number of bands");
+  vector<unsigned> input_channels;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "input_channels", input_channels ),
+    "Missing parameter: input_channels");
+  TEAGN_TRUE_OR_RETURN(input_channels.size() == input_weights.size(),
+    "Input bands with different size from input weights");
+   
+	// checking output_image
+    TePDITypes::TePDIRasterPtrType output_image;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "output_image", output_image ),
+		"Missing parameter: output_image");
+
+ 	// checking thresholds
+	float scale;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "scale", scale ),
+		"Missing parameter: scale");
+	TEAGN_TRUE_OR_RETURN(scale > 0,
+		"Parameter scale is > 0");
+ 	float compactness;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "compactness", compactness ),
+		"Missing parameter: compactness");
+	TEAGN_TRUE_OR_RETURN(compactness > 0 && compactness <= 1,
+		"Parameter compactness is > 0 and <= 1");
+ 	float color;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter( "color", color ),
+		"Missing parameter: color");
+	TEAGN_TRUE_OR_RETURN(color > 0 && color <= 1,
+		"Parameter color is > 0 and <= 1");
+    
+   // checking output polygon sets parameter
+  if( parameters.CheckParameter< TePDITypes::TePDIPolSetMapPtrType >( 
+    "output_polsets" ) ) {
+    TePDITypes::TePDIPolSetMapPtrType output_polsets;
+    parameters.GetParameter( "output_polsets", output_polsets );
+    TEAGN_TRUE_OR_RETURN( output_polsets.isActive(),
+      "Invalid parameter output_polsets : Inactive polygon set pointer" );   
+  }   
+
+	return true;
+}
+
+void TePDIBaatz::ResetState( const TePDIParameters& )
+{
+}
+     
+bool TePDIBaatz::RunImplementation()
+{
+  TePDITypes::TePDIRasterPtrType input_image;
+	params_.GetParameter( "input_image", input_image );
+
+  vector<float> input_weights;
+  params_.GetParameter( "input_weights", input_weights );
+
+  vector<unsigned> input_channels;
+  params_.GetParameter( "input_channels", input_channels );
+  
+	/* retrieve input_image parameters */
+	int H = input_image->params().nlines_,
+		W = input_image->params().ncols_,
+		B = input_channels.size();
+
+	/* retrieve algorithm parameters */
+	float scale;
+	params_.GetParameter( "scale", scale );
+	float compactness;
+	params_.GetParameter( "compactness", compactness );
+	float color;
+	params_.GetParameter( "color", color );
+
+  struct segment **segments_ptr_vector = NULL;
+  struct segment *initial_segment = NULL;
+  struct segment *final_segment = NULL;
+  struct segmentation_parameters seg_parameters;
+
+	seg_parameters.sp = scale;
+	seg_parameters.wcmpt = compactness;
+	seg_parameters.wcolor = color;
+	seg_parameters.bands = B;
+	for (int i = 0; i < B; i++)
+		seg_parameters.wband[i] = input_weights[i];
+
+	/* run segmentation */
+/*
+	initialize_segments(&segments_ptr_vector, 
+		&initial_segment, &final_segment, input_image, H, W, progress_enabled_);
+	segmentation(segments_ptr_vector, 
+		initial_segment, final_segment, H, W, seg_parameters, progress_enabled_);
+*/
+/*
+	float **float_input_image = (float **) malloc( B * sizeof(float) );
+	for (int i = 0; i < B; i++)
+		float_input_image[i] = (float *) malloc( H * W * sizeof(float) );
+
+	int p = 0;
+	cout << "H: " << H << " W: " << W << " B: " << B << endl;
+	for (int i = 0; i < H; i++)
+		for (int j = 0; j < W; j++)
+		{
+			for (int k = 0; k < B; k++)
+			{
+				double pixel;
+				input_image->getElement(j, i, pixel, k);
+				float_input_image[k][p] = (float) pixel;
+			}
+			p++;
+		}
+*/
+	initialize_segments(&segments_ptr_vector, 
+		&initial_segment, &final_segment, input_image, input_channels, H, W, progress_enabled_);
+
+  segmentation(segments_ptr_vector, 
+		initial_segment, final_segment, H, W, seg_parameters, progress_enabled_);
+
+  /* write results */
+  
+	TePDITypes::TePDIRasterPtrType output_image;
+	params_.GetParameter( "output_image", output_image );
+	TeRasterParams output_image_params = output_image->params();
+	output_image_params.nBands( 1 );
+	output_image_params.setDataType( TeUNSIGNEDLONG );
+  output_image_params.boundingBoxLinesColumns( 
+    input_image->params().boundingBox().x1(),
+    input_image->params().boundingBox().y1(),
+    input_image->params().boundingBox().x2(),
+    input_image->params().boundingBox().y2(),
+    input_image->params().nlines_,
+    input_image->params().ncols_ );
+  output_image_params.projection( input_image->params().projection() );
+	TEAGN_TRUE_OR_RETURN( output_image->init(output_image_params),
+    "Error initiating output image" );
+     
+	write_segments(output_image, initial_segment, 0, progress_enabled_); 
+  free_segment_list(&initial_segment, &segments_ptr_vector); 
+/*
+	p = 0;
+	for (int i = 0; i < H; i++)
+		for (int j = 0; j < W; j++)
+		{
+			double pixel = (double) float_input_image[0][p++];
+			output_image->setElement(j, i, pixel);
+		}
+*/
+
+	/* generate output polygonset */
+  if( params_.CheckParameter< TePDITypes::TePDIPolSetMapPtrType >( 
+    "output_polsets" ) ) {
+    TePDITypes::TePDIPolSetMapPtrType output_polsets;
+    params_.GetParameter( "output_polsets", output_polsets );
+
+    TePDIParameters params_output;
+    params_output.SetParameter( "rotulated_image", output_image );
+    params_output.SetParameter( "channel", (unsigned int) 0 );
+    params_output.SetParameter( "output_polsets", output_polsets );
+
+    TePDIRaster2Vector raster2Vector;  
+
+    TEAGN_TRUE_OR_THROW( raster2Vector.Reset(params_output),
+      "Invalid Parameters for raster2Vector" );
+
+    TEAGN_TRUE_OR_THROW( raster2Vector.Apply(), 
+      "Apply error" );
+  }   
+
+  return true;
+}
+
+/**********************************************************************************/
+/* Internal main implementation for Baatz Segmentation                            */
+/**********************************************************************************/
+
+/* remove segment from list and conects segment list neighbours */
+void remove_segment(struct segment *aux_segment, 
+          struct segment **first_segment, 
+          struct segment **last_segment);
+
+/* merge neighbor with current_segment and removes neighbor segment */
+int merge_segment(struct segment_neighbor *curr_neighbor, 
+          struct segment *curr_segment, 
+          struct segment **first_segment, 
+          struct segment **last_segment,
+          struct segment **segments_ptr_vector, 
+          long int nrows, 
+          long int ncols); 
+
+/* identifies borderline pixels and change segment_matrix */
+void reset_pixels(struct segment_neighbor *curr_neighbor, 
+          struct segment *curr_segment, 
+          struct segment **segments_ptr_vector, 
+          long int nrows, 
+          long int ncols);
+ 
+/* creates list of segment's image neighbours */
+struct segment_neighbor* find_neighbors(struct segment *curr_segment, 
+                    struct segment **segments_ptr_vector, 
+                    long int nrows, 
+                    long int ncols); 
+
+/* finds the 4 neighbors of a pixel */
+void find_neighbor_pixels(unsigned long int pixel_id, 
+              long int nrows, 
+              long int ncols, 
+              long int *n0, 
+              long int *n1, 
+              long int *n2, 
+              long int *n3);
+ 
+/* frees list of segment's neighbors from memory */
+void free_neighbor_list(struct segment_neighbor **first_neighbor); 
+
+/* calcs mean and stddev of merging of curr_segment and curr_neighbor */
+float calc_color_stats (struct segment_neighbor *curr_neighbor, 
+            struct segment *curr_segment, 
+            // float **input_image, 
+            struct segmentation_parameters parameters);
+ 
+/* calcs spatial heterogeneity of merging of curr_segment and curr_neighbor */
+float calc_spatial_stats(struct segment_neighbor *curr_neighbor, 
+             struct segment *curr_segment, 
+             struct segment *segments_ptr_vector, 
+             long int nrows, 
+             long int ncols, 
+             struct segmentation_parameters parameters);
+ 
+/* calcs perimeter of merging of curr_segment and curr_neighbor */
+void calc_perimeter(struct segment_neighbor *curr_neighbor, 
+          struct segment *curr_segment, 
+          struct segment **segments_ptr_vector, 
+          long int nrows, 
+          long int ncols); 
+
+/* calcs perimeter of merging of curr_segment and curr_neighbor, second version */
+void calc_perimeter_optimized(struct segment_neighbor *curr_neighbor, 
+          struct segment *curr_segment, 
+          struct segment **segments_ptr_vector, 
+          long int nrows, 
+          long int ncols); 
+
+/* calcs bounding box of merging of curr_segment and curr_neighbor */
+void calc_bounding_box(struct segment_neighbor *curr_neighbor, 
+             struct segment *curr_segment); 
+
+/* mark all segments as unused */
+void reset_unused_segments_list(unsigned long int num_segments, 
+                 struct segment *first_segment); 
+
+/* search unused segment using a dither matrix */
+struct segment* find_unused_by_dither(struct segment **segments_ptr_vector, 
+                    int num_bits, 
+                    long int nrows, 
+                    long int ncols,
+                    unsigned long int *cell_count);
+
+/* finds col and row from a pixel id */
+void convert_pixel_id(unsigned long int pixel_id, 
+            long int ncols, 
+            long int *row, 
+            long int *col); 
+
+/**********************************************************************************/
+/* ranval: random number generator                                                */
+/**********************************************************************************/
+
+float ranval(float low, 
+       float high)
+{
+  float val;
+
+  val = (((float) rand())/RAND_MAX) * (high - low) + low;
+
+  return(val);
+}
+
+/**********************************************************************************/
+/* function dither_matrix_bits: calculate number of bits necessary to hold a      */
+/*                              coordinate subscript of dither (square) matrix    */
+/**********************************************************************************/
+unsigned long int dither_matrix_dimension(long int nrows,
+                      long int ncols,
+                      int *dither_bits)
+{
+  int num_bits;
+  unsigned long int max_dimension;
+  unsigned long int dither_dimension;
+  
+  if (nrows>ncols)
+    max_dimension=nrows*nrows;
+  else
+    max_dimension=ncols*ncols;
+
+  num_bits=0;
+  dither_dimension=1;
+
+  while (dither_dimension < max_dimension)
+  {
+    dither_dimension = dither_dimension*2;
+    num_bits++;
+  }
+
+  if (num_bits%2)
+  {
+    num_bits++;
+    dither_dimension = dither_dimension*2;
+  }
+
+  *dither_bits = num_bits;
+
+  return(dither_dimension);
+}
+
+/**********************************************************************************/
+/* function dither_matrix_conversion: converts an pixel index into a dither       */
+/*                                    matrix index                                */
+/**********************************************************************************/
+unsigned long int dither_matrix_conversion(int num_bits, 
+                       long int nrows, 
+                       long int ncols,
+                       unsigned long int *cell_count)
+{
+  long int row, col, irow, icol;
+  unsigned long int pixel_id;
+  unsigned long int aux_cell_count;
+  int i, j, k;
+  bool found;
+
+  aux_cell_count = *cell_count;
+  found = false;
+
+  while (!found) 
+  {
+    irow = icol = 0;
+    j = k = 1;
+    for (i=0;i<num_bits;i++)
+    {
+      if (i % 2)
+      {
+        icol = icol+(aux_cell_count&j)/k;
+      }
+      else
+      {
+        irow = irow+(aux_cell_count&j)/k;
+        k = k * 2;
+      }
+      j = j * 2;
+    }
+
+    row = col = 0;
+    j = 1;
+    for (i=0;i<(num_bits/2);i++)
+    {
+      k = k / 2;
+      if (irow & j) row = row+k;
+      if (icol & j) col = col+k;
+      j = j * 2;
+    }
+    
+    if ((col >= ncols)||(row >= nrows))
+    {
+      found = false;
+      aux_cell_count++;
+    }
+    else
+    {
+      pixel_id = (ncols*row)+col;
+      found = true;
+    }
+  }
+
+  *cell_count = aux_cell_count;
+  return(pixel_id);
+}
+
+/**********************************************************************************/
+/* function create_initial_segments: creates initial segment list                 */
+/**********************************************************************************/
+
+int initialize_segments(struct segment ***segments_ptr_vector, 
+            struct segment **first_segment, 
+            struct segment **last_segment, 
+            // float **input_image, 
+            TePDITypes::TePDIRasterPtrType input_image,
+            vector<unsigned> input_channels, 
+            long int nrows, 
+            long int ncols,
+            bool progress_enabled_)
+{
+  struct segment *aux_segment = 0;
+  struct segment *prev_segment;
+  struct segment_pixel *body_pixel;
+  unsigned long int id_pixel;
+  int row, col;
+  int allocate_memory, error;
+
+  error = 0;
+
+  /* allocate memory for segments matrix if it has not been created yet */
+  if (*segments_ptr_vector == NULL)
+  {
+  allocate_memory = true;
+  *segments_ptr_vector = (struct segment **) malloc(nrows*ncols * sizeof(struct segment *));
+  }
+  else
+  allocate_memory = false;
+
+  if(*segments_ptr_vector == NULL) error = 1;
+
+  row = 0;
+  col = 0;
+  id_pixel=0;
+  prev_segment = NULL;
+
+  TePDIPIManager pim("Initializing Data", nrows * ncols, progress_enabled_);
+  while ((id_pixel<(unsigned long)(nrows*ncols)) && (error!=1))
+  {
+
+  if (allocate_memory)
+  {
+      aux_segment = (struct segment*) malloc(sizeof(struct segment));
+    if(aux_segment == NULL) error = 1;
+    
+    body_pixel = (struct segment_pixel*) malloc(sizeof(struct segment_pixel));
+    if(body_pixel == NULL) error = 1;
+
+    aux_segment->next_original_segment = NULL;
+    aux_segment->original_pixel = body_pixel;
+  }
+  else
+  {
+    if (id_pixel==0)
+      aux_segment = *first_segment;
+    else
+      aux_segment = aux_segment->next_original_segment;
+    
+    body_pixel = aux_segment->original_pixel;
+  }
+
+  if (error!=1)
+  {
+    (*segments_ptr_vector)[id_pixel] = aux_segment;
+
+    aux_segment->id = id_pixel;
+    aux_segment->area = 1;
+    aux_segment->perimeter = 4;
+    aux_segment->b_box[0] = (float)row;
+    aux_segment->b_box[1] = (float)col;
+    aux_segment->b_box[2] = 1;
+    aux_segment->b_box[3] = 1;
+
+    for(unsigned b = 0; b < input_channels.size(); b++)
+    {
+      double pixel;
+      input_image->getElement(col, row, pixel, input_channels[b]);
+      aux_segment->avg_color[b] = (float) pixel;
+      aux_segment->std_color[b] = 0;
+      aux_segment->avg_color_square[b] = (float) (pixel * pixel);
+      aux_segment->color_sum[b] = (float) pixel;
+    }
+/*
+    for(int b = 0; b < NUM_BANDS; b++)
+    {
+      aux_segment->avg_color[b] = input_image[b][id_pixel];
+      aux_segment->std_color[b] = 0;
+      aux_segment->avg_color_square[b] = (float)(input_image[b][id_pixel])*(input_image[b][id_pixel]);
+      aux_segment->color_sum[b] = input_image[b][id_pixel];
+    }
+*/
+    aux_segment->used = false;
+
+    body_pixel->pixel_id = id_pixel;
+    body_pixel->borderline = true;
+    body_pixel->next_pixel = NULL;
+    aux_segment->pixel_list = body_pixel;
+    aux_segment->last_pixel = body_pixel;
+    
+    aux_segment->next_segment = NULL;
+    aux_segment->previous_segment = prev_segment;
+
+    if (prev_segment)
+    {
+      prev_segment->next_segment = aux_segment;
+      prev_segment->next_original_segment = aux_segment;
+
+      *last_segment = aux_segment;
+    }
+    else
+    {
+      *first_segment = aux_segment;
+    }
+
+    prev_segment = aux_segment;
+    
+    col++;
+    if (col==ncols)
+    {
+      col = 0;
+      row++;
+    }
+    
+      id_pixel++;
+    pim.Increment();
+  }
+  }
+  pim.Toggle(false);
+  if(error)
+  {
+    /* out of memory space */
+    return(1);
+  }
+  return(0);
+}
+
+/**********************************************************************************/
+/* function find_unused_by_dither : finds segment using dither matrix             */
+/**********************************************************************************/
+
+struct segment* find_unused_by_dither(struct segment **segments_ptr_vector, 
+                    int num_bits, 
+                    long int nrows, 
+                    long int ncols,
+                    unsigned long int *cell_count)
+
+{
+  struct segment *aux_segment;
+  unsigned long int pixel_id;
+  bool found;
+
+  found = false;
+
+  while (!found)
+  {
+  pixel_id=dither_matrix_conversion(num_bits, nrows, ncols, cell_count);
+  aux_segment = segments_ptr_vector[pixel_id];
+
+    if (aux_segment->used)
+    *cell_count=*cell_count+1;
+  else
+    found = true;
+  }
+  
+  return(aux_segment);
+}
+
+/**********************************************************************************/
+/* function convert_pixel_id: finds col and row from pixel id                     */
+/**********************************************************************************/
+
+void convert_pixel_id(unsigned long int pixel_id, 
+            long int ncols, 
+            long int *row, 
+            long int *col)
+{
+  *row = (long)floor((double)pixel_id / (double)ncols);
+  *col = pixel_id % ncols;
+}
+
+/**********************************************************************************/
+/* function free_neighbor_list: frees list of segment's neighbors from memory     */
+/**********************************************************************************/
+
+void free_neighbor_list(struct segment_neighbor **first_neighbor)
+{
+  struct segment_neighbor *aux_neighbor;
+  
+  while (*first_neighbor!=NULL)
+  {
+    aux_neighbor = (*first_neighbor)->next_neighbor;
+    free(*first_neighbor);
+    *first_neighbor = aux_neighbor;
+  }
+}
+
+/**********************************************************************************/
+/* function find_neighbors: creates list of segment's image neighbors             */
+/**********************************************************************************/
+
+struct segment_neighbor* find_neighbors(struct segment *curr_segment, 
+                    struct segment **segments_ptr_vector, 
+                    long int nrows, long int ncols)
+{
+  int i, not_in_neighbors_list;
+  long int neighbor_pixel[4][2]; /* first col contain pixel id, second contains segment id */
+  struct segment_neighbor *first_neighbor;
+  struct segment_neighbor *aux_neighbor;
+  struct segment_neighbor *new_neighbor;
+  struct segment_pixel *aux_pixel;
+  struct segment *aux_segment;
+   
+  aux_pixel = curr_segment->pixel_list;
+  first_neighbor = NULL;
+
+  /* for each outline pixel */
+  while (aux_pixel!=NULL)
+  {
+    if (aux_pixel->borderline==true)
+    {
+      find_neighbor_pixels(aux_pixel->pixel_id, nrows, ncols, 
+      neighbor_pixel[0], neighbor_pixel[1], neighbor_pixel[2], neighbor_pixel[3]);
+      /* finds segments to which pixel belongs to */
+      for (i=0;i<4;i++)
+      {
+        if (neighbor_pixel[i][0]!=-1)
+        {
+          aux_segment = segments_ptr_vector[neighbor_pixel[i][0]];
+          neighbor_pixel[i][1] = aux_segment->id;
+
+          if (neighbor_pixel[i][1] == (int) curr_segment->id)
+            neighbor_pixel[i][1]=-1;
+        }
+        else
+        {
+          neighbor_pixel[i][1]=-1;
+        }
+        /* if pixel segment is not yet in the list of segment neighbors, includes it */
+        if (neighbor_pixel[i][1]>-1)
+        {
+          not_in_neighbors_list = true;
+          aux_neighbor = first_neighbor;
+          while ((aux_neighbor!=NULL)&&(not_in_neighbors_list))
+          {
+            if (aux_neighbor->neighbor_id == (unsigned) neighbor_pixel[i][1])
+            {
+              not_in_neighbors_list = false;
+            }
+            else
+            {
+              aux_neighbor = aux_neighbor->next_neighbor;
+            }
+          }
+          if (not_in_neighbors_list)
+          {
+            new_neighbor = (struct segment_neighbor*) malloc(sizeof(struct segment_neighbor));
+            new_neighbor->neighbor_id = neighbor_pixel[i][1];
+            new_neighbor->neighbor = segments_ptr_vector[neighbor_pixel[i][1]];
+
+            if (first_neighbor==NULL)
+            {
+              new_neighbor->next_neighbor = NULL;
+            }
+            else
+            {
+              new_neighbor->next_neighbor = first_neighbor;
+            }
+            first_neighbor = new_neighbor;
+          }
+        }
+      }
+    }
+    aux_pixel = aux_pixel->next_pixel;
+  }
+  return (first_neighbor);
+}
+
+/**********************************************************************************/
+/* function find_neighbor_pixels: returns the ids of the (4) neighbors of a pixel */
+/**********************************************************************************/
+
+void find_neighbor_pixels(unsigned long int pixel_id, 
+              long int nrows, 
+              long int ncols, 
+              long int *n0, 
+              long int *n1, 
+              long int *n2, 
+              long int *n3)
+{
+  long int row, col;
+
+  convert_pixel_id(pixel_id, ncols, &row, &col);
+
+  *n0 = *n1 = *n2 = *n3 = -1;
+  
+  if (row>0)         *n0=((row-1)*ncols) + col;      
+
+  if (col>0)         *n1=(row*ncols) + (col-1);
+
+  if (row<(nrows-1)) *n2=((row+1)*ncols) + col;
+
+  if (col<(ncols-1)) *n3=(row*ncols) + (col+1);
+}
+
+/**********************************************************************************/
+/* function calc_color_stats: calculate the mean color and the standard deviation */
+/*           of the merging of two segments and writes it to the current neighbor */
+/**********************************************************************************/
+
+float calc_color_stats (struct segment_neighbor *curr_neighbor, 
+            struct segment *curr_segment, 
+            //float **input_image, 
+            struct segmentation_parameters parameters)
+{
+  float mean[NUM_BANDS], colorSum[NUM_BANDS];
+  float squarePixels[NUM_BANDS];
+  float stddev[NUM_BANDS];
+  float stddevNew[NUM_BANDS];
+  float sum_wband, wband_norm[NUM_BANDS];
+  float color_f[NUM_BANDS];
+  float color_h;
+  int b;
+  long int count;
+  count = 0;
+  float a_current, a_neighbor, a_sum;
+  struct segment *neighbor;
+
+  neighbor = curr_neighbor->neighbor;
+
+  a_current = curr_segment->area;
+  a_neighbor = neighbor->area;
+  a_sum = a_current+a_neighbor;
+  sum_wband = 0;
+
+  for (b = 0; b < parameters.bands; b++)
+  {
+    mean[b] = ((curr_segment->avg_color[b]*a_current)+(neighbor->avg_color[b]*a_neighbor))/a_sum;
+  squarePixels[b] = (curr_segment->avg_color_square[b])+(neighbor->avg_color_square[b]);
+  colorSum[b] = curr_segment->color_sum[b] + neighbor->color_sum[b];
+    stddev[b] = 0;
+  stddevNew[b] = 0;
+  sum_wband = sum_wband + parameters.wband[b];
+  }
+
+  for(b = 0; b < parameters.bands; b++)
+  {
+    stddevNew[b] = squarePixels[b] - 2*mean[b]*colorSum[b] + a_sum*mean[b]*mean[b];
+  }
+
+  /* stores stddev and mean in neighbor */
+  /* calculates color factor per band and total */
+  color_h = 0;
+  for (b = 0; b < parameters.bands; b++)
+  {
+    stddev[b] = sqrt(stddevNew[b]/a_sum);
+  wband_norm[b] = parameters.wband[b]; /* new implementation, bands already weighted */
+
+    color_f[b] = (a_current*curr_segment->std_color[b]) + 
+    (a_neighbor*neighbor->std_color[b]);
+    color_f[b] = wband_norm[b] * ((a_sum*stddev[b])-color_f[b]);
+    color_h = color_h + color_f[b];
+    
+    curr_neighbor->avg_color[b] = mean[b];
+    curr_neighbor->std_color[b] = stddev[b];
+  curr_neighbor->avg_color_square[b] = squarePixels[b];
+  curr_neighbor->color_sum[b] = colorSum[b];
+  }
+  return(color_h);
+}
+
+/**********************************************************************************/
+/* function calc_spatial_stats: calcs spatial heterogeneity of merging of         */
+/*                              curr_segment and curr_neighbor                    */
+/**********************************************************************************/
+
+float calc_spatial_stats(struct segment_neighbor *curr_neighbor, 
+             struct segment *curr_segment, 
+             struct segment **segments_ptr_vector, 
+             long int nrows, 
+             long int ncols, 
+             struct segmentation_parameters parameters)
+{
+  struct segment *neighbor;  
+  float spatial_h, smooth_f, compact_f;
+  float area[3], perimeter[3], b_box_len[3]; /* 0-current segment; 
+                          1-neighbor segment; 
+                        2-merged (new) segment */
+
+  neighbor = curr_neighbor->neighbor;
+
+  /* area */
+  area[0] = curr_segment->area;
+  area[1] = neighbor->area;
+  area[2] = area[0]+area[1];
+  curr_neighbor->area = area[2];
+  
+  /* perimeter */
+  perimeter[0] = curr_segment->perimeter;
+  perimeter[1] = neighbor->perimeter;
+  if (area[2]<4) /* valid only if pixel neighborhood==4 */
+  {
+    if (area[2]==2)
+    curr_neighbor->perimeter = 6;
+  else
+    curr_neighbor->perimeter = 8; 
+  }
+  else
+  {
+//    calc_perimeter(curr_neighbor, curr_segment, segments_ptr_vector, nrows, ncols);
+//cout << "original: " << curr_neighbor->perimeter << endl;
+    calc_perimeter_optimized(curr_neighbor, curr_segment, segments_ptr_vector, nrows, ncols);
+//cout << "optimized: " << curr_neighbor->perimeter << endl;
+
+//    calc_perimeter(curr_neighbor, curr_segment, segments_ptr_vector, nrows, ncols);
+  }
+  perimeter[2] = curr_neighbor->perimeter;
+  
+  /* bounding box lenght */
+  calc_bounding_box(curr_neighbor, curr_segment);
+  b_box_len[0] = curr_segment->b_box[2]*2 + curr_segment->b_box[3]*2;
+  b_box_len[1] = neighbor->b_box[2]*2 + neighbor->b_box[3]*2;
+  b_box_len[2] = curr_neighbor->b_box[2]*2 + curr_neighbor->b_box[3]*2;
+
+  /* smoothness factor */
+  smooth_f = (area[2]*perimeter[2]/b_box_len[2] - 
+    (area[1]*perimeter[1]/b_box_len[1] + area[0]*perimeter[0]/b_box_len[0]));
+  
+  /* compactness factor */
+  compact_f = (area[2]*perimeter[2]/sqrt(area[2]) - 
+    (area[1]*perimeter[1]/sqrt(area[1]) + area[0]*perimeter[0]/sqrt(area[0])));
+
+  /* spatial heterogeneity */
+  spatial_h = parameters.wcmpt*compact_f + (1-parameters.wcmpt)*smooth_f;
+  return(spatial_h);
+}
+
+/**********************************************************************************/
+/* function calc_perimeter: calculates the perimeter of merging of curr_segment   */
+/*                          and curr_neighbor                                     */
+/**********************************************************************************/
+
+void calc_perimeter(struct segment_neighbor *curr_neighbor, 
+          struct segment *curr_segment, 
+          struct segment **segments_ptr_vector, 
+          long int nrows, 
+          long int ncols)
+{
+  int i, j, k;
+  float perimeter_total;
+  unsigned long int neighbor_id, segment_id;
+  long int neighbor_pixel[4][2]; /* first col contain pixel id, second contains segment id */
+  struct segment_pixel *aux_pixel;
+  struct segment *aux_segment; 
+
+  perimeter_total = 0;
+
+  for (j=0;j<2;j++) /* once for the current segment, once for the neighbor segment */
+  {
+    neighbor_id = curr_neighbor->neighbor_id;
+    segment_id = curr_segment->id;
+    if (j==1)
+    {
+      aux_pixel = curr_segment->pixel_list;
+    }
+    else
+    {
+      aux_pixel = curr_neighbor->neighbor->pixel_list;
+    }
+    /* for each outline pixel */
+    while (aux_pixel!=NULL)
+    {
+      if (aux_pixel->borderline==true)
+      {
+        find_neighbor_pixels(aux_pixel->pixel_id, nrows, ncols, 
+      &neighbor_pixel[0][0], &neighbor_pixel[1][0], &neighbor_pixel[2][0], &neighbor_pixel[3][0]);
+        /* count how many of the surrounding pixels are from the own segment or neighbor */
+        k = 0;
+    for (i=0; i<4; i++)
+          if (neighbor_pixel[i][0]==-1) /* image limit */
+      k++;
+          else
+          {
+            aux_segment = segments_ptr_vector[neighbor_pixel[i][0]];
+            neighbor_pixel[i][1] = aux_segment->id;
+
+            if ((neighbor_pixel[i][1] != (int) segment_id)&&(neighbor_pixel[i][1] != (int) neighbor_id))
+              k++;
+          }
+        perimeter_total=perimeter_total+k; 
+      }
+      aux_pixel = aux_pixel->next_pixel;
+    }
+  }
+  curr_neighbor->perimeter = perimeter_total;
+
+
+}
+
+/**********************************************************************************/
+/* function calc_bounding_box: calcs bounding box of merging of curr_segment      */
+/*   and curr_neighbor                                                            */
+/**********************************************************************************/
+
+void calc_bounding_box(struct segment_neighbor *curr_neighbor, 
+             struct segment *curr_segment)
+{
+  float min_row[3], max_row[3], min_col[3], max_col[3];
+
+  min_row[0] = curr_segment->b_box[0];
+  max_row[0] = curr_segment->b_box[0]+curr_segment->b_box[2];
+  min_col[0] = curr_segment->b_box[1];
+  max_col[0] = curr_segment->b_box[1]+curr_segment->b_box[3];
+  
+  min_row[1] = curr_neighbor->neighbor->b_box[0];
+  max_row[1] = curr_neighbor->neighbor->b_box[0]+curr_neighbor->neighbor->b_box[2];
+  min_col[1] = curr_neighbor->neighbor->b_box[1];
+  max_col[1] = curr_neighbor->neighbor->b_box[1]+curr_neighbor->neighbor->b_box[3];
+
+  if (min_row[0]<min_row[1]) min_row[2]=min_row[0]; else min_row[2]=min_row[1];
+  if (min_col[0]<min_col[1]) min_col[2]=min_col[0]; else min_col[2]=min_col[1];
+  if (max_row[0]>max_row[1]) max_row[2]=max_row[0]; else max_row[2]=max_row[1];
+  if (max_col[0]>max_col[1]) max_col[2]=max_col[0]; else max_col[2]=max_col[1];
+
+  curr_neighbor->b_box[0] = min_row[2];
+  curr_neighbor->b_box[1] = min_col[2];
+  curr_neighbor->b_box[2] = max_row[2]-min_row[2];
+  curr_neighbor->b_box[3] = max_col[2]-min_col[2];
+}
+
+/**********************************************************************************/
+/* function reset_pixels: sets pixels from neighbor as belonging to current      */
+/*                         segment and corrects its outline                       */
+/**********************************************************************************/
+
+void reset_pixels(struct segment_neighbor *curr_neighbor, 
+          struct segment *curr_segment, 
+          struct segment **segments_ptr_vector, 
+          long int nrows, 
+          long int ncols)
+{
+  int i;
+  unsigned long int neighbor_id, segment_id;
+  long int neighbor_pixel[4][2]; /* first col contain pixel id, second col contains segment id */
+  struct segment_pixel *aux_pixel;
+  struct segment *aux_segment;
+
+  neighbor_id = curr_neighbor->neighbor_id;
+  segment_id = curr_segment->id;
+
+  /* for each pixel of the neighbor segment to be merged */
+  aux_pixel = curr_neighbor->neighbor->pixel_list;
+  while (aux_pixel!=NULL)
+  {
+    /* changes the value of the pixel in the segment matrix (assign it to the current segment) */
+    segments_ptr_vector[aux_pixel->pixel_id] = curr_segment;
+
+    /* if it is outline pixel, check if that must be changed */
+    if ((aux_pixel->borderline==true)&&(curr_segment->area>6)) /* curr_segment->area>6, 
+                                  only valid for pixel neighborhood==4 */
+    {
+      find_neighbor_pixels(aux_pixel->pixel_id, nrows, ncols, 
+      neighbor_pixel[0], neighbor_pixel[1], neighbor_pixel[2], neighbor_pixel[3]);
+      /* if pixel is surrounded by pixels of the same segment or of the merged neighbor, 
+       it's no longer a border pixel */
+      i=0;
+      while ((i<4)&&(i>-1))
+      {
+        if (neighbor_pixel[i][0]==-1) /* image limit */
+        {
+          i=-1;
+        }
+        else
+        {
+      aux_segment = segments_ptr_vector[neighbor_pixel[i][0]];
+          neighbor_pixel[i][1] = aux_segment->id;
+
+          if ((neighbor_pixel[i][1] != (int) segment_id)&&(neighbor_pixel[i][1] != (int) neighbor_id))
+          {
+            i=-1;
+          }
+          else
+          {
+            i++;
+          }
+        }
+      }
+      if (i!=-1) /* no longer outline pixel */
+      {
+        aux_pixel->borderline=false;
+      }
+    }
+    aux_pixel = aux_pixel->next_pixel;
+  }
+  
+  if (curr_segment->area>6) /* curr_segment->area>6, only valid for pixel neighborhood==4 */
+  {
+    /* for each outline pixel of the current segment */
+    aux_pixel = curr_segment->pixel_list;
+    while (aux_pixel!=NULL)
+    {
+      if (aux_pixel->borderline==true)
+      {
+        find_neighbor_pixels(aux_pixel->pixel_id, nrows, ncols, 
+      neighbor_pixel[0], neighbor_pixel[1], neighbor_pixel[2], neighbor_pixel[3]);
+        /* if pixel is surrounded by pixels of the same segment or of the merged neighbor, 
+       it's no longer a border pixel */
+        i=0;
+        while ((i<4)&&(i>-1))
+        {
+          if (neighbor_pixel[i][0]==-1) /* image limit */
+          {
+            i=-1;
+          }
+          else
+          {
+            aux_segment = segments_ptr_vector[neighbor_pixel[i][0]];
+            neighbor_pixel[i][1] = aux_segment->id;
+
+            if ((neighbor_pixel[i][1] != (int) segment_id)&&(neighbor_pixel[i][1] != (int) neighbor_id))
+            {
+              i=-1;
+            }
+            else
+            {
+              i++;
+            }
+          }
+        }
+        if (i!=-1) /* no longer outline pixel */
+        {
+          aux_pixel->borderline=false;
+        }
+      }
+      aux_pixel = aux_pixel->next_pixel;
+    }
+  }
+
+  /* include pixel list of neighbor in the list of curr_segment */
+  curr_segment->last_pixel->next_pixel = curr_neighbor->neighbor->pixel_list;
+  curr_segment->last_pixel = curr_neighbor->neighbor->last_pixel;
+  curr_neighbor->neighbor->pixel_list = NULL;
+}
+
+/**********************************************************************************/
+/* function remove_segment: remove segment from list                              */
+/**********************************************************************************/
+
+void remove_segment(struct segment *aux_segment, 
+          struct segment **first_segment, 
+          struct segment **last_segment)
+{
+  if (aux_segment==*first_segment)
+  {
+    *first_segment = aux_segment->next_segment;
+    (*first_segment)->previous_segment = NULL;
+  }
+  else
+  {
+    if (aux_segment==*last_segment)
+    {
+      *last_segment = aux_segment->previous_segment;
+      (*last_segment)->next_segment = NULL;
+    }
+    else
+    {
+      aux_segment->previous_segment->next_segment = aux_segment->next_segment;
+      aux_segment->next_segment->previous_segment = aux_segment->previous_segment;
+    }
+  }
+}
+
+
+/**********************************************************************************/
+/* function merge_segment: merge neighbor with current_segment and removes        */
+/*                         neighbor segment. Returns 0 if merged segment has been */
+/*                         used before, 1 otherwise.                              */
+/**********************************************************************************/
+
+int merge_segment(struct segment_neighbor *curr_neighbor, 
+          struct segment *curr_segment, 
+          struct segment **first_segment, 
+          struct segment **last_segment, 
+          struct segment **segments_ptr_vector, 
+          long int nrows, 
+          long int ncols)
+{
+  int i, not_used;
+  struct segment *neighbor;
+
+  neighbor = curr_neighbor->neighbor;
+
+  /* check if selected neighbor had already been used, if not set it as used */
+  if (neighbor->used)
+  {
+    not_used = false;
+  }
+  else
+  {
+    not_used = true;
+    neighbor->used = true;
+  }
+  
+  /* copy data from curr_neighbor to curr_seg */
+  curr_segment->area = curr_neighbor->area;
+  curr_segment->perimeter = curr_neighbor->perimeter;
+  for (i=0;i<4;i++)
+  {
+    curr_segment->b_box[i] = curr_neighbor->b_box[i];   
+  }
+  for (i=0;i<NUM_BANDS;i++)
+  {
+    curr_segment->avg_color[i] = curr_neighbor->avg_color[i];
+    curr_segment->std_color[i] = curr_neighbor->std_color[i];
+  curr_segment->avg_color_square[i] = curr_neighbor->avg_color_square[i];
+  curr_segment->color_sum[i] = curr_neighbor->color_sum[i];
+  }
+
+  /* sets pixels from neighbor as belonging to current segment and corrects outline */
+  reset_pixels(curr_neighbor, curr_segment, segments_ptr_vector, nrows, ncols);
+  
+  /* remove neighbor segment from list */
+  remove_segment(neighbor, first_segment, last_segment);
+
+  return(not_used);
+}
+
+/**********************************************************************************/
+/* function free_segment_list: remove all segment list and frees memory         */
+/**********************************************************************************/
+
+void free_segment_list(struct segment **initial_segment, 
+             struct segment ***segments_ptr_vector)
+{
+  struct segment *aux_segment;
+  struct segment *next_segment;
+  struct segment_pixel *aux_pixel;
+  struct segment_pixel *next_pixel;
+
+  /* frees segment list */
+  aux_segment=*initial_segment;
+  while (aux_segment!=NULL)
+  {
+    /* frees pixels lists */
+    aux_pixel = aux_segment->pixel_list;
+    while (aux_pixel!=NULL)
+    {
+      next_pixel = aux_pixel->next_pixel;
+      free(aux_pixel);
+      aux_pixel = next_pixel;
+    }
+    next_segment=aux_segment->next_original_segment;
+    free(aux_segment);
+    aux_segment=next_segment;
+  }
+  initial_segment=NULL;
+
+  /* frees segment vector */
+  if (segments_ptr_vector!=NULL)
+  {
+    free(*segments_ptr_vector);
+    *segments_ptr_vector=NULL;
+  }
+}
+
+/**********************************************************************************/
+/* function reset_unused_segments_list: mark all segments as unused                */
+/**********************************************************************************/
+
+void reset_unused_segments_list(unsigned long int num_segments, 
+                 struct segment *first_segment)
+{
+  unsigned long int i;
+  struct segment *aux_segment;
+
+  aux_segment = first_segment;
+
+  /* mark all segments as unused */
+  for (i=0; i<num_segments; i++)
+  {
+    aux_segment->used = false;
+    aux_segment = aux_segment->next_segment;
+  }
+}
+
+/**********************************************************************************/
+/* function write_segments: write output image                                    */
+/**********************************************************************************/
+
+void write_segments(// float **input_image, 
+          TePDITypes::TePDIRasterPtrType output_image,
+          struct segment *first_segment, 
+          int write_type,
+          bool progress_enabled_)
+{
+  int color[NUM_BANDS];
+  struct segment_pixel *aux_pixel;
+  struct segment *aux_segment;
+  long  ncols = output_image->params().ncols_,
+      nrows = output_image->params().nlines_,
+    col, row;
+
+  /* searches for first segment with a pixel list */
+  aux_segment = first_segment;
+  while (aux_segment->pixel_list==NULL)
+  {
+    aux_segment = aux_segment->next_original_segment;
+  }
+
+  /* for each segment */
+  TePDIPIManager pim("Writing segments", nrows * ncols, progress_enabled_);
+  long pixel_id = 1;
+  while (aux_segment!=NULL)
+  {
+    /* define segment color */
+    switch (write_type)
+    {
+      case 0: /* random colors */
+        color[0] = pixel_id++; //(int) floor(ranval(0, 256));
+        //color[1] = (int) floor(ranval(0, 256));
+        //color[2] = (int) floor(ranval(0, 256));
+        break;
+      case 3: /* encoded segment id */
+        color[0] = (int) floor((double)aux_segment->id / 256.0);
+        //color[1] = ((int) aux_segment->id) % 256;
+        //color[2] = 0;
+        break;
+      default: /* average colors */
+        color[0] = (int) floor(aux_segment->avg_color[0]);
+        //color[1] = (int) floor(aux_segment->avg_color[1]);
+        //color[2] = (int) floor(aux_segment->avg_color[2]);
+        break;      
+    }
+
+    /* for each pixel of the segment */
+    aux_pixel = aux_segment->pixel_list;
+    while (aux_pixel!=NULL)
+    {
+   convert_pixel_id(aux_pixel->pixel_id, ncols, &row, &col);
+   output_image->setElement(col, row, color[0]);
+   // input_image[0][aux_pixel->pixel_id] = (unsigned char) color[0];
+     //input_image[1][aux_pixel->pixel_id] = (unsigned char) color[1];
+     //input_image[2][aux_pixel->pixel_id] = (unsigned char) color[2];
+     if (aux_pixel->borderline)
+      {
+        if (write_type==2)
+        {
+      convert_pixel_id(aux_pixel->pixel_id, ncols, &row, &col);
+      output_image->setElement(col, row, OUTLINE_COLOR_0);
+          // input_image[0][aux_pixel->pixel_id] = (unsigned char) OUTLINE_COLOR_0;
+          //input_image[1][aux_pixel->pixel_id] = (unsigned char) OUTLINE_COLOR_1;
+          //input_image[2][aux_pixel->pixel_id] = (unsigned char) OUTLINE_COLOR_2;
+        }
+        if (write_type==3)
+        {
+          //input_image[2][aux_pixel->pixel_id] = (unsigned char) 255;
+        }
+      }
+      aux_pixel = aux_pixel->next_pixel;
+    }
+    aux_segment=aux_segment->next_segment;
+  pim.Increment();
+  }
+  pim.Toggle(false);
+}
+
+/**********************************************************************************/
+/* function segmentation: performs the region growing segmentation                */
+/**********************************************************************************/
+
+float segmentation(//float **input_image, 
+           struct segment **segments_ptr_vector, 
+           struct segment *initial_segment, 
+           struct segment *final_segment, 
+           long int nrows, 
+           long int ncols, 
+           struct segmentation_parameters parameters,
+           bool progress_enabled_)
+{
+  int curr_step;
+  bool no_merges_prev_step = false;
+  float spectral_h, spatial_h;
+  float spectral_f, spatial_f;
+  float min_fusion_f, fusion_f, ssp;
+  long int num_segments, num_segments_unused;
+  unsigned long int num_pixels;
+  int dither_bits;
+  unsigned long int num_dither_cells, dither_cell_count;
+  struct segment *first_original_segment; /* first segment in segment list */
+  struct segment *first_segment; /* first not deleted segment in segment list */
+  struct segment *last_segment; /* last not deleted segment in segment list */
+  struct segment *curr_segment; /* current segment */
+  struct segment_neighbor *curr_neighbor; /* current neighbor */
+  struct segment_neighbor *first_neighbor; /* root of neighbor segment list */
+  struct segment_neighbor *best_neighbor = 0; /* lowest fusion factor to current segment */
+
+  /* initializes variables */
+  num_segments = num_pixels = nrows * ncols;
+  first_segment = initial_segment;
+  first_original_segment = initial_segment;
+  last_segment = final_segment;
+ 
+  /* square of scale parameter */
+  ssp = parameters.sp*parameters.sp;
+
+  /* calculate dimensions of dither matrix */
+  num_dither_cells = dither_matrix_dimension(nrows, ncols, &dither_bits);
+
+  curr_step = 0;
+
+  /* segmentation step */
+  TePDIPIManager pim("Segmenting image", MAX_STEPS, progress_enabled_);
+  while ((curr_step<MAX_STEPS) && (no_merges_prev_step!=true))
+  {
+    /* flag that indicates if there were merges in the step */
+    no_merges_prev_step = true;
+
+    /* mark all segments as not used */
+    num_segments_unused = num_segments;
+
+    /* initialize cell count for dither search */
+  dither_cell_count = 0;
+
+  /* while there are segments not used (num_segments_unused>0)*/
+    while (num_segments_unused>0)
+    {
+      /* select one segment and mark that segment as used */
+      curr_segment = find_unused_by_dither(segments_ptr_vector, 
+      dither_bits, nrows, ncols, &dither_cell_count);
+    dither_cell_count++;
+    
+    curr_segment->used = true;
+      num_segments_unused--;
+
+      first_neighbor = curr_neighbor = NULL;
+
+      /* find segment neighbors */
+      first_neighbor = find_neighbors(curr_segment, segments_ptr_vector, nrows, ncols);
+      curr_neighbor = first_neighbor;
+
+      /* calculate heterogeinity factors for each neighbor */
+      min_fusion_f =  (float) MAX_FLT;
+      while (curr_neighbor != NULL)
+      {
+        /* calculates spectral heterogeneity */
+        spectral_h = calc_color_stats(curr_neighbor, curr_segment, /* input_image, */ parameters);
+    spectral_f = parameters.wcolor * spectral_h;
+
+        if (spectral_f<ssp)
+    {
+      /* calculates spatial heterogeneity */
+      spatial_h = calc_spatial_stats(curr_neighbor, curr_segment, 
+        segments_ptr_vector, nrows, ncols, parameters);
+      spatial_f = (1-parameters.wcolor) * spatial_h;
+
+      /* calculates fusion factor and identify best neighbor */
+      fusion_f = spectral_f + spatial_f;
+      if (fusion_f<min_fusion_f)
+      {
+        min_fusion_f = fusion_f;
+        best_neighbor = curr_neighbor;  
+      }
+    }
+        curr_neighbor = curr_neighbor->next_neighbor; 
+      }
+
+      /* checks if merge of current segment with best neighbor is possible */
+      if (min_fusion_f<ssp)
+      {
+        /* merges current segment with best neighbor and removes best neighbor */
+        num_segments_unused = num_segments_unused - 
+      merge_segment(best_neighbor, curr_segment, &first_segment, &last_segment, 
+          segments_ptr_vector, nrows, ncols);
+        num_segments--;
+        no_merges_prev_step = false;
+      }
+      free_neighbor_list(&first_neighbor);
+    }
+    reset_unused_segments_list(num_segments, first_segment);
+    
+  curr_step++;
+  pim.Increment();
+    
+  }
+  return(1.0);
+}
+
+/**********************************************************************************/
+/* function calc_perimeter_optimized: calculates the perimeter of merging         */
+/*                         of curr_segment and curr_neighbor                      */
+/**********************************************************************************/
+
+void calc_perimeter_optimized(struct segment_neighbor *curr_neighbor, 
+          struct segment *curr_segment, 
+          struct segment **segments_ptr_vector, 
+          long int nrows, 
+          long int ncols)
+{
+  int i;
+  long int perimeter_total;
+  long int neighbor_pixel[4][2]; /* first col contain pixel id, second contains segment id */
+  struct segment_pixel *aux_pixel;
+  struct segment_pixel *id_nb;
+  struct segment *aux_segment; 
+
+	//optimization: perimeter total is the sum of perimeters less the points of colision between them
+	
+	//sum perimeters
+	perimeter_total = curr_segment->perimeter + curr_neighbor->neighbor->perimeter;
+
+	//choose segment with less perimeter
+	if ( curr_segment->perimeter <= curr_neighbor->neighbor->perimeter )
+	{
+    aux_pixel = curr_segment->pixel_list;
+    id_nb = curr_neighbor->neighbor->pixel_list;
+	}
+	else
+	{
+    aux_pixel = curr_neighbor->neighbor->pixel_list;
+    id_nb = curr_segment->pixel_list;
+	}
+
+  // for each pixel from the less perimeter segment
+  while ( aux_pixel != NULL )
+  {
+		// just for borderline
+		if ( aux_pixel->borderline == true )
+		{
+			find_neighbor_pixels( aux_pixel->pixel_id, nrows, ncols, 
+				                    &neighbor_pixel[ 0 ][ 0 ], &neighbor_pixel[ 1 ][ 0 ], 
+                            &neighbor_pixel[ 2 ][ 0 ], &neighbor_pixel[ 3 ][ 0 ] );
+
+			//verify the neighbor pixels
+			for ( i = 0; i < 4; i++ )
+			{
+			  if ( neighbor_pixel[i][0] != -1 ) // if it is not image limit 
+			  {
+          aux_segment = segments_ptr_vector[ neighbor_pixel[ i ][ 0 ] ];
+          neighbor_pixel[i][1] = aux_segment->id;
+
+          if ( neighbor_pixel[ i ][ 1 ] == (long int)id_nb->pixel_id ) //if the pixel neighbor is from grater perimeter segment
+            perimeter_total = perimeter_total - 2;
+			  }
+			}
+		}
+    aux_pixel = aux_pixel->next_pixel;
+  }
+
+  curr_neighbor->perimeter = perimeter_total;
+}
diff --git a/src/terralib/image_processing/TePDIBaatz.hpp b/src/terralib/image_processing/TePDIBaatz.hpp
index 1f49b0d..73d935e 100644
--- a/src/terralib/image_processing/TePDIBaatz.hpp
+++ b/src/terralib/image_processing/TePDIBaatz.hpp
@@ -1,221 +1,233 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIBAATZ_HPP
-  #define TEPDIBAATZ_HPP
-
-  // Internal defines
-  #define MAX_STEPS 20 /* maximum number of segmentation steps */
-  #define NUM_BANDS 10 /* number of image bands */
-  #define POSITION_SEARCH 0.00 /* minimum percentage of unused segments for segment selection by pixel position */
-  #define OUTLINE_COLOR_0 255 /* segments' outline color for output image */
-  #define OUTLINE_COLOR_1 000
-  #define OUTLINE_COLOR_2 000
-
-  // TerraLib includes
-  #include "TePDIAlgorithm.hpp"
-  #include <TePDITypes.hpp>
-  #include <TePDIPIManager.hpp>
-  #include <TePDIUtils.hpp>
-  #include <TeSharedPtr.h>
-
-  /**
-    * @brief This is the class models an image segmentation process. 
-    * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
-    * @author Gilson Costa <gilson at ele.puc-rio.br>
-    * @ingroup TePDISegmentationGroup
-    *
-    * Region Growing Segmentation, Baatz implementation
-    *
-    * @note The general required parameters :
-    *
-    * @param input_image (TePDITypes::TePDIRasterPtrType)
-    * @param input_weights (vector<float>) one weight for each input image channel
-    * @param input_bands (vector<unsigned>) used bands for input image
-    * @param scale (float) Parameter scale is > 0
-    * @param compactness (float) Parameter compactness is > 0 and <= 1
-    * @param color (float) Parameter color is > 0 and <= 1
-    * @param output_image (TePDITypes::TePDIRasterPtrType)
-    *
-    */
-
-/**********************************************************************************/
-/* TerraLib main class for Baatz Segmentation                                     */
-/**********************************************************************************/
-
-  class PDI_DLL TePDIBaatz : public TePDIAlgorithm {
-    public :
-      
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIBaatz();
-
-      /**
-       * @brief Default Destructor
-       */
-	  ~TePDIBaatz() {};
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of 
-       * each PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;      
-
-  protected:    
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& );    
-     
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-      
-  };
-  
-/** @example TePDISegmentation_test.cpp
- *    Shows how to use this class.
- */    
-
-
-/**********************************************************************************/
-/* Internal definitions Baatz Segmentation                                        */
-/**********************************************************************************/
-
-/**********************************************************************************/
-/* type definitions                                                               */
-/**********************************************************************************/
-
-/* node of list of segments' pixels */
-struct segment_pixel 
-{
-  unsigned long int pixel_id; /* pixel id */
-  bool borderline; /* indicates if the pixel belongs to the border of the segment */
-  struct segment_pixel *next_pixel; /* next pixel */
-};
-
-/* node of segment list */
-struct segment 
-{
-  unsigned long int id; /* segment id */
-  float area; /* number of pixels in segment */
-  float perimeter; /*number of border pixels */
-  float b_box[4]; /* bounding box of the segment, relative to rows and cols */
-  float avg_color[NUM_BANDS]; /* average colors of pixels, one for each band */
-  float std_color[NUM_BANDS]; /* std of pixel colors, one for each band */
-  float avg_color_square[NUM_BANDS];
-  float color_sum[NUM_BANDS];
-  int used; /* indicate if segment has been used in segmentation step */
-  struct segment_pixel *pixel_list; /* list of indexes of the segment's pixels */
-  struct segment_pixel *last_pixel; /* pointer to the last pixel in the pixel list */
-  struct segment_pixel *original_pixel; /* pointer to original pixel of the segment */
-  struct segment *previous_segment; /* previous not deleted segment */
-  struct segment *next_segment; /* next not deleted segment */
-  struct segment *previous_unused_segment; /* previous unused segment */
-  struct segment *next_unused_segment; /* next unused segment */
-  struct segment *next_original_segment; /* next original segment */
-};
-
-/* node of segments' neighbours */
-struct segment_neighbor 
-{
-  float area; /* number of pixels in merged segment, neighbour plus original */
-  float perimeter; /*number of border pixels in merged segment, neighbour plus original */
-  float b_box[4]; /* bounding box of the segment of merged segment, neighbour plus original */
-  float avg_color[NUM_BANDS]; /* average colors of pixels of merged segment, one for each band */
-  float std_color[NUM_BANDS]; /* std of pixel colors of merged segment, one for each band */
-  float avg_color_square[NUM_BANDS];
-  float color_sum[NUM_BANDS];
-  unsigned long int neighbor_id; /* id of neighbor segment */
-  struct segment *neighbor; /* neighbor segment */
-  struct segment_neighbor *next_neighbor; /* next neighbor */
-};
-
-/* record of segmentation parameters */
-struct segmentation_parameters 
-{
-  float sp; /* scale parameter */
-  float wband[NUM_BANDS]; /* weight of image bands, between 0 and 1 */
-  float wcolor; /* factor of color/shape, between 0 and 1 */
-  float wcmpt; /* factor of compactness/smothness, between 0 and 1 */
-  int bands; /* number of bands */
-};
-
-/**********************************************************************************/
-/* function prototypes                                                            */
-/**********************************************************************************/
-
-/* returns random number between low and high */
-float randval(float low, 
-        float high); 
-
-/* read parameter file */
-int read_seg_parameters(char *parameter_file_name,
-            struct segmentation_parameters *parameters); 
-
-/* creates one segment for each pixel of input image */
-int initialize_segments(struct segment ***segments_ptr_vector, 
-            struct segment **first_segment, 
-            struct segment **last_segment, 
-            // float **input_image, 
-            TePDITypes::TePDIRasterPtrType input_image,
-            vector<unsigned> input_bands, 
-            long int nrows, 
-            long int ncols,
-            bool progress_enabled_);  
-
-/* performs the segmentation, returns (num.segments + segmentation steps/100) */
-float segmentation(// float **input_image, 
-           struct segment **segments_ptr_vector, 
-           struct segment *initial_segment, 
-           struct segment *final_segment, 
-           long int nrows, 
-           long int ncols, 
-           struct segmentation_parameters parameters,
-           bool progress_enabled_); 
-
-/* write output image */
-void write_segments(// float **input_image, 
-          TePDITypes::TePDIRasterPtrType output_image,
-          struct segment *initial_segment, 
-          int write_type,
-          bool progress_enabled_); 
-
-/* remove segments from memory */
-void free_segment_list(struct segment **initial_segment, 
-             struct segment ***segments_ptr_vector);
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIBAATZ_HPP
+  #define TEPDIBAATZ_HPP
+
+  // Internal defines
+  #define MAX_STEPS 20 /* maximum number of segmentation steps */
+  #define NUM_BANDS 10 /* number of image bands */
+  #define POSITION_SEARCH 0.00 /* minimum percentage of unused segments for segment selection by pixel position */
+  #define OUTLINE_COLOR_0 255 /* segments' outline color for output image */
+  #define OUTLINE_COLOR_1 000
+  #define OUTLINE_COLOR_2 000
+
+  // TerraLib includes
+  #include "TePDIAlgorithm.hpp"
+  #include <TePDITypes.hpp>
+  #include <TePDIPIManager.hpp>
+  #include <TePDIUtils.hpp>
+  #include <TeSharedPtr.h>
+
+  /**
+    * @brief Region Growing Segmentation, Baatz implementation.
+    * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
+    * @author Gilson Costa <gilson at ele.puc-rio.br>
+    * @ingroup TePDISegmentationGroup
+    *
+    * @note Reference: Baatz, M.; Schape, A. Multiresolution segmentation: an 
+    * optimization approach for high quality multi-scale image segmentation. 
+    * In: XII Angewandte Geographische Informationsverarbeitung, 
+    * Wichmann-Verlag, Heidelberg, 2000.
+    *
+    * @note The general required parameters :
+    *
+    * @param input_image (TePDITypes::TePDIRasterPtrType)
+    * @param input_weights (vector<float>) one weight for each input image channel
+    * @param input_channels (vector<unsigned>) used channels for input image
+    * @param scale (float) Parameter scale is > 0 (Has direct influence
+    * over the generated segments size).
+    * @param compactness (float) Parameter compactness is > 0 and <= 1 (
+    compactness = perimeter / sqrt( area ) ).
+    * @param color (float) Parameter color is > 0 and <= 1 (the relative ratio
+    * between spacial components and spectral components).
+    * @param output_image (TePDITypes::TePDIRasterPtrType) - Output raster
+    * pointer.
+    *
+    * @note The optional parameters (will be used only if present):
+    *
+    * @param output_polsets (TePDITypes::TePDIPolSetMapPtrType) - 
+    * A pointer to the output polygon sets map.
+    *
+    */
+
+/**********************************************************************************/
+/* TerraLib main class for Baatz Segmentation                                     */
+/**********************************************************************************/
+
+  class PDI_DLL TePDIBaatz : public TePDIAlgorithm {
+    public :
+      
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIBaatz();
+
+      /**
+       * @brief Default Destructor
+       */
+	  ~TePDIBaatz() {};
+      
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of 
+       * each PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;      
+
+  protected:    
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& );    
+     
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+      
+  };
+  
+/** @example TePDISegmentation_test.cpp
+ *    Shows how to use this class.
+ */    
+
+
+/**********************************************************************************/
+/* Internal definitions Baatz Segmentation                                        */
+/**********************************************************************************/
+
+/**********************************************************************************/
+/* type definitions                                                               */
+/**********************************************************************************/
+
+/* node of list of segments' pixels */
+struct segment_pixel 
+{
+  unsigned long int pixel_id; /* pixel id */
+  bool borderline; /* indicates if the pixel belongs to the border of the segment */
+  struct segment_pixel *next_pixel; /* next pixel */
+};
+
+/* node of segment list */
+struct segment 
+{
+  unsigned long int id; /* segment id */
+  float area; /* number of pixels in segment */
+  float perimeter; /*number of border pixels */
+  float b_box[4]; /* bounding box of the segment, relative to rows and cols */
+  float avg_color[NUM_BANDS]; /* average colors of pixels, one for each band */
+  float std_color[NUM_BANDS]; /* std of pixel colors, one for each band */
+  float avg_color_square[NUM_BANDS];
+  float color_sum[NUM_BANDS];
+  int used; /* indicate if segment has been used in segmentation step */
+  struct segment_pixel *pixel_list; /* list of indexes of the segment's pixels */
+  struct segment_pixel *last_pixel; /* pointer to the last pixel in the pixel list */
+  struct segment_pixel *original_pixel; /* pointer to original pixel of the segment */
+  struct segment *previous_segment; /* previous not deleted segment */
+  struct segment *next_segment; /* next not deleted segment */
+  struct segment *previous_unused_segment; /* previous unused segment */
+  struct segment *next_unused_segment; /* next unused segment */
+  struct segment *next_original_segment; /* next original segment */
+};
+
+/* node of segments' neighbours */
+struct segment_neighbor 
+{
+  float area; /* number of pixels in merged segment, neighbour plus original */
+  float perimeter; /*number of border pixels in merged segment, neighbour plus original */
+  float b_box[4]; /* bounding box of the segment of merged segment, neighbour plus original */
+  float avg_color[NUM_BANDS]; /* average colors of pixels of merged segment, one for each band */
+  float std_color[NUM_BANDS]; /* std of pixel colors of merged segment, one for each band */
+  float avg_color_square[NUM_BANDS];
+  float color_sum[NUM_BANDS];
+  unsigned long int neighbor_id; /* id of neighbor segment */
+  struct segment *neighbor; /* neighbor segment */
+  struct segment_neighbor *next_neighbor; /* next neighbor */
+};
+
+/* record of segmentation parameters */
+struct segmentation_parameters 
+{
+  float sp; /* scale parameter */
+  float wband[NUM_BANDS]; /* weight of image bands, between 0 and 1 */
+  float wcolor; /* factor of color/shape, between 0 and 1 */
+  float wcmpt; /* factor of compactness/smothness, between 0 and 1 */
+  int bands; /* number of bands */
+};
+
+/**********************************************************************************/
+/* function prototypes                                                            */
+/**********************************************************************************/
+
+/* returns random number between low and high */
+float randval(float low, 
+        float high); 
+
+/* read parameter file */
+int read_seg_parameters(char *parameter_file_name,
+            struct segmentation_parameters *parameters); 
+
+/* creates one segment for each pixel of input image */
+int initialize_segments(struct segment ***segments_ptr_vector, 
+            struct segment **first_segment, 
+            struct segment **last_segment, 
+            // float **input_image, 
+            TePDITypes::TePDIRasterPtrType input_image,
+            vector<unsigned> input_channels, 
+            long int nrows, 
+            long int ncols,
+            bool progress_enabled_);  
+
+/* performs the segmentation, returns (num.segments + segmentation steps/100) */
+float segmentation(// float **input_image, 
+           struct segment **segments_ptr_vector, 
+           struct segment *initial_segment, 
+           struct segment *final_segment, 
+           long int nrows, 
+           long int ncols, 
+           struct segmentation_parameters parameters,
+           bool progress_enabled_); 
+
+/* write output image */
+void write_segments(// float **input_image, 
+          TePDITypes::TePDIRasterPtrType output_image,
+          struct segment *initial_segment, 
+          int write_type,
+          bool progress_enabled_); 
+
+/* remove segments from memory */
+void free_segment_list(struct segment **initial_segment, 
+             struct segment ***segments_ptr_vector);
+
+#endif
diff --git a/src/terralib/image_processing/TePDIBatchGeoMosaic.cpp b/src/terralib/image_processing/TePDIBatchGeoMosaic.cpp
old mode 100755
new mode 100644
index 4a1606e..0e0e295
--- a/src/terralib/image_processing/TePDIBatchGeoMosaic.cpp
+++ b/src/terralib/image_processing/TePDIBatchGeoMosaic.cpp
@@ -1,414 +1,563 @@
-#include "TePDIBatchGeoMosaic.hpp"
-#include "TePDIGeoMosaic.hpp"
-#include "TePDIUtils.hpp"
-#include <TeAgnostic.h>
-
-#include <TeVectorRemap.h>
-
-
-TePDIBatchGeoMosaic::TePDIBatchGeoMosaic()
-{
-}
-
-
-TePDIBatchGeoMosaic::~TePDIBatchGeoMosaic()
-{
-}
-
-
-void TePDIBatchGeoMosaic::ResetState( const TePDIParameters& )
-{
-}
-
-
-bool TePDIBatchGeoMosaic::CheckParameters( const TePDIParameters& parameters ) const
-{
-  unsigned int index = 0;
-
-  /* Checking input_rasters */
-  
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_rasters", 
-    input_rasters ),
-    "Missing parameter: input_rasters" );
-  TEAGN_TRUE_OR_RETURN( ( input_rasters.size() > 1 ),
-    "Invalid parameter: input_rasters" );
-    
-  for( index = 0 ; index < input_rasters.size() ; ++index ) {
-    TEAGN_TRUE_OR_RETURN( input_rasters[ index ].isActive(),
-      "Invalid parameter: input_rasters[" +  Te2String( index ) + 
-      "] inactive" );
-      
-    TEAGN_TRUE_OR_RETURN( input_rasters[ index ]->params().status_ != 
-      TeRasterParams::TeNotReady, "Invalid parameter: input_rasters[" +
-      Te2String( index ) + "] not ready" );
-      
-    TEAGN_TRUE_OR_RETURN( ( input_rasters[ index ]->params().projection() != 0 ),
-      "Missing input_rasters[" + Te2String( index ) + "] projection" );
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_rasters[ index ]->params().projection()->name() != "NoProjection" ),
-      "Invalid input_rasters[" + Te2String( index ) + "] projection" );        
-  }
-  
-  /* Checking output_raster */
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
-    output_raster ),
-    "Missing parameter: output_raster" );
-  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
-    "Invalid parameter: output_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );
-
-  /* Checking for blending type */
-  
-  std::string blending_type;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "blending_type", 
-    blending_type ), "Missing parameter: blending_type" );
-    
-  /* Checking bands */
-  
-  std::vector< int > bands;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "bands", 
-    bands ), "Missing parameter: bands" );
-  TEAGN_TRUE_OR_RETURN( ( bands.size() >= input_rasters.size() ),
-    "Invalid parameter: bands" );
-  TEAGN_TRUE_OR_RETURN( ( ( bands.size() % input_rasters.size() ) == 0 ),
-    "Invalid paramter: bands" );
-    
-  unsigned int bands_per_raster = bands.size() / input_rasters.size();
-    
-  for( unsigned int bands_index = 0 ; bands_index < bands.size() ; 
-    ++bands_index ) {
-    
-    unsigned int current_raster_index = (unsigned int) floor( 
-      ( (double)bands_index ) / ( (double)bands_per_raster ) );
-    TEAGN_TRUE_OR_RETURN( (
-      ( bands[ bands_index ] >= 0 ) &&
-      ( bands[ bands_index ] < input_rasters[ current_raster_index ]->nBands() 
-      ) ), "Invalid parameter: bands[" + Te2String( bands_index ) + "]" );
-  }
-    
-  return true;
-}
-
-
-bool TePDIBatchGeoMosaic::RunImplementation()
-{
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  params_.GetParameter( "input_rasters", input_rasters );
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params_.GetParameter( "output_raster", output_raster );
-  
-  std::vector< int > bands;
-  params_.GetParameter( "bands", bands );
-  
-  /* Dumyy value definition */
- 
-  const bool output_raster_uses_dummy = output_raster->params().useDummy_;
-  double output_raster_dummy = 0;
-  if( output_raster_uses_dummy ) {
-    output_raster_dummy = output_raster->params().dummy_[ 0 ];
-  }
-  
-  bool user_required_dummy = false;
-  double user_dummy = 0;
-  if( params_.CheckParameter< double >( "dummy_value" ) ) {
-    
-    params_.GetParameter( "dummy_value", user_dummy );
-    user_required_dummy = true;
-  }
-  
-  bool must_use_dummy = false;
-  double output_dummy_value = 0;
-  if( user_required_dummy ) {
-    must_use_dummy = true;
-    output_dummy_value = user_dummy;
-  } else if( output_raster_uses_dummy ) {
-    must_use_dummy = true;
-    output_dummy_value = output_raster_dummy;
-  }  
-  
-  /* Building a internal rasters list */
-  
-  std::list< TePDITypes::TePDIRasterPtrType > rasters_list;
-  
-  for( unsigned int index = 0 ; index < input_rasters.size() ; ++index ) {
-    rasters_list.push_back( input_rasters[ index ] );
-  }
-  
-  /* Processing each pair of rasters */
-  
-  TePDITypes::TePDIRasterPtrType result_raster; 
-    /* The final raster will be pointed by this */
-  
-  while( rasters_list.size() > 0 ) {
-    TePDITypes::TePDIRasterPtrType current_input_raster1;
-    TePDITypes::TePDIRasterPtrType current_input_raster2;
-    
-    std::vector< int > channels1;
-    std::vector< int > channels2;
-   
-    if( rasters_list.size() == input_rasters.size() ) {
-      TePDITypes::TePDIRasterPtrType found_raster1;
-      TePDITypes::TePDIRasterPtrType found_raster2;
-        
-      FindClosestRasters( rasters_list, found_raster1, found_raster2 );
-        
-      current_input_raster1 = found_raster1;
-      current_input_raster2 = found_raster2;
-      
-      findRastersChannels( current_input_raster1, params_, channels1 );
-      findRastersChannels( current_input_raster2, params_, channels2 );
-      
-      rasters_list.remove( found_raster1 );
-      rasters_list.remove( found_raster2 );
-    } else {
-      TePDITypes::TePDIRasterPtrType found_raster;
-        
-      FindClosestRaster( rasters_list, 
-        result_raster->params().box(),
-        result_raster->params().projection(),
-        found_raster );
-        
-      current_input_raster1 = result_raster;
-      current_input_raster2 = found_raster;
-      
-      /* building the channels list for the input mosaic */
-      
-      channels1.clear();
-        
-      for( int channels1_index = 0 ; 
-        channels1_index < result_raster->nBands() ; ++channels1_index ) {
-        
-        channels1.push_back( channels1_index );
-      }
-      
-      /* Retriving the channels vector for the new input rasters */      
-      
-      findRastersChannels( current_input_raster2, params_, channels2 );
-      
-      /* done */
-      
-      rasters_list.remove( found_raster );
-    }
-    
-    /* Guessing the output data type */
-    
-    TeDataType output_datatype = TeUNSIGNEDCHAR;
-    {
-      double r1_min = 0;
-      double r1_max = 0;
-      double r2_min = 0;
-      double r2_max = 0;
-
-      TePDIUtils::TeGetRasterMinMaxBounds( current_input_raster1, 0, r1_min,
-        r1_max );
-      TePDIUtils::TeGetRasterMinMaxBounds( current_input_raster2, 0, r2_min,
-        r2_max );
-        
-      if( ( r2_min < r1_min ) || ( r2_max > r1_max ) ) {
-        output_datatype = current_input_raster2->params().dataType_[ 0 ];
-      } else {
-        output_datatype = current_input_raster1->params().dataType_[ 0 ];
-      }
-    }
-    
-    /* Setting the output raster */
-    
-    TePDITypes::TePDIRasterPtrType current_output_raster;
-    
-    if( rasters_list.size() == 0 ) {
-      /* writing directly to the output raster */
-      
-      current_output_raster = output_raster;
-    } else {
-      /* writing to a internal buffered raster */
-      
-      TeRasterParams current_output_raster_params;
-      current_output_raster_params.nBands( 1 );
-      current_output_raster_params.nlines_ = 10;
-      current_output_raster_params.ncols_ = 10;
-      current_output_raster_params.dataType_[ 0 ] = output_datatype;
-      current_output_raster_params.setDummy( output_dummy_value, -1 );
-      if( must_use_dummy ) {
-        current_output_raster_params.useDummy_ = true;
-      } else {
-        current_output_raster_params.useDummy_ = false;
-      }
-      current_output_raster_params.setPhotometric( TeRasterParams::TeMultiBand,
-        -1 );
-        
-      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( 
-        current_output_raster, current_output_raster_params, 
-        TePDIUtils::TePDIUtilsAutoMemPol ), 
-        "Unable to allocate temporary mem raster" );
-    }
-    
-    /* Building geomosaic parameters */
-    
-    TePDIParameters geo_mos_params = params_;
-    geo_mos_params.SetParameter( "mosaic_type", std::string( "geo_mosaic" ) );  
-    geo_mos_params.SetParameter( "input_raster1", current_input_raster1 );
-    geo_mos_params.SetParameter( "input_raster2", current_input_raster2 );
-    geo_mos_params.SetParameter( "output_raster", current_output_raster );
-    geo_mos_params.SetParameter( "keep_best_res", (int)1 );
-    geo_mos_params.SetParameter( "channels1", channels1 );
-    geo_mos_params.SetParameter( "channels2", channels2 );
-          
-    TePDIGeoMosaic geo_mos_instance;
-    
-    TEAGN_TRUE_OR_RETURN( geo_mos_instance.Reset( geo_mos_params ), 
-      "Geo-mosaic instance reset error" );
-      
-    TEAGN_TRUE_OR_RETURN( geo_mos_instance.Apply(),
-      "Unable to apply geographic mosaic strategy" );
-      
-    result_raster = current_output_raster;
-  } /* while */        
-  
-  return true;
-}
-
-
-void TePDIBatchGeoMosaic::FindClosestRaster( 
-  std::list< TePDITypes::TePDIRasterPtrType >& input_rasters,
-  const TeBox& reference_raster_box,
-  TeProjection* reference_raster_projection,
-  TePDITypes::TePDIRasterPtrType& closest_raster )
-{
-  TEAGN_TRUE_OR_THROW( ( input_rasters.size() > 0 ), 
-    "input_rasters.size() < 1" );
-  TEAGN_TRUE_OR_THROW( ( reference_raster_projection != 0 ),
-    "Invalid reference_raster_projection" );
-  
-  std::list< TePDITypes::TePDIRasterPtrType >::iterator it = 
-    input_rasters.begin();
-  
-  double best_distance = 0;
-  bool first_best_distance_found = false;
-  
-  double current_distance = 0;
-  TeBox current_box;
-  TeBox remapped_box;
-  
-  while( it != input_rasters.end() ) {
-    current_box = (*it)->params().box();
-    remapped_box = TeRemapBox( current_box,
-      (*it)->params().projection(),
-      reference_raster_projection );
-    
-    if( first_best_distance_found ) {
-      current_distance = 
-        TeDistance( remapped_box.center(), 
-        reference_raster_box.center() );
-          
-      if( current_distance < best_distance ) {
-        best_distance = current_distance;
-        closest_raster = *it;
-      }
-    } else {
-      best_distance = 
-        TeDistance( remapped_box.center(), 
-        reference_raster_box.center() );
-      
-      first_best_distance_found = true;
-      closest_raster = *it;
-    }  
-    
-    ++it;
-  }
-  
-  TEAGN_DEBUG_CONDITION( first_best_distance_found, "Best distance not found" );
-}
-
-void TePDIBatchGeoMosaic::FindClosestRasters( 
-  std::list< TePDITypes::TePDIRasterPtrType >& input_rasters,
-  TePDITypes::TePDIRasterPtrType& raster1,
-  TePDITypes::TePDIRasterPtrType& raster2 )
-{
-  TEAGN_TRUE_OR_THROW( ( input_rasters.size() > 1 ), 
-    "input_rasters.size() < 2" );
-    
-  double best_distance = 0;
-  bool best_distance_found = false;
-  double current_distance = 0;
-  TeBox current_box;
-  TeBox closest_raster_box;
-  TeBox closest_raster_box_reproj;
-  TePDITypes::TePDIRasterPtrType current_raster;
-  TePDITypes::TePDIRasterPtrType closest_raster;
-  std::list< TePDITypes::TePDIRasterPtrType > input_rasters_copy;
-  std::list< TePDITypes::TePDIRasterPtrType >::iterator input_rasters_it = 
-    input_rasters.begin();
-  
-  while( input_rasters_it != input_rasters.end() ) {
-    current_raster = *input_rasters_it;
-    current_box = current_raster->params().box();
-    
-    input_rasters_copy = input_rasters;
-    input_rasters_copy.remove( current_raster );
-    
-    FindClosestRaster( input_rasters_copy, current_box, 
-      current_raster->params().projection(),
-      closest_raster );
-      
-    closest_raster_box = closest_raster->params().box();  
-    closest_raster_box_reproj = TeRemapBox( closest_raster_box,
-      closest_raster->projection(), current_raster->projection() );
-    
-    current_distance = TeDistance( current_box.center(), 
-      closest_raster_box_reproj.center() );
-      
-    if( best_distance_found ) {
-      if( current_distance < best_distance ) {
-        best_distance = current_distance;
-        raster1 = current_raster;
-        raster2 = closest_raster;
-      }
-    } else {
-      best_distance = current_distance;
-      raster1 = current_raster;
-      raster2 = closest_raster;
-    }
-    
-    ++input_rasters_it;
-  }  
-}
-
-
-void TePDIBatchGeoMosaic::findRastersChannels( 
-  const TePDITypes::TePDIRasterPtrType& raster_ptr, 
-  const TePDIParameters& params,
-  std::vector< int >& channels )
-{
-  channels.clear();
-  
-  std::vector< int > bands;
-  TEAGN_TRUE_OR_THROW( params.GetParameter( "bands", bands ),
-    "Unable to extract parameter: bands" );
-    
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  TEAGN_TRUE_OR_THROW( params.GetParameter( "input_rasters", input_rasters ),
-    "Unable to extract parameter: input_rasters" );
-    
-  unsigned int bands_per_raster = bands.size() / input_rasters.size();
-  
-  for( unsigned int rasters_index = 0 ; rasters_index < input_rasters.size() ;
-    ++rasters_index ) {
-    if( input_rasters[ rasters_index ] == raster_ptr ) {
-      unsigned int bands_start_index = ( rasters_index * bands_per_raster );
-      
-      for( unsigned int offset = 0 ; offset < bands_per_raster ; ++offset ) {
-        channels.push_back(  bands[ bands_start_index + offset ] );
-      }
-      
-      return;
-    }
-  }
-  
-  TEAGN_LOG_AND_THROW( "Unable to find the required rasters bands" );
-}
+#include "TePDIBatchGeoMosaic.hpp"
+
+#include "TePDIGeoMosaic.hpp"
+#include "TePDIUtils.hpp"
+#include "TePDIBlender.hpp"
+
+#include <TeAgnostic.h>
+#include <TeVectorRemap.h>
+#include <TeOverlay.h>
+
+TePDIBatchGeoMosaic::RastersListNodeT::RastersListNodeT()
+{
+}
+
+TePDIBatchGeoMosaic::RastersListNodeT::~RastersListNodeT()
+{
+}
+
+const TePDIBatchGeoMosaic::RastersListNodeT& 
+TePDIBatchGeoMosaic::RastersListNodeT::operator=( const RastersListNodeT& 
+  other )
+{
+  rasterPtr_ = other.rasterPtr_;
+  
+  dataPolygonRefProj_.clear();
+  dataPolygonRefProj_.copyElements( other.dataPolygonRefProj_ );
+  
+  dataPolygonRaProj_.clear();
+  dataPolygonRaProj_.copyElements( other.dataPolygonRaProj_ );  
+  
+  channelsVec_ = other.channelsVec_;
+  
+  return *this;
+}
+
+TePDIBatchGeoMosaic::TePDIBatchGeoMosaic()
+{
+}
+
+
+TePDIBatchGeoMosaic::~TePDIBatchGeoMosaic()
+{
+}
+
+
+void TePDIBatchGeoMosaic::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDIBatchGeoMosaic::CheckParameters( const TePDIParameters& parameters ) const
+{
+  unsigned int index = 0;
+
+  /* Checking input_rasters */
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_rasters", 
+    input_rasters ),
+    "Missing parameter: input_rasters" );
+  TEAGN_TRUE_OR_RETURN( ( input_rasters.size() > 1 ),
+    "Invalid parameter: input_rasters" );
+    
+  for( index = 0 ; index < input_rasters.size() ; ++index ) {
+    TEAGN_TRUE_OR_RETURN( input_rasters[ index ].isActive(),
+      "Invalid parameter: input_rasters[" +  Te2String( index ) + 
+      "] inactive" );
+      
+    TEAGN_TRUE_OR_RETURN( input_rasters[ index ]->params().status_ != 
+      TeRasterParams::TeNotReady, "Invalid parameter: input_rasters[" +
+      Te2String( index ) + "] not ready" );
+      
+    TEAGN_TRUE_OR_RETURN( ( input_rasters[ index ]->params().projection() != 0 ),
+      "Missing input_rasters[" + Te2String( index ) + "] projection" );
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_rasters[ index ]->params().projection()->name() != "NoProjection" ),
+      "Invalid input_rasters[" + Te2String( index ) + "] projection" );        
+  }
+  
+  /* Checking output_raster */
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
+    output_raster ),
+    "Missing parameter: output_raster" );
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
+    "Invalid parameter: output_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );
+    
+  /* Checking bands */
+  
+  std::vector< unsigned int > bands;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "bands", 
+    bands ), "Missing parameter: bands" );
+  TEAGN_TRUE_OR_RETURN( ( bands.size() >= input_rasters.size() ),
+    "Invalid parameter: bands" );
+  TEAGN_TRUE_OR_RETURN( ( ( bands.size() % input_rasters.size() ) == 0 ),
+    "Invalid paramter: bands" );
+    
+  unsigned int bands_per_raster = bands.size() / input_rasters.size();
+    
+  for( unsigned int bands_index = 0 ; bands_index < bands.size() ; 
+    ++bands_index ) {
+    
+    unsigned int current_raster_index = (unsigned int) floor( 
+      ( (double)bands_index ) / ( (double)bands_per_raster ) );
+    TEAGN_TRUE_OR_RETURN( (
+      ( (int)bands[ bands_index ] < input_rasters[ 
+      current_raster_index ]->nBands() ) ), 
+      "Invalid parameter: bands[" + Te2String( bands_index ) + "]" );
+  }
+    
+  return true;
+}
+
+
+bool TePDIBatchGeoMosaic::RunImplementation()
+{
+  // Extracting parameters
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  params_.GetParameter( "input_rasters", input_rasters );
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter( "output_raster", output_raster );
+  
+  std::vector< unsigned int > bands;
+  params_.GetParameter( "bands", bands );
+  
+  TePDIBlender::BlendMethod blend_method = TePDIBlender::NoBlendMethod;
+  if( params_.CheckParameter< TePDIBlender::BlendMethod >(
+    "blend_method" ) )
+  {
+    params_.GetParameter( "blend_method", blend_method );
+  }  
+    
+  TePDIInterpolator::InterpMethod interp_method = TePDIInterpolator::NNMethod;
+  if( params_.CheckParameter< TePDIInterpolator::InterpMethod >(
+    "interp_method" ) )
+  {
+    params_.GetParameter( "interp_method", interp_method );
+  }   
+   
+  bool auto_equalize = false;
+  if( params_.CheckParameter< int >( "auto_equalize" ) )
+  {
+    auto_equalize = true;
+  }   
+  
+  /* Dumyy value definition */
+ 
+  double dummy_value = 0;
+  if( params_.CheckParameter< double >( "dummy_value" ) ) 
+  {
+    params_.GetParameter( "dummy_value", dummy_value );
+  }
+  else if( output_raster->params().useDummy_ )
+  {
+    dummy_value = output_raster->params().dummy_[ 0 ];
+  }
+  
+  /* Building a internal rasters list */
+  
+  TeProjection* refProjPtr = getFreqProjection( input_rasters );
+  TEAGN_TRUE_OR_RETURN( refProjPtr, "Invalid reference projection pointer" );
+  
+  RastersListT rastersList;
+  TEAGN_TRUE_OR_RETURN( initRastersList( bands, input_rasters, refProjPtr,
+    rastersList ), "Error initializing rasters list" );
+  
+  /* Processing each pair of rasters... */
+  
+  RastersListNodeT inputNode1;
+  RastersListNodeT inputNode2;
+  RastersListNodeT outputNode;
+  TePDIGeoMosaic geo_mos_instance;
+  TePDIParameters geo_mos_params;
+  const unsigned int bandsPerRaster = bands.size() / input_rasters.size();
+  
+  while( rastersList.size() > 0 ) 
+  {
+    // Guessing input rasters 
+    
+    if( rastersList.size() == input_rasters.size() ) 
+    {
+      //The process starts choosing the two closest rasters to avid the
+      //creation of a intermediate mosaic result with disjoint
+      //rasters areas
+      
+      TEAGN_TRUE_OR_RETURN( extractClosestRastersNodes( rastersList,
+        inputNode1, inputNode2 ), "Internal processing error" );
+    } 
+    else
+    {
+      inputNode1 = outputNode;
+      
+      TEAGN_TRUE_OR_RETURN( extractCloserRasterNode( rastersList,
+        inputNode1, inputNode2 ), "Internal processing error" );
+    }
+    
+    // updating the output raster pointer
+    
+    if( rastersList.size() == 0 )
+    {
+      outputNode.rasterPtr_ = output_raster;
+    }    
+    else
+    {
+      TeRasterParams current_output_raster_params;
+      current_output_raster_params.setDataType( TeUNSIGNEDCHAR, -1 );
+      current_output_raster_params.setNLinesNColumns( 1, 1 );
+      current_output_raster_params.nBands( 1 );
+      current_output_raster_params.setDummy( dummy_value, -1 );
+      current_output_raster_params.setPhotometric( 
+        TeRasterParams::TeMultiBand, -1 );
+        
+      outputNode.rasterPtr_.reset();  
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( 
+        current_output_raster_params, outputNode.rasterPtr_ ), 
+        "Unable to allocate temporary mem raster" );
+    }
+    
+    /* Building geomosaic parameters */
+    
+    geo_mos_params.Clear();
+    geo_mos_params.SetParameter( "blend_method", blend_method );  
+    geo_mos_params.SetParameter( "input_raster1", inputNode1.rasterPtr_ );
+    geo_mos_params.SetParameter( "input_raster2", inputNode2.rasterPtr_ );
+    geo_mos_params.SetParameter( "output_raster", outputNode.rasterPtr_ );
+    geo_mos_params.SetParameter( "channels1", inputNode1.channelsVec_ );
+    geo_mos_params.SetParameter( "channels2", inputNode2.channelsVec_ );
+    geo_mos_params.SetParameter( "interp_method", interp_method );
+    geo_mos_params.SetParameter( "dummy_value", dummy_value );
+    if( auto_equalize )
+    {
+      geo_mos_params.SetParameter( "auto_equalize", (int)1 );
+    }    
+    geo_mos_params.SetParameter( "raster1_pol", 
+      inputNode1.dataPolygonRaProj_ );
+    geo_mos_params.SetParameter( "raster2_pol", 
+      inputNode2.dataPolygonRaProj_ );      
+    
+//TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff(
+//  inputNode1.rasterPtr_, "inputRaster1.tif" ),"" );
+//TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff(
+//  inputNode2.rasterPtr_, "inputRaster2.tif" ),"" );
+      
+    TEAGN_TRUE_OR_RETURN( geo_mos_instance.Apply( geo_mos_params ),
+      "Unable to apply geographic mosaic strategy" );
+      
+//TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff(
+//  outputNode.rasterPtr_, "outputRaster.tif" ),"" );
+      
+    TEAGN_DEBUG_CONDITION( outputNode.rasterPtr_->nBands() == 
+      (int)bandsPerRaster, "Invalid mosaic result" );
+      
+    // Updating the output node bands vector
+    
+    outputNode.channelsVec_.clear();
+    for( unsigned int cVIdx = 0 ; cVIdx < bandsPerRaster ; ++cVIdx )
+    {
+      outputNode.channelsVec_.push_back( cVIdx );
+    }
+    
+    // Updating the output node data polygons
+    
+    TePolygonSet r1PS;
+    r1PS.add( inputNode1.dataPolygonRefProj_ );
+    
+    TePolygonSet r2PS;
+    r2PS.add( inputNode2.dataPolygonRefProj_ );    
+    
+    TePolygonSet unionPS;
+    TEAGN_TRUE_OR_RETURN( TeOVERLAY::TeUnion( r1PS, r2PS, unionPS ),
+      "Polygon set union error" );
+    
+    if( ( unionPS.size() == 1 ) && ( unionPS[ 0 ].size() == 1 ) )
+    {
+      outputNode.dataPolygonRefProj_ = unionPS[ 0 ];
+          
+      if( refProjPtr->operator==( *( outputNode.rasterPtr_->params().
+        projection() ) ) )
+      {
+        outputNode.dataPolygonRaProj_ = outputNode.dataPolygonRefProj_;
+      }
+      else
+      {
+        TeVectorRemap( outputNode.dataPolygonRefProj_, refProjPtr,
+        outputNode.dataPolygonRaProj_, outputNode.rasterPtr_->params().
+        projection() );
+      }          
+    }
+    else
+    {
+      outputNode.dataPolygonRaProj_ = polygonFromBox( 
+        outputNode.rasterPtr_->params().boundingBox() );
+        
+      if( refProjPtr->operator==( *( outputNode.rasterPtr_->params().
+        projection() ) ) )
+      {
+        outputNode.dataPolygonRefProj_ = outputNode.dataPolygonRaProj_;
+      }
+      else
+      {
+        TeVectorRemap( outputNode.dataPolygonRaProj_, outputNode.rasterPtr_->
+        params().projection(), outputNode.dataPolygonRefProj_,
+        refProjPtr );
+      }          
+    }
+  }      
+  
+  return true;
+}
+
+bool TePDIBatchGeoMosaic::getRUsedChannels( 
+  const unsigned int& inputRastersIdx,
+  const std::vector< unsigned int >& bands,
+  const TePDITypes::TePDIRasterVectorType& input_rasters,
+  std::vector< unsigned int >& channels ) const
+{
+  TEAGN_DEBUG_CONDITION( ( inputRastersIdx < input_rasters.size() ),
+    "Invalid input_rasters or bands" );
+    
+  TEAGN_DEBUG_CONDITION( ( bands.size() % input_rasters.size() ) == 0,
+    "Invalid input_rasters or bands" );
+    
+  channels.clear();
+    
+  unsigned int bands_per_raster = bands.size() / input_rasters.size();
+  
+  for( unsigned int rasters_index = 0 ; rasters_index < input_rasters.size() ;
+    ++rasters_index ) 
+  {
+    if( rasters_index == inputRastersIdx ) 
+    {
+      unsigned int bands_start_index = ( rasters_index * bands_per_raster );
+      
+      for( unsigned int offset = 0 ; offset < bands_per_raster ; ++offset ) 
+      {
+        channels.push_back(  bands[ bands_start_index + offset ] );
+        
+        TEAGN_DEBUG_CONDITION( (int)channels.back() <
+          input_rasters[ rasters_index ]->params().nBands(),
+          "Invalid raster band" );        
+      }
+      
+      return true;
+    }
+  }
+  
+  return false;
+}
+
+bool TePDIBatchGeoMosaic::initRastersList( 
+  const std::vector< unsigned int >& bands,
+  const TePDITypes::TePDIRasterVectorType& input_rasters,      
+  TeProjection*  referenceProjPtr,
+  RastersListT& rList ) const
+{
+  TEAGN_DEBUG_CONDITION( referenceProjPtr, "Invalid projection pointer" );
+  TEAGN_DEBUG_CONDITION( ( bands.size() % input_rasters.size() ) == 0,
+    "Invalid input_rasters or bands" );  
+  
+  rList.clear();
+    
+  for( unsigned int iRVIdx = 0 ; iRVIdx < input_rasters.size() ; ++iRVIdx )
+  {
+    RastersListNodeT dummyNode;
+    
+    dummyNode.rasterPtr_ = input_rasters[ iRVIdx ];
+  
+    TEAGN_TRUE_OR_RETURN( getRUsedChannels( iRVIdx, bands, input_rasters, 
+      dummyNode.channelsVec_ ), "Internal processing error" );
+      
+    dummyNode.dataPolygonRaProj_ = polygonFromBox( 
+      dummyNode.rasterPtr_->params().boundingBox() );
+      
+    if( referenceProjPtr->operator==( *( dummyNode.rasterPtr_->params().
+      projection() ) ) )
+    {
+      dummyNode.dataPolygonRefProj_ = dummyNode.dataPolygonRaProj_;
+    }
+    else
+    {
+      TeVectorRemap( dummyNode.dataPolygonRaProj_, dummyNode.rasterPtr_->
+      params().projection(), dummyNode.dataPolygonRefProj_,
+      referenceProjPtr );
+    }
+      
+    rList.push_back( dummyNode );
+  }
+  
+  return true;
+}
+
+TeProjection* TePDIBatchGeoMosaic::getFreqProjection( 
+  const TePDITypes::TePDIRasterVectorType& rastersVec ) const
+{
+  std::map< std::string, std::pair< unsigned int, TeProjection* > > 
+    projsMap;
+  std::string projStr;
+  
+  for( unsigned int rVecIdx = 0 ; rVecIdx < rastersVec.size() ; ++rVecIdx )
+  {
+    TEAGN_DEBUG_CONDITION( rastersVec[ rVecIdx ]->projection(), 
+      "Invalid projection" );
+    
+    projStr = rastersVec[ rVecIdx ]->projection()->describe();
+    
+    if( projsMap[ projStr ].second == 0 )
+    {
+      projsMap[ projStr ].first = 1;
+      projsMap[ projStr ].second = rastersVec[ rVecIdx ]->projection();
+    }
+    else
+    {
+      ++(projsMap[ projStr ].first);
+    }
+  }
+  
+  std::map< std::string, std::pair< unsigned int, 
+    TeProjection* > >::iterator mIt = projsMap.begin();
+  const std::map< std::string, std::pair< unsigned int, 
+    TeProjection* > >::iterator mItEnd = projsMap.end();    
+  unsigned int bestProjCount = 0;  
+  TeProjection* bestProjPtr = 0;  
+    
+  if( mIt == mItEnd )
+  {
+    return 0;
+  }
+  else
+  {
+    while( mIt != mItEnd )
+    {
+      if( mIt->second.first > bestProjCount )
+      {
+        bestProjCount = mIt->second.first;
+        bestProjPtr = mIt->second.second;
+      }
+      
+      ++mIt;
+    }
+    
+    return bestProjPtr;
+  }
+}
+
+  
+bool TePDIBatchGeoMosaic::extractCloserRasterNode( RastersListT& rList,
+  const RastersListNodeT& inputNode,
+  RastersListNodeT& outputNode ) const
+{
+  if( rList.size() )
+  {
+    // Locating the raster closest to the raster bounding box center
+    
+    double minDist = DBL_MAX;
+    double curDist = 0;
+    const TeCoord2D iNodeRasterCenter = inputNode.dataPolygonRefProj_.box().center();
+    TeCoord2D curCenter;
+    
+    RastersListT::iterator it = rList.begin();
+    const RastersListT::iterator itEnd = rList.end(); 
+    RastersListT::iterator foundIt = itEnd;   
+    
+    while( it != itEnd )
+    {
+      curCenter = it->dataPolygonRefProj_.box().center();
+      
+      curDist = TeDistance( curCenter, iNodeRasterCenter );
+      
+      if( curDist < minDist )
+      {
+        minDist = curDist;
+        foundIt = it;
+      }
+      
+      ++it;
+    }
+    
+    if( foundIt != itEnd )
+    {
+      outputNode = *foundIt;
+      rList.erase( foundIt );
+      
+      return true;
+    }
+    else
+    {
+      return false;
+    }    
+  }
+  else
+  {
+    return false;
+  }
+}
+
+bool TePDIBatchGeoMosaic::extractClosestRastersNodes( RastersListT& rList,
+   RastersListNodeT& outputNode1, RastersListNodeT& outputNode2 ) const
+{
+  if( rList.size() )
+  {
+    // Locating the raster closest to the raster bounding box center
+    
+    double minDist = DBL_MAX;
+    double curDist = 0;
+    
+    RastersListT::iterator it1 = rList.begin();
+    const RastersListT::iterator itEnd = rList.end(); 
+    RastersListT::iterator it2;
+    RastersListT::iterator foundIt1;
+    RastersListT::iterator foundIt2;
+    
+    while( it1 != itEnd )
+    {
+      it2 = it1;
+      ++it2;
+      
+      while( it2 != itEnd )
+      {
+        curDist = TeDistance( it1->dataPolygonRefProj_.box().center(), 
+          it2->dataPolygonRefProj_.box().center() );
+      
+        if( curDist < minDist )
+        { 
+          minDist = curDist;
+          
+          foundIt1 = it1;
+          foundIt2 = it2;
+        }
+        
+        ++it2;
+      }
+      
+      ++it1;
+    }
+    
+    if( minDist != DBL_MAX )
+    {
+      outputNode1 = *foundIt1;
+      outputNode2 = *foundIt2;
+      
+      rList.erase( foundIt2 );
+      rList.erase( foundIt1 );
+      
+      return true;
+    }
+    else
+    {
+      return false;
+    }    
+  }
+  else
+  {
+    return false;
+  }
+}
+
+
diff --git a/src/terralib/image_processing/TePDIBatchGeoMosaic.hpp b/src/terralib/image_processing/TePDIBatchGeoMosaic.hpp
old mode 100755
new mode 100644
index 86ec497..3de3ffc
--- a/src/terralib/image_processing/TePDIBatchGeoMosaic.hpp
+++ b/src/terralib/image_processing/TePDIBatchGeoMosaic.hpp
@@ -1,147 +1,171 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIBATCHGEOMOSAIC_HPP
-  #define TEPDIBATCHGEOMOSAIC_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for Batch Geographic Mosaic
-   * ( geo-referenced rasters ) strategy.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   *
-   * @note The required parameters are:
-   * @param blending_type ( std::string ) - Blending type.
-   * type ( see each blending strategy documentation for other required
-   * parameters ).   
-   * @param input_rasters ( TePDITypes::TePDIRasterVectorType ) - 
-   * Input rasters vector (i.e if using two bands from each
-   * raster, the vector will follow the order [ raster0 raster0
-   * raster1 raster1 ...... ] ).
-   * @param bands ( std::vector< int > ) - The bands from each input_raster 
-   * following the order [Raster0 Band 0 - Raster0 Band 1 - ....
-   * RasterN Band 0 - RasterN Band 1 - .... - RasterN Band N ].
-   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
-   *
-   * @note The optional parameters are:
-   *
-   * @param dummy_value (double) - A dummy pixel value for use 
-   * in pixels where no data is available.
-   * @param auto_equalize ( int ) - If present ( any value ), input_raster2
-   * auto-equalizing will be made ( using overlap area reference ).    
-   *
-   * @note The output_raster pixel resolution will follow the best pixel 
-   * resolution found.
-   * @note Please check each blending strategy for other specific required
-   * parameters.
-   * @ingroup TePDIMosaicGroup
-   */
-  class PDI_DLL TePDIBatchGeoMosaic : public TePDIAlgorithm {
-    public :
-      
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIBatchGeoMosaic();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIBatchGeoMosaic();
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of 
-       * each PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;      
-
-    protected :
-    
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );    
-     
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();     
-      
-      /**
-       * @brief Locates the raster with the closest box ( relative boxes centers ).
-       *
-       * @param input_rasters A list with input rasters.
-       * @param reference_raster_box The reference raster box.
-       * @param reference_raster_projection Reference raster projection.
-       * @param closest_raster The returned closest raster.
-       */      
-      void FindClosestRaster( 
-        std::list< TePDITypes::TePDIRasterPtrType >& input_rasters,
-        const TeBox& reference_raster_box,
-        TeProjection* reference_raster_projection,
-        TePDITypes::TePDIRasterPtrType& closest_raster );      
-      
-      /**
-       * @brief Locates the two closest rasters ( relative boxes centers ).
-       *
-       * @param input_rasters A list with input rasters.
-       * @param raster1 The returned first raster.
-       * @param raster2 The returned second raster.
-       */      
-      void FindClosestRasters( 
-        std::list< TePDITypes::TePDIRasterPtrType >& input_rasters,
-        TePDITypes::TePDIRasterPtrType& raster1,
-        TePDITypes::TePDIRasterPtrType& raster2 );
-        
-      /**
-       * @brief Find the required raster channels inside the current parameters.
-       *
-       * @param raster_ptr The raster pointer.
-       * @param params A reference to the current parameters.
-       * @param channels The found channels.
-       */          
-      void findRastersChannels( 
-        const TePDITypes::TePDIRasterPtrType& raster_ptr,
-        const TePDIParameters& params,
-        std::vector< int >& channels );       
-  };
-  
-/** @example TePDIMosaic_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIBATCHGEOMOSAIC_HPP
+  #define TEPDIBATCHGEOMOSAIC_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @class TePDIBatchGeoMosaic
+   * @brief Mosaic of many geo-referenced rasters.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIMosaicGroup
+   *
+   * @note The required parameters are:
+   * @param input_rasters ( TePDITypes::TePDIRasterVectorType ) - 
+   * Input rasters vector (i.e if using two bands from each
+   * raster, the vector will follow the order [ raster0 raster0
+   * raster1 raster1 ...... ] ).
+   * @param bands ( std::vector< unsigned int > ) - The bands from each input_raster 
+   * following the order [Raster0 Band 0 - Raster0 Band 1 - ....
+   * RasterN Band 0 - RasterN Band 1 - .... - RasterN Band N ].
+   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
+   *
+   * @note The optional parameters are:
+   * @param blend_method ( TePDIBlender::BlendMethod ) - Blending method
+   * (default: TePDIBlender::NoBlendMethod).     
+   * @param interp_method ( TePDIInterpolator::InterpMethod ) - Interpolation
+   * method (default TePDIInterpolator::NNMethod) .
+   * @param dummy_value (double) - A dummy pixel value for use 
+   * in pixels where no data is available.
+   * @param auto_equalize ( int ) - If present ( any value )
+   * auto-equalizing will be made ( using overlap area reference ).    
+   *
+   * @note The output_raster pixel resolution will follow the best pixel 
+   * resolution found.
+   * @note Please check each blending strategy for other specific required
+   * parameters.
+   *
+   * @example TePDIMosaic_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIBatchGeoMosaic : public TePDIAlgorithm {
+    public :
+      
+      TePDIBatchGeoMosaic();
+
+      ~TePDIBatchGeoMosaic();
+      
+      //Overloaded
+      bool CheckParameters( const TePDIParameters& parameters ) const;      
+
+    protected :
+    
+      /** @brief Rasters list node type definition */    
+      class RastersListNodeT
+      {
+        public :
+        
+          /** @brief Raster pointer */    
+          TePDITypes::TePDIRasterPtrType rasterPtr_;
+          
+          /** @brief Polygon delimiting the valid raster data (under the 
+          global reference projection) */    
+          TePolygon dataPolygonRefProj_;
+          
+          /** @brief Polygon delimiting the valid raster data (under the 
+          raster projection) */    
+          TePolygon dataPolygonRaProj_;          
+          
+          /** Bands to use for this raster */
+          std::vector< unsigned int > channelsVec_;  
+          
+          RastersListNodeT();
+          
+          ~RastersListNodeT();
+          
+          const RastersListNodeT& operator=( const RastersListNodeT& other );
+      };
+    
+      /** @brief Rasters list type definition */    
+      typedef std::list< RastersListNodeT > RastersListT;
+    
+      //Overloaded
+      void ResetState( const TePDIParameters& params );    
+     
+      //Overloaded
+      bool RunImplementation();     
+      
+      /**
+       * @brief Find the channels for the raster with index inputRastersIdx.
+       * @param inputRastersIdx Raster index inside input_rasters;
+       * @param bands The user suplied bands vector.
+       * @param input_rasters The user suplied input rasters pointers vector.
+       * @param The channels to use for the required raster.
+       * @return true if OK, false on errors.
+       */          
+      bool getRUsedChannels( 
+        const unsigned int& inputRastersIdx,
+        const std::vector< unsigned int >& bands,
+        const TePDITypes::TePDIRasterVectorType& input_rasters,
+        std::vector< unsigned int >& channels ) const;
+        
+      /**
+       * @brief Initiate the rasters list.
+       * @param bands The user suplied bands vector..
+       * @param input_rasters The user suplied input rasters pointers vector.
+       * @param referenceProjPtr Reference projection pointer.
+       * @param rList The rasters list to initialize.
+       * @return true if OK, false on errors.
+       */       
+      bool initRastersList( const std::vector< unsigned int >& bands,
+        const TePDITypes::TePDIRasterVectorType& input_rasters,      
+        TeProjection* referenceProjPtr,
+        RastersListT& rList ) const;        
+        
+      /**
+       * @brief Return the most frequent projection among the given rasters.
+       * @param rastersVec The input rasters vector.
+       * @return A pointer to the choosed projection or NULL if not found.
+       * @note The returned projection should not be altered !!
+       */       
+      TeProjection* getFreqProjection( 
+        const TePDITypes::TePDIRasterVectorType& rastersVec ) const;
+        
+      /**
+       * @brief Extract the raster closer to given inputNode.
+       * @param rList The rasters list. The input rasters vector.
+       * @param inputNode Input node with the input raster.
+       * @param outputNode The extracted node.
+       * @return true if ok, false on errors.
+       */         
+      bool extractCloserRasterNode( RastersListT& rList,
+        const RastersListNodeT& inputNode,
+        RastersListNodeT& outputNode ) const;
+        
+      /**
+       * @brief Extract the raster closer to given inputNode.
+       * @param rList The rasters list. The input rasters vector.
+       * @param outputNode1 The extracted node 1.
+       * @param outputNode2 The extracted node 2.
+       * @return true if ok, false on errors.
+       */         
+      bool extractClosestRastersNodes( RastersListT& rList,
+        RastersListNodeT& outputNode1, RastersListNodeT& outputNode2 ) const;        
+
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDIBatchGeoMosaicFactory.cpp b/src/terralib/image_processing/TePDIBatchGeoMosaicFactory.cpp
deleted file mode 100644
index 98c2732..0000000
--- a/src/terralib/image_processing/TePDIBatchGeoMosaicFactory.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
- 
-#include "TePDIBatchGeoMosaicFactory.hpp"
-#include "TePDIBatchGeoMosaic.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIBatchGeoMosaicFactory::TePDIBatchGeoMosaicFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIBatchGeoMosaic" ) )
-{
-}
-
-
-TePDIBatchGeoMosaicFactory::~TePDIBatchGeoMosaicFactory()
-{
-}
-
-
-TePDIAlgorithm* TePDIBatchGeoMosaicFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIBatchGeoMosaic();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
diff --git a/src/terralib/image_processing/TePDIBatchGeoMosaicFactory.hpp b/src/terralib/image_processing/TePDIBatchGeoMosaicFactory.hpp
deleted file mode 100644
index 341ed56..0000000
--- a/src/terralib/image_processing/TePDIBatchGeoMosaicFactory.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIBATCHGEOMOSAICFACTORY_HPP
-  #define TEPDIBATCHGEOMOSAICFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for image geographic batch mosaic algorithms 
-   * factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIBatchGeoMosaicFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIBatchGeoMosaicFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIBatchGeoMosaicFactory();
-      
-    protected :  
-      
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIBatchGeoMosaicFactory TePDIBatchGeoMosaicFactory_instance;
-  };  
-  
-#endif
diff --git a/src/terralib/image_processing/TePDIBlendStratFactory.cpp b/src/terralib/image_processing/TePDIBlendStratFactory.cpp
deleted file mode 100755
index d52b71d..0000000
--- a/src/terralib/image_processing/TePDIBlendStratFactory.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
- 
-#include "TePDIBlendStratFactory.hpp"
-
-TePDIBlendStratFactory::TePDIBlendStratFactory( 
-  const std::string& factoryName )
-: TeFactory< TePDIBlendingStrategy, TePDIParameters >( factoryName )
-{
-};      
-
-TePDIBlendStratFactory::~TePDIBlendStratFactory()
-{
-};
diff --git a/src/terralib/image_processing/TePDIBlendStratFactory.hpp b/src/terralib/image_processing/TePDIBlendStratFactory.hpp
deleted file mode 100755
index b0ba315..0000000
--- a/src/terralib/image_processing/TePDIBlendStratFactory.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef PDI_BLEND_SF_REGISTERED
-  #define PDI_BLEND_SF_REGISTERED
-  
-  #include <TePDINoBlendSF.hpp>
-  #include <TePDIEuclidianBlendSF.hpp>
-
-#endif 
-
-#ifndef TEPDIBLENDSTRATFACTORY_HPP
-  #define TEPDIBLENDSTRATFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include <TePDIBlendingStrategy.hpp>
-  #include <TePDIParameters.hpp>
-  #include <TeFactory.h>
-
-  /**
-   * @brief This is the class for blending strategy factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategyFactories
-   */
-  class PDI_DLL TePDIBlendStratFactory : 
-    public TeFactory< TePDIBlendingStrategy, TePDIParameters >
-  {
-    public :
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIBlendStratFactory();
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIBlendStratFactory( const std::string& factoryName );
-  };
-  
-#endif
-
diff --git a/src/terralib/image_processing/TePDIBlender.cpp b/src/terralib/image_processing/TePDIBlender.cpp
new file mode 100644
index 0000000..80fdc45
--- /dev/null
+++ b/src/terralib/image_processing/TePDIBlender.cpp
@@ -0,0 +1,562 @@
+#include "TePDIBlender.hpp"
+
+#include <TePDIUtils.hpp>
+
+#include <TeOverlay.h>
+#include <TeGeometryAlgorithms.h>
+#include <TeGTFactory.h>
+#include <TeAgnostic.h>
+
+TePDIBlender::TePDIBlender()
+: dummyValue_( 0.0 ),
+  blendFunctPtr_( &TePDIBlender::noBlendMethodImp ), 
+  blendMethod_( NoBlendMethod ),
+  relation_( 0 )
+{
+}
+
+TePDIBlender::~TePDIBlender()
+{
+  reset();
+}
+
+void TePDIBlender::reset()
+{
+  dummyValue_ = 0;
+  blendFunctPtr_ = &TePDIBlender::noBlendMethodImp;
+  blendMethod_ = NoBlendMethod;
+  relation_ = 0;
+  transPrt_.reset();
+  raster1Ptr_.reset();
+  raster1ChannelsVec_.clear();
+  raster2Ptr_.reset();
+  raster2ChannelsVec_.clear();
+  interPolR1IdxRef_.clear();
+  interLineSetInR1_.clear();
+  interLineSetInR2_.clear();
+  pixelOffsets1_.clear();
+  pixelScales1_.clear();
+  pixelOffsets2_.clear();
+  pixelScales2_.clear();
+}
+
+bool TePDIBlender::init( const TePDITypes::TePDIRasterPtrType& raster1Ptr,
+  const std::vector< unsigned int > raster1ChannelsVec,
+  const TePDITypes::TePDIRasterPtrType& raster2Ptr,
+  const std::vector< unsigned int > raster2ChannelsVec,
+  BlendMethod blendMethod,
+  TePDIInterpolator::InterpMethod interpMethod,
+  const TeGTParams& transParams,
+  const double& dummyValue,
+  const std::vector< double >& pixelOffsets1,
+  const std::vector< double >& pixelScales1,
+  const std::vector< double >& pixelOffsets2,
+  const std::vector< double >& pixelScales2,
+  const TePolygon& raster1Pol, 
+  const TePolygon& raster2Pol )
+{
+  // Reset this instance
+  
+  reset();
+  
+  // Updating global vars
+  
+  dummyValue_ = dummyValue;
+  
+  // updating input images parameters 
+  {
+    TEAGN_TRUE_OR_RETURN( raster1Ptr.isActive(), "Invalid pointer" );
+    TEAGN_TRUE_OR_RETURN( raster2Ptr.isActive(), "Invalid pointer" );
+    TEAGN_TRUE_OR_RETURN( raster1Ptr->params().status_ != 
+      TeRasterParams::TeNotReady, "Invalid pointer" );
+    TEAGN_TRUE_OR_RETURN( raster2Ptr->params().status_ != 
+      TeRasterParams::TeNotReady, "Invalid pointer" );
+      
+    TEAGN_TRUE_OR_RETURN( raster1ChannelsVec.size(), 
+      "Invalid raster channels vector size" )  
+    TEAGN_TRUE_OR_RETURN( raster2ChannelsVec.size(), 
+      "Invalid raster channels vector size" )  
+    TEAGN_TRUE_OR_RETURN( raster1ChannelsVec.size() == raster2ChannelsVec.size(), 
+      "Incompatible rasters channels vectors size" )  
+    TEAGN_TRUE_OR_RETURN( raster1ChannelsVec.size() == pixelOffsets1.size(), 
+      "Incompatible pixelOffsets1 size" )      
+    TEAGN_TRUE_OR_RETURN( raster1ChannelsVec.size() == pixelScales1.size(), 
+      "Incompatible pixelScales1 size" )         
+    TEAGN_TRUE_OR_RETURN( raster2ChannelsVec.size() == pixelOffsets2.size(), 
+      "Incompatible pixelOffsets2 size" )      
+    TEAGN_TRUE_OR_RETURN( raster2ChannelsVec.size() == pixelScales2.size(), 
+      "Incompatible pixelScales2 size" )          
+      
+    for( unsigned int cVecIdx1 = 0 ; cVecIdx1 < raster1ChannelsVec.size() ;
+      ++cVecIdx1 )
+    {
+      TEAGN_TRUE_OR_RETURN( ((int)raster1ChannelsVec[ cVecIdx1 ]) < 
+        raster1Ptr->params().nBands(), "Invalid band/channel" );
+    }
+    for( unsigned int cVecIdx2 = 0 ; cVecIdx2 < raster2ChannelsVec.size() ;
+      ++cVecIdx2 )
+    {
+      TEAGN_TRUE_OR_RETURN( ((int)raster2ChannelsVec[ cVecIdx2 ]) < 
+        raster2Ptr->params().nBands(), "Invalid band/channel" );
+    }
+    
+    raster1Ptr_ = raster1Ptr;
+    raster1ChannelsVec_ = raster1ChannelsVec;
+    raster2Ptr_ = raster2Ptr;
+    raster2ChannelsVec_ = raster2ChannelsVec;
+    
+    pixelOffsets1_ = pixelOffsets1;
+    pixelScales1_ = pixelScales1;
+    pixelOffsets2_ = pixelOffsets2;
+    pixelScales2_ = pixelScales2;
+  }
+  
+  // initiating the interpolators instances
+  
+  TEAGN_TRUE_OR_RETURN( interp1Instance_.reset( raster1Ptr_, interpMethod,
+    dummyValue_ ), "Error initiating interpolator instance" );
+    
+  TEAGN_TRUE_OR_RETURN( interp2Instance_.reset( raster2Ptr_, interpMethod,
+    dummyValue_ ), "Error initiating interpolator instance" );    
+  
+  // updating geometric transformation parameters
+  
+  transPrt_.reset( TeGTFactory::make( transParams ) );
+  TEAGN_TRUE_OR_RETURN( transPrt_.isActive() , 
+    "Invalid transformation parameters" );  
+    
+  if( ! transPrt_->reset( transParams ) )
+  {
+    transPrt_.reset();
+
+    TEAGN_LOG_AND_RETURN( "Invalid transformation parameters" );
+  }  
+  
+  // Updating data related to the intersection between the two images
+  
+  {
+    // definint the raster 2 bounding box polygon - 
+    // raster 2 indexed  reference
+    TePolygon r2IdxPolBBoxR2Ref;    
+  
+    if( raster2Pol.size() )
+    {
+      r2IdxPolBBoxR2Ref = raster2Pol;
+    }
+    else
+    {
+      // raster 2 bounding box polygon - raster 2 projected  reference
+      TePolygon r2PolBBoxR2Ref = polygonFromBox( 
+        raster2Ptr_->params().boundingBox() );
+        
+      TePDIUtils::MapCoords2RasterIndexes( r2PolBBoxR2Ref, raster2Ptr_,
+        r2IdxPolBBoxR2Ref );        
+    }
+      
+    // raster 2 bounding box polygon - raster 1 indexed  reference
+    TePolygon r2IdxPolBBoxR1Ref;
+    {
+      TeLine2D line;
+      TeCoord2D pt1;
+      TeCoord2D pt2;
+      
+      TEAGN_DEBUG_CONDITION( r2IdxPolBBoxR2Ref.size() == 1, 
+        "Internal error" );
+      
+      for( unsigned int pointIdx = 0 ; pointIdx < r2IdxPolBBoxR2Ref[ 0 ].size() ;
+        ++pointIdx )
+      {
+        pt2 = r2IdxPolBBoxR2Ref[ 0 ][ pointIdx ];
+        
+        transPrt_->inverseMap( pt2, pt1 );
+        
+        line.add( pt1 );
+      }
+      
+      r2IdxPolBBoxR1Ref.add( TeLinearRing( line ) );
+    }
+    
+    // defining the raster 1 bounding box polygon - raster 1 indexed  reference
+    
+    TePolygon r1IdxPolBBoxR1Ref;  
+    
+    if( raster1Pol.size() )
+    {
+      r1IdxPolBBoxR1Ref = raster1Pol;
+    }
+    else
+    {
+      // raster 1 bounding box polygon - raster 1 projected  reference
+      TePolygon r1PolBBoxR1Ref = polygonFromBox( 
+        raster1Ptr_->params().boundingBox() );    
+        
+      TePDIUtils::MapCoords2RasterIndexes( r1PolBBoxR1Ref, raster1Ptr_,
+        r1IdxPolBBoxR1Ref );        
+    };
+      
+    // Calculating the intersection parameters interPolR1IdxRef_
+    // interLineSetInR1_ interLineSetInR2_
+    
+    // raster 2 bounding box polygon set - raster 1 indexed  reference
+    TePolygonSet r2IdxPolBBoxPSR1Ref;
+    r2IdxPolBBoxPSR1Ref.add( r2IdxPolBBoxR1Ref );
+    
+    // raster 1 bounding box polygon set - raster 1 indexed  reference
+    TePolygonSet r1IdxPolBBoxPSR1Ref;
+    r1IdxPolBBoxPSR1Ref.add( r1IdxPolBBoxR1Ref );  
+         
+    // Raster 1 line set - raster 1 indexed  reference
+    TeLineSet r1IdxLineSetR1Ref;      
+    TePDIUtils::makeSegmentSet( r1IdxPolBBoxR1Ref, r1IdxLineSetR1Ref );   
+    
+    // Raster 2 line set - raster 1 indexed  reference
+    TeLineSet r2IdxLineSetR1Ref;
+    TePDIUtils::makeSegmentSet( r2IdxPolBBoxR1Ref, r2IdxLineSetR1Ref );    
+    
+    relation_ = TeRelation( r1IdxPolBBoxR1Ref, r2IdxPolBBoxR1Ref );
+    
+    switch( relation_ )
+    {
+      case TeDISJOINT :
+      case TeTOUCHES :
+      {
+        break;
+      }
+      case TeEQUALS :
+      {
+        break;
+      }
+      case TeCOVEREDBY :
+      case TeWITHIN :
+      {
+        interPolR1IdxRef_ = r1IdxPolBBoxR1Ref;
+        interLineSetInR2_ = r1IdxLineSetR1Ref;
+        break;
+      }
+      case TeCONTAINS :
+      case TeCOVERS :
+      {
+        interPolR1IdxRef_ = r2IdxPolBBoxR1Ref;
+        interLineSetInR1_ = r2IdxLineSetR1Ref;
+        break;
+      }
+      case TeOVERLAPS :
+      {
+        // Intersection polygon set - raster 1 indexed reference
+        TePolygonSet interPsR1IdxRef;        
+          
+        if( TeOVERLAY::TeIntersection( r1IdxPolBBoxPSR1Ref,
+          r2IdxPolBBoxPSR1Ref, interPsR1IdxRef ) )
+        {
+          if( interPsR1IdxRef.size() == 1 )
+          {
+            if( interPsR1IdxRef[ 0 ].size() == 1 )
+            {
+              interPolR1IdxRef_ = interPsR1IdxRef[ 0 ];
+              
+              TeMultiGeometry interR1MGeom = TeOVERLAY::TeIntersection( 
+                r1IdxLineSetR1Ref, r2IdxPolBBoxPSR1Ref );
+              
+              TeMultiGeometry interR2MGeom = TeOVERLAY::TeIntersection( 
+                r2IdxLineSetR1Ref, r1IdxPolBBoxPSR1Ref );        
+                
+              if( ( ! interR1MGeom.getGeometry( interLineSetInR2_ ) ) ||
+                ( ! interR2MGeom.getGeometry( interLineSetInR1_ ) ) )
+              {
+                interLineSetInR1_.clear();
+                interLineSetInR1_.clear();
+              }                  
+            }
+          }
+        }
+              
+        break;      
+      }
+
+      default :
+      {
+        TEAGN_LOG_AND_THROW( "Invalid relation" );
+      }
+    }
+  }
+  
+  // updating blending and interpolation parameters
+  
+  blendMethod_ = blendMethod;
+  
+  switch( blendMethod_ )
+  {
+    case NoBlendMethod :
+    {
+      blendFunctPtr_ = &TePDIBlender::noBlendMethodImp;
+      
+      break;
+    }
+    case MeanBlendMethod :
+    {
+      blendFunctPtr_ = &TePDIBlender::meanBlendMethodImp;
+      
+      break;
+    }
+    case EuclideanBlendMethod :
+    {
+      if( ( interLineSetInR1_.size() > 0 ) && 
+        ( interLineSetInR2_.size() > 0 ) )
+      {
+        blendFunctPtr_ = &TePDIBlender::eucBlendMethodImp;
+      }
+      else
+      {
+        blendFunctPtr_ = &TePDIBlender::meanBlendMethodImp;
+      }
+      
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_THROW( "Invalid blending method" );
+      
+      break;
+    }      
+  }
+       
+  // So far... so good !
+
+  return true;
+}
+      
+void TePDIBlender::noBlendMethodImp( const double& line, const double& col,
+  const unsigned int& rasterChannelsVecsIdx, double& value )
+{
+  TEAGN_DEBUG_CONDITION( transPrt_.isActive(), "Invalid transformation pointer" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < raster1ChannelsVec_.size(),
+    "Invalid raster channels vector index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < raster2ChannelsVec_.size(),
+    "Invalid raster channels vector index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelOffsets1_.size(),
+    "Invalid raster channel index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelScales1_.size(),
+    "Invalid raster channel index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelOffsets2_.size(),
+    "Invalid raster channel index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelScales2_.size(),
+    "Invalid raster channel index" );
+              
+  interp1Instance_.interpolate( line, col, raster1ChannelsVec_[ 
+    rasterChannelsVecsIdx ], value);
+    
+  if( value == dummyValue_ )
+  {
+    noBlendMethodImp_coord1_.x( col );
+    noBlendMethodImp_coord1_.y( line );
+    
+    transPrt_->directMap( noBlendMethodImp_coord1_, noBlendMethodImp_coord2_ );
+    
+    interp2Instance_.interpolate( noBlendMethodImp_coord2_.y(), 
+      noBlendMethodImp_coord2_.x(), raster2ChannelsVec_[ rasterChannelsVecsIdx 
+      ], value);
+      
+    if( value != dummyValue_ )
+    {
+      value = ( value * pixelScales2_[ rasterChannelsVecsIdx ] ) + 
+        pixelOffsets2_[ rasterChannelsVecsIdx ];
+    }
+  }
+  else
+  {
+    value = ( value * pixelScales1_[ rasterChannelsVecsIdx ] ) + 
+      pixelOffsets1_[ rasterChannelsVecsIdx ];
+  }
+}
+        
+void TePDIBlender::eucBlendMethodImp( const double& line, const double& col,
+  const unsigned int& rasterChannelsVecsIdx, double& value )
+{
+  TEAGN_DEBUG_CONDITION( transPrt_.isActive(), "Invalid transformation pointer" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < raster1ChannelsVec_.size(),
+    "Invalid raster channels vector index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < raster2ChannelsVec_.size(),
+    "Invalid raster channels vector index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelOffsets1_.size(),
+    "Invalid raster channel index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelScales1_.size(),
+    "Invalid raster channel index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelOffsets2_.size(),
+    "Invalid raster channel index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelScales2_.size(),
+    "Invalid raster channel index" );   
+  TEAGN_DEBUG_CONDITION( ( interLineSetInR1_.size() > 0 ) &&
+    ( interLineSetInR2_.size() > 0 ), "Internal error" );
+  
+  interp1Instance_.interpolate( line, col, raster1ChannelsVec_[ 
+    rasterChannelsVecsIdx ], eucBlendMethodImp_value1_);
+    
+  eucBlendMethodImp_coord1_.x( col );
+  eucBlendMethodImp_coord1_.y( line ); 
+     
+  transPrt_->directMap( eucBlendMethodImp_coord1_, eucBlendMethodImp_coord2_ );
+  
+  interp2Instance_.interpolate( eucBlendMethodImp_coord2_.y(), 
+    eucBlendMethodImp_coord2_.x(), raster2ChannelsVec_[ rasterChannelsVecsIdx 
+    ], eucBlendMethodImp_value2_ );  
+    
+  if( eucBlendMethodImp_value1_ == dummyValue_ )
+  {
+    if( eucBlendMethodImp_value2_ == dummyValue_ )
+    {
+      value = eucBlendMethodImp_value2_;
+    }
+    else
+    {
+      value = ( eucBlendMethodImp_value2_ * pixelScales2_[ 
+        rasterChannelsVecsIdx ] ) + pixelOffsets2_[ rasterChannelsVecsIdx ];
+    }
+  }
+  else
+  {
+    eucBlendMethodImp_value1_ = ( eucBlendMethodImp_value1_ * 
+      pixelScales1_[ rasterChannelsVecsIdx ] ) + pixelOffsets1_[
+      rasterChannelsVecsIdx ];
+    
+    if( eucBlendMethodImp_value2_ == dummyValue_ )
+    {
+      value = eucBlendMethodImp_value1_;
+    }
+    else
+    {
+      eucBlendMethodImp_value2_ = ( eucBlendMethodImp_value2_ * 
+        pixelScales2_[ rasterChannelsVecsIdx ] ) + 
+        pixelOffsets2_[ rasterChannelsVecsIdx ];
+        
+      // Distance from the current point to raster 1 
+      
+      eucBlendMethodImp_minDistToR1_ = DBL_MAX;
+      eucBlendMethodImp_curCoord_.x( col );
+      eucBlendMethodImp_curCoord_.y( line );
+      
+      for( eucBlendMethodImp_iLSIdx_ = 0 ; eucBlendMethodImp_iLSIdx_ < 
+        interLineSetInR1_.size() ; ++eucBlendMethodImp_iLSIdx_ )
+      {
+        TEAGN_DEBUG_CONDITION( interLineSetInR1_[ eucBlendMethodImp_iLSIdx_ 
+          ].size() == 2, "Invalid line set size" );
+          
+        eucBlendMethodImp_currDist_ = TePerpendicularDistance( 
+          interLineSetInR1_[ eucBlendMethodImp_iLSIdx_ ][ 0 ],
+          interLineSetInR1_[ eucBlendMethodImp_iLSIdx_ ][ 1 ], eucBlendMethodImp_curCoord_, 
+          eucBlendMethodImp_dummyCoord_ );
+          
+        if( eucBlendMethodImp_currDist_ < eucBlendMethodImp_minDistToR1_ ) 
+          eucBlendMethodImp_minDistToR1_ = eucBlendMethodImp_currDist_;
+      }
+      
+      // Distance from the current point to raster 2
+      
+      eucBlendMethodImp_minDistToR2_ = DBL_MAX;
+      
+      for( eucBlendMethodImp_iLSIdx_ = 0 ; eucBlendMethodImp_iLSIdx_ < 
+        interLineSetInR2_.size() ; ++eucBlendMethodImp_iLSIdx_ )
+      {
+        TEAGN_DEBUG_CONDITION( interLineSetInR2_[ eucBlendMethodImp_iLSIdx_ 
+          ].size() == 2, "Invalid line set size" );
+          
+        eucBlendMethodImp_currDist_ = TePerpendicularDistance( 
+          interLineSetInR2_[ eucBlendMethodImp_iLSIdx_ ][ 0 ],
+          interLineSetInR2_[ eucBlendMethodImp_iLSIdx_ ][ 1 ], eucBlendMethodImp_curCoord_, 
+          eucBlendMethodImp_dummyCoord_ );
+          
+        if( eucBlendMethodImp_currDist_ < eucBlendMethodImp_minDistToR2_ ) 
+          eucBlendMethodImp_minDistToR2_ = eucBlendMethodImp_currDist_;
+      }  
+        
+      // Updating weights
+      
+      if( eucBlendMethodImp_minDistToR1_ == 0.0 )
+      {
+        eucBlendMethodImp_weight1_ = 1.0;
+      }
+      else
+      {
+        eucBlendMethodImp_weight1_ = 1.0 / eucBlendMethodImp_minDistToR1_;
+      }
+        
+      if( eucBlendMethodImp_minDistToR2_ == 0.0 )
+      {
+        eucBlendMethodImp_weight2_ = 1.0;
+      }
+      else
+      {
+        eucBlendMethodImp_weight2_ = 1.0 / eucBlendMethodImp_minDistToR2_;
+      } 
+             
+      TEAGN_DEBUG_CONDITION( ( ( eucBlendMethodImp_weight1_ > 0.0 ) ||
+       ( eucBlendMethodImp_weight2_ > 0.0 ) ),
+       "Invalid weights" );
+    
+      value = ( ( eucBlendMethodImp_value1_ * eucBlendMethodImp_weight1_ ) +
+        ( eucBlendMethodImp_value2_ * eucBlendMethodImp_weight2_ ) ) /
+        ( eucBlendMethodImp_weight1_ + eucBlendMethodImp_weight2_ );
+    }
+  }
+}
+
+void TePDIBlender::meanBlendMethodImp( const double& line, const double& col,
+  const unsigned int& rasterChannelsVecsIdx, double& value )
+{
+  TEAGN_DEBUG_CONDITION( transPrt_.isActive(), "Invalid transformation pointer" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < raster1ChannelsVec_.size(),
+    "Invalid raster channels vector index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < raster2ChannelsVec_.size(),
+    "Invalid raster channels vector index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelOffsets1_.size(),
+    "Invalid raster channel index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelScales1_.size(),
+    "Invalid raster channel index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelOffsets2_.size(),
+    "Invalid raster channel index" );
+  TEAGN_DEBUG_CONDITION( rasterChannelsVecsIdx < pixelScales2_.size(),
+    "Invalid raster channel index" );   
+  
+  interp1Instance_.interpolate( line, col, raster1ChannelsVec_[ 
+    rasterChannelsVecsIdx ], meanBlendMethodImp_value1_);
+    
+  meanBlendMethodImp_coord1_.x( col );
+  meanBlendMethodImp_coord1_.y( line ); 
+     
+  transPrt_->directMap( meanBlendMethodImp_coord1_, meanBlendMethodImp_coord2_ );
+  
+  interp2Instance_.interpolate( meanBlendMethodImp_coord2_.y(), 
+    meanBlendMethodImp_coord2_.x(), raster2ChannelsVec_[ rasterChannelsVecsIdx 
+    ], meanBlendMethodImp_value2_ );  
+    
+  if( meanBlendMethodImp_value1_ == dummyValue_ )
+  {
+    if( meanBlendMethodImp_value2_ == dummyValue_ )
+    {
+      value = meanBlendMethodImp_value2_;
+    }
+    else
+    {
+      value = ( meanBlendMethodImp_value2_ * pixelScales2_[ 
+        rasterChannelsVecsIdx ] ) + pixelOffsets2_[ rasterChannelsVecsIdx ];
+    }
+  }
+  else
+  {
+    meanBlendMethodImp_value1_ = ( meanBlendMethodImp_value1_ * 
+      pixelScales1_[ rasterChannelsVecsIdx ] ) + pixelOffsets1_[
+      rasterChannelsVecsIdx ];
+    
+    if( meanBlendMethodImp_value2_ == dummyValue_ )
+    {
+      value = meanBlendMethodImp_value1_;
+    }
+    else
+    {
+      meanBlendMethodImp_value2_ = ( meanBlendMethodImp_value2_ * 
+        pixelScales2_[ rasterChannelsVecsIdx ] ) + 
+        pixelOffsets2_[ rasterChannelsVecsIdx ];
+        
+      value = ( meanBlendMethodImp_value1_ + meanBlendMethodImp_value2_ ) / 2.0;
+    }
+  }
+}
diff --git a/src/terralib/image_processing/TePDIBlender.hpp b/src/terralib/image_processing/TePDIBlender.hpp
new file mode 100644
index 0000000..170d7a3
--- /dev/null
+++ b/src/terralib/image_processing/TePDIBlender.hpp
@@ -0,0 +1,274 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIBLENDER_HPP
+  #define TEPDIBLENDER_HPP
+
+  #include "TePDIInterpolator.hpp"
+  #include "TePDIDefines.hpp"
+  #include "TePDITypes.hpp"
+
+  #include <TeGeometry.h>
+  #include <TeRaster.h>
+  #include <TeGeometricTransformation.h>
+  
+  #include <vector>
+  
+  /**
+   * @class TePDIBlender
+   * @brief Blended pixel value calculation for two overlaped rasters.
+   * @details The overlap between the two images is modeled by the given
+   * geometric transformation direct mapping input raster 1 indexed
+   * coords (line, column) to input raster 2 indexed coords.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAux
+   *
+   * @example TePDIBlender_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIBlender 
+  {
+    public :
+      /** @typedef TeSharedPtr< TePDIBlender > pointer 
+          Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIBlender > pointer;
+      
+      /**
+       * @enum Allowed blender methods.
+       */      
+      enum BlendMethod {
+        /** No blending performed. */
+        NoBlendMethod = 1,
+        /** Mean of overlapped pixels method. */
+        MeanBlendMethod = 2,        
+        /** Euclidean distance based blending method. */
+        EuclideanBlendMethod = 3
+      };
+
+      TePDIBlender();
+
+      ~TePDIBlender();
+      
+      /**
+       * @brief Initiate this instance.
+       *
+       * @param raster1Ptr Input raster 1 pointer.
+       * @param raster1ChannelsVec Input raster 1 bands/channels.
+       * @param raster2Ptr Input raster 2 pointer.
+       * @param raster2ChannelsVec Input raster 2 bands/channels.
+       * @param blendMethod Blending method.
+       * @param interpMethod Interpolation method.  
+       * @param transParams Transformation parameters. 
+       * @param dummyValue The value to be returned for cases where there is no
+       * raster data to blend.    
+       * @param pixelOffsets1 The values offset to be applied to raster 1 pixel
+       * values before the blended value calcule (one element for each
+       * used raster channel/band).
+       * @param pixelScales1 The values scale to be applied to raster 1 pixel
+       * values before the blended value calcule (one element for each
+       * used raster channel/band).   
+       * @param pixelOffsets2 The values offset to be applied to raster 2 pixel
+       * values before the blended value calcule (one element for each
+       * used raster channel/band).
+       * @param pixelScales2 The values scale to be applied to raster 2 pixel
+       * values before the blended value calcule (one element for each
+       * used raster channel/band).   
+       * @param raster1Pol A polygon (raster 1 indexed coords - line, col)
+       * delimiting the raster region with valid data (if an empty polygon
+       * is given the entire raster will be considered).
+       * @param raster2Pol A polygon (raster 2 indexed coords - line, col)
+       * delimiting the raster region with valid data (if an empty polygon
+       * is given the entire raster will be considered).       
+       * @return true if OK, false on errors.
+       * @note Transformation tie-points: TeCoordPair::pt1 are raster 1 indexed 
+       * (line, column) coordinates and TeCoordPair::pt2 are raster 2 indexed 
+       * (line, column) coordinates.
+       * @note raster1ChannelsVec, raster2ChannelsVec, pixelOffsets1,
+       * pixelScales1, pixelOffsets2 and pixelScales2 must have the same
+       * number of elements.
+       *
+       */
+      bool init( const TePDITypes::TePDIRasterPtrType& raster1Ptr,
+        const std::vector< unsigned int > raster1ChannelsVec,
+        const TePDITypes::TePDIRasterPtrType& raster2Ptr,
+        const std::vector< unsigned int > raster2ChannelsVec,
+        BlendMethod blendMethod,
+        TePDIInterpolator::InterpMethod interpMethod,
+        const TeGTParams& transParams,
+        const double& dummyValue,
+        const std::vector< double >& pixelOffsets1,
+        const std::vector< double >& pixelScales1,
+        const std::vector< double >& pixelOffsets2,
+        const std::vector< double >& pixelScales2,
+        const TePolygon& raster1Pol = TePolygon(), 
+        const TePolygon& raster2Pol = TePolygon() );
+        
+      /**
+       * @brief Blend a pixel value using the current parameters.
+       *
+       * @param line Line (raster 1 reference).
+       * @param col Column (raster 1 reference).
+       * @param rasterChannelsVecsIdx Vector index (the index
+       * to search the correct band/channel for each input raster
+       * from raster1ChannelsVec and raster2ChannelsVec).
+       * @param value Blended value.
+       * @note The caller of this method must be aware that the returned 
+       * blended value may be outside the original input rasters valid values 
+       * range.
+       *
+       */
+      inline void blend( const double& line, const double& col, 
+        const unsigned int& rasterChannelsVecsIdx , double& value )
+      {
+        return (this->*blendFunctPtr_)( line, col, rasterChannelsVecsIdx, 
+          value );
+      };
+
+    protected :
+    
+      /**
+       * @brief Type definition for the a bleding function pointer.
+       *
+       * @param line Line.
+       * @param col Column.
+       * @param band Band.
+       * @param value Interpolated value.
+       */      
+      typedef void (TePDIBlender::*BlendFunctPtr)( const double& line, 
+        const double& col, const unsigned int& band, double& value );    
+        
+      /** @brief Current dummy value (default:0). */      
+      double dummyValue_;          
+        
+      /**
+       * @brief The current blending method pointer (default:noBlendMethod).
+       */      
+      BlendFunctPtr blendFunctPtr_;        
+       
+      /** @brief Current blending method (default:NoBlendMethod). */      
+      BlendMethod blendMethod_;  
+           
+      /** @brief The relation between the two rasters boinding box -
+      raster 1 indexed reference (default:0) */
+      short relation_;
+      
+      /** @brief Current geometrical transformation pointer. */      
+      TeGeometricTransformation::pointer transPrt_;      
+    
+      /** @brief Input raster 1 pointer. */      
+      TePDITypes::TePDIRasterPtrType raster1Ptr_;
+      
+      /** @brief Input raster 1 used channels vector. */      
+      std::vector< unsigned int > raster1ChannelsVec_;
+      
+      /** @brief Input raster 2 pointer. */      
+      TePDITypes::TePDIRasterPtrType raster2Ptr_;
+      
+      /** @brief Input raster 2 used channels vector. */      
+      std::vector< unsigned int > raster2ChannelsVec_;
+      
+      /** @brief Input raster 1 internal interpolator instance. */      
+      TePDIInterpolator interp1Instance_;      
+      
+      /** @brief Input raster 2 internal interpolator instance. */      
+      TePDIInterpolator interp2Instance_;      
+      
+      // noBlendMethodImp temporary used variables
+      TeCoord2D noBlendMethodImp_coord1_;
+      TeCoord2D noBlendMethodImp_coord2_;
+      
+      // eucBlendMethodImp temporary used variables
+      TeCoord2D eucBlendMethodImp_coord1_;
+      TeCoord2D eucBlendMethodImp_coord2_;
+      double eucBlendMethodImp_value1_; 
+      double eucBlendMethodImp_value2_;
+      double eucBlendMethodImp_weight1_;
+      double eucBlendMethodImp_weight2_;
+      double eucBlendMethodImp_minDistToR1_;
+      double eucBlendMethodImp_minDistToR2_;
+      TeCoord2D eucBlendMethodImp_curCoord_;
+      TeCoord2D eucBlendMethodImp_dummyCoord_;
+      double eucBlendMethodImp_currDist_;
+      unsigned int eucBlendMethodImp_iLSIdx_;
+      
+      // meanBlendMethodImp temporary used variables
+      TeCoord2D meanBlendMethodImp_coord1_;
+      TeCoord2D meanBlendMethodImp_coord2_;
+      double meanBlendMethodImp_value1_; 
+      double meanBlendMethodImp_value2_;
+      
+      /** @brief Intersection polygon between the two images 
+      (indexed - raster 1 indexed reference ) */
+      TePolygon interPolR1IdxRef_;
+      
+      /** @brief Intersection polygon line sets that are inside the
+       * raster 1 bounding box (raster 1 indexed reference) */    
+      TeLineSet interLineSetInR1_;
+      
+      /** @brief Intersection polygon line sets that are inside the
+       * raster 2 bounding box (raster 1 indexed reference) */    
+      TeLineSet interLineSetInR2_;
+
+      /** @brief The values offsets to be applied to raster 1 pixel
+       * values before the blended value calcule (one element for each
+       * used raster channel/band).
+       */       
+      std::vector< double > pixelOffsets1_;
+      
+      /** @brief pixelScale1 The values scale to be applied to raster 1 pixel
+       * values before the blended value calcule (one element for each
+       * used raster channel/band).
+       */
+      std::vector< double > pixelScales1_;
+      
+      /** @brief pixelOff2 The values offset to be applied to raster 2 pixel
+       * values before the blended value calcule (one element for each
+       * used raster channel/band).
+       */
+      std::vector< double > pixelOffsets2_;
+      
+      /** @param pixelScale2 The values scale to be applied to raster 2 pixel
+       * values before the blended value calcule (one element for each
+       * used raster channel/band).        
+       */
+      std::vector< double > pixelScales2_;
+      
+      /**
+       * @brief Reset this instance cleaning all allocated resources.
+       */      
+      void reset();
+      
+      // just like the method blend above
+      void noBlendMethodImp( const double& line, const double& col,
+        const unsigned int& rasterChannelsVecsIdx, double& value ); 
+        
+      // just like the method blend above
+      void eucBlendMethodImp( const double& line, const double& col,
+        const unsigned int& rasterChannelsVecsIdx, double& value );
+            
+      // just like the method blend above
+      void meanBlendMethodImp( const double& line, const double& col,
+        const unsigned int& rasterChannelsVecsIdx, double& value );            
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDIBlending.cpp b/src/terralib/image_processing/TePDIBlending.cpp
deleted file mode 100755
index add6f6a..0000000
--- a/src/terralib/image_processing/TePDIBlending.cpp
+++ /dev/null
@@ -1,1094 +0,0 @@
-#include "TePDIBlending.hpp"
-
-#include <TePDIBlendStratFactory.hpp>
-#include <TePDIStatistic.hpp>
-#include <TePDIContrast.hpp>
-#include <TePDIUtils.hpp>
-#include <TeAgnostic.h>
-
-#include <TeOverlay.h>
-#include <TeGeometryAlgorithms.h>
-
-
-TePDIBlending::TePDIBlending()
-{
-}
-
-
-TePDIBlending::~TePDIBlending()
-{
-}
-
-
-void TePDIBlending::ResetState( const TePDIParameters& )
-{
-}
-
-
-bool TePDIBlending::CheckParameters( const TePDIParameters& parameters ) const
-{
-  /* Checking input_raster1 */
-  
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster1", 
-    input_raster1 ),
-    "Missing parameter: input_raster1" );
-  TEAGN_TRUE_OR_RETURN( input_raster1.isActive(),
-    "Invalid parameter: input_raster1 inactive" );
-  TEAGN_TRUE_OR_RETURN( input_raster1->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: input_raster1 not ready" );
-  TEAGN_TRUE_OR_RETURN( ( input_raster1->params().projection() != 0 ),
-    "Invalid parameter: input_raster1 do not have a projection" );
-    
-  /* Checking input_raster2 */
-  
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster2", 
-    input_raster2 ),
-    "Missing parameter: input_raster2" );
-  TEAGN_TRUE_OR_RETURN( input_raster2.isActive(),
-    "Invalid parameter: input_raster2 inactive" );
-  TEAGN_TRUE_OR_RETURN( input_raster2->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: input_raster2 not ready" );    
-  TEAGN_TRUE_OR_RETURN( ( input_raster2->params().projection() != 0 ),
-    "Invalid parameter: input_raster2 do not have a projection" );
-    
-  /* Checking output_raster */
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
-    output_raster ),
-    "Missing parameter: output_raster" );
-  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
-    "Invalid parameter: output_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );    
-    
-  /* channels1 parameter checking */
-
-  std::vector< int > channels1;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "channels1", channels1 ), 
-    "Missing parameter: channels1" );
-  for( unsigned int channels1_index = 0 ; 
-    channels1_index < channels1.size() ; 
-    ++channels1_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( channels1[ channels1_index ] >= 0 ) &&
-      ( channels1[ channels1_index ] < input_raster1->nBands() ),
-      "Invalid parameter: channels1" );
-  }
-  
-  /* channels2 parameter checking */
-
-  std::vector< int > channels2;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "channels2", channels2 ), 
-    "Missing parameter: channels2" );
-  TEAGN_TRUE_OR_RETURN( ( channels2.size() == channels1.size() ),
-    "Size mismatch between channels1 and channels2" );
-  for( unsigned int channels2_index = 0 ; 
-    channels2_index < channels2.size() ; 
-    ++channels2_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( channels2[ channels2_index ] >= 0 ) &&
-      ( channels2[ channels2_index ] < input_raster2->nBands() ),
-      "Invalid parameter: channels2" );
-  } 
-    
-  /* Checking raster polygons */
-  
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster1_pol_ptr", 
-    raster1_pol_ptr ), "Missing parameter : raster1_pol_ptr" );
-  TEAGN_TRUE_OR_RETURN( raster1_pol_ptr.isActive(),
-    "Invalid parameter : raster1_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN(
-    ( ! input_raster1->begin( *raster1_pol_ptr, TeBoxPixelIn, 
-    0 ).end() ), "Invalid parameter : raster1_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN( ( raster1_pol_ptr->size() == 1 ),
-    "Invalid parameter : raster1_pol_ptr" )
-    
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster2_pol_ptr", 
-    raster2_pol_ptr ), "Missing parameter : raster2_pol_ptr" );
-  TEAGN_TRUE_OR_RETURN( raster2_pol_ptr.isActive(),
-    "Invalid parameter : raster2_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN(
-    ( ! input_raster2->begin( *raster2_pol_ptr, TeBoxPixelIn, 
-    0 ).end() ), "Invalid parameter : raster2_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN( ( raster2_pol_ptr->size() == 1 ),
-    "Invalid parameter : raster2_pol_ptr" )
-    
-  /* Checking raster2 polygon offsets */
-  
-  double raster2_pol_offset_x = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster2_pol_offset_x", 
-    raster2_pol_offset_x ), "Missing parameter : raster2_pol_offset_x" );  
-
-  double raster2_pol_offset_y = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster2_pol_offset_y", 
-    raster2_pol_offset_y ), "Missing parameter : raster2_pol_offset_y" );
-    
-  /* Checking the blending_type parameter */ 
-  
-  std::string blending_type;
-  
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "blending_type", 
-    blending_type ), "Missing parameter: blending_type" );
-    
-  TePDIBlendStratFactory::TeFactoryMap::iterator fac_map_it = 
-    TePDIBlendStratFactory::instance().find( blending_type );
-    
-  TEAGN_TRUE_OR_RETURN( 
-    ( fac_map_it != TePDIBlendStratFactory::instance().end() ),
-    "Invalid parameter: blending_type" );
-       
-  return true;
-}
-
-
-bool TePDIBlending::RunImplementation()
-{
-  bool auto_equalize = false;
-  if( params_.CheckParameter< int >( "auto_equalize" ) ) {
-    
-    auto_equalize = true;
-  }
-  
-  /* Converting input rasters to multiband */
-  {
-    TePDITypes::TePDIRasterPtrType input_raster1;
-    params_.GetParameter( "input_raster1", input_raster1 );  
-    
-    TePDITypes::TePDIRasterPtrType input_raster2;
-    params_.GetParameter( "input_raster2", input_raster2 );  
-  
-    TePDITypes::TePDIRasterPtrType input_raster1_multiband;
-    
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::convert2MultiBand( input_raster1,
-      progress_enabled_, input_raster1_multiband ), 
-      "Multi-band conversion error" );
-      
-    params_.SetParameter( "input_raster1", input_raster1_multiband );    
-  
-    TePDITypes::TePDIRasterPtrType input_raster2_multiband;
-    
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::convert2MultiBand( input_raster2,
-      progress_enabled_, input_raster2_multiband ), 
-      "Multi-band conversion error" );
-      
-    params_.SetParameter( "input_raster2", input_raster2_multiband );   
-  }
-  
-  /* Reseting output raster */
-  
-  TEAGN_TRUE_OR_RETURN( resetOuputRaster(), "Output raster reset error" );
-  
-  /* Auto equalizing ( if required ) */
-  
-  if( auto_equalize ) {
-    TEAGN_TRUE_OR_RETURN( equalizeInputRaster2(),
-      "input_raster2 equalizing error" );
-  }
-  
-  short pols_relation = 0;   
-    
-  /* Rendering the non-intersected areas */
-  
-  TEAGN_TRUE_OR_RETURN( renderNonIntersectedAreas( pols_relation ), 
-    "Non-intersected area redering error" );     
-    
-  /* Calling the blending strategy */  
-  
-  if( ( pols_relation != TeDISJOINT ) && ( pols_relation != TeTOUCHES ) ) {
-    std::string blending_type;
-    params_.GetParameter( "blending_type", blending_type );  
-    
-    TePDIBlendingStrategy::pointer blending_strategy( 
-      TePDIBlendStratFactory::make( blending_type, params_ ) );
-        
-    TEAGN_TRUE_OR_RETURN( blending_strategy.isActive(), 
-      "Unable to buil blend strategy" );
-      
-    TEAGN_TRUE_OR_RETURN( blending_strategy->Apply( params_ ),
-      "Error applying blending strategy" );    
-  }
-  
-  return true;
-}
-
-
-bool TePDIBlending::renderNonIntersectedAreas( short& pols_relation )
-{
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  params_.GetParameter( "input_raster1", input_raster1 );
-  TeRaster& input_raster1_ref = *( input_raster1.nakedPointer() );
-
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  params_.GetParameter( "input_raster2", input_raster2 );  
-  TeRaster& input_raster2_ref = *( input_raster2.nakedPointer() );
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params_.GetParameter( "output_raster", output_raster );
-  TeRaster& output_raster_ref = *( output_raster.nakedPointer() );
-
-  std::vector< int > channels1;
-  params_.GetParameter( "channels1", channels1 );
-  
-  std::vector< int > channels2;
-  params_.GetParameter( "channels2", channels2 );  
-  
-  /* Guessing dummy use */
-  
-  bool not_using_dummy = true;
-  double dummy_value = 0;
-  
-  if( params_.CheckParameter< double >( "dummy_value" ) ) {
-    
-    params_.GetParameter( "dummy_value", dummy_value );
-    
-    not_using_dummy = false;
-  }  
-  
-  /* Calculating intersecion polygons data */
-  
-  TePolygon new_raster1_polygon;
-  TePolygon new_raster2_polygon_ref_out;
-  TePolygon dummy_inter_pol;
-  TePolygon dummy_inter_pol_ref2;
-  double raster1_rel_index_offset_x = 0;
-  double raster1_rel_index_offset_y = 0;
-  double raster2_rel_index_offset_x = 0;
-  double raster2_rel_index_offset_y = 0;
-
-  TEAGN_TRUE_OR_RETURN( extractPolygons( params_, new_raster1_polygon,
-    new_raster2_polygon_ref_out, dummy_inter_pol, dummy_inter_pol_ref2,
-    pols_relation,
-    raster1_rel_index_offset_x, raster1_rel_index_offset_y,
-    raster2_rel_index_offset_x, raster2_rel_index_offset_y ),
-    "Error extracting intersection polygons" );
-  
-  /* Global vars */
-  
-  TeRaster::iteratorPoly input_raster1_it;
-  if( new_raster1_polygon.size() != 0 ) {
-    input_raster1_it =
-      output_raster->begin( new_raster1_polygon, TeBoxPixelIn, 0 );
-  }
-      
-  TeRaster::iteratorPoly input_raster2_it;
-  if( new_raster2_polygon_ref_out.size() != 0 ) {
-    input_raster2_it =
-    output_raster->begin( new_raster2_polygon_ref_out, TeBoxPixelIn, 0 );
-  }
-      
-  TePDIPIManager progress( "Rendering non-intersected area...", 
-    channels1.size() * ( input_raster1_it.nLinesInPoly() + 
-    input_raster2_it.nLinesInPoly() ), progress_enabled_ );    
-  
-  /* Transfering non-intersected areas */
-  
-  for( unsigned int channels_index = 0 ; channels_index < channels1.size() ;
-    ++channels_index ) {
-    
-    const unsigned int channel1 = channels1[ channels_index ];
-    const unsigned int channel2 = channels2[ channels_index ];
-
-    /* Transfering raster 1 - non-intersected area */
-    
-    if( new_raster1_polygon.size() != 0 ) {
-      input_raster1_it =
-        output_raster->begin( new_raster1_polygon, TeBoxPixelIn, 0 );
-    
-      unsigned int last_line = 0;  
-      unsigned int curr_line = 0;
-      unsigned int curr_col = 0;
-      double curr_value = 0;  
-      int offset_x = TeRound( raster1_rel_index_offset_x );
-      int offset_y = TeRound( raster1_rel_index_offset_y );
-      
-      while( ! input_raster1_it.end() ) {
-        curr_line = input_raster1_it.currentLine();
-        curr_col = input_raster1_it.currentColumn();
-          
-        if( input_raster1_ref.getElement( curr_col + offset_x, 
-            curr_line + offset_y, curr_value, channel1 ) ) {
-            
-          if( not_using_dummy || 
-            ( curr_value != dummy_value ) ) {
-            
-            TEAGN_TRUE_OR_RETURN( 
-              output_raster_ref.setElement( curr_col, curr_line, curr_value, 
-              channels_index ),
-              "Unable to write to output raster at line=" + 
-              Te2String( curr_line ) + 
-              " col=" + Te2String( curr_col ) );                    
-          }
-        }
-    
-        if( curr_line != last_line ) {
-          last_line = curr_line;
-          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-            "Canceled by the user" );
-        }
-        
-        ++input_raster1_it;
-      } 
-    }
-  
-    /* Transfering raster 2 - non-intersected area */
-    
-    if( new_raster2_polygon_ref_out.size() != 0 ) {
-      input_raster2_it =
-        output_raster->begin( new_raster2_polygon_ref_out, TeBoxPixelIn, 0 );
-    
-      unsigned int last_line = 0;  
-      unsigned int curr_line = 0;
-      unsigned int curr_col = 0;
-      double curr_value = 0;  
-      int offset_x = TeRound( raster2_rel_index_offset_x );
-      int offset_y = TeRound( raster2_rel_index_offset_y );
-        
-      while( ! input_raster2_it.end() ) {
-        curr_line = input_raster2_it.currentLine();
-        curr_col = input_raster2_it.currentColumn();
-          
-        if( input_raster2_ref.getElement( curr_col + offset_x, 
-            curr_line + offset_y , curr_value, channel2 ) ) {
-            
-          if( not_using_dummy || 
-            ( curr_value != dummy_value ) ) {
-          
-            TEAGN_TRUE_OR_RETURN( 
-              output_raster_ref.setElement( curr_col, curr_line, curr_value, 
-              channels_index ), "Unable to write to output raster at line=" + 
-              Te2String( curr_line ) + " col=" + Te2String( curr_col ) );
-          }
-        }
-    
-        if( curr_line != last_line ) {
-          last_line = curr_line;
-          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-            "Canceled by the user" );
-        }
-        
-        ++input_raster2_it;
-      }
-    }
-  }
-  
-  return true;
-}
-
-
-bool TePDIBlending::equalizeInputRaster2()
-{
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  params_.GetParameter( "input_raster1", input_raster1 );
-
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  params_.GetParameter( "input_raster2", input_raster2 );
-  
-  std::vector< int > channels1;
-  params_.GetParameter( "channels1", channels1 );  
-  
-  std::vector< int > channels2;
-  params_.GetParameter( "channels2", channels2 );  
-  
-  bool enable_multi_thread = params_.CheckParameter< int >( 
-    "enable_multi_thread" );
-  
-  /* Guessing dummy use */
-  
-  bool forced_dummy = false;
-  double dummy_value = 0;
-  
-  if( params_.CheckParameter< double >( "dummy_value" ) ) {
-    
-    params_.GetParameter( "dummy_value", dummy_value );
-    
-    forced_dummy = true;
-  }    
-  
-  /* Calculating intersecion polygons data */
-  
-  TePolygon new_raster1_polygon;
-  TePolygon new_raster2_polygon;
-  TePolygon inter_pol_ref1;
-  TePolygon int_pol_ref2;
-  double raster1_rel_index_offset_x = 0;
-  double raster1_rel_index_offset_y = 0;
-  double raster2_rel_index_offset_x = 0;
-  double raster2_rel_index_offset_y = 0;
-  short pols_relation = 0;
-
-  TEAGN_TRUE_OR_RETURN( TePDIBlending::extractPolygons( params_, 
-    new_raster1_polygon, new_raster2_polygon, inter_pol_ref1, int_pol_ref2,
-    pols_relation,
-    raster1_rel_index_offset_x, raster1_rel_index_offset_y,
-    raster2_rel_index_offset_x, raster2_rel_index_offset_y ),
-    "Error extracting intersection polygons" );  
-  
-  /* Defining the overlap polygon over raster1 ( raster1 world index )*/
-    
-  if( pols_relation != TeDISJOINT ) {
-    /* Creating the thread parameters */
-    
-    std::vector< double > mean_vector_raster1;
-    std::vector< double > mean_vector_raster2;
-    
-    std::vector< double > variance_vector_raster1;
-    std::vector< double > variance_vector_raster2;
-    
-    TeThreadParameters t1_params;
-    t1_params.store( "input_raster", input_raster1 );
-    t1_params.store( "input_pol", inter_pol_ref1 );
-    t1_params.store( "progress_enabled_flag", 
-      TePDIAlgorithm::progress_enabled_ );
-    t1_params.store( "input_channels", channels1 );
-    t1_params.store( "mean_vector_ptr", &mean_vector_raster1 );
-    t1_params.store( "variance_vector_ptr", &variance_vector_raster1 );
-
-    TeThreadParameters t2_params;
-    t2_params.store( "input_raster", input_raster2 );
-    t2_params.store( "input_pol", int_pol_ref2 );
-    t2_params.store( "progress_enabled_flag", 
-      TePDIAlgorithm::progress_enabled_ );
-    t2_params.store( "input_channels", channels2 );
-    t2_params.store( "mean_vector_ptr", &mean_vector_raster2 );
-    t2_params.store( "variance_vector_ptr", &variance_vector_raster2 );
-    
-    /* Starting both threads to generate the mean and variance vectors
-       from both rasters */
-
-    if( enable_multi_thread ) {
-      TeThreadFunctor thread1;
-      thread1.setStartFunctPtr( getMeanAndVarianceThreadEntry );
-      
-      TeThreadFunctor thread2;
-      thread2.setStartFunctPtr( getMeanAndVarianceThreadEntry );
-        
-      thread1.setParameters( t1_params );
-      TEAGN_TRUE_OR_RETURN( thread1.start(),
-        "Error starting thread1" );  
-      thread2.setParameters( t2_params );
-      TEAGN_TRUE_OR_RETURN( thread2.start(),
-        "Error starting thread2" );         
-    
-      TEAGN_TRUE_OR_RETURN( thread1.waitToFinish(),
-        "Error waiting for thread to finish" )  
-      TEAGN_TRUE_OR_RETURN( thread2.waitToFinish(),
-        "Error waiting for thread to finish" )          
-    } else {
-      TEAGN_TRUE_OR_RETURN( getMeanAndVarianceThreadEntry( t1_params ),
-        "Error calculatin mean and variance from raster 1" );      
-      TEAGN_TRUE_OR_RETURN( getMeanAndVarianceThreadEntry( t2_params ),
-        "Error calculatin mean and variance from raster 2" );         
-    }
-    
-    TEAGN_DEBUG_CONDITION( ( mean_vector_raster1.size() == channels1.size() ),
-      "Invalid mean vector size" )
-    TEAGN_DEBUG_CONDITION( ( mean_vector_raster2.size() == channels2.size() ),
-      "Invalid mean vector size" )
-
-    TEAGN_DEBUG_CONDITION( ( variance_vector_raster1.size() == channels1.size() ),
-      "Invalid variance vector size" )
-    TEAGN_DEBUG_CONDITION( ( variance_vector_raster2.size() == channels1.size() ),
-      "Invalid variance vector size" )
-  
-    /* Creating a new raster2 */
-      
-    TePDITypes::TePDIRasterPtrType new_input_raster2;
-    
-    TeRasterParams new_input_raster2_params = input_raster2->params();
-    new_input_raster2_params.nBands( channels2.size() );
-    if( forced_dummy ) {
-      new_input_raster2_params.setDummy( dummy_value, -1 );      
-    } else {
-      if( input_raster2->params().useDummy_ ) {
-        new_input_raster2_params.setDummy( 
-          input_raster2->params().dummy_[ 0 ], -1 );
-      }
-    }
-    
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( new_input_raster2,
-      input_raster2->params(), TePDIUtils::TePDIUtilsAutoMemPol ), 
-      "Unable to allocate the new equalized raster2" );
-      
-    /* Equalizing data */
-        
-    std::vector< int > new_channels2;
-        
-    for( unsigned int channels_index = 0 ; 
-      channels_index < channels2.size() ; ++channels_index ) {
-      
-      TePDIParameters contra_params;
-      contra_params.SetParameter( "contrast_type",
-        TePDIContrast::TePDIContrastStat );
-      contra_params.SetParameter( "input_image", input_raster2 );
-      contra_params.SetParameter( "input_band", 
-        channels2[ channels_index] );
-      contra_params.SetParameter( "target_mean", 
-        mean_vector_raster1[ channels_index ] );
-      contra_params.SetParameter( "target_variance", 
-        variance_vector_raster1[ channels_index ] );
-      contra_params.SetParameter( "input_mean", 
-        mean_vector_raster2[ channels_index ] );
-      contra_params.SetParameter( "input_variance", 
-        variance_vector_raster2[ channels_index ] );        
-      contra_params.SetParameter( "output_image", new_input_raster2 );
-      contra_params.SetParameter( "output_band", (int)channels_index );
-      contra_params.SetParameter( "restrict_out_reset", (int)1 );
-      if( forced_dummy ) {
-        contra_params.SetParameter( "dummy_value", dummy_value );
-      }
-      if( forced_dummy ) {
-        contra_params.SetParameter( "dummy_value", dummy_value );
-      } else {
-        if( input_raster2->params().useDummy_ ) {
-          contra_params.SetParameter( "dummy_value", 
-            input_raster2->params().dummy_[ 0 ] );
-        }
-      }      
-        
-      TePDIContrast contra_instance;
-      TEAGN_TRUE_OR_RETURN( contra_instance.Reset( contra_params ),
-        "TePDIContrast reset error" );
-      TEAGN_TRUE_OR_RETURN( contra_instance.Apply(),
-        "TePDIContrast apply error" );            
-        
-      new_channels2.push_back( channels_index );
-    }        
-     
-    params_.SetParameter( "input_raster2", new_input_raster2 );
-    params_.SetParameter( "channels2", new_channels2 );  
-  }
-  
-  return true;
-}
-
-
-bool TePDIBlending::resetOuputRaster()
-{
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  params_.GetParameter( "input_raster1", input_raster1 );
-  
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  params_.GetParameter( "input_raster2", input_raster2 );  
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params_.GetParameter( "output_raster", output_raster );  
-  
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr;
-  params_.GetParameter( "raster1_pol_ptr", raster1_pol_ptr );
-  TePolygon& raster1_polygon = ( *raster1_pol_ptr );
-
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr;
-  params_.GetParameter( "raster2_pol_ptr", raster2_pol_ptr );
-  TePolygon& raster2_polygon = ( *raster2_pol_ptr );
-  
-  std::vector< int > channels1;
-  params_.GetParameter( "channels1", channels1 );  
-  
-  double raster2_pol_offset_x = 0;
-  params_.GetParameter( "raster2_pol_offset_x", raster2_pol_offset_x );
-
-  double raster2_pol_offset_y = 0;
-  params_.GetParameter( "raster2_pol_offset_y", raster2_pol_offset_y );  
-  
-  /* Dumyy value definition */
- 
-  bool output_raster_uses_dummy = output_raster->params().useDummy_;
-  double output_raster_dummy = 0;
-  
-  if( output_raster_uses_dummy ) {
-    output_raster_dummy = output_raster->params().dummy_[ 0 ];
-  }
-  
-  if( params_.CheckParameter< double >( "dummy_value" ) ) {
-    
-    params_.GetParameter( "dummy_value", output_raster_dummy );
-    
-    output_raster_uses_dummy = true;
-  }  
-  
-  /* Building raster 2 polygon - reference raster1 */
-  
-  TePolygon raster2_polygon_ref1;
-  {
-    TePolygon raster2_polygon_indexed_ref2;
-    TePDIUtils::MapCoords2RasterIndexes( raster2_polygon,
-      input_raster2, raster2_polygon_indexed_ref2 );
-        
-    double r2_min_x = 
-      MIN( raster2_polygon_indexed_ref2.box().x1(),
-      raster2_polygon_indexed_ref2.box().x2() );
-    double r2_min_y = 
-      MIN( raster2_polygon_indexed_ref2.box().y1(),
-      raster2_polygon_indexed_ref2.box().y2() ); 
-     
-    for( unsigned int lr_index = 0 ; 
-      lr_index < raster2_polygon_indexed_ref2.size() ; ++lr_index ) {
-      for( unsigned int c2d_index = 0 ; 
-        c2d_index < raster2_polygon_indexed_ref2[ lr_index ].size() ; 
-        ++c2d_index ) {
-          
-        raster2_polygon_indexed_ref2[ lr_index ][ c2d_index ].x( 
-          raster2_polygon_indexed_ref2[ lr_index ][ c2d_index ].x() +
-          raster2_pol_offset_x - r2_min_x );
-        raster2_polygon_indexed_ref2[ lr_index ][ c2d_index ].y( 
-          raster2_polygon_indexed_ref2[ lr_index ][ c2d_index ].y() +
-          raster2_pol_offset_y - r2_min_y );
-      }
-    }
-  
-    TePDIUtils::MapRasterIndexes2Coords( raster2_polygon_indexed_ref2,
-      input_raster1, raster2_polygon_ref1 );
-  }  
-
-  /* Reseting output raster */
-  
-  TeBox global_box_ref1 = raster1_polygon.box();
-  updateBox( global_box_ref1, raster2_polygon_ref1.box() );
-  
-  TeRasterParams output_raster_params = output_raster->params();
-  
-  output_raster_params.nBands( channels1.size() );
-  if( input_raster1->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      input_raster1->projection()->params() ) );  
-    output_raster_params.projection( proj.nakedPointer() );
-  }
-  output_raster_params.boxResolution( global_box_ref1.x1(), 
-    global_box_ref1.y1(), global_box_ref1.x2(), global_box_ref1.y2(), 
-    input_raster1->params().resx_, input_raster1->params().resy_ );
-  if( output_raster_uses_dummy ) {
-    output_raster_params.setDummy( output_raster_dummy, -1 );
-  } else {
-    output_raster_params.useDummy_ = false;
-  }
-  output_raster_params.setPhotometric( TeRasterParams::TeMultiBand );
-     
-  TEAGN_TRUE_OR_RETURN( output_raster->init( output_raster_params ),
-    "Output raster reset error" );  
-    
-  return true;
-}
-
-
-bool TePDIBlending::extractPolygons( const TePDIParameters& params, 
-  TePolygon& new_raster1_pol_ref1, TePolygon& new_raster2_pol_ref1, 
-  TePolygon& inter_pol_ref1, TePolygon& inter_pol_ref2,
-  short& relation, double& raster1_rel_index_offset_x,
-  double& raster1_rel_index_offset_y, double& raster2_rel_index_offset_x,
-  double& raster2_rel_index_offset_y )
-{
-  new_raster1_pol_ref1.clear();
-  new_raster2_pol_ref1.clear();
-  inter_pol_ref1.clear();
-  inter_pol_ref2.clear();
-  
-  /* Extracting the used parameter */
-  
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  TEAGN_TRUE_OR_THROW( params.GetParameter( "input_raster1", input_raster1 ),
-    "Missing input_raster1" );
-  
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  TEAGN_TRUE_OR_THROW(params.GetParameter( "input_raster2", input_raster2 ),
-    "Missing input_raster2" );  
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_THROW(params.GetParameter( "output_raster", output_raster ),
-    "Missing output_raster" ); 
-     
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr;
-  TEAGN_TRUE_OR_THROW(params.GetParameter( "raster1_pol_ptr", 
-    raster1_pol_ptr ), "Missing raster1_pol_ptr" ); 
-  TePolygon& raster1_polygon = ( *raster1_pol_ptr ); 
-  
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr;
-  TEAGN_TRUE_OR_THROW(params.GetParameter( "raster2_pol_ptr", 
-    raster2_pol_ptr ), "Missing raster2_pol_ptr" );  
-  TePolygon& raster2_polygon = ( *raster2_pol_ptr );
-  
-  double raster2_pol_offset_x = 0;
-  TEAGN_TRUE_OR_THROW(params.GetParameter( "raster2_pol_offset_x", 
-    raster2_pol_offset_x ), "Missing raster2_pol_offset_x" );  
-
-  double raster2_pol_offset_y = 0;
-  TEAGN_TRUE_OR_THROW(params.GetParameter( "raster2_pol_offset_y", 
-    raster2_pol_offset_y ), "Missing raster2_pol_offset_y" );
-
-  /* Raster1 positioning */
-  
-  double raster1_abs_index_offset_x = 0;/* related to output raster indexes */
-  double raster1_abs_index_offset_y = 0;/* related to output raster indexes */
-  {
-    TeBox pol1_box_indexed;
-    TePDIUtils::MapCoords2RasterIndexes( raster1_polygon.box(),
-      input_raster1, pol1_box_indexed );
-          
-    double r1_min_x_index_ref1 = MIN( pol1_box_indexed.x1(),
-      pol1_box_indexed.x2() );
-    double r1_min_y_index_ref1 = MIN( pol1_box_indexed.y1(),
-      pol1_box_indexed.y2() );      
-
-    TeCoord2D r1_UL_ref1_indexed( r1_min_x_index_ref1, r1_min_y_index_ref1 );  
-    TeCoord2D r1_UL_ref1( input_raster1->index2Coord( r1_UL_ref1_indexed ) );  
-    TeCoord2D r1_UL_refout_indexed( output_raster->coord2Index( r1_UL_ref1 ) );
-    
-    /* Calculating the absolute offset betweeen input raster1 and output raster
-       following output raster indexed units */    
-        
-    raster1_abs_index_offset_x = r1_UL_refout_indexed.x();  
-    raster1_abs_index_offset_y = r1_UL_refout_indexed.y();
-    
-    /* Calculating the relative offset betweeen input raster1 and output raster
-       following output raster indexed units */    
-      
-    raster1_rel_index_offset_x = r1_UL_ref1_indexed.x() -
-      raster1_abs_index_offset_x;
-    raster1_rel_index_offset_y = r1_UL_ref1_indexed.y() -
-      raster1_abs_index_offset_y;
-  }
-  
-  /* Raster2 positioning */
-  
-  TePolygon r2_pol_refout;
-  {
-    TePolygon r2_pol_ref2_indexed;
-    TePDIUtils::MapCoords2RasterIndexes( raster2_polygon,
-      input_raster2, r2_pol_ref2_indexed );
-      
-    double r2_min_x = MIN( r2_pol_ref2_indexed.box().x1(),
-      r2_pol_ref2_indexed.box().x2() );
-    double r2_min_y = MIN( r2_pol_ref2_indexed.box().y1(),
-      r2_pol_ref2_indexed.box().y2() );
-  
-    raster2_rel_index_offset_x = r2_min_x - raster1_abs_index_offset_x -
-      raster2_pol_offset_x;
-    raster2_rel_index_offset_y = r2_min_y - raster1_abs_index_offset_y -
-      raster2_pol_offset_y;
-      
-    TePolygon r2_pol_refout_indexed = r2_pol_ref2_indexed;
-        
-    for( unsigned int lr_index = 0 ; 
-      lr_index < r2_pol_refout_indexed.size() ; ++lr_index ) {
-      for( unsigned int c2d_index = 0 ; 
-        c2d_index < r2_pol_refout_indexed[ lr_index ].size() ; 
-        ++c2d_index ) {
-            
-        r2_pol_refout_indexed[ lr_index ][ c2d_index ].x( 
-          r2_pol_refout_indexed[ lr_index ][ c2d_index ].x() -
-          r2_min_x + raster1_abs_index_offset_x + raster2_pol_offset_x );
-        r2_pol_refout_indexed[ lr_index ][ c2d_index ].y( 
-          r2_pol_refout_indexed[ lr_index ][ c2d_index ].y() -
-          r2_min_y + raster1_abs_index_offset_y + raster2_pol_offset_y );          
-      }
-    }
-    
-    TePDIUtils::MapRasterIndexes2Coords( r2_pol_refout_indexed,
-      output_raster, r2_pol_refout );
-  }
-  
-  /* Defining the new rasters polygons and the intersection polygons */
-  
-  relation = TeRelation( raster1_polygon, 
-    r2_pol_refout );
-  
-  switch( relation ) {
-    case TeEQUALS :
-    {
-      inter_pol_ref1 = raster1_polygon;
-      
-      return true;
-      break;
-    }
-    case TeDISJOINT :
-    case TeTOUCHES :
-    {
-      new_raster1_pol_ref1 = raster1_polygon;
-      new_raster2_pol_ref1 = r2_pol_refout;
-    
-      break;
-    }
-    case TeOVERLAPS:
-    {
-      TePolygonSet r1_ps;
-      r1_ps.add( raster1_polygon );
-
-      TePolygonSet r2_ps;
-      r2_ps.add( r2_pol_refout );
-      
-      /* Calculating the new raster1 polygon  - following raster1 projected 
-         coords */
-      
-      {
-        TePolygonSet ps_new;
-        
-        TEAGN_TRUE_OR_THROW( TeOVERLAY::TeDifference( r1_ps, 
-          r2_ps, ps_new ),
-            "Unable to find the new input_raster1 polygon" );
-        
-        TEAGN_TRUE_OR_THROW( ( ps_new.size() == 1 ),
-          "Invalid polygon set size" );
-          
-        new_raster1_pol_ref1 = ps_new[ 0 ];
-      }      
-      
-      /* Calculating the new raster2 polygon  - following raster1 projected 
-         coords */
-      
-      {
-        TePolygonSet ps_new;
-        
-        TEAGN_TRUE_OR_THROW( TeOVERLAY::TeDifference( r2_ps, 
-          r1_ps, ps_new ),
-            "Unable to find the new input_raster1 polygon" );
-          
-        TEAGN_TRUE_OR_THROW( ( ps_new.size() == 1 ),
-          "Invalid polygon set size" );
-          
-        new_raster2_pol_ref1 = ps_new[ 0 ];
-      }    
-      
-      /* Calculating the intersection polygon  - following raster1 projected 
-         coords */
-      
-      {
-        TePolygonSet ps_new;
-        
-        TEAGN_TRUE_OR_THROW( TeOVERLAY::TeIntersection( r1_ps, r2_ps, 
-          ps_new ), "Unable to find polygons intersection" );
-        
-        TEAGN_TRUE_OR_THROW( ( ps_new.size() == 1 ),
-          "Invalid polygon set size" );
-          
-        inter_pol_ref1 = ps_new[ 0 ];
-      }
-
-      /* Calculating the intersection polygon  - following raster2 projected 
-         coords */
-            
-      {
-        TePolygon inter_pol_indexed_refout;
-        TePDIUtils::MapCoords2RasterIndexes( inter_pol_ref1,
-          output_raster, inter_pol_indexed_refout );
-          
-        for( unsigned int lr_index = 0 ; 
-          lr_index < inter_pol_indexed_refout.size() ; ++lr_index ) {
-          for( unsigned int c2d_index = 0 ; 
-            c2d_index < inter_pol_indexed_refout[ lr_index ].size() ; 
-            ++c2d_index ) {
-                
-            inter_pol_indexed_refout[ lr_index ][ c2d_index ].x( 
-              inter_pol_indexed_refout[ lr_index ][ c2d_index ].x() +
-              raster2_rel_index_offset_x );
-            inter_pol_indexed_refout[ lr_index ][ c2d_index ].y( 
-              inter_pol_indexed_refout[ lr_index ][ c2d_index ].y() +
-              raster2_rel_index_offset_y );          
-          }
-        }
-        
-        TePDIUtils::MapRasterIndexes2Coords( inter_pol_indexed_refout,
-          input_raster2, inter_pol_ref2 );        
-      }
-    
-      break;
-    }
-    case TeCONTAINS :
-    case TeCOVERS :    
-    {
-      TePolygonSet r1_ps;
-      r1_ps.add( raster1_polygon );
-
-      TePolygonSet r2_ps;
-      r2_ps.add( r2_pol_refout );
-      
-      /* Calculating the new raster1 polygon  - following raster1 projected 
-         coords */      
-          
-      {
-        TePolygonSet ps_new;
-        
-        TEAGN_TRUE_OR_THROW( TeOVERLAY::TeDifference( r1_ps, 
-          r2_ps, ps_new ),
-            "Unable to find the new input_raster1 polygon" );
-        
-        TEAGN_TRUE_OR_THROW( ( ps_new.size() == 1 ),
-          "Invalid polygon set size" );
-          
-        new_raster1_pol_ref1 = ps_new[ 0 ];
-      }
-      
-      inter_pol_ref1 = r2_pol_refout;
-      
-      /* Calculating the intersection polygon  - following raster2 projected 
-         coords */
-            
-      {
-        TePolygon inter_pol_indexed_refout;
-        TePDIUtils::MapCoords2RasterIndexes( inter_pol_ref1,
-          output_raster, inter_pol_indexed_refout );
-          
-        for( unsigned int lr_index = 0 ; 
-          lr_index < inter_pol_indexed_refout.size() ; ++lr_index ) {
-          for( unsigned int c2d_index = 0 ; 
-            c2d_index < inter_pol_indexed_refout[ lr_index ].size() ; 
-            ++c2d_index ) {
-                
-            inter_pol_indexed_refout[ lr_index ][ c2d_index ].x( 
-              inter_pol_indexed_refout[ lr_index ][ c2d_index ].x() +
-              raster2_rel_index_offset_x );
-            inter_pol_indexed_refout[ lr_index ][ c2d_index ].y( 
-              inter_pol_indexed_refout[ lr_index ][ c2d_index ].y() +
-              raster2_rel_index_offset_y );          
-          }
-        }
-        
-        TePDIUtils::MapRasterIndexes2Coords( inter_pol_indexed_refout,
-          input_raster2, inter_pol_ref2 );        
-      }   
-      
-      break;
-    }
-    case TeWITHIN :
-    case TeCOVEREDBY :
-    {
-      TePolygonSet r1_ps;
-      r1_ps.add( raster1_polygon );
-
-      TePolygonSet r2_ps;
-      r2_ps.add( r2_pol_refout );     
-      
-      /* Calculating the new raster2 polygon  - following raster1 projected 
-         coords */      
-
-      {
-        TePolygonSet ps_new;
-        
-        TEAGN_TRUE_OR_THROW( TeOVERLAY::TeDifference( r2_ps, 
-          r1_ps, ps_new ),
-            "Unable to find the new input_raster1 polygon" );
-          
-        TEAGN_TRUE_OR_THROW( ( ps_new.size() == 1 ),
-          "Invalid polygon set size" );
-          
-        new_raster2_pol_ref1 = ps_new[ 0 ];
-      }
-      
-      inter_pol_ref1 = raster1_polygon;
-      
-      /* Calculating the intersection polygon  - following raster2 projected 
-         coords */
-            
-      {
-        TePolygon inter_pol_indexed_refout;
-        TePDIUtils::MapCoords2RasterIndexes( inter_pol_ref1,
-          output_raster, inter_pol_indexed_refout );
-          
-        for( unsigned int lr_index = 0 ; 
-          lr_index < inter_pol_indexed_refout.size() ; ++lr_index ) {
-          for( unsigned int c2d_index = 0 ; 
-            c2d_index < inter_pol_indexed_refout[ lr_index ].size() ; 
-            ++c2d_index ) {
-                
-            inter_pol_indexed_refout[ lr_index ][ c2d_index ].x( 
-              inter_pol_indexed_refout[ lr_index ][ c2d_index ].x() +
-              raster2_rel_index_offset_x );
-            inter_pol_indexed_refout[ lr_index ][ c2d_index ].y( 
-              inter_pol_indexed_refout[ lr_index ][ c2d_index ].y() +
-              raster2_rel_index_offset_y );          
-          }
-        }
-        
-        TePDIUtils::MapRasterIndexes2Coords( inter_pol_indexed_refout,
-          input_raster2, inter_pol_ref2 );        
-      }       
-      
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_THROW( "Invalid polygon relation" );
-      break;
-    }
-  }
-  
-  return true;
-}
-
-bool TePDIBlending::getMeanAndVarianceThreadEntry( const TeThreadParameters& pars )
-{
-  /* Retriving input parameters */
-  
-  TePDITypes::TePDIRasterPtrType input_raster;
-  TEAGN_TRUE_OR_RETURN( pars.retrive( "input_raster", input_raster ),
-    "Missing input_raster parameter" );  
-  
-  TePolygon input_pol;
-  TEAGN_TRUE_OR_RETURN( pars.retrive( "input_pol", input_pol ),
-    "Missing input_pol parameter" );
-    
-  bool progress_enabled_flag = false;
-  TEAGN_TRUE_OR_RETURN( pars.retrive( "progress_enabled_flag", 
-    progress_enabled_flag ),
-    "Missing progress_enabled_flag parameter" ); 
-    
-  std::vector< int > input_channels;   
-  TEAGN_TRUE_OR_RETURN( pars.retrive( "input_channels", 
-    input_channels ),
-    "Missing input_channels parameter" ); 
-        
-  /* Retriving output parameters */
-    
-  std::vector< double >* mean_vector_ptr = 0;
-  TEAGN_TRUE_OR_RETURN( pars.retrive( "mean_vector_ptr", mean_vector_ptr ),
-    "Missing mean_vector_ptr parameter" );
-  mean_vector_ptr->clear();
-  
-  std::vector< double >* variance_vector_ptr = 0;
-  TEAGN_TRUE_OR_RETURN( pars.retrive( "variance_vector_ptr", 
-    variance_vector_ptr ),
-    "Missing variance_vector_ptr parameter" );
-  variance_vector_ptr->clear();
-    
-  /* Generating algorithm parameters */
-    
-  TePDIParameters stat_params;
-    
-  TePDITypes::TePDIRasterVectorType rasters;
-  for( unsigned int channels_index = 0 ; 
-    channels_index < input_channels.size() ; ++channels_index ) {
-      
-    rasters.push_back( input_raster );
-  }
-  stat_params.SetParameter( "rasters", rasters );
-  
-  stat_params.SetParameter( "bands", input_channels );
-  
-  TePDITypes::TePDIPolygonSetPtrType polygonset_ptr( new TePolygonSet );
-  polygonset_ptr->add( input_pol );
-  stat_params.SetParameter( "polygonset", polygonset_ptr );
-  
-  /* Generating mean and variance vectors */
-  
-  TePDIStatistic stat_instance;
-  stat_instance.ToggleProgInt( progress_enabled_flag );
-
-  TEAGN_TRUE_OR_RETURN( stat_instance.Reset( stat_params ),
-    "TePDIStatistic reset error" );
-    
-  for( unsigned int channels_index = 0 ; 
-    channels_index < input_channels.size() ; ++channels_index ) {
-      
-    mean_vector_ptr->push_back( stat_instance.getMean( channels_index, 0 ) );
-    variance_vector_ptr->push_back( stat_instance.getVariance( channels_index, 
-      0 ) );
-  }
-  
-  return true;
-}
-
diff --git a/src/terralib/image_processing/TePDIBlending.hpp b/src/terralib/image_processing/TePDIBlending.hpp
deleted file mode 100755
index 327b01f..0000000
--- a/src/terralib/image_processing/TePDIBlending.hpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIBLENDING_HPP
-  #define TEPDIBLENDING_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIParameters.hpp"
-  
-  #include <TeSharedPtr.h>
-  #include <TeGeometry.h>
-  #include <TeThreadFunctor.h>
-
-  /**
-   * @brief This is the class for digital image blending.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIGeneralAlgoGroup
-   *
-   * @note The general required parameters:
-   * @param blending_type ( std::string ) - Blending type
-   * ( see TePDIBlendStratFactory for reference ).
-   * @param input_raster1 ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Input raster 1.
-   * @param input_raster2 ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Input raster 2.
-   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
-   * @param channels1 ( std::vector< int > ) - The channels to process from 
-   * input_raster1.
-   * @param channels2 ( std::vector< int > ) - The channels to process from 
-   * input_raster2.
-   * @param raster1_pol_ptr ( TePDITypes::TePDIPolygonPtrType ) - 
-   * Raster 1 polygon pointer ( related to
-   * input_raster1 world reference - Just 1 linear ring allowed ).
-   * @param raster2_pol_ptr ( TePDITypes::TePDIPolygonPtrType ) - 
-   * Raster 2 polygon pointer ( related to 
-   * input_raster2 world reference - Just 1 linear ring allowed ).
-   * @param raster2_pol_offset_x ( double ) - Raster 2 polygon box X offset 
-   * related to raster1 polygon box in input_raster1 matricial reference
-   * ( offset_x = pol2_x - pol1_x ).
-   * @param raster2_pol_offset_y ( double ) - Raster 2 polygon box Y offset 
-   * related to raster1 polygon box in input_raster1 matricial reference
-   * ( offset_y = pol2_y - pol1_y ). 
-   *
-   * @note The optional parameters are:
-   *
-   * @param auto_equalize ( int ) - If present ( any value ), input_raster2
-   * auto-equalizing will be made ( using overlap area reference ).
-   * @param dummy_value (double) - A dummy pixel value for use 
-   * in pixels where no data is available ( input pixels with
-   * dummy values will be ignored ).  
-   * @param enable_multi_thread (int) - If present(any value) will
-   * enable multi-threading.  
-   *
-   * @note The specific parameters: See each blending strategy for reference.
-   *
-   * @note The output_raster parameters will follow input_raster1 parameters
-   * ( box, resolution, projection ).
-   *
-   * @note All rasters will be converted to multi-band.
-   */
-  class PDI_DLL TePDIBlending : public TePDIAlgorithm {
-    public :
-    
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIBlending();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIBlending();
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;      
-      
-      /**
-       * @brief Calculate the polygons for rendering output image.
-       * @param params Algorithm parameters.
-       * @param new_raster1_pol_ref1 The new raster1 polygon
-       * ( reference - raster1 projected coords ).
-       * @param new_raster2_pol_ref1 The new raster2 polygon
-       * ( reference - raster1 projected coords ).
-       * @param inter_pol_ref1 The calculated intersection polygon
-       * ( reference - raster1 projected coords ).
-       * @param inter_pol_ref2 The calculated intersection polygon
-       * ( reference - raster2 projected coords ).
-       * @param relation The calculated polygons relation.
-       * @param raster1_rel_index_offset_x X offset between output and input
-       * raster 1 ( reference output_raster indexed units -> 
-       * input_x = output_x + offset ).
-       * @param raster1_rel_index_offset_y Y offset between output and input
-       * raster 1 ( reference output_raster indexed units -> 
-       * input_y = output_y + offset ).
-       * @param raster2_rel_index_offset_x X offset between output and input
-       * raster 2 ( reference output_raster indexed units -> 
-       * input_x = output_x + offset ).
-       * @param raster2_rel_index_offset_y Y offset between output and input
-       * raster 2 ( reference output_raster indexed units -> 
-       * input_y = output_y + offset ).
-       * @return true if ok, false on errors.
-       */
-      static bool extractPolygons( const TePDIParameters& params,
-        TePolygon& new_raster1_pol_ref1, TePolygon& new_raster2_pol_ref1,
-        TePolygon& inter_pol_ref1, TePolygon& inter_pol_ref2,
-        short& relation,
-        double& raster1_rel_index_offset_x,
-        double& raster1_rel_index_offset_y,
-        double& raster2_rel_index_offset_x,
-        double& raster2_rel_index_offset_y );
-
-    protected :
-    
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );    
-     
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();      
-
-      /**
-       * @brief Render into output raster the non-intersected areas.
-       * @param pols_relation The found raster polygons relation (output).  
-       * @return true if ok, false on errors.
-       */
-      bool renderNonIntersectedAreas( short& pols_relation );
-      
-      /**
-       * @brief Equalize the input_raster2.
-       * @return true if ok, false on errors.
-       */
-      bool equalizeInputRaster2();
-        
-      /**
-       * @brief Reset the output raster to the new geometry.
-       * @return true if ok, false on errors.
-       */
-      bool resetOuputRaster(); 
-      
-      /**
-       * @brief The mean and variance thread entry function.
-       * @param pars Thread parameters.
-       * @return true if ok, false on errors.
-       * @note The needed thread parameters are:
-       * * TePDITypes::TePDIRasterPtrType input_raster
-       * * TePolygon input_pol
-       * * bool progress_enabled_flag
-       * * std::vector< int > input_channels
-       * * std::vector< double >* mean_vector_ptr
-       * * std::vector< double >* variance_vector_ptr
-       */      
-      static bool getMeanAndVarianceThreadEntry( 
-        const TeThreadParameters& pars );
-  };
-  
-/** @example TePDIBlending_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
diff --git a/src/terralib/image_processing/TePDIBlendingFactory.cpp b/src/terralib/image_processing/TePDIBlendingFactory.cpp
deleted file mode 100755
index c490222..0000000
--- a/src/terralib/image_processing/TePDIBlendingFactory.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
- 
-#include "TePDIBlendingFactory.hpp"
-#include "TePDIBlending.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIBlendingFactory::TePDIBlendingFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIBlending" ) )
-{
-};      
-
-
-TePDIBlendingFactory::~TePDIBlendingFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIBlendingFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIBlending();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
diff --git a/src/terralib/image_processing/TePDIBlendingFactory.hpp b/src/terralib/image_processing/TePDIBlendingFactory.hpp
deleted file mode 100755
index 72b5812..0000000
--- a/src/terralib/image_processing/TePDIBlendingFactory.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIBLENDINGFACTORY_HPP
-  #define TEPDIBLENDINGFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for blending algorithm factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIBlendingFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIBlendingFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIBlendingFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIBlendingFactory TePDIBlendingFactory_instance;
-  };  
-  
-#endif
diff --git a/src/terralib/image_processing/TePDIBlendingStrategy.cpp b/src/terralib/image_processing/TePDIBlendingStrategy.cpp
deleted file mode 100755
index d4cc0ef..0000000
--- a/src/terralib/image_processing/TePDIBlendingStrategy.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "TePDIBlendingStrategy.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIBlendingStrategy::TePDIBlendingStrategy()
-{
-};      
-
-
-TePDIBlendingStrategy::~TePDIBlendingStrategy()
-{
-};
-
-
-TePDIBlendingStrategy* TePDIBlendingStrategy::DefaultObject( 
-  const TePDIParameters& )
-{
-  TEAGN_LOG_AND_THROW( 
-    "Trying to build an invalid blending strategy instance" );
-  return 0; 
-}
-
diff --git a/src/terralib/image_processing/TePDIBlendingStrategy.hpp b/src/terralib/image_processing/TePDIBlendingStrategy.hpp
deleted file mode 100755
index 4f1c9e1..0000000
--- a/src/terralib/image_processing/TePDIBlendingStrategy.hpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIBLENDINGSTRATEGY_HPP
-  #define TEPDIBLENDINGSTRATEGY_HPP
-
-  #include "TePDIStrategy.hpp"
-
-  /**
-   * @brief This is the base class for blending strategies.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategies
-   */
-  class PDI_DLL TePDIBlendingStrategy : public TePDIStrategy {
-    public:
-      /** @typedef TeSharedPtr< TePDIBlendingStrategy > pointer 
-          Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIBlendingStrategy > pointer;
-      
-      /** @typedef const TeSharedPtr< TePDIBlendingStrategy > const_pointer 
-          Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIBlendingStrategy > const_pointer;  
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIBlendingStrategy();      
-      
-      /**
-       * @brief Returns a default object.
-       *
-       * @return A default object.
-       */
-      static TePDIBlendingStrategy* DefaultObject( const TePDIParameters& );
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIBlendingStrategy();        
-  
-  };
-  
-#endif
-
-
-
diff --git a/src/terralib/image_processing/TePDIBufferedFilter.cpp b/src/terralib/image_processing/TePDIBufferedFilter.cpp
old mode 100755
new mode 100644
index 49c9daf..98b1df4
--- a/src/terralib/image_processing/TePDIBufferedFilter.cpp
+++ b/src/terralib/image_processing/TePDIBufferedFilter.cpp
@@ -1,173 +1,173 @@
-#include "TePDIBufferedFilter.hpp"
-
-#include <TeAgnostic.h>
-
-TePDIBufferedFilter::TePDIBufferedFilter()
-{
-  init_conv_buf();
-  init_maskmatrix();
-}
-
-
-TePDIBufferedFilter::~TePDIBufferedFilter()
-{
-  reset_conv_buf( 0, 0 );
-  TePDIFilterMask::deleteWeightsMatrix( temp_maskmatrix_, temp_maskmatrix_lines_ );
-}
-
-
-void TePDIBufferedFilter::ResetState( const TePDIParameters& params )
-{
-  TePDIParameters dummy_params = params;
-
-  reset_conv_buf( 0, 0 );
-  TePDIFilterMask::deleteWeightsMatrix( temp_maskmatrix_, temp_maskmatrix_lines_ );
-}
-
-
-void TePDIBufferedFilter::init_conv_buf()
-{
-  conv_buf_ = 0;
-  conv_buf_lines_ = 0;
-  conv_buf_columns_ = 0;
-}
-
-
-void TePDIBufferedFilter::init_maskmatrix()
-{
-  temp_maskmatrix_ = 0;
-  temp_maskmatrix_lines_ = 0;
-  temp_maskmatrix_columns_ = 0;
-}
-
-
-void TePDIBufferedFilter::reset_conv_buf( unsigned int lines, unsigned int columns )
-{
-  if( conv_buf_ != 0 ) {
-    for( unsigned int line = 0 ; line < conv_buf_lines_ ; ++line ) {
-      delete[] conv_buf_[ line ];
-    }
-
-    delete[] conv_buf_;
-
-    conv_buf_ = 0;
-    conv_buf_lines_ = 0;
-    conv_buf_columns_ = 0;
-  }
-
-  if( ( lines > 0 ) && ( columns > 0 ) ) {
-    conv_buf_ = new double*[ lines ];
-
-    TEAGN_TRUE_OR_THROW( conv_buf_ != 0, "Memory allocation error" );
-
-    for( unsigned int line = 0 ; line < lines ; ++line ) {
-      conv_buf_[ line ] = new double[ columns ];
-
-      TEAGN_TRUE_OR_THROW( conv_buf_[ line ] != 0, "Memory allocation error" );
-    }
-
-    conv_buf_lines_ = lines;
-    conv_buf_columns_ = columns;
-  }
-}
-
-
-void TePDIBufferedFilter::up_conv_buf( TePDITypes::TePDIRasterPtrType& inRaster,
-  unsigned int line, unsigned int band )
-{
-  TEAGN_DEBUG_CONDITION( inRaster.isActive(), "Inactive pointer" );
-  
-  TeRaster* inRaster_nptr = inRaster.nakedPointer();
-
-  TEAGN_DEBUG_CONDITION( ( inRaster_nptr->params().nlines_ > (int)line ),
-    "Trying to get a non existent line from raster" );
-  TEAGN_DEBUG_CONDITION( ( inRaster_nptr->params().ncols_ == 
-    (int)conv_buf_columns_ ),
-    "Buffer columns number not equal to raster columns" );
-  TEAGN_DEBUG_CONDITION( ( (int)band < inRaster_nptr->params().nBands() ),
-    "Invalid Band" );
-    
-  bool dummy_used = inRaster_nptr->params().useDummy_;
-  double dummy_value = 0;
-  if( dummy_used ) {
-    dummy_value = inRaster_nptr->params().dummy_[ band ];
-  }
-
-  /* Buffer roll up */
-
-  conv_buf_roolup( 1 );
-
-  /* Updating the last line */
-
-  unsigned int conv_buf_last_line = conv_buf_lines_ - 1;
-
-  for( unsigned int bufcolumn = 0 ; bufcolumn < conv_buf_columns_ ; ++bufcolumn ) {
-    if( ! inRaster_nptr->getElement( bufcolumn, line,
-        conv_buf_[ conv_buf_last_line ][ bufcolumn ], band ) ) {
-        
-      TEAGN_TRUE_OR_THROW( dummy_used, "Unable to read from input raster" );
-      
-      conv_buf_[ conv_buf_last_line ][ bufcolumn ] = dummy_value;
-    }
-  }
-}
-
-
-void TePDIBufferedFilter::reset_maskmatrix( TePDIFilterMask::pointer& mask )
-{
-  TePDIFilterMask::deleteWeightsMatrix( temp_maskmatrix_, temp_maskmatrix_lines_ );
-
-  temp_maskmatrix_ = mask->getWeightsMatrix();
-  temp_maskmatrix_lines_ = mask->lines();
-  temp_maskmatrix_columns_ = mask->columns();
-}
-
-
-void TePDIBufferedFilter::conv_buf_estatistics( unsigned int start_line,
-  unsigned int start_column, unsigned int width, unsigned int height, double& mean,
-  double& variance )
-{
-  TEAGN_DEBUG_CONDITION( ( conv_buf_lines_ >= ( start_line + height ) ),
-    "Invalid convolution buffer lines" );
-  TEAGN_DEBUG_CONDITION( ( conv_buf_columns_ >= ( start_column + width ) ),
-    "Invalid convolution buffer columns" );
-
-  mean = 0;
-  variance = 0;
-
-  unsigned int line_bound = start_line + height;
-  unsigned int column_bound = start_column + width;
-  double buf_value;
-
-  for( unsigned int line = start_line ; line < line_bound ; ++line ) {
-    for( unsigned int column = start_column ; column < column_bound ; ++column ) {
-      buf_value = conv_buf_[ line ][ column ];
-      mean += buf_value;
-      variance += ( buf_value * buf_value );
-    }
-  }
-
-  mean =  mean / ((double)width)  / ((double)height);
-  variance = ( variance / ((double)width) / ((double)height) ) -
-             ( mean * mean );
-}
-
-
-void TePDIBufferedFilter::conv_buf_roolup( unsigned int count )
-{
-  TEAGN_DEBUG_CONDITION( ( conv_buf_lines_ > 0 ), "Invalid convolution buffer lines" );
-
-  double* first_buf_line_ptr;
-  unsigned int conv_buf_last_line = conv_buf_lines_ - 1;
-  unsigned int bufline;
-
-  for( unsigned int cur_count = 0 ; cur_count < count ; ++cur_count ) {
-    first_buf_line_ptr = conv_buf_[ 0 ];
-
-    for( bufline = 1 ; bufline < conv_buf_lines_ ; ++bufline ) {
-      conv_buf_[ bufline - 1 ] = conv_buf_[ bufline ];
-    }
-
-    conv_buf_[ conv_buf_last_line ] = first_buf_line_ptr;
-  }
-}
+#include "TePDIBufferedFilter.hpp"
+
+#include <TeAgnostic.h>
+
+TePDIBufferedFilter::TePDIBufferedFilter()
+{
+  init_conv_buf();
+  init_maskmatrix();
+}
+
+
+TePDIBufferedFilter::~TePDIBufferedFilter()
+{
+  reset_conv_buf( 0, 0 );
+  TePDIFilterMask::deleteWeightsMatrix( temp_maskmatrix_, temp_maskmatrix_lines_ );
+}
+
+
+void TePDIBufferedFilter::ResetState( const TePDIParameters& params )
+{
+  TePDIParameters dummy_params = params;
+
+  reset_conv_buf( 0, 0 );
+  TePDIFilterMask::deleteWeightsMatrix( temp_maskmatrix_, temp_maskmatrix_lines_ );
+}
+
+
+void TePDIBufferedFilter::init_conv_buf()
+{
+  conv_buf_ = 0;
+  conv_buf_lines_ = 0;
+  conv_buf_columns_ = 0;
+}
+
+
+void TePDIBufferedFilter::init_maskmatrix()
+{
+  temp_maskmatrix_ = 0;
+  temp_maskmatrix_lines_ = 0;
+  temp_maskmatrix_columns_ = 0;
+}
+
+
+void TePDIBufferedFilter::reset_conv_buf( unsigned int lines, unsigned int columns )
+{
+  if( conv_buf_ != 0 ) {
+    for( unsigned int line = 0 ; line < conv_buf_lines_ ; ++line ) {
+      delete[] conv_buf_[ line ];
+    }
+
+    delete[] conv_buf_;
+
+    conv_buf_ = 0;
+    conv_buf_lines_ = 0;
+    conv_buf_columns_ = 0;
+  }
+
+  if( ( lines > 0 ) && ( columns > 0 ) ) {
+    conv_buf_ = new double*[ lines ];
+
+    TEAGN_TRUE_OR_THROW( conv_buf_ != 0, "Memory allocation error" );
+
+    for( unsigned int line = 0 ; line < lines ; ++line ) {
+      conv_buf_[ line ] = new double[ columns ];
+
+      TEAGN_TRUE_OR_THROW( conv_buf_[ line ] != 0, "Memory allocation error" );
+    }
+
+    conv_buf_lines_ = lines;
+    conv_buf_columns_ = columns;
+  }
+}
+
+
+void TePDIBufferedFilter::up_conv_buf( TePDITypes::TePDIRasterPtrType& inRaster,
+  unsigned int line, unsigned int band )
+{
+  TEAGN_DEBUG_CONDITION( inRaster.isActive(), "Inactive pointer" );
+  
+  TeRaster* inRaster_nptr = inRaster.nakedPointer();
+
+  TEAGN_DEBUG_CONDITION( ( inRaster_nptr->params().nlines_ > (int)line ),
+    "Trying to get a non existent line from raster" );
+  TEAGN_DEBUG_CONDITION( ( inRaster_nptr->params().ncols_ == 
+    (int)conv_buf_columns_ ),
+    "Buffer columns number not equal to raster columns" );
+  TEAGN_DEBUG_CONDITION( ( (int)band < inRaster_nptr->params().nBands() ),
+    "Invalid Band" );
+    
+  bool dummy_used = inRaster_nptr->params().useDummy_;
+  double dummy_value = 0;
+  if( dummy_used ) {
+    dummy_value = inRaster_nptr->params().dummy_[ band ];
+  }
+
+  /* Buffer roll up */
+
+  conv_buf_roolup( 1 );
+
+  /* Updating the last line */
+
+  unsigned int conv_buf_last_line = conv_buf_lines_ - 1;
+
+  for( unsigned int bufcolumn = 0 ; bufcolumn < conv_buf_columns_ ; ++bufcolumn ) {
+    if( ! inRaster_nptr->getElement( bufcolumn, line,
+        conv_buf_[ conv_buf_last_line ][ bufcolumn ], band ) ) {
+        
+      TEAGN_TRUE_OR_THROW( dummy_used, "Unable to read from input raster" );
+      
+      conv_buf_[ conv_buf_last_line ][ bufcolumn ] = dummy_value;
+    }
+  }
+}
+
+
+void TePDIBufferedFilter::reset_maskmatrix( TePDIFilterMask::pointer& mask )
+{
+  TePDIFilterMask::deleteWeightsMatrix( temp_maskmatrix_, temp_maskmatrix_lines_ );
+
+  temp_maskmatrix_ = mask->getWeightsMatrix();
+  temp_maskmatrix_lines_ = mask->lines();
+  temp_maskmatrix_columns_ = mask->columns();
+}
+
+
+void TePDIBufferedFilter::conv_buf_estatistics( unsigned int start_line,
+  unsigned int start_column, unsigned int width, unsigned int height, double& mean,
+  double& variance )
+{
+  TEAGN_DEBUG_CONDITION( ( conv_buf_lines_ >= ( start_line + height ) ),
+    "Invalid convolution buffer lines" );
+  TEAGN_DEBUG_CONDITION( ( conv_buf_columns_ >= ( start_column + width ) ),
+    "Invalid convolution buffer columns" );
+
+  mean = 0;
+  variance = 0;
+
+  unsigned int line_bound = start_line + height;
+  unsigned int column_bound = start_column + width;
+  double buf_value;
+
+  for( unsigned int line = start_line ; line < line_bound ; ++line ) {
+    for( unsigned int column = start_column ; column < column_bound ; ++column ) {
+      buf_value = conv_buf_[ line ][ column ];
+      mean += buf_value;
+      variance += ( buf_value * buf_value );
+    }
+  }
+
+  mean =  mean / ((double)width)  / ((double)height);
+  variance = ( variance / ((double)width) / ((double)height) ) -
+             ( mean * mean );
+}
+
+
+void TePDIBufferedFilter::conv_buf_roolup( unsigned int count )
+{
+  TEAGN_DEBUG_CONDITION( ( conv_buf_lines_ > 0 ), "Invalid convolution buffer lines" );
+
+  double* first_buf_line_ptr;
+  unsigned int conv_buf_last_line = conv_buf_lines_ - 1;
+  unsigned int bufline;
+
+  for( unsigned int cur_count = 0 ; cur_count < count ; ++cur_count ) {
+    first_buf_line_ptr = conv_buf_[ 0 ];
+
+    for( bufline = 1 ; bufline < conv_buf_lines_ ; ++bufline ) {
+      conv_buf_[ bufline - 1 ] = conv_buf_[ bufline ];
+    }
+
+    conv_buf_[ conv_buf_last_line ] = first_buf_line_ptr;
+  }
+}
diff --git a/src/terralib/image_processing/TePDIBufferedFilter.hpp b/src/terralib/image_processing/TePDIBufferedFilter.hpp
old mode 100755
new mode 100644
index 1de293d..e148470
--- a/src/terralib/image_processing/TePDIBufferedFilter.hpp
+++ b/src/terralib/image_processing/TePDIBufferedFilter.hpp
@@ -1,152 +1,152 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIBUFFEREDFILTER_HPP
-  #define TEPDIBUFFEREDFILTER_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIParameters.hpp"
-  #include "TePDITypes.hpp"
-  #include "TePDIFilterMask.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the base class for buffer based filters.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIFiltersGroup
-   */
-  class PDI_DLL TePDIBufferedFilter : public TePDIAlgorithm {
-    public :
-      /** @typedef Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIBufferedFilter > pointer;
-      /** @typedef Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIBufferedFilter > const_pointer;
-
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIBufferedFilter();
-
-    protected :
-      /**
-       * @brief Convolution Buffer.
-       */
-      double** conv_buf_;
-
-      /**
-       * @brief Convolution Buffer lines.
-       */
-      unsigned int conv_buf_lines_;
-
-      /**
-       * @brief Convolution Buffer columns.
-       */
-      unsigned int conv_buf_columns_;
-
-      /**
-       * @brief Temporary representation of filter masks.
-       */
-      double** temp_maskmatrix_;
-
-      /**
-       * @brief Number of lines of the temporary representation of filter masks.
-       */
-      unsigned int temp_maskmatrix_lines_;
-
-      /**
-       * @brief Number of columns of the temporary representation of filter masks.
-       */
-      unsigned int temp_maskmatrix_columns_;
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIBufferedFilter();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      virtual void ResetState( const TePDIParameters& params );
-
-      /**
-       * @brief Initiates the convolution buffer.
-       */
-      void init_conv_buf();
-
-      /**
-       * @brief Initiates the internal filter mask matrix representation.
-       */
-      void init_maskmatrix();
-
-      /**
-       * @brief Resets the convolution buffer.
-       *
-       * @param lines Convolution buffer lines.
-       * @param columns Convolution buffer columns.
-       */
-      void reset_conv_buf( unsigned int lines, unsigned int columns );
-
-      /**
-       * @brief Resets the internal filter mask matrix representation..
-       *
-       * @param mask The new filter Mask.
-       */
-      void reset_maskmatrix( TePDIFilterMask::pointer& mask );
-
-      /**
-       * @brief Updates the convolution buffer with a new raster line.
-       *
-       * @param inRaster Input Raster.
-       * @param line Raster line.
-       * @param band Raster band.
-       */
-      void up_conv_buf( TePDITypes::TePDIRasterPtrType& inRaster, unsigned int line,
-        unsigned int band );
-
-      /**
-       * @brief Generates statistics of a suplied window inside the convolution buffer.
-       *
-       * @param start_line Convolution buffer start line.
-       * @param start_column Convolution buffer start column.
-       * @param width Window width.
-       * @param height Window height.
-       * @param mean Mean.
-       * @param variance variance.
-       */
-      void conv_buf_estatistics( unsigned int start_line, unsigned int start_column,
-        unsigned int width, unsigned int height, double& mean, double& variance );
-
-      /**
-       * @brief Rools up the convolution buffer count lines.
-       *
-       * @param count Count times to rool convolution buffer.
-       */
-      void conv_buf_roolup( unsigned int count );
-
-  };
-
-#endif //TEPDIBUFFEREDFILTER_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIBUFFEREDFILTER_HPP
+  #define TEPDIBUFFEREDFILTER_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIParameters.hpp"
+  #include "TePDITypes.hpp"
+  #include "TePDIFilterMask.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the base class for buffer based filters.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIFiltersGroup
+   */
+  class PDI_DLL TePDIBufferedFilter : public TePDIAlgorithm {
+    public :
+      /** @typedef Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIBufferedFilter > pointer;
+      /** @typedef Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIBufferedFilter > const_pointer;
+
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TePDIBufferedFilter();
+
+    protected :
+      /**
+       * @brief Convolution Buffer.
+       */
+      double** conv_buf_;
+
+      /**
+       * @brief Convolution Buffer lines.
+       */
+      unsigned int conv_buf_lines_;
+
+      /**
+       * @brief Convolution Buffer columns.
+       */
+      unsigned int conv_buf_columns_;
+
+      /**
+       * @brief Temporary representation of filter masks.
+       */
+      double** temp_maskmatrix_;
+
+      /**
+       * @brief Number of lines of the temporary representation of filter masks.
+       */
+      unsigned int temp_maskmatrix_lines_;
+
+      /**
+       * @brief Number of columns of the temporary representation of filter masks.
+       */
+      unsigned int temp_maskmatrix_columns_;
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIBufferedFilter();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      virtual void ResetState( const TePDIParameters& params );
+
+      /**
+       * @brief Initiates the convolution buffer.
+       */
+      void init_conv_buf();
+
+      /**
+       * @brief Initiates the internal filter mask matrix representation.
+       */
+      void init_maskmatrix();
+
+      /**
+       * @brief Resets the convolution buffer.
+       *
+       * @param lines Convolution buffer lines.
+       * @param columns Convolution buffer columns.
+       */
+      void reset_conv_buf( unsigned int lines, unsigned int columns );
+
+      /**
+       * @brief Resets the internal filter mask matrix representation..
+       *
+       * @param mask The new filter Mask.
+       */
+      void reset_maskmatrix( TePDIFilterMask::pointer& mask );
+
+      /**
+       * @brief Updates the convolution buffer with a new raster line.
+       *
+       * @param inRaster Input Raster.
+       * @param line Raster line.
+       * @param band Raster band.
+       */
+      void up_conv_buf( TePDITypes::TePDIRasterPtrType& inRaster, unsigned int line,
+        unsigned int band );
+
+      /**
+       * @brief Generates statistics of a suplied window inside the convolution buffer.
+       *
+       * @param start_line Convolution buffer start line.
+       * @param start_column Convolution buffer start column.
+       * @param width Window width.
+       * @param height Window height.
+       * @param mean Mean.
+       * @param variance variance.
+       */
+      void conv_buf_estatistics( unsigned int start_line, unsigned int start_column,
+        unsigned int width, unsigned int height, double& mean, double& variance );
+
+      /**
+       * @brief Rools up the convolution buffer count lines.
+       *
+       * @param count Count times to rool convolution buffer.
+       */
+      void conv_buf_roolup( unsigned int count );
+
+  };
+
+#endif //TEPDIBUFFEREDFILTER_HPP
diff --git a/src/terralib/image_processing/TePDICluster.cpp b/src/terralib/image_processing/TePDICluster.cpp
old mode 100755
new mode 100644
index 2e5b95a..2f26c7c
--- a/src/terralib/image_processing/TePDICluster.cpp
+++ b/src/terralib/image_processing/TePDICluster.cpp
@@ -1,349 +1,349 @@
-#include "TePDICluster.hpp"
-
-#include <iostream>
-
-using namespace std;
-
-TePDICluster::TePDICluster(int nBands) : nbands(nBands), nElems(0)
-{
-  mean.clear();
-  variance.clear();
-  eVec.clear();
-  e2Vec.clear();
-
-  for(int i = 0; i < nbands; ++i)
-  {
-    mean.push_back(0);
-    variance.push_back(0);
-    eVec.push_back(0);
-    e2Vec.push_back(0);
-  }
-}
-
-TePDICluster::~TePDICluster()
-{
-}
-
-// Assignment operator
-const TePDICluster& TePDICluster::operator=(const TePDICluster& clu)
-{
-  id = clu.id;
-  nbands = clu.nbands;
-  area = clu.area;
-  nreg = clu.nreg;
-  mean.reserve(nbands);
-  covar = clu.covar;
-  lu = clu.lu;
-  lndet = clu.lndet;
-  initialized = clu.initialized;
-  nElems = clu.nElems;
-
-  for(int i = 0; i < nbands; i++)
-  {
-    mean.push_back(clu.mean[i]);
-  variance.push_back(clu.variance[i]);
-  eVec.push_back(clu.eVec[i]);
-  e2Vec.push_back(clu.e2Vec[i]);
-  }
-
-  return (*this);
-}
-
-// equal operator
-bool TePDICluster::operator==(TePDICluster clu)
-{
-  bool r = true;
-
-  r = r && (id == clu.id);
-  r = r && (nbands == clu.nbands);
-  r = r && (area == clu.area);
-  r = r && (nreg == clu.nreg);
-  r = r && (covar == clu.covar);
-  r = r && (lu == clu.lu);
-  r = r && (lndet == clu.lndet);
-  r = r && (initialized == clu.initialized);
-
-  for(int i = 0; i < nbands; i++)
-    r = r && (mean[i] == clu.mean[i]);
-
-  return r;
-}
-
-// Initialize cluster with its identifier and with statistics
-bool TePDICluster::Init(int ident, TePDIRegion reg)
-{
-  if(ident <= 0)
-    return false;
-
-  id = ident;
-  nbands = reg.GetNban();
-  area = (long) reg.GetArea();
-  nreg = 1;
-  mean.reserve(nbands);
-  mean = reg.GetMean();
-  initialized = true;
-
-  TEAGN_TRUE_OR_RETURN(covar.Init(nbands, nbands, 0.0), "Problem initializing covar Matrix");
-  covar = reg.GetCovar();
-  if(!covar.Initialized())
-    return false;
-  lndet = covar.Determinant();
-  lndet = ((lndet > 0.0) ? log(lndet) : 0.0);
-  if (!covar.CholeskyDecomp(lu))
-    lu.Init(nbands, 1.0);
-
-  return true;
-}
-
-// Add a region statistics to the cluster.
-bool TePDICluster::AddRegion(TePDIRegion reg)
-{
-  if(id <= 0)
-    return false;
-  if(nbands != reg.GetNban())
-    return false;
-
-  for(int i1 = 0; i1 < nbands; i1++)
-    mean[i1] = (mean[i1] * area + reg.Mean(i1) * reg.GetArea()) / (area + reg.GetArea());
-  area += reg.GetArea();
-  nreg++;
-
-  return true;
-}
-
-// Compute the Mahalanobis distance between the center of a region and the current cluster
-double TePDICluster::Distance(TePDIRegion reg)
-{
-  if (initialized == false)
-    return 100000.0;
-  if(nbands != reg.GetNban())
-    return 100000.0;
-
-
-  // Spring Method
-  double  dist = 0.0,
-      soma = 0.0;
-
-  for(int ban = 0; ban < nbands; ban++)
-  {
-    soma = 0.0;
-    for(int ban1 = 0; ban1 <= ban; ban1++)
-      soma += (mean[ban1] - reg.Mean(ban1)) * lu(ban, ban1);
-    dist += soma * soma;
-  }
-
-/*
-  // Hot method
-  TeMatrix  term_1, 
-        term_2, 
-        inverse, 
-        result, 
-        tmp;
-  double  dist = 0.0;
-
-  term_1.Init(1, nbands, 0.0);
-  term_2.Init(nbands, 1, 0.0);
-  inverse.Init(nbands, nbands, 0.0);
-  result.Init(1, 1, 0.0);
-  tmp.Init(nbands, 1, 0.0);
-
-  covar.Inverse(inverse);
-  for (int b = 0; b < nbands; b++)
-    term_1(0, b) = mean[b] - reg.Mean(b);
-  term_1.Transpose(term_2);
-  tmp = inverse * term_2;
-  result = term_1 * tmp;
-  dist = sqrt(result(0, 0));
-*/
-  return dist;
-}
-
-// Compute the Mahalanobis distance between the center of a cluster and the current cluster
-double TePDICluster::Distance(TePDICluster clu)
-{
-  if((initialized == false) || (clu.initialized == false))
-    return 100000.0;
-  if(nbands != clu.GetNban())
-    return 100000.0;
-
-  // Spring method
-  double  dist = 0.0,
-      sum = 0.0;
-
-  for(int ban = 0; ban < nbands; ban++)
-  {
-    sum = 0.0;
-    for(int ban1 = 0; ban1 <= ban; ban1++)
-      sum += (mean[ban1] - clu.mean[ban1]) * lu(ban, ban1);
-    dist += sum * sum;
-  }
-
-/*
-  // Hot Method
-  TeMatrix  term_1, 
-        term_2, 
-        inverse, 
-        result, 
-        tmp;
-  double  dist = 0.0;
-
-  term_1.Init(1, nbands, 0.0);
-  term_2.Init(nbands, 1, 0.0);
-  inverse.Init(nbands, nbands, 0.0);
-  result.Init(1, 1, 0.0);
-  tmp.Init(nbands, 1, 0.0);
-
-  covar.Inverse(inverse);
-  for (int b = 0; b < nbands; b++)
-    term_1(0, b) = mean[b] - clu.Mean(b);
-  term_1.Transpose(term_2);
-  tmp = inverse * term_2;
-  result = term_1 * tmp;
-  dist = sqrt(result(0, 0));
-*/
-  return dist;
-}
-
-// Returns the mean value.
-double TePDICluster::Mean(int ind)
-{
-  if (ind < nbands && ind >= 0)
-    return mean[ind];
-  return 0.0;
-}
-
-void TePDICluster::Merge(TePDICluster clu)
-{
-  for( int ban = 0; ban < nbands; ban++ )
-    mean[ban] = (mean[ban] * area + clu.mean[ban] * clu.area) / (area + clu.area);
-  if(area < clu.area)
-  {
-    lu = clu.lu;
-    covar = clu.covar;
-    lndet = clu.lndet;
-  }
-  nreg += clu.nreg;
-}
-
-void TePDICluster::add( vector<double> pixValue )
-{
-  for(int i = 0 ; i < nbands; i++ )
-  {
-    eVec[i]  += pixValue[i];
-    e2Vec[i] += pixValue[i]*pixValue[i];
-  }
-  
-  ++nElems;
-}
-
-double  TePDICluster::dist( vector<double> pixValue )const
-{
-  double dist = 0;
-  double diff = 0;
-  
-  for(int i = 0 ; i < nbands; i++ )
-  {
-    diff = pixValue[i] - mean[i];
-    dist += diff * diff;
-  }
-
-  return dist;
-}
-
-double TePDICluster::getVariance( int ind )const
-{
-  return variance[ind];
-}
-
-double TePDICluster::maxVar()const
-{
-  if( nElems <= 1 )
-    return 0;
-
-  double maxvar = 0;
-  
-  for(int i = 0 ; i < nbands; i++ )
-  {
-    if( variance[i] > maxvar )
-    {
-      maxvar = variance[i];
-    }
-  }
-
-  return maxvar;
-}
-
-int TePDICluster::maxVarBand()const
-{
-  if( nElems <= 1 )
-    return 0;
-
-  double maxvar = 0;
-  int ind = -1;
-  for(int i = 0 ; i < nbands; i++ )
-  {
-    if( variance[i] > maxvar )
-    {
-      maxvar = variance[i];
-      ind = i;
-    }
-  }
-
-  return ind;
-}
-
-void TePDICluster::resetCount()
-{
-  nElems = 0;
-  for(int i = 0 ; i < nbands; i++ )
-  {
-    eVec[i] = 0;
-    e2Vec[i] = 0;
-  }
-}
-
-void TePDICluster::updateStatistics()
-{
-  for(int i = 0 ; i < nbands; i++ )
-  {
-    double e2 = e2Vec[i] /(double)nElems;
-    double e  = eVec[i] /(double)nElems;
-    variance[i]  = nElems > 0 ? e2 - e * e : 0;
-    mean[i] = nElems > 0 ? e : 0; 
-  }
-}
-
-TePDICluster TePDICluster::splitLeft()const
-{
-  int band = maxVarBand();
-  if( band < 0 )
-    return TePDICluster(0);
-
-  TePDICluster result(*this);
-  result.mean[band] = mean[band] - sqrt(variance[band]);
-  result.resetCount();
-  return result;
-}
-
-TePDICluster TePDICluster::splitRight()const
-{
-  int band = maxVarBand();
-  if( band < 0 )
-    return TePDICluster(0);
-
-  TePDICluster result(*this);
-  result.mean[band] = mean[band] + sqrt(variance[band]);
-  result.resetCount();
-  return result;
-}
-
-void TePDICluster::clear()
-{
-  nbands = 0;
-  nElems = 0;
-  
-  mean.clear();
-  variance.clear();
-  eVec.clear();
-  e2Vec.clear();
-}
+#include "TePDICluster.hpp"
+
+#include <iostream>
+
+using namespace std;
+
+TePDICluster::TePDICluster(int nBands) : nbands(nBands), nElems(0)
+{
+  mean.clear();
+  variance.clear();
+  eVec.clear();
+  e2Vec.clear();
+
+  for(int i = 0; i < nbands; ++i)
+  {
+    mean.push_back(0);
+    variance.push_back(0);
+    eVec.push_back(0);
+    e2Vec.push_back(0);
+  }
+}
+
+TePDICluster::~TePDICluster()
+{
+}
+
+// Assignment operator
+const TePDICluster& TePDICluster::operator=(const TePDICluster& clu)
+{
+  id = clu.id;
+  nbands = clu.nbands;
+  area = clu.area;
+  nreg = clu.nreg;
+  mean.reserve(nbands);
+  covar = clu.covar;
+  lu = clu.lu;
+  lndet = clu.lndet;
+  initialized = clu.initialized;
+  nElems = clu.nElems;
+
+  for(int i = 0; i < nbands; i++)
+  {
+    mean.push_back(clu.mean[i]);
+  variance.push_back(clu.variance[i]);
+  eVec.push_back(clu.eVec[i]);
+  e2Vec.push_back(clu.e2Vec[i]);
+  }
+
+  return (*this);
+}
+
+// equal operator
+bool TePDICluster::operator==(TePDICluster clu)
+{
+  bool r = true;
+
+  r = r && (id == clu.id);
+  r = r && (nbands == clu.nbands);
+  r = r && (area == clu.area);
+  r = r && (nreg == clu.nreg);
+  r = r && (covar == clu.covar);
+  r = r && (lu == clu.lu);
+  r = r && (lndet == clu.lndet);
+  r = r && (initialized == clu.initialized);
+
+  for(int i = 0; i < nbands; i++)
+    r = r && (mean[i] == clu.mean[i]);
+
+  return r;
+}
+
+// Initialize cluster with its identifier and with statistics
+bool TePDICluster::Init(int ident, TePDIRegion reg)
+{
+  if(ident <= 0)
+    return false;
+
+  id = ident;
+  nbands = reg.GetNban();
+  area = (long) reg.GetArea();
+  nreg = 1;
+  mean.reserve(nbands);
+  mean = reg.GetMean();
+  initialized = true;
+
+  TEAGN_TRUE_OR_RETURN(covar.Init(nbands, nbands, 0.0), "Problem initializing covar Matrix");
+  covar = reg.GetCovar();
+  if(!covar.Initialized())
+    return false;
+  lndet = covar.Determinant();
+  lndet = ((lndet > 0.0) ? log(lndet) : 0.0);
+  if (!covar.CholeskyDecomp(lu))
+    lu.Init(nbands, 1.0);
+
+  return true;
+}
+
+// Add a region statistics to the cluster.
+bool TePDICluster::AddRegion(TePDIRegion reg)
+{
+  if(id <= 0)
+    return false;
+  if(nbands != reg.GetNban())
+    return false;
+
+  for(int i1 = 0; i1 < nbands; i1++)
+    mean[i1] = (mean[i1] * area + reg.Mean(i1) * reg.GetArea()) / (area + reg.GetArea());
+  area += reg.GetArea();
+  nreg++;
+
+  return true;
+}
+
+// Compute the Mahalanobis distance between the center of a region and the current cluster
+double TePDICluster::Distance(TePDIRegion reg)
+{
+  if (initialized == false)
+    return 100000.0;
+  if(nbands != reg.GetNban())
+    return 100000.0;
+
+
+  // Spring Method
+  double  dist = 0.0,
+      soma = 0.0;
+
+  for(int ban = 0; ban < nbands; ban++)
+  {
+    soma = 0.0;
+    for(int ban1 = 0; ban1 <= ban; ban1++)
+      soma += (mean[ban1] - reg.Mean(ban1)) * lu(ban, ban1);
+    dist += soma * soma;
+  }
+
+/*
+  // Hot method
+  TeMatrix  term_1, 
+        term_2, 
+        inverse, 
+        result, 
+        tmp;
+  double  dist = 0.0;
+
+  term_1.Init(1, nbands, 0.0);
+  term_2.Init(nbands, 1, 0.0);
+  inverse.Init(nbands, nbands, 0.0);
+  result.Init(1, 1, 0.0);
+  tmp.Init(nbands, 1, 0.0);
+
+  covar.Inverse(inverse);
+  for (int b = 0; b < nbands; b++)
+    term_1(0, b) = mean[b] - reg.Mean(b);
+  term_1.Transpose(term_2);
+  tmp = inverse * term_2;
+  result = term_1 * tmp;
+  dist = sqrt(result(0, 0));
+*/
+  return dist;
+}
+
+// Compute the Mahalanobis distance between the center of a cluster and the current cluster
+double TePDICluster::Distance(TePDICluster clu)
+{
+  if((initialized == false) || (clu.initialized == false))
+    return 100000.0;
+  if(nbands != clu.GetNban())
+    return 100000.0;
+
+  // Spring method
+  double  dist = 0.0,
+      sum = 0.0;
+
+  for(int ban = 0; ban < nbands; ban++)
+  {
+    sum = 0.0;
+    for(int ban1 = 0; ban1 <= ban; ban1++)
+      sum += (mean[ban1] - clu.mean[ban1]) * lu(ban, ban1);
+    dist += sum * sum;
+  }
+
+/*
+  // Hot Method
+  TeMatrix  term_1, 
+        term_2, 
+        inverse, 
+        result, 
+        tmp;
+  double  dist = 0.0;
+
+  term_1.Init(1, nbands, 0.0);
+  term_2.Init(nbands, 1, 0.0);
+  inverse.Init(nbands, nbands, 0.0);
+  result.Init(1, 1, 0.0);
+  tmp.Init(nbands, 1, 0.0);
+
+  covar.Inverse(inverse);
+  for (int b = 0; b < nbands; b++)
+    term_1(0, b) = mean[b] - clu.Mean(b);
+  term_1.Transpose(term_2);
+  tmp = inverse * term_2;
+  result = term_1 * tmp;
+  dist = sqrt(result(0, 0));
+*/
+  return dist;
+}
+
+// Returns the mean value.
+double TePDICluster::Mean(int ind)
+{
+  if (ind < nbands && ind >= 0)
+    return mean[ind];
+  return 0.0;
+}
+
+void TePDICluster::Merge(TePDICluster clu)
+{
+  for( int ban = 0; ban < nbands; ban++ )
+    mean[ban] = (mean[ban] * area + clu.mean[ban] * clu.area) / (area + clu.area);
+  if(area < clu.area)
+  {
+    lu = clu.lu;
+    covar = clu.covar;
+    lndet = clu.lndet;
+  }
+  nreg += clu.nreg;
+}
+
+void TePDICluster::add( vector<double> pixValue )
+{
+  for(int i = 0 ; i < nbands; i++ )
+  {
+    eVec[i]  += pixValue[i];
+    e2Vec[i] += pixValue[i]*pixValue[i];
+  }
+  
+  ++nElems;
+}
+
+double  TePDICluster::dist( vector<double> pixValue )const
+{
+  double dist = 0;
+  double diff = 0;
+  
+  for(int i = 0 ; i < nbands; i++ )
+  {
+    diff = pixValue[i] - mean[i];
+    dist += diff * diff;
+  }
+
+  return dist;
+}
+
+double TePDICluster::getVariance( int ind )const
+{
+  return variance[ind];
+}
+
+double TePDICluster::maxVar()const
+{
+  if( nElems <= 1 )
+    return 0;
+
+  double maxvar = 0;
+  
+  for(int i = 0 ; i < nbands; i++ )
+  {
+    if( variance[i] > maxvar )
+    {
+      maxvar = variance[i];
+    }
+  }
+
+  return maxvar;
+}
+
+int TePDICluster::maxVarBand()const
+{
+  if( nElems <= 1 )
+    return 0;
+
+  double maxvar = 0;
+  int ind = -1;
+  for(int i = 0 ; i < nbands; i++ )
+  {
+    if( variance[i] > maxvar )
+    {
+      maxvar = variance[i];
+      ind = i;
+    }
+  }
+
+  return ind;
+}
+
+void TePDICluster::resetCount()
+{
+  nElems = 0;
+  for(int i = 0 ; i < nbands; i++ )
+  {
+    eVec[i] = 0;
+    e2Vec[i] = 0;
+  }
+}
+
+void TePDICluster::updateStatistics()
+{
+  for(int i = 0 ; i < nbands; i++ )
+  {
+    double e2 = e2Vec[i] /(double)nElems;
+    double e  = eVec[i] /(double)nElems;
+    variance[i]  = nElems > 0 ? e2 - e * e : 0;
+    mean[i] = nElems > 0 ? e : 0; 
+  }
+}
+
+TePDICluster TePDICluster::splitLeft()const
+{
+  int band = maxVarBand();
+  if( band < 0 )
+    return TePDICluster(0);
+
+  TePDICluster result(*this);
+  result.mean[band] = mean[band] - sqrt(variance[band]);
+  result.resetCount();
+  return result;
+}
+
+TePDICluster TePDICluster::splitRight()const
+{
+  int band = maxVarBand();
+  if( band < 0 )
+    return TePDICluster(0);
+
+  TePDICluster result(*this);
+  result.mean[band] = mean[band] + sqrt(variance[band]);
+  result.resetCount();
+  return result;
+}
+
+void TePDICluster::clear()
+{
+  nbands = 0;
+  nElems = 0;
+  
+  mean.clear();
+  variance.clear();
+  eVec.clear();
+  e2Vec.clear();
+}
diff --git a/src/terralib/image_processing/TePDICluster.hpp b/src/terralib/image_processing/TePDICluster.hpp
old mode 100755
new mode 100644
index d580b65..c48c01b
--- a/src/terralib/image_processing/TePDICluster.hpp
+++ b/src/terralib/image_processing/TePDICluster.hpp
@@ -1,285 +1,285 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDICLUSTER_HPP
-  #define TEPDICLUSTER_HPP
-  
-#include "TePDIRegion.hpp"
-#include <iostream>
-#include <vector>
-#include <TeAgnostic.h>  
-
-using namespace std;
-
-  /**
-   * @brief This is the class for dealing with image clusters.
-   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
-   * @ingroup PDIAux
-   *
-   */
-class PDI_DLL TePDICluster
-{
-  private:
-    /**
-    * @brief identifier
-    */
-    int id;
-
-    /**
-    * @brief number of bands
-    */
-    int nbands;
-      
-  /**
-    * @brief number of bands
-    */
-    int nElems;
-
-    /**
-    * @brief number of pixels for each band
-    */
-    long area;
-
-    /**
-    * @brief Number of regions
-    */
-    long nreg;
-
-    /**
-    * @brief variance value vector
-    */
-    vector<double> variance;
-
-  /**
-    * @brief eVec ( e ) value vector (used to calculate variance)
-    */
-    vector<double> eVec;
-
-  /**
-    * @brief e2Vec (e x e) value vector (used to calculate variance)
-    */
-    vector<double> e2Vec;
-
-  /**
-    * @brief mean value vector
-    */
-    vector<double> mean;
-
-    /**
-    * @brief covariance matrix
-    */
-    TeMatrix covar;
-
-    /**
-    * @brief lu decomposition of covariance matrix
-    */
-    TeMatrix lu;
-
-    /**
-    * @brief ln of determinant of covariance matrix
-    */
-    double lndet;
-
-    /**
-    * @brief flag if the cluster was initialized
-    */
-    bool initialized;
-
-  public:
-
-    /**
-    * Default constructor
-    */
-    TePDICluster()
-    { id = 0; nbands = 0; area = 0L; lndet = 0.0; initialized = false; };
-
-    /**
-    * Alternative constructor.
-    * @param nBands The bands number.
-    */
-    TePDICluster( int nBands );
-
-    /**
-    * Default Destructor
-    */
-    ~TePDICluster();
-
-    /**
-    * Assignment operator
-    */
-    const TePDICluster& operator=( const TePDICluster& clu);
-
-    /**
-    * Equal operator
-    */
-    bool operator==(TePDICluster clu);
-
-    /**
-    * Initialize cluster with its identifier and with statistics
-    *
-    * @param ident The id of the cluster
-    * @param reg The First Region to be inserted in the Cluster
-    */
-    bool Init(int ident, TePDIRegion reg);
-  
-    /**
-    * Add a region statistics to the cluster.
-    *
-    * @param reg The Region to be added
-    */
-    bool AddRegion(TePDIRegion reg);
-  
-    /**
-    * Compute the Mahalanobis distance between the center of a region and the current cluster
-    *
-    * @param reg The region to be computed the distance
-    */
-    double Distance(TePDIRegion reg);
-  
-    /**
-    * Compute the Mahalanobis distance between the center of a cluster and the current cluster
-    *
-    * @param clu The cluster to be computed the distance
-    */
-    double Distance(TePDICluster clu);
-  
-    /**
-    * Set new identification to cluster
-    *
-    * @param newid The new ID
-    */
-    void SetId( int newid )
-    { id = newid; }
-
-    /**
-    * Return  cluster identification
-    */
-    int GetId(){ return id; }
-
-    /**
-    * Get mean value vector
-    *
-    * @param ind The cluster ID to get the mean
-    */
-    double Mean(int ind);
-
-    /**
-    * Return cluster covariance matrix.
-    */
-    TeMatrix GetCovariance()
-    { return covar; }
-
-    /**
-    * Get cluster size in pixels.
-    */
-    long GetArea()
-    { return area; }
-
-    /**
-    * Get number o bands
-    */
-    int GetNban()
-    { return nbands; }
-
-    /**
-    * Gets the Ln of Det
-    */
-    double GetLnDet()
-    { return lndet; }
-
-    /**
-    * Merges two clusters
-    *
-    * @param clu The cluster to be merged
-    */
-    void Merge(TePDICluster clu);
-
-    /**
-    * Get if the cluster was initialized
-    */
-    bool GetInitialized()
-    { return initialized; }
-
-  /**
-    * Insert a new pixel value in cluster
-    */
-  void add( vector<double> pixValue );
-
-  /**
-    * Calculate a distance over pixel value
-    */
-  double  dist( vector<double> pixValue )const;
-
-  /**
-    * Get variance value vector
-    *
-    * @param ind The cluster ID to get the variance
-    */
-  double getVariance( int ind )const;
-
-  /**
-    * Get the value of major variance
-    *
-    */
-  double maxVar()const;
-
-  /**
-    * Get the band value of major variance
-    *
-    */
-  int maxVarBand()const;
-
-  /**
-    * reset values used to get the variance
-    *
-    */
-  void resetCount();
-
-  /**
-    * update the information about mean and variance
-    *
-    */
-  void updateStatistics();
-
-  /**
-    * split the cluster
-    *
-    */
-  TePDICluster splitLeft()const;
-
-  /**
-  * split the cluster
-    *
-    */
-  TePDICluster splitRight()const;
-
-  /**
-    * Clear cluster
-    *
-    */
-    void clear();
-
-};
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDICLUSTER_HPP
+  #define TEPDICLUSTER_HPP
+  
+#include "TePDIRegion.hpp"
+#include <iostream>
+#include <vector>
+#include <TeAgnostic.h>  
+
+using namespace std;
+
+  /**
+   * @brief This is the class for dealing with image clusters.
+   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
+   * @ingroup PDIAux
+   *
+   */
+class PDI_DLL TePDICluster
+{
+  private:
+    /**
+    * @brief identifier
+    */
+    int id;
+
+    /**
+    * @brief number of bands
+    */
+    int nbands;
+      
+  /**
+    * @brief number of bands
+    */
+    int nElems;
+
+    /**
+    * @brief number of pixels for each band
+    */
+    long area;
+
+    /**
+    * @brief Number of regions
+    */
+    long nreg;
+
+    /**
+    * @brief variance value vector
+    */
+    vector<double> variance;
+
+  /**
+    * @brief eVec ( e ) value vector (used to calculate variance)
+    */
+    vector<double> eVec;
+
+  /**
+    * @brief e2Vec (e x e) value vector (used to calculate variance)
+    */
+    vector<double> e2Vec;
+
+  /**
+    * @brief mean value vector
+    */
+    vector<double> mean;
+
+    /**
+    * @brief covariance matrix
+    */
+    TeMatrix covar;
+
+    /**
+    * @brief lu decomposition of covariance matrix
+    */
+    TeMatrix lu;
+
+    /**
+    * @brief ln of determinant of covariance matrix
+    */
+    double lndet;
+
+    /**
+    * @brief flag if the cluster was initialized
+    */
+    bool initialized;
+
+  public:
+
+    /**
+    * Default constructor
+    */
+    TePDICluster()
+    { id = 0; nbands = 0; area = 0L; lndet = 0.0; initialized = false; };
+
+    /**
+    * Alternative constructor.
+    * @param nBands The bands number.
+    */
+    TePDICluster( int nBands );
+
+    /**
+    * Default Destructor
+    */
+    ~TePDICluster();
+
+    /**
+    * Assignment operator
+    */
+    const TePDICluster& operator=( const TePDICluster& clu);
+
+    /**
+    * Equal operator
+    */
+    bool operator==(TePDICluster clu);
+
+    /**
+    * Initialize cluster with its identifier and with statistics
+    *
+    * @param ident The id of the cluster
+    * @param reg The First Region to be inserted in the Cluster
+    */
+    bool Init(int ident, TePDIRegion reg);
+  
+    /**
+    * Add a region statistics to the cluster.
+    *
+    * @param reg The Region to be added
+    */
+    bool AddRegion(TePDIRegion reg);
+  
+    /**
+    * Compute the Mahalanobis distance between the center of a region and the current cluster
+    *
+    * @param reg The region to be computed the distance
+    */
+    double Distance(TePDIRegion reg);
+  
+    /**
+    * Compute the Mahalanobis distance between the center of a cluster and the current cluster
+    *
+    * @param clu The cluster to be computed the distance
+    */
+    double Distance(TePDICluster clu);
+  
+    /**
+    * Set new identification to cluster
+    *
+    * @param newid The new ID
+    */
+    void SetId( int newid )
+    { id = newid; }
+
+    /**
+    * Return  cluster identification
+    */
+    int GetId(){ return id; }
+
+    /**
+    * Get mean value vector
+    *
+    * @param ind The cluster ID to get the mean
+    */
+    double Mean(int ind);
+
+    /**
+    * Return cluster covariance matrix.
+    */
+    TeMatrix GetCovariance()
+    { return covar; }
+
+    /**
+    * Get cluster size in pixels.
+    */
+    long GetArea()
+    { return area; }
+
+    /**
+    * Get number o bands
+    */
+    int GetNban()
+    { return nbands; }
+
+    /**
+    * Gets the Ln of Det
+    */
+    double GetLnDet()
+    { return lndet; }
+
+    /**
+    * Merges two clusters
+    *
+    * @param clu The cluster to be merged
+    */
+    void Merge(TePDICluster clu);
+
+    /**
+    * Get if the cluster was initialized
+    */
+    bool GetInitialized()
+    { return initialized; }
+
+  /**
+    * Insert a new pixel value in cluster
+    */
+  void add( vector<double> pixValue );
+
+  /**
+    * Calculate a distance over pixel value
+    */
+  double  dist( vector<double> pixValue )const;
+
+  /**
+    * Get variance value vector
+    *
+    * @param ind The cluster ID to get the variance
+    */
+  double getVariance( int ind )const;
+
+  /**
+    * Get the value of major variance
+    *
+    */
+  double maxVar()const;
+
+  /**
+    * Get the band value of major variance
+    *
+    */
+  int maxVarBand()const;
+
+  /**
+    * reset values used to get the variance
+    *
+    */
+  void resetCount();
+
+  /**
+    * update the information about mean and variance
+    *
+    */
+  void updateStatistics();
+
+  /**
+    * split the cluster
+    *
+    */
+  TePDICluster splitLeft()const;
+
+  /**
+  * split the cluster
+    *
+    */
+  TePDICluster splitRight()const;
+
+  /**
+    * Clear cluster
+    *
+    */
+    void clear();
+
+};
+
+#endif
diff --git a/src/terralib/image_processing/TePDIColorTransform.cpp b/src/terralib/image_processing/TePDIColorTransform.cpp
old mode 100755
new mode 100644
index e300fde..4d67305
--- a/src/terralib/image_processing/TePDIColorTransform.cpp
+++ b/src/terralib/image_processing/TePDIColorTransform.cpp
@@ -1,586 +1,625 @@
-#include "TePDIColorTransform.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-#include "TePDIMatrix.hpp"
-#include <TeDefines.h>
-
-#ifndef M_PI
-  #define M_PI       3.14159265358979323846
-#endif
-
-
-TePDIColorTransform::TePDIColorTransform()
-{
-}
-
-
-TePDIColorTransform::~TePDIColorTransform()
-{
-}
-
-
-void TePDIColorTransform::ResetState( const TePDIParameters& )
-{
-}
-
-
-bool TePDIColorTransform::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking transformation type */
-  
-  ColorTransfTypes transf_type;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "transf_type", transf_type ),
-    "Missing parameter: transf_type" );
-  TEAGN_TRUE_OR_RETURN(
-    ( ( transf_type == Rgb2Ihs ) || ( transf_type == Ihs2Rgb ) ),
-    "Invalid parameter: transf_type" );
-    
-  /* Checking input_rasters and input_channels */
-  
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "input_rasters", input_rasters ),
-    "Missing parameter: input_rasters" );
-    
-  TEAGN_TRUE_OR_RETURN( ( input_rasters.size() == 3 ),
-    "Invalid number of input rasters" );    
-    
-  std::vector< int > input_channels;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "input_channels", input_channels ),
-    "Missing parameter: input_channels" );
-    
-  TEAGN_TRUE_OR_RETURN( ( input_channels.size() == 3 ), 
-    "Invalid number of input channels" );
-    
-  for( unsigned int index = 0 ; index < input_rasters.size() ; ++index ) {
-    TEAGN_TRUE_OR_RETURN( input_rasters[ index ].isActive(),
-      "Invalid parameter: raster " + 
-      Te2String( index ) + " inactive" );
-      
-    TEAGN_TRUE_OR_RETURN( 
-      input_rasters[ index ]->params().status_ != TeRasterParams::TeNotReady,
-      "Invalid parameter: raster " + 
-      Te2String( index ) + " not ready" );
-        
-    TEAGN_TRUE_OR_RETURN( 
-      input_rasters[ 0 ]->params().nlines_ == 
-      input_rasters[ index ]->params().nlines_,
-      "Lines number mismatch between raster 0 and raster " +
-      Te2String( index ) );
-      
-    TEAGN_TRUE_OR_RETURN( 
-      input_rasters[ 0 ]->params().ncols_ == 
-      input_rasters[ index ]->params().ncols_,
-      "Columns number mismatch between raster 0 and raster " +
-      Te2String( index ) );
-            
-    TEAGN_TRUE_OR_RETURN( 
-      input_channels[ index ] >= 0, "Invalid channel number (" + 
-      Te2String( index ) + ")" );
-    TEAGN_TRUE_OR_RETURN( 
-      input_channels[ index ] < input_rasters[ index ]->nBands(), 
-      "Invalid channel number (" + 
-      Te2String( index ) + ")" );
-      
-    /* Checking photometric interpretation */
-    
-    TEAGN_TRUE_OR_RETURN( ( 
-      ( input_rasters[ index ]->params().photometric_[ 
-        input_channels[ index ] ] == TeRasterParams::TeRGB ) ||
-      ( input_rasters[ index ]->params().photometric_[ 
-        input_channels[ index ] ] == TeRasterParams::TeMultiBand ) ),
-      "Invalid parameter - rasters (invalid photometric "
-      "interpretation)" );      
-  }    
-  
-  /* Checking output_rasters */
-  
-  TePDITypes::TePDIRasterVectorType output_rasters;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "output_rasters", output_rasters ),
-    "Missing parameter: output_rasters" );
-    
-  TEAGN_TRUE_OR_RETURN( ( ( output_rasters.size() == 3 ) ||
-    ( output_rasters.size() == 1 ) ), 
-    "Invalid number of output rasters" );
-    
-  for( unsigned int index = 0 ; index < output_rasters.size() ; ++index ) {
-    TEAGN_TRUE_OR_RETURN( output_rasters[ index ].isActive(),
-      "Invalid parameter: output raster " + 
-      Te2String( index ) + " inactive" );
-      
-    TEAGN_TRUE_OR_RETURN( 
-      output_rasters[ index ]->params().status_ != TeRasterParams::TeNotReady,
-      "Invalid parameter: output raster " + 
-      Te2String( index ) + " not ready" );
-      
-    if( ( index != 0 ) && ( output_rasters.size() != 1 ) ) {
-      TEAGN_TRUE_OR_RETURN( 
-        ( output_rasters[ 0 ] != output_rasters[ index ] ),
-        "Cannot use the same output raster two more times" );    
-    }
-    
-    /* Checking input data type */
-    
-    if( transf_type == Rgb2Ihs ) {
-      TEAGN_TRUE_OR_RETURN( 
-        (
-          ( 
-            output_rasters[ index ]->params().dataType_[ 0 ] == TeDOUBLE 
-          )
-          ||
-          (
-            output_rasters[ index ]->params().dataType_[ 0 ] == TeFLOAT 
-          )
-        ), "Invalid output rasters data type" );  
-    }      
-  }     
-  
-  /* Checking  rgb_channels_min and rgbs_channel_max */
-  
-  if( ( transf_type == Ihs2Rgb ) || ( transf_type == Rgb2Ihs ) ) {
-    double rgb_channels_min = 0;
-    TEAGN_TRUE_OR_RETURN( 
-      parameters.GetParameter( "rgb_channels_min", rgb_channels_min ),
-      "Missing parameter: rgbs_channels_min" );  
-      
-    double rgb_channels_max = 0;
-    TEAGN_TRUE_OR_RETURN( 
-      parameters.GetParameter( "rgb_channels_max", rgb_channels_max ),
-      "Missing parameter: rgb_channels_max" );    
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( rgb_channels_max > rgb_channels_min ),
-      "Invalid parameters: rgb_channels_max - rgb_channels_min" );       
-  }
-  
-  return true;
-}
-
-
-bool TePDIColorTransform::RunImplementation()
-{
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  params_.GetParameter( "input_rasters", input_rasters );
-    
-  std::vector< int > input_channels;
-  params_.GetParameter( "input_channels", input_channels );
-  
-  TePDITypes::TePDIRasterVectorType output_rasters;
-  params_.GetParameter( "output_rasters", output_rasters );
-
-  ColorTransfTypes transf_type;
-  params_.GetParameter( "transf_type", transf_type );
-  
-  std::vector< int > output_channels;
-  
-  /* Updating output raster geometries */
-  
-  TeRaster& ref_input_raster = *(input_rasters[ 0 ].nakedPointer() );
-  
-  if( output_rasters.size() == 1 ) {
-    TeRaster& output_raster = *( output_rasters[ 0 ].nakedPointer() );
-    
-    /* Generating the new output raster parameters */
-    
-    TeRasterParams output_raster_params = output_raster.params();
-    
-    output_raster_params.nBands( 3 );
-    if( ref_input_raster.projection() != 0 ) {
-      output_raster_params.projection( ref_input_raster.projection() );
-    }
-    output_raster_params.boxLinesColumns( 
-      ref_input_raster.params().box().x1(), 
-      ref_input_raster.params().box().y1(), 
-      ref_input_raster.params().box().x2(), 
-      ref_input_raster.params().box().y2(), 
-      ref_input_raster.params().nlines_, 
-      ref_input_raster.params().ncols_ );
-      
-    switch( transf_type ) {
-      case Rgb2Ihs :
-      {
-        output_raster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-
-        break;
-      }
-      case Ihs2Rgb :
-      {
-        output_raster_params.setPhotometric( TeRasterParams::TeRGB, -1 );
-
-        break;
-      }
-      default :
-      {
-        TEAGN_LOG_AND_RETURN( "Invalid transformation type" );
-        break;
-      }
-    }      
-      
-    TEAGN_TRUE_OR_RETURN( output_raster.init( output_raster_params ),
-      "Output raster reset error" );  
-      
-    /* updating the output_channels vector */
-      
-    output_channels.push_back( 0 );
-    output_channels.push_back( 1 );
-    output_channels.push_back( 2 );     
-    
-     /* updating the output_channels vector */
-
-    output_rasters.push_back( output_rasters[ 0 ] );   
-    output_rasters.push_back( output_rasters[ 0 ] );
-  } else {
-    /* output_rasters.size() == 3 */
-    
-    for( unsigned int index = 0 ; index < output_rasters.size() ; ++index ) {
-      TeRaster& output_raster = *( output_rasters[ index ].nakedPointer() );
-      
-      /* Generating the new output raster parameters */
-      
-      TeRasterParams output_raster_params = output_raster.params();
-      
-      output_raster_params.nBands( 1 );
-      if( ref_input_raster.projection() != 0 ) {
-        output_raster_params.projection( ref_input_raster.projection() );
-      }
-      output_raster_params.boxLinesColumns( 
-        ref_input_raster.params().box().x1(), 
-        ref_input_raster.params().box().y1(), 
-        ref_input_raster.params().box().x2(), 
-        ref_input_raster.params().box().y2(), 
-        ref_input_raster.params().nlines_, 
-        ref_input_raster.params().ncols_ );  
-      switch( transf_type ) {
-        case Rgb2Ihs :
-        {
-          output_raster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-
-          break;
-        }
-        case Ihs2Rgb :
-        {
-          output_raster_params.setPhotometric( TeRasterParams::TeRGB, -1 );
-
-          break;
-        }
-        default :
-        {
-          TEAGN_LOG_AND_RETURN( "Invalid transformation type" );
-          break;
-        }
-      }           
-        
-      TEAGN_TRUE_OR_RETURN( output_raster.init( output_raster_params ),
-        "Output raster reset error" );  
-    }
-
-    /* updating the output_channels vector */
-      
-    output_channels.push_back( 0 );
-    output_channels.push_back( 0 );
-    output_channels.push_back( 0 );       
-  }
-    
-  /* Calling the required color conversion */  
-
-  switch( transf_type ) {
-    case Rgb2Ihs :
-    {
-      double rgb_channels_min = 0;
-      params_.GetParameter( "rgb_channels_min", rgb_channels_min );
-        
-      double rgb_channels_max = 0;
-      params_.GetParameter( "rgb_channels_max", rgb_channels_max );
-          
-      return RunRgb2Ihs( input_rasters, input_channels, output_rasters,
-        output_channels, rgb_channels_min, rgb_channels_max );
-      break;
-    }
-    case Ihs2Rgb :
-    {
-      double rgb_channels_min = 0;
-      params_.GetParameter( "rgb_channels_min", rgb_channels_min );
-        
-      double rgb_channels_max = 0;
-      params_.GetParameter( "rgb_channels_max", rgb_channels_max );
-         
-      return RunIhs2Rgb( input_rasters, input_channels, output_rasters,
-        output_channels, rgb_channels_min, rgb_channels_max );
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_RETURN( "Invalid transformation type" );
-      break;
-    }
-  }
-
-  return false;
-}
-
-
-bool TePDIColorTransform::RunRgb2Ihs(
-  TePDITypes::TePDIRasterVectorType& input_rasters,
-  std::vector< int >& input_channels,
-  TePDITypes::TePDIRasterVectorType& output_rasters,
-  std::vector< int >& output_channels,
-  const double rgb_channels_min, const double rgb_channels_max )
-{
-  TEAGN_DEBUG_CONDITION( ( input_rasters.size() == 3 ),
-    "Invalid vector size" )
-  TEAGN_DEBUG_CONDITION( ( input_channels.size() == 3 ),
-    "Invalid vector size" )
-  TEAGN_DEBUG_CONDITION( ( output_rasters.size() == 3 ),
-    "Invalid vector size" )
-  TEAGN_DEBUG_CONDITION( ( output_channels.size() == 3 ),
-    "Invalid vector size" )
-  TEAGN_DEBUG_CONDITION( ( rgb_channels_max >= rgb_channels_min ),
-    "Invalid rgb channels max/min" )    
-                
-  /* Extracting local references */
-  
-  TeRaster& input_raster0 = *( input_rasters[ 0 ].nakedPointer() ); 
-  TeRaster& input_raster1 = *( input_rasters[ 1 ].nakedPointer() ); 
-  TeRaster& input_raster2 = *( input_rasters[ 2 ].nakedPointer() );
-  
-  const int input_channel0 = input_channels[ 0 ];
-  const int input_channel1 = input_channels[ 1 ];
-  const int input_channel2 = input_channels[ 2 ];
-  
-  TeRaster& output_raster0 = *( output_rasters[ 0 ].nakedPointer() ); 
-  TeRaster& output_raster1 = *( output_rasters[ 1 ].nakedPointer() ); 
-  TeRaster& output_raster2 = *( output_rasters[ 2 ].nakedPointer() );
-  
-  const int output_channel0 = output_channels[ 0 ];
-  const int output_channel1 = output_channels[ 1 ];
-  const int output_channel2 = output_channels[ 2 ];    
-  
-  const unsigned int lines = ( unsigned int ) input_raster0.params().nlines_;
-  const unsigned int columns = ( unsigned int ) 
-    input_raster0.params().ncols_;
-    
-  const double rgb_channels_diff = rgb_channels_max - rgb_channels_min;
-  const double rgb_channels_norm_fac = ( rgb_channels_diff != 0.0 ) ? 
-    rgb_channels_diff : 1.0;
-  
-  /* Dummy use definition */
-  
-  double out_raster_dummy = 0;
-  if( output_raster0.params().useDummy_ ) {
-    out_raster_dummy = output_raster0.params().dummy_[ 0 ];
-  }
-  
-  /* Generating the non-normalized ihs matrixes */
-  
-  double red = 0, green = 0, blue = 0;
-  double hue = 0, sat = 0, light = 0;  
-  unsigned int line = 0;
-  unsigned int column = 0;
-  double teta = 0;
-  double red_norm = 0, green_norm = 0, blue_norm = 0;
-  double r_minus_g = 0, r_minus_b = 0;
-  double rgb_sum = 0;
-  double cosvalue = 0;
-  const double two_pi = 2.0 * ((double)M_PI);
-  
-  TePDIPIManager progress( "Converting RGB -> IHS...", lines,
-    progress_enabled_ ); 
-
-  for( line = 0 ; line < lines ; ++line ) {
-    for( column = 0 ; column < columns ; ++column ) {
-      if( input_raster0.getElement( column, line, red, input_channel0 ) && 
-          input_raster1.getElement( column, line, green, input_channel1 ) &&
-          input_raster2.getElement( column, line, blue, input_channel2 ) ) {
-          
-        red_norm = ( red - rgb_channels_min ) / rgb_channels_norm_fac;
-        green_norm = ( green - rgb_channels_min ) / rgb_channels_norm_fac;
-        blue_norm = ( blue - rgb_channels_min ) / rgb_channels_norm_fac;
-        
-        r_minus_g = red_norm - green_norm;
-        r_minus_b = red_norm - blue_norm;
-        
-        cosvalue =  ( 0.5 * ( r_minus_g + r_minus_b )  ) /
-          sqrt( ( r_minus_g * r_minus_g ) + ( r_minus_b * ( green_norm -
-          blue_norm ) ) );
-          
-        TEAGN_DEBUG_CONDITION( ( cosvalue >= (-1.0) ) &&
-          ( cosvalue <= (1.0) ), "Invalid cos value" )
-        
-        teta = acos( cosvalue );
-          
-        if( blue_norm > green_norm )
-        {
-          hue = two_pi - teta;
-        }
-        else
-        {
-          hue = teta;
-        }
-          
-        rgb_sum = red_norm + green_norm + blue_norm;
-        
-        sat = 1.0 - ( 3 * MIN( MIN( red_norm, green_norm ), blue_norm ) /
-          rgb_sum );
-          
-        light = rgb_sum / 3.0;
-      } else {
-        hue = sat = light = 0.0;
-      }
-      
-      TEAGN_TRUE_OR_RETURN( output_raster0.setElement(
-        column, line, light, output_channel0 ),
-        "Unable to write intensity channel for output_image" );
-      TEAGN_TRUE_OR_RETURN( output_raster1.setElement(
-        column, line, hue, output_channel1 ),
-        "Unable to write hue channel for output_image" );
-      TEAGN_TRUE_OR_RETURN( output_raster2.setElement(
-        column, line, sat, output_channel2 ),
-        "Unable to write saturation channel for output_image" ); 
-    }
-    
-    TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-      "Canceled by the user" );    
-  }
-  
-  return true;
-}
-
-
-bool TePDIColorTransform::RunIhs2Rgb(
-  TePDITypes::TePDIRasterVectorType& input_rasters,
-  std::vector< int >& input_channels,
-  TePDITypes::TePDIRasterVectorType& output_rasters,
-  std::vector< int >& output_channels,
-  const double rgb_channels_min, const double rgb_channels_max )
-{
-  TEAGN_TRUE_OR_THROW( ( input_rasters.size() == 3 ),
-    "Invalid vector size" )
-  TEAGN_TRUE_OR_THROW( ( input_channels.size() == 3 ),
-    "Invalid vector size" )
-  TEAGN_TRUE_OR_THROW( ( output_rasters.size() == 3 ),
-    "Invalid vector size" )
-  TEAGN_TRUE_OR_THROW( ( output_channels.size() == 3 ),
-    "Invalid vector size" )
-                
-  /* Extracting local references */
-  
-  TeRaster& input_raster0 = *( input_rasters[ 0 ].nakedPointer() ); 
-  TeRaster& input_raster1 = *( input_rasters[ 1 ].nakedPointer() ); 
-  TeRaster& input_raster2 = *( input_rasters[ 2 ].nakedPointer() );
-  
-  const int input_channel0 = input_channels[ 0 ];
-  const int input_channel1 = input_channels[ 1 ];
-  const int input_channel2 = input_channels[ 2 ];
-  
-  TeRaster& output_raster0 = *( output_rasters[ 0 ].nakedPointer() ); 
-  TeRaster& output_raster1 = *( output_rasters[ 1 ].nakedPointer() ); 
-  TeRaster& output_raster2 = *( output_rasters[ 2 ].nakedPointer() );
-  
-  int output_channel0 = output_channels[ 0 ];
-  int output_channel1 = output_channels[ 1 ];
-  int output_channel2 = output_channels[ 2 ];  
-    
-  unsigned int lines = ( unsigned int ) input_raster0.params().nlines_;
-  unsigned int columns = ( unsigned int ) input_raster0.params().ncols_;
-
-  const double rgb_channels_diff = rgb_channels_max - rgb_channels_min;
-  const double rgb_channels_norm_fac = ( rgb_channels_diff != 0.0 ) ? 
-    rgb_channels_diff : 1.0;  
- 
-  /* Dummy use definition */
-  
-  double out_raster_dummy = 0;
-  if( output_raster0.params().useDummy_ ) {
-    out_raster_dummy = output_raster0.params().dummy_[ 0 ];
-  }
-  
-  /* Raster convertion */
-  
-  const double pi_rat3 = M_PI / 3.0; // 60
-  const double two_pi_rat3 = 2.0 * M_PI / 3.0; // 120
-  const double four_pi_rat3 = 4.0 * M_PI / 3.0; // 240
-  
-  double red = 0, green = 0, blue = 0;
-  double hue = 0, sat = 0, lig = 0;
-  
-  StartProgInt( "Converting IHS -> RGB...", lines );
-  
-  for( unsigned int line = 0 ; line < lines ; ++line ) {
-    TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
-  
-    for( unsigned int column = 0 ; column < columns ; ++column ) {
-      if( input_raster0.getElement( column, line, lig, input_channel0 ) &&
-          input_raster1.getElement( column, line, hue, input_channel1 ) &&
-          input_raster2.getElement( column, line, sat, input_channel2 ) ) {
-
-        /* Hue inside RG sector */
-        if( hue < two_pi_rat3 )
-        {
-          blue = lig * ( 1.0 - sat );
-          red = lig * ( 1.0 + ( sat * cos( hue ) / 
-            cos( pi_rat3 - hue ) ) );
-          green = ( 3.0 * lig ) - ( red + blue );
-        }
-        else if( hue < four_pi_rat3 )
-        { /* Hue inside GB sector */
-        
-          hue -= two_pi_rat3;
-          
-          red = lig * ( 1.0 - sat );
-          green = lig * ( 1.0 + ( sat * cos( hue ) / 
-            cos( pi_rat3 - hue ) ) );
-          blue = ( 3.0 * lig ) - ( red + green );
-        }
-        else
-        { /* Hue inside BR sector */
-        
-          hue -= four_pi_rat3;
-          
-          green = lig * ( 1.0 - sat );
-          blue = lig * ( 1.0 + ( sat * cos( hue ) / 
-            cos( pi_rat3 - hue ) ) );
-          red = ( 3.0 * lig ) - ( green + blue );
-        }
-        
-        red = ( red * rgb_channels_norm_fac ) + rgb_channels_min;
-        green = ( green * rgb_channels_norm_fac ) + rgb_channels_min;
-        blue = ( blue * rgb_channels_norm_fac ) + rgb_channels_min;
-        
-        red = MIN( red, rgb_channels_max );
-        green = MIN( green, rgb_channels_max );
-        blue = MIN( blue, rgb_channels_max );
-        
-        red = MAX( red, rgb_channels_min );
-        green = MAX( green, rgb_channels_min );
-        blue = MAX( blue, rgb_channels_min );        
-  
-        TEAGN_TRUE_OR_RETURN( output_raster0.setElement(
-          column, line, red, output_channel0 ),
-          "Unable to write red channel for output_image" );
-        TEAGN_TRUE_OR_RETURN( output_raster1.setElement(
-          column, line, green, output_channel1 ),
-          "Unable to write green channel for output_image" );
-        TEAGN_TRUE_OR_RETURN( output_raster2.setElement(
-          column, line, blue, output_channel2 ),
-          "Unable to write blue channel for output_image" );
-      } else {                    
-        TEAGN_TRUE_OR_RETURN( output_raster0.setElement(
-          column, line, out_raster_dummy, output_channel0 ),
-          "Unable to write red channel for output_image" );
-        TEAGN_TRUE_OR_RETURN( output_raster1.setElement(
-          column, line, out_raster_dummy, output_channel1 ),
-          "Unable to write green channel for output_image" );
-        TEAGN_TRUE_OR_RETURN( output_raster2.setElement(
-          column, line, out_raster_dummy, output_channel2 ),
-          "Unable to write blue channel for output_image" );
-      }
-    }
-  }
-
-  return true;
-}
-
+#include "TePDIColorTransform.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+#include "TePDIMatrix.hpp"
+#include <TeDefines.h>
+
+#ifndef M_PI
+  #define M_PI       3.14159265358979323846
+#endif
+
+
+TePDIColorTransform::TePDIColorTransform()
+{
+}
+
+
+TePDIColorTransform::~TePDIColorTransform()
+{
+}
+
+
+void TePDIColorTransform::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDIColorTransform::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking transformation type */
+  
+  ColorTransfTypes transf_type;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "transf_type", transf_type ),
+    "Missing parameter: transf_type" );
+  TEAGN_TRUE_OR_RETURN(
+    ( ( transf_type == Rgb2Ihs ) || ( transf_type == Ihs2Rgb ) ),
+    "Invalid parameter: transf_type" );
+    
+  /* Checking input_rasters and input_channels */
+  
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "input_rasters", input_rasters ),
+    "Missing parameter: input_rasters" );
+    
+  TEAGN_TRUE_OR_RETURN( ( input_rasters.size() == 3 ),
+    "Invalid number of input rasters" );    
+    
+  std::vector< int > input_channels;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "input_channels", input_channels ),
+    "Missing parameter: input_channels" );
+    
+  TEAGN_TRUE_OR_RETURN( ( input_channels.size() == 3 ), 
+    "Invalid number of input channels" );
+    
+  for( unsigned int index = 0 ; index < input_rasters.size() ; ++index ) {
+    TEAGN_TRUE_OR_RETURN( input_rasters[ index ].isActive(),
+      "Invalid parameter: raster " + 
+      Te2String( index ) + " inactive" );
+      
+    TEAGN_TRUE_OR_RETURN( 
+      input_rasters[ index ]->params().status_ != TeRasterParams::TeNotReady,
+      "Invalid parameter: raster " + 
+      Te2String( index ) + " not ready" );
+        
+    TEAGN_TRUE_OR_RETURN( 
+      input_rasters[ 0 ]->params().nlines_ == 
+      input_rasters[ index ]->params().nlines_,
+      "Lines number mismatch between raster 0 and raster " +
+      Te2String( index ) );
+      
+    TEAGN_TRUE_OR_RETURN( 
+      input_rasters[ 0 ]->params().ncols_ == 
+      input_rasters[ index ]->params().ncols_,
+      "Columns number mismatch between raster 0 and raster " +
+      Te2String( index ) );
+            
+    TEAGN_TRUE_OR_RETURN( 
+      input_channels[ index ] >= 0, "Invalid channel number (" + 
+      Te2String( index ) + ")" );
+    TEAGN_TRUE_OR_RETURN( 
+      input_channels[ index ] < input_rasters[ index ]->nBands(), 
+      "Invalid channel number (" + 
+      Te2String( index ) + ")" );
+      
+    /* Checking photometric interpretation */
+    
+    TEAGN_TRUE_OR_RETURN( ( 
+      ( input_rasters[ index ]->params().photometric_[ 
+        input_channels[ index ] ] == TeRasterParams::TeRGB ) ||
+      ( input_rasters[ index ]->params().photometric_[ 
+        input_channels[ index ] ] == TeRasterParams::TeMultiBand ) ),
+      "Invalid parameter - rasters (invalid photometric "
+      "interpretation)" );      
+  }    
+  
+  /* Checking output_rasters */
+  
+  TePDITypes::TePDIRasterVectorType output_rasters;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "output_rasters", output_rasters ),
+    "Missing parameter: output_rasters" );
+    
+  TEAGN_TRUE_OR_RETURN( ( ( output_rasters.size() == 3 ) ||
+    ( output_rasters.size() == 1 ) ), 
+    "Invalid number of output rasters" );
+    
+  for( unsigned int index = 0 ; index < output_rasters.size() ; ++index ) {
+    TEAGN_TRUE_OR_RETURN( output_rasters[ index ].isActive(),
+      "Invalid parameter: output raster " + 
+      Te2String( index ) + " inactive" );
+      
+    TEAGN_TRUE_OR_RETURN( 
+      output_rasters[ index ]->params().status_ != TeRasterParams::TeNotReady,
+      "Invalid parameter: output raster " + 
+      Te2String( index ) + " not ready" );
+      
+    if( ( index != 0 ) && ( output_rasters.size() != 1 ) ) {
+      TEAGN_TRUE_OR_RETURN( 
+        ( output_rasters[ 0 ] != output_rasters[ index ] ),
+        "Cannot use the same output raster two more times" );    
+    }
+    
+    /* Checking input data type */
+    
+    if( transf_type == Rgb2Ihs ) {
+      TEAGN_TRUE_OR_RETURN( 
+        (
+          ( 
+            output_rasters[ index ]->params().dataType_[ 0 ] == TeDOUBLE 
+          )
+          ||
+          (
+            output_rasters[ index ]->params().dataType_[ 0 ] == TeFLOAT 
+          )
+        ), "Invalid output rasters data type" );  
+    }      
+  }     
+  
+  /* Checking  rgb_channels_min and rgbs_channel_max */
+  
+  if( ( transf_type == Ihs2Rgb ) || ( transf_type == Rgb2Ihs ) ) {
+    double rgb_channels_min = 0;
+    TEAGN_TRUE_OR_RETURN( 
+      parameters.GetParameter( "rgb_channels_min", rgb_channels_min ),
+      "Missing parameter: rgbs_channels_min" );  
+      
+    double rgb_channels_max = 0;
+    TEAGN_TRUE_OR_RETURN( 
+      parameters.GetParameter( "rgb_channels_max", rgb_channels_max ),
+      "Missing parameter: rgb_channels_max" );    
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( rgb_channels_max > rgb_channels_min ),
+      "Invalid parameters: rgb_channels_max - rgb_channels_min" );       
+  }
+  
+  return true;
+}
+
+
+bool TePDIColorTransform::RunImplementation()
+{
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  params_.GetParameter( "input_rasters", input_rasters );
+    
+  std::vector< int > input_channels;
+  params_.GetParameter( "input_channels", input_channels );
+  
+  TePDITypes::TePDIRasterVectorType output_rasters;
+  params_.GetParameter( "output_rasters", output_rasters );
+
+  ColorTransfTypes transf_type;
+  params_.GetParameter( "transf_type", transf_type );
+  
+  std::vector< int > output_channels;
+  
+  /* Updating output raster geometries */
+  
+  TeRaster& ref_input_raster = *(input_rasters[ 0 ].nakedPointer() );
+  
+  if( output_rasters.size() == 1 ) {
+    TeRaster& output_raster = *( output_rasters[ 0 ].nakedPointer() );
+    
+    /* Generating the new output raster parameters */
+    
+    TeRasterParams output_raster_params = output_raster.params();
+    
+    output_raster_params.nBands( 3 );
+    if( ref_input_raster.projection() != 0 ) {
+      output_raster_params.projection( ref_input_raster.projection() );
+    }
+    output_raster_params.boxLinesColumns( 
+      ref_input_raster.params().box().x1(), 
+      ref_input_raster.params().box().y1(), 
+      ref_input_raster.params().box().x2(), 
+      ref_input_raster.params().box().y2(), 
+      ref_input_raster.params().nlines_, 
+      ref_input_raster.params().ncols_ );
+      
+    switch( transf_type ) {
+      case Rgb2Ihs :
+      {
+        output_raster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+
+        break;
+      }
+      case Ihs2Rgb :
+      {
+        output_raster_params.setPhotometric( TeRasterParams::TeRGB, -1 );
+
+        break;
+      }
+      default :
+      {
+        TEAGN_LOG_AND_RETURN( "Invalid transformation type" );
+        break;
+      }
+    }      
+      
+    TEAGN_TRUE_OR_RETURN( output_raster.init( output_raster_params ),
+      "Output raster reset error" );  
+      
+    /* updating the output_channels vector */
+      
+    output_channels.push_back( 0 );
+    output_channels.push_back( 1 );
+    output_channels.push_back( 2 );     
+    
+     /* updating the output_channels vector */
+
+    output_rasters.push_back( output_rasters[ 0 ] );   
+    output_rasters.push_back( output_rasters[ 0 ] );
+  } else {
+    /* output_rasters.size() == 3 */
+    
+    for( unsigned int index = 0 ; index < output_rasters.size() ; ++index ) {
+      TeRaster& output_raster = *( output_rasters[ index ].nakedPointer() );
+      
+      /* Generating the new output raster parameters */
+      
+      TeRasterParams output_raster_params = output_raster.params();
+      
+      output_raster_params.nBands( 1 );
+      if( ref_input_raster.projection() != 0 ) {
+        output_raster_params.projection( ref_input_raster.projection() );
+      }
+      output_raster_params.boxLinesColumns( 
+        ref_input_raster.params().box().x1(), 
+        ref_input_raster.params().box().y1(), 
+        ref_input_raster.params().box().x2(), 
+        ref_input_raster.params().box().y2(), 
+        ref_input_raster.params().nlines_, 
+        ref_input_raster.params().ncols_ );  
+      switch( transf_type ) {
+        case Rgb2Ihs :
+        {
+          output_raster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+
+          break;
+        }
+        case Ihs2Rgb :
+        {
+          output_raster_params.setPhotometric( TeRasterParams::TeRGB, -1 );
+
+          break;
+        }
+        default :
+        {
+          TEAGN_LOG_AND_RETURN( "Invalid transformation type" );
+          break;
+        }
+      }           
+        
+      TEAGN_TRUE_OR_RETURN( output_raster.init( output_raster_params ),
+        "Output raster reset error" );  
+    }
+
+    /* updating the output_channels vector */
+      
+    output_channels.push_back( 0 );
+    output_channels.push_back( 0 );
+    output_channels.push_back( 0 );       
+  }
+    
+  /* Calling the required color conversion */  
+
+  switch( transf_type ) {
+    case Rgb2Ihs :
+    {
+      double rgb_channels_min = 0;
+      params_.GetParameter( "rgb_channels_min", rgb_channels_min );
+        
+      double rgb_channels_max = 0;
+      params_.GetParameter( "rgb_channels_max", rgb_channels_max );
+          
+      return RunRgb2Ihs( input_rasters, input_channels, output_rasters,
+        output_channels, rgb_channels_min, rgb_channels_max );
+      break;
+    }
+    case Ihs2Rgb :
+    {
+      double rgb_channels_min = 0;
+      params_.GetParameter( "rgb_channels_min", rgb_channels_min );
+        
+      double rgb_channels_max = 0;
+      params_.GetParameter( "rgb_channels_max", rgb_channels_max );
+         
+      return RunIhs2Rgb( input_rasters, input_channels, output_rasters,
+        output_channels, rgb_channels_min, rgb_channels_max );
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid transformation type" );
+      break;
+    }
+  }
+
+  return false;
+}
+
+
+bool TePDIColorTransform::RunRgb2Ihs(
+  TePDITypes::TePDIRasterVectorType& input_rasters,
+  std::vector< int >& input_channels,
+  TePDITypes::TePDIRasterVectorType& output_rasters,
+  std::vector< int >& output_channels,
+  const double rgb_channels_min, const double rgb_channels_max )
+{
+  TEAGN_DEBUG_CONDITION( ( input_rasters.size() == 3 ),
+    "Invalid vector size" )
+  TEAGN_DEBUG_CONDITION( ( input_channels.size() == 3 ),
+    "Invalid vector size" )
+  TEAGN_DEBUG_CONDITION( ( output_rasters.size() == 3 ),
+    "Invalid vector size" )
+  TEAGN_DEBUG_CONDITION( ( output_channels.size() == 3 ),
+    "Invalid vector size" )
+  TEAGN_DEBUG_CONDITION( ( rgb_channels_max >= rgb_channels_min ),
+    "Invalid rgb channels max/min" )    
+                
+  /* Extracting local references */
+  
+  TeRaster& input_raster0 = *( input_rasters[ 0 ].nakedPointer() ); 
+  TeRaster& input_raster1 = *( input_rasters[ 1 ].nakedPointer() ); 
+  TeRaster& input_raster2 = *( input_rasters[ 2 ].nakedPointer() );
+  
+  const int input_channel0 = input_channels[ 0 ];
+  const int input_channel1 = input_channels[ 1 ];
+  const int input_channel2 = input_channels[ 2 ];
+  
+  TeRaster& output_raster0 = *( output_rasters[ 0 ].nakedPointer() ); 
+  TeRaster& output_raster1 = *( output_rasters[ 1 ].nakedPointer() ); 
+  TeRaster& output_raster2 = *( output_rasters[ 2 ].nakedPointer() );
+  
+  const int output_channel0 = output_channels[ 0 ];
+  const int output_channel1 = output_channels[ 1 ];
+  const int output_channel2 = output_channels[ 2 ];    
+  
+  const unsigned int lines = ( unsigned int ) input_raster0.params().nlines_;
+  const unsigned int columns = ( unsigned int ) 
+    input_raster0.params().ncols_;
+    
+  const double rgb_channels_diff = rgb_channels_max - rgb_channels_min;
+  const double rgb_channels_norm_fac = ( rgb_channels_diff != 0.0 ) ? 
+    rgb_channels_diff : 1.0;
+  
+  /* Dummy use definition */
+  
+  double out_raster_dummy = 0;
+  if( output_raster0.params().useDummy_ ) {
+    out_raster_dummy = output_raster0.params().dummy_[ 0 ];
+  }
+  
+  /* Generating the non-normalized ihs matrixes */
+  
+  double red = 0, green = 0, blue = 0;
+  double hue = 0, sat = 0, light = 0;  
+  unsigned int line = 0;
+  unsigned int column = 0;
+  double teta = 0;
+  double red_norm = 0, green_norm = 0, blue_norm = 0;
+  double r_minus_g = 0, r_minus_b = 0;
+  double rgb_sum = 0;
+  double cosvalue = 0;
+  const double two_pi = 2.0 * ((double)M_PI);
+  const double pi_rat_2 = ((double)M_PI) / 2.0;
+  
+  TePDIPIManager progress( "Converting RGB -> IHS...", lines,
+    progress_enabled_ ); 
+
+  for( line = 0 ; line < lines ; ++line ) {
+    for( column = 0 ; column < columns ; ++column ) {
+      if( input_raster0.getElement( column, line, red, input_channel0 ) && 
+        input_raster1.getElement( column, line, green, input_channel1 ) &&
+        input_raster2.getElement( column, line, blue, input_channel2 ) ) 
+      {
+        if( ( red == green ) && ( green == blue ) ) 
+        { // Gray scale case
+          // From Wikipedia:
+          // h = 0 is used for grays though the hue has no geometric 
+          // meaning there, where the saturation s = 0. Similarly, 
+          // the choice of 0 as the value for s when l is equal to 0 or 1 
+          // is arbitrary.        
+          
+          hue = sat = 0.0;
+          light = ( red / rgb_channels_norm_fac ); // or green or blue since they all are the same.
+        }
+        else
+        { // Color case
+          red_norm = ( red - rgb_channels_min ) / rgb_channels_norm_fac;
+          green_norm = ( green - rgb_channels_min ) / rgb_channels_norm_fac;
+          blue_norm = ( blue - rgb_channels_min ) / rgb_channels_norm_fac;
+          
+          r_minus_g = red_norm - green_norm;
+          r_minus_b = red_norm - blue_norm;
+          
+          cosvalue = sqrt( ( r_minus_g * r_minus_g ) + ( r_minus_b * 
+            ( green_norm - blue_norm ) ) );
+            
+          if( cosvalue == 0.0 )
+          {
+            teta = pi_rat_2;
+          }
+          else
+          {
+            cosvalue =  ( 0.5 * ( r_minus_g + r_minus_b )  ) /
+              cosvalue;
+            teta = acos( cosvalue );  
+          }
+            
+          TEAGN_DEBUG_CONDITION( ( cosvalue >= (-1.0) ) &&
+            ( cosvalue <= (1.0) ), "Invalid cosvalue value"
+            " cosvalue=" + Te2String( cosvalue, 9 )
+            + " red_norm=" + Te2String( red_norm, 9 )
+            + " green_norm=" + Te2String( green_norm, 9 )
+            + " blue_norm=" + Te2String( blue_norm, 9 )
+            + " r_minus_g=" + Te2String( r_minus_g, 9 )
+            + " r_minus_b=" + Te2String( r_minus_b, 9 )
+            + " rgb_channels_min=" + Te2String( rgb_channels_min, 9 ) 
+            + " rgb_channels_norm_fac=" + Te2String( rgb_channels_norm_fac, 9 )  
+            );
+            
+          if( blue_norm > green_norm )
+          {
+            hue = two_pi - teta;
+          }
+          else
+          {
+            hue = teta;
+          }
+            
+          rgb_sum = red_norm + green_norm + blue_norm;
+          
+          sat = 1.0 - ( 3 * MIN( MIN( red_norm, green_norm ), blue_norm ) /
+            rgb_sum );
+            
+          light = rgb_sum / 3.0;
+        }
+      } else {
+        hue = sat = light = 0.0;
+      }
+      
+      TEAGN_TRUE_OR_RETURN( output_raster0.setElement(
+        column, line, light, output_channel0 ),
+        "Unable to write intensity channel for output_image" );
+      TEAGN_TRUE_OR_RETURN( output_raster1.setElement(
+        column, line, hue, output_channel1 ),
+        "Unable to write hue channel for output_image" );
+      TEAGN_TRUE_OR_RETURN( output_raster2.setElement(
+        column, line, sat, output_channel2 ),
+        "Unable to write saturation channel for output_image" ); 
+    }
+    
+    TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+      "Canceled by the user" );    
+  }
+  
+  return true;
+}
+
+
+bool TePDIColorTransform::RunIhs2Rgb(
+  TePDITypes::TePDIRasterVectorType& input_rasters,
+  std::vector< int >& input_channels,
+  TePDITypes::TePDIRasterVectorType& output_rasters,
+  std::vector< int >& output_channels,
+  const double rgb_channels_min, const double rgb_channels_max )
+{
+  TEAGN_TRUE_OR_THROW( ( input_rasters.size() == 3 ),
+    "Invalid vector size" )
+  TEAGN_TRUE_OR_THROW( ( input_channels.size() == 3 ),
+    "Invalid vector size" )
+  TEAGN_TRUE_OR_THROW( ( output_rasters.size() == 3 ),
+    "Invalid vector size" )
+  TEAGN_TRUE_OR_THROW( ( output_channels.size() == 3 ),
+    "Invalid vector size" )
+                
+  /* Extracting local references */
+  
+  TeRaster& input_raster0 = *( input_rasters[ 0 ].nakedPointer() ); 
+  TeRaster& input_raster1 = *( input_rasters[ 1 ].nakedPointer() ); 
+  TeRaster& input_raster2 = *( input_rasters[ 2 ].nakedPointer() );
+  
+  const int input_channel0 = input_channels[ 0 ];
+  const int input_channel1 = input_channels[ 1 ];
+  const int input_channel2 = input_channels[ 2 ];
+  
+  TeRaster& output_raster0 = *( output_rasters[ 0 ].nakedPointer() ); 
+  TeRaster& output_raster1 = *( output_rasters[ 1 ].nakedPointer() ); 
+  TeRaster& output_raster2 = *( output_rasters[ 2 ].nakedPointer() );
+  
+  int output_channel0 = output_channels[ 0 ];
+  int output_channel1 = output_channels[ 1 ];
+  int output_channel2 = output_channels[ 2 ];  
+    
+  unsigned int lines = ( unsigned int ) input_raster0.params().nlines_;
+  unsigned int columns = ( unsigned int ) input_raster0.params().ncols_;
+
+  const double rgb_channels_diff = rgb_channels_max - rgb_channels_min;
+  const double rgb_channels_norm_fac = ( rgb_channels_diff != 0.0 ) ? 
+    rgb_channels_diff : 1.0;  
+ 
+  /* Dummy use definition */
+  
+  double out_raster_dummy = 0;
+  if( output_raster0.params().useDummy_ ) {
+    out_raster_dummy = output_raster0.params().dummy_[ 0 ];
+  }
+  
+  /* Raster convertion */
+  
+  const double pi_rat3 = M_PI / 3.0; // 60
+  const double two_pi_rat3 = 2.0 * M_PI / 3.0; // 120
+  const double four_pi_rat3 = 4.0 * M_PI / 3.0; // 240
+  
+  double red = 0, green = 0, blue = 0;
+  double hue = 0, sat = 0, lig = 0;
+  
+  StartProgInt( "Converting IHS -> RGB...", lines );
+  
+  for( unsigned int line = 0 ; line < lines ; ++line ) {
+    TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
+  
+    for( unsigned int column = 0 ; column < columns ; ++column ) {
+      if( input_raster0.getElement( column, line, lig, input_channel0 ) &&
+          input_raster1.getElement( column, line, hue, input_channel1 ) &&
+          input_raster2.getElement( column, line, sat, input_channel2 ) ) 
+      {
+        if( ( hue == 0.0 ) && ( sat == 0.0 ) )
+        { // Gray scale case
+          red = green = blue = ( lig * rgb_channels_norm_fac );
+        }
+        else
+        { // color case
+          /* Hue inside RG sector */
+          if( hue < two_pi_rat3 )
+          {
+            blue = lig * ( 1.0 - sat );
+            red = lig * ( 1.0 + ( sat * cos( hue ) / 
+              cos( pi_rat3 - hue ) ) );
+            green = ( 3.0 * lig ) - ( red + blue );
+          }
+          else if( hue < four_pi_rat3 )
+          { /* Hue inside GB sector */
+          
+            hue -= two_pi_rat3;
+            
+            red = lig * ( 1.0 - sat );
+            green = lig * ( 1.0 + ( sat * cos( hue ) / 
+              cos( pi_rat3 - hue ) ) );
+            blue = ( 3.0 * lig ) - ( red + green );
+          }
+          else
+          { /* Hue inside BR sector */
+          
+            hue -= four_pi_rat3;
+            
+            green = lig * ( 1.0 - sat );
+            blue = lig * ( 1.0 + ( sat * cos( hue ) / 
+              cos( pi_rat3 - hue ) ) );
+            red = ( 3.0 * lig ) - ( green + blue );
+          }
+          
+          red = ( red * rgb_channels_norm_fac ) + rgb_channels_min;
+          green = ( green * rgb_channels_norm_fac ) + rgb_channels_min;
+          blue = ( blue * rgb_channels_norm_fac ) + rgb_channels_min;
+        }
+        
+        red = MIN( red, rgb_channels_max );
+        green = MIN( green, rgb_channels_max );
+        blue = MIN( blue, rgb_channels_max );
+        
+        red = MAX( red, rgb_channels_min );
+        green = MAX( green, rgb_channels_min );
+        blue = MAX( blue, rgb_channels_min );        
+  
+        TEAGN_TRUE_OR_RETURN( output_raster0.setElement(
+          column, line, red, output_channel0 ),
+          "Unable to write red channel for output_image" );
+        TEAGN_TRUE_OR_RETURN( output_raster1.setElement(
+          column, line, green, output_channel1 ),
+          "Unable to write green channel for output_image" );
+        TEAGN_TRUE_OR_RETURN( output_raster2.setElement(
+          column, line, blue, output_channel2 ),
+          "Unable to write blue channel for output_image" );
+      } else {                    
+        TEAGN_TRUE_OR_RETURN( output_raster0.setElement(
+          column, line, out_raster_dummy, output_channel0 ),
+          "Unable to write red channel for output_image" );
+        TEAGN_TRUE_OR_RETURN( output_raster1.setElement(
+          column, line, out_raster_dummy, output_channel1 ),
+          "Unable to write green channel for output_image" );
+        TEAGN_TRUE_OR_RETURN( output_raster2.setElement(
+          column, line, out_raster_dummy, output_channel2 ),
+          "Unable to write blue channel for output_image" );
+      }
+    }
+  }
+
+  return true;
+}
+
diff --git a/src/terralib/image_processing/TePDIColorTransform.hpp b/src/terralib/image_processing/TePDIColorTransform.hpp
old mode 100755
new mode 100644
index d1eafda..63ea2d7
--- a/src/terralib/image_processing/TePDIColorTransform.hpp
+++ b/src/terralib/image_processing/TePDIColorTransform.hpp
@@ -1,152 +1,152 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDICOLORTRANSFORM_HPP
-  #define TEPDICOLORTRANSFORM_HPP
-
-  #include "TePDIAlgorithm.hpp"
-
-  /**
-   * @brief This is the class for raster color transforms.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIGeneralAlgoGroup
-   *
-   * @note The general required parameters are:
-   *
-   * @param input_rasters ( TePDITypes::TePDIRasterVectorType ) - 
-   * A vector of all used input rasters ( NOTE: When two or more bands
-   * from the same raster are used, this raster must be inserted 
-   * two or three times inside the vector.
-   * @param input_channels ( std::vector< int > ) - A vector of all used 
-   * input rasters channels/bands.
-   * @param output_rasters ( TePDITypes::TePDIRasterVectorType ) - 
-   * A vector of all used output rasters ( Possible combinations:
-   * One raster with 3 channels, 3 rasters with one channel per raster. ).
-   * @param transf_type ( TePDIColorTransform::ColorTransfTypes ) - 
-   * Transformation type.
-   * @param rgb_channels_min (double) - The output RGB channels min level.
-   * @param rgb_channels_max (double) - The output RGB channels max level.
-   *
-   * @note Channels disposition for RGB images:
-   * input_rasters[ 0 ]=Red , input_rasters[ 1 ]=Green , 
-   * input_rasters[ 2 ]=Blue
-   *   
-   * @note Channels disposition for IHS images:
-   * input_rasters[ 0 ]=Intensity , input_rasters[ 1 ]=Hue , 
-   * input_rasters[ 2 ]=Saturation
-   *
-   * @note This algorithm generates and expects IHS images with the 
-   * following channels ranges: I:[0,1] H:[0,2pi] (radians) S:[0,1]
-   */
-  class PDI_DLL TePDIColorTransform : public TePDIAlgorithm {
-    public :
-
-      /**
-       * @enum ColorTransfTypes Color transformation types.
-       * @note Reference: Digital Image Processing - Gonzales.
-       */
-      enum ColorTransfTypes {
-        /** RGB -> IHS */
-        Rgb2Ihs = 1,
-        /** IHS -> RGB */
-        Ihs2Rgb = 2
-      };
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIColorTransform();
-
-      /**
-       * @briefDefault Destructor
-       */
-      ~TePDIColorTransform();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-
-      /**
-       * @brief Runs the RGB -> IHS implementation.
-       * @param input_rasters Input rasters.
-       * @param input_channels Input rasters channels.
-       * @param output_rasters Output rasters.
-       * @param output_channels Output rasters channels.
-       * @param rgb_channels_min The output RGB channels min value.
-       * @param rgb_channels_max The output RGB channels max value.       
-       * @return true if OK. false if not.
-       */
-      bool RunRgb2Ihs( TePDITypes::TePDIRasterVectorType& input_rasters,
-        std::vector< int >& input_channels,
-        TePDITypes::TePDIRasterVectorType& output_rasters,
-        std::vector< int >& output_channels,
-        const double rgb_channels_min, const double rgb_channels_max );
-
-      /**
-       * @brief Runs the IHS -> RGB implementation.
-       * @param input_rasters Input rasters.
-       * @param input_channels Input rasters channels.
-       * @param output_rasters Output rasters.
-       * @param output_channels Output rasters channels.
-       * @param rgb_channels_min The output RGB channels min value.
-       * @param rgb_channels_max The output RGB channels max value.
-       * @return true if OK. false if not.
-       */
-      bool RunIhs2Rgb( TePDITypes::TePDIRasterVectorType& input_rasters,
-        std::vector< int >& input_channels,
-        TePDITypes::TePDIRasterVectorType& output_rasters,
-        std::vector< int >& output_channels,
-        const double rgb_channels_min, const double rgb_channels_max );
-
-  };
-  
-/** @example TePDIColorTransform_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDISTATISTIC_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDICOLORTRANSFORM_HPP
+  #define TEPDICOLORTRANSFORM_HPP
+
+  #include "TePDIAlgorithm.hpp"
+
+  /**
+   * @brief This is the class for raster color transforms.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIGeneralAlgoGroup
+   *
+   * @note The general required parameters are:
+   *
+   * @param input_rasters ( TePDITypes::TePDIRasterVectorType ) - 
+   * A vector of all used input rasters ( NOTE: When two or more bands
+   * from the same raster are used, this raster must be inserted 
+   * two or three times inside the vector.
+   * @param input_channels ( std::vector< int > ) - A vector of all used 
+   * input rasters channels/bands.
+   * @param output_rasters ( TePDITypes::TePDIRasterVectorType ) - 
+   * A vector of all used output rasters ( Possible combinations:
+   * One raster with 3 channels, 3 rasters with one channel per raster. ).
+   * @param transf_type ( TePDIColorTransform::ColorTransfTypes ) - 
+   * Transformation type.
+   * @param rgb_channels_min (double) - The output RGB channels min level.
+   * @param rgb_channels_max (double) - The output RGB channels max level.
+   *
+   * @note Channels disposition for RGB images:
+   * input_rasters[ 0 ]=Red , input_rasters[ 1 ]=Green , 
+   * input_rasters[ 2 ]=Blue
+   *   
+   * @note Channels disposition for IHS images:
+   * input_rasters[ 0 ]=Intensity , input_rasters[ 1 ]=Hue , 
+   * input_rasters[ 2 ]=Saturation
+   *
+   * @note This algorithm generates and expects IHS images with the 
+   * following channels ranges: I:[0,1] H:[0,2pi] (radians) S:[0,1]
+   */
+  class PDI_DLL TePDIColorTransform : public TePDIAlgorithm {
+    public :
+
+      /**
+       * @enum ColorTransfTypes Color transformation types.
+       * @note Reference: Digital Image Processing - Gonzales.
+       */
+      enum ColorTransfTypes {
+        /** RGB -> IHS */
+        Rgb2Ihs = 1,
+        /** IHS -> RGB */
+        Ihs2Rgb = 2
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIColorTransform();
+
+      /**
+       * @briefDefault Destructor
+       */
+      ~TePDIColorTransform();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+
+      /**
+       * @brief Runs the RGB -> IHS implementation.
+       * @param input_rasters Input rasters.
+       * @param input_channels Input rasters channels.
+       * @param output_rasters Output rasters.
+       * @param output_channels Output rasters channels.
+       * @param rgb_channels_min The output RGB channels min value.
+       * @param rgb_channels_max The output RGB channels max value.       
+       * @return true if OK. false if not.
+       */
+      bool RunRgb2Ihs( TePDITypes::TePDIRasterVectorType& input_rasters,
+        std::vector< int >& input_channels,
+        TePDITypes::TePDIRasterVectorType& output_rasters,
+        std::vector< int >& output_channels,
+        const double rgb_channels_min, const double rgb_channels_max );
+
+      /**
+       * @brief Runs the IHS -> RGB implementation.
+       * @param input_rasters Input rasters.
+       * @param input_channels Input rasters channels.
+       * @param output_rasters Output rasters.
+       * @param output_channels Output rasters channels.
+       * @param rgb_channels_min The output RGB channels min value.
+       * @param rgb_channels_max The output RGB channels max value.
+       * @return true if OK. false if not.
+       */
+      bool RunIhs2Rgb( TePDITypes::TePDIRasterVectorType& input_rasters,
+        std::vector< int >& input_channels,
+        TePDITypes::TePDIRasterVectorType& output_rasters,
+        std::vector< int >& output_channels,
+        const double rgb_channels_min, const double rgb_channels_max );
+
+  };
+  
+/** @example TePDIColorTransform_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDISTATISTIC_HPP
diff --git a/src/terralib/image_processing/TePDIColorTransformFactory.cpp b/src/terralib/image_processing/TePDIColorTransformFactory.cpp
old mode 100755
new mode 100644
index 7c1d81a..2bb8ff4
--- a/src/terralib/image_processing/TePDIColorTransformFactory.cpp
+++ b/src/terralib/image_processing/TePDIColorTransformFactory.cpp
@@ -1,24 +1,24 @@
- 
-#include "TePDIColorTransformFactory.hpp"
-#include "TePDIColorTransform.hpp"
-#include <TeAgnostic.h>
-
-TePDIColorTransformFactory::TePDIColorTransformFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIColorTransform" ) )
-{
-};      
-
-TePDIColorTransformFactory::~TePDIColorTransformFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIColorTransformFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIColorTransform();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIColorTransformFactory.hpp"
+#include "TePDIColorTransform.hpp"
+#include <TeAgnostic.h>
+
+TePDIColorTransformFactory::TePDIColorTransformFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIColorTransform" ) )
+{
+};      
+
+TePDIColorTransformFactory::~TePDIColorTransformFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIColorTransformFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIColorTransform();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIColorTransformFactory.hpp b/src/terralib/image_processing/TePDIColorTransformFactory.hpp
old mode 100755
new mode 100644
index 8c91084..1e0a1a9
--- a/src/terralib/image_processing/TePDIColorTransformFactory.hpp
+++ b/src/terralib/image_processing/TePDIColorTransformFactory.hpp
@@ -1,67 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDICOLORTRANSFORMFACTORY_HPP
-  #define TEPDICOLORTRANSFORMFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for color transform algorithms factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIColorTransformFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIColorTransformFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIColorTransformFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIColorTransformFactory TePDIColorTransformFactory_instance;
-  };  
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDICOLORTRANSFORMFACTORY_HPP
+  #define TEPDICOLORTRANSFORMFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for color transform algorithms factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIColorTransformFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIColorTransformFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIColorTransformFactory();
+      
+      protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace {
+    static TePDIColorTransformFactory TePDIColorTransformFactory_instance;
+  };  
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIContrast.cpp b/src/terralib/image_processing/TePDIContrast.cpp
old mode 100755
new mode 100644
index 534f9c7..ea17b70
--- a/src/terralib/image_processing/TePDIContrast.cpp
+++ b/src/terralib/image_processing/TePDIContrast.cpp
@@ -1,1739 +1,1763 @@
-#include "TePDIContrast.hpp"
-
-#include <TeAgnostic.h>
-#include <TePDITypes.hpp>
-#include <TePDIUtils.hpp>
-#include <TePDIHistogram.hpp>
-#include <TePDIMatrix.hpp>
-
-#include <math.h>
-#include <float.h>
-
-
-TePDIContrast::TePDIContrast()
-{
-}
-
-
-TePDIContrast::~TePDIContrast()
-{
-}
-
-
-bool TePDIContrast::RunImplementation()
-{
-  /* Getting general parameters */
-
-  TePDIContrastType contrast_type;
-  params_.GetParameter( "contrast_type", contrast_type );
-
-  TePDITypes::TePDIRasterPtrType inRaster;
-  int input_band = 0;
-  if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-    "input_image" ) ) {
-    
-    params_.GetParameter( "input_image", inRaster );
-    params_.GetParameter( "input_band", input_band );
-  }
-
-  int output_band = 0;
-  TePDITypes::TePDIRasterPtrType outRaster;
-  if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-    "output_image" ) ) {
-    
-    params_.GetParameter( "output_image", outRaster );
-    params_.GetParameter( "output_band", output_band );  
-  }  
-  
-  double min_level = 0;
-  double max_level = 0;
-  if( params_.CheckParameter< double >( "min_level" ) ) {
-    
-    params_.GetParameter( "min_level", min_level );
-  }
-  if( params_.CheckParameter< double >( "max_level" ) ) {
-    
-    params_.GetParameter( "max_level", max_level );
-  }
-  
-  TePDIRgbPalette::pointer palette;
-  if( params_.CheckParameter< TePDIRgbPalette::pointer >( "rgb_palette" ) ) {
-  
-    params_.GetParameter( "rgb_palette", palette );
-  }
-  
-  /* output dumyy value definition */
- 
-  bool output_raster_uses_dummy = false;
-  double output_raster_dummy = 0;
-  
-  if( outRaster.isActive() ) {
-    output_raster_uses_dummy = outRaster->params().useDummy_;
-    
-    if( output_raster_uses_dummy ) {
-      output_raster_dummy = outRaster->params().dummy_[ 0 ];
-    }    
-  }
-  
-  if( params_.CheckParameter< double >( "dummy_value" ) ) {
-    
-    params_.GetParameter( "dummy_value", output_raster_dummy );
-    
-    output_raster_uses_dummy = true;
-  }  
-  
-  /* Reseting output raster */
-  
-  if( outRaster.isActive() ) {
-    switch( contrast_type ) {
-      case TePDIContrastSimpleSlicer :
-      {
-        bool output_reset_not_needed = true;
-        
-        if( ! params_.CheckParameter< int >( "restrict_out_reset" ) ) {
-          output_reset_not_needed = false;
-        }
-        
-        if( output_reset_not_needed &&
-          ( inRaster->params().nlines_ != outRaster->params().nlines_ ) ) {
-           
-          output_reset_not_needed = false; 
-        }
-        
-        if( output_reset_not_needed &&
-          ( inRaster->params().ncols_ != outRaster->params().ncols_ ) ) {
-           
-          output_reset_not_needed = false; 
-        }
-        
-        if( output_reset_not_needed &&
-          ( output_band >= outRaster->params().nBands() ) ) {
-           
-          output_reset_not_needed = false; 
-        }
-        
-        if( output_reset_not_needed &&
-          ( 
-            ( inRaster->projection() == outRaster->projection() ) ? 
-            false : 
-            ( 
-              ( inRaster->projection() == 0 ) ?
-              true :
-              (
-                ( outRaster->projection() == 0 ) ? 
-                true :
-                ( inRaster->projection()->name() == 
-                  outRaster->projection()->name() ) ? false : true
-              )
-            ) 
-          )        
-         ) {
-           
-          output_reset_not_needed = false; 
-        }
-        
-        if( output_reset_not_needed &&
-          ( inRaster->params().box() != outRaster->params().box() ) ) {
-           
-          output_reset_not_needed = false; 
-        }
-        
-        if( output_reset_not_needed &&
-          ( inRaster->params().photometric_[ 0 ] != TeRasterParams::TePallete 
-          ) ) {
-           
-          output_reset_not_needed = false; 
-        }        
-        
-        if( output_reset_not_needed &&
-            ( ( outRaster->params().useDummy_ == output_raster_uses_dummy ) ?
-              false :
-              ( outRaster->params().useDummy_ ? 
-                ( outRaster->params().dummy_[ 0 ] != output_raster_dummy ) :
-                false
-              ) 
-            )
-          ) {
-           
-          output_reset_not_needed = false; 
-        }   
-              
-        if( ! output_reset_not_needed ) {
-          
-          TeRasterParams new_outRaster_params = outRaster->params();
-          new_outRaster_params.nBands( output_band + 1 );
-          if( inRaster->projection() == 0 ) {
-            new_outRaster_params.projection( 0 );
-          } else {
-            TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-              inRaster->projection()->params() ) );          
-            new_outRaster_params.projection( proj.nakedPointer() );
-          }
-          new_outRaster_params.boxResolution( inRaster->params().box().x1(), 
-            inRaster->params().box().y1(), inRaster->params().box().x2(), 
-            inRaster->params().box().y2(), 
-            inRaster->params().resx_, inRaster->params().resy_ );
-            
-          new_outRaster_params.setPhotometric( TeRasterParams::TePallete );
-          
-          new_outRaster_params.lutr_.clear();
-          new_outRaster_params.lutg_.clear();
-          new_outRaster_params.lutb_.clear();
-
-          TePDIRgbPalette::iterator pal_it = palette->begin();
-          TePDIRgbPalette::iterator pal_it_end = palette->end();
-          for( unsigned int lut_index = 0 ; lut_index < palette->size() ;
-              ++lut_index ) {
-    
-            new_outRaster_params.lutr_.push_back( 
-              (unsigned short)pal_it->second.red_ );
-            new_outRaster_params.lutg_.push_back( 
-              (unsigned short)pal_it->second.green_ );
-            new_outRaster_params.lutb_.push_back( 
-              (unsigned short)pal_it->second.blue_ );
-
-            ++pal_it;
-          }
-          
-          if( output_raster_uses_dummy ) {
-            new_outRaster_params.setDummy( output_raster_dummy, -1 );
-          } else {
-            new_outRaster_params.useDummy_ = false;
-          }
-            
-          TEAGN_TRUE_OR_RETURN( outRaster->init( new_outRaster_params ),            
-            "Output raster reset error" );           
-        }
-      
-        break;
-      }  
-      default :
-      {
-        /* Reseting output raster */
-        
-        bool output_reset_not_needed = true;
-        
-        if( ! params_.CheckParameter< int >( "restrict_out_reset" ) ) {
-          output_reset_not_needed = false;
-        }
-        
-        if( output_reset_not_needed &&
-          ( inRaster->params().nlines_ != outRaster->params().nlines_ ) ) {
-           
-          output_reset_not_needed = false; 
-        }
-        
-        if( output_reset_not_needed &&
-          ( inRaster->params().ncols_ != outRaster->params().ncols_ ) ) {
-           
-          output_reset_not_needed = false; 
-        }
-        
-        if( output_reset_not_needed &&
-          ( output_band >= outRaster->params().nBands() ) ) {
-           
-          output_reset_not_needed = false; 
-        }
-        
-        if( output_reset_not_needed &&
-          ( 
-            ( inRaster->projection() == outRaster->projection() ) ? 
-            false : 
-            ( 
-              ( inRaster->projection() == 0 ) ?
-              true :
-              (
-                ( outRaster->projection() == 0 ) ? 
-                true :
-                ( inRaster->projection()->name() == 
-                  outRaster->projection()->name() ) ? false : true
-              )
-            ) 
-          )        
-         ) {
-           
-          output_reset_not_needed = false; 
-        }
-        
-        if( output_reset_not_needed &&
-          ( inRaster->params().box() != outRaster->params().box() ) ) {
-           
-          output_reset_not_needed = false; 
-        }
-        
-        if( output_reset_not_needed &&
-            ( ( outRaster->params().useDummy_ == output_raster_uses_dummy ) ?
-              false :
-              ( outRaster->params().useDummy_ ? 
-                ( outRaster->params().dummy_[ 0 ] != output_raster_dummy ) :
-                false
-              ) 
-            )
-          ) {
-           
-          output_reset_not_needed = false; 
-        }          
-        
-        if( ! output_reset_not_needed ) {
-        
-          TeRasterParams new_outRaster_params = outRaster->params();
-          new_outRaster_params.nBands( output_band + 1 );
-          if( inRaster->projection() == 0 ) {
-            new_outRaster_params.projection( 0 );
-          } else {
-            TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-              inRaster->projection()->params() ) );          
-            new_outRaster_params.projection( proj.nakedPointer() );
-          }
-          new_outRaster_params.boxResolution( inRaster->params().box().x1(), 
-            inRaster->params().box().y1(), inRaster->params().box().x2(), 
-            inRaster->params().box().y2(), 
-            inRaster->params().resx_, inRaster->params().resy_ );            
-            
-          if( output_raster_uses_dummy ) {
-            new_outRaster_params.setDummy( output_raster_dummy, -1 );
-          } else {
-            new_outRaster_params.useDummy_ = false;
-          }            
-          
-          new_outRaster_params.setPhotometric( TeRasterParams::TeMultiBand );
-            
-          TEAGN_TRUE_OR_RETURN( outRaster->init( new_outRaster_params ),
-            "Output raster reset error" );             
-        }
-        
-        break;
-      }
-    }
-  }
-  
-  /* Getting output channel range */
-  
-  double output_channel_min_level = 0;
-  double output_channel_max_level = 0;
-  
-  if( params_.CheckParameter< double >( "output_channel_min_level" ) ) {
-    params_.GetParameter( "output_channel_min_level",
-      output_channel_min_level );
-    params_.GetParameter( "output_channel_max_level",
-      output_channel_max_level );
-  } else {
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, output_band, output_channel_min_level,
-      output_channel_max_level ), "Unable to get raster channel level bounds" );  
-  }
-      
-  /* Building a lut suitable for each algorithm */
-    
-  TePDITypes::TePDILutType lut;
-  bool hist_based_lut = false;
-  bool fixed_step_lut = false;
-  
-  switch( contrast_type ) {
-    case TePDIContrastMinMax :
-    {
-      TePDITypes::TePDILutType baselut;
-      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut ),
-        "Error getting base lut" );
-      
-      lut = GetMinMaxLut( output_channel_min_level, output_channel_max_level,
-        baselut );
-  
-      break;
-    }
-    case TePDIContrastLinear :
-    {
-      TePDITypes::TePDILutType baselut;
-      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut ),
-        "Error getting base lut" );
-            
-      lut = GetLinearLut( baselut,
-        min_level, max_level, output_channel_min_level, output_channel_max_level );
-  
-      break;
-    }
-    case TePDIContrastSquareRoot :
-    {
-      TePDITypes::TePDILutType baselut;
-      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut ),
-        "Error getting base lut" );    
-    
-      lut = GetSquareRootLut( baselut,
-        min_level, max_level, output_channel_min_level, output_channel_max_level );
-  
-      break;
-    }
-    case TePDIContrastSquare :
-    {
-      TePDITypes::TePDILutType baselut;
-      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut ),
-        "Error getting base lut" ); 
-            
-      lut = GetSquareLut( baselut,
-        min_level, max_level, output_channel_min_level, output_channel_max_level );
-  
-      break;
-    }
-    case TePDIContrastLog :
-    {
-      TePDITypes::TePDILutType baselut;
-      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut ),
-        "Error getting base lut" ); 
-            
-      lut = GetLogLut( baselut,
-        min_level, max_level, output_channel_min_level, output_channel_max_level );
-  
-      break;
-    }
-    case TePDIContrastNegative :
-    {
-      TePDITypes::TePDILutType baselut;
-      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut ),
-        "Error getting base lut" ); 
-            
-      lut = GetNegativeLut( baselut,
-        min_level, max_level, output_channel_min_level, output_channel_max_level );
- 
-      break;
-    }
-    case TePDIContrastHistEqualizer :
-    {
-      TePDIHistogram::pointer histogram;
-      TEAGN_TRUE_OR_RETURN( getHistogram( histogram ), 
-        "Unable to get histogram" );
-        
-      fixed_step_lut = histogram->hasFixedStep();
-      hist_based_lut = true;
-    
-      lut = GetHistEqualizerLut( histogram,
-        output_channel_min_level, output_channel_max_level );
-  
-      break;
-    }
-    case TePDIContrastSimpleSlicer :
-    {
-      TePDIHistogram::pointer histogram;
-      TEAGN_TRUE_OR_RETURN( getHistogram( histogram ), 
-        "Unable to get histogram" );
-        
-      fixed_step_lut = histogram->hasFixedStep();
-      hist_based_lut = true;
-            
-      GetSimpleSlicerLut( histogram,
-        palette,  min_level, max_level, lut );
-  
-      break;
-    }
-    case TePDIContrastStat :
-    {
-      TePDIHistogram::pointer histogram;
-      TEAGN_TRUE_OR_RETURN( getHistogram( histogram ), 
-        "Unable to get histogram" );
-        
-      fixed_step_lut = histogram->hasFixedStep();
-      hist_based_lut = true;
-    
-      double target_mean = 0;
-      params_.GetParameter( "target_mean", target_mean );
-      
-      double target_variance = 0;
-      params_.GetParameter( "target_variance", target_variance );
-      GetStatLut( histogram, target_mean, target_variance,
-        output_channel_min_level, output_channel_max_level, lut );
-  
-      break;
-    }    
-    default :
-    {
-      TEAGN_LOG_AND_THROW( "Unsuported contrast type" );
-      break;
-    }
-  }
-  
-  /* Updating the output lut, if present */
-  
-  if( params_.CheckParameter< TePDITypes::TePDILutPtrType >( 
-    "outlut" ) ) {
-
-    TePDITypes::TePDILutPtrType outlut;  
-    params_.GetParameter( "outlut", outlut );
-    
-    *outlut = lut;
-  }    
-
-  /* Rendering output raster */
-  
-  if( outRaster.isActive() ) {
-    if( hist_based_lut ) {
-      TEAGN_TRUE_OR_RETURN( RemapLevels( inRaster, lut, input_band, 
-        output_band, outRaster, output_raster_uses_dummy, output_raster_dummy, 
-        fixed_step_lut ), "Level remapping error" );
-    } else {
-      TEAGN_TRUE_OR_RETURN( FullRangeLutRemapLevels( inRaster, lut, 
-        input_band, output_band, outRaster, output_raster_uses_dummy, 
-        output_raster_dummy ), "Level remapping error" );    
-    }
-  }
-  
-  /* Returning the generated histogram, if required */
-  
-  if( params_.CheckParameter< TePDIHistogram::pointer >( 
-    "output_original_histogram" ) ) {
-    
-    TePDIHistogram::pointer curr_histo_ptr;
-    TEAGN_TRUE_OR_RETURN( getHistogram( curr_histo_ptr ), 
-        "Unable to get histogram" );      
-  
-    TePDIHistogram::pointer output_original_histogram;
-    params_.GetParameter( "output_original_histogram", 
-      output_original_histogram );
-    
-    (*output_original_histogram) = (*curr_histo_ptr);
-  }
-  
-  /* Returning output_enhanced_histogram, if required */
-  
-  if( params_.CheckParameter< TePDIHistogram::pointer >( 
-    "output_enhanced_histogram" ) ) {
-    
-    TePDIHistogram::pointer curr_histo_ptr;
-    TEAGN_TRUE_OR_RETURN( getHistogram( curr_histo_ptr ), 
-        "Unable to get histogram" );      
-  
-    TePDIHistogram::pointer output_enhanced_histogram;
-    params_.GetParameter( "output_enhanced_histogram", 
-      output_enhanced_histogram );
-    
-    TePDIHistogram::iterator curr_histo_it = curr_histo_ptr->begin();
-    TePDIHistogram::iterator curr_histo_it_end = curr_histo_ptr->end();
-    TePDITypes::TePDILutType::iterator lut_it_end = lut.end();
-    TePDITypes::TePDILutType::iterator found_lut_mapping_it;
-    
-    while( curr_histo_it != curr_histo_it_end ) {
-      found_lut_mapping_it = lut.find( curr_histo_it->first );
-      
-      if( found_lut_mapping_it != lut_it_end ) {
-        (*output_enhanced_histogram)[ found_lut_mapping_it->second ]
-          += curr_histo_it->second;
-      }
-    
-      ++curr_histo_it;
-    }
-  }  
-  
-  return true;
-}
-
-
-bool TePDIContrast::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking input raster */
-
-  if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-    "input_image" ) ) {
-    
-    TePDITypes::TePDIRasterPtrType inRaster;
-    
-    if( ! parameters.GetParameter( "input_image", inRaster ) ) {
-  
-      TEAGN_LOGERR( "Missing parameter: input_image" );
-      return false;
-    }
-    if( ! inRaster.isActive() ) {
-  
-      TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
-      return false;
-    }
-    if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-  
-    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
-      return false;
-    }
-    
-    /* Checking input band */
-    
-    int input_band;
-    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_band", input_band ),
-      "Missing parameter: input_band" );
-    TEAGN_TRUE_OR_RETURN( ( ( input_band >= 0 ) && 
-      ( input_band < inRaster->nBands() ) ),
-      "Invalid parameter: input_band" );     
-      
-    /* Checking photometric interpretation */
-    
-    TEAGN_TRUE_OR_RETURN( ( 
-      ( inRaster->params().photometric_[ input_band ] == 
-        TeRasterParams::TeRGB ) ||
-      ( inRaster->params().photometric_[ input_band ] == 
-        TeRasterParams::TeMultiBand ) ),
-    "Invalid parameter - input_image (invalid photometric interpretation)" );    
-  }
-        
-  /* checking output raster, if present */
-  
-  TePDITypes::TePDIRasterPtrType output_image;
-  if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-    "output_image" ) ) {
-    
-    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_image", 
-      output_image ),  "Missing parameter: output_image" );
-    TEAGN_TRUE_OR_RETURN( output_image.isActive(),
-      "Invalid parameter: output_image inactive" );
-    TEAGN_TRUE_OR_RETURN( output_image->params().status_ != 
-      TeRasterParams::TeNotReady, 
-      "Invalid parameter: output_image not ready" );
-      
-    /* Checking output_band */
-    
-    int output_band;
-    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_band", 
-      output_band ), "Missing parameter: output_band" );
-    TEAGN_TRUE_OR_RETURN( ( output_band >= 0 ),
-      "Invalid parameter: output_band" ); 
-      
-    /* Input raster needed if output_image is present */
-    
-    TEAGN_TRUE_OR_RETURN( 
-      parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-      "input_image" ), "Missing parameter: input_image" );
-  }
-
-  /* Checking for the correct allowed contrast types */
-
-  TePDIContrastType contrast_type;
-  if( ! parameters.GetParameter( "contrast_type", contrast_type ) ) {
-    TEAGN_LOGERR( "Missing parameter: contrast_type" );
-    return false;
-  }
-  TEAGN_CHECK_NOTEQUAL( contrast_type, 0, "Invalid Contrast type" );
-  if( ( contrast_type != TePDIContrastMinMax ) &&
-      ( contrast_type != TePDIContrastLinear ) &&
-      ( contrast_type != TePDIContrastSquareRoot ) &&
-      ( contrast_type != TePDIContrastSquare ) &&
-      ( contrast_type != TePDIContrastLog ) &&
-      ( contrast_type != TePDIContrastNegative ) &&
-      ( contrast_type != TePDIContrastHistEqualizer ) &&
-      ( contrast_type != TePDIContrastSimpleSlicer ) &&
-      ( contrast_type != TePDIContrastStat ) ) {
-
-    TEAGN_LOGERR( "Invalid parameter: contrast_type" );
-    return false;
-  }
-
-  /* Checking for min and max required parameters */
-
-  if( ( contrast_type == TePDIContrastLinear ) ||
-      ( contrast_type == TePDIContrastSquareRoot ) ||
-      ( contrast_type == TePDIContrastSquare ) ||
-      ( contrast_type == TePDIContrastLog ) ||
-      ( contrast_type == TePDIContrastNegative ) ||
-      ( contrast_type == TePDIContrastSimpleSlicer ) ) {
-
-    if( ! parameters.CheckParameter< double >( "min_level" ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: min_level" );
-      return false;
-    }
-    if( ! parameters.CheckParameter< double >( "max_level" ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: max_level" );
-      return false;
-    }
-  }
-
-  /* Checking for RGB Palette required parameters */
-
-  if( ( contrast_type == TePDIContrastSimpleSlicer ) ) {
-    TePDIRgbPalette::pointer rgb_palette;
-
-    if( ( ! parameters.GetParameter( "rgb_palette", rgb_palette ) ) ||
-        ( ! rgb_palette.isActive() ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: rgb_palette" );
-      return false;
-    }
-  }
-  
-  /* checking outlut parameter */
-  
-  if( parameters.CheckParameter< TePDITypes::TePDILutPtrType >( 
-    "outlut" ) ) {
-
-    TePDITypes::TePDILutPtrType outlut;  
-    parameters.GetParameter( "outlut", outlut );
-    
-    TEAGN_TRUE_OR_RETURN( outlut.isActive(),
-      "Invalid parameter: outlut" );
-  }
-  
-  /* checking input_histogram */
-  
-  TePDIHistogram::pointer input_histogram;
-  
-  if( parameters.CheckParameter< TePDIHistogram::pointer >( 
-    "input_histogram" ) ) {
-  
-    parameters.GetParameter( "input_histogram", input_histogram );
-    TEAGN_TRUE_OR_RETURN( input_histogram.isActive(),
-      "Invalid parameter: input_histogram" );
-    TEAGN_TRUE_OR_RETURN( ( input_histogram->size() > 0 ),
-      "Invalid parameter: input_histogram" );
-  } else {
-    /* Input raster needed if input_histogram isn't present */
-    
-    TEAGN_TRUE_OR_RETURN( 
-      parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-      "input_image" ), "Missing parameter: input_image" );
-  }
-  
-  /* checking output_original_histogram */
-  
-  TePDIHistogram::pointer output_original_histogram;
-  
-  if( parameters.CheckParameter< TePDIHistogram::pointer >( 
-    "output_original_histogram" ) ) {
-  
-    parameters.GetParameter( "output_original_histogram", 
-      output_original_histogram );
-    TEAGN_TRUE_OR_RETURN( output_original_histogram.isActive(),
-      "Invalid parameter: output_original_histogram" );
-  }
-
-  /* checking output_enhanced_histogram */
-  
-  TePDIHistogram::pointer output_enhanced_histogram;
-  
-  if( parameters.CheckParameter< TePDIHistogram::pointer >( 
-    "output_enhanced_histogram" ) ) {
-  
-    parameters.GetParameter( "output_enhanced_histogram", 
-      output_enhanced_histogram );
-    TEAGN_TRUE_OR_RETURN( output_enhanced_histogram.isActive(),
-      "Invalid parameter: output_enhanced_histogram" );
-  }  
-  
-  /* Checking target_mean and target_variance */
-  
-  if( ( contrast_type == TePDIContrastStat ) ) {
-    double target_mean = 0;
-    TEAGN_TRUE_OR_RETURN( 
-      parameters.GetParameter( "target_mean", target_mean ),
-      "Missing parameter: target_mean" );
-      
-    double target_variance = 0;
-    TEAGN_TRUE_OR_RETURN( 
-      parameters.GetParameter( "target_variance", target_variance ),
-      "Missing parameter: target_variance" );      
-  }
-  
-  /* Checking input_variance */
-  
-  /* if input_variance is zero the algoritm will fail in GetStatLut */
-  
-  double input_variance = 0;
-  
-  if( parameters.CheckParameter< double >( "input_variance" ) ) {
-    parameters.GetParameter( "input_variance", input_variance );
-    
-    TEAGN_TRUE_OR_RETURN( ( input_variance != 0 ),
-      "Invalid parameter - input_variance" )
-  }
-  
-  /* Checking output_channel_min_level and output_channel_max_level */
-  
-  if( ! output_image.isActive() ) {
-  
-    TEAGN_TRUE_OR_RETURN( 
-      parameters.CheckParameter< double >( "output_channel_min_level" ),
-      "Missing parameter: output_channel_min_level" );
-    TEAGN_TRUE_OR_RETURN( 
-      parameters.CheckParameter< double >( "output_channel_max_level" ),
-      "Missing parameter: output_channel_max_level" );
-  }
-  
-  return true;
-}
-
-
-void TePDIContrast::ResetState( const TePDIParameters& params )
-{
-  if( params != params_ ) {
-    histo_ptr_.reset();
-  }
-}
-
-
-TePDITypes::TePDILutType TePDIContrast::GetMinMaxLut(
-  double output_channel_min_level, double output_channel_max_level,
-  TePDITypes::TePDILutType& base_lut )
-{
-  TEAGN_TRUE_OR_THROW( base_lut.size() != 0, "Invalid base_lut" );
-  
-  double lut_max = (-1.0) * DBL_MAX;
-  double lut_min = DBL_MAX;
-  
-  TePDITypes::TePDILutType::iterator it = base_lut.begin();
-  TePDITypes::TePDILutType::iterator it_end = base_lut.end();
-  
-  while( it != it_end ) {
-    if( it->first < lut_min ) {
-      lut_min = it->first;
-    }
-    if( it->first > lut_max ) {
-      lut_max = it->first;
-    }
-  
-    ++it;
-  }
-
-  return GetLinearLut( base_lut, lut_min,
-    lut_max, output_channel_min_level, output_channel_max_level );
-}
-
-
-TePDITypes::TePDILutType TePDIContrast::GetLinearLut(
-  TePDITypes::TePDILutType& base_lut,
-  double min, double max,
-  double output_channel_min_level, double output_channel_max_level )
-{
-  TEAGN_CHECK_NOTEQUAL( base_lut.size(), 0, "Invalid base_lut size" );
-  TEAGN_TRUE_OR_THROW( max > min, "Invalid max and min values" );
-
-  /* Calculating parameters */
-
-  unsigned int levels = base_lut.size();
-
-  double a = 0;
-  double b = 0;
-
-  if( max == min ) {
-    a = (double)levels;
-    b = -1. * ((double)levels) * min;
-  } else {
-    a = ((double)levels) / ( max - min );
-    b = ( -1. * ((double)levels) * min ) / ( max - min );
-  }
-
-  /* Generating LUT map using the existing histogram levels */
-
-  TePDITypes::TePDILutType out_lut;
-
-  TePDITypes::TePDILutType::iterator base_lut_it = base_lut.begin();
-  TePDITypes::TePDILutType::iterator base_lut_it_end = base_lut.end();
-  
-  unsigned int progress = 0;
-  double mapped_level = 0;
-  StartProgInt( "Building Linear Lut...", base_lut.size() );
-
-  while( base_lut_it != base_lut_it_end ) {
-    UpdateProgInt( progress );
-    
-    if( base_lut_it->first <= min ) {
-      out_lut[ base_lut_it->first ] = output_channel_min_level;
-    } else if( base_lut_it->first >= max ) {
-      out_lut[ base_lut_it->first ] = output_channel_max_level;
-    } else {
-      mapped_level = ( a * base_lut_it->first ) + b;
-      
-      if( mapped_level < output_channel_min_level ) {
-        mapped_level = output_channel_min_level;
-      } else if( mapped_level > output_channel_max_level ) {
-        mapped_level = output_channel_max_level;
-      }
-      
-      out_lut[ base_lut_it->first ] = mapped_level;
-    }
-
-    ++progress;
-    ++base_lut_it;
-  }
-
-  return out_lut;
-}
-
-
-TePDITypes::TePDILutType TePDIContrast::GetSquareRootLut(
-  TePDITypes::TePDILutType& base_lut,
-  double min, double max,
-  double output_channel_min_level, double output_channel_max_level )
-{
-  TEAGN_CHECK_NOTEQUAL( base_lut.size(), 0, "Invalid base_lut size" );
-  TEAGN_TRUE_OR_THROW( min < max, "Invalid min and max values" );
-
-  unsigned int levels = base_lut.size();
-
-  double factor = ((double)levels) / sqrt( max - min );
-
-  /* Generating LUT map using the existing base lut levels */
-
-  TePDITypes::TePDILutType out_lut;
-
-  TePDITypes::TePDILutType::iterator base_lut_it = base_lut.begin();
-  TePDITypes::TePDILutType::iterator base_lut_it_end = base_lut.end();
-  
-  unsigned int progress = 0;
-  double mapped_level = 0;
-  StartProgInt( "Building Square Root Lut...", base_lut.size() );  
-
-  while( base_lut_it != base_lut_it_end ) {
-    UpdateProgInt( progress );
-    
-    if( base_lut_it->first <= min ) {
-      out_lut[ base_lut_it->first ] = output_channel_min_level;
-    } else if( base_lut_it->first >= max ) {
-      out_lut[ base_lut_it->first ] = output_channel_max_level;
-    } else {
-      mapped_level = factor * sqrt( base_lut_it->first - min );
-      
-      if( mapped_level < output_channel_min_level ) {
-        mapped_level = output_channel_min_level;
-      } else if( mapped_level > output_channel_max_level ) {
-        mapped_level = output_channel_max_level;
-      }      
-      
-      out_lut[ base_lut_it->first ] = mapped_level;
-    }
-
-    ++progress;
-    ++base_lut_it;
-  }
-
-  return out_lut;
-}
-
-
-TePDITypes::TePDILutType TePDIContrast::GetSquareLut(
-  TePDITypes::TePDILutType& base_lut,
-  double min, double max,
-  double output_channel_min_level, double output_channel_max_level )
-{
-  TEAGN_CHECK_NOTEQUAL( base_lut.size(), 0, "Invalid base_lut size" );
-  TEAGN_TRUE_OR_THROW( min < max, "Invalid min and max values" );
-
-  unsigned int levels = base_lut.size();
-
-  double factor = ((double)levels) / pow( (max - min), 2 );
-
-  /* Generating LUT map using the existing base lut levels */
-
-  TePDITypes::TePDILutType out_lut;
-
-  TePDITypes::TePDILutType::iterator base_lut_it = base_lut.begin();
-  TePDITypes::TePDILutType::iterator base_lut_it_end = base_lut.end();
-
-  unsigned int progress = 0;
-  double mapped_level = 0;
-  StartProgInt( "Building Square Lut...", base_lut.size() ); 
-    
-  while( base_lut_it != base_lut_it_end ) {
-    UpdateProgInt( progress );
-    
-    if( base_lut_it->first <= min ) {
-      out_lut[ base_lut_it->first ] = output_channel_min_level;
-    } else if( base_lut_it->first >= max ) {
-      out_lut[ base_lut_it->first ] = output_channel_max_level;
-    } else {
-      mapped_level = factor * pow( base_lut_it->first - min, 2 );
-      
-      if( mapped_level < output_channel_min_level ) {
-        mapped_level = output_channel_min_level;
-      } else if( mapped_level > output_channel_max_level ) {
-        mapped_level = output_channel_max_level;
-      }        
-      
-      out_lut[ base_lut_it->first ] = mapped_level;
-    }
-
-    ++progress;
-    ++base_lut_it;
-  }
-
-  return out_lut;
-}
-
-
-TePDITypes::TePDILutType TePDIContrast::GetLogLut(
-  TePDITypes::TePDILutType& base_lut,
-  double min, double max,
-  double output_channel_min_level, double output_channel_max_level )
-{
-  TEAGN_CHECK_NOTEQUAL( base_lut.size(), 0, "Invalid base_lut size" );
-  TEAGN_TRUE_OR_THROW( max > ( min+1 ), "Invalid min and max values" );
-
-  unsigned int levels = base_lut.size();
-
-  double factor = ((double)levels) / log10( max - min + 1 );
-
-  /* Generating LUT map using the existing base_lut levels */
-
-  TePDITypes::TePDILutType out_lut;
-
-  TePDITypes::TePDILutType::iterator base_lut_it = base_lut.begin();
-  TePDITypes::TePDILutType::iterator base_lut_it_end = base_lut.end();
-
-  unsigned int progress = 0;
-  double mapped_level = 0;
-  StartProgInt( "Building Log Lut...", base_lut.size() ); 
-    
-  while( base_lut_it != base_lut_it_end ) {
-    UpdateProgInt( progress );
-    
-    if( base_lut_it->first <= min ) {
-      out_lut[ base_lut_it->first ] = output_channel_min_level;
-    } else if( base_lut_it->first >= max ) {
-      out_lut[ base_lut_it->first ] = output_channel_max_level;
-    } else {
-      mapped_level = factor * log10( base_lut_it->first - min + 1 );
-      
-      if( mapped_level < output_channel_min_level ) {
-        mapped_level = output_channel_min_level;
-      } else if( mapped_level > output_channel_max_level ) {
-        mapped_level = output_channel_max_level;
-      }        
-    
-      out_lut[ base_lut_it->first ] = mapped_level;
-    }
-
-    ++progress;
-    ++base_lut_it;
-  }
-
-  return out_lut;
-}
-
-
-TePDITypes::TePDILutType TePDIContrast::GetNegativeLut(
-  TePDITypes::TePDILutType& base_lut,
-  double min, double max,
-  double output_channel_min_level, double output_channel_max_level )
-{
-  TEAGN_CHECK_NOTEQUAL( base_lut.size(), 0, "Invalid base_lut size" );
-  TEAGN_TRUE_OR_THROW( max > min, "Invalid max and min values" );
-
-  /* Calculating parameters */
-
-  unsigned int levels = base_lut.size();
-
-  double a = -1. * ((double)levels) / ( max - min );
-  double b = ( ((double)levels) * max ) / ( max - min );
-
-  /* Generating LUT map using the existing base_lut levels */
-
-  TePDITypes::TePDILutType out_lut;
-
-  TePDITypes::TePDILutType::iterator base_lut_it = base_lut.begin();
-  TePDITypes::TePDILutType::iterator base_lut_it_end = base_lut.end();
-
-  unsigned int progress = 0;
-  double mapped_level = 0;
-  StartProgInt( "Building Negative Lut...", base_lut.size() ); 
-    
-  while( base_lut_it != base_lut_it_end ) {
-    UpdateProgInt( progress );
-    
-    if( base_lut_it->first <= min ) {
-      out_lut[ base_lut_it->first ] = output_channel_max_level;
-    } else if( base_lut_it->first >= max ) {
-      out_lut[ base_lut_it->first ] = output_channel_min_level;
-    } else {
-      mapped_level = ( a * base_lut_it->first ) + b;
-      
-      if( mapped_level < output_channel_min_level ) {
-        mapped_level = output_channel_min_level;
-      } else if( mapped_level > output_channel_max_level ) {
-        mapped_level = output_channel_max_level;
-      }
-      
-      out_lut[ base_lut_it->first ] = mapped_level;
-    }
-
-    ++progress;
-    ++base_lut_it;
-  }
-
-  return out_lut;
-}
-
-TePDITypes::TePDILutType TePDIContrast::GetHistEqualizerLut(
-  TePDIHistogram::pointer hist,
-  double output_channel_min_level, double output_channel_max_level )
-{
-  TEAGN_TRUE_OR_THROW( hist->size() > 1, "Invalid histogram size" );
-  TEAGN_TRUE_OR_THROW( ( output_channel_max_level > output_channel_min_level ),
-    "Invalid paramters output_channel_max_level <= output_channel_min_level" );
-  TEAGN_TRUE_OR_THROW( ( hist->GetMaxCount() > 0 ),
-    "Invalid histogram" );
-    
-  /* Generating the accumulative matrix */
-
-  TePDIHistogram::iterator in_hist_it = hist->begin();
-  TePDIHistogram::iterator in_hist_it_end = hist->end();
-
-  TePDIMatrix< double > accumulative_matrix;
-  TEAGN_TRUE_OR_THROW( accumulative_matrix.Reset( hist->size(), 2 ),
-    "Matrix reset error" );
-    
-  accumulative_matrix( 0, 0 ) = in_hist_it->first;
-  accumulative_matrix( 0, 1 ) = (double)in_hist_it->second;
-  ++in_hist_it;
-  
-  unsigned int accumulative_matrix_line = 1;
-  double hist_population = (double)in_hist_it->second;
-  
-  StartProgInt( "Building Histogram Equalizer Lut...", 2 * hist->size() );
-  
-  while( in_hist_it != in_hist_it_end ) { 
-    accumulative_matrix( accumulative_matrix_line, 0 ) = in_hist_it->first;
-    accumulative_matrix( accumulative_matrix_line, 1 ) =
-      accumulative_matrix( accumulative_matrix_line - 1, 1 ) +
-      (double)in_hist_it->second;
-      
-     hist_population += (double)in_hist_it->second;
-  
-    ++accumulative_matrix_line;
-    ++in_hist_it;
-    
-    IncProgInt();
-  }
-  
-  /* Creating the look-up table */
-
-  double total_levels_nmb = (double)hist->size();
-  double mapped_level = 0;
-  TePDITypes::TePDILutType out_lut;
-  
-  for( accumulative_matrix_line = 0 ; 
-    accumulative_matrix_line < accumulative_matrix.GetLines() ;
-    ++accumulative_matrix_line ) {
-    
-    mapped_level = ( accumulative_matrix( accumulative_matrix_line, 1 ) *
-      total_levels_nmb ) / hist_population;
-      
-    if( mapped_level < output_channel_min_level ) {
-      mapped_level = output_channel_min_level;
-    } else if( mapped_level > output_channel_max_level ) {
-      mapped_level = output_channel_max_level;
-    }
-    
-    out_lut[ accumulative_matrix( accumulative_matrix_line, 0 ) ] = 
-      mapped_level;
-      
-    IncProgInt();  
-  }
-  
-  StopProgInt();
-  
-  return out_lut;
-}
-
-
-void TePDIContrast::GetSimpleSlicerLut(
-  TePDIHistogram::pointer hist,
-  TePDIRgbPalette::pointer in_palette,
-  double min,
-  double max,
-  TePDITypes::TePDILutType& out_lut )
-{
-  TEAGN_TRUE_OR_THROW( ( hist->size() > 0 ), "Invalid histogram size" );
-  TEAGN_TRUE_OR_THROW( max > min, "Invalid max and min values" );
-  TEAGN_TRUE_OR_THROW( in_palette->size() > 0,
-    "Invalid input palette size" );
-
-  out_lut.clear();
-
-  /* Extracting palette levels */
-
-  std::vector< double > palette_levels;
-  TePDIRgbPalette::iterator pal_it = in_palette->begin();
-  TePDIRgbPalette::iterator pal_it_end = in_palette->end();
-  
-  unsigned int progress = 0;
-  StartProgInt( "Building Simple Slicer Lut...", hist->size() +
-    in_palette->size() );    
-
-  while( pal_it != pal_it_end ) {
-    UpdateProgInt( progress );
-    
-    palette_levels.push_back( pal_it->first );
-
-    ++progress;
-    ++pal_it;
-  }
-
-  /* min and max adjusting to the supplied histogram range */
-
-  double in_hist_max = hist->GetMaxLevel();
-  double in_hist_min = hist->GetMinLevel();
-
-  min = ( min < in_hist_min ) ? in_hist_min : min;
-  max = ( max > in_hist_max ) ? in_hist_max : max;
-
-  /* Output LUT generation */
-
-  double slice_size = ( max - min ) / ((double)in_palette->size());
-
-  double first_pal_level = palette_levels[ 0 ];
-  double last_pal_level = palette_levels[ palette_levels.size() - 1 ];
-
-  TePDIHistogram::iterator in_hist_it = hist->begin();
-  TePDIHistogram::iterator in_hist_it_end = hist->end();
-
-  double current_level;
-  unsigned int current_slice;
-  
-  while( in_hist_it != in_hist_it_end ) {
-    UpdateProgInt( progress );
-    
-    current_level = in_hist_it->first;
-
-    if( current_level < min ) {
-      out_lut[ current_level ] = first_pal_level;
-    } else if ( current_level > max ) {
-      out_lut[ current_level ] = last_pal_level;
-    } else {
-      current_slice =
-        (unsigned int) floor( ( current_level - min ) / slice_size );
-        
-      TEAGN_DEBUG_CONDITION( ( current_slice < palette_levels.size() ),
-        "Invalid current_slice=" + Te2String( current_slice ) +
-        " for pallete_levels size=" + Te2String( palette_levels.size() ) );
-
-      out_lut[ current_level ] = palette_levels[ current_slice ];
-    }
-
-    ++progress;
-    ++in_hist_it;
-  }
-}
-
-
-void TePDIContrast::GetStatLut( TePDIHistogram::pointer hist,
-  double target_mean, double target_variance, double output_channel_min_level, 
-  double output_channel_max_level, TePDITypes::TePDILutType& out_lut )
-{
-  TEAGN_CHECK_NOTEQUAL( hist->size(), 0, "Invalid histogram size" );
-
-  out_lut.clear();
-  
-  TePDIHistogram::iterator in_hist_it;
-  TePDIHistogram::iterator in_hist_it_end = hist->end(); 
-  
-  /* Calculating the total pixels number */
-  
-  unsigned int total_pixels = 0;
-  
-  in_hist_it = hist->begin();
-  
-  while( in_hist_it != in_hist_it_end ) {
-    total_pixels += in_hist_it->second;
-        
-    ++in_hist_it;
-  }
-  
-  /* Calculating the current mean */ 
-  
-  double current_mean = 0;
-  
-  if( params_.CheckParameter< double >( "input_mean" ) ) {
-    params_.GetParameter( "input_mean", current_mean );
-  } else {
-    in_hist_it = hist->begin();
-    
-    while( in_hist_it != in_hist_it_end ) {
-      current_mean += ( in_hist_it->first * ((double)in_hist_it->second) );
-        
-      ++in_hist_it;
-    }
-  
-    current_mean = current_mean / ((double)total_pixels);
-  }
-    
-  /* Calculating the current variance */ 
-        
-  double current_variance = 0;
-  
-  if( params_.CheckParameter< double >( "input_variance" ) ) {
-    params_.GetParameter( "input_variance", current_variance );
-  } else {
-    double temp_double = 0;
-    
-    in_hist_it = hist->begin();
-    
-    while( in_hist_it != in_hist_it_end ) {
-      temp_double = ( in_hist_it->first - current_mean );
-      temp_double = temp_double * temp_double * ((double)in_hist_it->second);
-      
-      current_variance += temp_double;
-        
-      ++in_hist_it;
-    }
-    
-    current_variance = current_variance / ( (double) total_pixels );
-  }
-  
-  /* Creating levels map */
-  
-  double gain = sqrt( target_variance / current_variance );
-  double offset = target_mean - ( gain * current_mean );
-  
-  in_hist_it = hist->begin();
-  
-  double current_level = 0;
-  double mapped_level = 0;
-  
-  while( in_hist_it != in_hist_it_end ) {
-    current_level = in_hist_it->first;
-    mapped_level = ( current_level * gain ) + offset;
-
-    if( mapped_level < output_channel_min_level ) {
-      out_lut[ current_level ] = output_channel_min_level;
-    } else if ( mapped_level > output_channel_max_level ) {
-      out_lut[ current_level ] = output_channel_max_level;
-    } else {
-      out_lut[ current_level ] = mapped_level;
-    }    
-  
-    ++in_hist_it;
-  }
-}
-
-
-bool TePDIContrast::RemapLevels(
-  TePDITypes::TePDIRasterPtrType& inRaster,
-  TePDITypes::TePDILutType& lut,
-  int in_channel,
-  int out_channel,
-  TePDITypes::TePDIRasterPtrType& outRaster,
-  bool use_dummy, double dummy_value, bool fixed_step_lut )
-{
-  TEAGN_TRUE_OR_RETURN( inRaster.isActive(),
-    "inRaster inactive" );
-  TEAGN_TRUE_OR_RETURN( outRaster.isActive(),
-    "outRaster inactive" );
-  TEAGN_TRUE_OR_RETURN( 
-    inRaster->params().status_ != TeRasterParams::TeNotReady,
-    "inRaster not ready" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( outRaster->params().status_ != TeRasterParams::TeNotReady ),
-    "outRaster not ready" );
-    
-  TEAGN_TRUE_OR_RETURN( ( inRaster->params().nlines_ ==
-    outRaster->params().nlines_ ),
-    "Lines number mismatch between input and output image" );
-  TEAGN_TRUE_OR_RETURN( ( inRaster->params().ncols_ ==
-    outRaster->params().ncols_ ),
-    "Columns number mismatch between input and output image" );
-  TEAGN_TRUE_OR_RETURN( in_channel < inRaster->nBands(), 
-    "Invalid input band" );
-  TEAGN_TRUE_OR_RETURN( out_channel < outRaster->nBands(), 
-    "Invalid output band" );
-  TEAGN_TRUE_OR_RETURN( ( lut.size() > 1 ), "Invalid lut" );
-
-  const int raster_lines = inRaster->params().nlines_;
-  const int raster_columns = inRaster->params().ncols_;
-  
-  /* Guessing dummy use */
-  
-  bool inRaster_uses_dummy = inRaster->params().useDummy_;
-  
-  bool outRaster_uses_dummy = outRaster->params().useDummy_;
-  double outRaster_dummy = 0;
-  if( outRaster_uses_dummy ) {
-    outRaster_dummy = outRaster->params().dummy_[ out_channel ];
-  } else {
-    outRaster_dummy = dummy_value;
-  }
-  
-  /* Loading lut */
-  
-  TePDIMatrix< double > lutmatrix;
-  TEAGN_TRUE_OR_RETURN( lutmatrix.Reset( 2, lut.size(), 
-    TePDIMatrix< double >::AutoMemPol ),
-    "Unable to create lut matrix" );
-  {
-    TePDITypes::TePDILutType::iterator it = lut.begin();;
-  
-    for( unsigned int lutcol = 0 ; lutcol < lutmatrix.GetColumns() ; 
-      ++lutcol ) {
-      
-      lutmatrix( 0, lutcol ) = it->first;
-      lutmatrix( 1, lutcol ) = it->second;
-      
-      ++it;
-    }
-  }
-  
-  /* Remapping levels */
-  
-  StartProgInt( "Remapping Levels...", raster_lines );
-
-  if( fixed_step_lut ) {
-    double current_level = 0;
-    const double lut_min_level = lutmatrix( 0, 0 );
-    const double lut_max_level = lutmatrix( 0, lutmatrix.GetColumns() - 1 );
-    unsigned int best_lut_index = 0;
-    const unsigned int lutmatrix_last_index = ( lutmatrix.GetColumns() - 1 );
-    
-    double lut_step = 0;
-    if( lutmatrix.GetColumns() > 1 ) {
-      lut_step = lutmatrix( 0, 1 ) - lutmatrix( 0, 0 );
-    }
-  
-    for( int line = 0 ; line < raster_lines ; ++line ) {
-      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
-    
-      for( int column = 0 ; column < raster_columns ; ++column ) {
-        if( inRaster->getElement( column, line, current_level,
-            in_channel ) ) {
-            
-          if( use_dummy && ( current_level == dummy_value ) ) {
-            TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
-              outRaster_dummy, out_channel ),
-              "Level remmaping error at " + Te2String( line ) +
-              "," + Te2String( column ) );           
-          } else {
-            /* Finding the mapping level from lut */
-            
-            if( current_level < lut_min_level ) {
-              best_lut_index = 0;
-            } else if( current_level > lut_max_level ) {
-              best_lut_index = lutmatrix_last_index;
-            } else {
-              best_lut_index = ( unsigned int ) ( TeRound( ( current_level - 
-                lut_min_level ) / lut_step ) );             
-            }
-            
-            /* Pixel Output level remapping */
-            
-            TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
-              lutmatrix( 1, best_lut_index ), out_channel ),
-              "Level remmaping error at " + Te2String( line ) +
-              "," + Te2String( column ) );
-          }
-        } else {
-          TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
-            
-          TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
-            outRaster_dummy, out_channel ),
-            "Level remmaping error at " + Te2String( line ) +
-            "," + Te2String( column ) );          
-        }
-      }
-    }
-  } else {
-    double current_level;
-    unsigned int left_element_index;
-    unsigned int middle_element_index;
-    unsigned int right_element_index;
-    const unsigned int last_valid_index = lutmatrix.GetColumns() - 1;
-    const unsigned int lut_size = lutmatrix.GetColumns();
-    double middle_element_level;
-  
-    for( int line = 0 ; line < raster_lines ; ++line ) {
-      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
-    
-      for( int column = 0 ; column < raster_columns ; ++column ) {
-        if( inRaster->getElement( column, line, current_level,
-            in_channel ) ) {
-            
-          if( use_dummy && ( current_level == dummy_value ) ) {
-            TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
-              outRaster_dummy, out_channel ),
-              "Level remmaping error at " + Te2String( line ) +
-              "," + Te2String( column ) );           
-          } else {            
-            /* Finding the two best mapping levels from lut */
-            
-            if( lut_size == 1 ) {
-              right_element_index = left_element_index = 1;
-            } else {
-              left_element_index = 0;
-              right_element_index = last_valid_index;
-            
-              do {
-                middle_element_index =  left_element_index + 
-                  ( ( right_element_index - left_element_index ) / 2 );
-                middle_element_level = lutmatrix( 0, middle_element_index );
-                          
-                if( current_level == middle_element_level ) {
-                  left_element_index = right_element_index = 
-                    middle_element_index;
-                  break;
-                } else if( current_level < middle_element_level ) {
-                  right_element_index = middle_element_index;
-                } else {
-                  left_element_index = middle_element_index;
-                }          
-              } while( ( right_element_index - left_element_index ) > 1 );
-            }
-            
-            /* Pixel Output level aproximation and mapping */
-            
-            if( ( current_level - lutmatrix( 0, left_element_index ) ) <
-                ( lutmatrix( 0, right_element_index ) - current_level ) ) {
-    
-              TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
-                lutmatrix( 1, left_element_index ), out_channel ),
-                "Level remmaping error at " + Te2String( line ) +
-                "," + Te2String( column ) );
-            } else {
-              TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
-                lutmatrix( 1, right_element_index ), out_channel ),
-                "Level remmaping error at " + Te2String( line ) +
-                "," + Te2String( column ) );
-            }
-          }
-        } else {
-          TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
-          
-          TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
-            outRaster_dummy, out_channel ),
-            "Level remmaping error at " + Te2String( line ) +
-            "," + Te2String( column ) );          
-        }
-      }
-    }
-  }
-  
-  StopProgInt();
-  
-  return true;
-}
-
-
-bool TePDIContrast::FullRangeLutRemapLevels( 
-  TePDITypes::TePDIRasterPtrType& inRaster, TePDITypes::TePDILutType& lut,
-  int in_channel, int out_channel, TePDITypes::TePDIRasterPtrType& outRaster, 
-  bool use_dummy, double dummy_value )
-{
-  TEAGN_TRUE_OR_RETURN( inRaster.isActive(),
-    "inRaster inactive" );
-  TEAGN_TRUE_OR_RETURN( outRaster.isActive(),
-    "outRaster inactive" );
-  TEAGN_TRUE_OR_RETURN( 
-    inRaster->params().status_ != TeRasterParams::TeNotReady,
-    "inRaster not ready" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( outRaster->params().status_ != TeRasterParams::TeNotReady ),
-    "outRaster not ready" );
-    
-  TEAGN_TRUE_OR_RETURN( ( inRaster->params().nlines_ ==
-    outRaster->params().nlines_ ),
-    "Lines number mismatch between input and output image" );
-  TEAGN_TRUE_OR_RETURN( ( inRaster->params().ncols_ ==
-    outRaster->params().ncols_ ),
-    "Columns number mismatch between input and output image" );
-  TEAGN_TRUE_OR_RETURN( in_channel < inRaster->nBands(), 
-    "Invalid input band" );
-  TEAGN_TRUE_OR_RETURN( out_channel < outRaster->nBands(), 
-    "Invalid output band" );
-  TEAGN_TRUE_OR_RETURN( ( lut.size() > 1 ), "Invalid lut" );
-
-  const int raster_lines = inRaster->params().nlines_;
-  const int raster_columns = inRaster->params().ncols_;
-  
-  /* Guessing dummy use */
-  
-  bool inRaster_uses_dummy = inRaster->params().useDummy_;
-  
-  bool outRaster_uses_dummy = outRaster->params().useDummy_;
-  double outRaster_dummy = 0;
-  if( outRaster_uses_dummy ) {
-    outRaster_dummy = outRaster->params().dummy_[ out_channel ];
-  } else {
-    outRaster_dummy = dummy_value;
-  }
-  
-  /* Loading lut */
-  
-  TePDIMatrix< double > lutmatrix;
-  TEAGN_TRUE_OR_RETURN( lutmatrix.Reset( 2, lut.size(), 
-    TePDIMatrix< double >::AutoMemPol ),
-    "Unable to create lut matrix" );
-  {
-    TePDITypes::TePDILutType::iterator it = lut.begin();;
-  
-    for( unsigned int lutcol = 0 ; lutcol < lutmatrix.GetColumns() ; 
-      ++lutcol ) {
-      
-      lutmatrix( 0, lutcol ) = it->first;
-      lutmatrix( 1, lutcol ) = it->second;
-      
-      ++it;
-    }
-  }
-  
-  /* Remapping levels */
-  
-  TeRaster& inRaster_ref = *inRaster;
-  TeRaster& outRaster_ref = *outRaster;
-  int line = 0;
-  int column = 0 ;
-  double current_level = 0;
-  
-  StartProgInt( "Remapping Levels...", raster_lines );
-  
-  for( line = 0 ; line < raster_lines ; ++line ) {
-    TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
-    
-    for( column = 0 ; column < raster_columns ; ++column ) {
-      if( inRaster_ref.getElement( column, line, current_level,
-        in_channel ) ) { 
-        
-        if( use_dummy && ( current_level == dummy_value ) ) {
-          TEAGN_TRUE_OR_RETURN( outRaster_ref.setElement( column, line,
-            outRaster_dummy, out_channel ),
-            "Level remmaping error at " + Te2String( line ) +
-            "," + Te2String( column ) );       
-        } else {
-          TEAGN_DEBUG_CONDITION( ( ( (unsigned int)current_level ) <
-            lutmatrix.GetColumns() ), "Level out of lut range" );
-          TEAGN_DEBUG_CONDITION( 
-            ( lutmatrix( 0, ( (unsigned int)current_level ) ) ==
-            ( (unsigned int)current_level ) ), 
-            "Requested value not found inside lut" );
-          
-          TEAGN_TRUE_OR_RETURN( outRaster_ref.setElement( column, line,
-            lutmatrix( 1, ( (unsigned int)current_level ) ), out_channel ),
-            "Level remmaping error at " + Te2String( line ) +
-            "," + Te2String( column ) );          
-        }
-      } else {
-        TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
-            
-        TEAGN_TRUE_OR_RETURN( outRaster_ref.setElement( column, line,
-          outRaster_dummy, out_channel ),
-          "Level remmaping error at " + Te2String( line ) +
-          "," + Te2String( column ) );       
-      }
-    }
-  }
-  
-  StopProgInt();
-  
-  return true;  
-}
-
-
-bool TePDIContrast::getHistogram( TePDIHistogram::pointer& hist )
-{
-  if( ! histo_ptr_.isActive() ) {
-    if( params_.CheckParameter< TePDIHistogram::pointer >( 
-      "input_histogram" ) ) {
-    
-      params_.GetParameter( "input_histogram", histo_ptr_ );
-    } else {
-      /* No histogram supplied, we need to generate it */
-  
-      TePDITypes::TePDIRasterPtrType inRaster;
-      TEAGN_TRUE_OR_RETURN( params_.GetParameter( "input_image", inRaster ),
-        "Missing parameter : input_image" );
-      
-      int input_band = 0;
-      TEAGN_TRUE_OR_RETURN( params_.GetParameter( "input_band", input_band ),
-        "Missing parameter : input_band" );
-      
-      int histo_levels = 0;
-      if( ( inRaster->params().dataType_[ input_band ] == TeFLOAT ) ||
-        ( inRaster->params().dataType_[ input_band ] == TeDOUBLE ) ) {
-        
-        histo_levels = 256;
-      }
-      if( params_.CheckParameter< int >( "histo_levels" ) ) {
-        params_.GetParameter( "histo_levels", histo_levels );
-      }
-      
-      histo_ptr_.reset( new TePDIHistogram );
-      TEAGN_TRUE_OR_RETURN( 
-        histo_ptr_->reset( inRaster, input_band, 
-        (unsigned int)histo_levels, 
-        false, TeBoxPixelIn ), "Histogram generation error" );
-    }
-  }
-  
-  hist = histo_ptr_;
-  
-  return true;
-}
-
-bool TePDIContrast::getBaseLut( TePDITypes::TePDILutType& lut,
-  bool& hist_based_lut )
-{
-  lut.clear();
-  
-  if( params_.CheckParameter< TePDIHistogram::pointer >( 
-    "input_histogram" ) ) {
-  
-    TePDIHistogram::pointer hist;
-    TEAGN_TRUE_OR_RETURN( getHistogram( hist ), "Unable to get histogram" );    
-    
-    TePDIHistogram::iterator it = hist->begin();
-    TePDIHistogram::iterator it_end = hist->end();
-      
-    while( it != it_end ) {
-      lut[ it->first ] = it->first;
-    
-      ++it;
-    }
-      
-    hist_based_lut = true;    
-  } else {
-    TePDITypes::TePDIRasterPtrType inRaster;
-    params_.GetParameter( "input_image", inRaster );
-    
-    int input_band = 0;
-    params_.GetParameter( "input_band", input_band );
-      
-    switch( inRaster->params().dataType_[ input_band ] ) {
-      case TeBIT :
-      case TeUNSIGNEDCHAR :
-      case TeUNSIGNEDSHORT :
-      {
-        unsigned int lut_size = (unsigned int)( 
-          pow( 2.0, (double)( inRaster->params().elementSize( input_band ) * 
-          8 ) ) );
-      
-        for( unsigned int index = 0 ; index < lut_size ; ++index ) {
-          lut[ index ] = index;
-        }
-            
-        hist_based_lut = false;
-        
-        break;
-      }
-      case TeCHAR :
-      case TeSHORT :      
-      case TeINTEGER :
-      case TeLONG :
-      case TeUNSIGNEDLONG :
-      case TeFLOAT :
-      case TeDOUBLE :
-      {
-        TePDIHistogram::pointer hist;
-        TEAGN_TRUE_OR_RETURN( getHistogram( hist ), "Unable to get histogram" );
-        
-        TePDIHistogram::iterator it = hist->begin();
-        TePDIHistogram::iterator it_end = hist->end();
-        
-        while( it != it_end ) {
-          lut[ it->first ] = it->first;
-      
-          ++it;
-        }
-        
-        hist_based_lut = true;
-        
-        break;
-      }
-      default :
-      {
-        TEAGN_LOG_AND_THROW( "Invalid raster pixel type" );
-        break;
-      }
-    }
-  }
-  
-  return true;
-}
-
+#include "TePDIContrast.hpp"
+
+#include <TeAgnostic.h>
+#include <TePDITypes.hpp>
+#include <TePDIUtils.hpp>
+#include <TePDIHistogram.hpp>
+#include <TePDIMatrix.hpp>
+
+#include <math.h>
+#include <float.h>
+
+
+TePDIContrast::TePDIContrast()
+{
+}
+
+
+TePDIContrast::~TePDIContrast()
+{
+}
+
+
+bool TePDIContrast::RunImplementation()
+{
+  /* Getting general parameters */
+
+  TePDIContrastType contrast_type;
+  params_.GetParameter( "contrast_type", contrast_type );
+
+  TePDITypes::TePDIRasterPtrType inRaster;
+  int input_band = 0;
+  if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "input_image" ) ) {
+    
+    params_.GetParameter( "input_image", inRaster );
+    params_.GetParameter( "input_band", input_band );
+  }
+
+  int output_band = 0;
+  TePDITypes::TePDIRasterPtrType outRaster;
+  if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "output_image" ) ) {
+    
+    params_.GetParameter( "output_image", outRaster );
+    params_.GetParameter( "output_band", output_band );  
+  }  
+  
+  double min_level = 0;
+  double max_level = 0;
+  if( params_.CheckParameter< double >( "min_level" ) ) {
+    
+    params_.GetParameter( "min_level", min_level );
+  }
+  if( params_.CheckParameter< double >( "max_level" ) ) {
+    
+    params_.GetParameter( "max_level", max_level );
+  }
+  
+  TePDIRgbPalette::pointer palette;
+  if( params_.CheckParameter< TePDIRgbPalette::pointer >( "rgb_palette" ) ) {
+  
+    params_.GetParameter( "rgb_palette", palette );
+  }
+  
+  /* output dumyy value definition */
+ 
+  bool output_raster_uses_dummy = false;
+  double output_raster_dummy = 0;
+  
+  if( outRaster.isActive() ) {
+    output_raster_uses_dummy = outRaster->params().useDummy_;
+    
+    if( output_raster_uses_dummy ) {
+      output_raster_dummy = outRaster->params().dummy_[ 0 ];
+    }    
+  }
+  
+  if( params_.CheckParameter< double >( "dummy_value" ) ) {
+    
+    params_.GetParameter( "dummy_value", output_raster_dummy );
+    
+    output_raster_uses_dummy = true;
+  }  
+  
+  /* Reseting output raster */
+  
+  if( outRaster.isActive() ) {
+    switch( contrast_type ) {
+      case TePDIContrastSimpleSlicer :
+      {
+        bool output_reset_not_needed = true;
+        
+        if( ! params_.CheckParameter< int >( "restrict_out_reset" ) ) {
+          output_reset_not_needed = false;
+        }
+        
+        if( output_reset_not_needed &&
+          ( inRaster->params().nlines_ != outRaster->params().nlines_ ) ) {
+           
+          output_reset_not_needed = false; 
+        }
+        
+        if( output_reset_not_needed &&
+          ( inRaster->params().ncols_ != outRaster->params().ncols_ ) ) {
+           
+          output_reset_not_needed = false; 
+        }
+        
+        if( output_reset_not_needed &&
+          ( output_band >= outRaster->params().nBands() ) ) {
+           
+          output_reset_not_needed = false; 
+        }
+        
+        if( output_reset_not_needed )
+        { 
+          if( inRaster->projection() )
+          {
+            if( outRaster->projection() )
+            {
+              if( !( (*inRaster->projection()) == (*outRaster->projection()) ) )
+              {
+                output_reset_not_needed = false;
+              }
+            }
+            else
+            {
+              output_reset_not_needed = false;
+            }
+          }
+          else
+          {
+            if( outRaster->projection() )
+            {
+              output_reset_not_needed = false;
+            }
+          }
+        }
+        
+        if( output_reset_not_needed &&
+          ( inRaster->params().box() != outRaster->params().box() ) ) 
+        {
+           
+          output_reset_not_needed = false; 
+        }
+        
+        if( output_reset_not_needed &&
+          ( inRaster->params().photometric_[ 0 ] != TeRasterParams::TePallete 
+          ) ) 
+        {
+           
+          output_reset_not_needed = false; 
+        }        
+        
+        if( output_reset_not_needed &&
+            ( ( outRaster->params().useDummy_ == output_raster_uses_dummy ) ?
+              false :
+              ( outRaster->params().useDummy_ ? 
+                ( outRaster->params().dummy_[ 0 ] != output_raster_dummy ) :
+                false
+              ) 
+            )
+          ) {
+           
+          output_reset_not_needed = false; 
+        }   
+              
+        if( ! output_reset_not_needed ) 
+        {
+          TeRasterParams new_outRaster_params = outRaster->params();
+          new_outRaster_params.nBands( output_band + 1 );
+          if( inRaster->projection() == 0 ) {
+            new_outRaster_params.projection( 0 );
+          } else {
+            new_outRaster_params.projection( inRaster->projection() );
+          }
+          new_outRaster_params.boxResolution( inRaster->params().box().x1(), 
+            inRaster->params().box().y1(), inRaster->params().box().x2(), 
+            inRaster->params().box().y2(), 
+            inRaster->params().resx_, inRaster->params().resy_ );
+            
+          new_outRaster_params.setPhotometric( TeRasterParams::TePallete, -1 );
+          
+          new_outRaster_params.lutr_.clear();
+          new_outRaster_params.lutg_.clear();
+          new_outRaster_params.lutb_.clear();
+
+          TePDIRgbPalette::iterator pal_it = palette->begin();
+          TePDIRgbPalette::iterator pal_it_end = palette->end();
+          for( unsigned int lut_index = 0 ; lut_index < palette->size() ;
+              ++lut_index ) {
+    
+            new_outRaster_params.lutr_.push_back( 
+              (unsigned short)pal_it->second.red_ );
+            new_outRaster_params.lutg_.push_back( 
+              (unsigned short)pal_it->second.green_ );
+            new_outRaster_params.lutb_.push_back( 
+              (unsigned short)pal_it->second.blue_ );
+
+            ++pal_it;
+          }
+          
+          if( output_raster_uses_dummy ) {
+            new_outRaster_params.setDummy( output_raster_dummy, -1 );
+          } else {
+            new_outRaster_params.useDummy_ = false;
+          }
+            
+          TEAGN_TRUE_OR_RETURN( outRaster->init( new_outRaster_params ),            
+            "Output raster reset error" );           
+        }
+      
+        break;
+      }  
+      default :
+      {
+        /* Reseting output raster */
+        
+        bool output_reset_not_needed = true;
+        
+        if( ! params_.CheckParameter< int >( "restrict_out_reset" ) ) {
+          output_reset_not_needed = false;
+        }
+        
+        if( output_reset_not_needed &&
+          ( inRaster->params().nlines_ != outRaster->params().nlines_ ) ) {
+           
+          output_reset_not_needed = false; 
+        }
+        
+        if( output_reset_not_needed &&
+          ( inRaster->params().ncols_ != outRaster->params().ncols_ ) ) {
+           
+          output_reset_not_needed = false; 
+        }
+        
+        if( output_reset_not_needed &&
+          ( output_band >= outRaster->params().nBands() ) ) {
+           
+          output_reset_not_needed = false; 
+        }
+        
+        if( output_reset_not_needed &&
+          ( 
+            ( inRaster->projection() == outRaster->projection() ) ? 
+            false : 
+            ( 
+              ( inRaster->projection() == 0 ) ?
+              true :
+              (
+                ( outRaster->projection() == 0 ) ? 
+                true :
+                ( inRaster->projection()->name() == 
+                  outRaster->projection()->name() ) ? false : true
+              )
+            ) 
+          )        
+         ) {
+           
+          output_reset_not_needed = false; 
+        }
+        
+        if( output_reset_not_needed &&
+          ( inRaster->params().box() != outRaster->params().box() ) ) {
+           
+          output_reset_not_needed = false; 
+        }
+        
+        if( output_reset_not_needed &&
+            ( ( outRaster->params().useDummy_ == output_raster_uses_dummy ) ?
+              false :
+              ( outRaster->params().useDummy_ ? 
+                ( outRaster->params().dummy_[ 0 ] != output_raster_dummy ) :
+                false
+              ) 
+            )
+          ) {
+           
+          output_reset_not_needed = false; 
+        }          
+        
+        if( ! output_reset_not_needed ) {
+        
+          TeRasterParams new_outRaster_params = outRaster->params();
+          new_outRaster_params.nBands( output_band + 1 );
+          if( inRaster->projection() == 0 ) {
+            new_outRaster_params.projection( 0 );
+          } else {
+            TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+              inRaster->projection()->params() ) );          
+            new_outRaster_params.projection( proj.nakedPointer() );
+          }
+          new_outRaster_params.boxResolution( inRaster->params().box().x1(), 
+            inRaster->params().box().y1(), inRaster->params().box().x2(), 
+            inRaster->params().box().y2(), 
+            inRaster->params().resx_, inRaster->params().resy_ );            
+            
+          if( output_raster_uses_dummy ) {
+            new_outRaster_params.setDummy( output_raster_dummy, -1 );
+          } else {
+            new_outRaster_params.useDummy_ = false;
+          }            
+          
+          new_outRaster_params.setPhotometric( TeRasterParams::TeMultiBand );
+            
+          TEAGN_TRUE_OR_RETURN( outRaster->init( new_outRaster_params ),
+            "Output raster reset error" );             
+        }
+        
+        break;
+      }
+    }
+  }
+  
+  /* Getting output channel range */
+  
+  double output_channel_min_level = 0;
+  double output_channel_max_level = 0;
+  
+  if( params_.CheckParameter< double >( "output_channel_min_level" ) ) {
+    params_.GetParameter( "output_channel_min_level",
+      output_channel_min_level );
+    params_.GetParameter( "output_channel_max_level",
+      output_channel_max_level );
+  } else {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+      outRaster, output_band, output_channel_min_level,
+      output_channel_max_level ), "Unable to get raster channel level bounds" );  
+  }
+      
+  /* Building a lut suitable for each algorithm */
+    
+  TePDITypes::TePDILutType lut;
+  bool hist_based_lut = false;
+  bool fixed_step_lut = false;
+  
+  switch( contrast_type ) {
+    case TePDIContrastMinMax :
+    {
+      TePDITypes::TePDILutType baselut;
+      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut,
+        output_raster_uses_dummy, output_raster_dummy ),
+        "Error getting base lut" );
+      
+      lut = GetMinMaxLut( output_channel_min_level, output_channel_max_level,
+        baselut );
+  
+      break;
+    }
+    case TePDIContrastLinear :
+    {
+      TePDITypes::TePDILutType baselut;
+      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut,
+        output_raster_uses_dummy, output_raster_dummy ),
+        "Error getting base lut" );
+            
+      lut = GetLinearLut( baselut,
+        min_level, max_level, output_channel_min_level, output_channel_max_level );
+  
+      break;
+    }
+    case TePDIContrastSquareRoot :
+    {
+      TePDITypes::TePDILutType baselut;
+      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut,
+        output_raster_uses_dummy, output_raster_dummy ),
+        "Error getting base lut" );    
+    
+      lut = GetSquareRootLut( baselut,
+        min_level, max_level, output_channel_min_level, output_channel_max_level );
+  
+      break;
+    }
+    case TePDIContrastSquare :
+    {
+      TePDITypes::TePDILutType baselut;
+      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut,
+        output_raster_uses_dummy, output_raster_dummy ),
+        "Error getting base lut" ); 
+            
+      lut = GetSquareLut( baselut,
+        min_level, max_level, output_channel_min_level, output_channel_max_level );
+  
+      break;
+    }
+    case TePDIContrastLog :
+    {
+      TePDITypes::TePDILutType baselut;
+      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut,
+        output_raster_uses_dummy, output_raster_dummy ),
+        "Error getting base lut" ); 
+            
+      lut = GetLogLut( baselut,
+        min_level, max_level, output_channel_min_level, output_channel_max_level );
+  
+      break;
+    }
+    case TePDIContrastNegative :
+    {
+      TePDITypes::TePDILutType baselut;
+      TEAGN_TRUE_OR_RETURN( getBaseLut( baselut, hist_based_lut,
+        output_raster_uses_dummy, output_raster_dummy ),
+        "Error getting base lut" ); 
+            
+      lut = GetNegativeLut( baselut,
+        min_level, max_level, output_channel_min_level, output_channel_max_level );
+ 
+      break;
+    }
+    case TePDIContrastHistEqualizer :
+    {
+      TePDIHistogram::pointer histogram;
+      TEAGN_TRUE_OR_RETURN( getHistogram( histogram, output_raster_uses_dummy, 
+        output_raster_dummy ), "Unable to get histogram" );
+        
+      fixed_step_lut = histogram->hasFixedStep();
+      hist_based_lut = true;
+    
+      lut = GetHistEqualizerLut( histogram,
+        output_channel_min_level, output_channel_max_level );
+  
+      break;
+    }
+    case TePDIContrastSimpleSlicer :
+    {
+      TePDIHistogram::pointer histogram;
+      TEAGN_TRUE_OR_RETURN( getHistogram( histogram, output_raster_uses_dummy, 
+        output_raster_dummy ), "Unable to get histogram" );
+        
+      fixed_step_lut = histogram->hasFixedStep();
+      hist_based_lut = true;
+            
+      GetSimpleSlicerLut( histogram,
+        palette,  min_level, max_level, lut );
+  
+      break;
+    }
+    case TePDIContrastStat :
+    {
+      TePDIHistogram::pointer histogram;
+      TEAGN_TRUE_OR_RETURN( getHistogram( histogram, output_raster_uses_dummy, 
+        output_raster_dummy ), "Unable to get histogram" );
+        
+      fixed_step_lut = histogram->hasFixedStep();
+      hist_based_lut = true;
+    
+      double target_mean = 0;
+      params_.GetParameter( "target_mean", target_mean );
+      
+      double target_variance = 0;
+      params_.GetParameter( "target_variance", target_variance );
+      GetStatLut( histogram, target_mean, target_variance,
+        output_channel_min_level, output_channel_max_level, lut );
+  
+      break;
+    }    
+    default :
+    {
+      TEAGN_LOG_AND_THROW( "Unsuported contrast type" );
+      break;
+    }
+  }
+  
+  /* Updating the output lut, if present */
+  
+  if( params_.CheckParameter< TePDITypes::TePDILutPtrType >( 
+    "outlut" ) ) {
+
+    TePDITypes::TePDILutPtrType outlut;  
+    params_.GetParameter( "outlut", outlut );
+    
+    *outlut = lut;
+  }    
+
+  /* Rendering output raster */
+  
+  if( outRaster.isActive() ) {
+    if( hist_based_lut ) {
+      TEAGN_TRUE_OR_RETURN( RemapLevels( inRaster, lut, input_band, 
+        output_band, outRaster, output_raster_uses_dummy, output_raster_dummy, 
+        fixed_step_lut ), "Level remapping error" );
+    } else {
+      TEAGN_TRUE_OR_RETURN( FullRangeLutRemapLevels( inRaster, lut, 
+        input_band, output_band, outRaster, output_raster_uses_dummy, 
+        output_raster_dummy ), "Level remapping error" );    
+    }
+  }
+  
+  /* Returning the generated histogram, if required */
+  
+  if( params_.CheckParameter< TePDIHistogram::pointer >( 
+    "output_original_histogram" ) ) {
+    
+    TePDIHistogram::pointer curr_histo_ptr;
+    TEAGN_TRUE_OR_RETURN( getHistogram( curr_histo_ptr,
+      output_raster_uses_dummy, output_raster_dummy ), 
+        "Unable to get histogram" );      
+  
+    TePDIHistogram::pointer output_original_histogram;
+    params_.GetParameter( "output_original_histogram", 
+      output_original_histogram );
+    
+    (*output_original_histogram) = (*curr_histo_ptr);
+  }
+  
+  /* Returning output_enhanced_histogram, if required */
+  
+  if( params_.CheckParameter< TePDIHistogram::pointer >( 
+    "output_enhanced_histogram" ) ) {
+    
+    TePDIHistogram::pointer curr_histo_ptr;
+    TEAGN_TRUE_OR_RETURN( getHistogram( curr_histo_ptr,
+      output_raster_uses_dummy, output_raster_dummy ), 
+        "Unable to get histogram" );      
+  
+    TePDIHistogram::pointer output_enhanced_histogram;
+    params_.GetParameter( "output_enhanced_histogram", 
+      output_enhanced_histogram );
+    
+    TePDIHistogram::iterator curr_histo_it = curr_histo_ptr->begin();
+    TePDIHistogram::iterator curr_histo_it_end = curr_histo_ptr->end();
+    TePDITypes::TePDILutType::iterator lut_it_end = lut.end();
+    TePDITypes::TePDILutType::iterator found_lut_mapping_it;
+    
+    while( curr_histo_it != curr_histo_it_end ) {
+      found_lut_mapping_it = lut.find( curr_histo_it->first );
+      
+      if( found_lut_mapping_it != lut_it_end ) {
+        (*output_enhanced_histogram)[ found_lut_mapping_it->second ]
+          += curr_histo_it->second;
+      }
+    
+      ++curr_histo_it;
+    }
+  }  
+  
+  return true;
+}
+
+
+bool TePDIContrast::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking input raster */
+
+  if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "input_image" ) ) {
+    
+    TePDITypes::TePDIRasterPtrType inRaster;
+    
+    if( ! parameters.GetParameter( "input_image", inRaster ) ) {
+  
+      TEAGN_LOGERR( "Missing parameter: input_image" );
+      return false;
+    }
+    if( ! inRaster.isActive() ) {
+  
+      TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
+      return false;
+    }
+    if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+  
+    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
+      return false;
+    }
+    
+    /* Checking input band */
+    
+    int input_band;
+    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_band", input_band ),
+      "Missing parameter: input_band" );
+    TEAGN_TRUE_OR_RETURN( ( ( input_band >= 0 ) && 
+      ( input_band < inRaster->nBands() ) ),
+      "Invalid parameter: input_band" );     
+      
+    /* Checking photometric interpretation */
+    
+    TEAGN_TRUE_OR_RETURN( ( 
+      ( inRaster->params().photometric_[ input_band ] == 
+        TeRasterParams::TeRGB ) ||
+      ( inRaster->params().photometric_[ input_band ] == 
+        TeRasterParams::TeMultiBand ) ),
+    "Invalid parameter - input_image (invalid photometric interpretation)" );    
+  }
+        
+  /* checking output raster, if present */
+  
+  TePDITypes::TePDIRasterPtrType output_image;
+  if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "output_image" ) ) {
+    
+    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_image", 
+      output_image ),  "Missing parameter: output_image" );
+    TEAGN_TRUE_OR_RETURN( output_image.isActive(),
+      "Invalid parameter: output_image inactive" );
+    TEAGN_TRUE_OR_RETURN( output_image->params().status_ != 
+      TeRasterParams::TeNotReady, 
+      "Invalid parameter: output_image not ready" );
+      
+    /* Checking output_band */
+    
+    int output_band;
+    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_band", 
+      output_band ), "Missing parameter: output_band" );
+    TEAGN_TRUE_OR_RETURN( ( output_band >= 0 ),
+      "Invalid parameter: output_band" ); 
+      
+    /* Input raster needed if output_image is present */
+    
+    TEAGN_TRUE_OR_RETURN( 
+      parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+      "input_image" ), "Missing parameter: input_image" );
+  }
+
+  /* Checking for the correct allowed contrast types */
+
+  TePDIContrastType contrast_type;
+  if( ! parameters.GetParameter( "contrast_type", contrast_type ) ) {
+    TEAGN_LOGERR( "Missing parameter: contrast_type" );
+    return false;
+  }
+  TEAGN_CHECK_NOTEQUAL( contrast_type, 0, "Invalid Contrast type" );
+  if( ( contrast_type != TePDIContrastMinMax ) &&
+      ( contrast_type != TePDIContrastLinear ) &&
+      ( contrast_type != TePDIContrastSquareRoot ) &&
+      ( contrast_type != TePDIContrastSquare ) &&
+      ( contrast_type != TePDIContrastLog ) &&
+      ( contrast_type != TePDIContrastNegative ) &&
+      ( contrast_type != TePDIContrastHistEqualizer ) &&
+      ( contrast_type != TePDIContrastSimpleSlicer ) &&
+      ( contrast_type != TePDIContrastStat ) ) {
+
+    TEAGN_LOGERR( "Invalid parameter: contrast_type" );
+    return false;
+  }
+
+  /* Checking for min and max required parameters */
+
+  if( ( contrast_type == TePDIContrastLinear ) ||
+      ( contrast_type == TePDIContrastSquareRoot ) ||
+      ( contrast_type == TePDIContrastSquare ) ||
+      ( contrast_type == TePDIContrastLog ) ||
+      ( contrast_type == TePDIContrastNegative ) ||
+      ( contrast_type == TePDIContrastSimpleSlicer ) ) {
+
+    if( ! parameters.CheckParameter< double >( "min_level" ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: min_level" );
+      return false;
+    }
+    if( ! parameters.CheckParameter< double >( "max_level" ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: max_level" );
+      return false;
+    }
+  }
+
+  /* Checking for RGB Palette required parameters */
+
+  if( ( contrast_type == TePDIContrastSimpleSlicer ) ) {
+    TePDIRgbPalette::pointer rgb_palette;
+
+    if( ( ! parameters.GetParameter( "rgb_palette", rgb_palette ) ) ||
+        ( ! rgb_palette.isActive() ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: rgb_palette" );
+      return false;
+    }
+  }
+  
+  /* checking outlut parameter */
+  
+  if( parameters.CheckParameter< TePDITypes::TePDILutPtrType >( 
+    "outlut" ) ) {
+
+    TePDITypes::TePDILutPtrType outlut;  
+    parameters.GetParameter( "outlut", outlut );
+    
+    TEAGN_TRUE_OR_RETURN( outlut.isActive(),
+      "Invalid parameter: outlut" );
+  }
+  
+  /* checking input_histogram */
+  
+  TePDIHistogram::pointer input_histogram;
+  
+  if( parameters.CheckParameter< TePDIHistogram::pointer >( 
+    "input_histogram" ) ) {
+  
+    parameters.GetParameter( "input_histogram", input_histogram );
+    TEAGN_TRUE_OR_RETURN( input_histogram.isActive(),
+      "Invalid parameter: input_histogram" );
+    TEAGN_TRUE_OR_RETURN( ( input_histogram->size() > 0 ),
+      "Invalid parameter: input_histogram" );
+  } else {
+    /* Input raster needed if input_histogram isn't present */
+    
+    TEAGN_TRUE_OR_RETURN( 
+      parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+      "input_image" ), "Missing parameter: input_image" );
+  }
+  
+  /* checking output_original_histogram */
+  
+  TePDIHistogram::pointer output_original_histogram;
+  
+  if( parameters.CheckParameter< TePDIHistogram::pointer >( 
+    "output_original_histogram" ) ) {
+  
+    parameters.GetParameter( "output_original_histogram", 
+      output_original_histogram );
+    TEAGN_TRUE_OR_RETURN( output_original_histogram.isActive(),
+      "Invalid parameter: output_original_histogram" );
+  }
+
+  /* checking output_enhanced_histogram */
+  
+  TePDIHistogram::pointer output_enhanced_histogram;
+  
+  if( parameters.CheckParameter< TePDIHistogram::pointer >( 
+    "output_enhanced_histogram" ) ) {
+  
+    parameters.GetParameter( "output_enhanced_histogram", 
+      output_enhanced_histogram );
+    TEAGN_TRUE_OR_RETURN( output_enhanced_histogram.isActive(),
+      "Invalid parameter: output_enhanced_histogram" );
+  }  
+  
+  /* Checking target_mean and target_variance */
+  
+  if( ( contrast_type == TePDIContrastStat ) ) {
+    double target_mean = 0;
+    TEAGN_TRUE_OR_RETURN( 
+      parameters.GetParameter( "target_mean", target_mean ),
+      "Missing parameter: target_mean" );
+      
+    double target_variance = 0;
+    TEAGN_TRUE_OR_RETURN( 
+      parameters.GetParameter( "target_variance", target_variance ),
+      "Missing parameter: target_variance" );      
+  }
+  
+  /* Checking input_variance */
+  
+  /* if input_variance is zero the algoritm will fail in GetStatLut */
+  
+  double input_variance = 0;
+  
+  if( parameters.CheckParameter< double >( "input_variance" ) ) {
+    parameters.GetParameter( "input_variance", input_variance );
+    
+    TEAGN_TRUE_OR_RETURN( ( input_variance != 0 ),
+      "Invalid parameter - input_variance" )
+  }
+  
+  /* Checking output_channel_min_level and output_channel_max_level */
+  
+  if( ! output_image.isActive() ) {
+  
+    TEAGN_TRUE_OR_RETURN( 
+      parameters.CheckParameter< double >( "output_channel_min_level" ),
+      "Missing parameter: output_channel_min_level" );
+    TEAGN_TRUE_OR_RETURN( 
+      parameters.CheckParameter< double >( "output_channel_max_level" ),
+      "Missing parameter: output_channel_max_level" );
+  }
+  
+  return true;
+}
+
+
+void TePDIContrast::ResetState( const TePDIParameters& params )
+{
+  if( params != params_ ) {
+    histo_ptr_.reset();
+  }
+}
+
+
+TePDITypes::TePDILutType TePDIContrast::GetMinMaxLut(
+  double output_channel_min_level, double output_channel_max_level,
+  TePDITypes::TePDILutType& base_lut )
+{
+  TEAGN_TRUE_OR_THROW( base_lut.size() != 0, "Invalid base_lut" );
+  
+  double lut_max = (-1.0) * DBL_MAX;
+  double lut_min = DBL_MAX;
+  
+  TePDITypes::TePDILutType::iterator it = base_lut.begin();
+  TePDITypes::TePDILutType::iterator it_end = base_lut.end();
+  
+  while( it != it_end ) {
+    if( it->first < lut_min ) {
+      lut_min = it->first;
+    }
+    if( it->first > lut_max ) {
+      lut_max = it->first;
+    }
+  
+    ++it;
+  }
+
+  return GetLinearLut( base_lut, lut_min,
+    lut_max, output_channel_min_level, output_channel_max_level );
+}
+
+
+TePDITypes::TePDILutType TePDIContrast::GetLinearLut(
+  TePDITypes::TePDILutType& base_lut,
+  double min, double max,
+  double output_channel_min_level, double output_channel_max_level )
+{
+  TEAGN_CHECK_NOTEQUAL( base_lut.size(), 0, "Invalid base_lut size" );
+  TEAGN_TRUE_OR_THROW( max > min, "Invalid max and min values" );
+
+  /* Calculating parameters */
+
+  unsigned int levels = base_lut.size();
+
+  double a = 0;
+  double b = 0;
+
+  if( max == min ) {
+    a = (double)levels;
+    b = -1. * ((double)levels) * min;
+  } else {
+    a = ((double)levels) / ( max - min );
+    b = ( -1. * ((double)levels) * min ) / ( max - min );
+  }
+
+  /* Generating LUT map using the existing histogram levels */
+
+  TePDITypes::TePDILutType out_lut;
+
+  TePDITypes::TePDILutType::iterator base_lut_it = base_lut.begin();
+  TePDITypes::TePDILutType::iterator base_lut_it_end = base_lut.end();
+  
+  unsigned int progress = 0;
+  double mapped_level = 0;
+  StartProgInt( "Building Linear Lut...", base_lut.size() );
+
+  while( base_lut_it != base_lut_it_end ) {
+    UpdateProgInt( progress );
+    
+    if( base_lut_it->first <= min ) {
+      out_lut[ base_lut_it->first ] = output_channel_min_level;
+    } else if( base_lut_it->first >= max ) {
+      out_lut[ base_lut_it->first ] = output_channel_max_level;
+    } else {
+      mapped_level = ( a * base_lut_it->first ) + b;
+      
+      if( mapped_level < output_channel_min_level ) {
+        mapped_level = output_channel_min_level;
+      } else if( mapped_level > output_channel_max_level ) {
+        mapped_level = output_channel_max_level;
+      }
+      
+      out_lut[ base_lut_it->first ] = mapped_level;
+    }
+
+    ++progress;
+    ++base_lut_it;
+  }
+
+  return out_lut;
+}
+
+
+TePDITypes::TePDILutType TePDIContrast::GetSquareRootLut(
+  TePDITypes::TePDILutType& base_lut,
+  double min, double max,
+  double output_channel_min_level, double output_channel_max_level )
+{
+  TEAGN_CHECK_NOTEQUAL( base_lut.size(), 0, "Invalid base_lut size" );
+  TEAGN_TRUE_OR_THROW( min < max, "Invalid min and max values" );
+
+  unsigned int levels = base_lut.size();
+
+  double factor = ((double)levels) / sqrt( max - min );
+
+  /* Generating LUT map using the existing base lut levels */
+
+  TePDITypes::TePDILutType out_lut;
+
+  TePDITypes::TePDILutType::iterator base_lut_it = base_lut.begin();
+  TePDITypes::TePDILutType::iterator base_lut_it_end = base_lut.end();
+  
+  unsigned int progress = 0;
+  double mapped_level = 0;
+  StartProgInt( "Building Square Root Lut...", base_lut.size() );  
+
+  while( base_lut_it != base_lut_it_end ) {
+    UpdateProgInt( progress );
+    
+    if( base_lut_it->first <= min ) {
+      out_lut[ base_lut_it->first ] = output_channel_min_level;
+    } else if( base_lut_it->first >= max ) {
+      out_lut[ base_lut_it->first ] = output_channel_max_level;
+    } else {
+      mapped_level = factor * sqrt( base_lut_it->first - min );
+      
+      if( mapped_level < output_channel_min_level ) {
+        mapped_level = output_channel_min_level;
+      } else if( mapped_level > output_channel_max_level ) {
+        mapped_level = output_channel_max_level;
+      }      
+      
+      out_lut[ base_lut_it->first ] = mapped_level;
+    }
+
+    ++progress;
+    ++base_lut_it;
+  }
+
+  return out_lut;
+}
+
+
+TePDITypes::TePDILutType TePDIContrast::GetSquareLut(
+  TePDITypes::TePDILutType& base_lut,
+  double min, double max,
+  double output_channel_min_level, double output_channel_max_level )
+{
+  TEAGN_CHECK_NOTEQUAL( base_lut.size(), 0, "Invalid base_lut size" );
+  TEAGN_TRUE_OR_THROW( min < max, "Invalid min and max values" );
+
+  unsigned int levels = base_lut.size();
+
+  double factor = ((double)levels) / pow( (max - min), 2 );
+
+  /* Generating LUT map using the existing base lut levels */
+
+  TePDITypes::TePDILutType out_lut;
+
+  TePDITypes::TePDILutType::iterator base_lut_it = base_lut.begin();
+  TePDITypes::TePDILutType::iterator base_lut_it_end = base_lut.end();
+
+  unsigned int progress = 0;
+  double mapped_level = 0;
+  StartProgInt( "Building Square Lut...", base_lut.size() ); 
+    
+  while( base_lut_it != base_lut_it_end ) {
+    UpdateProgInt( progress );
+    
+    if( base_lut_it->first <= min ) {
+      out_lut[ base_lut_it->first ] = output_channel_min_level;
+    } else if( base_lut_it->first >= max ) {
+      out_lut[ base_lut_it->first ] = output_channel_max_level;
+    } else {
+      mapped_level = factor * pow( base_lut_it->first - min, 2 );
+      
+      if( mapped_level < output_channel_min_level ) {
+        mapped_level = output_channel_min_level;
+      } else if( mapped_level > output_channel_max_level ) {
+        mapped_level = output_channel_max_level;
+      }        
+      
+      out_lut[ base_lut_it->first ] = mapped_level;
+    }
+
+    ++progress;
+    ++base_lut_it;
+  }
+
+  return out_lut;
+}
+
+
+TePDITypes::TePDILutType TePDIContrast::GetLogLut(
+  TePDITypes::TePDILutType& base_lut,
+  double min, double max,
+  double output_channel_min_level, double output_channel_max_level )
+{
+  TEAGN_CHECK_NOTEQUAL( base_lut.size(), 0, "Invalid base_lut size" );
+  TEAGN_TRUE_OR_THROW( max > ( min+1 ), "Invalid min and max values" );
+
+  unsigned int levels = base_lut.size();
+
+  double factor = ((double)levels) / log10( max - min + 1 );
+
+  /* Generating LUT map using the existing base_lut levels */
+
+  TePDITypes::TePDILutType out_lut;
+
+  TePDITypes::TePDILutType::iterator base_lut_it = base_lut.begin();
+  TePDITypes::TePDILutType::iterator base_lut_it_end = base_lut.end();
+
+  unsigned int progress = 0;
+  double mapped_level = 0;
+  StartProgInt( "Building Log Lut...", base_lut.size() ); 
+    
+  while( base_lut_it != base_lut_it_end ) {
+    UpdateProgInt( progress );
+    
+    if( base_lut_it->first <= min ) {
+      out_lut[ base_lut_it->first ] = output_channel_min_level;
+    } else if( base_lut_it->first >= max ) {
+      out_lut[ base_lut_it->first ] = output_channel_max_level;
+    } else {
+      mapped_level = factor * log10( base_lut_it->first - min + 1 );
+      
+      if( mapped_level < output_channel_min_level ) {
+        mapped_level = output_channel_min_level;
+      } else if( mapped_level > output_channel_max_level ) {
+        mapped_level = output_channel_max_level;
+      }        
+    
+      out_lut[ base_lut_it->first ] = mapped_level;
+    }
+
+    ++progress;
+    ++base_lut_it;
+  }
+
+  return out_lut;
+}
+
+
+TePDITypes::TePDILutType TePDIContrast::GetNegativeLut(
+  TePDITypes::TePDILutType& base_lut,
+  double min, double max,
+  double output_channel_min_level, double output_channel_max_level )
+{
+  TEAGN_CHECK_NOTEQUAL( base_lut.size(), 0, "Invalid base_lut size" );
+  TEAGN_TRUE_OR_THROW( max > min, "Invalid max and min values" );
+
+  /* Calculating parameters */
+
+  unsigned int levels = base_lut.size();
+
+  double a = -1. * ((double)levels) / ( max - min );
+  double b = ( ((double)levels) * max ) / ( max - min );
+
+  /* Generating LUT map using the existing base_lut levels */
+
+  TePDITypes::TePDILutType out_lut;
+
+  TePDITypes::TePDILutType::iterator base_lut_it = base_lut.begin();
+  TePDITypes::TePDILutType::iterator base_lut_it_end = base_lut.end();
+
+  unsigned int progress = 0;
+  double mapped_level = 0;
+  StartProgInt( "Building Negative Lut...", base_lut.size() ); 
+    
+  while( base_lut_it != base_lut_it_end ) {
+    UpdateProgInt( progress );
+    
+    if( base_lut_it->first <= min ) {
+      out_lut[ base_lut_it->first ] = output_channel_max_level;
+    } else if( base_lut_it->first >= max ) {
+      out_lut[ base_lut_it->first ] = output_channel_min_level;
+    } else {
+      mapped_level = ( a * base_lut_it->first ) + b;
+      
+      if( mapped_level < output_channel_min_level ) {
+        mapped_level = output_channel_min_level;
+      } else if( mapped_level > output_channel_max_level ) {
+        mapped_level = output_channel_max_level;
+      }
+      
+      out_lut[ base_lut_it->first ] = mapped_level;
+    }
+
+    ++progress;
+    ++base_lut_it;
+  }
+
+  return out_lut;
+}
+
+TePDITypes::TePDILutType TePDIContrast::GetHistEqualizerLut(
+  TePDIHistogram::pointer hist,
+  double output_channel_min_level, double output_channel_max_level )
+{
+  TEAGN_TRUE_OR_THROW( hist->size() > 1, "Invalid histogram size" );
+  TEAGN_TRUE_OR_THROW( ( output_channel_max_level > output_channel_min_level ),
+    "Invalid paramters output_channel_max_level <= output_channel_min_level" );
+  TEAGN_TRUE_OR_THROW( ( hist->GetMaxCount() > 0 ),
+    "Invalid histogram" );
+    
+  /* Generating the accumulative matrix */
+
+  TePDIHistogram::iterator in_hist_it = hist->begin();
+  TePDIHistogram::iterator in_hist_it_end = hist->end();
+
+  TePDIMatrix< double > accumulative_matrix;
+  TEAGN_TRUE_OR_THROW( accumulative_matrix.Reset( hist->size(), 2 ),
+    "Matrix reset error" );
+    
+  accumulative_matrix( 0, 0 ) = in_hist_it->first;
+  accumulative_matrix( 0, 1 ) = (double)in_hist_it->second;
+  ++in_hist_it;
+  
+  unsigned int accumulative_matrix_line = 1;
+  double hist_population = (double)in_hist_it->second;
+  
+  StartProgInt( "Building Histogram Equalizer Lut...", 2 * hist->size() );
+  
+  while( in_hist_it != in_hist_it_end ) { 
+    accumulative_matrix( accumulative_matrix_line, 0 ) = in_hist_it->first;
+    accumulative_matrix( accumulative_matrix_line, 1 ) =
+      accumulative_matrix( accumulative_matrix_line - 1, 1 ) +
+      (double)in_hist_it->second;
+      
+     hist_population += (double)in_hist_it->second;
+  
+    ++accumulative_matrix_line;
+    ++in_hist_it;
+    
+    IncProgInt();
+  }
+  
+  /* Creating the look-up table */
+
+  double total_levels_nmb = (double)hist->size();
+  double mapped_level = 0;
+  TePDITypes::TePDILutType out_lut;
+  
+  for( accumulative_matrix_line = 0 ; 
+    accumulative_matrix_line < accumulative_matrix.GetLines() ;
+    ++accumulative_matrix_line ) {
+    
+    mapped_level = ( accumulative_matrix( accumulative_matrix_line, 1 ) *
+      total_levels_nmb ) / hist_population;
+      
+    if( mapped_level < output_channel_min_level ) {
+      mapped_level = output_channel_min_level;
+    } else if( mapped_level > output_channel_max_level ) {
+      mapped_level = output_channel_max_level;
+    }
+    
+    out_lut[ accumulative_matrix( accumulative_matrix_line, 0 ) ] = 
+      mapped_level;
+      
+    IncProgInt();  
+  }
+  
+  StopProgInt();
+  
+  return out_lut;
+}
+
+
+void TePDIContrast::GetSimpleSlicerLut(
+  TePDIHistogram::pointer hist,
+  TePDIRgbPalette::pointer in_palette,
+  double min,
+  double max,
+  TePDITypes::TePDILutType& out_lut )
+{
+  TEAGN_TRUE_OR_THROW( ( hist->size() > 0 ), "Invalid histogram size" );
+  TEAGN_TRUE_OR_THROW( max > min, "Invalid max and min values" );
+  TEAGN_TRUE_OR_THROW( in_palette->size() > 0,
+    "Invalid input palette size" );
+
+  out_lut.clear();
+
+  /* Extracting palette levels */
+
+  std::vector< double > palette_levels;
+  TePDIRgbPalette::iterator pal_it = in_palette->begin();
+  TePDIRgbPalette::iterator pal_it_end = in_palette->end();
+  
+  unsigned int progress = 0;
+  StartProgInt( "Building Simple Slicer Lut...", hist->size() +
+    in_palette->size() );    
+
+  while( pal_it != pal_it_end ) {
+    UpdateProgInt( progress );
+    
+    palette_levels.push_back( pal_it->first );
+
+    ++progress;
+    ++pal_it;
+  }
+
+  /* min and max adjusting to the supplied histogram range */
+
+  double in_hist_max = hist->GetMaxLevel();
+  double in_hist_min = hist->GetMinLevel();
+
+  min = ( min < in_hist_min ) ? in_hist_min : min;
+  max = ( max > in_hist_max ) ? in_hist_max : max;
+
+  /* Output LUT generation */
+
+  double slice_size = ( max - min ) / ((double)in_palette->size());
+
+  double first_pal_level = palette_levels[ 0 ];
+  double last_pal_level = palette_levels[ palette_levels.size() - 1 ];
+
+  TePDIHistogram::iterator in_hist_it = hist->begin();
+  TePDIHistogram::iterator in_hist_it_end = hist->end();
+
+  double current_level;
+  unsigned int current_slice;
+  
+  while( in_hist_it != in_hist_it_end ) {
+    UpdateProgInt( progress );
+    
+    current_level = in_hist_it->first;
+
+    if( current_level <= min ) {
+      out_lut[ current_level ] = first_pal_level;
+    } else if ( current_level >= max ) {
+      out_lut[ current_level ] = last_pal_level;
+    } else {
+      current_slice =
+        (unsigned int) floor( ( current_level - min ) / slice_size );
+        
+      TEAGN_DEBUG_CONDITION( ( current_slice < palette_levels.size() ),
+        "Invalid current_slice=" + Te2String( current_slice ) +
+        " for pallete_levels size=" + Te2String( palette_levels.size() ) );
+
+      out_lut[ current_level ] = palette_levels[ current_slice ];
+    }
+
+    ++progress;
+    ++in_hist_it;
+  }
+}
+
+
+void TePDIContrast::GetStatLut( TePDIHistogram::pointer hist,
+  double target_mean, double target_variance, double output_channel_min_level, 
+  double output_channel_max_level, TePDITypes::TePDILutType& out_lut )
+{
+  TEAGN_CHECK_NOTEQUAL( hist->size(), 0, "Invalid histogram size" );
+
+  out_lut.clear();
+  
+  TePDIHistogram::iterator in_hist_it;
+  TePDIHistogram::iterator in_hist_it_end = hist->end(); 
+  
+  /* Calculating the total pixels number */
+  
+  unsigned int total_pixels = 0;
+  
+  in_hist_it = hist->begin();
+  
+  while( in_hist_it != in_hist_it_end ) {
+    total_pixels += in_hist_it->second;
+        
+    ++in_hist_it;
+  }
+  
+  /* Calculating the current mean */ 
+  
+  double current_mean = 0;
+  
+  if( params_.CheckParameter< double >( "input_mean" ) ) {
+    params_.GetParameter( "input_mean", current_mean );
+  } else {
+    in_hist_it = hist->begin();
+    
+    while( in_hist_it != in_hist_it_end ) {
+      current_mean += ( in_hist_it->first * ((double)in_hist_it->second) );
+        
+      ++in_hist_it;
+    }
+  
+    current_mean = current_mean / ((double)total_pixels);
+  }
+    
+  /* Calculating the current variance */ 
+        
+  double current_variance = 0;
+  
+  if( params_.CheckParameter< double >( "input_variance" ) ) {
+    params_.GetParameter( "input_variance", current_variance );
+  } else {
+    double temp_double = 0;
+    
+    in_hist_it = hist->begin();
+    
+    while( in_hist_it != in_hist_it_end ) {
+      temp_double = ( in_hist_it->first - current_mean );
+      temp_double = temp_double * temp_double * ((double)in_hist_it->second);
+      
+      current_variance += temp_double;
+        
+      ++in_hist_it;
+    }
+    
+    current_variance = current_variance / ( (double) total_pixels );
+  }
+  
+  /* Creating levels map */
+  
+  double gain = sqrt( target_variance / current_variance );
+  double offset = target_mean - ( gain * current_mean );
+  
+  in_hist_it = hist->begin();
+  
+  double current_level = 0;
+  double mapped_level = 0;
+  
+  while( in_hist_it != in_hist_it_end ) {
+    current_level = in_hist_it->first;
+    mapped_level = ( current_level * gain ) + offset;
+
+    if( mapped_level < output_channel_min_level ) {
+      out_lut[ current_level ] = output_channel_min_level;
+    } else if ( mapped_level > output_channel_max_level ) {
+      out_lut[ current_level ] = output_channel_max_level;
+    } else {
+      out_lut[ current_level ] = mapped_level;
+    }    
+  
+    ++in_hist_it;
+  }
+}
+
+
+bool TePDIContrast::RemapLevels(
+  TePDITypes::TePDIRasterPtrType& inRaster,
+  TePDITypes::TePDILutType& lut,
+  int in_channel,
+  int out_channel,
+  TePDITypes::TePDIRasterPtrType& outRaster,
+  bool use_dummy, double dummy_value, bool fixed_step_lut )
+{
+  TEAGN_TRUE_OR_RETURN( inRaster.isActive(),
+    "inRaster inactive" );
+  TEAGN_TRUE_OR_RETURN( outRaster.isActive(),
+    "outRaster inactive" );
+  TEAGN_TRUE_OR_RETURN( 
+    inRaster->params().status_ != TeRasterParams::TeNotReady,
+    "inRaster not ready" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( outRaster->params().status_ != TeRasterParams::TeNotReady ),
+    "outRaster not ready" );
+    
+  TEAGN_TRUE_OR_RETURN( ( inRaster->params().nlines_ ==
+    outRaster->params().nlines_ ),
+    "Lines number mismatch between input and output image" );
+  TEAGN_TRUE_OR_RETURN( ( inRaster->params().ncols_ ==
+    outRaster->params().ncols_ ),
+    "Columns number mismatch between input and output image" );
+  TEAGN_TRUE_OR_RETURN( in_channel < inRaster->nBands(), 
+    "Invalid input band" );
+  TEAGN_TRUE_OR_RETURN( out_channel < outRaster->nBands(), 
+    "Invalid output band" );
+  TEAGN_TRUE_OR_RETURN( ( lut.size() > 1 ), "Invalid lut" );
+
+  const int raster_lines = inRaster->params().nlines_;
+  const int raster_columns = inRaster->params().ncols_;
+  
+  /* Guessing dummy use */
+  
+  bool inRaster_uses_dummy = inRaster->params().useDummy_;
+  
+  bool outRaster_uses_dummy = outRaster->params().useDummy_;
+  double outRaster_dummy = 0;
+  if( outRaster_uses_dummy ) {
+    outRaster_dummy = outRaster->params().dummy_[ out_channel ];
+  } else {
+    outRaster_dummy = dummy_value;
+  }
+  
+  /* Loading lut */
+  
+  TePDIMatrix< double > lutmatrix;
+  TEAGN_TRUE_OR_RETURN( lutmatrix.Reset( 2, lut.size(), 
+    TePDIMatrix< double >::AutoMemPol ),
+    "Unable to create lut matrix" );
+  {
+    TePDITypes::TePDILutType::iterator it = lut.begin();;
+  
+    for( unsigned int lutcol = 0 ; lutcol < lutmatrix.GetColumns() ; 
+      ++lutcol ) {
+      
+      lutmatrix( 0, lutcol ) = it->first;
+      lutmatrix( 1, lutcol ) = it->second;
+      
+      ++it;
+    }
+  }
+  
+  /* Remapping levels */
+  
+  StartProgInt( "Remapping Levels...", raster_lines );
+
+  if( fixed_step_lut ) {
+    double current_level = 0;
+    const double lut_min_level = lutmatrix( 0, 0 );
+    const double lut_max_level = lutmatrix( 0, lutmatrix.GetColumns() - 1 );
+    unsigned int best_lut_index = 0;
+    const unsigned int lutmatrix_last_index = ( lutmatrix.GetColumns() - 1 );
+    
+    double lut_step = 0;
+    if( lutmatrix.GetColumns() > 1 ) {
+      lut_step = lutmatrix( 0, 1 ) - lutmatrix( 0, 0 );
+    }
+  
+    for( int line = 0 ; line < raster_lines ; ++line ) {
+      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
+    
+      for( int column = 0 ; column < raster_columns ; ++column ) {
+        if( inRaster->getElement( column, line, current_level,
+            in_channel ) ) {
+            
+          if( use_dummy && ( current_level == dummy_value ) ) {
+            TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
+              outRaster_dummy, out_channel ),
+              "Level remmaping error at " + Te2String( line ) +
+              "," + Te2String( column ) );           
+          } else {
+            /* Finding the mapping level from lut */
+            
+            if( current_level < lut_min_level ) {
+              best_lut_index = 0;
+            } else if( current_level > lut_max_level ) {
+              best_lut_index = lutmatrix_last_index;
+            } else {
+              best_lut_index = ( unsigned int ) ( TeRound( ( current_level - 
+                lut_min_level ) / lut_step ) );             
+            }
+            
+            /* Pixel Output level remapping */
+            
+            TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
+              lutmatrix( 1, best_lut_index ), out_channel ),
+              "Level remmaping error at " + Te2String( line ) +
+              "," + Te2String( column ) );
+          }
+        } else {
+          TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
+            
+          TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
+            outRaster_dummy, out_channel ),
+            "Level remmaping error at " + Te2String( line ) +
+            "," + Te2String( column ) );          
+        }
+      }
+    }
+  } else {
+    double current_level;
+    unsigned int left_element_index;
+    unsigned int middle_element_index;
+    unsigned int right_element_index;
+    const unsigned int last_valid_index = lutmatrix.GetColumns() - 1;
+    const unsigned int lut_size = lutmatrix.GetColumns();
+    double middle_element_level;
+  
+    for( int line = 0 ; line < raster_lines ; ++line ) {
+      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
+    
+      for( int column = 0 ; column < raster_columns ; ++column ) {
+        if( inRaster->getElement( column, line, current_level,
+            in_channel ) ) {
+            
+          if( use_dummy && ( current_level == dummy_value ) ) {
+            TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
+              outRaster_dummy, out_channel ),
+              "Level remmaping error at " + Te2String( line ) +
+              "," + Te2String( column ) );           
+          } else {            
+            /* Finding the two best mapping levels from lut */
+            
+            if( lut_size == 1 ) {
+              right_element_index = left_element_index = 1;
+            } else {
+              left_element_index = 0;
+              right_element_index = last_valid_index;
+            
+              do {
+                middle_element_index =  left_element_index + 
+                  ( ( right_element_index - left_element_index ) / 2 );
+                middle_element_level = lutmatrix( 0, middle_element_index );
+                          
+                if( current_level == middle_element_level ) {
+                  left_element_index = right_element_index = 
+                    middle_element_index;
+                  break;
+                } else if( current_level < middle_element_level ) {
+                  right_element_index = middle_element_index;
+                } else {
+                  left_element_index = middle_element_index;
+                }          
+              } while( ( right_element_index - left_element_index ) > 1 );
+            }
+            
+            /* Pixel Output level aproximation and mapping */
+            
+            if( ( current_level - lutmatrix( 0, left_element_index ) ) <
+                ( lutmatrix( 0, right_element_index ) - current_level ) ) {
+    
+              TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
+                lutmatrix( 1, left_element_index ), out_channel ),
+                "Level remmaping error at " + Te2String( line ) +
+                "," + Te2String( column ) );
+            } else {
+              TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
+                lutmatrix( 1, right_element_index ), out_channel ),
+                "Level remmaping error at " + Te2String( line ) +
+                "," + Te2String( column ) );
+            }
+          }
+        } else {
+          TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
+          
+          TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
+            outRaster_dummy, out_channel ),
+            "Level remmaping error at " + Te2String( line ) +
+            "," + Te2String( column ) );          
+        }
+      }
+    }
+  }
+  
+  StopProgInt();
+  
+  return true;
+}
+
+
+bool TePDIContrast::FullRangeLutRemapLevels( 
+  TePDITypes::TePDIRasterPtrType& inRaster, TePDITypes::TePDILutType& lut,
+  int in_channel, int out_channel, TePDITypes::TePDIRasterPtrType& outRaster, 
+  bool use_dummy, double dummy_value )
+{
+  TEAGN_TRUE_OR_RETURN( inRaster.isActive(),
+    "inRaster inactive" );
+  TEAGN_TRUE_OR_RETURN( outRaster.isActive(),
+    "outRaster inactive" );
+  TEAGN_TRUE_OR_RETURN( 
+    inRaster->params().status_ != TeRasterParams::TeNotReady,
+    "inRaster not ready" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( outRaster->params().status_ != TeRasterParams::TeNotReady ),
+    "outRaster not ready" );
+    
+  TEAGN_TRUE_OR_RETURN( ( inRaster->params().nlines_ ==
+    outRaster->params().nlines_ ),
+    "Lines number mismatch between input and output image" );
+  TEAGN_TRUE_OR_RETURN( ( inRaster->params().ncols_ ==
+    outRaster->params().ncols_ ),
+    "Columns number mismatch between input and output image" );
+  TEAGN_TRUE_OR_RETURN( in_channel < inRaster->nBands(), 
+    "Invalid input band" );
+  TEAGN_TRUE_OR_RETURN( out_channel < outRaster->nBands(), 
+    "Invalid output band" );
+  TEAGN_TRUE_OR_RETURN( ( lut.size() > 1 ), "Invalid lut" );
+
+  const int raster_lines = inRaster->params().nlines_;
+  const int raster_columns = inRaster->params().ncols_;
+  
+  /* Guessing dummy use */
+  
+  bool inRaster_uses_dummy = inRaster->params().useDummy_;
+  
+  bool outRaster_uses_dummy = outRaster->params().useDummy_;
+  double outRaster_dummy = 0;
+  if( outRaster_uses_dummy ) {
+    outRaster_dummy = outRaster->params().dummy_[ out_channel ];
+  } else {
+    outRaster_dummy = dummy_value;
+  }
+  
+  /* Loading lut */
+  
+  TePDIMatrix< double > lutmatrix;
+  TEAGN_TRUE_OR_RETURN( lutmatrix.Reset( 2, lut.size(), 
+    TePDIMatrix< double >::AutoMemPol ),
+    "Unable to create lut matrix" );
+  {
+    TePDITypes::TePDILutType::iterator it = lut.begin();;
+  
+    for( unsigned int lutcol = 0 ; lutcol < lutmatrix.GetColumns() ; 
+      ++lutcol ) {
+      
+      lutmatrix( 0, lutcol ) = it->first;
+      lutmatrix( 1, lutcol ) = it->second;
+      
+      ++it;
+    }
+  }
+  
+  /* Remapping levels */
+  
+  TeRaster& inRaster_ref = *inRaster;
+  TeRaster& outRaster_ref = *outRaster;
+  int line = 0;
+  int column = 0 ;
+  double current_level = 0;
+  
+  StartProgInt( "Remapping Levels...", raster_lines );
+  
+  for( line = 0 ; line < raster_lines ; ++line ) {
+    TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
+    
+    for( column = 0 ; column < raster_columns ; ++column ) {
+      if( inRaster_ref.getElement( column, line, current_level,
+        in_channel ) ) { 
+        
+        if( use_dummy && ( current_level == dummy_value ) ) {
+          TEAGN_TRUE_OR_RETURN( outRaster_ref.setElement( column, line,
+            outRaster_dummy, out_channel ),
+            "Level remmaping error at " + Te2String( line ) +
+            "," + Te2String( column ) );       
+        } else {
+          TEAGN_DEBUG_CONDITION( ( ( (unsigned int)current_level ) <
+            lutmatrix.GetColumns() ), "Level out of lut range" );
+          TEAGN_DEBUG_CONDITION( 
+            ( lutmatrix( 0, ( (unsigned int)current_level ) ) ==
+            ( (unsigned int)current_level ) ), 
+            "Requested value not found inside lut" );
+          
+          TEAGN_TRUE_OR_RETURN( outRaster_ref.setElement( column, line,
+            lutmatrix( 1, ( (unsigned int)current_level ) ), out_channel ),
+            "Level remmaping error at " + Te2String( line ) +
+            "," + Te2String( column ) );          
+        }
+      } else {
+        TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
+            
+        TEAGN_TRUE_OR_RETURN( outRaster_ref.setElement( column, line,
+          outRaster_dummy, out_channel ),
+          "Level remmaping error at " + Te2String( line ) +
+          "," + Te2String( column ) );       
+      }
+    }
+  }
+  
+  StopProgInt();
+  
+  return true;  
+}
+
+
+bool TePDIContrast::getHistogram( TePDIHistogram::pointer& hist,
+  bool useDummy, double dummyValue )
+{
+  if( ! histo_ptr_.isActive() ) {
+    if( params_.CheckParameter< TePDIHistogram::pointer >( 
+      "input_histogram" ) ) {
+    
+      params_.GetParameter( "input_histogram", histo_ptr_ );
+    } else {
+      /* No histogram supplied, we need to generate it */
+  
+      TePDITypes::TePDIRasterPtrType inRaster;
+      TEAGN_TRUE_OR_RETURN( params_.GetParameter( "input_image", inRaster ),
+        "Missing parameter : input_image" );
+      
+      int input_band = 0;
+      TEAGN_TRUE_OR_RETURN( params_.GetParameter( "input_band", input_band ),
+        "Missing parameter : input_band" );
+      
+      int histo_levels = 0;
+      if( ( inRaster->params().dataType_[ input_band ] == TeFLOAT ) ||
+        ( inRaster->params().dataType_[ input_band ] == TeDOUBLE ) ) {
+        
+        histo_levels = 256;
+      }
+      if( params_.CheckParameter< int >( "histo_levels" ) ) {
+        params_.GetParameter( "histo_levels", histo_levels );
+      }
+      
+      histo_ptr_.reset( new TePDIHistogram );
+      TEAGN_TRUE_OR_RETURN( 
+        histo_ptr_->reset( inRaster, input_band, 
+        (unsigned int)histo_levels, 
+        TeBoxPixelIn ), "Histogram generation error" );
+        
+      // Removing the dummy value from the generated histrogram
+      
+      if( useDummy )
+      {
+        histo_ptr_->erase( dummyValue );
+      }
+    }
+  }
+  
+  hist = histo_ptr_;
+  
+  return true;
+}
+
+bool TePDIContrast::getBaseLut( TePDITypes::TePDILutType& lut,
+  bool& hist_based_lut, bool useDummy, double dummyValue )
+{
+  lut.clear();
+  
+  if( params_.CheckParameter< TePDIHistogram::pointer >( 
+    "input_histogram" ) ) 
+  {
+  
+    TePDIHistogram::pointer hist;
+    TEAGN_TRUE_OR_RETURN( getHistogram( hist, useDummy, dummyValue ), 
+      "Unable to get histogram" );    
+    
+    TePDIHistogram::iterator it = hist->begin();
+    TePDIHistogram::iterator it_end = hist->end();
+      
+    while( it != it_end ) {
+      lut[ it->first ] = it->first;
+    
+      ++it;
+    }
+      
+    hist_based_lut = true;    
+  } else {
+    TePDITypes::TePDIRasterPtrType inRaster;
+    params_.GetParameter( "input_image", inRaster );
+    
+    int input_band = 0;
+    params_.GetParameter( "input_band", input_band );
+      
+    switch( inRaster->params().dataType_[ input_band ] ) {
+      case TeBIT :
+      case TeUNSIGNEDCHAR :
+      case TeUNSIGNEDSHORT :
+      {
+        unsigned int lut_size = (unsigned int)( 
+          pow( 2.0, (double)( inRaster->params().elementSize( input_band ) * 
+          8 ) ) );
+      
+        for( unsigned int index = 0 ; index < lut_size ; ++index ) {
+          lut[ index ] = index;
+        }
+            
+        hist_based_lut = false;
+        
+        break;
+      }
+      case TeCHAR :
+      case TeSHORT :      
+      case TeINTEGER :
+      case TeLONG :
+      case TeUNSIGNEDLONG :
+      case TeFLOAT :
+      case TeDOUBLE :
+      {
+        TePDIHistogram::pointer hist;
+        TEAGN_TRUE_OR_RETURN( getHistogram( hist, useDummy, dummyValue ), 
+          "Unable to get histogram" );
+        
+        TePDIHistogram::iterator it = hist->begin();
+        TePDIHistogram::iterator it_end = hist->end();
+        
+        while( it != it_end ) {
+          lut[ it->first ] = it->first;
+      
+          ++it;
+        }
+        
+        hist_based_lut = true;
+        
+        break;
+      }
+      default :
+      {
+        TEAGN_LOG_AND_THROW( "Invalid raster pixel type" );
+        break;
+      }
+    }
+  }
+  
+  return true;
+}
+
diff --git a/src/terralib/image_processing/TePDIContrast.hpp b/src/terralib/image_processing/TePDIContrast.hpp
old mode 100755
new mode 100644
index 1fcc619..db4c2c3
--- a/src/terralib/image_processing/TePDIContrast.hpp
+++ b/src/terralib/image_processing/TePDIContrast.hpp
@@ -1,411 +1,417 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDICONTRAST_HPP
-  #define TEPDICONTRAST_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIRgbPalette.hpp"
-  #include "TePDITypes.hpp"
-  #include <TeSharedPtr.h>
-  #include "TePDIHistogram.hpp"
-
-  /**
-   * @brief  This is the class for contrast image processing algorithms.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIGeneralAlgoGroup
-   *
-   * @note The general input parameters are:
-   *
-   * @param contrast_type ( TePDIContrast::TePDIContrastType ) - The contrast 
-   * to be generated.
-   * @param input_image (TePDITypes::TePDIRasterPtrType) - The input
-   * image.
-   * @param input_band ( int ) - Band to process from input_image.
-   *
-   * @note The specific input parameters ( by parameter type ):
-   *
-   * @param min_level (double) - Minimal level for Linear Luts.
-   * Required by: TePDIContrastLinear, TePDIContrastSquareRoot,
-   * TePDIContrastSquare, TePDIContrastLog, TePDIContrastNegative,
-   * TePDIContrastSimpleSlicer.
-   *
-   * @param max_level (double) - Minimal level for Linear Luts.
-   * Required by: TePDIContrastLinear, TePDIContrastSquareRoot,
-   * TePDIContrastSquare, TePDIContrastLog, TePDIContrastNegative,
-   * TePDIContrastSimpleSlicer.
-   *
-   * @param rgb_palette (TePDIRgbPalette::pointer) -
-   * Reference RGB palette.
-   * Required by: TePDIContrastSimpleSlicer.
-   *
-   * @param target_mean ( double ) - The target mean value.
-   * Required by: TePDIContrastStat.
-   *
-   * @param target_variance ( double ) - The target variance value.
-   * Required by: TePDIContrastStat.
-   *
-   * @note The following parameters are optional and will be used if present.
-   *
-   * @param output_image ( TePDITypes::TePDIRasterPtrType ) -
-   * The output image ( if not present, only the output LUT will be
-   * generated ).   
-   *
-   * @param output_band ( int ) - Band to save the result inside output_image
-   * (required if output_image is present).
-   *
-   * @param restrict_out_reset (int) - If present (any value),
-   * a restrictive output_image reset will be done
-   * ( output_image reset will not be done if all of the following 
-   * conditions are satisfied - Exact number of lines, exact number
-   * of columns, sufficient number of bands, same projection, same box,
-   * dummy value ), 
-   * this allows output_image data keeping since
-   * unused bands are not changed.
-   *
-   * @param outlut ( TePDITypes::TePDILutPtrType ) - The generated look-up
-   * table. NOTE: If the current input_image has floating point pixel values,
-   * the generated look-up table will have interpolated values.
-   *
-   * @param input_histogram ( TePDIHistogram::pointer ) - A pointer to an
-   * active histogram instance that will be used when generating the
-   * internal lut - The internal histogram generation will be disabled.
-   *
-   * @param output_original_histogram ( TePDIHistogram::pointer ) - A 
-   * pointer to an active output histogram instance that will be filled 
-   * with the internally generated histogram from the input image or
-   * using the supplied input histogram.
-   *
-   * @param output_enhanced_histogram ( TePDIHistogram::pointer ) - A 
-   * pointer to an active output histogram instance that will be filled 
-   * with the internally generated histogram from the input image or
-   * using the supplied input histogram.   
-   *
-   * @param histo_levels (int) - Number of histogram levels when internal
-   * histogram generation is needed ( if zero, the histogram levels
-   * will be automatically found. In this case, for floating point rasters the
-   * number of levels will be always 256 ).
-   *
-   * @param dummy_value (double) - A dummy pixel value for use 
-   * in pixels where no data is available.    
-   *
-   * @param input_mean ( double ) - Force the algorithm to use the supplied
-   * value as mean for the current raster (The internal mean calcule will
-   * be disabled ).
-   * Used by: TePDIContrastStat.
-   *
-   * @param input_variance ( double ) - Force the algorithm to use the supplied
-   * value as variance for the current raster ( The internal variance calcule
-   * will be disabled ).
-   * Used by: TePDIContrastStat.      
-   *
-   * @param output_channel_min_level ( double ) - Force the miminum output
-   * gray level to be the supplied value (required if 
-   * output_image is not present).
-   *
-   * @param output_channel_max_level ( double ) - Force the maximum output
-   * gray level to be the supplied value (required if 
-   * output_image is not present).
-   */
-  class PDI_DLL TePDIContrast : public TePDIAlgorithm {
-    public :
-
-      /**
-       * @enum Allowed contrast types.
-       */
-      enum TePDIContrastType{
-        /** The histogram range will be changed to the supplied 
-            min/max range ( linear function ). */
-        TePDIContrastMinMax = 1,
-        /** The histogram will be remapped using a linear function. */
-        TePDIContrastLinear = 2,
-        /** The histogram will be remapped using a square root function. */
-        TePDIContrastSquareRoot = 3,
-        /** The histogram will be remapped using a square function. */
-        TePDIContrastSquare = 4,
-        /** The histogram will be remapped using a logarithmic function. */
-        TePDIContrastLog = 5,
-        /** The histogram will be remapped using a linear inverse function. */
-        TePDIContrastNegative = 6,
-        /** The uniform histogram aproximation. */
-        TePDIContrastHistEqualizer = 7,
-        /** The histogram values will be splitted into slices and linked with
-            a RGB color table. */
-        TePDIContrastSimpleSlicer = 8,
-        /** Image mean and variance uniformization. */
-        TePDIContrastStat = 9
-      };
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIContrast();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIContrast();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-    
-      /**
-       * @brief A pointer to the current generated histogram.
-       */    
-      TePDIHistogram::pointer histo_ptr_;
-
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-
-      /**
-       * @brief Build a min-max look-up table.
-       *
-       * @param channel_min_level The minimum channel possible level value.
-       * @param channel_max_level The maximum channel possible level value.
-       * @param base_lut Base lut.
-       * @return  The look-up table.
-       */
-      TePDITypes::TePDILutType GetMinMaxLut(
-        double channel_min_level, double channel_max_level,
-        TePDITypes::TePDILutType& base_lut );
-
-      /**
-       * @brief Build a Linear look-up table.
-       *
-       * @param min Minimal level value.
-       * @param max Maximum level value.
-       * @param channel_min_level The minimum channel possible level value.
-       * @param channel_max_level The maximum channel possible level value.
-       * @param base_lut Base lut.
-       * @return The look-up table.
-       */
-      TePDITypes::TePDILutType GetLinearLut(
-        TePDITypes::TePDILutType& base_lut,
-        double min, double max,
-        double channel_min_level, double channel_max_level );
-
-      /**
-       * @brief Build a Square Root look-up table.
-       *
-       * @param min Minimal level value.
-       * @param max Maximum level value.
-       * @param channel_min_level The minimum channel possible level value.
-       * @param channel_max_level The maximum channel possible level value.
-       * @param base_lut Base lut.
-       * @return The look-up table.
-       */
-      TePDITypes::TePDILutType GetSquareRootLut(
-        TePDITypes::TePDILutType& base_lut,
-        double min, double max,
-        double channel_min_level, double channel_max_level );
-
-      /**
-       * @brief Build a Square look-up table.
-       *
-       * @param min Minimal level value.
-       * @param max Maximum level value.
-       * @param channel_min_level The minimum channel possible level value.
-       * @param channel_max_level The maximum channel possible level value.
-       * @param base_lut Base lut.
-       * @return The look-up table.
-       */
-      TePDITypes::TePDILutType GetSquareLut(
-        TePDITypes::TePDILutType& base_lut,
-        double min, double max,
-        double channel_min_level, double channel_max_level );
-
-      /**
-       * @brief Build a Log look-up table.
-       *
-       * @param min Minimal level value.
-       * @param max Maximum level value.
-       * @param channel_min_level The minimum channel possible level value.
-       * @param channel_max_level The maximum channel possible level value.
-       * @param base_lut Base lut.
-       * @return The look-up table.
-       */
-      TePDITypes::TePDILutType GetLogLut(
-        TePDITypes::TePDILutType& base_lut,
-        double min, double max,
-        double channel_min_level, double channel_max_level );
-
-      /**
-       * @brief Build a Negative look-up table.
-       *
-       * @param min Minimal level value.
-       * @param max Maximum level value.
-       * @param channel_min_level The minimum channel possible level value.
-       * @param channel_max_level The maximum channel possible level value.
-       * @param base_lut Base lut.
-       * @return The look-up table.
-       */
-      TePDITypes::TePDILutType GetNegativeLut(
-        TePDITypes::TePDILutType& base_lut,
-        double min, double max,
-        double channel_min_level, double channel_max_level );
-
-      /**
-       * @brief Build a Histogram equalizer look-up table.
-       *
-       * @param channel_min_level The minimum channel possible level value.
-       * @param channel_max_level The maximum channel possible level value.       
-       * @param hist A LEVEL-ORDERED Base histogram.
-       * @return The look-up table.
-       */
-      TePDITypes::TePDILutType GetHistEqualizerLut(
-        TePDIHistogram::pointer hist,
-        double channel_min_level, double channel_max_level );
-
-      /**
-       * @brief Builds a Simple slicer look-up table.
-       *
-       * @param hist A LEVEL-ORDERED Base histogram.
-       * @param in_palette The reference RGB palette.
-       * @param min Minimal level value.
-       * @param max Maximum level value.
-       * @param out_lut The look-up table.
-       */
-      void GetSimpleSlicerLut(
-        TePDIHistogram::pointer hist,
-        TePDIRgbPalette::pointer in_palette,
-        double min,
-        double max,
-        TePDITypes::TePDILutType& out_lut );
-        
-      /**
-       * @brief Builds a mean and variance normalization lut.
-       *
-       * @param hist A LEVEL-ORDERED Base histogram.
-       * @param target_mean The target mean value.
-       * @param target_variance The target variance value.
-       * @param channel_min_level The minimum channel possible level value.
-       * @param channel_max_level The maximum channel possible level value.       
-       * @param out_lut The look-up table.
-       */
-      void GetStatLut( TePDIHistogram::pointer hist, double target_mean,
-        double target_variance, double channel_min_level, 
-        double channel_max_level, TePDITypes::TePDILutType& out_lut );        
-        
-      /**
-       * @brief Do level remapping from one raster to another.
-       *
-       * @param inRaster The input Raster.
-       * @param outRaster The Output Raster.
-       * @param lut The increasing level-ordered look-up table.
-       * @param in_channel in_raster channel to remap.
-       * @param out_channel out_raster channel to write on.
-       * @param use_dummy Force a new dummy value use ( input pixels with
-       * dummy values will be ignored ).
-       * @param dummy_value A dummy pixel value for use in pixels where no data 
-       * is available.
-       * @param fixed_step_lut A flag indication of a fixed step lut ( the
-       * internal optimized fixed step algorithm will be used )
-       * @return true if ok, false on errors.
-       */
-      bool RemapLevels(
-        TePDITypes::TePDIRasterPtrType& inRaster,
-        TePDITypes::TePDILutType& lut,
-        int in_channel,
-        int out_channel,
-        TePDITypes::TePDIRasterPtrType& outRaster,
-        bool use_dummy, double dummy_value,
-        bool fixed_step_lut );
-        
-      /**
-       * @brief Do level remapping from one raster to another.
-       *
-       * @note For luts having full channel range (contains mappings
-       * for all possible ordered gray scale values, starting from zero ).
-       *
-       * @param inRaster The input Raster.
-       * @param outRaster The Output Raster.
-       * @param lut The increasing level-ordered look-up table.
-       * @param in_channel in_raster channel to remap.
-       * @param out_channel out_raster channel to write on.
-       * @param use_dummy Force a new dummy value use ( input pixels with
-       * dummy values will be ignored ).
-       * @param dummy_value A dummy pixel value for use in pixels where no data 
-       * is available.
-       * @return true if ok, false on errors.
-       */
-      bool FullRangeLutRemapLevels(
-        TePDITypes::TePDIRasterPtrType& inRaster,
-        TePDITypes::TePDILutType& lut,
-        int in_channel,
-        int out_channel,
-        TePDITypes::TePDIRasterPtrType& outRaster,
-        bool use_dummy, double dummy_value );        
-        
-      /**
-       * @brief Returns a valid histogram using the given algorithm input 
-       * parameters.
-       *
-       * @param hist The generated Histogram.
-       * @return true if ok, false on errors.
-       */        
-      bool getHistogram( TePDIHistogram::pointer& hist );
-      
-      /**
-       * @brief Returns valid dummy base lut from the given algorithm input 
-       * parameters.
-       * @note The dummy lut contains dummy mappings for all grey levels
-       * following the algorithm input parameters.
-       *
-       * @param lut The generated dummy lut.
-       * @param hist_based_lut A false value means the lut has all
-       * possible gray levels ( including the unused ones ), true value means
-       * that the lut was build using the image histogram witch may contain
-       * only the used gray values or the interpolated values.
-       * @return true if ok, false on errors.
-       */        
-      bool getBaseLut( TePDITypes::TePDILutType& lut, bool& hist_based_lut );      
-  };
-  
-/** @example TePDIContrast_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDICONTRAST_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDICONTRAST_HPP
+  #define TEPDICONTRAST_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIRgbPalette.hpp"
+  #include "TePDITypes.hpp"
+  #include <TeSharedPtr.h>
+  #include "TePDIHistogram.hpp"
+
+  /**
+   * @brief  This is the class for contrast image processing algorithms.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIEnhancementGroup
+   *
+   * @note The general input parameters are:
+   *
+   * @param contrast_type ( TePDIContrast::TePDIContrastType ) - The contrast 
+   * to be generated.
+   * @param input_image (TePDITypes::TePDIRasterPtrType) - The input
+   * image.
+   * @param input_band ( int ) - Band to process from input_image.
+   *
+   * @note The specific input parameters ( by parameter type ):
+   *
+   * @param min_level (double) - Minimal level for Linear Luts.
+   * Required by: TePDIContrastLinear, TePDIContrastSquareRoot,
+   * TePDIContrastSquare, TePDIContrastLog, TePDIContrastNegative,
+   * TePDIContrastSimpleSlicer.
+   *
+   * @param max_level (double) - Minimal level for Linear Luts.
+   * Required by: TePDIContrastLinear, TePDIContrastSquareRoot,
+   * TePDIContrastSquare, TePDIContrastLog, TePDIContrastNegative,
+   * TePDIContrastSimpleSlicer.
+   *
+   * @param rgb_palette (TePDIRgbPalette::pointer) -
+   * Reference RGB palette.
+   * Required by: TePDIContrastSimpleSlicer.
+   *
+   * @param target_mean ( double ) - The target mean value.
+   * Required by: TePDIContrastStat.
+   *
+   * @param target_variance ( double ) - The target variance value.
+   * Required by: TePDIContrastStat.
+   *
+   * @note The following parameters are optional and will be used if present.
+   *
+   * @param output_image ( TePDITypes::TePDIRasterPtrType ) -
+   * The output image ( if not present, only the output LUT will be
+   * generated ).   
+   *
+   * @param output_band ( int ) - Band to save the result inside output_image
+   * (required if output_image is present).
+   *
+   * @param restrict_out_reset (int) - If present (any value),
+   * a restrictive output_image reset will be done
+   * ( output_image reset will not be done if all of the following 
+   * conditions are satisfied - Exact number of lines, exact number
+   * of columns, sufficient number of bands, same projection, same box,
+   * dummy value ), 
+   * this allows output_image data keeping since
+   * unused bands are not changed.
+   *
+   * @param outlut ( TePDITypes::TePDILutPtrType ) - The generated look-up
+   * table. NOTE: If the current input_image has floating point pixel values,
+   * the generated look-up table will have interpolated values.
+   *
+   * @param input_histogram ( TePDIHistogram::pointer ) - A pointer to an
+   * active histogram instance that will be used when generating the
+   * internal lut - The internal histogram generation will be disabled.
+   *
+   * @param output_original_histogram ( TePDIHistogram::pointer ) - A 
+   * pointer to an active output histogram instance that will be filled 
+   * with the internally generated histogram from the input image or
+   * using the supplied input histogram.
+   *
+   * @param output_enhanced_histogram ( TePDIHistogram::pointer ) - A 
+   * pointer to an active output histogram instance that will be filled 
+   * with the internally generated histogram from the input image or
+   * using the supplied input histogram.   
+   *
+   * @param histo_levels (int) - Number of histogram levels when internal
+   * histogram generation is needed ( if zero, the histogram levels
+   * will be automatically found. In this case, for floating point rasters the
+   * number of levels will be always 256 ).
+   *
+   * @param dummy_value (double) - A dummy pixel value for use 
+   * in pixels where no data is available.    
+   *
+   * @param input_mean ( double ) - Force the algorithm to use the supplied
+   * value as mean for the current raster (The internal mean calcule will
+   * be disabled ).
+   * Used by: TePDIContrastStat.
+   *
+   * @param input_variance ( double ) - Force the algorithm to use the supplied
+   * value as variance for the current raster ( The internal variance calcule
+   * will be disabled ).
+   * Used by: TePDIContrastStat.      
+   *
+   * @param output_channel_min_level ( double ) - Force the miminum output
+   * gray level to be the supplied value (required if 
+   * output_image is not present).
+   *
+   * @param output_channel_max_level ( double ) - Force the maximum output
+   * gray level to be the supplied value (required if 
+   * output_image is not present).
+   */
+  class PDI_DLL TePDIContrast : public TePDIAlgorithm {
+    public :
+
+      /**
+       * @enum Allowed contrast types.
+       */
+      enum TePDIContrastType{
+        /** The histogram range will be changed to the supplied 
+            min/max range ( linear function ). */
+        TePDIContrastMinMax = 1,
+        /** The histogram will be remapped using a linear function. */
+        TePDIContrastLinear = 2,
+        /** The histogram will be remapped using a square root function. */
+        TePDIContrastSquareRoot = 3,
+        /** The histogram will be remapped using a square function. */
+        TePDIContrastSquare = 4,
+        /** The histogram will be remapped using a logarithmic function. */
+        TePDIContrastLog = 5,
+        /** The histogram will be remapped using a linear inverse function. */
+        TePDIContrastNegative = 6,
+        /** The uniform histogram aproximation. */
+        TePDIContrastHistEqualizer = 7,
+        /** The histogram values will be splitted into slices and linked with
+            a RGB color table. */
+        TePDIContrastSimpleSlicer = 8,
+        /** Image mean and variance uniformization. */
+        TePDIContrastStat = 9
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIContrast();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIContrast();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+    
+      /**
+       * @brief A pointer to the current generated histogram.
+       */    
+      TePDIHistogram::pointer histo_ptr_;
+
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+
+      /**
+       * @brief Build a min-max look-up table.
+       *
+       * @param channel_min_level The minimum channel possible level value.
+       * @param channel_max_level The maximum channel possible level value.
+       * @param base_lut Base lut.
+       * @return  The look-up table.
+       */
+      TePDITypes::TePDILutType GetMinMaxLut(
+        double channel_min_level, double channel_max_level,
+        TePDITypes::TePDILutType& base_lut );
+
+      /**
+       * @brief Build a Linear look-up table.
+       *
+       * @param min Minimal level value.
+       * @param max Maximum level value.
+       * @param channel_min_level The minimum channel possible level value.
+       * @param channel_max_level The maximum channel possible level value.
+       * @param base_lut Base lut.
+       * @return The look-up table.
+       */
+      TePDITypes::TePDILutType GetLinearLut(
+        TePDITypes::TePDILutType& base_lut,
+        double min, double max,
+        double channel_min_level, double channel_max_level );
+
+      /**
+       * @brief Build a Square Root look-up table.
+       *
+       * @param min Minimal level value.
+       * @param max Maximum level value.
+       * @param channel_min_level The minimum channel possible level value.
+       * @param channel_max_level The maximum channel possible level value.
+       * @param base_lut Base lut.
+       * @return The look-up table.
+       */
+      TePDITypes::TePDILutType GetSquareRootLut(
+        TePDITypes::TePDILutType& base_lut,
+        double min, double max,
+        double channel_min_level, double channel_max_level );
+
+      /**
+       * @brief Build a Square look-up table.
+       *
+       * @param min Minimal level value.
+       * @param max Maximum level value.
+       * @param channel_min_level The minimum channel possible level value.
+       * @param channel_max_level The maximum channel possible level value.
+       * @param base_lut Base lut.
+       * @return The look-up table.
+       */
+      TePDITypes::TePDILutType GetSquareLut(
+        TePDITypes::TePDILutType& base_lut,
+        double min, double max,
+        double channel_min_level, double channel_max_level );
+
+      /**
+       * @brief Build a Log look-up table.
+       *
+       * @param min Minimal level value.
+       * @param max Maximum level value.
+       * @param channel_min_level The minimum channel possible level value.
+       * @param channel_max_level The maximum channel possible level value.
+       * @param base_lut Base lut.
+       * @return The look-up table.
+       */
+      TePDITypes::TePDILutType GetLogLut(
+        TePDITypes::TePDILutType& base_lut,
+        double min, double max,
+        double channel_min_level, double channel_max_level );
+
+      /**
+       * @brief Build a Negative look-up table.
+       *
+       * @param min Minimal level value.
+       * @param max Maximum level value.
+       * @param channel_min_level The minimum channel possible level value.
+       * @param channel_max_level The maximum channel possible level value.
+       * @param base_lut Base lut.
+       * @return The look-up table.
+       */
+      TePDITypes::TePDILutType GetNegativeLut(
+        TePDITypes::TePDILutType& base_lut,
+        double min, double max,
+        double channel_min_level, double channel_max_level );
+
+      /**
+       * @brief Build a Histogram equalizer look-up table.
+       *
+       * @param channel_min_level The minimum channel possible level value.
+       * @param channel_max_level The maximum channel possible level value.       
+       * @param hist A LEVEL-ORDERED Base histogram.
+       * @return The look-up table.
+       */
+      TePDITypes::TePDILutType GetHistEqualizerLut(
+        TePDIHistogram::pointer hist,
+        double channel_min_level, double channel_max_level );
+
+      /**
+       * @brief Builds a Simple slicer look-up table.
+       *
+       * @param hist A LEVEL-ORDERED Base histogram.
+       * @param in_palette The reference RGB palette.
+       * @param min Minimal level value.
+       * @param max Maximum level value.
+       * @param out_lut The look-up table.
+       */
+      void GetSimpleSlicerLut(
+        TePDIHistogram::pointer hist,
+        TePDIRgbPalette::pointer in_palette,
+        double min,
+        double max,
+        TePDITypes::TePDILutType& out_lut );
+        
+      /**
+       * @brief Builds a mean and variance normalization lut.
+       *
+       * @param hist A LEVEL-ORDERED Base histogram.
+       * @param target_mean The target mean value.
+       * @param target_variance The target variance value.
+       * @param channel_min_level The minimum channel possible level value.
+       * @param channel_max_level The maximum channel possible level value.       
+       * @param out_lut The look-up table.
+       */
+      void GetStatLut( TePDIHistogram::pointer hist, double target_mean,
+        double target_variance, double channel_min_level, 
+        double channel_max_level, TePDITypes::TePDILutType& out_lut );        
+        
+      /**
+       * @brief Do level remapping from one raster to another.
+       *
+       * @param inRaster The input Raster.
+       * @param outRaster The Output Raster.
+       * @param lut The increasing level-ordered look-up table.
+       * @param in_channel in_raster channel to remap.
+       * @param out_channel out_raster channel to write on.
+       * @param use_dummy Force a new dummy value use ( input pixels with
+       * dummy values will be ignored ).
+       * @param dummy_value A dummy pixel value for use in pixels where no data 
+       * is avaliable.
+       * @param fixed_step_lut A flag indication of a fixed step lut ( the
+       * internal optimized fixed step algorithm will be used )
+       * @return true if ok, false on errors.
+       */
+      bool RemapLevels(
+        TePDITypes::TePDIRasterPtrType& inRaster,
+        TePDITypes::TePDILutType& lut,
+        int in_channel,
+        int out_channel,
+        TePDITypes::TePDIRasterPtrType& outRaster,
+        bool use_dummy, double dummy_value,
+        bool fixed_step_lut );
+        
+      /**
+       * @brief Do level remapping from one raster to another.
+       *
+       * @note For luts having full channel range (contains mappings
+       * for all possible ordered gray scale values, starting from zero ).
+       *
+       * @param inRaster The input Raster.
+       * @param outRaster The Output Raster.
+       * @param lut The increasing level-ordered look-up table.
+       * @param in_channel in_raster channel to remap.
+       * @param out_channel out_raster channel to write on.
+       * @param use_dummy Force a new dummy value use ( input pixels with
+       * dummy values will be ignored ).
+       * @param dummy_value A dummy pixel value for use in pixels where no data 
+       * is available.
+       * @return true if ok, false on errors.
+       */
+      bool FullRangeLutRemapLevels(
+        TePDITypes::TePDIRasterPtrType& inRaster,
+        TePDITypes::TePDILutType& lut,
+        int in_channel,
+        int out_channel,
+        TePDITypes::TePDIRasterPtrType& outRaster,
+        bool use_dummy, double dummy_value );        
+        
+      /**
+       * @brief Returns a valid histogram using the given algorithm input 
+       * parameters.
+       *
+       * @param hist The generated Histogram.
+       * @param useDummy A flag indicating when a dummy value must be used.
+       * @param dummyValue The dummy value that must be used.
+       * @return true if ok, false on errors.
+       */        
+      bool getHistogram( TePDIHistogram::pointer& hist, bool useDummy,
+        double dummyValue );
+      
+      /**
+       * @brief Returns valid dummy base lut from the given algorithm input 
+       * parameters.
+       * @note The dummy lut contains dummy mappings for all grey levels
+       * following the algorithm input parameters.
+       *
+       * @param lut The generated dummy lut.
+       * @param hist_based_lut This parameter will be false if the generated
+       * lut has all possible gray levels ( including the unused ones ), 
+       * true value means that the lut was build using the image histogram 
+       * wich may contain only the used gray values or the interpolated values.
+       * @param useDummy A flag indicating when a dummy value must be used.
+       * @param dummyValue The dummy value that must be used.       
+       * @return true if ok, false on errors.
+       */        
+      bool getBaseLut( TePDITypes::TePDILutType& lut, bool& hist_based_lut,
+        bool useDummy, double dummyValue );      
+  };
+  
+/** @example TePDIContrast_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDICONTRAST_HPP
diff --git a/src/terralib/image_processing/TePDIContrastFactory.cpp b/src/terralib/image_processing/TePDIContrastFactory.cpp
old mode 100755
new mode 100644
index e630fac..409e646
--- a/src/terralib/image_processing/TePDIContrastFactory.cpp
+++ b/src/terralib/image_processing/TePDIContrastFactory.cpp
@@ -1,24 +1,24 @@
- 
-#include "TePDIContrastFactory.hpp"
-#include "TePDIContrast.hpp"
-#include <TeAgnostic.h>
-
-TePDIContrastFactory::TePDIContrastFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIContrast" ) )
-{
-};      
-
-TePDIContrastFactory::~TePDIContrastFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIContrastFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIContrast();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIContrastFactory.hpp"
+#include "TePDIContrast.hpp"
+#include <TeAgnostic.h>
+
+TePDIContrastFactory::TePDIContrastFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIContrast" ) )
+{
+};      
+
+TePDIContrastFactory::~TePDIContrastFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIContrastFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIContrast();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIContrastFactory.hpp b/src/terralib/image_processing/TePDIContrastFactory.hpp
old mode 100755
new mode 100644
index c41748d..a985908
--- a/src/terralib/image_processing/TePDIContrastFactory.hpp
+++ b/src/terralib/image_processing/TePDIContrastFactory.hpp
@@ -1,67 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDICONTRASTFACTORY_HPP
-  #define TEPDICONTRASTFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for contrast algorithms factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIContrastFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIContrastFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIContrastFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-  
-  namespace {
-    static TePDIContrastFactory TePDIContrastFactory_instance;
-  };  
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDICONTRASTFACTORY_HPP
+  #define TEPDICONTRASTFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for contrast algorithms factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIContrastFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIContrastFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIContrastFactory();
+      
+      protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+  
+  namespace {
+    static TePDIContrastFactory TePDIContrastFactory_instance;
+  };  
+
+#endif
diff --git a/src/terralib/image_processing/TePDICorrelationMatching.cpp b/src/terralib/image_processing/TePDICorrelationMatching.cpp
index cf7a023..7e30613 100644
--- a/src/terralib/image_processing/TePDICorrelationMatching.cpp
+++ b/src/terralib/image_processing/TePDICorrelationMatching.cpp
@@ -1,1027 +1,1287 @@
-#include "TePDICorrelationMatching.hpp"
-
-#include "TePDIUtils.hpp"
-
-#include <TeThreadFunctor.h>
-#include <TeMutex.h>
-#include <TeCoord2D.h>
-
-#include <math.h>
-
-
-TePDICorrelationMatching::TePDICorrelationMatching()
-{
-}
-
-
-TePDICorrelationMatching::~TePDICorrelationMatching()
-{
-}
-
-
-bool TePDICorrelationMatching::RunImplementation()
-{
-  /* Retriving Parameters */
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  params_.GetParameter( "input_image1_ptr", input_image1_ptr );  
-  
-  unsigned int input_channel1 = 0;
-  params_.GetParameter( "input_channel1", input_channel1 );   
-  
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  params_.GetParameter( "input_image2_ptr", input_image2_ptr );  
-  
-  unsigned int input_channel2 = 0;
-  params_.GetParameter( "input_channel2", input_channel2 );   
-
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
-  params_.GetParameter( "out_tie_points_ptr", out_tie_points_ptr );   
-  
-  TeBox input_box1;
-  if( params_.CheckParameter< TeBox >( "input_box1" ) ) {
-    params_.GetParameter( "input_box1", input_box1 );
-  } else {
-    TeBox input_box1_proj = input_image1_ptr->params().box();
-    
-    TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, input_image1_ptr,
-      input_box1 );
-  }
-  
-  TeBox input_box2;
-  if( params_.CheckParameter< TeBox >( "input_box2" ) ) {
-    params_.GetParameter( "input_box2", input_box2 );
-  } else {
-    TeBox input_box2_proj = input_image2_ptr->params().box();
-    
-    TePDIUtils::MapCoords2RasterIndexes( input_box2_proj, input_image2_ptr,
-      input_box2 );
-  }  
-  
-  bool enable_multi_thread = false;
-  if( params_.CheckParameter< int >( "enable_multi_thread" ) ) {
-    enable_multi_thread = true;
-  }
-  
-  double pixel_x_relation = 1.0;
-  if( params_.CheckParameter< double >( "pixel_x_relation" ) ) {
-    params_.GetParameter( "pixel_x_relation", pixel_x_relation );
-  }
-  
-  double pixel_y_relation = 1.0;
-  if( params_.CheckParameter< double >( "pixel_y_relation" ) ) {
-    params_.GetParameter( "pixel_y_relation", pixel_y_relation );
-  }  
-  
-  unsigned int max_size_opt = 0;
-  if( params_.CheckParameter< unsigned int >( "max_size_opt" ) ) {
-    params_.GetParameter( "max_size_opt", max_size_opt );
-  }   
-  
-  /* Calculating the number of allowed threads - this process
-     not included into the count */
-     
-  unsigned int max_threads = 0;
-  std::vector< TeThreadFunctor::pointer > threads_vector;
-  
-  if( enable_multi_thread ) {
-    max_threads = TeGetPhysProcNumber() - 1;
-    
-    for( unsigned int index = 0 ; index < max_threads ; ++index ) {
-      TeThreadFunctor::pointer aux_thread_ptr( new TeThreadFunctor );
-    
-      threads_vector.push_back( aux_thread_ptr );
-    }
-  }
-  
-  /* Calculating the box postion related values */
-  
-  const unsigned int orig_box1_x_off = (unsigned int)input_box1.lowerLeft().x();
-  const unsigned int orig_box1_y_off = (unsigned int)input_box1.upperRight().y();
-  const unsigned int orig_box1_nlines = 1 + (unsigned int)ABS( input_box1.height() );
-  const unsigned int orig_box1_ncols = 1 + (unsigned int)ABS( input_box1.width() );
-  
-  const unsigned int orig_box2_x_off = (unsigned int)input_box2.lowerLeft().x();
-  const unsigned int orig_box2_y_off = (unsigned int)input_box2.upperRight().y();
-  const unsigned int orig_box2_nlines = 1 + (unsigned int)ABS( input_box2.height() );
-  const unsigned int orig_box2_ncols = 1 + (unsigned int)ABS( input_box2.width() );
-    
-  /* Calculating the rescale factors 
-     rescaled_image = original_image * rescale_factor */
-  
-  double img1_x_rescale_factor = 1.0;
-  double img1_y_rescale_factor = 1.0;
-  double img2_x_rescale_factor = 1.0;
-  double img2_y_rescale_factor = 1.0;
-  {
-    double mean_pixel_relation = ( pixel_x_relation + pixel_y_relation ) /
-      2.0;
-      
-    if( mean_pixel_relation > 1.0 ) {
-      /* The image 1 has poor resolution - bigger pixel resolution values -
-         and image 2 needs to be rescaled down */
-      
-      img2_x_rescale_factor = 1.0 / pixel_x_relation;
-      img2_y_rescale_factor = 1.0 / pixel_y_relation;
-    } else if( mean_pixel_relation < 1.0 ) {
-      /* The image 2 has poor resolution - bigger pixel resolution values
-        and image 1 needs to be rescaled down */
-      
-      img1_x_rescale_factor = pixel_x_relation;
-      img1_y_rescale_factor = pixel_y_relation;
-    }
-  } 
-  
-  if( max_size_opt )
-  {
-    double resc_box1_size = 
-      ( (double)orig_box1_nlines  ) * img1_y_rescale_factor *
-      ( (double)orig_box1_ncols ) * img1_x_rescale_factor;
-    double resc_box2_size = 
-      ( (double)orig_box2_nlines  ) * img2_y_rescale_factor *
-      ( (double)orig_box2_ncols ) * img2_x_rescale_factor;
-    double max_size_opt_double = (double)max_size_opt;
-    
-    if( ( resc_box1_size > max_size_opt_double ) || 
-      ( resc_box2_size > max_size_opt_double ) )
-    {
-      double opt_rescale_factor = 1.0;
-      
-      if( resc_box1_size > resc_box2_size )
-      {
-        opt_rescale_factor = sqrt( resc_box1_size / max_size_opt_double );
-      }
-      else
-      {
-        opt_rescale_factor = sqrt( resc_box2_size / max_size_opt_double );
-      }
-      
-      img1_x_rescale_factor *= opt_rescale_factor;
-      img1_y_rescale_factor *= opt_rescale_factor;
-      img2_x_rescale_factor *= opt_rescale_factor;
-      img2_y_rescale_factor *= opt_rescale_factor;
-    }
-  }
-  
-  /* Checking if the small matrix fits inside the bigger one */
-  
-  {
-    unsigned int resc_box1_nlines = (unsigned int) ceil( 
-      ( (double)orig_box1_nlines ) * img1_y_rescale_factor );
-    unsigned int resc_box1_ncols = (unsigned int) ceil( 
-      ( (double)orig_box1_ncols ) * img1_x_rescale_factor );     
-    unsigned int resc_box2_nlines = (unsigned int) ceil( 
-      ( (double)orig_box2_nlines ) * img2_y_rescale_factor );
-    unsigned int resc_box2_ncols = (unsigned int) ceil( 
-      ( (double)orig_box2_ncols ) * img2_x_rescale_factor );   
-        
-    const unsigned int m1size = resc_box1_nlines * 
-      resc_box1_ncols;
-    const unsigned int m2size = resc_box2_nlines * 
-      resc_box2_ncols;      
-      
-    if( m1size < m2size )
-    {
-      if( ( resc_box1_ncols > resc_box2_ncols ) ||
-        ( resc_box1_nlines > resc_box2_nlines ) )
-      {
-        return true;
-      }
-    } 
-    else
-    {
-      if( ( resc_box2_ncols > resc_box1_ncols ) ||
-        ( resc_box2_nlines > resc_box1_nlines ) )
-      {
-        return true;
-      }    
-    }
-  }  
-  
-  /* Loading images */
-  
-  TeMutex glb_mem_lock; //global memory lock
-  
-  ImgMatrixT img1_matrix;
-  ImgMatrixT img2_matrix;
- 
-  {
-    TeThreadParameters tparams1;
-    tparams1.store( "input_image_ptr", input_image1_ptr );
-    tparams1.store( "img_matrix_ptr", &img1_matrix );
-    tparams1.store( "img_x_rescale_factor", img1_x_rescale_factor );
-    tparams1.store( "img_y_rescale_factor", img1_y_rescale_factor );
-    tparams1.store( "box_x_off", orig_box1_x_off );
-    tparams1.store( "box_y_off", orig_box1_y_off );
-    tparams1.store( "box_nlines", orig_box1_nlines );
-    tparams1.store( "box_ncols", orig_box1_ncols );
-    tparams1.store( "input_channel", input_channel1 );
-    tparams1.store( "progress_enabled", progress_enabled_ );
-    tparams1.store( "glb_mem_lock_ptr", &glb_mem_lock );
-    
-    TeThreadParameters tparams2;
-    tparams2.store( "input_image_ptr", input_image2_ptr );
-    tparams2.store( "img_matrix_ptr", &img2_matrix );
-    tparams2.store( "img_x_rescale_factor", img2_x_rescale_factor );
-    tparams2.store( "img_y_rescale_factor", img2_y_rescale_factor );
-    tparams2.store( "box_x_off", orig_box2_x_off );
-    tparams2.store( "box_y_off", orig_box2_y_off );
-    tparams2.store( "box_nlines", orig_box2_nlines );
-    tparams2.store( "box_ncols", orig_box2_ncols );
-    tparams2.store( "input_channel", input_channel2 );
-    tparams2.store( "progress_enabled", progress_enabled_ );
-    tparams2.store( "glb_mem_lock_ptr", &glb_mem_lock );
-  
-    if( max_threads > 0 ) {
-      threads_vector[ 0 ]->setStartFunctPtr( loadImage );
-      threads_vector[ 0 ]->setParameters( tparams1 );
-      threads_vector[ 0 ]->start();
-   
-      if( ! loadImage( tparams2 ) ) {
-        threads_vector[ 0 ]->waitToFinish();
-        
-        TEAGN_LOG_AND_RETURN( "Unable to load image 2" )
-      } else {
-        threads_vector[ 0 ]->waitToFinish();
-        
-        TEAGN_TRUE_OR_RETURN( threads_vector[ 0 ]->getReturnValue(),
-          "Unable to load image 1" )
-      }
-    } else {
-      TEAGN_TRUE_OR_RETURN( loadImage( tparams1 ),
-        "Error loading image 1" )
-      TEAGN_TRUE_OR_RETURN( loadImage( tparams2 ),
-        "Error loading image 2" )
-    }
-  }
-  
-/* remove */        
-//matrix2Tiff( img1_matrix, "img1_matrix.tif", 
-//  std::vector< TeCoord2D >() );
-//matrix2Tiff( img2_matrix, "img2_matrix.tif",
-//  std::vector< TeCoord2D >() );
-/* remove */  
-  
-  /* Correlating areas */
-  
-  out_tie_points_ptr->clear();
-  
-  {
-    /* Switching the big and small matrixes */
-    
-    const unsigned int m1size = img1_matrix.GetColumns() * 
-      img1_matrix.GetLines();
-    const unsigned int m2size = img2_matrix.GetColumns() * 
-      img2_matrix.GetLines();      
-    
-    ImgMatrixT* big_matrix_ptr = 0;
-    ImgMatrixT* small_matrix_ptr = 0;
-      
-    if( m1size < m2size )
-    {
-      big_matrix_ptr = &img2_matrix;
-      small_matrix_ptr = &img1_matrix;
-    } 
-    else
-    {
-      big_matrix_ptr = &img1_matrix;
-      small_matrix_ptr = &img2_matrix;
-    }
-    
-    ImgMatrixT& big_matrix = *big_matrix_ptr;
-    ImgMatrixT& small_matrix = *small_matrix_ptr;
-    
-    const unsigned int small_mtx_lines = small_matrix.GetLines();
-    const unsigned int small_mtx_cols = small_matrix.GetColumns();    
-    
-    /* Iterating over each small matrix position over the bigger one */
-    
-    const unsigned int big_mtx_lines_bound = big_matrix.GetLines() -
-      small_mtx_lines;
-    const unsigned int big_mtx_cols_bound = big_matrix.GetColumns() -
-      small_mtx_cols;
-      
-    unsigned int big_mtx_line = 0;
-    unsigned int big_mtx_col = 0;
-    unsigned int small_mtx_line = 0;
-    unsigned int small_mtx_col = 0;
-    
-    double best_cor_value = (-1.0) * DBL_MAX;
-    unsigned int best_cor_bm_line = 0; /* UL point over big matrix */
-    unsigned int best_cor_bm_col = 0; /* UL point over big matrix */
-
-    double* big_matrix_line_ptr = 0;
-    double* small_matrix_line_ptr = 0;
-    
-    double sbsum = 0;
-    double ssum = 0;
-    double bsum = 0;
-    double spow2sum = 0;
-    double bpow2sum = 0;
-    const double elemsnmb = (double)( small_mtx_lines *
-       small_mtx_cols );
-       
-    double curr_cor_value = 0;
-        
-    TePDIPIManager progress( "Looking for the best correlation", 
-      big_mtx_lines_bound, progress_enabled_ );
-        
-    for( ; big_mtx_line < big_mtx_lines_bound ; ++big_mtx_line )
-    {
-      for( big_mtx_col = 0 ; big_mtx_col < big_mtx_cols_bound ; 
-        ++big_mtx_col )
-      {
-        sbsum = 0;
-        ssum = 0;
-        bsum = 0;
-        spow2sum = 0;
-        bpow2sum = 0;
-        
-        for( small_mtx_line = 0 ; small_mtx_line < small_mtx_lines ;
-          ++small_mtx_line )
-        {
-          big_matrix_line_ptr = big_matrix[ big_mtx_line + 
-            small_mtx_line ];
-          small_matrix_line_ptr = small_matrix[ small_mtx_line ];
-          
-          for( small_mtx_col = 0 ; small_mtx_col < small_mtx_cols ;
-            ++small_mtx_col )
-          {
-            const double& smelem = small_matrix_line_ptr[ 
-              small_mtx_col ];
-            const double& bmelem = big_matrix_line_ptr[
-              big_mtx_col + small_mtx_col ];
-              
-            sbsum += ( smelem * bmelem );
-            ssum += smelem;
-            bsum += bmelem;
-            spow2sum += ( smelem * smelem );
-            bpow2sum += ( bmelem * bmelem );
-          }
-        }
-        
-        curr_cor_value = ( ( elemsnmb * sbsum ) - ( ssum * bsum ) ) /
-          ( sqrt( ( elemsnmb * spow2sum ) - ( ssum * ssum ) ) * 
-          sqrt( ( elemsnmb * bpow2sum ) - ( bsum * bsum ) ) );
-          
-        if( curr_cor_value > best_cor_value )
-        {
-          best_cor_value = curr_cor_value;
-          best_cor_bm_line = big_mtx_line;
-          best_cor_bm_col = big_mtx_col;
-        }
-      }
-      
-      TEAGN_FALSE_OR_RETURN( progress.Increment(),
-        "Canceled by the user" );
-    }
-    
-    /* Copy the best correlation value to user output var */
-    
-    double* best_cor_value_ptr = 0;
-    if( params_.CheckParameter< double* >( "best_cor_value_ptr" ) ) {
-      params_.GetParameter( "best_cor_value_ptr", best_cor_value_ptr );
-      (*best_cor_value_ptr) = best_cor_value;
-    }      
-    
-    /* Generating tie-points */
-    
-    TeCoord2D ulpoint_img1;
-    TeCoord2D urpoint_img1;
-    TeCoord2D llpoint_img1;
-    TeCoord2D lrpoint_img1;
-    
-    TeCoord2D ulpoint_img2;
-    TeCoord2D urpoint_img2;
-    TeCoord2D llpoint_img2;
-    TeCoord2D lrpoint_img2;
-    
-    if( m1size < m2size )
-    {
-      ulpoint_img1.setXY( 0 , 0 );
-      llpoint_img1.setXY( 0, img1_matrix.GetLines() - 1 );
-      urpoint_img1.setXY( img1_matrix.GetColumns() - 1 , 0 );
-      lrpoint_img1.setXY( img1_matrix.GetColumns() - 1,
-        img1_matrix.GetLines() - 1 );
-        
-      ulpoint_img2.setXY( best_cor_bm_col, best_cor_bm_line );
-      llpoint_img2.setXY( 
-        best_cor_bm_col,
-        best_cor_bm_line + img1_matrix.GetLines() - 1 );
-      urpoint_img2.setXY( 
-        best_cor_bm_col + img1_matrix.GetColumns() - 1,
-        best_cor_bm_line );
-      lrpoint_img2.setXY( 
-        best_cor_bm_col + img1_matrix.GetColumns() - 1,
-        best_cor_bm_line + img1_matrix.GetLines() - 1 );
-    } 
-    else
-    {
-      ulpoint_img2.setXY( 0 , 0 );
-      llpoint_img2.setXY( 0, img2_matrix.GetLines() - 1 );
-      urpoint_img2.setXY( img2_matrix.GetColumns() - 1 , 0 );
-      lrpoint_img2.setXY( img2_matrix.GetColumns() - 1,
-        img2_matrix.GetLines() - 1 );
-        
-      ulpoint_img1.setXY( best_cor_bm_col, best_cor_bm_line );
-      llpoint_img1.setXY( 
-        best_cor_bm_col,
-        best_cor_bm_line + img2_matrix.GetLines() - 1 );
-      urpoint_img1.setXY( 
-        best_cor_bm_col + img2_matrix.GetColumns() - 1,
-        best_cor_bm_line );
-      lrpoint_img1.setXY( 
-        best_cor_bm_col + img2_matrix.GetColumns() - 1,
-        best_cor_bm_line + img2_matrix.GetLines() - 1 );        
-    }
-    
-        
-    /* Bringing points into input_image1_ptr 
-       reference */
-       
-    ulpoint_img1.setXY( 
-      ( ulpoint_img1.x() / img1_x_rescale_factor ) +
-      ( (double)orig_box1_x_off ),
-      ( ulpoint_img1.y() / img1_y_rescale_factor ) +
-      ( (double)orig_box1_y_off ) );
-    urpoint_img1.setXY( 
-      ( urpoint_img1.x() / img1_x_rescale_factor ) +
-      ( (double)orig_box1_x_off ),
-      ( urpoint_img1.y() / img1_y_rescale_factor ) +
-      ( (double)orig_box1_y_off ) );
-    llpoint_img1.setXY( 
-      ( llpoint_img1.x() / img1_x_rescale_factor ) +
-      ( (double)orig_box1_x_off ),
-      ( llpoint_img1.y() / img1_y_rescale_factor ) +
-      ( (double)orig_box1_y_off ) );
-    lrpoint_img1.setXY( 
-      ( lrpoint_img1.x() / img1_x_rescale_factor ) +
-      ( (double)orig_box1_x_off ),
-      ( lrpoint_img1.y() / img1_y_rescale_factor ) +
-      ( (double)orig_box1_y_off ) );                  
-
-    /* Bringing points into input_image2_ptr 
-       reference */
-   
-    ulpoint_img2.setXY( 
-      ( ulpoint_img2.x() / img2_x_rescale_factor ) +
-      ( (double)orig_box2_x_off ),
-      ( ulpoint_img2.y() / img2_y_rescale_factor ) +
-      ( (double)orig_box2_y_off ) );
-    urpoint_img2.setXY( 
-      ( urpoint_img2.x() / img2_x_rescale_factor ) +
-      ( (double)orig_box2_x_off ),
-      ( urpoint_img2.y() / img2_y_rescale_factor ) +
-      ( (double)orig_box2_y_off ) );
-    llpoint_img2.setXY( 
-      ( llpoint_img2.x() / img2_x_rescale_factor ) +
-      ( (double)orig_box2_x_off ),
-      ( llpoint_img2.y() / img2_y_rescale_factor ) +
-      ( (double)orig_box2_y_off ) );
-    lrpoint_img2.setXY( 
-      ( lrpoint_img2.x() / img2_x_rescale_factor ) +
-      ( (double)orig_box2_x_off ),
-      ( lrpoint_img2.y() / img2_y_rescale_factor ) +
-      ( (double)orig_box2_y_off ) );  
-         
-    /* Generating output tie-points */
-    
-    out_tie_points_ptr->push_back( TeCoordPair( ulpoint_img1,
-      ulpoint_img2 ) );
-    out_tie_points_ptr->push_back( TeCoordPair( urpoint_img1,
-      urpoint_img2 ) );
-    out_tie_points_ptr->push_back( TeCoordPair( llpoint_img1,
-      llpoint_img2 ) );
-    out_tie_points_ptr->push_back( TeCoordPair( lrpoint_img1,
-      lrpoint_img2 ) );
-      
-    TEAGN_DEBUG_CONDITION( checkTPs( *out_tie_points_ptr ),
-      "Invalid tie-points" )                     
-  }
-  
-  return true;
-}
-
-
-bool TePDICorrelationMatching::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking input_image1_ptr */
-    
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_image1_ptr", input_image1_ptr ),
-    "Missing parameter: input_image1_ptr" );
-  TEAGN_TRUE_OR_RETURN( input_image1_ptr.isActive(),
-    "Invalid parameter: input_image1_ptr inactive" );
-  TEAGN_TRUE_OR_RETURN( input_image1_ptr->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: input_image1_ptr not ready" );
-    
-  /* Checking input_channel1 */
-    
-  unsigned int input_channel1 = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_channel1", input_channel1 ),
-    "Missing parameter: input_channel1" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( (int)input_channel1 ) < 
-    input_image1_ptr->params().nBands() ),
-    "Invalid parameter: input_channel1" );
-  
-    
-  /* Checking input_image1_ptr */
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_image2_ptr", input_image2_ptr ),
-    "Missing parameter: input_image2_ptr" );
-  TEAGN_TRUE_OR_RETURN( input_image2_ptr.isActive(),
-    "Invalid parameter: input_image2_ptr inactive" );
-  TEAGN_TRUE_OR_RETURN( input_image2_ptr->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: input_image2_ptr not ready" );    
-    
-  /* Checking input_channel2 */
-    
-  unsigned int input_channel2 = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_channel2", input_channel2 ),
-    "Missing parameter: input_channel2" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( (int)input_channel2 ) < 
-    input_image2_ptr->params().nBands() ),
-    "Invalid parameter: input_channel2" );
-    
-  /* Checking out_tie_points_ptr */
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "out_tie_points_ptr", out_tie_points_ptr ),
-    "Missing parameter: out_tie_points_ptr" );
-  TEAGN_TRUE_OR_RETURN( out_tie_points_ptr.isActive(),
-    "Invalid parameter: out_tie_points_ptr inactive" );
-    
-  /* Checking input_box1 */
-    
-  TeBox input_box1;
-  if( parameters.CheckParameter< TeBox >( "input_box1" ) ) {
-    parameters.GetParameter( "input_box1", input_box1 );
-    
-    TEAGN_TRUE_OR_RETURN( ( input_box1.x1() >= 0 ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( ( input_box1.x2() >= 0 ),
-      "Invalid parameter : input_box1" )      
-    TEAGN_TRUE_OR_RETURN( ( input_box1.y1() >= 0 ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( ( input_box1.y2() >= 0 ),
-      "Invalid parameter : input_box1" )         
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.x1() <= 
-        ( input_image1_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.x2() <= 
-        ( input_image1_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box1" )       
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.y1() <= 
-        ( input_image1_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.y2() <= 
-        ( input_image1_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box1" )        
-  }
-    
-  /* Checking input_box2 */
-    
-  TeBox input_box2;
-  if( parameters.CheckParameter< TeBox >( "input_box2" ) ) {
-    parameters.GetParameter( "input_box2", input_box2 );
-    
-    TEAGN_TRUE_OR_RETURN( ( input_box2.x1() >= 0 ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( ( input_box2.x2() >= 0 ),
-      "Invalid parameter : input_box2" )      
-    TEAGN_TRUE_OR_RETURN( ( input_box2.y1() >= 0 ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( ( input_box2.y2() >= 0 ),
-      "Invalid parameter : input_box2" )         
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.x1() <= 
-        ( input_image2_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.x2() <= 
-        ( input_image2_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box2" )       
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.y1() <= 
-        ( input_image2_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.y2() <= 
-        ( input_image2_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box2" )        
-  }    
-    
-  /* Checking pixel_x_relation */
-  
-  double pixel_x_relation = 1.0;
-  if( parameters.CheckParameter< double >( "pixel_x_relation" ) ) {
-    parameters.GetParameter( "pixel_x_relation", pixel_x_relation );
-    
-    TEAGN_TRUE_OR_RETURN( ( pixel_x_relation != 0.0 ),
-      "Invalid parameter : pixel_x_relation" )
-  }
-  
-  /* Checking pixel_y_relation */
-  
-  double pixel_y_relation = 1.0;
-  if( parameters.CheckParameter< double >( "pixel_y_relation" ) ) {
-    parameters.GetParameter( "pixel_y_relation", pixel_y_relation );
-    
-    TEAGN_TRUE_OR_RETURN( ( pixel_y_relation != 0.0 ),
-      "Invalid parameter : pixel_y_relation" )
-  }   
-  
-  return true;
-}
-
-
-void TePDICorrelationMatching::ResetState( const TePDIParameters& )
-{
-}
-
-
-bool TePDICorrelationMatching::loadImage( const TeThreadParameters& params )
-{
-  /* Retriving parameters */
-  
-  TePDITypes::TePDIRasterPtrType input_image_ptr;
-  TEAGN_TRUE_OR_THROW( params.retrive( "input_image_ptr", input_image_ptr ),
-    "Missing thread parameter" )
-    
-  ImgMatrixT* img_matrix_ptr;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_matrix_ptr", img_matrix_ptr ),
-    "Missing thread parameter" )
-    
-  double img_x_rescale_factor = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_x_rescale_factor", 
-    img_x_rescale_factor ), "Missing thread parameter" )
-    
-  double img_y_rescale_factor = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_y_rescale_factor", 
-    img_y_rescale_factor ), "Missing thread parameter" )    
-    
-  unsigned int input_channel = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "input_channel", 
-    input_channel ), "Missing thread parameter" )  
-    
-  unsigned int box_x_off = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_x_off", 
-    box_x_off ), "Missing thread parameter" )  
-
-  unsigned int box_y_off = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_y_off", 
-    box_y_off ), "Missing thread parameter" )      
-    
-  unsigned int box_nlines = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_nlines", 
-    box_nlines ), "Missing thread parameter" )      
-    
-  unsigned int box_ncols = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_ncols", 
-    box_ncols ), "Missing thread parameter" )   
-    
-  bool progress_enabled = false;   
-  TEAGN_TRUE_OR_THROW( params.retrive( "progress_enabled", 
-    progress_enabled ), "Missing thread parameter" ) 
-    
-  TeMutex* glb_mem_lock_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "glb_mem_lock_ptr", 
-    glb_mem_lock_ptr ), "Missing thread parameter" )   
-  TeMutex& glb_mem_lock = *glb_mem_lock_ptr;
-         
-  /* Rescaling image */
-  
-  unsigned int nlines = (unsigned int) ceil( 
-    ( (double)box_nlines ) * img_y_rescale_factor );
-  unsigned int ncols = (unsigned int) ceil( 
-    ( (double)box_ncols ) * img_x_rescale_factor );    
-  
-  glb_mem_lock.lock();
-  
-  if( ! img_matrix_ptr->Reset( nlines, ncols, 
-    TePDIMatrix< double >::AutoMemPol ) )
-  {
-    TEAGN_LOGERR( "Unable to allocate space for the loaded image" )
-    glb_mem_lock.unLock();
-    return false;
-  }
-    
-  glb_mem_lock.unLock();
-    
-  unsigned int curr_out_line = 0;
-  unsigned int curr_out_col = 0;
-  unsigned int curr_input_line = 0;
-  unsigned int curr_input_col = 0;
-  double value = 0;
-  
-  TePDIPIManager progress( "Rescaling image", nlines, progress_enabled );
-  
-  for( curr_out_line = 0 ; curr_out_line < nlines ; 
-    ++curr_out_line ) {
-    
-    curr_input_line = 
-      TeRound( 
-        ( 
-          ( (double)curr_out_line ) / img_y_rescale_factor
-        ) 
-        +
-        ( (double) box_y_off )
-      );
-    
-    for( curr_out_col = 0 ; curr_out_col < ncols ; 
-      ++curr_out_col ) {
-      
-      curr_input_col = 
-        TeRound( 
-          ( 
-            ( (double)curr_out_col ) / img_x_rescale_factor
-          ) 
-          +
-          ( (double) box_x_off )
-        );        
-      
-      if( input_image_ptr->getElement( curr_input_col, curr_input_line, value, 
-        input_channel ) ) {
-        
-        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = value;
-      } else {
-        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = 0;
-      }
-    }
-    
-    TEAGN_FALSE_OR_RETURN( progress.Increment(),
-      "Canceled by the user" );
-  }
-        
-  return true;
-}
-
-
-void TePDICorrelationMatching::matrix2Tiff( 
-  const ImgMatrixT& input_matrix,
-  const std::string& out_file_name,
-  const std::vector< TeCoord2D >& maxima_points )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_matrix.GetLines() > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_matrix.GetColumns() > 0 ), 
-    "Invalid matrix cols" )
-    
-  /* Finding min and max */
-  const double dbl_max = DBL_MAX;
-  const double dbl_min = (-1.0) * dbl_max;
-  double mtx_min = dbl_max;
-  double mtx_max = dbl_min;
-  double mtx_diff = 1.0;
-  
-  {
-    for( unsigned int line = 0 ; 
-      line < input_matrix.GetLines() ; ++line ) 
-    {
-      for( unsigned int col = 0 ; 
-        col < input_matrix.GetColumns() ; 
-        ++col ) 
-      {
-        if( ( input_matrix( line, col ) > dbl_min ) &&
-          ( input_matrix( line, col ) < dbl_max ) )
-        {
-          if( input_matrix( line, col ) < mtx_min )
-          {
-            mtx_min = input_matrix( line, col );
-          } 
-          
-          if( input_matrix( line, col ) > mtx_max )
-          {
-            mtx_max = input_matrix( line, col );
-          }
-        }
-      }  
-    }
-    
-    if( mtx_max != mtx_min )
-    {
-      mtx_diff = mtx_max - mtx_min;
-    } 
-  }
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_matrix.GetLines(),
-    input_matrix.GetColumns() );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  
-  for( unsigned int line = 0 ; 
-    line < input_matrix.GetLines() ; ++line ) {
-    for( unsigned int col = 0 ; 
-      col < input_matrix.GetColumns() ; 
-      ++col ) {
-
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        ( ( input_matrix( line, col ) - mtx_min ) / mtx_diff ) * 255.0, 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw maxima points */
-  
-  std::vector< TeCoord2D >::const_iterator maximas_it = 
-    maxima_points.begin();
-  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
-    maxima_points.end();
-    
-  while( maximas_it != maximas_it_end ) {
-    int x = TeRound( maximas_it->x() );
-    TEAGN_TRUE_OR_THROW( ( x < (int)input_matrix.GetColumns() ),
-      "Invalid maxima column" )
-    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-      "Invalid maxima column" )      
-    
-    int y = TeRound( maximas_it->y() );
-    TEAGN_TRUE_OR_THROW( ( y < (int)input_matrix.GetLines() ),
-      "Invalid maxima line" )
-    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-      "Invalid maxima line" )      
-    
-    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-      255.0, 0 ),
-      "Error writing raster" )
-      
-    ++maximas_it;
-  }  
-}
-
-
-void TePDICorrelationMatching::raster2Tiff( 
-  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-  unsigned int raster_channel,
-  const std::string& out_file_name,
-  const std::vector< TeCoord2D >& maxima_points,
-  const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
-  unsigned int tie_points_space )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
-    "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
-    "Invalid matrix cols" )
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
-    input_raster_ptr->params().ncols_ );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  double value = 0;
-  
-  for( int line = 0 ; 
-    line < input_raster_ptr->params().nlines_ ; ++line ) {
-    for( int col = 0 ; 
-      col < input_raster_ptr->params().ncols_ ; 
-      ++col ) {
-      
-      input_raster_ptr->getElement( col, line, value, 
-        raster_channel );
-      
-
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        value, 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw maxima points */
-  
-  std::vector< TeCoord2D >::const_iterator maximas_it = 
-    maxima_points.begin();
-  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
-    maxima_points.end();
-    
-  while( maximas_it != maximas_it_end ) {
-    int x = TeRound( maximas_it->x() );
-    TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
-      "Invalid maxima column" )
-    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-      "Invalid maxima column" )      
-    
-    int y = TeRound( maximas_it->y() );
-    TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
-      "Invalid maxima line" )
-    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-      "Invalid maxima line" )      
-    
-    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-      255.0, 0 ),
-      "Error writing raster" )
-      
-    ++maximas_it;
-  }
-  
-  /* Draw tie-points */
-  
-  if( out_tie_points_ptr.isActive() ) {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      int x = 0;
-      int y = 0;
-      
-      if( tie_points_space == 0 ) {
-         x = TeRound( it->pt1.x() );
-         y = TeRound( it->pt1.y() );
-      } else {
-         x = TeRound( it->pt2.x() );
-         y = TeRound( it->pt2.y() );
-      }
-      
-      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
-        "Invalid maxima column" )
-      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-        "Invalid maxima column" )      
-      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
-        "Invalid maxima line" )
-      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-        "Invalid maxima line" )      
-      
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-        255.0, 0 ),
-        "Error writing raster" )    
-    
-      ++it;
-    }
-  
-  }
-}
-
-
-bool TePDICorrelationMatching::checkTPs( 
-  const TeCoordPairVect& tpsvec ) const
-{
-  for( unsigned int idx1 = 0 ; idx1 < tpsvec.size() ; ++idx1 )
-  { 
-    for( unsigned int idx2 = idx1 + 1 ; idx2 < tpsvec.size() ; 
-      ++idx2 )
-    {
-      TEAGN_TRUE_OR_RETURN( 
-        (
-          (
-            ( tpsvec[ idx1 ].pt1.x() != tpsvec[ idx2 ].pt1.x() ) ||
-            ( tpsvec[ idx1 ].pt1.y() != tpsvec[ idx2 ].pt1.y() ) 
-          ) &&
-          (
-            ( tpsvec[ idx1 ].pt2.x() != tpsvec[ idx2 ].pt2.x() ) ||
-            ( tpsvec[ idx1 ].pt2.y() != tpsvec[ idx2 ].pt2.y() ) 
-          )
-        ),
-        "Invalid tie-point" +
-        std::string( " index1=" ) + Te2String( idx1 ) +
-        " [" + Te2String( tpsvec[ idx1 ].pt1.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx1 ].pt1.y(), 9 ) + " <-> " +
-        Te2String( tpsvec[ idx1 ].pt2.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx1 ].pt2.y(), 9 ) + "]" +
-        std::string( " index2=" ) + Te2String( idx2 ) +
-        " [" + Te2String( tpsvec[ idx2 ].pt1.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx2 ].pt1.y(), 9 ) + " <-> " +
-        Te2String( tpsvec[ idx2 ].pt2.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx2 ].pt2.y(), 9 ) + "]" );
-    }
-  }
-  
-  return true;
-}
-
-
+#include "TePDICorrelationMatching.hpp"
+
+#include "TePDIUtils.hpp"
+
+#include <TeThreadFunctor.h>
+#include <TeMutex.h>
+#include <TeCoord2D.h>
+
+#include <math.h>
+
+void TePDICorrelationMatching::CorrThread::run()
+{
+  TEAGN_DEBUG_CONDITION( bigMatrix_.getMemPolicy() == ImgMatrixT::RAMMemPol,
+    "invalid memory policy for use with threads" )
+  TEAGN_DEBUG_CONDITION( smallMatrix_.getMemPolicy() == ImgMatrixT::RAMMemPol,
+    "invalid memory policy for use with threads" )
+    
+  returnValue_ = false;
+  
+  const unsigned int small_mtx_lines = smallMatrix_.GetLines();
+  const unsigned int small_mtx_cols = smallMatrix_.GetColumns();    
+  const unsigned int big_mtx_lines_bound = bigMatrix_.GetLines() -
+    small_mtx_lines;
+  const unsigned int big_mtx_cols_bound = bigMatrix_.GetColumns() -
+    small_mtx_cols;
+  unsigned int big_mtx_line = 0;
+  unsigned int big_mtx_col = 0;
+  unsigned int small_mtx_line = 0;
+  unsigned int small_mtx_col = 0; 
+  double sbsum = 0;
+  double ssum = 0;
+  double bsum = 0;
+  double spow2sum = 0;
+  double bpow2sum = 0;
+  const double totalElemensNmb = (double)( small_mtx_lines *
+    small_mtx_cols );  
+  double elemsnmb = 0; 
+  double* big_matrix_line_ptr = 0;
+  double* small_matrix_line_ptr = 0;  
+  double auxVar1 = 0;  
+  double curr_cor_value = 0;
+  double currLineBestCorValue = 0;
+  unsigned int currLineBestCorCol = 0;  
+  
+  for( big_mtx_line = 0 ; big_mtx_line < big_mtx_lines_bound ; 
+    ++big_mtx_line )
+  {
+    // Can this line be processed ??
+    
+    mutex_.lock();
+    
+    if( big_mtx_line == nextLineToProcess_ )
+    {
+      ++nextLineToProcess_;
+      mutex_.unLock();
+      
+      currLineBestCorValue = -1.0;
+      currLineBestCorCol = 0;
+    
+      for( big_mtx_col = 0 ; big_mtx_col < big_mtx_cols_bound ; 
+        ++big_mtx_col )
+      {
+        sbsum = 0;
+        ssum = 0;
+        bsum = 0;
+        spow2sum = 0;
+        bpow2sum = 0;
+        elemsnmb = 0;
+        
+        for( small_mtx_line = 0 ; small_mtx_line < small_mtx_lines ;
+          ++small_mtx_line )
+        {
+          big_matrix_line_ptr = bigMatrix_[ big_mtx_line + 
+            small_mtx_line ];
+          small_matrix_line_ptr = smallMatrix_[ small_mtx_line ];
+          
+          for( small_mtx_col = 0 ; small_mtx_col < small_mtx_cols ;
+            ++small_mtx_col )
+          {
+            const double& smelem = small_matrix_line_ptr[ 
+              small_mtx_col ];
+            const double& bmelem = big_matrix_line_ptr[
+              big_mtx_col + small_mtx_col ];
+              
+            if( ( smelem != dummyValue_ ) && ( bmelem != dummyValue_ ) )
+            {
+              sbsum += ( smelem * bmelem );
+              ssum += smelem;
+              bsum += bmelem;
+              spow2sum += ( smelem * smelem );
+              bpow2sum += ( bmelem * bmelem );
+              ++elemsnmb;
+            }
+          }
+        }
+        
+        if( elemsnmb > 0.0 )
+        {
+          auxVar1 = sqrt( ( elemsnmb * spow2sum ) - ( ssum * ssum ) ) * 
+            sqrt( ( elemsnmb * bpow2sum ) - ( bsum * bsum ) );
+            
+          if( auxVar1 == 0.0 )
+          {
+            curr_cor_value = -1.0;
+          }
+          else
+          {
+            curr_cor_value = ( ( elemsnmb * sbsum ) - ( ssum * bsum ) ) /
+              auxVar1;
+            curr_cor_value *= ( elemsnmb / totalElemensNmb );
+          }
+        }
+        else
+        {
+          curr_cor_value = -1.0;
+        }
+        
+        // Comparing the current correlation with
+        // the current line best one
+          
+        if( curr_cor_value > currLineBestCorValue )
+        {
+          currLineBestCorValue = curr_cor_value;
+          currLineBestCorCol = big_mtx_col;
+        }
+      }
+      
+      // Comparing the current line best correlation with
+      // the current global best correlation
+      
+      mutex_.lock();
+      
+      if( currLineBestCorValue > bestCorValue_ )
+      {
+        bestCorValue_ = currLineBestCorValue;
+        bestCorLine_ = big_mtx_line;
+        bestCorCol_ = currLineBestCorCol;
+      }      
+      
+      if( progress_.Increment() )
+      {
+        TEAGN_LOGMSG( "Canceled by the user" );
+        abortFlag_ = true;
+        mutex_.unLock();  
+        return;
+      }
+      else
+      {
+        mutex_.unLock();  
+      }      
+    }
+    else
+    {
+      if( progress_.Increment() )
+      {
+        TEAGN_LOGMSG( "Canceled by the user" );
+        abortFlag_ = true;
+        mutex_.unLock();  
+        return;
+      }
+      else
+      {
+        mutex_.unLock();  
+      }
+    }
+  }
+  
+  returnValue_ = true;
+}
+
+TePDICorrelationMatching::TePDICorrelationMatching()
+{
+}
+
+
+TePDICorrelationMatching::~TePDICorrelationMatching()
+{
+}
+
+
+bool TePDICorrelationMatching::RunImplementation()
+{
+  /* Globals */
+     
+  const unsigned int procsNumber = TeGetPhysProcNumber();
+  TeMutex glb_mem_lock;
+
+  /* Retriving Parameters */
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  params_.GetParameter( "input_image1_ptr", input_image1_ptr );  
+  
+  unsigned int input_channel1 = 0;
+  params_.GetParameter( "input_channel1", input_channel1 );   
+  
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  params_.GetParameter( "input_image2_ptr", input_image2_ptr );  
+  
+  unsigned int input_channel2 = 0;
+  params_.GetParameter( "input_channel2", input_channel2 );   
+
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
+  params_.GetParameter( "out_tie_points_ptr", out_tie_points_ptr );   
+  
+  TeBox input_box1;
+  if( params_.CheckParameter< TeBox >( "input_box1" ) ) {
+    params_.GetParameter( "input_box1", input_box1 );
+  } else {
+    TeBox input_box1_proj = input_image1_ptr->params().box();
+    
+    TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, input_image1_ptr,
+      input_box1 );
+  }
+  
+  TeBox input_box2;
+  if( params_.CheckParameter< TeBox >( "input_box2" ) ) {
+    params_.GetParameter( "input_box2", input_box2 );
+  } else {
+    TeBox input_box2_proj = input_image2_ptr->params().box();
+    
+    TePDIUtils::MapCoords2RasterIndexes( input_box2_proj, input_image2_ptr,
+      input_box2 );
+  }  
+  
+  bool enable_multi_thread = false;
+  if( params_.CheckParameter< int >( "enable_multi_thread" ) &&
+    ( procsNumber > 1 ) ) 
+  {
+    enable_multi_thread = true;
+  }
+  
+  bool enable_threaded_raster_read = false;
+  if( enable_multi_thread && params_.CheckParameter< int >( 
+    "enable_threaded_raster_read" ) ) 
+  {
+    enable_threaded_raster_read = true;
+  }  
+  
+  double pixel_x_relation = 1.0;
+  if( params_.CheckParameter< double >( "pixel_x_relation" ) ) {
+    params_.GetParameter( "pixel_x_relation", pixel_x_relation );
+  }
+  
+  double pixel_y_relation = 1.0;
+  if( params_.CheckParameter< double >( "pixel_y_relation" ) ) {
+    params_.GetParameter( "pixel_y_relation", pixel_y_relation );
+  }  
+  
+  unsigned int max_size_opt = 0;
+  if( params_.CheckParameter< unsigned int >( "max_size_opt" ) ) {
+    params_.GetParameter( "max_size_opt", max_size_opt );
+  }   
+  
+  double* best_cor_value_ptr = 0;
+  if( params_.CheckParameter< double* >( "best_cor_value_ptr" ) ) 
+  {
+    params_.GetParameter( "best_cor_value_ptr", best_cor_value_ptr );
+  }
+     
+  double dummy_value = 0;
+  if( params_.CheckParameter< double >( "dummy_value" ) ) 
+  {
+    params_.GetParameter( "dummy_value", dummy_value );
+  }
+  
+  /* Calculating the box postion related values */
+  
+  const unsigned int orig_box1_x_off = (unsigned int)input_box1.lowerLeft().x();
+  const unsigned int orig_box1_y_off = (unsigned int)input_box1.upperRight().y();
+  const unsigned int orig_box1_nlines = 1 + (unsigned int)ABS( input_box1.height() );
+  const unsigned int orig_box1_ncols = 1 + (unsigned int)ABS( input_box1.width() );
+  
+  const unsigned int orig_box2_x_off = (unsigned int)input_box2.lowerLeft().x();
+  const unsigned int orig_box2_y_off = (unsigned int)input_box2.upperRight().y();
+  const unsigned int orig_box2_nlines = 1 + (unsigned int)ABS( input_box2.height() );
+  const unsigned int orig_box2_ncols = 1 + (unsigned int)ABS( input_box2.width() );
+    
+  /* Calculating the rescale factors 
+     rescaled_image = original_image * rescale_factor */
+  
+  double img1_x_rescale_factor = 1.0;
+  double img1_y_rescale_factor = 1.0;
+  double img2_x_rescale_factor = 1.0;
+  double img2_y_rescale_factor = 1.0;
+  {
+    double mean_pixel_relation = ( pixel_x_relation + pixel_y_relation ) /
+      2.0;
+      
+    if( mean_pixel_relation > 1.0 ) {
+      /* The image 1 has poor resolution - bigger pixel resolution values -
+         and image 2 needs to be rescaled down */
+      
+      img2_x_rescale_factor = 1.0 / pixel_x_relation;
+      img2_y_rescale_factor = 1.0 / pixel_y_relation;
+    } else if( mean_pixel_relation < 1.0 ) {
+      /* The image 2 has poor resolution - bigger pixel resolution values
+        and image 1 needs to be rescaled down */
+      
+      img1_x_rescale_factor = pixel_x_relation;
+      img1_y_rescale_factor = pixel_y_relation;
+    }
+  } 
+  
+  if( max_size_opt )
+  {
+    double resc_box1_size = 
+      ( (double)orig_box1_nlines  ) * img1_y_rescale_factor *
+      ( (double)orig_box1_ncols ) * img1_x_rescale_factor;
+    double resc_box2_size = 
+      ( (double)orig_box2_nlines  ) * img2_y_rescale_factor *
+      ( (double)orig_box2_ncols ) * img2_x_rescale_factor;
+    double max_size_opt_double = (double)max_size_opt;
+    
+    if( ( resc_box1_size > max_size_opt_double ) || 
+      ( resc_box2_size > max_size_opt_double ) )
+    {
+      double opt_rescale_factor = 1.0;
+      
+      if( resc_box1_size > resc_box2_size )
+      {
+        opt_rescale_factor = sqrt( resc_box1_size / max_size_opt_double );
+      }
+      else
+      {
+        opt_rescale_factor = sqrt( resc_box2_size / max_size_opt_double );
+      }
+      
+      img1_x_rescale_factor *= opt_rescale_factor;
+      img1_y_rescale_factor *= opt_rescale_factor;
+      img2_x_rescale_factor *= opt_rescale_factor;
+      img2_y_rescale_factor *= opt_rescale_factor;
+    }
+  }
+  
+  /* Checking if the small matrix fits inside the bigger one */
+  
+  {
+    unsigned int resc_box1_nlines = (unsigned int) ceil( 
+      ( (double)orig_box1_nlines ) * img1_y_rescale_factor );
+    unsigned int resc_box1_ncols = (unsigned int) ceil( 
+      ( (double)orig_box1_ncols ) * img1_x_rescale_factor );     
+    unsigned int resc_box2_nlines = (unsigned int) ceil( 
+      ( (double)orig_box2_nlines ) * img2_y_rescale_factor );
+    unsigned int resc_box2_ncols = (unsigned int) ceil( 
+      ( (double)orig_box2_ncols ) * img2_x_rescale_factor );   
+        
+    const unsigned int m1size = resc_box1_nlines * 
+      resc_box1_ncols;
+    const unsigned int m2size = resc_box2_nlines * 
+      resc_box2_ncols;      
+      
+    if( m1size < m2size )
+    {
+      if( ( resc_box1_ncols > resc_box2_ncols ) ||
+        ( resc_box1_nlines > resc_box2_nlines ) )
+      {
+        return false;
+      }
+    } 
+    else
+    {
+      if( ( resc_box2_ncols > resc_box1_ncols ) ||
+        ( resc_box2_nlines > resc_box1_nlines ) )
+      {
+        return false;
+      }    
+    }
+  }  
+  
+  /* Loading images */
+  
+  ImgMatrixT img1_matrix;
+  ImgMatrixT img2_matrix;
+  if( enable_multi_thread )
+  {
+    img1_matrix.Reset( ImgMatrixT::RAMMemPol );
+    img2_matrix.Reset( ImgMatrixT::RAMMemPol );
+  }
+  else
+  {
+    img1_matrix.Reset( 0, 0, ImgMatrixT::AutoMemPol, 
+      img1_matrix.getMaxTmpFileSize(), 25 );
+    img2_matrix.Reset( 0, 0, ImgMatrixT::AutoMemPol, 
+      img2_matrix.getMaxTmpFileSize(), 25 );      
+  }
+ 
+  {
+    TeThreadParameters tparams1;
+    tparams1.store( "input_image_ptr", input_image1_ptr );
+    tparams1.store( "img_matrix_ptr", &img1_matrix );
+    tparams1.store( "img_x_rescale_factor", img1_x_rescale_factor );
+    tparams1.store( "img_y_rescale_factor", img1_y_rescale_factor );
+    tparams1.store( "box_x_off", orig_box1_x_off );
+    tparams1.store( "box_y_off", orig_box1_y_off );
+    tparams1.store( "box_nlines", orig_box1_nlines );
+    tparams1.store( "box_ncols", orig_box1_ncols );
+    tparams1.store( "input_channel", input_channel1 );
+    tparams1.store( "progress_enabled", progress_enabled_ );
+    tparams1.store( "glb_mem_lock_ptr", &glb_mem_lock );
+    tparams1.store( "dummy_value", dummy_value );
+    
+    TeThreadParameters tparams2;
+    tparams2.store( "input_image_ptr", input_image2_ptr );
+    tparams2.store( "img_matrix_ptr", &img2_matrix );
+    tparams2.store( "img_x_rescale_factor", img2_x_rescale_factor );
+    tparams2.store( "img_y_rescale_factor", img2_y_rescale_factor );
+    tparams2.store( "box_x_off", orig_box2_x_off );
+    tparams2.store( "box_y_off", orig_box2_y_off );
+    tparams2.store( "box_nlines", orig_box2_nlines );
+    tparams2.store( "box_ncols", orig_box2_ncols );
+    tparams2.store( "input_channel", input_channel2 );
+    tparams2.store( "progress_enabled", progress_enabled_ );
+    tparams2.store( "glb_mem_lock_ptr", &glb_mem_lock );
+    tparams2.store( "dummy_value", dummy_value );
+  
+    if( enable_threaded_raster_read && ( procsNumber > 1 ) )
+    {
+      TeThreadFunctor::pointer aux_thread_ptr( new TeThreadFunctor );
+      aux_thread_ptr->setStartFunctPtr( loadImage );
+      aux_thread_ptr->setParameters( tparams1 );
+      aux_thread_ptr->start();
+   
+      if( ! loadImage( tparams2 ) ) {
+        aux_thread_ptr->waitToFinish();
+        
+        TEAGN_LOG_AND_RETURN( "Unable to load image 2" )
+      } 
+      else 
+      {
+        aux_thread_ptr->waitToFinish();
+        
+        TEAGN_TRUE_OR_RETURN( aux_thread_ptr->getReturnValue(),
+          "Unable to load image 1" )
+      }
+    } 
+    else 
+    {
+      TEAGN_TRUE_OR_RETURN( loadImage( tparams1 ),
+        "Error loading image 1" )
+      TEAGN_TRUE_OR_RETURN( loadImage( tparams2 ),
+        "Error loading image 2" )
+    }
+  }
+  
+/* remove */        
+//matrix2Tiff( img1_matrix, "img1_matrix.tif", 
+//  std::vector< TeCoord2D >() );
+//matrix2Tiff( img2_matrix, "img2_matrix.tif",
+//  std::vector< TeCoord2D >() );
+/* remove */  
+
+  /* Switching the big and small matrixes */
+  
+  ImgMatrixT* big_matrix_ptr = 0;
+  ImgMatrixT* small_matrix_ptr = 0;
+  bool mtx1IsTheSmallOne = true;
+  
+  {    
+    const unsigned int m1size = img1_matrix.GetColumns() * 
+      img1_matrix.GetLines();
+    const unsigned int m2size = img2_matrix.GetColumns() * 
+      img2_matrix.GetLines();      
+      
+    if( m1size < m2size )
+    {
+      mtx1IsTheSmallOne = true;
+      big_matrix_ptr = &img2_matrix;
+      small_matrix_ptr = &img1_matrix;
+    } 
+    else
+    {
+      mtx1IsTheSmallOne = false;
+      big_matrix_ptr = &img1_matrix;
+      small_matrix_ptr = &img2_matrix;
+    }
+  }
+    
+  /* Correlating areas */
+  
+  double best_cor_value = -1.0;
+  unsigned int best_cor_bm_line = 0; /* UL point over big matrix */
+  unsigned int best_cor_bm_col = 0; /* UL point over big matrix */    
+  
+  if( enable_multi_thread )
+  {
+    std::vector< TeSharedPtr< CorrThread > > tVec;
+    TeSharedPtr< CorrThread > tPtr;
+    TePDIPIManager progress( "Looking for the best correlation", 
+      procsNumber * ( big_matrix_ptr->GetLines() - small_matrix_ptr->GetLines() ), 
+      progress_enabled_ );
+    bool abortFlag = false;
+    bool returnValue = true;
+    unsigned int nextLineToProcess = 0;    
+    
+    // Starting correlation threads
+    
+    unsigned int tVecIdx = 0 ;
+    
+    for( tVecIdx = 0 ; tVecIdx < procsNumber ; ++tVecIdx )
+    {
+      tPtr.reset( new CorrThread( progress, *big_matrix_ptr, *small_matrix_ptr,
+        glb_mem_lock, nextLineToProcess, abortFlag, best_cor_value, 
+        best_cor_bm_line, best_cor_bm_col, dummy_value ) );
+        
+      tPtr->start();
+        
+      tVec.push_back( tPtr );
+    }
+    
+    // Waiting each thread to finish
+    
+    for( tVecIdx = 0 ; tVecIdx < procsNumber ; ++tVecIdx )
+    {
+      tVec[ tVecIdx ]->waitToFinish();
+      
+      returnValue &= tVec[ tVecIdx ]->getReturnValue();
+      
+      if( ! returnValue )
+      {
+        abortFlag = true;
+      }
+    }
+        
+    TEAGN_TRUE_OR_RETURN( returnValue, "Correlation thread error" );
+  }
+  else
+  {
+    ImgMatrixT& big_matrix = *big_matrix_ptr;
+    ImgMatrixT& small_matrix = *small_matrix_ptr;
+      
+    const unsigned int small_mtx_lines = small_matrix.GetLines();
+    const unsigned int small_mtx_cols = small_matrix.GetColumns();    
+    
+    /* Iterating over each small matrix position over the bigger one */
+    
+    const unsigned int big_mtx_lines_bound = big_matrix.GetLines() -
+      small_mtx_lines;
+    const unsigned int big_mtx_cols_bound = big_matrix.GetColumns() -
+      small_mtx_cols;
+      
+    unsigned int big_mtx_line = 0;
+    unsigned int big_mtx_col = 0;
+    unsigned int small_mtx_line = 0;
+    unsigned int small_mtx_col = 0;
+
+    double* big_matrix_line_ptr = 0;
+    double* small_matrix_line_ptr = 0;
+    double sbsum = 0;
+    double ssum = 0;
+    double bsum = 0;
+    double spow2sum = 0;
+    double bpow2sum = 0;
+    const double totalElemensNmb = (double)( small_mtx_lines *
+      small_mtx_cols );
+    double elemsnmb = 0;
+    double curr_cor_value = 0;
+    double auxVar1 = 0;
+        
+    TePDIPIManager progress( "Looking for the best correlation", 
+      big_mtx_lines_bound, progress_enabled_ );
+        
+    for( ; big_mtx_line < big_mtx_lines_bound ; ++big_mtx_line )
+    {
+      for( big_mtx_col = 0 ; big_mtx_col < big_mtx_cols_bound ; 
+        ++big_mtx_col )
+      {
+        sbsum = 0;
+        ssum = 0;
+        bsum = 0;
+        spow2sum = 0;
+        bpow2sum = 0;
+        elemsnmb = 0;
+        
+        for( small_mtx_line = 0 ; small_mtx_line < small_mtx_lines ;
+          ++small_mtx_line )
+        {
+          big_matrix_line_ptr = big_matrix[ big_mtx_line + 
+            small_mtx_line ];
+          small_matrix_line_ptr = small_matrix[ small_mtx_line ];
+          
+          for( small_mtx_col = 0 ; small_mtx_col < small_mtx_cols ;
+            ++small_mtx_col )
+          {
+            const double& smelem = small_matrix_line_ptr[ 
+              small_mtx_col ];
+            const double& bmelem = big_matrix_line_ptr[
+              big_mtx_col + small_mtx_col ];
+              
+            if( ( smelem != dummy_value ) && ( bmelem != dummy_value ) )
+            {
+              sbsum += ( smelem * bmelem );
+              ssum += smelem;
+              bsum += bmelem;
+              spow2sum += ( smelem * smelem );
+              bpow2sum += ( bmelem * bmelem );
+              ++elemsnmb;
+            }
+          }
+        }
+        
+        if( elemsnmb > 0.0 )
+        {
+          auxVar1 = sqrt( ( elemsnmb * spow2sum ) - ( ssum * ssum ) ) * 
+            sqrt( ( elemsnmb * bpow2sum ) - ( bsum * bsum ) );
+            
+          if( auxVar1 == 0.0 )
+          {
+            curr_cor_value = -1.0;
+          }
+          else
+          {
+            curr_cor_value = ( ( elemsnmb * sbsum ) - ( ssum * bsum ) ) /
+              auxVar1;
+            curr_cor_value *= ( elemsnmb / totalElemensNmb );  
+          }
+        }
+        else
+        {
+          curr_cor_value = -1.0;
+        }
+          
+        if( curr_cor_value > best_cor_value )
+        {
+          best_cor_value = curr_cor_value;
+          best_cor_bm_line = big_mtx_line;
+          best_cor_bm_col = big_mtx_col;
+        }
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" );
+    }
+  }
+  
+  /* Copy the best correlation value to user output var */
+  
+  if( best_cor_value_ptr ) 
+  {
+    (*best_cor_value_ptr) = best_cor_value;
+  }      
+  
+  /* Generating tie-points */
+  
+  TeCoord2D ulpoint_img1;
+  TeCoord2D urpoint_img1;
+  TeCoord2D llpoint_img1;
+  TeCoord2D lrpoint_img1;
+  
+  TeCoord2D ulpoint_img2;
+  TeCoord2D urpoint_img2;
+  TeCoord2D llpoint_img2;
+  TeCoord2D lrpoint_img2;
+  
+  if( mtx1IsTheSmallOne )
+  {
+    ulpoint_img1.setXY( 0 , 0 );
+    llpoint_img1.setXY( 0, img1_matrix.GetLines() - 1 );
+    urpoint_img1.setXY( img1_matrix.GetColumns() - 1 , 0 );
+    lrpoint_img1.setXY( img1_matrix.GetColumns() - 1,
+      img1_matrix.GetLines() - 1 );
+      
+    ulpoint_img2.setXY( best_cor_bm_col, best_cor_bm_line );
+    llpoint_img2.setXY( 
+      best_cor_bm_col,
+      best_cor_bm_line + img1_matrix.GetLines() - 1 );
+    urpoint_img2.setXY( 
+      best_cor_bm_col + img1_matrix.GetColumns() - 1,
+      best_cor_bm_line );
+    lrpoint_img2.setXY( 
+      best_cor_bm_col + img1_matrix.GetColumns() - 1,
+      best_cor_bm_line + img1_matrix.GetLines() - 1 );
+  } 
+  else
+  {
+    ulpoint_img2.setXY( 0 , 0 );
+    llpoint_img2.setXY( 0, img2_matrix.GetLines() - 1 );
+    urpoint_img2.setXY( img2_matrix.GetColumns() - 1 , 0 );
+    lrpoint_img2.setXY( img2_matrix.GetColumns() - 1,
+      img2_matrix.GetLines() - 1 );
+      
+    ulpoint_img1.setXY( best_cor_bm_col, best_cor_bm_line );
+    llpoint_img1.setXY( 
+      best_cor_bm_col,
+      best_cor_bm_line + img2_matrix.GetLines() - 1 );
+    urpoint_img1.setXY( 
+      best_cor_bm_col + img2_matrix.GetColumns() - 1,
+      best_cor_bm_line );
+    lrpoint_img1.setXY( 
+      best_cor_bm_col + img2_matrix.GetColumns() - 1,
+      best_cor_bm_line + img2_matrix.GetLines() - 1 );        
+  }
+  
+      
+  /* Bringing points into input_image1_ptr 
+     reference */
+     
+  ulpoint_img1.setXY( 
+    ( ulpoint_img1.x() / img1_x_rescale_factor ) +
+    ( (double)orig_box1_x_off ),
+    ( ulpoint_img1.y() / img1_y_rescale_factor ) +
+    ( (double)orig_box1_y_off ) );
+  urpoint_img1.setXY( 
+    ( urpoint_img1.x() / img1_x_rescale_factor ) +
+    ( (double)orig_box1_x_off ),
+    ( urpoint_img1.y() / img1_y_rescale_factor ) +
+    ( (double)orig_box1_y_off ) );
+  llpoint_img1.setXY( 
+    ( llpoint_img1.x() / img1_x_rescale_factor ) +
+    ( (double)orig_box1_x_off ),
+    ( llpoint_img1.y() / img1_y_rescale_factor ) +
+    ( (double)orig_box1_y_off ) );
+  lrpoint_img1.setXY( 
+    ( lrpoint_img1.x() / img1_x_rescale_factor ) +
+    ( (double)orig_box1_x_off ),
+    ( lrpoint_img1.y() / img1_y_rescale_factor ) +
+    ( (double)orig_box1_y_off ) );                  
+
+  /* Bringing points into input_image2_ptr 
+     reference */
+ 
+  ulpoint_img2.setXY( 
+    ( ulpoint_img2.x() / img2_x_rescale_factor ) +
+    ( (double)orig_box2_x_off ),
+    ( ulpoint_img2.y() / img2_y_rescale_factor ) +
+    ( (double)orig_box2_y_off ) );
+  urpoint_img2.setXY( 
+    ( urpoint_img2.x() / img2_x_rescale_factor ) +
+    ( (double)orig_box2_x_off ),
+    ( urpoint_img2.y() / img2_y_rescale_factor ) +
+    ( (double)orig_box2_y_off ) );
+  llpoint_img2.setXY( 
+    ( llpoint_img2.x() / img2_x_rescale_factor ) +
+    ( (double)orig_box2_x_off ),
+    ( llpoint_img2.y() / img2_y_rescale_factor ) +
+    ( (double)orig_box2_y_off ) );
+  lrpoint_img2.setXY( 
+    ( lrpoint_img2.x() / img2_x_rescale_factor ) +
+    ( (double)orig_box2_x_off ),
+    ( lrpoint_img2.y() / img2_y_rescale_factor ) +
+    ( (double)orig_box2_y_off ) );  
+       
+  /* Generating output tie-points */
+  
+  out_tie_points_ptr->clear();
+  
+  out_tie_points_ptr->push_back( TeCoordPair( ulpoint_img1,
+    ulpoint_img2 ) );
+  out_tie_points_ptr->push_back( TeCoordPair( urpoint_img1,
+    urpoint_img2 ) );
+  out_tie_points_ptr->push_back( TeCoordPair( llpoint_img1,
+    llpoint_img2 ) );
+  out_tie_points_ptr->push_back( TeCoordPair( lrpoint_img1,
+    lrpoint_img2 ) );
+    
+  TEAGN_DEBUG_CONDITION( checkTPs( *out_tie_points_ptr ),
+    "Invalid tie-points" )                     
+  
+  return true;
+}
+
+
+bool TePDICorrelationMatching::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking input_image1_ptr */
+    
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_image1_ptr", input_image1_ptr ),
+    "Missing parameter: input_image1_ptr" );
+  TEAGN_TRUE_OR_RETURN( input_image1_ptr.isActive(),
+    "Invalid parameter: input_image1_ptr inactive" );
+  TEAGN_TRUE_OR_RETURN( input_image1_ptr->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: input_image1_ptr not ready" );
+    
+  /* Checking input_channel1 */
+    
+  unsigned int input_channel1 = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_channel1", input_channel1 ),
+    "Missing parameter: input_channel1" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( (int)input_channel1 ) < 
+    input_image1_ptr->params().nBands() ),
+    "Invalid parameter: input_channel1" );
+  
+    
+  /* Checking input_image1_ptr */
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_image2_ptr", input_image2_ptr ),
+    "Missing parameter: input_image2_ptr" );
+  TEAGN_TRUE_OR_RETURN( input_image2_ptr.isActive(),
+    "Invalid parameter: input_image2_ptr inactive" );
+  TEAGN_TRUE_OR_RETURN( input_image2_ptr->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: input_image2_ptr not ready" );    
+    
+  /* Checking input_channel2 */
+    
+  unsigned int input_channel2 = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_channel2", input_channel2 ),
+    "Missing parameter: input_channel2" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( (int)input_channel2 ) < 
+    input_image2_ptr->params().nBands() ),
+    "Invalid parameter: input_channel2" );
+    
+  /* Checking out_tie_points_ptr */
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "out_tie_points_ptr", out_tie_points_ptr ),
+    "Missing parameter: out_tie_points_ptr" );
+  TEAGN_TRUE_OR_RETURN( out_tie_points_ptr.isActive(),
+    "Invalid parameter: out_tie_points_ptr inactive" );
+    
+  /* Checking input_box1 */
+    
+  TeBox input_box1;
+  if( parameters.CheckParameter< TeBox >( "input_box1" ) ) {
+    parameters.GetParameter( "input_box1", input_box1 );
+    
+    TEAGN_TRUE_OR_RETURN( ( input_box1.x1() >= 0 ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( ( input_box1.x2() >= 0 ),
+      "Invalid parameter : input_box1" )      
+    TEAGN_TRUE_OR_RETURN( ( input_box1.y1() >= 0 ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( ( input_box1.y2() >= 0 ),
+      "Invalid parameter : input_box1" )         
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.x1() <= 
+        ( input_image1_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.x2() <= 
+        ( input_image1_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box1" )       
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.y1() <= 
+        ( input_image1_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.y2() <= 
+        ( input_image1_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box1" )        
+  }
+    
+  /* Checking input_box2 */
+    
+  TeBox input_box2;
+  if( parameters.CheckParameter< TeBox >( "input_box2" ) ) {
+    parameters.GetParameter( "input_box2", input_box2 );
+    
+    TEAGN_TRUE_OR_RETURN( ( input_box2.x1() >= 0 ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( ( input_box2.x2() >= 0 ),
+      "Invalid parameter : input_box2" )      
+    TEAGN_TRUE_OR_RETURN( ( input_box2.y1() >= 0 ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( ( input_box2.y2() >= 0 ),
+      "Invalid parameter : input_box2" )         
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.x1() <= 
+        ( input_image2_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.x2() <= 
+        ( input_image2_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box2" )       
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.y1() <= 
+        ( input_image2_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.y2() <= 
+        ( input_image2_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box2" )        
+  }    
+    
+  /* Checking pixel_x_relation */
+  
+  double pixel_x_relation = 1.0;
+  if( parameters.CheckParameter< double >( "pixel_x_relation" ) ) {
+    parameters.GetParameter( "pixel_x_relation", pixel_x_relation );
+    
+    TEAGN_TRUE_OR_RETURN( ( pixel_x_relation != 0.0 ),
+      "Invalid parameter : pixel_x_relation" )
+  }
+  
+  /* Checking pixel_y_relation */
+  
+  double pixel_y_relation = 1.0;
+  if( parameters.CheckParameter< double >( "pixel_y_relation" ) ) {
+    parameters.GetParameter( "pixel_y_relation", pixel_y_relation );
+    
+    TEAGN_TRUE_OR_RETURN( ( pixel_y_relation != 0.0 ),
+      "Invalid parameter : pixel_y_relation" )
+  }   
+  
+  return true;
+}
+
+
+void TePDICorrelationMatching::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDICorrelationMatching::loadImage( const TeThreadParameters& params )
+{
+  /* Retriving parameters */
+  
+  TePDITypes::TePDIRasterPtrType input_image_ptr;
+  TEAGN_TRUE_OR_THROW( params.retrive( "input_image_ptr", input_image_ptr ),
+    "Missing thread parameter" )
+    
+  ImgMatrixT* img_matrix_ptr;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_matrix_ptr", img_matrix_ptr ),
+    "Missing thread parameter" )
+    
+  double img_x_rescale_factor = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_x_rescale_factor", 
+    img_x_rescale_factor ), "Missing thread parameter" )
+    
+  double img_y_rescale_factor = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_y_rescale_factor", 
+    img_y_rescale_factor ), "Missing thread parameter" )    
+    
+  unsigned int input_channel = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "input_channel", 
+    input_channel ), "Missing thread parameter" )  
+    
+  unsigned int box_x_off = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_x_off", 
+    box_x_off ), "Missing thread parameter" )  
+
+  unsigned int box_y_off = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_y_off", 
+    box_y_off ), "Missing thread parameter" )      
+    
+  unsigned int box_nlines = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_nlines", 
+    box_nlines ), "Missing thread parameter" )      
+    
+  unsigned int box_ncols = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_ncols", 
+    box_ncols ), "Missing thread parameter" )   
+    
+  bool progress_enabled = false;   
+  TEAGN_TRUE_OR_THROW( params.retrive( "progress_enabled", 
+    progress_enabled ), "Missing thread parameter" ) 
+    
+  TeMutex* glb_mem_lock_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "glb_mem_lock_ptr", 
+    glb_mem_lock_ptr ), "Missing thread parameter" )   
+  TeMutex& glb_mem_lock = *glb_mem_lock_ptr;
+  
+  double dummy_value = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "dummy_value", 
+    dummy_value ), "Missing dummy_value parameter" )   
+  
+         
+  /* Rescaling image */
+  
+  unsigned int nlines = (unsigned int) ceil( 
+    ( (double)box_nlines ) * img_y_rescale_factor );
+  unsigned int ncols = (unsigned int) ceil( 
+    ( (double)box_ncols ) * img_x_rescale_factor );    
+  
+  glb_mem_lock.lock();
+  
+  if( ! img_matrix_ptr->Reset( nlines, ncols ) )
+  {
+    TEAGN_LOGERR( "Unable to allocate space for the loaded image" )
+    glb_mem_lock.unLock();
+    return false;
+  }
+    
+  glb_mem_lock.unLock();
+    
+  unsigned int curr_out_line = 0;
+  unsigned int curr_out_col = 0;
+  unsigned int curr_input_line = 0;
+  unsigned int curr_input_col = 0;
+  double value = 0;
+  
+  TePDIPIManager progress( "Rescaling image", nlines, progress_enabled );
+  
+  for( curr_out_line = 0 ; curr_out_line < nlines ; 
+    ++curr_out_line ) {
+    
+    curr_input_line = 
+      TeRound( 
+        ( 
+          ( (double)curr_out_line ) / img_y_rescale_factor
+        ) 
+        +
+        ( (double) box_y_off )
+      );
+    
+    for( curr_out_col = 0 ; curr_out_col < ncols ; 
+      ++curr_out_col ) {
+      
+      curr_input_col = 
+        TeRound( 
+          ( 
+            ( (double)curr_out_col ) / img_x_rescale_factor
+          ) 
+          +
+          ( (double) box_x_off )
+        );        
+      
+      if( input_image_ptr->getElement( curr_input_col, curr_input_line, value, 
+        input_channel ) ) 
+      {
+        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = value;
+      } 
+      else 
+      {
+        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = dummy_value;
+      }
+    }
+    
+    TEAGN_FALSE_OR_RETURN( progress.Increment(),
+      "Canceled by the user" );
+  }
+        
+  return true;
+}
+
+
+void TePDICorrelationMatching::matrix2Tiff( 
+  const ImgMatrixT& input_matrix,
+  const std::string& out_file_name,
+  const std::vector< TeCoord2D >& maxima_points )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.GetLines() > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.GetColumns() > 0 ), 
+    "Invalid matrix cols" )
+    
+  /* Finding min and max */
+  const double dbl_max = DBL_MAX;
+  const double dbl_min = (-1.0) * dbl_max;
+  double mtx_min = dbl_max;
+  double mtx_max = dbl_min;
+  double mtx_diff = 1.0;
+  
+  {
+    for( unsigned int line = 0 ; 
+      line < input_matrix.GetLines() ; ++line ) 
+    {
+      for( unsigned int col = 0 ; 
+        col < input_matrix.GetColumns() ; 
+        ++col ) 
+      {
+        if( ( input_matrix( line, col ) > dbl_min ) &&
+          ( input_matrix( line, col ) < dbl_max ) )
+        {
+          if( input_matrix( line, col ) < mtx_min )
+          {
+            mtx_min = input_matrix( line, col );
+          } 
+          
+          if( input_matrix( line, col ) > mtx_max )
+          {
+            mtx_max = input_matrix( line, col );
+          }
+        }
+      }  
+    }
+    
+    if( mtx_max != mtx_min )
+    {
+      mtx_diff = mtx_max - mtx_min;
+    } 
+  }
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_matrix.GetLines(),
+    input_matrix.GetColumns() );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  
+  for( unsigned int line = 0 ; 
+    line < input_matrix.GetLines() ; ++line ) {
+    for( unsigned int col = 0 ; 
+      col < input_matrix.GetColumns() ; 
+      ++col ) {
+
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        ( ( input_matrix( line, col ) - mtx_min ) / mtx_diff ) * 255.0, 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw maxima points */
+  
+  std::vector< TeCoord2D >::const_iterator maximas_it = 
+    maxima_points.begin();
+  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
+    maxima_points.end();
+    
+  while( maximas_it != maximas_it_end ) {
+    int x = TeRound( maximas_it->x() );
+    TEAGN_TRUE_OR_THROW( ( x < (int)input_matrix.GetColumns() ),
+      "Invalid maxima column" )
+    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+      "Invalid maxima column" )      
+    
+    int y = TeRound( maximas_it->y() );
+    TEAGN_TRUE_OR_THROW( ( y < (int)input_matrix.GetLines() ),
+      "Invalid maxima line" )
+    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+      "Invalid maxima line" )      
+    
+    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+      255.0, 0 ),
+      "Error writing raster" )
+      
+    ++maximas_it;
+  }  
+}
+
+
+void TePDICorrelationMatching::raster2Tiff( 
+  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+  unsigned int raster_channel,
+  const std::string& out_file_name,
+  const std::vector< TeCoord2D >& maxima_points,
+  const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
+  unsigned int tie_points_space )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
+    "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
+    "Invalid matrix cols" )
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
+    input_raster_ptr->params().ncols_ );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  double value = 0;
+  
+  for( int line = 0 ; 
+    line < input_raster_ptr->params().nlines_ ; ++line ) {
+    for( int col = 0 ; 
+      col < input_raster_ptr->params().ncols_ ; 
+      ++col ) {
+      
+      input_raster_ptr->getElement( col, line, value, 
+        raster_channel );
+      
+
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        value, 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw maxima points */
+  
+  std::vector< TeCoord2D >::const_iterator maximas_it = 
+    maxima_points.begin();
+  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
+    maxima_points.end();
+    
+  while( maximas_it != maximas_it_end ) {
+    int x = TeRound( maximas_it->x() );
+    TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
+      "Invalid maxima column" )
+    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+      "Invalid maxima column" )      
+    
+    int y = TeRound( maximas_it->y() );
+    TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
+      "Invalid maxima line" )
+    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+      "Invalid maxima line" )      
+    
+    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+      255.0, 0 ),
+      "Error writing raster" )
+      
+    ++maximas_it;
+  }
+  
+  /* Draw tie-points */
+  
+  if( out_tie_points_ptr.isActive() ) {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      int x = 0;
+      int y = 0;
+      
+      if( tie_points_space == 0 ) {
+         x = TeRound( it->pt1.x() );
+         y = TeRound( it->pt1.y() );
+      } else {
+         x = TeRound( it->pt2.x() );
+         y = TeRound( it->pt2.y() );
+      }
+      
+      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
+        "Invalid maxima column" )
+      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+        "Invalid maxima column" )      
+      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
+        "Invalid maxima line" )
+      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+        "Invalid maxima line" )      
+      
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+        255.0, 0 ),
+        "Error writing raster" )    
+    
+      ++it;
+    }
+  
+  }
+}
+
+
+bool TePDICorrelationMatching::checkTPs( 
+  const TeCoordPairVect& tpsvec ) const
+{
+  for( unsigned int idx1 = 0 ; idx1 < tpsvec.size() ; ++idx1 )
+  { 
+    for( unsigned int idx2 = idx1 + 1 ; idx2 < tpsvec.size() ; 
+      ++idx2 )
+    {
+      TEAGN_TRUE_OR_RETURN( 
+        (
+          (
+            ( tpsvec[ idx1 ].pt1.x() != tpsvec[ idx2 ].pt1.x() ) ||
+            ( tpsvec[ idx1 ].pt1.y() != tpsvec[ idx2 ].pt1.y() ) || 
+            ( tpsvec[ idx1 ].pt2.x() != tpsvec[ idx2 ].pt2.x() ) ||
+            ( tpsvec[ idx1 ].pt2.y() != tpsvec[ idx2 ].pt2.y() ) 
+          )
+        ),
+        "Invalid tie-point" +
+        std::string( " index1=" ) + Te2String( idx1 ) +
+        " [" + Te2String( tpsvec[ idx1 ].pt1.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx1 ].pt1.y(), 9 ) + " <-> " +
+        Te2String( tpsvec[ idx1 ].pt2.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx1 ].pt2.y(), 9 ) + "]" +
+        std::string( " index2=" ) + Te2String( idx2 ) +
+        " [" + Te2String( tpsvec[ idx2 ].pt1.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx2 ].pt1.y(), 9 ) + " <-> " +
+        Te2String( tpsvec[ idx2 ].pt2.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx2 ].pt2.y(), 9 ) + "]" );
+    }
+  }
+  
+  return true;
+}
+
+
diff --git a/src/terralib/image_processing/TePDICorrelationMatching.hpp b/src/terralib/image_processing/TePDICorrelationMatching.hpp
index 7a8a79d..f69bbfb 100644
--- a/src/terralib/image_processing/TePDICorrelationMatching.hpp
+++ b/src/terralib/image_processing/TePDICorrelationMatching.hpp
@@ -1,187 +1,268 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDICORRELATIONMATCHING_HPP
-  #define TEPDICORRELATIONMATCHING_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIMatrix.hpp"
-  
-  #include <TeThreadParameters.h>
-
-  /**
-   * @brief  Area matching using correlation ( only  
-   * offset distortion is supported ).
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @note Better used for searching a small image inside a big image.
-   * @ingroup PDIMatchingAlgorithms
-   *
-   * @note The required parameters are:
-   *
-   * @param input_image1_ptr (TePDITypes::TePDIRasterPtrType) - 
-   * The input image 1.
-   * @param input_channel1 ( unsigned int ) - Band to process 
-   * from input_image1.
-   *
-   * @param input_image2_ptr (TePDITypes::TePDIRasterPtrType) - 
-   * The input image 2.
-   * @param input_channel2 ( unsigned int ) - Band to process 
-   * from input_image2.
-   *
-   * @param out_tie_points_ptr ( TeSharedPtr< TeCoordPairVect > ) - The 
-   * output tie- points 
-   * where TeCoordPair.pt1 are input_image1 matricial
-   * indexes and TeCoordPair.pt2 are input_image2 matricial
-   * indexes.
-   *
-   * @note The Optional parameters are:
-   *
-   * @param input_box1 ( TeBox ) - Box (image matrix coords) to process 
-   * from input_image1 ( the entire image will be used if no box
-   * was supplied )
-   *
-   * @param input_box2 ( TeBox ) - Box (image matrix coords) to process 
-   * from input_image2 ( the entire image will be used if no box
-   * was supplied )   
-   *
-   * @param enable_multi_thread (int) - If present (any value) 
-   * a multi-threaded processing will be used; Some TeDecoders do
-   * not support multi-thread so use it with cation
-   * (default: multi-thread disabled).
-   *
-   * @param pixel_x_relation (double) - The pixel resolution relation 
-   * pixel_x_relation = img1_pixel_res_x / img2_pixel_res_x (default=1.0);
-   *
-   * @param pixel_y_relation (double) - The pixel resolution relation 
-   * pixel_y_relation = img1_pixel_res_y / img2_pixel_res_y (default=1.0);   
-   *
-   * @param max_size_opt (unsigned int) - The maximum image box allowed
-   * size (size = pixels number = lines * columns); when the images pixels number
-   * exceed this value a downsample will be performed for optimization
-   * (default value=0 wich means optimization disabled).
-   *
-   * @param best_cor_value_ptr (double*) - A pointer to an output double 
-   * variable where to store the best found correlation value.
-   */
-  class PDI_DLL TePDICorrelationMatching : public TePDIAlgorithm {
-    public :
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDICorrelationMatching();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDICorrelationMatching();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-    
-      /**
-       * @typedef TePDIMatrix< double > ImgMatrixT
-       * @brief A type definition for a image matrix.
-       */    
-      typedef TePDIMatrix< double > ImgMatrixT;
-    
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial 
-       * state.
-       */
-      void ResetState( const TePDIParameters& params );
-      
-      /**
-       * @brief A thread entry point to load raster data into
-       * a simple matrix.
-       * @param params The parameters needed for the thread 
-       * execution.
-       * @return true if OK, false on errors.
-       */
-      static bool loadImage( const TeThreadParameters& params );
-      
-      /**
-       * @brief Save the output matrix to a geotiff file.
-       * @param input_matrix Input matrix.
-       * @param out_file_name Output file name.
-       * @param maxima_points The maxima points to be
-       * filled with 255
-       */      
-      static void matrix2Tiff( 
-        const ImgMatrixT& input_matrix,
-        const std::string& out_file_name,
-        const std::vector< TeCoord2D >& maxima_points );
-        
-      /**
-       * @brief Save the output matrix to a geotiff file.
-       * @param input_raster Input raster.
-       * @param raster_channel Raster channel.
-       * @param out_file_name Output file name.
-       * @param maxima_points The maxima points to be drawed.
-       * @param out_tie_points_ptr The tie-points to be drawed.
-       * @param tie_points_space The tie-points space 
-       * (pt1 or pt2).
-       */      
-      static void raster2Tiff( 
-        const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-        unsigned int raster_channel,
-        const std::string& out_file_name,
-        const std::vector< TeCoord2D >& maxima_points,
-        const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
-        unsigned int tie_points_space );        
-        
-      /**
-       * @brief Check tie-points indexes for repeated values.
-       * @param maximas Tie-points vector.
-       * @return true if OK, false on errors.
-       */
-      bool checkTPs( 
-        const TeCoordPairVect& tpsvec ) const;         
-  };
-  
-/** @example TePDICorrelationMatching_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDICORRELATIONMATCHING_HPP
+  #define TEPDICORRELATIONMATCHING_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIMatrix.hpp"
+  
+  #include <TeThreadParameters.h>
+  #include <TeThread.h>
+  #include <TeMutex.h>  
+
+  /**
+   * @brief  Area matching using correlation ( only  
+   * offset distortion is supported ).
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @note Better used for searching a small image inside a big image.
+   * @ingroup PDIMatchingAlgorithms
+   *
+   * @note The required parameters are:
+   *
+   * @param input_image1_ptr (TePDITypes::TePDIRasterPtrType) - 
+   * The input image 1.
+   * @param input_channel1 ( unsigned int ) - Band to process 
+   * from input_image1.
+   *
+   * @param input_image2_ptr (TePDITypes::TePDIRasterPtrType) - 
+   * The input image 2.
+   * @param input_channel2 ( unsigned int ) - Band to process 
+   * from input_image2.
+   *
+   * @param out_tie_points_ptr ( TeSharedPtr< TeCoordPairVect > ) - The 
+   * output tie- points 
+   * where TeCoordPair.pt1 are input_image1 matricial
+   * indexes and TeCoordPair.pt2 are input_image2 matricial
+   * indexes.
+   *
+   * @note The Optional parameters are:
+   *
+   * @param input_box1 ( TeBox ) - Box (image matrix coords) to process 
+   * from input_image1 ( the entire image will be used if no box
+   * was supplied )
+   *
+   * @param input_box2 ( TeBox ) - Box (image matrix coords) to process 
+   * from input_image2 ( the entire image will be used if no box
+   * was supplied )   
+   *
+   * @param enable_multi_thread (int) - If present (any value) 
+   * a multi-threaded processing will be used; Some TeDecoders do
+   * not support multi-thread so use it with cation
+   * (default: multi-thread disabled).
+   *
+   * @param enable_threaded_raster_read (int) - If present (any value) 
+   * a multi-threaded input rasters data reading will be performed
+   * if enable_multi_thread is also enabled; 
+   * Some TeDecoders do not support multi-thread so use it with caution
+   * (default: multi-threaded raster read disabled).     
+   *
+   * @param pixel_x_relation (double) - The pixel resolution relation 
+   * pixel_x_relation = img1_pixel_res_x / img2_pixel_res_x (default=1.0);
+   *
+   * @param pixel_y_relation (double) - The pixel resolution relation 
+   * pixel_y_relation = img1_pixel_res_y / img2_pixel_res_y (default=1.0);   
+   *
+   * @param max_size_opt (unsigned int) - The maximum image box allowed
+   * size (size = pixels number = lines * columns); when the images pixels number
+   * exceed this value a downsample will be performed for optimization
+   * (default value=0 wich means optimization disabled).
+   *
+   * @param best_cor_value_ptr (double*) - A pointer to an output double 
+   * variable where to store the best found correlation value.
+   *
+   * @param dummy_value (double) - Force a dummy value (image elements
+   * with dummy values are discarted - default = 0).
+   */
+  class PDI_DLL TePDICorrelationMatching : public TePDIAlgorithm {
+    public :
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDICorrelationMatching();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDICorrelationMatching();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+    
+      /**
+       * @typedef TePDIMatrix< double > ImgMatrixT
+       * @brief A type definition for a image matrix.
+       */    
+      typedef TePDIMatrix< double > ImgMatrixT;
+      
+      /**
+       * @class CorrThread
+       * @brief Correlation thread class
+       */    
+      class PDI_DLL CorrThread : public TeThread
+      {
+        public :
+        
+          CorrThread( TePDIPIManager& progress, ImgMatrixT& bigMatrix, 
+            ImgMatrixT& smallMatrix, TeMutex& mutex, 
+            unsigned int& nextLineToProcess, bool& abortFlag,
+            double& bestCorValue, unsigned int& bestCorLine,
+            unsigned int& bestCorCol, double dummyValue )
+            : progress_( progress ), returnValue_( false ), 
+              abortFlag_( abortFlag ), bestCorValue_( bestCorValue ),
+              bestCorLine_( bestCorLine ), bestCorCol_( bestCorCol ),
+              nextLineToProcess_( nextLineToProcess ), dummyValue_( dummyValue ),
+              bigMatrix_( bigMatrix ),
+              smallMatrix_( smallMatrix ), mutex_( mutex )
+            {
+            };
+          
+          ~CorrThread() {};
+          
+          inline bool getReturnValue() const
+          {
+            return returnValue_;
+          };
+          
+        protected :
+        
+          /** A reference to a prog
+          ress instance. */        
+          TePDIPIManager& progress_;
+          
+          /** The return value for this thread instance execution
+          ( true if ok, false on errors). */
+          bool returnValue_;
+          
+          /** The abort flag to be checked/set when an error occurs. */          
+          bool& abortFlag_;
+          
+          /** The best correlation value. */          
+          double& bestCorValue_;
+          
+          /** The line where the best correlation was found (upper left). */          
+          unsigned int& bestCorLine_;
+                    
+          /** The line where the best correlation was found (upper left). */          
+          unsigned int& bestCorCol_;    
+                          
+          /** The next line to process. */          
+          unsigned int& nextLineToProcess_;   
+          
+          /** The no-data value */          
+          double dummyValue_;             
+                
+          /** The biggest input matrix. */          
+          ImgMatrixT& bigMatrix_;
+          
+          /** The biggest input matrix. */          
+          ImgMatrixT& smallMatrix_;          
+          
+          /** The global mutex to use when reading input data. */          
+          TeMutex& mutex_;
+                           
+          //overload
+          void run();                           
+      };           
+    
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial 
+       * state.
+       */
+      void ResetState( const TePDIParameters& params );
+      
+      /**
+       * @brief A thread entry point to load raster data into
+       * a simple matrix.
+       * @param params The parameters needed for the thread 
+       * execution.
+       * @return true if OK, false on errors.
+       */
+      static bool loadImage( const TeThreadParameters& params );
+      
+      /**
+       * @brief Save the output matrix to a geotiff file.
+       * @param input_matrix Input matrix.
+       * @param out_file_name Output file name.
+       * @param maxima_points The maxima points to be
+       * filled with 255
+       */      
+      static void matrix2Tiff( 
+        const ImgMatrixT& input_matrix,
+        const std::string& out_file_name,
+        const std::vector< TeCoord2D >& maxima_points );
+        
+      /**
+       * @brief Save the output matrix to a geotiff file.
+       * @param input_raster Input raster.
+       * @param raster_channel Raster channel.
+       * @param out_file_name Output file name.
+       * @param maxima_points The maxima points to be drawed.
+       * @param out_tie_points_ptr The tie-points to be drawed.
+       * @param tie_points_space The tie-points space 
+       * (pt1 or pt2).
+       */      
+      static void raster2Tiff( 
+        const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+        unsigned int raster_channel,
+        const std::string& out_file_name,
+        const std::vector< TeCoord2D >& maxima_points,
+        const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
+        unsigned int tie_points_space );        
+        
+      /**
+       * @brief Check tie-points indexes for repeated values.
+       * @param maximas Tie-points vector.
+       * @return true if OK, false on errors.
+       */
+      bool checkTPs( 
+        const TeCoordPairVect& tpsvec ) const;         
+  };
+  
+/** @example TePDICorrelationMatching_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif
diff --git a/src/terralib/image_processing/TePDIDecorrelationEnhancement.cpp b/src/terralib/image_processing/TePDIDecorrelationEnhancement.cpp
index dae5f75..f97d040 100644
--- a/src/terralib/image_processing/TePDIDecorrelationEnhancement.cpp
+++ b/src/terralib/image_processing/TePDIDecorrelationEnhancement.cpp
@@ -1,170 +1,170 @@
-#include "TePDIDecorrelationEnhancement.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-#include "TePDITypes.hpp"
-#include "TePDIStatistic.hpp"
-#include "TePDIPrincipalComponents.hpp"
-#include <TeMatrix.h>
-#include <TeUtils.h>
-#include <math.h>
-
-TePDIDecorrelationEnhancement::TePDIDecorrelationEnhancement()
-{
-}
-
-TePDIDecorrelationEnhancement::~TePDIDecorrelationEnhancement()
-{
-}
-
-void TePDIDecorrelationEnhancement::ResetState(const TePDIParameters&)
-{
-}
-
-bool TePDIDecorrelationEnhancement::CheckParameters(const TePDIParameters& parameters) const
-{
-/* Input rasters and bands checking */
-
-	TePDITypes::TePDIRasterVectorType input_rasters;
-	
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
-	TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
-	
-	std::vector<int> bands;
-	
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
-	TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), "Invalid parameter: bands number");
-
-	for( unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); ++input_rasters_index )
-	{
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
-		TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[ " + Te2String(input_rasters_index) + " ]");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String( input_rasters_index ) + " with imcompatible number of columns" );
-		TEAGN_TRUE_OR_RETURN(((input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeRGB) || (input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeMultiBand)), "Invalid parameter - input_rasters (invalid photometric interpretation)");
-	}
-
-/* Output rasters checking */
-
-	TePDITypes::TePDIRasterVectorType output_rasters;
-
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
-	TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
-	TEAGN_TRUE_OR_RETURN(output_rasters.size() == input_rasters.size(), "Invalid parameter: output rasters size");
-
-	for(unsigned int input_rasters_index2 = 0; input_rasters_index2 < input_rasters.size(); ++input_rasters_index2)
-	{
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " inactive");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " not ready");
-	}
-
-	return true;
-}
-
-bool TePDIDecorrelationEnhancement::RunImplementation()
-{
-/********* Direct analysis *********/
-
-	TePDIPrincipalComponents::TePDIPCAType analysis_type = 
-	  TePDIPrincipalComponents::TePDIPCADirect;
-
-	TePDIParameters params_direct;
-
-	TePDITypes::TePDIRasterVectorType input_rasters;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
-
-	std::vector<int> bands_direct;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("bands", bands_direct), "Missing parameter: bands");
-
-	TePDITypes::TePDIRasterVectorType output_rasters;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
-
-	TePDITypes::TePDIRasterVectorType output_rasters_direct;
-	for (unsigned b = 0; b < output_rasters.size(); b++)
-	{
-		TePDITypes::TePDIRasterPtrType outRaster_direct;
-		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster_direct, 1, 1, 1, false, TeDOUBLE, 0), "RAM Raster " + Te2String(b) + " Alloc error");
-		output_rasters_direct.push_back(outRaster_direct);
-	}
-	
-	TeSharedPtr<TeMatrix> covariance_matrix(new TeMatrix);
-	
-	params_direct.SetParameter("analysis_type", analysis_type);
-	params_direct.SetParameter("input_rasters", input_rasters);
-	params_direct.SetParameter("bands", bands_direct);
-	params_direct.SetParameter("output_rasters", output_rasters_direct);
-	params_direct.SetParameter("covariance_matrix", covariance_matrix);
-	
-	TePDIPrincipalComponents pc_direct;
-	pc_direct.ToggleProgInt( progress_enabled_ );
-	TEAGN_TRUE_OR_THROW(pc_direct.Reset(params_direct), "Invalid Parameters");
-	TEAGN_TRUE_OR_THROW(pc_direct.Apply(), "Apply error");
-	
-/********* Enhancing pca components **********/
-	std::vector< int > bands_enhancement;
-	for (unsigned b = 0; b < output_rasters_direct.size(); b++)
-		bands_enhancement.push_back(0);
-
-	TePDIStatistic stat;
-	stat.ToggleProgInt( progress_enabled_ );
-	
-	TePDIParameters stat_pars;
-	stat_pars.SetParameter("rasters", output_rasters_direct);
-	stat_pars.SetParameter("bands", bands_enhancement);
-	
-	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
-
-	TeMatrix	std_matrix = stat.getStdDevMatrix(),
-			mean_matrix = stat.getMeanMatrix();
-	double	pixel,
-		gain,
-		offset;
-		
-  TePDIPIManager progress( "Enhancing PCA components", 
-    output_rasters_direct.size(), 
-    progress_enabled_ );
-
-	for (unsigned int b = 1; b < output_rasters_direct.size(); b++)
-	{
-		gain = std_matrix(0, 0) / std_matrix(b, 0);
-		offset = mean_matrix(0, b) - (gain * mean_matrix(0, b));
-		for (int i = 0; i < output_rasters_direct[0]->params().ncols_; i++)
-		{
-			for (int j = 0; j < output_rasters_direct[0]->params().nlines_; j++)
-				if (output_rasters_direct[b]->getElement(i, j, pixel))
-				{
-					pixel = gain * pixel + offset;
-					output_rasters_direct[b]->setElement(i, j, pixel);
-				}
-	  }
-	  
-    TEAGN_FALSE_OR_RETURN( progress.Increment(),
-      "Canceled by the user" );	  
-	}
-	
-	progress.Reset();
-
-/********* Inverse analysis *********/
-	analysis_type = TePDIPrincipalComponents::TePDIPCAInverse;
-	
-	TePDIParameters params_inverse;
-
-	std::vector< int > bands_inverse;
-	for (unsigned b = 0; b < output_rasters.size(); b++)
-		bands_inverse.push_back(0);
-
-	params_inverse.SetParameter("analysis_type", analysis_type);
-	params_inverse.SetParameter("input_rasters", output_rasters_direct);
-	params_inverse.SetParameter("bands", bands_inverse);
-	params_inverse.SetParameter("output_rasters", output_rasters);
-	params_inverse.SetParameter("covariance_matrix", covariance_matrix);
-	
-	TePDIPrincipalComponents pc_inverse;
-	pc_inverse.ToggleProgInt( progress_enabled_ );
-	TEAGN_TRUE_OR_THROW(pc_inverse.Reset(params_inverse), "Invalid Parameters");
-	TEAGN_TRUE_OR_THROW(pc_inverse.Apply(), "Apply error");
-
-	
-	return true;
-}
+#include "TePDIDecorrelationEnhancement.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+#include "TePDITypes.hpp"
+#include "TePDIStatistic.hpp"
+#include "TePDIPrincipalComponents.hpp"
+#include <TeMatrix.h>
+#include <TeUtils.h>
+#include <math.h>
+
+TePDIDecorrelationEnhancement::TePDIDecorrelationEnhancement()
+{
+}
+
+TePDIDecorrelationEnhancement::~TePDIDecorrelationEnhancement()
+{
+}
+
+void TePDIDecorrelationEnhancement::ResetState(const TePDIParameters&)
+{
+}
+
+bool TePDIDecorrelationEnhancement::CheckParameters(const TePDIParameters& parameters) const
+{
+/* Input rasters and bands checking */
+
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+	TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
+	
+	std::vector<int> bands;
+	
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+	TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), "Invalid parameter: bands number");
+
+	for( unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); ++input_rasters_index )
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
+		TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[ " + Te2String(input_rasters_index) + " ]");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String( input_rasters_index ) + " with imcompatible number of columns" );
+		TEAGN_TRUE_OR_RETURN(((input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeRGB) || (input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeMultiBand)), "Invalid parameter - input_rasters (invalid photometric interpretation)");
+	}
+
+/* Output rasters checking */
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() == input_rasters.size(), "Invalid parameter: output rasters size");
+
+	for(unsigned int input_rasters_index2 = 0; input_rasters_index2 < input_rasters.size(); ++input_rasters_index2)
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " not ready");
+	}
+
+	return true;
+}
+
+bool TePDIDecorrelationEnhancement::RunImplementation()
+{
+/********* Direct analysis *********/
+
+	TePDIPrincipalComponents::TePDIPCAType analysis_type = 
+	  TePDIPrincipalComponents::TePDIPCADirect;
+
+	TePDIParameters params_direct;
+
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+
+	std::vector<int> bands_direct;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("bands", bands_direct), "Missing parameter: bands");
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+
+	TePDITypes::TePDIRasterVectorType output_rasters_direct;
+	for (unsigned b = 0; b < output_rasters.size(); b++)
+	{
+		TePDITypes::TePDIRasterPtrType outRaster_direct;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster_direct, 1, 1, 1, false, TeDOUBLE, 0), "RAM Raster " + Te2String(b) + " Alloc error");
+		output_rasters_direct.push_back(outRaster_direct);
+	}
+	
+	TeSharedPtr<TeMatrix> covariance_matrix(new TeMatrix);
+	
+	params_direct.SetParameter("analysis_type", analysis_type);
+	params_direct.SetParameter("input_rasters", input_rasters);
+	params_direct.SetParameter("bands", bands_direct);
+	params_direct.SetParameter("output_rasters", output_rasters_direct);
+	params_direct.SetParameter("covariance_matrix", covariance_matrix);
+	
+	TePDIPrincipalComponents pc_direct;
+	pc_direct.ToggleProgInt( progress_enabled_ );
+	TEAGN_TRUE_OR_THROW(pc_direct.Reset(params_direct), "Invalid Parameters");
+	TEAGN_TRUE_OR_THROW(pc_direct.Apply(), "Apply error");
+	
+/********* Enhancing pca components **********/
+	std::vector< int > bands_enhancement;
+	for (unsigned b = 0; b < output_rasters_direct.size(); b++)
+		bands_enhancement.push_back(0);
+
+	TePDIStatistic stat;
+	stat.ToggleProgInt( progress_enabled_ );
+	
+	TePDIParameters stat_pars;
+	stat_pars.SetParameter("rasters", output_rasters_direct);
+	stat_pars.SetParameter("bands", bands_enhancement);
+	
+	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+
+	TeMatrix	std_matrix = stat.getStdDevMatrix(),
+			mean_matrix = stat.getMeanMatrix();
+	double	pixel,
+		gain,
+		offset;
+		
+  TePDIPIManager progress( "Enhancing PCA components", 
+    output_rasters_direct.size(), 
+    progress_enabled_ );
+
+	for (unsigned int b = 1; b < output_rasters_direct.size(); b++)
+	{
+		gain = std_matrix(0, 0) / std_matrix(b, 0);
+		offset = mean_matrix(0, b) - (gain * mean_matrix(0, b));
+		for (int i = 0; i < output_rasters_direct[0]->params().ncols_; i++)
+		{
+			for (int j = 0; j < output_rasters_direct[0]->params().nlines_; j++)
+				if (output_rasters_direct[b]->getElement(i, j, pixel))
+				{
+					pixel = gain * pixel + offset;
+					output_rasters_direct[b]->setElement(i, j, pixel);
+				}
+	  }
+	  
+    TEAGN_FALSE_OR_RETURN( progress.Increment(),
+      "Canceled by the user" );	  
+	}
+	
+	progress.Reset();
+
+/********* Inverse analysis *********/
+	analysis_type = TePDIPrincipalComponents::TePDIPCAInverse;
+	
+	TePDIParameters params_inverse;
+
+	std::vector< int > bands_inverse;
+	for (unsigned b = 0; b < output_rasters.size(); b++)
+		bands_inverse.push_back(0);
+
+	params_inverse.SetParameter("analysis_type", analysis_type);
+	params_inverse.SetParameter("input_rasters", output_rasters_direct);
+	params_inverse.SetParameter("bands", bands_inverse);
+	params_inverse.SetParameter("output_rasters", output_rasters);
+	params_inverse.SetParameter("covariance_matrix", covariance_matrix);
+	
+	TePDIPrincipalComponents pc_inverse;
+	pc_inverse.ToggleProgInt( progress_enabled_ );
+	TEAGN_TRUE_OR_THROW(pc_inverse.Reset(params_inverse), "Invalid Parameters");
+	TEAGN_TRUE_OR_THROW(pc_inverse.Apply(), "Apply error");
+
+	
+	return true;
+}
diff --git a/src/terralib/image_processing/TePDIDecorrelationEnhancement.hpp b/src/terralib/image_processing/TePDIDecorrelationEnhancement.hpp
index 5577e6d..ebd81dd 100644
--- a/src/terralib/image_processing/TePDIDecorrelationEnhancement.hpp
+++ b/src/terralib/image_processing/TePDIDecorrelationEnhancement.hpp
@@ -1,88 +1,88 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIDECORRELATIONENHANCEMENT_HPP
-  #define TEPDIDECORRELATIONENHANCEMENT_HPP
-
-  #include "TePDIAlgorithm.hpp"
-
-  /**
-   * @brief This is the class for principal components generation.
-   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-   * @ingroup TePDIGeneralAlgoGroup
-   *
-   * @note The required parameters are:
-   *
-   * @param input_rasters ( TePDITypes::TePDIRasterVectorType )
-   * @param output_rasters ( TePDITypes::TePDIRasterVectorType )
-   * @param bands ( std::vector< int > ) - The bands from each input raster.
-   *
-   */
-  class PDI_DLL TePDIDecorrelationEnhancement : public TePDIAlgorithm {
-    public :
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIDecorrelationEnhancement();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIDecorrelationEnhancement();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-      
-    protected :
-      
-      /**
-       * @brief Decide the direction of the analysis based on the analysis_type parameter.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-  };
-  
-/** @example TePDIDecorrelationEnhancement_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDIPRINCIPALCOMPONENTS_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIDECORRELATIONENHANCEMENT_HPP
+  #define TEPDIDECORRELATIONENHANCEMENT_HPP
+
+  #include "TePDIAlgorithm.hpp"
+
+  /**
+   * @brief Decorrelation Enhancement using principal components.
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @ingroup TePDIEnhancementGroup
+   *
+   * @note The required parameters are:
+   *
+   * @param input_rasters ( TePDITypes::TePDIRasterVectorType )
+   * @param output_rasters ( TePDITypes::TePDIRasterVectorType )
+   * @param bands ( std::vector< int > ) - The bands from each input raster.
+   *
+   */
+  class PDI_DLL TePDIDecorrelationEnhancement : public TePDIAlgorithm {
+    public :
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIDecorrelationEnhancement();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIDecorrelationEnhancement();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+      
+    protected :
+      
+      /**
+       * @brief Decide the direction of the analysis based on the analysis_type parameter.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+  };
+  
+/** @example TePDIDecorrelationEnhancement_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDIPRINCIPALCOMPONENTS_HPP
diff --git a/src/terralib/image_processing/TePDIDefines.hpp b/src/terralib/image_processing/TePDIDefines.hpp
old mode 100755
new mode 100644
index ef9566f..d052d16
--- a/src/terralib/image_processing/TePDIDefines.hpp
+++ b/src/terralib/image_processing/TePDIDefines.hpp
@@ -1,128 +1,133 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-/**
- * @defgroup PDIModule Image Processing.
- */  
- 
-/**
- * @defgroup PDIAlgorithms Image Processing Algorithms.
- * @ingroup PDIModule
- */ 
- 
-/**
- * @defgroup PDIAlgorithmsFactories Algorithms factories.
- * @ingroup PDIModule
- */   
- 
-/**
- * @defgroup TePDIMosaicGroup Mosaic algorithms.
- * @ingroup PDIAlgorithms
- */   
- 
-/**
- * @defgroup TePDISegmentationGroup Segmentation algorithms.
- * @ingroup PDIAlgorithms
- */
- 
-/**
- * @defgroup TePDIFiltersGroup Filtering algorithms.
- * @ingroup PDIAlgorithms
- */ 
- 
-/**
- * @defgroup TePDIGeneralAlgoGroup General purpose algorithms.
- * @ingroup PDIAlgorithms
- */ 
- 
-/**
- * @defgroup PDIStrategies Algorithm strategies.
- * @ingroup PDIModule
- */   
- 
-/**
- * @defgroup PDIStrategiesFactories Strategies factories.
- * @ingroup PDIModule
- */   
- 
-/**
- * @defgroup PDIClassificationAlgorithms Classification algorithms.
- * @ingroup PDIAlgorithms
- */  
-
-/**
- * @defgroup PDIWaveletsAlgorithms Wavelets algorithms.
- * @ingroup PDIAlgorithms
- */  
-  
-/**
- * @defgroup PDIBlendingStrategies Blending strategies.
- * @ingroup PDIStrategies
- */   
- 
-/**
- * @defgroup PDIAux Image processing auxiliary classes/methods.
- * @ingroup PDIModule
- */    
- 
-/**
- * @defgroup PDIFusionAlgorithms Image Fusion algorithms.
- * @ingroup PDIAlgorithms
- */   
- 
-/**
- * @defgroup PDIMatchingAlgorithms Image matching algorithms.
- * @ingroup PDIAlgorithms
- */  
-
-/**
- * @file TePDIDefines.hpp
- * @brief This file contains a set of definitions used by PDI module.
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- */
-
-#ifndef TEPDIDEFINES_HPP
-  #define TEPDIDEFINES_HPP
-  
-  #include <TeDefines.h>
-
-  /** @defgroup PDI_AS_DLL macros.
-    @{
-  */
-
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    #ifdef PDI_AS_DLL
-      #define PDI_DLL __declspec(dllexport)
-    #else
-      #define PDI_DLL __declspec(dllimport)
-    #endif  
-  #elif TePLATFORM == TePLATFORMCODE_LINUX
-    #define PDI_DLL
-  #else
-    #error "ERROR: Unsupported platform"
-  #endif
-
-  /** @} */ 
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+/**
+ * @defgroup PDIModule Image Processing.
+ */  
+ 
+/**
+ * @defgroup PDIAlgorithms Image Processing Algorithms.
+ * @ingroup PDIModule
+ */ 
+ 
+/**
+ * @defgroup PDIAlgorithmsFactories Algorithms factories.
+ * @ingroup PDIModule
+ */   
+ 
+/**
+ * @defgroup TePDIMosaicGroup Mosaic algorithms.
+ * @ingroup PDIAlgorithms
+ */   
+ 
+/**
+ * @defgroup TePDISegmentationGroup Segmentation algorithms.
+ * @ingroup PDIAlgorithms
+ */
+ 
+/**
+ * @defgroup TePDIFiltersGroup Filtering algorithms.
+ * @ingroup PDIAlgorithms
+ */ 
+ 
+/**
+ * @defgroup TePDIEnhancementGroup Image enhancement algorithms.
+ * @ingroup PDIAlgorithms
+ */  
+ 
+/**
+ * @defgroup TePDIGeneralAlgoGroup General purpose algorithms.
+ * @ingroup PDIAlgorithms
+ */ 
+ 
+/**
+ * @defgroup PDIStrategies Algorithm strategies.
+ * @ingroup PDIModule
+ */   
+ 
+/**
+ * @defgroup PDIStrategiesFactories Strategies factories.
+ * @ingroup PDIModule
+ */   
+ 
+/**
+ * @defgroup PDIClassificationAlgorithms Classification algorithms.
+ * @ingroup PDIAlgorithms
+ */  
+
+/**
+ * @defgroup PDIWaveletsAlgorithms Wavelets algorithms.
+ * @ingroup PDIAlgorithms
+ */  
+  
+/**
+ * @defgroup PDIBlendingStrategies Blending strategies.
+ * @ingroup PDIStrategies
+ */   
+ 
+/**
+ * @defgroup PDIAux Image processing auxiliary classes/methods.
+ * @ingroup PDIModule
+ */    
+ 
+/**
+ * @defgroup PDIFusionAlgorithms Image Fusion algorithms.
+ * @ingroup PDIAlgorithms
+ */   
+ 
+/**
+ * @defgroup PDIMatchingAlgorithms Image matching algorithms.
+ * @ingroup PDIAlgorithms
+ */  
+
+/**
+ * @file TePDIDefines.hpp
+ * @brief This file contains a set of definitions used by PDI module.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ */
+
+#ifndef TEPDIDEFINES_HPP
+  #define TEPDIDEFINES_HPP
+  
+  #include <TeDefines.h>
+
+  /** @defgroup PDI_AS_DLL macros.
+    @{
+  */
+
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    #ifdef PDI_AS_DLL
+      #define PDI_DLL __declspec(dllexport)
+    #else
+      #define PDI_DLL __declspec(dllimport)
+    #endif  
+  #elif TePLATFORM == TePLATFORMCODE_LINUX
+    #define PDI_DLL
+  #else
+    #error "ERROR: Unsupported platform"
+  #endif
+
+  /** @} */ 
+
+#endif
diff --git a/src/terralib/image_processing/TePDIEMClas.cpp b/src/terralib/image_processing/TePDIEMClas.cpp
index 7f4c2af..9737345 100644
--- a/src/terralib/image_processing/TePDIEMClas.cpp
+++ b/src/terralib/image_processing/TePDIEMClas.cpp
@@ -1,428 +1,428 @@
-#include "TePDIEMClas.hpp"
-#include "TePDIMathFunctions.hpp"
-#include "TePDIStrategyFactory.hpp"
-#include "TePDIAlgorithmFactory.hpp"
-#include "TePDIUtils.hpp"
-
-#include <TeBox.h>
-#include <TeUtils.h>
-#include <TeRasterParams.h>
-#include <TeRaster.h>
-#include <TeAgnostic.h>
-
-void TePDIEMClas::ResetState( const TePDIParameters& )
-{
-
-}
-
-TePDIEMClas::TePDIEMClas()
-{
-};
-
-TePDIEMClas::~TePDIEMClas()
-{
-};
-
-bool TePDIEMClas::CheckParameters(const TePDIParameters& parameters) const
-{
-  // Checking input_rasters
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), 
-    "Missing parameter: input_rasters");
-  TEAGN_TRUE_OR_RETURN(input_rasters.size() > 0, 
-    "Invalid input rasters number");
-
-  vector<int> bands;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
-  TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), Te2String(input_rasters.size()) + " Invalid parameter: bands number " + Te2String(bands.size()));
-
-  for(unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); input_rasters_index++)
-  {
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of columns");
-  }
-
-  int M;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("classes_to_find", M), "Missing parameter: classes_to_find");
-  double e;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("epsilon", e), "Missing parameter: epsilon");
-  TEAGN_TRUE_OR_RETURN(e > 0, "Parameter epsilon must be > 0");
-  double s;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("shift_threshold", s), "Missing parameter: shift_threshold");
-  TEAGN_TRUE_OR_RETURN(e > 0, "Parameter shift_threshold must be > 0");
-
-  // Checking output_raster
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_raster", output_raster), "Missing parameter: output_raster");
-  TEAGN_TRUE_OR_RETURN(output_raster.isActive(), "Invalid parameter: output_raster inactive");
-  TEAGN_TRUE_OR_RETURN(output_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready");
-  return true;
-}
-
-bool TePDIEMClas::RunImplementation()
-{
-  // Setting the parameters
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  params_.GetParameter("input_rasters", input_rasters);
-
-  vector<int> bands;
-  params_.GetParameter("bands", bands);
-
-  W = input_rasters[0]->params().ncols_;
-  H = input_rasters[0]->params().nlines_;
-  N = 0;
-  TOTAL_ATTRIBUTES = bands.size();
-  params_.GetParameter("classes_to_find", M);
-  
-  if( params_.CheckParameter< int >( "sx" ) )
-    params_.GetParameter("sx", SX);
-  else
-    SX = 1;
-    
-  if( params_.CheckParameter< int >( "sy" ) )
-    params_.GetParameter("sy", SY);
-  else
-    SY = 1;
-    
-  if( params_.CheckParameter< int >( "max_iterations" ) )
-    params_.GetParameter("max_iterations", MAX_ITERATIONS);
-  else
-    MAX_ITERATIONS = 3;
-    
-  if( params_.CheckParameter< double >( "epsilon" ) )
-    params_.GetParameter("epsilon", EPSILON);
-  else
-    EPSILON = 15.0;
-    
-  if( params_.CheckParameter< double >( "shift_threshold" ) )
-    params_.GetParameter("shift_threshold", SHIFT_THRESHOLD);
-  else
-    SHIFT_THRESHOLD = 40.0;
-
-  bool no_means = true;
-  TeSharedPtr<TeMatrix> input_means;
-  if( params_.CheckParameter< TeSharedPtr<TeMatrix> >( "input_means" ) ) {
-    params_.GetParameter("input_means", input_means);
-    no_means = false;
-  }
-
-  for (int i = 0; i < W; i+=SX)
-    for (int j = 0; j < H; j+=SY)
-      N++;
-  double  START_COVAR = 1000.0,
-      *variations = (double *) malloc(M * sizeof(double));
-
-  // Start the algorithm
-  vector<TeMatrix>  covars, // covariance matrix
-            old_covars, // to prevent problems in inverse function
-            means, // mean vectors
-            old_means, // to compare difference during the E-M process
-            X, // image points
-            original_X; // original image points (hole set)
-  vector<double>  P; // Probability for each cluster
-  double **P_C_x = (double **) malloc(M * sizeof(double)), // Probability a posteriori
-      **original_P_C_x = (double **) malloc(M * sizeof(double));
-
-  // Initializing data...
-  for (int i = 0; i < M; i++)
-  {
-    P_C_x[i] = (double *) malloc(N * sizeof(double));
-    original_P_C_x[i] = (double *) malloc(W * H * sizeof(double));
-    for (int j = 0; j < N; j++)
-      P_C_x[i][j] = 0.0;
-    for (int j = 0; j < W * H; j++)
-      original_P_C_x[i][j] = 0.0;
-  }
-  // initialize covariances, means and P
-  TeMatrix tmp_covar;
-  tmp_covar.Init(TOTAL_ATTRIBUTES, START_COVAR);
-  TeMatrix tmp_mean;
-
-  unsigned seed = (unsigned)time(0);
-  srand(seed);
-  for (int j = 0; j < M; j++)
-  {
-    double *random_means = (double *)malloc(TOTAL_ATTRIBUTES * sizeof(double));
-    if (no_means)
-    {
-      for (int r = 0; r < TOTAL_ATTRIBUTES; r++)
-        random_means[r] = rand() % 255;
-    }
-    else
-    {
-      for (int r = 0; r < TOTAL_ATTRIBUTES; r++)
-        random_means[r] = input_means->operator()(r, j);
-    }
-
-    tmp_mean.Init(TOTAL_ATTRIBUTES, 1, random_means);
-    means.push_back(tmp_mean);
-    old_means.push_back(tmp_mean);
-    covars.push_back(tmp_covar);
-    old_covars.push_back(tmp_covar);
-    P.push_back((double) 1 / M);
-	free(random_means);
-  }
-
-  // Generates the attributes vector
-  TeMatrix tmp_X;
-
-  double *tmp = (double*) malloc(TOTAL_ATTRIBUTES * sizeof(double));
-  for (int i = 0; i < W; i += SX)
-    for (int j = 0; j < H; j += SY)
-    {
-      for (int b = 0; b < TOTAL_ATTRIBUTES; b++)
-        input_rasters[b]->getElement(i, j, tmp[b], bands[b]);
-      tmp_X.Init(TOTAL_ATTRIBUTES, 1, tmp);
-      X.push_back(tmp_X);
-    }
-
-  TePDIPIManager p("Generating Attributes Vector", W, progress_enabled_);
-  // Store the hole set of pixels
-  for (int i = 0; i < W; i++)
-  {
-    for (int j = 0; j < H; j++)
-    {
-      for (int b = 0; b < TOTAL_ATTRIBUTES; b++)
-        input_rasters[b]->getElement(i, j, tmp[b], bands[b]);
-
-      tmp_X.Init(TOTAL_ATTRIBUTES, 1, tmp);
-      original_X.push_back(tmp_X);
-    }
-    p.Increment();
-  }
-  p.Toggle(false);
-  free(tmp);
-
-  // Start to estimate the data
-  int num_iterations = 0;
-  bool stop_condition = false;
-  TeMatrix  tmp_matrix,
-        tmp_inv,
-        tmp_trans,
-        tmp_prod;
-
-  TePDIPIManager p2("Estimating data", MAX_ITERATIONS, progress_enabled_);
-  while (stop_condition == false)
-  {
-    // Calculate P_C_x
-    for (int j = 0; j < M; j++)
-    {
-      for (int k = 0; k < N; k++)
-      {
-        double denom = 0.0;
-        for (int k1 = 0; k1 < M; k1++)
-        {
-          tmp_matrix = X[k] - means[k1];
-          if (!covars[k1].Inverse(tmp_inv))
-          {
-            covars[k1].Init(TOTAL_ATTRIBUTES, START_COVAR);
-            covars[k1].Inverse(tmp_inv);
-          }
-          tmp_matrix.Transpose(tmp_trans);
-          tmp_prod.Init();
-          tmp_prod = tmp_trans * tmp_inv * tmp_matrix;
-
-          denom += pow(covars[k1].Determinant(), -0.5) * exp(-0.5 * tmp_prod(0, 0)) * P[k1];
-        }
-
-        tmp_matrix = X[k] - means[j];
-
-
-        if (!covars[j].Inverse(tmp_inv))
-        {
-          covars[j].Init(TOTAL_ATTRIBUTES, START_COVAR);
-          covars[j].Inverse(tmp_inv);
-        }
-
-        tmp_matrix.Transpose(tmp_trans);
-        tmp_prod = tmp_trans * tmp_inv * tmp_matrix;
-
-        P_C_x[j][k] = pow(covars[j].Determinant(), -0.5) * exp(-0.5 * tmp_prod(0,0)) * P[j] / denom;
-      }
-    }
-
-    // Update means, covariances and Probabilities
-    for (int j = 0; j < M; j++)
-    {
-      double tmp_denom = 0.0;
-      TeMatrix  tmp_num_mean,
-            tmp_num_covar,
-            tmp_sub;
-      tmp_num_mean.Init(TOTAL_ATTRIBUTES, 1, 0.0);
-      tmp_num_covar.Init(TOTAL_ATTRIBUTES, 0.0);
-
-      for (int k = 1; k < N; k++)
-      {
-        // sum for mean numerator
-        tmp_num_mean = tmp_num_mean + P_C_x[j][k] * X[k];
-        // sum for both denominators
-        tmp_denom += P_C_x[j][k];
-        // sum for covar numerator
-        tmp_matrix = X[k] - means[j];
-        tmp_matrix.Transpose(tmp_trans);
-        tmp_prod = tmp_matrix * tmp_trans;
-        tmp_num_covar = tmp_num_covar + P_C_x[j][k] * tmp_prod;
-      }
-
-      means[j] =  (1 / tmp_denom) * tmp_num_mean;
-      covars[j] = (1 / tmp_denom) * tmp_num_covar;
-      P[j] = tmp_denom / N;
-
-      tmp_sub = means[j] - old_means[j];
-      tmp_sub.Transpose(tmp_trans);
-      tmp_prod = tmp_trans * tmp_sub;
-      variations[j] = sqrt(tmp_prod(0, 0));
-    }
-
-    TeMatrix  tmp_sub,
-          shift;
-
-    shift.Init(TOTAL_ATTRIBUTES, 1);
-    for (int a = 0; a < TOTAL_ATTRIBUTES; a++)
-      shift(a, 0) = rand() % 255;
-    for (int j = 0; j < M; j++)
-      for (int j1 = (j + 1); j1 < M; j1++)
-      {
-        tmp_sub = means[j] - means[j1];
-        tmp_sub.Transpose(tmp_trans);
-        tmp_prod = tmp_trans * tmp_sub;
-        if (sqrt(tmp_prod(0, 0)) < SHIFT_THRESHOLD)
-        {
-          for (int a = 0; a < TOTAL_ATTRIBUTES; a++)
-            shift(a, 0) = rand() % 255;
-
-          means[j1] = shift;
-          covars[j1] = tmp_covar;
-        }
-      }
-
-    double variation = 0.0;
-    for (int j = 0; j < M; j++)
-      if (variations[j] > variation)
-        variation = variations[j];
-
-    old_means = means;
-    old_covars = covars;
-    if (++num_iterations >= MAX_ITERATIONS)
-      stop_condition = true;
-	p2.Increment();
-    if (variation < EPSILON)
-      stop_condition = true;
-  }
-  p2.Toggle(false);
-  free(variations);
-
-  // Classifying input image
-  TePDIPIManager p3("Classifying input image", M, progress_enabled_);
-  double *class_covars_determinant = (double *) malloc(M * sizeof(double));
-  vector<TeMatrix> class_covars_inverse;
-  for (int j = 0; j < M; j++)
-  {
-    class_covars_determinant[j] = covars[j].Determinant();
-    covars[j].Inverse(tmp_inv);
-    class_covars_inverse.push_back(tmp_inv);
-  }
-  for (int j = 0; j < M; j++)
-  {
-    for (int k = 0; k < H * W; k++)
-    {
-      double denom = 0.0;
-
-      for (int k1 = 0; k1 < M; k1++)
-      {
-        tmp_matrix = original_X[k] - means[k1];
-        tmp_matrix.Transpose(tmp_trans);
-        tmp_prod = tmp_trans * class_covars_inverse[k1] * tmp_matrix;
-
-        denom += pow(class_covars_determinant[k1], -0.5) * exp(-0.5 * tmp_prod(0, 0)) * P[k1];
-      }
-
-      tmp_matrix = original_X[k] - means[j];
-      tmp_matrix.Transpose(tmp_trans);
-      tmp_prod = tmp_trans * class_covars_inverse[j] * tmp_matrix;
-
-      original_P_C_x[j][k] = pow(class_covars_determinant[j], -0.5) * exp(-0.5 * tmp_prod(0,0)) * P[j] / denom;
-    }
-    p3.Increment();
-  }
-  p3.Toggle(false);
-  free(class_covars_determinant);
-
-  // Setting the output raster 
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params_.GetParameter("output_raster", output_raster);
-
-  TeRasterParams output_raster_params = output_raster->params();
-  output_raster_params.setDataType( TeUNSIGNEDCHAR );
-  output_raster_params.nBands( 1 );
-  if( input_rasters[0]->projection() != 0 ) 
-    output_raster_params.projection( input_rasters[0]->projection() );
-
-  output_raster_params.boxResolution( input_rasters[0]->params().box().x1(), 
-    input_rasters[0]->params().box().y1(), input_rasters[0]->params().box().x2(), 
-    input_rasters[0]->params().box().y2(), input_rasters[0]->params().resx_, 
-    input_rasters[0]->params().resy_ ); 
-
-  // Lut
-  output_raster_params.setPhotometric( TeRasterParams::TePallete );
-  output_raster_params.lutr_.clear();
-  output_raster_params.lutg_.clear();
-  output_raster_params.lutb_.clear();
-
-  vector<unsigned short> colors_R, colors_G, colors_B;
-  colors_R.push_back(0); colors_G.push_back(0); colors_B.push_back(255);
-  colors_R.push_back(0); colors_G.push_back(255); colors_B.push_back(0);
-  colors_R.push_back(255); colors_G.push_back(0); colors_B.push_back(0);
-  colors_R.push_back(0); colors_G.push_back(255); colors_B.push_back(255);
-  colors_R.push_back(255); colors_G.push_back(0); colors_B.push_back(255);
-  colors_R.push_back(255); colors_G.push_back(255); colors_B.push_back(0);
-  colors_R.push_back(255); colors_G.push_back(255); colors_B.push_back(255);
-  colors_R.push_back(0); colors_G.push_back(0); colors_B.push_back(0);
-  colors_R.push_back(200); colors_G.push_back(0); colors_B.push_back(0);
-  colors_R.push_back(0); colors_G.push_back(200); colors_B.push_back(0);
-  colors_R.push_back(0); colors_G.push_back(0); colors_B.push_back(200);
-  colors_R.push_back(0); colors_G.push_back(200); colors_B.push_back(200);
-  colors_R.push_back(200); colors_G.push_back(200); colors_B.push_back(0);
-  colors_R.push_back(200); colors_G.push_back(0); colors_G.push_back(200);
-  colors_R.push_back(184); colors_G.push_back(115); colors_B.push_back(51);
-  colors_R.push_back(217); colors_G.push_back(135); colors_B.push_back(25);
-  colors_R.push_back(133); colors_G.push_back(99); colors_B.push_back(99);
-  colors_R.push_back(217); colors_G.push_back(217); colors_B.push_back(25);
-  colors_R.push_back(207); colors_G.push_back(181); colors_B.push_back(59);
-  colors_R.push_back(205); colors_G.push_back(127); colors_B.push_back(50);
-  colors_R.push_back(230); colors_G.push_back(232); colors_B.push_back(250);
-  
-  unsigned color_index = 0;
-  for( int lut_index = 0 ; lut_index < M ; ++lut_index ) 
-  {
-    color_index = ( (unsigned) lut_index < colors_R.size() ? lut_index : 0 );
-    output_raster_params.lutr_.push_back( (unsigned short) colors_R[color_index] );
-    output_raster_params.lutg_.push_back( (unsigned short) colors_G[color_index] );
-    output_raster_params.lutb_.push_back( (unsigned short) colors_B[color_index] );
-  }
-
-  TEAGN_TRUE_OR_RETURN( output_raster->init( output_raster_params ), "Output raster reset error" );
-  output_raster->params().status_ = TeRasterParams::TeReadyToWrite;
-
-  TePDIPIManager p4("Generating output image", H * W, progress_enabled_);
-  int k = 0;
-  for (int c = 0; c < W; c++)
-    for (int l = 0; l < H; l++)
-    {
-      int  max = 0;
-      
-      for (int j = 0; j < M; j++)
-        if (original_P_C_x[j][k] > original_P_C_x[max][k])
-          max = j;
-      output_raster->setElement(c, l, max);
-      k++;
-      p4.Increment();
-    }
-  p4.Toggle(false);
-  free(original_P_C_x);
-  free(P_C_x);
-
-  return true;
-}
+#include "TePDIEMClas.hpp"
+#include "TePDIMathFunctions.hpp"
+#include "TePDIStrategyFactory.hpp"
+#include "TePDIAlgorithmFactory.hpp"
+#include "TePDIUtils.hpp"
+
+#include <TeBox.h>
+#include <TeUtils.h>
+#include <TeRasterParams.h>
+#include <TeRaster.h>
+#include <TeAgnostic.h>
+
+void TePDIEMClas::ResetState( const TePDIParameters& )
+{
+
+}
+
+TePDIEMClas::TePDIEMClas()
+{
+};
+
+TePDIEMClas::~TePDIEMClas()
+{
+};
+
+bool TePDIEMClas::CheckParameters(const TePDIParameters& parameters) const
+{
+  // Checking input_rasters
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), 
+    "Missing parameter: input_rasters");
+  TEAGN_TRUE_OR_RETURN(input_rasters.size() > 0, 
+    "Invalid input rasters number");
+
+  vector<int> bands;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+  TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), Te2String(input_rasters.size()) + " Invalid parameter: bands number " + Te2String(bands.size()));
+
+  for(unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); input_rasters_index++)
+  {
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of columns");
+  }
+
+  int M;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("classes_to_find", M), "Missing parameter: classes_to_find");
+  double e;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("epsilon", e), "Missing parameter: epsilon");
+  TEAGN_TRUE_OR_RETURN(e > 0, "Parameter epsilon must be > 0");
+  double s;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("shift_threshold", s), "Missing parameter: shift_threshold");
+  TEAGN_TRUE_OR_RETURN(e > 0, "Parameter shift_threshold must be > 0");
+
+  // Checking output_raster
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_raster", output_raster), "Missing parameter: output_raster");
+  TEAGN_TRUE_OR_RETURN(output_raster.isActive(), "Invalid parameter: output_raster inactive");
+  TEAGN_TRUE_OR_RETURN(output_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready");
+  return true;
+}
+
+bool TePDIEMClas::RunImplementation()
+{
+  // Setting the parameters
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  params_.GetParameter("input_rasters", input_rasters);
+
+  vector<int> bands;
+  params_.GetParameter("bands", bands);
+
+  W = input_rasters[0]->params().ncols_;
+  H = input_rasters[0]->params().nlines_;
+  N = 0;
+  TOTAL_ATTRIBUTES = bands.size();
+  params_.GetParameter("classes_to_find", M);
+  
+  if( params_.CheckParameter< int >( "sx" ) )
+    params_.GetParameter("sx", SX);
+  else
+    SX = 1;
+    
+  if( params_.CheckParameter< int >( "sy" ) )
+    params_.GetParameter("sy", SY);
+  else
+    SY = 1;
+    
+  if( params_.CheckParameter< int >( "max_iterations" ) )
+    params_.GetParameter("max_iterations", MAX_ITERATIONS);
+  else
+    MAX_ITERATIONS = 3;
+    
+  if( params_.CheckParameter< double >( "epsilon" ) )
+    params_.GetParameter("epsilon", EPSILON);
+  else
+    EPSILON = 15.0;
+    
+  if( params_.CheckParameter< double >( "shift_threshold" ) )
+    params_.GetParameter("shift_threshold", SHIFT_THRESHOLD);
+  else
+    SHIFT_THRESHOLD = 40.0;
+
+  bool no_means = true;
+  TeSharedPtr<TeMatrix> input_means;
+  if( params_.CheckParameter< TeSharedPtr<TeMatrix> >( "input_means" ) ) {
+    params_.GetParameter("input_means", input_means);
+    no_means = false;
+  }
+
+  for (int i = 0; i < W; i+=SX)
+    for (int j = 0; j < H; j+=SY)
+      N++;
+  double  START_COVAR = 1000.0,
+      *variations = (double *) malloc(M * sizeof(double));
+
+  // Start the algorithm
+  vector<TeMatrix>  covars, // covariance matrix
+            old_covars, // to prevent problems in inverse function
+            means, // mean vectors
+            old_means, // to compare difference during the E-M process
+            X, // image points
+            original_X; // original image points (hole set)
+  vector<double>  P; // Probability for each cluster
+  double **P_C_x = (double **) malloc(M * sizeof(double)), // Probability a posteriori
+      **original_P_C_x = (double **) malloc(M * sizeof(double));
+
+  // Initializing data...
+  for (int i = 0; i < M; i++)
+  {
+    P_C_x[i] = (double *) malloc(N * sizeof(double));
+    original_P_C_x[i] = (double *) malloc(W * H * sizeof(double));
+    for (int j = 0; j < N; j++)
+      P_C_x[i][j] = 0.0;
+    for (int j = 0; j < W * H; j++)
+      original_P_C_x[i][j] = 0.0;
+  }
+  // initialize covariances, means and P
+  TeMatrix tmp_covar;
+  tmp_covar.Init(TOTAL_ATTRIBUTES, START_COVAR);
+  TeMatrix tmp_mean;
+
+  unsigned seed = (unsigned)time(0);
+  srand(seed);
+  for (int j = 0; j < M; j++)
+  {
+    double *random_means = (double *)malloc(TOTAL_ATTRIBUTES * sizeof(double));
+    if (no_means)
+    {
+      for (int r = 0; r < TOTAL_ATTRIBUTES; r++)
+        random_means[r] = rand() % 255;
+    }
+    else
+    {
+      for (int r = 0; r < TOTAL_ATTRIBUTES; r++)
+        random_means[r] = input_means->operator()(r, j);
+    }
+
+    tmp_mean.Init(TOTAL_ATTRIBUTES, 1, random_means);
+    means.push_back(tmp_mean);
+    old_means.push_back(tmp_mean);
+    covars.push_back(tmp_covar);
+    old_covars.push_back(tmp_covar);
+    P.push_back((double) 1 / M);
+	free(random_means);
+  }
+
+  // Generates the attributes vector
+  TeMatrix tmp_X;
+
+  double *tmp = (double*) malloc(TOTAL_ATTRIBUTES * sizeof(double));
+  for (int i = 0; i < W; i += SX)
+    for (int j = 0; j < H; j += SY)
+    {
+      for (int b = 0; b < TOTAL_ATTRIBUTES; b++)
+        input_rasters[b]->getElement(i, j, tmp[b], bands[b]);
+      tmp_X.Init(TOTAL_ATTRIBUTES, 1, tmp);
+      X.push_back(tmp_X);
+    }
+
+  TePDIPIManager p("Generating Attributes Vector", W, progress_enabled_);
+  // Store the hole set of pixels
+  for (int i = 0; i < W; i++)
+  {
+    for (int j = 0; j < H; j++)
+    {
+      for (int b = 0; b < TOTAL_ATTRIBUTES; b++)
+        input_rasters[b]->getElement(i, j, tmp[b], bands[b]);
+
+      tmp_X.Init(TOTAL_ATTRIBUTES, 1, tmp);
+      original_X.push_back(tmp_X);
+    }
+    p.Increment();
+  }
+  p.Toggle(false);
+  free(tmp);
+
+  // Start to estimate the data
+  int num_iterations = 0;
+  bool stop_condition = false;
+  TeMatrix  tmp_matrix,
+        tmp_inv,
+        tmp_trans,
+        tmp_prod;
+
+  TePDIPIManager p2("Estimating data", MAX_ITERATIONS, progress_enabled_);
+  while (stop_condition == false)
+  {
+    // Calculate P_C_x
+    for (int j = 0; j < M; j++)
+    {
+      for (int k = 0; k < N; k++)
+      {
+        double denom = 0.0;
+        for (int k1 = 0; k1 < M; k1++)
+        {
+          tmp_matrix = X[k] - means[k1];
+          if (!covars[k1].Inverse(tmp_inv))
+          {
+            covars[k1].Init(TOTAL_ATTRIBUTES, START_COVAR);
+            covars[k1].Inverse(tmp_inv);
+          }
+          tmp_matrix.Transpose(tmp_trans);
+          tmp_prod.Init();
+          tmp_prod = tmp_trans * tmp_inv * tmp_matrix;
+
+          denom += pow(covars[k1].Determinant(), -0.5) * exp(-0.5 * tmp_prod(0, 0)) * P[k1];
+        }
+
+        tmp_matrix = X[k] - means[j];
+
+
+        if (!covars[j].Inverse(tmp_inv))
+        {
+          covars[j].Init(TOTAL_ATTRIBUTES, START_COVAR);
+          covars[j].Inverse(tmp_inv);
+        }
+
+        tmp_matrix.Transpose(tmp_trans);
+        tmp_prod = tmp_trans * tmp_inv * tmp_matrix;
+
+        P_C_x[j][k] = pow(covars[j].Determinant(), -0.5) * exp(-0.5 * tmp_prod(0,0)) * P[j] / denom;
+      }
+    }
+
+    // Update means, covariances and Probabilities
+    for (int j = 0; j < M; j++)
+    {
+      double tmp_denom = 0.0;
+      TeMatrix  tmp_num_mean,
+            tmp_num_covar,
+            tmp_sub;
+      tmp_num_mean.Init(TOTAL_ATTRIBUTES, 1, 0.0);
+      tmp_num_covar.Init(TOTAL_ATTRIBUTES, 0.0);
+
+      for (int k = 1; k < N; k++)
+      {
+        // sum for mean numerator
+        tmp_num_mean = tmp_num_mean + P_C_x[j][k] * X[k];
+        // sum for both denominators
+        tmp_denom += P_C_x[j][k];
+        // sum for covar numerator
+        tmp_matrix = X[k] - means[j];
+        tmp_matrix.Transpose(tmp_trans);
+        tmp_prod = tmp_matrix * tmp_trans;
+        tmp_num_covar = tmp_num_covar + P_C_x[j][k] * tmp_prod;
+      }
+
+      means[j] =  (1 / tmp_denom) * tmp_num_mean;
+      covars[j] = (1 / tmp_denom) * tmp_num_covar;
+      P[j] = tmp_denom / N;
+
+      tmp_sub = means[j] - old_means[j];
+      tmp_sub.Transpose(tmp_trans);
+      tmp_prod = tmp_trans * tmp_sub;
+      variations[j] = sqrt(tmp_prod(0, 0));
+    }
+
+    TeMatrix  tmp_sub,
+          shift;
+
+    shift.Init(TOTAL_ATTRIBUTES, 1);
+    for (int a = 0; a < TOTAL_ATTRIBUTES; a++)
+      shift(a, 0) = rand() % 255;
+    for (int j = 0; j < M; j++)
+      for (int j1 = (j + 1); j1 < M; j1++)
+      {
+        tmp_sub = means[j] - means[j1];
+        tmp_sub.Transpose(tmp_trans);
+        tmp_prod = tmp_trans * tmp_sub;
+        if (sqrt(tmp_prod(0, 0)) < SHIFT_THRESHOLD)
+        {
+          for (int a = 0; a < TOTAL_ATTRIBUTES; a++)
+            shift(a, 0) = rand() % 255;
+
+          means[j1] = shift;
+          covars[j1] = tmp_covar;
+        }
+      }
+
+    double variation = 0.0;
+    for (int j = 0; j < M; j++)
+      if (variations[j] > variation)
+        variation = variations[j];
+
+    old_means = means;
+    old_covars = covars;
+    if (++num_iterations >= MAX_ITERATIONS)
+      stop_condition = true;
+	p2.Increment();
+    if (variation < EPSILON)
+      stop_condition = true;
+  }
+  p2.Toggle(false);
+  free(variations);
+
+  // Classifying input image
+  TePDIPIManager p3("Classifying input image", M, progress_enabled_);
+  double *class_covars_determinant = (double *) malloc(M * sizeof(double));
+  vector<TeMatrix> class_covars_inverse;
+  for (int j = 0; j < M; j++)
+  {
+    class_covars_determinant[j] = covars[j].Determinant();
+    covars[j].Inverse(tmp_inv);
+    class_covars_inverse.push_back(tmp_inv);
+  }
+  for (int j = 0; j < M; j++)
+  {
+    for (int k = 0; k < H * W; k++)
+    {
+      double denom = 0.0;
+
+      for (int k1 = 0; k1 < M; k1++)
+      {
+        tmp_matrix = original_X[k] - means[k1];
+        tmp_matrix.Transpose(tmp_trans);
+        tmp_prod = tmp_trans * class_covars_inverse[k1] * tmp_matrix;
+
+        denom += pow(class_covars_determinant[k1], -0.5) * exp(-0.5 * tmp_prod(0, 0)) * P[k1];
+      }
+
+      tmp_matrix = original_X[k] - means[j];
+      tmp_matrix.Transpose(tmp_trans);
+      tmp_prod = tmp_trans * class_covars_inverse[j] * tmp_matrix;
+
+      original_P_C_x[j][k] = pow(class_covars_determinant[j], -0.5) * exp(-0.5 * tmp_prod(0,0)) * P[j] / denom;
+    }
+    p3.Increment();
+  }
+  p3.Toggle(false);
+  free(class_covars_determinant);
+
+  // Setting the output raster 
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter("output_raster", output_raster);
+
+  TeRasterParams output_raster_params = output_raster->params();
+  output_raster_params.setDataType( TeUNSIGNEDCHAR );
+  output_raster_params.nBands( 1 );
+  if( input_rasters[0]->projection() != 0 ) 
+    output_raster_params.projection( input_rasters[0]->projection() );
+
+  output_raster_params.boxResolution( input_rasters[0]->params().box().x1(), 
+    input_rasters[0]->params().box().y1(), input_rasters[0]->params().box().x2(), 
+    input_rasters[0]->params().box().y2(), input_rasters[0]->params().resx_, 
+    input_rasters[0]->params().resy_ ); 
+
+  // Lut
+  output_raster_params.setPhotometric( TeRasterParams::TePallete );
+  output_raster_params.lutr_.clear();
+  output_raster_params.lutg_.clear();
+  output_raster_params.lutb_.clear();
+
+  vector<unsigned short> colors_R, colors_G, colors_B;
+  colors_R.push_back(0); colors_G.push_back(0); colors_B.push_back(255);
+  colors_R.push_back(0); colors_G.push_back(255); colors_B.push_back(0);
+  colors_R.push_back(255); colors_G.push_back(0); colors_B.push_back(0);
+  colors_R.push_back(0); colors_G.push_back(255); colors_B.push_back(255);
+  colors_R.push_back(255); colors_G.push_back(0); colors_B.push_back(255);
+  colors_R.push_back(255); colors_G.push_back(255); colors_B.push_back(0);
+  colors_R.push_back(255); colors_G.push_back(255); colors_B.push_back(255);
+  colors_R.push_back(0); colors_G.push_back(0); colors_B.push_back(0);
+  colors_R.push_back(200); colors_G.push_back(0); colors_B.push_back(0);
+  colors_R.push_back(0); colors_G.push_back(200); colors_B.push_back(0);
+  colors_R.push_back(0); colors_G.push_back(0); colors_B.push_back(200);
+  colors_R.push_back(0); colors_G.push_back(200); colors_B.push_back(200);
+  colors_R.push_back(200); colors_G.push_back(200); colors_B.push_back(0);
+  colors_R.push_back(200); colors_G.push_back(0); colors_G.push_back(200);
+  colors_R.push_back(184); colors_G.push_back(115); colors_B.push_back(51);
+  colors_R.push_back(217); colors_G.push_back(135); colors_B.push_back(25);
+  colors_R.push_back(133); colors_G.push_back(99); colors_B.push_back(99);
+  colors_R.push_back(217); colors_G.push_back(217); colors_B.push_back(25);
+  colors_R.push_back(207); colors_G.push_back(181); colors_B.push_back(59);
+  colors_R.push_back(205); colors_G.push_back(127); colors_B.push_back(50);
+  colors_R.push_back(230); colors_G.push_back(232); colors_B.push_back(250);
+  
+  unsigned color_index = 0;
+  for( int lut_index = 0 ; lut_index < M ; ++lut_index ) 
+  {
+    color_index = ( (unsigned) lut_index < colors_R.size() ? lut_index : 0 );
+    output_raster_params.lutr_.push_back( (unsigned short) colors_R[color_index] );
+    output_raster_params.lutg_.push_back( (unsigned short) colors_G[color_index] );
+    output_raster_params.lutb_.push_back( (unsigned short) colors_B[color_index] );
+  }
+
+  TEAGN_TRUE_OR_RETURN( output_raster->init( output_raster_params ), "Output raster reset error" );
+  output_raster->params().status_ = TeRasterParams::TeReadyToWrite;
+
+  TePDIPIManager p4("Generating output image", H * W, progress_enabled_);
+  int k = 0;
+  for (int c = 0; c < W; c++)
+    for (int l = 0; l < H; l++)
+    {
+      int  max = 0;
+      
+      for (int j = 0; j < M; j++)
+        if (original_P_C_x[j][k] > original_P_C_x[max][k])
+          max = j;
+      output_raster->setElement(c, l, max);
+      k++;
+      p4.Increment();
+    }
+  p4.Toggle(false);
+  free(original_P_C_x);
+  free(P_C_x);
+
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIEMClas.hpp b/src/terralib/image_processing/TePDIEMClas.hpp
index a9795a3..66de4c0 100644
--- a/src/terralib/image_processing/TePDIEMClas.hpp
+++ b/src/terralib/image_processing/TePDIEMClas.hpp
@@ -1,142 +1,142 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIEMCLAS_HPP
-  #define TEPDIEMCLAS_HPP
-
-#include "TePDIAlgorithm.hpp"
-
-#include "TePDIRegion.hpp"
-#include "TePDICluster.hpp"
-
-#include <string>
-#include <set>
-
-  /**
-   * @brief EM classification algorithm.
-   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIClassificationAlgorithms
-   *
-   * @note The required parameters are:
-   *
-   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Input rasters
-   * @param bands (vector<int>) - Input bands from each raster.
-   * @param classes_to_find (int) - The number of classes to find.
-   * @param output_raster (TePDITypes::TePDIRasterPtrType) - Output raster.
-   *
-   * @note The optional parameters are:
-   *
-   * @param sx (int) - Sampling Rate X (default: 1).
-   * @param sy (int) - Sampling Rate Y (default: 1).
-   * @param max_iterations (int) - The maximum number of iterations (default: 3).
-   * @param epsilon (double) - stop criteria (default: 15).
-   * @param shift_threshold (double) - minimum distance between clusters means (default: 40).
-   * @param input_means (TeMatrix) - initial Matrix of means for each cluster [bands x clusters]
-   */
-
-  class PDI_DLL TePDIEMClas : public TePDIAlgorithm
-  {
-    private:
-      /**
-      * Width, Height of image
-      */
-      long W, H;
-  
-      /**
-      * Total Instances and Total Attributes
-      */
-      int N, TOTAL_ATTRIBUTES;
-  
-      /**
-      * Total Classes to find
-      */
-      int M;
-  
-      /**
-      * Sampling Rate, in X and Y directions
-      */
-      int SX, SY;
-  
-      /**
-      * Limit of iterations
-      */
-      int MAX_ITERATIONS;
-  
-      /**
-      * Stop Condition
-      */
-      double EPSILON;
-
-      /**
-      * Threshold for shift
-      */
-      double SHIFT_THRESHOLD;
-  
-    public :
-  
-      typedef TeSharedPtr< TePDIEMClas > pointer;
-      typedef const TeSharedPtr< TePDIEMClas > const_pointer;
-  
-      /**
-      * Default constructor
-      *
-      * @param factoryName Factory name.
-      */
-      TePDIEMClas();
-  
-      /**
-      * Default Destructor
-      */
-      ~TePDIEMClas();
-  
-      /**
-      * Checks if the supplied parameters fits the requirements of each
-      * PDI strategy.
-      *
-      * Error log messages must be generated. No exceptions generated.
-      *
-      * @param parameters The parameters to be checked.
-      * @return true if the parameters are OK. false if not.
-      */
-      bool CheckParameters(const TePDIParameters& parameters) const;
-  
-    protected :
-  
-    /**
-    * @brief Reset the internal state to the initial state.
-    *
-    * @param params The new parameters referent at initial state.
-    */
-    void ResetState( const TePDIParameters& );
-  
-    /**
-    * Runs the algorithm implementation.
-    *
-    * @return true if OK. false on errors.
-    */
-    bool RunImplementation();
-  };
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIEMCLAS_HPP
+  #define TEPDIEMCLAS_HPP
+
+#include "TePDIAlgorithm.hpp"
+
+#include "TePDIRegion.hpp"
+#include "TePDICluster.hpp"
+
+#include <string>
+#include <set>
+
+  /**
+   * @brief EM classification algorithm.
+   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIClassificationAlgorithms
+   *
+   * @note The required parameters are:
+   *
+   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Input rasters
+   * @param bands (vector<int>) - Input bands from each raster.
+   * @param classes_to_find (int) - The number of classes to find.
+   * @param output_raster (TePDITypes::TePDIRasterPtrType) - Output raster.
+   *
+   * @note The optional parameters are:
+   *
+   * @param sx (int) - Sampling Rate X (default: 1).
+   * @param sy (int) - Sampling Rate Y (default: 1).
+   * @param max_iterations (int) - The maximum number of iterations (default: 3).
+   * @param epsilon (double) - stop criteria (default: 15).
+   * @param shift_threshold (double) - minimum distance between clusters means (default: 40).
+   * @param input_means (TeMatrix) - initial Matrix of means for each cluster [bands x clusters]
+   */
+
+  class PDI_DLL TePDIEMClas : public TePDIAlgorithm
+  {
+    private:
+      /**
+      * Width, Height of image
+      */
+      long W, H;
+  
+      /**
+      * Total Instances and Total Attributes
+      */
+      int N, TOTAL_ATTRIBUTES;
+  
+      /**
+      * Total Classes to find
+      */
+      int M;
+  
+      /**
+      * Sampling Rate, in X and Y directions
+      */
+      int SX, SY;
+  
+      /**
+      * Limit of iterations
+      */
+      int MAX_ITERATIONS;
+  
+      /**
+      * Stop Condition
+      */
+      double EPSILON;
+
+      /**
+      * Threshold for shift
+      */
+      double SHIFT_THRESHOLD;
+  
+    public :
+  
+      typedef TeSharedPtr< TePDIEMClas > pointer;
+      typedef const TeSharedPtr< TePDIEMClas > const_pointer;
+  
+      /**
+      * Default constructor
+      *
+      * @param factoryName Factory name.
+      */
+      TePDIEMClas();
+  
+      /**
+      * Default Destructor
+      */
+      ~TePDIEMClas();
+  
+      /**
+      * Checks if the supplied parameters fits the requirements of each
+      * PDI strategy.
+      *
+      * Error log messages must be generated. No exceptions generated.
+      *
+      * @param parameters The parameters to be checked.
+      * @return true if the parameters are OK. false if not.
+      */
+      bool CheckParameters(const TePDIParameters& parameters) const;
+  
+    protected :
+  
+    /**
+    * @brief Reset the internal state to the initial state.
+    *
+    * @param params The new parameters referent at initial state.
+    */
+    void ResetState( const TePDIParameters& );
+  
+    /**
+    * Runs the algorithm implementation.
+    *
+    * @return true if OK. false on errors.
+    */
+    bool RunImplementation();
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDIEMClasFactory.cpp b/src/terralib/image_processing/TePDIEMClasFactory.cpp
index 7312de9..b5d4608 100644
--- a/src/terralib/image_processing/TePDIEMClasFactory.cpp
+++ b/src/terralib/image_processing/TePDIEMClasFactory.cpp
@@ -1,25 +1,25 @@
-
-#include "TePDIEMClasFactory.hpp"
-#include "TePDIEMClas.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIEMClasFactory::TePDIEMClasFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIEMClas" ) )
-{
-}
-
-TePDIEMClasFactory::~TePDIEMClasFactory()
-{
-}
-
-
-TePDIAlgorithm* TePDIEMClasFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIEMClas();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+
+#include "TePDIEMClasFactory.hpp"
+#include "TePDIEMClas.hpp"
+#include <TeAgnostic.h>
+
+
+TePDIEMClasFactory::TePDIEMClasFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIEMClas" ) )
+{
+}
+
+TePDIEMClasFactory::~TePDIEMClasFactory()
+{
+}
+
+
+TePDIAlgorithm* TePDIEMClasFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIEMClas();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIEMClasFactory.hpp b/src/terralib/image_processing/TePDIEMClasFactory.hpp
index 00e77e2..00fd69d 100644
--- a/src/terralib/image_processing/TePDIEMClasFactory.hpp
+++ b/src/terralib/image_processing/TePDIEMClasFactory.hpp
@@ -1,68 +1,68 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIEMCLASFACTORY_HPP
-  #define TEPDIEMCLASFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for EM classification algorithm factory.
-   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIEMClasFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIEMClasFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIEMClasFactory();
-      
-    protected :  
-      
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIEMClasFactory TePDIEMClasFactory_instance;
-  };  
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIEMCLASFACTORY_HPP
+  #define TEPDIEMCLASFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for EM classification algorithm factory.
+   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIEMClasFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIEMClasFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIEMClasFactory();
+      
+    protected :  
+      
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace {
+    static TePDIEMClasFactory TePDIEMClasFactory_instance;
+  };  
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIEspecData.cpp b/src/terralib/image_processing/TePDIEspecData.cpp
index 7249077..562f65b 100644
--- a/src/terralib/image_processing/TePDIEspecData.cpp
+++ b/src/terralib/image_processing/TePDIEspecData.cpp
@@ -1,95 +1,95 @@
-#include "TePDIEspecData.hpp"
-#include <iostream>
-
-using namespace std;
-
-TePDIEspecData::TePDIEspecData()
-{
-};
-
-TePDIEspecData::~TePDIEspecData()
-{
-};
-
-bool TePDIEspecData::Init(int nband)
-{
-  int b;
-  int fat = (nband*nband + nband)/2;
-  
-  if( nban != nband )
-  {
-    //sum3 = new double[nband];
-    //sum4 = new double[nband];
-    //median = new double[nband];
-    //sum = new double[nband];
-    //sumbij = new double[fat];
-  }
-  
-  npix = 0;
-  nban = nband;
-  for ( b = 0; b < nban; b++)
-  {
-    sum.push_back(0.0);
-    //sum3[b] = 0.0;
-    //sum4[b] = 0.0;
-    //median[b] = 0.0;
-  }
-  for ( b = 0; b < fat; b++)
-    sumbij.push_back(0.0);
-    
-  return true;
-  
-}
-
-void TePDIEspecData::Add(double *pixel)
-{
-  npix++;
-  int k = 0;
-  double aux;
-  for (int b = 0; b < nban; b++)
-  {
-    sum[b] += (double) pixel[b];
-    aux = (double) pixel[b] * (double) pixel[b] * (double) pixel[b];
-    //sum3[b] += aux;
-    //sum4[b] += aux * (double) pixel[b];
-    for( int bo = 0; bo <= b; bo++, k++)
-      sumbij[k] = sumbij[k] + ((double) pixel[b] * (double) pixel[bo]);
-  }
-}
-
-float TePDIEspecData::Covar(int i, int j)const
-{
-  float cov = 0;
-  if(i < nban &&  j < nban && npix > 0)
-  {
-    int k;
-    if(i >= j)
-      k = (i * (i + 1)) / 2 + j;
-    else 
-      k = (j * (j + 1)) / 2 + i;
-    cov = (float) (sumbij[k] / (double) npix - sum[i] / (double) npix * sum[j] / (double) npix);
-  }
-  else cov = 0;
-
-  return cov;
-}
-
-TeMatrix TePDIEspecData::Covariance()const
-{
-  TeMatrix cov;
-  cov.Init(nban, nban, 0.0);
-
-  for(int i = 0; i < nban; i++)
-    for(int j = 0; j < nban; j++)
-      cov(i,j) = (double) Covar(i,j);
-
-  return cov;
-}
-
-float TePDIEspecData::Mean(int i)const
-{
-  if(i < nban && i >= 0 && npix > 0)
-    return (float) (sum[i] / npix);
-
-  return 0.0;
-}
+#include "TePDIEspecData.hpp"
+#include <iostream>
+
+using namespace std;
+
+TePDIEspecData::TePDIEspecData()
+{
+};
+
+TePDIEspecData::~TePDIEspecData()
+{
+};
+
+bool TePDIEspecData::Init(int nband)
+{
+  int b;
+  int fat = (nband*nband + nband)/2;
+  
+  if( nban != nband )
+  {
+    //sum3 = new double[nband];
+    //sum4 = new double[nband];
+    //median = new double[nband];
+    //sum = new double[nband];
+    //sumbij = new double[fat];
+  }
+  
+  npix = 0;
+  nban = nband;
+  for ( b = 0; b < nban; b++)
+  {
+    sum.push_back(0.0);
+    //sum3[b] = 0.0;
+    //sum4[b] = 0.0;
+    //median[b] = 0.0;
+  }
+  for ( b = 0; b < fat; b++)
+    sumbij.push_back(0.0);
+    
+  return true;
+  
+}
+
+void TePDIEspecData::Add(double *pixel)
+{
+  npix++;
+  int k = 0;
+  double aux;
+  for (int b = 0; b < nban; b++)
+  {
+    sum[b] += (double) pixel[b];
+    aux = (double) pixel[b] * (double) pixel[b] * (double) pixel[b];
+    //sum3[b] += aux;
+    //sum4[b] += aux * (double) pixel[b];
+    for( int bo = 0; bo <= b; bo++, k++)
+      sumbij[k] = sumbij[k] + ((double) pixel[b] * (double) pixel[bo]);
+  }
+}
+
+float TePDIEspecData::Covar(int i, int j)const
+{
+  float cov = 0;
+  if(i < nban &&  j < nban && npix > 0)
+  {
+    int k;
+    if(i >= j)
+      k = (i * (i + 1)) / 2 + j;
+    else 
+      k = (j * (j + 1)) / 2 + i;
+    cov = (float) (sumbij[k] / (double) npix - sum[i] / (double) npix * sum[j] / (double) npix);
+  }
+  else cov = 0;
+
+  return cov;
+}
+
+TeMatrix TePDIEspecData::Covariance()const
+{
+  TeMatrix cov;
+  cov.Init(nban, nban, 0.0);
+
+  for(int i = 0; i < nban; i++)
+    for(int j = 0; j < nban; j++)
+      cov(i,j) = (double) Covar(i,j);
+
+  return cov;
+}
+
+float TePDIEspecData::Mean(int i)const
+{
+  if(i < nban && i >= 0 && npix > 0)
+    return (float) (sum[i] / npix);
+
+  return 0.0;
+}
diff --git a/src/terralib/image_processing/TePDIEspecData.hpp b/src/terralib/image_processing/TePDIEspecData.hpp
index 6fb05ce..2c67a9a 100644
--- a/src/terralib/image_processing/TePDIEspecData.hpp
+++ b/src/terralib/image_processing/TePDIEspecData.hpp
@@ -1,67 +1,68 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIESPECDATA_HPP
-  #define TEPDIESPECDATA_HPP
-
-#include "TePDIDefines.hpp"
-#include <vector>
-#include <TeMatrix.h>
-
-/**
-  * @brief Espectral data class.
-  * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
-  * @ingroup PDIAux
-  */
-class PDI_DLL TePDIEspecData
-{
-  private:
-    int nban;               // Number of bands
-    long npix;              // Number of pixels = area
-    std::vector<double> sum;            // Sum of pixels values
-    //double* sum3;           // sum**3
-    //double* sum4;           // sum**4
-    std::vector<double> sumbij;         // sum of the produt of pixel values
-                // between bands i and j
-    //double* median;         // median value
-
-  public:
-    // constructor
-    TePDIEspecData();
-    // destructor
-    ~TePDIEspecData();
-
-    // initializer
-    bool Init(int nband);
-    // add a pixel
-    void Add(double *pixel);
-    // returns the covariance at i, j
-    float Covar(int i, int j)const;
-    // returns the covariance matrix
-    TeMatrix Covariance()const;
-    // returns the mean at band i
-    float Mean(int i)const;
-};
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIESPECDATA_HPP
+  #define TEPDIESPECDATA_HPP
+
+#include "TePDIDefines.hpp"
+#include <vector>
+#include <TeMatrix.h>
+
+/**
+  * @class TePDIEspecData
+  * @brief Espectral data class.
+  * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
+  * @ingroup PDIAux
+  */
+class PDI_DLL TePDIEspecData
+{
+  private:
+    int nban;               // Number of bands
+    long npix;              // Number of pixels = area
+    std::vector<double> sum;            // Sum of pixels values
+    //double* sum3;           // sum**3
+    //double* sum4;           // sum**4
+    std::vector<double> sumbij;         // sum of the produt of pixel values
+                // between bands i and j
+    //double* median;         // median value
+
+  public:
+    // constructor
+    TePDIEspecData();
+    // destructor
+    ~TePDIEspecData();
+
+    // initializer
+    bool Init(int nband);
+    // add a pixel
+    void Add(double *pixel);
+    // returns the covariance at i, j
+    float Covar(int i, int j)const;
+    // returns the covariance matrix
+    TeMatrix Covariance()const;
+    // returns the mean at band i
+    float Mean(int i)const;
+};
+
+#endif
diff --git a/src/terralib/image_processing/TePDIEuclidianBlendSF.cpp b/src/terralib/image_processing/TePDIEuclidianBlendSF.cpp
deleted file mode 100755
index 5e2e1a2..0000000
--- a/src/terralib/image_processing/TePDIEuclidianBlendSF.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "TePDIEuclidianBlendSF.hpp"
-#include "TePDIEuclidianBlendStrategy.hpp"
-
-TePDIEuclidianBlendSF::TePDIEuclidianBlendSF()
-: TePDIBlendStratFactory( std::string( "euclidian_blending" ) )
-{
-};      
-
-TePDIEuclidianBlendSF::~TePDIEuclidianBlendSF()
-{
-};
-
-
-TePDIBlendingStrategy* TePDIEuclidianBlendSF::build ( const TePDIParameters& )
-{
-  TePDIBlendingStrategy* instance_ptr = new TePDIEuclidianBlendStrategy();
-  
-  return instance_ptr;
-}
-
diff --git a/src/terralib/image_processing/TePDIEuclidianBlendSF.hpp b/src/terralib/image_processing/TePDIEuclidianBlendSF.hpp
deleted file mode 100755
index 7752c28..0000000
--- a/src/terralib/image_processing/TePDIEuclidianBlendSF.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIEUCLIDIANBLENDSF_HPP
-  #define TEPDIEUCLIDIANBLENDSF_HPP
-
-  #include <TePDIBlendStratFactory.hpp>
-  
-  /**
-   * @brief This is the class for euclidian blending factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategiesFactories
-   */
-  class PDI_DLL TePDIEuclidianBlendSF : public TePDIBlendStratFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIEuclidianBlendSF();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIEuclidianBlendSF();
-      
-    protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated strategy instance.
-       */
-      TePDIBlendingStrategy* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace
-  {  
-    static TePDIEuclidianBlendSF TePDIEuclidianBlendSF_instance;
-  };
-
-#endif
-
diff --git a/src/terralib/image_processing/TePDIEuclidianBlendStrategy.cpp b/src/terralib/image_processing/TePDIEuclidianBlendStrategy.cpp
deleted file mode 100755
index 328424c..0000000
--- a/src/terralib/image_processing/TePDIEuclidianBlendStrategy.cpp
+++ /dev/null
@@ -1,988 +0,0 @@
- 
-#include "TePDIEuclidianBlendStrategy.hpp"
-#include "TePDIBlending.hpp"
-#include "TePDIUtils.hpp"
-#include "TePDIPIManager.hpp"
-#include <TeAgnostic.h>
-
-#include <TeUtils.h>
-#include <TeGeometryAlgorithms.h>
-#include <TeDefines.h>
-#include <TeOverlayUtils.h>
-#include <TeOverlay.h>
-
-#include <float.h>
-
-
-TePDIEuclidianBlendStrategy::TePDIEuclidianBlendStrategy()
-{
-};      
-
-TePDIEuclidianBlendStrategy::~TePDIEuclidianBlendStrategy()
-{
-};
-
-
-bool TePDIEuclidianBlendStrategy::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking input_raster1 */
-  
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster1", 
-    input_raster1 ),
-    "Missing parameter: input_raster1" );
-  TEAGN_TRUE_OR_RETURN( input_raster1.isActive(),
-    "Invalid parameter: input_raster1 inactive" );
-  TEAGN_TRUE_OR_RETURN( input_raster1->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: input_raster1 not ready" );    
-    
-  /* Checking input_raster2 */
-  
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster2", 
-    input_raster2 ),
-    "Missing parameter: input_raster2" );
-  TEAGN_TRUE_OR_RETURN( input_raster2.isActive(),
-    "Invalid parameter: input_raster2 inactive" );
-  TEAGN_TRUE_OR_RETURN( input_raster2->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: input_raster2 not ready" );    
-    
-  /* Checking output_raster */
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
-    output_raster ),
-    "Missing parameter: output_raster" );
-  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
-    "Invalid parameter: output_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );    
-    
-  /* channels1 parameter checking */
-
-  std::vector< int > channels1;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "channels1", channels1 ), 
-    "Missing parameter: channels1" );
-  for( unsigned int channels1_index = 0 ; 
-    channels1_index < channels1.size() ; 
-    ++channels1_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( channels1[ channels1_index ] >= 0 ) &&
-      ( channels1[ channels1_index ] < input_raster1->nBands() ),
-      "Invalid parameter: channels1" );
-  }
-  
-  /* channels2 parameter checking */
-
-  std::vector< int > channels2;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "channels2", channels2 ), 
-    "Missing parameter: channels2" );
-  TEAGN_TRUE_OR_RETURN( ( channels2.size() == channels1.size() ),
-    "Size mismatch between channels1 and channels2" );
-  for( unsigned int channels2_index = 0 ; 
-    channels2_index < channels2.size() ; 
-    ++channels2_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( channels2[ channels2_index ] >= 0 ) &&
-      ( channels2[ channels2_index ] < input_raster2->nBands() ),
-      "Invalid parameter: channels2" );
-  }      
-    
-  /* Checking raster polygons */
-  
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster1_pol_ptr", 
-    raster1_pol_ptr ), "Missing parameter : raster1_pol_ptr" );
-  TEAGN_TRUE_OR_RETURN( raster1_pol_ptr.isActive(),
-    "Invalid parameter : raster1_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN(
-    ( ! input_raster1->begin( *raster1_pol_ptr, TeBoxPixelIn, 
-    0 ).end() ), "Invalid parameter : raster1_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN( ( raster1_pol_ptr->size() == 1 ),
-    "Invalid parameter : raster1_pol_ptr" )
-    
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster2_pol_ptr", 
-    raster2_pol_ptr ), "Missing parameter : raster2_pol_ptr" );
-  TEAGN_TRUE_OR_RETURN( raster2_pol_ptr.isActive(),
-    "Invalid parameter : raster2_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN(
-    ( ! input_raster2->begin( *raster2_pol_ptr, TeBoxPixelIn, 
-    0 ).end() ), "Invalid parameter : raster2_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN( ( raster2_pol_ptr->size() == 1 ),
-    "Invalid parameter : raster2_pol_ptr" )
-    
-  /* Checking raster2 polygon offsets */
-  
-  double raster2_pol_offset_x = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster2_pol_offset_x", 
-    raster2_pol_offset_x ), "Missing parameter : raster2_pol_offset_x" );  
-
-  double raster2_pol_offset_y = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster2_pol_offset_y", 
-    raster2_pol_offset_y ), "Missing parameter : raster2_pol_offset_y" );     
-    
-  return true;
-}
-
-
-bool TePDIEuclidianBlendStrategy::Implementation( 
-  const TePDIParameters& params )
-{
-  /* Extracting parameters */
-
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  params.GetParameter( "input_raster1", input_raster1 );
-  TeRaster& input_raster1_ref = *( input_raster1.nakedPointer() );
-
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  params.GetParameter( "input_raster2", input_raster2 );
-  TeRaster& input_raster2_ref = *( input_raster2.nakedPointer() );
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params.GetParameter( "output_raster", output_raster );
-  TeRaster& output_raster_ref = *( output_raster.nakedPointer() );
-  
-  std::vector< int > channels1;
-  params.GetParameter( "channels1", channels1 );
-
-  std::vector< int > channels2;
-  params.GetParameter( "channels2", channels2 ); 
-  
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr;
-  params.GetParameter( "raster1_pol_ptr", raster1_pol_ptr );
-  TePolygon& raster1_polygon = ( *raster1_pol_ptr );
-
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr;
-  params.GetParameter( "raster2_pol_ptr", raster2_pol_ptr );
-  TePolygon& raster2_polygon = ( *raster2_pol_ptr );
-  
-  double raster2_pol_offset_x = 0;
-  params.GetParameter( "raster2_pol_offset_x", raster2_pol_offset_x );
-
-  double raster2_pol_offset_y = 0;
-  params.GetParameter( "raster2_pol_offset_y", raster2_pol_offset_y );
-
-  
-  /* Dumyy value definition */
-  
-  bool output_raster_uses_dummy = output_raster->params().useDummy_;
-  double output_raster_dummy_value = 0;
-  
-  if( output_raster_uses_dummy ) {
-    output_raster_dummy_value = output_raster->params().dummy_[ 0 ];
-  }
-  
-  if( params.CheckParameter< double >( "dummy_value" ) ) {
-    
-    params.GetParameter( "dummy_value", output_raster_dummy_value );
-    
-    output_raster_uses_dummy = true;
-  }  
-  
-  /* Blending lines draw */
-  
-  bool draw_blend_lines = false;
-  double blend_lines_value = 0;
-  
-  if( params.CheckParameter< double >( "draw_blend_lines" ) ) {
-    
-    params.GetParameter( "draw_blend_lines", blend_lines_value );
-    
-    draw_blend_lines = true;
-  }  
-  
-  /* Calculating intersecion polygons data */
-  
-  TePolygon new_raster1_polygon;
-  TePolygon new_raster2_polygon;
-  TePolygon int_pol_refout;
-  TePolygon int_pol_ref2;
-  double raster1_rel_index_offset_x = 0;
-  double raster1_rel_index_offset_y = 0;
-  double raster2_rel_index_offset_x = 0;
-  double raster2_rel_index_offset_y = 0;
-  short pols_relation = 0;
-
-  TEAGN_TRUE_OR_RETURN( TePDIBlending::extractPolygons( params, 
-    new_raster1_polygon, new_raster2_polygon, int_pol_refout, int_pol_ref2,
-    pols_relation,
-    raster1_rel_index_offset_x, raster1_rel_index_offset_y,
-    raster2_rel_index_offset_x, raster2_rel_index_offset_y ),
-    "Error extracting intersection polygons" );
-  
-  /* Global vars */
-  
-  TeRaster::iteratorPoly intersection_refout_it =
-    output_raster->begin( int_pol_refout, TeBoxPixelIn, 0 );
-  TEAGN_TRUE_OR_RETURN( ( ! intersection_refout_it.end() ), 
-    "Unable to create an iterator over raster2 area" );     
-  
-  TePDIPIManager progress( "Blending intersection...", 
-    intersection_refout_it.nLinesInPoly() * channels1.size(), 
-    progress_interface_enabled_ );   
-    
-  /* Blending intersection */
-  { 
-    unsigned int current_line = 0;
-    unsigned int current_col = 0;
-    unsigned int last_line = 0;
-    
-    double value1 = 0;      
-    double value2 = 0;      
-    double value3 = 0;
-    
-    bool got_raster1_element = false;
-    bool got_raster2_element = false;     
-    
-    int raster1_offset_x = TeRound( raster1_rel_index_offset_x );
-    int raster1_offset_y = TeRound( raster1_rel_index_offset_y );    
-    int raster2_offset_x = TeRound( raster2_rel_index_offset_x );
-    int raster2_offset_y = TeRound( raster2_rel_index_offset_y );    
-    
-    if( ( pols_relation == TeCONTAINS ) || ( pols_relation == TeCOVERS ) ||
-        ( pols_relation == TeWITHIN ) || ( pols_relation == TeCOVEREDBY ) ) {
-        
-      /* This is the case where one raster is inside onother */
-
-      for( unsigned int channels_index = 0 ; 
-        channels_index < channels1.size() ;
-        ++channels_index ) {
-    
-        intersection_refout_it =
-          output_raster->begin( int_pol_refout, TeBoxPixelIn, 0 );
-        TEAGN_TRUE_OR_RETURN( ( ! intersection_refout_it.end() ), 
-          "Unable to create an iterator over raster2 area" );    
-      
-        const unsigned int channel1 = channels1[ channels_index ];
-        const unsigned int channel2 = channels2[ channels_index ];              
-      
-        while( ! intersection_refout_it.end() ) {
-          current_line = intersection_refout_it.currentLine();
-          current_col = intersection_refout_it.currentColumn();    
-          
-          if( input_raster1_ref.getElement( current_col + raster1_offset_x, 
-              current_line + raster1_offset_y, value1, channel1 ) ) {
-                  
-            if( output_raster_uses_dummy &&
-              ( value1 == output_raster_dummy_value ) ) {
-            
-              got_raster1_element = false;
-            } else {
-              got_raster1_element = true;
-            }
-          } else {
-            got_raster1_element = false;
-          }
-                
-          if( input_raster2_ref.getElement( current_col + raster2_offset_x, 
-              current_line + raster2_offset_y, value2, channel2 ) ) {
-                  
-            if( output_raster_uses_dummy &&
-              ( value2 == output_raster_dummy_value ) ) {
-                
-              got_raster2_element = false;
-            } else {
-              got_raster2_element = true;
-            }
-          } else {
-            got_raster2_element = false;
-          }          
-        
-          if( got_raster1_element && got_raster2_element ) {
-            value3 = ( value1 + value2 ) / 2;
-            
-            if( ( ! output_raster_uses_dummy ) || 
-              ( value3 != output_raster_dummy_value ) ) {
-                  
-              TEAGN_TRUE_OR_RETURN( 
-                output_raster_ref.setElement( current_col, current_line, value3, 
-                channels_index ), "Unable to write to output raster" );
-            }            
-          } else if( got_raster1_element ) {
-            if( ( ! output_raster_uses_dummy ) || 
-              ( value1 != output_raster_dummy_value ) ) {
-                  
-              TEAGN_TRUE_OR_RETURN( 
-                output_raster_ref.setElement( current_col, current_line, value1, 
-                channels_index ), "Unable to write to output raster" );
-            }          
-          } else {
-            if( ( ! output_raster_uses_dummy ) || 
-              ( value2 != output_raster_dummy_value ) ) {
-                
-              TEAGN_TRUE_OR_RETURN( 
-                output_raster_ref.setElement( current_col, current_line, value2, 
-                channels_index ), "Unable to write to output raster" );
-            }          
-          }
-          
-          if( current_line != last_line ) {
-            last_line = current_line;
-            progress.Increment();
-          }    
-        
-          ++intersection_refout_it;
-        }
-      }
-    } else {
-    /* Raster1 positioning */
-    
-      double raster1_abs_index_offset_x = 0;// output raster */
-      double raster1_abs_index_offset_y = 0;
-      {
-        TeBox pol1_box_indexed;
-        TePDIUtils::MapCoords2RasterIndexes( raster1_polygon.box(),
-          input_raster1, pol1_box_indexed );
-              
-        double r1_min_x = MIN( pol1_box_indexed.x1(),
-          pol1_box_indexed.x2() );
-        double r1_min_y = MIN( pol1_box_indexed.y1(),
-          pol1_box_indexed.y2() );      
-    
-        TeCoord2D r1_UL_ref1_indexed( r1_min_x, r1_min_y );  
-        TeCoord2D r1_UL_ref1( input_raster1->index2Coord( r1_UL_ref1_indexed ) );  
-        TeCoord2D r1_UL_refout_indexed( output_raster->coord2Index( r1_UL_ref1 ) );
-            
-        raster1_abs_index_offset_x = r1_UL_refout_indexed.x();  
-        raster1_abs_index_offset_y = r1_UL_refout_indexed.y();
-      }      
-
-      /* Calculating the raster 2 polygon with output raster reference */
-    
-      TePolygon r2_pol_refout;
-      {
-        TePolygon r2_pol_ref2_indexed;
-        TePDIUtils::MapCoords2RasterIndexes( raster2_polygon,
-          input_raster2, r2_pol_ref2_indexed );
-          
-        double r2_min_x = MIN( r2_pol_ref2_indexed.box().x1(),
-          r2_pol_ref2_indexed.box().x2() );
-        double r2_min_y = MIN( r2_pol_ref2_indexed.box().y1(),
-          r2_pol_ref2_indexed.box().y2() );
-    
-        TePolygon r2_pol_refout_indexed = r2_pol_ref2_indexed;
-            
-        for( unsigned int lr_index = 0 ; 
-          lr_index < r2_pol_refout_indexed.size() ; ++lr_index ) {
-          for( unsigned int c2d_index = 0 ; 
-            c2d_index < r2_pol_refout_indexed[ lr_index ].size() ; 
-            ++c2d_index ) {
-                
-            r2_pol_refout_indexed[ lr_index ][ c2d_index ].x( 
-              r2_pol_refout_indexed[ lr_index ][ c2d_index ].x() -
-              r2_min_x + raster1_abs_index_offset_x + raster2_pol_offset_x );
-            r2_pol_refout_indexed[ lr_index ][ c2d_index ].y( 
-              r2_pol_refout_indexed[ lr_index ][ c2d_index ].y() -
-              r2_min_y + raster1_abs_index_offset_y + raster2_pol_offset_y );          
-          }
-        }
-        
-        TePDIUtils::MapRasterIndexes2Coords( r2_pol_refout_indexed,
-          output_raster, r2_pol_refout );
-      }    
-    
-      /* Calculating the two blending lines - output raster indexed reference*/
-
-      bool x_axis_parallels = false;
-      bool y_axis_parallels = false;
-      double line1_a = 0;
-      double line1_b = 0;
-      double line1_c = 0;
-      double line1_x = 0;
-      double line1_y = 0;
-      double line2_a = 0;
-      double line2_b = 0;
-      double line2_c = 0;
-      double line2_x = 0;
-      double line2_y = 0;
-      
-      TePolygon raster1_polygon_indexed;
-      TePDIUtils::MapCoords2RasterIndexes( raster1_polygon,
-        output_raster, raster1_polygon_indexed );      
-   
-      TePolygon r2_pol_refout_indexed;
-      TePDIUtils::MapCoords2RasterIndexes( r2_pol_refout,
-        output_raster, r2_pol_refout_indexed );      
-          
-      TePolygon int_pol_refout_indexed;
-      TePDIUtils::MapCoords2RasterIndexes( int_pol_refout,
-        output_raster, int_pol_refout_indexed );        
-          
-      generateBlendingLines( raster1_polygon_indexed, r2_pol_refout_indexed, 
-        int_pol_refout_indexed, 
-        line1_a, line1_b, line1_c,
-        line2_a, line2_b, line2_c );
-        
-      if( line1_a == 0.0 ) {
-        x_axis_parallels = true;
-        line1_y = ( -1 ) * ( line1_c / line1_b );
-        line2_y = ( -1 ) * ( line2_c / line2_b );
-      } else if( line1_b == 0.0 ) {
-        y_axis_parallels = true;
-        line1_x = ( -1 ) * ( line1_c / line1_a );
-        line2_x = ( -1 ) * ( line2_c / line2_a );
-      }
-      
-      /* Blending intersection */  
-    
-      double dist1 = 0;   
-      double dist2 = 0;
-      const double const_hip1 = sqrt( ( line1_a * line1_a ) + 
-        ( line1_b * line1_b ) );
-      const double const_hip2 = sqrt( ( line2_a * line2_a ) + 
-        ( line2_b * line2_b ) );
-        
-      for( unsigned int channels_index = 0 ; 
-        channels_index < channels1.size() ;
-        ++channels_index ) {
-    
-        intersection_refout_it =
-          output_raster->begin( int_pol_refout, TeBoxPixelIn, 0 );
-        TEAGN_TRUE_OR_RETURN( ( ! intersection_refout_it.end() ), 
-          "Unable to create an iterator over raster2 area" );    
-      
-        const unsigned int channel1 = channels1[ channels_index ];
-        const unsigned int channel2 = channels2[ channels_index ];        
-    
-        while( ! intersection_refout_it.end() ) {
-          current_line = intersection_refout_it.currentLine();
-          current_col = intersection_refout_it.currentColumn();
-          
-          if( input_raster1_ref.getElement( current_col + raster1_offset_x, 
-              current_line + raster1_offset_y, value1, channel1 ) ) {
-                  
-            if( output_raster_uses_dummy &&
-              ( value1 == output_raster_dummy_value ) ) {
-            
-              got_raster1_element = false;
-            } else {
-              got_raster1_element = true;
-            }
-          } else {
-            got_raster1_element = false;
-          }
-                
-          if( input_raster2_ref.getElement( current_col + raster2_offset_x, 
-              current_line + raster2_offset_y, value2, channel2 ) ) {
-                  
-            if( output_raster_uses_dummy &&
-              ( value2 == output_raster_dummy_value ) ) {
-                
-              got_raster2_element = false;
-            } else {
-              got_raster2_element = true;
-            }
-          } else {
-            got_raster2_element = false;
-          }        
-            
-          if( got_raster1_element && got_raster2_element ) {
-            if( x_axis_parallels ) {
-              dist1 = ABS( line1_y - ( (double)current_line ) );
-              dist2 = ABS( line2_y - ( (double)current_line ) );
-            } else if( y_axis_parallels ) {
-              dist1 = ABS( line1_x - ( (double)current_col ) );
-              dist2 = ABS( line2_x - ( (double)current_col ) );
-            } else {
-              dist1 = ABS( ( ( line1_a * ( (double)current_line ) ) +
-                ( line1_b * ( (double)current_col) ) + line1_c ) / 
-                const_hip1 );
-              dist2 = ABS( ( ( line2_a * ( (double)current_line ) ) +
-                ( line2_b * ( (double)current_col) ) + line2_c ) / 
-                const_hip2 );
-            }
-          
-            if( dist1 == 0.0 ) {
-              value3 = value1;
-            } else if( dist2 == 0.0 ) {
-              value3 = value2;
-            } else {
-              value3 = ( ( dist1 * value2 ) + ( dist2 * value1 ) ) /
-                ( dist1 + dist2 );
-            }
-                
-            TEAGN_TRUE_OR_RETURN( 
-              output_raster_ref.setElement( current_col, 
-              current_line,
-              value3, channels_index ), "Unable to write to output raster" );                 
-          } else if( got_raster1_element ) {
-            TEAGN_TRUE_OR_RETURN( 
-              output_raster_ref.setElement( current_col, 
-              current_line,
-              value1, channels_index ), "Unable to write to output raster" );
-          } else if( got_raster2_element ) {
-            TEAGN_TRUE_OR_RETURN( 
-              output_raster_ref.setElement( current_col, 
-              current_line,
-              value2, channels_index ), "Unable to write to output raster" );
-          }        
-          
-          ++intersection_refout_it;
-          
-          if( current_line != last_line ) {
-            last_line = current_line;
-            progress.Increment();
-          }
-        }   
-        
-        if( draw_blend_lines ) {
-          drawLine( output_raster, channels_index, blend_lines_value,
-            line1_a, line1_b, line1_c );
-          drawLine( output_raster, channels_index, blend_lines_value,
-            line2_a, line2_b, line2_c );
-        }
-      }
-    } 
-  }
-  
-  return true;
-}
-
-
-void TePDIEuclidianBlendStrategy::generateBlendingLines( 
-  const TePolygon& polygon1,  
-  const TePolygon& polygon2, const TePolygon& inter_pol, 
-  double& line1_a, double& line1_b, double& line1_c,
-  double& line2_a, double& line2_b, double& line2_c )
-{
-  const TeCoord2D centroid1 = TeFindCentroid( polygon1 );
-  const TeCoord2D centroid2 = TeFindCentroid( polygon2 );
-  const TeCoord2D inter_pol_centroid = TeFindCentroid( inter_pol );
-  
-  TePointSet pols_inter_points;
-  {
-    TeLineSet ls1;
-    TePDIUtils::makeSegmentSet( polygon1, ls1 );
-    
-    TeLineSet ls2;
-    TePDIUtils::makeSegmentSet( polygon2, ls2 );    
-    
-    TePDIUtils::TeSegSetIntersection( ls1, ls2, pols_inter_points );
-  }
-  
-  if( centroid1.x() == centroid2.x() ) {
-    /* Centroids are lined up ( y axis ) then
-       blending lines are X parallels */
-    
-    if( centroid1.y() > centroid2.y() ) {
-      line1_a = 0.0;
-      line1_b = -1.0;
-      line1_c = inter_pol.box().y2() ;
-      
-      line2_a = 0.0;
-      line2_b = -1.0;
-      line2_c = inter_pol.box().y1() ;
-    } else {
-      line1_a = 0.0;
-      line1_b = -1.0;
-      line1_c = inter_pol.box().y1() ;
-      
-      line2_a = 0.0;
-      line2_b = -1.0;
-      line2_c = inter_pol.box().y2() ;
-    }
-  } else if( centroid1.y() == centroid2.y() ) {
-    /* Centroids are lined up ( x axis ) then
-       blending lines are Y parallels */
-      
-    if( centroid1.x() > centroid2.x() ) {
-      line1_a = -1.0;
-      line1_b = 0.0;
-      line1_c = inter_pol.box().x2() ;
-      
-      line2_a = -1.0;
-      line2_b = 0.0;
-      line2_c = inter_pol.box().x1() ;
-    } else {
-      line1_a = -1.0;
-      line1_b = 0.0;
-      line1_c = inter_pol.box().x1() ;
-      
-      line2_a = -1.0;
-      line2_b = 0.0;
-      line2_c = inter_pol.box().x2() ;
-    } 
-    
-  } else if( pols_inter_points.size() == 2 ) {
-    /* This is the case where the intersection of the two polygons
-       occurs on just two points, these points will be used as
-       guides for the blending lines */
-  
-    const TeCoord2D& inter_point1 = pols_inter_points[ 0 ].elem();
-    const TeCoord2D& inter_point2 = pols_inter_points[ 1 ].elem();
-  
-    if( inter_point1.x() == inter_point2.x() ) {
-      /* Intersection points are lined up ( y axis ) then
-         blending lines are Y parallels */
-         
-      if( centroid1.x() > centroid2.x() ) {
-        line1_a = -1.0;
-        line1_b = 0.0;
-        line1_c = inter_pol.box().x2() ;
-        
-        line2_a = -1.0;
-        line2_b = 0.0;
-        line2_c = inter_pol.box().x1() ;
-      } else {
-        line1_a = -1.0;
-        line1_b = 0.0;
-        line1_c = inter_pol.box().x1() ;
-        
-        line2_a = -1.0;
-        line2_b = 0.0;
-        line2_c = inter_pol.box().x2() ;
-      }          
-    } else if( inter_point1.y() == inter_point2.y() ) {
-      /* Intersection points are lined up ( x axis ) then
-         blending lines are X parallels */
-        
-      if( centroid1.y() > centroid2.y() ) {
-        line1_a = 0.0;
-        line1_b = -1.0;
-        line1_c = inter_pol.box().y2() ;
-        
-        line2_a = 0.0;
-        line2_b = -1.0;
-        line2_c = inter_pol.box().y1() ;
-      } else {
-        line1_a = 0.0;
-        line1_b = -1.0;
-        line1_c = inter_pol.box().y1() ;
-        
-        line2_a = 0.0;
-        line2_b = -1.0;
-        line2_c = inter_pol.box().y2() ;
-      }
-    } else {
-      /* The intersection points are NOT lined up */
-    
-      /* Blending lines angular coef */
-    
-      const double blend_lines_m = ( inter_point2.y() - inter_point1.y() ) /
-        ( inter_point2.x() - inter_point1.x() ); 
-        
-      /* generating the equation for the parallel line passing 
-         throught the intersection polygon centroid */
-         
-      double ip_cent_para_line_a = 0;
-      double ip_cent_para_line_b = 0;
-      double ip_cent_para_line_c = 0;
-      {
-        double ip_centroid_para_line_q = inter_pol_centroid.y() -
-        ( blend_lines_m * inter_pol_centroid.x() ); 
-        
-        TeCoord2D aux_point( ( inter_pol_centroid.x() + 10 ), 
-          ( blend_lines_m * ( inter_pol_centroid.x() + 10 ) ) + 
-          ip_centroid_para_line_q );
-          
-        ip_cent_para_line_a = inter_pol_centroid.y() - aux_point.y();
-        ip_cent_para_line_b = aux_point.x() - inter_pol_centroid.x();
-        ip_cent_para_line_c = ( inter_pol_centroid.x() * aux_point.y() ) - 
-          ( aux_point.x() * inter_pol_centroid.y() );          
-      }        
-    
-      /* perpendicular line passing throught intersection polygon centroid 
-         coeficients  */      
-    
-      const double ipc_perp_line_m = ( -1.0 ) / blend_lines_m;    
-      
-      double ipc_perp_line_q = inter_pol_centroid.y() -
-        ( ipc_perp_line_m * inter_pol_centroid.x() );      
-      
-      /* Projecting each intersection polygon point over the perpendicular 
-         line passing throught intersection polygon centroid */
-      
-      std::vector< TeCoord2D > proj_points;
-      
-      for( unsigned int lr_index = 0 ; lr_index < inter_pol.size() ; 
-        ++lr_index  ) {
-        for( unsigned int coord_index = 0 ; 
-          coord_index < inter_pol[ lr_index ].size() ; ++coord_index  ) {
-          
-          /* projection line linear coef passing throught the current point */
-        
-          double proj_line_q = inter_pol[ lr_index ][ coord_index ].y() -
-            ( blend_lines_m * inter_pol[ lr_index ][ coord_index ].x() );
-            
-          /* Calculating intersection between the projection line and
-             the perpendicular line passing throught the intersection
-             polygon centroid */
-          
-          TeCoord2D int_point;
-          int_point.x( ( proj_line_q - ipc_perp_line_q ) / 
-            ( ipc_perp_line_m - blend_lines_m  ) );
-          int_point.y( ( ipc_perp_line_m * int_point.x() ) + ipc_perp_line_q );
-          
-          proj_points.push_back( int_point );
-        }
-      }
-      
-      TEAGN_TRUE_OR_THROW( ( proj_points.size() > 1 ), 
-        "Invalid projected points" );      
-        
-      /* Finding the two pivots for the two blending lines */
-    
-      TeCoord2D pivot1; /* related to polygon 1 */
-      TeCoord2D pivot2; /* related to polygon 2 */
-      {
-        /* Taking the two points  with the higher distance one to another */
-        
-        TeCoord2D proj_point1 = proj_points[ 0 ];
-        TeCoord2D proj_point2 = proj_points[ 1 ];
-        double higher_dist = TeDistance( proj_point1, proj_point2 );
-        
-        for( unsigned int proj_points_index = 2 ; 
-          proj_points_index < proj_points.size() ; ++proj_points_index ) {
-          
-          double dist1 = TeDistance( proj_points[ proj_points_index ], 
-            proj_point1 );
-          double dist2 = TeDistance( proj_points[ proj_points_index ], 
-            proj_point2 );
-            
-          if( dist1 > dist2 ) {
-            if( dist1 > higher_dist ) {
-              proj_point2 = proj_points[ proj_points_index ];
-              higher_dist = dist1;
-            }
-          } else {
-            if( dist2 > higher_dist ) {
-              proj_point1 = proj_points[ proj_points_index ];
-              higher_dist = TeDistance( proj_points[ proj_points_index ], 
-                proj_point2 );
-            }
-          }
-        }
-        
-        /* Association of the projected points with the correct polygons */     
-      
-        {
-          double rel_pos_proj_point1 = ( ip_cent_para_line_a * proj_point1.x() ) 
-            + ( ip_cent_para_line_b * proj_point1.y() ) + ip_cent_para_line_c;
-          double rel_pos_centroid1 = ( ip_cent_para_line_a * centroid1.x() ) 
-            + ( ip_cent_para_line_b * centroid1.y() ) + ip_cent_para_line_c;
-           
-          if( ( rel_pos_proj_point1 > 0 ) && ( rel_pos_centroid1 > 0 ) ) {
-            pivot1 = proj_point1;
-            pivot2 = proj_point2;        
-          } else {
-            pivot2 = proj_point1;
-            pivot1 = proj_point2;
-          }
-        }        
-      }
-      
-      /* Calculating blending line 1 equation */
-      
-      {
-        double line1_q = pivot1.y() -
-          ( blend_lines_m * pivot1.x() );
-          
-        TeCoord2D aux_point( ( pivot1.x() + 10 ), 
-          ( blend_lines_m * ( pivot1.x() + 10 ) ) + line1_q );
-          
-        line1_a = pivot1.y() - aux_point.y();
-        line1_b = aux_point.x() - pivot1.x();
-        line1_c = ( pivot1.x() * aux_point.y() ) - 
-          ( aux_point.x() * pivot1.y() );
-      }
-  
-      /* Calculating blending line 2 equation */
-      
-      {
-        double line2_q = pivot2.y() -
-          ( blend_lines_m * pivot2.x() );
-          
-        TeCoord2D aux_point( ( pivot2.x() + 10 ), 
-          ( blend_lines_m * ( pivot2.x() + 10 ) ) + line2_q );
-          
-        line2_a = pivot2.y() - aux_point.y();
-        line2_b = aux_point.x() - pivot2.x();
-        line2_c = ( pivot2.x() * aux_point.y() ) - 
-          ( aux_point.x() * pivot2.y() );
-      }        
-    }
-  } else {
-    /* This is the case where the polygons intersection gives us more than 
-       two points */
-       
-    /* line passing throught intersection polygon centroid coeficients -
-       this line is parallel with the line passing throught centroids */
-    
-    const double ipc_line_m = ( centroid2.y() - centroid1.y() ) /
-      ( centroid2.x() - centroid1.x() );
-    const double ipc_line_q = inter_pol_centroid.y() - 
-      ( ipc_line_m * inter_pol_centroid.x() );
-      
-    /* perpendicular line angular coeficient */
-    
-    const double perp_line_m = ( -1.0 ) / ipc_line_m;
-    
-    /* Projecting each intersection polygon point over the parallel line */
-    
-    std::vector< TeCoord2D > proj_points;
-    
-    for( unsigned int lr_index = 0 ; lr_index < inter_pol.size() ; 
-      ++lr_index  ) {
-      for( unsigned int coord_index = 0 ; 
-        coord_index < inter_pol[ lr_index ].size() ; ++coord_index  ) {
-        
-        /* perpendicular line linear coef passing throught the current point */
-      
-        double perp_line_q = inter_pol[ lr_index ][ coord_index ].y() -
-          ( perp_line_m * inter_pol[ lr_index ][ coord_index ].x() );
-          
-        /* Calculating the lines intersection */
-        
-        TeCoord2D int_point;
-        int_point.x( ( perp_line_q - ipc_line_q ) / 
-          ( ipc_line_m - perp_line_m  ) );
-        int_point.y( ( ipc_line_m * int_point.x() ) + ipc_line_q );
-        
-        proj_points.push_back( int_point );
-      }
-    }
-    
-    TEAGN_TRUE_OR_THROW( ( proj_points.size() > 1 ), 
-      "Invalid projected points" );
-      
-    /* Finding the two pivots for the two blending lines */
-    
-    TeCoord2D pivot1; /* related to polygon 1 */
-    TeCoord2D pivot2; /* related to polygon 2 */
-    {
-      /* Taking the two points  with the higher distance one to another */
-      
-      TeCoord2D proj_point1 = proj_points[ 0 ];
-      TeCoord2D proj_point2 = proj_points[ 1 ];
-      double higher_dist = TeDistance( proj_point1, proj_point2 );
-      
-      for( unsigned int proj_points_index = 2 ; 
-        proj_points_index < proj_points.size() ; ++proj_points_index ) {
-        
-        double dist1 = TeDistance( proj_points[ proj_points_index ], 
-          proj_point1 );
-        double dist2 = TeDistance( proj_points[ proj_points_index ], 
-          proj_point2 );
-          
-        if( dist1 > dist2 ) {
-          if( dist1 > higher_dist ) {
-            proj_point2 = proj_points[ proj_points_index ];
-            higher_dist = dist1;
-          }
-        } else {
-          if( dist2 > higher_dist ) {
-            proj_point1 = proj_points[ proj_points_index ];
-            higher_dist = TeDistance( proj_points[ proj_points_index ], 
-              proj_point2 );
-          }
-        }
-      }
-      
-      /* generating the equation for the perpendicular line passing 
-         throught the intersection polygon centroid */
-         
-      double ip_cent_perp_line_a = 0;
-      double ip_cent_perp_line_b = 0;
-      double ip_cent_perp_line_c = 0;
-      {
-        double ip_centroid_perp_line_q = inter_pol_centroid.y() -
-        ( perp_line_m * inter_pol_centroid.x() ); 
-        
-        TeCoord2D aux_point( ( inter_pol_centroid.x() + 10 ), 
-          ( perp_line_m * ( inter_pol_centroid.x() + 10 ) ) + 
-          ip_centroid_perp_line_q );
-          
-        ip_cent_perp_line_a = inter_pol_centroid.y() - aux_point.y();
-        ip_cent_perp_line_b = aux_point.x() - inter_pol_centroid.x();
-        ip_cent_perp_line_c = ( inter_pol_centroid.x() * aux_point.y() ) - 
-        ( aux_point.x() * inter_pol_centroid.y() );          
-      }
-        
-      /* Association of the projected points with the correct polygons */     
-      
-      {
-        double rel_pos_proj_point1 = ( ip_cent_perp_line_a * proj_point1.x() ) 
-          + ( ip_cent_perp_line_b * proj_point1.y() ) + ip_cent_perp_line_c;
-        double rel_pos_centroid1 = ( ip_cent_perp_line_a * centroid1.x() ) 
-          + ( ip_cent_perp_line_b * centroid1.y() ) + ip_cent_perp_line_c;
-         
-        if( ( rel_pos_proj_point1 > 0 ) && ( rel_pos_centroid1 > 0 ) ) {
-          pivot1 = proj_point1;
-          pivot2 = proj_point2;        
-        } else {
-          pivot2 = proj_point1;
-          pivot1 = proj_point2;
-        }
-      }
-    }
-    
-    /* Calculating blending line 1 equation */
-    
-    {
-      double line1_q = pivot1.y() -
-        ( perp_line_m * pivot1.x() );
-        
-      TeCoord2D aux_point( ( pivot1.x() + 10 ), 
-        ( perp_line_m * ( pivot1.x() + 10 ) ) + line1_q );
-        
-      line1_a = pivot1.y() - aux_point.y();
-      line1_b = aux_point.x() - pivot1.x();
-      line1_c = ( pivot1.x() * aux_point.y() ) - 
-        ( aux_point.x() * pivot1.y() );
-    }
-
-    /* Calculating blending line 2 equation */
-    
-    {
-      double line2_q = pivot2.y() -
-        ( perp_line_m * pivot2.x() );
-        
-      TeCoord2D aux_point( ( pivot2.x() + 10 ), 
-        ( perp_line_m * ( pivot2.x() + 10 ) ) + line2_q );
-        
-      line2_a = pivot2.y() - aux_point.y();
-      line2_b = aux_point.x() - pivot2.x();
-      line2_c = ( pivot2.x() * aux_point.y() ) - 
-        ( aux_point.x() * pivot2.y() );
-    }
-  }  
-}
-
-
-void TePDIEuclidianBlendStrategy::drawLine( 
-  const TePDITypes::TePDIRasterPtrType& raster, unsigned int channel,
-  double value, double line_a, double line_b, double line_c )
-{
-  double line_x = 0;
-  double line_y = 0;
-  
-  if( line_a == 0 ) {
-    /* horizontal parallels */
-    
-    line_y = ( -1.0 * line_c ) / line_b;
-  
-    for( line_x = 0 ; line_x < raster->params().ncols_ ; ++line_x ) {
-      raster->setElement( (int)line_x, (int)line_y, value, channel );
-    }             
-  } else if( line_b == 0 ) {
-    /* vertical parallels */
-    
-    line_x = ( -1.0 * line_c ) / line_a;
-  
-    for( line_y = 0 ; line_y < raster->params().nlines_ ; ++line_y ) {
-      
-      raster->setElement( (int)line_x, (int)line_y, value, channel );
-    }            
-  } else {
-    for( line_x = 0 ; line_x < raster->params().ncols_ ; ++line_x ) {
-
-      line_y = ( ( -1.0 * line_c ) + ( -1.0 * line_a * line_x ) ) / line_b;
-      
-      raster->setElement( (int)line_x, (int)line_y, value, channel );
-    }           
-  }
-}
diff --git a/src/terralib/image_processing/TePDIEuclidianBlendStrategy.hpp b/src/terralib/image_processing/TePDIEuclidianBlendStrategy.hpp
deleted file mode 100755
index 84d57d6..0000000
--- a/src/terralib/image_processing/TePDIEuclidianBlendStrategy.hpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIEUCLIDIANBLENDSTRATEGY_HPP
-  #define TEPDIEUCLIDIANBLENDSTRATEGY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIBlendingStrategy.hpp"
-  #include "TePDIParameters.hpp"
-  
-  #include <string>
-
-  /**
-   * @brief This is the class for Euclidian blending strategy.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIBlendingStrategies
-   *
-   * @note The required parameters are:
-   * @param input_raster1 ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Input raster 1.
-   * @param input_raster2 ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Input raster 2.
-   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
-   * @param channels1 ( std::vector< int > ) - The channels to process from 
-   * input_raster1.
-   * @param channels2 ( std::vector< int > ) - The channels to process from 
-   * input_raster2.
-   * Raster 1 polygon pointer ( related to
-   * input_raster1 world reference - Just 1 linear ring allowed ).
-   * @param raster2_pol_ptr ( TePDITypes::TePDIPolygonPtrType ) - 
-   * Raster 2 polygon pointer ( related to 
-   * input_raster2 world reference - Just 1 linear ring allowed ).
-   * @param raster2_pol_offset_x ( double ) - Raster 2 polygon box X offset 
-   * related to raster1 polygon box in input_raster1 matricial reference
-   * ( offset_x = pol2_x - pol1_x ).
-   * @param raster2_pol_offset_y ( double ) - Raster 2 polygon box Y offset 
-   * related to raster1 polygon box in input_raster1 matricial reference
-   * ( offset_y = pol2_y - pol1_y ). 
-   *
-   * @note The optional parameters are:
-   *
-   * @param dummy_value (double) - A dummy pixel value for use 
-   * in pixels where no data is available ( input pixels with
-   * dummy values will be ignored ).  
-   * @param draw_blend_lines (double) - Draw the blending lines over
-   * the image using the supplied pixel value.
-   *
-   * @note The output_raster parameters will take the input_raster1 as
-   * reference.
-   * @note All input rasters must have the same dimensions.
-   *
-   */
-  class PDI_DLL TePDIEuclidianBlendStrategy : public TePDIBlendingStrategy
-  {
-    friend class TePDIEuclidianBlendSF;
-  
-    public :
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIEuclidianBlendStrategy();
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI strategy.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( 
-        const TePDIParameters& parameters ) const;       
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIEuclidianBlendStrategy();
-      
-      /**
-       * @brief Runs the algorithm implementation.
-       *
-       * @return true if OK. false on errors.
-       */
-      bool Implementation( const TePDIParameters& params );
-
-      /**
-       * @brief Transfers the raster1 non-intersected ared to output raster.
-       *
-       * @return true if OK. false on errors.
-       */            
-      bool transferRaster1();
-      
-      /**
-       * @brief Generates the two blending lines equations ( a . X + b . y + c = 0 ).
-       *
-       * @note All geometries must be in the same reference system.
-       * @note If ( line1_a == 0 ) <--> X axis parallels (horizontal lines).
-       * @note If ( line1_b == 0 ) <--> Y axis parallels (vertical lines).
-       *
-       * @param polygon1 Raster1 polygon.
-       * @param polygon2 Raster2 polygon.
-       * @param inter_pol Intersection polygon.
-       * @param line1_a Blending line 1 ( related to raster1 polygon ) a 
-       * coefficient.
-       * @param line1_b Blending line 1 ( related to raster1 polygon ) b
-       * coefficient.
-       * @param line1_c Blending line 1 ( related to raster1 polygon ) c
-       * coefficient.
-       * @param line2_a Blending line 2 ( related to raster2 polygon ) a 
-       * coefficient.
-       * @param line2_b Blending line 2 ( related to raster2 polygon ) b
-       * coefficient.
-       * @param line2_c Blending line 2 ( related to raster2 polygon ) c
-       * coefficient.
-       */            
-      void generateBlendingLines( const TePolygon& polygon1,  
-        const TePolygon& polygon2, const TePolygon& inter_pol, 
-        double& line1_a, double& line1_b, double& line1_c,
-        double& line2_a, double& line2_b, double& line2_c );  
-     
-      /**
-       * @brief Draws a line over the supplied raster.
-       *
-       * @note If ( line_a == 0 ) <--> X axis parallels (horizontal lines).
-       * @note If ( line_b == 0 ) <--> Y axis parallels (vertical lines).
-       *
-       * @param raster Raster pointer.
-       * @param channel Raster channel.
-       * @param value The pixel value to draw.
-       * @param line_a Line 1 "a" coefficient.
-       * @param line_b Line 1 "b" coefficient.
-       * @param line_c Line 1 "c" coefficient.
-       */          
-      void drawLine( const TePDITypes::TePDIRasterPtrType& raster, 
-        unsigned int channel, double value, double line_a, double line_b, 
-        double line_c );          
-  };
-  
-#endif
-
-
-
diff --git a/src/terralib/image_processing/TePDIFilterMask.cpp b/src/terralib/image_processing/TePDIFilterMask.cpp
old mode 100755
new mode 100644
index e75a23b..7ceab62
--- a/src/terralib/image_processing/TePDIFilterMask.cpp
+++ b/src/terralib/image_processing/TePDIFilterMask.cpp
@@ -1,657 +1,657 @@
-#include "TePDIFilterMask.hpp"
-
-#include <TeAgnostic.h>
-
-
-TePDIFilterMask::TePDIFilterMask()
-{
-  reset( 0, 0 );
-}
-
-
-TePDIFilterMask::TePDIFilterMask( unsigned int width, double gain )
-{
-  reset( width, gain );
-}
-
-
-TePDIFilterMask::~TePDIFilterMask()
-{
-}
-
-
-void TePDIFilterMask::reset( unsigned int width, double gain )
-{
-  TEAGN_TRUE_OR_THROW( ( width % 2 != 0 ),
-    "Invalid width suplied, must be an odd number." );
-  TEAGN_TRUE_OR_THROW( width > 2,
-    "Invalid width suplied, must be greater than 2" );
-
-  weights_gain_ = gain;
-  weights_sum_ = 0;
-  internal_matrix_.Init( width, width, 0. );
-}
-
-
-unsigned int TePDIFilterMask::columns() const
-{
-  return (unsigned int) internal_matrix_.Ncol();
-}
-
-
-unsigned int TePDIFilterMask::lines() const
-{
-  return (unsigned int) internal_matrix_.Nrow();
-}
-
-
-void TePDIFilterMask::set( unsigned int line, unsigned int column,
-  double value )
-{
-  TEAGN_TRUE_OR_THROW( (int)line < internal_matrix_.Nrow(),
-    "Invalid line number" );
-  TEAGN_TRUE_OR_THROW( (int)column < internal_matrix_.Ncol(),
-    "Invalid columnLine number" );
-
-  weights_sum_ -= internal_matrix_( line, column );
-  internal_matrix_( line, column ) = value;
-  weights_sum_ += value;
-}
-
-
-double TePDIFilterMask::get( unsigned int line, unsigned int column ) const
-{
-  TEAGN_TRUE_OR_THROW( (int)line < internal_matrix_.Nrow(),
-    "Invalid line number" );
-  TEAGN_TRUE_OR_THROW( (int)column < internal_matrix_.Ncol(),
-    "Invalid columnLine number" );
-
-  return internal_matrix_( line, column ) + weights_gain_;
-}
-
-double TePDIFilterMask::getSum()
-{
-  return weights_sum_;
-}
-
-
-void TePDIFilterMask::operator=( const TePDIFilterMask& external )
-{
-  internal_matrix_ = external.internal_matrix_;
-  weights_sum_ = external.weights_sum_;
-  weights_gain_ = external.weights_gain_;
-}
-
-
-void TePDIFilterMask::normalize()
-{
-  if( weights_sum_ != 1. ) {
-
-    TEAGN_TRUE_OR_THROW( weights_sum_ != 0.,
-      "Trying to normalize a zero weights sum mask" );
-
-    for( int line = 0 ; line < internal_matrix_.Nrow() ; ++line ) {
-      for( int column = 0 ; column < internal_matrix_.Ncol() ;
-           ++column ) {
-
-        internal_matrix_( line, column ) /= weights_sum_;
-      }
-    }
-
-    weights_sum_ = 1.;
-  }
-}
-
-
-double** TePDIFilterMask::getWeightsMatrix() const
-{
-  TEAGN_TRUE_OR_THROW( internal_matrix_.Nrow() != 0,
-    "Cannot create a Weights Matrix from an empty mask." );
-  TEAGN_TRUE_OR_THROW( internal_matrix_.Ncol() != 0,
-    "Cannot create a Weights Matrix from an empty mask." );
-
-  double** outmatrix = new double*[ internal_matrix_.Nrow() ];
-  TEAGN_TRUE_OR_THROW( outmatrix != 0,
-    "Memory allocation error" );
-
-  for( int line = 0 ; line < internal_matrix_.Nrow() ; ++line ) {
-    outmatrix[ line ] = new double[ internal_matrix_.Ncol() ];
-
-    TEAGN_TRUE_OR_THROW( outmatrix[ line ] != 0,
-      "Memory allocation error" );
-  }
-
-  for( int linecounter = 0 ; linecounter < internal_matrix_.Nrow() ; ++linecounter ) {
-    for( int column = 0 ; column < internal_matrix_.Ncol() ;
-      ++column ) {
-      outmatrix[ linecounter ][ column ] = get( linecounter, column );
-    }
-  }
-
-  return outmatrix;
-}
-
-
-void TePDIFilterMask::deleteWeightsMatrix( double** matrix,
-  unsigned int lines )
-{
-  if( matrix != 0 ) {
-    for( unsigned int line = 0 ; line < lines ; ++line ) {
-      if( matrix[ line ] != 0 ) {
-        delete[] matrix[ line ];
-      }
-    }
-
-    delete[] matrix;
-  }
-}
-
-
-bool TePDIFilterMask::isMorfMask()
-{
-  double value;
-
-  bool zero_matrix = true;
-
-  if( weights_gain_ != 0 ) {
-    return false;
-  }
-
-  for( int line = 0 ; line < internal_matrix_.Nrow() ; ++line ) {
-    for( int column = 0 ; column < internal_matrix_.Ncol() ;
-         ++column ) {
-
-      value = internal_matrix_( line, column );
-
-      if( ( value != 1. ) && ( value != 0 ) ) {
-        return false;
-      }
-
-      if( zero_matrix ) {
-        if( value != 0 ) {
-          zero_matrix = false;
-        }
-      }
-    }
-  }
-
-  if( zero_matrix ) {
-    return false;
-  }
-
-  return true;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_Dummy()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  for( unsigned int line = 0 ; line < 3 ; ++line ) {
-    for( unsigned int column = 0 ; column < 3 ; ++column ) {
-      outmask->set( line, column, 0 );
-    }
-  }
-  outmask->set( 1, 1, 1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_Avg3x3( bool no_norm )
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  for( unsigned int line = 0 ; line < 3 ; ++line ) {
-    for( unsigned int column = 0 ; column < 3 ; ++column ) {
-      outmask->set( line, column, 1. );
-    }
-  }
-
-  if( ! no_norm ) {
-    outmask->normalize();
-  }
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_Avg5x5( bool no_norm )
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 5, 0 ) );
-
-  for( unsigned int line = 0 ; line < 5 ; ++line ) {
-    for( unsigned int column = 0 ; column < 5 ; ++column ) {
-      outmask->set( line, column, 1. );
-    }
-  }
-
-  if( ! no_norm ) {
-    outmask->normalize();
-  }
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_Avg7x7( bool no_norm )
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 7, 0 ) );
-
-  for( unsigned int line = 0 ; line < 7 ; ++line ) {
-    for( unsigned int column = 0 ; column < 7 ; ++column ) {
-      outmask->set( line, column, 1. );
-    }
-  }
-
-  if( ! no_norm ) {
-    outmask->normalize();
-  }
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_S()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, -1. );
-  outmask->set( 0, 1, -1. );
-  outmask->set( 0, 2, -1. );
-
-  outmask->set( 1, 0, 1. );
-  outmask->set( 1, 1, -2. );
-  outmask->set( 1, 2, 1. );
-
-  outmask->set( 2, 0, 1. );
-  outmask->set( 2, 1, 1. );
-  outmask->set( 2, 2, 1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_N()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 1. );
-  outmask->set( 0, 1, 1. );
-  outmask->set( 0, 2, 1. );
-
-  outmask->set( 1, 0, 1. );
-  outmask->set( 1, 1, -2. );
-  outmask->set( 1, 2, 1. );
-
-  outmask->set( 2, 0, -1. );
-  outmask->set( 2, 1, -1. );
-  outmask->set( 2, 2, -1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_E()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, -1. );
-  outmask->set( 0, 1, 1. );
-  outmask->set( 0, 2, 1. );
-
-  outmask->set( 1, 0, -1. );
-  outmask->set( 1, 1, -2. );
-  outmask->set( 1, 2, 1. );
-
-  outmask->set( 2, 0, -1. );
-  outmask->set( 2, 1, 1. );
-  outmask->set( 2, 2, 1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_W()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 1. );
-  outmask->set( 0, 1, 1. );
-  outmask->set( 0, 2, -1. );
-
-  outmask->set( 1, 0, 1. );
-  outmask->set( 1, 1, -2. );
-  outmask->set( 1, 2, -1. );
-
-  outmask->set( 2, 0, 1. );
-  outmask->set( 2, 1, 1. );
-  outmask->set( 2, 2, -1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_NW()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 1. );
-  outmask->set( 0, 1, 1. );
-  outmask->set( 0, 2, 1. );
-
-  outmask->set( 1, 0, 1. );
-  outmask->set( 1, 1, -2. );
-  outmask->set( 1, 2, -1. );
-
-  outmask->set( 2, 0, 1. );
-  outmask->set( 2, 1, -1. );
-  outmask->set( 2, 2, -1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_SW()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 1. );
-  outmask->set( 0, 1, -1. );
-  outmask->set( 0, 2, -1. );
-
-  outmask->set( 1, 0, 1. );
-  outmask->set( 1, 1, -2. );
-  outmask->set( 1, 2, -1. );
-
-  outmask->set( 2, 0, 1. );
-  outmask->set( 2, 1, 1. );
-  outmask->set( 2, 2, 1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_NE()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 1. );
-  outmask->set( 0, 1, 1. );
-  outmask->set( 0, 2, 1. );
-
-  outmask->set( 1, 0, -1. );
-  outmask->set( 1, 1, -2. );
-  outmask->set( 1, 2, 1. );
-
-  outmask->set( 2, 0, -1. );
-  outmask->set( 2, 1, -1. );
-  outmask->set( 2, 2, 1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_SE()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, -1. );
-  outmask->set( 0, 1, -1. );
-  outmask->set( 0, 2, 1. );
-
-  outmask->set( 1, 0, -1. );
-  outmask->set( 1, 1, -2. );
-  outmask->set( 1, 2, 1. );
-
-  outmask->set( 2, 0, 1. );
-  outmask->set( 2, 1, 1. );
-  outmask->set( 2, 2, 1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_NDLow()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 0 );
-  outmask->set( 0, 1, -1. );
-  outmask->set( 0, 2, 0 );
-
-  outmask->set( 1, 0, -1. );
-  outmask->set( 1, 1, 4. );
-  outmask->set( 1, 2, -1. );
-
-  outmask->set( 2, 0, 0 );
-  outmask->set( 2, 1, -1. );
-  outmask->set( 2, 2, 0 );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_NDMed()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, -1. );
-  outmask->set( 0, 1, -1. );
-  outmask->set( 0, 2, -1. );
-
-  outmask->set( 1, 0, -1. );
-  outmask->set( 1, 1, 8. );
-  outmask->set( 1, 2, -1. );
-
-  outmask->set( 2, 0, -1. );
-  outmask->set( 2, 1, -1. );
-  outmask->set( 2, 2, -1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_NDHigh()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 1. );
-  outmask->set( 0, 1, -2. );
-  outmask->set( 0, 2, 1. );
-
-  outmask->set( 1, 0, -2. );
-  outmask->set( 1, 1, 4. );
-  outmask->set( 1, 2, -2. );
-
-  outmask->set( 2, 0, 1. );
-  outmask->set( 2, 1, -2. );
-  outmask->set( 2, 2, 1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_TMEnh( bool no_norm )
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 5, 0 ) );
-
-  outmask->set( 0, 0, 1. );
-  outmask->set( 0, 1, -3. );
-  outmask->set( 0, 2, -3. );
-  outmask->set( 0, 3, 1. );
-  outmask->set( 0, 4, 0 );
-
-  outmask->set( 1, 0, -3. );
-  outmask->set( 1, 1, 7. );
-  outmask->set( 1, 2, 7. );
-  outmask->set( 1, 3, -3. );
-  outmask->set( 1, 4, 0 );
-
-  outmask->set( 2, 0, -3. );
-  outmask->set( 2, 1, 7. );
-  outmask->set( 2, 2, 7. );
-  outmask->set( 2, 3, -3. );
-  outmask->set( 2, 4, 0 );
-
-  outmask->set( 3, 0, 1. );
-  outmask->set( 3, 1, -3. );
-  outmask->set( 3, 2, -3. );
-  outmask->set( 3, 3, 1. );
-  outmask->set( 3, 4, 0 );
-
-  outmask->set( 4, 0, 0 );
-  outmask->set( 4, 1, 0 );
-  outmask->set( 4, 2, 0 );
-  outmask->set( 4, 3, 0 );
-  outmask->set( 4, 4, 0 );
-
-  if( ! no_norm ) {
-    outmask->normalize();
-  }
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_MorfD()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 0 );
-  outmask->set( 0, 1, 0 );
-  outmask->set( 0, 2, 1. );
-
-  outmask->set( 1, 0, 0 );
-  outmask->set( 1, 1, 1. );
-  outmask->set( 1, 2, 0 );
-
-  outmask->set( 2, 0, 1. );
-  outmask->set( 2, 1, 0 );
-  outmask->set( 2, 2, 0 );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_MorfE()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 1. );
-  outmask->set( 0, 1, 0 );
-  outmask->set( 0, 2, 0 );
-
-  outmask->set( 1, 0, 0 );
-  outmask->set( 1, 1, 1. );
-  outmask->set( 1, 2, 0 );
-
-  outmask->set( 2, 0, 0 );
-  outmask->set( 2, 1, 0 );
-  outmask->set( 2, 2, 1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_MorfM()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 0 );
-  outmask->set( 0, 1, 1. );
-  outmask->set( 0, 2, 0 );
-
-  outmask->set( 1, 0, 0 );
-  outmask->set( 1, 1, 1. );
-  outmask->set( 1, 2, 0 );
-
-  outmask->set( 2, 0, 0 );
-  outmask->set( 2, 1, 1. );
-  outmask->set( 2, 2, 0 );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_MorfM_()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 0 );
-  outmask->set( 0, 1, 0 );
-  outmask->set( 0, 2, 0 );
-
-  outmask->set( 1, 0, 1. );
-  outmask->set( 1, 1, 1. );
-  outmask->set( 1, 2, 1. );
-
-  outmask->set( 2, 0, 0 );
-  outmask->set( 2, 1, 0 );
-  outmask->set( 2, 2, 0 );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_MorfMPlus()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 0 );
-  outmask->set( 0, 1, 1. );
-  outmask->set( 0, 2, 0 );
-
-  outmask->set( 1, 0, 1. );
-  outmask->set( 1, 1, 1. );
-  outmask->set( 1, 2, 1. );
-
-  outmask->set( 2, 0, 0 );
-  outmask->set( 2, 1, 1. );
-  outmask->set( 2, 2, 0 );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_MorfMtot()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 1. );
-  outmask->set( 0, 1, 1. );
-  outmask->set( 0, 2, 1. );
-
-  outmask->set( 1, 0, 1. );
-  outmask->set( 1, 1, 1. );
-  outmask->set( 1, 2, 1. );
-
-  outmask->set( 2, 0, 1. );
-  outmask->set( 2, 1, 1. );
-  outmask->set( 2, 2, 1. );
-
-  return outmask;
-}
-
-
-TePDIFilterMask::pointer TePDIFilterMask::create_MorfMX()
-{
-  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
-
-  outmask->set( 0, 0, 1. );
-  outmask->set( 0, 1, 0 );
-  outmask->set( 0, 2, 1. );
-
-  outmask->set( 1, 0, 0 );
-  outmask->set( 1, 1, 1. );
-  outmask->set( 1, 2, 0 );
-
-  outmask->set( 2, 0, 1. );
-  outmask->set( 2, 1, 0 );
-  outmask->set( 2, 2, 1. );
-
-  return outmask;
-}
-
-
-
+#include "TePDIFilterMask.hpp"
+
+#include <TeAgnostic.h>
+
+
+TePDIFilterMask::TePDIFilterMask()
+{
+  reset( 0, 0 );
+}
+
+
+TePDIFilterMask::TePDIFilterMask( unsigned int width, double gain )
+{
+  reset( width, gain );
+}
+
+
+TePDIFilterMask::~TePDIFilterMask()
+{
+}
+
+
+void TePDIFilterMask::reset( unsigned int width, double gain )
+{
+  TEAGN_TRUE_OR_THROW( ( width % 2 != 0 ),
+    "Invalid width suplied, must be an odd number." );
+  TEAGN_TRUE_OR_THROW( width > 2,
+    "Invalid width suplied, must be greater than 2" );
+
+  weights_gain_ = gain;
+  weights_sum_ = 0;
+  internal_matrix_.Init( width, width, 0. );
+}
+
+
+unsigned int TePDIFilterMask::columns() const
+{
+  return (unsigned int) internal_matrix_.Ncol();
+}
+
+
+unsigned int TePDIFilterMask::lines() const
+{
+  return (unsigned int) internal_matrix_.Nrow();
+}
+
+
+void TePDIFilterMask::set( unsigned int line, unsigned int column,
+  double value )
+{
+  TEAGN_TRUE_OR_THROW( (int)line < internal_matrix_.Nrow(),
+    "Invalid line number" );
+  TEAGN_TRUE_OR_THROW( (int)column < internal_matrix_.Ncol(),
+    "Invalid columnLine number" );
+
+  weights_sum_ -= internal_matrix_( line, column );
+  internal_matrix_( line, column ) = value;
+  weights_sum_ += value;
+}
+
+
+double TePDIFilterMask::get( unsigned int line, unsigned int column ) const
+{
+  TEAGN_TRUE_OR_THROW( (int)line < internal_matrix_.Nrow(),
+    "Invalid line number" );
+  TEAGN_TRUE_OR_THROW( (int)column < internal_matrix_.Ncol(),
+    "Invalid columnLine number" );
+
+  return internal_matrix_( line, column ) + weights_gain_;
+}
+
+double TePDIFilterMask::getSum()
+{
+  return weights_sum_;
+}
+
+
+void TePDIFilterMask::operator=( const TePDIFilterMask& external )
+{
+  internal_matrix_ = external.internal_matrix_;
+  weights_sum_ = external.weights_sum_;
+  weights_gain_ = external.weights_gain_;
+}
+
+
+void TePDIFilterMask::normalize()
+{
+  if( weights_sum_ != 1. ) {
+
+    TEAGN_TRUE_OR_THROW( weights_sum_ != 0.,
+      "Trying to normalize a zero weights sum mask" );
+
+    for( int line = 0 ; line < internal_matrix_.Nrow() ; ++line ) {
+      for( int column = 0 ; column < internal_matrix_.Ncol() ;
+           ++column ) {
+
+        internal_matrix_( line, column ) /= weights_sum_;
+      }
+    }
+
+    weights_sum_ = 1.;
+  }
+}
+
+
+double** TePDIFilterMask::getWeightsMatrix() const
+{
+  TEAGN_TRUE_OR_THROW( internal_matrix_.Nrow() != 0,
+    "Cannot create a Weights Matrix from an empty mask." );
+  TEAGN_TRUE_OR_THROW( internal_matrix_.Ncol() != 0,
+    "Cannot create a Weights Matrix from an empty mask." );
+
+  double** outmatrix = new double*[ internal_matrix_.Nrow() ];
+  TEAGN_TRUE_OR_THROW( outmatrix != 0,
+    "Memory allocation error" );
+
+  for( int line = 0 ; line < internal_matrix_.Nrow() ; ++line ) {
+    outmatrix[ line ] = new double[ internal_matrix_.Ncol() ];
+
+    TEAGN_TRUE_OR_THROW( outmatrix[ line ] != 0,
+      "Memory allocation error" );
+  }
+
+  for( int linecounter = 0 ; linecounter < internal_matrix_.Nrow() ; ++linecounter ) {
+    for( int column = 0 ; column < internal_matrix_.Ncol() ;
+      ++column ) {
+      outmatrix[ linecounter ][ column ] = get( linecounter, column );
+    }
+  }
+
+  return outmatrix;
+}
+
+
+void TePDIFilterMask::deleteWeightsMatrix( double** matrix,
+  unsigned int lines )
+{
+  if( matrix != 0 ) {
+    for( unsigned int line = 0 ; line < lines ; ++line ) {
+      if( matrix[ line ] != 0 ) {
+        delete[] matrix[ line ];
+      }
+    }
+
+    delete[] matrix;
+  }
+}
+
+
+bool TePDIFilterMask::isMorfMask()
+{
+  double value;
+
+  bool zero_matrix = true;
+
+  if( weights_gain_ != 0 ) {
+    return false;
+  }
+
+  for( int line = 0 ; line < internal_matrix_.Nrow() ; ++line ) {
+    for( int column = 0 ; column < internal_matrix_.Ncol() ;
+         ++column ) {
+
+      value = internal_matrix_( line, column );
+
+      if( ( value != 1. ) && ( value != 0 ) ) {
+        return false;
+      }
+
+      if( zero_matrix ) {
+        if( value != 0 ) {
+          zero_matrix = false;
+        }
+      }
+    }
+  }
+
+  if( zero_matrix ) {
+    return false;
+  }
+
+  return true;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_Dummy()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  for( unsigned int line = 0 ; line < 3 ; ++line ) {
+    for( unsigned int column = 0 ; column < 3 ; ++column ) {
+      outmask->set( line, column, 0 );
+    }
+  }
+  outmask->set( 1, 1, 1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_Avg3x3( bool no_norm )
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  for( unsigned int line = 0 ; line < 3 ; ++line ) {
+    for( unsigned int column = 0 ; column < 3 ; ++column ) {
+      outmask->set( line, column, 1. );
+    }
+  }
+
+  if( ! no_norm ) {
+    outmask->normalize();
+  }
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_Avg5x5( bool no_norm )
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 5, 0 ) );
+
+  for( unsigned int line = 0 ; line < 5 ; ++line ) {
+    for( unsigned int column = 0 ; column < 5 ; ++column ) {
+      outmask->set( line, column, 1. );
+    }
+  }
+
+  if( ! no_norm ) {
+    outmask->normalize();
+  }
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_Avg7x7( bool no_norm )
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 7, 0 ) );
+
+  for( unsigned int line = 0 ; line < 7 ; ++line ) {
+    for( unsigned int column = 0 ; column < 7 ; ++column ) {
+      outmask->set( line, column, 1. );
+    }
+  }
+
+  if( ! no_norm ) {
+    outmask->normalize();
+  }
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_S()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, -1. );
+  outmask->set( 0, 1, -1. );
+  outmask->set( 0, 2, -1. );
+
+  outmask->set( 1, 0, 1. );
+  outmask->set( 1, 1, -2. );
+  outmask->set( 1, 2, 1. );
+
+  outmask->set( 2, 0, 1. );
+  outmask->set( 2, 1, 1. );
+  outmask->set( 2, 2, 1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_N()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 1. );
+  outmask->set( 0, 1, 1. );
+  outmask->set( 0, 2, 1. );
+
+  outmask->set( 1, 0, 1. );
+  outmask->set( 1, 1, -2. );
+  outmask->set( 1, 2, 1. );
+
+  outmask->set( 2, 0, -1. );
+  outmask->set( 2, 1, -1. );
+  outmask->set( 2, 2, -1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_E()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, -1. );
+  outmask->set( 0, 1, 1. );
+  outmask->set( 0, 2, 1. );
+
+  outmask->set( 1, 0, -1. );
+  outmask->set( 1, 1, -2. );
+  outmask->set( 1, 2, 1. );
+
+  outmask->set( 2, 0, -1. );
+  outmask->set( 2, 1, 1. );
+  outmask->set( 2, 2, 1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_W()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 1. );
+  outmask->set( 0, 1, 1. );
+  outmask->set( 0, 2, -1. );
+
+  outmask->set( 1, 0, 1. );
+  outmask->set( 1, 1, -2. );
+  outmask->set( 1, 2, -1. );
+
+  outmask->set( 2, 0, 1. );
+  outmask->set( 2, 1, 1. );
+  outmask->set( 2, 2, -1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_NW()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 1. );
+  outmask->set( 0, 1, 1. );
+  outmask->set( 0, 2, 1. );
+
+  outmask->set( 1, 0, 1. );
+  outmask->set( 1, 1, -2. );
+  outmask->set( 1, 2, -1. );
+
+  outmask->set( 2, 0, 1. );
+  outmask->set( 2, 1, -1. );
+  outmask->set( 2, 2, -1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_SW()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 1. );
+  outmask->set( 0, 1, -1. );
+  outmask->set( 0, 2, -1. );
+
+  outmask->set( 1, 0, 1. );
+  outmask->set( 1, 1, -2. );
+  outmask->set( 1, 2, -1. );
+
+  outmask->set( 2, 0, 1. );
+  outmask->set( 2, 1, 1. );
+  outmask->set( 2, 2, 1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_NE()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 1. );
+  outmask->set( 0, 1, 1. );
+  outmask->set( 0, 2, 1. );
+
+  outmask->set( 1, 0, -1. );
+  outmask->set( 1, 1, -2. );
+  outmask->set( 1, 2, 1. );
+
+  outmask->set( 2, 0, -1. );
+  outmask->set( 2, 1, -1. );
+  outmask->set( 2, 2, 1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_SE()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, -1. );
+  outmask->set( 0, 1, -1. );
+  outmask->set( 0, 2, 1. );
+
+  outmask->set( 1, 0, -1. );
+  outmask->set( 1, 1, -2. );
+  outmask->set( 1, 2, 1. );
+
+  outmask->set( 2, 0, 1. );
+  outmask->set( 2, 1, 1. );
+  outmask->set( 2, 2, 1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_NDLow()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 0 );
+  outmask->set( 0, 1, -1. );
+  outmask->set( 0, 2, 0 );
+
+  outmask->set( 1, 0, -1. );
+  outmask->set( 1, 1, 4. );
+  outmask->set( 1, 2, -1. );
+
+  outmask->set( 2, 0, 0 );
+  outmask->set( 2, 1, -1. );
+  outmask->set( 2, 2, 0 );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_NDMed()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, -1. );
+  outmask->set( 0, 1, -1. );
+  outmask->set( 0, 2, -1. );
+
+  outmask->set( 1, 0, -1. );
+  outmask->set( 1, 1, 8. );
+  outmask->set( 1, 2, -1. );
+
+  outmask->set( 2, 0, -1. );
+  outmask->set( 2, 1, -1. );
+  outmask->set( 2, 2, -1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_NDHigh()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 1. );
+  outmask->set( 0, 1, -2. );
+  outmask->set( 0, 2, 1. );
+
+  outmask->set( 1, 0, -2. );
+  outmask->set( 1, 1, 4. );
+  outmask->set( 1, 2, -2. );
+
+  outmask->set( 2, 0, 1. );
+  outmask->set( 2, 1, -2. );
+  outmask->set( 2, 2, 1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_TMEnh( bool no_norm )
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 5, 0 ) );
+
+  outmask->set( 0, 0, 1. );
+  outmask->set( 0, 1, -3. );
+  outmask->set( 0, 2, -3. );
+  outmask->set( 0, 3, 1. );
+  outmask->set( 0, 4, 0 );
+
+  outmask->set( 1, 0, -3. );
+  outmask->set( 1, 1, 7. );
+  outmask->set( 1, 2, 7. );
+  outmask->set( 1, 3, -3. );
+  outmask->set( 1, 4, 0 );
+
+  outmask->set( 2, 0, -3. );
+  outmask->set( 2, 1, 7. );
+  outmask->set( 2, 2, 7. );
+  outmask->set( 2, 3, -3. );
+  outmask->set( 2, 4, 0 );
+
+  outmask->set( 3, 0, 1. );
+  outmask->set( 3, 1, -3. );
+  outmask->set( 3, 2, -3. );
+  outmask->set( 3, 3, 1. );
+  outmask->set( 3, 4, 0 );
+
+  outmask->set( 4, 0, 0 );
+  outmask->set( 4, 1, 0 );
+  outmask->set( 4, 2, 0 );
+  outmask->set( 4, 3, 0 );
+  outmask->set( 4, 4, 0 );
+
+  if( ! no_norm ) {
+    outmask->normalize();
+  }
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_MorfD()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 0 );
+  outmask->set( 0, 1, 0 );
+  outmask->set( 0, 2, 1. );
+
+  outmask->set( 1, 0, 0 );
+  outmask->set( 1, 1, 1. );
+  outmask->set( 1, 2, 0 );
+
+  outmask->set( 2, 0, 1. );
+  outmask->set( 2, 1, 0 );
+  outmask->set( 2, 2, 0 );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_MorfE()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 1. );
+  outmask->set( 0, 1, 0 );
+  outmask->set( 0, 2, 0 );
+
+  outmask->set( 1, 0, 0 );
+  outmask->set( 1, 1, 1. );
+  outmask->set( 1, 2, 0 );
+
+  outmask->set( 2, 0, 0 );
+  outmask->set( 2, 1, 0 );
+  outmask->set( 2, 2, 1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_MorfM()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 0 );
+  outmask->set( 0, 1, 1. );
+  outmask->set( 0, 2, 0 );
+
+  outmask->set( 1, 0, 0 );
+  outmask->set( 1, 1, 1. );
+  outmask->set( 1, 2, 0 );
+
+  outmask->set( 2, 0, 0 );
+  outmask->set( 2, 1, 1. );
+  outmask->set( 2, 2, 0 );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_MorfM_()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 0 );
+  outmask->set( 0, 1, 0 );
+  outmask->set( 0, 2, 0 );
+
+  outmask->set( 1, 0, 1. );
+  outmask->set( 1, 1, 1. );
+  outmask->set( 1, 2, 1. );
+
+  outmask->set( 2, 0, 0 );
+  outmask->set( 2, 1, 0 );
+  outmask->set( 2, 2, 0 );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_MorfMPlus()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 0 );
+  outmask->set( 0, 1, 1. );
+  outmask->set( 0, 2, 0 );
+
+  outmask->set( 1, 0, 1. );
+  outmask->set( 1, 1, 1. );
+  outmask->set( 1, 2, 1. );
+
+  outmask->set( 2, 0, 0 );
+  outmask->set( 2, 1, 1. );
+  outmask->set( 2, 2, 0 );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_MorfMtot()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 1. );
+  outmask->set( 0, 1, 1. );
+  outmask->set( 0, 2, 1. );
+
+  outmask->set( 1, 0, 1. );
+  outmask->set( 1, 1, 1. );
+  outmask->set( 1, 2, 1. );
+
+  outmask->set( 2, 0, 1. );
+  outmask->set( 2, 1, 1. );
+  outmask->set( 2, 2, 1. );
+
+  return outmask;
+}
+
+
+TePDIFilterMask::pointer TePDIFilterMask::create_MorfMX()
+{
+  TePDIFilterMask::pointer outmask( new TePDIFilterMask( 3, 0 ) );
+
+  outmask->set( 0, 0, 1. );
+  outmask->set( 0, 1, 0 );
+  outmask->set( 0, 2, 1. );
+
+  outmask->set( 1, 0, 0 );
+  outmask->set( 1, 1, 1. );
+  outmask->set( 1, 2, 0 );
+
+  outmask->set( 2, 0, 1. );
+  outmask->set( 2, 1, 0 );
+  outmask->set( 2, 2, 1. );
+
+  return outmask;
+}
+
+
+
diff --git a/src/terralib/image_processing/TePDIFilterMask.hpp b/src/terralib/image_processing/TePDIFilterMask.hpp
old mode 100755
new mode 100644
index df9d51a..f099b37
--- a/src/terralib/image_processing/TePDIFilterMask.hpp
+++ b/src/terralib/image_processing/TePDIFilterMask.hpp
@@ -1,345 +1,346 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIFILTERMASK_HPP
-  #define TEPDIFILTERMASK_HPP
-
- #include "TePDIDefines.hpp"
- #include <TeSharedPtr.h>
-
-  #include <TeMatrix.h>
-
-  /**
-   * @brief This is the class for image filtering mask.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAux
-   */
-  class PDI_DLL TePDIFilterMask {
-    public :
-      /** @typedef TeSharedPtr< TePDIFilterMask > pointer
-          Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIFilterMask > pointer;
-      /** @typedef const TeSharedPtr< TePDIFilterMask > const_pointer 
-          Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIFilterMask > const_pointer;
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIFilterMask();
-
-      /**
-       * @brief Alternative Constructor.
-       *
-       * @param width Mask width ( odd values ).
-       * @param gain Mask gain.
-       */
-      TePDIFilterMask( unsigned int width, double gain = 0 );
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIFilterMask();
-
-      /**
-       * @brief Resets the current mask.
-       *
-       * @param width Mask width.
-       * @param gain Mask gain.
-       */
-      void reset( unsigned int width, double gain = 0 );
-
-      /**
-       * @brief The current mask coluns number.
-       *
-       * @return Mask columns number.
-       */
-      unsigned int columns() const;
-
-      /**
-       * @brief The current mask lines number.
-       *
-       * @return Mask columns number.
-       */
-      unsigned int lines() const;
-
-      /**
-       * @brief Assingns a new value to the element.
-       *
-       * @param line Element line.
-       * @param column Element column.
-       * @param value Element velue.
-       */
-      void set( unsigned int line, unsigned int column, double value );
-
-      /**
-       * @brief Returns the required element value.
-       *
-       * @param line Element line.
-       * @param column Element column.
-       * @return The element value.
-       */
-      double get( unsigned int line, unsigned int column ) const;
-
-      /**
-       * @brief Returns the sum of the weights ( withour gain ).
-       *
-       * @return The sum of the weights ( withour gain ).
-       */
-      double getSum();
-
-      /**
-       * @brief Operator = overload.
-       *
-       * @param external External Mask reference.
-       */
-	  void operator=( const TePDIFilterMask& external );
-
-      /**
-       * @brief Normalizes the current mask.
-       */
-      void normalize();
-
-      /**
-       * @brief Return a simple matrix[line][column] with the current weights.
-       *
-       * @note No automatic deletion will be performed for the returned
-       * matrix.
-       *
-       * @return The weights matrix ( based on gain ).
-       */
-      double** getWeightsMatrix() const;
-
-      /**
-       * @brief Frees the memory of a weights matrix.
-       *
-       * @param matrix The weights matrix.
-       * @param lines The lines number.
-       */
-      static void deleteWeightsMatrix( double** matrix, unsigned int lines );
-
-
-      /**
-       * @brief Verify if the mask is a morfological filter mask.
-       *
-       * @return true if the mask is a morfological filter mask, false if not.
-       */
-      bool isMorfMask();
-
-      /**
-       * @brief Creates an dummy average mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_Dummy();
-      
-      /**
-       * @brief Creates an 3x3 average mask.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_Avg3x3( bool no_norm = false );
-
-      /**
-       * @brief Creates an 5x5 average mask.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_Avg5x5( bool no_norm = false );
-
-      /**
-       * @brief Creates an 7x7 average mask.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_Avg7x7( bool no_norm = false );
-
-      /**
-       * @brief Creates an 3x3 South mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_S();
-
-      /**
-       * @brief Creates an 3x3 North mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_N();
-
-      /**
-       * @brief Creates an 3x3 East mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_E();
-
-      /**
-       * @brief Creates an 3x3 West mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_W();
-
-      /**
-       * @brief Creates an 3x3 North-West mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_NW();
-
-      /**
-       * @brief Creates an 3x3 South-West mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_SW();
-
-      /**
-       * @brief Creates an 3x3 North-East mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_NE();
-
-      /**
-       * @brief Creates an 3x3 South-East mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_SE();
-
-      /**
-       * @brief Creates an non directional low frequencies pass filter mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_NDLow();
-
-      /**
-       * @brief Creates an non directional medium frequencies pass filter mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_NDMed();
-
-      /**
-       * @brief Creates an non directional high frequencies pass filter mask.
-       *
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_NDHigh();
-
-      /**
-       * @brief Creates an filter mask for TM imagens enhancement.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_TMEnh( bool no_norm = false );
-
-      /**
-       * @brief Creates an morfological (D) filter mask.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_MorfD();
-
-      /**
-       * @brief Creates an morfological (E) filter mask.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_MorfE();
-
-      /**
-       * @brief Creates an morfological (M) filter mask.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_MorfM();
-
-      /**
-       * @brief Creates an morfological (M-) filter mask.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_MorfM_();
-
-      /**
-       * @brief Creates an morfological (M+) filter mask.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_MorfMPlus();
-
-      /**
-       * @brief Creates an morfological (Mtot) filter mask.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_MorfMtot();
-
-      /**
-       * @brief Creates an morfological (MX) filter mask.
-       *
-       * @param no_norm if true, no normalization will be performed.
-       * @return The created mask.
-       */
-      static TePDIFilterMask::pointer create_MorfMX();
-
-    protected :
-
-      /**
-       * @brief Internal weights matrix reference
-       */
-      mutable TeMatrix internal_matrix_;
-
-      /**
-       * @brief Internal matrix weights sum
-       */
-      double weights_sum_;
-
-      /**
-       * @brief Internal matrix weights gain
-       */
-      double weights_gain_;
-  };
-  
-/** @example TePDIFilterMask_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDIFILTERMASK_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIFILTERMASK_HPP
+  #define TEPDIFILTERMASK_HPP
+
+ #include "TePDIDefines.hpp"
+ #include <TeSharedPtr.h>
+
+  #include <TeMatrix.h>
+
+  /**
+   * @class TePDIFilterMask
+   * @brief This is the class for image filtering mask.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAux
+   */
+  class PDI_DLL TePDIFilterMask {
+    public :
+      /** @typedef TeSharedPtr< TePDIFilterMask > pointer
+          Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIFilterMask > pointer;
+      /** @typedef const TeSharedPtr< TePDIFilterMask > const_pointer 
+          Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIFilterMask > const_pointer;
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIFilterMask();
+
+      /**
+       * @brief Alternative Constructor.
+       *
+       * @param width Mask width ( odd values ).
+       * @param gain Mask gain.
+       */
+      TePDIFilterMask( unsigned int width, double gain = 0 );
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIFilterMask();
+
+      /**
+       * @brief Resets the current mask.
+       *
+       * @param width Mask width.
+       * @param gain Mask gain.
+       */
+      void reset( unsigned int width, double gain = 0 );
+
+      /**
+       * @brief The current mask coluns number.
+       *
+       * @return Mask columns number.
+       */
+      unsigned int columns() const;
+
+      /**
+       * @brief The current mask lines number.
+       *
+       * @return Mask columns number.
+       */
+      unsigned int lines() const;
+
+      /**
+       * @brief Assingns a new value to the element.
+       *
+       * @param line Element line.
+       * @param column Element column.
+       * @param value Element velue.
+       */
+      void set( unsigned int line, unsigned int column, double value );
+
+      /**
+       * @brief Returns the required element value.
+       *
+       * @param line Element line.
+       * @param column Element column.
+       * @return The element value.
+       */
+      double get( unsigned int line, unsigned int column ) const;
+
+      /**
+       * @brief Returns the sum of the weights ( withour gain ).
+       *
+       * @return The sum of the weights ( withour gain ).
+       */
+      double getSum();
+
+      /**
+       * @brief Operator = overload.
+       *
+       * @param external External Mask reference.
+       */
+	  void operator=( const TePDIFilterMask& external );
+
+      /**
+       * @brief Normalizes the current mask.
+       */
+      void normalize();
+
+      /**
+       * @brief Return a simple matrix[line][column] with the current weights.
+       *
+       * @note No automatic deletion will be performed for the returned
+       * matrix.
+       *
+       * @return The weights matrix ( based on gain ).
+       */
+      double** getWeightsMatrix() const;
+
+      /**
+       * @brief Frees the memory of a weights matrix.
+       *
+       * @param matrix The weights matrix.
+       * @param lines The lines number.
+       */
+      static void deleteWeightsMatrix( double** matrix, unsigned int lines );
+
+
+      /**
+       * @brief Verify if the mask is a morfological filter mask.
+       *
+       * @return true if the mask is a morfological filter mask, false if not.
+       */
+      bool isMorfMask();
+
+      /**
+       * @brief Creates an dummy average mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_Dummy();
+      
+      /**
+       * @brief Creates an 3x3 average mask.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_Avg3x3( bool no_norm = false );
+
+      /**
+       * @brief Creates an 5x5 average mask.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_Avg5x5( bool no_norm = false );
+
+      /**
+       * @brief Creates an 7x7 average mask.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_Avg7x7( bool no_norm = false );
+
+      /**
+       * @brief Creates an 3x3 South mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_S();
+
+      /**
+       * @brief Creates an 3x3 North mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_N();
+
+      /**
+       * @brief Creates an 3x3 East mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_E();
+
+      /**
+       * @brief Creates an 3x3 West mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_W();
+
+      /**
+       * @brief Creates an 3x3 North-West mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_NW();
+
+      /**
+       * @brief Creates an 3x3 South-West mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_SW();
+
+      /**
+       * @brief Creates an 3x3 North-East mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_NE();
+
+      /**
+       * @brief Creates an 3x3 South-East mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_SE();
+
+      /**
+       * @brief Creates an non directional low frequencies pass filter mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_NDLow();
+
+      /**
+       * @brief Creates an non directional medium frequencies pass filter mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_NDMed();
+
+      /**
+       * @brief Creates an non directional high frequencies pass filter mask.
+       *
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_NDHigh();
+
+      /**
+       * @brief Creates an filter mask for TM imagens enhancement.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_TMEnh( bool no_norm = false );
+
+      /**
+       * @brief Creates an morfological (D) filter mask.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_MorfD();
+
+      /**
+       * @brief Creates an morfological (E) filter mask.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_MorfE();
+
+      /**
+       * @brief Creates an morfological (M) filter mask.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_MorfM();
+
+      /**
+       * @brief Creates an morfological (M-) filter mask.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_MorfM_();
+
+      /**
+       * @brief Creates an morfological (M+) filter mask.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_MorfMPlus();
+
+      /**
+       * @brief Creates an morfological (Mtot) filter mask.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_MorfMtot();
+
+      /**
+       * @brief Creates an morfological (MX) filter mask.
+       *
+       * @param no_norm if true, no normalization will be performed.
+       * @return The created mask.
+       */
+      static TePDIFilterMask::pointer create_MorfMX();
+
+    protected :
+
+      /**
+       * @brief Internal weights matrix reference
+       */
+      mutable TeMatrix internal_matrix_;
+
+      /**
+       * @brief Internal matrix weights sum
+       */
+      double weights_sum_;
+
+      /**
+       * @brief Internal matrix weights gain
+       */
+      double weights_gain_;
+  };
+  
+/** @example TePDIFilterMask_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDIFILTERMASK_HPP
diff --git a/src/terralib/image_processing/TePDIFusion.cpp b/src/terralib/image_processing/TePDIFusion.cpp
deleted file mode 100755
index 667a8b7..0000000
--- a/src/terralib/image_processing/TePDIFusion.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "TePDIFusion.hpp"
-#include "TePDIStrategyFactory.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIFusion::TePDIFusion()
-{
-}
-
-
-TePDIFusion::~TePDIFusion()
-{
-}
-
-
-void TePDIFusion::ResetState( const TePDIParameters& params )
-{
-  TePDIParameters dummy_params = params;
-}
-
-
-bool TePDIFusion::CheckParameters( const TePDIParameters& parameters ) const
-{
-  std::string fusion_type;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "fusion_type", fusion_type ),
-    "Missing parameter : fusion_type" );
-
-  TePDIStrategy::pointer fusion_strategy(  
-    TePDIStrategyFactory::make( fusion_type, parameters ) );
-    
-  TEAGN_TRUE_OR_RETURN( fusion_strategy.isActive(), "Invalid strategy" );
-  
-  return fusion_strategy->CheckParameters( parameters );
-}
-
-
-bool TePDIFusion::RunImplementation()
-{
-  std::string fusion_type;
-  TEAGN_TRUE_OR_RETURN( params_.GetParameter( "fusion_type", fusion_type ),
-    "Missing parameter : fusion_type" );
-    
-  TePDIStrategy::pointer fusion_strategy(  
-    TePDIStrategyFactory::make( fusion_type, params_ ) );
-    
-  TEAGN_TRUE_OR_RETURN( fusion_strategy.isActive(), "Invalid strategy" );
-  
-  return fusion_strategy->Apply( params_ );
-}
-
-
diff --git a/src/terralib/image_processing/TePDIFusion.hpp b/src/terralib/image_processing/TePDIFusion.hpp
deleted file mode 100755
index 1d799ba..0000000
--- a/src/terralib/image_processing/TePDIFusion.hpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIFUSION_HPP
-  #define TEPDIFUSION_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the base class for image fusion algorithms.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIFusionAlgorithms
-   *
-   * @note The general required parameters:
-   * @param fusion_type ( std::string ) - Fusion type
-   * (See each fusion strategy for reference).
-   *
-   * @note The specific parameters: See each fusion strategy for reference.   
-   */
-  class PDI_DLL TePDIFusion : public TePDIAlgorithm{
-  
-    public :
-    
-      /** @typedef Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIFusion > pointer;
-      /** @typedef Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIFusion > const_pointer;
-      
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIFusion();      
-
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIFusion();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;   
-            
-    protected :
-    
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );    
-     
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();      
-  
-  };
-  
-/** @example TePDIFusion_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDIFUSION_HPP
diff --git a/src/terralib/image_processing/TePDIFusionFactory.cpp b/src/terralib/image_processing/TePDIFusionFactory.cpp
deleted file mode 100755
index 1ed8098..0000000
--- a/src/terralib/image_processing/TePDIFusionFactory.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
- 
-#include "TePDIFusionFactory.hpp"
-#include "TePDIFusion.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIFusionFactory::TePDIFusionFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIFusion" ) )
-{
-};      
-
-
-TePDIFusionFactory::~TePDIFusionFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIFusionFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIFusion();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
diff --git a/src/terralib/image_processing/TePDIFusionFactory.hpp b/src/terralib/image_processing/TePDIFusionFactory.hpp
deleted file mode 100755
index 5db108b..0000000
--- a/src/terralib/image_processing/TePDIFusionFactory.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIFUSIONFACTORY_HPP
-  #define TEPDIFUSIONFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for fusion algorithms factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIFusionFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIFusionFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIFusionFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIFusionFactory TePDIFusionFactory_instance;
-  };  
-  
-#endif
diff --git a/src/terralib/image_processing/TePDIFusionIndexes.cpp b/src/terralib/image_processing/TePDIFusionIndexes.cpp
new file mode 100644
index 0000000..90398a0
--- /dev/null
+++ b/src/terralib/image_processing/TePDIFusionIndexes.cpp
@@ -0,0 +1,688 @@
+#include "TePDIFusionIndexes.hpp"
+
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+#include <TePDITypes.hpp>
+#include <TePDIStatistic.hpp>
+#include <TeRasterRemap.h>
+#include <TeMatrix.h>
+#include <TeUtils.h>
+#include <math.h>
+#include <queue>
+
+#define waveletPlanes 2
+
+TePDIFusionIndexes::TePDIFusionIndexes()
+{
+}
+
+TePDIFusionIndexes::~TePDIFusionIndexes()
+{
+}
+
+void TePDIFusionIndexes::ResetState(const TePDIParameters&)
+{
+}
+
+bool TePDIFusionIndexes::CheckParameters(const TePDIParameters& parameters) const
+{
+	int index_type;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("index_type", index_type), "Missing parameter: index_type");
+
+	if ((index_type == TePDIFusionIndexes::CC) || (index_type == TePDIFusionIndexes::VARDIF) || (index_type == TePDIFusionIndexes::SDD) || (index_type == TePDIFusionIndexes::BIAS) || (index_type == TePDIFusionIndexes::UIQI) || (index_type == TePDIFusionIndexes::RMSE) || (index_type == TePDIFusionIndexes::SIMM))
+	{
+		TePDITypes::TePDIRasterPtrType original_raster;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("original_raster", original_raster), "Missing parameter: original_raster");
+		TEAGN_TRUE_OR_RETURN(original_raster.isActive(), "Invalid parameter: original_raster inactive");
+		TEAGN_TRUE_OR_RETURN(original_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: original_raster not ready");
+	
+		int original_band;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("original_band", original_band), "Missing parameter: original_band");
+		TEAGN_TRUE_OR_THROW(original_raster->params().nBands() > original_band, "Original band out of the bands bounds");
+	
+		TePDITypes::TePDIRasterPtrType fused_raster;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fused_raster", fused_raster), "Missing parameter: fused_raster");
+		TEAGN_TRUE_OR_RETURN(fused_raster.isActive(), "Invalid parameter: fused_raster inactive");
+		TEAGN_TRUE_OR_RETURN(fused_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: fused_raster not ready");
+	
+		int fused_band;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fused_band", fused_band), "Missing parameter: fused_band");
+		TEAGN_TRUE_OR_THROW(fused_raster->params().nBands() > fused_band, "Fused band out of the bands bounds");
+	
+		TeSharedPtr<double> index_value;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("index_value", index_value), "Missing parameter: index_value");
+
+		TEAGN_TRUE_OR_THROW((original_raster->params().nlines_ == fused_raster->params().nlines_) && (original_raster->params().ncols_ == fused_raster->params().ncols_), "Original raster lines and/or columns differs from Fused raster");
+	}
+	else if ((index_type == TePDIFusionIndexes::ERGAS) || (index_type == TePDIFusionIndexes::SERGAS))
+	{
+		TePDITypes::TePDIRasterVectorType original_rasters;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("original_rasters", original_rasters), "Missing parameter: original_rasters");
+
+		std::vector<int> original_bands;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("original_bands", original_bands), "Missing parameter: original_bands");
+		TEAGN_TRUE_OR_THROW(original_bands.size() == original_rasters.size(), "Original raster and Original bands difference in size");
+
+		for (unsigned b = 0; b < original_rasters.size(); b++)
+		{
+			TEAGN_TRUE_OR_RETURN(original_rasters[b].isActive(), "Invalid parameter: original_rasters inactive");
+			TEAGN_TRUE_OR_RETURN(original_rasters[b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: original_rasters not ready");
+			TEAGN_TRUE_OR_THROW((original_rasters[0]->params().nlines_ == original_rasters[b]->params().nlines_) && (original_rasters[0]->params().ncols_ == original_rasters[b]->params().ncols_), "Original raster lines and/or columns differs");
+			TEAGN_TRUE_OR_THROW(original_rasters[b]->params().nBands() > original_bands[b], "Original bands out of the bands bounds");
+		}
+
+		if (index_type == TePDIFusionIndexes::SERGAS)
+		{
+			TePDITypes::TePDIRasterPtrType pan_raster;
+			TEAGN_TRUE_OR_RETURN(parameters.GetParameter("pan_raster", pan_raster), "Missing parameter: pan_raster");
+			TEAGN_TRUE_OR_RETURN(pan_raster.isActive(), "Invalid parameter: pan_raster inactive");
+			TEAGN_TRUE_OR_RETURN(pan_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: pan_raster not ready");
+
+			int pan_band;
+			TEAGN_TRUE_OR_RETURN(parameters.GetParameter("pan_band", pan_band), "Missing parameter: pan_band");
+			TEAGN_TRUE_OR_THROW(pan_raster->params().nBands() > pan_band, "Pan band out of the band bounds");
+		}
+
+		TePDITypes::TePDIRasterVectorType fused_rasters;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fused_rasters", fused_rasters), "Missing parameter: fused_rasters");
+		TEAGN_TRUE_OR_THROW(fused_rasters.size() == original_rasters.size(), "Fused and Original rasters numbers are different");
+
+		std::vector<int> fused_bands;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fused_bands", fused_bands), "Missing parameter: fused_bands");
+		TEAGN_TRUE_OR_THROW(fused_bands.size() == fused_rasters.size(), "Fused raster and Fused bands difference in size");
+
+		for (unsigned b = 0; b < fused_rasters.size(); b++)
+		{
+			TEAGN_TRUE_OR_RETURN(fused_rasters[b].isActive(), "Invalid parameter: fused_rasters inactive");
+			TEAGN_TRUE_OR_RETURN(fused_rasters[b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: fused_rasters not ready");
+			TEAGN_TRUE_OR_THROW(fused_rasters[b]->params().nBands() > fused_bands[b], "Fused bands out of the bands bounds");
+			TEAGN_TRUE_OR_THROW((fused_rasters[0]->params().nlines_ == fused_rasters[b]->params().nlines_) && (fused_rasters[0]->params().ncols_ == fused_rasters[b]->params().ncols_), "Fused raster lines and/or columns differs");
+			TEAGN_TRUE_OR_THROW((original_rasters[b]->params().nlines_ == fused_rasters[b]->params().nlines_) && (original_rasters[b]->params().ncols_ == fused_rasters[b]->params().ncols_), "Original raster lines and/or columns differs from Fused raster");
+		}
+
+		double low_resolution;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("low_resolution", low_resolution), "Missing parameter: low_resolution");
+
+		double high_resolution;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("high_resolution", high_resolution), "Missing parameter: high_resolution");
+
+		TeSharedPtr<double> index_value;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("index_value", index_value), "Missing parameter: index_value");
+	}
+	else if (index_type == TePDIFusionIndexes::SCC)
+	{
+		TePDITypes::TePDIRasterPtrType fused_raster;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fused_raster", fused_raster), "Missing parameter: fused_raster");
+		TEAGN_TRUE_OR_RETURN(fused_raster.isActive(), "Invalid parameter: fused_raster inactive");
+		TEAGN_TRUE_OR_RETURN(fused_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: fused_raster not ready");
+	
+		int fused_band;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fused_band", fused_band), "Missing parameter: fused_band");
+		TEAGN_TRUE_OR_THROW(fused_raster->params().nBands() > fused_band, "Fused band out of the bands bounds");
+
+		TePDITypes::TePDIRasterPtrType pan_raster;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("pan_raster", pan_raster), "Missing parameter: pan_raster");
+		TEAGN_TRUE_OR_RETURN(pan_raster.isActive(), "Invalid parameter: pan_raster inactive");
+		TEAGN_TRUE_OR_RETURN(pan_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: pan_raster not ready");
+	
+		int pan_band;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("pan_band", pan_band), "Missing parameter: pan_band");
+		TEAGN_TRUE_OR_THROW(pan_raster->params().nBands() > pan_band, "Pan band out of the bands bounds");
+	
+		TeSharedPtr<double> index_value;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("index_value", index_value), "Missing parameter: index_value");
+
+		TEAGN_TRUE_OR_THROW((fused_raster->params().nlines_ == pan_raster->params().nlines_) && (fused_raster->params().ncols_ == pan_raster->params().ncols_), "Fused raster lines and/or columns differs from Pan raster");
+	}
+	else
+	{
+		TEAGN_TRUE_OR_RETURN(false, "Invalid parameter: index type");
+	}
+
+
+	return true;
+}
+
+bool TePDIFusionIndexes::raster_mean(TePDITypes::TePDIRasterPtrType raster, int band, double& mean)
+{
+	double	pixel;
+	mean = 0.0;
+
+	TePDIPIManager progress("Computing raster mean", raster->params().nlines_, progress_enabled_);
+	for (int j = 0; j < raster->params().nlines_; j++)
+	{
+		for (int i = 0; i < raster->params().ncols_; i++)
+		{
+			raster->getElement(i, j, pixel, band);
+			mean += pixel;
+		}
+		progress.Increment();
+	}
+	progress.Toggle(progress_enabled_);
+
+	mean = mean / ((double)raster->params().nlines_ * (double)raster->params().ncols_);
+
+	return true;
+}
+
+bool TePDIFusionIndexes::rasters_difference(TePDITypes::TePDIRasterPtrType raster1, int band1, TePDITypes::TePDIRasterPtrType raster2, int band2, TePDITypes::TePDIRasterPtrType raster_diff, int band_diff)
+{
+	double	pixel1,
+		pixel2,
+		diff;
+
+	TePDIPIManager progress("Computing rasters difference", raster1->params().nlines_, progress_enabled_);
+	for (int j = 0; j < raster1->params().nlines_; j++)
+	{
+		for (int i = 0; i < raster1->params().ncols_; i++)
+		{
+			raster1->getElement(i, j, pixel1, band1);
+			raster2->getElement(i, j, pixel2, band2);
+			diff = pixel1-pixel2;
+			raster_diff->setElement(i, j, (diff < 0?-diff:diff), band_diff);
+		}
+		progress.Increment();
+	}
+	progress.Toggle(progress_enabled_);
+
+	return true;
+}
+
+// CORRELATION COEFFICIENT INDEX -> NUNEZ:1999 with a modifications in the correlation coefficient equation
+bool TePDIFusionIndexes::correlation_coefficient_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> cc)
+{
+	/*double	original_mean,
+		fused_mean,
+		original_pixel,
+		fused_pixel,
+		sigma_original_fused = 0.0,
+		sigma_original = 0.0,
+		sigma_fused = 0.0,
+		diff_original,
+		diff_fused;
+
+	TEAGN_TRUE_OR_THROW(raster_mean(original_raster, original_band, original_mean), "Unable to compute Original raster mean");
+	TEAGN_TRUE_OR_THROW(raster_mean(fused_raster, fused_band, fused_mean), "Unable to compute Fused raster mean");	
+
+	TePDIPIManager progress("Computing correlation coefficient index", original_raster->params().nlines_, progress_enabled_);
+	for (int j = 0; j < original_raster->params().nlines_; j++)
+	{
+		for (int i = 0; i < original_raster->params().ncols_; i++)
+		{
+			original_raster->getElement(i, j, original_pixel, original_band);
+			fused_raster->getElement(i, j, fused_pixel, fused_band);
+			diff_original = original_pixel - original_mean;
+			diff_fused = fused_pixel - fused_mean;
+			sigma_original_fused += diff_original * diff_fused;
+			sigma_original += diff_original * diff_original;
+			sigma_fused += diff_fused * diff_fused;
+		}
+		progress.Increment();
+	}
+	progress.Toggle(false);
+
+	*cc = sigma_original_fused / sqrt(sigma_original * sigma_fused);*/
+
+	TePDIStatistic stat;
+	
+	TePDIParameters stat_pars;
+	TePDITypes::TePDIRasterVectorType stat_rasters;
+	stat_rasters.push_back(original_raster);
+	stat_rasters.push_back(fused_raster);
+	stat_pars.SetParameter("rasters", stat_rasters);
+	std::vector<int> stat_bands;
+	stat_bands.push_back(original_band);
+	stat_bands.push_back(fused_band);
+	stat_pars.SetParameter("bands", stat_bands);
+
+	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+	stat.ToggleProgInt(progress_enabled_);
+	
+	*cc = stat.getCorrelation(0, 1);
+
+	return true;
+}
+
+// BIAS INDEX -> OTAZU:2005
+bool TePDIFusionIndexes::bias_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> bias)
+{
+	double	original_mean,
+			fused_mean;
+	/*TEAGN_TRUE_OR_THROW(raster_mean(original_raster, original_band, original_mean), "Unable to compute Original raster mean");
+	TEAGN_TRUE_OR_THROW(raster_mean(fused_raster, fused_band, fused_mean), "Unable to compute Fused raster mean");
+
+	*bias = (((original_mean - fused_mean) >= 0)?(original_mean - fused_mean):(fused_mean - original_mean));*/
+
+	TePDIStatistic stat;
+	
+	TePDIParameters stat_pars;
+	TePDITypes::TePDIRasterVectorType stat_rasters;
+	stat_rasters.push_back(original_raster);
+	stat_rasters.push_back(fused_raster);
+	stat_pars.SetParameter("rasters", stat_rasters);
+	std::vector<int> stat_bands;
+	stat_bands.push_back(original_band);
+	stat_bands.push_back(fused_band);
+	stat_pars.SetParameter("bands", stat_bands);
+
+	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+	stat.ToggleProgInt(progress_enabled_);
+	
+	original_mean = stat.getMean(0);
+	fused_mean = stat.getMean(1);
+
+	*bias = original_mean - fused_mean;
+
+	return true;
+}
+// THESIS MIGUEL TELLES 2008
+bool TePDIFusionIndexes::variance_difference_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> vardif)
+{
+	double	original_variance,
+			fused_variance;
+
+	TePDIStatistic stat;
+	
+	TePDIParameters stat_pars;
+	TePDITypes::TePDIRasterVectorType stat_rasters;
+	stat_rasters.push_back(original_raster);
+	stat_rasters.push_back(fused_raster);
+	stat_pars.SetParameter("rasters", stat_rasters);
+	std::vector<int> stat_bands;
+	stat_bands.push_back(original_band);
+	stat_bands.push_back(fused_band);
+	stat_pars.SetParameter("bands", stat_bands);
+
+	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+	stat.ToggleProgInt(progress_enabled_);
+
+	original_variance = stat.getVariance(0);	
+	fused_variance = stat.getVariance(1);	
+
+	*vardif = (original_variance - fused_variance) / original_variance;
+
+	return true;
+}
+
+// STANDARD DEVIATION DIFFERENCE INDEX -> GONZALEZ-AUDICANA:2004
+bool TePDIFusionIndexes::standard_deviation_diff_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> sdd)
+{
+	TeRasterParams diff_raster_params = original_raster->params();
+	TePDITypes::TePDIRasterPtrType diff_raster;
+	TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(diff_raster,  diff_raster_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create the resampled input rasters");
+
+	int diff_raster_band = 0;
+	/*double	diff_raster_mean,
+		diff_raster_pixel;
+	*sdd = 0.0;*/
+
+	TEAGN_TRUE_OR_THROW(rasters_difference(original_raster, original_band, fused_raster, fused_band, diff_raster, diff_raster_band), "Unable to compute rasters difference");
+	/*TEAGN_TRUE_OR_THROW(raster_mean(diff_raster, diff_raster_band, diff_raster_mean), "Unable to compute Diff raster mean");
+
+	TePDIPIManager progress("Computing difference standard deviation index", diff_raster->params().nlines_, progress_enabled_);
+	for (int j = 0; j < diff_raster->params().nlines_; j++)
+	{
+		for (int i = 0; i < diff_raster->params().ncols_; i++)
+		{
+			diff_raster->getElement(i, j, diff_raster_pixel, diff_raster_band);
+ 			*sdd += (diff_raster_pixel - diff_raster_mean) * (diff_raster_pixel - diff_raster_mean);
+		}
+		progress.Increment();
+	}
+	progress.Toggle(false);
+
+	*sdd = sqrt(*sdd / (double)(diff_raster->params().nlines_ * diff_raster->params().ncols_));*/
+
+	TePDIStatistic stat;
+	
+	TePDIParameters stat_pars;
+	TePDITypes::TePDIRasterVectorType stat_rasters;
+	stat_rasters.push_back(diff_raster);
+	stat_pars.SetParameter("rasters", stat_rasters);
+	std::vector<int> stat_bands;
+	stat_bands.push_back(diff_raster_band);
+	stat_pars.SetParameter("bands", stat_bands);
+
+	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+	stat.ToggleProgInt(progress_enabled_);
+	
+	*sdd = stat.getStdDev(0);
+
+	return true;
+}
+
+bool TePDIFusionIndexes::uiqi_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> uiqi)
+{
+	TePDIStatistic stat;
+	
+	TePDIParameters stat_pars;
+	TePDITypes::TePDIRasterVectorType stat_rasters;
+	stat_rasters.push_back(original_raster);
+	stat_rasters.push_back(fused_raster);
+	stat_pars.SetParameter("rasters", stat_rasters);
+	std::vector<int> stat_bands;
+	stat_bands.push_back(original_band);
+	stat_bands.push_back(fused_band);
+	stat_pars.SetParameter("bands", stat_bands);
+
+	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+	stat.ToggleProgInt(progress_enabled_);
+	
+	TeMatrix	mean_matrix = stat.getMeanMatrix(),
+				stddev_matrix = stat.getStdDevMatrix();
+	double	covariance = stat.getCovariance(0, 1);
+	
+	*uiqi = (covariance / (stddev_matrix(0, 0) * stddev_matrix(1, 0))) * ((2 * mean_matrix(0, 0) * mean_matrix(0, 1)) / ((mean_matrix(0, 0) * mean_matrix(0, 0)) + (mean_matrix(0, 1) * mean_matrix(0, 1)))) * ((2 * stddev_matrix(0, 0) * stddev_matrix(1, 0)) / ((stddev_matrix(0, 0) * stddev_matrix(0, 0)) + (stddev_matrix(1, 0) * stddev_matrix(1, 0))));
+
+	return true;
+}
+
+// RMSE INDEX -> OTAZU:2005
+bool TePDIFusionIndexes::rmse_index(TePDITypes::TePDIRasterPtrType original, int original_band, TePDITypes::TePDIRasterPtrType fused, int fused_band, TeSharedPtr<double> rmse)
+{
+	TeSharedPtr<double>	bias(new double),
+						sdd(new double);
+	TEAGN_TRUE_OR_THROW(bias_index(original, original_band, fused, fused_band, bias), "Unable to compute the bias index");
+ 	TEAGN_TRUE_OR_THROW(standard_deviation_diff_index(original, original_band, fused, fused_band, sdd), "Unable to compute the standart deviation index");
+
+	*rmse = sqrt((*bias * *bias) + (*sdd * *sdd));
+
+	return true;
+}
+
+// ERGAS INDEX -> OTAZU:2005
+bool TePDIFusionIndexes::ergas_index(TePDITypes::TePDIRasterVectorType original_rasters, std::vector<int> original_bands, TePDITypes::TePDIRasterVectorType fused_rasters, std::vector<int> fused_bands, double low_resolution, double high_resolution, TeSharedPtr<double> ergas)
+{
+	TeSharedPtr<double> rmse(new double);
+	double	original_mean,
+			sum = 0.0;
+
+	TePDIStatistic stat;
+	
+	TePDIParameters stat_pars;
+	TePDITypes::TePDIRasterVectorType stat_rasters;
+	std::vector<int> stat_bands;
+	for (unsigned i = 0; i < original_rasters.size(); i++)
+	{
+		stat_rasters.push_back(original_rasters[i]);
+		stat_bands.push_back(original_bands[i]);
+	}
+	stat_pars.SetParameter("rasters", stat_rasters);
+	stat_pars.SetParameter("bands", stat_bands);
+
+	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+	stat.ToggleProgInt(progress_enabled_);
+
+	TePDIPIManager progress("Computing ERGAS index", original_rasters.size(), progress_enabled_);
+	for (unsigned i = 0; i < original_rasters.size(); i++)
+	{
+ 		TEAGN_TRUE_OR_THROW(rmse_index(original_rasters[i], original_bands[i], fused_rasters[i], fused_bands[i], rmse), "Unable to compute the RMSE index");
+		original_mean = stat.getMean(i);
+		sum += (*rmse * *rmse) / (original_mean * original_mean);
+		progress.Increment();
+	}
+	progress.Toggle(progress_enabled_);
+
+	*ergas = 100.0 * (high_resolution / low_resolution) * sqrt((1.0 / (double)original_rasters.size()) * sum);
+
+	return true;
+}
+
+bool TePDIFusionIndexes::structural_similarity_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> simm)
+{
+	double	C1 = 0.01,
+			C2 = 0.03;
+
+	TePDIStatistic stat;
+	
+	TePDIParameters stat_pars;
+	TePDITypes::TePDIRasterVectorType stat_rasters;
+	stat_rasters.push_back(original_raster);
+	stat_rasters.push_back(fused_raster);
+	stat_pars.SetParameter("rasters", stat_rasters);
+	std::vector<int> stat_bands;
+	stat_bands.push_back(original_band);
+	stat_bands.push_back(fused_band);
+	stat_pars.SetParameter("bands", stat_bands);
+
+	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+	stat.ToggleProgInt(progress_enabled_);
+	
+	TeMatrix	mean_matrix = stat.getMeanMatrix(),
+				stddev_matrix = stat.getStdDevMatrix();
+	double	covariance = stat.getCovariance(0, 1);
+
+	*simm = ((2 * mean_matrix(0, 0) * mean_matrix(0, 1) + C1) * (2 * covariance + C2)) / ((mean_matrix(0, 0) * mean_matrix(0, 0) + mean_matrix(0, 1) * mean_matrix(0, 1) + C1) * (stddev_matrix(0, 0) * stddev_matrix(0, 0) + stddev_matrix(1, 0) * stddev_matrix(1, 0) + C2));
+
+	return true;
+}
+
+bool TePDIFusionIndexes::fit_histogram(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType pan_raster, int pan_band, TePDITypes::TePDIRasterPtrType temp_raster)
+{
+	TePDIStatistic stat;
+	
+	TePDIParameters stat_pars;
+	TePDITypes::TePDIRasterVectorType stat_rasters;
+	stat_rasters.push_back(original_raster);
+	stat_rasters.push_back(pan_raster);
+	stat_pars.SetParameter("rasters", stat_rasters);
+	std::vector<int> stat_bands;
+	stat_bands.push_back(original_band);
+	stat_bands.push_back(pan_band);
+	stat_pars.SetParameter("bands", stat_bands);
+
+	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+	stat.ToggleProgInt(false);
+
+	TeMatrix	std_matrix = stat.getStdDevMatrix(),
+			mean_matrix = stat.getMeanMatrix();
+
+	double	pixel,
+		gain = 1.0,
+		offset = 0.0;
+
+ 	gain = std_matrix(0, 0) / std_matrix(1, 0);
+ 	offset = mean_matrix(0, 0) - (gain * mean_matrix(0, 1));
+
+	TePDIPIManager progress("Fitting histograms", pan_raster->params().nlines_, progress_enabled_);
+	for (int j = 0; j < pan_raster->params().nlines_; j++)
+	{
+		for (int i = 0; i < pan_raster->params().ncols_; i++)
+			if (pan_raster->getElement(i, j, pixel))
+			{
+				pixel = gain * pixel + offset;
+				temp_raster->setElement(i, j, pixel, 0);
+			}
+		progress.Increment();
+	}
+	progress.Toggle(false);
+
+	return true;
+}
+
+bool TePDIFusionIndexes::sergas_index(TePDITypes::TePDIRasterVectorType original_rasters, std::vector<int> original_bands, TePDITypes::TePDIRasterPtrType pan_raster, int pan_band, TePDITypes::TePDIRasterVectorType fused_rasters, std::vector<int> fused_bands, double low_resolution, double high_resolution, TeSharedPtr<double> ergas)
+{
+	TeSharedPtr<double> rmse(new double);
+	double	temp_mean,
+		sum = 0.0;
+
+	TePDIPIManager progress("Computing ERGAS index", original_rasters.size(), progress_enabled_);
+	for (unsigned i = 0; i < original_rasters.size(); i++)
+	{
+		TePDITypes::TePDIRasterPtrType tempRaster;
+		TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(tempRaster, pan_raster->params(), TePDIUtils::TePDIUtilsAutoMemPol), "Unable create tempRaster");
+		fit_histogram(original_rasters[i], original_bands[i], pan_raster, pan_band, tempRaster);
+ 		TEAGN_TRUE_OR_THROW(rmse_index(tempRaster, 0, fused_rasters[i], fused_bands[i], rmse), "Unable to compute the RMSE index");
+		TEAGN_TRUE_OR_THROW(raster_mean(tempRaster, 0, temp_mean), "Unable to compute Temp raster mean");
+		sum += (*rmse * *rmse) / (temp_mean * temp_mean);
+		progress.Increment();
+	}
+	progress.Toggle(false);
+
+	*ergas = 100.0 * (high_resolution / low_resolution) * sqrt((1 / (double)original_rasters.size()) * sum);
+
+	return true;
+}
+
+bool TePDIFusionIndexes::spatial_correlation_coefficient_index(TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TePDITypes::TePDIRasterPtrType pan_raster, int pan_band, TeSharedPtr<double> scc)
+{
+	int x,
+		y;
+	int m[3][3];
+	double	pf,
+			pp,
+			sumf,
+			sump;
+
+	m[0][0] = -1; m[0][1] = -1; m[0][2] = -1;
+	m[1][0] = -1; m[1][1] = 8;  m[1][2] = -1;
+	m[2][0] = -1; m[2][1] = -1; m[2][2] = -1;
+
+	TeRasterParams fused_raster_params = fused_raster->params();
+	TePDITypes::TePDIRasterPtrType fused_raster_lap;
+	TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(fused_raster_lap,  fused_raster_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create the fused_raster_lap raster");
+
+	TeRasterParams pan_raster_params = pan_raster->params();
+	TePDITypes::TePDIRasterPtrType pan_raster_lap;
+	TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(pan_raster_lap, pan_raster_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create the pan_raster_lap raster");
+	
+	TePDIPIManager progress("Computing SCC index", fused_raster->params().nlines_, progress_enabled_);
+	for (int j = 0; j < fused_raster->params().nlines_; j++)
+	{
+		for (int i = 0; i < fused_raster->params().ncols_; i++)
+		{
+			sumf = sump = 0.0;
+			for (int l = 0; l < 3; l++)
+			{
+				for (int k = 0; k < 3; k++)
+				{
+					y = j+l-1;
+					x = i+k-1;
+					if (y < 0)
+						y = 0;
+					else if (y >= fused_raster->params().nlines_)
+						y = fused_raster->params().nlines_-1;
+					if (x < 0)
+						x = 0;
+					else if (x >= fused_raster->params().ncols_)
+						x = fused_raster->params().ncols_-1;
+					fused_raster->getElement(x, y, pf, fused_band);
+					pan_raster->getElement(x, y, pp, pan_band);
+					sumf += (pf * (double)m[k][l]);
+					sump += (pp * (double)m[k][l]);
+				}
+			}
+			sumf = (sumf<0.0?0.0:(sumf>256.0?256.0:sumf));
+			sump = (sump<0.0?0.0:(sump>256.0?256.0:sump));
+			fused_raster_lap->setElement(i, j, sumf, 0);
+			pan_raster_lap->setElement(i, j, sump, 0);
+		}
+		progress.Increment();
+	}
+	progress.Toggle(false);
+
+	//TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(fused_raster_lap, "o1.tif"), "GeoTIFF generation error");
+	//TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(pan_raster_lap, "o2.tif"), "GeoTIFF generation error");
+
+	TeSharedPtr<double> cc(new double);
+	correlation_coefficient_index(fused_raster_lap, 0, pan_raster_lap, 0, cc);
+
+	*scc = *cc;
+
+	return true;
+}
+
+bool TePDIFusionIndexes::RunImplementation()
+{
+/* Getting parameters */
+	int index_type;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("index_type", index_type), "Missing parameter: index_type");
+
+	if ((index_type == TePDIFusionIndexes::CC) || (index_type == TePDIFusionIndexes::VARDIF) || (index_type == TePDIFusionIndexes::SDD) || (index_type == TePDIFusionIndexes::BIAS) || (index_type == TePDIFusionIndexes::UIQI) || (index_type == TePDIFusionIndexes::RMSE) || (index_type == TePDIFusionIndexes::SIMM))
+	{
+		TePDITypes::TePDIRasterPtrType original_raster;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("original_raster", original_raster), "Missing parameter: original_raster");
+	
+		int original_band;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("original_band", original_band), "Missing parameter: original_band");
+	
+		TePDITypes::TePDIRasterPtrType fused_raster;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("fused_raster", fused_raster), "Missing parameter: fused_raster");
+	
+		int fused_band;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("fused_band", fused_band), "Missing parameter: fused_band");
+	
+		TeSharedPtr<double> index_value;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("index_value", index_value), "Missing parameter: index_value");
+
+		if (index_type == TePDIFusionIndexes::CC)
+			correlation_coefficient_index(original_raster, original_band, fused_raster, fused_band, index_value);
+		else if (index_type == TePDIFusionIndexes::BIAS)
+			bias_index(original_raster, original_band, fused_raster, fused_band, index_value);
+		else if (index_type == TePDIFusionIndexes::VARDIF)
+			variance_difference_index(original_raster, original_band, fused_raster, fused_band, index_value);
+		else if (index_type == TePDIFusionIndexes::SDD)
+			standard_deviation_diff_index(original_raster, original_band, fused_raster, fused_band, index_value);
+		else if (index_type == TePDIFusionIndexes::UIQI)
+			uiqi_index(original_raster, original_band, fused_raster, fused_band, index_value);
+		else if (index_type == TePDIFusionIndexes::RMSE)
+			rmse_index(original_raster, original_band, fused_raster, fused_band, index_value);
+		else if (index_type == TePDIFusionIndexes::SIMM)
+			structural_similarity_index(original_raster, original_band, fused_raster, fused_band, index_value);
+	}
+	else if ((index_type == TePDIFusionIndexes::ERGAS) || (index_type == TePDIFusionIndexes::SERGAS))
+	{
+		TePDITypes::TePDIRasterVectorType original_rasters;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("original_rasters", original_rasters), "Missing parameter: original_rasters");
+	
+		std::vector<int> original_bands;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("original_bands", original_bands), "Missing parameter: original_bands");
+
+		TePDITypes::TePDIRasterVectorType fused_rasters;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("fused_rasters", fused_rasters), "Missing parameter: fused_rasters");
+	
+		std::vector<int> fused_bands;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("fused_bands", fused_bands), "Missing parameter: fused_bands");
+
+		double low_resolution;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("low_resolution", low_resolution), "Missing parameter: low_resolution");
+
+		double high_resolution;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("high_resolution", high_resolution), "Missing parameter: high_resolution");
+	
+		TeSharedPtr<double> index_value;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("index_value", index_value), "Missing parameter: index_value");
+
+		if (index_type == TePDIFusionIndexes::ERGAS)
+			ergas_index(original_rasters, original_bands, fused_rasters, fused_bands, low_resolution, high_resolution, index_value);
+		else if (index_type == TePDIFusionIndexes::SERGAS)
+		{
+			TePDITypes::TePDIRasterPtrType pan_raster;
+			TEAGN_TRUE_OR_RETURN(params_.GetParameter("pan_raster", pan_raster), "Missing parameter: pan_raster");
+			int pan_band;
+			TEAGN_TRUE_OR_RETURN(params_.GetParameter("pan_band", pan_band), "Missing parameter: pan_band");
+			sergas_index(original_rasters, original_bands, pan_raster, pan_band, fused_rasters, fused_bands, low_resolution, high_resolution, index_value);
+		}
+	}
+	else if (index_type == TePDIFusionIndexes::SCC)
+	{
+		TePDITypes::TePDIRasterPtrType fused_raster;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("fused_raster", fused_raster), "Missing parameter: fused_raster");
+	
+		int fused_band;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("fused_band", fused_band), "Missing parameter: fused_band");
+
+		TePDITypes::TePDIRasterPtrType pan_raster;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("pan_raster", pan_raster), "Missing parameter: pan_raster");
+	
+		int pan_band;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("pan_band", pan_band), "Missing parameter: pan_band");
+	
+		TeSharedPtr<double> index_value;
+		TEAGN_TRUE_OR_RETURN(params_.GetParameter("index_value", index_value), "Missing parameter: index_value");
+
+		spatial_correlation_coefficient_index(fused_raster, fused_band, pan_raster, pan_band, index_value);
+	}
+		
+	return true;
+}
diff --git a/src/terralib/image_processing/TePDIFusionIndexes.hpp b/src/terralib/image_processing/TePDIFusionIndexes.hpp
new file mode 100644
index 0000000..7da739a
--- /dev/null
+++ b/src/terralib/image_processing/TePDIFusionIndexes.hpp
@@ -0,0 +1,195 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIFUSIONINDEXES_HPP
+  #define TEPDIFUSIONINDEXES_HPP
+
+  #include "TePDILevelRemap.hpp"
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the class for principal components generation.
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @ingroup PDIAlgorithms
+   *
+   * @note The required parameters for band to band indexes are:
+   *
+   * @param index_type (TePDIFusionIndexes::TeFusionIndexes) - CC, SDD, BIAS, RMSE
+   * @param original_raster (TePDITypes::TePDIRasterPtrType) - Original raster.
+   * @param original_band (int) - Band of the Original raster.
+   * @param fused_raster (TePDITypes::TePDIRasterPtrType) - Fused raster.
+   * @param fused_band (int) - Band of the Fused raster.
+   * @param index_value (TeSharedPtr<double>) - Index value.
+   *
+   * @note The required parameters for all bands indexes are:
+   *
+   * @param index_type (TePDIFusionIndexes::TeFusionIndexes) - ERGAS
+   * @param original_rasters (TePDITypes::TePDIRasterVectorType) - Original rasters.
+   * @param original_bands (std::vector<int>) - Bands of the Original rasters.
+   * @param fused_rasters (TePDITypes::TePDIRasterVectorType) - Fused rasters.
+   * @param fused_bands (std::vector<int>) - Band of the Fused rasters.
+   * @param index_value (TeSharedPtr<double>) - Index value.
+   */
+  class PDI_DLL TePDIFusionIndexes : public TePDIAlgorithm {
+    public :
+      /** @enum TeFusionIndexes Fusion indexes available */
+      enum TeFusionIndexes {CC, BIAS, VARDIF, SDD, UIQI, RMSE, ERGAS, SIMM, SERGAS, SCC};
+      /** @typedef Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIFusionIndexes > pointer;
+      /** @typedef Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIFusionIndexes > const_pointer;
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIFusionIndexes();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIFusionIndexes();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+      
+	/**
+	* @brief Decide the direction of the analysis based on the analysis_type parameter.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool RunImplementation();
+	
+	/**
+	* @brief Reset the internal state to the initial state.
+	*
+	* @param params The new parameters referente at initial state.
+	*/
+	void ResetState(const TePDIParameters&);
+
+	/**
+	* @brief Compute the raster meam.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool raster_mean(TePDITypes::TePDIRasterPtrType raster, int band, double& mean);
+
+	/**
+	* @brief Compute the difference between two rasters.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool rasters_difference(TePDITypes::TePDIRasterPtrType raster1, int band1, TePDITypes::TePDIRasterPtrType raster2, int band2, TePDITypes::TePDIRasterPtrType raster_diff, int band_diff);
+
+	/**
+	* @brief Compute the CORRELATION COEFFICIENT INDEX between two rasters.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool correlation_coefficient_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> bias);
+
+	/**
+	* @brief Compute the BIAS index between two rasters.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool bias_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> bias);
+
+	/**
+	* @brief Compute the VARIANCE DIFFERENCE INDEX between two rasters.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool variance_difference_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> vardif);
+
+	/**
+	* @brief Compute the STANDARD DEVIATION INDEX of the raster produce by the difference between two rasters.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool standard_deviation_diff_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> bias);
+
+	/**
+	* @brief Compute the UIQI between two rasters.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool uiqi_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> uiqi);
+
+	/**
+	* @brief Compute the RMSE index between two rasters.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool rmse_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> rmse);
+
+	/**
+	* @brief Compute the ERGAS index between two raster set.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool ergas_index(TePDITypes::TePDIRasterVectorType original_rasters, std::vector<int> original_bands, TePDITypes::TePDIRasterVectorType fused_rasters, std::vector<int> fused_bands, double low_resolution, double high_resolution, TeSharedPtr<double> ergas);
+
+	/**
+	* @brief Compute the STRUCTURAL SIMILARITY index between two rasters.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool structural_similarity_index(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TeSharedPtr<double> simm);
+
+	/**
+	* @brief Fit histogram between two rasters.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool fit_histogram(TePDITypes::TePDIRasterPtrType original_raster, int original_band, TePDITypes::TePDIRasterPtrType pan_raster, int pan_band, TePDITypes::TePDIRasterPtrType temp_raster);
+
+	/**
+	* @brief Compute the Spatial ERGAS index between two raster set.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool sergas_index(TePDITypes::TePDIRasterVectorType original_rasters, std::vector<int> original_bands, TePDITypes::TePDIRasterPtrType pan_raster, int pan_band, TePDITypes::TePDIRasterVectorType fused_rasters, std::vector<int> fused_bands, double low_resolution, double high_resolution, TeSharedPtr<double> ergas);
+
+	/**
+	* @brief Compute the Spacial Correlation Coefficient index between two rasters.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool spatial_correlation_coefficient_index(TePDITypes::TePDIRasterPtrType fused_raster, int fused_band, TePDITypes::TePDIRasterPtrType pan_raster, int pan_band, TeSharedPtr<double> scc);
+  };
+
+#endif //TEPDIFUSIONINDEXES_HPP
diff --git a/src/terralib/image_processing/TePDIGarguetFusion.cpp b/src/terralib/image_processing/TePDIGarguetFusion.cpp
new file mode 100644
index 0000000..71fee80
--- /dev/null
+++ b/src/terralib/image_processing/TePDIGarguetFusion.cpp
@@ -0,0 +1,323 @@
+#include "TePDIGarguetFusion.hpp"
+#include "TePDIUtils.hpp"
+#include "TePDIMallatWavelets.hpp"
+
+TePDIGarguetFusion::TePDIGarguetFusion()
+{
+}
+
+TePDIGarguetFusion::~TePDIGarguetFusion()
+{
+}
+
+
+void TePDIGarguetFusion::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDIGarguetFusion::CheckParameters( const TePDIParameters& parameters ) 
+  const
+{
+  /* Checking reference_raster */
+  
+  TePDITypes::TePDIRasterPtrType reference_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster", 
+    reference_raster ),
+    "Missing parameter: reference_raster" );
+  TEAGN_TRUE_OR_RETURN( reference_raster.isActive(),
+    "Invalid parameter: reference_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( reference_raster->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: reference_raster not ready" );    
+    
+  /* Checking lowres_raster */
+  
+  TePDITypes::TePDIRasterPtrType lowres_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "lowres_raster", 
+    lowres_raster ),
+    "Missing parameter: lowres_raster" );
+  TEAGN_TRUE_OR_RETURN( lowres_raster.isActive(),
+    "Invalid parameter: lowres_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( lowres_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: lowres_raster not ready" );    
+    
+  double max_low_res_raster_res =
+    MAX( lowres_raster->params().resx_, 
+    lowres_raster->params().resy_ );
+  double max_reference_raster_res =
+    MAX( reference_raster->params().resx_, 
+    reference_raster->params().resy_ );
+    
+  TEAGN_TRUE_OR_RETURN(     
+    ( max_low_res_raster_res > max_reference_raster_res ),
+    "Invalid low resolution raster resolution" );
+        
+  /* Checking output_raster */
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
+    output_raster ),
+    "Missing parameter: output_raster" );
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
+    "Invalid parameter: output_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );    
+    
+  /* Checking bands */    
+    
+  int reference_raster_band = 0;    
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster_band", 
+    reference_raster_band ), "Missing parameter : reference_raster_band" );
+  TEAGN_TRUE_OR_RETURN( ( reference_raster->nBands() > reference_raster_band ),
+    "Invalid parameter : reference_raster_band" );
+    
+  int lowres_raster_band = 0;    
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "lowres_raster_band", 
+    lowres_raster_band ), "Missing parameter : lowres_raster_band" );
+  TEAGN_TRUE_OR_RETURN( ( lowres_raster->nBands() > lowres_raster_band ),
+    "Invalid parameter : lowres_raster_band" ); 
+    
+  /* Checking photometric interpretation */
+  
+  TEAGN_TRUE_OR_RETURN( ( 
+    ( reference_raster->params().photometric_[ reference_raster_band ] == 
+      TeRasterParams::TeRGB ) ||
+    ( reference_raster->params().photometric_[ reference_raster_band ] == 
+      TeRasterParams::TeMultiBand ) ),
+  "Invalid parameter - reference_raster (invalid photometric interpretation)" );   
+
+  TEAGN_TRUE_OR_RETURN( ( 
+    ( lowres_raster->params().photometric_[ lowres_raster_band ] == 
+      TeRasterParams::TeRGB ) ||
+    ( lowres_raster->params().photometric_[ lowres_raster_band ] == 
+      TeRasterParams::TeMultiBand ) ),
+  "Invalid parameter - lowres_raster (invalid photometric interpretation)" );   
+      
+  return true;
+}
+
+
+bool TePDIGarguetFusion::RunImplementation()
+{
+  TePDITypes::TePDIRasterPtrType reference_raster;
+  params_.GetParameter( "reference_raster", reference_raster );
+
+  TePDITypes::TePDIRasterPtrType lowres_raster;
+  params_.GetParameter( "lowres_raster", lowres_raster );
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter( "output_raster", output_raster );
+  
+  int reference_raster_band = 0;
+  params_.GetParameter( "reference_raster_band", reference_raster_band );
+
+  int lowres_raster_band = 0;
+  params_.GetParameter( "lowres_raster_band", lowres_raster_band );
+  
+  TePDITypes::TePDIRasterPtrType lowlow;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( lowlow, 1, 1, 1, false,
+    TeDOUBLE, 0 ), "Unable to create temporary low-low raster" );  
+  
+  /* Finding the best decomposition levels for reference raster */
+  
+  unsigned int rr_best_level = 0;
+  unsigned int rr_best_level_w = 0;
+  unsigned int rr_best_level_h = 0;
+  
+  TEAGN_TRUE_OR_RETURN( findBestDecimLevel( reference_raster,
+    lowres_raster, rr_best_level, rr_best_level_w,
+    rr_best_level_h ), 
+    "Unable to find the best decomposition level" )
+    
+ /* Building default wavelet filters  - Reference coef 07 */
+ 
+  double filters_scale = 0.71;
+  if( params_.CheckParameter< double >( "filters_scale" ) ) {
+      
+    params_.GetParameter( "filters_scale", filters_scale );
+  }
+    
+  std::vector< double > a_filter_l;
+  a_filter_l.push_back( -0.05 );
+  a_filter_l.push_back( 0.25 );
+  a_filter_l.push_back( 0.6 );
+  a_filter_l.push_back( 0.25 );
+  a_filter_l.push_back( -0.05 );
+  
+  std::vector< double > a_filter_h;
+  a_filter_h.push_back( 0.0107143 );
+  a_filter_h.push_back( -0.0535714 );
+  a_filter_h.push_back( -0.2607143 );
+  a_filter_h.push_back( 0.6071429 );
+  a_filter_h.push_back( -0.2607143 );
+  a_filter_h.push_back( -0.0535714 );
+  a_filter_h.push_back( 0.0107143 );
+  
+  std::vector< double > s_filter_l;
+  s_filter_l.push_back( -0.0107143 );
+  s_filter_l.push_back( -0.0535714 );
+  s_filter_l.push_back( 0.2607143 );
+  s_filter_l.push_back( 0.6071429 );
+  s_filter_l.push_back( 0.2607143 );
+  s_filter_l.push_back( -0.0535714 );
+  s_filter_l.push_back( -0.0107143 );
+  
+  std::vector< double > s_filter_h;
+  s_filter_h.push_back( -0.05 );
+  s_filter_h.push_back( -0.25 );
+  s_filter_h.push_back( 0.6 );
+  s_filter_h.push_back( -0.25 );
+  s_filter_h.push_back( -0.05 );
+  
+  /* Checking for user supplied wavelet filters */
+  
+  if( params_.CheckParameter< std::vector< double > >( "a_filter_l" ) ) {
+      
+    params_.GetParameter( "a_filter_l", a_filter_l );
+  }
+  if( params_.CheckParameter< std::vector< double > >( "a_filter_h" ) ) {
+      
+    params_.GetParameter( "a_filter_h", a_filter_h );
+  }  
+  if( params_.CheckParameter< std::vector< double > >( "s_filter_l" ) ) {
+      
+    params_.GetParameter( "s_filter_l", s_filter_l );
+  }
+  if( params_.CheckParameter< std::vector< double > >( "s_filter_h" ) ) {
+      
+    params_.GetParameter( "s_filter_h", s_filter_h );
+  }  
+
+  /* Bringing the low res raster to the correct size */
+
+  if( ( lowres_raster->params().nlines_ != (int)rr_best_level_h ) ||
+    ( lowres_raster->params().ncols_ != (int)rr_best_level_w ) ) {
+
+    TePDITypes::TePDIRasterPtrType resampled_raster;
+
+    TeRasterParams dummy_pars;
+    dummy_pars.setNLinesNColumns( 1, 1 );
+
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( 
+      resampled_raster,
+      dummy_pars, TePDIUtils::TePDIUtilsAutoMemPol ),
+      "Unable create the new resampled raster" );
+
+    TePDIInterpolator::InterpMethod int_method = 
+      TePDIInterpolator::NNMethod;
+    if( 
+      ( ( (int)rr_best_level_h ) < 
+      lowres_raster->params().nlines_ ) ||
+      ( ( (int)rr_best_level_w ) < 
+      lowres_raster->params().ncols_ ) ) {
+
+      int_method = TePDIInterpolator::BicubicMethod;
+    }
+
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::resampleRasterByLinsCols(
+      lowres_raster, resampled_raster, rr_best_level_h,
+      rr_best_level_w, progress_enabled_,
+      TePDIInterpolator::NNMethod ),
+      "Error resampling low resolution raster" );
+
+    lowres_raster = resampled_raster;
+  }
+
+
+  /* starting filter */
+  
+  TePDIParameters params2;
+  params2.SetParameter( "filter_task", std::string( "SBSwap" ) );
+  params2.SetParameter( "input_image", reference_raster );
+  params2.SetParameter( "band", reference_raster_band );
+  params2.SetParameter( "output_image", output_raster );
+  params2.SetParameter( "a_filter_l", a_filter_l );
+  params2.SetParameter( "a_filter_h", a_filter_h );
+  params2.SetParameter( "s_filter_l", s_filter_l );
+  params2.SetParameter( "s_filter_h", s_filter_h );    
+  params2.SetParameter( "filters_scale", filters_scale );         
+  params2.SetParameter( "levels", (int)rr_best_level );  
+  params2.SetParameter( "sub_band", lowres_raster ); 
+  params2.SetParameter( "sub_band_index", (int)0 );  
+    
+  TePDIMallatWavelets filter2;
+  filter2.ToggleProgInt( progress_enabled_ );
+  TEAGN_TRUE_OR_RETURN( filter2.Reset( params2 ),
+    "Unable to set wavelet filter 2 Parameters" );  
+  TEAGN_TRUE_OR_RETURN( filter2.Apply(), 
+    "Wavelet Filter apply error" );  
+   
+  return true;
+}
+
+bool TePDIGarguetFusion::findBestDecimLevel( 
+  const TePDITypes::TePDIRasterPtrType& reference_raster,
+  const TePDITypes::TePDIRasterPtrType& lowres_raster,
+  unsigned int& rr_level, 
+  unsigned int& rr_level_width,
+  unsigned int& rr_level_height )
+{
+  /* Default output values */
+
+  rr_level = rr_level_width = rr_level_height = 0;
+
+  /* Input checking */
+
+  TEAGN_TRUE_OR_THROW( reference_raster.isActive(), 
+    "reference_raster inactive" );
+  TEAGN_TRUE_OR_THROW( lowres_raster.isActive(), 
+    "lowres_raster inactive" );
+    
+  unsigned int rr_lines =   
+    reference_raster->params().nlines_ ;
+  unsigned int rr_cols = 
+    reference_raster->params().ncols_;
+
+  const unsigned long int rr_max_levels = MIN(
+    TePDIMathFunctions::DecimLevels( rr_lines ),
+    TePDIMathFunctions::DecimLevels( rr_cols ) );  
+  
+  if( rr_max_levels > 0 ) {
+    double rr_resx = reference_raster->params().resx_;
+    double rr_resy = reference_raster->params().resy_;
+    double lr_resx = lowres_raster->params().resx_;
+    double lr_resy = lowres_raster->params().resy_;
+    double curr_diff_y = 0;
+    double curr_diff_x = 0;
+    double curr_err = 0;
+    double best_err = DBL_MAX;
+    
+    for( unsigned long int curr_rr_level = 1 ; 
+      curr_rr_level <= rr_max_levels ; 
+      ++curr_rr_level ) {
+      
+      rr_lines = (unsigned int)
+        ceil( ( (double)rr_lines ) / 2 );
+      rr_cols = (unsigned int)
+        ceil( ( (double)rr_cols ) / 2 );
+      rr_resy *= 2.0;
+      rr_resx *= 2.0;   
+        
+      curr_diff_y = ABS( lr_resy - rr_resy );
+      curr_diff_x = ABS( lr_resx - rr_resx );
+
+      curr_err = MAX( curr_diff_x, curr_diff_y );
+          
+      if( curr_err < best_err ) {
+        best_err = curr_err;
+
+        rr_level = curr_rr_level;
+        rr_level_width = rr_cols;
+        rr_level_height = rr_lines;
+      }
+    }
+  }
+
+  if( rr_level > 0 ) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
diff --git a/src/terralib/image_processing/TePDIGarguetFusion.hpp b/src/terralib/image_processing/TePDIGarguetFusion.hpp
new file mode 100644
index 0000000..e875146
--- /dev/null
+++ b/src/terralib/image_processing/TePDIGarguetFusion.hpp
@@ -0,0 +1,105 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIGARGUETFUSION_HPP
+  #define TEPDIGARGUETFUSION_HPP
+
+  #include "TePDIAlgorithm.hpp"
+
+  /**
+   * @class TePDIGarguetFusion
+   * @brief This is the class for garguet fusion.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIFusionAlgorithms
+   *
+   * @note The required parameters are:
+   * @param reference_raster ( TePDITypes::TePDIRasterPtrType ) - 
+   *  Reference raster ( higher quality ).
+   * @param lowres_raster ( TePDITypes::TePDIRasterPtrType ) - 
+   *  Low resolution raster ( will be improved ).
+   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
+   * @param reference_raster_band ( int ) - The band to process for 
+   * reference_raster.
+   * @param lowres_raster_band ( int ) - The band to process for lowres_raster.
+   *
+   * @note The following parameters are optional, and will be used if present:
+   *
+   * @param filters_scale ( double ) - The wavelet filters scale.
+   * @param a_filter_l ( std::vector< double > ) - Wavelet Analysis filter, 
+   * low pass, non
+   * normalized ( used in decomposition ).
+   * @param a_filter_h ( std::vector< double > ) - Wavelet Analysis filter, 
+   * high pass, non
+   * normalized ( used in decomposition ).
+   * @param s_filter_l ( std::vector< double > ) - Wavelet Synthesis filter, 
+   * low pass, non
+   * normalized ( used in recomposition ).
+   * @param s_filter_h ( std::vector< double > ) - Wavelet Synthesis filter, 
+   * high pass, non
+   * normalized ( used in recomposition ). 
+   *
+   * @example TePDIFusion_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIGarguetFusion : public TePDIAlgorithm
+  {
+    public :
+      
+      TePDIGarguetFusion();      
+
+      ~TePDIGarguetFusion();
+
+      //Overloaded
+      bool CheckParameters( const TePDIParameters& parameters ) const;   
+            
+    protected :
+    
+      //Overloaded
+      void ResetState( const TePDIParameters& params );    
+     
+      //Overloaded
+      bool RunImplementation();      
+  
+      /**
+      * @brief Find the best reference_raster decimation level 
+      * that comes close to lowres_raster.
+      *
+      * @param reference_raster Reference raster.
+      * @param lowres_raster Low resolution raster.
+      * @param rr_level Reference raster best decomposition level.
+      * @param rr_level_width Reference raster best decomposition level
+      * width (starting from level 1 - at least 1 decimation
+      * done)
+      * @param rr_level_height Reference raster best decomposition level
+      * height.      
+      * @return true if OK. false on errors.
+      */
+      bool findBestDecimLevel( 
+        const TePDITypes::TePDIRasterPtrType& reference_raster,
+        const TePDITypes::TePDIRasterPtrType& lowres_raster,
+        unsigned int& rr_level, 
+        unsigned int& rr_level_width,
+        unsigned int& rr_level_height );    
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDIGarguetFusionSF.cpp b/src/terralib/image_processing/TePDIGarguetFusionSF.cpp
deleted file mode 100755
index 726ab4a..0000000
--- a/src/terralib/image_processing/TePDIGarguetFusionSF.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "TePDIGarguetFusionSF.hpp"
-#include "TePDIGarguetFusionStrategy.hpp"
-
-TePDIGarguetFusionSF::TePDIGarguetFusionSF()
-: TePDIStrategyFactory( std::string( "garguet" ) )
-{
-};
-
-
-TePDIGarguetFusionSF::~TePDIGarguetFusionSF()
-{
-};
-
-
-TePDIStrategy* TePDIGarguetFusionSF::build ( const TePDIParameters& )
-{
-  TePDIStrategy* instance_ptr = new TePDIGarguetFusionStrategy();
-  
-  return instance_ptr;
-}
-
diff --git a/src/terralib/image_processing/TePDIGarguetFusionSF.hpp b/src/terralib/image_processing/TePDIGarguetFusionSF.hpp
deleted file mode 100755
index 755daba..0000000
--- a/src/terralib/image_processing/TePDIGarguetFusionSF.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIGARGUETFUSIONSF_HPP
-  #define TEPDIGARGUETFUSIONSF_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIStrategyFactory.hpp"
-  #include "TePDIParameters.hpp"
-  #include "TePDIStrategy.hpp"
-  
-  /**
-   * @brief This is the class for garguet fusion strategy factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategiesFactories
-   */
-  class PDI_DLL TePDIGarguetFusionSF : public TePDIStrategyFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIGarguetFusionSF();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIGarguetFusionSF();
-      
-    protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated strategy instance.
-       */
-      TePDIStrategy* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace
-  {  
-    static TePDIGarguetFusionSF TePDIGarguetFusionSF_instance;
-  };
-
-#endif
-
diff --git a/src/terralib/image_processing/TePDIGarguetFusionStrategy.cpp b/src/terralib/image_processing/TePDIGarguetFusionStrategy.cpp
deleted file mode 100755
index af70d50..0000000
--- a/src/terralib/image_processing/TePDIGarguetFusionStrategy.cpp
+++ /dev/null
@@ -1,329 +0,0 @@
- 
-#include "TePDIGarguetFusionStrategy.hpp"
-#include "TePDIMathFunctions.hpp"
-#include "TePDIStrategyFactory.hpp"
-#include "TePDIMallatWavelets.hpp"
-#include "TePDIUtils.hpp"
-#include <TeAgnostic.h>
-
-#include <TeBox.h>
-#include <TeUtils.h>
-#include <TeRasterParams.h>
-#include <TeRasterRemap.h>
-
-TePDIGarguetFusionStrategy::TePDIGarguetFusionStrategy()
-{
-};      
-
-TePDIGarguetFusionStrategy::~TePDIGarguetFusionStrategy()
-{
-};
-
-
-bool TePDIGarguetFusionStrategy::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking reference_raster */
-  
-  TePDITypes::TePDIRasterPtrType reference_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster", 
-    reference_raster ),
-    "Missing parameter: reference_raster" );
-  TEAGN_TRUE_OR_RETURN( reference_raster.isActive(),
-    "Invalid parameter: reference_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( reference_raster->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: reference_raster not ready" );    
-    
-  /* Checking lowres_raster */
-  
-  TePDITypes::TePDIRasterPtrType lowres_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "lowres_raster", 
-    lowres_raster ),
-    "Missing parameter: lowres_raster" );
-  TEAGN_TRUE_OR_RETURN( lowres_raster.isActive(),
-    "Invalid parameter: lowres_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( lowres_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: lowres_raster not ready" );    
-    
-  double max_low_res_raster_res =
-    MAX( lowres_raster->params().resx_, 
-    lowres_raster->params().resy_ );
-  double max_reference_raster_res =
-    MAX( reference_raster->params().resx_, 
-    reference_raster->params().resy_ );
-    
-  TEAGN_TRUE_OR_RETURN(     
-    ( max_low_res_raster_res > max_reference_raster_res ),
-    "Invalid low resolution raster resolution" );
-        
-  /* Checking output_raster */
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
-    output_raster ),
-    "Missing parameter: output_raster" );
-  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
-    "Invalid parameter: output_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );    
-    
-  /* Checking bands */    
-    
-  int reference_raster_band = 0;    
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster_band", 
-    reference_raster_band ), "Missing parameter : reference_raster_band" );
-  TEAGN_TRUE_OR_RETURN( ( reference_raster->nBands() > reference_raster_band ),
-    "Invalid parameter : reference_raster_band" );
-    
-  int lowres_raster_band = 0;    
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "lowres_raster_band", 
-    lowres_raster_band ), "Missing parameter : lowres_raster_band" );
-  TEAGN_TRUE_OR_RETURN( ( lowres_raster->nBands() > lowres_raster_band ),
-    "Invalid parameter : lowres_raster_band" ); 
-    
-  /* Checking photometric interpretation */
-  
-  TEAGN_TRUE_OR_RETURN( ( 
-    ( reference_raster->params().photometric_[ reference_raster_band ] == 
-      TeRasterParams::TeRGB ) ||
-    ( reference_raster->params().photometric_[ reference_raster_band ] == 
-      TeRasterParams::TeMultiBand ) ),
-  "Invalid parameter - reference_raster (invalid photometric interpretation)" );   
-
-  TEAGN_TRUE_OR_RETURN( ( 
-    ( lowres_raster->params().photometric_[ lowres_raster_band ] == 
-      TeRasterParams::TeRGB ) ||
-    ( lowres_raster->params().photometric_[ lowres_raster_band ] == 
-      TeRasterParams::TeMultiBand ) ),
-  "Invalid parameter - lowres_raster (invalid photometric interpretation)" );   
-      
-  return true;
-}
-
-
-bool TePDIGarguetFusionStrategy::Implementation( const TePDIParameters& params )
-{
-  TePDITypes::TePDIRasterPtrType reference_raster;
-  params.GetParameter( "reference_raster", reference_raster );
-
-  TePDITypes::TePDIRasterPtrType lowres_raster;
-  params.GetParameter( "lowres_raster", lowres_raster );
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params.GetParameter( "output_raster", output_raster );
-  
-  int reference_raster_band = 0;
-  params.GetParameter( "reference_raster_band", reference_raster_band );
-
-  int lowres_raster_band = 0;
-  params.GetParameter( "lowres_raster_band", lowres_raster_band );
-  
-  TePDITypes::TePDIRasterPtrType lowlow;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( lowlow, 1, 1, 1, false,
-    TeDOUBLE, 0 ), "Unable to create temporary low-low raster" );  
-  
-  /* Finding the best decomposition levels for reference raster */
-  
-  unsigned int rr_best_level = 0;
-  unsigned int rr_best_level_w = 0;
-  unsigned int rr_best_level_h = 0;
-  
-  TEAGN_TRUE_OR_RETURN( findBestDecimLevel( reference_raster,
-    lowres_raster, rr_best_level, rr_best_level_w,
-    rr_best_level_h ), 
-    "Unable to find the best decomposition level" )
-    
- /* Building default wavelet filters  - Reference coef 07 */
- 
-  double filters_scale = 0.71;
-  if( params.CheckParameter< double >( "filters_scale" ) ) {
-      
-    params.GetParameter( "filters_scale", filters_scale );
-  }
-    
-  std::vector< double > a_filter_l;
-  a_filter_l.push_back( -0.05 );
-  a_filter_l.push_back( 0.25 );
-  a_filter_l.push_back( 0.6 );
-  a_filter_l.push_back( 0.25 );
-  a_filter_l.push_back( -0.05 );
-  
-  std::vector< double > a_filter_h;
-  a_filter_h.push_back( 0.0107143 );
-  a_filter_h.push_back( -0.0535714 );
-  a_filter_h.push_back( -0.2607143 );
-  a_filter_h.push_back( 0.6071429 );
-  a_filter_h.push_back( -0.2607143 );
-  a_filter_h.push_back( -0.0535714 );
-  a_filter_h.push_back( 0.0107143 );
-  
-  std::vector< double > s_filter_l;
-  s_filter_l.push_back( -0.0107143 );
-  s_filter_l.push_back( -0.0535714 );
-  s_filter_l.push_back( 0.2607143 );
-  s_filter_l.push_back( 0.6071429 );
-  s_filter_l.push_back( 0.2607143 );
-  s_filter_l.push_back( -0.0535714 );
-  s_filter_l.push_back( -0.0107143 );
-  
-  std::vector< double > s_filter_h;
-  s_filter_h.push_back( -0.05 );
-  s_filter_h.push_back( -0.25 );
-  s_filter_h.push_back( 0.6 );
-  s_filter_h.push_back( -0.25 );
-  s_filter_h.push_back( -0.05 );
-  
-  /* Checking for user supplied wavelet filters */
-  
-  if( params.CheckParameter< std::vector< double > >( "a_filter_l" ) ) {
-      
-    params.GetParameter( "a_filter_l", a_filter_l );
-  }
-  if( params.CheckParameter< std::vector< double > >( "a_filter_h" ) ) {
-      
-    params.GetParameter( "a_filter_h", a_filter_h );
-  }  
-  if( params.CheckParameter< std::vector< double > >( "s_filter_l" ) ) {
-      
-    params.GetParameter( "s_filter_l", s_filter_l );
-  }
-  if( params.CheckParameter< std::vector< double > >( "s_filter_h" ) ) {
-      
-    params.GetParameter( "s_filter_h", s_filter_h );
-  }  
-
-  /* Bringing the low res raster to the correct size */
-
-  if( ( lowres_raster->params().nlines_ != (int)rr_best_level_h ) ||
-    ( lowres_raster->params().ncols_ != (int)rr_best_level_w ) ) {
-
-    TePDITypes::TePDIRasterPtrType resampled_raster;
-
-    TeRasterParams dummy_pars;
-    dummy_pars.setNLinesNColumns( 1, 1 );
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( 
-      resampled_raster,
-      dummy_pars, TePDIUtils::TePDIUtilsAutoMemPol ),
-      "Unable create the new resampled raster" );
-
-    TePDIInterpolator::InterpMethod int_method = 
-      TePDIInterpolator::NNMethod;
-    if( 
-      ( ( (int)rr_best_level_h ) < 
-      lowres_raster->params().nlines_ ) ||
-      ( ( (int)rr_best_level_w ) < 
-      lowres_raster->params().ncols_ ) ) {
-
-      int_method = TePDIInterpolator::BicubicMethod;
-    }
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::resampleRasterByLinsCols(
-      lowres_raster, resampled_raster, rr_best_level_h,
-      rr_best_level_w, progress_interface_enabled_,
-      TePDIInterpolator::NNMethod ),
-      "Error resampling low resolution raster" );
-
-    lowres_raster = resampled_raster;
-  }
-
-
-  /* starting filter */
-  
-  TePDIParameters params2;
-  params2.SetParameter( "filter_task", std::string( "SBSwap" ) );
-  params2.SetParameter( "input_image", reference_raster );
-  params2.SetParameter( "band", reference_raster_band );
-  params2.SetParameter( "output_image", output_raster );
-  params2.SetParameter( "a_filter_l", a_filter_l );
-  params2.SetParameter( "a_filter_h", a_filter_h );
-  params2.SetParameter( "s_filter_l", s_filter_l );
-  params2.SetParameter( "s_filter_h", s_filter_h );    
-  params2.SetParameter( "filters_scale", filters_scale );         
-  params2.SetParameter( "levels", (int)rr_best_level );  
-  params2.SetParameter( "sub_band", lowres_raster ); 
-  params2.SetParameter( "sub_band_index", (int)0 );  
-    
-  TePDIMallatWavelets filter2;
-  filter2.ToggleProgInt( progress_interface_enabled_ );
-  TEAGN_TRUE_OR_RETURN( filter2.Reset( params2 ),
-    "Unable to set wavelet filter 2 Parameters" );  
-  TEAGN_TRUE_OR_RETURN( filter2.Apply(), 
-    "Wavelet Filter apply error" );  
-    
-  return true;
-}
-
-
-bool TePDIGarguetFusionStrategy::findBestDecimLevel( 
-  const TePDITypes::TePDIRasterPtrType& reference_raster,
-  const TePDITypes::TePDIRasterPtrType& lowres_raster,
-  unsigned int& rr_level, 
-  unsigned int& rr_level_width,
-  unsigned int& rr_level_height )
-{
-  /* Default output values */
-
-  rr_level = rr_level_width = rr_level_height = 0;
-
-  /* Input checking */
-
-  TEAGN_TRUE_OR_THROW( reference_raster.isActive(), 
-    "reference_raster inactive" );
-  TEAGN_TRUE_OR_THROW( lowres_raster.isActive(), 
-    "lowres_raster inactive" );
-    
-  unsigned int rr_lines =   
-    reference_raster->params().nlines_ ;
-  unsigned int rr_cols = 
-    reference_raster->params().ncols_;
-
-  const unsigned long int rr_max_levels = MIN(
-    TePDIMathFunctions::DecimLevels( rr_lines ),
-    TePDIMathFunctions::DecimLevels( rr_cols ) );  
-  
-  if( rr_max_levels > 0 ) {
-    double rr_resx = reference_raster->params().resx_;
-    double rr_resy = reference_raster->params().resy_;
-    double lr_resx = lowres_raster->params().resx_;
-    double lr_resy = lowres_raster->params().resy_;
-    double curr_diff_y = 0;
-    double curr_diff_x = 0;
-    double curr_err = 0;
-    double best_err = DBL_MAX;
-    
-    for( unsigned long int curr_rr_level = 1 ; 
-      curr_rr_level <= rr_max_levels ; 
-      ++curr_rr_level ) {
-      
-      rr_lines = (unsigned int)
-        ceil( ( (double)rr_lines ) / 2 );
-      rr_cols = (unsigned int)
-        ceil( ( (double)rr_cols ) / 2 );
-      rr_resy *= 2.0;
-      rr_resx *= 2.0;   
-        
-      curr_diff_y = ABS( lr_resy - rr_resy );
-      curr_diff_x = ABS( lr_resx - rr_resx );
-
-      curr_err = MAX( curr_diff_x, curr_diff_y );
-          
-      if( curr_err < best_err ) {
-        best_err = curr_err;
-
-        rr_level = curr_rr_level;
-        rr_level_width = rr_cols;
-        rr_level_height = rr_lines;
-      }
-    }
-  }
-
-  if( rr_level > 0 ) {
-    return true;
-  } else {
-    return false;
-  }
-}
-
-
diff --git a/src/terralib/image_processing/TePDIGarguetFusionStrategy.hpp b/src/terralib/image_processing/TePDIGarguetFusionStrategy.hpp
deleted file mode 100755
index a473949..0000000
--- a/src/terralib/image_processing/TePDIGarguetFusionStrategy.hpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIGARGUETFUSIONSTRATEGY_HPP
-  #define TEPDIGARGUETFUSIONSTRATEGY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIStrategy.hpp"
-  #include "TePDIParameters.hpp"
-  
-  #include <string>
-
-  /**
-   * @brief This is the class for garguet fusion strategy.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategies
-   *
-   * @note The required parameters are:
-   * @param fusion_type ( std::string ) : Must be "garguet".
-   * @param reference_raster ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Reference raster ( higher quality ).
-   * @param lowres_raster ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Low resolution raster ( will be improved ).
-   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
-   * @param reference_raster_band ( int ) - The band to process for 
-   * reference_raster.
-   * @param lowres_raster_band ( int ) - The band to process for lowres_raster.
-   *
-   * @note The following parameters are optional, and will be used if present:
-   *
-   * @param filters_scale ( double ) - The wavelet filters scale.
-   * @param a_filter_l ( std::vector< double > ) - Wavelet Analysis filter, 
-   * low pass, non
-   * normalized ( used in decomposition ).
-   * @param a_filter_h ( std::vector< double > ) - Wavelet Analysis filter, 
-   * high pass, non
-   * normalized ( used in decomposition ).
-   * @param s_filter_l ( std::vector< double > ) - Wavelet Synthesis filter, 
-   * low pass, non
-   * normalized ( used in recomposition ).
-   * @param s_filter_h ( std::vector< double > ) - Wavelet Synthesis filter, 
-   * high pass, non
-   * normalized ( used in recomposition ).    
-   *
-   */
-  class PDI_DLL TePDIGarguetFusionStrategy : public TePDIStrategy
-  {
-    friend class TePDIGarguetFusionSF;
-  
-    public :
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIGarguetFusionStrategy();
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI strategy.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( 
-        const TePDIParameters& parameters ) const;       
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIGarguetFusionStrategy();
-      
-      /**
-       * @brief Runs the algorithm implementation.
-       *
-       * @return true if OK. false on errors.
-       */
-      bool Implementation( const TePDIParameters& params );
-      
-
-      /**
-      * @brief Find the best reference_raster decimation level 
-      * that comes close to lowres_raster.
-      *
-      * @param reference_raster Reference raster.
-      * @param lowres_raster Low resolution raster.
-      * @param rr_level Reference raster best decomposition level.
-      * @param rr_level_width Reference raster best decomposition level
-      * width (starting from level 1 - at least 1 decimation
-      * done)
-      * @param rr_level_height Reference raster best decomposition level
-      * height.      
-      * @return true if OK. false on errors.
-      */
-      bool findBestDecimLevel( 
-        const TePDITypes::TePDIRasterPtrType& reference_raster,
-        const TePDITypes::TePDIRasterPtrType& lowres_raster,
-        unsigned int& rr_level, 
-        unsigned int& rr_level_width,
-        unsigned int& rr_level_height );      
-   
-  };
-  
-#endif
-
-
-
diff --git a/src/terralib/image_processing/TePDIGeneralizedIHSFusion.cpp b/src/terralib/image_processing/TePDIGeneralizedIHSFusion.cpp
new file mode 100644
index 0000000..3b7db0f
--- /dev/null
+++ b/src/terralib/image_processing/TePDIGeneralizedIHSFusion.cpp
@@ -0,0 +1,411 @@
+#include "TePDIGeneralizedIHSFusion.hpp"
+
+#include <TePDIUtils.hpp>
+#include <TeAgnostic.h>
+#include <TePDIColorTransform.hpp>
+#include <TePDIPIManager.hpp>
+#include <TeRasterRemap.h>
+#include <TePDIStatistic.hpp>
+#include <TeMatrix.h>
+
+#define max_gray_levels 255.0
+#define max_angle 360.0
+#define PI 3.141592653589793238462643383279502884197169399375105820974944592
+#define PIdiv2 (PI / 2)
+#define PImult3div2 (3 * PI / 2)
+#define PImult2 (2 * PI)
+#define AlmostZero 0.0001
+
+TePDIGeneralizedIHSFusion::TePDIGeneralizedIHSFusion()
+{
+}
+
+TePDIGeneralizedIHSFusion::~TePDIGeneralizedIHSFusion()
+{
+}
+
+void TePDIGeneralizedIHSFusion::ResetState(const TePDIParameters& )
+{
+}
+
+bool TePDIGeneralizedIHSFusion::CheckParameters(const TePDIParameters& parameters) const
+{
+	PreProcessingType pp_type;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("pp_type", pp_type), "Missing parameter: pp_type");
+
+	double mean;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("mean", mean), "Missing parameter: mean");
+
+	double variance;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("variance", variance), "Missing parameter: variance");
+
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters" , input_rasters), "Missing parameter: input_rasters");
+	for (unsigned b = 0; b < input_rasters.size(); b++)
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[b].isActive(), "Invalid parameter: input_rasters " + Te2String(b+1) + " inactive");
+  		TEAGN_TRUE_OR_RETURN(input_rasters[b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_rasters " + Te2String(b+1) + " not ready");
+	}
+
+	vector<double> bands_center;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands_center", bands_center), "Missing parameter: bands_center");
+	TEAGN_TRUE_OR_RETURN(bands_center.size() == input_rasters.size(), "Invalid Parameter: number os bands center angles")
+
+	bool pansharpening;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("pansharpening", pansharpening), "Missing parameter: pansharpening");
+
+	if (pansharpening)
+	{
+		TePDITypes::TePDIRasterPtrType reference_raster;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+		TEAGN_TRUE_OR_RETURN(reference_raster.isActive(), "Invalid parameter: reference_raster inactive");
+		TEAGN_TRUE_OR_RETURN(reference_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: reference_raster not ready");
+	}
+
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+	
+	TePDITypes::TePDIRasterVectorType ihs_output_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("ihs_output_rasters" , ihs_output_rasters), "Missing parameter: ihs_output_rasters");
+	for (unsigned b = 0; b < ihs_output_rasters.size(); b++)
+	{
+		TEAGN_TRUE_OR_RETURN(ihs_output_rasters[b].isActive(), "Invalid parameter: ihs_output_rasters " + Te2String(b+1) + " inactive");
+  		TEAGN_TRUE_OR_RETURN(ihs_output_rasters[b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: ihs_output_rasters " + Te2String(b+1) + " not ready");
+	}
+
+	TePDITypes::TePDIRasterPtrType rgb_output_raster;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("rgb_output_raster", rgb_output_raster), "Missing parameter: rgb_output_raster");
+	TEAGN_TRUE_OR_RETURN(rgb_output_raster.isActive(), "Invalid parameter: rgb_output_raster inactive");
+	TEAGN_TRUE_OR_RETURN(rgb_output_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: rgb_output_raster not ready");
+
+	return true;
+}
+
+double max_three(std::vector<double> list)
+{
+	double max_value = -1;
+	for (unsigned int i = 0; i < list.size(); i++)
+		if (list[i] > max_value)
+			max_value = list[i];
+	//return (max_value == 0.0? AlmostZero: max_value);
+	return max_value;
+}
+
+double min_three(std::vector<double> list)
+{
+	double min_value = max_gray_levels + 1.0;
+	for (unsigned int i = 0; i < list.size(); i++)
+		if (list[i] < min_value)
+			min_value = list[i];
+	//return (min_value == 0.0? AlmostZero: min_value);
+	return min_value;
+}
+
+double compute_raster_mean(TePDITypes::TePDIRasterPtrType input_raster)
+{
+	double mean = 0.0;
+	for(int i = 0; i < input_raster->params().ncols_; i++)
+		for(int j = 0; j < input_raster->params().nlines_; j++)
+		{
+			double pixel;
+			input_raster->getElement(i, j, pixel);
+			mean += pixel;
+		}
+	mean /= (double)(input_raster->params().ncols_ * input_raster->params().nlines_);
+	return mean;
+}
+
+
+double compute_raster_variance(TePDITypes::TePDIRasterPtrType input_raster, double mean)
+{
+	double variance = 0.0;
+	for(int i = 0; i < input_raster->params().ncols_; i++)
+		for(int j = 0; j < input_raster->params().nlines_; j++)
+		{
+			double pixel;
+			input_raster->getElement(i, j, pixel);
+			variance += ((pixel - mean) * (pixel - mean));
+		}
+	variance /= (double)(input_raster->params().ncols_ * input_raster->params().nlines_);
+	return variance;
+}
+
+bool TePDIGeneralizedIHSFusion::RunImplementation()
+{
+	PreProcessingType pp_type;
+	params_.GetParameter("pp_type", pp_type);
+
+	double mean;
+	params_.GetParameter("mean", mean);
+
+	double variance;
+	params_.GetParameter("variance", variance);
+
+	vector<double> bands_center;
+	params_.GetParameter("bands_center", bands_center);
+
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	params_.GetParameter("input_rasters" , input_rasters);
+
+// Compute covariance matrix before the transformation
+	TePDIStatistic stat_before;
+
+	TePDIParameters stat_before_pars;
+	std::vector<int> bands(input_rasters.size(), 0);
+	stat_before_pars.SetParameter("rasters", input_rasters);
+	stat_before_pars.SetParameter("bands", bands);
+	TEAGN_TRUE_OR_RETURN(stat_before.Reset(stat_before_pars), "Unable to inialize the statistc module");
+	TeMatrix covariance_input_rasters = stat_before.getCovMatrix();
+	covariance_input_rasters.Print();
+
+	bool pansharpening;
+	params_.GetParameter("pansharpening", pansharpening);
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	params_.GetParameter("reference_raster", reference_raster);
+
+	int reference_raster_band;
+	params_.GetParameter("reference_raster_band", reference_raster_band);
+	
+	TePDITypes::TePDIRasterVectorType ihs_output_rasters;
+	params_.GetParameter("ihs_output_rasters" , ihs_output_rasters);
+
+	TePDITypes::TePDIRasterPtrType rgb_output_raster;
+	params_.GetParameter("rgb_output_raster" , rgb_output_raster);
+
+	int input_rasters_number = input_rasters.size();
+	int output_rasters_number = 3;
+
+	/* Base rasters params */
+	TeRasterParams base_raster_params = input_rasters[0]->params();
+
+	/* Preprocessing input multirasters */
+	TePDITypes::TePDIRasterVectorType pp_input_rasters;
+	for(int b = 0; b < input_rasters_number; b++)
+	{
+		TePDITypes::TePDIRasterPtrType ppInRaster;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(ppInRaster, 1, base_raster_params.nlines_, base_raster_params.ncols_, false, TeDOUBLE, 0), "pp_input_raster Alloc error");
+		pp_input_rasters.push_back(ppInRaster);
+	}
+
+/* Preprocessing input rasters */
+	std::vector<double>	means,
+				variances,
+				gains,
+				offsets;
+
+	TePDIPIManager progress("Pre-processing input rasters", 0, progress_enabled_);
+	if (pp_type == VariancePreProcessing)
+	{
+		progress.Reset("Pre-processing input rasters - Type imposed", input_rasters_number);
+		for(int b = 0; b < input_rasters_number; b++)
+		{
+			means.push_back(compute_raster_mean(input_rasters[b]));
+			variances.push_back(compute_raster_variance(input_rasters[b], means[b]));
+			gains.push_back(sqrt(variance / variances[b]));
+			offsets.push_back(mean - (gains[b] * means[b]));
+			for(int i = 0; i < input_rasters[b]->params().ncols_; i++)
+				for(int j = 0; j < input_rasters[b]->params().nlines_; j++)
+				{
+					double pixel;
+					input_rasters[b]->getElement(i, j, pixel);
+					pixel = gains[b] * pixel + offsets[b];
+					pixel = (pixel>255.0?255.0:pixel);
+					pp_input_rasters[b]->setElement(i, j, pixel);
+				}
+			progress.Increment();
+		}
+	}
+	else if (pp_type == MeanPreProcessing)
+	{
+		for(int b = 0; b < input_rasters_number; b++)
+		{
+			
+			means.push_back(compute_raster_mean(input_rasters[b]));
+			mean += means[b];
+			variances.push_back(compute_raster_variance(input_rasters[b], means[b]));
+			variance += variances[b];
+		}
+		mean /= (double)input_rasters_number;
+		variance /= (double)input_rasters_number;
+		progress.Reset("Pre-processing input rasters - Type means", input_rasters_number);
+		for(int b = 0; b < input_rasters_number; b++)
+		{
+			gains.push_back(sqrt(variance / variances[b]));
+			offsets.push_back(mean - (gains[b] * means[b]));
+			for(int i = 0; i < input_rasters[b]->params().ncols_; i++)
+				for(int j = 0; j < input_rasters[b]->params().nlines_; j++)
+				{
+					double pixel;
+					input_rasters[b]->getElement(i, j, pixel);
+					pixel = pixel * gains[b] + offsets[b];
+					pixel = (pixel>255.0?255.0:pixel);
+					pp_input_rasters[b]->setElement(i, j, pixel);
+				}
+			progress.Increment();
+		}	
+	}
+	else if (pp_type == NoPreProcessing)
+	{
+		progress.Reset("Pre-processing input rasters - Type nothing", input_rasters_number);
+		for(int b = 0; b < input_rasters_number; b++)
+		{
+			pp_input_rasters[b] = input_rasters[b];
+			progress.Increment();
+		}
+	}
+ else
+ {
+  TEAGN_LOG_AND_THROW( "Invalid pre-processing type");
+ } 
+ 
+/* Writing Preprocessing input rasters in disk */
+//	for (int b = 0; b < input_rasters_number; b++)
+//		TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(pp_input_rasters[b], "PPInputRaster_test" + Te2String(b+1) + ".tif"), "GeoTIF generation error");
+
+/* nbands2ihs */
+	std::vector<double>	bands_center_sin,
+				bands_center_cos;
+	for (int b = 0; b < input_rasters_number; b++)
+	{
+		bands_center[b] = (bands_center[b] * PI) / 180.0;
+		bands_center_sin.push_back(sin(bands_center[b]));
+		bands_center_cos.push_back(cos(bands_center[b]));
+	}
+
+	progress.Reset("Non Orthogonal IHS Transformation", base_raster_params.ncols_);
+	for (int i = 0; i < base_raster_params.ncols_; i++)
+	{
+		for (int j = 0; j < base_raster_params.nlines_; j++)
+		{
+			std::vector<double> pixel_vector(input_rasters_number, 0.0);
+			for (int b = 0; b < input_rasters_number; b++)
+				pp_input_rasters[b]->getElement(i, j, pixel_vector[b]);
+			double	max_value = max_three(pixel_vector),
+				min_value = min_three(pixel_vector);
+			double	product_sin = 0.0,
+				product_cos = 0.0;
+			for (int b = 0; b < input_rasters_number; b++)
+			{
+				product_sin += (pixel_vector[b] - min_value) * bands_center_sin[b];
+				product_cos += (pixel_vector[b] - min_value) * bands_center_cos[b];
+			}
+			std::vector<double> pixel_output;
+			pixel_output.push_back(max_value);
+			if (product_cos == 0.0)
+				product_cos = AlmostZero;
+			if (product_cos < 0.0)
+ 				pixel_output.push_back(max_angle * (atan(product_sin / product_cos) + PI) / PImult2);
+			else
+				if (product_sin < 0.0)
+					pixel_output.push_back(max_angle * (PImult2 + atan(product_sin / product_cos)) / PImult2);
+				else
+					pixel_output.push_back(max_angle * atan(product_sin / product_cos) / PImult2);
+			pixel_output[1] = (max_gray_levels * pixel_output[1]) / max_angle;
+			pixel_output.push_back((max_value > 0.0?(max_gray_levels* (1.0-(min_value/max_value))):0.0));
+			for (int b = 0; b < output_rasters_number; b++)
+				ihs_output_rasters[b]->setElement(i, j, pixel_output[b]);
+		}
+		progress.Increment();
+	}
+
+/* ihs vector to ihs 3 bands */
+
+	TeRasterParams ihs_temp_raster_params = input_rasters[0]->params();
+	ihs_temp_raster_params.nBands(output_rasters_number);
+	ihs_temp_raster_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
+	TePDITypes::TePDIRasterPtrType ihs_temp_raster;
+	TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(ihs_temp_raster, ihs_temp_raster_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create ihs_temp_raster");
+
+	progress.Reset("Transforming raster vector in one raster", base_raster_params.ncols_);
+	for (int i = 0; i < base_raster_params.ncols_; i++)
+	{
+		for (int j = 0; j < base_raster_params.nlines_; j++)
+			for (int b = 0; b < output_rasters_number; b++)
+			{
+				double pixel;
+				ihs_output_rasters[b]->getElement(i, j, pixel);
+				ihs_temp_raster->setElement(i, j, pixel, b);
+			}
+		progress.Increment();
+	}
+
+	if (!pansharpening)
+	{
+		TePDIParameters ihs2rgb_params;
+		ihs2rgb_params.SetParameter("input_image", ihs_temp_raster);
+		ihs2rgb_params.SetParameter("output_image", rgb_output_raster);
+		ihs2rgb_params.SetParameter("transf_type", TePDIColorTransform::Ihs2Rgb);
+		TePDIColorTransform IHSTransform;
+		TEAGN_TRUE_OR_THROW(IHSTransform.Apply(), "Unable to build IHS2RGB color space");
+
+// Compute covariance matrix after the transformation
+		TePDIStatistic stat_after;
+	
+		TePDIParameters stat_after_pars;
+		std::vector<int> bands(output_rasters_number, 0);
+		TePDITypes::TePDIRasterVectorType temp_output_rasters;
+		for (int b = 0; b < output_rasters_number; b++)
+		{
+			temp_output_rasters.push_back(rgb_output_raster);
+			bands[b] = b;
+		}
+		stat_after_pars.SetParameter("rasters", temp_output_rasters);
+		stat_after_pars.SetParameter("bands", bands);
+		TEAGN_TRUE_OR_RETURN(stat_after.Reset(stat_after_pars), "Unable to inialize the statistc module");
+		TeMatrix covariance_output_rasters = stat_after.getCovMatrix();
+		covariance_output_rasters.Print();
+
+		return true;
+	}
+
+/* Bringing ihs_temp_raster to reference_raster size generating upsampled_raster */
+	double dummy_value = 0;
+	if (ihs_temp_raster->params().useDummy_)
+		dummy_value = ihs_temp_raster->params().dummy_[0];
+	
+	TeRasterParams upsampled_raster_params;
+	upsampled_raster_params.nBands(output_rasters_number);
+	if (reference_raster->projection() != 0)
+		upsampled_raster_params.projection(TeProjectionFactory::make(reference_raster->projection()->params()));
+	upsampled_raster_params.boxResolution(reference_raster->params().box().x1(), reference_raster->params().box().y1(), reference_raster->params().box().x2(), reference_raster->params().box().y2(), reference_raster->params().resx_, reference_raster->params().resy_);
+	upsampled_raster_params.setDataType(ihs_temp_raster->params().dataType_[0], -1);
+	if (ihs_temp_raster->params().useDummy_)
+		upsampled_raster_params.setDummy(dummy_value, -1);
+	else
+		upsampled_raster_params.useDummy_ = false;
+	upsampled_raster_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
+	
+	TePDITypes::TePDIRasterPtrType upsampled_raster;
+	TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(upsampled_raster, upsampled_raster_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create the new upsampled raster RGB raster");
+	
+	TeRasterRemap remap_instance(ihs_temp_raster.nakedPointer(), upsampled_raster.nakedPointer());
+	TEAGN_TRUE_OR_RETURN(remap_instance.apply(true), "Unable to remap ihs_temp_raster");
+
+/* Swapping intensity band */
+	progress.Reset("Swapping panchromatic and intensity channel", reference_raster->params().ncols_);
+	for (int i = 0; i < reference_raster->params().ncols_; i++)
+	{
+		for (int j = 0; j < reference_raster->params().nlines_; j++)
+		{
+			double pixel;
+			reference_raster->getElement(i, j, pixel, reference_raster_band);
+			upsampled_raster->setElement(i, j, pixel, 0);
+
+		}
+		progress.Increment();
+	}
+
+//	TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(upsampled_raster, "out.tif"), "GeoTIF generation error");
+
+/* ihs2rgb */
+	TePDIParameters ihs2rgb_params;
+	ihs2rgb_params.SetParameter("input_image", upsampled_raster);
+	ihs2rgb_params.SetParameter("output_image", rgb_output_raster);
+	ihs2rgb_params.SetParameter("transf_type", TePDIColorTransform::Ihs2Rgb);
+	TePDIColorTransform IHSTransform;
+	TEAGN_TRUE_OR_THROW(IHSTransform.Apply( ihs2rgb_params ), 
+    "Unable to build IHS2RGB color space");
+
+	return true;
+}
diff --git a/src/terralib/image_processing/TePDIGeneralizedIHSFusion.hpp b/src/terralib/image_processing/TePDIGeneralizedIHSFusion.hpp
new file mode 100644
index 0000000..929ab36
--- /dev/null
+++ b/src/terralib/image_processing/TePDIGeneralizedIHSFusion.hpp
@@ -0,0 +1,111 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIGENERALIZEDIHSFUSION_HPP
+  #define TEPDIGENERALIZEDIHSFUSION_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIParameters.hpp"
+  #include "TePDIAlgorithm.hpp"
+
+  /**
+   * @class TePDIGeneralizedIHSFusion
+   * @brief This is the class for Multi Bands IHS fusion strategy.
+   * @warning This class is under development and may produce incorrect 
+   * results or generate execution errors, please wait for the next version.   
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @ingroup PDIFusionAlgorithms
+   * @param pp_type (TePDIGeneralizedIHSFusion::PreProcessingType) - 
+   * Input rasters pre-processing type.
+   * @param mean (double) - ???
+   * @param variance (double) - ???
+   * @param bands_center (vector<double>) - Bands center angles 
+   * (decimal degrees).
+   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Input
+   * low resolution rasters (only the first band/channel will be
+   * used).
+   * @param pansharpening (bool) - ???
+   * @param reference_raster ( TePDITypes::TePDIRasterPtrType ) - 
+   *  Reference raster ( higher resolution ). 
+   * @param reference_raster_band (int) - Reference raster band/channel. 
+   * @param ihs_output_rasters (TePDITypes::TePDIRasterVectorType) - Pointers
+   * to the output generated IHS components rasters.
+   * @param rgb_output_raster (TePDITypes::TePDIRasterPtrType) - A pointer
+   * to the output generated RGB raster.
+   *
+   * @example TePDIFusion_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIGeneralizedIHSFusion : public TePDIAlgorithm {
+    public :
+      typedef TeSharedPtr< TePDIGeneralizedIHSFusion > pointer;
+      typedef const TeSharedPtr< TePDIGeneralizedIHSFusion > const_pointer;
+      
+      /** Input rasters pre processing type */
+      enum PreProcessingType
+      {
+        NoPreProcessing = 0,
+        VariancePreProcessing = 1,
+        MeanPreProcessing = 2
+      };
+      
+      /**
+       * Default constructor
+       *
+       * @param factoryName Factory name.
+       */
+      TePDIGeneralizedIHSFusion();
+
+      /**
+       * Default Destructor
+       */
+      ~TePDIGeneralizedIHSFusion();
+
+      /**
+       * Checks if the supplied parameters fits the requirements of each
+       * PDI strategy.
+       *
+       * Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( 
+        const TePDIParameters& parameters ) const;       
+
+    protected :
+      /**
+       * Runs the algorithm implementation.
+       *
+       * @return true if OK. false on errors.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+  };
+#endif
diff --git a/src/terralib/image_processing/TePDIGeoMosaic.cpp b/src/terralib/image_processing/TePDIGeoMosaic.cpp
old mode 100755
new mode 100644
index c2ace6a..68a22b0
--- a/src/terralib/image_processing/TePDIGeoMosaic.cpp
+++ b/src/terralib/image_processing/TePDIGeoMosaic.cpp
@@ -1,280 +1,602 @@
-#include "TePDIGeoMosaic.hpp"
-#include "TePDIBlending.hpp"
-#include "TePDIUtils.hpp"
-#include <TeAgnostic.h>
-
-#include <TeVectorRemap.h>
-
-
-TePDIGeoMosaic::TePDIGeoMosaic()
-{
-}
-
-
-TePDIGeoMosaic::~TePDIGeoMosaic()
-{
-}
-
-
-void TePDIGeoMosaic::ResetState( const TePDIParameters& )
-{
-}
-
-
-bool TePDIGeoMosaic::CheckParameters( const TePDIParameters& parameters ) const
-{
-  /* Checking input_raster1 */
-  
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster1", 
-    input_raster1 ),
-    "Missing parameter: input_raster1" );
-  TEAGN_TRUE_OR_RETURN( input_raster1.isActive(),
-    "Invalid parameter: input_raster1 inactive" );
-  TEAGN_TRUE_OR_RETURN( input_raster1->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: input_raster1 not ready" );    
-    
-  /* Checking input_raster2 */
-  
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster2", 
-    input_raster2 ),
-    "Missing parameter: input_raster2" );
-  TEAGN_TRUE_OR_RETURN( input_raster2.isActive(),
-    "Invalid parameter: input_raster2 inactive" );
-  TEAGN_TRUE_OR_RETURN( input_raster2->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: input_raster2 not ready" );    
-    
-  /* channels1 parameter checking */
-
-  std::vector< int > channels1;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "channels1", channels1 ), 
-    "Missing parameter: channels1" );
-  for( unsigned int channels1_index = 0 ; 
-    channels1_index < channels1.size() ; 
-    ++channels1_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( channels1[ channels1_index ] >= 0 ) &&
-      ( channels1[ channels1_index ] < input_raster1->nBands() ),
-      "Invalid parameter: channels1" );
-  }
-  
-  /* channels2 parameter checking */
-
-  std::vector< int > channels2;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "channels2", channels2 ), 
-    "Missing parameter: channels2" );
-  TEAGN_TRUE_OR_RETURN( ( channels2.size() == channels1.size() ),
-    "Size mismatch between channels1 and channels2" );
-  for( unsigned int channels2_index = 0 ; 
-    channels2_index < channels2.size() ; 
-    ++channels2_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( channels2[ channels2_index ] >= 0 ) &&
-      ( channels2[ channels2_index ] < input_raster2->nBands() ),
-      "Invalid parameter: channels2" );
-  }     
-    
-  /* Checking output_raster */
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
-    output_raster ),
-    "Missing parameter: output_raster" );
-  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
-    "Invalid parameter: output_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );
-
-  /* Checking for blending type */
-  
-  std::string blending_type;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "blending_type", 
-    blending_type ), "Missing parameter: blending_type" );
-    
-  /* Checking rasters projections */
-  
-  TEAGN_TRUE_OR_RETURN( ( input_raster1->params().projection() != 0 ),
-    "Missing input_raster1 projection" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( input_raster1->params().projection()->name() != "NoProjection" ),
-    "Invalid input_raster1 projection" );  
-  TEAGN_TRUE_OR_RETURN( ( input_raster2->params().projection() != 0 ),
-    "Missing input_raster2 projection" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( input_raster2->params().projection()->name() != "NoProjection" ),
-    "Invalid input_raster2 projection" );      
-    
-  return true;
-}
-
-
-bool TePDIGeoMosaic::RunImplementation()
-{
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  params_.GetParameter( "input_raster1", input_raster1 );
-
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  params_.GetParameter( "input_raster2", input_raster2 );
-  
-  std::vector< int > channels1;
-  params_.GetParameter( "channels1", channels1 );
-
-  std::vector< int > channels2;
-  params_.GetParameter( "channels2", channels2 ); 
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params_.GetParameter( "output_raster", output_raster );
-  
-  /* Input rasters swap using pixel resolution as reference */
-  
-  if( params_.CheckParameter< int >( "keep_best_res" ) ) {
-    
-    double raster1_x_res = 0;
-    double raster1_y_res = 0;
-    TePDIUtils::getGeodeticPixelRes( input_raster1->params(), 
-      raster1_x_res, raster1_y_res );    
-      
-    double raster2_x_res = 0;
-    double raster2_y_res = 0;
-    TePDIUtils::getGeodeticPixelRes( input_raster2->params(), 
-      raster2_x_res, raster2_y_res );      
-    
-    if( ( ( raster2_x_res <= raster1_x_res ) &&
-        ( raster2_y_res < raster1_y_res ) ) ||
-      ( ( raster2_x_res < raster1_x_res ) &&
-        ( raster2_y_res <= raster1_y_res ) ) ) 
-    {
-    
-      TePDITypes::TePDIRasterPtrType temp_raster_ptr = input_raster1;
-      input_raster1 = input_raster2;
-      input_raster2 = temp_raster_ptr;
-    }
-  }
-  
-  /* Dumyy value definition */
- 
-  const bool output_raster_uses_dummy = output_raster->params().useDummy_;
-  double output_raster_dummy = 0;
-  if( output_raster_uses_dummy ) {
-    output_raster_dummy = output_raster->params().dummy_[ 0 ];
-  }
-  
-  bool user_required_dummy = false;
-  double user_dummy = 0;
-  if( params_.CheckParameter< double >( "dummy_value" ) ) {
-    
-    params_.GetParameter( "dummy_value", user_dummy );
-    user_required_dummy = true;
-  }
-  
-  bool must_use_dummy = false;
-  double output_dummy_value = 0;
-  if( user_required_dummy ) {
-    must_use_dummy = true;
-    output_dummy_value = user_dummy;
-  } else if( output_raster_uses_dummy ) {
-    must_use_dummy = true;
-    output_dummy_value = output_raster_dummy;
-  }
-  
-  /* Bringing input_raster2 to the same projection and resolution,
-     if needed */
-     
-  TePolygon input_raster2_pol_proj1;
-  
-  if( ( input_raster1->params().projection()->name() != 
-        input_raster2->params().projection()->name() ) ||
-      ( input_raster1->params().resx_ != 
-        input_raster2->params().resx_ ) ||        
-      ( input_raster1->params().resy_ != 
-        input_raster2->params().resy_ ) ) {
-        
-    /* input_raster2 reprojection */
-        
-    TePDITypes::TePDIRasterPtrType new_input_raster2;
-    TeRasterParams new_input_raster2_params = input_raster2->params();
-    new_input_raster2_params.setNLinesNColumns( 10, 10 );
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( new_input_raster2, 
-      new_input_raster2_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
-      "Unable to allocate new_input_raster2" );
-      
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::reprojectRaster( input_raster2,
-      *( input_raster1->projection() ), input_raster1->params().resx_,
-      input_raster1->params().resy_, new_input_raster2 ),
-      "Raster reprojection error" );
-    
-    /* updating input_raster2_pol_proj1 */
-
-    TePolygon input_raster2_pol_proj2;
-    
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::buildDetailedBBox( input_raster2,
-      input_raster2_pol_proj2 ), 
-      "Unable to build raster2 detailed bounding box" );
-    
-    TeVectorRemap( input_raster2_pol_proj2, input_raster2->projection(),
-      input_raster2_pol_proj1, input_raster1->projection() );         
-      
-    /* swapping raster */
-      
-    input_raster2 = new_input_raster2;
-  } else {
-    TeBox input_raster2_box_proj2 = input_raster2->params().boundingBox();
-    input_raster2_pol_proj1 = polygonFromBox( input_raster2_box_proj2 );
-  }
-  
-  /* Finding the offset between the two boxes */
-  
-  double raster2_pol_offset_x = 0;
-  double raster2_pol_offset_y = 0;
-  {
-    TeBox pol1_box_indexed;
-    TeBox input_raster_box = input_raster1->params().box();
-    TePDIUtils::MapCoords2RasterIndexes( 
-      input_raster_box, input_raster1, pol1_box_indexed );
-          
-    double p1_min_x = MIN( pol1_box_indexed.x1(),
-      pol1_box_indexed.x2() );
-    double p1_min_y = MIN( pol1_box_indexed.y1(),
-      pol1_box_indexed.y2() );      
-      
-    TeBox pol2_box_indexed;
-    TePDIUtils::MapCoords2RasterIndexes( input_raster2_pol_proj1.box(),
-      input_raster1, pol2_box_indexed );
-          
-    double p2_min_x = MIN( pol2_box_indexed.x1(),
-      pol2_box_indexed.x2() );
-    double p2_min_y = MIN( pol2_box_indexed.y1(),
-      pol2_box_indexed.y2() );       
-
-    raster2_pol_offset_x = p2_min_x - p1_min_x;
-    raster2_pol_offset_y = p2_min_y - p1_min_y;
-  }
-    
-  /* Creating blending parameters */
-    
-  TePDIParameters blend_params = params_;
-  blend_params.SetParameter( "input_raster1", input_raster1 );
-  blend_params.SetParameter( "input_raster2", input_raster2 );
-  
-  TeBox input_raster_box = input_raster1->params().boundingBox();
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr( new TePolygon );
-  *raster1_pol_ptr = polygonFromBox( input_raster_box );
-  blend_params.SetParameter( "raster1_pol_ptr",  raster1_pol_ptr );
-    
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr( 
-    &input_raster2_pol_proj1, true );
-  blend_params.SetParameter( "raster2_pol_ptr", raster2_pol_ptr );
-  
-  blend_params.SetParameter( "raster2_pol_offset_x", raster2_pol_offset_x );
-  blend_params.SetParameter( "raster2_pol_offset_y", raster2_pol_offset_y );
-  
-  TePDIBlending blend_instance;
-  TEAGN_TRUE_OR_RETURN( blend_instance.Reset( blend_params ), 
-    "Blending instance reset error" );
-  
-  return blend_instance.Apply();
-}
-
+#include "TePDIGeoMosaic.hpp"
+
+#include "TePDIBlender.hpp"
+#include "TePDIUtils.hpp"
+#include "TePDIPIManager.hpp"
+
+#include <TeOverlay.h>
+#include <TeVectorRemap.h>
+#include <TeGeometryAlgorithms.h>
+#include <TeGeometricTransformation.h>
+#include <TeAgnostic.h>
+
+
+TePDIGeoMosaic::TePDIGeoMosaic()
+{
+}
+
+
+TePDIGeoMosaic::~TePDIGeoMosaic()
+{
+}
+
+
+void TePDIGeoMosaic::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDIGeoMosaic::CheckParameters( const TePDIParameters& parameters ) const
+{
+  /* Checking input_raster1 */
+  
+  TePDITypes::TePDIRasterPtrType input_raster1;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster1", 
+    input_raster1 ),
+    "Missing parameter: input_raster1" );
+  TEAGN_TRUE_OR_RETURN( input_raster1.isActive(),
+    "Invalid parameter: input_raster1 inactive" );
+  TEAGN_TRUE_OR_RETURN( input_raster1->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: input_raster1 not ready" );    
+    
+  /* Checking input_raster2 */
+  
+  TePDITypes::TePDIRasterPtrType input_raster2;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster2", 
+    input_raster2 ),
+    "Missing parameter: input_raster2" );
+  TEAGN_TRUE_OR_RETURN( input_raster2.isActive(),
+    "Invalid parameter: input_raster2 inactive" );
+  TEAGN_TRUE_OR_RETURN( input_raster2->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: input_raster2 not ready" );    
+    
+  /* channels1 parameter checking */
+
+  std::vector< unsigned int > channels1;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "channels1", channels1 ), 
+    "Missing parameter: channels1" );
+  for( unsigned int channels1_index = 0 ; 
+    channels1_index < channels1.size() ; 
+    ++channels1_index ) {
+    
+    TEAGN_TRUE_OR_RETURN( ( (int)channels1[ channels1_index ] < 
+      input_raster1->nBands() ),
+      "Invalid parameter: channels1" );
+  }
+  
+  /* channels2 parameter checking */
+
+  std::vector< unsigned int > channels2;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "channels2", channels2 ), 
+    "Missing parameter: channels2" );
+  TEAGN_TRUE_OR_RETURN( ( channels2.size() == channels1.size() ),
+    "Size mismatch between channels1 and channels2" );
+  for( unsigned int channels2_index = 0 ; 
+    channels2_index < channels2.size() ; 
+    ++channels2_index ) {
+    
+    TEAGN_TRUE_OR_RETURN( ( (int)channels2[ channels2_index ] < 
+      input_raster2->nBands() ),
+      "Invalid parameter: channels2" );
+  }     
+    
+  /* Checking output_raster */
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
+    output_raster ),
+    "Missing parameter: output_raster" );
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
+    "Invalid parameter: output_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );
+    
+  /* Checking rasters projections */
+  
+  TEAGN_TRUE_OR_RETURN( ( input_raster1->params().projection() != 0 ),
+    "Missing input_raster1 projection" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( input_raster1->params().projection()->name() != "NoProjection" ),
+    "Invalid input_raster1 projection" );  
+  TEAGN_TRUE_OR_RETURN( ( input_raster2->params().projection() != 0 ),
+    "Missing input_raster2 projection" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( input_raster2->params().projection()->name() != "NoProjection" ),
+    "Invalid input_raster2 projection" );      
+    
+  return true;
+}
+
+
+bool TePDIGeoMosaic::RunImplementation()
+{
+  TePDITypes::TePDIRasterPtrType input_raster1;
+  params_.GetParameter( "input_raster1", input_raster1 );
+
+  TePDITypes::TePDIRasterPtrType input_raster2;
+  params_.GetParameter( "input_raster2", input_raster2 );
+  
+  std::vector< unsigned int > channels1;
+  params_.GetParameter( "channels1", channels1 );
+
+  std::vector< unsigned int > channels2;
+  params_.GetParameter( "channels2", channels2 ); 
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter( "output_raster", output_raster );
+  
+  TePDIBlender::BlendMethod blend_method = TePDIBlender::NoBlendMethod;
+  if( params_.CheckParameter< TePDIBlender::BlendMethod >(
+    "blend_method" ) )
+  {
+    params_.GetParameter( "blend_method", blend_method );
+  }  
+  
+  TePDIInterpolator::InterpMethod interp_method = TePDIInterpolator::NNMethod;
+  if( params_.CheckParameter< TePDIInterpolator::InterpMethod >(
+    "interp_method" ) )
+  {
+    params_.GetParameter( "interp_method", interp_method );
+  }
+  
+  bool auto_equalize = false;
+  if( params_.CheckParameter< int >( "auto_equalize" ) )
+  {
+    auto_equalize = true;
+  }
+  
+  TePolygon raster1_pol;
+  if( params_.CheckParameter< TePolygon >( "raster1_pol" ) )
+  {
+    params_.GetParameter( "raster1_pol", raster1_pol );
+  }  
+  
+  TePolygon raster2_pol;
+  if( params_.CheckParameter< TePolygon >( "raster2_pol" ) )
+  {
+    params_.GetParameter( "raster2_pol", raster2_pol );
+  }  
+  
+  /* Input rasters swap using pixel resolution as reference 
+    Input raster 1 will always have the better resolution
+  */
+  
+  {
+    // Fiding the raster 2 bounding box ( raster 1 proj )
+    
+    TeBox r2BBoxR1Ref = input_raster2->params().boundingBox();
+    TePolygon r2PolR2Ref = polygonFromBox( r2BBoxR1Ref );
+    
+    TePolygon r2PolR1Ref;  
+    TeVectorRemap( r2PolR2Ref, input_raster2->params().projection(),
+      r2PolR1Ref, input_raster1->params().projection() ); 
+      
+    // finding the rasters resolutions
+    // raster 1 projected reference
+          
+    double raster1_x_res = input_raster1->params().resx_;
+    double raster1_y_res = input_raster1->params().resy_;
+      
+    double raster2_x_res = r2PolR1Ref.box().width() / 
+      ((double)input_raster2->params().ncols_);
+    double raster2_y_res = r2PolR1Ref.box().height() / 
+      ((double)input_raster2->params().nlines_);
+    
+    if( ( ( raster2_x_res <= raster1_x_res ) &&
+        ( raster2_y_res < raster1_y_res ) ) ||
+      ( ( raster2_x_res < raster1_x_res ) &&
+        ( raster2_y_res <= raster1_y_res ) ) ) 
+    {
+      // swapping rasters pointers 
+    
+      TePDITypes::TePDIRasterPtrType temp_raster_ptr = input_raster1;
+      input_raster1 = input_raster2;
+      input_raster2 = temp_raster_ptr;
+      
+      // swapping rasters bands vectors
+      
+      std::vector< unsigned int > auxVec = channels1;
+      channels1 = channels2;
+      channels2 = auxVec;
+      
+      // swapping rasters polygons
+      
+      TePolygon auxPol = raster1_pol;
+      raster1_pol = raster2_pol;
+      raster2_pol = auxPol;
+    }
+  }  
+  
+  /* Bringing input_raster2 to the same projection and resolution */
+  
+  if( ( ! ( ( *input_raster1->params().projection() ) == 
+      ( *input_raster2->params().projection() ) ) ) )
+  {
+    // reprojecting the raster 2 polygon 
+    
+    TePolygon reprojR2Pol;  
+    
+    TeVectorRemap( raster2_pol, input_raster2->params().projection(),
+      reprojR2Pol, input_raster1->projection() );
+      
+    raster2_pol = reprojR2Pol;
+  
+    /* input_raster2 reprojection */
+        
+    TePDITypes::TePDIRasterPtrType new_input_raster2;
+    TeRasterParams new_input_raster2_params = input_raster2->params();
+    new_input_raster2_params.setNLinesNColumns( 1, 1 );
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( 
+      new_input_raster2_params, new_input_raster2 ), 
+      "Unable to allocate new_input_raster2" );
+      
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::reprojectRaster( *input_raster2,
+      *( input_raster1->projection() ), 
+      (unsigned int)input_raster2->params().nlines_,
+      (unsigned int)input_raster2->params().ncols_, 
+      progress_enabled_,
+      *new_input_raster2 ),
+      "Raster reprojection error" );
+      
+    input_raster2 = new_input_raster2;
+  } 
+  
+  /* Dumyy value definition */
+ 
+  double dummy_value = 0;
+  if( params_.CheckParameter< double >( "dummy_value" ) ) 
+  {
+    params_.GetParameter( "dummy_value", dummy_value );
+  }
+  else if( output_raster->params().useDummy_ )
+  {
+    dummy_value = output_raster->params().dummy_[ 0 ];
+  }
+  else if( input_raster1->params().useDummy_ )
+  {
+    dummy_value = input_raster1->params().dummy_[ 0 ];
+  }  
+  else if( input_raster2->params().useDummy_ )
+  {
+    dummy_value = input_raster2->params().dummy_[ 0 ];
+  }    
+  
+  // Calc auto equalizing parameters
+  
+  std::vector< double > pixelOffsets1;
+  std::vector< double > pixelScales1;
+  std::vector< double > pixelOffsets2;
+  std::vector< double > pixelScales2;
+  
+  if( auto_equalize )
+  {
+    TePolygon r1AreaPol;
+    if( raster1_pol.size() )
+    {
+      r1AreaPol = raster1_pol;
+    }
+    else
+    {
+      TeBox r1BBox = input_raster1->params().boundingBox();
+      
+      r1AreaPol = polygonFromBox( r1BBox );
+    }
+    
+    TePolygon r2AreaPol;
+    if( raster2_pol.size() )
+    {
+      r2AreaPol = raster2_pol;
+    }
+    else
+    {
+      TeBox r2BBox = input_raster2->params().boundingBox();
+      
+      r2AreaPol = polygonFromBox( r2BBox );
+    }    
+  
+    TEAGN_TRUE_OR_RETURN( calcEqParams( input_raster1, channels1, r1AreaPol,
+      input_raster2, channels2, r2AreaPol, dummy_value, pixelOffsets1,
+      pixelScales1, pixelOffsets2, pixelScales2 ), 
+      "Error calculating equalization parameters" );
+  }
+  else
+  {
+    for( unsigned int idx = 0 ; idx < channels1.size() ; ++idx )
+    {
+      pixelOffsets1.push_back( 0 );
+      pixelScales1.push_back( 1 );
+      pixelOffsets2.push_back( 0 );
+      pixelScales2.push_back( 1 );      
+    }
+  }
+  
+  // Initiating blender
+  
+  TePDIBlender blender;
+  
+  {
+    // Creating the indexed polygons of each raster
+    
+    TePolygon r1IdxPolR1Ref;
+    TePDIUtils::MapCoords2RasterIndexes( raster1_pol, input_raster1,
+      r1IdxPolR1Ref );    
+      
+    TePolygon r2IdxPolR2Ref;
+    TePDIUtils::MapCoords2RasterIndexes( raster2_pol, input_raster2,
+      r2IdxPolR2Ref );          
+  
+    // Creating the transformation parameters
+    
+    TeCoord2D r1ULI( 0, 0 );
+    TeCoord2D r1ULP = input_raster1->params().index2Coord( r1ULI );
+    TeCoord2D r1ULIOverR2I = input_raster2->params().coord2Index( r1ULP );
+    
+    TeCoord2D r1LLI( 0, ( (double)input_raster1->params().nlines_ ) - 1.0 );
+    TeCoord2D r1LLP = input_raster1->params().index2Coord( r1LLI );
+    TeCoord2D r1LLIOverR2I = input_raster2->params().coord2Index( r1LLP );    
+    
+    TeCoord2D r1URI( ( (double)input_raster1->params().ncols_ ) - 1.0, 0 );
+    TeCoord2D r1URP = input_raster1->params().index2Coord( r1URI );
+    TeCoord2D r1URIOverR2I = input_raster2->params().coord2Index( r1URP );      
+    
+    TeGTParams transParams;
+    transParams.transformation_name_ = "affine";
+    transParams.out_rem_strat_ = TeGTParams::NoOutRemotion;
+    transParams.tiepoints_.push_back( TeCoordPair( r1ULI, r1ULIOverR2I ) );
+    transParams.tiepoints_.push_back( TeCoordPair( r1LLI, r1LLIOverR2I ) );
+    transParams.tiepoints_.push_back( TeCoordPair( r1URI, r1URIOverR2I ) );
+/*    
+    TEAGN_TRUE_OR_RETURN( transParams.direct_parameters_.Init( 3, 3, 0.0 ),
+      "Matrix init error" );
+    TEAGN_TRUE_OR_RETURN( transParams.inverse_parameters_.Init( 3, 3, 0.0 ),
+      "Matrix init error" );    
+    transParams.direct_parameters_( 0, 0 ) = 1.0;
+    transParams.direct_parameters_( 0, 2 ) = r1ULIOverR2I.x();
+    transParams.direct_parameters_( 1, 1 ) = 1.0;
+    transParams.direct_parameters_( 1, 2 ) = r1ULIOverR2I.y();
+    transParams.inverse_parameters_( 0, 0 ) = 1.0;
+    transParams.inverse_parameters_( 0, 2 ) = -r1ULIOverR2I.x();
+    transParams.inverse_parameters_( 1, 1 ) = 1.0;
+    transParams.inverse_parameters_( 1, 2 ) = -r1ULIOverR2I.y();    
+*/    
+    // Initiating blender
+    
+    TEAGN_TRUE_OR_RETURN( blender.init( input_raster1, channels1,
+      input_raster2, channels2, blend_method,
+      interp_method, transParams, dummy_value, pixelOffsets1, pixelScales1, 
+      pixelOffsets2, pixelScales2, r1IdxPolR1Ref, r2IdxPolR2Ref ),
+      "Blender initiation error" );
+  }
+    
+  // Updating output image geometry
+  
+  TeRasterParams outputRasterParams = output_raster->params();
+  
+  outputRasterParams.nBands( channels1.size() );
+  
+  TeBox outputRasterBoundingBox = input_raster1->params().boundingBox();
+  updateBox( outputRasterBoundingBox, input_raster2->params().boundingBox() );
+  
+  outputRasterParams.boundingBoxResolution( outputRasterBoundingBox.x1(),
+    outputRasterBoundingBox.y1(), outputRasterBoundingBox.x2(),
+    outputRasterBoundingBox.y2(), input_raster1->params().resx_,
+    input_raster1->params().resy_ );
+    
+  outputRasterParams.projection( input_raster1->projection() );
+    
+  outputRasterParams.setDummy( dummy_value, -1 );
+  
+  TePDITypes::TePDIRasterVectorType rastersVec;
+  rastersVec.push_back( input_raster1 );
+  rastersVec.push_back( input_raster2 );
+  outputRasterParams.setDataType( TePDIUtils::chooseBestPixelType(
+    rastersVec ), -1 );
+  
+  TEAGN_TRUE_OR_RETURN( output_raster->init( outputRasterParams ), 
+    "Output raster init error" );    
+  
+  // Generate output raster blended values
+  
+  const unsigned int outNLines = (unsigned int)output_raster->params().nlines_;
+  const unsigned int outNCols = (unsigned int)output_raster->params().ncols_;
+  const unsigned int outNBands = (unsigned int)output_raster->params().nBands();
+  double value = 0;
+  unsigned int band = 0;
+  unsigned int line = 0;
+  unsigned int col = 0;
+  TeRaster& outRasterRef = *output_raster;
+  const double colOff = ( outRasterRef.params().boundingBox().x1() -
+    input_raster1->params().boundingBox().x1() ) /
+    outRasterRef.params().resx_;
+  const double lineOff = -1.0 * ( outRasterRef.params().boundingBox().y2() -
+    input_raster1->params().boundingBox().y2() ) /
+    outRasterRef.params().resy_;    
+  double outMax = 0;
+  double outMin = 0;    
+  
+  TePDIPIManager progress( "Rendering mosaic", outNBands * outNLines,
+    progress_enabled_ );
+  
+  for( band = 0 ; band < outNBands ; ++band )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds( output_raster,
+      band, outMin, outMax ), "Internal error" );
+        
+    for( line = 0 ; line < outNLines ; ++line )  
+    {
+      for( col = 0 ; col < outNCols ; ++col )
+      {
+        blender.blend( ((double)line) + lineOff, ((double)col) + colOff, band, 
+          value );
+          
+        value = MIN( value, outMax );
+        value = MAX( value, outMin );          
+        
+        TEAGN_TRUE_OR_RETURN( outRasterRef.setElement( col, line, value, 
+          band ), "Error writing value to output raster" );
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+    }
+  }
+  
+  return true;
+}
+
+bool TePDIGeoMosaic::calcEqParams( 
+  const TePDITypes::TePDIRasterPtrType& raster1, 
+  const std::vector< unsigned int >& channels1,
+  TePolygon& r1Pol,
+  const TePDITypes::TePDIRasterPtrType& raster2,
+  const std::vector< unsigned int >& channels2,
+  TePolygon& r2Pol,
+  const double& dummyValue,
+  std::vector< double >& pixelOffsets1, 
+  std::vector< double >& pixelScales1,
+  std::vector< double >& pixelOffsets2, 
+  std::vector< double >& pixelScales2 ) const
+{
+  TEAGN_DEBUG_CONDITION( raster1.isActive(), "Invalid pointer" );
+  TEAGN_DEBUG_CONDITION( channels1.size(), "Invalid vector" );
+  TEAGN_DEBUG_CONDITION( r1Pol.size(), "Invalid r1Pol" );
+  TEAGN_DEBUG_CONDITION( raster2.isActive(), "Invalid pointer" );
+  TEAGN_DEBUG_CONDITION( channels2.size(), "Invalid vector" );
+  TEAGN_DEBUG_CONDITION( r2Pol.size(), "Invalid r2Pol" );
+  TEAGN_DEBUG_CONDITION( channels1.size() == channels2.size(), 
+    "Vectors size mismatch" );
+    
+  pixelOffsets1.clear();
+  pixelScales1.clear();       
+  pixelOffsets2.clear();
+  pixelScales2.clear();    
+    
+  TePolygonSet r1Ps;
+  r1Ps.add( r1Pol );
+  
+  TePolygonSet r2Ps;
+  r2Ps.add( r2Pol );  
+  
+  TePolygonSet interPs;
+  
+  if( TeOVERLAY::TeIntersection( r1Ps, r2Ps, interPs ) && 
+    ( interPs.size() > 0 ) )
+  {
+    // calculating statistic attributes
+    
+    std::vector< double > r1Means;
+    std::vector< double > r1Variances;
+    TEAGN_TRUE_OR_RETURN( calcStats( raster1, channels1, interPs,
+      dummyValue, r1Means, r1Variances ), "Error calculating statistics" );
+  
+    std::vector< double > r2Means;
+    std::vector< double > r2Variances;
+    TEAGN_TRUE_OR_RETURN( calcStats( raster2, channels2, interPs,
+      dummyValue, r2Means, r2Variances ), "Error calculating statistics" );
+      
+    // generating output values
+    
+    for( unsigned int idx = 0 ; idx < r1Means.size() ; ++idx )
+    {
+      if( r1Variances[ idx ] > r2Variances[ idx ] )
+      {
+        pixelOffsets1.push_back( 0 );
+        pixelScales1.push_back( 1 );         
+        pixelScales2.push_back( sqrt( r1Variances[ idx ] / r2Variances[ idx ] ) );
+        pixelOffsets2.push_back( r1Means[ idx ] - ( pixelScales2[ idx ] * 
+          r2Means[ idx ] ) );      
+      }
+      else
+      {
+        pixelOffsets2.push_back( 0 );
+        pixelScales2.push_back( 1 );         
+        pixelScales1.push_back( sqrt( r2Variances[ idx ] / r1Variances[ idx ] ) );
+        pixelOffsets1.push_back( r2Means[ idx ] - ( pixelScales1[ idx ] * 
+          r1Means[ idx ] ) ); 
+      }
+    }
+  }
+  else
+  {
+    for( unsigned int idx = 0 ; idx < channels2.size() ; ++idx )
+    {
+      pixelOffsets1.push_back( 0 );
+      pixelScales1.push_back( 1 );     
+      pixelOffsets2.push_back( 0 );
+      pixelScales2.push_back( 1 );      
+    }  
+  }
+  
+  return true;
+}
+
+bool TePDIGeoMosaic::calcStats( const TePDITypes::TePDIRasterPtrType& raster,
+  const std::vector< unsigned int >& channels,
+  TePolygonSet& polSet,
+  const double& dummyValue,
+  std::vector< double >& means,
+  std::vector< double >& variances ) const
+{
+  TEAGN_DEBUG_CONDITION( raster.isActive(), "Invalid pointer" );
+  TEAGN_DEBUG_CONDITION( channels.size(), "Invalid vector" );
+  TEAGN_DEBUG_CONDITION( polSet.size() == 1, "Invalid PS" );
+  TEAGN_DEBUG_CONDITION( polSet[ 0 ].size() > 0, "Invalid PS" );
+    
+  means.clear();
+  variances.clear();
+  
+  // Creating the statistic algorithm parameters
+  
+  TePDITypes::TePDIPolygonSetPtrType polsetptr( &polSet, true );
+  
+  for( unsigned int cIdx = 0 ; cIdx < channels.size() ; ++cIdx )
+  {
+    TePDIHistogram histo;
+    histo.ToggleProgressInt( progress_enabled_ );
+    TEAGN_TRUE_OR_RETURN( histo.reset( raster, channels[ cIdx ], 0,
+      TeBoxPixelIn, polsetptr ),
+      "Histogram reset error" );
+      
+    TePDIHistogram::const_iterator it = histo.begin();
+    const TePDIHistogram::const_iterator itEnd = histo.end();
+    
+    double pixelsNumber = 0;
+    double sum = 0;
+    
+    while( it != itEnd )
+    {
+      if( it->first != dummyValue )
+      {
+        sum += ( it->first * ((double)it->second) );
+        pixelsNumber += it->second;
+      }
+      
+      ++it;
+    }
+    
+    double mean = sum / pixelsNumber;      
+    
+    it = histo.begin();
+    
+    double variance = 0;
+      
+    while( it != itEnd )
+    {
+      if( it->first != dummyValue )
+      {
+        variance += ( ( (double)it->second ) / pixelsNumber ) *
+          ( it->first - mean ) * ( it->first - mean );
+      }
+      
+      ++it;
+    }      
+  
+    means.push_back( mean );
+    variances.push_back( variance );
+  }
+
+  return true;
+}
+
+
diff --git a/src/terralib/image_processing/TePDIGeoMosaic.hpp b/src/terralib/image_processing/TePDIGeoMosaic.hpp
old mode 100755
new mode 100644
index 23b85be..95db571
--- a/src/terralib/image_processing/TePDIGeoMosaic.hpp
+++ b/src/terralib/image_processing/TePDIGeoMosaic.hpp
@@ -1,110 +1,142 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIGEOMOSAIC_HPP
-  #define TEPDIGEOMOSAIC_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for Geographic Mosaic ( geo-referenced rasters )
-   * strategy.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIMosaicGroup
-   *
-   * @note The required parameters are:
-   * @param blending_type ( std::string ) - Blending type.
-   * type ( see TePDIBlendStratFactory documentation for avaliable
-   * blending strategies ).   
-   * @param input_raster1 ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Input raster 1.
-   * @param input_raster2 ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Input raster 2.
-   * @param channels1 ( std::vector< int > ) - The channels to process from 
-   * input_raster1.
-   * @param channels2 ( std::vector< int > ) - The channels to process from 
-   * input_raster2. 
-   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
-   *
-   * @note The optional parameters are:
-   *
-   * @param dummy_value (double) - A dummy pixel value for use 
-   * in pixels where no data is available.     
-   * @param keep_best_res (int) - If present (any value) the best
-   * resolution raster will be used as reference.
-   * @param auto_equalize ( int ) - If present ( any value ), input_raster2
-   * auto-equalizing will be made ( using overlap area reference ).   
-   *
-   * @note The output_raster parameters will take the choosed reference
-   * raster parameters.
-   */
-  class PDI_DLL TePDIGeoMosaic : public TePDIAlgorithm {
-    public :
-      
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIGeoMosaic();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIGeoMosaic();
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of 
-       * each PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;      
-
-    protected :
-    
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );    
-     
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();      
-  };
-  
-/** @example TePDIMosaic_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIGEOMOSAIC_HPP
+  #define TEPDIGEOMOSAIC_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  
+  #include "TePDIHistogram.hpp"
+
+  /**
+   * @class TePDIGeoMosaic 
+   * @brief Mosaic of two geo-referenced rasters.
+   * strategy.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIMosaicGroup
+   *
+   * @note The required parameters are:
+   * @param input_raster1 ( TePDITypes::TePDIRasterPtrType ) - 
+   *  Input raster 1.
+   * @param input_raster2 ( TePDITypes::TePDIRasterPtrType ) - 
+   *  Input raster 2.
+   * @param channels1 ( std::vector< unsigned int > ) - The channels to process from 
+   * input_raster1.
+   * @param channels2 ( std::vector< unsigned int > ) - The channels to process from 
+   * input_raster2. 
+   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
+   *
+   * @note The optional parameters are:
+   * @param blend_method ( TePDIBlender::BlendMethod ) - Blending method
+   * (default: TePDIBlender::NoBlendMethod).   
+   * @param interp_method ( TePDIInterpolator::InterpMethod ) - Interpolation
+   * method (default TePDIInterpolator::NNMethod) .
+   * @param dummy_value (double) - A dummy pixel value for use 
+   * in pixels where no data is available.     
+   * @param auto_equalize ( int ) - If present ( any value )
+   * auto-equalizing will be made ( using overlap area reference ).
+   * @param raster1_pol (TePolygon) - A polygon (raster 1 projected coords)
+   * delimiting the raster region with valid data (if no polygon
+   * is given the entire raster will be considered).
+   * @param raster2_pol (TePolygon) - A polygon (raster 2 projected coords)
+   * delimiting the raster region with valid data (if no polygon
+   * is given the entire raster will be considered).     
+   *
+   * @note If the projections are different input_raster2 will be reprojected.
+   * @note The reference raster will be that one with better resolution.
+   * @note The output_raster parameters will take the choosed reference
+   * raster parameters.   
+   * @note The output raster data type will be automatically to fit the
+   * range of both input rasters.
+   * @example TePDIMosaic_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIGeoMosaic : public TePDIAlgorithm {
+    public :
+      
+
+      TePDIGeoMosaic();
+
+      ~TePDIGeoMosaic();
+      
+      //overloaded
+      bool CheckParameters( const TePDIParameters& parameters ) const;      
+
+    protected :
+    
+      //overloaded
+      void ResetState( const TePDIParameters& params );    
+     
+      //overloaded
+      bool RunImplementation();    
+        
+    /**
+     * @brief Calc equalization parameters.
+     * @param raster1 Raster 1 pointer.
+     * @param channels1 Raster 1 channels.
+     * @param r1Pol A polygon (raster 1 projected coords) delimiting
+     * the area over raster 1 to be considered.
+     * @param raster2 Raster 2 pointer.
+     * @param channels2 Raster 2 channels.
+     * @param r2Pol A polygon (raster 1 projected coords) delimiting
+     * the area over raster 1 to be considered.
+     * @param dummyValue Dummy value.
+     * @param pixelOffsets1 The generated offsets values for raster 1.
+     * @param pixelScales1 The generated scales values for raster 1.
+     * @param pixelOffsets2 The generated offsets values for raster 2.
+     * @param pixelScales2 The generated scales values for raster 2.
+     * @return true if OK, false on errors.
+     * @note Both rasters must have the same projection.
+     */        
+      bool calcEqParams( const TePDITypes::TePDIRasterPtrType& raster1, 
+        const std::vector< unsigned int >& channels1,
+        TePolygon& r1Pol,
+        const TePDITypes::TePDIRasterPtrType& raster2,
+        const std::vector< unsigned int >& channels2,
+        TePolygon& r2Pol,
+        const double& dummyValue,
+        std::vector< double >& pixelOffsets1, 
+        std::vector< double >& pixelScales1,
+        std::vector< double >& pixelOffsets2, 
+        std::vector< double >& pixelScales2 ) const;
+        
+    /**
+     * @brief Calc mean and variances for each raster channel.
+     * @param raster Raster pointer.
+     * @param channels Raster channels.
+     * @param polSet The restriction polygon set over input raster.
+     * @param dummyValue Dummy value.
+     * @param means The generated mean values.
+     * @param means The generated variance values.
+     * @return true if OK, false on errors.
+     * @note Both rasters must have the same projection.
+     */           
+      bool calcStats( const TePDITypes::TePDIRasterPtrType& raster,
+        const std::vector< unsigned int >& channels,
+        TePolygonSet& polSet,
+        const double& dummyValue,
+        std::vector< double >& means,
+        std::vector< double >& variances ) const;
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDIGeoMosaicFactory.cpp b/src/terralib/image_processing/TePDIGeoMosaicFactory.cpp
deleted file mode 100644
index 1181bbe..0000000
--- a/src/terralib/image_processing/TePDIGeoMosaicFactory.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
- 
-#include "TePDIGeoMosaicFactory.hpp"
-#include "TePDIGeoMosaic.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIGeoMosaicFactory::TePDIGeoMosaicFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIGeoMosaic" ) )
-{
-}
-
-
-TePDIGeoMosaicFactory::~TePDIGeoMosaicFactory()
-{
-}
-
-
-TePDIAlgorithm* TePDIGeoMosaicFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIGeoMosaic();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
diff --git a/src/terralib/image_processing/TePDIGeoMosaicFactory.hpp b/src/terralib/image_processing/TePDIGeoMosaicFactory.hpp
deleted file mode 100644
index ef9648f..0000000
--- a/src/terralib/image_processing/TePDIGeoMosaicFactory.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIGEOMOSAICFACTORY_HPP
-  #define TEPDIGEOMOSAICFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for image geographic mosaic algorithms factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIGeoMosaicFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIGeoMosaicFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIGeoMosaicFactory();
-      
-    protected :  
-      
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIGeoMosaicFactory TePDIGeoMosaicFactory_instance;
-  };  
-  
-#endif
diff --git a/src/terralib/image_processing/TePDIHaralick.cpp b/src/terralib/image_processing/TePDIHaralick.cpp
old mode 100755
new mode 100644
index 9874135..1c6d0d0
--- a/src/terralib/image_processing/TePDIHaralick.cpp
+++ b/src/terralib/image_processing/TePDIHaralick.cpp
@@ -1,605 +1,577 @@
-#include "TePDIHaralick.hpp"
-
-#include <TeGeometryAlgorithms.h>
-#include <TeCoord2D.h>
-#include <TeAgnostic.h>
-
-#include <math.h>
-
-#define INSERT_CONCURRENCE( concpixel_line, concpixel_col ) \
-  { \
-    if( input_raster_->getElement( concpixel_col, concpixel_line, \
-      auxkey.second, band ) ) \
-    { \
-      auxkey.first = itp.operator*(band); \
-      ++( mat[ auxkey ] ); \
-      \
-      inverseAuxKey.first = auxkey.second; \
-      inverseAuxKey.second = auxkey.first; \
-      ++( mat[ inverseAuxKey ] ); \
-    } \
-  };
-  
-  
-TePDIHaralick::COMatrixCacheNodeT::COMatrixCacheNodeT()
-{
-};
-
-TePDIHaralick::COMatrixCacheNodeT::~COMatrixCacheNodeT()
-{
-};
-
-TePDIHaralick::TePDIHaralick( int dirmask )
-{
-  polygonset_.reset( new TePolygonSet );
-  dirmask_ = dirmask;
-}
-
-
-TePDIHaralick::~TePDIHaralick()
-{
-  clear();
-}
-
-
-void TePDIHaralick::ResetState( const TePDIParameters& params )
-{
-  clear();
-  
-  TEAGN_TRUE_OR_THROW( params.GetParameter( "input_raster", input_raster_ ),
-    "Missing parameter input_raster" )
-  TEAGN_TRUE_OR_THROW( params.GetParameter( "polygonset", polygonset_ ),
-    "Missing parameter polygonset" )
-}
-
-
-bool TePDIHaralick::RunImplementation()
-{
-  TEAGN_LOG_AND_THROW( "This function cannot be used for this class" );
-  return false;
-}
-
-
-bool TePDIHaralick::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking input_raster1 */
-  
-  TePDITypes::TePDIRasterPtrType input_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster", 
-    input_raster ),
-    "Missing parameter: input_raster" );
-  TEAGN_TRUE_OR_RETURN( input_raster.isActive(),
-    "Invalid parameter: input_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( input_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: input_raster not ready" );
-  
-  for( int band = 0 ; band < input_raster->params().nBands() ;
-    ++band )
-  {
-    TEAGN_TRUE_OR_RETURN( input_raster->params().dataType_[ band ] !=
-      TeFLOAT, "Invalid raster data type" )
-    TEAGN_TRUE_OR_RETURN( input_raster->params().dataType_[ band ] !=
-      TeDOUBLE, "Invalid raster data type" )
-  }
-
-  /* Checking the restriction polygon set */
-  
-  TePDITypes::TePDIPolygonSetPtrType polygonset;  
-  
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "polygonset", polygonset ),
-    "Missing parameter : polygonset" );
-  
-  TEAGN_TRUE_OR_RETURN( polygonset.isActive(), 
-    "Invalid parameter : polygonset" );
-    
-  TEAGN_TRUE_OR_RETURN( polygonset->size() > 0, 
-    "Invalid parameter : polygonset" );    
-      
-  return true;
-}
-
-
-bool TePDIHaralick::getEntropy( unsigned int band, unsigned int pol_index,
-  double& entropyValue )
-{
-  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
-    "Invalid raster band" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-
-  COMatrixCacheNodeT const* nodePtr = getCOMatrixNodePtr( band, pol_index );
-   
-  if( nodePtr )
-  {
-    entropyValue = 0.0;
-  
-    COMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
-    COMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
-  
-    while ( itFirst != itEnd )
-    {
-      const double& ocurrences = itFirst->second;
-      
-      entropyValue += ( ocurrences * log(ocurrences) );
-      
-      ++itFirst;
-    }
-    
-    entropyValue *= -1.0;
-  
-    return true;
-  }
-  else
-  {
-    return false;
-  }
-}
-
-
-
-bool TePDIHaralick::getEnergy( unsigned int band, unsigned int pol_index,
-  double& energyValue )
-{
-  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
-    "Invalid raster band" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-
-  COMatrixCacheNodeT const* nodePtr = getCOMatrixNodePtr( band, pol_index );
-  
-  if( nodePtr == 0 )
-  {
-    return false;
-  }
-  else
-  {
-    energyValue = 0.0;
-  
-    COMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
-    COMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
-      
-    while ( itFirst != itEnd )
-    {
-      energyValue += ( (itFirst->second) * (itFirst->second) );
-      ++itFirst;
-    }
-    
-    return true;
-  }
-}
-
-
-bool TePDIHaralick::getContrast( unsigned int band, unsigned int pol_index,
-  double& contrastValue )
-{
-  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
-    "Invalid raster band" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-  
-  COMatrixCacheNodeT const* nodePtr = getCOMatrixNodePtr( band, pol_index );
-  
-  if( nodePtr )
-  {
-    contrastValue = 0.0;
-    
-    double dif = 0;
-    
-    COMatrixT::const_iterator itFirst;
-    const COMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
-    double psum = 0;
-    
-    for( double value = nodePtr->matrixMinGray_ ; value <= 
-      nodePtr->matrixMaxGray_ ; ++value )
-    {
-      itFirst = nodePtr->matrix_.begin();
-      psum = 0;
-      
-      while ( itFirst != itEnd )
-      {
-        dif = ((itFirst->first.first) - (itFirst->first.second));
-        
-        if( ABS(dif) == value )
-        {
-          psum += itFirst->second;
-        }
-        
-        ++itFirst;
-      }
-      
-      contrastValue += ( value * value * psum );
-    }
-    
-    return true;
-  }
-  else
-  {
-    return false;
-  }
-}
-
-
-bool TePDIHaralick::getHomogeneity( unsigned int band, unsigned int pol_index,
-  double& homogeneityValue )
-{
-  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
-    "Invalid raster band" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-
-  COMatrixCacheNodeT const* nodePtr = getCOMatrixNodePtr( band, pol_index );
-  
-  if( nodePtr )
-  {
-    homogeneityValue = 0.0;
-    
-    // The dif stores difference i - j.
-    double dif;
-    
-    COMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
-    COMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
-      
-    while ( itFirst != itEnd )
-    {
-      dif = ((itFirst->first.first) - (itFirst->first.second));
-      
-      homogeneityValue += ( (itFirst->second) /
-        ( 1 + ( dif * dif ) ) );
-      
-      ++itFirst;
-    }
-    
-    return true;
-  }
-  else
-  {
-    return false;
-  }
-}
-
-
-bool TePDIHaralick::getQuiSquare( unsigned int band, unsigned int pol_index,
-  double& QuiSquareValue )
-{
-  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
-    "Invalid raster band" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-
-  COMatrixCacheNodeT const* nodePtr = getCOMatrixNodePtr( band, pol_index );
-  
-  if( nodePtr )
-  {
-    QuiSquareValue = 0.0;
-  
-    // total_col stores the sum of the probabilities of column j
-    // total_ln stores the sum of the probabilities of line i
-    double total_col =  0.0, total_ln = 0.0;
-    
-    COMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
-    COMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
-  
-    //iterators and map auxiliaries
-    COMatrixT::const_iterator itAux1 = nodePtr->matrix_.begin();
-        
-    map <double, double> totalLine;
-    map <double, double> totalColumn;
-  
-    while(itAux1 != itEnd)
-    { 
-      if (totalLine.find(itAux1->first.first)== totalLine.end())
-      {
-        totalLine[itAux1->first.first] = itAux1->second;
-      }
-      else
-      {
-        totalLine[itAux1->first.first] += itAux1->second;
-      }
-  
-      if (totalColumn.find(itAux1->first.second) == totalColumn.end())
-      {
-        totalColumn[itAux1->first.second] = itAux1->second;
-      }
-      else
-      {
-        totalColumn[itAux1->first.second] += itAux1->second;
-      }
-  
-      ++itAux1;
-  
-    }
-    
-    while ( itFirst != itEnd )
-    {
-      total_col = (totalColumn.find(itFirst->first.second))->second;
-      total_ln = (totalLine.find(itFirst->first.first))->second;
-  
-      QuiSquareValue += ((pow(itFirst->second,2)))/( total_col * total_ln);
-      ++itFirst;
-    }
-  
-    return true;
-  }
-  else
-  {
-    return false;
-  }
-}
-
-bool TePDIHaralick::getMean( unsigned int band, unsigned int pol_index,
-  double& meanValue )
-{
-  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
-    "Invalid raster band" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-
-  COMatrixCacheNodeT const* nodePtr = getCOMatrixNodePtr( band, pol_index );
-  
-  if( nodePtr )
-  {
-    if( nodePtr->matrix_.size() )
-    {
-      double nn = nodePtr->matrixMaxGray_ - nodePtr->matrixMinGray_ + 1.0;
-      nn *= nn;
-          
-      COMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
-      COMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
-      
-      meanValue = 0;
-        
-      while ( itFirst != itEnd )
-      {
-        meanValue += itFirst->second;
-        ++itFirst;
-      }
-      
-      meanValue /= nn;
-      
-      return true;
-    }
-    else
-    {
-      return false;
-    }
-  }
-  else
-  {
-    return false;
-  }  
-}
-
-bool TePDIHaralick::getDissimilarity( unsigned int band, 
-  unsigned int pol_index, double& dissimilarityValue )
-{
-  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
-    "Invalid raster band" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-
-  COMatrixCacheNodeT const* nodePtr = getCOMatrixNodePtr( band, pol_index );
-  
-  if( nodePtr )
-  {
-    if( nodePtr->matrix_.size() )
-    {
-      dissimilarityValue = 0;
-      
-      COMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
-      COMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
-        
-      while ( itFirst != itEnd )
-      {
-        dissimilarityValue += ( itFirst->second * (
-          ABS( itFirst->first.first - itFirst->first.second ) ) );
-        
-        ++itFirst;
-      }
-      
-      return true;
-    }
-    else
-    {
-      return false;
-    }
-  }
-  else
-  {
-    return false;
-  }
-}
-
-bool TePDIHaralick::getAngular2ndMoment( unsigned int band, 
-  unsigned int pol_index, double& ang2ndMomentValue )
-{
-  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
-    "Invalid raster band" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-
-  COMatrixCacheNodeT const* nodePtr = getCOMatrixNodePtr( band, pol_index );
-  
-  if( nodePtr )
-  {
-    ang2ndMomentValue = 0;
-    
-    if( nodePtr->matrix_.size() )
-    {
-      COMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
-      COMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
-        
-      while ( itFirst != itEnd )
-      {
-        ang2ndMomentValue += ( itFirst->second * itFirst->second );
-        
-        ++itFirst;
-      }
-      
-      return true;
-    }
-    else
-    {
-      return false;
-    }
-  }
-  else
-  {
-    return false;
-  }
-}
-
-bool TePDIHaralick::getStdDev( unsigned int band, 
-  unsigned int pol_index, double& stdDevValue )
-{
-  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
-    "Invalid raster band" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-
-  COMatrixCacheNodeT const* nodePtr = getCOMatrixNodePtr( band, pol_index );
-  
-  if( nodePtr )
-  {
-    double mean = 0;
-    
-    if( ( nodePtr->matrix_.size() ) && getMean( band, pol_index, mean ) )
-    {
-      stdDevValue = 0;
-      
-      COMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
-      COMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
-      double mean = 0;
-        
-      while ( itFirst != itEnd )
-      {
-        stdDevValue += ( itFirst->second * ( itFirst->first.first - mean ) );
-        
-        ++itFirst;
-      }
-      
-      stdDevValue = sqrt( stdDevValue );
-      
-      return true;
-    }
-    else
-    {
-      return false;
-    }
-  }
-  else
-  {
-    return false;
-  }
-}
-
-
-TePDIHaralick::COMatrixCacheNodeT const* TePDIHaralick::getCOMatrixNodePtr( 
-  unsigned int band, unsigned int pol_index )
-{
-  TEAGN_DEBUG_CONDITION( ( ((int)band) < input_raster_->params().nBands() ),
-    "Invalid raster band" );
-  TEAGN_DEBUG_CONDITION( ( pol_index < polygonset_->size() ), 
-    "Invalid polygon index" );
-    
-  COMatrixCacheKeyT key;
-  key.first = band;
-  key.second = pol_index;
-  const COMatrixCacheNodeT dummyNode;
-  COMatrixCacheT::iterator it = conc_matrix_cache_.find( key );
-  
-  if( it == conc_matrix_cache_.end() ) 
-  {
-    TePolygon& pol = (*polygonset_)[ pol_index ];
-
-    conc_matrix_cache_[ key ] = dummyNode;
-    COMatrixCacheNodeT& cacheNode = conc_matrix_cache_[ key ];
-  
-    TeRaster::iteratorPoly itp = input_raster_->begin(pol,TeBoxPixelIn, band);
-
-    COMatrixT& mat = cacheNode.matrix_;
-
-    COMatrixKeyT auxkey;
-    COMatrixKeyT inverseAuxKey;
-    
-    int curr_line = 0;
-    int curr_col = 0;
-    
-    //enquanto no acabar os pixels do polgono n
-    while ( ! itp.end() ) 
-    {
-      curr_line =  itp.currentLine();
-      curr_col = itp.currentColumn();
-    
-      if( dirmask_ & North ) 
-        INSERT_CONCURRENCE( curr_line - 1, curr_col )
-      if( dirmask_ & NorthEast ) 
-        INSERT_CONCURRENCE( curr_line - 1, curr_col + 1 )
-      if( dirmask_ & East ) 
-        INSERT_CONCURRENCE( curr_line, curr_col + 1 )
-      if( dirmask_ & SouthEast ) 
-        INSERT_CONCURRENCE( curr_line + 1, curr_col + 1 )        
-      if( dirmask_ & South ) 
-        INSERT_CONCURRENCE( curr_line + 1, curr_col )         
-      if( dirmask_ & SouthWest ) 
-        INSERT_CONCURRENCE( curr_line + 1, curr_col - 1 )        
-      if( dirmask_ & West ) 
-        INSERT_CONCURRENCE( curr_line, curr_col - 1 )         
-      if( dirmask_ & NorthWest ) 
-        INSERT_CONCURRENCE( curr_line - 1, curr_col - 1 )           
-    
-      ++itp;
-    } 
-      
-    /* Post-processing matrix */
-      
-    COMatrixT::iterator ccm_it = mat.begin();
-    const COMatrixT::iterator ccm_it_end = mat.end();
-
-    cacheNode.matrixMinGray_ = DBL_MAX;
-    cacheNode.matrixMaxGray_ = (-1.0) * DBL_MAX;
-    
-    double normFact = 0;
-      
-    while ( ccm_it != ccm_it_end )
-    {
-      if( ccm_it->first.first < cacheNode.matrixMinGray_ )
-        cacheNode.matrixMinGray_ = ccm_it->first.first;
-      if( ccm_it->first.second < cacheNode.matrixMinGray_ )
-        cacheNode.matrixMinGray_ = ccm_it->first.second;
-        
-      if( ccm_it->first.first > cacheNode.matrixMaxGray_ )
-        cacheNode.matrixMaxGray_ = ccm_it->first.first;
-      if( ccm_it->first.second > cacheNode.matrixMaxGray_ )
-        cacheNode.matrixMaxGray_ = ccm_it->first.second;
-      
-      normFact += ccm_it->second;
-      
-      ccm_it++;
-    } 
-      
-    ccm_it = mat.begin();
-      
-    while ( ccm_it != ccm_it_end )
-    {
-      ( ccm_it->second ) /= normFact;
-        
-      ++ccm_it;
-    }
-    
-    /* Updading concurrence matrix cache */
-
-    return &(cacheNode);  
-  } else {
-    return &(it->second);
-  }
-}
-
-void TePDIHaralick::clear()
-{
-  conc_matrix_cache_.clear();
-  input_raster_.reset();
-  polygonset_.reset();
-}
-
-
+#include "TePDIHaralick.hpp"
+
+#include <TeGeometryAlgorithms.h>
+#include <TeCoord2D.h>
+#include <TeAgnostic.h>
+
+#include <math.h>
+
+#define INSERT_GLCM_ELEMENT( concpixel_line, concpixel_col ) \
+  if( input_raster_->getElement( concpixel_col, concpixel_line, \
+    auxkey.second, band ) ) \
+  { \
+    auxkey.first = itp.operator*(band); \
+    \
+    ++( mat[ auxkey ] ); \
+    \
+    ++( cacheNode.coOcurrences_ ); \
+    \
+    inverseAuxKey.first = auxkey.second; \
+    inverseAuxKey.second = auxkey.first; \
+    \
+    ++( mat[ inverseAuxKey ] ); \
+    \
+    ++( cacheNode.coOcurrences_ ); \
+    \
+    if( auxkey.first < cacheNode.rasterMinGray_ ) \
+      cacheNode.rasterMinGray_ = auxkey.first; \
+    if( auxkey.second < cacheNode.rasterMinGray_ ) \
+      cacheNode.rasterMinGray_ = auxkey.second; \
+    \
+    if( auxkey.first > cacheNode.rasterMaxGray_ ) \
+      cacheNode.rasterMaxGray_ = auxkey.first; \
+    if( auxkey.second > cacheNode.rasterMaxGray_ ) \
+      cacheNode.rasterMaxGray_ = auxkey.second; \
+  };
+  
+TePDIHaralick::TePDIHaralick()
+{
+  polygonset_.reset( new TePolygonSet );
+  direction_ = NoDirection;
+}
+
+
+TePDIHaralick::~TePDIHaralick()
+{
+  clear();
+}
+
+
+void TePDIHaralick::ResetState( const TePDIParameters& params )
+{
+  clear();
+  
+  TEAGN_TRUE_OR_THROW( params.GetParameter( "input_raster", input_raster_ ),
+    "Missing parameter input_raster" )
+  TEAGN_TRUE_OR_THROW( params.GetParameter( "direction", direction_ ),
+    "Missing parameter direction" )    
+  TEAGN_TRUE_OR_THROW( params.GetParameter( "polygonset", polygonset_ ),
+    "Missing parameter polygonset" )
+}
+
+
+bool TePDIHaralick::RunImplementation()
+{
+  TEAGN_LOG_AND_THROW( "This function cannot be used for this class" );
+  return false;
+}
+
+
+bool TePDIHaralick::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking input_raster1 */
+  
+  TePDITypes::TePDIRasterPtrType input_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster", 
+    input_raster ),
+    "Missing parameter: input_raster" );
+  TEAGN_TRUE_OR_RETURN( input_raster.isActive(),
+    "Invalid parameter: input_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( input_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: input_raster not ready" );
+  
+  for( int band = 0 ; band < input_raster->params().nBands() ;
+    ++band )
+  {
+    TEAGN_TRUE_OR_RETURN( input_raster->params().dataType_[ band ] !=
+      TeFLOAT, "Invalid raster data type" )
+    TEAGN_TRUE_OR_RETURN( input_raster->params().dataType_[ band ] !=
+      TeDOUBLE, "Invalid raster data type" )
+  }
+  
+  /* Checking the direction parameter */
+  
+  DirectionT direction = NoDirection;
+  
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "direction", direction ),
+    "Missing parameter : direction" );    
+
+  /* Checking the restriction polygon set */
+  
+  TePDITypes::TePDIPolygonSetPtrType polygonset;  
+  
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "polygonset", polygonset ),
+    "Missing parameter : polygonset" );
+  
+  TEAGN_TRUE_OR_RETURN( polygonset.isActive(), 
+    "Invalid parameter : polygonset" );
+    
+  TEAGN_TRUE_OR_RETURN( polygonset->size() > 0, 
+    "Invalid parameter : polygonset" );    
+      
+  return true;
+}
+
+
+bool TePDIHaralick::getGLCMEntropy( unsigned int band, unsigned int pol_index,
+  double& entropyValue )
+{
+  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
+    "Invalid raster band" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+
+  GLCMMatrixCacheNodeT const* nodePtr = getGLCMMatrixNodePtr( band, pol_index );
+   
+  if( nodePtr )
+  {
+    entropyValue = 0.0;
+  
+    GLCMMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
+    GLCMMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
+  
+    while ( itFirst != itEnd )
+    {
+      const double& ocurrences = itFirst->second;
+      
+      entropyValue += ( ocurrences * log(ocurrences) );
+      
+      ++itFirst;
+    }
+    
+    entropyValue *= -1.0;
+  
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+
+
+bool TePDIHaralick::getGLCMEnergy( unsigned int band, unsigned int pol_index,
+  double& energyValue )
+{
+  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
+    "Invalid raster band" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+
+  GLCMMatrixCacheNodeT const* nodePtr = getGLCMMatrixNodePtr( band, pol_index );
+  
+  if( nodePtr == 0 )
+  {
+    return false;
+  }
+  else
+  {
+    energyValue = 0.0;
+  
+    GLCMMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
+    GLCMMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
+      
+    while ( itFirst != itEnd )
+    {
+      energyValue += ( (itFirst->second) * (itFirst->second) );
+      ++itFirst;
+    }
+    
+    return true;
+  }
+}
+
+
+bool TePDIHaralick::getGLCMContrast( unsigned int band, unsigned int pol_index,
+  double& contrastValue )
+{
+  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
+    "Invalid raster band" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+  
+  GLCMMatrixCacheNodeT const* nodePtr = getGLCMMatrixNodePtr( band, pol_index );
+  
+  if( nodePtr )
+  {
+    contrastValue = 0.0;
+    
+    double dif = 0;
+    
+    GLCMMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
+    GLCMMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
+      
+    while ( itFirst != itEnd )
+    {
+      dif = ((itFirst->first.first) - (itFirst->first.second));
+      
+      contrastValue += ( dif * dif ) * itFirst->second;
+      
+      ++itFirst;
+    }    
+    
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+
+bool TePDIHaralick::getGLCMHomogeneity( unsigned int band, unsigned int pol_index,
+  double& homogeneityValue )
+{
+  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
+    "Invalid raster band" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+
+  GLCMMatrixCacheNodeT const* nodePtr = getGLCMMatrixNodePtr( band, pol_index );
+  
+  if( nodePtr )
+  {
+    homogeneityValue = 0.0;
+    
+    // The dif stores difference i - j.
+    double dif;
+    
+    GLCMMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
+    GLCMMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
+      
+    while ( itFirst != itEnd )
+    {
+      dif = ((itFirst->first.first) - (itFirst->first.second));
+      
+      homogeneityValue += ( (itFirst->second) /
+        ( 1 + ( dif * dif ) ) );
+      
+      ++itFirst;
+    }
+    
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+
+bool TePDIHaralick::getGLCMQuiSquare( unsigned int band, unsigned int pol_index,
+  double& QuiSquareValue )
+{
+  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
+    "Invalid raster band" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+
+  GLCMMatrixCacheNodeT const* nodePtr = getGLCMMatrixNodePtr( band, pol_index );
+  
+  if( nodePtr )
+  {
+    QuiSquareValue = 0.0;
+  
+    // total_col stores the sum of the probabilities of column j
+    // total_ln stores the sum of the probabilities of line i
+    double total_col =  0.0, total_ln = 0.0;
+    
+    GLCMMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
+    GLCMMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
+  
+    //iterators and map auxiliaries
+    GLCMMatrixT::const_iterator itAux1 = nodePtr->matrix_.begin();
+        
+    map <double, double> totalLine;
+    map <double, double> totalColumn;
+  
+    while(itAux1 != itEnd)
+    { 
+      if (totalLine.find(itAux1->first.first)== totalLine.end())
+      {
+        totalLine[itAux1->first.first] = itAux1->second;
+      }
+      else
+      {
+        totalLine[itAux1->first.first] += itAux1->second;
+      }
+  
+      if (totalColumn.find(itAux1->first.second) == totalColumn.end())
+      {
+        totalColumn[itAux1->first.second] = itAux1->second;
+      }
+      else
+      {
+        totalColumn[itAux1->first.second] += itAux1->second;
+      }
+  
+      ++itAux1;
+  
+    }
+    
+    while ( itFirst != itEnd )
+    {
+      total_col = (totalColumn.find(itFirst->first.second))->second;
+      total_ln = (totalLine.find(itFirst->first.first))->second;
+  
+      QuiSquareValue += ((pow(itFirst->second,2)))/( total_col * total_ln);
+      ++itFirst;
+    }
+  
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+bool TePDIHaralick::getGLCMMean( unsigned int band, unsigned int pol_index,
+  double& meanValue )
+{
+  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
+    "Invalid raster band" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+
+  GLCMMatrixCacheNodeT const* nodePtr = getGLCMMatrixNodePtr( band, pol_index );
+  
+  if( nodePtr && ( nodePtr->coOcurrences_ ) )
+  {
+    GLCMMatrixT::const_iterator it = nodePtr->matrix_.begin();
+    GLCMMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
+    
+    meanValue = 0;
+      
+    while ( it != itEnd )
+    {
+      meanValue += ( it->first.first + it->first.second ) * it->second * 
+        ((double)nodePtr->coOcurrences_);
+                
+      ++it;
+    }
+    
+    meanValue /= ( 2.0 *((double)nodePtr->coOcurrences_) );
+    
+    return true;
+  }
+  else
+  {
+    return false;
+  }  
+}
+
+bool TePDIHaralick::getGLCMDissimilarity( unsigned int band, 
+  unsigned int pol_index, double& dissimilarityValue )
+{
+  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
+    "Invalid raster band" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+
+  GLCMMatrixCacheNodeT const* nodePtr = getGLCMMatrixNodePtr( band, pol_index );
+  
+  if( nodePtr )
+  {
+    if( nodePtr->matrix_.size() )
+    {
+      dissimilarityValue = 0;
+      
+      GLCMMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
+      GLCMMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
+        
+      while ( itFirst != itEnd )
+      {
+        dissimilarityValue += ( itFirst->second * (
+          ABS( itFirst->first.first - itFirst->first.second ) ) );
+        
+        ++itFirst;
+      }
+      
+      return true;
+    }
+    else
+    {
+      return false;
+    }
+  }
+  else
+  {
+    return false;
+  }
+}
+
+
+bool TePDIHaralick::getGLCMStdDev( unsigned int band, 
+  unsigned int pol_index, double& stdDevValue )
+{
+  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
+    "Invalid raster band" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+
+  GLCMMatrixCacheNodeT const* nodePtr = getGLCMMatrixNodePtr( band, pol_index );
+  
+  if( nodePtr )
+  {
+    double mean = 0;
+    
+    if( ( nodePtr->matrix_.size() ) && getGLCMMean( band, pol_index, mean ) )
+    {
+      stdDevValue = 0;
+      
+      GLCMMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
+      GLCMMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
+      double mean = 0;
+        
+      while ( itFirst != itEnd )
+      {
+        stdDevValue += ( itFirst->second * ( itFirst->first.first - mean ) );
+        
+        ++itFirst;
+      }
+      
+      stdDevValue = sqrt( stdDevValue );
+      
+      return true;
+    }
+    else
+    {
+      return false;
+    }
+  }
+  else
+  {
+    return false;
+  }
+}
+
+bool TePDIHaralick::getGLCMCorrelation( unsigned int band, 
+  unsigned int pol_index, double& correlationValue )
+{
+  TEAGN_TRUE_OR_THROW( ( ((int)band) < input_raster_->params().nBands() ),
+    "Invalid raster band" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+    
+  double mean = 0;
+  double stddev = 0;
+  GLCMMatrixCacheNodeT const* nodePtr = getGLCMMatrixNodePtr( band, pol_index );
+  
+  if( getGLCMMean( band, pol_index, mean ) && getGLCMStdDev( band, pol_index, 
+    stddev ) && ( nodePtr != 0 ) )
+  {
+    // Calc correlation 
+    
+    correlationValue = 0;
+    
+    GLCMMatrixT::const_iterator itFirst = nodePtr->matrix_.begin();
+    const GLCMMatrixT::const_iterator itEnd = nodePtr->matrix_.end();
+    
+    double stddev2 = stddev * stddev;
+        
+    while ( itFirst != itEnd )
+    {
+      correlationValue += ( ( ( itFirst->first.first - mean ) *
+        ( itFirst->first.second - mean ) * itFirst->second ) /
+        stddev2 ) ;
+      
+      ++itFirst;
+    }
+      
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+
+TePDIHaralick::GLCMMatrixCacheNodeT const* TePDIHaralick::getGLCMMatrixNodePtr( 
+  unsigned int band, unsigned int pol_index )
+{
+  TEAGN_DEBUG_CONDITION( ( ((int)band) < input_raster_->params().nBands() ),
+    "Invalid raster band" );
+  TEAGN_DEBUG_CONDITION( ( pol_index < polygonset_->size() ), 
+    "Invalid polygon index" );
+    
+  GLCMMatrixCacheKeyT key;
+  key.first = band;
+  key.second = pol_index;
+  const GLCMMatrixCacheNodeT dummyNode;
+  GLCMMatrixCacheT::iterator it = conc_matrix_cache_.find( key );
+  
+  if( it == conc_matrix_cache_.end() ) 
+  {
+    TePolygon& pol = (*polygonset_)[ pol_index ];
+
+    conc_matrix_cache_[ key ] = dummyNode;
+    GLCMMatrixCacheNodeT& cacheNode = conc_matrix_cache_[ key ];
+  
+    TeRaster::iteratorPoly itp = input_raster_->begin(pol,TeBoxPixelIn, band);
+
+    GLCMMatrixT& mat = cacheNode.matrix_;
+
+    GLCMMatrixKeyT auxkey;
+    GLCMMatrixKeyT inverseAuxKey;
+    
+    int curr_line = 0;
+    int curr_col = 0;
+    
+    //enquanto no acabar os pixels do polgono n
+    while ( ! itp.end() ) 
+    {
+      curr_line =  itp.currentLine();
+      curr_col = itp.currentColumn();
+    
+      if( direction_ & North ) 
+        INSERT_GLCM_ELEMENT( curr_line - 1, curr_col )
+      if( direction_ & NorthEast ) 
+        INSERT_GLCM_ELEMENT( curr_line - 1, curr_col + 1 )
+      if( direction_ & East ) 
+        INSERT_GLCM_ELEMENT( curr_line, curr_col + 1 )
+      if( direction_ & SouthEast ) 
+        INSERT_GLCM_ELEMENT( curr_line + 1, curr_col + 1 )        
+      if( direction_ & South ) 
+        INSERT_GLCM_ELEMENT( curr_line + 1, curr_col )         
+      if( direction_ & SouthWest ) 
+        INSERT_GLCM_ELEMENT( curr_line + 1, curr_col - 1 )        
+      if( direction_ & West ) 
+        INSERT_GLCM_ELEMENT( curr_line, curr_col - 1 )         
+      if( direction_ & NorthWest ) 
+        INSERT_GLCM_ELEMENT( curr_line - 1, curr_col - 1 )           
+    
+      ++itp;
+    } 
+      
+    /* Normalizing matrix */
+      
+    GLCMMatrixT::iterator ccm_it = mat.begin();
+    const GLCMMatrixT::iterator ccm_it_end = mat.end();
+      
+    while ( ccm_it != ccm_it_end )
+    {
+      ( ccm_it->second ) /= ( (double)cacheNode.coOcurrences_ );
+        
+      ++ccm_it;
+    }
+    
+    /* Updading concurrence matrix cache */
+
+    return &(cacheNode);  
+  } else {
+    return &(it->second);
+  }
+}
+
+void TePDIHaralick::clear()
+{
+  conc_matrix_cache_.clear();
+  input_raster_.reset();
+  polygonset_.reset();
+}
+
+
diff --git a/src/terralib/image_processing/TePDIHaralick.hpp b/src/terralib/image_processing/TePDIHaralick.hpp
old mode 100755
new mode 100644
index 350f65b..f68e2cf
--- a/src/terralib/image_processing/TePDIHaralick.hpp
+++ b/src/terralib/image_processing/TePDIHaralick.hpp
@@ -1,311 +1,327 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIHARALICK_HPP
-  #define TEPDIHARALICK_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIParameters.hpp"
-  #include "TePDITypes.hpp"
-  
-  #include <map>
-
-  /**
-   * @brief This is the class for Haralick texture features over raster data.
-   * @author Vanessa Oliveira de Souza <vanessa at dpi.inpe.br>
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIGeneralAlgoGroup
-   * @note Reference 1 : Textural Features for Image Classification -
-   * Robert M. Haralick, K. Shanmugam, Its'hak Dinstein.
-   * @note Reference 2: Computer and Robot Vision - Robert M. Haralick - 
-   * Addison-Wesley Publishing Company
-   * @note Reference 3: Definiens Developer 7 Reference Book
-   *
-   * @note The general required parameters are:
-   *
-   * @param input_raster (TePDITypes::TePDIRasterPtrType) Input image -
-   * no floating point images allowed.
-   * @param polygonset ( TePDITypes::TePDIPolygonSetPtrType ) - Restriction 
-   * polygon set - The area where to do calcules over all rasters.
-   */
-  class PDI_DLL TePDIHaralick : public TePDIAlgorithm {
-    public :
-      
-      /** @enum DirectionT Concurrence matrix used directions */ 
-      enum DirectionT {
-        /** @brief North direction */
-        North = 1,
-        /** @brief NorthEast direction */
-        NorthEast = 2,
-        /** @brief East direction */
-        East = 4,
-        /** @brief SouthEast direction */
-        SouthEast = 8,
-        /** @brief South direction */
-        South = 16,
-        /** @brief SouthWest direction */
-        SouthWest = 32,
-        /** @brief West direction */
-        West = 64,
-        /** @brief NorthWest direction */
-        NorthWest = 128
-      };
-
-      /**
-       * @brief Default Constructor.
-       * @param dirmask Directions mask( DirectionT ), can be a single direction
-       * or a combination of multiple directions (using the OR operator),
-       *
-       */
-      TePDIHaralick( int dirmask = East );
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIHaralick();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-                
-      /**
-       * @brief GLCM Entropy of one polygon inside one band (Reference 1).
-       *
-       * @param band Raster band.
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @param entropyValue The generated value.
-       * @return true if OK, false on errors.
-       */
-      bool getEntropy( unsigned int band, unsigned int pol_index,
-        double& entropyValue );
-        
-       /**
-        * @brief GLCM Energy of one polygon inside one band (Reference 2).
-        * The energy measures textural uniformity, that is, repetition of pairs of pixel in the image. 
-        * High values of energy indicate that the distribution of gray level in region in the image 
-        * has a constant distribution or a periodic form.
-        *
-        * @param band Raster band.
-        * @param pol_index The polygon index inside the polygon set
-        * ( if no polygon set is present, use de default zero value ).
-        * @param energyValue The generated value.
-        * @return true if OK, false on errors.
-        */
-      bool getEnergy( unsigned int band, unsigned int pol_index,
-        double& energyValue );
-  
-        /**
-        * @brief GLCM Contrast of one polygon inside one band (Reference 1).
-        * The contrast is a estimate of the local variations. 
-        * Average of the squares of the differences between pixels.
-        *
-        * @param band Raster band.
-        * @param pol_index The polygon index inside the polygon set
-        * ( if no polygon set is present, use de default zero value ).
-        * @param contrastValue The generated value.
-        * @return true if OK, false on errors.
-        */
-      bool getContrast( unsigned int band, unsigned int pol_index,
-        double& contrastValue );
-  
-        /**
-        * @brief GLCM Homogeneity (a.k.a. Inverse Difference Moment) of 
-        * one polygon inside one band (Reference 1).
-        * This measure of texture results in great values for regions with similar gray level. 
-        * The contrast and the homogeneity are inversely correlacionad
-        *
-        * @param band Raster band.
-        * @param pol_index The polygon index inside the polygon set
-        * ( if no polygon set is present, use de default zero value ).
-        * @param homogeneityValue The generated value.
-        * @return true if OK, false on errors.
-        */
-      bool getHomogeneity( unsigned int band, unsigned int pol_index,
-        double& homogeneityValue );
-  
-        /**
-        * @brief GLCM QuiSquare of one polygon inside one band.
-        * This measure can be understood as a normalization of the energy for the linear dependence 
-        * of the gray level tones in a region in the image. 
-        *        
-        * @param band Raster band.
-        * @param pol_index The polygon index inside the polygon set
-        * ( if no polygon set is present, use de default zero value ).
-        * @param QuiSquareValue The generated value.
-        * @return true if OK, false on errors.
-        */
-      bool getQuiSquare( unsigned int band, unsigned int pol_index,
-        double& QuiSquareValue );
-      
-        /**
-        * @brief GLCM Mean of one polygon inside one band (Reference 3).
-        * The GLCM mean is the average expressed in terms of the GLCM. 
-        *        
-        * @param band Raster band.
-        * @param pol_index The polygon index inside the polygon set
-        * ( if no polygon set is present, use de default zero value ).
-        * @param meanValue The generated value.
-        * @return true if OK, false on errors.
-        */
-      bool getMean( unsigned int band, unsigned int pol_index,
-        double& meanValue );        
-      
-        /**
-        * @brief GLCM Dissimilarity of one polygon inside one band
-        * (Reference 3).
-        * Similar to contrast, but increases linearly. High if the local region 
-        * has a high contrast.
-        *        
-        * @param band Raster band.
-        * @param pol_index The polygon index inside the polygon set
-        * ( if no polygon set is present, use de default zero value ).
-        * @param dissimilarityValue The generated value.
-        * @return true if OK, false on errors.
-        */
-      bool getDissimilarity( unsigned int band, unsigned int pol_index,
-        double& dissimilarityValue );      
-      
-       /**
-        * @brief GLCM angular second moment (Reference 1).
-        *        
-        * @param band Raster band.
-        * @param pol_index The polygon index inside the polygon set
-        * ( if no polygon set is present, use de default zero value ).
-        * @param ang2ndMomentValue The generated value.
-        * @return true if OK, false on errors.
-        */
-      bool getAngular2ndMoment( unsigned int band, unsigned int pol_index,
-        double& ang2ndMomentValue );      
-      
-       /**
-        * @brief GLCM standard deviation (Reference 3).
-        * GLCM standard deviation uses the GLCM, therefore it deals 
-        * specifically with the combinations of reference and neighbor pixels. 
-        * Thus, it is not the same as the simple standard deviation of gray 
-        * levels in the original image.       
-        * @param band Raster band.
-        * @param pol_index The polygon index inside the polygon set
-        * ( if no polygon set is present, use de default zero value ).
-        * @param ang2ndMomentValue The generated value.
-        * @return true if OK, false on errors.
-        */
-      bool getStdDev( unsigned int band, unsigned int pol_index,
-        double& stdDevValue );       
-  
-    protected :
-    
-      /**
-        * Concurrence matrix key type( A coord pair where x=first pixel value 
-        * and y=second pixel value).
-        */    
-      typedef std::pair< double, double > COMatrixKeyT;
-    
-      /** 
-        * Concurrence matrix type. 
-        * @param COMatrixKeyT A coord pair where x=first pixel value and 
-        * y=second pixel value.
-        * @param double The pair frequency ( The frequency field must be 
-        * double type due the matrix normalizing ).
-        */
-      typedef std::map< COMatrixKeyT, double > COMatrixT;
-      
-      /** 
-        * Concurrence matrix cache key type.
-        */
-      typedef std::pair< unsigned int, unsigned int > COMatrixCacheKeyT;
-      
-      /** Concurrence matrix cache node type. */
-      class COMatrixCacheNodeT
-      {
-        public :
-          
-          COMatrixT matrix_;
-          double matrixMinGray_;
-          double matrixMaxGray_;
-          
-          COMatrixCacheNodeT();
-          ~COMatrixCacheNodeT();
-      };
-      
-      /** 
-        * Concurrence matrix cache type.
-        */
-      typedef std::map< COMatrixCacheKeyT, COMatrixCacheNodeT > 
-        COMatrixCacheT;    
- 
-      /** @brief Direction mask. */
-      int dirmask_;
-      
-      /** @brief Concurrent matrix cache. */
-      COMatrixCacheT conc_matrix_cache_;
-      
-      /** @brief Input raster pointer. */
-      TePDITypes::TePDIRasterPtrType input_raster_;
-      
-      /** @brief Polygon set pointer. */
-      TePDITypes::TePDIPolygonSetPtrType polygonset_;
-      
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();      
-      
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );      
-      
-      /**
-       * @brief Build a co-ocurrence matrix node using a supplied polygon.
-       *
-       * @param band Raster band.
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The generated matrix node pointer o NULL on errors.
-       */      
-      COMatrixCacheNodeT const* getCOMatrixNodePtr( unsigned int band, 
-        unsigned int pol_index );
-      
-      // Clear all internal allocated resources.
-      void clear();
-   
-  };
-  
-/** @example TePDIHaralick_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIHARALICK_HPP
+  #define TEPDIHARALICK_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIParameters.hpp"
+  #include "TePDITypes.hpp"
+  
+  #include <map>
+
+  /**
+   * @class TePDIHaralick
+   * @brief Haralick texture features over raster regions.
+   * @author Vanessa Oliveira de Souza <vanessa at dpi.inpe.br>
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIGeneralAlgoGroup
+   *
+   * @note Reference 1 : Textural Features for Image Classification -
+   * Robert M. Haralick, K. Shanmugam, Its'hak Dinstein.
+   * @note Reference 2: Computer and Robot Vision - Robert M. Haralick - 
+   * Addison-Wesley Publishing Company
+   * @note Reference 3: Definiens Developer 7 Reference Book
+   * @note Reference 4 : Remote Sensing - Models and Methods for Image
+   * Processing 2nd Edition - Robert A. Schowengerdt - Academic Press.
+   *
+   * @note The general required parameters are:
+   *
+   * @param input_raster (TePDITypes::TePDIRasterPtrType) Input image -
+   * no floating point images allowed.
+   * @param direction ( TePDIHaralick::DirectionT ) - The direction
+   * (or direction combination bit-field mask) to be used.
+   * @param polygonset ( TePDITypes::TePDIPolygonSetPtrType ) - Restriction 
+   * polygon set - The area where to do calcules over all rasters.
+   *
+   * @example TePDIHaralick_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIHaralick : public TePDIAlgorithm 
+  {
+    public :
+      
+      /** @enum DirectionT Concurrence matrix used directions */ 
+      enum DirectionT 
+      {
+        /** @brief Invalid direction */
+        NoDirection = 0,
+        /** @brief North direction */
+        North = 1,
+        /** @brief NorthEast direction */
+        NorthEast = 2,
+        /** @brief East direction */
+        East = 4,
+        /** @brief SouthEast direction */
+        SouthEast = 8,
+        /** @brief South direction */
+        South = 16,
+        /** @brief SouthWest direction */
+        SouthWest = 32,
+        /** @brief West direction */
+        West = 64,
+        /** @brief NorthWest direction */
+        NorthWest = 128
+      };
+
+      TePDIHaralick();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIHaralick();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+                
+      /**
+       * @brief GLCM Entropy of one polygon inside one band (Reference 1).
+       *
+       * @param band Raster band.
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @param entropyValue The generated value.
+       * @return true if OK, false on errors.
+       */
+      bool getGLCMEntropy( unsigned int band, unsigned int pol_index,
+        double& entropyValue );
+        
+       /**
+        * @brief GLCM Energy (a.k.a GLCM angular second moment) (Reference 2).
+        * The energy measures textural uniformity, that is, repetition of pairs of pixel in the image. 
+        * High values of energy indicate that the distribution of gray level in region in the image 
+        * has a constant distribution or a periodic form.
+        *
+        * @param band Raster band.
+        * @param pol_index The polygon index inside the polygon set
+        * ( if no polygon set is present, use de default zero value ).
+        * @param energyValue The generated value.
+        * @return true if OK, false on errors.
+        */
+      bool getGLCMEnergy( unsigned int band, unsigned int pol_index,
+        double& energyValue );
+  
+        /**
+        * @brief GLCM Contrast of one polygon inside one band (Reference 4).
+        * The contrast is a estimate of the local variations. 
+        * Average of the squares of the differences between pixels.
+        *
+        * @param band Raster band.
+        * @param pol_index The polygon index inside the polygon set
+        * ( if no polygon set is present, use de default zero value ).
+        * @param contrastValue The generated value.
+        * @return true if OK, false on errors.
+        */
+      bool getGLCMContrast( unsigned int band, unsigned int pol_index,
+        double& contrastValue );
+  
+        /**
+        * @brief GLCM Homogeneity (a.k.a. Inverse Difference Moment) of 
+        * one polygon inside one band (Reference 1).
+        * This measure of texture results in great values for regions with similar gray level. 
+        * The contrast and the homogeneity are inversely correlacionad
+        *
+        * @param band Raster band.
+        * @param pol_index The polygon index inside the polygon set
+        * ( if no polygon set is present, use de default zero value ).
+        * @param homogeneityValue The generated value.
+        * @return true if OK, false on errors.
+        */
+      bool getGLCMHomogeneity( unsigned int band, unsigned int pol_index,
+        double& homogeneityValue );
+  
+        /**
+        * @brief GLCM QuiSquare of one polygon inside one band.
+        * This measure can be understood as a normalization of the energy for the linear dependence 
+        * of the gray level tones in a region in the image. 
+        *        
+        * @param band Raster band.
+        * @param pol_index The polygon index inside the polygon set
+        * ( if no polygon set is present, use de default zero value ).
+        * @param QuiSquareValue The generated value.
+        * @return true if OK, false on errors.
+        */
+      bool getGLCMQuiSquare( unsigned int band, unsigned int pol_index,
+        double& QuiSquareValue );
+      
+        /**
+        * @brief GLCM Mean of one polygon inside one band (Reference 3).
+        * The GLCM mean is the average expressed in terms of the GLCM. 
+        *        
+        * @param band Raster band.
+        * @param pol_index The polygon index inside the polygon set
+        * ( if no polygon set is present, use de default zero value ).
+        * @param meanValue The generated value.
+        * @return true if OK, false on errors.
+        */
+      bool getGLCMMean( unsigned int band, unsigned int pol_index,
+        double& meanValue );        
+      
+        /**
+        * @brief GLCM Dissimilarity of one polygon inside one band
+        * (Reference 3).
+        * Similar to contrast, but increases linearly. High if the local region 
+        * has a high contrast.
+        *        
+        * @param band Raster band.
+        * @param pol_index The polygon index inside the polygon set
+        * ( if no polygon set is present, use de default zero value ).
+        * @param dissimilarityValue The generated value.
+        * @return true if OK, false on errors.
+        */
+      bool getGLCMDissimilarity( unsigned int band, unsigned int pol_index,
+        double& dissimilarityValue );      
+      
+       /**
+        * @brief GLCM standard deviation (Reference 3).
+        * @defails GLCM standard deviation uses the GLCM, therefore it deals 
+        * specifically with the combinations of reference and neighbor pixels. 
+        * Thus, it is not the same as the simple standard deviation of gray 
+        * levels in the original image.       
+        * @param band Raster band.
+        * @param pol_index The polygon index inside the polygon set
+        * ( if no polygon set is present, use de default zero value ).
+        * @param ang2ndMomentValue The generated value.
+        * @return true if OK, false on errors.
+        */
+      bool getGLCMStdDev( unsigned int band, unsigned int pol_index,
+        double& stdDevValue );    
+           
+       /**
+        * @brief GLCM correlation (Reference 2).
+        * @param band Raster band.
+        * @param pol_index The polygon index inside the polygon set
+        * ( if no polygon set is present, use de default zero value ).
+        * @param correlationValue The generated value.
+        * @return true if OK, false on errors.
+        */
+      bool getGLCMCorrelation( unsigned int band, unsigned int pol_index,
+        double& correlationValue );             
+  
+    protected :
+    
+      /**
+        * Concurrence matrix key type( A coord pair where x=first pixel value 
+        * and y=second pixel value).
+        */    
+      typedef std::pair< double, double > GLCMMatrixKeyT;
+    
+      /** 
+        * Concurrence matrix type. 
+        * @param GLCMMatrixKeyT A coord pair where x=first pixel value and 
+        * y=second pixel value.
+        * @param double The pair frequency ( The frequency field must be 
+        * double type due the matrix normalizing ).
+        */
+      typedef std::map< GLCMMatrixKeyT, double > GLCMMatrixT;
+      
+      /** 
+        * Concurrence matrix cache key type.
+        */
+      typedef std::pair< unsigned int, unsigned int > GLCMMatrixCacheKeyT;
+      
+      /** Concurrence matrix cache node type. */
+      class GLCMMatrixCacheNodeT
+      {
+        public :
+          
+          /** GLCM matrix (simetric, normalized between 0 and 1). */
+          GLCMMatrixT matrix_;
+          
+          /** Original minimum value read from the input image.
+          (default: DBL_MAX ) */
+          double rasterMinGray_;
+          
+          /** Original maximum value read from the input image. 
+          (default: -1.0 * DBL_MAX )*/
+          double rasterMaxGray_;
+                  
+          /** The total number of co-ocurrences inserted into the GLCM matrix.
+            (default:0)*/
+          unsigned int coOcurrences_;                  
+          
+          GLCMMatrixCacheNodeT()
+          : rasterMinGray_( DBL_MAX ), rasterMaxGray_( -1.0 * DBL_MAX ), 
+          coOcurrences_( 0 )
+          {};
+          
+          ~GLCMMatrixCacheNodeT() {};
+      };
+      
+      /** 
+        * Concurrence matrix cache type.
+        */
+      typedef std::map< GLCMMatrixCacheKeyT, GLCMMatrixCacheNodeT > 
+        GLCMMatrixCacheT;    
+ 
+      /** @brief Direction mask. */
+      DirectionT direction_;
+      
+      /** @brief Concurrent matrix cache. */
+      GLCMMatrixCacheT conc_matrix_cache_;
+      
+      /** @brief Input raster pointer. */
+      TePDITypes::TePDIRasterPtrType input_raster_;
+      
+      /** @brief Polygon set pointer. */
+      TePDITypes::TePDIPolygonSetPtrType polygonset_;
+      
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();      
+      
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );      
+      
+      /**
+       * @brief Build a co-ocurrence matrix node using a supplied polygon.
+       *
+       * @param band Raster band.
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The generated matrix node pointer o NULL on errors.
+       */      
+      GLCMMatrixCacheNodeT const* getGLCMMatrixNodePtr( unsigned int band, 
+        unsigned int pol_index );
+      
+      /** Clear all internal allocated resources. */
+      void clear();
+   
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDIHistogram.cpp b/src/terralib/image_processing/TePDIHistogram.cpp
old mode 100755
new mode 100644
index d1a3a5f..b88d78a
--- a/src/terralib/image_processing/TePDIHistogram.cpp
+++ b/src/terralib/image_processing/TePDIHistogram.cpp
@@ -1,1296 +1,1101 @@
-#include "TePDIHistogram.hpp"
-
-#include "TePDIUtils.hpp"
-#include "TePDIMatrix.hpp"
-#include <TeAgnostic.h>
-#include "TePDIPIManager.hpp"
-
-#include <TeUtils.h>
-#include <TePrecision.h>
-
-#include <float.h>
-#include <limits.h>
-
-
-TePDIHistogram::TePDIHistogram()
-{
-  init();
-}
-
-
-TePDIHistogram::TePDIHistogram( const TePDIHistogram& external )
-: TePDIHMapSpec()
-{
-  init();
-  
-  operator=( external );
-}
-
-
-TePDIHistogram::TePDIHistogram( 
-  const std::map< double, unsigned int >& external )
-{
-  init();
-  
-  operator=( external );
-}
-
-
-TePDIHistogram::~TePDIHistogram()
-{
-}
-
-
-bool TePDIHistogram::SetH(
-  const TePDITypes::TePDIRasterPtrType& in_raster,
-  unsigned int band,
-  bool zero_expansion,
-  TeStrategicIterator iterstrat,
-  const TeSharedPtr< TePolygonSet>& polsetptr )
-{
-  TEAGN_DEBUG_CONDITION( in_raster.isActive(),
-    "Inactive raster pointer" );
-  TEAGN_DEBUG_CONDITION( 
-    in_raster->params().status_ != TeRasterParams::TeNotReady,
-    "Raster not ready to read" );
-  TEAGN_DEBUG_CONDITION( (int)band < in_raster->nBands(),
-    "Invalid band" );
-  TEAGN_DEBUG_CONDITION( ( ! TePDIUtils::IsFloatBand( in_raster, band ) ),
-    "Unable to build non-interpolated histogram from float pixels type" );
-    
-  /* Optimization for 8 / 16 bit images */
-  
-  if( ( in_raster->params().dataType_[ band ] == TeUNSIGNEDCHAR ) ||
-    ( in_raster->params().dataType_[ band ] == TeCHAR ) ) {
-    return Set8BitH( in_raster, band, zero_expansion, 
-      iterstrat, polsetptr );
-  } else if( ( in_raster->params().dataType_[ band ] == TeUNSIGNEDSHORT ) ||
-    ( in_raster->params().dataType_[ band ] == TeSHORT ) ) {
-    return Set16BitH( in_raster, band, zero_expansion, 
-      iterstrat, polsetptr );
-  }
-  
-  TePDIHMapSpec::clear();
-  
-  const unsigned long int progress_steps = 
-    getProgressSteps( polsetptr, in_raster->params().resy_ );  
-
-  /* Dummy use check */
-  
-  bool in_raster_donot_uses_dummy = ! in_raster->params().useDummy_;
-  double in_raster_dummy = 0;
-  
-  if( ! in_raster_donot_uses_dummy ) {
-    in_raster_dummy = in_raster->params().dummy_[ band ];
-  }    
-    
-  /* Building initial unordered histogram */
-  
-  std::map< double, unsigned int > init_hist;
-  
-  {
-    TePDIPIManager progress( "Generating histogram", 
-      progress_steps, progress_int_enabled_ );
-  
-    double current_raster_level = 0;
-    TeRaster::iteratorPoly input_raster_it;
-    std::map< double, unsigned int >::iterator it;
-    unsigned int curr_line = 0;
-    unsigned int last_line = 0;
-    
-    for( unsigned int local_polset_index = 0 ; 
-      local_polset_index < polsetptr->size() ; 
-      ++local_polset_index ) {
-      
-      input_raster_it = in_raster->begin( 
-        (*polsetptr)[ local_polset_index ], iterstrat, 0 );
-      
-      while( ! input_raster_it.end() ) {
-        curr_line = input_raster_it.currentLine();
-      
-        current_raster_level = input_raster_it*( band );
-        
-        if( in_raster_donot_uses_dummy || 
-          ( current_raster_level != in_raster_dummy ) ) {
-          
-          it = init_hist.find( current_raster_level );
-            
-          if( it == init_hist.end() ) {
-            init_hist[ current_raster_level ] = 1;
-          } else {
-            it->second = it->second + 1;
-          }          
-        }
-        
-        if( curr_line != last_line ) {
-          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-            "Canceled by the user" );
-          
-          last_line = curr_line;
-        }
-        
-        ++input_raster_it;
-      }
-    }  
-  }
-  
-  if( init_hist.size() == 0 ) {
-    return true;
-  }
-  
-  /* Finding the lowest end highest level */
-
-  double lowest_level = init_hist.begin()->first;
-  double highest_level = lowest_level;
-  
-  {
-    std::map< double, unsigned int >::iterator it_end = init_hist.end();
-    --it_end;
-
-    highest_level = it_end->first;
-  }
-  
-  /* Doing zero expansion */
-  
-  if( zero_expansion ) {
-    if( 0. < lowest_level ) {
-      for( double index = 0. ; index < lowest_level ; ++index ) {
-        init_hist[ index ] = 0;
-      }
-    
-      lowest_level = 0.;
-    } else if( 0. > highest_level ) {
-      for( double index = highest_level + 1. ; index < 1. ; ++index ) {
-        init_hist[ index ] = 0;
-      }
-      
-      std::map< double, unsigned int >::iterator it_end = init_hist.end();
-      --it_end;
-    
-      highest_level = it_end->first;
-    }
-  }
-  
-  /* Building ordered histogram */
-  
-  {
-    double index = 0;
-    
-    for( index = lowest_level ; index <= highest_level ; ++index ) {
-      operator[]( index ) = 0;  
-    }
-  
-    std::map< double, unsigned int >::iterator it = init_hist.begin();
-    std::map< double, unsigned int >::iterator it_end = init_hist.end();
-    
-    while( it != it_end ) {
-      operator[]( it->first ) = it->second;
-    
-      ++it;
-    }
-  }
-
-  return true;
-}
-
-
-bool TePDIHistogram::reset(
-  const TePDITypes::TePDIRasterPtrType& in_raster,
-  unsigned int band,
-  unsigned int levels,
-  bool zero_expansion,
-  TeStrategicIterator iterstrat,
-  const TeSharedPtr< TePolygonSet>& polsetptr )
-{
-  TEAGN_TRUE_OR_RETURN( in_raster.isActive(),
-    "Inactive raster pointer" );
-  TEAGN_TRUE_OR_RETURN( 
-    in_raster->params().status_ != TeRasterParams::TeNotReady,
-    "Raster not ready to read" );
-  TEAGN_TRUE_OR_RETURN( (int)band < in_raster->nBands(),
-    "Invalid band" );
-    
-  /* Building the local restriction polygon set */
-  
-  TeSharedPtr< TePolygonSet> local_polsetptr;
-    
-  if( polsetptr.isActive() ) {
-    local_polsetptr = polsetptr;
-  } else {
-    local_polsetptr.reset( new TePolygonSet );
-    
-    TeBox rasterbox( in_raster->params().boundingBox() );
-    
-    local_polsetptr->add( polygonFromBox( rasterbox ) );
-  }
-  
-  /* For palette based rasters another algorithm is required */
-  
-  if( in_raster->params().photometric_[ band ] == 
-    TeRasterParams::TePallete ) {
-   
-    return SetPaletteBasedH( in_raster, band, zero_expansion,
-      iterstrat, local_polsetptr ); 
-  }
-    
-  /* Optimization - If the raster does not contains float pixels for 
-     this band, then we do not need an interpolated histogram */
-    
-  if( ( ! TePDIUtils::IsFloatBand( in_raster, band ) ) &&
-      ( levels == 0 ) ) {
-      
-    return SetH( in_raster, band, zero_expansion, iterstrat,
-      local_polsetptr );
-  }
-  
-  TePDIHMapSpec::clear();
-  
-  const unsigned long int progress_steps = 
-    getProgressSteps( local_polsetptr, in_raster->params().resy_ );
-  
-  /* Dummy use check */
-  
-  bool in_raster_donot_uses_dummy = ! in_raster->params().useDummy_;
-  double in_raster_dummy = 0;
-  
-  if( ! in_raster_donot_uses_dummy ) {
-    in_raster_dummy = in_raster->params().dummy_[ band ];
-  }
-  
-  /* Finding the lowest end highest level */
-  
-  double lowest_level = 0;
-  double highest_level = 0;  
-    
-  if ( in_raster->params().decoderIdentifier_ == "DB" ) {
-    lowest_level = in_raster->params().vmin_[ band ];
-    highest_level = in_raster->params().vmax_[ band ];
-
-    // Return if there is no pixel data to read 
-
-    if( in_raster->params().useDummy_ && ( lowest_level == in_raster_dummy ) &&
-      ( highest_level == in_raster_dummy ) )
-    {
-      return true;
-    }
-  } else {
-    lowest_level = DBL_MAX;
-    highest_level = ( -1.0 ) * DBL_MAX;  
-
-    bool lh_levels_set = false; // lowest_level and highest_level values set
-    
-    TeRaster::iteratorPoly input_raster_it;
-    TePDIPIManager progress( "Finding histogram range", progress_steps, 
-      progress_int_enabled_ );
-    double current_raster_level = 0;
-    unsigned int curr_line = 0;
-    unsigned int last_line = 0;    
-    
-    for( unsigned int local_polset_index = 0 ; 
-      local_polset_index < local_polsetptr->size() ; 
-      ++local_polset_index ) {
-      
-      input_raster_it = in_raster->begin( 
-        (*local_polsetptr)[ local_polset_index ], iterstrat, 0 );
-      
-      while( ! input_raster_it.end() ) {
-        current_raster_level = input_raster_it*( band );
-        curr_line = input_raster_it.currentLine();
-        
-        if( in_raster_donot_uses_dummy || 
-          ( current_raster_level != in_raster_dummy ) ) {
-
-          lh_levels_set = true;
-
-          if( current_raster_level > highest_level ) {
-            highest_level = current_raster_level;
-          }
-          if( current_raster_level < lowest_level ) {
-            lowest_level = current_raster_level;
-          }
-        }
-        
-        if( curr_line != last_line ) {
-          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-            "Canceled by the user" );
-          
-          last_line = curr_line;
-        }
-        
-        ++input_raster_it;
-      }
-    }
-
-    // Return if no pixel data was read 
-
-    if( ! lh_levels_set )
-    {
-      return true;
-    }
-  }
-  
-  if( zero_expansion &&
-      ( ! ( ( lowest_level <= 0.0 ) && ( highest_level >= 0.0 ) ) ) ) {
-  
-    if( lowest_level > 0.0 ) {
-      lowest_level = 0.0;
-    } else if ( highest_level < 0.0 ) {
-      highest_level = 0.0;
-    }
-  }  
-  
-  /* Calculating the histogram step and computed levels */
-
-  double step = 1;
-  unsigned int hist_computed_levels = 1;
-
-  if( highest_level != lowest_level )
-  {
-    if( levels == 0 ) {
-      /* Auto step feature */
-      TEAGN_TRUE_OR_RETURN( ( ( highest_level - lowest_level ) > 1.0 ),
-        "Histogram level range is too short for auto-step feature"
-        " lowest_level=" + Te2String( lowest_level ) + " highest_level=" +
-        Te2String( highest_level ) );
-  
-      hist_computed_levels = 1 +
-        ( unsigned int ) floor( highest_level - lowest_level );
-    } else {
-      hist_computed_levels = levels;
-    }
-  
-    TEAGN_TRUE_OR_RETURN( hist_computed_levels > 0,
-      "Invalid levels number" );
-  
-    step = ( highest_level - lowest_level ) /
-          ( (double)( hist_computed_levels - 1 ) );
-  }
-
-  /* Ordered Histogram buffer allocation */
-  
-  TePDIMatrix< double > hbuffer; /* line 0 - pixel level, 
-                                    line 1 - pixels count for that level */
-  TEAGN_TRUE_OR_RETURN( 
-    hbuffer.Reset( 2, hist_computed_levels, 
-    TePDIMatrix< double >::AutoMemPol ),
-    "Unable to create histogram internal buffer" );
-  {
-    hbuffer( 0, 0 ) = lowest_level;
-    hbuffer( 1, 0 ) = 0;
-        
-    for( unsigned int hbuffer_col = 1 ; 
-      ( hbuffer_col < hbuffer.GetColumns() ); 
-      ++hbuffer_col ) {
-    
-      hbuffer( 0, hbuffer_col ) = hbuffer( 0, hbuffer_col - 1 ) + step;
-      hbuffer( 1, hbuffer_col ) = 0;
-    }
-
-    // Fixing the last value precision
-
-    hbuffer( 0, hbuffer.GetColumns() - 1 ) = highest_level;
-  }
-  
-  /* Interpolated histogram generation */
-  
-  {
-    double current_raster_level = 0;
-    unsigned int found_index = 0;
-    
-    TePDIPIManager progress( "Generating interpolated histogram", 
-      progress_steps, progress_int_enabled_ );
-      
-    unsigned int curr_line = 0;
-    unsigned int last_line = 0;      
-
-    bool valid_pixel_found = false; // at least one valid pixel found
-    
-    for( unsigned int local_polset_index = 0 ; 
-      local_polset_index < local_polsetptr->size() ; 
-      ++local_polset_index ) {
-      
-      TeRaster::iteratorPoly input_raster_it = in_raster->begin( 
-        (*local_polsetptr)[ local_polset_index ], iterstrat, 0 );    
-    
-      while( ! input_raster_it.end() ) {
-        current_raster_level = input_raster_it*( band );
-        curr_line = input_raster_it.currentLine();
-        
-        if( in_raster_donot_uses_dummy || 
-          ( current_raster_level != in_raster_dummy ) ) {        
-
-          valid_pixel_found = true;
-
-          found_index = (unsigned int) TeRound( 
-            ( current_raster_level - lowest_level ) / step );          
-          
-          TEAGN_DEBUG_CONDITION( ( found_index < hist_computed_levels ),
-            "Invalid generated index position " + Te2String( found_index ) );
-        
-          hbuffer( 1, found_index ) = hbuffer( 1, found_index ) + 1;
-        }
-        
-        if( curr_line != last_line ) {
-          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-            "Canceled by the user" );
-          
-          last_line = curr_line;
-        }
-        
-        ++input_raster_it;
-      }
-    }
-
-    // Return if no valid pixel was read
-
-    if( ! valid_pixel_found )
-    {
-      return true;
-    }
-  }
-      
-  /* Transfering values from internal buffer to internal map */  
-  
-  for( unsigned int hbuffer_col = 0 ; hbuffer_col < hbuffer.GetColumns() ; 
-    ++hbuffer_col ) {
-    
-    operator[]( hbuffer( 0, hbuffer_col ) ) = 
-      ( unsigned int ) hbuffer( 1, hbuffer_col );
-  }
-  
-  return true;
-}
-
-
-bool TePDIHistogram::hasFixedStep() const
-{
-  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
-  
-  const_iterator it = begin();
-  const_iterator it_end = end();
-  
-  std::vector< double > steps;
-  std::vector< double >::iterator steps_it;
-  std::vector< double >::iterator steps_it_end;
-  
-  double curr_step = 0;
-  double last_value = it->first;
-  bool step_found = false;
-  
-  ++it;
-  
-  while( it != it_end ) {
-    curr_step = it->first - last_value;
-    
-    steps_it = steps.begin();
-    steps_it_end = steps.end();
-    
-    step_found = false;
-    
-    while( steps_it != steps_it_end ) {
-      if( (*steps_it) == curr_step ) {
-        step_found = true;
-        break;
-      }
-      
-      ++steps_it;
-    }
-    
-    if( ! step_found ) {
-      steps.push_back( curr_step );
-    }
-    
-    last_value = it->first;
-    
-    ++it;
-  }
-  
-  return ( ( steps.size() <= 1 ) ? true : false );
-}
-
-
-bool TePDIHistogram::IsDiscrete() const
-{
-  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
-  
-  const_iterator it = begin();
-  const_iterator it_end = end();
-
-  while( it != it_end ) {
-    if( (it->first) != ( (double)TeRound(it->first) ) ) {
-      return false;
-    }
-    
-    ++it;
-  }
-  
-  return true;
-}
-
-
-bool TePDIHistogram::Discretize()
-{
-  TEAGN_TRUE_OR_RETURN( size() > 0, "Trying to use an empty histogram" );
-  TEAGN_TRUE_OR_RETURN( ( ( GetMaxLevel() - GetMinLevel() ) > 1 ),
-    "The current histogram range do not allow discretization" );
-
-  if( IsDiscrete() ) {
-    return true;
-  }
-  
-  TePDIPIManager progress( "Discretizing histogram...", size() * 2,
-    progress_int_enabled_ );
-
-  unsigned int progress_step = 0; 
-
-  iterator it = begin();
-  iterator it_end = end();
-
-  TePDIHistogram temp_hist;
-
-  while( it != it_end ) {
-    progress.Update( progress_step );
-    ++progress_step;  
-  
-    temp_hist[ TeRound( it->first ) ] = 0;
-
-    ++it;
-  }
-  
-  it = begin();
-  
-  while( it != it_end ) {
-    progress.Update( progress_step );
-    ++progress_step;  
-  
-    temp_hist[ TeRound( it->first ) ] += it->second;
-
-    ++it;
-  }
-
-  TePDIHMapSpec::clear();
-  
-  operator=( temp_hist );
-
-  progress.Toggle( false );
-
-  return true;
-}
-
-
-double TePDIHistogram::GetMinLevel() const
-{
-  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
-  
-  return begin()->first;
-}
-
-
-double TePDIHistogram::GetMaxLevel() const
-{
-  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
-  
-  const_iterator it = end();
-  --it;
-  
-  return it->first;
-}
-
-
-unsigned int TePDIHistogram::GetMinCount() const
-{
-  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
-  
-  const_iterator it = begin();
-  const_iterator it_end = end();
-  
-  unsigned int min_count = INT_MAX;
-
-  while( it != it_end ) {
-    if( (it->second) < min_count ) {
-      min_count = it->second;
-    }
-    
-    ++it;
-  }
-  
-  return min_count;  
-}
-
-
-unsigned int TePDIHistogram::GetMaxCount() const
-{
-  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
-  
-  const_iterator it = begin();
-  const_iterator it_end = end();
-  
-  unsigned int max_count = 0;
-
-  while( it != it_end ) {
-    if( (it->second) > max_count ) {
-      max_count = it->second;
-    }
-    
-    ++it;
-  }
-  
-  return max_count;  
-}
-
-
-unsigned int TePDIHistogram::getTotalCount() const
-{
-  const_iterator it = begin();
-  const_iterator it_end = end();
-  
-  unsigned int total_count = 0;
-
-  while( it != it_end ) {
-    total_count += it->second;
-    
-    ++it;
-  }
-  
-  return total_count;  
-}
-
-
-void TePDIHistogram::clear()
-{
-  TePDIHMapSpec::clear();
-  init();
-}
-
-
-const TePDIHistogram& TePDIHistogram::operator=( 
-  const TePDIHistogram& external )
-{
-  clear();
-  
-  TePDIHMapSpec::operator=( external );
-
-  return *this;
-}
-
-
-const TePDIHistogram& TePDIHistogram::operator=( 
-  const std::map< double, unsigned int >& external )
-{
-  clear();
-  
-  std::map< double, unsigned int >::const_iterator ext_it = external.begin();
-  std::map< double, unsigned int >::const_iterator ext_it_end = 
-    external.end();
-    
-  if( ext_it != ext_it_end ) {
-    /* Verifying if the external histogram has floating point values 
-       and guessing min and max */
-    
-    bool has_floating_point_values = false;
-    
-    const double min = ext_it->first;
-      
-    while( ext_it != ext_it_end ) {
-      if( ext_it->first != TeRound( ext_it->first ) ) {
-        has_floating_point_values = true;
-      }
-      
-      ++ext_it;
-    }
-    
-    --ext_it;
-    const double max = ext_it->first;
-    
-    if( has_floating_point_values ) {
-      /* building primary interpolated histogram */
-    
-      double step_size = ( max - min ) / ( (double)external.size() - 1 );
-      
-      for( unsigned int step = 0 ; step < external.size() ; ++step ) {
-        operator[]( ( (double)step ) * step_size ) = 0;
-      }
-      
-      /* Interpolating values */
-      
-      ext_it = external.begin();
-      TePDIHistogram::iterator hist_it;
-      TePDIHistogram::iterator hist_it_aux;
-      double left_value = 0;
-      double right_value = 0;
-      double curr_value = 0;
-      
-      while( ext_it != ext_it_end ) {
-        curr_value = ext_it->first;
-      
-        hist_it = find( curr_value );
-        
-        if( hist_it == end() ) {
-          hist_it = upper_bound( curr_value );
-          
-          right_value = hist_it->first;
-          
-          hist_it_aux = hist_it;
-          --hist_it_aux;
-          left_value = hist_it_aux->first;
-          
-          if( ( right_value - curr_value ) > ( curr_value - left_value ) ) {
-            hist_it_aux->second += ext_it->second;
-          } else {
-            hist_it->second += ext_it->second;
-          }
-        } else {
-          hist_it->second += ext_it->second;
-        }
-        
-        ++ext_it;
-      }
-    } else {
-      /* Building discrete histogram */
-      
-      unsigned int min_ui = ( (unsigned int) min );
-      unsigned int max_ui = ( (unsigned int)max );
-      
-      unsigned int steps = 1 + max_ui - min_ui;
-      
-      if( steps == 1 ) {
-        operator[]( external.begin()->first ) = external.begin()->second;
-      } else {
-        for( unsigned int level = min_ui ; level <= max_ui ; ++level ) {
-          ext_it = external.find( (double)level );
-          
-          if( ext_it != ext_it_end ) {
-            operator[]( (double)level ) = ext_it->second;
-          } else {
-            operator[]( (double)level ) = 0;  
-          }
-        }
-      }
-    }
-  }
-  
-  return *this;
-}
-
-bool TePDIHistogram::operator==( const TePDIHistogram& external ) const
-{
-  if( size() == external.size() )
-  {
-    const_iterator myIt = begin();
-    const_iterator myIt_end = end();
-    const_iterator extIt = external.begin();
-    
-    while( myIt != myIt_end )
-    {
-      if( ( myIt->first != extIt->first ) || ( myIt->second != 
-        extIt->second ) )
-      {
-        return false;
-      }
-      
-      ++extIt;
-      ++myIt;
-    }
-    
-    return true;
-  }
-  else
-  {
-    return false;
-  }
-}
-
-unsigned int TePDIHistogram::size() const
-{
-  return (unsigned int)TePDIHMapSpec::size();
-}
-
-
-void TePDIHistogram::init()
-{
-  progress_int_enabled_ = true;
-}
-
-
-void TePDIHistogram::ToggleProgressInt( bool enabled )
-{
-  progress_int_enabled_ = enabled;
-}
-
-
-bool TePDIHistogram::SetPaletteBasedH(
-  const TePDITypes::TePDIRasterPtrType& in_raster,
-  unsigned int band,
-  bool zero_expansion,
-  TeStrategicIterator iterstrat,
-  const TeSharedPtr< TePolygonSet>& polsetptr )
-{
-  TEAGN_DEBUG_CONDITION( in_raster.isActive(),
-    "Inactive raster pointer" );
-  TEAGN_DEBUG_CONDITION( 
-    in_raster->params().status_ != TeRasterParams::TeNotReady,
-    "Raster not ready to read" );
-  TEAGN_DEBUG_CONDITION( ( (int)band < in_raster->nBands() ),
-    "Invalid band" );
-
-  TEAGN_TRUE_OR_RETURN( ( band < 3 ), "Invalid band" );
-  TEAGN_TRUE_OR_RETURN( (
-    ( in_raster->params().dataType_[ band ] == TeUNSIGNEDCHAR ) ||
-    ( in_raster->params().dataType_[ band ] == TeUNSIGNEDSHORT ) ||
-    ( in_raster->params().dataType_[ band ] == TeUNSIGNEDLONG ) ),
-    "Invalid pixel data type" );
-  TEAGN_TRUE_OR_RETURN( ( in_raster->params().photometric_[ band ] == 
-    TeRasterParams::TePallete ), "Incorrect photometric" )
-    
-  TePDIHMapSpec::clear();
-
-  const unsigned long int progress_steps = 
-    getProgressSteps( polsetptr, in_raster->params().resy_ );    
-
-  /* Dummy use check */
-  
-  bool in_raster_donot_uses_dummy = ! in_raster->params().useDummy_;
-  double in_raster_dummy = 0;
-  
-  if( ! in_raster_donot_uses_dummy ) {
-    in_raster_dummy = in_raster->params().dummy_[ band ];
-  }
-  
-  /* Defining the current lut pointer */
-  
-  vector< unsigned short >* lut_ptr = 0;
-  
-  if( band == 0 ) {
-    lut_ptr = &( in_raster->params().lutr_ );
-  } else if( band == 1 ) {
-    lut_ptr = &( in_raster->params().lutg_ );
-  } else {
-    lut_ptr = &( in_raster->params().lutb_ );
-  }
-    
-  /* Building initial unordered histogram */
-  
-  std::map< double, unsigned int > init_hist;
-  
-  {
-    TePDIPIManager progress( "Generating histogram", 
-      progress_steps, progress_int_enabled_ );
-  
-    double current_lut_index = 0;
-    unsigned short current_raster_level = 0;
-    TeRaster::iteratorPoly input_raster_it;
-    std::map< double, unsigned int >::iterator it;
-    unsigned int curr_line = 0;
-    unsigned int last_line = 0;
-    
-    for( unsigned int local_polset_index = 0 ; 
-      local_polset_index < polsetptr->size() ; 
-      ++local_polset_index ) {
-      
-      input_raster_it = in_raster->begin( 
-        (*polsetptr)[ local_polset_index ], iterstrat, 0 );
-      
-      while( ! input_raster_it.end() ) {
-        curr_line = input_raster_it.currentLine();
-      
-        current_lut_index = input_raster_it*( band );
-        
-        if( in_raster_donot_uses_dummy || 
-          ( current_lut_index != in_raster_dummy ) ) {
-          
-          TEAGN_DEBUG_CONDITION( ( ( ( unsigned long int )current_lut_index ) 
-            < lut_ptr->size() ), "Invalid lut index" )
-          
-          current_raster_level = (*lut_ptr)[ ( unsigned long int )
-            current_lut_index ];
-          
-          it = init_hist.find( current_raster_level );
-            
-          if( it == init_hist.end() ) {
-            init_hist[ current_raster_level ] = 1;
-          } else {
-            it->second = it->second + 1;
-          }          
-        }
-        
-        if( curr_line != last_line ) {
-          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-            "Canceled by the user" );
-          
-          last_line = curr_line;
-        }
-        
-        ++input_raster_it;
-      }
-    }  
-  }
-  
-  if( init_hist.size() == 0 ) {
-    return true;
-  }
-  
-  /* Finding the lowest end highest level */
-
-  double lowest_level = 0;
-  double highest_level = 0;
-  
-  {
-    std::map< double, unsigned int >::iterator it = init_hist.begin();
-    std::map< double, unsigned int >::iterator it_end = init_hist.end();
-    
-    lowest_level = highest_level = it->first;
-    
-    while( it != it_end ) {
-      if( it->first < lowest_level ) {
-        lowest_level = it->first;
-      }
-      
-      if( it->first > highest_level ) {
-        highest_level = it->first;
-      }
-          
-      ++it;
-    }
-  }
-  
-  /* Doing zero expansion */
-  
-  if( zero_expansion ) {
-    if( 0. < lowest_level ) {
-      for( double index = 0. ; index < lowest_level ; ++index ) {
-        init_hist[ index ] = 0;
-      }
-    
-      lowest_level = 0.;
-    } else if( 0. > highest_level ) {
-      for( double index = highest_level + 1. ; index < 1. ; ++index ) {
-        init_hist[ index ] = 0;
-      }
-      
-      std::map< double, unsigned int >::iterator it_end = init_hist.end();
-      --it_end;
-    
-      highest_level = it_end->first;
-    }
-  }
-  
-  /* Building ordered histogram */
-  
-  {
-    double index = 0;
-    
-    for( index = lowest_level ; index <= highest_level ; ++index ) {
-      operator[]( index ) = 0;  
-    }
-  
-    std::map< double, unsigned int >::iterator it = init_hist.begin();
-    std::map< double, unsigned int >::iterator it_end = init_hist.end();
-    
-    while( it != it_end ) {
-      operator[]( it->first ) = it->second;
-    
-      ++it;
-    }
-  }
-
-  return true;
-}
-
-
-bool TePDIHistogram::Set8BitH(
-  const TePDITypes::TePDIRasterPtrType& in_raster,
-  unsigned int band,
-  bool zero_expansion,
-  TeStrategicIterator iterstrat,
-  const TeSharedPtr< TePolygonSet>& polsetptr )
-{
-  TEAGN_DEBUG_CONDITION( in_raster.isActive(),
-    "Inactive raster pointer" );
-  TEAGN_DEBUG_CONDITION( 
-    in_raster->params().status_ != TeRasterParams::TeNotReady,
-    "Raster not ready to read" );
-  TEAGN_DEBUG_CONDITION( (int)band < in_raster->nBands(),
-    "Invalid band" );
-  TEAGN_DEBUG_CONDITION( ( ! TePDIUtils::IsFloatBand( in_raster, band ) ),
-    "Unable to build non-interpolated histogram from float pixels type" );
-  TEAGN_DEBUG_CONDITION( (
-    ( in_raster->params().dataType_[ band ] == TeUNSIGNEDCHAR ) ||
-    in_raster->params().dataType_[ band ] == TeCHAR ),
-    "Invalid pixel data type" );
-    
-  TePDIHMapSpec::clear();
-
-//  unsigned int in_lines_number = in_raster->params().nlines_;
-//  unsigned int in_columns_number = in_raster->params().ncols_;
-  const unsigned long int progress_steps = 
-    getProgressSteps( polsetptr, in_raster->params().resy_ );    
-    
-  /* Defining level offset based on data bype */
-  
-  unsigned int level_offset = 0;
-  
-  if( in_raster->params().dataType_[ band ] == TeCHAR ) {
-    level_offset = 127; /*( 256 / 2 ) - 1 */
-  }
-    
-  /* Building histogram */
-  
-  unsigned int init_hist[ 256 ];
-  unsigned int hist_index = 0;
-  
-  for( hist_index = 0 ; hist_index < 256 ; ++hist_index ) {
-    init_hist[ hist_index ] = 0;
-  }
-  
-  /* Analysing raster */
-  
-  {
-    TePDIPIManager progress( "Generating histogram", progress_steps, 
-      progress_int_enabled_ );
-    int int_pixel_value = 0;
-  
-    double current_raster_level = 0;
-    TeRaster::iteratorPoly input_raster_it;
-    std::map< double, unsigned int >::iterator it;
-    TeRaster& input_raster_ref = *in_raster;
-    
-    unsigned int curr_line = 0;
-    unsigned int curr_col = 0;
-    unsigned int last_line = 0;    
-    
-    for( unsigned int local_polset_index = 0 ; 
-      local_polset_index < polsetptr->size() ; 
-      ++local_polset_index ) {
-      
-      input_raster_it = input_raster_ref.begin( 
-        (*polsetptr)[ local_polset_index ], iterstrat, 0 );
-      
-      while( ! input_raster_it.end() ) {
-        curr_line = input_raster_it.currentLine();
-        curr_col = input_raster_it.currentColumn();
-        
-        if( input_raster_ref.getElement( curr_col, curr_line, 
-          current_raster_level, band ) ) 
-        {
-          int_pixel_value = ( int ) current_raster_level;
-          
-          TEAGN_DEBUG_CONDITION( ( int_pixel_value + level_offset ) < 256,
-            "Invalid histogram position" )
-            
-          ++( init_hist[ int_pixel_value + level_offset ] );
-        }
-        
-        if( curr_line != last_line ) {
-          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-            "Canceled by the user" );
-          
-          last_line = curr_line;
-        }
-        
-        ++input_raster_it;
-      }
-    }  
-  }  
- 
-  
-  /* Finding the lowest end highest level indexes */
-
-  unsigned int lowest_index = 0;
-  unsigned int highest_index = 255;
-  
-  for( hist_index = 0 ; hist_index < 256 ; ++hist_index ) {
-    if( init_hist[ hist_index ] != 0 ) {
-      lowest_index = hist_index;
-      break;
-    }
-  }
-  for( hist_index = 0 ; hist_index < 256 ; ++hist_index ) {  
-    if( init_hist[ 255 - hist_index ] != 0 ) {
-      highest_index = 255 - hist_index;
-      break;
-    }
-  }
-  
-  if( zero_expansion ) {
-    if( in_raster->params().dataType_[ band ] == TeUNSIGNEDCHAR ) {
-      lowest_index = 0;
-    } else {
-      if( lowest_index > level_offset ) {
-        lowest_index = level_offset;
-      } else if( highest_index < level_offset ) {
-        highest_index = level_offset;
-      }
-    }
-  }
-  
-  /* Building ordered histogram */
-  
-  for( hist_index = lowest_index; hist_index <= highest_index ; 
-       ++hist_index ) {
-       
-    operator[]( ( (double)hist_index ) - ( (double)level_offset ) ) = 
-      init_hist[ hist_index ];
-  }
-  
-  return true;
-}
-
-
-bool TePDIHistogram::Set16BitH(
-  const TePDITypes::TePDIRasterPtrType& in_raster,
-  unsigned int band,
-  bool zero_expansion,
-  TeStrategicIterator iterstrat,
-  const TeSharedPtr< TePolygonSet>& polsetptr )
-{
-  TEAGN_DEBUG_CONDITION( in_raster.isActive(),
-    "Inactive raster pointer" );
-  TEAGN_DEBUG_CONDITION( 
-    in_raster->params().status_ != TeRasterParams::TeNotReady,
-    "Raster not ready to read" );
-  TEAGN_DEBUG_CONDITION( (int)band < in_raster->nBands(),
-    "Invalid band" );
-  TEAGN_DEBUG_CONDITION( ( ! TePDIUtils::IsFloatBand( in_raster, band ) ),
-    "Unable to build non-interpolated histogram from float pixels type" );
-  TEAGN_DEBUG_CONDITION( (
-    ( in_raster->params().dataType_[ band ] == TeSHORT ) ||
-    ( in_raster->params().dataType_[ band ] == TeUNSIGNEDSHORT ) ),
-    "Invalid pixel data type" );
-    
-  TePDIHMapSpec::clear();
-
-//  unsigned int in_lines_number = in_raster->params().nlines_;
-//  unsigned int in_columns_number = in_raster->params().ncols_;
-  const unsigned long int progress_steps = 
-    getProgressSteps( polsetptr, in_raster->params().resy_ );   
-  
-  /* Dummy use check */
-  
-  bool in_raster_donot_uses_dummy = ! in_raster->params().useDummy_;
-  double in_raster_dummy = 0;
-  
-  if( ! in_raster_donot_uses_dummy ) {
-    in_raster_dummy = in_raster->params().dummy_[ band ];
-  }     
-    
-  /* Defining level offset base on data bype */
-  
-  unsigned int level_offset = 0;
-  
-  if( in_raster->params().dataType_[ band ] == TeSHORT ) {
-    level_offset = 32767; /*( 256 / 2 ) - 1 */
-  }    
-    
-  /* Building histogram */
-  
-  unsigned int init_hist[ 65536 ];
-  unsigned int hist_index = 0;
-  
-  for( hist_index = 0 ; hist_index < 65536 ; ++hist_index ) {
-    init_hist[ hist_index ] = 0;
-  }
-  
-  /* Analysing raster */
-  
-  {
-    TePDIPIManager progress( "Generating histogram", progress_steps,
-      progress_int_enabled_ );
-    int int_pixel_value = 0;
-    
-    unsigned int curr_line = 0;
-    unsigned int last_line = 0;    
-  
-    double current_raster_level = 0;
-    TeRaster::iteratorPoly input_raster_it;
-    std::map< double, unsigned int >::iterator it;
-    
-    for( unsigned int local_polset_index = 0 ; 
-      local_polset_index < polsetptr->size() ; 
-      ++local_polset_index ) {
-      
-      input_raster_it = in_raster->begin( 
-        (*polsetptr)[ local_polset_index ], iterstrat, 0 );
-      
-      while( ! input_raster_it.end() ) {
-        current_raster_level = input_raster_it*( band );
-        curr_line = input_raster_it.currentLine();
-        
-        if( in_raster_donot_uses_dummy || 
-          ( current_raster_level != in_raster_dummy ) ) {
-          
-          int_pixel_value = ( int ) current_raster_level;
-            
-          init_hist[ int_pixel_value + level_offset ] = init_hist[ 
-            int_pixel_value + level_offset ] + 1;  
-        }
-        
-        if( curr_line != last_line ) {
-          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-            "Canceled by the user" );
-          
-          last_line = curr_line;
-        }
-        
-        ++input_raster_it;
-      }
-    }  
-  }    
-  
-  /* Finding the lowest end highest level indexes */
-
-  unsigned int lowest_index = 0;
-  unsigned int highest_index = 65535;
-  
-  for( hist_index = 0 ; hist_index < 65536 ; ++hist_index ) {
-    if( init_hist[ hist_index ] != 0 ) {
-      lowest_index = hist_index;
-      break;
-    }
-  }
-  for( hist_index = 0 ; hist_index < 65536 ; ++hist_index ) {  
-    if( init_hist[ 65535 - hist_index ] != 0 ) {
-      highest_index = 65535 - hist_index;
-      break;
-    }
-  }
-  
-  if( zero_expansion ) {
-    if( in_raster->params().dataType_[ band ] == TeUNSIGNEDSHORT ) {
-      lowest_index = 0;
-    } else {
-      if( lowest_index > level_offset ) {
-        lowest_index = level_offset;
-      } else if( highest_index < level_offset ) {
-        highest_index = level_offset;
-      }
-    }
-  }
-  
-  /* Building ordered histogram */
-  
-  for( hist_index = lowest_index; hist_index <= highest_index ; 
-       ++hist_index ) {
-       
-    operator[]( ( (double)hist_index ) - ( (double)level_offset ) ) = 
-      init_hist[ hist_index ];
-  }
-  
-  return true;  
-}
-
-
-unsigned long int TePDIHistogram::getProgressSteps( 
-  const TeSharedPtr< TePolygonSet>& polsetptr, double resy )
-{
-  unsigned long int steps = 0;
-
-  for( unsigned int ps_index = 0 ; ps_index < polsetptr->size() ; 
-    ++ps_index ) {
-    
-    const TeBox& polbox( (*polsetptr)[ ps_index ].box() );
-    steps += ( unsigned long int)ABS( ( polbox.y2() - polbox.y1() ) / resy );
-  }
-  
-  return steps;
-}
-
+#include "TePDIHistogram.hpp"
+
+#include "TePDIUtils.hpp"
+#include "TePDIMatrix.hpp"
+#include <TeAgnostic.h>
+#include "TePDIPIManager.hpp"
+
+#include <TeUtils.h>
+#include <TePrecision.h>
+
+#include <float.h>
+#include <limits.h>
+
+TePDIHistogram::TePDIHistogram()
+{
+  init();
+}
+
+
+TePDIHistogram::TePDIHistogram( const TePDIHistogram& external )
+: TePDIHMapSpec()
+{
+  init();
+  
+  operator=( external );
+}
+
+
+TePDIHistogram::TePDIHistogram( 
+  const std::map< double, unsigned int >& external )
+{
+  init();
+  
+  operator=( external );
+}
+
+
+TePDIHistogram::~TePDIHistogram()
+{
+}
+
+
+bool TePDIHistogram::SetH(
+  const TePDITypes::TePDIRasterPtrType& in_raster,
+  unsigned int band,
+  TeStrategicIterator iterstrat,
+  const TeSharedPtr< TePolygonSet>& polsetptr )
+{
+  TEAGN_DEBUG_CONDITION( in_raster.isActive(),
+    "Inactive raster pointer" );
+  TEAGN_DEBUG_CONDITION( 
+    in_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Raster not ready to read" );
+  TEAGN_DEBUG_CONDITION( (int)band < in_raster->nBands(),
+    "Invalid band" );
+  TEAGN_DEBUG_CONDITION( ( ! TePDIUtils::IsFloatBand( in_raster, band ) ),
+    "Unable to build non-interpolated histogram from float pixels type" );
+    
+  /* Optimization for 8 / 16 bit images */
+  
+  if( ( in_raster->params().dataType_[ band ] == TeUNSIGNEDCHAR ) ||
+    ( in_raster->params().dataType_[ band ] == TeCHAR ) ) {
+    return Set8BitH( in_raster, band, iterstrat, polsetptr );
+  } else if( ( in_raster->params().dataType_[ band ] == TeUNSIGNEDSHORT ) ||
+    ( in_raster->params().dataType_[ band ] == TeSHORT ) ) {
+    return Set16BitH( in_raster, band, iterstrat, polsetptr );
+  }
+  
+  TePDIHMapSpec::clear();
+  
+  const unsigned long int progress_steps = 
+    getProgressSteps( polsetptr, in_raster->params().resy_ );  
+
+  /* Dummy use check */
+  
+  bool in_raster_donot_uses_dummy = ! in_raster->params().useDummy_;
+  double in_raster_dummy = 0;
+  
+  if( ! in_raster_donot_uses_dummy ) {
+    in_raster_dummy = in_raster->params().dummy_[ band ];
+  }    
+    
+  /* Building ordered histogram */
+  
+  {
+    TePDIPIManager progress( "Generating histogram", 
+      progress_steps, progress_int_enabled_ );
+  
+    double current_raster_level = 0;
+    TeRaster::iteratorPoly input_raster_it;
+    std::map< double, unsigned int >::iterator it;
+    unsigned int curr_line = 0;
+    unsigned int last_line = 0;
+    
+    for( unsigned int local_polset_index = 0 ; 
+      local_polset_index < polsetptr->size() ; 
+      ++local_polset_index ) {
+      
+      input_raster_it = in_raster->begin( 
+        (*polsetptr)[ local_polset_index ], iterstrat, 0 );
+      
+      while( ! input_raster_it.end() ) 
+      {
+        curr_line = input_raster_it.currentLine();
+      
+        current_raster_level = input_raster_it*( band );
+        
+        if( in_raster_donot_uses_dummy || 
+          ( current_raster_level != in_raster_dummy ) ) 
+        {
+          ++( operator[]( current_raster_level ) );
+        }
+        
+        if( curr_line != last_line ) {
+          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+            "Canceled by the user" );
+          
+          last_line = curr_line;
+        }
+        
+        ++input_raster_it;
+      }
+    }  
+  }
+
+  return true;
+}
+
+
+bool TePDIHistogram::reset(
+  const TePDITypes::TePDIRasterPtrType& in_raster,
+  unsigned int band,
+  unsigned int levels,
+  TeStrategicIterator iterstrat,
+  const TeSharedPtr< TePolygonSet>& polsetptr )
+{
+  TEAGN_TRUE_OR_RETURN( in_raster.isActive(),
+    "Inactive raster pointer" );
+  TEAGN_TRUE_OR_RETURN( 
+    in_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Raster not ready to read" );
+  TEAGN_TRUE_OR_RETURN( (int)band < in_raster->nBands(),
+    "Invalid band" );
+    
+  /* Building the local restriction polygon set */
+  
+  TeSharedPtr< TePolygonSet> local_polsetptr;
+    
+  if( polsetptr.isActive() ) {
+    local_polsetptr = polsetptr;
+  } else {
+    local_polsetptr.reset( new TePolygonSet );
+    
+    TeBox rasterbox( in_raster->params().boundingBox() );
+    
+    local_polsetptr->add( polygonFromBox( rasterbox ) );
+  }
+  
+  /* For palette based rasters another algorithm is required */
+  
+  if( in_raster->params().photometric_[ band ] == 
+    TeRasterParams::TePallete ) {
+   
+    return SetPaletteBasedH( in_raster, band, iterstrat, local_polsetptr ); 
+  }
+    
+  /* Optimization - If the raster does not contains float pixels for 
+     this band, then we do not need an interpolated histogram */
+    
+  if( ( ! TePDIUtils::IsFloatBand( in_raster, band ) ) &&
+      ( levels == 0 ) ) {
+      
+    return SetH( in_raster, band, iterstrat, local_polsetptr );
+  }
+  
+  TePDIHMapSpec::clear();
+  
+  const unsigned long int progress_steps = 
+    getProgressSteps( local_polsetptr, in_raster->params().resy_ );
+  
+  /* Dummy use check */
+  
+  bool in_raster_donot_uses_dummy = ! in_raster->params().useDummy_;
+  double in_raster_dummy = 0;
+  
+  if( ! in_raster_donot_uses_dummy ) {
+    in_raster_dummy = in_raster->params().dummy_[ band ];
+  }
+  
+  /* Finding the lowest end highest level */
+  
+  double lowest_level = 0;
+  double highest_level = 0;  
+    
+  if ( in_raster->params().decoderIdentifier_ == "DB" ) {
+    lowest_level = in_raster->params().vmin_[ band ];
+    highest_level = in_raster->params().vmax_[ band ];
+
+    // Return if there is no pixel data to read 
+
+    if( in_raster->params().useDummy_ && ( lowest_level == in_raster_dummy ) &&
+      ( highest_level == in_raster_dummy ) )
+    {
+      return true;
+    }
+  } else {
+    lowest_level = DBL_MAX;
+    highest_level = ( -1.0 ) * DBL_MAX;  
+
+    bool lh_levels_set = false; // lowest_level and highest_level values set
+    
+    TeRaster::iteratorPoly input_raster_it;
+    TePDIPIManager progress( "Finding histogram range", progress_steps, 
+      progress_int_enabled_ );
+    double current_raster_level = 0;
+    unsigned int curr_line = 0;
+    unsigned int last_line = 0;    
+    
+    for( unsigned int local_polset_index = 0 ; 
+      local_polset_index < local_polsetptr->size() ; 
+      ++local_polset_index ) {
+      
+      input_raster_it = in_raster->begin( 
+        (*local_polsetptr)[ local_polset_index ], iterstrat, 0 );
+      
+      while( ! input_raster_it.end() ) {
+        current_raster_level = input_raster_it*( band );
+        curr_line = input_raster_it.currentLine();
+        
+        if( in_raster_donot_uses_dummy || 
+          ( current_raster_level != in_raster_dummy ) ) {
+
+          lh_levels_set = true;
+
+          if( current_raster_level > highest_level ) {
+            highest_level = current_raster_level;
+          }
+          if( current_raster_level < lowest_level ) {
+            lowest_level = current_raster_level;
+          }
+        }
+        
+        if( curr_line != last_line ) {
+          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+            "Canceled by the user" );
+          
+          last_line = curr_line;
+        }
+        
+        ++input_raster_it;
+      }
+    }
+
+    // Return if no pixel data was read 
+
+    if( ! lh_levels_set )
+    {
+      return true;
+    }
+  }
+  
+  /* Calculating the histogram step and computed levels */
+
+  double step = 1;
+  unsigned int hist_computed_levels = 1;
+
+  if( highest_level != lowest_level )
+  {
+    if( levels == 0 ) {
+      /* Auto step feature */
+      TEAGN_TRUE_OR_RETURN( ( ( highest_level - lowest_level ) > 1.0 ),
+        "Histogram level range is too short for auto-step feature"
+        " lowest_level=" + Te2String( lowest_level ) + " highest_level=" +
+        Te2String( highest_level ) );
+  
+      hist_computed_levels = 1 +
+        ( unsigned int ) floor( highest_level - lowest_level );
+    } else {
+      hist_computed_levels = levels;
+    }
+  
+    TEAGN_TRUE_OR_RETURN( hist_computed_levels > 0,
+      "Invalid levels number" );
+  
+    step = ( highest_level - lowest_level ) /
+          ( (double)( hist_computed_levels - 1 ) );
+  }
+
+  /* Ordered Histogram buffer allocation */
+  
+  TePDIMatrix< double > hbuffer; /* line 0 - pixel level, 
+                                    line 1 - pixels count for that level */
+  TEAGN_TRUE_OR_RETURN( 
+    hbuffer.Reset( 2, hist_computed_levels, 
+    TePDIMatrix< double >::AutoMemPol ),
+    "Unable to create histogram internal buffer" );
+  {
+    hbuffer( 0, 0 ) = lowest_level;
+    hbuffer( 1, 0 ) = 0;
+        
+    for( unsigned int hbuffer_col = 1 ; 
+      ( hbuffer_col < hbuffer.GetColumns() ); 
+      ++hbuffer_col ) {
+    
+      hbuffer( 0, hbuffer_col ) = hbuffer( 0, hbuffer_col - 1 ) + step;
+      hbuffer( 1, hbuffer_col ) = 0;
+    }
+
+    // Fixing the last value precision
+
+    hbuffer( 0, hbuffer.GetColumns() - 1 ) = highest_level;
+  }
+  
+  /* Interpolated histogram generation */
+  
+  {
+    double current_raster_level = 0;
+    unsigned int found_index = 0;
+    
+    TePDIPIManager progress( "Generating interpolated histogram", 
+      progress_steps, progress_int_enabled_ );
+      
+    unsigned int curr_line = 0;
+    unsigned int last_line = 0;      
+
+    bool valid_pixel_found = false; // at least one valid pixel found
+    
+    for( unsigned int local_polset_index = 0 ; 
+      local_polset_index < local_polsetptr->size() ; 
+      ++local_polset_index ) {
+      
+      TeRaster::iteratorPoly input_raster_it = in_raster->begin( 
+        (*local_polsetptr)[ local_polset_index ], iterstrat, 0 );    
+    
+      while( ! input_raster_it.end() ) {
+        current_raster_level = input_raster_it*( band );
+        curr_line = input_raster_it.currentLine();
+        
+        if( in_raster_donot_uses_dummy || 
+          ( current_raster_level != in_raster_dummy ) ) {        
+
+          valid_pixel_found = true;
+
+          found_index = (unsigned int) TeRound( 
+            ( current_raster_level - lowest_level ) / step );          
+          
+          TEAGN_DEBUG_CONDITION( ( found_index < hist_computed_levels ),
+            "Invalid generated index position " + Te2String( found_index ) );
+        
+          hbuffer( 1, found_index ) = hbuffer( 1, found_index ) + 1;
+        }
+        
+        if( curr_line != last_line ) {
+          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+            "Canceled by the user" );
+          
+          last_line = curr_line;
+        }
+        
+        ++input_raster_it;
+      }
+    }
+
+    // Return if no valid pixel was read
+
+    if( ! valid_pixel_found )
+    {
+      return true;
+    }
+  }
+      
+  /* Transfering values from internal buffer to internal map */  
+  
+  for( unsigned int hbuffer_col = 0 ; hbuffer_col < hbuffer.GetColumns() ; 
+    ++hbuffer_col ) 
+  {
+    if( hbuffer( 1, hbuffer_col ) != 0 )
+    {
+      operator[]( hbuffer( 0, hbuffer_col ) ) = 
+        ( unsigned int ) hbuffer( 1, hbuffer_col );
+    }
+  }
+  
+  return true;
+}
+
+
+bool TePDIHistogram::hasFixedStep() const
+{
+  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
+  
+  const_iterator it = begin();
+  const_iterator it_end = end();
+  
+  std::vector< double > steps;
+  std::vector< double >::iterator steps_it;
+  std::vector< double >::iterator steps_it_end;
+  
+  double curr_step = 0;
+  double last_value = it->first;
+  bool step_found = false;
+  
+  ++it;
+  
+  while( it != it_end ) {
+    curr_step = it->first - last_value;
+    
+    steps_it = steps.begin();
+    steps_it_end = steps.end();
+    
+    step_found = false;
+    
+    while( steps_it != steps_it_end ) {
+      if( (*steps_it) == curr_step ) {
+        step_found = true;
+        break;
+      }
+      
+      ++steps_it;
+    }
+    
+    if( ! step_found ) {
+      steps.push_back( curr_step );
+    }
+    
+    last_value = it->first;
+    
+    ++it;
+  }
+  
+  return ( ( steps.size() <= 1 ) ? true : false );
+}
+
+
+bool TePDIHistogram::IsDiscrete() const
+{
+  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
+  
+  const_iterator it = begin();
+  const_iterator it_end = end();
+
+  while( it != it_end ) {
+    if( (it->first) != ( (double)TeRound(it->first) ) ) {
+      return false;
+    }
+    
+    ++it;
+  }
+  
+  return true;
+}
+
+
+bool TePDIHistogram::Discretize()
+{
+  TEAGN_TRUE_OR_RETURN( size() > 0, "Trying to use an empty histogram" );
+  TEAGN_TRUE_OR_RETURN( ( ( GetMaxLevel() - GetMinLevel() ) > 1 ),
+    "The current histogram range do not allow discretization" );
+
+  if( IsDiscrete() ) {
+    return true;
+  }
+  
+  TePDIPIManager progress( "Discretizing histogram...", size() * 2,
+    progress_int_enabled_ );
+
+  unsigned int progress_step = 0; 
+
+  iterator it = begin();
+  iterator it_end = end();
+
+  TePDIHistogram temp_hist;
+
+  while( it != it_end ) {
+    progress.Update( progress_step );
+    ++progress_step;  
+  
+    temp_hist[ TeRound( it->first ) ] = 0;
+
+    ++it;
+  }
+  
+  it = begin();
+  
+  while( it != it_end ) {
+    progress.Update( progress_step );
+    ++progress_step;  
+  
+    temp_hist[ TeRound( it->first ) ] += it->second;
+
+    ++it;
+  }
+
+  TePDIHMapSpec::clear();
+  
+  operator=( temp_hist );
+
+  progress.Toggle( false );
+
+  return true;
+}
+
+
+double TePDIHistogram::GetMinLevel() const
+{
+  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
+  
+  return begin()->first;
+}
+
+
+double TePDIHistogram::GetMaxLevel() const
+{
+  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
+  
+  const_iterator it = end();
+  --it;
+  
+  return it->first;
+}
+
+
+unsigned int TePDIHistogram::GetMinCount() const
+{
+  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
+  
+  const_iterator it = begin();
+  const_iterator it_end = end();
+  
+  unsigned int min_count = INT_MAX;
+
+  while( it != it_end ) {
+    if( (it->second) < min_count ) {
+      min_count = it->second;
+    }
+    
+    ++it;
+  }
+  
+  return min_count;  
+}
+
+
+unsigned int TePDIHistogram::GetMaxCount() const
+{
+  TEAGN_TRUE_OR_THROW( size() > 0, "Trying to use an empty histogram" );
+  
+  const_iterator it = begin();
+  const_iterator it_end = end();
+  
+  unsigned int max_count = 0;
+
+  while( it != it_end ) {
+    if( (it->second) > max_count ) {
+      max_count = it->second;
+    }
+    
+    ++it;
+  }
+  
+  return max_count;  
+}
+
+
+unsigned int TePDIHistogram::getTotalCount() const
+{
+  const_iterator it = begin();
+  const_iterator it_end = end();
+  
+  unsigned int total_count = 0;
+
+  while( it != it_end ) {
+    total_count += it->second;
+    
+    ++it;
+  }
+  
+  return total_count;  
+}
+
+
+void TePDIHistogram::clear()
+{
+  TePDIHMapSpec::clear();
+  init();
+}
+
+
+const TePDIHistogram& TePDIHistogram::operator=( 
+  const TePDIHistogram& external )
+{
+  clear();
+  
+  TePDIHMapSpec::operator=( external );
+
+  return *this;
+}
+
+
+const TePDIHistogram& TePDIHistogram::operator=( 
+  const std::map< double, unsigned int >& external )
+{
+  clear();
+  
+  std::map< double, unsigned int >::const_iterator ext_it = external.begin();
+  std::map< double, unsigned int >::const_iterator ext_it_end = 
+    external.end();
+    
+  if( ext_it != ext_it_end ) {
+    /* Verifying if the external histogram has floating point values 
+       and guessing min and max */
+    
+    bool has_floating_point_values = false;
+    
+    const double min = ext_it->first;
+      
+    while( ext_it != ext_it_end ) {
+      if( ext_it->first != TeRound( ext_it->first ) ) {
+        has_floating_point_values = true;
+      }
+      
+      ++ext_it;
+    }
+    
+    --ext_it;
+    const double max = ext_it->first;
+    
+    if( has_floating_point_values ) {
+      /* building primary interpolated histogram */
+    
+      double step_size = ( max - min ) / ( (double)external.size() - 1 );
+      
+      for( unsigned int step = 0 ; step < external.size() ; ++step ) {
+        operator[]( ( (double)step ) * step_size ) = 0;
+      }
+      
+      /* Interpolating values */
+      
+      ext_it = external.begin();
+      TePDIHistogram::iterator hist_it;
+      TePDIHistogram::iterator hist_it_aux;
+      double left_value = 0;
+      double right_value = 0;
+      double curr_value = 0;
+      
+      while( ext_it != ext_it_end ) {
+        curr_value = ext_it->first;
+      
+        hist_it = find( curr_value );
+        
+        if( hist_it == end() ) {
+          hist_it = upper_bound( curr_value );
+          
+          right_value = hist_it->first;
+          
+          hist_it_aux = hist_it;
+          --hist_it_aux;
+          left_value = hist_it_aux->first;
+          
+          if( ( right_value - curr_value ) > ( curr_value - left_value ) ) {
+            hist_it_aux->second += ext_it->second;
+          } else {
+            hist_it->second += ext_it->second;
+          }
+        } else {
+          hist_it->second += ext_it->second;
+        }
+        
+        ++ext_it;
+      }
+    } else {
+      /* Building discrete histogram */
+      
+      unsigned int min_ui = ( (unsigned int) min );
+      unsigned int max_ui = ( (unsigned int)max );
+      
+      unsigned int steps = 1 + max_ui - min_ui;
+      
+      if( steps == 1 ) {
+        operator[]( external.begin()->first ) = external.begin()->second;
+      } else {
+        for( unsigned int level = min_ui ; level <= max_ui ; ++level ) {
+          ext_it = external.find( (double)level );
+          
+          if( ext_it != ext_it_end ) {
+            operator[]( (double)level ) = ext_it->second;
+          } else {
+            operator[]( (double)level ) = 0;  
+          }
+        }
+      }
+    }
+  }
+  
+  return *this;
+}
+
+bool TePDIHistogram::operator==( const TePDIHistogram& external ) const
+{
+  if( size() == external.size() )
+  {
+    const_iterator myIt = begin();
+    const_iterator myIt_end = end();
+    const_iterator extIt = external.begin();
+    
+    while( myIt != myIt_end )
+    {
+      if( ( myIt->first != extIt->first ) || ( myIt->second != 
+        extIt->second ) )
+      {
+        return false;
+      }
+      
+      ++extIt;
+      ++myIt;
+    }
+    
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+unsigned int TePDIHistogram::size() const
+{
+  return (unsigned int)TePDIHMapSpec::size();
+}
+
+std::string TePDIHistogram::toString() const
+{
+  std::string outStr;
+  
+  const_iterator it = begin();
+  const_iterator it_end = end();
+  
+  while( it != it_end ) 
+  {
+    outStr.append( "[" + Te2String( it->first, 2 ) + "->" +
+      Te2String( it->second ) + "]" );
+    
+    ++it;
+  }
+  
+  return outStr;
+}
+
+void TePDIHistogram::init()
+{
+  progress_int_enabled_ = true;
+}
+
+
+void TePDIHistogram::ToggleProgressInt( bool enabled )
+{
+  progress_int_enabled_ = enabled;
+}
+
+
+bool TePDIHistogram::SetPaletteBasedH(
+  const TePDITypes::TePDIRasterPtrType& in_raster,
+  unsigned int band,
+  TeStrategicIterator iterstrat,
+  const TeSharedPtr< TePolygonSet>& polsetptr )
+{
+  TEAGN_DEBUG_CONDITION( in_raster.isActive(),
+    "Inactive raster pointer" );
+  TEAGN_DEBUG_CONDITION( 
+    in_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Raster not ready to read" );
+  TEAGN_DEBUG_CONDITION( ( (int)band < in_raster->nBands() ),
+    "Invalid band" );
+
+  TEAGN_TRUE_OR_RETURN( ( band < 3 ), "Invalid band" );
+  TEAGN_TRUE_OR_RETURN( (
+    ( in_raster->params().dataType_[ band ] == TeUNSIGNEDCHAR ) ||
+    ( in_raster->params().dataType_[ band ] == TeUNSIGNEDSHORT ) ||
+    ( in_raster->params().dataType_[ band ] == TeUNSIGNEDLONG ) ),
+    "Invalid pixel data type" );
+  TEAGN_TRUE_OR_RETURN( ( in_raster->params().photometric_[ band ] == 
+    TeRasterParams::TePallete ), "Incorrect photometric" )
+    
+  TePDIHMapSpec::clear();
+
+  const unsigned long int progress_steps = 
+    getProgressSteps( polsetptr, in_raster->params().resy_ );    
+
+  /* Dummy use check */
+  
+  bool in_raster_donot_uses_dummy = ! in_raster->params().useDummy_;
+  double in_raster_dummy = 0;
+  
+  if( ! in_raster_donot_uses_dummy ) {
+    in_raster_dummy = in_raster->params().dummy_[ band ];
+  }
+  
+  /* Defining the current lut pointer */
+  
+  vector< unsigned short >* lut_ptr = 0;
+  
+  if( band == 0 ) {
+    lut_ptr = &( in_raster->params().lutr_ );
+  } else if( band == 1 ) {
+    lut_ptr = &( in_raster->params().lutg_ );
+  } else {
+    lut_ptr = &( in_raster->params().lutb_ );
+  }
+    
+  /* Building ordered histogram */
+  
+  {
+    TePDIPIManager progress( "Generating histogram", 
+      progress_steps, progress_int_enabled_ );
+  
+    double current_lut_index = 0;
+    unsigned short current_raster_level = 0;
+    TeRaster::iteratorPoly input_raster_it;
+    unsigned int curr_line = 0;
+    unsigned int last_line = 0;
+    
+    for( unsigned int local_polset_index = 0 ; 
+      local_polset_index < polsetptr->size() ; 
+      ++local_polset_index ) {
+      
+      input_raster_it = in_raster->begin( 
+        (*polsetptr)[ local_polset_index ], iterstrat, 0 );
+      
+      while( ! input_raster_it.end() ) {
+        curr_line = input_raster_it.currentLine();
+      
+        current_lut_index = input_raster_it*( band );
+        
+        if( in_raster_donot_uses_dummy || 
+          ( current_lut_index != in_raster_dummy ) ) {
+          
+          TEAGN_DEBUG_CONDITION( ( ( ( unsigned long int )current_lut_index ) 
+            < lut_ptr->size() ), "Invalid lut index" )
+          
+          current_raster_level = (*lut_ptr)[ ( unsigned long int )
+            current_lut_index ];
+            
+          ++( operator[]( current_raster_level ) );
+
+        }
+        
+        if( curr_line != last_line ) {
+          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+            "Canceled by the user" );
+          
+          last_line = curr_line;
+        }
+        
+        ++input_raster_it;
+      }
+    }  
+  }
+
+  return true;
+}
+
+
+bool TePDIHistogram::Set8BitH(
+  const TePDITypes::TePDIRasterPtrType& in_raster,
+  unsigned int band,
+  TeStrategicIterator iterstrat,
+  const TeSharedPtr< TePolygonSet>& polsetptr )
+{
+  TEAGN_DEBUG_CONDITION( in_raster.isActive(),
+    "Inactive raster pointer" );
+  TEAGN_DEBUG_CONDITION( 
+    in_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Raster not ready to read" );
+  TEAGN_DEBUG_CONDITION( (int)band < in_raster->nBands(),
+    "Invalid band" );
+  TEAGN_DEBUG_CONDITION( ( ! TePDIUtils::IsFloatBand( in_raster, band ) ),
+    "Unable to build non-interpolated histogram from float pixels type" );
+  TEAGN_DEBUG_CONDITION( (
+    ( in_raster->params().dataType_[ band ] == TeUNSIGNEDCHAR ) ||
+    in_raster->params().dataType_[ band ] == TeCHAR ),
+    "Invalid pixel data type" );
+    
+  TePDIHMapSpec::clear();
+
+//  unsigned int in_lines_number = in_raster->params().nlines_;
+//  unsigned int in_columns_number = in_raster->params().ncols_;
+  const unsigned long int progress_steps = 
+    getProgressSteps( polsetptr, in_raster->params().resy_ );    
+    
+  /* Defining level offset based on data bype */
+  
+  unsigned int level_offset = 0;
+  
+  if( in_raster->params().dataType_[ band ] == TeCHAR ) {
+    level_offset = 127; /*( 256 / 2 ) - 1 */
+  }
+    
+  /* Building histogram */
+  
+  unsigned int init_hist[ 256 ];
+  unsigned int hist_index = 0;
+  
+  for( hist_index = 0 ; hist_index < 256 ; ++hist_index ) {
+    init_hist[ hist_index ] = 0;
+  }
+  
+  /* Analysing raster */
+  
+  {
+    TePDIPIManager progress( "Generating histogram", progress_steps, 
+      progress_int_enabled_ );
+    int int_pixel_value = 0;
+  
+    double current_raster_level = 0;
+    TeRaster::iteratorPoly input_raster_it;
+    std::map< double, unsigned int >::iterator it;
+    TeRaster& input_raster_ref = *in_raster;
+    
+    unsigned int curr_line = 0;
+    unsigned int curr_col = 0;
+    unsigned int last_line = 0;    
+    
+    for( unsigned int local_polset_index = 0 ; 
+      local_polset_index < polsetptr->size() ; 
+      ++local_polset_index ) {
+      
+      input_raster_it = input_raster_ref.begin( 
+        (*polsetptr)[ local_polset_index ], iterstrat, 0 );
+      
+      while( ! input_raster_it.end() ) {
+        curr_line = input_raster_it.currentLine();
+        curr_col = input_raster_it.currentColumn();
+        
+        if( input_raster_ref.getElement( curr_col, curr_line, 
+          current_raster_level, band ) ) 
+        {
+          int_pixel_value = ( int ) current_raster_level;
+          
+          TEAGN_DEBUG_CONDITION( ( int_pixel_value + level_offset ) < 256,
+            "Invalid histogram position" )
+            
+          ++( init_hist[ int_pixel_value + level_offset ] );
+        }
+        
+        if( curr_line != last_line ) {
+          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+            "Canceled by the user" );
+          
+          last_line = curr_line;
+        }
+        
+        ++input_raster_it;
+      }
+    }  
+  }  
+ 
+  /* Building ordered histogram */
+  
+  for( hist_index = 0; hist_index < 256 ; 
+       ++hist_index ) 
+  {
+    if( init_hist[ hist_index ] )
+    {
+      operator[]( ( (double)hist_index ) - ( (double)level_offset ) ) = 
+        init_hist[ hist_index ];
+    }
+  }
+  
+  return true;
+}
+
+
+bool TePDIHistogram::Set16BitH(
+  const TePDITypes::TePDIRasterPtrType& in_raster,
+  unsigned int band,
+  TeStrategicIterator iterstrat,
+  const TeSharedPtr< TePolygonSet>& polsetptr )
+{
+  TEAGN_DEBUG_CONDITION( in_raster.isActive(),
+    "Inactive raster pointer" );
+  TEAGN_DEBUG_CONDITION( 
+    in_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Raster not ready to read" );
+  TEAGN_DEBUG_CONDITION( (int)band < in_raster->nBands(),
+    "Invalid band" );
+  TEAGN_DEBUG_CONDITION( ( ! TePDIUtils::IsFloatBand( in_raster, band ) ),
+    "Unable to build non-interpolated histogram from float pixels type" );
+  TEAGN_DEBUG_CONDITION( (
+    ( in_raster->params().dataType_[ band ] == TeSHORT ) ||
+    ( in_raster->params().dataType_[ band ] == TeUNSIGNEDSHORT ) ),
+    "Invalid pixel data type" );
+    
+  TePDIHMapSpec::clear();
+
+//  unsigned int in_lines_number = in_raster->params().nlines_;
+//  unsigned int in_columns_number = in_raster->params().ncols_;
+  const unsigned long int progress_steps = 
+    getProgressSteps( polsetptr, in_raster->params().resy_ );   
+  
+  /* Dummy use check */
+  
+  bool in_raster_donot_uses_dummy = ! in_raster->params().useDummy_;
+  double in_raster_dummy = 0;
+  
+  if( ! in_raster_donot_uses_dummy ) {
+    in_raster_dummy = in_raster->params().dummy_[ band ];
+  }     
+    
+  /* Defining level offset base on data bype */
+  
+  unsigned int level_offset = 0;
+  
+  if( in_raster->params().dataType_[ band ] == TeSHORT ) {
+    level_offset = 32767; /*( 256 / 2 ) - 1 */
+  }    
+    
+  /* Building histogram */
+  
+  unsigned int init_hist[ 65536 ];
+  unsigned int hist_index = 0;
+  
+  for( hist_index = 0 ; hist_index < 65536 ; ++hist_index ) {
+    init_hist[ hist_index ] = 0;
+  }
+  
+  /* Analysing raster */
+  
+  {
+    TePDIPIManager progress( "Generating histogram", progress_steps,
+      progress_int_enabled_ );
+    int int_pixel_value = 0;
+    
+    unsigned int curr_line = 0;
+    unsigned int last_line = 0;    
+  
+    double current_raster_level = 0;
+    TeRaster::iteratorPoly input_raster_it;
+    std::map< double, unsigned int >::iterator it;
+    
+    for( unsigned int local_polset_index = 0 ; 
+      local_polset_index < polsetptr->size() ; 
+      ++local_polset_index ) {
+      
+      input_raster_it = in_raster->begin( 
+        (*polsetptr)[ local_polset_index ], iterstrat, 0 );
+      
+      while( ! input_raster_it.end() ) {
+        current_raster_level = input_raster_it*( band );
+        curr_line = input_raster_it.currentLine();
+        
+        if( in_raster_donot_uses_dummy || 
+          ( current_raster_level != in_raster_dummy ) ) {
+          
+          int_pixel_value = ( int ) current_raster_level;
+            
+          init_hist[ int_pixel_value + level_offset ] = init_hist[ 
+            int_pixel_value + level_offset ] + 1;  
+        }
+        
+        if( curr_line != last_line ) {
+          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+            "Canceled by the user" );
+          
+          last_line = curr_line;
+        }
+        
+        ++input_raster_it;
+      }
+    }  
+  }    
+  
+  /* Building ordered histogram */
+  
+  for( hist_index = 0; hist_index < 65536 ; ++hist_index ) 
+  {
+    if( init_hist[ hist_index ] )
+    {
+      operator[]( ( (double)hist_index ) - ( (double)level_offset ) ) = 
+        init_hist[ hist_index ];
+    }
+  }
+  
+  return true;  
+}
+
+
+unsigned long int TePDIHistogram::getProgressSteps( 
+  const TeSharedPtr< TePolygonSet>& polsetptr, double resy )
+{
+  unsigned long int steps = 0;
+
+  for( unsigned int ps_index = 0 ; ps_index < polsetptr->size() ; 
+    ++ps_index ) {
+    
+    const TeBox& polbox( (*polsetptr)[ ps_index ].box() );
+    steps += ( unsigned long int)ABS( ( polbox.y2() - polbox.y1() ) / resy );
+  }
+  
+  return steps;
+}
+
diff --git a/src/terralib/image_processing/TePDIHistogram.hpp b/src/terralib/image_processing/TePDIHistogram.hpp
old mode 100755
new mode 100644
index 6dde636..af81f68
--- a/src/terralib/image_processing/TePDIHistogram.hpp
+++ b/src/terralib/image_processing/TePDIHistogram.hpp
@@ -1,329 +1,321 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIHISTOGRAM_HPP
-  #define TEPDIHISTOGRAM_HPP
-
-  #include "TePDITypes.hpp"
-  
-  #include <TeSharedPtr.h>
-  #include <TeGeometry.h>
-
-  #include <map>
-
-  /**
-   * @brief Base Histogram class (from std::map ).
-   * @ingroup PDIAux
-   */  
-  class PDI_DLL TePDIHMapSpec : public std::map< double, unsigned int > {};
-  
-  /**
-   * @brief This class deals with histograms and related tasks.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAux
-   */
-  class PDI_DLL TePDIHistogram : public TePDIHMapSpec {
-    protected :
-    
-     /**
-      * @brief Base Histogram class (from std::map ).
-      * @ingroup PDIAux
-      */     
-      class PDI_DLL TePolygonSetPointer : public TeSharedPtr< TePolygonSet> {};
-      
-    public :
-      /** @typedef TeSharedPtr< TePDIHistogram > pointer
-       * Type definition for a instance pointer. */
-      typedef TeSharedPtr< TePDIHistogram > pointer;
-      /** @typedef const TeSharedPtr< TePDIHistogram > const_pointer
-       * Type definition for a const instance pointer. */
-      typedef const TeSharedPtr< TePDIHistogram > const_pointer;
-  
-      //! const_iterator type definition
-      typedef TePDIHMapSpec::const_iterator const_iterator;      
-
-      //! iterator type definition
-      typedef TePDIHMapSpec::iterator iterator;      
-
-      /**
-       * @brief Default Constructor
-       *
-       */
-      TePDIHistogram();
-      
-      /**
-       * @brief Alternative constructor.
-       *
-       * @param external External histogram reference.
-       *
-       */
-      TePDIHistogram( const TePDIHistogram& external );      
-      
-      /**
-       * @brief Alternative constructor from std::map.
-       *
-       * @param external External map reference.
-       *
-       */
-      TePDIHistogram( const std::map< double, unsigned int >& external );
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIHistogram();
-
-      /**
-       * @brief Generates a level-ordered histogram ( fixed step ).
-       *
-       * @note If the input raster has float data, the histogram will be
-       * interpolated.
-       *
-       * @param in_raster Input raster.
-       * @param band Band number.
-       * @param levels The number of interpolated levels, and if set to zero,
-       * the number of levels will be automaticlly found by using
-       * level step with value one.
-       * @param zero_expansion If true, the histogram will be expanded
-       * until it contains value zero.
-       * @param iterstrat The raster iteration strategy (if you
-       * do not know what this is use TeBoxPixelIn"
-       * @param polsetptr The restriction polygon set.
-       * @return true if the histogram has been generated, false on error.
-       */
-      bool reset(
-        const TePDITypes::TePDIRasterPtrType& in_raster,
-        unsigned int band, unsigned int levels,
-        bool zero_expansion, 
-        TeStrategicIterator iterstrat,
-        const TeSharedPtr< TePolygonSet>& polsetptr = TePolygonSetPointer() );
-        
-      /**
-       * @brief Histogram discrete verification.
-       *
-       * @return true if the histogram has only discrete levels.
-       */
-      bool IsDiscrete() const;
-      
-      /**
-       * @brief Histogram fixed step verification.
-       *
-       * @return true if the histogram has fixed step.
-       */
-      bool hasFixedStep() const;      
-
-      /**
-       * @brief Round the histogram levels to the near integer generating a
-       * descrete ( fixed step ) histogram.
-       *
-       * @return True if the process was concluded successfully, false if not.
-       */
-      bool Discretize();
-
-      /**
-       * @brief Histogram minimum level.
-       *
-       * @return The histogram minimum level.
-       */
-      double GetMinLevel() const;
-
-      /**
-       * @brief Histogram maximum level.
-       *
-       * @return The histogram maximum level.
-       */
-      double GetMaxLevel() const;
-
-      /**
-       * @brief Histogram minimum count (frequency) value for all levels.
-       *
-       * @return The histogram minimum count value.
-       */
-      unsigned int GetMinCount() const;
-
-      /**
-       * @brief Histogram maximum count (frequency) value for all levels.
-       *
-       * @return The histogram maximum count value.
-       */
-      unsigned int GetMaxCount() const;
-      
-      /**
-       * @brief Histogram total count ( the sum of all frequencies ).
-       *
-       * @return The histogram total count
-       */
-      unsigned int getTotalCount() const;
-
-      /**
-       * @brief std::map::clear() overload.
-       *
-       */
-      void clear();
-      
-      /**
-       * @brief operator= overload.
-       *
-       */
-      const TePDIHistogram& operator=( const TePDIHistogram& external );      
-      
-      /**
-       * @brief operator= overload for simple std:maps.
-       *
-       */
-      const TePDIHistogram& operator=( 
-        const std::map< double, unsigned int >& external );
-      
-      /**
-       * @brief Enable / Disable the progress interface.
-       *
-       * @param enabled Flag to enable ( true - default ) or disable ( false ).
-       */      
-      void ToggleProgressInt( bool enabled );
-      
-       // operator== overload.
-      bool operator==( const TePDIHistogram& external ) const;
-      
-      /**
-       * @brief Returns the histogram size.
-       * @return Returns the histogram size.
-       */
-      unsigned int size() const;      
-
-    protected :
-
-      /**
-       * @brief Progress interface enabled status.
-       */
-      bool progress_int_enabled_;
-      
-      /**
-       * @brief Reset the internal variables with default values.
-       */
-      void init();      
-
-      /**
-       * @brief Generates a level-ordered histogram ( fixed step ) from
-       * not floating point data type rasters.
-       *
-       * @note No trows generated.
-       *
-       * @param in_raster Input raster.
-       * @param band Band number.
-       * @param zero_expansion If true, the histogram will be expanded
-       * until it contains value zero.
-       * @param iterstrat The raster iteration strategy (if you
-       * do not know what this is use TeBoxPixelIn"       
-       * @param polsetptr The restriction polygon set.
-       * @return true if the histogram has been generated, false on error.
-       */
-      bool SetH(
-        const TePDITypes::TePDIRasterPtrType& in_raster,
-        unsigned int band, bool zero_expansion,
-        TeStrategicIterator iterstrat,
-        const TeSharedPtr< TePolygonSet>& polsetptr );      
-      
-      /**
-       * @brief Generates a level-ordered histogram ( fixed step )for an 
-       * palette based raster.
-       *
-       * @note No trows generated.
-       *
-       * @param in_raster Input raster.
-       * @param band Band number.
-       * @param zero_expansion If true, the histogram will be expanded
-       * until it contains value zero.
-       * @param iterstrat The raster iteration strategy (if you
-       * do not know what this is use TeBoxPixelIn"        
-       * @param polsetptr The restriction polygon set.
-       * @return true if the histogram has been generated, false on error.
-       */
-      bool SetPaletteBasedH(
-        const TePDITypes::TePDIRasterPtrType& in_raster,
-        unsigned int band,
-        bool zero_expansion,
-        TeStrategicIterator iterstrat,
-        const TeSharedPtr< TePolygonSet>& polsetptr );
-        
-      /**
-       * @brief Generates a level-ordered histogram ( fixed step )for an 8 
-       * bit raster.
-       *
-       * @note No trows generated.
-       *
-       * @param in_raster Input raster.
-       * @param band Band number.
-       * @param zero_expansion If true, the histogram will be expanded
-       * until it contains value zero.
-       * @param iterstrat The raster iteration strategy (if you
-       * do not know what this is use TeBoxPixelIn"         
-       * @param polsetptr The restriction polygon set.
-       * @return true if the histogram has been generated, false on error.
-       */
-      bool Set8BitH(
-        const TePDITypes::TePDIRasterPtrType& in_raster,
-        unsigned int band,
-        bool zero_expansion,
-        TeStrategicIterator iterstrat,
-        const TeSharedPtr< TePolygonSet>& polsetptr );        
-        
-      /**
-       * @brief Generates a level-ordered histogram (fixed step) for an 
-       * 16 bit raster.
-       *
-       * @note No trows generated.
-       *
-       * @param in_raster Input raster.
-       * @param band Band number.
-       * @param zero_expansion If true, the histogram will be expanded
-       * until it contains value zero.
-       * @param iterstrat The raster iteration strategy (if you
-       * do not know what this is use TeBoxPixelIn"         
-       * @param polsetptr The restriction polygon set.
-       * @return true if the histogram has been generated, false on error.
-       */
-      bool Set16BitH(
-        const TePDITypes::TePDIRasterPtrType& in_raster,
-        unsigned int band,
-        bool zero_expansion,
-        TeStrategicIterator iterstrat,
-        const TeSharedPtr< TePolygonSet>& polsetptr );
-        
-      /**
-       * @brief Calculate the number of progress steps when using
-       * a polygon iterator over a raster for the supplied 
-       * polygon set.
-       *
-       * @param polsetptr The polygon set pointer.
-       * @param resy Y axis resolution.
-       */        
-      unsigned long int getProgressSteps( 
-        const TeSharedPtr< TePolygonSet>& polsetptr, double resy );
-    
-  };
-  
-/** @example TePDIHistogram_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDIHISTOGRAM_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIHISTOGRAM_HPP
+  #define TEPDIHISTOGRAM_HPP
+
+  #include "TePDITypes.hpp"
+  
+  #include <TeSharedPtr.h>
+  #include <TeGeometry.h>
+
+  #include <map>
+
+  /**
+   * @brief Base Histogram class (from std::map ).
+   * @ingroup PDIAux
+   */  
+  class PDI_DLL TePDIHMapSpec : public std::map< double, unsigned int > {};
+  
+  /**
+   * @class TePDIHistogram
+   * @brief This class deals with histograms and related tasks.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAux
+   */
+  class PDI_DLL TePDIHistogram : public TePDIHMapSpec {
+    protected :
+    
+     /**
+      * @brief Base Histogram class (from std::map ).
+      * @ingroup PDIAux
+      */     
+      class PDI_DLL TePolygonSetPointer : public TeSharedPtr< TePolygonSet> {};
+      
+    public :
+      /** @typedef TeSharedPtr< TePDIHistogram > pointer
+       * Type definition for a instance pointer. */
+      typedef TeSharedPtr< TePDIHistogram > pointer;
+      /** @typedef const TeSharedPtr< TePDIHistogram > const_pointer
+       * Type definition for a const instance pointer. */
+      typedef const TeSharedPtr< TePDIHistogram > const_pointer;
+  
+      //! const_iterator type definition
+      typedef TePDIHMapSpec::const_iterator const_iterator;      
+
+      //! iterator type definition
+      typedef TePDIHMapSpec::iterator iterator;      
+
+      /**
+       * @brief Default Constructor
+       *
+       */
+      TePDIHistogram();
+      
+      /**
+       * @brief Alternative constructor.
+       *
+       * @param external External histogram reference.
+       *
+       */
+      TePDIHistogram( const TePDIHistogram& external );      
+      
+      /**
+       * @brief Alternative constructor from std::map.
+       *
+       * @param external External map reference.
+       *
+       */
+      TePDIHistogram( const std::map< double, unsigned int >& external );
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIHistogram();
+
+      /**
+       * @brief Generates a level-ordered histogram ( fixed step ).
+       *
+       * @note If the input raster has float data, the histogram will be
+       * interpolated.
+       *
+       * @param in_raster Input raster.
+       * @param band Band number.
+       * @param levels The number of interpolated levels, and if set to zero,
+       * the number of levels will be automaticlly found by using
+       * level step with value one.
+       * @param iterstrat The raster iteration strategy (if you
+       * do not know what this is use TeBoxPixelIn"
+       * @param polsetptr The restriction polygon set.
+       * @return true if the histogram has been generated, false on error.
+       */
+      bool reset(
+        const TePDITypes::TePDIRasterPtrType& in_raster,
+        unsigned int band, unsigned int levels,
+        TeStrategicIterator iterstrat,
+        const TeSharedPtr< TePolygonSet>& polsetptr = TePolygonSetPointer() );
+        
+      /**
+       * @brief Histogram discrete verification.
+       *
+       * @return true if the histogram has only discrete levels.
+       */
+      bool IsDiscrete() const;
+      
+      /**
+       * @brief Histogram fixed step verification.
+       *
+       * @return true if the histogram has fixed step.
+       */
+      bool hasFixedStep() const;      
+
+      /**
+       * @brief Round the histogram levels to the near integer generating a
+       * descrete ( fixed step ) histogram.
+       *
+       * @return True if the process was concluded successfully, false if not.
+       */
+      bool Discretize();
+
+      /**
+       * @brief Histogram minimum level.
+       *
+       * @return The histogram minimum level.
+       */
+      double GetMinLevel() const;
+
+      /**
+       * @brief Histogram maximum level.
+       *
+       * @return The histogram maximum level.
+       */
+      double GetMaxLevel() const;
+
+      /**
+       * @brief Histogram minimum count (frequency) value for all levels.
+       *
+       * @return The histogram minimum count value.
+       */
+      unsigned int GetMinCount() const;
+
+      /**
+       * @brief Histogram maximum count (frequency) value for all levels.
+       *
+       * @return The histogram maximum count value.
+       */
+      unsigned int GetMaxCount() const;
+      
+      /**
+       * @brief Histogram total count ( the sum of all frequencies ).
+       *
+       * @return The histogram total count
+       */
+      unsigned int getTotalCount() const;
+
+      /**
+       * @brief std::map::clear() overload.
+       *
+       */
+      void clear();
+      
+      /**
+       * @brief operator= overload.
+       *
+       */
+      const TePDIHistogram& operator=( const TePDIHistogram& external );      
+      
+      /**
+       * @brief operator= overload for simple std:maps.
+       *
+       */
+      const TePDIHistogram& operator=( 
+        const std::map< double, unsigned int >& external );
+      
+      /**
+       * @brief Enable / Disable the progress interface.
+       *
+       * @param enabled Flag to enable ( true - default ) or disable ( false ).
+       */      
+      void ToggleProgressInt( bool enabled );
+      
+       // operator== overload.
+      bool operator==( const TePDIHistogram& external ) const;
+      
+      /**
+       * @brief Returns the histogram size.
+       * @return Returns the histogram size.
+       */
+      unsigned int size() const;      
+      
+      /**
+       * @brief Ouput histogram to string.
+       */      
+      std::string toString() const;
+
+    protected :
+
+      /**
+       * @brief Progress interface enabled status.
+       */
+      bool progress_int_enabled_;
+      
+      /**
+       * @brief Reset the internal variables with default values.
+       */
+      void init();      
+
+      /**
+       * @brief Generates a level-ordered histogram ( fixed step ) from
+       * not floating point data type rasters.
+       *
+       * @note No trows generated.
+       *
+       * @param in_raster Input raster.
+       * @param band Band number.
+       * @param iterstrat The raster iteration strategy (if you
+       * do not know what this is use TeBoxPixelIn"       
+       * @param polsetptr The restriction polygon set.
+       * @return true if the histogram has been generated, false on error.
+       */
+      bool SetH(
+        const TePDITypes::TePDIRasterPtrType& in_raster,
+        unsigned int band,
+        TeStrategicIterator iterstrat,
+        const TeSharedPtr< TePolygonSet>& polsetptr );      
+      
+      /**
+       * @brief Generates a level-ordered histogram ( fixed step )for an 
+       * palette based raster.
+       *
+       * @note No trows generated.
+       *
+       * @param in_raster Input raster.
+       * @param band Band number.
+       * @param iterstrat The raster iteration strategy (if you
+       * do not know what this is use TeBoxPixelIn"        
+       * @param polsetptr The restriction polygon set.
+       * @return true if the histogram has been generated, false on error.
+       */
+      bool SetPaletteBasedH(
+        const TePDITypes::TePDIRasterPtrType& in_raster,
+        unsigned int band,
+        TeStrategicIterator iterstrat,
+        const TeSharedPtr< TePolygonSet>& polsetptr );
+        
+      /**
+       * @brief Generates a level-ordered histogram ( fixed step )for an 8 
+       * bit raster.
+       *
+       * @note No trows generated.
+       *
+       * @param in_raster Input raster.
+       * @param band Band number.
+       * @param iterstrat The raster iteration strategy (if you
+       * do not know what this is use TeBoxPixelIn"         
+       * @param polsetptr The restriction polygon set.
+       * @return true if the histogram has been generated, false on error.
+       */
+      bool Set8BitH(
+        const TePDITypes::TePDIRasterPtrType& in_raster,
+        unsigned int band,
+        TeStrategicIterator iterstrat,
+        const TeSharedPtr< TePolygonSet>& polsetptr );        
+        
+      /**
+       * @brief Generates a level-ordered histogram (fixed step) for an 
+       * 16 bit raster.
+       *
+       * @note No trows generated.
+       *
+       * @param in_raster Input raster.
+       * @param band Band number.
+       * @param iterstrat The raster iteration strategy (if you
+       * do not know what this is use TeBoxPixelIn"         
+       * @param polsetptr The restriction polygon set.
+       * @return true if the histogram has been generated, false on error.
+       */
+      bool Set16BitH(
+        const TePDITypes::TePDIRasterPtrType& in_raster,
+        unsigned int band,
+        TeStrategicIterator iterstrat,
+        const TeSharedPtr< TePolygonSet>& polsetptr );
+        
+      /**
+       * @brief Calculate the number of progress steps when using
+       * a polygon iterator over a raster for the supplied 
+       * polygon set.
+       *
+       * @param polsetptr The polygon set pointer.
+       * @param resy Y axis resolution.
+       */        
+      unsigned long int getProgressSteps( 
+        const TeSharedPtr< TePolygonSet>& polsetptr, double resy );
+    
+  };
+  
+/** @example TePDIHistogram_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDIHISTOGRAM_HPP
diff --git a/src/terralib/image_processing/TePDIIHSFusion.cpp b/src/terralib/image_processing/TePDIIHSFusion.cpp
new file mode 100644
index 0000000..cb6765f
--- /dev/null
+++ b/src/terralib/image_processing/TePDIIHSFusion.cpp
@@ -0,0 +1,380 @@
+#include "TePDIIHSFusion.hpp"
+#include "TePDIUtils.hpp"
+#include "TePDIColorTransform.hpp"
+#include "TePDIStatistic.hpp"
+#include "TePDIContrast.hpp"
+
+
+TePDIIHSFusion::TePDIIHSFusion()
+{
+}
+
+
+TePDIIHSFusion::~TePDIIHSFusion()
+{
+}
+
+
+void TePDIIHSFusion::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDIIHSFusion::CheckParameters( const TePDIParameters& parameters ) const
+{
+  /* Checking input_raster1 */
+  
+  TePDITypes::TePDIRasterPtrType reference_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster", 
+    reference_raster ),
+    "Missing parameter: reference_raster" );
+  TEAGN_TRUE_OR_RETURN( reference_raster.isActive(),
+    "Invalid parameter: reference_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( reference_raster->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: reference_raster not ready" );
+    
+  /* Checking input_raster2 */
+  
+  TePDITypes::TePDIRasterVectorType lowres_rasters;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "lowres_rasters", lowres_rasters ),
+    "Missing parameter: lowres_rasters" );
+    
+  TEAGN_TRUE_OR_RETURN( ( lowres_rasters.size() == 3 ),
+    "Invalid number of lower resolution rasters" );    
+    
+  std::vector< int > lowres_channels;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "lowres_channels", lowres_channels ),
+    "Missing parameter: lowres_channels" );
+    
+  TEAGN_TRUE_OR_RETURN( ( lowres_channels.size() == 3 ), 
+    "Invalid number of resolution channels" );
+    
+  for( unsigned int index = 0 ; index < lowres_rasters.size() ; ++index ) {
+    TEAGN_TRUE_OR_RETURN( lowres_rasters[ index ].isActive(),
+      "Invalid parameter: raster " + 
+      Te2String( index ) + " inactive" );
+      
+    TEAGN_TRUE_OR_RETURN( 
+      lowres_rasters[ index ]->params().status_ != TeRasterParams::TeNotReady,
+      "Invalid parameter: raster " + 
+      Te2String( index ) + " not ready" );
+        
+            
+    TEAGN_TRUE_OR_RETURN( 
+      lowres_channels[ index ] >= 0, "Invalid channel number (" + 
+      Te2String( index ) + ")" );
+    TEAGN_TRUE_OR_RETURN( 
+      lowres_channels[ index ] < lowres_rasters[ index ]->nBands(), 
+      "Invalid channel number (" + 
+      Te2String( index ) + ")" );
+      
+    /* Checking photometric interpretation */
+    
+    TEAGN_TRUE_OR_RETURN( ( 
+      ( lowres_rasters[ index ]->params().photometric_[ 
+        lowres_channels[ index ] ] == TeRasterParams::TeRGB ) ||
+      ( lowres_rasters[ index ]->params().photometric_[ 
+        lowres_channels[ index ] ] == TeRasterParams::TeMultiBand ) ),
+      "Invalid parameter - rasters (invalid photometric "
+      "interpretation)" );      
+  }  
+
+  /* Checking output_raster */
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
+    output_raster ),
+    "Missing parameter: output_raster" );
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
+    "Invalid parameter: output_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );    
+    
+  /* Checking bands */    
+    
+  int reference_raster_band = 0;    
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster_band", 
+    reference_raster_band ), "Missing parameter : reference_raster_band" );
+  TEAGN_TRUE_OR_RETURN( ( reference_raster->nBands() > reference_raster_band ),
+    "Invalid parameter : reference_raster_band" );
+    
+  /* Checking photometric interpretation */
+  
+  TEAGN_TRUE_OR_RETURN( ( 
+    ( reference_raster->params().photometric_[ reference_raster_band ] == 
+      TeRasterParams::TeRGB ) ||
+    ( reference_raster->params().photometric_[ reference_raster_band ] == 
+      TeRasterParams::TeMultiBand ) ),
+  "Invalid parameter - reference_raster (invalid photometric interpretation)" );   
+
+  return true;
+}
+
+
+bool TePDIIHSFusion::RunImplementation()
+{
+  TePDITypes::TePDIRasterPtrType reference_raster;
+  params_.GetParameter( "reference_raster", reference_raster );
+
+  TePDITypes::TePDIRasterVectorType lowres_rasters;
+  params_.GetParameter( "lowres_rasters", lowres_rasters );
+    
+  std::vector< int > lowres_channels;
+  params_.GetParameter( "lowres_channels", lowres_channels );
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter( "output_raster", output_raster );
+    
+  int reference_raster_band = 0;    
+  params_.GetParameter( "reference_raster_band", reference_raster_band );
+  
+  TePDIInterpolator::InterpMethod interpol_method = 
+    TePDIInterpolator::BicubicMethod;
+  if( params_.CheckParameter<TePDIInterpolator::InterpMethod>( 
+    "interpol_method" ) )
+  {
+    params_.GetParameter( "interpol_method", interpol_method );
+  }
+  
+  /* Bringing lowres_rasters to reference_raster size */
+
+  TePDITypes::TePDIRasterVectorType input_rasters_ihs;
+
+  for( unsigned int index = 0 ; index < lowres_rasters.size() ; ++index ) {
+    
+	TeRaster& lowres_raster = *( lowres_rasters[ index ].nakedPointer() );
+	TePDITypes::TePDIRasterPtrType upsampled_raster;
+    
+	TeRasterParams upsampled_raster_params = lowres_raster.params();
+    upsampled_raster_params.setNLinesNColumns( 1, 1 );
+    
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( upsampled_raster,
+      upsampled_raster_params, TePDIUtils::TePDIUtilsAutoMemPol ),
+      "Unable create the new upsampled raster RGB raster" );
+      
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::resampleRasterByLinsCols(
+      lowres_rasters[ index ], 
+      upsampled_raster, 
+      (unsigned int)reference_raster->params().nlines_, 
+      (unsigned int)reference_raster->params().ncols_, 
+      progress_enabled_,
+      interpol_method), "Raster resample error" ); 
+
+	input_rasters_ihs.push_back(upsampled_raster);
+/*    
+TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( upsampled_raster,
+  "TePDIIHSFusion_upsampled_raster.tif" ), 
+  "GeoTIF generation error" );     
+*/      
+  }
+   
+  /* Generating the IHS raster */
+  
+  TePDITypes::TePDIRasterPtrType ihs_raster;
+  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( ihs_raster,
+    1, 10, 10, false, TeFLOAT, 0 ),
+    "Unable create the new ihs_raster raster RGB raster" );  
+    
+  double rgb_channels_min = 0;
+  double rgb_channels_max = 0;
+  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds( 
+    input_rasters_ihs[0],
+    0, rgb_channels_min, rgb_channels_max ),
+    "Unable to get channel range" )
+     
+  {
+    TePDIParameters rgb2ihs_params;
+    
+    rgb2ihs_params.SetParameter( "input_rasters", input_rasters_ihs );
+    
+    rgb2ihs_params.SetParameter( "input_channels", lowres_channels );
+    
+    TePDITypes::TePDIRasterVectorType output_rasters;
+    output_rasters.push_back( ihs_raster );
+    rgb2ihs_params.SetParameter( "output_rasters", output_rasters );
+    
+    rgb2ihs_params.SetParameter( "transf_type", TePDIColorTransform::Rgb2Ihs );  
+
+    rgb2ihs_params.SetParameter( "rgb_channels_min", rgb_channels_min );
+    rgb2ihs_params.SetParameter( "rgb_channels_max", rgb_channels_max );    
+    
+    TePDIColorTransform transform_instance;
+    TEAGN_TRUE_OR_RETURN( transform_instance.Reset( rgb2ihs_params ),
+      "Error in IHS parameters" )
+      
+    transform_instance.ToggleProgInt( progress_enabled_ );
+      
+    TEAGN_TRUE_OR_RETURN( transform_instance.Apply(), 
+      "Unable to build IHS color space" );
+  }
+  
+/*  
+TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( ihs_raster,
+  "TePDIIHSFusion_ihs_raster.tif" ), 
+  "GeoTIF generation error" );    
+*/
+
+  /* Free the anused raster */
+  for( unsigned int index = 0 ; index < lowres_rasters.size() ; ++index ) {
+    lowres_rasters[ index ].reset();
+  }
+  
+  /* Bring the reference raster to the mean and variance of
+     the I channel */
+  
+  TePDITypes::TePDIRasterPtrType ref_rast_contrast;
+  
+  {
+    {
+      /* Get stat params */
+      
+      double target_mean = 0;
+      double target_variance = 0;
+      double current_mean = 0;
+      double current_variance = 0; 
+      
+      {
+        TePDIParameters statparams;
+        
+        TePDITypes::TePDIRasterVectorType rasters;
+        rasters.push_back( ihs_raster );
+        rasters.push_back( reference_raster );
+        statparams.SetParameter( "rasters", rasters );
+        
+        std::vector< int > bands;
+        bands.push_back( 0 ); // IHS raster I band
+        bands.push_back( reference_raster_band ); // reference_raster band
+        statparams.SetParameter( "bands", bands );
+        
+        TePDIStatistic stat;
+        stat.ToggleProgInt( progress_enabled_ );
+        TEAGN_TRUE_OR_THROW( stat.Reset( statparams ),
+          "Invalid statistic algorithm parameters" )
+          
+        target_mean = stat.getMean( 0 );
+        target_variance = stat.getVariance( 0 );
+        current_mean = stat.getMean( 1 );
+        current_variance = stat.getVariance( 1 );        
+      }
+      
+      double gain = ( ( current_variance == 0.0 ) ? 1.0 :
+        sqrt( target_variance / current_variance ) );
+      double offset = target_mean - ( gain * current_mean );      
+
+      /* Applying contrast to the reference raster */
+      
+      TeRasterParams ref_rast_cont_params = reference_raster->params();
+      ref_rast_cont_params.nBands( 1 );
+      ref_rast_cont_params.setDataType( TeFLOAT, -1 );
+            
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( ref_rast_contrast,
+        ref_rast_cont_params, TePDIUtils::TePDIUtilsAutoMemPol ),
+        "Unable create the new reference raster (contrast)" ); 
+         
+      const unsigned int nLines = reference_raster->params().nlines_;
+      const unsigned int nCols = reference_raster->params().ncols_;
+      unsigned line = 0;
+      unsigned col = 0;
+      double curr_value = 0;
+      double new_value = 0;
+      TeRaster& reference_raster_ref = (*reference_raster);
+      TeRaster& ref_rast_contrast_ref = (*ref_rast_contrast);
+      
+      TePDIPIManager progress( "Applying contrast", nLines,
+        progress_enabled_ );      
+              
+      for( line = 0; line < nLines ; ++line )
+      {
+        for( col = 0; col < nCols ; ++col )
+        {
+          reference_raster_ref.getElement( col, line, curr_value, 
+            reference_raster_band );
+            
+          new_value = ( curr_value * gain ) + offset;
+          new_value = MAX( new_value, 0.0 );
+          new_value = MIN( new_value, 1.0 );
+            
+          TEAGN_TRUE_OR_THROW( ref_rast_contrast_ref.setElement( col, line, 
+            new_value, 0 ), "Error writing value" );            
+        }
+        
+        TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+          "Canceled by the user" );
+      }
+    }
+  }
+/*  
+TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( ref_rast_contrast,
+  "TePDIIHSFusion_ref_rast_contrast.tif" ), 
+  "GeoTIF generation error" );   
+*/    
+  /* Swapping reference_raster into ihs_raster I component */
+  {
+    const unsigned int lines_bound = ihs_raster->params().nlines_;
+    const unsigned int cols_bound = ihs_raster->params().ncols_;
+    unsigned int line = 0;
+    unsigned int col = 0;
+    TeRaster* inraster = ref_rast_contrast.nakedPointer();
+    TeRaster* outraster = ihs_raster.nakedPointer();
+    double value = 0;
+    
+    TePDIPIManager progress( "Swapping Intensity channel...", lines_bound,
+      progress_enabled_ );
+    
+    for( line = 0; line < lines_bound ; ++line ) {
+      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+    
+      for( col = 0; col < cols_bound ; ++col ) {
+        inraster->getElement( col, line, value, 0 );
+        
+        outraster->setElement( col, line, value, 0 );
+      }
+    }
+  }
+  
+/* 
+TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( ihs_raster,
+  "TePDIIHSFusion_ihs_raster_swapped.tif" ), 
+  "GeoTIF generation error" );     
+*/  
+
+  /* Switching back to RBG space */
+  {
+    TePDIParameters ihs2rgb_params;
+    
+    TePDITypes::TePDIRasterVectorType input_rasters;
+    input_rasters.push_back( ihs_raster );
+    input_rasters.push_back( ihs_raster );
+    input_rasters.push_back( ihs_raster );
+    ihs2rgb_params.SetParameter( "input_rasters", input_rasters );
+    
+    std::vector< int >input_channels;
+    input_channels.push_back( 0 );
+    input_channels.push_back( 1 );
+    input_channels.push_back( 2 );
+    ihs2rgb_params.SetParameter( "input_channels", input_channels );
+    
+    TePDITypes::TePDIRasterVectorType output_rasters;
+    output_rasters.push_back( output_raster );    
+    ihs2rgb_params.SetParameter( "output_rasters", output_rasters );
+    
+    ihs2rgb_params.SetParameter( "transf_type", TePDIColorTransform::Ihs2Rgb );  
+    
+    ihs2rgb_params.SetParameter( "rgb_channels_min", rgb_channels_min );
+    ihs2rgb_params.SetParameter( "rgb_channels_max", rgb_channels_max );
+    
+    TePDIColorTransform transform_instance;
+    TEAGN_TRUE_OR_RETURN( transform_instance.Reset( ihs2rgb_params ),
+      "Error in IHS parameters" )    
+    transform_instance.ToggleProgInt( progress_enabled_ );
+    TEAGN_TRUE_OR_RETURN( transform_instance.Apply(), 
+      "Unable to build RGB color space" );      
+  }
+   
+  return true;
+}
+
+
diff --git a/src/terralib/image_processing/TePDIIHSFusion.hpp b/src/terralib/image_processing/TePDIIHSFusion.hpp
new file mode 100644
index 0000000..9b4daaa
--- /dev/null
+++ b/src/terralib/image_processing/TePDIIHSFusion.hpp
@@ -0,0 +1,76 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIIHSFUSION_HPP
+  #define TEPDIIHSFUSION_HPP
+
+  #include "TePDIAlgorithm.hpp"
+
+  /**
+   * @class TePDIIHSFusion
+   * @brief This is the class for IHS fusion.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIFusionAlgorithms
+   *
+   * @note The required parameters are:
+   * @param reference_raster ( TePDITypes::TePDIRasterPtrType ) - 
+   *  Reference raster ( higher quality ).
+   * @param lowres_rasters( TePDITypes::TePDIRasterVectorType ) - 
+   * A vector of all used low resolution raster ( NOTE: When two or more bands
+   * from the same raster are used, this raster must be inserted 
+   * two or three times inside the vector.
+   * @param lowres_channels ( std::vector< int > ) - A vector of all used 
+   * low resolution raster rasters channels/bands.
+   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
+   * @param reference_raster_band ( int ) - The band to process from 
+   * reference_raster.
+   *
+   * @note The optional parameters are:
+   * @param interpol_method (TePDIInterpolator::InterpMethod) - Upsampling
+   * interpolation method (default:BicubicMethod);
+   *
+   * @example TePDIFusion_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIIHSFusion : public TePDIAlgorithm{
+  
+    public :
+      
+      TePDIIHSFusion();      
+
+      ~TePDIIHSFusion();
+
+      //Overloaded
+      bool CheckParameters( const TePDIParameters& parameters ) const;   
+            
+    protected :
+    
+      //Overloaded
+      void ResetState( const TePDIParameters& params );    
+     
+      //Overloaded
+      bool RunImplementation();      
+  
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDIIHSFusionSF.cpp b/src/terralib/image_processing/TePDIIHSFusionSF.cpp
deleted file mode 100755
index 472219e..0000000
--- a/src/terralib/image_processing/TePDIIHSFusionSF.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "TePDIIHSFusionSF.hpp"
-#include "TePDIIHSFusionStrategy.hpp"
-
-TePDIIHSFusionSF::TePDIIHSFusionSF()
-: TePDIStrategyFactory( std::string( "ihs" ) )
-{
-};
-
-
-TePDIIHSFusionSF::~TePDIIHSFusionSF()
-{
-};
-
-
-TePDIStrategy* TePDIIHSFusionSF::build ( const TePDIParameters& )
-{
-  TePDIStrategy* instance_ptr = new TePDIIHSFusionStrategy();
-  
-  return instance_ptr;
-}
-
diff --git a/src/terralib/image_processing/TePDIIHSFusionSF.hpp b/src/terralib/image_processing/TePDIIHSFusionSF.hpp
deleted file mode 100755
index 29b043d..0000000
--- a/src/terralib/image_processing/TePDIIHSFusionSF.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIIHSFUSIONSF_HPP
-  #define TEPDIIHSFUSIONSF_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIStrategyFactory.hpp"
-  #include "TePDIParameters.hpp"
-  #include "TePDIStrategy.hpp"
-  
-  /**
-   * @brief This is the class for IHS fusion strategy factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategiesFactories
-   */
-  class PDI_DLL TePDIIHSFusionSF : public TePDIStrategyFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIIHSFusionSF();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIIHSFusionSF();
-      
-    protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated strategy instance.
-       */
-      TePDIStrategy* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace
-  {  
-    static TePDIIHSFusionSF TePDIIHSFusionSF_instance;
-  };
-
-#endif
-
diff --git a/src/terralib/image_processing/TePDIIHSFusionStrategy.cpp b/src/terralib/image_processing/TePDIIHSFusionStrategy.cpp
deleted file mode 100755
index 3030334..0000000
--- a/src/terralib/image_processing/TePDIIHSFusionStrategy.cpp
+++ /dev/null
@@ -1,317 +0,0 @@
- 
-#include "TePDIIHSFusionStrategy.hpp"
-#include "TePDIUtils.hpp"
-#include <TeAgnostic.h>
-#include "TePDIColorTransform.hpp"
-#include "TePDIAlgorithmFactory.hpp"
-#include "TePDIPIManager.hpp"
-#include "TePDIStatistic.hpp"
-#include "TePDIContrast.hpp"
-
-#include <TeRasterRemap.h>
-
-
-TePDIIHSFusionStrategy::TePDIIHSFusionStrategy()
-{
-};      
-
-
-TePDIIHSFusionStrategy::~TePDIIHSFusionStrategy()
-{
-};
-
-
-bool TePDIIHSFusionStrategy::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking input_raster1 */
-  
-  TePDITypes::TePDIRasterPtrType reference_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster", 
-    reference_raster ),
-    "Missing parameter: reference_raster" );
-  TEAGN_TRUE_OR_RETURN( reference_raster.isActive(),
-    "Invalid parameter: reference_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( reference_raster->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: reference_raster not ready" );
-    
-  /* Checking input_raster2 */
-  
-  TePDITypes::TePDIRasterPtrType lowres_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "lowres_raster", 
-    lowres_raster ),
-    "Missing parameter: lowres_raster" );
-  TEAGN_TRUE_OR_RETURN( lowres_raster.isActive(),
-    "Invalid parameter: lowres_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( lowres_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: lowres_raster not ready" );    
-  TEAGN_TRUE_OR_RETURN( ( lowres_raster->nBands() == 3 ),
-    "Invalid parameter: lowres_raster must have 3 bands ( RGB )" );       
-    
-  /* Checking output_raster */
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
-    output_raster ),
-    "Missing parameter: output_raster" );
-  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
-    "Invalid parameter: output_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );    
-    
-  /* Checking bands */    
-    
-  int reference_raster_band = 0;    
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster_band", 
-    reference_raster_band ), "Missing parameter : reference_raster_band" );
-  TEAGN_TRUE_OR_RETURN( ( reference_raster->nBands() > reference_raster_band ),
-    "Invalid parameter : reference_raster_band" );
-    
-  /* Checking photometric interpretation */
-  
-  TEAGN_TRUE_OR_RETURN( ( 
-    ( reference_raster->params().photometric_[ reference_raster_band ] == 
-      TeRasterParams::TeRGB ) ||
-    ( reference_raster->params().photometric_[ reference_raster_band ] == 
-      TeRasterParams::TeMultiBand ) ),
-  "Invalid parameter - reference_raster (invalid photometric interpretation)" );   
-
-  for( int lowres_raster_band = 0 ; 
-    lowres_raster_band < lowres_raster->params().nBands() ; 
-    ++lowres_raster_band ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( 
-      ( lowres_raster->params().photometric_[ lowres_raster_band ] == 
-        TeRasterParams::TeRGB ) ||
-      ( lowres_raster->params().photometric_[ lowres_raster_band ] == 
-        TeRasterParams::TeMultiBand ) ),
-    "Invalid parameter - lowres_raster (invalid photometric interpretation)" ); 
-  }  
-    
-  return true;
-}
-
-
-bool TePDIIHSFusionStrategy::Implementation( const TePDIParameters& params )
-{
-  TePDITypes::TePDIRasterPtrType reference_raster;
-  params.GetParameter( "reference_raster", reference_raster );
-  
-  TePDITypes::TePDIRasterPtrType lowres_raster;
-  params.GetParameter( "lowres_raster", lowres_raster );
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params.GetParameter( "output_raster", output_raster );
-    
-  int reference_raster_band = 0;    
-  params.GetParameter( "reference_raster_band", reference_raster_band );
-  
-  /* Bringing lowres_raster to reference_raster size */
-   
-  TePDITypes::TePDIRasterPtrType upsampled_raster;
-  
-  {
-    TeRasterParams upsampled_raster_params = lowres_raster->params();
-    upsampled_raster_params.setNLinesNColumns( 1, 1 );
-    
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( upsampled_raster,
-      upsampled_raster_params, TePDIUtils::TePDIUtilsAutoMemPol ),
-      "Unable create the new upsampled raster RGB raster" );
-      
-	  TEAGN_TRUE_OR_RETURN( TePDIUtils::resampleRasterByLinsCols(
-	    lowres_raster, 
-		  upsampled_raster, 
-		  (unsigned int)reference_raster->params().nlines_, 
-		  (unsigned int)reference_raster->params().ncols_, 
-		  progress_interface_enabled_,
-		  TePDIInterpolator::NNMethod), "Raster resample error" );    
-/*      
-TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( upsampled_raster,
-  "TePDIIHSFusionStrategy_upsampled_raster.tif" ), 
-  "GeoTIF generation error" );     
-*/      
-  }
-   
-  /* Generating the IHS raster */
-  
-  TePDITypes::TePDIRasterPtrType ihs_raster;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( ihs_raster,
-    1, 10, 10, false, TeFLOAT, 0 ),
-    "Unable create the new ihs_raster raster RGB raster" );  
-    
-  double rgb_channels_min = 0;
-  double rgb_channels_max = 0;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds( 
-    upsampled_raster,
-    0, rgb_channels_min, rgb_channels_max ),
-    "Unable to get channel range" )
-     
-  {
-    TePDIParameters rgb2ihs_params;
-    
-    TePDITypes::TePDIRasterVectorType input_rasters;
-    input_rasters.push_back( upsampled_raster );
-    input_rasters.push_back( upsampled_raster );
-    input_rasters.push_back( upsampled_raster );
-    rgb2ihs_params.SetParameter( "input_rasters", input_rasters );
-    
-    std::vector< int > input_channels;
-    input_channels.push_back( 0 );
-    input_channels.push_back( 1 );
-    input_channels.push_back( 2 );
-    rgb2ihs_params.SetParameter( "input_channels", input_channels );
-    
-    TePDITypes::TePDIRasterVectorType output_rasters;
-    output_rasters.push_back( ihs_raster );
-    rgb2ihs_params.SetParameter( "output_rasters", output_rasters );
-    
-    rgb2ihs_params.SetParameter( "transf_type", TePDIColorTransform::Rgb2Ihs );  
-
-    rgb2ihs_params.SetParameter( "rgb_channels_min", rgb_channels_min );
-    rgb2ihs_params.SetParameter( "rgb_channels_max", rgb_channels_max );    
-    
-    TePDIColorTransform transform_instance;
-    TEAGN_TRUE_OR_RETURN( transform_instance.Reset( rgb2ihs_params ),
-      "Error in IHS parameters" )
-      
-    transform_instance.ToggleProgInt( progress_interface_enabled_ );
-      
-    TEAGN_TRUE_OR_RETURN( transform_instance.Apply(), 
-      "Unable to build IHS color space" );
-  }
-  
-/*  
-TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( ihs_raster,
-  "TePDIIHSFusionStrategy_ihs_raster.tif" ), 
-  "GeoTIF generation error" );    
-*/
-
-  /* Free the anused raster */
-  
-  upsampled_raster.reset();  
-  
-  /* Bring the reference raster to the mean and variance of
-     the I channel */
-  
-  TePDITypes::TePDIRasterPtrType ref_rast_contrast;
-  
-  {
-    {
-      /* Get target stat params */
-      
-      TePDIParameters statparams;
-      
-      TePDITypes::TePDIRasterVectorType rasters;
-      rasters.push_back( ihs_raster );
-      statparams.SetParameter( "rasters", rasters );
-      
-      std::vector< int > bands;
-      bands.push_back( 0 ); // IHS raster I band
-      statparams.SetParameter( "bands", bands );
-      
-      TePDIStatistic stat;
-      stat.ToggleProgInt( progress_interface_enabled_ );
-      TEAGN_TRUE_OR_THROW( stat.Reset( statparams ),
-        "Invalid statistic algorithm parameters" )
-        
-      double target_mean = stat.getMean( 0 );
-      double target_variance = stat.getVariance( 0 );
-
-      /* Applying contrast to the reference raster */
-      
-      TePDIParameters contparams;
-      
-      contparams.SetParameter( "contrast_type", 
-        TePDIContrast::TePDIContrastStat );
-      contparams.SetParameter( "input_image", reference_raster );
-      contparams.SetParameter( "input_band", (int)reference_raster_band );
-      contparams.SetParameter( "target_mean", target_mean );
-      contparams.SetParameter( "target_variance", target_variance );
-      
-      TeRasterParams ref_rast_cont_params = reference_raster->params();
-      ref_rast_cont_params.setNLinesNColumns( 1, 1 );
-      ref_rast_cont_params.nBands( 1 );
-      ref_rast_cont_params.setDataType( TeFLOAT, -1 );
-      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( ref_rast_contrast,
-        ref_rast_cont_params, TePDIUtils::TePDIUtilsAutoMemPol ),
-        "Unable create the new reference raster (contrast)" );  
-      contparams.SetParameter( "output_image", ref_rast_contrast );
-      
-      contparams.SetParameter( "output_band", (int)0 );
-      
-      TePDIContrast contra;
-      TEAGN_TRUE_OR_RETURN( contra.Apply( contparams ),
-        "Error applying contrast" )
-    }
-  
-  }
-    
-  /* Swapping reference_raster into ihs_raster I component */
-  {
-    const unsigned int lines_bound = ihs_raster->params().nlines_;
-    const unsigned int cols_bound = ihs_raster->params().ncols_;
-    unsigned int line = 0;
-    unsigned int col = 0;
-    TeRaster* inraster = ref_rast_contrast.nakedPointer();
-    TeRaster* outraster = ihs_raster.nakedPointer();
-    double value = 0;
-    
-    TePDIPIManager progress( "Swapping Intensity channel...", lines_bound,
-      progress_interface_enabled_ );
-    
-    for( line = 0; line < lines_bound ; ++line ) {
-      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
-    
-      for( col = 0; col < cols_bound ; ++col ) {
-        inraster->getElement( col, line, value, 0 );
-        
-        outraster->setElement( col, line, value, 0 );
-      }
-    }
-    
-    progress.Toggle( false );
-  }
-  
-/* 
-TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( ihs_raster,
-  "TePDIIHSFusionStrategy_ihs_raster_swapped.tif" ), 
-  "GeoTIF generation error" );     
-*/  
-
-  /* Switching back to RBG space */
-  {
-    TePDIParameters ihs2rgb_params;
-    
-    TePDITypes::TePDIRasterVectorType input_rasters;
-    input_rasters.push_back( ihs_raster );
-    input_rasters.push_back( ihs_raster );
-    input_rasters.push_back( ihs_raster );
-    ihs2rgb_params.SetParameter( "input_rasters", input_rasters );
-    
-    std::vector< int >input_channels;
-    input_channels.push_back( 0 );
-    input_channels.push_back( 1 );
-    input_channels.push_back( 2 );
-    ihs2rgb_params.SetParameter( "input_channels", input_channels );
-    
-    TePDITypes::TePDIRasterVectorType output_rasters;
-    output_rasters.push_back( output_raster );    
-    ihs2rgb_params.SetParameter( "output_rasters", output_rasters );
-    
-    ihs2rgb_params.SetParameter( "transf_type", TePDIColorTransform::Ihs2Rgb );  
-    
-    ihs2rgb_params.SetParameter( "rgb_channels_min", rgb_channels_min );
-    ihs2rgb_params.SetParameter( "rgb_channels_max", rgb_channels_max );
-    
-    TePDIColorTransform transform_instance;
-    TEAGN_TRUE_OR_RETURN( transform_instance.Reset( ihs2rgb_params ),
-      "Error in IHS parameters" )    
-    
-    TEAGN_TRUE_OR_RETURN( transform_instance.Apply(), 
-      "Unable to build RGB color space" );      
-  }
-   
-  return true;
-}
-
diff --git a/src/terralib/image_processing/TePDIIHSFusionStrategy.hpp b/src/terralib/image_processing/TePDIIHSFusionStrategy.hpp
deleted file mode 100755
index 6feb7d3..0000000
--- a/src/terralib/image_processing/TePDIIHSFusionStrategy.hpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIIHSFUSIONSTRATEGY_HPP
-  #define TEPDIIHSFUSIONSTRATEGY_HPP
-
-
-  #include "TePDIStrategy.hpp"
-
-  /**
-   * @brief This is the class for IHS fusion strategy.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategies
-   *
-   * @note The required parameters are:
-   * @param fusion_type ( std::string ) : Must be "ihs".
-   * @param reference_raster ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Reference raster ( higher quality ).
-   * @param lowres_raster ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Low resolution RGB raster with 3 channels ( will be improved  - 
-   * band0=Red, band1=Green, band2=Blue ).
-   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
-   * @param reference_raster_band ( int ) - The band to process from 
-   * reference_raster.
-   *
-   */
-  class PDI_DLL TePDIIHSFusionStrategy : public TePDIStrategy
-  {
-    friend class TePDIIHSFusionSF;
-  
-    public :
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIIHSFusionStrategy();
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI strategy.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( 
-        const TePDIParameters& parameters ) const;       
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIIHSFusionStrategy();
-      
-      /**
-       * @brief Runs the algorithm implementation.
-       *
-       * @return true if OK. false on errors.
-       */
-      bool Implementation( const TePDIParameters& params );
-      
-  };
-  
-#endif
-
-
-
diff --git a/src/terralib/image_processing/TePDIIHSWaveletFusion.cpp b/src/terralib/image_processing/TePDIIHSWaveletFusion.cpp
new file mode 100644
index 0000000..5d3c5bc
--- /dev/null
+++ b/src/terralib/image_processing/TePDIIHSWaveletFusion.cpp
@@ -0,0 +1,478 @@
+#include "TePDIIHSWaveletFusion.hpp"
+#include "TePDIUtils.hpp"
+#include "TePDITypes.hpp"
+#include "TePDIWaveletAtrous.hpp"
+#include "TePDIColorTransform.hpp"
+#include "TePDIStatistic.hpp"
+
+#include <TeRasterRemap.h>
+#include <TeAgnostic.h>
+#include <TeMatrix.h>
+#include <TeUtils.h>
+
+#include <math.h>
+
+#define waveletPlanes 2
+
+TePDIIHSWaveletFusion::TePDIIHSWaveletFusion()
+{
+}
+
+TePDIIHSWaveletFusion::~TePDIIHSWaveletFusion()
+{
+}
+
+void TePDIIHSWaveletFusion::ResetState(const TePDIParameters&)
+{
+}
+
+void TePDIIHSWaveletFusion::rgb2ihs(double *rgb, double *ihs)
+{
+	double theta = acos((0.5 * ((rgb[0] - rgb[1]) + (rgb[0] - rgb[2]))) / sqrt((rgb[0] - rgb[1]) * (rgb[0] - rgb[1]) + (rgb[0] - rgb[2]) * (rgb[1] - rgb[2])));
+	if (rgb[2] > rgb[1])
+		ihs[1] = (((2 * PI) - theta) * 180) / PI;
+	else
+		ihs[1] = (theta * 180) / PI;
+	ihs[2] = 1 - (3 / (rgb[0] + rgb[1] + rgb[2])) * MIN(rgb[0], MIN(rgb[1], rgb[2]));
+	ihs[0] = (rgb[0] + rgb[1] + rgb[2]) / 3;
+}
+
+void TePDIIHSWaveletFusion::ihs2rgb(double *ihs, double *rgb)
+{
+	if ((ihs[1] >= 0.0) && (ihs[1] < 120.0))
+	{
+		ihs[1] = (ihs[1] * PI) / 180;
+		rgb[2] = ihs[0] * (1 - ihs[2]);
+		rgb[0] = ihs[0] * (1 + ((ihs[2] * cos(ihs[1])) / (cos((PI/3) - ihs[1]))));
+		rgb[1] = (3 * ihs[0]) - (rgb[0] + rgb[2]);
+	}
+	else
+	if ((ihs[1] >= 120.0) && (ihs[1] < 240.0))
+	{
+		ihs[1] = ((ihs[1] - 120) * PI) / 180;
+		rgb[0] = ihs[0] * (1 - ihs[2]);
+		rgb[1] = ihs[0] * (1 + ((ihs[2] * cos(ihs[1])) / (cos((PI/3) - ihs[1]))));
+		rgb[2] = (3 * ihs[0]) - (rgb[0] + rgb[1]);
+	}
+	else
+	if ((ihs[1] >= 240.0) && (ihs[1] <= 360.0))
+	{
+		ihs[1] = ((ihs[1] - 240) * PI) / 180;
+		rgb[1] = ihs[0] * (1 - ihs[2]);
+		rgb[2] = ihs[0] * (1 + ((ihs[2] * cos(ihs[1])) / (cos((PI/3) - ihs[1]))));
+		rgb[0] = (3 * ihs[0]) - (rgb[1] + rgb[2]);
+	}
+}
+
+bool TePDIIHSWaveletFusion::CheckParameters(const TePDIParameters& parameters) const
+{
+/* Input rasters and bands checking */
+
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+	TEAGN_TRUE_OR_RETURN(input_rasters.size() == 3, "Invalid input rasters number");
+	
+	std::vector<int> bands;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+	TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), "Invalid parameter: bands number");
+
+	for( unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); ++input_rasters_index )
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
+		TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[" + Te2String(input_rasters_index) + "]");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String( input_rasters_index ) + " with imcompatible number of columns" );
+		TEAGN_TRUE_OR_RETURN(((input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeRGB) || (input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeMultiBand)), "Invalid parameter - input_rasters (invalid photometric interpretation)");
+	}
+
+/* Reference raster checking */
+
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+	TEAGN_TRUE_OR_RETURN(((reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeRGB ) || (reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeMultiBand)), "Invalid parameter - reference_raster (invalid photometric interpretation)");
+
+	TEAGN_TRUE_OR_RETURN(reference_raster_band < reference_raster->nBands(), "Invalid parameter - reference_raster_band");
+
+/* Output rasters checking */
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() == input_rasters.size(), "Invalid parameter: output rasters size");
+
+	for(unsigned int input_rasters_index2 = 0; input_rasters_index2 < input_rasters.size(); ++input_rasters_index2)
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " not ready");
+	}
+
+	int i_levels;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("i_levels", i_levels), "Missing parameter: i_levels");
+
+	int reference_levels;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
+
+	string filter_file;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("filter_file", filter_file), "Missing parameter: filter_file");
+
+	TePDIIHSWaveletFusion::InterpMethod resampling_type;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
+
+	bool fit_histogram;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
+
+	return true;
+}
+
+bool TePDIIHSWaveletFusion::RunImplementation()
+{
+// Getting parameters
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+
+	std::vector<int> bands;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("bands", bands), "Missing parameter: bands");
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+
+	int i_levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("i_levels", i_levels), "Missing parameter: i_levels");
+
+	int reference_levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
+
+	string filter_file;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("filter_file", filter_file), "Missing parameter: filter_file");
+
+	TePDIIHSWaveletFusion::InterpMethod resampling_type;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
+
+	bool fit_histogram;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
+
+// Setting variables
+	unsigned int b;
+	int i,
+		j,
+		l;
+	double	rgb[NUN_BANDS_IHS],
+			ihs[NUN_BANDS_IHS],
+			channelMinLevel[NUN_BANDS_IHS],
+			channelMaxLevel[NUN_BANDS_IHS];
+
+	for(b = 0; b < input_rasters.size(); b++)
+	{
+		channelMinLevel[b] = 0.0;
+		channelMaxLevel[b] = 255.0;
+		//channelMaxLevel[b] = pow(2.0, (double)input_rasters[b]->params().nbitsperPixel_[bands[b]])-1.0;
+	}
+
+/* Allocating output rasters */
+	TeRasterParams reference_params = reference_raster->params();
+	for(b = 0; b < output_rasters.size(); b++)
+	{
+		TeRasterParams outRaster_params = output_rasters[b]->params();
+		outRaster_params.nBands(1);
+		if (reference_params.projection() != 0)
+		{
+			TeSharedPtr<TeProjection> proj(TeProjectionFactory::make(reference_params.projection()->params()));
+			outRaster_params.projection(proj.nakedPointer());
+		}
+		outRaster_params.boxResolution(reference_params.box().x1(), reference_params.box().y1(), reference_params.box().x2(), reference_params.box().y2(), reference_params.resx_, reference_params.resy_);
+		outRaster_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
+		outRaster_params.setDummy(0.0, -1);
+		outRaster_params.setDataType(TeUNSIGNEDCHAR, -1);
+		TEAGN_TRUE_OR_RETURN(output_rasters[b]->init(outRaster_params), "Raster reset error - Raster index " + Te2String(b));
+	}
+
+// Resampling the input raster
+	TePDITypes::TePDIRasterVectorType resampled_input_rasters;
+	for(b = 0; b < input_rasters.size(); b++)
+	{
+		if (resampling_type != TePDIIHSWaveletFusion::Nothing)
+		{
+		  TePDIInterpolator::InterpMethod intMethod;
+		  switch( resampling_type )
+		  {
+		    case TePDIIHSWaveletFusion::NNMethod :
+		    {
+		      intMethod =  TePDIInterpolator::NNMethod;
+		      break;
+		    }
+		    case TePDIIHSWaveletFusion::BilinearMethod :
+		    {
+		      intMethod =  TePDIInterpolator::BilinearMethod;
+		      break;
+		    }		  
+		    case TePDIIHSWaveletFusion::BicubicMethod :
+		    {
+		      intMethod =  TePDIInterpolator::BicubicMethod;
+		      break;
+		    }				      
+		    default :
+		    {
+		      TEAGN_LOG_AND_THROW( "Invalid resampling type" );
+		    }
+		  }
+		
+			TePDITypes::TePDIRasterPtrType resampled_input_rasters_temp;
+			TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(resampled_input_rasters_temp,  reference_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create the resampled input rasters");
+			resampleRasterByResLinsCols(input_rasters[b], resampled_input_rasters_temp, reference_params.resx_ / input_rasters[b]->params().resx_, reference_params.resy_ / input_rasters[b]->params().resy_, reference_params.nlines_,  reference_params.ncols_, intMethod, progress_enabled_);
+			resampled_input_rasters.push_back(resampled_input_rasters_temp);
+		}
+		else
+			resampled_input_rasters.push_back(input_rasters[b]);
+	}
+
+// IHS Direct transformation
+	TePDITypes::TePDIRasterVectorType ihs_rasters;
+	for(b = 0; b < resampled_input_rasters.size(); b++)
+	{
+		TePDITypes::TePDIRasterPtrType temp_raster;
+		TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(temp_raster,  reference_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create the resampled input rasters");
+		ihs_rasters.push_back(temp_raster);
+	}
+
+	TePDIPIManager progress("RGB2IHS transformation", reference_params.nlines_, progress_enabled_);
+	progress.Toggle(progress_enabled_);
+	for (j = 0; j < reference_params.nlines_; j++)
+	{
+		for (i = 0; i < reference_params.ncols_; i++)
+		{
+			for(b = 0; b < resampled_input_rasters.size(); b++)
+			{
+				resampled_input_rasters[b]->getElement(i, j, rgb[b], bands[b]);
+				rgb[b] = (rgb[b]-channelMinLevel[b])/(channelMaxLevel[b]-channelMinLevel[b]);
+			}
+			rgb2ihs(rgb, ihs);
+			for(b = 0; b < resampled_input_rasters.size(); b++)
+			{
+				if (b!=1)
+					ihs[b] = (ihs[b]*(channelMaxLevel[b]-channelMinLevel[b]))+channelMinLevel[b];
+				else
+					ihs[b] = (ihs[b]/360.0)*(channelMaxLevel[b]-channelMinLevel[b]);
+				ihs_rasters[b]->setElement(i, j, ihs[b], 0);
+			}
+		}
+		progress.Increment();
+	}
+	progress.Toggle(false);
+
+// Creating I wavelet plane
+	std::vector<TePDITypes::TePDIRasterVectorType> ihs_rasters_wavelets;
+	TePDITypes::TePDIRasterVectorType ihs_rasters_wavelets_vector_temp;
+	ihs_rasters_wavelets_vector_temp.push_back(ihs_rasters[0]);
+	for(l = 1; l <= i_levels; l++)
+	{
+		TePDITypes::TePDIRasterPtrType input_rasters_wavelets_temp;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(input_rasters_wavelets_temp, waveletPlanes, reference_params.nlines_, reference_params.ncols_, false, TeFLOAT, 0), "Unable to alloc input rasters wavelet planes");
+		ihs_rasters_wavelets_vector_temp.push_back(input_rasters_wavelets_temp);
+	}
+	ihs_rasters_wavelets.push_back(ihs_rasters_wavelets_vector_temp);
+
+// Extracting I wavelet planes
+	TePDIParameters iWaveletAtrousParams;
+	iWaveletAtrousParams.SetParameter("direction", (int)TePDIWaveletAtrous::DECOMPOSE);
+	iWaveletAtrousParams.SetParameter("input_raster", ihs_rasters[0]);
+	iWaveletAtrousParams.SetParameter("band", 0);
+	iWaveletAtrousParams.SetParameter("levels", i_levels);
+	iWaveletAtrousParams.SetParameter("filter_file", filter_file);
+	iWaveletAtrousParams.SetParameter("fit_histogram", false);
+	iWaveletAtrousParams.SetParameter("output_wavelets", ihs_rasters_wavelets[0]);
+	TePDIWaveletAtrous waI;
+	TEAGN_TRUE_OR_THROW(waI.Reset(iWaveletAtrousParams), "Invalid Parameters");
+	waI.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(waI.Apply(), "Apply error");
+
+// Creating reference raster wavelet planes
+	double p;
+	TePDITypes::TePDIRasterVectorType reference_raster_wavelets;
+	for(l = 0; l <= reference_levels; l++)
+	{
+		TePDITypes::TePDIRasterPtrType reference_raster_wavelets_temp;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(reference_raster_wavelets_temp, waveletPlanes, reference_params.nlines_, reference_params.ncols_, false, TeFLOAT, 0), "Reference raster wavelets Alloc error");
+		if (l == 0)
+		{
+			for (j = 0; j < reference_params.nlines_; j++)
+			{
+				for (i = 0; i < reference_params.ncols_; i++)
+				{
+					reference_raster->getElement(i, j, p, reference_raster_band);
+					reference_raster_wavelets_temp->setElement(i, j, p, 0);
+				}
+			}
+		}
+		reference_raster_wavelets.push_back(reference_raster_wavelets_temp);
+	}
+
+// Extracting reference raster wavelet planes
+	TePDIParameters referenceWaveletAtrousParams;
+	referenceWaveletAtrousParams.SetParameter("direction", (int)TePDIWaveletAtrous::DECOMPOSE);
+	referenceWaveletAtrousParams.SetParameter("input_raster", reference_raster);
+	referenceWaveletAtrousParams.SetParameter("band", reference_raster_band);
+	referenceWaveletAtrousParams.SetParameter("levels", reference_levels);
+	referenceWaveletAtrousParams.SetParameter("filter_file", filter_file);
+	referenceWaveletAtrousParams.SetParameter("fit_histogram", fit_histogram);
+	referenceWaveletAtrousParams.SetParameter("output_wavelets", reference_raster_wavelets);
+	TePDIWaveletAtrous waReference;
+	TEAGN_TRUE_OR_THROW(waReference.Reset(referenceWaveletAtrousParams), "Invalid Parameters");
+	waReference.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(waReference.Apply(), "Apply error");
+
+// Recomposing wavelets
+	TePDIParameters waveletAtrousParamsRecompose;
+	waveletAtrousParamsRecompose.SetParameter("direction", (int)TePDIWaveletAtrous::RECOMPOSE);
+	waveletAtrousParamsRecompose.SetParameter("input_rasters_wavelets", ihs_rasters_wavelets);
+	waveletAtrousParamsRecompose.SetParameter("rasters_levels", i_levels);
+	waveletAtrousParamsRecompose.SetParameter("reference_raster_wavelets", reference_raster_wavelets);
+	waveletAtrousParamsRecompose.SetParameter("reference_levels", reference_levels);
+	waveletAtrousParamsRecompose.SetParameter("output_rasters", ihs_rasters);
+	TePDIWaveletAtrous waRecompose;
+	TEAGN_TRUE_OR_THROW(waRecompose.Reset(waveletAtrousParamsRecompose), "Invalid Parameters");
+	waRecompose.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(waRecompose.Apply(), "Apply error");
+
+// Inverse IHS transformation
+	progress.Reset("IHS2RGB transformation", reference_params.nlines_);
+	progress.Toggle(progress_enabled_);
+	for (j = 0; j < reference_params.nlines_; j++)
+	{
+		for (i = 0; i < reference_params.ncols_; i++)
+		{
+			for(b = 0; b < resampled_input_rasters.size(); b++)
+			{
+				ihs_rasters[b]->getElement(i, j, ihs[b], bands[b]);
+				if (b!=1)
+					ihs[b] = (ihs[b]-channelMinLevel[b])/(channelMaxLevel[b]-channelMinLevel[b]);
+				else
+					ihs[b] = (ihs[b]/(channelMaxLevel[b]-channelMinLevel[b]))*360.0;
+			}
+			ihs2rgb(ihs, rgb);
+			for(b = 0; b < resampled_input_rasters.size(); b++)
+			{
+				rgb[b] = (rgb[b]*(channelMaxLevel[b]-channelMinLevel[b]))+channelMinLevel[b];
+				rgb[b] = (rgb[b]>channelMaxLevel[b]?channelMaxLevel[b]:(rgb[b]<channelMinLevel[b]?channelMinLevel[b]:rgb[b]));
+				output_rasters[b]->setElement(i, j, rgb[b], 0);
+			}
+		}
+		progress.Increment();
+	}
+	progress.Toggle(false);
+
+	return true;
+}
+
+bool TePDIIHSWaveletFusion::resampleRasterByResLinsCols( 
+  const TePDITypes::TePDIRasterPtrType& input_raster,
+  const TePDITypes::TePDIRasterPtrType& output_raster,
+  double x_resolution_ratio, double y_resolution_ratio, int l, int c,
+  TePDIInterpolator::InterpMethod interpol, bool enable_progress ) 
+{
+    
+  TEAGN_TRUE_OR_RETURN( input_raster.isActive(), "Inactive input raster" );
+  TEAGN_TRUE_OR_RETURN( 
+    input_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Input raster not ready" )
+  
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(), 
+    "Inactive output raster" );
+  TEAGN_TRUE_OR_RETURN( 
+    output_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Output raster not ready" )
+    
+  TEAGN_TRUE_OR_RETURN( ( x_resolution_ratio > 0.0 ), "Invalid X ratio" )
+  TEAGN_TRUE_OR_RETURN( ( y_resolution_ratio > 0.0 ), "Invalid X ratio" )
+  
+  /* Reseting the output raster to the new geometry */
+  
+  TeRasterParams& input_raster_params = input_raster->params();
+  
+  TeRasterParams new_output_raster_params = output_raster->params();
+  
+  new_output_raster_params.nBands( input_raster_params.nBands() );
+  new_output_raster_params.setPhotometric( 
+    input_raster_params.photometric_[ 0 ], -1 );
+  if( input_raster_params.projection() != 0 ) {
+    new_output_raster_params.projection( input_raster_params.projection() );
+  }
+  new_output_raster_params.boxResolution( 
+    input_raster_params.box().x1(), 
+    input_raster_params.box().y1(), input_raster_params.box().x2(), 
+    input_raster_params.box().y2(), 
+    ( input_raster_params.resx_ * x_resolution_ratio ), 
+    ( input_raster_params.resy_ * y_resolution_ratio ) );
+  new_output_raster_params.lowerLeftResolutionSize(input_raster_params.box().lowerLeft().x(), input_raster_params.box().lowerLeft().y(), ( input_raster_params.resx_ * x_resolution_ratio ), ( input_raster_params.resy_ * y_resolution_ratio ), c, l);
+
+    
+  TEAGN_TRUE_OR_RETURN( output_raster->init( new_output_raster_params ),
+    "Output raster reset error" )
+//cout << output_raster->params().resx_ << endl;
+    
+  /* interpolating pixel values */
+  
+  const TeRasterParams& output_raster_params = output_raster->params();
+  
+  const unsigned int out_lines = output_raster_params.nlines_;
+  const unsigned int out_cols = output_raster_params.ncols_;
+  const unsigned int out_bands = output_raster_params.nBands();
+  
+  double in_col = 0;
+  double in_line = 0;
+  unsigned int out_col = 0;
+  unsigned int out_line = 0;
+  unsigned int out_band = 0;
+  double value = 0;
+  
+  double dummy_value = 0;
+  if( input_raster_params.useDummy_ ) {
+    dummy_value = input_raster_params.dummy_[ 0 ];
+  }
+  
+  TeRaster& output_raster_ref = *( output_raster.nakedPointer() );
+  
+  TePDIInterpolator interpolator;
+  TEAGN_TRUE_OR_RETURN( interpolator.reset( input_raster, interpol,
+    dummy_value), "Interpolator reset error" )
+    
+  TePDIPIManager progress( "Resampling raster", ( out_bands * out_lines ),
+    enable_progress );
+  
+  for( out_band = 0 ; out_band < out_bands ; ++out_band ) {
+    for( out_line = 0 ; out_line < out_lines ; ++out_line ) {
+      in_line = ( (double)out_line) * y_resolution_ratio;
+if ((int)in_line >= (input_raster->params().nlines_-1))
+  in_line = (double)(input_raster->params().nlines_-1);
+    
+      for( out_col = 0 ; out_col < out_cols ; ++out_col ) {
+        in_col = ( (double)out_col) * x_resolution_ratio;
+  if ((int)in_col >= (input_raster->params().ncols_-1))
+  in_col = (double)(input_raster->params().ncols_-1);
+      
+        interpolator.interpolate( in_line, in_col, out_band, value );
+
+    if (value>255)
+      value=255;
+    else if (value<0)
+      value=0;
+    
+        TEAGN_TRUE_OR_RETURN( output_raster_ref.setElement( out_col, 
+          out_line, value, out_band ), "Output raster writing error" )
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by user" );
+    }
+  }
+  
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIIHSWaveletFusion.hpp b/src/terralib/image_processing/TePDIIHSWaveletFusion.hpp
new file mode 100644
index 0000000..ddce7cb
--- /dev/null
+++ b/src/terralib/image_processing/TePDIIHSWaveletFusion.hpp
@@ -0,0 +1,145 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIIHSWAVELETFUSION_HPP
+  #define TEPDIIHSWAVELETFUSION_HPP
+
+  #include "TePDILevelRemap.hpp"
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIInterpolator.hpp"
+  #include <TeSharedPtr.h>
+
+  #define PI 3.141592653589793238462643383279502884197169399375105820974944592
+  #define NUN_BANDS_IHS 3
+  #define waveletPlanes 2
+
+  /**
+   * @class TePDIIHSWaveletFusion
+   * @brief This is the class for wavelet+IHS fusion.
+   * @warning This class is under development and may produce incorrect 
+   * results or generate execution errors, please wait for the next version.
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @ingroup PDIFusionAlgorithms
+   *
+   * @note The required parameters are:
+   *
+   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Low resolution rasters.
+   * @param bands (std::vector< int >) - The bands from each low resolution raster.
+   * @param output_rasters (TePDITypes::TePDIRasterVectorType) - High resolution fused rasters.
+   * @param reference_raster (TePDITypes::TePDIRasterPtrType) - High resolution raster.
+   * @param reference_raster_band (int) - Reference raster band number.
+   * @param i_levels (int) - Decomposition levels for the I component.
+   * @param reference_levels (int) - Decomposition levels for each reference raster.
+   * @param filter_file (std::string) - The wavelet filter file name.
+   * @param resampling_type (TePDIIHSWaveletFusion::InterpMethod) - Resampling type.
+   * @param fit_histogram (bool) - Fit histogram before the substitution.
+   *
+   */
+  class PDI_DLL TePDIIHSWaveletFusion : public TePDIAlgorithm {
+    public :
+      /**
+       * @enum Allowed interpolation methods.
+       */      
+      enum InterpMethod {
+        /** No interpolation method. */
+        Nothing = 0,
+        /** Near neighborhood interpolation method. */
+        NNMethod = 1,
+        /** Bilinear interpolation method. */
+        BilinearMethod = 2,
+        /** Bicubic interpolation method. */
+        BicubicMethod = 3      
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIIHSWaveletFusion();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIIHSWaveletFusion();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+      
+    protected :
+      
+      /**
+       * @brief Decide the direction of the analysis based on the analysis_type parameter.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState(const TePDIParameters&);
+
+      void rgb2ihs(double *rgb, double *ihs);
+      void ihs2rgb(double *ihs, double *rgb);
+      
+      /**
+       * @brief Raster resampling to new resolution, forcing lines and columns.
+       * @param input_raster Input raster.
+       * @param output_raster Output raster.
+       * @param x_resolution_ratio X resolution ratio.
+       * @param y_resolution_ratio Y resolution ratio.
+       * @param l Output raster Lines.
+       * @param c Output raster Columns.
+       * @param interpol Interpolation method.
+       * @param enable_progress Enable/disable the progress interface.
+       * @return true if OK, false on errors.
+       * 
+       * @note ( resolution_ratio = output_resolution / input_resolution ).
+       */      
+      bool resampleRasterByResLinsCols(
+        const TePDITypes::TePDIRasterPtrType& input_raster,
+        const TePDITypes::TePDIRasterPtrType& output_raster,
+        double x_resolution_ratio,
+        double y_resolution_ratio,
+        int l,
+        int c,
+        TePDIInterpolator::InterpMethod interpol,
+        bool enable_progress );        
+  };
+  
+/** @example TePDIIHSWaveletFusion_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDIIHSWAVELETFUSION_HPP
diff --git a/src/terralib/image_processing/TePDIInterpolator.cpp b/src/terralib/image_processing/TePDIInterpolator.cpp
old mode 100755
new mode 100644
index 6636073..30dbcde
--- a/src/terralib/image_processing/TePDIInterpolator.cpp
+++ b/src/terralib/image_processing/TePDIInterpolator.cpp
@@ -1,384 +1,357 @@
-#include "TePDIInterpolator.hpp"
-
-#include "TePDIUtils.hpp"
-
-#include <TeAgnostic.h>
-#include <TeUtils.h>
-
-#include <math.h>
-
-#define BICUBIC_MODULE( x ) ( ( x < 0 ) ? ( -1 * x ) : x )
-#define BICUBIC_K1( x , a ) ( ( ( a + 2 ) * x * x * x ) - \
-  ( ( a + 3 ) * x * x ) + 1 )
-#define BICUBIC_K2( x , a ) ( ( a * x * x * x ) - ( 5 * a * x * x ) + \
-  ( 8 * a * x ) - ( 4 * a ) )
-#define BICUBIC_RANGES(x,a) \
-  ( ( ( 0 <= x ) && ( x <= 1 ) ) ? \
-    BICUBIC_K1(x,a) \
-  : ( ( ( 1 < x ) && ( x <= 2 ) ) ? \
-      BICUBIC_K2(x,a) \
-    : 0 ) )
-#define BICUBIC_KERNEL( x , a ) BICUBIC_RANGES( BICUBIC_MODULE(x) , a )
-
-TePDIInterpolator::TePDIInterpolator()
-{
-  init();
-}
-
-
-TePDIInterpolator::~TePDIInterpolator()
-{
-  clear();
-}
-
-
-void TePDIInterpolator::init()
-{
-  input_raster_params_nptr_ = 0;
-  interp_funct_ptr_ = 0;
-  bicubic_lines_bound_ = 0;
-  bicubic_columns_bound_ = 0;
-  bicubic_kernel_parameter_ = -1.0;
-  last_valid_line_ = 0;
-  last_valid_col_ = 0;
-  raster_uses_dummy_ = false;
-  nbands_ = 0;
-  dummy_value_ = 0;
-  input_raster_ptr_.reset();
-  input_raster_nptr_ = 0;
-  input_raster_max_chan_val_vec_ = 0;
-  input_raster_min_chan_val_vec_ = 0;
-}
-
-
-void TePDIInterpolator::clear()
-{
-  input_raster_ptr_.reset();
-
-  if( input_raster_max_chan_val_vec_ ) {
-    delete[] input_raster_max_chan_val_vec_;
-  }
-
-  if( input_raster_min_chan_val_vec_ ) {
-    delete[] input_raster_min_chan_val_vec_;
-  }
-
-  init();
-}
-
-
-bool TePDIInterpolator::reset( const TeSharedPtr< TeRaster >& input_raster,
-  InterpMethod method, double dummy_value )
-{
-  clear();
-
-  /* Checking input */
-
-  TEAGN_TRUE_OR_RETURN( input_raster.isActive(), "Inactive input raster" );
-  TEAGN_TRUE_OR_RETURN( input_raster->status(), "Input raster not ready" );
-  
-  if( method != NNMethod ) {
-    for( int band = 0 ; band < input_raster->params().nBands() ;
-      ++band ) {
-      TEAGN_TRUE_OR_RETURN( ( 
-        ( input_raster->params().photometric_[ band ] == 
-        TeRasterParams::TeMultiBand ) || 
-        ( input_raster->params().photometric_[ band ] == 
-        TeRasterParams::TeRGB ) ),
-      "Only NNMethod can be used on this raster" );
-    }
-  }
-
-  /* Getting input raster channel ranges */
-
-  input_raster_max_chan_val_vec_ = 
-    new double[ input_raster->nBands() ];
-  TEAGN_TRUE_OR_THROW( input_raster_max_chan_val_vec_,
-    "Vector allocation error" )
-
-  input_raster_min_chan_val_vec_ = 
-    new double[ input_raster->nBands() ];
-  TEAGN_TRUE_OR_THROW( input_raster_min_chan_val_vec_,
-    "Vector allocation error" )
-
-  for( int channel = 0 ; channel < input_raster->nBands() ;
-    ++channel ) {
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds( 
-      input_raster, channel, 
-      input_raster_min_chan_val_vec_[ channel ],
-      input_raster_max_chan_val_vec_[ channel ] ),
-      "Error getting channels bounds" );
-  }
-
-  /* Switching interpolation function pointer */
-  
-  switch( method ) {
-    case BicubicMethod :
-    {
-      TEAGN_TRUE_OR_RETURN( ( input_raster->params().nlines_ > 3 ), 
-        "Invalid raster lines number" );
-      TEAGN_TRUE_OR_RETURN( ( input_raster->params().ncols_ > 3 ), 
-        "Invalid raster columns number" );
-    
-      interp_funct_ptr_ = &TePDIInterpolator::bicubicInterpolation;
-      break;
-    }
-    case BilinearMethod :
-    {
-      TEAGN_TRUE_OR_RETURN( ( input_raster->params().nlines_ > 1 ), 
-        "Invalid raster lines number" );
-      TEAGN_TRUE_OR_RETURN( ( input_raster->params().ncols_ > 1 ), 
-        "Invalid raster columns number" );
-    
-      interp_funct_ptr_ = &TePDIInterpolator::bilinearInterpolation;
-      break;
-    }
-    case NNMethod :
-    {
-      TEAGN_TRUE_OR_RETURN( ( input_raster->params().nlines_ > 0 ), 
-        "Invalid raster lines number" );
-      TEAGN_TRUE_OR_RETURN( ( input_raster->params().ncols_ > 0 ), 
-        "Invalid raster columns number" );
-    
-      interp_funct_ptr_ = &TePDIInterpolator::nNInterpolation;
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_RETURN( "Invalid interpolation method" );
-      break;
-    }
-  }
-  
-  input_raster_ptr_ = input_raster;
-  input_raster_nptr_ = input_raster_ptr_.nakedPointer();
-  input_raster_params_nptr_ = &(input_raster->params());
-  raster_uses_dummy_ = input_raster_params_nptr_->useDummy_;
-  nbands_ = input_raster_params_nptr_->nBands();
-  dummy_value_ = dummy_value;
-  
-  last_valid_line_ = (double)( input_raster_params_nptr_->nlines_ - 1 );
-  last_valid_col_ = (double)( input_raster_params_nptr_->ncols_ - 1 );
-  
-  bicubic_lines_bound_ = (double)( input_raster_params_nptr_->nlines_ - 2 );
-  bicubic_columns_bound_ = (double)( input_raster_params_nptr_->ncols_ - 2 );
-  
-  return true;
-}
-
-
-void TePDIInterpolator::interpolate( const double& line, const double& col, 
-  const unsigned int& band, double& value )
-{
-  TEAGN_TRUE_OR_THROW( interp_funct_ptr_, 
-    "Invalid interpolation function pointer" );
-  TEAGN_TRUE_OR_THROW( ( band < nbands_ ), "Invalid band" );
-    
-  if( ( col > last_valid_col_ ) || ( line > last_valid_line_ ) ||
-      ( col < 0 ) || ( line < 0 ) ) {
- 
-    value = dummy_value_;
-  } else {
-    ( this->*( interp_funct_ptr_ ) )( line, col, band, value );
-  }
-}
-
-
-void TePDIInterpolator::nNInterpolation( const double& line, const double& col, 
-  const unsigned int& band, double& value )
-{
-  TEAGN_DEBUG_CONDITION( interp_funct_ptr_, 
-    "Invalid interpolation function pointer" );
-  TEAGN_DEBUG_CONDITION( ( band < nbands_ ), "Invalid band" );
-    
-  if( ! input_raster_nptr_->getElement( TeRound( col ), TeRound( line ), value, 
-    band ) ) {
-    
-    TEAGN_TRUE_OR_THROW( raster_uses_dummy_, 
-      "Unable to get raster element" );
-    
-    value = dummy_value_;
-  }
-}
-
-
-void TePDIInterpolator::bilinearInterpolation( const double& line, 
-  const double& col, const unsigned int& band, double& value )
-{
-  TEAGN_DEBUG_CONDITION( interp_funct_ptr_, 
-    "Invalid interpolation function pointer" );
-  TEAGN_DEBUG_CONDITION( ( band < nbands_ ), "Invalid band" );
-
-  bilinear_line_min_ = floor( line );
-  bilinear_line_max_ = ( ( bilinear_line_min_ == line ) ? bilinear_line_min_ : 
-    ( bilinear_line_min_ + 1.0 ) );
-  bilinear_col_min_ = floor( col );
-  bilinear_col_max_ = ( ( bilinear_col_min_ == col ) ? bilinear_col_min_ : 
-    ( bilinear_col_min_ + 1.0 ) );
-  
-  bilinear_diff_line_min_ = line - bilinear_line_min_;
-  bilinear_diff_line_max_ = line - bilinear_line_max_;
-  bilinear_diff_col_min_ = col - bilinear_col_min_;
-  bilinear_diff_col_max_ = col - bilinear_col_max_;
-  
-  bilinear_dist1_ = sqrt( ( bilinear_diff_line_min_ * bilinear_diff_line_min_ )
-    + ( bilinear_diff_col_min_ * bilinear_diff_col_min_ ) );
-  bilinear_dist2_ = sqrt( ( bilinear_diff_line_min_ * bilinear_diff_line_min_ )
-    + ( bilinear_diff_col_max_ * bilinear_diff_col_max_ ) );
-  bilinear_dist3_ = sqrt( ( bilinear_diff_line_max_ * bilinear_diff_line_max_ )
-    + ( bilinear_diff_col_min_ * bilinear_diff_col_min_ ) );
-  bilinear_dist4_ = sqrt( ( bilinear_diff_line_max_ * bilinear_diff_line_max_ )
-    + ( bilinear_diff_col_max_ * bilinear_diff_col_max_ ) );
-  
-  bilinear_weigh1_ = ( ( bilinear_dist1_ == 0 ) ? 1 : 
-    ( 1 / bilinear_dist1_ ) );
-  bilinear_weigh2_ = ( ( bilinear_dist2_ == 0 ) ? 1 : 
-    ( 1 / bilinear_dist2_ ) );
-  bilinear_weigh3_ = ( ( bilinear_dist3_ == 0 ) ? 1 : 
-    ( 1 / bilinear_dist3_ ) );
-  bilinear_weigh4_ = ( ( bilinear_dist4_ == 0 ) ? 1 : 
-    ( 1 / bilinear_dist4_ ) );
-  
-  bilinear_elem1_ = 0;
-  bilinear_elem2_ = 0;
-  bilinear_elem3_ = 0;
-  bilinear_elem4_ = 0;
-  
-  if( input_raster_nptr_->getElement( (unsigned int)bilinear_col_min_, 
-        (unsigned int)bilinear_line_min_, bilinear_elem1_, band ) &&
-      input_raster_nptr_->getElement( (unsigned int)bilinear_col_max_, 
-        (unsigned int)bilinear_line_min_, bilinear_elem2_, band ) &&        
-      input_raster_nptr_->getElement( (unsigned int)bilinear_col_min_, 
-        (unsigned int)bilinear_line_max_, bilinear_elem3_, band ) &&        
-      input_raster_nptr_->getElement( (unsigned int)bilinear_col_max_, 
-        (unsigned int)bilinear_line_max_, bilinear_elem4_, band ) ) {
-        
-      value = ( ( bilinear_elem1_ * bilinear_weigh1_ ) + 
-        ( bilinear_elem2_ * bilinear_weigh2_ ) +
-        ( bilinear_elem3_ * bilinear_weigh3_ ) + 
-        ( bilinear_elem4_ * bilinear_weigh4_ ) ) / 
-        ( bilinear_weigh1_ + bilinear_weigh2_ + bilinear_weigh3_ + 
-        bilinear_weigh4_ );
-  } else {
-    TEAGN_TRUE_OR_THROW( raster_uses_dummy_, 
-      "Unable to get raster element" );  
-  
-    value = dummy_value_;
-  }
-}
-
-
-void TePDIInterpolator::bicubicInterpolation( const double& line, 
-  const double& col, const unsigned int& band, double& value )
-{
-  TEAGN_DEBUG_CONDITION( interp_funct_ptr_, 
-    "Invalid interpolation function pointer" );
-  TEAGN_DEBUG_CONDITION( ( band < nbands_ ), "Invalid band" );
-  
-  if( ( col < 1 ) || ( line < 1 ) || ( col >= bicubic_columns_bound_ ) || 
-    ( line >= bicubic_lines_bound_ ) ) {
-    
-    /* Near neighborhood interpolation will be used */
-    
-    if( ! input_raster_nptr_->getElement( TeRound( col ), TeRound( line ), 
-      value, band ) ) {
-      
-      TEAGN_TRUE_OR_THROW( raster_uses_dummy_, 
-        "Unable to get raster element" );       
-      
-      value = dummy_value_;
-    }    
-  } else {
-    bicubic_grid_raster_line_ = ( (unsigned int)floor( line ) ) - 1;
-    bicubic_grid_raster_col_ = ( (unsigned int)floor( col ) ) - 1;
-    
-    /* retriving raster elements */
-    
-    for( bicubic_buffer_line_ = 0 ; bicubic_buffer_line_ < 4 ; 
-      ++bicubic_buffer_line_) {
-      for( bicubic_buffer_col_ = 0 ; bicubic_buffer_col_ < 4 ; 
-        ++bicubic_buffer_col_) {
-      
-        if( ! input_raster_nptr_->getElement( 
-          bicubic_grid_raster_col_ + bicubic_buffer_col_, 
-          bicubic_grid_raster_line_ + bicubic_buffer_line_, 
-          bicubic_buffer_[bicubic_buffer_line_][bicubic_buffer_col_], band ) 
-          ) {
-          
-          TEAGN_TRUE_OR_THROW( raster_uses_dummy_, 
-            "Unable to get raster element" );       
-      
-          value = dummy_value_;          
-          
-          return;
-        }
-      }
-    }
-    
-    /* Bicubic weights calcule for the required position */
-    
-    bicubic_offset_x_ = col - (double)( bicubic_grid_raster_col_ + 1 );
-    bicubic_offset_y_ = line - (double)( bicubic_grid_raster_line_ + 1 );    
-    
-    bicubic_h_weights_[0] = BICUBIC_KERNEL( 1.0 + bicubic_offset_x_, 
-      bicubic_kernel_parameter_ );
-    bicubic_h_weights_[1] = BICUBIC_KERNEL( bicubic_offset_x_, 
-      bicubic_kernel_parameter_ );
-    bicubic_h_weights_[2] = BICUBIC_KERNEL( 1.0 - bicubic_offset_x_, 
-      bicubic_kernel_parameter_ );
-    bicubic_h_weights_[3] = BICUBIC_KERNEL( 2.0 - bicubic_offset_x_, 
-      bicubic_kernel_parameter_ );
-      
-    bicubic_v_weights_[0] = BICUBIC_KERNEL( 1.0 + bicubic_offset_y_, 
-      bicubic_kernel_parameter_ );
-    bicubic_v_weights_[1] = BICUBIC_KERNEL( bicubic_offset_y_, 
-      bicubic_kernel_parameter_ );
-    bicubic_v_weights_[2] = BICUBIC_KERNEL( 1.0 - bicubic_offset_y_, 
-      bicubic_kernel_parameter_ );
-    bicubic_v_weights_[3] = BICUBIC_KERNEL( 2.0 - bicubic_offset_y_, 
-      bicubic_kernel_parameter_ );
-      
-    bicubic_h_weights_sum_ = bicubic_h_weights_[0] + bicubic_h_weights_[1] +
-      bicubic_h_weights_[2] + bicubic_h_weights_[3];
-    bicubic_v_weights_sum_ = bicubic_v_weights_[0] + bicubic_v_weights_[1] +
-      bicubic_v_weights_[2] + bicubic_v_weights_[3];
-    
-    /* interpolating the value */
-    
-    for( bicubic_buffer_line_ = 0 ; bicubic_buffer_line_ < 4 ; 
-      ++bicubic_buffer_line_) {
-      
-      bicubic_int_line_accum_ = 0;
-      
-      for( bicubic_buffer_col_ = 0 ; bicubic_buffer_col_ < 4 ; 
-        ++bicubic_buffer_col_) {
-        
-        bicubic_int_line_accum_ += 
-          bicubic_buffer_[bicubic_buffer_line_][bicubic_buffer_col_] *
-          bicubic_h_weights_[ bicubic_buffer_col_ ];
-      }
-      
-      bicubic_int_lines_values_[ bicubic_buffer_line_ ] = 
-        bicubic_int_line_accum_ / bicubic_h_weights_sum_;
-    }
-    
-    value = bicubic_int_lines_values_[ 0 ] * bicubic_v_weights_[ 0 ] +
-      bicubic_int_lines_values_[ 1 ] * bicubic_v_weights_[ 1 ] +
-      bicubic_int_lines_values_[ 2 ] * bicubic_v_weights_[ 2 ] +
-      bicubic_int_lines_values_[ 3 ] * bicubic_v_weights_[ 3 ];
-    value = value / bicubic_v_weights_sum_;
-
-    /* Checking channel bounds */
-
-    if( value > input_raster_max_chan_val_vec_[ band ] ) {
-      value = input_raster_max_chan_val_vec_[ band ];
-    }
-
-    if( value < input_raster_min_chan_val_vec_[ band ] ) {
-      value = input_raster_min_chan_val_vec_[ band ];
-    }
-  }
-}
-
-
+#include "TePDIInterpolator.hpp"
+
+#include "TePDIUtils.hpp"
+
+#include <TeAgnostic.h>
+#include <TeUtils.h>
+
+#include <math.h>
+
+#define BICUBIC_MODULE( x ) ( ( x < 0 ) ? ( -1 * x ) : x )
+#define BICUBIC_K1( x , a ) ( ( ( a + 2 ) * x * x * x ) - \
+  ( ( a + 3 ) * x * x ) + 1 )
+#define BICUBIC_K2( x , a ) ( ( a * x * x * x ) - ( 5 * a * x * x ) + \
+  ( 8 * a * x ) - ( 4 * a ) )
+#define BICUBIC_RANGES(x,a) \
+  ( ( ( 0 <= x ) && ( x <= 1 ) ) ? \
+    BICUBIC_K1(x,a) \
+  : ( ( ( 1 < x ) && ( x <= 2 ) ) ? \
+      BICUBIC_K2(x,a) \
+    : 0 ) )
+#define BICUBIC_KERNEL( x , a ) BICUBIC_RANGES( BICUBIC_MODULE(x) , a )
+
+TePDIInterpolator::TePDIInterpolator()
+{
+  init();
+}
+
+
+TePDIInterpolator::~TePDIInterpolator()
+{
+  clear();
+}
+
+
+void TePDIInterpolator::init()
+{
+  input_raster_params_nptr_ = 0;
+  interp_funct_ptr_ = 0;
+  bicubic_lines_bound_ = 0;
+  bicubic_columns_bound_ = 0;
+  bicubic_kernel_parameter_ = -1.0;
+  last_valid_line_ = 0;
+  last_valid_col_ = 0;
+  raster_uses_dummy_ = false;
+  nbands_ = 0;
+  dummy_value_ = 0;
+  input_raster_ptr_.reset();
+  input_raster_nptr_ = 0;
+}
+
+
+void TePDIInterpolator::clear()
+{
+  input_raster_ptr_.reset();
+
+  init();
+}
+
+
+bool TePDIInterpolator::reset( const TeSharedPtr< TeRaster >& input_raster,
+  InterpMethod method, double dummy_value )
+{
+  clear();
+  init();
+
+  /* Checking input */
+
+  TEAGN_TRUE_OR_RETURN( input_raster.isActive(), "Inactive input raster" );
+  TEAGN_TRUE_OR_RETURN( input_raster->status(), "Input raster not ready" );
+  
+  if( method != NNMethod ) 
+  {
+    for( int band = 0 ; band < input_raster->params().nBands() ;
+      ++band ) 
+    {
+      TEAGN_TRUE_OR_RETURN( ( 
+        ( input_raster->params().photometric_[ band ] == 
+        TeRasterParams::TeMultiBand ) || 
+        ( input_raster->params().photometric_[ band ] == 
+        TeRasterParams::TeRGB ) ),
+      "Only NNMethod can be used on this raster" );
+    }
+  }
+
+  /* Switching interpolation function pointer */
+  
+  switch( method ) {
+    case BicubicMethod :
+    {
+      TEAGN_TRUE_OR_RETURN( ( input_raster->params().nlines_ > 3 ), 
+        "Invalid raster lines number" );
+      TEAGN_TRUE_OR_RETURN( ( input_raster->params().ncols_ > 3 ), 
+        "Invalid raster columns number" );
+    
+      interp_funct_ptr_ = &TePDIInterpolator::bicubicInterpolation;
+      break;
+    }
+    case BilinearMethod :
+    {
+      TEAGN_TRUE_OR_RETURN( ( input_raster->params().nlines_ > 1 ), 
+        "Invalid raster lines number" );
+      TEAGN_TRUE_OR_RETURN( ( input_raster->params().ncols_ > 1 ), 
+        "Invalid raster columns number" );
+    
+      interp_funct_ptr_ = &TePDIInterpolator::bilinearInterpolation;
+      break;
+    }
+    case NNMethod :
+    {
+      TEAGN_TRUE_OR_RETURN( ( input_raster->params().nlines_ > 0 ), 
+        "Invalid raster lines number" );
+      TEAGN_TRUE_OR_RETURN( ( input_raster->params().ncols_ > 0 ), 
+        "Invalid raster columns number" );
+    
+      interp_funct_ptr_ = &TePDIInterpolator::nNInterpolation;
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid interpolation method" );
+      break;
+    }
+  }
+  
+  input_raster_ptr_ = input_raster;
+  input_raster_nptr_ = input_raster_ptr_.nakedPointer();
+  input_raster_params_nptr_ = &(input_raster->params());
+  raster_uses_dummy_ = input_raster_params_nptr_->useDummy_;
+  nbands_ = input_raster_params_nptr_->nBands();
+  dummy_value_ = dummy_value;
+  
+  last_valid_line_ = (double)( input_raster_params_nptr_->nlines_ - 1 );
+  last_valid_col_ = (double)( input_raster_params_nptr_->ncols_ - 1 );
+  
+  bicubic_lines_bound_ = (double)( input_raster_params_nptr_->nlines_ - 2 );
+  bicubic_columns_bound_ = (double)( input_raster_params_nptr_->ncols_ - 2 );
+  
+  return true;
+}
+
+void TePDIInterpolator::nNInterpolation( const double& line, const double& col, 
+  const unsigned int& band, double& value )
+{
+  TEAGN_DEBUG_CONDITION( interp_funct_ptr_, 
+    "Invalid interpolation function pointer" );
+  TEAGN_DEBUG_CONDITION( ( band < nbands_ ), "Invalid band" );
+    
+  value = dummy_value_;
+  input_raster_nptr_->getElement( TeRound( col ), TeRound( line ), value, 
+    band );
+}
+
+
+void TePDIInterpolator::bilinearInterpolation( const double& line, 
+  const double& col, const unsigned int& band, double& value )
+{
+  TEAGN_DEBUG_CONDITION( interp_funct_ptr_, 
+    "Invalid interpolation function pointer" );
+  TEAGN_DEBUG_CONDITION( ( band < nbands_ ), "Invalid band" );
+  
+  if( ( line < 0.0 ) || ( col < 0.0 ) || ( line > last_valid_line_ ) ||
+    ( col > last_valid_col_ ) )
+  {
+    value = dummy_value_;
+    input_raster_nptr_->getElement( TeRound( col ), TeRound( line ), 
+      value, band );
+  }
+  else
+  {
+    bilinear_line_min_ = floor( line );
+    bilinear_line_max_ = ( ( bilinear_line_min_ == line ) ? bilinear_line_min_ : 
+      ( bilinear_line_min_ + 1.0 ) );
+    bilinear_col_min_ = floor( col );
+    bilinear_col_max_ = ( ( bilinear_col_min_ == col ) ? bilinear_col_min_ : 
+      ( bilinear_col_min_ + 1.0 ) );
+    
+    bilinear_diff_line_min_ = line - bilinear_line_min_;
+    bilinear_diff_line_max_ = line - bilinear_line_max_;
+    bilinear_diff_col_min_ = col - bilinear_col_min_;
+    bilinear_diff_col_max_ = col - bilinear_col_max_;
+    
+    bilinear_dist1_ = sqrt( 
+      ( bilinear_diff_line_min_ * bilinear_diff_line_min_ )
+      + ( bilinear_diff_col_min_ * bilinear_diff_col_min_ ) );
+    bilinear_dist2_ = sqrt( 
+      ( bilinear_diff_line_min_ * bilinear_diff_line_min_ )
+      + ( bilinear_diff_col_max_ * bilinear_diff_col_max_ ) );
+    bilinear_dist3_ = sqrt( 
+      ( bilinear_diff_line_max_ * bilinear_diff_line_max_ )
+      + ( bilinear_diff_col_min_ * bilinear_diff_col_min_ ) );
+    bilinear_dist4_ = sqrt( 
+      ( bilinear_diff_line_max_ * bilinear_diff_line_max_ )
+      + ( bilinear_diff_col_max_ * bilinear_diff_col_max_ ) );
+    
+    bilinear_weigh1_ = ( ( bilinear_dist1_ == 0 ) ? 1 : 
+      ( 1 / bilinear_dist1_ ) );
+    bilinear_weigh2_ = ( ( bilinear_dist2_ == 0 ) ? 1 : 
+      ( 1 / bilinear_dist2_ ) );
+    bilinear_weigh3_ = ( ( bilinear_dist3_ == 0 ) ? 1 : 
+      ( 1 / bilinear_dist3_ ) );
+    bilinear_weigh4_ = ( ( bilinear_dist4_ == 0 ) ? 1 : 
+      ( 1 / bilinear_dist4_ ) );
+    
+    bilinear_elem1_ = 0;
+    bilinear_elem2_ = 0;
+    bilinear_elem3_ = 0;
+    bilinear_elem4_ = 0;
+    
+    if( input_raster_nptr_->getElement( (unsigned int)bilinear_col_min_, 
+          (unsigned int)bilinear_line_min_, bilinear_elem1_, band ) &&
+        input_raster_nptr_->getElement( (unsigned int)bilinear_col_max_, 
+          (unsigned int)bilinear_line_min_, bilinear_elem2_, band ) &&        
+        input_raster_nptr_->getElement( (unsigned int)bilinear_col_min_, 
+          (unsigned int)bilinear_line_max_, bilinear_elem3_, band ) &&        
+        input_raster_nptr_->getElement( (unsigned int)bilinear_col_max_, 
+          (unsigned int)bilinear_line_max_, bilinear_elem4_, band ) ) 
+    {
+      value = ( ( bilinear_elem1_ * bilinear_weigh1_ ) + 
+        ( bilinear_elem2_ * bilinear_weigh2_ ) +
+        ( bilinear_elem3_ * bilinear_weigh3_ ) + 
+        ( bilinear_elem4_ * bilinear_weigh4_ ) ) / 
+        ( bilinear_weigh1_ + bilinear_weigh2_ + bilinear_weigh3_ + 
+        bilinear_weigh4_ );
+          
+      // if the interpolated value is dummy
+      // fall-back to NN interpolation          
+        
+      if( value == dummy_value_)
+      {
+        input_raster_nptr_->getElement( TeRound( col ), TeRound( line ), 
+          value, band );         
+      }
+    } else {
+      TEAGN_TRUE_OR_THROW( raster_uses_dummy_, 
+        "Unable to read raster element" );  
+    
+      value = dummy_value_;
+      input_raster_nptr_->getElement( TeRound( col ), TeRound( line ), 
+        value, band );     
+    }
+  }
+}
+
+
+void TePDIInterpolator::bicubicInterpolation( const double& line, 
+  const double& col, const unsigned int& band, double& value )
+{
+  TEAGN_DEBUG_CONDITION( interp_funct_ptr_, 
+    "Invalid interpolation function pointer" );
+  TEAGN_DEBUG_CONDITION( ( band < nbands_ ), "Invalid band" );
+  
+  if( ( col <= 1.0 ) || ( line <= 1.0 ) || ( col >= bicubic_columns_bound_ ) || 
+    ( line >= bicubic_lines_bound_ ) ) 
+  {
+    value = dummy_value_;
+    input_raster_nptr_->getElement( TeRound( col ), TeRound( line ), 
+      value, band );  
+  } 
+  else 
+  {
+    bicubic_grid_raster_line_ = ( (unsigned int)floor( line ) ) - 1;
+    bicubic_grid_raster_col_ = ( (unsigned int)floor( col ) ) - 1;
+    
+    /* retriving raster elements */
+    
+    for( bicubic_buffer_line_ = 0 ; bicubic_buffer_line_ < 4 ; 
+      ++bicubic_buffer_line_) 
+    {
+      for( bicubic_buffer_col_ = 0 ; bicubic_buffer_col_ < 4 ; 
+        ++bicubic_buffer_col_) 
+      {
+        if( ! input_raster_nptr_->getElement( 
+          bicubic_grid_raster_col_ + bicubic_buffer_col_, 
+          bicubic_grid_raster_line_ + bicubic_buffer_line_, 
+          bicubic_buffer_[bicubic_buffer_line_][bicubic_buffer_col_], band ) )
+        {
+          TEAGN_DEBUG_CONDITION( raster_uses_dummy_,
+            "Unable to read raster data at [" +
+            Te2String( bicubic_grid_raster_col_ + bicubic_buffer_col_, 1 ) 
+            + "," 
+            + Te2String( bicubic_grid_raster_line_ + bicubic_buffer_line_ ) 
+            + "]" );
+            
+          value = dummy_value_;
+          input_raster_nptr_->getElement( TeRound( col ), TeRound( line ), 
+            value, band );           
+            
+          return;
+        }
+      }
+    }
+    
+    /* Bicubic weights calcule for the required position */
+    
+    bicubic_offset_x_ = col - (double)( bicubic_grid_raster_col_ + 1 );
+    bicubic_offset_y_ = line - (double)( bicubic_grid_raster_line_ + 1 );    
+    
+    bicubic_h_weights_[0] = BICUBIC_KERNEL( 1.0 + bicubic_offset_x_, 
+      bicubic_kernel_parameter_ );
+    bicubic_h_weights_[1] = BICUBIC_KERNEL( bicubic_offset_x_, 
+      bicubic_kernel_parameter_ );
+    bicubic_h_weights_[2] = BICUBIC_KERNEL( 1.0 - bicubic_offset_x_, 
+      bicubic_kernel_parameter_ );
+    bicubic_h_weights_[3] = BICUBIC_KERNEL( 2.0 - bicubic_offset_x_, 
+      bicubic_kernel_parameter_ );
+      
+    bicubic_v_weights_[0] = BICUBIC_KERNEL( 1.0 + bicubic_offset_y_, 
+      bicubic_kernel_parameter_ );
+    bicubic_v_weights_[1] = BICUBIC_KERNEL( bicubic_offset_y_, 
+      bicubic_kernel_parameter_ );
+    bicubic_v_weights_[2] = BICUBIC_KERNEL( 1.0 - bicubic_offset_y_, 
+      bicubic_kernel_parameter_ );
+    bicubic_v_weights_[3] = BICUBIC_KERNEL( 2.0 - bicubic_offset_y_, 
+      bicubic_kernel_parameter_ );
+      
+    bicubic_h_weights_sum_ = bicubic_h_weights_[0] + bicubic_h_weights_[1] +
+      bicubic_h_weights_[2] + bicubic_h_weights_[3];
+    bicubic_v_weights_sum_ = bicubic_v_weights_[0] + bicubic_v_weights_[1] +
+      bicubic_v_weights_[2] + bicubic_v_weights_[3];
+    
+    /* interpolating the value */
+    
+    for( bicubic_buffer_line_ = 0 ; bicubic_buffer_line_ < 4 ; 
+      ++bicubic_buffer_line_) {
+      
+      bicubic_int_line_accum_ = 0;
+      
+      for( bicubic_buffer_col_ = 0 ; bicubic_buffer_col_ < 4 ; 
+        ++bicubic_buffer_col_) {
+        
+        bicubic_int_line_accum_ += 
+          bicubic_buffer_[bicubic_buffer_line_][bicubic_buffer_col_] *
+          bicubic_h_weights_[ bicubic_buffer_col_ ];
+      }
+      
+      bicubic_int_lines_values_[ bicubic_buffer_line_ ] = 
+        bicubic_int_line_accum_ / bicubic_h_weights_sum_;
+    }
+    
+    value = bicubic_int_lines_values_[ 0 ] * bicubic_v_weights_[ 0 ] +
+      bicubic_int_lines_values_[ 1 ] * bicubic_v_weights_[ 1 ] +
+      bicubic_int_lines_values_[ 2 ] * bicubic_v_weights_[ 2 ] +
+      bicubic_int_lines_values_[ 3 ] * bicubic_v_weights_[ 3 ];
+    value = value / bicubic_v_weights_sum_;
+    
+    // if the interpolated value is dummy
+    // fall-back to NN interpolation
+    
+    if( value == dummy_value_)
+    {
+      input_raster_nptr_->getElement( TeRound( col ), TeRound( line ), 
+        value, band );         
+    }
+  }
+}
+
+
diff --git a/src/terralib/image_processing/TePDIInterpolator.hpp b/src/terralib/image_processing/TePDIInterpolator.hpp
old mode 100755
new mode 100644
index 5b42833..bbd113d
--- a/src/terralib/image_processing/TePDIInterpolator.hpp
+++ b/src/terralib/image_processing/TePDIInterpolator.hpp
@@ -1,298 +1,289 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIINTERPOLATOR_HPP
-  #define TEPDIINTERPOLATOR_HPP
-
-  #include "TePDIDefines.hpp"
-  #include <TeSharedPtr.h>
-  #include <TeRaster.h>
-  
-  /**
-   * @brief This is the class for pixel interpolation from an input raster.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAux
-   */
-  class PDI_DLL TePDIInterpolator {
-    public :
-      /** @typedef TeSharedPtr< TePDIInterpolator > pointer 
-          Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIInterpolator > pointer;
-      /** @typedef const TeSharedPtr< TePDIInterpolator > const_pointer 
-          Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIInterpolator > const_pointer;
-      
-      /**
-       * @enum Allowed interpolation methods.
-       */      
-      enum InterpMethod {
-        /** Near neighborhood interpolation method. */
-        NNMethod = 1,
-        /** Bilinear interpolation method. */
-        BilinearMethod = 2,
-        /** Bicubic interpolation method. */
-        BicubicMethod = 3      
-      };
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIInterpolator();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIInterpolator();
-      
-      /**
-       * @brief Reset this interpolator instance.
-       *
-       * @param input_raster Input raster shared pointer.
-       * @param method Interpolation method (For pallete based rasters only
-       * the NNMethod can be used).
-       * @param dummy_value A pixel dummy value to use when the input_raster
-       * do not have dummy_values.
-       * @return true if OK, false on errors.
-       *
-       */
-      bool reset( const TeSharedPtr< TeRaster >& input_raster,
-        InterpMethod method, double dummy_value );
-        
-      /**
-       * @brief Interpolate a pixel value.
-       *
-       * @param line Line.
-       * @param col Column.
-       * @param band Band.
-       * @param value Interpolated value.
-       *
-       */
-      void interpolate( const double& line, const double& col, 
-        const unsigned int& band, double& value );        
-
-    protected :
-    
-      /**
-       * @brief Type definition for the a interpolation function pointer.
-       *
-       * @param line Line.
-       * @param col Column.
-       * @param band Band.
-       * @param value Interpolated value.
-       */      
-      typedef void (TePDIInterpolator::*InterpFunctPtr)( const double& line, 
-        const double& col, const unsigned int& band, double& value );
-
-      /**
-       * @brief Input raster naked pointer.
-       */
-      TeRasterParams* input_raster_params_nptr_;
-      
-      /**
-       * @brief The current interpolation function pointer.
-       */      
-      InterpFunctPtr interp_funct_ptr_;
-     
-      /**
-       * @brief The bicubic interpolation lines bound (not included).
-       */      
-      double bicubic_lines_bound_;      
-
-      /**
-       * @brief The bicubic interpolation columns bound (not included).
-       */      
-      double bicubic_columns_bound_;        
-      
-      /**
-       * @brief The bicubic kernel parameters.
-       */      
-      double bicubic_kernel_parameter_;        
-            
-      /**
-       * @brief The last valid line index ( included ).
-       */         
-      double last_valid_line_;
-
-      /**
-       * @brief The last valid column index ( included ).
-       */         
-      double last_valid_col_;
-
-      /**
-       * @brief The current raster dummy use status.
-       */      
-      bool raster_uses_dummy_;
-      
-      /**
-       * @brief The current raster bands number.
-       */      
-      unsigned int nbands_;      
-      
-      /**
-       * @brief The current raster bands number.
-       */      
-      double dummy_value_;       
-            
-      /**
-       * @brief Input raster shared pointer copy.
-       */
-      TeSharedPtr< TeRaster > input_raster_ptr_;      
-            
-      /**
-       * @brief Input raster shared naked pointer.
-       */
-      TeRaster* input_raster_nptr_;  
-
-      /**
-       * @brief Input raster maximum allowed channels values
-       * vector.
-       */
-      double* input_raster_max_chan_val_vec_;  
-
-      /**
-       * @brief Input raster minimum allowed channels values
-       * vector.
-       */
-      double* input_raster_min_chan_val_vec_; 
-      
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_line_min_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_line_max_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_col_min_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_col_max_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_diff_line_min_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_diff_line_max_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_diff_col_min_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_diff_col_max_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_dist1_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_dist2_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_dist3_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_dist4_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_weigh1_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_weigh2_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_weigh3_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_weigh4_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_elem1_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_elem2_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_elem3_;
-      /** @brief Internal bilinear function used variable. */      
-      double bilinear_elem4_;
-      
-      /** @brief Internal bicubic function used variable. */      
-      unsigned int bicubic_grid_raster_line_;
-      /** @brief Internal bicubic function used variable. */      
-      unsigned int bicubic_grid_raster_col_;
-      /** @brief Internal bicubic function used variable. */      
-      unsigned int bicubic_buffer_line_;
-      /** @brief Internal bicubic function used variable. */      
-      unsigned int bicubic_buffer_col_;
-      /** @brief Internal bicubic function used variable. */      
-      double bicubic_buffer_[4][4];
-      /** @brief Internal bicubic function used variable. */      
-      double bicubic_offset_x_;
-      /** @brief Internal bicubic function used variable. */      
-      double bicubic_offset_y_;
-      /** @brief Internal bicubic function used variable. */      
-      double bicubic_h_weights_[4];
-      /** @brief Internal bicubic function used variable. */      
-      double bicubic_v_weights_[4];
-      /** @brief Internal bicubic function used variable. */      
-      double bicubic_h_weights_sum_;
-      /** @brief Internal bicubic function used variable. */      
-      double bicubic_v_weights_sum_;
-      /** @brief Internal bicubic function used variable. */      
-      double bicubic_int_line_accum_;
-      /** @brief Internal bicubic function used variable. */      
-      double bicubic_int_lines_values_[4];
-
-      /**
-       * @brief Set default internal state.
-       */
-      void init();
-
-      /**
-       * @brief Clear all allocated resources and
-       * rollback to the initial state.
-       */
-      void clear();
-      
-      /**
-       * @brief Near neighborhood interpolation function.
-       *
-       * @param line Line.
-       * @param col Column.
-       * @param band Band.
-       * @param value Interpolated value.
-       */
-      void nNInterpolation( const double& line, const double& col,
-        const unsigned int& band, double& value );
-        
-      /**
-       * @brief Bilinear interpolation function.
-       *
-       * @param line Line.
-       * @param col Column.
-       * @param band Band.
-       * @param value Interpolated value.
-       */
-      void bilinearInterpolation( const double& line, const double& col, 
-        const unsigned int& band, double& value );
-        
-      /**
-       * @brief Bicubic interpolation function.
-       *
-       * @param line Line.
-       * @param col Column.
-       * @param band Band.
-       * @param value Interpolated value.
-       */
-      void bicubicInterpolation( const double& line, const double& col, 
-        const unsigned int& band, double& value );    
-
-  };
-  
-/** @example TePDIInterpolator_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDIFILTERMASK_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIINTERPOLATOR_HPP
+  #define TEPDIINTERPOLATOR_HPP
+
+  #include "TePDIDefines.hpp"
+  #include <TeSharedPtr.h>
+  #include <TeRaster.h>
+  
+  /**
+   * @class TePDIInterpolator
+   * @brief This is the class for pixel interpolation from an input raster.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAux
+   */
+  class PDI_DLL TePDIInterpolator {
+    public :
+      /** @typedef TeSharedPtr< TePDIInterpolator > pointer 
+          Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIInterpolator > pointer;
+      /** @typedef const TeSharedPtr< TePDIInterpolator > const_pointer 
+          Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIInterpolator > const_pointer;
+      
+      /**
+       * @enum Allowed interpolation methods.
+       */      
+      enum InterpMethod {
+        /** Near neighborhood interpolation method. */
+        NNMethod = 1,
+        /** Bilinear interpolation method. */
+        BilinearMethod = 2,
+        /** Bicubic interpolation method. */
+        BicubicMethod = 3      
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIInterpolator();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIInterpolator();
+      
+      /**
+       * @brief Reset this interpolator instance.
+       *
+       * @param input_raster Input raster shared pointer.
+       * @param method Interpolation method (For pallete based rasters only
+       * the NNMethod can be used).
+       * @param dummy_value A pixel dummy value to use when the input_raster
+       * do not have dummy_values.
+       * @return true if OK, false on errors.
+       *
+       */
+      bool reset( const TeSharedPtr< TeRaster >& input_raster,
+        InterpMethod method, double dummy_value );
+        
+      /**
+       * @brief Interpolate a pixel value.
+       *
+       * @param line Line.
+       * @param col Column.
+       * @param band Band.
+       * @param value Interpolated value.
+       * @note The caller of this method must be aware that the returned 
+       * interpolated value may be outside the original input raster valid 
+       * values range.       
+       *
+       */
+      inline void interpolate( const double& line, const double& col, 
+        const unsigned int& band, double& value )
+      {
+        TEAGN_DEBUG_CONDITION( interp_funct_ptr_, 
+          "Invalid interpolation function pointer" );
+     
+        ( this->*( interp_funct_ptr_ ) )( line, col, band, value );
+      };        
+
+    protected :
+    
+      /**
+       * @brief Type definition for the a interpolation function pointer.
+       *
+       * @param line Line.
+       * @param col Column.
+       * @param band Band.
+       * @param value Interpolated value.
+       */      
+      typedef void (TePDIInterpolator::*InterpFunctPtr)( const double& line, 
+        const double& col, const unsigned int& band, double& value );
+
+      /**
+       * @brief Input raster naked pointer (default:0).
+       */
+      TeRasterParams* input_raster_params_nptr_;
+      
+      /**
+       * @brief The current interpolation function pointer (default:0).
+       */      
+      InterpFunctPtr interp_funct_ptr_;
+     
+      /**
+       * @brief The bicubic interpolation lines bound (not included,
+       default:0).
+       */      
+      double bicubic_lines_bound_;      
+
+      /**
+       * @brief The bicubic interpolation columns bound (not included,
+       default:0).
+       */      
+      double bicubic_columns_bound_;        
+      
+      /**
+       * @brief The bicubic kernel parameters (default:-1.0).
+       */      
+      double bicubic_kernel_parameter_;        
+            
+      /**
+       * @brief The last valid line index ( included, default:0 ).
+       */         
+      double last_valid_line_;
+
+      /**
+       * @brief The last valid column index ( included, default:0 ).
+       */         
+      double last_valid_col_;
+
+      /**
+       * @brief The current raster dummy use status (default:false).
+       */      
+      bool raster_uses_dummy_;
+      
+      /**
+       * @brief The current raster bands number (default:0).
+       */      
+      unsigned int nbands_;      
+      
+      /**
+       * @brief The current raster bands number (default:0).
+       */      
+      double dummy_value_;       
+            
+      /**
+       * @brief Input raster shared pointer copy.
+       */
+      TeSharedPtr< TeRaster > input_raster_ptr_;      
+            
+      /**
+       * @brief Input raster shared naked pointer (default:0).
+       */
+      TeRaster* input_raster_nptr_;  
+
+      /**
+       * @brief Input raster maximum allowed channels values
+       * vector (default:0).
+       */
+      double* input_raster_max_chan_val_vec_;  
+
+      /**
+       * @brief Input raster minimum allowed channels values
+       * vector (default:0).
+       */
+      double* input_raster_min_chan_val_vec_; 
+      
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_line_min_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_line_max_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_col_min_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_col_max_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_diff_line_min_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_diff_line_max_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_diff_col_min_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_diff_col_max_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_dist1_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_dist2_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_dist3_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_dist4_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_weigh1_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_weigh2_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_weigh3_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_weigh4_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_elem1_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_elem2_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_elem3_;
+      /** @brief Internal bilinear function used variable. */      
+      double bilinear_elem4_;
+      
+      /** @brief Internal bicubic function used variable. */      
+      unsigned int bicubic_grid_raster_line_;
+      /** @brief Internal bicubic function used variable. */      
+      unsigned int bicubic_grid_raster_col_;
+      /** @brief Internal bicubic function used variable. */      
+      unsigned int bicubic_buffer_line_;
+      /** @brief Internal bicubic function used variable. */      
+      unsigned int bicubic_buffer_col_;
+      /** @brief Internal bicubic function used variable. */      
+      double bicubic_buffer_[4][4];
+      /** @brief Internal bicubic function used variable. */      
+      double bicubic_offset_x_;
+      /** @brief Internal bicubic function used variable. */      
+      double bicubic_offset_y_;
+      /** @brief Internal bicubic function used variable. */      
+      double bicubic_h_weights_[4];
+      /** @brief Internal bicubic function used variable. */      
+      double bicubic_v_weights_[4];
+      /** @brief Internal bicubic function used variable. */      
+      double bicubic_h_weights_sum_;
+      /** @brief Internal bicubic function used variable. */      
+      double bicubic_v_weights_sum_;
+      /** @brief Internal bicubic function used variable. */      
+      double bicubic_int_line_accum_;
+      /** @brief Internal bicubic function used variable. */      
+      double bicubic_int_lines_values_[4];
+
+      /**
+       * @brief Set default internal state.
+       */
+      void init();
+
+      /**
+       * @brief Clear all allocated resources and
+       * rollback to the initial state.
+       */
+      void clear();
+      
+      // just like the method interpolate above
+      void nNInterpolation( const double& line, const double& col,
+        const unsigned int& band, double& value );
+        
+      // just like the method interpolate above
+      void bilinearInterpolation( const double& line, const double& col, 
+        const unsigned int& band, double& value );
+        
+      // just like the method interpolate above
+      void bicubicInterpolation( const double& line, const double& col, 
+        const unsigned int& band, double& value );    
+
+  };
+  
+/** @example TePDIInterpolator_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDIFILTERMASK_HPP
diff --git a/src/terralib/image_processing/TePDIIsosegClas.cpp b/src/terralib/image_processing/TePDIIsosegClas.cpp
index c568f39..9c849c7 100644
--- a/src/terralib/image_processing/TePDIIsosegClas.cpp
+++ b/src/terralib/image_processing/TePDIIsosegClas.cpp
@@ -1,397 +1,397 @@
-#include "TePDIIsosegClas.hpp"
-#include "TePDIMathFunctions.hpp"
-#include "TePDIStrategyFactory.hpp"
-#include "TePDIAlgorithmFactory.hpp"
-#include "TePDIUtils.hpp"
-
-#include <TeBox.h>
-#include <TeUtils.h>
-#include <TeRasterParams.h>
-#include <TeRaster.h>
-#include <TeAgnostic.h>
-
-void TePDIIsosegClas::ResetState( const TePDIParameters& )
-{
-}
-
-TePDIIsosegClas::TePDIIsosegClas()
-{
-};
-
-TePDIIsosegClas::~TePDIIsosegClas()
-{
-};
-
-bool TePDIIsosegClas::SetThreshold(double t, int Nban)
-{
-  float ChiTab1[10][6] =
-  {
-    //     75.0%           90.0%           95.0%           99.0%           99.9%           100.%
-    {(float)1.32,    (float)2.71,    (float)3.84,    (float)6.64,    (float)10.83,   (float)10000.}, 
-    {(float)2.77,    (float)4.61,    (float)5.99,    (float)9.21,    (float)13.82,   (float)10000.}, 
-    {(float)4.11,    (float)6.25,    (float)7.82,    (float)11.35,   (float)16.27,   (float)10000.}, 
-    {(float)5.39,    (float)7.78,    (float)9.49,    (float)13.28,   (float)18.47,   (float)10000.}, 
-    {(float)6.63,    (float)9.24,    (float)11.07,   (float)15.09,   (float)20.52,   (float)10000.}, 
-    {(float)7.84,    (float)10.65,   (float)12.59,   (float)16.81,   (float)22.46,   (float)10000.}, 
-    {(float)9.04,    (float)12.02,   (float)14.07,   (float)18.48,   (float)24.32,   (float)10000.}, 
-    {(float)10.22,   (float)13.36,   (float)15.51,   (float)20.09,   (float)26.13,   (float)10000.}, 
-    {(float)11.39,   (float)14.68,   (float)16.92,   (float)21.67,   (float)27.88,   (float)10000.}, 
-    {(float)12.55,   (float)15.99,   (float)18.31,   (float)23.21,   (float)29.59,   (float)10000.}  
-  };
-
-  int  igl,
-    it;
-
-  if(t < 90.0)
-    it = 0;
-  else if(t < 95.0)
-    it = 1;
-  else if(t < 99.0)
-    it = 2;
-  else if(t < 99.9)
-    it = 3;
-  else it = 4;
-  
-  igl = Nban - 1;
-
-  threshold = ChiTab1[igl][it];
-
-  return true;
-}
-
-bool TePDIIsosegClas::MergeClusters()
-{
-  double dist = 0,
-      d1 = 0,
-      d2 = 0,
-      dmin = 0.0;
-  int  ic = 0,
-    ic_merge = 0,
-    ic_d1 = 0,
-    ic_d2 = 0;
-  bool flag = false;
-
-  // Remove the smallest clusters
-  while(clusters.size() > 1)
-  {
-    dmin = 0.0;
-    flag = false;
-    for(unsigned iclu1 = 0; iclu1 < clusters.size(); iclu1++)
-    {
-      for(unsigned iclu2 = 0; iclu2 < clusters.size(); iclu2++)
-      {
-        if(clusters[iclu1] == clusters[iclu2])
-          continue;
-
-        d1 = clusters[iclu1].Distance(clusters[iclu2]) + clusters[iclu1].GetLnDet();
-        d2 = clusters[iclu2].Distance(clusters[iclu1]) + clusters[iclu2].GetLnDet();
-        dist = ((d1 < d2) ? d2 : d1);
-        if(dist < dmin || (!flag))
-        {
-          ic_d1 = iclu1;
-          ic_d2 = iclu2;
-          flag = true;
-
-          dmin = dist;
-          ic = iclu2;
-          ic_merge = iclu1;
-        }
-      }
-    }
-    d1 = clusters[ic_d1].Distance(clusters[ic_d2]);
-    d2 = clusters[ic_d2].Distance(clusters[ic_d1]);
-    dist = ((d1 < d2) ? d2 : d1);
-
-    if(dist < threshold)
-    {
-      // merging two clusters
-      clusters[ic_d1].Merge(clusters[ic_d2]);
-
-      // setting new cluster id to the respective regions
-      int  id_old_cluster = clusters[ic_d2].GetId(),
-        id_new_cluster = clusters[ic_d1].GetId();
-      multimap<double, TePDIRegion, greater<double> >::iterator regions_it;
-      for (regions_it = regions.begin(); regions_it != regions.end(); ++regions_it)
-        if (regions_it->second.GetClass() == id_old_cluster)
-          regions_it->second.SetClass(id_new_cluster);
-
-      // arrange clusters vector
-      for (unsigned i = ic; i < (clusters.size() - 1); i++)
-        clusters[i] = clusters[i + 1];
-      clusters.pop_back();
-    }
-    else
-      break;
-  }
-
-  return true;
-}
-
-bool TePDIIsosegClas::GenerateClusters()
-{
-  int total_classes = 0,
-      total_classified = 0;
-
-  // loops until all the regions are classified
-  multimap<double, TePDIRegion, greater<double> >::iterator region_it,
-                                                            region_it_internal;
-
-  while (total_classified < total_regions)
-  {
-    // iterates over the regions, starting from the one with higher area, in descending order
-    for (region_it = regions.begin(); region_it != regions.end(); ++region_it)
-    {
-      TePDICluster tmp_cluster;
-
-      // if the region ins't classified, it's attributed to the class "total_classes"
-      if (region_it->second.GetClass() == 0)
-      {
-        ++total_classes;
-        int current_class = total_classes;
-        region_it->second.SetClass(current_class);
-
-        TEAGN_TRUE_OR_RETURN(tmp_cluster.Init(current_class, region_it->second), "Unable to init cluster");
-        total_classified++;
-        // searches for other regions with the same attributes, and put it into the same class
-        double dist = 0.0;
-        for (region_it_internal = regions.begin(); region_it_internal != regions.end(); ++region_it_internal)
-        {
-          if (region_it_internal->second.GetClass() == 0)
-          {
-            dist = tmp_cluster.Distance(region_it_internal->second);
-            if (dist <= threshold)
-            {
-              region_it_internal->second.SetClass(current_class);
-              TEAGN_TRUE_OR_RETURN(tmp_cluster.AddRegion(region_it_internal->second), "Unable to add region");
-              total_classified++;
-            }
-          }
-        }
-        clusters.push_back(tmp_cluster);
-      }
-    }
-  }
-
-  return true;
-}
-
-bool TePDIIsosegClas::CheckParameters(const TePDIParameters& parameters) const
-{
-  // Checking input_rasters
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
-  TEAGN_TRUE_OR_RETURN(input_rasters.size() > 0, "Invalid input rasters number");
-
-  vector<int> bands;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
-  TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), Te2String(input_rasters.size()) + " Invalid parameter: bands number " + Te2String(bands.size()));
-
-  for(unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); input_rasters_index++)
-  {
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of columns");
-  }
-
-  // Checking input_polygonset
-  TePDITypes::TePDIPolygonSetPtrType input_polygonset;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_polygonset", input_polygonset), "Missing parameter: input_polygon");
-  TEAGN_TRUE_OR_RETURN(input_polygonset.isActive(), "Invalid parameter: input_poligonset inactive");
-  
-  // Checking acceptance_limiar
-  double  acceptance_limiar;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("acceptance_limiar", acceptance_limiar), "Missing parameter: acceptance_limiar");
-
-  // Checking output_raster
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_raster", output_raster), "Missing parameter: output_raster");
-  TEAGN_TRUE_OR_RETURN(output_raster.isActive(), "Invalid parameter: output_raster inactive");
-  TEAGN_TRUE_OR_RETURN(output_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready");
-  return true;
-}
-
-// bool TePDIIsosegClas::Implementation(const TePDIParameters& params)
-bool TePDIIsosegClas::RunImplementation()
-{
-  // Setting the parameters
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  params_.GetParameter("input_rasters", input_rasters);
-
-  vector<int> bands;
-  params_.GetParameter("bands", bands);
-
-  W = input_rasters[0]->params().ncols_;
-  H = input_rasters[0]->params().nlines_;
-
-  TePDITypes::TePDIPolygonSetPtrType input_polygonset;
-  params_.GetParameter("input_polygonset", input_polygonset);
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params_.GetParameter("output_raster", output_raster);
-
-  double  acceptance_limiar;
-  params_.GetParameter("acceptance_limiar", acceptance_limiar);
-
-  /* Setting the output raster */
-  TeRasterParams output_raster_params = output_raster->params();
-
-  output_raster_params.setDataType( TeDOUBLE, -1 );
-  output_raster_params.nBands( 3 );
-  if( input_rasters[0]->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      input_rasters[0]->projection()->params() ) );
-    output_raster_params.projection( proj.nakedPointer() );
-  }
-  output_raster_params.boxResolution( input_rasters[0]->params().box().x1(), 
-    input_rasters[0]->params().box().y1(), input_rasters[0]->params().box().x2(), 
-    input_rasters[0]->params().box().y2(), input_rasters[0]->params().resx_, 
-    input_rasters[0]->params().resy_ ); 
-  output_raster_params.setPhotometric( TeRasterParams::TeRGB, -1 );
-
-  TEAGN_TRUE_OR_RETURN( output_raster->init( output_raster_params ),
-    "Output raster reset error" );    
-
-  for (unsigned pols = 0; pols < input_polygonset->size(); pols++)
-  {
-    TePolygon polygon(input_polygonset->operator[](pols));
-
-    // this iterator "walks" in the image, on the region defined by a specific polygon
-    TeRaster::iteratorPoly it = input_rasters[0]->begin(polygon, TeBoxPixelIn, 0);
-    TeRaster::iteratorPoly it_end = input_rasters[0]->end(polygon, TeBoxPixelIn, 0);
-
-    long area = (long)TeGeometryArea(polygon);
-    // pixel vector for each band
-    vector<vector<double> > pixels_per_band(bands.size());
-    vector<double> sums(bands.size());
-    vector<double> tmp(1);
-    for (unsigned band = 0; band < bands.size(); band++)
-      pixels_per_band.push_back(tmp);
-
-    long npix = 0;
-    while(it != it_end)
-    {
-      int  i = it.currentColumn(),
-        j = it.currentLine();
-
-      bool result = false;
-      for (unsigned band = 0; band < bands.size(); band++)
-      {
-        double tmp_pixel = -1;
-        if ((i >= 0 && i < H) && (j >=0 && j < W))
-        {
-          input_rasters[band]->getElement(i, j, tmp_pixel, band);
-          // output_raster->setElement(i, j, 255, 0, 0);
-          pixels_per_band[band].push_back(tmp_pixel);
-          sums[band] += tmp_pixel;
-          result = true;
-        }
-      }
-      if (result)
-        npix++;
-      ++it;
-    }
-
-    vector<double> tmp_mean;
-    tmp_mean.reserve(bands.size());
-    for (unsigned band = 0; band < bands.size(); band++)
-    {
-      tmp_mean.push_back(sums[band]/npix);
-    }
-
-    // sets the covarariance matrix
-    TeMatrix tmp_covar;
-    int nbands = bands.size();
-    TEAGN_TRUE_OR_RETURN(tmp_covar.Init(nbands, nbands, 0.0), "Unable to Init tmp_covar");
-    double sum;
-    for(int i = 0; i < nbands; i++)
-      for(int j = 0; j < nbands; j++)
-      {
-        sum = 0.0;
-        for (int p = 0; p < npix; p++)
-          sum += (pixels_per_band[i][p] - tmp_mean[i]) * (pixels_per_band[j][p] - tmp_mean[j]);
-        tmp_covar(i,j) = (double)(sum / (npix - 1));
-      }
-
-    TePDIRegion tmp_region(pols);
-    TEAGN_TRUE_OR_RETURN(tmp_region.Init(bands.size(), npix, tmp_mean, tmp_covar), "Unable to Init tmp_region");
-    regions.insert(pair<double, TePDIRegion>(area, tmp_region));
-  }
-  total_regions = regions.size();
-
-  TEAGN_TRUE_OR_RETURN(SetThreshold(acceptance_limiar, bands.size()), "Unable to SetThreshold");
-  TEAGN_TRUE_OR_RETURN(GenerateClusters(), "Unable to GenerateClusters");
-  TEAGN_TRUE_OR_RETURN(MergeClusters(), "Unable to MergeClusters");
-
-  // paint output_raster with the correspondent classes
-  for (int pols = 0; pols < total_regions; pols++)
-  {
-    TePolygon polygon(input_polygonset->operator[](pols));
-
-    // this iterator "walks" in the image, on the region defined by a specific polygon
-    TeRaster::iteratorPoly it = input_rasters[0]->begin(polygon, TeBoxPixelIn, 0);
-    TeRaster::iteratorPoly it_end = input_rasters[0]->end(polygon, TeBoxPixelIn, 0);
-
-    // searches for the region with Id = pols
-    multimap<double, TePDIRegion, greater<double> >::iterator  regions_it,
-                        regions_tmp = regions.begin();
-    for (regions_it = regions.begin(); regions_it != regions.end(); ++regions_it)
-      if (regions_it->second.GetId() == pols)
-      {
-        regions_tmp = regions_it;
-        break;
-      }
-
-    unsigned  bit_class = regions_it->second.GetClass();
-
-    // here, a set of colors for up to 81 classes, C(3, 4) = tree bands, four levels
-    vector<int> levels;
-    levels.push_back(0);
-    levels.push_back(50);
-    levels.push_back(100);
-    levels.push_back(150);
-    levels.push_back(200);
-    levels.push_back(255);
-	int change = levels.size();
-    vector<int> colors_R, colors_G, colors_B;
-    for (int c = 0, i = 0, j = 0, k = 0; c < 81; c++)
-    {
-      colors_R.push_back(levels[i]);
-      colors_G.push_back(levels[j]);
-      colors_B.push_back(levels[k]);
-
-      i++;
-      if (i > change)
-      {
-        i = 0;
-        j++;
-      }
-      if (j > change)
-      {
-        j = 0;
-        k++;
-      }
-      if (k > change)
-        k = 0;
-    }
-
-	if (bit_class > colors_R.size())
-		bit_class = 0;
-
-    double  R = colors_R[bit_class],
-        G = colors_G[bit_class],
-        B = colors_B[bit_class];
-
-    // paint output_raster with specific color class
-    while(it != it_end)
-    {
-      int  i = it.currentColumn(),
-        j = it.currentLine();
-
-	  output_raster->setElement(i, j, R, G, B);
-      ++it;
-    }
-  }
-
-  return true;
-}
+#include "TePDIIsosegClas.hpp"
+#include "TePDIMathFunctions.hpp"
+#include "TePDIStrategyFactory.hpp"
+#include "TePDIAlgorithmFactory.hpp"
+#include "TePDIUtils.hpp"
+
+#include <TeBox.h>
+#include <TeUtils.h>
+#include <TeRasterParams.h>
+#include <TeRaster.h>
+#include <TeAgnostic.h>
+
+void TePDIIsosegClas::ResetState( const TePDIParameters& )
+{
+}
+
+TePDIIsosegClas::TePDIIsosegClas()
+{
+};
+
+TePDIIsosegClas::~TePDIIsosegClas()
+{
+};
+
+bool TePDIIsosegClas::SetThreshold(double t, int Nban)
+{
+  float ChiTab1[10][6] =
+  {
+    //     75.0%           90.0%           95.0%           99.0%           99.9%           100.%
+    {(float)1.32,    (float)2.71,    (float)3.84,    (float)6.64,    (float)10.83,   (float)10000.}, 
+    {(float)2.77,    (float)4.61,    (float)5.99,    (float)9.21,    (float)13.82,   (float)10000.}, 
+    {(float)4.11,    (float)6.25,    (float)7.82,    (float)11.35,   (float)16.27,   (float)10000.}, 
+    {(float)5.39,    (float)7.78,    (float)9.49,    (float)13.28,   (float)18.47,   (float)10000.}, 
+    {(float)6.63,    (float)9.24,    (float)11.07,   (float)15.09,   (float)20.52,   (float)10000.}, 
+    {(float)7.84,    (float)10.65,   (float)12.59,   (float)16.81,   (float)22.46,   (float)10000.}, 
+    {(float)9.04,    (float)12.02,   (float)14.07,   (float)18.48,   (float)24.32,   (float)10000.}, 
+    {(float)10.22,   (float)13.36,   (float)15.51,   (float)20.09,   (float)26.13,   (float)10000.}, 
+    {(float)11.39,   (float)14.68,   (float)16.92,   (float)21.67,   (float)27.88,   (float)10000.}, 
+    {(float)12.55,   (float)15.99,   (float)18.31,   (float)23.21,   (float)29.59,   (float)10000.}  
+  };
+
+  int  igl,
+    it;
+
+  if(t < 90.0)
+    it = 0;
+  else if(t < 95.0)
+    it = 1;
+  else if(t < 99.0)
+    it = 2;
+  else if(t < 99.9)
+    it = 3;
+  else it = 4;
+  
+  igl = Nban - 1;
+
+  threshold = ChiTab1[igl][it];
+
+  return true;
+}
+
+bool TePDIIsosegClas::MergeClusters()
+{
+  double dist = 0,
+      d1 = 0,
+      d2 = 0,
+      dmin = 0.0;
+  int  ic = 0,
+    ic_merge = 0,
+    ic_d1 = 0,
+    ic_d2 = 0;
+  bool flag = false;
+
+  // Remove the smallest clusters
+  while(clusters.size() > 1)
+  {
+    dmin = 0.0;
+    flag = false;
+    for(unsigned iclu1 = 0; iclu1 < clusters.size(); iclu1++)
+    {
+      for(unsigned iclu2 = 0; iclu2 < clusters.size(); iclu2++)
+      {
+        if(clusters[iclu1] == clusters[iclu2])
+          continue;
+
+        d1 = clusters[iclu1].Distance(clusters[iclu2]) + clusters[iclu1].GetLnDet();
+        d2 = clusters[iclu2].Distance(clusters[iclu1]) + clusters[iclu2].GetLnDet();
+        dist = ((d1 < d2) ? d2 : d1);
+        if(dist < dmin || (!flag))
+        {
+          ic_d1 = iclu1;
+          ic_d2 = iclu2;
+          flag = true;
+
+          dmin = dist;
+          ic = iclu2;
+          ic_merge = iclu1;
+        }
+      }
+    }
+    d1 = clusters[ic_d1].Distance(clusters[ic_d2]);
+    d2 = clusters[ic_d2].Distance(clusters[ic_d1]);
+    dist = ((d1 < d2) ? d2 : d1);
+
+    if(dist < threshold)
+    {
+      // merging two clusters
+      clusters[ic_d1].Merge(clusters[ic_d2]);
+
+      // setting new cluster id to the respective regions
+      int  id_old_cluster = clusters[ic_d2].GetId(),
+        id_new_cluster = clusters[ic_d1].GetId();
+      multimap<double, TePDIRegion, greater<double> >::iterator regions_it;
+      for (regions_it = regions.begin(); regions_it != regions.end(); ++regions_it)
+        if (regions_it->second.GetClass() == id_old_cluster)
+          regions_it->second.SetClass(id_new_cluster);
+
+      // arrange clusters vector
+      for (unsigned i = ic; i < (clusters.size() - 1); i++)
+        clusters[i] = clusters[i + 1];
+      clusters.pop_back();
+    }
+    else
+      break;
+  }
+
+  return true;
+}
+
+bool TePDIIsosegClas::GenerateClusters()
+{
+  int total_classes = 0,
+      total_classified = 0;
+
+  // loops until all the regions are classified
+  multimap<double, TePDIRegion, greater<double> >::iterator region_it,
+                                                            region_it_internal;
+
+  while (total_classified < total_regions)
+  {
+    // iterates over the regions, starting from the one with higher area, in descending order
+    for (region_it = regions.begin(); region_it != regions.end(); ++region_it)
+    {
+      TePDICluster tmp_cluster;
+
+      // if the region ins't classified, it's attributed to the class "total_classes"
+      if (region_it->second.GetClass() == 0)
+      {
+        ++total_classes;
+        int current_class = total_classes;
+        region_it->second.SetClass(current_class);
+
+        TEAGN_TRUE_OR_RETURN(tmp_cluster.Init(current_class, region_it->second), "Unable to init cluster");
+        total_classified++;
+        // searches for other regions with the same attributes, and put it into the same class
+        double dist = 0.0;
+        for (region_it_internal = regions.begin(); region_it_internal != regions.end(); ++region_it_internal)
+        {
+          if (region_it_internal->second.GetClass() == 0)
+          {
+            dist = tmp_cluster.Distance(region_it_internal->second);
+            if (dist <= threshold)
+            {
+              region_it_internal->second.SetClass(current_class);
+              TEAGN_TRUE_OR_RETURN(tmp_cluster.AddRegion(region_it_internal->second), "Unable to add region");
+              total_classified++;
+            }
+          }
+        }
+        clusters.push_back(tmp_cluster);
+      }
+    }
+  }
+
+  return true;
+}
+
+bool TePDIIsosegClas::CheckParameters(const TePDIParameters& parameters) const
+{
+  // Checking input_rasters
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+  TEAGN_TRUE_OR_RETURN(input_rasters.size() > 0, "Invalid input rasters number");
+
+  vector<int> bands;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+  TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), Te2String(input_rasters.size()) + " Invalid parameter: bands number " + Te2String(bands.size()));
+
+  for(unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); input_rasters_index++)
+  {
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of columns");
+  }
+
+  // Checking input_polygonset
+  TePDITypes::TePDIPolygonSetPtrType input_polygonset;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_polygonset", input_polygonset), "Missing parameter: input_polygon");
+  TEAGN_TRUE_OR_RETURN(input_polygonset.isActive(), "Invalid parameter: input_poligonset inactive");
+  
+  // Checking acceptance_limiar
+  double  acceptance_limiar;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("acceptance_limiar", acceptance_limiar), "Missing parameter: acceptance_limiar");
+
+  // Checking output_raster
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_raster", output_raster), "Missing parameter: output_raster");
+  TEAGN_TRUE_OR_RETURN(output_raster.isActive(), "Invalid parameter: output_raster inactive");
+  TEAGN_TRUE_OR_RETURN(output_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready");
+  return true;
+}
+
+// bool TePDIIsosegClas::Implementation(const TePDIParameters& params)
+bool TePDIIsosegClas::RunImplementation()
+{
+  // Setting the parameters
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  params_.GetParameter("input_rasters", input_rasters);
+
+  vector<int> bands;
+  params_.GetParameter("bands", bands);
+
+  W = input_rasters[0]->params().ncols_;
+  H = input_rasters[0]->params().nlines_;
+
+  TePDITypes::TePDIPolygonSetPtrType input_polygonset;
+  params_.GetParameter("input_polygonset", input_polygonset);
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter("output_raster", output_raster);
+
+  double  acceptance_limiar;
+  params_.GetParameter("acceptance_limiar", acceptance_limiar);
+
+  /* Setting the output raster */
+  TeRasterParams output_raster_params = output_raster->params();
+
+  output_raster_params.setDataType( TeDOUBLE, -1 );
+  output_raster_params.nBands( 3 );
+  if( input_rasters[0]->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      input_rasters[0]->projection()->params() ) );
+    output_raster_params.projection( proj.nakedPointer() );
+  }
+  output_raster_params.boxResolution( input_rasters[0]->params().box().x1(), 
+    input_rasters[0]->params().box().y1(), input_rasters[0]->params().box().x2(), 
+    input_rasters[0]->params().box().y2(), input_rasters[0]->params().resx_, 
+    input_rasters[0]->params().resy_ ); 
+  output_raster_params.setPhotometric( TeRasterParams::TeRGB, -1 );
+
+  TEAGN_TRUE_OR_RETURN( output_raster->init( output_raster_params ),
+    "Output raster reset error" );    
+
+  for (unsigned pols = 0; pols < input_polygonset->size(); pols++)
+  {
+    TePolygon polygon(input_polygonset->operator[](pols));
+
+    // this iterator "walks" in the image, on the region defined by a specific polygon
+    TeRaster::iteratorPoly it = input_rasters[0]->begin(polygon, TeBoxPixelIn, 0);
+    TeRaster::iteratorPoly it_end = input_rasters[0]->end(polygon, TeBoxPixelIn, 0);
+
+    long area = (long)TeGeometryArea(polygon);
+    // pixel vector for each band
+    vector<vector<double> > pixels_per_band(bands.size());
+    vector<double> sums(bands.size());
+    vector<double> tmp(1);
+    for (unsigned band = 0; band < bands.size(); band++)
+      pixels_per_band.push_back(tmp);
+
+    long npix = 0;
+    while(it != it_end)
+    {
+      int  i = it.currentColumn(),
+        j = it.currentLine();
+
+      bool result = false;
+      for (unsigned band = 0; band < bands.size(); band++)
+      {
+        double tmp_pixel = -1;
+        if ((i >= 0 && i < H) && (j >=0 && j < W))
+        {
+          input_rasters[band]->getElement(i, j, tmp_pixel, band);
+          // output_raster->setElement(i, j, 255, 0, 0);
+          pixels_per_band[band].push_back(tmp_pixel);
+          sums[band] += tmp_pixel;
+          result = true;
+        }
+      }
+      if (result)
+        npix++;
+      ++it;
+    }
+
+    vector<double> tmp_mean;
+    tmp_mean.reserve(bands.size());
+    for (unsigned band = 0; band < bands.size(); band++)
+    {
+      tmp_mean.push_back(sums[band]/npix);
+    }
+
+    // sets the covarariance matrix
+    TeMatrix tmp_covar;
+    int nbands = bands.size();
+    TEAGN_TRUE_OR_RETURN(tmp_covar.Init(nbands, nbands, 0.0), "Unable to Init tmp_covar");
+    double sum;
+    for(int i = 0; i < nbands; i++)
+      for(int j = 0; j < nbands; j++)
+      {
+        sum = 0.0;
+        for (int p = 0; p < npix; p++)
+          sum += (pixels_per_band[i][p] - tmp_mean[i]) * (pixels_per_band[j][p] - tmp_mean[j]);
+        tmp_covar(i,j) = (double)(sum / (npix - 1));
+      }
+
+    TePDIRegion tmp_region(pols);
+    TEAGN_TRUE_OR_RETURN(tmp_region.Init(bands.size(), npix, tmp_mean, tmp_covar), "Unable to Init tmp_region");
+    regions.insert(pair<double, TePDIRegion>(area, tmp_region));
+  }
+  total_regions = regions.size();
+
+  TEAGN_TRUE_OR_RETURN(SetThreshold(acceptance_limiar, bands.size()), "Unable to SetThreshold");
+  TEAGN_TRUE_OR_RETURN(GenerateClusters(), "Unable to GenerateClusters");
+  TEAGN_TRUE_OR_RETURN(MergeClusters(), "Unable to MergeClusters");
+
+  // paint output_raster with the correspondent classes
+  for (int pols = 0; pols < total_regions; pols++)
+  {
+    TePolygon polygon(input_polygonset->operator[](pols));
+
+    // this iterator "walks" in the image, on the region defined by a specific polygon
+    TeRaster::iteratorPoly it = input_rasters[0]->begin(polygon, TeBoxPixelIn, 0);
+    TeRaster::iteratorPoly it_end = input_rasters[0]->end(polygon, TeBoxPixelIn, 0);
+
+    // searches for the region with Id = pols
+    multimap<double, TePDIRegion, greater<double> >::iterator  regions_it,
+                        regions_tmp = regions.begin();
+    for (regions_it = regions.begin(); regions_it != regions.end(); ++regions_it)
+      if (regions_it->second.GetId() == pols)
+      {
+        regions_tmp = regions_it;
+        break;
+      }
+
+    unsigned  bit_class = regions_it->second.GetClass();
+
+    // here, a set of colors for up to 81 classes, C(3, 4) = tree bands, four levels
+    vector<int> levels;
+    levels.push_back(0);
+    levels.push_back(50);
+    levels.push_back(100);
+    levels.push_back(150);
+    levels.push_back(200);
+    levels.push_back(255);
+	int change = levels.size();
+    vector<int> colors_R, colors_G, colors_B;
+    for (int c = 0, i = 0, j = 0, k = 0; c < 81; c++)
+    {
+      colors_R.push_back(levels[i]);
+      colors_G.push_back(levels[j]);
+      colors_B.push_back(levels[k]);
+
+      i++;
+      if (i >= change)
+      {
+        i = 0;
+        j++;
+      }
+      if (j >= change)
+      {
+        j = 0;
+        k++;
+      }
+      if (k >= change)
+        k = 0;
+    }
+
+	if (bit_class >= colors_R.size())
+		bit_class = 0;
+
+    double  R = colors_R[bit_class],
+        G = colors_G[bit_class],
+        B = colors_B[bit_class];
+
+    // paint output_raster with specific color class
+    while(it != it_end)
+    {
+      int  i = it.currentColumn(),
+        j = it.currentLine();
+
+	  output_raster->setElement(i, j, R, G, B);
+      ++it;
+    }
+  }
+
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIIsosegClas.hpp b/src/terralib/image_processing/TePDIIsosegClas.hpp
index 43d963d..fb78015 100644
--- a/src/terralib/image_processing/TePDIIsosegClas.hpp
+++ b/src/terralib/image_processing/TePDIIsosegClas.hpp
@@ -1,145 +1,145 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIISOSEGCLAS
-  #define TEPDIISOSEGCLAS
-
-#include "TePDIAlgorithm.hpp"
-
-#include "TePDIRegion.hpp"
-#include "TePDICluster.hpp"
-
-#include <string>
-#include <set>
-
-  /**
-   * @brief Isoseg classification algorithm.
-   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIClassificationAlgorithms
-   *
-   * @note The required parameters are:
-   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Input rasters
-   * @param bands (vector<int>) - Input bands
-   * @param input_polygons (TePolygonSet) - Input polygonset
-   * @param acceptance_limiar (double) - Acceptance Limiar (90%, 95%, 99%, 100%)
-   * @param output_raster (TePDITypes::TePDIRasterPtrType) - Output raster.
-   *
-   */
-
-class PDI_DLL TePDIIsosegClas : public TePDIAlgorithm
-{
-  private:
-    /**
-    * Generates the Clusters, starting from the Region with higher area
-    * inserting into the same cluster other regions whose distance to this 
-    * Cluster is lower then the Threshold
-    *
-    * @return true if everything was done OK
-    */
-    bool GenerateClusters();
-
-    /**
-    * Merge similar clusters
-    *
-    * @return true if everything was done OK
-    */
-    bool MergeClusters();
-
-    /**
-    * Set the threshold value, based on the ChiTab1
-    */
-    bool SetThreshold(double t, int Nban);
-
-    /**
-    * Limiar of acceptance
-    */
-    double threshold;
-
-    /**
-    * Width and Height of image
-    */
-    long W, H;
-
-    /**
-    * Number of regions present in the PolygonSet
-    */
-    int total_regions;
-
-    /**
-    * Set of regions, ordered by area
-    */
-    multimap<double, TePDIRegion, greater<double> > regions;
-
-    /**
-    * Set of clusters
-    */
-    vector<TePDICluster> clusters;
-
-  public :
-
-    typedef TeSharedPtr< TePDIIsosegClas > pointer;
-    typedef const TeSharedPtr< TePDIIsosegClas > const_pointer;
-
-    /**
-    * Default constructor
-    *
-    * @param factoryName Factory name.
-    */
-    TePDIIsosegClas();
-
-    /**
-    * Default Destructor
-    */
-    ~TePDIIsosegClas();
-
-    /**
-    * Checks if the supplied parameters fits the requirements of each
-    * PDI strategy.
-    *
-    * Error log messages must be generated. No exceptions generated.
-    *
-    * @param parameters The parameters to be checked.
-    * @return true if the parameters are OK. false if not.
-    */
-    bool CheckParameters(const TePDIParameters& parameters) const;
-
-  protected :
-
-	/**
-	* @brief Reset the internal state to the initial state.
-	*
-	* @param params The new parameters referent at initial state.
-	*/
-	void ResetState( const TePDIParameters& );
-
-	/**
-	* @brief Runs the current algorithm implementation.
-	*
-	* @return true if OK. false on error.
-	*/
-	bool RunImplementation();
-};
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIISOSEGCLAS
+  #define TEPDIISOSEGCLAS
+
+#include "TePDIAlgorithm.hpp"
+
+#include "TePDIRegion.hpp"
+#include "TePDICluster.hpp"
+
+#include <string>
+#include <set>
+
+  /**
+   * @brief Isoseg classification algorithm.
+   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIClassificationAlgorithms
+   *
+   * @note The required parameters are:
+   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Input rasters
+   * @param bands (vector<int>) - Input bands
+   * @param input_polygons (TePolygonSet) - Input polygonset
+   * @param acceptance_limiar (double) - Acceptance Limiar (90%, 95%, 99%, 100%)
+   * @param output_raster (TePDITypes::TePDIRasterPtrType) - Output raster.
+   *
+   */
+
+class PDI_DLL TePDIIsosegClas : public TePDIAlgorithm
+{
+  private:
+    /**
+    * Generates the Clusters, starting from the Region with higher area
+    * inserting into the same cluster other regions whose distance to this 
+    * Cluster is lower then the Threshold
+    *
+    * @return true if everything was done OK
+    */
+    bool GenerateClusters();
+
+    /**
+    * Merge similar clusters
+    *
+    * @return true if everything was done OK
+    */
+    bool MergeClusters();
+
+    /**
+    * Set the threshold value, based on the ChiTab1
+    */
+    bool SetThreshold(double t, int Nban);
+
+    /**
+    * Limiar of acceptance
+    */
+    double threshold;
+
+    /**
+    * Width and Height of image
+    */
+    long W, H;
+
+    /**
+    * Number of regions present in the PolygonSet
+    */
+    int total_regions;
+
+    /**
+    * Set of regions, ordered by area
+    */
+    multimap<double, TePDIRegion, greater<double> > regions;
+
+    /**
+    * Set of clusters
+    */
+    vector<TePDICluster> clusters;
+
+  public :
+
+    typedef TeSharedPtr< TePDIIsosegClas > pointer;
+    typedef const TeSharedPtr< TePDIIsosegClas > const_pointer;
+
+    /**
+    * Default constructor
+    *
+    * @param factoryName Factory name.
+    */
+    TePDIIsosegClas();
+
+    /**
+    * Default Destructor
+    */
+    ~TePDIIsosegClas();
+
+    /**
+    * Checks if the supplied parameters fits the requirements of each
+    * PDI strategy.
+    *
+    * Error log messages must be generated. No exceptions generated.
+    *
+    * @param parameters The parameters to be checked.
+    * @return true if the parameters are OK. false if not.
+    */
+    bool CheckParameters(const TePDIParameters& parameters) const;
+
+  protected :
+
+	/**
+	* @brief Reset the internal state to the initial state.
+	*
+	* @param params The new parameters referent at initial state.
+	*/
+	void ResetState( const TePDIParameters& );
+
+	/**
+	* @brief Runs the current algorithm implementation.
+	*
+	* @return true if OK. false on error.
+	*/
+	bool RunImplementation();
+};
+
+#endif
diff --git a/src/terralib/image_processing/TePDIIsosegClasFactory.cpp b/src/terralib/image_processing/TePDIIsosegClasFactory.cpp
index 8ff85df..21f8321 100644
--- a/src/terralib/image_processing/TePDIIsosegClasFactory.cpp
+++ b/src/terralib/image_processing/TePDIIsosegClasFactory.cpp
@@ -1,25 +1,25 @@
-
-#include "TePDIIsosegClasFactory.hpp"
-#include "TePDIIsosegClas.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIIsosegClasFactory::TePDIIsosegClasFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIIsosegClas" ) )
-{
-}
-
-TePDIIsosegClasFactory::~TePDIIsosegClasFactory()
-{
-}
-
-
-TePDIAlgorithm* TePDIIsosegClasFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIIsosegClas();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+
+#include "TePDIIsosegClasFactory.hpp"
+#include "TePDIIsosegClas.hpp"
+#include <TeAgnostic.h>
+
+
+TePDIIsosegClasFactory::TePDIIsosegClasFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIIsosegClas" ) )
+{
+}
+
+TePDIIsosegClasFactory::~TePDIIsosegClasFactory()
+{
+}
+
+
+TePDIAlgorithm* TePDIIsosegClasFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIIsosegClas();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIIsosegClasFactory.hpp b/src/terralib/image_processing/TePDIIsosegClasFactory.hpp
index 1dd4293..23be494 100644
--- a/src/terralib/image_processing/TePDIIsosegClasFactory.hpp
+++ b/src/terralib/image_processing/TePDIIsosegClasFactory.hpp
@@ -1,68 +1,68 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIISOSEGCLASFACTORY_HPP
-  #define TEPDIISOSEGCLASFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for isoseg classification algorithm factory.
-   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIIsosegClasFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIIsosegClasFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIIsosegClasFactory();
-      
-    protected :  
-      
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIIsosegClasFactory TePDIIsosegClasFactory_instance;
-  };  
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIISOSEGCLASFACTORY_HPP
+  #define TEPDIISOSEGCLASFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for isoseg classification algorithm factory.
+   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIIsosegClasFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIIsosegClasFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIIsosegClasFactory();
+      
+    protected :  
+      
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace {
+    static TePDIIsosegClasFactory TePDIIsosegClasFactory_instance;
+  };  
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIJointHistogram.cpp b/src/terralib/image_processing/TePDIJointHistogram.cpp
old mode 100755
new mode 100644
index c57c134..ee2dc7d
--- a/src/terralib/image_processing/TePDIJointHistogram.cpp
+++ b/src/terralib/image_processing/TePDIJointHistogram.cpp
@@ -1,1026 +1,983 @@
-#include "TePDIJointHistogram.hpp"
-
-#include "TePDIPIManager.hpp"
-
-#include <TeOverlay.h>
-#include <TeBox.h>
-#include <TeGeometry.h>
-#include <TeAgnostic.h>
-
-TePDIJointHistogram::TePDIJointHistogram()
-{
-  progressEnabled_ = true;
-
-  init_jhist_ = 0;
-  init_jhist_lines_ = 0;
-  init_jhist_cols_ = 0;
-  init_r1hist_ = 0;
-  init_r2hist_ = 0;
-}
-
-
-TePDIJointHistogram::TePDIJointHistogram( const TePDIJointHistogram& external )
-{
-  operator=( external );
-}
-
-
-TePDIJointHistogram::~TePDIJointHistogram()
-{
-  clear();
-}
-
-const TePDIJointHistogram& TePDIJointHistogram::operator=( const 
-  TePDIJointHistogram& external )    
-{
-  clear();
-
-  jHistContainer_ = external.jHistContainer_;
-  r1Histogram_ = external.r1Histogram_;
-  r2Histogram_ = external.r2Histogram_;
-  
-  return external;
-}
-
-void TePDIJointHistogram::toggleProgress( bool enabled )
-{
-  progressEnabled_ = enabled;
-}
-
-bool TePDIJointHistogram::update( TeRaster& inputRaster1, 
-  unsigned int inputRasterChn1, TeRaster& inputRaster2, 
-  unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
-  unsigned int levels, const TePolygonSet& restricPolSet )
-{
-  TEAGN_TRUE_OR_RETURN( inputRaster1.params().status_ != 
-    TeRasterParams::TeNotReady, "Raster1 not ready" )
-  TEAGN_TRUE_OR_RETURN( inputRaster2.params().status_ != 
-    TeRasterParams::TeNotReady, "Raster2 not ready" )
-    
-  TEAGN_TRUE_OR_RETURN( inputRaster1.params().resx_ ==
-    inputRaster2.params().resx_, "X resolution mismatch" )
-  TEAGN_TRUE_OR_RETURN( inputRaster1.params().resy_ ==
-    inputRaster2.params().resy_, "Y resolution mismatch" )
-      
-  TEAGN_TRUE_OR_RETURN( (int)inputRasterChn1 < inputRaster1.nBands(),
-    "Invalid channel" )
-  TEAGN_TRUE_OR_RETURN( (int)inputRasterChn2 < inputRaster2.nBands(),
-    "Invalid channel" )
-      
-  clear();
-    
-  // Calc the intersection between the restriction polygon set,
-  // and both rasters bounding box
-     
-  TePolygonSet interPS;
-  {
-    TePolygon pol1 = polygonFromBox( inputRaster1.params().boundingBox() );
-    TePolygon pol2 = polygonFromBox( inputRaster2.params().boundingBox() );
-    
-    TePolygonSet ps1;
-    ps1.add( pol1 );
-    
-    TePolygonSet ps2;
-    ps2.add( pol2 );
-    
-    TePolygonSet boxesInterPS;
-    TEAGN_TRUE_OR_RETURN( TeOVERLAY::TeIntersection( ps1, ps2, boxesInterPS ),
-      "Unable to find the intersection between both raster bounding boxes" );
-    
-    if( restricPolSet.size() == 0 )
-    {
-      interPS = boxesInterPS;
-    }
-    else
-    {
-      TEAGN_TRUE_OR_RETURN( TeOVERLAY::TeIntersection( boxesInterPS, restricPolSet, 
-        interPS ), "Unable to find the intersection between both raster bounding boxes" );
-    }
-  }
-    
-  // Pallete based rasters not supported
-    
-  if( ( inputRaster1.params().photometric_[ inputRasterChn1 ] == 
-    TeRasterParams::TePallete ) ||
-    ( inputRaster2.params().photometric_[ inputRasterChn2 ] == 
-    TeRasterParams::TePallete ) ) 
-  {
-    TEAGN_LOG_AND_RETURN( "Pallete based rasters not supported" )
-  }
-    
-  // Optimization for floating point rasters
-
-  if( ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeDOUBLE ) ||
-      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeFLOAT ) ||
-      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeDOUBLE ) ||
-      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeFLOAT ) )
-  {
-    try
-    {
-      return updateFloat( inputRaster1, inputRasterChn1, inputRaster2, 
-        inputRasterChn2, iterStrat, levels, interPS );
-    }
-    catch(...)
-    {
-      TEAGN_LOG_AND_RETURN( "Not enought memory" );
-    }
-  }
-  
-  // Optmization for integer rasters
-		  
-  if( ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeINTEGER ) ||
-      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeUNSIGNEDLONG ) ||
-      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeLONG ) ||
-      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeSHORT ) ||
-      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeUNSIGNEDSHORT ) ||
-      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeINTEGER ) ||
-      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeUNSIGNEDLONG ) ||
-      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeLONG ) ||
-      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeSHORT ) ||
-      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeUNSIGNEDSHORT ) )
-  {
-    return updateInteger( inputRaster1, inputRasterChn1, inputRaster2, 
-      inputRasterChn2, iterStrat, interPS );
-  }  
-  
-  // Optimization for 8 bits or 16 bits
-  
-  if( ( ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeCHAR ) ||
-      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeUNSIGNEDCHAR ) ) &&
-      ( ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeCHAR ) ||
-      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeUNSIGNEDCHAR ) ) )
-  {
-    return update8Bits( inputRaster1, inputRasterChn1, inputRaster2, 
-      inputRasterChn2, iterStrat, interPS );
-  }  
-  
-  TEAGN_LOG_AND_THROW( "Invalid data type" );
-  return false;
-}
-
-void TePDIJointHistogram::clear()
-{
-  jHistContainer_.clear();
-  r1Histogram_.clear();
-  r2Histogram_.clear();
-
-  clearTempHistBuffers();
-}
-
-const TePDIHistogram& TePDIJointHistogram::getRaster1Hist() const
-{
-  return r1Histogram_;
-}
-
-const TePDIHistogram& TePDIJointHistogram::getRaster2Hist() const
-{
-  return r2Histogram_;
-}
-
-TePDIJointHistogram::const_iterator TePDIJointHistogram::begin() const
-{
-  return jHistContainer_.begin();
-}
-
-TePDIJointHistogram::const_iterator TePDIJointHistogram::end() const
-{
-  return jHistContainer_.end();
-}
-
-unsigned int TePDIJointHistogram::size() const
-{
-  return (unsigned int)jHistContainer_.size();
-}
-
-void TePDIJointHistogram::getInverseJHist( TePDIJointHistogram& external )
-{
-  external.clear();
-  external.r1Histogram_ = r2Histogram_;
-  external.r2Histogram_ = r1Histogram_;
-
-  ConteinerT::const_iterator cit = jHistContainer_.begin();
-  ConteinerT::const_iterator cit_end = jHistContainer_.end();
-  std::pair< double, double > tempPair;
-  while( cit != cit_end )
-  {
-    tempPair.first = cit->first.second;
-    tempPair.second = cit->first.first;
-    external.jHistContainer_[ tempPair ] = cit->second;
-    
-    ++cit;
-  }
-}
-
-unsigned long int TePDIJointHistogram::getFreqSum() const
-{
-  ConteinerT::const_iterator cit = jHistContainer_.begin();
-  ConteinerT::const_iterator cit_end = jHistContainer_.end();
-
-  unsigned long int sum = 0;
-
-  while( cit != cit_end )
-  {
-    sum += (unsigned long int)cit->second;
-    
-    ++cit;
-  }
-  
-  return sum;
-}
-
-bool TePDIJointHistogram::updateFloat( TeRaster& inputRaster1, 
-  unsigned int inputRasterChn1, TeRaster& inputRaster2, 
-  unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
-  unsigned int levels, const TePolygonSet& restricPolSet )
-{
-  const unsigned long int progress_steps = 
-    getProgressSteps( restricPolSet, inputRaster1.params().resy_ );   
-  
-  /* Finding raster 1 lowest end highest levels */
-  
-  double r1_lowest_level = 0;
-  double r1_highest_level = 0;  
-    
-  if ( inputRaster1.params().decoderIdentifier_ == "DB" ) {
-    r1_lowest_level = inputRaster1.params().vmin_[ inputRasterChn1 ];
-    r1_highest_level = inputRaster1.params().vmax_[ inputRasterChn1 ];
-
-    // Return if there is no pixel data to read 
-
-    if( inputRaster1.params().useDummy_ && ( r1_lowest_level == 
-      inputRaster1.params().dummy_[ inputRasterChn1 ] ) && ( r1_highest_level == 
-      inputRaster1.params().dummy_[ inputRasterChn1 ] ) )
-    {
-      return true;
-    }
-  } else {
-    r1_lowest_level = DBL_MAX;
-    r1_highest_level = ( -1.0 ) * DBL_MAX;  
-
-    bool lh_levels_set = false; // lowest_level and highest_level values set
-    
-    TeRaster::iteratorPoly input_raster_it;
-    TePDIPIManager progress( "Finding histogram range", progress_steps, 
-      progressEnabled_ );
-    double current_raster_level = 0;
-    unsigned int curr_line = 0;
-    unsigned int curr_col = 0;
-    unsigned int last_line = 0;    
-    
-    for( unsigned int local_polset_index = 0 ; local_polset_index < 
-      restricPolSet.size() ; ++local_polset_index ) 
-    {
-      input_raster_it = inputRaster1.begin( restricPolSet[ local_polset_index ], 
-        iterStrat, 0 );
-      
-      while( ! input_raster_it.end() ) {
-        curr_line = input_raster_it.currentLine();
-        curr_col = input_raster_it.currentColumn();
-        
-        if( inputRaster1.getElement( curr_col, curr_line, current_raster_level,
-          inputRasterChn1 ) )
-        {
-          lh_levels_set = true;
-
-          if( current_raster_level > r1_highest_level ) {
-            r1_highest_level = current_raster_level;
-          }
-          if( current_raster_level < r1_lowest_level ) {
-            r1_lowest_level = current_raster_level;
-          }
-        }
-        
-        if( curr_line != last_line ) {
-          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-            "Canceled by the user" );
-          
-          last_line = curr_line;
-        }
-        
-        ++input_raster_it;
-      }
-    }
-
-    // Return if no pixel data was read 
-
-    if( ! lh_levels_set )
-    {
-      return true;
-    }
-  }   
-   
-  /* Finding raster 2 lowest end highest levels */
-  
-  double r2_lowest_level = 0;
-  double r2_highest_level = 0;  
-    
-  if ( inputRaster2.params().decoderIdentifier_ == "DB" ) {
-    r2_lowest_level = inputRaster2.params().vmin_[ inputRasterChn2 ];
-    r2_highest_level = inputRaster2.params().vmax_[ inputRasterChn2 ];
-
-    // Return if there is no pixel data to read 
-
-    if( inputRaster2.params().useDummy_ && ( r2_lowest_level == 
-      inputRaster2.params().dummy_[ inputRasterChn2 ] ) && ( r2_highest_level == 
-      inputRaster2.params().dummy_[ inputRasterChn2 ] ) )
-    {
-      return true;
-    }
-  } else {
-    r2_lowest_level = DBL_MAX;
-    r2_highest_level = ( -1.0 ) * DBL_MAX;  
-
-    bool lh_levels_set = false; // lowest_level and highest_level values set
-    
-    TeRaster::iteratorPoly input_raster_it;
-    TePDIPIManager progress( "Finding histogram range", progress_steps, 
-      progressEnabled_ );
-    double current_raster_level = 0;
-    unsigned int curr_line = 0;
-    unsigned int curr_col = 0;
-    unsigned int last_line = 0;    
-    
-    for( unsigned int local_polset_index = 0 ; local_polset_index < 
-      restricPolSet.size() ; ++local_polset_index ) 
-    {
-      input_raster_it = inputRaster2.begin( restricPolSet[ local_polset_index ], 
-        iterStrat, 0 );
-      
-      while( ! input_raster_it.end() ) {
-        curr_line = input_raster_it.currentLine();
-        curr_col = input_raster_it.currentColumn();
-        
-        if( inputRaster2.getElement( curr_col, curr_line, current_raster_level,
-          inputRasterChn2 ) )
-        {
-          lh_levels_set = true;
-
-          if( current_raster_level > r2_highest_level ) {
-            r2_highest_level = current_raster_level;
-          }
-          if( current_raster_level < r2_lowest_level ) {
-            r2_lowest_level = current_raster_level;
-          }
-        }
-        
-        if( curr_line != last_line ) {
-          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-            "Canceled by the user" );
-          
-          last_line = curr_line;
-        }
-        
-        ++input_raster_it;
-      }
-    }
-
-    // Return if no pixel data was read 
-
-    if( ! lh_levels_set )
-    {
-      return true;
-    }
-  }      
-     
-  /* Calculating the raster 1 histogram step and computed levels */
-
-  double r1_step = 1;
-  unsigned int r1_hist_computed_levels = 1;
-
-  if( r1_highest_level != r1_lowest_level )
-  {
-    if( levels == 0 ) {
-      /* Auto step feature */
-      TEAGN_TRUE_OR_RETURN( ( ( r1_highest_level - r1_lowest_level ) > 1.0 ),
-        "Histogram level range is too short for auto-step feature"
-        " lowest_level=" + Te2String( r1_lowest_level ) + " highest_level=" +
-        Te2String( r1_highest_level ) );
-  
-      r1_hist_computed_levels = 1 +
-        ( unsigned int ) floor( r1_highest_level - r1_lowest_level );
-    } else {
-      r1_hist_computed_levels = levels;
-    }
-  
-    TEAGN_TRUE_OR_RETURN( r1_hist_computed_levels > 0,
-      "Invalid levels number" );
-  
-    r1_step = ( r1_highest_level - r1_lowest_level ) /
-          ( (double)( r1_hist_computed_levels - 1 ) );
-  }
-  
-  /* Calculating the raster 2 histogram step and computed levels */
-
-  double r2_step = 1;
-  unsigned int r2_hist_computed_levels = 1;
-
-  if( r2_highest_level != r2_lowest_level )
-  {
-    if( levels == 0 ) {
-      /* Auto step feature */
-      TEAGN_TRUE_OR_RETURN( ( ( r2_highest_level - r2_lowest_level ) > 1.0 ),
-        "Histogram level range is too short for auto-step feature"
-        " lowest_level=" + Te2String( r2_lowest_level ) + " highest_level=" +
-        Te2String( r2_highest_level ) );
-  
-      r2_hist_computed_levels = 1 +
-        ( unsigned int ) floor( r2_highest_level - r2_lowest_level );
-    } else {
-      r2_hist_computed_levels = levels;
-    }
-  
-    TEAGN_TRUE_OR_RETURN( r2_hist_computed_levels > 0,
-      "Invalid levels number" );
-  
-    r2_step = ( r2_highest_level - r2_lowest_level ) /
-      ( (double)( r2_hist_computed_levels - 1 ) );
-  }  
-     
-   /* Building initial histograms */
-   
-   init_jhist_ = new unsigned int*[ r1_hist_computed_levels ];
-   init_jhist_lines_ = r1_hist_computed_levels;
-
-   init_r1hist_ = new unsigned int[ r1_hist_computed_levels ];
-   init_r2hist_ = new unsigned int[ r2_hist_computed_levels ];
-   {
-     unsigned int hist_index1 = 0;
-     unsigned int hist_index2 = 0;
-     
-     for( hist_index1 = 0 ; hist_index1 < r1_hist_computed_levels ; ++hist_index1 )
-     {
-       init_r1hist_[ hist_index1 ] = 0;
-       init_jhist_[ hist_index1 ] = new unsigned int[ r2_hist_computed_levels ];
-       
-       for( hist_index2 = 0 ; hist_index2 < r2_hist_computed_levels ; ++hist_index2 )
-       {
-         init_jhist_[ hist_index1 ][ hist_index2 ] = 0;
-       }
-     }
-       
-     for( hist_index2 = 0 ; hist_index2 < r2_hist_computed_levels ; ++hist_index2 )
-     {
-       init_r2hist_[ hist_index2 ] = 0;
-     }
-   }
-     
-   /* Analysing raster */
-   
-   {
-     const unsigned long int progress_steps = 
-       getProgressSteps( restricPolSet, inputRaster1.params().resy_ ); 
-     
-     TePDIPIManager progress( "Generating histogram", progress_steps, 
-       progressEnabled_ );
-   
-     TeRaster::iteratorPoly r1_it;
-     TeRaster::iteratorPoly r2_it;
-     
-     long int r1_line = 0;
-     long int r1_col = 0;
-     long int last_r1_line = 0;
-     
-     long int r2_line_off = 0;
-     long int r2_col_off = 0;
-     
-     double r1_value_double = 0;
-     double r2_value_double = 0;
-     unsigned int r1_value_int = 0;
-     unsigned int r2_value_int = 0;
-     
-     bool gotvalue1 = false;
-     bool gotvalue2 = false;
-     
-     for( unsigned int polset_index = 0 ; polset_index < 
-       restricPolSet.size() ; ++polset_index ) 
-     {
-       r1_it = inputRaster1.begin( restricPolSet[ polset_index ], 
-         iterStrat, 0 );
-       r2_it = inputRaster2.begin( restricPolSet[ polset_index ], 
-         iterStrat, 0 );
-       
-       if( ( ! r1_it.end() ) && ( ! r2_it.end() ) )
-       {
-         r1_line = r1_it.currentLine();
-         r1_col = r1_it.currentColumn();
-         
-         r2_line_off = r1_line - r2_it.currentLine();
-         r2_col_off = r1_col - r2_it.currentColumn();         
-  
-         while( ! r1_it.end() ) {
-           gotvalue1 = inputRaster1.getElement( r1_col, r1_line, 
-             r1_value_double, inputRasterChn1 );
-           gotvalue2 = inputRaster2.getElement( r1_col - r2_col_off, 
-             r1_line - r2_line_off, r2_value_double, inputRasterChn2 );
-           
-           if( gotvalue1 )
-           {
-             r1_value_int = (unsigned int) TeRound( ( r1_value_double - 
-               r1_lowest_level ) / r1_step );
-             TEAGN_DEBUG_CONDITION( r1_value_int < r1_hist_computed_levels,
-               "Invalid histogram index");
-
-             ++( init_r1hist_[ r1_value_int ] );
-           }
-           
-           if( gotvalue2 )
-           {
-             r2_value_int = (unsigned int) TeRound( ( r2_value_double - 
-               r2_lowest_level ) / r2_step );
-             TEAGN_DEBUG_CONDITION( r2_value_int < r2_hist_computed_levels,
-               "Invalid histogram index");
-           
-             ++( init_r2hist_[ r2_value_int ] );
-             
-             if( gotvalue1 )
-             {
-               ++( init_jhist_[ r1_value_int ][ r2_value_int ] );          
-             }             
-           }
-           
-           if( r1_line != last_r1_line ) {
-             TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-               "Canceled by the user" );
-             
-             last_r1_line = r1_line;
-           }
-           
-           ++r1_it;
-           r1_line = r1_it.currentLine();
-           r1_col = r1_it.currentColumn();           
-         }
-       }
-     }  
-   }    
-  
-   /* Building ordered joint histogram */
-   
-   {
-     unsigned int hist_index1 = 0;
-     unsigned int hist_index2 = 0;
-     std::pair< double, double > temp_pair;
-     
-     for( hist_index1 = 0 ; hist_index1 < r1_hist_computed_levels ; 
-       ++hist_index1 )
-     {
-       if( hist_index1 == ( r1_hist_computed_levels - 1 ) )
-       {
-         temp_pair.first = r1_highest_level;
-       }
-       else
-       {
-         temp_pair.first = ( r1_step * (double)hist_index1 ) + 
-           r1_lowest_level;
-       }
-       
-       for( hist_index2 = 0 ; hist_index2 < r2_hist_computed_levels ;
-         ++hist_index2 )
-       { 
-         if( hist_index2 == ( r2_hist_computed_levels - 1 ) )
-         {
-           temp_pair.second = r2_highest_level;
-         }
-         else
-         {
-           temp_pair.second = ( r2_step * (double)hist_index2 ) + 
-             r2_lowest_level;
-         }     
-           
-         jHistContainer_[ temp_pair ] = init_jhist_[ hist_index1 ][ 
-           hist_index2 ];
-       }
-     }
-   }
-      
-   /* Building ordered raster 1 histogram */
-   
-   {
-     for( unsigned int hist_index = 0 ; hist_index < r1_hist_computed_levels ; 
-       ++hist_index )
-     {
-       if( hist_index == ( r1_hist_computed_levels - 1 ) )
-       {
-         r1Histogram_[ r1_highest_level ] = init_r1hist_[ hist_index ];
-       }
-       else
-       {
-         r1Histogram_[ ( r1_step * (double)hist_index ) + r1_lowest_level ] =
-           init_r1hist_[ hist_index ];
-       }
-     }
-   }   
-   
-   /* Building ordered raster 2 histogram */
-   
-   {
-     for( unsigned int hist_index = 0 ; hist_index < r2_hist_computed_levels ; 
-       ++hist_index )
-     {
-       if( hist_index == ( r2_hist_computed_levels - 1 ) )
-       {
-         r2Histogram_[ r2_highest_level ] = init_r2hist_[ hist_index ];
-       }
-       else
-       {
-         r2Histogram_[ ( r2_step * (double)hist_index ) + r2_lowest_level ] =
-           init_r2hist_[ hist_index ];
-       }
-     }
-   }  
-
-   clearTempHistBuffers(); 
-      
-   return true;
-}
-
-bool TePDIJointHistogram::updateInteger( TeRaster& inputRaster1, 
-  unsigned int inputRasterChn1, TeRaster& inputRaster2, 
-  unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
-  const TePolygonSet& restricPolSet )
-{
-   /* Analysing raster */
-   
-   {
-     const unsigned long int progress_steps = 
-       getProgressSteps( restricPolSet, inputRaster1.params().resy_ ); 
-     
-     TePDIPIManager progress( "Generating histogram", progress_steps, 
-       progressEnabled_ );
-   
-     TeRaster::iteratorPoly r1_it;
-     TeRaster::iteratorPoly r2_it;
-     
-     long int r1_line = 0;
-     long int r1_col = 0;
-     long int last_r1_line = 0;
-     
-     long int r2_line_off = 0;
-     long int r2_col_off = 0;
-     
-     bool gotvalue1 = false;
-     bool gotvalue2 = false;
-
-     std::pair< double, double > tempPair;
-     
-     for( unsigned int polset_index = 0 ; polset_index < 
-       restricPolSet.size() ; ++polset_index ) 
-     {
-       r1_it = inputRaster1.begin( restricPolSet[ polset_index ], 
-         iterStrat, 0 );
-       r2_it = inputRaster2.begin( restricPolSet[ polset_index ], 
-         iterStrat, 0 );
-       
-       if( ( ! r1_it.end() ) && ( ! r2_it.end() ) )
-       {
-         r1_line = r1_it.currentLine();
-         r1_col = r1_it.currentColumn();
-         
-         r2_line_off = r1_line - r2_it.currentLine();
-         r2_col_off = r1_col - r2_it.currentColumn();         
-  
-         while( ! r1_it.end() ) {
-           gotvalue1 = inputRaster1.getElement( r1_col, r1_line, 
-             tempPair.first, inputRasterChn1 );
-           gotvalue2 = inputRaster2.getElement( r1_col - r2_col_off, 
-             r1_line - r2_line_off, tempPair.second, inputRasterChn2 );
-           
-           if( gotvalue1 )
-           {
-             ++( r1Histogram_[ tempPair.first ] );
-           }
-           
-           if( gotvalue2 )
-           {
-             ++( r2Histogram_[ tempPair.second ] );
-             
-             if( gotvalue1 )
-             {
-               ++( jHistContainer_[ tempPair ] );          
-             }             
-           }
-           
-           if( r1_line != last_r1_line ) {
-             TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-               "Canceled by the user" );
-             
-             last_r1_line = r1_line;
-           }
-           
-           ++r1_it;
-           r1_line = r1_it.currentLine();
-           r1_col = r1_it.currentColumn();           
-         }
-       }
-     }  
-   }    
-
-   clearTempHistBuffers();
-   
-   return true;
-}
-
-bool TePDIJointHistogram::update8Bits( TeRaster& inputRaster1, 
-  unsigned int inputRasterChn1, TeRaster& inputRaster2, 
-  unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
-  const TePolygonSet& restricPolSet )
-{
-   /* Defining level offset based on data bype */
-   
-   unsigned int level_offset1 = 0;
-   
-   if( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeCHAR ) {
-     level_offset1 = 127; /*( 256 / 2 ) - 1 */
-   }
-   
-   unsigned int level_offset2 = 0;
-   
-   if( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeCHAR ) {
-     level_offset2 = 127; /*( 256 / 2 ) - 1 */
-   }   
-     
-   /* Building initial histograms */
-   
-   init_jhist_ = new unsigned int*[ 256 ];
-   init_jhist_lines_ = 256;
-
-   init_r1hist_ = new unsigned int[ 256 ];
-   init_r2hist_ = new unsigned int[ 256 ];
-   {
-     unsigned int hist_index1 = 0;
-     unsigned int hist_index2 = 0;
-     
-     for( hist_index1 = 0 ; hist_index1 < 256 ; ++hist_index1 )
-     {
-       init_r1hist_[ hist_index1 ] = 0;
-       init_jhist_[ hist_index1 ] = new unsigned int[ 256 ];
-       
-       for( hist_index2 = 0 ; hist_index2 < 256 ; ++hist_index2 )
-       {
-         init_jhist_[ hist_index1 ][ hist_index2 ] = 0;
-       }
-     }
-
-     for( hist_index2 = 0 ; hist_index2 < 256 ; ++hist_index2 )
-     {
-       init_r2hist_[ hist_index2 ] = 0;
-     }
-   }
-   
-   /* Analysing raster */
-   
-   {
-     const unsigned long int progress_steps = 
-       getProgressSteps( restricPolSet, inputRaster1.params().resy_ ); 
-     
-     TePDIPIManager progress( "Generating histogram", progress_steps, 
-       progressEnabled_ );
-   
-     TeRaster::iteratorPoly r1_it;
-     TeRaster::iteratorPoly r2_it;
-     
-     long int r1_line = 0;
-     long int r1_col = 0;
-     long int last_r1_line = 0;
-     
-     long int r2_line_off = 0;
-     long int r2_col_off = 0;
-     
-     double r1_value_double = 0;
-     double r2_value_double = 0;
-     int r1_value_int = 0;
-     int r2_value_int = 0;
-     
-     bool gotvalue1 = false;
-     bool gotvalue2 = false;
-     
-     for( unsigned int polset_index = 0 ; polset_index < 
-       restricPolSet.size() ; ++polset_index ) 
-     {
-       r1_it = inputRaster1.begin( restricPolSet[ polset_index ], 
-         iterStrat, 0 );
-       r2_it = inputRaster2.begin( restricPolSet[ polset_index ], 
-         iterStrat, 0 );
-       
-       if( ( ! r1_it.end() ) && ( ! r2_it.end() ) )
-       {
-         r1_line = r1_it.currentLine();
-         r1_col = r1_it.currentColumn();
-         
-         r2_line_off = r1_line - r2_it.currentLine();
-         r2_col_off = r1_col - r2_it.currentColumn();         
-  
-         while( ! r1_it.end() ) {
-           gotvalue1 = inputRaster1.getElement( r1_col, r1_line, 
-             r1_value_double, inputRasterChn1 );
-           gotvalue2 = inputRaster2.getElement( r1_col - r2_col_off, 
-             r1_line - r2_line_off, r2_value_double, inputRasterChn2 );
-           
-           if( gotvalue1 )
-           {
-             r1_value_int = ( int ) r1_value_double;
-             TEAGN_DEBUG_CONDITION( (r1_value_int + level_offset1) < 256,
-               "Invalid histogram index");
-
-             ++( init_r1hist_[ r1_value_int + level_offset1 ] );
-           }
-           
-           if( gotvalue2 )
-           {
-             r2_value_int = ( int ) r2_value_double;
-             TEAGN_DEBUG_CONDITION( (r2_value_int + level_offset2) < 256,
-               "Invalid histogram index");
-           
-             ++( init_r2hist_[ r2_value_int + level_offset2 ] );
-             
-             if( gotvalue1 )
-             {
-               ++( init_jhist_[ r1_value_int + level_offset1 ][ r2_value_int + 
-                 level_offset2 ] );          
-             }             
-           }
-           
-           if( r1_line != last_r1_line ) {
-             TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-               "Canceled by the user" );
-             
-             last_r1_line = r1_line;
-           }
-           
-           ++r1_it;
-           r1_line = r1_it.currentLine();
-           r1_col = r1_it.currentColumn();           
-         }
-       }
-     }  
-   }    
-  
-   // locating the first and last non-null joint histogram position 
-  
-   unsigned int first_nonnul_jh_idx1 = 256;
-   unsigned int first_nonnul_jh_idx2 = 256;
-   unsigned int last_nonnul_jh_idx1 = 256;
-   unsigned int last_nonnul_jh_idx2 = 256;
-   {
-     unsigned int hist_index1 = 0;
-     unsigned int hist_index2 = 0;
-     
-     for( hist_index1 = 0 ; hist_index1 < 256 ; ++hist_index1 )
-     {
-       for( hist_index2 = 0 ; hist_index2 < 256 ; ++hist_index2 )
-       {
-         if( init_jhist_[ hist_index1 ][ hist_index2 ] != 0 )
-         {
-           if( first_nonnul_jh_idx1 == 256 )
-           {
-             first_nonnul_jh_idx1 = last_nonnul_jh_idx1 = hist_index1;
-           }
-           else
-           {
-             last_nonnul_jh_idx1 = hist_index1;
-           }
-           
-           if( first_nonnul_jh_idx2 == 256 )
-           {
-             first_nonnul_jh_idx2 = last_nonnul_jh_idx2 = hist_index2;
-           }
-           else
-           {
-             last_nonnul_jh_idx2 = hist_index2;
-           }           
-         }
-       }
-     }
-   }   
-   
-   /* Building ordered joint histogram */
-   
-   if( first_nonnul_jh_idx1 != 256 )
-   {
-     unsigned int hist_index1 = 0;
-     unsigned int hist_index2 = 0;
-     std::pair< double, double > temp_pair;
-     
-     for( hist_index1 = first_nonnul_jh_idx2 ; hist_index1 <= last_nonnul_jh_idx1 ; 
-       ++hist_index1 )
-     {
-       for( hist_index2 = first_nonnul_jh_idx2 ; hist_index2 <= last_nonnul_jh_idx2 ;
-         ++hist_index2 )
-       { 
-         temp_pair.first = ( (double)hist_index1 ) - ( (double)level_offset1 );
-         temp_pair.second = ( (double)hist_index2 ) - ( (double)level_offset2 );
-           
-         jHistContainer_[ temp_pair ] = init_jhist_[ hist_index1 ][ hist_index2 ];
-       }
-     }
-   }
-      
-   // locating the first and last non-null histograms position
-  
-   unsigned int first_nonnul_h_idx1 = 256;
-   unsigned int first_nonnul_h_idx2 = 256;
-   unsigned int last_nonnul_h_idx1 = 256;
-   unsigned int last_nonnul_h_idx2 = 256;
-   {
-     for( unsigned int hist_index = 0 ; hist_index < 256 ; ++hist_index )
-     {
-       if( init_r1hist_[ hist_index ] != 0 )
-       {
-         if( first_nonnul_h_idx1 == 256 )
-         {
-           first_nonnul_h_idx1 = last_nonnul_h_idx1 = hist_index;
-         }
-         else
-         {
-           last_nonnul_h_idx1 = hist_index;
-         }
-       }
-       
-       if( init_r2hist_[ hist_index ] != 0 )
-       {
-         if( first_nonnul_h_idx2 == 256 )
-         {
-           first_nonnul_h_idx2 = last_nonnul_h_idx2 = hist_index;
-         }
-         else
-         {
-           last_nonnul_h_idx2 = hist_index;
-         }
-       }      
-     }
-   }   
-   
-   /* Building ordered raster 1 histogram */
-   
-   if( first_nonnul_h_idx1 != 256 )
-   {
-     unsigned int hist_index = 0;
-     
-     for( hist_index = first_nonnul_h_idx1 ; hist_index <= last_nonnul_h_idx1 ; 
-       ++hist_index )
-     {
-       r1Histogram_[ ( (double)hist_index ) - ( (double)level_offset1 ) ] =
-         init_r1hist_[ hist_index ];
-     }
-   }   
-   
-   /* Building ordered raster 2 histogram */
-   
-   if( first_nonnul_h_idx2 != 256 )
-   {
-     unsigned int hist_index = 0;
-     
-     for( hist_index = first_nonnul_h_idx2 ; hist_index <= last_nonnul_h_idx2 ; 
-       ++hist_index )
-     {
-       r2Histogram_[ ( (double)hist_index ) - ( (double)level_offset2 ) ] =
-         init_r2hist_[ hist_index ];
-     }
-   }    
-
-   clearTempHistBuffers();
-   
-   return true;
-}
-
-unsigned long int TePDIJointHistogram::getProgressSteps( 
-  const TePolygonSet& polset, double resy )
-{
-  unsigned long int steps = 0;
-
-  for( unsigned int ps_index = 0 ; ps_index < polset.size() ; 
-    ++ps_index ) {
-    
-    const TeBox& polbox( polset[ ps_index ].box() );
-    steps += ( unsigned long int)ABS( ( polbox.y2() - polbox.y1() ) / resy );
-  }
-  
-  return steps;
-}
-
-void TePDIJointHistogram::clearTempHistBuffers()
-{
-  if( init_jhist_ )
-  {
-    for( unsigned int line = 0 ; line < init_jhist_lines_ ; ++line )
-    {
-      if( init_jhist_[ line ] ) delete[]( init_jhist_[ line ] );
-    }
-
-    delete[]( init_jhist_ );
-
-    init_jhist_ = 0;
-    init_jhist_lines_ = 0;
-  }
-
-  if( init_r1hist_ )
-  {
-    delete[]( init_r1hist_ );
-    init_r1hist_ = 0;
-  }
-
-  if( init_r2hist_ )
-  {
-    delete[]( init_r2hist_ );
-    init_r2hist_ = 0;
-	}
-}
+#include "TePDIJointHistogram.hpp"
+
+#include "TePDIPIManager.hpp"
+
+#include <TeOverlay.h>
+#include <TeBox.h>
+#include <TeGeometry.h>
+#include <TeAgnostic.h>
+
+TePDIJointHistogram::TePDIJointHistogram()
+{
+  progressEnabled_ = true;
+
+  init_jhist_ = 0;
+  init_jhist_lines_ = 0;
+  init_jhist_cols_ = 0;
+  init_r1hist_ = 0;
+  init_r2hist_ = 0;
+}
+
+
+TePDIJointHistogram::TePDIJointHistogram( const TePDIJointHistogram& external )
+{
+  operator=( external );
+}
+
+
+TePDIJointHistogram::~TePDIJointHistogram()
+{
+  clear();
+}
+
+const TePDIJointHistogram& TePDIJointHistogram::operator=( const 
+  TePDIJointHistogram& external )    
+{
+  clear();
+
+  jHistContainer_ = external.jHistContainer_;
+  r1Histogram_ = external.r1Histogram_;
+  r2Histogram_ = external.r2Histogram_;
+  
+  return external;
+}
+
+void TePDIJointHistogram::toggleProgress( bool enabled )
+{
+  progressEnabled_ = enabled;
+}
+
+bool TePDIJointHistogram::update( TeRaster& inputRaster1, 
+  unsigned int inputRasterChn1, TeRaster& inputRaster2, 
+  unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
+  unsigned int levels, const TePolygonSet& restricPolSet )
+{
+  TEAGN_TRUE_OR_RETURN( inputRaster1.params().status_ != 
+    TeRasterParams::TeNotReady, "Raster1 not ready" )
+  TEAGN_TRUE_OR_RETURN( inputRaster2.params().status_ != 
+    TeRasterParams::TeNotReady, "Raster2 not ready" )
+    
+  TEAGN_TRUE_OR_RETURN( inputRaster1.params().resx_ ==
+    inputRaster2.params().resx_, "X resolution mismatch" )
+  TEAGN_TRUE_OR_RETURN( inputRaster1.params().resy_ ==
+    inputRaster2.params().resy_, "Y resolution mismatch" )
+      
+  TEAGN_TRUE_OR_RETURN( (int)inputRasterChn1 < inputRaster1.nBands(),
+    "Invalid channel" )
+  TEAGN_TRUE_OR_RETURN( (int)inputRasterChn2 < inputRaster2.nBands(),
+    "Invalid channel" )
+      
+  clear();
+    
+  // Calc the intersection between the restriction polygon set,
+  // and both rasters bounding box
+     
+  TePolygonSet interPS;
+  {
+    TePolygon pol1 = polygonFromBox( inputRaster1.params().boundingBox() );
+    TePolygon pol2 = polygonFromBox( inputRaster2.params().boundingBox() );
+    
+    TePolygonSet ps1;
+    ps1.add( pol1 );
+    
+    TePolygonSet ps2;
+    ps2.add( pol2 );
+    
+    TePolygonSet boxesInterPS;
+    TEAGN_TRUE_OR_RETURN( TeOVERLAY::TeIntersection( ps1, ps2, boxesInterPS ),
+      "Unable to find the intersection between both raster bounding boxes" );
+    
+    if( restricPolSet.size() == 0 )
+    {
+      interPS = boxesInterPS;
+    }
+    else
+    {
+      TEAGN_TRUE_OR_RETURN( TeOVERLAY::TeIntersection( boxesInterPS, restricPolSet, 
+        interPS ), "Unable to find the intersection between both raster bounding boxes" );
+    }
+  }
+    
+  // Pallete based rasters not supported
+    
+  if( ( inputRaster1.params().photometric_[ inputRasterChn1 ] == 
+    TeRasterParams::TePallete ) ||
+    ( inputRaster2.params().photometric_[ inputRasterChn2 ] == 
+    TeRasterParams::TePallete ) ) 
+  {
+    TEAGN_LOG_AND_RETURN( "Pallete based rasters not supported" )
+  }
+    
+  // Optimization for floating point rasters
+
+  if( ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeDOUBLE ) ||
+      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeFLOAT ) ||
+      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeDOUBLE ) ||
+      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeFLOAT ) )
+  {
+    try
+    {
+      return updateFloat( inputRaster1, inputRasterChn1, inputRaster2, 
+        inputRasterChn2, iterStrat, levels, interPS );
+    }
+    catch(...)
+    {
+      TEAGN_LOG_AND_RETURN( "Not enought memory" );
+    }
+  }
+  
+  // Optmization for integer rasters
+		  
+  if( ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeINTEGER ) ||
+      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeUNSIGNEDLONG ) ||
+      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeLONG ) ||
+      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeSHORT ) ||
+      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeUNSIGNEDSHORT ) ||
+      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeINTEGER ) ||
+      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeUNSIGNEDLONG ) ||
+      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeLONG ) ||
+      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeSHORT ) ||
+      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeUNSIGNEDSHORT ) )
+  {
+    return updateInteger( inputRaster1, inputRasterChn1, inputRaster2, 
+      inputRasterChn2, iterStrat, interPS );
+  }  
+  
+  // Optimization for 8 bits or 16 bits
+  
+  if( ( ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeCHAR ) ||
+      ( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeUNSIGNEDCHAR ) ) &&
+      ( ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeCHAR ) ||
+      ( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeUNSIGNEDCHAR ) ) )
+  {
+    return update8Bits( inputRaster1, inputRasterChn1, inputRaster2, 
+      inputRasterChn2, iterStrat, interPS );
+  }  
+  
+  TEAGN_LOG_AND_THROW( "Invalid data type" );
+  return false;
+}
+
+void TePDIJointHistogram::clear()
+{
+  jHistContainer_.clear();
+  r1Histogram_.clear();
+  r2Histogram_.clear();
+
+  clearTempHistBuffers();
+}
+
+const TePDIHistogram& TePDIJointHistogram::getRaster1Hist() const
+{
+  return r1Histogram_;
+}
+
+const TePDIHistogram& TePDIJointHistogram::getRaster2Hist() const
+{
+  return r2Histogram_;
+}
+
+TePDIJointHistogram::const_iterator TePDIJointHistogram::begin() const
+{
+  return jHistContainer_.begin();
+}
+
+TePDIJointHistogram::const_iterator TePDIJointHistogram::end() const
+{
+  return jHistContainer_.end();
+}
+
+unsigned int TePDIJointHistogram::size() const
+{
+  return (unsigned int)jHistContainer_.size();
+}
+
+void TePDIJointHistogram::getInverseJHist( TePDIJointHistogram& external )
+{
+  external.clear();
+  external.r1Histogram_ = r2Histogram_;
+  external.r2Histogram_ = r1Histogram_;
+
+  ConteinerT::const_iterator cit = jHistContainer_.begin();
+  ConteinerT::const_iterator cit_end = jHistContainer_.end();
+  std::pair< double, double > tempPair;
+  while( cit != cit_end )
+  {
+    tempPair.first = cit->first.second;
+    tempPair.second = cit->first.first;
+    external.jHistContainer_[ tempPair ] = cit->second;
+    
+    ++cit;
+  }
+}
+
+unsigned long int TePDIJointHistogram::getFreqSum() const
+{
+  ConteinerT::const_iterator cit = jHistContainer_.begin();
+  ConteinerT::const_iterator cit_end = jHistContainer_.end();
+
+  unsigned long int sum = 0;
+
+  while( cit != cit_end )
+  {
+    sum += (unsigned long int)cit->second;
+    
+    ++cit;
+  }
+  
+  return sum;
+}
+
+std::string TePDIJointHistogram::toString() const
+{
+  std::string outStr;
+  
+  const_iterator it = begin();
+  const_iterator it_end = end();
+  
+  while( it != it_end ) 
+  {
+    outStr.append( "[" + Te2String( it->first.first, 2 ) + "," +
+      Te2String( it->first.second, 2 ) + "->" +
+      Te2String( it->second ) + "]" );
+    
+    ++it;
+  }
+  
+  return outStr;
+}
+
+bool TePDIJointHistogram::updateFloat( TeRaster& inputRaster1, 
+  unsigned int inputRasterChn1, TeRaster& inputRaster2, 
+  unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
+  unsigned int levels, const TePolygonSet& restricPolSet )
+{
+  const unsigned long int progress_steps = 
+    getProgressSteps( restricPolSet, inputRaster1.params().resy_ );   
+  
+  /* Finding raster 1 lowest end highest levels */
+  
+  double r1_lowest_level = 0;
+  double r1_highest_level = 0;  
+    
+  if ( inputRaster1.params().decoderIdentifier_ == "DB" ) {
+    r1_lowest_level = inputRaster1.params().vmin_[ inputRasterChn1 ];
+    r1_highest_level = inputRaster1.params().vmax_[ inputRasterChn1 ];
+
+    // Return if there is no pixel data to read 
+
+    if( inputRaster1.params().useDummy_ && ( r1_lowest_level == 
+      inputRaster1.params().dummy_[ inputRasterChn1 ] ) && ( r1_highest_level == 
+      inputRaster1.params().dummy_[ inputRasterChn1 ] ) )
+    {
+      return true;
+    }
+  } else {
+    r1_lowest_level = DBL_MAX;
+    r1_highest_level = ( -1.0 ) * DBL_MAX;  
+
+    bool lh_levels_set = false; // lowest_level and highest_level values set
+    
+    TeRaster::iteratorPoly input_raster_it;
+    TePDIPIManager progress( "Finding histogram range", progress_steps, 
+      progressEnabled_ );
+    double current_raster_level = 0;
+    unsigned int curr_line = 0;
+    unsigned int curr_col = 0;
+    unsigned int last_line = 0;    
+    
+    for( unsigned int local_polset_index = 0 ; local_polset_index < 
+      restricPolSet.size() ; ++local_polset_index ) 
+    {
+      input_raster_it = inputRaster1.begin( restricPolSet[ local_polset_index ], 
+        iterStrat, 0 );
+      
+      while( ! input_raster_it.end() ) {
+        curr_line = input_raster_it.currentLine();
+        curr_col = input_raster_it.currentColumn();
+        
+        if( inputRaster1.getElement( curr_col, curr_line, current_raster_level,
+          inputRasterChn1 ) )
+        {
+          lh_levels_set = true;
+
+          if( current_raster_level > r1_highest_level ) {
+            r1_highest_level = current_raster_level;
+          }
+          if( current_raster_level < r1_lowest_level ) {
+            r1_lowest_level = current_raster_level;
+          }
+        }
+        
+        if( curr_line != last_line ) {
+          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+            "Canceled by the user" );
+          
+          last_line = curr_line;
+        }
+        
+        ++input_raster_it;
+      }
+    }
+
+    // Return if no pixel data was read 
+
+    if( ! lh_levels_set )
+    {
+      return true;
+    }
+  }   
+   
+  /* Finding raster 2 lowest end highest levels */
+  
+  double r2_lowest_level = 0;
+  double r2_highest_level = 0;  
+    
+  if ( inputRaster2.params().decoderIdentifier_ == "DB" ) {
+    r2_lowest_level = inputRaster2.params().vmin_[ inputRasterChn2 ];
+    r2_highest_level = inputRaster2.params().vmax_[ inputRasterChn2 ];
+
+    // Return if there is no pixel data to read 
+
+    if( inputRaster2.params().useDummy_ && ( r2_lowest_level == 
+      inputRaster2.params().dummy_[ inputRasterChn2 ] ) && ( r2_highest_level == 
+      inputRaster2.params().dummy_[ inputRasterChn2 ] ) )
+    {
+      return true;
+    }
+  } else {
+    r2_lowest_level = DBL_MAX;
+    r2_highest_level = ( -1.0 ) * DBL_MAX;  
+
+    bool lh_levels_set = false; // lowest_level and highest_level values set
+    
+    TeRaster::iteratorPoly input_raster_it;
+    TePDIPIManager progress( "Finding histogram range", progress_steps, 
+      progressEnabled_ );
+    double current_raster_level = 0;
+    unsigned int curr_line = 0;
+    unsigned int curr_col = 0;
+    unsigned int last_line = 0;    
+    
+    for( unsigned int local_polset_index = 0 ; local_polset_index < 
+      restricPolSet.size() ; ++local_polset_index ) 
+    {
+      input_raster_it = inputRaster2.begin( restricPolSet[ local_polset_index ], 
+        iterStrat, 0 );
+      
+      while( ! input_raster_it.end() ) {
+        curr_line = input_raster_it.currentLine();
+        curr_col = input_raster_it.currentColumn();
+        
+        if( inputRaster2.getElement( curr_col, curr_line, current_raster_level,
+          inputRasterChn2 ) )
+        {
+          lh_levels_set = true;
+
+          if( current_raster_level > r2_highest_level ) {
+            r2_highest_level = current_raster_level;
+          }
+          if( current_raster_level < r2_lowest_level ) {
+            r2_lowest_level = current_raster_level;
+          }
+        }
+        
+        if( curr_line != last_line ) {
+          TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+            "Canceled by the user" );
+          
+          last_line = curr_line;
+        }
+        
+        ++input_raster_it;
+      }
+    }
+
+    // Return if no pixel data was read 
+
+    if( ! lh_levels_set )
+    {
+      return true;
+    }
+  }      
+     
+  /* Calculating the raster 1 histogram step and computed levels */
+
+  double r1_step = 1;
+  unsigned int r1_hist_computed_levels = 1;
+
+  if( r1_highest_level != r1_lowest_level )
+  {
+    if( levels == 0 ) {
+      /* Auto step feature */
+      TEAGN_TRUE_OR_RETURN( ( ( r1_highest_level - r1_lowest_level ) > 1.0 ),
+        "Histogram level range is too short for auto-step feature"
+        " lowest_level=" + Te2String( r1_lowest_level ) + " highest_level=" +
+        Te2String( r1_highest_level ) );
+  
+      r1_hist_computed_levels = 1 +
+        ( unsigned int ) floor( r1_highest_level - r1_lowest_level );
+    } else {
+      r1_hist_computed_levels = levels;
+    }
+  
+    TEAGN_TRUE_OR_RETURN( r1_hist_computed_levels > 0,
+      "Invalid levels number" );
+  
+    r1_step = ( r1_highest_level - r1_lowest_level ) /
+          ( (double)( r1_hist_computed_levels - 1 ) );
+  }
+  
+  /* Calculating the raster 2 histogram step and computed levels */
+
+  double r2_step = 1;
+  unsigned int r2_hist_computed_levels = 1;
+
+  if( r2_highest_level != r2_lowest_level )
+  {
+    if( levels == 0 ) {
+      /* Auto step feature */
+      TEAGN_TRUE_OR_RETURN( ( ( r2_highest_level - r2_lowest_level ) > 1.0 ),
+        "Histogram level range is too short for auto-step feature"
+        " lowest_level=" + Te2String( r2_lowest_level ) + " highest_level=" +
+        Te2String( r2_highest_level ) );
+  
+      r2_hist_computed_levels = 1 +
+        ( unsigned int ) floor( r2_highest_level - r2_lowest_level );
+    } else {
+      r2_hist_computed_levels = levels;
+    }
+  
+    TEAGN_TRUE_OR_RETURN( r2_hist_computed_levels > 0,
+      "Invalid levels number" );
+  
+    r2_step = ( r2_highest_level - r2_lowest_level ) /
+      ( (double)( r2_hist_computed_levels - 1 ) );
+  }  
+     
+   /* Building initial histograms */
+   
+   init_jhist_ = new unsigned int*[ r1_hist_computed_levels ];
+   init_jhist_lines_ = r1_hist_computed_levels;
+
+   init_r1hist_ = new unsigned int[ r1_hist_computed_levels ];
+   init_r2hist_ = new unsigned int[ r2_hist_computed_levels ];
+   {
+     unsigned int hist_index1 = 0;
+     unsigned int hist_index2 = 0;
+     
+     for( hist_index1 = 0 ; hist_index1 < r1_hist_computed_levels ; ++hist_index1 )
+     {
+       init_r1hist_[ hist_index1 ] = 0;
+       init_jhist_[ hist_index1 ] = new unsigned int[ r2_hist_computed_levels ];
+       
+       for( hist_index2 = 0 ; hist_index2 < r2_hist_computed_levels ; ++hist_index2 )
+       {
+         init_jhist_[ hist_index1 ][ hist_index2 ] = 0;
+       }
+     }
+       
+     for( hist_index2 = 0 ; hist_index2 < r2_hist_computed_levels ; ++hist_index2 )
+     {
+       init_r2hist_[ hist_index2 ] = 0;
+     }
+   }
+     
+   /* Analysing raster */
+   
+   {
+     const unsigned long int progress_steps = 
+       getProgressSteps( restricPolSet, inputRaster1.params().resy_ ); 
+     
+     TePDIPIManager progress( "Generating histogram", progress_steps, 
+       progressEnabled_ );
+   
+     TeRaster::iteratorPoly r1_it;
+     TeRaster::iteratorPoly r2_it;
+     
+     long int r1_line = 0;
+     long int r1_col = 0;
+     long int last_r1_line = 0;
+     
+     long int r2_line_off = 0;
+     long int r2_col_off = 0;
+     
+     double r1_value_double = 0;
+     double r2_value_double = 0;
+     unsigned int r1_value_int = 0;
+     unsigned int r2_value_int = 0;
+     
+     bool gotvalue1 = false;
+     bool gotvalue2 = false;
+     
+     for( unsigned int polset_index = 0 ; polset_index < 
+       restricPolSet.size() ; ++polset_index ) 
+     {
+       r1_it = inputRaster1.begin( restricPolSet[ polset_index ], 
+         iterStrat, 0 );
+       r2_it = inputRaster2.begin( restricPolSet[ polset_index ], 
+         iterStrat, 0 );
+       
+       if( ( ! r1_it.end() ) && ( ! r2_it.end() ) )
+       {
+         r1_line = r1_it.currentLine();
+         r1_col = r1_it.currentColumn();
+         
+         r2_line_off = r1_line - r2_it.currentLine();
+         r2_col_off = r1_col - r2_it.currentColumn();         
+  
+         while( ! r1_it.end() ) {
+           gotvalue1 = inputRaster1.getElement( r1_col, r1_line, 
+             r1_value_double, inputRasterChn1 );
+           gotvalue2 = inputRaster2.getElement( r1_col - r2_col_off, 
+             r1_line - r2_line_off, r2_value_double, inputRasterChn2 );
+           
+           if( gotvalue1 )
+           {
+             r1_value_int = (unsigned int) TeRound( ( r1_value_double - 
+               r1_lowest_level ) / r1_step );
+             TEAGN_DEBUG_CONDITION( r1_value_int < r1_hist_computed_levels,
+               "Invalid histogram index");
+
+             ++( init_r1hist_[ r1_value_int ] );
+           }
+           
+           if( gotvalue2 )
+           {
+             r2_value_int = (unsigned int) TeRound( ( r2_value_double - 
+               r2_lowest_level ) / r2_step );
+             TEAGN_DEBUG_CONDITION( r2_value_int < r2_hist_computed_levels,
+               "Invalid histogram index");
+           
+             ++( init_r2hist_[ r2_value_int ] );
+             
+             if( gotvalue1 )
+             {
+               ++( init_jhist_[ r1_value_int ][ r2_value_int ] );          
+             }             
+           }
+           
+           if( r1_line != last_r1_line ) {
+             TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+               "Canceled by the user" );
+             
+             last_r1_line = r1_line;
+           }
+           
+           ++r1_it;
+           r1_line = r1_it.currentLine();
+           r1_col = r1_it.currentColumn();           
+         }
+       }
+     }  
+   }    
+  
+   /* Building ordered joint histogram */
+   
+   {
+     unsigned int hist_index1 = 0;
+     unsigned int hist_index2 = 0;
+     std::pair< double, double > temp_pair;
+     
+     for( hist_index1 = 0 ; hist_index1 < r1_hist_computed_levels ; 
+       ++hist_index1 )
+     {
+       if( hist_index1 == ( r1_hist_computed_levels - 1 ) )
+       {
+         temp_pair.first = r1_highest_level;
+       }
+       else
+       {
+         temp_pair.first = ( r1_step * (double)hist_index1 ) + 
+           r1_lowest_level;
+       }
+       
+       for( hist_index2 = 0 ; hist_index2 < r2_hist_computed_levels ;
+         ++hist_index2 )
+       { 
+         if( init_jhist_[ hist_index1 ][ hist_index2 ] )  
+         {
+           if( hist_index2 == ( r2_hist_computed_levels - 1 ) )
+           {
+             temp_pair.second = r2_highest_level;
+           }
+           else
+           {
+             temp_pair.second = ( r2_step * (double)hist_index2 ) + 
+               r2_lowest_level;
+           }     
+             
+           jHistContainer_[ temp_pair ] = init_jhist_[ hist_index1 ][ 
+             hist_index2 ];
+         }
+       }
+     }
+   }
+      
+   /* Building ordered raster 1 histogram */
+   
+   {
+     for( unsigned int hist_index = 0 ; hist_index < r1_hist_computed_levels ; 
+       ++hist_index )
+     {
+       if( init_r1hist_[ hist_index ] )
+       {
+         if( hist_index == ( r1_hist_computed_levels - 1 ) )
+         {
+           r1Histogram_[ r1_highest_level ] = init_r1hist_[ hist_index ];
+         }
+         else
+         {
+           r1Histogram_[ ( r1_step * (double)hist_index ) + r1_lowest_level ] =
+             init_r1hist_[ hist_index ];
+         }
+       }
+     }
+   }   
+   
+   /* Building ordered raster 2 histogram */
+   
+   {
+     for( unsigned int hist_index = 0 ; hist_index < r2_hist_computed_levels ; 
+       ++hist_index )
+     {
+       if( init_r2hist_[ hist_index ] ) 
+       {
+         if( hist_index == ( r2_hist_computed_levels - 1 ) )
+         {
+           r2Histogram_[ r2_highest_level ] = init_r2hist_[ hist_index ];
+         }
+         else
+         {
+           r2Histogram_[ ( r2_step * (double)hist_index ) + r2_lowest_level ] =
+             init_r2hist_[ hist_index ];
+         }
+       }
+     }
+   }  
+
+   clearTempHistBuffers(); 
+      
+   return true;
+}
+
+bool TePDIJointHistogram::updateInteger( TeRaster& inputRaster1, 
+  unsigned int inputRasterChn1, TeRaster& inputRaster2, 
+  unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
+  const TePolygonSet& restricPolSet )
+{
+   /* Analysing raster */
+   
+   {
+     const unsigned long int progress_steps = 
+       getProgressSteps( restricPolSet, inputRaster1.params().resy_ ); 
+     
+     TePDIPIManager progress( "Generating histogram", progress_steps, 
+       progressEnabled_ );
+   
+     TeRaster::iteratorPoly r1_it;
+     TeRaster::iteratorPoly r2_it;
+     
+     long int r1_line = 0;
+     long int r1_col = 0;
+     long int last_r1_line = 0;
+     
+     long int r2_line_off = 0;
+     long int r2_col_off = 0;
+     
+     bool gotvalue1 = false;
+     bool gotvalue2 = false;
+
+     std::pair< double, double > tempPair;
+     
+     for( unsigned int polset_index = 0 ; polset_index < 
+       restricPolSet.size() ; ++polset_index ) 
+     {
+       r1_it = inputRaster1.begin( restricPolSet[ polset_index ], 
+         iterStrat, 0 );
+       r2_it = inputRaster2.begin( restricPolSet[ polset_index ], 
+         iterStrat, 0 );
+       
+       if( ( ! r1_it.end() ) && ( ! r2_it.end() ) )
+       {
+         r1_line = r1_it.currentLine();
+         r1_col = r1_it.currentColumn();
+         
+         r2_line_off = r1_line - r2_it.currentLine();
+         r2_col_off = r1_col - r2_it.currentColumn();         
+  
+         while( ! r1_it.end() ) {
+           gotvalue1 = inputRaster1.getElement( r1_col, r1_line, 
+             tempPair.first, inputRasterChn1 );
+           gotvalue2 = inputRaster2.getElement( r1_col - r2_col_off, 
+             r1_line - r2_line_off, tempPair.second, inputRasterChn2 );
+           
+           if( gotvalue1 )
+           {
+             ++( r1Histogram_[ tempPair.first ] );
+           }
+           
+           if( gotvalue2 )
+           {
+             ++( r2Histogram_[ tempPair.second ] );
+             
+             if( gotvalue1 )
+             {
+               ++( jHistContainer_[ tempPair ] );          
+             }             
+           }
+           
+           if( r1_line != last_r1_line ) {
+             TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+               "Canceled by the user" );
+             
+             last_r1_line = r1_line;
+           }
+           
+           ++r1_it;
+           r1_line = r1_it.currentLine();
+           r1_col = r1_it.currentColumn();           
+         }
+       }
+     }  
+   }    
+
+   clearTempHistBuffers();
+   
+   return true;
+}
+
+bool TePDIJointHistogram::update8Bits( TeRaster& inputRaster1, 
+  unsigned int inputRasterChn1, TeRaster& inputRaster2, 
+  unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
+  const TePolygonSet& restricPolSet )
+{
+   /* Defining level offset based on data bype */
+   
+   unsigned int level_offset1 = 0;
+   
+   if( inputRaster1.params().dataType_[ inputRasterChn1 ] == TeCHAR ) {
+     level_offset1 = 127; /*( 256 / 2 ) - 1 */
+   }
+   
+   unsigned int level_offset2 = 0;
+   
+   if( inputRaster2.params().dataType_[ inputRasterChn2 ] == TeCHAR ) {
+     level_offset2 = 127; /*( 256 / 2 ) - 1 */
+   }   
+     
+   /* Building initial histograms */
+   
+   init_jhist_ = new unsigned int*[ 256 ];
+   init_jhist_lines_ = 256;
+
+   init_r1hist_ = new unsigned int[ 256 ];
+   init_r2hist_ = new unsigned int[ 256 ];
+   {
+     unsigned int hist_index1 = 0;
+     unsigned int hist_index2 = 0;
+     
+     for( hist_index1 = 0 ; hist_index1 < 256 ; ++hist_index1 )
+     {
+       init_r1hist_[ hist_index1 ] = 0;
+       init_jhist_[ hist_index1 ] = new unsigned int[ 256 ];
+       
+       for( hist_index2 = 0 ; hist_index2 < 256 ; ++hist_index2 )
+       {
+         init_jhist_[ hist_index1 ][ hist_index2 ] = 0;
+       }
+     }
+
+     for( hist_index2 = 0 ; hist_index2 < 256 ; ++hist_index2 )
+     {
+       init_r2hist_[ hist_index2 ] = 0;
+     }
+   }
+   
+   /* Analysing raster */
+   
+   {
+     const unsigned long int progress_steps = 
+       getProgressSteps( restricPolSet, inputRaster1.params().resy_ ); 
+     
+     TePDIPIManager progress( "Generating histogram", progress_steps, 
+       progressEnabled_ );
+   
+     TeRaster::iteratorPoly r1_it;
+     TeRaster::iteratorPoly r2_it;
+     
+     long int r1_line = 0;
+     long int r1_col = 0;
+     long int last_r1_line = 0;
+     
+     long int r2_line_off = 0;
+     long int r2_col_off = 0;
+     
+     double r1_value_double = 0;
+     double r2_value_double = 0;
+     int r1_value_int = 0;
+     int r2_value_int = 0;
+     
+     bool gotvalue1 = false;
+     bool gotvalue2 = false;
+   
+     for( unsigned int polset_index = 0 ; polset_index < 
+       restricPolSet.size() ; ++polset_index ) 
+     {
+       r1_it = inputRaster1.begin( restricPolSet[ polset_index ], 
+         iterStrat, 0 );
+       r2_it = inputRaster2.begin( restricPolSet[ polset_index ], 
+         iterStrat, 0 );
+       
+       if( ( ! r1_it.end() ) && ( ! r2_it.end() ) )
+       {
+         r1_line = r1_it.currentLine();
+         r1_col = r1_it.currentColumn();
+         
+         r2_line_off = r1_line - r2_it.currentLine();
+         r2_col_off = r1_col - r2_it.currentColumn();         
+  
+         while( ! r1_it.end() ) {
+           gotvalue1 = inputRaster1.getElement( r1_col, r1_line, 
+             r1_value_double, inputRasterChn1 );
+           gotvalue2 = inputRaster2.getElement( r1_col - r2_col_off, 
+             r1_line - r2_line_off, r2_value_double, inputRasterChn2 );
+           
+           if( gotvalue1 )
+           {
+             r1_value_int = ( int ) r1_value_double;
+             TEAGN_DEBUG_CONDITION( (r1_value_int + level_offset1) < 256,
+               "Invalid histogram index");
+
+             ++( init_r1hist_[ r1_value_int + level_offset1 ] );
+           }
+           
+           if( gotvalue2 )
+           {
+             r2_value_int = ( int ) r2_value_double;
+             TEAGN_DEBUG_CONDITION( (r2_value_int + level_offset2) < 256,
+               "Invalid histogram index");
+           
+             ++( init_r2hist_[ r2_value_int + level_offset2 ] );
+             
+             if( gotvalue1 )
+             {
+               ++( init_jhist_[ r1_value_int + level_offset1 ][ r2_value_int + 
+                 level_offset2 ] );  
+             }             
+           }
+           
+           if( r1_line != last_r1_line ) {
+             TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+               "Canceled by the user" );
+             
+             last_r1_line = r1_line;
+           }
+           
+           ++r1_it;
+           r1_line = r1_it.currentLine();
+           r1_col = r1_it.currentColumn();           
+         }
+       }
+     }  
+   }    
+   
+   /* Building ordered joint histogram */
+   
+   {
+     unsigned int hist_index1 = 0;
+     unsigned int hist_index2 = 0;
+     std::pair< double, double > temp_pair;
+     
+     for( hist_index1 = 0 ; hist_index1 < 256 ; ++hist_index1 )
+     {
+       for( hist_index2 = 0 ; hist_index2 < 256 ; ++hist_index2 )
+       { 
+         if( init_jhist_[ hist_index1 ][ hist_index2 ] ) 
+         {
+           temp_pair.first = ( (double)hist_index1 ) - ( (double)level_offset1 );
+           temp_pair.second = ( (double)hist_index2 ) - ( (double)level_offset2 );
+           
+           jHistContainer_[ temp_pair ] = init_jhist_[ hist_index1 ][ hist_index2 ];
+         }
+       }
+     }
+   }
+   
+   /* Building ordered raster 1 histogram */
+   
+   {
+     unsigned int hist_index = 0;
+     
+     for( hist_index = 0 ; hist_index < 256 ; ++hist_index )
+     {
+       if( init_r1hist_[ hist_index ] )
+       {
+         r1Histogram_[ ( (double)hist_index ) - ( (double)level_offset1 ) ] =
+          init_r1hist_[ hist_index ];
+       }
+     }
+   }   
+   
+   /* Building ordered raster 2 histogram */
+   
+   {
+     unsigned int hist_index = 0;
+     
+     for( hist_index = 0 ; hist_index < 256 ; ++hist_index )
+     {
+       if( init_r2hist_[ hist_index ] )
+       {
+         r2Histogram_[ ( (double)hist_index ) - ( (double)level_offset2 ) ] =
+           init_r2hist_[ hist_index ];
+       }
+     }
+   }    
+
+   clearTempHistBuffers();
+   
+   return true;
+}
+
+unsigned long int TePDIJointHistogram::getProgressSteps( 
+  const TePolygonSet& polset, double resy )
+{
+  unsigned long int steps = 0;
+
+  for( unsigned int ps_index = 0 ; ps_index < polset.size() ; 
+    ++ps_index ) {
+    
+    const TeBox& polbox( polset[ ps_index ].box() );
+    steps += ( unsigned long int)ABS( ( polbox.y2() - polbox.y1() ) / resy );
+  }
+  
+  return steps;
+}
+
+void TePDIJointHistogram::clearTempHistBuffers()
+{
+  if( init_jhist_ )
+  {
+    for( unsigned int line = 0 ; line < init_jhist_lines_ ; ++line )
+    {
+      if( init_jhist_[ line ] ) delete[]( init_jhist_[ line ] );
+    }
+
+    delete[]( init_jhist_ );
+
+    init_jhist_ = 0;
+    init_jhist_lines_ = 0;
+  }
+
+  if( init_r1hist_ )
+  {
+    delete[]( init_r1hist_ );
+    init_r1hist_ = 0;
+  }
+
+  if( init_r2hist_ )
+  {
+    delete[]( init_r2hist_ );
+    init_r2hist_ = 0;
+	}
+}
diff --git a/src/terralib/image_processing/TePDIJointHistogram.hpp b/src/terralib/image_processing/TePDIJointHistogram.hpp
old mode 100755
new mode 100644
index 0ed8a6f..da75f0d
--- a/src/terralib/image_processing/TePDIJointHistogram.hpp
+++ b/src/terralib/image_processing/TePDIJointHistogram.hpp
@@ -1,191 +1,197 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIJOINTHISTOGRAM_HPP
-  #define TEPDIJOINTHISTOGRAM_HPP
-
-  #include "TePDIHistogram.hpp"
-  #include "TePDITypes.hpp"
-
-  #include <map>
-  
-  class TePDIHistogram;
-  
-  /**
-   * @brief Raster joint histogram.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAux
-   */
-  class PDI_DLL TePDIJointHistogram
-  {
-    public :
-      
-      //! Joint histogram container type definition.
-      typedef std::map< std::pair< double, double >, unsigned int > ConteinerT;
-      
-      //! Iterator type definition.
-      typedef ConteinerT::iterator iterator;
-      
-      //! Const-Iterator type definition.
-      typedef ConteinerT::const_iterator const_iterator;
-        
-      TePDIJointHistogram();
-      
-      TePDIJointHistogram( const TePDIJointHistogram& external );      
-
-       ~TePDIJointHistogram();
-      
-      const TePDIJointHistogram& operator=( const TePDIJointHistogram& external );      
-      
-      /**
-       * @brief Enable / Disable the progress interface.
-       *
-       * @param enabled Flag to enable ( true - default ) or disable ( false ).
-       */      
-      void toggleProgress( bool enabled );
-
-      /**
-       * @brief Update the current histogram reading data from the supplied
-       * rasters.
-       *
-       * @param input1Raster Input raster.
-       * @param input1RasterChn Input raster channel/band number.
-       * @param input2Raster Input raster.
-       * @param input2RasterChn Input raster channel/band number.
-       * @param iterStrat The raster iteration strategy (if you
-       * do not know what this is use TeBoxPixelIn).
-       * @param levels The number of histogram levels, and if set to zero,
-       * the number of levels will be automaticlly found by using
-       * level step with value one.
-       * @param restricPolSet The restriction polygon set.
-       * @return true if OK, false on errors.
-       * @note Pallete based rasters not supported.
-       * @note Only rasters with the same pixel resolution must be used.
-       * @note Floating point rasters will generate an aproximated histogram
-           with the number of gray levels configured by the parameter levels.
-       */
-      bool update( TeRaster& inputRaster1, 
-        unsigned int inputRasterChn1, TeRaster& inputRaster2, 
-        unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
-        unsigned int levels,
-        const TePolygonSet& restricPolSet = TePolygonSet() );
-      
-      /**
-       * @brief Clear the current histogram contents.
-       */      
-      void clear();      
-      
-      //!  Return a reference to raster 1 histogram.
-      /*!
-        \return A reference to raster 1 histogram.
-      */
-      const TePDIHistogram& getRaster1Hist() const;
-      
-      //!  Return a reference to raster 2 histogram.
-      /*!
-        \return A reference to raster 2 histogram.
-      */
-      const TePDIHistogram& getRaster2Hist() const;
-      
-      //! Returns an iterator pointing to the beginning of the joint histogram.
-      const_iterator begin() const;
-      
-      //! Returns an iterator pointing to the end of the joint histogram.
-      const_iterator end() const;
-      
-      //! Returns the histogram size.
-      unsigned int size() const;
-
-      //! Generate a inversed joint histogram from the current one.
-      /*!
-          \param external A external output histogram.
-          \note The inversed histogram has swapped raster1 and raster2 
-          values.
-      */
-      void getInverseJHist( TePDIJointHistogram& external );
-      
-      //! Returns the sum of all pixel velues frequencies.
-      /*! \return The sum of all pixel velues frequencies. */
-      unsigned long int getFreqSum() const;      
-      
-    protected :
-      
-      //! Progress enabled flag.
-      bool progressEnabled_;
-
-      //! Internal container.
-      ConteinerT jHistContainer_;
-      
-      //! Raster1 histogram.
-      TePDIHistogram r1Histogram_;
-      
-      //! Raster2 histogram.
-      TePDIHistogram r2Histogram_;
-
-      // Internal used variables to store temporary histogram buffers.
-	    unsigned int** init_jhist_;
-      unsigned int init_jhist_lines_;
-      unsigned int init_jhist_cols_;
-	    unsigned int* init_r1hist_;
-	    unsigned int* init_r2hist_;
-      
-      // Just like the Update method, but for floating point rasters.
-      bool updateFloat( TeRaster& inputRaster1, 
-          unsigned int inputRasterChn1, TeRaster& inputRaster2, 
-          unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
-          unsigned int levels, const TePolygonSet& restricPolSet );
-      
-      // Just like the Update method, but for integer rasters.
-      bool updateInteger( TeRaster& inputRaster1, 
-          unsigned int inputRasterChn1, TeRaster& inputRaster2, 
-          unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
-          const TePolygonSet& restricPolSet );
-      
-      // Just like the Update method, but for 8 bits rasters.
-      bool update8Bits( TeRaster& inputRaster1, 
-          unsigned int inputRasterChn1, TeRaster& inputRaster2, 
-          unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
-          const TePolygonSet& restricPolSet ); 
-      
-      /**
-       * @brief Calculate the number of progress steps when using
-       * a polygon iterator over a raster for the supplied 
-       * polygon set.
-       *
-       * @param polset The polygon set.
-       * @param resy Y axis resolution.
-       */        
-      unsigned long int getProgressSteps( 
-        const TePolygonSet& polset, double resy );     
-
-      //! Clear the internal temporary histogram buffers ( init_jhist_, init_jhist_lines_, init_jhist_cols_, init_r1hist_, init_r2hist_.
-      void clearTempHistBuffers();
-    
-  };
-  
-/** @example TePDIJointHistogram_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIJOINTHISTOGRAM_HPP
+  #define TEPDIJOINTHISTOGRAM_HPP
+
+  #include "TePDIHistogram.hpp"
+  #include "TePDITypes.hpp"
+
+  #include <map>
+  
+  class TePDIHistogram;
+  
+  /**
+   * @class TePDIJointHistogram
+   * @brief Raster joint histogram.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAux
+   */
+  class PDI_DLL TePDIJointHistogram
+  {
+    public :
+      
+      //! Joint histogram container type definition.
+      typedef std::map< std::pair< double, double >, unsigned int > ConteinerT;
+      
+      //! Iterator type definition.
+      typedef ConteinerT::iterator iterator;
+      
+      //! Const-Iterator type definition.
+      typedef ConteinerT::const_iterator const_iterator;
+        
+      TePDIJointHistogram();
+      
+      TePDIJointHistogram( const TePDIJointHistogram& external );      
+
+       ~TePDIJointHistogram();
+      
+      const TePDIJointHistogram& operator=( const TePDIJointHistogram& external );      
+      
+      /**
+       * @brief Enable / Disable the progress interface.
+       *
+       * @param enabled Flag to enable ( true - default ) or disable ( false ).
+       */      
+      void toggleProgress( bool enabled );
+
+      /**
+       * @brief Update the current histogram reading data from the supplied
+       * rasters.
+       *
+       * @param input1Raster Input raster.
+       * @param input1RasterChn Input raster channel/band number.
+       * @param input2Raster Input raster.
+       * @param input2RasterChn Input raster channel/band number.
+       * @param iterStrat The raster iteration strategy (if you
+       * do not know what this is use TeBoxPixelIn).
+       * @param levels The number of histogram levels, and if set to zero,
+       * the number of levels will be automaticlly found by using
+       * level step with value one.
+       * @param restricPolSet The restriction polygon set.
+       * @return true if OK, false on errors.
+       * @note Pallete based rasters not supported.
+       * @note Only rasters with the same pixel resolution must be used.
+       * @note Floating point rasters will generate an aproximated histogram
+           with the number of gray levels configured by the parameter levels.
+       */
+      bool update( TeRaster& inputRaster1, 
+        unsigned int inputRasterChn1, TeRaster& inputRaster2, 
+        unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
+        unsigned int levels,
+        const TePolygonSet& restricPolSet = TePolygonSet() );
+      
+      /**
+       * @brief Clear the current histogram contents.
+       */      
+      void clear();      
+      
+      //!  Return a reference to raster 1 histogram.
+      /*!
+        \return A reference to raster 1 histogram.
+      */
+      const TePDIHistogram& getRaster1Hist() const;
+      
+      //!  Return a reference to raster 2 histogram.
+      /*!
+        \return A reference to raster 2 histogram.
+      */
+      const TePDIHistogram& getRaster2Hist() const;
+      
+      //! Returns an iterator pointing to the beginning of the joint histogram.
+      const_iterator begin() const;
+      
+      //! Returns an iterator pointing to the end of the joint histogram.
+      const_iterator end() const;
+      
+      //! Returns the histogram size.
+      unsigned int size() const;
+
+      //! Generate a inversed joint histogram from the current one.
+      /*!
+          \param external A external output histogram.
+          \note The inversed histogram has swapped raster1 and raster2 
+          values.
+      */
+      void getInverseJHist( TePDIJointHistogram& external );
+      
+      //! Returns the sum of all pixel velues frequencies.
+      /*! \return The sum of all pixel velues frequencies. */
+      unsigned long int getFreqSum() const;     
+       
+      /**
+       * @brief Ouput histogram to string.
+       */      
+      std::string toString() const;       
+      
+    protected :
+      
+      //! Progress enabled flag.
+      bool progressEnabled_;
+
+      //! Internal container.
+      ConteinerT jHistContainer_;
+      
+      //! Raster1 histogram.
+      TePDIHistogram r1Histogram_;
+      
+      //! Raster2 histogram.
+      TePDIHistogram r2Histogram_;
+
+      // Internal used variables to store temporary histogram buffers.
+	    unsigned int** init_jhist_;
+      unsigned int init_jhist_lines_;
+      unsigned int init_jhist_cols_;
+	    unsigned int* init_r1hist_;
+	    unsigned int* init_r2hist_;
+      
+      // Just like the Update method, but for floating point rasters.
+      bool updateFloat( TeRaster& inputRaster1, 
+          unsigned int inputRasterChn1, TeRaster& inputRaster2, 
+          unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
+          unsigned int levels, const TePolygonSet& restricPolSet );
+      
+      // Just like the Update method, but for integer rasters.
+      bool updateInteger( TeRaster& inputRaster1, 
+          unsigned int inputRasterChn1, TeRaster& inputRaster2, 
+          unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
+          const TePolygonSet& restricPolSet );
+      
+      // Just like the Update method, but for 8 bits rasters.
+      bool update8Bits( TeRaster& inputRaster1, 
+          unsigned int inputRasterChn1, TeRaster& inputRaster2, 
+          unsigned int inputRasterChn2, TeStrategicIterator iterStrat, 
+          const TePolygonSet& restricPolSet ); 
+      
+      /**
+       * @brief Calculate the number of progress steps when using
+       * a polygon iterator over a raster for the supplied 
+       * polygon set.
+       *
+       * @param polset The polygon set.
+       * @param resy Y axis resolution.
+       */        
+      unsigned long int getProgressSteps( 
+        const TePolygonSet& polset, double resy );     
+
+      //! Clear the internal temporary histogram buffers ( init_jhist_, init_jhist_lines_, init_jhist_cols_, init_r1hist_, init_r2hist_.
+      void clearTempHistBuffers();
+    
+  };
+  
+/** @example TePDIJointHistogram_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif
diff --git a/src/terralib/image_processing/TePDIKMeansClas.cpp b/src/terralib/image_processing/TePDIKMeansClas.cpp
index a6523b7..1005928 100644
--- a/src/terralib/image_processing/TePDIKMeansClas.cpp
+++ b/src/terralib/image_processing/TePDIKMeansClas.cpp
@@ -1,344 +1,354 @@
-#include "TePDIKMeansClas.hpp"
-#include "TePDIStrategyFactory.hpp"
-#include "TePDIAlgorithmFactory.hpp"
-#include "TePDIUtils.hpp"
-
-#include <TeAgnostic.h>
-
-TePDIKMeansClas::TePDIKMeansClas()
-{
-};
-
-TePDIKMeansClas::~TePDIKMeansClas()
-{
-  tuple.clear();
-  clusters.clear();
-};
-
-void TePDIKMeansClas::ResetState( const TePDIParameters& )
-{
-
-}
-
-bool TePDIKMeansClas::CheckParameters(const TePDIParameters& parameters) const
-{
-// Checking input_rasters
-  TePDITypes::TePDIRasterPtrType input_raster;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_raster", input_raster), "Missing parameter: input_raster");
-  TEAGN_TRUE_OR_RETURN(input_raster->params().nBands() > 0, "Invalid input rasters number");
-
-// Checking output_raster
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_raster", output_raster), "Missing parameter: output_raster");
-  TEAGN_TRUE_OR_RETURN(output_raster.isActive(), "Invalid parameter: output_raster inactive");
-  TEAGN_TRUE_OR_RETURN(output_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready");
-
-// Checking nClass
-  int nClass = 0;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("classes_number", nClass), "Missing parameter: classes_number");
-  TEAGN_TRUE_OR_RETURN( ( nClass > 0 ) , "Invalid parameter - classes_number" );
-
-// Checking bands
-  vector<int> bands;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
-  TEAGN_TRUE_OR_RETURN(bands.size() > 0, " Invalid parameter: bands number ");
-  for( unsigned int bands_index = 0 ; bands_index < bands.size() ; 
-    ++bands_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( 
-      ( bands[ bands_index ] < input_raster->params().nBands() ),
-      "Invalid parameter : bands[" + Te2String( bands_index ) + "]" )  
-  }
-  
-  return true;
-}
-
-bool TePDIKMeansClas::RunImplementation()
-{
-// Getting raster vector
-  params_.GetParameter("input_raster", input_raster);
-  
-// Getting output raster
-  params_.GetParameter("output_raster", output_raster);
-
-  /* Setting the output raster */
-  TeRasterParams output_raster_params = output_raster->params();
-
-  output_raster_params.setDataType( TeUNSIGNEDCHAR );
-  output_raster_params.nBands( 1 );
-  if( input_raster->projection() != 0 ) 
-  {
-    output_raster_params.projection( input_raster->projection() );
-  }
-
-  output_raster_params.boxResolution( input_raster->params().box().x1(), 
-    input_raster->params().box().y1(), input_raster->params().box().x2(), 
-    input_raster->params().box().y2(), input_raster->params().resx_, 
-    input_raster->params().resy_ ); 
-  
-  TEAGN_TRUE_OR_RETURN( output_raster->init( output_raster_params ), 
-    "Output raster reset error" );
-
-  output_raster->params().status_ = TeRasterParams::TeReadyToWrite;
-
-// Getting bands
-  params_.GetParameter("bands", bands);
-  n_Bands = bands.size();
-
-// Getting number of classe
-  params_.GetParameter("classes_number", n_Class);
-
-// Checking nIter
-  int nIter = 0;
-  if( params_.CheckParameter< int >( "iterations_number" ) ) 
-  {
-    params_.GetParameter( "iterations_number", nIter );
-  }
-  n_Iter = nIter <= 0 ? 10 : nIter;
-
-// Checking initial line
-  int lineBegin = 0;
-  if( params_.CheckParameter< int >( "line_begin" ) ) 
-  {
-    params_.GetParameter( "line_begin", lineBegin );
-  }
-  initial_line = lineBegin <= 0 || lineBegin >=  input_raster->params().nlines_ ? 0 : lineBegin;
-  
-// Checking end line
-  int lineEnd = 0;
-  if( params_.CheckParameter< int >( "line_end" ) ) 
-  {
-    params_.GetParameter( "line_end", lineEnd );
-  }
-  end_line = lineEnd <= 0 || lineEnd >= input_raster->params().nlines_ ? input_raster->params().nlines_ - 1 : lineEnd;
-
-// Checking initial column
-  int columnBegin = 0;
-  if( params_.CheckParameter< int >( "column_begin" ) ) 
-  {
-    params_.GetParameter( "column_begin", columnBegin );
-  }
-  initial_column = columnBegin <= 0 || columnBegin >= input_raster->params().ncols_ ? 0 : columnBegin;
-
-// Checking end column
-  int columnEnd = 0;
-  if( params_.CheckParameter< int >( "column_end" ) ) 
-  {
-    params_.GetParameter( "column_end", columnEnd );
-  }
-  end_column = columnEnd <= 0 || columnEnd >= input_raster->params().ncols_ ? input_raster->params().ncols_ - 1 : columnEnd;
-
-// Checking fSamp
-  int fSamp = 0;
-  if( params_.CheckParameter< int >( "sample" ) ) 
-  {
-    params_.GetParameter( "sample", fSamp );
-  }
-  
-  int defaultSamp = ( (end_line - initial_line + 1)*( end_column - initial_column + 1) ) / (256*256);
-  
-  if( defaultSamp <= 0 )
-    defaultSamp = 1;
-
-  f_Samp = fSamp == 0 ? defaultSamp : fSamp;
-
-//initialization of cluster vector
-  for( int i = 0; i < 256; ++i )
-  {
-    clusters.push_back(0);
-  }
-  
-  classifyPixels(initial_line, end_line, columnBegin, end_column);
-
-
-  return true;
-}
-
-void TePDIKMeansClas::GenerateClassificationParameters()
-{  
-// Creates first Cluster
-  clusters[0] =  new TePDICluster( n_Bands );
-
-  tuple.clear();
-
-  TePDIPIManager progress("Generating Classification Parameters", end_line,
-    progress_enabled_ );
-
-  for( int lin = initial_line; lin <= end_line; lin += f_Samp )
-  {
-    for( int col = initial_column; col <= end_column; col += f_Samp )
-    {
-      for( int band = 0; band < n_Bands; ++band )
-      {
-        double value;
-        input_raster->getElement(col,lin, value, bands[band]);
-        tuple.push_back(value);
-      }
-
-      clusters[0]->add(tuple);
-
-      tuple.clear();
-    }
-    progress.Increment();
-  }
-
-  progress.Toggle(false);
-
-  clusters[0]->updateStatistics();
-
-// Generates other clusters 
-  class_count = 1;
-  while( class_count < n_Class )
-  {
-    if( !split() )
-      break;
-  }
-
-  kmeans();
-
-  return;
-}
-
-  
-bool TePDIKMeansClas::split()
-{
-//Selects class with biggest variance
-  TePDICluster* splitCluster = clusters[0];
-  for( int indclass = 1; indclass < class_count; ++indclass )
-  {
-    if( splitCluster->maxVar() < clusters[indclass]->maxVar() )
-    {
-      splitCluster = clusters[indclass];
-    }
-  }
-
-  if( splitCluster->splitRight().GetNban() <= 0 )
-    return false;
-
-// Splits Cluster
-  clusters[class_count++] = new TePDICluster( splitCluster->splitRight() );
-  *splitCluster = splitCluster->splitLeft();
-
-// Classify Samples
-  classifySamples();
-
-  return true;
-}
-  
-void TePDIKMeansClas::kmeans()
-{
-  if( class_count <= 1 )
-    return;
-
-  TePDIPIManager progress("Classifying Samples", n_Iter, progress_enabled_ );
-
-  for( int iter = 0; iter < n_Iter; ++iter )
-  {
-    classifySamples();
-    progress.Increment();
-  }
-  
-  progress.Toggle(false);
-
-  return;
-}
-
-void TePDIKMeansClas::classifySamples()
-{
-  int indclass;
-
-// Reset Counts
-  for( indclass = 0; indclass < class_count; ++indclass )
-  {
-    clusters[indclass]->resetCount();
-  }
-
-  tuple.clear();
-
-
-// Classification of samples
-  for( int lin = initial_line; lin <= end_line; lin += f_Samp )
-  {
-    for( int col = initial_column; col <= end_column; col += f_Samp )
-    {
-      for( int band = 0; band < n_Bands; ++band )
-      {
-        double value;
-        input_raster->getElement(col, lin, value, bands[band]);
-        tuple.push_back(value);
-      }
-
-      TePDICluster* bestCluster = clusters[0];
-      
-      double distance = bestCluster->dist( tuple );
-
-      for( int indclass = 1; indclass < class_count; ++indclass )
-      {
-        if( clusters[indclass]->dist( tuple ) < distance )
-        {
-          bestCluster = clusters[indclass];
-          distance = clusters[indclass]->dist( tuple );
-        }
-      }
-
-      bestCluster->add( tuple );
-
-      tuple.clear();
-    }
-  }
-
-// Update Statistics
-  for( indclass = 0; indclass < class_count; ++indclass )
-  {
-    clusters[indclass]->updateStatistics();
-  }
-
-  return;
-}
-
-
-int TePDIKMeansClas::classifyPixels( int l1, int l2, int c1, int c2)
-{
-  vector<double> pixel;
-
-  GenerateClassificationParameters();
-
-  TePDIPIManager progress("Classifying Pixels", l2, progress_enabled_ );
-
-  for( int lin = l1; lin <= l2; lin++ )
-  {
-    for( int col = c1; col <= c2; col++ )
-    {
-      for( int ban = 0; ban < n_Bands; ban++ )
-      {
-        double value;
-        input_raster->getElement(col, lin, value, bands[ban]);
-        pixel.push_back(value);
-      }
-
-      double dist = 0;
-      double distance = clusters[0]->dist( pixel );
-      int besttheme = 0;
-      for(int indclass = 0; indclass < class_count; ++indclass )
-      {
-        if( ( dist = clusters[indclass]->dist( pixel ) ) < distance )
-        {
-          distance  = dist;
-          besttheme = indclass;
-        }
-      }
-
-      pixel.clear();
-
-      output_raster->setElement(col, lin, besttheme);
-    }
-
-    progress.Increment();
-  }
-
-  progress.Toggle(false);
-
-  pixel.clear();
-
-  return class_count;
-}
+#include "TePDIKMeansClas.hpp"
+#include "TePDIStrategyFactory.hpp"
+#include "TePDIAlgorithmFactory.hpp"
+#include "TePDIUtils.hpp"
+
+#include <TeAgnostic.h>
+
+TePDIKMeansClas::TePDIKMeansClas()
+{
+};
+
+TePDIKMeansClas::~TePDIKMeansClas()
+{
+  tuple.clear();
+  clusters.clear();
+};
+
+void TePDIKMeansClas::ResetState( const TePDIParameters& )
+{
+
+}
+
+bool TePDIKMeansClas::CheckParameters(const TePDIParameters& parameters) const
+{
+// Checking input_rasters
+  TePDITypes::TePDIRasterPtrType input_raster;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_raster", input_raster), "Missing parameter: input_raster");
+  TEAGN_TRUE_OR_RETURN(input_raster->params().nBands() > 0, "Invalid input rasters number");
+
+// Checking output_raster
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_raster", output_raster), "Missing parameter: output_raster");
+  TEAGN_TRUE_OR_RETURN(output_raster.isActive(), "Invalid parameter: output_raster inactive");
+  TEAGN_TRUE_OR_RETURN(output_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready");
+
+// Checking nClass
+  int nClass = 0;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("classes_number", nClass), "Missing parameter: classes_number");
+  TEAGN_TRUE_OR_RETURN( ( nClass > 0 ) , "Invalid parameter - classes_number" );
+
+// Checking bands
+  vector<int> bands;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+  TEAGN_TRUE_OR_RETURN(bands.size() > 0, " Invalid parameter: bands number ");
+  for( unsigned int bands_index = 0 ; bands_index < bands.size() ; 
+    ++bands_index ) {
+    
+    TEAGN_TRUE_OR_RETURN( 
+      ( bands[ bands_index ] < input_raster->params().nBands() ),
+      "Invalid parameter : bands[" + Te2String( bands_index ) + "]" )  
+  }
+  
+  return true;
+}
+
+bool TePDIKMeansClas::RunImplementation()
+{
+// Getting raster vector
+  params_.GetParameter("input_raster", input_raster);
+  
+// Getting output raster
+  params_.GetParameter("output_raster", output_raster);
+
+  /* Setting the output raster */
+  //TeRasterParams output_raster_params = output_raster->params();
+
+  //output_raster_params.setDataType( TeUNSIGNEDCHAR );
+  //output_raster_params.nBands( 1 );
+  //if( input_raster->projection() != 0 ) 
+  //{
+  //  output_raster_params.projection( input_raster->projection() );
+  //}
+
+  //output_raster_params.boxResolution( input_raster->params().box().x1(), 
+  //  input_raster->params().box().y1(), input_raster->params().box().x2(), 
+  //  input_raster->params().box().y2(), input_raster->params().resx_, 
+  //  input_raster->params().resy_ ); 
+  
+  TEAGN_TRUE_OR_RETURN( output_raster->init( ), 
+    "Output raster reset error" );
+
+  output_raster->params().status_ = TeRasterParams::TeReadyToWrite;
+
+// Getting bands
+  params_.GetParameter("bands", bands);
+  n_Bands = bands.size();
+
+// Getting number of classe
+  params_.GetParameter("classes_number", n_Class);
+
+// Checking nIter
+  int nIter = 0;
+  if( params_.CheckParameter< int >( "iterations_number" ) ) 
+  {
+    params_.GetParameter( "iterations_number", nIter );
+  }
+  n_Iter = nIter <= 0 ? 10 : nIter;
+
+// Checking initial line
+  int lineBegin = 0;
+  if( params_.CheckParameter< int >( "line_begin" ) ) 
+  {
+    params_.GetParameter( "line_begin", lineBegin );
+  }
+  initial_line = lineBegin <= 0 || lineBegin >=  input_raster->params().nlines_ ? 0 : lineBegin;
+  
+// Checking end line
+  int lineEnd = 0;
+  if( params_.CheckParameter< int >( "line_end" ) ) 
+  {
+    params_.GetParameter( "line_end", lineEnd );
+  }
+  end_line = lineEnd <= 0 || lineEnd >= input_raster->params().nlines_ ? input_raster->params().nlines_ - 1 : lineEnd;
+
+// Checking initial column
+  int columnBegin = 0;
+  if( params_.CheckParameter< int >( "column_begin" ) ) 
+  {
+    params_.GetParameter( "column_begin", columnBegin );
+  }
+  initial_column = columnBegin <= 0 || columnBegin >= input_raster->params().ncols_ ? 0 : columnBegin;
+
+// Checking end column
+  int columnEnd = 0;
+  if( params_.CheckParameter< int >( "column_end" ) ) 
+  {
+    params_.GetParameter( "column_end", columnEnd );
+  }
+  end_column = columnEnd <= 0 || columnEnd >= input_raster->params().ncols_ ? input_raster->params().ncols_ - 1 : columnEnd;
+
+// Checking fSamp
+  int fSamp = 0;
+  if( params_.CheckParameter< int >( "sample" ) ) 
+  {
+    params_.GetParameter( "sample", fSamp );
+  }
+  
+  int defaultSamp = ( (end_line - initial_line + 1)*( end_column - initial_column + 1) ) / (256*256);
+  
+  if( defaultSamp <= 0 )
+    defaultSamp = 1;
+
+  f_Samp = fSamp == 0 ? defaultSamp : fSamp;
+
+//initialization of cluster vector
+  for( int i = 0; i < 256; ++i )
+  {
+    clusters.push_back(0);
+  }
+  
+  classifyPixels(initial_line, end_line, columnBegin, end_column);
+
+
+  return true;
+}
+
+void TePDIKMeansClas::GenerateClassificationParameters()
+{  
+// Creates first Cluster
+  clusters[0] =  new TePDICluster( n_Bands );
+
+  tuple.clear();
+
+  TePDIPIManager progress("Generating Classification Parameters", end_line,
+    progress_enabled_ );
+
+  for( int lin = initial_line; lin <= end_line; lin += f_Samp )
+  {
+    for( int col = initial_column; col <= end_column; col += f_Samp )
+    {
+      for( int band = 0; band < n_Bands; ++band )
+      {
+        double value;
+        input_raster->getElement(col,lin, value, bands[band]);
+        tuple.push_back(value);
+      }
+
+      clusters[0]->add(tuple);
+
+      tuple.clear();
+    }
+    progress.Increment();
+  }
+
+  progress.Toggle(false);
+
+  clusters[0]->updateStatistics();
+
+// Generates other clusters 
+  class_count = 1;
+  while( class_count < n_Class )
+  {
+    if( !split() )
+      break;
+  }
+
+  kmeans();
+
+  return;
+}
+
+  
+bool TePDIKMeansClas::split()
+{
+//Selects class with biggest variance
+  TePDICluster* splitCluster = clusters[0];
+  for( int indclass = 1; indclass < class_count; ++indclass )
+  {
+    if( splitCluster->maxVar() < clusters[indclass]->maxVar() )
+    {
+      splitCluster = clusters[indclass];
+    }
+  }
+
+  if( splitCluster->splitRight().GetNban() <= 0 )
+    return false;
+
+// Splits Cluster
+  clusters[class_count++] = new TePDICluster( splitCluster->splitRight() );
+  *splitCluster = splitCluster->splitLeft();
+
+// Classify Samples
+  classifySamples();
+
+  return true;
+}
+  
+void TePDIKMeansClas::kmeans()
+{
+  if( class_count <= 1 )
+    return;
+
+  TePDIPIManager progress("Classifying Samples", n_Iter, progress_enabled_ );
+
+  for( int iter = 0; iter < n_Iter; ++iter )
+  {
+    classifySamples();
+    progress.Increment();
+  }
+  
+  progress.Toggle(false);
+
+  return;
+}
+
+void TePDIKMeansClas::classifySamples()
+{
+  int indclass;
+
+// Reset Counts
+  for( indclass = 0; indclass < class_count; ++indclass )
+  {
+    clusters[indclass]->resetCount();
+  }
+
+  tuple.clear();
+
+
+// Classification of samples
+  for( int lin = initial_line; lin <= end_line; lin += f_Samp )
+  {
+    for( int col = initial_column; col <= end_column; col += f_Samp )
+    {
+      for( int band = 0; band < n_Bands; ++band )
+      {
+        double value;
+        input_raster->getElement(col, lin, value, bands[band]);
+        tuple.push_back(value);
+      }
+
+      TePDICluster* bestCluster = clusters[0];
+      
+      double distance = bestCluster->dist( tuple );
+
+      for( int indclass = 1; indclass < class_count; ++indclass )
+      {
+        if( clusters[indclass]->dist( tuple ) < distance )
+        {
+          bestCluster = clusters[indclass];
+          distance = clusters[indclass]->dist( tuple );
+        }
+      }
+
+      bestCluster->add( tuple );
+
+      tuple.clear();
+    }
+  }
+
+// Update Statistics
+  for( indclass = 0; indclass < class_count; ++indclass )
+  {
+    clusters[indclass]->updateStatistics();
+  }
+
+  return;
+}
+
+
+int TePDIKMeansClas::classifyPixels( int l1, int l2, int c1, int c2)
+{
+  vector<double> pixel;
+
+  GenerateClassificationParameters();
+
+  TePDIPIManager progress("Classifying Pixels", l2, progress_enabled_ );
+
+  for( int lin = l1; lin <= l2; lin++ )
+  {
+    for( int col = c1; col <= c2; col++ )
+    {
+	  bool dummy = true;
+
+      for( int ban = 0; ban < n_Bands; ban++ )
+      {
+        double value;
+        
+		if(input_raster->getElement(col, lin, value, bands[ban]))
+		{
+			dummy = false;
+		}
+
+		pixel.push_back(value);
+      }
+
+	  if(!dummy)
+	  {
+		  double dist = 0;
+		  double distance = clusters[0]->dist( pixel );
+		  int besttheme = 0;
+		  for(int indclass = 0; indclass < class_count; ++indclass )
+		  {
+			if( ( dist = clusters[indclass]->dist( pixel ) ) < distance )
+			{
+			  distance  = dist;
+			  besttheme = indclass;
+			}
+		  }
+
+		  pixel.clear();
+
+		  output_raster->setElement(col, lin, besttheme);
+	  }
+    }
+
+    progress.Increment();
+  }
+
+  progress.Toggle(false);
+
+  pixel.clear();
+
+  return class_count;
+}
diff --git a/src/terralib/image_processing/TePDIKMeansClas.hpp b/src/terralib/image_processing/TePDIKMeansClas.hpp
index 08fe35c..29353ce 100644
--- a/src/terralib/image_processing/TePDIKMeansClas.hpp
+++ b/src/terralib/image_processing/TePDIKMeansClas.hpp
@@ -1,208 +1,208 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIKMEANSCLAS_HPP
-  #define TEPDIKMEANSCLAS_HPP
-
-#include "TePDIAlgorithm.hpp"
-
-#include "TePDIRegion.hpp"
-#include "TePDICluster.hpp"
-
-#include <string>
-#include <set>
-
-  /**
-   * @brief Kmeans classification algorithm.
-   * @author Eric Silva Abreu <eric at dpi.inpe.br>
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIClassificationAlgorithms
-   *
-   * @note The required parameters are:
-   * @param input_raster (TePDITypes::TePDIRasterPtrType) - Input raster.
-   * @param output_raster (TePDITypes::TePDIRasterPtrType) - Output raster.
-   * @param bands (vector<int>) - input bands.
-   * @param classes_number (int) - number of classes.
-   *
-   * @note The optional parameters are:
-   *
-   * @param sample (int) - ???? (default 1).
-   * @param iterations_number (int) - number of iterations (default 10).
-   * @param line_begin (int) - initial line to do classfication (default 0).
-   * @param line_end (int) - end line to do classfication(default: the last raster line).
-   * @param column_begin (int) - initial column to do classfication (default 0).
-   * @param column_end (int) - end column to do classfication (default : the last raster column).   
-   */
-
-class PDI_DLL TePDIKMeansClas : public TePDIAlgorithm
-{
-  private :
-
-  /**
-    * @brief Generate classificatin paramters.
-    */   
-  void GenerateClassificationParameters();
-  
-  /**
-    * @brief Start the clusters classifying process.
-    */    
-  void classifySamples();
-  
-  /**
-    * @brief Start the clusters splitting process.
-    */    
-  bool split();
-  
-  /**
-    * @brief Start the kmeans algorithm.
-    */  
-  void kmeans();
-
-  /**
-    * @brief Classify pixels.
-    *
-    * @param l1 Starting line.
-    * @param l2 Ending line.
-    * @param c1 Starting column.
-    * @param c2 Ending column.
-    * @return The classes count.
-    */
-  int classifyPixels( int l1, int l2, int c1, int c2);
-
-  /**
-    * Number of classes
-    */
-    int n_Class;
-
-  /**
-    * class count
-    */
-    int class_count;
-
-  /**
-    * Number of bands
-    */
-    int n_Bands;
-
-  /**
-    * Number of iterations
-    */
-    int n_Iter;
-
-  /**
-    * Sample
-    */
-    int f_Samp;
-
-  /**
-    * initial line to do classfication
-    */
-    int initial_line;
-
-  /**
-    * end line to do classfication
-    */
-    int end_line;
-
-  /**
-    * initial column to do classfication
-    */
-    int initial_column;
-
-  /**
-    * end column to do classfication
-    */
-    int end_column;
-
-  /**
-    * pixel value of each input raster
-    */
-  vector<int> bands;
-
-  /**
-    * Set of clusters
-    */
-    vector<TePDICluster*> clusters;
-
-  /**
-    * pixel value of each input raster
-    */
-  vector<double> tuple;
-
-  /**
-    * input rasters
-    */
-  TePDITypes::TePDIRasterPtrType input_raster;
-
-  /**
-    * output raster
-    */
-  TePDITypes::TePDIRasterPtrType output_raster;
-
-  public :
-
-    typedef TeSharedPtr< TePDIKMeansClas > pointer;
-    typedef const TeSharedPtr< TePDIKMeansClas > const_pointer;
-
-    /**
-    * Default constructor
-    *
-    * @param factoryName Factory name.
-    */
-    TePDIKMeansClas();
-
-    /**
-    * Default Destructor
-    */
-    ~TePDIKMeansClas();
-
-    /**
-    * Checks if the supplied parameters fits the requirements of each
-    * PDI strategy.
-    *
-    * Error log messages must be generated. No exceptions generated.
-    *
-    * @param parameters The parameters to be checked.
-    * @return true if the parameters are OK. false if not.
-    */
-    bool CheckParameters(const TePDIParameters& parameters) const;
-
-  protected :
-
-  /**
-  * @brief Reset the internal state to the initial state.
-  *
-  * @param params The new parameters referent at initial state.
-  */
-  void ResetState( const TePDIParameters& );
-
-  /**
-  * @brief Runs the current algorithm implementation.
-  *
-  * @return true if OK. false on error.
-  */
-  bool RunImplementation();
-};
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIKMEANSCLAS_HPP
+  #define TEPDIKMEANSCLAS_HPP
+
+#include "TePDIAlgorithm.hpp"
+
+#include "TePDIRegion.hpp"
+#include "TePDICluster.hpp"
+
+#include <string>
+#include <set>
+
+  /**
+   * @brief Kmeans classification algorithm.
+   * @author Eric Silva Abreu <eric at dpi.inpe.br>
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIClassificationAlgorithms
+   *
+   * @note The required parameters are:
+   * @param input_raster (TePDITypes::TePDIRasterPtrType) - Input raster.
+   * @param output_raster (TePDITypes::TePDIRasterPtrType) - Output raster.
+   * @param bands (vector<int>) - input bands.
+   * @param classes_number (int) - number of classes.
+   *
+   * @note The optional parameters are:
+   *
+   * @param sample (int) - ???? (default 1).
+   * @param iterations_number (int) - number of iterations (default 10).
+   * @param line_begin (int) - initial line to do classfication (default 0).
+   * @param line_end (int) - end line to do classfication(default: the last raster line).
+   * @param column_begin (int) - initial column to do classfication (default 0).
+   * @param column_end (int) - end column to do classfication (default : the last raster column).   
+   */
+
+class PDI_DLL TePDIKMeansClas : public TePDIAlgorithm
+{
+  private :
+
+  /**
+    * @brief Generate classificatin paramters.
+    */   
+  void GenerateClassificationParameters();
+  
+  /**
+    * @brief Start the clusters classifying process.
+    */    
+  void classifySamples();
+  
+  /**
+    * @brief Start the clusters splitting process.
+    */    
+  bool split();
+  
+  /**
+    * @brief Start the kmeans algorithm.
+    */  
+  void kmeans();
+
+  /**
+    * @brief Classify pixels.
+    *
+    * @param l1 Starting line.
+    * @param l2 Ending line.
+    * @param c1 Starting column.
+    * @param c2 Ending column.
+    * @return The classes count.
+    */
+  int classifyPixels( int l1, int l2, int c1, int c2);
+
+  /**
+    * Number of classes
+    */
+    int n_Class;
+
+  /**
+    * class count
+    */
+    int class_count;
+
+  /**
+    * Number of bands
+    */
+    int n_Bands;
+
+  /**
+    * Number of iterations
+    */
+    int n_Iter;
+
+  /**
+    * Sample
+    */
+    int f_Samp;
+
+  /**
+    * initial line to do classfication
+    */
+    int initial_line;
+
+  /**
+    * end line to do classfication
+    */
+    int end_line;
+
+  /**
+    * initial column to do classfication
+    */
+    int initial_column;
+
+  /**
+    * end column to do classfication
+    */
+    int end_column;
+
+  /**
+    * pixel value of each input raster
+    */
+  vector<int> bands;
+
+  /**
+    * Set of clusters
+    */
+    vector<TePDICluster*> clusters;
+
+  /**
+    * pixel value of each input raster
+    */
+  vector<double> tuple;
+
+  /**
+    * input rasters
+    */
+  TePDITypes::TePDIRasterPtrType input_raster;
+
+  /**
+    * output raster
+    */
+  TePDITypes::TePDIRasterPtrType output_raster;
+
+  public :
+
+    typedef TeSharedPtr< TePDIKMeansClas > pointer;
+    typedef const TeSharedPtr< TePDIKMeansClas > const_pointer;
+
+    /**
+    * Default constructor
+    *
+    * @param factoryName Factory name.
+    */
+    TePDIKMeansClas();
+
+    /**
+    * Default Destructor
+    */
+    ~TePDIKMeansClas();
+
+    /**
+    * Checks if the supplied parameters fits the requirements of each
+    * PDI strategy.
+    *
+    * Error log messages must be generated. No exceptions generated.
+    *
+    * @param parameters The parameters to be checked.
+    * @return true if the parameters are OK. false if not.
+    */
+    bool CheckParameters(const TePDIParameters& parameters) const;
+
+  protected :
+
+  /**
+  * @brief Reset the internal state to the initial state.
+  *
+  * @param params The new parameters referent at initial state.
+  */
+  void ResetState( const TePDIParameters& );
+
+  /**
+  * @brief Runs the current algorithm implementation.
+  *
+  * @return true if OK. false on error.
+  */
+  bool RunImplementation();
+};
+
+#endif
diff --git a/src/terralib/image_processing/TePDIKMeansClasFactory.cpp b/src/terralib/image_processing/TePDIKMeansClasFactory.cpp
index b6efc9d..34a4771 100644
--- a/src/terralib/image_processing/TePDIKMeansClasFactory.cpp
+++ b/src/terralib/image_processing/TePDIKMeansClasFactory.cpp
@@ -1,25 +1,25 @@
-
-#include "TePDIKMeansClasFactory.hpp"
-#include "TePDIKMeansClas.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIKMeansClasFactory::TePDIKMeansClasFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIKMeansClas" ) )
-{
-}
-
-TePDIKMeansClasFactory::~TePDIKMeansClasFactory()
-{
-}
-
-
-TePDIAlgorithm* TePDIKMeansClasFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIKMeansClas();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+
+#include "TePDIKMeansClasFactory.hpp"
+#include "TePDIKMeansClas.hpp"
+#include <TeAgnostic.h>
+
+
+TePDIKMeansClasFactory::TePDIKMeansClasFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIKMeansClas" ) )
+{
+}
+
+TePDIKMeansClasFactory::~TePDIKMeansClasFactory()
+{
+}
+
+
+TePDIAlgorithm* TePDIKMeansClasFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIKMeansClas();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIKMeansClasFactory.hpp b/src/terralib/image_processing/TePDIKMeansClasFactory.hpp
index fc56587..2c4df7b 100644
--- a/src/terralib/image_processing/TePDIKMeansClasFactory.hpp
+++ b/src/terralib/image_processing/TePDIKMeansClasFactory.hpp
@@ -1,68 +1,68 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIKMEANSCLASFACTORY_HPP
-  #define TEPDIKMEANSCLASFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for kmeans classification algorithm factory.
-   * @author Eric Silva Abreu <eric at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIKMeansClasFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIKMeansClasFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIKMeansClasFactory();
-      
-    protected :  
-      
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIKMeansClasFactory TePDIKMeansClasFactory_instance;
-  };  
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIKMEANSCLASFACTORY_HPP
+  #define TEPDIKMEANSCLASFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for kmeans classification algorithm factory.
+   * @author Eric Silva Abreu <eric at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIKMeansClasFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIKMeansClasFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIKMeansClasFactory();
+      
+    protected :  
+      
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace {
+    static TePDIKMeansClasFactory TePDIKMeansClasFactory_instance;
+  };  
+  
+#endif
diff --git a/src/terralib/image_processing/TePDILevelRemap.cpp b/src/terralib/image_processing/TePDILevelRemap.cpp
old mode 100755
new mode 100644
index cc96c39..1576a25
--- a/src/terralib/image_processing/TePDILevelRemap.cpp
+++ b/src/terralib/image_processing/TePDILevelRemap.cpp
@@ -1,520 +1,520 @@
-#include "TePDILevelRemap.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-#include "TePDIStatistic.hpp"
-#include "TePDIMatrix.hpp"
-
-#include <TeUtils.h>
-#include <TeDefines.h>
-
-#include <math.h>
-#include <float.h>
-
-TePDILevelRemap::TePDILevelRemap()
-{
-}
-
-
-TePDILevelRemap::~TePDILevelRemap()
-{
-}
-
-
-
-void TePDILevelRemap::ResetState( const TePDIParameters& params )
-{
-  TePDIParameters dummy_params = params;
-
-  histo_cache_.clear();
-}
-
-
-bool TePDILevelRemap::RemapLevels(
-  TePDITypes::TePDIRasterPtrType& inRaster,
-  remap_func_3_ptr_type remapp_func,
-  int in_channel,
-  int out_channel,
-  double gain,
-  double offset,
-  bool normalize_output,
-  TePDITypes::TePDIRasterPtrType& outRaster )
-{
-  TEAGN_TRUE_OR_THROW( inRaster.isActive(),
-    "inRaster inactive" );
-  TEAGN_TRUE_OR_THROW( outRaster.isActive(),
-    "outRaster inactive" );
-  TEAGN_TRUE_OR_THROW( 
-    ( inRaster->params().status_ != TeRasterParams::TeNotReady ),
-    "inRaster not ready" );
-  TEAGN_TRUE_OR_THROW( 
-    ( outRaster->params().status_ != TeRasterParams::TeNotReady ),
-    "outRaster not ready" );
-  TEAGN_CHECK_EQUAL( inRaster->params().nlines_,
-    outRaster->params().nlines_,
-    "Lines number mismatch between input and output image" );
-  TEAGN_CHECK_EQUAL( inRaster->params().ncols_,
-    outRaster->params().ncols_,
-    "Columns number mismatch between input and output image" );
-  TEAGN_TRUE_OR_THROW( in_channel < inRaster->nBands(), "Invalid input band" );
-  TEAGN_TRUE_OR_THROW( out_channel < outRaster->nBands(), "Invalid output band" );
-  
-  if( normalize_output ) {
-    TEAGN_TRUE_OR_THROW( 
-      ( outRaster->params().dataType_[ out_channel ] != TeDOUBLE ),
-      "Cannot apply normalization for TeDOUBLE pixel type output bands" );
-  }
-  
-  TeRaster* inRasterNPtr = inRaster.nakedPointer();
-  TeRaster* outRasterNPtr = outRaster.nakedPointer();
-  const int in_raster_lines = inRaster->params().nlines_;
-  const int in_raster_columns = inRaster->params().ncols_;  
-  
-  /* Guessing channel bounds */
-  
-  double in_channel_min_level = 0;
-  double in_channel_max_level = 0;
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
-    inRaster, in_channel, in_channel_min_level,
-    in_channel_max_level ), 
-    "Unable to get raster input channel level bounds" );  
-
-  double out_channel_min_level = 0;
-  double out_channel_max_level = 0;
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
-    outRaster, out_channel, out_channel_min_level,
-    out_channel_max_level ), 
-    "Unable to get raster output channel level bounds" );
-    
-  /* Guessing dummy use */
-  
-  bool inRaster_uses_dummy = inRaster->params().useDummy_;
-  double inRaster_dummy = 0;
-  if( inRaster_uses_dummy ) {
-    inRaster_dummy = inRaster->params().dummy_[ in_channel ];
-  }
-  
-  bool outRaster_uses_dummy = outRaster->params().useDummy_;
-  double outRaster_dummy = 0;
-  if( outRaster_uses_dummy ) {
-    outRaster_dummy = outRaster->params().dummy_[ out_channel ];
-  }
-  
-  /* Level remapping */
-  
-  if( normalize_output ) {
-    /* Guessing normalization factors */
-  
-    double norm_min_level = DBL_MAX;
-    double norm_max_level = -1.0 * norm_min_level;
-    double norm_factor = 0;
-    double norm_off = 0;
-    
-    double current_level = 0;
-    
-    TePDIMatrix< double > mapped_matrix;
-    TEAGN_TRUE_OR_THROW( mapped_matrix.Reset( in_raster_lines, 
-      in_raster_columns, TePDIMatrix< double >::AutoMemPol ),
-      "Mapped levels matrix reset error" );
-    
-    StartProgInt( "Guessing normalization factors...", in_raster_lines );
-    
-    int line = 0;
-    int column = 0;
-      
-    for( line = 0 ; line < in_raster_lines ; ++line ) {
-      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
-    
-      for( column = 0 ; column < in_raster_columns ; ++column ) {
-        if( ! inRasterNPtr->getElement( column, line, current_level, 
-          in_channel ) ) {
-          
-          TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
-          
-          current_level = inRaster_dummy;
-        }
-        
-        current_level = remapp_func( current_level, gain, offset ); 
-          
-        mapped_matrix( line, column ) = current_level;
-          
-        if( current_level < norm_min_level ) {
-          norm_min_level = current_level;
-        } 
-        if( current_level > norm_max_level ) {
-          norm_max_level = current_level;
-        }                  
-      }
-    }
-       
-    StopProgInt();
-    
-    norm_factor = ( out_channel_max_level - out_channel_min_level ) /
-      ( norm_max_level - norm_min_level );
-    norm_off = out_channel_min_level - norm_min_level;
-    
-    /* Output Level remapping */
-    
-    double output_level = 0;
-    double matrix_level = 0;
-    
-    StartProgInt( "Remapping Levels...", in_raster_lines );
-  
-    for( line = 0 ; line < in_raster_lines ; ++line ) {
-      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
-    
-      for( column = 0 ; column < in_raster_columns ; ++column ) {
-        matrix_level = mapped_matrix( line, column );
-        output_level = ( matrix_level + norm_off ) * norm_factor;
-        
-        TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
-          output_level, out_channel ),
-          "Level remmaping error at " + Te2String( line ) +
-          "," + Te2String( column ) );            
-      }
-    }
-    
-    StopProgInt();
-  } else {
-    /* Level remapping */
-  
-    double current_level;
-    double output_level;
-    
-    StartProgInt( "Remapping Levels...", in_raster_lines );
-  
-    int line = 0;
-    int column = 0;
-    for( line = 0 ; line < in_raster_lines ; ++line ) {
-      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
-    
-      for( column = 0 ; column < in_raster_columns ; ++column ) {
-        if( inRasterNPtr->getElement( column, line, current_level,
-            in_channel ) ) {
-  
-          /* Finding mapped level by using the level remapping function */
-  
-          output_level = remapp_func( current_level, gain, offset );
-  
-          /* Level range filtering */
-          
-          if( output_level < out_channel_min_level ) {
-            output_level = out_channel_min_level;
-          } else if( output_level > out_channel_max_level ) {
-            output_level = out_channel_max_level;
-          }
-  
-          TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
-            output_level, out_channel ),
-            "Level remmaping error at " + Te2String( line ) +
-            "," + Te2String( column ) );
-        } else {
-          TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
-            
-          TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
-            outRaster_dummy, out_channel ),
-            "Level remmaping error at " + Te2String( line ) +
-            "," + Te2String( column ) );          
-        }
-      }
-    }
-    
-    StopProgInt();
-  }
-  
-  return true;
-}
-
-
-bool TePDILevelRemap::RemapLevels(
-  TePDITypes::TePDIRasterPtrType& inRaster1,
-  TePDITypes::TePDIRasterPtrType& inRaster2,
-  remap_func_4_ptr_type remapp_func,
-  int in_channel1,
-  int in_channel2,
-  int out_channel,
-  double gain,
-  double offset,
-  bool normalize_output,
-  TePDITypes::TePDIRasterPtrType& outRaster )
-{
-  TEAGN_TRUE_OR_THROW( inRaster1.isActive(),
-    "inRaster1 inactive" );
-  TEAGN_TRUE_OR_THROW( inRaster2.isActive(),
-    "inRaster2 inactive" );
-  TEAGN_TRUE_OR_THROW( outRaster.isActive(),
-    "outRaster inactive" );
-  TEAGN_TRUE_OR_THROW( 
-    ( inRaster1->params().status_ != TeRasterParams::TeNotReady ),
-    "inRaster1 not ready" );
-  TEAGN_TRUE_OR_THROW( 
-    ( inRaster2->params().status_ != TeRasterParams::TeNotReady ),
-    "inRaster2 not ready" );
-  TEAGN_TRUE_OR_THROW( 
-    ( outRaster->params().status_ != TeRasterParams::TeNotReady ),
-    "outRaster not ready" );
-  TEAGN_CHECK_EQUAL( inRaster1->params().nlines_,
-    outRaster->params().nlines_,
-    "Lines number mismatch between input1 and output image" );
-  TEAGN_CHECK_EQUAL( inRaster1->params().ncols_,
-    outRaster->params().ncols_,
-    "Columns number mismatch between input1 and output image" );
-  TEAGN_CHECK_EQUAL( inRaster2->params().nlines_,
-    outRaster->params().nlines_,
-    "Lines number mismatch between input2 and output image" );
-  TEAGN_CHECK_EQUAL( inRaster2->params().ncols_,
-    outRaster->params().ncols_,
-    "Columns number mismatch between input2 and output image" );
-  TEAGN_TRUE_OR_THROW( in_channel1 < inRaster1->nBands(), "Invalid input1 band" );
-  TEAGN_TRUE_OR_THROW( in_channel2 < inRaster2->nBands(), "Invalid input2 band" );
-  TEAGN_TRUE_OR_THROW( out_channel < outRaster->nBands(), "Invalid output band" );
-  
-  if( normalize_output ) {
-    TEAGN_TRUE_OR_THROW( 
-      ( outRaster->params().dataType_[ out_channel ] != TeDOUBLE ),
-      "Cannot apply normalization for TeDOUBLE pixel type output bands" );
-  }
-  
-  TeRaster* inRaster1NPtr = inRaster1.nakedPointer();
-  TeRaster* inRaster2NPtr = inRaster2.nakedPointer();
-  TeRaster* outRasterNPtr = outRaster.nakedPointer();
-  const int in_raster_lines = inRaster1->params().nlines_;
-  const int in_raster_columns = inRaster1->params().ncols_;    
-  
-  /* Guessing dummy use */
-  
-  bool inRaster1_uses_dummy = inRaster1->params().useDummy_;
-  bool inRaster2_uses_dummy = inRaster2->params().useDummy_;
-  bool outRaster_uses_dummy = outRaster->params().useDummy_;
-  double outRaster_dummy = 0;
-  if( outRaster_uses_dummy ) {
-    outRaster_dummy = outRaster->params().dummy_[ out_channel ];
-  }   
-  
-  /* Guessing channel bounds */
-  
-  double in_channel1_min_level = 0;
-  double in_channel1_max_level = 0;
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
-    inRaster1, in_channel1, in_channel1_min_level,
-    in_channel1_max_level ), 
-    "Unable to get raster1 input channel level bounds" );  
-    
-  double in_channel2_min_level = 0;
-  double in_channel2_max_level = 0;
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
-    inRaster2, in_channel2, in_channel2_min_level,
-    in_channel2_max_level ), 
-    "Unable to get raster2 input channel level bounds" );  
-
-  double out_channel_min_level = 0;
-  double out_channel_max_level = 0;
-
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
-    outRaster, out_channel, out_channel_min_level,
-    out_channel_max_level ), 
-    "Unable to get raster output channel level bounds" );
-    
-  /* Level remapping */
-    
-  if( normalize_output ) {
-    /* Guessing normalization factors */
-    
-    double norm_factor = 0;
-    double norm_off = 0;
-    
-    TePDIMatrix< double > mapped_matrix;
-    TEAGN_TRUE_OR_THROW( mapped_matrix.Reset( in_raster_lines, 
-      in_raster_columns, TePDIMatrix< double >::AutoMemPol ),
-      "Mapped levels matrix reset error" );    
-  
-    StartProgInt( "Guessing normalization factors...", in_raster_lines );
-  
-    double norm_min_level = DBL_MAX;
-    double norm_max_level = -1.0 * norm_min_level;
-    int line = 0;
-    int column = 0;
-    double value1 = 0;
-    double value2= 0;
-    bool got_element1 = false;
-    bool got_element2 = false;
-    double mapped_level = 0;
-    
-    for( line = 0 ; line < in_raster_lines ; ++line ) {
-      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
-  
-      for( column = 0 ; column < in_raster_columns ; ++column ) {
-        got_element1 = inRaster1NPtr->getElement( column, line, value1, 
-          in_channel1 );
-        got_element2 = inRaster2NPtr->getElement( column, line, value2, 
-          in_channel2 );
-          
-        if( got_element1 && got_element2 ) {
-          mapped_level = remapp_func( value1, value2 , gain, offset );    
-        
-          mapped_matrix( line, column ) = mapped_level;
-            
-          if( mapped_level < norm_min_level ) {
-            norm_min_level = mapped_level;
-          } 
-          if( mapped_level > norm_max_level ) {
-            norm_max_level = mapped_level;
-          }
-        } else {
-          if( got_element1 ) {
-            TEAGN_TRUE_OR_RETURN( inRaster2_uses_dummy, 
-              "Raster2 read error" );
-          } else {
-            TEAGN_TRUE_OR_RETURN( inRaster1_uses_dummy, 
-              "Raster1 read error" );
-          }        
-        
-          mapped_matrix( line, column ) = outRaster_dummy;
-        }
-      }
-    }
-     
-    StopProgInt();
-    
-    norm_factor = ( out_channel_max_level - out_channel_min_level ) /
-      ( norm_max_level - norm_min_level );
-    norm_off = out_channel_min_level - norm_min_level;
-    
-    /* Remapping levels */
-    
-    double output_level = 0;
-    
-    StartProgInt( "Remapping Levels...", in_raster_lines );
-    
-    for( line = 0 ; line < in_raster_lines ; ++line ) {
-      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
-    
-      for( column = 0 ; column < in_raster_columns ; ++column ) {
-        output_level = mapped_matrix( line, column );
-              
-        output_level = ( output_level + norm_off ) * norm_factor;
-        
-        TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
-          output_level, out_channel ),
-          "Level remmaping error at " + Te2String( line ) +
-          "," + Te2String( column ) );        
-      }  
-    }
-  } else {
-    int line = 0;
-    int column = 0;  
-    double current_level1 = 0;
-    double current_level2 = 0;
-    double output_level = 0;
-    bool got_element1 = false;
-    bool got_element2 = false;
-    
-    StartProgInt( "Remapping Levels...", in_raster_lines );
-  
-    for( line = 0 ; line < in_raster_lines ; ++line ) {
-      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
-    
-      for( column = 0 ; column < in_raster_columns ; ++column ) {
-        got_element1 = inRaster1NPtr->getElement( column, line, 
-          current_level1, in_channel1 );
-        got_element2 = inRaster2NPtr->getElement( column, line, 
-          current_level2, in_channel2 );
-              
-        if( got_element1 && got_element2 ) {
-  
-          /* Finding mapped level by using the level remapping function */
-  
-          output_level = remapp_func( current_level1, current_level2 , gain, 
-            offset );
-  
-          /* Level range filtering */
-          
-          if( output_level < out_channel_min_level ) {
-            output_level = out_channel_min_level;
-          } else if( output_level > out_channel_max_level ) {
-            output_level = out_channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
-            output_level, out_channel ),
-            "Level remmaping error at " + Te2String( line ) +
-            "," + Te2String( column ) );
-        } else {
-          if( got_element1 ) {
-            TEAGN_TRUE_OR_RETURN( inRaster2_uses_dummy, 
-              "Raster2 read error" );
-          } else {
-            TEAGN_TRUE_OR_RETURN( inRaster1_uses_dummy, 
-              "Raster1 read error" );
-          }
-            
-          TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
-            outRaster_dummy, out_channel ),
-            "Level remmaping error at " + Te2String( line ) +
-            "," + Te2String( column ) );
-        }
-      }  
-    }
-  }
-  
-  return true;
-}
-
-
-void TePDILevelRemap::BuildHistograms(
-  TePDITypes::TePDIRasterPtrType& inRaster,
-  unsigned int histo_levels,
-  std::vector< int >& channels,
-  bool force )
-{
-  TEAGN_TRUE_OR_THROW( inRaster.isActive(),
-    "inRaster inactive" );
-  TEAGN_TRUE_OR_THROW( inRaster->params().status_ != TeRasterParams::TeNotReady,
-    "inRaster not ready" );
-
-  std::pair< TeRaster*, unsigned int  > mapkey;
-  mapkey.first = inRaster.nakedPointer();
-
-  for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
-       ++channels_index ) {
-
-    TEAGN_TRUE_OR_THROW( channels[ channels_index ] < inRaster->nBands(),
-      "Trying to creat histogram from an invalid band" );
-
-    mapkey.second = channels_index;
-
-    if( ( histo_cache_.find( mapkey ) ==  histo_cache_.end() ) || force ) {
-
-      TePDIHistogram::pointer temp_hist( new TePDIHistogram );
-
-      TEAGN_TRUE_OR_THROW( temp_hist->reset( inRaster,
-        channels[ channels_index ], histo_levels, false,
-        TeBoxPixelIn ),
-        "Histogram Generation Error" );
-
-      histo_cache_[ mapkey ] = temp_hist;
-    }
-  }
-}
-
-
-TePDIHistogram::pointer TePDILevelRemap::GetHistRef(
-  TePDITypes::TePDIRasterPtrType& inRaster,
-  unsigned int band )
-{
-  std::pair< TeRaster*, unsigned int  > mapkey;
-  mapkey.first = inRaster.nakedPointer();
-  mapkey.second = band;
-
-  TEAGN_TRUE_OR_THROW(
-    ( histo_cache_.find( mapkey ) != histo_cache_.end() ),
-    "Histogram not stored inside cache" );
-
-  return histo_cache_[ mapkey ];
-}
-
-
+#include "TePDILevelRemap.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+#include "TePDIStatistic.hpp"
+#include "TePDIMatrix.hpp"
+
+#include <TeUtils.h>
+#include <TeDefines.h>
+
+#include <math.h>
+#include <float.h>
+
+TePDILevelRemap::TePDILevelRemap()
+{
+}
+
+
+TePDILevelRemap::~TePDILevelRemap()
+{
+}
+
+
+
+void TePDILevelRemap::ResetState( const TePDIParameters& params )
+{
+  TePDIParameters dummy_params = params;
+
+  histo_cache_.clear();
+}
+
+
+bool TePDILevelRemap::RemapLevels(
+  TePDITypes::TePDIRasterPtrType& inRaster,
+  remap_func_3_ptr_type remapp_func,
+  int in_channel,
+  int out_channel,
+  double gain,
+  double offset,
+  bool normalize_output,
+  TePDITypes::TePDIRasterPtrType& outRaster )
+{
+  TEAGN_TRUE_OR_THROW( inRaster.isActive(),
+    "inRaster inactive" );
+  TEAGN_TRUE_OR_THROW( outRaster.isActive(),
+    "outRaster inactive" );
+  TEAGN_TRUE_OR_THROW( 
+    ( inRaster->params().status_ != TeRasterParams::TeNotReady ),
+    "inRaster not ready" );
+  TEAGN_TRUE_OR_THROW( 
+    ( outRaster->params().status_ != TeRasterParams::TeNotReady ),
+    "outRaster not ready" );
+  TEAGN_CHECK_EQUAL( inRaster->params().nlines_,
+    outRaster->params().nlines_,
+    "Lines number mismatch between input and output image" );
+  TEAGN_CHECK_EQUAL( inRaster->params().ncols_,
+    outRaster->params().ncols_,
+    "Columns number mismatch between input and output image" );
+  TEAGN_TRUE_OR_THROW( in_channel < inRaster->nBands(), "Invalid input band" );
+  TEAGN_TRUE_OR_THROW( out_channel < outRaster->nBands(), "Invalid output band" );
+  
+  if( normalize_output ) {
+    TEAGN_TRUE_OR_THROW( 
+      ( outRaster->params().dataType_[ out_channel ] != TeDOUBLE ),
+      "Cannot apply normalization for TeDOUBLE pixel type output bands" );
+  }
+  
+  TeRaster* inRasterNPtr = inRaster.nakedPointer();
+  TeRaster* outRasterNPtr = outRaster.nakedPointer();
+  const int in_raster_lines = inRaster->params().nlines_;
+  const int in_raster_columns = inRaster->params().ncols_;  
+  
+  /* Guessing channel bounds */
+  
+  double in_channel_min_level = 0;
+  double in_channel_max_level = 0;
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
+    inRaster, in_channel, in_channel_min_level,
+    in_channel_max_level ), 
+    "Unable to get raster input channel level bounds" );  
+
+  double out_channel_min_level = 0;
+  double out_channel_max_level = 0;
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
+    outRaster, out_channel, out_channel_min_level,
+    out_channel_max_level ), 
+    "Unable to get raster output channel level bounds" );
+    
+  /* Guessing dummy use */
+  
+  bool inRaster_uses_dummy = inRaster->params().useDummy_;
+  double inRaster_dummy = 0;
+  if( inRaster_uses_dummy ) {
+    inRaster_dummy = inRaster->params().dummy_[ in_channel ];
+  }
+  
+  bool outRaster_uses_dummy = outRaster->params().useDummy_;
+  double outRaster_dummy = 0;
+  if( outRaster_uses_dummy ) {
+    outRaster_dummy = outRaster->params().dummy_[ out_channel ];
+  }
+  
+  /* Level remapping */
+  
+  if( normalize_output ) {
+    /* Guessing normalization factors */
+  
+    double norm_min_level = DBL_MAX;
+    double norm_max_level = -1.0 * norm_min_level;
+    double norm_factor = 0;
+    double norm_off = 0;
+    
+    double current_level = 0;
+    
+    TePDIMatrix< double > mapped_matrix;
+    TEAGN_TRUE_OR_THROW( mapped_matrix.Reset( in_raster_lines, 
+      in_raster_columns, TePDIMatrix< double >::AutoMemPol ),
+      "Mapped levels matrix reset error" );
+    
+    StartProgInt( "Guessing normalization factors...", in_raster_lines );
+    
+    int line = 0;
+    int column = 0;
+      
+    for( line = 0 ; line < in_raster_lines ; ++line ) {
+      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
+    
+      for( column = 0 ; column < in_raster_columns ; ++column ) {
+        if( ! inRasterNPtr->getElement( column, line, current_level, 
+          in_channel ) ) {
+          
+          TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
+          
+          current_level = inRaster_dummy;
+        }
+        
+        current_level = remapp_func( current_level, gain, offset ); 
+          
+        mapped_matrix( line, column ) = current_level;
+          
+        if( current_level < norm_min_level ) {
+          norm_min_level = current_level;
+        } 
+        if( current_level > norm_max_level ) {
+          norm_max_level = current_level;
+        }                  
+      }
+    }
+       
+    StopProgInt();
+    
+    norm_factor = ( out_channel_max_level - out_channel_min_level ) /
+      ( norm_max_level - norm_min_level );
+    norm_off = out_channel_min_level - norm_min_level;
+    
+    /* Output Level remapping */
+    
+    double output_level = 0;
+    double matrix_level = 0;
+    
+    StartProgInt( "Remapping Levels...", in_raster_lines );
+  
+    for( line = 0 ; line < in_raster_lines ; ++line ) {
+      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
+    
+      for( column = 0 ; column < in_raster_columns ; ++column ) {
+        matrix_level = mapped_matrix( line, column );
+        output_level = ( matrix_level + norm_off ) * norm_factor;
+        
+        TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
+          output_level, out_channel ),
+          "Level remmaping error at " + Te2String( line ) +
+          "," + Te2String( column ) );            
+      }
+    }
+    
+    StopProgInt();
+  } else {
+    /* Level remapping */
+  
+    double current_level;
+    double output_level;
+    
+    StartProgInt( "Remapping Levels...", in_raster_lines );
+  
+    int line = 0;
+    int column = 0;
+    for( line = 0 ; line < in_raster_lines ; ++line ) {
+      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
+    
+      for( column = 0 ; column < in_raster_columns ; ++column ) {
+        if( inRasterNPtr->getElement( column, line, current_level,
+            in_channel ) ) {
+  
+          /* Finding mapped level by using the level remapping function */
+  
+          output_level = remapp_func( current_level, gain, offset );
+  
+          /* Level range filtering */
+          
+          if( output_level < out_channel_min_level ) {
+            output_level = out_channel_min_level;
+          } else if( output_level > out_channel_max_level ) {
+            output_level = out_channel_max_level;
+          }
+  
+          TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
+            output_level, out_channel ),
+            "Level remmaping error at " + Te2String( line ) +
+            "," + Te2String( column ) );
+        } else {
+          TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
+            
+          TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
+            outRaster_dummy, out_channel ),
+            "Level remmaping error at " + Te2String( line ) +
+            "," + Te2String( column ) );          
+        }
+      }
+    }
+    
+    StopProgInt();
+  }
+  
+  return true;
+}
+
+
+bool TePDILevelRemap::RemapLevels(
+  TePDITypes::TePDIRasterPtrType& inRaster1,
+  TePDITypes::TePDIRasterPtrType& inRaster2,
+  remap_func_4_ptr_type remapp_func,
+  int in_channel1,
+  int in_channel2,
+  int out_channel,
+  double gain,
+  double offset,
+  bool normalize_output,
+  TePDITypes::TePDIRasterPtrType& outRaster )
+{
+  TEAGN_TRUE_OR_THROW( inRaster1.isActive(),
+    "inRaster1 inactive" );
+  TEAGN_TRUE_OR_THROW( inRaster2.isActive(),
+    "inRaster2 inactive" );
+  TEAGN_TRUE_OR_THROW( outRaster.isActive(),
+    "outRaster inactive" );
+  TEAGN_TRUE_OR_THROW( 
+    ( inRaster1->params().status_ != TeRasterParams::TeNotReady ),
+    "inRaster1 not ready" );
+  TEAGN_TRUE_OR_THROW( 
+    ( inRaster2->params().status_ != TeRasterParams::TeNotReady ),
+    "inRaster2 not ready" );
+  TEAGN_TRUE_OR_THROW( 
+    ( outRaster->params().status_ != TeRasterParams::TeNotReady ),
+    "outRaster not ready" );
+  TEAGN_CHECK_EQUAL( inRaster1->params().nlines_,
+    outRaster->params().nlines_,
+    "Lines number mismatch between input1 and output image" );
+  TEAGN_CHECK_EQUAL( inRaster1->params().ncols_,
+    outRaster->params().ncols_,
+    "Columns number mismatch between input1 and output image" );
+  TEAGN_CHECK_EQUAL( inRaster2->params().nlines_,
+    outRaster->params().nlines_,
+    "Lines number mismatch between input2 and output image" );
+  TEAGN_CHECK_EQUAL( inRaster2->params().ncols_,
+    outRaster->params().ncols_,
+    "Columns number mismatch between input2 and output image" );
+  TEAGN_TRUE_OR_THROW( in_channel1 < inRaster1->nBands(), "Invalid input1 band" );
+  TEAGN_TRUE_OR_THROW( in_channel2 < inRaster2->nBands(), "Invalid input2 band" );
+  TEAGN_TRUE_OR_THROW( out_channel < outRaster->nBands(), "Invalid output band" );
+  
+  if( normalize_output ) {
+    TEAGN_TRUE_OR_THROW( 
+      ( outRaster->params().dataType_[ out_channel ] != TeDOUBLE ),
+      "Cannot apply normalization for TeDOUBLE pixel type output bands" );
+  }
+  
+  TeRaster* inRaster1NPtr = inRaster1.nakedPointer();
+  TeRaster* inRaster2NPtr = inRaster2.nakedPointer();
+  TeRaster* outRasterNPtr = outRaster.nakedPointer();
+  const int in_raster_lines = inRaster1->params().nlines_;
+  const int in_raster_columns = inRaster1->params().ncols_;    
+  
+  /* Guessing dummy use */
+  
+  bool inRaster1_uses_dummy = inRaster1->params().useDummy_;
+  bool inRaster2_uses_dummy = inRaster2->params().useDummy_;
+  bool outRaster_uses_dummy = outRaster->params().useDummy_;
+  double outRaster_dummy = 0;
+  if( outRaster_uses_dummy ) {
+    outRaster_dummy = outRaster->params().dummy_[ out_channel ];
+  }   
+  
+  /* Guessing channel bounds */
+  
+  double in_channel1_min_level = 0;
+  double in_channel1_max_level = 0;
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
+    inRaster1, in_channel1, in_channel1_min_level,
+    in_channel1_max_level ), 
+    "Unable to get raster1 input channel level bounds" );  
+    
+  double in_channel2_min_level = 0;
+  double in_channel2_max_level = 0;
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
+    inRaster2, in_channel2, in_channel2_min_level,
+    in_channel2_max_level ), 
+    "Unable to get raster2 input channel level bounds" );  
+
+  double out_channel_min_level = 0;
+  double out_channel_max_level = 0;
+
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
+    outRaster, out_channel, out_channel_min_level,
+    out_channel_max_level ), 
+    "Unable to get raster output channel level bounds" );
+    
+  /* Level remapping */
+    
+  if( normalize_output ) {
+    /* Guessing normalization factors */
+    
+    double norm_factor = 0;
+    double norm_off = 0;
+    
+    TePDIMatrix< double > mapped_matrix;
+    TEAGN_TRUE_OR_THROW( mapped_matrix.Reset( in_raster_lines, 
+      in_raster_columns, TePDIMatrix< double >::AutoMemPol ),
+      "Mapped levels matrix reset error" );    
+  
+    StartProgInt( "Guessing normalization factors...", in_raster_lines );
+  
+    double norm_min_level = DBL_MAX;
+    double norm_max_level = -1.0 * norm_min_level;
+    int line = 0;
+    int column = 0;
+    double value1 = 0;
+    double value2= 0;
+    bool got_element1 = false;
+    bool got_element2 = false;
+    double mapped_level = 0;
+    
+    for( line = 0 ; line < in_raster_lines ; ++line ) {
+      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
+  
+      for( column = 0 ; column < in_raster_columns ; ++column ) {
+        got_element1 = inRaster1NPtr->getElement( column, line, value1, 
+          in_channel1 );
+        got_element2 = inRaster2NPtr->getElement( column, line, value2, 
+          in_channel2 );
+          
+        if( got_element1 && got_element2 ) {
+          mapped_level = remapp_func( value1, value2 , gain, offset );    
+        
+          mapped_matrix( line, column ) = mapped_level;
+            
+          if( mapped_level < norm_min_level ) {
+            norm_min_level = mapped_level;
+          } 
+          if( mapped_level > norm_max_level ) {
+            norm_max_level = mapped_level;
+          }
+        } else {
+          if( got_element1 ) {
+            TEAGN_TRUE_OR_RETURN( inRaster2_uses_dummy, 
+              "Raster2 read error" );
+          } else {
+            TEAGN_TRUE_OR_RETURN( inRaster1_uses_dummy, 
+              "Raster1 read error" );
+          }        
+        
+          mapped_matrix( line, column ) = outRaster_dummy;
+        }
+      }
+    }
+     
+    StopProgInt();
+    
+    norm_factor = ( out_channel_max_level - out_channel_min_level ) /
+      ( norm_max_level - norm_min_level );
+    norm_off = out_channel_min_level - norm_min_level;
+    
+    /* Remapping levels */
+    
+    double output_level = 0;
+    
+    StartProgInt( "Remapping Levels...", in_raster_lines );
+    
+    for( line = 0 ; line < in_raster_lines ; ++line ) {
+      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
+    
+      for( column = 0 ; column < in_raster_columns ; ++column ) {
+        output_level = mapped_matrix( line, column );
+              
+        output_level = ( output_level + norm_off ) * norm_factor;
+        
+        TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
+          output_level, out_channel ),
+          "Level remmaping error at " + Te2String( line ) +
+          "," + Te2String( column ) );        
+      }  
+    }
+  } else {
+    int line = 0;
+    int column = 0;  
+    double current_level1 = 0;
+    double current_level2 = 0;
+    double output_level = 0;
+    bool got_element1 = false;
+    bool got_element2 = false;
+    
+    StartProgInt( "Remapping Levels...", in_raster_lines );
+  
+    for( line = 0 ; line < in_raster_lines ; ++line ) {
+      TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
+    
+      for( column = 0 ; column < in_raster_columns ; ++column ) {
+        got_element1 = inRaster1NPtr->getElement( column, line, 
+          current_level1, in_channel1 );
+        got_element2 = inRaster2NPtr->getElement( column, line, 
+          current_level2, in_channel2 );
+              
+        if( got_element1 && got_element2 ) {
+  
+          /* Finding mapped level by using the level remapping function */
+  
+          output_level = remapp_func( current_level1, current_level2 , gain, 
+            offset );
+  
+          /* Level range filtering */
+          
+          if( output_level < out_channel_min_level ) {
+            output_level = out_channel_min_level;
+          } else if( output_level > out_channel_max_level ) {
+            output_level = out_channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
+            output_level, out_channel ),
+            "Level remmaping error at " + Te2String( line ) +
+            "," + Te2String( column ) );
+        } else {
+          if( got_element1 ) {
+            TEAGN_TRUE_OR_RETURN( inRaster2_uses_dummy, 
+              "Raster2 read error" );
+          } else {
+            TEAGN_TRUE_OR_RETURN( inRaster1_uses_dummy, 
+              "Raster1 read error" );
+          }
+            
+          TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
+            outRaster_dummy, out_channel ),
+            "Level remmaping error at " + Te2String( line ) +
+            "," + Te2String( column ) );
+        }
+      }  
+    }
+  }
+  
+  return true;
+}
+
+
+void TePDILevelRemap::BuildHistograms(
+  TePDITypes::TePDIRasterPtrType& inRaster,
+  unsigned int histo_levels,
+  std::vector< int >& channels,
+  bool force )
+{
+  TEAGN_TRUE_OR_THROW( inRaster.isActive(),
+    "inRaster inactive" );
+  TEAGN_TRUE_OR_THROW( inRaster->params().status_ != TeRasterParams::TeNotReady,
+    "inRaster not ready" );
+
+  std::pair< TeRaster*, unsigned int  > mapkey;
+  mapkey.first = inRaster.nakedPointer();
+
+  for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
+       ++channels_index ) {
+
+    TEAGN_TRUE_OR_THROW( channels[ channels_index ] < inRaster->nBands(),
+      "Trying to creat histogram from an invalid band" );
+
+    mapkey.second = channels_index;
+
+    if( ( histo_cache_.find( mapkey ) ==  histo_cache_.end() ) || force ) {
+
+      TePDIHistogram::pointer temp_hist( new TePDIHistogram );
+
+      TEAGN_TRUE_OR_THROW( temp_hist->reset( inRaster,
+        channels[ channels_index ], histo_levels, 
+        TeBoxPixelIn ),
+        "Histogram Generation Error" );
+
+      histo_cache_[ mapkey ] = temp_hist;
+    }
+  }
+}
+
+
+TePDIHistogram::pointer TePDILevelRemap::GetHistRef(
+  TePDITypes::TePDIRasterPtrType& inRaster,
+  unsigned int band )
+{
+  std::pair< TeRaster*, unsigned int  > mapkey;
+  mapkey.first = inRaster.nakedPointer();
+  mapkey.second = band;
+
+  TEAGN_TRUE_OR_THROW(
+    ( histo_cache_.find( mapkey ) != histo_cache_.end() ),
+    "Histogram not stored inside cache" );
+
+  return histo_cache_[ mapkey ];
+}
+
+
diff --git a/src/terralib/image_processing/TePDILevelRemap.hpp b/src/terralib/image_processing/TePDILevelRemap.hpp
old mode 100755
new mode 100644
index f96fc03..c155994
--- a/src/terralib/image_processing/TePDILevelRemap.hpp
+++ b/src/terralib/image_processing/TePDILevelRemap.hpp
@@ -1,183 +1,183 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDILEVELREMAP_HPP
-  #define TEPDILEVELREMAP_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIHistogram.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-  #include "TePDITypes.hpp"
-
-  /**
-   * @brief This is the base class for level remapping algorithms.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIGeneralAlgoGroup
-   */
-  class PDI_DLL TePDILevelRemap : public TePDIAlgorithm {
-    public :
-      /** @typedef Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDILevelRemap > pointer;
-      /** @typedef Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDILevelRemap > const_pointer;
-
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDILevelRemap();
-
-    protected :
-      /**
-       * @brief A level remap function pointer ( 3 arguments ).
-       *
-       * @param double Level to be remapped.
-       * @param double Gain.
-       * @param double Offset.
-       * @return The remapped level.
-       */
-      typedef double (*remap_func_3_ptr_type)( double, double, double );
-
-      /**
-       * @brief A level remap function pointer ( 4 arguments ).
-       *
-       * @param double Input Level 1 ( from image 1 ) to be remapped.
-       * @param double Input Level 2 ( from image 2 ) to be remapped.
-       * @param double Gain.
-       * @param double Offset.
-       * @return The remapped level.
-       */
-      typedef double (*remap_func_4_ptr_type)( double, double, double,
-        double );
-
-      /**
-       * @brief A cache of level ordered histograms to avoid rebuilding
-       * histograms all the times.
-       *
-       * @param TeRaster A raster naked pointer reference.
-       * @param unsigned int Raster band.
-       * @param TePDIHistogram::pointer A Histogram shared pointer reference.
-       */
-      std::map< std::pair< TeRaster*, unsigned int  >,
-                TePDIHistogram::pointer > histo_cache_;
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDILevelRemap();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      virtual void ResetState( const TePDIParameters& params );
-
-      /**
-       * @brief Do level remapping from one raster to another.
-       *
-       * @param inRaster The input Raster.
-       * @param outRaster The Output Raster.
-       * @param remapp_func The level remapping function pointer.
-       * @param in_channel in_raster channel to remap.
-       * @param out_channel out_raster channel to write on.
-       * @param gain Level Gain.
-       * @param offset Level Offset.
-       * @param normalize_output Do output normalization following the output
-       * raster channel allowed values range.
-       * @return true if ok, false on errors.
-       */
-      bool RemapLevels(
-        TePDITypes::TePDIRasterPtrType& inRaster,
-        remap_func_3_ptr_type remapp_func,
-        int in_channel,
-        int out_channel,
-        double gain,
-        double offset,
-        bool normalize_output,
-        TePDITypes::TePDIRasterPtrType& outRaster );
-
-      /**
-       * @brief Do level remapping from two input rasters to another.
-       *
-       * @param inRaster1 The input Raster 1.
-       * @param inRaster2 The input Raster 2.
-       * @param outRaster The Output Raster.
-       * @param remapp_func The level remapping function pointer.
-       * @param in_channel1 in_raster1 channel to remap.
-       * @param in_channel2 in_raster2 channel to remap.
-       * @param out_channel out_raster channel to write on.
-       * @param gain Level Gain.
-       * @param offset Level Offset.
-       * @param normalize_output Do output normalization following the output
-       * raster channel allowed values range
-       * @return true if ok, false on errors.
-       */
-      bool RemapLevels(
-        TePDITypes::TePDIRasterPtrType& inRaster1,
-        TePDITypes::TePDIRasterPtrType& inRaster2,
-        remap_func_4_ptr_type remapp_func,
-        int in_channel1,
-        int in_channel2,
-        int out_channel,
-        double gain,
-        double offset,
-        bool normalize_output,
-        TePDITypes::TePDIRasterPtrType& outRaster );
-
-      /**
-       * @brief Build level ordered histograms from the required raster channels.
-       *
-       * @note The result histograms will remain inside the protected
-       * object histo_cache_
-       *
-       * @param inRaster The input Raster.
-       * @param histo_levels Number of histogram interpolated levels.
-       * @param channels Channels to use for histogram generation.
-       * @param force Force histogram regeneratin even if already in cache.
-       */
-      void BuildHistograms(
-        TePDITypes::TePDIRasterPtrType& inRaster,
-        unsigned int histo_levels,
-        std::vector< int >& channels,
-        bool force = false );
-
-      /**
-       * @brief Returns the histogram reference stored inside the histogram cache.
-       *
-       * @note The result histograms will remain inside the protected
-       * object histo_cache_
-       *
-       * @param inRaster The input Raster.
-       * @param band Band number.
-       * @return The histogram reference.
-       */
-      TePDIHistogram::pointer GetHistRef(
-        TePDITypes::TePDIRasterPtrType& inRaster,
-        unsigned int band );
-
-  };
-
-#endif //TEPDILEVELREMAP_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDILEVELREMAP_HPP
+  #define TEPDILEVELREMAP_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIHistogram.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+  #include "TePDITypes.hpp"
+
+  /**
+   * @brief This is the base class for level remapping algorithms.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIGeneralAlgoGroup
+   */
+  class PDI_DLL TePDILevelRemap : public TePDIAlgorithm {
+    public :
+      /** @typedef Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDILevelRemap > pointer;
+      /** @typedef Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDILevelRemap > const_pointer;
+
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TePDILevelRemap();
+
+    protected :
+      /**
+       * @brief A level remap function pointer ( 3 arguments ).
+       *
+       * @param double Level to be remapped.
+       * @param double Gain.
+       * @param double Offset.
+       * @return The remapped level.
+       */
+      typedef double (*remap_func_3_ptr_type)( double, double, double );
+
+      /**
+       * @brief A level remap function pointer ( 4 arguments ).
+       *
+       * @param double Input Level 1 ( from image 1 ) to be remapped.
+       * @param double Input Level 2 ( from image 2 ) to be remapped.
+       * @param double Gain.
+       * @param double Offset.
+       * @return The remapped level.
+       */
+      typedef double (*remap_func_4_ptr_type)( double, double, double,
+        double );
+
+      /**
+       * @brief A cache of level ordered histograms to avoid rebuilding
+       * histograms all the times.
+       *
+       * @param TeRaster A raster naked pointer reference.
+       * @param unsigned int Raster band.
+       * @param TePDIHistogram::pointer A Histogram shared pointer reference.
+       */
+      std::map< std::pair< TeRaster*, unsigned int  >,
+                TePDIHistogram::pointer > histo_cache_;
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDILevelRemap();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      virtual void ResetState( const TePDIParameters& params );
+
+      /**
+       * @brief Do level remapping from one raster to another.
+       *
+       * @param inRaster The input Raster.
+       * @param outRaster The Output Raster.
+       * @param remapp_func The level remapping function pointer.
+       * @param in_channel in_raster channel to remap.
+       * @param out_channel out_raster channel to write on.
+       * @param gain Level Gain.
+       * @param offset Level Offset.
+       * @param normalize_output Do output normalization following the output
+       * raster channel allowed values range.
+       * @return true if ok, false on errors.
+       */
+      bool RemapLevels(
+        TePDITypes::TePDIRasterPtrType& inRaster,
+        remap_func_3_ptr_type remapp_func,
+        int in_channel,
+        int out_channel,
+        double gain,
+        double offset,
+        bool normalize_output,
+        TePDITypes::TePDIRasterPtrType& outRaster );
+
+      /**
+       * @brief Do level remapping from two input rasters to another.
+       *
+       * @param inRaster1 The input Raster 1.
+       * @param inRaster2 The input Raster 2.
+       * @param outRaster The Output Raster.
+       * @param remapp_func The level remapping function pointer.
+       * @param in_channel1 in_raster1 channel to remap.
+       * @param in_channel2 in_raster2 channel to remap.
+       * @param out_channel out_raster channel to write on.
+       * @param gain Level Gain.
+       * @param offset Level Offset.
+       * @param normalize_output Do output normalization following the output
+       * raster channel allowed values range
+       * @return true if ok, false on errors.
+       */
+      bool RemapLevels(
+        TePDITypes::TePDIRasterPtrType& inRaster1,
+        TePDITypes::TePDIRasterPtrType& inRaster2,
+        remap_func_4_ptr_type remapp_func,
+        int in_channel1,
+        int in_channel2,
+        int out_channel,
+        double gain,
+        double offset,
+        bool normalize_output,
+        TePDITypes::TePDIRasterPtrType& outRaster );
+
+      /**
+       * @brief Build level ordered histograms from the required raster channels.
+       *
+       * @note The result histograms will remain inside the protected
+       * object histo_cache_
+       *
+       * @param inRaster The input Raster.
+       * @param histo_levels Number of histogram interpolated levels.
+       * @param channels Channels to use for histogram generation.
+       * @param force Force histogram regeneratin even if already in cache.
+       */
+      void BuildHistograms(
+        TePDITypes::TePDIRasterPtrType& inRaster,
+        unsigned int histo_levels,
+        std::vector< int >& channels,
+        bool force = false );
+
+      /**
+       * @brief Returns the histogram reference stored inside the histogram cache.
+       *
+       * @note The result histograms will remain inside the protected
+       * object histo_cache_
+       *
+       * @param inRaster The input Raster.
+       * @param band Band number.
+       * @return The histogram reference.
+       */
+      TePDIHistogram::pointer GetHistRef(
+        TePDITypes::TePDIRasterPtrType& inRaster,
+        unsigned int band );
+
+  };
+
+#endif //TEPDILEVELREMAP_HPP
diff --git a/src/terralib/image_processing/TePDILinearFilter.cpp b/src/terralib/image_processing/TePDILinearFilter.cpp
old mode 100755
new mode 100644
index d46f4b3..b9a0706
--- a/src/terralib/image_processing/TePDILinearFilter.cpp
+++ b/src/terralib/image_processing/TePDILinearFilter.cpp
@@ -1,373 +1,373 @@
-#include "TePDILinearFilter.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-
-#include <TeUtils.h>
-
-#include "math.h"
-
-TePDILinearFilter::TePDILinearFilter()
-{
-}
-
-
-TePDILinearFilter::~TePDILinearFilter()
-{
-}
-
-
-bool TePDILinearFilter::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking for general required parameters */
-
-  TePDITypes::TePDIRasterPtrType inRaster;
-  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: input_image" );
-    return false;
-  }
-  if( ! inRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
-    return false;
-  }
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: output_image" );
-    return false;
-  }
-  if( ! outRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeReadyToWrite ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
-    return false;
-  }
-
-  /* channels parameter checking */
-
-  std::vector< int > channels;
-  if( ! parameters.GetParameter( "channels", channels ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: channels" );
-    return false;
-  }
-  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
-    if( channels[ index ] >= inRaster->nBands() ) {
-      TEAGN_LOGERR( "Invalid parameter: channels" );
-      return false;
-    }
-  }
-
-  /* Filter mask checking */
-  TePDIFilterMask::pointer mask;
-
-  if( ! parameters.GetParameter( "filter_mask", mask ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: filter_mask" );
-    return false;
-  }
-  if( ! mask.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: filter_mask inactive" );
-    return false;
-  }
-  if( mask->columns() < 3 ) {
-    TEAGN_WATCH( mask->columns() );
-    TEAGN_LOGERR( "Invalid parameter: filter_mask with invalid colunms number" );
-    return false;
-  }
-  if( mask->lines() < 3 ) {
-    TEAGN_WATCH( mask->lines() );
-    TEAGN_LOGERR( "Invalid parameter: filter_mask with invalid lines number" );
-    return false;
-  }
-  if( ( (int)mask->lines() > inRaster->params().nlines_ ) ||
-      ( (int)mask->columns() > inRaster->params().ncols_ ) ){
-    TEAGN_LOGERR( "Invalid parameter: filter_mask do not fit inside input image" );
-    return false;
-  }
-
-  /* Checking for number of iterations */
-  int iterations = 0;
-  if( ! parameters.GetParameter( "iterations", iterations ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: iterations" );
-    return false;
-  }
-  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
-
-  /* Checking photometric interpretation */
-  
-  for( unsigned int channels_index = 0 ; channels_index < channels.size() ; 
-    ++channels_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( 
-      ( inRaster->params().photometric_[ channels[ channels_index ] ] == 
-        TeRasterParams::TeRGB ) ||
-      ( inRaster->params().photometric_[ channels[ channels_index ] ] == 
-        TeRasterParams::TeMultiBand ) ),
-    "Invalid parameter - input_image "
-    "(invalid photometric interpretation)" );
-  }  
-  
-  return true;
-}
-
-
-bool TePDILinearFilter::RunImplementation()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  TePDIFilterMask::pointer mask;
-  params_.GetParameter( "filter_mask", mask );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-  
-  bool inRaster_uses_dummy = inRaster->params().useDummy_;
-
-  /* checking for the optional parameter level offset */
-
-  double level_offset;
-  if( params_.CheckParameter< double >( "level_offset" ) ) {
-    
-    params_.GetParameter( "level_offset", level_offset );
-  } else {
-    level_offset = 0;
-  }
-
-  /* Resetting the output raster */
-  
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    outRaster_params.projection( inRaster->projection() );
-  }
-  outRaster_params.boundingBoxLinesColumns( 
-    inRaster->params().boundingBox().x1(), 
-    inRaster->params().boundingBox().y1(), 
-    inRaster->params().boundingBox().x2(), 
-    inRaster->params().boundingBox().y2(), 
-    inRaster->params().nlines_,
-    inRaster->params().ncols_ );
-  if( inRaster->params().useDummy_ ) {
-    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
-  } else {
-    outRaster_params.setDummy( 0, -1 );
-  }
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand );
-  
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );       
-
-  /* Creating the temporary rasters with one band each */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  TePDITypes::TePDIRasterPtrType aux_raster2;
-  {
-    TeRasterParams aux_raster_params = inRaster->params();
-    aux_raster_params.nBands( channels.size() );
-    
-    if( iterations > 1 ) {
-      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster1, 
-        aux_raster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
-        "Unable to create auxiliary raster 1" );
-    }
-  
-    if( iterations > 2 ) {
-      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster2, 
-        aux_raster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
-        "Unable to create auxiliary raster 2" );      
-    }        
-  }
-  
-  /* Updating the global temporary representation of mask weights */
-
-  reset_maskmatrix( mask );
-
-  /* Setting the convolution buffer initial state */
-
-  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  reset_conv_buf( temp_maskmatrix_lines_, raster_columns );
-
-  /* Convolution Loop */
-
-  double output_level;
-
-  unsigned int mask_middle_off_lines =
-    (unsigned int) floor( ((double)temp_maskmatrix_lines_) / 2. );
-  unsigned int mask_middle_off_columns =
-    (unsigned int) floor( ((double)temp_maskmatrix_columns_) / 2. );
-
-  unsigned int conv_column_bound = raster_columns - temp_maskmatrix_columns_ + 1;
-  unsigned int conv_line_bound = raster_lines - temp_maskmatrix_lines_ + 1;
-
-  unsigned int mask_line;  
-  unsigned int mask_column;
-  unsigned int raster_line;
-  unsigned int conv_buf_column;
-
-  double out_channel_min_level = 0;
-  double out_channel_max_level = 0;
-  
-  double dummy_value = 0;
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-  
-  TePDIPIManager progress( "Linear filter", channels.size() * iterations *
-     conv_line_bound, progress_enabled_ );  
-     
-  unsigned int current_input_channel =0;
-  unsigned int curr_out_channel = 0;     
-
-  for( int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-    /* Defining the source and target rasters */
-      
-    if( iteration == 0 ) {
-      /* The first iteration */
-      
-      source_raster = inRaster;
-      
-      if( iterations > 1 ) {
-        target_raster = aux_raster1;
-      } else {
-        target_raster = outRaster;
-      }
-    } else if ( iteration == ( iterations - 1 ) ) {
-      /* The last iteration */
-      
-      source_raster = target_raster;        
-      target_raster = outRaster;
-    } else {
-      /* The intermediary iteration */
-      
-      if( iteration == 1 ) {
-        source_raster = target_raster;
-        target_raster = aux_raster2;
-      } else {
-        TePDITypes::TePDIRasterPtrType swap_ptr = source_raster;
-        source_raster = target_raster;
-        target_raster = swap_ptr;
-      }
-    }
-    
-    for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
-      ++channels_index ) {
-       
-      /* Defining the source channel and target channel */
-        
-      if( iteration == 0 ) {
-        /* The first iteration */
-        
-        current_input_channel = channels[ channels_index ];
-        curr_out_channel = channels_index;
-      } else if ( iteration == ( iterations - 1 ) ) {
-        /* The last iteration */
-        
-        current_input_channel = channels_index;
-        curr_out_channel = channels_index;
-      } else {
-        /* The intermediary iteration */
-
-        current_input_channel = channels_index;
-        curr_out_channel = channels_index;
-      }        
-          
-      if( inRaster_uses_dummy ) {
-        dummy_value = inRaster->params().dummy_[ current_input_channel ];
-      }
-
-      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-        outRaster, channels_index, out_channel_min_level,
-        out_channel_max_level ), "Unable to get raster channel level bounds" ); 
-       
-
-      /* Fills the convolution buffer with the first "mask_lines" from the 
-         raster */
-
-      for( unsigned int line = 0 ; line < ( temp_maskmatrix_lines_ - 1 ); 
-        ++line ) {
-        
-        up_conv_buf( source_raster, line, current_input_channel );
-      }
-
-      /* raster convolution */
-
-      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-        
-        TEAGN_FALSE_OR_RETURN( progress.Increment(),
-          "Canceled by the user" );
-          
-        up_conv_buf( source_raster, raster_line + temp_maskmatrix_lines_ - 1,
-          current_input_channel );
-
-        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
-             ++conv_buf_column ) {
-
-          output_level = level_offset;
-
-          for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; ++mask_line ) {
-            for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
-                 ++mask_column ) {
-              output_level += temp_maskmatrix_[ mask_line ][ mask_column ] *
-                conv_buf_[ mask_line ][ conv_buf_column + mask_column ];
-            }
-          }
-
-          /* Level range filtering */
-
-          if( output_level < out_channel_min_level ) {
-            output_level = out_channel_min_level;
-          } else if( output_level > out_channel_max_level ) {
-            output_level = out_channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            conv_buf_column + mask_middle_off_columns,
-            raster_line +  mask_middle_off_lines, output_level, 
-            curr_out_channel ),
-            "Pixel mapping error at line=" + 
-            Te2String( raster_line +  mask_middle_off_lines ) + " column=" +
-            Te2String( conv_buf_column + mask_middle_off_columns ) 
-            + " channel=" + Te2String( curr_out_channel ) +
-            " iteration=" + Te2String( iteration ) );
-        }
-      }
-    }
-  }
-
-  return true;
-}
-
-
-void TePDILinearFilter::ResetState( const TePDIParameters& params )
-{
-  TePDIBufferedFilter::ResetState( params );
-}
-
-
+#include "TePDILinearFilter.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+
+#include <TeUtils.h>
+
+#include "math.h"
+
+TePDILinearFilter::TePDILinearFilter()
+{
+}
+
+
+TePDILinearFilter::~TePDILinearFilter()
+{
+}
+
+
+bool TePDILinearFilter::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking for general required parameters */
+
+  TePDITypes::TePDIRasterPtrType inRaster;
+  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: input_image" );
+    return false;
+  }
+  if( ! inRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
+    return false;
+  }
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: output_image" );
+    return false;
+  }
+  if( ! outRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeReadyToWrite ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
+    return false;
+  }
+
+  /* channels parameter checking */
+
+  std::vector< int > channels;
+  if( ! parameters.GetParameter( "channels", channels ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: channels" );
+    return false;
+  }
+  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
+    if( channels[ index ] >= inRaster->nBands() ) {
+      TEAGN_LOGERR( "Invalid parameter: channels" );
+      return false;
+    }
+  }
+
+  /* Filter mask checking */
+  TePDIFilterMask::pointer mask;
+
+  if( ! parameters.GetParameter( "filter_mask", mask ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: filter_mask" );
+    return false;
+  }
+  if( ! mask.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: filter_mask inactive" );
+    return false;
+  }
+  if( mask->columns() < 3 ) {
+    TEAGN_WATCH( mask->columns() );
+    TEAGN_LOGERR( "Invalid parameter: filter_mask with invalid colunms number" );
+    return false;
+  }
+  if( mask->lines() < 3 ) {
+    TEAGN_WATCH( mask->lines() );
+    TEAGN_LOGERR( "Invalid parameter: filter_mask with invalid lines number" );
+    return false;
+  }
+  if( ( (int)mask->lines() > inRaster->params().nlines_ ) ||
+      ( (int)mask->columns() > inRaster->params().ncols_ ) ){
+    TEAGN_LOGERR( "Invalid parameter: filter_mask do not fit inside input image" );
+    return false;
+  }
+
+  /* Checking for number of iterations */
+  int iterations = 0;
+  if( ! parameters.GetParameter( "iterations", iterations ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: iterations" );
+    return false;
+  }
+  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
+
+  /* Checking photometric interpretation */
+  
+  for( unsigned int channels_index = 0 ; channels_index < channels.size() ; 
+    ++channels_index ) {
+    
+    TEAGN_TRUE_OR_RETURN( ( 
+      ( inRaster->params().photometric_[ channels[ channels_index ] ] == 
+        TeRasterParams::TeRGB ) ||
+      ( inRaster->params().photometric_[ channels[ channels_index ] ] == 
+        TeRasterParams::TeMultiBand ) ),
+    "Invalid parameter - input_image "
+    "(invalid photometric interpretation)" );
+  }  
+  
+  return true;
+}
+
+
+bool TePDILinearFilter::RunImplementation()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  TePDIFilterMask::pointer mask;
+  params_.GetParameter( "filter_mask", mask );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+  
+  bool inRaster_uses_dummy = inRaster->params().useDummy_;
+
+  /* checking for the optional parameter level offset */
+
+  double level_offset;
+  if( params_.CheckParameter< double >( "level_offset" ) ) {
+    
+    params_.GetParameter( "level_offset", level_offset );
+  } else {
+    level_offset = 0;
+  }
+
+  /* Resetting the output raster */
+  
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    outRaster_params.projection( inRaster->projection() );
+  }
+  outRaster_params.boundingBoxLinesColumns( 
+    inRaster->params().boundingBox().x1(), 
+    inRaster->params().boundingBox().y1(), 
+    inRaster->params().boundingBox().x2(), 
+    inRaster->params().boundingBox().y2(), 
+    inRaster->params().nlines_,
+    inRaster->params().ncols_ );
+  if( inRaster->params().useDummy_ ) {
+    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
+  } else {
+    outRaster_params.setDummy( 0, -1 );
+  }
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand );
+  
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );       
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  {
+    TeRasterParams aux_raster_params = inRaster->params();
+    aux_raster_params.nBands( channels.size() );
+    
+    if( iterations > 1 ) {
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster1, 
+        aux_raster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
+        "Unable to create auxiliary raster 1" );
+    }
+  
+    if( iterations > 2 ) {
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( aux_raster2, 
+        aux_raster_params, TePDIUtils::TePDIUtilsAutoMemPol ), 
+        "Unable to create auxiliary raster 2" );      
+    }        
+  }
+  
+  /* Updating the global temporary representation of mask weights */
+
+  reset_maskmatrix( mask );
+
+  /* Setting the convolution buffer initial state */
+
+  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( temp_maskmatrix_lines_, raster_columns );
+
+  /* Convolution Loop */
+
+  double output_level;
+
+  unsigned int mask_middle_off_lines =
+    (unsigned int) floor( ((double)temp_maskmatrix_lines_) / 2. );
+  unsigned int mask_middle_off_columns =
+    (unsigned int) floor( ((double)temp_maskmatrix_columns_) / 2. );
+
+  unsigned int conv_column_bound = raster_columns - temp_maskmatrix_columns_ + 1;
+  unsigned int conv_line_bound = raster_lines - temp_maskmatrix_lines_ + 1;
+
+  unsigned int mask_line;  
+  unsigned int mask_column;
+  unsigned int raster_line;
+  unsigned int conv_buf_column;
+
+  double out_channel_min_level = 0;
+  double out_channel_max_level = 0;
+  
+  double dummy_value = 0;
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+  
+  TePDIPIManager progress( "Linear filter", channels.size() * iterations *
+     conv_line_bound, progress_enabled_ );  
+     
+  unsigned int current_input_channel =0;
+  unsigned int curr_out_channel = 0;     
+
+  for( int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
+    /* Defining the source and target rasters */
+      
+    if( iteration == 0 ) {
+      /* The first iteration */
+      
+      source_raster = inRaster;
+      
+      if( iterations > 1 ) {
+        target_raster = aux_raster1;
+      } else {
+        target_raster = outRaster;
+      }
+    } else if ( iteration == ( iterations - 1 ) ) {
+      /* The last iteration */
+      
+      source_raster = target_raster;        
+      target_raster = outRaster;
+    } else {
+      /* The intermediary iteration */
+      
+      if( iteration == 1 ) {
+        source_raster = target_raster;
+        target_raster = aux_raster2;
+      } else {
+        TePDITypes::TePDIRasterPtrType swap_ptr = source_raster;
+        source_raster = target_raster;
+        target_raster = swap_ptr;
+      }
+    }
+    
+    for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
+      ++channels_index ) {
+       
+      /* Defining the source channel and target channel */
+        
+      if( iteration == 0 ) {
+        /* The first iteration */
+        
+        current_input_channel = channels[ channels_index ];
+        curr_out_channel = channels_index;
+      } else if ( iteration == ( iterations - 1 ) ) {
+        /* The last iteration */
+        
+        current_input_channel = channels_index;
+        curr_out_channel = channels_index;
+      } else {
+        /* The intermediary iteration */
+
+        current_input_channel = channels_index;
+        curr_out_channel = channels_index;
+      }        
+          
+      if( inRaster_uses_dummy ) {
+        dummy_value = inRaster->params().dummy_[ current_input_channel ];
+      }
+
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+        outRaster, channels_index, out_channel_min_level,
+        out_channel_max_level ), "Unable to get raster channel level bounds" ); 
+       
+
+      /* Fills the convolution buffer with the first "mask_lines" from the 
+         raster */
+
+      for( unsigned int line = 0 ; line < ( temp_maskmatrix_lines_ - 1 ); 
+        ++line ) {
+        
+        up_conv_buf( source_raster, line, current_input_channel );
+      }
+
+      /* raster convolution */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( progress.Increment(),
+          "Canceled by the user" );
+          
+        up_conv_buf( source_raster, raster_line + temp_maskmatrix_lines_ - 1,
+          current_input_channel );
+
+        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
+             ++conv_buf_column ) {
+
+          output_level = level_offset;
+
+          for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; ++mask_line ) {
+            for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
+                 ++mask_column ) {
+              output_level += temp_maskmatrix_[ mask_line ][ mask_column ] *
+                conv_buf_[ mask_line ][ conv_buf_column + mask_column ];
+            }
+          }
+
+          /* Level range filtering */
+
+          if( output_level < out_channel_min_level ) {
+            output_level = out_channel_min_level;
+          } else if( output_level > out_channel_max_level ) {
+            output_level = out_channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            conv_buf_column + mask_middle_off_columns,
+            raster_line +  mask_middle_off_lines, output_level, 
+            curr_out_channel ),
+            "Pixel mapping error at line=" + 
+            Te2String( raster_line +  mask_middle_off_lines ) + " column=" +
+            Te2String( conv_buf_column + mask_middle_off_columns ) 
+            + " channel=" + Te2String( curr_out_channel ) +
+            " iteration=" + Te2String( iteration ) );
+        }
+      }
+    }
+  }
+
+  return true;
+}
+
+
+void TePDILinearFilter::ResetState( const TePDIParameters& params )
+{
+  TePDIBufferedFilter::ResetState( params );
+}
+
+
diff --git a/src/terralib/image_processing/TePDILinearFilter.hpp b/src/terralib/image_processing/TePDILinearFilter.hpp
old mode 100755
new mode 100644
index f6c0f3c..13ffc3a
--- a/src/terralib/image_processing/TePDILinearFilter.hpp
+++ b/src/terralib/image_processing/TePDILinearFilter.hpp
@@ -1,96 +1,96 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDILINEARFILTER_HPP
-  #define TEPDILINEARFILTER_HPP
-
-  #include "TePDIBufferedFilter.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for image Linear filtering processing.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIFiltersGroup
-   *
-   * @note The general required parameters are:
-   *
-   * @param input_image (TePDITypes::TePDIRasterPtrType),
-   * @param output_image (TePDITypes::TePDIRasterPtrType),
-   * @param channels (std::vector<int>) - Band(s) to process.
-   * @param filter_mask (TePDIFilterMask::pointer) Filter mask,
-   * @param iterations (int) - Iterations number,
-   * @param level_offset (int - optional ) - Level offset to be applied after
-   * pixel value calcule.
-   */
-  class PDI_DLL TePDILinearFilter : public TePDIBufferedFilter{
-    public :
-      /** @typedef Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDILinearFilter > pointer;
-      /** @typedef Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDILinearFilter > const_pointer;
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDILinearFilter();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDILinearFilter();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-  };
-  
-/** @example TePDILinearFilter_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDILINEARFILTER_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDILINEARFILTER_HPP
+  #define TEPDILINEARFILTER_HPP
+
+  #include "TePDIBufferedFilter.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the class for image Linear filtering processing.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIFiltersGroup
+   *
+   * @note The general required parameters are:
+   *
+   * @param input_image (TePDITypes::TePDIRasterPtrType),
+   * @param output_image (TePDITypes::TePDIRasterPtrType),
+   * @param channels (std::vector<int>) - Band(s) to process.
+   * @param filter_mask (TePDIFilterMask::pointer) Filter mask,
+   * @param iterations (int) - Iterations number,
+   * @param level_offset (int - optional ) - Level offset to be applied after
+   * pixel value calcule.
+   */
+  class PDI_DLL TePDILinearFilter : public TePDIBufferedFilter{
+    public :
+      /** @typedef Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDILinearFilter > pointer;
+      /** @typedef Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDILinearFilter > const_pointer;
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDILinearFilter();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDILinearFilter();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+  };
+  
+/** @example TePDILinearFilter_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDILINEARFILTER_HPP
diff --git a/src/terralib/image_processing/TePDILinearFilterFactory.cpp b/src/terralib/image_processing/TePDILinearFilterFactory.cpp
old mode 100755
new mode 100644
index 9b764af..b66f034
--- a/src/terralib/image_processing/TePDILinearFilterFactory.cpp
+++ b/src/terralib/image_processing/TePDILinearFilterFactory.cpp
@@ -1,25 +1,25 @@
- 
-#include "TePDILinearFilterFactory.hpp"
-#include "TePDILinearFilter.hpp"
-#include <TeAgnostic.h>
-
-TePDILinearFilterFactory::TePDILinearFilterFactory()
-: TePDIAlgorithmFactory( std::string( "TePDILinearFilter" ) )
-{
-};      
-
-TePDILinearFilterFactory::~TePDILinearFilterFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDILinearFilterFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDILinearFilter();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
-
+ 
+#include "TePDILinearFilterFactory.hpp"
+#include "TePDILinearFilter.hpp"
+#include <TeAgnostic.h>
+
+TePDILinearFilterFactory::TePDILinearFilterFactory()
+: TePDIAlgorithmFactory( std::string( "TePDILinearFilter" ) )
+{
+};      
+
+TePDILinearFilterFactory::~TePDILinearFilterFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDILinearFilterFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDILinearFilter();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
+
diff --git a/src/terralib/image_processing/TePDILinearFilterFactory.hpp b/src/terralib/image_processing/TePDILinearFilterFactory.hpp
old mode 100755
new mode 100644
index 72fc661..15463ad
--- a/src/terralib/image_processing/TePDILinearFilterFactory.hpp
+++ b/src/terralib/image_processing/TePDILinearFilterFactory.hpp
@@ -1,67 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDILINEARFILTERFACTORY_HPP
-  #define TEPDILINEARFILTERFACTORY_HPP
-
-  #include "TePDIAlgorithmFactory.hpp"
-  
-  /**
-   * @brief This is the class for linear filter factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDILinearFilterFactory : public TePDIAlgorithmFactory
-  {
-    public :
-     
-      /**
-       * @brief Default constructor
-       */
-      TePDILinearFilterFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDILinearFilterFactory();
-      
-    protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace
-  {  
-    static TePDILinearFilterFactory TePDILinearFilterFactory_instance;
-  };
-
-#endif
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDILINEARFILTERFACTORY_HPP
+  #define TEPDILINEARFILTERFACTORY_HPP
+
+  #include "TePDIAlgorithmFactory.hpp"
+  
+  /**
+   * @brief This is the class for linear filter factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDILinearFilterFactory : public TePDIAlgorithmFactory
+  {
+    public :
+     
+      /**
+       * @brief Default constructor
+       */
+      TePDILinearFilterFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDILinearFilterFactory();
+      
+    protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace
+  {  
+    static TePDILinearFilterFactory TePDILinearFilterFactory_instance;
+  };
+
+#endif
+
diff --git a/src/terralib/image_processing/TePDIMIMatching.cpp b/src/terralib/image_processing/TePDIMIMatching.cpp
index 25e0b87..5f1c555 100644
--- a/src/terralib/image_processing/TePDIMIMatching.cpp
+++ b/src/terralib/image_processing/TePDIMIMatching.cpp
@@ -1,1238 +1,1238 @@
-#include "TePDIMIMatching.hpp"
-
-#include "TePDIUtils.hpp"
-#include "TePDIMatrix.hpp"
-#include <TeThreadFunctor.h>
-#include <TeMutex.h>
-#include <TeCoord2D.h>
-
-#include <math.h>
-#include <limits.h>
-
-
-TePDIMIMatching::TePDIMIMatching()
-{
-}
-
-
-TePDIMIMatching::~TePDIMIMatching()
-{
-}
-
-
-bool TePDIMIMatching::RunImplementation()
-{
-  /* Retriving Parameters */
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  params_.GetParameter( "input_image1_ptr", input_image1_ptr );  
-  
-  unsigned int input_channel1 = 0;
-  params_.GetParameter( "input_channel1", input_channel1 );   
-  
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  params_.GetParameter( "input_image2_ptr", input_image2_ptr );  
-  
-  unsigned int input_channel2 = 0;
-  params_.GetParameter( "input_channel2", input_channel2 );   
-
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
-  params_.GetParameter( "out_tie_points_ptr", out_tie_points_ptr );   
-  
-  TeBox input_box1;
-  if( params_.CheckParameter< TeBox >( "input_box1" ) ) {
-    params_.GetParameter( "input_box1", input_box1 );
-  } else {
-    TeBox input_box1_proj = input_image1_ptr->params().box();
-    
-    TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, input_image1_ptr,
-      input_box1 );
-  }
-  
-  TeBox input_box2;
-  if( params_.CheckParameter< TeBox >( "input_box2" ) ) {
-    params_.GetParameter( "input_box2", input_box2 );
-  } else {
-    TeBox input_box2_proj = input_image2_ptr->params().box();
-    
-    TePDIUtils::MapCoords2RasterIndexes( input_box2_proj, input_image2_ptr,
-      input_box2 );
-  }  
-  
-  bool enable_multi_thread = false;
-  if( params_.CheckParameter< int >( "enable_multi_thread" ) ) {
-    enable_multi_thread = true;
-  }
-  
-  double pixel_x_relation = 1.0;
-  if( params_.CheckParameter< double >( "pixel_x_relation" ) ) {
-    params_.GetParameter( "pixel_x_relation", pixel_x_relation );
-  }
-  
-  double pixel_y_relation = 1.0;
-  if( params_.CheckParameter< double >( "pixel_y_relation" ) ) {
-    params_.GetParameter( "pixel_y_relation", pixel_y_relation );
-  }  
-  
-  unsigned int max_size_opt = 0;
-  if( params_.CheckParameter< unsigned int >( "max_size_opt" ) ) {
-    params_.GetParameter( "max_size_opt", max_size_opt );
-  }   
-  
-  /* Calculating the number of allowed threads - this process
-     not included into the count */
-     
-  unsigned int max_threads = 0;
-  std::vector< TeThreadFunctor::pointer > threads_vector;
-  
-  if( enable_multi_thread ) {
-    max_threads = TeGetPhysProcNumber() - 1;
-    
-    for( unsigned int index = 0 ; index < max_threads ; ++index ) {
-      TeThreadFunctor::pointer aux_thread_ptr( new TeThreadFunctor );
-    
-      threads_vector.push_back( aux_thread_ptr );
-    }
-  }
-  
-  /* Calculating the box postion related values */
-  
-  const unsigned int orig_box1_x_off = (unsigned int)input_box1.lowerLeft().x();
-  const unsigned int orig_box1_y_off = (unsigned int)input_box1.upperRight().y();
-  const unsigned int orig_box1_nlines = 1 + (unsigned int)ABS( input_box1.height() );
-  const unsigned int orig_box1_ncols = 1 + (unsigned int)ABS( input_box1.width() );
-  
-  const unsigned int orig_box2_x_off = (unsigned int)input_box2.lowerLeft().x();
-  const unsigned int orig_box2_y_off = (unsigned int)input_box2.upperRight().y();
-  const unsigned int orig_box2_nlines = 1 + (unsigned int)ABS( input_box2.height() );
-  const unsigned int orig_box2_ncols = 1 + (unsigned int)ABS( input_box2.width() );
-    
-  /* Calculating the rescale factors 
-     rescaled_image = original_image * rescale_factor */
-  
-  double img1_x_rescale_factor = 1.0;
-  double img1_y_rescale_factor = 1.0;
-  double img2_x_rescale_factor = 1.0;
-  double img2_y_rescale_factor = 1.0;
-  {
-    double mean_pixel_relation = ( pixel_x_relation + pixel_y_relation ) /
-      2.0;
-      
-    if( mean_pixel_relation > 1.0 ) {
-      /* The image 1 has poor resolution - bigger pixel resolution values -
-         and image 2 needs to be rescaled down */
-      
-      img2_x_rescale_factor = 1.0 / pixel_x_relation;
-      img2_y_rescale_factor = 1.0 / pixel_y_relation;
-    } else if( mean_pixel_relation < 1.0 ) {
-      /* The image 2 has poor resolution - bigger pixel resolution values
-        and image 1 needs to be rescaled down */
-      
-      img1_x_rescale_factor = pixel_x_relation;
-      img1_y_rescale_factor = pixel_y_relation;
-    }
-  } 
-  
-  if( max_size_opt )
-  {
-    double resc_box1_size = 
-      ( (double)orig_box1_nlines  ) * img1_y_rescale_factor *
-      ( (double)orig_box1_ncols ) * img1_x_rescale_factor;
-    double resc_box2_size = 
-      ( (double)orig_box2_nlines  ) * img2_y_rescale_factor *
-      ( (double)orig_box2_ncols ) * img2_x_rescale_factor;
-    double max_size_opt_double = (double)max_size_opt;
-    
-    if( ( resc_box1_size > max_size_opt_double ) || 
-      ( resc_box2_size > max_size_opt_double ) )
-    {
-      double opt_rescale_factor = 1.0;
-      
-      if( resc_box1_size > resc_box2_size )
-      {
-        opt_rescale_factor = sqrt( resc_box1_size / max_size_opt_double );
-      }
-      else
-      {
-        opt_rescale_factor = sqrt( resc_box2_size / max_size_opt_double );
-      }
-      
-      img1_x_rescale_factor *= opt_rescale_factor;
-      img1_y_rescale_factor *= opt_rescale_factor;
-      img2_x_rescale_factor *= opt_rescale_factor;
-      img2_y_rescale_factor *= opt_rescale_factor;
-    }
-  }
-  
-  /* Checking if the small matrix fits inside the bigger one */
-  
-  {
-    unsigned int resc_box1_nlines = (unsigned int) ceil( 
-      ( (double)orig_box1_nlines ) * img1_y_rescale_factor );
-    unsigned int resc_box1_ncols = (unsigned int) ceil( 
-      ( (double)orig_box1_ncols ) * img1_x_rescale_factor );     
-    unsigned int resc_box2_nlines = (unsigned int) ceil( 
-      ( (double)orig_box2_nlines ) * img2_y_rescale_factor );
-    unsigned int resc_box2_ncols = (unsigned int) ceil( 
-      ( (double)orig_box2_ncols ) * img2_x_rescale_factor );   
-        
-    const unsigned int m1size = resc_box1_nlines * 
-      resc_box1_ncols;
-    const unsigned int m2size = resc_box2_nlines * 
-      resc_box2_ncols;      
-      
-    if( m1size < m2size )
-    {
-      if( ( resc_box1_ncols > resc_box2_ncols ) ||
-        ( resc_box1_nlines > resc_box2_nlines ) )
-      {
-        return true;
-      }
-    } 
-    else
-    {
-      if( ( resc_box2_ncols > resc_box1_ncols ) ||
-        ( resc_box2_nlines > resc_box1_nlines ) )
-      {
-        return true;
-      }    
-    }
-  }  
-  
-  /* Loading images */
-  
-  TeMutex glb_mem_lock; //global memory lock
-  
-  ImgMatrixT img1_matrix;
-  ImgMatrixT img2_matrix;
- 
-  {
-    TeThreadParameters tparams1;
-    tparams1.store( "input_image_ptr", input_image1_ptr );
-    tparams1.store( "img_matrix_ptr", &img1_matrix );
-    tparams1.store( "img_x_rescale_factor", img1_x_rescale_factor );
-    tparams1.store( "img_y_rescale_factor", img1_y_rescale_factor );
-    tparams1.store( "box_x_off", orig_box1_x_off );
-    tparams1.store( "box_y_off", orig_box1_y_off );
-    tparams1.store( "box_nlines", orig_box1_nlines );
-    tparams1.store( "box_ncols", orig_box1_ncols );
-    tparams1.store( "input_channel", input_channel1 );
-    tparams1.store( "progress_enabled", progress_enabled_ );
-    tparams1.store( "glb_mem_lock_ptr", &glb_mem_lock );
-    
-    TeThreadParameters tparams2;
-    tparams2.store( "input_image_ptr", input_image2_ptr );
-    tparams2.store( "img_matrix_ptr", &img2_matrix );
-    tparams2.store( "img_x_rescale_factor", img2_x_rescale_factor );
-    tparams2.store( "img_y_rescale_factor", img2_y_rescale_factor );
-    tparams2.store( "box_x_off", orig_box2_x_off );
-    tparams2.store( "box_y_off", orig_box2_y_off );
-    tparams2.store( "box_nlines", orig_box2_nlines );
-    tparams2.store( "box_ncols", orig_box2_ncols );
-    tparams2.store( "input_channel", input_channel2 );
-    tparams2.store( "progress_enabled", progress_enabled_ );
-    tparams2.store( "glb_mem_lock_ptr", &glb_mem_lock );
-  
-    if( max_threads > 0 ) {
-      threads_vector[ 0 ]->setStartFunctPtr( loadImage );
-      threads_vector[ 0 ]->setParameters( tparams1 );
-      threads_vector[ 0 ]->start();
-   
-      if( ! loadImage( tparams2 ) ) {
-        threads_vector[ 0 ]->waitToFinish();
-        
-        TEAGN_LOG_AND_RETURN( "Unable to load image 2" )
-      } else {
-        threads_vector[ 0 ]->waitToFinish();
-        
-        TEAGN_TRUE_OR_RETURN( threads_vector[ 0 ]->getReturnValue(),
-          "Unable to load image 1" )
-      }
-    } else {
-      TEAGN_TRUE_OR_RETURN( loadImage( tparams1 ),
-        "Error loading image 1" )
-      TEAGN_TRUE_OR_RETURN( loadImage( tparams2 ),
-        "Error loading image 2" )
-    }
-  }
-  
-/* remove */        
-//matrix2Tiff( img1_matrix, "img1_matrix.tif", 
-//  std::vector< TeCoord2D >() );
-//matrix2Tiff( img2_matrix, "img2_matrix.tif",
-//  std::vector< TeCoord2D >() );
-/* remove */  
-  
-  /* Correlating areas */
-  
-  out_tie_points_ptr->clear();
-  
-  {
-    /* Switching the big and small matrixes */
-    
-    const unsigned int m1size = img1_matrix.GetColumns() * 
-      img1_matrix.GetLines();
-    const unsigned int m2size = img2_matrix.GetColumns() * 
-      img2_matrix.GetLines();      
-    
-    ImgMatrixT* big_matrix_ptr = 0;
-    ImgMatrixT* small_matrix_ptr = 0;
-      
-    if( m1size < m2size )
-    {
-      big_matrix_ptr = &img2_matrix;
-      small_matrix_ptr = &img1_matrix;
-    } 
-    else
-    {
-      big_matrix_ptr = &img1_matrix;
-      small_matrix_ptr = &img2_matrix;
-    }
-    
-    ImgMatrixT& big_matrix = *big_matrix_ptr;
-    ImgMatrixT& small_matrix = *small_matrix_ptr;
-    
-    const unsigned int small_mtx_lines = small_matrix.GetLines();
-    const unsigned int small_mtx_cols = small_matrix.GetColumns();
-    const unsigned int big_mtx_lines = big_matrix.GetLines();
-    const unsigned int big_mtx_cols = big_matrix.GetColumns();    
-    const double elements_nmb = (double)( small_mtx_cols *
-      small_mtx_lines );    
-    
-    /* Generating small matrix histogram */
-    
-    std::vector< unsigned int > small_mtx_histo;
-    long int small_mtx_min = LONG_MAX;
-    long int small_mtx_max = (-1) * small_mtx_min;
-    unsigned int small_mtx_histo_size = 0;
-    {
-      unsigned int line = 0;
-      unsigned int col = 0;
-      double* small_matrix_line_ptr = 0;
-      long int elem = 0;
-      
-      for( ; line < small_mtx_lines ; ++line )
-      {
-        small_matrix_line_ptr = small_matrix[ line ];
-        
-        for( col = 0 ; col < small_mtx_cols ; ++col )
-        {
-          elem = (long int)small_matrix_line_ptr[ col ];
-          
-          if( elem > small_mtx_max )
-          {
-            small_mtx_max = elem;
-          }
-          
-          if( elem < small_mtx_min )
-          {
-            small_mtx_min = elem;
-          }
-          
-        }
-      }
-      
-      if( small_mtx_max >= small_mtx_min )
-      {
-        small_mtx_histo_size = (unsigned int)(
-          small_mtx_max - small_mtx_min + 1 );
-          
-        small_mtx_histo.resize( small_mtx_histo_size );
-        
-        for( line = 0 ; line < small_mtx_lines ; ++line )
-        {
-          small_matrix_line_ptr = small_matrix[ line ];
-          
-          for( col = 0 ; col < small_mtx_cols ; ++col )
-          {
-            elem = (long int)small_matrix_line_ptr[ col ];
-            elem -= small_mtx_min;
-            
-            small_mtx_histo[ elem ] += 1;
-          }
-        }
-      }      
-    }
-    
-    /* Calc the small matrix entropy */
-    
-    double small_mtx_entropy = 0.0;
-    const double log2 = log( (double)2.0 );
-    
-    {
-      double prob = 0.0;
-      const unsigned int small_mtx_histo_size = (unsigned int)
-        small_mtx_histo.size();
-
-      for( unsigned int hidx = 0 ; hidx < small_mtx_histo_size ; ++hidx )
-      {
-        prob = ( (double)(small_mtx_histo[ hidx ] ) ) / elements_nmb;
-        
-        if( prob > 0.0 ) {
-          small_mtx_entropy += ( prob * ( log( prob ) / log2 ) );
-        }        
-      }
-      
-      small_mtx_entropy *= (-1.0);
-    }
-
-    /* Pre-initiating big matrix histogram */
-    
-    std::vector< unsigned int > big_mtx_histo;
-    long int big_mtx_min = LONG_MAX;
-    long int big_mtx_max = (-1) * big_mtx_min;
-    unsigned int big_mtx_histo_size = 0;
-    {
-      unsigned int line = 0;
-      unsigned int col = 0;
-      double* big_matrix_line_ptr = 0;
-      long int elem = 0;
-      
-      for( ; line < big_mtx_lines ; ++line )
-      {
-        big_matrix_line_ptr = big_matrix[ line ];
-        
-        for( col = 0 ; col < big_mtx_cols ; ++col )
-        {
-          elem = (long int)big_matrix_line_ptr[ col ];
-          
-          if( elem > big_mtx_max )
-          {
-            big_mtx_max = elem;
-          }
-          
-          if( elem < big_mtx_min )
-          {
-            big_mtx_min = elem;
-          }
-          
-        }
-      }
-      
-      if( big_mtx_max >= big_mtx_min )
-      {
-        big_mtx_histo_size = (unsigned int)( 
-          big_mtx_max - big_mtx_min + 1 );
-          
-        big_mtx_histo.resize( big_mtx_histo_size );
-      }      
-    }
-
-    /* Pre-initiating joint histogram matrix */
-    
-    TePDIMatrix< unsigned int > joint_histo_mtx;
-    TEAGN_TRUE_OR_RETURN( joint_histo_mtx.Reset( small_mtx_histo_size,
-      big_mtx_histo_size, TePDIMatrix< unsigned int >::AutoMemPol ), 
-      "Error allocating joint histogram" )
-    
-    /* Iterating over each small matrix position over the bigger one */
-    
-    const unsigned int big_mtx_lines_bound = big_matrix.GetLines() -
-      small_mtx_lines;
-    const unsigned int big_mtx_cols_bound = big_matrix.GetColumns() -
-      small_mtx_cols;
-      
-    unsigned int big_mtx_line = 0;
-    unsigned  int big_mtx_col = 0;
-    unsigned int small_mtx_line = 0;
-    unsigned int small_mtx_col = 0;
-    
-    double* big_matrix_line_ptr = 0;
-    double* small_matrix_line_ptr = 0;
-    
-    double prob = 0.0;
-    double bmtx_crop_entropy = 0;
-    double curr_jentropy = 0;
-    double curr_mi = 0;
-    long int big_mtx_ele = 0;
-    long int small_mtx_ele = 0;
-    
-    double best_mi = DBL_MAX * ( -1.0 );
-    unsigned int best_mi_lin = 0;
-    unsigned int best_mi_col = 0;
-    
-    unsigned int big_mtx_histo_idx = 0;
-    unsigned int joint_histo_mtx_line = 0;
-    unsigned int joint_histo_mtx_col = 0;
-    unsigned int* joint_histo_line_ptr = 0;
-    
-    TePDIPIManager progress( "Looking for the best matching", 
-      big_mtx_lines_bound, progress_enabled_ );
-        
-    for( ; big_mtx_line < big_mtx_lines_bound ; ++big_mtx_line )
-    {
-      for( big_mtx_col = 0 ; big_mtx_col < big_mtx_cols_bound ; 
-        ++big_mtx_col )
-      {
-        /* Cleaning big_mtx_histo */
-        
-        for( big_mtx_histo_idx = 0 ; big_mtx_histo_idx < 
-          big_mtx_histo_size ; ++big_mtx_histo_idx )
-        {
-          big_mtx_histo[ big_mtx_histo_idx ] = 0;
-        }
-        
-        /* Cleaning joint_histo_mtx */
-        
-        for( joint_histo_mtx_line = 0; joint_histo_mtx_line <
-          small_mtx_histo_size ; ++joint_histo_mtx_line )
-        {
-          joint_histo_line_ptr = joint_histo_mtx[ 
-            joint_histo_mtx_line ];
-            
-          for( joint_histo_mtx_col = 0; joint_histo_mtx_col <
-            big_mtx_histo_size ; ++joint_histo_mtx_col )
-          {
-            joint_histo_line_ptr[ joint_histo_mtx_col ] = 0;
-          }
-        }
-          
-        /* Generating histograms for the current position */
-        
-        for( small_mtx_line = 0 ; small_mtx_line < small_mtx_lines ;
-          ++small_mtx_line )
-        {
-          big_matrix_line_ptr = big_matrix[ big_mtx_line + 
-            small_mtx_line ];
-          small_matrix_line_ptr = small_matrix[ small_mtx_line ];
-          
-          for( small_mtx_col = 0 ; small_mtx_col < small_mtx_cols ;
-            ++small_mtx_col )
-          {
-            big_mtx_ele = (long int)big_matrix_line_ptr[ big_mtx_col + 
-              small_mtx_col ];
-            small_mtx_ele = (long int)small_matrix_line_ptr[ 
-              small_mtx_col ];              
-              
-            big_mtx_histo_idx = big_mtx_ele - big_mtx_min;
-            big_mtx_histo[ big_mtx_histo_idx ] += 1;
-            
-            joint_histo_mtx_line = small_mtx_ele - small_mtx_min;
-            joint_histo_mtx( joint_histo_mtx_line, big_mtx_histo_idx ) 
-              += 1;
-          }
-        }
-
-        /* Calc the entropy for the current position */
-        
-        bmtx_crop_entropy = 0.0;
-        
-        for( big_mtx_histo_idx = 0 ; big_mtx_histo_idx < 
-          big_mtx_histo_size ; ++big_mtx_histo_idx )
-        {
-          prob = ( (double)( big_mtx_histo[ big_mtx_histo_idx ] ) ) / 
-            elements_nmb;
-          
-          if( prob > 0.0 ) {
-            bmtx_crop_entropy += ( prob * ( log( prob ) / log2 ) );
-          }        
-        }        
-        
-        bmtx_crop_entropy *= (-1.0);
-        
-        /* Calc the joint entropy for the current position */
-        
-        curr_jentropy = 0.0;
-        
-        for( joint_histo_mtx_line = 0; joint_histo_mtx_line <
-          small_mtx_histo_size ; ++joint_histo_mtx_line )
-        {
-          joint_histo_line_ptr = joint_histo_mtx[ 
-            joint_histo_mtx_line ];
-            
-          for( joint_histo_mtx_col = 0; joint_histo_mtx_col <
-            big_mtx_histo_size ; ++joint_histo_mtx_col )
-          {
-            prob = ( (double)( joint_histo_line_ptr[ 
-              joint_histo_mtx_col ] ) ) / elements_nmb;
-            
-            if( prob > 0.0 ) {
-              curr_jentropy += ( prob * ( log( prob ) / log2 ) );
-            }               
-          }
-        }        
-        
-        curr_jentropy *= (-1.0);
-        
-        /* Is this the best position ??? */
-        
-        curr_mi = small_mtx_entropy + bmtx_crop_entropy -
-          curr_jentropy;
-        
-        if( curr_mi > best_mi )
-        {
-          best_mi = curr_mi;
-          best_mi_col = big_mtx_col;
-          best_mi_lin = big_mtx_line;
-        } 
-      }
-      
-      TEAGN_FALSE_OR_RETURN( progress.Increment(),
-        "Canceled by the user" );
-    }
-    
-    /* Copy the best MI to user output var */
-    
-    double* best_mi_ptr = 0;
-    if( params_.CheckParameter< double* >( "best_mi_ptr" ) ) {
-      params_.GetParameter( "best_mi_ptr", best_mi_ptr );
-      (*best_mi_ptr) = best_mi;
-    }       
-    
-    /* Generating tie-points */
-    
-    TeCoord2D ulpoint_img1;
-    TeCoord2D urpoint_img1;
-    TeCoord2D llpoint_img1;
-    TeCoord2D lrpoint_img1;
-    
-    TeCoord2D ulpoint_img2;
-    TeCoord2D urpoint_img2;
-    TeCoord2D llpoint_img2;
-    TeCoord2D lrpoint_img2;
-    
-    if( m1size < m2size )
-    {
-      ulpoint_img1.setXY( 0 , 0 );
-      llpoint_img1.setXY( 0, img1_matrix.GetLines() - 1 );
-      urpoint_img1.setXY( img1_matrix.GetColumns() - 1 , 0 );
-      lrpoint_img1.setXY( img1_matrix.GetColumns() - 1,
-        img1_matrix.GetLines() - 1 );
-        
-      ulpoint_img2.setXY( best_mi_col, best_mi_lin );
-      llpoint_img2.setXY( 
-        best_mi_col,
-        best_mi_lin + img1_matrix.GetLines() - 1 );
-      urpoint_img2.setXY( 
-        best_mi_col + img1_matrix.GetColumns() - 1,
-        best_mi_lin );
-      lrpoint_img2.setXY( 
-        best_mi_col + img1_matrix.GetColumns() - 1,
-        best_mi_lin + img1_matrix.GetLines() - 1 );
-    } 
-    else
-    {
-      ulpoint_img2.setXY( 0 , 0 );
-      llpoint_img2.setXY( 0, img2_matrix.GetLines() - 1 );
-      urpoint_img2.setXY( img2_matrix.GetColumns() - 1 , 0 );
-      lrpoint_img2.setXY( img2_matrix.GetColumns() - 1,
-        img2_matrix.GetLines() - 1 );
-        
-      ulpoint_img1.setXY( best_mi_col, best_mi_lin );
-      llpoint_img1.setXY( 
-        best_mi_col,
-        best_mi_lin + img2_matrix.GetLines() - 1 );
-      urpoint_img1.setXY( 
-        best_mi_col + img2_matrix.GetColumns() - 1,
-        best_mi_lin );
-      lrpoint_img1.setXY( 
-        best_mi_col + img2_matrix.GetColumns() - 1,
-        best_mi_lin + img2_matrix.GetLines() - 1 );        
-    }
-    
-        
-    /* Bringing points into input_image1_ptr 
-       reference */
-       
-    ulpoint_img1.setXY( 
-      ( ulpoint_img1.x() / img1_x_rescale_factor ) +
-      ( (double)orig_box1_x_off ),
-      ( ulpoint_img1.y() / img1_y_rescale_factor ) +
-      ( (double)orig_box1_y_off ) );
-    urpoint_img1.setXY( 
-      ( urpoint_img1.x() / img1_x_rescale_factor ) +
-      ( (double)orig_box1_x_off ),
-      ( urpoint_img1.y() / img1_y_rescale_factor ) +
-      ( (double)orig_box1_y_off ) );
-    llpoint_img1.setXY( 
-      ( llpoint_img1.x() / img1_x_rescale_factor ) +
-      ( (double)orig_box1_x_off ),
-      ( llpoint_img1.y() / img1_y_rescale_factor ) +
-      ( (double)orig_box1_y_off ) );
-    lrpoint_img1.setXY( 
-      ( lrpoint_img1.x() / img1_x_rescale_factor ) +
-      ( (double)orig_box1_x_off ),
-      ( lrpoint_img1.y() / img1_y_rescale_factor ) +
-      ( (double)orig_box1_y_off ) );                  
-
-    /* Bringing points into input_image2_ptr 
-       reference */
-   
-    ulpoint_img2.setXY( 
-      ( ulpoint_img2.x() / img2_x_rescale_factor ) +
-      ( (double)orig_box2_x_off ),
-      ( ulpoint_img2.y() / img2_y_rescale_factor ) +
-      ( (double)orig_box2_y_off ) );
-    urpoint_img2.setXY( 
-      ( urpoint_img2.x() / img2_x_rescale_factor ) +
-      ( (double)orig_box2_x_off ),
-      ( urpoint_img2.y() / img2_y_rescale_factor ) +
-      ( (double)orig_box2_y_off ) );
-    llpoint_img2.setXY( 
-      ( llpoint_img2.x() / img2_x_rescale_factor ) +
-      ( (double)orig_box2_x_off ),
-      ( llpoint_img2.y() / img2_y_rescale_factor ) +
-      ( (double)orig_box2_y_off ) );
-    lrpoint_img2.setXY( 
-      ( lrpoint_img2.x() / img2_x_rescale_factor ) +
-      ( (double)orig_box2_x_off ),
-      ( lrpoint_img2.y() / img2_y_rescale_factor ) +
-      ( (double)orig_box2_y_off ) );  
-         
-    /* Generating output tie-points */
-    
-    out_tie_points_ptr->push_back( TeCoordPair( ulpoint_img1,
-      ulpoint_img2 ) );
-    out_tie_points_ptr->push_back( TeCoordPair( urpoint_img1,
-      urpoint_img2 ) );
-    out_tie_points_ptr->push_back( TeCoordPair( llpoint_img1,
-      llpoint_img2 ) );
-    out_tie_points_ptr->push_back( TeCoordPair( lrpoint_img1,
-      lrpoint_img2 ) );
-      
-    TEAGN_DEBUG_CONDITION( checkTPs( *out_tie_points_ptr ),
-      "Invalid tie-points" )                     
-  }
-  
-  return true;
-}
-
-
-bool TePDIMIMatching::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking input_image1_ptr */
-    
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_image1_ptr", input_image1_ptr ),
-    "Missing parameter: input_image1_ptr" );
-  TEAGN_TRUE_OR_RETURN( input_image1_ptr.isActive(),
-    "Invalid parameter: input_image1_ptr inactive" );
-  TEAGN_TRUE_OR_RETURN( input_image1_ptr->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: input_image1_ptr not ready" );
-    
-  /* Checking input_channel1 */
-    
-  unsigned int input_channel1 = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_channel1", input_channel1 ),
-    "Missing parameter: input_channel1" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( (int)input_channel1 ) < 
-    input_image1_ptr->params().nBands() ),
-    "Invalid parameter: input_channel1" );
-    
-  /* Checking input_image1_ptr */
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_image2_ptr", input_image2_ptr ),
-    "Missing parameter: input_image2_ptr" );
-  TEAGN_TRUE_OR_RETURN( input_image2_ptr.isActive(),
-    "Invalid parameter: input_image2_ptr inactive" );
-  TEAGN_TRUE_OR_RETURN( input_image2_ptr->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: input_image2_ptr not ready" );    
-    
-  /* Checking input_channel2 */
-    
-  unsigned int input_channel2 = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_channel2", input_channel2 ),
-    "Missing parameter: input_channel2" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( (int)input_channel2 ) < 
-    input_image2_ptr->params().nBands() ),
-    "Invalid parameter: input_channel2" );
-    
-  /* Checking out_tie_points_ptr */
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "out_tie_points_ptr", out_tie_points_ptr ),
-    "Missing parameter: out_tie_points_ptr" );
-  TEAGN_TRUE_OR_RETURN( out_tie_points_ptr.isActive(),
-    "Invalid parameter: out_tie_points_ptr inactive" );
-    
-  /* Checking input_box1 */
-    
-  TeBox input_box1;
-  if( parameters.CheckParameter< TeBox >( "input_box1" ) ) {
-    parameters.GetParameter( "input_box1", input_box1 );
-    
-    TEAGN_TRUE_OR_RETURN( ( input_box1.x1() >= 0 ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( ( input_box1.x2() >= 0 ),
-      "Invalid parameter : input_box1" )      
-    TEAGN_TRUE_OR_RETURN( ( input_box1.y1() >= 0 ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( ( input_box1.y2() >= 0 ),
-      "Invalid parameter : input_box1" )         
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.x1() <= 
-        ( input_image1_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.x2() <= 
-        ( input_image1_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box1" )       
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.y1() <= 
-        ( input_image1_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.y2() <= 
-        ( input_image1_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box1" )        
-  }
-    
-  /* Checking input_box2 */
-    
-  TeBox input_box2;
-  if( parameters.CheckParameter< TeBox >( "input_box2" ) ) {
-    parameters.GetParameter( "input_box2", input_box2 );
-    
-    TEAGN_TRUE_OR_RETURN( ( input_box2.x1() >= 0 ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( ( input_box2.x2() >= 0 ),
-      "Invalid parameter : input_box2" )      
-    TEAGN_TRUE_OR_RETURN( ( input_box2.y1() >= 0 ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( ( input_box2.y2() >= 0 ),
-      "Invalid parameter : input_box2" )         
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.x1() <= 
-        ( input_image2_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.x2() <= 
-        ( input_image2_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box2" )       
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.y1() <= 
-        ( input_image2_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.y2() <= 
-        ( input_image2_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box2" )        
-  }    
-    
-  /* Checking pixel_x_relation */
-  
-  double pixel_x_relation = 1.0;
-  if( parameters.CheckParameter< double >( "pixel_x_relation" ) ) {
-    parameters.GetParameter( "pixel_x_relation", pixel_x_relation );
-    
-    TEAGN_TRUE_OR_RETURN( ( pixel_x_relation != 0.0 ),
-      "Invalid parameter : pixel_x_relation" )
-  }
-  
-  /* Checking pixel_y_relation */
-  
-  double pixel_y_relation = 1.0;
-  if( parameters.CheckParameter< double >( "pixel_y_relation" ) ) {
-    parameters.GetParameter( "pixel_y_relation", pixel_y_relation );
-    
-    TEAGN_TRUE_OR_RETURN( ( pixel_y_relation != 0.0 ),
-      "Invalid parameter : pixel_y_relation" )
-  }   
-  
-  /* Checking img1 data type */
-    
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( input_image1_ptr->params().dataType_[ input_channel1 ] != 
-    TeFLOAT ) && ( input_image1_ptr->params().dataType_[ 
-    input_channel1 ] != TeDOUBLE ) ),
-    "Invalid parameter: invalid input_image1 data type" );    
-  
-  /* Checking img2 data type */
-    
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( input_image2_ptr->params().dataType_[ input_channel2 ] != 
-    TeFLOAT ) && ( input_image2_ptr->params().dataType_[ 
-    input_channel2 ] != TeDOUBLE ) ),
-    "Invalid parameter: invalid input_image2 data type" );    
-  
-  return true;
-}
-
-
-void TePDIMIMatching::ResetState( const TePDIParameters& )
-{
-}
-
-
-bool TePDIMIMatching::loadImage( const TeThreadParameters& params )
-{
-  /* Retriving parameters */
-  
-  TePDITypes::TePDIRasterPtrType input_image_ptr;
-  TEAGN_TRUE_OR_THROW( params.retrive( "input_image_ptr", input_image_ptr ),
-    "Missing thread parameter" )
-    
-  ImgMatrixT* img_matrix_ptr;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_matrix_ptr", img_matrix_ptr ),
-    "Missing thread parameter" )
-    
-  double img_x_rescale_factor = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_x_rescale_factor", 
-    img_x_rescale_factor ), "Missing thread parameter" )
-    
-  double img_y_rescale_factor = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_y_rescale_factor", 
-    img_y_rescale_factor ), "Missing thread parameter" )    
-    
-  unsigned int input_channel = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "input_channel", 
-    input_channel ), "Missing thread parameter" )  
-    
-  unsigned int box_x_off = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_x_off", 
-    box_x_off ), "Missing thread parameter" )  
-
-  unsigned int box_y_off = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_y_off", 
-    box_y_off ), "Missing thread parameter" )      
-    
-  unsigned int box_nlines = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_nlines", 
-    box_nlines ), "Missing thread parameter" )      
-    
-  unsigned int box_ncols = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_ncols", 
-    box_ncols ), "Missing thread parameter" )   
-    
-  bool progress_enabled = false;   
-  TEAGN_TRUE_OR_THROW( params.retrive( "progress_enabled", 
-    progress_enabled ), "Missing thread parameter" ) 
-    
-  TeMutex* glb_mem_lock_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "glb_mem_lock_ptr", 
-    glb_mem_lock_ptr ), "Missing thread parameter" )   
-  TeMutex& glb_mem_lock = *glb_mem_lock_ptr;
-         
-  /* Rescaling image */
-  
-  unsigned int nlines = (unsigned int) ceil( 
-    ( (double)box_nlines ) * img_y_rescale_factor );
-  unsigned int ncols = (unsigned int) ceil( 
-    ( (double)box_ncols ) * img_x_rescale_factor );    
-  
-  glb_mem_lock.lock();
-  
-  if( ! img_matrix_ptr->Reset( nlines, ncols, 
-    TePDIMatrix< double >::AutoMemPol ) )
-  {
-    TEAGN_LOGERR( "Unable to allocate space for the loaded image" )
-    glb_mem_lock.unLock();
-    return false;
-  }
-    
-  glb_mem_lock.unLock();
-    
-  unsigned int curr_out_line = 0;
-  unsigned int curr_out_col = 0;
-  unsigned int curr_input_line = 0;
-  unsigned int curr_input_col = 0;
-  double value = 0;
-  
-  TePDIPIManager progress( "Rescaling image", nlines, progress_enabled );
-  
-  for( curr_out_line = 0 ; curr_out_line < nlines ; 
-    ++curr_out_line ) {
-    
-    curr_input_line = 
-      TeRound( 
-        ( 
-          ( (double)curr_out_line ) / img_y_rescale_factor
-        ) 
-        +
-        ( (double) box_y_off )
-      );
-    
-    for( curr_out_col = 0 ; curr_out_col < ncols ; 
-      ++curr_out_col ) {
-      
-      curr_input_col = 
-        TeRound( 
-          ( 
-            ( (double)curr_out_col ) / img_x_rescale_factor
-          ) 
-          +
-          ( (double) box_x_off )
-        );        
-      
-      if( input_image_ptr->getElement( curr_input_col, curr_input_line, value, 
-        input_channel ) ) {
-        
-        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = value;
-      } else {
-        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = 0;
-      }
-    }
-    
-    TEAGN_FALSE_OR_RETURN( progress.Increment(),
-      "Canceled by the user" );
-  }
-        
-  return true;
-}
-
-
-void TePDIMIMatching::matrix2Tiff( 
-  const ImgMatrixT& input_matrix,
-  const std::string& out_file_name,
-  const std::vector< TeCoord2D >& maxima_points )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_matrix.GetLines() > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_matrix.GetColumns() > 0 ), 
-    "Invalid matrix cols" )
-    
-  /* Finding min and max */
-  const double dbl_max = DBL_MAX;
-  const double dbl_min = (-1.0) * dbl_max;
-  double mtx_min = dbl_max;
-  double mtx_max = dbl_min;
-  double mtx_diff = 1.0;
-  
-  {
-    for( unsigned int line = 0 ; 
-      line < input_matrix.GetLines() ; ++line ) 
-    {
-      for( unsigned int col = 0 ; 
-        col < input_matrix.GetColumns() ; 
-        ++col ) 
-      {
-        if( ( input_matrix( line, col ) > dbl_min ) &&
-          ( input_matrix( line, col ) < dbl_max ) )
-        {
-          if( input_matrix( line, col ) < mtx_min )
-          {
-            mtx_min = input_matrix( line, col );
-          } 
-          
-          if( input_matrix( line, col ) > mtx_max )
-          {
-            mtx_max = input_matrix( line, col );
-          }
-        }
-      }  
-    }
-    
-    if( mtx_max != mtx_min )
-    {
-      mtx_diff = mtx_max - mtx_min;
-    } 
-  }
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_matrix.GetLines(),
-    input_matrix.GetColumns() );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  
-  for( unsigned int line = 0 ; 
-    line < input_matrix.GetLines() ; ++line ) {
-    for( unsigned int col = 0 ; 
-      col < input_matrix.GetColumns() ; 
-      ++col ) {
-
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        ( ( input_matrix( line, col ) - mtx_min ) / mtx_diff ) * 255.0, 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw maxima points */
-  
-  std::vector< TeCoord2D >::const_iterator maximas_it = 
-    maxima_points.begin();
-  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
-    maxima_points.end();
-    
-  while( maximas_it != maximas_it_end ) {
-    int x = TeRound( maximas_it->x() );
-    TEAGN_TRUE_OR_THROW( ( x < (int)input_matrix.GetColumns() ),
-      "Invalid maxima column" )
-    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-      "Invalid maxima column" )      
-    
-    int y = TeRound( maximas_it->y() );
-    TEAGN_TRUE_OR_THROW( ( y < (int)input_matrix.GetLines() ),
-      "Invalid maxima line" )
-    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-      "Invalid maxima line" )      
-    
-    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-      255.0, 0 ),
-      "Error writing raster" )
-      
-    ++maximas_it;
-  }  
-}
-
-
-void TePDIMIMatching::raster2Tiff( 
-  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-  unsigned int raster_channel,
-  const std::string& out_file_name,
-  const std::vector< TeCoord2D >& maxima_points,
-  const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
-  unsigned int tie_points_space )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
-    "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
-    "Invalid matrix cols" )
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
-    input_raster_ptr->params().ncols_ );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  double value = 0;
-  
-  for( int line = 0 ; 
-    line < input_raster_ptr->params().nlines_ ; ++line ) {
-    for( int col = 0 ; 
-      col < input_raster_ptr->params().ncols_ ; 
-      ++col ) {
-      
-      input_raster_ptr->getElement( col, line, value, 
-        raster_channel );
-      
-
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        value, 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw maxima points */
-  
-  std::vector< TeCoord2D >::const_iterator maximas_it = 
-    maxima_points.begin();
-  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
-    maxima_points.end();
-    
-  while( maximas_it != maximas_it_end ) {
-    int x = TeRound( maximas_it->x() );
-    TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
-      "Invalid maxima column" )
-    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-      "Invalid maxima column" )      
-    
-    int y = TeRound( maximas_it->y() );
-    TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
-      "Invalid maxima line" )
-    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-      "Invalid maxima line" )      
-    
-    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-      255.0, 0 ),
-      "Error writing raster" )
-      
-    ++maximas_it;
-  }
-  
-  /* Draw tie-points */
-  
-  if( out_tie_points_ptr.isActive() ) {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      int x = 0;
-      int y = 0;
-      
-      if( tie_points_space == 0 ) {
-         x = TeRound( it->pt1.x() );
-         y = TeRound( it->pt1.y() );
-      } else {
-         x = TeRound( it->pt2.x() );
-         y = TeRound( it->pt2.y() );
-      }
-      
-      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
-        "Invalid maxima column" )
-      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-        "Invalid maxima column" )      
-      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
-        "Invalid maxima line" )
-      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-        "Invalid maxima line" )      
-      
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-        255.0, 0 ),
-        "Error writing raster" )    
-    
-      ++it;
-    }
-  
-  }
-}
-
-
-bool TePDIMIMatching::checkTPs( 
-  const TeCoordPairVect& tpsvec ) const
-{
-  for( unsigned int idx1 = 0 ; idx1 < tpsvec.size() ; ++idx1 )
-  { 
-    for( unsigned int idx2 = idx1 + 1 ; idx2 < tpsvec.size() ; 
-      ++idx2 )
-    {
-      TEAGN_TRUE_OR_RETURN( 
-        (
-          (
-            ( tpsvec[ idx1 ].pt1.x() != tpsvec[ idx2 ].pt1.x() ) ||
-            ( tpsvec[ idx1 ].pt1.y() != tpsvec[ idx2 ].pt1.y() ) 
-          ) &&
-          (
-            ( tpsvec[ idx1 ].pt2.x() != tpsvec[ idx2 ].pt2.x() ) ||
-            ( tpsvec[ idx1 ].pt2.y() != tpsvec[ idx2 ].pt2.y() ) 
-          )
-        ),
-        "Invalid tie-point" +
-        std::string( " index1=" ) + Te2String( idx1 ) +
-        " [" + Te2String( tpsvec[ idx1 ].pt1.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx1 ].pt1.y(), 9 ) + " <-> " +
-        Te2String( tpsvec[ idx1 ].pt2.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx1 ].pt2.y(), 9 ) + "]" +
-        std::string( " index2=" ) + Te2String( idx2 ) +
-        " [" + Te2String( tpsvec[ idx2 ].pt1.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx2 ].pt1.y(), 9 ) + " <-> " +
-        Te2String( tpsvec[ idx2 ].pt2.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx2 ].pt2.y(), 9 ) + "]" );
-    }
-  }
-  
-  return true;
-}
-     
-        
-
+#include "TePDIMIMatching.hpp"
+
+#include "TePDIUtils.hpp"
+#include "TePDIMatrix.hpp"
+#include <TeThreadFunctor.h>
+#include <TeMutex.h>
+#include <TeCoord2D.h>
+
+#include <math.h>
+#include <limits.h>
+
+
+TePDIMIMatching::TePDIMIMatching()
+{
+}
+
+
+TePDIMIMatching::~TePDIMIMatching()
+{
+}
+
+
+bool TePDIMIMatching::RunImplementation()
+{
+  /* Retriving Parameters */
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  params_.GetParameter( "input_image1_ptr", input_image1_ptr );  
+  
+  unsigned int input_channel1 = 0;
+  params_.GetParameter( "input_channel1", input_channel1 );   
+  
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  params_.GetParameter( "input_image2_ptr", input_image2_ptr );  
+  
+  unsigned int input_channel2 = 0;
+  params_.GetParameter( "input_channel2", input_channel2 );   
+
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
+  params_.GetParameter( "out_tie_points_ptr", out_tie_points_ptr );   
+  
+  TeBox input_box1;
+  if( params_.CheckParameter< TeBox >( "input_box1" ) ) {
+    params_.GetParameter( "input_box1", input_box1 );
+  } else {
+    TeBox input_box1_proj = input_image1_ptr->params().box();
+    
+    TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, input_image1_ptr,
+      input_box1 );
+  }
+  
+  TeBox input_box2;
+  if( params_.CheckParameter< TeBox >( "input_box2" ) ) {
+    params_.GetParameter( "input_box2", input_box2 );
+  } else {
+    TeBox input_box2_proj = input_image2_ptr->params().box();
+    
+    TePDIUtils::MapCoords2RasterIndexes( input_box2_proj, input_image2_ptr,
+      input_box2 );
+  }  
+  
+  bool enable_multi_thread = false;
+  if( params_.CheckParameter< int >( "enable_multi_thread" ) ) {
+    enable_multi_thread = true;
+  }
+  
+  double pixel_x_relation = 1.0;
+  if( params_.CheckParameter< double >( "pixel_x_relation" ) ) {
+    params_.GetParameter( "pixel_x_relation", pixel_x_relation );
+  }
+  
+  double pixel_y_relation = 1.0;
+  if( params_.CheckParameter< double >( "pixel_y_relation" ) ) {
+    params_.GetParameter( "pixel_y_relation", pixel_y_relation );
+  }  
+  
+  unsigned int max_size_opt = 0;
+  if( params_.CheckParameter< unsigned int >( "max_size_opt" ) ) {
+    params_.GetParameter( "max_size_opt", max_size_opt );
+  }   
+  
+  /* Calculating the number of allowed threads - this process
+     not included into the count */
+     
+  unsigned int max_threads = 0;
+  std::vector< TeThreadFunctor::pointer > threads_vector;
+  
+  if( enable_multi_thread ) {
+    max_threads = TeGetPhysProcNumber() - 1;
+    
+    for( unsigned int index = 0 ; index < max_threads ; ++index ) {
+      TeThreadFunctor::pointer aux_thread_ptr( new TeThreadFunctor );
+    
+      threads_vector.push_back( aux_thread_ptr );
+    }
+  }
+  
+  /* Calculating the box postion related values */
+  
+  const unsigned int orig_box1_x_off = (unsigned int)input_box1.lowerLeft().x();
+  const unsigned int orig_box1_y_off = (unsigned int)input_box1.upperRight().y();
+  const unsigned int orig_box1_nlines = 1 + (unsigned int)ABS( input_box1.height() );
+  const unsigned int orig_box1_ncols = 1 + (unsigned int)ABS( input_box1.width() );
+  
+  const unsigned int orig_box2_x_off = (unsigned int)input_box2.lowerLeft().x();
+  const unsigned int orig_box2_y_off = (unsigned int)input_box2.upperRight().y();
+  const unsigned int orig_box2_nlines = 1 + (unsigned int)ABS( input_box2.height() );
+  const unsigned int orig_box2_ncols = 1 + (unsigned int)ABS( input_box2.width() );
+    
+  /* Calculating the rescale factors 
+     rescaled_image = original_image * rescale_factor */
+  
+  double img1_x_rescale_factor = 1.0;
+  double img1_y_rescale_factor = 1.0;
+  double img2_x_rescale_factor = 1.0;
+  double img2_y_rescale_factor = 1.0;
+  {
+    double mean_pixel_relation = ( pixel_x_relation + pixel_y_relation ) /
+      2.0;
+      
+    if( mean_pixel_relation > 1.0 ) {
+      /* The image 1 has poor resolution - bigger pixel resolution values -
+         and image 2 needs to be rescaled down */
+      
+      img2_x_rescale_factor = 1.0 / pixel_x_relation;
+      img2_y_rescale_factor = 1.0 / pixel_y_relation;
+    } else if( mean_pixel_relation < 1.0 ) {
+      /* The image 2 has poor resolution - bigger pixel resolution values
+        and image 1 needs to be rescaled down */
+      
+      img1_x_rescale_factor = pixel_x_relation;
+      img1_y_rescale_factor = pixel_y_relation;
+    }
+  } 
+  
+  if( max_size_opt )
+  {
+    double resc_box1_size = 
+      ( (double)orig_box1_nlines  ) * img1_y_rescale_factor *
+      ( (double)orig_box1_ncols ) * img1_x_rescale_factor;
+    double resc_box2_size = 
+      ( (double)orig_box2_nlines  ) * img2_y_rescale_factor *
+      ( (double)orig_box2_ncols ) * img2_x_rescale_factor;
+    double max_size_opt_double = (double)max_size_opt;
+    
+    if( ( resc_box1_size > max_size_opt_double ) || 
+      ( resc_box2_size > max_size_opt_double ) )
+    {
+      double opt_rescale_factor = 1.0;
+      
+      if( resc_box1_size > resc_box2_size )
+      {
+        opt_rescale_factor = sqrt( resc_box1_size / max_size_opt_double );
+      }
+      else
+      {
+        opt_rescale_factor = sqrt( resc_box2_size / max_size_opt_double );
+      }
+      
+      img1_x_rescale_factor *= opt_rescale_factor;
+      img1_y_rescale_factor *= opt_rescale_factor;
+      img2_x_rescale_factor *= opt_rescale_factor;
+      img2_y_rescale_factor *= opt_rescale_factor;
+    }
+  }
+  
+  /* Checking if the small matrix fits inside the bigger one */
+  
+  {
+    unsigned int resc_box1_nlines = (unsigned int) ceil( 
+      ( (double)orig_box1_nlines ) * img1_y_rescale_factor );
+    unsigned int resc_box1_ncols = (unsigned int) ceil( 
+      ( (double)orig_box1_ncols ) * img1_x_rescale_factor );     
+    unsigned int resc_box2_nlines = (unsigned int) ceil( 
+      ( (double)orig_box2_nlines ) * img2_y_rescale_factor );
+    unsigned int resc_box2_ncols = (unsigned int) ceil( 
+      ( (double)orig_box2_ncols ) * img2_x_rescale_factor );   
+        
+    const unsigned int m1size = resc_box1_nlines * 
+      resc_box1_ncols;
+    const unsigned int m2size = resc_box2_nlines * 
+      resc_box2_ncols;      
+      
+    if( m1size < m2size )
+    {
+      if( ( resc_box1_ncols > resc_box2_ncols ) ||
+        ( resc_box1_nlines > resc_box2_nlines ) )
+      {
+        return true;
+      }
+    } 
+    else
+    {
+      if( ( resc_box2_ncols > resc_box1_ncols ) ||
+        ( resc_box2_nlines > resc_box1_nlines ) )
+      {
+        return true;
+      }    
+    }
+  }  
+  
+  /* Loading images */
+  
+  TeMutex glb_mem_lock; //global memory lock
+  
+  ImgMatrixT img1_matrix;
+  ImgMatrixT img2_matrix;
+ 
+  {
+    TeThreadParameters tparams1;
+    tparams1.store( "input_image_ptr", input_image1_ptr );
+    tparams1.store( "img_matrix_ptr", &img1_matrix );
+    tparams1.store( "img_x_rescale_factor", img1_x_rescale_factor );
+    tparams1.store( "img_y_rescale_factor", img1_y_rescale_factor );
+    tparams1.store( "box_x_off", orig_box1_x_off );
+    tparams1.store( "box_y_off", orig_box1_y_off );
+    tparams1.store( "box_nlines", orig_box1_nlines );
+    tparams1.store( "box_ncols", orig_box1_ncols );
+    tparams1.store( "input_channel", input_channel1 );
+    tparams1.store( "progress_enabled", progress_enabled_ );
+    tparams1.store( "glb_mem_lock_ptr", &glb_mem_lock );
+    
+    TeThreadParameters tparams2;
+    tparams2.store( "input_image_ptr", input_image2_ptr );
+    tparams2.store( "img_matrix_ptr", &img2_matrix );
+    tparams2.store( "img_x_rescale_factor", img2_x_rescale_factor );
+    tparams2.store( "img_y_rescale_factor", img2_y_rescale_factor );
+    tparams2.store( "box_x_off", orig_box2_x_off );
+    tparams2.store( "box_y_off", orig_box2_y_off );
+    tparams2.store( "box_nlines", orig_box2_nlines );
+    tparams2.store( "box_ncols", orig_box2_ncols );
+    tparams2.store( "input_channel", input_channel2 );
+    tparams2.store( "progress_enabled", progress_enabled_ );
+    tparams2.store( "glb_mem_lock_ptr", &glb_mem_lock );
+  
+    if( max_threads > 0 ) {
+      threads_vector[ 0 ]->setStartFunctPtr( loadImage );
+      threads_vector[ 0 ]->setParameters( tparams1 );
+      threads_vector[ 0 ]->start();
+   
+      if( ! loadImage( tparams2 ) ) {
+        threads_vector[ 0 ]->waitToFinish();
+        
+        TEAGN_LOG_AND_RETURN( "Unable to load image 2" )
+      } else {
+        threads_vector[ 0 ]->waitToFinish();
+        
+        TEAGN_TRUE_OR_RETURN( threads_vector[ 0 ]->getReturnValue(),
+          "Unable to load image 1" )
+      }
+    } else {
+      TEAGN_TRUE_OR_RETURN( loadImage( tparams1 ),
+        "Error loading image 1" )
+      TEAGN_TRUE_OR_RETURN( loadImage( tparams2 ),
+        "Error loading image 2" )
+    }
+  }
+  
+/* remove */        
+//matrix2Tiff( img1_matrix, "img1_matrix.tif", 
+//  std::vector< TeCoord2D >() );
+//matrix2Tiff( img2_matrix, "img2_matrix.tif",
+//  std::vector< TeCoord2D >() );
+/* remove */  
+  
+  /* Correlating areas */
+  
+  out_tie_points_ptr->clear();
+  
+  {
+    /* Switching the big and small matrixes */
+    
+    const unsigned int m1size = img1_matrix.GetColumns() * 
+      img1_matrix.GetLines();
+    const unsigned int m2size = img2_matrix.GetColumns() * 
+      img2_matrix.GetLines();      
+    
+    ImgMatrixT* big_matrix_ptr = 0;
+    ImgMatrixT* small_matrix_ptr = 0;
+      
+    if( m1size < m2size )
+    {
+      big_matrix_ptr = &img2_matrix;
+      small_matrix_ptr = &img1_matrix;
+    } 
+    else
+    {
+      big_matrix_ptr = &img1_matrix;
+      small_matrix_ptr = &img2_matrix;
+    }
+    
+    ImgMatrixT& big_matrix = *big_matrix_ptr;
+    ImgMatrixT& small_matrix = *small_matrix_ptr;
+    
+    const unsigned int small_mtx_lines = small_matrix.GetLines();
+    const unsigned int small_mtx_cols = small_matrix.GetColumns();
+    const unsigned int big_mtx_lines = big_matrix.GetLines();
+    const unsigned int big_mtx_cols = big_matrix.GetColumns();    
+    const double elements_nmb = (double)( small_mtx_cols *
+      small_mtx_lines );    
+    
+    /* Generating small matrix histogram */
+    
+    std::vector< unsigned int > small_mtx_histo;
+    long int small_mtx_min = LONG_MAX;
+    long int small_mtx_max = (-1) * small_mtx_min;
+    unsigned int small_mtx_histo_size = 0;
+    {
+      unsigned int line = 0;
+      unsigned int col = 0;
+      double* small_matrix_line_ptr = 0;
+      long int elem = 0;
+      
+      for( ; line < small_mtx_lines ; ++line )
+      {
+        small_matrix_line_ptr = small_matrix[ line ];
+        
+        for( col = 0 ; col < small_mtx_cols ; ++col )
+        {
+          elem = (long int)small_matrix_line_ptr[ col ];
+          
+          if( elem > small_mtx_max )
+          {
+            small_mtx_max = elem;
+          }
+          
+          if( elem < small_mtx_min )
+          {
+            small_mtx_min = elem;
+          }
+          
+        }
+      }
+      
+      if( small_mtx_max >= small_mtx_min )
+      {
+        small_mtx_histo_size = (unsigned int)(
+          small_mtx_max - small_mtx_min + 1 );
+          
+        small_mtx_histo.resize( small_mtx_histo_size );
+        
+        for( line = 0 ; line < small_mtx_lines ; ++line )
+        {
+          small_matrix_line_ptr = small_matrix[ line ];
+          
+          for( col = 0 ; col < small_mtx_cols ; ++col )
+          {
+            elem = (long int)small_matrix_line_ptr[ col ];
+            elem -= small_mtx_min;
+            
+            small_mtx_histo[ elem ] += 1;
+          }
+        }
+      }      
+    }
+    
+    /* Calc the small matrix entropy */
+    
+    double small_mtx_entropy = 0.0;
+    const double log2 = log( (double)2.0 );
+    
+    {
+      double prob = 0.0;
+      const unsigned int small_mtx_histo_size = (unsigned int)
+        small_mtx_histo.size();
+
+      for( unsigned int hidx = 0 ; hidx < small_mtx_histo_size ; ++hidx )
+      {
+        prob = ( (double)(small_mtx_histo[ hidx ] ) ) / elements_nmb;
+        
+        if( prob > 0.0 ) {
+          small_mtx_entropy += ( prob * ( log( prob ) / log2 ) );
+        }        
+      }
+      
+      small_mtx_entropy *= (-1.0);
+    }
+
+    /* Pre-initiating big matrix histogram */
+    
+    std::vector< unsigned int > big_mtx_histo;
+    long int big_mtx_min = LONG_MAX;
+    long int big_mtx_max = (-1) * big_mtx_min;
+    unsigned int big_mtx_histo_size = 0;
+    {
+      unsigned int line = 0;
+      unsigned int col = 0;
+      double* big_matrix_line_ptr = 0;
+      long int elem = 0;
+      
+      for( ; line < big_mtx_lines ; ++line )
+      {
+        big_matrix_line_ptr = big_matrix[ line ];
+        
+        for( col = 0 ; col < big_mtx_cols ; ++col )
+        {
+          elem = (long int)big_matrix_line_ptr[ col ];
+          
+          if( elem > big_mtx_max )
+          {
+            big_mtx_max = elem;
+          }
+          
+          if( elem < big_mtx_min )
+          {
+            big_mtx_min = elem;
+          }
+          
+        }
+      }
+      
+      if( big_mtx_max >= big_mtx_min )
+      {
+        big_mtx_histo_size = (unsigned int)( 
+          big_mtx_max - big_mtx_min + 1 );
+          
+        big_mtx_histo.resize( big_mtx_histo_size );
+      }      
+    }
+
+    /* Pre-initiating joint histogram matrix */
+    
+    TePDIMatrix< unsigned int > joint_histo_mtx;
+    TEAGN_TRUE_OR_RETURN( joint_histo_mtx.Reset( small_mtx_histo_size,
+      big_mtx_histo_size, TePDIMatrix< unsigned int >::AutoMemPol ), 
+      "Error allocating joint histogram" )
+    
+    /* Iterating over each small matrix position over the bigger one */
+    
+    const unsigned int big_mtx_lines_bound = big_matrix.GetLines() -
+      small_mtx_lines;
+    const unsigned int big_mtx_cols_bound = big_matrix.GetColumns() -
+      small_mtx_cols;
+      
+    unsigned int big_mtx_line = 0;
+    unsigned  int big_mtx_col = 0;
+    unsigned int small_mtx_line = 0;
+    unsigned int small_mtx_col = 0;
+    
+    double* big_matrix_line_ptr = 0;
+    double* small_matrix_line_ptr = 0;
+    
+    double prob = 0.0;
+    double bmtx_crop_entropy = 0;
+    double curr_jentropy = 0;
+    double curr_mi = 0;
+    long int big_mtx_ele = 0;
+    long int small_mtx_ele = 0;
+    
+    double best_mi = DBL_MAX * ( -1.0 );
+    unsigned int best_mi_lin = 0;
+    unsigned int best_mi_col = 0;
+    
+    unsigned int big_mtx_histo_idx = 0;
+    unsigned int joint_histo_mtx_line = 0;
+    unsigned int joint_histo_mtx_col = 0;
+    unsigned int* joint_histo_line_ptr = 0;
+    
+    TePDIPIManager progress( "Looking for the best matching", 
+      big_mtx_lines_bound, progress_enabled_ );
+        
+    for( ; big_mtx_line < big_mtx_lines_bound ; ++big_mtx_line )
+    {
+      for( big_mtx_col = 0 ; big_mtx_col < big_mtx_cols_bound ; 
+        ++big_mtx_col )
+      {
+        /* Cleaning big_mtx_histo */
+        
+        for( big_mtx_histo_idx = 0 ; big_mtx_histo_idx < 
+          big_mtx_histo_size ; ++big_mtx_histo_idx )
+        {
+          big_mtx_histo[ big_mtx_histo_idx ] = 0;
+        }
+        
+        /* Cleaning joint_histo_mtx */
+        
+        for( joint_histo_mtx_line = 0; joint_histo_mtx_line <
+          small_mtx_histo_size ; ++joint_histo_mtx_line )
+        {
+          joint_histo_line_ptr = joint_histo_mtx[ 
+            joint_histo_mtx_line ];
+            
+          for( joint_histo_mtx_col = 0; joint_histo_mtx_col <
+            big_mtx_histo_size ; ++joint_histo_mtx_col )
+          {
+            joint_histo_line_ptr[ joint_histo_mtx_col ] = 0;
+          }
+        }
+          
+        /* Generating histograms for the current position */
+        
+        for( small_mtx_line = 0 ; small_mtx_line < small_mtx_lines ;
+          ++small_mtx_line )
+        {
+          big_matrix_line_ptr = big_matrix[ big_mtx_line + 
+            small_mtx_line ];
+          small_matrix_line_ptr = small_matrix[ small_mtx_line ];
+          
+          for( small_mtx_col = 0 ; small_mtx_col < small_mtx_cols ;
+            ++small_mtx_col )
+          {
+            big_mtx_ele = (long int)big_matrix_line_ptr[ big_mtx_col + 
+              small_mtx_col ];
+            small_mtx_ele = (long int)small_matrix_line_ptr[ 
+              small_mtx_col ];              
+              
+            big_mtx_histo_idx = big_mtx_ele - big_mtx_min;
+            big_mtx_histo[ big_mtx_histo_idx ] += 1;
+            
+            joint_histo_mtx_line = small_mtx_ele - small_mtx_min;
+            joint_histo_mtx( joint_histo_mtx_line, big_mtx_histo_idx ) 
+              += 1;
+          }
+        }
+
+        /* Calc the entropy for the current position */
+        
+        bmtx_crop_entropy = 0.0;
+        
+        for( big_mtx_histo_idx = 0 ; big_mtx_histo_idx < 
+          big_mtx_histo_size ; ++big_mtx_histo_idx )
+        {
+          prob = ( (double)( big_mtx_histo[ big_mtx_histo_idx ] ) ) / 
+            elements_nmb;
+          
+          if( prob > 0.0 ) {
+            bmtx_crop_entropy += ( prob * ( log( prob ) / log2 ) );
+          }        
+        }        
+        
+        bmtx_crop_entropy *= (-1.0);
+        
+        /* Calc the joint entropy for the current position */
+        
+        curr_jentropy = 0.0;
+        
+        for( joint_histo_mtx_line = 0; joint_histo_mtx_line <
+          small_mtx_histo_size ; ++joint_histo_mtx_line )
+        {
+          joint_histo_line_ptr = joint_histo_mtx[ 
+            joint_histo_mtx_line ];
+            
+          for( joint_histo_mtx_col = 0; joint_histo_mtx_col <
+            big_mtx_histo_size ; ++joint_histo_mtx_col )
+          {
+            prob = ( (double)( joint_histo_line_ptr[ 
+              joint_histo_mtx_col ] ) ) / elements_nmb;
+            
+            if( prob > 0.0 ) {
+              curr_jentropy += ( prob * ( log( prob ) / log2 ) );
+            }               
+          }
+        }        
+        
+        curr_jentropy *= (-1.0);
+        
+        /* Is this the best position ??? */
+        
+        curr_mi = small_mtx_entropy + bmtx_crop_entropy -
+          curr_jentropy;
+        
+        if( curr_mi > best_mi )
+        {
+          best_mi = curr_mi;
+          best_mi_col = big_mtx_col;
+          best_mi_lin = big_mtx_line;
+        } 
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" );
+    }
+    
+    /* Copy the best MI to user output var */
+    
+    double* best_mi_ptr = 0;
+    if( params_.CheckParameter< double* >( "best_mi_ptr" ) ) {
+      params_.GetParameter( "best_mi_ptr", best_mi_ptr );
+      (*best_mi_ptr) = best_mi;
+    }       
+    
+    /* Generating tie-points */
+    
+    TeCoord2D ulpoint_img1;
+    TeCoord2D urpoint_img1;
+    TeCoord2D llpoint_img1;
+    TeCoord2D lrpoint_img1;
+    
+    TeCoord2D ulpoint_img2;
+    TeCoord2D urpoint_img2;
+    TeCoord2D llpoint_img2;
+    TeCoord2D lrpoint_img2;
+    
+    if( m1size < m2size )
+    {
+      ulpoint_img1.setXY( 0 , 0 );
+      llpoint_img1.setXY( 0, img1_matrix.GetLines() - 1 );
+      urpoint_img1.setXY( img1_matrix.GetColumns() - 1 , 0 );
+      lrpoint_img1.setXY( img1_matrix.GetColumns() - 1,
+        img1_matrix.GetLines() - 1 );
+        
+      ulpoint_img2.setXY( best_mi_col, best_mi_lin );
+      llpoint_img2.setXY( 
+        best_mi_col,
+        best_mi_lin + img1_matrix.GetLines() - 1 );
+      urpoint_img2.setXY( 
+        best_mi_col + img1_matrix.GetColumns() - 1,
+        best_mi_lin );
+      lrpoint_img2.setXY( 
+        best_mi_col + img1_matrix.GetColumns() - 1,
+        best_mi_lin + img1_matrix.GetLines() - 1 );
+    } 
+    else
+    {
+      ulpoint_img2.setXY( 0 , 0 );
+      llpoint_img2.setXY( 0, img2_matrix.GetLines() - 1 );
+      urpoint_img2.setXY( img2_matrix.GetColumns() - 1 , 0 );
+      lrpoint_img2.setXY( img2_matrix.GetColumns() - 1,
+        img2_matrix.GetLines() - 1 );
+        
+      ulpoint_img1.setXY( best_mi_col, best_mi_lin );
+      llpoint_img1.setXY( 
+        best_mi_col,
+        best_mi_lin + img2_matrix.GetLines() - 1 );
+      urpoint_img1.setXY( 
+        best_mi_col + img2_matrix.GetColumns() - 1,
+        best_mi_lin );
+      lrpoint_img1.setXY( 
+        best_mi_col + img2_matrix.GetColumns() - 1,
+        best_mi_lin + img2_matrix.GetLines() - 1 );        
+    }
+    
+        
+    /* Bringing points into input_image1_ptr 
+       reference */
+       
+    ulpoint_img1.setXY( 
+      ( ulpoint_img1.x() / img1_x_rescale_factor ) +
+      ( (double)orig_box1_x_off ),
+      ( ulpoint_img1.y() / img1_y_rescale_factor ) +
+      ( (double)orig_box1_y_off ) );
+    urpoint_img1.setXY( 
+      ( urpoint_img1.x() / img1_x_rescale_factor ) +
+      ( (double)orig_box1_x_off ),
+      ( urpoint_img1.y() / img1_y_rescale_factor ) +
+      ( (double)orig_box1_y_off ) );
+    llpoint_img1.setXY( 
+      ( llpoint_img1.x() / img1_x_rescale_factor ) +
+      ( (double)orig_box1_x_off ),
+      ( llpoint_img1.y() / img1_y_rescale_factor ) +
+      ( (double)orig_box1_y_off ) );
+    lrpoint_img1.setXY( 
+      ( lrpoint_img1.x() / img1_x_rescale_factor ) +
+      ( (double)orig_box1_x_off ),
+      ( lrpoint_img1.y() / img1_y_rescale_factor ) +
+      ( (double)orig_box1_y_off ) );                  
+
+    /* Bringing points into input_image2_ptr 
+       reference */
+   
+    ulpoint_img2.setXY( 
+      ( ulpoint_img2.x() / img2_x_rescale_factor ) +
+      ( (double)orig_box2_x_off ),
+      ( ulpoint_img2.y() / img2_y_rescale_factor ) +
+      ( (double)orig_box2_y_off ) );
+    urpoint_img2.setXY( 
+      ( urpoint_img2.x() / img2_x_rescale_factor ) +
+      ( (double)orig_box2_x_off ),
+      ( urpoint_img2.y() / img2_y_rescale_factor ) +
+      ( (double)orig_box2_y_off ) );
+    llpoint_img2.setXY( 
+      ( llpoint_img2.x() / img2_x_rescale_factor ) +
+      ( (double)orig_box2_x_off ),
+      ( llpoint_img2.y() / img2_y_rescale_factor ) +
+      ( (double)orig_box2_y_off ) );
+    lrpoint_img2.setXY( 
+      ( lrpoint_img2.x() / img2_x_rescale_factor ) +
+      ( (double)orig_box2_x_off ),
+      ( lrpoint_img2.y() / img2_y_rescale_factor ) +
+      ( (double)orig_box2_y_off ) );  
+         
+    /* Generating output tie-points */
+    
+    out_tie_points_ptr->push_back( TeCoordPair( ulpoint_img1,
+      ulpoint_img2 ) );
+    out_tie_points_ptr->push_back( TeCoordPair( urpoint_img1,
+      urpoint_img2 ) );
+    out_tie_points_ptr->push_back( TeCoordPair( llpoint_img1,
+      llpoint_img2 ) );
+    out_tie_points_ptr->push_back( TeCoordPair( lrpoint_img1,
+      lrpoint_img2 ) );
+      
+    TEAGN_DEBUG_CONDITION( checkTPs( *out_tie_points_ptr ),
+      "Invalid tie-points" )                     
+  }
+  
+  return true;
+}
+
+
+bool TePDIMIMatching::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking input_image1_ptr */
+    
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_image1_ptr", input_image1_ptr ),
+    "Missing parameter: input_image1_ptr" );
+  TEAGN_TRUE_OR_RETURN( input_image1_ptr.isActive(),
+    "Invalid parameter: input_image1_ptr inactive" );
+  TEAGN_TRUE_OR_RETURN( input_image1_ptr->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: input_image1_ptr not ready" );
+    
+  /* Checking input_channel1 */
+    
+  unsigned int input_channel1 = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_channel1", input_channel1 ),
+    "Missing parameter: input_channel1" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( (int)input_channel1 ) < 
+    input_image1_ptr->params().nBands() ),
+    "Invalid parameter: input_channel1" );
+    
+  /* Checking input_image1_ptr */
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_image2_ptr", input_image2_ptr ),
+    "Missing parameter: input_image2_ptr" );
+  TEAGN_TRUE_OR_RETURN( input_image2_ptr.isActive(),
+    "Invalid parameter: input_image2_ptr inactive" );
+  TEAGN_TRUE_OR_RETURN( input_image2_ptr->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: input_image2_ptr not ready" );    
+    
+  /* Checking input_channel2 */
+    
+  unsigned int input_channel2 = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_channel2", input_channel2 ),
+    "Missing parameter: input_channel2" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( (int)input_channel2 ) < 
+    input_image2_ptr->params().nBands() ),
+    "Invalid parameter: input_channel2" );
+    
+  /* Checking out_tie_points_ptr */
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "out_tie_points_ptr", out_tie_points_ptr ),
+    "Missing parameter: out_tie_points_ptr" );
+  TEAGN_TRUE_OR_RETURN( out_tie_points_ptr.isActive(),
+    "Invalid parameter: out_tie_points_ptr inactive" );
+    
+  /* Checking input_box1 */
+    
+  TeBox input_box1;
+  if( parameters.CheckParameter< TeBox >( "input_box1" ) ) {
+    parameters.GetParameter( "input_box1", input_box1 );
+    
+    TEAGN_TRUE_OR_RETURN( ( input_box1.x1() >= 0 ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( ( input_box1.x2() >= 0 ),
+      "Invalid parameter : input_box1" )      
+    TEAGN_TRUE_OR_RETURN( ( input_box1.y1() >= 0 ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( ( input_box1.y2() >= 0 ),
+      "Invalid parameter : input_box1" )         
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.x1() <= 
+        ( input_image1_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.x2() <= 
+        ( input_image1_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box1" )       
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.y1() <= 
+        ( input_image1_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.y2() <= 
+        ( input_image1_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box1" )        
+  }
+    
+  /* Checking input_box2 */
+    
+  TeBox input_box2;
+  if( parameters.CheckParameter< TeBox >( "input_box2" ) ) {
+    parameters.GetParameter( "input_box2", input_box2 );
+    
+    TEAGN_TRUE_OR_RETURN( ( input_box2.x1() >= 0 ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( ( input_box2.x2() >= 0 ),
+      "Invalid parameter : input_box2" )      
+    TEAGN_TRUE_OR_RETURN( ( input_box2.y1() >= 0 ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( ( input_box2.y2() >= 0 ),
+      "Invalid parameter : input_box2" )         
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.x1() <= 
+        ( input_image2_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.x2() <= 
+        ( input_image2_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box2" )       
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.y1() <= 
+        ( input_image2_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.y2() <= 
+        ( input_image2_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box2" )        
+  }    
+    
+  /* Checking pixel_x_relation */
+  
+  double pixel_x_relation = 1.0;
+  if( parameters.CheckParameter< double >( "pixel_x_relation" ) ) {
+    parameters.GetParameter( "pixel_x_relation", pixel_x_relation );
+    
+    TEAGN_TRUE_OR_RETURN( ( pixel_x_relation != 0.0 ),
+      "Invalid parameter : pixel_x_relation" )
+  }
+  
+  /* Checking pixel_y_relation */
+  
+  double pixel_y_relation = 1.0;
+  if( parameters.CheckParameter< double >( "pixel_y_relation" ) ) {
+    parameters.GetParameter( "pixel_y_relation", pixel_y_relation );
+    
+    TEAGN_TRUE_OR_RETURN( ( pixel_y_relation != 0.0 ),
+      "Invalid parameter : pixel_y_relation" )
+  }   
+  
+  /* Checking img1 data type */
+    
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( input_image1_ptr->params().dataType_[ input_channel1 ] != 
+    TeFLOAT ) && ( input_image1_ptr->params().dataType_[ 
+    input_channel1 ] != TeDOUBLE ) ),
+    "Invalid parameter: invalid input_image1 data type" );    
+  
+  /* Checking img2 data type */
+    
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( input_image2_ptr->params().dataType_[ input_channel2 ] != 
+    TeFLOAT ) && ( input_image2_ptr->params().dataType_[ 
+    input_channel2 ] != TeDOUBLE ) ),
+    "Invalid parameter: invalid input_image2 data type" );    
+  
+  return true;
+}
+
+
+void TePDIMIMatching::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDIMIMatching::loadImage( const TeThreadParameters& params )
+{
+  /* Retriving parameters */
+  
+  TePDITypes::TePDIRasterPtrType input_image_ptr;
+  TEAGN_TRUE_OR_THROW( params.retrive( "input_image_ptr", input_image_ptr ),
+    "Missing thread parameter" )
+    
+  ImgMatrixT* img_matrix_ptr;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_matrix_ptr", img_matrix_ptr ),
+    "Missing thread parameter" )
+    
+  double img_x_rescale_factor = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_x_rescale_factor", 
+    img_x_rescale_factor ), "Missing thread parameter" )
+    
+  double img_y_rescale_factor = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_y_rescale_factor", 
+    img_y_rescale_factor ), "Missing thread parameter" )    
+    
+  unsigned int input_channel = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "input_channel", 
+    input_channel ), "Missing thread parameter" )  
+    
+  unsigned int box_x_off = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_x_off", 
+    box_x_off ), "Missing thread parameter" )  
+
+  unsigned int box_y_off = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_y_off", 
+    box_y_off ), "Missing thread parameter" )      
+    
+  unsigned int box_nlines = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_nlines", 
+    box_nlines ), "Missing thread parameter" )      
+    
+  unsigned int box_ncols = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_ncols", 
+    box_ncols ), "Missing thread parameter" )   
+    
+  bool progress_enabled = false;   
+  TEAGN_TRUE_OR_THROW( params.retrive( "progress_enabled", 
+    progress_enabled ), "Missing thread parameter" ) 
+    
+  TeMutex* glb_mem_lock_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "glb_mem_lock_ptr", 
+    glb_mem_lock_ptr ), "Missing thread parameter" )   
+  TeMutex& glb_mem_lock = *glb_mem_lock_ptr;
+         
+  /* Rescaling image */
+  
+  unsigned int nlines = (unsigned int) ceil( 
+    ( (double)box_nlines ) * img_y_rescale_factor );
+  unsigned int ncols = (unsigned int) ceil( 
+    ( (double)box_ncols ) * img_x_rescale_factor );    
+  
+  glb_mem_lock.lock();
+  
+  if( ! img_matrix_ptr->Reset( nlines, ncols, 
+    TePDIMatrix< double >::AutoMemPol ) )
+  {
+    TEAGN_LOGERR( "Unable to allocate space for the loaded image" )
+    glb_mem_lock.unLock();
+    return false;
+  }
+    
+  glb_mem_lock.unLock();
+    
+  unsigned int curr_out_line = 0;
+  unsigned int curr_out_col = 0;
+  unsigned int curr_input_line = 0;
+  unsigned int curr_input_col = 0;
+  double value = 0;
+  
+  TePDIPIManager progress( "Rescaling image", nlines, progress_enabled );
+  
+  for( curr_out_line = 0 ; curr_out_line < nlines ; 
+    ++curr_out_line ) {
+    
+    curr_input_line = 
+      TeRound( 
+        ( 
+          ( (double)curr_out_line ) / img_y_rescale_factor
+        ) 
+        +
+        ( (double) box_y_off )
+      );
+    
+    for( curr_out_col = 0 ; curr_out_col < ncols ; 
+      ++curr_out_col ) {
+      
+      curr_input_col = 
+        TeRound( 
+          ( 
+            ( (double)curr_out_col ) / img_x_rescale_factor
+          ) 
+          +
+          ( (double) box_x_off )
+        );        
+      
+      if( input_image_ptr->getElement( curr_input_col, curr_input_line, value, 
+        input_channel ) ) {
+        
+        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = value;
+      } else {
+        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = 0;
+      }
+    }
+    
+    TEAGN_FALSE_OR_RETURN( progress.Increment(),
+      "Canceled by the user" );
+  }
+        
+  return true;
+}
+
+
+void TePDIMIMatching::matrix2Tiff( 
+  const ImgMatrixT& input_matrix,
+  const std::string& out_file_name,
+  const std::vector< TeCoord2D >& maxima_points )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.GetLines() > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.GetColumns() > 0 ), 
+    "Invalid matrix cols" )
+    
+  /* Finding min and max */
+  const double dbl_max = DBL_MAX;
+  const double dbl_min = (-1.0) * dbl_max;
+  double mtx_min = dbl_max;
+  double mtx_max = dbl_min;
+  double mtx_diff = 1.0;
+  
+  {
+    for( unsigned int line = 0 ; 
+      line < input_matrix.GetLines() ; ++line ) 
+    {
+      for( unsigned int col = 0 ; 
+        col < input_matrix.GetColumns() ; 
+        ++col ) 
+      {
+        if( ( input_matrix( line, col ) > dbl_min ) &&
+          ( input_matrix( line, col ) < dbl_max ) )
+        {
+          if( input_matrix( line, col ) < mtx_min )
+          {
+            mtx_min = input_matrix( line, col );
+          } 
+          
+          if( input_matrix( line, col ) > mtx_max )
+          {
+            mtx_max = input_matrix( line, col );
+          }
+        }
+      }  
+    }
+    
+    if( mtx_max != mtx_min )
+    {
+      mtx_diff = mtx_max - mtx_min;
+    } 
+  }
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_matrix.GetLines(),
+    input_matrix.GetColumns() );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  
+  for( unsigned int line = 0 ; 
+    line < input_matrix.GetLines() ; ++line ) {
+    for( unsigned int col = 0 ; 
+      col < input_matrix.GetColumns() ; 
+      ++col ) {
+
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        ( ( input_matrix( line, col ) - mtx_min ) / mtx_diff ) * 255.0, 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw maxima points */
+  
+  std::vector< TeCoord2D >::const_iterator maximas_it = 
+    maxima_points.begin();
+  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
+    maxima_points.end();
+    
+  while( maximas_it != maximas_it_end ) {
+    int x = TeRound( maximas_it->x() );
+    TEAGN_TRUE_OR_THROW( ( x < (int)input_matrix.GetColumns() ),
+      "Invalid maxima column" )
+    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+      "Invalid maxima column" )      
+    
+    int y = TeRound( maximas_it->y() );
+    TEAGN_TRUE_OR_THROW( ( y < (int)input_matrix.GetLines() ),
+      "Invalid maxima line" )
+    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+      "Invalid maxima line" )      
+    
+    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+      255.0, 0 ),
+      "Error writing raster" )
+      
+    ++maximas_it;
+  }  
+}
+
+
+void TePDIMIMatching::raster2Tiff( 
+  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+  unsigned int raster_channel,
+  const std::string& out_file_name,
+  const std::vector< TeCoord2D >& maxima_points,
+  const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
+  unsigned int tie_points_space )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
+    "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
+    "Invalid matrix cols" )
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
+    input_raster_ptr->params().ncols_ );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  double value = 0;
+  
+  for( int line = 0 ; 
+    line < input_raster_ptr->params().nlines_ ; ++line ) {
+    for( int col = 0 ; 
+      col < input_raster_ptr->params().ncols_ ; 
+      ++col ) {
+      
+      input_raster_ptr->getElement( col, line, value, 
+        raster_channel );
+      
+
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        value, 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw maxima points */
+  
+  std::vector< TeCoord2D >::const_iterator maximas_it = 
+    maxima_points.begin();
+  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
+    maxima_points.end();
+    
+  while( maximas_it != maximas_it_end ) {
+    int x = TeRound( maximas_it->x() );
+    TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
+      "Invalid maxima column" )
+    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+      "Invalid maxima column" )      
+    
+    int y = TeRound( maximas_it->y() );
+    TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
+      "Invalid maxima line" )
+    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+      "Invalid maxima line" )      
+    
+    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+      255.0, 0 ),
+      "Error writing raster" )
+      
+    ++maximas_it;
+  }
+  
+  /* Draw tie-points */
+  
+  if( out_tie_points_ptr.isActive() ) {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      int x = 0;
+      int y = 0;
+      
+      if( tie_points_space == 0 ) {
+         x = TeRound( it->pt1.x() );
+         y = TeRound( it->pt1.y() );
+      } else {
+         x = TeRound( it->pt2.x() );
+         y = TeRound( it->pt2.y() );
+      }
+      
+      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
+        "Invalid maxima column" )
+      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+        "Invalid maxima column" )      
+      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
+        "Invalid maxima line" )
+      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+        "Invalid maxima line" )      
+      
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+        255.0, 0 ),
+        "Error writing raster" )    
+    
+      ++it;
+    }
+  
+  }
+}
+
+
+bool TePDIMIMatching::checkTPs( 
+  const TeCoordPairVect& tpsvec ) const
+{
+  for( unsigned int idx1 = 0 ; idx1 < tpsvec.size() ; ++idx1 )
+  { 
+    for( unsigned int idx2 = idx1 + 1 ; idx2 < tpsvec.size() ; 
+      ++idx2 )
+    {
+      TEAGN_TRUE_OR_RETURN( 
+        (
+          (
+            ( tpsvec[ idx1 ].pt1.x() != tpsvec[ idx2 ].pt1.x() ) ||
+            ( tpsvec[ idx1 ].pt1.y() != tpsvec[ idx2 ].pt1.y() ) 
+          ) &&
+          (
+            ( tpsvec[ idx1 ].pt2.x() != tpsvec[ idx2 ].pt2.x() ) ||
+            ( tpsvec[ idx1 ].pt2.y() != tpsvec[ idx2 ].pt2.y() ) 
+          )
+        ),
+        "Invalid tie-point" +
+        std::string( " index1=" ) + Te2String( idx1 ) +
+        " [" + Te2String( tpsvec[ idx1 ].pt1.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx1 ].pt1.y(), 9 ) + " <-> " +
+        Te2String( tpsvec[ idx1 ].pt2.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx1 ].pt2.y(), 9 ) + "]" +
+        std::string( " index2=" ) + Te2String( idx2 ) +
+        " [" + Te2String( tpsvec[ idx2 ].pt1.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx2 ].pt1.y(), 9 ) + " <-> " +
+        Te2String( tpsvec[ idx2 ].pt2.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx2 ].pt2.y(), 9 ) + "]" );
+    }
+  }
+  
+  return true;
+}
+     
+        
+
diff --git a/src/terralib/image_processing/TePDIMIMatching.hpp b/src/terralib/image_processing/TePDIMIMatching.hpp
index 69a64ce..f873af6 100644
--- a/src/terralib/image_processing/TePDIMIMatching.hpp
+++ b/src/terralib/image_processing/TePDIMIMatching.hpp
@@ -1,190 +1,190 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMIMATCHING_HPP
-  #define TEPDIMIMATCHING_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIMatrix.hpp"
-  
-  #include <TeThreadParameters.h>
-  
-  #include <map>
-
-  /**
-   * @brief Mutual Information image area matching ( only  
-   * offset distortion is supported ).
-   * @note Better used for searching a small image inside a big image.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @author Etore Marcari Junior <etore at dpi.inpe.br>
-   * @ingroup PDIMatchingAlgorithms
-   *
-   * @note The required parameters are:
-   *
-   * @param input_image1_ptr (TePDITypes::TePDIRasterPtrType) - 
-   * The input image 1.
-   * @param input_channel1 ( unsigned int ) - Band to process 
-   * from input_image1.
-   *
-   * @param input_image2_ptr (TePDITypes::TePDIRasterPtrType) - 
-   * The input image 2.
-   * @param input_channel2 ( unsigned int ) - Band to process 
-   * from input_image2.
-   *
-   * @param out_tie_points_ptr ( TeSharedPtr< TeCoordPairVect > ) - The 
-   * output tie- points 
-   * where TeCoordPair.pt1 are input_image1 matricial
-   * indexes and TeCoordPair.pt2 are input_image2 matricial
-   * indexes.
-   *
-   * @note The Optional parameters are:
-   *
-   * @param input_box1 ( TeBox ) - Box (image matrix coords) to process 
-   * from input_image1 ( the entire image will be used if no box
-   * was supplied )
-   *
-   * @param input_box2 ( TeBox ) - Box (image matrix coords) to process 
-   * from input_image2 ( the entire image will be used if no box
-   * was supplied )   
-   *
-   * @param enable_multi_thread (int) - If present (any value) 
-   * a multi-threaded processing will be used; Some TeDecoders do
-   * not support multi-thread so use it with cation
-   * (default: multi-thread disabled).
-   *
-   * @param pixel_x_relation (double) - The pixel resolution relation 
-   * pixel_x_relation = img1_pixel_res_x / img2_pixel_res_x (default=1.0);
-   *
-   * @param pixel_y_relation (double) - The pixel resolution relation 
-   * pixel_y_relation = img1_pixel_res_y / img2_pixel_res_y (default=1.0);   
-   *
-   * @param max_size_opt (unsigned int) - The maximum image box allowed
-   * size (size = pixels number = lines * columns); when the images pixels number
-   * exceed this value a downsample will be performed for optimization
-   * (default value=0 wich means optimization disabled).
-   *
-   * @param best_mi_ptr (double*) - A pointer to an output double 
-   * variable where to store the best found MI value.
-   */
-  class PDI_DLL TePDIMIMatching : public TePDIAlgorithm {
-    public :
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIMIMatching();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIMIMatching();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-    
-      /**
-       * @typedef TePDIMatrix< double > ImgMatrixT
-       * @brief A type definition for a image matrix.
-       */    
-      typedef TePDIMatrix< double > ImgMatrixT;
-    
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial 
-       * state.
-       */
-      void ResetState( const TePDIParameters& params );
-      
-      /**
-       * @brief A thread entry point to load raster data into
-       * a simple matrix.
-       * @param params The parameters needed for the thread 
-       * execution.
-       * @return true if OK, false on errors.
-       */
-      static bool loadImage( const TeThreadParameters& params );
-      
-      /**
-       * @brief Save the output matrix to a geotiff file.
-       * @param input_matrix Input matrix.
-       * @param out_file_name Output file name.
-       * @param maxima_points The maxima points to be
-       * filled with 255
-       */      
-      static void matrix2Tiff( 
-        const ImgMatrixT& input_matrix,
-        const std::string& out_file_name,
-        const std::vector< TeCoord2D >& maxima_points );
-        
-      /**
-       * @brief Save the output matrix to a geotiff file.
-       * @param input_raster Input raster.
-       * @param raster_channel Raster channel.
-       * @param out_file_name Output file name.
-       * @param maxima_points The maxima points to be drawed.
-       * @param out_tie_points_ptr The tie-points to be drawed.
-       * @param tie_points_space The tie-points space 
-       * (pt1 or pt2).
-       */      
-      static void raster2Tiff( 
-        const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-        unsigned int raster_channel,
-        const std::string& out_file_name,
-        const std::vector< TeCoord2D >& maxima_points,
-        const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
-        unsigned int tie_points_space );        
-        
-      /**
-       * @brief Check tie-points indexes for repeated values.
-       * @param maximas Tie-points vector.
-       * @return true if OK, false on errors.
-       */
-      bool checkTPs( 
-        const TeCoordPairVect& tpsvec ) const;         
-  };
-  
-/** @example TePDIMIMatching_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMIMATCHING_HPP
+  #define TEPDIMIMATCHING_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIMatrix.hpp"
+  
+  #include <TeThreadParameters.h>
+  
+  #include <map>
+
+  /**
+   * @brief Mutual Information image area matching ( only  
+   * offset distortion is supported ).
+   * @note Better used for searching a small image inside a big image.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @author Etore Marcari Junior <etore at dpi.inpe.br>
+   * @ingroup PDIMatchingAlgorithms
+   *
+   * @note The required parameters are:
+   *
+   * @param input_image1_ptr (TePDITypes::TePDIRasterPtrType) - 
+   * The input image 1.
+   * @param input_channel1 ( unsigned int ) - Band to process 
+   * from input_image1.
+   *
+   * @param input_image2_ptr (TePDITypes::TePDIRasterPtrType) - 
+   * The input image 2.
+   * @param input_channel2 ( unsigned int ) - Band to process 
+   * from input_image2.
+   *
+   * @param out_tie_points_ptr ( TeSharedPtr< TeCoordPairVect > ) - The 
+   * output tie- points 
+   * where TeCoordPair.pt1 are input_image1 matricial
+   * indexes and TeCoordPair.pt2 are input_image2 matricial
+   * indexes.
+   *
+   * @note The Optional parameters are:
+   *
+   * @param input_box1 ( TeBox ) - Box (image matrix coords) to process 
+   * from input_image1 ( the entire image will be used if no box
+   * was supplied )
+   *
+   * @param input_box2 ( TeBox ) - Box (image matrix coords) to process 
+   * from input_image2 ( the entire image will be used if no box
+   * was supplied )   
+   *
+   * @param enable_multi_thread (int) - If present (any value) 
+   * a multi-threaded processing will be used; Some TeDecoders do
+   * not support multi-thread so use it with cation
+   * (default: multi-thread disabled).
+   *
+   * @param pixel_x_relation (double) - The pixel resolution relation 
+   * pixel_x_relation = img1_pixel_res_x / img2_pixel_res_x (default=1.0);
+   *
+   * @param pixel_y_relation (double) - The pixel resolution relation 
+   * pixel_y_relation = img1_pixel_res_y / img2_pixel_res_y (default=1.0);   
+   *
+   * @param max_size_opt (unsigned int) - The maximum image box allowed
+   * size (size = pixels number = lines * columns); when the images pixels number
+   * exceed this value a downsample will be performed for optimization
+   * (default value=0 wich means optimization disabled).
+   *
+   * @param best_mi_ptr (double*) - A pointer to an output double 
+   * variable where to store the best found MI value.
+   */
+  class PDI_DLL TePDIMIMatching : public TePDIAlgorithm {
+    public :
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIMIMatching();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIMIMatching();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+    
+      /**
+       * @typedef TePDIMatrix< double > ImgMatrixT
+       * @brief A type definition for a image matrix.
+       */    
+      typedef TePDIMatrix< double > ImgMatrixT;
+    
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial 
+       * state.
+       */
+      void ResetState( const TePDIParameters& params );
+      
+      /**
+       * @brief A thread entry point to load raster data into
+       * a simple matrix.
+       * @param params The parameters needed for the thread 
+       * execution.
+       * @return true if OK, false on errors.
+       */
+      static bool loadImage( const TeThreadParameters& params );
+      
+      /**
+       * @brief Save the output matrix to a geotiff file.
+       * @param input_matrix Input matrix.
+       * @param out_file_name Output file name.
+       * @param maxima_points The maxima points to be
+       * filled with 255
+       */      
+      static void matrix2Tiff( 
+        const ImgMatrixT& input_matrix,
+        const std::string& out_file_name,
+        const std::vector< TeCoord2D >& maxima_points );
+        
+      /**
+       * @brief Save the output matrix to a geotiff file.
+       * @param input_raster Input raster.
+       * @param raster_channel Raster channel.
+       * @param out_file_name Output file name.
+       * @param maxima_points The maxima points to be drawed.
+       * @param out_tie_points_ptr The tie-points to be drawed.
+       * @param tie_points_space The tie-points space 
+       * (pt1 or pt2).
+       */      
+      static void raster2Tiff( 
+        const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+        unsigned int raster_channel,
+        const std::string& out_file_name,
+        const std::vector< TeCoord2D >& maxima_points,
+        const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
+        unsigned int tie_points_space );        
+        
+      /**
+       * @brief Check tie-points indexes for repeated values.
+       * @param maximas Tie-points vector.
+       * @return true if OK, false on errors.
+       */
+      bool checkTPs( 
+        const TeCoordPairVect& tpsvec ) const;         
+  };
+  
+/** @example TePDIMIMatching_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif
diff --git a/src/terralib/image_processing/TePDIMMIOMatching.cpp b/src/terralib/image_processing/TePDIMMIOMatching.cpp
index a1ccd00..2426b0b 100644
--- a/src/terralib/image_processing/TePDIMMIOMatching.cpp
+++ b/src/terralib/image_processing/TePDIMMIOMatching.cpp
@@ -1,2783 +1,3118 @@
-#include "TePDIMMIOMatching.hpp"
-
-#include "TePDIInterpolator.hpp"
-#include "TePDIUtils.hpp"
-#include "TePDITypes.hpp"
-
-#include <TeThreadJobsManager.h>
-#include <TeFunctionCallThreadJob.h>
-#include <TeCoord2D.h>
-#include <TeGTFactory.h>
-#include <TeDefines.h>
-#include <TeMutex.h>
-#include <TeUtils.h>
-
-#include <math.h>
-#include <limits.h>
-#include <TeRTree.h>
-
-#include <map>
-
-#define BICUBIC_MODULE( x ) ( ( x < 0 ) ? ( -1 * x ) : x )
-#define BICUBIC_K1( x , a ) ( ( ( a + 2 ) * x * x * x ) - \
-  ( ( a + 3 ) * x * x ) + 1 )
-#define BICUBIC_K2( x , a ) ( ( a * x * x * x ) - ( 5 * a * x * x ) + \
-  ( 8 * a * x ) - ( 4 * a ) )
-#define BICUBIC_RANGES(x,a) \
-  ( ( ( 0 <= x ) && ( x <= 1 ) ) ? \
-    BICUBIC_K1(x,a) \
-  : ( ( ( 1 < x ) && ( x <= 2 ) ) ? \
-      BICUBIC_K2(x,a) \
-    : 0 ) )
-#define BICUBIC_KERNEL( x , a ) BICUBIC_RANGES( BICUBIC_MODULE(x) , a )
-
-TePDIMMIOMatching::TePDIMMIOMatching()
-{
-  input_channel1_ = 0;
-  input_channel2_ = 0;
-  matching_method_ = NormCrossCorrMethod;
-}
-
-
-TePDIMMIOMatching::~TePDIMMIOMatching()
-{
-}
-
-bool TePDIMMIOMatching::CheckParameters( const TePDIParameters& parameters ) const
-{
-  /* Checking input_image1_ptr */
-    
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_image1_ptr", input_image1_ptr ),
-    "Missing parameter: input_image1_ptr" );
-  TEAGN_TRUE_OR_RETURN( input_image1_ptr.isActive(),
-    "Invalid parameter: input_image1_ptr inactive" );
-  TEAGN_TRUE_OR_RETURN( input_image1_ptr->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: input_image1_ptr not ready" );
-  
-  /* Checking matching method */
-  
-  FeatMatchingMethod matching_method = TePDIMMIOMatching::NormCrossCorrMethod;
-  if( parameters.CheckParameter< FeatMatchingMethod >( 
-    "matching_method" ) ) 
-  {
-    parameters.GetParameter( "matching_method", matching_method );
-    
-    TEAGN_TRUE_OR_RETURN( 
-      ( ( matching_method == TePDIMMIOMatching::EuclidianDistMethod ) ||
-      ( matching_method == TePDIMMIOMatching::NormCrossCorrMethod ) ),
-      "Invalid parameter : matching_method" );
-  }     
-    
-  /* Checking input_channel1 */
-    
-  unsigned int input_channel1 = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_channel1", input_channel1 ),
-    "Missing parameter: input_channel1" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( (int)input_channel1 ) < 
-    input_image1_ptr->params().nBands() ),
-    "Invalid parameter: input_channel1" );
-  
-    
-  /* Checking input_image1_ptr */
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_image2_ptr", input_image2_ptr ),
-    "Missing parameter: input_image2_ptr" );
-  TEAGN_TRUE_OR_RETURN( input_image2_ptr.isActive(),
-    "Invalid parameter: input_image2_ptr inactive" );
-  TEAGN_TRUE_OR_RETURN( input_image2_ptr->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: input_image2_ptr not ready" );    
-    
-  /* Checking input_channel2 */
-    
-  unsigned int input_channel2 = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_channel2", input_channel2 ),
-    "Missing parameter: input_channel2" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( (int)input_channel2 ) < 
-    input_image2_ptr->params().nBands() ),
-    "Invalid parameter: input_channel2" );
-    
-  /* Checking out_tie_points_ptr */
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "out_tie_points_ptr", out_tie_points_ptr ),
-    "Missing parameter: out_tie_points_ptr" );
-  TEAGN_TRUE_OR_RETURN( out_tie_points_ptr.isActive(),
-    "Invalid parameter: out_tie_points_ptr inactive" );
-    
-  /* Checking gt_params */
-    
-  TeGTParams gt_params;
-  if( parameters.CheckParameter< TeGTParams >( "gt_params" ) ) {
-    parameters.GetParameter( "gt_params", gt_params );
-    
-    TEAGN_TRUE_OR_RETURN( ( TeGTFactory::instance().find( 
-      gt_params.transformation_name_ ) != 
-      TeGTFactory::instance().end() ),
-      "Invalid parameter : gt_params" )
-  }   
-  
-  /* Checking out_gt_params */
-  
-  TeGTParams::pointer out_gt_params_ptr;
-  if( parameters.CheckParameter< TeGTParams::pointer >( 
-    "out_gt_params_ptr" ) ) 
-  {
-    parameters.GetParameter( "out_gt_params_ptr", out_gt_params_ptr );
-    
-    TEAGN_TRUE_OR_RETURN( ( out_gt_params_ptr.isActive() ),
-      "Invalid parameter : out_gt_params_ptr" )
-  }      
-    
-  /* Checking input_box1 */
-    
-  TeBox input_box1;
-  if( parameters.CheckParameter< TeBox >( "input_box1" ) ) {
-    parameters.GetParameter( "input_box1", input_box1 );
-    
-    TEAGN_TRUE_OR_RETURN( ( input_box1.x1() >= 0 ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( ( input_box1.x2() >= 0 ),
-      "Invalid parameter : input_box1" )      
-    TEAGN_TRUE_OR_RETURN( ( input_box1.y1() >= 0 ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( ( input_box1.y2() >= 0 ),
-      "Invalid parameter : input_box1" )         
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.x1() <= 
-        ( input_image1_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.x2() <= 
-        ( input_image1_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box1" )       
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.y1() <= 
-        ( input_image1_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.y2() <= 
-        ( input_image1_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box1" )        
-  }
-    
-  /* Checking input_box2 */
-    
-  TeBox input_box2;
-  if( parameters.CheckParameter< TeBox >( "input_box2" ) ) {
-    parameters.GetParameter( "input_box2", input_box2 );
-    
-    TEAGN_TRUE_OR_RETURN( ( input_box2.x1() >= 0 ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( ( input_box2.x2() >= 0 ),
-      "Invalid parameter : input_box2" )      
-    TEAGN_TRUE_OR_RETURN( ( input_box2.y1() >= 0 ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( ( input_box2.y2() >= 0 ),
-      "Invalid parameter : input_box2" )         
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.x1() <= 
-        ( input_image2_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.x2() <= 
-        ( input_image2_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box2" )       
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.y1() <= 
-        ( input_image2_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.y2() <= 
-        ( input_image2_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box2" )        
-  }    
-    
-  /* Checking max_tie_points */
-  
-  unsigned int max_tie_points = 0;
-  if( parameters.CheckParameter< unsigned int >( "max_tie_points" ) ) {
-    parameters.GetParameter( "max_tie_points", max_tie_points );
-    
-    TEAGN_TRUE_OR_RETURN( ( max_tie_points > 0 ),
-      "Invalid parameter : max_tie_points" )    
-  }
-  
-  /* Checking corr_window_width */
-  
-  unsigned int corr_window_width = 0;
-  if( parameters.CheckParameter< unsigned int >( 
-    "corr_window_width" ) ) {
-    
-    parameters.GetParameter( "corr_window_width", 
-      corr_window_width );
-      
-    TEAGN_TRUE_OR_RETURN( ( ( corr_window_width % 2 ) > 0 ),
-      "Invalid parameter : corr_window_width" )      
-    
-    TEAGN_TRUE_OR_RETURN( ( corr_window_width >= 13 ),
-      "Invalid parameter : corr_window_width" )
-  }    
-  
-  /* Checking moravec_window_width */
-  
-  unsigned int moravec_window_width = corr_window_width / 2;
-  if( parameters.CheckParameter< unsigned int >( 
-    "moravec_window_width" ) ) {
-    
-    parameters.GetParameter( "moravec_window_width", 
-      moravec_window_width );
-      
-    TEAGN_TRUE_OR_RETURN( ( ( moravec_window_width % 2 ) > 0 ),
-      "Invalid parameter : moravec_window_width" )      
-    
-    TEAGN_TRUE_OR_RETURN( ( moravec_window_width >= 3 ),
-      "Invalid parameter : corr_window_width" )
-  }   
-  
-  /* Checking pixel_x_relation */
-  
-  double pixel_x_relation = 1.0;
-  if( parameters.CheckParameter< double >( "pixel_x_relation" ) ) {
-    parameters.GetParameter( "pixel_x_relation", pixel_x_relation );
-    
-    TEAGN_TRUE_OR_RETURN( ( pixel_x_relation != 0.0 ),
-      "Invalid parameter : pixel_x_relation" )
-  }
-  
-  /* Checking pixel_y_relation */
-  
-  double pixel_y_relation = 1.0;
-  if( parameters.CheckParameter< double >( "pixel_y_relation" ) ) {
-    parameters.GetParameter( "pixel_y_relation", pixel_y_relation );
-    
-    TEAGN_TRUE_OR_RETURN( ( pixel_y_relation != 0.0 ),
-      "Invalid parameter : pixel_y_relation" )
-  }
-  
-  /* Checking variance_min_thrs */
-  
-  double variance_min_thrs = 0;
-  if( parameters.CheckParameter< double >( "variance_min_thrs" ) ) {
-    parameters.GetParameter( "variance_min_thrs", variance_min_thrs );
-    
-    TEAGN_TRUE_OR_RETURN( ( ( variance_min_thrs >= 0.0 ) &&
-      ( variance_min_thrs <= 3.0 ) ),
-      "Invalid parameter : variance_min_thrs" )
-  }  
-  
-  return true;
-}
-
-bool TePDIMMIOMatching::RunImplementation()
-{
-  /* Retriving Parameters */
-
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
-  params_.GetParameter( "out_tie_points_ptr", out_tie_points_ptr );
-  
-  double pixel_x_relation = 1.0;
-  if( params_.CheckParameter< double >( "pixel_x_relation" ) ) {
-    params_.GetParameter( "pixel_x_relation", pixel_x_relation );
-  }
-  
-  double pixel_y_relation = 1.0;
-  if( params_.CheckParameter< double >( "pixel_y_relation" ) ) {
-    params_.GetParameter( "pixel_y_relation", pixel_y_relation );
-  }    
-  
-  TeGTParams gt_params;
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 2.0;
-  gt_params.max_imap_error_ = 2.0;
-  gt_params.transformation_name_ = "affine";
-  if( params_.CheckParameter< TeGTParams >( "gt_params" ) ) {
-    params_.GetParameter( "gt_params", gt_params );
-  }
-  
-  bool enable_multi_thread = false;
-  if( params_.CheckParameter< int >( "enable_multi_thread" ) ) {
-    enable_multi_thread = true;
-  }
-  
-  bool skip_geom_filter = false;
-  if( params_.CheckParameter< int >( "skip_geom_filter" ) ) {
-    skip_geom_filter = true;
-  }  
-  
-  bool enable_upsampled_filter = false;
-  if( params_.CheckParameter< int >( "enable_upsampled_filter" ) ) {
-    enable_upsampled_filter = true;
-  }    
-  
-  unsigned int max_tie_points = 1000;
-  if( params_.CheckParameter< unsigned int >( "max_tie_points" ) ) {
-    params_.GetParameter( "max_tie_points", max_tie_points );
-  }    
-  
-  unsigned int corr_window_width = 13;
-  if( params_.CheckParameter< unsigned int >( 
-    "corr_window_width" ) ) {
-    
-    params_.GetParameter( "corr_window_width", corr_window_width );
-  }    
-  
-  unsigned int moravec_window_width = 11;
-  if( params_.CheckParameter< unsigned int >( "moravec_window_width" ) ) 
-  {
-    params_.GetParameter( "moravec_window_width", 
-      moravec_window_width );
-  }     
-  
-  double variance_min_thrs = 1.0;
-  if( params_.CheckParameter< double >( "variance_min_thrs" ) ) {
-    params_.GetParameter( "variance_min_thrs", variance_min_thrs );
-  }    
-  
-  // Do wee need to process what images ??
-  
-  const bool processImg1 = img1featMtx_.IsEmpty();
-  const bool processImg2 = img2featMtx_.IsEmpty();
-  
-  // The original boxes postion over the original images
-  
-  const unsigned int orig_box1_x_off = (unsigned int)
-    input_box1_.lowerLeft().x();
-  const unsigned int orig_box1_y_off = (unsigned int)
-    input_box1_.upperRight().y();
-  const unsigned int orig_box1_nlines = 1 + (unsigned int)
-    ABS( input_box1_.height() );
-  const unsigned int orig_box1_ncols = 1 + (unsigned int)
-    ABS( input_box1_.width() );
-  
-  const unsigned int orig_box2_x_off = (unsigned int)
-    input_box2_.lowerLeft().x();
-  const unsigned int orig_box2_y_off = (unsigned int)
-    input_box2_.upperRight().y();
-  const unsigned int orig_box2_nlines = 1 + (unsigned int)
-    ABS( input_box2_.height() );
-  const unsigned int orig_box2_ncols = 1 + (unsigned int)
-    ABS( input_box2_.width() );  
-  
-  /* Calculating the rescale factors 
-     factor = rescaled_orignal_image / original_image */
-  
-  double i1XRescFact = 1.0;
-  double i1YRescFact = 1.0;
-  double i2XRescFact = 1.0;
-  double i2YRescFact = 1.0;
-  {
-    double mean_pixel_relation = ( pixel_x_relation + pixel_y_relation ) /
-      2.0;
-      
-    if( mean_pixel_relation > 1.0 ) {
-      /* The image 1 has poor resolution - bigger pixel resolution values -
-         and image 2 needs to be rescaled down */
-      
-      i2XRescFact = 1.0 / pixel_x_relation;
-      i2YRescFact = 1.0 / pixel_y_relation;
-    } else if( mean_pixel_relation < 1.0 ) {
-      /* The image 2 has poor resolution - bigger pixel resolution values
-        and image 1 needs to be rescaled down */
-      
-      i1XRescFact = pixel_x_relation;
-      i1YRescFact = pixel_y_relation;
-    }
-  }   
-  
-  /* Calculating the max tie-points to be generated for each image
-     trying to keep the same tie-point density for both images */
-     
-  unsigned int img1MaxTps = max_tie_points;
-  unsigned int img2MaxTps = max_tie_points;
-  
-  {
-    double resc_box1_nlines =  ( (double)orig_box1_nlines  ) * 
-      i1YRescFact;
-    double resc_box1_ncols =  ( (double)orig_box1_ncols ) * 
-      i1XRescFact;
-    double resc_box2_nlines =  ( (double)orig_box2_nlines  ) * 
-      i2YRescFact;
-    double resc_box2_ncols =  ( (double)orig_box2_ncols ) * 
-      i2XRescFact;
-      
-    double resc_box1_area = resc_box1_nlines * resc_box1_ncols;
-    double resc_box2_area = resc_box2_nlines * resc_box2_ncols;
-      
-    if( resc_box1_area > resc_box2_area )
-    {
-      img1MaxTps = (unsigned int)( 
-        resc_box1_area / 
-        ( resc_box2_area / ( (double)max_tie_points ) ) );
-    }
-    else if( resc_box1_area < resc_box2_area )
-    {
-      img2MaxTps = (unsigned int)( 
-        resc_box2_area / 
-        ( resc_box1_area / ( (double)max_tie_points ) ) ); 
-    }
-  }
-  
-  // Moravec specific variables
-  
-  // factor = original_image / downsampled_image
-  const double moravecDownSampleFactor = 1.5;
-  // factor = original_image / upsampled_image
-  const double moravecUpSampleFactor = 0.5;
-  
-  const double moravecRepeatabilityMinTolerance = 3.0;
-
-  unsigned int moravecDSWindowSize = (unsigned int)( 
-    moravec_window_width / moravecDownSampleFactor );
-  if( ( moravecDSWindowSize % 2 ) == 0 ) ++moravecDSWindowSize;
-  TEAGN_DEBUG_CONDITION( moravecDSWindowSize > 2, 
-    "Invalid moravecDSWindowSize ")
-
-  unsigned int moravecUSWindowSize = (unsigned int)( 
-    moravec_window_width / moravecUpSampleFactor );
-  if( ( moravecUSWindowSize % 2 ) == 0 ) ++moravecUSWindowSize;
-  TEAGN_DEBUG_CONDITION( moravecUSWindowSize > 2, 
-    "Invalid moravecUSWindowSize ")
-       
-  /* Calculating the number of allowed threads - this process
-     not included into the count */
-  
-  if( enable_multi_thread )
-  {
-    jobsMan_.setAutoMaxSimulJobs();
-  }
-  else
-  {
-    jobsMan_.setMaxSimulJobs( 0 );
-  }
-  
- /* Loading images */
-  
-  TeSharedPtr< TePDIMtxDoubleAdptInt > img1_matrix_ptr;
-  TeSharedPtr< TePDIMtxDoubleAdptInt > img1_matrix_ds_ptr; // Downsampled version
-  TeSharedPtr< TePDIMtxDoubleAdptInt > img1_matrix_us_ptr; // Upsampled version  
-
-  if( processImg1 )
-  {
-    createImgMatrix( input_image1_ptr_->params().dataType_[input_channel1_],
-      img1_matrix_ptr );
-    createImgMatrix( input_image1_ptr_->params().dataType_[input_channel1_],
-      img1_matrix_ds_ptr );
-    if( enable_upsampled_filter )
-    {
-      createImgMatrix( input_image1_ptr_->params().dataType_[input_channel1_],
-        img1_matrix_us_ptr );
-    }
-  }
-  
-  TeSharedPtr< TePDIMtxDoubleAdptInt > img2_matrix_ptr;
-  TeSharedPtr< TePDIMtxDoubleAdptInt > img2_matrix_ds_ptr; // Downsampled version
-  TeSharedPtr< TePDIMtxDoubleAdptInt > img2_matrix_us_ptr; // Upsampled version
-
-  if( processImg2 )
-  {
-    createImgMatrix( input_image2_ptr_->params().dataType_[input_channel2_],
-      img2_matrix_ptr );
-    createImgMatrix( input_image2_ptr_->params().dataType_[input_channel2_],
-      img2_matrix_ds_ptr );
-    if( enable_upsampled_filter )
-    {
-      createImgMatrix( input_image2_ptr_->params().dataType_[input_channel2_],
-        img2_matrix_us_ptr );  
-    }
-  }
- 
-  {
-    LoadImageParams img1pars;
-    img1pars.input_image_ptr_ = input_image1_ptr_;
-    img1pars.input_image_channel_ = input_channel1_;
-    img1pars.img_matrix_ptr_ = img1_matrix_ptr.nakedPointer();
-    img1pars.img_matrix_ds_ptr_ = img1_matrix_ds_ptr.nakedPointer();
-    img1pars.img_matrix_us_ptr_ = img1_matrix_us_ptr.nakedPointer();
-    img1pars.in_box_x_off_ = orig_box1_x_off;
-    img1pars.in_box_y_off_ = orig_box1_y_off;
-    img1pars.in_box_nlines_ = orig_box1_nlines;
-    img1pars.in_box_ncols_ = orig_box1_ncols;
-    img1pars.progress_enabled_ = progress_enabled_;
-    img1pars.glb_mem_lock_ptr_ = &globalMutex_;
-    img1pars.origImgXRescFact_ = i1XRescFact;
-    img1pars.origImgYRescFact_ = i1YRescFact;
-    img1pars.moravecDownSampleFactor_ = moravecDownSampleFactor;
-    img1pars.moravecUpSampleFactor_ = moravecUpSampleFactor;
-    img1pars.returnValue_ = true;
-    img1pars.generateUpsampledImage_ = enable_upsampled_filter;
-    
-    LoadImageParams img2pars = img1pars;
-    img2pars.input_image_ptr_ = input_image2_ptr_;
-    img1pars.input_image_channel_ = input_channel2_;
-    img2pars.img_matrix_ptr_ = img2_matrix_ptr.nakedPointer();
-    img2pars.img_matrix_ds_ptr_ = img2_matrix_ds_ptr.nakedPointer();
-    img2pars.img_matrix_us_ptr_ = img2_matrix_us_ptr.nakedPointer();
-    img2pars.in_box_x_off_ = orig_box2_x_off;
-    img2pars.in_box_y_off_ = orig_box2_y_off;
-    img2pars.in_box_nlines_ = orig_box2_nlines;
-    img2pars.in_box_ncols_ = orig_box2_ncols;    
-    img2pars.origImgXRescFact_ = i2XRescFact;
-    img2pars.origImgYRescFact_ = i2YRescFact;
-    
-    if( processImg1 )
-    {    
-      TeFunctionCallThreadJob job1;
-      job1.jobFunc_ = loadImage;
-      job1.jobFuncParsPtr_ = (void*)&img1pars;
-      jobsMan_.executeJob( job1 );
-    }
-
-    if( processImg2 )
-    {    
-      TeFunctionCallThreadJob job2;
-      job2.jobFunc_ = loadImage;
-      job2.jobFuncParsPtr_ = (void*)&img2pars;
-      jobsMan_.executeJob( job2 );
-    }
-    
-    jobsMan_.waitAllToFinish();
-    
-    TEAGN_TRUE_OR_RETURN( img1pars.returnValue_, "Error loading image" )
-    TEAGN_TRUE_OR_RETURN( img2pars.returnValue_, "Error loading image" )
-  }  
-
-/* 
-matrix2Tiff( *img1_matrix_ptr, "img1_matrix_ptr_loaded.tif" );
-matrix2Tiff( *img1_matrix_ds_ptr, "img1_matrix_ds_ptr_loaded.tif" );
-matrix2Tiff( *img1_matrix_us_ptr, "img1_matrix_us_ptr_loaded.tif" );
-matrix2Tiff( *img2_matrix_ptr, "img2_matrix_ptr_loaded.tif" );
-matrix2Tiff( *img2_matrix_ds_ptr, "img2_matrix_ds_ptr_loaded.tif" );
-matrix2Tiff( *img2_matrix_us_ptr, "img2_matrix_us_ptr_loaded.tif" );
-*/
-  
-  // Extracting maximas from all images
-  
-  MaximasListT img1ds_maximas_list;
-  MaximasListT img1us_maximas_list;
-  MaximasListT img2ds_maximas_list;
-  MaximasListT img2us_maximas_list;
-  
-  {
-    // Creating job execution parameters 
-    
-    TeFunctionCallThreadJob dummyJob;
-    dummyJob.jobFunc_ = extractLocalMaximas;
-    
-    ExtractLocalMaximasParams img1pars;
-    img1pars.imgMatrixPtr_ = img1_matrix_ptr.nakedPointer();
-    img1pars.outMaximasListPtr_ = &img1_maximas_list_;
-    img1pars.moravecWindowSize_ = moravec_window_width;
-    img1pars.maximasNumber_ = img1MaxTps;
-    img1pars.moravecMinVarianceThreshold_ = variance_min_thrs;
-    img1pars.seachSubImagesNmb_ = 9;
-    img1pars.returnValue_ = true;
-    img1pars.progressEnabled_ = progress_enabled_;
-    img1pars.glbMutexptr_ = &globalMutex_;
-    
-    ExtractLocalMaximasParams img1dspars = img1pars;
-    img1dspars.imgMatrixPtr_ = img1_matrix_ds_ptr.nakedPointer();
-    img1dspars.outMaximasListPtr_ = &img1ds_maximas_list;
-    img1dspars.moravecWindowSize_ = moravecDSWindowSize;
-
-    ExtractLocalMaximasParams img1uspars = img1pars;
-    img1uspars.imgMatrixPtr_ = img1_matrix_us_ptr.nakedPointer();
-    img1uspars.outMaximasListPtr_ = &img1us_maximas_list;
-    img1uspars.moravecWindowSize_ = moravecUSWindowSize;
-    
-    ExtractLocalMaximasParams img2pars = img1pars;;
-    img2pars.imgMatrixPtr_ = img2_matrix_ptr.nakedPointer();
-    img2pars.outMaximasListPtr_ = &img2_maximas_list_;
-    img2pars.maximasNumber_ = img2MaxTps;
-    
-    ExtractLocalMaximasParams img2dspars = img2pars;
-    img2dspars.imgMatrixPtr_ = img2_matrix_ds_ptr.nakedPointer();
-    img2dspars.outMaximasListPtr_ = &img2ds_maximas_list;
-    img2dspars.moravecWindowSize_ = moravecDSWindowSize;
-
-    ExtractLocalMaximasParams img2uspars = img2pars;
-    img2uspars.imgMatrixPtr_ = img2_matrix_us_ptr.nakedPointer();
-    img2uspars.outMaximasListPtr_ = &img2us_maximas_list;
-    img2uspars.moravecWindowSize_ = moravecUSWindowSize;
-    
-    // Starting jobs
-    
-    if( processImg1 )
-    {
-      dummyJob.jobFuncParsPtr_ = (void*)&img1pars;
-      jobsMan_.executeJob( dummyJob );     
-      
-      dummyJob.jobFuncParsPtr_ = (void*)&img1dspars;
-      jobsMan_.executeJob( dummyJob ); 
-      
-      if( enable_upsampled_filter )
-      {
-        dummyJob.jobFuncParsPtr_ = (void*)&img1uspars;
-        jobsMan_.executeJob( dummyJob ); 
-      }
-    }
-    
-    if( processImg2 )
-    {
-      dummyJob.jobFuncParsPtr_ = (void*)&img2pars;
-      jobsMan_.executeJob( dummyJob );     
-      
-      dummyJob.jobFuncParsPtr_ = (void*)&img2dspars;
-      jobsMan_.executeJob( dummyJob );   
-      
-      if( enable_upsampled_filter )
-      {
-        dummyJob.jobFuncParsPtr_ = (void*)&img2uspars;
-        jobsMan_.executeJob( dummyJob );   
-      }
-    }
-    
-    // Waiting all jobs to finish
-    
-    jobsMan_.waitAllToFinish();
-    
-    TEAGN_TRUE_OR_RETURN( img1pars.returnValue_, 
-      "Error loocking for maximas" )
-    TEAGN_TRUE_OR_RETURN( img1dspars.returnValue_,
-      "Error loocking for maximas" )
-    TEAGN_TRUE_OR_RETURN( img1uspars.returnValue_, 
-      "Error loocking for maximas" )
-    TEAGN_TRUE_OR_RETURN( img2pars.returnValue_, 
-      "Error loocking for maximas" )
-    TEAGN_TRUE_OR_RETURN( img2dspars.returnValue_, 
-      "Error loocking for maximas" )
-    TEAGN_TRUE_OR_RETURN( img2uspars.returnValue_, 
-      "Error loocking for maximas" )
-  }
-  
-/*
-matrix2Tiff( *img1_matrix_ptr, "img1_matrix_ptr_max.tif",
-  img1_maximas_list_ );
-matrix2Tiff( *img1_matrix_ds_ptr, "img1_matrix_ds_ptr_max.tif",
-  img1ds_maximas_list );
-matrix2Tiff( *img1_matrix_us_ptr, "img1_matrix_us_ptr_max.tif",
-  img1us_maximas_list );
-matrix2Tiff( *img2_matrix_ptr, "img2_matrix_ptr_max.tif",
-  img2_maximas_list_ );
-matrix2Tiff( *img2_matrix_ds_ptr, "img2_matrix_ds_ptr_max.tif",
-  img2ds_maximas_list );
-matrix2Tiff( *img2_matrix_us_ptr, "img2_matrix_us_ptr_max.tif",
-  img2us_maximas_list );  
-*/
-
-  // Applying moravec repeatability filter 
-  
-  if( processImg1 )
-  {
-    MaximasListT auxList;
-    
-    moravecRepeatability( img1_maximas_list_, img1ds_maximas_list,
-      img1_matrix_ds_ptr->getNCols(),
-      img1_matrix_ds_ptr->getNLines(), 
-      moravecRepeatabilityMinTolerance / moravecDownSampleFactor, 
-      moravecDownSampleFactor, auxList );
-    
-    if( enable_upsampled_filter )
-    {
-      moravecRepeatability( auxList, img1us_maximas_list,
-        img1_matrix_us_ptr->getNCols(),
-        img1_matrix_us_ptr->getNLines(), 
-        moravecRepeatabilityMinTolerance / moravecUpSampleFactor, 
-        moravecUpSampleFactor, img1_maximas_list_ );    
-    }
-    else
-    {
-      img1_maximas_list_ = auxList;
-    }
-  }
-  
-  if( processImg2 )
-  {
-    MaximasListT auxList;
-    
-    moravecRepeatability( img2_maximas_list_, img2ds_maximas_list,
-      img2_matrix_ds_ptr->getNCols(),
-      img2_matrix_ds_ptr->getNLines(), 
-      moravecRepeatabilityMinTolerance / moravecDownSampleFactor, 
-      moravecDownSampleFactor, auxList );
-    
-    if( enable_upsampled_filter )
-    {
-      moravecRepeatability( auxList, img2us_maximas_list,
-        img2_matrix_us_ptr->getNCols(),
-        img2_matrix_us_ptr->getNLines(), 
-        moravecRepeatabilityMinTolerance / moravecUpSampleFactor, 
-        moravecUpSampleFactor, img2_maximas_list_ );
-    }
-    else
-    {
-      img2_maximas_list_ = auxList;
-    }
-  }
-/*  
-matrix2Tiff( *img1_matrix_ptr, "img1_matrix_ptr_max_repeat.tif",
-  img1_maximas_list_ );
-matrix2Tiff( *img2_matrix_ptr, "img2_matrix_ptr_max_repeat.tif",
-  img2_maximas_list_ );
-*/
-  
-  img1us_maximas_list.clear();
-  img1ds_maximas_list.clear();  
-  img2us_maximas_list.clear();
-  img2ds_maximas_list.clear();
-  
-  img1_matrix_ds_ptr.reset();
-  img1_matrix_us_ptr.reset();
-  img2_matrix_ds_ptr.reset();
-  img2_matrix_us_ptr.reset();  
-  
-  // filtering out points closer to images borders to avoid
-  // correlation windows generation errors 
-
-  
-  {
-    /* The radius of a feature window rotated by 90 degrees. 
-     * over the input image */
-    const unsigned int winRadius = (unsigned int)
-      (
-        ceil( 
-          sqrt( 
-            2 
-            * 
-            ( 
-              ( (double)corr_window_width ) 
-              *
-              ( (double)corr_window_width )
-            )
-          ) / 2.0
-        )
-      );
-    
-    unsigned int img1FistValidLine = winRadius;
-    unsigned int img1FistValidCol = winRadius;
-    unsigned int img2FistValidLine = winRadius;
-    unsigned int img2FistValidCol = winRadius;
-    
-    // Removing maximas outside the image 1 allowed bondaries
-    
-    if( processImg1 )
-    {
-      unsigned int img1LinesBound = img1_matrix_ptr->getNLines() - winRadius;
-      unsigned int img1ColsBound = img1_matrix_ptr->getNCols() - winRadius;
-    
-      MaximasListT::iterator maxIt = img1_maximas_list_.begin();
-      MaximasListT::iterator maxItEnd = img1_maximas_list_.end();
-      MaximasListT::iterator maxAuxIt;
-      
-      while( maxIt != maxItEnd )
-      {
-        if( ( maxIt->first < img1FistValidCol ) ||
-          ( maxIt->first >= img1ColsBound ) || 
-          ( maxIt->second < img1FistValidLine ) ||
-          ( maxIt->second >= img1LinesBound ) )
-        {
-          maxAuxIt = maxIt;
-          ++maxIt;
-          img1_maximas_list_.erase( maxAuxIt );
-        }
-        else
-        {
-          ++maxIt;
-        }
-      }
-    }
-    
-    // Removing maximas outside the image 2 allowed bondaries
-    
-    if( processImg2 )
-    {
-      unsigned int img2LinesBound = img2_matrix_ptr->getNLines() - winRadius;
-      unsigned int img2ColsBound = img2_matrix_ptr->getNCols() - winRadius;
-    
-      MaximasListT::iterator maxIt = img2_maximas_list_.begin();
-      MaximasListT::iterator maxItEnd = img2_maximas_list_.end();
-      MaximasListT::iterator maxAuxIt;
-      
-      while( maxIt != maxItEnd )
-      {
-        if( ( maxIt->first < img2FistValidCol ) ||
-          ( maxIt->first >= img2ColsBound ) || 
-          ( maxIt->second < img2FistValidLine ) ||
-          ( maxIt->second >= img2LinesBound ) )
-        {
-          maxAuxIt = maxIt;
-          ++maxIt;
-          img2_maximas_list_.erase( maxAuxIt );
-        }
-        else
-        {
-          ++maxIt;
-        }
-      }
-    }
-  }
-  
-/*
-matrix2Tiff( *img1_matrix_ptr, "img1_matrix_ptr_max_outremoved.tif",
-  img1_maximas_list_ );
-matrix2Tiff( *img2_matrix_ptr, "img2_matrix_ptr_max_outremoved.tif",
-  img2_maximas_list_ );  
-*/
-  
-  /* Generating features matrix */
-  
-  {
-    GenerateCorrelationFeaturesParams params1;
-    
-    switch( matching_method_ )
-    {
-      case EuclidianDistMethod :
-      {
-        params1.normalizeWindows_ = true;
-        break;
-      }      
-      case NormCrossCorrMethod :
-      {
-        params1.normalizeWindows_ = true;
-        break;
-      }
-      default :
-      {
-        TEAGN_LOG_AND_THROW( "Invalid correlation method" );
-        break;
-      }
-    }
-    
-    params1.imgMatrixPtr_ = img1_matrix_ptr.nakedPointer();
-    params1.inMaximasListPtr_ = &img1_maximas_list_;
-    params1.featMtxPtr_ = &img1featMtx_;
-    params1.returnValue_ = true;
-    params1.glbMemLockPtr_ = &globalMutex_;
-    params1.corrWindowsWidth_ = corr_window_width;
-    params1.progressEnabled_ = progress_enabled_;
-    
-    GenerateCorrelationFeaturesParams params2 = params1;
-    params2.imgMatrixPtr_ = img2_matrix_ptr.nakedPointer();
-    params2.inMaximasListPtr_ = &img2_maximas_list_;
-    params2.featMtxPtr_ = &img2featMtx_;
-    
-    // Starting jobs
-    
-    TeFunctionCallThreadJob dummyJob;
-    dummyJob.jobFunc_ = generateCorrelationFeatures;
-   
-    // Starting jobs
-    
-    if( processImg1 )
-    {
-      dummyJob.jobFuncParsPtr_ = (void*)&params1;
-      jobsMan_.executeJob( dummyJob );     
-    }
-    
-    if( processImg2 )
-    {
-      dummyJob.jobFuncParsPtr_ = (void*)&params2;
-      jobsMan_.executeJob( dummyJob );       
-    }
-    
-    // Waiting all jobs to finish
-    
-    jobsMan_.waitAllToFinish();
-    
-    TEAGN_TRUE_OR_RETURN( params1.returnValue_, 
-      "Error generating correlation features" )
-    TEAGN_TRUE_OR_RETURN( params2.returnValue_,
-      "Error generating correlation features" )    
-  }
-  
-/*  
-features2Tiff( corr_window_width, img1_maximas_list_, img1featMtx, 
-  "img1feat" );
-features2Tiff( corr_window_width, img2_maximas_list_, img2featMtx, 
-  "img2feat" ); 
-*/
-  
-  // Generating tie-points (images boxes reference)
-  
-  TEAGN_TRUE_OR_RETURN( matchFeatures( matching_method_, img1featMtx_,
-    img1_maximas_list_, img2featMtx_, img2_maximas_list_, *out_tie_points_ptr
-    ), "Error generating tie-points" );
-  
-/*  
-matrix2Tiff( *img1_matrix_ptr, "img1_matrix_ptr_tps.tif",
-  *out_tie_points_ptr, true );
-matrix2Tiff( *img2_matrix_ptr, "img2_matrix_ptr_tps.tif",
-  *out_tie_points_ptr, false );      
-*/  
-  
-  img1_matrix_ds_ptr.reset();
-  img1_matrix_us_ptr.reset();  
-    
-  // Bring tie-points to original images reference
-    
-  {
-    for( unsigned int tpsVecIdx = 0 ; tpsVecIdx < 
-      out_tie_points_ptr->size() ; ++tpsVecIdx )
-    {
-      TeCoordPair& coordPair = out_tie_points_ptr->operator[]( tpsVecIdx );
-      
-      coordPair.pt1.x( ( coordPair.pt1.x() / i1XRescFact ) + (double)orig_box1_x_off );
-      coordPair.pt1.y( ( coordPair.pt1.y() / i1YRescFact ) + (double)orig_box1_y_off );
-      
-      coordPair.pt2.x( ( coordPair.pt2.x() / i2XRescFact ) + (double)orig_box2_x_off );
-      coordPair.pt2.y( ( coordPair.pt2.y() / i2YRescFact ) + (double)orig_box2_y_off );
-    }
-  }
-  
-  /* Doing geometrical filtering using user supplied 
-     geometrical transformation parameters */
-     
-  if( ! skip_geom_filter ) {
-    gt_params.tiepoints_ = (*out_tie_points_ptr);
-       
-    TeGeometricTransformation::pointer trans_ptr( 
-      TeGTFactory::make( gt_params ) );
-    if( trans_ptr->reset( gt_params ) ) {
-      trans_ptr->getParameters( gt_params );
-      
-      /* updating the output tie points */
-      
-      (*out_tie_points_ptr) = gt_params.tiepoints_;
-      
-      /* updating the output gt_params, if available */
-      
-      TeGTParams::pointer out_gt_params_ptr;
-      if( params_.CheckParameter< TeGTParams::pointer >( 
-        "out_gt_params_ptr" ) ) 
-      {
-        params_.GetParameter( "out_gt_params_ptr", out_gt_params_ptr );
-        
-        *out_gt_params_ptr = gt_params;
-      }       
-    } else {
-      out_tie_points_ptr->clear();
-    }
-  }
-  
-  // So far.... so good !!
-  
-  return true;
-}
-
-
-void TePDIMMIOMatching::ResetState( const TePDIParameters& params )
-{
-  // Do we need to re-process input image 1 ??
-  
-  FeatMatchingMethod matching_method = NormCrossCorrMethod;
-  if( params.CheckParameter< FeatMatchingMethod >( 
-    "matching_method" ) ) 
-  {
-    params.GetParameter( "matching_method", matching_method );
-  }   
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  params.GetParameter( "input_image1_ptr", input_image1_ptr ); 
-  
-  unsigned int input_channel1 = 0;
-  params.GetParameter( "input_channel1", input_channel1 );
-  
-  TeBox input_box1;
-  if( params.CheckParameter< TeBox >( "input_box1" ) ) {
-    params.GetParameter( "input_box1", input_box1 );
-  } else {
-    TeBox input_box1_proj = input_image1_ptr->params().box();
-    
-    TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, input_image1_ptr,
-      input_box1 );
-  }   
-  
-  if( ( matching_method_ != matching_method ) || ( input_image1_ptr != 
-    input_image1_ptr_ ) || ( input_channel1 != 
-    input_channel1_ ) || ( input_box1 != input_box1_ ) )
-  {
-    img1featMtx_.Reset();
-    img1_maximas_list_.clear();
-  }
-  
-  // Do we need to re-process input image 2 ??
-  
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  params.GetParameter( "input_image2_ptr", input_image2_ptr ); 
-  
-  unsigned int input_channel2 = 0;
-  params.GetParameter( "input_channel2", input_channel2 );
-  
-  TeBox input_box2;
-  if( params.CheckParameter< TeBox >( "input_box2" ) ) {
-    params.GetParameter( "input_box2", input_box2 );
-  } else {
-    TeBox input_box2_proj = input_image2_ptr->params().box();
-    
-    TePDIUtils::MapCoords2RasterIndexes( input_box2_proj, input_image2_ptr,
-      input_box2 );
-  }    
-  
-  if( ( matching_method_ != matching_method ) || ( input_image2_ptr != 
-    input_image2_ptr_ ) || ( input_channel2 != 
-    input_channel2_ ) || ( input_box2 != input_box2_ ) )
-  {
-    img2featMtx_.Reset();
-    img2_maximas_list_.clear();
-  }
-  
-  matching_method_ = matching_method;
-  input_image1_ptr_ = input_image1_ptr;
-  input_channel1_ = input_channel1;
-  input_box1_ = input_box1;  
-  input_image2_ptr_ = input_image2_ptr;
-  input_channel2_ = input_channel2; 
-  input_box2_ = input_box2;
-}
-
-
-void TePDIMMIOMatching::loadImage( void * paramsPtr )
-{
- /* Retriving parameters */
-  
-  LoadImageParams& params = *( (LoadImageParams*) paramsPtr );
-  
-  params.returnValue_ = false;
-  
-  // Loading original image box
-  
-  const unsigned int origBoxRescNLines = (unsigned int)(
-    params.in_box_nlines_ * params.origImgYRescFact_ );
-  const unsigned int origBoxRescNCols = (unsigned int)(
-    params.in_box_ncols_ * params.origImgXRescFact_ );
-  
-  {
-    // Allocating resources 
-    
-    params.glb_mem_lock_ptr_->lock();
-    
-    if( ! params.img_matrix_ptr_->reset( origBoxRescNLines, 
-      origBoxRescNCols ) )
-    {
-      TEAGN_LOGERR( "Unable to allocate space for the loaded image" )
-      params.glb_mem_lock_ptr_->unLock();
-      return;
-    }
-      
-    params.glb_mem_lock_ptr_->unLock();
-    
-    // Interpolator - if needed
-    
-    TePDIInterpolator::InterpMethod intMethod = 
-      TePDIInterpolator::NNMethod;
-    if( ( params.origImgXRescFact_ != 1.0 ) || 
-      ( params.origImgYRescFact_ != 1.0 ) )
-    {
-      intMethod = TePDIInterpolator::BicubicMethod;
-    }
-    
-    TePDIInterpolator interp;
-    TEAGN_TRUE_OR_THROW( interp.reset( params.input_image_ptr_,
-      intMethod,
-      params.input_image_ptr_->params().useDummy_ ?
-      params.input_image_ptr_->params().dummy_[ params.input_image_channel_ ] : 
-      0 ), "Interpolator error" );    
-      
-    unsigned int curr_out_line = 0;
-    unsigned int curr_out_col = 0;
-    unsigned int curr_input_line = 0;
-    unsigned int curr_input_col = 0;
-    double value = 0;
-    TeRaster& inputRasterRef = (*params.input_image_ptr_);
-    
-    TePDIPIManager progress( "Loading image data", params.in_box_nlines_, 
-       params.progress_enabled_ );
-    
-    for( curr_out_line = 0 ; curr_out_line < origBoxRescNLines ; 
-      ++curr_out_line ) {
-      
-      curr_input_line = (unsigned int)( ( ( (double)curr_out_line ) / 
-        params.origImgYRescFact_ ) + ( (double) params.in_box_y_off_ ) );      
-      
-      for( curr_out_col = 0 ; curr_out_col < origBoxRescNCols ; 
-        ++curr_out_col ) {
-        
-        curr_input_col = (unsigned int)( ( ( (double)curr_out_col ) / 
-            params.origImgXRescFact_ ) + ( (double) params.in_box_x_off_ ) );        
-        
-        inputRasterRef.getElement( curr_input_col, curr_input_line,
-          value, params.input_image_channel_ );
-        
-        params.img_matrix_ptr_->setValue( curr_out_line, curr_out_col, 
-          value );
-      }
-      
-      if( progress.Increment() )
-      {
-        TEAGN_LOGMSG( "Canceled by the user" );
-        return;
-      }
-    }
-  }
-  
-  // Retriving raster channel max and min channel allowed values
-  
-  double rasterChnMin = 0;
-  double rasterChnMax = 0;
-  
-  if( ! TePDIUtils::TeGetRasterMinMaxBounds( 
-    params.input_image_ptr_,
-    params.input_image_channel_, rasterChnMin, rasterChnMax ) )
-  {
-     TEAGN_LOGERR( "Error getting channels bounds" );  
-     return;
-  }
-  
-  // Loading downsampled image box
-  
-  {
-    const unsigned int out_box_nlines = (unsigned int)
-      ( ((double)origBoxRescNLines) / params.moravecDownSampleFactor_ );
-    const unsigned int out_box_ncols = (unsigned int)
-      ( ((double)origBoxRescNCols) / params.moravecDownSampleFactor_ );
-    
-    if( ! bicubicResampleMatrix( *( params.img_matrix_ptr_ ), out_box_nlines,
-      out_box_ncols, params.progress_enabled_, *(params.glb_mem_lock_ptr_),
-      rasterChnMin, rasterChnMax, *( params.img_matrix_ds_ptr_ ) ) )
-    {
-      TEAGN_LOGERR( "Error generating downsampled image" );
-      return;
-    }
-  }
-  
-  // Loading upsampled image box
-  
-  if( params.generateUpsampledImage_ )
-  {
-    // Calculating sizes for resampled boxes
-    
-    const unsigned int out_box_nlines = (unsigned int)
-      ( ((double)origBoxRescNLines) / params.moravecUpSampleFactor_ );
-    const unsigned int out_box_ncols = (unsigned int)
-      ( ((double)origBoxRescNCols) / params.moravecUpSampleFactor_ );
-    
-    if( ! bicubicResampleMatrix( *( params.img_matrix_ptr_ ), out_box_nlines,
-      out_box_ncols, params.progress_enabled_, *(params.glb_mem_lock_ptr_),
-      rasterChnMin, rasterChnMax, *( params.img_matrix_us_ptr_ ) ) )
-    {
-      TEAGN_LOGERR( "Error generating downsampled image" );
-      return;
-    }
-  }    
-  
-  params.returnValue_ = true;
-}
-
-void TePDIMMIOMatching::createImgMatrix( TeDataType dataType, 
-  TeSharedPtr< TePDIMtxDoubleAdptInt >& matrixPtr )
-{
-  switch( dataType )
-  {
-    case TeDOUBLE :
-    {
-      matrixPtr.reset( new TePDIMtxDoubleAdpt< double >( 
-        TePDIMtxDoubleAdpt< double >::AutoMemPol ) );
-      break;
-    }
-    case TeFLOAT :
-    {
-      matrixPtr.reset( new TePDIMtxDoubleAdpt< float >( 
-        TePDIMtxDoubleAdpt< float >::AutoMemPol ) );
-      break;
-    }
-    case TeLONG :
-    {
-      matrixPtr.reset( new TePDIMtxDoubleAdpt< long int >( 
-        TePDIMtxDoubleAdpt< long int >::AutoMemPol ) );
-      break;
-    }
-    case TeUNSIGNEDLONG :
-    {
-      matrixPtr.reset( new TePDIMtxDoubleAdpt< unsigned long int >( 
-        TePDIMtxDoubleAdpt< unsigned long int >::AutoMemPol ) );
-      break;
-    }
-    case TeINTEGER :
-    {
-      matrixPtr.reset( new TePDIMtxDoubleAdpt< int >( 
-        TePDIMtxDoubleAdpt< int >::AutoMemPol ) );
-      break;
-    }
-    case TeSHORT :
-    {
-      matrixPtr.reset( new TePDIMtxDoubleAdpt< short int >( 
-        TePDIMtxDoubleAdpt< short int >::AutoMemPol ) );
-      break;
-    }
-    case TeUNSIGNEDSHORT :
-    {
-      matrixPtr.reset( new TePDIMtxDoubleAdpt< unsigned short int >( 
-        TePDIMtxDoubleAdpt< unsigned short int >::AutoMemPol ) );
-      break;
-    }
-    case TeCHAR :
-    {
-      matrixPtr.reset( new TePDIMtxDoubleAdpt< char >( 
-        TePDIMtxDoubleAdpt< char >::AutoMemPol ) );
-      break;
-    }
-    case TeUNSIGNEDCHAR :
-    {
-      matrixPtr.reset( new TePDIMtxDoubleAdpt< unsigned char >( 
-        TePDIMtxDoubleAdpt< unsigned char >::AutoMemPol ) );
-      break;
-    }
-    case TeBIT :
-    {
-      matrixPtr.reset( new TePDIMtxDoubleAdpt< unsigned char >( 
-        TePDIMtxDoubleAdpt< unsigned char >::AutoMemPol ) );
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_THROW( "Invalid data type ");
-      break;
-    }
-  }
-}
-
-void TePDIMMIOMatching::extractLocalMaximas( void * paramsPtr )
-{
- /* Retriving parameters */
-  
-  ExtractLocalMaximasParams params = *( (ExtractLocalMaximasParams*) 
-    paramsPtr );
-    
-  TEAGN_DEBUG_CONDITION( params.seachSubImagesNmb_ > 0,
-    "Invalid params.seachSubImagesNmb_" );
-    
-  ( (ExtractLocalMaximasParams*) paramsPtr )->returnValue_ = false;
-  
-  /* Fixing parameters */
-   
-  unsigned int sqrtSI = (unsigned int)ceil( sqrt( 
-    (double)params.seachSubImagesNmb_ ) );
-  if( sqrtSI == 0 ) sqrtSI = 1;
-  
-  params.seachSubImagesNmb_ = sqrtSI * sqrtSI;
-  
-  params.maximasNumber_ = MAX( params.maximasNumber_, 
-    params.seachSubImagesNmb_ );
-  params.maximasNumber_ = params.maximasNumber_ / 
-    params.seachSubImagesNmb_;  
-    
-  if( params.moravecWindowSize_ % 2 == 0 ) ++params.moravecWindowSize_;
-  
-  /* Calling the maximas extraction for each sub-image */
-  
-  const unsigned int subWindowMaxWidth = params.imgMatrixPtr_->getNCols() / 
-    sqrtSI;
-  const unsigned int subWindowMaxHeight = params.imgMatrixPtr_->getNLines() / 
-    sqrtSI;
-    
-  if( ( subWindowMaxWidth > 0 ) && ( subWindowMaxHeight > 0 ) )
-  {
-    unsigned int windColBound = 0;
-    unsigned int windLinBound = 0;
-    unsigned int windWidth = 0;
-    unsigned int windHeight = 0;
-    
-    MaximasMapT maximasMap;
-      
-    TePDIPIManager progress( "Finding local maximas",
-      ( ( params.imgMatrixPtr_->getNLines() - ( sqrtSI * 
-      params.moravecWindowSize_ ) ) / params.moravecWindowSize_ ) * sqrtSI, 
-      params.progressEnabled_ );
-      
-    for( unsigned int line = 0 ; line < params.imgMatrixPtr_->getNLines() ;
-      line += subWindowMaxHeight )
-    {
-      windLinBound = MIN( line + subWindowMaxHeight, 
-        params.imgMatrixPtr_->getNLines() );
-      windHeight = windLinBound - line;
-      
-      if( windHeight > params.moravecWindowSize_ )
-      {
-        for( unsigned int col = 0 ; col < params.imgMatrixPtr_->getNCols() ; 
-          col += subWindowMaxWidth ) 
-        {
-          windColBound = MIN( col + subWindowMaxWidth, 
-            params.imgMatrixPtr_->getNCols() );
-          windWidth = windColBound - col;
-          
-          if( windWidth > params.moravecWindowSize_ )
-          {
-            if( ! extractLocalMaximas( params, col, line, windWidth, 
-              windHeight, maximasMap, progress ) )
-            {
-              return;
-            }
-          }
-        }
-      }
-    }
-    
-    // Filtering out maximis below the variance threshold
-    
-    if( maximasMap.size() > 0 )
-    {
-      if( params.moravecMinVarianceThreshold_ > 0.0 )
-      {
-        double mean = 0;
-        MaximasMapT::iterator it = maximasMap.begin();
-        const MaximasMapT::iterator itEnd = maximasMap.end();  
-        while( it != itEnd ) 
-        {
-          mean += it->first ;
-          ++it;
-        }    
-        mean /= (double)( maximasMap.size() );
-        
-        double stddev = 0;
-        double diff = 0;
-        it = maximasMap.begin();
-        while( it != itEnd ) 
-        {
-          diff = it->first - mean;
-          stddev += ( diff * diff );
-          
-          ++it;
-        }
-        stddev /= (double)( maximasMap.size() );
-        stddev = sqrt( stddev );
-        
-        const double minAllowedVariance = mean - ( ( stddev / 2.0 ) *   
-          params.moravecMinVarianceThreshold_ );
-        
-        it = maximasMap.begin();
-        
-        while( it != itEnd ) 
-        {
-          if( it->first >= minAllowedVariance )
-            params.outMaximasListPtr_->push_back( it->second );
-          
-          ++it;
-        }
-      }
-      else
-      {
-        MaximasMapT::iterator it = maximasMap.begin();
-        MaximasMapT::iterator itEnd = maximasMap.end();  
-        
-        while( it != itEnd ) 
-        {
-          params.outMaximasListPtr_->push_back( it->second );
-          
-          ++it;
-        }
-      }
-    }
-  }
-    
-  // So far... so good !
-  
-  ( (ExtractLocalMaximasParams*) paramsPtr )->returnValue_ = true;
-}
-
-bool TePDIMMIOMatching::extractLocalMaximas( 
-  ExtractLocalMaximasParams& params,
-  unsigned int xStart, unsigned int yStart, unsigned int width,
-  unsigned int height, MaximasMapT& outMaximasMap,
-  TePDIPIManager& progress )
-{
-  TEAGN_DEBUG_CONDITION( width > params.moravecWindowSize_, 
-    "invalid block size" )
-  TEAGN_DEBUG_CONDITION( height > params.moravecWindowSize_, 
-    "invalid block size" )
-  TEAGN_DEBUG_CONDITION( ( params.moravecWindowSize_ % 2 ), 
-    "invalid moravec window size" )
-    
-    
-  // Allocating the variance values buffer
-  
-  const int windRad = (unsigned int)( params.moravecWindowSize_ / 
-    2 );    
-    
-  const unsigned int bufferLines = params.moravecWindowSize_;
-  const unsigned int bufferCols = width - ( 2 * windRad );
-  
-  TePDIMatrix< double > buffer( TePDIMatrix< double >::RAMMemPol );
-  if( ! buffer.Reset( bufferLines, bufferCols ) )
-  {
-    TEAGN_LOGERR( "Error allocating internal buffer" )
-    return false;
-  }
-
-  // Iterating over image (reference: window center) looking for maximas
-  
-  // The found maximas coords ordered by diretional variance
-  MaximasMapT maximasData;
-  
-  // Buffer over input 
-  const unsigned int imgBufStartLinesBound = yStart + height - windRad -  
-    params.moravecWindowSize_  + 1;
-  const unsigned int imgBufStartCol = xStart + windRad;
-  
-  // Internal buffer block variables
-  const unsigned int bufBlockStartLinesBound = bufferCols - ( bufferCols % 
-    params.moravecWindowSize_ ) - params.moravecWindowSize_  + 1;
-  unsigned int bufBlockStartCol = 0;
-  unsigned int bufBlockCol = 0;
-  unsigned int bufBlockLin = 0;
-
-  int offset = 0;
-  double hor_var = 0;
-  double ver_var = 0;
-  double diag_var = 0;
-  double adiag_var = 0;
-  double min_var = 0;
-  double centerValue = 0;
-  double neightValue = 0;
-  double diffValue = 0;  
-  
-  TePDIMtxDoubleAdptInt& imgMatrix = *(params.imgMatrixPtr_);
-  
-  unsigned int bufLine = 0;
-  unsigned int bufCol = 0;
-  unsigned int im_line = 0;
-  unsigned int im_col = 0;
-
-  std::pair< double, std::pair< unsigned int, unsigned int > > 
-    maxVarDataPair;
-  
-  // Starting from the first valid pixel where the variances can
-  // be calculated
-  for( unsigned int imgBufStartLine = windRad + yStart ; 
-    imgBufStartLine < imgBufStartLinesBound ; 
-    imgBufStartLine += params.moravecWindowSize_ )
-  {
-    // Generating variance information for the current buffer
-    // position over input image
-    
-    for( bufLine = 0 ; bufLine < bufferLines ; ++bufLine )
-    {
-      im_line = bufLine + imgBufStartLine;
-        
-      for( bufCol = 0 ; bufCol < bufferCols ; ++bufCol )
-      {        
-        im_col = bufCol + imgBufStartCol;
-        
-        imgMatrix.getValue( im_line, im_col, centerValue );
-        
-        hor_var = 0;
-        ver_var = 0;
-        diag_var = 0;
-        adiag_var = 0;
-    
-        for( offset = -windRad ; offset <= windRad ; ++offset )
-        {
-          imgMatrix.getValue( im_line, im_col + offset, neightValue );
-          diffValue = neightValue - centerValue;
-          hor_var += ( diffValue * diffValue );
-          
-          imgMatrix.getValue( im_line + offset, im_col, neightValue );
-          diffValue = neightValue - centerValue;
-          ver_var += ( diffValue * diffValue );
-
-          imgMatrix.getValue( im_line + offset, im_col + offset, neightValue );
-          diffValue = neightValue - centerValue;
-          diag_var += ( diffValue * diffValue );
-        
-          imgMatrix.getValue( im_line - offset, im_col + offset, neightValue );
-          diffValue = neightValue - centerValue;
-          adiag_var += ( diffValue * diffValue );
-        }
-        
-        min_var = MIN( hor_var, MIN( ver_var, MIN( diag_var, adiag_var ) ) );
-        
-        buffer[ bufLine ][ bufCol ] = min_var;
-      }
-    }
-    
-    // Selecting the higher variance levels for each window of 
-    // moravecWindowSize_ X moravecWindowSize_ from inside the 
-    // current buffer
-    
-    for( bufBlockStartCol = 0 ; bufBlockStartCol < 
-      bufBlockStartLinesBound ; bufBlockStartCol += params.moravecWindowSize_ )
-    {
-      maxVarDataPair.first = DBL_MAX * (-1.0);
-        
-      for( bufBlockLin = 0 ; bufBlockLin < params.moravecWindowSize_ ; 
-        ++bufBlockLin )
-      {
-        im_line = bufBlockLin + imgBufStartLine;
-        
-        for( bufBlockCol = 0 ; bufBlockCol < params.moravecWindowSize_ ; 
-          ++bufBlockCol )
-        {  
-          const double& bufElement = buffer[ bufBlockLin ][ bufBlockCol + 
-            bufBlockStartCol ];
-          
-          if( bufElement > maxVarDataPair.first )
-          {
-            im_col = bufBlockCol + bufBlockStartCol + imgBufStartCol;
-            
-            maxVarDataPair.first = bufElement;
-            maxVarDataPair.second.second = im_line;
-            maxVarDataPair.second.first = im_col;
-          }
-        }
-      }
-      
-      // Adding maxima point to the ordered maximas list
-
-      maximasData.insert( maxVarDataPair );
-    }
-    
-    if( progress.Increment() )
-    {
-      TEAGN_LOGERR( "Canceled by the user");
-      return false;
-    }
-  }  
-  
-  // Inserting params.maximasNumber_ maximas with higher directional 
-  // variance into output map
-  
-  unsigned int addedMaximas = 0;
-  
-  MaximasMapT::reverse_iterator it = maximasData.rbegin();  
-  MaximasMapT::reverse_iterator itEnd = maximasData.rend();  
-    
-  while( ( it != itEnd ) && ( addedMaximas < params.maximasNumber_ ) )
-  {
-    outMaximasMap.insert( *it );
-    
-    ++addedMaximas;
-    ++it;
-  }
-  
-  return true;
-}
-
-void TePDIMMIOMatching::moravecRepeatability( const MaximasListT& inputList,
-  const MaximasListT& constraintList, 
-  unsigned int constraintImageWidth,
-  unsigned int constraintImageHeight,  
-  double moravecRepeatabilityMinTolerance, 
-  double moravecReSampleFactor, 
-  MaximasListT& outputList )
-{
-  TEAGN_DEBUG_CONDITION( moravecRepeatabilityMinTolerance > 0,
-    "Invalid moravecRepeatabilityMinTolerance ")
-  TEAGN_DEBUG_CONDITION( moravecReSampleFactor > 0,
-    "Invalid moravecReSampleFactor ")
-      
-  outputList.clear();
-  
-  // Criating an RTree for seach optmization
-  
-  const TeBox myTreeBBox( -1.0, -1.0, (double)(constraintImageWidth),
-    (double)(constraintImageHeight) );  
-  
-  TeSAM::TeRTree<MaximasListNodeT const*, 8, 4> myTree( myTreeBBox );
-  
-  {
-    MaximasListT::const_iterator cListIt = constraintList.begin();
-    MaximasListT::const_iterator cListItEnd = constraintList.end();
-    TeBox auxBox;
-    
-    while( cListIt != cListItEnd )
-    {
-      auxBox.x1_ = (double)(cListIt->first) - moravecRepeatabilityMinTolerance;
-      auxBox.y1_ = (double)(cListIt->second) - moravecRepeatabilityMinTolerance;
-      
-      auxBox.x2_ = (double)(cListIt->first) + moravecRepeatabilityMinTolerance;
-      auxBox.y2_ = (double)(cListIt->second) + moravecRepeatabilityMinTolerance;
-      
-      myTree.insert( auxBox, &(*cListIt) );
-          
-      ++cListIt;
-    }
-  }
-  
-  // Iterating over input list
-  
-  MaximasListT::const_iterator iListIt = inputList.begin();
-  MaximasListT::const_iterator iListItEnd = inputList.end();
-  std::vector< MaximasListNodeT const* > resultVec;
-  TeBox auxBox;
-    
-  while( iListIt != iListItEnd )
-  {
-    const MaximasListNodeT& iListEle = *iListIt;
-    
-    auxBox.x1_ = auxBox.x2_ = iListEle.first / moravecReSampleFactor;
-    auxBox.y1_ = auxBox.y2_ = iListEle.second / moravecReSampleFactor;
-    
-    if( myTree.search( auxBox, resultVec ) )
-    {
-      outputList.push_back( iListEle );  
-    }
-    
-    ++iListIt;  
-  }
-  
-  return;
-}
-
-void TePDIMMIOMatching::generateCorrelationFeatures( void * paramsPtr )
-{
-  /* Retriving parameters */
-  
-  GenerateCorrelationFeaturesParams& params = 
-    *( (GenerateCorrelationFeaturesParams*) paramsPtr );
-  
-  const TePDIMtxDoubleAdptInt& img_matrix = *(params.imgMatrixPtr_);
-  
-  TePDIMatrix< double >& img_features_matrix = *( params.featMtxPtr_);
-  
-  params.returnValue_ = false;
-    
-  if( params.inMaximasListPtr_->size() > 0 ) {
-    /* Allocating output matrix */
-       
-    params.glbMemLockPtr_->lock();
-    
-    if( ! params.featMtxPtr_->Reset( params.inMaximasListPtr_->size(),
-      params.corrWindowsWidth_ * params.corrWindowsWidth_,
-      TePDIMatrix< double >::RAMMemPol ) )
-    {
-      TEAGN_LOGERR( "Error allocating image features matrix" )
-      params.glbMemLockPtr_->unLock();
-      return;
-    }
-      
-    params.glbMemLockPtr_->unLock();
-      
-    /* variables related to the current window over the hole image */
-    unsigned int curr_window_x_start = 0;
-    unsigned int curr_window_y_start = 0;
-    unsigned int curr_window_x_center = 0;
-    unsigned int curr_window_y_center = 0;
-    unsigned int curr_window_x_bound = 0;
-    unsigned int curr_window_y_bound = 0;
-    
-    /*used on the rotation calcule */
-
-    const unsigned int wind_radius = params.corrWindowsWidth_ / 2;
-    // output window radius
-    const double wind_radius_double = (double)wind_radius;
-
-    const unsigned int img_features_matrix_cols = 
-      params.featMtxPtr_->GetColumns();
-    unsigned int curr_x = 0;
-    unsigned int curr_y = 0;
-    double curr_x_minus_radius = 0;
-    double curr_y_minus_radius = 0;
-    unsigned int curr_offset = 0;
-    double int_x_dir = 0;
-    double int_y_dir = 0;
-    double int_norm = 0;
-    double rotated_curr_x = 0;/* rotaded coord - window ref */
-    double rotated_curr_y = 0;/* rotaded coord - window ref */
-    
-     /* the found rotation parameters */
-    double rot_cos = 0;
-    double rot_sin = 0;
-    
-    /* the coords rotated but in the hole image reference */
-    int rotated_curr_x_img = 0;
-    int rotated_curr_y_img = 0;
-    
-    /* current window mean and standart deviation */
-    double curr_wind_mean = 0.0;
-    double curr_wind_stddev = 0.0;
-    double curr_wind_stddev_aux = 0.0;
-    
-    // used on intensity vector calcule
-    double imgMatrixValue1 = 0;
-    double imgMatrixValue2 = 0;
-    
-    TePDIPIManager progress( "Generating correlation windows",
-      params.inMaximasListPtr_->size(), params.progressEnabled_ );
-    
-    MaximasListT::const_iterator maximIt = params.inMaximasListPtr_->begin();
-    MaximasListT::const_iterator maximItEnd = params.inMaximasListPtr_->end();
-    unsigned int maximasListIndex = 0;
-      
-    while( maximIt != maximItEnd ) {
-      
-      /* Calculating the current window position */
-     
-      curr_window_x_center = maximIt->first;
-      curr_window_y_center = maximIt->second;
-      curr_window_x_start = curr_window_x_center - wind_radius;
-      curr_window_y_start = curr_window_y_center - wind_radius;
-      curr_window_x_bound = curr_window_x_start + params.corrWindowsWidth_;
-      curr_window_y_bound = curr_window_y_start + params.corrWindowsWidth_;
-        
-      /* Estimating the intensity vector X direction */
-      
-      for( curr_offset = 0 ; curr_offset < wind_radius ;
-        ++curr_offset ) {      
-
-        for( curr_y = curr_window_y_start ; curr_y < curr_window_y_bound ; 
-          ++curr_y ) 
-        {
-          img_matrix.getValue( curr_y, curr_window_x_bound - 1 - curr_offset, 
-             imgMatrixValue1 );
-          img_matrix.getValue( curr_y, curr_window_x_start + curr_offset, 
-             imgMatrixValue2 );
-        
-          int_x_dir += imgMatrixValue1 - imgMatrixValue2;
-        }
-      }
-      
-      int_x_dir /= ( 2.0 * ( (double) wind_radius ) );
-      
-      /* Estimating the intensity vector y direction */
-      
-      for( curr_offset = 0 ; curr_offset < wind_radius ;
-        ++curr_offset ) {      
-
-        for( curr_x = curr_window_x_start ; 
-          curr_x < curr_window_x_bound ;
-          ++curr_x ) 
-        {
-          img_matrix.getValue( curr_window_y_start + curr_offset, curr_x , 
-            imgMatrixValue1 );
-          img_matrix.getValue( curr_window_y_bound - 1 - curr_offset, 
-            curr_x, imgMatrixValue2 );          
-        
-          int_y_dir += imgMatrixValue1 - imgMatrixValue2;
-        }
-      }      
-      
-      int_y_dir /= ( 2.0 * ( (double) wind_radius ) );
-      
-      /* Calculating the rotation parameters - 
-         counterclockwise rotation 
-         
-         | u |    |cos  -sin|   |X|
-         | v | == |sin   cos| x |Y|
-      */
-      int_norm = sqrt( ( int_x_dir * int_x_dir ) + 
-        ( int_y_dir * int_y_dir ) );
-      
-      if( int_norm != 0.0 ) {
-        rot_cos = int_x_dir / int_norm;
-        rot_sin = int_y_dir / int_norm;
-      } else {
-        /* No rotation */
-        rot_cos = 1.0;
-        rot_sin = 0.0;
-      }
-      
-      /* Generating the rotated window data and inserting it into 
-         the img_features_matrix by setting the intensity vector
-         to the direction (1,0) by a clockwise rotation
-         using the inverse matrix 
-      
-         | u |    |cos   sin|   |X|
-         | v | == |-sin  cos| x |Y|
-      */
-         
-      for( curr_y = 0 ; curr_y < params.corrWindowsWidth_ ; ++curr_y ) 
-      {
-        for( curr_x = 0 ; curr_x < params.corrWindowsWidth_ ; ++curr_x ) 
-        {
-          /* briging the window to the coord system center */
-          
-          curr_x_minus_radius = ((double)curr_x) - 
-            wind_radius_double;
-          curr_y_minus_radius = ((double)curr_y) - 
-            wind_radius_double;
-          
-          /* rotating the centered window */
-          
-          rotated_curr_x = 
-            ( ( rot_cos * curr_x_minus_radius ) + 
-            ( rot_sin * curr_y_minus_radius ) );
-          
-          rotated_curr_y =
-            ( ( -1.0 * rot_sin * curr_x_minus_radius ) + 
-            ( rot_cos * curr_y_minus_radius ) );
-            
-          /* bringing the window back to its original
-             location with the correct new scale */ 
-            
-          rotated_curr_x += wind_radius_double;
-          rotated_curr_y += wind_radius_double;
-          
-          /* copy the new rotated window to the output vector */
-            
-          rotated_curr_x_img = curr_window_x_start +
-            TeRound( rotated_curr_x );
-          rotated_curr_y_img = curr_window_y_start +
-            TeRound( rotated_curr_y );                        
-           
-          if( ( rotated_curr_x_img > 0 ) &&  
-            ( rotated_curr_x_img < (int)img_matrix.getNCols() ) &&
-            ( rotated_curr_y_img > 0 ) &&
-            ( rotated_curr_y_img < (int)img_matrix.getNLines() ) )
-          {
-            img_matrix.getValue( rotated_curr_y_img, rotated_curr_x_img, 
-              imgMatrixValue1 ); 
-          }
-          else
-          {
-            TEAGN_LOGERR( "Invalid matrix position -> rotated_curr_y_img=" +
-              Te2String( rotated_curr_y_img ) + " img_matrix.getNLines()=" +
-              Te2String( img_matrix.getNLines() ) + " Processing point [" + Te2String( curr_window_x_center, 1 ) +
-              "," + Te2String( curr_window_y_center, 1 ) + "] ");
-          
-            imgMatrixValue1 = 0;
-          }
-            
-          img_features_matrix( maximasListIndex, ( curr_y * 
-            params.corrWindowsWidth_ ) + curr_x ) = imgMatrixValue1;
-
-        }
-      }
-      
-      /* Normalizing the generated window by subtracting its mean
-         and dividing by its standard deviation */      
-      
-      if( params.normalizeWindows_ )
-      {
-        curr_wind_mean = 0.0;
-        
-        for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
-          ++curr_x ) {
-          
-          curr_wind_mean += img_features_matrix( maximasListIndex,
-            curr_x );
-        }
-        
-        curr_wind_mean /= ( (double)img_features_matrix_cols  );
-        
-        curr_wind_stddev = 0.0;  
-        
-        for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
-          ++curr_x ) {
-          
-          curr_wind_stddev_aux = img_features_matrix( 
-            maximasListIndex, curr_x ) - curr_wind_mean;
-            
-          curr_wind_stddev += ( curr_wind_stddev_aux *
-            curr_wind_stddev_aux );
-        }      
-        
-        curr_wind_stddev /= ( (double)img_features_matrix_cols  );
-        curr_wind_stddev = sqrt( curr_wind_stddev );
-        
-        if( curr_wind_stddev == 0.0 ) {
-          for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
-            ++curr_x ) {
-            
-            double& curr_value = img_features_matrix( 
-              maximasListIndex, curr_x );
-            
-            curr_value -= curr_wind_mean;
-          } 
-        } else {
-          for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
-            ++curr_x ) {
-            
-            double& curr_value = img_features_matrix( 
-              maximasListIndex, curr_x );
-            
-            curr_value -= curr_wind_mean;
-            curr_value /= curr_wind_stddev;
-          }
-        }
-      }
-      
-      /* Finished !! */
-     
-      if( progress.Increment() )
-      {
-        TEAGN_LOGERR( "Canceled by the user" );
-        return;
-      }
-      
-      ++maximasListIndex;
-      ++maximIt;
-    }
-  }    
-  
-  params.returnValue_ = true;
-}
-
-bool TePDIMMIOMatching::matchFeatures( FeatMatchingMethod matching_method,
-  const TePDIMatrix< double >& img1featMtx,
-  const MaximasListT& img1_maximas_list,
-  const TePDIMatrix< double >& img2featMtx,
-  const MaximasListT& img2_maximas_list,
-  TeCoordPairVect& tiePointsVec )
-{
-  if( ( img1featMtx.GetLines() == 0 ) || ( img2featMtx.GetLines() == 0 ) )
-  {
-    return true;
-  }
-  
-  TEAGN_DEBUG_CONDITION( ( img1featMtx.GetLines() == 
-    img1_maximas_list.size() ), "Size mismatch" )
-  TEAGN_DEBUG_CONDITION( ( img2featMtx.GetLines() == 
-    img2_maximas_list.size() ), "Size mismatch" )    
-  TEAGN_DEBUG_CONDITION( ( img1featMtx.GetColumns() == 
-    img2featMtx.GetColumns() ), "Size mismatch" )
-    
-  tiePointsVec.clear();
-  
-  // Init matching matrix
-  
-  TePDIMatrix<double> matchMatrix;
-  TEAGN_TRUE_OR_RETURN( matchMatrix.Reset( img1_maximas_list.size(),
-    img2_maximas_list.size(), TePDIMatrix<double>::RAMMemPol ),
-    "Error allocating memory" );  
-  
-  const unsigned int mMCols = matchMatrix.GetColumns();
-  const unsigned int mMLines = matchMatrix.GetLines();  
-  
-  {
-    const double negativeInfinite = DBL_MAX * (-1.0);
-    double* linePtr = 0;
-    unsigned int col = 0;
-    
-    for( unsigned int line =0 ; line < mMLines ; ++line )
-    {
-      linePtr = matchMatrix[ line ];
-      
-      for( col =0 ; col < mMCols ; ++col )
-        linePtr[ col ] = negativeInfinite;
-    }
-  }
-  
-  const unsigned long int maxJobs = jobsMan_.getMaxSimulJobs() ?
-      jobsMan_.getMaxSimulJobs() : 1;
-  
-  switch( matching_method )
-  {
-    case EuclidianDistMethod :
-    {
-      // Spawning jobs
-      
-      std::vector< CalcEuclidianDistanceMtxParams > jobsParamsVec;  
-      
-      CalcEuclidianDistanceMtxParams auxPars;      
-      auxPars.img1FeatMtxPtr_ = &img1featMtx;
-      auxPars.img2FeatMtxPtr_ = &img2featMtx;
-      auxPars.matchMatrixPtr_ = &matchMatrix;
-      auxPars.progressEnabled_ = progress_enabled_;
-      auxPars.glbMutexptr_ = &globalMutex_;
-      auxPars.returnValue_ = false;
-      
-      TeFunctionCallThreadJob dummyJob;
-      dummyJob.jobFunc_ = calcEuclidianDistanceMtx;
-      
-      unsigned int jobidx = 0;
-      jobsParamsVec.resize( maxJobs );
-      
-      for( jobidx = 0 ; jobidx < maxJobs ; ++jobidx )
-      {
-        jobsParamsVec[ jobidx ] = auxPars;
-        dummyJob.jobFuncParsPtr_ = &( jobsParamsVec[ jobidx ] );
-        
-        jobsMan_.executeJob( dummyJob );
-      }
-      
-      // Waiting jobs to finish
-      
-      jobsMan_.waitAllToFinish();
-      
-      for( jobidx = 0 ; jobidx < maxJobs ; ++jobidx )
-      {
-        TEAGN_TRUE_OR_RETURN( jobsParamsVec[ jobidx ].returnValue_, 
-          "Error calculating euclidian distance" );
-      }      
-      
-      break;
-    }    
-    case NormCrossCorrMethod :
-    {
-      // Spawning jobs
-      
-      std::vector< CalcCCorrelationMtxParams > jobsParamsVec;  
-      
-      CalcCCorrelationMtxParams auxPars;      
-      auxPars.img1FeatMtxPtr_ = &img1featMtx;
-      auxPars.img2FeatMtxPtr_ = &img2featMtx;
-      auxPars.matchMatrixPtr_ = &matchMatrix;
-      auxPars.progressEnabled_ = progress_enabled_;
-      auxPars.glbMutexptr_ = &globalMutex_;
-      auxPars.returnValue_ = false;
-      
-      TeFunctionCallThreadJob dummyJob;
-      dummyJob.jobFunc_ = calcCCorrelationMtx;
-
-      unsigned int jobidx = 0;
-      jobsParamsVec.resize( maxJobs );
-      
-      for( jobidx = 0 ; jobidx < maxJobs ; ++jobidx )
-      {
-        jobsParamsVec[ jobidx ] = auxPars;
-        dummyJob.jobFuncParsPtr_ = &( jobsParamsVec[ jobidx ] );
-        
-        jobsMan_.executeJob( dummyJob );
-      }
-      
-      // Waiting jobs to finish
-      
-      jobsMan_.waitAllToFinish();
-      
-      for( jobidx = 0 ; jobidx < maxJobs ; ++jobidx )
-      {
-        TEAGN_TRUE_OR_RETURN( jobsParamsVec[ jobidx ].returnValue_, 
-          "Error calculating euclidian distance" );
-      }      
-      
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_THROW( "Invalid method")
-      break;
-    }
-  }
-  
-  // Finding best matchings
-  
-  // Feature 1 desires to match with the feature 2 with the index
-  // indicated by this vector
-  std::vector< unsigned int> feat1Tofeat2( matchMatrix.GetLines(),
-    matchMatrix.GetColumns() );  
-  
-  // Feature 2 desires to match with the feature 1 with the index
-  // indicated by this vector
-  std::vector< unsigned int> feat2Tofeat1( matchMatrix.GetColumns(),
-    matchMatrix.GetLines() );     
-  
-  switch( matching_method )
-  {
-    case EuclidianDistMethod :
-    {  
-      // minimum values found on each column
-      std::vector< double > colsMinsVec( matchMatrix.GetColumns(), 
-        DBL_MAX );
-      
-      // minimum values found on each line
-      std::vector< double > linesMinsVec( matchMatrix.GetLines(), 
-        DBL_MAX );
-      
-      double const* linePtr = 0;
-      unsigned int mMLine =0;
-      unsigned int mMCol =0;
-      
-      TePDIPIManager progress( "Matching features",
-        mMLines, progress_enabled_ );       
-      
-      for( mMLine =0 ; mMLine < mMLines ; ++mMLine )
-      {
-        linePtr = matchMatrix[ mMLine ];
-        
-        for( mMCol =0 ; mMCol < mMCols ; ++mMCol )
-        {
-          const double& value = linePtr[ mMCol ];
-          
-          if( value < linesMinsVec[ mMLine ] )
-          {
-            linesMinsVec[ mMLine ] = value;
-            feat1Tofeat2[ mMLine ] = mMCol;
-          }
-          
-          if( value < colsMinsVec[ mMCol ] )
-          {
-            colsMinsVec[ mMCol ] = value;
-            feat2Tofeat1[ mMCol ] = mMLine;
-          }          
-        }
-        
-        if( progress.Increment() )
-        {
-          TEAGN_LOGERR( "Canceled by the user" );
-          return false;
-        }           
-      }
-      
-      break;
-    }
-    case NormCrossCorrMethod :
-    {
-     // maximum values found on each column
-      std::vector< double > colsMaxsVec( matchMatrix.GetColumns(), 
-        (-1.0) * DBL_MAX );
-      
-      // maximum values found on each line
-      std::vector< double > linesMaxsVec( matchMatrix.GetLines(), 
-        (-1.0) * DBL_MAX );
-      
-      double const* linePtr = 0;
-      unsigned int mMLine =0;
-      unsigned int mMCol =0;
-      
-      TePDIPIManager progress( "Matching features",
-        mMLines, progress_enabled_ );       
-      
-      for( mMLine =0 ; mMLine < mMLines ; ++mMLine )
-      {
-        linePtr = matchMatrix[ mMLine ];
-        
-        for( mMCol =0 ; mMCol < mMCols ; ++mMCol )
-        {
-          const double& value = linePtr[ mMCol ];
-          
-          if( value > linesMaxsVec[ mMLine ] )
-          {
-            linesMaxsVec[ mMLine ] = value;
-            feat1Tofeat2[ mMLine ] = mMCol;
-          }
-          
-          if( value > colsMaxsVec[ mMCol ] )
-          {
-            colsMaxsVec[ mMCol ] = value;
-            feat2Tofeat1[ mMCol ] = mMLine;
-          }          
-        }
-        
-        if( progress.Increment() )
-        {
-          TEAGN_LOGERR( "Canceled by the user" );
-          return false;
-        }           
-      }
-      
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_THROW( "Invalid method")
-      break;
-    }
-  }
-  
-  // Generating tie-points
-  
-  {
-    MaximasListT::const_iterator mList1It = img1_maximas_list.begin();
-    MaximasListT::const_iterator mList2It;
-    TeCoordPair dummyCPair;
-    
-    for( unsigned int feat1Tofeat2_idx = 0 ; feat1Tofeat2_idx < 
-      feat1Tofeat2.size() ; ++feat1Tofeat2_idx )
-    {
-      // feature1 wants to match with the feature 2 with index
-      // feat1Tofeat2[ feat1Tofeat2_idx ]
-      if( feat1Tofeat2[ feat1Tofeat2_idx ] < feat2Tofeat1.size() )
-      {
-        // does feature 2 wants to match back ??
-        if( feat2Tofeat1[ feat1Tofeat2[ feat1Tofeat2_idx ] ] ==
-          feat1Tofeat2_idx )
-        { // Great !!! we hava a match
-        
-          // move an iterator to the correct maximas list 2 position
-          
-          mList2It = img2_maximas_list.begin();
-          for( unsigned int maxList2dx = 0 ; maxList2dx < 
-            feat1Tofeat2[ feat1Tofeat2_idx ] ; ++maxList2dx )
-          {
-            ++mList2It;
-          }
-          
-          // Generating the new tie-point
-          
-          dummyCPair.pt1.x( mList1It->first );
-          dummyCPair.pt1.y( mList1It->second );
-          dummyCPair.pt2.x( mList2It->first );
-          dummyCPair.pt2.y( mList2It->second );
-          
-          tiePointsVec.push_back( dummyCPair );
-        }
-      }
-      
-      ++mList1It;
-    }
-  }
-  
-  return true;
-}
-
-void TePDIMMIOMatching::calcEuclidianDistanceMtx( void * paramsPtr )
-{
-  CalcEuclidianDistanceMtxParams& params = 
-    *((CalcEuclidianDistanceMtxParams*)paramsPtr );
-  
-  params.returnValue_ = false;
-  
-  TEAGN_DEBUG_CONDITION( params.matchMatrixPtr_->GetLines() ==
-    params.img1FeatMtxPtr_->GetLines(), "Size mismatch" )
-  TEAGN_DEBUG_CONDITION( params.matchMatrixPtr_->GetColumns() ==
-    params.img2FeatMtxPtr_->GetLines(), "Size mismatch" )
-  TEAGN_DEBUG_CONDITION( params.img1FeatMtxPtr_->GetColumns() ==
-    params.img2FeatMtxPtr_->GetColumns(), "Size mismatch" )    
-    
-  TePDIMatrix< double >& matchMatrix = *params.matchMatrixPtr_;
-  const TePDIMatrix< double >& img1FeatMtx = *(params.img1FeatMtxPtr_);
-  const TePDIMatrix< double >& img2FeatMtx = *(params.img2FeatMtxPtr_);
-  const unsigned int matchMatrixLines = matchMatrix.GetLines();
-  const unsigned int matchMatrixCols = matchMatrix.GetColumns();
-  unsigned int notProcLine = 0;
-  unsigned int notProcCol = 0;
-  const double negativeInfinite = DBL_MAX * (-1.0);
-  double const* feat1Ptr = 0;
-  double const* feat2Ptr = 0;
-  double eucDist = 0;
-  double diff = 0;
-  unsigned int featCol = 0;
-  const unsigned int featSize = img1FeatMtx.GetColumns();
-  double* mMLinePtr = 0;
-  
-  // Loocking for a not processed cell
-  
-  TePDIPIManager progress( "Calculating Euclidian distance matrix",
-    matchMatrixLines, params.progressEnabled_ );  
-  
-  for( notProcLine = 0 ; notProcLine < matchMatrixLines ; ++notProcLine )
-  {
-    mMLinePtr = matchMatrix[ notProcLine ];
-    
-    for( notProcCol = 0 ; notProcCol < matchMatrixCols ; ++notProcCol )
-    {
-      params.glbMutexptr_->lock();
-      
-      double& mMElem = mMLinePtr[ notProcCol ];
-      
-      if( mMElem == negativeInfinite )
-      {
-        // mark as under processing 
-        mMElem = 0;
-        
-        params.glbMutexptr_->unLock();
-        
-        // Calculating distance
-        
-        feat1Ptr = img1FeatMtx[ notProcLine ];
-        feat2Ptr = img2FeatMtx[ notProcCol ];
-        
-        eucDist = 0;
-        
-        for( featCol = 0 ; featCol < featSize ; ++featCol )
-        {
-          diff = feat1Ptr[ featCol ] - feat2Ptr[ featCol ];
-          
-          diff *= diff;
-          
-          eucDist += diff;
-        }
-        
-        mMElem = sqrt( eucDist );
-      }
-      else
-      {
-        params.glbMutexptr_->unLock();
-      }
-    }
-    
-    if( progress.Increment() )
-    {
-      TEAGN_LOGERR( "Canceled by the user" );
-      return;
-    }    
-  }
-  
-  params.returnValue_ = true;
-}
-
-void TePDIMMIOMatching::calcCCorrelationMtx( void * paramsPtr )
-{
-  CalcCCorrelationMtxParams& params = 
-    *((CalcCCorrelationMtxParams*)paramsPtr );
-  
-  params.returnValue_ = false;
-  
-  TEAGN_DEBUG_CONDITION( params.matchMatrixPtr_->GetLines() ==
-    params.img1FeatMtxPtr_->GetLines(), "Size mismatch" )
-  TEAGN_DEBUG_CONDITION( params.matchMatrixPtr_->GetColumns() ==
-    params.img2FeatMtxPtr_->GetLines(), "Size mismatch" )
-  TEAGN_DEBUG_CONDITION( params.img1FeatMtxPtr_->GetColumns() ==
-    params.img2FeatMtxPtr_->GetColumns(), "Size mismatch" )    
-    
-  TePDIMatrix< double >& matchMatrix = *params.matchMatrixPtr_;
-  const TePDIMatrix< double >& img1FeatMtx = *(params.img1FeatMtxPtr_);
-  const TePDIMatrix< double >& img2FeatMtx = *(params.img2FeatMtxPtr_);
-  const unsigned int matchMatrixLines = matchMatrix.GetLines();
-  const unsigned int matchMatrixCols = matchMatrix.GetColumns();
-  unsigned int notProcLine = 0;
-  unsigned int notProcCol = 0;
-  const double negativeInfinite = DBL_MAX * (-1.0);
-  double const* feat1Ptr = 0;
-  double const* feat2Ptr = 0;
-  double sumAA = 0;
-  double sumBB = 0;
-  double ccorrelation = 0;
-  double cc_norm = 0;
-  unsigned int featCol = 0;
-  const unsigned int featSize = img1FeatMtx.GetColumns();
-  double* mMLinePtr = 0;
-  
-  // Loocking for a not processed cell
-  
-  TePDIPIManager progress( "Calculating correlation matrix",
-    matchMatrixLines, params.progressEnabled_ );  
-  
-  for( notProcLine = 0 ; notProcLine < matchMatrixLines ; ++notProcLine )
-  {
-    mMLinePtr = matchMatrix[ notProcLine ];
-    
-    for( notProcCol = 0 ; notProcCol < matchMatrixCols ; ++notProcCol )
-    {
-      params.glbMutexptr_->lock();
-      
-      double& mMElem = mMLinePtr[ notProcCol ];
-      
-      if( mMElem == negativeInfinite )
-      {
-        // mark as under processing 
-        mMElem = 0;
-        
-        params.glbMutexptr_->unLock();
-        
-        feat1Ptr = img1FeatMtx[ notProcLine ];
-        feat2Ptr = img2FeatMtx[ notProcCol ];        
-        
-        sumAA = 0;
-        sumBB = 0;   
-        
-        for( featCol = 0 ; featCol < featSize ; ++featCol )
-        {
-          sumAA += feat1Ptr[ featCol ] * feat1Ptr[ featCol ];
-          sumBB += feat2Ptr[ featCol ] * feat2Ptr[ featCol ];
-        }
-        
-        cc_norm = sqrt( sumAA * sumBB );
-        
-        if( cc_norm == 0.0 )
-        {
-          mMElem = 0;
-        }
-        else
-        {
-          ccorrelation = 0;
-          
-          for( featCol = 0 ; featCol < featSize ; ++featCol )
-          {
-            ccorrelation += ( feat1Ptr[ featCol ] * feat2Ptr[ featCol ] ) / cc_norm;
-          }
-          
-          mMElem = ABS( ccorrelation );
-        }
-      }
-      else
-      {
-        params.glbMutexptr_->unLock();
-      }
-    }
-    
-    if( progress.Increment() )
-    {
-      TEAGN_LOGERR( "Canceled by the user" );
-      return;
-    }    
-  }
-  
-  params.returnValue_ = true;
-}
-
-void TePDIMMIOMatching::matrix2Tiff( 
-  const TePDIMtxDoubleAdptInt& input_matrix,
-  const std::string& out_file_name,
-  const MaximasListT& maxima_points )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_matrix.getNLines() > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_matrix.getNCols() > 0 ), 
-    "Invalid matrix cols" )
-    
-  double value = 0;
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_matrix.getNLines(),
-    input_matrix.getNCols() );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  
-  for( unsigned int line = 0 ; 
-    line < input_matrix.getNLines() ; ++line ) {
-    for( unsigned int col = 0 ; 
-      col < input_matrix.getNCols() ; 
-      ++col ) 
-    {
-      input_matrix.getValue( line, col, value );
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        MIN( value, 254.0 ), 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw maxima points */
-  
-  MaximasListT::const_iterator maximas_it = 
-    maxima_points.begin();
-  MaximasListT::const_iterator maximas_it_end = 
-    maxima_points.end();
-    
-  while( maximas_it != maximas_it_end ) {
-    const unsigned int& x = maximas_it->first;
-    
-    TEAGN_TRUE_OR_THROW( ( ((int)x) < (int)input_matrix.getNCols() ),
-      "Invalid maxima column" )
-    const unsigned int& y = maximas_it->second;
-    TEAGN_TRUE_OR_THROW( ( ((int)y) < (int)input_matrix.getNLines() ),
-      "Invalid maxima line" )
-    
-    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-      255.0, 0 ),
-      "Error writing raster" )
-      
-    ++maximas_it;
-  }  
-}
-
-void TePDIMMIOMatching::matrix2Tiff( 
-  const TePDIMtxDoubleAdptInt& input_matrix,
-  const std::string& out_file_name,
-  const TeCoordPairVect& tiepoints,
-  bool usePt1 )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_matrix.getNLines() > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_matrix.getNCols() > 0 ), 
-    "Invalid matrix cols" )
-    
-  double value = 0;
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_matrix.getNLines(),
-    input_matrix.getNCols() );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  
-  for( unsigned int line = 0 ; 
-    line < input_matrix.getNLines() ; ++line ) {
-    for( unsigned int col = 0 ; 
-      col < input_matrix.getNCols() ; 
-      ++col ) 
-    {
-      input_matrix.getValue( line, col, value );
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        MIN( value, 254.0 ), 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw maxima points */
-  
-  TeCoordPairVect::const_iterator it = 
-    tiepoints.begin();
-  TeCoordPairVect::const_iterator it_end = 
-    tiepoints.end();
-  
-  int tpx = 0;
-  int tpy = 0;
-    
-  while( it != it_end ) {
-    if( usePt1 )
-    {
-      tpx = (int)it->pt1.x();
-      tpy = (int)it->pt1.y();
-    }
-    else
-    {
-      tpx = (int)it->pt2.x();
-      tpy = (int)it->pt2.y();
-    }
-    
-    TEAGN_TRUE_OR_THROW( ( tpx < (int)input_matrix.getNCols() ),
-      "Invalid maxima column" )
-    TEAGN_TRUE_OR_THROW( ( tpx >= 0 ),
-      "Invalid maxima column" )
-    TEAGN_TRUE_OR_THROW( ( tpy < (int)input_matrix.getNLines() ),
-      "Invalid maxima line" )
-    TEAGN_TRUE_OR_THROW( ( tpy >= 0 ),
-      "Invalid maxima line" )           
-    
-    TEAGN_TRUE_OR_THROW( out_raster.setElement( tpx, tpy, 
-      255.0, 0 ),
-      "Error writing raster" )
-      
-    ++it;
-  }  
-}
-
-void TePDIMMIOMatching::features2Tiff( 
-  unsigned int corr_window_width,
-  const MaximasListT& img_maxima_points,
-  TePDIMatrix< double >& img_features_matrix,
-  const std::string& filenameaddon )
-{
-  TEAGN_TRUE_OR_THROW( ( img_features_matrix.GetLines() ==
-    img_maxima_points.size() ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( img_features_matrix.GetColumns() ==
-    ( corr_window_width * corr_window_width ) ), 
-    "Invalid matrix columns" )
-  TEAGN_TRUE_OR_THROW( ( corr_window_width > 0 ),
-    "Invalid corr_window_width" )   
-    
-  MaximasListT::const_iterator maxIt = img_maxima_points.begin();
-
-  for( unsigned int curr_wind_index = 0 ; 
-    curr_wind_index < img_features_matrix.GetLines() ;
-    ++curr_wind_index ) {
-    
-    // finding feature min and max
-    
-    double featMin = DBL_MAX;
-    double featMax = -1.0 * featMin;
-    
-    for( unsigned int fcol = 0 ; fcol < img_features_matrix.GetColumns();
-      ++fcol )
-    {
-      if( img_features_matrix( curr_wind_index, fcol ) < featMin )
-      {
-        featMin = img_features_matrix( curr_wind_index, fcol );
-      }
-      if( img_features_matrix( curr_wind_index, fcol ) > featMax )
-      {
-        featMax = img_features_matrix( curr_wind_index, fcol );
-      }
-    }
-    
-    double featRange = ( featMin != featMax ) ? ( featMax - featMin ) : 1.0;
-    double featMultFac = 255.0 / featRange;
-    
-    // saving output
-    
-    TeRasterParams params;
-    params.setNLinesNColumns( corr_window_width,
-      corr_window_width );
-    params.nBands( 1 );
-    params.setDataType( TeUNSIGNEDCHAR, -1 );
-    params.nBands( 1 );
-    params.decoderIdentifier_ = "TIF";
-    params.mode_ = 'c';
-    params.fileName_ = filenameaddon + "_" + Te2String( maxIt->first, 0 ) + 
-      "_" + Te2String( maxIt->second, 0 ) + ".tif";
-    
-    TeRaster out_raster( params );
-    TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-    
-    for( unsigned int line = 0 ; line < corr_window_width ; ++line ) {
-      for( unsigned int col = 0 ; col < corr_window_width ; ++col ) {
-
-        TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-          ( img_features_matrix( curr_wind_index, ( line * 
-          corr_window_width ) + col ) - featMin ) * featMultFac, 0 ), 
-          "Error writing raster" )
-      }  
-    }
-    
-    ++maxIt;
-  }
-}
-
-bool TePDIMMIOMatching::bicubicResampleMatrix( const TePDIMtxDoubleAdptInt& inputMatrix,
-  unsigned int outLines, unsigned int outCols, bool progressEnabled,
-  TeMutex& globalMutex, double outMinValue, double outMaxValue,
-  TePDIMtxDoubleAdptInt& outputMatrix )
-{
-  globalMutex.lock();
-  
-  if( ! outputMatrix.reset( outLines, outCols ) )
-  {
-    globalMutex.unLock();
-    
-    TEAGN_LOGERR( "Output matrix reset error" );
-  }
-  
-  globalMutex.unLock();
-  
-  const unsigned int inLines = inputMatrix.getNLines();
-  const unsigned int inCols = inputMatrix.getNCols();
-  const int lastInLineIdx = inLines - 1;
-  const int lastInColIdx = inCols - 1;
-  const double yResFact = ((double)outLines) / ((double)inLines);
-  const double xResFact = ((double)outCols) / ((double)inCols);
-  const double bicubic_columns_bound = ((double)inCols) - 2;
-  const double bicubic_lines_bound = ((double)inLines) - 2;
-  const double bicubic_kernel_parameter = -1.0;
-  
-  double inputLine = 0;
-  double inputCol = 0;
-  unsigned int outLine = 0;
-  unsigned int outCol = 0;
-  double value = 0;
-  unsigned int  bicubic_grid_input_line = 0;
-  unsigned int  bicubic_grid_input_col = 0;
-  unsigned int  bicubic_buffer_line = 0;
-  unsigned int  bicubic_buffer_col = 0;  
-  double bicubic_offset_x;
-  double bicubic_offset_y;
-  double bicubic_h_weights[4];
-  double bicubic_v_weights[4];  
-  double bicubic_h_weights_sum = 0;
-  double bicubic_v_weights_sum = 0;
-  double bicubic_int_line_accum = 0;
-  double bicubic_int_lines_values[4];
-  int correctedInputLine = 0;
-  int correctedInputCol = 0;
-  
-  TePDIPIManager progress( "Resampling", outLines, 
-     progressEnabled );  
-  
-  for( outLine = 0 ; outLine < outLines ; ++outLine )
-  {
-    inputLine =  ((double)outLine) / yResFact;
-    
-    for( outCol = 0 ; outCol < outCols ; ++outCol )
-    {
-      inputCol =  ((double)outCol) / xResFact;
-      
-      if( ( inputCol < 1.0 ) || ( inputLine < 1.0 ) || ( inputCol >= 
-        bicubic_columns_bound ) || ( inputLine >= bicubic_lines_bound ) ) 
-      {
-        /* Near neighborhood interpolation will be used */
-        
-        correctedInputLine = (int)TeRound( inputLine );
-        correctedInputLine = MAX( 0, correctedInputLine );
-        correctedInputLine = MIN( lastInLineIdx, correctedInputLine );
-        
-        correctedInputCol = (int)TeRound( inputCol );
-        correctedInputCol = MAX( 0, correctedInputCol );
-        correctedInputCol = MIN( lastInColIdx, correctedInputCol );        
-        
-        inputMatrix.getValue( correctedInputLine, correctedInputCol, value );
-        outputMatrix.setValue( outLine , outCol, value );
-      } else {
-        bicubic_grid_input_line = ( (unsigned int)floor( inputLine ) ) - 1;
-        bicubic_grid_input_col = ( (unsigned int)floor( inputCol ) ) - 1;
-        
-        /* Bicubic weights calcule for the required position */
-        
-        bicubic_offset_x = inputCol - (double)( bicubic_grid_input_col + 1 );
-        bicubic_offset_y = inputLine - (double)( bicubic_grid_input_line + 1 );    
-        
-        bicubic_h_weights[0] = BICUBIC_KERNEL( 1.0 + bicubic_offset_x, 
-          bicubic_kernel_parameter );
-        bicubic_h_weights[1] = BICUBIC_KERNEL( bicubic_offset_x, 
-          bicubic_kernel_parameter );
-        bicubic_h_weights[2] = BICUBIC_KERNEL( 1.0 - bicubic_offset_x, 
-          bicubic_kernel_parameter );
-        bicubic_h_weights[3] = BICUBIC_KERNEL( 2.0 - bicubic_offset_x, 
-          bicubic_kernel_parameter );
-          
-        bicubic_v_weights[0] = BICUBIC_KERNEL( 1.0 + bicubic_offset_y, 
-          bicubic_kernel_parameter );
-        bicubic_v_weights[1] = BICUBIC_KERNEL( bicubic_offset_y, 
-          bicubic_kernel_parameter );
-        bicubic_v_weights[2] = BICUBIC_KERNEL( 1.0 - bicubic_offset_y, 
-          bicubic_kernel_parameter );
-        bicubic_v_weights[3] = BICUBIC_KERNEL( 2.0 - bicubic_offset_y, 
-          bicubic_kernel_parameter );
-          
-        bicubic_h_weights_sum = bicubic_h_weights[0] + bicubic_h_weights[1] +
-          bicubic_h_weights[2] + bicubic_h_weights[3];
-        bicubic_v_weights_sum = bicubic_v_weights[0] + bicubic_v_weights[1] +
-          bicubic_v_weights[2] + bicubic_v_weights[3];
-        
-        /* interpolating the value */
-        
-        for( bicubic_buffer_line = 0 ; bicubic_buffer_line < 4 ; 
-          ++bicubic_buffer_line) {
-          
-          bicubic_int_line_accum = 0;
-          
-          for( bicubic_buffer_col = 0 ; bicubic_buffer_col < 4 ; 
-            ++bicubic_buffer_col ) 
-          {
-            inputMatrix.getValue( bicubic_grid_input_line + bicubic_buffer_line, 
-                bicubic_grid_input_col + bicubic_buffer_col,
-                value );            
-            
-            bicubic_int_line_accum += value * 
-              bicubic_h_weights[ bicubic_buffer_col ];
-          }
-          
-          bicubic_int_lines_values[ bicubic_buffer_line ] = 
-            bicubic_int_line_accum / bicubic_h_weights_sum;
-        }
-        
-        value = bicubic_int_lines_values[ 0 ] * bicubic_v_weights[ 0 ] +
-          bicubic_int_lines_values[ 1 ] * bicubic_v_weights[ 1 ] +
-          bicubic_int_lines_values[ 2 ] * bicubic_v_weights[ 2 ] +
-          bicubic_int_lines_values[ 3 ] * bicubic_v_weights[ 3 ];
-        value = value / bicubic_v_weights_sum;
-        
-        if( value > outMaxValue )
-        {
-          outputMatrix.setValue( outLine , outCol, outMaxValue );
-        }
-        else if( value < outMinValue )
-        {
-          outputMatrix.setValue( outLine , outCol, outMinValue );
-        }
-        else
-        {  
-          outputMatrix.setValue( outLine , outCol, value );
-        }
-      }
-    }
-    
-    if( progress.Increment() )
-    {
-      TEAGN_LOGMSG( "Canceled by the user" );
-      return false;
-    }
-  }
- 
-  return true;
-}
-
-
+#include "TePDIMMIOMatching.hpp"
+
+#include "TePDIUtils.hpp"
+#include "TePDITypes.hpp"
+
+#include <TeThreadJobsManager.h>
+#include <TeFunctionCallThreadJob.h>
+#include <TeCoord2D.h>
+#include <TeGTFactory.h>
+#include <TeDefines.h>
+#include <TeMutex.h>
+#include <TeUtils.h>
+
+#include <math.h>
+#include <limits.h>
+#include <TeRTree.h>
+
+#include <map>
+
+#define BICUBIC_MODULE( x ) ( ( x < 0 ) ? ( -1 * x ) : x )
+#define BICUBIC_K1( x , a ) ( ( ( a + 2 ) * x * x * x ) - \
+  ( ( a + 3 ) * x * x ) + 1 )
+#define BICUBIC_K2( x , a ) ( ( a * x * x * x ) - ( 5 * a * x * x ) + \
+  ( 8 * a * x ) - ( 4 * a ) )
+#define BICUBIC_RANGES(x,a) \
+  ( ( ( 0 <= x ) && ( x <= 1 ) ) ? \
+    BICUBIC_K1(x,a) \
+  : ( ( ( 1 < x ) && ( x <= 2 ) ) ? \
+      BICUBIC_K2(x,a) \
+    : 0 ) )
+#define BICUBIC_KERNEL( x , a ) BICUBIC_RANGES( BICUBIC_MODULE(x) , a )
+
+TePDIMMIOMatching::TePDIMMIOMatching()
+: moravecDownSampleFactor_( 1.5 ), moravecUpSampleFactor_( 0.5 ),
+moravecRepeatabilityMinTolerance_( 3.0 )
+{
+}
+
+
+TePDIMMIOMatching::~TePDIMMIOMatching()
+{
+}
+
+bool TePDIMMIOMatching::CheckParameters( const TePDIParameters& parameters ) const
+{
+  /* Checking input_image1_ptr */
+    
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_image1_ptr", input_image1_ptr ),
+    "Missing parameter: input_image1_ptr" );
+  TEAGN_TRUE_OR_RETURN( input_image1_ptr.isActive(),
+    "Invalid parameter: input_image1_ptr inactive" );
+  TEAGN_TRUE_OR_RETURN( input_image1_ptr->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: input_image1_ptr not ready" );
+  
+  /* Checking matching method */
+  
+  FeatMatchingMethod matching_method = TePDIMMIOMatching::NormCrossCorrMethod;
+  if( parameters.CheckParameter< FeatMatchingMethod >( 
+    "matching_method" ) ) 
+  {
+    parameters.GetParameter( "matching_method", matching_method );
+    
+    TEAGN_TRUE_OR_RETURN( 
+      ( matching_method == TePDIMMIOMatching::NormCrossCorrMethod ),
+      "Invalid parameter : matching_method" );
+  }     
+    
+  /* Checking input_channel1 */
+    
+  unsigned int input_channel1 = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_channel1", input_channel1 ),
+    "Missing parameter: input_channel1" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( (int)input_channel1 ) < 
+    input_image1_ptr->params().nBands() ),
+    "Invalid parameter: input_channel1" );
+  
+    
+  /* Checking input_image1_ptr */
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_image2_ptr", input_image2_ptr ),
+    "Missing parameter: input_image2_ptr" );
+  TEAGN_TRUE_OR_RETURN( input_image2_ptr.isActive(),
+    "Invalid parameter: input_image2_ptr inactive" );
+  TEAGN_TRUE_OR_RETURN( input_image2_ptr->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: input_image2_ptr not ready" );    
+    
+  /* Checking input_channel2 */
+    
+  unsigned int input_channel2 = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_channel2", input_channel2 ),
+    "Missing parameter: input_channel2" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( (int)input_channel2 ) < 
+    input_image2_ptr->params().nBands() ),
+    "Invalid parameter: input_channel2" );
+    
+  /* Checking out_tie_points_ptr */
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "out_tie_points_ptr", out_tie_points_ptr ),
+    "Missing parameter: out_tie_points_ptr" );
+  TEAGN_TRUE_OR_RETURN( out_tie_points_ptr.isActive(),
+    "Invalid parameter: out_tie_points_ptr inactive" );
+    
+  /* Checking gt_params */
+    
+  TeGTParams gt_params;
+  if( parameters.CheckParameter< TeGTParams >( "gt_params" ) ) {
+    parameters.GetParameter( "gt_params", gt_params );
+    
+    TEAGN_TRUE_OR_RETURN( ( TeGTFactory::instance().find( 
+      gt_params.transformation_name_ ) != 
+      TeGTFactory::instance().end() ),
+      "Invalid parameter : gt_params" )
+  }   
+  
+  /* Checking out_gt_params */
+  
+  TeGTParams::pointer out_gt_params_ptr;
+  if( parameters.CheckParameter< TeGTParams::pointer >( 
+    "out_gt_params_ptr" ) ) 
+  {
+    parameters.GetParameter( "out_gt_params_ptr", out_gt_params_ptr );
+    
+    TEAGN_TRUE_OR_RETURN( ( out_gt_params_ptr.isActive() ),
+      "Invalid parameter : out_gt_params_ptr" )
+  }      
+    
+  /* Checking input_box1 */
+    
+  TeBox input_box1;
+  if( parameters.CheckParameter< TeBox >( "input_box1" ) ) {
+    parameters.GetParameter( "input_box1", input_box1 );
+    
+    TEAGN_TRUE_OR_RETURN( ( input_box1.x1() >= 0 ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( ( input_box1.x2() >= 0 ),
+      "Invalid parameter : input_box1" )      
+    TEAGN_TRUE_OR_RETURN( ( input_box1.y1() >= 0 ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( ( input_box1.y2() >= 0 ),
+      "Invalid parameter : input_box1" )         
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.x1() <= 
+        ( input_image1_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.x2() <= 
+        ( input_image1_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box1" )       
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.y1() <= 
+        ( input_image1_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.y2() <= 
+        ( input_image1_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box1" )        
+      
+    TEAGN_TRUE_OR_RETURN( ( input_box1.x1() < input_box1.x2() ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( ( input_box1.y1() > input_box1.y2() ),
+      "Invalid parameter : input_box1" )                  
+  }
+    
+  /* Checking input_box2 */
+    
+  TeBox input_box2;
+  if( parameters.CheckParameter< TeBox >( "input_box2" ) ) {
+    parameters.GetParameter( "input_box2", input_box2 );
+    
+    TEAGN_TRUE_OR_RETURN( ( input_box2.x1() >= 0 ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( ( input_box2.x2() >= 0 ),
+      "Invalid parameter : input_box2" )      
+    TEAGN_TRUE_OR_RETURN( ( input_box2.y1() >= 0 ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( ( input_box2.y2() >= 0 ),
+      "Invalid parameter : input_box2" )         
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.x1() <= 
+        ( input_image2_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.x2() <= 
+        ( input_image2_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box2" )       
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.y1() <= 
+        ( input_image2_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.y2() <= 
+        ( input_image2_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box2" )   
+           
+    TEAGN_TRUE_OR_RETURN( ( input_box2.x1() < input_box2.x2() ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( ( input_box2.y1() > input_box2.y2() ),
+      "Invalid parameter : input_box1" )               
+  }    
+    
+  /* Checking max_tie_points */
+  
+  unsigned int max_tie_points = 0;
+  if( parameters.CheckParameter< unsigned int >( "max_tie_points" ) ) {
+    parameters.GetParameter( "max_tie_points", max_tie_points );
+    
+    TEAGN_TRUE_OR_RETURN( ( max_tie_points > 0 ),
+      "Invalid parameter : max_tie_points" )    
+  }
+  
+  /* Checking corr_window_width */
+  
+  unsigned int corr_window_width = 0;
+  if( parameters.CheckParameter< unsigned int >( 
+    "corr_window_width" ) ) {
+    
+    parameters.GetParameter( "corr_window_width", 
+      corr_window_width );
+      
+    TEAGN_TRUE_OR_RETURN( ( ( corr_window_width % 2 ) > 0 ),
+      "Invalid parameter : corr_window_width" )      
+    
+    TEAGN_TRUE_OR_RETURN( ( corr_window_width >= 13 ),
+      "Invalid parameter : corr_window_width" )
+  }    
+  
+  /* Checking moravec_window_width */
+  
+  unsigned int moravec_window_width = corr_window_width / 2;
+  if( parameters.CheckParameter< unsigned int >( 
+    "moravec_window_width" ) ) {
+    
+    parameters.GetParameter( "moravec_window_width", 
+      moravec_window_width );
+      
+    TEAGN_TRUE_OR_RETURN( ( ( moravec_window_width % 2 ) > 0 ),
+      "Invalid parameter : moravec_window_width" )      
+    
+    TEAGN_TRUE_OR_RETURN( ( moravec_window_width >= 11 ),
+      "Invalid parameter : corr_window_width" )
+  }   
+  
+  /* Checking pixel_x_relation */
+  
+  double pixel_x_relation = 1.0;
+  if( parameters.CheckParameter< double >( "pixel_x_relation" ) ) {
+    parameters.GetParameter( "pixel_x_relation", pixel_x_relation );
+    
+    TEAGN_TRUE_OR_RETURN( ( pixel_x_relation != 0.0 ),
+      "Invalid parameter : pixel_x_relation" )
+  }
+  
+  /* Checking pixel_y_relation */
+  
+  double pixel_y_relation = 1.0;
+  if( parameters.CheckParameter< double >( "pixel_y_relation" ) ) {
+    parameters.GetParameter( "pixel_y_relation", pixel_y_relation );
+    
+    TEAGN_TRUE_OR_RETURN( ( pixel_y_relation != 0.0 ),
+      "Invalid parameter : pixel_y_relation" )
+  }
+  
+  TeSharedPtr< std::vector< double > > out_tie_points_weights_ptr;
+  if( parameters.CheckParameter< TeSharedPtr< std::vector< double > > >( 
+    "out_tie_points_weights_ptr" ) ) {
+    parameters.GetParameter( "out_tie_points_weights_ptr", 
+      out_tie_points_weights_ptr );
+    
+    TEAGN_TRUE_OR_RETURN( out_tie_points_weights_ptr.isActive(),
+      "Invalid parameter : out_tie_points_weights_ptr" )
+  }
+  
+  /* Checking mask_image1_ptr */
+  
+  TePDITypes::TePDIRasterPtrType mask_image1_ptr;
+  if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "mask_image1_ptr" ) ) 
+  {
+    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+      "mask_image1_ptr", mask_image1_ptr ),
+      "Missing parameter: mask_image1_ptr" );
+    TEAGN_TRUE_OR_RETURN( mask_image1_ptr.isActive(),
+      "Invalid parameter: mask_image1_ptr inactive" );
+    TEAGN_TRUE_OR_RETURN( mask_image1_ptr->params().status_ != 
+      TeRasterParams::TeNotReady, 
+      "Invalid parameter: mask_image1_ptr not ready" );  
+    TEAGN_TRUE_OR_RETURN( mask_image1_ptr->params().nlines_ == 
+      input_image1_ptr->params().nlines_,
+      "Invalid parameter: mask_image1_ptr" );      
+    TEAGN_TRUE_OR_RETURN( mask_image1_ptr->params().ncols_ == 
+      input_image1_ptr->params().ncols_,
+      "Invalid parameter: mask_image1_ptr" );        
+  }
+  
+  /* Checking mask_image2_ptr */
+  
+  TePDITypes::TePDIRasterPtrType mask_image2_ptr;
+  if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "mask_image2_ptr" ) ) 
+  {
+    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+      "mask_image2_ptr", mask_image2_ptr ),
+      "Missing parameter: mask_image2_ptr" );
+    TEAGN_TRUE_OR_RETURN( mask_image2_ptr.isActive(),
+      "Invalid parameter: mask_image2_ptr inactive" );
+    TEAGN_TRUE_OR_RETURN( mask_image2_ptr->params().status_ != 
+      TeRasterParams::TeNotReady, 
+      "Invalid parameter: mask_image2_ptr not ready" );  
+    TEAGN_TRUE_OR_RETURN( mask_image2_ptr->params().nlines_ == 
+      input_image2_ptr->params().nlines_,
+      "Invalid parameter: mask_image2_ptr" );      
+    TEAGN_TRUE_OR_RETURN( mask_image2_ptr->params().ncols_ == 
+      input_image2_ptr->params().ncols_,
+      "Invalid parameter: mask_image2_ptr" );        
+  }  
+  
+  return true;
+}
+
+bool TePDIMMIOMatching::RunImplementation()
+{
+  /* Retriving Parameters */
+  
+  FeatMatchingMethod matching_method = NormCrossCorrMethod;
+  if( params_.CheckParameter< FeatMatchingMethod >( 
+    "matching_method" ) ) 
+  {
+    params_.GetParameter( "matching_method", matching_method );
+  }     
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  params_.GetParameter( "input_image1_ptr", input_image1_ptr ); 
+  
+  unsigned int input_channel1 = 0;
+  params_.GetParameter( "input_channel1", input_channel1 );
+  
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  params_.GetParameter( "input_image2_ptr", input_image2_ptr ); 
+  
+  unsigned int input_channel2 = 0;
+  params_.GetParameter( "input_channel2", input_channel2 );  
+    
+  TeBox input_box1;
+  if( params_.CheckParameter< TeBox >( "input_box1" ) ) {
+    params_.GetParameter( "input_box1", input_box1 );
+  } else {
+    TeBox input_box1_proj = input_image1_ptr->params().box();
+    
+    TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, input_image1_ptr,
+      input_box1 );
+  }
+  
+  TeBox input_box2;
+  if( params_.CheckParameter< TeBox >( "input_box2" ) ) {
+    params_.GetParameter( "input_box2", input_box2 );
+  } else {
+    TeBox input_box2_proj = input_image2_ptr->params().box();
+    
+    TePDIUtils::MapCoords2RasterIndexes( input_box2_proj, input_image2_ptr,
+      input_box2 );
+  }         
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
+  params_.GetParameter( "out_tie_points_ptr", out_tie_points_ptr );
+  
+  double pixel_x_relation = 1.0;
+  if( params_.CheckParameter< double >( "pixel_x_relation" ) ) {
+    params_.GetParameter( "pixel_x_relation", pixel_x_relation );
+  }
+  
+  double pixel_y_relation = 1.0;
+  if( params_.CheckParameter< double >( "pixel_y_relation" ) ) {
+    params_.GetParameter( "pixel_y_relation", pixel_y_relation );
+  }    
+  
+  TeGTParams gt_params;
+  gt_params.out_rem_strat_ = TeGTParams::RANSACRemotion;
+  gt_params.max_dmap_error_ = 2.0;
+  gt_params.max_imap_error_ = gt_params.max_dmap_error_ /
+    MIN( pixel_x_relation, pixel_y_relation );
+  gt_params.transformation_name_ = "affine";
+  if( params_.CheckParameter< TeGTParams >( "gt_params" ) ) {
+    params_.GetParameter( "gt_params", gt_params );
+  }
+  
+  bool enable_multi_thread = false;
+  if( params_.CheckParameter< int >( "enable_multi_thread" ) ) {
+    enable_multi_thread = true;
+  }
+  
+  bool enable_threaded_raster_read = false;
+  if( params_.CheckParameter< int >( "enable_threaded_raster_read" ) ) {
+    enable_threaded_raster_read = true;
+  }  
+  
+  bool skip_geom_filter = false;
+  if( params_.CheckParameter< int >( "skip_geom_filter" ) ) {
+    skip_geom_filter = true;
+  }  
+  
+  unsigned int max_tie_points = 1000;
+  if( params_.CheckParameter< unsigned int >( "max_tie_points" ) ) {
+    params_.GetParameter( "max_tie_points", max_tie_points );
+  }    
+  
+  unsigned int corr_window_width = 21;
+  if( params_.CheckParameter< unsigned int >( 
+    "corr_window_width" ) ) {
+    
+    params_.GetParameter( "corr_window_width", corr_window_width );
+  }    
+  
+  unsigned int moravec_window_width = 11;
+  if( params_.CheckParameter< unsigned int >( "moravec_window_width" ) ) 
+  {
+    params_.GetParameter( "moravec_window_width", 
+      moravec_window_width );
+  }     
+  
+  TeSharedPtr< std::vector< double > > out_tie_points_weights_ptr;
+  if( params_.CheckParameter< TeSharedPtr< std::vector< double > > >( 
+    "out_tie_points_weights_ptr" ) ) 
+  {
+    params_.GetParameter( "out_tie_points_weights_ptr", 
+      out_tie_points_weights_ptr );
+  }
+  else
+  {
+    out_tie_points_weights_ptr.reset( new std::vector< double > );
+  } 
+  
+  bool enableMoravecDownsampledFilter = true;
+  bool enableMoravecUpsampledFilter = false;
+  if( params_.CheckParameter< int >( "disable_reap_filter" ) ) 
+  {
+    enableMoravecDownsampledFilter = false;
+  }
+  else
+  {
+    if( params_.CheckParameter< int >( "enable_upsampled_filter" ) ) {
+      enableMoravecUpsampledFilter = true;
+    } 
+  }
+    
+  TePDITypes::TePDIRasterPtrType mask_image1_ptr;
+  if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "mask_image1_ptr" ) ) 
+  {
+    params_.GetParameter( "mask_image1_ptr", mask_image1_ptr );    
+  }
+  
+  TePDITypes::TePDIRasterPtrType mask_image2_ptr;
+  if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "mask_image2_ptr" ) ) 
+  {
+    params_.GetParameter( "mask_image2_ptr", mask_image2_ptr );    
+  }  
+  
+  bool enableSubImageSearch = true;
+  if( params_.CheckParameter< int >( "disable_subimage_search" ) ) 
+  {
+    enableSubImageSearch = false;
+  }    
+  
+  TePDITypes::TePDIRasterPtrType out_maximas_image1_ptr;
+  if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "out_maximas_image1_ptr" ) ) 
+  {
+    params_.GetParameter( "out_maximas_image1_ptr", out_maximas_image1_ptr );    
+  }  
+  
+  TePDITypes::TePDIRasterPtrType out_maximas_image2_ptr;
+  if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "out_maximas_image2_ptr" ) ) 
+  {
+    params_.GetParameter( "out_maximas_image2_ptr", out_maximas_image2_ptr );    
+  }    
+  
+  // The original boxes postion over the original images
+  
+  const unsigned int orig_box1_x_off = (unsigned int)
+    input_box1.lowerLeft().x();
+  const unsigned int orig_box1_y_off = (unsigned int)
+    input_box1.upperRight().y();
+  const unsigned int orig_box1_nlines = 1 + (unsigned int)
+    ABS( input_box1.height() );
+  const unsigned int orig_box1_ncols = 1 + (unsigned int)
+    ABS( input_box1.width() );
+  
+  const unsigned int orig_box2_x_off = (unsigned int)
+    input_box2.lowerLeft().x();
+  const unsigned int orig_box2_y_off = (unsigned int)
+    input_box2.upperRight().y();
+  const unsigned int orig_box2_nlines = 1 + (unsigned int)
+    ABS( input_box2.height() );
+  const unsigned int orig_box2_ncols = 1 + (unsigned int)
+    ABS( input_box2.width() );  
+  
+  /* Calculating the rescale factors 
+     factor = rescaled_orignal_image / original_image */
+  
+  double i1XRescFact = 1.0;
+  double i1YRescFact = 1.0;
+  double i2XRescFact = 1.0;
+  double i2YRescFact = 1.0;
+  {
+    double mean_pixel_relation = ( pixel_x_relation + pixel_y_relation ) /
+      2.0;
+      
+    if( mean_pixel_relation > 1.0 ) {
+      /* The image 1 has poor resolution - bigger pixel resolution values -
+         and image 2 needs to be rescaled down */
+      
+      i2XRescFact = 1.0 / pixel_x_relation;
+      i2YRescFact = 1.0 / pixel_y_relation;
+    } else if( mean_pixel_relation < 1.0 ) {
+      /* The image 2 has poor resolution - bigger pixel resolution values
+        and image 1 needs to be rescaled down */
+      
+      i1XRescFact = pixel_x_relation;
+      i1YRescFact = pixel_y_relation;
+    }
+  }   
+  
+  /* Calculating the max tie-points to be generated for each image
+     trying to keep the same tie-point density for both images */
+     
+  unsigned int img1MaxTps = max_tie_points;
+  unsigned int img2MaxTps = max_tie_points;
+  
+  {
+    double resc_box1_nlines =  ( (double)orig_box1_nlines  ) * 
+      i1YRescFact;
+    double resc_box1_ncols =  ( (double)orig_box1_ncols ) * 
+      i1XRescFact;
+    double resc_box2_nlines =  ( (double)orig_box2_nlines  ) * 
+      i2YRescFact;
+    double resc_box2_ncols =  ( (double)orig_box2_ncols ) * 
+      i2XRescFact;
+      
+    double resc_box1_area = resc_box1_nlines * resc_box1_ncols;
+    double resc_box2_area = resc_box2_nlines * resc_box2_ncols;
+      
+    if( resc_box1_area > resc_box2_area )
+    {
+      img1MaxTps = (unsigned int)( 
+        resc_box1_area / 
+        ( resc_box2_area / ( (double)max_tie_points ) ) );
+    }
+    else if( resc_box1_area < resc_box2_area )
+    {
+      img2MaxTps = (unsigned int)( 
+        resc_box2_area / 
+        ( resc_box1_area / ( (double)max_tie_points ) ) ); 
+    }
+  }
+  
+  // Moravec specific variables
+
+  unsigned int moravecDSWindowSize = (unsigned int)( 
+    moravec_window_width / moravecDownSampleFactor_ );
+  if( ( moravecDSWindowSize % 2 ) == 0 ) ++moravecDSWindowSize;
+  TEAGN_DEBUG_CONDITION( moravecDSWindowSize > 2, 
+    "Invalid moravecDSWindowSize ")
+
+  unsigned int moravecUSWindowSize = (unsigned int)( 
+    moravec_window_width / moravecUpSampleFactor_ );
+  if( ( moravecUSWindowSize % 2 ) == 0 ) ++moravecUSWindowSize;
+  TEAGN_DEBUG_CONDITION( moravecUSWindowSize > 2, 
+    "Invalid moravecUSWindowSize ")
+       
+  /* Calculating the number of allowed threads - this process
+     not included into the count */
+  
+  if( enable_multi_thread )
+  {
+    jobsMan_.setAutoMaxSimulJobs();
+  }
+  else
+  {
+    jobsMan_.setMaxSimulJobs( 0 );
+  }
+  
+ /* Loading images */
+ 
+  TePDIPIManager progress( "Matching", 6, progress_enabled_ ); 
+ 
+//jobsMan_.setMaxSimulJobs( 0 );   
+//jobsMan_.setAutoMaxSimulJobs();
+  
+  TeSharedPtr< TePDIMtxDoubleAdptInt > img1_matrix_ptr;
+  TeSharedPtr< TePDIMtxDoubleAdptInt > img1_matrix_ds_ptr; // Downsampled version
+  TeSharedPtr< TePDIMtxDoubleAdptInt > img1_matrix_us_ptr; // Upsampled version  
+  
+  MaskMatrixT mask_matrix1;
+  mask_matrix1.Reset( MaskMatrixT::AutoMemPol );
+
+  {
+    createImgMatrix( input_image1_ptr->params().dataType_[input_channel1],
+      img1_matrix_ptr );
+    if( enableMoravecDownsampledFilter )
+    {
+      createImgMatrix( input_image1_ptr->params().dataType_[input_channel1],
+        img1_matrix_ds_ptr );
+    }
+    if( enableMoravecUpsampledFilter )
+    {
+      createImgMatrix( input_image1_ptr->params().dataType_[input_channel1],
+        img1_matrix_us_ptr );
+    }
+  }
+  
+  TeSharedPtr< TePDIMtxDoubleAdptInt > img2_matrix_ptr;
+  TeSharedPtr< TePDIMtxDoubleAdptInt > img2_matrix_ds_ptr; // Downsampled version
+  TeSharedPtr< TePDIMtxDoubleAdptInt > img2_matrix_us_ptr; // Upsampled version
+  
+  MaskMatrixT mask_matrix2;
+  mask_matrix2.Reset( MaskMatrixT::AutoMemPol );
+
+  {
+    createImgMatrix( input_image2_ptr->params().dataType_[input_channel2],
+      img2_matrix_ptr );
+    if( enableMoravecDownsampledFilter )
+    {
+      createImgMatrix( input_image2_ptr->params().dataType_[input_channel2],
+        img2_matrix_ds_ptr );
+    }
+    if( enableMoravecUpsampledFilter )
+    {
+      createImgMatrix( input_image2_ptr->params().dataType_[input_channel2],
+        img2_matrix_us_ptr );  
+    }
+  }
+ 
+  {
+    LoadImageParams img1pars;
+    
+    img1pars.progress_enabled_ = progress_enabled_;
+    img1pars.glb_mem_lock_ptr_ = &globalMutex_;
+    img1pars.moravecDownSampleFactor_ = moravecDownSampleFactor_;
+    img1pars.moravecUpSampleFactor_ = moravecUpSampleFactor_;
+    img1pars.returnValue_ = true;
+    img1pars.generateDownsampledImage_ = enableMoravecDownsampledFilter;
+    img1pars.generateUpsampledImage_ = enableMoravecUpsampledFilter;    
+    
+    img1pars.input_image_ptr_ = input_image1_ptr;
+    img1pars.mask_image_ptr_ = mask_image1_ptr;
+    img1pars.input_image_channel_ = input_channel1;
+    img1pars.img_matrix_ptr_ = img1_matrix_ptr.nakedPointer();
+    img1pars.img_matrix_ds_ptr_ = img1_matrix_ds_ptr.nakedPointer();
+    img1pars.img_matrix_us_ptr_ = img1_matrix_us_ptr.nakedPointer();
+    img1pars.mask_matrix_ptr_ = &mask_matrix1;
+    img1pars.in_box_x_off_ = orig_box1_x_off;
+    img1pars.in_box_y_off_ = orig_box1_y_off;
+    img1pars.in_box_nlines_ = orig_box1_nlines;
+    img1pars.in_box_ncols_ = orig_box1_ncols;
+    img1pars.origImgXRescFact_ = i1XRescFact;
+    img1pars.origImgYRescFact_ = i1YRescFact;
+    
+    LoadImageParams img2pars = img1pars;
+    img2pars.input_image_ptr_ = input_image2_ptr;
+    img2pars.mask_image_ptr_ = mask_image2_ptr;
+    img2pars.input_image_channel_ = input_channel2;
+    img2pars.img_matrix_ptr_ = img2_matrix_ptr.nakedPointer();
+    img2pars.img_matrix_ds_ptr_ = img2_matrix_ds_ptr.nakedPointer();
+    img2pars.img_matrix_us_ptr_ = img2_matrix_us_ptr.nakedPointer();
+    img2pars.mask_matrix_ptr_ = &mask_matrix2;
+    img2pars.in_box_x_off_ = orig_box2_x_off;
+    img2pars.in_box_y_off_ = orig_box2_y_off;
+    img2pars.in_box_nlines_ = orig_box2_nlines;
+    img2pars.in_box_ncols_ = orig_box2_ncols;    
+    img2pars.origImgXRescFact_ = i2XRescFact;
+    img2pars.origImgYRescFact_ = i2YRescFact;
+    
+    if( enable_threaded_raster_read && enable_multi_thread )
+    {
+      TeFunctionCallThreadJob job1;
+      job1.jobFunc_ = loadImage;
+      job1.jobFuncParsPtr_ = (void*)&img1pars;
+      jobsMan_.executeJob( job1 );
+  
+      TeFunctionCallThreadJob job2;
+      job2.jobFunc_ = loadImage;
+      job2.jobFuncParsPtr_ = (void*)&img2pars;
+      jobsMan_.executeJob( job2 );
+      
+      jobsMan_.waitAllToFinish();
+    }
+    else
+    {
+      loadImage( (void*)&img1pars );
+      loadImage( (void*)&img2pars );
+    }
+    
+    TEAGN_TRUE_OR_RETURN( img1pars.returnValue_, "Error loading image" )
+    TEAGN_TRUE_OR_RETURN( img2pars.returnValue_, "Error loading image" )
+  }  
+
+/* 
+matrix2Tiff( *img1_matrix_ptr, "img1_matrix_ptr_loaded.tif" );
+matrix2Tiff( *img1_matrix_ds_ptr, "img1_matrix_ds_ptr_loaded.tif" );
+matrix2Tiff( *img1_matrix_us_ptr, "img1_matrix_us_ptr_loaded.tif" );
+matrix2Tiff( *img2_matrix_ptr, "img2_matrix_ptr_loaded.tif" );
+matrix2Tiff( *img2_matrix_ds_ptr, "img2_matrix_ds_ptr_loaded.tif" );
+matrix2Tiff( *img2_matrix_us_ptr, "img2_matrix_us_ptr_loaded.tif" );
+*/
+
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by user" );
+  
+  // Extracting maximas from all images
+  
+//jobsMan_.setMaxSimulJobs( 0 );  
+//jobsMan_.setAutoMaxSimulJobs();
+  MaximasListT img1_maximas_list;
+  MaximasListT img1ds_maximas_list;
+  MaximasListT img1us_maximas_list;
+  MaximasListT img2_maximas_list;
+  MaximasListT img2ds_maximas_list;
+  MaximasListT img2us_maximas_list;
+  
+  {
+    // Creating job execution parameters 
+    
+    TeFunctionCallThreadJob dummyJob;
+    dummyJob.jobFunc_ = extractLocalMaximas;
+    
+    ExtractLocalMaximasParams img1pars;
+    img1pars.seachSubImagesNmb_ = ( enableSubImageSearch ? 9 : 1 );
+    img1pars.returnValue_ = true;
+    img1pars.progressEnabled_ = progress_enabled_;
+    img1pars.glbMutexptr_ = &globalMutex_;
+        
+    img1pars.maximasNumber_ = img1MaxTps;    
+    img1pars.imgMatrixPtr_ = img1_matrix_ptr.nakedPointer();
+    img1pars.outMaximasListPtr_ = &img1_maximas_list;
+    img1pars.moravecWindowSize_ = moravec_window_width;
+    img1pars.maskMatrixPtr_ = ( mask_image1_ptr.isActive() ? (&mask_matrix1) :
+      0 );
+    
+    ExtractLocalMaximasParams img1dspars = img1pars;
+    img1dspars.imgMatrixPtr_ = img1_matrix_ds_ptr.nakedPointer();
+    img1dspars.outMaximasListPtr_ = &img1ds_maximas_list;
+    img1dspars.moravecWindowSize_ = moravecDSWindowSize;
+    img1dspars.maskMatrixPtr_ = 0;
+
+    ExtractLocalMaximasParams img1uspars = img1pars;
+    img1uspars.imgMatrixPtr_ = img1_matrix_us_ptr.nakedPointer();
+    img1uspars.outMaximasListPtr_ = &img1us_maximas_list;
+    img1uspars.moravecWindowSize_ = moravecUSWindowSize;
+    img1uspars.maskMatrixPtr_ = 0;
+    
+    ExtractLocalMaximasParams img2pars = img1pars;
+    img2pars.maximasNumber_ = img2MaxTps;
+    img2pars.imgMatrixPtr_ = img2_matrix_ptr.nakedPointer();
+    img2pars.outMaximasListPtr_ = &img2_maximas_list;
+    img2pars.maskMatrixPtr_ = ( mask_image2_ptr.isActive() ? (&mask_matrix2) :
+      0 );
+    
+    ExtractLocalMaximasParams img2dspars = img2pars;
+    img2dspars.imgMatrixPtr_ = img2_matrix_ds_ptr.nakedPointer();
+    img2dspars.outMaximasListPtr_ = &img2ds_maximas_list;
+    img2dspars.moravecWindowSize_ = moravecDSWindowSize;
+    img2dspars.maskMatrixPtr_ = 0;
+
+    ExtractLocalMaximasParams img2uspars = img2pars;
+    img2uspars.imgMatrixPtr_ = img2_matrix_us_ptr.nakedPointer();
+    img2uspars.outMaximasListPtr_ = &img2us_maximas_list;
+    img2uspars.moravecWindowSize_ = moravecUSWindowSize;
+    img2uspars.maskMatrixPtr_ = 0;
+    
+    // Starting jobs
+    
+    dummyJob.jobFuncParsPtr_ = (void*)&img1pars;
+    jobsMan_.executeJob( dummyJob );     
+    
+    if( enableMoravecDownsampledFilter )
+    {
+      dummyJob.jobFuncParsPtr_ = (void*)&img1dspars;
+      jobsMan_.executeJob( dummyJob ); 
+    }
+    
+    if( enableMoravecUpsampledFilter )
+    {
+      dummyJob.jobFuncParsPtr_ = (void*)&img1uspars;
+      jobsMan_.executeJob( dummyJob ); 
+    }
+  
+    dummyJob.jobFuncParsPtr_ = (void*)&img2pars;
+    jobsMan_.executeJob( dummyJob );     
+    
+    if( enableMoravecDownsampledFilter )
+    {
+      dummyJob.jobFuncParsPtr_ = (void*)&img2dspars;
+      jobsMan_.executeJob( dummyJob );   
+    }
+    
+    if( enableMoravecUpsampledFilter )
+    {
+      dummyJob.jobFuncParsPtr_ = (void*)&img2uspars;
+      jobsMan_.executeJob( dummyJob );   
+    }
+    
+    // Waiting all jobs to finish
+    
+    jobsMan_.waitAllToFinish();
+    
+    TEAGN_TRUE_OR_RETURN( img1pars.returnValue_, 
+      "Error loocking for maximas" )
+    TEAGN_TRUE_OR_RETURN( img1dspars.returnValue_,
+      "Error loocking for maximas" )
+    TEAGN_TRUE_OR_RETURN( img1uspars.returnValue_, 
+      "Error loocking for maximas" )
+    TEAGN_TRUE_OR_RETURN( img2pars.returnValue_, 
+      "Error loocking for maximas" )
+    TEAGN_TRUE_OR_RETURN( img2dspars.returnValue_, 
+      "Error loocking for maximas" )
+    TEAGN_TRUE_OR_RETURN( img2uspars.returnValue_, 
+      "Error loocking for maximas" )
+  }
+  
+
+//matrix2Tiff( *img1_matrix_ptr, "img1_matrix_ptr_max.tif",
+//  img1_maximas_list );
+//matrix2Tiff( *img1_matrix_ds_ptr, "img1_matrix_ds_ptr_max.tif",
+//  img1ds_maximas_list );
+//matrix2Tiff( *img1_matrix_us_ptr, "img1_matrix_us_ptr_max.tif",
+//  img1us_maximas_list );
+//matrix2Tiff( *img2_matrix_ptr, "img2_matrix_ptr_max.tif",
+//  img2_maximas_list );
+//matrix2Tiff( *img2_matrix_ds_ptr, "img2_matrix_ds_ptr_max.tif",
+//  img2ds_maximas_list );
+//matrix2Tiff( *img2_matrix_us_ptr, "img2_matrix_us_ptr_max.tif",
+//  img2us_maximas_list );  
+
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by user" );
+
+  // Applying moravec repeatability filter 
+  
+//jobsMan_.setMaxSimulJobs( 0 );  
+//jobsMan_.setAutoMaxSimulJobs();
+    
+  if( enableMoravecDownsampledFilter )
+  {
+    MaximasListT auxList;
+    
+    moravecRepeatability( img1_maximas_list, img1ds_maximas_list,
+      img1_matrix_ds_ptr->getNCols(),
+      img1_matrix_ds_ptr->getNLines(), 
+      moravecRepeatabilityMinTolerance_ / moravecDownSampleFactor_, 
+      moravecDownSampleFactor_, auxList );
+      
+    img1_maximas_list = auxList;
+  }
+  
+  if( enableMoravecUpsampledFilter )
+  {
+    MaximasListT auxList; 
+    
+    moravecRepeatability( img1_maximas_list, img1us_maximas_list,
+      img1_matrix_us_ptr->getNCols(),
+      img1_matrix_us_ptr->getNLines(), 
+      moravecRepeatabilityMinTolerance_ / moravecUpSampleFactor_, 
+      moravecUpSampleFactor_, auxList );  
+        
+    img1_maximas_list = auxList;
+  }
+  
+  if( enableMoravecDownsampledFilter )
+  {
+    MaximasListT auxList;
+    
+    moravecRepeatability( img2_maximas_list, img2ds_maximas_list,
+      img2_matrix_ds_ptr->getNCols(),
+      img2_matrix_ds_ptr->getNLines(), 
+      moravecRepeatabilityMinTolerance_ / moravecDownSampleFactor_, 
+      moravecDownSampleFactor_, auxList );
+      
+    img2_maximas_list = auxList;
+  }
+    
+  if( enableMoravecUpsampledFilter )
+  {
+    MaximasListT auxList;
+    
+    moravecRepeatability( img2_maximas_list, img2us_maximas_list,
+      img2_matrix_us_ptr->getNCols(),
+      img2_matrix_us_ptr->getNLines(), 
+      moravecRepeatabilityMinTolerance_ / moravecUpSampleFactor_, 
+      moravecUpSampleFactor_, auxList );
+      
+    img2_maximas_list = auxList;
+  }
+
+/*  
+matrix2Tiff( *img1_matrix_ptr, "img1_matrix_ptr_max_repeat.tif",
+  img1_maximas_list );
+matrix2Tiff( *img2_matrix_ptr, "img2_matrix_ptr_max_repeat.tif",
+  img2_maximas_list );
+*/
+  
+  img1us_maximas_list.clear();
+  img1ds_maximas_list.clear();  
+  img2us_maximas_list.clear();
+  img2ds_maximas_list.clear();
+  
+  img1_matrix_ds_ptr.reset();
+  img1_matrix_us_ptr.reset();
+  img2_matrix_ds_ptr.reset();
+  img2_matrix_us_ptr.reset();  
+  
+  // filtering out points closer to images borders to avoid
+  // correlation windows generation errors 
+
+  
+  {
+    /* The radius of a feature window rotated by 90 degrees. 
+     * over the input image */
+    const unsigned int winRadius = (unsigned int)
+      (
+        ceil( 
+          sqrt( 
+            2 
+            * 
+            ( 
+              ( (double)corr_window_width ) 
+              *
+              ( (double)corr_window_width )
+            )
+          ) / 2.0
+        )
+      );
+    
+    unsigned int img1FistValidLine = winRadius;
+    unsigned int img1FistValidCol = winRadius;
+    unsigned int img2FistValidLine = winRadius;
+    unsigned int img2FistValidCol = winRadius;
+    
+    // Removing maximas outside the image 1 allowed bondaries
+    
+    {
+      unsigned int img1LinesBound = img1_matrix_ptr->getNLines() - winRadius;
+      unsigned int img1ColsBound = img1_matrix_ptr->getNCols() - winRadius;
+    
+      MaximasListT::iterator maxIt = img1_maximas_list.begin();
+      MaximasListT::iterator maxItEnd = img1_maximas_list.end();
+      MaximasListT::iterator maxAuxIt;
+      
+      while( maxIt != maxItEnd )
+      {
+        if( ( maxIt->x_ < img1FistValidCol ) ||
+          ( maxIt->x_ >= img1ColsBound ) || 
+          ( maxIt->y_ < img1FistValidLine ) ||
+          ( maxIt->y_ >= img1LinesBound ) )
+        {
+          maxAuxIt = maxIt;
+          ++maxIt;
+          img1_maximas_list.erase( maxAuxIt );
+        }
+        else
+        {
+          ++maxIt;
+        }
+      }
+    }
+    
+    // Removing maximas outside the image 2 allowed bondaries
+    
+    {
+      unsigned int img2LinesBound = img2_matrix_ptr->getNLines() - winRadius;
+      unsigned int img2ColsBound = img2_matrix_ptr->getNCols() - winRadius;
+    
+      MaximasListT::iterator maxIt = img2_maximas_list.begin();
+      MaximasListT::iterator maxItEnd = img2_maximas_list.end();
+      MaximasListT::iterator maxAuxIt;
+      
+      while( maxIt != maxItEnd )
+      {
+        if( ( maxIt->x_ < img2FistValidCol ) ||
+          ( maxIt->x_ >= img2ColsBound ) || 
+          ( maxIt->y_ < img2FistValidLine ) ||
+          ( maxIt->y_ >= img2LinesBound ) )
+        {
+          maxAuxIt = maxIt;
+          ++maxIt;
+          img2_maximas_list.erase( maxAuxIt );
+        }
+        else
+        {
+          ++maxIt;
+        }
+      }
+    }
+  }
+  
+/*
+matrix2Tiff( *img1_matrix_ptr, "img1_matrix_ptr_max_outremoved.tif",
+  img1_maximas_list );
+matrix2Tiff( *img2_matrix_ptr, "img2_matrix_ptr_max_outremoved.tif",
+  img2_maximas_list );  
+*/
+
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by user" );
+  
+  // Generating the output maximas rasters
+  
+  if( out_maximas_image1_ptr.isActive() )
+  {
+    TEAGN_TRUE_OR_RETURN( generateMaximasRaster( *img1_matrix_ptr,
+      img1_maximas_list, *out_maximas_image1_ptr ),
+      "Error generating the maximas image 1" )
+  }
+  
+  if( out_maximas_image2_ptr.isActive() )
+  {
+    TEAGN_TRUE_OR_RETURN( generateMaximasRaster( *img2_matrix_ptr,
+      img2_maximas_list, *out_maximas_image2_ptr ),
+      "Error generating the maximas image 2" )
+  }   
+  
+  /* Generating features matrix */
+  
+  TePDIMatrix< double > img1featMtx;
+  img1featMtx.Reset( TePDIMatrix< double >::RAMMemPol );
+  
+  TePDIMatrix< double > img2featMtx;  
+  img2featMtx.Reset( TePDIMatrix< double >::RAMMemPol );
+  
+  {
+    GenerateCorrelationFeaturesParams params1;
+    
+    switch( matching_method )
+    {
+      case NormCrossCorrMethod :
+      {
+        params1.normalizeWindows_ = true;
+        break;
+      }
+      default :
+      {
+        TEAGN_LOG_AND_THROW( "Invalid correlation method" );
+        break;
+      }
+    }
+    
+    params1.imgMatrixPtr_ = img1_matrix_ptr.nakedPointer();
+    params1.inMaximasListPtr_ = &img1_maximas_list;
+    params1.featMtxPtr_ = &img1featMtx;
+    params1.returnValue_ = true;
+    params1.glbMemLockPtr_ = &globalMutex_;
+    params1.corrWindowsWidth_ = corr_window_width;
+    params1.progressEnabled_ = progress_enabled_;
+    
+    GenerateCorrelationFeaturesParams params2 = params1;
+    params2.imgMatrixPtr_ = img2_matrix_ptr.nakedPointer();
+    params2.inMaximasListPtr_ = &img2_maximas_list;
+    params2.featMtxPtr_ = &img2featMtx;
+    
+    // Starting jobs
+    
+    TeFunctionCallThreadJob dummyJob;
+    dummyJob.jobFunc_ = generateCorrelationFeatures;
+   
+    // Starting jobs
+    
+    dummyJob.jobFuncParsPtr_ = (void*)&params1;
+    jobsMan_.executeJob( dummyJob );     
+    
+    dummyJob.jobFuncParsPtr_ = (void*)&params2;
+    jobsMan_.executeJob( dummyJob );       
+    
+    // Waiting all jobs to finish
+    
+    jobsMan_.waitAllToFinish();
+    
+    TEAGN_TRUE_OR_RETURN( params1.returnValue_, 
+      "Error generating correlation features" )
+    TEAGN_TRUE_OR_RETURN( params2.returnValue_,
+      "Error generating correlation features" )    
+  }
+  
+/*  
+features2Tiff( corr_window_width, img1_maximas_list, img1featMtx, 
+  "img1feat" );
+features2Tiff( corr_window_width, img2_maximas_list, img2featMtx, 
+  "img2feat" ); 
+*/
+
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by user" );
+  
+  // Generating tie-points (images boxes reference)
+  
+  TEAGN_TRUE_OR_RETURN( matchFeatures( matching_method, img1featMtx,
+    img1_maximas_list, img2featMtx, img2_maximas_list, 
+    *out_tie_points_ptr, *out_tie_points_weights_ptr
+    ), "Error generating tie-points" );
+  
+/*  
+matrix2Tiff( *img1_matrix_ptr, "img1_matrix_ptr_tps.tif",
+  *out_tie_points_ptr, true );
+matrix2Tiff( *img2_matrix_ptr, "img2_matrix_ptr_tps.tif",
+  *out_tie_points_ptr, false );      
+*/  
+
+  // Clean anused resources
+  
+  img1_matrix_ptr.reset();
+  img2_matrix_ptr.reset();
+  
+  img1featMtx.Reset( 0, 0 );
+  img2featMtx.Reset( 0, 0 );
+  
+  img1_matrix_ds_ptr.reset();
+  img1_matrix_us_ptr.reset();  
+    
+  // Bring tie-points to original images reference
+    
+  {
+    for( unsigned int tpsVecIdx = 0 ; tpsVecIdx < 
+      out_tie_points_ptr->size() ; ++tpsVecIdx )
+    {
+      TeCoordPair& coordPair = out_tie_points_ptr->operator[]( tpsVecIdx );
+      
+      coordPair.pt1.x( ( coordPair.pt1.x() / i1XRescFact ) + (double)orig_box1_x_off );
+      coordPair.pt1.y( ( coordPair.pt1.y() / i1YRescFact ) + (double)orig_box1_y_off );
+      
+      coordPair.pt2.x( ( coordPair.pt2.x() / i2XRescFact ) + (double)orig_box2_x_off );
+      coordPair.pt2.y( ( coordPair.pt2.y() / i2YRescFact ) + (double)orig_box2_y_off );
+    }
+  }
+  
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by user" );
+  
+  /* Doing geometrical filtering using user supplied 
+     geometrical transformation parameters */
+     
+  if( ! skip_geom_filter ) {
+    gt_params.tiepoints_ = (*out_tie_points_ptr);
+    gt_params.tiePointsWeights_ = (*out_tie_points_weights_ptr);
+       
+    TeGeometricTransformation::pointer trans_ptr( 
+      TeGTFactory::make( gt_params ) );
+    if( trans_ptr->reset( gt_params ) ) {
+      trans_ptr->getParameters( gt_params );
+      
+      /* updating the output tie points */
+      
+      (*out_tie_points_ptr) = gt_params.tiepoints_;
+      
+      // Updating the output tie points weights
+      
+      (*out_tie_points_weights_ptr) = gt_params.tiePointsWeights_;
+      
+      /* updating the output gt_params, if available */
+      
+      TeGTParams::pointer out_gt_params_ptr;
+      if( params_.CheckParameter< TeGTParams::pointer >( 
+        "out_gt_params_ptr" ) ) 
+      {
+        params_.GetParameter( "out_gt_params_ptr", out_gt_params_ptr );
+        
+        *out_gt_params_ptr = gt_params;
+      }       
+    } else {
+      out_tie_points_ptr->clear();
+    }
+  }
+  
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by user" );
+  
+  // So far.... so good !!
+  
+  return true;
+}
+
+
+void TePDIMMIOMatching::ResetState( const TePDIParameters& )
+{
+}
+
+
+void TePDIMMIOMatching::loadImage( void * paramsPtr )
+{
+ /* Retriving parameters */
+  
+  LoadImageParams& params = *( (LoadImageParams*) paramsPtr );
+  
+  params.returnValue_ = false;
+  
+  // Loading original image box
+  
+  const unsigned int origBoxRescNLines = (unsigned int)(
+    params.in_box_nlines_ * params.origImgYRescFact_ );
+  const unsigned int origBoxRescNCols = (unsigned int)(
+    params.in_box_ncols_ * params.origImgXRescFact_ );
+  
+  {
+    // Allocating resources 
+    
+    params.glb_mem_lock_ptr_->lock();
+    
+    if( ! params.img_matrix_ptr_->reset( origBoxRescNLines, 
+      origBoxRescNCols ) )
+    {
+      TEAGN_LOGERR( "Unable to allocate space for the loaded image" )
+      params.glb_mem_lock_ptr_->unLock();
+      return;
+    }
+    
+    bool useMaskImage = false;
+    if( params.mask_image_ptr_.isActive() )
+    {
+      useMaskImage = true;
+      
+      TEAGN_DEBUG_CONDITION( params.mask_matrix_ptr_, 
+        "Invalid mask_matrix_ptr_" );
+      TEAGN_DEBUG_CONDITION( params.mask_image_ptr_->params().nlines_ ==
+        params.input_image_ptr_->params().nlines_, "invalid mask raster lines" )
+      TEAGN_DEBUG_CONDITION( params.mask_image_ptr_->params().ncols_ ==
+        params.input_image_ptr_->params().ncols_, "invalid mask raster cols" )
+        
+      if( ! params.mask_matrix_ptr_->Reset( origBoxRescNLines, origBoxRescNCols ) )
+      {
+        TEAGN_LOGERR( "Unable to allocate space for the loaded mask image" )
+        params.glb_mem_lock_ptr_->unLock();
+        return;
+      }
+    }    
+      
+    params.glb_mem_lock_ptr_->unLock();
+    
+    // Resampling image and mask
+
+    unsigned int curr_out_line = 0;
+    unsigned int curr_out_col = 0;
+    unsigned int curr_input_line = 0;
+    unsigned int curr_input_col = 0;
+    double imagePixelValue = 0;
+    double maskPixelValue = 0;
+    TeRaster& inputRasterRef = (*params.input_image_ptr_);
+    
+    TePDIPIManager progress( "Loading image data", params.in_box_nlines_, 
+       params.progress_enabled_ );
+    
+    for( curr_out_line = 0 ; curr_out_line < origBoxRescNLines ; 
+      ++curr_out_line ) 
+    {
+      curr_input_line = (unsigned int)( ( ( (double)curr_out_line ) / 
+        params.origImgYRescFact_ ) + ( (double) params.in_box_y_off_ ) );      
+      
+      for( curr_out_col = 0 ; curr_out_col < origBoxRescNCols ; 
+        ++curr_out_col ) {
+        
+        curr_input_col = (unsigned int)( ( ( (double)curr_out_col ) / 
+            params.origImgXRescFact_ ) + ( (double) params.in_box_x_off_ ) );        
+        
+        inputRasterRef.getElement( curr_input_col, curr_input_line,
+          imagePixelValue, params.input_image_channel_ );
+        
+        params.img_matrix_ptr_->setValue( curr_out_line, curr_out_col, 
+          imagePixelValue );
+          
+        if( useMaskImage )
+        {
+          params.mask_image_ptr_->getElement( curr_input_col, curr_input_line,
+            maskPixelValue, 0 );          
+            
+          params.mask_matrix_ptr_->operator[]( curr_out_line )[ curr_out_col ] = 
+            (unsigned char)maskPixelValue;
+        }
+      }
+      
+      if( progress.Increment() )
+      {
+        TEAGN_LOGMSG( "Canceled by the user" );
+        
+        return;
+      }
+    }
+  }
+  
+  // Retriving raster channel max and min channel allowed values
+  
+  if( params.generateDownsampledImage_ || params.generateUpsampledImage_ )
+  {
+    double rasterChnMin = 0;
+    double rasterChnMax = 0;  
+    if( ! TePDIUtils::TeGetRasterMinMaxBounds( 
+      params.input_image_ptr_,
+      params.input_image_channel_, rasterChnMin, rasterChnMax ) )
+    {
+       TEAGN_LOGERR( "Error getting channels bounds" );  
+       return;
+    }
+    
+    // Loading downsampled image box
+    
+    if( params.generateDownsampledImage_ )
+    {
+      const unsigned int out_box_nlines = (unsigned int)
+        ( ((double)origBoxRescNLines) / params.moravecDownSampleFactor_ );
+      const unsigned int out_box_ncols = (unsigned int)
+        ( ((double)origBoxRescNCols) / params.moravecDownSampleFactor_ );
+      
+      if( ! bicubicResampleMatrix( *( params.img_matrix_ptr_ ), out_box_nlines,
+        out_box_ncols, params.progress_enabled_, *(params.glb_mem_lock_ptr_),
+        rasterChnMin, rasterChnMax, *( params.img_matrix_ds_ptr_ ) ) )
+      {
+        TEAGN_LOGERR( "Error generating downsampled image" );
+        return;
+      }
+    }
+    
+    // Loading upsampled image box
+    
+    if( params.generateUpsampledImage_ )
+    {
+      // Calculating sizes for resampled boxes
+      
+      const unsigned int out_box_nlines = (unsigned int)
+        ( ((double)origBoxRescNLines) / params.moravecUpSampleFactor_ );
+      const unsigned int out_box_ncols = (unsigned int)
+        ( ((double)origBoxRescNCols) / params.moravecUpSampleFactor_ );
+      
+      if( ! bicubicResampleMatrix( *( params.img_matrix_ptr_ ), out_box_nlines,
+        out_box_ncols, params.progress_enabled_, *(params.glb_mem_lock_ptr_),
+        rasterChnMin, rasterChnMax, *( params.img_matrix_us_ptr_ ) ) )
+      {
+        TEAGN_LOGERR( "Error generating downsampled image" );
+        return;
+      }
+    } 
+  }   
+  
+  params.returnValue_ = true;
+}
+
+void TePDIMMIOMatching::createImgMatrix( TeDataType dataType, 
+  TeSharedPtr< TePDIMtxDoubleAdptInt >& matrixPtr )
+{
+  switch( dataType )
+  {
+    case TeDOUBLE :
+    {
+      TePDIMtxDoubleAdpt< double >* newMtxPtr =  
+        new TePDIMtxDoubleAdpt< double >;
+      newMtxPtr->Reset( TePDIMtxDoubleAdpt< double >::AutoMemPol );
+      matrixPtr.reset( newMtxPtr );
+      
+      break;
+    }
+    case TeFLOAT :
+    {
+      TePDIMtxDoubleAdpt< float >* newMtxPtr =  
+        new TePDIMtxDoubleAdpt< float >;
+      newMtxPtr->Reset( TePDIMtxDoubleAdpt< float >::AutoMemPol );
+      matrixPtr.reset( newMtxPtr );        
+        
+      break;
+    }
+    case TeLONG :
+    {
+      TePDIMtxDoubleAdpt< long int >* newMtxPtr =  
+        new TePDIMtxDoubleAdpt< long int >;
+      newMtxPtr->Reset( TePDIMtxDoubleAdpt< long int >::AutoMemPol );
+      matrixPtr.reset( newMtxPtr );        
+        
+        
+      break;
+    }
+    case TeUNSIGNEDLONG :
+    {
+      TePDIMtxDoubleAdpt< unsigned long int >* newMtxPtr =  
+        new TePDIMtxDoubleAdpt< unsigned long int >;
+      newMtxPtr->Reset( TePDIMtxDoubleAdpt< unsigned long int >::AutoMemPol );
+      matrixPtr.reset( newMtxPtr );        
+        
+        
+      break;
+    }
+    case TeINTEGER :
+    {
+      TePDIMtxDoubleAdpt< int >* newMtxPtr =  
+        new TePDIMtxDoubleAdpt< int >;
+      newMtxPtr->Reset( TePDIMtxDoubleAdpt< int >::AutoMemPol );
+      matrixPtr.reset( newMtxPtr );        
+        
+        
+      break;
+    }
+    case TeSHORT :
+    {
+      TePDIMtxDoubleAdpt< short int >* newMtxPtr =  
+        new TePDIMtxDoubleAdpt< short int >;
+      newMtxPtr->Reset( TePDIMtxDoubleAdpt< short int >::AutoMemPol );
+      matrixPtr.reset( newMtxPtr );        
+        
+      break;
+    }
+    case TeUNSIGNEDSHORT :
+    {
+      TePDIMtxDoubleAdpt< unsigned short int >* newMtxPtr =  
+        new TePDIMtxDoubleAdpt< unsigned short int >;
+      newMtxPtr->Reset( TePDIMtxDoubleAdpt< unsigned short int >::AutoMemPol );
+      matrixPtr.reset( newMtxPtr );        
+        
+      break;
+    }
+    case TeCHAR :
+    {
+      TePDIMtxDoubleAdpt< char >* newMtxPtr =  
+        new TePDIMtxDoubleAdpt< char >;
+      newMtxPtr->Reset( TePDIMtxDoubleAdpt< char >::AutoMemPol );
+      matrixPtr.reset( newMtxPtr );        
+        
+      break;
+    }
+    case TeUNSIGNEDCHAR :
+    {
+      TePDIMtxDoubleAdpt< unsigned char >* newMtxPtr =  
+        new TePDIMtxDoubleAdpt< unsigned char >;
+      newMtxPtr->Reset( TePDIMtxDoubleAdpt< unsigned char >::AutoMemPol );
+      matrixPtr.reset( newMtxPtr );        
+        
+      break;
+    }
+    case TeBIT :
+    {
+      TePDIMtxDoubleAdpt< unsigned char >* newMtxPtr =  
+        new TePDIMtxDoubleAdpt< unsigned char >;
+      newMtxPtr->Reset( TePDIMtxDoubleAdpt< unsigned char >::AutoMemPol );
+      matrixPtr.reset( newMtxPtr );        
+        
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_THROW( "Invalid data type ");
+      break;
+    }
+  }
+}
+
+void TePDIMMIOMatching::extractLocalMaximas( void * paramsPtr )
+{
+ /* Retriving parameters */
+  
+  ExtractLocalMaximasParams params = *( (ExtractLocalMaximasParams*) 
+    paramsPtr );
+  TEAGN_DEBUG_CONDITION( ( params.moravecWindowSize_ % 2 ),
+    "Invalid moravecWindowSize" );    
+  TEAGN_DEBUG_CONDITION( params.seachSubImagesNmb_ > 0,
+    "Invalid params.seachSubImagesNmb_" );
+    
+  ( (ExtractLocalMaximasParams*) paramsPtr )->returnValue_ = false;
+  
+  if( ( params.imgMatrixPtr_->getNCols() > params.moravecWindowSize_ ) &&
+    ( params.imgMatrixPtr_->getNLines() > params.moravecWindowSize_ ) )
+  {
+    /* Defining sub-windows */
+    
+    unsigned int sqrtSI = 0;
+    if( ( params.imgMatrixPtr_->getNCols() <= ( sqrtSI * 
+      params.moravecWindowSize_ ) ) || ( params.imgMatrixPtr_->getNLines() <=
+      ( sqrtSI * params.moravecWindowSize_ ) ) ||
+      ( params.maximasNumber_ < params.seachSubImagesNmb_ ) )
+    {
+      sqrtSI = 1;
+    }
+    else
+    {
+      sqrtSI = (unsigned int)ceil( sqrt( 
+        (double)params.seachSubImagesNmb_ ) );
+      if( sqrtSI == 0 ) sqrtSI = 1; 
+    }
+
+    const unsigned int subWindowMaxWidth = (unsigned int)
+      ( params.imgMatrixPtr_->getNCols() / sqrtSI );
+    const unsigned int subWindowMaxHeight = (unsigned int)
+      ( params.imgMatrixPtr_->getNLines() / sqrtSI );  
+        
+    // Allocating buffers
+    
+    TePDIMatrix< double > dirVarMatrix;
+    if( ! dirVarMatrix.Reset( subWindowMaxHeight, subWindowMaxWidth,
+      TePDIMatrix< double >::RAMMemPol ) )
+    {
+      TEAGN_LOGERR( "Buffer reset error" );
+      return;
+    }         
+       
+    // Looking for maximas on each sub-image
+      
+    unsigned int windColBound = 0;
+    unsigned int windLinBound = 0;
+    unsigned int windWidth = 0;
+    unsigned int windHeight = 0;
+      
+    TePDIPIManager progress( "Finding local maximas", sqrtSI * sqrtSI, 
+      params.progressEnabled_ );
+      
+    for( unsigned int line = 0 ; line < params.imgMatrixPtr_->getNLines() ;
+      line += subWindowMaxHeight )
+    {
+      windLinBound = MIN( line + subWindowMaxHeight, 
+        params.imgMatrixPtr_->getNLines() );
+      windHeight = windLinBound - line;
+      
+      for( unsigned int col = 0 ; col < params.imgMatrixPtr_->getNCols() ; 
+        col += subWindowMaxWidth ) 
+      {
+        if( windHeight > params.moravecWindowSize_ )
+        {
+          windColBound = MIN( col + subWindowMaxWidth, 
+            params.imgMatrixPtr_->getNCols() );
+          windWidth = windColBound - col;
+          
+          if( windWidth > params.moravecWindowSize_ )
+          {
+            if( ! extractLocalMaximas( params.imgMatrixPtr_, 
+              params.maskMatrixPtr_, col, line, 
+              windWidth, windHeight, dirVarMatrix, 
+              params.moravecWindowSize_, 
+              params.maximasNumber_ / params.seachSubImagesNmb_,
+              *params.outMaximasListPtr_, progress ) )
+            {
+              return;
+            } 
+            
+//matrix2Tiff( *params.imgMatrixPtr_, "subimagesmaximas.tif", *params.outMaximasListPtr_ );              
+          }
+        }
+        
+        if( progress.Increment() )
+        {
+          TEAGN_LOGWARN( "Canceled by the user" );
+          return;
+        }
+      }
+    }
+  }
+  
+  // So far... so good !
+  
+  ( (ExtractLocalMaximasParams*) paramsPtr )->returnValue_ = true;
+}
+
+bool TePDIMMIOMatching::extractLocalMaximas( 
+  TePDIMtxDoubleAdptInt const* imgMatrixPtr,
+  MaskMatrixT const* maskMatrixPtr,
+  const unsigned int& xStart, const unsigned int& yStart, 
+  const unsigned int& width,
+  const unsigned int& height, TePDIMatrix< double >& bufferMatrix, 
+  const unsigned int& moravecWindowSize, 
+  const unsigned int& maximasNumber, MaximasListT& outMaximasList, 
+  TePDIPIManager& progress )
+{
+  TEAGN_DEBUG_CONDITION( imgMatrixPtr, "Invalid pointer" )
+  TEAGN_DEBUG_CONDITION( xStart < imgMatrixPtr->getNCols() - moravecWindowSize,
+    "Invalid xStart" )
+  TEAGN_DEBUG_CONDITION( yStart < imgMatrixPtr->getNLines() - moravecWindowSize,
+    "Invalid yStart" )
+  TEAGN_DEBUG_CONDITION( width >= moravecWindowSize, "Invalid width" )
+  TEAGN_DEBUG_CONDITION( height >= moravecWindowSize, "Invalid height" )
+  TEAGN_DEBUG_CONDITION( bufferMatrix.GetColumns() >= width, "Invalid buffer" );
+  TEAGN_DEBUG_CONDITION( bufferMatrix.GetLines() >= height, "Invalid buffer" );
+  
+  // Globals
+  
+  const int windRad = (unsigned int)( moravecWindowSize / 2 );   
+  
+  {
+    // directional variance calcule
+    
+    unsigned int bufferLin = 0;
+    unsigned int bufferCol = 0;
+    const unsigned int bufferLinBound = height - moravecWindowSize + 1;
+    const unsigned int bufferColBound = width - moravecWindowSize + 1;
+    unsigned int imgLine = 0;
+    unsigned int imgCol = 0;
+    unsigned int offset = 0;
+    const TePDIMtxDoubleAdptInt& imgMatrix = *imgMatrixPtr;
+    double neightValue = 0;
+    double diffValue = 0;  
+    double horVar = 0;
+    double verVar = 0;
+    double diagVar = 0;
+    double adiagVar = 0;
+    double centerValue = 0;
+    unsigned int horImgLine = 0;
+    unsigned int horImgCol = 0;
+    unsigned int verImgLine = 0;
+    unsigned int verImgCol = 0;
+    unsigned int aDiagImgLine = 0;
+    
+    for( bufferLin = 0 ; bufferLin < bufferLinBound ; ++bufferLin )
+    {
+      imgLine = bufferLin + yStart;
+      
+      for( bufferCol = 0 ; bufferCol < bufferColBound ; ++bufferCol )
+      {
+        imgCol = bufferCol + xStart;
+        
+        imgMatrix.getValue( imgLine + windRad, imgCol + windRad, centerValue );
+        
+        horVar = verVar = diagVar = adiagVar = 0;
+        
+        horImgLine = imgLine + windRad;
+        horImgCol = imgCol;
+        
+        verImgLine = imgLine;
+        verImgCol = imgCol + windRad;
+        
+        aDiagImgLine = imgLine + moravecWindowSize - 1;
+        
+        for( offset = moravecWindowSize ; offset ; --offset )
+        {
+          imgMatrix.getValue( horImgLine, horImgCol, neightValue );
+          diffValue = neightValue - centerValue;
+          horVar += ( diffValue * diffValue );
+          
+          imgMatrix.getValue( verImgLine, verImgCol, neightValue );
+          diffValue = neightValue - centerValue;
+          verVar += ( diffValue * diffValue );
+  
+          imgMatrix.getValue( verImgLine, horImgCol, neightValue );
+          diffValue = neightValue - centerValue;
+          diagVar += ( diffValue * diffValue );
+        
+          imgMatrix.getValue( aDiagImgLine, horImgCol, neightValue );
+          diffValue = neightValue - centerValue;
+          adiagVar += ( diffValue * diffValue );
+          
+          ++horImgCol;
+          ++verImgLine;
+          --aDiagImgLine;
+        }
+        
+        bufferMatrix( bufferLin + windRad, bufferCol + windRad ) = 
+          MIN( horVar, MIN( verVar, MIN( diagVar, adiagVar ) ) );
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+    }
+  }
+  
+//doublesMatrix2Tiff( bufferMatrix, "bufferMatrix.tif" );
+  
+  // Loocking for local maximas
+  
+  MaximasMapT localMaximasMap;
+  
+  {
+    const unsigned int bufferLinBound = height - windRad - moravecWindowSize + 1;
+    const unsigned int bufferColBound = width - windRad - moravecWindowSize + 1;  
+    unsigned int bufferLin = 0;
+    unsigned int bufferCol = 0;
+    double centerValue = 0;
+    double*  bufferLinPtr = 0;   
+    unsigned int bufferLin2 = 0;
+    unsigned int bufferCol2 = 0;
+    unsigned int bufferColBound2 = 0;
+    unsigned int bufferLinBound2 = 0;
+    bool currentIsMaxima = false;
+    std::pair< double, MaximasMapNodeT > auxPair;
+    
+    for( bufferLin = windRad ; bufferLin < bufferLinBound ; ++bufferLin )
+    {
+      for( bufferCol = windRad ; bufferCol < bufferColBound ; ++bufferCol )
+      {
+        centerValue = bufferMatrix( bufferLin + windRad, bufferCol + windRad );
+        
+        bufferLinBound2 = bufferLin + moravecWindowSize;
+        bufferColBound2 = bufferCol + moravecWindowSize;
+        
+        // This is a maxima point compared with all neighboors ??
+        
+        currentIsMaxima = true;
+        
+        for( bufferLin2 = bufferLin  ; bufferLin2 < bufferLinBound2 ;
+          ++bufferLin2 )
+        {
+          bufferLinPtr = bufferMatrix[ bufferLin2 ];
+          
+          for( bufferCol2 = bufferCol ; bufferCol2 < bufferColBound2 ;
+            ++bufferCol2 )
+          {
+            if( bufferLinPtr[ bufferCol2 ] > centerValue )
+            {
+              currentIsMaxima = false;
+              bufferLin2 = bufferLinBound2;
+              break;
+            }
+            else if( maskMatrixPtr && ( maskMatrixPtr->operator[]( bufferLin2 + 
+              yStart )[ bufferCol2 + xStart ] == 0 ) )
+            {
+              currentIsMaxima = false;
+              bufferLin2 = bufferLinBound2;
+              break;
+            }              
+          }
+        }
+        
+        if( currentIsMaxima )
+        {
+          auxPair.first = centerValue;
+          auxPair.second.first = bufferCol + xStart + windRad;
+          auxPair.second.second = bufferLin + yStart + windRad;
+    
+          localMaximasMap.insert( auxPair );
+          
+          if( localMaximasMap.size() > maximasNumber )
+          {
+            localMaximasMap.erase( localMaximasMap.begin() );
+          }
+        }
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+    }
+  }
+    
+  // filtering the best maximas
+  
+  unsigned int currMaximasCount = 0;
+  MaximasMapT::reverse_iterator it = localMaximasMap.rbegin();
+  const MaximasMapT::reverse_iterator itEnd = localMaximasMap.rend();
+  MaximasListNodeT auxNode;
+  
+  while( ( currMaximasCount < maximasNumber ) && ( it != itEnd ) )
+  {
+    auxNode.dirVariance_ = it->first;
+    auxNode.x_ = it->second.first;
+    auxNode.y_ = it->second.second;
+    
+    outMaximasList.push_back( auxNode );
+  
+    ++currMaximasCount;
+    ++it;
+  }
+  
+  return true;
+}
+
+void TePDIMMIOMatching::moravecRepeatability( const MaximasListT& inputList,
+  const MaximasListT& constraintList, 
+  unsigned int constraintImageWidth,
+  unsigned int constraintImageHeight,  
+  double moravecRepeatabilityMinTolerance, 
+  double moravecReSampleFactor, 
+  MaximasListT& outputList )
+{
+  TEAGN_DEBUG_CONDITION( moravecRepeatabilityMinTolerance > 0,
+    "Invalid moravecRepeatabilityMinTolerance ")
+  TEAGN_DEBUG_CONDITION( moravecReSampleFactor > 0,
+    "Invalid moravecReSampleFactor ")
+      
+  outputList.clear();
+  
+  // Criating an RTree for seach optmization
+  
+  const TeBox myTreeBBox( -1.0, -1.0, (double)(constraintImageWidth),
+    (double)(constraintImageHeight) );  
+  
+  TeSAM::TeRTree<MaximasListNodeT const*, 8, 4> myTree( myTreeBBox );
+  
+  {
+    MaximasListT::const_iterator cListIt = constraintList.begin();
+    MaximasListT::const_iterator cListItEnd = constraintList.end();
+    TeBox auxBox;
+    
+    while( cListIt != cListItEnd )
+    {
+      auxBox.x1_ = (double)(cListIt->x_) - moravecRepeatabilityMinTolerance;
+      auxBox.y1_ = (double)(cListIt->y_) - moravecRepeatabilityMinTolerance;
+      
+      auxBox.x2_ = (double)(cListIt->x_) + moravecRepeatabilityMinTolerance;
+      auxBox.y2_ = (double)(cListIt->y_) + moravecRepeatabilityMinTolerance;
+      
+      myTree.insert( auxBox, &(*cListIt) );
+          
+      ++cListIt;
+    }
+  }
+  
+  // Iterating over input list
+  
+  MaximasListT::const_iterator iListIt = inputList.begin();
+  MaximasListT::const_iterator iListItEnd = inputList.end();
+  std::vector< MaximasListNodeT const* > resultVec;
+  TeBox auxBox;
+    
+  while( iListIt != iListItEnd )
+  {
+    const MaximasListNodeT& iListEle = *iListIt;
+    
+    auxBox.x1_ = auxBox.x2_ = iListEle.x_ / moravecReSampleFactor;
+    auxBox.y1_ = auxBox.y2_ = iListEle.y_ / moravecReSampleFactor;
+    
+    resultVec.clear();
+    
+    if( myTree.search( auxBox, resultVec ) )
+    {
+      outputList.push_back( iListEle );  
+    }
+    
+    ++iListIt;  
+  }
+  
+  return;
+}
+
+void TePDIMMIOMatching::generateCorrelationFeatures( void * paramsPtr )
+{
+  /* Retriving parameters */
+  
+  GenerateCorrelationFeaturesParams& params = 
+    *( (GenerateCorrelationFeaturesParams*) paramsPtr );
+  
+  const TePDIMtxDoubleAdptInt& img_matrix = *(params.imgMatrixPtr_);
+  
+  TePDIMatrix< double >& img_features_matrix = *( params.featMtxPtr_);
+  
+  params.returnValue_ = false;
+    
+  if( params.inMaximasListPtr_->size() > 0 ) {
+    /* Allocating output matrix */
+       
+    params.glbMemLockPtr_->lock();
+    
+    if( ! params.featMtxPtr_->Reset( params.inMaximasListPtr_->size(),
+      params.corrWindowsWidth_ * params.corrWindowsWidth_ ) )
+    {
+      TEAGN_LOGERR( "Error allocating image features matrix" )
+      params.glbMemLockPtr_->unLock();
+      return;
+    }
+      
+    params.glbMemLockPtr_->unLock();
+      
+    /* variables related to the current window over the hole image */
+    unsigned int curr_window_x_start = 0;
+    unsigned int curr_window_y_start = 0;
+    unsigned int curr_window_x_center = 0;
+    unsigned int curr_window_y_center = 0;
+    unsigned int curr_window_x_bound = 0;
+    unsigned int curr_window_y_bound = 0;
+    
+    /*used on the rotation calcule */
+
+    const unsigned int wind_radius = params.corrWindowsWidth_ / 2;
+    // output window radius
+    const double wind_radius_double = (double)wind_radius;
+
+    const unsigned int img_features_matrix_cols = 
+      params.featMtxPtr_->GetColumns();
+    unsigned int curr_x = 0;
+    unsigned int curr_y = 0;
+    double curr_x_minus_radius = 0;
+    double curr_y_minus_radius = 0;
+    unsigned int curr_offset = 0;
+    double int_x_dir = 0;
+    double int_y_dir = 0;
+    double int_norm = 0;
+    double rotated_curr_x = 0;/* rotaded coord - window ref */
+    double rotated_curr_y = 0;/* rotaded coord - window ref */
+    
+     /* the found rotation parameters */
+    double rot_cos = 0;
+    double rot_sin = 0;
+    
+    /* the coords rotated but in the hole image reference */
+    int rotated_curr_x_img = 0;
+    int rotated_curr_y_img = 0;
+    
+    /* current window mean and standart deviation */
+    double curr_wind_mean = 0.0;
+    double curr_wind_stddev = 0.0;
+    double curr_wind_stddev_aux = 0.0;
+    
+    // used on intensity vector calcule
+    double imgMatrixValue1 = 0;
+    double imgMatrixValue2 = 0;
+    
+    TePDIPIManager progress( "Generating correlation windows",
+      params.inMaximasListPtr_->size(), params.progressEnabled_ );
+    
+    MaximasListT::const_iterator maximIt = params.inMaximasListPtr_->begin();
+    MaximasListT::const_iterator maximItEnd = params.inMaximasListPtr_->end();
+    unsigned int maximasListIndex = 0;
+      
+    while( maximIt != maximItEnd ) {
+      
+      /* Calculating the current window position */
+     
+      curr_window_x_center = maximIt->x_;
+      curr_window_y_center = maximIt->y_;
+      curr_window_x_start = curr_window_x_center - wind_radius;
+      curr_window_y_start = curr_window_y_center - wind_radius;
+      curr_window_x_bound = curr_window_x_start + params.corrWindowsWidth_;
+      curr_window_y_bound = curr_window_y_start + params.corrWindowsWidth_;
+        
+      /* Estimating the intensity vector X direction */
+      
+      for( curr_offset = 0 ; curr_offset < wind_radius ;
+        ++curr_offset ) {      
+
+        for( curr_y = curr_window_y_start ; curr_y < curr_window_y_bound ; 
+          ++curr_y ) 
+        {
+          img_matrix.getValue( curr_y, curr_window_x_bound - 1 - curr_offset, 
+             imgMatrixValue1 );
+          img_matrix.getValue( curr_y, curr_window_x_start + curr_offset, 
+             imgMatrixValue2 );
+        
+          int_x_dir += imgMatrixValue1 - imgMatrixValue2;
+        }
+      }
+      
+      int_x_dir /= ( 2.0 * ( (double) wind_radius ) );
+      
+      /* Estimating the intensity vector y direction */
+      
+      for( curr_offset = 0 ; curr_offset < wind_radius ;
+        ++curr_offset ) {      
+
+        for( curr_x = curr_window_x_start ; 
+          curr_x < curr_window_x_bound ;
+          ++curr_x ) 
+        {
+          img_matrix.getValue( curr_window_y_start + curr_offset, curr_x , 
+            imgMatrixValue1 );
+          img_matrix.getValue( curr_window_y_bound - 1 - curr_offset, 
+            curr_x, imgMatrixValue2 );          
+        
+          int_y_dir += imgMatrixValue1 - imgMatrixValue2;
+        }
+      }      
+      
+      int_y_dir /= ( 2.0 * ( (double) wind_radius ) );
+      
+      /* Calculating the rotation parameters - 
+         counterclockwise rotation 
+         
+         | u |    |cos  -sin|   |X|
+         | v | == |sin   cos| x |Y|
+      */
+      int_norm = sqrt( ( int_x_dir * int_x_dir ) + 
+        ( int_y_dir * int_y_dir ) );
+      
+      if( int_norm != 0.0 ) {
+        rot_cos = int_x_dir / int_norm;
+        rot_sin = int_y_dir / int_norm;
+      } else {
+        /* No rotation */
+        rot_cos = 1.0;
+        rot_sin = 0.0;
+      }
+      
+      /* Generating the rotated window data and inserting it into 
+         the img_features_matrix by setting the intensity vector
+         to the direction (1,0) by a clockwise rotation
+         using the inverse matrix 
+      
+         | u |    |cos   sin|   |X|
+         | v | == |-sin  cos| x |Y|
+      */
+         
+      for( curr_y = 0 ; curr_y < params.corrWindowsWidth_ ; ++curr_y ) 
+      {
+        for( curr_x = 0 ; curr_x < params.corrWindowsWidth_ ; ++curr_x ) 
+        {
+          /* briging the window to the coord system center */
+          
+          curr_x_minus_radius = ((double)curr_x) - 
+            wind_radius_double;
+          curr_y_minus_radius = ((double)curr_y) - 
+            wind_radius_double;
+          
+          /* rotating the centered window */
+          
+          rotated_curr_x = 
+            ( ( rot_cos * curr_x_minus_radius ) + 
+            ( rot_sin * curr_y_minus_radius ) );
+          
+          rotated_curr_y =
+            ( ( -1.0 * rot_sin * curr_x_minus_radius ) + 
+            ( rot_cos * curr_y_minus_radius ) );
+            
+          /* bringing the window back to its original
+             location with the correct new scale */ 
+            
+          rotated_curr_x += wind_radius_double;
+          rotated_curr_y += wind_radius_double;
+          
+          /* copy the new rotated window to the output vector */
+            
+          rotated_curr_x_img = curr_window_x_start +
+            TeRound( rotated_curr_x );
+          rotated_curr_y_img = curr_window_y_start +
+            TeRound( rotated_curr_y );                        
+           
+          if( ( rotated_curr_x_img > 0 ) &&  
+            ( rotated_curr_x_img < (int)img_matrix.getNCols() ) &&
+            ( rotated_curr_y_img > 0 ) &&
+            ( rotated_curr_y_img < (int)img_matrix.getNLines() ) )
+          {
+            img_matrix.getValue( rotated_curr_y_img, rotated_curr_x_img, 
+              imgMatrixValue1 ); 
+          }
+          else
+          {
+            TEAGN_LOGERR( "Invalid matrix position -> rotated_curr_y_img=" +
+              Te2String( rotated_curr_y_img ) + " img_matrix.getNLines()=" +
+              Te2String( img_matrix.getNLines() ) + " Processing point [" + Te2String( curr_window_x_center, 1 ) +
+              "," + Te2String( curr_window_y_center, 1 ) + "] ");
+          
+            imgMatrixValue1 = 0;
+          }
+            
+          img_features_matrix( maximasListIndex, ( curr_y * 
+            params.corrWindowsWidth_ ) + curr_x ) = imgMatrixValue1;
+
+        }
+      }
+      
+      /* Normalizing the generated window by subtracting its mean
+         and dividing by its standard deviation */      
+      
+      if( params.normalizeWindows_ )
+      {
+        curr_wind_mean = 0.0;
+        
+        for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
+          ++curr_x ) {
+          
+          curr_wind_mean += img_features_matrix( maximasListIndex,
+            curr_x );
+        }
+        
+        curr_wind_mean /= ( (double)img_features_matrix_cols  );
+        
+        curr_wind_stddev = 0.0;  
+        
+        for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
+          ++curr_x ) {
+          
+          curr_wind_stddev_aux = img_features_matrix( 
+            maximasListIndex, curr_x ) - curr_wind_mean;
+            
+          curr_wind_stddev += ( curr_wind_stddev_aux *
+            curr_wind_stddev_aux );
+        }      
+        
+        curr_wind_stddev /= ( (double)img_features_matrix_cols  );
+        curr_wind_stddev = sqrt( curr_wind_stddev );
+        
+        if( curr_wind_stddev == 0.0 ) {
+          for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
+            ++curr_x ) {
+            
+            double& curr_value = img_features_matrix( 
+              maximasListIndex, curr_x );
+            
+            curr_value -= curr_wind_mean;
+          } 
+        } else {
+          for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
+            ++curr_x ) {
+            
+            double& curr_value = img_features_matrix( 
+              maximasListIndex, curr_x );
+            
+            curr_value -= curr_wind_mean;
+            curr_value /= curr_wind_stddev;
+          }
+        }
+      }
+      
+      /* Finished !! */
+     
+      if( progress.Increment() )
+      {
+        TEAGN_LOGERR( "Canceled by the user" );
+        return;
+      }
+      
+      ++maximasListIndex;
+      ++maximIt;
+    }
+  }    
+  
+  params.returnValue_ = true;
+}
+
+bool TePDIMMIOMatching::matchFeatures( FeatMatchingMethod matching_method,
+  const TePDIMatrix< double >& img1featMtx,
+  const MaximasListT& img1_maximas_list,
+  const TePDIMatrix< double >& img2featMtx,
+  const MaximasListT& img2_maximas_list,
+  TeCoordPairVect& tiePointsVec,
+  std::vector< double >& tiePointsWeights )
+{
+  if( ( img1featMtx.GetLines() == 0 ) || ( img2featMtx.GetLines() == 0 ) )
+  {
+    return true;
+  }
+  
+  TEAGN_DEBUG_CONDITION( ( img1featMtx.GetLines() == 
+    img1_maximas_list.size() ), "Size mismatch" )
+  TEAGN_DEBUG_CONDITION( ( img2featMtx.GetLines() == 
+    img2_maximas_list.size() ), "Size mismatch" )    
+  TEAGN_DEBUG_CONDITION( ( img1featMtx.GetColumns() == 
+    img2featMtx.GetColumns() ), "Size mismatch" )
+    
+  tiePointsVec.clear();
+  tiePointsWeights.clear();
+  
+  // Generating the matching matrix
+  // For each matching method the matching matrix will have 
+  // different values range.
+  
+  TePDIMatrix<double> matchMatrix;
+  TEAGN_TRUE_OR_RETURN( matchMatrix.Reset( img1_maximas_list.size(),
+    img2_maximas_list.size(), TePDIMatrix<double>::RAMMemPol ),
+    "Error allocating memory" );  
+  
+  const unsigned int mMCols = matchMatrix.GetColumns();
+  const unsigned int mMLines = matchMatrix.GetLines();  
+  
+  {
+    const double negativeInfinite = DBL_MAX * (-1.0);
+    double* linePtr = 0;
+    unsigned int col = 0;
+    
+    for( unsigned int line =0 ; line < mMLines ; ++line )
+    {
+      linePtr = matchMatrix[ line ];
+      
+      for( col =0 ; col < mMCols ; ++col )
+        linePtr[ col ] = negativeInfinite;
+    }
+  }
+  
+  const unsigned long int maxJobs = jobsMan_.getMaxSimulJobs() ?
+      jobsMan_.getMaxSimulJobs() : 1;
+      
+  double matchingMatrixMin = DBL_MAX;
+  double matchingMatrixMax = (-1.0) * DBL_MAX;   
+  
+  switch( matching_method )
+  {
+    case NormCrossCorrMethod :
+    {
+      // Spawning jobs
+      
+      std::vector< CalcCCorrelationMtxParams > jobsParamsVec;  
+      
+      CalcCCorrelationMtxParams auxPars;      
+      auxPars.img1FeatMtxPtr_ = &img1featMtx;
+      auxPars.img2FeatMtxPtr_ = &img2featMtx;
+      auxPars.matchMatrixMinPtr_ = &matchingMatrixMin;
+      auxPars.matchMatrixMaxPtr_ = &matchingMatrixMax;
+      auxPars.matchMatrixPtr_ = &matchMatrix;
+      auxPars.progressEnabled_ = progress_enabled_;
+      auxPars.glbMutexptr_ = &globalMutex_;
+      auxPars.returnValue_ = false;
+      
+      TeFunctionCallThreadJob dummyJob;
+      dummyJob.jobFunc_ = calcCCorrelationMtx;
+
+      unsigned int jobidx = 0;
+      jobsParamsVec.resize( maxJobs );
+      
+      for( jobidx = 0 ; jobidx < maxJobs ; ++jobidx )
+      {
+        jobsParamsVec[ jobidx ] = auxPars;
+        dummyJob.jobFuncParsPtr_ = &( jobsParamsVec[ jobidx ] );
+        
+        jobsMan_.executeJob( dummyJob );
+      }
+      
+      // Waiting jobs to finish
+      
+      jobsMan_.waitAllToFinish();
+      
+      for( jobidx = 0 ; jobidx < maxJobs ; ++jobidx )
+      {
+        TEAGN_TRUE_OR_RETURN( jobsParamsVec[ jobidx ].returnValue_, 
+          "Error calculating euclidian distance" );
+      }      
+      
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_THROW( "Invalid method")
+      break;
+    }
+  }
+  
+  // Finding best matchings
+  
+  // Feature 1 desires to match with the feature 2 with the index
+  // indicated by this vector
+  std::vector< unsigned int> feat1Tofeat2( matchMatrix.GetLines(),
+    matchMatrix.GetColumns() );  
+  
+  // Feature 2 desires to match with the feature 1 with the index
+  // indicated by this vector
+  std::vector< unsigned int> feat2Tofeat1( matchMatrix.GetColumns(),
+    matchMatrix.GetLines() );     
+  
+  switch( matching_method )
+  {
+    case NormCrossCorrMethod :
+    {
+     // maximum values found on each column
+      std::vector< double > colsMaxsVec( matchMatrix.GetColumns(), 
+        (-1.0) * DBL_MAX );
+      
+      // maximum values found on each line
+      std::vector< double > linesMaxsVec( matchMatrix.GetLines(), 
+        (-1.0) * DBL_MAX );
+      
+      double const* linePtr = 0;
+      unsigned int mMLine =0;
+      unsigned int mMCol =0;
+      
+      TePDIPIManager progress( "Matching features",
+        mMLines, progress_enabled_ );       
+      
+      for( mMLine =0 ; mMLine < mMLines ; ++mMLine )
+      {
+        linePtr = matchMatrix[ mMLine ];
+        
+        for( mMCol =0 ; mMCol < mMCols ; ++mMCol )
+        {
+          const double& value = linePtr[ mMCol ];
+          
+          if( value > linesMaxsVec[ mMLine ] )
+          {
+            linesMaxsVec[ mMLine ] = value;
+            
+            if( value > 0.0 )
+            {
+              feat1Tofeat2[ mMLine ] = mMCol;
+            }
+          }
+          
+          if( value > colsMaxsVec[ mMCol ] )
+          {
+            colsMaxsVec[ mMCol ] = value;
+            
+            if( value > 0.0 )
+            {
+              feat2Tofeat1[ mMCol ] = mMLine;
+            }
+          }
+        }
+        
+        if( progress.Increment() )
+        {
+          TEAGN_LOGERR( "Canceled by the user" );
+          return false;
+        }           
+      }
+      
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_THROW( "Invalid method")
+      break;
+    }
+  }
+  
+  // Calculating the normalization parameters
+  
+  double list1DirVarianceMin = DBL_MAX;
+  double list1DirVarianceMax = (-1.0) * list1DirVarianceMin;
+  double list1DirVarianceRange = 0;
+  
+  double list2DirVarianceMin = DBL_MAX;
+  double list2DirVarianceMax = (-1.0) * list2DirVarianceMin;  
+  double list2DirVarianceRange = 0;
+  
+  TEAGN_DEBUG_CONDITION( matchingMatrixMax >= matchingMatrixMin,
+    "Invalid maching matrix limits" );  
+  const double matchingMatrixRange = matchingMatrixMax - matchingMatrixMin;
+  
+  {
+    // Image 1 maximas variance range 
+    
+    MaximasListT::const_iterator mListIt = img1_maximas_list.begin();
+    MaximasListT::const_iterator mListItEnd = img1_maximas_list.end();
+    
+    while( mListIt != mListItEnd )
+    {
+      if( mListIt->dirVariance_ < list1DirVarianceMin )
+      {
+        list1DirVarianceMin = mListIt->dirVariance_;
+      }
+      if( mListIt->dirVariance_ > list1DirVarianceMax )
+      {
+        list1DirVarianceMax = mListIt->dirVariance_;
+      }
+          
+      ++mListIt;
+    }
+    
+    list1DirVarianceRange = list1DirVarianceMax - list1DirVarianceMin;
+    
+    // Image 2 maximas variance range 
+    
+    mListIt = img2_maximas_list.begin();
+    mListItEnd = img2_maximas_list.end();
+    
+    while( mListIt != mListItEnd )
+    {
+      if( mListIt->dirVariance_ < list2DirVarianceMin )
+      {
+        list2DirVarianceMin = mListIt->dirVariance_;
+      }
+      if( mListIt->dirVariance_ > list2DirVarianceMax )
+      {
+        list2DirVarianceMax = mListIt->dirVariance_;
+      }
+          
+      ++mListIt;
+    }
+    
+    list2DirVarianceRange = list2DirVarianceMax - list2DirVarianceMin;
+  }
+  
+  // Generating tie-points
+  
+  {
+    MaximasListT::const_iterator mList1It = img1_maximas_list.begin();
+    MaximasListT::const_iterator mList2It;
+    TeCoordPair dummyCPair;
+    unsigned int desiredFeature2Idx = 0;
+    unsigned int desiredFeature1Idx = 0;
+    const unsigned int feat2Tofeat1Size = (unsigned int)
+      feat2Tofeat1.size();
+    double tpWeight = 0;
+    
+    for( unsigned int feat1Tofeat2_idx = 0 ; feat1Tofeat2_idx < 
+      feat1Tofeat2.size() ; ++feat1Tofeat2_idx )
+    {
+      desiredFeature2Idx = feat1Tofeat2[ feat1Tofeat2_idx ];
+      
+      // feature1 wants to match with the feature 2 with index
+      // feat1Tofeat2[ feat1Tofeat2_idx ]
+      if( desiredFeature2Idx < feat2Tofeat1Size )
+      {
+        // does feature 2 wants to match back ??
+        
+        desiredFeature1Idx = feat2Tofeat1[ desiredFeature2Idx ];
+        
+        if( desiredFeature1Idx == feat1Tofeat2_idx )
+        { // Great !!! we hava a match
+        
+          // move an iterator to the correct maximas list 2 position
+          
+          mList2It = img2_maximas_list.begin();
+          for( unsigned int maxList2dx = 0 ; maxList2dx < 
+            desiredFeature2Idx ; ++maxList2dx )
+          {
+            ++mList2It;
+          }
+          
+          // Generating the new tie-point
+          
+          dummyCPair.pt1.x( mList1It->x_ );
+          dummyCPair.pt1.y( mList1It->y_ );
+          dummyCPair.pt2.x( mList2It->x_ );
+          dummyCPair.pt2.y( mList2It->y_ );
+          
+          tiePointsVec.push_back( dummyCPair );
+          
+          // updating the new tie-point weight
+          
+          TEAGN_DEBUG_CONDITION( mList1It->dirVariance_ >= 0,
+            "Negative directional variance found" )
+          TEAGN_DEBUG_CONDITION( mList2It->dirVariance_ >= 0,
+            "Negative directional variance found" )
+            
+          tpWeight = 1.0;
+          
+          if( ( list1DirVarianceRange != 0.0 ) &&
+            ( list2DirVarianceRange != 0.0 ) && ( matchingMatrixRange != 0.0 ) )
+          {
+            tpWeight = ( ( ( mList1It->dirVariance_ - 
+              list1DirVarianceMin ) / list1DirVarianceRange ) +
+              ( ( mList2It->dirVariance_ - list2DirVarianceMin ) / 
+              list2DirVarianceRange ) ) / 2.00;
+          
+            switch( matching_method )
+            {
+              case NormCrossCorrMethod :
+              {
+                tpWeight *= 
+                ( ( matchMatrix[ desiredFeature1Idx ][ desiredFeature2Idx ] 
+                  - matchingMatrixMin ) / matchingMatrixRange  );
+                                
+                break;
+              }            
+              default :
+              {
+                TEAGN_LOG_AND_THROW( "Invalid method")
+                break;    
+              }            
+            }
+          }
+          
+          TEAGN_DEBUG_CONDITION( ( ( tpWeight >= 0.0 ) && 
+            ( tpWeight <= 1.0 ) ), "invalid tpWeight=" + Te2String( tpWeight, 
+            2 ) );
+          tiePointsWeights.push_back( tpWeight );          
+        }
+      }
+      
+      ++mList1It;
+    }
+  }
+  
+  return true;
+}
+
+void TePDIMMIOMatching::calcCCorrelationMtx( void * paramsPtr )
+{
+  CalcCCorrelationMtxParams& params = 
+    *((CalcCCorrelationMtxParams*)paramsPtr );
+  
+  params.returnValue_ = false;
+  
+  TEAGN_DEBUG_CONDITION( params.matchMatrixPtr_->GetLines() ==
+    params.img1FeatMtxPtr_->GetLines(), "Size mismatch" )
+  TEAGN_DEBUG_CONDITION( params.matchMatrixPtr_->GetColumns() ==
+    params.img2FeatMtxPtr_->GetLines(), "Size mismatch" )
+  TEAGN_DEBUG_CONDITION( params.img1FeatMtxPtr_->GetColumns() ==
+    params.img2FeatMtxPtr_->GetColumns(), "Size mismatch" )    
+  TEAGN_DEBUG_CONDITION( params.img1FeatMtxPtr_->getMemPolicy() ==
+    TePDIMatrix< double >::RAMMemPol, "Invalid metrix policy" );
+  TEAGN_DEBUG_CONDITION( params.img2FeatMtxPtr_->getMemPolicy() ==
+    TePDIMatrix< double >::RAMMemPol, "Invalid metrix policy" );   
+  TEAGN_DEBUG_CONDITION( params.matchMatrixPtr_->getMemPolicy() ==
+    TePDIMatrix< double >::RAMMemPol, "Invalid metrix policy" );      
+  TEAGN_DEBUG_CONDITION( params.matchMatrixMinPtr_, "Invalid pointer" );
+  TEAGN_DEBUG_CONDITION( params.matchMatrixMaxPtr_, "Invalid pointer" );            
+    
+  TePDIMatrix< double >& matchMatrix = *params.matchMatrixPtr_;
+  const TePDIMatrix< double >& img1FeatMtx = *(params.img1FeatMtxPtr_);
+  const TePDIMatrix< double >& img2FeatMtx = *(params.img2FeatMtxPtr_);
+  const unsigned int matchMatrixLines = matchMatrix.GetLines();
+  const unsigned int matchMatrixCols = matchMatrix.GetColumns();
+  double& matchMatrixMin = *params.matchMatrixMinPtr_;
+  double& matchMatrixMax = *params.matchMatrixMaxPtr_;
+  unsigned int notProcLine = 0;
+  unsigned int notProcCol = 0;
+  const double negativeInfinite = DBL_MAX * (-1.0);
+  double const* feat1Ptr = 0;
+  double const* feat2Ptr = 0;
+  double sumAA = 0;
+  double sumBB = 0;
+  double ccorrelation = 0;
+  double cc_norm = 0;
+  unsigned int featCol = 0;
+  const unsigned int featSize = img1FeatMtx.GetColumns();
+  double* mMLinePtr = 0;
+  double lineMinValue = 0;
+  double lineMaxValue = 0;
+  
+  // Loocking for a not processed line
+  // Each line will be processed by each thread
+  
+  TePDIPIManager progress( "Calculating correlation matrix",
+    matchMatrixLines, params.progressEnabled_ );  
+  
+  for( notProcLine = 0 ; notProcLine < matchMatrixLines ; ++notProcLine )
+  {
+    params.glbMutexptr_->lock();
+    
+    mMLinePtr = matchMatrix[ notProcLine ];
+    
+    if( mMLinePtr[ 0 ] == negativeInfinite )
+    {
+      // mark line as under processing 
+      mMLinePtr[ 0 ] = 0;  
+      
+      params.glbMutexptr_->unLock();
+      
+      lineMinValue = DBL_MAX;
+      lineMaxValue = -1.00 * DBL_MAX;
+      
+      for( notProcCol = 0 ; notProcCol < matchMatrixCols ; ++notProcCol )
+      {      
+        params.glbMutexptr_->lock();
+        
+        feat1Ptr = img1FeatMtx[ notProcLine ];
+        feat2Ptr = img2FeatMtx[ notProcCol ];        
+        
+        params.glbMutexptr_->unLock();
+        
+        sumAA = 0;
+        sumBB = 0;   
+        
+        for( featCol = 0 ; featCol < featSize ; ++featCol )
+        {
+          sumAA += feat1Ptr[ featCol ] * feat1Ptr[ featCol ];
+          sumBB += feat2Ptr[ featCol ] * feat2Ptr[ featCol ];
+        }
+        
+        cc_norm = sqrt( sumAA * sumBB );
+        
+        if( cc_norm == 0.0 )
+        {
+          ccorrelation = -1.00;
+          mMLinePtr[ notProcCol ] = -1.00 ;
+        }
+        else
+        {
+          ccorrelation = 0;
+          
+          for( featCol = 0 ; featCol < featSize ; ++featCol )
+          {
+            ccorrelation += ( feat1Ptr[ featCol ] * feat2Ptr[ featCol ] ) / 
+              cc_norm;
+          }
+            
+          mMLinePtr[ notProcCol ] = ccorrelation;            
+        }
+        
+        if( ccorrelation < lineMinValue )
+        {
+          lineMinValue = ccorrelation;
+        }  
+        if( ccorrelation > lineMaxValue )
+        {
+          lineMaxValue = ccorrelation;
+        }
+      }
+      
+      // Updating the global match matrix min and max variables using
+      // the current line min and max
+      
+      TEAGN_DEBUG_CONDITION( lineMinValue <= lineMaxValue, "invalid values" )
+      
+      params.glbMutexptr_->lock();
+      
+      if( lineMinValue < matchMatrixMin )
+      {
+        matchMatrixMin = lineMinValue;
+      }
+      if( lineMaxValue > matchMatrixMax )
+      {
+        matchMatrixMax = lineMaxValue;
+      }        
+      
+      params.glbMutexptr_->unLock();      
+    }
+    else
+    {
+      params.glbMutexptr_->unLock();
+    }
+   
+    if( progress.Increment() )
+    {
+      TEAGN_LOGERR( "Canceled by the user" );
+      return;
+    }
+  }
+  
+  params.returnValue_ = true;
+}
+
+void TePDIMMIOMatching::matrix2Tiff( 
+  const TePDIMtxDoubleAdptInt& input_matrix,
+  const std::string& out_file_name,
+  const MaximasListT& maxima_points )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.getNLines() > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.getNCols() > 0 ), 
+    "Invalid matrix cols" )
+    
+  double value = 0;
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_matrix.getNLines(),
+    input_matrix.getNCols() );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  
+  for( unsigned int line = 0 ; 
+    line < input_matrix.getNLines() ; ++line ) {
+    for( unsigned int col = 0 ; 
+      col < input_matrix.getNCols() ; 
+      ++col ) 
+    {
+      input_matrix.getValue( line, col, value );
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        MIN( value, 254.0 ), 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw maxima points */
+  
+  MaximasListT::const_iterator maximas_it = 
+    maxima_points.begin();
+  MaximasListT::const_iterator maximas_it_end = 
+    maxima_points.end();
+    
+  while( maximas_it != maximas_it_end ) {
+    const unsigned int& x = maximas_it->x_;
+    
+    TEAGN_TRUE_OR_THROW( ( ((int)x) < (int)input_matrix.getNCols() ),
+      "Invalid maxima column" )
+    const unsigned int& y = maximas_it->y_;
+    TEAGN_TRUE_OR_THROW( ( ((int)y) < (int)input_matrix.getNLines() ),
+      "Invalid maxima line" )
+    
+    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+      255.0, 0 ),
+      "Error writing raster" )
+      
+    ++maximas_it;
+  }  
+}
+
+void TePDIMMIOMatching::matrix2Tiff( 
+  const TePDIMtxDoubleAdptInt& input_matrix,
+  const std::string& out_file_name,
+  const TeCoordPairVect& tiepoints,
+  bool usePt1 )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.getNLines() > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.getNCols() > 0 ), 
+    "Invalid matrix cols" )
+    
+  double value = 0;
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_matrix.getNLines(),
+    input_matrix.getNCols() );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  
+  for( unsigned int line = 0 ; 
+    line < input_matrix.getNLines() ; ++line ) {
+    for( unsigned int col = 0 ; 
+      col < input_matrix.getNCols() ; 
+      ++col ) 
+    {
+      input_matrix.getValue( line, col, value );
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        MIN( value, 254.0 ), 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw maxima points */
+  
+  TeCoordPairVect::const_iterator it = 
+    tiepoints.begin();
+  TeCoordPairVect::const_iterator it_end = 
+    tiepoints.end();
+  
+  int tpx = 0;
+  int tpy = 0;
+    
+  while( it != it_end ) {
+    if( usePt1 )
+    {
+      tpx = (int)it->pt1.x();
+      tpy = (int)it->pt1.y();
+    }
+    else
+    {
+      tpx = (int)it->pt2.x();
+      tpy = (int)it->pt2.y();
+    }
+    
+    TEAGN_TRUE_OR_THROW( ( tpx < (int)input_matrix.getNCols() ),
+      "Invalid maxima column" )
+    TEAGN_TRUE_OR_THROW( ( tpx >= 0 ),
+      "Invalid maxima column" )
+    TEAGN_TRUE_OR_THROW( ( tpy < (int)input_matrix.getNLines() ),
+      "Invalid maxima line" )
+    TEAGN_TRUE_OR_THROW( ( tpy >= 0 ),
+      "Invalid maxima line" )           
+    
+    TEAGN_TRUE_OR_THROW( out_raster.setElement( tpx, tpy, 
+      255.0, 0 ),
+      "Error writing raster" )
+      
+    ++it;
+  }  
+}
+
+void TePDIMMIOMatching::doublesMatrix2Tiff( 
+  const TePDIMatrix< double >& input_matrix,
+  const std::string& out_file_name,
+  const MaximasListT& maxima_points )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.GetLines() > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.GetColumns() > 0 ), 
+    "Invalid matrix cols" )
+    
+  // Guessing matrix range
+  
+  unsigned int line = 0;
+  unsigned int col = 0;
+  double input_matrix_min = DBL_MAX;
+  double input_matrix_max = -1.0 * DBL_MAX;
+  
+  for( line = 0 ; line < input_matrix.GetLines() ; ++line ) 
+  {
+    for( col = 0 ; col < input_matrix.GetColumns() ; ++col ) 
+    {
+      if( input_matrix( line, col ) < input_matrix_min )
+      {
+        input_matrix_min = input_matrix( line, col );
+      }
+      if( input_matrix( line, col ) > input_matrix_max )
+      {
+        input_matrix_max = input_matrix( line, col );
+      }      
+    }  
+  }  
+  
+  double input_matrix_range = input_matrix_max - input_matrix_min;
+  
+  // Generate output
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_matrix.GetLines(),
+    input_matrix.GetColumns() );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  
+  for( line = 0 ; line < input_matrix.GetLines() ; ++line ) 
+  {
+    for( col = 0 ; col < input_matrix.GetColumns() ; ++col ) 
+    {
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        255.0 * ( ( input_matrix( line, col ) - input_matrix_min ) / 
+        input_matrix_range ), 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw maxima points */
+  
+  MaximasListT::const_iterator maximas_it = 
+    maxima_points.begin();
+  MaximasListT::const_iterator maximas_it_end = 
+    maxima_points.end();
+    
+  while( maximas_it != maximas_it_end ) {
+    const unsigned int& x = maximas_it->x_;
+    
+    TEAGN_TRUE_OR_THROW( ( ((int)x) < (int)input_matrix.GetColumns() ),
+      "Invalid maxima column" )
+    const unsigned int& y = maximas_it->y_;
+    TEAGN_TRUE_OR_THROW( ( ((int)y) < (int)input_matrix.GetLines() ),
+      "Invalid maxima line" )
+    
+    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+      255.0, 0 ),
+      "Error writing raster" )
+      
+    ++maximas_it;
+  }  
+}
+
+void TePDIMMIOMatching::features2Tiff( 
+  unsigned int corr_window_width,
+  const MaximasListT& img_maxima_points,
+  TePDIMatrix< double >& img_features_matrix,
+  const std::string& filenameaddon )
+{
+  TEAGN_TRUE_OR_THROW( ( img_features_matrix.GetLines() ==
+    img_maxima_points.size() ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( img_features_matrix.GetColumns() ==
+    ( corr_window_width * corr_window_width ) ), 
+    "Invalid matrix columns" )
+  TEAGN_TRUE_OR_THROW( ( corr_window_width > 0 ),
+    "Invalid corr_window_width" )   
+    
+  MaximasListT::const_iterator maxIt = img_maxima_points.begin();
+
+  for( unsigned int curr_wind_index = 0 ; 
+    curr_wind_index < img_features_matrix.GetLines() ;
+    ++curr_wind_index ) {
+    
+    // finding feature min and max
+    
+    double featMin = DBL_MAX;
+    double featMax = -1.0 * featMin;
+    
+    for( unsigned int fcol = 0 ; fcol < img_features_matrix.GetColumns();
+      ++fcol )
+    {
+      if( img_features_matrix( curr_wind_index, fcol ) < featMin )
+      {
+        featMin = img_features_matrix( curr_wind_index, fcol );
+      }
+      if( img_features_matrix( curr_wind_index, fcol ) > featMax )
+      {
+        featMax = img_features_matrix( curr_wind_index, fcol );
+      }
+    }
+    
+    double featRange = ( featMin != featMax ) ? ( featMax - featMin ) : 1.0;
+    double featMultFac = 255.0 / featRange;
+    
+    // saving output
+    
+    TeRasterParams params;
+    params.setNLinesNColumns( corr_window_width,
+      corr_window_width );
+    params.nBands( 1 );
+    params.setDataType( TeUNSIGNEDCHAR, -1 );
+    params.nBands( 1 );
+    params.decoderIdentifier_ = "TIF";
+    params.mode_ = 'c';
+    params.fileName_ = filenameaddon + "_" + Te2String( maxIt->x_, 0 ) + 
+      "_" + Te2String( maxIt->y_, 0 ) + ".tif";
+    
+    TeRaster out_raster( params );
+    TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+    
+    for( unsigned int line = 0 ; line < corr_window_width ; ++line ) {
+      for( unsigned int col = 0 ; col < corr_window_width ; ++col ) {
+
+        TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+          ( img_features_matrix( curr_wind_index, ( line * 
+          corr_window_width ) + col ) - featMin ) * featMultFac, 0 ), 
+          "Error writing raster" )
+      }  
+    }
+    
+    ++maxIt;
+  }
+}
+
+bool TePDIMMIOMatching::bicubicResampleMatrix( const TePDIMtxDoubleAdptInt& inputMatrix,
+  unsigned int outLines, unsigned int outCols, bool progressEnabled,
+  TeMutex& globalMutex, double outMinValue, double outMaxValue,
+  TePDIMtxDoubleAdptInt& outputMatrix )
+{
+  globalMutex.lock();
+  
+  if( ! outputMatrix.reset( outLines, outCols ) )
+  {
+    globalMutex.unLock();
+    
+    TEAGN_LOGERR( "Output matrix reset error" );
+  }
+  
+  globalMutex.unLock();
+  
+  const unsigned int inLines = inputMatrix.getNLines();
+  const unsigned int inCols = inputMatrix.getNCols();
+  const int lastInLineIdx = inLines - 1;
+  const int lastInColIdx = inCols - 1;
+  const double yResFact = ((double)outLines) / ((double)inLines);
+  const double xResFact = ((double)outCols) / ((double)inCols);
+  const double bicubic_columns_bound = ((double)inCols) - 2;
+  const double bicubic_lines_bound = ((double)inLines) - 2;
+  const double bicubic_kernel_parameter = -1.0;
+  
+  double inputLine = 0;
+  double inputCol = 0;
+  unsigned int outLine = 0;
+  unsigned int outCol = 0;
+  double value = 0;
+  unsigned int  bicubic_grid_input_line = 0;
+  unsigned int  bicubic_grid_input_col = 0;
+  unsigned int  bicubic_buffer_line = 0;
+  unsigned int  bicubic_buffer_col = 0;  
+  double bicubic_offset_x;
+  double bicubic_offset_y;
+  double bicubic_h_weights[4];
+  double bicubic_v_weights[4];  
+  double bicubic_h_weights_sum = 0;
+  double bicubic_v_weights_sum = 0;
+  double bicubic_int_line_accum = 0;
+  double bicubic_int_lines_values[4];
+  int correctedInputLine = 0;
+  int correctedInputCol = 0;
+  
+  TePDIPIManager progress( "Resampling", outLines, 
+     progressEnabled );  
+  
+  for( outLine = 0 ; outLine < outLines ; ++outLine )
+  {
+    inputLine =  ((double)outLine) / yResFact;
+    
+    for( outCol = 0 ; outCol < outCols ; ++outCol )
+    {
+      inputCol =  ((double)outCol) / xResFact;
+      
+      if( ( inputCol < 1.0 ) || ( inputLine < 1.0 ) || ( inputCol >= 
+        bicubic_columns_bound ) || ( inputLine >= bicubic_lines_bound ) ) 
+      {
+        /* Near neighborhood interpolation will be used */
+        
+        correctedInputLine = (int)TeRound( inputLine );
+        correctedInputLine = MAX( 0, correctedInputLine );
+        correctedInputLine = MIN( lastInLineIdx, correctedInputLine );
+        
+        correctedInputCol = (int)TeRound( inputCol );
+        correctedInputCol = MAX( 0, correctedInputCol );
+        correctedInputCol = MIN( lastInColIdx, correctedInputCol );        
+        
+        inputMatrix.getValue( correctedInputLine, correctedInputCol, value );
+        outputMatrix.setValue( outLine , outCol, value );
+      } else {
+        bicubic_grid_input_line = ( (unsigned int)floor( inputLine ) ) - 1;
+        bicubic_grid_input_col = ( (unsigned int)floor( inputCol ) ) - 1;
+        
+        /* Bicubic weights calcule for the required position */
+        
+        bicubic_offset_x = inputCol - (double)( bicubic_grid_input_col + 1 );
+        bicubic_offset_y = inputLine - (double)( bicubic_grid_input_line + 1 );    
+        
+        bicubic_h_weights[0] = BICUBIC_KERNEL( 1.0 + bicubic_offset_x, 
+          bicubic_kernel_parameter );
+        bicubic_h_weights[1] = BICUBIC_KERNEL( bicubic_offset_x, 
+          bicubic_kernel_parameter );
+        bicubic_h_weights[2] = BICUBIC_KERNEL( 1.0 - bicubic_offset_x, 
+          bicubic_kernel_parameter );
+        bicubic_h_weights[3] = BICUBIC_KERNEL( 2.0 - bicubic_offset_x, 
+          bicubic_kernel_parameter );
+          
+        bicubic_v_weights[0] = BICUBIC_KERNEL( 1.0 + bicubic_offset_y, 
+          bicubic_kernel_parameter );
+        bicubic_v_weights[1] = BICUBIC_KERNEL( bicubic_offset_y, 
+          bicubic_kernel_parameter );
+        bicubic_v_weights[2] = BICUBIC_KERNEL( 1.0 - bicubic_offset_y, 
+          bicubic_kernel_parameter );
+        bicubic_v_weights[3] = BICUBIC_KERNEL( 2.0 - bicubic_offset_y, 
+          bicubic_kernel_parameter );
+          
+        bicubic_h_weights_sum = bicubic_h_weights[0] + bicubic_h_weights[1] +
+          bicubic_h_weights[2] + bicubic_h_weights[3];
+        bicubic_v_weights_sum = bicubic_v_weights[0] + bicubic_v_weights[1] +
+          bicubic_v_weights[2] + bicubic_v_weights[3];
+        
+        /* interpolating the value */
+        
+        for( bicubic_buffer_line = 0 ; bicubic_buffer_line < 4 ; 
+          ++bicubic_buffer_line) {
+          
+          bicubic_int_line_accum = 0;
+          
+          for( bicubic_buffer_col = 0 ; bicubic_buffer_col < 4 ; 
+            ++bicubic_buffer_col ) 
+          {
+            inputMatrix.getValue( bicubic_grid_input_line + bicubic_buffer_line, 
+                bicubic_grid_input_col + bicubic_buffer_col,
+                value );            
+            
+            bicubic_int_line_accum += value * 
+              bicubic_h_weights[ bicubic_buffer_col ];
+          }
+          
+          bicubic_int_lines_values[ bicubic_buffer_line ] = 
+            bicubic_int_line_accum / bicubic_h_weights_sum;
+        }
+        
+        value = bicubic_int_lines_values[ 0 ] * bicubic_v_weights[ 0 ] +
+          bicubic_int_lines_values[ 1 ] * bicubic_v_weights[ 1 ] +
+          bicubic_int_lines_values[ 2 ] * bicubic_v_weights[ 2 ] +
+          bicubic_int_lines_values[ 3 ] * bicubic_v_weights[ 3 ];
+        value = value / bicubic_v_weights_sum;
+        
+        if( value > outMaxValue )
+        {
+          outputMatrix.setValue( outLine , outCol, outMaxValue );
+        }
+        else if( value < outMinValue )
+        {
+          outputMatrix.setValue( outLine , outCol, outMinValue );
+        }
+        else
+        {  
+          outputMatrix.setValue( outLine , outCol, value );
+        }
+      }
+    }
+    
+    if( progress.Increment() )
+    {
+      TEAGN_LOGMSG( "Canceled by the user" );
+      return false;
+    }
+  }
+ 
+  return true;
+}
+
+bool TePDIMMIOMatching::generateMaximasRaster( 
+  const TePDIMtxDoubleAdptInt& inputMatrix,
+  const MaximasListT& maximaPoints,
+  TeRaster& outRaster )
+{
+  // initiating the output raster
+  
+  const unsigned int nLines = inputMatrix.getNLines();
+  const unsigned int nCols = inputMatrix.getNCols();
+      
+  TeRasterParams params = outRaster.params();
+  params.setNLinesNColumns( nLines, nCols );
+  params.nBands( 3 );
+  params.setPhotometric( TeRasterParams::TeRGB );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  TEAGN_TRUE_OR_THROW( outRaster.init( params ), "Error init raster" );
+  
+  // copying data
+  
+  double value = 0;
+  
+  for( unsigned int line = 0 ; line < nLines ; ++line ) 
+  {
+    for( unsigned int col = 0 ; col < nCols ; ++col ) 
+    {
+      inputMatrix.getValue( line, col, value );
+      
+      TEAGN_TRUE_OR_RETURN( outRaster.setElement( col, line, 
+        MIN( value, 254.0 ), 0 ),
+        "Error writing raster" )
+      TEAGN_TRUE_OR_RETURN( outRaster.setElement( col, line, 
+        MIN( value, 254.0 ), 1 ),
+        "Error writing raster" )
+      TEAGN_TRUE_OR_RETURN( outRaster.setElement( col, line, 
+        MIN( value, 254.0 ), 2 ),
+        "Error writing raster" )                
+    }  
+  }
+  
+  /* Draw maxima points */
+  
+  MaximasListT::const_iterator maximas_it = 
+    maximaPoints.begin();
+  MaximasListT::const_iterator maximas_it_end = 
+    maximaPoints.end();
+  unsigned int xValue = 0;
+  unsigned int yValue = 0;
+    
+  while( maximas_it != maximas_it_end ) 
+  {
+    xValue = maximas_it->x_;
+    yValue = maximas_it->y_;
+    
+    if( ( xValue < nCols ) && ( yValue < nLines ) )
+    {
+      TEAGN_TRUE_OR_RETURN( outRaster.setElement( xValue, yValue, 
+        255.0, 0 ),
+        "Error writing raster" )
+      TEAGN_TRUE_OR_RETURN( outRaster.setElement( xValue, yValue, 
+        0.0, 1 ),
+        "Error writing raster" )        
+      TEAGN_TRUE_OR_RETURN( outRaster.setElement( xValue, yValue, 
+        0.0, 2 ),
+        "Error writing raster" )        
+    }
+      
+    ++maximas_it;
+  }  
+
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIMMIOMatching.hpp b/src/terralib/image_processing/TePDIMMIOMatching.hpp
index d89784a..43043fa 100644
--- a/src/terralib/image_processing/TePDIMMIOMatching.hpp
+++ b/src/terralib/image_processing/TePDIMMIOMatching.hpp
@@ -1,492 +1,607 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMMIOMATCHING_HPP
-  #define TEPDIMMIOMATCHING_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIMtxDoubleAdpt.hpp"
-
-  #include <TeThreadJobsManager.h>
-  #include <TeMutex.h>
-
-  #include <list>
-
-  /*!
-      \class TePDIMMIOMatching
-      \brief Modified Moravec Interest Operator based image area matching.
-      \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
-      \ingroup PDIMatchingAlgorithms
-     
-      \note The required parameters are:
-     
-      \param input_image1_ptr (TePDITypes::TePDIRasterPtrType) - 
-      The input image 1.
-      \param input_channel1 ( unsigned int ) - Band to process 
-      from input_image1.
-     
-      \param input_image2_ptr (TePDITypes::TePDIRasterPtrType) - 
-      The input image 2.
-      \param input_channel2 ( unsigned int ) - Band to process 
-      from input_image2.
-     
-      \param out_tie_points_ptr ( TeSharedPtr< TeCoordPairVect > ) - The 
-      output tie- points correlation_method
-      where TeCoordPair.pt1 are input_image1 matricial
-      indexes and TeCoordPair.pt2 are input_image2 matricial
-      indexes.
-     
-      \note The Optional parameters are:
-      
-      \param matching_method (FeatMatchingMethod) Features matching method
-      (default: TePDIMMIOMatching::NormCrossCorrMethod).    
-     
-      \param pixel_x_relation (double) - The pixel resolution relation 
-      pixel_x_relation = img1_pixel_res_x / img2_pixel_res_x (default=1.0).
-     
-      \param pixel_y_relation (double) - The pixel resolution relation 
-      pixel_y_relation = img1_pixel_res_y / img2_pixel_res_y (default=1.0).   
-      
-      \param gt_params ( TeGTParams ) - The geometric transformation
-      parameters to be used (if not supplied, the dafult TeGTParams
-      will be used - affine transformation, max direct mapping
-      error = 2 pixels, max inverse mapping error = 2 pixels,
-      LWAOutRemotion outliers remotion ).
-     
-      \param out_gt_params_ptr ( TeGTParams::pointer ) - The output 
-      parameters of internally generated geometric transformation 
-      (only valid when geometrical filtering is enabled).
-     
-      \param input_box1 ( TeBox ) - Box (image matrix coords) to process 
-      from input_image1 ( the entire image will be used if no box
-      was supplied ).
-     
-      \param input_box2 ( TeBox ) - Box (image matrix coords) to process 
-      from input_image2 ( the entire image will be used if no box
-      was supplied ).
-     
-      \param enable_multi_thread (int) - If present (any value) 
-      a multi-threaded processing will be used; Some TeDecoders do
-      not support multi-thread so use it with cation
-      (default: multi-thread disabled).
-     
-      \param max_tie_points (unsigned int) - The maximum number
-      of generated tie-points (default=1000).
-     
-      \param skip_geom_filter (int) - If present (any value) 
-      will disable the geometric filtering
-      ( default: geometric filtering enabled ). 
-  
-      \param enable_upsampled_filter (int) - If present (any value) 
-      will enable the upsampled image Moravec repeatability filter
-      ( default: upsampled filtering disable - only the downsampled
-      image filter will be applied ).  
-     
-      \param corr_window_width (unsigned int) - The correlation 
-      window width used to correlate points between 
-      images (Must be an odd number, minimum 13, default: 13).  
-  
-      \param moravec_window_width (unsigned int) - The Moravec
-      window width used to locate canditate tie-points
-      (Must be an odd number, minimum 10, default: 11 ).  
-      
-      \param variance_min_thrs (double) - Variance minimum value threshold( tie-points
-      with directional variance values below this threshold will be eliminated ) - Allowed
-      range  [0,3] - with higher values more points with low directional variance will be acquired - 
-      default:1.
-      
-      \example TePDIMMIOMatching_test.cpp Shows how to use this class.
-  */
-  class PDI_DLL TePDIMMIOMatching : public TePDIAlgorithm {
-    public :
-      
-      /*! Features matching methods. */
-      enum FeatMatchingMethod
-      {
-        /*! Features nuclidian distance method */
-        EuclidianDistMethod = 1,      
-        /*! Features normalized cross-correlation method */
-        NormCrossCorrMethod = 2
-      };
-
-      TePDIMMIOMatching();
-
-      ~TePDIMMIOMatching();
-
-      // Overloaded
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-      
-      /*! Maximas list node type 
-         \param unsigned int (first) Column - X.
-         \param unsigned int (second) Line - Y.
-       */
-      typedef std::pair< unsigned int, unsigned int > MaximasListNodeT;      
-      
-      /*! Maximas list type 
-       */
-      typedef std::list< MaximasListNodeT > MaximasListT;
-      
-      /*! Ordered maximas map type 
-         \param unsigned int (first) Column - X.
-         \param unsigned int (second) Line - Y.
-       */
-      typedef std::multimap< double, std::pair< unsigned int, unsigned int > > 
-        MaximasMapT;      
-      
-      struct LoadImageParams
-      {
-        TePDITypes::TePDIRasterPtrType input_image_ptr_;
-        unsigned int input_image_channel_;
-        TePDIMtxDoubleAdptInt* img_matrix_ptr_;
-        TePDIMtxDoubleAdptInt* img_matrix_ds_ptr_;
-        TePDIMtxDoubleAdptInt* img_matrix_us_ptr_;
-        unsigned int in_box_x_off_;
-        unsigned int in_box_y_off_;
-        unsigned int in_box_nlines_;
-        unsigned int in_box_ncols_;
-        bool progress_enabled_;
-        TeMutex* glb_mem_lock_ptr_;
-        double origImgXRescFact_; // factor = rescaled_orignal_image / original_image
-        double origImgYRescFact_; // factor = rescaled_orignal_image / original_image
-        double moravecDownSampleFactor_; // factor = rescaled_original_img / ds_image
-        double moravecUpSampleFactor_; // factor = rescaled_original_img / us_image
-        bool returnValue_; // true if OK.
-        bool generateUpsampledImage_;
-      };
-      
-      struct ExtractLocalMaximasParams 
-      {
-        /*! Input image matrix */
-        TePDIMtxDoubleAdptInt* imgMatrixPtr_;
-        
-        /*! The output list where the found maximas index coords will be 
-            appended */
-        MaximasListT* outMaximasListPtr_;
-        
-        unsigned int moravecWindowSize_;
-        
-        unsigned int maximasNumber_;
-        
-        double moravecMinVarianceThreshold_;
-        
-        /*! Number of sub-images to seach (power of 2). */
-        unsigned seachSubImagesNmb_; // Number of sub-images to seach.
-        
-        //Job return value.
-        bool returnValue_;
-        
-        /*! Is progress interface enabled ?? */
-        bool progressEnabled_;
-        
-        /*! Global mutex pointer */
-        TeMutex* glbMutexptr_;     
-      };
-      
-      struct GenerateCorrelationFeaturesParams
-      {
-        /*! Input image matrix */
-        TePDIMtxDoubleAdptInt const* imgMatrixPtr_;
-        
-        /*! Input maximas list */
-        MaximasListT const* inMaximasListPtr_;
-        
-        /*! Output features matrix pointer */
-        TePDIMatrix< double >* featMtxPtr_;
-        
-        /*! Execution return value (true if OK, false on errors).*/
-        bool returnValue_;
-        
-        /* A mutex object pointer to sync large memory allocations */
-        TeMutex* glbMemLockPtr_; // To sync large memory allocations
-        
-        /*! The generated correlation windows width.*/
-        unsigned int corrWindowsWidth_;
-        
-        /*! Is progress interface enabled ?? */
-        bool progressEnabled_;
-        
-        /*! If true, the generated windows will be normalized between -1 
-         * and + 1. 
-         */
-        bool normalizeWindows_;
-      };
-      
-      struct CalcEuclidianDistanceMtxParams
-      {
-        /*! Image 1 features matrix pointer. */
-        TePDIMatrix< double > const* img1FeatMtxPtr_;
-        
-        /*! Image 2 features matrix pointer. */
-        TePDIMatrix< double > const* img2FeatMtxPtr_;
-
-        /*! Output matching matrix. */
-        TePDIMatrix<double>* matchMatrixPtr_;
-  
-        /*! Is progress interface enabled ?? */
-        bool progressEnabled_;
-        
-        /*! Global mutex pointer */
-        TeMutex* glbMutexptr_;
-  
-        /*! Execution return value (true if OK, false on errors).*/
-        bool returnValue_;
-      };
-      
-      struct CalcCCorrelationMtxParams
-      {
-        /*! Image 1 features matrix pointer. */
-        TePDIMatrix< double > const* img1FeatMtxPtr_;
-        
-        /*! Image 2 features matrix pointer. */
-        TePDIMatrix< double > const* img2FeatMtxPtr_;
-
-        /*! Output matching matrix. */
-        TePDIMatrix<double>* matchMatrixPtr_;
-  
-        /*! Is progress interface enabled ?? */
-        bool progressEnabled_;
-        
-        /*! Global mutex pointer */
-        TeMutex* glbMutexptr_;
-  
-        /*! Execution return value (true if OK, false on errors).*/
-        bool returnValue_;
-      };      
-      
-      /*! Internal threaded jobs manager. */
-      TeThreadJobsManager jobsMan_;
-      
-      /*! A global syncronization mutex. */
-      TeMutex globalMutex_;
-      
-      /*! A pointer to the input image 1. */
-      TePDITypes::TePDIRasterPtrType input_image1_ptr_;
-      
-      /*! Input image 1 channel. */
-      unsigned int input_channel1_;
-      
-      /*! Input image 1 box (indexed). */
-      TeBox input_box1_;
-      
-      /*! A pointer to the input image 2. */
-      TePDITypes::TePDIRasterPtrType input_image2_ptr_;
-      
-      /*! Input image 2 channel. */
-      unsigned int input_channel2_;
-      
-      /*! Input image 2 box (indexed). */
-      TeBox input_box2_;
-      
-      /*! Image 1 features matrix (each matrix line is a stacked version of one 
-       * correlation window
-       */ 
-      TePDIMatrix< double > img1featMtx_;
-      
-      /*! Image 2 features matrix (each matrix line is a stacked version of one 
-       * correlation window
-       */ 
-      TePDIMatrix< double > img2featMtx_;      
-
-      /*! Image 1 maximas list. */       
-      MaximasListT img1_maximas_list_;
-
-      /*! Image 2 maximas list. */       
-      MaximasListT img2_maximas_list_;
-      
-      /*! Feature matching mathod. */
-      FeatMatchingMethod matching_method_;
-      
-      // Overloaded
-      bool RunImplementation();
-
-      // Overloaded
-      void ResetState( const TePDIParameters& params );
-      
-      /**
-        \brief A job function load raster data into
-        a simple matrix.
-        \param paramsPtr The parameters needed for the thread 
-        execution (a pointer to a LoadImageParams struct).
-       */
-      static void loadImage( void * paramsPtr ); 
-      
-      /*! Instantiate an image matrix capable of store pixel data
-         of the supplied type.
-        \param dataType Pixel type.
-        \param matrixPtr A pointer for the new created matrix.
-       */
-      static void createImgMatrix( TeDataType dataType, 
-        TeSharedPtr< TePDIMtxDoubleAdptInt >& matrixPtr );
-     
-      /*!
-        \brief Extract local interest maxima points using a Modified
-        Moravec Interest Operator aproach.
-        \param paramsPtr The parameters needed for the thread 
-        execution (a pointer to a ExtractLocalMaximasParams struct).
-       */
-      static void extractLocalMaximas( void * paramsPtr );
-      
-      /*!
-        \brief Extract local interest maxima points from an image
-        sub-region using a Modified Moravec Interest Operator aproach.
-        \param paramsPtr The parameters needed for the thread
-        execution (a pointer to a ExtractLocalMaximasParams struct).
-        \param xStart Image sub-region initial X coordinate. 
-        \param yStart Image sub-region initial y coordinate.
-        \param width Image sub-region width.
-        \param height Image sub-region height.
-        \param progres Progress interface manager reference.
-        \param return true if OK, false on errors.
-       */      
-      static bool extractLocalMaximas( ExtractLocalMaximasParams& params,
-        unsigned int xStart, unsigned int yStart, unsigned int width,
-        unsigned int height, MaximasMapT& outMaximasMap,
-        TePDIPIManager& progress );
-      
-      /*! 
-        \brief Applies a Moravec repeatability constraint over an image
-        maximas list.
-        \param inputList Original image maximas list.
-        \param constraintList Constraint list.
-        \param constraintImageWidth Constraint image width.
-        \param constraintImageHeight Constraint image height.
-        \param moravecRepeatabilityMinTolerance Error tolerance (pixels)
-        - constraint image reference.
-        \param moravecReSampleFactor Moravec resample factor 
-        (factor = inputList_scal / constraintList_scale).
-        \param outputList Output maximas list from input list.
-       */
-      void moravecRepeatability( const MaximasListT& inputList,
-        const MaximasListT& constraintList, 
-        unsigned int constraintImageWidth,
-        unsigned int constraintImageHeight,
-        double moravecRepeatabilityMinTolerance, 
-        double moravecReSampleFactor, 
-        MaximasListT& outputList );      
-      
-      /*!
-        \brief Generate correlation features.
-        \param paramsPtr The parameters needed for the thread 
-        execution (a pointer to a ExtractLocalMaximasParams struct).
-       */
-      static void generateCorrelationFeatures( void * paramsPtr );    
-      
-      /*! 
-        \brief Features matching and tie-points generation.
-        \param matching_method Features matching method.
-        \param img1featMtx Image 1 features matrix.
-        \param img1_maximas_list Image 1 maximas list.
-        \param img2featMtx Image 2 features matrix.
-        \param img2_maximas_list Image 2 maximas list.
-        \param tiePointsVec Output tie-points vector.
-        \return true if OK, false on errors.
-       */      
-      bool matchFeatures( FeatMatchingMethod matching_method,
-        const TePDIMatrix< double >& img1featMtx,
-        const MaximasListT& img1_maximas_list,
-        const TePDIMatrix< double >& img2featMtx,
-        const MaximasListT& img2_maximas_list,
-        TeCoordPairVect& tiePointsVec );
-      
-      /*!
-        \brief Calc euclidian distance matrix for the supplied features.
-        \param paramsPtr The parameters needed for the thread 
-        execution (a pointer to a CalcEuclidianDistanceMtxParams struct).
-       */
-      static void calcEuclidianDistanceMtx( void * paramsPtr );   
-      
-      /*!
-        \brief cross-correlation matrix calcule (absolute values).
-        \param paramsPtr The parameters needed for the thread 
-        execution (a pointer to a CalcInvCCorrelationMtxParams struct).
-       */
-      static void calcCCorrelationMtx( void * paramsPtr );      
-      
-      /*!
-        \brief Save the output matrix to a geotiff file.
-        \param input_matrix Input matrix.
-        \param out_file_name Output file name.
-        \param maxima_points The maxima points to be
-        filled with 255
-       */      
-      static void matrix2Tiff( 
-        const TePDIMtxDoubleAdptInt& input_matrix,
-        const std::string& out_file_name,
-        const MaximasListT& maxima_points = MaximasListT() );
-      
-      /*!
-        \brief Save the output matrix to a geotiff file.
-        \param input_matrix Input matrix.
-        \param out_file_name Output file name.
-        \param tiepoints The tie oints to be
-        filled with 255
-        \param usePt1 Use pt1 from tiepoints, otherwise use pt1
-       */      
-      static void matrix2Tiff( 
-        const TePDIMtxDoubleAdptInt& input_matrix,
-        const std::string& out_file_name,
-        const TeCoordPairVect& tiepoints,
-        bool usePt1 );      
-      
-      /*!
-        \brief Save the generated features to tif files.
-        \param corr_window_width The correlation windows width.
-        \param img_maxima_points The image maxima points
-        (these are the correlation matrix centers).
-        \param img_features_matrix The output image
-        features matrix ( each line is a stacked version
-        of one rotated correlation window ).
-        \filenameaddon A string to be appended to the
-        file name of each feature file.
-        \return true if OK, false on errors.
-       */          
-      static void features2Tiff( 
-        unsigned int corr_window_width,
-        const MaximasListT& img_maxima_points,
-        TePDIMatrix< double >& img_features_matrix,
-        const std::string& filenameaddon );      
-
-      /*!
-        \brief Input matrix bicubic resample.
-        \param inputMatrix Input matrix.
-        \param outLines Output number of lines.
-        \param outCols Output number of columns.
-        \param progressEnabled Progress enabled flag.
-        \param globalMutex Global mutex.
-        \param outMinValue The allowed output min value.
-        \param outMaxValue The allowed output max value.
-        \param outputMatrix Output matrix.
-        \return true if OK, false on errors.
-       */      
-      static bool bicubicResampleMatrix( const TePDIMtxDoubleAdptInt& inputMatrix,
-        unsigned int outLines, unsigned int outCols, bool progressEnabled,
-        TeMutex& globalMutex, double outMinValue, double outMaxValue,
-        TePDIMtxDoubleAdptInt& outputMatrix );
-      
-  };
-
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMMIOMATCHING_HPP
+  #define TEPDIMMIOMATCHING_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIMtxDoubleAdpt.hpp"
+
+  #include <TeThreadJobsManager.h>
+  #include <TeMutex.h>
+
+  #include <list>
+
+  /*!
+      \class TePDIMMIOMatching
+      \brief Modified Moravec Interest Operator based image area matching.
+      \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
+      \ingroup PDIMatchingAlgorithms
+     
+      \note The required parameters are:
+     
+      \param input_image1_ptr (TePDITypes::TePDIRasterPtrType) - 
+      The input image 1.
+      \param input_channel1 ( unsigned int ) - Band to process 
+      from input_image1.
+     
+      \param input_image2_ptr (TePDITypes::TePDIRasterPtrType) - 
+      The input image 2.
+      \param input_channel2 ( unsigned int ) - Band to process 
+      from input_image2.
+     
+      \param out_tie_points_ptr ( TeSharedPtr< TeCoordPairVect > ) - The 
+      output tie-points where TeCoordPair.pt1 are input_image1 matricial
+      indexes and TeCoordPair.pt2 are input_image2 matricial
+      indexes.
+     
+      \note The Optional parameters are:
+      
+      \param matching_method (TePDIMMIOMatching::FeatMatchingMethod) Features 
+      matching method (default: TePDIMMIOMatching::NormCrossCorrMethod).    
+     
+      \param pixel_x_relation (double) - The pixel resolution relation 
+      pixel_x_relation = img1_pixel_res_x / img2_pixel_res_x (default=1.0).
+     
+      \param pixel_y_relation (double) - The pixel resolution relation 
+      pixel_y_relation = img1_pixel_res_y / img2_pixel_res_y (default=1.0).   
+      
+      \param gt_params ( TeGTParams ) - The geometric transformation
+      parameters to be used (if not supplied, the dafult TeGTParams
+      will be used - affine transformation, max direct mapping
+      error = 2 pixels, RANSACRemotion outliers remotion ).
+     
+      \param out_gt_params_ptr ( TeGTParams::pointer ) - The output 
+      parameters of internally generated geometric transformation 
+      (only valid when geometrical filtering is enabled).
+     
+      \param input_box1 ( TeBox ) - Box (image matrix coords) to process 
+      from input_image1 ( the entire image will be used if no box
+      was supplied ).
+     
+      \param input_box2 ( TeBox ) - Box (image matrix coords) to process 
+      from input_image2 ( the entire image will be used if no box
+      was supplied ).
+     
+      \param enable_multi_thread (int) - If present (any value) 
+      a multi-threaded processing will be used.
+      (default: multi-thread disabled).
+      
+      \param enable_threaded_raster_read (int) - If present (any value) 
+      a multi-threaded input rasters data reading will be performed
+      if enable_multi_thread is also enabled; 
+      Some TeDecoders do not support multi-thread so use it with caution
+      (default: multi-threaded raster read disabled).      
+     
+      \param max_tie_points (unsigned int) - The maximum number
+      of generated tie-points (default=1000).
+     
+      \param skip_geom_filter (int) - If present (any value) 
+      will disable the geometric filtering
+      ( default: geometric filtering enabled ). 
+  
+      \param enable_upsampled_filter (int) - If present (any value) 
+      will enable the upsampled image Moravec repeatability filter
+      ( default: upsampled filtering disabled - only the downsampled
+      image filter will be applied ).  
+      
+      \param disable_reap_filter (int) - If present (any value) 
+      will disable the image Moravec repeatability filters (upsample
+      and downsample) ( default: filtering enabled - filter will be 
+      applied to avoid creation of tie-points over noisy areas).        
+     
+      \param corr_window_width (unsigned int) - The correlation 
+      window width used to correlate points between 
+      images (Must be an odd number, minimum 13, default: 21).  
+  
+      \param moravec_window_width (unsigned int) - The Moravec
+      window width used to locate canditate tie-points
+      (Must be an odd number, minimum 11, default: 11 ).  
+      
+      \param out_tie_points_weights_ptr ( TeSharedPtr< std::vector< double > > ) - The 
+      output tie- points weights vector (normalized between 0 and 1).
+      
+      \param mask_image1_ptr (TePDITypes::TePDIRasterPtrType) - Mask image 1
+      pointer (tie-points falling inside mask image areas marked with
+      zeroes will not be generated; this image must have the same number
+      of lines/columns as input_image1).
+      
+      \param mask_image2_ptr (TePDITypes::TePDIRasterPtrType) - Mask image 2
+      pointer (tie-points falling inside mask image areas marked with
+      zeroes will not be generated; this image must have the same number
+      of lines/columns as input_image1).     
+       
+      \param disable_subimage_search (int) - If present (any value) 
+      the sub-image search will not enabled (the sub-image search
+      improves the tie-point distribution homogeneity - 
+      default:sub-image search enabled).
+      
+      \param out_maximas_image1_ptr (TePDITypes::TePDIRasterPtrType) - This
+      parameters is for visualization and test purposes and if this
+      parameter is present and the pointer is valid (pointing to a
+      valid raster instance) the output maximas image (frim input
+      image 1) will be generated an copied to the pointed raster (this raster
+      will be initiated to 3 RGB bands where the maximas points are marked
+      with value R255G0B0).
+      
+      \param out_maximas_image2_ptr - The same as the out_maximas_image1_ptr
+      parameter but for the second input image.   
+      
+      \example TePDIMMIOMatching_test.cpp Shows how to use this class.
+  */
+  class PDI_DLL TePDIMMIOMatching : public TePDIAlgorithm {
+    public :
+      
+      /*! Features matching methods. */
+      enum FeatMatchingMethod
+      {
+        /*! Features normalized cross-correlation method */
+        NormCrossCorrMethod
+      };
+
+      TePDIMMIOMatching();
+
+      ~TePDIMMIOMatching();
+
+      // Overloaded
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+    
+      /*! Mask matrix type.
+       */
+      typedef TePDIMatrix< unsigned char > MaskMatrixT;     
+      
+      /*! Maximas list node type */            
+      struct MaximasListNodeT
+      {
+        /*! Maxima point X coord */
+        unsigned int x_; 
+        /*! Maxima point Y coord */
+        unsigned int y_;
+        /*! Maxima point X diretional variance (always positive value)*/
+        double dirVariance_;
+      };
+      
+      /*! Maximas list type 
+       */
+      typedef std::list< MaximasListNodeT > MaximasListT;
+      
+      /*! Ordered maximas map node type 
+         \param unsigned int (first) Column - X.
+         \param unsigned int (second) Line - Y.
+       */
+      typedef std::pair< unsigned int, unsigned int > MaximasMapNodeT;      
+      
+      /*! Ordered maximas map type.
+       */
+      typedef std::multimap< double, MaximasMapNodeT > MaximasMapT;      
+      
+      /*! The parameters required to run the method loadImage.
+       */      
+      class PDI_DLL LoadImageParams
+      {
+        public :
+        
+          /*! A pointer to the input image raster.*/
+          TePDITypes::TePDIRasterPtrType input_image_ptr_;
+          
+          /*! A pointer to the input mask image raster or an inactive
+          pointer when no mask image is used.*/
+          TePDITypes::TePDIRasterPtrType mask_image_ptr_;
+          
+          unsigned int input_image_channel_;
+          
+          TePDIMtxDoubleAdptInt* img_matrix_ptr_;
+          
+          TePDIMtxDoubleAdptInt* img_matrix_ds_ptr_;
+          
+          TePDIMtxDoubleAdptInt* img_matrix_us_ptr_;
+          
+          /*! A pointer to a non-initialized output mask matrix.*/          
+          MaskMatrixT* mask_matrix_ptr_;
+          
+          /*! Input box X axis offset (default:0)*/
+          unsigned int in_box_x_off_;
+          
+          /*! Input box Y axis offset (default:0)*/
+          unsigned int in_box_y_off_;
+          
+          /*! Input box number of lines (default:0)*/
+          unsigned int in_box_nlines_;
+          
+          /*! Input box number of columns (default:0)*/
+          unsigned int in_box_ncols_;
+          
+          /*! If true the progress interface will be used (default:false)*/
+          bool progress_enabled_;
+          
+          /*! A pointer to the global mutex instance (default:0)*/
+          TeMutex* glb_mem_lock_ptr_;
+          
+          /*! factor = rescaled_orignal_image / original_image */
+          double origImgXRescFact_;
+          
+          /*! factor = rescaled_orignal_image / original_image */
+          double origImgYRescFact_;
+          
+          /*! factor = rescaled_original_img / ds_image */
+          double moravecDownSampleFactor_;
+          
+          /*! factor = rescaled_original_img / us_image */
+          double moravecUpSampleFactor_;
+          
+          /*! Processing return value, true if OK (default:false) */
+          bool returnValue_;
+          
+          /*! If true, the upsampled image will be generated (default:false) */
+          bool generateUpsampledImage_;
+          
+          /*! If true, the downsampled image will be generated (default:false) */
+          bool generateDownsampledImage_;
+          
+          LoadImageParams()
+          : input_image_channel_( 0 ), img_matrix_ptr_( 0 ),
+            img_matrix_ds_ptr_( 0 ), img_matrix_us_ptr_( 0 ),
+            mask_matrix_ptr_( 0 ), in_box_x_off_( 0 ),
+            in_box_y_off_( 0 ), in_box_nlines_( 0 ),
+            in_box_ncols_( 0 ), progress_enabled_( false ),
+            glb_mem_lock_ptr_( 0 ),
+            origImgXRescFact_( 1 ),
+            origImgYRescFact_( 1 ), moravecDownSampleFactor_( 1 ),
+            moravecUpSampleFactor_( 1 ), returnValue_( false ),
+            generateUpsampledImage_( false ), generateDownsampledImage_( false )
+          {};
+          
+          ~LoadImageParams() {};
+      };
+      
+      class PDI_DLL ExtractLocalMaximasParams 
+      {
+        public :
+        
+          /*! Input image matrix */
+          TePDIMtxDoubleAdptInt const* imgMatrixPtr_;
+          
+          /*! The output list where the found maximas index coords will be 
+              appended */
+          MaximasListT* outMaximasListPtr_;
+          
+          unsigned int moravecWindowSize_;
+          
+          unsigned int maximasNumber_;
+          
+          /*! Number of sub-images to seach (power of 2). */
+          unsigned seachSubImagesNmb_; // Number of sub-images to seach.
+          
+          //Job return value.
+          bool returnValue_;
+          
+          /*! Is progress interface enabled ?? */
+          bool progressEnabled_;
+          
+          /*! Global mutex pointer */
+          TeMutex* glbMutexptr_;  
+          
+          /*! A pointer to a mask matrix or null if mask is not used.*/          
+          MaskMatrixT const* maskMatrixPtr_;          
+             
+          ExtractLocalMaximasParams()
+          : imgMatrixPtr_( 0 ), outMaximasListPtr_( 0 ),
+            moravecWindowSize_( 0 ), maximasNumber_( 0 ),
+            seachSubImagesNmb_( 0 ), returnValue_( false ),
+            progressEnabled_( false ), glbMutexptr_( 0 ),
+            maskMatrixPtr_( 0 )
+          {};
+          
+          ~ExtractLocalMaximasParams() {};
+      };
+      
+      struct GenerateCorrelationFeaturesParams
+      {
+        /*! Input image matrix */
+        TePDIMtxDoubleAdptInt const* imgMatrixPtr_;
+        
+        /*! Input maximas list */
+        MaximasListT const* inMaximasListPtr_;
+        
+        /*! Output features matrix pointer */
+        TePDIMatrix< double >* featMtxPtr_;
+        
+        /*! Execution return value (true if OK, false on errors).*/
+        bool returnValue_;
+        
+        /* A mutex object pointer to sync large memory allocations */
+        TeMutex* glbMemLockPtr_; // To sync large memory allocations
+        
+        /*! The generated correlation windows width.*/
+        unsigned int corrWindowsWidth_;
+        
+        /*! Is progress interface enabled ?? */
+        bool progressEnabled_;
+        
+        /*! If true, the generated windows will be normalized between -1 
+         * and + 1. 
+         */
+        bool normalizeWindows_;
+      };
+      
+      class CalcCCorrelationMtxParams
+      {
+        public :
+          /*! Image 1 features matrix pointer (default:0). */
+          TePDIMatrix< double > const* img1FeatMtxPtr_;
+          
+          /*! Image 2 features matrix pointer. */
+          TePDIMatrix< double > const* img2FeatMtxPtr_;
+  
+          /*! A pointer to an output matching matrix pr�-initialized with 
+          negative infinite values DBL_MAX * -1 (default:0)*/
+          TePDIMatrix<double>* matchMatrixPtr_;
+          
+          /*! A pointer to pre-initialized double variable (DBL_MAX) to store
+          the mininum value written to the output match matrix (default:0) */
+          double* matchMatrixMinPtr_;
+          
+          /*! A pointer to pre-initialized double variable (-1.0 * DBL_MAX) 
+          to store the maximum value written to the output match matrix (default:0) */
+          double* matchMatrixMaxPtr_;          
+    
+          /*! Is progress interface enabled ?? (default:false)*/
+          bool progressEnabled_;
+          
+          /*! Global mutex pointer (default:0)*/
+          TeMutex* glbMutexptr_;
+    
+          /*! Execution return value (true if OK, false on errors - default:
+          false).*/
+          bool returnValue_;
+          
+          CalcCCorrelationMtxParams()
+          : img1FeatMtxPtr_( 0 ), img2FeatMtxPtr_( 0 ), matchMatrixPtr_( 0 ), 
+          matchMatrixMinPtr_( 0 ),
+          matchMatrixMaxPtr_( 0 ),
+          progressEnabled_( false ), glbMutexptr_( 0 ), returnValue_( false )
+          {};
+          
+          ~CalcCCorrelationMtxParams() {};
+      };      
+      
+      /*! Moravec downsample factor = original_image / downsampled_image */
+      const double moravecDownSampleFactor_;
+      
+      /*! Moravec upsample factor = original_image / upsampled_image */
+      const double moravecUpSampleFactor_;
+      
+      /*! Moravec repeatability tolerance */
+      const double moravecRepeatabilityMinTolerance_;      
+      
+      /*! Internal threaded jobs manager. */
+      TeThreadJobsManager jobsMan_;
+      
+      /*! A global syncronization mutex. */
+      TeMutex globalMutex_;
+      
+      // Overloaded
+      bool RunImplementation();
+
+      // Overloaded
+      void ResetState( const TePDIParameters& params );
+      
+      /**
+        \brief A job function load raster data into
+        a simple matrix.
+        \param paramsPtr The parameters needed for the thread 
+        execution (a pointer to a LoadImageParams struct).
+       */
+      static void loadImage( void * paramsPtr ); 
+      
+      /*! Instantiate an image matrix capable of store pixel data
+         of the supplied type.
+        \param dataType Pixel type.
+        \param matrixPtr A pointer for the new created matrix.
+       */
+      static void createImgMatrix( TeDataType dataType, 
+        TeSharedPtr< TePDIMtxDoubleAdptInt >& matrixPtr );
+     
+      /*!
+        \brief Extract local interest maxima points using a Modified
+        Moravec Interest Operator aproach.
+        \param paramsPtr The parameters needed for the thread 
+        execution (a pointer to a ExtractLocalMaximasParams struct).
+       */
+      static void extractLocalMaximas( void * paramsPtr );
+      
+      /*!
+        \brief Extract local interest maxima points from an sub-image
+        sub-region using a Modified Moravec Interest Operator aproach.
+        \param imgMatrixPtr Input image matrix pointer.
+        \param maskMatrixPtr Input mask matrix pointer (or null if mask
+        is not used).
+        \param xStart Image sub-region initial X coordinate. 
+        \param yStart Image sub-region initial y coordinate.
+        \param width Image sub-region width.
+        \param height Image sub-region height.
+        \param bufferMatrix Pre-initiated buffer with at least width x height.
+        \param moravecWindowSize Moravec window size
+        \param maximasNumber The number of maximas to append to outMaximasMap.
+        \param outMaximasList The found maximas will be appended to this container.
+        \param progres Progress interface manager reference.
+        \param return true if OK, false on errors.
+       */      
+      static bool extractLocalMaximas( 
+        TePDIMtxDoubleAdptInt const* imgMatrixPtr,
+        MaskMatrixT const* maskMatrixPtr,
+        const unsigned int& xStart, const unsigned int& yStart, 
+        const unsigned int& width, const unsigned int& height, 
+        TePDIMatrix< double >& bufferMatrix,
+        const unsigned int& moravecWindowSize, 
+        const unsigned int& maximasNumber, 
+        MaximasListT& outMaximasList, 
+        TePDIPIManager& progress );         
+      
+      /*! 
+        \brief Applies a Moravec repeatability constraint over an image
+        maximas list.
+        \param inputList Original image maximas list.
+        \param constraintList Constraint list.
+        \param constraintImageWidth Constraint image width.
+        \param constraintImageHeight Constraint image height.
+        \param moravecRepeatabilityMinTolerance Error tolerance (pixels)
+        - constraint image reference.
+        \param moravecReSampleFactor Moravec resample factor 
+        (factor = inputList_scal / constraintList_scale).
+        \param outputList Output maximas list from input list.
+       */
+      void moravecRepeatability( const MaximasListT& inputList,
+        const MaximasListT& constraintList, 
+        unsigned int constraintImageWidth,
+        unsigned int constraintImageHeight,
+        double moravecRepeatabilityMinTolerance, 
+        double moravecReSampleFactor, 
+        MaximasListT& outputList );      
+      
+      /*!
+        \brief Generate correlation features.
+        \param paramsPtr The parameters needed for the thread 
+        execution (a pointer to a ExtractLocalMaximasParams struct).
+       */
+      static void generateCorrelationFeatures( void * paramsPtr );    
+      
+      /*! 
+        \brief Features matching and tie-points generation.
+        \param matching_method Features matching method.
+        \param img1featMtx Image 1 features matrix.
+        \param img1_maximas_list Image 1 maximas list.
+        \param img2featMtx Image 2 features matrix.
+        \param img2_maximas_list Image 2 maximas list.
+        \param tiePointsVec Output tie-points vector.
+        \param tiePointsWeights Output tie-points weights vector
+        ( normalized between DBL_MIN and 1 ).
+        \return true if OK, false on errors.
+       */      
+      bool matchFeatures( FeatMatchingMethod matching_method,
+        const TePDIMatrix< double >& img1featMtx,
+        const MaximasListT& img1_maximas_list,
+        const TePDIMatrix< double >& img2featMtx,
+        const MaximasListT& img2_maximas_list,
+        TeCoordPairVect& tiePointsVec,
+        std::vector< double >& tiePointsWeights );
+      
+      /*!
+        \brief cross-correlation matrix calcule.
+        \param paramsPtr The parameters needed for the thread 
+        execution (a pointer to a CalcCCorrelationMtxParams struct).
+       */
+      static void calcCCorrelationMtx( void * paramsPtr );      
+      
+      /*!
+        \brief Save the output matrix to a geotiff file.
+        \param input_matrix Input matrix.
+        \param out_file_name Output file name.
+        \param maxima_points The maxima points to be
+        filled with 255
+       */      
+      static void matrix2Tiff( 
+        const TePDIMtxDoubleAdptInt& input_matrix,
+        const std::string& out_file_name,
+        const MaximasListT& maxima_points = MaximasListT() );
+      
+      /*!
+        \brief Save the output matrix to a geotiff file.
+        \param input_matrix Input matrix.
+        \param out_file_name Output file name.
+        \param tiepoints The tie oints to be
+        filled with 255
+        \param usePt1 Use pt1 from tiepoints, otherwise use pt1
+       */      
+      static void matrix2Tiff( 
+        const TePDIMtxDoubleAdptInt& input_matrix,
+        const std::string& out_file_name,
+        const TeCoordPairVect& tiepoints,
+        bool usePt1 );    
+          
+      /*!
+        \brief Save the output matrix to a geotiff file.
+        \param input_matrix Input matrix.
+        \param out_file_name Output file name.
+        \param maxima_points The maxima points to be
+        filled with 255
+       */      
+      static void doublesMatrix2Tiff( 
+        const TePDIMatrix< double >& input_matrix,
+        const std::string& out_file_name,
+        const MaximasListT& maxima_points = MaximasListT() );          
+      
+      /*!
+        \brief Save the generated features to tif files.
+        \param corr_window_width The correlation windows width.
+        \param img_maxima_points The image maxima points
+        (these are the correlation matrix centers).
+        \param img_features_matrix The output image
+        features matrix ( each line is a stacked version
+        of one rotated correlation window ).
+        \filenameaddon A string to be appended to the
+        file name of each feature file.
+        \return true if OK, false on errors.
+       */          
+      static void features2Tiff( 
+        unsigned int corr_window_width,
+        const MaximasListT& img_maxima_points,
+        TePDIMatrix< double >& img_features_matrix,
+        const std::string& filenameaddon );      
+
+      /*!
+        \brief Input matrix bicubic resample.
+        \param inputMatrix Input matrix.
+        \param outLines Output number of lines.
+        \param outCols Output number of columns.
+        \param progressEnabled Progress enabled flag.
+        \param globalMutex Global mutex.
+        \param outMinValue The allowed output min value.
+        \param outMaxValue The allowed output max value.
+        \param outputMatrix Output matrix.
+        \return true if OK, false on errors.
+       */      
+      static bool bicubicResampleMatrix( const TePDIMtxDoubleAdptInt& inputMatrix,
+        unsigned int outLines, unsigned int outCols, bool progressEnabled,
+        TeMutex& globalMutex, double outMinValue, double outMaxValue,
+        TePDIMtxDoubleAdptInt& outputMatrix );
+      
+      /*!
+        \brief Generate the output maximas image ( 3 RGB bands where the 
+        maximas points are marked with value R255G0B0).
+        \param inputMatrix Input image data matrix.
+        \param maximaPoints Input maximas point list.
+        \param outRaster The ouptput raster.
+        \return true if ok, false on errors.
+       */      
+      static bool generateMaximasRaster( 
+        const TePDIMtxDoubleAdptInt& inputMatrix,
+        const MaximasListT& maximaPoints,
+        TeRaster& outRaster );       
+  };
+
+
+#endif
diff --git a/src/terralib/image_processing/TePDIMallatWavelets.cpp b/src/terralib/image_processing/TePDIMallatWavelets.cpp
index 9bb0d3e..d6bc3f9 100644
--- a/src/terralib/image_processing/TePDIMallatWavelets.cpp
+++ b/src/terralib/image_processing/TePDIMallatWavelets.cpp
@@ -1,2017 +1,2032 @@
-#include "TePDIMallatWavelets.hpp"
-
-#include "TePDIUtils.hpp"
-#include "TePDIStrategyFactory.hpp"
-#include "TePDIMathFunctions.hpp"
-#include "TePDIPIManager.hpp"
-
-#include <TeAgnostic.h>
-#include <TeUtils.h>
-#include <TeDefines.h>
-
-#include <math.h>
-#include <float.h>
-
-
-TePDIMallatWavelets::TePDIMallatWavelets()
-{
-  shift_histogram_flag_ = false;
-  input_image_mean_ = 0;
-}
-
-
-TePDIMallatWavelets::~TePDIMallatWavelets()
-{
-}
-
-
-bool TePDIMallatWavelets::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  std::string filter_task;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "filter_task", filter_task ),
-    "Missing parameter: filter_task" );
-    
-  /* Checking filters */
-  
-  std::vector< double > a_filter_l;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "a_filter_l", a_filter_l ),
-    "Missing parameter: a_filter_l" );
-  TEAGN_TRUE_OR_RETURN( a_filter_l.size() > 1, 
-    "Invalid parameter: a_filter_l" );
-    
-  std::vector< double > a_filter_h;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "a_filter_h", a_filter_h ),
-    "Missing parameter: a_filter_h" );
-  TEAGN_TRUE_OR_RETURN( a_filter_h.size() > 1, 
-    "Invalid parameter: a_filter_h" );    
-    
-  std::vector< double > s_filter_l;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "s_filter_l", s_filter_l ),
-    "Missing parameter: s_filter_l" );
-  TEAGN_TRUE_OR_RETURN( s_filter_l.size() > 1, 
-    "Invalid parameter: s_filter_l" );
-    
-  std::vector< double > s_filter_h;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "s_filter_h", s_filter_h ),
-    "Missing parameter: s_filter_h" );
-  TEAGN_TRUE_OR_RETURN( s_filter_h.size() > 1, 
-    "Invalid parameter: s_filter_h" );
-    
-  unsigned int max_filter_size = ( unsigned int )
-    MAX( a_filter_l.size(), MAX( a_filter_h.size(), MAX( s_filter_l.size(), 
-    s_filter_h.size() ) ) );
-    
-  /* Checking filters scale */        
-  
-  double filters_scale = 0;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "filters_scale", filters_scale ),
-    "Missing parameter: filters_scale" );
-  TEAGN_TRUE_OR_RETURN( filters_scale != 0, "filters scale cannot be zero" );
-  
-  /* Additional checking for each task */
-  
-  if( filter_task == "SBExtract" ) {
-      /* Checking input_raster */
-  
-      TePDITypes::TePDIRasterPtrType input_image;
-      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_image", 
-        input_image ),  "Missing parameter: input_image" );
-      TEAGN_TRUE_OR_RETURN( input_image.isActive(),
-        "Invalid parameter: input_image inactive" );
-      TEAGN_TRUE_OR_RETURN( input_image->params().status_ != 
-        TeRasterParams::TeNotReady, 
-        "Invalid parameter: input_image not ready" );
-    
-      TEAGN_TRUE_OR_RETURN( ( input_image->params().nlines_ > 1 ), 
-        "Invalid input_image lines number" );
-      TEAGN_TRUE_OR_RETURN( ( input_image->params().ncols_ > 1 ), 
-        "Invalid input_image columns number" );
-    
-      /* Checking input band */
-  
-      int band;
-      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "band", band ),
-        "Missing parameter: band" );
-      TEAGN_TRUE_OR_RETURN( band < input_image->nBands(),
-        "Invalid parameter: band" );
-        
-      /* Checking photometric interpretation */
-  
-      TEAGN_TRUE_OR_RETURN( ( 
-        ( input_image->params().photometric_[ band ] == 
-          TeRasterParams::TeRGB ) ||
-        ( input_image->params().photometric_[ band ] == 
-          TeRasterParams::TeMultiBand ) ),
-        "Invalid parameter: input_image "
-        "( invalid photometric interpretation" );
-        
-      /* checking for the output lowlow raster */
-    
-      TePDITypes::TePDIRasterPtrType sub_band;
-      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "sub_band", sub_band ),
-        "Missing parameter: sub_band" );
-      TEAGN_TRUE_OR_RETURN( sub_band.isActive(),
-        "Invalid parameter: sub_band inactive pointer" );
-      TEAGN_TRUE_OR_RETURN( sub_band->params().status_ != 
-        TeRasterParams::TeNotReady, "Invalid parameter: sub_band not ready" );        
-      
-      int sub_band_index = 0;
-      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "sub_band_index", 
-        sub_band_index ), "Missing parameter: sub_band" );
-      TEAGN_TRUE_OR_RETURN( ( ( sub_band_index >= 0 ) && 
-        ( sub_band_index < 4 ) ), "Invalid parameter: sub_band_index" );
-        
-      /* Checking decomposition levels number */
-      
-      int max_levels = (int)( MIN(
-          TePDIMathFunctions::DecimLevels( input_image->params().nlines_ ),
-          TePDIMathFunctions::DecimLevels( input_image->params().ncols_ ) ) );
-    
-      int levels = 0;
-      TEAGN_TRUE_OR_RETURN( 
-        parameters.GetParameter( "levels", levels ),
-        "Missing parameter: levels" );
-      TEAGN_TRUE_OR_RETURN( ( levels > 0 ) && ( levels <= max_levels ),
-        "Invalid parameter: levels" );
-      TEAGN_TRUE_OR_RETURN( 
-        ( TePDIMathFunctions::DecimLevelSize(
-        levels, MIN( input_image->params().nlines_,
-        input_image->params().ncols_ ) ) >= max_filter_size ),
-        "Invalid parameter: The current \"levels\" parameter and "
-        "input filters are incompatible" );
-    } else if( filter_task == "SBSwap" ) {
-      /* Checking input_raster */
-  
-      TePDITypes::TePDIRasterPtrType input_image;
-      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_image", 
-        input_image ), "Missing parameter: input_image" );
-      TEAGN_TRUE_OR_RETURN( input_image.isActive(),
-        "Invalid parameter: input_image inactive" );
-      TEAGN_TRUE_OR_RETURN( input_image->params().status_ != 
-        TeRasterParams::TeNotReady, 
-        "Invalid parameter: input_image not ready" );
-    
-      TEAGN_TRUE_OR_RETURN( ( input_image->params().nlines_ > 1 ), 
-        "Invalid input_image lines number" );
-      TEAGN_TRUE_OR_RETURN( ( input_image->params().ncols_ > 1 ), 
-        "Invalid input_image columns number" );
-    
-      /* Checking input band */
-  
-      int band;
-      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "band", band ),
-        "Missing parameter: band" );
-      TEAGN_TRUE_OR_RETURN( band < input_image->nBands(),
-        "Invalid parameter: band" );
-        
-      /* Checking photometric interpretation */
-  
-      TEAGN_TRUE_OR_RETURN( ( 
-        ( input_image->params().photometric_[ band ] == 
-          TeRasterParams::TeRGB ) ||
-        ( input_image->params().photometric_[ band ] == 
-          TeRasterParams::TeMultiBand ) ),
-        "Invalid parameter: input_image "
-        "( invalid photometric interpretation" );        
-        
-      /* Checking decomposition levels number */   
-  
-      int max_levels = (int)( MIN(
-          TePDIMathFunctions::DecimLevels( input_image->params().nlines_ ),
-          TePDIMathFunctions::DecimLevels( input_image->params().ncols_ ) ) );
-    
-      int levels = 0;
-      TEAGN_TRUE_OR_RETURN( 
-        parameters.GetParameter( "levels", levels ),
-        "Missing parameter: levels" );
-      TEAGN_TRUE_OR_RETURN( ( levels > 0 ) && ( levels <= max_levels ),
-        "Invalid parameter: levels" );
-      TEAGN_TRUE_OR_RETURN( 
-        ( TePDIMathFunctions::DecimLevelSize(
-        levels, MIN( input_image->params().nlines_,
-        input_image->params().ncols_ ) ) >= max_filter_size ),
-        "Invalid parameter: The current \"levels\" parameter and "
-        "input filters are incompatible" );                
-            
-      /* Checking output_raster */
-  
-      TePDITypes::TePDIRasterPtrType output_image;
-      TEAGN_TRUE_OR_RETURN( 
-        parameters.GetParameter( "output_image", output_image ),
-        "Missing parameter: output_image" );
-      TEAGN_TRUE_OR_RETURN( output_image.isActive(),
-        "Invalid parameter: output_image inactive" );
-      TEAGN_TRUE_OR_RETURN( output_image->params().status_ != 
-        TeRasterParams::TeNotReady, 
-        "Invalid parameter: output_image not ready" );    
-        
-      /* checking for the sub-band */
-    
-      TePDITypes::TePDIRasterPtrType sub_band;
-      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "sub_band", sub_band ),
-        "Missing parameter: sub_band" );
-      TEAGN_TRUE_OR_RETURN( sub_band.isActive(),
-        "Invalid parameter: sub_band inactive pointer" );
-      TEAGN_TRUE_OR_RETURN( sub_band->params().status_ != 
-        TeRasterParams::TeNotReady, "Invalid parameter: sub_band not ready" );       
-        
-      TEAGN_TRUE_OR_RETURN( ( ((unsigned int)sub_band->params().nlines_) == 
-        TePDIMathFunctions::DecimLevelSize( levels,
-        input_image->params().nlines_ ) ),
-        "Invalid parameter: Sub_band lines mismatch for the choosen "
-        "decomposition level" );
-      TEAGN_TRUE_OR_RETURN( ( ( (unsigned int)sub_band->params().ncols_) == 
-        TePDIMathFunctions::DecimLevelSize( levels,
-        input_image->params().ncols_ ) ),
-        "Invalid parameter: Sub_band columns mismatch for the choosen "
-        "decomposition level" );
-        
-      /* checking sub-band index */
-                
-      int sub_band_index = 0;
-      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "sub_band_index", 
-        sub_band_index ), "Missing parameter: sub_band" );
-      TEAGN_TRUE_OR_RETURN( ( ( sub_band_index >= 0 ) && 
-        ( sub_band_index < 4 ) ), "Invalid parameter: sub_band_index" );       
-    } else if( filter_task == "GetPyramid" ) {
-      /* Checking input_raster */
-  
-      TePDITypes::TePDIRasterPtrType input_image;
-      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_image", 
-        input_image ), "Missing parameter: input_image" );
-      TEAGN_TRUE_OR_RETURN( input_image.isActive(),
-        "Invalid parameter: input_image inactive" );
-      TEAGN_TRUE_OR_RETURN( input_image->params().status_ != 
-        TeRasterParams::TeNotReady, 
-        "Invalid parameter: input_image not ready" );
-    
-      TEAGN_TRUE_OR_RETURN( ( input_image->params().nlines_ > 1 ), 
-        "Invalid input_image lines number" );
-      TEAGN_TRUE_OR_RETURN( ( input_image->params().ncols_ > 1 ), 
-        "Invalid input_image columns number" );
-    
-      /* Checking input band */
-  
-      int band;
-      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "band", band ),
-        "Missing parameter: band" );
-      TEAGN_TRUE_OR_RETURN( band < input_image->nBands(),
-        "Invalid parameter: band" );
-        
-      /* Checking photometric interpretation */
-  
-      TEAGN_TRUE_OR_RETURN( ( 
-        ( input_image->params().photometric_[ band ] == 
-          TeRasterParams::TeRGB ) ||
-        ( input_image->params().photometric_[ band ] == 
-          TeRasterParams::TeMultiBand ) ),
-        "Invalid parameter: input_image "
-        "( invalid photometric interpretation" );        
-        
-      /* Checking decomposition levels number */   
-  
-      int max_levels = (int)( MIN(
-          TePDIMathFunctions::DecimLevels( input_image->params().nlines_ ),
-          TePDIMathFunctions::DecimLevels( input_image->params().ncols_ ) ) );
-    
-      int levels = 0;
-      TEAGN_TRUE_OR_RETURN( 
-        parameters.GetParameter( "levels", levels ),
-        "Missing parameter: levels" );
-      TEAGN_TRUE_OR_RETURN( ( levels > 0 ) && ( levels <= max_levels ),
-        "Invalid parameter: levels" );
-      TEAGN_TRUE_OR_RETURN( 
-        ( TePDIMathFunctions::DecimLevelSize(
-        levels, MIN( input_image->params().nlines_,
-        input_image->params().ncols_ ) ) >= max_filter_size ),
-        "Invalid parameter: The current \"levels\" parameter and "
-        "input filters are incompatible" );
-        
-      /* Checking for the pyramid reference */
-      
-      TePDITypes::TePDIRasterVectorPtrType pyramid;
-      TEAGN_TRUE_OR_RETURN( 
-        parameters.GetParameter( "pyramid", pyramid ),
-        "Missing parameter: pyramid" );
-      TEAGN_TRUE_OR_RETURN( 
-        pyramid.isActive(), "Inactive parameter: pyramid" );
-    } else if( filter_task == "RecomposePyramid" ) {
-      /* Checking input_raster */
-  
-      TePDITypes::TePDIRasterPtrType input_image;
-      
-      if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-        "input_image" ) ) {
-        
-        TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_image", 
-          input_image ), "Missing parameter: input_image" );
-        TEAGN_TRUE_OR_RETURN( input_image.isActive(),
-          "Invalid parameter: input_image inactive" );
-        TEAGN_TRUE_OR_RETURN( input_image->params().status_ != 
-          TeRasterParams::TeNotReady, 
-          "Invalid parameter: input_image not ready" );
-      
-        TEAGN_TRUE_OR_RETURN( ( input_image->params().nlines_ > 1 ), 
-          "Invalid input_image lines number" );
-        TEAGN_TRUE_OR_RETURN( ( input_image->params().ncols_ > 1 ), 
-          "Invalid input_image columns number" );
-      
-        /* Checking input band */
-    
-        int band;
-        TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "band", band ),
-          "Missing parameter: band" );
-        TEAGN_TRUE_OR_RETURN( band < input_image->nBands(),
-          "Invalid parameter: band" );
-          
-        /* Checking photometric interpretation */
-    
-        TEAGN_TRUE_OR_RETURN( ( 
-          ( input_image->params().photometric_[ band ] == 
-            TeRasterParams::TeRGB ) ||
-          ( input_image->params().photometric_[ band ] == 
-            TeRasterParams::TeMultiBand ) ),
-          "Invalid parameter: input_image "
-          "( invalid photometric interpretation" );          
-      }
-      
-      /* Checking output_raster */
-  
-      TePDITypes::TePDIRasterPtrType output_image;
-      TEAGN_TRUE_OR_RETURN( 
-        parameters.GetParameter( "output_image", output_image ),
-        "Missing parameter: output_image" );
-      TEAGN_TRUE_OR_RETURN( output_image.isActive(),
-        "Invalid parameter: output_image inactive" );
-      TEAGN_TRUE_OR_RETURN( output_image->params().status_ != 
-        TeRasterParams::TeNotReady, 
-        "Invalid parameter: output_image not ready" );          
-      
-      /* Checking for the pyramid reference */
-      
-      TePDITypes::TePDIRasterVectorPtrType pyramid;
-      TEAGN_TRUE_OR_RETURN( 
-        parameters.GetParameter( "pyramid", pyramid ),
-        "Missing parameter: pyramid" );
-      TEAGN_TRUE_OR_RETURN( 
-        pyramid.isActive(), "Inactive parameter: pyramid" );      
-      
-      TEAGN_TRUE_OR_RETURN( ( ( pyramid->size() % 4 ) == 0 ),
-        "Invalid input pyramid size" );
-        
-      unsigned int py_levels = pyramid->size() / 4;
-      unsigned int py_sb00_index = 0;
-      for( unsigned int level = 1 ; level <= py_levels ; ++level ) {
-        py_sb00_index = ( level - 1 ) * 4;
-        
-        TEAGN_TRUE_OR_RETURN( (
-          ( (*pyramid)[ py_sb00_index ]->params().nlines_ ==
-            (*pyramid)[ py_sb00_index + 1 ]->params().nlines_ ) &&
-          ( (*pyramid)[ py_sb00_index ]->params().nlines_ ==
-            (*pyramid)[ py_sb00_index + 2 ]->params().nlines_ ) &&
-          ( (*pyramid)[ py_sb00_index ]->params().nlines_ ==
-            (*pyramid)[ py_sb00_index + 3 ]->params().nlines_ ) &&
-          ( (*pyramid)[ py_sb00_index ]->params().ncols_ ==
-            (*pyramid)[ py_sb00_index + 1 ]->params().ncols_ ) &&
-          ( (*pyramid)[ py_sb00_index ]->params().ncols_ ==
-            (*pyramid)[ py_sb00_index + 2 ]->params().ncols_ ) &&
-          ( (*pyramid)[ py_sb00_index ]->params().ncols_ ==
-            (*pyramid)[ py_sb00_index + 3 ]->params().ncols_ ) ),
-          "Dimensions mismatch detected between same level sub-bands"
-          " inside input pyramid" );
-            
-        TEAGN_TRUE_OR_RETURN( (
-          ( (*pyramid)[ py_sb00_index ]->nBands() == 1 ) &&
-          ( (*pyramid)[ py_sb00_index + 1 ]->nBands() == 1 ) &&
-          ( (*pyramid)[ py_sb00_index + 2 ]->nBands() == 1 ) &&
-          ( (*pyramid)[ py_sb00_index + 3 ]->nBands() == 1 ) ),
-          "Invalid number of bands detected inside input pyramid" );
-          
-        /* Checking the correct dimensions between levels */
-        
-        if( level != py_levels ) {
-          TEAGN_TRUE_OR_RETURN( (
-            ( (*pyramid)[ py_sb00_index ]->params().nlines_ >
-            ( 2 * ( (*pyramid)[ py_sb00_index + 4 ]->params().nlines_ - 
-            1 ) ) ) 
-            && ( (*pyramid)[ py_sb00_index ]->params().ncols_ >
-            ( 2 * ( (*pyramid)[ py_sb00_index + 4 ]->params().ncols_ - 
-            1 ) ) ) ),
-            "Dimensions mismatch detected between levels inside input pyramid" 
-            );
-        }
-      }
-      
-      if( input_image.isActive() ) {
-        TEAGN_TRUE_OR_RETURN(
-          ( (*pyramid)[ 0 ]->params().nlines_ == 
-          ( (int)ceil( ((double)input_image->params().nlines_) / 2 ) ) &&
-          ( (*pyramid)[ 0 ]->params().ncols_) == 
-          ( (int)ceil( ((double)input_image->params().ncols_ ) / 2 ) ) ) , 
-          "The supplied pyramid and reference image are not compatible" );
-      }
-    } else { 
-      TEAGN_LOG_AND_RETURN( "Invalid filter_task parameter" );
-    }
-  
-  return true;  
-}
-
-
-bool TePDIMallatWavelets::RunImplementation()
-{
-  std::string filter_task;
-  params_.GetParameter( "filter_task", filter_task );
-
-  if( filter_task == "SBExtract" ) {
-      TEAGN_TRUE_OR_RETURN( Decompose( params_ ), 
-        "Unable to do Wavelet decomposition" );
-        
-      TePDITypes::TePDIRasterPtrType sub_band;
-      params_.GetParameter( "sub_band", sub_band );
-      
-      int sub_band_index = 0;
-      params_.GetParameter( "sub_band_index", sub_band_index );
-      
-      TEAGN_TRUE_OR_RETURN( GetSubBand(  pyramid_.size() - 1,
-        sub_band_index, sub_band ),
-        "Unable to copy sub-band to output raster" );
-        
-      pyramid_.clear();
-    } else if( filter_task == "SBSwap" ) {
-      TEAGN_TRUE_OR_RETURN( Decompose( params_ ), 
-        "Unable to do Wavelet decomposition" );
-        
-      TePDITypes::TePDIRasterPtrType sub_band;
-      params_.GetParameter( "sub_band", sub_band );
-      
-      int sub_band_index = 0;
-      params_.GetParameter( "sub_band_index", sub_band_index );      
-      
-      TEAGN_TRUE_OR_RETURN( ChangeSubBand( pyramid_.size() - 1,
-        sub_band_index, sub_band ), "Sub-band swap error" );
-        
-      TEAGN_TRUE_OR_RETURN( Recompose( pyramid_.size() - 1, params_ ),
-        "Recomposition error" );
-        
-      pyramid_.clear();
-    } else if( filter_task == "GetPyramid" ) {
-      TEAGN_TRUE_OR_RETURN( Decompose( params_ ), 
-        "Unable to do Wavelet decomposition" );
-        
-      TePDITypes::TePDIRasterVectorPtrType pyramid;
-      params_.GetParameter( "pyramid", pyramid );
-        
-      for( unsigned int level = 1 ; level < pyramid_.size() ; ++level ) {
-        TePDITypes::TePDIRasterPtrType sub_band00;
-        TePDITypes::TePDIRasterPtrType sub_band01;
-        TePDITypes::TePDIRasterPtrType sub_band10;
-        TePDITypes::TePDIRasterPtrType sub_band11;
-        
-        TEAGN_TRUE_OR_RETURN(
-          TePDIUtils::TeAllocRAMRaster( sub_band00, 1, 1, 1, false, TeDOUBLE, 
-          0 ), "Unable to allocate temporary sub-band00 raster" );
-        TEAGN_TRUE_OR_RETURN(
-          TePDIUtils::TeAllocRAMRaster( sub_band01, 1, 1, 1, false, TeDOUBLE, 
-          0 ), "Unable to allocate temporary sub-band01 raster" );
-        TEAGN_TRUE_OR_RETURN(
-          TePDIUtils::TeAllocRAMRaster( sub_band10, 1, 1, 1, false, TeDOUBLE, 
-          0 ), "Unable to allocate temporary sub-band10 raster" );
-        TEAGN_TRUE_OR_RETURN(
-          TePDIUtils::TeAllocRAMRaster( sub_band11, 1, 1, 1, false, TeDOUBLE, 
-          0 ), "Unable to allocate temporary sub-band11 raster" );
-      
-        TEAGN_TRUE_OR_RETURN( GetSubBand( level, 0, sub_band00 ),
-          "Unable to copy sub-band00 to output raster" );
-        pyramid->push_back( sub_band00 );        
-        TEAGN_TRUE_OR_RETURN( GetSubBand( level, 1, sub_band01 ),
-          "Unable to copy sub-band01 to output raster" );
-        pyramid->push_back( sub_band01 );
-        TEAGN_TRUE_OR_RETURN( GetSubBand( level, 2, sub_band10 ),
-          "Unable to copy sub-band10 to output raster" );
-        pyramid->push_back( sub_band10 );
-        TEAGN_TRUE_OR_RETURN( GetSubBand( level, 3, sub_band11 ),
-          "Unable to copy sub-band11 to output raster" );
-        pyramid->push_back( sub_band11 );
-      }
-      
-      pyramid_.clear();
-    } else if( filter_task == "RecomposePyramid" ) {
-      pyramid_.clear();
-      
-      TePDITypes::TePDIRasterPtrType input_image;
-      if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-        "input_image" ) ) {
-        
-        params_.GetParameter( "input_image", input_image );
-      }      
-      
-      TePDITypes::TePDIRasterVectorPtrType pyramid;
-      params_.GetParameter( "pyramid", pyramid );
-      
-      const unsigned int levels = ( pyramid->size() - 1 ) / 3;
-      unsigned int sblines = 0;
-      unsigned int sbcols = 0;
-      unsigned int py_sb00_index = 0;
-    
-      for( unsigned int level = 1 ; level <= levels ; ++level ) {
-        py_sb00_index = ( level - 1 ) * 4;
-      
-        if( ( level == 1 ) && ( input_image.isActive() ) ) {
-          sblines = ( unsigned int )
-            ceil( ( (double)input_image->params().nlines_ ) / 2 );
-          sbcols = ( unsigned int )
-            ceil( ( (double)input_image->params().ncols_ ) / 2 );
-        } else {
-          sblines = (*pyramid)[ py_sb00_index + 1 ]->params().nlines_;
-          sbcols = (*pyramid)[ py_sb00_index + 1 ]->params().ncols_;
-        }
-        
-        TEAGN_TRUE_OR_RETURN( AllocateTopLevel( level, sblines, sbcols ),
-          "Unable to allocate the new pyramid level " +
-          Te2String( level ) );
-          
-        TEAGN_TRUE_OR_RETURN( ChangeSubBand( level,
-          0, (*pyramid)[ py_sb00_index ] ), "Unable to copy pyramid data at"
-          "level " + Te2String( level ) + " sub-band 00" );
-        TEAGN_TRUE_OR_RETURN( ChangeSubBand( level,
-          1, (*pyramid)[ py_sb00_index + 1 ] ), "Unable to copy pyramid data at"
-          "level " + Te2String( level ) + " sub-band 01" );
-        TEAGN_TRUE_OR_RETURN( ChangeSubBand( level,
-          2, (*pyramid)[ py_sb00_index + 2 ] ), "Unable to copy pyramid data at"
-          "level " + Te2String( level ) + " sub-band 10" );
-        TEAGN_TRUE_OR_RETURN( ChangeSubBand( level,
-          3, (*pyramid)[ py_sb00_index + 3 ] ), "Unable to copy pyramid data at"
-          "level " + Te2String( level ) + " sub-band 11" );
-      }
-      
-      TEAGN_TRUE_OR_RETURN( Recompose( pyramid_.size() - 1, params_ ),
-        "Recomposition error" ); 
-        
-      pyramid_.clear();     
-    } else {
-      TEAGN_LOG_AND_THROW( "Invalid filter task" );
-    }    
-  
-  return true;
-}
-
-
-
-
-void TePDIMallatWavelets::ResetState( const TePDIParameters& )
-{
-  shift_histogram_flag_ = false;
-  input_image_mean_ = 0;
-}
-
-
-bool TePDIMallatWavelets::Decompose( const TePDIParameters& params )
-{
-  /* Retriving parameters */
-    
-  TePDITypes::TePDIRasterPtrType input_image;
-  params.GetParameter( "input_image", input_image );
-  
-  int band;
-  params.GetParameter( "band", band );  
-  
-  int levels = 0;
-  params.GetParameter( "levels", levels );
-  
-  /* Guessing dummy use */
-  
-  bool input_image_uses_dummy = input_image->params().useDummy_;
-  double input_image_dummy = 0;
-  if( input_image_uses_dummy ) {
-    input_image_dummy = input_image->params().dummy_[ band ];
-  }
-  
-  /* Generationg subband pyramid level 0 */
-    
-  const unsigned int inputlines = input_image->params().nlines_;
-  const unsigned int inputcolumns = input_image->params().ncols_;
-  
-  pyramid_.clear();
-    
-  TePDIMatrix<double> subband0;
-  
-  TePDIMatrix< TePDIMatrix< double > > levelzeromatrix( 1, 1 ); 
-  levelzeromatrix( 0, 0 ) = subband0;
-  
-  pyramid_.push_back( levelzeromatrix );
-  
-  TEAGN_TRUE_OR_RETURN( 
-    pyramid_[ 0 ]( 0, 0 ).Reset( inputlines, inputcolumns,
-    TePDIMatrix<double>::AutoMemPol ),
-    "Unable to create level 0 sub-band" );
-    
-  double pixel_value;
-  TePDIMatrix< double >& l0matrix = pyramid_[ 0 ]( 0, 0 );
-  
-  input_image_mean_ = 0;
-  
-  unsigned int inputline;
-  unsigned int inputcolumn;
-  
-  for( inputline = 0 ; inputline < inputlines ; ++inputline ) {
-    for( inputcolumn = 0 ; inputcolumn < inputcolumns ; ++inputcolumn ) {
-      if( input_image->getElement( inputcolumn, inputline, pixel_value, 
-          band ) ) {
-  
-        l0matrix( inputline, inputcolumn ) = pixel_value;
-        input_image_mean_ += pixel_value;
-      } else {
-        TEAGN_TRUE_OR_RETURN( input_image_uses_dummy, "Raster read error" );
-      
-        l0matrix( inputline, inputcolumn ) = input_image_dummy;
-        input_image_mean_ += input_image_dummy;        
-      }
-    }
-  }
-  
-  input_image_mean_ = 
-    input_image_mean_ / ( (double)( inputlines * inputcolumns ) );  
-  
-  if( shift_histogram_flag_ ) {
-  
-    /* Removing mean */  
-    
-    for( inputline = 0 ; inputline < inputlines ; ++inputline ) {
-      for( inputcolumn = 0 ; inputcolumn < inputcolumns ; ++inputcolumn ) {
-        l0matrix( inputline, inputcolumn ) = 
-        l0matrix( inputline, inputcolumn ) - input_image_mean_;
-      }
-    }  
-  }
-  
-  /* Generating the other subband pyramid levels */
-  
-  for( int level = 1 ; level <= levels ; ++level ) {
-    TEAGN_TRUE_OR_RETURN( GenerateLevel( level, params ),
-      "Unable to generate level " + 
-      Te2String( level ) );
-  }
-  
-  return true;  
-}
-
-
-bool TePDIMallatWavelets::Recompose( unsigned int ref_level,
-  const TePDIParameters& params )
-{
-  TePDITypes::TePDIRasterPtrType input_image;
-  if( params.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-    "input_image" ) ) {
-      
-    params.GetParameter( "input_image", input_image );    
-  }
-
-  TEAGN_TRUE_OR_RETURN( ( ( pyramid_.size() > ref_level ) &&
-    ( ref_level > 0 ) ), 
-    "Invalid reference level" );
-    
-  /* Retriving the systesis filters */
-  
-  
-  std::vector< double > s_filter_l;
-  std::vector< double > s_filter_h;
-  int lowshift;
-  int highshift;
-  
-  TEAGN_TRUE_OR_RETURN( GetSynthesisFilters( s_filter_l, s_filter_h,
-    lowshift, highshift, params ),
-    "Unable to get synthesis filters" );  
-  
-  /* Reconstruction of levels */
-  
-  TePDIMatrix< double > rec_result;
-  
-  {
-    TePDIMatrix< double > temp_llsb;
-    
-    unsigned int llsblines;
-    unsigned int llsbcols;
-    
-    TePDIPIManager progress( "Recomposing levels...", ref_level,
-      progress_enabled_ );
-    
-    for( unsigned int level = ref_level ; level != 0 ; --level ) {
-      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
-    
-      if( level == 1 ) {
-        if( pyramid_[ 0 ]( 0, 0 ).IsEmpty() ) {
-          llsblines = ( ( pyramid_[ 1 ]( 0, 0 ).GetLines() - 1 ) * 2 ) + 1;
-          llsbcols = ( ( pyramid_[ 1 ]( 0, 0 ).GetColumns() - 1 ) * 2 ) + 1;
-        } else {
-          llsblines = pyramid_[ 0 ]( 0, 0 ).GetLines();
-          llsbcols = pyramid_[ 0 ]( 0, 0 ).GetColumns();
-        }
-      } else {
-        llsblines = pyramid_[ level - 1 ]( 0, 1 ).GetLines();
-        llsbcols = pyramid_[ level - 1 ]( 0, 1 ).GetColumns();
-      }
-      
-      TEAGN_TRUE_OR_RETURN( temp_llsb.Reset( llsblines, llsbcols,
-        TePDIMatrix<double>::AutoMemPol ),
-        "Unable to allocate memory for low-low sub-band reconstruction "
-        "at level " + Te2String( level ) );    
-      
-      if( level == ref_level ) {
-        TEAGN_TRUE_OR_RETURN( ReconstructLL( pyramid_[ level ]( 0, 0 ), 
-          pyramid_[ level ]( 0, 1 ), pyramid_[ level ]( 1, 0 ),
-          pyramid_[ level ]( 1, 1 ), s_filter_l, 
-          s_filter_h, lowshift, highshift, temp_llsb ),
-          "Low-Low sub-band reconstruction error at level "
-          + Te2String( level ) );
-      } else {
-        TEAGN_TRUE_OR_RETURN( ReconstructLL( rec_result, 
-          pyramid_[ level ]( 0, 1 ), pyramid_[ level ]( 1, 0 ),
-          pyramid_[ level ]( 1, 1 ), s_filter_l, 
-          s_filter_h, lowshift, highshift, temp_llsb ),
-          "Low-Low sub-band reconstruction error at level "
-          + Te2String( level ) ); 
-      }
-      
-      rec_result = temp_llsb;
-    }
-    
-    progress.Toggle( false );
-  }
-  
-  /* Retriving output raster reference from parameters */
-  
-  TePDITypes::TePDIRasterPtrType output_image;
-  params.GetParameter( "output_image", output_image );
-    
-  /* Updating output raster geo parameters if available */
-  
-  if( input_image.isActive() ) {
-    TeRasterParams output_image_params = output_image->params();
-    
-    output_image_params.nBands( 1 );
-    
-    if( input_image->projection() != 0 ) {
-      TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-        input_image->projection()->params() ) );    
-      output_image_params.projection( proj.nakedPointer() );
-    }    
-    
-    output_image_params.boxResolution( input_image->params().box().x1(), 
-      input_image->params().box().y1(), input_image->params().box().x2(), 
-      input_image->params().box().y2(), 
-      input_image->params().resx_, input_image->params().resy_ );    
-    
-    TEAGN_TRUE_OR_RETURN( output_image->init( output_image_params ),
-      "Output raster reset error" );
-  } else {
-    TeRasterParams output_image_params = output_image->params();
-    
-    output_image_params.nBands( 1 );
-    
-    output_image_params.setNLinesNColumns( rec_result.GetLines(),
-      rec_result.GetColumns() );
-    
-    TEAGN_TRUE_OR_RETURN( output_image->init( output_image_params ),
-      "Output raster reset error" );  
-  }
-    
-  double channel_min_level = 0;
-  double channel_max_level = 0;
-  
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-    output_image, 0, channel_min_level,
-    channel_max_level ), "Unable to get output raster channel level bounds" );    
- 
-  unsigned int line, column;
-  double value;
-  
-  for( line = 0 ; line < rec_result.GetLines() ; ++line ) {
-    for( column = 0 ; column < rec_result.GetColumns() ; ++column ) {
-      value = rec_result( line, column );
-      
-      if( shift_histogram_flag_ ) {
-        value += input_image_mean_;
-      }
-      
-      /* Level range filtering */
-
-      if( value < channel_min_level ) {
-        value = channel_min_level;
-      } else if( value > channel_max_level ) {
-        value = channel_max_level;
-      }  
-            
-      TEAGN_TRUE_OR_RETURN( 
-        output_image->setElement( column, line, value, 0 ),
-        "Unable to set output raster element" );
-    }
-  }  
-  
-  return true;
-}
-
-
-bool TePDIMallatWavelets::GetSubBand( unsigned int level, 
-  unsigned int subband, 
-  const TePDITypes::TePDIRasterPtrType& sb_raster ) const
-{
-  TEAGN_TRUE_OR_RETURN( pyramid_.size() > level, 
-    "Invalid level number" );
-  TEAGN_TRUE_OR_RETURN( sb_raster.isActive(), 
-    "Inactive sub-band raster" );
-    
-    
-  TePDIMatrix< double >* sb_ptr = 0;
-    
-  switch( subband ) {
-    case 0 :
-    {
-      sb_ptr = &( pyramid_[ level ]( 0 , 0 ) );
-      break;
-    }
-    case 1 :
-    {
-      sb_ptr = &( pyramid_[ level ]( 0 , 1 ) );
-      break;
-    }
-    case 2 :
-    {
-      sb_ptr = &( pyramid_[ level ]( 1 , 0 ) );
-      break;
-    }
-    case 3 :
-    {
-      sb_ptr = &( pyramid_[ level ]( 1 , 1 ) );
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_RETURN( "Invalid subband" );
-    }
-  }
-  
-  unsigned int lines = sb_ptr->GetLines();
-  unsigned int columns = sb_ptr->GetColumns();
-      
-  TeRasterParams sb_raster_params = sb_raster->params();
-  sb_raster_params.setDataType( TeDOUBLE, -1 );
-  sb_raster_params.nBands( 1 );
-  sb_raster_params.setNLinesNColumns( lines, columns );
-  TEAGN_TRUE_OR_RETURN( sb_raster->init( sb_raster_params ),
-    "Unable to reset sb_raster" );   
-        
-  unsigned int line;
-  unsigned int col;
-      
-  for( line = 0; line < lines ; ++line ) {
-    for( col = 0; col < columns ; ++col ) {
-      TEAGN_TRUE_OR_RETURN( sb_raster->setElement( col, line,
-        (*sb_ptr)( line, col ), 0 ),
-        "Unable to copy pixel value into low-low output raster" );
-    }
-  }    
-  
-  return true;
-}
-
-
-bool TePDIMallatWavelets::ChangeSubBand( 
-  unsigned int level, unsigned int subband_index,
-  const TePDITypes::TePDIRasterPtrType& newsband )
-{
-  TEAGN_TRUE_OR_RETURN( pyramid_.size() > level, "Invalid level number" );
-  TEAGN_TRUE_OR_RETURN( newsband.isActive(), 
-    "The new sub-band is inactive" );
-    
-  TePDIMatrix< double >* target_sb = 0;
-    
-  switch( subband_index ) {
-    case 0 :
-    {
-      target_sb = &( pyramid_[ level ]( 0, 0 ) );
-      
-      break;
-    }
-    case 1 :
-    {
-      target_sb = &( pyramid_[ level ]( 0, 1 ) );
-      
-      break;
-
-    }
-    case 2 :
-    {
-      target_sb = &( pyramid_[ level ]( 1, 0 ) );
-      
-      break;
-
-    }
-    case 3 :
-    {
-      target_sb = &( pyramid_[ level ]( 1, 1 ) );
-      
-      break;
-
-    }
-    default :
-    {
-      TEAGN_LOG_AND_RETURN( "Invalid subband" );
-    }
-  }
-  
-  const int sblines = (int)target_sb->GetLines();
-  const int sbcols = (int)target_sb->GetColumns();
-  const int raster_lines = newsband->params().nlines_;
-  const int raster_cols = newsband->params().ncols_;  
-  
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( sblines == raster_lines ) && ( sbcols == raster_cols ) ),
-    "Incompatible sub-band dimensions" );  
-  
-  int line;
-  int col;
-      
-  for( line = 0; line < sblines ; ++line ) {
-    for( col = 0; col < sbcols ; ++col ) {
-      if( ( line < raster_lines ) && ( col < raster_cols ) ) {
-        TEAGN_TRUE_OR_RETURN( newsband->getElement( col, line,
-          (*target_sb)( line, col ), 0 ),
-          "Unable to copy pixel value from input raster" );
-      } else {
-        (*target_sb)( line, col ) = 0;
-      }
-    }
-  }    
-  
-  return true;
-}
-
-
-bool TePDIMallatWavelets::GenerateLevel( unsigned int level,
-  const TePDIParameters& params )
-{
-  TEAGN_TRUE_OR_RETURN( level > 0, "Invalid level" );
-  TEAGN_TRUE_OR_RETURN( pyramid_.size() >= level, 
-    "Not enought generated levels to generate the new required level" );
-    
-  const unsigned int subblines = ( unsigned int )
-    ceil( ( (double)pyramid_[ level - 1 ]( 0 , 0 ).GetLines() ) / 2 );
-  const unsigned int subbcolumns = ( unsigned int )
-    ceil( ( (double)pyramid_[ level - 1 ]( 0, 0 ).GetColumns() ) / 2 );
-
-  /* Deleting all higher levels */
-     
-  while( pyramid_.size() > ( level + 1 ) ) {
-    pyramid_.pop_back();
-  }
-  
-  /* Allocating space for the new level, if it doesn't exists */
-  
-  TEAGN_TRUE_OR_RETURN( AllocateTopLevel( level, subblines, subbcolumns ),
-    "Unable to allocate memory for the new level" );
-    
-  /* Retriving the analysis filters */
-  
-  std::vector< double > a_filter_l;
-  std::vector< double > a_filter_h;
-  int lowshift = 0;
-  int highshift = 0;
-  
-  TEAGN_TRUE_OR_RETURN( GetAnalysisFilters( a_filter_l, a_filter_h,
-     lowshift, highshift, params ), "Unable to retrive analysis filters" );
-  
-  /* Applying filters */
-  
-  TePDIMatrix< double > temp_sb;
-  TEAGN_TRUE_OR_RETURN( 
-    temp_sb.Reset( pyramid_[ level - 1 ]( 0 , 0 ).GetLines(), subbcolumns,
-    TePDIMatrix<double>::AutoMemPol ),
-    "Unable to create temporary sub-band" );
-    
-  TePDIPIManager progress( "Generating sub-bands for level " + 
-    Te2String( level ), 8, progress_enabled_ );
-    
-  ApplyHorizontalFilter( 
-    pyramid_[ level - 1 ]( 0, 0 ), a_filter_l, lowshift, temp_sb );
-  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
-  ApplyVerticalFilter( 
-    temp_sb, a_filter_l, lowshift, pyramid_[ level ]( 0, 0 ) );
-  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
-    
-  ApplyHorizontalFilter( 
-    pyramid_[ level - 1 ]( 0, 0 ), a_filter_l, lowshift, temp_sb );
-  progress.Increment();
-  ApplyVerticalFilter( 
-    temp_sb, a_filter_h, highshift, pyramid_[ level ]( 0, 1 ) );
-  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
-      
-  ApplyHorizontalFilter( 
-    pyramid_[ level - 1 ]( 0, 0 ), a_filter_h, highshift, temp_sb );
-  progress.Increment();
-  ApplyVerticalFilter( 
-    temp_sb, a_filter_l, lowshift, pyramid_[ level ]( 1, 0 ) );
-  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
-
-  ApplyHorizontalFilter( 
-    pyramid_[ level - 1 ]( 0, 0 ), a_filter_h, highshift, temp_sb );
-  progress.Increment();
-  ApplyVerticalFilter( 
-    temp_sb, a_filter_h, highshift, pyramid_[ level ]( 1, 1 ) );
-  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
-    
-  progress.Toggle( false );
-  
-  return true;
-}
-
-
-void TePDIMallatWavelets::ApplyVerticalFilter( 
-  const TePDIMatrix< double >& inMatrix, 
-  const std::vector< double >& filter,
-  int filter_shift,
-  TePDIMatrix< double >& outMatrix ) const
-{
-  TEAGN_TRUE_OR_THROW( inMatrix.GetLines() > outMatrix.GetLines(),
-    "inMatrix lines number must be greater than outMatrix lines number" );
-  TEAGN_TRUE_OR_THROW( inMatrix.GetColumns() == outMatrix.GetColumns(),
-    "inMatrix columns != outMatrix columns" );
-  TEAGN_TRUE_OR_THROW( inMatrix.GetLines() > filter.size(),
-    "inMatrix lines < filter size" );
-    
-  const unsigned int filter_size = filter.size();
-  const unsigned int makeeven = filter_shift % 2;
-  const unsigned int in_lines = inMatrix.GetLines();
-  const unsigned int in_columns = inMatrix.GetColumns();
-  const unsigned int vitual_in_lines_start = 
-    ( filter_size - 1 );/* The index where start the apply of
-    filter index 0 */
-  const unsigned int vitual_in_lines_bound = 
-    in_lines + vitual_in_lines_start;
-  
-  unsigned int virtual_in_line;
-  unsigned int in_column;
-  unsigned filter_index;
-  double out_level;
-  
-  for( in_column = 0 ; in_column < in_columns ; ++in_column ) {
-       
-    for( virtual_in_line = vitual_in_lines_start + makeeven; 
-         virtual_in_line < vitual_in_lines_bound ; 
-         virtual_in_line += 2 ) {
-         
-      out_level = 0;  
-    
-      for( filter_index = 0 ; filter_index < filter_size ; ++filter_index ) {
-        
-        out_level +=
-          inMatrix( ( virtual_in_line - filter_index ) % in_lines, 
-          in_column ) * filter[ filter_index ];
-      }
-      
-      outMatrix( ( ( virtual_in_line - vitual_in_lines_start + 
-        filter_shift ) % in_lines ) / 2, in_column ) = out_level;
-    }
-  }
-}
-
-
-void TePDIMallatWavelets::ApplyHorizontalFilter( 
-  const TePDIMatrix< double >& inMatrix,
-  const std::vector< double >& filter,
-  int filter_shift,
-  TePDIMatrix< double >& outMatrix ) const
-{
-  TEAGN_TRUE_OR_THROW( inMatrix.GetColumns() > outMatrix.GetColumns(),
-    "inMatrix columns  < outMatrix columns" );
-  TEAGN_TRUE_OR_THROW( inMatrix.GetLines() == outMatrix.GetLines(),
-    "inMatrix lines != outMatrix lines" );
-  TEAGN_TRUE_OR_THROW( inMatrix.GetColumns() > filter.size(),
-    "inMatrix columns < filter size" );
-    
-  const unsigned int filter_size = filter.size();
-  const unsigned int makeeven = filter_shift % 2;
-  const unsigned int in_lines = inMatrix.GetLines();
-  const unsigned int in_columns = inMatrix.GetColumns();
-  const unsigned int virtual_in_column_start = 
-    ( filter_size - 1 ) ;/* The index where start the apply of
-    filter index 0 */
-  const unsigned int virtual_in_columns_bound = 
-    in_columns + virtual_in_column_start;
-
-  unsigned virtual_in_column;  
-  unsigned int in_line;
-  unsigned int filter_index;
-  double out_level;
-  
-  for( in_line = 0 ; in_line < in_lines ; ++in_line ) {
-       
-    for( virtual_in_column = virtual_in_column_start + makeeven; 
-         virtual_in_column < virtual_in_columns_bound ; 
-         virtual_in_column += 2 ) {
-         
-      out_level = 0;  
-    
-      for( filter_index = 0 ; filter_index < filter_size ; ++filter_index ) {
-        
-        out_level += 
-          inMatrix( in_line, ( virtual_in_column -  
-            filter_index ) % in_columns ) * filter[ filter_index ];
-      }
-      
-      outMatrix( in_line, 
-        ( ( virtual_in_column - virtual_in_column_start + 
-        filter_shift ) % in_columns ) / 2 ) = out_level;
-    }
-  }
-}
-
-
-bool TePDIMallatWavelets::BuildSuperimposedLevel( unsigned int level,
-  TePDIMatrix< double >& level_matrix, bool normalize, double min_norm_level, 
-  double max_norm_level ) const
-{
-  TEAGN_TRUE_OR_RETURN( ( ! level_matrix.IsEmpty() ), 
-    "level_matrix is empty" );
-  TEAGN_TRUE_OR_RETURN( ( level > 0 ) && ( level < pyramid_.size() ),
-    "Invalid level" );
-    
-  if( level == ( pyramid_.size() - 1 ) ) {
-    if( normalize ) {
-      TePDIMatrix< double > sb00( pyramid_[ level ]( 0, 0 ).GetLines(),
-        pyramid_[ level ]( 0, 0 ).GetColumns() );
-      TePDIMatrix< double > sb01( pyramid_[ level ]( 0, 1 ).GetLines(),
-        pyramid_[ level ]( 0, 1 ).GetColumns() );
-      TePDIMatrix< double > sb10( pyramid_[ level ]( 1, 0 ).GetLines(),
-        pyramid_[ level ]( 1, 0 ).GetColumns() );
-      TePDIMatrix< double > sb11( pyramid_[ level ]( 1, 1 ).GetLines(),
-        pyramid_[ level ]( 1, 1 ).GetColumns() );
-      
-      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
-        pyramid_[ level ]( 0, 0 ), sb00,
-        min_norm_level, max_norm_level ), "Matrix normalization error" );
-      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
-        pyramid_[ level ]( 0, 1 ), sb01,
-        min_norm_level, max_norm_level ), "Matrix normalization error" );
-      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
-        pyramid_[ level ]( 1, 0 ), sb10,
-        min_norm_level, max_norm_level ), "Matrix normalization error" );
-      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
-        pyramid_[ level ]( 1, 1 ), sb11,
-        min_norm_level, max_norm_level ), "Matrix normalization error" );
-      
-      TEAGN_TRUE_OR_RETURN( AgregateSubBands( sb00, sb01, sb10, sb11,
-        level_matrix ), "Unable to agregate sub-bands at level " +
-        Te2String( level ) );
-    } else {
-      TEAGN_TRUE_OR_RETURN( AgregateSubBands( pyramid_[ level ]( 0, 0 ),
-        pyramid_[ level ]( 0, 1 ), pyramid_[ level ]( 1, 0 ),
-        pyramid_[ level ]( 1, 1 ), level_matrix ), 
-        "Unable to agregate sub-bands at level " +
-        Te2String( level ) );    
-    };
-      
-    return true;
-  } else {
-    TePDIMatrix< double > sb00;
-    TEAGN_TRUE_OR_RETURN( sb00.Reset( pyramid_[ level ]( 0, 1 ).GetLines(),
-      pyramid_[ level ]( 0, 1 ).GetColumns(), 
-      TePDIMatrix<double>::AutoMemPol ),
-      "Unable to allocate memory for sub-band [0,0] at level " +
-      Te2String( level ) );
-    
-    TEAGN_TRUE_OR_RETURN( BuildSuperimposedLevel( level + 1, sb00, normalize,
-      min_norm_level, max_norm_level ),
-      "Unable to build superimposed level " +
-      Te2String( level ) );
-      
-    if( normalize ) {
-      TePDIMatrix< double > sb01( pyramid_[ level ]( 0, 1 ).GetLines(),
-        pyramid_[ level ]( 0, 1 ).GetColumns() );
-      TePDIMatrix< double > sb10( pyramid_[ level ]( 1, 0 ).GetLines(),
-        pyramid_[ level ]( 1, 0 ).GetColumns() );
-      TePDIMatrix< double > sb11( pyramid_[ level ]( 1, 1 ).GetLines(),
-        pyramid_[ level ]( 1, 1 ).GetColumns() );
-      
-      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
-        pyramid_[ level ]( 0, 1 ), sb01,
-        min_norm_level, max_norm_level ), "Matrix normalization error" );
-      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
-        pyramid_[ level ]( 1, 0 ), sb10,
-        min_norm_level, max_norm_level ), "Matrix normalization error" );
-      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
-        pyramid_[ level ]( 1, 1 ), sb11,
-        min_norm_level, max_norm_level ), "Matrix normalization error" );      
-      
-      TEAGN_TRUE_OR_RETURN( AgregateSubBands( sb00, sb01, sb10, sb11,
-        level_matrix ), "Unable to agregate sub-bands at level " +
-        Te2String( level ) );
-    } else {
-      TEAGN_TRUE_OR_RETURN( AgregateSubBands( sb00, pyramid_[ level ]( 0, 1 ),
-        pyramid_[ level ]( 1, 0 ), pyramid_[ level ]( 1, 1 ), level_matrix ),
-        "Unable to agregate sub-bands at level " +
-        Te2String( level ) );      
-    }  
-      
-    return true;
-  }
-}
-
-
-bool TePDIMallatWavelets::AgregateSubBands(
-  const TePDIMatrix< double >& upper_left,
-  const TePDIMatrix< double >& upper_right,
-  const TePDIMatrix< double >& lower_left,
-  const TePDIMatrix< double >& lower_right,
-  TePDIMatrix< double >& result ) const
-{
-  TEAGN_TRUE_OR_RETURN( 
-    ( ! result.IsEmpty() ), "result matrix is empty" );
-
-  TEAGN_CHECK_EPS( upper_left.GetColumns(), lower_left.GetColumns(), 0,
-    "Size mismatch" );
-  TEAGN_CHECK_EPS( upper_right.GetColumns(), lower_right.GetColumns(), 0,
-    "Size mismatch" );
-  TEAGN_CHECK_EPS( upper_left.GetLines(), upper_right.GetLines(), 0,
-    "Size mismatch" );
-  TEAGN_CHECK_EPS( lower_left.GetLines(), lower_right.GetLines(), 0,
-    "Size mismatch" );
-    
-  unsigned int line = 0;
-  unsigned int column = 0;
-  const unsigned int lines_offset = upper_left.GetLines();
-  const unsigned int columns_offset = upper_left.GetColumns();
-  unsigned int lines_bound = 0;
-  unsigned int columns_bound = 0;
-  
-  /* Copying the upper_left sub-band */
-
-  lines_bound = 
-    MIN( result.GetLines(), upper_left.GetLines() );
-  columns_bound = 
-    MIN( result.GetColumns(), upper_left.GetColumns() );
-  
-  for( line = 0 ; line < lines_bound ; ++line ) {
-    for( column = 0 ; column < columns_bound ; ++column ) {
-      result( line, column ) = upper_left( line, column );
-    }
-  }
-  
-  /* Copying the upper_right sub-band */
-    
-  if( columns_offset < result.GetColumns() ) {
-    lines_bound = MIN( result.GetLines(), upper_right.GetLines() );
-    columns_bound = MIN( result.GetColumns() - columns_offset, 
-        upper_right.GetColumns() );  
-    
-    for( line = 0 ; line < lines_bound ; ++line ) {
-      for( column = 0 ; column < columns_bound ; ++column ) {
-        result( line, column + columns_offset ) = 
-          upper_right( line, column );
-      }
-    }
-  }
-  
-  /* Copying the lower_left sub-band */
-  
-  if( lines_offset < result.GetLines() ) {
-    lines_bound = 
-      MIN( result.GetLines() - lines_offset, 
-      lower_left.GetLines() );
-    columns_bound =
-      MIN( result.GetColumns(), lower_left.GetColumns() );   
-    
-    for( line = 0 ; line < lines_bound ; ++line ) {
-      for( column = 0 ; column < columns_bound ; ++column ) {
-        result( line + lines_offset, column ) = 
-          lower_left( line, column );
-      }
-    }
-  }
-  
-  /* Copying the lower_right sub-band */
-    
-  if( ( lines_offset < result.GetLines() ) &&
-      ( columns_offset < result.GetColumns() ) ) {
-  
-    lines_bound = MIN( 
-      result.GetLines() - lines_offset, lower_right.GetLines() );
-    columns_bound = MIN( 
-      result.GetColumns() - columns_offset, lower_right.GetColumns() );    
-    
-    for( line = 0 ; line < lines_bound ; ++line ) {
-      for( column = 0 ; column < columns_bound ; ++column ) {
-        result( line + lines_offset, column + columns_offset ) = 
-          lower_right( line, column );
-      }
-    }
-  }
-  
-  return true;          
-}
-
-
-bool TePDIMallatWavelets::PushLevel( unsigned int level, 
-  const TePDIMatrix< double >& sb0, const TePDIMatrix< double >& sb1, 
-  const TePDIMatrix< double >& sb2, const TePDIMatrix< double >& sb3 )
-{
-  TEAGN_TRUE_OR_RETURN( level > 0, "Invalid level" );
-  
-  TEAGN_TRUE_OR_RETURN( 
-    ( sb0.GetLines() == sb1.GetLines() ) &&
-    ( sb1.GetLines() == sb2.GetLines() ) &&
-    ( sb2.GetLines() == sb3.GetLines() ) &&
-    ( sb0.GetColumns() == sb1.GetColumns() ) &&
-    ( sb1.GetColumns() == sb2.GetColumns() ) &&
-    ( sb2.GetColumns() == sb3.GetColumns() ),
-    "All sub-bands must have the same dimensions" );
-    
-  TEAGN_TRUE_OR_RETURN( AllocateTopLevel( level, sb0.GetLines(), 
-    sb0.GetColumns() ), "Unable to allocate memory for the new level" );
-  
-  pyramid_[ level ]( 0, 0 ) = sb0;
-  pyramid_[ level ]( 0, 1 ) = sb1;
-  pyramid_[ level ]( 1, 0 ) = sb2;
-  pyramid_[ level ]( 1, 1 ) = sb3;
-  
-  return true;
-}
-
-
-bool TePDIMallatWavelets::AllocateTopLevel( unsigned int level, 
-  unsigned int sblines, unsigned int sbcolumns )
-{
-  /* Checking if the required levels already exists */
-
-  if( pyramid_.size() > 1 ) {
-    TEAGN_TRUE_OR_RETURN( 
-      ( ( level == pyramid_.size() ) || ( ( level + 1 ) == pyramid_.size() ) ),
-      "Invalid level" );
-  
-    if( ( level + 1 ) == pyramid_.size() ) {
-      if( ( pyramid_[ level ]( 0, 0 ).GetLines() == sblines ) &&
-        ( pyramid_[ level ]( 0, 0 ).GetColumns() == sbcolumns ) ) {
-        
-        return true;
-      }
-    }
-  } else {
-    TEAGN_TRUE_OR_RETURN( level == 1, "Invalid level" );
-  }
-  
-  /* Creating a dummy level 0 if necessary */
-  
-  if( pyramid_.size() == 0 ) {
-    TePDIMatrix<double> subband0;
-  
-    TePDIMatrix< TePDIMatrix< double > > levelzeromatrix( 1, 1 ); 
-    levelzeromatrix( 0, 0 ) = subband0;
-  
-    pyramid_.push_back( levelzeromatrix );  
-  }
-  
-  /* Checking if the supplied level dimensions are correct */
-  
-  if( level > 1 ) {
-    sblines = ( unsigned int )
-      ceil( ( (double)pyramid_[ level - 1 ]( 0 , 0 ).GetLines() ) / 2 );
-    sbcolumns = ( unsigned int )
-      ceil( ( (double)pyramid_[ level - 1 ]( 0, 0 ).GetColumns() ) / 2 );           
-  } else {
-    TEAGN_TRUE_OR_RETURN( ( sblines > 0 ) && ( sbcolumns > 0 ),
-      "Number of lines and number of columns must not be zero" );
-  }
-  
-  /* Allocating the new level */
-      
-  TePDIMatrix< TePDIMatrix< double > > newlevel;
-  pyramid_.push_back( newlevel );
-  
-  if( ! pyramid_[ level ].Reset( 2, 2 ) ) {
-    pyramid_.pop_back();
-    TEAGN_LOG_AND_RETURN( 
-      "Unable to create level " + Te2String( level ) );
-  }
-  
-  /* Allocating the new sub-bands for the new level */
-  
-  TePDIMatrix< double > tempsb;
-  
-  pyramid_[ level ]( 0, 0 ) = tempsb;
-  pyramid_[ level ]( 0, 1 ) = tempsb;
-  pyramid_[ level ]( 1, 0 ) = tempsb;
-  pyramid_[ level ]( 1, 1 ) = tempsb;
-  
-    
-  if( pyramid_[ level ]( 0, 0 ).Reset( sblines, sbcolumns, 
-    TePDIMatrix<double>::AutoMemPol ) &&
-    pyramid_[ level ]( 0, 1 ).Reset( sblines, sbcolumns, 
-    TePDIMatrix<double>::AutoMemPol ) &&
-    pyramid_[ level ]( 1, 0 ).Reset( sblines, sbcolumns,
-    TePDIMatrix<double>::AutoMemPol ) &&
-    pyramid_[ level ]( 1, 1 ).Reset( sblines, sbcolumns,
-    TePDIMatrix<double>::AutoMemPol ) ) {
-    
-    /* Fill the new level with 0's */
-    {
-      TePDIMatrix< double >& sb00_ref = pyramid_[ level ]( 0, 0 );
-      TePDIMatrix< double >& sb01_ref = pyramid_[ level ]( 0, 1 );
-      TePDIMatrix< double >& sb10_ref = pyramid_[ level ]( 1, 0 );
-      TePDIMatrix< double >& sb11_ref = pyramid_[ level ]( 1, 1 );
-    
-      unsigned int line;
-      unsigned int col;
-      
-      for( line = 0 ; line < sblines ; ++line ) {
-        for( col = 0 ; col < sbcolumns ; ++col ) {
-          sb00_ref( line, col ) = 0;
-          sb01_ref( line, col ) = 0;
-          sb10_ref( line, col ) = 0;
-          sb11_ref( line, col ) = 0;
-        }
-      }
-    }
-    
-    return true;    
-  } else {
-    pyramid_.pop_back();
-    TEAGN_LOG_AND_RETURN( "Unable to allocate all sub-bands into pyramid" );
-  }
-}
-
-
-bool TePDIMallatWavelets::GetAFiltersShift( 
-  const std::vector< double >& a_lowfilter,
-  const std::vector< double >& a_highfilter,
-  int& lowshift, int& highshift ) const
-{
-  const unsigned int fsizel = a_lowfilter.size();
-  const unsigned int fsizeh = a_highfilter.size();
-  
-  TEAGN_TRUE_OR_RETURN( fsizel > 1, "Low Filter size < 2" );
-  TEAGN_TRUE_OR_RETURN( fsizeh > 1, "High Filter size < 2" );
-  
-  lowshift = ( fsizel - 1 ) / 2;
-  highshift = ( fsizeh - 1 ) / 2;
-  
-  if( lowshift <= highshift ) {
-    highshift = lowshift;
-  } 
-    
-  if( lowshift == 0 ) lowshift = 1;
-  if( highshift == 0 ) highshift = 1;
-  
-  /* This is for odd symstric filters with different lenghts */
-  
-  if( ( ( lowshift % 2 ) != 0 ) && ( ( highshift % 2 ) == 0 ) ) {
-    --lowshift;
-  }
-  
-  if( ( ( lowshift % 2 ) == 0 ) && ( ( highshift % 2 ) != 0 ) ) {
-    --highshift;
-  }
-  
-  /* This is for non-symmetrical filters */
-  
-  if( ( a_lowfilter[ 0 ] != a_lowfilter[ fsizel - 1 ] ) && 
-    ( ( fsizel % 2 ) == 0 ) ) {
-    
-    /* updating the lowshift with the index of the higher absolute value 
-       inside the low filter */
-       
-    bool hindex_found = false;
-    double lowf_hav = 0; /* higher absolute value inside low filter */
-    
-    for( unsigned int lindex = 0 ; lindex < fsizel ; ++lindex ) {
-      if( hindex_found ) {
-        if( ABS( a_lowfilter[ lindex ] ) > lowf_hav ) {
-          lowf_hav = ABS( a_lowfilter[ lindex ] );
-          lowshift = lindex;
-        }
-      } else {
-        hindex_found = true;
-        lowf_hav = ABS( a_lowfilter[ lindex ] );
-        lowshift = lindex;
-      }
-    }
-    
-    lowshift = fsizel - lowshift - 1;
-    highshift = fsizel - lowshift - 1;
-    
-    if( ( lowshift % 2 ) != ( highshift % 2 ) ) {
-      ++highshift;
-    }
-  }
-  
-  return true;
-}
-
-
-bool TePDIMallatWavelets::GetSFiltersShift( 
-  const std::vector< double >& a_lowfilter,
-  const std::vector< double >& a_highfilter,
-  const std::vector< double >& s_lowfilter,
-  const std::vector< double >& s_highfilter,
-  int& lowshift, int& highshift ) const
-{
-  const unsigned int afsizel = a_lowfilter.size();
-  const unsigned int afsizeh = a_highfilter.size();
-  const unsigned int sfsizel = s_lowfilter.size();
-  const unsigned int sfsizeh = s_highfilter.size();
-  
-  TEAGN_TRUE_OR_RETURN( afsizel > 1, "Analysis Low Filter size < 2" );
-  TEAGN_TRUE_OR_RETURN( afsizeh > 1, "Analysis High Filter size < 2" );
-  TEAGN_TRUE_OR_RETURN( sfsizel > 1, "Syntesis Low Filter size < 2" );
-  TEAGN_TRUE_OR_RETURN( sfsizeh > 1, "Syntesis High Filter size < 2" );
-  
-  lowshift = ( sfsizel - 1 ) / 2;
-  highshift = ( sfsizeh - 1 ) / 2;
-    
-  if( lowshift == 0 ) lowshift = 1;
-  if( highshift == 0 ) highshift = 1;
-  
-  /* This is for odd symstric filters with different lenghts */
-  
-  if( ( ( lowshift % 2 ) != 0 ) && ( ( highshift % 2 ) == 0 ) ) {
-    ++highshift;
-  }
-  
-  if( ( ( lowshift % 2 ) == 0 ) && ( ( highshift % 2 ) != 0 ) ) {
-    ++lowshift;
-  }
-  
-  /* General case for even lenght filters */
-  
-  if( ( ( afsizel % 2 ) == 0 ) && ( ( afsizeh % 2 ) == 0 ) &&
-      ( ( sfsizel % 2 ) == 0 ) && ( ( sfsizeh % 2 ) == 0 ) ) {
-      
-    ++lowshift;
-    ++highshift;
-  }
-  
-  /* This is for non-symmetrical filters */
-  
-  if( s_lowfilter[ 0 ] != s_lowfilter[ sfsizel - 1 ] ) {
-    
-    /* updating the lowshift with the index of the higher absolute value 
-       inside the low filter */
-    
-    bool hav_found = false;
-    double lowf_hav = 0; /* low filter highest value */
-    
-    for( unsigned int lindex = 0 ; lindex < sfsizel ; ++lindex ) {
-      if( hav_found ) {
-        if( ABS( s_lowfilter[ lindex ] ) > lowf_hav ) {
-          lowf_hav = ABS( s_lowfilter[ lindex ] );
-          lowshift = lindex;
-        }
-      } else {
-        hav_found = true;
-        lowf_hav = ABS( s_lowfilter[ lindex ] );
-        lowshift = lindex;
-      }
-    }
-    
-    lowshift = sfsizel - lowshift - 1;
-    highshift = sfsizel - lowshift - 2;
-    
-    if( ( lowshift % 2 ) != ( highshift % 2 ) ) {
-      --highshift;
-    }
-  }
-  
-  return true;
-}
-
-
-
-bool TePDIMallatWavelets::ReconstructLL( 
-  const TePDIMatrix< double >& sb00_in,
-  const TePDIMatrix< double >& sb01_in,
-  const TePDIMatrix< double >& sb10_in,
-  const TePDIMatrix< double >& sb11_in,
-  const std::vector< double >& s_low_filter,
-  const std::vector< double >& s_high_filter,
-  int lowshift, int highshift,
-  TePDIMatrix< double >& sb00_out ) const
-{
-  TEAGN_TRUE_OR_RETURN( ( ! sb00_out.IsEmpty() ), 
-    "Output sub-band ( 0 , 0 ) is empty" );
-    
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( sb00_in.GetLines() == sb01_in.GetLines() ) && 
-      ( sb01_in.GetLines() == sb10_in.GetLines() ) &&
-      ( sb10_in.GetLines() == sb11_in.GetLines() ) &&
-      ( sb00_in.GetColumns() == sb01_in.GetColumns() ) &&
-      ( sb01_in.GetColumns() == sb10_in.GetColumns() ) &&
-      ( sb10_in.GetColumns() == sb11_in.GetColumns() ) ), 
-    "Dimensions mismatch detected between input sub-bands" );
-    
-  /* Allocating space for temporary sub-bands */    
-    
-  TePDIMatrix< double > tempsb1;
-  TEAGN_TRUE_OR_RETURN( tempsb1.Reset( sb00_out.GetLines(), 
-    sb00_out.GetColumns(), TePDIMatrix<double>::AutoMemPol ), 
-    "Unable to allocate memory for temporary sub-band 1" );
-  
-  TePDIMatrix< double > tempsb2;
-  TEAGN_TRUE_OR_RETURN( tempsb2.Reset( sb00_out.GetLines(), 
-    sb00_out.GetColumns(), TePDIMatrix<double>::AutoMemPol ), 
-    "Unable to allocate memory for temporary sub-band 2" );
-    
-  /* Cleanning output data */
-  
-  for( unsigned int outline = 0 ; outline < sb00_out.GetLines() ; ++outline ) {
-    for( unsigned int outcolumn = 0 ; outcolumn < sb00_out.GetColumns() ; 
-      ++outcolumn ) {
-  
-       sb00_out( outline, outcolumn ) = 0.0;
-    }
-  }
-    
-  /* Processing sub-band [ 0, 0 ] */
-
-  TEAGN_TRUE_OR_RETURN( UpSampleMatrix( sb00_in, tempsb1 ), 
-    "Upsample error" );
-  TEAGN_TRUE_OR_RETURN( ApplyHorizontalRFilter( 
-    tempsb1, s_low_filter, lowshift, tempsb2 ), 
-    "Horizontal filter apply error" );
-  TEAGN_TRUE_OR_RETURN( ApplyVerticalRFilter( 
-    tempsb2, s_low_filter, lowshift, tempsb1 ), 
-    "Vertical filter apply error" );    
-  TEAGN_TRUE_OR_RETURN( AddMatrixes( tempsb1, sb00_out, sb00_out ), 
-    "Addition error" );    
-
-  /* Processing sub-band [ 0, 1 ] */
-
-  TEAGN_TRUE_OR_RETURN( UpSampleMatrix( sb01_in, tempsb1 ), 
-    "Upsample error" );
-  TEAGN_TRUE_OR_RETURN( ApplyHorizontalRFilter( 
-    tempsb1, s_low_filter, lowshift, tempsb2 ), 
-    "Horizontal filter apply error" );
-  TEAGN_TRUE_OR_RETURN( ApplyVerticalRFilter( 
-    tempsb2, s_high_filter, highshift, tempsb1 ), 
-    "Vertical filter apply error" );    
-  TEAGN_TRUE_OR_RETURN( AddMatrixes( tempsb1, sb00_out, sb00_out ), 
-    "Addition error" );    
-
-  /* Processing sub-band [ 1, 0 ] */
-
-  TEAGN_TRUE_OR_RETURN( UpSampleMatrix( sb10_in, tempsb1 ), 
-    "Upsample error" );
-  TEAGN_TRUE_OR_RETURN( ApplyHorizontalRFilter( 
-    tempsb1, s_high_filter, highshift, tempsb2 ), 
-    "Horizontal filter apply error" );
-  TEAGN_TRUE_OR_RETURN( ApplyVerticalRFilter( 
-    tempsb2, s_low_filter, lowshift, tempsb1 ), 
-    "Vertical filter apply error" );    
-  TEAGN_TRUE_OR_RETURN( AddMatrixes( tempsb1, sb00_out, sb00_out ), 
-    "Addition error" );      
-
-  /* Processing sub-band [ 1, 1 ] */
-
-  TEAGN_TRUE_OR_RETURN( UpSampleMatrix( sb11_in, tempsb1 ), 
-    "Upsample error" );
-  TEAGN_TRUE_OR_RETURN( ApplyHorizontalRFilter( 
-    tempsb1, s_high_filter, highshift, tempsb2 ), 
-    "Horizontal filter apply error" );
-  TEAGN_TRUE_OR_RETURN( ApplyVerticalRFilter( 
-    tempsb2, s_high_filter, highshift, tempsb1 ), 
-    "Vertical filter apply error" );    
-  TEAGN_TRUE_OR_RETURN( AddMatrixes( tempsb1, sb00_out, sb00_out ), 
-    "Addition error" );
-
-  return true;
-}
-
-
-bool TePDIMallatWavelets::UpSampleMatrix( const TePDIMatrix< double >& in,
-  TePDIMatrix< double >& out ) const
-{
-  TEAGN_TRUE_OR_RETURN( ( ! out.IsEmpty() ), 
-    "Invalid output matrix" );
-    
-  const unsigned int outlines = out.GetLines();
-  const unsigned int outcolumns = out.GetColumns();
-  
-  const unsigned int inlines = in.GetLines();
-  const unsigned int incolumns = in.GetColumns();
-  
-  const unsigned int required_out_lines = ( 2 * ( inlines - 1 ) ) + 1;
-  const unsigned int required_out_columns = ( 2 * ( incolumns - 1 ) ) + 1;
-  
-  TEAGN_TRUE_OR_RETURN( ( outlines >= required_out_lines ), 
-    "Insuficient output lines" );
-  TEAGN_TRUE_OR_RETURN( ( outcolumns >= required_out_columns ), 
-    "Insuficient output columns" );
-    
-  unsigned int line;
-  unsigned int column;
-  
-  /* Cleanning output matrix */
-
-  for( line = 0 ; line < outlines ; ++line ) {
-    for( column = 0 ; column < outcolumns ; ++column ) {
-      out( line, column ) = 0.;
-    }
-  }
-    
-  /* Transfering values to output */
-  
-  for( line = 0 ; line < inlines ; ++line ) {
-    for( column = 0 ; column < incolumns ; ++column ) {
-       out( line * 2, column * 2 ) = in( line, column ) * 4;
-    }
-  }   
-  
-  return true; 
-}
-
-
-bool TePDIMallatWavelets::AddMatrixes( const TePDIMatrix< double >& in1,
-  const TePDIMatrix< double >& in2, TePDIMatrix< double >& res ) const
-{
-  TEAGN_TRUE_OR_RETURN( in1.GetLines() == in2.GetLines(),
-    "in1 lines != in2 lines" );
-  TEAGN_TRUE_OR_RETURN( in1.GetColumns() == in2.GetColumns(),
-    "in1 columns != in2 columns" );
-  
-  TEAGN_TRUE_OR_RETURN( in1.GetLines() == res.GetLines(),
-    "in1 lines != res lines" );
-  TEAGN_TRUE_OR_RETURN( in1.GetColumns() == res.GetColumns(),
-    "in1 columns != res columns" );
-        
-  const unsigned int lines = in1.GetLines();
-  const unsigned int columns = in1.GetColumns();
-  
-  unsigned int line;
-  unsigned int column;
-  
-  for( line = 0 ; line < lines ; ++line ) {
-    for( column = 0 ; column < columns ; ++column ) {
-      res( line, column ) = in1( line, column ) + in2( line, column );
-    }
-  } 
-  
-  return true;   
-}
-
-
-bool TePDIMallatWavelets::ApplyVerticalRFilter( 
-  const TePDIMatrix< double >& inMatrix, 
-  const std::vector< double >& filter,
-  int filter_shift,
-  TePDIMatrix< double >& outMatrix ) const
-{
-  TEAGN_TRUE_OR_RETURN( inMatrix.GetLines() == outMatrix.GetLines(),
-    "inMatrix lines != outMatrix lines" );
-  TEAGN_TRUE_OR_RETURN( inMatrix.GetColumns() == outMatrix.GetColumns(),
-    "inMatrix columns != outMatrix columns" );
-  TEAGN_TRUE_OR_RETURN( inMatrix.GetLines() > filter.size(),
-    "inMatrix lines < filter size" );
-
-  const unsigned int in_lines = inMatrix.GetLines();
-  const unsigned int in_columns = inMatrix.GetColumns();
-  const unsigned int filter_size = filter.size();
-  unsigned int virtual_in_line_start = filter_size - 1;
-  unsigned int virtual_in_lines_bound = in_lines + virtual_in_line_start;  
-  
-  unsigned int virtual_in_line;
-  unsigned int in_column;
-  unsigned int filter_index;
-  double out_level;
-  int ircli; /* input raster convolution line index */
-  
-  for( in_column = 0 ; in_column < in_columns ; ++in_column ) {
-       
-    for( virtual_in_line = virtual_in_line_start ; 
-         virtual_in_line < virtual_in_lines_bound ; 
-         ++virtual_in_line ) {
-    
-      out_level = 0;  
-    
-      for( filter_index = 0 ; filter_index < filter_size ; ++filter_index ) {
-        
-        ircli = ( virtual_in_line - filter_index ) % in_lines;
-        
-        if( ircli % 2 == 0 ) {
-          out_level += 
-            inMatrix( ircli, in_column ) * filter[ filter_index ];
-        }
-      }
-      
-      outMatrix( ( virtual_in_line - virtual_in_line_start + 
-        filter_shift ) % in_lines, in_column ) = out_level;
-    }
-  }
-  
-  return true;
-}
-
-
-bool TePDIMallatWavelets::ApplyHorizontalRFilter( 
-  const TePDIMatrix< double >& inMatrix,
-  const std::vector< double >& filter,
-  int filter_shift,
-  TePDIMatrix< double >& outMatrix ) const
-{
-  TEAGN_TRUE_OR_RETURN( inMatrix.GetColumns() == outMatrix.GetColumns(),
-    "inMatrix columns != outMatrix columns" );
-  TEAGN_TRUE_OR_RETURN( inMatrix.GetLines() == outMatrix.GetLines(),
-    "inMatrix lines != outMatrix lines" );
-  TEAGN_TRUE_OR_RETURN( inMatrix.GetColumns() > filter.size(),
-    "inMatrix columns < filter size" );
-
-  const unsigned int in_lines = inMatrix.GetLines();
-  const unsigned int in_columns = inMatrix.GetColumns();
-  const unsigned int filter_size = filter.size();
-  unsigned int virtual_in_column_start = filter_size - 1;
-  unsigned int virtual_in_columns_bound = in_columns + virtual_in_column_start;
-  
-  unsigned int virtual_in_column;
-  unsigned int in_line;
-  unsigned int filter_index;
-  double out_level;
-  int ircci; /* input raster convolution column index */
-  
-  for( in_line = 0 ; in_line < in_lines ; in_line += 2 ) {
-       
-    for( virtual_in_column = virtual_in_column_start ; 
-         virtual_in_column < virtual_in_columns_bound ; 
-         ++virtual_in_column ) {
-    
-      out_level = 0;  
-    
-      for( filter_index = 0 ; filter_index < filter_size ; ++filter_index ) {
-        
-        ircci = ( virtual_in_column - filter_index ) % in_columns;
-        
-        if( ircci % 2 == 0 ) {
-          out_level += 
-            inMatrix( in_line, ircci ) * filter[ filter_index ];
-        }
-      }
-      
-      outMatrix( in_line, ( virtual_in_column - virtual_in_column_start + 
-        filter_shift ) % in_columns ) = out_level;
-    }
-  }
-  
-  return true;
-}
-
-
-bool TePDIMallatWavelets::GetAnalysisFilters( std::vector< double >& low_filter,
-  std::vector< double >& high_filter, int& low_shift, int& high_shift,
-  const TePDIParameters& params ) const
-{
-  /* Retriving the analysis filters and normalizing */
-  
-  double filters_scale = 0;
-  params.GetParameter( "filters_scale", filters_scale );  
-  
-  params.GetParameter( "a_filter_l", low_filter );
-    
-  params.GetParameter( "a_filter_h", high_filter );
-  
-  double factor = sqrt( 2.0 ) * sqrt( filters_scale );
-  
-  for( unsigned int a_filter_l_i = 0 ; a_filter_l_i < low_filter.size() ;
-       ++a_filter_l_i ) {
-       
-       low_filter[ a_filter_l_i ] *= factor;
-  }
-  
-  for( unsigned int a_filter_h_i = 0 ; a_filter_h_i < high_filter.size() ;
-       ++a_filter_h_i ) {
-       
-       high_filter[ a_filter_h_i ] *= factor;
-  }  
-  
-  /* Calculating filters shift */
-  
-  TEAGN_TRUE_OR_RETURN( GetAFiltersShift( low_filter, high_filter, low_shift, 
-    high_shift ), "Unable to calculate filters shift" );
-    
-  return true;
-}
-
-
-bool TePDIMallatWavelets::GetSynthesisFilters( std::vector< double >& low_filter,
-  std::vector< double >& high_filter, int& low_shift, int& high_shift,
-  const TePDIParameters& params ) const
-{
-  /* Retriving the analysis filters */
-  
-  std::vector< double > a_low_filter;
-  std::vector< double > a_high_filter;
-  int a_low_shift;
-  int a_high_shift;
-  
-  TEAGN_TRUE_OR_RETURN( GetAnalysisFilters( a_low_filter, a_high_filter,
-    a_low_shift, a_high_shift, params ), "Unable to get analysis filters" );
-    
-  /* Retriving the synthesis filters */
-  
-  double filters_scale = 0;
-  params.GetParameter( "filters_scale", filters_scale );  
-  
-  params.GetParameter( "s_filter_l", low_filter );
-    
-  params.GetParameter( "s_filter_h", high_filter );
-  
-  double factor = 1 / ( sqrt( 2.0 ) * sqrt( filters_scale ) );
-  
-  for( unsigned int s_filter_l_i = 0 ; s_filter_l_i < low_filter.size() ;
-       ++s_filter_l_i ) {
-       
-       low_filter[ s_filter_l_i ] *= factor;
-  }
-  
-  for( unsigned int s_filter_h_i = 0 ; s_filter_h_i < high_filter.size() ;
-       ++s_filter_h_i ) {
-       
-       high_filter[ s_filter_h_i ] *= factor;
-  }  
-  
-  /* Calculating filters shift */
-  
-  TEAGN_TRUE_OR_RETURN( GetSFiltersShift( a_low_filter, a_high_filter,
-    low_filter, high_filter, low_shift, high_shift ), 
-    "Unable to calculate filters shift" );
-    
-  return true;
-}
-
-
-bool TePDIMallatWavelets::NormalizeMatrix( 
-    const TePDIMatrix< double >& input, 
-    TePDIMatrix< double >& output, double min, double max ) const
-{
-  TEAGN_TRUE_OR_RETURN( min < max, "Invalid range" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( ( max / 4. ) - ( min / 4. ) ) < ( DBL_MAX / 2. ) ),
-    "min and max are out of allowed range" );
-      
-  TEAGN_TRUE_OR_RETURN( ( input.GetLines() == output.GetLines() ),
-    "input lines != output lines" );
-  TEAGN_TRUE_OR_RETURN( ( input.GetColumns() == output.GetColumns() ),
-    "input columns != output columns" );
-  
-  const unsigned int lines = input.GetLines();
-  const unsigned int columns = input.GetColumns();
-    
-  if( ( lines == 0 ) || ( columns == 0 ) ) {
-    return true;
-  }
-    
-  unsigned int line;
-  unsigned int column;
-  double value;   
-    
-  /* Finding the current min and max */
-  
-  double cmin = input( 0, 0 );
-  double cmax = cmin;
-    
-  for( line = 0 ; line < lines ; ++line ) {
-    for( column = 0 ; column < columns ; ++column ) {
-      value = input( line, column );
-      
-      if( value < cmin ) {
-        cmin = value;
-      }
-      if( value > cmax ) {
-        cmax = value;
-      }
-    }
-  }
-    
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( ( cmax / 4. ) - ( cmin / 4. ) ) < ( DBL_MAX / 2. ) ),
-    "current image min and max are out of allowed range" );
-    
-  double offset = min - cmin;
-  double scale = ( cmax - cmin ) / ( max - min );
-    
-  if( scale == 0 ) return true;
-    
-  /* Remapping values */
-      
-  for( line = 0 ; line < lines ; ++line ) {
-    for( column = 0 ; column < columns ; ++column ) {
-      output( line, column ) = ( input( line, column ) / scale ) + offset;
-    }
-  }
-    
-  return true;
-}  
-
-
-
+#include "TePDIMallatWavelets.hpp"
+
+#include "TePDIUtils.hpp"
+#include "TePDIStrategyFactory.hpp"
+#include "TePDIMathFunctions.hpp"
+#include "TePDIPIManager.hpp"
+
+#include <TeAgnostic.h>
+#include <TeUtils.h>
+#include <TeDefines.h>
+
+#include <math.h>
+#include <float.h>
+
+
+TePDIMallatWavelets::TePDIMallatWavelets()
+{
+  shift_histogram_flag_ = false;
+  input_image_mean_ = 0;
+}
+
+
+TePDIMallatWavelets::~TePDIMallatWavelets()
+{
+}
+
+
+bool TePDIMallatWavelets::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  std::string filter_task;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "filter_task", filter_task ),
+    "Missing parameter: filter_task" );
+    
+  /* Checking filters */
+  
+  std::vector< double > a_filter_l;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "a_filter_l", a_filter_l ),
+    "Missing parameter: a_filter_l" );
+  TEAGN_TRUE_OR_RETURN( a_filter_l.size() > 1, 
+    "Invalid parameter: a_filter_l" );
+    
+  std::vector< double > a_filter_h;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "a_filter_h", a_filter_h ),
+    "Missing parameter: a_filter_h" );
+  TEAGN_TRUE_OR_RETURN( a_filter_h.size() > 1, 
+    "Invalid parameter: a_filter_h" );    
+    
+  std::vector< double > s_filter_l;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "s_filter_l", s_filter_l ),
+    "Missing parameter: s_filter_l" );
+  TEAGN_TRUE_OR_RETURN( s_filter_l.size() > 1, 
+    "Invalid parameter: s_filter_l" );
+    
+  std::vector< double > s_filter_h;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "s_filter_h", s_filter_h ),
+    "Missing parameter: s_filter_h" );
+  TEAGN_TRUE_OR_RETURN( s_filter_h.size() > 1, 
+    "Invalid parameter: s_filter_h" );
+    
+  unsigned int max_filter_size = ( unsigned int )
+    MAX( a_filter_l.size(), MAX( a_filter_h.size(), MAX( s_filter_l.size(), 
+    s_filter_h.size() ) ) );
+    
+  /* Checking filters scale */        
+  
+  double filters_scale = 0;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "filters_scale", filters_scale ),
+    "Missing parameter: filters_scale" );
+  TEAGN_TRUE_OR_RETURN( filters_scale != 0, "filters scale cannot be zero" );
+  
+  /* Additional checking for each task */
+  
+  if( filter_task == "SBExtract" ) {
+      /* Checking input_raster */
+  
+      TePDITypes::TePDIRasterPtrType input_image;
+      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_image", 
+        input_image ),  "Missing parameter: input_image" );
+      TEAGN_TRUE_OR_RETURN( input_image.isActive(),
+        "Invalid parameter: input_image inactive" );
+      TEAGN_TRUE_OR_RETURN( input_image->params().status_ != 
+        TeRasterParams::TeNotReady, 
+        "Invalid parameter: input_image not ready" );
+    
+      TEAGN_TRUE_OR_RETURN( ( input_image->params().nlines_ > 1 ), 
+        "Invalid input_image lines number" );
+      TEAGN_TRUE_OR_RETURN( ( input_image->params().ncols_ > 1 ), 
+        "Invalid input_image columns number" );
+    
+      /* Checking input band */
+  
+      int band;
+      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "band", band ),
+        "Missing parameter: band" );
+      TEAGN_TRUE_OR_RETURN( band < input_image->nBands(),
+        "Invalid parameter: band" );
+        
+      /* Checking photometric interpretation */
+  
+      TEAGN_TRUE_OR_RETURN( ( 
+        ( input_image->params().photometric_[ band ] == 
+          TeRasterParams::TeRGB ) ||
+        ( input_image->params().photometric_[ band ] == 
+          TeRasterParams::TeMultiBand ) ),
+        "Invalid parameter: input_image "
+        "( invalid photometric interpretation" );
+        
+      /* checking for the output lowlow raster */
+    
+      TePDITypes::TePDIRasterPtrType sub_band;
+      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "sub_band", sub_band ),
+        "Missing parameter: sub_band" );
+      TEAGN_TRUE_OR_RETURN( sub_band.isActive(),
+        "Invalid parameter: sub_band inactive pointer" );
+      TEAGN_TRUE_OR_RETURN( sub_band->params().status_ != 
+        TeRasterParams::TeNotReady, "Invalid parameter: sub_band not ready" );        
+      
+      int sub_band_index = 0;
+      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "sub_band_index", 
+        sub_band_index ), "Missing parameter: sub_band" );
+      TEAGN_TRUE_OR_RETURN( ( ( sub_band_index >= 0 ) && 
+        ( sub_band_index < 4 ) ), "Invalid parameter: sub_band_index" );
+        
+      /* Checking decomposition levels number */
+      
+      int max_levels = (int)( MIN(
+          TePDIMathFunctions::DecimLevels( input_image->params().nlines_ ),
+          TePDIMathFunctions::DecimLevels( input_image->params().ncols_ ) ) );
+    
+      int levels = 0;
+      TEAGN_TRUE_OR_RETURN( 
+        parameters.GetParameter( "levels", levels ),
+        "Missing parameter: levels" );
+      TEAGN_TRUE_OR_RETURN( ( levels > 0 ) && ( levels <= max_levels ),
+        "Invalid parameter: levels" );
+      TEAGN_TRUE_OR_RETURN( 
+        ( TePDIMathFunctions::DecimLevelSize(
+        levels, MIN( input_image->params().nlines_,
+        input_image->params().ncols_ ) ) >= max_filter_size ),
+        "Invalid parameter: The current \"levels\" parameter and "
+        "input filters are incompatible" );
+    } else if( filter_task == "SBSwap" ) {
+      /* Checking input_raster */
+  
+      TePDITypes::TePDIRasterPtrType input_image;
+      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_image", 
+        input_image ), "Missing parameter: input_image" );
+      TEAGN_TRUE_OR_RETURN( input_image.isActive(),
+        "Invalid parameter: input_image inactive" );
+      TEAGN_TRUE_OR_RETURN( input_image->params().status_ != 
+        TeRasterParams::TeNotReady, 
+        "Invalid parameter: input_image not ready" );
+    
+      TEAGN_TRUE_OR_RETURN( ( input_image->params().nlines_ > 1 ), 
+        "Invalid input_image lines number" );
+      TEAGN_TRUE_OR_RETURN( ( input_image->params().ncols_ > 1 ), 
+        "Invalid input_image columns number" );
+    
+      /* Checking input band */
+  
+      int band;
+      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "band", band ),
+        "Missing parameter: band" );
+      TEAGN_TRUE_OR_RETURN( band < input_image->nBands(),
+        "Invalid parameter: band" );
+        
+      /* Checking photometric interpretation */
+  
+      TEAGN_TRUE_OR_RETURN( ( 
+        ( input_image->params().photometric_[ band ] == 
+          TeRasterParams::TeRGB ) ||
+        ( input_image->params().photometric_[ band ] == 
+          TeRasterParams::TeMultiBand ) ),
+        "Invalid parameter: input_image "
+        "( invalid photometric interpretation" );        
+        
+      /* Checking decomposition levels number */   
+  
+      int max_levels = (int)( MIN(
+          TePDIMathFunctions::DecimLevels( input_image->params().nlines_ ),
+          TePDIMathFunctions::DecimLevels( input_image->params().ncols_ ) ) );
+    
+      int levels = 0;
+      TEAGN_TRUE_OR_RETURN( 
+        parameters.GetParameter( "levels", levels ),
+        "Missing parameter: levels" );
+      TEAGN_TRUE_OR_RETURN( ( levels > 0 ) && ( levels <= max_levels ),
+        "Invalid parameter: levels" );
+      TEAGN_TRUE_OR_RETURN( 
+        ( TePDIMathFunctions::DecimLevelSize(
+        levels, MIN( input_image->params().nlines_,
+        input_image->params().ncols_ ) ) >= max_filter_size ),
+        "Invalid parameter: The current \"levels\" parameter and "
+        "input filters are incompatible" );                
+            
+      /* Checking output_raster */
+  
+      TePDITypes::TePDIRasterPtrType output_image;
+      TEAGN_TRUE_OR_RETURN( 
+        parameters.GetParameter( "output_image", output_image ),
+        "Missing parameter: output_image" );
+      TEAGN_TRUE_OR_RETURN( output_image.isActive(),
+        "Invalid parameter: output_image inactive" );
+      TEAGN_TRUE_OR_RETURN( output_image->params().status_ != 
+        TeRasterParams::TeNotReady, 
+        "Invalid parameter: output_image not ready" );    
+        
+      /* checking for the sub-band */
+    
+      TePDITypes::TePDIRasterPtrType sub_band;
+      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "sub_band", sub_band ),
+        "Missing parameter: sub_band" );
+      TEAGN_TRUE_OR_RETURN( sub_band.isActive(),
+        "Invalid parameter: sub_band inactive pointer" );
+      TEAGN_TRUE_OR_RETURN( sub_band->params().status_ != 
+        TeRasterParams::TeNotReady, "Invalid parameter: sub_band not ready" );       
+        
+      TEAGN_TRUE_OR_RETURN( ( ((unsigned int)sub_band->params().nlines_) == 
+        TePDIMathFunctions::DecimLevelSize( levels,
+        input_image->params().nlines_ ) ),
+        "Invalid parameter: Sub_band lines mismatch for the choosen "
+        "decomposition level" );
+      TEAGN_TRUE_OR_RETURN( ( ( (unsigned int)sub_band->params().ncols_) == 
+        TePDIMathFunctions::DecimLevelSize( levels,
+        input_image->params().ncols_ ) ),
+        "Invalid parameter: Sub_band columns mismatch for the choosen "
+        "decomposition level" );
+        
+      /* checking sub-band index */
+                
+      int sub_band_index = 0;
+      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "sub_band_index", 
+        sub_band_index ), "Missing parameter: sub_band" );
+      TEAGN_TRUE_OR_RETURN( ( ( sub_band_index >= 0 ) && 
+        ( sub_band_index < 4 ) ), "Invalid parameter: sub_band_index" );       
+    } else if( filter_task == "GetPyramid" ) {
+      /* Checking input_raster */
+  
+      TePDITypes::TePDIRasterPtrType input_image;
+      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_image", 
+        input_image ), "Missing parameter: input_image" );
+      TEAGN_TRUE_OR_RETURN( input_image.isActive(),
+        "Invalid parameter: input_image inactive" );
+      TEAGN_TRUE_OR_RETURN( input_image->params().status_ != 
+        TeRasterParams::TeNotReady, 
+        "Invalid parameter: input_image not ready" );
+    
+      TEAGN_TRUE_OR_RETURN( ( input_image->params().nlines_ > 1 ), 
+        "Invalid input_image lines number" );
+      TEAGN_TRUE_OR_RETURN( ( input_image->params().ncols_ > 1 ), 
+        "Invalid input_image columns number" );
+    
+      /* Checking input band */
+  
+      int band;
+      TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "band", band ),
+        "Missing parameter: band" );
+      TEAGN_TRUE_OR_RETURN( band < input_image->nBands(),
+        "Invalid parameter: band" );
+        
+      /* Checking photometric interpretation */
+  
+      TEAGN_TRUE_OR_RETURN( ( 
+        ( input_image->params().photometric_[ band ] == 
+          TeRasterParams::TeRGB ) ||
+        ( input_image->params().photometric_[ band ] == 
+          TeRasterParams::TeMultiBand ) ),
+        "Invalid parameter: input_image "
+        "( invalid photometric interpretation" );        
+        
+      /* Checking decomposition levels number */   
+  
+      int max_levels = (int)( MIN(
+          TePDIMathFunctions::DecimLevels( input_image->params().nlines_ ),
+          TePDIMathFunctions::DecimLevels( input_image->params().ncols_ ) ) );
+    
+      int levels = 0;
+      TEAGN_TRUE_OR_RETURN( 
+        parameters.GetParameter( "levels", levels ),
+        "Missing parameter: levels" );
+      TEAGN_TRUE_OR_RETURN( ( levels > 0 ) && ( levels <= max_levels ),
+        "Invalid parameter: levels" );
+      TEAGN_TRUE_OR_RETURN( 
+        ( TePDIMathFunctions::DecimLevelSize(
+        levels, MIN( input_image->params().nlines_,
+        input_image->params().ncols_ ) ) >= max_filter_size ),
+        "Invalid parameter: The current \"levels\" parameter and "
+        "input filters are incompatible" );
+        
+      /* Checking for the pyramid reference */
+      
+      TePDITypes::TePDIRasterVectorPtrType pyramid;
+      TEAGN_TRUE_OR_RETURN( 
+        parameters.GetParameter( "pyramid", pyramid ),
+        "Missing parameter: pyramid" );
+      TEAGN_TRUE_OR_RETURN( 
+        pyramid.isActive(), "Inactive parameter: pyramid" );
+    } else if( filter_task == "RecomposePyramid" ) {
+      /* Checking input_raster */
+  
+      TePDITypes::TePDIRasterPtrType input_image;
+      
+      if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+        "input_image" ) ) {
+        
+        TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_image", 
+          input_image ), "Missing parameter: input_image" );
+        TEAGN_TRUE_OR_RETURN( input_image.isActive(),
+          "Invalid parameter: input_image inactive" );
+        TEAGN_TRUE_OR_RETURN( input_image->params().status_ != 
+          TeRasterParams::TeNotReady, 
+          "Invalid parameter: input_image not ready" );
+      
+        TEAGN_TRUE_OR_RETURN( ( input_image->params().nlines_ > 1 ), 
+          "Invalid input_image lines number" );
+        TEAGN_TRUE_OR_RETURN( ( input_image->params().ncols_ > 1 ), 
+          "Invalid input_image columns number" );
+      
+        /* Checking input band */
+    
+        int band;
+        TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "band", band ),
+          "Missing parameter: band" );
+        TEAGN_TRUE_OR_RETURN( band < input_image->nBands(),
+          "Invalid parameter: band" );
+          
+        /* Checking photometric interpretation */
+    
+        TEAGN_TRUE_OR_RETURN( ( 
+          ( input_image->params().photometric_[ band ] == 
+            TeRasterParams::TeRGB ) ||
+          ( input_image->params().photometric_[ band ] == 
+            TeRasterParams::TeMultiBand ) ),
+          "Invalid parameter: input_image "
+          "( invalid photometric interpretation" );          
+      }
+      
+      /* Checking output_raster */
+  
+      TePDITypes::TePDIRasterPtrType output_image;
+      TEAGN_TRUE_OR_RETURN( 
+        parameters.GetParameter( "output_image", output_image ),
+        "Missing parameter: output_image" );
+      TEAGN_TRUE_OR_RETURN( output_image.isActive(),
+        "Invalid parameter: output_image inactive" );
+      TEAGN_TRUE_OR_RETURN( output_image->params().status_ != 
+        TeRasterParams::TeNotReady, 
+        "Invalid parameter: output_image not ready" );          
+      
+      /* Checking for the pyramid reference */
+      
+      TePDITypes::TePDIRasterVectorPtrType pyramid;
+      TEAGN_TRUE_OR_RETURN( 
+        parameters.GetParameter( "pyramid", pyramid ),
+        "Missing parameter: pyramid" );
+      TEAGN_TRUE_OR_RETURN( 
+        pyramid.isActive(), "Inactive parameter: pyramid" );      
+      
+      TEAGN_TRUE_OR_RETURN( ( ( pyramid->size() % 4 ) == 0 ),
+        "Invalid input pyramid size" );
+        
+      unsigned int py_levels = pyramid->size() / 4;
+      unsigned int py_sb00_index = 0;
+      for( unsigned int level = 1 ; level <= py_levels ; ++level ) {
+        py_sb00_index = ( level - 1 ) * 4;
+        
+        TEAGN_TRUE_OR_RETURN( (
+          ( (*pyramid)[ py_sb00_index ]->params().nlines_ ==
+            (*pyramid)[ py_sb00_index + 1 ]->params().nlines_ ) &&
+          ( (*pyramid)[ py_sb00_index ]->params().nlines_ ==
+            (*pyramid)[ py_sb00_index + 2 ]->params().nlines_ ) &&
+          ( (*pyramid)[ py_sb00_index ]->params().nlines_ ==
+            (*pyramid)[ py_sb00_index + 3 ]->params().nlines_ ) &&
+          ( (*pyramid)[ py_sb00_index ]->params().ncols_ ==
+            (*pyramid)[ py_sb00_index + 1 ]->params().ncols_ ) &&
+          ( (*pyramid)[ py_sb00_index ]->params().ncols_ ==
+            (*pyramid)[ py_sb00_index + 2 ]->params().ncols_ ) &&
+          ( (*pyramid)[ py_sb00_index ]->params().ncols_ ==
+            (*pyramid)[ py_sb00_index + 3 ]->params().ncols_ ) ),
+          "Dimensions mismatch detected between same level sub-bands"
+          " inside input pyramid" );
+            
+        TEAGN_TRUE_OR_RETURN( (
+          ( (*pyramid)[ py_sb00_index ]->nBands() == 1 ) &&
+          ( (*pyramid)[ py_sb00_index + 1 ]->nBands() == 1 ) &&
+          ( (*pyramid)[ py_sb00_index + 2 ]->nBands() == 1 ) &&
+          ( (*pyramid)[ py_sb00_index + 3 ]->nBands() == 1 ) ),
+          "Invalid number of bands detected inside input pyramid" );
+          
+        /* Checking the correct dimensions between levels */
+        
+        if( level != py_levels ) {
+          TEAGN_TRUE_OR_RETURN( (
+            ( (*pyramid)[ py_sb00_index ]->params().nlines_ >
+            ( 2 * ( (*pyramid)[ py_sb00_index + 4 ]->params().nlines_ - 
+            1 ) ) ) 
+            && ( (*pyramid)[ py_sb00_index ]->params().ncols_ >
+            ( 2 * ( (*pyramid)[ py_sb00_index + 4 ]->params().ncols_ - 
+            1 ) ) ) ),
+            "Dimensions mismatch detected between levels inside input pyramid" 
+            );
+        }
+      }
+      
+      if( input_image.isActive() ) {
+        TEAGN_TRUE_OR_RETURN(
+          ( (*pyramid)[ 0 ]->params().nlines_ == 
+          ( (int)ceil( ((double)input_image->params().nlines_) / 2 ) ) &&
+          ( (*pyramid)[ 0 ]->params().ncols_) == 
+          ( (int)ceil( ((double)input_image->params().ncols_ ) / 2 ) ) ) , 
+          "The supplied pyramid and reference image are not compatible" );
+      }
+    } else { 
+      TEAGN_LOG_AND_RETURN( "Invalid filter_task parameter" );
+    }
+  
+  return true;  
+}
+
+
+bool TePDIMallatWavelets::RunImplementation()
+{
+  std::string filter_task;
+  params_.GetParameter( "filter_task", filter_task );
+
+  if( filter_task == "SBExtract" ) {
+      TEAGN_TRUE_OR_RETURN( Decompose( params_ ), 
+        "Unable to do Wavelet decomposition" );
+        
+      TePDITypes::TePDIRasterPtrType sub_band;
+      params_.GetParameter( "sub_band", sub_band );
+      
+      int sub_band_index = 0;
+      params_.GetParameter( "sub_band_index", sub_band_index );
+      
+      TEAGN_TRUE_OR_RETURN( GetSubBand(  pyramid_.size() - 1,
+        sub_band_index, sub_band ),
+        "Unable to copy sub-band to output raster" );
+        
+      pyramid_.clear();
+    } else if( filter_task == "SBSwap" ) {
+      TEAGN_TRUE_OR_RETURN( Decompose( params_ ), 
+        "Unable to do Wavelet decomposition" );
+        
+      TePDITypes::TePDIRasterPtrType sub_band;
+      params_.GetParameter( "sub_band", sub_band );
+      
+      int sub_band_index = 0;
+      params_.GetParameter( "sub_band_index", sub_band_index );      
+      
+      TEAGN_TRUE_OR_RETURN( ChangeSubBand( pyramid_.size() - 1,
+        sub_band_index, sub_band ), "Sub-band swap error" );
+        
+      TEAGN_TRUE_OR_RETURN( Recompose( pyramid_.size() - 1, params_ ),
+        "Recomposition error" );
+        
+      pyramid_.clear();
+    } else if( filter_task == "GetPyramid" ) {
+      TEAGN_TRUE_OR_RETURN( Decompose( params_ ), 
+        "Unable to do Wavelet decomposition" );
+        
+      TePDITypes::TePDIRasterVectorPtrType pyramid;
+      params_.GetParameter( "pyramid", pyramid );
+        
+      for( unsigned int level = 1 ; level < pyramid_.size() ; ++level ) {
+        TePDITypes::TePDIRasterPtrType sub_band00;
+        TePDITypes::TePDIRasterPtrType sub_band01;
+        TePDITypes::TePDIRasterPtrType sub_band10;
+        TePDITypes::TePDIRasterPtrType sub_band11;
+        
+        TEAGN_TRUE_OR_RETURN(
+          TePDIUtils::TeAllocRAMRaster( sub_band00, 1, 1, 1, false, TeDOUBLE, 
+          0 ), "Unable to allocate temporary sub-band00 raster" );
+        TEAGN_TRUE_OR_RETURN(
+          TePDIUtils::TeAllocRAMRaster( sub_band01, 1, 1, 1, false, TeDOUBLE, 
+          0 ), "Unable to allocate temporary sub-band01 raster" );
+        TEAGN_TRUE_OR_RETURN(
+          TePDIUtils::TeAllocRAMRaster( sub_band10, 1, 1, 1, false, TeDOUBLE, 
+          0 ), "Unable to allocate temporary sub-band10 raster" );
+        TEAGN_TRUE_OR_RETURN(
+          TePDIUtils::TeAllocRAMRaster( sub_band11, 1, 1, 1, false, TeDOUBLE, 
+          0 ), "Unable to allocate temporary sub-band11 raster" );
+      
+        TEAGN_TRUE_OR_RETURN( GetSubBand( level, 0, sub_band00 ),
+          "Unable to copy sub-band00 to output raster" );
+        pyramid->push_back( sub_band00 );        
+        TEAGN_TRUE_OR_RETURN( GetSubBand( level, 1, sub_band01 ),
+          "Unable to copy sub-band01 to output raster" );
+        pyramid->push_back( sub_band01 );
+        TEAGN_TRUE_OR_RETURN( GetSubBand( level, 2, sub_band10 ),
+          "Unable to copy sub-band10 to output raster" );
+        pyramid->push_back( sub_band10 );
+        TEAGN_TRUE_OR_RETURN( GetSubBand( level, 3, sub_band11 ),
+          "Unable to copy sub-band11 to output raster" );
+        pyramid->push_back( sub_band11 );
+      }
+      
+      pyramid_.clear();
+    } else if( filter_task == "RecomposePyramid" ) {
+      pyramid_.clear();
+      
+      TePDITypes::TePDIRasterPtrType input_image;
+      if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+        "input_image" ) ) {
+        
+        params_.GetParameter( "input_image", input_image );
+      }      
+      
+      TePDITypes::TePDIRasterVectorPtrType pyramid;
+      params_.GetParameter( "pyramid", pyramid );
+      
+      const unsigned int levels = ( pyramid->size() - 1 ) / 3;
+      unsigned int sblines = 0;
+      unsigned int sbcols = 0;
+      unsigned int py_sb00_index = 0;
+    
+      for( unsigned int level = 1 ; level <= levels ; ++level ) {
+        py_sb00_index = ( level - 1 ) * 4;
+      
+        if( ( level == 1 ) && ( input_image.isActive() ) ) {
+          sblines = ( unsigned int )
+            ceil( ( (double)input_image->params().nlines_ ) / 2 );
+          sbcols = ( unsigned int )
+            ceil( ( (double)input_image->params().ncols_ ) / 2 );
+        } else {
+          sblines = (*pyramid)[ py_sb00_index + 1 ]->params().nlines_;
+          sbcols = (*pyramid)[ py_sb00_index + 1 ]->params().ncols_;
+        }
+        
+        TEAGN_TRUE_OR_RETURN( AllocateTopLevel( level, sblines, sbcols ),
+          "Unable to allocate the new pyramid level " +
+          Te2String( level ) );
+          
+        TEAGN_TRUE_OR_RETURN( ChangeSubBand( level,
+          0, (*pyramid)[ py_sb00_index ] ), "Unable to copy pyramid data at"
+          "level " + Te2String( level ) + " sub-band 00" );
+        TEAGN_TRUE_OR_RETURN( ChangeSubBand( level,
+          1, (*pyramid)[ py_sb00_index + 1 ] ), "Unable to copy pyramid data at"
+          "level " + Te2String( level ) + " sub-band 01" );
+        TEAGN_TRUE_OR_RETURN( ChangeSubBand( level,
+          2, (*pyramid)[ py_sb00_index + 2 ] ), "Unable to copy pyramid data at"
+          "level " + Te2String( level ) + " sub-band 10" );
+        TEAGN_TRUE_OR_RETURN( ChangeSubBand( level,
+          3, (*pyramid)[ py_sb00_index + 3 ] ), "Unable to copy pyramid data at"
+          "level " + Te2String( level ) + " sub-band 11" );
+      }
+      
+      TEAGN_TRUE_OR_RETURN( Recompose( pyramid_.size() - 1, params_ ),
+        "Recomposition error" ); 
+        
+      pyramid_.clear();     
+    } else {
+      TEAGN_LOG_AND_THROW( "Invalid filter task" );
+    }    
+  
+  return true;
+}
+
+
+
+
+void TePDIMallatWavelets::ResetState( const TePDIParameters& )
+{
+  shift_histogram_flag_ = false;
+  input_image_mean_ = 0;
+}
+
+
+bool TePDIMallatWavelets::Decompose( const TePDIParameters& params )
+{
+  /* Retriving parameters */
+    
+  TePDITypes::TePDIRasterPtrType input_image;
+  params.GetParameter( "input_image", input_image );
+  
+  int band;
+  params.GetParameter( "band", band );  
+  
+  int levels = 0;
+  params.GetParameter( "levels", levels );
+  
+  /* Guessing dummy use */
+  
+  bool input_image_uses_dummy = input_image->params().useDummy_;
+  double input_image_dummy = 0;
+  if( input_image_uses_dummy ) {
+    input_image_dummy = input_image->params().dummy_[ band ];
+  }
+  
+  /* Generationg subband pyramid level 0 */
+    
+  const unsigned int inputlines = input_image->params().nlines_;
+  const unsigned int inputcolumns = input_image->params().ncols_;
+  
+  pyramid_.clear();
+    
+  TePDIMatrix<double> subband0;
+  
+  TePDIMatrix< TePDIMatrix< double > > levelzeromatrix; 
+  TEAGN_TRUE_OR_THROW( levelzeromatrix.Reset( 1, 1 ), "Matrix reset error" );
+  levelzeromatrix( 0, 0 ) = subband0;
+  
+  pyramid_.push_back( levelzeromatrix );
+  
+  TEAGN_TRUE_OR_RETURN( 
+    pyramid_[ 0 ]( 0, 0 ).Reset( inputlines, inputcolumns,
+    TePDIMatrix<double>::AutoMemPol ),
+    "Unable to create level 0 sub-band" );
+    
+  double pixel_value;
+  TePDIMatrix< double >& l0matrix = pyramid_[ 0 ]( 0, 0 );
+  
+  input_image_mean_ = 0;
+  
+  unsigned int inputline;
+  unsigned int inputcolumn;
+  
+  for( inputline = 0 ; inputline < inputlines ; ++inputline ) {
+    for( inputcolumn = 0 ; inputcolumn < inputcolumns ; ++inputcolumn ) {
+      if( input_image->getElement( inputcolumn, inputline, pixel_value, 
+          band ) ) {
+  
+        l0matrix( inputline, inputcolumn ) = pixel_value;
+        input_image_mean_ += pixel_value;
+      } else {
+        TEAGN_TRUE_OR_RETURN( input_image_uses_dummy, "Raster read error" );
+      
+        l0matrix( inputline, inputcolumn ) = input_image_dummy;
+        input_image_mean_ += input_image_dummy;        
+      }
+    }
+  }
+  
+  input_image_mean_ = 
+    input_image_mean_ / ( (double)( inputlines * inputcolumns ) );  
+  
+  if( shift_histogram_flag_ ) {
+  
+    /* Removing mean */  
+    
+    for( inputline = 0 ; inputline < inputlines ; ++inputline ) {
+      for( inputcolumn = 0 ; inputcolumn < inputcolumns ; ++inputcolumn ) {
+        l0matrix( inputline, inputcolumn ) = 
+        l0matrix( inputline, inputcolumn ) - input_image_mean_;
+      }
+    }  
+  }
+  
+  /* Generating the other subband pyramid levels */
+  
+  for( int level = 1 ; level <= levels ; ++level ) {
+    TEAGN_TRUE_OR_RETURN( GenerateLevel( level, params ),
+      "Unable to generate level " + 
+      Te2String( level ) );
+  }
+  
+  return true;  
+}
+
+
+bool TePDIMallatWavelets::Recompose( unsigned int ref_level,
+  const TePDIParameters& params )
+{
+  TePDITypes::TePDIRasterPtrType input_image;
+  if( params.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "input_image" ) ) {
+      
+    params.GetParameter( "input_image", input_image );    
+  }
+
+  TEAGN_TRUE_OR_RETURN( ( ( pyramid_.size() > ref_level ) &&
+    ( ref_level > 0 ) ), 
+    "Invalid reference level" );
+    
+  /* Retriving the systesis filters */
+  
+  
+  std::vector< double > s_filter_l;
+  std::vector< double > s_filter_h;
+  int lowshift;
+  int highshift;
+  
+  TEAGN_TRUE_OR_RETURN( GetSynthesisFilters( s_filter_l, s_filter_h,
+    lowshift, highshift, params ),
+    "Unable to get synthesis filters" );  
+  
+  /* Reconstruction of levels */
+  
+  TePDIMatrix< double > rec_result;
+  
+  {
+    TePDIMatrix< double > temp_llsb;
+    
+    unsigned int llsblines;
+    unsigned int llsbcols;
+    
+    TePDIPIManager progress( "Recomposing levels...", ref_level,
+      progress_enabled_ );
+    
+    for( unsigned int level = ref_level ; level != 0 ; --level ) {
+      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+    
+      if( level == 1 ) {
+        if( pyramid_[ 0 ]( 0, 0 ).IsEmpty() ) {
+          llsblines = ( ( pyramid_[ 1 ]( 0, 0 ).GetLines() - 1 ) * 2 ) + 1;
+          llsbcols = ( ( pyramid_[ 1 ]( 0, 0 ).GetColumns() - 1 ) * 2 ) + 1;
+        } else {
+          llsblines = pyramid_[ 0 ]( 0, 0 ).GetLines();
+          llsbcols = pyramid_[ 0 ]( 0, 0 ).GetColumns();
+        }
+      } else {
+        llsblines = pyramid_[ level - 1 ]( 0, 1 ).GetLines();
+        llsbcols = pyramid_[ level - 1 ]( 0, 1 ).GetColumns();
+      }
+      
+      TEAGN_TRUE_OR_RETURN( temp_llsb.Reset( llsblines, llsbcols,
+        TePDIMatrix<double>::AutoMemPol ),
+        "Unable to allocate memory for low-low sub-band reconstruction "
+        "at level " + Te2String( level ) );    
+      
+      if( level == ref_level ) {
+        TEAGN_TRUE_OR_RETURN( ReconstructLL( pyramid_[ level ]( 0, 0 ), 
+          pyramid_[ level ]( 0, 1 ), pyramid_[ level ]( 1, 0 ),
+          pyramid_[ level ]( 1, 1 ), s_filter_l, 
+          s_filter_h, lowshift, highshift, temp_llsb ),
+          "Low-Low sub-band reconstruction error at level "
+          + Te2String( level ) );
+      } else {
+        TEAGN_TRUE_OR_RETURN( ReconstructLL( rec_result, 
+          pyramid_[ level ]( 0, 1 ), pyramid_[ level ]( 1, 0 ),
+          pyramid_[ level ]( 1, 1 ), s_filter_l, 
+          s_filter_h, lowshift, highshift, temp_llsb ),
+          "Low-Low sub-band reconstruction error at level "
+          + Te2String( level ) ); 
+      }
+      
+      rec_result = temp_llsb;
+    }
+    
+    progress.Toggle( false );
+  }
+  
+  /* Retriving output raster reference from parameters */
+  
+  TePDITypes::TePDIRasterPtrType output_image;
+  params.GetParameter( "output_image", output_image );
+    
+  /* Updating output raster geo parameters if available */
+  
+  if( input_image.isActive() ) {
+    TeRasterParams output_image_params = output_image->params();
+    
+    output_image_params.nBands( 1 );
+    
+    if( input_image->projection() != 0 ) {
+      TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+        input_image->projection()->params() ) );    
+      output_image_params.projection( proj.nakedPointer() );
+    }    
+    
+    output_image_params.boxResolution( input_image->params().box().x1(), 
+      input_image->params().box().y1(), input_image->params().box().x2(), 
+      input_image->params().box().y2(), 
+      input_image->params().resx_, input_image->params().resy_ );    
+    
+    TEAGN_TRUE_OR_RETURN( output_image->init( output_image_params ),
+      "Output raster reset error" );
+  } else {
+    TeRasterParams output_image_params = output_image->params();
+    
+    output_image_params.nBands( 1 );
+    
+    output_image_params.setNLinesNColumns( rec_result.GetLines(),
+      rec_result.GetColumns() );
+    
+    TEAGN_TRUE_OR_RETURN( output_image->init( output_image_params ),
+      "Output raster reset error" );  
+  }
+    
+  double channel_min_level = 0;
+  double channel_max_level = 0;
+  
+  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+    output_image, 0, channel_min_level,
+    channel_max_level ), "Unable to get output raster channel level bounds" );    
+ 
+  unsigned int line, column;
+  double value;
+  
+  for( line = 0 ; line < rec_result.GetLines() ; ++line ) {
+    for( column = 0 ; column < rec_result.GetColumns() ; ++column ) {
+      value = rec_result( line, column );
+      
+      if( shift_histogram_flag_ ) {
+        value += input_image_mean_;
+      }
+      
+      /* Level range filtering */
+
+      if( value < channel_min_level ) {
+        value = channel_min_level;
+      } else if( value > channel_max_level ) {
+        value = channel_max_level;
+      }  
+            
+      TEAGN_TRUE_OR_RETURN( 
+        output_image->setElement( column, line, value, 0 ),
+        "Unable to set output raster element" );
+    }
+  }  
+  
+  return true;
+}
+
+
+bool TePDIMallatWavelets::GetSubBand( unsigned int level, 
+  unsigned int subband, 
+  const TePDITypes::TePDIRasterPtrType& sb_raster ) const
+{
+  TEAGN_TRUE_OR_RETURN( pyramid_.size() > level, 
+    "Invalid level number" );
+  TEAGN_TRUE_OR_RETURN( sb_raster.isActive(), 
+    "Inactive sub-band raster" );
+    
+    
+  TePDIMatrix< double >* sb_ptr = 0;
+    
+  switch( subband ) {
+    case 0 :
+    {
+      sb_ptr = &( pyramid_[ level ]( 0 , 0 ) );
+      break;
+    }
+    case 1 :
+    {
+      sb_ptr = &( pyramid_[ level ]( 0 , 1 ) );
+      break;
+    }
+    case 2 :
+    {
+      sb_ptr = &( pyramid_[ level ]( 1 , 0 ) );
+      break;
+    }
+    case 3 :
+    {
+      sb_ptr = &( pyramid_[ level ]( 1 , 1 ) );
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid subband" );
+    }
+  }
+  
+  unsigned int lines = sb_ptr->GetLines();
+  unsigned int columns = sb_ptr->GetColumns();
+      
+  TeRasterParams sb_raster_params = sb_raster->params();
+  sb_raster_params.setDataType( TeDOUBLE, -1 );
+  sb_raster_params.nBands( 1 );
+  sb_raster_params.setNLinesNColumns( lines, columns );
+  TEAGN_TRUE_OR_RETURN( sb_raster->init( sb_raster_params ),
+    "Unable to reset sb_raster" );   
+        
+  unsigned int line;
+  unsigned int col;
+      
+  for( line = 0; line < lines ; ++line ) {
+    for( col = 0; col < columns ; ++col ) {
+      TEAGN_TRUE_OR_RETURN( sb_raster->setElement( col, line,
+        (*sb_ptr)( line, col ), 0 ),
+        "Unable to copy pixel value into low-low output raster" );
+    }
+  }    
+  
+  return true;
+}
+
+
+bool TePDIMallatWavelets::ChangeSubBand( 
+  unsigned int level, unsigned int subband_index,
+  const TePDITypes::TePDIRasterPtrType& newsband )
+{
+  TEAGN_TRUE_OR_RETURN( pyramid_.size() > level, "Invalid level number" );
+  TEAGN_TRUE_OR_RETURN( newsband.isActive(), 
+    "The new sub-band is inactive" );
+    
+  TePDIMatrix< double >* target_sb = 0;
+    
+  switch( subband_index ) {
+    case 0 :
+    {
+      target_sb = &( pyramid_[ level ]( 0, 0 ) );
+      
+      break;
+    }
+    case 1 :
+    {
+      target_sb = &( pyramid_[ level ]( 0, 1 ) );
+      
+      break;
+
+    }
+    case 2 :
+    {
+      target_sb = &( pyramid_[ level ]( 1, 0 ) );
+      
+      break;
+
+    }
+    case 3 :
+    {
+      target_sb = &( pyramid_[ level ]( 1, 1 ) );
+      
+      break;
+
+    }
+    default :
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid subband" );
+    }
+  }
+  
+  const int sblines = (int)target_sb->GetLines();
+  const int sbcols = (int)target_sb->GetColumns();
+  const int raster_lines = newsband->params().nlines_;
+  const int raster_cols = newsband->params().ncols_;  
+  
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( sblines == raster_lines ) && ( sbcols == raster_cols ) ),
+    "Incompatible sub-band dimensions" );  
+  
+  int line;
+  int col;
+      
+  for( line = 0; line < sblines ; ++line ) {
+    for( col = 0; col < sbcols ; ++col ) {
+      if( ( line < raster_lines ) && ( col < raster_cols ) ) {
+        TEAGN_TRUE_OR_RETURN( newsband->getElement( col, line,
+          (*target_sb)( line, col ), 0 ),
+          "Unable to copy pixel value from input raster" );
+      } else {
+        (*target_sb)( line, col ) = 0;
+      }
+    }
+  }    
+  
+  return true;
+}
+
+
+bool TePDIMallatWavelets::GenerateLevel( unsigned int level,
+  const TePDIParameters& params )
+{
+  TEAGN_TRUE_OR_RETURN( level > 0, "Invalid level" );
+  TEAGN_TRUE_OR_RETURN( pyramid_.size() >= level, 
+    "Not enought generated levels to generate the new required level" );
+    
+  const unsigned int subblines = ( unsigned int )
+    ceil( ( (double)pyramid_[ level - 1 ]( 0 , 0 ).GetLines() ) / 2 );
+  const unsigned int subbcolumns = ( unsigned int )
+    ceil( ( (double)pyramid_[ level - 1 ]( 0, 0 ).GetColumns() ) / 2 );
+
+  /* Deleting all higher levels */
+     
+  while( pyramid_.size() > ( level + 1 ) ) {
+    pyramid_.pop_back();
+  }
+  
+  /* Allocating space for the new level, if it doesn't exists */
+  
+  TEAGN_TRUE_OR_RETURN( AllocateTopLevel( level, subblines, subbcolumns ),
+    "Unable to allocate memory for the new level" );
+    
+  /* Retriving the analysis filters */
+  
+  std::vector< double > a_filter_l;
+  std::vector< double > a_filter_h;
+  int lowshift = 0;
+  int highshift = 0;
+  
+  TEAGN_TRUE_OR_RETURN( GetAnalysisFilters( a_filter_l, a_filter_h,
+     lowshift, highshift, params ), "Unable to retrive analysis filters" );
+  
+  /* Applying filters */
+  
+  TePDIMatrix< double > temp_sb;
+  TEAGN_TRUE_OR_RETURN( 
+    temp_sb.Reset( pyramid_[ level - 1 ]( 0 , 0 ).GetLines(), subbcolumns,
+    TePDIMatrix<double>::AutoMemPol ),
+    "Unable to create temporary sub-band" );
+    
+  TePDIPIManager progress( "Generating sub-bands for level " + 
+    Te2String( level ), 8, progress_enabled_ );
+    
+  ApplyHorizontalFilter( 
+    pyramid_[ level - 1 ]( 0, 0 ), a_filter_l, lowshift, temp_sb );
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+  ApplyVerticalFilter( 
+    temp_sb, a_filter_l, lowshift, pyramid_[ level ]( 0, 0 ) );
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+    
+  ApplyHorizontalFilter( 
+    pyramid_[ level - 1 ]( 0, 0 ), a_filter_l, lowshift, temp_sb );
+  progress.Increment();
+  ApplyVerticalFilter( 
+    temp_sb, a_filter_h, highshift, pyramid_[ level ]( 0, 1 ) );
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+      
+  ApplyHorizontalFilter( 
+    pyramid_[ level - 1 ]( 0, 0 ), a_filter_h, highshift, temp_sb );
+  progress.Increment();
+  ApplyVerticalFilter( 
+    temp_sb, a_filter_l, lowshift, pyramid_[ level ]( 1, 0 ) );
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+
+  ApplyHorizontalFilter( 
+    pyramid_[ level - 1 ]( 0, 0 ), a_filter_h, highshift, temp_sb );
+  progress.Increment();
+  ApplyVerticalFilter( 
+    temp_sb, a_filter_h, highshift, pyramid_[ level ]( 1, 1 ) );
+  TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+    
+  progress.Toggle( false );
+  
+  return true;
+}
+
+
+void TePDIMallatWavelets::ApplyVerticalFilter( 
+  const TePDIMatrix< double >& inMatrix, 
+  const std::vector< double >& filter,
+  int filter_shift,
+  TePDIMatrix< double >& outMatrix ) const
+{
+  TEAGN_TRUE_OR_THROW( inMatrix.GetLines() > outMatrix.GetLines(),
+    "inMatrix lines number must be greater than outMatrix lines number" );
+  TEAGN_TRUE_OR_THROW( inMatrix.GetColumns() == outMatrix.GetColumns(),
+    "inMatrix columns != outMatrix columns" );
+  TEAGN_TRUE_OR_THROW( inMatrix.GetLines() > filter.size(),
+    "inMatrix lines < filter size" );
+    
+  const unsigned int filter_size = filter.size();
+  const unsigned int makeeven = filter_shift % 2;
+  const unsigned int in_lines = inMatrix.GetLines();
+  const unsigned int in_columns = inMatrix.GetColumns();
+  const unsigned int vitual_in_lines_start = 
+    ( filter_size - 1 );/* The index where start the apply of
+    filter index 0 */
+  const unsigned int vitual_in_lines_bound = 
+    in_lines + vitual_in_lines_start;
+  
+  unsigned int virtual_in_line;
+  unsigned int in_column;
+  unsigned filter_index;
+  double out_level;
+  
+  for( in_column = 0 ; in_column < in_columns ; ++in_column ) {
+       
+    for( virtual_in_line = vitual_in_lines_start + makeeven; 
+         virtual_in_line < vitual_in_lines_bound ; 
+         virtual_in_line += 2 ) {
+         
+      out_level = 0;  
+    
+      for( filter_index = 0 ; filter_index < filter_size ; ++filter_index ) {
+        
+        out_level +=
+          inMatrix( ( virtual_in_line - filter_index ) % in_lines, 
+          in_column ) * filter[ filter_index ];
+      }
+      
+      outMatrix( ( ( virtual_in_line - vitual_in_lines_start + 
+        filter_shift ) % in_lines ) / 2, in_column ) = out_level;
+    }
+  }
+}
+
+
+void TePDIMallatWavelets::ApplyHorizontalFilter( 
+  const TePDIMatrix< double >& inMatrix,
+  const std::vector< double >& filter,
+  int filter_shift,
+  TePDIMatrix< double >& outMatrix ) const
+{
+  TEAGN_TRUE_OR_THROW( inMatrix.GetColumns() > outMatrix.GetColumns(),
+    "inMatrix columns  < outMatrix columns" );
+  TEAGN_TRUE_OR_THROW( inMatrix.GetLines() == outMatrix.GetLines(),
+    "inMatrix lines != outMatrix lines" );
+  TEAGN_TRUE_OR_THROW( inMatrix.GetColumns() > filter.size(),
+    "inMatrix columns < filter size" );
+    
+  const unsigned int filter_size = filter.size();
+  const unsigned int makeeven = filter_shift % 2;
+  const unsigned int in_lines = inMatrix.GetLines();
+  const unsigned int in_columns = inMatrix.GetColumns();
+  const unsigned int virtual_in_column_start = 
+    ( filter_size - 1 ) ;/* The index where start the apply of
+    filter index 0 */
+  const unsigned int virtual_in_columns_bound = 
+    in_columns + virtual_in_column_start;
+
+  unsigned virtual_in_column;  
+  unsigned int in_line;
+  unsigned int filter_index;
+  double out_level;
+  
+  for( in_line = 0 ; in_line < in_lines ; ++in_line ) {
+       
+    for( virtual_in_column = virtual_in_column_start + makeeven; 
+         virtual_in_column < virtual_in_columns_bound ; 
+         virtual_in_column += 2 ) {
+         
+      out_level = 0;  
+    
+      for( filter_index = 0 ; filter_index < filter_size ; ++filter_index ) {
+        
+        out_level += 
+          inMatrix( in_line, ( virtual_in_column -  
+            filter_index ) % in_columns ) * filter[ filter_index ];
+      }
+      
+      outMatrix( in_line, 
+        ( ( virtual_in_column - virtual_in_column_start + 
+        filter_shift ) % in_columns ) / 2 ) = out_level;
+    }
+  }
+}
+
+
+bool TePDIMallatWavelets::BuildSuperimposedLevel( unsigned int level,
+  TePDIMatrix< double >& level_matrix, bool normalize, double min_norm_level, 
+  double max_norm_level ) const
+{
+  TEAGN_TRUE_OR_RETURN( ( ! level_matrix.IsEmpty() ), 
+    "level_matrix is empty" );
+  TEAGN_TRUE_OR_RETURN( ( level > 0 ) && ( level < pyramid_.size() ),
+    "Invalid level" );
+    
+  if( level == ( pyramid_.size() - 1 ) ) {
+    if( normalize ) {
+      TePDIMatrix< double > sb00;
+      TEAGN_TRUE_OR_RETURN( sb00.Reset( pyramid_[ level ]( 0, 0 ).GetLines(),
+        pyramid_[ level ]( 0, 0 ).GetColumns() ), "Matrix reset error" );
+        
+      TePDIMatrix< double > sb01;
+      TEAGN_TRUE_OR_RETURN( sb01.Reset( pyramid_[ level ]( 0, 1 ).GetLines(),
+        pyramid_[ level ]( 0, 1 ).GetColumns() ), "Matrix reset error" );
+                
+      TePDIMatrix< double > sb10;
+      TEAGN_TRUE_OR_RETURN( sb10.Reset( pyramid_[ level ]( 1, 0 ).GetLines(),
+        pyramid_[ level ]( 1, 0 ).GetColumns() ), "Matrix reset error" );        
+        
+      TePDIMatrix< double > sb11;
+      TEAGN_TRUE_OR_RETURN( sb11.Reset( pyramid_[ level ]( 1, 1 ).GetLines(),
+        pyramid_[ level ]( 1, 1 ).GetColumns() ), "Matrix reset error" );        
+      
+      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
+        pyramid_[ level ]( 0, 0 ), sb00,
+        min_norm_level, max_norm_level ), "Matrix normalization error" );
+      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
+        pyramid_[ level ]( 0, 1 ), sb01,
+        min_norm_level, max_norm_level ), "Matrix normalization error" );
+      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
+        pyramid_[ level ]( 1, 0 ), sb10,
+        min_norm_level, max_norm_level ), "Matrix normalization error" );
+      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
+        pyramid_[ level ]( 1, 1 ), sb11,
+        min_norm_level, max_norm_level ), "Matrix normalization error" );
+      
+      TEAGN_TRUE_OR_RETURN( AgregateSubBands( sb00, sb01, sb10, sb11,
+        level_matrix ), "Unable to agregate sub-bands at level " +
+        Te2String( level ) );
+    } else {
+      TEAGN_TRUE_OR_RETURN( AgregateSubBands( pyramid_[ level ]( 0, 0 ),
+        pyramid_[ level ]( 0, 1 ), pyramid_[ level ]( 1, 0 ),
+        pyramid_[ level ]( 1, 1 ), level_matrix ), 
+        "Unable to agregate sub-bands at level " +
+        Te2String( level ) );    
+    };
+      
+    return true;
+  } else {
+    TePDIMatrix< double > sb00;
+    TEAGN_TRUE_OR_RETURN( sb00.Reset( pyramid_[ level ]( 0, 1 ).GetLines(),
+      pyramid_[ level ]( 0, 1 ).GetColumns(), 
+      TePDIMatrix<double>::AutoMemPol ),
+      "Unable to allocate memory for sub-band [0,0] at level " +
+      Te2String( level ) );
+    
+    TEAGN_TRUE_OR_RETURN( BuildSuperimposedLevel( level + 1, sb00, normalize,
+      min_norm_level, max_norm_level ),
+      "Unable to build superimposed level " +
+      Te2String( level ) );
+      
+    if( normalize ) {
+      TePDIMatrix< double > sb01;
+      TEAGN_TRUE_OR_RETURN( sb01.Reset( pyramid_[ level ]( 0, 1 ).GetLines(),
+        pyramid_[ level ]( 0, 1 ).GetColumns() ), "Matrix reset error" );         
+        
+      TePDIMatrix< double > sb10;
+      TEAGN_TRUE_OR_RETURN( sb10.Reset( pyramid_[ level ]( 1, 0 ).GetLines(),
+        pyramid_[ level ]( 1, 0 ).GetColumns() ), "Matrix reset error" );         
+        
+      TePDIMatrix< double > sb11;
+      TEAGN_TRUE_OR_RETURN( sb11.Reset( pyramid_[ level ]( 1, 1 ).GetLines(),
+        pyramid_[ level ]( 1, 1 ).GetColumns() ), "Matrix reset error" );         
+      
+      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
+        pyramid_[ level ]( 0, 1 ), sb01,
+        min_norm_level, max_norm_level ), "Matrix normalization error" );
+      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
+        pyramid_[ level ]( 1, 0 ), sb10,
+        min_norm_level, max_norm_level ), "Matrix normalization error" );
+      TEAGN_TRUE_OR_RETURN( NormalizeMatrix( 
+        pyramid_[ level ]( 1, 1 ), sb11,
+        min_norm_level, max_norm_level ), "Matrix normalization error" );      
+      
+      TEAGN_TRUE_OR_RETURN( AgregateSubBands( sb00, sb01, sb10, sb11,
+        level_matrix ), "Unable to agregate sub-bands at level " +
+        Te2String( level ) );
+    } else {
+      TEAGN_TRUE_OR_RETURN( AgregateSubBands( sb00, pyramid_[ level ]( 0, 1 ),
+        pyramid_[ level ]( 1, 0 ), pyramid_[ level ]( 1, 1 ), level_matrix ),
+        "Unable to agregate sub-bands at level " +
+        Te2String( level ) );      
+    }  
+      
+    return true;
+  }
+}
+
+
+bool TePDIMallatWavelets::AgregateSubBands(
+  const TePDIMatrix< double >& upper_left,
+  const TePDIMatrix< double >& upper_right,
+  const TePDIMatrix< double >& lower_left,
+  const TePDIMatrix< double >& lower_right,
+  TePDIMatrix< double >& result ) const
+{
+  TEAGN_TRUE_OR_RETURN( 
+    ( ! result.IsEmpty() ), "result matrix is empty" );
+
+  TEAGN_CHECK_EPS( upper_left.GetColumns(), lower_left.GetColumns(), 0,
+    "Size mismatch" );
+  TEAGN_CHECK_EPS( upper_right.GetColumns(), lower_right.GetColumns(), 0,
+    "Size mismatch" );
+  TEAGN_CHECK_EPS( upper_left.GetLines(), upper_right.GetLines(), 0,
+    "Size mismatch" );
+  TEAGN_CHECK_EPS( lower_left.GetLines(), lower_right.GetLines(), 0,
+    "Size mismatch" );
+    
+  unsigned int line = 0;
+  unsigned int column = 0;
+  const unsigned int lines_offset = upper_left.GetLines();
+  const unsigned int columns_offset = upper_left.GetColumns();
+  unsigned int lines_bound = 0;
+  unsigned int columns_bound = 0;
+  
+  /* Copying the upper_left sub-band */
+
+  lines_bound = 
+    MIN( result.GetLines(), upper_left.GetLines() );
+  columns_bound = 
+    MIN( result.GetColumns(), upper_left.GetColumns() );
+  
+  for( line = 0 ; line < lines_bound ; ++line ) {
+    for( column = 0 ; column < columns_bound ; ++column ) {
+      result( line, column ) = upper_left( line, column );
+    }
+  }
+  
+  /* Copying the upper_right sub-band */
+    
+  if( columns_offset < result.GetColumns() ) {
+    lines_bound = MIN( result.GetLines(), upper_right.GetLines() );
+    columns_bound = MIN( result.GetColumns() - columns_offset, 
+        upper_right.GetColumns() );  
+    
+    for( line = 0 ; line < lines_bound ; ++line ) {
+      for( column = 0 ; column < columns_bound ; ++column ) {
+        result( line, column + columns_offset ) = 
+          upper_right( line, column );
+      }
+    }
+  }
+  
+  /* Copying the lower_left sub-band */
+  
+  if( lines_offset < result.GetLines() ) {
+    lines_bound = 
+      MIN( result.GetLines() - lines_offset, 
+      lower_left.GetLines() );
+    columns_bound =
+      MIN( result.GetColumns(), lower_left.GetColumns() );   
+    
+    for( line = 0 ; line < lines_bound ; ++line ) {
+      for( column = 0 ; column < columns_bound ; ++column ) {
+        result( line + lines_offset, column ) = 
+          lower_left( line, column );
+      }
+    }
+  }
+  
+  /* Copying the lower_right sub-band */
+    
+  if( ( lines_offset < result.GetLines() ) &&
+      ( columns_offset < result.GetColumns() ) ) {
+  
+    lines_bound = MIN( 
+      result.GetLines() - lines_offset, lower_right.GetLines() );
+    columns_bound = MIN( 
+      result.GetColumns() - columns_offset, lower_right.GetColumns() );    
+    
+    for( line = 0 ; line < lines_bound ; ++line ) {
+      for( column = 0 ; column < columns_bound ; ++column ) {
+        result( line + lines_offset, column + columns_offset ) = 
+          lower_right( line, column );
+      }
+    }
+  }
+  
+  return true;          
+}
+
+
+bool TePDIMallatWavelets::PushLevel( unsigned int level, 
+  const TePDIMatrix< double >& sb0, const TePDIMatrix< double >& sb1, 
+  const TePDIMatrix< double >& sb2, const TePDIMatrix< double >& sb3 )
+{
+  TEAGN_TRUE_OR_RETURN( level > 0, "Invalid level" );
+  
+  TEAGN_TRUE_OR_RETURN( 
+    ( sb0.GetLines() == sb1.GetLines() ) &&
+    ( sb1.GetLines() == sb2.GetLines() ) &&
+    ( sb2.GetLines() == sb3.GetLines() ) &&
+    ( sb0.GetColumns() == sb1.GetColumns() ) &&
+    ( sb1.GetColumns() == sb2.GetColumns() ) &&
+    ( sb2.GetColumns() == sb3.GetColumns() ),
+    "All sub-bands must have the same dimensions" );
+    
+  TEAGN_TRUE_OR_RETURN( AllocateTopLevel( level, sb0.GetLines(), 
+    sb0.GetColumns() ), "Unable to allocate memory for the new level" );
+  
+  pyramid_[ level ]( 0, 0 ) = sb0;
+  pyramid_[ level ]( 0, 1 ) = sb1;
+  pyramid_[ level ]( 1, 0 ) = sb2;
+  pyramid_[ level ]( 1, 1 ) = sb3;
+  
+  return true;
+}
+
+
+bool TePDIMallatWavelets::AllocateTopLevel( unsigned int level, 
+  unsigned int sblines, unsigned int sbcolumns )
+{
+  /* Checking if the required levels already exists */
+
+  if( pyramid_.size() > 1 ) {
+    TEAGN_TRUE_OR_RETURN( 
+      ( ( level == pyramid_.size() ) || ( ( level + 1 ) == pyramid_.size() ) ),
+      "Invalid level" );
+  
+    if( ( level + 1 ) == pyramid_.size() ) {
+      if( ( pyramid_[ level ]( 0, 0 ).GetLines() == sblines ) &&
+        ( pyramid_[ level ]( 0, 0 ).GetColumns() == sbcolumns ) ) {
+        
+        return true;
+      }
+    }
+  } else {
+    TEAGN_TRUE_OR_RETURN( level == 1, "Invalid level" );
+  }
+  
+  /* Creating a dummy level 0 if necessary */
+  
+  if( pyramid_.size() == 0 ) {
+    TePDIMatrix<double> subband0;
+  
+    TePDIMatrix< TePDIMatrix< double > > levelzeromatrix; 
+    TEAGN_TRUE_OR_RETURN( levelzeromatrix.Reset( 1, 1 ), 
+      "Matrix reset error" );
+    levelzeromatrix( 0, 0 ) = subband0;
+  
+    pyramid_.push_back( levelzeromatrix );  
+  }
+  
+  /* Checking if the supplied level dimensions are correct */
+  
+  if( level > 1 ) {
+    sblines = ( unsigned int )
+      ceil( ( (double)pyramid_[ level - 1 ]( 0 , 0 ).GetLines() ) / 2 );
+    sbcolumns = ( unsigned int )
+      ceil( ( (double)pyramid_[ level - 1 ]( 0, 0 ).GetColumns() ) / 2 );           
+  } else {
+    TEAGN_TRUE_OR_RETURN( ( sblines > 0 ) && ( sbcolumns > 0 ),
+      "Number of lines and number of columns must not be zero" );
+  }
+  
+  /* Allocating the new level */
+      
+  TePDIMatrix< TePDIMatrix< double > > newlevel;
+  pyramid_.push_back( newlevel );
+  
+  if( ! pyramid_[ level ].Reset( 2, 2 ) ) {
+    pyramid_.pop_back();
+    TEAGN_LOG_AND_RETURN( 
+      "Unable to create level " + Te2String( level ) );
+  }
+  
+  /* Allocating the new sub-bands for the new level */
+  
+  TePDIMatrix< double > tempsb;
+  
+  pyramid_[ level ]( 0, 0 ) = tempsb;
+  pyramid_[ level ]( 0, 1 ) = tempsb;
+  pyramid_[ level ]( 1, 0 ) = tempsb;
+  pyramid_[ level ]( 1, 1 ) = tempsb;
+  
+    
+  if( pyramid_[ level ]( 0, 0 ).Reset( sblines, sbcolumns, 
+    TePDIMatrix<double>::AutoMemPol ) &&
+    pyramid_[ level ]( 0, 1 ).Reset( sblines, sbcolumns, 
+    TePDIMatrix<double>::AutoMemPol ) &&
+    pyramid_[ level ]( 1, 0 ).Reset( sblines, sbcolumns,
+    TePDIMatrix<double>::AutoMemPol ) &&
+    pyramid_[ level ]( 1, 1 ).Reset( sblines, sbcolumns,
+    TePDIMatrix<double>::AutoMemPol ) ) {
+    
+    /* Fill the new level with 0's */
+    {
+      TePDIMatrix< double >& sb00_ref = pyramid_[ level ]( 0, 0 );
+      TePDIMatrix< double >& sb01_ref = pyramid_[ level ]( 0, 1 );
+      TePDIMatrix< double >& sb10_ref = pyramid_[ level ]( 1, 0 );
+      TePDIMatrix< double >& sb11_ref = pyramid_[ level ]( 1, 1 );
+    
+      unsigned int line;
+      unsigned int col;
+      
+      for( line = 0 ; line < sblines ; ++line ) {
+        for( col = 0 ; col < sbcolumns ; ++col ) {
+          sb00_ref( line, col ) = 0;
+          sb01_ref( line, col ) = 0;
+          sb10_ref( line, col ) = 0;
+          sb11_ref( line, col ) = 0;
+        }
+      }
+    }
+    
+    return true;    
+  } else {
+    pyramid_.pop_back();
+    TEAGN_LOG_AND_RETURN( "Unable to allocate all sub-bands into pyramid" );
+  }
+}
+
+
+bool TePDIMallatWavelets::GetAFiltersShift( 
+  const std::vector< double >& a_lowfilter,
+  const std::vector< double >& a_highfilter,
+  int& lowshift, int& highshift ) const
+{
+  const unsigned int fsizel = a_lowfilter.size();
+  const unsigned int fsizeh = a_highfilter.size();
+  
+  TEAGN_TRUE_OR_RETURN( fsizel > 1, "Low Filter size < 2" );
+  TEAGN_TRUE_OR_RETURN( fsizeh > 1, "High Filter size < 2" );
+  
+  lowshift = ( fsizel - 1 ) / 2;
+  highshift = ( fsizeh - 1 ) / 2;
+  
+  if( lowshift <= highshift ) {
+    highshift = lowshift;
+  } 
+    
+  if( lowshift == 0 ) lowshift = 1;
+  if( highshift == 0 ) highshift = 1;
+  
+  /* This is for odd symstric filters with different lenghts */
+  
+  if( ( ( lowshift % 2 ) != 0 ) && ( ( highshift % 2 ) == 0 ) ) {
+    --lowshift;
+  }
+  
+  if( ( ( lowshift % 2 ) == 0 ) && ( ( highshift % 2 ) != 0 ) ) {
+    --highshift;
+  }
+  
+  /* This is for non-symmetrical filters */
+  
+  if( ( a_lowfilter[ 0 ] != a_lowfilter[ fsizel - 1 ] ) && 
+    ( ( fsizel % 2 ) == 0 ) ) {
+    
+    /* updating the lowshift with the index of the higher absolute value 
+       inside the low filter */
+       
+    bool hindex_found = false;
+    double lowf_hav = 0; /* higher absolute value inside low filter */
+    
+    for( unsigned int lindex = 0 ; lindex < fsizel ; ++lindex ) {
+      if( hindex_found ) {
+        if( ABS( a_lowfilter[ lindex ] ) > lowf_hav ) {
+          lowf_hav = ABS( a_lowfilter[ lindex ] );
+          lowshift = lindex;
+        }
+      } else {
+        hindex_found = true;
+        lowf_hav = ABS( a_lowfilter[ lindex ] );
+        lowshift = lindex;
+      }
+    }
+    
+    lowshift = fsizel - lowshift - 1;
+    highshift = fsizel - lowshift - 1;
+    
+    if( ( lowshift % 2 ) != ( highshift % 2 ) ) {
+      ++highshift;
+    }
+  }
+  
+  return true;
+}
+
+
+bool TePDIMallatWavelets::GetSFiltersShift( 
+  const std::vector< double >& a_lowfilter,
+  const std::vector< double >& a_highfilter,
+  const std::vector< double >& s_lowfilter,
+  const std::vector< double >& s_highfilter,
+  int& lowshift, int& highshift ) const
+{
+  const unsigned int afsizel = a_lowfilter.size();
+  const unsigned int afsizeh = a_highfilter.size();
+  const unsigned int sfsizel = s_lowfilter.size();
+  const unsigned int sfsizeh = s_highfilter.size();
+  
+  TEAGN_TRUE_OR_RETURN( afsizel > 1, "Analysis Low Filter size < 2" );
+  TEAGN_TRUE_OR_RETURN( afsizeh > 1, "Analysis High Filter size < 2" );
+  TEAGN_TRUE_OR_RETURN( sfsizel > 1, "Syntesis Low Filter size < 2" );
+  TEAGN_TRUE_OR_RETURN( sfsizeh > 1, "Syntesis High Filter size < 2" );
+  
+  lowshift = ( sfsizel - 1 ) / 2;
+  highshift = ( sfsizeh - 1 ) / 2;
+    
+  if( lowshift == 0 ) lowshift = 1;
+  if( highshift == 0 ) highshift = 1;
+  
+  /* This is for odd symstric filters with different lenghts */
+  
+  if( ( ( lowshift % 2 ) != 0 ) && ( ( highshift % 2 ) == 0 ) ) {
+    ++highshift;
+  }
+  
+  if( ( ( lowshift % 2 ) == 0 ) && ( ( highshift % 2 ) != 0 ) ) {
+    ++lowshift;
+  }
+  
+  /* General case for even lenght filters */
+  
+  if( ( ( afsizel % 2 ) == 0 ) && ( ( afsizeh % 2 ) == 0 ) &&
+      ( ( sfsizel % 2 ) == 0 ) && ( ( sfsizeh % 2 ) == 0 ) ) {
+      
+    ++lowshift;
+    ++highshift;
+  }
+  
+  /* This is for non-symmetrical filters */
+  
+  if( s_lowfilter[ 0 ] != s_lowfilter[ sfsizel - 1 ] ) {
+    
+    /* updating the lowshift with the index of the higher absolute value 
+       inside the low filter */
+    
+    bool hav_found = false;
+    double lowf_hav = 0; /* low filter highest value */
+    
+    for( unsigned int lindex = 0 ; lindex < sfsizel ; ++lindex ) {
+      if( hav_found ) {
+        if( ABS( s_lowfilter[ lindex ] ) > lowf_hav ) {
+          lowf_hav = ABS( s_lowfilter[ lindex ] );
+          lowshift = lindex;
+        }
+      } else {
+        hav_found = true;
+        lowf_hav = ABS( s_lowfilter[ lindex ] );
+        lowshift = lindex;
+      }
+    }
+    
+    lowshift = sfsizel - lowshift - 1;
+    highshift = sfsizel - lowshift - 2;
+    
+    if( ( lowshift % 2 ) != ( highshift % 2 ) ) {
+      --highshift;
+    }
+  }
+  
+  return true;
+}
+
+
+
+bool TePDIMallatWavelets::ReconstructLL( 
+  const TePDIMatrix< double >& sb00_in,
+  const TePDIMatrix< double >& sb01_in,
+  const TePDIMatrix< double >& sb10_in,
+  const TePDIMatrix< double >& sb11_in,
+  const std::vector< double >& s_low_filter,
+  const std::vector< double >& s_high_filter,
+  int lowshift, int highshift,
+  TePDIMatrix< double >& sb00_out ) const
+{
+  TEAGN_TRUE_OR_RETURN( ( ! sb00_out.IsEmpty() ), 
+    "Output sub-band ( 0 , 0 ) is empty" );
+    
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( sb00_in.GetLines() == sb01_in.GetLines() ) && 
+      ( sb01_in.GetLines() == sb10_in.GetLines() ) &&
+      ( sb10_in.GetLines() == sb11_in.GetLines() ) &&
+      ( sb00_in.GetColumns() == sb01_in.GetColumns() ) &&
+      ( sb01_in.GetColumns() == sb10_in.GetColumns() ) &&
+      ( sb10_in.GetColumns() == sb11_in.GetColumns() ) ), 
+    "Dimensions mismatch detected between input sub-bands" );
+    
+  /* Allocating space for temporary sub-bands */    
+    
+  TePDIMatrix< double > tempsb1;
+  TEAGN_TRUE_OR_RETURN( tempsb1.Reset( sb00_out.GetLines(), 
+    sb00_out.GetColumns(), TePDIMatrix<double>::AutoMemPol ), 
+    "Unable to allocate memory for temporary sub-band 1" );
+  
+  TePDIMatrix< double > tempsb2;
+  TEAGN_TRUE_OR_RETURN( tempsb2.Reset( sb00_out.GetLines(), 
+    sb00_out.GetColumns(), TePDIMatrix<double>::AutoMemPol ), 
+    "Unable to allocate memory for temporary sub-band 2" );
+    
+  /* Cleanning output data */
+  
+  for( unsigned int outline = 0 ; outline < sb00_out.GetLines() ; ++outline ) {
+    for( unsigned int outcolumn = 0 ; outcolumn < sb00_out.GetColumns() ; 
+      ++outcolumn ) {
+  
+       sb00_out( outline, outcolumn ) = 0.0;
+    }
+  }
+    
+  /* Processing sub-band [ 0, 0 ] */
+
+  TEAGN_TRUE_OR_RETURN( UpSampleMatrix( sb00_in, tempsb1 ), 
+    "Upsample error" );
+  TEAGN_TRUE_OR_RETURN( ApplyHorizontalRFilter( 
+    tempsb1, s_low_filter, lowshift, tempsb2 ), 
+    "Horizontal filter apply error" );
+  TEAGN_TRUE_OR_RETURN( ApplyVerticalRFilter( 
+    tempsb2, s_low_filter, lowshift, tempsb1 ), 
+    "Vertical filter apply error" );    
+  TEAGN_TRUE_OR_RETURN( AddMatrixes( tempsb1, sb00_out, sb00_out ), 
+    "Addition error" );    
+
+  /* Processing sub-band [ 0, 1 ] */
+
+  TEAGN_TRUE_OR_RETURN( UpSampleMatrix( sb01_in, tempsb1 ), 
+    "Upsample error" );
+  TEAGN_TRUE_OR_RETURN( ApplyHorizontalRFilter( 
+    tempsb1, s_low_filter, lowshift, tempsb2 ), 
+    "Horizontal filter apply error" );
+  TEAGN_TRUE_OR_RETURN( ApplyVerticalRFilter( 
+    tempsb2, s_high_filter, highshift, tempsb1 ), 
+    "Vertical filter apply error" );    
+  TEAGN_TRUE_OR_RETURN( AddMatrixes( tempsb1, sb00_out, sb00_out ), 
+    "Addition error" );    
+
+  /* Processing sub-band [ 1, 0 ] */
+
+  TEAGN_TRUE_OR_RETURN( UpSampleMatrix( sb10_in, tempsb1 ), 
+    "Upsample error" );
+  TEAGN_TRUE_OR_RETURN( ApplyHorizontalRFilter( 
+    tempsb1, s_high_filter, highshift, tempsb2 ), 
+    "Horizontal filter apply error" );
+  TEAGN_TRUE_OR_RETURN( ApplyVerticalRFilter( 
+    tempsb2, s_low_filter, lowshift, tempsb1 ), 
+    "Vertical filter apply error" );    
+  TEAGN_TRUE_OR_RETURN( AddMatrixes( tempsb1, sb00_out, sb00_out ), 
+    "Addition error" );      
+
+  /* Processing sub-band [ 1, 1 ] */
+
+  TEAGN_TRUE_OR_RETURN( UpSampleMatrix( sb11_in, tempsb1 ), 
+    "Upsample error" );
+  TEAGN_TRUE_OR_RETURN( ApplyHorizontalRFilter( 
+    tempsb1, s_high_filter, highshift, tempsb2 ), 
+    "Horizontal filter apply error" );
+  TEAGN_TRUE_OR_RETURN( ApplyVerticalRFilter( 
+    tempsb2, s_high_filter, highshift, tempsb1 ), 
+    "Vertical filter apply error" );    
+  TEAGN_TRUE_OR_RETURN( AddMatrixes( tempsb1, sb00_out, sb00_out ), 
+    "Addition error" );
+
+  return true;
+}
+
+
+bool TePDIMallatWavelets::UpSampleMatrix( const TePDIMatrix< double >& in,
+  TePDIMatrix< double >& out ) const
+{
+  TEAGN_TRUE_OR_RETURN( ( ! out.IsEmpty() ), 
+    "Invalid output matrix" );
+    
+  const unsigned int outlines = out.GetLines();
+  const unsigned int outcolumns = out.GetColumns();
+  
+  const unsigned int inlines = in.GetLines();
+  const unsigned int incolumns = in.GetColumns();
+  
+  const unsigned int required_out_lines = ( 2 * ( inlines - 1 ) ) + 1;
+  const unsigned int required_out_columns = ( 2 * ( incolumns - 1 ) ) + 1;
+  
+  TEAGN_TRUE_OR_RETURN( ( outlines >= required_out_lines ), 
+    "Insuficient output lines" );
+  TEAGN_TRUE_OR_RETURN( ( outcolumns >= required_out_columns ), 
+    "Insuficient output columns" );
+    
+  unsigned int line;
+  unsigned int column;
+  
+  /* Cleanning output matrix */
+
+  for( line = 0 ; line < outlines ; ++line ) {
+    for( column = 0 ; column < outcolumns ; ++column ) {
+      out( line, column ) = 0.;
+    }
+  }
+    
+  /* Transfering values to output */
+  
+  for( line = 0 ; line < inlines ; ++line ) {
+    for( column = 0 ; column < incolumns ; ++column ) {
+       out( line * 2, column * 2 ) = in( line, column ) * 4;
+    }
+  }   
+  
+  return true; 
+}
+
+
+bool TePDIMallatWavelets::AddMatrixes( const TePDIMatrix< double >& in1,
+  const TePDIMatrix< double >& in2, TePDIMatrix< double >& res ) const
+{
+  TEAGN_TRUE_OR_RETURN( in1.GetLines() == in2.GetLines(),
+    "in1 lines != in2 lines" );
+  TEAGN_TRUE_OR_RETURN( in1.GetColumns() == in2.GetColumns(),
+    "in1 columns != in2 columns" );
+  
+  TEAGN_TRUE_OR_RETURN( in1.GetLines() == res.GetLines(),
+    "in1 lines != res lines" );
+  TEAGN_TRUE_OR_RETURN( in1.GetColumns() == res.GetColumns(),
+    "in1 columns != res columns" );
+        
+  const unsigned int lines = in1.GetLines();
+  const unsigned int columns = in1.GetColumns();
+  
+  unsigned int line;
+  unsigned int column;
+  
+  for( line = 0 ; line < lines ; ++line ) {
+    for( column = 0 ; column < columns ; ++column ) {
+      res( line, column ) = in1( line, column ) + in2( line, column );
+    }
+  } 
+  
+  return true;   
+}
+
+
+bool TePDIMallatWavelets::ApplyVerticalRFilter( 
+  const TePDIMatrix< double >& inMatrix, 
+  const std::vector< double >& filter,
+  int filter_shift,
+  TePDIMatrix< double >& outMatrix ) const
+{
+  TEAGN_TRUE_OR_RETURN( inMatrix.GetLines() == outMatrix.GetLines(),
+    "inMatrix lines != outMatrix lines" );
+  TEAGN_TRUE_OR_RETURN( inMatrix.GetColumns() == outMatrix.GetColumns(),
+    "inMatrix columns != outMatrix columns" );
+  TEAGN_TRUE_OR_RETURN( inMatrix.GetLines() > filter.size(),
+    "inMatrix lines < filter size" );
+
+  const unsigned int in_lines = inMatrix.GetLines();
+  const unsigned int in_columns = inMatrix.GetColumns();
+  const unsigned int filter_size = filter.size();
+  unsigned int virtual_in_line_start = filter_size - 1;
+  unsigned int virtual_in_lines_bound = in_lines + virtual_in_line_start;  
+  
+  unsigned int virtual_in_line;
+  unsigned int in_column;
+  unsigned int filter_index;
+  double out_level;
+  int ircli; /* input raster convolution line index */
+  
+  for( in_column = 0 ; in_column < in_columns ; ++in_column ) {
+       
+    for( virtual_in_line = virtual_in_line_start ; 
+         virtual_in_line < virtual_in_lines_bound ; 
+         ++virtual_in_line ) {
+    
+      out_level = 0;  
+    
+      for( filter_index = 0 ; filter_index < filter_size ; ++filter_index ) {
+        
+        ircli = ( virtual_in_line - filter_index ) % in_lines;
+        
+        if( ircli % 2 == 0 ) {
+          out_level += 
+            inMatrix( ircli, in_column ) * filter[ filter_index ];
+        }
+      }
+      
+      outMatrix( ( virtual_in_line - virtual_in_line_start + 
+        filter_shift ) % in_lines, in_column ) = out_level;
+    }
+  }
+  
+  return true;
+}
+
+
+bool TePDIMallatWavelets::ApplyHorizontalRFilter( 
+  const TePDIMatrix< double >& inMatrix,
+  const std::vector< double >& filter,
+  int filter_shift,
+  TePDIMatrix< double >& outMatrix ) const
+{
+  TEAGN_TRUE_OR_RETURN( inMatrix.GetColumns() == outMatrix.GetColumns(),
+    "inMatrix columns != outMatrix columns" );
+  TEAGN_TRUE_OR_RETURN( inMatrix.GetLines() == outMatrix.GetLines(),
+    "inMatrix lines != outMatrix lines" );
+  TEAGN_TRUE_OR_RETURN( inMatrix.GetColumns() > filter.size(),
+    "inMatrix columns < filter size" );
+
+  const unsigned int in_lines = inMatrix.GetLines();
+  const unsigned int in_columns = inMatrix.GetColumns();
+  const unsigned int filter_size = filter.size();
+  unsigned int virtual_in_column_start = filter_size - 1;
+  unsigned int virtual_in_columns_bound = in_columns + virtual_in_column_start;
+  
+  unsigned int virtual_in_column;
+  unsigned int in_line;
+  unsigned int filter_index;
+  double out_level;
+  int ircci; /* input raster convolution column index */
+  
+  for( in_line = 0 ; in_line < in_lines ; in_line += 2 ) {
+       
+    for( virtual_in_column = virtual_in_column_start ; 
+         virtual_in_column < virtual_in_columns_bound ; 
+         ++virtual_in_column ) {
+    
+      out_level = 0;  
+    
+      for( filter_index = 0 ; filter_index < filter_size ; ++filter_index ) {
+        
+        ircci = ( virtual_in_column - filter_index ) % in_columns;
+        
+        if( ircci % 2 == 0 ) {
+          out_level += 
+            inMatrix( in_line, ircci ) * filter[ filter_index ];
+        }
+      }
+      
+      outMatrix( in_line, ( virtual_in_column - virtual_in_column_start + 
+        filter_shift ) % in_columns ) = out_level;
+    }
+  }
+  
+  return true;
+}
+
+
+bool TePDIMallatWavelets::GetAnalysisFilters( std::vector< double >& low_filter,
+  std::vector< double >& high_filter, int& low_shift, int& high_shift,
+  const TePDIParameters& params ) const
+{
+  /* Retriving the analysis filters and normalizing */
+  
+  double filters_scale = 0;
+  params.GetParameter( "filters_scale", filters_scale );  
+  
+  params.GetParameter( "a_filter_l", low_filter );
+    
+  params.GetParameter( "a_filter_h", high_filter );
+  
+  double factor = sqrt( 2.0 ) * sqrt( filters_scale );
+  
+  for( unsigned int a_filter_l_i = 0 ; a_filter_l_i < low_filter.size() ;
+       ++a_filter_l_i ) {
+       
+       low_filter[ a_filter_l_i ] *= factor;
+  }
+  
+  for( unsigned int a_filter_h_i = 0 ; a_filter_h_i < high_filter.size() ;
+       ++a_filter_h_i ) {
+       
+       high_filter[ a_filter_h_i ] *= factor;
+  }  
+  
+  /* Calculating filters shift */
+  
+  TEAGN_TRUE_OR_RETURN( GetAFiltersShift( low_filter, high_filter, low_shift, 
+    high_shift ), "Unable to calculate filters shift" );
+    
+  return true;
+}
+
+
+bool TePDIMallatWavelets::GetSynthesisFilters( std::vector< double >& low_filter,
+  std::vector< double >& high_filter, int& low_shift, int& high_shift,
+  const TePDIParameters& params ) const
+{
+  /* Retriving the analysis filters */
+  
+  std::vector< double > a_low_filter;
+  std::vector< double > a_high_filter;
+  int a_low_shift;
+  int a_high_shift;
+  
+  TEAGN_TRUE_OR_RETURN( GetAnalysisFilters( a_low_filter, a_high_filter,
+    a_low_shift, a_high_shift, params ), "Unable to get analysis filters" );
+    
+  /* Retriving the synthesis filters */
+  
+  double filters_scale = 0;
+  params.GetParameter( "filters_scale", filters_scale );  
+  
+  params.GetParameter( "s_filter_l", low_filter );
+    
+  params.GetParameter( "s_filter_h", high_filter );
+  
+  double factor = 1 / ( sqrt( 2.0 ) * sqrt( filters_scale ) );
+  
+  for( unsigned int s_filter_l_i = 0 ; s_filter_l_i < low_filter.size() ;
+       ++s_filter_l_i ) {
+       
+       low_filter[ s_filter_l_i ] *= factor;
+  }
+  
+  for( unsigned int s_filter_h_i = 0 ; s_filter_h_i < high_filter.size() ;
+       ++s_filter_h_i ) {
+       
+       high_filter[ s_filter_h_i ] *= factor;
+  }  
+  
+  /* Calculating filters shift */
+  
+  TEAGN_TRUE_OR_RETURN( GetSFiltersShift( a_low_filter, a_high_filter,
+    low_filter, high_filter, low_shift, high_shift ), 
+    "Unable to calculate filters shift" );
+    
+  return true;
+}
+
+
+bool TePDIMallatWavelets::NormalizeMatrix( 
+    const TePDIMatrix< double >& input, 
+    TePDIMatrix< double >& output, double min, double max ) const
+{
+  TEAGN_TRUE_OR_RETURN( min < max, "Invalid range" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( ( max / 4. ) - ( min / 4. ) ) < ( DBL_MAX / 2. ) ),
+    "min and max are out of allowed range" );
+      
+  TEAGN_TRUE_OR_RETURN( ( input.GetLines() == output.GetLines() ),
+    "input lines != output lines" );
+  TEAGN_TRUE_OR_RETURN( ( input.GetColumns() == output.GetColumns() ),
+    "input columns != output columns" );
+  
+  const unsigned int lines = input.GetLines();
+  const unsigned int columns = input.GetColumns();
+    
+  if( ( lines == 0 ) || ( columns == 0 ) ) {
+    return true;
+  }
+    
+  unsigned int line;
+  unsigned int column;
+  double value;   
+    
+  /* Finding the current min and max */
+  
+  double cmin = input( 0, 0 );
+  double cmax = cmin;
+    
+  for( line = 0 ; line < lines ; ++line ) {
+    for( column = 0 ; column < columns ; ++column ) {
+      value = input( line, column );
+      
+      if( value < cmin ) {
+        cmin = value;
+      }
+      if( value > cmax ) {
+        cmax = value;
+      }
+    }
+  }
+    
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( ( cmax / 4. ) - ( cmin / 4. ) ) < ( DBL_MAX / 2. ) ),
+    "current image min and max are out of allowed range" );
+    
+  double offset = min - cmin;
+  double scale = ( cmax - cmin ) / ( max - min );
+    
+  if( scale == 0 ) return true;
+    
+  /* Remapping values */
+      
+  for( line = 0 ; line < lines ; ++line ) {
+    for( column = 0 ; column < columns ; ++column ) {
+      output( line, column ) = ( input( line, column ) / scale ) + offset;
+    }
+  }
+    
+  return true;
+}  
+
+
+
diff --git a/src/terralib/image_processing/TePDIMallatWavelets.hpp b/src/terralib/image_processing/TePDIMallatWavelets.hpp
index 5748035..db1c0ba 100644
--- a/src/terralib/image_processing/TePDIMallatWavelets.hpp
+++ b/src/terralib/image_processing/TePDIMallatWavelets.hpp
@@ -1,485 +1,485 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMALLATWAVELETS_HPP
-  #define TEPDIMALLATWAVELETS_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIMatrix.hpp"
-
-  /**
-   * @brief Mallat wavelts algorithm.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIWaveletsAlgorithms
-   *
-   * @note The general required parameters:
-   *
-   * @param filter_task ( std::string ) - Task to be 
-   * accomplished - see below.
-   * @param filters_scale ( double ) - The filters scale.
-   * @param a_filter_l ( std::vector< double > ) - Analysis filter, low pass, non
-   * normalized ( used in decomposition ).
-   * @param a_filter_h ( std::vector< double > ) - Analysis filter, high pass, non
-   * normalized ( used in decomposition ).
-   * @param s_filter_l ( std::vector< double > ) - Synthesis filter, low pass, non
-   * normalized ( used in recomposition ).
-   * @param s_filter_h ( std::vector< double > ) - Synthesis filter, high pass, non
-   * normalized ( used in recomposition ). 
-   *
-   * @note The input parameters for filter_task="SBExtract" are:
-   * 
-   * @param input_image ( TePDITypes::TePDIRasterPtrType ) - Input Image.
-   * @param band ( int ) - Input band from input_image.   
-   * @param sub_band ( TePDITypes::TePDIRasterPtrType ) - The extracted  
-   * sub-band raster reference.
-   * @param sub_band_index ( int ) - Sub-band index [ 0, 1, 2, 3 ].
-   * @param levels ( int ) - The number of decomposition levels.
-   *
-   * @note The input parameters for filter_task="SBSwap" are:
-   *
-   * @param input_image ( TePDITypes::TePDIRasterPtrType ) - Input Image.
-   * @param band ( int ) - Input band from input_image.   
-   * @param output_image ( TePDITypes::TePDIRasterPtrType ) - Output Image.
-   * @param sub_band ( TePDITypes::TePDIRasterPtrType ) - The new  
-   * sub-band raster reference.
-   * @param sub_band_index ( int ) - Sub-band index [ 0, 1, 2, 3 ].
-   * @param levels ( int ) - The number of decomposition levels.
-   *
-   * @note The input parameters for filter_task="GetPyramid" are:
-   * 
-   * @param input_image ( TePDITypes::TePDIRasterPtrType ) - Input Image.
-   * @param band ( int ) - Input band from input_image.   
-   * @param sub_band ( TePDITypes::TePDIRasterPtrType ) - The extracted  
-   * sub-band raster reference.
-   * @param sub_band_index ( int ) - Sub-band index [ 0, 1, 2, 3 ].
-   * @param levels ( int ) - The number of decomposition levels.
-   * @param pyramid ( TePDITypes::TePDIRasterVectorPtrType ) - The generated
-   * pyramid following the format :
-   * [raster0][raster1][raster2][raster3]....[raster( levels*4 - 1 )]
-   * where: raster0->sub-band00 of level1, raster1->sub-band01 of level1,
-   * raster2->sub-band10 of level1, raster3->sub-band11 of level1,
-   * raster4->sub-band00 of level2,  ....., raster(n-1)->sub-band11 of the
-   * last level.
-   *
-   * @note The input parameters for filter_task="RecomposePyramid" are:
-   * 
-   * @param input_image ( TePDITypes::TePDIRasterPtrType - Optional ):
-   * Reference Input Image.
-   * @param band ( int - Optional ) - Input band from input_image.   
-   * @param pyramid ( TePDITypes::TePDIRasterVectorPtrType ) - The input
-   * pyramid following the format:
-   * [raster0][raster1][raster2][raster3]....[raster( levels*4 - 1 )]
-   * where: raster0->sub-band00 of level1, raster1->sub-band01 of level1,
-   * raster2->sub-band10 of level1, raster3->sub-band11 of level1,
-   * raster4->sub-band00 of level2,  ....., raster(n-1)->sub-band11 of the
-   * last level.
-   * @param output_image ( TePDITypes::TePDIRasterPtrType ) - Output Image.
-   *
-   * @note Each decomposed level will follow the structure ( matricial indexes ):
-   * index 0 = [ 0, 0 ] = Low-Low filtered - upper-left .
-   * index 1 = [ 0, 1 ] = Low-High filtered - upper-right.
-   * index 2 = [ 1, 0 ] = High-Low filtered - bottom-left.
-   * index 3 = [ 1, 1 ] = High-High filtered - bottom-right.
-   *
-   */
-  class PDI_DLL TePDIMallatWavelets : public TePDIAlgorithm {
-    public :
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIMallatWavelets();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIMallatWavelets();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-
-      /**
-       * @brief Histogram shift flag.
-       *
-       */
-      bool shift_histogram_flag_;
-      
-      /**
-       * @brief The input image mean ( used for histogram shift ).
-       *
-       */
-      double input_image_mean_;
-    
-      /**
-       * @brief Internal pyramidal structure of decomposed bands.
-       *
-       * @note The index 0 corresponds to the full original input image.
-       */
-      mutable std::vector< TePDIMatrix< TePDIMatrix< double > > > pyramid_;    
-    
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial 
-       * state.
-       */
-      void ResetState( const TePDIParameters& params );
-      
-      /**
-       * @brief Do Wavelet decomposition using input_image and levels number 
-       * parameters.
-       *
-       * @note No output image will be generated by this function. 
-       * To decompose and generate output image use Apply()
-       * ( using Apply() the generated image will be
-       * saved inside the output_image parameter );
-       *
-       * @param params The current strategy parameters reference.
-       * @return true if no erros ocurred.
-       */
-      bool Decompose( const TePDIParameters& params );
-      
-      /**
-       * @brief Do Wavelet recomposition to output_image parameter and the current
-       * internal state.
-       *
-       * @note If a input_image exists, it will be used to guess the
-       * recomposed image dimensions.
-       *
-       * @param ref_level The reference level used for image reconstruction
-       * ( starting from 1 ), this level will be used to reconstruct the
-       * first LL sub-band used by the other levels.
-       * @param params The current strategy parameters reference.
-       * @return true if no erros ocurred.
-       */
-      bool Recompose( unsigned int ref_level, const TePDIParameters& params );
-
-      /**
-       * @brief Returns a copy of one genereted sub-band.
-       *
-       * @param level Sub-band decomposition level ( starting from 1 ).
-       * @param subband Sub-band index [ 0 - top left, 1 - top right, 
-       * 2 - bottom left, 3 - bottom right ].
-       * @param sb_raster The raster where the sub-band data will be copied.
-       * @return true if ok, false on errors.
-       */
-      bool GetSubBand( unsigned int level, 
-        unsigned int subband, 
-        const TePDITypes::TePDIRasterPtrType& sb_raster ) const;
-        
-      /**
-       * @brief Change one genereted sub-band by another one.
-       *
-       * @note Both sub-bands must have the same number of lines and
-       * columns.
-       *
-       * @param level Sub-band decomposition level ( starting from 1 ).
-       * @param subband_index Old Sub-band index 
-       * [ 0 - top left, 1 - top right, 2 - bottom left, 3 - bottom right ].
-       * @param newsband The new sub-band data.
-       * @return true if ok, false on errors.
-       */        
-      bool ChangeSubBand( unsigned int level, unsigned int subband_index,
-        const TePDITypes::TePDIRasterPtrType& newsband );
-        
-        
-      /**
-       * @brief Push a new level at pyramid level's top.
-       *
-       * @param level Sub-band level ( starting from 1 ).
-       * @param sb0 Sub-band 0 ( top left ) data. 
-       * @param sb1 Sub-band 1 ( top right ) data. 
-       * @param sb2 Sub-band 2 ( bottom left ) data. 
-       * @param sb3 Sub-band 3 ( bottom right ) data. 
-       * @return true if ok, false on errors.
-       */           
-      bool PushLevel( unsigned int level, 
-        const TePDIMatrix< double >& sb0,
-        const TePDIMatrix< double >& sb1,
-        const TePDIMatrix< double >& sb2,
-        const TePDIMatrix< double >& sb3 );      
-      
-      /**
-       * @brief Retrive the analysis filters from the internal parameters.
-       *
-       * @param low_filter The low filter.
-       * @param high_filter The high filter.
-       * @param low_shift The low filter shift.
-       * @param high_shift The high filter shift.
-       * @param params The current strategy parameters reference.
-       * @return true if ok, false on errors.
-       */
-      bool GetAnalysisFilters( std::vector< double >& low_filter,
-        std::vector< double >& high_filter,
-        int& low_shift,
-        int& high_shift,
-        const TePDIParameters& params ) const;
-      
-      /**
-       * @brief Retrive the synthesis filters from the internal parameters.
-       *
-       * @param low_filter The low filter.
-       * @param high_filter The high filter.
-       * @param low_shift The low filter shift.
-       * @param high_shift The high filter shift.
-       * @param params The current strategy parameters reference.
-       * @return true if ok, false on errors.
-       */
-      bool GetSynthesisFilters( std::vector< double >& low_filter,
-        std::vector< double >& high_filter,
-        int& low_shift,
-        int& high_shift,
-        const TePDIParameters& params ) const;        
-        
-      /**
-       * @brief Generates one level of Wavelet decomposition, using the data from
-       * the preceding level.
-       *
-       * @param level Decomposition level ( starting from 1 ).
-       * @param params The current strategy parameters reference.
-       * @return true if ok, false on errors.
-       */
-      bool GenerateLevel( unsigned int level, const TePDIParameters& params );
-      
-      /**
-       * @brief Applies a vertical filter.
-       *
-       * @param inMatrix Input matrix.
-       * @param filter Filter to apply.
-       * @param filter_shift Filter shift.
-       * @param outMatrix Output matrix.
-       */
-      void ApplyVerticalFilter( 
-        const TePDIMatrix< double >& inMatrix,
-        const std::vector< double >& filter,
-        int filter_shift,
-        TePDIMatrix< double >& outMatrix ) const;
-        
-      /**
-       * @brief Applies a horizontal filter.
-       *
-       * @param inMatrix Input matrix.
-       * @param filter Filter to apply.
-       * @param filter_shift Filter shift.
-       * @param outMatrix Output matrix.
-       */
-      void ApplyHorizontalFilter( 
-        const TePDIMatrix< double >& inMatrix,
-        const std::vector< double >& filter,
-        int filter_shift, 
-        TePDIMatrix< double >& outMatrix ) const;    
-        
-      /**
-       * @brief Recursive build of a simperimposed level ( 
-       * a level where the sub-band 0 is a
-       * composition of all higher levels ).
-       *
-       * @param level Decomposition level ( starting from 1 ).
-       * @param level_matrix The user pre-initiated resultant level matrix.
-       * @param normalize If true, grayscale level normalization will be 
-       * performed.
-       * @param min_norm_level Minimal grayscale level used for 
-       * grayscale range normalization.
-       * @param max_norm_level Maximum grayscale level used for 
-       * grayscale range normalization.
-       * @return true if ok, false on error.
-       */
-      bool BuildSuperimposedLevel( unsigned int level,
-        TePDIMatrix< double >& level_matrix, bool normalize = false,
-        double min_norm_level = 0, double max_norm_level = 0 ) const;
-      
-      /**
-       * @brief Build a agregated matrix using 4 sub-bands of identical dimensions.
-       *
-       * @param upper_left Uppper-left sub-band.
-       * @param upper_right Uppper-right sub-band.
-       * @param lower_left Lower-left sub-band.
-       * @param lower_right Lower-right sub-band.
-       * @param result The user pre-initiated result matrix where all data 
-       * will be stored.
-       * @return true if ok, false on error.
-       */          
-      bool AgregateSubBands(
-        const TePDIMatrix< double >& upper_left,
-        const TePDIMatrix< double >& upper_right,
-        const TePDIMatrix< double >& lower_left,
-        const TePDIMatrix< double >& lower_right,
-        TePDIMatrix< double >& result ) const;
-        
-      /**
-       * @brief Allocate space for a new level at pyrimid's top.
-       * @param level Level number.
-       * @param sblines Sub-bands lines number 
-       * ( only required if level == 1 ).
-       * @param sbcolumns Sub-bands columns number 
-       * ( only required if level == 1 ).
-       * @return true if ok, false on error.
-       */      
-      bool AllocateTopLevel( unsigned int level, unsigned int sblines = 0,
-        unsigned int sbcolumns = 0 );
-        
-      /**
-       * @brief Compute the analysis inversed filters reference shift ( offset ).
-       *
-       * @param a_lowfilter The analysis low filter reference.
-       * @param a_highfilter The analysis high filter reference.
-       * @param lowshift The computed shift for lowfilter.
-       * @param highshift The computed shift for highfilter.
-       * @return true if ok, false on errors.
-       */      
-      bool GetAFiltersShift( 
-        const std::vector< double >& a_lowfilter,
-        const std::vector< double >& a_highfilter,
-        int& lowshift, int& highshift ) const;
-        
-      /**
-       * @brief Compute the syntesis inversed filters reference shift ( offset ).
-       *
-       * @param s_lowfilter The syntesis low filter reference.
-       * @param s_highfilter The syntesis high filter reference.
-       * @param a_lowfilter The analysis low filter reference.
-       * @param a_highfilter The analysis high filter reference.
-       * @param lowshift The computed shift for lowfilter.
-       * @param highshift The computed shift for highfilter.
-       * @return true if ok, false on errors.
-       */      
-      bool GetSFiltersShift( 
-        const std::vector< double >& a_lowfilter,
-        const std::vector< double >& a_highfilter,
-        const std::vector< double >& s_lowfilter,
-        const std::vector< double >& s_highfilter,
-        int& lowshift, int& highshift ) const;        
-
-      /**
-       * @brief Reconstruct the Low-low ( 0, 0 ) sub-band.
-       *
-       * @param sb00_in A reference to the input sub-band ( 0, 0 ).
-       * @param sb01_in A reference to the input sub-band ( 0, 1 ).
-       * @param sb10_in A reference to the input sub-band ( 1, 0 ).
-       * @param sb11_in A reference to the input sub-band ( 1, 1 ).
-       * @param s_low_filter Low Synthesis filter.
-       * @param s_high_filter High Synthesis filter.
-       * @param lowshift Low filter shift.
-       * @param highshift High filter shift.
-       * @param sb00_out A reference to the generated sub-band ( user 
-       * initiated matrix ).
-       * @return true if ok, false on errors.
-       */                   
-      bool ReconstructLL( 
-        const TePDIMatrix< double >& sb00_in,
-        const TePDIMatrix< double >& sb01_in,
-        const TePDIMatrix< double >& sb10_in,
-        const TePDIMatrix< double >& sb11_in,
-        const std::vector< double >& s_low_filter,
-        const std::vector< double >& s_high_filter,
-        int lowshift, int highshift,
-        TePDIMatrix< double >& sb00_out ) const;
-        
-      /**
-       * @brief Up-samples a matrix.
-       *
-       * @param in Input matrix.
-       * @param out A user initiated output matrix.
-       * @return true if ok, false on errors.
-       */        
-      bool UpSampleMatrix( const TePDIMatrix< double >& in,
-        TePDIMatrix< double >& out ) const;
-        
-      /**
-       * @brief Matrix addition.
-       *
-       * @param in1 Input matrix 1.
-       * @param in2 Input matrix 2.
-       * @param res Result matrix.
-       * @return true if ok, false on errors.
-       */        
-      bool AddMatrixes( const TePDIMatrix< double >& in1,
-        const TePDIMatrix< double >& in2, TePDIMatrix< double >& res ) const;  
-        
-      /**
-       * @brief Applies a reconstruction vertical filter.
-       *
-       * @param inMatrix A Input matrix filtered with ApplyHorizontalRFilter.
-       * @param filter Filter to apply.
-       * @param filter_shift Filter shift.
-       * @param outMatrix Output matrix.
-       * @return true if ok, false on errors.
-       */
-      bool ApplyVerticalRFilter( 
-        const TePDIMatrix< double >& inMatrix,
-        const std::vector< double >& filter,
-        int filter_shift,
-        TePDIMatrix< double >& outMatrix ) const;
-        
-      /**
-       * @brief Applies a reconstruction horizontal filter.
-       *
-       * @param inMatrix An upsampled Input matrix.
-       * @param filter Filter to apply.
-       * @param filter_shift Filter shift.
-       * @param outMatrix Output matrix.
-       * @return true if ok, false on errors.
-       */
-      bool ApplyHorizontalRFilter( 
-        const TePDIMatrix< double >& inMatrix,
-        const std::vector< double >& filter,
-        int filter_shift,
-        TePDIMatrix< double >& outMatrix ) const;    
-        
-      /**
-       * @brief Do matrix normalization using the supplied ranges.
-       *
-       * @param input The input matrix.
-       * @param output The output matrix.
-       * @param min The mininum reference value.
-       * @param max The maxumum reference value.
-       */      
-      bool NormalizeMatrix( const TePDIMatrix< double >& input, 
-        TePDIMatrix< double >& output, double min, 
-        double max ) const;      
-  };
-  
-/** @example TePDIWavelets_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMALLATWAVELETS_HPP
+  #define TEPDIMALLATWAVELETS_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIMatrix.hpp"
+
+  /**
+   * @brief Mallat wavelts algorithm.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIWaveletsAlgorithms
+   *
+   * @note The general required parameters:
+   *
+   * @param filter_task ( std::string ) - Task to be 
+   * accomplished - see below.
+   * @param filters_scale ( double ) - The filters scale.
+   * @param a_filter_l ( std::vector< double > ) - Analysis filter, low pass, non
+   * normalized ( used in decomposition ).
+   * @param a_filter_h ( std::vector< double > ) - Analysis filter, high pass, non
+   * normalized ( used in decomposition ).
+   * @param s_filter_l ( std::vector< double > ) - Synthesis filter, low pass, non
+   * normalized ( used in recomposition ).
+   * @param s_filter_h ( std::vector< double > ) - Synthesis filter, high pass, non
+   * normalized ( used in recomposition ). 
+   *
+   * @note The input parameters for filter_task="SBExtract" are:
+   * 
+   * @param input_image ( TePDITypes::TePDIRasterPtrType ) - Input Image.
+   * @param band ( int ) - Input band from input_image.   
+   * @param sub_band ( TePDITypes::TePDIRasterPtrType ) - The extracted  
+   * sub-band raster reference.
+   * @param sub_band_index ( int ) - Sub-band index [ 0, 1, 2, 3 ].
+   * @param levels ( int ) - The number of decomposition levels.
+   *
+   * @note The input parameters for filter_task="SBSwap" are:
+   *
+   * @param input_image ( TePDITypes::TePDIRasterPtrType ) - Input Image.
+   * @param band ( int ) - Input band from input_image.   
+   * @param output_image ( TePDITypes::TePDIRasterPtrType ) - Output Image.
+   * @param sub_band ( TePDITypes::TePDIRasterPtrType ) - The new  
+   * sub-band raster reference.
+   * @param sub_band_index ( int ) - Sub-band index [ 0, 1, 2, 3 ].
+   * @param levels ( int ) - The number of decomposition levels.
+   *
+   * @note The input parameters for filter_task="GetPyramid" are:
+   * 
+   * @param input_image ( TePDITypes::TePDIRasterPtrType ) - Input Image.
+   * @param band ( int ) - Input band from input_image.   
+   * @param sub_band ( TePDITypes::TePDIRasterPtrType ) - The extracted  
+   * sub-band raster reference.
+   * @param sub_band_index ( int ) - Sub-band index [ 0, 1, 2, 3 ].
+   * @param levels ( int ) - The number of decomposition levels.
+   * @param pyramid ( TePDITypes::TePDIRasterVectorPtrType ) - The generated
+   * pyramid following the format :
+   * [raster0][raster1][raster2][raster3]....[raster( levels*4 - 1 )]
+   * where: raster0->sub-band00 of level1, raster1->sub-band01 of level1,
+   * raster2->sub-band10 of level1, raster3->sub-band11 of level1,
+   * raster4->sub-band00 of level2,  ....., raster(n-1)->sub-band11 of the
+   * last level.
+   *
+   * @note The input parameters for filter_task="RecomposePyramid" are:
+   * 
+   * @param input_image ( TePDITypes::TePDIRasterPtrType - Optional ):
+   * Reference Input Image.
+   * @param band ( int - Optional ) - Input band from input_image.   
+   * @param pyramid ( TePDITypes::TePDIRasterVectorPtrType ) - The input
+   * pyramid following the format:
+   * [raster0][raster1][raster2][raster3]....[raster( levels*4 - 1 )]
+   * where: raster0->sub-band00 of level1, raster1->sub-band01 of level1,
+   * raster2->sub-band10 of level1, raster3->sub-band11 of level1,
+   * raster4->sub-band00 of level2,  ....., raster(n-1)->sub-band11 of the
+   * last level.
+   * @param output_image ( TePDITypes::TePDIRasterPtrType ) - Output Image.
+   *
+   * @note Each decomposed level will follow the structure ( matricial indexes ):
+   * index 0 = [ 0, 0 ] = Low-Low filtered - upper-left .
+   * index 1 = [ 0, 1 ] = Low-High filtered - upper-right.
+   * index 2 = [ 1, 0 ] = High-Low filtered - bottom-left.
+   * index 3 = [ 1, 1 ] = High-High filtered - bottom-right.
+   *
+   */
+  class PDI_DLL TePDIMallatWavelets : public TePDIAlgorithm {
+    public :
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIMallatWavelets();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIMallatWavelets();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+
+      /**
+       * @brief Histogram shift flag.
+       *
+       */
+      bool shift_histogram_flag_;
+      
+      /**
+       * @brief The input image mean ( used for histogram shift ).
+       *
+       */
+      double input_image_mean_;
+    
+      /**
+       * @brief Internal pyramidal structure of decomposed bands.
+       *
+       * @note The index 0 corresponds to the full original input image.
+       */
+      mutable std::vector< TePDIMatrix< TePDIMatrix< double > > > pyramid_;    
+    
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial 
+       * state.
+       */
+      void ResetState( const TePDIParameters& params );
+      
+      /**
+       * @brief Do Wavelet decomposition using input_image and levels number 
+       * parameters.
+       *
+       * @note No output image will be generated by this function. 
+       * To decompose and generate output image use Apply()
+       * ( using Apply() the generated image will be
+       * saved inside the output_image parameter );
+       *
+       * @param params The current strategy parameters reference.
+       * @return true if no erros ocurred.
+       */
+      bool Decompose( const TePDIParameters& params );
+      
+      /**
+       * @brief Do Wavelet recomposition to output_image parameter and the current
+       * internal state.
+       *
+       * @note If a input_image exists, it will be used to guess the
+       * recomposed image dimensions.
+       *
+       * @param ref_level The reference level used for image reconstruction
+       * ( starting from 1 ), this level will be used to reconstruct the
+       * first LL sub-band used by the other levels.
+       * @param params The current strategy parameters reference.
+       * @return true if no erros ocurred.
+       */
+      bool Recompose( unsigned int ref_level, const TePDIParameters& params );
+
+      /**
+       * @brief Returns a copy of one genereted sub-band.
+       *
+       * @param level Sub-band decomposition level ( starting from 1 ).
+       * @param subband Sub-band index [ 0 - top left, 1 - top right, 
+       * 2 - bottom left, 3 - bottom right ].
+       * @param sb_raster The raster where the sub-band data will be copied.
+       * @return true if ok, false on errors.
+       */
+      bool GetSubBand( unsigned int level, 
+        unsigned int subband, 
+        const TePDITypes::TePDIRasterPtrType& sb_raster ) const;
+        
+      /**
+       * @brief Change one genereted sub-band by another one.
+       *
+       * @note Both sub-bands must have the same number of lines and
+       * columns.
+       *
+       * @param level Sub-band decomposition level ( starting from 1 ).
+       * @param subband_index Old Sub-band index 
+       * [ 0 - top left, 1 - top right, 2 - bottom left, 3 - bottom right ].
+       * @param newsband The new sub-band data.
+       * @return true if ok, false on errors.
+       */        
+      bool ChangeSubBand( unsigned int level, unsigned int subband_index,
+        const TePDITypes::TePDIRasterPtrType& newsband );
+        
+        
+      /**
+       * @brief Push a new level at pyramid level's top.
+       *
+       * @param level Sub-band level ( starting from 1 ).
+       * @param sb0 Sub-band 0 ( top left ) data. 
+       * @param sb1 Sub-band 1 ( top right ) data. 
+       * @param sb2 Sub-band 2 ( bottom left ) data. 
+       * @param sb3 Sub-band 3 ( bottom right ) data. 
+       * @return true if ok, false on errors.
+       */           
+      bool PushLevel( unsigned int level, 
+        const TePDIMatrix< double >& sb0,
+        const TePDIMatrix< double >& sb1,
+        const TePDIMatrix< double >& sb2,
+        const TePDIMatrix< double >& sb3 );      
+      
+      /**
+       * @brief Retrive the analysis filters from the internal parameters.
+       *
+       * @param low_filter The low filter.
+       * @param high_filter The high filter.
+       * @param low_shift The low filter shift.
+       * @param high_shift The high filter shift.
+       * @param params The current strategy parameters reference.
+       * @return true if ok, false on errors.
+       */
+      bool GetAnalysisFilters( std::vector< double >& low_filter,
+        std::vector< double >& high_filter,
+        int& low_shift,
+        int& high_shift,
+        const TePDIParameters& params ) const;
+      
+      /**
+       * @brief Retrive the synthesis filters from the internal parameters.
+       *
+       * @param low_filter The low filter.
+       * @param high_filter The high filter.
+       * @param low_shift The low filter shift.
+       * @param high_shift The high filter shift.
+       * @param params The current strategy parameters reference.
+       * @return true if ok, false on errors.
+       */
+      bool GetSynthesisFilters( std::vector< double >& low_filter,
+        std::vector< double >& high_filter,
+        int& low_shift,
+        int& high_shift,
+        const TePDIParameters& params ) const;        
+        
+      /**
+       * @brief Generates one level of Wavelet decomposition, using the data from
+       * the preceding level.
+       *
+       * @param level Decomposition level ( starting from 1 ).
+       * @param params The current strategy parameters reference.
+       * @return true if ok, false on errors.
+       */
+      bool GenerateLevel( unsigned int level, const TePDIParameters& params );
+      
+      /**
+       * @brief Applies a vertical filter.
+       *
+       * @param inMatrix Input matrix.
+       * @param filter Filter to apply.
+       * @param filter_shift Filter shift.
+       * @param outMatrix Output matrix.
+       */
+      void ApplyVerticalFilter( 
+        const TePDIMatrix< double >& inMatrix,
+        const std::vector< double >& filter,
+        int filter_shift,
+        TePDIMatrix< double >& outMatrix ) const;
+        
+      /**
+       * @brief Applies a horizontal filter.
+       *
+       * @param inMatrix Input matrix.
+       * @param filter Filter to apply.
+       * @param filter_shift Filter shift.
+       * @param outMatrix Output matrix.
+       */
+      void ApplyHorizontalFilter( 
+        const TePDIMatrix< double >& inMatrix,
+        const std::vector< double >& filter,
+        int filter_shift, 
+        TePDIMatrix< double >& outMatrix ) const;    
+        
+      /**
+       * @brief Recursive build of a simperimposed level ( 
+       * a level where the sub-band 0 is a
+       * composition of all higher levels ).
+       *
+       * @param level Decomposition level ( starting from 1 ).
+       * @param level_matrix The user pre-initiated resultant level matrix.
+       * @param normalize If true, grayscale level normalization will be 
+       * performed.
+       * @param min_norm_level Minimal grayscale level used for 
+       * grayscale range normalization.
+       * @param max_norm_level Maximum grayscale level used for 
+       * grayscale range normalization.
+       * @return true if ok, false on error.
+       */
+      bool BuildSuperimposedLevel( unsigned int level,
+        TePDIMatrix< double >& level_matrix, bool normalize = false,
+        double min_norm_level = 0, double max_norm_level = 0 ) const;
+      
+      /**
+       * @brief Build a agregated matrix using 4 sub-bands of identical dimensions.
+       *
+       * @param upper_left Uppper-left sub-band.
+       * @param upper_right Uppper-right sub-band.
+       * @param lower_left Lower-left sub-band.
+       * @param lower_right Lower-right sub-band.
+       * @param result The user pre-initiated result matrix where all data 
+       * will be stored.
+       * @return true if ok, false on error.
+       */          
+      bool AgregateSubBands(
+        const TePDIMatrix< double >& upper_left,
+        const TePDIMatrix< double >& upper_right,
+        const TePDIMatrix< double >& lower_left,
+        const TePDIMatrix< double >& lower_right,
+        TePDIMatrix< double >& result ) const;
+        
+      /**
+       * @brief Allocate space for a new level at pyrimid's top.
+       * @param level Level number.
+       * @param sblines Sub-bands lines number 
+       * ( only required if level == 1 ).
+       * @param sbcolumns Sub-bands columns number 
+       * ( only required if level == 1 ).
+       * @return true if ok, false on error.
+       */      
+      bool AllocateTopLevel( unsigned int level, unsigned int sblines = 0,
+        unsigned int sbcolumns = 0 );
+        
+      /**
+       * @brief Compute the analysis inversed filters reference shift ( offset ).
+       *
+       * @param a_lowfilter The analysis low filter reference.
+       * @param a_highfilter The analysis high filter reference.
+       * @param lowshift The computed shift for lowfilter.
+       * @param highshift The computed shift for highfilter.
+       * @return true if ok, false on errors.
+       */      
+      bool GetAFiltersShift( 
+        const std::vector< double >& a_lowfilter,
+        const std::vector< double >& a_highfilter,
+        int& lowshift, int& highshift ) const;
+        
+      /**
+       * @brief Compute the syntesis inversed filters reference shift ( offset ).
+       *
+       * @param s_lowfilter The syntesis low filter reference.
+       * @param s_highfilter The syntesis high filter reference.
+       * @param a_lowfilter The analysis low filter reference.
+       * @param a_highfilter The analysis high filter reference.
+       * @param lowshift The computed shift for lowfilter.
+       * @param highshift The computed shift for highfilter.
+       * @return true if ok, false on errors.
+       */      
+      bool GetSFiltersShift( 
+        const std::vector< double >& a_lowfilter,
+        const std::vector< double >& a_highfilter,
+        const std::vector< double >& s_lowfilter,
+        const std::vector< double >& s_highfilter,
+        int& lowshift, int& highshift ) const;        
+
+      /**
+       * @brief Reconstruct the Low-low ( 0, 0 ) sub-band.
+       *
+       * @param sb00_in A reference to the input sub-band ( 0, 0 ).
+       * @param sb01_in A reference to the input sub-band ( 0, 1 ).
+       * @param sb10_in A reference to the input sub-band ( 1, 0 ).
+       * @param sb11_in A reference to the input sub-band ( 1, 1 ).
+       * @param s_low_filter Low Synthesis filter.
+       * @param s_high_filter High Synthesis filter.
+       * @param lowshift Low filter shift.
+       * @param highshift High filter shift.
+       * @param sb00_out A reference to the generated sub-band ( user 
+       * initiated matrix ).
+       * @return true if ok, false on errors.
+       */                   
+      bool ReconstructLL( 
+        const TePDIMatrix< double >& sb00_in,
+        const TePDIMatrix< double >& sb01_in,
+        const TePDIMatrix< double >& sb10_in,
+        const TePDIMatrix< double >& sb11_in,
+        const std::vector< double >& s_low_filter,
+        const std::vector< double >& s_high_filter,
+        int lowshift, int highshift,
+        TePDIMatrix< double >& sb00_out ) const;
+        
+      /**
+       * @brief Up-samples a matrix.
+       *
+       * @param in Input matrix.
+       * @param out A user initiated output matrix.
+       * @return true if ok, false on errors.
+       */        
+      bool UpSampleMatrix( const TePDIMatrix< double >& in,
+        TePDIMatrix< double >& out ) const;
+        
+      /**
+       * @brief Matrix addition.
+       *
+       * @param in1 Input matrix 1.
+       * @param in2 Input matrix 2.
+       * @param res Result matrix.
+       * @return true if ok, false on errors.
+       */        
+      bool AddMatrixes( const TePDIMatrix< double >& in1,
+        const TePDIMatrix< double >& in2, TePDIMatrix< double >& res ) const;  
+        
+      /**
+       * @brief Applies a reconstruction vertical filter.
+       *
+       * @param inMatrix A Input matrix filtered with ApplyHorizontalRFilter.
+       * @param filter Filter to apply.
+       * @param filter_shift Filter shift.
+       * @param outMatrix Output matrix.
+       * @return true if ok, false on errors.
+       */
+      bool ApplyVerticalRFilter( 
+        const TePDIMatrix< double >& inMatrix,
+        const std::vector< double >& filter,
+        int filter_shift,
+        TePDIMatrix< double >& outMatrix ) const;
+        
+      /**
+       * @brief Applies a reconstruction horizontal filter.
+       *
+       * @param inMatrix An upsampled Input matrix.
+       * @param filter Filter to apply.
+       * @param filter_shift Filter shift.
+       * @param outMatrix Output matrix.
+       * @return true if ok, false on errors.
+       */
+      bool ApplyHorizontalRFilter( 
+        const TePDIMatrix< double >& inMatrix,
+        const std::vector< double >& filter,
+        int filter_shift,
+        TePDIMatrix< double >& outMatrix ) const;    
+        
+      /**
+       * @brief Do matrix normalization using the supplied ranges.
+       *
+       * @param input The input matrix.
+       * @param output The output matrix.
+       * @param min The mininum reference value.
+       * @param max The maxumum reference value.
+       */      
+      bool NormalizeMatrix( const TePDIMatrix< double >& input, 
+        TePDIMatrix< double >& output, double min, 
+        double max ) const;      
+  };
+  
+/** @example TePDIWavelets_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif
diff --git a/src/terralib/image_processing/TePDIMathFunctions.cpp b/src/terralib/image_processing/TePDIMathFunctions.cpp
old mode 100755
new mode 100644
index 9336464..933cfe2
--- a/src/terralib/image_processing/TePDIMathFunctions.cpp
+++ b/src/terralib/image_processing/TePDIMathFunctions.cpp
@@ -1,31 +1,31 @@
-#include "TePDIMathFunctions.hpp"
-#include <TeAgnostic.h>
-
-#include <math.h>
-
-namespace TePDIMathFunctions {
-
-  unsigned long int DecimLevelSize( unsigned long int level,
-    unsigned long int elements )
-  {
-    TEAGN_TRUE_OR_THROW( ( level <= DecimLevels( elements ) ),
-      "Invalid required level for the current elements number" );
-    
-    unsigned long int current_level = 0;
-    unsigned long int size = elements;
-      
-    do {
-      if( size < 2 ) {
-        break;
-      } else {
-        size = ( ( size + ( size % 2 ) ) / 2 );
-      }
-        
-      ++current_level;
-    } while( current_level != level );
-      
-    return size;
-  }
-  
-}
-
+#include "TePDIMathFunctions.hpp"
+#include <TeAgnostic.h>
+
+#include <math.h>
+
+namespace TePDIMathFunctions {
+
+  unsigned long int DecimLevelSize( unsigned long int level,
+    unsigned long int elements )
+  {
+    TEAGN_TRUE_OR_THROW( ( level <= DecimLevels( elements ) ),
+      "Invalid required level for the current elements number" );
+    
+    unsigned long int current_level = 0;
+    unsigned long int size = elements;
+      
+    do {
+      if( size < 2 ) {
+        break;
+      } else {
+        size = ( ( size + ( size % 2 ) ) / 2 );
+      }
+        
+      ++current_level;
+    } while( current_level != level );
+      
+    return size;
+  }
+  
+}
+
diff --git a/src/terralib/image_processing/TePDIMathFunctions.hpp b/src/terralib/image_processing/TePDIMathFunctions.hpp
old mode 100755
new mode 100644
index 5ebda61..8fe9210
--- a/src/terralib/image_processing/TePDIMathFunctions.hpp
+++ b/src/terralib/image_processing/TePDIMathFunctions.hpp
@@ -1,80 +1,80 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMATHFUNCTIONS_HPP
-  #define TEPDIMATHFUNCTIONS_HPP
-  
-  #include "TePDIDefines.hpp"
-  #include <TeCoord2D.h>
-  #include <TeBox.h>
-  #include <TeGeometry.h>
-  
-    /**
-     * @brief This namespace contains mathematic functions used by PDI 
-     * algorithms. 
-     * @note THEY SHOLD NOT BE USED BY ANYONE. The support and interfaces 
-     * can be changed in future. THIS IS FOR INTERNAL USE ONLY.     
-     * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-     * @ingroup PDIModule
-     */
-  namespace TePDIMathFunctions
-  {
-      
-    /**
-     * @brief Returns the number of decimation levels for a given number of elements.
-     *
-     * @param elements Elements number.
-     * @return The decimation levels.
-     */    
-    template< typename T >
-    unsigned long int DecimLevels( const T& elements )
-    {
-      if( elements < 2 )
-      {
-        return 0;
-      } else if( elements == 3 ) {
-        return 2;
-      } else {
-        return ( 1 + DecimLevels( ( elements + 
-          ( elements % 2 ) ) / 2 ) );
-      }
-    }
-    
-    /**
-     * @brief Returns the number of elements of a decimation level.
-     *
-     * @param level The decimation level (starting from 1).
-     * @param elements The initial elements number.
-     * @return The number of elements for the required level.
-     */    
-    PDI_DLL unsigned long int DecimLevelSize( unsigned long int level,
-      unsigned long int elements );
-    
-  };
-  
-/** @example TePDIMathFunctions_test.cpp
- *    Shows how to use this namespace functions.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMATHFUNCTIONS_HPP
+  #define TEPDIMATHFUNCTIONS_HPP
+  
+  #include "TePDIDefines.hpp"
+  #include <TeCoord2D.h>
+  #include <TeBox.h>
+  #include <TeGeometry.h>
+  
+    /**
+     * @brief This namespace contains mathematic functions used by PDI 
+     * algorithms. 
+     * @note THEY SHOLD NOT BE USED BY ANYONE. The support and interfaces 
+     * can be changed in future. THIS IS FOR INTERNAL USE ONLY.     
+     * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+     * @ingroup PDIModule
+     */
+  namespace TePDIMathFunctions
+  {
+      
+    /**
+     * @brief Returns the number of decimation levels for a given number of elements.
+     *
+     * @param elements Elements number.
+     * @return The decimation levels.
+     */    
+    template< typename T >
+    unsigned long int DecimLevels( const T& elements )
+    {
+      if( elements < 2 )
+      {
+        return 0;
+      } else if( elements == 3 ) {
+        return 2;
+      } else {
+        return ( 1 + DecimLevels( ( elements + 
+          ( elements % 2 ) ) / 2 ) );
+      }
+    }
+    
+    /**
+     * @brief Returns the number of elements of a decimation level.
+     *
+     * @param level The decimation level (starting from 1).
+     * @param elements The initial elements number.
+     * @return The number of elements for the required level.
+     */    
+    PDI_DLL unsigned long int DecimLevelSize( unsigned long int level,
+      unsigned long int elements );
+    
+  };
+  
+/** @example TePDIMathFunctions_test.cpp
+ *    Shows how to use this namespace functions.
+ */    
+
+#endif
diff --git a/src/terralib/image_processing/TePDIMatrix.hpp b/src/terralib/image_processing/TePDIMatrix.hpp
old mode 100755
new mode 100644
index 54db510..26b0b5a
--- a/src/terralib/image_processing/TePDIMatrix.hpp
+++ b/src/terralib/image_processing/TePDIMatrix.hpp
@@ -1,829 +1,859 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMATRIX_HPP
-  #define TEPDIMATRIX_HPP
-  
-  #include <TeAgnostic.h>
-  #include <TeSharedPtr.h>
-  #include <TeTempFilesRemover.h>
-  #include <TeUtils.h>
-  
-  #include <vector>
-  #include <string>
-  
-
-  /**
-   * @brief This is the template class to deal with a generic matrix.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAux
-   */
-  template< class T >
-  class TePDIMatrix {
-    public :
-      /** @typedef TeSharedPtr< TePDIMatrix< T > > pointer 
-          Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIMatrix< T > > pointer;
-      
-      /**
-       * @brief Memory polycy.
-       */
-      enum MemoryPolicy {
-        /**
-         * Automatic memory policy ( Try to use RAM or DISK, if there is no 
-         * avaliable RAM ) -
-         * DO NOT USE AutoMemPol FOR COMPLEX DATA TYPES !
-         * 
-         */
-        AutoMemPol,
-        /**
-         * RAM memory policy.
-         */
-        RAMMemPol,
-        /**
-         * Disk memory policy ( virtual mapped memory ) -
-         *  DO NOT USE DiskMemPol FOR COMPLEX DATA TYPES !
-         */
-        DiskMemPol
-      };
-      
-      /**
-       * @brief Default Constructor.
-       * @note The default mamory policy is RAMMemPol.
-       */
-      TePDIMatrix();      
-      
-      /**
-       * @brief Alternative Constructor.
-       *
-       * @param lines Number of lines.
-       * @param columns Number of columns.
-       * @param mp Memory policy.
-       */
-      TePDIMatrix( unsigned int lines, unsigned int columns, 
-        MemoryPolicy mp );
-      
-      /**
-       * @brief Alternative Constructor.
-       *
-       * @param mp Memory policy.
-       */
-      TePDIMatrix( MemoryPolicy mp );      
-        
-      /**
-       * @brief Alternative Constructor.
-       *
-       * @param lines Number of lines.
-       * @param columns Number of columns.
-       * @note The default mamory policy is RAMMemPol.
-       */
-      TePDIMatrix( unsigned int lines, unsigned int columns );        
-
-      /**
-       * @brief Alternative Constructor.
-       *
-       * @param external External object reference.
-       * @param mp Memory policy.
-       */
-      TePDIMatrix( const TePDIMatrix< T >& external );
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIMatrix();
-      
-      /**
-       * @brief Reset the active instance the the new parameters.
-       *
-       * @param lines Number of lines.
-       * @param columns Number of columns.
-       * @return true if OK, false on error.
-       */
-      bool Reset( unsigned int lines = 0, 
-        unsigned int columns = 0 );      
-
-      /**
-       * @brief Reset the active instance the the new parameters.
-       *
-       * @param lines Number of lines.
-       * @param columns Number of columns.
-       * @param mp Memory policy.
-       * @return true if OK, false on error.
-       */
-      bool Reset( unsigned int lines, unsigned int columns,
-        MemoryPolicy mp );
-      
-      /**
-       * @brief The number of current matrix lines.
-       *
-       * @return The number of current matrix lines.
-       */
-      unsigned int GetLines() const;
-      
-      /**
-       * @brief The number of current matrix columns.
-       *
-       * @return The number of current matrix columns
-       */
-      unsigned int GetColumns() const;
-      
-      /**
-       * @brief Empty Matrix verification.
-       *
-       * @return true if the matrix is empty.
-       */
-      bool IsEmpty() const;
-
-      /**
-       * @brief Operator = overload.
-       *
-       * @note The external memory policy will be used as reference.
-       *
-       * @param external External instance reference.
-       * @return A reference to the current matrix.
-       */
-      const TePDIMatrix< T >& operator=( 
-        const TePDIMatrix< T >& external );
-
-      /**
-       * @brief Operator () overload.
-       *
-       * @param line Line number.
-       * @param column Column number.
-       * @return A reference to the required element.
-       */
-      inline T& operator()( const unsigned int& line, 
-        const unsigned int& column )
-      {
-        TEAGN_DEBUG_CONDITION( ( line < totalLines_ ),
-          "Invalid line" )
-        TEAGN_DEBUG_CONDITION( ( column < totalColumns_ ),
-          "Invalid columns" )
-            
-        return scanLine( line )[ column ];      
-      };
-      
-      /**
-       * @brief Operator () overload.
-       *
-       * @param line Line number.
-       * @param column Column number.
-       * @return A const reference to the required element.
-       */
-      inline const T& operator()( const unsigned int& line, 
-        const unsigned int& column ) const
-      {
-        TEAGN_DEBUG_CONDITION( ( line < totalLines_ ),
-          "Invalid line" )
-        TEAGN_DEBUG_CONDITION( ( column < totalColumns_ ),
-          "Invalid columns" )
-          
-        return scanLine( line )[ column ];      
-      }; 
-      
-      /**
-       * @brief Operator [] overload.
-       *
-       * @param line Line number.
-       * @param column Column number.
-       * @return A pointer to the required line.
-       * @note The returned pointer is garanteed to 
-       * be valid until an acess to another line occurs.
-       */
-      inline T* operator[]( const unsigned int& line )
-      {
-        TEAGN_DEBUG_CONDITION( ( line < totalLines_ ),
-          "Invalid line" )
-      
-        return scanLine( line );      
-      };
-      
-      /**
-       * @brief Operator [] overload.
-       *
-       * @param line Line number.
-       * @param column Column number.
-       * @return A pointer to the required line.
-       * @note The returned pointer is garanteed to 
-       * be valid until an acess to another line occurs.
-       */
-      inline T const* operator[]( const unsigned int& line ) const
-      {
-        TEAGN_DEBUG_CONDITION( ( line < totalLines_ ),
-          "Invalid line" )
-      
-        return scanLine( line );      
-      };      
-            
-    protected :
-    
-      /**
-       * @brief File tiles data node.
-       */         
-      class DiskLinesVecNodeT
-      {
-        public :
-          
-          FILE* filePtr_;
-          unsigned int fileOff_;
-          std::string fullFilePath_;
-          
-          DiskLinesVecNodeT()
-          {
-            filePtr_ = 0;
-            fileOff_ = 0;
-          }
-      };
-      
-      typedef std::vector< DiskLinesVecNodeT > DiskLinesVecT;
-      
-      /**
-       * @brief Max bytes per temp file (for swapped tiles only).
-       */
-      unsigned long int maxTmpFileSize_;      
-      
-      /**
-       * @brief The total lines number.
-       */
-      unsigned int totalLines_;
-      
-      /**
-       * @brief The total columns number.
-       */
-      unsigned int totalColumns_;     
-      
-      /**
-       * @brief The current used memory policy.
-       */
-      MemoryPolicy currentMemPolicy_;
-      
-      /**
-       * @brief The index of the current active disk line copy in RAM
-       * ( default -1 , no disk line active ).
-       */     
-      mutable long int curDiskLineIdx_;    
-        
-      /**
-       * @brief A pointer to the RAM memory used for disk lines swap..
-       */     
-      T* currDiskLinePtr_;
-      
-      /**
-       * @brief The lines size (bytes).
-       */     
-      unsigned int linesSize_;      
-
-      /**
-       * @brief The lines pointers vector (RAM + disk lines).
-       */
-      mutable std::vector< T* > linesPtrsVec_;     
-       
-      /**
-       * @brief The disk lines data vector.
-       */      
-      DiskLinesVecT diskLinesVec_;    
-     
-      /**
-       * @brief Reset the internal variables to the initial state.
-       */      
-      void init();
-      
-      /**
-       * @brief Clear all allocated resources and go back to the initial
-       * state.
-       */      
-      void clear();
-      
-      /**
-       * @brief Allocate disk lines.
-       * @param startingLineIdx Starting line index.
-       * @return true if OK, false on errors.
-       */    
-      bool allocateDiskLines( 
-        unsigned int startingLineIdx );      
-      
-      /**
-       * @brief Returns a pointer to the required line.
-       *
-       * @param line Line number.
-       * @param column Column number.
-       * @return A pointer to the required line.
-       * @note The returned pointer is garanteed to 
-       * be valid until an acess to another line occurs
-       */
-      T* scanLine( const unsigned int& line ) const;
-        
-      /**
-       * @brief Create a new disk file.
-       * @param filename The file name.
-       * @param size The file size.
-       * @param fileptr The file pointer.
-       * @return true if OK. false on errors.
-       */
-      bool createNewDiskFile( unsigned long int size,
-        const std::string& filename, FILE** fileptr ) const;      
-  };
-
-  template< class T >
-  void TePDIMatrix< T >::init()
-  {
-    maxTmpFileSize_ = ( 1024 * 1024 * 100 );
-    totalLines_ = 0;
-    totalColumns_ = 0;  
-    currentMemPolicy_ = RAMMemPol;
-    curDiskLineIdx_ = -1;
-    currDiskLinePtr_ = 0;
-    linesSize_ = 0;
-  }
-  
-
-  template< class T >
-  void TePDIMatrix< T >::clear()
-  {
-    if( curDiskLineIdx_ > -1 )
-    {
-      delete[] currDiskLinePtr_;
-      linesPtrsVec_[ curDiskLineIdx_ ] = 0;
-    }
-    
-    const unsigned int linesPtrsVecSize = linesPtrsVec_.size();
-    for( unsigned int linesPtrsVecIdx = 0 ; linesPtrsVecIdx < linesPtrsVecSize ;
-      ++linesPtrsVecIdx ) {
-     
-      if( linesPtrsVec_[ linesPtrsVecIdx ] ) {
-        delete[] linesPtrsVec_[ linesPtrsVecIdx ];
-      }
-    }  
-      
-    linesPtrsVec_.clear();
-    
-    const unsigned int diskLinesVecSize = diskLinesVec_.size();
-    for( unsigned int diskLinesVecIdx = 0 ; diskLinesVecIdx <
-      diskLinesVecSize ; ++diskLinesVecIdx )
-    {
-      TeTempFilesRemover::instance().removeFile( diskLinesVec_[ 
-        diskLinesVecIdx ].fullFilePath_ ); 
-    }
-    
-    diskLinesVec_.clear();
-  
-    init();
-  }  
-  
-
-  template< class T >
-  TePDIMatrix< T >::TePDIMatrix()
-  {
-    init();
-  }    
-  
-  
-  template< class T >
-  TePDIMatrix< T >::TePDIMatrix( unsigned int lines, 
-    unsigned int columns, MemoryPolicy mp )
-  {
-    init();
-    
-    TEAGN_TRUE_OR_THROW( Reset( lines, columns, mp ),
-      "Unable to initiate the matrix object" );
-  }  
-  
-  template< class T >
-  TePDIMatrix< T >::TePDIMatrix( MemoryPolicy mp )
-  {
-    init();
-    
-    currentMemPolicy_ = mp;
-  }    
-  
-  template< class T >
-  TePDIMatrix< T >::TePDIMatrix( unsigned int lines, 
-    unsigned int columns )
-  {
-    init();
-    
-    TEAGN_TRUE_OR_THROW( Reset( lines, columns, RAMMemPol ),
-      "Unable to initiate the matrix object" );
-  }   
-  
-  
-  template< class T >
-  TePDIMatrix< T >::TePDIMatrix( const TePDIMatrix< T >& external )
-  {
-    init();
-    
-    operator=( external );
-  }
-
-
-  template< class T >
-    TePDIMatrix< T >::~TePDIMatrix()
-  {
-    clear();
-  }
-
-  
-  template< class T >
-  bool TePDIMatrix< T >::Reset( unsigned int lines, 
-    unsigned int columns )
-  {
-    return Reset( lines, columns, currentMemPolicy_ );
-  }  
-
-  template< class T >
-  bool TePDIMatrix< T >::Reset( unsigned int lines, 
-    unsigned int columns,
-    MemoryPolicy mp )
-  {
-    /* Update the old buffer if necessary */
-    
-    if( ( lines != totalLines_ ) || ( columns != totalColumns_ ) ||
-        ( currentMemPolicy_ != mp ) ) {
-    
-      /* free the old resources */
-      
-      clear();
-    
-      /* Allocate the new resources */
-      
-      totalLines_ = lines;
-      totalColumns_ = columns;       
-      linesSize_ = sizeof( T ) * totalColumns_;
-      
-      currentMemPolicy_ = mp;
-      
-      if( ( lines != 0 ) && ( columns != 0 ) ) {
-        /* Guessing the memory source, if in automatic mode */
-     
-        unsigned int line = 0;
-        
-        /* Allocating the main lines pointers vector */
-        
-        try
-        {
-          linesPtrsVec_.resize( totalLines_, 0 );
-        }
-        catch(...)
-        {
-          clear();
-          TEAGN_LOG_AND_RETURN( "Memory allocation error" );
-        }
-        
-        if( linesPtrsVec_.size() != totalLines_ ) {
-          clear();
-          TEAGN_LOG_AND_RETURN( "Memory allocation error" );
-        }
-        
-        /* Allocating the disk lines data vector */
-        
-        try
-        {
-          diskLinesVec_.resize( totalLines_ );
-        }
-        catch(...)
-        {
-          clear();
-          TEAGN_LOG_AND_RETURN( "Memory allocation error" );
-        }
-        
-        if( diskLinesVec_.size() != totalLines_ ) {
-          clear();
-          TEAGN_LOG_AND_RETURN( "Memory allocation error" );
-        }        
-        
-        /* Allocating the RAM file swap area */
-        
-        try
-        {
-          currDiskLinePtr_ = new T[ totalColumns_ ];
-        }
-        catch(...)
-        {
-          clear();
-          TEAGN_LOG_AND_RETURN( "Memory allocation error" );
-        }
-        
-        if( currDiskLinePtr_ == 0 ) {
-          clear();
-          TEAGN_LOG_AND_RETURN( "Memory allocation error" );
-        }    
-
-        /* Allocating lines */
-
-        switch( currentMemPolicy_ ) {
-          case RAMMemPol :
-          {
-            T* new_line_ptr = 0;
-        
-            for( line = 0 ; line < totalLines_ ; ++line ) {
-              try {
-                new_line_ptr = new T[ totalColumns_ ];
-              }
-              catch(...) {
-                clear();
-                
-                TEAGN_LOG_AND_RETURN( "Memory allocation error" );               
-              }
-              
-              if( new_line_ptr == 0 ) {
-                clear();
-                
-                TEAGN_LOG_AND_RETURN( "Memory allocation error" );              
-              } 
-              
-              linesPtrsVec_[ line ] = new_line_ptr;
-            }
-            
-            break;
-          }
-          case DiskMemPol :
-          {
-            if( ! allocateDiskLines( 0 ) ) {
-              clear();
-              
-              TEAGN_LOG_AND_RETURN( 
-                "Error allocating mapped memory lines" )
-            }
-              
-            break;
-          }       
-          case AutoMemPol :
-          {
-            const unsigned long int freeVm = TeGetFreeVirtualMemory();
-            unsigned long int lineBytes = sizeof( T ) * totalColumns_;
-            const unsigned long int maxRam  = (unsigned long int)
-              ( 0.90 * ( (double)( freeVm ) ) );    
-            unsigned long int maxRamLines = (unsigned long int)
-              ( ( (double)maxRam ) / ( (double) lineBytes ) ); 
-              
-            T* new_line_ptr = 0;
-        
-            for( unsigned int line = 0 ; line < totalLines_ ; ++line ) 
-            {
-              if( line < maxRamLines ) 
-              {
-                try {
-                  new_line_ptr = new T[ totalColumns_ ];
-                }
-                catch(...) 
-                {
-                  if( allocateDiskLines( line ) )
-                  {
-                    return true;
-                  }
-                  else 
-                  {
-                    clear();
-                    
-                    TEAGN_LOG_AND_RETURN( 
-                      "Error allocating mapped memory lines" )
-                  }
-                }
-                
-                if( new_line_ptr == 0 ) {
-                  if( allocateDiskLines( line ) )
-                  {
-                    return true;
-                  }
-                  else 
-                  {
-                    clear();
-                    
-                    TEAGN_LOG_AND_RETURN( 
-                      "Error allocating mapped memory lines" )
-                  }         
-                } 
-                
-                linesPtrsVec_[ line ] = new_line_ptr;
-              } else { // ( line >= maxRamLines )
-                if( allocateDiskLines( line ) ) 
-                {
-                  return true;
-                } 
-                else 
-                {
-                  clear();
-                  
-                  TEAGN_LOG_AND_RETURN( 
-                    "Error allocating mapped memory lines" )
-                }              
-              }
-            }
-            
-            break;
-          }                 
-          default :
-          {
-            TEAGN_LOG_AND_THROW( "Invalid memory policy" );
-            break;
-          }
-        }
-      }
-    }
-    
-    return true;
-  }
-  
-  
-  template< class T >
-  unsigned int TePDIMatrix< T >::GetLines() const
-  {
-    return totalLines_;
-  }
-
-  
-  template< class T >
-  unsigned int TePDIMatrix< T >::GetColumns() const
-  {
-    return totalColumns_;
-  }
-  
-  
-  template< class T >
-  bool TePDIMatrix< T >::IsEmpty() const
-  {
-    return ( totalLines_ == 0 ) ? true : false;
-  }
-  
-
-  template< class T >
-  const TePDIMatrix< T >& TePDIMatrix< T >::operator=(
-    const TePDIMatrix< T >& external )
-  {
-    TEAGN_TRUE_OR_THROW( 
-      Reset( external.totalLines_, external.totalColumns_,
-      external.currentMemPolicy_ ),
-      "Unable to initiate the matrix object" );
-    
-    unsigned int line;
-    unsigned int column;
-    T const* inLinePtr = 0;
-    T* outLinePtr = 0;
-    
-    for( line = 0 ; line < totalLines_ ; ++line ) 
-    {
-      inLinePtr = external.scanLine( line );
-      outLinePtr = scanLine( line );
-      
-      for( column = 0 ; column < totalColumns_ ; ++column ) {
-        outLinePtr[ column ] = inLinePtr[ column ];
-      }
-    }
-
-    return *this;
-  }
-  
-  template< class T >
-  bool TePDIMatrix< T >::allocateDiskLines( unsigned int startingLineIdx )
-  {
-    TEAGN_DEBUG_CONDITION( diskLinesVec_.size() == totalLines_,
-      "Invalid disk lines vector size" );
-    
-    const unsigned int lineBytes = sizeof( T ) * totalColumns_;
-    const unsigned int linesPerfile = ( unsigned long int )
-      floor( ( (double)maxTmpFileSize_ ) / ( (double) lineBytes ) );    
-    const unsigned long int fileSize = (unsigned long int)
-      ( linesPerfile * lineBytes );
-    
-    unsigned int currFileLines = linesPerfile + 1;
-    DiskLinesVecNodeT dummyNode;
-     
-    for( unsigned long int lineIdx = startingLineIdx ; lineIdx < 
-      totalLines_ ; ++lineIdx )
-    {
-      if( currFileLines >= linesPerfile )
-      {
-        TEAGN_TRUE_OR_RETURN( TeGetTempFileName( dummyNode.fullFilePath_ ),
-          "Unable to create temporary file name" );
-        TEAGN_TRUE_OR_RETURN( createNewDiskFile( fileSize, 
-          dummyNode.fullFilePath_, &(dummyNode.filePtr_) ), 
-          "Error creating temporary file" );
-        
-        TeTempFilesRemover::instance().addFile( dummyNode.fullFilePath_,
-          dummyNode.filePtr_ );        
-        
-        currFileLines = 0;
-      }
-      
-      dummyNode.fileOff_ = currFileLines * lineBytes;
-      diskLinesVec_[ lineIdx ] = dummyNode;
-      
-      ++currFileLines;
-    } 
-    
-    return true;
-  }
-  
-  template< class T >
-  T* TePDIMatrix< T >::scanLine( const unsigned int& line ) const
-  {
-    TEAGN_DEBUG_CONDITION( line < linesPtrsVec_.size(),
-      "Invalid tile index" );
-      
-    T* line_ptr = linesPtrsVec_[ line ];
-      
-    if( line_ptr ) {
-      return line_ptr;
-    } else {
-      /* flush the current disk line from RAM */
-      
-      if( curDiskLineIdx_ > -1 )
-      {
-        TEAGN_DEBUG_CONDITION( curDiskLineIdx_ < (long int)diskLinesVec_.size(),
-          "Invalid disk tile index" );
-        TEAGN_DEBUG_CONDITION( curDiskLineIdx_ < (long int)linesPtrsVec_.size(),
-          "Invalid disk tile index" );
-        TEAGN_DEBUG_CONDITION( currDiskLinePtr_,
-          "Invalid swap line pointer" );
-        
-        const DiskLinesVecNodeT& node = diskLinesVec_[ curDiskLineIdx_ ];
-        
-        TEAGN_TRUE_OR_THROW( 0 == fseek( node.filePtr_, 
-          (long)( node.fileOff_ ), SEEK_SET ),
-          "File seek error" );        
-        
-        TEAGN_TRUE_OR_THROW( 1 == fwrite( (void*)currDiskLinePtr_, 
-          (size_t)( linesSize_ ), 1, node.filePtr_ ),
-          "File write error" )
-            
-        linesPtrsVec_[ curDiskLineIdx_ ] = 0;
-      }
-      
-      // Read the required line into RAM
-      
-      TEAGN_DEBUG_CONDITION( line < (unsigned int)diskLinesVec_.size(),
-        "Invalid disk tile index" );      
-      const DiskLinesVecNodeT& node = diskLinesVec_[ line ];
-      
-      TEAGN_TRUE_OR_THROW( 0 == fseek( node.filePtr_, 
-        (long)( node.fileOff_ ), SEEK_SET ),
-        "File seek error" );
-      
-      TEAGN_TRUE_OR_THROW( 1 == fread( (void*)currDiskLinePtr_, 
-        (size_t)( linesSize_ ), 1, node.filePtr_ ),
-        "File read error" )      
-          
-      curDiskLineIdx_ =  line;   
-      linesPtrsVec_[ curDiskLineIdx_ ] = currDiskLinePtr_;
-      
-      return currDiskLinePtr_;
-    }
-  } 
-
-  template< class T >
-  bool TePDIMatrix< T >::createNewDiskFile( unsigned long int size,
-    const std::string& filename, FILE** fileptr ) const
-  {
-    TEAGN_TRUE_OR_RETURN( ! filename.empty(),
-      "Invalid file name" );
-      
-    (*fileptr) = fopen( filename.c_str(), "wb+" );
-    TEAGN_TRUE_OR_RETURN( (*fileptr) != 0, "Invalid file pointer" )
-    
-    long seekoff = (long)( size - 1 );
-    
-    if( 0 != fseek( (*fileptr), seekoff, SEEK_SET ) )
-    {
-      fclose( (*fileptr) );
-      TEAGN_LOGERR( "File seek error" );
-      return false;
-    }
-  
-    unsigned char c = '\0';
-    if( 1 != fwrite( &c, 1, 1, (*fileptr) ) )
-    {
-      fclose( (*fileptr) );
-      TEAGN_LOGERR( "File write error" );
-      return false;
-    }
-      
-    return true;
-  }  
-  
-/** @example TePDIMatrix_test.cpp
- *    Shows how to use this class.
- */    
-  
-#endif //TEPDIMATRIX_HPP
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMATRIX_HPP
+  #define TEPDIMATRIX_HPP
+  
+  #include <TeAgnostic.h>
+  #include <TeSharedPtr.h>
+  #include <TeTempFilesRemover.h>
+  #include <TeUtils.h>
+  
+  #include <vector>
+  #include <string>
+  
+
+  /**
+   * @class TePDIMatrix
+   * @brief This is the template class to deal with a generic matrix.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAux
+   * @example TePDIMatrix_test.cpp
+   */
+  template< class ElementType >
+  class TePDIMatrix {
+    public :
+      /** @typedef TeSharedPtr< TePDIMatrix< ElementType > > pointer 
+          Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIMatrix< ElementType > > pointer;
+      
+      /**
+       * @brief Memory polycy.
+       */
+      enum MemoryPolicy 
+      {
+        /**
+         * Automatic memory policy ( Try to use RAM or DISK, if there is no 
+         * avaliable RAM ) -
+         * DO NOT USE AutoMemPol FOR COMPLEX DATA TYPES !
+         * 
+         */
+        AutoMemPol,
+        /**
+         * RAM memory policy.
+         */
+        RAMMemPol,
+        /**
+         * Disk memory policy ( virtual mapped memory ) -
+         *  DO NOT USE DiskMemPol FOR COMPLEX DATA TYPES !
+         */
+        DiskMemPol
+      };
+      
+      TePDIMatrix();      
+
+      TePDIMatrix( const TePDIMatrix< ElementType >& external );
+
+      virtual ~TePDIMatrix();
+      
+      /**
+       * @brief Reset (clear) the active instance data.
+       * @note Other parameters will not be changed.
+       *
+       * @param memoryPolicy Memory policy.
+       */
+      void Reset();      
+      
+      /**
+       * @brief Reset (clear) the active instance data and update its
+       * internal parameters folowing the the new supplied parameters.
+       * @note Other parameters will not be changed.
+       *
+       * @param memoryPolicy Memory policy.
+       */
+      void Reset( MemoryPolicy memoryPolicy );       
+      
+      /**
+       * @brief Reset (clear) the active instance data and update its
+       * internal parameters folowing the the new supplied parameters.
+       * @note Other parameters will not be changed.
+       *
+       * @param lines Number of lines.
+       * @param columns Number of columns.
+       * @return true if OK, false on error.
+       */
+      bool Reset( unsigned int lines, unsigned int columns );      
+
+      /**
+       * @brief Reset (clear) the active instance data and update its
+       * internal parameters folowing the the new supplied parameters.
+       * @note Other parameters will not be changed.
+       *
+       * @param lines Number of lines.
+       * @param columns Number of columns.
+       * @param memoryPolicy Memory policy.
+       * @return true if OK, false on error.
+       */
+      bool Reset( unsigned int lines, unsigned int columns,
+        MemoryPolicy memoryPolicy );        
+        
+      /**
+       * @brief Reset (clear) the active instance data and update its
+       * internal parameters folowing the the new supplied parameters.
+       * @note Other parameters will not be changed.
+       *
+       * @param lines Number of lines.
+       * @param columns Number of columns.
+       * @param memoryPolicy Memory policy.
+       * @param maxTmpFileSize Max temp file size.
+       * @param maxMemPercentUsage The max amount of free memory to use 
+       * when necessary.
+       * @return true if OK, false on error.
+       */
+      bool Reset( unsigned int lines, unsigned int columns,
+        MemoryPolicy memoryPolicy, unsigned long int maxTmpFileSize,
+        unsigned char maxMemPercentUsage ); 
+        
+      /**
+       * @brief Clear all allocated resources and go back to the initial
+       * default parameters.
+       */      
+      void clear();            
+      
+      /**
+       * @brief The number of current matrix lines.
+       *
+       * @return The number of current matrix lines.
+       */
+      unsigned int GetLines() const;
+      
+      /**
+       * @brief The number of current matrix columns.
+       *
+       * @return The number of current matrix columns
+       */
+      unsigned int GetColumns() const;
+      
+      /**
+       * @brief Empty Matrix verification.
+       *
+       * @return true if the matrix is empty.
+       */
+      bool IsEmpty() const;
+
+      /**
+       * @brief Operator = overload.
+       *
+       * @note The external memory policy will be used as reference.
+       *
+       * @param external External instance reference.
+       * @return A reference to the current matrix.
+       */
+      const TePDIMatrix< ElementType >& operator=( 
+        const TePDIMatrix< ElementType >& external );
+
+      /**
+       * @brief Operator () overload.
+       *
+       * @param line Line number.
+       * @param column Column number.
+       * @return A reference to the required element.
+       */
+      inline ElementType& operator()( const unsigned int& line, 
+        const unsigned int& column )
+      {
+        TEAGN_DEBUG_CONDITION( ( column < totalColumns_ ),
+          "Invalid columns" )
+            
+        return getScanLine( line )[ column ];      
+      };
+      
+      /**
+       * @brief Operator () overload.
+       *
+       * @param line Line number.
+       * @param column Column number.
+       * @return A const reference to the required element.
+       */
+      inline const ElementType& operator()( const unsigned int& line, 
+        const unsigned int& column ) const
+      {
+        TEAGN_DEBUG_CONDITION( ( column < totalColumns_ ),
+          "Invalid columns" )
+          
+        return getScanLine( line )[ column ] ;      
+      }; 
+      
+      /**
+       * @brief Operator [] overload.
+       *
+       * @param line Line number.
+       * @param column Column number.
+       * @return A pointer to the required line.
+       * @note The returned pointer is garanteed to 
+       * be valid until an acess to another line occurs.
+       * @note Concurrent thread access to this method is guaranteed
+       * if RAMMemPol policy method is used.
+       */
+      inline ElementType* operator[]( const unsigned int& line )
+      {
+        return getScanLine( line );
+      };
+      
+      /**
+       * @brief Operator [] overload.
+       *
+       * @param line Line number.
+       * @param column Column number.
+       * @return A pointer to the required line.
+       * @note The returned pointer is garanteed to 
+       * be valid until an acess to another line occurs.
+       * @note Concurrent thread access to this method is guaranteed
+       * if RAMMemPol policy method is used.       
+       */
+      inline ElementType const* operator[]( const unsigned int& line ) const
+      {
+        return getScanLine( line );
+      };      
+      
+      /**
+       * @brief Returns the current memory policy.
+       * @return The current memory policy.
+       */      
+      MemoryPolicy getMemPolicy() const;
+      
+      /**
+       * @brief Returns the current maximum temporary disk file size.
+       * @return Returns the current maximum temporary disk file size.
+       */            
+      unsigned long int getMaxTmpFileSize() const; 
+            
+    protected :
+    
+      /**
+       * @brief Disk lines infor node.
+       */         
+      class DiskLinesInfoNode
+      {
+        public :
+          
+          FILE* filePtr_;
+          unsigned int fileOff_;
+          
+          DiskLinesInfoNode()
+          {
+            filePtr_ = 0;
+            fileOff_ = 0;
+          }
+          
+          ~DiskLinesInfoNode() {};
+      };
+      
+      /**
+       * @brief Disk lines vector type definition.
+       */      
+      typedef std::vector< DiskLinesInfoNode > DiskLinesVecT;
+      
+      /**
+       * @typedef std::vector< std::pair< FILE*, unsigned int > >
+       * Openend disk files data vector type.
+       */         
+      typedef std::vector< std::pair< FILE*, std::string > > 
+        OpenDiskFilesVecT;         
+      
+      /**
+       * @brief Max bytes per temp file (for swapped tiles only, default: 2GB).
+       */
+      unsigned long int maxTmpFileSize_;      
+      
+      /**
+       * @brief the max amount of free memory to use when necessary
+       * (default:50).
+       */        
+      unsigned char maxMemPercentUsage_;
+      
+      /**
+       * @brief The total lines number (default:0).
+       */
+      unsigned int totalLines_;
+      
+      /**
+       * @brief The total columns number (default:0).
+       */
+      unsigned int totalColumns_;     
+      
+      /**
+       * @brief The used memory policy (default:RAMMemPol).
+       */
+      MemoryPolicy memoryPolicy_;
+      
+      /**
+       * @brief The line size (bytes, default:0).
+       */     
+      unsigned int lineSize_;      
+
+      /**
+       * @brief A vector with pointers to all lines.
+       */
+      mutable std::vector< ElementType* > allLinesPtrsVec_;     
+      
+      /**
+       * @brief A vector with open disk files info.
+       */      
+      OpenDiskFilesVecT openDiskFilesVec_;
+      
+      /**
+       * @brief Disk lines vector.
+       */      
+      mutable DiskLinesVecT diskLinesVec_;      
+      
+      /**
+       * @brief The indexes inside allTilesPtrsVec_ of all RAM lines.
+       */        
+      mutable std::vector< unsigned int > ramLinesIndexesVec_;
+      
+      /**
+       * @brief The index inside ramLinesIndexesVec_ of the next RAM
+       * line index that will be swapped to disk when a disk line
+       * is required.
+       */        
+      mutable unsigned int nextSwapLineRamLinesIndexesVecIdx_;
+      
+      /**
+       * @brief A pointer to the auxiliar line used when swapping
+       * data to/from disk.
+       */              
+      mutable ElementType* swapLinePtr_;      
+
+         
+      // temp variables used by the method getScanLine
+      mutable ElementType* getScanLine_linePtr_;
+      mutable unsigned int getScanLine_swapLineIdx_;
+     
+      /**
+       * @brief Reset the internal variables to the initial state.
+       */      
+      void init();
+      
+      /**
+       * @brief Allocate disk lines.
+       * @param startingLineIdx Starting line index.
+       * @return true if OK, false on errors.
+       */    
+      bool allocateDiskLines( unsigned int startingLineIdx );      
+      
+      /**
+       * @brief Returns a pointer to the required line.
+       *
+       * @param line Line number.
+       * @param column Column number.
+       * @return A pointer to the required line.
+       * @note The returned pointer is garanteed to 
+       * be valid until an acess to another line occurs.
+       * @note Concurrent thread access to this method is guaranteed
+       * if RAMMemPol policy method is used.       
+       */
+      ElementType* getScanLine( const unsigned int& line ) const;
+        
+      /**
+       * @brief Create a new disk file.
+       * @param filename The file name.
+       * @param size The file size.
+       * @param fileptr The file pointer.
+       * @return true if OK. false on errors.
+       */
+      bool createNewDiskFile( unsigned long int size,
+        const std::string& filename, FILE** fileptr ) const;      
+  };
+
+  template< class ElementType >
+  void TePDIMatrix< ElementType >::init()
+  {
+    maxTmpFileSize_ = 2ul * 1024ul * 1024ul * 1024ul;;
+    maxMemPercentUsage_ = 50;
+    totalLines_ = 0;
+    totalColumns_ = 0;  
+    memoryPolicy_ = RAMMemPol;
+    lineSize_ = 0;
+    nextSwapLineRamLinesIndexesVecIdx_ = 0;
+    getScanLine_linePtr_ = 0;
+    getScanLine_swapLineIdx_ = 0;
+    swapLinePtr_ = 0;
+  }
+
+  template< class ElementType >
+  TePDIMatrix< ElementType >::TePDIMatrix()
+  {
+    init();
+  }    
+  
+  template< class ElementType >
+  TePDIMatrix< ElementType >::TePDIMatrix( 
+    const TePDIMatrix< ElementType >& external )
+  {
+    init();
+    
+    operator=( external );
+  }
+
+  template< class ElementType >
+    TePDIMatrix< ElementType >::~TePDIMatrix()
+  {
+    clear();
+  }
+  
+  template< class ElementType >
+  void TePDIMatrix< ElementType >::Reset()
+  {
+    Reset( 0, 0, memoryPolicy_, maxTmpFileSize_, maxMemPercentUsage_ );
+  }  
+  
+  template< class ElementType >
+  void TePDIMatrix< ElementType >::Reset( MemoryPolicy memoryPolicy )
+  {
+    Reset( 0, 0, memoryPolicy, maxTmpFileSize_, maxMemPercentUsage_ );
+  }   
+  
+  template< class ElementType >
+  bool TePDIMatrix< ElementType >::Reset( unsigned int lines, 
+    unsigned int columns )
+  {
+    return Reset( lines, columns, memoryPolicy_, maxTmpFileSize_,
+      maxMemPercentUsage_ );
+  } 
+   
+  template< class ElementType >
+  bool TePDIMatrix< ElementType >::Reset( unsigned int lines, 
+    unsigned int columns, MemoryPolicy memoryPolicy )
+  {
+    return Reset( lines, columns, memoryPolicy, maxTmpFileSize_, 
+      maxMemPercentUsage_ );
+  }
+
+  template< class ElementType >
+  bool TePDIMatrix< ElementType >::Reset( unsigned int lines, 
+    unsigned int columns, MemoryPolicy memoryPolicy,
+    unsigned long int maxTmpFileSize,
+    unsigned char maxMemPercentUsage )
+  {
+    clear();
+    
+    // Updating the global vars
+    
+    maxTmpFileSize_ = maxTmpFileSize;
+    maxMemPercentUsage_ = maxMemPercentUsage;
+    memoryPolicy_ = memoryPolicy;
+    
+    /* Update the old buffer if necessary */
+    
+    if( ( lines > 0 ) || ( columns > 0 ) )
+    {
+      try
+      {
+        // Updating the global vars
+        
+        totalLines_ = lines;
+        totalColumns_ = columns;    
+        lineSize_ = sizeof( ElementType ) * totalColumns_;
+              
+        // Allocating tiles
+        
+        allLinesPtrsVec_.resize( totalLines_, 0 );
+      
+        if( memoryPolicy_ == RAMMemPol )
+        {
+          for( unsigned int allLinesPtrsVecIdx = 0 ; allLinesPtrsVecIdx <
+            totalLines_ ; ++allLinesPtrsVecIdx )
+          {
+            allLinesPtrsVec_[ allLinesPtrsVecIdx ] = 
+              new ElementType[ totalColumns_ ];
+              
+            if( allLinesPtrsVec_[ allLinesPtrsVecIdx ] == 0 )
+            {
+              clear();
+            
+              TEAGN_LOG_AND_RETURN( "Tiles allocation error" )
+            }
+          }
+        }
+        else
+        { // AutoMemPol, DiskMemPol
+        
+          // Allocating the swap line pointer
+          
+          swapLinePtr_ = new ElementType[ totalColumns_ ];
+          
+          if( swapLinePtr_ == 0 )
+          {
+            clear();
+          
+            TEAGN_LOG_AND_RETURN( "Swap line allocation error" )
+          }          
+        
+          // Defining the number of max RAM lines
+          
+          unsigned int maxRAMLines = 1;
+          
+          if( memoryPolicy_ == AutoMemPol )
+          {
+            // Defining the max number of RAM tiles
+            
+            const double totalPhysMem = (double)TeGetTotalPhysicalMemory();
+            
+            const double totalVMem = (double)TeGetTotalVirtualMemory();
+            
+            const double totalMem = ( ((double)maxMemPercentUsage_) / 100.0 ) *
+              MIN( totalVMem, totalPhysMem );
+              
+            const double freeMem = MIN( totalMem, (double)TeGetFreeVirtualMemory() );          
+            
+            maxRAMLines = (unsigned int)MAX( 1, freeMem /
+              ((double)lineSize_) );
+          }        
+          
+          // Allocating RAM lines
+          
+          unsigned int ramLinesNmb = MIN( maxRAMLines, totalLines_ );
+          
+          for( unsigned int allLinesPtrsVecIdx = 0 ; allLinesPtrsVecIdx <
+            ramLinesNmb ; ++allLinesPtrsVecIdx )
+          {
+            allLinesPtrsVec_[ allLinesPtrsVecIdx ] = 
+              new ElementType[ totalColumns_ ];
+              
+            if( allLinesPtrsVec_[ allLinesPtrsVecIdx ] == 0 )
+            {
+              clear();
+            
+              TEAGN_LOG_AND_RETURN( "Tiles allocation error" )
+            }
+            else
+            {
+              ramLinesIndexesVec_.push_back( allLinesPtrsVecIdx );
+            }
+          }
+          
+          // Allocating Disk lines
+        
+          if( ! allocateDiskLines( ramLinesNmb ) )
+          {
+            clear();
+            
+            TEAGN_LOG_AND_RETURN( "Tiles allocation error" )
+          }          
+        }
+      }
+      catch(...)
+      {
+        clear();
+        
+        TEAGN_LOG_AND_RETURN( "Tiles allocation error" )
+      } 
+    }
+    
+    return true;
+  }
+  
+  template< class ElementType >
+  void TePDIMatrix< ElementType >::clear()
+  {
+    const unsigned int allLinesPtrsVecSize = (unsigned int)
+      allLinesPtrsVec_.size();
+      
+    for( unsigned int allLinesPtrsVecIdx = 0 ; allLinesPtrsVecIdx < 
+      allLinesPtrsVecSize ; ++allLinesPtrsVecIdx ) 
+    {
+      if( allLinesPtrsVec_[ allLinesPtrsVecIdx ] ) 
+      {
+        delete[] allLinesPtrsVec_[ allLinesPtrsVecIdx ];
+      }
+    }  
+    allLinesPtrsVec_.clear();
+    
+    for( unsigned int openDiskFilesVecIdx = 0 ; openDiskFilesVecIdx < 
+      openDiskFilesVec_.size() ; ++openDiskFilesVecIdx )
+    {
+      TeTempFilesRemover::instance().removeFile( openDiskFilesVec_[ 
+        openDiskFilesVecIdx ].second );      
+    } 
+    openDiskFilesVec_.clear(); 
+       
+    diskLinesVec_.clear();
+    
+    ramLinesIndexesVec_.clear();
+    
+    if( swapLinePtr_ ) delete swapLinePtr_;
+  
+    init();
+  }    
+  
+  template< class ElementType >
+  unsigned int TePDIMatrix< ElementType >::GetLines() const
+  {
+    return totalLines_;
+  }
+
+  
+  template< class ElementType >
+  unsigned int TePDIMatrix< ElementType >::GetColumns() const
+  {
+    return totalColumns_;
+  }
+  
+  
+  template< class ElementType >
+  bool TePDIMatrix< ElementType >::IsEmpty() const
+  {
+    return ( totalLines_ == 0 ) ? true : false;
+  }
+  
+
+  template< class ElementType >
+  const TePDIMatrix< ElementType >& TePDIMatrix< ElementType >::operator=(
+    const TePDIMatrix< ElementType >& external )
+  {
+    TEAGN_TRUE_OR_THROW( 
+      Reset( external.totalLines_, external.totalColumns_,
+      memoryPolicy_, maxTmpFileSize_, maxMemPercentUsage_ ),
+      "Unable to initiate the matrix object" );
+    
+    unsigned int column = 0;;
+    ElementType const* inLinePtr = 0;
+    ElementType* outLinePtr = 0;
+    
+    for( unsigned int line = 0 ; line < totalLines_ ; ++line ) 
+    {
+      inLinePtr = external.getScanLine( line );
+      outLinePtr = getScanLine( line );
+      
+      for( column = 0 ; column < totalColumns_ ; ++column ) {
+        outLinePtr[ column ] = inLinePtr[ column ];
+      }
+    }
+
+    return *this;
+  }
+  
+  template< class ElementType >
+  typename TePDIMatrix< ElementType >::MemoryPolicy TePDIMatrix< ElementType >::getMemPolicy() const
+  {
+    return memoryPolicy_;
+  }  
+  
+  template< class ElementType >
+  unsigned long int TePDIMatrix< ElementType >::getMaxTmpFileSize() const
+  {
+    return maxTmpFileSize_;
+  }    
+  
+  template< class ElementType >
+  bool TePDIMatrix< ElementType >::allocateDiskLines( unsigned int startingLineIdx )
+  {
+    const unsigned long int diskLinesNmb = totalLines_ - startingLineIdx;
+    
+    if( diskLinesNmb )
+    {    
+      const unsigned long int maxLinesPerFile = ( unsigned long int )
+        floor( ( (double)maxTmpFileSize_ ) / ( (double) lineSize_ ) );
+          
+      const unsigned long int maxFileSize = (unsigned long int)
+        ( maxLinesPerFile * lineSize_ );
+        
+      const unsigned int filesNumber = (unsigned int)ceil( ((double)diskLinesNmb) 
+        / ((double)maxLinesPerFile) );
+
+      // Resizing the disk lines info vector
+      
+      diskLinesVec_.resize( totalLines_ );
+      
+      // Allocating each file
+      
+      unsigned int remainingLinesNmb = diskLinesNmb;
+      unsigned int fileSize = 0;
+      unsigned int fileLinesNumber = 0;    
+      std::pair< FILE*, std::string > auxFileData;  
+      unsigned int diskLinesVecIdx = startingLineIdx;
+      
+      for( unsigned int fileIdx = 0 ; fileIdx < filesNumber ; ++fileIdx )
+      {
+        // Defining the current file size
+        
+        fileSize = maxFileSize;
+        fileLinesNumber = maxLinesPerFile;
+        
+        if( remainingLinesNmb < maxLinesPerFile )
+        {
+          fileSize = (unsigned long int)( lineSize_ * remainingLinesNmb );
+          fileLinesNumber = remainingLinesNmb;
+        }
+        
+        remainingLinesNmb -= fileLinesNumber;
+        
+        // allocating the file 
+        
+        TEAGN_TRUE_OR_RETURN( TeGetTempFileName( auxFileData.second ),
+          "Unable to get temporary file name" );        
+        
+        if( ! createNewDiskFile( fileSize, auxFileData.second, 
+          &( auxFileData.first) ) )
+        {
+          TEAGN_LOGERR( "Unable to create temporary disk file" );
+          
+          return false;           
+        }
+        else
+        {
+          openDiskFilesVec_.push_back( auxFileData );
+          
+          TeTempFilesRemover::instance().addFile( auxFileData.second,
+            auxFileData.first );    
+                
+          for( unsigned int lineIdx = 0; lineIdx < fileLinesNumber ; ++lineIdx )
+          {
+            diskLinesVec_[ diskLinesVecIdx ].filePtr_ = auxFileData.first;
+            diskLinesVec_[ diskLinesVecIdx ].fileOff_ = lineIdx * lineSize_;
+            
+            ++diskLinesVecIdx;
+          }
+        }
+      }
+    }
+    
+    return true;
+  }
+  
+  template< class ElementType >
+  ElementType* TePDIMatrix< ElementType >::getScanLine( const unsigned int& line ) const
+  {
+    TEAGN_DEBUG_CONDITION( line < allLinesPtrsVec_.size(),
+      "Invalid tile index" );
+      
+    if( allLinesPtrsVec_[ line ] ) 
+    {
+      return allLinesPtrsVec_[ line ];
+    } 
+    else 
+    {
+      // Finding the swap line index 
+
+      TEAGN_DEBUG_CONDITION( nextSwapLineRamLinesIndexesVecIdx_ <
+        ramLinesIndexesVec_.size(), "Internal error" );
+      getScanLine_swapLineIdx_ = ramLinesIndexesVec_[ 
+        nextSwapLineRamLinesIndexesVecIdx_ ];
+      
+      TEAGN_DEBUG_CONDITION( line < diskLinesVec_.size(), "Internal error" );
+      DiskLinesInfoNode& inLineData = diskLinesVec_[ line ];
+      
+      TEAGN_DEBUG_CONDITION( getScanLine_swapLineIdx_ < 
+        diskLinesVec_.size(), "Internal error" )
+      DiskLinesInfoNode& outLineData = diskLinesVec_[ 
+        getScanLine_swapLineIdx_ ];
+        
+      /* Reading the required tile into RAM (swapTilePtr_) */
+      
+      TEAGN_DEBUG_CONDITION( inLineData.filePtr_, "Internal error" );
+      TEAGN_TRUE_OR_THROW( 0 == fseek( inLineData.filePtr_, 
+        (long)( inLineData.fileOff_ ), SEEK_SET ),
+        "File seek error" )
+        
+      TEAGN_DEBUG_CONDITION( swapLinePtr_, "Internal error" );
+      TEAGN_TRUE_OR_THROW( 1 == fread( (void*)swapLinePtr_, 
+        (size_t)( lineSize_ ), 1, inLineData.filePtr_ ),
+        "File read error" )
+    
+      /* Flushing the swap tile to disk */
+        
+      TEAGN_TRUE_OR_THROW( 0 == fseek( inLineData.filePtr_, 
+        (long)( inLineData.fileOff_ ), SEEK_SET ),
+        "File seek error" );
+        
+      TEAGN_DEBUG_CONDITION( getScanLine_swapLineIdx_ < 
+        allLinesPtrsVec_.size(), "Internal error" );          
+      TEAGN_TRUE_OR_THROW( 1 == fwrite( (void*)allLinesPtrsVec_[ 
+        getScanLine_swapLineIdx_ ], 
+        (size_t)( lineSize_ ), 1, inLineData.filePtr_ ),
+        "File write error" )        
+      
+      // Updating the tile pointers
+      
+      getScanLine_linePtr_ = allLinesPtrsVec_[ getScanLine_swapLineIdx_ ];
+      
+      allLinesPtrsVec_[ getScanLine_swapLineIdx_ ] = 0;
+      
+      allLinesPtrsVec_[ line ] = swapLinePtr_;
+      
+      swapLinePtr_ = getScanLine_linePtr_;
+      
+      /* Updating the info vectors */
+          
+      outLineData.filePtr_ = inLineData.filePtr_;
+      outLineData.fileOff_ = inLineData.fileOff_;
+      
+      inLineData.filePtr_ = 0;
+      inLineData.fileOff_ = 0;    
+      
+      ramLinesIndexesVec_[ nextSwapLineRamLinesIndexesVecIdx_ ] =
+        line;
+      nextSwapLineRamLinesIndexesVecIdx_ = 
+        ( ( nextSwapLineRamLinesIndexesVecIdx_ + 1 ) % 
+        ((unsigned int)ramLinesIndexesVec_.size()) );
+      TEAGN_DEBUG_CONDITION( nextSwapLineRamLinesIndexesVecIdx_ <
+        ramLinesIndexesVec_.size(), "Internal error" );          
+          
+      return allLinesPtrsVec_[ line ];
+    }
+  } 
+  
+  template< class ElementType >
+  bool TePDIMatrix< ElementType >::createNewDiskFile( unsigned long int size,
+    const std::string& filename, FILE** fileptr ) const
+  {
+    TEAGN_TRUE_OR_RETURN( ! filename.empty(),
+      "Invalid file name" );
+      
+    (*fileptr) = fopen( filename.c_str(), "wb+" );
+    TEAGN_TRUE_OR_RETURN( (*fileptr) != 0, "Invalid file pointer" )
+    
+    long seekoff = (long)( size - 1 );
+    
+    if( 0 != fseek( (*fileptr), seekoff, SEEK_SET ) )
+    {
+      fclose( (*fileptr) );
+      TEAGN_LOGERR( "File seek error" );
+      return false;
+    }
+  
+    unsigned char c = '\0';
+    if( 1 != fwrite( &c, 1, 1, (*fileptr) ) )
+    {
+      fclose( (*fileptr) );
+      TEAGN_LOGERR( "File write error" );
+      return false;
+    }
+      
+    return true;
+  }  
+  
+#endif
+
diff --git a/src/terralib/image_processing/TePDIMatrixFunctions.cpp b/src/terralib/image_processing/TePDIMatrixFunctions.cpp
old mode 100755
new mode 100644
index c26471e..7558103
--- a/src/terralib/image_processing/TePDIMatrixFunctions.cpp
+++ b/src/terralib/image_processing/TePDIMatrixFunctions.cpp
@@ -1,140 +1,140 @@
-#include "TePDIMatrixFunctions.hpp"
-#include <TeAgnostic.h>
-
-#include "math.h"
-
-namespace TePDIMatrixFunctions {
-
-  double GetCorrelation( const TePDIMatrix< double >& matrix1,
-    const TePDIMatrix< double >& matrix2 )
-  {
-    const unsigned int lines_bound = 
-      MIN( matrix1.GetLines(), matrix2.GetLines() );
-    const unsigned int cols_bound = 
-      MIN( matrix1.GetColumns(), matrix2.GetColumns() );
-      
-    if( ( lines_bound == 0 ) || ( cols_bound == 0 ) ) {
-      return 0;
-    } else {
-      unsigned int line = 0;
-      unsigned int col = 0;
-      
-      double M1XM2 = 0;
-      double M1XM1 = 0;
-      double M2XM2 = 0;
-      double M1SUM = 0;
-      double M2SUM = 0;
-      
-      double element1 = 0;
-      double element2 = 0;
-      
-      for( line = 0; line < lines_bound ; ++line ) {
-        for( col = 0 ; col < cols_bound ; ++col ) {
-          element1 = matrix1( line, col );
-          element2 = matrix2( line, col );
-        
-          M1XM2 += element1 * element2;
-          M1XM1 += element1 * element1;
-          M2XM2 += element2 * element2;
-          M1SUM += element1;
-          M2SUM += element2;
-        }
-      }
-      
-      const double elements = ( double )( lines_bound * cols_bound );
-      double mean1 = M1SUM / elements;
-      double mean2 = M2SUM / elements;
-      
-      double var1 = sqrt( ( M1XM1 / elements ) - ( mean1 * mean1 ) );
-      double var2 = sqrt( ( M2XM2 / elements ) - ( mean2 * mean2 ) );
-      
-      if( ( var1 != 0 ) && ( var2 != 0 ) ) {
-        return ( ( ( M1XM2 / elements ) - ( mean1 * mean2 ) ) /
-          ( var1 * var2 ) );
-      } else {
-        return 0;
-      }
-    }
-  }
-  
-  
-  bool Abs( const TePDIMatrix< double >& inMatrix, 
-    TePDIMatrix< double >& absMatrix )
-  {
-    const unsigned int lines_bound = inMatrix.GetLines();
-    const unsigned int cols_bound = inMatrix.GetColumns();
-    unsigned int line = 0;
-    unsigned int col = 0;
-    
-    TEAGN_TRUE_OR_RETURN( absMatrix.Reset( lines_bound, cols_bound ),
-      "Unable to reset output matrix" );
-    
-    for( line = 0 ; line < lines_bound ; ++line ) {
-      for( col = 0 ; col < cols_bound ; ++col ) {
-        absMatrix( line, col ) = ABS( inMatrix( line, col ) );
-      }
-    }
-    
-    return true;
-  }
-
-  
-  bool WhereIsGreater( const TePDIMatrix< double >& inMatrix1,
-    const TePDIMatrix< double >& inMatrix2,
-    TePDIMatrix< double >& gtMatrix )
-  {
-    const unsigned int m1lines = inMatrix1.GetLines();
-    const unsigned int m2lines = inMatrix2.GetLines();
-    const unsigned int m1cols = inMatrix1.GetColumns();
-    const unsigned int m2cols = inMatrix2.GetColumns();
-    
-    unsigned int line = 0;
-    unsigned int col = 0;
-    
-    TEAGN_TRUE_OR_RETURN( gtMatrix.Reset( m1lines, m1cols ),
-      "Unable to reset output matrix" );
-    
-    for( line = 0 ; line < m1lines ; ++line ) {
-      for( col = 0 ; col < m1cols ; ++col ) {
-        if( ( line < m2lines ) && ( col < m2cols ) ) {
-          if( inMatrix1( line, col ) > inMatrix2( line, col ) ) {
-            gtMatrix( line, col ) = 1.;
-          } else {
-            gtMatrix( line, col ) = 0;
-          }
-        } else {
-          gtMatrix( line, col ) = 0;
-        }
-      }
-    }
-    
-    return true;  
-  }
-  
-  
-  bool Negate( const TePDIMatrix< double >& inMatrix,
-    TePDIMatrix< double >& negMatrix )
-  {
-    const unsigned int lines_bound = inMatrix.GetLines();
-    const unsigned int cols_bound = inMatrix.GetColumns();
-    unsigned int line = 0;
-    unsigned int col = 0;
-    
-    TEAGN_TRUE_OR_RETURN( negMatrix.Reset( lines_bound, cols_bound ),
-      "Unable to reset output matrix" );
-    
-    for( line = 0 ; line < lines_bound ; ++line ) {
-      for( col = 0 ; col < cols_bound ; ++col ) {
-        if( inMatrix( line, col ) == 0 ) {
-          negMatrix( line, col ) = 1.0;
-        } else {
-          negMatrix( line, col ) = 0.0;
-        }
-      }
-    }
-    
-    return true;
-  }  
-
-}
-
+#include "TePDIMatrixFunctions.hpp"
+#include <TeAgnostic.h>
+
+#include "math.h"
+
+namespace TePDIMatrixFunctions {
+
+  double GetCorrelation( const TePDIMatrix< double >& matrix1,
+    const TePDIMatrix< double >& matrix2 )
+  {
+    const unsigned int lines_bound = 
+      MIN( matrix1.GetLines(), matrix2.GetLines() );
+    const unsigned int cols_bound = 
+      MIN( matrix1.GetColumns(), matrix2.GetColumns() );
+      
+    if( ( lines_bound == 0 ) || ( cols_bound == 0 ) ) {
+      return 0;
+    } else {
+      unsigned int line = 0;
+      unsigned int col = 0;
+      
+      double M1XM2 = 0;
+      double M1XM1 = 0;
+      double M2XM2 = 0;
+      double M1SUM = 0;
+      double M2SUM = 0;
+      
+      double element1 = 0;
+      double element2 = 0;
+      
+      for( line = 0; line < lines_bound ; ++line ) {
+        for( col = 0 ; col < cols_bound ; ++col ) {
+          element1 = matrix1( line, col );
+          element2 = matrix2( line, col );
+        
+          M1XM2 += element1 * element2;
+          M1XM1 += element1 * element1;
+          M2XM2 += element2 * element2;
+          M1SUM += element1;
+          M2SUM += element2;
+        }
+      }
+      
+      const double elements = ( double )( lines_bound * cols_bound );
+      double mean1 = M1SUM / elements;
+      double mean2 = M2SUM / elements;
+      
+      double var1 = sqrt( ( M1XM1 / elements ) - ( mean1 * mean1 ) );
+      double var2 = sqrt( ( M2XM2 / elements ) - ( mean2 * mean2 ) );
+      
+      if( ( var1 != 0 ) && ( var2 != 0 ) ) {
+        return ( ( ( M1XM2 / elements ) - ( mean1 * mean2 ) ) /
+          ( var1 * var2 ) );
+      } else {
+        return 0;
+      }
+    }
+  }
+  
+  
+  bool Abs( const TePDIMatrix< double >& inMatrix, 
+    TePDIMatrix< double >& absMatrix )
+  {
+    const unsigned int lines_bound = inMatrix.GetLines();
+    const unsigned int cols_bound = inMatrix.GetColumns();
+    unsigned int line = 0;
+    unsigned int col = 0;
+    
+    TEAGN_TRUE_OR_RETURN( absMatrix.Reset( lines_bound, cols_bound ),
+      "Unable to reset output matrix" );
+    
+    for( line = 0 ; line < lines_bound ; ++line ) {
+      for( col = 0 ; col < cols_bound ; ++col ) {
+        absMatrix( line, col ) = ABS( inMatrix( line, col ) );
+      }
+    }
+    
+    return true;
+  }
+
+  
+  bool WhereIsGreater( const TePDIMatrix< double >& inMatrix1,
+    const TePDIMatrix< double >& inMatrix2,
+    TePDIMatrix< double >& gtMatrix )
+  {
+    const unsigned int m1lines = inMatrix1.GetLines();
+    const unsigned int m2lines = inMatrix2.GetLines();
+    const unsigned int m1cols = inMatrix1.GetColumns();
+    const unsigned int m2cols = inMatrix2.GetColumns();
+    
+    unsigned int line = 0;
+    unsigned int col = 0;
+    
+    TEAGN_TRUE_OR_RETURN( gtMatrix.Reset( m1lines, m1cols ),
+      "Unable to reset output matrix" );
+    
+    for( line = 0 ; line < m1lines ; ++line ) {
+      for( col = 0 ; col < m1cols ; ++col ) {
+        if( ( line < m2lines ) && ( col < m2cols ) ) {
+          if( inMatrix1( line, col ) > inMatrix2( line, col ) ) {
+            gtMatrix( line, col ) = 1.;
+          } else {
+            gtMatrix( line, col ) = 0;
+          }
+        } else {
+          gtMatrix( line, col ) = 0;
+        }
+      }
+    }
+    
+    return true;  
+  }
+  
+  
+  bool Negate( const TePDIMatrix< double >& inMatrix,
+    TePDIMatrix< double >& negMatrix )
+  {
+    const unsigned int lines_bound = inMatrix.GetLines();
+    const unsigned int cols_bound = inMatrix.GetColumns();
+    unsigned int line = 0;
+    unsigned int col = 0;
+    
+    TEAGN_TRUE_OR_RETURN( negMatrix.Reset( lines_bound, cols_bound ),
+      "Unable to reset output matrix" );
+    
+    for( line = 0 ; line < lines_bound ; ++line ) {
+      for( col = 0 ; col < cols_bound ; ++col ) {
+        if( inMatrix( line, col ) == 0 ) {
+          negMatrix( line, col ) = 1.0;
+        } else {
+          negMatrix( line, col ) = 0.0;
+        }
+      }
+    }
+    
+    return true;
+  }  
+
+}
+
diff --git a/src/terralib/image_processing/TePDIMatrixFunctions.hpp b/src/terralib/image_processing/TePDIMatrixFunctions.hpp
old mode 100755
new mode 100644
index bbbfe77..4a2bed0
--- a/src/terralib/image_processing/TePDIMatrixFunctions.hpp
+++ b/src/terralib/image_processing/TePDIMatrixFunctions.hpp
@@ -1,92 +1,92 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMATRIXFUNCTIONS_HPP
-  #define TEPDIMATRIXFUNCTIONS_HPP
-  
-  #include "TePDIMatrix.hpp"
-  #include "TePDITypes.hpp"
-  
-  /**
-   * @brief This namespace contains functions for TePDIMatrix manipulation.
-   * @note THEY SHOLD NOT BE USED BY ANYONE. The support and interfaces 
-   * can be changed in future. THIS IS FOR INTERNAL USE ONLY.     
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIModule
-   */
-  namespace TePDIMatrixFunctions
-  {
-    /**
-     * @brief Matrices correlation.
-     * 
-     * @param matrix1 Input matrix 1.
-     * @param matrix2 Input matrix 2.
-     * @return The correlation between the two matrix.
-     * @note The calcule will only be made for elements that exists in both
-     * matrices.
-     */
-    PDI_DLL double GetCorrelation( const TePDIMatrix< double >& matrix1,
-      const TePDIMatrix< double >& matrix2 );
-      
-    /**
-     * @brief Absolute values matrix generation.
-     * 
-     * @param inMatrix Input matrix.
-     * @param absMatrix Output matrix.
-     * @return true if ok, false on errors.
-     */
-    PDI_DLL bool Abs( const TePDIMatrix< double >& inMatrix,
-      TePDIMatrix< double >& absMatrix );
-      
-    /**
-     * @brief Locates all inMatrix1 elements there are greater than
-     * inMatrix2 elements. These elements positions will be marked with
-     * value 1 in gtMatrix. The other positions will be marked with 0's.
-     * 
-     * @param inMatrix1 Input matrix.
-     * @param inMatrix2 Input matrix.
-     * @param gtMatrix Output matrix.
-     * @return true if ok, false on errors.
-     */
-   PDI_DLL bool WhereIsGreater( const TePDIMatrix< double >& inMatrix1,
-      const TePDIMatrix< double >& inMatrix2,
-      TePDIMatrix< double >& gtMatrix );
-      
-    /**
-     * @brief Locates all inMatrix1 zero elements. These elements positions will be 
-     * marked with value 1 in negMatrix. The other positions will be marked 
-     * with 0's. 
-     * @param inMatrix Input matrix.
-     * @param negMatrix Output matrix.
-     * @return true if ok, false on errors.
-     */
-   PDI_DLL bool Negate( const TePDIMatrix< double >& inMatrix,
-      TePDIMatrix< double >& negMatrix );       
-  };
-  
-/** @example TePDIMatrixFunctions_test.cpp
- *    Shows how to use this namespace functions.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMATRIXFUNCTIONS_HPP
+  #define TEPDIMATRIXFUNCTIONS_HPP
+  
+  #include "TePDIMatrix.hpp"
+  #include "TePDITypes.hpp"
+  
+  /**
+   * @brief This namespace contains functions for TePDIMatrix manipulation.
+   * @note THEY SHOLD NOT BE USED BY ANYONE. The support and interfaces 
+   * can be changed in future. THIS IS FOR INTERNAL USE ONLY.     
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIModule
+   */
+  namespace TePDIMatrixFunctions
+  {
+    /**
+     * @brief Matrices correlation.
+     * 
+     * @param matrix1 Input matrix 1.
+     * @param matrix2 Input matrix 2.
+     * @return The correlation between the two matrix.
+     * @note The calcule will only be made for elements that exists in both
+     * matrices.
+     */
+    PDI_DLL double GetCorrelation( const TePDIMatrix< double >& matrix1,
+      const TePDIMatrix< double >& matrix2 );
+      
+    /**
+     * @brief Absolute values matrix generation.
+     * 
+     * @param inMatrix Input matrix.
+     * @param absMatrix Output matrix.
+     * @return true if ok, false on errors.
+     */
+    PDI_DLL bool Abs( const TePDIMatrix< double >& inMatrix,
+      TePDIMatrix< double >& absMatrix );
+      
+    /**
+     * @brief Locates all inMatrix1 elements there are greater than
+     * inMatrix2 elements. These elements positions will be marked with
+     * value 1 in gtMatrix. The other positions will be marked with 0's.
+     * 
+     * @param inMatrix1 Input matrix.
+     * @param inMatrix2 Input matrix.
+     * @param gtMatrix Output matrix.
+     * @return true if ok, false on errors.
+     */
+   PDI_DLL bool WhereIsGreater( const TePDIMatrix< double >& inMatrix1,
+      const TePDIMatrix< double >& inMatrix2,
+      TePDIMatrix< double >& gtMatrix );
+      
+    /**
+     * @brief Locates all inMatrix1 zero elements. These elements positions will be 
+     * marked with value 1 in negMatrix. The other positions will be marked 
+     * with 0's. 
+     * @param inMatrix Input matrix.
+     * @param negMatrix Output matrix.
+     * @return true if ok, false on errors.
+     */
+   PDI_DLL bool Negate( const TePDIMatrix< double >& inMatrix,
+      TePDIMatrix< double >& negMatrix );       
+  };
+  
+/** @example TePDIMatrixFunctions_test.cpp
+ *    Shows how to use this namespace functions.
+ */    
+
+#endif
diff --git a/src/terralib/image_processing/TePDIMixModel.cpp b/src/terralib/image_processing/TePDIMixModel.cpp
old mode 100755
new mode 100644
index da1c9e9..8d654ab
--- a/src/terralib/image_processing/TePDIMixModel.cpp
+++ b/src/terralib/image_processing/TePDIMixModel.cpp
@@ -1,42 +1,42 @@
-#include <TePDIMixModel.hpp>
-#include <TePDIMixModelStratFactory.hpp>
-
-TePDIMixModel::TePDIMixModel()
-{
-}
-
-
-TePDIMixModel::~TePDIMixModel()
-{
-}
-
-void TePDIMixModel::ResetState(const TePDIParameters& params)
-{
-	TePDIParameters dummy_params = params;
-}
-
-
-bool TePDIMixModel::CheckParameters(const TePDIParameters& parameters) const
-{
-	std::string mixmodel_type;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("mixmodel_type", mixmodel_type), "Missing parameter : mixmodel_type");
-
-	TePDIMixModelStrategy::pointer mixmodel_strategy(TePDIMixModelStratFactory::make(mixmodel_type, parameters));
-	
-	TEAGN_TRUE_OR_RETURN(mixmodel_strategy.isActive(), "Invalid strategy");
-
-	return mixmodel_strategy->CheckParameters(parameters);
-}
-
-
-bool TePDIMixModel::RunImplementation()
-{
-	std::string mixmodel_type;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("mixmodel_type", mixmodel_type), "Missing parameter : mixmodel_type");
-	
-	TePDIMixModelStrategy::pointer mixmodel_strategy(TePDIMixModelStratFactory::make(mixmodel_type, params_));
-	
-	TEAGN_TRUE_OR_RETURN(mixmodel_strategy.isActive(), "Invalid strategy");
-	
-	return mixmodel_strategy->Apply(params_);
-}
+#include <TePDIMixModel.hpp>
+#include <TePDIMixModelStratFactory.hpp>
+
+TePDIMixModel::TePDIMixModel()
+{
+}
+
+
+TePDIMixModel::~TePDIMixModel()
+{
+}
+
+void TePDIMixModel::ResetState(const TePDIParameters& params)
+{
+	TePDIParameters dummy_params = params;
+}
+
+
+bool TePDIMixModel::CheckParameters(const TePDIParameters& parameters) const
+{
+	std::string mixmodel_type;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("mixmodel_type", mixmodel_type), "Missing parameter : mixmodel_type");
+
+	TePDIMixModelStrategy::pointer mixmodel_strategy(TePDIMixModelStratFactory::make(mixmodel_type, parameters));
+	
+	TEAGN_TRUE_OR_RETURN(mixmodel_strategy.isActive(), "Invalid strategy");
+
+	return mixmodel_strategy->CheckParameters(parameters);
+}
+
+
+bool TePDIMixModel::RunImplementation()
+{
+	std::string mixmodel_type;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("mixmodel_type", mixmodel_type), "Missing parameter : mixmodel_type");
+	
+	TePDIMixModelStrategy::pointer mixmodel_strategy(TePDIMixModelStratFactory::make(mixmodel_type, params_));
+	
+	TEAGN_TRUE_OR_RETURN(mixmodel_strategy.isActive(), "Invalid strategy");
+	
+	return mixmodel_strategy->Apply(params_);
+}
diff --git a/src/terralib/image_processing/TePDIMixModel.hpp b/src/terralib/image_processing/TePDIMixModel.hpp
old mode 100755
new mode 100644
index f57a64e..f189d9c
--- a/src/terralib/image_processing/TePDIMixModel.hpp
+++ b/src/terralib/image_processing/TePDIMixModel.hpp
@@ -1,98 +1,98 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-
-#ifndef TEPDIMIXMODEL_HPP
-#define TEPDIMIXMODEL_HPP
-
-#include <TePDIStrategyFactory.hpp>
-#include <TeAgnostic.h>
-#include <TePDIAlgorithm.hpp>
-#include <TePDIParameters.hpp>
-#include <TeSharedPtr.h>
-
-/**
-* @brief This is the base class for image mixmodel algorithms.
-* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-* @ingroup TePDIGeneralAlgoGroup
-*
-* @note The general required parameters:
-* @param mixmodel_type (std::string) - MixModel Strategy type
-*
-* @note The specific parameters: See each mixmodel strategy for reference.   
-*/
-
-class PDI_DLL TePDIMixModel : public TePDIAlgorithm
-{
-	
-	public :
-		
-/*		typedef TeSharedPtr< TePDIMixModel > pointer;
-		typedef const TeSharedPtr< TePDIMixModel > const_pointer;*/
-		
-		/**
-		* Default Constructor.
-		*
-		*/
-		TePDIMixModel();
-		
-		/**
-		* Default Destructor
-		*/
-		virtual ~TePDIMixModel();
-		
-		/**
-		* Checks if the supplied parameters fits the requirements of each
-		* PDI algorithm implementation.
-		*
-		* Error log messages will be generated. No exceptions generated.
-		*
-		* @param parameters The parameters to be checked.
-		* @return true if the parameters are OK. false if not.
-		*/
-		bool CheckParameters( const TePDIParameters& parameters ) const;
-
-	protected :
-	
-		/**
-		* Reset the internal state to the initial state.
-		*
-		* @param params The new parameters referente at initial state.
-		*/
-		void ResetState( const TePDIParameters& params );
-
-		/**
-		* Runs the current algorithm implementation.
-		*
-		* @return true if OK. false on error.
-		*/
-		bool RunImplementation();
-
-};
-  
-/** @example TePDIMixModel_test.cpp
- *    Shows how to use this class.
- */
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+
+#ifndef TEPDIMIXMODEL_HPP
+#define TEPDIMIXMODEL_HPP
+
+#include <TePDIStrategyFactory.hpp>
+#include <TeAgnostic.h>
+#include <TePDIAlgorithm.hpp>
+#include <TePDIParameters.hpp>
+#include <TeSharedPtr.h>
+
+/**
+* @brief This is the base class for image mixmodel algorithms.
+* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+* @ingroup TePDIGeneralAlgoGroup
+*
+* @note The general required parameters:
+* @param mixmodel_type (std::string) - MixModel Strategy type
+*
+* @note The specific parameters: See each mixmodel strategy for reference.   
+*/
+
+class PDI_DLL TePDIMixModel : public TePDIAlgorithm
+{
+	
+	public :
+		
+/*		typedef TeSharedPtr< TePDIMixModel > pointer;
+		typedef const TeSharedPtr< TePDIMixModel > const_pointer;*/
+		
+		/**
+		* Default Constructor.
+		*
+		*/
+		TePDIMixModel();
+		
+		/**
+		* Default Destructor
+		*/
+		virtual ~TePDIMixModel();
+		
+		/**
+		* Checks if the supplied parameters fits the requirements of each
+		* PDI algorithm implementation.
+		*
+		* Error log messages will be generated. No exceptions generated.
+		*
+		* @param parameters The parameters to be checked.
+		* @return true if the parameters are OK. false if not.
+		*/
+		bool CheckParameters( const TePDIParameters& parameters ) const;
+
+	protected :
+	
+		/**
+		* Reset the internal state to the initial state.
+		*
+		* @param params The new parameters referente at initial state.
+		*/
+		void ResetState( const TePDIParameters& params );
+
+		/**
+		* Runs the current algorithm implementation.
+		*
+		* @return true if OK. false on error.
+		*/
+		bool RunImplementation();
+
+};
+  
+/** @example TePDIMixModel_test.cpp
+ *    Shows how to use this class.
+ */
+
+#endif
diff --git a/src/terralib/image_processing/TePDIMixModelComponent.cpp b/src/terralib/image_processing/TePDIMixModelComponent.cpp
old mode 100755
new mode 100644
index 19bc82f..2a89517
--- a/src/terralib/image_processing/TePDIMixModelComponent.cpp
+++ b/src/terralib/image_processing/TePDIMixModelComponent.cpp
@@ -1,49 +1,55 @@
-#include <TePDIMixModelComponent.hpp>
-
-TePDIMixModelComponent::TePDIMixModelComponent(string l)
-{
-	label = l;
-}
-
-TePDIMixModelComponent::~TePDIMixModelComponent()
-{
-}
-
-bool TePDIMixModelComponent::insertPixel(unsigned int bn, double p)
-{
-	pixels.insert(pair<unsigned int, double>(bn, p));
-
-	return true;
-}
-
-bool TePDIMixModelComponent::removePixel(unsigned int bn)
-{
-	map<unsigned int, double>::iterator it = pixels.find(bn);
-
-	if (it == pixels.end())
-		return false;
-
-	pixels.erase(bn);
-
-	return true;
-}
-
-double TePDIMixModelComponent::getPixel(unsigned int bn)
-{
-	map<unsigned int, double>::iterator it = pixels.find(bn);
-
-	if (it == pixels.end())
-		return -1.0;
-
-	return it->second;
-}
-
-unsigned TePDIMixModelComponent::getSize()
-{
-	return pixels.size();
-}
-
-void TePDIMixModelComponent::clearPixels()
-{
-	pixels.clear();
-}
+#include <TePDIMixModelComponent.hpp>
+
+TePDIMixModelComponent::TePDIMixModelComponent(string l)
+{
+	label = l;
+}
+
+TePDIMixModelComponent::~TePDIMixModelComponent()
+{
+}
+
+bool TePDIMixModelComponent::insertPixel(unsigned int bn, double p)
+{
+	pixels.insert(pair<unsigned int, double>(bn, p));
+
+	return true;
+}
+
+bool TePDIMixModelComponent::removePixel(unsigned int bn)
+{
+	map<unsigned int, double>::iterator it = pixels.find(bn);
+
+	if (it == pixels.end())
+		return false;
+
+	pixels.erase(bn);
+
+	return true;
+}
+
+double TePDIMixModelComponent::getPixel(unsigned int bn)
+{
+	map<unsigned int, double>::iterator it = pixels.find(bn);
+
+	if (it == pixels.end())
+		return -1.0;
+
+	return it->second;
+}
+
+unsigned TePDIMixModelComponent::getSize()
+{
+	return pixels.size();
+}
+
+void TePDIMixModelComponent::clearPixels()
+{
+	pixels.clear();
+}
+
+bool TePDIMixModelComponent::operator==( 
+  const TePDIMixModelComponent& external ) const
+{
+  return ( ( label == external.label ) && ( pixels == external.pixels ) );
+}
diff --git a/src/terralib/image_processing/TePDIMixModelComponent.hpp b/src/terralib/image_processing/TePDIMixModelComponent.hpp
old mode 100755
new mode 100644
index 478a1a9..ab8bdc0
--- a/src/terralib/image_processing/TePDIMixModelComponent.hpp
+++ b/src/terralib/image_processing/TePDIMixModelComponent.hpp
@@ -1,88 +1,91 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-
-#ifndef TEPDIMIXMODELCOMPONENT_HPP
-#define TEPDIMIXMODELCOMPONENT_HPP
-
-#include "TePDIDefines.hpp"
-#include <string>
-#include <map>
-
-using namespace std;
-
-/**
-* @brief This is the class contains the component information for mixmodel algorithms.
-* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-* @ingroup PDIMixModel
-*/
-
-class PDI_DLL TePDIMixModelComponent
-{
-	public:
-/**
-* Default constructor.
-* @param l name of the component (e.g. cloud, vegetation, ...).
-*/
-		TePDIMixModelComponent(string l);
-/**Default destructor.*/
-		~TePDIMixModelComponent();
-
-/**
-* Insert pixel.
-* @param bn band number where the pixel will be stored.
-* @param p pixel value.
-* @return true if pixel was inserted, false if not.
-*/
-		bool insertPixel(unsigned int bn, double p);
-/**
-* Remove pixel.
-* @param bn band number of the pixel to be removed.
-* @return true if pixel was removed, false if not.
-*/
-		bool removePixel(unsigned int bn);
-/**
-* Return pixel value.
-* @param bn pixel band number.
-* @return if bn exists, pixel value, if note -1.0.
-*/
-		double getPixel(unsigned int bn);
-/**
-* Return bands number.
-* @return bands number in the component.
-*/
-		unsigned getSize();
-/**Clear all the component.*/
-		void clearPixels();
-
-	private:
-/**The component name (e.g. cloud, vegetation, ...).*/
-		string label;
-/**Store band number and pixel value.*/
-		map<unsigned int, double> pixels;
-};
-
-#endif
-
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+
+#ifndef TEPDIMIXMODELCOMPONENT_HPP
+#define TEPDIMIXMODELCOMPONENT_HPP
+
+#include "TePDIDefines.hpp"
+#include <string>
+#include <map>
+
+using namespace std;
+
+/**
+* @class TePDIMixModelComponent
+* @brief This is the class contains the component information for mixmodel algorithms.
+* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+* @ingroup PDIMixModel
+*/
+class PDI_DLL TePDIMixModelComponent
+{
+	public:
+/**
+* Default constructor.
+* @param l name of the component (e.g. cloud, vegetation, ...).
+*/
+		TePDIMixModelComponent(string l);
+/**Default destructor.*/
+		~TePDIMixModelComponent();
+
+/**
+* Insert pixel.
+* @param bn band number where the pixel will be stored.
+* @param p pixel value.
+* @return true if pixel was inserted, false if not.
+*/
+		bool insertPixel(unsigned int bn, double p);
+/**
+* Remove pixel.
+* @param bn band number of the pixel to be removed.
+* @return true if pixel was removed, false if not.
+*/
+		bool removePixel(unsigned int bn);
+/**
+* Return pixel value.
+* @param bn pixel band number.
+* @return if bn exists, pixel value, if note -1.0.
+*/
+		double getPixel(unsigned int bn);
+/**
+* Return bands number.
+* @return bands number in the component.
+*/
+		unsigned getSize();
+/**Clear all the component.*/
+		void clearPixels();
+    
+    // overload
+    bool operator==( const TePDIMixModelComponent& external ) const;    
+
+	private:
+/**The component name (e.g. cloud, vegetation, ...).*/
+		string label;
+/**Store band number and pixel value.*/
+		map<unsigned int, double> pixels;
+};
+
+#endif
+
+
diff --git a/src/terralib/image_processing/TePDIMixModelComponentList.cpp b/src/terralib/image_processing/TePDIMixModelComponentList.cpp
old mode 100755
new mode 100644
index 1bd978e..42729a9
--- a/src/terralib/image_processing/TePDIMixModelComponentList.cpp
+++ b/src/terralib/image_processing/TePDIMixModelComponentList.cpp
@@ -1,79 +1,85 @@
-#include <TePDIMixModelComponentList.hpp>
-
-TePDIMixModelComponentList::TePDIMixModelComponentList()
-{
-}
-
-TePDIMixModelComponentList::~TePDIMixModelComponentList()
-{
-}
-
-bool TePDIMixModelComponentList::insertComponent(unsigned int cn, TePDIMixModelComponent c)
-{
-	components.insert(pair<unsigned int, TePDIMixModelComponent>(cn, c));
-
-	return true;
-}
-
-bool TePDIMixModelComponentList::insertComponent(unsigned int cn, string l)
-{
-	components.insert(pair<unsigned int, TePDIMixModelComponent>(cn, TePDIMixModelComponent(l)));
-
-	return true;
-}
-
-bool TePDIMixModelComponentList::removeComponent(unsigned int cn)
-{
-	components.erase(cn);
-
-	return true;
-}
-
-unsigned int TePDIMixModelComponentList::getSize()
-{
-	return components.size();
-}
-
-bool TePDIMixModelComponentList::insertPixel(unsigned int cn, unsigned int bn, double p)
-{
-	map<unsigned int, TePDIMixModelComponent>::iterator it = components.find(cn);
-
-	if (it == components.end())
-		return false;
-
-	it->second.insertPixel(bn, p);
-
-	return true;
-}
-
-bool TePDIMixModelComponentList::removePixel(unsigned int cn, unsigned int bn)
-{
-	map<unsigned int, TePDIMixModelComponent>::iterator it = components.find(cn);
-
-	if (it == components.end())
-		return false;
-
-	it->second.removePixel(bn);
-
-	return true;
-}
-
-double TePDIMixModelComponentList::getPixel(unsigned int cn, unsigned int bn)
-{
-	map<unsigned int, TePDIMixModelComponent>::iterator it = components.find(cn);
-
-	if (it == components.end())
-		return -1.0;
-
-	return it->second.getPixel(bn);
-}
-
-int TePDIMixModelComponentList::getComponentSize(unsigned cn)
-{
-	map<unsigned int, TePDIMixModelComponent>::iterator it = components.find(cn);
-
-	if (it == components.end())
-		return -1;
-
-	return it->second.getSize();
-}
+#include <TePDIMixModelComponentList.hpp>
+
+TePDIMixModelComponentList::TePDIMixModelComponentList()
+{
+}
+
+TePDIMixModelComponentList::~TePDIMixModelComponentList()
+{
+}
+
+bool TePDIMixModelComponentList::insertComponent(unsigned int cn, TePDIMixModelComponent c)
+{
+	components.insert(pair<unsigned int, TePDIMixModelComponent>(cn, c));
+
+	return true;
+}
+
+bool TePDIMixModelComponentList::insertComponent(unsigned int cn, string l)
+{
+	components.insert(pair<unsigned int, TePDIMixModelComponent>(cn, TePDIMixModelComponent(l)));
+
+	return true;
+}
+
+bool TePDIMixModelComponentList::removeComponent(unsigned int cn)
+{
+	components.erase(cn);
+
+	return true;
+}
+
+unsigned int TePDIMixModelComponentList::getSize()
+{
+	return components.size();
+}
+
+bool TePDIMixModelComponentList::insertPixel(unsigned int cn, unsigned int bn, double p)
+{
+	map<unsigned int, TePDIMixModelComponent>::iterator it = components.find(cn);
+
+	if (it == components.end())
+		return false;
+
+	it->second.insertPixel(bn, p);
+
+	return true;
+}
+
+bool TePDIMixModelComponentList::removePixel(unsigned int cn, unsigned int bn)
+{
+	map<unsigned int, TePDIMixModelComponent>::iterator it = components.find(cn);
+
+	if (it == components.end())
+		return false;
+
+	it->second.removePixel(bn);
+
+	return true;
+}
+
+double TePDIMixModelComponentList::getPixel(unsigned int cn, unsigned int bn)
+{
+	map<unsigned int, TePDIMixModelComponent>::iterator it = components.find(cn);
+
+	if (it == components.end())
+		return -1.0;
+
+	return it->second.getPixel(bn);
+}
+
+int TePDIMixModelComponentList::getComponentSize(unsigned cn)
+{
+	map<unsigned int, TePDIMixModelComponent>::iterator it = components.find(cn);
+
+	if (it == components.end())
+		return -1;
+
+	return it->second.getSize();
+}
+
+bool TePDIMixModelComponentList::operator==( 
+  const TePDIMixModelComponentList& external ) const
+{
+  return ( components == external.components );
+}
diff --git a/src/terralib/image_processing/TePDIMixModelComponentList.hpp b/src/terralib/image_processing/TePDIMixModelComponentList.hpp
old mode 100755
new mode 100644
index a0e0493..e6e9ac1
--- a/src/terralib/image_processing/TePDIMixModelComponentList.hpp
+++ b/src/terralib/image_processing/TePDIMixModelComponentList.hpp
@@ -1,107 +1,111 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMIXMODELCOMPONENTLIST_HPP
-#define TEPDIMIXMODELCOMPONENTLIST_HPP
-
-#include <string>
-#include <map>
-
-#include <TeSharedPtr.h>
-#include <TePDIMixModelComponent.hpp>
-
-using namespace std;
-
-/**
-* @brief This is the class contains the list of components for mixmodel algorithms.
-* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-* @ingroup PDIMixModel
-*/
-
-class PDI_DLL TePDIMixModelComponentList
-{
-	public:
-/**Default constructor.*/
-		TePDIMixModelComponentList();
-/**Default destructor.*/
-		~TePDIMixModelComponentList();
-/**
-* Insert component.
-* @param cn component number where the component will be stored.
-* @param c component to be stored.
-* @return true if the component was inserted, false if not.
-*/
-		bool insertComponent(unsigned cn, TePDIMixModelComponent c);
-/**
-* Insert a blank component called l.
-* @param cn component number where the component will be stored.
-* @param l name of the component (e.g. cloud, vegetation, ...).
-* @return true if the component was inserted, false if not.
-*/
-		bool insertComponent(unsigned cn, string l);
-/**
-* Remove component.
-* @param cn component number to be removed.
-* @return true if the component was removed, false if not.
-*/
-		bool removeComponent(unsigned cn);
-/**
-* Return component list size.
-* @return return the componentlist size.
-*/
-		unsigned getSize();
-/**
-* Insert pixel.
-* @param cn component number where the pixel will be stored.
-* @param bn band number where the pixel will be stored.
-* @param p value of the pixel.
-* @return true if the pixel was inserted, false if not.
-*/
-		bool insertPixel(unsigned cn, unsigned bn, double p);
-/**
-* Remove pixel.
-* @param cn component number where the pixel will be removed.
-* @param bn band number where the pixel will be removed.
-* @return true if the pixel was removed, false if not.
-*/
-		bool removePixel(unsigned cn, unsigned bn);
-/**
-* Return pixel value.
-* @param cn component number.
-* @param bn band number.
-* @return if cn and bn exist, pixel value, if not -1.0
-*/
-		double getPixel(unsigned cn, unsigned bn);
-/**
-* Return component size.
-* @param cn component number.
-* @return if cn exists, component size, if not -1.
-*/
-		int getComponentSize(unsigned cn);
-	private:
-/**Store component number and component.*/
-		map<unsigned, TePDIMixModelComponent> components;
-};
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMIXMODELCOMPONENTLIST_HPP
+#define TEPDIMIXMODELCOMPONENTLIST_HPP
+
+#include <string>
+#include <map>
+
+#include <TeSharedPtr.h>
+#include <TePDIMixModelComponent.hpp>
+
+using namespace std;
+
+/**
+* @class TePDIMixModelComponentList
+* @brief This is the class contains the list of components for mixmodel algorithms.
+* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+* @ingroup PDIMixModel
+*/
+class PDI_DLL TePDIMixModelComponentList
+{
+	public:
+/**Default constructor.*/
+		TePDIMixModelComponentList();
+/**Default destructor.*/
+		~TePDIMixModelComponentList();
+/**
+* Insert component.
+* @param cn component number where the component will be stored.
+* @param c component to be stored.
+* @return true if the component was inserted, false if not.
+*/
+		bool insertComponent(unsigned cn, TePDIMixModelComponent c);
+/**
+* Insert a blank component called l.
+* @param cn component number where the component will be stored.
+* @param l name of the component (e.g. cloud, vegetation, ...).
+* @return true if the component was inserted, false if not.
+*/
+		bool insertComponent(unsigned cn, string l);
+/**
+* Remove component.
+* @param cn component number to be removed.
+* @return true if the component was removed, false if not.
+*/
+		bool removeComponent(unsigned cn);
+/**
+* Return component list size.
+* @return return the componentlist size.
+*/
+		unsigned getSize();
+/**
+* Insert pixel.
+* @param cn component number where the pixel will be stored.
+* @param bn band number where the pixel will be stored.
+* @param p value of the pixel.
+* @return true if the pixel was inserted, false if not.
+*/
+		bool insertPixel(unsigned cn, unsigned bn, double p);
+/**
+* Remove pixel.
+* @param cn component number where the pixel will be removed.
+* @param bn band number where the pixel will be removed.
+* @return true if the pixel was removed, false if not.
+*/
+		bool removePixel(unsigned cn, unsigned bn);
+/**
+* Return pixel value.
+* @param cn component number.
+* @param bn band number.
+* @return if cn and bn exist, pixel value, if not -1.0
+*/
+		double getPixel(unsigned cn, unsigned bn);
+/**
+* Return component size.
+* @param cn component number.
+* @return if cn exists, component size, if not -1.
+*/
+		int getComponentSize(unsigned cn);
+    
+    // overload
+    bool operator==( const TePDIMixModelComponentList& external ) const;
+    
+	private:
+/**Store component number and component.*/
+		map<unsigned, TePDIMixModelComponent> components;
+};
+
+#endif
diff --git a/src/terralib/image_processing/TePDIMixModelFactory.cpp b/src/terralib/image_processing/TePDIMixModelFactory.cpp
old mode 100755
new mode 100644
index a3aea71..f3a71fc
--- a/src/terralib/image_processing/TePDIMixModelFactory.cpp
+++ b/src/terralib/image_processing/TePDIMixModelFactory.cpp
@@ -1,21 +1,21 @@
-#include "TePDIMixModelFactory.hpp"
-#include "TePDIMixModel.hpp"
-#include "TeAgnostic.h"
-
-
-TePDIMixModelFactory::TePDIMixModelFactory():TePDIAlgorithmFactory(std::string("TePDIMixModel"))
-{
-};
-
-TePDIMixModelFactory::~TePDIMixModelFactory()
-{
-};
-
-TePDIAlgorithm* TePDIMixModelFactory::build (const TePDIParameters& arg)
-{
-	TePDIAlgorithm* instance_ptr = new TePDIMixModel();
-	
-	TEAGN_TRUE_OR_THROW(instance_ptr->Reset(arg), "Invalid parameters");
-	
-	return instance_ptr;
-}
+#include "TePDIMixModelFactory.hpp"
+#include "TePDIMixModel.hpp"
+#include "TeAgnostic.h"
+
+
+TePDIMixModelFactory::TePDIMixModelFactory():TePDIAlgorithmFactory(std::string("TePDIMixModel"))
+{
+};
+
+TePDIMixModelFactory::~TePDIMixModelFactory()
+{
+};
+
+TePDIAlgorithm* TePDIMixModelFactory::build (const TePDIParameters& arg)
+{
+	TePDIAlgorithm* instance_ptr = new TePDIMixModel();
+	
+	TEAGN_TRUE_OR_THROW(instance_ptr->Reset(arg), "Invalid parameters");
+	
+	return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIMixModelFactory.hpp b/src/terralib/image_processing/TePDIMixModelFactory.hpp
old mode 100755
new mode 100644
index 577f4c2..1db22ca
--- a/src/terralib/image_processing/TePDIMixModelFactory.hpp
+++ b/src/terralib/image_processing/TePDIMixModelFactory.hpp
@@ -1,59 +1,59 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMIXMODELFACTORY_HPP
-#define TEPDIMIXMODELFACTORY_HPP
-
-#include <TeSharedPtr.h>
-#include "TePDIAlgorithmFactory.hpp"
-#include "TePDIParameters.hpp"
-
-/**
-* @brief This is the class for mixmodel algorithms factory.
-* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-* @ingroup PDIAlgorithmsFactories
-*/
-
-class PDI_DLL TePDIMixModelFactory : public TePDIAlgorithmFactory
-{
-	public :
-/**
-* Default constructor.
-*/
-		TePDIMixModelFactory();
-/**Default destructor.*/
-		~TePDIMixModelFactory();
-
-	protected :
-/**
-* Implementation for the abstract TeFactory::build.
-* @param arg A const reference to the parameters used by the algorithm.
-* @return A pointer to the new generated algorithm instance.
-*/
-	TePDIAlgorithm* build( const TePDIParameters& arg );
-};
-
-namespace{static TePDIMixModelFactory TePDIMixModelFactory_instance;};
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMIXMODELFACTORY_HPP
+#define TEPDIMIXMODELFACTORY_HPP
+
+#include <TeSharedPtr.h>
+#include "TePDIAlgorithmFactory.hpp"
+#include "TePDIParameters.hpp"
+
+/**
+* @brief This is the class for mixmodel algorithms factory.
+* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+* @ingroup PDIAlgorithmsFactories
+*/
+
+class PDI_DLL TePDIMixModelFactory : public TePDIAlgorithmFactory
+{
+	public :
+/**
+* Default constructor.
+*/
+		TePDIMixModelFactory();
+/**Default destructor.*/
+		~TePDIMixModelFactory();
+
+	protected :
+/**
+* Implementation for the abstract TeFactory::build.
+* @param arg A const reference to the parameters used by the algorithm.
+* @return A pointer to the new generated algorithm instance.
+*/
+	TePDIAlgorithm* build( const TePDIParameters& arg );
+};
+
+namespace{static TePDIMixModelFactory TePDIMixModelFactory_instance;};
+
+#endif
diff --git a/src/terralib/image_processing/TePDIMixModelSpectralBand.cpp b/src/terralib/image_processing/TePDIMixModelSpectralBand.cpp
old mode 100755
new mode 100644
index f124ced..66dcf30
--- a/src/terralib/image_processing/TePDIMixModelSpectralBand.cpp
+++ b/src/terralib/image_processing/TePDIMixModelSpectralBand.cpp
@@ -1,39 +1,49 @@
-#include <TePDIMixModelSpectralBand.hpp>
-
-TePDIMixModelSpectralBand::TePDIMixModelSpectralBand(unsigned int s, unsigned int b, double ll, double ul, string l)
-{
-	sensor = s;
-	band = b;
-	lowerlimit = ll;
-	upperlimit = ul;
-	label = l;
-}
-
-TePDIMixModelSpectralBand::~TePDIMixModelSpectralBand()
-{
-}
-
-unsigned int TePDIMixModelSpectralBand::getSensor()
-{
-	return sensor;
-}
-
-unsigned int TePDIMixModelSpectralBand::getBand()
-{
-	return band;
-}
-
-double TePDIMixModelSpectralBand::getLowerLimit()
-{
-	return lowerlimit;
-}
-
-double TePDIMixModelSpectralBand::getUpperLimit()
-{
-	return upperlimit;
-}
-
-string TePDIMixModelSpectralBand::getLabel()
-{
-	return label;
-}
+#include <TePDIMixModelSpectralBand.hpp>
+
+TePDIMixModelSpectralBand::TePDIMixModelSpectralBand(unsigned int s, unsigned int b, double ll, double ul, string l)
+{
+	sensor = s;
+	band = b;
+	lowerlimit = ll;
+	upperlimit = ul;
+	label = l;
+}
+
+TePDIMixModelSpectralBand::~TePDIMixModelSpectralBand()
+{
+}
+
+unsigned int TePDIMixModelSpectralBand::getSensor()
+{
+	return sensor;
+}
+
+unsigned int TePDIMixModelSpectralBand::getBand()
+{
+	return band;
+}
+
+double TePDIMixModelSpectralBand::getLowerLimit()
+{
+	return lowerlimit;
+}
+
+double TePDIMixModelSpectralBand::getUpperLimit()
+{
+	return upperlimit;
+}
+
+string TePDIMixModelSpectralBand::getLabel()
+{
+	return label;
+}
+
+bool TePDIMixModelSpectralBand::operator==( 
+  const TePDIMixModelSpectralBand& external ) const
+{
+  return ( ( sensor == external.sensor ) && ( band == external.band ) 
+    && ( lowerlimit == external.lowerlimit ) 
+    && ( upperlimit == external.upperlimit ) 
+    && ( label == external.label ) );
+}
+
diff --git a/src/terralib/image_processing/TePDIMixModelSpectralBand.hpp b/src/terralib/image_processing/TePDIMixModelSpectralBand.hpp
old mode 100755
new mode 100644
index e6822a6..e49c331
--- a/src/terralib/image_processing/TePDIMixModelSpectralBand.hpp
+++ b/src/terralib/image_processing/TePDIMixModelSpectralBand.hpp
@@ -1,98 +1,101 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMIXMODELSPECTRALBAND_HPP
-#define TEPDIMIXMODELSPECTRALBAND_HPP
-
-#include "TePDIDefines.hpp"
-#include <string>
-
-using namespace std;
-
-/**
-* @brief This is the class contains the spectral band information for mixmodel algorithms.
-* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-* @ingroup PDIMixModel
-*/
-
-class PDI_DLL TePDIMixModelSpectralBand
-{
-	public:
-/**
-* Default constructor.
-* @param s sensor number.
-* @param b band number.
-* @param ll lower spectral range bound.
-* @param ul upper spectral range bound.
-* @note In "princo" strategy case, the parameters s, ll and ul, can be zero.
-* @param l spectral band name (e.g. CBERS_RED, CBERS_BLUE, CBERS_GREEN, ...).
-*/
-		TePDIMixModelSpectralBand(unsigned int s, unsigned int b, double ll, double ul, string l);
-/**Default constructor.*/
-		~TePDIMixModelSpectralBand();
-/**
-* Return the sensor.
-* @return sensor number.
-*/
-		unsigned int getSensor();
-/**
-* Return band number.
-* @return band number.
-*/
-		unsigned int getBand();
-/**
-* Return lower spectral range bound.
-* @return lower spectral range bound.
-*/
-		double getLowerLimit();
-/**
-* Return upper spectral range bound.
-* @return upper spectral range bound.
-*/
-		double getUpperLimit();
-/**
-* Return spectral band name.
-* @return spectral band name.
-*/
-		string getLabel();
-
-	private:
-    /** @brief Sensor number.*/	
-		unsigned int	sensor;
-
-    /** @brief Band number.*/			
-		unsigned int	band;
-
-    /** @brief Lower spectral range bound.*/			
-		double	lowerlimit;
-
-    /** @brief Upper spectral range bound.*/			
-		double	upperlimit;
-
-    /** @brief Spectral band name.*/			
-		string label;
-
-};
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMIXMODELSPECTRALBAND_HPP
+#define TEPDIMIXMODELSPECTRALBAND_HPP
+
+#include "TePDIDefines.hpp"
+#include <string>
+
+using namespace std;
+
+/**
+* @class TePDIMixModelSpectralBand
+* @brief This is the class contains the spectral band information for mixmodel algorithms.
+* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+* @ingroup PDIMixModel
+*/
+class PDI_DLL TePDIMixModelSpectralBand
+{
+	public:
+/**
+* Default constructor.
+* @param s sensor number.
+* @param b band number.
+* @param ll lower spectral range bound.
+* @param ul upper spectral range bound.
+* @note In "princo" strategy case, the parameters s, ll and ul, can be zero.
+* @param l spectral band name (e.g. CBERS_RED, CBERS_BLUE, CBERS_GREEN, ...).
+*/
+		TePDIMixModelSpectralBand(unsigned int s, unsigned int b, double ll, double ul, string l);
+/**Default constructor.*/
+		~TePDIMixModelSpectralBand();
+/**
+* Return the sensor.
+* @return sensor number.
+*/
+		unsigned int getSensor();
+/**
+* Return band number.
+* @return band number.
+*/
+		unsigned int getBand();
+/**
+* Return lower spectral range bound.
+* @return lower spectral range bound.
+*/
+		double getLowerLimit();
+/**
+* Return upper spectral range bound.
+* @return upper spectral range bound.
+*/
+		double getUpperLimit();
+/**
+* Return spectral band name.
+* @return spectral band name.
+*/
+		string getLabel();
+    
+    // overload
+    bool operator==( const TePDIMixModelSpectralBand& external ) const;        
+
+	private:
+    /** @brief Sensor number.*/	
+		unsigned int	sensor;
+
+    /** @brief Band number.*/			
+		unsigned int	band;
+
+    /** @brief Lower spectral range bound.*/			
+		double	lowerlimit;
+
+    /** @brief Upper spectral range bound.*/			
+		double	upperlimit;
+
+    /** @brief Spectral band name.*/			
+		string label;
+
+};
+
+#endif
diff --git a/src/terralib/image_processing/TePDIMixModelSpectralBandList.cpp b/src/terralib/image_processing/TePDIMixModelSpectralBandList.cpp
old mode 100755
new mode 100644
index 864874c..c5725b2
--- a/src/terralib/image_processing/TePDIMixModelSpectralBandList.cpp
+++ b/src/terralib/image_processing/TePDIMixModelSpectralBandList.cpp
@@ -1,54 +1,62 @@
-#include <TePDIMixModelSpectralBandList.hpp>
-
-TePDIMixModelSpectralBandList::TePDIMixModelSpectralBandList()
-{
-}
-
-TePDIMixModelSpectralBandList::~TePDIMixModelSpectralBandList()
-{
-}
-
-bool TePDIMixModelSpectralBandList::insertSpectralBand(TePDIMixModelSpectralBand sb)
-{
-	bands.push_back(sb);
-
-	return true;
-}
-
-bool TePDIMixModelSpectralBandList::loadSpectralBandsFromFile(string filename)
-{
-	FILE *fsb = fopen(filename.c_str(), "r");
-
-	if (fsb != NULL)
-	{
-		TEAGN_LOGERR("ok\n");
-		unsigned int	s,
-				b;
-		double	ll,
-			ul;
-		char l[256];
-		while (fscanf(fsb, "%d %d %lf %lf %s", &s, &b, &ll, &ul, l) >= 5)
-		{
-			insertSpectralBand(TePDIMixModelSpectralBand(s, b, ll, ul, l));
-		}
-		fclose(fsb);
-		return true;
-	}
-	else
-		return false;
-}
-
-unsigned int TePDIMixModelSpectralBandList::getSize()
-{
-	return bands.size();
-}
-
-string TePDIMixModelSpectralBandList::getSpectralBandLabel(unsigned int b)
-{
-	return bands[b].getLabel();
-}
-
-TePDIMixModelSpectralBand TePDIMixModelSpectralBandList::getSpectralBand(unsigned int b)
-{
-	return bands[b];
-}
+#include <TePDIMixModelSpectralBandList.hpp>
+
+#include <cstdio>
+
+TePDIMixModelSpectralBandList::TePDIMixModelSpectralBandList()
+{
+}
+
+TePDIMixModelSpectralBandList::~TePDIMixModelSpectralBandList()
+{
+}
+
+bool TePDIMixModelSpectralBandList::insertSpectralBand(TePDIMixModelSpectralBand sb)
+{
+	bands.push_back(sb);
+
+	return true;
+}
+
+bool TePDIMixModelSpectralBandList::loadSpectralBandsFromFile(string filename)
+{
+	FILE *fsb = fopen(filename.c_str(), "r");
+
+	if (fsb != NULL)
+	{
+		TEAGN_LOGERR("ok\n");
+		unsigned int	s,
+				b;
+		double	ll,
+			ul;
+		char l[256];
+		while (fscanf(fsb, "%d %d %lf %lf %s", &s, &b, &ll, &ul, l) >= 5)
+		{
+			insertSpectralBand(TePDIMixModelSpectralBand(s, b, ll, ul, l));
+		}
+		fclose(fsb);
+		return true;
+	}
+	else
+		return false;
+}
+
+unsigned int TePDIMixModelSpectralBandList::getSize()
+{
+	return bands.size();
+}
+
+string TePDIMixModelSpectralBandList::getSpectralBandLabel(unsigned int b)
+{
+	return bands[b].getLabel();
+}
+
+TePDIMixModelSpectralBand TePDIMixModelSpectralBandList::getSpectralBand(unsigned int b)
+{
+	return bands[b];
+}
+
+bool TePDIMixModelSpectralBandList::operator==( 
+  const TePDIMixModelSpectralBandList& external ) const
+{
+  return ( bands == external.bands );
+}
diff --git a/src/terralib/image_processing/TePDIMixModelSpectralBandList.hpp b/src/terralib/image_processing/TePDIMixModelSpectralBandList.hpp
old mode 100755
new mode 100644
index dc44d95..1f0dbf9
--- a/src/terralib/image_processing/TePDIMixModelSpectralBandList.hpp
+++ b/src/terralib/image_processing/TePDIMixModelSpectralBandList.hpp
@@ -1,83 +1,87 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMIXMODELSPECTRALBANDLIST_HPP
-#define TEPDIMIXMODELSPECTRALBANDLIST_HPP
-
-#include <string>
-#include <vector>
-
-#include <TeAgnostic.h>
-#include <TePDIMixModelSpectralBand.hpp>
-
-using namespace std;
-
-/**
-* @brief This is the class contains the list of spectral bands for mixmodel algorithms.
-* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-* @ingroup PDIMixModel
-*/
-
-class PDI_DLL TePDIMixModelSpectralBandList
-{
-	public:
-/**Default constructor.*/
-		TePDIMixModelSpectralBandList();
-/**Default destructor.*/
-		~TePDIMixModelSpectralBandList();
-/**
-* Insert spectral band.
-* @param sb spectral band to be stored.
-* @return true if the spectral band was inserted, false if not.
-*/
-		bool insertSpectralBand(TePDIMixModelSpectralBand sb);
-/**
-* Load spectral band file.
-* @note This file have the following format: sensor_number band_number lower_spectral_range_bound upper_spectral_range_bound spectral_band_name (e.g. 160 1 0.450000 0.520000 Landsat5-TM1)
-* @param filename file name with spectral bands information.
-* @return true if the file was loaded sucessfully, false if not.
-*/
-		bool loadSpectralBandsFromFile(string filename);
-/**
-* Return spectral band list size.
-* @return return the spectralbandlist size.
-*/
-		unsigned int getSize();
-/**
-* Return spectral band name.
-* @param b band number.
-* @return return the spectral band name.
-*/
-		string getSpectralBandLabel(unsigned int b);
-/**
-* Return spectral band.
-* @param b band number.
-* @return return the spectral band.
-*/
-		TePDIMixModelSpectralBand getSpectralBand(unsigned int b);
-	private:
-/**Store the spectral bands*/
-		vector<TePDIMixModelSpectralBand> bands;
-};
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMIXMODELSPECTRALBANDLIST_HPP
+#define TEPDIMIXMODELSPECTRALBANDLIST_HPP
+
+#include <string>
+#include <vector>
+
+#include <TeAgnostic.h>
+#include <TePDIMixModelSpectralBand.hpp>
+
+using namespace std;
+
+/**
+* @class TePDIMixModelSpectralBandList
+* @brief This is the class contains the list of spectral bands for mixmodel algorithms.
+* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+* @ingroup PDIMixModel
+*/
+class PDI_DLL TePDIMixModelSpectralBandList
+{
+	public:
+/**Default constructor.*/
+		TePDIMixModelSpectralBandList();
+/**Default destructor.*/
+		~TePDIMixModelSpectralBandList();
+/**
+* Insert spectral band.
+* @param sb spectral band to be stored.
+* @return true if the spectral band was inserted, false if not.
+*/
+		bool insertSpectralBand(TePDIMixModelSpectralBand sb);
+/**
+* Load spectral band file.
+* @note This file have the following format: sensor_number band_number lower_spectral_range_bound upper_spectral_range_bound spectral_band_name (e.g. 160 1 0.450000 0.520000 Landsat5-TM1)
+* @param filename file name with spectral bands information.
+* @return true if the file was loaded sucessfully, false if not.
+*/
+		bool loadSpectralBandsFromFile(string filename);
+/**
+* Return spectral band list size.
+* @return return the spectralbandlist size.
+*/
+		unsigned int getSize();
+/**
+* Return spectral band name.
+* @param b band number.
+* @return return the spectral band name.
+*/
+		string getSpectralBandLabel(unsigned int b);
+/**
+* Return spectral band.
+* @param b band number.
+* @return return the spectral band.
+*/
+		TePDIMixModelSpectralBand getSpectralBand(unsigned int b);
+    
+    // overload
+    bool operator==( const TePDIMixModelSpectralBandList& external ) const;
+        
+	private:
+/**Store the spectral bands*/
+		vector<TePDIMixModelSpectralBand> bands;
+};
+#endif
diff --git a/src/terralib/image_processing/TePDIMixModelStratFactory.cpp b/src/terralib/image_processing/TePDIMixModelStratFactory.cpp
index 6fa0fc3..03de019 100644
--- a/src/terralib/image_processing/TePDIMixModelStratFactory.cpp
+++ b/src/terralib/image_processing/TePDIMixModelStratFactory.cpp
@@ -1,12 +1,12 @@
- 
-#include "TePDIMixModelStratFactory.hpp"
-
-TePDIMixModelStratFactory::TePDIMixModelStratFactory( 
-  const std::string& factoryName )
-: TeFactory< TePDIMixModelStrategy, TePDIParameters >( factoryName )
-{
-};      
-
-TePDIMixModelStratFactory::~TePDIMixModelStratFactory()
-{
-};
+ 
+#include "TePDIMixModelStratFactory.hpp"
+
+TePDIMixModelStratFactory::TePDIMixModelStratFactory( 
+  const std::string& factoryName )
+: TeFactory< TePDIMixModelStrategy, TePDIParameters >( factoryName )
+{
+};      
+
+TePDIMixModelStratFactory::~TePDIMixModelStratFactory()
+{
+};
diff --git a/src/terralib/image_processing/TePDIMixModelStratFactory.hpp b/src/terralib/image_processing/TePDIMixModelStratFactory.hpp
index c3d0ac5..3a256a2 100644
--- a/src/terralib/image_processing/TePDIMixModelStratFactory.hpp
+++ b/src/terralib/image_processing/TePDIMixModelStratFactory.hpp
@@ -1,66 +1,66 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef PDI_MIXMODEL_SF_REGISTERED
-  #define PDI_MIXMODEL_SF_REGISTERED
-  
-  #include <TePDIPrincoMixModelSF.hpp>
-  
-#endif 
-
-#ifndef TEPDIMIXMODELSTRATFACTORY_HPP
-  #define TEPDIMIXMODELSTRATFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include <TePDIMixModelStrategy.hpp>
-  #include <TePDIParameters.hpp>
-  #include <TeFactory.h>
-
-  /**
-   * @brief This is the class for blending strategy factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategyFactories
-   */
-  class PDI_DLL TePDIMixModelStratFactory : 
-    public TeFactory< TePDIMixModelStrategy, TePDIParameters >
-  {
-    public :
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIMixModelStratFactory();
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIMixModelStratFactory( const std::string& factoryName );
-  };
-  
-#endif
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef PDI_MIXMODEL_SF_REGISTERED
+  #define PDI_MIXMODEL_SF_REGISTERED
+  
+  #include <TePDIPrincoMixModelSF.hpp>
+  
+#endif 
+
+#ifndef TEPDIMIXMODELSTRATFACTORY_HPP
+  #define TEPDIMIXMODELSTRATFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include <TePDIMixModelStrategy.hpp>
+  #include <TePDIParameters.hpp>
+  #include <TeFactory.h>
+
+  /**
+   * @brief This is the class for blending strategy factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIStrategyFactories
+   */
+  class PDI_DLL TePDIMixModelStratFactory : 
+    public TeFactory< TePDIMixModelStrategy, TePDIParameters >
+  {
+    public :
+      
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TePDIMixModelStratFactory();
+      
+    protected :
+      
+      /**
+       * @brief Default constructor
+       *
+       * @param factoryName Factory name.
+       */
+      TePDIMixModelStratFactory( const std::string& factoryName );
+  };
+  
+#endif
+
diff --git a/src/terralib/image_processing/TePDIMixModelStrategy.cpp b/src/terralib/image_processing/TePDIMixModelStrategy.cpp
index ecf41fe..1b7030a 100644
--- a/src/terralib/image_processing/TePDIMixModelStrategy.cpp
+++ b/src/terralib/image_processing/TePDIMixModelStrategy.cpp
@@ -1,22 +1,22 @@
-#include "TePDIMixModelStrategy.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIMixModelStrategy::TePDIMixModelStrategy()
-{
-};      
-
-
-TePDIMixModelStrategy::~TePDIMixModelStrategy()
-{
-};
-
-
-TePDIMixModelStrategy* TePDIMixModelStrategy::DefaultObject( 
-  const TePDIParameters& )
-{
-  TEAGN_LOG_AND_THROW( 
-    "Trying to build an invalid mixmodel strategy instance" );
-  return 0; 
-}
-
+#include "TePDIMixModelStrategy.hpp"
+#include <TeAgnostic.h>
+
+
+TePDIMixModelStrategy::TePDIMixModelStrategy()
+{
+};      
+
+
+TePDIMixModelStrategy::~TePDIMixModelStrategy()
+{
+};
+
+
+TePDIMixModelStrategy* TePDIMixModelStrategy::DefaultObject( 
+  const TePDIParameters& )
+{
+  TEAGN_LOG_AND_THROW( 
+    "Trying to build an invalid mixmodel strategy instance" );
+  return 0; 
+}
+
diff --git a/src/terralib/image_processing/TePDIMixModelStrategy.hpp b/src/terralib/image_processing/TePDIMixModelStrategy.hpp
index 8edcef6..da934d5 100644
--- a/src/terralib/image_processing/TePDIMixModelStrategy.hpp
+++ b/src/terralib/image_processing/TePDIMixModelStrategy.hpp
@@ -1,72 +1,72 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMIXMODELSTRATEGY_HPP
-  #define TEPDIMIXMODELSTRATEGY_HPP
-
-  #include "TePDIStrategy.hpp"
-
-  /**
-   * @brief This is the base class for mix models strategies.
-   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategies
-   */
-  class PDI_DLL TePDIMixModelStrategy : public TePDIStrategy {
-    public:
-      /** @typedef TeSharedPtr< TePDIMixModelStrategy > pointer 
-          Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIMixModelStrategy > pointer;
-      
-      /** @typedef const TeSharedPtr< TePDIMixModelStrategy > const_pointer 
-          Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIMixModelStrategy > const_pointer;  
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIMixModelStrategy();      
-      
-      /**
-       * @brief Returns a default object.
-       *
-       * @return A default object.
-       */
-      static TePDIMixModelStrategy* DefaultObject( const TePDIParameters& );
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIMixModelStrategy();        
-  
-  };
-  
-#endif
-
-
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMIXMODELSTRATEGY_HPP
+  #define TEPDIMIXMODELSTRATEGY_HPP
+
+  #include "TePDIStrategy.hpp"
+
+  /**
+   * @brief This is the base class for mix models strategies.
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIStrategies
+   */
+  class PDI_DLL TePDIMixModelStrategy : public TePDIStrategy {
+    public:
+      /** @typedef TeSharedPtr< TePDIMixModelStrategy > pointer 
+          Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIMixModelStrategy > pointer;
+      
+      /** @typedef const TeSharedPtr< TePDIMixModelStrategy > const_pointer 
+          Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIMixModelStrategy > const_pointer;  
+      
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TePDIMixModelStrategy();      
+      
+      /**
+       * @brief Returns a default object.
+       *
+       * @return A default object.
+       */
+      static TePDIMixModelStrategy* DefaultObject( const TePDIParameters& );
+      
+    protected :
+      
+      /**
+       * @brief Default constructor
+       *
+       * @param factoryName Factory name.
+       */
+      TePDIMixModelStrategy();        
+  
+  };
+  
+#endif
+
+
+
diff --git a/src/terralib/image_processing/TePDIMorfFilter.cpp b/src/terralib/image_processing/TePDIMorfFilter.cpp
old mode 100755
new mode 100644
index db48111..9aa8a33
--- a/src/terralib/image_processing/TePDIMorfFilter.cpp
+++ b/src/terralib/image_processing/TePDIMorfFilter.cpp
@@ -1,1335 +1,1335 @@
-#include "TePDIMorfFilter.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIFilterMask.hpp"
-#include "TePDIUtils.hpp"
-
-#include "math.h"
-
-
-TePDIMorfFilter::TePDIMorfFilter()
-{
-  double_buffer_ = 0;
-}
-
-
-TePDIMorfFilter::~TePDIMorfFilter()
-{
-  if( double_buffer_ ) {
-    delete[] double_buffer_;
-  }
-}
-
-
-bool TePDIMorfFilter::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking for general required parameters */
-
-  TePDITypes::TePDIRasterPtrType inRaster;
-  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: input_image" );
-    return false;
-  }
-  if( ! inRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
-    return false;
-  }
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: output_image" );
-    return false;
-  }
-  if( ! outRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
-    return false;
-  }
-
-  /* Filter type checking */
-  TePDIMorfType filter_type;
-  if( ! parameters.GetParameter( "filter_type", filter_type ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: filter_type" );
-    return false;
-  }
-  if( ( filter_type != TePDIMDilationType ) &&
-      ( filter_type != TePDIMErosionType ) &&
-      ( filter_type != TePDIMMedianType ) &&
-      ( filter_type != TePDIMModeType ) ) {
-
-    TEAGN_LOGERR( "Invalid parameter: filter_type" );
-    return false;
-  }
-
-  /* channels parameter checking */
-
-  std::vector< int > channels;
-  if( ! parameters.GetParameter( "channels", channels ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: channels" );
-    return false;
-  }
-  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
-    if( channels[ index ] >= inRaster->nBands() ) {
-      TEAGN_LOGERR( "Invalid parameter: channels" );
-      return false;
-    }
-  }
-
-  /* Filter mask checking */
-
-  TePDIFilterMask::pointer mask;
-
-  if( ! parameters.GetParameter( "filter_mask", mask ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: filter_mask" );
-    return false;
-  }
-  if( ! mask.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: filter_mask inactive" );
-    return false;
-  }
-  if( mask->columns() < 3 ) {
-    TEAGN_WATCH( mask->columns() );
-    TEAGN_LOGERR( "Invalid parameter: filter_mask with invalid colunms number" );
-    return false;
-  }
-  if( mask->lines() < 3 ) {
-    TEAGN_WATCH( mask->lines() );
-    TEAGN_LOGERR( "Invalid parameter: filter_mask with invalid lines number" );
-    return false;
-  }
-  if( ( (int)mask->lines() > inRaster->params().nlines_ ) ||
-      ( (int)mask->columns() > inRaster->params().ncols_ ) ){
-    TEAGN_LOGERR( "Invalid parameter: filter_mask do not fit inside input image" );
-    return false;
-  }
-  TEAGN_TRUE_OR_RETURN(
-    mask->isMorfMask(), "Invalid mask: Not a morfological mask" );
-
-  /* Checking for number of iterations */
-
-  int iterations = 0;
-  if( ! parameters.GetParameter( "iterations", iterations ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: iterations" );
-    return false;
-  }
-  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
-
-  return true;
-}
-
-
-bool TePDIMorfFilter::RunImplementation()
-{
-  TePDIMorfType filter_type;
-  params_.GetParameter( "filter_type", filter_type );
-
-  switch( filter_type ) {
-    case TePDIMDilationType :
-    {
-      return RunDilation();
-      break;
-    }
-    case TePDIMErosionType :
-    {
-      return RunErosion();
-      break;
-    }
-    case TePDIMMedianType :
-    {
-      return RunMedian();
-      break;
-    }
-    case TePDIMModeType :
-    {
-      return RunMode();
-      break;
-    }    
-    default :
-    {
-      TEAGN_LOG_AND_RETURN( "Invalid algorithm type" );
-    }
-  }
-}
-
-
-bool TePDIMorfFilter::RunDilation()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  TePDIFilterMask::pointer mask;
-  params_.GetParameter( "filter_mask", mask );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-  
-  bool inRaster_uses_dummy = inRaster->params().useDummy_;
-
-  /* Setting the output raster */
-
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );  
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ ); 
-    
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
-  
-  if( inRaster->params().useDummy_ ) {
-    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
-  } else {
-    outRaster_params.setDummy( 0, -1 );
-  }  
-
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );    
-
-  /* Creating the temporary rasters with one band each */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  if( iterations > 1 ) {
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
-      aux_raster1, 1, true, false, TeDOUBLE ), 
-      "Unable to create auxiliary raster 1" );
-  }
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;
-  if( iterations > 2 ) {
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
-      aux_raster2, 1, true, false, TeDOUBLE ), 
-      "Unable to create auxiliary raster 2" );
-  }
-
-  /* Updating the global temporary representation of mask weights */
-
-  reset_maskmatrix( mask );
-
-  /* Setting the convolution buffer initial state */
-
-  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  reset_conv_buf( temp_maskmatrix_lines_, raster_columns );
-
-  /* Convolution Loop */
-  
-  double output_level = 0; /* the value generated by each pixel mask calcule */
-
-  double max_gen_level = 0;/* The maximum value generated by each mask convolution */
-
-  unsigned int mask_middle_off_lines =
-    (unsigned int) floor( ((double)temp_maskmatrix_lines_) / 2. );
-  unsigned int mask_middle_off_columns =
-    (unsigned int) floor( ((double)temp_maskmatrix_columns_) / 2. );
-
-  unsigned int conv_column_bound = raster_columns - temp_maskmatrix_columns_ + 1;
-  unsigned int conv_line_bound = raster_lines - temp_maskmatrix_lines_ + 1;
-
-  unsigned int mask_line = 0;
-  unsigned int mask_column = 0;
-  unsigned int raster_line = 0;
-  unsigned int conv_buf_column = 0;
-
-  double out_channel_min_level = 0;
-  double out_channel_max_level = 0;
-  
-  double dummy_value = 0;
-  double curr_buf_value = 0;
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-  
-  StartProgInt( "Dilation", channels.size() * iterations *
-     conv_line_bound );  
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-       
-    unsigned int current_input_channel =0;
-    unsigned int curr_out_channel = 0;
-       
-    if( inRaster_uses_dummy ) {
-      dummy_value = inRaster->params().dummy_[ current_input_channel ];
-    }
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels_index, out_channel_min_level,
-      out_channel_max_level ), "Unable to get raster channel level bounds" );
-
-    for( int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-      if( iteration == 0 ) {
-        /* The first iteration */
-        
-        source_raster = inRaster;
-        current_input_channel = channels[ channels_index ];
-        
-        if( iterations > 1 ) {
-          target_raster = aux_raster1;
-          curr_out_channel = 0;
-        } else {
-          target_raster = outRaster;
-          curr_out_channel = channels[ channels_index ];
-        }
-      } else if ( iteration == ( iterations - 1 ) ) {
-        /* The last iteration */
-        
-        current_input_channel = 0;
-        source_raster = target_raster;
-        
-        target_raster = outRaster;
-        curr_out_channel = channels[ channels_index ];
-      } else {
-        /* The intermediary iteration */
-        
-        if( iteration == 1 ) {
-          source_raster = target_raster;
-          current_input_channel = 0;
-        
-          target_raster = aux_raster1;
-          curr_out_channel = 0;
-        } else {        
-          TePDITypes::TePDIRasterPtrType swap_ptr = source_raster;
-          source_raster = target_raster;
-          current_input_channel = 0;
-            
-          target_raster = swap_ptr;
-          curr_out_channel = 0;
-        }
-      }
-
-      /* Fills the convolution buffer with the first "mask_lines" from the raster */
-
-      for( unsigned int line = 0 ; line < ( temp_maskmatrix_lines_ - 1 ); 
-        ++line ) {
-        
-        up_conv_buf( source_raster, line, current_input_channel );
-      }
-
-      /* raster convolution */
-
-      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
-          conv_line_bound ) +
-          ( iteration * conv_line_bound ) + raster_line ),
-          "Canceled by the user" );
-        
-        up_conv_buf( source_raster, raster_line + temp_maskmatrix_lines_ - 1,
-          current_input_channel );
-
-        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
-             ++conv_buf_column ) {
-
-          output_level = 0;
-          
-          if( inRaster_uses_dummy ) {
-            max_gen_level = dummy_value;
-            
-            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; 
-              ++mask_line ) {
-              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
-                  ++mask_column ) {
-                  
-                curr_buf_value = conv_buf_[ mask_line ][ conv_buf_column + 
-                  mask_column ];
-                  
-                if( curr_buf_value != dummy_value ) {
-                  output_level = temp_maskmatrix_[ mask_line ][ mask_column ] *
-                    curr_buf_value;
-                    
-                  if( max_gen_level == dummy_value ) {
-                    max_gen_level = output_level;
-                  } else {
-                    if( output_level > max_gen_level ) {
-                      max_gen_level = output_level;
-                    }
-                  }
-                }
-              }
-            }
-          } else {
-            max_gen_level = out_channel_min_level;
-            
-            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; 
-              ++mask_line ) {
-              
-              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
-                  ++mask_column ) {
-                output_level = temp_maskmatrix_[ mask_line ][ mask_column ] *
-                  conv_buf_[ mask_line ][ conv_buf_column + mask_column ];
-  
-                if( output_level > max_gen_level ) {
-                  max_gen_level = output_level;
-                }
-              }
-            }
-          }
-
-          /* Level range filtering */
-
-          if( max_gen_level < out_channel_min_level ) {
-            max_gen_level = out_channel_min_level;
-          } else if( max_gen_level > out_channel_max_level ) {
-            max_gen_level = out_channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            conv_buf_column + mask_middle_off_columns,
-            raster_line +  mask_middle_off_lines, max_gen_level, 
-            curr_out_channel ), "Pixel mapping error" );
-        }
-      }
-    }
-  }
-
-  return true;
-
-}
-
-bool TePDIMorfFilter::RunErosion()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  TePDIFilterMask::pointer mask;
-  params_.GetParameter( "filter_mask", mask );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-  
-  bool inRaster_uses_dummy = inRaster->params().useDummy_;
-
-  /* Setting the output raster */
-
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );  
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ );
-    
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );   
-  
-  if( inRaster->params().useDummy_ ) {
-    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
-  } else {
-    outRaster_params.setDummy( 0, -1 );
-  }  
-
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );    
-
-  /* Creating the temporary rasters with one band each */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  if( iterations > 1 ) {
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
-      aux_raster1, 1, true, false, TeDOUBLE ), 
-      "Unable to create auxiliary raster 1" );
-  }
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;
-  if( iterations > 2 ) {
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
-      aux_raster2, 1, true, false, TeDOUBLE ), 
-      "Unable to create auxiliary raster 2" );
-  }
-
-  /* Updating the global temporary representation of mask weights */
-
-  reset_maskmatrix( mask );
-
-  /* Setting the convolution buffer initial state */
-
-  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  reset_conv_buf( temp_maskmatrix_lines_, raster_columns );
-
-  /* Convolution Loop */
-
-  double output_level; /* the value generated by each pixel mask calcule */
-
-  double min_gen_level; /* The minimal value generated by each mask convolution */
-
-  unsigned int mask_middle_off_lines =
-    (unsigned int) floor( ((double)temp_maskmatrix_lines_) / 2. );
-  unsigned int mask_middle_off_columns =
-    (unsigned int) floor( ((double)temp_maskmatrix_columns_) / 2. );
-
-  unsigned int conv_column_bound = raster_columns - temp_maskmatrix_columns_ + 1;
-  unsigned int conv_line_bound = raster_lines - temp_maskmatrix_lines_ + 1;
-
-  unsigned int mask_line;
-  unsigned int mask_column;
-  unsigned int raster_line;
-  unsigned int conv_buf_column;
-
-  double out_channel_min_level;
-  double out_channel_max_level;
-  
-  double dummy_value = 0;
-  double curr_buf_value = 0;
-  double curr_mask_value = 0;
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-
-  StartProgInt( "Erosion", channels.size() * iterations *
-     conv_line_bound );  
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-       
-    unsigned int current_input_channel = channels[ channels_index ];
-    unsigned int curr_out_channel = 0;
-    
-    if( inRaster_uses_dummy ) {
-      dummy_value = inRaster->params().dummy_[ current_input_channel ];
-    }    
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels_index, out_channel_min_level,
-      out_channel_max_level ), "Unable to get raster channel level bounds" );
-
-    for( int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-      if( iteration == 0 ) {
-        /* The first iteration */
-        
-        source_raster = inRaster;
-        current_input_channel = channels[ channels_index ];
-        
-        if( iterations > 1 ) {
-          target_raster = aux_raster1;
-          curr_out_channel = 0;
-        } else {
-          target_raster = outRaster;
-          curr_out_channel = channels[ channels_index ];
-        }
-      } else if ( iteration == ( iterations - 1 ) ) {
-        /* The last iteration */
-        
-        current_input_channel = 0;
-        source_raster = target_raster;
-        
-        target_raster = outRaster;
-        curr_out_channel = channels[ channels_index ];
-      } else {
-        /* The intermediary iteration */
-        
-        if( iteration == 1 ) {
-          source_raster = target_raster;
-          current_input_channel = 0;
-        
-          target_raster = aux_raster1;
-          curr_out_channel = 0;
-        } else {        
-          TePDITypes::TePDIRasterPtrType swap_ptr = source_raster;
-          source_raster = target_raster;
-          current_input_channel = 0;
-            
-          target_raster = swap_ptr;
-          curr_out_channel = 0;
-        }
-      }
-
-      /* Fills the convolution buffer with the first "mask_lines" from the raster */
-
-      for( unsigned int line = 0 ; line < ( temp_maskmatrix_lines_ - 1 ); ++line ) {
-        up_conv_buf( source_raster, line, current_input_channel );
-      }
-
-      /* raster convolution */
-
-      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
-          conv_line_bound ) +
-          ( iteration * conv_line_bound ) + raster_line ),
-          "Canceled by the user" );
-                  
-        up_conv_buf( source_raster, raster_line + temp_maskmatrix_lines_ - 1,
-          current_input_channel );
-
-        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
-             ++conv_buf_column ) {
-
-          output_level = 0;
-          
-          if( inRaster_uses_dummy ) {
-            min_gen_level = dummy_value;
-            
-            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; 
-              ++mask_line ) {
-              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
-                  ++mask_column ) {
-                  
-                curr_buf_value = conv_buf_[ mask_line ][ conv_buf_column + 
-                  mask_column ];
-                curr_mask_value = temp_maskmatrix_[ mask_line ][ mask_column ];
-                  
-                if( ( curr_buf_value != dummy_value ) &&
-                  ( curr_mask_value != 0 ) ) {
-                  
-                  output_level = curr_buf_value * curr_mask_value;;
-                 
-                  if( min_gen_level == dummy_value ) {
-                    min_gen_level = output_level;
-                  } else {
-                    if( output_level < min_gen_level ) {
-                      min_gen_level = output_level;
-                    }
-                  } 
-                }
-              }
-            }
-          } else {
-            min_gen_level = out_channel_max_level;
-            
-            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; 
-              ++mask_line ) {
-              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
-                  ++mask_column ) {
-  
-                output_level = temp_maskmatrix_[ mask_line ][ mask_column ] *
-                  conv_buf_[ mask_line ][ conv_buf_column + mask_column ];
-  
-                if( ( output_level < min_gen_level ) &&
-                    ( temp_maskmatrix_[ mask_line ][ mask_column ] != 0 ) ) {
-  
-                  min_gen_level = output_level;
-                }
-              }
-            }
-          }
-
-          /* Level range filtering */
-
-          if( min_gen_level < out_channel_min_level ) {
-            min_gen_level = out_channel_min_level;
-          } else if( min_gen_level > out_channel_max_level ) {
-            min_gen_level = out_channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            conv_buf_column + mask_middle_off_columns,
-            raster_line +  mask_middle_off_lines, min_gen_level, 
-            curr_out_channel ), "Pixel mapping error" );
-        }
-      }
-    }
-  }
-
-  return true;
-}
-
-bool TePDIMorfFilter::RunMedian()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  TePDIFilterMask::pointer mask;
-  params_.GetParameter( "filter_mask", mask );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-  
-  bool inRaster_uses_dummy = inRaster->params().useDummy_;
-
-  /* Setting the output raster */
-
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );  
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ );  
-    
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
-  
-  if( inRaster->params().useDummy_ ) {
-    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
-  } else {
-    outRaster_params.setDummy( 0, -1 );
-  }  
-
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );    
-    
-
-  /* Creating the temporary rasters with one band each */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  if( iterations > 1 ) {
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
-      aux_raster1, 1, true, false, TeDOUBLE ), 
-      "Unable to create auxiliary raster 1" );
-  }
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;
-  if( iterations > 2 ) {
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
-      aux_raster2, 1, true, false, TeDOUBLE ), 
-      "Unable to create auxiliary raster 2" );
-  }
-
-  /* Updating the global temporary representation of mask weights */
-
-  reset_maskmatrix( mask );
-
-  /* Setting the convolution buffer initial state */
-
-  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  reset_conv_buf( temp_maskmatrix_lines_, raster_columns );
-
-  /* A vector to store the mask apply results for a given convolution */
-
-  if( double_buffer_ ) {
-    delete[] double_buffer_;
-  }
-
-  double_buffer_ =
-    new double[ temp_maskmatrix_lines_ * temp_maskmatrix_columns_ ];
-
-//  const unsigned int mask_apply_restult_median_pos =
-//    ( temp_maskmatrix_lines_ * temp_maskmatrix_columns_ ) -
-//    (int)ceil( mask->getSum() / 2 );
-
-  /* Bubble sort alg parameters */
-
-//  unsigned int fixed_bubble_end_bound =
-//    ( temp_maskmatrix_lines_ * temp_maskmatrix_columns_ ) - 1;/* not included */
-  unsigned int temp_bubble_bound; // the position before the last valid 
-                                  // element index inside double buf
-  unsigned int bubble_index;
-  double temp_bubble_swap;
-
-  /* Finding mask middle pixel offset */
-
-  unsigned int mask_middle_off_lines =
-    (unsigned int) floor( ((double)temp_maskmatrix_lines_) / 2. );
-  unsigned int mask_middle_off_columns =
-    (unsigned int) floor( ((double)temp_maskmatrix_columns_) / 2. );
-
-  unsigned int conv_column_bound = raster_columns - temp_maskmatrix_columns_ + 1;
-  unsigned int conv_line_bound = raster_lines - temp_maskmatrix_lines_ + 1;
-
-  unsigned int mask_line;
-  unsigned int mask_column;
-  unsigned int raster_line;
-  unsigned int conv_buf_column;
-
-  double out_channel_min_level;
-  double out_channel_max_level;
-  
-  unsigned int next_db_element_index = 0; // next double buffer element index,
-                                          // points to the position after the
-                                          // last valid buffer element.
-  double curr_mask_value = 0;
-  double curr_cb_value = 0; // current convolution buffer value
-  double dummy_value = 0;
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-  
-  StartProgInt( "Median", channels.size() * iterations *
-     conv_line_bound );    
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-       
-    unsigned int current_input_channel = channels[ channels_index ];
-    unsigned int curr_out_channel = 0;
-       
-    if( inRaster_uses_dummy ) {
-      dummy_value = inRaster->params().dummy_[ current_input_channel ];
-    }        
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels_index, out_channel_min_level,
-      out_channel_max_level ), "Unable to get raster channel level bounds" );
-
-    for( int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-      if( iteration == 0 ) {
-        /* The first iteration */
-        
-        source_raster = inRaster;
-        current_input_channel = channels[ channels_index ];
-        
-        if( iterations > 1 ) {
-          target_raster = aux_raster1;
-          curr_out_channel = 0;
-        } else {
-          target_raster = outRaster;
-          curr_out_channel = channels[ channels_index ];
-        }
-      } else if ( iteration == ( iterations - 1 ) ) {
-        /* The last iteration */
-        
-        current_input_channel = 0;
-        source_raster = target_raster;
-        
-        target_raster = outRaster;
-        curr_out_channel = channels[ channels_index ];
-      } else {
-        /* The intermediary iteration */
-        
-        if( iteration == 1 ) {
-          source_raster = target_raster;
-          current_input_channel = 0;
-        
-          target_raster = aux_raster1;
-          curr_out_channel = 0;
-        } else {        
-          TePDITypes::TePDIRasterPtrType swap_ptr = source_raster;
-          source_raster = target_raster;
-          current_input_channel = 0;
-            
-          target_raster = swap_ptr;
-          curr_out_channel = 0;
-        }
-      }
-
-      /* Fills the convolution buffer with the first "mask_lines" from the raster */
-
-      for( unsigned int line = 0 ; line < ( temp_maskmatrix_lines_ - 1 ) ; ++line ) {
-        up_conv_buf( source_raster, line, current_input_channel );
-      }
-
-      /* raster convolution */
-
-      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-        
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
-          conv_line_bound ) +
-          ( iteration * conv_line_bound ) + raster_line ),
-          "Canceled by the user" );
-
-        up_conv_buf( source_raster, raster_line + temp_maskmatrix_lines_ - 1,
-          current_input_channel );
-
-        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
-             ++conv_buf_column ) {
-
-          /* Finding convolution weights apply result */
-          
-          next_db_element_index = 0;
-          
-          if( inRaster_uses_dummy ) {
-            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; ++mask_line ) {
-              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
-                  ++mask_column ) {
-                  
-                curr_mask_value = temp_maskmatrix_[ mask_line ][ mask_column ];
-                curr_cb_value = conv_buf_[ mask_line ][ conv_buf_column + 
-                  mask_column ];
-                  
-                if( ( curr_mask_value != 0 ) && 
-                  ( curr_cb_value != dummy_value ) ) {
-                  
-                  double_buffer_[ next_db_element_index ] =
-                    curr_mask_value * curr_cb_value;
-                    
-                  ++next_db_element_index;
-                }
-              }
-            }
-          } else {
-            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; ++mask_line ) {
-              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
-                  ++mask_column ) {
-                  
-                curr_mask_value = temp_maskmatrix_[ mask_line ][ mask_column ];
-                  
-                if( curr_mask_value != 0 ) {
-                  double_buffer_[ next_db_element_index ] =
-                    curr_mask_value *
-                    conv_buf_[ mask_line ][ conv_buf_column + mask_column ];
-                    
-                  ++next_db_element_index;
-                }
-              }
-            }
-          }
-
-          if( next_db_element_index == 0 ) {
-            TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-              conv_buf_column + mask_middle_off_columns,
-              raster_line +  mask_middle_off_lines, dummy_value, 
-              curr_out_channel ), "Pixel mapping error" );           
-          } else if( next_db_element_index == 1 ) {
-            TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-              conv_buf_column + mask_middle_off_columns,
-              raster_line +  mask_middle_off_lines,
-              double_buffer_[ 0 ], curr_out_channel ),
-              "Pixel mapping error" );          
-          } else {
-            /* Sorting the results */
-
-            temp_bubble_bound = next_db_element_index - 1;
-  
-            while( temp_bubble_bound > 0 ) {
-              for( bubble_index = 0 ; bubble_index < temp_bubble_bound ;
-                ++bubble_index ) {
-  
-                if( double_buffer_[ bubble_index ] >
-                    double_buffer_[ bubble_index + 1 ] ) {
-  
-                    temp_bubble_swap = double_buffer_[ bubble_index ];
-                    double_buffer_[ bubble_index ] =
-                      double_buffer_[ bubble_index + 1 ];
-                    double_buffer_[ bubble_index + 1 ] = temp_bubble_swap;
-                }
-              }
-  
-              --temp_bubble_bound;
-            }
-  
-            TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-              conv_buf_column + mask_middle_off_columns,
-              raster_line +  mask_middle_off_lines,
-              double_buffer_[ ( next_db_element_index - 1 ) / 2 ], 
-              curr_out_channel ), "Pixel mapping error" );
-          }
-        }
-      }
-    }
-  }
-
-  return true;
-}
-
-
-bool TePDIMorfFilter::RunMode()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  TePDIFilterMask::pointer mask;
-  params_.GetParameter( "filter_mask", mask );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-  
-  bool inRaster_uses_dummy = inRaster->params().useDummy_;
-
-  /* Setting the output raster */
-
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );  
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ );  
-    
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
-  
-  if( inRaster->params().useDummy_ ) {
-    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
-  } else {
-    outRaster_params.setDummy( 0, -1 );
-  }  
-
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );    
-    
-
-  /* Creating the temporary rasters with one band each */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  if( iterations > 1 ) {
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
-      aux_raster1, 1, true, false, TeDOUBLE ), 
-      "Unable to create auxiliary raster 1" );
-  }
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;
-  if( iterations > 2 ) {
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
-      aux_raster2, 1, true, false, TeDOUBLE ), 
-      "Unable to create auxiliary raster 2" );
-  }
-
-  /* Updating the global temporary representation of mask weights */
-
-  reset_maskmatrix( mask );
-
-  /* Setting the convolution buffer initial state */
-
-  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  reset_conv_buf( temp_maskmatrix_lines_, raster_columns );
-
-  /* Bubble sort alg parameters */
-
-  std::map< double, unsigned int > freqmap;
-  std::map< double, unsigned int >::iterator freqmap_it;
-  std::map< double, unsigned int >::iterator freqmap_it_end;
-  double freqmap_highest_freq_value = 0;
-  unsigned int freqmap_highest_freq = 0;
-
-  /* Finding mask middle pixel offset */
-
-  unsigned int mask_middle_off_lines =
-    (unsigned int) floor( ((double)temp_maskmatrix_lines_) / 2. );
-  unsigned int mask_middle_off_columns =
-    (unsigned int) floor( ((double)temp_maskmatrix_columns_) / 2. );
-
-  unsigned int conv_column_bound = raster_columns - temp_maskmatrix_columns_ + 1;
-  unsigned int conv_line_bound = raster_lines - temp_maskmatrix_lines_ + 1;
-
-  unsigned int mask_line = 0;
-  unsigned int mask_column = 0;
-  unsigned int raster_line = 0;
-  unsigned int raster_col = 0;
-  unsigned int conv_buf_column = 0;
-
-  double out_channel_min_level = 0;
-  double out_channel_max_level = 0;
-  
-//  unsigned int next_db_element_index = 0; // next double buffer element index,
-                                          // points to the position after the
-                                          // last valid buffer element.
-//  double curr_mask_value = 0;
-//  double curr_cb_value = 0; // current convolution buffer value
-  double dummy_value = 0;
-  double pixel_value = 0;
-  double mask_apply_result = 0.0;
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-  
-  StartProgInt( "Mede", channels.size() * iterations *
-     conv_line_bound );    
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-       
-    unsigned int current_input_channel = channels[ channels_index ];
-    unsigned int curr_out_channel = 0;
-       
-    if( inRaster_uses_dummy ) {
-      dummy_value = inRaster->params().dummy_[ current_input_channel ];
-    }
-    else
-    {
-      dummy_value = 0;
-    }
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels_index, out_channel_min_level,
-      out_channel_max_level ), 
-      "Unable to get raster channel level bounds" );
-
-    for( int iteration = 0 ; (int)iteration < iterations ; 
-      ++iteration ) 
-    {
-      if( iteration == 0 ) {
-        /* The first iteration */
-        
-        source_raster = inRaster;
-        current_input_channel = channels[ channels_index ];
-        
-        if( iterations > 1 ) {
-          target_raster = aux_raster1;
-          curr_out_channel = 0;
-        } else {
-          target_raster = outRaster;
-          curr_out_channel = channels[ channels_index ];
-        }
-      } else if ( iteration == ( iterations - 1 ) ) {
-        /* The last iteration */
-        
-        current_input_channel = 0;
-        source_raster = target_raster;
-        
-        target_raster = outRaster;
-        curr_out_channel = channels[ channels_index ];
-      } else {
-        /* The intermediary iteration */
-        
-        if( iteration == 1 ) {
-          source_raster = target_raster;
-          current_input_channel = 0;
-        
-          target_raster = aux_raster1;
-          curr_out_channel = 0;
-        } else {        
-          TePDITypes::TePDIRasterPtrType swap_ptr = source_raster;
-          source_raster = target_raster;
-          current_input_channel = 0;
-            
-          target_raster = swap_ptr;
-          curr_out_channel = 0;
-        }
-      }
-      
-      /* Copying the first and the last cols image pixels */
-      
-      for( raster_line = 0 ; raster_line < raster_lines ; 
-        ++raster_line ) 
-      {
-        if( source_raster->getElement( 0, raster_line, pixel_value,
-          current_input_channel ) )
-        {
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            0, raster_line, pixel_value, curr_out_channel ), 
-            "Pixel writing error" );        
-        }
-        else
-        {
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            0, raster_line, dummy_value, curr_out_channel ), 
-            "Pixel writing error" );        
-        }
-        
-        if( source_raster->getElement( raster_columns - 1, 
-          raster_line, pixel_value,
-          current_input_channel ) )
-        {
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            raster_columns - 1, raster_line, pixel_value, 
-            curr_out_channel ), 
-            "Pixel writing error" );        
-        }
-        else
-        {
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            raster_columns - 1, raster_line, dummy_value, 
-            curr_out_channel ), 
-            "Pixel writing error" );        
-        }        
-      }      
-      
-      /* Copying the first and the last line image pixels */
-      
-      for( raster_col = 0 ; raster_col < raster_columns ; 
-        ++raster_col ) 
-      {
-        if( source_raster->getElement( raster_col, 0, pixel_value,
-          current_input_channel ) )
-        {
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            raster_col, 0, pixel_value, curr_out_channel ), 
-            "Pixel writing error" );        
-        }
-        else
-        {
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            raster_col, 0, dummy_value, curr_out_channel ), 
-            "Pixel writing error" );        
-        }
-        
-        if( source_raster->getElement( raster_col, 
-          raster_lines - 1, pixel_value,
-          current_input_channel ) )
-        {
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            raster_col, raster_lines - 1, pixel_value, 
-            curr_out_channel ), 
-            "Pixel writing error" );        
-        }
-        else
-        {
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            raster_col, raster_lines - 1, dummy_value, 
-            curr_out_channel ), 
-            "Pixel writing error" );        
-        }        
-      }       
-
-      /* Fills the convolution buffer with the first "mask_lines" from the raster */
-
-      for( unsigned int line = 0 ; line < ( temp_maskmatrix_lines_ - 1 ) ; ++line ) {
-        up_conv_buf( source_raster, line, current_input_channel );
-      }
-      
-      /* raster convolution */
-
-      for( raster_line = 0 ; raster_line < conv_line_bound ; 
-        ++raster_line ) 
-      {
-        /* Getting one more line from the source raster and adding to buffer */
-        
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( 
-          ( channels_index * iterations * 
-          conv_line_bound ) +
-          ( iteration * conv_line_bound ) + raster_line ),
-          "Canceled by the user" );
-
-        up_conv_buf( source_raster, raster_line + temp_maskmatrix_lines_ - 1,
-          current_input_channel );
-
-        for( conv_buf_column = 0 ; conv_buf_column < 
-          conv_column_bound ; ++conv_buf_column ) 
-        {
-          freqmap.clear();
-          
-          /* Finding convolution weights apply result */
-          
-          if( inRaster_uses_dummy ) {
-            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; ++mask_line ) {
-              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
-                  ++mask_column ) {
-                  
-                const double& curr_mask_value = 
-                  temp_maskmatrix_[ mask_line ][ mask_column ];
-                const double& curr_cb_value = 
-                  conv_buf_[ mask_line ][ conv_buf_column + 
-                  mask_column ];
-                
-                  
-                if( ( curr_mask_value != 0 ) && 
-                  ( curr_cb_value != dummy_value ) ) {
-                  
-                  mask_apply_result = curr_mask_value *
-                    curr_cb_value;
-                    
-                  freqmap[ mask_apply_result ] += 1;
-                }
-              }
-            }
-          } else {
-            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; ++mask_line ) {
-              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
-                  ++mask_column ) {
-                  
-                const double& curr_mask_value = 
-                  temp_maskmatrix_[ mask_line ][ mask_column ];
-                  
-                if( curr_mask_value != 0 ) {
-                  freqmap[ conv_buf_[ mask_line ][ 
-                    conv_buf_column + mask_column ] ] += 1;
-                }
-              }
-            }
-          }
-
-          if( freqmap.size() == 0 ) {
-            TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-              conv_buf_column + mask_middle_off_columns,
-              raster_line +  mask_middle_off_lines, dummy_value, 
-              curr_out_channel ), "Pixel mapping error" );           
-          } 
-          else 
-          {
-            /* Finding the high frequency value */
-            freqmap_highest_freq = 0;
-            freqmap_it = freqmap.begin();
-            freqmap_it_end = freqmap.end();
-            
-            while( freqmap_it != freqmap_it_end )
-            {
-              if( freqmap_it->second > freqmap_highest_freq )
-              {
-                freqmap_highest_freq = freqmap_it->second;
-                freqmap_highest_freq_value = freqmap_it->first;
-              }
-            
-              ++freqmap_it;
-            }
-            
-            TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-              conv_buf_column + mask_middle_off_columns,
-              raster_line +  mask_middle_off_lines,
-              freqmap_highest_freq_value, curr_out_channel ),
-              "Pixel mapping error" );          
-          }
-        }
-      }
-    }
-  }
-
-  return true;
-}
-
-
-void TePDIMorfFilter::ResetState( const TePDIParameters& params )
-{
-  TePDIBufferedFilter::ResetState( params );
-
-  if( double_buffer_ ) {
-    delete[] double_buffer_;
-    double_buffer_ = 0;
-  }
-}
-
-
+#include "TePDIMorfFilter.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIFilterMask.hpp"
+#include "TePDIUtils.hpp"
+
+#include "math.h"
+
+
+TePDIMorfFilter::TePDIMorfFilter()
+{
+  double_buffer_ = 0;
+}
+
+
+TePDIMorfFilter::~TePDIMorfFilter()
+{
+  if( double_buffer_ ) {
+    delete[] double_buffer_;
+  }
+}
+
+
+bool TePDIMorfFilter::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking for general required parameters */
+
+  TePDITypes::TePDIRasterPtrType inRaster;
+  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: input_image" );
+    return false;
+  }
+  if( ! inRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
+    return false;
+  }
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: output_image" );
+    return false;
+  }
+  if( ! outRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
+    return false;
+  }
+
+  /* Filter type checking */
+  TePDIMorfType filter_type;
+  if( ! parameters.GetParameter( "filter_type", filter_type ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: filter_type" );
+    return false;
+  }
+  if( ( filter_type != TePDIMDilationType ) &&
+      ( filter_type != TePDIMErosionType ) &&
+      ( filter_type != TePDIMMedianType ) &&
+      ( filter_type != TePDIMModeType ) ) {
+
+    TEAGN_LOGERR( "Invalid parameter: filter_type" );
+    return false;
+  }
+
+  /* channels parameter checking */
+
+  std::vector< int > channels;
+  if( ! parameters.GetParameter( "channels", channels ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: channels" );
+    return false;
+  }
+  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
+    if( channels[ index ] >= inRaster->nBands() ) {
+      TEAGN_LOGERR( "Invalid parameter: channels" );
+      return false;
+    }
+  }
+
+  /* Filter mask checking */
+
+  TePDIFilterMask::pointer mask;
+
+  if( ! parameters.GetParameter( "filter_mask", mask ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: filter_mask" );
+    return false;
+  }
+  if( ! mask.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: filter_mask inactive" );
+    return false;
+  }
+  if( mask->columns() < 3 ) {
+    TEAGN_WATCH( mask->columns() );
+    TEAGN_LOGERR( "Invalid parameter: filter_mask with invalid colunms number" );
+    return false;
+  }
+  if( mask->lines() < 3 ) {
+    TEAGN_WATCH( mask->lines() );
+    TEAGN_LOGERR( "Invalid parameter: filter_mask with invalid lines number" );
+    return false;
+  }
+  if( ( (int)mask->lines() > inRaster->params().nlines_ ) ||
+      ( (int)mask->columns() > inRaster->params().ncols_ ) ){
+    TEAGN_LOGERR( "Invalid parameter: filter_mask do not fit inside input image" );
+    return false;
+  }
+  TEAGN_TRUE_OR_RETURN(
+    mask->isMorfMask(), "Invalid mask: Not a morfological mask" );
+
+  /* Checking for number of iterations */
+
+  int iterations = 0;
+  if( ! parameters.GetParameter( "iterations", iterations ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: iterations" );
+    return false;
+  }
+  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
+
+  return true;
+}
+
+
+bool TePDIMorfFilter::RunImplementation()
+{
+  TePDIMorfType filter_type;
+  params_.GetParameter( "filter_type", filter_type );
+
+  switch( filter_type ) {
+    case TePDIMDilationType :
+    {
+      return RunDilation();
+      break;
+    }
+    case TePDIMErosionType :
+    {
+      return RunErosion();
+      break;
+    }
+    case TePDIMMedianType :
+    {
+      return RunMedian();
+      break;
+    }
+    case TePDIMModeType :
+    {
+      return RunMode();
+      break;
+    }    
+    default :
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid algorithm type" );
+    }
+  }
+}
+
+
+bool TePDIMorfFilter::RunDilation()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  TePDIFilterMask::pointer mask;
+  params_.GetParameter( "filter_mask", mask );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+  
+  bool inRaster_uses_dummy = inRaster->params().useDummy_;
+
+  /* Setting the output raster */
+
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ ); 
+    
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
+  
+  if( inRaster->params().useDummy_ ) {
+    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
+  } else {
+    outRaster_params.setDummy( 0, -1 );
+  }  
+
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );    
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  if( iterations > 1 ) {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
+      aux_raster1, 1, true, false, TeDOUBLE ), 
+      "Unable to create auxiliary raster 1" );
+  }
+
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  if( iterations > 2 ) {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
+      aux_raster2, 1, true, false, TeDOUBLE ), 
+      "Unable to create auxiliary raster 2" );
+  }
+
+  /* Updating the global temporary representation of mask weights */
+
+  reset_maskmatrix( mask );
+
+  /* Setting the convolution buffer initial state */
+
+  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( temp_maskmatrix_lines_, raster_columns );
+
+  /* Convolution Loop */
+  
+  double output_level = 0; /* the value generated by each pixel mask calcule */
+
+  double max_gen_level = 0;/* The maximum value generated by each mask convolution */
+
+  unsigned int mask_middle_off_lines =
+    (unsigned int) floor( ((double)temp_maskmatrix_lines_) / 2. );
+  unsigned int mask_middle_off_columns =
+    (unsigned int) floor( ((double)temp_maskmatrix_columns_) / 2. );
+
+  unsigned int conv_column_bound = raster_columns - temp_maskmatrix_columns_ + 1;
+  unsigned int conv_line_bound = raster_lines - temp_maskmatrix_lines_ + 1;
+
+  unsigned int mask_line = 0;
+  unsigned int mask_column = 0;
+  unsigned int raster_line = 0;
+  unsigned int conv_buf_column = 0;
+
+  double out_channel_min_level = 0;
+  double out_channel_max_level = 0;
+  
+  double dummy_value = 0;
+  double curr_buf_value = 0;
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+  
+  StartProgInt( "Dilation", channels.size() * iterations *
+     conv_line_bound );  
+
+  for( unsigned int channels_index = 0 ;
+       channels_index < channels.size() ;
+       ++channels_index ) {
+       
+    unsigned int current_input_channel =0;
+    unsigned int curr_out_channel = 0;
+       
+    if( inRaster_uses_dummy ) {
+      dummy_value = inRaster->params().dummy_[ current_input_channel ];
+    }
+
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+      outRaster, channels_index, out_channel_min_level,
+      out_channel_max_level ), "Unable to get raster channel level bounds" );
+
+    for( int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
+      if( iteration == 0 ) {
+        /* The first iteration */
+        
+        source_raster = inRaster;
+        current_input_channel = channels[ channels_index ];
+        
+        if( iterations > 1 ) {
+          target_raster = aux_raster1;
+          curr_out_channel = 0;
+        } else {
+          target_raster = outRaster;
+          curr_out_channel = channels[ channels_index ];
+        }
+      } else if ( iteration == ( iterations - 1 ) ) {
+        /* The last iteration */
+        
+        current_input_channel = 0;
+        source_raster = target_raster;
+        
+        target_raster = outRaster;
+        curr_out_channel = channels[ channels_index ];
+      } else {
+        /* The intermediary iteration */
+        
+        if( iteration == 1 ) {
+          source_raster = target_raster;
+          current_input_channel = 0;
+        
+          target_raster = aux_raster1;
+          curr_out_channel = 0;
+        } else {        
+          TePDITypes::TePDIRasterPtrType swap_ptr = source_raster;
+          source_raster = target_raster;
+          current_input_channel = 0;
+            
+          target_raster = swap_ptr;
+          curr_out_channel = 0;
+        }
+      }
+
+      /* Fills the convolution buffer with the first "mask_lines" from the raster */
+
+      for( unsigned int line = 0 ; line < ( temp_maskmatrix_lines_ - 1 ); 
+        ++line ) {
+        
+        up_conv_buf( source_raster, line, current_input_channel );
+      }
+
+      /* raster convolution */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) +
+          ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+        
+        up_conv_buf( source_raster, raster_line + temp_maskmatrix_lines_ - 1,
+          current_input_channel );
+
+        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
+             ++conv_buf_column ) {
+
+          output_level = 0;
+          
+          if( inRaster_uses_dummy ) {
+            max_gen_level = dummy_value;
+            
+            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; 
+              ++mask_line ) {
+              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
+                  ++mask_column ) {
+                  
+                curr_buf_value = conv_buf_[ mask_line ][ conv_buf_column + 
+                  mask_column ];
+                  
+                if( curr_buf_value != dummy_value ) {
+                  output_level = temp_maskmatrix_[ mask_line ][ mask_column ] *
+                    curr_buf_value;
+                    
+                  if( max_gen_level == dummy_value ) {
+                    max_gen_level = output_level;
+                  } else {
+                    if( output_level > max_gen_level ) {
+                      max_gen_level = output_level;
+                    }
+                  }
+                }
+              }
+            }
+          } else {
+            max_gen_level = out_channel_min_level;
+            
+            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; 
+              ++mask_line ) {
+              
+              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
+                  ++mask_column ) {
+                output_level = temp_maskmatrix_[ mask_line ][ mask_column ] *
+                  conv_buf_[ mask_line ][ conv_buf_column + mask_column ];
+  
+                if( output_level > max_gen_level ) {
+                  max_gen_level = output_level;
+                }
+              }
+            }
+          }
+
+          /* Level range filtering */
+
+          if( max_gen_level < out_channel_min_level ) {
+            max_gen_level = out_channel_min_level;
+          } else if( max_gen_level > out_channel_max_level ) {
+            max_gen_level = out_channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            conv_buf_column + mask_middle_off_columns,
+            raster_line +  mask_middle_off_lines, max_gen_level, 
+            curr_out_channel ), "Pixel mapping error" );
+        }
+      }
+    }
+  }
+
+  return true;
+
+}
+
+bool TePDIMorfFilter::RunErosion()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  TePDIFilterMask::pointer mask;
+  params_.GetParameter( "filter_mask", mask );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+  
+  bool inRaster_uses_dummy = inRaster->params().useDummy_;
+
+  /* Setting the output raster */
+
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );
+    
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );   
+  
+  if( inRaster->params().useDummy_ ) {
+    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
+  } else {
+    outRaster_params.setDummy( 0, -1 );
+  }  
+
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );    
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  if( iterations > 1 ) {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
+      aux_raster1, 1, true, false, TeDOUBLE ), 
+      "Unable to create auxiliary raster 1" );
+  }
+
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  if( iterations > 2 ) {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
+      aux_raster2, 1, true, false, TeDOUBLE ), 
+      "Unable to create auxiliary raster 2" );
+  }
+
+  /* Updating the global temporary representation of mask weights */
+
+  reset_maskmatrix( mask );
+
+  /* Setting the convolution buffer initial state */
+
+  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( temp_maskmatrix_lines_, raster_columns );
+
+  /* Convolution Loop */
+
+  double output_level; /* the value generated by each pixel mask calcule */
+
+  double min_gen_level; /* The minimal value generated by each mask convolution */
+
+  unsigned int mask_middle_off_lines =
+    (unsigned int) floor( ((double)temp_maskmatrix_lines_) / 2. );
+  unsigned int mask_middle_off_columns =
+    (unsigned int) floor( ((double)temp_maskmatrix_columns_) / 2. );
+
+  unsigned int conv_column_bound = raster_columns - temp_maskmatrix_columns_ + 1;
+  unsigned int conv_line_bound = raster_lines - temp_maskmatrix_lines_ + 1;
+
+  unsigned int mask_line;
+  unsigned int mask_column;
+  unsigned int raster_line;
+  unsigned int conv_buf_column;
+
+  double out_channel_min_level;
+  double out_channel_max_level;
+  
+  double dummy_value = 0;
+  double curr_buf_value = 0;
+  double curr_mask_value = 0;
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+
+  StartProgInt( "Erosion", channels.size() * iterations *
+     conv_line_bound );  
+
+  for( unsigned int channels_index = 0 ;
+       channels_index < channels.size() ;
+       ++channels_index ) {
+       
+    unsigned int current_input_channel = channels[ channels_index ];
+    unsigned int curr_out_channel = 0;
+    
+    if( inRaster_uses_dummy ) {
+      dummy_value = inRaster->params().dummy_[ current_input_channel ];
+    }    
+
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+      outRaster, channels_index, out_channel_min_level,
+      out_channel_max_level ), "Unable to get raster channel level bounds" );
+
+    for( int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
+      if( iteration == 0 ) {
+        /* The first iteration */
+        
+        source_raster = inRaster;
+        current_input_channel = channels[ channels_index ];
+        
+        if( iterations > 1 ) {
+          target_raster = aux_raster1;
+          curr_out_channel = 0;
+        } else {
+          target_raster = outRaster;
+          curr_out_channel = channels[ channels_index ];
+        }
+      } else if ( iteration == ( iterations - 1 ) ) {
+        /* The last iteration */
+        
+        current_input_channel = 0;
+        source_raster = target_raster;
+        
+        target_raster = outRaster;
+        curr_out_channel = channels[ channels_index ];
+      } else {
+        /* The intermediary iteration */
+        
+        if( iteration == 1 ) {
+          source_raster = target_raster;
+          current_input_channel = 0;
+        
+          target_raster = aux_raster1;
+          curr_out_channel = 0;
+        } else {        
+          TePDITypes::TePDIRasterPtrType swap_ptr = source_raster;
+          source_raster = target_raster;
+          current_input_channel = 0;
+            
+          target_raster = swap_ptr;
+          curr_out_channel = 0;
+        }
+      }
+
+      /* Fills the convolution buffer with the first "mask_lines" from the raster */
+
+      for( unsigned int line = 0 ; line < ( temp_maskmatrix_lines_ - 1 ); ++line ) {
+        up_conv_buf( source_raster, line, current_input_channel );
+      }
+
+      /* raster convolution */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) +
+          ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+                  
+        up_conv_buf( source_raster, raster_line + temp_maskmatrix_lines_ - 1,
+          current_input_channel );
+
+        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
+             ++conv_buf_column ) {
+
+          output_level = 0;
+          
+          if( inRaster_uses_dummy ) {
+            min_gen_level = dummy_value;
+            
+            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; 
+              ++mask_line ) {
+              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
+                  ++mask_column ) {
+                  
+                curr_buf_value = conv_buf_[ mask_line ][ conv_buf_column + 
+                  mask_column ];
+                curr_mask_value = temp_maskmatrix_[ mask_line ][ mask_column ];
+                  
+                if( ( curr_buf_value != dummy_value ) &&
+                  ( curr_mask_value != 0 ) ) {
+                  
+                  output_level = curr_buf_value * curr_mask_value;;
+                 
+                  if( min_gen_level == dummy_value ) {
+                    min_gen_level = output_level;
+                  } else {
+                    if( output_level < min_gen_level ) {
+                      min_gen_level = output_level;
+                    }
+                  } 
+                }
+              }
+            }
+          } else {
+            min_gen_level = out_channel_max_level;
+            
+            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; 
+              ++mask_line ) {
+              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
+                  ++mask_column ) {
+  
+                output_level = temp_maskmatrix_[ mask_line ][ mask_column ] *
+                  conv_buf_[ mask_line ][ conv_buf_column + mask_column ];
+  
+                if( ( output_level < min_gen_level ) &&
+                    ( temp_maskmatrix_[ mask_line ][ mask_column ] != 0 ) ) {
+  
+                  min_gen_level = output_level;
+                }
+              }
+            }
+          }
+
+          /* Level range filtering */
+
+          if( min_gen_level < out_channel_min_level ) {
+            min_gen_level = out_channel_min_level;
+          } else if( min_gen_level > out_channel_max_level ) {
+            min_gen_level = out_channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            conv_buf_column + mask_middle_off_columns,
+            raster_line +  mask_middle_off_lines, min_gen_level, 
+            curr_out_channel ), "Pixel mapping error" );
+        }
+      }
+    }
+  }
+
+  return true;
+}
+
+bool TePDIMorfFilter::RunMedian()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  TePDIFilterMask::pointer mask;
+  params_.GetParameter( "filter_mask", mask );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+  
+  bool inRaster_uses_dummy = inRaster->params().useDummy_;
+
+  /* Setting the output raster */
+
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );  
+    
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
+  
+  if( inRaster->params().useDummy_ ) {
+    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
+  } else {
+    outRaster_params.setDummy( 0, -1 );
+  }  
+
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );    
+    
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  if( iterations > 1 ) {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
+      aux_raster1, 1, true, false, TeDOUBLE ), 
+      "Unable to create auxiliary raster 1" );
+  }
+
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  if( iterations > 2 ) {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
+      aux_raster2, 1, true, false, TeDOUBLE ), 
+      "Unable to create auxiliary raster 2" );
+  }
+
+  /* Updating the global temporary representation of mask weights */
+
+  reset_maskmatrix( mask );
+
+  /* Setting the convolution buffer initial state */
+
+  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( temp_maskmatrix_lines_, raster_columns );
+
+  /* A vector to store the mask apply results for a given convolution */
+
+  if( double_buffer_ ) {
+    delete[] double_buffer_;
+  }
+
+  double_buffer_ =
+    new double[ temp_maskmatrix_lines_ * temp_maskmatrix_columns_ ];
+
+//  const unsigned int mask_apply_restult_median_pos =
+//    ( temp_maskmatrix_lines_ * temp_maskmatrix_columns_ ) -
+//    (int)ceil( mask->getSum() / 2 );
+
+  /* Bubble sort alg parameters */
+
+//  unsigned int fixed_bubble_end_bound =
+//    ( temp_maskmatrix_lines_ * temp_maskmatrix_columns_ ) - 1;/* not included */
+  unsigned int temp_bubble_bound; // the position before the last valid 
+                                  // element index inside double buf
+  unsigned int bubble_index;
+  double temp_bubble_swap;
+
+  /* Finding mask middle pixel offset */
+
+  unsigned int mask_middle_off_lines =
+    (unsigned int) floor( ((double)temp_maskmatrix_lines_) / 2. );
+  unsigned int mask_middle_off_columns =
+    (unsigned int) floor( ((double)temp_maskmatrix_columns_) / 2. );
+
+  unsigned int conv_column_bound = raster_columns - temp_maskmatrix_columns_ + 1;
+  unsigned int conv_line_bound = raster_lines - temp_maskmatrix_lines_ + 1;
+
+  unsigned int mask_line;
+  unsigned int mask_column;
+  unsigned int raster_line;
+  unsigned int conv_buf_column;
+
+  double out_channel_min_level;
+  double out_channel_max_level;
+  
+  unsigned int next_db_element_index = 0; // next double buffer element index,
+                                          // points to the position after the
+                                          // last valid buffer element.
+  double curr_mask_value = 0;
+  double curr_cb_value = 0; // current convolution buffer value
+  double dummy_value = 0;
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+  
+  StartProgInt( "Median", channels.size() * iterations *
+     conv_line_bound );    
+
+  for( unsigned int channels_index = 0 ;
+       channels_index < channels.size() ;
+       ++channels_index ) {
+       
+    unsigned int current_input_channel = channels[ channels_index ];
+    unsigned int curr_out_channel = 0;
+       
+    if( inRaster_uses_dummy ) {
+      dummy_value = inRaster->params().dummy_[ current_input_channel ];
+    }        
+
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+      outRaster, channels_index, out_channel_min_level,
+      out_channel_max_level ), "Unable to get raster channel level bounds" );
+
+    for( int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
+      if( iteration == 0 ) {
+        /* The first iteration */
+        
+        source_raster = inRaster;
+        current_input_channel = channels[ channels_index ];
+        
+        if( iterations > 1 ) {
+          target_raster = aux_raster1;
+          curr_out_channel = 0;
+        } else {
+          target_raster = outRaster;
+          curr_out_channel = channels[ channels_index ];
+        }
+      } else if ( iteration == ( iterations - 1 ) ) {
+        /* The last iteration */
+        
+        current_input_channel = 0;
+        source_raster = target_raster;
+        
+        target_raster = outRaster;
+        curr_out_channel = channels[ channels_index ];
+      } else {
+        /* The intermediary iteration */
+        
+        if( iteration == 1 ) {
+          source_raster = target_raster;
+          current_input_channel = 0;
+        
+          target_raster = aux_raster1;
+          curr_out_channel = 0;
+        } else {        
+          TePDITypes::TePDIRasterPtrType swap_ptr = source_raster;
+          source_raster = target_raster;
+          current_input_channel = 0;
+            
+          target_raster = swap_ptr;
+          curr_out_channel = 0;
+        }
+      }
+
+      /* Fills the convolution buffer with the first "mask_lines" from the raster */
+
+      for( unsigned int line = 0 ; line < ( temp_maskmatrix_lines_ - 1 ) ; ++line ) {
+        up_conv_buf( source_raster, line, current_input_channel );
+      }
+
+      /* raster convolution */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) +
+          ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+
+        up_conv_buf( source_raster, raster_line + temp_maskmatrix_lines_ - 1,
+          current_input_channel );
+
+        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
+             ++conv_buf_column ) {
+
+          /* Finding convolution weights apply result */
+          
+          next_db_element_index = 0;
+          
+          if( inRaster_uses_dummy ) {
+            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; ++mask_line ) {
+              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
+                  ++mask_column ) {
+                  
+                curr_mask_value = temp_maskmatrix_[ mask_line ][ mask_column ];
+                curr_cb_value = conv_buf_[ mask_line ][ conv_buf_column + 
+                  mask_column ];
+                  
+                if( ( curr_mask_value != 0 ) && 
+                  ( curr_cb_value != dummy_value ) ) {
+                  
+                  double_buffer_[ next_db_element_index ] =
+                    curr_mask_value * curr_cb_value;
+                    
+                  ++next_db_element_index;
+                }
+              }
+            }
+          } else {
+            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; ++mask_line ) {
+              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
+                  ++mask_column ) {
+                  
+                curr_mask_value = temp_maskmatrix_[ mask_line ][ mask_column ];
+                  
+                if( curr_mask_value != 0 ) {
+                  double_buffer_[ next_db_element_index ] =
+                    curr_mask_value *
+                    conv_buf_[ mask_line ][ conv_buf_column + mask_column ];
+                    
+                  ++next_db_element_index;
+                }
+              }
+            }
+          }
+
+          if( next_db_element_index == 0 ) {
+            TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+              conv_buf_column + mask_middle_off_columns,
+              raster_line +  mask_middle_off_lines, dummy_value, 
+              curr_out_channel ), "Pixel mapping error" );           
+          } else if( next_db_element_index == 1 ) {
+            TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+              conv_buf_column + mask_middle_off_columns,
+              raster_line +  mask_middle_off_lines,
+              double_buffer_[ 0 ], curr_out_channel ),
+              "Pixel mapping error" );          
+          } else {
+            /* Sorting the results */
+
+            temp_bubble_bound = next_db_element_index - 1;
+  
+            while( temp_bubble_bound > 0 ) {
+              for( bubble_index = 0 ; bubble_index < temp_bubble_bound ;
+                ++bubble_index ) {
+  
+                if( double_buffer_[ bubble_index ] >
+                    double_buffer_[ bubble_index + 1 ] ) {
+  
+                    temp_bubble_swap = double_buffer_[ bubble_index ];
+                    double_buffer_[ bubble_index ] =
+                      double_buffer_[ bubble_index + 1 ];
+                    double_buffer_[ bubble_index + 1 ] = temp_bubble_swap;
+                }
+              }
+  
+              --temp_bubble_bound;
+            }
+  
+            TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+              conv_buf_column + mask_middle_off_columns,
+              raster_line +  mask_middle_off_lines,
+              double_buffer_[ ( next_db_element_index - 1 ) / 2 ], 
+              curr_out_channel ), "Pixel mapping error" );
+          }
+        }
+      }
+    }
+  }
+
+  return true;
+}
+
+
+bool TePDIMorfFilter::RunMode()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  TePDIFilterMask::pointer mask;
+  params_.GetParameter( "filter_mask", mask );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+  
+  bool inRaster_uses_dummy = inRaster->params().useDummy_;
+
+  /* Setting the output raster */
+
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );  
+    
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
+  
+  if( inRaster->params().useDummy_ ) {
+    outRaster_params.setDummy( inRaster->params().dummy_[ 0 ], -1 );
+  } else {
+    outRaster_params.setDummy( 0, -1 );
+  }  
+
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );    
+    
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  if( iterations > 1 ) {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
+      aux_raster1, 1, true, false, TeDOUBLE ), 
+      "Unable to create auxiliary raster 1" );
+  }
+
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  if( iterations > 2 ) {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, 
+      aux_raster2, 1, true, false, TeDOUBLE ), 
+      "Unable to create auxiliary raster 2" );
+  }
+
+  /* Updating the global temporary representation of mask weights */
+
+  reset_maskmatrix( mask );
+
+  /* Setting the convolution buffer initial state */
+
+  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( temp_maskmatrix_lines_, raster_columns );
+
+  /* Bubble sort alg parameters */
+
+  std::map< double, unsigned int > freqmap;
+  std::map< double, unsigned int >::iterator freqmap_it;
+  std::map< double, unsigned int >::iterator freqmap_it_end;
+  double freqmap_highest_freq_value = 0;
+  unsigned int freqmap_highest_freq = 0;
+
+  /* Finding mask middle pixel offset */
+
+  unsigned int mask_middle_off_lines =
+    (unsigned int) floor( ((double)temp_maskmatrix_lines_) / 2. );
+  unsigned int mask_middle_off_columns =
+    (unsigned int) floor( ((double)temp_maskmatrix_columns_) / 2. );
+
+  unsigned int conv_column_bound = raster_columns - temp_maskmatrix_columns_ + 1;
+  unsigned int conv_line_bound = raster_lines - temp_maskmatrix_lines_ + 1;
+
+  unsigned int mask_line = 0;
+  unsigned int mask_column = 0;
+  unsigned int raster_line = 0;
+  unsigned int raster_col = 0;
+  unsigned int conv_buf_column = 0;
+
+  double out_channel_min_level = 0;
+  double out_channel_max_level = 0;
+  
+//  unsigned int next_db_element_index = 0; // next double buffer element index,
+                                          // points to the position after the
+                                          // last valid buffer element.
+//  double curr_mask_value = 0;
+//  double curr_cb_value = 0; // current convolution buffer value
+  double dummy_value = 0;
+  double pixel_value = 0;
+  double mask_apply_result = 0.0;
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+  
+  StartProgInt( "Mede", channels.size() * iterations *
+     conv_line_bound );    
+
+  for( unsigned int channels_index = 0 ;
+       channels_index < channels.size() ;
+       ++channels_index ) {
+       
+    unsigned int current_input_channel = channels[ channels_index ];
+    unsigned int curr_out_channel = 0;
+       
+    if( inRaster_uses_dummy ) {
+      dummy_value = inRaster->params().dummy_[ current_input_channel ];
+    }
+    else
+    {
+      dummy_value = 0;
+    }
+
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+      outRaster, channels_index, out_channel_min_level,
+      out_channel_max_level ), 
+      "Unable to get raster channel level bounds" );
+
+    for( int iteration = 0 ; (int)iteration < iterations ; 
+      ++iteration ) 
+    {
+      if( iteration == 0 ) {
+        /* The first iteration */
+        
+        source_raster = inRaster;
+        current_input_channel = channels[ channels_index ];
+        
+        if( iterations > 1 ) {
+          target_raster = aux_raster1;
+          curr_out_channel = 0;
+        } else {
+          target_raster = outRaster;
+          curr_out_channel = channels[ channels_index ];
+        }
+      } else if ( iteration == ( iterations - 1 ) ) {
+        /* The last iteration */
+        
+        current_input_channel = 0;
+        source_raster = target_raster;
+        
+        target_raster = outRaster;
+        curr_out_channel = channels[ channels_index ];
+      } else {
+        /* The intermediary iteration */
+        
+        if( iteration == 1 ) {
+          source_raster = target_raster;
+          current_input_channel = 0;
+        
+          target_raster = aux_raster1;
+          curr_out_channel = 0;
+        } else {        
+          TePDITypes::TePDIRasterPtrType swap_ptr = source_raster;
+          source_raster = target_raster;
+          current_input_channel = 0;
+            
+          target_raster = swap_ptr;
+          curr_out_channel = 0;
+        }
+      }
+      
+      /* Copying the first and the last cols image pixels */
+      
+      for( raster_line = 0 ; raster_line < raster_lines ; 
+        ++raster_line ) 
+      {
+        if( source_raster->getElement( 0, raster_line, pixel_value,
+          current_input_channel ) )
+        {
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            0, raster_line, pixel_value, curr_out_channel ), 
+            "Pixel writing error" );        
+        }
+        else
+        {
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            0, raster_line, dummy_value, curr_out_channel ), 
+            "Pixel writing error" );        
+        }
+        
+        if( source_raster->getElement( raster_columns - 1, 
+          raster_line, pixel_value,
+          current_input_channel ) )
+        {
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            raster_columns - 1, raster_line, pixel_value, 
+            curr_out_channel ), 
+            "Pixel writing error" );        
+        }
+        else
+        {
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            raster_columns - 1, raster_line, dummy_value, 
+            curr_out_channel ), 
+            "Pixel writing error" );        
+        }        
+      }      
+      
+      /* Copying the first and the last line image pixels */
+      
+      for( raster_col = 0 ; raster_col < raster_columns ; 
+        ++raster_col ) 
+      {
+        if( source_raster->getElement( raster_col, 0, pixel_value,
+          current_input_channel ) )
+        {
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            raster_col, 0, pixel_value, curr_out_channel ), 
+            "Pixel writing error" );        
+        }
+        else
+        {
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            raster_col, 0, dummy_value, curr_out_channel ), 
+            "Pixel writing error" );        
+        }
+        
+        if( source_raster->getElement( raster_col, 
+          raster_lines - 1, pixel_value,
+          current_input_channel ) )
+        {
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            raster_col, raster_lines - 1, pixel_value, 
+            curr_out_channel ), 
+            "Pixel writing error" );        
+        }
+        else
+        {
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            raster_col, raster_lines - 1, dummy_value, 
+            curr_out_channel ), 
+            "Pixel writing error" );        
+        }        
+      }       
+
+      /* Fills the convolution buffer with the first "mask_lines" from the raster */
+
+      for( unsigned int line = 0 ; line < ( temp_maskmatrix_lines_ - 1 ) ; ++line ) {
+        up_conv_buf( source_raster, line, current_input_channel );
+      }
+      
+      /* raster convolution */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; 
+        ++raster_line ) 
+      {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( 
+          ( channels_index * iterations * 
+          conv_line_bound ) +
+          ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+
+        up_conv_buf( source_raster, raster_line + temp_maskmatrix_lines_ - 1,
+          current_input_channel );
+
+        for( conv_buf_column = 0 ; conv_buf_column < 
+          conv_column_bound ; ++conv_buf_column ) 
+        {
+          freqmap.clear();
+          
+          /* Finding convolution weights apply result */
+          
+          if( inRaster_uses_dummy ) {
+            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; ++mask_line ) {
+              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
+                  ++mask_column ) {
+                  
+                const double& curr_mask_value = 
+                  temp_maskmatrix_[ mask_line ][ mask_column ];
+                const double& curr_cb_value = 
+                  conv_buf_[ mask_line ][ conv_buf_column + 
+                  mask_column ];
+                
+                  
+                if( ( curr_mask_value != 0 ) && 
+                  ( curr_cb_value != dummy_value ) ) {
+                  
+                  mask_apply_result = curr_mask_value *
+                    curr_cb_value;
+                    
+                  freqmap[ mask_apply_result ] += 1;
+                }
+              }
+            }
+          } else {
+            for( mask_line = 0; mask_line < temp_maskmatrix_lines_ ; ++mask_line ) {
+              for( mask_column = 0; mask_column < temp_maskmatrix_columns_ ;
+                  ++mask_column ) {
+                  
+                const double& curr_mask_value = 
+                  temp_maskmatrix_[ mask_line ][ mask_column ];
+                  
+                if( curr_mask_value != 0 ) {
+                  freqmap[ conv_buf_[ mask_line ][ 
+                    conv_buf_column + mask_column ] ] += 1;
+                }
+              }
+            }
+          }
+
+          if( freqmap.size() == 0 ) {
+            TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+              conv_buf_column + mask_middle_off_columns,
+              raster_line +  mask_middle_off_lines, dummy_value, 
+              curr_out_channel ), "Pixel mapping error" );           
+          } 
+          else 
+          {
+            /* Finding the high frequency value */
+            freqmap_highest_freq = 0;
+            freqmap_it = freqmap.begin();
+            freqmap_it_end = freqmap.end();
+            
+            while( freqmap_it != freqmap_it_end )
+            {
+              if( freqmap_it->second > freqmap_highest_freq )
+              {
+                freqmap_highest_freq = freqmap_it->second;
+                freqmap_highest_freq_value = freqmap_it->first;
+              }
+            
+              ++freqmap_it;
+            }
+            
+            TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+              conv_buf_column + mask_middle_off_columns,
+              raster_line +  mask_middle_off_lines,
+              freqmap_highest_freq_value, curr_out_channel ),
+              "Pixel mapping error" );          
+          }
+        }
+      }
+    }
+  }
+
+  return true;
+}
+
+
+void TePDIMorfFilter::ResetState( const TePDIParameters& params )
+{
+  TePDIBufferedFilter::ResetState( params );
+
+  if( double_buffer_ ) {
+    delete[] double_buffer_;
+    double_buffer_ = 0;
+  }
+}
+
+
diff --git a/src/terralib/image_processing/TePDIMorfFilter.hpp b/src/terralib/image_processing/TePDIMorfFilter.hpp
old mode 100755
new mode 100644
index 622662a..b9f79ac
--- a/src/terralib/image_processing/TePDIMorfFilter.hpp
+++ b/src/terralib/image_processing/TePDIMorfFilter.hpp
@@ -1,138 +1,138 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMORFFILTER_HPP
-  #define TEPDIMORFFILTER_HPP
-
-  #include "TePDIBufferedFilter.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for morfological filter.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIFiltersGroup
-   *
-   * @note The general required parameters are:
-   *
-   * @param filter_type ( TePDIMorfType ),
-   * @param input_image (TePDITypes::TePDIRasterPtrType),
-   * @param output_image (TePDITypes::TePDIRasterPtrType),
-   * @param channels (std::vector<int>) - input_image Band(s) to process.
-   * @param iterations (int) - Iterations number.
-   * @param filter_mask ( TePDIFilterMask::pointer ) Morfological filter mask.
-   */
-  class PDI_DLL TePDIMorfFilter : public TePDIBufferedFilter {
-    public :
-
-      /** @enum Morfological filters types */
-      enum TePDIMorfType{
-        /** @brief Dilation */
-        TePDIMDilationType = 1,
-        /** @brief Erosion */
-        TePDIMErosionType = 2,
-        /** @brief Median */        
-        TePDIMMedianType = 3,
-        /** @brief Mode */        
-        TePDIMModeType = 4
-      };
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIMorfFilter();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIMorfFilter();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-      /**
-       * @brief A buffer to store temporary double values.
-       *
-       */
-      double* double_buffer_;
-
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Runs the dilation algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunDilation();
-
-      /**
-       * @brief Runs the erosion algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunErosion();
-
-      /**
-       * @brief Runs the median algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunMedian();
-      
-      /**
-       * @brief Runs the mode algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunMode();      
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-
-  };
-
-/** @example TePDIMorfFilter_test.cpp
- *    Shows how to use this class.
- */  
-   
-#endif //TEPDIMORFFILTER_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMORFFILTER_HPP
+  #define TEPDIMORFFILTER_HPP
+
+  #include "TePDIBufferedFilter.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the class for morfological filter.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIFiltersGroup
+   *
+   * @note The general required parameters are:
+   *
+   * @param filter_type ( TePDIMorfType ),
+   * @param input_image (TePDITypes::TePDIRasterPtrType),
+   * @param output_image (TePDITypes::TePDIRasterPtrType),
+   * @param channels (std::vector<int>) - input_image Band(s) to process.
+   * @param iterations (int) - Iterations number.
+   * @param filter_mask ( TePDIFilterMask::pointer ) Morfological filter mask.
+   */
+  class PDI_DLL TePDIMorfFilter : public TePDIBufferedFilter {
+    public :
+
+      /** @enum Morfological filters types */
+      enum TePDIMorfType{
+        /** @brief Dilation */
+        TePDIMDilationType = 1,
+        /** @brief Erosion */
+        TePDIMErosionType = 2,
+        /** @brief Median */        
+        TePDIMMedianType = 3,
+        /** @brief Mode */        
+        TePDIMModeType = 4
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIMorfFilter();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIMorfFilter();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+      /**
+       * @brief A buffer to store temporary double values.
+       *
+       */
+      double* double_buffer_;
+
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Runs the dilation algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunDilation();
+
+      /**
+       * @brief Runs the erosion algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunErosion();
+
+      /**
+       * @brief Runs the median algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunMedian();
+      
+      /**
+       * @brief Runs the mode algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunMode();      
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+
+  };
+
+/** @example TePDIMorfFilter_test.cpp
+ *    Shows how to use this class.
+ */  
+   
+#endif //TEPDIMORFFILTER_HPP
diff --git a/src/terralib/image_processing/TePDIMorfFilterFactory.cpp b/src/terralib/image_processing/TePDIMorfFilterFactory.cpp
old mode 100755
new mode 100644
index 908e935..1723a4b
--- a/src/terralib/image_processing/TePDIMorfFilterFactory.cpp
+++ b/src/terralib/image_processing/TePDIMorfFilterFactory.cpp
@@ -1,24 +1,24 @@
- 
-#include "TePDIMorfFilterFactory.hpp"
-#include "TePDIMorfFilter.hpp"
-#include <TeAgnostic.h>
-
-TePDIMorfFilterFactory::TePDIMorfFilterFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIMorfFilter" ) )
-{
-};      
-
-TePDIMorfFilterFactory::~TePDIMorfFilterFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIMorfFilterFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIMorfFilter();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIMorfFilterFactory.hpp"
+#include "TePDIMorfFilter.hpp"
+#include <TeAgnostic.h>
+
+TePDIMorfFilterFactory::TePDIMorfFilterFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIMorfFilter" ) )
+{
+};      
+
+TePDIMorfFilterFactory::~TePDIMorfFilterFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIMorfFilterFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIMorfFilter();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIMorfFilterFactory.hpp b/src/terralib/image_processing/TePDIMorfFilterFactory.hpp
old mode 100755
new mode 100644
index 41d467e..1e9f64e
--- a/src/terralib/image_processing/TePDIMorfFilterFactory.hpp
+++ b/src/terralib/image_processing/TePDIMorfFilterFactory.hpp
@@ -1,67 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMORFFILTERFACTORY_HPP
-  #define TEPDIMORFFILTERFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for morfological filters algorithms factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIMorfFilterFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIMorfFilterFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIMorfFilterFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIMorfFilterFactory TePDIMorfFilterFactory_instance;
-  };  
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMORFFILTERFACTORY_HPP
+  #define TEPDIMORFFILTERFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for morfological filters algorithms factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIMorfFilterFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIMorfFilterFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIMorfFilterFactory();
+      
+      protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace {
+    static TePDIMorfFilterFactory TePDIMorfFilterFactory_instance;
+  };  
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIMtxDoubleAdpt.hpp b/src/terralib/image_processing/TePDIMtxDoubleAdpt.hpp
index e154024..c63eb08 100644
--- a/src/terralib/image_processing/TePDIMtxDoubleAdpt.hpp
+++ b/src/terralib/image_processing/TePDIMtxDoubleAdpt.hpp
@@ -1,140 +1,143 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIMTXDOUBLEADPT_HPP
-  #define TEPDIMTXDOUBLEADPT_HPP
-
-  #include "TePDIMatrix.hpp"
-
-  /*!
-    \brief Matrix double adapter interface.
-    \author Emiliano F. Castejon <castejon at dpi.inpe.br>
-    \ingroup PDIAux
-   */
-  class TePDIMtxDoubleAdptInt
-  {
-    public :
-      
-      virtual ~TePDIMtxDoubleAdptInt() {};
-    
-      /*! \brief Read values from the internal representation converting
-       * to double.
-       * \param lin Line.
-       * \param col Column.
-       * \param value The readed value. 
-       */
-      virtual void getValue( const unsigned int& lin, 
-        const unsigned int col, double& value ) const = 0;
-      
-      /*! \brief Write double values converting to the internal 
-       * representation.
-       * \param lin Line.
-       * \param col Column.
-       * \param value The value to write. 
-       */
-      virtual void setValue( const unsigned int& lin, 
-        const unsigned int col, const double& value ) = 0;
-      
-      /*! \brief Reallocate memory following the internal memory 
-       * policy.
-       * \param lines The new lines number.
-       * \param columns The new columns number.
-       * \return true if OK. 
-       */
-      virtual bool reset( unsigned int lines = 0, 
-         unsigned int columns = 0 ) = 0;
-      
-      /*! Return the number of matrix lines.
-       * \return The number of Matrix lines.
-       */
-      virtual unsigned int getNLines() const = 0;
-      
-      /*! Return the number of matrix columns.
-       * \return The number of Matrix columns.
-       */
-      virtual unsigned int getNCols() const = 0;      
-      
-    protected :
-      
-      TePDIMtxDoubleAdptInt() {};
-      TePDIMtxDoubleAdptInt( const TePDIMtxDoubleAdptInt& ) {};
-  };
-  
-  /*!
-    \brief Matrix double adapter.
-    \author Emiliano F. Castejon <castejon at dpi.inpe.br>
-    \ingroup PDIAux
-   */
-  template< class T >
-  class TePDIMtxDoubleAdpt : public TePDIMatrix< T >,
-    public TePDIMtxDoubleAdptInt
-  {
-    public :
-      
-      /*! Forward declaration for memory policy */
-      typedef typename TePDIMatrix< T >::MemoryPolicy MemoryPolicy;
-      
-      TePDIMtxDoubleAdpt() {};
-      
-      TePDIMtxDoubleAdpt( MemoryPolicy mp ) 
-      : TePDIMatrix< T >( mp ) 
-      {};
-      
-      ~TePDIMtxDoubleAdpt() {};
-
-      // Overloaded.
-      inline void getValue( const unsigned int& lin, 
-        const unsigned int col, double& value ) const
-      {
-        value = (double)( TePDIMatrix< T >::scanLine( lin )[ col ] );
-      };
-      
-      // Overloaded.
-      inline void setValue( const unsigned int& lin, 
-        const unsigned int col, const double& value )
-      {
-        ( TePDIMatrix< T >::scanLine( lin )[ col ] ) = (T)value;  
-      };
-      
-      // Overloaded.
-      inline bool reset( unsigned int lines = 0, 
-        unsigned int columns = 0 )
-      {
-        return TePDIMatrix< T >::Reset( lines, columns );
-      };
-      
-      // Overloaded
-      inline unsigned int getNLines() const
-      {
-        return TePDIMatrix< T >::GetLines();
-      };
-      
-      // Overloaded
-      inline unsigned int getNCols() const
-      {
-        return TePDIMatrix< T >::GetColumns();          
-      };
-  };
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIMTXDOUBLEADPT_HPP
+  #define TEPDIMTXDOUBLEADPT_HPP
+
+  #include "TePDIMatrix.hpp"
+
+  /*!
+    \class TePDIMtxDoubleAdptInt
+    \brief Matrix double adapter interface.
+    \author Emiliano F. Castejon <castejon at dpi.inpe.br>
+    \ingroup PDIAux
+   */
+  class TePDIMtxDoubleAdptInt
+  {
+    public :
+      
+      virtual ~TePDIMtxDoubleAdptInt() {};
+    
+      /*! \brief Read values from the internal representation converting
+       * to double.
+       * \param lin Line.
+       * \param col Column.
+       * \param value The readed value. 
+       */
+      virtual void getValue( const unsigned int& lin, 
+        const unsigned int col, double& value ) const = 0;
+      
+      /*! \brief Write double values converting to the internal 
+       * representation.
+       * \param lin Line.
+       * \param col Column.
+       * \param value The value to write. 
+       */
+      virtual void setValue( const unsigned int& lin, 
+        const unsigned int col, const double& value ) = 0;
+        
+      /*! \brief Reallocate memory following the internal memory 
+       * policy.
+       * \param lines The new lines number.
+       * \param columns The new columns number.
+       * \return true if OK. 
+       */
+      virtual bool reset( unsigned int lines, 
+         unsigned int columns ) = 0;
+      
+      /*! Return the number of matrix lines.
+       * \return The number of Matrix lines.
+       */
+      virtual unsigned int getNLines() const = 0;
+      
+      /*! Return the number of matrix columns.
+       * \return The number of Matrix columns.
+       */
+      virtual unsigned int getNCols() const = 0;      
+      
+    protected :
+      
+      TePDIMtxDoubleAdptInt() {};
+      TePDIMtxDoubleAdptInt( const TePDIMtxDoubleAdptInt& ) {};
+  };
+  
+  /*!
+    \class TePDIMtxDoubleAdpt
+    \brief Matrix double adapter.
+    \author Emiliano F. Castejon <castejon at dpi.inpe.br>
+    \ingroup PDIAux
+   */
+  template< class T >
+  class TePDIMtxDoubleAdpt : public TePDIMatrix< T >,
+    public TePDIMtxDoubleAdptInt
+  {
+    public :
+      
+      /*! Forward declaration for memory policy */
+      typedef typename TePDIMatrix< T >::MemoryPolicy MemoryPolicy;
+      
+      TePDIMtxDoubleAdpt() {};
+      
+      ~TePDIMtxDoubleAdpt() {};
+
+      // Overloaded.
+      inline void getValue( const unsigned int& lin, 
+        const unsigned int col, double& value ) const
+      {
+        TEAGN_DEBUG_CONDITION( col < TePDIMatrix< T >::GetColumns(),
+          "Invalid column" );
+        
+        value = (double)TePDIMatrix< T >::getScanLine( lin )[ col ];
+      };
+      
+      // Overloaded.
+      inline void setValue( const unsigned int& lin, 
+        const unsigned int col, const double& value )
+      {
+        TEAGN_DEBUG_CONDITION( col < TePDIMatrix< T >::GetColumns(),
+          "Invalid column" );
+        
+        TePDIMatrix< T >::getScanLine( lin )[ col ] = (T)value;  
+      };
+      
+      // Overloaded.
+      inline bool reset( unsigned int lines, unsigned int columns )
+      {
+        return TePDIMatrix< T >::Reset( lines, columns );
+      };
+      
+      // Overloaded
+      inline unsigned int getNLines() const
+      {
+        return TePDIMatrix< T >::GetLines();
+      };
+      
+      // Overloaded
+      inline unsigned int getNCols() const
+      {
+        return TePDIMatrix< T >::GetColumns();          
+      };
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDINoBlendSF.cpp b/src/terralib/image_processing/TePDINoBlendSF.cpp
deleted file mode 100755
index a50c878..0000000
--- a/src/terralib/image_processing/TePDINoBlendSF.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "TePDINoBlendSF.hpp"
-#include "TePDINoBlendStrategy.hpp"
-
-TePDINoBlendSF::TePDINoBlendSF()
-: TePDIBlendStratFactory( std::string( "no_blending" ) )
-{
-};      
-
-TePDINoBlendSF::~TePDINoBlendSF()
-{
-};
-
-
-TePDIBlendingStrategy* TePDINoBlendSF::build ( const TePDIParameters& )
-{
-  TePDIBlendingStrategy* instance_ptr = new TePDINoBlendStrategy();
-  
-  return instance_ptr;
-}
-
diff --git a/src/terralib/image_processing/TePDINoBlendSF.hpp b/src/terralib/image_processing/TePDINoBlendSF.hpp
deleted file mode 100755
index f4b84de..0000000
--- a/src/terralib/image_processing/TePDINoBlendSF.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDINOBLENDSF_HPP
-  #define TEPDINOBLENDSF_HPP
-
-  #include <TePDIBlendStratFactory.hpp>
-  
-  /**
-   * @brief This is the class for no blending factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategiesFactories
-   */
-  class PDI_DLL TePDINoBlendSF : public TePDIBlendStratFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDINoBlendSF();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDINoBlendSF();
-      
-    protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated strategy instance.
-       */
-      TePDIBlendingStrategy* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace
-  {  
-    static TePDINoBlendSF TePDINoBlendSF_instance;
-  };
-
-#endif
-
diff --git a/src/terralib/image_processing/TePDINoBlendStrategy.cpp b/src/terralib/image_processing/TePDINoBlendStrategy.cpp
deleted file mode 100755
index 9d5c761..0000000
--- a/src/terralib/image_processing/TePDINoBlendStrategy.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
- 
-#include "TePDINoBlendStrategy.hpp"
-#include "TePDIBlending.hpp"
-#include "TePDIUtils.hpp"
-#include "TePDIStrategyFactory.hpp"
-#include "TePDIPIManager.hpp"
-#include <TeAgnostic.h>
-
-#include <TeBox.h>
-#include <TeUtils.h>
-#include <TeOverlay.h>
-
-TePDINoBlendStrategy::TePDINoBlendStrategy()
-{
-};      
-
-TePDINoBlendStrategy::~TePDINoBlendStrategy()
-{
-};
-
-
-bool TePDINoBlendStrategy::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking input_raster1 */
-  
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster1", 
-    input_raster1 ),
-    "Missing parameter: input_raster1" );
-  TEAGN_TRUE_OR_RETURN( input_raster1.isActive(),
-    "Invalid parameter: input_raster1 inactive" );
-  TEAGN_TRUE_OR_RETURN( input_raster1->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: input_raster1 not ready" );    
-    
-  /* Checking input_raster2 */
-  
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster2", 
-    input_raster2 ),
-    "Missing parameter: input_raster2" );
-  TEAGN_TRUE_OR_RETURN( input_raster2.isActive(),
-    "Invalid parameter: input_raster2 inactive" );
-  TEAGN_TRUE_OR_RETURN( input_raster2->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: input_raster2 not ready" );    
-    
-  /* Checking output_raster */
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
-    output_raster ),
-    "Missing parameter: output_raster" );
-  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
-    "Invalid parameter: output_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );    
-    
-  /* channels1 parameter checking */
-
-  std::vector< int > channels1;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "channels1", channels1 ), 
-    "Missing parameter: channels1" );
-  for( unsigned int channels1_index = 0 ; 
-    channels1_index < channels1.size() ; 
-    ++channels1_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( channels1[ channels1_index ] >= 0 ) &&
-      ( channels1[ channels1_index ] < input_raster1->nBands() ),
-      "Invalid parameter: channels1" );
-  }
-  
-  /* channels2 parameter checking */
-
-  std::vector< int > channels2;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "channels2", channels2 ), 
-    "Missing parameter: channels2" );
-  TEAGN_TRUE_OR_RETURN( ( channels2.size() == channels1.size() ),
-    "Size mismatch between channels1 and channels2" );
-  for( unsigned int channels2_index = 0 ; 
-    channels2_index < channels2.size() ; 
-    ++channels2_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( channels2[ channels2_index ] >= 0 ) &&
-      ( channels2[ channels2_index ] < input_raster2->nBands() ),
-      "Invalid parameter: channels2" );
-  }       
-    
-  /* Checking raster polygons */
-  
-  TePDITypes::TePDIPolygonPtrType raster1_pol_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster1_pol_ptr", 
-    raster1_pol_ptr ), "Missing parameter : raster1_pol_ptr" );
-  TEAGN_TRUE_OR_RETURN( raster1_pol_ptr.isActive(),
-    "Invalid parameter : raster1_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN(
-    ( ! input_raster1->begin( *raster1_pol_ptr, TeBoxPixelIn, 
-    0 ).end() ), "Invalid parameter : raster1_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN( ( raster1_pol_ptr->size() == 1 ),
-    "Invalid parameter : raster1_pol_ptr" )
-    
-  TePDITypes::TePDIPolygonPtrType raster2_pol_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster2_pol_ptr", 
-    raster2_pol_ptr ), "Missing parameter : raster2_pol_ptr" );
-  TEAGN_TRUE_OR_RETURN( raster2_pol_ptr.isActive(),
-    "Invalid parameter : raster2_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN(
-    ( ! input_raster2->begin( *raster2_pol_ptr, TeBoxPixelIn, 
-    0 ).end() ), "Invalid parameter : raster2_pol_ptr" )
-  TEAGN_TRUE_OR_RETURN( ( raster2_pol_ptr->size() == 1 ),
-    "Invalid parameter : raster2_pol_ptr" )
-    
-  /* Checking raster2 polygon offsets */
-  
-  double raster2_pol_offset_x = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster2_pol_offset_x", 
-    raster2_pol_offset_x ), "Missing parameter : raster2_pol_offset_x" );  
-
-  double raster2_pol_offset_y = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "raster2_pol_offset_y", 
-    raster2_pol_offset_y ), "Missing parameter : raster2_pol_offset_y" );    
-    
-  return true;
-}
-
-
-bool TePDINoBlendStrategy::Implementation( const TePDIParameters& params )
-{
-  /* Extracting parameters */
-
-  TePDITypes::TePDIRasterPtrType input_raster1;
-  params.GetParameter( "input_raster1", input_raster1 );
-  TeRaster& input_raster1_ref = *( input_raster1.nakedPointer() );
-
-  TePDITypes::TePDIRasterPtrType input_raster2;
-  params.GetParameter( "input_raster2", input_raster2 );
-  TeRaster& input_raster2_ref = *( input_raster2.nakedPointer() );
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params.GetParameter( "output_raster", output_raster );
-  TeRaster& output_raster_ref = *( output_raster.nakedPointer() );
-  
-  std::vector< int > channels1;
-  params.GetParameter( "channels1", channels1 );
-
-  std::vector< int > channels2;
-  params.GetParameter( "channels2", channels2 ); 
- 
-  /* Dummy definition */
-  
-  const bool no_force_dummy = ! params.CheckParameter< double >( "dummy_value" );
-  double forced_dummy_value = 0;
-  if( ! no_force_dummy ) {
-    params.GetParameter( "dummy_value", forced_dummy_value );
-  }    
-  
-  /* Calculating intersecion polygons data */
-  
-  TePolygon new_raster1_polygon;
-  TePolygon new_raster2_polygon;
-  TePolygon int_pol_refout;
-  TePolygon int_pol_ref2;
-  double raster1_rel_index_offset_x = 0;
-  double raster1_rel_index_offset_y = 0;
-  double raster2_rel_index_offset_x = 0;
-  double raster2_rel_index_offset_y = 0;
-  short pols_relation = 0;
-
-  TEAGN_TRUE_OR_RETURN( TePDIBlending::extractPolygons( params, 
-    new_raster1_polygon, new_raster2_polygon, int_pol_refout, int_pol_ref2,
-    pols_relation,
-    raster1_rel_index_offset_x, raster1_rel_index_offset_y,
-    raster2_rel_index_offset_x, raster2_rel_index_offset_y ),
-    "Error extracting intersection polygons" );
-  
-  /* Global vars */
-  
-  TeRaster::iteratorPoly intersection_refout_it =
-    output_raster->begin( int_pol_refout, TeBoxPixelIn, 0 );
-  TEAGN_TRUE_OR_RETURN( ( ! intersection_refout_it.end() ), 
-    "Unable to create an iterator over raster2 area" );       
-  
-  TePDIPIManager progress( "Rendering intersection...", 
-    intersection_refout_it.nLinesInPoly() * channels1.size(),
-    progress_interface_enabled_ );
-    
-  /* Rendering intersection */
-  
-  int raster1_offset_x = TeRound( raster1_rel_index_offset_x );
-  int raster1_offset_y = TeRound( raster1_rel_index_offset_y );    
-  int raster2_offset_x = TeRound( raster2_rel_index_offset_x );
-  int raster2_offset_y = TeRound( raster2_rel_index_offset_y );    
-  
-  for( unsigned int channels_index = 0 ; channels_index < channels1.size() ;
-    ++channels_index ) {
-    
-    const unsigned int channel1 = channels1[ channels_index ];
-    const unsigned int channel2 = channels2[ channels_index ];  
-  
-    unsigned int curr_line = 0;
-    unsigned int curr_col = 0;
-    unsigned int last_line = 0; 
-    
-    double value = 0;
-    
-    intersection_refout_it =
-      output_raster->begin( int_pol_refout, TeBoxPixelIn, 0 );
-  
-    while( ! intersection_refout_it.end() ) {
-      curr_line = intersection_refout_it.currentLine();
-      curr_col = intersection_refout_it.currentColumn();
-            
-      if( input_raster2_ref.getElement( curr_col + raster2_offset_x, 
-        curr_line + raster2_offset_y, value, channel2 ) ) {
-        
-        if( no_force_dummy || ( value != forced_dummy_value ) ) {
-          TEAGN_TRUE_OR_RETURN( 
-              output_raster_ref.setElement( curr_col, curr_line, value, 
-              channels_index ),
-              "Unable to write to output raster at line=" + 
-              Te2String( curr_line ) + 
-              " col=" + Te2String( curr_col ) );          
-        } else {
-          if( input_raster1_ref.getElement( curr_col + raster1_offset_x, 
-            curr_line + raster1_offset_y, value, channel1 ) ) {
-            
-            if( no_force_dummy || ( value != forced_dummy_value ) ) {
-              TEAGN_TRUE_OR_RETURN( 
-                output_raster_ref.setElement( curr_col, curr_line, value, 
-                channels_index ),
-                "Unable to write to output raster at line=" + 
-                Te2String( curr_line ) + 
-                " col=" + Te2String( curr_col ) );            
-            }
-          }     
-        }
-      } else {
-        if( input_raster1_ref.getElement( curr_col + raster1_offset_x, 
-          curr_line + raster1_offset_y, value, channel1 ) ) {
-          
-          if( no_force_dummy || ( value != forced_dummy_value ) ) {
-            TEAGN_TRUE_OR_RETURN( 
-              output_raster_ref.setElement( curr_col, curr_line, value, 
-              channels_index ),
-              "Unable to write to output raster at line=" + 
-              Te2String( curr_line ) + 
-              " col=" + Te2String( curr_col ) );            
-          }
-        }
-      }
-      
-      if( curr_line != last_line ) {
-        last_line = curr_line;
-        progress.Increment();
-      }      
-    
-      ++intersection_refout_it;
-    }
-  }
-  
-  return true;
-}
-
-
diff --git a/src/terralib/image_processing/TePDINoBlendStrategy.hpp b/src/terralib/image_processing/TePDINoBlendStrategy.hpp
deleted file mode 100755
index d92a0f4..0000000
--- a/src/terralib/image_processing/TePDINoBlendStrategy.hpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDINOBLENDSTRATEGY_HPP
-  #define TEPDINOBLENDSTRATEGY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIBlendingStrategy.hpp"
-  #include "TePDIParameters.hpp"
-  
-  #include <string>
-
-  /**
-   * @brief This is the class for no blending strategy.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIBlendingStrategies
-   *
-   * @note The required parameters are:
-   * @param input_raster1 ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Input raster 1.
-   * @param input_raster2 ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Input raster 2.
-   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
-   * @param channels1 ( std::vector< int > ) - The channels to process from 
-   * input_raster1.
-   * @param channels2 ( std::vector< int > ) - The channels to process from 
-   * input_raster2.
-   * Raster 1 polygon pointer ( related to
-   * input_raster1 world reference - Just 1 linear ring allowed ).
-   * @param raster2_pol_ptr ( TePDITypes::TePDIPolygonPtrType ) - 
-   * Raster 2 polygon pointer ( related to 
-   * input_raster2 world reference - Just 1 linear ring allowed ).
-   * @param raster2_pol_offset_x ( double ) - Raster 2 polygon box X offset 
-   * related to raster1 polygon box in input_raster1 matricial reference
-   * ( offset_x = pol2_x - pol1_x ).
-   * @param raster2_pol_offset_y ( double ) - Raster 2 polygon box Y offset 
-   * related to raster1 polygon box in input_raster1 matricial reference
-   * ( offset_y = pol2_y - pol1_y ). 
-   *
-   * @note The optional parameters are:
-   *
-   * @param dummy_value (double) - A dummy pixel value for use 
-   * in pixels where no data is available ( input pixels with
-   * dummy values will be ignored ).  
-   *
-   * @note The output_raster parameters will take the input_raster1 as
-   * reference.
-   * @note All input rasters must have the same dimensions.
-   *
-   */
-  class PDI_DLL TePDINoBlendStrategy : public TePDIBlendingStrategy
-  {
-    friend class TePDINoBlendSF;
-  
-    public :
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDINoBlendStrategy();
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI strategy.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( 
-        const TePDIParameters& parameters ) const;       
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDINoBlendStrategy();
-      
-      /**
-       * @brief Runs the algorithm implementation.
-       *
-       * @return true if OK. false on errors.
-       */
-      bool Implementation( const TePDIParameters& params );
-     
-  };
-  
-#endif
-
-
-
diff --git a/src/terralib/image_processing/TePDIOFMatching.cpp b/src/terralib/image_processing/TePDIOFMatching.cpp
index cefb0b6..2dd0cd2 100644
--- a/src/terralib/image_processing/TePDIOFMatching.cpp
+++ b/src/terralib/image_processing/TePDIOFMatching.cpp
@@ -1,2560 +1,2571 @@
-#include "TePDIOFMatching.hpp"
-
-#include "TePDIUtils.hpp"
-
-#include <TeThreadFunctor.h>
-#include <TeMutex.h>
-#include <TeCoord2D.h>
-#include <TeGTFactory.h>
-#include <TeDefines.h>
-
-#include <math.h>
-
-#ifndef M_PI
-  #define M_PI       3.14159265358979323846
-#endif
-#ifndef M_PI_2
-  #define M_PI_2     1.57079632679489661923
-#endif
-#ifndef M_PI_4
-  #define M_PI_4     0.785398163397448309616
-#endif
-
-TePDIOFMatching::TePDIOFMatching()
-{
-}
-
-
-TePDIOFMatching::~TePDIOFMatching()
-{
-}
-
-
-bool TePDIOFMatching::RunImplementation()
-{
-  /* Retriving Parameters */
-  
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  params_.GetParameter( "input_image1_ptr", input_image1_ptr );  
-  
-  unsigned int input_channel1 = 0;
-  params_.GetParameter( "input_channel1", input_channel1 );   
-  
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  params_.GetParameter( "input_image2_ptr", input_image2_ptr );  
-  
-  unsigned int input_channel2 = 0;
-  params_.GetParameter( "input_channel2", input_channel2 );   
-
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
-  params_.GetParameter( "out_tie_points_ptr", out_tie_points_ptr );   
-  
-  TeGTParams gt_params;
-  gt_params.out_rem_strat_ = TeGTParams::LWAOutRemotion;
-  gt_params.max_dmap_error_ = 1.0;
-  gt_params.max_imap_error_ = 1.0;
-  gt_params.transformation_name_ = "affine";
-  if( params_.CheckParameter< TeGTParams >( "gt_params" ) ) {
-    params_.GetParameter( "gt_params", gt_params );
-  }
-  
-  TeBox input_box1;
-  if( params_.CheckParameter< TeBox >( "input_box1" ) ) {
-    params_.GetParameter( "input_box1", input_box1 );
-  } else {
-    TeBox input_box1_proj = input_image1_ptr->params().box();
-    
-    TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, input_image1_ptr,
-      input_box1 );
-  }
-  
-  TeBox input_box2;
-  if( params_.CheckParameter< TeBox >( "input_box2" ) ) {
-    params_.GetParameter( "input_box2", input_box2 );
-  } else {
-    TeBox input_box2_proj = input_image2_ptr->params().box();
-    
-    TePDIUtils::MapCoords2RasterIndexes( input_box2_proj, input_image2_ptr,
-      input_box2 );
-  }  
-  
-  bool enable_multi_thread = false;
-  if( params_.CheckParameter< int >( "enable_multi_thread" ) ) {
-    enable_multi_thread = true;
-  }
-  
-  bool skip_geom_filter = false;
-  if( params_.CheckParameter< int >( "skip_geom_filter" ) ) {
-    skip_geom_filter = true;
-  }  
-  
-  double pixel_x_relation = 1.0;
-  if( params_.CheckParameter< double >( "pixel_x_relation" ) ) {
-    params_.GetParameter( "pixel_x_relation", pixel_x_relation );
-  }
-  
-  double pixel_y_relation = 1.0;
-  if( params_.CheckParameter< double >( "pixel_y_relation" ) ) {
-    params_.GetParameter( "pixel_y_relation", pixel_y_relation );
-  }  
-  
-  unsigned int max_tie_points = 529;
-  if( params_.CheckParameter< unsigned int >( "max_tie_points" ) ) {
-    params_.GetParameter( "max_tie_points", max_tie_points );
-  }    
-  
-  double corr_sens = 0.5;
-  if( params_.CheckParameter< double >( "corr_sens" ) ) {
-    params_.GetParameter( "corr_sens", corr_sens );
-  }    
-  
-  unsigned int corr_window_width = 21;
-  if( params_.CheckParameter< unsigned int >( 
-    "corr_window_width" ) ) {
-    
-    params_.GetParameter( "corr_window_width", corr_window_width );
-  }     
-  
-  unsigned int max_size_opt = 0;
-  if( params_.CheckParameter< unsigned int >( "max_size_opt" ) ) {
-    params_.GetParameter( "max_size_opt", max_size_opt );
-  }   
-  
-  double maximas_sens = 0;
-  if( params_.CheckParameter< double >( "maximas_sens" ) ) {
-    params_.GetParameter( "maximas_sens", maximas_sens );
-  }      
-  
-  /* Calculating the number of allowed threads - this process
-     not included into the count */
-     
-  unsigned int max_threads = 0;
-  std::vector< TeThreadFunctor::pointer > threads_vector;
-  
-  if( enable_multi_thread ) {
-    max_threads = TeGetPhysProcNumber() - 1;
-    
-    for( unsigned int index = 0 ; index < max_threads ; ++index ) {
-      TeThreadFunctor::pointer aux_thread_ptr( new TeThreadFunctor );
-    
-      threads_vector.push_back( aux_thread_ptr );
-    }
-  }
-  
-  /* Calculating the box postion related values */
-  
-  const unsigned int orig_box1_x_off = (unsigned int)input_box1.lowerLeft().x();
-  const unsigned int orig_box1_y_off = (unsigned int)input_box1.upperRight().y();
-  const unsigned int orig_box1_nlines = 1 + (unsigned int)ABS( input_box1.height() );
-  const unsigned int orig_box1_ncols = 1 + (unsigned int)ABS( input_box1.width() );
-  
-  const unsigned int orig_box2_x_off = (unsigned int)input_box2.lowerLeft().x();
-  const unsigned int orig_box2_y_off = (unsigned int)input_box2.upperRight().y();
-  const unsigned int orig_box2_nlines = 1 + (unsigned int)ABS( input_box2.height() );
-  const unsigned int orig_box2_ncols = 1 + (unsigned int)ABS( input_box2.width() );
-    
-  /* Calculating the rescale factors 
-     rescaled_image = original_image * rescale_factor */
-  
-  double img1_x_rescale_factor = 1.0;
-  double img1_y_rescale_factor = 1.0;
-  double img2_x_rescale_factor = 1.0;
-  double img2_y_rescale_factor = 1.0;
-  {
-    double mean_pixel_relation = ( pixel_x_relation + pixel_y_relation ) /
-      2.0;
-      
-    if( mean_pixel_relation > 1.0 ) {
-      /* The image 1 has poor resolution - bigger pixel resolution values -
-         and image 2 needs to be rescaled down */
-      
-      img2_x_rescale_factor = 1.0 / pixel_x_relation;
-      img2_y_rescale_factor = 1.0 / pixel_y_relation;
-    } else if( mean_pixel_relation < 1.0 ) {
-      /* The image 2 has poor resolution - bigger pixel resolution values
-        and image 1 needs to be rescaled down */
-      
-      img1_x_rescale_factor = pixel_x_relation;
-      img1_y_rescale_factor = pixel_y_relation;
-    }
-  } 
-  
-  if( max_size_opt )
-  {
-    double resc_box1_size = 
-      ( (double)orig_box1_nlines  ) * img1_y_rescale_factor *
-      ( (double)orig_box1_ncols ) * img1_x_rescale_factor;
-    double resc_box2_size = 
-      ( (double)orig_box2_nlines  ) * img2_y_rescale_factor *
-      ( (double)orig_box2_ncols ) * img2_x_rescale_factor;
-    double max_size_opt_double = (double)max_size_opt;
-    
-    if( ( resc_box1_size > max_size_opt_double ) || 
-      ( resc_box2_size > max_size_opt_double ) )
-    {
-      double opt_rescale_factor = 1.0;
-      
-      if( resc_box1_size > resc_box2_size )
-      {
-        opt_rescale_factor = sqrt( resc_box1_size / max_size_opt_double );
-      }
-      else
-      {
-        opt_rescale_factor = sqrt( resc_box2_size / max_size_opt_double );
-      }
-      
-      img1_x_rescale_factor *= opt_rescale_factor;
-      img1_y_rescale_factor *= opt_rescale_factor;
-      img2_x_rescale_factor *= opt_rescale_factor;
-      img2_y_rescale_factor *= opt_rescale_factor;
-    }
-  }
-  
-  /* Calculating the max tie-points to be generated for each image
-     trying to keep the same tie-point density for both images */
-     
-  unsigned int img1_max_tps = 0;
-  unsigned int img2_max_tps = 0;
-  
-  {
-    double resc_box1_nlines =  ( (double)orig_box1_nlines  ) * 
-      img1_y_rescale_factor;
-    double resc_box1_ncols =  ( (double)orig_box1_ncols ) * 
-      img1_x_rescale_factor;
-    double resc_box2_nlines =  ( (double)orig_box2_nlines  ) * 
-      img2_y_rescale_factor;
-    double resc_box2_ncols =  ( (double)orig_box2_ncols ) * 
-      img2_x_rescale_factor;
-      
-    double resc_box1_area = resc_box1_nlines * resc_box1_ncols;
-    double resc_box2_area = resc_box2_nlines * resc_box2_ncols;
-      
-    if( resc_box1_area > resc_box2_area )
-    {
-      img2_max_tps = max_tie_points;
-      
-      img1_max_tps = (unsigned int)( 
-        resc_box1_area / 
-        ( resc_box2_area / ( (double)max_tie_points ) ) );
-    }
-    else
-    {
-      img1_max_tps = max_tie_points;
-      
-      img2_max_tps = (unsigned int)( 
-        resc_box2_area / 
-        ( resc_box1_area / ( (double)max_tie_points ) ) ); 
-    }
-  }
-  
-  /* Loading images */
-  
-  TeMutex glb_mem_lock; //global memory lock
-  
-  ImgMatrixT img1_matrix;
-  ImgMatrixT img2_matrix;
- 
-  {
-    TeThreadParameters tparams1;
-    tparams1.store( "input_image_ptr", input_image1_ptr );
-    tparams1.store( "img_matrix_ptr", &img1_matrix );
-    tparams1.store( "img_x_rescale_factor", img1_x_rescale_factor );
-    tparams1.store( "img_y_rescale_factor", img1_y_rescale_factor );
-    tparams1.store( "box_x_off", orig_box1_x_off );
-    tparams1.store( "box_y_off", orig_box1_y_off );
-    tparams1.store( "box_nlines", orig_box1_nlines );
-    tparams1.store( "box_ncols", orig_box1_ncols );
-    tparams1.store( "input_channel", input_channel1 );
-    tparams1.store( "progress_enabled", progress_enabled_ );
-    tparams1.store( "glb_mem_lock_ptr", &glb_mem_lock );
-    
-    TeThreadParameters tparams2;
-    tparams2.store( "input_image_ptr", input_image2_ptr );
-    tparams2.store( "img_matrix_ptr", &img2_matrix );
-    tparams2.store( "img_x_rescale_factor", img2_x_rescale_factor );
-    tparams2.store( "img_y_rescale_factor", img2_y_rescale_factor );
-    tparams2.store( "box_x_off", orig_box2_x_off );
-    tparams2.store( "box_y_off", orig_box2_y_off );
-    tparams2.store( "box_nlines", orig_box2_nlines );
-    tparams2.store( "box_ncols", orig_box2_ncols );
-    tparams2.store( "input_channel", input_channel2 );
-    tparams2.store( "progress_enabled", progress_enabled_ );
-    tparams2.store( "glb_mem_lock_ptr", &glb_mem_lock );
-  
-    if( max_threads > 0 ) {
-      threads_vector[ 0 ]->setStartFunctPtr( loadImage );
-      threads_vector[ 0 ]->setParameters( tparams1 );
-      threads_vector[ 0 ]->start();
-   
-      if( ! loadImage( tparams2 ) ) {
-        threads_vector[ 0 ]->waitToFinish();
-        
-        TEAGN_LOG_AND_RETURN( "Unable to load image 2" )
-      } else {
-        threads_vector[ 0 ]->waitToFinish();
-        
-        TEAGN_TRUE_OR_RETURN( threads_vector[ 0 ]->getReturnValue(),
-          "Unable to load image 1" )
-      }
-    } else {
-      TEAGN_TRUE_OR_RETURN( loadImage( tparams1 ),
-        "Error loading image 1" )
-      TEAGN_TRUE_OR_RETURN( loadImage( tparams2 ),
-        "Error loading image 2" )
-    }
-  }
-  
-/* remove */        
-//matrix2Tiff( img1_matrix, "img1_matrix.tif", 
-//  std::vector< TeCoord2D >() );
-//matrix2Tiff( img2_matrix, "img2_matrix.tif",
-//  std::vector< TeCoord2D >() );
-/* remove */  
-  
-  /* Generating the correlation windows and the maxima points */
-  
-  std::vector< TeCoord2D > img1_maxima_points;
-  std::vector< TeCoord2D > img2_maxima_points;
-  
-  ImgMatrixT img1_features_matrix;/* each line is a stacked version
-                                     of one rotated correlation 
-                                     window */
-  ImgMatrixT img2_features_matrix;/* each line is a stacked version
-                                     of one rotated correlation 
-                                     window */
-  {
-    TeThreadParameters tparams1;
-    tparams1.store( "img_matrix_ptr", &img1_matrix );
-    tparams1.store( "corr_window_width", corr_window_width );
-    tparams1.store( "img_maxima_points_ptr", &img1_maxima_points );
-    tparams1.store( "img_features_matrix_ptr", &img1_features_matrix );
-    tparams1.store( "progress_enabled", progress_enabled_ );
-    tparams1.store( "max_points", img1_max_tps );
-    tparams1.store( "glb_mem_lock_ptr", &glb_mem_lock );
-    tparams1.store( "maximas_sens", maximas_sens );
-    
-    TeThreadParameters tparams2;
-    tparams2.store( "img_matrix_ptr", &img2_matrix );
-    tparams2.store( "corr_window_width", corr_window_width );
-    tparams2.store( "img_maxima_points_ptr", &img2_maxima_points );
-    tparams2.store( "img_features_matrix_ptr", &img2_features_matrix );    
-    tparams2.store( "progress_enabled", progress_enabled_ );
-    tparams2.store( "max_points", img2_max_tps );
-    tparams2.store( "glb_mem_lock_ptr", &glb_mem_lock );
-    tparams2.store( "maximas_sens", maximas_sens );
-    
-    if( max_threads > 0 ) {
-      threads_vector[ 0 ]->setStartFunctPtr( generateFeatures );
-      threads_vector[ 0 ]->setParameters( tparams1 );
-      threads_vector[ 0 ]->start();
-    
-      if( ! generateFeatures( tparams2 ) ) {
-        threads_vector[ 0 ]->waitToFinish();
-        
-        TEAGN_LOG_AND_RETURN( "Unable to the correlation windows from image 2" )
-      } else {
-        threads_vector[ 0 ]->waitToFinish();
-        
-        TEAGN_TRUE_OR_RETURN( threads_vector[ 0 ]->getReturnValue(),
-          "Unable to the correlation windows from image 1" )
-      }      
-    } else {
-      TEAGN_TRUE_OR_RETURN( generateFeatures( tparams1 ),
-        "Error generating the correlation windows from image 1" )
-      TEAGN_TRUE_OR_RETURN( generateFeatures( tparams2 ),
-        "Error generating the correlation windows from image 2" )        
-    }
-    
-    if( ( img1_maxima_points.size() == 0 ) ||
-      ( img2_maxima_points.size() == 0 ) )
-    {
-      /* No maximas found in one image */
-      
-      return true;
-    }
-    
-/* remove */
-//matrix2Tiff( img1_matrix, "img1_matrix_with_maxima_points.tif", 
-//  img1_maxima_points );
-//matrix2Tiff( img2_matrix, "img2_matrix_with_maxima_points.tif", 
-//  img2_maxima_points );
-/* remove */
-    
-    /* Bringing img1_maxima_points into input_image1_ptr 
-       reference */
- 
-    std::vector< TeCoord2D >::iterator maximas_it = 
-      img1_maxima_points.begin();
-    std::vector< TeCoord2D >::iterator maximas_it_end = 
-      img1_maxima_points.end();
-      
-    while( maximas_it != maximas_it_end ) {
-      (*maximas_it) = 
-        TeCoord2D( 
-          ( (*maximas_it).x() / img1_x_rescale_factor ) +
-            ( (double)orig_box1_x_off ),
-          ( (*maximas_it).y() / img1_y_rescale_factor ) +
-            ( (double)orig_box1_y_off )
-        );
-        
-      TEAGN_DEBUG_CONDITION( 
-        ( maximas_it->x() < input_image1_ptr->params().ncols_ ),
-        "Invalid x coord generated" )
-      TEAGN_DEBUG_CONDITION( 
-        ( maximas_it->x() >= 0 ),
-        "Invalid x coord generated" )        
-      TEAGN_DEBUG_CONDITION( 
-        ( maximas_it->y() < input_image1_ptr->params().nlines_ ),
-        "Invalid y coord generated" )
-      TEAGN_DEBUG_CONDITION( 
-        ( maximas_it->y() >= 0 ),
-        "Invalid y coord generated" )           
-        
-      ++maximas_it;
-    }
-    
-    /* Bringing img2_maxima_points into input_image2_ptr 
-       reference */    
-    
-    maximas_it = img2_maxima_points.begin();
-    maximas_it_end = img2_maxima_points.end();
-      
-    while( maximas_it != maximas_it_end ) {
-      (*maximas_it) = 
-        TeCoord2D( 
-          ( (*maximas_it).x() / img2_x_rescale_factor ) +
-            ( (double)orig_box2_x_off ),
-          ( (*maximas_it).y() / img2_y_rescale_factor ) +
-            ( (double)orig_box2_y_off )
-        );
-      
-      TEAGN_DEBUG_CONDITION( 
-        ( maximas_it->x() < input_image2_ptr->params().ncols_ ),
-        "Invalid x coord generated" )
-      TEAGN_DEBUG_CONDITION( 
-        ( maximas_it->x() >= 0 ),
-        "Invalid x coord generated" )         
-      TEAGN_DEBUG_CONDITION( 
-        ( maximas_it->y() < input_image2_ptr->params().nlines_ ),
-        "Invalid y coord generated" ) 
-      TEAGN_DEBUG_CONDITION( 
-        ( maximas_it->y() >= 0 ),
-        "Invalid y coord generated" )                 
-        
-      ++maximas_it;
-    }    
-  }
-  
-  TEAGN_DEBUG_CONDITION( ( img1_maxima_points.size() ==
-    img1_features_matrix.GetLines() ),
-    "Features number mismatch" );
-  TEAGN_DEBUG_CONDITION( ( img2_maxima_points.size() ==
-    img2_features_matrix.GetLines() ),
-    "Features number mismatch" ); 
-    
-  TEAGN_DEBUG_CONDITION( checkMaximaPoints( img1_maxima_points ),
-    "Invalid img1 maximas" )
-  TEAGN_DEBUG_CONDITION( checkMaximaPoints( img2_maxima_points ),
-    "Invalid img2 maximas" )
-    
-  /* Free anused resources */
-  
-  img1_matrix.Reset();
-  img2_matrix.Reset();
-
-/* remove */
-//raster2Tiff( input_image1_ptr, input_channel1,
-//  "orig_img1_plus_all_maximas.tif",
-//  img1_maxima_points,TeSharedPtr< TeCoordPairVect >(), 0 );
-//raster2Tiff( input_image2_ptr, input_channel2,
-//  "orig_img2_plus_all_maximas.tif",
-//  img2_maxima_points, TeSharedPtr< TeCoordPairVect >(), 0 ); 
-/* remove */
-  
-  
-/* remove */
-//features2Tiff( corr_window_width, img1_maxima_points, 
-//  img1_features_matrix, "img1" );
-//features2Tiff( corr_window_width, img2_maxima_points, 
-//  img2_features_matrix, "img2" );
-/* remove */   
-  
-  /* Matching the correlation windows */
-  
-  /* A vector with the matrix 2 features indexes with
-    the best correlation value for each matrix 1 element 
-    features2_indexes size = img1_features_matrix size */
-  std::vector< unsigned int > features2_indexes;
-  
-  /* A vector with the matrix 1 features indexes with
-    the best correlation value for each matrix 2 element 
-    features1_indexes size = img2_features_matrix size */
-  std::vector< unsigned int > features1_indexes;
-      
-  {
-    /* lock objects for the two vectors */
-    TeMutex features2_indexes_lock;
-    TeMutex features1_indexes_lock;
-   
-    TeThreadParameters tparams;
-    tparams.store( "features2_indexes_ptr", &features2_indexes );
-    tparams.store( "features1_indexes_ptr", &features1_indexes );
-    tparams.store( "features2_indexes_lock_ptr", 
-      &features2_indexes_lock );
-    tparams.store( "features1_indexes_lock_ptr", 
-      &features1_indexes_lock );      
-    tparams.store( "img1_features_matrix_ptr", 
-      &img1_features_matrix );
-    tparams.store( "img2_features_matrix_ptr", 
-      &img2_features_matrix );
-    tparams.store( "progress_enabled", progress_enabled_ );
-    tparams.store( "corr_sens", corr_sens );
-    
-    if( max_threads > 0 ) 
-    {
-      for( unsigned int thr_vec_ind = 0 ;
-        thr_vec_ind < threads_vector.size() ; ++thr_vec_ind ) {
-        
-        threads_vector[ thr_vec_ind ]->setStartFunctPtr( 
-          locateBestFeaturesMatching );
-          
-        threads_vector[ thr_vec_ind ]->setParameters( tparams );
-        threads_vector[ thr_vec_ind ]->start();
-      }
-        
-      if( ! locateBestFeaturesMatching( tparams ) ) {
-        for( unsigned int thr_vec_ind = 0 ;
-          thr_vec_ind < threads_vector.size() ; ++thr_vec_ind ) {
-          
-          threads_vector[ thr_vec_ind ]->waitToFinish();
-        }
-        
-        TEAGN_LOG_AND_RETURN( 
-          "Error locating the features matching for matrix 1" )
-      } else {
-        bool one_thread_returned_error = false;
-        
-        for( unsigned int thr_vec_ind = 0 ;
-          thr_vec_ind < threads_vector.size() ; ++thr_vec_ind ) {
-          
-          threads_vector[ thr_vec_ind ]->waitToFinish();
-          
-          if( ! threads_vector[ thr_vec_ind ]->getReturnValue() ) {
-            one_thread_returned_error = true;
-          }
-        }
-        
-        TEAGN_TRUE_OR_RETURN( ( ! one_thread_returned_error ),
-          "Error locating the features matching" )
-      }      
-    } else {
-      TEAGN_TRUE_OR_RETURN( locateBestFeaturesMatching( tparams ),
-        "Error locating the features matching" );
-    }
-  }
-  
-  TEAGN_DEBUG_CONDITION( ( img1_maxima_points.size() ==
-    features2_indexes.size() ),
-    "Features number mismatch" );
-  TEAGN_DEBUG_CONDITION( ( img2_maxima_points.size() ==
-    features1_indexes.size() ),
-    "Features number mismatch" );
-    
-  /* Free anused resources */
-  
-  img1_features_matrix.Reset();  
-  img2_features_matrix.Reset();
-    
-  /* Generating tie-points */
-  
-  out_tie_points_ptr->clear();
-   
-  {
-    unsigned int features2_indexes_size = features2_indexes.size();
-    unsigned int features1_indexes_size = features1_indexes.size();
-  
-    unsigned int f1i_index = 0;//index over features1_indexes
-    unsigned int f2i_index = 0;//index over features2_indexes
- 
-    /* features1_indexes pointed indexes */
-    unsigned int f1_pointed_index = 0;
-    /* features2_indexes pointed indexes */
-    unsigned int f2_pointed_index = 0;
-    
-    /* Getting the matchings priorizing the pointings
-       indicated by features2_indexes */
-  
-    for( f2i_index = 0 ; f2i_index < features2_indexes_size ;
-      ++f2i_index ) {
-      
-      f2_pointed_index = features2_indexes[ f2i_index ];
-      
-      if( f2_pointed_index < features1_indexes_size ) {
-        f1_pointed_index = features1_indexes[ f2_pointed_index ];
-          
-        if( f1_pointed_index == f2i_index ) {
-         
-          out_tie_points_ptr->push_back( TeCoordPair(
-            img1_maxima_points[ f2i_index ],
-            img2_maxima_points[ f2_pointed_index ] ) ); 
-            
-          /* Invalidating the pointings to avoid duplicated 
-            matches */
-            
-          features2_indexes[ f2i_index ] = features1_indexes_size;
-          features1_indexes[ f2_pointed_index ] =
-            features2_indexes_size;
-        }
-      }
-    }
-    
-    /* Getting the remaining matchings priorizing the pointings
-       indicated by features1_indexes */
-    
-    for( f1i_index = 0 ; f1i_index < features1_indexes_size ;
-      ++f1i_index ) {
-      
-      f1_pointed_index = features1_indexes[ f1i_index ];
-      
-      if( f1_pointed_index < features2_indexes_size ) {
-        
-        f2_pointed_index = features2_indexes[ f1_pointed_index ];
-        
-        if( f2_pointed_index == f1i_index ) {
-         
-          out_tie_points_ptr->push_back( TeCoordPair(
-            img1_maxima_points[ f1_pointed_index ],
-            img2_maxima_points[ f1i_index ] ) ); 
-            
-          /* Invalidating the pointings to avoid duplicated 
-            matches */
-            
-          features2_indexes[ f1_pointed_index ] = features1_indexes_size;
-          features1_indexes[ f1i_index ] = features2_indexes_size;            
-        }
-      }
-    }    
-
-  }
-  
-  TEAGN_DEBUG_CONDITION( checkTPs( *out_tie_points_ptr ),
-    "Invalid tie-points" )
-  
-  /* Free anused resources */
-  
-  img1_maxima_points.clear();
-  img2_maxima_points.clear();  
-  
-  features2_indexes.clear();
-  features1_indexes.clear();
-  
-/* remove */
-//raster2Tiff( input_image1_ptr, input_channel1,
-//  "orig_img1_plus_all_tp.tif",
-//  std::vector< TeCoord2D >(), out_tie_points_ptr, 0 );
-//raster2Tiff( input_image2_ptr, input_channel2,
-//  "orig_img2_plus_all_tp.tif",
-//  std::vector< TeCoord2D >(), out_tie_points_ptr, 1 );  
-/* remove */     
-  
-  /* Doing geometrical filtering using user supplied 
-     geometrical transformation parameters */
-     
-  if( ! skip_geom_filter ) {
-    gt_params.tiepoints_ = (*out_tie_points_ptr);
-       
-    TeGeometricTransformation::pointer trans_ptr( 
-      TeGTFactory::make( gt_params ) );
-    if( trans_ptr->reset( gt_params ) ) {
-      trans_ptr->getParameters( gt_params );
-      
-      /* updating the output tie points */
-      
-      (*out_tie_points_ptr) = gt_params.tiepoints_;
-      
-      /* updating the output gt_params, if available */
-      
-      TeGTParams::pointer out_gt_params_ptr;
-      if( params_.CheckParameter< TeGTParams::pointer >( 
-        "out_gt_params_ptr" ) ) 
-      {
-        params_.GetParameter( "out_gt_params_ptr", out_gt_params_ptr );
-        
-        *out_gt_params_ptr = gt_params;
-      }       
-    } else {
-      out_tie_points_ptr->clear();
-    }
-  }
-  
-/* remove */
-//raster2Tiff( input_image1_ptr, input_channel1,
-//  "orig_img1_plus_filtered_tp.tif",
-//  std::vector< TeCoord2D >(), out_tie_points_ptr, 0 );
-//raster2Tiff( input_image2_ptr, input_channel2,
-//  "orig_img2_plus_filtered_tp.tif",
-//  std::vector< TeCoord2D >(), out_tie_points_ptr, 1 );  
-/* remove */   
-  
-  return true;
-}
-
-
-bool TePDIOFMatching::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking input_image1_ptr */
-    
-  TePDITypes::TePDIRasterPtrType input_image1_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_image1_ptr", input_image1_ptr ),
-    "Missing parameter: input_image1_ptr" );
-  TEAGN_TRUE_OR_RETURN( input_image1_ptr.isActive(),
-    "Invalid parameter: input_image1_ptr inactive" );
-  TEAGN_TRUE_OR_RETURN( input_image1_ptr->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: input_image1_ptr not ready" );
-    
-  /* Checking input_channel1 */
-    
-  unsigned int input_channel1 = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_channel1", input_channel1 ),
-    "Missing parameter: input_channel1" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( (int)input_channel1 ) < 
-    input_image1_ptr->params().nBands() ),
-    "Invalid parameter: input_channel1" );
-  
-    
-  /* Checking input_image1_ptr */
-    
-  TePDITypes::TePDIRasterPtrType input_image2_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_image2_ptr", input_image2_ptr ),
-    "Missing parameter: input_image2_ptr" );
-  TEAGN_TRUE_OR_RETURN( input_image2_ptr.isActive(),
-    "Invalid parameter: input_image2_ptr inactive" );
-  TEAGN_TRUE_OR_RETURN( input_image2_ptr->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: input_image2_ptr not ready" );    
-    
-  /* Checking input_channel2 */
-    
-  unsigned int input_channel2 = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "input_channel2", input_channel2 ),
-    "Missing parameter: input_channel2" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( ( (int)input_channel2 ) < 
-    input_image2_ptr->params().nBands() ),
-    "Invalid parameter: input_channel2" );
-    
-  /* Checking out_tie_points_ptr */
-    
-  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
-    "out_tie_points_ptr", out_tie_points_ptr ),
-    "Missing parameter: out_tie_points_ptr" );
-  TEAGN_TRUE_OR_RETURN( out_tie_points_ptr.isActive(),
-    "Invalid parameter: out_tie_points_ptr inactive" );
-    
-  /* Checking gt_params */
-    
-  TeGTParams gt_params;
-  if( parameters.CheckParameter< TeGTParams >( "gt_params" ) ) {
-    parameters.GetParameter( "gt_params", gt_params );
-    
-    TEAGN_TRUE_OR_RETURN( ( TeGTFactory::instance().find( 
-      gt_params.transformation_name_ ) != 
-      TeGTFactory::instance().end() ),
-      "Invalid parameter : gt_params" )
-  }   
-    
-  /* Checking input_box1 */
-    
-  TeBox input_box1;
-  if( parameters.CheckParameter< TeBox >( "input_box1" ) ) {
-    parameters.GetParameter( "input_box1", input_box1 );
-    
-    TEAGN_TRUE_OR_RETURN( ( input_box1.x1() >= 0 ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( ( input_box1.x2() >= 0 ),
-      "Invalid parameter : input_box1" )      
-    TEAGN_TRUE_OR_RETURN( ( input_box1.y1() >= 0 ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( ( input_box1.y2() >= 0 ),
-      "Invalid parameter : input_box1" )         
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.x1() <= 
-        ( input_image1_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.x2() <= 
-        ( input_image1_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box1" )       
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.y1() <= 
-        ( input_image1_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box1" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box1.y2() <= 
-        ( input_image1_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box1" )        
-  }
-    
-  /* Checking input_box2 */
-    
-  TeBox input_box2;
-  if( parameters.CheckParameter< TeBox >( "input_box2" ) ) {
-    parameters.GetParameter( "input_box2", input_box2 );
-    
-    TEAGN_TRUE_OR_RETURN( ( input_box2.x1() >= 0 ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( ( input_box2.x2() >= 0 ),
-      "Invalid parameter : input_box2" )      
-    TEAGN_TRUE_OR_RETURN( ( input_box2.y1() >= 0 ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( ( input_box2.y2() >= 0 ),
-      "Invalid parameter : input_box2" )         
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.x1() <= 
-        ( input_image2_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.x2() <= 
-        ( input_image2_ptr->params().ncols_ - 1 ) ),
-      "Invalid parameter : input_box2" )       
-      
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.y1() <= 
-        ( input_image2_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box2" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_box2.y2() <= 
-        ( input_image2_ptr->params().nlines_ - 1 ) ),
-      "Invalid parameter : input_box2" )        
-  }    
-    
-  /* Checking pixel_x_relation */
-  
-  double pixel_x_relation = 1.0;
-  if( parameters.CheckParameter< double >( "pixel_x_relation" ) ) {
-    parameters.GetParameter( "pixel_x_relation", pixel_x_relation );
-    
-    TEAGN_TRUE_OR_RETURN( ( pixel_x_relation != 0.0 ),
-      "Invalid parameter : pixel_x_relation" )
-  }
-  
-  /* Checking pixel_y_relation */
-  
-  double pixel_y_relation = 1.0;
-  if( parameters.CheckParameter< double >( "pixel_y_relation" ) ) {
-    parameters.GetParameter( "pixel_y_relation", pixel_y_relation );
-    
-    TEAGN_TRUE_OR_RETURN( ( pixel_y_relation != 0.0 ),
-      "Invalid parameter : pixel_y_relation" )
-  }   
-  
-  /* Checking max_tie_points */
-  
-  unsigned int max_tie_points = 0;
-  if( parameters.CheckParameter< unsigned int >( "max_tie_points" ) ) {
-    parameters.GetParameter( "max_tie_points", max_tie_points );
-    
-    TEAGN_TRUE_OR_RETURN( ( max_tie_points > 0 ),
-      "Invalid parameter : max_tie_points" )    
-  }
-  
-  /* Checking corr_sens */
-  
-  double corr_sens = 0;
-  if( parameters.CheckParameter< double >( "corr_sens" ) ) {
-    parameters.GetParameter( "corr_sens", corr_sens );
-    
-    TEAGN_TRUE_OR_RETURN( ( corr_sens > 0.0 ) &&
-      ( corr_sens <= 3.0 ),
-      "Invalid parameter : corr_sens" )
-  }  
-  
-  /* Checking corr_window_width */
-  
-  unsigned int corr_window_width = 0;
-  if( parameters.CheckParameter< unsigned int >( 
-    "corr_window_width" ) ) {
-    
-    parameters.GetParameter( "corr_window_width", 
-      corr_window_width );
-      
-    TEAGN_TRUE_OR_RETURN( ( ( corr_window_width % 2 ) > 0 ),
-      "Invalid parameter : corr_window_width" )      
-    
-    TEAGN_TRUE_OR_RETURN( ( corr_window_width >= 3 ),
-      "Invalid parameter : corr_window_width" )
-  }    
-  
-  /* Checking maximas_sens */
-  
-  double maximas_sens = 0;
-  if( parameters.CheckParameter< double >( "maximas_sens" ) ) {
-    parameters.GetParameter( "maximas_sens", maximas_sens );
-    
-    TEAGN_TRUE_OR_RETURN( ( maximas_sens >= 0.0 ) &&
-      ( maximas_sens <= 1.0 ),
-      "Invalid parameter : maximas_sens" )
-  }   
-  
-  /* Checking out_gt_params */
-  
-  TeGTParams::pointer out_gt_params_ptr;
-  if( parameters.CheckParameter< TeGTParams::pointer >( 
-    "out_gt_params_ptr" ) ) 
-  {
-    parameters.GetParameter( "out_gt_params_ptr", out_gt_params_ptr );
-    
-    TEAGN_TRUE_OR_RETURN( ( out_gt_params_ptr.isActive() ),
-      "Invalid parameter : out_gt_params_ptr" )
-  }    
-  
-  return true;
-}
-
-
-void TePDIOFMatching::ResetState( const TePDIParameters& )
-{
-}
-
-
-bool TePDIOFMatching::loadImage( const TeThreadParameters& params )
-{
-  /* Retriving parameters */
-  
-  TePDITypes::TePDIRasterPtrType input_image_ptr;
-  TEAGN_TRUE_OR_THROW( params.retrive( "input_image_ptr", input_image_ptr ),
-    "Missing thread parameter" )
-    
-  ImgMatrixT* img_matrix_ptr;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_matrix_ptr", img_matrix_ptr ),
-    "Missing thread parameter" )
-    
-  double img_x_rescale_factor = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_x_rescale_factor", 
-    img_x_rescale_factor ), "Missing thread parameter" )
-    
-  double img_y_rescale_factor = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_y_rescale_factor", 
-    img_y_rescale_factor ), "Missing thread parameter" )    
-    
-  unsigned int input_channel = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "input_channel", 
-    input_channel ), "Missing thread parameter" )  
-    
-  unsigned int box_x_off = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_x_off", 
-    box_x_off ), "Missing thread parameter" )  
-
-  unsigned int box_y_off = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_y_off", 
-    box_y_off ), "Missing thread parameter" )      
-    
-  unsigned int box_nlines = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_nlines", 
-    box_nlines ), "Missing thread parameter" )      
-    
-  unsigned int box_ncols = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "box_ncols", 
-    box_ncols ), "Missing thread parameter" )   
-    
-  bool progress_enabled = false;   
-  TEAGN_TRUE_OR_THROW( params.retrive( "progress_enabled", 
-    progress_enabled ), "Missing thread parameter" ) 
-    
-  TeMutex* glb_mem_lock_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "glb_mem_lock_ptr", 
-    glb_mem_lock_ptr ), "Missing thread parameter" )   
-  TeMutex& glb_mem_lock = *glb_mem_lock_ptr;
-         
-  /* Rescaling image */
-  
-  unsigned int nlines = (unsigned int) ceil( 
-    ( (double)box_nlines ) * img_y_rescale_factor );
-  unsigned int ncols = (unsigned int) ceil( 
-    ( (double)box_ncols ) * img_x_rescale_factor );    
-  
-  glb_mem_lock.lock();
-  
-  if( ! img_matrix_ptr->Reset( nlines, ncols, 
-    TePDIMatrix< double >::AutoMemPol ) )
-  {
-    TEAGN_LOGERR( "Unable to allocate space for the loaded image" )
-    glb_mem_lock.unLock();
-    return false;
-  }
-    
-  glb_mem_lock.unLock();
-    
-  unsigned int curr_out_line = 0;
-  unsigned int curr_out_col = 0;
-  unsigned int curr_input_line = 0;
-  unsigned int curr_input_col = 0;
-  double value = 0;
-  
-  TePDIPIManager progress( "Rescaling image", nlines, progress_enabled );
-  
-  for( curr_out_line = 0 ; curr_out_line < nlines ; 
-    ++curr_out_line ) {
-    
-    curr_input_line = 
-      TeRound( 
-        ( 
-          ( (double)curr_out_line ) / img_y_rescale_factor
-        ) 
-        +
-        ( (double) box_y_off )
-      );
-    
-    for( curr_out_col = 0 ; curr_out_col < ncols ; 
-      ++curr_out_col ) {
-      
-      curr_input_col = 
-        TeRound( 
-          ( 
-            ( (double)curr_out_col ) / img_x_rescale_factor
-          ) 
-          +
-          ( (double) box_x_off )
-        );        
-      
-      if( input_image_ptr->getElement( curr_input_col, curr_input_line, value, 
-        input_channel ) ) {
-        
-        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = value;
-      } else {
-        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = 0;
-      }
-    }
-    
-    TEAGN_FALSE_OR_RETURN( progress.Increment(),
-      "Canceled by the user" );
-  }
-        
-  return true;
-}
-
-
-bool TePDIOFMatching::generateFeatures( 
-  const TeThreadParameters& params )
-{
-  /* Retriving parameters */
-  
-  ImgMatrixT* img_matrix_ptr;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_matrix_ptr", img_matrix_ptr ),
-    "Missing thread parameter" )
-    
-  unsigned int corr_window_width = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "corr_window_width", corr_window_width ),
-    "Missing thread parameter" )
-  TEAGN_DEBUG_CONDITION( ( corr_window_width >= 3 ),
-    "Invalid correlation window width" )    
-  TEAGN_DEBUG_CONDITION( ( ( corr_window_width % 2 ) != 0 ),
-    "Invalid correlation window width" )
-    
-  std::vector< TeCoord2D >* img_maxima_points_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_maxima_points_ptr", 
-    img_maxima_points_ptr ), "Missing thread parameter" )
-    
-  ImgMatrixT* img_features_matrix_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img_features_matrix_ptr", 
-    img_features_matrix_ptr ), "Missing thread parameter" )
-    
-  bool progress_enabled = false;   
-  TEAGN_TRUE_OR_THROW( params.retrive( "progress_enabled", 
-    progress_enabled ), "Missing thread parameter" )     
-    
-  unsigned int max_points = 0;   
-  TEAGN_TRUE_OR_THROW( params.retrive( "max_points", 
-    max_points ), "Missing thread parameter" )  
-    
-  TeMutex* glb_mem_lock_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "glb_mem_lock_ptr", 
-    glb_mem_lock_ptr ), "Missing thread parameter" )   
-  TeMutex& glb_mem_lock = *glb_mem_lock_ptr;   
-  
-  double maximas_sens = 0;   
-  TEAGN_TRUE_OR_THROW( params.retrive( "maximas_sens", 
-    maximas_sens ), "Missing thread parameter" )         
-    
-  /* Filtering image */
-  
-  ImgMatrixT filtered_img_matrix;
-  TEAGN_TRUE_OR_RETURN( gaussianSmoothing( *img_matrix_ptr, 
-    filtered_img_matrix, 1, progress_enabled, glb_mem_lock ),
-    "Error filtering image" )
-    
-  /* Get the least squares surface */
-  
-  ImgMatrixT ls_surface_matrix;
-  TEAGN_TRUE_OR_RETURN( generateLSSurface( 
-    filtered_img_matrix, 
-    ls_surface_matrix, progress_enabled, glb_mem_lock ),
-    "Error getting the least squares surface" )   
-    
-/* remove */    
-//matrix2Tiff( ls_surface_matrix, "ls_surface_matrix.tif",
-//  std::vector< TeCoord2D >() );     
-/* remove */    
-    
-  /* Free unused resources */
-  
-  filtered_img_matrix.Reset();
-
-  /* Get the maxima points */
-  
-  TEAGN_TRUE_OR_RETURN( getMaximaPoints( ls_surface_matrix,
-    *img_maxima_points_ptr, max_points, corr_window_width, 
-    progress_enabled, maximas_sens ),
-    "Error generating maxima points" );
-  TEAGN_DEBUG_CONDITION( ( img_maxima_points_ptr->size() <=
-    max_points ), "Invalid number of generated maxima points" )
-
-/* remove */    
-//matrix2Tiff( *img_matrix_ptr, "croped_img_plus_maximas.tif",
-//  *img_maxima_points_ptr );     
-/* remove */
-    
-  /* Generating the rotated correlation windows matrix */
-  
-  if( img_maxima_points_ptr->size() > 0 ) {
-//    TEAGN_TRUE_OR_RETURN( img_features_matrix_ptr->Reset( 
-//      corr_window_width * corr_window_width, 
-//      img_maxima_points_ptr->size(), ImgMatrixT::RAMMemPol ),
-//      "Error allocating image features matrix" )  
-      
-    TEAGN_TRUE_OR_RETURN( generateCorrWindows( *img_matrix_ptr,
-      corr_window_width, *img_maxima_points_ptr, 
-      *img_features_matrix_ptr, progress_enabled, glb_mem_lock ),
-      "Error generating the correlation windows" )
-  } else {
-    img_features_matrix_ptr->Reset();
-  }
-    
-  return true;
-}
-
-
-bool TePDIOFMatching::gaussianSmoothing( 
-  const ImgMatrixT& input_matrix,
-  ImgMatrixT& output_matrix, 
-  unsigned int iterations,
-  bool progress_enabled,
-  TeMutex& glb_mem_lock )
-{        
-  TEAGN_TRUE_OR_THROW( ( iterations > 0 ), "Invalid iterations" )
-  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetColumns() > 2 ),
-    "Invalid columns number" )
-  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetLines() > 2 ),
-    "Invalid lines number" )   
-    
-  unsigned int nlines = input_matrix.GetLines();
-  unsigned int ncols = input_matrix.GetColumns();
-  unsigned int last_line_index = nlines - 1;
-  unsigned int last_col_index = ncols - 1;  
-  unsigned int curr_line = 0;
-  unsigned int curr_col = 0;   
-    
-  glb_mem_lock.lock();  
-    
-  if( !output_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
-  {
-    TEAGN_LOGERR( "Error reseting matrix" )
-    glb_mem_lock.unLock();
-    return false;
-  }
-    
-  glb_mem_lock.unLock();
-  
-  /* Fill borders with zero */
-  
-  for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
-    output_matrix( curr_line, 0 ) = 0.0;
-    output_matrix( curr_line, last_col_index ) = 0.0;
-  }
-  
-  for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
-    output_matrix( 0, curr_col ) = 0.0;
-    output_matrix( last_line_index, curr_col ) = 0.0;
-  }  
-  
-  /* Smoothing */
-  
-  TePDIPIManager progress( "Filtering image", nlines - 2, progress_enabled );
-  
-  for( curr_line = 1 ; curr_line < last_line_index ; ++curr_line ) {
-    for( curr_col = 1 ; curr_col < last_col_index ; ++curr_col ) {
-      output_matrix( curr_line, curr_col ) = 
-        ( 
-          input_matrix( curr_line - 1, curr_col ) +
-          ( 4.0 * input_matrix( curr_line, curr_col ) ) +
-          input_matrix( curr_line + 1, curr_col ) +
-          input_matrix( curr_line, curr_col - 1 ) +
-          input_matrix( curr_line, curr_col + 1 )        
-        ) / 8.0;
-    }
-    
-    TEAGN_FALSE_OR_RETURN( progress.Increment(),
-      "Canceled by the user" );
-  }
-  
-  return true;
-}
-
-
-bool TePDIOFMatching::generateLSSurface( 
-  const ImgMatrixT& input_matrix,
-  ImgMatrixT& ls_surface_matrix, 
-  bool progress_enabled,
-  TeMutex& glb_mem_lock )
-{        
-  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetColumns() > 2 ),
-    "Invalid columns number" )
-  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetLines() > 2 ),
-    "Invalid lines number" )   
-    
-  const unsigned int nlines = input_matrix.GetLines();
-  const unsigned int ncols = input_matrix.GetColumns();
-  
-  TePDIPIManager progress( "Creating LS surface",
-    ( nlines - 2 ) + ( 9 * ( nlines - 2 ) ) + nlines, 
-    progress_enabled );
-
-  /* Creating gx and gy */
-  
-  glb_mem_lock.lock();
-  
-  ImgMatrixT gx_matrix;
-  if( ! gx_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
-  {
-    TEAGN_LOGERR( "Error reseting matrix" )
-    glb_mem_lock.unLock();
-    return false;
-  }
-  
-  ImgMatrixT gy_matrix;
-  if( ! gy_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
-  {
-    TEAGN_LOGERR( "Error reseting matrix" )
-    glb_mem_lock.unLock();
-    return false;
-  }
-    
-  glb_mem_lock.unLock();
-  
-  {
-    unsigned int curr_line = 0;
-    unsigned int curr_col = 0; 
-    const unsigned int last_line_index = nlines - 1;
-    const unsigned int last_col_index = ncols - 1;      
-    
-    /* Border fill */
-    
-    for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
-      gx_matrix( curr_line, 0 ) = 0.0;
-      gx_matrix( curr_line, last_col_index ) = 0.0;
-      
-      gy_matrix( curr_line, 0 ) = 0.0;
-      gy_matrix( curr_line, last_col_index ) = 0.0;      
-    }
-    for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
-      gx_matrix( 0, curr_col ) = 0.0;
-      gx_matrix( last_line_index, curr_col ) = 0.0;
-      
-      gy_matrix( 0, curr_col ) = 0.0;
-      gy_matrix( last_line_index, curr_col ) = 0.0;
-    }  
-    
-    /* Calculating values */
-    
-    for( curr_line = 1 ; curr_line < last_line_index ; ++curr_line ) { 
-      for( curr_col = 1 ; curr_col < last_col_index ; ++curr_col ) { 
-        gx_matrix( curr_line, curr_col ) =
-          ( input_matrix( curr_line + 1, curr_col ) -
-            input_matrix( curr_line - 1, curr_col ) 
-          ) / 2.0;
-          
-        gy_matrix( curr_line, curr_col ) =
-          ( input_matrix( curr_line, curr_col + 1 ) -
-            input_matrix( curr_line, curr_col - 1 ) 
-          ) / 2.0;          
-      }
-      
-      TEAGN_FALSE_OR_RETURN( progress.Increment(),
-        "Canceled by the user" );
-    }
-  }  
-  
-  /* Creating gxx and gxy and gyy */
-  
-  glb_mem_lock.lock();
-  
-  ImgMatrixT gxx_matrix;
-  if( ! gxx_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
-  {
-    TEAGN_LOGERR( "Error reseting matrix" )
-    glb_mem_lock.unLock();
-    return false;
-  }
-  
-  ImgMatrixT gxy_matrix;
-  if( ! gxy_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
-  {
-    TEAGN_LOGERR( "Error reseting matrix" )
-    glb_mem_lock.unLock();
-    return false;
-  }
-  
-  ImgMatrixT gyy_matrix;
-  if( ! gyy_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
-  {
-    TEAGN_LOGERR( "Error reseting matrix" ) 
-    glb_mem_lock.unLock();
-    return false;
-  }
-    
-  glb_mem_lock.unLock();
-     
-  {
-    /* zero fill */
-    
-    {
-      unsigned int curr_line = 0;
-      unsigned int curr_col = 0; 
-      
-      for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
-        for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
-          gxx_matrix( curr_line, curr_col ) = 0.0;
-          gxy_matrix( curr_line, curr_col ) = 0.0;
-          gyy_matrix( curr_line, curr_col ) = 0.0;
-        }
-      }
-    }
-    
-    /* Allocating p matrix */
-    
-    glb_mem_lock.lock();
-    
-    ImgMatrixT p_matrix;
-    if( ! p_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
-    {
-      TEAGN_LOGERR( "Error reseting matrix" ) 
-      glb_mem_lock.unLock();
-      return false;
-    }
-      
-    glb_mem_lock.unLock();       
-    
-    /* iterating over the optical flow displacement */
-    
-    int curr_line_offset = 0;
-    int curr_col_offset = 0;
-    unsigned int curr_line = 0;
-    unsigned int curr_col = 0;
-    unsigned int curr_line_bound = 0;
-    unsigned int curr_col_bound = 0;    
-    
-    for( curr_line_offset = -1 ; curr_line_offset < 2 ; 
-      ++curr_line_offset ) { 
-      
-      for( curr_col_offset = -1 ; curr_col_offset < 2 ; 
-        ++curr_col_offset ) { 
-        
-        /* fill p matrix with ones */
-      
-        for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
-          for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
-            p_matrix( curr_line, curr_col ) = 1.0;
-          }
-        }
-        
-        /* updating p matrix */
-        
-        curr_line_bound = nlines - 1;
-        curr_col_bound = ncols - 1;
-      
-        for( curr_line = 1 ; curr_line < curr_line_bound ; ++curr_line ) {
-          for( curr_col = 1 ; curr_col < curr_col_bound ; ++curr_col ) {
-            p_matrix( curr_line, curr_col ) = 
-              ( gx_matrix( curr_line, curr_col ) * gx_matrix( curr_line + 
-                curr_line_offset, curr_col + curr_col_offset ) ) +
-              ( gy_matrix( curr_line, curr_col ) * gy_matrix( curr_line +
-                curr_line_offset, curr_col + curr_col_offset ) );
-              
-          }
-        }
-        
-        for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
-          for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
-            if( p_matrix( curr_line, curr_col ) < 0.0 ) {
-              p_matrix( curr_line, curr_col ) = 0.0;
-            }
-          }
-        }   
-        
-        /* Generating gxx, gxy and gyy */
-        
-        curr_line_bound = nlines - 1;
-        curr_col_bound = ncols - 1;
-      
-        for( curr_line = 1 ; curr_line < curr_line_bound ; ++curr_line ) {
-          for( curr_col = 1 ; curr_col < curr_col_bound ; ++curr_col ) {
-            gxx_matrix( curr_line, curr_col ) = 
-              gxx_matrix( curr_line, curr_col ) +
-              ( p_matrix( curr_line, curr_col ) * gx_matrix( curr_line + 
-              curr_line_offset, curr_col + curr_col_offset ) *
-              gx_matrix( curr_line + curr_line_offset, curr_col + 
-              curr_col_offset ) ) ;
-              
-            gxy_matrix( curr_line, curr_col ) = 
-              gxy_matrix( curr_line, curr_col ) +
-              ( p_matrix( curr_line, curr_col ) * gx_matrix( curr_line + 
-              curr_line_offset, curr_col + curr_col_offset ) *
-              gy_matrix( curr_line + curr_line_offset, curr_col + 
-              curr_col_offset ) ) ;              
-              
-            gyy_matrix( curr_line, curr_col ) = 
-              gyy_matrix( curr_line, curr_col ) +
-              ( p_matrix( curr_line, curr_col ) * gy_matrix( curr_line + 
-              curr_line_offset, curr_col + curr_col_offset ) *
-              gy_matrix( curr_line + curr_line_offset, curr_col + 
-              curr_col_offset ) ) ;              
-          }
-          
-          TEAGN_FALSE_OR_RETURN( progress.Increment(),
-            "Canceled by the user" );
-        }        
-      }
-    }
-  }    
-  
-  /* Creating the ls surface matrix */
-  {
-    glb_mem_lock.lock();
-    
-    if( ! ls_surface_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
-    {
-      TEAGN_LOGERR( "Error reseting matrix" )
-      glb_mem_lock.unLock();
-      return false;
-    }
-      
-    glb_mem_lock.unLock();
-      
-    unsigned int curr_line = 0;
-    unsigned int curr_col = 0;          
-    double div_value = 0;
-  
-    for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
-      for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
-        div_value = sqrt( ( gxx_matrix( curr_line, curr_col ) *
-          gxx_matrix( curr_line, curr_col ) ) + ( gyy_matrix( curr_line,
-          curr_col ) * gyy_matrix( curr_line, curr_col ) ) +
-          ( 2.0 * gxy_matrix( curr_line, curr_col ) * 
-          gxy_matrix( curr_line, curr_col ) ) )
-          *
-          sqrt( gxx_matrix( curr_line, curr_col ) +
-            gyy_matrix( curr_line, curr_col ) );
-        
-        if( div_value == 0.0 ) {
-          ls_surface_matrix( curr_line, curr_col ) = 
-            ( -1.0 ) * DBL_MAX;
-        } else {
-          ls_surface_matrix( curr_line, curr_col ) =
-            ABS( ( gxx_matrix( curr_line, curr_col ) * gyy_matrix( 
-            curr_line, curr_col ) ) - ( gxy_matrix( curr_line,
-            curr_col ) * gxy_matrix( curr_line, curr_col ) ) ) / 
-            div_value;
-        }
-      }
-      
-      TEAGN_FALSE_OR_RETURN( progress.Increment(),
-        "Canceled by the user" );
-    }  
-  }
-  
-  return true;
-}
-
-
-void TePDIOFMatching::matrix2Tiff( 
-  const ImgMatrixT& input_matrix,
-  const std::string& out_file_name,
-  const std::vector< TeCoord2D >& maxima_points )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_matrix.GetLines() > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_matrix.GetColumns() > 0 ), 
-    "Invalid matrix cols" )
-    
-  /* Finding min and max */
-  const double dbl_max = DBL_MAX;
-  const double dbl_min = (-1.0) * dbl_max;
-  double mtx_min = dbl_max;
-  double mtx_max = dbl_min;
-  double mtx_diff = 1.0;
-  
-  {
-    for( unsigned int line = 0 ; 
-      line < input_matrix.GetLines() ; ++line ) 
-    {
-      for( unsigned int col = 0 ; 
-        col < input_matrix.GetColumns() ; 
-        ++col ) 
-      {
-        if( ( input_matrix( line, col ) > dbl_min ) &&
-          ( input_matrix( line, col ) < dbl_max ) )
-        {
-          if( input_matrix( line, col ) < mtx_min )
-          {
-            mtx_min = input_matrix( line, col );
-          } 
-          
-          if( input_matrix( line, col ) > mtx_max )
-          {
-            mtx_max = input_matrix( line, col );
-          }
-        }
-      }  
-    }
-    
-    if( mtx_max != mtx_min )
-    {
-      mtx_diff = mtx_max - mtx_min;
-    } 
-  }
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_matrix.GetLines(),
-    input_matrix.GetColumns() );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  
-  for( unsigned int line = 0 ; 
-    line < input_matrix.GetLines() ; ++line ) {
-    for( unsigned int col = 0 ; 
-      col < input_matrix.GetColumns() ; 
-      ++col ) {
-
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        ( ( input_matrix( line, col ) - mtx_min ) / mtx_diff ) * 255.0, 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw maxima points */
-  
-  std::vector< TeCoord2D >::const_iterator maximas_it = 
-    maxima_points.begin();
-  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
-    maxima_points.end();
-    
-  while( maximas_it != maximas_it_end ) {
-    int x = TeRound( maximas_it->x() );
-    TEAGN_TRUE_OR_THROW( ( x < (int)input_matrix.GetColumns() ),
-      "Invalid maxima column" )
-    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-      "Invalid maxima column" )      
-    
-    int y = TeRound( maximas_it->y() );
-    TEAGN_TRUE_OR_THROW( ( y < (int)input_matrix.GetLines() ),
-      "Invalid maxima line" )
-    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-      "Invalid maxima line" )      
-    
-    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-      255.0, 0 ),
-      "Error writing raster" )
-      
-    ++maximas_it;
-  }  
-}
-
-
-void TePDIOFMatching::raster2Tiff( 
-  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-  unsigned int raster_channel,
-  const std::string& out_file_name,
-  const std::vector< TeCoord2D >& maxima_points,
-  const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
-  unsigned int tie_points_space )
-{   
-  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
-    "Invalid file name" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
-    "Invalid matrix cols" )
-    
-  TeRasterParams params;
-  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
-    input_raster_ptr->params().ncols_ );
-  params.nBands( 1 );
-  params.setDataType( TeUNSIGNEDCHAR, -1 );
-  params.nBands( 1 );
-  params.decoderIdentifier_ = "TIF";
-  params.mode_ = 'c';
-  params.fileName_ = out_file_name;
-  
-  TeRaster out_raster( params );
-  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-  double value = 0;
-  
-  for( int line = 0 ; 
-    line < input_raster_ptr->params().nlines_ ; ++line ) {
-    for( int col = 0 ; 
-      col < input_raster_ptr->params().ncols_ ; 
-      ++col ) {
-      
-      input_raster_ptr->getElement( col, line, value, 
-        raster_channel );
-      
-
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-        value, 0 ),
-        "Error writing raster" )
-    }  
-  }
-  
-  /* Draw maxima points */
-  
-  std::vector< TeCoord2D >::const_iterator maximas_it = 
-    maxima_points.begin();
-  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
-    maxima_points.end();
-    
-  while( maximas_it != maximas_it_end ) {
-    int x = TeRound( maximas_it->x() );
-    TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
-      "Invalid maxima column" )
-    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-      "Invalid maxima column" )      
-    
-    int y = TeRound( maximas_it->y() );
-    TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
-      "Invalid maxima line" )
-    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-      "Invalid maxima line" )      
-    
-    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-      255.0, 0 ),
-      "Error writing raster" )
-      
-    ++maximas_it;
-  }
-  
-  /* Draw tie-points */
-  
-  if( out_tie_points_ptr.isActive() ) {
-    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
-    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
-    
-    while( it != it_end ) {
-      int x = 0;
-      int y = 0;
-      
-      if( tie_points_space == 0 ) {
-         x = TeRound( it->pt1.x() );
-         y = TeRound( it->pt1.y() );
-      } else {
-         x = TeRound( it->pt2.x() );
-         y = TeRound( it->pt2.y() );
-      }
-      
-      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
-        "Invalid maxima column" )
-      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
-        "Invalid maxima column" )      
-      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
-        "Invalid maxima line" )
-      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
-        "Invalid maxima line" )      
-      
-      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
-        255.0, 0 ),
-        "Error writing raster" )    
-    
-      ++it;
-    }
-  
-  }
-}
-
-
-bool TePDIOFMatching::getMaximaPoints( 
-  const ImgMatrixT& input_matrix,
-  std::vector< TeCoord2D >& maxima_points,
-  unsigned int max_points, unsigned int corr_window_width,
-  bool progress_enabled, double maximas_sens )
-{
-  maxima_points.clear();
-  
-  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetLines() > 0 ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetColumns() > 0 ), 
-    "Invalid matrix cols" )
-  TEAGN_DEBUG_CONDITION( ( max_points > 0 ), 
-    "Invalid number of maximum maxima points" )
-  TEAGN_DEBUG_CONDITION( ( corr_window_width >= 3 ), 
-    "Invalid correlation window width" )
-  TEAGN_DEBUG_CONDITION( 
-    ( maximas_sens >= 0.0 ) && ( maximas_sens <= 10.0 ), 
-    "Invalid maximas_sens" )    
-    
-  /* The radius of a windows rotated by 90 degrees. */
-  const unsigned int rotated_window_radius = (unsigned int)
-    (
-      ceil( 
-        sqrt( 
-          2 * 
-          ( ( (double)corr_window_width ) * 
-            ( (double)corr_window_width ) 
-          )
-        ) / 2.0
-      )
-    );
-  const unsigned int rotated_window_diam = 1 + ( 2 *
-    rotated_window_radius );
-    
-  /* Checking if the current rotated correlation window width 
-     fits inside the current image */
-     
-  const unsigned int total_lines = input_matrix.GetLines();
-  const unsigned int total_cols = input_matrix.GetColumns();
-
-  if( total_lines <= rotated_window_diam ) {
-    return true;
-  }
-  if( total_cols <= rotated_window_diam ) {
-    return true;
-  }    
-  
-  const unsigned int max_blks_per_line = total_cols - 
-    rotated_window_diam;
-  const unsigned int max_blks_per_col = total_lines - 
-    rotated_window_diam;   
-  
-  /* Calc block dimentions */
-  
-  unsigned int blocks_per_line_col = 
-    MIN( (unsigned int)floor( sqrt( (double)max_points ) ), 
-      MIN( max_blks_per_line, max_blks_per_col ) );
-  
-  if( blocks_per_line_col == 0 )
-  {
-    return true;
-  }
-  
-  unsigned int block_width = (unsigned int)
-    ceil(
-      ((double)( total_cols - rotated_window_diam ) ) 
-      / 
-      ((double) blocks_per_line_col )
-    );
-  unsigned int block_height = (unsigned int)
-    ceil(
-      ((double)( total_lines - rotated_window_diam ) ) 
-      / 
-      ((double) blocks_per_line_col )
-    );
-    
-  TEAGN_DEBUG_CONDITION( ( block_width > 0 ), 
-    "Invalid block width" )
-  TEAGN_DEBUG_CONDITION( ( block_height > 0 ), 
-    "Invalid block height" )
-  
-  /* Looking maximas */
-  
-  const double dbl_max = DBL_MAX;
-  const double dbl_min = dbl_max * (-1.0);  
-  
-  std::vector< TeCoord2D > internal_maxima_points;
-  internal_maxima_points.reserve( blocks_per_line_col * 
-    blocks_per_line_col );
-  
-  std::vector< double > maxima_points_blkmean_diffs;
-  maxima_points_blkmean_diffs.reserve( blocks_per_line_col * 
-    blocks_per_line_col );
-  double maxima_points_blkmean_diffs_max = dbl_min;
-  double maxima_points_blkmean_diffs_min = dbl_max;
-    
-  unsigned int curr_block_start_line = 0;
-  unsigned int curr_block_start_col = 0;
-  unsigned int curr_block_line_bound = 0;
-  unsigned int curr_block_col_bound = 0;
-  unsigned int curr_line = 0;
-  unsigned int curr_col = 0;
-  
-  unsigned int block_maxima_col = 0;
-  unsigned int block_maxima_line = 0;  
-  double block_maxima_val = 0.0;
-  
-  unsigned int curr_horiz_block = 0;
-  unsigned int curr_vert_block = 0;
-  const unsigned int cols_bound = total_cols - 
-   rotated_window_radius;
-  const unsigned int lines_bound = total_lines - 
-   rotated_window_radius;
-   
-  double blk_mean = 0.0;
-  double blk_mean_diff = 0.0;   
-  
-  TePDIPIManager progress( "Finding maxima points",
-    blocks_per_line_col, progress_enabled );  
-    
-  for( curr_vert_block = 0 ; curr_vert_block < blocks_per_line_col ;
-    ++curr_vert_block ) {
-    
-    curr_block_start_line = rotated_window_radius +
-      ( curr_vert_block * block_height );
-    curr_block_line_bound = MIN( curr_block_start_line + block_height,
-      lines_bound );
-    
-    for( curr_horiz_block = 0 ; curr_horiz_block < blocks_per_line_col ;
-      ++curr_horiz_block ) {
-      
-      curr_block_start_col = rotated_window_radius +
-        ( curr_horiz_block * block_width );
-      curr_block_col_bound = MIN( curr_block_start_col + block_width,
-        cols_bound );  
-      
-      block_maxima_val = dbl_min;
-      blk_mean = 0.0;
-      blk_mean_diff = 0.0;
-      
-      for( curr_line = curr_block_start_line ;
-        curr_line < curr_block_line_bound ; ++curr_line ) {
-        for( curr_col = curr_block_start_col ;
-          curr_col < curr_block_col_bound ; ++curr_col ) {
-          
-          const double& curr_value = input_matrix( curr_line, 
-            curr_col );
-            
-          if( ( curr_value > dbl_min ) && ( curr_value < dbl_max ) )
-          {
-            blk_mean += curr_value;
-            
-            if( curr_value >= block_maxima_val ) {
-             
-              block_maxima_val = curr_value;
-              block_maxima_col = curr_col;
-              block_maxima_line = curr_line;
-            }            
-          }
-        }
-      }
-      
-      if( block_maxima_val != dbl_min )
-      {
-        blk_mean /= (double)( 
-          ( curr_block_line_bound - curr_block_start_line ) *
-          ( curr_block_col_bound - curr_block_start_col ) );
-        
-        blk_mean_diff = block_maxima_val - blk_mean;
-          
-        maxima_points_blkmean_diffs.push_back( blk_mean_diff );
-          
-        if( maxima_points_blkmean_diffs_max < blk_mean_diff )
-        {
-          maxima_points_blkmean_diffs_max = blk_mean_diff;
-        }
-        
-        if( maxima_points_blkmean_diffs_min > blk_mean_diff )
-        {
-          maxima_points_blkmean_diffs_min = blk_mean_diff;
-        }        
-        
-        internal_maxima_points.push_back( TeCoord2D( block_maxima_col, 
-          block_maxima_line ) );
-      }
-    }
-    
-    TEAGN_FALSE_OR_RETURN( progress.Increment(),
-      "Canceled by the user" );
-  }
-  
-  /* Post-selecting maxima points by the difference to blocks mean */
-  
-  double mean_diff_lim = ( ( maxima_points_blkmean_diffs_max -
-    maxima_points_blkmean_diffs_min ) * maximas_sens ) +
-    maxima_points_blkmean_diffs_min;
-    
-  maxima_points.reserve( blocks_per_line_col * 
-    blocks_per_line_col );
-        
-  for( unsigned int imp_idx = 0 ; imp_idx < internal_maxima_points.size() ;
-    ++imp_idx )
-  {
-    if( maxima_points_blkmean_diffs[ imp_idx ] >= mean_diff_lim )
-    {
-      maxima_points.push_back( internal_maxima_points[ imp_idx ] );
-    }
-  }
-  
-  return true;
-}
-
-
-bool TePDIOFMatching::generateCorrWindows( 
-  const ImgMatrixT& img_matrix,
-  unsigned int corr_window_width,
-  const std::vector< TeCoord2D >& img_maxima_points,
-  ImgMatrixT& img_features_matrix,
-  bool progress_enabled,
-  TeMutex& glb_mem_lock )
-{
-  TEAGN_TRUE_OR_THROW( img_matrix.GetColumns() *
-    img_matrix.GetLines() > 0,
-    "Invalid ls matrix" )
-  TEAGN_TRUE_OR_THROW( ( ( corr_window_width % 2 ) > 0 ),
-    "Invalid corr_window_width" )    
-  TEAGN_TRUE_OR_THROW( ( corr_window_width >= 3 ),
-    "Invalid corr_window_width" )      
-    
-  if( img_maxima_points.size() == 0 ) {
-    img_features_matrix.Reset();
-  } else {
-  /* Generating the image features */
-
-    /* each line is a stacked version of one rotated correlation 
-       window */
-       
-    glb_mem_lock.lock();
-    
-    if( ! img_features_matrix.Reset( img_maxima_points.size(),
-      corr_window_width * corr_window_width,
-      ImgMatrixT::RAMMemPol ) )
-    {
-      TEAGN_LOGERR( "Error allocating image features matrix" )
-      glb_mem_lock.unLock();
-      return false;
-    }
-      
-    glb_mem_lock.unLock();
-      
-    /* variables related to the current window over the hole image */
-    unsigned int curr_window_x_start = 0;
-    unsigned int curr_window_y_start = 0;
-    unsigned int curr_window_x_center = 0;
-    unsigned int curr_window_y_center = 0;
-    unsigned int curr_window_x_bound = 0;
-    unsigned int curr_window_y_bound = 0;
-    
-    /*used on the rotation calcule */
-    const unsigned int wind_radius = corr_window_width / 2;
-    const double wind_radius_double = (double)wind_radius;
-    const unsigned int img_features_matrix_cols = 
-      img_features_matrix.GetColumns();
-    unsigned int curr_x = 0;
-    unsigned int curr_y = 0;
-    double curr_x_minus_radius = 0;
-    double curr_y_minus_radius = 0;
-    unsigned int curr_offset = 0;
-    double int_x_dir = 0;
-    double int_y_dir = 0;
-    double int_norm = 0;
-    double rotated_curr_x = 0;/* rotaded coord - window ref */
-    double rotated_curr_y = 0;/* rotaded coord - window ref */
-    
-     /* the found rotation parameters */
-    double rot_cos = 0;
-    double rot_sin = 0;
-    
-    /* the coords rotated but in the hole image reference */
-    int rotated_curr_x_img = 0;
-    int rotated_curr_y_img = 0;
-    
-    /* current window mean and standart deviation */
-    double curr_wind_mean = 0.0;
-    double curr_wind_stddev = 0.0;
-    double curr_wind_stddev_aux = 0.0;
-    
-    TePDIPIManager progress( "Generating correlation windows",
-      img_maxima_points.size(), progress_enabled );     
-      
-    for( unsigned int img_maximas_index = 0 ; 
-      img_maximas_index < img_maxima_points.size() ; 
-      ++img_maximas_index ) {
-      
-      /* Calculating the current window position */
-     
-      curr_window_x_center = 
-        (unsigned int)img_maxima_points[ img_maximas_index ].x();
-      curr_window_y_center = 
-        (unsigned int)img_maxima_points[ img_maximas_index ].y();
-      curr_window_x_start = curr_window_x_center - wind_radius;
-      curr_window_y_start = curr_window_y_center - wind_radius;
-      curr_window_x_bound = curr_window_x_start + 
-        corr_window_width;
-      curr_window_y_bound = curr_window_y_start + 
-        corr_window_width;
-        
-      /* Estimating the intensity vector X direction */
-      
-      for( curr_offset = 0 ; curr_offset < wind_radius ;
-        ++curr_offset ) {      
-
-        for( curr_y = curr_window_y_start ; 
-          curr_y < curr_window_y_bound ;
-          ++curr_y ) {
-        
-          int_x_dir += 
-            img_matrix( curr_y, curr_window_x_bound - 1 - 
-              curr_offset ) - 
-            img_matrix( curr_y, 
-              curr_window_x_start + curr_offset );
-        }
-      }
-      
-      int_x_dir /= ( 2.0 * ( (double) wind_radius ) );
-      
-      /* Estimating the intensity vector y direction */
-      
-      for( curr_offset = 0 ; curr_offset < wind_radius ;
-        ++curr_offset ) {      
-
-        for( curr_x = curr_window_x_start ; 
-          curr_x < curr_window_x_bound ;
-          ++curr_x ) {
-        
-          int_y_dir += 
-            img_matrix( curr_window_y_start + curr_offset,
-              curr_x ) - 
-            img_matrix( curr_window_y_bound - 1 -
-              curr_offset, curr_x );
-        }
-      }      
-      
-      int_y_dir /= ( 2.0 * ( (double) wind_radius ) );
-      
-      /* Calculating the rotation parameters - 
-         counterclockwise rotation 
-         
-         | u |    |cos  -sin|   |X|
-         | v | == |sin   cos| x |Y|
-      */
-      int_norm = sqrt( ( int_x_dir * int_x_dir ) + 
-        ( int_y_dir * int_y_dir ) );
-      
-      if( int_norm != 0.0 ) {
-        rot_cos = int_x_dir / int_norm;
-        rot_sin = int_y_dir / int_norm;
-      } else {
-        /* No rotation */
-        rot_cos = 1.0;
-        rot_sin = 0.0;
-      }
-      
-      
-/* remove */
-//rot_cos = cos( M_PI_4 );
-//rot_sin = sin( M_PI_4 );
-//if( ( curr_window_x_center = 366 ) &&
-//  ( curr_window_y_center == 641 ) ) {
-//  double angle = atan( rot_sin / rot_cos );
-//  angle = angle + 1.0;
-//}
-//double angle = atan( rot_sin / rot_cos );
-/* remove */      
-      
-      
-      
-      /* Generating the rotated window data and inserting it into 
-         the img_features_matrix by setting the intensity vector
-         to the direction (1,0) by a clockwise rotation
-         using the inverse matrix 
-      
-         | u |    |cos   sin|   |X|
-         | v | == |-sin  cos| x |Y|
-      */
-         
-      for( curr_y = 0 ; curr_y < corr_window_width ; ++curr_y ) {
-        for( curr_x = 0 ; curr_x < corr_window_width ; ++curr_x ) {
-          /* briging the window to the coord system center */
-          
-          curr_x_minus_radius = ((double)curr_x) - 
-            wind_radius_double;
-          curr_y_minus_radius = ((double)curr_y) - 
-            wind_radius_double;
-          
-          /* rotating the centered window */
-          
-          rotated_curr_x = 
-            ( ( rot_cos * curr_x_minus_radius ) + 
-            ( rot_sin * curr_y_minus_radius ) );
-          
-          rotated_curr_y =
-            ( ( -1.0 * rot_sin * curr_x_minus_radius ) + 
-            ( rot_cos * curr_y_minus_radius ) );
-            
-          /* bringing the window back to its original
-             centered location */ 
-            
-          rotated_curr_x += wind_radius_double;
-          rotated_curr_y += wind_radius_double;
-          
-          /* copy the new rotated window to the output vector */
-            
-          rotated_curr_x_img = curr_window_x_start +
-            TeRound( rotated_curr_x );
-          rotated_curr_y_img = curr_window_y_start +
-            TeRound( rotated_curr_y );                        
-           
-          TEAGN_DEBUG_CONDITION( ( rotated_curr_x_img > 0 ), "" )
-          TEAGN_DEBUG_CONDITION( ( rotated_curr_x_img < 
-            (int)img_matrix.GetColumns() ), "" )
-          TEAGN_DEBUG_CONDITION( ( rotated_curr_y_img > 0 ), "" )
-          TEAGN_DEBUG_CONDITION( ( rotated_curr_y_img < 
-            (int)img_matrix.GetLines() ), "" )
-            
-          img_features_matrix( img_maximas_index, ( curr_y * 
-            corr_window_width ) + curr_x ) =
-            img_matrix( rotated_curr_y_img, rotated_curr_x_img );
-
-        }
-      }
-      
-      
-/* remove - skipping normalizing */
-//continue;
-/* remove */      
-      
-      
-      /* Normalizing the generated window by subtracting its mean
-         and dividing by its standard deviation */
-      
-      curr_wind_mean = 0.0;
-      
-      for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
-        ++curr_x ) {
-        
-        curr_wind_mean += img_features_matrix( img_maximas_index,
-          curr_x );
-      }
-      
-      curr_wind_mean /= ( (double)img_features_matrix_cols  );
-      
-      curr_wind_stddev = 0.0;  
-      
-      for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
-        ++curr_x ) {
-        
-        curr_wind_stddev_aux = img_features_matrix( 
-          img_maximas_index, curr_x ) - curr_wind_mean;
-          
-        curr_wind_stddev += ( curr_wind_stddev_aux *
-          curr_wind_stddev_aux );
-      }      
-      
-      curr_wind_stddev /= ( (double)img_features_matrix_cols  );
-      curr_wind_stddev = sqrt( curr_wind_stddev );
-      
-      if( curr_wind_stddev == 0.0 ) {
-        for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
-          ++curr_x ) {
-          
-          double& curr_value = img_features_matrix( 
-            img_maximas_index, curr_x );
-          
-          curr_value -= curr_wind_mean;
-        } 
-      } else {
-        for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
-          ++curr_x ) {
-          
-          double& curr_value = img_features_matrix( 
-            img_maximas_index, curr_x );
-          
-          curr_value -= curr_wind_mean;
-          curr_value /= curr_wind_stddev;
-        }
-      }
-      
-      /* Finished !! */
-     
-      TEAGN_FALSE_OR_RETURN( progress.Increment(),
-        "Canceled by the user" );
-    }
-  }    
-  
-  return true;
-}
-
-
-void TePDIOFMatching::features2Tiff( 
-  unsigned int corr_window_width,
-  const std::vector< TeCoord2D >& img_maxima_points,
-  ImgMatrixT& img_features_matrix,
-  const std::string& filenameaddon )
-{
-  TEAGN_TRUE_OR_THROW( ( img_features_matrix.GetLines() ==
-    img_maxima_points.size() ), 
-    "Invalid matrix lines" )
-  TEAGN_TRUE_OR_THROW( ( img_features_matrix.GetColumns() ==
-    ( corr_window_width * corr_window_width ) ), 
-    "Invalid matrix columns" )
-  TEAGN_TRUE_OR_THROW( ( corr_window_width > 0 ),
-    "Invalid corr_window_width" )      
-
-  for( unsigned int curr_wind_index = 0 ; 
-    curr_wind_index < img_features_matrix.GetLines() ;
-    ++curr_wind_index ) {
-    
-    TeRasterParams params;
-    params.setNLinesNColumns( corr_window_width,
-      corr_window_width );
-    params.nBands( 1 );
-    params.setDataType( TeDOUBLE, -1 );
-    params.nBands( 1 );
-    params.decoderIdentifier_ = "TIF";
-    params.mode_ = 'c';
-    params.fileName_ = Te2String( img_maxima_points[ 
-      curr_wind_index ].x(), 0 ) + "_" + Te2String( 
-      img_maxima_points[ curr_wind_index ].y(), 0 ) + 
-      "_" + filenameaddon + ".tif";
-    
-    TeRaster out_raster( params );
-    TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
-    
-    for( unsigned int line = 0 ; line < corr_window_width ; ++line ) {
-      for( unsigned int col = 0 ; col < corr_window_width ; ++col ) {
-
-        TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
-          img_features_matrix( curr_wind_index, ( line * 
-          corr_window_width ) + col ), 0 ), "Error writing raster" )
-      }  
-    }    
-  }
-}
-
-
-bool TePDIOFMatching::locateBestFeaturesMatching( 
-  const TeThreadParameters& params )
-{
-  /* Retriving parameters */
-  
-  std::vector< unsigned int >* features2_indexes_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "features2_indexes_ptr", 
-    features2_indexes_ptr ),
-    "Missing thread parameter" )
-  std::vector< unsigned int >& features2_indexes = *features2_indexes_ptr;    
-
-  std::vector< unsigned int >* features1_indexes_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "features1_indexes_ptr", 
-    features1_indexes_ptr ),
-    "Missing thread parameter" )
-  std::vector< unsigned int >& features1_indexes = *features1_indexes_ptr;
-  
-  TeMutex* features2_indexes_lock_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "features2_indexes_lock_ptr", 
-    features2_indexes_lock_ptr ),
-    "Missing thread parameter" )
-  TeMutex& features2_indexes_lock = 
-    *features2_indexes_lock_ptr;  
-    
-  TeMutex* features1_indexes_lock_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "features1_indexes_lock_ptr", 
-    features1_indexes_lock_ptr ),
-    "Missing thread parameter" )
-  TeMutex& features1_indexes_lock = 
-    *features1_indexes_lock_ptr;     
-
-  ImgMatrixT* img1_features_matrix_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img1_features_matrix_ptr", 
-    img1_features_matrix_ptr ),
-    "Missing thread parameter" )
-  ImgMatrixT& img1_features_matrix =
-    *img1_features_matrix_ptr;
-    
-  ImgMatrixT* img2_features_matrix_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "img2_features_matrix_ptr", 
-    img2_features_matrix_ptr ),
-    "Missing thread parameter" )
-  ImgMatrixT& img2_features_matrix =
-    *img2_features_matrix_ptr;
-    
-  bool progress_enabled = false;   
-  TEAGN_TRUE_OR_THROW( params.retrive( "progress_enabled", 
-    progress_enabled ), "Missing thread parameter" )     
-    
-  double corr_sens = 0;   
-  TEAGN_TRUE_OR_THROW( params.retrive( "corr_sens", 
-    corr_sens ), "Missing thread parameter" )  
-    
-  TEAGN_DEBUG_CONDITION( ( img2_features_matrix.GetColumns() ==
-    img1_features_matrix.GetColumns() ),
-     "Size columns mismatch" )        
-    
-  /* Init the output featers2_indexes vector once */
-  
-  features2_indexes_lock.lock();
-  
-  if( features2_indexes.size() == 0 )
-  {
-    for( unsigned int features2_indexes_index = 0 ; 
-      features2_indexes_index < img1_features_matrix.GetLines() ;
-      ++features2_indexes_index ) {
-      
-      /* fills with an matrix lines number indicating
-         no processing done yet */
-      features2_indexes.push_back( 
-        img2_features_matrix.GetLines() );
-    }
-  }  
-  
-  features2_indexes_lock.unLock();
-  
-  /* Init the output featers2_indexes vector once */
-  
-  features1_indexes_lock.lock();
-  
-  if( features1_indexes.size() == 0 )
-  {
-    for( unsigned int features1_indexes_index = 0 ; 
-      features1_indexes_index < img2_features_matrix.GetLines() ;
-      ++features1_indexes_index ) {
-      
-      /* fills with an matrix lines number indicating
-         no processing done yet */
-      features1_indexes.push_back( 
-        img1_features_matrix.GetLines() );
-    }
-  }  
-  
-  features1_indexes_lock.unLock();  
-    
-  /* Iterating over img1_features_matrix */
-  
-  const unsigned int img1_features_matrix_lines = 
-    img1_features_matrix.GetLines();
-  const unsigned int img2_features_matrix_lines = 
-    img2_features_matrix.GetLines();  
-  
-  TePDIPIManager progress( "Matching features", 
-    img1_features_matrix_lines + img2_features_matrix_lines, 
-    progress_enabled );
-        
-  const unsigned int cols_nmb = img2_features_matrix.GetColumns();
-  const double max_allowed_diff = ((double)cols_nmb) / corr_sens;
-            
-  {
-    unsigned int mat1_line = 0;
-    unsigned int mat2_line = 0;
-    double min_diff_value = 0;
-    unsigned int min_diff_index = 0;
-    unsigned int curr_col = 0;
-    double curr_diff_value = 0;
-    double curr_elem_diff = 0;
-      
-    for( mat1_line = 0 ; 
-      mat1_line < img1_features_matrix_lines ; ++mat1_line ) {
-      
-      /* Looking for a non-processed feature */
-      
-      features2_indexes_lock.lock();
-      
-      if( features2_indexes[ mat1_line ] == 
-        img2_features_matrix_lines ) {
-        
-        /* Tell to other threads that the current correlation
-          is being calculated */
-        
-        features2_indexes[ mat1_line ] = img2_features_matrix_lines + 1;
-        features2_indexes_lock.unLock();
-        
-        /* Looking for the best correlation with matrix 2 */
-        
-        min_diff_value = DBL_MAX;
-        
-        for( mat2_line = 0 ; mat2_line < img2_features_matrix_lines ;
-          ++mat2_line ) {
-           
-          curr_diff_value = 0.0;
-          
-          for( curr_col = 0 ; curr_col < cols_nmb ; ++curr_col ) {
-            curr_elem_diff = img1_features_matrix( mat1_line,
-              curr_col ) - img2_features_matrix( mat2_line,
-              curr_col );
-              
-            curr_elem_diff *= curr_elem_diff;
-              
-            curr_diff_value += curr_elem_diff;
-          }
-          
-          curr_diff_value = sqrt( curr_diff_value );
-          
-          if( curr_diff_value < min_diff_value ) {
-            min_diff_value = curr_diff_value;
-            min_diff_index = mat2_line;
-          }
-        }
-        
-        if( min_diff_value <= max_allowed_diff ) {
-          features2_indexes_lock.lock();
-          
-          features2_indexes[ mat1_line ] = min_diff_index;
-          
-          features2_indexes_lock.unLock();
-        }
-      } else {
-        features2_indexes_lock.unLock();
-      }
-      
-      TEAGN_FALSE_OR_RETURN( progress.Increment(),
-        "Canceled by the user" );
-    }
-  }
-  
-  /* Iterating over img2_features_matrix */
-  
-  {
-    unsigned int mat1_line = 0;
-    unsigned int mat2_line = 0;
-    double min_diff_value = 0;
-    unsigned int min_diff_index = 0;
-    unsigned int curr_col = 0;
-    double curr_diff_value = 0;
-    double curr_elem_diff = 0;
-      
-    for( mat2_line = 0 ; 
-      mat2_line < img2_features_matrix_lines ; ++mat2_line ) {
-      
-      /* Looking for a non-processed feature */
-      
-      features1_indexes_lock.lock();
-      
-      if( features1_indexes[ mat2_line ] == 
-        img1_features_matrix_lines ) {
-        
-        /* Tell to other threads that the current correlation
-          is being calculated */
-        
-        features1_indexes[ mat2_line ] = img1_features_matrix_lines + 1;
-        features1_indexes_lock.unLock();
-        
-        /* Looking for the best correlation with matrix 1 */
-        
-        min_diff_value = DBL_MAX;
-        
-        for( mat1_line = 0 ; mat1_line < img1_features_matrix_lines ;
-          ++mat1_line ) {
-           
-          curr_diff_value = 0.0;
-          
-          for( curr_col = 0 ; curr_col < cols_nmb ; ++curr_col ) {
-            curr_elem_diff = img2_features_matrix( mat2_line,
-              curr_col ) - img1_features_matrix( mat1_line,
-              curr_col );
-              
-            curr_elem_diff *= curr_elem_diff;
-            
-            curr_diff_value += curr_elem_diff;
-          }
-          
-          curr_diff_value = sqrt( curr_diff_value );
-          
-          if( curr_diff_value < min_diff_value ) {
-            min_diff_value = curr_diff_value;
-            min_diff_index = mat1_line;
-          }
-        }
-        
-        if( min_diff_value <= max_allowed_diff ) {
-          features1_indexes_lock.lock();
-          
-          features1_indexes[ mat2_line ] = min_diff_index;
-          
-          features1_indexes_lock.unLock();
-        }
-      } else {
-        features1_indexes_lock.unLock();
-      }
-      
-      TEAGN_FALSE_OR_RETURN( progress.Increment(),
-        "Canceled by the user" );
-    }
-  }
-  
-  return true;  
-}
-
-
-bool TePDIOFMatching::checkMaximaPoints( 
-  const std::vector< TeCoord2D >&maximas ) const
-{
-  for( unsigned int idx1 = 0 ; idx1 < maximas.size() ; ++idx1 )
-  { 
-    for( unsigned int idx2 = idx1 + 1 ; idx2 < maximas.size() ; ++idx2 )
-    {
-      TEAGN_TRUE_OR_RETURN( (
-        ( maximas[ idx1 ].x() != maximas[ idx2 ].x() ) ||
-        ( maximas[ idx1 ].y() != maximas[ idx2 ].y() ) ),
-        "Invalid maxima points" +
-        std::string( " index1=" ) + Te2String( idx1 ) +
-        " [" + Te2String( maximas[ idx1 ].x(), 9 ) + "," +
-        Te2String( maximas[ idx1 ].y(), 9 ) + "]" +
-        std::string( " index2=" ) + Te2String( idx2 ) +
-        " [" + Te2String( maximas[ idx2 ].x(), 9 ) + "," +
-        Te2String( maximas[ idx2 ].y(), 9 ) + "]" )
-    }
-  }
-  
-  return true;
-}
-
-
-bool TePDIOFMatching::checkTPs( 
-  const TeCoordPairVect& tpsvec ) const
-{
-  for( unsigned int idx1 = 0 ; idx1 < tpsvec.size() ; ++idx1 )
-  { 
-    for( unsigned int idx2 = idx1 + 1 ; idx2 < tpsvec.size() ; 
-      ++idx2 )
-    {
-      TEAGN_TRUE_OR_RETURN( 
-        (
-          (
-            ( tpsvec[ idx1 ].pt1.x() != tpsvec[ idx2 ].pt1.x() ) ||
-            ( tpsvec[ idx1 ].pt1.y() != tpsvec[ idx2 ].pt1.y() ) 
-          ) &&
-          (
-            ( tpsvec[ idx1 ].pt2.x() != tpsvec[ idx2 ].pt2.x() ) ||
-            ( tpsvec[ idx1 ].pt2.y() != tpsvec[ idx2 ].pt2.y() ) 
-          )
-        ),
-        "Invalid tie-point" +
-        std::string( " index1=" ) + Te2String( idx1 ) +
-        " [" + Te2String( tpsvec[ idx1 ].pt1.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx1 ].pt1.y(), 9 ) + " <-> " +
-        Te2String( tpsvec[ idx1 ].pt2.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx1 ].pt2.y(), 9 ) + "]" +
-        std::string( " index2=" ) + Te2String( idx2 ) +
-        " [" + Te2String( tpsvec[ idx2 ].pt1.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx2 ].pt1.y(), 9 ) + " <-> " +
-        Te2String( tpsvec[ idx2 ].pt2.x(), 9 ) + "," +
-        Te2String( tpsvec[ idx2 ].pt2.y(), 9 ) + "]" );
-    }
-  }
-  
-  return true;
-}
-
-
+#include "TePDIOFMatching.hpp"
+
+#include "TePDIUtils.hpp"
+
+#include <TeThreadFunctor.h>
+#include <TeMutex.h>
+#include <TeCoord2D.h>
+#include <TeGTFactory.h>
+#include <TeDefines.h>
+
+#include <math.h>
+
+#ifndef M_PI
+  #define M_PI       3.14159265358979323846
+#endif
+#ifndef M_PI_2
+  #define M_PI_2     1.57079632679489661923
+#endif
+#ifndef M_PI_4
+  #define M_PI_4     0.785398163397448309616
+#endif
+
+TePDIOFMatching::TePDIOFMatching()
+{
+}
+
+
+TePDIOFMatching::~TePDIOFMatching()
+{
+}
+
+
+bool TePDIOFMatching::RunImplementation()
+{
+  /* Retriving Parameters */
+  
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  params_.GetParameter( "input_image1_ptr", input_image1_ptr );  
+  
+  unsigned int input_channel1 = 0;
+  params_.GetParameter( "input_channel1", input_channel1 );   
+  
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  params_.GetParameter( "input_image2_ptr", input_image2_ptr );  
+  
+  unsigned int input_channel2 = 0;
+  params_.GetParameter( "input_channel2", input_channel2 );   
+
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
+  params_.GetParameter( "out_tie_points_ptr", out_tie_points_ptr );   
+  
+  TeBox input_box1;
+  if( params_.CheckParameter< TeBox >( "input_box1" ) ) {
+    params_.GetParameter( "input_box1", input_box1 );
+  } else {
+    TeBox input_box1_proj = input_image1_ptr->params().box();
+    
+    TePDIUtils::MapCoords2RasterIndexes( input_box1_proj, input_image1_ptr,
+      input_box1 );
+  }
+  
+  TeBox input_box2;
+  if( params_.CheckParameter< TeBox >( "input_box2" ) ) {
+    params_.GetParameter( "input_box2", input_box2 );
+  } else {
+    TeBox input_box2_proj = input_image2_ptr->params().box();
+    
+    TePDIUtils::MapCoords2RasterIndexes( input_box2_proj, input_image2_ptr,
+      input_box2 );
+  }  
+  
+  bool enable_multi_thread = false;
+  if( params_.CheckParameter< int >( "enable_multi_thread" ) ) {
+    enable_multi_thread = true;
+  }
+  
+  bool skip_geom_filter = false;
+  if( params_.CheckParameter< int >( "skip_geom_filter" ) ) {
+    skip_geom_filter = true;
+  }  
+  
+  double pixel_x_relation = 1.0;
+  if( params_.CheckParameter< double >( "pixel_x_relation" ) ) {
+    params_.GetParameter( "pixel_x_relation", pixel_x_relation );
+  }
+  
+  double pixel_y_relation = 1.0;
+  if( params_.CheckParameter< double >( "pixel_y_relation" ) ) {
+    params_.GetParameter( "pixel_y_relation", pixel_y_relation );
+  }  
+  
+  TeGTParams gt_params;
+  gt_params.out_rem_strat_ = TeGTParams::RANSACRemotion;
+  gt_params.max_dmap_error_ = 2.0;
+  gt_params.max_imap_error_ = gt_params.max_dmap_error_ /
+    MIN( pixel_x_relation, pixel_y_relation );
+  gt_params.transformation_name_ = "affine";
+  if( params_.CheckParameter< TeGTParams >( "gt_params" ) ) {
+    params_.GetParameter( "gt_params", gt_params );
+  }  
+  
+  unsigned int max_tie_points = 529;
+  if( params_.CheckParameter< unsigned int >( "max_tie_points" ) ) {
+    params_.GetParameter( "max_tie_points", max_tie_points );
+  }    
+  
+  double corr_sens = 0.5;
+  if( params_.CheckParameter< double >( "corr_sens" ) ) {
+    params_.GetParameter( "corr_sens", corr_sens );
+  }    
+  
+  unsigned int corr_window_width = 21;
+  if( params_.CheckParameter< unsigned int >( 
+    "corr_window_width" ) ) {
+    
+    params_.GetParameter( "corr_window_width", corr_window_width );
+  }     
+  
+  unsigned int max_size_opt = 0;
+  if( params_.CheckParameter< unsigned int >( "max_size_opt" ) ) {
+    params_.GetParameter( "max_size_opt", max_size_opt );
+  }   
+  
+  double maximas_sens = 0;
+  if( params_.CheckParameter< double >( "maximas_sens" ) ) {
+    params_.GetParameter( "maximas_sens", maximas_sens );
+  }      
+  
+  /* Calculating the number of allowed threads - this process
+     not included into the count */
+     
+  unsigned int max_threads = 0;
+  std::vector< TeThreadFunctor::pointer > threads_vector;
+  
+  if( enable_multi_thread ) {
+    max_threads = TeGetPhysProcNumber() - 1;
+    
+    for( unsigned int index = 0 ; index < max_threads ; ++index ) {
+      TeThreadFunctor::pointer aux_thread_ptr( new TeThreadFunctor );
+    
+      threads_vector.push_back( aux_thread_ptr );
+    }
+  }
+  
+  /* Calculating the box postion related values */
+  
+  const unsigned int orig_box1_x_off = (unsigned int)input_box1.lowerLeft().x();
+  const unsigned int orig_box1_y_off = (unsigned int)input_box1.upperRight().y();
+  const unsigned int orig_box1_nlines = 1 + (unsigned int)ABS( input_box1.height() );
+  const unsigned int orig_box1_ncols = 1 + (unsigned int)ABS( input_box1.width() );
+  
+  const unsigned int orig_box2_x_off = (unsigned int)input_box2.lowerLeft().x();
+  const unsigned int orig_box2_y_off = (unsigned int)input_box2.upperRight().y();
+  const unsigned int orig_box2_nlines = 1 + (unsigned int)ABS( input_box2.height() );
+  const unsigned int orig_box2_ncols = 1 + (unsigned int)ABS( input_box2.width() );
+    
+  /* Calculating the rescale factors 
+     rescaled_image = original_image * rescale_factor */
+  
+  double img1_x_rescale_factor = 1.0;
+  double img1_y_rescale_factor = 1.0;
+  double img2_x_rescale_factor = 1.0;
+  double img2_y_rescale_factor = 1.0;
+  {
+    double mean_pixel_relation = ( pixel_x_relation + pixel_y_relation ) /
+      2.0;
+      
+    if( mean_pixel_relation > 1.0 ) {
+      /* The image 1 has poor resolution - bigger pixel resolution values -
+         and image 2 needs to be rescaled down */
+      
+      img2_x_rescale_factor = 1.0 / pixel_x_relation;
+      img2_y_rescale_factor = 1.0 / pixel_y_relation;
+    } else if( mean_pixel_relation < 1.0 ) {
+      /* The image 2 has poor resolution - bigger pixel resolution values
+        and image 1 needs to be rescaled down */
+      
+      img1_x_rescale_factor = pixel_x_relation;
+      img1_y_rescale_factor = pixel_y_relation;
+    }
+  } 
+  
+  if( max_size_opt )
+  {
+    double resc_box1_size = 
+      ( (double)orig_box1_nlines  ) * img1_y_rescale_factor *
+      ( (double)orig_box1_ncols ) * img1_x_rescale_factor;
+    double resc_box2_size = 
+      ( (double)orig_box2_nlines  ) * img2_y_rescale_factor *
+      ( (double)orig_box2_ncols ) * img2_x_rescale_factor;
+    double max_size_opt_double = (double)max_size_opt;
+    
+    if( ( resc_box1_size > max_size_opt_double ) || 
+      ( resc_box2_size > max_size_opt_double ) )
+    {
+      double opt_rescale_factor = 1.0;
+      
+      if( resc_box1_size > resc_box2_size )
+      {
+        opt_rescale_factor = sqrt( resc_box1_size / max_size_opt_double );
+      }
+      else
+      {
+        opt_rescale_factor = sqrt( resc_box2_size / max_size_opt_double );
+      }
+      
+      img1_x_rescale_factor *= opt_rescale_factor;
+      img1_y_rescale_factor *= opt_rescale_factor;
+      img2_x_rescale_factor *= opt_rescale_factor;
+      img2_y_rescale_factor *= opt_rescale_factor;
+    }
+  }
+  
+  /* Calculating the max tie-points to be generated for each image
+     trying to keep the same tie-point density for both images */
+     
+  unsigned int img1_max_tps = 0;
+  unsigned int img2_max_tps = 0;
+  
+  {
+    double resc_box1_nlines =  ( (double)orig_box1_nlines  ) * 
+      img1_y_rescale_factor;
+    double resc_box1_ncols =  ( (double)orig_box1_ncols ) * 
+      img1_x_rescale_factor;
+    double resc_box2_nlines =  ( (double)orig_box2_nlines  ) * 
+      img2_y_rescale_factor;
+    double resc_box2_ncols =  ( (double)orig_box2_ncols ) * 
+      img2_x_rescale_factor;
+      
+    double resc_box1_area = resc_box1_nlines * resc_box1_ncols;
+    double resc_box2_area = resc_box2_nlines * resc_box2_ncols;
+      
+    if( resc_box1_area > resc_box2_area )
+    {
+      img2_max_tps = max_tie_points;
+      
+      img1_max_tps = (unsigned int)( 
+        resc_box1_area / 
+        ( resc_box2_area / ( (double)max_tie_points ) ) );
+    }
+    else
+    {
+      img1_max_tps = max_tie_points;
+      
+      img2_max_tps = (unsigned int)( 
+        resc_box2_area / 
+        ( resc_box1_area / ( (double)max_tie_points ) ) ); 
+    }
+  }
+  
+  /* Loading images */
+  
+  TeMutex glb_mem_lock; //global memory lock
+  
+  ImgMatrixT img1_matrix;
+  ImgMatrixT img2_matrix;
+ 
+  {
+    TeThreadParameters tparams1;
+    tparams1.store( "input_image_ptr", input_image1_ptr );
+    tparams1.store( "img_matrix_ptr", &img1_matrix );
+    tparams1.store( "img_x_rescale_factor", img1_x_rescale_factor );
+    tparams1.store( "img_y_rescale_factor", img1_y_rescale_factor );
+    tparams1.store( "box_x_off", orig_box1_x_off );
+    tparams1.store( "box_y_off", orig_box1_y_off );
+    tparams1.store( "box_nlines", orig_box1_nlines );
+    tparams1.store( "box_ncols", orig_box1_ncols );
+    tparams1.store( "input_channel", input_channel1 );
+    tparams1.store( "progress_enabled", progress_enabled_ );
+    tparams1.store( "glb_mem_lock_ptr", &glb_mem_lock );
+    
+    TeThreadParameters tparams2;
+    tparams2.store( "input_image_ptr", input_image2_ptr );
+    tparams2.store( "img_matrix_ptr", &img2_matrix );
+    tparams2.store( "img_x_rescale_factor", img2_x_rescale_factor );
+    tparams2.store( "img_y_rescale_factor", img2_y_rescale_factor );
+    tparams2.store( "box_x_off", orig_box2_x_off );
+    tparams2.store( "box_y_off", orig_box2_y_off );
+    tparams2.store( "box_nlines", orig_box2_nlines );
+    tparams2.store( "box_ncols", orig_box2_ncols );
+    tparams2.store( "input_channel", input_channel2 );
+    tparams2.store( "progress_enabled", progress_enabled_ );
+    tparams2.store( "glb_mem_lock_ptr", &glb_mem_lock );
+  
+    if( max_threads > 0 ) {
+      threads_vector[ 0 ]->setStartFunctPtr( loadImage );
+      threads_vector[ 0 ]->setParameters( tparams1 );
+      threads_vector[ 0 ]->start();
+   
+      if( ! loadImage( tparams2 ) ) {
+        threads_vector[ 0 ]->waitToFinish();
+        
+        TEAGN_LOG_AND_RETURN( "Unable to load image 2" )
+      } else {
+        threads_vector[ 0 ]->waitToFinish();
+        
+        TEAGN_TRUE_OR_RETURN( threads_vector[ 0 ]->getReturnValue(),
+          "Unable to load image 1" )
+      }
+    } else {
+      TEAGN_TRUE_OR_RETURN( loadImage( tparams1 ),
+        "Error loading image 1" )
+      TEAGN_TRUE_OR_RETURN( loadImage( tparams2 ),
+        "Error loading image 2" )
+    }
+  }
+  
+/* remove */        
+//matrix2Tiff( img1_matrix, "img1_matrix.tif", 
+//  std::vector< TeCoord2D >() );
+//matrix2Tiff( img2_matrix, "img2_matrix.tif",
+//  std::vector< TeCoord2D >() );
+/* remove */  
+  
+  /* Generating the correlation windows and the maxima points */
+  
+  std::vector< TeCoord2D > img1_maxima_points;
+  std::vector< TeCoord2D > img2_maxima_points;
+  
+  ImgMatrixT img1_features_matrix;
+  img1_features_matrix.Reset( ImgMatrixT::RAMMemPol );
+    /* each line is a stacked version
+       of one rotated correlation 
+       window */
+       
+  ImgMatrixT img2_features_matrix;
+  img2_features_matrix.Reset( ImgMatrixT::RAMMemPol );
+    /* each line is a stacked version
+       of one rotated correlation 
+       window */
+  {
+    TeThreadParameters tparams1;
+    tparams1.store( "img_matrix_ptr", &img1_matrix );
+    tparams1.store( "corr_window_width", corr_window_width );
+    tparams1.store( "img_maxima_points_ptr", &img1_maxima_points );
+    tparams1.store( "img_features_matrix_ptr", &img1_features_matrix );
+    tparams1.store( "progress_enabled", progress_enabled_ );
+    tparams1.store( "max_points", img1_max_tps );
+    tparams1.store( "glb_mem_lock_ptr", &glb_mem_lock );
+    tparams1.store( "maximas_sens", maximas_sens );
+    
+    TeThreadParameters tparams2;
+    tparams2.store( "img_matrix_ptr", &img2_matrix );
+    tparams2.store( "corr_window_width", corr_window_width );
+    tparams2.store( "img_maxima_points_ptr", &img2_maxima_points );
+    tparams2.store( "img_features_matrix_ptr", &img2_features_matrix );    
+    tparams2.store( "progress_enabled", progress_enabled_ );
+    tparams2.store( "max_points", img2_max_tps );
+    tparams2.store( "glb_mem_lock_ptr", &glb_mem_lock );
+    tparams2.store( "maximas_sens", maximas_sens );
+    
+    if( max_threads > 0 ) {
+      threads_vector[ 0 ]->setStartFunctPtr( generateFeatures );
+      threads_vector[ 0 ]->setParameters( tparams1 );
+      threads_vector[ 0 ]->start();
+    
+      if( ! generateFeatures( tparams2 ) ) {
+        threads_vector[ 0 ]->waitToFinish();
+        
+        TEAGN_LOG_AND_RETURN( "Unable to the correlation windows from image 2" )
+      } else {
+        threads_vector[ 0 ]->waitToFinish();
+        
+        TEAGN_TRUE_OR_RETURN( threads_vector[ 0 ]->getReturnValue(),
+          "Unable to the correlation windows from image 1" )
+      }      
+    } else {
+      TEAGN_TRUE_OR_RETURN( generateFeatures( tparams1 ),
+        "Error generating the correlation windows from image 1" )
+      TEAGN_TRUE_OR_RETURN( generateFeatures( tparams2 ),
+        "Error generating the correlation windows from image 2" )        
+    }
+    
+    if( ( img1_maxima_points.size() == 0 ) ||
+      ( img2_maxima_points.size() == 0 ) )
+    {
+      /* No maximas found in one image */
+      
+      return true;
+    }
+    
+/* remove */
+//matrix2Tiff( img1_matrix, "img1_matrix_with_maxima_points.tif", 
+//  img1_maxima_points );
+//matrix2Tiff( img2_matrix, "img2_matrix_with_maxima_points.tif", 
+//  img2_maxima_points );
+/* remove */
+    
+    /* Bringing img1_maxima_points into input_image1_ptr 
+       reference */
+ 
+    std::vector< TeCoord2D >::iterator maximas_it = 
+      img1_maxima_points.begin();
+    std::vector< TeCoord2D >::iterator maximas_it_end = 
+      img1_maxima_points.end();
+      
+    while( maximas_it != maximas_it_end ) {
+      (*maximas_it) = 
+        TeCoord2D( 
+          ( (*maximas_it).x() / img1_x_rescale_factor ) +
+            ( (double)orig_box1_x_off ),
+          ( (*maximas_it).y() / img1_y_rescale_factor ) +
+            ( (double)orig_box1_y_off )
+        );
+        
+      TEAGN_DEBUG_CONDITION( 
+        ( maximas_it->x() < input_image1_ptr->params().ncols_ ),
+        "Invalid x coord generated" )
+      TEAGN_DEBUG_CONDITION( 
+        ( maximas_it->x() >= 0 ),
+        "Invalid x coord generated" )        
+      TEAGN_DEBUG_CONDITION( 
+        ( maximas_it->y() < input_image1_ptr->params().nlines_ ),
+        "Invalid y coord generated" )
+      TEAGN_DEBUG_CONDITION( 
+        ( maximas_it->y() >= 0 ),
+        "Invalid y coord generated" )           
+        
+      ++maximas_it;
+    }
+    
+    /* Bringing img2_maxima_points into input_image2_ptr 
+       reference */    
+    
+    maximas_it = img2_maxima_points.begin();
+    maximas_it_end = img2_maxima_points.end();
+      
+    while( maximas_it != maximas_it_end ) {
+      (*maximas_it) = 
+        TeCoord2D( 
+          ( (*maximas_it).x() / img2_x_rescale_factor ) +
+            ( (double)orig_box2_x_off ),
+          ( (*maximas_it).y() / img2_y_rescale_factor ) +
+            ( (double)orig_box2_y_off )
+        );
+      
+      TEAGN_DEBUG_CONDITION( 
+        ( maximas_it->x() < input_image2_ptr->params().ncols_ ),
+        "Invalid x coord generated" )
+      TEAGN_DEBUG_CONDITION( 
+        ( maximas_it->x() >= 0 ),
+        "Invalid x coord generated" )         
+      TEAGN_DEBUG_CONDITION( 
+        ( maximas_it->y() < input_image2_ptr->params().nlines_ ),
+        "Invalid y coord generated" ) 
+      TEAGN_DEBUG_CONDITION( 
+        ( maximas_it->y() >= 0 ),
+        "Invalid y coord generated" )                 
+        
+      ++maximas_it;
+    }    
+  }
+  
+  TEAGN_DEBUG_CONDITION( ( img1_maxima_points.size() ==
+    img1_features_matrix.GetLines() ),
+    "Features number mismatch" );
+  TEAGN_DEBUG_CONDITION( ( img2_maxima_points.size() ==
+    img2_features_matrix.GetLines() ),
+    "Features number mismatch" ); 
+    
+  TEAGN_DEBUG_CONDITION( checkMaximaPoints( img1_maxima_points ),
+    "Invalid img1 maximas" )
+  TEAGN_DEBUG_CONDITION( checkMaximaPoints( img2_maxima_points ),
+    "Invalid img2 maximas" )
+    
+  /* Free anused resources */
+  
+  img1_matrix.Reset();
+  img2_matrix.Reset();
+
+/* remove */
+//raster2Tiff( input_image1_ptr, input_channel1,
+//  "orig_img1_plus_all_maximas.tif",
+//  img1_maxima_points,TeSharedPtr< TeCoordPairVect >(), 0 );
+//raster2Tiff( input_image2_ptr, input_channel2,
+//  "orig_img2_plus_all_maximas.tif",
+//  img2_maxima_points, TeSharedPtr< TeCoordPairVect >(), 0 ); 
+/* remove */
+  
+  
+/* remove */
+//features2Tiff( corr_window_width, img1_maxima_points, 
+//  img1_features_matrix, "img1" );
+//features2Tiff( corr_window_width, img2_maxima_points, 
+//  img2_features_matrix, "img2" );
+/* remove */   
+  
+  /* Matching the correlation windows */
+  
+  /* A vector with the matrix 2 features indexes with
+    the best correlation value for each matrix 1 element 
+    features2_indexes size = img1_features_matrix size */
+  std::vector< unsigned int > features2_indexes;
+  
+  /* A vector with the matrix 1 features indexes with
+    the best correlation value for each matrix 2 element 
+    features1_indexes size = img2_features_matrix size */
+  std::vector< unsigned int > features1_indexes;
+      
+  {
+    /* lock objects for the two vectors */
+    TeMutex globalMutex;
+   
+    TeThreadParameters tparams;
+    tparams.store( "features2_indexes_ptr", &features2_indexes );
+    tparams.store( "features1_indexes_ptr", &features1_indexes );
+    tparams.store( "global_mutex_ptr", 
+      &globalMutex );
+    tparams.store( "img1_features_matrix_ptr", 
+      &img1_features_matrix );
+    tparams.store( "img2_features_matrix_ptr", 
+      &img2_features_matrix );
+    tparams.store( "progress_enabled", progress_enabled_ );
+    tparams.store( "corr_sens", corr_sens );
+    
+    if( max_threads > 0 ) 
+    {
+      for( unsigned int thr_vec_ind = 0 ;
+        thr_vec_ind < threads_vector.size() ; ++thr_vec_ind ) {
+        
+        threads_vector[ thr_vec_ind ]->setStartFunctPtr( 
+          locateBestFeaturesMatching );
+          
+        threads_vector[ thr_vec_ind ]->setParameters( tparams );
+        threads_vector[ thr_vec_ind ]->start();
+      }
+        
+      if( ! locateBestFeaturesMatching( tparams ) ) {
+        for( unsigned int thr_vec_ind = 0 ;
+          thr_vec_ind < threads_vector.size() ; ++thr_vec_ind ) {
+          
+          threads_vector[ thr_vec_ind ]->waitToFinish();
+        }
+        
+        TEAGN_LOG_AND_RETURN( 
+          "Error locating the features matching for matrix 1" )
+      } else {
+        bool one_thread_returned_error = false;
+        
+        for( unsigned int thr_vec_ind = 0 ;
+          thr_vec_ind < threads_vector.size() ; ++thr_vec_ind ) {
+          
+          threads_vector[ thr_vec_ind ]->waitToFinish();
+          
+          if( ! threads_vector[ thr_vec_ind ]->getReturnValue() ) {
+            one_thread_returned_error = true;
+          }
+        }
+        
+        TEAGN_TRUE_OR_RETURN( ( ! one_thread_returned_error ),
+          "Error locating the features matching" )
+      }      
+    } else {
+      TEAGN_TRUE_OR_RETURN( locateBestFeaturesMatching( tparams ),
+        "Error locating the features matching" );
+    }
+  }
+  
+  TEAGN_DEBUG_CONDITION( ( img1_maxima_points.size() ==
+    features2_indexes.size() ),
+    "Features number mismatch" );
+  TEAGN_DEBUG_CONDITION( ( img2_maxima_points.size() ==
+    features1_indexes.size() ),
+    "Features number mismatch" );
+    
+  /* Free anused resources */
+  
+  img1_features_matrix.Reset();  
+  img2_features_matrix.Reset();
+    
+  /* Generating tie-points */
+  
+  out_tie_points_ptr->clear();
+   
+  {
+    unsigned int features2_indexes_size = features2_indexes.size();
+    unsigned int features1_indexes_size = features1_indexes.size();
+  
+    unsigned int f1i_index = 0;//index over features1_indexes
+    unsigned int f2i_index = 0;//index over features2_indexes
+ 
+    /* features1_indexes pointed indexes */
+    unsigned int f1_pointed_index = 0;
+    /* features2_indexes pointed indexes */
+    unsigned int f2_pointed_index = 0;
+    
+    /* Getting the matchings priorizing the pointings
+       indicated by features2_indexes */
+  
+    for( f2i_index = 0 ; f2i_index < features2_indexes_size ;
+      ++f2i_index ) {
+      
+      f2_pointed_index = features2_indexes[ f2i_index ];
+      
+      if( f2_pointed_index < features1_indexes_size ) {
+        f1_pointed_index = features1_indexes[ f2_pointed_index ];
+          
+        if( f1_pointed_index == f2i_index ) {
+         
+          out_tie_points_ptr->push_back( TeCoordPair(
+            img1_maxima_points[ f2i_index ],
+            img2_maxima_points[ f2_pointed_index ] ) ); 
+            
+          /* Invalidating the pointings to avoid duplicated 
+            matches */
+            
+          features2_indexes[ f2i_index ] = features1_indexes_size;
+          features1_indexes[ f2_pointed_index ] =
+            features2_indexes_size;
+        }
+      }
+    }
+    
+    /* Getting the remaining matchings priorizing the pointings
+       indicated by features1_indexes */
+    
+    for( f1i_index = 0 ; f1i_index < features1_indexes_size ;
+      ++f1i_index ) {
+      
+      f1_pointed_index = features1_indexes[ f1i_index ];
+      
+      if( f1_pointed_index < features2_indexes_size ) {
+        
+        f2_pointed_index = features2_indexes[ f1_pointed_index ];
+        
+        if( f2_pointed_index == f1i_index ) {
+         
+          out_tie_points_ptr->push_back( TeCoordPair(
+            img1_maxima_points[ f1_pointed_index ],
+            img2_maxima_points[ f1i_index ] ) ); 
+            
+          /* Invalidating the pointings to avoid duplicated 
+            matches */
+            
+          features2_indexes[ f1_pointed_index ] = features1_indexes_size;
+          features1_indexes[ f1i_index ] = features2_indexes_size;            
+        }
+      }
+    }    
+
+  }
+  
+  TEAGN_DEBUG_CONDITION( checkTPs( *out_tie_points_ptr ),
+    "Invalid tie-points" )
+  
+  /* Free anused resources */
+  
+  img1_maxima_points.clear();
+  img2_maxima_points.clear();  
+  
+  features2_indexes.clear();
+  features1_indexes.clear();
+  
+/* remove */
+//raster2Tiff( input_image1_ptr, input_channel1,
+//  "orig_img1_plus_all_tp.tif",
+//  std::vector< TeCoord2D >(), out_tie_points_ptr, 0 );
+//raster2Tiff( input_image2_ptr, input_channel2,
+//  "orig_img2_plus_all_tp.tif",
+//  std::vector< TeCoord2D >(), out_tie_points_ptr, 1 );  
+/* remove */     
+  
+  /* Doing geometrical filtering using user supplied 
+     geometrical transformation parameters */
+     
+  if( ! skip_geom_filter ) {
+    gt_params.tiepoints_ = (*out_tie_points_ptr);
+       
+    TeGeometricTransformation::pointer trans_ptr( 
+      TeGTFactory::make( gt_params ) );
+    if( trans_ptr->reset( gt_params ) ) {
+      trans_ptr->getParameters( gt_params );
+      
+      /* updating the output tie points */
+      
+      (*out_tie_points_ptr) = gt_params.tiepoints_;
+      
+      /* updating the output gt_params, if available */
+      
+      TeGTParams::pointer out_gt_params_ptr;
+      if( params_.CheckParameter< TeGTParams::pointer >( 
+        "out_gt_params_ptr" ) ) 
+      {
+        params_.GetParameter( "out_gt_params_ptr", out_gt_params_ptr );
+        
+        *out_gt_params_ptr = gt_params;
+      }       
+    } else {
+      out_tie_points_ptr->clear();
+    }
+  }
+  
+/* remove */
+//raster2Tiff( input_image1_ptr, input_channel1,
+//  "orig_img1_plus_filtered_tp.tif",
+//  std::vector< TeCoord2D >(), out_tie_points_ptr, 0 );
+//raster2Tiff( input_image2_ptr, input_channel2,
+//  "orig_img2_plus_filtered_tp.tif",
+//  std::vector< TeCoord2D >(), out_tie_points_ptr, 1 );  
+/* remove */   
+  
+  return true;
+}
+
+
+bool TePDIOFMatching::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking input_image1_ptr */
+    
+  TePDITypes::TePDIRasterPtrType input_image1_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_image1_ptr", input_image1_ptr ),
+    "Missing parameter: input_image1_ptr" );
+  TEAGN_TRUE_OR_RETURN( input_image1_ptr.isActive(),
+    "Invalid parameter: input_image1_ptr inactive" );
+  TEAGN_TRUE_OR_RETURN( input_image1_ptr->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: input_image1_ptr not ready" );
+    
+  /* Checking input_channel1 */
+    
+  unsigned int input_channel1 = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_channel1", input_channel1 ),
+    "Missing parameter: input_channel1" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( (int)input_channel1 ) < 
+    input_image1_ptr->params().nBands() ),
+    "Invalid parameter: input_channel1" );
+  
+    
+  /* Checking input_image1_ptr */
+    
+  TePDITypes::TePDIRasterPtrType input_image2_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_image2_ptr", input_image2_ptr ),
+    "Missing parameter: input_image2_ptr" );
+  TEAGN_TRUE_OR_RETURN( input_image2_ptr.isActive(),
+    "Invalid parameter: input_image2_ptr inactive" );
+  TEAGN_TRUE_OR_RETURN( input_image2_ptr->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: input_image2_ptr not ready" );    
+    
+  /* Checking input_channel2 */
+    
+  unsigned int input_channel2 = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "input_channel2", input_channel2 ),
+    "Missing parameter: input_channel2" );
+  TEAGN_TRUE_OR_RETURN( 
+    ( ( (int)input_channel2 ) < 
+    input_image2_ptr->params().nBands() ),
+    "Invalid parameter: input_channel2" );
+    
+  /* Checking out_tie_points_ptr */
+    
+  TeSharedPtr< TeCoordPairVect > out_tie_points_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( 
+    "out_tie_points_ptr", out_tie_points_ptr ),
+    "Missing parameter: out_tie_points_ptr" );
+  TEAGN_TRUE_OR_RETURN( out_tie_points_ptr.isActive(),
+    "Invalid parameter: out_tie_points_ptr inactive" );
+    
+  /* Checking gt_params */
+    
+  TeGTParams gt_params;
+  if( parameters.CheckParameter< TeGTParams >( "gt_params" ) ) {
+    parameters.GetParameter( "gt_params", gt_params );
+    
+    TEAGN_TRUE_OR_RETURN( ( TeGTFactory::instance().find( 
+      gt_params.transformation_name_ ) != 
+      TeGTFactory::instance().end() ),
+      "Invalid parameter : gt_params" )
+  }   
+    
+  /* Checking input_box1 */
+    
+  TeBox input_box1;
+  if( parameters.CheckParameter< TeBox >( "input_box1" ) ) {
+    parameters.GetParameter( "input_box1", input_box1 );
+    
+    TEAGN_TRUE_OR_RETURN( ( input_box1.x1() >= 0 ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( ( input_box1.x2() >= 0 ),
+      "Invalid parameter : input_box1" )      
+    TEAGN_TRUE_OR_RETURN( ( input_box1.y1() >= 0 ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( ( input_box1.y2() >= 0 ),
+      "Invalid parameter : input_box1" )         
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.x1() <= 
+        ( input_image1_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.x2() <= 
+        ( input_image1_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box1" )       
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.y1() <= 
+        ( input_image1_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box1" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box1.y2() <= 
+        ( input_image1_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box1" )        
+  }
+    
+  /* Checking input_box2 */
+    
+  TeBox input_box2;
+  if( parameters.CheckParameter< TeBox >( "input_box2" ) ) {
+    parameters.GetParameter( "input_box2", input_box2 );
+    
+    TEAGN_TRUE_OR_RETURN( ( input_box2.x1() >= 0 ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( ( input_box2.x2() >= 0 ),
+      "Invalid parameter : input_box2" )      
+    TEAGN_TRUE_OR_RETURN( ( input_box2.y1() >= 0 ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( ( input_box2.y2() >= 0 ),
+      "Invalid parameter : input_box2" )         
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.x1() <= 
+        ( input_image2_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.x2() <= 
+        ( input_image2_ptr->params().ncols_ - 1 ) ),
+      "Invalid parameter : input_box2" )       
+      
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.y1() <= 
+        ( input_image2_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box2" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_box2.y2() <= 
+        ( input_image2_ptr->params().nlines_ - 1 ) ),
+      "Invalid parameter : input_box2" )        
+  }    
+    
+  /* Checking pixel_x_relation */
+  
+  double pixel_x_relation = 1.0;
+  if( parameters.CheckParameter< double >( "pixel_x_relation" ) ) {
+    parameters.GetParameter( "pixel_x_relation", pixel_x_relation );
+    
+    TEAGN_TRUE_OR_RETURN( ( pixel_x_relation != 0.0 ),
+      "Invalid parameter : pixel_x_relation" )
+  }
+  
+  /* Checking pixel_y_relation */
+  
+  double pixel_y_relation = 1.0;
+  if( parameters.CheckParameter< double >( "pixel_y_relation" ) ) {
+    parameters.GetParameter( "pixel_y_relation", pixel_y_relation );
+    
+    TEAGN_TRUE_OR_RETURN( ( pixel_y_relation != 0.0 ),
+      "Invalid parameter : pixel_y_relation" )
+  }   
+  
+  /* Checking max_tie_points */
+  
+  unsigned int max_tie_points = 0;
+  if( parameters.CheckParameter< unsigned int >( "max_tie_points" ) ) {
+    parameters.GetParameter( "max_tie_points", max_tie_points );
+    
+    TEAGN_TRUE_OR_RETURN( ( max_tie_points > 0 ),
+      "Invalid parameter : max_tie_points" )    
+  }
+  
+  /* Checking corr_sens */
+  
+  double corr_sens = 0;
+  if( parameters.CheckParameter< double >( "corr_sens" ) ) {
+    parameters.GetParameter( "corr_sens", corr_sens );
+    
+    TEAGN_TRUE_OR_RETURN( ( corr_sens > 0.0 ) &&
+      ( corr_sens <= 3.0 ),
+      "Invalid parameter : corr_sens" )
+  }  
+  
+  /* Checking corr_window_width */
+  
+  unsigned int corr_window_width = 0;
+  if( parameters.CheckParameter< unsigned int >( 
+    "corr_window_width" ) ) {
+    
+    parameters.GetParameter( "corr_window_width", 
+      corr_window_width );
+      
+    TEAGN_TRUE_OR_RETURN( ( ( corr_window_width % 2 ) > 0 ),
+      "Invalid parameter : corr_window_width" )      
+    
+    TEAGN_TRUE_OR_RETURN( ( corr_window_width >= 3 ),
+      "Invalid parameter : corr_window_width" )
+  }    
+  
+  /* Checking maximas_sens */
+  
+  double maximas_sens = 0;
+  if( parameters.CheckParameter< double >( "maximas_sens" ) ) {
+    parameters.GetParameter( "maximas_sens", maximas_sens );
+    
+    TEAGN_TRUE_OR_RETURN( ( maximas_sens >= 0.0 ) &&
+      ( maximas_sens <= 1.0 ),
+      "Invalid parameter : maximas_sens" )
+  }   
+  
+  /* Checking out_gt_params */
+  
+  TeGTParams::pointer out_gt_params_ptr;
+  if( parameters.CheckParameter< TeGTParams::pointer >( 
+    "out_gt_params_ptr" ) ) 
+  {
+    parameters.GetParameter( "out_gt_params_ptr", out_gt_params_ptr );
+    
+    TEAGN_TRUE_OR_RETURN( ( out_gt_params_ptr.isActive() ),
+      "Invalid parameter : out_gt_params_ptr" )
+  }    
+  
+  return true;
+}
+
+
+void TePDIOFMatching::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDIOFMatching::loadImage( const TeThreadParameters& params )
+{
+  /* Retriving parameters */
+  
+  TePDITypes::TePDIRasterPtrType input_image_ptr;
+  TEAGN_TRUE_OR_THROW( params.retrive( "input_image_ptr", input_image_ptr ),
+    "Missing thread parameter" )
+    
+  ImgMatrixT* img_matrix_ptr;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_matrix_ptr", img_matrix_ptr ),
+    "Missing thread parameter" )
+    
+  double img_x_rescale_factor = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_x_rescale_factor", 
+    img_x_rescale_factor ), "Missing thread parameter" )
+    
+  double img_y_rescale_factor = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_y_rescale_factor", 
+    img_y_rescale_factor ), "Missing thread parameter" )    
+    
+  unsigned int input_channel = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "input_channel", 
+    input_channel ), "Missing thread parameter" )  
+    
+  unsigned int box_x_off = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_x_off", 
+    box_x_off ), "Missing thread parameter" )  
+
+  unsigned int box_y_off = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_y_off", 
+    box_y_off ), "Missing thread parameter" )      
+    
+  unsigned int box_nlines = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_nlines", 
+    box_nlines ), "Missing thread parameter" )      
+    
+  unsigned int box_ncols = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "box_ncols", 
+    box_ncols ), "Missing thread parameter" )   
+    
+  bool progress_enabled = false;   
+  TEAGN_TRUE_OR_THROW( params.retrive( "progress_enabled", 
+    progress_enabled ), "Missing thread parameter" ) 
+    
+  TeMutex* glb_mem_lock_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "glb_mem_lock_ptr", 
+    glb_mem_lock_ptr ), "Missing thread parameter" )   
+  TeMutex& glb_mem_lock = *glb_mem_lock_ptr;
+         
+  /* Rescaling image */
+  
+  unsigned int nlines = (unsigned int) ceil( 
+    ( (double)box_nlines ) * img_y_rescale_factor );
+  unsigned int ncols = (unsigned int) ceil( 
+    ( (double)box_ncols ) * img_x_rescale_factor );    
+  
+  glb_mem_lock.lock();
+  
+  if( ! img_matrix_ptr->Reset( nlines, ncols, 
+    TePDIMatrix< double >::AutoMemPol ) )
+  {
+    TEAGN_LOGERR( "Unable to allocate space for the loaded image" )
+    glb_mem_lock.unLock();
+    return false;
+  }
+    
+  glb_mem_lock.unLock();
+    
+  unsigned int curr_out_line = 0;
+  unsigned int curr_out_col = 0;
+  unsigned int curr_input_line = 0;
+  unsigned int curr_input_col = 0;
+  double value = 0;
+  
+  TePDIPIManager progress( "Rescaling image", nlines, progress_enabled );
+  
+  for( curr_out_line = 0 ; curr_out_line < nlines ; 
+    ++curr_out_line ) {
+    
+    curr_input_line = 
+      TeRound( 
+        ( 
+          ( (double)curr_out_line ) / img_y_rescale_factor
+        ) 
+        +
+        ( (double) box_y_off )
+      );
+    
+    for( curr_out_col = 0 ; curr_out_col < ncols ; 
+      ++curr_out_col ) {
+      
+      curr_input_col = 
+        TeRound( 
+          ( 
+            ( (double)curr_out_col ) / img_x_rescale_factor
+          ) 
+          +
+          ( (double) box_x_off )
+        );        
+      
+      if( input_image_ptr->getElement( curr_input_col, curr_input_line, value, 
+        input_channel ) ) {
+        
+        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = value;
+      } else {
+        img_matrix_ptr->operator()( curr_out_line, curr_out_col ) = 0;
+      }
+    }
+    
+    TEAGN_FALSE_OR_RETURN( progress.Increment(),
+      "Canceled by the user" );
+  }
+        
+  return true;
+}
+
+
+bool TePDIOFMatching::generateFeatures( 
+  const TeThreadParameters& params )
+{
+  /* Retriving parameters */
+  
+  ImgMatrixT* img_matrix_ptr;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_matrix_ptr", img_matrix_ptr ),
+    "Missing thread parameter" )
+    
+  unsigned int corr_window_width = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "corr_window_width", corr_window_width ),
+    "Missing thread parameter" )
+  TEAGN_DEBUG_CONDITION( ( corr_window_width >= 3 ),
+    "Invalid correlation window width" )    
+  TEAGN_DEBUG_CONDITION( ( ( corr_window_width % 2 ) != 0 ),
+    "Invalid correlation window width" )
+    
+  std::vector< TeCoord2D >* img_maxima_points_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_maxima_points_ptr", 
+    img_maxima_points_ptr ), "Missing thread parameter" )
+    
+  ImgMatrixT* img_features_matrix_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img_features_matrix_ptr", 
+    img_features_matrix_ptr ), "Missing thread parameter" )
+    
+  bool progress_enabled = false;   
+  TEAGN_TRUE_OR_THROW( params.retrive( "progress_enabled", 
+    progress_enabled ), "Missing thread parameter" )     
+    
+  unsigned int max_points = 0;   
+  TEAGN_TRUE_OR_THROW( params.retrive( "max_points", 
+    max_points ), "Missing thread parameter" )  
+    
+  TeMutex* glb_mem_lock_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "glb_mem_lock_ptr", 
+    glb_mem_lock_ptr ), "Missing thread parameter" )   
+  TeMutex& glb_mem_lock = *glb_mem_lock_ptr;   
+  
+  double maximas_sens = 0;   
+  TEAGN_TRUE_OR_THROW( params.retrive( "maximas_sens", 
+    maximas_sens ), "Missing thread parameter" )         
+    
+  /* Filtering image */
+  
+  ImgMatrixT filtered_img_matrix;
+  TEAGN_TRUE_OR_RETURN( gaussianSmoothing( *img_matrix_ptr, 
+    filtered_img_matrix, 1, progress_enabled, glb_mem_lock ),
+    "Error filtering image" )
+    
+  /* Get the least squares surface */
+  
+  ImgMatrixT ls_surface_matrix;
+  TEAGN_TRUE_OR_RETURN( generateLSSurface( 
+    filtered_img_matrix, 
+    ls_surface_matrix, progress_enabled, glb_mem_lock ),
+    "Error getting the least squares surface" )   
+    
+/* remove */    
+//matrix2Tiff( ls_surface_matrix, "ls_surface_matrix.tif",
+//  std::vector< TeCoord2D >() );     
+/* remove */    
+    
+  /* Free unused resources */
+  
+  filtered_img_matrix.Reset();
+
+  /* Get the maxima points */
+  
+  TEAGN_TRUE_OR_RETURN( getMaximaPoints( ls_surface_matrix,
+    *img_maxima_points_ptr, max_points, corr_window_width, 
+    progress_enabled, maximas_sens ),
+    "Error generating maxima points" );
+  TEAGN_DEBUG_CONDITION( ( img_maxima_points_ptr->size() <=
+    max_points ), "Invalid number of generated maxima points" )
+
+/* remove */    
+//matrix2Tiff( *img_matrix_ptr, "croped_img_plus_maximas.tif",
+//  *img_maxima_points_ptr );     
+/* remove */
+    
+  /* Generating the rotated correlation windows matrix */
+  
+  if( img_maxima_points_ptr->size() > 0 ) {
+//    TEAGN_TRUE_OR_RETURN( img_features_matrix_ptr->Reset( 
+//      corr_window_width * corr_window_width, 
+//      img_maxima_points_ptr->size(), ImgMatrixT::RAMMemPol ),
+//      "Error allocating image features matrix" )  
+      
+    TEAGN_TRUE_OR_RETURN( generateCorrWindows( *img_matrix_ptr,
+      corr_window_width, *img_maxima_points_ptr, 
+      *img_features_matrix_ptr, progress_enabled, glb_mem_lock ),
+      "Error generating the correlation windows" )
+  } else {
+    img_features_matrix_ptr->Reset();
+  }
+    
+  return true;
+}
+
+
+bool TePDIOFMatching::gaussianSmoothing( 
+  const ImgMatrixT& input_matrix,
+  ImgMatrixT& output_matrix, 
+  unsigned int iterations,
+  bool progress_enabled,
+  TeMutex& glb_mem_lock )
+{        
+  TEAGN_TRUE_OR_THROW( ( iterations > 0 ), "Invalid iterations" )
+  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetColumns() > 2 ),
+    "Invalid columns number" )
+  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetLines() > 2 ),
+    "Invalid lines number" )   
+    
+  unsigned int nlines = input_matrix.GetLines();
+  unsigned int ncols = input_matrix.GetColumns();
+  unsigned int last_line_index = nlines - 1;
+  unsigned int last_col_index = ncols - 1;  
+  unsigned int curr_line = 0;
+  unsigned int curr_col = 0;   
+    
+  glb_mem_lock.lock();  
+    
+  if( !output_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
+  {
+    TEAGN_LOGERR( "Error reseting matrix" )
+    glb_mem_lock.unLock();
+    return false;
+  }
+    
+  glb_mem_lock.unLock();
+  
+  /* Fill borders with zero */
+  
+  for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
+    output_matrix( curr_line, 0 ) = 0.0;
+    output_matrix( curr_line, last_col_index ) = 0.0;
+  }
+  
+  for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
+    output_matrix( 0, curr_col ) = 0.0;
+    output_matrix( last_line_index, curr_col ) = 0.0;
+  }  
+  
+  /* Smoothing */
+  
+  TePDIPIManager progress( "Filtering image", nlines - 2, progress_enabled );
+  
+  for( curr_line = 1 ; curr_line < last_line_index ; ++curr_line ) {
+    for( curr_col = 1 ; curr_col < last_col_index ; ++curr_col ) {
+      output_matrix( curr_line, curr_col ) = 
+        ( 
+          input_matrix( curr_line - 1, curr_col ) +
+          ( 4.0 * input_matrix( curr_line, curr_col ) ) +
+          input_matrix( curr_line + 1, curr_col ) +
+          input_matrix( curr_line, curr_col - 1 ) +
+          input_matrix( curr_line, curr_col + 1 )        
+        ) / 8.0;
+    }
+    
+    TEAGN_FALSE_OR_RETURN( progress.Increment(),
+      "Canceled by the user" );
+  }
+  
+  return true;
+}
+
+
+bool TePDIOFMatching::generateLSSurface( 
+  const ImgMatrixT& input_matrix,
+  ImgMatrixT& ls_surface_matrix, 
+  bool progress_enabled,
+  TeMutex& glb_mem_lock )
+{        
+  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetColumns() > 2 ),
+    "Invalid columns number" )
+  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetLines() > 2 ),
+    "Invalid lines number" )   
+    
+  const unsigned int nlines = input_matrix.GetLines();
+  const unsigned int ncols = input_matrix.GetColumns();
+  
+  TePDIPIManager progress( "Creating LS surface",
+    ( nlines - 2 ) + ( 9 * ( nlines - 2 ) ) + nlines, 
+    progress_enabled );
+
+  /* Creating gx and gy */
+  
+  glb_mem_lock.lock();
+  
+  ImgMatrixT gx_matrix;
+  if( ! gx_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
+  {
+    TEAGN_LOGERR( "Error reseting matrix" )
+    glb_mem_lock.unLock();
+    return false;
+  }
+  
+  ImgMatrixT gy_matrix;
+  if( ! gy_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
+  {
+    TEAGN_LOGERR( "Error reseting matrix" )
+    glb_mem_lock.unLock();
+    return false;
+  }
+    
+  glb_mem_lock.unLock();
+  
+  {
+    unsigned int curr_line = 0;
+    unsigned int curr_col = 0; 
+    const unsigned int last_line_index = nlines - 1;
+    const unsigned int last_col_index = ncols - 1;      
+    
+    /* Border fill */
+    
+    for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
+      gx_matrix( curr_line, 0 ) = 0.0;
+      gx_matrix( curr_line, last_col_index ) = 0.0;
+      
+      gy_matrix( curr_line, 0 ) = 0.0;
+      gy_matrix( curr_line, last_col_index ) = 0.0;      
+    }
+    for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
+      gx_matrix( 0, curr_col ) = 0.0;
+      gx_matrix( last_line_index, curr_col ) = 0.0;
+      
+      gy_matrix( 0, curr_col ) = 0.0;
+      gy_matrix( last_line_index, curr_col ) = 0.0;
+    }  
+    
+    /* Calculating values */
+    
+    for( curr_line = 1 ; curr_line < last_line_index ; ++curr_line ) { 
+      for( curr_col = 1 ; curr_col < last_col_index ; ++curr_col ) { 
+        gx_matrix( curr_line, curr_col ) =
+          ( input_matrix( curr_line + 1, curr_col ) -
+            input_matrix( curr_line - 1, curr_col ) 
+          ) / 2.0;
+          
+        gy_matrix( curr_line, curr_col ) =
+          ( input_matrix( curr_line, curr_col + 1 ) -
+            input_matrix( curr_line, curr_col - 1 ) 
+          ) / 2.0;          
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" );
+    }
+  }  
+  
+  /* Creating gxx and gxy and gyy */
+  
+  glb_mem_lock.lock();
+  
+  ImgMatrixT gxx_matrix;
+  if( ! gxx_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
+  {
+    TEAGN_LOGERR( "Error reseting matrix" )
+    glb_mem_lock.unLock();
+    return false;
+  }
+  
+  ImgMatrixT gxy_matrix;
+  if( ! gxy_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
+  {
+    TEAGN_LOGERR( "Error reseting matrix" )
+    glb_mem_lock.unLock();
+    return false;
+  }
+  
+  ImgMatrixT gyy_matrix;
+  if( ! gyy_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
+  {
+    TEAGN_LOGERR( "Error reseting matrix" ) 
+    glb_mem_lock.unLock();
+    return false;
+  }
+    
+  glb_mem_lock.unLock();
+     
+  {
+    /* zero fill */
+    
+    {
+      unsigned int curr_line = 0;
+      unsigned int curr_col = 0; 
+      
+      for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
+        for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
+          gxx_matrix( curr_line, curr_col ) = 0.0;
+          gxy_matrix( curr_line, curr_col ) = 0.0;
+          gyy_matrix( curr_line, curr_col ) = 0.0;
+        }
+      }
+    }
+    
+    /* Allocating p matrix */
+    
+    glb_mem_lock.lock();
+    
+    ImgMatrixT p_matrix;
+    if( ! p_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
+    {
+      TEAGN_LOGERR( "Error reseting matrix" ) 
+      glb_mem_lock.unLock();
+      return false;
+    }
+      
+    glb_mem_lock.unLock();       
+    
+    /* iterating over the optical flow displacement */
+    
+    int curr_line_offset = 0;
+    int curr_col_offset = 0;
+    unsigned int curr_line = 0;
+    unsigned int curr_col = 0;
+    unsigned int curr_line_bound = 0;
+    unsigned int curr_col_bound = 0;    
+    
+    for( curr_line_offset = -1 ; curr_line_offset < 2 ; 
+      ++curr_line_offset ) { 
+      
+      for( curr_col_offset = -1 ; curr_col_offset < 2 ; 
+        ++curr_col_offset ) { 
+        
+        /* fill p matrix with ones */
+      
+        for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
+          for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
+            p_matrix( curr_line, curr_col ) = 1.0;
+          }
+        }
+        
+        /* updating p matrix */
+        
+        curr_line_bound = nlines - 1;
+        curr_col_bound = ncols - 1;
+      
+        for( curr_line = 1 ; curr_line < curr_line_bound ; ++curr_line ) {
+          for( curr_col = 1 ; curr_col < curr_col_bound ; ++curr_col ) {
+            p_matrix( curr_line, curr_col ) = 
+              ( gx_matrix( curr_line, curr_col ) * gx_matrix( curr_line + 
+                curr_line_offset, curr_col + curr_col_offset ) ) +
+              ( gy_matrix( curr_line, curr_col ) * gy_matrix( curr_line +
+                curr_line_offset, curr_col + curr_col_offset ) );
+              
+          }
+        }
+        
+        for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
+          for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
+            if( p_matrix( curr_line, curr_col ) < 0.0 ) {
+              p_matrix( curr_line, curr_col ) = 0.0;
+            }
+          }
+        }   
+        
+        /* Generating gxx, gxy and gyy */
+        
+        curr_line_bound = nlines - 1;
+        curr_col_bound = ncols - 1;
+      
+        for( curr_line = 1 ; curr_line < curr_line_bound ; ++curr_line ) {
+          for( curr_col = 1 ; curr_col < curr_col_bound ; ++curr_col ) {
+            gxx_matrix( curr_line, curr_col ) = 
+              gxx_matrix( curr_line, curr_col ) +
+              ( p_matrix( curr_line, curr_col ) * gx_matrix( curr_line + 
+              curr_line_offset, curr_col + curr_col_offset ) *
+              gx_matrix( curr_line + curr_line_offset, curr_col + 
+              curr_col_offset ) ) ;
+              
+            gxy_matrix( curr_line, curr_col ) = 
+              gxy_matrix( curr_line, curr_col ) +
+              ( p_matrix( curr_line, curr_col ) * gx_matrix( curr_line + 
+              curr_line_offset, curr_col + curr_col_offset ) *
+              gy_matrix( curr_line + curr_line_offset, curr_col + 
+              curr_col_offset ) ) ;              
+              
+            gyy_matrix( curr_line, curr_col ) = 
+              gyy_matrix( curr_line, curr_col ) +
+              ( p_matrix( curr_line, curr_col ) * gy_matrix( curr_line + 
+              curr_line_offset, curr_col + curr_col_offset ) *
+              gy_matrix( curr_line + curr_line_offset, curr_col + 
+              curr_col_offset ) ) ;              
+          }
+          
+          TEAGN_FALSE_OR_RETURN( progress.Increment(),
+            "Canceled by the user" );
+        }        
+      }
+    }
+  }    
+  
+  /* Creating the ls surface matrix */
+  {
+    glb_mem_lock.lock();
+    
+    if( ! ls_surface_matrix.Reset( nlines, ncols, ImgMatrixT::AutoMemPol ) )
+    {
+      TEAGN_LOGERR( "Error reseting matrix" )
+      glb_mem_lock.unLock();
+      return false;
+    }
+      
+    glb_mem_lock.unLock();
+      
+    unsigned int curr_line = 0;
+    unsigned int curr_col = 0;          
+    double div_value = 0;
+  
+    for( curr_line = 0 ; curr_line < nlines ; ++curr_line ) {
+      for( curr_col = 0 ; curr_col < ncols ; ++curr_col ) {
+        div_value = sqrt( ( gxx_matrix( curr_line, curr_col ) *
+          gxx_matrix( curr_line, curr_col ) ) + ( gyy_matrix( curr_line,
+          curr_col ) * gyy_matrix( curr_line, curr_col ) ) +
+          ( 2.0 * gxy_matrix( curr_line, curr_col ) * 
+          gxy_matrix( curr_line, curr_col ) ) )
+          *
+          sqrt( gxx_matrix( curr_line, curr_col ) +
+            gyy_matrix( curr_line, curr_col ) );
+        
+        if( div_value == 0.0 ) {
+          ls_surface_matrix( curr_line, curr_col ) = 
+            ( -1.0 ) * DBL_MAX;
+        } else {
+          ls_surface_matrix( curr_line, curr_col ) =
+            ABS( ( gxx_matrix( curr_line, curr_col ) * gyy_matrix( 
+            curr_line, curr_col ) ) - ( gxy_matrix( curr_line,
+            curr_col ) * gxy_matrix( curr_line, curr_col ) ) ) / 
+            div_value;
+        }
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" );
+    }  
+  }
+  
+  return true;
+}
+
+
+void TePDIOFMatching::matrix2Tiff( 
+  const ImgMatrixT& input_matrix,
+  const std::string& out_file_name,
+  const std::vector< TeCoord2D >& maxima_points )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.GetLines() > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_matrix.GetColumns() > 0 ), 
+    "Invalid matrix cols" )
+    
+  /* Finding min and max */
+  const double dbl_max = DBL_MAX;
+  const double dbl_min = (-1.0) * dbl_max;
+  double mtx_min = dbl_max;
+  double mtx_max = dbl_min;
+  double mtx_diff = 1.0;
+  
+  {
+    for( unsigned int line = 0 ; 
+      line < input_matrix.GetLines() ; ++line ) 
+    {
+      for( unsigned int col = 0 ; 
+        col < input_matrix.GetColumns() ; 
+        ++col ) 
+      {
+        if( ( input_matrix( line, col ) > dbl_min ) &&
+          ( input_matrix( line, col ) < dbl_max ) )
+        {
+          if( input_matrix( line, col ) < mtx_min )
+          {
+            mtx_min = input_matrix( line, col );
+          } 
+          
+          if( input_matrix( line, col ) > mtx_max )
+          {
+            mtx_max = input_matrix( line, col );
+          }
+        }
+      }  
+    }
+    
+    if( mtx_max != mtx_min )
+    {
+      mtx_diff = mtx_max - mtx_min;
+    } 
+  }
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_matrix.GetLines(),
+    input_matrix.GetColumns() );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  
+  for( unsigned int line = 0 ; 
+    line < input_matrix.GetLines() ; ++line ) {
+    for( unsigned int col = 0 ; 
+      col < input_matrix.GetColumns() ; 
+      ++col ) {
+
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        ( ( input_matrix( line, col ) - mtx_min ) / mtx_diff ) * 255.0, 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw maxima points */
+  
+  std::vector< TeCoord2D >::const_iterator maximas_it = 
+    maxima_points.begin();
+  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
+    maxima_points.end();
+    
+  while( maximas_it != maximas_it_end ) {
+    int x = TeRound( maximas_it->x() );
+    TEAGN_TRUE_OR_THROW( ( x < (int)input_matrix.GetColumns() ),
+      "Invalid maxima column" )
+    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+      "Invalid maxima column" )      
+    
+    int y = TeRound( maximas_it->y() );
+    TEAGN_TRUE_OR_THROW( ( y < (int)input_matrix.GetLines() ),
+      "Invalid maxima line" )
+    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+      "Invalid maxima line" )      
+    
+    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+      255.0, 0 ),
+      "Error writing raster" )
+      
+    ++maximas_it;
+  }  
+}
+
+
+void TePDIOFMatching::raster2Tiff( 
+  const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+  unsigned int raster_channel,
+  const std::string& out_file_name,
+  const std::vector< TeCoord2D >& maxima_points,
+  const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
+  unsigned int tie_points_space )
+{   
+  TEAGN_TRUE_OR_THROW( ( ! out_file_name.empty() ), 
+    "Invalid file name" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().nlines_ > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( input_raster_ptr->params().ncols_ > 0 ), 
+    "Invalid matrix cols" )
+    
+  TeRasterParams params;
+  params.setNLinesNColumns( input_raster_ptr->params().nlines_,
+    input_raster_ptr->params().ncols_ );
+  params.nBands( 1 );
+  params.setDataType( TeUNSIGNEDCHAR, -1 );
+  params.nBands( 1 );
+  params.decoderIdentifier_ = "TIF";
+  params.mode_ = 'c';
+  params.fileName_ = out_file_name;
+  
+  TeRaster out_raster( params );
+  TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+  double value = 0;
+  
+  for( int line = 0 ; 
+    line < input_raster_ptr->params().nlines_ ; ++line ) {
+    for( int col = 0 ; 
+      col < input_raster_ptr->params().ncols_ ; 
+      ++col ) {
+      
+      input_raster_ptr->getElement( col, line, value, 
+        raster_channel );
+      
+
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+        value, 0 ),
+        "Error writing raster" )
+    }  
+  }
+  
+  /* Draw maxima points */
+  
+  std::vector< TeCoord2D >::const_iterator maximas_it = 
+    maxima_points.begin();
+  std::vector< TeCoord2D >::const_iterator maximas_it_end = 
+    maxima_points.end();
+    
+  while( maximas_it != maximas_it_end ) {
+    int x = TeRound( maximas_it->x() );
+    TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
+      "Invalid maxima column" )
+    TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+      "Invalid maxima column" )      
+    
+    int y = TeRound( maximas_it->y() );
+    TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
+      "Invalid maxima line" )
+    TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+      "Invalid maxima line" )      
+    
+    TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+      255.0, 0 ),
+      "Error writing raster" )
+      
+    ++maximas_it;
+  }
+  
+  /* Draw tie-points */
+  
+  if( out_tie_points_ptr.isActive() ) {
+    TeCoordPairVect::iterator it = out_tie_points_ptr->begin();
+    TeCoordPairVect::iterator it_end = out_tie_points_ptr->end();
+    
+    while( it != it_end ) {
+      int x = 0;
+      int y = 0;
+      
+      if( tie_points_space == 0 ) {
+         x = TeRound( it->pt1.x() );
+         y = TeRound( it->pt1.y() );
+      } else {
+         x = TeRound( it->pt2.x() );
+         y = TeRound( it->pt2.y() );
+      }
+      
+      TEAGN_TRUE_OR_THROW( ( x < input_raster_ptr->params().ncols_ ),
+        "Invalid maxima column" )
+      TEAGN_TRUE_OR_THROW( ( x >= 0 ),
+        "Invalid maxima column" )      
+      TEAGN_TRUE_OR_THROW( ( y < input_raster_ptr->params().nlines_ ),
+        "Invalid maxima line" )
+      TEAGN_TRUE_OR_THROW( ( y >= 0 ),
+        "Invalid maxima line" )      
+      
+      TEAGN_TRUE_OR_THROW( out_raster.setElement( x, y, 
+        255.0, 0 ),
+        "Error writing raster" )    
+    
+      ++it;
+    }
+  
+  }
+}
+
+
+bool TePDIOFMatching::getMaximaPoints( 
+  const ImgMatrixT& input_matrix,
+  std::vector< TeCoord2D >& maxima_points,
+  unsigned int max_points, unsigned int corr_window_width,
+  bool progress_enabled, double maximas_sens )
+{
+  maxima_points.clear();
+  
+  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetLines() > 0 ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_RETURN( ( input_matrix.GetColumns() > 0 ), 
+    "Invalid matrix cols" )
+  TEAGN_DEBUG_CONDITION( ( max_points > 0 ), 
+    "Invalid number of maximum maxima points" )
+  TEAGN_DEBUG_CONDITION( ( corr_window_width >= 3 ), 
+    "Invalid correlation window width" )
+  TEAGN_DEBUG_CONDITION( 
+    ( maximas_sens >= 0.0 ) && ( maximas_sens <= 10.0 ), 
+    "Invalid maximas_sens" )    
+    
+  /* The radius of a windows rotated by 90 degrees. */
+  const unsigned int rotated_window_radius = (unsigned int)
+    (
+      ceil( 
+        sqrt( 
+          2 * 
+          ( ( (double)corr_window_width ) * 
+            ( (double)corr_window_width ) 
+          )
+        ) / 2.0
+      )
+    );
+  const unsigned int rotated_window_diam = 1 + ( 2 *
+    rotated_window_radius );
+    
+  /* Checking if the current rotated correlation window width 
+     fits inside the current image */
+     
+  const unsigned int total_lines = input_matrix.GetLines();
+  const unsigned int total_cols = input_matrix.GetColumns();
+
+  if( total_lines <= rotated_window_diam ) {
+    return true;
+  }
+  if( total_cols <= rotated_window_diam ) {
+    return true;
+  }    
+  
+  const unsigned int max_blks_per_line = total_cols - 
+    rotated_window_diam;
+  const unsigned int max_blks_per_col = total_lines - 
+    rotated_window_diam;   
+  
+  /* Calc block dimentions */
+  
+  unsigned int blocks_per_line_col = 
+    MIN( (unsigned int)floor( sqrt( (double)max_points ) ), 
+      MIN( max_blks_per_line, max_blks_per_col ) );
+  
+  if( blocks_per_line_col == 0 )
+  {
+    return true;
+  }
+  
+  unsigned int block_width = (unsigned int)
+    ceil(
+      ((double)( total_cols - rotated_window_diam ) ) 
+      / 
+      ((double) blocks_per_line_col )
+    );
+  unsigned int block_height = (unsigned int)
+    ceil(
+      ((double)( total_lines - rotated_window_diam ) ) 
+      / 
+      ((double) blocks_per_line_col )
+    );
+    
+  TEAGN_DEBUG_CONDITION( ( block_width > 0 ), 
+    "Invalid block width" )
+  TEAGN_DEBUG_CONDITION( ( block_height > 0 ), 
+    "Invalid block height" )
+  
+  /* Looking maximas */
+  
+  const double dbl_max = DBL_MAX;
+  const double dbl_min = dbl_max * (-1.0);  
+  
+  std::vector< TeCoord2D > internal_maxima_points;
+  internal_maxima_points.reserve( blocks_per_line_col * 
+    blocks_per_line_col );
+  
+  std::vector< double > maxima_points_blkmean_diffs;
+  maxima_points_blkmean_diffs.reserve( blocks_per_line_col * 
+    blocks_per_line_col );
+  double maxima_points_blkmean_diffs_max = dbl_min;
+  double maxima_points_blkmean_diffs_min = dbl_max;
+    
+  unsigned int curr_block_start_line = 0;
+  unsigned int curr_block_start_col = 0;
+  unsigned int curr_block_line_bound = 0;
+  unsigned int curr_block_col_bound = 0;
+  unsigned int curr_line = 0;
+  unsigned int curr_col = 0;
+  
+  unsigned int block_maxima_col = 0;
+  unsigned int block_maxima_line = 0;  
+  double block_maxima_val = 0.0;
+  
+  unsigned int curr_horiz_block = 0;
+  unsigned int curr_vert_block = 0;
+  const unsigned int cols_bound = total_cols - 
+   rotated_window_radius;
+  const unsigned int lines_bound = total_lines - 
+   rotated_window_radius;
+   
+  double blk_mean = 0.0;
+  double blk_mean_diff = 0.0;   
+  
+  TePDIPIManager progress( "Finding maxima points",
+    blocks_per_line_col, progress_enabled );  
+    
+  for( curr_vert_block = 0 ; curr_vert_block < blocks_per_line_col ;
+    ++curr_vert_block ) {
+    
+    curr_block_start_line = rotated_window_radius +
+      ( curr_vert_block * block_height );
+    curr_block_line_bound = MIN( curr_block_start_line + block_height,
+      lines_bound );
+    
+    for( curr_horiz_block = 0 ; curr_horiz_block < blocks_per_line_col ;
+      ++curr_horiz_block ) {
+      
+      curr_block_start_col = rotated_window_radius +
+        ( curr_horiz_block * block_width );
+      curr_block_col_bound = MIN( curr_block_start_col + block_width,
+        cols_bound );  
+      
+      block_maxima_val = dbl_min;
+      blk_mean = 0.0;
+      blk_mean_diff = 0.0;
+      
+      for( curr_line = curr_block_start_line ;
+        curr_line < curr_block_line_bound ; ++curr_line ) {
+        for( curr_col = curr_block_start_col ;
+          curr_col < curr_block_col_bound ; ++curr_col ) {
+          
+          const double& curr_value = input_matrix( curr_line, 
+            curr_col );
+            
+          if( ( curr_value > dbl_min ) && ( curr_value < dbl_max ) )
+          {
+            blk_mean += curr_value;
+            
+            if( curr_value >= block_maxima_val ) {
+             
+              block_maxima_val = curr_value;
+              block_maxima_col = curr_col;
+              block_maxima_line = curr_line;
+            }            
+          }
+        }
+      }
+      
+      if( block_maxima_val != dbl_min )
+      {
+        blk_mean /= (double)( 
+          ( curr_block_line_bound - curr_block_start_line ) *
+          ( curr_block_col_bound - curr_block_start_col ) );
+        
+        blk_mean_diff = block_maxima_val - blk_mean;
+          
+        maxima_points_blkmean_diffs.push_back( blk_mean_diff );
+          
+        if( maxima_points_blkmean_diffs_max < blk_mean_diff )
+        {
+          maxima_points_blkmean_diffs_max = blk_mean_diff;
+        }
+        
+        if( maxima_points_blkmean_diffs_min > blk_mean_diff )
+        {
+          maxima_points_blkmean_diffs_min = blk_mean_diff;
+        }        
+        
+        internal_maxima_points.push_back( TeCoord2D( block_maxima_col, 
+          block_maxima_line ) );
+      }
+    }
+    
+    TEAGN_FALSE_OR_RETURN( progress.Increment(),
+      "Canceled by the user" );
+  }
+  
+  /* Post-selecting maxima points by the difference to blocks mean */
+  
+  double mean_diff_lim = ( ( maxima_points_blkmean_diffs_max -
+    maxima_points_blkmean_diffs_min ) * maximas_sens ) +
+    maxima_points_blkmean_diffs_min;
+    
+  maxima_points.reserve( blocks_per_line_col * 
+    blocks_per_line_col );
+        
+  for( unsigned int imp_idx = 0 ; imp_idx < internal_maxima_points.size() ;
+    ++imp_idx )
+  {
+    if( maxima_points_blkmean_diffs[ imp_idx ] >= mean_diff_lim )
+    {
+      maxima_points.push_back( internal_maxima_points[ imp_idx ] );
+    }
+  }
+  
+  return true;
+}
+
+
+bool TePDIOFMatching::generateCorrWindows( 
+  const ImgMatrixT& img_matrix,
+  unsigned int corr_window_width,
+  const std::vector< TeCoord2D >& img_maxima_points,
+  ImgMatrixT& img_features_matrix,
+  bool progress_enabled,
+  TeMutex& glb_mem_lock )
+{
+  TEAGN_TRUE_OR_THROW( img_matrix.GetColumns() *
+    img_matrix.GetLines() > 0,
+    "Invalid ls matrix" )
+  TEAGN_TRUE_OR_THROW( ( ( corr_window_width % 2 ) > 0 ),
+    "Invalid corr_window_width" )    
+  TEAGN_TRUE_OR_THROW( ( corr_window_width >= 3 ),
+    "Invalid corr_window_width" )      
+    
+  if( img_maxima_points.size() == 0 ) {
+    img_features_matrix.Reset();
+  } else {
+  /* Generating the image features */
+
+    /* each line is a stacked version of one rotated correlation 
+       window */
+       
+    glb_mem_lock.lock();
+    
+    if( ! img_features_matrix.Reset( img_maxima_points.size(),
+      corr_window_width * corr_window_width,
+      ImgMatrixT::RAMMemPol ) )
+    {
+      TEAGN_LOGERR( "Error allocating image features matrix" )
+      glb_mem_lock.unLock();
+      return false;
+    }
+      
+    glb_mem_lock.unLock();
+      
+    /* variables related to the current window over the hole image */
+    unsigned int curr_window_x_start = 0;
+    unsigned int curr_window_y_start = 0;
+    unsigned int curr_window_x_center = 0;
+    unsigned int curr_window_y_center = 0;
+    unsigned int curr_window_x_bound = 0;
+    unsigned int curr_window_y_bound = 0;
+    
+    /*used on the rotation calcule */
+    const unsigned int wind_radius = corr_window_width / 2;
+    const double wind_radius_double = (double)wind_radius;
+    const unsigned int img_features_matrix_cols = 
+      img_features_matrix.GetColumns();
+    unsigned int curr_x = 0;
+    unsigned int curr_y = 0;
+    double curr_x_minus_radius = 0;
+    double curr_y_minus_radius = 0;
+    unsigned int curr_offset = 0;
+    double int_x_dir = 0;
+    double int_y_dir = 0;
+    double int_norm = 0;
+    double rotated_curr_x = 0;/* rotaded coord - window ref */
+    double rotated_curr_y = 0;/* rotaded coord - window ref */
+    
+     /* the found rotation parameters */
+    double rot_cos = 0;
+    double rot_sin = 0;
+    
+    /* the coords rotated but in the hole image reference */
+    int rotated_curr_x_img = 0;
+    int rotated_curr_y_img = 0;
+    
+    /* current window mean and standart deviation */
+    double curr_wind_mean = 0.0;
+    double curr_wind_stddev = 0.0;
+    double curr_wind_stddev_aux = 0.0;
+    
+    TePDIPIManager progress( "Generating correlation windows",
+      img_maxima_points.size(), progress_enabled );     
+      
+    for( unsigned int img_maximas_index = 0 ; 
+      img_maximas_index < img_maxima_points.size() ; 
+      ++img_maximas_index ) {
+      
+      /* Calculating the current window position */
+     
+      curr_window_x_center = 
+        (unsigned int)img_maxima_points[ img_maximas_index ].x();
+      curr_window_y_center = 
+        (unsigned int)img_maxima_points[ img_maximas_index ].y();
+      curr_window_x_start = curr_window_x_center - wind_radius;
+      curr_window_y_start = curr_window_y_center - wind_radius;
+      curr_window_x_bound = curr_window_x_start + 
+        corr_window_width;
+      curr_window_y_bound = curr_window_y_start + 
+        corr_window_width;
+        
+      /* Estimating the intensity vector X direction */
+      
+      for( curr_offset = 0 ; curr_offset < wind_radius ;
+        ++curr_offset ) {      
+
+        for( curr_y = curr_window_y_start ; 
+          curr_y < curr_window_y_bound ;
+          ++curr_y ) {
+        
+          int_x_dir += 
+            img_matrix( curr_y, curr_window_x_bound - 1 - 
+              curr_offset ) - 
+            img_matrix( curr_y, 
+              curr_window_x_start + curr_offset );
+        }
+      }
+      
+      int_x_dir /= ( 2.0 * ( (double) wind_radius ) );
+      
+      /* Estimating the intensity vector y direction */
+      
+      for( curr_offset = 0 ; curr_offset < wind_radius ;
+        ++curr_offset ) {      
+
+        for( curr_x = curr_window_x_start ; 
+          curr_x < curr_window_x_bound ;
+          ++curr_x ) {
+        
+          int_y_dir += 
+            img_matrix( curr_window_y_start + curr_offset,
+              curr_x ) - 
+            img_matrix( curr_window_y_bound - 1 -
+              curr_offset, curr_x );
+        }
+      }      
+      
+      int_y_dir /= ( 2.0 * ( (double) wind_radius ) );
+      
+      /* Calculating the rotation parameters - 
+         counterclockwise rotation 
+         
+         | u |    |cos  -sin|   |X|
+         | v | == |sin   cos| x |Y|
+      */
+      int_norm = sqrt( ( int_x_dir * int_x_dir ) + 
+        ( int_y_dir * int_y_dir ) );
+      
+      if( int_norm != 0.0 ) {
+        rot_cos = int_x_dir / int_norm;
+        rot_sin = int_y_dir / int_norm;
+      } else {
+        /* No rotation */
+        rot_cos = 1.0;
+        rot_sin = 0.0;
+      }
+      
+      
+/* remove */
+//rot_cos = cos( M_PI_4 );
+//rot_sin = sin( M_PI_4 );
+//if( ( curr_window_x_center = 366 ) &&
+//  ( curr_window_y_center == 641 ) ) {
+//  double angle = atan( rot_sin / rot_cos );
+//  angle = angle + 1.0;
+//}
+//double angle = atan( rot_sin / rot_cos );
+/* remove */      
+      
+      
+      
+      /* Generating the rotated window data and inserting it into 
+         the img_features_matrix by setting the intensity vector
+         to the direction (1,0) by a clockwise rotation
+         using the inverse matrix 
+      
+         | u |    |cos   sin|   |X|
+         | v | == |-sin  cos| x |Y|
+      */
+         
+      for( curr_y = 0 ; curr_y < corr_window_width ; ++curr_y ) {
+        for( curr_x = 0 ; curr_x < corr_window_width ; ++curr_x ) {
+          /* briging the window to the coord system center */
+          
+          curr_x_minus_radius = ((double)curr_x) - 
+            wind_radius_double;
+          curr_y_minus_radius = ((double)curr_y) - 
+            wind_radius_double;
+          
+          /* rotating the centered window */
+          
+          rotated_curr_x = 
+            ( ( rot_cos * curr_x_minus_radius ) + 
+            ( rot_sin * curr_y_minus_radius ) );
+          
+          rotated_curr_y =
+            ( ( -1.0 * rot_sin * curr_x_minus_radius ) + 
+            ( rot_cos * curr_y_minus_radius ) );
+            
+          /* bringing the window back to its original
+             centered location */ 
+            
+          rotated_curr_x += wind_radius_double;
+          rotated_curr_y += wind_radius_double;
+          
+          /* copy the new rotated window to the output vector */
+            
+          rotated_curr_x_img = curr_window_x_start +
+            TeRound( rotated_curr_x );
+          rotated_curr_y_img = curr_window_y_start +
+            TeRound( rotated_curr_y );                        
+           
+          TEAGN_DEBUG_CONDITION( ( rotated_curr_x_img > 0 ), "" )
+          TEAGN_DEBUG_CONDITION( ( rotated_curr_x_img < 
+            (int)img_matrix.GetColumns() ), "" )
+          TEAGN_DEBUG_CONDITION( ( rotated_curr_y_img > 0 ), "" )
+          TEAGN_DEBUG_CONDITION( ( rotated_curr_y_img < 
+            (int)img_matrix.GetLines() ), "" )
+            
+          img_features_matrix( img_maximas_index, ( curr_y * 
+            corr_window_width ) + curr_x ) =
+            img_matrix( rotated_curr_y_img, rotated_curr_x_img );
+
+        }
+      }
+      
+      
+/* remove - skipping normalizing */
+//continue;
+/* remove */      
+      
+      
+      /* Normalizing the generated window by subtracting its mean
+         and dividing by its standard deviation */
+      
+      curr_wind_mean = 0.0;
+      
+      for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
+        ++curr_x ) {
+        
+        curr_wind_mean += img_features_matrix( img_maximas_index,
+          curr_x );
+      }
+      
+      curr_wind_mean /= ( (double)img_features_matrix_cols  );
+      
+      curr_wind_stddev = 0.0;  
+      
+      for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
+        ++curr_x ) {
+        
+        curr_wind_stddev_aux = img_features_matrix( 
+          img_maximas_index, curr_x ) - curr_wind_mean;
+          
+        curr_wind_stddev += ( curr_wind_stddev_aux *
+          curr_wind_stddev_aux );
+      }      
+      
+      curr_wind_stddev /= ( (double)img_features_matrix_cols  );
+      curr_wind_stddev = sqrt( curr_wind_stddev );
+      
+      if( curr_wind_stddev == 0.0 ) {
+        for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
+          ++curr_x ) {
+          
+          double& curr_value = img_features_matrix( 
+            img_maximas_index, curr_x );
+          
+          curr_value -= curr_wind_mean;
+        } 
+      } else {
+        for( curr_x = 0 ; curr_x < img_features_matrix_cols ; 
+          ++curr_x ) {
+          
+          double& curr_value = img_features_matrix( 
+            img_maximas_index, curr_x );
+          
+          curr_value -= curr_wind_mean;
+          curr_value /= curr_wind_stddev;
+        }
+      }
+      
+      /* Finished !! */
+     
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" );
+    }
+  }    
+  
+  return true;
+}
+
+
+void TePDIOFMatching::features2Tiff( 
+  unsigned int corr_window_width,
+  const std::vector< TeCoord2D >& img_maxima_points,
+  ImgMatrixT& img_features_matrix,
+  const std::string& filenameaddon )
+{
+  TEAGN_TRUE_OR_THROW( ( img_features_matrix.GetLines() ==
+    img_maxima_points.size() ), 
+    "Invalid matrix lines" )
+  TEAGN_TRUE_OR_THROW( ( img_features_matrix.GetColumns() ==
+    ( corr_window_width * corr_window_width ) ), 
+    "Invalid matrix columns" )
+  TEAGN_TRUE_OR_THROW( ( corr_window_width > 0 ),
+    "Invalid corr_window_width" )      
+
+  for( unsigned int curr_wind_index = 0 ; 
+    curr_wind_index < img_features_matrix.GetLines() ;
+    ++curr_wind_index ) {
+    
+    TeRasterParams params;
+    params.setNLinesNColumns( corr_window_width,
+      corr_window_width );
+    params.nBands( 1 );
+    params.setDataType( TeDOUBLE, -1 );
+    params.nBands( 1 );
+    params.decoderIdentifier_ = "TIF";
+    params.mode_ = 'c';
+    params.fileName_ = Te2String( img_maxima_points[ 
+      curr_wind_index ].x(), 0 ) + "_" + Te2String( 
+      img_maxima_points[ curr_wind_index ].y(), 0 ) + 
+      "_" + filenameaddon + ".tif";
+    
+    TeRaster out_raster( params );
+    TEAGN_TRUE_OR_THROW( out_raster.init(), "Error init raster" );
+    
+    for( unsigned int line = 0 ; line < corr_window_width ; ++line ) {
+      for( unsigned int col = 0 ; col < corr_window_width ; ++col ) {
+
+        TEAGN_TRUE_OR_THROW( out_raster.setElement( col, line, 
+          img_features_matrix( curr_wind_index, ( line * 
+          corr_window_width ) + col ), 0 ), "Error writing raster" )
+      }  
+    }    
+  }
+}
+
+
+bool TePDIOFMatching::locateBestFeaturesMatching( 
+  const TeThreadParameters& params )
+{
+  /* Retriving parameters */
+  
+  std::vector< unsigned int >* features2_indexes_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "features2_indexes_ptr", 
+    features2_indexes_ptr ),
+    "Missing thread parameter" )
+  std::vector< unsigned int >& features2_indexes = *features2_indexes_ptr;    
+
+  std::vector< unsigned int >* features1_indexes_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "features1_indexes_ptr", 
+    features1_indexes_ptr ),
+    "Missing thread parameter" )
+  std::vector< unsigned int >& features1_indexes = *features1_indexes_ptr;
+  
+  TeMutex* globalMutexPtr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "global_mutex_ptr", 
+    globalMutexPtr ),
+    "Missing thread parameter" )
+  TeMutex& globalMutex = *globalMutexPtr;  
+
+  ImgMatrixT* img1_features_matrix_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img1_features_matrix_ptr", 
+    img1_features_matrix_ptr ),
+    "Missing thread parameter" )
+  ImgMatrixT& img1_features_matrix =
+    *img1_features_matrix_ptr;
+    
+  ImgMatrixT* img2_features_matrix_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "img2_features_matrix_ptr", 
+    img2_features_matrix_ptr ),
+    "Missing thread parameter" )
+  ImgMatrixT& img2_features_matrix =
+    *img2_features_matrix_ptr;
+    
+  bool progress_enabled = false;   
+  TEAGN_TRUE_OR_THROW( params.retrive( "progress_enabled", 
+    progress_enabled ), "Missing thread parameter" )     
+    
+  double corr_sens = 0;   
+  TEAGN_TRUE_OR_THROW( params.retrive( "corr_sens", 
+    corr_sens ), "Missing thread parameter" )  
+    
+  TEAGN_DEBUG_CONDITION( ( img2_features_matrix.GetColumns() ==
+    img1_features_matrix.GetColumns() ),
+     "Size columns mismatch" )        
+    
+  /* Init the output featers2_indexes vector once */
+  
+  globalMutex.lock();
+  
+  if( features2_indexes.size() == 0 )
+  {
+    for( unsigned int features2_indexes_index = 0 ; 
+      features2_indexes_index < img1_features_matrix.GetLines() ;
+      ++features2_indexes_index ) {
+      
+      /* fills with an matrix lines number indicating
+         no processing done yet */
+      features2_indexes.push_back( 
+        img2_features_matrix.GetLines() );
+    }
+  }  
+  
+  /* Init the output featers2_indexes vector once */
+  
+  if( features1_indexes.size() == 0 )
+  {
+    for( unsigned int features1_indexes_index = 0 ; 
+      features1_indexes_index < img2_features_matrix.GetLines() ;
+      ++features1_indexes_index ) {
+      
+      /* fills with an matrix lines number indicating
+         no processing done yet */
+      features1_indexes.push_back( 
+        img1_features_matrix.GetLines() );
+    }
+  }  
+  
+  globalMutex.unLock();  
+    
+  /* Iterating over img1_features_matrix */
+  
+  const unsigned int img1_features_matrix_lines = 
+    img1_features_matrix.GetLines();
+  const unsigned int img2_features_matrix_lines = 
+    img2_features_matrix.GetLines();  
+  
+  TePDIPIManager progress( "Matching features", 
+    img1_features_matrix_lines + img2_features_matrix_lines, 
+    progress_enabled );
+        
+  const unsigned int cols_nmb = img2_features_matrix.GetColumns();
+  const double max_allowed_diff = ((double)cols_nmb) / corr_sens;
+            
+  {
+    unsigned int mat1_line = 0;
+    unsigned int mat2_line = 0;
+    double min_diff_value = 0;
+    unsigned int min_diff_index = 0;
+    unsigned int curr_col = 0;
+    double curr_diff_value = 0;
+    double curr_elem_diff = 0;
+    double* img1FMtxLinePtr = 0;
+    double* img2FMtxLinePtr = 0;
+      
+    for( mat1_line = 0 ; 
+      mat1_line < img1_features_matrix_lines ; ++mat1_line ) {
+      
+      /* Looking for a non-processed feature */
+      
+      globalMutex.lock();
+      
+      if( features2_indexes[ mat1_line ] == img2_features_matrix_lines ) 
+      {
+        /* Tell to other threads that the current correlation
+          is being calculated */
+        
+        features2_indexes[ mat1_line ] = img2_features_matrix_lines + 1;
+        
+        img1FMtxLinePtr = img1_features_matrix[ mat1_line ];
+        
+        globalMutex.unLock();
+        
+        /* Looking for the best correlation with matrix 2 */
+        
+        min_diff_value = DBL_MAX;
+        
+        for( mat2_line = 0 ; mat2_line < img2_features_matrix_lines ;
+          ++mat2_line ) 
+        {
+          globalMutex.lock();
+          
+          img2FMtxLinePtr = img2_features_matrix[ mat2_line ]; 
+           
+          globalMutex.unLock();
+           
+          curr_diff_value = 0.0;
+          
+          for( curr_col = 0 ; curr_col < cols_nmb ; ++curr_col ) 
+          {
+            curr_elem_diff = img1FMtxLinePtr[ curr_col ] - 
+              img2FMtxLinePtr[ curr_col ];
+              
+            curr_elem_diff *= curr_elem_diff;
+              
+            curr_diff_value += curr_elem_diff;
+          }
+          
+          curr_diff_value = sqrt( curr_diff_value );
+          
+          if( curr_diff_value < min_diff_value ) {
+            min_diff_value = curr_diff_value;
+            min_diff_index = mat2_line;
+          }
+        }
+        
+        if( min_diff_value <= max_allowed_diff ) {
+          globalMutex.lock();
+          
+          features2_indexes[ mat1_line ] = min_diff_index;
+          
+          globalMutex.unLock();
+        }
+      } else {
+        globalMutex.unLock();
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" );
+    }
+  }
+  
+  /* Iterating over img2_features_matrix */
+  
+  {
+    unsigned int mat1_line = 0;
+    unsigned int mat2_line = 0;
+    double min_diff_value = 0;
+    unsigned int min_diff_index = 0;
+    unsigned int curr_col = 0;
+    double curr_diff_value = 0;
+    double curr_elem_diff = 0;
+    double* img1FMtxLinePtr = 0;
+    double* img2FMtxLinePtr = 0;    
+      
+    for( mat2_line = 0 ; 
+      mat2_line < img2_features_matrix_lines ; ++mat2_line ) {
+      
+      /* Looking for a non-processed feature */
+      
+      globalMutex.lock();
+      
+      if( features1_indexes[ mat2_line ] == img1_features_matrix_lines ) 
+      {
+        /* Tell to other threads that the current correlation
+          is being calculated */
+        
+        features1_indexes[ mat2_line ] = img1_features_matrix_lines + 1;
+        
+        img2FMtxLinePtr = img2_features_matrix[ mat2_line ];
+        
+        globalMutex.unLock();
+        
+        /* Looking for the best correlation with matrix 1 */
+        
+        min_diff_value = DBL_MAX;
+        
+        for( mat1_line = 0 ; mat1_line < img1_features_matrix_lines ;
+          ++mat1_line ) 
+        {
+          globalMutex.lock();
+            
+          img1FMtxLinePtr = img1_features_matrix[ mat1_line ];  
+            
+          globalMutex.unLock();
+            
+          curr_diff_value = 0.0;
+          
+          for( curr_col = 0 ; curr_col < cols_nmb ; ++curr_col ) 
+          {
+            curr_elem_diff = img2FMtxLinePtr[ curr_col ] - 
+              img1FMtxLinePtr[ curr_col ];
+              
+            curr_elem_diff *= curr_elem_diff;
+            
+            curr_diff_value += curr_elem_diff;
+          }
+          
+          curr_diff_value = sqrt( curr_diff_value );
+          
+          if( curr_diff_value < min_diff_value ) {
+            min_diff_value = curr_diff_value;
+            min_diff_index = mat1_line;
+          }
+        }
+        
+        if( min_diff_value <= max_allowed_diff ) {
+          globalMutex.lock();
+          
+          features1_indexes[ mat2_line ] = min_diff_index;
+          
+          globalMutex.unLock();
+        }
+      } else {
+        globalMutex.unLock();
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" );
+    }
+  }
+  
+  return true;  
+}
+
+
+bool TePDIOFMatching::checkMaximaPoints( 
+  const std::vector< TeCoord2D >&maximas ) const
+{
+  for( unsigned int idx1 = 0 ; idx1 < maximas.size() ; ++idx1 )
+  { 
+    for( unsigned int idx2 = idx1 + 1 ; idx2 < maximas.size() ; ++idx2 )
+    {
+      TEAGN_TRUE_OR_RETURN( (
+        ( maximas[ idx1 ].x() != maximas[ idx2 ].x() ) ||
+        ( maximas[ idx1 ].y() != maximas[ idx2 ].y() ) ),
+        "Invalid maxima points" +
+        std::string( " index1=" ) + Te2String( idx1 ) +
+        " [" + Te2String( maximas[ idx1 ].x(), 9 ) + "," +
+        Te2String( maximas[ idx1 ].y(), 9 ) + "]" +
+        std::string( " index2=" ) + Te2String( idx2 ) +
+        " [" + Te2String( maximas[ idx2 ].x(), 9 ) + "," +
+        Te2String( maximas[ idx2 ].y(), 9 ) + "]" )
+    }
+  }
+  
+  return true;
+}
+
+
+bool TePDIOFMatching::checkTPs( 
+  const TeCoordPairVect& tpsvec ) const
+{
+  for( unsigned int idx1 = 0 ; idx1 < tpsvec.size() ; ++idx1 )
+  { 
+    for( unsigned int idx2 = idx1 + 1 ; idx2 < tpsvec.size() ; 
+      ++idx2 )
+    {
+      TEAGN_TRUE_OR_RETURN( 
+        (
+          (
+            ( tpsvec[ idx1 ].pt1.x() != tpsvec[ idx2 ].pt1.x() ) ||
+            ( tpsvec[ idx1 ].pt1.y() != tpsvec[ idx2 ].pt1.y() ) 
+          ) &&
+          (
+            ( tpsvec[ idx1 ].pt2.x() != tpsvec[ idx2 ].pt2.x() ) ||
+            ( tpsvec[ idx1 ].pt2.y() != tpsvec[ idx2 ].pt2.y() ) 
+          )
+        ),
+        "Invalid tie-point" +
+        std::string( " index1=" ) + Te2String( idx1 ) +
+        " [" + Te2String( tpsvec[ idx1 ].pt1.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx1 ].pt1.y(), 9 ) + " <-> " +
+        Te2String( tpsvec[ idx1 ].pt2.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx1 ].pt2.y(), 9 ) + "]" +
+        std::string( " index2=" ) + Te2String( idx2 ) +
+        " [" + Te2String( tpsvec[ idx2 ].pt1.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx2 ].pt1.y(), 9 ) + " <-> " +
+        Te2String( tpsvec[ idx2 ].pt2.x(), 9 ) + "," +
+        Te2String( tpsvec[ idx2 ].pt2.y(), 9 ) + "]" );
+    }
+  }
+  
+  return true;
+}
+
+
diff --git a/src/terralib/image_processing/TePDIOFMatching.hpp b/src/terralib/image_processing/TePDIOFMatching.hpp
index 1118400..03a1908 100644
--- a/src/terralib/image_processing/TePDIOFMatching.hpp
+++ b/src/terralib/image_processing/TePDIOFMatching.hpp
@@ -1,347 +1,346 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIOFMATCHING_HPP
-  #define TEPDIOFMATCHING_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIMatrix.hpp"
-  
-  #include <TeThreadParameters.h>
-
-  /**
-   * @brief  Optical flow based image area matching.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIMatchingAlgorithms
-   *
-   * @note The required parameters are:
-   *
-   * @param input_image1_ptr (TePDITypes::TePDIRasterPtrType) - 
-   * The input image 1.
-   * @param input_channel1 ( unsigned int ) - Band to process 
-   * from input_image1.
-   *
-   * @param input_image2_ptr (TePDITypes::TePDIRasterPtrType) - 
-   * The input image 2.
-   * @param input_channel2 ( unsigned int ) - Band to process 
-   * from input_image2.
-   *
-   * @param out_tie_points_ptr ( TeSharedPtr< TeCoordPairVect > ) - The 
-   * output tie- points 
-   * where TeCoordPair.pt1 are input_image1 matricial
-   * indexes and TeCoordPair.pt2 are input_image2 matricial
-   * indexes.
-   *
-   * @note The Optional parameters are:
-   *
-   * @param gt_params ( TeGTParams ) - The geometric transformation
-   * parameters to be used (if not supplied, the dafult TeGTParams
-   * will be used - affine transformation, max direct mapping
-   * error = 1 pixel, max inverse mapping error = 1 pixel,
-   * LWAOutRemotion outliers remotion ).
-   *
-   * @param out_gt_params_ptr ( TeGTParams::pointer ) - The output 
-   * parameters of internally generated geometric transformation 
-   * (only valid when geometrical filtering is enabled).
-   *
-   * @param input_box1 ( TeBox ) - Box (image matrix coords) to process 
-   * from input_image1 ( the entire image will be used if no box
-   * was supplied )
-   *
-   * @param input_box2 ( TeBox ) - Box (image matrix coords) to process 
-   * from input_image2 ( the entire image will be used if no box
-   * was supplied )   
-   *
-   * @param enable_multi_thread (int) - If present (any value) 
-   * a multi-threaded processing will be used; Some TeDecoders do
-   * not support multi-thread so use it with cation
-   * (default: multi-thread disabled).
-   *
-   * @param pixel_x_relation (double) - The pixel resolution relation 
-   * pixel_x_relation = img1_pixel_res_x / img2_pixel_res_x (default=1.0);
-   *
-   * @param pixel_y_relation (double) - The pixel resolution relation 
-   * pixel_y_relation = img1_pixel_res_y / img2_pixel_res_y (default=1.0);   
-   *
-   * @param max_tie_points (unsigned int) - The maximum number
-   * of generated tie-points (default=529);   
-   *
-   * @param skip_geom_filter (int) - If present (any value) 
-   * will disable the geometric filtering
-   * ( default: geometric filtering enabled ). 
-   *
-   * @param corr_sens (double) - The correlation sensibility
-   * (default: 0.5 range: (0,3] ).
-   *
-   * @param corr_window_width (unsigned int) - The correlation 
-   * window width used to correlate points between 
-   * images (Must be an odd number, minimum 3, default: 21).  
-   *
-   * @param max_size_opt (unsigned int) - The maximum image box allowed
-   * size (size = pixels number = lines * columns); when the images pixels number
-   * exceed this value a downsample will be performed for optimization
-   * (default value=0 wich means optimization disabled).
-   *
-   * @param maximas_sens (double) - The maximas (candidate tie-points)
-   * detection sensibility
-   * (default: 0 range: [0,1] ).
-   */
-  class PDI_DLL TePDIOFMatching : public TePDIAlgorithm {
-    public :
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIOFMatching();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIOFMatching();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-    
-      /**
-       * @typedef TePDIMatrix< double > ImgMatrixT
-       * @brief A type definition for a image matrix.
-       */    
-      typedef TePDIMatrix< double > ImgMatrixT;
-    
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial 
-       * state.
-       */
-      void ResetState( const TePDIParameters& params );
-      
-      /**
-       * @brief A thread entry point to load raster data into
-       * a simple matrix.
-       * @param params The parameters needed for the thread 
-       * execution.
-       * @return true if OK, false on errors.
-       */
-      static bool loadImage( const TeThreadParameters& params );
-      
-      /**
-       * @brief A thread entry point to generate the image features
-       * and the maxima points.
-       * @param params The parameters needed for the thread execution.
-       * @return true if OK, false on errors.
-       * @note The points inside img_maxima_points_ptr
-       * will have img_matrix_ptr reference.
-       */
-      static bool generateFeatures( 
-        const TeThreadParameters& params );      
-      
-      /**
-       * @brief Apply a gaussian smoothing over the input_matrix.
-       * @param input_matrix Input matrix.
-       * @param output_matrix Output matrix.
-       * @param iterations Iterations number.
-       * @param progress_enabled Progress interface enabled.
-       * @param glb_mem_lock a Reference to the global memory
-       * allocation mutex.
-       * @return true if OK, false on errors.
-       */      
-      static bool gaussianSmoothing( 
-        const ImgMatrixT& input_matrix,
-        ImgMatrixT& output_matrix, 
-        unsigned int iterations,
-        bool progress_enabled,
-        TeMutex& glb_mem_lock );
-        
-      /**
-       * @brief Generates a least squares surface from the input matrix.
-       * @param input_matrix Input matrix.
-       * @param ls_surface_matrix Output matrix containing the LS 
-       * surface.
-       * @param progress_enabled Progress interface enabled.
-       * @param glb_mem_lock a Reference to the global memory
-       * allocation mutex.       
-       * @return true if OK, false on errors.
-       */      
-      static bool generateLSSurface( 
-        const ImgMatrixT& input_matrix,
-        ImgMatrixT& ls_surface_matrix, 
-        bool progress_enabled,
-        TeMutex& glb_mem_lock );
-        
-      /**
-       * @brief Save the output matrix to a geotiff file.
-       * @param input_matrix Input matrix.
-       * @param out_file_name Output file name.
-       * @param maxima_points The maxima points to be
-       * filled with 255
-       */      
-      static void matrix2Tiff( 
-        const ImgMatrixT& input_matrix,
-        const std::string& out_file_name,
-        const std::vector< TeCoord2D >& maxima_points );
-        
-      /**
-       * @brief Save the output matrix to a geotiff file.
-       * @param input_raster Input raster.
-       * @param raster_channel Raster channel.
-       * @param out_file_name Output file name.
-       * @param maxima_points The maxima points to be drawed.
-       * @param out_tie_points_ptr The tie-points to be drawed.
-       * @param tie_points_space The tie-points space 
-       * (pt1 or pt2).
-       */      
-      static void raster2Tiff( 
-        const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
-        unsigned int raster_channel,
-        const std::string& out_file_name,
-        const std::vector< TeCoord2D >& maxima_points,
-        const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
-        unsigned int tie_points_space );        
-        
-      /**
-       * @brief Get image local maxima points.
-       * @param input_matrix Input matrix.
-       * @param maxima_points The generated points.
-       * @param max_points The maximum number of generated points.
-       * @param corr_window_width The correlation window width
-       * (points outside the correlation window based valid image bounds
-       * will not be generated ).
-       * @param progress_enabled Progress interface enabled.
-       * @param maximas_sens Maximas sensibility to blocks mean
-       * ( block mean diff >= max blocks mean diff * maximas_sens )
-       * @return true if OK, false on errors.
-       */      
-      static bool getMaximaPoints( 
-        const ImgMatrixT& input_matrix,
-        std::vector< TeCoord2D >& maxima_points,
-        unsigned int max_points, unsigned int corr_window_width,
-        bool progress_enabled,
-        double maximas_sens ); 
-        
-      /**
-       * @brief Generate the rotated normalized corelation 
-       * windows matrix.
-       * @param img_matrix Input image matrix.
-       * @param corr_window_width The correlation windows width.
-       * @param img_maxima_points The image maxima points
-       * (these are the correlation matrix centers).
-       * @param img_features_matrix The output image
-       * features matrix ( each line is a stacked version
-       * of one rotated correlation window ).
-       * @param progress_enabled Progress interface enabled.
-       * @param glb_mem_lock a Reference to the global memory
-       * allocation mutex.        
-       * @return true if OK, false on errors.
-       */          
-      static bool generateCorrWindows( 
-        const ImgMatrixT& img_matrix,
-        unsigned int corr_window_width,
-        const std::vector< TeCoord2D >& img_maxima_points,
-        ImgMatrixT& img_features_matrix,
-        bool progress_enabled,
-        TeMutex& glb_mem_lock );
-        
-      /**
-       * @brief Save the generated features to tif files.
-       * @param corr_window_width The correlation windows width.
-       * @param img_maxima_points The image maxima points
-       * (these are the correlation matrix centers).
-       * @param img_features_matrix The output image
-       * features matrix ( each line is a stacked version
-       * of one rotated correlation window ).
-       * @filenameaddon A string to be appended to the
-       * file name of each feature file.
-       * @return true if OK, false on errors.
-       */          
-      static void features2Tiff( 
-        unsigned int corr_window_width,
-        const std::vector< TeCoord2D >& img_maxima_points,
-        ImgMatrixT& img_features_matrix,
-        const std::string& filenameaddon );   
-        
-      /**
-       * @brief A thread entry point to locate the
-       * best features matching index on matrix 2 from
-       * each feature on matrix 1.
-       * @param params The parameters needed for the 
-       * thread execution.
-       * @return true if OK, false on errors.
-       * 
-       * @note The internal used parameters:
-       * @param features2_indexes_ptr (std::vector< unsigned int >*)
-       * A pointer the the empty vector where the generated
-       * features matrix 2 indexes will be stored.
-       * @param features2_indexes_lock_ptr (TeMutex*) A thread
-       * lock object to access features2_indexes_ptr.
-       * @param img1_features_matrix_ptr (ImgMatrixT*) A pointer
-       * to the image 1 features matrix.
-       * @param img2_features_matrix_ptr (ImgMatrixT*) A pointer
-       * to the image 2 features matrix.
-       * @param progress_enabled (bool) Progress enabled flag.
-       * @param corr_sens (double) Correlation sensitivity.
-       */
-      static bool locateBestFeaturesMatching( 
-        const TeThreadParameters& params );      
-
-      /**
-       * @brief Check maxima points for repeated values.
-       * @param maximas Maxima points vector.
-       * @return true if OK, false on errors.
-       */
-      bool checkMaximaPoints( const std::vector< TeCoord2D >& maximas )
-        const;
-        
-      /**
-       * @brief Check tie-points indexes for repeated values.
-       * @param maximas Tie-points vector.
-       * @return true if OK, false on errors.
-       */
-      bool checkTPs( 
-        const TeCoordPairVect& tpsvec ) const;         
-  };
-  
-/** @example TePDIOFMatching_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIOFMATCHING_HPP
+  #define TEPDIOFMATCHING_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIMatrix.hpp"
+  
+  #include <TeThreadParameters.h>
+
+  /**
+   * @brief  Optical flow based image area matching.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIMatchingAlgorithms
+   *
+   * @note The required parameters are:
+   *
+   * @param input_image1_ptr (TePDITypes::TePDIRasterPtrType) - 
+   * The input image 1.
+   * @param input_channel1 ( unsigned int ) - Band to process 
+   * from input_image1.
+   *
+   * @param input_image2_ptr (TePDITypes::TePDIRasterPtrType) - 
+   * The input image 2.
+   * @param input_channel2 ( unsigned int ) - Band to process 
+   * from input_image2.
+   *
+   * @param out_tie_points_ptr ( TeSharedPtr< TeCoordPairVect > ) - The 
+   * output tie- points 
+   * where TeCoordPair.pt1 are input_image1 matricial
+   * indexes and TeCoordPair.pt2 are input_image2 matricial
+   * indexes.
+   *
+   * @note The Optional parameters are:
+   *
+   * @param gt_params ( TeGTParams ) - The geometric transformation
+   * parameters to be used (if not supplied, the dafult TeGTParams
+   * will be used - affine transformation, max direct mapping
+   * error = 2 pixels, RANSACRemotion outliers remotion ).
+   *
+   * @param out_gt_params_ptr ( TeGTParams::pointer ) - The output 
+   * parameters of internally generated geometric transformation 
+   * (only valid when geometrical filtering is enabled).
+   *
+   * @param input_box1 ( TeBox ) - Box (image matrix coords) to process 
+   * from input_image1 ( the entire image will be used if no box
+   * was supplied )
+   *
+   * @param input_box2 ( TeBox ) - Box (image matrix coords) to process 
+   * from input_image2 ( the entire image will be used if no box
+   * was supplied )   
+   *
+   * @param enable_multi_thread (int) - If present (any value) 
+   * a multi-threaded processing will be used; Some TeDecoders do
+   * not support multi-thread so use it with cation
+   * (default: multi-thread disabled).
+   *
+   * @param pixel_x_relation (double) - The pixel resolution relation 
+   * pixel_x_relation = img1_pixel_res_x / img2_pixel_res_x (default=1.0);
+   *
+   * @param pixel_y_relation (double) - The pixel resolution relation 
+   * pixel_y_relation = img1_pixel_res_y / img2_pixel_res_y (default=1.0);   
+   *
+   * @param max_tie_points (unsigned int) - The maximum number
+   * of generated tie-points (default=529);   
+   *
+   * @param skip_geom_filter (int) - If present (any value) 
+   * will disable the geometric filtering
+   * ( default: geometric filtering enabled ). 
+   *
+   * @param corr_sens (double) - The correlation sensibility
+   * (default: 0.5 range: (0,3] ).
+   *
+   * @param corr_window_width (unsigned int) - The correlation 
+   * window width used to correlate points between 
+   * images (Must be an odd number, minimum 3, default: 21).  
+   *
+   * @param max_size_opt (unsigned int) - The maximum image box allowed
+   * size (size = pixels number = lines * columns); when the images pixels number
+   * exceed this value a downsample will be performed for optimization
+   * (default value=0 wich means optimization disabled).
+   *
+   * @param maximas_sens (double) - The maximas (candidate tie-points)
+   * detection sensibility
+   * (default: 0 range: [0,1] ).
+   */
+  class PDI_DLL TePDIOFMatching : public TePDIAlgorithm {
+    public :
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIOFMatching();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIOFMatching();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+    
+      /**
+       * @typedef TePDIMatrix< double > ImgMatrixT
+       * @brief A type definition for a image matrix.
+       */    
+      typedef TePDIMatrix< double > ImgMatrixT;
+    
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial 
+       * state.
+       */
+      void ResetState( const TePDIParameters& params );
+      
+      /**
+       * @brief A thread entry point to load raster data into
+       * a simple matrix.
+       * @param params The parameters needed for the thread 
+       * execution.
+       * @return true if OK, false on errors.
+       */
+      static bool loadImage( const TeThreadParameters& params );
+      
+      /**
+       * @brief A thread entry point to generate the image features
+       * and the maxima points.
+       * @param params The parameters needed for the thread execution.
+       * @return true if OK, false on errors.
+       * @note The points inside img_maxima_points_ptr
+       * will have img_matrix_ptr reference.
+       */
+      static bool generateFeatures( 
+        const TeThreadParameters& params );      
+      
+      /**
+       * @brief Apply a gaussian smoothing over the input_matrix.
+       * @param input_matrix Input matrix.
+       * @param output_matrix Output matrix.
+       * @param iterations Iterations number.
+       * @param progress_enabled Progress interface enabled.
+       * @param glb_mem_lock a Reference to the global memory
+       * allocation mutex.
+       * @return true if OK, false on errors.
+       */      
+      static bool gaussianSmoothing( 
+        const ImgMatrixT& input_matrix,
+        ImgMatrixT& output_matrix, 
+        unsigned int iterations,
+        bool progress_enabled,
+        TeMutex& glb_mem_lock );
+        
+      /**
+       * @brief Generates a least squares surface from the input matrix.
+       * @param input_matrix Input matrix.
+       * @param ls_surface_matrix Output matrix containing the LS 
+       * surface.
+       * @param progress_enabled Progress interface enabled.
+       * @param glb_mem_lock a Reference to the global memory
+       * allocation mutex.       
+       * @return true if OK, false on errors.
+       */      
+      static bool generateLSSurface( 
+        const ImgMatrixT& input_matrix,
+        ImgMatrixT& ls_surface_matrix, 
+        bool progress_enabled,
+        TeMutex& glb_mem_lock );
+        
+      /**
+       * @brief Save the output matrix to a geotiff file.
+       * @param input_matrix Input matrix.
+       * @param out_file_name Output file name.
+       * @param maxima_points The maxima points to be
+       * filled with 255
+       */      
+      static void matrix2Tiff( 
+        const ImgMatrixT& input_matrix,
+        const std::string& out_file_name,
+        const std::vector< TeCoord2D >& maxima_points );
+        
+      /**
+       * @brief Save the output matrix to a geotiff file.
+       * @param input_raster Input raster.
+       * @param raster_channel Raster channel.
+       * @param out_file_name Output file name.
+       * @param maxima_points The maxima points to be drawed.
+       * @param out_tie_points_ptr The tie-points to be drawed.
+       * @param tie_points_space The tie-points space 
+       * (pt1 or pt2).
+       */      
+      static void raster2Tiff( 
+        const TePDITypes::TePDIRasterPtrType& input_raster_ptr,
+        unsigned int raster_channel,
+        const std::string& out_file_name,
+        const std::vector< TeCoord2D >& maxima_points,
+        const TeSharedPtr< TeCoordPairVect >& out_tie_points_ptr,
+        unsigned int tie_points_space );        
+        
+      /**
+       * @brief Get image local maxima points.
+       * @param input_matrix Input matrix.
+       * @param maxima_points The generated points.
+       * @param max_points The maximum number of generated points.
+       * @param corr_window_width The correlation window width
+       * (points outside the correlation window based valid image bounds
+       * will not be generated ).
+       * @param progress_enabled Progress interface enabled.
+       * @param maximas_sens Maximas sensibility to blocks mean
+       * ( block mean diff >= max blocks mean diff * maximas_sens )
+       * @return true if OK, false on errors.
+       */      
+      static bool getMaximaPoints( 
+        const ImgMatrixT& input_matrix,
+        std::vector< TeCoord2D >& maxima_points,
+        unsigned int max_points, unsigned int corr_window_width,
+        bool progress_enabled,
+        double maximas_sens ); 
+        
+      /**
+       * @brief Generate the rotated normalized corelation 
+       * windows matrix.
+       * @param img_matrix Input image matrix.
+       * @param corr_window_width The correlation windows width.
+       * @param img_maxima_points The image maxima points
+       * (these are the correlation matrix centers).
+       * @param img_features_matrix The output image
+       * features matrix ( each line is a stacked version
+       * of one rotated correlation window ).
+       * @param progress_enabled Progress interface enabled.
+       * @param glb_mem_lock a Reference to the global memory
+       * allocation mutex.        
+       * @return true if OK, false on errors.
+       */          
+      static bool generateCorrWindows( 
+        const ImgMatrixT& img_matrix,
+        unsigned int corr_window_width,
+        const std::vector< TeCoord2D >& img_maxima_points,
+        ImgMatrixT& img_features_matrix,
+        bool progress_enabled,
+        TeMutex& glb_mem_lock );
+        
+      /**
+       * @brief Save the generated features to tif files.
+       * @param corr_window_width The correlation windows width.
+       * @param img_maxima_points The image maxima points
+       * (these are the correlation matrix centers).
+       * @param img_features_matrix The output image
+       * features matrix ( each line is a stacked version
+       * of one rotated correlation window ).
+       * @filenameaddon A string to be appended to the
+       * file name of each feature file.
+       * @return true if OK, false on errors.
+       */          
+      static void features2Tiff( 
+        unsigned int corr_window_width,
+        const std::vector< TeCoord2D >& img_maxima_points,
+        ImgMatrixT& img_features_matrix,
+        const std::string& filenameaddon );   
+        
+      /**
+       * @brief A thread entry point to locate the
+       * best features matching index on matrix 2 from
+       * each feature on matrix 1.
+       * @param params The parameters needed for the 
+       * thread execution.
+       * @return true if OK, false on errors.
+       * 
+       * @note The internal used parameters:
+       * @param features2_indexes_ptr (std::vector< unsigned int >*)
+       * A pointer the the empty vector where the generated
+       * features matrix 2 indexes will be stored.
+       * @param features2_indexes_lock_ptr (TeMutex*) A thread
+       * lock object to access features2_indexes_ptr.
+       * @param img1_features_matrix_ptr (ImgMatrixT*) A pointer
+       * to the image 1 features matrix.
+       * @param img2_features_matrix_ptr (ImgMatrixT*) A pointer
+       * to the image 2 features matrix.
+       * @param progress_enabled (bool) Progress enabled flag.
+       * @param corr_sens (double) Correlation sensitivity.
+       */
+      static bool locateBestFeaturesMatching( 
+        const TeThreadParameters& params );      
+
+      /**
+       * @brief Check maxima points for repeated values.
+       * @param maximas Maxima points vector.
+       * @return true if OK, false on errors.
+       */
+      bool checkMaximaPoints( const std::vector< TeCoord2D >& maximas )
+        const;
+        
+      /**
+       * @brief Check tie-points indexes for repeated values.
+       * @param maximas Tie-points vector.
+       * @return true if OK, false on errors.
+       */
+      bool checkTPs( 
+        const TeCoordPairVect& tpsvec ) const;         
+  };
+  
+/** @example TePDIOFMatching_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif
diff --git a/src/terralib/image_processing/TePDIPCAWaveletFusion.cpp b/src/terralib/image_processing/TePDIPCAWaveletFusion.cpp
new file mode 100644
index 0000000..cb0dd16
--- /dev/null
+++ b/src/terralib/image_processing/TePDIPCAWaveletFusion.cpp
@@ -0,0 +1,386 @@
+#include "TePDIPCAWaveletFusion.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+#include "TePDITypes.hpp"
+#include "TePDIStatistic.hpp"
+#include "TePDIPrincipalComponents.hpp"
+#include "TePDIWaveletAtrous.hpp"
+#include "TeRasterRemap.h"
+#include <TeMatrix.h>
+#include <TeUtils.h>
+#include <math.h>
+
+#define waveletPlanes 2
+
+TePDIPCAWaveletFusion::TePDIPCAWaveletFusion()
+{
+}
+
+TePDIPCAWaveletFusion::~TePDIPCAWaveletFusion()
+{
+}
+
+void TePDIPCAWaveletFusion::ResetState(const TePDIParameters&)
+{
+}
+
+bool TePDIPCAWaveletFusion::CheckParameters(const TePDIParameters& parameters) const
+{
+/* Input rasters and bands checking */
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+	TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
+	
+	std::vector<int> bands;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+	TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), "Invalid parameter: bands number");
+
+	for( unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); ++input_rasters_index )
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
+		TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[" + Te2String(input_rasters_index) + "]");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String( input_rasters_index ) + " with imcompatible number of columns" );
+		TEAGN_TRUE_OR_RETURN(((input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeRGB) || (input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeMultiBand)), "Invalid parameter - input_rasters (invalid photometric interpretation)");
+	}
+
+/* Reference raster checking */
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+	TEAGN_TRUE_OR_RETURN(((reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeRGB ) || (reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeMultiBand)), "Invalid parameter - reference_raster (invalid photometric interpretation)");
+
+	TEAGN_TRUE_OR_RETURN(reference_raster_band < reference_raster->nBands(), "Invalid parameter - reference_raster_band");
+
+/* Output rasters checking */
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() == input_rasters.size(), "Invalid parameter: output rasters size");
+
+	for(unsigned int input_rasters_index2 = 0; input_rasters_index2 < input_rasters.size(); ++input_rasters_index2)
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " not ready");
+	}
+
+	int pca1_levels;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("pca1_levels", pca1_levels), "Missing parameter: pca1_levels");
+
+	int reference_levels;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
+
+	string filter_file;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("filter_file", filter_file), "Missing parameter: filter_file");
+
+	TePDIPCAWaveletFusion::InterpMethod resampling_type;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
+
+	bool fit_histogram;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
+
+	return true;
+}
+
+bool TePDIPCAWaveletFusion::RunImplementation()
+{
+// Getting parameters
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+
+	std::vector<int> bands_direct;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("bands", bands_direct), "Missing parameter: bands");
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+
+	int pca1_levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("pca1_levels", pca1_levels), "Missing parameter: pca1_levels");
+
+	int reference_levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
+
+	string filter_file;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("filter_file", filter_file), "Missing parameter: filter_file");
+
+	TePDIPCAWaveletFusion::InterpMethod resampling_type;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
+
+	bool fit_histogram;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
+
+// Resampling the input raster
+	TeRasterParams reference_params = reference_raster->params();
+  
+	TePDITypes::TePDIRasterVectorType resampled_input_rasters;
+	for(unsigned int b = 0; b < input_rasters.size(); b++)
+	{
+		if (resampling_type != TePDIPCAWaveletFusion::Nothing)
+		{
+		  TePDIInterpolator::InterpMethod intMethod;
+		  switch( resampling_type )
+		  {
+		    case TePDIPCAWaveletFusion::NNMethod :
+		    {
+		      intMethod =  TePDIInterpolator::NNMethod;
+		      break;
+		    }
+		    case TePDIPCAWaveletFusion::BilinearMethod :
+		    {
+		      intMethod =  TePDIInterpolator::BilinearMethod;
+		      break;
+		    }		  
+		    case TePDIPCAWaveletFusion::BicubicMethod :
+		    {
+		      intMethod =  TePDIInterpolator::BicubicMethod;
+		      break;
+		    }				      
+		    default :
+		    {
+		      TEAGN_LOG_AND_THROW( "Invalid resampling type" );
+		    }
+		  }
+		  
+			TePDITypes::TePDIRasterPtrType resampled_input_rasters_temp;
+			TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(resampled_input_rasters_temp,  reference_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create the resampled input rasters");
+			resampleRasterByResLinsCols(input_rasters[b], resampled_input_rasters_temp, reference_params.resx_ / input_rasters[b]->params().resx_, reference_params.resy_ / input_rasters[b]->params().resy_, reference_params.nlines_,  reference_params.ncols_, intMethod, progress_enabled_);
+			resampled_input_rasters.push_back(resampled_input_rasters_temp);
+		}
+		else
+			resampled_input_rasters.push_back(input_rasters[b]);
+	}
+
+// PCA Direct analysis
+	TePDITypes::TePDIRasterVectorType output_rasters_direct;
+	for (unsigned b = 0; b < output_rasters.size(); b++)
+	{
+		TePDITypes::TePDIRasterPtrType outRaster_direct;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster_direct, 1, 1, 1, false, TeDOUBLE, 0), "RAM Raster " + Te2String(b) + " Alloc error");
+		output_rasters_direct.push_back(outRaster_direct);
+	}
+
+	TeSharedPtr<TeMatrix> covariance_matrix(new TeMatrix);
+
+	TePDIParameters params_direct;
+
+	params_direct.SetParameter("analysis_type", 
+    TePDIPrincipalComponents::TePDIPCADirect);
+	params_direct.SetParameter("input_rasters", resampled_input_rasters);
+	params_direct.SetParameter("bands", bands_direct);
+	params_direct.SetParameter("output_rasters", output_rasters_direct);
+	params_direct.SetParameter("covariance_matrix", covariance_matrix);
+	
+	TePDIPrincipalComponents pc_direct;
+	TEAGN_TRUE_OR_THROW(pc_direct.Reset(params_direct), "Invalid Parameters");
+	pc_direct.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(pc_direct.Apply(), "Apply error");
+
+// Creating PCA 1 wavelet plane
+	std::vector<TePDITypes::TePDIRasterVectorType> output_rasters_direct_wavelets;
+	TePDITypes::TePDIRasterVectorType input_rasters_wavelets_vector_temp;
+	input_rasters_wavelets_vector_temp.push_back(output_rasters_direct[0]);
+	for(int l = 1; l <= pca1_levels; l++)
+	{
+		TePDITypes::TePDIRasterPtrType output_rasters_direct_wavelets_temp;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(output_rasters_direct_wavelets_temp, waveletPlanes, output_rasters_direct[0]->params().nlines_, output_rasters_direct[0]->params().ncols_, false, TeFLOAT, 0), "Unable to alloc input rasters wavelet planes");
+		input_rasters_wavelets_vector_temp.push_back(output_rasters_direct_wavelets_temp);
+	}
+	output_rasters_direct_wavelets.push_back(input_rasters_wavelets_vector_temp);
+
+// Extracting PCA 1 wavelet planes
+	TePDIParameters pca1WaveletAtrousParams;
+	pca1WaveletAtrousParams.SetParameter("direction", (int)TePDIWaveletAtrous::DECOMPOSE);
+	pca1WaveletAtrousParams.SetParameter("input_raster", output_rasters_direct[0]);
+	pca1WaveletAtrousParams.SetParameter("band", 0);
+	pca1WaveletAtrousParams.SetParameter("levels", pca1_levels);
+	pca1WaveletAtrousParams.SetParameter("filter_file", filter_file);
+	pca1WaveletAtrousParams.SetParameter("output_wavelets", output_rasters_direct_wavelets[0]);
+	TePDIWaveletAtrous wa_pca1;
+	TEAGN_TRUE_OR_THROW(wa_pca1.Reset(pca1WaveletAtrousParams), "Invalid Parameters");
+	wa_pca1.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(wa_pca1.Apply(), "Apply error");
+
+// Creating reference raster wavelet planes
+	double p;
+	TePDITypes::TePDIRasterVectorType reference_raster_wavelets;
+	for(int l = 0; l <= reference_levels; l++)
+	{
+		TePDITypes::TePDIRasterPtrType reference_raster_wavelets_temp;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(reference_raster_wavelets_temp, waveletPlanes, reference_params.nlines_, reference_params.ncols_, false, TeFLOAT, 0), "Reference raster wavelets Alloc error");
+		if (l == 0)
+		{
+			for (int j = 0; j < reference_params.nlines_; j++)
+			{
+				for (int i = 0; i < reference_params.ncols_; i++)
+				{
+					reference_raster->getElement(i, j, p, reference_raster_band);
+					reference_raster_wavelets_temp->setElement(i, j, p, 0);
+				}
+			}
+		}
+		reference_raster_wavelets.push_back(reference_raster_wavelets_temp);
+	}
+
+// Extracting reference raster wavelet planes
+	TePDIParameters referenceWaveletAtrousParams;
+	referenceWaveletAtrousParams.SetParameter("direction", (int)TePDIWaveletAtrous::DECOMPOSE);
+	referenceWaveletAtrousParams.SetParameter("input_raster", reference_raster);
+	referenceWaveletAtrousParams.SetParameter("band", reference_raster_band);
+	referenceWaveletAtrousParams.SetParameter("levels", reference_levels);
+	referenceWaveletAtrousParams.SetParameter("filter_file", filter_file);
+	referenceWaveletAtrousParams.SetParameter("output_wavelets", reference_raster_wavelets);
+	referenceWaveletAtrousParams.SetParameter("fit_histogram", fit_histogram);
+	TePDIWaveletAtrous wa_reference;
+	TEAGN_TRUE_OR_THROW(wa_reference.Reset(referenceWaveletAtrousParams), "Invalid Parameters");
+	wa_reference.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(wa_reference.Apply(), "Apply error");
+
+// Recomposing wavelets
+	TePDIParameters waveletAtrousParamsRecompose;
+	waveletAtrousParamsRecompose.SetParameter("direction", (int)TePDIWaveletAtrous::RECOMPOSE);
+	waveletAtrousParamsRecompose.SetParameter("input_rasters_wavelets", output_rasters_direct_wavelets);
+	waveletAtrousParamsRecompose.SetParameter("rasters_levels", pca1_levels);
+	waveletAtrousParamsRecompose.SetParameter("reference_raster_wavelets", reference_raster_wavelets);
+	waveletAtrousParamsRecompose.SetParameter("reference_levels", reference_levels);
+	waveletAtrousParamsRecompose.SetParameter("output_rasters", output_rasters_direct);
+	TePDIWaveletAtrous waRecompose;
+	TEAGN_TRUE_OR_THROW(waRecompose.Reset(waveletAtrousParamsRecompose), "Invalid Parameters");
+	waRecompose.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(waRecompose.Apply(), "Apply error");
+
+// Inverse analysis
+	
+	TePDIParameters params_inverse;
+
+	std::vector< int > bands_inverse;
+	for (unsigned b = 0; b < output_rasters.size(); b++)
+		bands_inverse.push_back(0);
+
+	params_inverse.SetParameter("analysis_type", 
+   TePDIPrincipalComponents::TePDIPCAInverse);
+	params_inverse.SetParameter("input_rasters", output_rasters_direct);
+	params_inverse.SetParameter("bands", bands_inverse);
+	params_inverse.SetParameter("output_rasters", output_rasters);
+	params_inverse.SetParameter("covariance_matrix", covariance_matrix);
+	
+	TePDIPrincipalComponents pc_inverse;
+	TEAGN_TRUE_OR_THROW(pc_inverse.Reset(params_inverse), "Invalid Parameters");
+	pc_inverse.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(pc_inverse.Apply(), "Apply error");
+
+	return true;
+}
+
+bool TePDIPCAWaveletFusion::resampleRasterByResLinsCols( 
+  const TePDITypes::TePDIRasterPtrType& input_raster,
+  const TePDITypes::TePDIRasterPtrType& output_raster,
+  double x_resolution_ratio, double y_resolution_ratio, int l, int c,
+  TePDIInterpolator::InterpMethod interpol, bool enable_progress ) 
+{
+    
+  TEAGN_TRUE_OR_RETURN( input_raster.isActive(), "Inactive input raster" );
+  TEAGN_TRUE_OR_RETURN( 
+    input_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Input raster not ready" )
+  
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(), 
+    "Inactive output raster" );
+  TEAGN_TRUE_OR_RETURN( 
+    output_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Output raster not ready" )
+    
+  TEAGN_TRUE_OR_RETURN( ( x_resolution_ratio > 0.0 ), "Invalid X ratio" )
+  TEAGN_TRUE_OR_RETURN( ( y_resolution_ratio > 0.0 ), "Invalid X ratio" )
+  
+  /* Reseting the output raster to the new geometry */
+  
+  TeRasterParams& input_raster_params = input_raster->params();
+  
+  TeRasterParams new_output_raster_params = output_raster->params();
+  
+  new_output_raster_params.nBands( input_raster_params.nBands() );
+  new_output_raster_params.setPhotometric( 
+    input_raster_params.photometric_[ 0 ], -1 );
+  if( input_raster_params.projection() != 0 ) {
+    new_output_raster_params.projection( input_raster_params.projection() );
+  }
+  new_output_raster_params.boxResolution( 
+    input_raster_params.box().x1(), 
+    input_raster_params.box().y1(), input_raster_params.box().x2(), 
+    input_raster_params.box().y2(), 
+    ( input_raster_params.resx_ * x_resolution_ratio ), 
+    ( input_raster_params.resy_ * y_resolution_ratio ) );
+  new_output_raster_params.lowerLeftResolutionSize(input_raster_params.box().lowerLeft().x(), input_raster_params.box().lowerLeft().y(), ( input_raster_params.resx_ * x_resolution_ratio ), ( input_raster_params.resy_ * y_resolution_ratio ), c, l);
+
+    
+  TEAGN_TRUE_OR_RETURN( output_raster->init( new_output_raster_params ),
+    "Output raster reset error" )
+//cout << output_raster->params().resx_ << endl;
+    
+  /* interpolating pixel values */
+  
+  const TeRasterParams& output_raster_params = output_raster->params();
+  
+  const unsigned int out_lines = output_raster_params.nlines_;
+  const unsigned int out_cols = output_raster_params.ncols_;
+  const unsigned int out_bands = output_raster_params.nBands();
+  
+  double in_col = 0;
+  double in_line = 0;
+  unsigned int out_col = 0;
+  unsigned int out_line = 0;
+  unsigned int out_band = 0;
+  double value = 0;
+  
+  double dummy_value = 0;
+  if( input_raster_params.useDummy_ ) {
+    dummy_value = input_raster_params.dummy_[ 0 ];
+  }
+  
+  TeRaster& output_raster_ref = *( output_raster.nakedPointer() );
+  
+  TePDIInterpolator interpolator;
+  TEAGN_TRUE_OR_RETURN( interpolator.reset( input_raster, interpol,
+    dummy_value), "Interpolator reset error" )
+    
+  TePDIPIManager progress( "Resampling raster", ( out_bands * out_lines ),
+    enable_progress );
+  
+  for( out_band = 0 ; out_band < out_bands ; ++out_band ) {
+    for( out_line = 0 ; out_line < out_lines ; ++out_line ) {
+      in_line = ( (double)out_line) * y_resolution_ratio;
+if ((int)in_line >= (input_raster->params().nlines_-1))
+  in_line = (double)(input_raster->params().nlines_-1);
+    
+      for( out_col = 0 ; out_col < out_cols ; ++out_col ) {
+        in_col = ( (double)out_col) * x_resolution_ratio;
+  if ((int)in_col >= (input_raster->params().ncols_-1))
+  in_col = (double)(input_raster->params().ncols_-1);
+      
+        interpolator.interpolate( in_line, in_col, out_band, value );
+
+    if (value>255)
+      value=255;
+    else if (value<0)
+      value=0;
+    
+        TEAGN_TRUE_OR_RETURN( output_raster_ref.setElement( out_col, 
+          out_line, value, out_band ), "Output raster writing error" )
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by user" );
+    }
+  }
+  
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIPCAWaveletFusion.hpp b/src/terralib/image_processing/TePDIPCAWaveletFusion.hpp
new file mode 100644
index 0000000..31930dc
--- /dev/null
+++ b/src/terralib/image_processing/TePDIPCAWaveletFusion.hpp
@@ -0,0 +1,138 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPCAWAVELETFUSION_HPP
+  #define TEPDIPCAWAVELETFUSION_HPP
+
+  #include "TePDILevelRemap.hpp"
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIInterpolator.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @class TePDIPCAWaveletFusion
+   * @brief Image fusion using principal components.
+   * @warning This class is under development and may produce incorrect 
+   * results or generate execution errors, please wait for the next version.   
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @ingroup PDIFusionAlgorithms
+   *
+   * @note The required parameters are:
+   *
+   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Low resolution rasters.
+   * @param bands (std::vector< int >) - The bands from each low resolution raster.
+   * @param output_rasters (TePDITypes::TePDIRasterVectorType) - High resolution fused rasters.
+   * @param reference_raster (TePDITypes::TePDIRasterPtrType) - High resolution raster.
+   * @param reference_raster_band (int) - Reference raster band number.
+   * @param pca1_levels (int) - Decomposition levels for the PCA1 component.
+   * @param reference_levels (int) - Decomposition levels for each reference raster.
+   * @param filter_file (std::string) - The filter file name.
+   * @param resampling_type (TePDIPCAWaveletFusion::InterpMethod) - Resampling type.
+   * @param fit_histogram (bool) - Fit histogram before the substitutionion raster.
+   *
+   */
+  class PDI_DLL TePDIPCAWaveletFusion : public TePDIAlgorithm {
+    public :
+      /**
+       * @enum Allowed interpolation methods.
+       */      
+      enum InterpMethod {
+        /** No interpolation method. */
+        Nothing = 0,
+        /** Near neighborhood interpolation method. */
+        NNMethod = 1,
+        /** Bilinear interpolation method. */
+        BilinearMethod = 2,
+        /** Bicubic interpolation method. */
+        BicubicMethod = 3      
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIPCAWaveletFusion();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIPCAWaveletFusion();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+      
+    protected :
+      
+      /**
+       * @brief Decide the direction of the analysis based on the analysis_type parameter.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState(const TePDIParameters&);
+      
+      /**
+       * @brief Raster resampling to new resolution, forcing lines and columns.
+       * @param input_raster Input raster.
+       * @param output_raster Output raster.
+       * @param x_resolution_ratio X resolution ratio.
+       * @param y_resolution_ratio Y resolution ratio.
+       * @param l Output raster Lines.
+       * @param c Output raster Columns.
+       * @param interpol Interpolation method.
+       * @param enable_progress Enable/disable the progress interface.
+       * @return true if OK, false on errors.
+       * 
+       * @note ( resolution_ratio = output_resolution / input_resolution ).
+       */      
+      bool resampleRasterByResLinsCols(
+        const TePDITypes::TePDIRasterPtrType& input_raster,
+        const TePDITypes::TePDIRasterPtrType& output_raster,
+        double x_resolution_ratio,
+        double y_resolution_ratio,
+        int l,
+        int c,
+        TePDIInterpolator::InterpMethod interpol,
+        bool enable_progress );        
+  };
+  
+/** @example TePDIPCAWaveletFusion_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDIPCAWAVELETFUSION_HPP
diff --git a/src/terralib/image_processing/TePDIPIManager.cpp b/src/terralib/image_processing/TePDIPIManager.cpp
old mode 100755
new mode 100644
index d946b46..8409e4d
--- a/src/terralib/image_processing/TePDIPIManager.cpp
+++ b/src/terralib/image_processing/TePDIPIManager.cpp
@@ -1,189 +1,179 @@
-#include "TePDIPIManager.hpp"
-
-#include <TeAgnostic.h>
-
-/* Forcing the instantiation of global settings 
-   to avoid thread racing condition */
-namespace {
-  static TePDIPIManagerGlobalSettings& globalsettings = 
-    TePDIPIManagerGlobalSettings::instance();
-}
-
-TePDIPIManager::TePDIPIManager( const std::string& message, 
-  unsigned long int tsteps, bool enabled )
-{
-  enabled_ = false;
-  total_steps_ = tsteps;
-  curr_step_ = 0;
-  message_ = message;
-  
-  if( enabled ) {
-    Toggle( true );
-  }
-}
-
-
-TePDIPIManager::~TePDIPIManager()
-{
-  Toggle( false );
-}
-
-
-void TePDIPIManager::Toggle( bool enabled )
-{
-  TeProgressBase* prog_intef_ptr = TeProgress::instance();
-  
-  if( prog_intef_ptr ) {
-    TePDIPIManagerGlobalSettings& global_settings = 
-      TePDIPIManagerGlobalSettings::instance();
-    
-    if( ( ! enabled_ ) && enabled && ( total_steps_ > 0 ) ) {
-      /* Need to enable this instance */
-     
-      global_settings.lock_.lock();
-
-      if( global_settings.active_manager_instances_ == 0 ) {
-        /* No instance has control */
-        
-        global_settings.total_steps_ = total_steps_;
-        global_settings.curr_step_ = curr_step_;
-        /* keeping global_settings.curr_prop_step_ */
-        global_settings.active_manager_instances_ = 1;
-        global_settings.curr_message_ = message_;
-      } else {
-        /* More instances are controling */
-        
-        global_settings.total_steps_ += total_steps_;
-        global_settings.curr_step_ += curr_step_;
-        /* Keeping global_settings.curr_prop_step_ */
-        global_settings.active_manager_instances_ += 1;
-        global_settings.curr_message_.clear();
-      }
-      
-      enabled_ = true;
-      
-      updateProgressInterface( global_settings, prog_intef_ptr );
-      
-      global_settings.lock_.unLock();
-    } if( enabled_ && ( ! enabled ) ) {
-      /* Need to disable this instance */
-      
-      global_settings.lock_.lock();
-
-      if( global_settings.active_manager_instances_ == 1 ) {
-        /* Just this instance has control */
-        
-        global_settings.total_steps_ = 0;
-        global_settings.curr_step_ = 0;
-        /* keeping global_settings.curr_prop_step_ */
-        global_settings.active_manager_instances_ = 0;
-        global_settings.curr_message_.clear();
-      } else {
-        /* More instance are controling */
-        
-        /* keeping global_settings.total_steps_ */
-        global_settings.curr_step_ += ( total_steps_ - curr_step_ );
-        /* keeping global_settings.curr_prop_step_ */
-        global_settings.active_manager_instances_ -= 1;
-      }
-      
-      enabled_ = false;
-      
-      updateProgressInterface( global_settings, prog_intef_ptr );
-      
-      global_settings.lock_.unLock();      
-    }
-  }
-}
-
-
-bool TePDIPIManager::updateProgressInterface( 
-  TePDIPIManagerGlobalSettings& settings,
-  TeProgressBase* prog_intef_ptr ) const
-{
-  if( prog_intef_ptr->wasCancelled() ) {
-    if( settings.active_manager_instances_ == 0 ) {
-      prog_intef_ptr->reset();
-      return false;
-    } else {
-      return true;
-    }
-  } else {
-    if( settings.active_manager_instances_ == 0 ) {
-      settings.curr_prop_step_ = 0;
-      prog_intef_ptr->reset();    
-    } else {
-      unsigned long int new_prop_step = (unsigned long int)
-        ( 100.0 * 
-        ( ((double)settings.curr_step_) / 
-        ( (double)settings.total_steps_ ) ) );
-          
-      if( new_prop_step > settings.curr_prop_step_ ) {
-        prog_intef_ptr->setMessage( settings.curr_message_ );
-        prog_intef_ptr->setTotalSteps( 100 );
-        prog_intef_ptr->setProgress( new_prop_step );
-        
-        settings.curr_prop_step_ = new_prop_step;
-      }
-    } 
-    
-    return false; 
-  }
-}
-
-
-bool TePDIPIManager::Update( unsigned long int step )
-{
-  if( step > total_steps_ ) {
-    step = total_steps_;
-  }
-  
-  TeProgressBase* prog_intef_ptr = TeProgress::instance();
-  
-  if( enabled_ && prog_intef_ptr && ( step > curr_step_ ) ) {
-    TePDIPIManagerGlobalSettings& global_settings = 
-      TePDIPIManagerGlobalSettings::instance();
-    
-    global_settings.lock_.lock();
-
-    /* keeping global_settings.total_steps_ */
-    global_settings.curr_step_ += ( step - curr_step_ );
-    /* keeping global_settings.curr_prop_step_ */
-    /* keeping global_settings.active_manager_instances_ */
-    
-    curr_step_ = step;
-    
-    bool return_value = updateProgressInterface( global_settings, 
-      prog_intef_ptr );
-    
-    global_settings.lock_.unLock();      
-  
-    return return_value;
-  } else {
-    return false;
-  }
-}
-
-
-bool TePDIPIManager::Increment()
-{
-  return Update( (int)( curr_step_ + 1 ) );
-}
-
-
-void TePDIPIManager::Reset( const std::string& message, 
-  unsigned long int tsteps )
-{
-  bool old_enabled_state = enabled_;
-  
-  Toggle( false );
-  
-  total_steps_ = tsteps; 
-  curr_step_ = 0;
-  message_ = message;
-
-  if( old_enabled_state ) {
-    Toggle( true );
-  }  
-}
-
+#include "TePDIPIManager.hpp"
+
+#include <TeAgnostic.h>
+
+/* Forcing the instantiation of global settings 
+   to avoid thread racing condition */
+namespace {
+  static TePDIPIManagerGlobalSettings& globalsettings = 
+    TePDIPIManagerGlobalSettings::instance();
+}
+
+TePDIPIManager::TePDIPIManager( const std::string& message, 
+  unsigned long int tsteps, bool enabled )
+  : global_settings_( TePDIPIManagerGlobalSettings::instance() )
+{
+  enabled_ = false;
+  total_steps_ = tsteps;
+  curr_step_ = 0;
+  prog_intef_ptr_ = TeProgress::instance();
+  message_ = message;
+  
+  if( enabled ) {
+    Toggle( true );
+  }
+}
+
+TePDIPIManager::TePDIPIManager( const TePDIPIManager& )
+  : global_settings_( TePDIPIManagerGlobalSettings::instance() )
+{
+}
+
+
+TePDIPIManager::~TePDIPIManager()
+{
+  Toggle( false );
+}
+
+
+void TePDIPIManager::Toggle( bool enabled )
+{
+  if( prog_intef_ptr_ ) 
+  {
+    if( ( ! enabled_ ) && enabled && ( total_steps_ > 0 ) ) {
+      /* Need to enable this instance */
+     
+      global_settings_.lock_.lock();
+
+      if( global_settings_.active_manager_instances_ == 0 ) {
+        /* No instance has control */
+        
+        global_settings_.total_steps_ = total_steps_;
+        global_settings_.curr_step_ = curr_step_;
+        /* keeping global_settings.curr_prop_step_ */
+        global_settings_.active_manager_instances_ = 1;
+        global_settings_.curr_message_ = message_;
+      } else {
+        /* More instances are controling */
+        
+        global_settings_.total_steps_ += total_steps_;
+        global_settings_.curr_step_ += curr_step_;
+        /* Keeping global_settings.curr_prop_step_ */
+        global_settings_.active_manager_instances_ += 1;
+        global_settings_.curr_message_.clear();
+      }
+      
+      enabled_ = true;
+      
+      updateProgressInterface();
+      
+      global_settings_.lock_.unLock();
+    } if( enabled_ && ( ! enabled ) ) {
+      /* Need to disable this instance */
+      
+      global_settings_.lock_.lock();
+
+      if( global_settings_.active_manager_instances_ == 1 ) {
+        /* Just this instance has control */
+        
+        global_settings_.total_steps_ = 0;
+        global_settings_.curr_step_ = 0;
+        /* keeping global_settings.curr_prop_step_ */
+        global_settings_.active_manager_instances_ = 0;
+        global_settings_.curr_message_.clear();
+      } else {
+        /* More instance are controling */
+        
+        /* keeping global_settings.total_steps_ */
+        global_settings_.curr_step_ += ( total_steps_ - curr_step_ );
+        /* keeping global_settings.curr_prop_step_ */
+        global_settings_.active_manager_instances_ -= 1;
+      }
+      
+      enabled_ = false;
+      
+      updateProgressInterface();
+      
+      global_settings_.lock_.unLock();      
+    }
+  }
+}
+
+
+bool TePDIPIManager::updateProgressInterface() const
+{
+  if( prog_intef_ptr_->wasCancelled() ) {
+    if( global_settings_.active_manager_instances_ == 0 ) {
+      prog_intef_ptr_->reset();
+      return false;
+    } else {
+      return true;
+    }
+  } else {
+    if( global_settings_.active_manager_instances_ == 0 ) 
+    {
+      global_settings_.curr_prop_step_ = 0;
+      prog_intef_ptr_->reset();    
+    } else {
+      unsigned long int new_prop_step = (unsigned long int)
+        ( 100.0 * 
+        ( ((double)global_settings_.curr_step_) / 
+        ( (double)global_settings_.total_steps_ ) ) );
+          
+      if( new_prop_step > global_settings_.curr_prop_step_ ) {
+        prog_intef_ptr_->setMessage( global_settings_.curr_message_ );
+        prog_intef_ptr_->setTotalSteps( 100 );
+        prog_intef_ptr_->setProgress( new_prop_step );
+        
+        global_settings_.curr_prop_step_ = new_prop_step;
+      }
+    } 
+    
+    return false; 
+  }
+}
+
+
+bool TePDIPIManager::Update( unsigned long int step )
+{
+  if( step > total_steps_ ) {
+    step = total_steps_;
+  }
+  
+  if( enabled_ && prog_intef_ptr_ && ( step > curr_step_ ) ) 
+  {
+    global_settings_.lock_.lock();
+
+    /* keeping global_settings.total_steps_ */
+    global_settings_.curr_step_ += ( step - curr_step_ );
+    /* keeping global_settings.curr_prop_step_ */
+    /* keeping global_settings.active_manager_instances_ */
+    
+    curr_step_ = step;
+    
+    bool return_value = updateProgressInterface();
+    
+    global_settings_.lock_.unLock();      
+  
+    return return_value;
+  } else {
+    return false;
+  }
+}
+
+void TePDIPIManager::Reset( const std::string& message, 
+  unsigned long int tsteps )
+{
+  bool old_enabled_state = enabled_;
+  
+  Toggle( false );
+  
+  total_steps_ = tsteps; 
+  curr_step_ = 0;
+  message_ = message;
+
+  if( old_enabled_state ) {
+    Toggle( true );
+  }  
+}
+
diff --git a/src/terralib/image_processing/TePDIPIManager.hpp b/src/terralib/image_processing/TePDIPIManager.hpp
old mode 100755
new mode 100644
index 15406ab..9f1c732
--- a/src/terralib/image_processing/TePDIPIManager.hpp
+++ b/src/terralib/image_processing/TePDIPIManager.hpp
@@ -1,137 +1,162 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIPIMANAGER_HPP
-  #define TEPDIPIMANAGER_HPP
-  
-  #include "TePDIPIManagerGlobalSettings.hpp"
-  
-  #include <TeProgress.h>
-  
-  #include <string>
-
-  /**
-   * @brief This is the class for the active progress interface management.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAux
-   */
-  class PDI_DLL TePDIPIManager {
-  
-    public :
-    
-      /**
-       * @brief Default Constructor
-       *
-       * @param message Progress window message (label).
-       * @param tsteps Progress window total steps.
-       * @param enabled Flag to enable ( true ) or disable ( false ).
-       */
-      TePDIPIManager( const std::string& message = std::string(), 
-        unsigned long int tsteps = 0, bool enabled = false );    
-    
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIPIManager();
-      
-      /**
-       * @brief Enable / Disable the current progress interface manager.
-       *
-       * @param enabled Flag to enable ( true ) or disable ( false ).
-       */
-      void Toggle( bool enabled );  
-      
-      /**
-       * @brief Update the current progress interface to the supplied step.
-       *
-       * @param step Current step.
-       * @return true if the interface was canceled, false otherwise.
-       */
-      bool Update( unsigned long int step );      
-      
-      /**
-       * @brief Incriments the the current progress by one step.
-       * @return true if the interface was canceled, false otherwise.
-       */
-      bool Increment();
-
-      /**
-       * @brief Reset the current instance state.
-       * 
-       * @param message Message (label).
-       * @param tsteps Total steps.
-       */
-      void Reset( const std::string& message = std::string(), 
-        unsigned long int tsteps = 0 );
-        
-    protected :
-    
-      /**
-        * @brief A flag indicating if the PI manager is enabled.
-        */
-      bool enabled_;    
-
-      /**
-        * @brief The total steps number.
-        */
-      unsigned long int total_steps_;
-
-      /**
-        * @brief The current step.
-        */
-      unsigned long int curr_step_;
-      
-      /**
-        * @brief The progress interface message (label).
-        */
-      std::string message_;    
-     
-      /**
-       * @brief Updates the progress interface with the new settings.
-       * @note NO LOCK DONE !!
-       * @param settings The new progress interface manager to be applied.
-       * @param prog_intef_ptr Progres interface pointer.
-       * @return true if the interface was canceled, false otherwise.
-       */         
-      bool updateProgressInterface( 
-        TePDIPIManagerGlobalSettings& settings,
-        TeProgressBase* prog_intef_ptr ) const;
-        
-    private :
-    
-      /**
-       * @brief Alternative Constructor
-       */    
-      TePDIPIManager( const TePDIPIManager& ) {};
-      
-      /**
-       * @brief operator= overload.
-       */    
-      const TePDIPIManager& operator=( const TePDIPIManager& ) 
-      { 
-        return *this;
-      };
-  };
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPIMANAGER_HPP
+  #define TEPDIPIMANAGER_HPP
+  
+  #include "TePDIPIManagerGlobalSettings.hpp"
+  
+  #include <TeProgress.h>
+  
+  #include <string>
+
+  /**
+   * @class TePDIPIManager
+   * @brief This is the class for the active progress interface management.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @note This class is not thread safe by itself but multiple threads
+   * can access the global progress interface by instantiating their own
+   * TePDIPIManager instances.
+   * @ingroup PDIAux
+   */
+  class PDI_DLL TePDIPIManager {
+  
+    public :
+    
+      /**
+       * @brief Default Constructor
+       *
+       * @param message Progress window message (label).
+       * @param tsteps Progress window total steps.
+       * @param enabled Flag to enable ( true ) or disable ( false ).
+       */
+      TePDIPIManager( const std::string& message = std::string(), 
+        unsigned long int tsteps = 0, bool enabled = false );    
+    
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIPIManager();
+      
+      /**
+       * @brief Enable / Disable the current progress interface manager.
+       *
+       * @param enabled Flag to enable ( true ) or disable ( false ).
+       */
+      void Toggle( bool enabled );  
+      
+      /**
+       * @brief Update the current progress interface to the supplied step.
+       *
+       * @param step Current step.
+       * @return true if the interface was canceled, false otherwise.
+       */
+      bool Update( unsigned long int step );      
+      
+      /**
+       * @brief Incriments the the current progress by one step.
+       * @return true if the interface was canceled, false otherwise.
+       */
+      inline bool Increment()
+      {
+        return Update( (int)( curr_step_ + 1 ) );
+      };
+
+      /**
+       * @brief Reset the current instance state.
+       * 
+       * @param message Message (label).
+       * @param tsteps Total steps.
+       */
+      void Reset( const std::string& message = std::string(), 
+        unsigned long int tsteps = 0 );
+        
+      /**
+       * @brief Returns true if the progress was canceled.
+       * @return Returns true if the progress was canceled.
+       */
+      inline bool wasCanceled()
+      {
+        return ( prog_intef_ptr_ ? prog_intef_ptr_->wasCancelled() : false );
+      };         
+        
+    protected :
+    
+      /**
+        * @brief A flag indicating if the PI manager is enabled.
+        */
+      bool enabled_;    
+
+      /**
+        * @brief The total steps number.
+        */
+      unsigned long int total_steps_;
+
+      /**
+        * @brief The current step.
+        */
+      unsigned long int curr_step_;
+      
+      /**
+        * @brief A reference to the global settings instance.
+        */      
+      TePDIPIManagerGlobalSettings& global_settings_;
+      
+      /**
+        * @brief A pointer to the active progress instance.
+        * @note null if no active instance is present.
+        */        
+      TeProgressBase* prog_intef_ptr_;
+      
+      /**
+        * @brief The progress interface message (label).
+        */
+      std::string message_;    
+     
+      /**
+       * @brief Updates the progress interface with the new settings.
+       * @note NO LOCK DONE !!
+       * @param settings The new progress interface manager to be applied.
+       * @param prog_intef_ptr Progres interface pointer.
+       * @return true if the interface was canceled, false otherwise.
+       */         
+      bool updateProgressInterface() const;
+        
+    private :
+    
+      /**
+       * @brief Alternative Constructor
+       */    
+      TePDIPIManager( const TePDIPIManager& );
+      
+      /**
+       * @brief operator= overload.
+       */    
+      const TePDIPIManager& operator=( const TePDIPIManager& ) 
+      { 
+        return *this;
+      };
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDIPIManagerGlobalSettings.hpp b/src/terralib/image_processing/TePDIPIManagerGlobalSettings.hpp
index 9a9704a..39a1365 100644
--- a/src/terralib/image_processing/TePDIPIManagerGlobalSettings.hpp
+++ b/src/terralib/image_processing/TePDIPIManagerGlobalSettings.hpp
@@ -1,98 +1,98 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIPIMANAGERGLOBALSETTINGS_HPP
-  #define TEPDIPIMANAGERGLOBALSETTINGS_HPP
-  
-  #include "TePDIDefines.hpp"
-  #include "TePDIPIManager.hpp"
-  
-  #include <TeMutex.h>
-  #include <TeSingleton.h>
-  
-  #include <string>
-
-  /**
-    * @brief Progress interface management global settings.
-    * @ingroup PDIAux
-    */    
-  class PDI_DLL TePDIPIManagerGlobalSettings : public 
-    TeSingleton< TePDIPIManagerGlobalSettings > {
-    
-      friend class TePDIPIManager;
-      
-    public :
-    
-      /**
-        * @brief Default constructor.
-        */
-      TePDIPIManagerGlobalSettings()
-      {
-        total_steps_ = 0;
-        curr_step_ = 0;
-        curr_prop_step_ = 0;
-        active_manager_instances_ = 0;
-      };         
-    
-      /**
-        * @brief Default desstructor.
-        */
-      ~TePDIPIManagerGlobalSettings() {};
-     
-    protected :
-    
-      /**
-        * @brief The lock instance needed to update the global
-        * settings.
-        */
-      TeMutex lock_;
-              
-      /**
-        * @brief The total steps number.
-        */
-      unsigned long int total_steps_;
-      
-      /**
-        * @brief The current step.
-        */
-      unsigned long int curr_step_;
-      
-      /**
-        * @brief The current proportional step ( 0 up to 100 ).
-        */
-      unsigned long int curr_prop_step_;    
-      
-      /**
-        * @brief The number of TePDIPIManager active instances.
-        */
-      unsigned long int active_manager_instances_;                   
-      
-      /**
-        * @brief The progress interface message (label).
-        */
-      std::string curr_message_;          
-  
-  };     
-      
-#endif    
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPIMANAGERGLOBALSETTINGS_HPP
+  #define TEPDIPIMANAGERGLOBALSETTINGS_HPP
+  
+  #include "TePDIDefines.hpp"
+  #include "TePDIPIManager.hpp"
+  
+  #include <TeMutex.h>
+  #include <TeSingleton.h>
+  
+  #include <string>
+
+  /**
+    * @brief Progress interface management global settings.
+    * @ingroup PDIAux
+    */    
+  class PDI_DLL TePDIPIManagerGlobalSettings : public 
+    TeSingleton< TePDIPIManagerGlobalSettings > {
+    
+      friend class TePDIPIManager;
+      
+    public :
+    
+      /**
+        * @brief Default constructor.
+        */
+      TePDIPIManagerGlobalSettings()
+      {
+        total_steps_ = 0;
+        curr_step_ = 0;
+        curr_prop_step_ = 0;
+        active_manager_instances_ = 0;
+      };         
+    
+      /**
+        * @brief Default desstructor.
+        */
+      ~TePDIPIManagerGlobalSettings() {};
+     
+    protected :
+    
+      /**
+        * @brief The lock instance needed to update the global
+        * settings.
+        */
+      TeMutex lock_;
+              
+      /**
+        * @brief The total steps number.
+        */
+      unsigned long int total_steps_;
+      
+      /**
+        * @brief The current step.
+        */
+      unsigned long int curr_step_;
+      
+      /**
+        * @brief The current proportional step ( 0 up to 100 ).
+        */
+      unsigned long int curr_prop_step_;    
+      
+      /**
+        * @brief The number of TePDIPIManager active instances.
+        */
+      unsigned long int active_manager_instances_;                   
+      
+      /**
+        * @brief The progress interface message (label).
+        */
+      std::string curr_message_;          
+  
+  };     
+      
+#endif    
diff --git a/src/terralib/image_processing/TePDIParaSegBaatzStrategy.cpp b/src/terralib/image_processing/TePDIParaSegBaatzStrategy.cpp
new file mode 100644
index 0000000..48ff233
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegBaatzStrategy.cpp
@@ -0,0 +1,170 @@
+#include "TePDIParaSegBaatzStrategy.hpp"
+
+#include "TePDIParaSegRegGrowStrategy.hpp"
+#include "TePDIUtils.hpp"
+
+#include <TeAgnostic.h>
+
+#include <map>
+
+TePDIParaSegBaatzStrategy::TePDIParaSegBaatzStrategy( 
+  const TePDIParaSegStrategyParams& params )
+  : TePDIParaSegStrategy( params ), eucTreshold_( 0 )
+{
+  segmenter_.ToggleProgInt( false );
+}
+
+
+TePDIParaSegBaatzStrategy::~TePDIParaSegBaatzStrategy()
+{
+}
+
+bool TePDIParaSegBaatzStrategy::execute( const RasterDataVecT& 
+  rasterDataVector, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& 
+  outSegsMatrix )
+{
+  TEAGN_DEBUG_CONDITION( rasterDataVector.size(), "Empty data vector" )
+
+  // Globals 
+  
+  const unsigned int nLines = rasterDataVector[ 0 ].GetLines();
+  const unsigned int nCols = rasterDataVector[ 0 ].GetColumns();      
+  const unsigned int nBands = (unsigned int)rasterDataVector.size();  
+  
+  // Copy data from data vector to the internal raster instance
+  
+  {
+    // Initiating the input raster
+    
+    if( ( ! inputRasterPtr_.isActive() ) ||
+      ( inputRasterPtr_->params().nBands() != (int)nBands )
+      || ( inputRasterPtr_->params().nlines_ != (int)nLines ) 
+      || ( inputRasterPtr_->params().ncols_ != (int)nCols ) )
+    {
+      TeRasterParams inRasterParams;
+      inRasterParams.nBands( nBands );
+      inRasterParams.setDataType( TeDOUBLE, -1 );
+      inRasterParams.setNLinesNColumns( nLines, nCols );
+      
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( inRasterParams,
+       inputRasterPtr_ ), "Error creating output raster" );
+    }
+    
+    // Copy data
+    
+    unsigned int line = 0;
+    unsigned int col = 0;
+    unsigned int band = 0;
+    double const* linePtr = 0;
+    TeDecoder& inputRasterDecoder = *(inputRasterPtr_->decoder());
+    
+    for( band = 0 ; band < nBands ; ++band )
+    {
+      for( line = 0 ; line < nLines ; ++line )
+      {
+        linePtr = rasterDataVector[ band ][ line ];
+      
+        for( col = 0 ; col < nCols ; ++col )
+        {
+          TEAGN_TRUE_OR_RETURN( inputRasterDecoder.setElement( col, line, 
+            linePtr[ col ], band ), "Error writing input raster" )
+        }
+      }
+    }
+  }
+
+  // Initiating the output raster
+    
+  if( ! outputRasterPtr_.isActive() )
+  {
+    TeRasterParams outRasterParams;
+    outRasterParams.nBands( 1 );
+    outRasterParams.setDataType( TeUNSIGNEDLONG, -1 );
+    outRasterParams.setNLinesNColumns( 1, 1 );
+    
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRasterParams,
+     outputRasterPtr_ ), "Error creating output raster" );
+  }
+  
+  // Updating segmenter algorithm parameters
+  
+  std::vector<unsigned> input_channels;
+  for( unsigned int band = 0 ; band < nBands ; ++band )
+  {
+    input_channels.push_back( band );
+  }
+  
+  segParams_.SetParameter( "input_channels", input_channels );
+  segParams_.SetParameter( "input_image", inputRasterPtr_ );
+  segParams_.SetParameter( "output_image", outputRasterPtr_ );
+  
+  // Running the algorithm
+
+  TEAGN_TRUE_OR_RETURN( segmenter_.Apply( segParams_ ),
+    "Segmentation error" );
+    
+  // Creating the segment objects
+  
+  TEAGN_TRUE_OR_RETURN( TePDIParaSegRegGrowStrategy::createSegsBlkFromLImg<
+    TePDIParaSegBaatzStrategy >( rasterDataVector, *outputRasterPtr_, 
+    this, outSegsMatrix  ),
+    "Error creating output segments" );    
+
+  return true;
+}
+
+bool TePDIParaSegBaatzStrategy::mergeSegments( 
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& centerMatrix,
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* topMatrixPtr,
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* leftMatrixPtr )
+{
+  return TePDIParaSegRegGrowStrategy::staticMergeSegments( 
+    centerMatrix, topMatrixPtr, leftMatrixPtr, eucTreshold_ );
+}
+
+bool TePDIParaSegBaatzStrategy::setParameters( 
+  const TePDIParameters& params )
+{
+  TEAGN_TRUE_OR_RETURN( params.GetParameter( "euc_treshold", eucTreshold_),
+    "Missing parameter euc_treshold" );
+    
+  float scale = 0;
+  TEAGN_TRUE_OR_RETURN( params.GetParameter( "scale", scale),
+    "Missing parameter scale" );
+    
+  float compactness = 0;
+  TEAGN_TRUE_OR_RETURN( params.GetParameter( "compactness", compactness),
+    "Missing parameter compactness" );    
+    
+  float color = 0;
+  TEAGN_TRUE_OR_RETURN( params.GetParameter( "color", color),
+    "Missing parameter color" );     
+     
+  std::vector<float> input_weights;
+  TEAGN_TRUE_OR_RETURN( params.GetParameter( "input_weights", input_weights),
+    "Missing parameter input_weights" );     
+  
+  segParams_.Clear();
+  segParams_.SetParameter( "euc_treshold", eucTreshold_ );
+  segParams_.SetParameter( "scale", scale );
+  segParams_.SetParameter( "compactness", compactness );
+  segParams_.SetParameter( "color", color );
+  segParams_.SetParameter( "input_weights", input_weights );
+
+  return true;
+}
+
+unsigned int TePDIParaSegBaatzStrategy::getMemUsageEst( 
+  unsigned int channelsNumber ) const
+{
+  return 2 * (
+    // internal Raster used as algorithm input
+    ( channelsNumber * sizeof( double ) )
+    // internal algorithm structures
+    + sizeof( segment* ) 
+    // segment structure
+    + sizeof( segment )
+    // segment_pixel
+    + sizeof( segment_pixel )
+    );
+};
diff --git a/src/terralib/image_processing/TePDIParaSegBaatzStrategy.hpp b/src/terralib/image_processing/TePDIParaSegBaatzStrategy.hpp
new file mode 100644
index 0000000..e357073
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegBaatzStrategy.hpp
@@ -0,0 +1,98 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARASEGBAATZSTRATEGY_HPP
+  #define TEPDIPARASEGBAATZSTRATEGY_HPP
+
+  #include "TePDIParaSegStrategy.hpp"
+  #include "TePDIBaatz.hpp"
+  
+  #include <vector>
+
+  /*!
+      \class TePDIParaSegBaatzStrategy
+      \brief Multi-threaded image segmenter Region Growing strategy.
+      \author Thales Sehn Korting <tkorting at dpi.inpe.br>.
+      \ingroup PDIStrategies
+      \note The strategy name that must be used to construct an instance
+      of this class is "Baatz".
+      
+      \note The general required parameters :
+      \param scale (float) Parameter scale is > 0 (Has direct influence
+      over the generated segments size).
+      \param compactness (float) Parameter compactness is > 0 and <= 1 (
+      compactness = perimeter / sqrt( area ) ).
+      \param color (float) Parameter color is > 0 and <= 1 (the relative ratio
+      between spacial components and spectral components).
+      \param input_weights (std::vector<float>) one weight for each input image channel
+      \param euc_treshold (double) - Maximum eclidean distance between each
+      segment (This parameter is used to merge adjacent segments from
+      adjacent image blocks).
+*/
+  class PDI_DLL TePDIParaSegBaatzStrategy : public TePDIParaSegStrategy
+  {
+    public :
+         
+      // This method has the same parameters as the 
+      // TePDIParaSegStrategy constructor
+      TePDIParaSegBaatzStrategy( const TePDIParaSegStrategyParams& params );
+  
+      ~TePDIParaSegBaatzStrategy();
+      
+      // overloaded
+      bool execute( const RasterDataVecT& rasterDataVector, 
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& outSegsMatrix );      
+        
+      //overloaded
+      bool setParameters( const TePDIParameters& params );         
+    
+      //overloaded
+      bool mergeSegments( 
+       TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& centerMatrix,
+       TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* topMatrixPtr,
+       TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* leftMatrixPtr ); 
+       
+      //overloaded
+      unsigned int getMemUsageEst( unsigned int channelsNumber ) const;
+      
+    protected :
+      
+      /*! A raster generated from the input raster data vector. */      
+      TePDITypes::TePDIRasterPtrType inputRasterPtr_;
+      
+      /*! A raster generated from the segmentation. */      
+      TePDITypes::TePDIRasterPtrType outputRasterPtr_;
+      
+      /*! Segmentation algorithm parameters */      
+      TePDIParameters segParams_;
+      
+      /*! Segmenter instance */
+      TePDIBaatz segmenter_;
+      
+      /*! Maximum allowed euclidean distance parameter */
+      double eucTreshold_;
+
+  };
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIParaSegBaatzStrategyFactory.cpp b/src/terralib/image_processing/TePDIParaSegBaatzStrategyFactory.cpp
new file mode 100644
index 0000000..18cb0e7
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegBaatzStrategyFactory.cpp
@@ -0,0 +1,24 @@
+#include "TePDIParaSegBaatzStrategyFactory.hpp"
+#include "TePDIParaSegBaatzStrategy.hpp"
+
+namespace
+{
+  TePDIParaSegBaatzStrategyFactory tePDIParaSegBaatzStrategyFactoryInstance_;
+}
+
+TePDIParaSegBaatzStrategyFactory::TePDIParaSegBaatzStrategyFactory()
+  : TePDIParaSegStrategyFactory( "Baatz" )
+{
+}
+
+TePDIParaSegBaatzStrategyFactory::~TePDIParaSegBaatzStrategyFactory()
+{
+}
+
+TePDIParaSegStrategy* TePDIParaSegBaatzStrategyFactory::build( 
+  const TePDIParaSegStrategyFactoryParams& arg )
+{
+  return new TePDIParaSegBaatzStrategy( arg.stratParams_ );
+}
+
+
diff --git a/src/terralib/image_processing/TePDIParaSegBaatzStrategyFactory.hpp b/src/terralib/image_processing/TePDIParaSegBaatzStrategyFactory.hpp
new file mode 100644
index 0000000..ce211fd
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegBaatzStrategyFactory.hpp
@@ -0,0 +1,49 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARASEGBAATZSTRATEGYFACTORY_HPP
+  #define TEPDIPARASEGBAATZSTRATEGYFACTORY_HPP
+
+  #include "TePDIParaSegStrategyFactory.hpp"
+
+  /*!
+      \class TePDIParaSegBaatzStrategyFactory
+      \brief Multi-threaded image segmenter Baatz strategy factory.
+      \author Thales Sehn Korting<tkorting at dpi.inpe.br>.
+      \ingroup PDIStrategiesFactories
+  */
+  class PDI_DLL TePDIParaSegBaatzStrategyFactory : 
+    public TePDIParaSegStrategyFactory
+  {
+    public :
+
+      TePDIParaSegBaatzStrategyFactory();
+      ~TePDIParaSegBaatzStrategyFactory();
+      
+      //overload
+      TePDIParaSegStrategy* build( const TePDIParaSegStrategyFactoryParams& 
+        arg );
+  };   
+
+#endif
diff --git a/src/terralib/image_processing/TePDIParaSegRegGrowStrategy.cpp b/src/terralib/image_processing/TePDIParaSegRegGrowStrategy.cpp
new file mode 100644
index 0000000..78d14fb
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegRegGrowStrategy.cpp
@@ -0,0 +1,449 @@
+#include "TePDIParaSegRegGrowStrategy.hpp"
+
+#include "TePDIUtils.hpp"
+
+#include <TeAgnostic.h>
+
+#include <limits.h>
+
+#include <map>
+
+TePDIParaSegRegGrowStrategy::MergingSegmentInfo::MergingSegmentInfo()
+: segPtr_( 0 ), mtxPtr_( 0 ), jointBorderLenght_( 0 )
+{
+}
+
+TePDIParaSegRegGrowStrategy::MergingSegmentInfo::~MergingSegmentInfo()
+{
+}
+
+TePDIParaSegRegGrowStrategy::TePDIParaSegRegGrowStrategy( 
+  const TePDIParaSegStrategyParams& params )
+  : TePDIParaSegStrategy( params ), eucTreshold_( 0 )
+{
+  segmenter_.ToggleProgInt( false );
+}
+
+
+TePDIParaSegRegGrowStrategy::~TePDIParaSegRegGrowStrategy()
+{
+}
+
+bool TePDIParaSegRegGrowStrategy::execute( const RasterDataVecT& 
+  rasterDataVector, TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& 
+  outSegsMatrix )
+{
+  TEAGN_DEBUG_CONDITION( rasterDataVector.size(), "Empty data vector" )
+  
+  // Globals 
+  
+  const unsigned int nLines = rasterDataVector[ 0 ].GetLines();
+  const unsigned int nCols = rasterDataVector[ 0 ].GetColumns();      
+  const unsigned int nBands = (unsigned int)rasterDataVector.size();  
+  
+  // Copy data from data vector to the internal raster instance
+  
+  {
+    // Initiating the input raster
+    
+    if( ( ! inputRasterPtr_.isActive() ) ||
+      ( inputRasterPtr_->params().nBands() != (int)nBands )
+      || ( inputRasterPtr_->params().nlines_ != (int)nLines ) 
+      || ( inputRasterPtr_->params().ncols_ != (int)nCols ) )
+    {
+      TeRasterParams inRasterParams;
+      inRasterParams.nBands( nBands );
+      inRasterParams.setDataType( TeDOUBLE, -1 );
+      inRasterParams.setNLinesNColumns( nLines, nCols );
+      
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( inRasterParams,
+       inputRasterPtr_ ), "Error creating output raster" );
+    }
+    
+    // Copy data
+    
+    unsigned int line = 0;
+    unsigned int col = 0;
+    unsigned int band = 0;
+    double const* linePtr = 0;
+    TeDecoder& inputRasterDecoder = *(inputRasterPtr_->decoder());
+    
+    for( band = 0 ; band < nBands ; ++band )
+    {
+      for( line = 0 ; line < nLines ; ++line )
+      {
+        linePtr = rasterDataVector[ band ][ line ];
+      
+        for( col = 0 ; col < nCols ; ++col )
+        {
+          TEAGN_TRUE_OR_RETURN( inputRasterDecoder.setElement( col, line, 
+            linePtr[ col ], band ), "Error writing input raster" )
+        }
+      }
+    }
+  }
+    
+  // Initiating the output raster
+    
+  if( ! outputRasterPtr_.isActive() )
+  {
+    TeRasterParams outRasterParams;
+    outRasterParams.nBands( 1 );
+    outRasterParams.setDataType( TeUNSIGNEDLONG, -1 );
+    outRasterParams.setNLinesNColumns( 1, 1 );
+    
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRasterParams,
+     outputRasterPtr_ ), "Error creating output raster" );
+  }
+  
+  // Updating segmenter algorithm parameters
+  
+  segParams_.SetParameter( "input_image", inputRasterPtr_ );
+  segParams_.SetParameter( "output_image", outputRasterPtr_ );
+  
+  // Running the algorithm
+  
+  TEAGN_TRUE_OR_RETURN( segmenter_.Apply( segParams_ ),
+    "Segmentation error" );
+    
+  // Creating the segment objects
+  
+  TEAGN_TRUE_OR_RETURN( TePDIParaSegRegGrowStrategy::createSegsBlkFromLImg( 
+    rasterDataVector, *outputRasterPtr_, this, outSegsMatrix  ),
+    "Error creating output segments" );
+  
+  return true;
+}
+
+TePDIParaSegRegGrowStrategy::Segment::Segment()
+: pixelsNumber_( 0 ), wasMerged_( false )
+{
+}
+
+TePDIParaSegRegGrowStrategy::Segment::~Segment()
+{
+}
+
+bool TePDIParaSegRegGrowStrategy::mergeSegments( 
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& centerMatrix,
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* topMatrixPtr,
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* leftMatrixPtr )
+{
+  return TePDIParaSegRegGrowStrategy::staticMergeSegments( 
+    centerMatrix, topMatrixPtr, leftMatrixPtr, eucTreshold_ );
+}
+
+bool TePDIParaSegRegGrowStrategy::staticMergeSegments( 
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& centerMatrix,
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* topMatrixPtr,
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* leftMatrixPtr,
+  double eucTreshold )
+{
+  // Creating the merging segments map
+
+  // Auxiliar maps map
+  // first = current block segment pointer
+  // second.first = other block segment pointer
+  // second.second = info related to outherBlock segments touching the
+  // current block segment.
+  std::map< Segment const*, std::map< Segment const*,
+    TePDIParaSegRegGrowStrategy::MergingSegmentInfo > > auxMapsMap;
+    
+  if( topMatrixPtr )
+  {
+    TEAGN_DEBUG_CONDITION( centerMatrix.GetColumns() == 
+      topMatrixPtr->GetColumns(), 
+      "Block size mismatch" );
+
+    std::map< Segment const*, std::map< Segment const*,
+      TePDIParaSegRegGrowStrategy::MergingSegmentInfo > >::iterator mapsMapIt;
+    std::map< Segment const*, 
+      TePDIParaSegRegGrowStrategy::MergingSegmentInfo >::iterator mapIt;
+      
+    TePDIParaSegRegGrowStrategy::MergingSegmentInfo auxMergSegInfo;
+      
+    Segment const* currBlockSegPtr = 0;
+    Segment const* otherBlockSegPtr = 0;
+    
+    const unsigned int topMatrixLastLineIdx = topMatrixPtr->GetLines() - 1;
+    const unsigned int centerMatrixWidth = centerMatrix.GetColumns();
+      
+    for( unsigned int bCol = 0 ; bCol < centerMatrixWidth ; ++bCol )
+    {
+      currBlockSegPtr = (Segment*)centerMatrix( 0, bCol );
+      otherBlockSegPtr = (Segment*)
+        topMatrixPtr->operator()( topMatrixLastLineIdx, bCol );
+        
+      mapsMapIt = auxMapsMap.find( currBlockSegPtr );
+      
+      if( mapsMapIt == auxMapsMap.end() )
+      {
+        auxMergSegInfo.segPtr_ = otherBlockSegPtr;
+        auxMergSegInfo.mtxPtr_ = topMatrixPtr;
+        auxMergSegInfo.jointBorderLenght_ = 1;
+        
+        auxMapsMap[ currBlockSegPtr ][ otherBlockSegPtr ] = auxMergSegInfo;
+      }
+      else
+      {
+        mapIt = mapsMapIt->second.find( otherBlockSegPtr );
+        
+        if( mapIt == mapsMapIt->second.end() )
+        {
+          auxMergSegInfo.segPtr_ = otherBlockSegPtr;
+          auxMergSegInfo.mtxPtr_ = topMatrixPtr;
+          auxMergSegInfo.jointBorderLenght_ = 1;
+          
+          mapsMapIt->second.operator[]( otherBlockSegPtr ) = auxMergSegInfo;
+        }
+        else
+        {
+          ++(mapIt->second.jointBorderLenght_);
+        }
+      }
+    }
+  }
+  
+  if( leftMatrixPtr )
+  {
+    TEAGN_DEBUG_CONDITION( centerMatrix.GetLines() == 
+      leftMatrixPtr->GetLines(), 
+      "Block size mismatch" );
+           
+    std::map< Segment const*, std::map< Segment const*,
+      TePDIParaSegRegGrowStrategy::MergingSegmentInfo > >::iterator mapsMapIt;
+    std::map< Segment const*, 
+      TePDIParaSegRegGrowStrategy::MergingSegmentInfo >::iterator mapIt;
+      
+    TePDIParaSegRegGrowStrategy::MergingSegmentInfo auxMergSegInfo;
+      
+    Segment const* currBlockSegPtr = 0;
+    Segment const* otherBlockSegPtr = 0;
+    
+    const unsigned int leftMatrixLastColIdx = leftMatrixPtr->GetColumns() - 1;
+    const unsigned int centerMatrixHeight = centerMatrix.GetLines();
+      
+    for( unsigned int bLine = 0 ; bLine < centerMatrixHeight ; ++bLine )
+    {
+      currBlockSegPtr = (Segment*)centerMatrix( bLine, 0 );
+      otherBlockSegPtr = (Segment*)
+        leftMatrixPtr->operator()( bLine, leftMatrixLastColIdx );
+        
+      mapsMapIt = auxMapsMap.find( currBlockSegPtr );
+      
+      if( mapsMapIt == auxMapsMap.end() )
+      {
+        auxMergSegInfo.segPtr_ = otherBlockSegPtr;
+        auxMergSegInfo.mtxPtr_ = leftMatrixPtr;
+        auxMergSegInfo.jointBorderLenght_ = 1;
+        
+        auxMapsMap[ currBlockSegPtr ][ otherBlockSegPtr ] = auxMergSegInfo;
+      }
+      else
+      {
+        mapIt = mapsMapIt->second.find( otherBlockSegPtr );
+        
+        if( mapIt == mapsMapIt->second.end() )
+        {
+          auxMergSegInfo.segPtr_ = otherBlockSegPtr;
+          auxMergSegInfo.mtxPtr_ = leftMatrixPtr;
+          auxMergSegInfo.jointBorderLenght_ = 1;
+          
+          mapsMapIt->second.operator[]( otherBlockSegPtr ) = auxMergSegInfo;
+        }
+        else
+        {
+          ++(mapIt->second.jointBorderLenght_);
+        }
+      }
+    }
+  }
+  
+  // Merging each border segment, if possible
+  
+  {
+    std::map< Segment const*, std::map< Segment const*,
+      TePDIParaSegRegGrowStrategy::MergingSegmentInfo > >::iterator mapsMapIt =
+      auxMapsMap.begin();      
+    std::map< Segment const*, std::map< Segment const*,
+      TePDIParaSegRegGrowStrategy::MergingSegmentInfo > >::iterator mapsMapItEnd =
+      auxMapsMap.end();  
+    std::map< Segment const*, 
+      TePDIParaSegRegGrowStrategy::MergingSegmentInfo >::iterator mapIt;
+    std::map< Segment const*, 
+      TePDIParaSegRegGrowStrategy::MergingSegmentInfo >::iterator mapItEnd;                
+    std::vector< unsigned int > locatedSegsIndexes;
+    unsigned int locatedSegsIndexesIdx = 0;
+    Segment* locatedSegPtr = 0;
+    Segment* currentSegPtr = 0;
+            
+    while( mapsMapIt != mapsMapItEnd )
+    {
+      TEAGN_DEBUG_CONDITION( ! mapsMapIt->first->wasMerged_,
+        "Trying to merge an already merged segment" );
+       
+      TePDIParaSegRegGrowStrategy::MergingSegmentInfoVecT auxMSVec;
+      
+      mapIt = mapsMapIt->second.begin();
+      mapItEnd = mapsMapIt->second.end();
+      
+      while( mapIt != mapItEnd )
+      {
+        auxMSVec.push_back( mapIt->second );
+      
+        ++mapIt;
+      }
+      
+      if( staticLocateMergingSegments( mapsMapIt->first,
+        &(centerMatrix), auxMSVec, locatedSegsIndexes,
+        eucTreshold ) )
+      {
+        TEAGN_DEBUG_CONDITION( locatedSegsIndexes.size(),
+          "Invalid locatedSegsIndexes size" );
+          
+        currentSegPtr = (Segment*)mapsMapIt->first;
+        
+        for( locatedSegsIndexesIdx = 0 ; locatedSegsIndexesIdx < 
+          locatedSegsIndexes.size() ; ++locatedSegsIndexesIdx )
+        {
+          TEAGN_DEBUG_CONDITION( locatedSegsIndexes[ locatedSegsIndexesIdx ] <
+            auxMSVec.size(), "invalid locatedSegsIndexesIdx" );
+            
+          locatedSegPtr = (Segment*)
+            auxMSVec[ locatedSegsIndexes[ locatedSegsIndexesIdx ] ].segPtr_;
+            
+          if( ! locatedSegPtr->wasMerged_ )
+          {
+            locatedSegPtr->wasMerged_ = true;
+            locatedSegPtr->id_ = currentSegPtr->id_;
+            
+            currentSegPtr->wasMerged_ = true;
+          }
+        }
+        
+        if( ! currentSegPtr->wasMerged_ )
+        {
+          locatedSegPtr = (Segment*)
+            auxMSVec[ locatedSegsIndexes[ 0 ] ].segPtr_;        
+              
+          currentSegPtr->wasMerged_ = true;
+          currentSegPtr->id_ = locatedSegPtr->id_;          
+        }
+      }      
+    
+      ++mapsMapIt;
+    }
+  }
+  
+  return true;
+}
+
+
+bool TePDIParaSegRegGrowStrategy::setParameters( 
+  const TePDIParameters& params )
+{
+  TEAGN_TRUE_OR_RETURN( params.GetParameter( "euc_treshold", eucTreshold_),
+    "Missing parameter euc_treshold" )
+    
+  int area_min = 0;
+  TEAGN_TRUE_OR_RETURN( params.GetParameter( "area_min", area_min),
+    "Missing parameter area_min" )
+  
+  segParams_.Clear();
+  segParams_.SetParameter( "euc_treshold", eucTreshold_ );
+  segParams_.SetParameter( "area_min", area_min );
+
+  return true;
+}
+
+bool TePDIParaSegRegGrowStrategy::staticLocateMergingSegments( 
+  Segment const* inputSegPtr,
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT const* ,
+  const MergingSegmentInfoVecT& candidateSegmentsVec,
+  std::vector< unsigned int >& locatedSegsIndexes, double eucTreshold )
+{
+  const Segment& inputSeg = *( inputSegPtr );
+  const std::vector< double >& inputSegMeansVec = inputSeg.bandsMeansVec_;
+  const unsigned int cVecSize = (unsigned int)candidateSegmentsVec.size();
+  
+  const unsigned int meansVecSize = (unsigned int)inputSegMeansVec.size();
+  TEAGN_DEBUG_CONDITION( meansVecSize, "Invalid means vector size" );  
+  
+  // Locating the candidates following the max euclidean ths
+  
+  unsigned int meansVecIdx = 0;
+  double diff = 0;
+  double dist = 0;
+  std::multimap< unsigned int, unsigned int > auxMap;
+      
+  for( unsigned int cVecIdx = 0 ; cVecIdx < cVecSize ; ++cVecIdx )
+  {
+    const MergingSegmentInfo& candidateSegmentInfo = 
+      candidateSegmentsVec[ cVecIdx ];
+    TEAGN_DEBUG_CONDITION( candidateSegmentInfo.jointBorderLenght_,
+      "Invalid joint border lenght" );
+  
+    const std::vector< double >& candSegMeansVec = 
+      ((Segment const*)candidateSegmentInfo.segPtr_)->bandsMeansVec_;
+    TEAGN_DEBUG_CONDITION( meansVecSize == candSegMeansVec.size(),
+      "Means vector size mismatch" );        
+    
+    dist = 0;
+    diff = 0;
+      
+    for( meansVecIdx = 0 ; meansVecIdx < meansVecSize ; ++meansVecIdx )
+    {
+      diff += candSegMeansVec[ meansVecIdx ] - inputSegMeansVec[ meansVecIdx ];
+      dist += ( diff * diff );
+    }
+    
+    dist = sqrt( dist );
+    
+    if( dist <= eucTreshold )
+    {
+      auxMap.insert( std::pair< unsigned int, unsigned int >( 
+        candidateSegmentInfo.jointBorderLenght_, cVecIdx ) );
+    }
+  }
+  
+  // Generating the ordered output vector
+  
+  locatedSegsIndexes.clear();
+  locatedSegsIndexes.reserve( auxMap.size() );
+  
+  std::multimap< unsigned int, unsigned int >::reverse_iterator mapIt = 
+    auxMap.rbegin();
+  std::multimap< unsigned int, unsigned int >::reverse_iterator mapItEnd = 
+    auxMap.rend();
+  
+  while( mapIt != mapItEnd )
+  {
+    locatedSegsIndexes.push_back( mapIt->second );
+    
+    ++mapIt;
+  }
+  
+  if( locatedSegsIndexes.size() )
+  {
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+unsigned int TePDIParaSegRegGrowStrategy::getMemUsageEst( 
+  unsigned int channelsNumber ) const
+{
+  return
+    // internal Raster used as algorithm input
+    ( channelsNumber * sizeof( double ) )   
+    // TePDIRGSCell
+    + sizeof( TePDIRGSCell ) + ( 2 *  sizeof( float ) * channelsNumber )
+    // TePDIRGSCellList from within TePDIRGSCell
+    + sizeof( TePDIRGSCellList ) + ( 4 * ( sizeof( long ) + sizeof( 
+    TePDIRGSCell* ) ) )
+    // CloserCells from within TePDIRGSCell
+    + sizeof( CloserCells );
+};
diff --git a/src/terralib/image_processing/TePDIParaSegRegGrowStrategy.hpp b/src/terralib/image_processing/TePDIParaSegRegGrowStrategy.hpp
new file mode 100644
index 0000000..f9569ae
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegRegGrowStrategy.hpp
@@ -0,0 +1,290 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARASEGREGGROWSTRATEGY_HPP
+  #define TEPDIPARASEGREGGROWSTRATEGY_HPP
+
+  #include "TePDIParaSegStrategy.hpp"
+  #include "TePDIParaSegSegment.hpp"
+  #include "TePDIRegGrowSeg.hpp"
+  
+  #include <vector>
+
+  /*!
+      \class TePDIParaSegRegGrowStrategy
+      \brief Multi-threaded image segmenter Region Growing strategy.
+      \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
+      \ingroup PDIStrategies
+      \note The strategy name that must be used to construct an instance
+      of this class is "RegionGrowing".
+      
+      \note The general required parameters :
+      \param euc_treshold (double) - Maximum eclidean distance between each
+      segment (This parameter is used to merge adjacent segments from
+      adjacent image blocks).
+      \param area_min (int) - cell pixel size min value.      
+  */
+  class PDI_DLL TePDIParaSegRegGrowStrategy : public TePDIParaSegStrategy
+  {
+    public :
+    
+      /*!
+          \class Segment
+          \brief Information about one segment.
+          \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
+          \ingroup PDIAux
+      */
+      class PDI_DLL Segment : public TePDIParaSegSegment
+      {
+        public :
+        
+          /*! Raster bands means values for this segment (default:empty 
+          vector). */ 
+          std::vector< double > bandsMeansVec_;
+          
+          /*! The number of pixels inside this region (default:0). */ 
+          double pixelsNumber_;       
+             
+          /*! True if this segment was merged with another and the current
+          segment Id corresponds to the merging result. (default:false)*/
+          bool wasMerged_;             
+        
+          Segment();
+          
+          ~Segment();
+      };    
+    
+      // This method has the same parameters as the 
+      // TePDIParaSegStrategy constructor
+      TePDIParaSegRegGrowStrategy( const TePDIParaSegStrategyParams& params );
+
+      ~TePDIParaSegRegGrowStrategy();
+
+      // overloaded
+      bool execute( const RasterDataVecT& rasterDataVector, 
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& outSegsMatrix );
+             
+      //overloaded
+      bool setParameters( const TePDIParameters& params );        
+        
+     //overloaded
+      bool mergeSegments( 
+       TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& centerMatrix,
+       TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* topMatrixPtr,
+       TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* leftMatrixPtr );  
+          
+      // just as the mergeSegments above
+      static bool staticMergeSegments( 
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& centerMatrix,
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* topMatrixPtr,
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* leftMatrixPtr,
+        double eucTreshold );  
+                
+      /*!
+        \brief Create a segments matrix from a label image.
+        \param rasterDataVector The original input raster data vector.
+        \param labelRaster The label image raster.
+        \param stratPtr A pointer to the strategy calling this method..
+        \param outSegsMatrix A reference to the output generated segments
+        matrix.
+        \return true if OK, false on errors.
+        \note This method is templated by the strategy type inherithed
+        from TePDIParaSegStrategy.
+      */                
+      template< class StrategyTemplateT >
+      static bool createSegsBlkFromLImg( const RasterDataVecT& rasterDataVector,
+        TeRaster& labelRaster, StrategyTemplateT* stratPtr,
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& outSegsMatrix );
+        
+      //overloaded
+      unsigned int getMemUsageEst( unsigned int channelsNumber ) const;        
+
+    protected :
+      
+      /*!
+          \class MergingSegmentInfo
+          \brief Information about a candidate segment for merging.
+          \ingroup PDIAux
+      */          
+      class PDI_DLL MergingSegmentInfo
+      {
+        public:
+        
+        /*! The candidate segment pointer* (default:0) */
+        TePDIParaSegSegment const* segPtr_;
+        
+        /*! The candidate segment matrix pointer (default:0) */
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT const* mtxPtr_;
+        
+        /*! The lenght of the joint border (pixels number) (default:0) */
+        unsigned int jointBorderLenght_;
+        
+        MergingSegmentInfo();
+        
+        ~MergingSegmentInfo();
+      
+      };      
+      
+      /*!
+          \brief Type definition for a vector of canditate merging segments
+          information vector.
+      */     
+      typedef std::vector< MergingSegmentInfo >  MergingSegmentInfoVecT;       
+      
+      /*! A raster generated from the input raster data vector. */      
+      TePDITypes::TePDIRasterPtrType inputRasterPtr_;
+      
+      /*! A raster generated from the segmentation. */      
+      TePDITypes::TePDIRasterPtrType outputRasterPtr_;
+      
+      /*! Segmentation algorithm parameters */      
+      TePDIParameters segParams_;
+      
+      /*! Segmenter instance */
+      TePDIRegGrowSeg segmenter_;
+      
+      /*! Maximum allowed euclidean distance parameter */
+      double eucTreshold_;
+      
+      /*!
+        \brief Locate, among the given candidate segments, those wich
+        can be merged with the segment inputSegPtr.
+        \param inputSegPtr A pointer to the segment to merge with the located candidate.
+        \param inputSegMtxPtr Input segment matrix pointer.
+        \param candidateSegmentsVec The candidate segments information
+        vector.
+        \param locatedSegsIndexes The selected candidate segment indexes
+        inside candidateSegmentsVec ordered from the best candidate (first
+        locatedSegInfoIndexes vector element ) to the worse canditate (last
+        locatedSegInfoIndexes vector element).
+        \param eucTreshold Max euclidean distance between each segment.
+        \return true if one cadidate was located, false if no candidate
+        was located.
+      */
+      static bool staticLocateMergingSegments( Segment const* inputSegPtr,
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT const* inputSegMtxPtr,
+        const MergingSegmentInfoVecT& candidateSegmentsVec,
+        std::vector< unsigned int >& locatedSegsIndexes, double eucTreshold );      
+
+  };
+    
+template< class StrategyTemplateT >    
+bool TePDIParaSegRegGrowStrategy::createSegsBlkFromLImg( 
+  const RasterDataVecT& rasterDataVector, TeRaster& labelRaster,
+  StrategyTemplateT* stratPtr,
+  TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& outSegsMatrix )
+{
+
+  const unsigned int nLines = (unsigned int)labelRaster.params().nlines_;
+  const unsigned int nCols = (unsigned int)labelRaster.params().ncols_;      
+  const unsigned int nBands = (unsigned int)labelRaster.params().nBands(); 
+  
+  // Initiating the output matrix
+  
+  TEAGN_TRUE_OR_RETURN( outSegsMatrix.Reset( rasterDataVector[ 0 ].GetLines(),
+    rasterDataVector[ 0 ].GetColumns() ),
+    "output segments matrix reset error " );  
+  
+  unsigned int band = 0;
+  unsigned int line = 0;
+  unsigned int col = 0;
+  TePDIParaSegSegment** segsMtxLinePtr = 0;
+  TeDecoder& labelRasterDecoder = *(labelRaster.decoder());
+  double value = 0;
+  Segment* segPtr = 0;
+  Segment* borderSegPtr = 0;
+  const unsigned int lastLineIdx = nLines - 1;
+  const unsigned int lastColIdx = nCols - 1;
+  double oldSegPixelsNmb = 0;
+  double newBandMeanValue = 0;
+  std::map< double, Segment* > allSegsMap;
+  std::map< double, Segment* > borderSegsMap;
+  bool blockMergingEnabled = stratPtr->isBlockMergingEnabled();
+
+  for( line = 0 ; line < nLines ; ++line )
+  {
+    segsMtxLinePtr = outSegsMatrix[ line ];
+  
+    for( col = 0 ; col < nCols ; ++col )
+    {
+      TEAGN_TRUE_OR_THROW( labelRasterDecoder.getElement( col, line, 
+        value, 0 ), "Error writing input raster" )
+      
+      // Does this segment already was created ??
+        
+      segPtr = allSegsMap[ value ];
+      if( segPtr == 0 )
+      {
+        segPtr = new Segment;
+        segPtr->id_ = stratPtr->acquireNewSegID();
+        
+        allSegsMap[ value ] = segPtr;
+      }
+      
+      segsMtxLinePtr[ col ] = segPtr;
+      
+      // Is this a border segment ??
+      
+      if( blockMergingEnabled && ( ( line == 0 ) || ( line == lastLineIdx ) || ( col == 0 ) || 
+        ( col == lastColIdx ) ) )
+      {
+        borderSegPtr = borderSegsMap[ value ];
+        
+        if( borderSegPtr == 0 )
+        {
+          borderSegsMap[ value ] = segPtr;
+          borderSegPtr = segPtr;
+          
+          borderSegPtr->pixelsNumber_ = 1.0;
+          
+          borderSegPtr->bandsMeansVec_.resize( nBands );
+          for( band = 0 ; band < nBands ; ++band )
+          {
+            borderSegPtr->bandsMeansVec_[ band ] = rasterDataVector[ 
+              band ][ line ][ col ];
+          }
+        }
+        else
+        {
+          oldSegPixelsNmb = borderSegPtr->pixelsNumber_;
+          ++(borderSegPtr->pixelsNumber_);
+          
+          for( band = 0 ; band < nBands ; ++band )
+          {
+            newBandMeanValue = ( borderSegPtr->bandsMeansVec_[ band ] * 
+              oldSegPixelsNmb );
+            newBandMeanValue += rasterDataVector[ band ][ line ][ col ];
+            newBandMeanValue /= borderSegPtr->pixelsNumber_;
+          
+            borderSegPtr->bandsMeansVec_[ band ] = newBandMeanValue;
+          }   
+        }
+      }
+    }
+  }
+  
+  return true;
+}    
+    
+#endif
diff --git a/src/terralib/image_processing/TePDIParaSegRegGrowStrategyFactory.cpp b/src/terralib/image_processing/TePDIParaSegRegGrowStrategyFactory.cpp
new file mode 100644
index 0000000..364e316
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegRegGrowStrategyFactory.cpp
@@ -0,0 +1,24 @@
+#include "TePDIParaSegRegGrowStrategyFactory.hpp"
+#include "TePDIParaSegRegGrowStrategy.hpp"
+
+namespace
+{
+  TePDIParaSegRegGrowStrategyFactory tePDIParaSegRegGrowStrategyFactoryInstance_;
+}
+
+TePDIParaSegRegGrowStrategyFactory::TePDIParaSegRegGrowStrategyFactory()
+  : TePDIParaSegStrategyFactory( "RegionGrowing" )
+{
+}
+
+TePDIParaSegRegGrowStrategyFactory::~TePDIParaSegRegGrowStrategyFactory()
+{
+}
+
+TePDIParaSegStrategy* TePDIParaSegRegGrowStrategyFactory::build( 
+  const TePDIParaSegStrategyFactoryParams& arg )
+{
+  return new TePDIParaSegRegGrowStrategy( arg.stratParams_ );
+}
+
+
diff --git a/src/terralib/image_processing/TePDIParaSegRegGrowStrategyFactory.hpp b/src/terralib/image_processing/TePDIParaSegRegGrowStrategyFactory.hpp
new file mode 100644
index 0000000..c9ea4d8
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegRegGrowStrategyFactory.hpp
@@ -0,0 +1,49 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARASEGREGGROWSTRATEGYFACTORY_HPP
+  #define TEPDIPARASEGREGGROWSTRATEGYFACTORY_HPP
+
+  #include "TePDIParaSegStrategyFactory.hpp"
+
+  /*!
+      \class TePDIParaSegRegGrowStrategyFactory
+      \brief Multi-threaded image segmenter Region Growing strategy factory.
+      \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
+      \ingroup PDIStrategiesFactories
+  */
+  class PDI_DLL TePDIParaSegRegGrowStrategyFactory : 
+    public TePDIParaSegStrategyFactory
+  {
+    public :
+
+      TePDIParaSegRegGrowStrategyFactory();
+      ~TePDIParaSegRegGrowStrategyFactory();
+      
+      //overload
+      TePDIParaSegStrategy* build( const TePDIParaSegStrategyFactoryParams& 
+        arg );
+  };   
+
+#endif
diff --git a/src/terralib/image_processing/TePDIParaSegSegment.cpp b/src/terralib/image_processing/TePDIParaSegSegment.cpp
new file mode 100644
index 0000000..f64af10
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegSegment.cpp
@@ -0,0 +1,12 @@
+#include "TePDIParaSegSegment.hpp"
+
+TePDIParaSegSegment::TePDIParaSegSegment()
+: id_( 0 )
+{
+}
+
+
+TePDIParaSegSegment::~TePDIParaSegSegment()
+{
+}
+
diff --git a/src/terralib/image_processing/TePDIParaSegSegment.hpp b/src/terralib/image_processing/TePDIParaSegSegment.hpp
new file mode 100644
index 0000000..0dc1431
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegSegment.hpp
@@ -0,0 +1,55 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARASEGSEGMENT_HPP
+  #define TEPDIPARASEGSEGMENT_HPP
+
+  #include "TePDIDefines.hpp"
+
+  /*!
+      \class TePDIParaSegSegment
+      \brief Multi-threaded image segmenter segment description base class.
+      \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
+      \ingroup PDIAux
+  */
+  class PDI_DLL TePDIParaSegSegment
+  {
+    public :
+    
+      /*! Segment ID data type definition - (zero: means invalid ID) */
+      typedef unsigned int SegIdDataType;    
+
+      virtual ~TePDIParaSegSegment();
+
+      /*! Segment unique ID - default:0 (invalid ID). */
+      SegIdDataType id_; 
+
+    protected :
+    
+      TePDIParaSegSegment();
+   
+  };
+
+
+#endif
diff --git a/src/terralib/image_processing/TePDIParaSegSegmentsBlock.cpp b/src/terralib/image_processing/TePDIParaSegSegmentsBlock.cpp
new file mode 100644
index 0000000..9b5d83c
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegSegmentsBlock.cpp
@@ -0,0 +1,57 @@
+#include "TePDIParaSegSegmentsBlock.hpp"
+
+#include <limits.h>
+
+#include <set>
+
+TePDIParaSegSegmentsBlock::TePDIParaSegSegmentsBlock()
+{
+  startX_ = startY_ = UINT_MAX;
+  status_ = BlockNotProcessed;
+  width_ = height_ = 0;
+  segsPtrsMatrix_.Reset( SegmentsPointersMatrixT::RAMMemPol );
+}
+
+
+TePDIParaSegSegmentsBlock::~TePDIParaSegSegmentsBlock()
+{
+  clear();
+}
+
+void TePDIParaSegSegmentsBlock::clear()
+{
+  // Getting all segments pointers
+  
+  std::set< TePDIParaSegSegment* > segsPtrsSet;
+  
+  unsigned int mtxLine = 0;
+  unsigned int mtxLines = segsPtrsMatrix_.GetLines();
+  unsigned int mtxCol = 0;
+  unsigned int mtxCols = segsPtrsMatrix_.GetColumns();
+  TePDIParaSegSegment** mtxLinePtr = 0;
+  
+  for( mtxLine = 0 ; mtxLine < mtxLines ; ++mtxLine )
+  {
+    mtxLinePtr = segsPtrsMatrix_[ mtxLine ];
+  
+    for( mtxCol = 0 ; mtxCol < mtxCols ; ++mtxCol )
+    {
+      segsPtrsSet.insert( mtxLinePtr[ mtxCol ] );
+    }
+  }
+  
+  std::set< TePDIParaSegSegment* >::iterator setIt = segsPtrsSet.begin();
+  const std::set< TePDIParaSegSegment* >::iterator setItEnd = segsPtrsSet.end();
+  
+  while( setIt != setItEnd )
+  {
+    delete (*setIt);
+  
+    ++setIt;
+  }
+  
+  // Clear matrix
+  
+  segsPtrsMatrix_.clear();
+}
+
diff --git a/src/terralib/image_processing/TePDIParaSegSegmentsBlock.hpp b/src/terralib/image_processing/TePDIParaSegSegmentsBlock.hpp
new file mode 100644
index 0000000..ee1c05e
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegSegmentsBlock.hpp
@@ -0,0 +1,92 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARASEGSEGMENTSLOCK_HPP
+  #define TEPDIPARASEGSEGMENTSLOCK_HPP
+
+  #include "TePDIDefines.hpp"
+  #include "TePDIParaSegSegment.hpp"
+  #include "TePDIMatrix.hpp"
+
+  /*!
+      \class TePDIParaSegSegmentsBlock
+      \brief Multi-threaded image segmenter segments block description class.
+      \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
+      \note All segments will be deleted when this instance is deleted.
+      \ingroup PDIAux
+  */
+  class PDI_DLL TePDIParaSegSegmentsBlock
+  {
+    public :
+    
+      /*! Raster data block (one band/channel)*/
+      typedef TePDIMatrix< TePDIParaSegSegment* > SegmentsPointersMatrixT;          
+      
+      /*! Block status flag. */
+      enum BlockStatus
+      {
+        /*! This block was not processed yet */
+        BlockNotProcessed = 0,
+        /*! This block is under segmentation */
+        BlockUnderSegmentation = 1,        
+        /*! This block already was segmented */
+        BlockSegmented = 2,
+        /*! This block already was alread merged */
+        BlockMerged = 3,
+        /*! This block already was flushed to the output raster */
+        BlockFlushed = 4
+      };    
+      
+      /*! Block status - default:BlockNotProcessed*/
+      unsigned int status_;      
+
+      /*! Block uppler left X over input full image - default:UINT_MAX*/
+      unsigned int startX_;
+     
+      /*! Block uppler left Y over input full image - default:UINT_MAX*/
+      unsigned int startY_;
+      
+      /*! Block width - default:0*/
+      unsigned int width_;
+     
+      /*! Block height - default:0*/
+      unsigned int height_;      
+      
+      /*! 
+        \brief Segments pointers matrix - default: empty matrix
+        \note The pointed pointed segments will not be deleted by this class.
+        \note The default memory policy is RAMMemPol.
+      */
+      SegmentsPointersMatrixT segsPtrsMatrix_;
+      
+      TePDIParaSegSegmentsBlock();
+
+      ~TePDIParaSegSegmentsBlock();   
+         
+      /*! Clear all internal data including all segments objects */   
+      void clear();
+  };
+
+
+#endif
diff --git a/src/terralib/image_processing/TePDIParaSegStrategy.cpp b/src/terralib/image_processing/TePDIParaSegStrategy.cpp
new file mode 100644
index 0000000..b039ba5
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegStrategy.cpp
@@ -0,0 +1,43 @@
+#include "TePDIParaSegStrategy.hpp"
+
+#include <TeAgnostic.h>
+
+#include <limits.h>
+
+TePDIParaSegStrategy::TePDIParaSegStrategy( const TePDIParaSegStrategyParams& 
+  params )
+  : lastGenSegID_( 0 ), params_( params )
+{
+}
+
+
+TePDIParaSegStrategy::~TePDIParaSegStrategy()
+{
+}
+
+TePDIParaSegSegment::SegIdDataType TePDIParaSegStrategy::acquireNewSegID()
+{
+  params_.globalMutexPtr_->lock();
+  
+  if( (*params_.segmentsIdsCounterPtr_) == UINT_MAX )
+  {
+    params_.globalMutexPtr_->unLock();
+    
+    return 0;
+  }
+  else
+  {
+    ++(*params_.segmentsIdsCounterPtr_);
+    lastGenSegID_ = (*params_.segmentsIdsCounterPtr_);
+    params_.globalMutexPtr_->unLock();
+    return lastGenSegID_;
+  }
+}
+
+TePDIParaSegStrategy* TePDIParaSegStrategy::DefaultObject( 
+  const TePDIParaSegStrategyFactoryParams& ) 
+{ 
+  TEAGN_LOG_AND_THROW( "Unable to build a TePDIParaSegStrategy instance");
+  return 0;
+}
+
diff --git a/src/terralib/image_processing/TePDIParaSegStrategy.hpp b/src/terralib/image_processing/TePDIParaSegStrategy.hpp
new file mode 100644
index 0000000..8b1c48a
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegStrategy.hpp
@@ -0,0 +1,174 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARASEGSTRATEGY_HPP
+  #define TEPDIPARASEGSTRATEGY_HPP
+
+  #include "TePDIParaSegStrategyParams.hpp"
+  #include "TePDIParaSegSegmentsBlock.hpp"
+  #include "TePDIParaSegStrategyFactoryParams.hpp"
+  #include "TePDIMatrix.hpp"
+  #include "TePDIDefines.hpp"
+  #include "TePDIParameters.hpp"
+  
+  #include <vector>
+
+  /*!
+      \class TePDIParaSegStrategy
+      \brief Multi-threaded image segmenter strategy base class.
+      \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
+      \ingroup PDIStrategies
+  */
+  class PDI_DLL TePDIParaSegStrategy
+  {
+    public :
+        
+
+      /*! Raster data block (one band/channel)*/
+      typedef TePDIMatrix< double > RasterBandDataT;          
+         
+      /*! Raster data block type definition (one vector element for each
+      raster band)*/
+      typedef std::vector< RasterBandDataT > RasterDataVecT;           
+    
+      virtual ~TePDIParaSegStrategy();
+
+      /*!
+          \brief Execute segmentation following the supplied strategy
+          specific parameters.
+          \details This method will be called many times as required
+          to the same strategy instance to execute segmentation on each
+          image block.
+          \param rasterDataVector The input raster data vector (each
+          vector element represents one raster band/channel).
+          \param outSegsMatrix The generated output segments matrix.
+          \return true if OK, false on errors.
+          \note The generated segments IDs must be acquired by using the
+           TePDIParaSegStrategy::acquireNewSegID() method.
+          \note The generated segments reference counters must be initiated
+           with value 1.           
+      */ 
+      virtual bool execute( const RasterDataVecT& rasterDataVector, 
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& outSegsMatrix ) = 0 ;
+        
+      /*!
+          \brief Set the specific strategy parameters.
+          \details This method will be called once for each strategy
+          instance created.
+          \param params A reference to the new parameters.
+          \return true if OK, false on errors.
+      */         
+      virtual bool setParameters( const TePDIParameters& params ) = 0;        
+        
+      /*!
+          \brief Merge adjacent matrix border segments.
+          \details This method will be called many times as required to the 
+          same strategy instance to merge the entire label image  
+          incrementally; on each call references to 3 adjacent image segments 
+          blocks will be passed as shown ahead.
+          \code
+          ________________________________
+          |     |     |      |     |     |
+          ________________________________
+          |     |     |top   |     |     |
+          ________________________________
+          |     |left |center|     |     |          
+          _______________________________
+          |     |     |      |     |     |          
+          ________________________________          
+          \endcode
+          \param centerMatrix A reference to the image block matrix located
+          at the merging region center.
+          \param topMatrixPtr A pointer to the image block matrix located
+          at the merging region top or null if this block does not exists.          
+          \param leftMatrixPtr A pointer to the image block matrix located
+          at the merging region left or null if this block does not exists.          
+          \return true if OK, false on errors.
+      */         
+      virtual bool mergeSegments( 
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT& centerMatrix,
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* topMatrixPtr,
+        TePDIParaSegSegmentsBlock::SegmentsPointersMatrixT* leftMatrixPtr ) = 0;
+        
+      /*!
+          \brief Returns an estimation of how much RAM is required to 
+          process an unique input image element given the
+          number of input bands/channels.
+          \details This parameter is used by the parallel segmenter to
+          guess the memory required to process each sub-image block.
+          \param channelsNumber The number of input image bands/channels
+          to process.
+          \return Returns an estimation of how much RAM is required to 
+          process an unique input image element given the
+          number of input bands/channels.
+      */          
+      virtual unsigned int getMemUsageEst( unsigned int channelsNumber )
+        const = 0;
+        
+      /*!
+          \brief Acquire an unique segment ID to be associated with a new
+          generated segment.
+          \return An unique segment ID to be associated with a new
+          generated segment or zero if an error occurred.
+          \note The returned ID is unique, meaning that other calls
+          to this method (by this or by other threads) will never generate
+          the same values.
+      */         
+      TePDIParaSegSegment::SegIdDataType acquireNewSegID();
+      
+      /*!
+          \brief Return true if adjacent segments blocks merging
+          will be performed.
+          \return Return true if adjacent segments blocks merging
+          will be performed.
+      */      
+      inline bool isBlockMergingEnabled() const
+      {
+        return params_.blockMergingEnabled_;
+      };      
+      
+      // Overloaded
+      static TePDIParaSegStrategy* DefaultObject( 
+        const TePDIParaSegStrategyFactoryParams& params );
+        
+    protected :
+    
+      /*!
+          \brief The default constructor.
+          \param params The strategy parameters.
+      */    
+      TePDIParaSegStrategy( const TePDIParaSegStrategyParams& params );    
+             
+    private :
+    
+      /*! The last generated segment ID (default:0). */
+      TePDIParaSegSegment::SegIdDataType lastGenSegID_;    
+      
+      /*! This strategy instance parameters. */
+      TePDIParaSegStrategyParams params_;
+      
+  };
+
+
+#endif
diff --git a/src/terralib/image_processing/TePDIParaSegStrategyFactory.cpp b/src/terralib/image_processing/TePDIParaSegStrategyFactory.cpp
new file mode 100644
index 0000000..5a6fe7f
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegStrategyFactory.cpp
@@ -0,0 +1,14 @@
+ 
+#include "TePDIParaSegStrategyFactory.hpp"
+
+TePDIParaSegStrategyFactory::TePDIParaSegStrategyFactory( 
+  const std::string& factoryName )
+: TeFactory< TePDIParaSegStrategy, TePDIParaSegStrategyFactoryParams >( 
+  factoryName )
+{
+};      
+
+TePDIParaSegStrategyFactory::~TePDIParaSegStrategyFactory()
+{
+};
+
diff --git a/src/terralib/image_processing/TePDIParaSegStrategyFactory.hpp b/src/terralib/image_processing/TePDIParaSegStrategyFactory.hpp
new file mode 100644
index 0000000..4615842
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegStrategyFactory.hpp
@@ -0,0 +1,59 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARASEGSTRATEGYFACTORY_HPP
+  #define TEPDIPARASEGSTRATEGYFACTORY_HPP
+
+  #include "TePDIParaSegStrategy.hpp"
+  #include "TePDIParaSegStrategyFactoryParams.hpp"
+  #include "TePDIDefines.hpp"
+  
+  #include <TeFactory.h>
+  
+  /**
+   * @brief Parallel segmenter strategy factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIStrategiesFactories
+   */
+  class PDI_DLL TePDIParaSegStrategyFactory : 
+    public TeFactory< TePDIParaSegStrategy, TePDIParaSegStrategyFactoryParams >
+  {
+    public :
+
+      virtual ~TePDIParaSegStrategyFactory();
+      
+    protected :
+      
+      /**
+       * @brief Default constructor
+       *
+       * @param factoryName Factory name.
+       */
+      TePDIParaSegStrategyFactory( const std::string& factoryName );
+  };
+  
+#endif
+
+
+
diff --git a/src/terralib/image_processing/TePDIParaSegStrategyFactoryParams.cpp b/src/terralib/image_processing/TePDIParaSegStrategyFactoryParams.cpp
new file mode 100644
index 0000000..a5938c6
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegStrategyFactoryParams.cpp
@@ -0,0 +1,16 @@
+#include "TePDIParaSegStrategyFactoryParams.hpp"
+
+TePDIParaSegStrategyFactoryParams::TePDIParaSegStrategyFactoryParams()
+{
+}
+
+
+TePDIParaSegStrategyFactoryParams::~TePDIParaSegStrategyFactoryParams()
+{
+}
+
+std::string TePDIParaSegStrategyFactoryParams::decName() const
+{
+  return std::string();
+}
+
diff --git a/src/terralib/image_processing/TePDIParaSegStrategyFactoryParams.hpp b/src/terralib/image_processing/TePDIParaSegStrategyFactoryParams.hpp
new file mode 100644
index 0000000..a1d94e3
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegStrategyFactoryParams.hpp
@@ -0,0 +1,54 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARASEGSTRATEGYFACTORYPARAMS_HPP
+  #define TEPDIPARASEGSTRATEGYFACTORYPARAMS_HPP
+
+  #include "TePDIParaSegStrategyParams.hpp"
+  #include "TePDIDefines.hpp"
+
+  /*!
+      \class TePDIParaSegStrategyFactoryParams
+      \brief Multi-threaded image segmenter strategy factory parameters.
+      \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
+      \ingroup PDIAux
+  */
+  class PDI_DLL TePDIParaSegStrategyFactoryParams
+  {
+    public :
+   
+      TePDIParaSegStrategyFactoryParams();
+
+      ~TePDIParaSegStrategyFactoryParams();
+      
+      /*! Segmenter strategy parameters*/
+      TePDIParaSegStrategyParams stratParams_;      
+      
+      // Factory compatibility
+      std::string decName() const;
+ 
+  };
+
+
+#endif
diff --git a/src/terralib/image_processing/TePDIParaSegStrategyParams.cpp b/src/terralib/image_processing/TePDIParaSegStrategyParams.cpp
new file mode 100644
index 0000000..25af4f0
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegStrategyParams.cpp
@@ -0,0 +1,13 @@
+#include "TePDIParaSegStrategyParams.hpp"
+
+TePDIParaSegStrategyParams::TePDIParaSegStrategyParams()
+: globalMutexPtr_( 0 ), segmentsIdsCounterPtr_( 0 ), 
+  blockMergingEnabled_( false )
+{
+}
+
+
+TePDIParaSegStrategyParams::~TePDIParaSegStrategyParams()
+{
+}
+
diff --git a/src/terralib/image_processing/TePDIParaSegStrategyParams.hpp b/src/terralib/image_processing/TePDIParaSegStrategyParams.hpp
new file mode 100644
index 0000000..5e59bc3
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParaSegStrategyParams.hpp
@@ -0,0 +1,65 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARASEGSTRATEGYPARAMS_HPP
+  #define TEPDIPARASEGSTRATEGYPARAMS_HPP
+
+  #include "TePDIDefines.hpp"
+  #include "TePDIParaSegSegment.hpp"
+
+  #include <TeMutex.h>
+
+  /*!
+      \class TePDIParaSegStrategyParams
+      \brief Multi-threaded image segmenter strategy parameters.
+      \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
+      \ingroup PDIAux
+  */
+  class PDI_DLL TePDIParaSegStrategyParams
+  {
+    public :
+    
+      friend class TePDIParaSegStrategy;
+      friend class TePDIParallelSegmenter;
+   
+      TePDIParaSegStrategyParams();
+
+      ~TePDIParaSegStrategyParams();
+      
+    protected :
+      
+      /*! The global mutex pointer (default:0)*/
+      TeMutex* globalMutexPtr_;
+      
+      /*! The global generated segments IDs counter pointer (default:0). */
+      TePDIParaSegSegment::SegIdDataType* segmentsIdsCounterPtr_;
+      
+      /*! True if adjacent segments blocks merging will be performed
+      (default:false). */
+      bool blockMergingEnabled_;
+ 
+  };
+
+
+#endif
diff --git a/src/terralib/image_processing/TePDIParallelSegmenter.cpp b/src/terralib/image_processing/TePDIParallelSegmenter.cpp
new file mode 100644
index 0000000..28cdd59
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParallelSegmenter.cpp
@@ -0,0 +1,973 @@
+#include "TePDIParallelSegmenter.hpp"
+
+#include "TePDIParaSegStrategyFactory.hpp"
+#include "TePDIPIManager.hpp"
+
+#include <TeUtils.h>
+#include <TeThreadFunctor.h>
+#include <TeAgnostic.h>
+
+
+TePDIParallelSegmenter::TePDIParallelSegmenter()
+{
+}
+
+
+TePDIParallelSegmenter::~TePDIParallelSegmenter()
+{
+}
+
+bool TePDIParallelSegmenter::CheckParameters( const TePDIParameters& parameters ) const
+{
+  /* Checking input_image_ptr */
+    
+  TePDITypes::TePDIRasterPtrType input_image_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_image_ptr", 
+    input_image_ptr ), "Missing parameter: input_image_ptr" );
+  TEAGN_TRUE_OR_RETURN( input_image_ptr.isActive(),
+    "Invalid parameter: input_image_ptr inactive" );
+  TEAGN_TRUE_OR_RETURN( input_image_ptr->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: input_image_ptr not ready" );
+  
+  /* Checking input_channels */
+  
+  std::vector< unsigned int > input_channels;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_channels", 
+    input_channels ), "Missing parameter: input_channels" );
+  for( unsigned inputChannelsIdx = 0 ; inputChannelsIdx < input_channels.size() ;
+    ++inputChannelsIdx )
+  {
+    TEAGN_TRUE_OR_RETURN( ( (int)input_channels[ inputChannelsIdx ] <
+      input_image_ptr->params().nBands() ), 
+      "Invalid parameter: input_channels" );  
+  }
+  
+  /* Checking strategy_name */
+  
+  std::string strategy_name;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "strategy_name", 
+    strategy_name ), "Missing parameter: strategy_name" );
+  TEAGN_TRUE_OR_RETURN( TePDIParaSegStrategyFactory::instance().find(
+    strategy_name ) != TePDIParaSegStrategyFactory::instance().end(),
+    "Invalid parameter: strategy_name" ); 
+       
+  /* Checking output_image_ptr */
+    
+  TePDITypes::TePDIRasterPtrType output_image_ptr;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_image_ptr", 
+    output_image_ptr ),
+    "Missing parameter: output_image_ptr" );
+  TEAGN_TRUE_OR_RETURN( output_image_ptr.isActive(),
+    "Invalid parameter: output_image_ptr inactive" );
+  TEAGN_TRUE_OR_RETURN( output_image_ptr->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: output_image_ptr not ready" );           
+  
+  /* Checking max_block_size */
+  
+  if( parameters.CheckParameter< unsigned int >( "max_block_size" ) )
+  {
+    unsigned int max_block_size = 0;
+    parameters.GetParameter( "max_block_size", max_block_size );
+    TEAGN_TRUE_OR_RETURN( max_block_size > 0, 
+      "Invalid parameter: max_block_size" );     
+  }     
+  
+  return true;
+}
+
+bool TePDIParallelSegmenter::RunImplementation()
+{
+  /* Retriving parameters */
+
+  TePDITypes::TePDIRasterPtrType input_image_ptr;
+  params_.GetParameter( "input_image_ptr", input_image_ptr );
+  
+  std::vector< unsigned int > input_channels;
+  params_.GetParameter( "input_channels", input_channels );  
+  
+  TePDIParameters strategy_params;
+  if( params_.CheckParameter< TePDIParameters >( "strategy_params" ) )
+  {
+    params_.GetParameter( "strategy_params", strategy_params );
+  }      
+  
+  std::string strategy_name;
+  params_.GetParameter( "strategy_name", strategy_name );
+  
+  TePDITypes::TePDIRasterPtrType output_image_ptr;
+  params_.GetParameter( "output_image_ptr", output_image_ptr );
+  
+  unsigned int max_seg_threads = TeGetPhysProcNumber();
+  if( params_.CheckParameter< unsigned int >( "max_seg_threads" ) )
+  {
+    params_.GetParameter( "max_seg_threads", max_seg_threads );
+  }    
+  
+  bool merge_adjacent_blocks = true;
+  if( params_.CheckParameter< bool >( "merge_adjacent_blocks" ) )
+  {
+    params_.GetParameter( "merge_adjacent_blocks", merge_adjacent_blocks );
+  }      
+  
+  // Globals
+  
+  TeMutex globalMutex;
+  TeThreadSignal globalSignal;
+  bool abortSegmentationFlag = false;  
+  // The number of generated segments IDs
+  TePDIParaSegSegment::SegIdDataType segmentsIdsCounter = 0;
+  
+  const unsigned int pIManagerSteps = ( max_seg_threads ?
+    (max_seg_threads+1) : 2 );
+  TePDIPIManager progress( "Segmenting", pIManagerSteps, progress_enabled_ );
+  
+  // Calc block width & height
+  
+  unsigned int max_block_width = 0;
+  unsigned int max_block_height = 0;
+  
+  if( params_.CheckParameter< unsigned int >( "max_block_size" ) )
+  {
+    unsigned int user_max_block_width = 0;
+    params_.GetParameter( "max_block_size", user_max_block_width );
+    
+    TEAGN_TRUE_OR_RETURN( calcBestBlockSize( input_image_ptr->params().nlines_,
+      input_image_ptr->params().ncols_, 
+      user_max_block_width * user_max_block_width, max_block_width, 
+      max_block_height ),
+      "Unable to define sub-image blocks size" );    
+  }
+  else
+  {
+    // get the strategy required memory  
+     
+    TePDIParaSegStrategyFactoryParams facParams;
+    facParams.stratParams_.globalMutexPtr_ = &globalMutex;
+    facParams.stratParams_.segmentsIdsCounterPtr_ = &segmentsIdsCounter;
+    facParams.stratParams_.blockMergingEnabled_ = merge_adjacent_blocks;   
+    
+    TeSharedPtr< TePDIParaSegStrategy > strategyPtr(
+      TePDIParaSegStrategyFactory::make( strategy_name, 
+      facParams ) );
+    TEAGN_TRUE_OR_THROW( strategyPtr.isActive(), 
+    "Unable to create an segmentation strategy" ); 
+    TEAGN_TRUE_OR_RETURN( strategyPtr->setParameters( 
+      strategy_params ), 
+      "Unable to set segmentation strategy parameters" );    
+      
+    unsigned int stratMemUsageEst = strategyPtr->getMemUsageEst(
+      input_channels.size() );
+  
+    unsigned long int avaiFreeRAM = MIN( TeGetFreeVirtualMemory(), 
+      TeGetTotalPhysicalMemory() );   
+    avaiFreeRAM = (unsigned long int)( 0.7 * (double)avaiFreeRAM );
+      
+    const unsigned long int pixelRequiredRam = stratMemUsageEst +
+      (unsigned long int)(input_channels.size() * sizeof( double ) );
+      
+    unsigned long int totalRequiredRAM = pixelRequiredRam *
+      (unsigned long int)( input_image_ptr->params().nlines_ *
+      input_image_ptr->params().ncols_ );
+       
+    if( max_seg_threads )
+    {
+      if( totalRequiredRAM < avaiFreeRAM )
+      {
+        TEAGN_TRUE_OR_RETURN( calcBestBlockSize( 
+          input_image_ptr->params().nlines_,
+          input_image_ptr->params().ncols_, 
+          ( input_image_ptr->params().ncols_ * 
+          input_image_ptr->params().nlines_ ) / ( max_seg_threads + 1 ), 
+          max_block_width, max_block_height ),
+          "Unable to define sub-image blocks size" );
+      }
+      else
+      {
+        TEAGN_TRUE_OR_RETURN( calcBestBlockSize( 
+          input_image_ptr->params().nlines_,
+          input_image_ptr->params().ncols_, ( avaiFreeRAM / ( max_seg_threads + 
+          1 ) ) / pixelRequiredRam, max_block_width, max_block_height ),
+          "Unable to define sub-image blocks size" );
+      }
+    }
+    else
+    {
+      if( totalRequiredRAM < avaiFreeRAM )
+      {
+        max_block_width = (unsigned int)( input_image_ptr->params().ncols_ );
+        max_block_height = (unsigned int)( input_image_ptr->params().nlines_ );          
+      }
+      else
+      {
+        TEAGN_TRUE_OR_RETURN( calcBestBlockSize( 
+          input_image_ptr->params().nlines_,
+          input_image_ptr->params().ncols_, 
+          avaiFreeRAM / pixelRequiredRam,
+          max_block_width, max_block_height ),
+          "Unable to define sub-image blocks size" );
+      }
+    }
+  }
+  
+  max_block_width = MIN( max_block_width, (unsigned int)( 
+    input_image_ptr->params().ncols_ ) );
+  max_block_height = MIN( max_block_height, (unsigned int)( 
+    input_image_ptr->params().nlines_ ) );
+  
+  // Creating image blocks matrix
+  
+  SegmentsBlocksMatrixT segmentsblocksMatrix;
+  segmentsblocksMatrix.Reset( SegmentsBlocksMatrixT::RAMMemPol );
+  
+  {
+    const unsigned int hBlocksNumber = (unsigned int)ceil( 
+      ((double)input_image_ptr->params().ncols_) / ((double)max_block_width) );
+    const unsigned int vBlocksNumber = (unsigned int)ceil( 
+      ((double)input_image_ptr->params().nlines_) / ((double)max_block_height) );
+       
+    TEAGN_TRUE_OR_RETURN( segmentsblocksMatrix.Reset( vBlocksNumber, 
+      hBlocksNumber ), "Blocks matrix reset error" );
+      
+    const unsigned int linesBound = (unsigned int)
+      input_image_ptr->params().nlines_;
+    const unsigned int colsBound = (unsigned int)
+      input_image_ptr->params().ncols_;
+    unsigned int blockXBound = 0;
+    unsigned int blockYBound = 0;
+      
+    for( unsigned int segmentsMatrixLine = 0 ; segmentsMatrixLine < 
+      segmentsblocksMatrix.GetLines() ; ++segmentsMatrixLine )
+    {
+      for( unsigned int segmentsMatrixCol = 0 ; segmentsMatrixCol < 
+        segmentsblocksMatrix.GetColumns() ; ++segmentsMatrixCol )
+      {
+        TePDIParaSegSegmentsBlock& segmentsBlock = segmentsblocksMatrix( 
+          segmentsMatrixLine, segmentsMatrixCol );
+          
+        segmentsBlock.status_ = TePDIParaSegSegmentsBlock::BlockNotProcessed;
+        segmentsBlock.startX_ = segmentsMatrixCol * max_block_width;
+        segmentsBlock.startY_ = segmentsMatrixLine * max_block_height;          
+          
+        blockXBound = MIN( segmentsBlock.startX_ + max_block_width, 
+          colsBound );
+        blockYBound = MIN( segmentsBlock.startY_ + max_block_height, 
+          linesBound );          
+      
+        segmentsBlock.width_ = blockXBound - segmentsBlock.startX_;
+        segmentsBlock.height_ = blockYBound - segmentsBlock.startY_;
+      }
+    }
+  }
+  
+  // Spawning segmenter threads
+  
+  bool returnValue = true;
+
+  std::vector< TeSharedPtr< TeThreadFunctor > > threadsVec;
+  
+  SegmenterThreadEntryParams segThreadParams;
+  segThreadParams.inputRasterPtr_ = input_image_ptr.nakedPointer();
+  segThreadParams.inputChannelsVecPtr_ = &input_channels;
+  segThreadParams.segsBlocksMatrixPtr_ = &segmentsblocksMatrix;
+  segThreadParams.mutexPtr_ = &globalMutex;
+  segThreadParams.stratParamsPtr_ = &strategy_params;
+  segThreadParams.stratNamePtr_ = &strategy_name;
+  segThreadParams.abortSegmentationFlagPtr_ = &abortSegmentationFlag;
+  segThreadParams.segmentsIdsCounterPtr_ = &segmentsIdsCounter;
+  segThreadParams.signalPtr_ = &globalSignal;
+  segThreadParams.progressEnabled_ = progress_enabled_;
+  segThreadParams.mergeAdjacentBlocks_ = merge_adjacent_blocks;
+    
+  if( max_seg_threads )
+  {    
+    for( unsigned int threadIdx = 0 ; threadIdx < max_seg_threads ;
+      ++threadIdx )
+    {
+      TeSharedPtr< TeThreadFunctor > threadPtr( new TeThreadFunctor );
+      threadPtr->setStartFunctPtr( segmenterThreadEntry );
+      threadPtr->setParametersPtr( &segThreadParams );
+      threadPtr->start();
+      threadsVec.push_back( threadPtr );
+    }
+  }
+  else
+  {
+    if( ! segmenterThreadEntry( (void*)&segThreadParams ) )
+    {
+      TEAGN_LOGERR( "Segmentation error" );
+      returnValue = false;
+    }
+    
+    progress.Increment();
+  }
+  
+  // Initiate output raster
+
+  if( returnValue )
+  {
+    TeRasterParams outputImgParams = output_image_ptr->params();
+    outputImgParams.nBands( 1 );
+    outputImgParams.projection( 
+      input_image_ptr->params().projection() );
+    outputImgParams.boundingBoxLinesColumns( 
+      input_image_ptr->params().boundingBox().x1(), 
+      input_image_ptr->params().boundingBox().y1(), 
+      input_image_ptr->params().boundingBox().x2(), 
+      input_image_ptr->params().boundingBox().y2(), 
+      input_image_ptr->params().nlines_, 
+      input_image_ptr->params().ncols_ );    
+    
+    if( ! output_image_ptr->init( outputImgParams ) )
+    {
+      TEAGN_LOGERR( "Output raster init error" );  
+      abortSegmentationFlag = true;            
+      returnValue = false;
+    }
+  }
+    
+  // Spawning the thread to group the segmented data
+  
+  TeSharedPtr< TeThreadFunctor > groupDataThreadPtr( new TeThreadFunctor );
+
+  if( returnValue )
+  {
+    GroupDataThreadEntryParams groupThreadParams;
+    groupThreadParams.outputRasterPtr_ = output_image_ptr.nakedPointer();
+    groupThreadParams.segsBlocksMatrixPtr_ = &segmentsblocksMatrix;
+    groupThreadParams.mutexPtr_ = &globalMutex;
+    groupThreadParams.stratParamsPtr_ = &strategy_params;
+    groupThreadParams.stratNamePtr_ = &strategy_name;
+    groupThreadParams.abortSegmentationFlagPtr_ = &abortSegmentationFlag;
+    groupThreadParams.signalPtr_ = &globalSignal;
+    groupThreadParams.segmentsIdsCounterPtr_ = &segmentsIdsCounter;
+    groupThreadParams.waitForSignals_ = true;
+    groupThreadParams.progressEnabled_ = progress_enabled_;
+    groupThreadParams.mergeAdjacentBlocks_ = merge_adjacent_blocks;
+    
+    if( max_seg_threads )
+    {   
+      groupDataThreadPtr.reset( new TeThreadFunctor );
+      groupDataThreadPtr->setStartFunctPtr( groupDataThreadEntry );
+      groupDataThreadPtr->setParametersPtr( &groupThreadParams );
+      groupDataThreadPtr->start();
+    }
+    else
+    {
+      if( returnValue )
+      {
+        groupThreadParams.waitForSignals_ = false;
+        
+        if( ! groupDataThreadEntry( (void*)&groupThreadParams ) )
+        {
+          TEAGN_LOGERR( "Segmentation error" );
+          returnValue = false;
+        }
+      }
+      
+      progress.Increment();
+    }
+  }
+
+  // Wait all threads to finish
+      
+  if( max_seg_threads )
+  {        
+    for( unsigned int threadsVecIdx = 0 ; threadsVecIdx < max_seg_threads ;
+      ++threadsVecIdx )
+    {
+      threadsVec[ threadsVecIdx ]->waitToFinish();
+      returnValue = returnValue && threadsVec[ threadsVecIdx ]->getReturnValue();
+      
+      progress.Increment();
+    }  
+    
+    while( groupDataThreadPtr->getStatus() != TeThreadStopped )
+    {
+      globalSignal.waitSignal( 250 );
+      globalSignal.emitSignal();
+    }
+    
+    returnValue = returnValue && groupDataThreadPtr->getReturnValue();
+    
+    progress.Increment();
+  }
+  
+  // So far.... so good !!
+  
+  return returnValue;
+}
+
+
+void TePDIParallelSegmenter::ResetState( const TePDIParameters& )
+{
+}
+
+bool TePDIParallelSegmenter::segmenterThreadEntry(void* paramsPtr)
+{
+  TEAGN_DEBUG_CONDITION( paramsPtr, "Invalid pointer" );
+  SegmenterThreadEntryParams& segThreadParams =
+    *((SegmenterThreadEntryParams*)paramsPtr);
+    
+  TEAGN_DEBUG_CONDITION( segThreadParams.inputRasterPtr_,
+    "Invalid raster pointer" );
+  TEAGN_DEBUG_CONDITION( segThreadParams.inputChannelsVecPtr_,
+    "Invalid input channels" );
+  TEAGN_DEBUG_CONDITION( segThreadParams.segsBlocksMatrixPtr_,
+    "Invalid block matrix pointer" );
+  TEAGN_DEBUG_CONDITION( segThreadParams.mutexPtr_,
+    "Invalid mutex pointer" )
+  TEAGN_DEBUG_CONDITION( segThreadParams.stratParamsPtr_, 
+    "Invalid strategy params pointer" );
+  TEAGN_DEBUG_CONDITION( segThreadParams.stratNamePtr_,
+    "Invalid strategy name pointer" );
+  TEAGN_DEBUG_CONDITION( segThreadParams.abortSegmentationFlagPtr_,
+    "Invalid abort flag pointer" );
+  TEAGN_DEBUG_CONDITION( segThreadParams.segmentsIdsCounterPtr_,
+    "Invalid abort flag pointer" ); 
+       
+  // Creating the segmentation strategy instance
+  
+  TePDIParaSegStrategyFactoryParams facParams;
+  facParams.stratParams_.globalMutexPtr_ = segThreadParams.mutexPtr_;
+  facParams.stratParams_.segmentsIdsCounterPtr_ = 
+    segThreadParams.segmentsIdsCounterPtr_;
+  facParams.stratParams_.blockMergingEnabled_ = 
+    segThreadParams.mergeAdjacentBlocks_;
+  
+  TeSharedPtr< TePDIParaSegStrategy > strategyPtr(
+    TePDIParaSegStrategyFactory::make( *segThreadParams.stratNamePtr_, 
+    facParams ) );
+  TEAGN_TRUE_OR_THROW( strategyPtr.isActive(), 
+    "Unable to create an segmentation strategy" ); 
+  TEAGN_TRUE_OR_RETURN( strategyPtr->setParameters( 
+    *segThreadParams.stratParamsPtr_ ), 
+    "Unable to set segmentation strategy parameters" );    
+    
+  // Pre-initializing raster data matrix
+    
+  TePDIParaSegStrategy::RasterDataVecT rasterDataVec;
+  {
+    for( unsigned int bandIdx = 0 ; bandIdx < 
+      segThreadParams.inputChannelsVecPtr_->size() ;
+      ++bandIdx )
+    {
+      rasterDataVec.push_back( TePDIParaSegStrategy::RasterBandDataT() );
+      rasterDataVec.back().Reset( 
+        TePDIParaSegStrategy::RasterBandDataT::RAMMemPol );
+    }
+  }    
+    
+  // Looking for a non processed segments block
+  
+  TePDIPIManager progress( "Segmenting", 
+    segThreadParams.segsBlocksMatrixPtr_->GetLines() *
+    segThreadParams.segsBlocksMatrixPtr_->GetColumns() , 
+    segThreadParams.progressEnabled_ );
+  
+  for( unsigned int sBMLine = 0 ; sBMLine < 
+    segThreadParams.segsBlocksMatrixPtr_->GetLines() ; ++sBMLine )
+  {
+    for( unsigned int sBMCol = 0 ; sBMCol < 
+      segThreadParams.segsBlocksMatrixPtr_->GetColumns() ;  ++sBMCol )  
+    {
+      if( *(segThreadParams.abortSegmentationFlagPtr_ ) )
+      {
+        return false;
+      }
+      else
+      {
+        segThreadParams.mutexPtr_->lock();
+        
+        TePDIParaSegSegmentsBlock& segsBlk = 
+          segThreadParams.segsBlocksMatrixPtr_->operator()( sBMLine, sBMCol );
+        
+        if( segsBlk.status_ == TePDIParaSegSegmentsBlock::BlockNotProcessed )
+        {
+          segsBlk.status_ = TePDIParaSegSegmentsBlock::BlockUnderSegmentation;
+          
+          segThreadParams.mutexPtr_->unLock();
+          
+          // Initializing raster data matrix
+          
+          for( unsigned int rasterDataVecIdx = 0 ; rasterDataVecIdx < 
+            segThreadParams.inputChannelsVecPtr_->size() ; ++rasterDataVecIdx )
+          {
+            TePDIParaSegStrategy::RasterBandDataT& bandData = rasterDataVec[ rasterDataVecIdx ];
+            if( ! bandData.Reset( segsBlk.height_, segsBlk.width_, 
+              TePDIParaSegStrategy::RasterBandDataT::RAMMemPol ) )
+            {
+              *(segThreadParams.abortSegmentationFlagPtr_ ) = true;
+              TEAGN_LOGERR( "Error initializing raster data matrix" );
+              return false;
+            }
+          }
+          
+          // Load raster data into data matrix
+          
+          {
+            segThreadParams.mutexPtr_->lock();
+            
+            TeRaster& inputRaster = *(segThreadParams.inputRasterPtr_);
+            unsigned int blockLine = 0;
+            unsigned int blockCol = 0;
+            double* bandDataLinePtr = 0;
+            unsigned int rasterLine = 0;
+            
+            for( unsigned int inputChannelsVecIdx = 0 ; inputChannelsVecIdx <
+              segThreadParams.inputChannelsVecPtr_->size() ;
+              ++inputChannelsVecIdx )
+            {
+              const unsigned int& bandIdx = 
+                segThreadParams.inputChannelsVecPtr_->operator[]( 
+                inputChannelsVecIdx );
+                
+              TePDIParaSegStrategy::RasterBandDataT& bandData = rasterDataVec[ inputChannelsVecIdx ];
+                
+              for( blockLine = 0 ; blockLine < segsBlk.height_ ; ++blockLine )
+              {
+                bandDataLinePtr = bandData[ blockLine ];
+                rasterLine = blockLine + segsBlk.startY_;
+                
+                for( blockCol = 0 ; blockCol < segsBlk.width_ ; ++blockCol )
+                {
+                  inputRaster.getElement( blockCol + segsBlk.startX_,
+                    rasterLine, bandDataLinePtr[ blockCol ],
+                    bandIdx );
+                }
+              }   
+            }
+                 
+            segThreadParams.mutexPtr_->unLock();     
+          }
+          
+          // Executing the strategy
+          
+          if( ! strategyPtr->execute( rasterDataVec, segsBlk.segsPtrsMatrix_ ) )
+          {
+            *(segThreadParams.abortSegmentationFlagPtr_ ) = true;
+            TEAGN_LOGERR( "Segmentation strategy execution error" );
+            return false;
+          }
+          
+          // Check block dimensions
+          
+          TEAGN_DEBUG_CONDITION( segsBlk.segsPtrsMatrix_.GetLines()
+            == segsBlk.height_, "Invalid generated matrix lines number " )
+          TEAGN_DEBUG_CONDITION( segsBlk.segsPtrsMatrix_.GetColumns()
+            == segsBlk.width_, "Invalid generated matrix columns number " )
+          
+          // Updating block information
+          
+          segsBlk.status_ = TePDIParaSegSegmentsBlock::BlockSegmented;
+          
+          // Emiting block processed signal
+          
+          segThreadParams.signalPtr_->emitSignal();
+        }
+        else
+        {
+          segThreadParams.mutexPtr_->unLock();
+        }
+      }
+      
+      // Updating the progress interface
+      
+      if( progress.Increment() )
+      {
+        *(segThreadParams.abortSegmentationFlagPtr_ ) = true;
+        TEAGN_LOGERR( "Canceled by the user" );
+        return false;
+      }         
+    }
+  }
+
+  return true;
+}
+
+bool TePDIParallelSegmenter::groupDataThreadEntry(void* paramsPtr)
+{
+  TEAGN_DEBUG_CONDITION( paramsPtr, "Invalid pointer" );
+  GroupDataThreadEntryParams& groupDataThreadParams =
+    *((GroupDataThreadEntryParams*)paramsPtr);
+    
+  TEAGN_DEBUG_CONDITION( groupDataThreadParams.outputRasterPtr_,
+    "Invalid outputRasterPtr_" );
+  TEAGN_DEBUG_CONDITION( groupDataThreadParams.segsBlocksMatrixPtr_,
+    "Invalid segsBlocksMatrixPtr_" );
+  TEAGN_DEBUG_CONDITION( groupDataThreadParams.mutexPtr_,
+    "Invalid mutexPtr_" );
+  TEAGN_DEBUG_CONDITION( groupDataThreadParams.stratParamsPtr_,
+    "Invalid stratParamsPtr_" )
+  TEAGN_DEBUG_CONDITION( groupDataThreadParams.stratNamePtr_, 
+    "Invalid stratNamePtr_" );
+  TEAGN_DEBUG_CONDITION( groupDataThreadParams.abortSegmentationFlagPtr_,
+    "Invalid abortSegmentationFlagPtr_" );
+  TEAGN_DEBUG_CONDITION( groupDataThreadParams.signalPtr_,
+    "Invalid signalPtr_" );    
+    
+  // Creating the segmentation strategy instance
+  
+  TePDIParaSegStrategyFactoryParams facParams;
+  facParams.stratParams_.globalMutexPtr_ = groupDataThreadParams.mutexPtr_;
+  facParams.stratParams_.segmentsIdsCounterPtr_ = 
+    groupDataThreadParams.segmentsIdsCounterPtr_;
+  facParams.stratParams_.blockMergingEnabled_ = 
+    groupDataThreadParams.mergeAdjacentBlocks_;
+  
+  TeSharedPtr< TePDIParaSegStrategy > strategyPtr(
+    TePDIParaSegStrategyFactory::make( *groupDataThreadParams.stratNamePtr_, 
+    facParams ) );
+  TEAGN_TRUE_OR_THROW( strategyPtr.isActive(), 
+    "Unable to create an segmentation strategy" );     
+  TEAGN_TRUE_OR_RETURN( strategyPtr->setParameters(
+    *groupDataThreadParams.stratParamsPtr_ ), 
+    "Unable to set segmentation strategy parameters" );    
+    
+  // Creating the progress instance
+    
+  TePDIPIManager progress( "Grouping blocks", 
+    2 * groupDataThreadParams.segsBlocksMatrixPtr_->GetColumns() *
+    groupDataThreadParams.segsBlocksMatrixPtr_->GetLines(), 
+    groupDataThreadParams.progressEnabled_ );    
+
+  // Processing blocks
+  
+  bool notAllBlocksProcessed = true;
+      
+  do
+  {
+    // Wait for a signal, if required
+    if( groupDataThreadParams.waitForSignals_ )
+    { 
+      groupDataThreadParams.signalPtr_->waitSignal();
+    }
+    
+    if( *(groupDataThreadParams.abortSegmentationFlagPtr_) )
+    {
+      TEAGN_LOGERR( "Segmentation aborted ");
+      return false;
+    }
+    else
+    {
+      // Locking for blocks to merge border segments
+      
+      unsigned int segsBlkMtxLine = 0 ;
+      unsigned int segsBlkMtxCol = 0;
+      
+      for( segsBlkMtxLine = 0 ; segsBlkMtxLine < 
+        groupDataThreadParams.segsBlocksMatrixPtr_->GetLines() ; 
+        ++segsBlkMtxLine )
+      {
+        for( segsBlkMtxCol = 0 ; segsBlkMtxCol < 
+          groupDataThreadParams.segsBlocksMatrixPtr_->GetColumns() ; 
+          ++segsBlkMtxCol )
+        {
+          groupDataThreadParams.mutexPtr_->lock();
+          
+          TePDIParaSegSegmentsBlock& currBlk = groupDataThreadParams.
+            segsBlocksMatrixPtr_->operator()( segsBlkMtxLine, segsBlkMtxCol );
+          
+          // Checking the block requirements 
+          
+          if( currBlk.status_ == TePDIParaSegSegmentsBlock::BlockSegmented )
+          {
+            // Does this block depends on other blocks ???
+            
+            bool blokDependsOk = true;
+            bool requireUpBlk = false;
+            bool requireLeftBlk = false;
+            
+            if( segsBlkMtxLine > 0 )
+            {
+              requireUpBlk = true;
+              
+              if( groupDataThreadParams.segsBlocksMatrixPtr_->operator()( 
+                segsBlkMtxLine - 1 , segsBlkMtxCol ).status_ != 
+                TePDIParaSegSegmentsBlock::BlockMerged )
+              {
+                // Cannot process this block since the required block
+                // from the above line was not merged yet
+
+                blokDependsOk = false;
+              }
+            }
+            
+            if( segsBlkMtxCol > 0 )
+            {
+              requireLeftBlk = true;
+              
+              if( groupDataThreadParams.segsBlocksMatrixPtr_->operator()( 
+                segsBlkMtxLine, segsBlkMtxCol - 1 ).status_ != 
+                TePDIParaSegSegmentsBlock::BlockMerged )
+              {
+                // Cannot process this block since the required left block
+                // merged yet
+
+                blokDependsOk = false;
+              }
+            }
+            
+            // Ok to merge ??
+            
+            if( blokDependsOk )
+            {
+              TePDIParaSegSegmentsBlock* upBlkPtr = 0;
+              if( requireUpBlk )
+              { 
+                upBlkPtr = &( groupDataThreadParams.segsBlocksMatrixPtr_->operator()( 
+                  segsBlkMtxLine - 1, segsBlkMtxCol ) );
+              }
+              
+              
+              TePDIParaSegSegmentsBlock* leftBlkPtr = 0;
+              if( requireLeftBlk )
+              {
+                leftBlkPtr = &( groupDataThreadParams.segsBlocksMatrixPtr_->operator()( 
+                  segsBlkMtxLine, segsBlkMtxCol - 1 ) );
+              }
+              
+              groupDataThreadParams.mutexPtr_->unLock();
+              
+              // Merging block
+              
+              if( groupDataThreadParams.mergeAdjacentBlocks_)
+              {
+                if( ! strategyPtr->mergeSegments( currBlk.segsPtrsMatrix_,
+                  ( requireUpBlk ? &(upBlkPtr->segsPtrsMatrix_) : 0 ), 
+                  ( requireLeftBlk ? &(leftBlkPtr->segsPtrsMatrix_) : 0 ) ) )
+                {
+                  TEAGN_LOGERR( "Block merging error");
+                  *(groupDataThreadParams.abortSegmentationFlagPtr_ ) = true;
+                  return false;
+                }
+              }              
+              
+              currBlk.status_ = TePDIParaSegSegmentsBlock::BlockMerged;
+              
+              if( progress.Increment() )
+              {
+                TEAGN_LOGERR( "Canceled by the user");
+                *(groupDataThreadParams.abortSegmentationFlagPtr_ ) = true;
+                return false;
+              }
+            }
+            else
+            {
+              groupDataThreadParams.mutexPtr_->unLock();
+              
+              // Unable to process the current block
+              // break the loop and wait until the next oportunity
+              
+              segsBlkMtxLine = 
+                groupDataThreadParams.segsBlocksMatrixPtr_->GetLines();
+                
+              break;
+            }
+          }
+          else
+          { // This block was not segmented yet !
+            groupDataThreadParams.mutexPtr_->unLock();
+          }
+        } 
+      }
+            
+      // Locking for blocks to flush
+      
+      for( segsBlkMtxLine = 0 ; segsBlkMtxLine < 
+        groupDataThreadParams.segsBlocksMatrixPtr_->GetLines() ; ++segsBlkMtxLine )
+      {
+        for( segsBlkMtxCol = 0 ; segsBlkMtxCol < 
+          groupDataThreadParams.segsBlocksMatrixPtr_->GetColumns() ; ++segsBlkMtxCol )
+        {
+          groupDataThreadParams.mutexPtr_->lock();
+          
+          TePDIParaSegSegmentsBlock& currBlk = groupDataThreadParams.
+            segsBlocksMatrixPtr_->operator()( segsBlkMtxLine, segsBlkMtxCol );
+          
+          // Checking the block requirements 
+          
+          if( currBlk.status_ == TePDIParaSegSegmentsBlock::BlockMerged )
+          {
+            // Does this block depends on other blocks ???
+            
+            bool blokDependsOk = true;
+            bool requireDownBlk = false;
+            bool requireRightBlk = false;
+            
+            if( segsBlkMtxLine < ( groupDataThreadParams.segsBlocksMatrixPtr_->
+              GetLines() - 1 ) )
+            {
+              requireDownBlk = true;
+              
+              if( groupDataThreadParams.segsBlocksMatrixPtr_->operator()( 
+                segsBlkMtxLine + 1 , segsBlkMtxCol ).status_ != 
+                TePDIParaSegSegmentsBlock::BlockMerged )
+              {
+                // Cannot process this block since the required block
+                // from the above line was not segmented yet
+
+                blokDependsOk = false;
+              }
+            }
+            
+            if( segsBlkMtxCol < ( groupDataThreadParams.segsBlocksMatrixPtr_->
+              GetColumns() - 1 ) )
+            {
+              requireRightBlk = true;
+              
+              if( groupDataThreadParams.segsBlocksMatrixPtr_->operator()( 
+                segsBlkMtxLine, segsBlkMtxCol + 1 ).status_ != 
+                TePDIParaSegSegmentsBlock::BlockMerged )
+              {
+                // Cannot process this block since the required left block
+                // segmented yet
+
+                blokDependsOk = false;
+              }
+            }
+            
+            // Ok to flush ??
+            
+            if( blokDependsOk )
+            {
+              groupDataThreadParams.mutexPtr_->unLock();
+              
+              // Flushing block
+
+              if( ! flushBlock( currBlk, 
+                *(groupDataThreadParams.outputRasterPtr_), progress ) )
+              {
+                TEAGN_LOGERR( "Block flushing error");
+                *(groupDataThreadParams.abortSegmentationFlagPtr_ ) = true;
+                return false;
+              }
+              
+              currBlk.status_ = TePDIParaSegSegmentsBlock::BlockFlushed;
+              
+              if( progress.Increment() )
+              {
+                TEAGN_LOGERR( "Canceled by the user");
+                *(groupDataThreadParams.abortSegmentationFlagPtr_ ) = true;
+                return false;
+              }              
+              
+              // Is this the last block to flush ??
+              
+              if( ( segsBlkMtxLine == groupDataThreadParams.segsBlocksMatrixPtr_->
+                GetLines() - 1 ) && ( segsBlkMtxCol == groupDataThreadParams.
+                segsBlocksMatrixPtr_->GetColumns() - 1 ) )
+              {
+                notAllBlocksProcessed = false;
+              }
+            }
+            else
+            {
+              groupDataThreadParams.mutexPtr_->unLock();
+              
+              // Unable to process the current block
+              // break the loop and wait until the next oportunity
+              
+              segsBlkMtxLine = 
+                groupDataThreadParams.segsBlocksMatrixPtr_->GetLines();
+                
+              break;              
+            }
+          }
+          else
+          { // This block was not segmented yet !
+            groupDataThreadParams.mutexPtr_->unLock();
+          }
+        } 
+      }            
+    }
+  } while( notAllBlocksProcessed );
+
+  return true;
+}
+
+bool TePDIParallelSegmenter::flushBlock( TePDIParaSegSegmentsBlock& currBlock,
+  TeRaster& outRaster, TePDIPIManager& progress )
+{
+  TEAGN_DEBUG_CONDITION( outRaster.params().status_ !=  
+    TeRasterParams::TeNotReady, 
+    "Output raster not initiated" );
+  TEAGN_DEBUG_CONDITION( currBlock.width_ == currBlock.segsPtrsMatrix_.
+    GetColumns(), 
+    "Block size mismatch" );
+  TEAGN_DEBUG_CONDITION( currBlock.height_ == currBlock.segsPtrsMatrix_.
+    GetLines(), 
+    "Block size mismatch" );
+  TEAGN_DEBUG_CONDITION( currBlock.status_ == 
+    TePDIParaSegSegmentsBlock::BlockMerged, "Cannot flush a not merged block" );
+    
+  unsigned int curBLine = 0;
+  unsigned int curBCol = 0;
+  unsigned int rasterLine = 0;
+  unsigned int rasterCol = 0;
+  TePDIParaSegSegment* const* bLinePtr = 0;
+  
+  // Flushing data to output raster
+  
+  for( curBLine = 0 ; curBLine < currBlock.height_ ; ++curBLine )
+  {
+    rasterLine = curBLine + currBlock.startY_;
+    bLinePtr = currBlock.segsPtrsMatrix_.operator[]( curBLine );
+    
+    for( curBCol = 0 ; curBCol < currBlock.width_ ; ++curBCol )
+    {
+      rasterCol = curBCol + currBlock.startX_;
+      
+      if( ! outRaster.setElement( rasterCol, rasterLine, (double)
+        (bLinePtr[ curBCol ]->id_), 0 ) )
+      {
+        TEAGN_LOGERR( "Error writing to output raster" );
+        return false;
+      }
+    }
+    
+    TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" )
+  }
+  
+  // Cleanning data
+  
+  currBlock.clear();
+    
+  // So far... so GOOD !!
+  
+  return true;
+}
+
+bool TePDIParallelSegmenter::calcBestBlockSize( unsigned int totalImageLines, 
+  unsigned totalImageCols, unsigned int maxBlockPixels, 
+  unsigned int& blockWidth, unsigned int& blockHeight ) const
+{
+  double currDownScaleFactor = 1;
+  double currBlockWidth = ((double)totalImageCols);
+  double currBlockHeight = ((double)totalImageLines);
+  double currBlockPixels = currBlockWidth * currBlockHeight;
+
+  while( currBlockPixels > 1 )
+  {
+    if( currBlockPixels <= ((double)maxBlockPixels) )
+    {
+      blockWidth = (unsigned int)ceil( currBlockWidth );
+      blockHeight = (unsigned int)ceil( currBlockHeight );
+      
+      return true;
+    }
+    else
+    {
+      ++currDownScaleFactor;
+      
+      currBlockWidth = ((double)totalImageCols) / currDownScaleFactor;
+      currBlockHeight = ((double)totalImageLines) / currDownScaleFactor;
+      
+      currBlockPixels = currBlockWidth * currBlockHeight;
+    }
+  }
+  
+  return false;
+}
+
diff --git a/src/terralib/image_processing/TePDIParallelSegmenter.hpp b/src/terralib/image_processing/TePDIParallelSegmenter.hpp
new file mode 100644
index 0000000..8fa2a2f
--- /dev/null
+++ b/src/terralib/image_processing/TePDIParallelSegmenter.hpp
@@ -0,0 +1,266 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPARALELLSEGMENTER_HPP
+  #define TEPDIPARALELLSEGMENTER_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIMatrix.hpp"
+  #include "TePDIParaSegSegmentsBlock.hpp"
+  #include "TePDIParaSegSegment.hpp"
+  #include "TePDIParaSegStrategy.hpp"
+  
+  #include <TeMutex.h>
+  #include <TeThreadSignal.h>
+
+  /*!
+      \class TePDIParallelSegmenter
+      \brief Multi-threaded image segmenter.
+      \details This class acts just like a threaded engine that splits the 
+      input image into small blocks to be  processed by the choosen 
+      segmentation strategy. All blocks are segmented independently and the 
+      result will be merged (if possible) at the end.
+      \author Emiliano F. Castejon <castejon at dpi.inpe.br>.
+      \ingroup TePDISegmentationGroup
+     
+      \note The required parameters are:
+     
+      \param input_image_ptr (TePDITypes::TePDIRasterPtrType) - 
+      The input image pointer.
+      \param input_channels ( std::vector< unsigned int > ) - Bands/channels
+      to process from input_image.
+      \param strategy_name (std::string) - Parallel segmenter strategy name
+      (see each TePDIParaSegStrategy inherited classes
+      documentation reference).
+      \param output_image_ptr (TePDITypes::TePDIRasterPtrType) - 
+      The output labeled image.      
+     
+      \note The optional parameters are:
+      
+      \param strategy_params (TePDIParameters) - Segmenter strategy specific
+      parameters (see each TePDIParaSegStrategy inherited classes
+      documentation reference).
+      \param max_block_size (unsigned int) - The input image will be
+      split into blocks with this for processing, this parameter
+      tells the maximum block lateral size (width/height), the default: 
+      automatic width following the current system resources and physical processors
+      number).
+      \param max_seg_threads (unsigned int) - The maximum number of concurrent
+      segmenter threads (default:the number of physical processors,
+      minimum:0 - multi-thread disabled).    
+      \param merge_adjacent_blocks (bool) - All image adjacent blocks boder 
+      segments will be merged, when possible (default:true)
+      
+      \note Since this algorithm uses multi-thread processing the user must be 
+      aware that some image decoders do not offer support for multi-threaded 
+      processing.
+      
+      \example TePDIParallelSegmenter_test.cpp Shows how to use this class.
+  */
+  class PDI_DLL TePDIParallelSegmenter : public TePDIAlgorithm 
+  {
+    public :
+    
+      TePDIParallelSegmenter();
+
+      ~TePDIParallelSegmenter();
+
+      // Overloaded
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+    
+      /*! Segments blocks matrix type definition */
+      typedef TePDIMatrix< TePDIParaSegSegmentsBlock > SegmentsBlocksMatrixT;    
+    
+      /*! 
+        \brief The parameters passed to the segmenterThreadEntry method.
+      */     
+      class SegmenterThreadEntryParams
+      {
+        public :
+          /*! Pointer to the input raster (default:0)*/
+          TeRaster* inputRasterPtr_;      
+          
+          /*! Pointer to the input raster used channels vector (default:0)*/
+          std::vector< unsigned int > const* inputChannelsVecPtr_;
+        
+          /*! Pointer to the segments blocks matrix (default:0)*/
+          SegmentsBlocksMatrixT* segsBlocksMatrixPtr_;
+          
+          /*! Pointer to the global mutex (default:0)*/
+          TeMutex* mutexPtr_;
+          
+          /*! Pointer to the segmenter strategy parameters (default:0)*/
+          TePDIParameters const* stratParamsPtr_;
+          
+          /*! Pointer to the segmenter strategy name (default:0)*/
+          std::string const* stratNamePtr_;
+          
+          /*! Pointer to the abort segmentation flag (default:0)*/
+          bool* abortSegmentationFlagPtr_;
+          
+          /*! Pointer to the segments Ids counter - (must be used with 
+          mutexPtr_ - default 0) */
+          TePDIParaSegSegment::SegIdDataType* segmentsIdsCounterPtr_;
+          
+          /*! A signal to be emited when a segments block was processed (default:0)*/
+          TeThreadSignal* signalPtr_;
+          
+          /*! Progress interface enabled/disabled flag (default:false). */ 
+          bool progressEnabled_;  
+                  
+          /*! Merge adjacent blocks border segments (default:false). */ 
+          bool mergeAdjacentBlocks_;                  
+          
+          SegmenterThreadEntryParams()
+          {
+            inputRasterPtr_ = 0;
+            inputChannelsVecPtr_ = 0;
+            segsBlocksMatrixPtr_ = 0;
+            mutexPtr_ = 0;
+            stratParamsPtr_ = 0;
+            stratNamePtr_ = 0;
+            abortSegmentationFlagPtr_ = 0;
+            segmentsIdsCounterPtr_ = 0;
+            signalPtr_ = 0;
+            progressEnabled_ = false;
+            mergeAdjacentBlocks_ = false;
+          }
+          
+          ~SegmenterThreadEntryParams() {};
+      };
+      
+      /*! 
+        \brief The parameters passed to the groupDataThreadEntry method.
+      */     
+      class GroupDataThreadEntryParams
+      {
+        public :
+        
+          /*! Pointer to the pre-initiated output raster */
+          TeRaster* outputRasterPtr_;    
+                
+          /*! Pointer to the segments blocks matrix */
+          SegmentsBlocksMatrixT* segsBlocksMatrixPtr_;
+          
+          /*! Pointer to the global mutex */
+          TeMutex* mutexPtr_;
+          
+          /*! Pointer to the segmenter strategy parameters */
+          TePDIParameters const* stratParamsPtr_;
+          
+          /*! Pointer to the segmenter strategy name */
+          std::string const* stratNamePtr_;
+          
+          /*! Pointer to the abort segmentation flag */
+          bool* abortSegmentationFlagPtr_;
+          
+          /*! A signal to be listen when a segments block was processed 
+          or errors aborting the segmentation process (default:0)*/
+          TeThreadSignal* signalPtr_;      
+              
+          /*! Pointer to the segments Ids counter - (must be used with 
+          mutexPtr_ - default 0) */
+          TePDIParaSegSegment::SegIdDataType* segmentsIdsCounterPtr_;
+          
+          /*! If true, the thread will wait for signals emitted by signalPtr_
+          (default true) */          
+          bool waitForSignals_;
+          
+          /*! Progress interface enabled/disabled flag (default:false). */ 
+          bool progressEnabled_;         
+                   
+          /*! Merge adjacent blocks border segments (default:false). */ 
+          bool mergeAdjacentBlocks_;
+          
+          GroupDataThreadEntryParams()
+          {
+            outputRasterPtr_ = 0;
+            segsBlocksMatrixPtr_ = 0;
+            mutexPtr_ = 0;
+            stratParamsPtr_ = 0;
+            stratNamePtr_ = 0;
+            abortSegmentationFlagPtr_ = 0;
+            signalPtr_ = 0;
+            segmentsIdsCounterPtr_ = 0;
+            waitForSignals_ = true;
+            progressEnabled_ = false;
+            mergeAdjacentBlocks_ = false;
+          }
+          
+          ~GroupDataThreadEntryParams() {};
+      };      
+      
+      // Overloaded
+      bool RunImplementation();
+
+      // Overloaded
+      void ResetState( const TePDIParameters& params );
+      
+      /*! 
+        \brief Segmenter thread entry.
+        \param paramsPtr A pointer to a casted SegmenterThreadEntryParams.
+        \return true if OK, false on errors.
+      */      
+      static bool segmenterThreadEntry(void* paramsPtr);
+      
+      /*! 
+        \brief Group segmented data thread entry.
+        \param paramsPtr A pointer to a casted GroupDataThreadEntryParams.
+        \return true if OK, false on errors.
+      */      
+      static bool groupDataThreadEntry(void* paramsPtr);      
+        
+      /*! 
+        \brief Flush block to output raster.
+        \param currBlock The current block that will be flushed.
+        \param outRaster The output raster.
+        \param progress Progress interface instance to increment.
+        \return true if OK, false on errors.
+        \note The block unused memory will be freed as well segments
+        with no more references left.
+      */      
+      static bool flushBlock( TePDIParaSegSegmentsBlock& currBlock,
+        TeRaster& outRaster, TePDIPIManager& progress ); 
+               
+      /*! 
+        \brief Calc the best sub-image block size for each thread to
+        process.
+        \param totalImageLines The total original full image lines.
+        \param totalImageCols The total original full image columns.
+        \param maxBlockPixels The calculated block maximum allowed pixels number.
+        \param blockWidth The calculated block width.
+        \param blockHeight The calculated block width.
+        \return true if OK, false on errors.
+      */                
+      bool calcBestBlockSize( unsigned int totalImageLines, 
+        unsigned totalImageCols,
+        unsigned int maxBlockPixels, unsigned int& blockWidth,
+        unsigned int& blockHeight ) const;
+      
+  };
+
+
+#endif
diff --git a/src/terralib/image_processing/TePDIParameters.cpp b/src/terralib/image_processing/TePDIParameters.cpp
old mode 100755
new mode 100644
index a7dc113..215c23f
--- a/src/terralib/image_processing/TePDIParameters.cpp
+++ b/src/terralib/image_processing/TePDIParameters.cpp
@@ -1,65 +1,65 @@
-#include "TePDIParameters.hpp"
-
-#include <TeAgnostic.h>
-
-#include <TeUtils.h>
-
-TePDIParameters::TePDIParameters()
-{
-}
-
-
-TePDIParameters::TePDIParameters( const TePDIParameters& external )
-: TeMultiContainer< std::string >( external )
-{
-}
-
-
-TePDIParameters::~TePDIParameters()
-{
-}
-
-
-void TePDIParameters::Clear()
-{
-  TeMultiContainer< std::string >::clear();
-}
-
-
-void TePDIParameters::SetdecName( const std::string& dec_name )
-{
-  TeMultiContainer< std::string >::store( "dec_name", dec_name );
-}
-
-
-std::string TePDIParameters::decName() const
-{
-  std::string return_string;
-  
-  TEAGN_TRUE_OR_THROW( TeMultiContainer< std::string >::retrive( "dec_name", 
-    return_string ), "Parameters descriptor not set" );
-  
-  return return_string;
-}
-
-
-bool TePDIParameters::operator==( const TePDIParameters& ext_instance ) const
-{
-  return TeMultiContainer< std::string >::operator==( ext_instance );
-}
-
-
-bool TePDIParameters::operator!=( const TePDIParameters& ext_instance ) const
-{
-  return TeMultiContainer< std::string >::operator!=( ext_instance );
-}
-
-
-const TePDIParameters& TePDIParameters::operator=( 
-  const TePDIParameters& ext_instance )
-{
-  TeMultiContainer< std::string >::operator=( ext_instance );
-  
-  return ext_instance;
-}
-
+#include "TePDIParameters.hpp"
+
+#include <TeAgnostic.h>
+
+#include <TeUtils.h>
+
+TePDIParameters::TePDIParameters()
+{
+}
+
+
+TePDIParameters::TePDIParameters( const TePDIParameters& external )
+: TeMultiContainer< std::string >( external )
+{
+}
+
+
+TePDIParameters::~TePDIParameters()
+{
+}
+
+
+void TePDIParameters::Clear()
+{
+  TeMultiContainer< std::string >::clear();
+}
+
+
+void TePDIParameters::SetdecName( const std::string& dec_name )
+{
+  TeMultiContainer< std::string >::store( "dec_name", dec_name );
+}
+
+
+std::string TePDIParameters::decName() const
+{
+  std::string return_string;
+  
+  TEAGN_TRUE_OR_THROW( TeMultiContainer< std::string >::retrive( "dec_name", 
+    return_string ), "Parameters descriptor not set" );
+  
+  return return_string;
+}
+
+
+bool TePDIParameters::operator==( const TePDIParameters& ext_instance ) const
+{
+  return TeMultiContainer< std::string >::operator==( ext_instance );
+}
+
+
+bool TePDIParameters::operator!=( const TePDIParameters& ext_instance ) const
+{
+  return TeMultiContainer< std::string >::operator!=( ext_instance );
+}
+
+
+const TePDIParameters& TePDIParameters::operator=( 
+  const TePDIParameters& ext_instance )
+{
+  TeMultiContainer< std::string >::operator=( ext_instance );
+  
+  return ext_instance;
+}
+
diff --git a/src/terralib/image_processing/TePDIParameters.hpp b/src/terralib/image_processing/TePDIParameters.hpp
old mode 100755
new mode 100644
index e212481..92b567d
--- a/src/terralib/image_processing/TePDIParameters.hpp
+++ b/src/terralib/image_processing/TePDIParameters.hpp
@@ -1,176 +1,177 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-/**
- *  @brief This file contains the class of structures and definitions
- *   to deal with parameters used by all PDI classes.
- */
-
-#ifndef TEPDIPARAMETERS_HPP
-  #define TEPDIPARAMETERS_HPP
-
-  #include "TePDITypes.hpp"
-  
-  #include <TeMultiContainer.h>
-  
-  #include <string>
-
-/**
- * @brief This is the class to deal with parameters used by all PDI classes.
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- * @ingroup PDIAux
- @note Do not use this class with polymorphic types !!
- */
-  class PDI_DLL TePDIParameters : protected 
-    TeMultiContainer< std::string >
-  {
-    public :
-    
-      /** @typedef TeSharedPtr< TePDIParameters > pointer 
-          Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIParameters > pointer;
-      
-      /** @typedef const TeSharedPtr< TePDIParameters > const_pointer 
-          Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIParameters > const_pointer;
-
-      /**
-       * @brief Default Constructor
-       */
-      TePDIParameters();
-      
-      /**
-       * @brief Alternative Constructor
-       * @param external External reference.
-       */
-      TePDIParameters( const TePDIParameters& external );      
-
-      /**
-       * @brief  Default Destructor
-       */
-      ~TePDIParameters();
-      
-      /**
-       * @brief Set the a name descriptor for the current parameters.
-       *
-       * @param dec_name A a name descriptor for the current parameters. 
-       */                                                      
-      void SetdecName( const std::string& dec_name );                            
-                           
-      /**
-       * @brief Returns the a name descriptor for the current parameters.
-       *
-       * @return A a name descriptor for the current parameters. 
-       */                                                      
-      std::string decName() const;                           
-      
-      /**
-       * @brief Operator == overload.
-       *
-       * @param ext_instance External instance reference.
-       * @return true if this instance have the same internal
-       * parameters that the external instance.
-       */
-      bool operator==( const TePDIParameters& ext_instance ) const;
-      
-      /**
-       * @brief Operator != overload.
-       *
-       * @param ext_instance External instance reference.
-       * @return true if this instance don't have the same internal
-       * parameters that the external instance.
-       */
-      bool operator!=( const TePDIParameters& ext_instance ) const;
-      
-      /**
-       * @brief operator= overload.
-       *
-       * @param ext_instance External instance reference.
-       * @return The external instance reference.
-       */
-      const TePDIParameters& operator=( const TePDIParameters& ext_instance );
-      
-      /**
-       * @brief Clear all parameter contents.
-       *
-       */
-      void Clear();
-                         
-      /**
-       * @brief Store a parameter object copy.
-       *
-       * @param pname Parameter name.
-       * @param data Parameter object instance.
-       */                         
-      template< typename DataT >
-      void SetParameter( const std::string& pname,
-                         const DataT& data )
-      {
-        TeMultiContainer< std::string >::store( pname, data );
-      };
-      
-      /**
-       * @brief Retrive a copy of a stored object.
-       *
-       * @param pname Parameter name.
-       * @param data Output parameter data.
-       * @return true if OK, false if the parameter was no found or error.
-       */      
-      template< typename DataT >
-      bool GetParameter( const std::string& pname,
-                         DataT& data ) const
-      {
-        return TeMultiContainer< std::string >::retrive( pname, data );
-      };
-      
-      /** 
-       * @brief Checks if a parameter was set.
-       * 
-       * @param pname Parameter name.
-       * @note The parameter data type must be specified.
-       * @return true if OK, false if the parameter was not set.
-       */
-      template< typename DataT >
-      bool CheckParameter( const std::string& pname ) const
-      {
-        return TeMultiContainer< std::string >::isStored< DataT >( pname );
-      };
-      
-      /** 
-       * @brief Remove a stored parameter.
-       * 
-       * @param pname Parameter name.
-       */
-      void RemoveParameter( const std::string& pname )
-      {
-        TeMultiContainer< std::string >::remove( pname );
-      };      
-
-};
-
-/** @example TePDIParameters_test.cpp
- *    Shows how to use this class.
- */  
-
-#endif //TEPDIPARAMETERS_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+/**
+ *  @brief This file contains the class of structures and definitions
+ *   to deal with parameters used by all PDI classes.
+ */
+
+#ifndef TEPDIPARAMETERS_HPP
+  #define TEPDIPARAMETERS_HPP
+
+  #include "TePDITypes.hpp"
+  
+  #include <TeMultiContainer.h>
+  
+  #include <string>
+
+/**
+ * @class TePDIParameters
+ * @brief Store parameters used by all PDI classes.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * @ingroup PDIAux
+ * @note Do not use this class with polymorphic types !!
+ */
+  class PDI_DLL TePDIParameters : protected 
+    TeMultiContainer< std::string >
+  {
+    public :
+    
+      /** @typedef TeSharedPtr< TePDIParameters > pointer 
+          Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIParameters > pointer;
+      
+      /** @typedef const TeSharedPtr< TePDIParameters > const_pointer 
+          Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIParameters > const_pointer;
+
+      /**
+       * @brief Default Constructor
+       */
+      TePDIParameters();
+      
+      /**
+       * @brief Alternative Constructor
+       * @param external External reference.
+       */
+      TePDIParameters( const TePDIParameters& external );      
+
+      /**
+       * @brief  Default Destructor
+       */
+      ~TePDIParameters();
+      
+      /**
+       * @brief Set the a name descriptor for the current parameters.
+       *
+       * @param dec_name A a name descriptor for the current parameters. 
+       */                                                      
+      void SetdecName( const std::string& dec_name );                            
+                           
+      /**
+       * @brief Returns the a name descriptor for the current parameters.
+       *
+       * @return A a name descriptor for the current parameters. 
+       */                                                      
+      std::string decName() const;                           
+      
+      /**
+       * @brief Operator == overload.
+       *
+       * @param ext_instance External instance reference.
+       * @return true if this instance have the same internal
+       * parameters that the external instance.
+       */
+      bool operator==( const TePDIParameters& ext_instance ) const;
+      
+      /**
+       * @brief Operator != overload.
+       *
+       * @param ext_instance External instance reference.
+       * @return true if this instance don't have the same internal
+       * parameters that the external instance.
+       */
+      bool operator!=( const TePDIParameters& ext_instance ) const;
+      
+      /**
+       * @brief operator= overload.
+       *
+       * @param ext_instance External instance reference.
+       * @return The external instance reference.
+       */
+      const TePDIParameters& operator=( const TePDIParameters& ext_instance );
+      
+      /**
+       * @brief Clear all parameter contents.
+       *
+       */
+      void Clear();
+                         
+      /**
+       * @brief Store a parameter object copy.
+       *
+       * @param pname Parameter name.
+       * @param data Parameter object instance.
+       */                         
+      template< typename DataT >
+      void SetParameter( const std::string& pname,
+                         const DataT& data )
+      {
+        TeMultiContainer< std::string >::store( pname, data );
+      };
+      
+      /**
+       * @brief Retrive a copy of a stored object.
+       *
+       * @param pname Parameter name.
+       * @param data Output parameter data.
+       * @return true if OK, false if the parameter was no found or error.
+       */      
+      template< typename DataT >
+      bool GetParameter( const std::string& pname,
+                         DataT& data ) const
+      {
+        return TeMultiContainer< std::string >::retrive( pname, data );
+      };
+      
+      /** 
+       * @brief Checks if a parameter was set.
+       * 
+       * @param pname Parameter name.
+       * @note The parameter data type must be specified.
+       * @return true if OK, false if the parameter was not set.
+       */
+      template< typename DataT >
+      bool CheckParameter( const std::string& pname ) const
+      {
+        return TeMultiContainer< std::string >::isStored< DataT >( pname );
+      };
+      
+      /** 
+       * @brief Remove a stored parameter.
+       * 
+       * @param pname Parameter name.
+       */
+      void RemoveParameter( const std::string& pname )
+      {
+        TeMultiContainer< std::string >::remove( pname );
+      };      
+
+};
+
+/** @example TePDIParameters_test.cpp
+ *    Shows how to use this class.
+ */  
+
+#endif //TEPDIPARAMETERS_HPP
diff --git a/src/terralib/image_processing/TePDIPrincipalComponents.cpp b/src/terralib/image_processing/TePDIPrincipalComponents.cpp
old mode 100755
new mode 100644
index 84710e9..c2ceca7
--- a/src/terralib/image_processing/TePDIPrincipalComponents.cpp
+++ b/src/terralib/image_processing/TePDIPrincipalComponents.cpp
@@ -1,409 +1,433 @@
-#include "TePDIPrincipalComponents.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-#include "TePDITypes.hpp"
-#include "TePDIStatistic.hpp"
-
-#include <TeMatrix.h>
-#include <TeUtils.h>
-
-#include <math.h>
-
-
-
-TePDIPrincipalComponents::TePDIPrincipalComponents()
-{
-}
-
-
-TePDIPrincipalComponents::~TePDIPrincipalComponents()
-{
-}
-
-
-void TePDIPrincipalComponents::ResetState(
-  const TePDIParameters&)
-{
-}
-
-
-bool TePDIPrincipalComponents::CheckParameters(
-  const TePDIParameters& parameters) const
-{
-/* Analysis type checking */
-	TePDIPCAType analysis_type;
-
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("analysis_type", 
-	  analysis_type), "Missing parameter: analysis_type");
-	TEAGN_TRUE_OR_RETURN(
-	  ((analysis_type == TePDIPrincipalComponents::TePDIPCADirect) || 
-	  (analysis_type == TePDIPrincipalComponents::TePDIPCAInverse)), 
-	  "Invalid analysis type");
-
-/* Input rasters and bands checking */
-	
-	TePDITypes::TePDIRasterVectorType input_rasters;
-	
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
-	TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
-	
-	std::vector<int> bands;
-	
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
-	TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), "Invalid parameter: bands number");
-
-	for( unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); ++input_rasters_index )
-	{
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
-		TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[ " + Te2String(input_rasters_index) + " ]");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[ 0 ]->params().ncols_, "Invalid parameter: input_raster " + Te2String( input_rasters_index ) + " with imcompatible number of columns" );
-/* Checking photometric interpretation */
-		TEAGN_TRUE_OR_RETURN(((input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeRGB) || (input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeMultiBand)), "Invalid parameter - input_rasters (invalid photometric interpretation)" );
-	}
-
-/* Output rasters checking */
-
-	TePDITypes::TePDIRasterVectorType output_rasters;
-
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
-	TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
-	TEAGN_TRUE_OR_RETURN(output_rasters.size() == input_rasters.size(), "Invalid parameter: output rasters size");
-
-	for(unsigned int input_rasters_index2 = 0; input_rasters_index2 < input_rasters.size(); ++input_rasters_index2)
-	{
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " inactive");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " not ready");
-	}
-	
-	/* Checking covariance_matrix */
-
-	TeSharedPtr<TeMatrix> covariance_matrix;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("covariance_matrix", 
-	  covariance_matrix), "Missing parameter: covariance_matrix");
-
-/* Inverse type checking */
-
-	if (analysis_type == TePDIPrincipalComponents::TePDIPCAInverse)
-		TEAGN_TRUE_OR_RETURN((((unsigned)covariance_matrix->Nrow() == input_rasters.size()) && ((unsigned)covariance_matrix->Ncol() == input_rasters.size())), "Covariance matrix out of rasters bounds");
-		
-	return true;
-}
-
-bool TePDIPrincipalComponents::RunImplementation_direct()
-{
-	TePDITypes::TePDIRasterVectorType input_rasters;
-	params_.GetParameter("input_rasters", input_rasters);
-	
-	TePDITypes::TePDIRasterVectorType output_rasters;
-	params_.GetParameter("output_rasters", output_rasters);
-	
-	std::vector<int> bands;
-	params_.GetParameter("bands", bands);
-
-	TeSharedPtr<TeMatrix> covariance_matrix;
-	params_.GetParameter("covariance_matrix", covariance_matrix);
-	
-	TeRasterParams base_raster_params = input_rasters[0]->params();
-	
-/* Setting the output rasters */
-	
-	for(unsigned int outrasterindex = 0; outrasterindex < output_rasters.size(); ++outrasterindex)
-	{
-		TeRasterParams outRaster_params = output_rasters[outrasterindex]->params();
-		outRaster_params.nBands(1);
-		if (base_raster_params.projection() != 0)
-		{
-			TeSharedPtr<TeProjection> proj(TeProjectionFactory::make(base_raster_params.projection()->params())); 
-			outRaster_params.projection(proj.nakedPointer());
-		}
-		outRaster_params.boxResolution(base_raster_params.box().x1(), base_raster_params.box().y1(), base_raster_params.box().x2(), base_raster_params.box().y2(), base_raster_params.resx_, base_raster_params.resy_);
-		outRaster_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
-		//outRaster_params.setDataType(TeDOUBLE, -1);
-	
-		TEAGN_TRUE_OR_RETURN(output_rasters[outrasterindex]->init(outRaster_params), "Raster reset error - Raster index " + Te2String(outrasterindex));
-	}
-	
-/* Finding the mininum and maximum allowed pixel values */
-	
-	double channel_min_level = 0;
-	double channel_max_level = 0;
-	
-	TEAGN_TRUE_OR_RETURN(TePDIUtils::TeGetRasterMinMaxBounds(input_rasters[0], bands[0], channel_min_level, channel_max_level), "Unable to get raster channel level bounds");
-	
-/* Initializing statistic module */
-	
-	TePDIStatistic stat;
-	
-	TePDIParameters stat_pars;
-	stat_pars.SetParameter("rasters", input_rasters);
-	stat_pars.SetParameter("bands", bands);
-	
-	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
-	stat.ToggleProgInt(false);
-
-	
-/* Building covariance matrix from all used bands ( lines == columns ) */
-
-	TeSharedPtr<TeMatrix> x(new TeMatrix);
-	*covariance_matrix = stat.getCovMatrix();
-/* Building eigenvalues matrix from all used bands ( 1 column ) */
-
-	TeMatrix eigenvaluesmatrix;
-	TEAGN_TRUE_OR_RETURN(covariance_matrix->EigenValues(eigenvaluesmatrix), "Unable to build eigenvalue matrix");
-	
-/* Building eigenvectors matrix from all used bands (lines == columns) */
-
-	TeMatrix tempmatrix;
-	TEAGN_TRUE_OR_RETURN(covariance_matrix->EigenVectors(tempmatrix), "Unable to build eigenvectors matrix");
-	TeMatrix eigenvectors;
-	TEAGN_TRUE_OR_RETURN(tempmatrix.Transpose(eigenvectors), "Unable to build eigenvectors matrix");
-	
-/* Building auxiliary vectors for optimization */
-
-	std::vector< bool > in_dummy_use_vector;
-	for (unsigned int in_dummy_use_vector_index = 0; in_dummy_use_vector_index < input_rasters.size(); ++in_dummy_use_vector_index)
-	{
-		in_dummy_use_vector.push_back(input_rasters[in_dummy_use_vector_index]->params().useDummy_);
-	}
-
-	std::vector< double > out_dummy_vector;
-	for (unsigned int out_dummy_vector_index = 0; out_dummy_vector_index < output_rasters.size(); ++out_dummy_vector_index)
-	{
-		if (output_rasters[out_dummy_vector_index]->params().useDummy_)
-		{
-			out_dummy_vector.push_back(output_rasters[out_dummy_vector_index]->params().dummy_[0]);
-		}
-		else
-		{
-			out_dummy_vector.push_back(0.0);
-		}
-	}
-	
-/* Do level remapping based on each matrix above */
-	TeMatrix in_values; /* input levels */
-	in_values.Init(bands.size(), 1, 0.0);
-	
-	TeMatrix intermediary_values;
-	intermediary_values.Init(bands.size(), 1, 0.0);
-	
-	int line;
-	int column;
-	unsigned int index;
-	unsigned int index_bound = bands.size();
-	double value;
-	bool missing_pixel = false;
-
-	TePDIPIManager progress("Generating principal components", base_raster_params.nlines_, progress_enabled_);
-	for(line = 0 ; line < base_raster_params.nlines_ ; line++)
-	{
-		for(column = 0 ; column < base_raster_params.ncols_; ++column)
-		{
-/* Retriving the levels from all bands for the current line and column */
-			missing_pixel = false;
-	
-			for(index = 0 ; index < index_bound ; ++index)
-			{
-				if (input_rasters[index]->getElement(column, line, value, bands[index]))
-				{
-					in_values(index, 0) = value;
-				}
-				else
-				{
-					TEAGN_TRUE_OR_RETURN(in_dummy_use_vector[index], "Raster read error");
-					missing_pixel = true;
-					break;
-				}
-			}
-	
-			if (missing_pixel)
-			{
-				for(index = 0 ; index < index_bound; ++index)
-				{
-					TEAGN_TRUE_OR_RETURN(output_rasters[index]->setElement(column, line, out_dummy_vector[index], 0), "Unable to set raster element - raster index " + Te2String(index));
-				}
-			}
-			else
-			{
-				intermediary_values = eigenvectors * in_values;
-/* Remapping levels */
-				for(index = 0; index < index_bound; ++index)
-				{
-					value = intermediary_values(index, 0);
-/* Level range filtering */
-// 					if (value < channel_min_level)
-// 					{
-// 						value = channel_min_level;
-// 					}
-// 					else if(value > channel_max_level)
-// 					{
-// 						value = channel_max_level;
-// 					}
-
-					TEAGN_TRUE_OR_RETURN(output_rasters[index]->setElement(column, line, value, 0), "Unable to set raster element - raster index " + Te2String(index));
-				}
-			}
-		}
-		progress.Increment();
-	}
-	progress.Toggle(false);
-
-	return true;
-}
-
-bool TePDIPrincipalComponents::RunImplementation_inverse()
-{
-	TePDITypes::TePDIRasterVectorType input_rasters;
-	params_.GetParameter("input_rasters", input_rasters);
-	
-	TePDITypes::TePDIRasterVectorType output_rasters;
-	params_.GetParameter("output_rasters", output_rasters);
-	
-	std::vector<int> bands;
-	params_.GetParameter("bands", bands);
-
-	TeSharedPtr<TeMatrix> covariance_matrix;
-	params_.GetParameter("covariance_matrix", covariance_matrix);
-	
-	TeRasterParams base_raster_params = input_rasters[0]->params();
-	
-/* Setting the output rasters */
-	
-	for(unsigned int outrasterindex = 0; outrasterindex < output_rasters.size(); ++outrasterindex)
-	{
-		TeRasterParams outRaster_params = output_rasters[outrasterindex]->params();
-		outRaster_params.nBands(1);
-		if (base_raster_params.projection() != 0)
-		{
-			TeSharedPtr<TeProjection> proj(TeProjectionFactory::make(base_raster_params.projection()->params())); 
-			outRaster_params.projection(proj.nakedPointer());
-		}
-		outRaster_params.boxResolution(base_raster_params.box().x1(), base_raster_params.box().y1(), base_raster_params.box().x2(), base_raster_params.box().y2(), base_raster_params.resx_, base_raster_params.resy_);
-		outRaster_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
-		outRaster_params.setDataType(TeDOUBLE, -1);
-	
-		TEAGN_TRUE_OR_RETURN(output_rasters[outrasterindex]->init(outRaster_params), "Raster reset error - Raster index " + Te2String(outrasterindex));
-	}
-	
-/* Finding the mininum and maximum allowed pixel values */
-	
-	double channel_min_level = 0;
-	double channel_max_level = 0;
-	
-	TEAGN_TRUE_OR_RETURN(TePDIUtils::TeGetRasterMinMaxBounds(input_rasters[0], bands[0], channel_min_level, channel_max_level), "Unable to get raster channel level bounds");
-	
-/* Initializing statistic module */
-	
-	TeMatrix eigenvaluesmatrix;
-	TEAGN_TRUE_OR_RETURN(covariance_matrix->EigenValues(eigenvaluesmatrix), "Unable to build eigenvalue matrix");
-	
-/* Building eigenvectors matrix from all used bands (lines == columns) */
-
-	TeMatrix eigenvectors;
-	TEAGN_TRUE_OR_RETURN(covariance_matrix->EigenVectors(eigenvectors), "Unable to build eigenvectors matrix");
-	
-/* Building auxiliary vectors for optimization */
-
-	std::vector< bool > in_dummy_use_vector;
-	for (unsigned int in_dummy_use_vector_index = 0; in_dummy_use_vector_index < input_rasters.size(); ++in_dummy_use_vector_index)
-	{
-		in_dummy_use_vector.push_back(input_rasters[in_dummy_use_vector_index]->params().useDummy_);
-	}
-
-	std::vector< double > out_dummy_vector;
-	for (unsigned int out_dummy_vector_index = 0; out_dummy_vector_index < output_rasters.size(); ++out_dummy_vector_index)
-	{
-		if (output_rasters[out_dummy_vector_index]->params().useDummy_)
-		{
-			out_dummy_vector.push_back(output_rasters[out_dummy_vector_index]->params().dummy_[0]);
-		}
-		else
-		{
-			out_dummy_vector.push_back(0.0);
-		}
-	}
-	
-/* Do level remapping based on each matrix above */
-	TeMatrix in_values; /* input levels */
-	in_values.Init(bands.size(), 1, 0.0);
-	
-	TeMatrix intermediary_values;
-	intermediary_values.Init(bands.size(), 1, 0.0);
-	
-	int line;
-	int column;
-	unsigned int index;
-	unsigned int index_bound = bands.size();
-	double value;
-	bool missing_pixel = false;
-	
-	TePDIPIManager progress("Generating original images", base_raster_params.nlines_, progress_enabled_);
-	for(line = 0 ; line < base_raster_params.nlines_ ; line++)
-	{
-		for(column = 0 ; column < base_raster_params.ncols_; ++column)
-		{
-/* Retriving the levels from all bands for the current line and column */
-			missing_pixel = false;
-			for(index = 0 ; index < index_bound ; ++index)
-			{
-				if (input_rasters[index]->getElement(column, line, value, bands[index]))
-					in_values(index, 0) = value;
-				else
-				{
-					TEAGN_TRUE_OR_RETURN(in_dummy_use_vector[index], "Raster read error");
-					missing_pixel = true;
-					break;
-				}
-			}
-	
-			if (missing_pixel)
-			{
-				for(index = 0 ; index < index_bound; ++index)
-				{
-					TEAGN_TRUE_OR_RETURN(output_rasters[index]->setElement(column, line, out_dummy_vector[index], 0), "Unable to set raster element - raster index " + Te2String(index));
-				}
-			}
-			else
-			{
-				intermediary_values = eigenvectors * in_values;
-/* Remapping levels */
-				for(index = 0; index < index_bound; ++index)
-				{
-					value = intermediary_values(index, 0);
-
-/* Level range filtering */
-					if (value < channel_min_level)
-					{
-						value = channel_min_level;
-					}
-					else if(value > channel_max_level)
-					{
-						value = channel_max_level;
-					}
-					TEAGN_TRUE_OR_RETURN(output_rasters[index]->setElement(column, line, value, 0), "Unable to set raster element - raster index " + Te2String(index));
-				}
-			}
-		}
-		progress.Increment();
-	}
-	progress.Toggle(false);
-
-	return true;
-}
-
-bool TePDIPrincipalComponents::RunImplementation()
-{
-	TePDIPCAType analysis_type;
-	params_.GetParameter("analysis_type", analysis_type);
-
-	if (analysis_type == TePDIPrincipalComponents::TePDIPCADirect)
-		return RunImplementation_direct();
-	else if (analysis_type == TePDIPrincipalComponents::TePDIPCAInverse)
-		return RunImplementation_inverse();
-
-	return true;
-}
-
-
+#include "TePDIPrincipalComponents.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+#include "TePDITypes.hpp"
+#include "TePDIStatistic.hpp"
+
+#include <TeMatrix.h>
+#include <TeUtils.h>
+
+#include <math.h>
+
+
+
+TePDIPrincipalComponents::TePDIPrincipalComponents()
+{
+}
+
+
+TePDIPrincipalComponents::~TePDIPrincipalComponents()
+{
+}
+
+
+void TePDIPrincipalComponents::ResetState(
+  const TePDIParameters&)
+{
+}
+
+
+bool TePDIPrincipalComponents::CheckParameters(
+  const TePDIParameters& parameters) const
+{
+/* Analysis type checking */
+	TePDIPCAType analysis_type;
+
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("analysis_type", 
+	  analysis_type), "Missing parameter: analysis_type");
+	TEAGN_TRUE_OR_RETURN(
+	  ((analysis_type == TePDIPrincipalComponents::TePDIPCADirect) || 
+	  (analysis_type == TePDIPrincipalComponents::TePDIPCAInverse)), 
+	  "Invalid analysis type");
+
+/* Input rasters and bands checking */
+	
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+	TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
+	
+	std::vector<int> bands;
+	
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+	TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), "Invalid parameter: bands number");
+
+	for( unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); ++input_rasters_index )
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
+		TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[ " + Te2String(input_rasters_index) + " ]");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[ 0 ]->params().ncols_, "Invalid parameter: input_raster " + Te2String( input_rasters_index ) + " with imcompatible number of columns" );
+/* Checking photometric interpretation */
+		TEAGN_TRUE_OR_RETURN(((input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeRGB) || (input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeMultiBand)), "Invalid parameter - input_rasters (invalid photometric interpretation)" );
+	}
+
+/* Output rasters checking */
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() == input_rasters.size(), "Invalid parameter: output rasters size");
+
+	for(unsigned int input_rasters_index2 = 0; input_rasters_index2 < input_rasters.size(); ++input_rasters_index2)
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " not ready");
+	}
+	
+	/* Checking covariance_matrix */
+
+	TeSharedPtr<TeMatrix> covariance_matrix;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("covariance_matrix", 
+	  covariance_matrix), "Missing parameter: covariance_matrix");
+
+/* Inverse type checking */
+
+	if (analysis_type == TePDIPrincipalComponents::TePDIPCAInverse)
+		TEAGN_TRUE_OR_RETURN((((unsigned)covariance_matrix->Nrow() == input_rasters.size()) && ((unsigned)covariance_matrix->Ncol() == input_rasters.size())), "Covariance matrix out of rasters bounds");
+		
+	return true;
+}
+
+bool TePDIPrincipalComponents::RunImplementation_direct()
+{
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	params_.GetParameter("input_rasters", input_rasters);
+	
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	params_.GetParameter("output_rasters", output_rasters);
+	
+	std::vector<int> bands;
+	params_.GetParameter("bands", bands);
+
+	TeSharedPtr<TeMatrix> covariance_matrix;
+	params_.GetParameter("covariance_matrix", covariance_matrix);
+	
+	TeRasterParams base_raster_params = input_rasters[0]->params();
+	
+/* Setting the output rasters */
+	
+	for(unsigned int outrasterindex = 0; outrasterindex < output_rasters.size(); ++outrasterindex)
+	{
+		TeRasterParams outRaster_params = 
+      output_rasters[outrasterindex]->params();
+      
+		outRaster_params.nBands(1);
+    
+    outRaster_params.projection(base_raster_params.projection());
+
+		outRaster_params.boundingBoxLinesColumns(
+      base_raster_params.boundingBox().x1(), 
+      base_raster_params.boundingBox().y1(), 
+      base_raster_params.boundingBox().x2(), 
+      base_raster_params.boundingBox().y2(), 
+      base_raster_params.nlines_, 
+      base_raster_params.ncols_);
+      
+		outRaster_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
+	
+		TEAGN_TRUE_OR_RETURN(output_rasters[outrasterindex]->init(
+      outRaster_params), "Raster reset error - Raster index " + 
+      Te2String(outrasterindex));
+	}
+	
+/* Finding the mininum and maximum allowed pixel values */
+	
+	double channel_min_level = 0;
+	double channel_max_level = 0;
+	
+	TEAGN_TRUE_OR_RETURN(TePDIUtils::TeGetRasterMinMaxBounds(
+    output_rasters[0], 0, channel_min_level, channel_max_level), 
+    "Unable to get raster channel level bounds");
+	
+/* Initializing statistic module */
+	
+	TePDIStatistic stat;
+  stat.ToggleProgInt( progress_enabled_ );
+	
+	TePDIParameters stat_pars;
+	stat_pars.SetParameter("rasters", input_rasters);
+	stat_pars.SetParameter("bands", bands);
+	
+	TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+	stat.ToggleProgInt(progress_enabled_);
+
+	
+/* Building covariance matrix from all used bands ( lines == columns ) */
+
+	TeSharedPtr<TeMatrix> x(new TeMatrix);
+	*covariance_matrix = stat.getCovMatrix();
+/* Building eigenvalues matrix from all used bands ( 1 column ) */
+
+	TeMatrix eigenvaluesmatrix;
+	TEAGN_TRUE_OR_RETURN(covariance_matrix->EigenValues(eigenvaluesmatrix), "Unable to build eigenvalue matrix");
+	
+/* Building eigenvectors matrix from all used bands (lines == columns) */
+
+	TeMatrix tempmatrix;
+	TEAGN_TRUE_OR_RETURN(covariance_matrix->EigenVectors(tempmatrix), "Unable to build eigenvectors matrix");
+	TeMatrix eigenvectors;
+	TEAGN_TRUE_OR_RETURN(tempmatrix.Transpose(eigenvectors), "Unable to build eigenvectors matrix");
+	
+/* Building auxiliary vectors for optimization */
+
+	std::vector< bool > in_dummy_use_vector;
+	for (unsigned int in_dummy_use_vector_index = 0; in_dummy_use_vector_index < input_rasters.size(); ++in_dummy_use_vector_index)
+	{
+		in_dummy_use_vector.push_back(input_rasters[in_dummy_use_vector_index]->params().useDummy_);
+	}
+
+	std::vector< double > out_dummy_vector;
+	for (unsigned int out_dummy_vector_index = 0; out_dummy_vector_index < output_rasters.size(); ++out_dummy_vector_index)
+	{
+		if (output_rasters[out_dummy_vector_index]->params().useDummy_)
+		{
+			out_dummy_vector.push_back(output_rasters[out_dummy_vector_index]->params().dummy_[0]);
+		}
+		else
+		{
+			out_dummy_vector.push_back(0.0);
+		}
+	}
+	
+/* Do level remapping based on each matrix above */
+	TeMatrix in_values; /* input levels */
+	in_values.Init(bands.size(), 1, 0.0);
+	
+	TeMatrix intermediary_values;
+	intermediary_values.Init(bands.size(), 1, 0.0);
+	
+	int line;
+	int column;
+	unsigned int index;
+	unsigned int index_bound = bands.size();
+	double value;
+	bool missing_pixel = false;
+
+	TePDIPIManager progress("Generating principal components", 
+    base_raster_params.nlines_, progress_enabled_);
+	for(line = 0 ; line < base_raster_params.nlines_ ; line++)
+	{
+		for(column = 0 ; column < base_raster_params.ncols_; ++column)
+		{
+/* Retriving the levels from all bands for the current line and column */
+			missing_pixel = false;
+	
+			for(index = 0 ; index < index_bound ; ++index)
+			{
+				if (input_rasters[index]->getElement(column, line, value, bands[index]))
+				{
+					in_values(index, 0) = value;
+				}
+				else
+				{
+					TEAGN_TRUE_OR_RETURN(in_dummy_use_vector[index], "Raster read error");
+					missing_pixel = true;
+					break;
+				}
+			}
+	
+			if (missing_pixel)
+			{
+				for(index = 0 ; index < index_bound; ++index)
+				{
+					TEAGN_TRUE_OR_RETURN(output_rasters[index]->setElement(column, line, out_dummy_vector[index], 0), "Unable to set raster element - raster index " + Te2String(index));
+				}
+			}
+			else
+			{
+				intermediary_values = eigenvectors * in_values;
+        
+        /* Remapping levels */
+				for(index = 0; index < index_bound; ++index)
+				{
+					value = intermediary_values(index, 0);
+          
+          /* Level range filtering */
+ 					if (value < channel_min_level)
+ 					{
+ 						value = channel_min_level;
+ 					}
+ 					if(value > channel_max_level)
+ 					{
+ 						value = channel_max_level;
+ 					}
+
+					TEAGN_TRUE_OR_RETURN(output_rasters[index]->setElement(column, line, value, 0), "Unable to set raster element - raster index " + Te2String(index));
+				}
+			}
+		}
+		progress.Increment();
+	}
+	progress.Toggle(false);
+
+	return true;
+}
+
+bool TePDIPrincipalComponents::RunImplementation_inverse()
+{
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	params_.GetParameter("input_rasters", input_rasters);
+	
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	params_.GetParameter("output_rasters", output_rasters);
+	
+	std::vector<int> bands;
+	params_.GetParameter("bands", bands);
+
+	TeSharedPtr<TeMatrix> covariance_matrix;
+	params_.GetParameter("covariance_matrix", covariance_matrix);
+	
+	TeRasterParams base_raster_params = input_rasters[0]->params();
+	
+/* Setting the output rasters */
+	
+	for(unsigned int outrasterindex = 0; outrasterindex < output_rasters.size(); ++outrasterindex)
+	{
+		TeRasterParams outRaster_params = 
+      output_rasters[outrasterindex]->params();
+      
+		outRaster_params.nBands(1);
+    
+    outRaster_params.projection(base_raster_params.projection());
+
+		outRaster_params.boundingBoxLinesColumns(
+      base_raster_params.boundingBox().x1(), 
+      base_raster_params.boundingBox().y1(), 
+      base_raster_params.boundingBox().x2(), 
+      base_raster_params.boundingBox().y2(), 
+      base_raster_params.nlines_, 
+      base_raster_params.ncols_);
+      
+		outRaster_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
+	
+		TEAGN_TRUE_OR_RETURN(output_rasters[outrasterindex]->init(
+      outRaster_params), "Raster reset error - Raster index " + 
+      Te2String(outrasterindex));
+	}
+	
+/* Finding the mininum and maximum allowed pixel values */
+	
+	double channel_min_level = 0;
+	double channel_max_level = 0;
+	
+	TEAGN_TRUE_OR_RETURN(TePDIUtils::TeGetRasterMinMaxBounds(
+    output_rasters[0], 0, channel_min_level, channel_max_level), 
+    "Unable to get raster channel level bounds");
+	
+/* Initializing statistic module */
+	
+	TeMatrix eigenvaluesmatrix;
+	TEAGN_TRUE_OR_RETURN(covariance_matrix->EigenValues(eigenvaluesmatrix), "Unable to build eigenvalue matrix");
+	
+/* Building eigenvectors matrix from all used bands (lines == columns) */
+
+	TeMatrix eigenvectors;
+	TEAGN_TRUE_OR_RETURN(covariance_matrix->EigenVectors(eigenvectors), "Unable to build eigenvectors matrix");
+	
+/* Building auxiliary vectors for optimization */
+
+	std::vector< bool > in_dummy_use_vector;
+	for (unsigned int in_dummy_use_vector_index = 0; in_dummy_use_vector_index < input_rasters.size(); ++in_dummy_use_vector_index)
+	{
+		in_dummy_use_vector.push_back(input_rasters[in_dummy_use_vector_index]->params().useDummy_);
+	}
+
+	std::vector< double > out_dummy_vector;
+	for (unsigned int out_dummy_vector_index = 0; out_dummy_vector_index < output_rasters.size(); ++out_dummy_vector_index)
+	{
+		if (output_rasters[out_dummy_vector_index]->params().useDummy_)
+		{
+			out_dummy_vector.push_back(output_rasters[out_dummy_vector_index]->params().dummy_[0]);
+		}
+		else
+		{
+			out_dummy_vector.push_back(0.0);
+		}
+	}
+	
+/* Do level remapping based on each matrix above */
+	TeMatrix in_values; /* input levels */
+	in_values.Init(bands.size(), 1, 0.0);
+	
+	TeMatrix intermediary_values;
+	intermediary_values.Init(bands.size(), 1, 0.0);
+	
+	int line;
+	int column;
+	unsigned int index;
+	unsigned int index_bound = bands.size();
+	double value;
+	bool missing_pixel = false;
+	
+	TePDIPIManager progress("Generating original images", base_raster_params.nlines_, progress_enabled_);
+	for(line = 0 ; line < base_raster_params.nlines_ ; line++)
+	{
+		for(column = 0 ; column < base_raster_params.ncols_; ++column)
+		{
+/* Retriving the levels from all bands for the current line and column */
+			missing_pixel = false;
+			for(index = 0 ; index < index_bound ; ++index)
+			{
+				if (input_rasters[index]->getElement(column, line, value, bands[index]))
+					in_values(index, 0) = value;
+				else
+				{
+					TEAGN_TRUE_OR_RETURN(in_dummy_use_vector[index], "Raster read error");
+					missing_pixel = true;
+					break;
+				}
+			}
+	
+			if (missing_pixel)
+			{
+				for(index = 0 ; index < index_bound; ++index)
+				{
+					TEAGN_TRUE_OR_RETURN(output_rasters[index]->setElement(column, line, out_dummy_vector[index], 0), "Unable to set raster element - raster index " + Te2String(index));
+				}
+			}
+			else
+			{
+				intermediary_values = eigenvectors * in_values;
+        /* Remapping levels */
+				for(index = 0; index < index_bound; ++index)
+				{
+					value = intermediary_values(index, 0);
+
+          /* Level range filtering */
+					if (value < channel_min_level)
+					{
+						value = channel_min_level;
+					}
+					if(value > channel_max_level)
+					{
+						value = channel_max_level;
+					}
+					TEAGN_TRUE_OR_RETURN(output_rasters[index]->setElement(column, line, value, 0), "Unable to set raster element - raster index " + Te2String(index));
+				}
+			}
+		}
+		progress.Increment();
+	}
+	progress.Toggle(false);
+
+	return true;
+}
+
+bool TePDIPrincipalComponents::RunImplementation()
+{
+	TePDIPCAType analysis_type;
+	params_.GetParameter("analysis_type", analysis_type);
+
+	if (analysis_type == TePDIPrincipalComponents::TePDIPCADirect)
+		return RunImplementation_direct();
+	else if (analysis_type == TePDIPrincipalComponents::TePDIPCAInverse)
+		return RunImplementation_inverse();
+
+	return true;
+}
+
+
diff --git a/src/terralib/image_processing/TePDIPrincipalComponents.hpp b/src/terralib/image_processing/TePDIPrincipalComponents.hpp
old mode 100755
new mode 100644
index fdbd8f0..a9fcea6
--- a/src/terralib/image_processing/TePDIPrincipalComponents.hpp
+++ b/src/terralib/image_processing/TePDIPrincipalComponents.hpp
@@ -1,114 +1,114 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIPRINCIPALCOMPONENTS_HPP
-  #define TEPDIPRINCIPALCOMPONENTS_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for principal components generation.
-   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-   * @ingroup TePDIGeneralAlgoGroup
-   *
-   * @note The required parameters are:
-   *
-   * @param analysis_type ( TePDIPrincipalComponents::TePDIPCAType )
-   * @param input_rasters ( TePDITypes::TePDIRasterVectorType )
-   * @param output_rasters ( TePDITypes::TePDIRasterVectorType )
-   * @param bands ( std::vector< int > ) - The bands from each input raster.
-   * @param covariance_matrix ( TeSharedPtr<TeMatrix> ) - This
-   * is the output covariance matrix generated when TePDIPCADirect
-   * is used, or, this is the input covariance matrix when
-   * TePDIPCAInverse is used.
-   *
-   */
-  class PDI_DLL TePDIPrincipalComponents : public TePDIAlgorithm {
-    public :
-      /** @enum TePDIPCAType Direction of the PCA analisys */
-      enum TePDIPCAType
-      {
-        TePDIPCADirect, 
-        TePDIPCAInverse
-      };
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIPrincipalComponents();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIPrincipalComponents();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-      
-    protected :
-      
-      /**
-       * @brief Decide the direction of the analysis based on the analysis_type parameter.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Runs the direct algorithm.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation_direct();
-
-      /**
-       * @brief Runs the inverse algorithm.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation_inverse();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-  };
-  
-/** @example TePDIPrincipalComponents_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDIPRINCIPALCOMPONENTS_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPRINCIPALCOMPONENTS_HPP
+  #define TEPDIPRINCIPALCOMPONENTS_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the class for principal components generation.
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @ingroup TePDIGeneralAlgoGroup
+   *
+   * @note The required parameters are:
+   *
+   * @param analysis_type ( TePDIPrincipalComponents::TePDIPCAType )
+   * @param input_rasters ( TePDITypes::TePDIRasterVectorType )
+   * @param output_rasters ( TePDITypes::TePDIRasterVectorType )
+   * @param bands ( std::vector< int > ) - The bands from each input raster.
+   * @param covariance_matrix ( TeSharedPtr<TeMatrix> ) - This
+   * is the output covariance matrix generated when TePDIPCADirect
+   * is used, or, this is the input covariance matrix when
+   * TePDIPCAInverse is used.
+   *
+   */
+  class PDI_DLL TePDIPrincipalComponents : public TePDIAlgorithm {
+    public :
+      /** @enum TePDIPCAType Direction of the PCA analisys */
+      enum TePDIPCAType
+      {
+        TePDIPCADirect, 
+        TePDIPCAInverse
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIPrincipalComponents();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIPrincipalComponents();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+      
+    protected :
+      
+      /**
+       * @brief Decide the direction of the analysis based on the analysis_type parameter.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Runs the direct algorithm.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation_direct();
+
+      /**
+       * @brief Runs the inverse algorithm.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation_inverse();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+  };
+  
+/** @example TePDIPrincipalComponents_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDIPRINCIPALCOMPONENTS_HPP
diff --git a/src/terralib/image_processing/TePDIPrincipalComponentsFactory.cpp b/src/terralib/image_processing/TePDIPrincipalComponentsFactory.cpp
old mode 100755
new mode 100644
index cc26646..2c8cbe5
--- a/src/terralib/image_processing/TePDIPrincipalComponentsFactory.cpp
+++ b/src/terralib/image_processing/TePDIPrincipalComponentsFactory.cpp
@@ -1,24 +1,24 @@
- 
-#include "TePDIPrincipalComponentsFactory.hpp"
-#include "TePDIPrincipalComponents.hpp"
-#include <TeAgnostic.h>
-
-TePDIPrincipalComponentsFactory::TePDIPrincipalComponentsFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIPrincipalComponents" ) )
-{
-};      
-
-TePDIPrincipalComponentsFactory::~TePDIPrincipalComponentsFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIPrincipalComponentsFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIPrincipalComponents();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIPrincipalComponentsFactory.hpp"
+#include "TePDIPrincipalComponents.hpp"
+#include <TeAgnostic.h>
+
+TePDIPrincipalComponentsFactory::TePDIPrincipalComponentsFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIPrincipalComponents" ) )
+{
+};      
+
+TePDIPrincipalComponentsFactory::~TePDIPrincipalComponentsFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIPrincipalComponentsFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIPrincipalComponents();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIPrincipalComponentsFactory.hpp b/src/terralib/image_processing/TePDIPrincipalComponentsFactory.hpp
old mode 100755
new mode 100644
index a2fb165..10802fd
--- a/src/terralib/image_processing/TePDIPrincipalComponentsFactory.hpp
+++ b/src/terralib/image_processing/TePDIPrincipalComponentsFactory.hpp
@@ -1,68 +1,68 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIPRINCIPALCOMPONENTSFACTORY_HPP
-  #define TEPDIPRINCIPALCOMPONENTSFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for principal components algorithm factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIPrincipalComponentsFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIPrincipalComponentsFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIPrincipalComponentsFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-  
-  namespace {
-    static TePDIPrincipalComponentsFactory 
-      TePDIPrincipalComponentsFactory_instance;
-  };  
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPRINCIPALCOMPONENTSFACTORY_HPP
+  #define TEPDIPRINCIPALCOMPONENTSFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for principal components algorithm factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIPrincipalComponentsFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIPrincipalComponentsFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIPrincipalComponentsFactory();
+      
+      protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+  
+  namespace {
+    static TePDIPrincipalComponentsFactory 
+      TePDIPrincipalComponentsFactory_instance;
+  };  
+
+#endif
diff --git a/src/terralib/image_processing/TePDIPrincipalComponentsFusion.cpp b/src/terralib/image_processing/TePDIPrincipalComponentsFusion.cpp
index ca803e8..087939f 100644
--- a/src/terralib/image_processing/TePDIPrincipalComponentsFusion.cpp
+++ b/src/terralib/image_processing/TePDIPrincipalComponentsFusion.cpp
@@ -1,241 +1,264 @@
-#include "TePDIPrincipalComponentsFusion.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-#include "TePDITypes.hpp"
-#include "TePDIStatistic.hpp"
-#include "TePDIPrincipalComponents.hpp"
-#include "TeRasterRemap.h"
-#include <TeMatrix.h>
-#include <TeUtils.h>
-#include <math.h>
-
-TePDIPrincipalComponentsFusion::TePDIPrincipalComponentsFusion()
-{
-}
-
-TePDIPrincipalComponentsFusion::~TePDIPrincipalComponentsFusion()
-{
-}
-
-void TePDIPrincipalComponentsFusion::ResetState(const TePDIParameters& /*params*/)
-{
-}
-
-bool TePDIPrincipalComponentsFusion::CheckParameters(const TePDIParameters& parameters) const
-{
-/* Input rasters and bands checking */
-
-	TePDITypes::TePDIRasterVectorType input_rasters;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
-	TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
-	
-	std::vector<int> bands;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
-	TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), "Invalid parameter: bands number");
-
-	for( unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); ++input_rasters_index )
-	{
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
-		TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[" + Te2String(input_rasters_index) + "]");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String( input_rasters_index ) + " with imcompatible number of columns" );
-		TEAGN_TRUE_OR_RETURN(((input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeRGB) || (input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeMultiBand)), "Invalid parameter - input_rasters (invalid photometric interpretation)");
-	}
-
-/* Reference raster checking */
-
-	int reference_raster_band;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
-
-	TePDITypes::TePDIRasterPtrType reference_raster;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
-	TEAGN_TRUE_OR_RETURN(((reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeRGB ) || (reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeMultiBand)), "Invalid parameter - reference_raster (invalid photometric interpretation)");
-
-	TEAGN_TRUE_OR_RETURN(reference_raster_band < reference_raster->nBands(), "Invalid parameter - reference_raster_band");
-
-/* Output rasters checking */
-
-	TePDITypes::TePDIRasterVectorType output_rasters;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
-	TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
-	TEAGN_TRUE_OR_RETURN(output_rasters.size() == input_rasters.size(), "Invalid parameter: output rasters size");
-
-	for(unsigned int input_rasters_index2 = 0; input_rasters_index2 < input_rasters.size(); ++input_rasters_index2)
-	{
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " inactive");
-		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " not ready");
-	}
-
-	InterpMethod resampling_type;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
-
-	bool fit_histogram;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
-
-	return true;
-}
-
-bool TePDIPrincipalComponentsFusion::RunImplementation()
-{
-/* Getting parameters */
-
-	TePDITypes::TePDIRasterVectorType input_rasters;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
-
-	std::vector<int> bands_direct;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("bands", bands_direct), "Missing parameter: bands");
-
-	TePDITypes::TePDIRasterVectorType output_rasters;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
-
-	TePDITypes::TePDIRasterPtrType reference_raster;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
-
-	int reference_raster_band;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
-
-	InterpMethod resampling_type;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
-
-	bool fit_histogram;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
-
-/* Resampling the input raster */
-
-	TeRasterParams resampled_input_rasters_params = input_rasters[0]->params();
-	if (reference_raster->projection() != 0)
-		resampled_input_rasters_params.projection(reference_raster->projection());
-	resampled_input_rasters_params.boxResolution(reference_raster->params().box().x1(), reference_raster->params().box().y1(), reference_raster->params().box().x2(), reference_raster->params().box().y2(), reference_raster->params().resx_, reference_raster->params().resy_);
-  
-	TePDITypes::TePDIRasterVectorType resampled_input_rasters;
-	for(unsigned int b = 0; b < input_rasters.size(); b++)
-	{
-		if (resampling_type != NothingMethod)
-		{
-		  TePDIInterpolator::InterpMethod int_method = 
-		    TePDIInterpolator::NNMethod;
-		  switch( resampling_type )
-		  {
-		    case NNMethod :
-		      int_method = TePDIInterpolator::NNMethod;
-		      break;
-		    case BilinearMethod :
-		      int_method = TePDIInterpolator::BilinearMethod;
-		      break;
-		    case BicubicMethod :
-		      int_method = TePDIInterpolator::BicubicMethod;
-		      break;
-		    default :
-		      TEAGN_LOG_AND_THROW( "Invalid resapling method" );
-		      break;
-		  }
-		  		
-			TePDITypes::TePDIRasterPtrType resampled_input_rasters_temp;
-			TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(resampled_input_rasters_temp,  resampled_input_rasters_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create the resampled input rasters");
-			TEAGN_TRUE_OR_RETURN( TePDIUtils::resampleRasterByLinsCols(input_rasters[b], 
-			  resampled_input_rasters_temp, 
-			  (unsigned int)reference_raster->params().nlines_, 
-			  (unsigned int)reference_raster->params().ncols_, 
-			  progress_enabled_,
-			  int_method), "Raster resample error" );
-			resampled_input_rasters.push_back(resampled_input_rasters_temp);
-		}
-		else
-			resampled_input_rasters.push_back(input_rasters[b]);
-	}
-
-/* PCA Direct analysis */
-
-	TePDITypes::TePDIRasterVectorType output_rasters_direct;
-	for (unsigned b = 0; b < output_rasters.size(); b++)
-	{
-		TePDITypes::TePDIRasterPtrType outRaster_direct;
-		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(outRaster_direct, 1, 1, 1, false, TeDOUBLE, 0), "RAM Raster " + Te2String(b) + " Alloc error");
-		output_rasters_direct.push_back(outRaster_direct);
-	}
-
-	TeSharedPtr<TeMatrix> covariance_matrix(new TeMatrix);
-	
-	TePDIPrincipalComponents::TePDIPCAType analysis_type = 
-	  TePDIPrincipalComponents::TePDIPCADirect;
-
-	TePDIParameters params_direct;
-
-	params_direct.SetParameter("analysis_type", analysis_type);
-	params_direct.SetParameter("input_rasters", resampled_input_rasters);
-	params_direct.SetParameter("bands", bands_direct);
-	params_direct.SetParameter("output_rasters", output_rasters_direct);
-	params_direct.SetParameter("covariance_matrix", covariance_matrix);
-	
-	TePDIPrincipalComponents pc_direct;
-	TEAGN_TRUE_OR_THROW(pc_direct.Reset(params_direct), "Invalid Parameters");
-	pc_direct.ToggleProgInt(progress_enabled_);
-	TEAGN_TRUE_OR_THROW(pc_direct.Apply(), "Apply error");
-
-/* Computing statistics to fit the histograms */
-	
-	double	pixel,
-		gain = 1.0,
-		offset = 0.0;
-
-	if (fit_histogram)
-	{
-		TePDIStatistic stat;
-		
-		TePDIParameters stat_pars;
-		TePDITypes::TePDIRasterVectorType stat_rasters;
-		stat_rasters.push_back(output_rasters_direct[0]);
-		stat_rasters.push_back(reference_raster);
-		stat_pars.SetParameter("rasters", stat_rasters);
-		std::vector<int> stat_bands;
-		stat_bands.push_back(0);
-		stat_bands.push_back(reference_raster_band);
-		stat_pars.SetParameter("bands", stat_bands);
-		
-		TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
-		stat.ToggleProgInt(false);
-	
-		TeMatrix	std_matrix = stat.getStdDevMatrix(),
-				mean_matrix = stat.getMeanMatrix();
-	
-/* Swapping reference raster by first principal component */
-
-		gain = std_matrix(0, 0) / std_matrix(1, 0);
-		offset = mean_matrix(0, 0) - (gain * mean_matrix(0, 1));
-	}
-
-	TePDIPIManager progress("Swapping PCA 1 by reference raster", reference_raster->params().ncols_, progress_enabled_);
-	for (int j = 0; j < reference_raster->params().nlines_; j++)
-	{
-		for (int i = 0; i < reference_raster->params().ncols_; i++)
-		{
-			if (reference_raster->getElement(i, j, pixel, reference_raster_band))
-				output_rasters_direct[0]->setElement(i, j, gain*pixel+offset, 0);
-		}
-		progress.Increment();
-	}
-	progress.Toggle(false);
-
-/* Inverse analysis */
-
-	analysis_type = TePDIPrincipalComponents::TePDIPCAInverse;
-	
-	TePDIParameters params_inverse;
-
-	std::vector< int > bands_inverse(output_rasters.size(), 0);
-
-	params_inverse.SetParameter("analysis_type", analysis_type);
-	params_inverse.SetParameter("input_rasters", output_rasters_direct);
-	params_inverse.SetParameter("bands", bands_inverse);
-	params_inverse.SetParameter("output_rasters", output_rasters);
-	params_inverse.SetParameter("covariance_matrix", covariance_matrix);
-	
-	TePDIPrincipalComponents pc_inverse;
-	TEAGN_TRUE_OR_THROW(pc_inverse.Reset(params_inverse), "Invalid Parameters");
-	pc_inverse.ToggleProgInt(progress_enabled_);
-	TEAGN_TRUE_OR_THROW(pc_inverse.Apply(), "Apply error");
-
-	return true;
-}
+#include "TePDIPrincipalComponentsFusion.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+#include "TePDITypes.hpp"
+#include "TePDIStatistic.hpp"
+#include "TePDIPrincipalComponents.hpp"
+#include "TeRasterRemap.h"
+#include <TeMatrix.h>
+#include <TeUtils.h>
+#include <math.h>
+
+TePDIPrincipalComponentsFusion::TePDIPrincipalComponentsFusion()
+{
+}
+
+TePDIPrincipalComponentsFusion::~TePDIPrincipalComponentsFusion()
+{
+}
+
+void TePDIPrincipalComponentsFusion::ResetState(const TePDIParameters& /*params*/)
+{
+}
+
+bool TePDIPrincipalComponentsFusion::CheckParameters(const TePDIParameters& parameters) const
+{
+/* Input rasters and bands checking */
+
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+	TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
+	
+	std::vector<int> bands;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+	TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), "Invalid parameter: bands number");
+
+	for( unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); ++input_rasters_index )
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
+		TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[" + Te2String(input_rasters_index) + "]");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String( input_rasters_index ) + " with imcompatible number of columns" );
+		TEAGN_TRUE_OR_RETURN(((input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeRGB) || (input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeMultiBand)), "Invalid parameter - input_rasters (invalid photometric interpretation)");
+	}
+
+/* Reference raster checking */
+
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+	TEAGN_TRUE_OR_RETURN(((reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeRGB ) || (reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeMultiBand)), "Invalid parameter - reference_raster (invalid photometric interpretation)");
+
+	TEAGN_TRUE_OR_RETURN(reference_raster_band < reference_raster->nBands(), "Invalid parameter - reference_raster_band");
+
+/* Output rasters checking */
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() == input_rasters.size(), "Invalid parameter: output rasters size");
+
+	for(unsigned int input_rasters_index2 = 0; input_rasters_index2 < input_rasters.size(); ++input_rasters_index2)
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index2]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index2) + " not ready");
+	}
+
+	TePDIInterpolator::InterpMethod resampling_type;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("resampling_type", 
+     resampling_type), "Missing parameter: resampling_type");
+
+	bool fit_histogram;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
+
+	return true;
+}
+
+bool TePDIPrincipalComponentsFusion::RunImplementation()
+{
+/* Getting parameters */
+
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+
+	std::vector<int> bands;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("bands", bands), 
+    "Missing parameter: bands");
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+
+	TePDIInterpolator::InterpMethod resampling_type;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
+
+	bool fit_histogram;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
+
+  /* Resampling the input rasters */
+  
+  TePDITypes::TePDIRasterVectorType resampled_input_rasters;
+  std::vector< int > resampled_input_rasters_bands;
+  
+  {
+    for(unsigned int b = 0; b < input_rasters.size(); b++)
+    {
+      TeRasterParams resampled_input_rasters_params = 
+        input_rasters[b]->params();
+      resampled_input_rasters_params.setNLinesNColumns( 1, 1 );
+      resampled_input_rasters_params.nBands( 1 );
+        
+      TePDITypes::TePDIRasterPtrType resampled_input_rasters_temp;
+      TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(
+        resampled_input_rasters_temp,  
+        resampled_input_rasters_params, 
+        TePDIUtils::TePDIUtilsAutoMemPol), 
+        "Unable create the resampled input rasters");
+        
+      std::vector< unsigned int > inputResampBands;
+      inputResampBands.push_back( (unsigned int)bands[ b ] );
+      
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::resampleRasterByLinsCols(
+        input_rasters[b], 
+        inputResampBands,
+        (unsigned int)reference_raster->params().nlines_, 
+        (unsigned int)reference_raster->params().ncols_, 
+        progress_enabled_,
+        resampling_type,
+        resampled_input_rasters_temp ), "Raster resample error" );
+        
+      resampled_input_rasters.push_back(resampled_input_rasters_temp);
+      resampled_input_rasters_bands.push_back( 0 );
+/*      
+TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff(
+  resampled_input_rasters[ b ],
+  "TePDIPrincipalComponentsFusion_resamp_" + Te2String( b ) + ".tif" ),
+  "Error generating geotiff" );
+*/  
+    }
+  }
+
+/* PCA Direct analysis */
+
+	TePDITypes::TePDIRasterVectorType output_rasters_direct;
+  TeSharedPtr<TeMatrix> covariance_matrix(new TeMatrix);
+   
+  {
+    for (unsigned b = 0; b < output_rasters.size(); b++)
+    {
+      TePDITypes::TePDIRasterPtrType outRaster_direct;
+      TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
+        outRaster_direct, 1, 1, 1, false, TeDOUBLE, 0), 
+        "RAM Raster " + Te2String(b) + " Alloc error");
+      output_rasters_direct.push_back(outRaster_direct);
+    }
+    
+    TePDIPrincipalComponents::TePDIPCAType analysis_type = 
+      TePDIPrincipalComponents::TePDIPCADirect;
+  
+    TePDIParameters params_direct;
+  
+    params_direct.SetParameter("analysis_type", analysis_type);
+    params_direct.SetParameter("input_rasters", resampled_input_rasters);
+    params_direct.SetParameter("bands", resampled_input_rasters_bands);
+    params_direct.SetParameter("output_rasters", output_rasters_direct);
+    params_direct.SetParameter("covariance_matrix", covariance_matrix);
+    
+    TePDIPrincipalComponents pc_direct;
+    TEAGN_TRUE_OR_THROW(pc_direct.Reset(params_direct), "Invalid Parameters");
+    pc_direct.ToggleProgInt(progress_enabled_);
+    TEAGN_TRUE_OR_THROW(pc_direct.Apply(), "Apply error");
+  } 
+
+  /* Computing statistics to fit the histograms */
+	
+	double	pixel = 0.0,
+		gain = 1.0,
+		offset = 0.0;
+
+	if (fit_histogram)
+	{
+		TePDIStatistic stat;
+		
+		TePDIParameters stat_pars;
+    
+		TePDITypes::TePDIRasterVectorType stat_rasters;
+		stat_rasters.push_back(output_rasters_direct[0]);
+		stat_rasters.push_back(reference_raster);
+		stat_pars.SetParameter("rasters", stat_rasters);
+    
+		std::vector<int> stat_bands;
+		stat_bands.push_back(0);
+		stat_bands.push_back(reference_raster_band);
+		stat_pars.SetParameter("bands", stat_bands);
+		
+		TEAGN_TRUE_OR_RETURN(stat.Reset(stat_pars), "Unable to inialize the statistc module");
+		stat.ToggleProgInt(progress_enabled_);
+	
+    double current_variance = stat.getVariance( 1 );
+    double target_variance = stat.getVariance( 0 );
+    
+    double current_mean = stat.getMean( 1 );
+    double target_mean = stat.getMean( 0 );
+    
+    gain = ( ( current_variance == 0.0 ) ? 1.0 :
+      sqrt( target_variance / current_variance ) );
+    offset = target_mean - ( gain * current_mean ); 
+	}
+  
+  /* Swapping reference raster by first principal component */
+
+  {
+	  TePDIPIManager progress("Swapping PCA 1 by reference raster", 
+     reference_raster->params().nlines_, progress_enabled_);
+     
+    TeRaster& inRasterRef = (*reference_raster);
+    TeRaster& outRasterRef = (*output_rasters_direct[0]);
+    
+    for (int j = 0; j < reference_raster->params().nlines_; j++)
+    {
+      for (int i = 0; i < reference_raster->params().ncols_; i++)
+      {
+        TEAGN_TRUE_OR_RETURN( inRasterRef.getElement(i, j, pixel, 
+          reference_raster_band), "Error reading data" )
+          
+        TEAGN_TRUE_OR_RETURN( outRasterRef.setElement(i, j, 
+          gain*pixel+offset, 0), "Error writing data" );
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" );
+    }
+  } 
+
+/* Inverse analysis */
+
+	TePDIPrincipalComponents::TePDIPCAType analysis_type = 
+    TePDIPrincipalComponents::TePDIPCAInverse;
+	
+	TePDIParameters params_inverse;
+
+	std::vector< int > bands_inverse(output_rasters.size(), 0);
+
+	params_inverse.SetParameter("analysis_type", analysis_type);
+	params_inverse.SetParameter("input_rasters", output_rasters_direct);
+	params_inverse.SetParameter("bands", bands_inverse);
+	params_inverse.SetParameter("output_rasters", output_rasters);
+	params_inverse.SetParameter("covariance_matrix", covariance_matrix);
+	
+	TePDIPrincipalComponents pc_inverse;
+	TEAGN_TRUE_OR_THROW(pc_inverse.Reset(params_inverse), "Invalid Parameters");
+	pc_inverse.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(pc_inverse.Apply(), "Apply error");
+
+	return true;
+}
diff --git a/src/terralib/image_processing/TePDIPrincipalComponentsFusion.hpp b/src/terralib/image_processing/TePDIPrincipalComponentsFusion.hpp
index ac61ab7..5887f45 100644
--- a/src/terralib/image_processing/TePDIPrincipalComponentsFusion.hpp
+++ b/src/terralib/image_processing/TePDIPrincipalComponentsFusion.hpp
@@ -1,107 +1,95 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIPRINCIPALCOMPONENTSFUSION_HPP
-  #define TEPDIPRINCIPALCOMPONENTSFUSION_HPP
-
-  #include "TePDIAlgorithm.hpp"
-
-  /**
-   * @brief This is the class for principal components generation.
-   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-   * @ingroup PDIFusionAlgorithms
-   *
-   * @note The required parameters are:
-   *
-   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Low resolution rasters.
-   * @param bands (std::vector< int >) - The bands from each low resolution raster.
-   * @param output_rasters (TePDITypes::TePDIRasterVectorType) - High resolution fused rasters.
-   * @param reference_raster (TePDITypes::TePDIRasterPtrType) - High resolution raster.
-   * @param reference_raster_band (int) - Reference raster band number.
-   * @param resampling_type (TePDIPrincipalComponentsFusion::InterpMethod) - Resampling type.
-   * @param fit_histogram (bool) - ???
-   * @param output_rasters (TePDITypes::TePDIRasterVectorType) - High resolution fused rasters.
-   *
-   */
-  class PDI_DLL TePDIPrincipalComponentsFusion : public TePDIAlgorithm {
-    public :
-      
-      /**
-       * @enum Allowed resampling methods.
-       */      
-      enum InterpMethod {
-        /** No interpolation performed. */
-        NothingMethod = 0,
-        /** Near neighborhood interpolation method. */
-        NNMethod = 1,
-        /** Bilinear interpolation method. */
-        BilinearMethod = 2,
-        /** Bicubic interpolation method. */
-        BicubicMethod = 3      
-      };      
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIPrincipalComponentsFusion();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIPrincipalComponentsFusion();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-      
-    protected :
-      
-      /**
-       * @brief Decide the direction of the analysis based on the analysis_type parameter.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-  };
-  
-/** @example TePDIFusion_test.cpp
- *    Fusion algorithms test.
- */    
-
-#endif //TEPDIPRINCIPALCOMPONENTS_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPRINCIPALCOMPONENTSFUSION_HPP
+  #define TEPDIPRINCIPALCOMPONENTSFUSION_HPP
+
+  #include "TePDIAlgorithm.hpp"
+
+  /**
+   * @brief This is the class for principal components generation.
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @ingroup PDIFusionAlgorithms
+   *
+   * @note The required parameters are:
+   *
+   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Low resolution rasters.
+   * @param bands (std::vector< int >) - The bands from each low resolution raster.
+   * @param output_rasters (TePDITypes::TePDIRasterVectorType) - High resolution fused rasters.
+   * @param reference_raster (TePDITypes::TePDIRasterPtrType) - High resolution raster.
+   * @param reference_raster_band (int) - Reference raster band number.
+   * @param resampling_type (TePDIInterpolator::InterpMethod) - 
+   * Resampling type.
+   * @param fit_histogram (bool) - Fit the reference histogram to the
+   * low resolution rasters histograms (better collor quality).
+   * @param output_rasters (TePDITypes::TePDIRasterVectorType) - High resolution fused rasters.
+   *
+   */
+  class PDI_DLL TePDIPrincipalComponentsFusion : public TePDIAlgorithm {
+    public :
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIPrincipalComponentsFusion();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIPrincipalComponentsFusion();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+      
+    protected :
+      
+      /**
+       * @brief Decide the direction of the analysis based on the analysis_type parameter.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+  };
+  
+/** @example TePDIFusion_test.cpp
+ *    Fusion algorithms test.
+ */    
+
+#endif //TEPDIPRINCIPALCOMPONENTS_HPP
diff --git a/src/terralib/image_processing/TePDIPrincoMixModelSF.cpp b/src/terralib/image_processing/TePDIPrincoMixModelSF.cpp
old mode 100755
new mode 100644
index 41c744e..bf9d209
--- a/src/terralib/image_processing/TePDIPrincoMixModelSF.cpp
+++ b/src/terralib/image_processing/TePDIPrincoMixModelSF.cpp
@@ -1,21 +1,21 @@
-#include "TePDIPrincoMixModelSF.hpp"
-#include "TePDIPrincoMixModelStrategy.hpp"
-
-TePDIPrincoMixModelSF::TePDIPrincoMixModelSF()
-: TePDIMixModelStratFactory( std::string( "princo" ) )
-{
-};
-
-
-TePDIPrincoMixModelSF::~TePDIPrincoMixModelSF()
-{
-};
-
-
-TePDIMixModelStrategy* TePDIPrincoMixModelSF::build ( const TePDIParameters& )
-{
-  TePDIMixModelStrategy* instance_ptr = new TePDIPrincoMixModelStrategy();
-  
-  return instance_ptr;
-}
-
+#include "TePDIPrincoMixModelSF.hpp"
+#include "TePDIPrincoMixModelStrategy.hpp"
+
+TePDIPrincoMixModelSF::TePDIPrincoMixModelSF()
+: TePDIMixModelStratFactory( std::string( "princo" ) )
+{
+};
+
+
+TePDIPrincoMixModelSF::~TePDIPrincoMixModelSF()
+{
+};
+
+
+TePDIMixModelStrategy* TePDIPrincoMixModelSF::build ( const TePDIParameters& )
+{
+  TePDIMixModelStrategy* instance_ptr = new TePDIPrincoMixModelStrategy();
+  
+  return instance_ptr;
+}
+
diff --git a/src/terralib/image_processing/TePDIPrincoMixModelSF.hpp b/src/terralib/image_processing/TePDIPrincoMixModelSF.hpp
old mode 100755
new mode 100644
index 09428a8..66702a3
--- a/src/terralib/image_processing/TePDIPrincoMixModelSF.hpp
+++ b/src/terralib/image_processing/TePDIPrincoMixModelSF.hpp
@@ -1,59 +1,59 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIPRINCOMIXMODELSF_HPP
-#define TEPDIPRINCOMIXMODELSF_HPP
-
-#include <TeSharedPtr.h>
-#include "TePDIMixModelStratFactory.hpp"
-#include "TePDIParameters.hpp"
-#include "TePDIStrategy.hpp"
-
-/**
-* @brief This is the class for garguet fusion strategy factory.
-* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-* @ingroup PDIStrategiesFactories
-*/
-
-class PDI_DLL TePDIPrincoMixModelSF : public TePDIMixModelStratFactory
-{
-	public:
-/**Default constructor.*/
-		TePDIPrincoMixModelSF();
-/**Default cestructor.*/
-		~TePDIPrincoMixModelSF();
-
-	protected:
-/**
-* Implementation for the abstract TeFactory::build.
-* @param arg A const reference to the parameters used by the
-* algorithm.
-* @return A pointer to the new generated strategy instance.
-*/
-		TePDIMixModelStrategy* build( const TePDIParameters& arg );
-};
-
-namespace{static TePDIPrincoMixModelSF TePDIPrincoMixModelSF_instance;};
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIPRINCOMIXMODELSF_HPP
+#define TEPDIPRINCOMIXMODELSF_HPP
+
+#include <TeSharedPtr.h>
+#include "TePDIMixModelStratFactory.hpp"
+#include "TePDIParameters.hpp"
+#include "TePDIStrategy.hpp"
+
+/**
+* @brief This is the class for garguet fusion strategy factory.
+* @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+* @ingroup PDIStrategiesFactories
+*/
+
+class PDI_DLL TePDIPrincoMixModelSF : public TePDIMixModelStratFactory
+{
+	public:
+/**Default constructor.*/
+		TePDIPrincoMixModelSF();
+/**Default cestructor.*/
+		~TePDIPrincoMixModelSF();
+
+	protected:
+/**
+* Implementation for the abstract TeFactory::build.
+* @param arg A const reference to the parameters used by the
+* algorithm.
+* @return A pointer to the new generated strategy instance.
+*/
+		TePDIMixModelStrategy* build( const TePDIParameters& arg );
+};
+
+namespace{static TePDIPrincoMixModelSF TePDIPrincoMixModelSF_instance;};
+
+#endif
diff --git a/src/terralib/image_processing/TePDIPrincoMixModelStrategy.cpp b/src/terralib/image_processing/TePDIPrincoMixModelStrategy.cpp
old mode 100755
new mode 100644
index fdf13a7..bfffba5
--- a/src/terralib/image_processing/TePDIPrincoMixModelStrategy.cpp
+++ b/src/terralib/image_processing/TePDIPrincoMixModelStrategy.cpp
@@ -1,555 +1,588 @@
-#include <TePDIPrincoMixModelStrategy.hpp>
-
-TePDIPrincoMixModelStrategy::TePDIPrincoMixModelStrategy()
-{
-};
-
-TePDIPrincoMixModelStrategy::~TePDIPrincoMixModelStrategy()
-{
-};
-
-bool TePDIPrincoMixModelStrategy::CheckParameters(const TePDIParameters& parameters) const
-{
-// Components e spectralbands checking
-
-  TePDIMixModelComponentList componentList;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("component_list", componentList), "Missing parameter: component_list");
-
-  TePDIMixModelSpectralBandList spectralBandList;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("spectral_band_list", spectralBandList), "Missing parameter: spectral_band_list");
-
-  TEAGN_TRUE_OR_RETURN(componentList.getSize() <= spectralBandList.getSize(), "Invalid parameter: componentsNumber greater than spectralBandsNumber");
-  for (unsigned int nc = 0; nc < componentList.getSize(); nc++)
-    TEAGN_TRUE_OR_RETURN(componentList.getComponentSize(nc) == 
-      (int)spectralBandList.getSize(), 
-      "Invalid parameter: components bands diferred from spectralBandsNumber");
-    
-
-// Input rasters and bands checking
-
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
-  TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
-
-  TEAGN_TRUE_OR_RETURN(input_rasters.size() == spectralBandList.getSize(), "Invalid parameter: input_raster number diferred from spectralBandsNumber");
-
-  std::vector<int> bands;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
-  TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), Te2String(input_rasters.size()) + " Invalid parameter: bands number " + Te2String(bands.size()));
-
-  for (unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); input_rasters_index++)
-  {
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
-    TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[" + Te2String(input_rasters_index) + "]");
-        TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
-    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of columns" );
-  }
- 
-// Output rasters checking
-
-  TePDITypes::TePDIRasterVectorType output_rasters;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
-  TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
-
-// Compute error raster flag checking
-  int computeErrorRasters;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("compute_error_rasters", computeErrorRasters), "Missing parameter: compute error rasters");
-  if (computeErrorRasters)
-  {
-    TePDITypes::TePDIRasterVectorType output_error_rasters;
-    TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_error_rasters", output_error_rasters), "Missing parameter: output_error_rasters");
-    TEAGN_TRUE_OR_RETURN(output_error_rasters.size() > 1, "Invalid output error rasters number");
-  }
-
-// Normalize flag checking
-  int normalize;
-  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("normalize", normalize), "Missing parameter: normalize");
-  TEAGN_TRUE_OR_RETURN((normalize >= 0) && (normalize <= 1) , "Inavlid parameter value: normalize");
-  
-  return true;
-}
-
-int SGaussElimination (TeMatrix& Z, std::vector<int>& line, unsigned int componentsNumber)
-{
-  int     i, j, k,
-              aux;
-  double  auxd, m;
- 
-  int nrows = Z.Nrow();
-
-  // Verify matrix and vector sizes
-  TEAGN_TRUE_OR_RETURN(nrows >= Z.Ncol(), "Matrix not square");
-   TEAGN_TRUE_OR_RETURN( ((int)componentsNumber) >= nrows, "Vector Size");
-
-  // Initialize changed lines indicator
-  for (i = 0; i < nrows; i++)
-          line[i] = i;
-
-  // Diagonalization Process
-  for (k = 0; k < nrows; k++)
-  {
-    i = k;
-    while (Z(i, k) == 0.0)
-    {
-      TEAGN_TRUE_OR_RETURN(i != nrows-1, "Singular Matrix");
-      i++;
-    }
-
-    if (k != i)
-    {
-      // Update changed lines indicator 
-      aux = line[i];
-      line[i] = line[k];              
-      line[k] = aux;
-
-      // Change lines 
-      for (j=0; j < nrows; j ++)
-      {
-        auxd = Z(k,j);
-        Z(k,j) = Z (i, j);  
-        Z (i, j) = auxd;
-      }
-    }
-
-    // Recompute lines i = k + 1,..., componentsNumber - 1 
-    for (i = k + 1; i < nrows; i++)
-    {
-      m = Z(i, k)/Z(k, k);
-      Z(i, k) = m;
-      for (j = k + 1; j < nrows; j++)
-        Z (i, j) = Z (i, j) - m * Z(k,j);
-    }
-
-       } // End of diagonalization process
-
-  TEAGN_TRUE_OR_RETURN(Z(nrows-1, nrows-1) != 0.0, "Singular Matrix");
-
-  return true;
-}
-
-int SFowardBackSubstitution (TeMatrix& Z, std::vector<double>& y, int ys, std::vector<int>& line, int lines, std::vector<double>& x, int xs)
-{
-  int  nrows = Z.Nrow(); 
-
-  // Verify matrix and vector sizes
-  TEAGN_TRUE_OR_RETURN(nrows >= Z.Ncol(), "Matriz not square");
-  TEAGN_TRUE_OR_RETURN(!((lines < nrows) || (ys < nrows) || (xs < nrows)), "Vector Size");
-
-  int k, j;
-  double aux;
-  std::vector<double> F(nrows, 0.0);
-
-  // Foward substuitution 
-  for (k = 0; k < nrows; k++)
-  {
-    aux = 0.;
-    for (j = 0; j <= k - 1; j ++)
-      aux = aux + Z(k,j) * F[j];
-    F[k] = y[line[k]] - aux;
-  }
-
-  // Backward substitution  
-  for (k= nrows - 1; k >= 0; k--)
-  {
-    aux = 0.;
-    for (j = k + 1; j < nrows; j++)
-      aux = aux + Z(k,j) * x[j];
-    x[k] = (F[k] - aux)/Z(k,k);
-  }
-
-  return true;
-} 
-
-bool TePDIPrincoMixModelStrategy::Implementation(const TePDIParameters& params)
-{
-// Check components e spectralbands parameters
-  TePDIMixModelComponentList componentList;
-  TEAGN_TRUE_OR_RETURN(params.GetParameter("component_list", componentList), "Missing parameter: component_list");
-
-  TePDIMixModelSpectralBandList spectralBandList;
-  TEAGN_TRUE_OR_RETURN(params.GetParameter("spectral_band_list", spectralBandList), "Missing parameter: spectral_band_list");
-
-  unsigned int  componentsNumber = componentList.getSize(),
-      spectralBandsNumber = spectralBandList.getSize(),
-      componentsNumberLessOne = componentsNumber - 1;
-
-// Check input_rasters parameter
-  TePDITypes::TePDIRasterVectorType input_rasters;
-  TEAGN_TRUE_OR_RETURN(params.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
-  
-  std::vector<int> bands;
-  TEAGN_TRUE_OR_RETURN(params.GetParameter("bands", bands), 
-    "Missing parameter: bands");
-
-// Check output_rasters parameter
-  TePDITypes::TePDIRasterVectorType output_rasters;
-  TEAGN_TRUE_OR_RETURN(params.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
-
-// Initialize output_rasters based on first input raster
-
-  TeRasterParams base_raster_params = input_rasters[0]->params();
-  base_raster_params.setDataType( TeDOUBLE, -1 );
-  base_raster_params.nBands( 1 );
-  
-  for(unsigned int outrasterindex = 0; outrasterindex < output_rasters.size(); ++outrasterindex )
-    TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
-      output_rasters[outrasterindex], base_raster_params, false ), 
-      "pp_input_raster Alloc error");
-
-// Check compute error raster parameter and outout error rasters if it's necessary
-  int computeErrorRasters;
-  TEAGN_TRUE_OR_RETURN(params.GetParameter("compute_error_rasters", computeErrorRasters), "Missing parameter: compute_error_asters");
-  TePDITypes::TePDIRasterVectorType output_error_rasters;
-  if (computeErrorRasters)
-  {
-    TEAGN_TRUE_OR_RETURN(params.GetParameter("output_error_rasters", output_error_rasters), "Missing parameter: output_error_rasters");
-    for(unsigned int outrasterindex = 0; outrasterindex < output_error_rasters.size(); ++outrasterindex )
-      TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(
-        output_error_rasters[outrasterindex], base_raster_params,
-        false ), "pp_input_raster Alloc error");
-  }
-
-// Check compute average error
-  int computeAverageError;
-  TEAGN_TRUE_OR_RETURN(params.GetParameter("compute_average_error", computeAverageError), "Missing parameter: compute_average_error_");
-  double averageError;
-  if (computeAverageError)
-    TEAGN_TRUE_OR_RETURN(params.GetParameter("average_error", averageError), "Missing parameter: average_error");
-
-// Check normalize
-  int normalize;
-  TEAGN_TRUE_OR_RETURN(params.GetParameter("normalize", normalize), "Missing parameter: normalize");
-
-// Getting number of lines and columns from the first image
-  int rastersLines = base_raster_params.nlines_;
-  int rastersColumns = base_raster_params.ncols_;
-
-// Indexes variables
-  unsigned int  i,
-      j,
-      k,
-      m;
-
-// Buildind the SpectralBandsComponents Matrix base on input componentsList and spectralBandList
-  TeMatrix SpectralBandsComponents;
-  SpectralBandsComponents.Init(spectralBandsNumber, componentsNumber, 0.0);
-  for(i = 0; i < spectralBandsNumber; i++)
-    for (j = 0; j < componentsNumber; j++)
-      SpectralBandsComponents(i, j) = componentList.getPixel(j, i);
-//Printing
-//cout << "SpectralBandsComponents" << endl;
-//SpectralBandsComponents.Print();
-
-//----- Part I : mathematical processing independend on image data -----//
-
-// SpectralBandsComponentsTransposed stores SpectralBandsComponents and other things after
-   TeMatrix SpectralBandsComponentsTransposed;
-// Initializing SpectralBandsComponentsTransposed Matrix
-  TEAGN_TRUE_OR_RETURN(SpectralBandsComponentsTransposed.Init(componentsNumber, spectralBandsNumber, 0.0), "Error initializing SpectralBandsComponentsTransposed Matrix");
-// Initializing SpectralBandsComponentsTransposed Matrix = Transpose of SpectralBandsComponents
-   TEAGN_TRUE_OR_RETURN(SpectralBandsComponents.Transpose(SpectralBandsComponentsTransposed), "Error transposing SpectralBandsComponents to SpectralBandsComponentsTransposed");
-
-//Printing
-//cout << "SpectralBandsComponentsTransposed - After transposing" << endl;
-//SpectralBandsComponentsTransposed.Print();
- 
-// Compute componentsMean vector as the mean coefficient value per band and subtract the componentsMeanAfter from the coefficients matrix
-// Creating two double vectors to store de means of the spectralBands of each component
-   std::vector<double> componentsMean(spectralBandsNumber, 0.0),
-     componentsMeanAfter(spectralBandsNumber, 0.0);
-  for (j = 0; j < spectralBandsNumber; j++)
-  {
-// Compute original mean (componentsMean)
-    componentsMean[j] = 0;
-    for(i = 0; i < componentsNumber; i++)
-      componentsMean[j] = componentsMean[j] + SpectralBandsComponentsTransposed(i,j);
-    componentsMean[j] = componentsMean[j] / (double)componentsNumber;
-
-// Subtract mean from SpectralBandsComponents and compute new matrix mean (componentsMeanAfter)
-    componentsMeanAfter[j] = 0;
-    for(i = 0; i < componentsNumber; i++)
-    {
-      SpectralBandsComponentsTransposed(i,j) = SpectralBandsComponentsTransposed(i,j) - componentsMean[j];
-      componentsMeanAfter[j] = componentsMeanAfter[j] + SpectralBandsComponentsTransposed(i,j);
-    }
-    componentsMeanAfter[j] = componentsMeanAfter[j]/ (double)componentsNumber;
-  }
-
-//Printing
-//cout << "SpectralBandsComponentsTransposed - After less mean" << endl;
-//SpectralBandsComponentsTransposed.Print();
-
-// Compute covarianceVector vector
-  std::vector<double> covarianceVector(spectralBandsNumber*spectralBandsNumber, 0.0);
-  for(k = 0; k < spectralBandsNumber*spectralBandsNumber; k++)
-    covarianceVector[k] = 0;
-   k = 0 ;
-   for(j = 0; j < spectralBandsNumber; j++)
-   {
-     for(m = 0; m < j + 1; m++)
-     {
-       for(i = 0; i < componentsNumber; i++)
-         covarianceVector[k] = covarianceVector[k] + (SpectralBandsComponentsTransposed(i, j) - componentsMeanAfter[j]) * (SpectralBandsComponentsTransposed(i, m) - componentsMeanAfter[m]);
-       covarianceVector[k] = covarianceVector[k]/(double)componentsNumber ;
-       k++;
-     }
-   }
-// Printing
-//  for(k = 0; k < spectralBandsNumber*spectralBandsNumber; k++)
-//  {
-//    cout << covarianceVector[k] << " ";
-//  }
-
-   TeMatrix covarianceMatrix;
-  TEAGN_TRUE_OR_RETURN(covarianceMatrix.Init(spectralBandsNumber, spectralBandsNumber, 0.0), "Error initializing covarianceMatrix");
-
-   k = 0;
-   for (i = 0; i< spectralBandsNumber; i++)
-     for (j = 0; j <= i; j++)
-       covarianceMatrix(i, j) = covarianceVector[k++];
-// Printing
-//cout << "covarianceMatrix" << endl;
-//covarianceMatrix.Print();
-
-// Compute eigenvectors : results aux
-   TeMatrix auxMatrix;
-   TEAGN_TRUE_OR_RETURN(covarianceMatrix.EigenVectors(auxMatrix), "Error in eigenvectors calcule of auxMatrix")
-
-// Printing
-//cout << "auxMatrix - eigenvectors of covarianceMatrix" << endl;
-//auxMatrix.Print();
-
-// Keep only significant eigenvectors (componentsNumber - 1): results eigenreducted
-   TeMatrix eigenreducted;
-   TEAGN_TRUE_OR_RETURN(eigenreducted.Init(spectralBandsNumber, componentsNumberLessOne, 0.0), "Error initializing eigenreducted matrix")
-   for (j = 0; j <  spectralBandsNumber; j++)
-     for (i = 0; i <  componentsNumberLessOne; i++)
-       eigenreducted(j, i) = auxMatrix(j, i);
-
-//Printing
-//cout << "eigenreducted" << endl;
-//eigenreducted.Print();
-
-// Clear auxMatrix for future use
-   auxMatrix.Clear(); 
-
-// Rotate SpectralBandsComponentsTransposed to PCA space;  result SpectralBandsComponentsPCA
-  TeMatrix SpectralBandsComponentsPCA;
-  TEAGN_TRUE_OR_RETURN(SpectralBandsComponentsPCA.Init(SpectralBandsComponentsTransposed.Nrow(), eigenreducted.Ncol()), "Error initializing SpectralBandsComponentsPCA");
- 
-  SpectralBandsComponentsPCA = SpectralBandsComponentsTransposed * eigenreducted;
-
-// Printing
-//cout << "SpectralBandsComponentsPCA - Rotate SpectralBandsComponentsTransposed to PCA space" << endl;
-//SpectralBandsComponentsPCA.Print();
-
-// Clear SpectralBandsComponentsTransposed: it will not be used bellow
-  SpectralBandsComponentsTransposed.Clear();
- 
-// Initialize one more column to SpectralBandsComponentsPCA to incorporate sum restriction to equations; results auxMatrix
-  TEAGN_TRUE_OR_RETURN(auxMatrix.Init(SpectralBandsComponentsPCA.Nrow(), SpectralBandsComponentsPCA.Ncol() + 1), "Error initializing auxMatrix");
- 
-  for (j = 0; j < ((unsigned int)SpectralBandsComponentsPCA.Nrow()); j++)
-  {
-    for (i = 0; i <  ((unsigned int)SpectralBandsComponentsPCA.Ncol() ); i++)
-      auxMatrix(j, i) = SpectralBandsComponentsPCA(j, i);
-    auxMatrix (j, SpectralBandsComponentsPCA.Ncol()) = 1.0;
-  }
-// Printing
-//cout << "Initialize one more column to SpectralBandsComponentsPCA to incorporate sum restriction to equation" << endl;
-//auxMatrix.Print();
-
-// Clear SpectralBandsComponentsPCA for future use
-  SpectralBandsComponentsPCA.Clear(); 
- 
-// Transpose auxMatrix; results SpectralBandsComponentsPCA
-  TEAGN_TRUE_OR_RETURN(auxMatrix.Transpose(SpectralBandsComponentsPCA), "Error transposing auxMatrix to SpectralBandsComponentsPCA");
-
-// Printing
-//cout << "Transpose matrix SpectralBandsComponentsPCA" << endl;
-//SpectralBandsComponentsPCA.Print();
-
-// Clear auxMatrix for future use
-  auxMatrix.Clear();
- 
-// Invert matrix SpectralBandsComponentsPCA; results SpectralBandsComponentsPCA
-  std::vector<int> lines(componentsNumber, 0);
-
-   TEAGN_TRUE_OR_RETURN(SGaussElimination(SpectralBandsComponentsPCA, lines, componentsNumber), "Error in gauss elimination");
-
-// Printing
-//cout << "Invert matrix SpectralBandsComponentsPCA" << endl;
-//SpectralBandsComponentsPCA.Print();
-
-//----- Part II : mathematical processing dependend on image data -----//
- 
-// Initialize matrixes that will help to prepare vector Y
-  TEAGN_TRUE_OR_RETURN(auxMatrix.Init(1, spectralBandsNumber, 0.0), "Error initializing auxMatrix");
- 
-  TeMatrix ymat;
-  TEAGN_TRUE_OR_RETURN(ymat.Init(componentsNumberLessOne, componentsNumberLessOne, 0.0), "Error initializing ymat");
- 
-// Initialize proportion vector X and image dependent values for the linear equations Y  
-  std::vector<double>  x(componentsNumber, 0.0),
-    y(componentsNumber, 0.0);
-  for (i = 0; i < componentsNumber; i++)
-  {
-    x[i] = 0.0;
-    y[i] = 0.0;
-  }
-
-// Initialize current line and column    
-  std::vector<int> colin(spectralBandsNumber, 0);
-  int  colout,
-// Auxiliates the transformation of proportions to [0, 255]
-    prop;
-
-// It's should be class variables
-  std::vector<int> linesIn(spectralBandsNumber, 0),
-    colsIn(spectralBandsNumber, 0);
-
-// It's should be class variables
-  TeMatrix  rasterLinesIn,
-			rasterLinesOut;
-  rasterLinesIn.Init(spectralBandsNumber, rastersColumns, 0.0);
-  rasterLinesOut.Init(componentsNumber, rastersColumns, 0.0);
-  std::vector<double> spectralBandsError(spectralBandsNumber, 0.0);
-
-// Initialization of variables declared above
-  for (i = 0; i < spectralBandsNumber; i++)
-  {
-    colin[i] = 0;
-    linesIn[i] = 0;
-    colsIn[i] = 0;
-    spectralBandsError[i] = 0.0;
-  }
-
-// Start computing proportions for each line lines
-  TePDIPIManager progress( "Computing MixModel proportions", rastersLines,
-    progress_interface_enabled_ );
-
-  for (int linout = 0; linout < rastersLines;  linout++)
-  {
-    // Read input line for each band
-    for (i = 0; i < spectralBandsNumber; i++)
-    {
-      for (j = 0; j < ( (unsigned int)rastersColumns ); j++)
-      {
-        double p;
-        input_rasters[i]->getElement(j, linesIn[i], p, bands[ i ] );
-        rasterLinesIn(i, j) = p;
-      }
-      // Update next line to be read for band i
-      linesIn[i]++;
-
-      // Reinitialize first column for band i
-      colin[i] = colsIn[i];
-    }
-
-    // Compute proportions for each column
-           for (colout = 0; colout < rastersColumns; colout++)
-    {
-      // Prepare y
-      for (i = 0; i < spectralBandsNumber; i++)
-        auxMatrix(0,i) = (double) (rasterLinesIn(i, colin[i]))/255. - componentsMean[i];
- 
-      ymat = auxMatrix * eigenreducted;
-    
-      for (i = 0; i < componentsNumber - 1; i++)
-        y[i] = ymat(0,i);
-      
-      // Compute proportions
-      SFowardBackSubstitution(SpectralBandsComponentsPCA, y, componentsNumber, lines, componentsNumber, x, componentsNumber);
- 
-      // Store proportion in buffers  
-      for (i = 0; i < componentsNumber; i++)
-      {
-        prop = (short) (x[i]*100 + 100);
-        rasterLinesOut(i, colout) = (unsigned char)prop;
-      }
- 
-//----- It's should be a function (ComputeErrors.begin) -----//
-
-      double   aux, error;
-      // Verifify if it is necessary to compute the error
-      if (computeErrorRasters || computeAverageError)
-      {
-        for (i = 0; i < spectralBandsNumber; i++)
-        {
-          // Compute digital value from the proportions
-          aux = 0.0;
-          for (j = 0; j < componentsNumber; j++)
-            aux += x[j] * SpectralBandsComponents(i,j);
-      
-          // Compute error as module of the difference between the original value and aux
-          error = (long)(rasterLinesIn(i, colin[i]))/255.0 - aux;
-          if (error < 0)
-            error = -1 * error;
-          if (computeErrorRasters)
-            rasterLinesIn(i, colout) = error * 255.0;
-          if (computeAverageError)
-            spectralBandsError[i] += error*255.;
-        }
-      }
-
-//----- It's should be a function (ComputeErrors.end) -----//
-      // Update current column number
-      for (i = 0; i < spectralBandsNumber; i++)
-        colin[i]++;
- 
-     } // End of column processing
- 
-    // Write processed line to disk
-    for (i = 0; i < componentsNumber; i++)
-      for (j = 0; j < ((unsigned int)rastersColumns); j++)
-        output_rasters[i]->setElement(j, linout, rasterLinesOut(i, j));
-
-
-//----- It's should be a function (StoreErrorRasters.begin) -----//
-    // Store output error rasters
-    if (computeErrorRasters)
-    {
-      // Write the output error images lines
-      for (i = 0; i < componentsNumber; i++)
-        for (j = 0; j < ((unsigned int)rastersColumns); j++)
-                  output_error_rasters[i]->setElement(j, linout, rasterLinesIn(i, j));
-    }
-//----- It's should be a function (StoreErrorRasters.end) -----//
-
-    progress.Increment();
-  } // End of line processing
-  
-  progress.Toggle( false );
-
-//----- It's should be a function (ComputeAverageError.begin) -----//
-// Verifify if it is necessary to compute the error
-  averageError = 0.0;
-  if (computeAverageError)
-  {
-    // Compute total number of pixels in the output image
-    int numpix = rastersLines*rastersColumns;
-    for (i = 0; i < spectralBandsNumber; i++)
-    {
-      // Compute avarege band error taking accumulated band error 
-      spectralBandsError[i] = spectralBandsError[i]/numpix;
-      // Accumulate avarege error
-      averageError += spectralBandsError[i];
-    }
-    // Compute total error taking the accumulated average error
-    if (!(spectralBandsNumber == 0))
-    {
-      averageError = averageError/spectralBandsNumber;
-    }
-// Printing
-//    cout << endl << averageError << endl;
-  }
-// Printing
-//  for(k = 0; k < spectralBandsNumber; k++)
-//  {
-//    cout << spectralBandsError[k] << " ";
-//  }
-//----- It's should be a function (ComputeAverageError.end) -----//
-
-  return true;
-}
+#include <TePDIPrincoMixModelStrategy.hpp>
+
+TePDIPrincoMixModelStrategy::TePDIPrincoMixModelStrategy()
+{
+};
+
+TePDIPrincoMixModelStrategy::~TePDIPrincoMixModelStrategy()
+{
+};
+
+bool TePDIPrincoMixModelStrategy::CheckParameters(const TePDIParameters& parameters) const
+{
+// Components e spectralbands checking
+
+  TePDIMixModelComponentList componentList;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("component_list", componentList), "Missing parameter: component_list");
+
+  TePDIMixModelSpectralBandList spectralBandList;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("spectral_band_list", spectralBandList), "Missing parameter: spectral_band_list");
+
+  TEAGN_TRUE_OR_RETURN(componentList.getSize() <= spectralBandList.getSize(), "Invalid parameter: componentsNumber greater than spectralBandsNumber");
+  for (unsigned int nc = 0; nc < componentList.getSize(); nc++)
+    TEAGN_TRUE_OR_RETURN(componentList.getComponentSize(nc) == 
+      (int)spectralBandList.getSize(), 
+      "Invalid parameter: components bands diferred from spectralBandsNumber");
+    
+
+// Input rasters and bands checking
+
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+  TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
+
+  TEAGN_TRUE_OR_RETURN(input_rasters.size() == spectralBandList.getSize(), "Invalid parameter: input_raster number diferred from spectralBandsNumber");
+
+  std::vector<int> bands;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+  TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), Te2String(input_rasters.size()) + " Invalid parameter: bands number " + Te2String(bands.size()));
+
+  for (unsigned int input_rasters_index = 0 ; input_rasters_index < input_rasters.size(); input_rasters_index++)
+  {
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
+    TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[" + Te2String(input_rasters_index) + "]");
+        TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
+    TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of columns" );
+  }
+ 
+// Output rasters checking
+
+  TePDITypes::TePDIRasterVectorType output_rasters;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+  TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
+
+// Compute error raster flag checking
+  int computeErrorRasters;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("compute_error_rasters", computeErrorRasters), "Missing parameter: compute error rasters");
+  if (computeErrorRasters)
+  {
+    TePDITypes::TePDIRasterVectorType output_error_rasters;
+    TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_error_rasters", output_error_rasters), "Missing parameter: output_error_rasters");
+    TEAGN_TRUE_OR_RETURN(output_error_rasters.size() > 1, "Invalid output error rasters number");
+  }
+
+// Normalize flag checking
+  int normalize;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("normalize", normalize), "Missing parameter: normalize");
+  TEAGN_TRUE_OR_RETURN((normalize >= 0) && (normalize <= 1) , "Inavlid parameter value: normalize");
+  
+  return true;
+}
+
+int SGaussElimination (TeMatrix& Z, std::vector<int>& line, unsigned int componentsNumber)
+{
+  int     i, j, k,
+              aux;
+  double  auxd, m;
+ 
+  int nrows = Z.Nrow();
+
+  // Verify matrix and vector sizes
+  TEAGN_TRUE_OR_RETURN(nrows >= Z.Ncol(), "Matrix not square");
+   TEAGN_TRUE_OR_RETURN( ((int)componentsNumber) >= nrows, "Vector Size");
+
+  // Initialize changed lines indicator
+  for (i = 0; i < nrows; i++)
+          line[i] = i;
+
+  // Diagonalization Process
+  for (k = 0; k < nrows; k++)
+  {
+    i = k;
+    while (Z(i, k) == 0.0)
+    {
+      TEAGN_TRUE_OR_RETURN(i != nrows-1, "Singular Matrix");
+      i++;
+    }
+
+    if (k != i)
+    {
+      // Update changed lines indicator 
+      aux = line[i];
+      line[i] = line[k];              
+      line[k] = aux;
+
+      // Change lines 
+      for (j=0; j < nrows; j ++)
+      {
+        auxd = Z(k,j);
+        Z(k,j) = Z (i, j);  
+        Z (i, j) = auxd;
+      }
+    }
+
+    // Recompute lines i = k + 1,..., componentsNumber - 1 
+    for (i = k + 1; i < nrows; i++)
+    {
+      m = Z(i, k)/Z(k, k);
+      Z(i, k) = m;
+      for (j = k + 1; j < nrows; j++)
+        Z (i, j) = Z (i, j) - m * Z(k,j);
+    }
+
+       } // End of diagonalization process
+
+  TEAGN_TRUE_OR_RETURN(Z(nrows-1, nrows-1) != 0.0, "Singular Matrix");
+
+  return true;
+}
+
+int SFowardBackSubstitution (TeMatrix& Z, std::vector<double>& y, int ys, std::vector<int>& line, int lines, std::vector<double>& x, int xs)
+{
+  int  nrows = Z.Nrow(); 
+
+  // Verify matrix and vector sizes
+  TEAGN_TRUE_OR_RETURN(nrows >= Z.Ncol(), "Matriz not square");
+  TEAGN_TRUE_OR_RETURN(!((lines < nrows) || (ys < nrows) || (xs < nrows)), "Vector Size");
+
+  int k, j;
+  double aux;
+  std::vector<double> F(nrows, 0.0);
+
+  // Foward substuitution 
+  for (k = 0; k < nrows; k++)
+  {
+    aux = 0.;
+    for (j = 0; j <= k - 1; j ++)
+      aux = aux + Z(k,j) * F[j];
+    F[k] = y[line[k]] - aux;
+  }
+
+  // Backward substitution  
+  for (k= nrows - 1; k >= 0; k--)
+  {
+    aux = 0.;
+    for (j = k + 1; j < nrows; j++)
+      aux = aux + Z(k,j) * x[j];
+    x[k] = (F[k] - aux)/Z(k,k);
+  }
+
+  return true;
+} 
+
+bool TePDIPrincoMixModelStrategy::Implementation(const TePDIParameters& params)
+{
+// Check components e spectralbands parameters
+  TePDIMixModelComponentList componentList;
+  TEAGN_TRUE_OR_RETURN(params.GetParameter("component_list", componentList), "Missing parameter: component_list");
+
+  TePDIMixModelSpectralBandList spectralBandList;
+  TEAGN_TRUE_OR_RETURN(params.GetParameter("spectral_band_list", spectralBandList), "Missing parameter: spectral_band_list");
+
+  unsigned int  componentsNumber = componentList.getSize(),
+      spectralBandsNumber = spectralBandList.getSize(),
+      componentsNumberLessOne = componentsNumber - 1;
+
+// Check input_rasters parameter
+  TePDITypes::TePDIRasterVectorType input_rasters;
+  TEAGN_TRUE_OR_RETURN(params.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+  
+  std::vector<int> bands;
+  TEAGN_TRUE_OR_RETURN(params.GetParameter("bands", bands), 
+    "Missing parameter: bands");
+
+// Check output_rasters parameter
+  TePDITypes::TePDIRasterVectorType output_rasters;
+  TEAGN_TRUE_OR_RETURN(params.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+
+// Initialize output_rasters based on first input raster
+
+  TeRasterParams base_raster_params = input_rasters[0]->params();
+  base_raster_params.setDataType( TeDOUBLE, -1 );
+  base_raster_params.nBands( 1 );
+  
+  for(unsigned int outrasterindex = 0; outrasterindex < output_rasters.size(); 
+    ++outrasterindex )
+  {
+    TeRasterParams outRasterParams = output_rasters[outrasterindex]->params();
+    outRasterParams.nBands( 1 );
+    outRasterParams.boundingBoxLinesColumns(
+      base_raster_params.boundingBox().x1(),
+      base_raster_params.boundingBox().y1(),
+      base_raster_params.boundingBox().x2(),
+      base_raster_params.boundingBox().y2(),
+      base_raster_params.nlines_,
+      base_raster_params.ncols_,
+      TeBox::TeUPPERLEFT );
+    outRasterParams.projection( base_raster_params.projection() );
+    
+    TEAGN_TRUE_OR_THROW( 
+      output_rasters[outrasterindex]->init( outRasterParams ), 
+        "Output raster init error");
+  }
+
+// Check compute error raster parameter and outout error rasters if it's necessary
+  int computeErrorRasters;
+  TEAGN_TRUE_OR_RETURN(params.GetParameter("compute_error_rasters", computeErrorRasters), "Missing parameter: compute_error_asters");
+  TePDITypes::TePDIRasterVectorType output_error_rasters;
+  if (computeErrorRasters)
+  {
+    TEAGN_TRUE_OR_RETURN(params.GetParameter("output_error_rasters", 
+      output_error_rasters), "Missing parameter: output_error_rasters");
+      
+    for(unsigned int outrasterindex = 0; outrasterindex < 
+      output_error_rasters.size(); ++outrasterindex )
+    {
+      TeRasterParams outRasterParams = 
+        output_error_rasters[outrasterindex]->params();
+      outRasterParams.nBands( 1 );
+      outRasterParams.boundingBoxLinesColumns(
+        base_raster_params.boundingBox().x1(),
+        base_raster_params.boundingBox().y1(),
+        base_raster_params.boundingBox().x2(),
+        base_raster_params.boundingBox().y2(),
+        base_raster_params.nlines_,
+        base_raster_params.ncols_,
+        TeBox::TeUPPERLEFT );
+      outRasterParams.projection( base_raster_params.projection() );    
+      
+      TEAGN_TRUE_OR_THROW( 
+        output_error_rasters[outrasterindex]->init( outRasterParams ), 
+          "Output raster init error");      
+    }
+  }
+
+// Check compute average error
+  int computeAverageError;
+  TEAGN_TRUE_OR_RETURN(params.GetParameter("compute_average_error", computeAverageError), "Missing parameter: compute_average_error_");
+  double averageError;
+  if (computeAverageError)
+    TEAGN_TRUE_OR_RETURN(params.GetParameter("average_error", averageError), "Missing parameter: average_error");
+
+// Check normalize
+  int normalize;
+  TEAGN_TRUE_OR_RETURN(params.GetParameter("normalize", normalize), "Missing parameter: normalize");
+
+// Getting number of lines and columns from the first image
+  int rastersLines = base_raster_params.nlines_;
+  int rastersColumns = base_raster_params.ncols_;
+
+// Indexes variables
+  unsigned int  i,
+      j,
+      k,
+      m;
+
+// Buildind the SpectralBandsComponents Matrix base on input componentsList and spectralBandList
+  TeMatrix SpectralBandsComponents;
+  SpectralBandsComponents.Init(spectralBandsNumber, componentsNumber, 0.0);
+  for(i = 0; i < spectralBandsNumber; i++)
+    for (j = 0; j < componentsNumber; j++)
+      SpectralBandsComponents(i, j) = componentList.getPixel(j, i);
+//Printing
+//cout << "SpectralBandsComponents" << endl;
+//SpectralBandsComponents.Print();
+
+//----- Part I : mathematical processing independend on image data -----//
+
+// SpectralBandsComponentsTransposed stores SpectralBandsComponents and other things after
+   TeMatrix SpectralBandsComponentsTransposed;
+// Initializing SpectralBandsComponentsTransposed Matrix
+  TEAGN_TRUE_OR_RETURN(SpectralBandsComponentsTransposed.Init(componentsNumber, spectralBandsNumber, 0.0), "Error initializing SpectralBandsComponentsTransposed Matrix");
+// Initializing SpectralBandsComponentsTransposed Matrix = Transpose of SpectralBandsComponents
+   TEAGN_TRUE_OR_RETURN(SpectralBandsComponents.Transpose(SpectralBandsComponentsTransposed), "Error transposing SpectralBandsComponents to SpectralBandsComponentsTransposed");
+
+//Printing
+//cout << "SpectralBandsComponentsTransposed - After transposing" << endl;
+//SpectralBandsComponentsTransposed.Print();
+ 
+// Compute componentsMean vector as the mean coefficient value per band and subtract the componentsMeanAfter from the coefficients matrix
+// Creating two double vectors to store de means of the spectralBands of each component
+   std::vector<double> componentsMean(spectralBandsNumber, 0.0),
+     componentsMeanAfter(spectralBandsNumber, 0.0);
+  for (j = 0; j < spectralBandsNumber; j++)
+  {
+// Compute original mean (componentsMean)
+    componentsMean[j] = 0;
+    for(i = 0; i < componentsNumber; i++)
+      componentsMean[j] = componentsMean[j] + SpectralBandsComponentsTransposed(i,j);
+    componentsMean[j] = componentsMean[j] / (double)componentsNumber;
+
+// Subtract mean from SpectralBandsComponents and compute new matrix mean (componentsMeanAfter)
+    componentsMeanAfter[j] = 0;
+    for(i = 0; i < componentsNumber; i++)
+    {
+      SpectralBandsComponentsTransposed(i,j) = SpectralBandsComponentsTransposed(i,j) - componentsMean[j];
+      componentsMeanAfter[j] = componentsMeanAfter[j] + SpectralBandsComponentsTransposed(i,j);
+    }
+    componentsMeanAfter[j] = componentsMeanAfter[j]/ (double)componentsNumber;
+  }
+
+//Printing
+//cout << "SpectralBandsComponentsTransposed - After less mean" << endl;
+//SpectralBandsComponentsTransposed.Print();
+
+// Compute covarianceVector vector
+  std::vector<double> covarianceVector(spectralBandsNumber*spectralBandsNumber, 0.0);
+  for(k = 0; k < spectralBandsNumber*spectralBandsNumber; k++)
+    covarianceVector[k] = 0;
+   k = 0 ;
+   for(j = 0; j < spectralBandsNumber; j++)
+   {
+     for(m = 0; m < j + 1; m++)
+     {
+       for(i = 0; i < componentsNumber; i++)
+         covarianceVector[k] = covarianceVector[k] + (SpectralBandsComponentsTransposed(i, j) - componentsMeanAfter[j]) * (SpectralBandsComponentsTransposed(i, m) - componentsMeanAfter[m]);
+       covarianceVector[k] = covarianceVector[k]/(double)componentsNumber ;
+       k++;
+     }
+   }
+// Printing
+//  for(k = 0; k < spectralBandsNumber*spectralBandsNumber; k++)
+//  {
+//    cout << covarianceVector[k] << " ";
+//  }
+
+   TeMatrix covarianceMatrix;
+  TEAGN_TRUE_OR_RETURN(covarianceMatrix.Init(spectralBandsNumber, spectralBandsNumber, 0.0), "Error initializing covarianceMatrix");
+
+   k = 0;
+   for (i = 0; i< spectralBandsNumber; i++)
+     for (j = 0; j <= i; j++)
+       covarianceMatrix(i, j) = covarianceVector[k++];
+// Printing
+//cout << "covarianceMatrix" << endl;
+//covarianceMatrix.Print();
+
+// Compute eigenvectors : results aux
+   TeMatrix auxMatrix;
+   TEAGN_TRUE_OR_RETURN(covarianceMatrix.EigenVectors(auxMatrix), "Error in eigenvectors calcule of auxMatrix")
+
+// Printing
+//cout << "auxMatrix - eigenvectors of covarianceMatrix" << endl;
+//auxMatrix.Print();
+
+// Keep only significant eigenvectors (componentsNumber - 1): results eigenreducted
+   TeMatrix eigenreducted;
+   TEAGN_TRUE_OR_RETURN(eigenreducted.Init(spectralBandsNumber, componentsNumberLessOne, 0.0), "Error initializing eigenreducted matrix")
+   for (j = 0; j <  spectralBandsNumber; j++)
+     for (i = 0; i <  componentsNumberLessOne; i++)
+       eigenreducted(j, i) = auxMatrix(j, i);
+
+//Printing
+//cout << "eigenreducted" << endl;
+//eigenreducted.Print();
+
+// Clear auxMatrix for future use
+   auxMatrix.Clear(); 
+
+// Rotate SpectralBandsComponentsTransposed to PCA space;  result SpectralBandsComponentsPCA
+  TeMatrix SpectralBandsComponentsPCA;
+  TEAGN_TRUE_OR_RETURN(SpectralBandsComponentsPCA.Init(SpectralBandsComponentsTransposed.Nrow(), eigenreducted.Ncol()), "Error initializing SpectralBandsComponentsPCA");
+ 
+  SpectralBandsComponentsPCA = SpectralBandsComponentsTransposed * eigenreducted;
+
+// Printing
+//cout << "SpectralBandsComponentsPCA - Rotate SpectralBandsComponentsTransposed to PCA space" << endl;
+//SpectralBandsComponentsPCA.Print();
+
+// Clear SpectralBandsComponentsTransposed: it will not be used bellow
+  SpectralBandsComponentsTransposed.Clear();
+ 
+// Initialize one more column to SpectralBandsComponentsPCA to incorporate sum restriction to equations; results auxMatrix
+  TEAGN_TRUE_OR_RETURN(auxMatrix.Init(SpectralBandsComponentsPCA.Nrow(), SpectralBandsComponentsPCA.Ncol() + 1), "Error initializing auxMatrix");
+ 
+  for (j = 0; j < ((unsigned int)SpectralBandsComponentsPCA.Nrow()); j++)
+  {
+    for (i = 0; i <  ((unsigned int)SpectralBandsComponentsPCA.Ncol() ); i++)
+      auxMatrix(j, i) = SpectralBandsComponentsPCA(j, i);
+    auxMatrix (j, SpectralBandsComponentsPCA.Ncol()) = 1.0;
+  }
+// Printing
+//cout << "Initialize one more column to SpectralBandsComponentsPCA to incorporate sum restriction to equation" << endl;
+//auxMatrix.Print();
+
+// Clear SpectralBandsComponentsPCA for future use
+  SpectralBandsComponentsPCA.Clear(); 
+ 
+// Transpose auxMatrix; results SpectralBandsComponentsPCA
+  TEAGN_TRUE_OR_RETURN(auxMatrix.Transpose(SpectralBandsComponentsPCA), "Error transposing auxMatrix to SpectralBandsComponentsPCA");
+
+// Printing
+//cout << "Transpose matrix SpectralBandsComponentsPCA" << endl;
+//SpectralBandsComponentsPCA.Print();
+
+// Clear auxMatrix for future use
+  auxMatrix.Clear();
+ 
+// Invert matrix SpectralBandsComponentsPCA; results SpectralBandsComponentsPCA
+  std::vector<int> lines(componentsNumber, 0);
+
+   TEAGN_TRUE_OR_RETURN(SGaussElimination(SpectralBandsComponentsPCA, lines, componentsNumber), "Error in gauss elimination");
+
+// Printing
+//cout << "Invert matrix SpectralBandsComponentsPCA" << endl;
+//SpectralBandsComponentsPCA.Print();
+
+//----- Part II : mathematical processing dependend on image data -----//
+ 
+// Initialize matrixes that will help to prepare vector Y
+  TEAGN_TRUE_OR_RETURN(auxMatrix.Init(1, spectralBandsNumber, 0.0), "Error initializing auxMatrix");
+ 
+  TeMatrix ymat;
+  TEAGN_TRUE_OR_RETURN(ymat.Init(componentsNumberLessOne, componentsNumberLessOne, 0.0), "Error initializing ymat");
+ 
+// Initialize proportion vector X and image dependent values for the linear equations Y  
+  std::vector<double>  x(componentsNumber, 0.0),
+    y(componentsNumber, 0.0);
+  for (i = 0; i < componentsNumber; i++)
+  {
+    x[i] = 0.0;
+    y[i] = 0.0;
+  }
+
+// Initialize current line and column    
+  std::vector<int> colin(spectralBandsNumber, 0);
+  int  colout,
+// Auxiliates the transformation of proportions to [0, 255]
+    prop;
+
+// It's should be class variables
+  std::vector<int> linesIn(spectralBandsNumber, 0),
+    colsIn(spectralBandsNumber, 0);
+
+// It's should be class variables
+  TeMatrix  rasterLinesIn,
+			rasterLinesOut;
+  rasterLinesIn.Init(spectralBandsNumber, rastersColumns, 0.0);
+  rasterLinesOut.Init(componentsNumber, rastersColumns, 0.0);
+  std::vector<double> spectralBandsError(spectralBandsNumber, 0.0);
+
+// Initialization of variables declared above
+  for (i = 0; i < spectralBandsNumber; i++)
+  {
+    colin[i] = 0;
+    linesIn[i] = 0;
+    colsIn[i] = 0;
+    spectralBandsError[i] = 0.0;
+  }
+
+// Start computing proportions for each line lines
+  TePDIPIManager progress( "Computing MixModel proportions", rastersLines,
+    progress_interface_enabled_ );
+
+  for (int linout = 0; linout < rastersLines;  linout++)
+  {
+    // Read input line for each band
+    for (i = 0; i < spectralBandsNumber; i++)
+    {
+      for (j = 0; j < ( (unsigned int)rastersColumns ); j++)
+      {
+        double p;
+        input_rasters[i]->getElement(j, linesIn[i], p, bands[ i ] );
+        rasterLinesIn(i, j) = p;
+      }
+      // Update next line to be read for band i
+      linesIn[i]++;
+
+      // Reinitialize first column for band i
+      colin[i] = colsIn[i];
+    }
+
+    // Compute proportions for each column
+           for (colout = 0; colout < rastersColumns; colout++)
+    {
+      // Prepare y
+      for (i = 0; i < spectralBandsNumber; i++)
+        auxMatrix(0,i) = (double) (rasterLinesIn(i, colin[i]))/255. - componentsMean[i];
+ 
+      ymat = auxMatrix * eigenreducted;
+    
+      for (i = 0; i < componentsNumber - 1; i++)
+        y[i] = ymat(0,i);
+      
+      // Compute proportions
+      SFowardBackSubstitution(SpectralBandsComponentsPCA, y, componentsNumber, lines, componentsNumber, x, componentsNumber);
+ 
+      // Store proportion in buffers  
+      for (i = 0; i < componentsNumber; i++)
+      {
+        prop = (short) (x[i]*100 + 100);
+        rasterLinesOut(i, colout) = (unsigned char)prop;
+      }
+ 
+//----- It's should be a function (ComputeErrors.begin) -----//
+
+      double   aux, error;
+      // Verifify if it is necessary to compute the error
+      if (computeErrorRasters || computeAverageError)
+      {
+        for (i = 0; i < spectralBandsNumber; i++)
+        {
+          // Compute digital value from the proportions
+          aux = 0.0;
+          for (j = 0; j < componentsNumber; j++)
+            aux += x[j] * SpectralBandsComponents(i,j);
+      
+          // Compute error as module of the difference between the original value and aux
+          error = (long)(rasterLinesIn(i, colin[i]))/255.0 - aux;
+          if (error < 0)
+            error = -1 * error;
+          if (computeErrorRasters)
+            rasterLinesIn(i, colout) = error * 255.0;
+          if (computeAverageError)
+            spectralBandsError[i] += error*255.;
+        }
+      }
+
+//----- It's should be a function (ComputeErrors.end) -----//
+      // Update current column number
+      for (i = 0; i < spectralBandsNumber; i++)
+        colin[i]++;
+ 
+     } // End of column processing
+ 
+    // Write processed line to disk
+    for (i = 0; i < componentsNumber; i++)
+      for (j = 0; j < ((unsigned int)rastersColumns); j++)
+        output_rasters[i]->setElement(j, linout, rasterLinesOut(i, j));
+
+
+//----- It's should be a function (StoreErrorRasters.begin) -----//
+    // Store output error rasters
+    if (computeErrorRasters)
+    {
+      // Write the output error images lines
+      for (i = 0; i < componentsNumber; i++)
+        for (j = 0; j < ((unsigned int)rastersColumns); j++)
+                  output_error_rasters[i]->setElement(j, linout, rasterLinesIn(i, j));
+    }
+//----- It's should be a function (StoreErrorRasters.end) -----//
+
+    progress.Increment();
+  } // End of line processing
+  
+  progress.Toggle( false );
+
+//----- It's should be a function (ComputeAverageError.begin) -----//
+// Verifify if it is necessary to compute the error
+  averageError = 0.0;
+  if (computeAverageError)
+  {
+    // Compute total number of pixels in the output image
+    int numpix = rastersLines*rastersColumns;
+    for (i = 0; i < spectralBandsNumber; i++)
+    {
+      // Compute avarege band error taking accumulated band error 
+      spectralBandsError[i] = spectralBandsError[i]/numpix;
+      // Accumulate avarege error
+      averageError += spectralBandsError[i];
+    }
+    // Compute total error taking the accumulated average error
+    if (!(spectralBandsNumber == 0))
+    {
+      averageError = averageError/spectralBandsNumber;
+    }
+// Printing
+//    cout << endl << averageError << endl;
+  }
+// Printing
+//  for(k = 0; k < spectralBandsNumber; k++)
+//  {
+//    cout << spectralBandsError[k] << " ";
+//  }
+//----- It's should be a function (ComputeAverageError.end) -----//
+
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIPrincoMixModelStrategy.hpp b/src/terralib/image_processing/TePDIPrincoMixModelStrategy.hpp
old mode 100755
new mode 100644
index 2d04063..ac9d92a
--- a/src/terralib/image_processing/TePDIPrincoMixModelStrategy.hpp
+++ b/src/terralib/image_processing/TePDIPrincoMixModelStrategy.hpp
@@ -1,95 +1,95 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIGARGUETMIXMODELSTRATEGY_HPP
-#define TEPDIGARGUETMIXMODELSTRATEGY_HPP
-
-#include <TePDIStrategyFactory.hpp>
-#include <TePDIAlgorithmFactory.hpp>
-#include <TePDIUtils.hpp>
-#include <TeAgnostic.h>
-#include <TeRasterParams.h>
-#include <TeRaster.h>
-#include <TeSharedPtr.h>
-#include <TePDIMixModelStrategy.hpp>
-#include <TePDIParameters.hpp>
-#include <TePDIMixModelComponentList.hpp>
-#include <TePDIMixModelSpectralBandList.hpp>
-
-#include <string>
-
-/**
-* @brief This is the class for princo mixmodel strategy.
-* @author Felipe Castro da Silva <tkorting at dpi.inpe.br>
-* @ingroup PDIStrategies
-*
-* @note The required parameters are:
-* @param mixmodel_type (std::string): Must be "princo", "mqp" or "mpr".
-* @param component_list (TePDIMixModelComponentList): components list.
-* @param spectral_band_list (TePDIMixModelSpectralBandList): spectral bands list.
-* @param input_rasters (TePDITypes::TePDIRasterVectorType): input rasters.
-* @param bands (std::vector<int>): band number of each input raster.
-* @param output_rasters (TePDITypes::TePDIRasterVectorType): output rasters (ratio images).
-* @param compute_error_rasters (int): if 1, the algorithm compute the error rasters, if 0, not.
-* @param output_error_rasters (TePDITypes::TePDIRasterVectorType): if compute_error_rasters, here we have to set output error rasters.
-* @param compute_average_error (int): if 1, the algorithm compute the average error, if 0, not.
-* @param average_error (double): if compute_average_error, here we have the average error value.
-* @param normalize (double): if 1, the output images are normalized, if 0, not.
-*/
-
-class PDI_DLL TePDIPrincoMixModelStrategy : public TePDIMixModelStrategy
-{
- 	friend class TePDIPrincoMixModelSF;
-	public :
- 		typedef TeSharedPtr< TePDIPrincoMixModelStrategy > pointer;
- 		typedef const TeSharedPtr< TePDIPrincoMixModelStrategy > const_pointer;
-/**Default destructor.*/
-		~TePDIPrincoMixModelStrategy();
-/**
-* Checks if the supplied parameters fits the requirements of each
-* PDI strategy.
-*
-* Error log messages must be generated. No exceptions generated.
-*
-* @param parameters The parameters to be checked.
-* @return true if the parameters are OK. false if not.
-*/
-		bool CheckParameters(const TePDIParameters& parameters) const;
-
-	protected :
-/**
-* Default constructor
-*
-* @param factoryName Factory name.
-*/
-		TePDIPrincoMixModelStrategy();
-/**
-* Runs the algorithm implementation.
-*
-* @return true if OK. false on errors.
-*/
-		bool Implementation(const TePDIParameters& params);
-};
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIGARGUETMIXMODELSTRATEGY_HPP
+#define TEPDIGARGUETMIXMODELSTRATEGY_HPP
+
+#include <TePDIStrategyFactory.hpp>
+#include <TePDIAlgorithmFactory.hpp>
+#include <TePDIUtils.hpp>
+#include <TeAgnostic.h>
+#include <TeRasterParams.h>
+#include <TeRaster.h>
+#include <TeSharedPtr.h>
+#include <TePDIMixModelStrategy.hpp>
+#include <TePDIParameters.hpp>
+#include <TePDIMixModelComponentList.hpp>
+#include <TePDIMixModelSpectralBandList.hpp>
+
+#include <string>
+
+/**
+* @brief This is the class for princo mixmodel strategy.
+* @author Felipe Castro da Silva <tkorting at dpi.inpe.br>
+* @ingroup PDIStrategies
+*
+* @note The required parameters are:
+* @param mixmodel_type (std::string): Must be "princo", "mqp" or "mpr".
+* @param component_list (TePDIMixModelComponentList): components list.
+* @param spectral_band_list (TePDIMixModelSpectralBandList): spectral bands list.
+* @param input_rasters (TePDITypes::TePDIRasterVectorType): input rasters.
+* @param bands (std::vector<int>): band number of each input raster.
+* @param output_rasters (TePDITypes::TePDIRasterVectorType): output rasters (ratio images).
+* @param compute_error_rasters (int): if 1, the algorithm compute the error rasters, if 0, not.
+* @param output_error_rasters (TePDITypes::TePDIRasterVectorType): if compute_error_rasters, here we have to set output error rasters.
+* @param compute_average_error (int): if 1, the algorithm compute the average error, if 0, not.
+* @param average_error (double): if compute_average_error, here we have the average error value.
+* @param normalize (double): if 1, the output images are normalized, if 0, not.
+*/
+
+class PDI_DLL TePDIPrincoMixModelStrategy : public TePDIMixModelStrategy
+{
+ 	friend class TePDIPrincoMixModelSF;
+	public :
+ 		typedef TeSharedPtr< TePDIPrincoMixModelStrategy > pointer;
+ 		typedef const TeSharedPtr< TePDIPrincoMixModelStrategy > const_pointer;
+/**Default destructor.*/
+		~TePDIPrincoMixModelStrategy();
+/**
+* Checks if the supplied parameters fits the requirements of each
+* PDI strategy.
+*
+* Error log messages must be generated. No exceptions generated.
+*
+* @param parameters The parameters to be checked.
+* @return true if the parameters are OK. false if not.
+*/
+		bool CheckParameters(const TePDIParameters& parameters) const;
+
+	protected :
+/**
+* Default constructor
+*
+* @param factoryName Factory name.
+*/
+		TePDIPrincoMixModelStrategy();
+/**
+* Runs the algorithm implementation.
+*
+* @return true if OK. false on errors.
+*/
+		bool Implementation(const TePDIParameters& params);
+};
+
+#endif
diff --git a/src/terralib/image_processing/TePDIRadarFilter.cpp b/src/terralib/image_processing/TePDIRadarFilter.cpp
old mode 100755
new mode 100644
index 213cc29..f6aa653
--- a/src/terralib/image_processing/TePDIRadarFilter.cpp
+++ b/src/terralib/image_processing/TePDIRadarFilter.cpp
@@ -1,19 +1,19 @@
-#include "TePDIRadarFilter.hpp"
-
-TePDIRadarFilter::TePDIRadarFilter()
-{
-  max_adapt_mask_width_ = 9;
-}
-
-
-TePDIRadarFilter::~TePDIRadarFilter()
-{
-}
-
-
-void TePDIRadarFilter::ResetState( const TePDIParameters& params )
-{
-  TePDIBufferedFilter::ResetState( params );
-}
-
-
+#include "TePDIRadarFilter.hpp"
+
+TePDIRadarFilter::TePDIRadarFilter()
+{
+  max_adapt_mask_width_ = 9;
+}
+
+
+TePDIRadarFilter::~TePDIRadarFilter()
+{
+}
+
+
+void TePDIRadarFilter::ResetState( const TePDIParameters& params )
+{
+  TePDIBufferedFilter::ResetState( params );
+}
+
+
diff --git a/src/terralib/image_processing/TePDIRadarFilter.hpp b/src/terralib/image_processing/TePDIRadarFilter.hpp
old mode 100755
new mode 100644
index d7d9ced..99f8364
--- a/src/terralib/image_processing/TePDIRadarFilter.hpp
+++ b/src/terralib/image_processing/TePDIRadarFilter.hpp
@@ -1,70 +1,71 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRADARFILTER_HPP
-  #define TEPDIRADARFILTER_HPP
-
-  #include "TePDIBufferedFilter.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the base class for radar filters.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIFiltersGroup
-   */
-  class PDI_DLL TePDIRadarFilter : public TePDIBufferedFilter {
-    public :
-      /** @typedef Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIRadarFilter > pointer;
-      /** @typedef Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIRadarFilter > const_pointer;
-
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIRadarFilter();
-
-    protected :
-      /**
-       * @brief The maximum mask width for adaptative filters
-       */
-      unsigned int max_adapt_mask_width_;
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIRadarFilter();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      virtual void ResetState( const TePDIParameters& params );
-
-  };
-
-#endif //TEPDIRADARFILTER_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRADARFILTER_HPP
+  #define TEPDIRADARFILTER_HPP
+
+  #include "TePDIBufferedFilter.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @class TePDIRadarFilter
+   * @brief This is the base class for radar filters.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIFiltersGroup
+   */
+  class PDI_DLL TePDIRadarFilter : public TePDIBufferedFilter {
+    public :
+      /** @typedef Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIRadarFilter > pointer;
+      /** @typedef Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIRadarFilter > const_pointer;
+
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TePDIRadarFilter();
+
+    protected :
+      /**
+       * @brief The maximum mask width for adaptative filters
+       */
+      unsigned int max_adapt_mask_width_;
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIRadarFilter();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      virtual void ResetState( const TePDIParameters& params );
+
+  };
+
+#endif //TEPDIRADARFILTER_HPP
diff --git a/src/terralib/image_processing/TePDIRadarFrostFilter.cpp b/src/terralib/image_processing/TePDIRadarFrostFilter.cpp
old mode 100755
new mode 100644
index b35ae27..89a54c4
--- a/src/terralib/image_processing/TePDIRadarFrostFilter.cpp
+++ b/src/terralib/image_processing/TePDIRadarFrostFilter.cpp
@@ -1,377 +1,413 @@
-#include "TePDIRadarFrostFilter.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-
-#include "math.h"
-
-TePDIRadarFrostFilter::TePDIRadarFrostFilter()
-{
-}
-
-
-TePDIRadarFrostFilter::~TePDIRadarFrostFilter()
-{
-}
-
-
-void TePDIRadarFrostFilter::ResetState( const TePDIParameters& params )
-{
-  TePDIRadarFilter::ResetState( params );
-}
-
-
-bool TePDIRadarFrostFilter::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking for general required parameters */
-
-  TePDITypes::TePDIRasterPtrType inRaster;
-  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: input_image" );
-    return false;
-  }
-  if( ! inRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
-    return false;
-  }
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: output_image" );
-    return false;
-  }
-  if( ! outRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeReadyToWrite ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
-    return false;
-  }
-
-  /* channels parameter checking */
-
-  std::vector< int > channels;
-  if( ! parameters.GetParameter( "channels", channels ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: channels" );
-    return false;
-  }
-  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
-    if( channels[ index ] >= inRaster->nBands() ) {
-      TEAGN_LOGERR( "Invalid parameter: channels" );
-      return false;
-    }
-  }
-
-  /* Checking for number of iterations */
-
-  int iterations = 0;
-  if( ! parameters.GetParameter( "iterations", iterations ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: iterations" );
-    return false;
-  }
-  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
-
-  /* Checking for detection type parameter */
-
-  TePDIFrostDetType det_type;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "det_type", det_type ),
-    "Missing parameter: det_type" );
-  TEAGN_TRUE_OR_RETURN(
-    ( ( det_type == TePDIFrostDTLinear ) || ( det_type == TePDIFrostDTQuadratic ) ),
-    "Invalid detection type" );
-
-  /* Checking for image look number */
-
-  double look_number = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "look_number", look_number ),
-    "Missing parameter: look_number" );
-  TEAGN_TRUE_OR_RETURN( look_number > 0,  "Invalid image look number" );
-
-  /* Checking for corr_coef parameter */
-
-  double corr_coef = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "corr_coef",
-    corr_coef ),
-    "Missing parameter: corr_coef" );
-  TEAGN_TRUE_OR_RETURN( ( corr_coef >= 0 ) && ( corr_coef <= 1 ),
-    "Invalid curr_coef" );
-
-  /* Checking photometric interpretation */
-  
-  for( unsigned int channel = 0 ; channel < channels.size() ; ++channel ) {
-    TEAGN_TRUE_OR_RETURN( ( 
-      ( inRaster->params().photometric_[ channel ] == 
-        TeRasterParams::TeRGB ) ||
-      ( inRaster->params().photometric_[ channel ] == 
-        TeRasterParams::TeMultiBand ) ),
-    "Invalid parameter - input_image (invalid photometric interpretation)" );
-  }    
-
-  return true;
-}
-
-
-bool TePDIRadarFrostFilter::RunImplementation()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-
-  TePDIFrostDetType det_type;
-  params_.GetParameter( "det_type", det_type );
-
-  double look_number = 0;
-  params_.GetParameter( "look_number", look_number );
-
-  double corr_coef;
-  params_.GetParameter( "corr_coef", corr_coef );
-
-  const unsigned int mask_width = 5;
-  /* fixed size - affects convolution weights matrix dimentions */
-
-  /* Setting the output raster */
-
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );  
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ );  
-    
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
-
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );    
-
-  /* Creating the temporary rasters with one band each */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, aux_raster1, 1,
-    false, false, TeDOUBLE ), "Unable to create auxiliary raster 1" );
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, aux_raster2, 1,
-    false, false, TeDOUBLE ), "Unable to create auxiliary raster 2" );
-
-  /* Noise statistics */
-
-  double noise_deviation = 0;
-
-  if( det_type == TePDIFrostDTLinear ) {
-    noise_deviation = 0.522723008 / sqrt( look_number );
-  } else if( det_type == TePDIFrostDTQuadratic ) {
-    noise_deviation = 1.0 / sqrt( look_number );
-  }
-
-  const double noise_variance = noise_deviation * noise_deviation;
-  const double noise_variance_plus_one = noise_variance + 1.;
-
-  /* Setting the convolution buffer initial state */
-
-  const unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  const unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  reset_conv_buf( mask_width, raster_columns );
-
-  /* Convolution Loop */
-
-  double output_level; /* the value generated by each pixel mask calcule */
-
-  const unsigned int mask_middle_off =
-    (unsigned int) floor( ((double)mask_width) / 2. );
-
-  const unsigned int conv_column_bound = raster_columns - mask_width + 1;
-  const unsigned int conv_line_bound = raster_lines - mask_width + 1;
-
-  unsigned int raster_line; /* mask top-left line */
-  unsigned int conv_buf_column; /* mask top-left column */
-
-  double channel_min_level;
-  double channel_max_level;
-
-  double mean = 0; /* for the current window covolution inside convolution 
-    buffer */
-  double variance = 0; /* for the current window convolution inside 
-    convolution buffer */
-  double mean_2 = 0;; /* mean ^ 2 */
-  double vx = 0;;
-  double H = 0;;
-  double m = 0;;
-  double m_cumulative = 0;;
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-
-  double mtab[ 33 ];
-
-  unsigned int mask_line;
-  unsigned int mask_column;
-
-  unsigned int dist_x;
-  unsigned int dist_y;
-  unsigned int dist_2;
-  
-  StartProgInt( "Frost filter", channels.size() * iterations * 
-    conv_line_bound );  
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-
-    TEAGN_TRUE_OR_THROW(
-      TePDIUtils::TeCopyRasterPixels( inRaster, channels[ channels_index ],
-      aux_raster1, 0, false, false ), "Auxiliar Raster fill error" );
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels[ channels_index ], channel_min_level,
-      channel_max_level ), "Unable to get raster channel level bounds" );
-
-    for( unsigned int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-      /* Switching from input and output raster for more than 1 iteration */
-
-      if( iteration % 2 == 0 ) {
-        source_raster = aux_raster1;
-        target_raster = aux_raster2;
-      } else {
-        source_raster = aux_raster2;
-        target_raster = aux_raster1;
-      }
-
-      /* Fills the convolution buffer with the first "mask_lines" from the raster */
-
-      for( unsigned int line = 0 ; line < ( mask_width - 1) ; ++line ) {
-        up_conv_buf( source_raster, line, 0 );
-      }
-
-      /* window convolution over raster */
-
-      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-        
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
-          conv_line_bound ) +
-          ( iteration * conv_line_bound ) + raster_line ), 
-          "Canceled by the user" );
-
-        up_conv_buf( source_raster, raster_line + mask_width - 1,
-          channels_index );
-
-        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
-             ++conv_buf_column ) {
-
-          conv_buf_estatistics( 0, conv_buf_column, mask_width, mask_width, mean,
-            variance );
-
-          mean_2 = mean * mean;
-
-          vx = ( variance  - ( noise_variance *  mean_2 ) ) /
-               noise_variance_plus_one;
-
-          H = vx + mean_2;
-          if( H != 0 ) {
-            H = corr_coef + ( 2 * corr_coef * vx / noise_variance / H );
-          }
-          if( H <= 0 ) {
-            H = corr_coef;
-          }
-          H = sqrt( H );
-
-          /* Weights matrix creation */
-
-          mtab[0] = 1.;
-          mtab[1] = exp(-H * 1.);
-          mtab[2] = exp(-H * 1.414213562);
-          mtab[4] = exp(-H * 2.);
-          mtab[5] = exp(-H * 2.236067977);
-          mtab[8] = exp(-H * 2.828427125);
-          mtab[9] = exp(-H * 3.);
-          mtab[10] = exp(-H * 3.16227766);
-          mtab[13] = exp(-H * 3.605551276);
-          mtab[16] = exp(-H * 4.);
-          mtab[17] = exp(-H * 4.123105626);
-          mtab[18] = exp(-H * 4.242640687);
-          mtab[20] = exp(-H * 4.472135955);
-          mtab[25] = exp(-H * 5.);
-          mtab[32] = exp(-H * 5.65685425);
-
-          /* Mask Convolution */
-
-          output_level = 0;
-          m_cumulative = 0;
-
-          for( mask_line = 0 ; mask_line < mask_width ; ++mask_line ) {
-            dist_y = mask_line - mask_middle_off - mask_width;
-
-            for( mask_column = 0 ; mask_column < mask_width ; ++mask_column ) {
-              dist_x = mask_column - mask_middle_off - mask_width;
-
-              dist_2 = ( dist_y * dist_y ) + ( dist_x * dist_x );
-
-              if( ( dist_2 < 32 ) && ( mtab[ dist_2 ] != 0 ) ) {
-                m = m * mtab[ dist_2 ];
-              } else {
-                m = H;
-              }
-            }
-
-            output_level +=
-              m * conv_buf_[ mask_line ][ mask_column + conv_buf_column];
-            m_cumulative += m;
-          }
-
-          output_level = output_level / m_cumulative;
-
-
-          /* Level range filtering */
-
-          if( output_level < channel_min_level ) {
-            output_level = channel_min_level;
-          } else if( output_level > channel_max_level ) {
-            output_level = channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            conv_buf_column +  mask_middle_off,
-            raster_line +  mask_middle_off, output_level, 0 ),
-            "Pixel mapping error" );
-
-        }
-      }
-    }
-
-    /* Content copy from the target raster to the output raster */
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeCopyRasterPixels( target_raster, 0,
-      outRaster, channels_index, false, false ), "Output raster fill error" );
-  }
-
-  return true;
-}
+#include "TePDIRadarFrostFilter.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+
+#include "math.h"
+
+TePDIRadarFrostFilter::TePDIRadarFrostFilter()
+{
+}
+
+
+TePDIRadarFrostFilter::~TePDIRadarFrostFilter()
+{
+}
+
+
+void TePDIRadarFrostFilter::ResetState( const TePDIParameters& params )
+{
+  TePDIRadarFilter::ResetState( params );
+}
+
+
+bool TePDIRadarFrostFilter::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking for general required parameters */
+
+  TePDITypes::TePDIRasterPtrType inRaster;
+  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: input_image" );
+    return false;
+  }
+  if( ! inRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
+    return false;
+  }
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: output_image" );
+    return false;
+  }
+  if( ! outRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeReadyToWrite ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
+    return false;
+  }
+
+  /* channels parameter checking */
+
+  std::vector< int > channels;
+  if( ! parameters.GetParameter( "channels", channels ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: channels" );
+    return false;
+  }
+  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
+    if( channels[ index ] >= inRaster->nBands() ) {
+      TEAGN_LOGERR( "Invalid parameter: channels" );
+      return false;
+    }
+  }
+
+  /* Checking for number of iterations */
+
+  int iterations = 0;
+  if( ! parameters.GetParameter( "iterations", iterations ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: iterations" );
+    return false;
+  }
+  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
+
+  /* Checking for detection type parameter */
+
+  TePDIFrostDetType det_type;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "det_type", det_type ),
+    "Missing parameter: det_type" );
+  TEAGN_TRUE_OR_RETURN(
+    ( ( det_type == TePDIFrostDTLinear ) || ( det_type == TePDIFrostDTQuadratic ) ),
+    "Invalid detection type" );
+
+  /* Checking for image look number */
+
+  double look_number = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "look_number", look_number ),
+    "Missing parameter: look_number" );
+  TEAGN_TRUE_OR_RETURN( look_number > 0,  "Invalid image look number" );
+
+  /* Checking for corr_coef parameter */
+
+  double corr_coef = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "corr_coef",
+    corr_coef ),
+    "Missing parameter: corr_coef" );
+  TEAGN_TRUE_OR_RETURN( ( corr_coef >= 0 ) && ( corr_coef <= 1 ),
+    "Invalid curr_coef" );
+
+  /* Checking photometric interpretation */
+  
+  for( unsigned int channel = 0 ; channel < channels.size() ; ++channel ) {
+    TEAGN_TRUE_OR_RETURN( ( 
+      ( inRaster->params().photometric_[ channel ] == 
+        TeRasterParams::TeRGB ) ||
+      ( inRaster->params().photometric_[ channel ] == 
+        TeRasterParams::TeMultiBand ) ),
+    "Invalid parameter - input_image (invalid photometric interpretation)" );
+  }    
+
+  return true;
+}
+
+
+bool TePDIRadarFrostFilter::RunImplementation()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+
+  TePDIFrostDetType det_type;
+  params_.GetParameter( "det_type", det_type );
+
+  double look_number = 0;
+  params_.GetParameter( "look_number", look_number );
+
+  double corr_coef;
+  params_.GetParameter( "corr_coef", corr_coef );
+
+  const unsigned int mask_width = 5;
+  /* fixed size - affects convolution weights matrix dimentions */
+
+  /* Setting the output raster */
+
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );  
+    
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
+
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );    
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  
+  TeRasterParams auxRasterParams = inRaster->params();
+  auxRasterParams.nBands( 1 );
+  auxRasterParams.setDataType( TeDOUBLE, -1 );
+  
+  if( iterations > 1  )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster1 ), "Unable to create auxiliary raster 1" );
+  }
+
+  if( iterations > 2 )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster2 ), "Unable to create auxiliary raster 1" );
+  }
+
+  /* Noise statistics */
+
+  double noise_deviation = 0;
+
+  if( det_type == TePDIFrostDTLinear ) {
+    noise_deviation = 0.522723008 / sqrt( look_number );
+  } else if( det_type == TePDIFrostDTQuadratic ) {
+    noise_deviation = 1.0 / sqrt( look_number );
+  }
+
+  const double noise_variance = noise_deviation * noise_deviation;
+  const double noise_variance_plus_one = noise_variance + 1.;
+
+  /* Setting the convolution buffer initial state */
+
+  const unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  const unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( mask_width, raster_columns );
+
+  /* Convolution Loop */
+
+  double output_level; /* the value generated by each pixel mask calcule */
+
+  const unsigned int mask_middle_off =
+    (unsigned int) floor( ((double)mask_width) / 2. );
+
+  const unsigned int conv_column_bound = raster_columns - mask_width + 1;
+  const unsigned int conv_line_bound = raster_lines - mask_width + 1;
+
+  unsigned int raster_line; /* mask top-left line */
+  unsigned int conv_buf_column; /* mask top-left column */
+
+  double channel_min_level;
+  double channel_max_level;
+
+  double mean = 0; /* for the current window covolution inside convolution 
+    buffer */
+  double variance = 0; /* for the current window convolution inside 
+    convolution buffer */
+  double mean_2 = 0;; /* mean ^ 2 */
+  double vx = 0;;
+  double H = 0;;
+  double m = 0;;
+  double m_cumulative = 0;;
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+
+  double mtab[ 33 ];
+
+  unsigned int mask_line;
+  unsigned int mask_column;
+
+  unsigned int dist_x;
+  unsigned int dist_y;
+  unsigned int dist_2;
+  int sourceChannel = 0;
+  int targetChannel = 0;  
+  
+  StartProgInt( "Frost filter", channels.size() * iterations * 
+    conv_line_bound );  
+
+  for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
+       ++channels_index ) 
+  {
+    for( int iteration = 0 ; iteration < iterations ; ++iteration ) 
+    {
+      /* Switching rasters */
+
+      if( iteration == 0 ) 
+      {
+        source_raster = inRaster;
+        sourceChannel = channels[ channels_index ];
+        
+        if( iterations > 1 )
+        {
+          target_raster = aux_raster1;
+          targetChannel = 0;
+        }
+        else
+        {
+          target_raster = outRaster;
+          targetChannel = channels_index;
+        }
+      }
+      else if( iteration == ( iterations - 1 ) )
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        target_raster = outRaster;
+        targetChannel = channels_index;
+      }
+      else 
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        if( target_raster == aux_raster1 )
+        {
+          target_raster = aux_raster2;
+        }
+        else
+        {
+          target_raster = aux_raster1;
+        }
+        targetChannel = 0;
+      }
+      
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+        target_raster, targetChannel, channel_min_level,
+        channel_max_level ), "Unable to get raster channel level bounds" );
+
+      /* Fills the convolution buffer with the first "mask_lines" from the raster */
+
+      for( unsigned int line = 0 ; line < ( mask_width - 1) ; ++line ) {
+        up_conv_buf( source_raster, line, sourceChannel );
+      }
+
+      /* window convolution over raster */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) +
+          ( iteration * conv_line_bound ) + raster_line ), 
+          "Canceled by the user" );
+
+        up_conv_buf( source_raster, raster_line + mask_width - 1,
+          sourceChannel );
+
+        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
+             ++conv_buf_column ) {
+
+          conv_buf_estatistics( 0, conv_buf_column, mask_width, mask_width, mean,
+            variance );
+
+          mean_2 = mean * mean;
+
+          vx = ( variance  - ( noise_variance *  mean_2 ) ) /
+               noise_variance_plus_one;
+
+          H = vx + mean_2;
+          if( H != 0 ) {
+            H = corr_coef + ( 2 * corr_coef * vx / noise_variance / H );
+          }
+          if( H <= 0 ) {
+            H = corr_coef;
+          }
+          H = sqrt( H );
+
+          /* Weights matrix creation */
+
+          mtab[0] = 1.;
+          mtab[1] = exp(-H * 1.);
+          mtab[2] = exp(-H * 1.414213562);
+          mtab[4] = exp(-H * 2.);
+          mtab[5] = exp(-H * 2.236067977);
+          mtab[8] = exp(-H * 2.828427125);
+          mtab[9] = exp(-H * 3.);
+          mtab[10] = exp(-H * 3.16227766);
+          mtab[13] = exp(-H * 3.605551276);
+          mtab[16] = exp(-H * 4.);
+          mtab[17] = exp(-H * 4.123105626);
+          mtab[18] = exp(-H * 4.242640687);
+          mtab[20] = exp(-H * 4.472135955);
+          mtab[25] = exp(-H * 5.);
+          mtab[32] = exp(-H * 5.65685425);
+
+          /* Mask Convolution */
+
+          output_level = 0;
+          m_cumulative = 0;
+
+          for( mask_line = 0 ; mask_line < mask_width ; ++mask_line ) {
+            dist_y = mask_line - mask_middle_off - mask_width;
+
+            for( mask_column = 0 ; mask_column < mask_width ; ++mask_column ) {
+              dist_x = mask_column - mask_middle_off - mask_width;
+
+              dist_2 = ( dist_y * dist_y ) + ( dist_x * dist_x );
+
+              if( ( dist_2 < 32 ) && ( mtab[ dist_2 ] != 0 ) ) {
+                m = m * mtab[ dist_2 ];
+              } else {
+                m = H;
+              }
+            }
+
+            output_level +=
+              m * conv_buf_[ mask_line ][ mask_column + conv_buf_column];
+            m_cumulative += m;
+          }
+
+          output_level = output_level / m_cumulative;
+
+
+          /* Level range filtering */
+
+          if( output_level < channel_min_level ) {
+            output_level = channel_min_level;
+          } else if( output_level > channel_max_level ) {
+            output_level = channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            conv_buf_column +  mask_middle_off,
+            raster_line +  mask_middle_off, output_level, targetChannel ),
+            "Pixel mapping error" );
+
+        }
+      }
+    }
+  }
+
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIRadarFrostFilter.hpp b/src/terralib/image_processing/TePDIRadarFrostFilter.hpp
old mode 100755
new mode 100644
index 65ffe7a..14c01db
--- a/src/terralib/image_processing/TePDIRadarFrostFilter.hpp
+++ b/src/terralib/image_processing/TePDIRadarFrostFilter.hpp
@@ -1,108 +1,108 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRADARFROSTFILTER_HPP
-  #define TEPDIRADARFROSTFILTER_HPP
-
-  #include "TePDIRadarFilter.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for radar Frost filter.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIFiltersGroup
-   *
-   * @note The general required parameters are:
-   *
-   * @param input_image (TePDITypes::TePDIRasterPtrType),
-   * @param output_image (TePDITypes::TePDIRasterPtrType),
-   * @param channels (std::vector<int>) - Band(s) to process. For
-   * @param iterations (int) - Iterations number,
-   * @param det_type (TePDIFrostDetType) - Detection type,
-   * @param look_number (double) - Image look number,
-   * @param corr_coef (double ) - The correlation coeficient
-   * for each convolution.
-   */
-  class PDI_DLL TePDIRadarFrostFilter : public TePDIRadarFilter{
-    public :
-      /** @typedef Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIRadarFrostFilter > pointer;
-      /** @typedef Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIRadarFrostFilter > const_pointer;
-
-      /**
-       * @enum Frost type.
-       */
-      enum TePDIFrostDetType{
-        /** Linear type */
-        TePDIFrostDTLinear = 1,
-        /** Quadratic type */
-        TePDIFrostDTQuadratic = 2
-      };
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIRadarFrostFilter();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRadarFrostFilter();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-  };
-  
-/** @example TePDIRadarFilters_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDIRADARFROSTFILTER_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRADARFROSTFILTER_HPP
+  #define TEPDIRADARFROSTFILTER_HPP
+
+  #include "TePDIRadarFilter.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the class for radar Frost filter.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIFiltersGroup
+   *
+   * @note The general required parameters are:
+   *
+   * @param input_image (TePDITypes::TePDIRasterPtrType),
+   * @param output_image (TePDITypes::TePDIRasterPtrType),
+   * @param channels (std::vector<int>) - Band(s) to process. For
+   * @param iterations (int) - Iterations number,
+   * @param det_type (TePDIFrostDetType) - Detection type,
+   * @param look_number (double) - Image look number,
+   * @param corr_coef (double ) - The correlation coeficient
+   * for each convolution.
+   */
+  class PDI_DLL TePDIRadarFrostFilter : public TePDIRadarFilter{
+    public :
+      /** @typedef Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIRadarFrostFilter > pointer;
+      /** @typedef Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIRadarFrostFilter > const_pointer;
+
+      /**
+       * @enum Frost type.
+       */
+      enum TePDIFrostDetType{
+        /** Linear type */
+        TePDIFrostDTLinear = 1,
+        /** Quadratic type */
+        TePDIFrostDTQuadratic = 2
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIRadarFrostFilter();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRadarFrostFilter();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+  };
+  
+/** @example TePDIRadarFilters_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDIRADARFROSTFILTER_HPP
diff --git a/src/terralib/image_processing/TePDIRadarFrostFilterFactory.cpp b/src/terralib/image_processing/TePDIRadarFrostFilterFactory.cpp
old mode 100755
new mode 100644
index dc1517d..3726b82
--- a/src/terralib/image_processing/TePDIRadarFrostFilterFactory.cpp
+++ b/src/terralib/image_processing/TePDIRadarFrostFilterFactory.cpp
@@ -1,24 +1,24 @@
- 
-#include "TePDIRadarFrostFilterFactory.hpp"
-#include "TePDIRadarFrostFilter.hpp"
-#include <TeAgnostic.h>
-
-TePDIRadarFrostFilterFactory::TePDIRadarFrostFilterFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIRadarFrostFilter" ) )
-{
-};      
-
-TePDIRadarFrostFilterFactory::~TePDIRadarFrostFilterFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIRadarFrostFilterFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIRadarFrostFilter();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIRadarFrostFilterFactory.hpp"
+#include "TePDIRadarFrostFilter.hpp"
+#include <TeAgnostic.h>
+
+TePDIRadarFrostFilterFactory::TePDIRadarFrostFilterFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIRadarFrostFilter" ) )
+{
+};      
+
+TePDIRadarFrostFilterFactory::~TePDIRadarFrostFilterFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIRadarFrostFilterFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIRadarFrostFilter();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIRadarFrostFilterFactory.hpp b/src/terralib/image_processing/TePDIRadarFrostFilterFactory.hpp
old mode 100755
new mode 100644
index 3bb27d6..54139fc
--- a/src/terralib/image_processing/TePDIRadarFrostFilterFactory.hpp
+++ b/src/terralib/image_processing/TePDIRadarFrostFilterFactory.hpp
@@ -1,67 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRADARFROSTFILTERFACTORY_HPP
-  #define TEPDIRADARFROSTFILTERFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for radar frost filter factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIRadarFrostFilterFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIRadarFrostFilterFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRadarFrostFilterFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIRadarFrostFilterFactory TePDIRadarFrostFilterFactory_instance;
-  };  
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRADARFROSTFILTERFACTORY_HPP
+  #define TEPDIRADARFROSTFILTERFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for radar frost filter factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIRadarFrostFilterFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIRadarFrostFilterFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRadarFrostFilterFactory();
+      
+      protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace {
+    static TePDIRadarFrostFilterFactory TePDIRadarFrostFilterFactory_instance;
+  };  
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIRadarGammaFilter.cpp b/src/terralib/image_processing/TePDIRadarGammaFilter.cpp
new file mode 100644
index 0000000..6977a9c
--- /dev/null
+++ b/src/terralib/image_processing/TePDIRadarGammaFilter.cpp
@@ -0,0 +1,394 @@
+#include "TePDIRadarGammaFilter.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+
+#include "math.h"
+
+TePDIRadarGammaFilter::TePDIRadarGammaFilter()
+{
+}
+
+
+TePDIRadarGammaFilter::~TePDIRadarGammaFilter()
+{
+}
+
+
+void TePDIRadarGammaFilter::ResetState( const TePDIParameters& params )
+{
+  TePDIRadarFilter::ResetState( params );
+}
+
+
+bool TePDIRadarGammaFilter::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking for general required parameters */
+
+  TePDITypes::TePDIRasterPtrType inRaster;
+  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: input_image" );
+    return false;
+  }
+  if( ! inRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
+    return false;
+  }
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: output_image" );
+    return false;
+  }
+  if( ! outRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeReadyToWrite ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
+    return false;
+  }
+
+  /* Filter type checking */
+  TePDIGammaFType filter_type;
+  if( ! parameters.GetParameter( "filter_type", filter_type ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: filter_type" );
+    return false;
+  }
+  if( ( filter_type != TePDIGammaFixedType ) &&
+      ( filter_type != TePDIGammaAdaptType ) ) {
+
+    TEAGN_LOGERR( "Invalid parameter: filter_type" );
+    return false;
+  }
+
+  /* channels parameter checking */
+
+  std::vector< int > channels;
+  if( ! parameters.GetParameter( "channels", channels ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: channels" );
+    return false;
+  }
+  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
+    if( channels[ index ] >= inRaster->nBands() ) {
+      TEAGN_LOGERR( "Invalid parameter: channels" );
+      return false;
+    }
+  }
+
+  /* Checking for number of iterations */
+
+  int iterations = 0;
+  if( ! parameters.GetParameter( "iterations", iterations ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: iterations" );
+    return false;
+  }
+  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
+
+  /* Checking for detection type parameter */
+
+  TePDIGammaDetType det_type;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "det_type", det_type ),
+    "Missing parameter: det_type" );
+  TEAGN_TRUE_OR_RETURN(
+    ( ( det_type == TePDIGammaDTLinear ) || ( det_type == TePDIGammaDTQuadratic ) ),
+    "Invalid detection type" );
+
+  /* Checking for image look number */
+
+  double look_number = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "look_number", look_number ),
+    "Missing parameter: look_number" );
+  TEAGN_TRUE_OR_RETURN( look_number > 0,  "Invalid image look number" );
+
+  /* Checking for detection type parameter */
+
+  int mask_width = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "mask_width", mask_width ),
+    "Missing parameter: mask_width" );
+  TEAGN_TRUE_OR_RETURN( ( ( mask_width > 2 ) && ( ( mask_width % 2 ) != 0 ) ),
+    "Invalid mask width" );
+  if( filter_type != TePDIGammaAdaptType ) {
+    TEAGN_TRUE_OR_RETURN( ( mask_width <=  (int)max_adapt_mask_width_ ),
+      "Invalid mask width" );
+  }
+
+  /* Checking photometric interpretation */
+  
+  for( unsigned int channel = 0 ; channel < channels.size() ; ++channel ) {
+    TEAGN_TRUE_OR_RETURN( ( 
+      ( inRaster->params().photometric_[ channel ] == 
+        TeRasterParams::TeRGB ) ||
+      ( inRaster->params().photometric_[ channel ] == 
+        TeRasterParams::TeMultiBand ) ),
+    "Invalid parameter - input_image (invalid photometric interpretation)" );
+  }      
+
+  return true;
+}
+
+
+bool TePDIRadarGammaFilter::RunImplementation()
+{
+  TePDIGammaFType filter_type;
+  params_.GetParameter( "filter_type", filter_type );
+
+  switch( filter_type ) {
+    case TePDIGammaFixedType :
+    {
+      return RunFixedImplementation();
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid algorithm type" );
+    }
+  }
+}
+
+bool TePDIRadarGammaFilter::RunFixedImplementation()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  int mask_width;
+  params_.GetParameter( "mask_width", mask_width );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+
+  TePDIGammaDetType det_type;
+  params_.GetParameter( "det_type", det_type );
+
+  double look_number = 0;
+  params_.GetParameter( "look_number", look_number );
+
+  /* Setting the output raster */
+
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );  
+    
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
+
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );         
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  
+  TeRasterParams auxRasterParams = inRaster->params();
+  auxRasterParams.nBands( 1 );
+  auxRasterParams.setDataType( TeDOUBLE, -1 );
+  
+  if( iterations > 1  )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster1 ), "Unable to create auxiliary raster 1" );
+  }
+
+  if( iterations > 2 )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster2 ), "Unable to create auxiliary raster 1" );
+  }
+
+  /* Noise statistics */
+
+  double noise_deviation = 0;
+
+  //if( det_type == TePDIGammaDTLinear ) {
+  //  noise_deviation = 0.522723008 / sqrt( look_number );
+  //} else if( det_type == TePDIGammaDTQuadratic ) {
+    noise_deviation = 1.0 / sqrt( look_number );
+  //}
+
+  const double noise_variance = noise_deviation * noise_deviation;
+
+  /* Setting the convolution buffer initial state */
+
+  const unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  const unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( mask_width, raster_columns );
+
+  /* Convolution Loop */
+
+  double output_level; /* the value generated by each pixel mask calcule */
+
+  unsigned int mask_middle_off_lines =
+    (unsigned int) floor( ((double)mask_width) / 2. );
+  unsigned int mask_middle_off_columns = mask_middle_off_lines;
+
+  unsigned int conv_column_bound = raster_columns - mask_width + 1;
+  unsigned int conv_line_bound = raster_lines - mask_width + 1;
+
+  unsigned int raster_line; /* mask top-left line */
+  unsigned int conv_buf_column; /* mask top-left column */
+
+  unsigned int current_pixel_column; /* raster reference for the current pixel being
+                                        processed */
+
+  double channel_min_level;
+  double channel_max_level;
+
+  double mean; /* for the current window covolution inside convolution buffer */
+  double variance; /* for the current window convolution inside convolution buffer */
+  int sourceChannel = 0;
+  int targetChannel = 0;  
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+  
+  StartProgInt( "Gamma fixed filter", channels.size() * iterations * 
+    conv_line_bound ); 
+
+  for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
+       ++channels_index ) 
+  {
+    for( int iteration = 0 ; (int)iteration < iterations ; 
+      ++iteration ) 
+    {
+      /* Switching rasters */
+
+      if( iteration == 0 ) 
+      {
+        source_raster = inRaster;
+        sourceChannel = channels[ channels_index ];
+        
+        if( iterations > 1 )
+        {
+          target_raster = aux_raster1;
+          targetChannel = 0;
+        }
+        else
+        {
+          target_raster = outRaster;
+          targetChannel = channels_index;
+        }
+      }
+      else if( iteration == ( iterations - 1 ) )
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        target_raster = outRaster;
+        targetChannel = channels_index;
+      }
+      else 
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        if( target_raster == aux_raster1 )
+        {
+          target_raster = aux_raster2;
+        }
+        else
+        {
+          target_raster = aux_raster1;
+        }
+        targetChannel = 0;
+      }
+      
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+        target_raster, targetChannel, channel_min_level,
+        channel_max_level ), "Unable to get raster channel level bounds" );      
+
+      /* Fills the convolution buffer with the first "mask_lines" from the raster */
+
+      for( int line = 0 ; line < ( mask_width - 1) ; ++line ) {
+        up_conv_buf( source_raster, line, sourceChannel );
+      }
+
+      /* window convolution over raster */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) +
+          ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+
+        up_conv_buf( source_raster, raster_line + mask_width - 1,
+          sourceChannel );
+
+        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
+             ++conv_buf_column ) 
+        {
+          current_pixel_column = conv_buf_column +  mask_middle_off_columns;
+
+          conv_buf_estatistics( 0, conv_buf_column, mask_width, mask_width, mean,
+            variance );
+
+		  double zval = conv_buf_[ mask_middle_off_lines ][ current_pixel_column ];
+
+		  double c = sqrt(2.0) * noise_deviation;
+		  double ci = sqrt(variance) / mean;
+
+		  if( ci <= noise_deviation ) {
+            output_level = mean;
+		  //} else if( ( noise_deviation < ci ) && ( ci < c ) ) {
+		  } else if( ( noise_deviation < ci ) && ( noise_deviation < c ) ) {
+			double alpha = ( 1 + noise_variance ) / ( ( ci * ci ) - noise_variance );
+			double b = alpha - look_number - 1;
+			double d = ( ( mean * mean ) * ( b * b ) ) + ( 4 * alpha * look_number * mean *
+			  zval );
+			
+			output_level = ( ( b * mean ) + sqrt( d ) ) / ( 2 * alpha );
+
+		  } else {
+			output_level = zval;
+		  }
+
+          /* Level range filtering */
+
+          if( output_level < channel_min_level ) {
+            output_level = channel_min_level;
+          } else if( output_level > channel_max_level ) {
+            output_level = channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            current_pixel_column,
+            raster_line +  mask_middle_off_lines, output_level, targetChannel ),
+            "Pixel mapping error" );
+        }
+      }
+    }
+  }
+
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIRadarGammaFilter.hpp b/src/terralib/image_processing/TePDIRadarGammaFilter.hpp
new file mode 100644
index 0000000..9fca9de
--- /dev/null
+++ b/src/terralib/image_processing/TePDIRadarGammaFilter.hpp
@@ -0,0 +1,125 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRADARGAMMAFILTER_HPP
+  #define TEPDIRADARGAMMAFILTER_HPP
+
+  #include "TePDIRadarFilter.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the class for radar Gamma filter.
+   * @author Fernanda Paiva Seidl <fernanda at dpi.inpe.br>
+   * @ingroup TePDIFiltersGroup
+   *
+   * @note The general required parameters are:
+   *
+   * @param filter_type ( TePDIGammaFType ),
+   * @param input_image (TePDITypes::TePDIRasterPtrType),
+   * @param output_image (TePDITypes::TePDIRasterPtrType),
+   * @param channels (std::vector<int>) - Band(s) to process. For
+   * @param iterations (int) - Iterations number,
+   * @param det_type (TePDIGammaDetType) - Detection type,
+   * @param look_number (double) - Image look number,
+   * @param mask_width (int) - Mask width
+   */
+  class PDI_DLL TePDIRadarGammaFilter : public TePDIRadarFilter{
+    public :
+      /** @typedef Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIRadarGammaFilter > pointer;
+      /** @typedef Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIRadarGammaFilter > const_pointer;
+
+      /**
+       * @enum Filter type.
+       */
+      enum TePDIGammaFType{
+        /** Fixed type */
+        TePDIGammaFixedType = 1,
+        /** Adaptative type */
+        TePDIGammaAdaptType = 2
+      };
+
+      /**
+       * @enum Detection type.
+       */      
+      enum TePDIGammaDetType{
+        /** Linear detection */
+        TePDIGammaDTLinear = 1,
+        /** Quadratic detection */
+        TePDIGammaDTQuadratic = 2
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIRadarGammaFilter();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRadarGammaFilter();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Runs the fixed window algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunFixedImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+
+  };
+  
+/** @example TePDIRadarFilters_test.cpp
+ *    Shows how to use this class.
+ */   
+
+#endif //TEPDIRADARGAMMAFILTER_HPP
diff --git a/src/terralib/image_processing/TePDIRadarKuanFilter.cpp b/src/terralib/image_processing/TePDIRadarKuanFilter.cpp
old mode 100755
new mode 100644
index 19588f8..af60dc8
--- a/src/terralib/image_processing/TePDIRadarKuanFilter.cpp
+++ b/src/terralib/image_processing/TePDIRadarKuanFilter.cpp
@@ -1,633 +1,707 @@
-#include "TePDIRadarKuanFilter.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-
-#include "math.h"
-
-TePDIRadarKuanFilter::TePDIRadarKuanFilter()
-{
-}
-
-
-TePDIRadarKuanFilter::~TePDIRadarKuanFilter()
-{
-}
-
-
-void TePDIRadarKuanFilter::ResetState( const TePDIParameters& params )
-{
-  TePDIRadarFilter::ResetState( params );
-}
-
-
-bool TePDIRadarKuanFilter::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking for general required parameters */
-
-  TePDITypes::TePDIRasterPtrType inRaster;
-  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: input_image" );
-    return false;
-  }
-  if( ! inRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
-    return false;
-  }
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: output_image" );
-    return false;
-  }
-  if( ! outRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeReadyToWrite ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
-    return false;
-  }
-
-  /* Filter type checking */
-  TePDIKuanFType filter_type;
-  if( ! parameters.GetParameter( "filter_type", filter_type ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: filter_type" );
-    return false;
-  }
-  if( ( filter_type != TePDIKuanFixedType ) &&
-      ( filter_type != TePDIKuanAdaptType ) ) {
-
-    TEAGN_LOGERR( "Invalid parameter: filter_type" );
-    return false;
-  }
-
-  /* channels parameter checking */
-
-  std::vector< int > channels;
-  if( ! parameters.GetParameter( "channels", channels ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: channels" );
-    return false;
-  }
-  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
-    if( channels[ index ] >= inRaster->nBands() ) {
-      TEAGN_LOGERR( "Invalid parameter: channels" );
-      return false;
-    }
-  }
-
-  /* Checking for number of iterations */
-
-  int iterations = 0;
-  if( ! parameters.GetParameter( "iterations", iterations ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: iterations" );
-    return false;
-  }
-  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
-
-  /* Checking for detection type parameter */
-
-  TePDIKuanDetType det_type;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "det_type", det_type ),
-    "Missing parameter: det_type" );
-  TEAGN_TRUE_OR_RETURN(
-    ( ( det_type == TePDIKuanDTLinear ) || ( det_type == TePDIKuanDTQuadratic ) ),
-    "Invalid detection type" );
-
-  /* Checking for image look number */
-
-  double look_number = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "look_number", look_number ),
-    "Missing parameter: look_number" );
-  TEAGN_TRUE_OR_RETURN( look_number > 0,  "Invalid image look number" );
-
-  /* Checking for detection type parameter */
-
-  int mask_width = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "mask_width", mask_width ),
-    "Missing parameter: mask_width" );
-  TEAGN_TRUE_OR_RETURN( ( ( mask_width > 2 ) && ( ( mask_width % 2 ) != 0 ) ),
-    "Invalid mask width" );
-  if( filter_type != TePDIKuanAdaptType ) {
-    TEAGN_TRUE_OR_RETURN( ( mask_width <=  (int)max_adapt_mask_width_ ),
-      "Invalid mask width" );
-  }
-
-  /* Checking for variance_threshold parameter */
-
-  double variance_threshold = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "variance_threshold",
-    variance_threshold ),
-    "Missing parameter: variance_threshold" );
-  TEAGN_TRUE_OR_RETURN( variance_threshold >= 0,
-    "Invalid variance_threshold" );
-
-  /* Checking photometric interpretation */
-  
-  for( unsigned int channel = 0 ; channel < channels.size() ; ++channel ) {
-    TEAGN_TRUE_OR_RETURN( ( 
-      ( inRaster->params().photometric_[ channel ] == 
-        TeRasterParams::TeRGB ) ||
-      ( inRaster->params().photometric_[ channel ] == 
-        TeRasterParams::TeMultiBand ) ),
-    "Invalid parameter - input_image (invalid photometric interpretation)" );
-  }      
-
-  return true;
-}
-
-
-bool TePDIRadarKuanFilter::RunImplementation()
-{
-  TePDIKuanFType filter_type;
-  params_.GetParameter( "filter_type", filter_type );
-
-  switch( filter_type ) {
-    case TePDIKuanFixedType :
-    {
-      return RunFixedImplementation();
-      break;
-    }
-    case TePDIKuanAdaptType :
-    {
-      return RunAdaptImplementation();
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_RETURN( "Invalid algorithm type" );
-    }
-  }
-}
-
-
-bool TePDIRadarKuanFilter::RunFixedImplementation()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  int mask_width;
-  params_.GetParameter( "mask_width", mask_width );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-
-  TePDIKuanDetType det_type;
-  params_.GetParameter( "det_type", det_type );
-
-  double look_number = 0;
-  params_.GetParameter( "look_number", look_number );
-
-  double variance_threshold;
-  params_.GetParameter( "variance_threshold", variance_threshold );
-
-  /* Setting the output raster */
-
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );  
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ );  
-    
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
-
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );         
-
-  /* Creating the temporary rasters with one band each */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, aux_raster1, 1,
-    false, false, TeDOUBLE ), "Unable to create auxiliary raster 1" );
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, aux_raster2, 1,
-    false, false, TeDOUBLE ), "Unable to create auxiliary raster 2" );
-
-  /* Noise statistics */
-
-  double noise_deviation = 0;
-
-  if( det_type == TePDIKuanDTLinear ) {
-    noise_deviation = 0.522723008 / sqrt( look_number );
-  } else if( det_type == TePDIKuanDTQuadratic ) {
-    noise_deviation = 1.0 / sqrt( look_number );
-  }
-
-  const double noise_variance = noise_deviation * noise_deviation;
-  const double noise_variance_plus_one = noise_variance + 1.;
-
-  /* Setting the convolution buffer initial state */
-
-  const unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  const unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  reset_conv_buf( mask_width, raster_columns );
-
-  /* Convolution Loop */
-
-  double output_level; /* the value generated by each pixel mask calcule */
-
-  unsigned int mask_middle_off_lines =
-    (unsigned int) floor( ((double)mask_width) / 2. );
-  unsigned int mask_middle_off_columns = mask_middle_off_lines;
-
-  unsigned int conv_column_bound = raster_columns - mask_width + 1;
-  unsigned int conv_line_bound = raster_lines - mask_width + 1;
-
-  unsigned int raster_line; /* mask top-left line */
-  unsigned int conv_buf_column; /* mask top-left column */
-
-  unsigned int current_pixel_column; /* raster reference for the current pixel being
-                                        processed */
-
-  double channel_min_level;
-  double channel_max_level;
-
-  double mean; /* for the current window covolution inside convolution buffer */
-  double variance; /* for the current window convolution inside convolution buffer */
-  double mean_2; /* mean ^ 2 */
-  double relation_top;
-  double relation_bottom;
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-  
-  StartProgInt( "Kuan fixed filter", channels.size() * iterations * 
-    conv_line_bound ); 
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-
-    TEAGN_TRUE_OR_THROW(
-      TePDIUtils::TeCopyRasterPixels( inRaster, channels[ channels_index ],
-      aux_raster1, 0, false, false ), "Auxiliar Raster fill error" );
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels[ channels_index ], channel_min_level,
-      channel_max_level ), "Unable to get raster channel level bounds" );
-
-    for( unsigned int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-      /* Switching from input and output raster for more than 1 iteration */
-
-      if( iteration % 2 == 0 ) {
-        source_raster = aux_raster1;
-        target_raster = aux_raster2;
-      } else {
-        source_raster = aux_raster2;
-        target_raster = aux_raster1;
-      }
-
-      /* Fills the convolution buffer with the first "mask_lines" from the raster */
-
-      for( int line = 0 ; line < ( mask_width - 1) ; ++line ) {
-        up_conv_buf( source_raster, line, 0 );
-      }
-
-      /* window convolution over raster */
-
-      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-        
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
-          conv_line_bound ) +
-          ( iteration * conv_line_bound ) + raster_line ),
-          "Canceled by the user" );
-
-        up_conv_buf( source_raster, raster_line + mask_width - 1,
-          channels_index );
-
-        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
-             ++conv_buf_column ) {
-
-          current_pixel_column = conv_buf_column +  mask_middle_off_columns;
-
-          conv_buf_estatistics( 0, conv_buf_column, mask_width, mask_width, mean,
-            variance );
-
-          if( variance < 0 ) {
-            output_level = mean;
-          } else {
-            mean_2 = mean * mean;
-            relation_top = variance  - ( noise_variance *  mean_2 );
-            relation_bottom = variance * noise_variance_plus_one;
-
-            if( relation_top < 0 ) {
-              output_level = mean;
-            } else {
-              output_level =
-                conv_buf_[ mask_middle_off_lines ][ current_pixel_column ];
-
-              if( ( mean != 0 ) &&
-                  ( relation_bottom != 0 ) &&
-                  ( ( variance / mean_2 ) < variance_threshold ) ) {
-
-                output_level = mean + ( ( relation_top / relation_bottom ) *
-                  ( output_level - mean ) );
-              }
-            }
-          }
-
-          /* Level range filtering */
-
-          if( output_level < channel_min_level ) {
-            output_level = channel_min_level;
-          } else if( output_level > channel_max_level ) {
-            output_level = channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            current_pixel_column,
-            raster_line +  mask_middle_off_lines, output_level, 0 ),
-            "Pixel mapping error" );
-        }
-      }
-    }
-
-    /* Content copy from the target raster to the output raster */
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeCopyRasterPixels( target_raster, 0,
-      outRaster, channels_index, false, false ), "Output raster fill error" );
-  }
-
-  return true;
-}
-
-
-bool TePDIRadarKuanFilter::RunAdaptImplementation()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  int initial_mask_width;
-  params_.GetParameter( "mask_width", initial_mask_width );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-
-  TePDIKuanDetType det_type;
-  params_.GetParameter( "det_type", det_type );
-
-  double look_number = 0;
-  params_.GetParameter( "look_number", look_number );
-
-  double variance_threshold;
-  params_.GetParameter( "variance_threshold", variance_threshold );
-
-  /* Setting the output raster */
-  
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );  
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ );  
-    
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
-
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );  
-
-  const unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  const unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  /* Creating the temporary rasters with one band each */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, aux_raster1, 1,
-    false, false, TeDOUBLE ), "Unable to create auxiliary raster 1" );
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, aux_raster2, 1,
-    false, false, TeDOUBLE ), "Unable to create auxiliary raster 2" );
-
-  /* Noise statistics */
-
-  double noise_deviation = 0;
-
-  if( det_type == TePDIKuanDTLinear ) {
-    noise_deviation = 0.522723008 / sqrt( look_number );
-  } else if( det_type == TePDIKuanDTQuadratic ) {
-    noise_deviation = 1.0 / sqrt( look_number );
-  }
-
-  const double noise_variance = noise_deviation * noise_deviation;
-  const double noise_variance_plus_one = noise_variance + 1.;
-
-  /* Setting the convolution buffer initial state */
-
-  reset_conv_buf( max_adapt_mask_width_, raster_columns );
-
-  /* Convolution Loop */
-
-  double output_level; /* the value generated by each pixel mask calcule */
-
-  const unsigned int initial_mask_middle_off =
-    (unsigned int) floor( ((double)initial_mask_width) / 2. );
-
-  const unsigned int buf_middle_line_off =
-    (unsigned int)floor( ((double)max_adapt_mask_width_)  / 2. );
-  const unsigned int buf_init_fill_lines = buf_middle_line_off +
-    initial_mask_middle_off;
-
-  const unsigned int conv_init_line = (unsigned int)
-    floor( (double)max_adapt_mask_width_ / 2. );
-  const unsigned int conv_init_column = conv_init_line;
-  const unsigned int conv_column_bound = raster_columns - conv_init_column;
-  const unsigned int conv_line_bound = raster_lines - conv_init_line;
-
-  unsigned int raster_line; /* currente pixel being processed line */
-  unsigned int raster_column; /* currente pixel being processed column */
-
-  double channel_min_level;
-  double channel_max_level;
-
-  double mean; /* for the current window covolution inside convolution buffer */
-  double mean_2; // mean * mean
-  double variance; /* for the current window convolution inside convolution buffer */
-  double relation;
-  double relation_top;
-  double relation_bottom;
-
-  unsigned int new_mask_width;  /* the widht of the adapted mask */
-  unsigned int new_mask_middle_off; /* the middle offset of the adapted mask */
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-  
-  StartProgInt( "Kuan adaptative filter", channels.size() * iterations * 
-    conv_line_bound );   
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-
-    TEAGN_TRUE_OR_THROW(
-      TePDIUtils::TeCopyRasterPixels( inRaster, channels[ channels_index ],
-      aux_raster1, 0, false, false ), "Auxiliar Raster fill error" );
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels[ channels_index ], channel_min_level,
-      channel_max_level ), "Unable to get raster channel level bounds" );
-
-    for( unsigned int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-      /* Switching from input and output raster for more than 1 iteration */
-
-      if( iteration % 2 == 0 ) {
-        source_raster = aux_raster1;
-        target_raster = aux_raster2;
-      } else {
-        source_raster = aux_raster2;
-        target_raster = aux_raster1;
-      }
-
-      /* Fills the convolution buffer to cover all positions of the mask
-         always centered at buffer middle line */
-
-      for( unsigned int line = 0 ; line < buf_init_fill_lines ; ++line ) {
-        up_conv_buf( source_raster, line, 0 );
-      }
-
-      /* window convolution over raster */
-
-      for( raster_line = conv_init_line ; raster_line < conv_line_bound ;
-             ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-        
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
-          conv_line_bound ) +
-          ( iteration * conv_line_bound ) + raster_line ),
-          "Canceled by the user" );
-
-        up_conv_buf( source_raster, raster_line + initial_mask_middle_off,
-          channels_index );
-
-        for( raster_column = conv_init_column ; raster_column < conv_column_bound ;
-             ++raster_column ) {
-
-          conv_buf_estatistics( buf_middle_line_off - initial_mask_middle_off,
-            raster_column - initial_mask_middle_off,
-            (unsigned int)initial_mask_width,
-            (unsigned int)initial_mask_width, mean, variance );
-
-          mean_2 = mean * mean;
-
-          if( variance <= 0 ) {
-            output_level = mean;
-          } else {
-            /* Mask size adptation */
-
-            relation = ( 1. - ( mean_2 * ( noise_variance / variance ) ) ) /
-                      noise_variance_plus_one;
-
-            if( relation < 0.2 ) {
-              new_mask_width = 9;
-              new_mask_middle_off = 4;
-            } else if( relation < 0.4 ) {
-              new_mask_width = 7;
-              new_mask_middle_off = 3;
-            } else if( relation < 0.7 ) {
-              new_mask_width = 5;
-              new_mask_middle_off = 2;
-            } else if( relation < 0.9 ) {
-              new_mask_width = 3;
-              new_mask_middle_off = 1;
-            } else { // relation >= 0.9
-              new_mask_width = 1;
-              new_mask_middle_off = 0;
-            }
-
-            /* Pixel value calcule */
-
-            if( new_mask_width == 1 ) {
-              output_level = conv_buf_[ buf_middle_line_off ][ raster_column ];
-            } else {
-              if( (int)new_mask_width != initial_mask_width ) {
-                conv_buf_estatistics( buf_middle_line_off - new_mask_middle_off,
-                  raster_column - new_mask_middle_off, new_mask_width, new_mask_width,
-                  mean, variance );
-
-                mean_2 = mean * mean;
-              }
-
-              relation_top = variance - ( noise_variance * mean_2 );
-              relation_bottom = variance * noise_variance_plus_one;
-
-              if( ( relation_top < 0 ) || ( relation_bottom == 0 ) ) {
-                output_level = mean;
-              } else {
-                if( ( mean != 0 ) &&
-                    ( ( variance / mean_2 ) < variance_threshold ) ) {
-
-                  output_level = mean + ( ( relation_top / relation_bottom ) *
-                    ( conv_buf_[ buf_middle_line_off ][ raster_column ] - mean ) );
-                } else {
-                  output_level = conv_buf_[ buf_middle_line_off ][ raster_column ];
-                }
-              }
-            }
-          }
-
-          /* Level range filtering */
-
-          if( output_level < channel_min_level ) {
-            output_level = channel_min_level;
-          } else if( output_level > channel_max_level ) {
-            output_level = channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            raster_column, raster_line, output_level, 0 ),
-            "Pixel mapping error" );
-        }
-      }
-    }
-
-    /* Content copy from the target raster to the output raster */
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeCopyRasterPixels( target_raster, 0,
-      outRaster, channels_index, false, false ), "Output raster fill error" );
-  }
-
-  return true;
-}
+#include "TePDIRadarKuanFilter.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+
+#include "math.h"
+
+TePDIRadarKuanFilter::TePDIRadarKuanFilter()
+{
+}
+
+
+TePDIRadarKuanFilter::~TePDIRadarKuanFilter()
+{
+}
+
+
+void TePDIRadarKuanFilter::ResetState( const TePDIParameters& params )
+{
+  TePDIRadarFilter::ResetState( params );
+}
+
+
+bool TePDIRadarKuanFilter::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking for general required parameters */
+
+  TePDITypes::TePDIRasterPtrType inRaster;
+  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: input_image" );
+    return false;
+  }
+  if( ! inRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
+    return false;
+  }
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: output_image" );
+    return false;
+  }
+  if( ! outRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeReadyToWrite ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
+    return false;
+  }
+
+  /* Filter type checking */
+  TePDIKuanFType filter_type;
+  if( ! parameters.GetParameter( "filter_type", filter_type ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: filter_type" );
+    return false;
+  }
+  if( ( filter_type != TePDIKuanFixedType ) &&
+      ( filter_type != TePDIKuanAdaptType ) ) {
+
+    TEAGN_LOGERR( "Invalid parameter: filter_type" );
+    return false;
+  }
+
+  /* channels parameter checking */
+
+  std::vector< int > channels;
+  if( ! parameters.GetParameter( "channels", channels ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: channels" );
+    return false;
+  }
+  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
+    if( channels[ index ] >= inRaster->nBands() ) {
+      TEAGN_LOGERR( "Invalid parameter: channels" );
+      return false;
+    }
+  }
+
+  /* Checking for number of iterations */
+
+  int iterations = 0;
+  if( ! parameters.GetParameter( "iterations", iterations ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: iterations" );
+    return false;
+  }
+  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
+
+  /* Checking for detection type parameter */
+
+  TePDIKuanDetType det_type;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "det_type", det_type ),
+    "Missing parameter: det_type" );
+  TEAGN_TRUE_OR_RETURN(
+    ( ( det_type == TePDIKuanDTLinear ) || ( det_type == TePDIKuanDTQuadratic ) ),
+    "Invalid detection type" );
+
+  /* Checking for image look number */
+
+  double look_number = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "look_number", look_number ),
+    "Missing parameter: look_number" );
+  TEAGN_TRUE_OR_RETURN( look_number > 0,  "Invalid image look number" );
+
+  /* Checking for detection type parameter */
+
+  int mask_width = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "mask_width", mask_width ),
+    "Missing parameter: mask_width" );
+  TEAGN_TRUE_OR_RETURN( ( ( mask_width > 2 ) && ( ( mask_width % 2 ) != 0 ) ),
+    "Invalid mask width" );
+  if( filter_type != TePDIKuanAdaptType ) {
+    TEAGN_TRUE_OR_RETURN( ( mask_width <=  (int)max_adapt_mask_width_ ),
+      "Invalid mask width" );
+  }
+
+  /* Checking for variance_threshold parameter */
+
+  double variance_threshold = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "variance_threshold",
+    variance_threshold ),
+    "Missing parameter: variance_threshold" );
+  TEAGN_TRUE_OR_RETURN( variance_threshold >= 0,
+    "Invalid variance_threshold" );
+
+  /* Checking photometric interpretation */
+  
+  for( unsigned int channel = 0 ; channel < channels.size() ; ++channel ) {
+    TEAGN_TRUE_OR_RETURN( ( 
+      ( inRaster->params().photometric_[ channel ] == 
+        TeRasterParams::TeRGB ) ||
+      ( inRaster->params().photometric_[ channel ] == 
+        TeRasterParams::TeMultiBand ) ),
+    "Invalid parameter - input_image (invalid photometric interpretation)" );
+  }      
+
+  return true;
+}
+
+
+bool TePDIRadarKuanFilter::RunImplementation()
+{
+  TePDIKuanFType filter_type;
+  params_.GetParameter( "filter_type", filter_type );
+
+  switch( filter_type ) {
+    case TePDIKuanFixedType :
+    {
+      return RunFixedImplementation();
+      break;
+    }
+    case TePDIKuanAdaptType :
+    {
+      return RunAdaptImplementation();
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid algorithm type" );
+    }
+  }
+}
+
+
+bool TePDIRadarKuanFilter::RunFixedImplementation()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  int mask_width;
+  params_.GetParameter( "mask_width", mask_width );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+
+  TePDIKuanDetType det_type;
+  params_.GetParameter( "det_type", det_type );
+
+  double look_number = 0;
+  params_.GetParameter( "look_number", look_number );
+
+  double variance_threshold;
+  params_.GetParameter( "variance_threshold", variance_threshold );
+
+  /* Setting the output raster */
+
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );  
+    
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
+
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );         
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  
+  TeRasterParams auxRasterParams = inRaster->params();
+  auxRasterParams.nBands( 1 );
+  auxRasterParams.setDataType( TeDOUBLE, -1 );
+  
+  if( iterations > 1  )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster1 ), "Unable to create auxiliary raster 1" );
+  }
+
+  if( iterations > 2 )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster2 ), "Unable to create auxiliary raster 1" );
+  }
+
+  /* Noise statistics */
+
+  double noise_deviation = 0;
+
+  if( det_type == TePDIKuanDTLinear ) {
+    noise_deviation = 0.522723008 / sqrt( look_number );
+  } else if( det_type == TePDIKuanDTQuadratic ) {
+    noise_deviation = 1.0 / sqrt( look_number );
+  }
+
+  const double noise_variance = noise_deviation * noise_deviation;
+  const double noise_variance_plus_one = noise_variance + 1.;
+
+  /* Setting the convolution buffer initial state */
+
+  const unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  const unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( mask_width, raster_columns );
+
+  /* Convolution Loop */
+
+  double output_level; /* the value generated by each pixel mask calcule */
+
+  unsigned int mask_middle_off_lines =
+    (unsigned int) floor( ((double)mask_width) / 2. );
+  unsigned int mask_middle_off_columns = mask_middle_off_lines;
+
+  unsigned int conv_column_bound = raster_columns - mask_width + 1;
+  unsigned int conv_line_bound = raster_lines - mask_width + 1;
+
+  unsigned int raster_line; /* mask top-left line */
+  unsigned int conv_buf_column; /* mask top-left column */
+
+  unsigned int current_pixel_column; /* raster reference for the current pixel being
+                                        processed */
+
+  double channel_min_level;
+  double channel_max_level;
+
+  double mean; /* for the current window covolution inside convolution buffer */
+  double variance; /* for the current window convolution inside convolution buffer */
+  double mean_2; /* mean ^ 2 */
+  double relation_top;
+  double relation_bottom;
+  int sourceChannel = 0;
+  int targetChannel = 0;  
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+  
+  StartProgInt( "Kuan fixed filter", channels.size() * iterations * 
+    conv_line_bound ); 
+
+  for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
+       ++channels_index ) 
+  {
+    for( int iteration = 0 ; (int)iteration < iterations ; 
+      ++iteration ) 
+    {
+      /* Switching rasters */
+
+      if( iteration == 0 ) 
+      {
+        source_raster = inRaster;
+        sourceChannel = channels[ channels_index ];
+        
+        if( iterations > 1 )
+        {
+          target_raster = aux_raster1;
+          targetChannel = 0;
+        }
+        else
+        {
+          target_raster = outRaster;
+          targetChannel = channels_index;
+        }
+      }
+      else if( iteration == ( iterations - 1 ) )
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        target_raster = outRaster;
+        targetChannel = channels_index;
+      }
+      else 
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        if( target_raster == aux_raster1 )
+        {
+          target_raster = aux_raster2;
+        }
+        else
+        {
+          target_raster = aux_raster1;
+        }
+        targetChannel = 0;
+      }
+      
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+        target_raster, targetChannel, channel_min_level,
+        channel_max_level ), "Unable to get raster channel level bounds" );      
+
+      /* Fills the convolution buffer with the first "mask_lines" from the raster */
+
+      for( int line = 0 ; line < ( mask_width - 1) ; ++line ) {
+        up_conv_buf( source_raster, line, sourceChannel );
+      }
+
+      /* window convolution over raster */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) +
+          ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+
+        up_conv_buf( source_raster, raster_line + mask_width - 1,
+          sourceChannel );
+
+        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
+             ++conv_buf_column ) 
+        {
+
+          current_pixel_column = conv_buf_column +  mask_middle_off_columns;
+
+          conv_buf_estatistics( 0, conv_buf_column, mask_width, mask_width, mean,
+            variance );
+
+          if( variance < 0 ) {
+            output_level = mean;
+          } else {
+            mean_2 = mean * mean;
+            relation_top = variance  - ( noise_variance *  mean_2 );
+            relation_bottom = variance * noise_variance_plus_one;
+
+            if( relation_top < 0 ) {
+              output_level = mean;
+            } else {
+              output_level =
+                conv_buf_[ mask_middle_off_lines ][ current_pixel_column ];
+
+              if( ( mean != 0 ) &&
+                  ( relation_bottom != 0 ) &&
+                  ( ( variance / mean_2 ) < variance_threshold ) ) {
+
+                output_level = mean + ( ( relation_top / relation_bottom ) *
+                  ( output_level - mean ) );
+              }
+            }
+          }
+
+          /* Level range filtering */
+
+          if( output_level < channel_min_level ) {
+            output_level = channel_min_level;
+          } else if( output_level > channel_max_level ) {
+            output_level = channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            current_pixel_column,
+            raster_line +  mask_middle_off_lines, output_level, targetChannel ),
+            "Pixel mapping error" );
+        }
+      }
+    }
+  }
+
+  return true;
+}
+
+
+bool TePDIRadarKuanFilter::RunAdaptImplementation()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  int initial_mask_width;
+  params_.GetParameter( "mask_width", initial_mask_width );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+
+  TePDIKuanDetType det_type;
+  params_.GetParameter( "det_type", det_type );
+
+  double look_number = 0;
+  params_.GetParameter( "look_number", look_number );
+
+  double variance_threshold;
+  params_.GetParameter( "variance_threshold", variance_threshold );
+
+  /* Setting the output raster */
+  
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );  
+    
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 ); 
+
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );  
+
+  const unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  const unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  
+  TeRasterParams auxRasterParams = inRaster->params();
+  auxRasterParams.nBands( 1 );
+  auxRasterParams.setDataType( TeDOUBLE, -1 );
+  
+  if( iterations > 1  )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster1 ), "Unable to create auxiliary raster 1" );
+  }
+
+  if( iterations > 2 )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster2 ), "Unable to create auxiliary raster 1" );
+  }
+
+  /* Noise statistics */
+
+  double noise_deviation = 0;
+
+  if( det_type == TePDIKuanDTLinear ) {
+    noise_deviation = 0.522723008 / sqrt( look_number );
+  } else if( det_type == TePDIKuanDTQuadratic ) {
+    noise_deviation = 1.0 / sqrt( look_number );
+  }
+
+  const double noise_variance = noise_deviation * noise_deviation;
+  const double noise_variance_plus_one = noise_variance + 1.;
+
+  /* Setting the convolution buffer initial state */
+
+  reset_conv_buf( max_adapt_mask_width_, raster_columns );
+
+  /* Convolution Loop */
+
+  double output_level; /* the value generated by each pixel mask calcule */
+
+  const unsigned int initial_mask_middle_off =
+    (unsigned int) floor( ((double)initial_mask_width) / 2. );
+
+  const unsigned int buf_middle_line_off =
+    (unsigned int)floor( ((double)max_adapt_mask_width_)  / 2. );
+  const unsigned int buf_init_fill_lines = buf_middle_line_off +
+    initial_mask_middle_off;
+
+  const unsigned int conv_init_line = (unsigned int)
+    floor( (double)max_adapt_mask_width_ / 2. );
+  const unsigned int conv_init_column = conv_init_line;
+  const unsigned int conv_column_bound = raster_columns - conv_init_column;
+  const unsigned int conv_line_bound = raster_lines - conv_init_line;
+
+  unsigned int raster_line; /* currente pixel being processed line */
+  unsigned int raster_column; /* currente pixel being processed column */
+
+  double channel_min_level;
+  double channel_max_level;
+
+  double mean; /* for the current window covolution inside convolution buffer */
+  double mean_2; // mean * mean
+  double variance; /* for the current window convolution inside convolution buffer */
+  double relation;
+  double relation_top;
+  double relation_bottom;
+  int sourceChannel = 0;
+  int targetChannel = 0;  
+
+  unsigned int new_mask_width;  /* the widht of the adapted mask */
+  unsigned int new_mask_middle_off; /* the middle offset of the adapted mask */
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+  
+  StartProgInt( "Kuan adaptative filter", channels.size() * iterations * 
+    conv_line_bound );   
+
+  for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
+       ++channels_index ) 
+  {
+    for( int iteration = 0 ; (int)iteration < iterations ; ++iteration ) 
+    {
+      /* Switching rasters */
+
+      if( iteration == 0 ) 
+      {
+        source_raster = inRaster;
+        sourceChannel = channels[ channels_index ];
+        
+        if( iterations > 1 )
+        {
+          target_raster = aux_raster1;
+          targetChannel = 0;
+        }
+        else
+        {
+          target_raster = outRaster;
+          targetChannel = channels_index;
+        }
+      }
+      else if( iteration == ( iterations - 1 ) )
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        target_raster = outRaster;
+        targetChannel = channels_index;
+      }
+      else 
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        if( target_raster == aux_raster1 )
+        {
+          target_raster = aux_raster2;
+        }
+        else
+        {
+          target_raster = aux_raster1;
+        }
+        targetChannel = 0;
+      }
+      
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+        target_raster, targetChannel, channel_min_level,
+        channel_max_level ), "Unable to get raster channel level bounds" );
+
+      /* Fills the convolution buffer to cover all positions of the mask
+         always centered at buffer middle line */
+
+      for( unsigned int line = 0 ; line < buf_init_fill_lines ; ++line ) {
+        up_conv_buf( source_raster, line, sourceChannel );
+      }
+
+      /* window convolution over raster */
+
+      for( raster_line = conv_init_line ; raster_line < conv_line_bound ;
+             ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) +
+          ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+
+        up_conv_buf( source_raster, raster_line + initial_mask_middle_off,
+          sourceChannel );
+
+        for( raster_column = conv_init_column ; raster_column < conv_column_bound ;
+             ++raster_column ) {
+
+          conv_buf_estatistics( buf_middle_line_off - initial_mask_middle_off,
+            raster_column - initial_mask_middle_off,
+            (unsigned int)initial_mask_width,
+            (unsigned int)initial_mask_width, mean, variance );
+
+          mean_2 = mean * mean;
+
+          if( variance <= 0 ) {
+            output_level = mean;
+          } else {
+            /* Mask size adptation */
+
+            relation = ( 1. - ( mean_2 * ( noise_variance / variance ) ) ) /
+                      noise_variance_plus_one;
+
+            if( relation < 0.2 ) {
+              new_mask_width = 9;
+              new_mask_middle_off = 4;
+            } else if( relation < 0.4 ) {
+              new_mask_width = 7;
+              new_mask_middle_off = 3;
+            } else if( relation < 0.7 ) {
+              new_mask_width = 5;
+              new_mask_middle_off = 2;
+            } else if( relation < 0.9 ) {
+              new_mask_width = 3;
+              new_mask_middle_off = 1;
+            } else { // relation >= 0.9
+              new_mask_width = 1;
+              new_mask_middle_off = 0;
+            }
+
+            /* Pixel value calcule */
+
+            if( new_mask_width == 1 ) {
+              output_level = conv_buf_[ buf_middle_line_off ][ raster_column ];
+            } else {
+              if( (int)new_mask_width != initial_mask_width ) {
+                conv_buf_estatistics( buf_middle_line_off - new_mask_middle_off,
+                  raster_column - new_mask_middle_off, new_mask_width, new_mask_width,
+                  mean, variance );
+
+                mean_2 = mean * mean;
+              }
+
+              relation_top = variance - ( noise_variance * mean_2 );
+              relation_bottom = variance * noise_variance_plus_one;
+
+              if( ( relation_top < 0 ) || ( relation_bottom == 0 ) ) {
+                output_level = mean;
+              } else {
+                if( ( mean != 0 ) &&
+                    ( ( variance / mean_2 ) < variance_threshold ) ) {
+
+                  output_level = mean + ( ( relation_top / relation_bottom ) *
+                    ( conv_buf_[ buf_middle_line_off ][ raster_column ] - mean ) );
+                } else {
+                  output_level = conv_buf_[ buf_middle_line_off ][ raster_column ];
+                }
+              }
+            }
+          }
+
+          /* Level range filtering */
+
+          if( output_level < channel_min_level ) {
+            output_level = channel_min_level;
+          } else if( output_level > channel_max_level ) {
+            output_level = channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            raster_column, raster_line, output_level, targetChannel ),
+            "Pixel mapping error" );
+        }
+      }
+    }
+  }
+
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIRadarKuanFilter.hpp b/src/terralib/image_processing/TePDIRadarKuanFilter.hpp
old mode 100755
new mode 100644
index a595aff..ae5c825
--- a/src/terralib/image_processing/TePDIRadarKuanFilter.hpp
+++ b/src/terralib/image_processing/TePDIRadarKuanFilter.hpp
@@ -1,134 +1,134 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRADARKUANFILTER_HPP
-  #define TEPDIRADARKUANFILTER_HPP
-
-  #include "TePDIRadarFilter.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for radar Kuan filter.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIFiltersGroup
-   *
-   * @note The general required parameters are:
-   *
-   * @param filter_type ( TePDIKuanFType ),
-   * @param input_image (TePDITypes::TePDIRasterPtrType),
-   * @param output_image (TePDITypes::TePDIRasterPtrType),
-   * @param channels (std::vector<int>) - Band(s) to process. For
-   * @param iterations (int) - Iterations number,
-   * @param det_type (TePDIKuanDetType) - Detection type,
-   * @param look_number (double) - Image look number,
-   * @param mask_width (int) - Mask width,
-   * @param variance_threshold (double - optional ) - The noise variance threshold
-   * for each convolution.
-   */
-  class PDI_DLL TePDIRadarKuanFilter : public TePDIRadarFilter{
-    public :
-      /** @typedef Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIRadarKuanFilter > pointer;
-      /** @typedef Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIRadarKuanFilter > const_pointer;
-
-      /**
-       * @enum Filter type.
-       */
-      enum TePDIKuanFType{
-        /** Fixed type */
-        TePDIKuanFixedType = 1,
-        /** Adaptative type */
-        TePDIKuanAdaptType = 2
-      };
-
-      /**
-       * @enum Detection type.
-       */      
-      enum TePDIKuanDetType{
-        /** Linear detection */
-        TePDIKuanDTLinear = 1,
-        /** Quadratic detection */
-        TePDIKuanDTQuadratic = 2
-      };
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIRadarKuanFilter();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRadarKuanFilter();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Runs the fixed window algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunFixedImplementation();
-
-      /**
-       * @brief Runs the adaptative window algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunAdaptImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-
-  };
-  
-/** @example TePDIRadarFilters_test.cpp
- *    Shows how to use this class.
- */   
-
-#endif //TEPDIRADARKUANFILTER_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRADARKUANFILTER_HPP
+  #define TEPDIRADARKUANFILTER_HPP
+
+  #include "TePDIRadarFilter.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the class for radar Kuan filter.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIFiltersGroup
+   *
+   * @note The general required parameters are:
+   *
+   * @param filter_type ( TePDIKuanFType ),
+   * @param input_image (TePDITypes::TePDIRasterPtrType),
+   * @param output_image (TePDITypes::TePDIRasterPtrType),
+   * @param channels (std::vector<int>) - Band(s) to process. For
+   * @param iterations (int) - Iterations number,
+   * @param det_type (TePDIKuanDetType) - Detection type,
+   * @param look_number (double) - Image look number,
+   * @param mask_width (int) - Mask width,
+   * @param variance_threshold (double - optional ) - The noise variance threshold
+   * for each convolution.
+   */
+  class PDI_DLL TePDIRadarKuanFilter : public TePDIRadarFilter{
+    public :
+      /** @typedef Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIRadarKuanFilter > pointer;
+      /** @typedef Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIRadarKuanFilter > const_pointer;
+
+      /**
+       * @enum Filter type.
+       */
+      enum TePDIKuanFType{
+        /** Fixed type */
+        TePDIKuanFixedType = 1,
+        /** Adaptative type */
+        TePDIKuanAdaptType = 2
+      };
+
+      /**
+       * @enum Detection type.
+       */      
+      enum TePDIKuanDetType{
+        /** Linear detection */
+        TePDIKuanDTLinear = 1,
+        /** Quadratic detection */
+        TePDIKuanDTQuadratic = 2
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIRadarKuanFilter();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRadarKuanFilter();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Runs the fixed window algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunFixedImplementation();
+
+      /**
+       * @brief Runs the adaptative window algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunAdaptImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+
+  };
+  
+/** @example TePDIRadarFilters_test.cpp
+ *    Shows how to use this class.
+ */   
+
+#endif //TEPDIRADARKUANFILTER_HPP
diff --git a/src/terralib/image_processing/TePDIRadarKuanFilterFactory.cpp b/src/terralib/image_processing/TePDIRadarKuanFilterFactory.cpp
old mode 100755
new mode 100644
index 5db7685..3dcdb82
--- a/src/terralib/image_processing/TePDIRadarKuanFilterFactory.cpp
+++ b/src/terralib/image_processing/TePDIRadarKuanFilterFactory.cpp
@@ -1,24 +1,24 @@
- 
-#include "TePDIRadarKuanFilterFactory.hpp"
-#include "TePDIRadarKuanFilter.hpp"
-#include <TeAgnostic.h>
-
-TePDIRadarKuanFilterFactory::TePDIRadarKuanFilterFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIRadarKuanFilter" ) )
-{
-};      
-
-TePDIRadarKuanFilterFactory::~TePDIRadarKuanFilterFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIRadarKuanFilterFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIRadarKuanFilter();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIRadarKuanFilterFactory.hpp"
+#include "TePDIRadarKuanFilter.hpp"
+#include <TeAgnostic.h>
+
+TePDIRadarKuanFilterFactory::TePDIRadarKuanFilterFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIRadarKuanFilter" ) )
+{
+};      
+
+TePDIRadarKuanFilterFactory::~TePDIRadarKuanFilterFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIRadarKuanFilterFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIRadarKuanFilter();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIRadarKuanFilterFactory.hpp b/src/terralib/image_processing/TePDIRadarKuanFilterFactory.hpp
old mode 100755
new mode 100644
index 1b89184..01a98ac
--- a/src/terralib/image_processing/TePDIRadarKuanFilterFactory.hpp
+++ b/src/terralib/image_processing/TePDIRadarKuanFilterFactory.hpp
@@ -1,67 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRADARKUANFILTERFACTORY_HPP
-  #define TEPDIRADARKUANFILTERFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for radar kuan filter factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIRadarKuanFilterFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIRadarKuanFilterFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRadarKuanFilterFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-  
-  namespace {
-    static TePDIRadarKuanFilterFactory TePDIRadarKuanFilterFactory_instance;
-  };  
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRADARKUANFILTERFACTORY_HPP
+  #define TEPDIRADARKUANFILTERFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for radar kuan filter factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIRadarKuanFilterFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIRadarKuanFilterFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRadarKuanFilterFactory();
+      
+      protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+  
+  namespace {
+    static TePDIRadarKuanFilterFactory TePDIRadarKuanFilterFactory_instance;
+  };  
+
+#endif
diff --git a/src/terralib/image_processing/TePDIRadarLeeFilter.cpp b/src/terralib/image_processing/TePDIRadarLeeFilter.cpp
old mode 100755
new mode 100644
index 3c0b0a4..c645c24
--- a/src/terralib/image_processing/TePDIRadarLeeFilter.cpp
+++ b/src/terralib/image_processing/TePDIRadarLeeFilter.cpp
@@ -1,635 +1,709 @@
-#include "TePDIRadarLeeFilter.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-
-#include "math.h"
-
-
-TePDIRadarLeeFilter::TePDIRadarLeeFilter()
-{
-}
-
-
-TePDIRadarLeeFilter::~TePDIRadarLeeFilter()
-{
-}
-
-
-void TePDIRadarLeeFilter::ResetState( const TePDIParameters& params )
-{
-  TePDIRadarFilter::ResetState( params );
-}
-
-
-bool TePDIRadarLeeFilter::CheckParameters( const 
-  TePDIParameters& parameters ) const
-{
-  /* Checking for general required parameters */
-
-  TePDITypes::TePDIRasterPtrType inRaster;
-  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: input_image" );
-    return false;
-  }
-  if( ! inRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
-    return false;
-  }
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: output_image" );
-    return false;
-  }
-  if( ! outRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeReadyToWrite ) {
-
-    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
-    return false;
-  }
-
-  /* Filter type checking */
-  TePDILeeFType filter_type;
-  if( ! parameters.GetParameter( "filter_type", filter_type ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: filter_type" );
-    return false;
-  }
-  if( ( filter_type != TePDILeeFixedType ) &&
-      ( filter_type != TePDILeeAdaptType ) ) {
-
-    TEAGN_LOGERR( "Invalid parameter: filter_type" );
-    return false;
-  }
-
-  /* channels parameter checking */
-
-  std::vector< int > channels;
-  if( ! parameters.GetParameter( "channels", channels ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: channels" );
-    return false;
-  }
-  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
-    if( channels[ index ] >= inRaster->nBands() ) {
-      TEAGN_LOGERR( "Invalid parameter: channels" );
-      return false;
-    }
-  }
-
-  /* Checking for number of iterations */
-
-  int iterations = 0;
-  if( ! parameters.GetParameter( "iterations", iterations ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: iterations" );
-    return false;
-  }
-  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
-
-  /* Checking for detection type parameter */
-
-  TePDILeeDetType det_type;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "det_type", det_type ),
-    "Missing parameter: det_type" );
-  TEAGN_TRUE_OR_RETURN(
-    ( ( det_type == TePDILeeDTLinear ) || ( det_type == TePDILeeDTQuadratic ) ),
-    "Invalid detection type" );
-
-  /* Checking for image look number */
-
-  double look_number = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "look_number", look_number ),
-    "Missing parameter: look_number" );
-  TEAGN_TRUE_OR_RETURN( look_number > 0,  "Invalid image look number" );
-
-  /* Checking for detection type parameter */
-
-  int mask_width = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "mask_width", mask_width ),
-    "Missing parameter: mask_width" );
-  TEAGN_TRUE_OR_RETURN( ( ( mask_width > 2 ) && ( ( mask_width % 2 ) != 0 ) ),
-    "Invalid mask width" );
-  if( filter_type != TePDILeeAdaptType ) {
-    TEAGN_TRUE_OR_RETURN( ( mask_width <=  (int)max_adapt_mask_width_ ),
-      "Invalid mask width" );
-  }
-
-  /* Checking for variance_threshold parameter */
-
-  double variance_threshold = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "variance_threshold",
-    variance_threshold ),
-    "Missing parameter: variance_threshold" );
-  TEAGN_TRUE_OR_RETURN( variance_threshold >= 0,
-    "Invalid variance_threshold" );
-
-  /* Checking photometric interpretation */
-  
-  for( unsigned int channel = 0 ; channel < channels.size() ; ++channel ) {
-    TEAGN_TRUE_OR_RETURN( ( 
-      ( inRaster->params().photometric_[ channel ] == 
-        TeRasterParams::TeRGB ) ||
-      ( inRaster->params().photometric_[ channel ] == 
-        TeRasterParams::TeMultiBand ) ),
-    "Invalid parameter - input_image (invalid photometric interpretation)" );
-  }  
-  
-  return true;
-}
-
-
-bool TePDIRadarLeeFilter::RunImplementation()
-{
-  TePDILeeFType filter_type;
-  params_.GetParameter( "filter_type", filter_type );
-
-  switch( filter_type ) {
-    case TePDILeeFixedType :
-    {
-      return RunFixedImplementation();
-      break;
-    }
-    case TePDILeeAdaptType :
-    {
-      return RunAdaptImplementation();
-      break;
-    }
-    default :
-    {
-      TEAGN_LOG_AND_RETURN( "Invalid algorithm type" );
-    }
-  }
-}
-
-
-bool TePDIRadarLeeFilter::RunFixedImplementation()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  int mask_width;
-  params_.GetParameter( "mask_width", mask_width );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-
-  TePDILeeDetType det_type;
-  params_.GetParameter( "det_type", det_type );
-
-  double look_number = 0;
-  params_.GetParameter( "look_number", look_number );
-
-  double variance_threshold;
-  params_.GetParameter( "variance_threshold", variance_threshold );
-
-  /* Setting the output raster */
-  
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );  
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ );  
-
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );  
-    
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );  
-
-  /* Creating the temporary rasters with one band each */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, aux_raster1, 1,
-    false, false, TeDOUBLE ), "Unable to create auxiliary raster 1" );
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, aux_raster2, 1,
-    false, false, TeDOUBLE ), "Unable to create auxiliary raster 2" );
-
-  /* Noise statistics */
-
-  double noise_deviation = 0;
-
-  if( det_type == TePDILeeDTLinear ) {
-    noise_deviation = 0.522723008 / sqrt( look_number );
-  } else if( det_type == TePDILeeDTQuadratic ) {
-    noise_deviation = 1.0 / sqrt( look_number );
-  }
-
-  double noise_variance = noise_deviation * noise_deviation;
-  double noise_variance_2 = noise_variance * noise_variance;
-
-  /* Setting the convolution buffer initial state */
-
-  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  reset_conv_buf( mask_width, raster_columns );
-
-  /* Convolution Loop */
-
-  double output_level; /* the value generated by each pixel mask calcule */
-
-  unsigned int mask_middle_off_lines =
-    (unsigned int) floor( ((double)mask_width) / 2. );
-  unsigned int mask_middle_off_columns = mask_middle_off_lines;
-
-  unsigned int conv_column_bound = raster_columns - mask_width + 1;
-  unsigned int conv_line_bound = raster_lines - mask_width + 1;
-
-  unsigned int raster_line; /* mask top-left line */
-  unsigned int conv_buf_column; /* mask top-left column */
-
-  unsigned int current_pixel_column; /* raster reference for the current pixel being
-                                        processed */
-
-  double channel_min_level;
-  double channel_max_level;
-
-  double mean; /* for the current window covolution inside convolution buffer */
-  double variance; /* for the current window convolution inside convolution buffer */
-  double mean_2; /* mean ^ 2 */
-  double relation_top;
-  double relation_bottom;
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-  
-  StartProgInt( "Lee Fixed filter", channels.size() * iterations * 
-    conv_line_bound );   
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-
-    TEAGN_TRUE_OR_THROW(
-      TePDIUtils::TeCopyRasterPixels( inRaster, channels[ channels_index ],
-      aux_raster1, 0, false, false ), "Auxiliar Raster fill error" );
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels[ channels_index ], channel_min_level,
-      channel_max_level ), "Unable to get raster channel level bounds" );
-
-    for( unsigned int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-      /* Switching from input and output raster for more than 1 iteration */
-
-      if( iteration % 2 == 0 ) {
-        source_raster = aux_raster1;
-        target_raster = aux_raster2;
-      } else {
-        source_raster = aux_raster2;
-        target_raster = aux_raster1;
-      }
-
-      /* Fills the convolution buffer with the first "mask_lines" from the raster */
-
-      for( int line = 0 ; line < ( mask_width - 1) ; ++line ) {
-        up_conv_buf( source_raster, line, 0 );
-      }
-
-      /* window convolution over raster */
-
-      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-        
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
-          conv_line_bound ) +
-          ( iteration * conv_line_bound ) + raster_line ),
-          "Canceled by the user" );
-
-        up_conv_buf( source_raster, raster_line + mask_width - 1,
-          channels_index );
-
-        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
-             ++conv_buf_column ) {
-
-          current_pixel_column = conv_buf_column +  mask_middle_off_columns;
-
-          conv_buf_estatistics( 0, conv_buf_column, mask_width, mask_width, mean,
-            variance );
-
-          if( variance < 0 ) {
-            output_level = mean;
-          } else {
-            mean_2 = mean * mean;
-            relation_top = variance - ( noise_variance * mean_2 );
-            relation_bottom = variance + ( noise_variance_2 * mean_2 );
-
-            if( relation_top < 0 ) {
-              output_level = mean;
-            } else {
-              output_level =
-                conv_buf_[ mask_middle_off_lines ][ current_pixel_column ];
-
-              if( ( mean != 0 ) &&
-                  ( relation_bottom != 0 ) &&
-                  ( ( variance / mean_2 ) < variance_threshold ) ) {
-
-                output_level = mean + ( ( relation_top / relation_bottom ) *
-                  ( output_level - mean ) );
-              }
-            }
-          }
-
-          /* Level range filtering */
-
-          if( output_level < channel_min_level ) {
-            output_level = channel_min_level;
-          } else if( output_level > channel_max_level ) {
-            output_level = channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            current_pixel_column,
-            raster_line +  mask_middle_off_lines, output_level, 0 ),
-            "Pixel mapping error" );
-        }
-      }
-    }
-
-    /* Content copy from the target raster to the output raster */
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeCopyRasterPixels( target_raster, 0,
-      outRaster, channels_index, false, false ), "Output raster fill error" );
-  }
-
-  return true;
-}
-
-
-bool TePDIRadarLeeFilter::RunAdaptImplementation()
-{
-  TePDITypes::TePDIRasterPtrType inRaster;
-  params_.GetParameter( "input_image", inRaster );
-
-  TePDITypes::TePDIRasterPtrType outRaster;
-  params_.GetParameter( "output_image", outRaster );
-
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-
-  int initial_mask_width;
-  params_.GetParameter( "mask_width", initial_mask_width );
-
-  int iterations = 0;
-  params_.GetParameter( "iterations", iterations );
-
-  TePDILeeDetType det_type;
-  params_.GetParameter( "det_type", det_type );
-
-  double look_number = 0;
-  params_.GetParameter( "look_number", look_number );
-
-  double variance_threshold;
-  params_.GetParameter( "variance_threshold", variance_threshold );
-
-  /* Setting the output raster */
-  
-  TeRasterParams outRaster_params = outRaster->params();
-  
-  outRaster_params.nBands( channels.size() );
-  if( inRaster->projection() != 0 ) {
-    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-      inRaster->projection()->params() ) );  
-    outRaster_params.projection( proj.nakedPointer() );
-  }
-  outRaster_params.boxResolution( inRaster->params().box().x1(), 
-    inRaster->params().box().y1(), inRaster->params().box().x2(), 
-    inRaster->params().box().y2(), inRaster->params().resx_, 
-    inRaster->params().resy_ );  
-    
-  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-
-  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
-    "Output raster reset error" );  
-
-  const unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
-  const unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
-
-  /* Creating the temporary rasters with one band each */
-
-  TePDITypes::TePDIRasterPtrType aux_raster1;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, aux_raster1, 1,
-    false, false, TeDOUBLE ), "Unable to create auxiliary raster 1" );
-
-  TePDITypes::TePDIRasterPtrType aux_raster2;
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( outRaster, aux_raster2, 1,
-    false, false, TeDOUBLE ), "Unable to create auxiliary raster 2" );
-
-  /* Noise statistics */
-
-  double noise_deviation = 0;
-
-  if( det_type == TePDILeeDTLinear ) {
-    noise_deviation = 0.522723008 / sqrt( look_number );
-  } else if( det_type == TePDILeeDTQuadratic ) {
-    noise_deviation = 1.0 / sqrt( look_number );
-  }
-
-  const double noise_variance = noise_deviation * noise_deviation;
-  const double noise_variance_2 = noise_variance * noise_variance;
-  const double noise_variance_plus_one = noise_variance + 1.;
-
-  /* Setting the convolution buffer initial state */
-
-  reset_conv_buf( max_adapt_mask_width_, raster_columns );
-
-  /* Convolution Loop */
-
-  double output_level; /* the value generated by each pixel mask calcule */
-
-  const unsigned int initial_mask_middle_off =
-    (unsigned int) floor( ((double)initial_mask_width) / 2. );
-
-  const unsigned int buf_middle_line_off =
-    (unsigned int)floor( ((double)max_adapt_mask_width_)  / 2. );
-  const unsigned int buf_init_fill_lines = buf_middle_line_off +
-    initial_mask_middle_off;
-
-  const unsigned int conv_init_line = (unsigned int)
-    floor( (double)max_adapt_mask_width_ / 2. );
-  const unsigned int conv_init_column = conv_init_line;
-  const unsigned int conv_column_bound = raster_columns - conv_init_column;
-  const unsigned int conv_line_bound = raster_lines - conv_init_line;
-
-  unsigned int raster_line; /* currente pixel being processed line */
-  unsigned int raster_column; /* currente pixel being processed column */
-
-  double channel_min_level;
-  double channel_max_level;
-
-  double mean; /* for the current window covolution inside convolution buffer */
-  double mean_2; // mean * mean
-  double variance; /* for the current window convolution inside convolution buffer */
-  double relation;
-  double relation_top;
-  double relation_bottom;
-
-  unsigned int new_mask_width;  /* the widht of the adapted mask */
-  unsigned int new_mask_middle_off; /* the middle offset of the adapted mask */
-
-  TePDITypes::TePDIRasterPtrType source_raster;
-  TePDITypes::TePDIRasterPtrType target_raster;
-  
-  StartProgInt( "Lee Adaptative filter", channels.size() * iterations * 
-    conv_line_bound );   
-
-  for( unsigned int channels_index = 0 ;
-       channels_index < channels.size() ;
-       ++channels_index ) {
-
-    TEAGN_TRUE_OR_THROW(
-      TePDIUtils::TeCopyRasterPixels( inRaster, channels[ channels_index ],
-      aux_raster1, 0, false, false ), "Auxiliar Raster fill error" );
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
-      outRaster, channels[ channels_index ], channel_min_level,
-      channel_max_level ), "Unable to get raster channel level bounds" );
-
-    for( unsigned int iteration = 0 ; (int)iteration < iterations ; ++iteration ) {
-      /* Switching from input and output raster for more than 1 iteration */
-
-      if( iteration % 2 == 0 ) {
-        source_raster = aux_raster1;
-        target_raster = aux_raster2;
-      } else {
-        source_raster = aux_raster2;
-        target_raster = aux_raster1;
-      }
-
-      /* Fills the convolution buffer to cover all positions of the mask
-         always centered at buffer middle line */
-
-      for( unsigned int line = 0 ; line < buf_init_fill_lines ; ++line ) {
-        up_conv_buf( source_raster, line, 0 );
-      }
-
-      /* window convolution over raster */
-
-      for( raster_line = conv_init_line ; raster_line < conv_line_bound ;
-             ++raster_line ) {
-        /* Getting one more line from the source raster and adding to buffer */
-        
-        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
-          conv_line_bound ) +
-          ( iteration * conv_line_bound ) + raster_line ),
-          "Canceled by the user" );
-
-        up_conv_buf( source_raster, raster_line + initial_mask_middle_off,
-          channels_index );
-
-        for( raster_column = conv_init_column ; raster_column < conv_column_bound ;
-             ++raster_column ) {
-
-          conv_buf_estatistics( buf_middle_line_off - initial_mask_middle_off,
-            raster_column - initial_mask_middle_off,
-            (unsigned int)initial_mask_width,
-            (unsigned int)initial_mask_width, mean, variance );
-
-          mean_2 = mean * mean;
-
-          if( variance <= 0 ) {
-            output_level = mean;
-          } else {
-            /* Mask size adptation */
-
-            relation = ( 1. - ( mean_2 * ( noise_variance / variance ) ) ) /
-                      noise_variance_plus_one;
-
-            if( relation < 0.2 ) {
-              new_mask_width = 9;
-              new_mask_middle_off = 4;
-            } else if( relation < 0.4 ) {
-              new_mask_width = 7;
-              new_mask_middle_off = 3;
-            } else if( relation < 0.7 ) {
-              new_mask_width = 5;
-              new_mask_middle_off = 2;
-            } else if( relation < 0.9 ) {
-              new_mask_width = 3;
-              new_mask_middle_off = 1;
-            } else { // relation >= 0.9
-              new_mask_width = 1;
-              new_mask_middle_off = 0;
-            }
-
-            /* Pixel value calcule */
-
-            if( new_mask_width == 1 ) {
-              output_level = conv_buf_[ buf_middle_line_off ][ raster_column ];
-            } else {
-              if( (int)new_mask_width != initial_mask_width ) {
-                conv_buf_estatistics( buf_middle_line_off - new_mask_middle_off,
-                  raster_column - new_mask_middle_off, new_mask_width, new_mask_width,
-                  mean, variance );
-
-                mean_2 = mean * mean;
-              }
-
-              relation_top = variance - ( noise_variance * mean_2 );
-              relation_bottom = variance + ( noise_variance_2 * mean_2 );
-
-              if( ( relation_top < 0 ) || ( relation_bottom == 0 ) ) {
-                output_level = mean;
-              } else {
-                if( ( mean != 0 ) &&
-                    ( ( variance / mean_2 ) < variance_threshold ) ) {
-
-                  output_level = mean + ( ( relation_top / relation_bottom ) *
-                    ( conv_buf_[ buf_middle_line_off ][ raster_column ] - mean ) );
-                } else {
-                  output_level = conv_buf_[ buf_middle_line_off ][ raster_column ];
-                }
-              }
-            }
-          }
-
-          /* Level range filtering */
-
-          if( output_level < channel_min_level ) {
-            output_level = channel_min_level;
-          } else if( output_level > channel_max_level ) {
-            output_level = channel_max_level;
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
-            raster_column, raster_line, output_level, 0 ),
-            "Pixel mapping error" );
-        }
-      }
-    }
-
-    /* Content copy from the target raster to the output raster */
-
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeCopyRasterPixels( target_raster, 0,
-      outRaster, channels_index, false, false ), "Output raster fill error" );
-  }
-
-  return true;
-}
+#include "TePDIRadarLeeFilter.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+
+#include "math.h"
+
+
+TePDIRadarLeeFilter::TePDIRadarLeeFilter()
+{
+}
+
+
+TePDIRadarLeeFilter::~TePDIRadarLeeFilter()
+{
+}
+
+
+void TePDIRadarLeeFilter::ResetState( const TePDIParameters& params )
+{
+  TePDIRadarFilter::ResetState( params );
+}
+
+
+bool TePDIRadarLeeFilter::CheckParameters( const 
+  TePDIParameters& parameters ) const
+{
+  /* Checking for general required parameters */
+
+  TePDITypes::TePDIRasterPtrType inRaster;
+  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: input_image" );
+    return false;
+  }
+  if( ! inRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
+    return false;
+  }
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  if( ! parameters.GetParameter( "output_image", outRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: output_image" );
+    return false;
+  }
+  if( ! outRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeReadyToWrite ) {
+
+    TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
+    return false;
+  }
+
+  /* Filter type checking */
+  TePDILeeFType filter_type;
+  if( ! parameters.GetParameter( "filter_type", filter_type ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: filter_type" );
+    return false;
+  }
+  if( ( filter_type != TePDILeeFixedType ) &&
+      ( filter_type != TePDILeeAdaptType ) ) {
+
+    TEAGN_LOGERR( "Invalid parameter: filter_type" );
+    return false;
+  }
+
+  /* channels parameter checking */
+
+  std::vector< int > channels;
+  if( ! parameters.GetParameter( "channels", channels ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: channels" );
+    return false;
+  }
+  for( unsigned int index = 0 ; index < channels.size() ; ++index ) {
+    if( channels[ index ] >= inRaster->nBands() ) {
+      TEAGN_LOGERR( "Invalid parameter: channels" );
+      return false;
+    }
+  }
+
+  /* Checking for number of iterations */
+
+  int iterations = 0;
+  if( ! parameters.GetParameter( "iterations", iterations ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: iterations" );
+    return false;
+  }
+  TEAGN_TRUE_OR_RETURN( iterations > 0, "Invalid iterations number" );
+
+  /* Checking for detection type parameter */
+
+  TePDILeeDetType det_type;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "det_type", det_type ),
+    "Missing parameter: det_type" );
+  TEAGN_TRUE_OR_RETURN(
+    ( ( det_type == TePDILeeDTLinear ) || ( det_type == TePDILeeDTQuadratic ) ),
+    "Invalid detection type" );
+
+  /* Checking for image look number */
+
+  double look_number = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "look_number", look_number ),
+    "Missing parameter: look_number" );
+  TEAGN_TRUE_OR_RETURN( look_number > 0,  "Invalid image look number" );
+
+  /* Checking for detection type parameter */
+
+  int mask_width = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "mask_width", mask_width ),
+    "Missing parameter: mask_width" );
+  TEAGN_TRUE_OR_RETURN( ( ( mask_width > 2 ) && ( ( mask_width % 2 ) != 0 ) ),
+    "Invalid mask width" );
+  if( filter_type != TePDILeeAdaptType ) {
+    TEAGN_TRUE_OR_RETURN( ( mask_width <=  (int)max_adapt_mask_width_ ),
+      "Invalid mask width" );
+  }
+
+  /* Checking for variance_threshold parameter */
+
+  double variance_threshold = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "variance_threshold",
+    variance_threshold ),
+    "Missing parameter: variance_threshold" );
+  TEAGN_TRUE_OR_RETURN( variance_threshold >= 0,
+    "Invalid variance_threshold" );
+
+  /* Checking photometric interpretation */
+  
+  for( unsigned int channel = 0 ; channel < channels.size() ; ++channel ) {
+    TEAGN_TRUE_OR_RETURN( ( 
+      ( inRaster->params().photometric_[ channel ] == 
+        TeRasterParams::TeRGB ) ||
+      ( inRaster->params().photometric_[ channel ] == 
+        TeRasterParams::TeMultiBand ) ),
+    "Invalid parameter - input_image (invalid photometric interpretation)" );
+  }  
+  
+  return true;
+}
+
+
+bool TePDIRadarLeeFilter::RunImplementation()
+{
+  TePDILeeFType filter_type;
+  params_.GetParameter( "filter_type", filter_type );
+
+  switch( filter_type ) {
+    case TePDILeeFixedType :
+    {
+      return RunFixedImplementation();
+      break;
+    }
+    case TePDILeeAdaptType :
+    {
+      return RunAdaptImplementation();
+      break;
+    }
+    default :
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid algorithm type" );
+    }
+  }
+}
+
+
+bool TePDIRadarLeeFilter::RunFixedImplementation()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  int mask_width;
+  params_.GetParameter( "mask_width", mask_width );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+
+  TePDILeeDetType det_type;
+  params_.GetParameter( "det_type", det_type );
+
+  double look_number = 0;
+  params_.GetParameter( "look_number", look_number );
+
+  double variance_threshold;
+  params_.GetParameter( "variance_threshold", variance_threshold );
+
+  /* Setting the output raster */
+  
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );  
+
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );  
+    
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );  
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  
+  TeRasterParams auxRasterParams = inRaster->params();
+  auxRasterParams.nBands( 1 );
+  auxRasterParams.setDataType( TeDOUBLE, -1 );
+  
+  if( iterations > 1  )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster1 ), "Unable to create auxiliary raster 1" );
+  }
+
+  if( iterations > 2 )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster2 ), "Unable to create auxiliary raster 1" );
+  }
+
+  /* Noise statistics */
+
+  double noise_deviation = 0;
+
+  if( det_type == TePDILeeDTLinear ) {
+    noise_deviation = 0.522723008 / sqrt( look_number );
+  } else if( det_type == TePDILeeDTQuadratic ) {
+    noise_deviation = 1.0 / sqrt( look_number );
+  }
+
+  double noise_variance = noise_deviation * noise_deviation;
+  double noise_variance_2 = noise_variance * noise_variance;
+
+  /* Setting the convolution buffer initial state */
+
+  unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  reset_conv_buf( mask_width, raster_columns );
+
+  /* Convolution Loop */
+
+  double output_level; /* the value generated by each pixel mask calcule */
+
+  unsigned int mask_middle_off_lines =
+    (unsigned int) floor( ((double)mask_width) / 2. );
+  unsigned int mask_middle_off_columns = mask_middle_off_lines;
+
+  unsigned int conv_column_bound = raster_columns - mask_width + 1;
+  unsigned int conv_line_bound = raster_lines - mask_width + 1;
+
+  unsigned int raster_line; /* mask top-left line */
+  unsigned int conv_buf_column; /* mask top-left column */
+
+  unsigned int current_pixel_column; /* raster reference for the current pixel being
+                                        processed */
+
+  double channel_min_level = 0;
+  double channel_max_level = 0;
+
+  double mean; /* for the current window covolution inside convolution buffer */
+  double variance; /* for the current window convolution inside convolution buffer */
+  double mean_2; /* mean ^ 2 */
+  double relation_top;
+  double relation_bottom;
+  int sourceChannel = 0;
+  int targetChannel = 0;
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+  
+  StartProgInt( "Lee Fixed filter", channels.size() * iterations * 
+    conv_line_bound );   
+
+  for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
+       ++channels_index ) 
+  {
+    for( int iteration = 0 ; iteration < iterations ; 
+      ++iteration ) 
+    {
+      /* Switching rasters */
+
+      if( iteration == 0 ) 
+      {
+        source_raster = inRaster;
+        sourceChannel = channels[ channels_index ];
+        
+        if( iterations > 1 )
+        {
+          target_raster = aux_raster1;
+          targetChannel = 0;
+        }
+        else
+        {
+          target_raster = outRaster;
+          targetChannel = channels_index;
+        }
+      }
+      else if( iteration == ( iterations - 1 ) )
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        target_raster = outRaster;
+        targetChannel = channels_index;
+      }
+      else 
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        if( target_raster == aux_raster1 )
+        {
+          target_raster = aux_raster2;
+        }
+        else
+        {
+          target_raster = aux_raster1;
+        }
+        targetChannel = 0;
+      }
+      
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+        target_raster, targetChannel, channel_min_level,
+        channel_max_level ), "Unable to get raster channel level bounds" );      
+
+      /* Fills the convolution buffer with the first "mask_lines" from the raster */
+
+      for( int line = 0 ; line < ( mask_width - 1) ; ++line ) {
+        up_conv_buf( source_raster, line, sourceChannel );
+      }
+
+      /* window convolution over raster */
+
+      for( raster_line = 0 ; raster_line < conv_line_bound ; ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) +
+          ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+
+        up_conv_buf( source_raster, raster_line + mask_width - 1,
+          sourceChannel );
+
+        for( conv_buf_column = 0 ; conv_buf_column < conv_column_bound ;
+             ++conv_buf_column ) {
+
+          current_pixel_column = conv_buf_column +  mask_middle_off_columns;
+
+          conv_buf_estatistics( 0, conv_buf_column, mask_width, mask_width, mean,
+            variance );
+
+          if( variance < 0 ) {
+            output_level = mean;
+          } else {
+            mean_2 = mean * mean;
+            relation_top = variance - ( noise_variance * mean_2 );
+            relation_bottom = variance + ( noise_variance_2 * mean_2 );
+
+            if( relation_top < 0 ) {
+              output_level = mean;
+            } else {
+              output_level =
+                conv_buf_[ mask_middle_off_lines ][ current_pixel_column ];
+
+              if( ( mean != 0 ) &&
+                  ( relation_bottom != 0 ) &&
+                  ( ( variance / mean_2 ) < variance_threshold ) ) {
+
+                output_level = mean + ( ( relation_top / relation_bottom ) *
+                  ( output_level - mean ) );
+              }
+            }
+          }
+
+          /* Level range filtering */
+
+          if( output_level < channel_min_level ) {
+            output_level = channel_min_level;
+          } else if( output_level > channel_max_level ) {
+            output_level = channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            current_pixel_column,
+            raster_line +  mask_middle_off_lines, output_level, targetChannel ),
+            "Pixel mapping error" );
+        }
+      }
+    }
+  }
+
+  return true;
+}
+
+
+bool TePDIRadarLeeFilter::RunAdaptImplementation()
+{
+  TePDITypes::TePDIRasterPtrType inRaster;
+  params_.GetParameter( "input_image", inRaster );
+
+  TePDITypes::TePDIRasterPtrType outRaster;
+  params_.GetParameter( "output_image", outRaster );
+
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+
+  int initial_mask_width;
+  params_.GetParameter( "mask_width", initial_mask_width );
+
+  int iterations = 0;
+  params_.GetParameter( "iterations", iterations );
+
+  TePDILeeDetType det_type;
+  params_.GetParameter( "det_type", det_type );
+
+  double look_number = 0;
+  params_.GetParameter( "look_number", look_number );
+
+  double variance_threshold;
+  params_.GetParameter( "variance_threshold", variance_threshold );
+
+  /* Setting the output raster */
+  
+  TeRasterParams outRaster_params = outRaster->params();
+  
+  outRaster_params.nBands( channels.size() );
+  if( inRaster->projection() != 0 ) {
+    TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+      inRaster->projection()->params() ) );  
+    outRaster_params.projection( proj.nakedPointer() );
+  }
+  outRaster_params.boxResolution( inRaster->params().box().x1(), 
+    inRaster->params().box().y1(), inRaster->params().box().x2(), 
+    inRaster->params().box().y2(), inRaster->params().resx_, 
+    inRaster->params().resy_ );  
+    
+  outRaster_params.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+
+  TEAGN_TRUE_OR_RETURN( outRaster->init( outRaster_params ),
+    "Output raster reset error" );  
+
+  const unsigned int raster_lines = (unsigned int)outRaster->params().nlines_;
+  const unsigned int raster_columns = (unsigned int)outRaster->params().ncols_;
+
+  /* Creating the temporary rasters with one band each */
+
+  TePDITypes::TePDIRasterPtrType aux_raster1;
+  TePDITypes::TePDIRasterPtrType aux_raster2;
+  
+  TeRasterParams auxRasterParams = inRaster->params();
+  auxRasterParams.nBands( 1 );
+  auxRasterParams.setDataType( TeDOUBLE, -1 );
+  
+  if( iterations > 1  )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster1 ), "Unable to create auxiliary raster 1" );
+  }
+
+  if( iterations > 2 )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster( auxRasterParams,
+      aux_raster2 ), "Unable to create auxiliary raster 1" );
+  }
+
+  /* Noise statistics */
+
+  double noise_deviation = 0;
+
+  if( det_type == TePDILeeDTLinear ) {
+    noise_deviation = 0.522723008 / sqrt( look_number );
+  } else if( det_type == TePDILeeDTQuadratic ) {
+    noise_deviation = 1.0 / sqrt( look_number );
+  }
+
+  const double noise_variance = noise_deviation * noise_deviation;
+  const double noise_variance_2 = noise_variance * noise_variance;
+  const double noise_variance_plus_one = noise_variance + 1.;
+
+  /* Setting the convolution buffer initial state */
+
+  reset_conv_buf( max_adapt_mask_width_, raster_columns );
+
+  /* Convolution Loop */
+
+  double output_level; /* the value generated by each pixel mask calcule */
+
+  const unsigned int initial_mask_middle_off =
+    (unsigned int) floor( ((double)initial_mask_width) / 2. );
+
+  const unsigned int buf_middle_line_off =
+    (unsigned int)floor( ((double)max_adapt_mask_width_)  / 2. );
+  const unsigned int buf_init_fill_lines = buf_middle_line_off +
+    initial_mask_middle_off;
+
+  const unsigned int conv_init_line = (unsigned int)
+    floor( (double)max_adapt_mask_width_ / 2. );
+  const unsigned int conv_init_column = conv_init_line;
+  const unsigned int conv_column_bound = raster_columns - conv_init_column;
+  const unsigned int conv_line_bound = raster_lines - conv_init_line;
+
+  unsigned int raster_line; /* currente pixel being processed line */
+  unsigned int raster_column; /* currente pixel being processed column */
+
+  double channel_min_level;
+  double channel_max_level;
+
+  double mean; /* for the current window covolution inside convolution buffer */
+  double mean_2; // mean * mean
+  double variance; /* for the current window convolution inside convolution buffer */
+  double relation;
+  double relation_top;
+  double relation_bottom;
+  int sourceChannel = 0;
+  int targetChannel = 0;  
+
+  unsigned int new_mask_width;  /* the widht of the adapted mask */
+  unsigned int new_mask_middle_off; /* the middle offset of the adapted mask */
+
+  TePDITypes::TePDIRasterPtrType source_raster;
+  TePDITypes::TePDIRasterPtrType target_raster;
+  
+  StartProgInt( "Lee Adaptative filter", channels.size() * iterations * 
+    conv_line_bound );   
+
+  for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
+       ++channels_index ) 
+  {
+    for( int iteration = 0 ; iteration < iterations ; 
+      ++iteration ) 
+    {
+      /* Switching rasters */
+
+      if( iteration == 0 ) 
+      {
+        source_raster = inRaster;
+        sourceChannel = channels[ channels_index ];
+        
+        if( iterations > 1 )
+        {
+          target_raster = aux_raster1;
+          targetChannel = 0;
+        }
+        else
+        {
+          target_raster = outRaster;
+          targetChannel = channels_index;
+        }
+      }
+      else if( iteration == ( iterations - 1 ) )
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        target_raster = outRaster;
+        targetChannel = channels_index;
+      }
+      else 
+      {
+        source_raster = target_raster;
+        sourceChannel = targetChannel;
+        
+        if( target_raster == aux_raster1 )
+        {
+          target_raster = aux_raster2;
+        }
+        else
+        {
+          target_raster = aux_raster1;
+        }
+        targetChannel = 0;
+      }    
+    
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+        target_raster, targetChannel, channel_min_level,
+        channel_max_level ), "Unable to get raster channel level bounds" );
+
+      /* Fills the convolution buffer to cover all positions of the mask
+         always centered at buffer middle line */
+
+      for( unsigned int line = 0 ; line < buf_init_fill_lines ; ++line ) {
+        up_conv_buf( source_raster, line, sourceChannel );
+      }
+
+      /* window convolution over raster */
+
+      for( raster_line = conv_init_line ; raster_line < conv_line_bound ;
+             ++raster_line ) {
+        /* Getting one more line from the source raster and adding to buffer */
+        
+        TEAGN_FALSE_OR_RETURN( UpdateProgInt( ( channels_index * iterations * 
+          conv_line_bound ) +
+          ( iteration * conv_line_bound ) + raster_line ),
+          "Canceled by the user" );
+
+        up_conv_buf( source_raster, raster_line + initial_mask_middle_off,
+          sourceChannel );
+
+        for( raster_column = conv_init_column ; raster_column < conv_column_bound ;
+             ++raster_column ) {
+
+          conv_buf_estatistics( buf_middle_line_off - initial_mask_middle_off,
+            raster_column - initial_mask_middle_off,
+            (unsigned int)initial_mask_width,
+            (unsigned int)initial_mask_width, mean, variance );
+
+          mean_2 = mean * mean;
+
+          if( variance <= 0 ) {
+            output_level = mean;
+          } else {
+            /* Mask size adptation */
+
+            relation = ( 1. - ( mean_2 * ( noise_variance / variance ) ) ) /
+                      noise_variance_plus_one;
+
+            if( relation < 0.2 ) {
+              new_mask_width = 9;
+              new_mask_middle_off = 4;
+            } else if( relation < 0.4 ) {
+              new_mask_width = 7;
+              new_mask_middle_off = 3;
+            } else if( relation < 0.7 ) {
+              new_mask_width = 5;
+              new_mask_middle_off = 2;
+            } else if( relation < 0.9 ) {
+              new_mask_width = 3;
+              new_mask_middle_off = 1;
+            } else { // relation >= 0.9
+              new_mask_width = 1;
+              new_mask_middle_off = 0;
+            }
+
+            /* Pixel value calcule */
+
+            if( new_mask_width == 1 ) {
+              output_level = conv_buf_[ buf_middle_line_off ][ raster_column ];
+            } else {
+              if( (int)new_mask_width != initial_mask_width ) {
+                conv_buf_estatistics( buf_middle_line_off - new_mask_middle_off,
+                  raster_column - new_mask_middle_off, new_mask_width, new_mask_width,
+                  mean, variance );
+
+                mean_2 = mean * mean;
+              }
+
+              relation_top = variance - ( noise_variance * mean_2 );
+              relation_bottom = variance + ( noise_variance_2 * mean_2 );
+
+              if( ( relation_top < 0 ) || ( relation_bottom == 0 ) ) {
+                output_level = mean;
+              } else {
+                if( ( mean != 0 ) &&
+                    ( ( variance / mean_2 ) < variance_threshold ) ) {
+
+                  output_level = mean + ( ( relation_top / relation_bottom ) *
+                    ( conv_buf_[ buf_middle_line_off ][ raster_column ] - mean ) );
+                } else {
+                  output_level = conv_buf_[ buf_middle_line_off ][ raster_column ];
+                }
+              }
+            }
+          }
+
+          /* Level range filtering */
+
+          if( output_level < channel_min_level ) {
+            output_level = channel_min_level;
+          } else if( output_level > channel_max_level ) {
+            output_level = channel_max_level;
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement(
+            raster_column, raster_line, output_level, targetChannel ),
+            "Pixel mapping error" );
+        }
+      }
+    }
+  }
+
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIRadarLeeFilter.hpp b/src/terralib/image_processing/TePDIRadarLeeFilter.hpp
old mode 100755
new mode 100644
index 9ed551e..991274d
--- a/src/terralib/image_processing/TePDIRadarLeeFilter.hpp
+++ b/src/terralib/image_processing/TePDIRadarLeeFilter.hpp
@@ -1,134 +1,134 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRADARLEEFILTER_HPP
-  #define TEPDIRADARLEEFILTER_HPP
-
-  #include "TePDIRadarFilter.hpp"
-  #include "TePDIParameters.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for radar Lee filter.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIFiltersGroup
-   *
-   * @note The general required parameters are:
-   *
-   * @param filter_type ( TePDILeeFType ),
-   * @param input_image (TePDITypes::TePDIRasterPtrType),
-   * @param output_image (TePDITypes::TePDIRasterPtrType),
-   * @param channels (std::vector<int>) - Band(s) to process. For
-   * @param iterations (int) - Iterations number,
-   * @param det_type (TePDILeeDetType) - Detection type,
-   * @param look_number (double) - Image look number,
-   * @param mask_width (int) - Mask width,
-   * @param variance_threshold (double - optional ) - The noise variance threshold
-   * for each convolution.
-   */
-  class PDI_DLL TePDIRadarLeeFilter : public TePDIRadarFilter{
-    public :
-      /** @typedef Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIRadarLeeFilter > pointer;
-      /** @typedef Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIRadarLeeFilter > const_pointer;
-
-      /**
-       * @enum Filter type 
-       */
-      enum TePDILeeFType{
-        /** Fixed type */
-        TePDILeeFixedType = 1,
-        /** Adaptative type */
-        TePDILeeAdaptType = 2
-      };
-
-      /**
-       * @enum Detection type 
-       */
-      enum TePDILeeDetType{
-        /** Linear detection */
-        TePDILeeDTLinear = 1,
-        /** Quadratic detection */
-        TePDILeeDTQuadratic = 2
-      };
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIRadarLeeFilter();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRadarLeeFilter();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected :
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Runs the fixed window algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunFixedImplementation();
-
-      /**
-       * @brief Runs the adaptative window algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunAdaptImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-
-  };
-  
-/** @example TePDIRadarFilters_test.cpp
- *    Shows how to use this class.
- */   
-
-#endif //TEPDIRADARLEEFILTER_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRADARLEEFILTER_HPP
+  #define TEPDIRADARLEEFILTER_HPP
+
+  #include "TePDIRadarFilter.hpp"
+  #include "TePDIParameters.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the class for radar Lee filter.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIFiltersGroup
+   *
+   * @note The general required parameters are:
+   *
+   * @param filter_type ( TePDILeeFType ),
+   * @param input_image (TePDITypes::TePDIRasterPtrType),
+   * @param output_image (TePDITypes::TePDIRasterPtrType),
+   * @param channels (std::vector<int>) - Band(s) to process. For
+   * @param iterations (int) - Iterations number,
+   * @param det_type (TePDILeeDetType) - Detection type,
+   * @param look_number (double) - Image look number,
+   * @param mask_width (int) - Mask width,
+   * @param variance_threshold (double - optional ) - The noise variance threshold
+   * for each convolution.
+   */
+  class PDI_DLL TePDIRadarLeeFilter : public TePDIRadarFilter{
+    public :
+      /** @typedef Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIRadarLeeFilter > pointer;
+      /** @typedef Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIRadarLeeFilter > const_pointer;
+
+      /**
+       * @enum Filter type 
+       */
+      enum TePDILeeFType{
+        /** Fixed type */
+        TePDILeeFixedType = 1,
+        /** Adaptative type */
+        TePDILeeAdaptType = 2
+      };
+
+      /**
+       * @enum Detection type 
+       */
+      enum TePDILeeDetType{
+        /** Linear detection */
+        TePDILeeDTLinear = 1,
+        /** Quadratic detection */
+        TePDILeeDTQuadratic = 2
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIRadarLeeFilter();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRadarLeeFilter();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Runs the fixed window algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunFixedImplementation();
+
+      /**
+       * @brief Runs the adaptative window algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunAdaptImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+
+  };
+  
+/** @example TePDIRadarFilters_test.cpp
+ *    Shows how to use this class.
+ */   
+
+#endif //TEPDIRADARLEEFILTER_HPP
diff --git a/src/terralib/image_processing/TePDIRadarLeeFilterFactory.cpp b/src/terralib/image_processing/TePDIRadarLeeFilterFactory.cpp
old mode 100755
new mode 100644
index de92034..43d09c8
--- a/src/terralib/image_processing/TePDIRadarLeeFilterFactory.cpp
+++ b/src/terralib/image_processing/TePDIRadarLeeFilterFactory.cpp
@@ -1,24 +1,24 @@
- 
-#include "TePDIRadarLeeFilterFactory.hpp"
-#include "TePDIRadarLeeFilter.hpp"
-#include <TeAgnostic.h>
-
-TePDIRadarLeeFilterFactory::TePDIRadarLeeFilterFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIRadarLeeFilter" ) )
-{
-};      
-
-TePDIRadarLeeFilterFactory::~TePDIRadarLeeFilterFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIRadarLeeFilterFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIRadarLeeFilter();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIRadarLeeFilterFactory.hpp"
+#include "TePDIRadarLeeFilter.hpp"
+#include <TeAgnostic.h>
+
+TePDIRadarLeeFilterFactory::TePDIRadarLeeFilterFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIRadarLeeFilter" ) )
+{
+};      
+
+TePDIRadarLeeFilterFactory::~TePDIRadarLeeFilterFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIRadarLeeFilterFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIRadarLeeFilter();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIRadarLeeFilterFactory.hpp b/src/terralib/image_processing/TePDIRadarLeeFilterFactory.hpp
old mode 100755
new mode 100644
index 67345d0..02cc6e3
--- a/src/terralib/image_processing/TePDIRadarLeeFilterFactory.hpp
+++ b/src/terralib/image_processing/TePDIRadarLeeFilterFactory.hpp
@@ -1,67 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRADARLEEFILTERFACTORY_HPP
-  #define TEPDIRADARLEEFILTERFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for radar lee filter factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIRadarLeeFilterFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIRadarLeeFilterFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRadarLeeFilterFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-  
-  namespace {
-    static TePDIRadarLeeFilterFactory TePDIRadarLeeFilterFactory_instance;
-  };  
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRADARLEEFILTERFACTORY_HPP
+  #define TEPDIRADARLEEFILTERFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for radar lee filter factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIRadarLeeFilterFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIRadarLeeFilterFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRadarLeeFilterFactory();
+      
+      protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+  
+  namespace {
+    static TePDIRadarLeeFilterFactory TePDIRadarLeeFilterFactory_instance;
+  };  
+
+#endif
diff --git a/src/terralib/image_processing/TePDIRaster2Vector.cpp b/src/terralib/image_processing/TePDIRaster2Vector.cpp
old mode 100755
new mode 100644
index 1ef8600..ec25eff
--- a/src/terralib/image_processing/TePDIRaster2Vector.cpp
+++ b/src/terralib/image_processing/TePDIRaster2Vector.cpp
@@ -1,886 +1,886 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <TePDIRaster2Vector.hpp>
-#include <TeAgnostic.h>
-#include <TePDIUtils.hpp>
-
-#include <TeUtils.h>
-
-#include <algorithm>
-#include <string>
-#include <vector>
-
-#include <float.h>
-
-//these are the 8 cardinals directions used to parcour an edge
-#define NW 0
-#define N  1
-#define EN 2
-#define E  3
-#define SE 4
-#define S  5
-#define WS 6
-#define W  7
-
-
-TePDIRaster2Vector::TePDIRaster2Vector()
-{
-  raster_uses_dummy_ = false;
-  dummy_value_ = 0;
-  containerPolygons_.clear();
-  rtreePolygons_=NULL;
-  raster_channel_ = 0;
-  
-  /* Updating the directions  */
-  
-  directions_[ 0 ] = TeCoord2D( -1, -1 );  /* NW - 0 */
-  directions_[ 1 ] = TeCoord2D(  0, -1 );  /* N  - 1 */
-  directions_[ 2 ] = TeCoord2D(  1, -1 );  /* EN - 2 */
-  directions_[ 3 ] = TeCoord2D(  1,  0 );  /* E  - 3 */
-  directions_[ 4 ] = TeCoord2D(  1,  1 );  /* SE - 4 */
-  directions_[ 5 ] = TeCoord2D(  0,  1 );  /* S  - 5 */
-  directions_[ 6 ] = TeCoord2D( -1,  1 );  /* WS - 6 */
-  directions_[ 7 ] = TeCoord2D( -1,  0 );  /* W  - 7 */  
-}
-
-TePDIRaster2Vector::~TePDIRaster2Vector()
-{
-  clear();
-}
-
-bool
-TePDIRaster2Vector :: CheckParameters( 
-  const TePDIParameters& parameters ) const {
-  /* Checking for general required parameters */
-
-  //parameter input_image
-  TePDITypes::TePDIRasterPtrType inRaster;
-  if( ! parameters.GetParameter( "rotulated_image", inRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: rotulated_image" );
-    return false;
-  }
-  if( ! inRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: rotulated_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: rotulated_image not ready" );
-    return false;
-  }
-  
-  /* Checking output_polsets */
-  
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.CheckParameter< TePDITypes::TePDIPolSetMapPtrType >( 
-    "output_polsets" ), "Missing parameter: output_polsets" );
-  
-  TePDITypes::TePDIPolSetMapPtrType output_polsets;
-  parameters.GetParameter( "output_polsets", output_polsets );
-            
-  TEAGN_TRUE_OR_RETURN( output_polsets.isActive(),
-    "Invalid parameter output_polsets : Inactive polygon set pointer" );
-
-  /* Checking channel */
-  
-  unsigned int channel = 0;
-  
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "channel", channel ), 
-    "Missing parameter: channel" );
-    
-  TEAGN_TRUE_OR_RETURN( ( channel < (unsigned int)inRaster->nBands() ),
-    "Invalid parameter: channel" );
-    
-  /* checking rotulated_image data type */
-  
-  for( int band = 0 ; band < inRaster->params().nBands() ; ++band ) {
-    TEAGN_TRUE_OR_RETURN( 
-      ( inRaster->params().dataType_[ band ] != TeFLOAT ), 
-      "Invalid rotulated_image floating point raster data type" );
-    TEAGN_TRUE_OR_RETURN( 
-      ( inRaster->params().dataType_[ band ] != TeDOUBLE ), 
-      "Invalid rotulated_image floating point raster data type" );    
-  }  
-    
-  return true;
-}
-
-
-bool TePDIRaster2Vector::RunImplementation()
-{
-  clear();
-  
-  /* Extratcting parameters */
-  
-  params_.GetParameter( "rotulated_image", raster_ );
-  params_.GetParameter( "channel", raster_channel_ );  
-  
-  unsigned long int max_pols = 0;
-  if( params_.CheckParameter< unsigned long int >( "max_pols" ) ) {
-    params_.GetParameter( "max_pols", max_pols );
-  }
-  
-  /* Guessing dummy use */
-        
-  raster_uses_dummy_ = raster_->params().useDummy_;
-  dummy_value_ = 0;
-  if( raster_uses_dummy_ ) {
-    dummy_value_ = raster_->params().dummy_[ 0 ];
-  }
-
-  //attributes of the raster
-  
-  resx_ = raster_->params().resx_ ;
-  resy_ = raster_->params().resy_ ;
-
-  const TeBox raster_bbox=raster_->params().boundingBox();
-  nCols_  = raster_->params().ncols_;
-  nLines_ = raster_->params().nlines_;
-
-  //declarations
-        
-  double val;
-  int i,j;
-
-  /* Creating a new RTree */
-  
-  rtreePolygons_ = new TeSAM::TeRTree<unsigned int, 8, 4>(
-    raster_->params().boundingBox());
-    
-  int countObjects = 0;
-  vector<unsigned int> indexVec;
-
-  StartProgInt( "Vectorizing...", nLines_ );
-                
-  // scanning rotulated image in row order to vectorize the cells
-  
-  TeCoord2D last_line_ll_point;
-  TeCoord2D last_line_ll_point_indexed;
-  TeCoord2D last_line_lr_point;
-  TeCoord2D last_line_lr_point_indexed;  
-  
-  for ( j = 0 ; j < nLines_ ; j++) {
-    TEAGN_FALSE_OR_RETURN( UpdateProgInt( j ), "Canceled by the user" );
-    
-    /* Cleaning the tileindexers that will not be used anymore */
-    
-    last_line_ll_point_indexed.setXY( 0, ( (double)j ) - 1.0 );
-    last_line_lr_point_indexed.setXY( ( (double)nCols_ ) - 1, 
-      ( (double)j ) - 1.0 );
-    
-    last_line_ll_point = raster_->index2Coord( 
-      last_line_ll_point_indexed );
-    last_line_lr_point = raster_->index2Coord( 
-      last_line_lr_point_indexed );
-            
-    TeBox last_line_bbox( last_line_ll_point,
-      last_line_lr_point );
-      
-    indexVec.clear();
-    rtreePolygons_->search( last_line_bbox, indexVec ); 
-    
-    for( unsigned int indexVec_index = 0 ;
-      indexVec_index < indexVec.size() ; ++indexVec_index ) {
-      
-      TePDIRaster2VectorPolStruct& curr_pol_struct =
-        containerPolygons_[ indexVec[ indexVec_index ] ];
-      
-      if( raster_->coord2Index( 
-        curr_pol_struct.poly_.box().lowerLeft() ).y() < j ) {
-        
-        curr_pol_struct.indexer_->clear();
-      }
-    }
-      
-    /* iterating through columns */
-    
-    for ( i = 0 ; i < nCols_ ; i++) {
-      /* Virifying if the current point is already inside a polygon generated
-         before */
-         
-      TeCoord2D coordMatrix(i, j);
-      TeCoord2D coordWorld = raster_->index2Coord(coordMatrix);
-      TeBox boxPoint(coordWorld, coordWorld);
-      bool exist = false;  
-      
-      indexVec.clear();
-      rtreePolygons_->search( boxPoint, indexVec );
-      
-      if( ! raster_->getElement(i,j,val,raster_channel_) ) {
-        val = dummy_value_;
-      }      
-      
-      if ( ! indexVec.empty() ) {
-        unsigned int indexVec_index = 0;        
-
-        while( indexVec_index < indexVec.size() ) {
-          TEAGN_DEBUG_CONDITION( 
-            ( indexVec[ indexVec_index ] < containerPolygons_.size() ),
-            "Invalid cadidates vector index" );
-    
-          const TePDIRaster2VectorPolStruct& pol_str_ref = 
-            containerPolygons_[ indexVec[ indexVec_index ] ];
-      
-          if ( val == pol_str_ref.value_ ) {
-            if( TePDIUtils::TeRelation( coordWorld, 
-              *( pol_str_ref.indexer_ ) ) == TeINSIDE ) {
-                 
-              exist = true;
-              break;
-            }        
-          }
-          
-          ++indexVec_index;
-        }                
-      }
-
-      if( ! exist ) {
-         //we found a new class
-         
-        TeLine2D line; 
-         
-        if( detectEdge( i, j, line ) ) {
-          try {
-            TePolygon poly;
-            poly.add( line );
-            
-            /* Verifying if the polygon is a hole of other one */
-              
-            unsigned int indexVec_index = 0;
-            
-            while( indexVec_index < indexVec.size() ) {
-              TePDIRaster2VectorPolStruct& pol_struct_ref = 
-                containerPolygons_[ indexVec[ indexVec_index ] ];
-              TeTileIndexer& indexer_ref = *( pol_struct_ref.indexer_ );
-              TePolygon& pol_ref = pol_struct_ref.poly_;
-            
-              if( TePDIUtils::TeRelation( coordWorld, indexer_ref ) == 
-                TeINSIDE ) {
-              
-                pol_ref.add( poly.first() );
-                indexer_ref.addRing( pol_ref.size() - 1 );
-                  
-                break;
-              }
-              
-              ++indexVec_index;
-            }
-            
-            /* free indexVec */
-            
-            indexVec.clear();
-            
-            // inserting the new polygon into tree and container
-            
-            if( raster_uses_dummy_ && ( val == dummy_value_ ) ) {
-              poly.objectId( "none" );
-            } else {
-              ++countObjects;
-              poly.objectId( Te2String( countObjects ) );
-            }
-            
-            TePDIRaster2VectorPolStruct dummy_ps;
-            containerPolygons_.push_back( dummy_ps );
- 
-            containerPolygons_[ containerPolygons_.size() - 
-              1 ].reset( poly, (int)val, 
-              MAX( 
-                  (
-                    4.0 * poly.box().height() 
-                    /
-                    (
-                      poly.box().width()
-                      *
-                      ( (double) poly[ 0 ].size() )
-                    )
-                  )
-                  ,
-                  raster_->params().resy_
-                 )
-            );                                  
-      
-            rtreePolygons_->insert( poly.box(), containerPolygons_.size() - 1 );  
-          }
-          catch(...) {
-            TEAGN_LOGERR( "Error generating polygon - "
-              "not enough memory" );
-              
-            /* no more polygons will be generated */    
-            i = nCols_;
-            j = nLines_;              
-          }
-        } else {
-          /* no more polygons will be generated */
-          i = nCols_;
-          j = nLines_;
-        }
-        
-        if( max_pols ) {
-          if( countObjects >= ( (int)max_pols ) ) {
-            /* no more polygons will be generated */
-            i = nCols_;
-            j = nLines_;          
-          }
-        }
-      }
-    }
-  }
-  
-  /* Cleaning the tree */
-  
-  delete rtreePolygons_;
-  rtreePolygons_ = 0;
-        
-  /* Generating output data */
-  
-  TePDITypes::TePDIPolSetMapPtrType output_polsets;
-  params_.GetParameter( "output_polsets", output_polsets );
-      
-  output_polsets->clear();
-  
-  std::map< double, TePolygonSet >::iterator psm_it;
-    
-  std::vector<TePDIRaster2VectorPolStruct>::iterator cpit = 
-    containerPolygons_.begin();
-  std::vector<TePDIRaster2VectorPolStruct>::iterator cpit_end = 
-    containerPolygons_.end();
-  
-  double value = 0;
-    
-  try {
-    while( cpit != cpit_end ) {
-      value = (double)cpit->value_;
-    
-      if( ( ! raster_uses_dummy_ ) || ( value != dummy_value_ ) ) {
-        psm_it = output_polsets->find( value );
-        
-        if( psm_it == output_polsets->end() ) {
-          TePolygonSet dummy_ps;
-          dummy_ps.add( cpit->poly_ );
-          
-          (*output_polsets)[ value ] = dummy_ps;
-        } else {
-          psm_it->second.add( cpit->poly_ );
-        }
-      }
-      
-      cpit->clear();
-      
-      ++cpit;
-    }
-  }
-  catch(...) {
-    TEAGN_LOG_AND_THROW( 
-      "Memory error - error generating output polygons sets map" )
-  }
-                
-  return true;
-}
-
-void
-TePDIRaster2Vector::ResetState( const TePDIParameters& /* params */ )
-{
-  clear();       
-}
-
-
-bool TePDIRaster2Vector::detectEdge(long i, long j, TeLine2D &line )
-{
-  TEAGN_DEBUG_RETURN( startingEdgeTest( i, j ), 
-    "Starting edge detection error at x=" + Te2String( i ) + " line=" +
-    Te2String( j ) )
-    
-  line.clear();
-    
-  try {
-    /* Current polygon pixel values */
-    
-    double pol_pixels_value = 0;
-    
-    if( ! raster_->getElement(i, j, pol_pixels_value, raster_channel_ ) ) {
-      pol_pixels_value = dummy_value_;
-    }  
-    
-    /* Generating chaing code by following the polygon borders */
-    
-    short curr_dir = E;
-    short new_dir = E;
-    short new_test_start_dir = E;
-    short curr_pixel_corner = NW;
-    
-    short pinit_leaving_dir = W;
-    bool pinit_leaving_dir_set = false;
-    
-    TeCoord2D curr_chain_p = TeCoord2D( 0, 0 );
-
-    int curr_x_index = i;
-    int curr_y_index = j;
-    int next_x_index = i;
-    int next_y_index = j;
-    
-    double curr_pixel_value = 0;
-    
-    bool look_for_next_pixel = true;
-    bool next_pixel_found = false;
-    bool must_add_curr_chain_p = false;
-    
-    line.add( curr_chain_p );
-    
-    while( look_for_next_pixel ) {
-      /* Finding the next direction */
-          
-      new_test_start_dir = ( curr_dir + 6 ) % 8;
-      new_dir = new_test_start_dir;
-      next_pixel_found = false;
-          
-      do {
-        next_x_index = curr_x_index + (int)( directions_[new_dir].x() );
-        next_y_index = curr_y_index + (int)( directions_[new_dir].y() );
-              
-        if( ( next_x_index > (-1) ) && ( next_y_index > (-1) ) && 
-          ( next_x_index < nCols_ ) && ( next_y_index < nLines_ ) ) {
-                
-          if( ! raster_->getElement( next_x_index, next_y_index, 
-            curr_pixel_value, raster_channel_ ) ) {
-                          
-            curr_pixel_value = dummy_value_;  
-          }
-                          
-          if ( curr_pixel_value == pol_pixels_value ){
-            next_pixel_found = true;
-            break;
-          }
-        }
-              
-        new_dir = ( new_dir + 2 ) % 8;
-      } while( new_dir != new_test_start_dir );
-      
-      /* Generating the polygon line following the current state */
-      
-        if( ! next_pixel_found ) {
-          // there is only one point inside the polygon
-          // that is the last one
-          
-          curr_chain_p += ( directions_[ E ] );
-          line.add( curr_chain_p );
-          
-          curr_chain_p += ( directions_[ S ] );
-          line.add( curr_chain_p );
-          
-          curr_chain_p += ( directions_[ W ] );
-          line.add( curr_chain_p );
-          
-          curr_chain_p += ( directions_[ N ] );
-          line.add( curr_chain_p );                        
-                        
-          look_for_next_pixel = false;
-        } else if( ( curr_x_index == i ) && ( curr_y_index == j ) &&
-          ( pinit_leaving_dir == new_dir ) ) {
-        
-          /* We are back to the fist pixel again
-            ( going to the same direction ) */
-          
-          switch( curr_pixel_corner ) {
-            case EN :
-            {
-              curr_chain_p += ( directions_[ S ] );
-              line.add( curr_chain_p );
-          
-              curr_chain_p += ( directions_[ W ] );
-              line.add( curr_chain_p );
-          
-              curr_chain_p += ( directions_[ N ] );
-              line.add( curr_chain_p );
-              
-              break;
-            }
-            case SE :
-            { 
-              curr_chain_p += ( directions_[ W ] );
-              line.add( curr_chain_p );
-          
-              curr_chain_p += ( directions_[ N ] );
-              line.add( curr_chain_p );
-              
-              break;
-            }
-            case WS :
-            {
-              curr_chain_p += ( directions_[ N ] );
-              line.add( curr_chain_p );
-                        
-              break;
-            }
-            default :
-            {
-              TEAGN_LOG_AND_RETURN( "Invalid pixel corner=" + 
-                Te2String( curr_pixel_corner) + " curr_dir=" + 
-                Te2String( curr_dir ) );
-              break;
-            }
-          }      
-         
-          look_for_next_pixel = false;   
-        } else {
-          /* Updating current chain point and current pixel corner */
-          
-          if( curr_dir == new_dir ) {
-            curr_chain_p += ( directions_[ curr_dir ] );
-            
-            must_add_curr_chain_p = true;
-          } else {
-            if( must_add_curr_chain_p ) {
-              line.add( curr_chain_p );
-              
-              must_add_curr_chain_p = false;
-            }
-          
-            switch( new_dir ) {
-              case E:
-              {
-                switch( curr_pixel_corner ) {
-                  case NW :
-                  {
-                    curr_chain_p += ( directions_[ E ] );
-                    line.add( curr_chain_p );
-                          
-                    break;
-                  }
-                  case EN :
-                  {
-                    curr_pixel_corner = NW;
-                    break;
-                  }
-                  case SE :
-                  { 
-                    curr_chain_p += ( directions_[ W ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ N ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ E ] );
-                    line.add( curr_chain_p );                                                      
-                    
-                    curr_pixel_corner = NW;
-                    break;
-                  }
-                  case WS :
-                  {
-                    curr_chain_p += ( directions_[ N ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ E ] );
-                    line.add( curr_chain_p );                    
-                    
-                    curr_pixel_corner = NW;
-                    break;
-                  }
-                  default :
-                  {
-                    TEAGN_LOG_AND_THROW( "Invalid pixel corner" )
-                    break;
-                  }
-                }
-                
-                break;
-              }
-              case S:
-              {
-                switch( curr_pixel_corner ) {
-                  case NW :
-                  {
-                    curr_chain_p += ( directions_[ E ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ S ] );
-                    line.add( curr_chain_p );  
-                                    
-                    curr_pixel_corner = EN;  
-                    break;
-                  }
-                  case EN :
-                  {
-                    curr_chain_p += ( directions_[ S ] );
-                    line.add( curr_chain_p );
-                                    
-                    break;
-                  }
-                  case SE :
-                  {
-                    curr_pixel_corner = EN;
-                    break;
-                  }
-                  case WS :
-                  {
-                    curr_chain_p += ( directions_[ N ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ E ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ S ] );
-                    line.add( curr_chain_p );                 
-                  
-                    curr_pixel_corner = EN;
-                    break;
-                  }
-                  default :
-                  {
-                    TEAGN_LOG_AND_THROW( "Invalid pixel corner" )
-                    break;
-                  }
-                }
-                
-                break;
-              }    
-              case W:
-              {
-                switch( curr_pixel_corner ) {
-                  case NW :
-                  {
-                    curr_chain_p += ( directions_[ E ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ S ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ W ] );
-                    line.add( curr_chain_p ); 
-                                    
-                    curr_pixel_corner = SE;  
-                    break;
-                  }
-                  case EN :
-                  {
-                    curr_chain_p += ( directions_[ S ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ W ] );
-                    line.add( curr_chain_p ); 
-                                    
-                    curr_pixel_corner = SE;
-                    break;
-                  }
-                  case SE :
-                  {
-                    curr_chain_p += ( directions_[ W ] );
-                    line.add( curr_chain_p ); 
-                                    
-                    break;
-                  }
-                  case WS :
-                  {
-                    curr_pixel_corner = SE;
-                    break;
-                  }
-                  default :
-                  {
-                    TEAGN_LOG_AND_THROW( "Invalid pixel corner" )
-                    break;
-                  }
-                }
-                
-                break;
-              }
-              case N:
-              {
-                switch( curr_pixel_corner ) {
-                  case NW :
-                  {
-                    curr_pixel_corner = WS;  
-                    break;
-                  }
-                  case EN :
-                  {
-                    curr_chain_p += ( directions_[ S ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ W ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ N ] );
-                    line.add( curr_chain_p );
-                                    
-                    curr_pixel_corner = WS;  
-                    break;
-                  }
-                  case SE :
-                  {
-                    curr_chain_p += ( directions_[ W ] );
-                    line.add( curr_chain_p );
-                    
-                    curr_chain_p += ( directions_[ N ] );
-                    line.add( curr_chain_p );
-                                    
-                    curr_pixel_corner = WS;  
-                    break;
-                  }
-                  case WS :
-                  {
-                    curr_chain_p += ( directions_[ N ] );
-                    line.add( curr_chain_p );                
-
-                    break;
-                  }
-                  default :
-                  {
-                    TEAGN_LOG_AND_THROW( "Invalid pixel corner" )
-                    break;
-                  }
-                }
-              
-                break;
-              }
-              default :
-              {
-                TEAGN_LOG_AND_THROW( "Invalid new_dir" )
-                break;
-              }
-            }
-          }
-            
-          /* Updating the leaving direction from the initial point */
-          
-          if( ( ! pinit_leaving_dir_set ) && ( curr_x_index == i ) && 
-              ( curr_y_index == j ) ) {
-                
-            pinit_leaving_dir_set = true;
-            pinit_leaving_dir = new_dir;
-          }           
-            
-          /* updating the current state */
-          
-          curr_x_index = next_x_index;
-          curr_y_index = next_y_index;  
-          
-          curr_dir = new_dir;         
-        }
-    }
-      
-    /* Changing lines coords to world coords */
-    
-    const TeCoord2D chain_init_p = raster_->index2Coord( TeCoord2D( 
-      ( (double)i ) - 0.5, ( (double)j ) - 0.5 ) );  
-      
-    TeLine2D::iterator it = line.begin();
-    TeLine2D::iterator it_end = line.end();
-    
-    double min_x = DBL_MAX;
-    double min_y = DBL_MAX;
-    double max_x = ( -1.0 ) * DBL_MAX;
-    double max_y = ( -1.0 ) * DBL_MAX;
-    
-    while( it != it_end ) {
-      it->x_ = chain_init_p.x_ + ( it->x_ * resx_ );
-      it->y_ = chain_init_p.y_ - ( it->y_ * resy_ );
-      
-      if( it->x_ < min_x ) min_x = it->x_;
-      if( it->y_ < min_y ) min_y = it->y_;
-
-      if( it->x_ > max_x ) max_x = it->x_;
-      if( it->y_ > max_y ) max_y = it->y_;
-      
-      ++it;
-    }
-    
-    /* Updating the line box */
-    
-    TeBox newbox( min_x, min_y, max_x, max_y );
-    line.setBox( newbox );
-    
-    /* Closing the line, if necessary */
-    
-    if( line.size() > 1 ) {
-      if( ( line[ 0 ].x() != line[ line.size() - 1 ].x() ) ||
-        ( line[ 0 ].y() != line[ line.size() - 1 ].y() ) ) {
-        
-        line.add( line[ 0 ] );
-      }
-    }  
-  }
-  catch(...) {
-    line.clear();
-    
-    TEAGN_LOG_AND_RETURN( "Unable to detect edge - "
-      "not enough memory" )
-  }
-
-  return true;
-}
-
-
-bool TePDIRaster2Vector::startingEdgeTest( const int& x, 
-  const int& y )
-{
-  int nlines = raster_->params().nlines_;
-  int ncols = raster_->params().ncols_;
-
-  TEAGN_TRUE_OR_RETURN( ( y < nlines ), 
-    "Invalid col [" + Te2String( x ) + "]" );
-  TEAGN_TRUE_OR_RETURN( ( x < ncols ), 
-    "Invalid line [" + Te2String( y ) + "]" );
-    
-  if( ( x == 0 ) || ( y == 0 ) || ( x == ( ncols - 1 ) ) || 
-    ( y == ( nlines - 1 ) ) ) {
-    
-    return true;
-  } else {
-    double test_val = 0;
-    double current_val = 0;  
-  
-    if( ! raster_->getElement(x, y, current_val, raster_channel_ ) ) {
-      TEAGN_TRUE_OR_RETURN( raster_uses_dummy_, "Raster read error" );
-      current_val = dummy_value_;
-    }
-    
-    if( ! raster_->getElement(x - 1, y, test_val, raster_channel_ ) ) {
-      TEAGN_TRUE_OR_RETURN( raster_uses_dummy_, "Raster read error" );
-      test_val = dummy_value_;
-    }  
-  
-    TEAGN_TRUE_OR_RETURN( ( current_val != test_val ), 
-      "The given point isn't a starting edge [x=" + Te2String( x ) +
-      " y=" + Te2String( y ) + "]" );
-      
-    return true;
-  }
-}
-
-
-void TePDIRaster2Vector::clear()
-{
-  raster_.reset();
-  
-  if( rtreePolygons_ ) {
-    delete rtreePolygons_;
-    rtreePolygons_ = 0;
-  }
-  
-  containerPolygons_.clear();
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <TePDIRaster2Vector.hpp>
+#include <TeAgnostic.h>
+#include <TePDIUtils.hpp>
+
+#include <TeUtils.h>
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+#include <float.h>
+
+//these are the 8 cardinals directions used to parcour an edge
+#define NW 0
+#define N  1
+#define EN 2
+#define E  3
+#define SE 4
+#define S  5
+#define WS 6
+#define W  7
+
+
+TePDIRaster2Vector::TePDIRaster2Vector()
+{
+  raster_uses_dummy_ = false;
+  dummy_value_ = 0;
+  containerPolygons_.clear();
+  rtreePolygons_=NULL;
+  raster_channel_ = 0;
+  
+  /* Updating the directions  */
+  
+  directions_[ 0 ] = TeCoord2D( -1, -1 );  /* NW - 0 */
+  directions_[ 1 ] = TeCoord2D(  0, -1 );  /* N  - 1 */
+  directions_[ 2 ] = TeCoord2D(  1, -1 );  /* EN - 2 */
+  directions_[ 3 ] = TeCoord2D(  1,  0 );  /* E  - 3 */
+  directions_[ 4 ] = TeCoord2D(  1,  1 );  /* SE - 4 */
+  directions_[ 5 ] = TeCoord2D(  0,  1 );  /* S  - 5 */
+  directions_[ 6 ] = TeCoord2D( -1,  1 );  /* WS - 6 */
+  directions_[ 7 ] = TeCoord2D( -1,  0 );  /* W  - 7 */  
+}
+
+TePDIRaster2Vector::~TePDIRaster2Vector()
+{
+  clear();
+}
+
+bool
+TePDIRaster2Vector :: CheckParameters( 
+  const TePDIParameters& parameters ) const {
+  /* Checking for general required parameters */
+
+  //parameter input_image
+  TePDITypes::TePDIRasterPtrType inRaster;
+  if( ! parameters.GetParameter( "rotulated_image", inRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: rotulated_image" );
+    return false;
+  }
+  if( ! inRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: rotulated_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: rotulated_image not ready" );
+    return false;
+  }
+  
+  /* Checking output_polsets */
+  
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.CheckParameter< TePDITypes::TePDIPolSetMapPtrType >( 
+    "output_polsets" ), "Missing parameter: output_polsets" );
+  
+  TePDITypes::TePDIPolSetMapPtrType output_polsets;
+  parameters.GetParameter( "output_polsets", output_polsets );
+            
+  TEAGN_TRUE_OR_RETURN( output_polsets.isActive(),
+    "Invalid parameter output_polsets : Inactive polygon set pointer" );
+
+  /* Checking channel */
+  
+  unsigned int channel = 0;
+  
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "channel", channel ), 
+    "Missing parameter: channel" );
+    
+  TEAGN_TRUE_OR_RETURN( ( channel < (unsigned int)inRaster->nBands() ),
+    "Invalid parameter: channel" );
+    
+  /* checking rotulated_image data type */
+  
+  for( int band = 0 ; band < inRaster->params().nBands() ; ++band ) {
+    TEAGN_TRUE_OR_RETURN( 
+      ( inRaster->params().dataType_[ band ] != TeFLOAT ), 
+      "Invalid rotulated_image floating point raster data type" );
+    TEAGN_TRUE_OR_RETURN( 
+      ( inRaster->params().dataType_[ band ] != TeDOUBLE ), 
+      "Invalid rotulated_image floating point raster data type" );    
+  }  
+    
+  return true;
+}
+
+
+bool TePDIRaster2Vector::RunImplementation()
+{
+  clear();
+  
+  /* Extratcting parameters */
+  
+  params_.GetParameter( "rotulated_image", raster_ );
+  params_.GetParameter( "channel", raster_channel_ );  
+  
+  unsigned long int max_pols = 0;
+  if( params_.CheckParameter< unsigned long int >( "max_pols" ) ) {
+    params_.GetParameter( "max_pols", max_pols );
+  }
+  
+  /* Guessing dummy use */
+        
+  raster_uses_dummy_ = raster_->params().useDummy_;
+  dummy_value_ = 0;
+  if( raster_uses_dummy_ ) {
+    dummy_value_ = raster_->params().dummy_[ 0 ];
+  }
+
+  //attributes of the raster
+  
+  resx_ = raster_->params().resx_ ;
+  resy_ = raster_->params().resy_ ;
+
+  const TeBox raster_bbox=raster_->params().boundingBox();
+  nCols_  = raster_->params().ncols_;
+  nLines_ = raster_->params().nlines_;
+
+  //declarations
+        
+  double val;
+  int i,j;
+
+  /* Creating a new RTree */
+  
+  rtreePolygons_ = new TeSAM::TeRTree<unsigned int, 8, 4>(
+    raster_->params().boundingBox());
+    
+  int countObjects = 0;
+  vector<unsigned int> indexVec;
+
+  StartProgInt( "Vectorizing...", nLines_ );
+                
+  // scanning rotulated image in row order to vectorize the cells
+  
+  TeCoord2D last_line_ll_point;
+  TeCoord2D last_line_ll_point_indexed;
+  TeCoord2D last_line_lr_point;
+  TeCoord2D last_line_lr_point_indexed;  
+  
+  for ( j = 0 ; j < nLines_ ; j++) {
+    TEAGN_FALSE_OR_RETURN( UpdateProgInt( j ), "Canceled by the user" );
+    
+    /* Cleaning the tileindexers that will not be used anymore */
+    
+    last_line_ll_point_indexed.setXY( 0, ( (double)j ) - 1.0 );
+    last_line_lr_point_indexed.setXY( ( (double)nCols_ ) - 1, 
+      ( (double)j ) - 1.0 );
+    
+    last_line_ll_point = raster_->index2Coord( 
+      last_line_ll_point_indexed );
+    last_line_lr_point = raster_->index2Coord( 
+      last_line_lr_point_indexed );
+            
+    TeBox last_line_bbox( last_line_ll_point,
+      last_line_lr_point );
+      
+    indexVec.clear();
+    rtreePolygons_->search( last_line_bbox, indexVec ); 
+    
+    for( unsigned int indexVec_index = 0 ;
+      indexVec_index < indexVec.size() ; ++indexVec_index ) {
+      
+      TePDIRaster2VectorPolStruct& curr_pol_struct =
+        containerPolygons_[ indexVec[ indexVec_index ] ];
+      
+      if( raster_->coord2Index( 
+        curr_pol_struct.poly_.box().lowerLeft() ).y() < j ) {
+        
+        curr_pol_struct.indexer_->clear();
+      }
+    }
+      
+    /* iterating through columns */
+    
+    for ( i = 0 ; i < nCols_ ; i++) {
+      /* Virifying if the current point is already inside a polygon generated
+         before */
+         
+      TeCoord2D coordMatrix(i, j);
+      TeCoord2D coordWorld = raster_->index2Coord(coordMatrix);
+      TeBox boxPoint(coordWorld, coordWorld);
+      bool exist = false;  
+      
+      indexVec.clear();
+      rtreePolygons_->search( boxPoint, indexVec );
+      
+      if( ! raster_->getElement(i,j,val,raster_channel_) ) {
+        val = dummy_value_;
+      }      
+      
+      if ( ! indexVec.empty() ) {
+        unsigned int indexVec_index = 0;        
+
+        while( indexVec_index < indexVec.size() ) {
+          TEAGN_DEBUG_CONDITION( 
+            ( indexVec[ indexVec_index ] < containerPolygons_.size() ),
+            "Invalid cadidates vector index" );
+    
+          const TePDIRaster2VectorPolStruct& pol_str_ref = 
+            containerPolygons_[ indexVec[ indexVec_index ] ];
+      
+          if ( val == pol_str_ref.value_ ) {
+            if( TePDIUtils::TeRelation( coordWorld, 
+              *( pol_str_ref.indexer_ ) ) == TeINSIDE ) {
+                 
+              exist = true;
+              break;
+            }        
+          }
+          
+          ++indexVec_index;
+        }                
+      }
+
+      if( ! exist ) {
+         //we found a new class
+         
+        TeLine2D line; 
+         
+        if( detectEdge( i, j, line ) ) {
+          try {
+            TePolygon poly;
+            poly.add( line );
+            
+            /* Verifying if the polygon is a hole of other one */
+              
+            unsigned int indexVec_index = 0;
+            
+            while( indexVec_index < indexVec.size() ) {
+              TePDIRaster2VectorPolStruct& pol_struct_ref = 
+                containerPolygons_[ indexVec[ indexVec_index ] ];
+              TePDITileIndexer& indexer_ref = *( pol_struct_ref.indexer_ );
+              TePolygon& pol_ref = pol_struct_ref.poly_;
+            
+              if( TePDIUtils::TeRelation( coordWorld, indexer_ref ) == 
+                TeINSIDE ) {
+              
+                pol_ref.add( poly.first() );
+                indexer_ref.addRing( pol_ref.size() - 1 );
+                  
+                break;
+              }
+              
+              ++indexVec_index;
+            }
+            
+            /* free indexVec */
+            
+            indexVec.clear();
+            
+            // inserting the new polygon into tree and container
+            
+            if( raster_uses_dummy_ && ( val == dummy_value_ ) ) {
+              poly.objectId( "none" );
+            } else {
+              ++countObjects;
+              poly.objectId( Te2String( countObjects ) );
+            }
+            
+            TePDIRaster2VectorPolStruct dummy_ps;
+            containerPolygons_.push_back( dummy_ps );
+ 
+            containerPolygons_[ containerPolygons_.size() - 
+              1 ].reset( poly, (int)val, 
+              MAX( 
+                  (
+                    4.0 * poly.box().height() 
+                    /
+                    (
+                      poly.box().width()
+                      *
+                      ( (double) poly[ 0 ].size() )
+                    )
+                  )
+                  ,
+                  raster_->params().resy_
+                 )
+            );                                  
+      
+            rtreePolygons_->insert( poly.box(), containerPolygons_.size() - 1 );  
+          }
+          catch(...) {
+            TEAGN_LOGERR( "Error generating polygon - "
+              "not enough memory" );
+              
+            /* no more polygons will be generated */    
+            i = nCols_;
+            j = nLines_;              
+          }
+        } else {
+          /* no more polygons will be generated */
+          i = nCols_;
+          j = nLines_;
+        }
+        
+        if( max_pols ) {
+          if( countObjects >= ( (int)max_pols ) ) {
+            /* no more polygons will be generated */
+            i = nCols_;
+            j = nLines_;          
+          }
+        }
+      }
+    }
+  }
+  
+  /* Cleaning the tree */
+  
+  delete rtreePolygons_;
+  rtreePolygons_ = 0;
+        
+  /* Generating output data */
+  
+  TePDITypes::TePDIPolSetMapPtrType output_polsets;
+  params_.GetParameter( "output_polsets", output_polsets );
+      
+  output_polsets->clear();
+  
+  std::map< double, TePolygonSet >::iterator psm_it;
+    
+  std::vector<TePDIRaster2VectorPolStruct>::iterator cpit = 
+    containerPolygons_.begin();
+  std::vector<TePDIRaster2VectorPolStruct>::iterator cpit_end = 
+    containerPolygons_.end();
+  
+  double value = 0;
+    
+  try {
+    while( cpit != cpit_end ) {
+      value = (double)cpit->value_;
+    
+      if( ( ! raster_uses_dummy_ ) || ( value != dummy_value_ ) ) {
+        psm_it = output_polsets->find( value );
+        
+        if( psm_it == output_polsets->end() ) {
+          TePolygonSet dummy_ps;
+          dummy_ps.add( cpit->poly_ );
+          
+          (*output_polsets)[ value ] = dummy_ps;
+        } else {
+          psm_it->second.add( cpit->poly_ );
+        }
+      }
+      
+      cpit->clear();
+      
+      ++cpit;
+    }
+  }
+  catch(...) {
+    TEAGN_LOG_AND_THROW( 
+      "Memory error - error generating output polygons sets map" )
+  }
+                
+  return true;
+}
+
+void
+TePDIRaster2Vector::ResetState( const TePDIParameters& /* params */ )
+{
+  clear();       
+}
+
+
+bool TePDIRaster2Vector::detectEdge(long i, long j, TeLine2D &line )
+{
+  TEAGN_DEBUG_RETURN( startingEdgeTest( i, j ), 
+    "Starting edge detection error at x=" + Te2String( i ) + " line=" +
+    Te2String( j ) )
+    
+  line.clear();
+    
+  try {
+    /* Current polygon pixel values */
+    
+    double pol_pixels_value = 0;
+    
+    if( ! raster_->getElement(i, j, pol_pixels_value, raster_channel_ ) ) {
+      pol_pixels_value = dummy_value_;
+    }  
+    
+    /* Generating chaing code by following the polygon borders */
+    
+    short curr_dir = E;
+    short new_dir = E;
+    short new_test_start_dir = E;
+    short curr_pixel_corner = NW;
+    
+    short pinit_leaving_dir = W;
+    bool pinit_leaving_dir_set = false;
+    
+    TeCoord2D curr_chain_p = TeCoord2D( 0, 0 );
+
+    int curr_x_index = i;
+    int curr_y_index = j;
+    int next_x_index = i;
+    int next_y_index = j;
+    
+    double curr_pixel_value = 0;
+    
+    bool look_for_next_pixel = true;
+    bool next_pixel_found = false;
+    bool must_add_curr_chain_p = false;
+    
+    line.add( curr_chain_p );
+    
+    while( look_for_next_pixel ) {
+      /* Finding the next direction */
+          
+      new_test_start_dir = ( curr_dir + 6 ) % 8;
+      new_dir = new_test_start_dir;
+      next_pixel_found = false;
+          
+      do {
+        next_x_index = curr_x_index + (int)( directions_[new_dir].x() );
+        next_y_index = curr_y_index + (int)( directions_[new_dir].y() );
+              
+        if( ( next_x_index > (-1) ) && ( next_y_index > (-1) ) && 
+          ( next_x_index < nCols_ ) && ( next_y_index < nLines_ ) ) {
+                
+          if( ! raster_->getElement( next_x_index, next_y_index, 
+            curr_pixel_value, raster_channel_ ) ) {
+                          
+            curr_pixel_value = dummy_value_;  
+          }
+                          
+          if ( curr_pixel_value == pol_pixels_value ){
+            next_pixel_found = true;
+            break;
+          }
+        }
+              
+        new_dir = ( new_dir + 2 ) % 8;
+      } while( new_dir != new_test_start_dir );
+      
+      /* Generating the polygon line following the current state */
+      
+        if( ! next_pixel_found ) {
+          // there is only one point inside the polygon
+          // that is the last one
+          
+          curr_chain_p += ( directions_[ E ] );
+          line.add( curr_chain_p );
+          
+          curr_chain_p += ( directions_[ S ] );
+          line.add( curr_chain_p );
+          
+          curr_chain_p += ( directions_[ W ] );
+          line.add( curr_chain_p );
+          
+          curr_chain_p += ( directions_[ N ] );
+          line.add( curr_chain_p );                        
+                        
+          look_for_next_pixel = false;
+        } else if( ( curr_x_index == i ) && ( curr_y_index == j ) &&
+          ( pinit_leaving_dir == new_dir ) ) {
+        
+          /* We are back to the fist pixel again
+            ( going to the same direction ) */
+          
+          switch( curr_pixel_corner ) {
+            case EN :
+            {
+              curr_chain_p += ( directions_[ S ] );
+              line.add( curr_chain_p );
+          
+              curr_chain_p += ( directions_[ W ] );
+              line.add( curr_chain_p );
+          
+              curr_chain_p += ( directions_[ N ] );
+              line.add( curr_chain_p );
+              
+              break;
+            }
+            case SE :
+            { 
+              curr_chain_p += ( directions_[ W ] );
+              line.add( curr_chain_p );
+          
+              curr_chain_p += ( directions_[ N ] );
+              line.add( curr_chain_p );
+              
+              break;
+            }
+            case WS :
+            {
+              curr_chain_p += ( directions_[ N ] );
+              line.add( curr_chain_p );
+                        
+              break;
+            }
+            default :
+            {
+              TEAGN_LOG_AND_RETURN( "Invalid pixel corner=" + 
+                Te2String( curr_pixel_corner) + " curr_dir=" + 
+                Te2String( curr_dir ) );
+              break;
+            }
+          }      
+         
+          look_for_next_pixel = false;   
+        } else {
+          /* Updating current chain point and current pixel corner */
+          
+          if( curr_dir == new_dir ) {
+            curr_chain_p += ( directions_[ curr_dir ] );
+            
+            must_add_curr_chain_p = true;
+          } else {
+            if( must_add_curr_chain_p ) {
+              line.add( curr_chain_p );
+              
+              must_add_curr_chain_p = false;
+            }
+          
+            switch( new_dir ) {
+              case E:
+              {
+                switch( curr_pixel_corner ) {
+                  case NW :
+                  {
+                    curr_chain_p += ( directions_[ E ] );
+                    line.add( curr_chain_p );
+                          
+                    break;
+                  }
+                  case EN :
+                  {
+                    curr_pixel_corner = NW;
+                    break;
+                  }
+                  case SE :
+                  { 
+                    curr_chain_p += ( directions_[ W ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ N ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ E ] );
+                    line.add( curr_chain_p );                                                      
+                    
+                    curr_pixel_corner = NW;
+                    break;
+                  }
+                  case WS :
+                  {
+                    curr_chain_p += ( directions_[ N ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ E ] );
+                    line.add( curr_chain_p );                    
+                    
+                    curr_pixel_corner = NW;
+                    break;
+                  }
+                  default :
+                  {
+                    TEAGN_LOG_AND_THROW( "Invalid pixel corner" )
+                    break;
+                  }
+                }
+                
+                break;
+              }
+              case S:
+              {
+                switch( curr_pixel_corner ) {
+                  case NW :
+                  {
+                    curr_chain_p += ( directions_[ E ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ S ] );
+                    line.add( curr_chain_p );  
+                                    
+                    curr_pixel_corner = EN;  
+                    break;
+                  }
+                  case EN :
+                  {
+                    curr_chain_p += ( directions_[ S ] );
+                    line.add( curr_chain_p );
+                                    
+                    break;
+                  }
+                  case SE :
+                  {
+                    curr_pixel_corner = EN;
+                    break;
+                  }
+                  case WS :
+                  {
+                    curr_chain_p += ( directions_[ N ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ E ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ S ] );
+                    line.add( curr_chain_p );                 
+                  
+                    curr_pixel_corner = EN;
+                    break;
+                  }
+                  default :
+                  {
+                    TEAGN_LOG_AND_THROW( "Invalid pixel corner" )
+                    break;
+                  }
+                }
+                
+                break;
+              }    
+              case W:
+              {
+                switch( curr_pixel_corner ) {
+                  case NW :
+                  {
+                    curr_chain_p += ( directions_[ E ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ S ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ W ] );
+                    line.add( curr_chain_p ); 
+                                    
+                    curr_pixel_corner = SE;  
+                    break;
+                  }
+                  case EN :
+                  {
+                    curr_chain_p += ( directions_[ S ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ W ] );
+                    line.add( curr_chain_p ); 
+                                    
+                    curr_pixel_corner = SE;
+                    break;
+                  }
+                  case SE :
+                  {
+                    curr_chain_p += ( directions_[ W ] );
+                    line.add( curr_chain_p ); 
+                                    
+                    break;
+                  }
+                  case WS :
+                  {
+                    curr_pixel_corner = SE;
+                    break;
+                  }
+                  default :
+                  {
+                    TEAGN_LOG_AND_THROW( "Invalid pixel corner" )
+                    break;
+                  }
+                }
+                
+                break;
+              }
+              case N:
+              {
+                switch( curr_pixel_corner ) {
+                  case NW :
+                  {
+                    curr_pixel_corner = WS;  
+                    break;
+                  }
+                  case EN :
+                  {
+                    curr_chain_p += ( directions_[ S ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ W ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ N ] );
+                    line.add( curr_chain_p );
+                                    
+                    curr_pixel_corner = WS;  
+                    break;
+                  }
+                  case SE :
+                  {
+                    curr_chain_p += ( directions_[ W ] );
+                    line.add( curr_chain_p );
+                    
+                    curr_chain_p += ( directions_[ N ] );
+                    line.add( curr_chain_p );
+                                    
+                    curr_pixel_corner = WS;  
+                    break;
+                  }
+                  case WS :
+                  {
+                    curr_chain_p += ( directions_[ N ] );
+                    line.add( curr_chain_p );                
+
+                    break;
+                  }
+                  default :
+                  {
+                    TEAGN_LOG_AND_THROW( "Invalid pixel corner" )
+                    break;
+                  }
+                }
+              
+                break;
+              }
+              default :
+              {
+                TEAGN_LOG_AND_THROW( "Invalid new_dir" )
+                break;
+              }
+            }
+          }
+            
+          /* Updating the leaving direction from the initial point */
+          
+          if( ( ! pinit_leaving_dir_set ) && ( curr_x_index == i ) && 
+              ( curr_y_index == j ) ) {
+                
+            pinit_leaving_dir_set = true;
+            pinit_leaving_dir = new_dir;
+          }           
+            
+          /* updating the current state */
+          
+          curr_x_index = next_x_index;
+          curr_y_index = next_y_index;  
+          
+          curr_dir = new_dir;         
+        }
+    }
+      
+    /* Changing lines coords to world coords */
+    
+    const TeCoord2D chain_init_p = raster_->index2Coord( TeCoord2D( 
+      ( (double)i ) - 0.5, ( (double)j ) - 0.5 ) );  
+      
+    TeLine2D::iterator it = line.begin();
+    TeLine2D::iterator it_end = line.end();
+    
+    double min_x = DBL_MAX;
+    double min_y = DBL_MAX;
+    double max_x = ( -1.0 ) * DBL_MAX;
+    double max_y = ( -1.0 ) * DBL_MAX;
+    
+    while( it != it_end ) {
+      it->x_ = chain_init_p.x_ + ( it->x_ * resx_ );
+      it->y_ = chain_init_p.y_ - ( it->y_ * resy_ );
+      
+      if( it->x_ < min_x ) min_x = it->x_;
+      if( it->y_ < min_y ) min_y = it->y_;
+
+      if( it->x_ > max_x ) max_x = it->x_;
+      if( it->y_ > max_y ) max_y = it->y_;
+      
+      ++it;
+    }
+    
+    /* Updating the line box */
+    
+    TeBox newbox( min_x, min_y, max_x, max_y );
+    line.setBox( newbox );
+    
+    /* Closing the line, if necessary */
+    
+    if( line.size() > 1 ) {
+      if( ( line[ 0 ].x() != line[ line.size() - 1 ].x() ) ||
+        ( line[ 0 ].y() != line[ line.size() - 1 ].y() ) ) {
+        
+        line.add( line[ 0 ] );
+      }
+    }  
+  }
+  catch(...) {
+    line.clear();
+    
+    TEAGN_LOG_AND_RETURN( "Unable to detect edge - "
+      "not enough memory" )
+  }
+
+  return true;
+}
+
+
+bool TePDIRaster2Vector::startingEdgeTest( const int& x, 
+  const int& y )
+{
+  int nlines = raster_->params().nlines_;
+  int ncols = raster_->params().ncols_;
+
+  TEAGN_TRUE_OR_RETURN( ( y < nlines ), 
+    "Invalid col [" + Te2String( x ) + "]" );
+  TEAGN_TRUE_OR_RETURN( ( x < ncols ), 
+    "Invalid line [" + Te2String( y ) + "]" );
+    
+  if( ( x == 0 ) || ( y == 0 ) || ( x == ( ncols - 1 ) ) || 
+    ( y == ( nlines - 1 ) ) ) {
+    
+    return true;
+  } else {
+    double test_val = 0;
+    double current_val = 0;  
+  
+    if( ! raster_->getElement(x, y, current_val, raster_channel_ ) ) {
+      TEAGN_TRUE_OR_RETURN( raster_uses_dummy_, "Raster read error" );
+      current_val = dummy_value_;
+    }
+    
+    if( ! raster_->getElement(x - 1, y, test_val, raster_channel_ ) ) {
+      TEAGN_TRUE_OR_RETURN( raster_uses_dummy_, "Raster read error" );
+      test_val = dummy_value_;
+    }  
+  
+    TEAGN_TRUE_OR_RETURN( ( current_val != test_val ), 
+      "The given point isn't a starting edge [x=" + Te2String( x ) +
+      " y=" + Te2String( y ) + "]" );
+      
+    return true;
+  }
+}
+
+
+void TePDIRaster2Vector::clear()
+{
+  raster_.reset();
+  
+  if( rtreePolygons_ ) {
+    delete rtreePolygons_;
+    rtreePolygons_ = 0;
+  }
+  
+  containerPolygons_.clear();
+}
+
diff --git a/src/terralib/image_processing/TePDIRaster2Vector.hpp b/src/terralib/image_processing/TePDIRaster2Vector.hpp
old mode 100755
new mode 100644
index 526bcca..3f08671
--- a/src/terralib/image_processing/TePDIRaster2Vector.hpp
+++ b/src/terralib/image_processing/TePDIRaster2Vector.hpp
@@ -1,315 +1,315 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/**
- * @file TePDIRaster2Vector.hpp
- *
- * @brief This file contains functions to support vectorizing of
- * raster data into a TerraLib database
- * the input raster is a 4-connected rotulated image :
- *               *each region is for 4-connected
- *               *each region has a unique identifier
- */
-
-#ifndef  TEPDIRASTER2VECTOR_HPP
-  #define  TEPDIRASTER2VECTOR_HPP
-
-  #include "TePDIParameters.hpp"
-  #include "TePDIAlgorithm.hpp"
-
-  #include "data_structs/TeTileIndexer.h"
-  
-  #include <TeRaster.h>
-  #include <TeLayer.h>
-  #include <TeRTree.h>
-
-
-  /**
-    *  @brief A polygon container node class. 
-    */    
-  class PDI_DLL TePDIRaster2VectorPolStruct
-  {
-    public:
-    
-      /**
-      * @brief The value ( color ) related to a polygon.
-      */
-      int value_;
-
-      /**
-      * @brief The polygon tile indexer Y Axis resolution.
-      */
-      double tile_indexer_dy_;
-      
-      /**
-      * @brief The polygon tile indexer pointer.
-      */
-      TeTileIndexer* indexer_;    
-      
-      /**
-      * @brief The stored polygon instance.
-      */
-      TePolygon poly_;
-      
-      /**
-      * @brief Init internal variables.
-      */    
-      void init()
-      {
-        value_ = 0;
-        tile_indexer_dy_ = 1.0;
-        indexer_ = 0;
-      };
-      
-      /**
-      * @brief Init internal variables.
-      */    
-      void clear()
-      {
-        if( indexer_ ) {
-          delete indexer_;
-        }
-        
-        init();
-      };    
-      
-      /**
-      * @brief Default constructor.
-      */       
-      TePDIRaster2VectorPolStruct()
-      {
-        init();
-      };
-      
-      /**
-      * @brief Alternative constructor.
-      * @param external External reference.
-      */       
-      TePDIRaster2VectorPolStruct( 
-        const TePDIRaster2VectorPolStruct& external )
-      {
-        init();
-        
-        reset( external.poly_, external.value_, 
-          external.tile_indexer_dy_ );
-      }
-      
-      /**
-      * @brief Alternative constructor.
-      * @param p Polygon reference.
-      * @param v V.
-      * @param tile_indexer_dy Tile indexer dy.
-      */       
-      TePDIRaster2VectorPolStruct( const TePolygon& p, 
-        const int& v, 
-        const double& tile_indexer_dy )
-      {
-        init();
-        
-        reset( p, v, tile_indexer_dy );
-      }
-      
-      /**
-      * @brief Default destructor.
-      */       
-      ~TePDIRaster2VectorPolStruct()
-      {
-        clear();
-      };      
-      
-      /**
-      * @brief Operator= overload.
-      * @param external External reference.
-      * @return a reference to the external object.
-      */         
-      const TePDIRaster2VectorPolStruct& operator=( 
-        const TePDIRaster2VectorPolStruct& external )
-      {
-        reset( external.poly_, external.value_, 
-          external.tile_indexer_dy_ );
-          
-        return external;
-      }
-      
-      /**
-      * @brief Reset the current instance.
-      * @param p Polygon reference.
-      * @param v V.
-      * @param tile_indexer_dy Tile indexer dy.
-      */       
-      void reset( const TePolygon& p, const int& v, 
-        const double& tile_indexer_dy )
-      {
-        clear();
-        
-        poly_ = p;
-        value_ = v;
-        tile_indexer_dy_ = tile_indexer_dy;
-        
-        indexer_ = new TeTileIndexer( poly_, 
-          tile_indexer_dy_ );       
-      }
-  };
-
-  /**
-    * @brief Raster vectorizer.
-    * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-    * @author Eric S. Abreu <eric at dpi.inpe.br>
-    * @author Gilberto Ribeiro de Quiroz <gribeiro at dpi.inpe.br>
-    * @author Nicolas Despres <nicolasdespres at wanadoo.fr>
-    * @ingroup TePDIGeneralAlgoGroup
-    *
-    * @note The general required parameters by TePDIRaster2Vector :
-    *
-    * @param rotulated_image (TePDITypes::TePDIRasterPtrType),
-    * The rotulated_image raster ( 1 band, not floating point, 4-connected 
-    * - each region is for 4-connected ).
-    * @param output_polsets ( TePDITypes::TePDIPolSetMapPtrType ) - 
-    * The user supplied output polygon sets map where the generated polygons 
-    * will be stored (each polygon set contains polygons related to the
-    * same pixel value).
-    * @param channel (unsigned int) - The raster channel to process.
-    *
-    * @note Optional parameters:
-    *
-    * @param max_pols (unsigned long int) - The maximum number of poligons
-    * to generate (default:0 - no maximum defined).
-    */
-  class PDI_DLL TePDIRaster2Vector : public TePDIAlgorithm
-  {
-    public:
-    /** @typedef Type definition for a instance pointer */
-    typedef TeSharedPtr< TePDIRaster2Vector > pointer;
-    /** @typedef Type definition for a const instance pointer */
-    typedef const TeSharedPtr< TePDIRaster2Vector > const_pointer;
-
-    /**
-      * @brief Default Constructor.
-      */
-    TePDIRaster2Vector();
-
-    /**
-      * @brief Default destructor.
-      */
-    ~TePDIRaster2Vector();
-
-    /**
-      * @brief Checks if the supplied parameters fits the requirements of each
-      * PDI algorithm implementation.
-      *
-      * @note Error log messages must be generated. No exceptions generated.
-      *
-      * @param parameters The parameters to be checked.
-      * @return true if the parameters are OK. false if not.
-      */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-
-    protected:
-
-      /**
-      * @brief Flag indication for dummy value use ( rotulated image ).
-      */
-      bool raster_uses_dummy_;
-      
-      /**
-      * @brief The used dummy value.
-      */
-      double dummy_value_;
-      
-      /**
-      * @brief Directions vector.
-      */ 
-      TeCoord2D directions_[8];  
-      
-      /** @brief pointer to the input image */
-      TePDITypes::TePDIRasterPtrType raster_;
-
-      /** @brief resolution x */
-      double resx_;
-      
-      /** @brief resolution y */
-      double resy_;
-      
-      /** @brief number of lines */
-      long   nLines_;
-      
-      /** @brief number of cols */
-      long   nCols_;
-
-      /** @brief number of cols */
-      unsigned int raster_channel_;
-      
-      /** 
-      *  @brief A RTree instance pointer to optimize the searching of points
-      *  inside already created polygons 
-      */
-      TeSAM::TeRTree<unsigned int, 8, 4>*    rtreePolygons_;
-      
-      /** @brief Vector of all polygons */
-      vector<TePDIRaster2VectorPolStruct>  containerPolygons_;    
-      
-      /**
-      * @brief Runs the current algorithm implementation.
-      *
-      * @return true if OK. false on error.
-      */
-      bool RunImplementation();
-
-      /**
-      * @brief Reset the internal state to the initial state.
-      *
-      * @param params The new parameters referente at initial state.
-      */
-      void ResetState( const TePDIParameters& params );
-
-      /**
-        * @brief Detects a edge of a cell in Raster.
-        *
-        * @param i abscissa( column ) of the upper-left point of the shape
-        * @param j ordinate( line ) of the upper-left point of the shape
-        * @param line 2D Line.
-        * @return true if ok, otherwise false
-        */
-      bool detectEdge(long i, long j, TeLine2D &line );
-        
-      /**
-      * @brief Tests if the current point is a edge start.
-      * @param x X coord.
-      * @param y Y coord.
-      * @return true if the current point is a edge start, false if not.
-      */
-      bool startingEdgeTest( const int& x, const int& y );
-      
-      /**
-      * @brief Clear all internally allocated resources.
-      */
-      void clear();    
-
-  };
-
-
-  /** @example TePDIRaster2Vector_test.cpp
-  *    Shows how to use this class.
-  */  
- 
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/**
+ * @file TePDIRaster2Vector.hpp
+ *
+ * @brief This file contains functions to support vectorizing of
+ * raster data into a TerraLib database
+ * the input raster is a 4-connected rotulated image :
+ *               *each region is for 4-connected
+ *               *each region has a unique identifier
+ */
+
+#ifndef  TEPDIRASTER2VECTOR_HPP
+  #define  TEPDIRASTER2VECTOR_HPP
+
+  #include "TePDIParameters.hpp"
+  #include "TePDIAlgorithm.hpp"
+
+  #include "TePDITileIndexer.hpp"
+  
+  #include <TeRaster.h>
+  #include <TeLayer.h>
+  #include <TeRTree.h>
+
+
+  /**
+    *  @brief A polygon container node class. 
+    */    
+  class PDI_DLL TePDIRaster2VectorPolStruct
+  {
+    public:
+    
+      /**
+      * @brief The value ( color ) related to a polygon.
+      */
+      int value_;
+
+      /**
+      * @brief The polygon tile indexer Y Axis resolution.
+      */
+      double tile_indexer_dy_;
+      
+      /**
+      * @brief The polygon tile indexer pointer.
+      */
+      TePDITileIndexer* indexer_;    
+      
+      /**
+      * @brief The stored polygon instance.
+      */
+      TePolygon poly_;
+      
+      /**
+      * @brief Init internal variables.
+      */    
+      void init()
+      {
+        value_ = 0;
+        tile_indexer_dy_ = 1.0;
+        indexer_ = 0;
+      };
+      
+      /**
+      * @brief Init internal variables.
+      */    
+      void clear()
+      {
+        if( indexer_ ) {
+          delete indexer_;
+        }
+        
+        init();
+      };    
+      
+      /**
+      * @brief Default constructor.
+      */       
+      TePDIRaster2VectorPolStruct()
+      {
+        init();
+      };
+      
+      /**
+      * @brief Alternative constructor.
+      * @param external External reference.
+      */       
+      TePDIRaster2VectorPolStruct( 
+        const TePDIRaster2VectorPolStruct& external )
+      {
+        init();
+        
+        reset( external.poly_, external.value_, 
+          external.tile_indexer_dy_ );
+      }
+      
+      /**
+      * @brief Alternative constructor.
+      * @param p Polygon reference.
+      * @param v V.
+      * @param tile_indexer_dy Tile indexer dy.
+      */       
+      TePDIRaster2VectorPolStruct( const TePolygon& p, 
+        const int& v, 
+        const double& tile_indexer_dy )
+      {
+        init();
+        
+        reset( p, v, tile_indexer_dy );
+      }
+      
+      /**
+      * @brief Default destructor.
+      */       
+      ~TePDIRaster2VectorPolStruct()
+      {
+        clear();
+      };      
+      
+      /**
+      * @brief Operator= overload.
+      * @param external External reference.
+      * @return a reference to the external object.
+      */         
+      const TePDIRaster2VectorPolStruct& operator=( 
+        const TePDIRaster2VectorPolStruct& external )
+      {
+        reset( external.poly_, external.value_, 
+          external.tile_indexer_dy_ );
+          
+        return external;
+      }
+      
+      /**
+      * @brief Reset the current instance.
+      * @param p Polygon reference.
+      * @param v V.
+      * @param tile_indexer_dy Tile indexer dy.
+      */       
+      void reset( const TePolygon& p, const int& v, 
+        const double& tile_indexer_dy )
+      {
+        clear();
+        
+        poly_ = p;
+        value_ = v;
+        tile_indexer_dy_ = tile_indexer_dy;
+        
+        indexer_ = new TePDITileIndexer( poly_, 
+          tile_indexer_dy_ );       
+      }
+  };
+
+  /**
+    * @brief Raster vectorizer.
+    * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+    * @author Eric S. Abreu <eric at dpi.inpe.br>
+    * @author Gilberto Ribeiro de Quiroz <gribeiro at dpi.inpe.br>
+    * @author Nicolas Despres <nicolasdespres at wanadoo.fr>
+    * @ingroup TePDIGeneralAlgoGroup
+    *
+    * @note The general required parameters by TePDIRaster2Vector :
+    *
+    * @param rotulated_image (TePDITypes::TePDIRasterPtrType),
+    * The rotulated_image raster ( 1 band, not floating point, 4-connected 
+    * - each region is for 4-connected ).
+    * @param output_polsets ( TePDITypes::TePDIPolSetMapPtrType ) - 
+    * The user supplied output polygon sets map where the generated polygons 
+    * will be stored (each polygon set contains polygons related to the
+    * same pixel value).
+    * @param channel (unsigned int) - The raster channel to process.
+    *
+    * @note Optional parameters:
+    *
+    * @param max_pols (unsigned long int) - The maximum number of poligons
+    * to generate (default:0 - no maximum defined).
+    */
+  class PDI_DLL TePDIRaster2Vector : public TePDIAlgorithm
+  {
+    public:
+    /** @typedef Type definition for a instance pointer */
+    typedef TeSharedPtr< TePDIRaster2Vector > pointer;
+    /** @typedef Type definition for a const instance pointer */
+    typedef const TeSharedPtr< TePDIRaster2Vector > const_pointer;
+
+    /**
+      * @brief Default Constructor.
+      */
+    TePDIRaster2Vector();
+
+    /**
+      * @brief Default destructor.
+      */
+    ~TePDIRaster2Vector();
+
+    /**
+      * @brief Checks if the supplied parameters fits the requirements of each
+      * PDI algorithm implementation.
+      *
+      * @note Error log messages must be generated. No exceptions generated.
+      *
+      * @param parameters The parameters to be checked.
+      * @return true if the parameters are OK. false if not.
+      */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected:
+
+      /**
+      * @brief Flag indication for dummy value use ( rotulated image ).
+      */
+      bool raster_uses_dummy_;
+      
+      /**
+      * @brief The used dummy value.
+      */
+      double dummy_value_;
+      
+      /**
+      * @brief Directions vector.
+      */ 
+      TeCoord2D directions_[8];  
+      
+      /** @brief pointer to the input image */
+      TePDITypes::TePDIRasterPtrType raster_;
+
+      /** @brief resolution x */
+      double resx_;
+      
+      /** @brief resolution y */
+      double resy_;
+      
+      /** @brief number of lines */
+      long   nLines_;
+      
+      /** @brief number of cols */
+      long   nCols_;
+
+      /** @brief number of cols */
+      unsigned int raster_channel_;
+      
+      /** 
+      *  @brief A RTree instance pointer to optimize the searching of points
+      *  inside already created polygons 
+      */
+      TeSAM::TeRTree<unsigned int, 8, 4>*    rtreePolygons_;
+      
+      /** @brief Vector of all polygons */
+      vector<TePDIRaster2VectorPolStruct>  containerPolygons_;    
+      
+      /**
+      * @brief Runs the current algorithm implementation.
+      *
+      * @return true if OK. false on error.
+      */
+      bool RunImplementation();
+
+      /**
+      * @brief Reset the internal state to the initial state.
+      *
+      * @param params The new parameters referente at initial state.
+      */
+      void ResetState( const TePDIParameters& params );
+
+      /**
+        * @brief Detects a edge of a cell in Raster.
+        *
+        * @param i abscissa( column ) of the upper-left point of the shape
+        * @param j ordinate( line ) of the upper-left point of the shape
+        * @param line 2D Line.
+        * @return true if ok, otherwise false
+        */
+      bool detectEdge(long i, long j, TeLine2D &line );
+        
+      /**
+      * @brief Tests if the current point is a edge start.
+      * @param x X coord.
+      * @param y Y coord.
+      * @return true if the current point is a edge start, false if not.
+      */
+      bool startingEdgeTest( const int& x, const int& y );
+      
+      /**
+      * @brief Clear all internally allocated resources.
+      */
+      void clear();    
+
+  };
+
+
+  /** @example TePDIRaster2Vector_test.cpp
+  *    Shows how to use this class.
+  */  
+ 
+#endif
diff --git a/src/terralib/image_processing/TePDIRaster2VectorFactory.cpp b/src/terralib/image_processing/TePDIRaster2VectorFactory.cpp
old mode 100755
new mode 100644
index 0e42075..d6630fa
--- a/src/terralib/image_processing/TePDIRaster2VectorFactory.cpp
+++ b/src/terralib/image_processing/TePDIRaster2VectorFactory.cpp
@@ -1,24 +1,24 @@
- 
-#include "TePDIRaster2VectorFactory.hpp"
-#include "TePDIRaster2Vector.hpp"
-#include <TeAgnostic.h>
-
-TePDIRaster2VectorFactory::TePDIRaster2VectorFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIRaster2Vector" ) )
-{
-};      
-
-TePDIRaster2VectorFactory::~TePDIRaster2VectorFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIRaster2VectorFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIRaster2Vector();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIRaster2VectorFactory.hpp"
+#include "TePDIRaster2Vector.hpp"
+#include <TeAgnostic.h>
+
+TePDIRaster2VectorFactory::TePDIRaster2VectorFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIRaster2Vector" ) )
+{
+};      
+
+TePDIRaster2VectorFactory::~TePDIRaster2VectorFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIRaster2VectorFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIRaster2Vector();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIRaster2VectorFactory.hpp b/src/terralib/image_processing/TePDIRaster2VectorFactory.hpp
old mode 100755
new mode 100644
index f320392..6d32fba
--- a/src/terralib/image_processing/TePDIRaster2VectorFactory.hpp
+++ b/src/terralib/image_processing/TePDIRaster2VectorFactory.hpp
@@ -1,67 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRASTER2VECTORFACTORY_HPP
-  #define TEPDIRASTER2VECTORFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for vectorization algorithm factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIRaster2VectorFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIRaster2VectorFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRaster2VectorFactory();
-      
-      protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-  
-  namespace {
-    static TePDIRaster2VectorFactory TePDIRaster2VectorFactory_instance;
-  };  
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRASTER2VECTORFACTORY_HPP
+  #define TEPDIRASTER2VECTORFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for vectorization algorithm factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIRaster2VectorFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIRaster2VectorFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRaster2VectorFactory();
+      
+      protected :  
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+  
+  namespace {
+    static TePDIRaster2VectorFactory TePDIRaster2VectorFactory_instance;
+  };  
+
+#endif
diff --git a/src/terralib/image_processing/TePDIRasterRUBuffer.cpp b/src/terralib/image_processing/TePDIRasterRUBuffer.cpp
old mode 100755
new mode 100644
index 6a8a992..d475de8
--- a/src/terralib/image_processing/TePDIRasterRUBuffer.cpp
+++ b/src/terralib/image_processing/TePDIRasterRUBuffer.cpp
@@ -1,146 +1,146 @@
-#include "TePDIRasterRUBuffer.hpp"
-
-#include <TeAgnostic.h>
-
-#include <limits.h>
-
-TePDIRasterRUBuffer::TePDIRasterRUBuffer()
-{
-  rasterPtr_ = 0;
-  rasterChn_ = 0;
-  bufferPtr_ = 0;
-  bufferLines_ = 0;
-  bufferCols_ = 0;
-  lastReadedLine_ = UINT_MAX;
-}
-
-
-TePDIRasterRUBuffer::~TePDIRasterRUBuffer()
-{
-  clear();
-}
-
-bool TePDIRasterRUBuffer::reset( TeRaster& inputRaster, 
-  unsigned int inRasterChn, unsigned int nLines )
-{
-  clear();
-  
-  TEAGN_TRUE_OR_RETURN( inputRaster.params().status_ != 
-    TeRasterParams::TeNotReady, "Raster not ready" )
-  TEAGN_TRUE_OR_RETURN( inputRaster.params().status_ != 
-    TeRasterParams::TeNotReady, "Raster not ready" )  
-  TEAGN_TRUE_OR_RETURN( inputRaster.params().nlines_ >= 
-    (int)nLines, "Invalid raster lines number" )    
-
-  try
-  {
-    bufferPtr_ = new double*[ nLines ];
-  }
-  catch(...)
-  {
-    return false;
-  }
-  if( bufferPtr_ == 0 ) 
-  {
-    return false;
-  }
-  
-  bufferLines_ = nLines;
-  
-  for( unsigned int line = 0 ; line < nLines ; ++line )
-    bufferPtr_[ line ] = 0;
-  
-  try
-  {
-    bufferCols_ = inputRaster.params().ncols_;
-    
-    for( unsigned int line = 0 ; line < nLines ; ++line )
-    {
-      bufferPtr_[ line ] = new double[ bufferCols_ ];
-      
-      if( bufferPtr_[ line ] == 0 )
-      {
-        clear();
-        return false;
-      }
-    }
-  }
-  catch(...)
-  {
-    clear();
-    return false;
-  }
-  
-  rasterPtr_ = &inputRaster;
-  rasterChn_ = inRasterChn;
-  
-  return true;
-}
-
-bool TePDIRasterRUBuffer::roolUp()
-{
-  TEAGN_DEBUG_CONDITION( rasterPtr_ != 0, "No input raster" )
-  TEAGN_DEBUG_CONDITION( bufferPtr_ != 0, "No internal buffer" )
-  
-  if( ( (int)lastReadedLine_  ) == ( rasterPtr_->params().nlines_ 
-    - 1 ) ) 
-  {
-    return false;
-  }
-  else
-  {
-    // roll-up
-    
-    double* firstLine = bufferPtr_[ 0 ];
-    
-    unsigned int lastLineIdx = bufferLines_ - 1;
-    
-    for( unsigned int line = 0 ; line < lastLineIdx ; ++line )
-      bufferPtr_[ line ] = bufferPtr_[ line + 1 ];
-                          
-    bufferPtr_[ lastLineIdx ] = firstLine;
-    
-    // load the next line
-    
-    if( lastReadedLine_ == UINT_MAX )
-    {
-      lastReadedLine_ = 0;
-    }
-    else
-    {
-      ++lastReadedLine_;
-    }
-    
-    for( unsigned int col = 0 ; col < bufferCols_ ; ++col )
-    {
-      rasterPtr_->getElement( col, lastReadedLine_, firstLine[ col ], 
-        rasterChn_ );
-    }    
-    
-    return true;
-  }
-}
-
-double** TePDIRasterRUBuffer::getBufferPtr()
-{
-  TEAGN_DEBUG_CONDITION( bufferPtr_ != 0, "No internal buffer" )
-  return bufferPtr_;
-}
-
-void TePDIRasterRUBuffer::clear()
-{
-  if( bufferPtr_ )
-  {
-    for( unsigned int line = 0 ; line < bufferLines_ ; ++line )
-      if( bufferPtr_[ line ] ) delete[] bufferPtr_[ line ];
-    
-    delete[] bufferPtr_;
-  }
-  
-  bufferPtr_ = 0;
-  bufferLines_ = 0;
-  bufferCols_ = 0;
-  rasterPtr_ = 0;
-  rasterChn_ = 0;
-  lastReadedLine_ = UINT_MAX;
-}
+#include "TePDIRasterRUBuffer.hpp"
+
+#include <TeAgnostic.h>
+
+#include <limits.h>
+
+TePDIRasterRUBuffer::TePDIRasterRUBuffer()
+{
+  rasterPtr_ = 0;
+  rasterChn_ = 0;
+  bufferPtr_ = 0;
+  bufferLines_ = 0;
+  bufferCols_ = 0;
+  lastReadedLine_ = UINT_MAX;
+}
+
+
+TePDIRasterRUBuffer::~TePDIRasterRUBuffer()
+{
+  clear();
+}
+
+bool TePDIRasterRUBuffer::reset( TeRaster& inputRaster, 
+  unsigned int inRasterChn, unsigned int nLines )
+{
+  clear();
+  
+  TEAGN_TRUE_OR_RETURN( inputRaster.params().status_ != 
+    TeRasterParams::TeNotReady, "Raster not ready" )
+  TEAGN_TRUE_OR_RETURN( inputRaster.params().status_ != 
+    TeRasterParams::TeNotReady, "Raster not ready" )  
+  TEAGN_TRUE_OR_RETURN( inputRaster.params().nlines_ >= 
+    (int)nLines, "Invalid raster lines number" )    
+
+  try
+  {
+    bufferPtr_ = new double*[ nLines ];
+  }
+  catch(...)
+  {
+    return false;
+  }
+  if( bufferPtr_ == 0 ) 
+  {
+    return false;
+  }
+  
+  bufferLines_ = nLines;
+  
+  for( unsigned int line = 0 ; line < nLines ; ++line )
+    bufferPtr_[ line ] = 0;
+  
+  try
+  {
+    bufferCols_ = inputRaster.params().ncols_;
+    
+    for( unsigned int line = 0 ; line < nLines ; ++line )
+    {
+      bufferPtr_[ line ] = new double[ bufferCols_ ];
+      
+      if( bufferPtr_[ line ] == 0 )
+      {
+        clear();
+        return false;
+      }
+    }
+  }
+  catch(...)
+  {
+    clear();
+    return false;
+  }
+  
+  rasterPtr_ = &inputRaster;
+  rasterChn_ = inRasterChn;
+  
+  return true;
+}
+
+bool TePDIRasterRUBuffer::roolUp()
+{
+  TEAGN_DEBUG_CONDITION( rasterPtr_ != 0, "No input raster" )
+  TEAGN_DEBUG_CONDITION( bufferPtr_ != 0, "No internal buffer" )
+  
+  if( ( (int)lastReadedLine_  ) == ( rasterPtr_->params().nlines_ 
+    - 1 ) ) 
+  {
+    return false;
+  }
+  else
+  {
+    // roll-up
+    
+    double* firstLine = bufferPtr_[ 0 ];
+    
+    unsigned int lastLineIdx = bufferLines_ - 1;
+    
+    for( unsigned int line = 0 ; line < lastLineIdx ; ++line )
+      bufferPtr_[ line ] = bufferPtr_[ line + 1 ];
+                          
+    bufferPtr_[ lastLineIdx ] = firstLine;
+    
+    // load the next line
+    
+    if( lastReadedLine_ == UINT_MAX )
+    {
+      lastReadedLine_ = 0;
+    }
+    else
+    {
+      ++lastReadedLine_;
+    }
+    
+    for( unsigned int col = 0 ; col < bufferCols_ ; ++col )
+    {
+      rasterPtr_->getElement( col, lastReadedLine_, firstLine[ col ], 
+        rasterChn_ );
+    }    
+    
+    return true;
+  }
+}
+
+double** TePDIRasterRUBuffer::getBufferPtr()
+{
+  TEAGN_DEBUG_CONDITION( bufferPtr_ != 0, "No internal buffer" )
+  return bufferPtr_;
+}
+
+void TePDIRasterRUBuffer::clear()
+{
+  if( bufferPtr_ )
+  {
+    for( unsigned int line = 0 ; line < bufferLines_ ; ++line )
+      if( bufferPtr_[ line ] ) delete[] bufferPtr_[ line ];
+    
+    delete[] bufferPtr_;
+  }
+  
+  bufferPtr_ = 0;
+  bufferLines_ = 0;
+  bufferCols_ = 0;
+  rasterPtr_ = 0;
+  rasterChn_ = 0;
+  lastReadedLine_ = UINT_MAX;
+}
diff --git a/src/terralib/image_processing/TePDIRasterRUBuffer.hpp b/src/terralib/image_processing/TePDIRasterRUBuffer.hpp
old mode 100755
new mode 100644
index 74ad48b..bda2dfa
--- a/src/terralib/image_processing/TePDIRasterRUBuffer.hpp
+++ b/src/terralib/image_processing/TePDIRasterRUBuffer.hpp
@@ -1,87 +1,88 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRASTERRUBUFFER_HPP
-  #define TEPDIRASTERRUBUFFER_HPP
-
-  #include "TePDIDefines.hpp"
-  #include <TeRaster.h>
-  
-  /**
-   * @brief A raster rool-up lines buffer.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAux
-   */
-  class PDI_DLL TePDIRasterRUBuffer {
-    public :
-      
-      TePDIRasterRUBuffer();
-
-      ~TePDIRasterRUBuffer();
-      
-      /**
-       * @brief Reset this roll up buffer instance.
-       *
-       * @param inputRaster Input raster.
-       * @param inRasterChn Input raster channel/band.
-       * @param bufferLines Number of roll-up buffer lines.
-       * @return true if OK, false on errors.
-       * @note No lines will be pre-loaded.
-       *
-       */
-      bool reset( TeRaster& inputRaster, unsigned int inRasterChn, 
-        unsigned int bufferLines );
-      
-      /**
-       * @brief Buffer roll-up (read the next line from input raster)
-       * @return true if OK, false on errors.
-       */      
-      bool roolUp();
-      
-      /**
-       * @brief Returns a pointer to the current buffer.
-       * @return A pointer to the current buffer.
-       * @note The returned pointer will be invalidated if reset or roolUp
-       * methods were called.
-       */         
-      double** getBufferPtr();        
- 
-    protected :
-      
-      TeRaster* rasterPtr_;
-      
-      unsigned int rasterChn_;
-    
-      double** bufferPtr_;
-      
-      unsigned int bufferLines_;
-      
-      unsigned int bufferCols_;
-      
-      unsigned int lastReadedLine_;
-      
-      void clear();
-  };
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRASTERRUBUFFER_HPP
+  #define TEPDIRASTERRUBUFFER_HPP
+
+  #include "TePDIDefines.hpp"
+  #include <TeRaster.h>
+  
+  /**
+   * @class TePDIRasterRUBuffer
+   * @brief A raster rool-up lines buffer.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAux
+   */
+  class PDI_DLL TePDIRasterRUBuffer {
+    public :
+      
+      TePDIRasterRUBuffer();
+
+      ~TePDIRasterRUBuffer();
+      
+      /**
+       * @brief Reset this roll up buffer instance.
+       *
+       * @param inputRaster Input raster.
+       * @param inRasterChn Input raster channel/band.
+       * @param bufferLines Number of roll-up buffer lines.
+       * @return true if OK, false on errors.
+       * @note No lines will be pre-loaded.
+       *
+       */
+      bool reset( TeRaster& inputRaster, unsigned int inRasterChn, 
+        unsigned int bufferLines );
+      
+      /**
+       * @brief Buffer roll-up (read the next line from input raster)
+       * @return true if OK, false on errors.
+       */      
+      bool roolUp();
+      
+      /**
+       * @brief Returns a pointer to the current buffer.
+       * @return A pointer to the current buffer.
+       * @note The returned pointer will be invalidated if reset or roolUp
+       * methods were called.
+       */         
+      double** getBufferPtr();        
+ 
+    protected :
+      
+      TeRaster* rasterPtr_;
+      
+      unsigned int rasterChn_;
+    
+      double** bufferPtr_;
+      
+      unsigned int bufferLines_;
+      
+      unsigned int bufferCols_;
+      
+      unsigned int lastReadedLine_;
+      
+      void clear();
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDIRegGrowSeg.cpp b/src/terralib/image_processing/TePDIRegGrowSeg.cpp
old mode 100755
new mode 100644
index 9428843..97fdd75
--- a/src/terralib/image_processing/TePDIRegGrowSeg.cpp
+++ b/src/terralib/image_processing/TePDIRegGrowSeg.cpp
@@ -1,998 +1,998 @@
-#include "TePDIRegGrowSeg.hpp"
-
-#include "TePDIRaster2Vector.hpp"
-#include "TePDIUtils.hpp"
-
-
-TePDIRegGrowSeg::TePDIRegGrowSeg()
-{
-        ListCell_      = NULL;
-        WindowCell_    = NULL;
-        tuple_         = NULL;
-        OnLimbo_       = 0;
-        CurrentWindow_ = 0;
-        WindowOffset_  = 1;
-        WindowLines_   = 0;
-        WindowColumns_ = 0;
-        Nlin_          = 0;
-        Ncol_          = 0;
-        Nban_          = 0;
-        Areamin_       = 0;
-        Difsim_       = (float)0;
-}
-
-
-TePDIRegGrowSeg::~TePDIRegGrowSeg()
-{
-        Imagein_.reset();
-        Imagelab_.reset();
-        Imageexc_.reset();
-
-        if( WindowCell_ != NULL ) {delete []WindowCell_; WindowCell_=NULL;}
-        if( tuple_      != NULL ) {delete []tuple_; tuple_=NULL;}
-        NWindow_       = 0;
-        WindowLines_   = 0;
-        WindowColumns_ = 0;
-        CurrentWindow_ = 0;
-        WindowOffset_  = 1;
-        Nlin_       = 0;
-        Ncol_       = 0;
-        Nban_       = 0;
-        Areamin_    = 0;
-        Difsim_     = (float)0;
-        if( ListCell_  != NULL )
-        {
-                TePDIRGSCellList::iterator it;
-                for (it=ListCell_->begin(); it!=ListCell_->end(); it++)
-                        delete (*it).second;
-                ListCell_->clear();
-                delete ListCell_;
-                ListCell_ = NULL;
-        }
-}
-
-
-void TePDIRegGrowSeg::ResetState( const TePDIParameters& params )
-{
-  if( params != params_ ) {
-    Imagein_.reset();
-    Imagelab_.reset();
-    Imageexc_.reset();
-    
-    if( WindowCell_ != NULL ) {delete []WindowCell_; WindowCell_=NULL;}
-        
-    if( tuple_ != NULL ) {delete []tuple_; tuple_=NULL;}
-            
-    if( ListCell_  != NULL )
-    {
-            TePDIRGSCellList::iterator it;
-            for (it=ListCell_->begin(); it!=ListCell_->end(); it++)
-                    delete (*it).second;
-            ListCell_->clear();
-            delete ListCell_;
-            ListCell_ = NULL;
-    }    
-  }
-}
-
-
-bool TePDIRegGrowSeg::CheckParameters( const TePDIParameters& parameters ) const
-{
-  /* Checking for general required parameters */
-
-  //parameter input_image
-  TePDITypes::TePDIRasterPtrType inRaster;
-  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
-
-    TEAGN_LOGERR( "Missing parameter: input_image" );
-    return false;
-  }
-  if( ! inRaster.isActive() ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
-    return false;
-  }
-  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
-    return false;
-  }
-  TEAGN_TRUE_OR_RETURN( ( ! inRaster->params().useDummy_ ),
-    "input_image must not contain dummy values" );
-
-  //parameter output_image
-  if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-    "output_image" ) ) {
-    
-    TePDITypes::TePDIRasterPtrType outRaster;
-    if( ! parameters.GetParameter( "output_image", outRaster ) ) {
-  
-      TEAGN_LOGERR( "Missing parameter: output_image" );
-      return false;
-    }
-    if( ! outRaster.isActive() ) {
-  
-      TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
-      return false;
-    }
-    if( outRaster->params().status_ != TeRasterParams::TeReadyToWrite ) {
-  
-      TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
-      return false;
-    }
-    TEAGN_TRUE_OR_RETURN( 
-      ( outRaster->params().dataType_[0] == TeUNSIGNEDLONG ),
-      "Invalid parameter: output_image pixel type must be TeUNSIGNEDLONG" );
-  }
-  
-  //parameter restriction_image
-  TePDITypes::TePDIRasterPtrType restrictionRaster;
-  if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-    "restriction_image" ) ) {
-
-    if( ! parameters.GetParameter( "restriction_image", restrictionRaster ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: restriction_image" );
-      return false;
-    }
-    if( ! restrictionRaster.isActive() ) {
-
-      TEAGN_LOGERR( "Invalid parameter: restriction_image inactive" );
-      return false;
-    }
-    if( restrictionRaster->params().status_ == TeRasterParams::TeNotReady ) {
-
-      TEAGN_LOGERR( "Invalid parameter: restriction_image not ready" );
-      return false;
-    }
-    TEAGN_TRUE_OR_RETURN( ( ! restrictionRaster->params().useDummy_ ),
-      "input_image must not contain dummy values" );    
-  }
-
-  if( ! parameters.CheckParameter< double >( "euc_treshold" ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: euc_treshold" );
-      return false;
-  }
-
-  if( ! parameters.CheckParameter< int >( "area_min" ) ) {
-
-        TEAGN_LOGERR( "Missing parameter: area_min" );
-    return false;
-  }
-  
-  if( parameters.CheckParameter< TePDITypes::TePDIPolSetMapPtrType >( 
-    "output_polsets" ) ) {
-            
-    TePDITypes::TePDIPolSetMapPtrType output_polsets;
-    parameters.GetParameter( "output_polsets", output_polsets );
-            
-    TEAGN_TRUE_OR_RETURN( output_polsets.isActive(),
-      "Invalid parameter output_polsets : Inactive polygon set pointer" );   
-  }   
-
-  return true;
-}
-
-
-bool TePDIRegGrowSeg::RunImplementation()
-{
-        params_.GetParameter( "input_image", Imagein_ ) ;
-        params_.GetParameter( "area_min", Areamin_ ) ;
-        params_.GetParameter( "euc_treshold", Difsim_ ) ;
-
-        if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-          "restriction_image" ) ) {
-
-          params_.GetParameter( "restriction_image", Imageexc_ );
-        }
-
-        Nban_ = (int)Imagein_->params().nBands();
-
-        if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
-          "output_image" ) ) {
-
-          params_.GetParameter( "output_image", Imagelab_ );
-            
-          TeRasterParams Imagelab_params = Imagelab_->params();
-  
-          Imagelab_params.nBands( 1 );
-          if( Imagein_->projection() != 0 ) {
-            TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-              Imagein_->projection()->params() ) );          
-            Imagelab_params.projection( proj.nakedPointer() );
-          }
-          Imagelab_params.boxResolution( Imagein_->params().box().x1(), 
-            Imagein_->params().box().y1(), Imagein_->params().box().x2(), 
-            Imagein_->params().box().y2(), Imagein_->params().resx_, 
-            Imagein_->params().resy_ );  
-
-          TEAGN_TRUE_OR_RETURN( Imagelab_->init( Imagelab_params ),
-            "Output raster reset error" );            
-        } else {
-          TeRasterParams Imagelab_params = Imagein_->params();
-          Imagelab_params.nBands( 1 );
-          Imagelab_params.setDataType( TeUNSIGNEDLONG, -1 );
-          
-          TEAGN_TRUE_OR_RETURN( 
-            TePDIUtils::TeAllocRAMRaster( Imagelab_, Imagelab_params,
-            TePDIUtils::TePDIUtilsAutoMemPol ),
-            "Internal raster allocation error");
-        }
-
-        Nlin_ = Imagelab_->params().nlines_;
-        Ncol_ = Imagelab_->params().ncols_;
-
-        // Initialize colection of regions
-        ListCell_ = new TePDIRGSCellList;
-        TEAGN_TRUE_OR_RETURN( ( ListCell_ != NULL ),
-          "Unable to create the cells list" )
-
-        // Initialize the array of regions of window
-
-        WindowCell_ = new TePDIRGSCell*[TAMJAN*TAMJAN];
-        TEAGN_TRUE_OR_RETURN( ( WindowCell_ != NULL ),
-          "Unable to create TePDIRGSCell instance" )
-                
-
-        // Set initial values
-
-        tuple_ = new unsigned long[Nban_] ;
-
-
-        WindowLines_ = ( Nlin_ % TAMJAN ) ? ( Nlin_ / TAMJAN + 1 ) : ( Nlin_ / TAMJAN );
-        WindowColumns_ = ( Ncol_ % TAMJAN ) ? ( Ncol_ / TAMJAN + 1 ) : ( Ncol_ / TAMJAN );
-        NWindow_    = WindowLines_ * WindowColumns_;
-
-        // Start Region Growing
-        short canceled = 0;
-        WindowOffset_ = 1L;
-
-
-        int step = 0;
-        TePDIPIManager progress( "Region Growing...", NWindow_,
-          progress_enabled_ );
-
-        for( CurrentWindow_ = 0; CurrentWindow_ < NWindow_; CurrentWindow_++ )
-        {
-                TEAGN_TRUE_OR_RETURN( InitWindow(),
-                  "Unable to init window" )
-                  
-                Adjust();
-                
-                TEAGN_TRUE_OR_RETURN( MergeMutuallyClosestCells(),
-                  "Unable to merge cells" )
-                                        
-                TEAGN_TRUE_OR_RETURN( MergeSmallCells( 5 , Nlin_),
-                  "Unable to merge small cells" )
-                                        
-                TEAGN_FALSE_OR_RETURN( progress.Update( step ),
-                  "Canceled by the user" );
-
-                ++step;
-        }
-
-
-        if (!canceled)
-        {
-                if( MergeSmallCells( Areamin_ , Nlin_) == 0 )
-                                canceled=1;
-                if( Resort() == 0 )
-                                canceled=1;
-        }
-        
-        if (!canceled) {
-          if( params_.CheckParameter< TePDITypes::TePDIPolSetMapPtrType >( 
-            "output_polsets" ) ) {
-            
-            TePDIRaster2Vector vectorizer;
-            
-            TePDIParameters vectorizer_params = params_;
-            vectorizer_params.SetParameter( "rotulated_image", Imagelab_ );
-            vectorizer_params.SetParameter( "channel", (unsigned int)0 );
-            
-            TEAGN_TRUE_OR_RETURN( vectorizer.Reset( vectorizer_params ),
-              "Unable to set vectorize parameters" );
-            TEAGN_TRUE_OR_RETURN( vectorizer.Apply(),
-              "Unable to create output polygon set" );
-          }          
-        }
-
-        return !canceled;
-}
-
-
-bool
-TePDIRegGrowSeg :: InitWindow()
-{
-        int             lin, col;
-        long    ind;
-        unsigned long   idcell,
-                        idwindow,
-                        cellid;
-        float   dist;
-        TePDIRGSCell *c = 0;
-        TePDIRGSCell *cell = 0;
-        TePDIRGSCell *cwindow = 0;
-
-        ilin_ = (int)( ( CurrentWindow_ / WindowColumns_ ) * TAMJAN );
-        icol_ = (int)( ( CurrentWindow_ % WindowColumns_ ) * TAMJAN );
-        flin_ = ilin_ + TAMJAN - 1;
-        if( flin_ >= Nlin_ ) flin_ = Nlin_ - 1;
-        fcol_ = icol_ + TAMJAN - 1;
-        if( fcol_ >= Ncol_ ) fcol_ = Ncol_ - 1;
-        sizelin_   = flin_ - ilin_ + 1;
-        sizecol_   = fcol_ - icol_ + 1;
-        int     proLimbo = 6*TAMJAN;
-
-
-//CTX Drop cells that are farther than proLimbo from current window base line
-        if (icol_ < TAMJAN && ilin_ > proLimbo)
-        {
-                short   flag=0;
-                MergeSmallCells( Areamin_ , ilin_ - proLimbo);
-
-                TePDIRGSCellList::iterator it;
-                for (it=ListCell_->begin(); it!=ListCell_->end() ; ++it) {
-                        c=(*it).second;
-
-                        if( c == NULL ) continue;
-                        if ((ilin_ - c->LineMax()) > proLimbo)
-                        {
-                                flag = 1;
-                                c->Kill();
-                                OnLimbo_++;
-                        }
-                }
-                if (flag)
-                        Adjust();
-        }
-
-        // Constructs the array of regions belonging to this window
-        idcell = (unsigned long)WindowOffset_;
-        double val;
-
-        for( lin = ilin_; lin <= flin_; lin++ ) {
-                for( col = icol_; col <= fcol_; col++ ) {
-
-                        if( Imageexc_.isActive() ){
-                                (*Imageexc_).getElement(col, lin ,val,0);
-                                if( val == 0 ){
-                                        (*Imagelab_).setElement(col,lin,0L);
-                                        WindowCell_[idcell-WindowOffset_] = NULL;
-                                        idcell++;
-                                        continue;
-                                }
-                        }
-
-                        if (!((*Imagelab_).setElement(col,lin,(double) idcell,0))){
-                                                         return false;
-                        }
-
-                        double d;
-                        (*Imagelab_).getElement(col, lin,d,0);
-                        for( int ban = 0; ban < Nban_; ban++ ) {
-                                (*Imagein_).getElement(col,lin ,val,ban);
-                                tuple_[ban] = (unsigned long)val;
-                        }
-
-//FAMI1095 (it's really not necessary to free memory)
-//if(WindowCell_[idcell-WindowOffset_]) {delete WindowCell_[idcell-WindowOffset_]; WindowCell_[idcell-WindowOffset_]=NULL;}
-                        //WindowCell_[idcell-WindowOffset_] = new TePDIRGSCell( tuple_, idcell, lin, col, Nban_ );
-                        WindowCell_[idcell-WindowOffset_] = cellStack.Pop();
-
-                        WindowCell_[idcell-WindowOffset_]->Init( tuple_, idcell, lin, col, Nban_ );
-                        if( WindowCell_[idcell-WindowOffset_] == NULL )
-                        {
-                                for( unsigned int i = 0; i < idcell-WindowOffset_; i++ )
-                                        delete WindowCell_[i];
-                        }
-                        idcell++;
-                }
-        }
-
-
-        // Take the neighborhood of regions lying inside the window
-        for( lin = ilin_; lin <= flin_; lin++ )
-        {
-                for( col = icol_; col <= fcol_; col++ )
-                {
-                        ind = (lin - ilin_) * sizecol_ + ( col - icol_ );
-                        c = WindowCell_[ind];
-                        if( c == NULL )
-                                continue;
-                        if( col < fcol_ && WindowCell_[ind+1] != NULL )
-                        {
-                                dist = WindowCell_[ind]->Distance( WindowCell_[ind+1] );
-                                WindowCell_[ind]->InsertNeighbor(WindowCell_[ind+1], dist );
-                                WindowCell_[ind+1]->InsertNeighbor(WindowCell_[ind], dist );
-                        }
-                        if( lin < flin_ && WindowCell_[ind+sizecol_] != NULL )
-                        {
-                                dist = WindowCell_[ind]->Distance( WindowCell_[ind+sizecol_] );
-                                WindowCell_[ind]->InsertNeighbor(WindowCell_[ind+sizecol_], dist );
-                                WindowCell_[ind+sizecol_]->InsertNeighbor(WindowCell_[ind], dist );
-                        }
-                }
-        }
-
-        // Atualiza Cells de fronteira a esquerda
-        double tmp;
-        if( icol_ > 0 )
-        {
-                cellid = 0L;
-                for( lin = ilin_; lin <= flin_; lin++ )
-                {
-                        (*Imagelab_).getElement(icol_-1,lin,tmp,0);
-                        idcell = (unsigned long)tmp;
-                        (*Imagelab_).getElement(icol_,lin,tmp,0);
-                        idwindow = (unsigned long)tmp;
-                        if( idcell == 0L || idwindow == 0L )
-                                continue;
-                        if( cellid != idcell ){
-                                TePDIRGSCellList::iterator it;
-                                if ( (it = ListCell_->find( idcell ) ) == ListCell_->end() ) {
-                                    //Fatal error : we didn t found the id in the list
-                                                                        return false;
-                                }
-                                cell = (*it).second;
-                                cellid = cell->Id();
-                        }
-                        cwindow = WindowCell_[ (lin-ilin_) * sizecol_ ];
-                        dist = cell->Distance( cwindow );
-                        cell->AddNeighbor( cwindow, dist );
-                        cwindow->AddNeighbor( cell, dist );
-                }
-        }
-
-        // Atualiza Cells de fronteira acima
-        if( ilin_ > 0 )
-        {
-                cellid = 0L;
-                for( col = icol_; col <= fcol_; col++ )
-                {
-                        (*Imagelab_).getElement(col,ilin_-1,tmp,0);
-                        idcell = (unsigned long)tmp;
-                        (*Imagelab_).getElement(col,ilin_,tmp,0);
-                        idwindow = (unsigned long)tmp;
-                        if( idcell == 0L || idwindow == 0L )
-                                continue;
-                        if( cellid != idcell )
-                        {
-                                TePDIRGSCellList::iterator it;
-                                if ( (it = ListCell_->find( idcell ) ) == ListCell_->end() ) {
-                                                                        return false;
-                                }
-                                cell = (*it).second;
-                                cellid = cell->Id();
-                        }
-                        cwindow = WindowCell_[ col - icol_ ];
-                        dist = cell->Distance( cwindow );
-                        cell->AddNeighbor( cwindow, dist );
-                        cwindow->AddNeighbor( cell, dist );
-                }
-        }
-
-        // Add Regions in WindowCell_ in the list ListCell_;
-        for( ind = 0; ind < sizelin_ * sizecol_; ind++ ){
-                if( WindowCell_[ ind ] != NULL )
-                        ListCell_->insert(make_pair(WindowCell_[ ind ]->Id(), WindowCell_[ ind ]));
-        }                                               //stCell[WindowCell_[ ind ]->Id()]=WindowCell_[ ind ];
-
-
-        WindowOffset_ += ((long)sizelin_ * sizecol_ );
-        return true;
-
-}
-
-bool
-TePDIRegGrowSeg::MergeMutuallyClosestCells() {
-        float   dist;
-        float   diff;
-        char    status;
-        TePDIRGSCell    *c,
-                *cgo,
-                *cback;
-
-        for( int step = 1; step <= (int)Difsim_ ; step++ )
-        {
-           diff = (float)step * step;
-           do {
-                status  = 0;
-                TePDIRGSCellList::iterator it;
-                for (it=ListCell_->begin(); it!=ListCell_->end() ; ++it) {
-                        c=(*it).second;
-
-                        while( !c->Dead() )
-                        {
-                                if( ( cgo = c->ClosestNeighbor(dist) ) == NULL ) break;
-
-                                cback = cgo->ClosestNeighbor(dist);
-                                if( c == cback ) {
-                                        if( dist <= diff  ) {
-                                                c = MergeCells( c, cgo );
-                                                status = 1;
-                                        }else
-                                                break;
-                                }else
-                                        break;
-                        }
-                }
-//              Adjust();
-           }while( status );
-        }
-        Adjust();
-
-        return true;
-}
-
-bool
-TePDIRegGrowSeg :: MergeSimilarCells()
-{
-        float   d1;
-        float   diff;
-        char    status;
-        TePDIRGSCell    *c,
-                *cgo;
-
-        for( int step = 1; step <= (int)Difsim_ ; step++ )
-        {
-           diff = (float)step * step;
-           do {
-                status  = 0;
-
-                TePDIRGSCellList::iterator it;
-                for (it=ListCell_->begin(); it!=ListCell_->end() ; ++it) {
-                        c=(*it).second;
-
-                        while( !c->Dead() )
-                        {
-                                if( ( cgo = c->ClosestNeighbor(d1) ) == NULL ) break;
-                                if( d1 <= diff )
-                                {
-                                        c = MergeCells( c, cgo );
-                                        status = 1;
-                                }
-                                else    break;
-                        }
-                }
-                Adjust();
-           }while( status );
-        }
-        return true;
-}
-
-bool
-TePDIRegGrowSeg :: MergeSmallCells( long area ,int linmax)
-{
-        char    status;
-        TePDIRGSCell    *c,
-                *cgo,
-                *cback;
-        float   dist;
-        float   diff;
-        int step;
-
-        if( area > Areamin_ )area = Areamin_;
-
-// Elimina regioes pequenas atraves do merging com a regiao vizinha mais proxima
-        for( step = 1; step <= 6; step++ )
-        {
-           diff = (float)(Difsim_ + step * 2);
-           diff = diff * diff;
-           do {         status  = 0;
-
-                TePDIRGSCellList::iterator it;
-                for (it=ListCell_->begin(); it!=ListCell_->end() ; ++it) {
-                        c=(*it).second;
-
-                        if( c->Dead() || c->Area() > area || c->LineMax() > linmax)
-                                continue;
-                        if( ( cgo = c->ClosestNeighbor(dist) ) == NULL )
-                                break;
-                        cback = cgo->ClosestNeighbor(dist);
-                        if( c != cback ) continue;
-                        if( dist <= diff || step > 5 )
-                        {
-                                c = MergeCells( c, cgo );
-                                status = 1;
-                        }
-                }
-//CTX           Adjust();
-           }while( status );
-        }
-        Adjust();
-
-        for( step = 1; step <= 6; step++ )
-        {
-           diff = (float)(Difsim_ + step * 2);
-           diff = diff * diff;
-           do {         status  = 0;
-                TePDIRGSCellList::iterator it;
-                for (it=ListCell_->begin(); it!=ListCell_->end() ; ++it) {
-                        c=(*it).second;
-
-                        if( c->Dead() || c->Area() > area || c->LineMax() > linmax)
-                                continue;
-                        if( ( cgo = c->ClosestNeighbor(dist) ) == NULL ) break;
-                        if( dist <= diff || step > 5 )
-                        {
-                                c = MergeCells( c, cgo );
-                                status = 1;
-                        }
-                }
-//              Adjust();
-           }while( status );
-        }
-        Adjust();
-
-        return true;
-}
-
-void
-TePDIRegGrowSeg :: Adjust()
-{
-        TePDIRGSCell    *c;
-        TePDIRGSCellList::iterator itt;
-                TePDIRGSCellList::iterator it=ListCell_->begin();
-        while (it!=ListCell_->end()) {
-            itt=it;
-                        c=(*itt).second;
-                        it++;
-            if ( c == NULL ) {
-                ListCell_->erase(itt);
-            } else if( c->Dead() ) {
-                ListCell_->erase(itt);
-                cellStack.Push(c);
-            } else {
-                c->AdjustNeighborhood();
-            }
-        }
-}
-
-TePDIRGSCell*
-TePDIRegGrowSeg :: MergeCells( TePDIRGSCell *c1, TePDIRGSCell *c2 )
-{
-        double val;
-        int     lmin, lmax, cmin, cmax;
-        TePDIRGSCell    *cret = NULL;
-
-        if( c1 == NULL || c2 == NULL ) return NULL;
-        if( c1 == c2 ) return NULL;
-
-        if( c1->Area() >= c2->Area() )
-        {
-                if( c1->Merge( c2 ) == 0 ) return NULL;
-                c2->BoundingRectangle( lmin, cmin, lmax, cmax );
-                for( int lin = lmin; lin <= lmax; lin++ ) {
-                        for( unsigned int col = cmin; col <= (unsigned int)cmax; col++ ) {
-                                (*Imagelab_).getElement(col,lin,val,0);
-                                if( (unsigned long)val == (unsigned long)c2->Id() ) (*Imagelab_).setElement(col,lin,(unsigned long)c1->Id(), 0);
-                        }
-                }
-                cret = c1;
-        }
-        else
-        {
-                if( c2->Merge( c1 ) == 0 ) return NULL;
-                c1->BoundingRectangle( lmin, cmin, lmax, cmax );
-                for( int lin = lmin; lin <= lmax; lin++ ) {
-                        for( int col = cmin; col <= cmax; col++ ) {
-                                (*Imagelab_).getElement(col,lin,val,0);
-                                if( (unsigned long)val == (unsigned long)c1->Id() )
-                                        (*Imagelab_).setElement(col,lin,(unsigned long)c2->Id(),0);
-                        }
-                }
-                cret = c2;
-        }
-
-        return cret;
-}
-
-
-bool
-TePDIRegGrowSeg :: Resort()
-{
-// Evaluate total number of cells
-
-        //long size = OnLimbo_ + ListCell_->size();
-
-// Allocate array for resorting image
-        map<long, long> m_map;
-        long    newid,
-                        oldid = 0L,
-                        index=1,
-                        nindex = 0L;
-        double val;
-
-        for( int lin = 0; lin < Nlin_; lin++ )
-        {
-                for( int col = 0; col < Ncol_ ; col++ )
-                {
-
-                        (*Imagelab_).getElement(col,lin,val,0);
-                        newid=(long)val;
-                        if( newid == 0L ) // 0L means excluded area for region growing....
-                                continue;
-                        if( newid != oldid || oldid == 0L )
-                        {
-
-                                if ( m_map.find(newid) == m_map.end() )
-                                {
-                                        nindex++;
-                                        index = nindex;
-                                        m_map[newid] = index;
-                                }
-                                else index = m_map[newid];              // AND & LEO 10/00
-                                oldid = newid;
-                        }
-                        (*Imagelab_).setElement(col,lin,index,0);
-                }
-        }
-
-
-// Free all memory
-        ListCell_->clear();
-        delete ListCell_;
-        ListCell_ = NULL;
-        cellStack.Clear();
-
-        m_map.clear();
-        return true;
-}
-
-
-//--------------------------------TePDIRGSCell ---------------------------------
-
-
-TePDIRGSCell :: TePDIRGSCell( unsigned long* tuple, long id, short lin, short col, short Nban )
-{
-        Stat_          = 0;
-        Idnumber_      = id;
-        Npix_          = 1;
-        Nban_          = Nban;
-        LinMax_        = lin;
-        LinMin_        = lin;
-        ColMax_        = col;
-        ColMin_        = col;
-        Neighbors_     = new TePDIRGSCellList;
-        Media_         = new float[Nban];
-        PreviousMedia_ = new float[Nban];
-        Cc_            = new CloserCells;
-        for( int ban = 0; ban < Nban_; ban++ )
-                Media_[ban] = PreviousMedia_[ban] = (float) tuple[ban];
-}
-
-
-void TePDIRGSCell :: Init( unsigned long* tuple, long id, short lin, short col, short Nban )
-{
-        Stat_          = 0;
-        Idnumber_      = id;
-        Npix_          = 1;
-        Nban_          = Nban;
-        LinMax_        = lin;
-        LinMin_        = lin;
-        ColMax_        = col;
-        ColMin_        = col;
-        if (Neighbors_==NULL)
-        {
-                Neighbors_     = new TePDIRGSCellList;
-                Media_         = new float[Nban_];
-                PreviousMedia_ = new float[Nban_];
-                Cc_            = new CloserCells;
-
-                /*if ( PreviousMedia_ == NULL || Media_ == NULL || Neighbors == NULL || Cc == NULL )
-                        SGError.Handler(ALLOCATION,FATAL,"TePDIRGSCell constructor");*/
-        }
-        else
-        {
-                Cc_->Reset();
-                Neighbors_->clear();
-        }
-        for( int ban = 0; ban < Nban_; ban++ )
-                Media_[ban] = PreviousMedia_[ban] = (float) tuple[ban];
-}
-
-
-TePDIRGSCell :: TePDIRGSCell()
-{
-        Stat_          = 0;
-        Idnumber_      = 0;
-        Npix_          = 1;
-        Nban_          = 0;
-        LinMax_        = 0;
-        LinMin_        = 0;
-        ColMax_        = 0;
-        ColMin_        = 0;
-        Neighbors_     = NULL;
-        Media_         = NULL;
-        PreviousMedia_ = NULL;
-        Cc_            = NULL;
-}
-
-TePDIRGSCell :: ~TePDIRGSCell()
-{
-        if(Media_) {delete []Media_; Media_=NULL;}
-        if(Neighbors_) {delete Neighbors_; Neighbors_=NULL;}
-        if(PreviousMedia_) {delete []PreviousMedia_; PreviousMedia_=NULL;}
-        if(Cc_) {delete Cc_; Cc_=NULL;}
-}
-
-void
-TePDIRGSCell::AdjustNeighborhood()
-{
-        Cc_->Adjust();
-        TePDIRGSCellList::iterator itt;
-                TePDIRGSCellList::iterator it=Neighbors_->begin();
-        while (it!=Neighbors_->end()){
-            itt=it;
-                        it++;
-                        if (( (*itt).second==NULL) || ( (*itt).second->Dead() ) ){
-                  Neighbors_->erase(itt);
-            }
-        }
-}
-
-
-bool
-TePDIRGSCell :: AddNeighbor( TePDIRGSCell *c, float dist )
-{
-        if( c == NULL ) return false;
-        if( c->Dead() ) return false;
-        Cc_->Update( c, dist );
-
-//      Neighbors[c->id()]=c;
-        Neighbors_->insert(make_pair(c->Id(),c));
-        AdjustNeighborhood();
-        return true;
-}
-
-
-bool
-TePDIRGSCell :: InsertNeighbor( TePDIRGSCell* c, float dist )
-{
-        if( c == NULL ) return false;
-        if( c->Dead() ) return false;
-        Cc_->Insert( c, dist );
-
-//  Neighbors[c->id()]=c;
-        Neighbors_->insert(make_pair(c->Id(),c));
-        AdjustNeighborhood();
-        return true;
-}
-
-
-bool
-TePDIRGSCell :: Merge( TePDIRGSCell *c )
-{
-        TePDIRGSCell    *cviz;
-        float   dist;
-        long    area;
-        int ban;
-
-        if( c == NULL ) return false;
-
-        if( LinMax_ < c->LinMax_ ) LinMax_ = c->LinMax_;
-        if( LinMin_ > c->LinMin_ ) LinMin_ = c->LinMin_;
-        if( ColMax_ < c->ColMax_ ) ColMax_ = c->ColMax_;
-        if( ColMin_ > c->ColMin_ ) ColMin_ = c->ColMin_;
-
-        area  = Npix_ + c->Npix_;
-        delta_ = (float)0;
-        for( ban = 0; ban < Nban_; ban++ )
-        {
-                Media_[ban] = (Media_[ban] * Npix_ + c->Media_[ban] * c->Npix_) / area;
-                dist = Media_[ban] - PreviousMedia_[ban];
-                delta_ += dist * dist;
-        }
-        Npix_ = area;
-
-        c->Kill();
-
-        if( delta_ > (float)1 )
-        {
-                Cc_->Reset();
-                for( ban = 0; ban < Nban_; ban++ )
-                        PreviousMedia_[ban] = Media_[ban];
-
-                TePDIRGSCellList::iterator it;
-                for (it=Neighbors_->begin(); it!=Neighbors_->end() ; ++it) {
-                        cviz=(*it).second;
-                        if( cviz == NULL ) return false;
-                        if( cviz->Dead() ) continue;
-                        dist = Distance( cviz );
-                        Cc_->Insert( cviz, dist );
-                        cviz->Cc_->Update( this, dist );
-                }
-        }
-
-        TePDIRGSCellList::iterator it;
-        for (it=c->Neighbors_->begin(); it!=c->Neighbors_->end() ; ++it) {
-                cviz=(*it).second;
-
-                if( cviz == NULL ) return false;
-                if( cviz != this && !cviz->Dead())
-                {
-                        dist = Distance( cviz );
-                        if( cviz->AddNeighbor( this, dist ) == 0 )
-                                return false;
-                        if( AddNeighbor( cviz, dist ) == 0 )
-                                return false;
-                }
-        }
-
-        return true;
-}
-
-
-float
-TePDIRGSCell :: Distance( TePDIRGSCell *c )
-{
-        float   diff;
-        float   dist;
-
-        if( c == NULL ) return (float)100000;
-
-        dist = 0;
-        for (short ban = 0; ban < Nban_; ban++ )
-        {
-                diff  = PreviousMedia_[ban] - c->PreviousMedia_[ban];
-                dist += (diff * diff);
-        }
-
-        return dist;
-}
-
-TePDIRGSCell*
-TePDIRGSCell :: ClosestNeighbor( float& dist )
-{
-        TePDIRGSCell    *c;
-
-        AdjustNeighborhood();
-        if( Neighbors_->size() <= 0L ) return NULL;
-        if( ( c = Cc_->Minimum( dist ) ) != NULL ) return c;
-
-        Cc_->Reset();
-
-        TePDIRGSCellList::iterator it;
-        for (it=Neighbors_->begin(); it!=Neighbors_->end() ; ++it) {
-                c=(*it).second;
-
-                if( !c->Dead() )
-                {
-                        dist = Distance( c );
-                        Cc_->Insert( c, dist );
-                }
-        }
-        c = Cc_->Minimum( dist );
-
-        return c;
-}
-
-void
-TePDIRGSCell :: Print()
-{
-        TePDIRGSCell    *c;
-        long i;
-
-        printf( "\n%ld - %ld %f %i ", Idnumber_, Npix_, delta_, Neighbors_->size() );
-        for( short ban = 0; ban < Nban_; ban++ )
-                printf( "%f ", Media_[ban] );
-        printf("\n Mais proximos -> ");
-        for( i = 0; i < MAXCLOSECELLS; i++ )
-        {
-                if( Cc_->cmin[i] != NULL )
-                        printf("( %ld %f %d ) ", Cc_->cmin[i]->Id(), Cc_->dmin[i], Cc_->cmin[i]->Stat_ );
-                else
-                        printf("( NULL ) " );
-        }
-        printf("\n Neighbors -> ");
-        TePDIRGSCellList::iterator it;
-        for (it=Neighbors_->begin(); it!=Neighbors_->end() ; ++it) {
-                c=(*it).second;
-                if( c != NULL )
-                        printf( "(%ld %f %d) ", c->Idnumber_, Distance( c ), c->Stat_ );
-        }
-        printf( "\n");
-}
-
+#include "TePDIRegGrowSeg.hpp"
+
+#include "TePDIRaster2Vector.hpp"
+#include "TePDIUtils.hpp"
+
+
+TePDIRegGrowSeg::TePDIRegGrowSeg()
+{
+        ListCell_      = NULL;
+        WindowCell_    = NULL;
+        tuple_         = NULL;
+        OnLimbo_       = 0;
+        CurrentWindow_ = 0;
+        WindowOffset_  = 1;
+        WindowLines_   = 0;
+        WindowColumns_ = 0;
+        Nlin_          = 0;
+        Ncol_          = 0;
+        Nban_          = 0;
+        Areamin_       = 0;
+        Difsim_       = (float)0;
+}
+
+
+TePDIRegGrowSeg::~TePDIRegGrowSeg()
+{
+        Imagein_.reset();
+        Imagelab_.reset();
+        Imageexc_.reset();
+
+        if( WindowCell_ != NULL ) {delete []WindowCell_; WindowCell_=NULL;}
+        if( tuple_      != NULL ) {delete []tuple_; tuple_=NULL;}
+        NWindow_       = 0;
+        WindowLines_   = 0;
+        WindowColumns_ = 0;
+        CurrentWindow_ = 0;
+        WindowOffset_  = 1;
+        Nlin_       = 0;
+        Ncol_       = 0;
+        Nban_       = 0;
+        Areamin_    = 0;
+        Difsim_     = (float)0;
+        if( ListCell_  != NULL )
+        {
+                TePDIRGSCellList::iterator it;
+                for (it=ListCell_->begin(); it!=ListCell_->end(); it++)
+                        delete (*it).second;
+                ListCell_->clear();
+                delete ListCell_;
+                ListCell_ = NULL;
+        }
+}
+
+
+void TePDIRegGrowSeg::ResetState( const TePDIParameters& params )
+{
+  if( params != params_ ) {
+    Imagein_.reset();
+    Imagelab_.reset();
+    Imageexc_.reset();
+    
+    if( WindowCell_ != NULL ) {delete []WindowCell_; WindowCell_=NULL;}
+        
+    if( tuple_ != NULL ) {delete []tuple_; tuple_=NULL;}
+            
+    if( ListCell_  != NULL )
+    {
+            TePDIRGSCellList::iterator it;
+            for (it=ListCell_->begin(); it!=ListCell_->end(); it++)
+                    delete (*it).second;
+            ListCell_->clear();
+            delete ListCell_;
+            ListCell_ = NULL;
+    }    
+  }
+}
+
+
+bool TePDIRegGrowSeg::CheckParameters( const TePDIParameters& parameters ) const
+{
+  /* Checking for general required parameters */
+
+  //parameter input_image
+  TePDITypes::TePDIRasterPtrType inRaster;
+  if( ! parameters.GetParameter( "input_image", inRaster ) ) {
+
+    TEAGN_LOGERR( "Missing parameter: input_image" );
+    return false;
+  }
+  if( ! inRaster.isActive() ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image inactive" );
+    return false;
+  }
+  if( inRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+    TEAGN_LOGERR( "Invalid parameter: input_image not ready" );
+    return false;
+  }
+  TEAGN_TRUE_OR_RETURN( ( ! inRaster->params().useDummy_ ),
+    "input_image must not contain dummy values" );
+
+  //parameter output_image
+  if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "output_image" ) ) {
+    
+    TePDITypes::TePDIRasterPtrType outRaster;
+    if( ! parameters.GetParameter( "output_image", outRaster ) ) {
+  
+      TEAGN_LOGERR( "Missing parameter: output_image" );
+      return false;
+    }
+    if( ! outRaster.isActive() ) {
+  
+      TEAGN_LOGERR( "Invalid parameter: output_image inactive" );
+      return false;
+    }
+    if( outRaster->params().status_ != TeRasterParams::TeReadyToWrite ) {
+  
+      TEAGN_LOGERR( "Invalid parameter: output_image not ready" );
+      return false;
+    }
+    TEAGN_TRUE_OR_RETURN( 
+      ( outRaster->params().dataType_[0] == TeUNSIGNEDLONG ),
+      "Invalid parameter: output_image pixel type must be TeUNSIGNEDLONG" );
+  }
+  
+  //parameter restriction_image
+  TePDITypes::TePDIRasterPtrType restrictionRaster;
+  if( parameters.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+    "restriction_image" ) ) {
+
+    if( ! parameters.GetParameter( "restriction_image", restrictionRaster ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: restriction_image" );
+      return false;
+    }
+    if( ! restrictionRaster.isActive() ) {
+
+      TEAGN_LOGERR( "Invalid parameter: restriction_image inactive" );
+      return false;
+    }
+    if( restrictionRaster->params().status_ == TeRasterParams::TeNotReady ) {
+
+      TEAGN_LOGERR( "Invalid parameter: restriction_image not ready" );
+      return false;
+    }
+    TEAGN_TRUE_OR_RETURN( ( ! restrictionRaster->params().useDummy_ ),
+      "input_image must not contain dummy values" );    
+  }
+
+  if( ! parameters.CheckParameter< double >( "euc_treshold" ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: euc_treshold" );
+      return false;
+  }
+
+  if( ! parameters.CheckParameter< int >( "area_min" ) ) {
+
+        TEAGN_LOGERR( "Missing parameter: area_min" );
+    return false;
+  }
+  
+  if( parameters.CheckParameter< TePDITypes::TePDIPolSetMapPtrType >( 
+    "output_polsets" ) ) {
+            
+    TePDITypes::TePDIPolSetMapPtrType output_polsets;
+    parameters.GetParameter( "output_polsets", output_polsets );
+            
+    TEAGN_TRUE_OR_RETURN( output_polsets.isActive(),
+      "Invalid parameter output_polsets : Inactive polygon set pointer" );   
+  }   
+
+  return true;
+}
+
+
+bool TePDIRegGrowSeg::RunImplementation()
+{
+        params_.GetParameter( "input_image", Imagein_ ) ;
+        params_.GetParameter( "area_min", Areamin_ ) ;
+        params_.GetParameter( "euc_treshold", Difsim_ ) ;
+
+        if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+          "restriction_image" ) ) {
+
+          params_.GetParameter( "restriction_image", Imageexc_ );
+        }
+
+        Nban_ = (int)Imagein_->params().nBands();
+
+        if( params_.CheckParameter< TePDITypes::TePDIRasterPtrType >( 
+          "output_image" ) ) {
+
+          params_.GetParameter( "output_image", Imagelab_ );
+            
+          TeRasterParams Imagelab_params = Imagelab_->params();
+  
+          Imagelab_params.nBands( 1 );
+          if( Imagein_->projection() != 0 ) {
+            TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+              Imagein_->projection()->params() ) );          
+            Imagelab_params.projection( proj.nakedPointer() );
+          }
+          Imagelab_params.boxResolution( Imagein_->params().box().x1(), 
+            Imagein_->params().box().y1(), Imagein_->params().box().x2(), 
+            Imagein_->params().box().y2(), Imagein_->params().resx_, 
+            Imagein_->params().resy_ );  
+
+          TEAGN_TRUE_OR_RETURN( Imagelab_->init( Imagelab_params ),
+            "Output raster reset error" );            
+        } else {
+          TeRasterParams Imagelab_params = Imagein_->params();
+          Imagelab_params.nBands( 1 );
+          Imagelab_params.setDataType( TeUNSIGNEDLONG, -1 );
+          
+          TEAGN_TRUE_OR_RETURN( 
+            TePDIUtils::TeAllocRAMRaster( Imagelab_, Imagelab_params,
+            TePDIUtils::TePDIUtilsAutoMemPol ),
+            "Internal raster allocation error");
+        }
+
+        Nlin_ = Imagelab_->params().nlines_;
+        Ncol_ = Imagelab_->params().ncols_;
+
+        // Initialize colection of regions
+        ListCell_ = new TePDIRGSCellList;
+        TEAGN_TRUE_OR_RETURN( ( ListCell_ != NULL ),
+          "Unable to create the cells list" )
+
+        // Initialize the array of regions of window
+
+        WindowCell_ = new TePDIRGSCell*[TAMJAN*TAMJAN];
+        TEAGN_TRUE_OR_RETURN( ( WindowCell_ != NULL ),
+          "Unable to create TePDIRGSCell instance" )
+                
+
+        // Set initial values
+
+        tuple_ = new unsigned long[Nban_] ;
+
+
+        WindowLines_ = ( Nlin_ % TAMJAN ) ? ( Nlin_ / TAMJAN + 1 ) : ( Nlin_ / TAMJAN );
+        WindowColumns_ = ( Ncol_ % TAMJAN ) ? ( Ncol_ / TAMJAN + 1 ) : ( Ncol_ / TAMJAN );
+        NWindow_    = WindowLines_ * WindowColumns_;
+
+        // Start Region Growing
+        short canceled = 0;
+        WindowOffset_ = 1L;
+
+
+        int step = 0;
+        TePDIPIManager progress( "Region Growing...", NWindow_,
+          progress_enabled_ );
+
+        for( CurrentWindow_ = 0; CurrentWindow_ < NWindow_; CurrentWindow_++ )
+        {
+                TEAGN_TRUE_OR_RETURN( InitWindow(),
+                  "Unable to init window" )
+                  
+                Adjust();
+                
+                TEAGN_TRUE_OR_RETURN( MergeMutuallyClosestCells(),
+                  "Unable to merge cells" )
+                                        
+                TEAGN_TRUE_OR_RETURN( MergeSmallCells( 5 , Nlin_),
+                  "Unable to merge small cells" )
+                                        
+                TEAGN_FALSE_OR_RETURN( progress.Update( step ),
+                  "Canceled by the user" );
+
+                ++step;
+        }
+
+
+        if (!canceled)
+        {
+                if( MergeSmallCells( Areamin_ , Nlin_) == 0 )
+                                canceled=1;
+                if( Resort() == 0 )
+                                canceled=1;
+        }
+        
+        if (!canceled) {
+          if( params_.CheckParameter< TePDITypes::TePDIPolSetMapPtrType >( 
+            "output_polsets" ) ) {
+            
+            TePDIRaster2Vector vectorizer;
+            
+            TePDIParameters vectorizer_params = params_;
+            vectorizer_params.SetParameter( "rotulated_image", Imagelab_ );
+            vectorizer_params.SetParameter( "channel", (unsigned int)0 );
+            
+            TEAGN_TRUE_OR_RETURN( vectorizer.Reset( vectorizer_params ),
+              "Unable to set vectorize parameters" );
+            TEAGN_TRUE_OR_RETURN( vectorizer.Apply(),
+              "Unable to create output polygon set" );
+          }          
+        }
+
+        return !canceled;
+}
+
+
+bool
+TePDIRegGrowSeg :: InitWindow()
+{
+        int             lin, col;
+        long    ind;
+        unsigned long   idcell,
+                        idwindow,
+                        cellid;
+        float   dist;
+        TePDIRGSCell *c = 0;
+        TePDIRGSCell *cell = 0;
+        TePDIRGSCell *cwindow = 0;
+
+        ilin_ = (int)( ( CurrentWindow_ / WindowColumns_ ) * TAMJAN );
+        icol_ = (int)( ( CurrentWindow_ % WindowColumns_ ) * TAMJAN );
+        flin_ = ilin_ + TAMJAN - 1;
+        if( flin_ >= Nlin_ ) flin_ = Nlin_ - 1;
+        fcol_ = icol_ + TAMJAN - 1;
+        if( fcol_ >= Ncol_ ) fcol_ = Ncol_ - 1;
+        sizelin_   = flin_ - ilin_ + 1;
+        sizecol_   = fcol_ - icol_ + 1;
+        int     proLimbo = 6*TAMJAN;
+
+
+//CTX Drop cells that are farther than proLimbo from current window base line
+        if (icol_ < TAMJAN && ilin_ > proLimbo)
+        {
+                short   flag=0;
+                MergeSmallCells( Areamin_ , ilin_ - proLimbo);
+
+                TePDIRGSCellList::iterator it;
+                for (it=ListCell_->begin(); it!=ListCell_->end() ; ++it) {
+                        c=(*it).second;
+
+                        if( c == NULL ) continue;
+                        if ((ilin_ - c->LineMax()) > proLimbo)
+                        {
+                                flag = 1;
+                                c->Kill();
+                                OnLimbo_++;
+                        }
+                }
+                if (flag)
+                        Adjust();
+        }
+
+        // Constructs the array of regions belonging to this window
+        idcell = (unsigned long)WindowOffset_;
+        double val;
+
+        for( lin = ilin_; lin <= flin_; lin++ ) {
+                for( col = icol_; col <= fcol_; col++ ) {
+
+                        if( Imageexc_.isActive() ){
+                                (*Imageexc_).getElement(col, lin ,val,0);
+                                if( val == 0 ){
+                                        (*Imagelab_).setElement(col,lin,0L);
+                                        WindowCell_[idcell-WindowOffset_] = NULL;
+                                        idcell++;
+                                        continue;
+                                }
+                        }
+
+                        if (!((*Imagelab_).setElement(col,lin,(double) idcell,0))){
+                                                         return false;
+                        }
+
+                        double d;
+                        (*Imagelab_).getElement(col, lin,d,0);
+                        for( int ban = 0; ban < Nban_; ban++ ) {
+                                (*Imagein_).getElement(col,lin ,val,ban);
+                                tuple_[ban] = (unsigned long)val;
+                        }
+
+//FAMI1095 (it's really not necessary to free memory)
+//if(WindowCell_[idcell-WindowOffset_]) {delete WindowCell_[idcell-WindowOffset_]; WindowCell_[idcell-WindowOffset_]=NULL;}
+                        //WindowCell_[idcell-WindowOffset_] = new TePDIRGSCell( tuple_, idcell, lin, col, Nban_ );
+                        WindowCell_[idcell-WindowOffset_] = cellStack.Pop();
+
+                        WindowCell_[idcell-WindowOffset_]->Init( tuple_, idcell, lin, col, Nban_ );
+                        if( WindowCell_[idcell-WindowOffset_] == NULL )
+                        {
+                                for( unsigned int i = 0; i < idcell-WindowOffset_; i++ )
+                                        delete WindowCell_[i];
+                        }
+                        idcell++;
+                }
+        }
+
+
+        // Take the neighborhood of regions lying inside the window
+        for( lin = ilin_; lin <= flin_; lin++ )
+        {
+                for( col = icol_; col <= fcol_; col++ )
+                {
+                        ind = (lin - ilin_) * sizecol_ + ( col - icol_ );
+                        c = WindowCell_[ind];
+                        if( c == NULL )
+                                continue;
+                        if( col < fcol_ && WindowCell_[ind+1] != NULL )
+                        {
+                                dist = WindowCell_[ind]->Distance( WindowCell_[ind+1] );
+                                WindowCell_[ind]->InsertNeighbor(WindowCell_[ind+1], dist );
+                                WindowCell_[ind+1]->InsertNeighbor(WindowCell_[ind], dist );
+                        }
+                        if( lin < flin_ && WindowCell_[ind+sizecol_] != NULL )
+                        {
+                                dist = WindowCell_[ind]->Distance( WindowCell_[ind+sizecol_] );
+                                WindowCell_[ind]->InsertNeighbor(WindowCell_[ind+sizecol_], dist );
+                                WindowCell_[ind+sizecol_]->InsertNeighbor(WindowCell_[ind], dist );
+                        }
+                }
+        }
+
+        // Atualiza Cells de fronteira a esquerda
+        double tmp;
+        if( icol_ > 0 )
+        {
+                cellid = 0L;
+                for( lin = ilin_; lin <= flin_; lin++ )
+                {
+                        (*Imagelab_).getElement(icol_-1,lin,tmp,0);
+                        idcell = (unsigned long)tmp;
+                        (*Imagelab_).getElement(icol_,lin,tmp,0);
+                        idwindow = (unsigned long)tmp;
+                        if( idcell == 0L || idwindow == 0L )
+                                continue;
+                        if( cellid != idcell ){
+                                TePDIRGSCellList::iterator it;
+                                if ( (it = ListCell_->find( idcell ) ) == ListCell_->end() ) {
+                                    //Fatal error : we didn t found the id in the list
+                                                                        return false;
+                                }
+                                cell = (*it).second;
+                                cellid = cell->Id();
+                        }
+                        cwindow = WindowCell_[ (lin-ilin_) * sizecol_ ];
+                        dist = cell->Distance( cwindow );
+                        cell->AddNeighbor( cwindow, dist );
+                        cwindow->AddNeighbor( cell, dist );
+                }
+        }
+
+        // Atualiza Cells de fronteira acima
+        if( ilin_ > 0 )
+        {
+                cellid = 0L;
+                for( col = icol_; col <= fcol_; col++ )
+                {
+                        (*Imagelab_).getElement(col,ilin_-1,tmp,0);
+                        idcell = (unsigned long)tmp;
+                        (*Imagelab_).getElement(col,ilin_,tmp,0);
+                        idwindow = (unsigned long)tmp;
+                        if( idcell == 0L || idwindow == 0L )
+                                continue;
+                        if( cellid != idcell )
+                        {
+                                TePDIRGSCellList::iterator it;
+                                if ( (it = ListCell_->find( idcell ) ) == ListCell_->end() ) {
+                                                                        return false;
+                                }
+                                cell = (*it).second;
+                                cellid = cell->Id();
+                        }
+                        cwindow = WindowCell_[ col - icol_ ];
+                        dist = cell->Distance( cwindow );
+                        cell->AddNeighbor( cwindow, dist );
+                        cwindow->AddNeighbor( cell, dist );
+                }
+        }
+
+        // Add Regions in WindowCell_ in the list ListCell_;
+        for( ind = 0; ind < sizelin_ * sizecol_; ind++ ){
+                if( WindowCell_[ ind ] != NULL )
+                        ListCell_->insert(make_pair(WindowCell_[ ind ]->Id(), WindowCell_[ ind ]));
+        }                                               //stCell[WindowCell_[ ind ]->Id()]=WindowCell_[ ind ];
+
+
+        WindowOffset_ += ((long)sizelin_ * sizecol_ );
+        return true;
+
+}
+
+bool
+TePDIRegGrowSeg::MergeMutuallyClosestCells() {
+        float   dist;
+        float   diff;
+        char    status;
+        TePDIRGSCell    *c,
+                *cgo,
+                *cback;
+
+        for( int step = 1; step <= (int)Difsim_ ; step++ )
+        {
+           diff = (float)step * step;
+           do {
+                status  = 0;
+                TePDIRGSCellList::iterator it;
+                for (it=ListCell_->begin(); it!=ListCell_->end() ; ++it) {
+                        c=(*it).second;
+
+                        while( !c->Dead() )
+                        {
+                                if( ( cgo = c->ClosestNeighbor(dist) ) == NULL ) break;
+
+                                cback = cgo->ClosestNeighbor(dist);
+                                if( c == cback ) {
+                                        if( dist <= diff  ) {
+                                                c = MergeCells( c, cgo );
+                                                status = 1;
+                                        }else
+                                                break;
+                                }else
+                                        break;
+                        }
+                }
+//              Adjust();
+           }while( status );
+        }
+        Adjust();
+
+        return true;
+}
+
+bool
+TePDIRegGrowSeg :: MergeSimilarCells()
+{
+        float   d1;
+        float   diff;
+        char    status;
+        TePDIRGSCell    *c,
+                *cgo;
+
+        for( int step = 1; step <= (int)Difsim_ ; step++ )
+        {
+           diff = (float)step * step;
+           do {
+                status  = 0;
+
+                TePDIRGSCellList::iterator it;
+                for (it=ListCell_->begin(); it!=ListCell_->end() ; ++it) {
+                        c=(*it).second;
+
+                        while( !c->Dead() )
+                        {
+                                if( ( cgo = c->ClosestNeighbor(d1) ) == NULL ) break;
+                                if( d1 <= diff )
+                                {
+                                        c = MergeCells( c, cgo );
+                                        status = 1;
+                                }
+                                else    break;
+                        }
+                }
+                Adjust();
+           }while( status );
+        }
+        return true;
+}
+
+bool
+TePDIRegGrowSeg :: MergeSmallCells( long area ,int linmax)
+{
+        char    status;
+        TePDIRGSCell    *c,
+                *cgo,
+                *cback;
+        float   dist;
+        float   diff;
+        int step;
+
+        if( area > Areamin_ )area = Areamin_;
+
+// Elimina regioes pequenas atraves do merging com a regiao vizinha mais proxima
+        for( step = 1; step <= 6; step++ )
+        {
+           diff = (float)(Difsim_ + step * 2);
+           diff = diff * diff;
+           do {         status  = 0;
+
+                TePDIRGSCellList::iterator it;
+                for (it=ListCell_->begin(); it!=ListCell_->end() ; ++it) {
+                        c=(*it).second;
+
+                        if( c->Dead() || c->Area() > area || c->LineMax() > linmax)
+                                continue;
+                        if( ( cgo = c->ClosestNeighbor(dist) ) == NULL )
+                                break;
+                        cback = cgo->ClosestNeighbor(dist);
+                        if( c != cback ) continue;
+                        if( dist <= diff || step > 5 )
+                        {
+                                c = MergeCells( c, cgo );
+                                status = 1;
+                        }
+                }
+//CTX           Adjust();
+           }while( status );
+        }
+        Adjust();
+
+        for( step = 1; step <= 6; step++ )
+        {
+           diff = (float)(Difsim_ + step * 2);
+           diff = diff * diff;
+           do {         status  = 0;
+                TePDIRGSCellList::iterator it;
+                for (it=ListCell_->begin(); it!=ListCell_->end() ; ++it) {
+                        c=(*it).second;
+
+                        if( c->Dead() || c->Area() > area || c->LineMax() > linmax)
+                                continue;
+                        if( ( cgo = c->ClosestNeighbor(dist) ) == NULL ) break;
+                        if( dist <= diff || step > 5 )
+                        {
+                                c = MergeCells( c, cgo );
+                                status = 1;
+                        }
+                }
+//              Adjust();
+           }while( status );
+        }
+        Adjust();
+
+        return true;
+}
+
+void
+TePDIRegGrowSeg :: Adjust()
+{
+        TePDIRGSCell    *c;
+        TePDIRGSCellList::iterator itt;
+                TePDIRGSCellList::iterator it=ListCell_->begin();
+        while (it!=ListCell_->end()) {
+            itt=it;
+                        c=(*itt).second;
+                        it++;
+            if ( c == NULL ) {
+                ListCell_->erase(itt);
+            } else if( c->Dead() ) {
+                ListCell_->erase(itt);
+                cellStack.Push(c);
+            } else {
+                c->AdjustNeighborhood();
+            }
+        }
+}
+
+TePDIRGSCell*
+TePDIRegGrowSeg :: MergeCells( TePDIRGSCell *c1, TePDIRGSCell *c2 )
+{
+        double val;
+        int     lmin, lmax, cmin, cmax;
+        TePDIRGSCell    *cret = NULL;
+
+        if( c1 == NULL || c2 == NULL ) return NULL;
+        if( c1 == c2 ) return NULL;
+
+        if( c1->Area() >= c2->Area() )
+        {
+                if( c1->Merge( c2 ) == 0 ) return NULL;
+                c2->BoundingRectangle( lmin, cmin, lmax, cmax );
+                for( int lin = lmin; lin <= lmax; lin++ ) {
+                        for( unsigned int col = cmin; col <= (unsigned int)cmax; col++ ) {
+                                (*Imagelab_).getElement(col,lin,val,0);
+                                if( (unsigned long)val == (unsigned long)c2->Id() ) (*Imagelab_).setElement(col,lin,(unsigned long)c1->Id(), 0);
+                        }
+                }
+                cret = c1;
+        }
+        else
+        {
+                if( c2->Merge( c1 ) == 0 ) return NULL;
+                c1->BoundingRectangle( lmin, cmin, lmax, cmax );
+                for( int lin = lmin; lin <= lmax; lin++ ) {
+                        for( int col = cmin; col <= cmax; col++ ) {
+                                (*Imagelab_).getElement(col,lin,val,0);
+                                if( (unsigned long)val == (unsigned long)c1->Id() )
+                                        (*Imagelab_).setElement(col,lin,(unsigned long)c2->Id(),0);
+                        }
+                }
+                cret = c2;
+        }
+
+        return cret;
+}
+
+
+bool
+TePDIRegGrowSeg :: Resort()
+{
+// Evaluate total number of cells
+
+        //long size = OnLimbo_ + ListCell_->size();
+
+// Allocate array for resorting image
+        map<long, long> m_map;
+        long    newid,
+                        oldid = 0L,
+                        index=1,
+                        nindex = 0L;
+        double val;
+
+        for( int lin = 0; lin < Nlin_; lin++ )
+        {
+                for( int col = 0; col < Ncol_ ; col++ )
+                {
+
+                        (*Imagelab_).getElement(col,lin,val,0);
+                        newid=(long)val;
+                        if( newid == 0L ) // 0L means excluded area for region growing....
+                                continue;
+                        if( newid != oldid || oldid == 0L )
+                        {
+
+                                if ( m_map.find(newid) == m_map.end() )
+                                {
+                                        nindex++;
+                                        index = nindex;
+                                        m_map[newid] = index;
+                                }
+                                else index = m_map[newid];              // AND & LEO 10/00
+                                oldid = newid;
+                        }
+                        (*Imagelab_).setElement(col,lin,index,0);
+                }
+        }
+
+
+// Free all memory
+        ListCell_->clear();
+        delete ListCell_;
+        ListCell_ = NULL;
+        cellStack.Clear();
+
+        m_map.clear();
+        return true;
+}
+
+
+//--------------------------------TePDIRGSCell ---------------------------------
+
+
+TePDIRGSCell :: TePDIRGSCell( unsigned long* tuple, long id, short lin, short col, short Nban )
+{
+        Stat_          = 0;
+        Idnumber_      = id;
+        Npix_          = 1;
+        Nban_          = Nban;
+        LinMax_        = lin;
+        LinMin_        = lin;
+        ColMax_        = col;
+        ColMin_        = col;
+        Neighbors_     = new TePDIRGSCellList;
+        Media_         = new float[Nban];
+        PreviousMedia_ = new float[Nban];
+        Cc_            = new CloserCells;
+        for( int ban = 0; ban < Nban_; ban++ )
+                Media_[ban] = PreviousMedia_[ban] = (float) tuple[ban];
+}
+
+
+void TePDIRGSCell :: Init( unsigned long* tuple, long id, short lin, short col, short Nban )
+{
+        Stat_          = 0;
+        Idnumber_      = id;
+        Npix_          = 1;
+        Nban_          = Nban;
+        LinMax_        = lin;
+        LinMin_        = lin;
+        ColMax_        = col;
+        ColMin_        = col;
+        if (Neighbors_==NULL)
+        {
+                Neighbors_     = new TePDIRGSCellList;
+                Media_         = new float[Nban_];
+                PreviousMedia_ = new float[Nban_];
+                Cc_            = new CloserCells;
+
+                /*if ( PreviousMedia_ == NULL || Media_ == NULL || Neighbors == NULL || Cc == NULL )
+                        SGError.Handler(ALLOCATION,FATAL,"TePDIRGSCell constructor");*/
+        }
+        else
+        {
+                Cc_->Reset();
+                Neighbors_->clear();
+        }
+        for( int ban = 0; ban < Nban_; ban++ )
+                Media_[ban] = PreviousMedia_[ban] = (float) tuple[ban];
+}
+
+
+TePDIRGSCell :: TePDIRGSCell()
+{
+        Stat_          = 0;
+        Idnumber_      = 0;
+        Npix_          = 1;
+        Nban_          = 0;
+        LinMax_        = 0;
+        LinMin_        = 0;
+        ColMax_        = 0;
+        ColMin_        = 0;
+        Neighbors_     = NULL;
+        Media_         = NULL;
+        PreviousMedia_ = NULL;
+        Cc_            = NULL;
+}
+
+TePDIRGSCell :: ~TePDIRGSCell()
+{
+        if(Media_) {delete []Media_; Media_=NULL;}
+        if(Neighbors_) {delete Neighbors_; Neighbors_=NULL;}
+        if(PreviousMedia_) {delete []PreviousMedia_; PreviousMedia_=NULL;}
+        if(Cc_) {delete Cc_; Cc_=NULL;}
+}
+
+void
+TePDIRGSCell::AdjustNeighborhood()
+{
+        Cc_->Adjust();
+        TePDIRGSCellList::iterator itt;
+                TePDIRGSCellList::iterator it=Neighbors_->begin();
+        while (it!=Neighbors_->end()){
+            itt=it;
+                        it++;
+                        if (( (*itt).second==NULL) || ( (*itt).second->Dead() ) ){
+                  Neighbors_->erase(itt);
+            }
+        }
+}
+
+
+bool
+TePDIRGSCell :: AddNeighbor( TePDIRGSCell *c, float dist )
+{
+        if( c == NULL ) return false;
+        if( c->Dead() ) return false;
+        Cc_->Update( c, dist );
+
+//      Neighbors[c->id()]=c;
+        Neighbors_->insert(make_pair(c->Id(),c));
+        AdjustNeighborhood();
+        return true;
+}
+
+
+bool
+TePDIRGSCell :: InsertNeighbor( TePDIRGSCell* c, float dist )
+{
+        if( c == NULL ) return false;
+        if( c->Dead() ) return false;
+        Cc_->Insert( c, dist );
+
+//  Neighbors[c->id()]=c;
+        Neighbors_->insert(make_pair(c->Id(),c));
+        AdjustNeighborhood();
+        return true;
+}
+
+
+bool
+TePDIRGSCell :: Merge( TePDIRGSCell *c )
+{
+        TePDIRGSCell    *cviz;
+        float   dist;
+        long    area;
+        int ban;
+
+        if( c == NULL ) return false;
+
+        if( LinMax_ < c->LinMax_ ) LinMax_ = c->LinMax_;
+        if( LinMin_ > c->LinMin_ ) LinMin_ = c->LinMin_;
+        if( ColMax_ < c->ColMax_ ) ColMax_ = c->ColMax_;
+        if( ColMin_ > c->ColMin_ ) ColMin_ = c->ColMin_;
+
+        area  = Npix_ + c->Npix_;
+        delta_ = (float)0;
+        for( ban = 0; ban < Nban_; ban++ )
+        {
+                Media_[ban] = (Media_[ban] * Npix_ + c->Media_[ban] * c->Npix_) / area;
+                dist = Media_[ban] - PreviousMedia_[ban];
+                delta_ += dist * dist;
+        }
+        Npix_ = area;
+
+        c->Kill();
+
+        if( delta_ > (float)1 )
+        {
+                Cc_->Reset();
+                for( ban = 0; ban < Nban_; ban++ )
+                        PreviousMedia_[ban] = Media_[ban];
+
+                TePDIRGSCellList::iterator it;
+                for (it=Neighbors_->begin(); it!=Neighbors_->end() ; ++it) {
+                        cviz=(*it).second;
+                        if( cviz == NULL ) return false;
+                        if( cviz->Dead() ) continue;
+                        dist = Distance( cviz );
+                        Cc_->Insert( cviz, dist );
+                        cviz->Cc_->Update( this, dist );
+                }
+        }
+
+        TePDIRGSCellList::iterator it;
+        for (it=c->Neighbors_->begin(); it!=c->Neighbors_->end() ; ++it) {
+                cviz=(*it).second;
+
+                if( cviz == NULL ) return false;
+                if( cviz != this && !cviz->Dead())
+                {
+                        dist = Distance( cviz );
+                        if( cviz->AddNeighbor( this, dist ) == 0 )
+                                return false;
+                        if( AddNeighbor( cviz, dist ) == 0 )
+                                return false;
+                }
+        }
+
+        return true;
+}
+
+
+float
+TePDIRGSCell :: Distance( TePDIRGSCell *c )
+{
+        float   diff;
+        float   dist;
+
+        if( c == NULL ) return (float)100000;
+
+        dist = 0;
+        for (short ban = 0; ban < Nban_; ban++ )
+        {
+                diff  = PreviousMedia_[ban] - c->PreviousMedia_[ban];
+                dist += (diff * diff);
+        }
+
+        return dist;
+}
+
+TePDIRGSCell*
+TePDIRGSCell :: ClosestNeighbor( float& dist )
+{
+        TePDIRGSCell    *c;
+
+        AdjustNeighborhood();
+        if( Neighbors_->size() <= 0L ) return NULL;
+        if( ( c = Cc_->Minimum( dist ) ) != NULL ) return c;
+
+        Cc_->Reset();
+
+        TePDIRGSCellList::iterator it;
+        for (it=Neighbors_->begin(); it!=Neighbors_->end() ; ++it) {
+                c=(*it).second;
+
+                if( !c->Dead() )
+                {
+                        dist = Distance( c );
+                        Cc_->Insert( c, dist );
+                }
+        }
+        c = Cc_->Minimum( dist );
+
+        return c;
+}
+
+void
+TePDIRGSCell :: Print()
+{
+        TePDIRGSCell    *c;
+        long i;
+
+        printf( "\n%ld - %ld %f %i ", Idnumber_, Npix_, delta_, Neighbors_->size() );
+        for( short ban = 0; ban < Nban_; ban++ )
+                printf( "%f ", Media_[ban] );
+        printf("\n Mais proximos -> ");
+        for( i = 0; i < MAXCLOSECELLS; i++ )
+        {
+                if( Cc_->cmin[i] != NULL )
+                        printf("( %ld %f %d ) ", Cc_->cmin[i]->Id(), Cc_->dmin[i], Cc_->cmin[i]->Stat_ );
+                else
+                        printf("( NULL ) " );
+        }
+        printf("\n Neighbors -> ");
+        TePDIRGSCellList::iterator it;
+        for (it=Neighbors_->begin(); it!=Neighbors_->end() ; ++it) {
+                c=(*it).second;
+                if( c != NULL )
+                        printf( "(%ld %f %d) ", c->Idnumber_, Distance( c ), c->Stat_ );
+        }
+        printf( "\n");
+}
+
diff --git a/src/terralib/image_processing/TePDIRegGrowSeg.hpp b/src/terralib/image_processing/TePDIRegGrowSeg.hpp
old mode 100755
new mode 100644
index 5751470..59975d5
--- a/src/terralib/image_processing/TePDIRegGrowSeg.hpp
+++ b/src/terralib/image_processing/TePDIRegGrowSeg.hpp
@@ -1,755 +1,756 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIREGGROWSEG_HPP
-  #define TEPDIREGGROWSEG_HPP
-
-  #include "TePDIAlgorithm.hpp"
-
-  #include <TeSharedPtr.h>
-  
-  #include <map>
-  
-  #define MAXCLOSECELLS   5
-  #define SQR_NC          65025
-  #define TAMJAN          128
-  #define STATDEAD        (char)2    
-  
-  /** @brief Forward declaration */
-  class TePDIRGSCell;
-  
-  
-  /** @brief Forward declaration */
-  class CloserCells;
-  
-  /**
-  * @typedef map<long, TePDIRGSCell *> TePDIRGSCellList
-  * Cell list type definition.
-  */
-  typedef map<long, TePDIRGSCell *> TePDIRGSCellList;    
-  
-  
-  /**
-  * @brief This is the basic element in the region growing process. The cell represents an area
-  * in the image being segmented. It contains spectral, geometrical and contextual
-  * information of this area. The behaviour of this class allows it to merge
-  *
-  * The behaviour of this class allows it to merge with other cells and to update its
-  * information. At the initial stage in the region growing process each cell is
-  * composed by one pixel of the image. It uses 4-Neighbourhood (contextual information).
-  */
-class PDI_DLL TePDIRGSCell
-{
-public:
-   /**
-    * @brief Default Constructor.
-    */
-        TePDIRGSCell ();
-
-   /**
-    * @brief Alternative Constructor.
-    *
-    * @param tuple: pixel tuple containing spectral information.
-    * @param id: Id number of the cell.
-    * @param lin: line position of tuple in the image.
-    * @param col: column position of tuple in the image.
-    * @param nban: Number of bands.
-    */
-   TePDIRGSCell( unsigned long *tuple, long id, short lin, short col, short nban );
-
-   /**
-    * @brief Default destructor.
-    */
-   ~TePDIRGSCell();
-
-   /**
-    * @brief Initializes an existing TePDIRGSCell
-    *
-    * @param tuple: pixel tuple containing spectral information.
-    * @param id: Id number of the cell.
-    * @param lin: line position of tuple in the image.
-    * @param col: column position of tuple in the image.
-    * @param nban: Number of bands.
-    */
-   void Init( unsigned long *tuple, long id, short lin, short col, short nban );
-
-   /**
-    * @brief Changes the Id  number of the cell
-        *
-    * @param idc: new id number
-    *
-    */
-   void ResetId( long idc ) { Idnumber_ = idc; }
-
-   /**
-    * @brief Returns The status of the cell
-    *
-    * @return If cell is dead return 1, otherwise, 0.
-    */
-   char Dead()  { return (Stat_ & STATDEAD); }
-
-   /**
-    * @brief Turns cell dead
-    *
-        * When the cell is dead it does not represent
-    * any region in the image.
-    */
-   void Kill() { Stat_ = STATDEAD; }
-
-   /**
-    * @brief Return the bounding box of the cell
-    *
-    * @param lmin: Minimum image row wich contains a pixel belonging to the cell
-    * @param cmin: Minimum image column wich contains a pixel belonging to the cell
-    * @param lmax: Maximum image row wich contains a pixel belonging to the cell
-    * @param cmax: Maximum image column wich contains a pixel belonging to the cell
-    */
-   void BoundingRectangle( int& lmin, int& cmin, int& lmax, int& cmax )
-        { lmin = LinMin_; cmin = ColMin_; lmax = LinMax_; cmax = ColMax_; }
-
-   /**
-    * @brief LinMax
-    *
-        * @return Maximum image line wich contains a pixel belonging to the cell
-    */
-   int LineMax () { return LinMax_;}
-
-   /**
-    * @brief Merge cell c with the "this" cell.
-    *
-    * @return true if OK. false on error.
-    */
-   bool Merge( TePDIRGSCell *c );
-
-   /**
-    * @brief Remove dead cells from the list of neighbour cells and closest cells
-    */
-   void AdjustNeighborhood();//{ Cc_->Adjust(); /*Neighbors_->Adjust();*/ }
-
-   /**
-    * @brief Add neighbour to neighbour cells list and closest cells list.
-    *
-    * @param c being added.
-    * @param dist euclidian distance to "this" cell
-    * @return true if OK. false on error.
-    */
-   bool AddNeighbor( TePDIRGSCell* c, float dist );
-
-   /**
-    * @brief Insert neighbour to neighbour cells list and closest cells list.
-    *
-    * @param c being added.
-    * @param dist: euclidian distance to "this" cell
-    * @return true if OK. false on error.
-    */
-   bool InsertNeighbor( TePDIRGSCell* c, float dist );
-
-   /**
-    * @brief Return the cell with the minimum euclidian distance.
-    *
-    * @param dist: minimum distance.
-    * @return Pointer to cell which has the minimum euclidian distance.
-    */
-   TePDIRGSCell* ClosestNeighbor( float& dist );
-
-   /**
-    * @brief Return the euclidian distance between cell c and "this" cell.
-    *
-        * @param c: input cell
-    * @return euclidian distance between cell c and "this" cell.
-    */
-   float Distance( TePDIRGSCell *c );
-
-   /**
-    * @brief Returns the Id number of the cell.
-    *
-    * @return Id number of the cell.
-    */
-   long Id() { return Idnumber_; }
-
-   /**
-    * @brief Return the number of pixels of the cell
-    *
-    * @return Number of pixels of the cell
-    */
-   long Area() { return Npix_; }
-
-   /**
-    * @brief Return the number of espectral bands used
-    *
-    * @return Number of espectral bands used
-    */
-   int GetNban() { return Nban_; }
-
-   /**
-    * @brief Prints cell state
-    */
-   void Print();
-
-private:
-        /** @brief Status STATDEAD = dead, otherwise, alive. */
-        char            Stat_;
-        
-        /** @brief Id number of cell */
-        long            Idnumber_;
-        
-        /** @brief Number of pixels it contains */
-        long            Npix_;
-        
-        /** @brief Number of spectral bands used */
-        int             Nban_;
-        
-        /** @brief Delta */
-        float           delta_;
-        
-        /** @brief Bounding box of cell */
-        int             LinMin_;
-        
-        /** @brief Bounding box of cell */
-        int             LinMax_;
-        
-        /** @brief Bounding box of cell */
-        int             ColMin_;
-        
-        /** @brief Bounding box of cell */
-        int             ColMax_;
-        
-        /** @brief Array of spectral mean. */
-        float           *Media_;
-        
-        /** @brief Array containing the previous spectral mean */
-        float           *PreviousMedia_;
-        
-        /** @brief List of neighbour cells */
-        TePDIRGSCellList        *Neighbors_;
-        
-        /** @brief List of closest cells */
-        CloserCells     *Cc_;
-
-};  
-
-
-/**
- * @brief Simple cell stack class.
- */
-class PDI_DLL CellStack : public vector< TePDIRGSCell* >
-{
-public:
-
-        /** 
-         * @brief Add element to top of stack.
-         * @param c Cell.
-         */
-        void Push(TePDIRGSCell* c)
-        { push_back(c); }
-
-        /** 
-         * @brief Peek at top element of stack.
-         */
-        TePDIRGSCell* Peek()
-    {
-                if (size()==0){
-                        return NULL;
-                } else {
-                        return back();
-                }
-        }
-
-        /** 
-         * @brief Pop top element off stack.
-         * @return Cell.
-         */
-        TePDIRGSCell* Pop()
-        {
-                TePDIRGSCell* c;
-                if (size()==0)
-                {
-                        c = new TePDIRGSCell();
-                } else {
-                        c = back();
-                        pop_back();
-                }
-                return c;
-        }
-
-        /**
-         * @brief Destructor.
-         */
-        ~CellStack ()
-        {
-                TePDIRGSCell *b;
-                while (size()!=0)
-                {
-                        b = Pop();
-                        delete b;
-                }
-        }
-        
-        /**
-         * @brief Clear.
-         */        
-        void Clear ()
-        {
-                TePDIRGSCell *b;
-                while (size()!=0)
-                {
-                        b = Pop();
-                        delete b;
-                }
-        }
-};
-
-
-/**
-  * @brief Keep a number (given by MAXCLOSECELLS) of closest  neighbour cells of a cell.
-  * Its an ordered array of closest neighbour cells of a cell. The contents of array
-  * are sorted in ascending order by the euclidian distance between the cell and its
-  * neighbour cell.
-  *
-  * The class cell hold some of the closest neighbour cells in this class. Every time
-  * the cell wants to the closest neighbour cell it calls methods of this class to
-  *  retrieve closest neighbour.
-  */
-class PDI_DLL CloserCells
-{
-public :
-        /**
-         * @brief Array of closest cells.
-         */
-        TePDIRGSCell    *cmin[MAXCLOSECELLS];
-
-        /**
-         * @brief Array of euclidian distances between the cell containing 
-         * this object (CloserCells) and cmin[i].
-         */
-        float   dmin[MAXCLOSECELLS];
-        
-        /**
-         * @brief Defalt constructor.
-         */
-        CloserCells()
-        {
-                for(short i = 0; i < MAXCLOSECELLS; i++ )
-                {
-                        cmin[i] = NULL;
-                        dmin[i] = 1000000.;
-                }
-        }
-
-        /**
-         * @brief New cell insertion.
-         * @param cell Cell pointer.
-         * @param dist Distance.
-         */
-        void
-        Insert( TePDIRGSCell *cell, float dist )
-        {
-                TePDIRGSCell    **pci,
-                        **p;
-                float   *di,
-                        *d;
-
-                for( pci = &cmin[0], di = &dmin[0]; pci < &cmin[MAXCLOSECELLS]; pci++, di++ )
-                {
-                        if( *pci == NULL )
-                        {
-                                *pci = cell;
-                                *di  = dist;
-                                return;
-                        }
-                        if( dist <= *di )
-                        {
-                                if( dist == *di && (*pci)->Id() < cell->Id() )
-                                        continue;
-                                if( pci < &cmin[MAXCLOSECELLS] )
-                                {
-                                        for( p = &cmin[MAXCLOSECELLS-1], d = &dmin[MAXCLOSECELLS-1]; p > pci; p--, d-- )
-                                        {
-                                                *p = *(p-1);
-                                                *d = *(d-1);
-                                        }
-                                }
-                                *pci = cell;
-                                *di  = dist;
-                                return;
-                        }
-                }
-        }
-
-        /**
-         * @brief Cell update.
-         * @param cell Cell pointer.
-         * @param dist Distance.
-         */        
-        void
-        Update( TePDIRGSCell *cell, float dist )
-        {
-                char    ok = 1;
-                TePDIRGSCell    **pci,
-                        **pc0,
-                        **pc01,
-                        **pc02;
-                float *di = 0;
-                float *d0 = 0;
-                float *d01 = 0;
-
-                pc0 = NULL;
-                for( pci = &cmin[0], di = &dmin[0]; pci < &cmin[MAXCLOSECELLS]; pci++, di++ )
-                {
-                        if( *pci == NULL )
-                        {
-                                pc0 = pci;
-                                d0  = di;
-                        }
-                        else if( (*pci)->Dead() )
-                        {
-                                *pci = NULL;
-                                pc0 = pci;
-                                d0  = di;
-                        }
-                        else if( *pci == cell )
-                        {
-                                *pci = NULL;
-                                pc0  = pci;
-                                d0   = di;
-                        }
-
-                        if( ok && dist <= *di )
-                        {
-                                if( dist == *di )
-                                {
-                                        if( *pci == NULL )
-                                        {
-                                                if( pci < &cmin[MAXCLOSECELLS-1] )
-                                                        continue;
-                                        }
-                                        else if( (*pci)->Id() < cell->Id() )
-                                                continue;
-                                }
-                                if( pc0 != NULL )
-                                {
-                                        for( pc01 = pc0, d01 = d0; pc01 < pci-1; pc01++, d01++ )
-                                        {
-                                                *pc01 = *(pc01+1);
-                                                *d01  = *(d01+1);
-                                        }
-                                        *pc01 = cell;
-                                        *d01  = dist;
-                                }
-                                else if( pci < &cmin[MAXCLOSECELLS-1] )
-                                {
-                                        for( pc01 = pci+1, d01 = di+1; pc01 < &cmin[MAXCLOSECELLS-1]; pc01++, d01++ )
-                                        {
-                                                if( (*pc01) == NULL ) break;
-                                                if( (*pc01)->Dead() ) break;
-                                                if( *pc01 == cell )   break;
-                                        }
-                                        for( pc02 = pc01; pc02 > pci; pc02-- )
-                                        {
-                                                *pc02 = *(pc02-1);
-                                                *d01  = *(d01-1);
-                                                d01--;
-                                        }
-                                        *pci = cell;
-                                        *di  = dist;
-                                }
-                                else
-                                {
-                                        *pci = cell;
-                                        *di  = dist;
-                                }
-                                ok   = 0;
-                        }
-                }
-                return;
-        }
-
-        /**
-         * @brief Undocumented.
-         * @param dist Distance.
-         * @return Cell pointer.
-         */          
-        TePDIRGSCell*
-        Minimum( float& dist )
-        {
-                if( cmin[0] != NULL )
-                {
-                        if( !cmin[0]->Dead() )
-                        {
-                                dist = dmin[0];
-                                return cmin[0];
-                        }
-                }
-                for( short i = 1; i < MAXCLOSECELLS; i++ )
-                {
-                        if( cmin[i] != NULL )
-                                if( !cmin[i]->Dead() )
-                                {
-                                        dist = dmin[i];
-                                        return cmin[i];
-                                }
-                }
-
-                return NULL;
-        }
-
-        /**
-         * @brief Undocumented.
-         */            
-        void
-        Adjust()
-        {
-                for( short i = 0; i < MAXCLOSECELLS; i++ )
-                        if( cmin[i] != NULL )
-                                if( cmin[i]->Dead() )
-                                        cmin[i] = NULL;
-        }
-
-        /**
-         * @brief Undocumented.
-         */           
-        void
-        Reset()
-        {
-                for(short i = 0; i < MAXCLOSECELLS; i++ )
-                {
-                        cmin[i] = NULL;
-                        dmin[i] = 1000000.0;
-                }
-        }
-};
-
-
-  /**
-    * @brief This is the class models an image segmentation process. 
-    * @author Nicolas Despres <nicolasdespres at wanadoo.fr>
-    * @ingroup TePDISegmentationGroup
-    *
-    * The segmentation
-    * is performed through a region growing approach described in:  Leonardo
-    * et allii, "Satellite image segmentation: a region growing approach",
-    * Simposio Brasileiro de Sensoriamento Remoto, Salvador, 1996
-    *
-    * @note The general required parameters :
-    *
-    * @param input_image (TePDITypes::TePDIRasterPtrType),
-    * @param euc_treshold (double) - euclidian distance treshold value.
-    * @param area_min (int) - cell pixel size min value.
-    *
-    * @note The following parameters are optional and will be used if present.
-    *
-    * @param restriction_image (TePDITypes::TePDIRasterPtrType) - Restriction (mask) image
-    * ( restriction image pixels with value zero will not be inside 
-    * any segments generated from the input_image, they will be ignored ). 
-    * @param output_polsets ( TePDITypes::TePDIPolSetMapPtrType ) - 
-    * The user supplied output polygon sets map where the generated polygons 
-    * will be stored (each polygon set contains polygons related to the
-    * same pixel value).   
-    * @param output_image (TePDITypes::TePDIRasterPtrType),
-    *       pointer to a Labelled image containing the final
-    *       segmentation. Each pixel contains the cell id
-    *       number to which it belongs. This image must have TeUNSIGNEDLONG 
-    *       data type.
-    */
-  class PDI_DLL TePDIRegGrowSeg : public TePDIAlgorithm {
-    public :
-      
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIRegGrowSeg();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRegGrowSeg();
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of 
-       * each PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;      
-
-    protected :
-    
-      /** @brief Array of pointer to images (input images). */
-      TePDITypes::TePDIRasterPtrType  Imagein_;
-      
-      /** @brief Pointer to the output image. */
-      TePDITypes::TePDIRasterPtrType  Imagelab_;
-      
-      /** @brief Pointer to the image containing restrictions */
-      TePDITypes::TePDIRasterPtrType  Imageexc_;
-      
-      /** @brief Pointer to the list of cells. */
-      TePDIRGSCellList        *ListCell_;
-      
-      /** @brief Array of cells for a subimage. */
-      TePDIRGSCell            **WindowCell_;
-      
-      /** @brief Number of cells which have been removed from ListCell due to distance criteria*/
-      long            OnLimbo_;
-      
-      /** @brief tuple of pixel (auxiliar). */
-      unsigned long   *tuple_;
-      
-      /** @brief Number of subimages in the image. */
-      long            NWindow_;
-      
-      /** @brief Number of subimages along the lines of image */
-      long            WindowLines_;
-      
-      /** @brief Number of subimages along the columns of image */
-      long            WindowColumns_;
-      
-      /** @brief Current subimage. */
-      long            CurrentWindow_;
-      
-      /** @brief Id number of the first cell in the subimage. */
-      long            WindowOffset_;
-      
-      /** @brief Minimum area allowed to the final cells. */
-      int             Areamin_;
-      
-      /** @brief Minimum euclidian distance between final cells. */
-      double          Difsim_;
-      
-      /** @brief Number of lines in Imagelab. */
-      int             Nlin_;
-      
-      /** @brief Number of colums in Imagelab. */
-      int             Ncol_;
-      
-      /** @brief Number of bands in Imagein */
-      int             Nban_;
-      
-      /** @brief auxiliar variables */
-      int             ilin_;
-       
-      /** @brief auxiliar variables */
-      int flin_;
-      
-      /** @brief auxiliar variables */
-      int             icol_;
-      
-      /** @brief auxiliar variables */
-      int fcol_;
-      
-      /** @brief auxiliar variables */
-      int             sizelin_;
-       
-      /** @brief auxiliar variables */
-      int sizecol_;    
-      
-      /** @brief Cell stack */
-      CellStack cellStack;
-    
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );    
-     
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-      
-      /**
-      * @brief Merges two cells
-      *
-      * @param c1 pointer to a cell to be merged
-      * @param c2 pointer to a cell to be merged
-      * @return pointer to cell resulting from merging..
-      */
-      TePDIRGSCell* MergeCells( TePDIRGSCell *c1, TePDIRGSCell *c2 );
-  
-      /**
-      * @brief Initializes a window over a image
-      *
-      * @return true if OK. false on error.
-      */
-          bool InitWindow();
-  
-      /**
-      * @brief Remove dead cells from list of cells.
-      */
-      void Adjust();
-  
-      /**
-      * @brief Eliminates all cells with area smaller than argument area.
-      * The cells with area smaller than argument area are merged with its
-      * nearest neighbour cell.
-      *
-      * @param area size in pixels which defines de area treshold for merging.
-      * @param linmax lin max of the image to consider
-      * @return true if OK. false on error.
-      */
-      bool MergeSmallCells( long area, int linmax);
-  
-      /**
-      * @brief Merges all pairs of neighbouring cells with euclidian distance
-      * bellow a threshold.
-      * The pair of cells say, c1 and c2 must satisfy the criteria:
-      *              1 - c1 = closestneighbour( c2 ) or c2 = closestneighbour( c1 ).
-      *              2 - dist( c1, c2) < threshold >
-      *
-      * @return true if OK. false on error.
-      */
-      bool MergeSimilarCells();
-  
-      /**
-      * @brief Merges all pairs of neighbouring cells with euclidian distance
-      * bellow a threshold.
-      * The pair of cells say, c1 and c2 must satisfy the criteria:
-      *              1 - c1 = closestneighbour( c2 ) or c2 = closestneighbour( c1 ).
-      *              2 - dist( c1, c2) < threshold >
-      *
-      * @return true if OK. false on error.
-      */
-      bool MergeMutuallyClosestCells();
-  
-      /**
-      * @brief Updates ImageLab by writing the cell id number for
-      * every pixel belonging to the cell.
-      *
-      * @return true if OK. false on error.
-      */
-      bool Resort();      
-  };
-  
-/** @example TePDISegmentation_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIREGGROWSEG_HPP
+  #define TEPDIREGGROWSEG_HPP
+
+  #include "TePDIAlgorithm.hpp"
+
+  #include <TeSharedPtr.h>
+  
+  #include <map>
+  
+  #define MAXCLOSECELLS   5
+  #define SQR_NC          65025
+  #define TAMJAN          128
+  #define STATDEAD        (char)2    
+  
+  /** @brief Forward declaration */
+  class TePDIRGSCell;
+  
+  
+  /** @brief Forward declaration */
+  class CloserCells;
+  
+  /**
+  * @typedef map<long, TePDIRGSCell *> TePDIRGSCellList
+  * Cell list type definition.
+  */
+  typedef map<long, TePDIRGSCell *> TePDIRGSCellList;    
+  
+  
+  /**
+  * @brief This is the basic element in the region growing process. The cell represents an area
+  * in the image being segmented. It contains spectral, geometrical and contextual
+  * information of this area. The behaviour of this class allows it to merge
+  *
+  * The behaviour of this class allows it to merge with other cells and to update its
+  * information. At the initial stage in the region growing process each cell is
+  * composed by one pixel of the image. It uses 4-Neighbourhood (contextual information).
+  */
+class PDI_DLL TePDIRGSCell
+{
+public:
+   /**
+    * @brief Default Constructor.
+    */
+        TePDIRGSCell ();
+
+   /**
+    * @brief Alternative Constructor.
+    *
+    * @param tuple: pixel tuple containing spectral information.
+    * @param id: Id number of the cell.
+    * @param lin: line position of tuple in the image.
+    * @param col: column position of tuple in the image.
+    * @param nban: Number of bands.
+    */
+   TePDIRGSCell( unsigned long *tuple, long id, short lin, short col, short nban );
+
+   /**
+    * @brief Default destructor.
+    */
+   ~TePDIRGSCell();
+
+   /**
+    * @brief Initializes an existing TePDIRGSCell
+    *
+    * @param tuple: pixel tuple containing spectral information.
+    * @param id: Id number of the cell.
+    * @param lin: line position of tuple in the image.
+    * @param col: column position of tuple in the image.
+    * @param nban: Number of bands.
+    */
+   void Init( unsigned long *tuple, long id, short lin, short col, short nban );
+
+   /**
+    * @brief Changes the Id  number of the cell
+        *
+    * @param idc: new id number
+    *
+    */
+   void ResetId( long idc ) { Idnumber_ = idc; }
+
+   /**
+    * @brief Returns The status of the cell
+    *
+    * @return If cell is dead return 1, otherwise, 0.
+    */
+   char Dead()  { return (Stat_ & STATDEAD); }
+
+   /**
+    * @brief Turns cell dead
+    *
+        * When the cell is dead it does not represent
+    * any region in the image.
+    */
+   void Kill() { Stat_ = STATDEAD; }
+
+   /**
+    * @brief Return the bounding box of the cell
+    *
+    * @param lmin: Minimum image row wich contains a pixel belonging to the cell
+    * @param cmin: Minimum image column wich contains a pixel belonging to the cell
+    * @param lmax: Maximum image row wich contains a pixel belonging to the cell
+    * @param cmax: Maximum image column wich contains a pixel belonging to the cell
+    */
+   void BoundingRectangle( int& lmin, int& cmin, int& lmax, int& cmax )
+        { lmin = LinMin_; cmin = ColMin_; lmax = LinMax_; cmax = ColMax_; }
+
+   /**
+    * @brief LinMax
+    *
+        * @return Maximum image line wich contains a pixel belonging to the cell
+    */
+   int LineMax () { return LinMax_;}
+
+   /**
+    * @brief Merge cell c with the "this" cell.
+    *
+    * @return true if OK. false on error.
+    */
+   bool Merge( TePDIRGSCell *c );
+
+   /**
+    * @brief Remove dead cells from the list of neighbour cells and closest cells
+    */
+   void AdjustNeighborhood();//{ Cc_->Adjust(); /*Neighbors_->Adjust();*/ }
+
+   /**
+    * @brief Add neighbour to neighbour cells list and closest cells list.
+    *
+    * @param c being added.
+    * @param dist euclidian distance to "this" cell
+    * @return true if OK. false on error.
+    */
+   bool AddNeighbor( TePDIRGSCell* c, float dist );
+
+   /**
+    * @brief Insert neighbour to neighbour cells list and closest cells list.
+    *
+    * @param c being added.
+    * @param dist: euclidian distance to "this" cell
+    * @return true if OK. false on error.
+    */
+   bool InsertNeighbor( TePDIRGSCell* c, float dist );
+
+   /**
+    * @brief Return the cell with the minimum euclidian distance.
+    *
+    * @param dist: minimum distance.
+    * @return Pointer to cell which has the minimum euclidian distance.
+    */
+   TePDIRGSCell* ClosestNeighbor( float& dist );
+
+   /**
+    * @brief Return the euclidian distance between cell c and "this" cell.
+    *
+        * @param c: input cell
+    * @return euclidian distance between cell c and "this" cell.
+    */
+   float Distance( TePDIRGSCell *c );
+
+   /**
+    * @brief Returns the Id number of the cell.
+    *
+    * @return Id number of the cell.
+    */
+   long Id() { return Idnumber_; }
+
+   /**
+    * @brief Return the number of pixels of the cell
+    *
+    * @return Number of pixels of the cell
+    */
+   long Area() { return Npix_; }
+
+   /**
+    * @brief Return the number of espectral bands used
+    *
+    * @return Number of espectral bands used
+    */
+   int GetNban() { return Nban_; }
+
+   /**
+    * @brief Prints cell state
+    */
+   void Print();
+
+private:
+        /** @brief Status STATDEAD = dead, otherwise, alive. */
+        char            Stat_;
+        
+        /** @brief Id number of cell */
+        long            Idnumber_;
+        
+        /** @brief Number of pixels it contains */
+        long            Npix_;
+        
+        /** @brief Number of spectral bands used */
+        int             Nban_;
+        
+        /** @brief Delta */
+        float           delta_;
+        
+        /** @brief Bounding box of cell */
+        int             LinMin_;
+        
+        /** @brief Bounding box of cell */
+        int             LinMax_;
+        
+        /** @brief Bounding box of cell */
+        int             ColMin_;
+        
+        /** @brief Bounding box of cell */
+        int             ColMax_;
+        
+        /** @brief Array of spectral mean. */
+        float           *Media_;
+        
+        /** @brief Array containing the previous spectral mean */
+        float           *PreviousMedia_;
+        
+        /** @brief List of neighbour cells */
+        TePDIRGSCellList        *Neighbors_;
+        
+        /** @brief List of closest cells */
+        CloserCells     *Cc_;
+
+};  
+
+
+/**
+ * @brief Simple cell stack class.
+ */
+class PDI_DLL CellStack : public vector< TePDIRGSCell* >
+{
+public:
+
+        /** 
+         * @brief Add element to top of stack.
+         * @param c Cell.
+         */
+        void Push(TePDIRGSCell* c)
+        { push_back(c); }
+
+        /** 
+         * @brief Peek at top element of stack.
+         */
+        TePDIRGSCell* Peek()
+    {
+                if (size()==0){
+                        return NULL;
+                } else {
+                        return back();
+                }
+        }
+
+        /** 
+         * @brief Pop top element off stack.
+         * @return Cell.
+         */
+        TePDIRGSCell* Pop()
+        {
+                TePDIRGSCell* c;
+                if (size()==0)
+                {
+                        c = new TePDIRGSCell();
+                } else {
+                        c = back();
+                        pop_back();
+                }
+                return c;
+        }
+
+        /**
+         * @brief Destructor.
+         */
+        ~CellStack ()
+        {
+                TePDIRGSCell *b;
+                while (size()!=0)
+                {
+                        b = Pop();
+                        delete b;
+                }
+        }
+        
+        /**
+         * @brief Clear.
+         */        
+        void Clear ()
+        {
+                TePDIRGSCell *b;
+                while (size()!=0)
+                {
+                        b = Pop();
+                        delete b;
+                }
+        }
+};
+
+
+/**
+  * @brief Keep a number (given by MAXCLOSECELLS) of closest  neighbour cells of a cell.
+  * Its an ordered array of closest neighbour cells of a cell. The contents of array
+  * are sorted in ascending order by the euclidian distance between the cell and its
+  * neighbour cell.
+  *
+  * The class cell hold some of the closest neighbour cells in this class. Every time
+  * the cell wants to the closest neighbour cell it calls methods of this class to
+  *  retrieve closest neighbour.
+  */
+class PDI_DLL CloserCells
+{
+public :
+        /**
+         * @brief Array of closest cells.
+         */
+        TePDIRGSCell    *cmin[MAXCLOSECELLS];
+
+        /**
+         * @brief Array of euclidian distances between the cell containing 
+         * this object (CloserCells) and cmin[i].
+         */
+        float   dmin[MAXCLOSECELLS];
+        
+        /**
+         * @brief Defalt constructor.
+         */
+        CloserCells()
+        {
+                for(short i = 0; i < MAXCLOSECELLS; i++ )
+                {
+                        cmin[i] = NULL;
+                        dmin[i] = 1000000.;
+                }
+        }
+
+        /**
+         * @brief New cell insertion.
+         * @param cell Cell pointer.
+         * @param dist Distance.
+         */
+        void
+        Insert( TePDIRGSCell *cell, float dist )
+        {
+                TePDIRGSCell    **pci,
+                        **p;
+                float   *di,
+                        *d;
+
+                for( pci = &cmin[0], di = &dmin[0]; pci < &cmin[MAXCLOSECELLS]; pci++, di++ )
+                {
+                        if( *pci == NULL )
+                        {
+                                *pci = cell;
+                                *di  = dist;
+                                return;
+                        }
+                        if( dist <= *di )
+                        {
+                                if( dist == *di && (*pci)->Id() < cell->Id() )
+                                        continue;
+                                if( pci < &cmin[MAXCLOSECELLS] )
+                                {
+                                        for( p = &cmin[MAXCLOSECELLS-1], d = &dmin[MAXCLOSECELLS-1]; p > pci; p--, d-- )
+                                        {
+                                                *p = *(p-1);
+                                                *d = *(d-1);
+                                        }
+                                }
+                                *pci = cell;
+                                *di  = dist;
+                                return;
+                        }
+                }
+        }
+
+        /**
+         * @brief Cell update.
+         * @param cell Cell pointer.
+         * @param dist Distance.
+         */        
+        void
+        Update( TePDIRGSCell *cell, float dist )
+        {
+                char    ok = 1;
+                TePDIRGSCell    **pci,
+                        **pc0,
+                        **pc01,
+                        **pc02;
+                float *di = 0;
+                float *d0 = 0;
+                float *d01 = 0;
+
+                pc0 = NULL;
+                for( pci = &cmin[0], di = &dmin[0]; pci < &cmin[MAXCLOSECELLS]; pci++, di++ )
+                {
+                        if( *pci == NULL )
+                        {
+                                pc0 = pci;
+                                d0  = di;
+                        }
+                        else if( (*pci)->Dead() )
+                        {
+                                *pci = NULL;
+                                pc0 = pci;
+                                d0  = di;
+                        }
+                        else if( *pci == cell )
+                        {
+                                *pci = NULL;
+                                pc0  = pci;
+                                d0   = di;
+                        }
+
+                        if( ok && dist <= *di )
+                        {
+                                if( dist == *di )
+                                {
+                                        if( *pci == NULL )
+                                        {
+                                                if( pci < &cmin[MAXCLOSECELLS-1] )
+                                                        continue;
+                                        }
+                                        else if( (*pci)->Id() < cell->Id() )
+                                                continue;
+                                }
+                                if( pc0 != NULL )
+                                {
+                                        for( pc01 = pc0, d01 = d0; pc01 < pci-1; pc01++, d01++ )
+                                        {
+                                                *pc01 = *(pc01+1);
+                                                *d01  = *(d01+1);
+                                        }
+                                        *pc01 = cell;
+                                        *d01  = dist;
+                                }
+                                else if( pci < &cmin[MAXCLOSECELLS-1] )
+                                {
+                                        for( pc01 = pci+1, d01 = di+1; pc01 < &cmin[MAXCLOSECELLS-1]; pc01++, d01++ )
+                                        {
+                                                if( (*pc01) == NULL ) break;
+                                                if( (*pc01)->Dead() ) break;
+                                                if( *pc01 == cell )   break;
+                                        }
+                                        for( pc02 = pc01; pc02 > pci; pc02-- )
+                                        {
+                                                *pc02 = *(pc02-1);
+                                                *d01  = *(d01-1);
+                                                d01--;
+                                        }
+                                        *pci = cell;
+                                        *di  = dist;
+                                }
+                                else
+                                {
+                                        *pci = cell;
+                                        *di  = dist;
+                                }
+                                ok   = 0;
+                        }
+                }
+                return;
+        }
+
+        /**
+         * @brief Undocumented.
+         * @param dist Distance.
+         * @return Cell pointer.
+         */          
+        TePDIRGSCell*
+        Minimum( float& dist )
+        {
+                if( cmin[0] != NULL )
+                {
+                        if( !cmin[0]->Dead() )
+                        {
+                                dist = dmin[0];
+                                return cmin[0];
+                        }
+                }
+                for( short i = 1; i < MAXCLOSECELLS; i++ )
+                {
+                        if( cmin[i] != NULL )
+                                if( !cmin[i]->Dead() )
+                                {
+                                        dist = dmin[i];
+                                        return cmin[i];
+                                }
+                }
+
+                return NULL;
+        }
+
+        /**
+         * @brief Undocumented.
+         */            
+        void
+        Adjust()
+        {
+                for( short i = 0; i < MAXCLOSECELLS; i++ )
+                        if( cmin[i] != NULL )
+                                if( cmin[i]->Dead() )
+                                        cmin[i] = NULL;
+        }
+
+        /**
+         * @brief Undocumented.
+         */           
+        void
+        Reset()
+        {
+                for(short i = 0; i < MAXCLOSECELLS; i++ )
+                {
+                        cmin[i] = NULL;
+                        dmin[i] = 1000000.0;
+                }
+        }
+};
+
+
+  /**
+    * @brief This is the class models an image segmentation process. 
+    * @author Nicolas Despres <nicolasdespres at wanadoo.fr>
+    * @ingroup TePDISegmentationGroup
+    *
+    * @note The segmentation is performed through a region growing approach 
+    * described in: S. A. Bins, L. M. G. Fonseca, G. J. Erthal e F. M. Ii, 
+    * "Satellite Imagery segmentation: a region growing approach", 
+    * VIII Simp�sio Brasileiro de Sensoriamento Remoto, Salvador, BA, 
+    * 14-19 abril 1996.    
+    *
+    * @note The general required parameters :
+    *
+    * @param input_image (TePDITypes::TePDIRasterPtrType),
+    * @param euc_treshold (double) - euclidian distance treshold value.
+    * @param area_min (int) - cell pixel size min value.
+    *
+    * @note The following parameters are optional and will be used if present.
+    *
+    * @param restriction_image (TePDITypes::TePDIRasterPtrType) - Restriction (mask) image
+    * ( restriction image pixels with value zero will not be inside 
+    * any segments generated from the input_image, they will be ignored ). 
+    * @param output_polsets ( TePDITypes::TePDIPolSetMapPtrType ) - 
+    * The user supplied output polygon sets map where the generated polygons 
+    * will be stored (each polygon set contains polygons related to the
+    * same pixel value).   
+    * @param output_image (TePDITypes::TePDIRasterPtrType),
+    *       pointer to a Labelled image containing the final
+    *       segmentation. Each pixel contains the cell id
+    *       number to which it belongs. This image must have TeUNSIGNEDLONG 
+    *       data type.
+    */
+  class PDI_DLL TePDIRegGrowSeg : public TePDIAlgorithm {
+    public :
+      
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIRegGrowSeg();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRegGrowSeg();
+      
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of 
+       * each PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;      
+
+    protected :
+    
+      /** @brief Array of pointer to images (input images). */
+      TePDITypes::TePDIRasterPtrType  Imagein_;
+      
+      /** @brief Pointer to the output image. */
+      TePDITypes::TePDIRasterPtrType  Imagelab_;
+      
+      /** @brief Pointer to the image containing restrictions */
+      TePDITypes::TePDIRasterPtrType  Imageexc_;
+      
+      /** @brief Pointer to the list of cells. */
+      TePDIRGSCellList        *ListCell_;
+      
+      /** @brief Array of cells for a subimage. */
+      TePDIRGSCell            **WindowCell_;
+      
+      /** @brief Number of cells which have been removed from ListCell due to distance criteria*/
+      long            OnLimbo_;
+      
+      /** @brief tuple of pixel (auxiliar). */
+      unsigned long   *tuple_;
+      
+      /** @brief Number of subimages in the image. */
+      long            NWindow_;
+      
+      /** @brief Number of subimages along the lines of image */
+      long            WindowLines_;
+      
+      /** @brief Number of subimages along the columns of image */
+      long            WindowColumns_;
+      
+      /** @brief Current subimage. */
+      long            CurrentWindow_;
+      
+      /** @brief Id number of the first cell in the subimage. */
+      long            WindowOffset_;
+      
+      /** @brief Minimum area allowed to the final cells. */
+      int             Areamin_;
+      
+      /** @brief Minimum euclidian distance between final cells. */
+      double          Difsim_;
+      
+      /** @brief Number of lines in Imagelab. */
+      int             Nlin_;
+      
+      /** @brief Number of colums in Imagelab. */
+      int             Ncol_;
+      
+      /** @brief Number of bands in Imagein */
+      int             Nban_;
+      
+      /** @brief auxiliar variables */
+      int             ilin_;
+       
+      /** @brief auxiliar variables */
+      int flin_;
+      
+      /** @brief auxiliar variables */
+      int             icol_;
+      
+      /** @brief auxiliar variables */
+      int fcol_;
+      
+      /** @brief auxiliar variables */
+      int             sizelin_;
+       
+      /** @brief auxiliar variables */
+      int sizecol_;    
+      
+      /** @brief Cell stack */
+      CellStack cellStack;
+    
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );    
+     
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+      
+      /**
+      * @brief Merges two cells
+      *
+      * @param c1 pointer to a cell to be merged
+      * @param c2 pointer to a cell to be merged
+      * @return pointer to cell resulting from merging..
+      */
+      TePDIRGSCell* MergeCells( TePDIRGSCell *c1, TePDIRGSCell *c2 );
+  
+      /**
+      * @brief Initializes a window over a image
+      *
+      * @return true if OK. false on error.
+      */
+          bool InitWindow();
+  
+      /**
+      * @brief Remove dead cells from list of cells.
+      */
+      void Adjust();
+  
+      /**
+      * @brief Eliminates all cells with area smaller than argument area.
+      * The cells with area smaller than argument area are merged with its
+      * nearest neighbour cell.
+      *
+      * @param area size in pixels which defines de area treshold for merging.
+      * @param linmax lin max of the image to consider
+      * @return true if OK. false on error.
+      */
+      bool MergeSmallCells( long area, int linmax);
+  
+      /**
+      * @brief Merges all pairs of neighbouring cells with euclidian distance
+      * bellow a threshold.
+      * The pair of cells say, c1 and c2 must satisfy the criteria:
+      *              1 - c1 = closestneighbour( c2 ) or c2 = closestneighbour( c1 ).
+      *              2 - dist( c1, c2) < threshold >
+      *
+      * @return true if OK. false on error.
+      */
+      bool MergeSimilarCells();
+  
+      /**
+      * @brief Merges all pairs of neighbouring cells with euclidian distance
+      * bellow a threshold.
+      * The pair of cells say, c1 and c2 must satisfy the criteria:
+      *              1 - c1 = closestneighbour( c2 ) or c2 = closestneighbour( c1 ).
+      *              2 - dist( c1, c2) < threshold >
+      *
+      * @return true if OK. false on error.
+      */
+      bool MergeMutuallyClosestCells();
+  
+      /**
+      * @brief Updates ImageLab by writing the cell id number for
+      * every pixel belonging to the cell.
+      *
+      * @return true if OK. false on error.
+      */
+      bool Resort();      
+  };
+  
+/** @example TePDISegmentation_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif
diff --git a/src/terralib/image_processing/TePDIRegGrowSegFactory.cpp b/src/terralib/image_processing/TePDIRegGrowSegFactory.cpp
index f8fd68f..87045c0 100644
--- a/src/terralib/image_processing/TePDIRegGrowSegFactory.cpp
+++ b/src/terralib/image_processing/TePDIRegGrowSegFactory.cpp
@@ -1,26 +1,26 @@
- 
-#include "TePDIRegGrowSegFactory.hpp"
-#include "TePDIRegGrowSeg.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIRegGrowSegFactory::TePDIRegGrowSegFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIRegGrowSeg" ) )
-{
-}
-
-
-TePDIRegGrowSegFactory::~TePDIRegGrowSegFactory()
-{
-}
-
-
-TePDIAlgorithm* TePDIRegGrowSegFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIRegGrowSeg();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIRegGrowSegFactory.hpp"
+#include "TePDIRegGrowSeg.hpp"
+#include <TeAgnostic.h>
+
+
+TePDIRegGrowSegFactory::TePDIRegGrowSegFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIRegGrowSeg" ) )
+{
+}
+
+
+TePDIRegGrowSegFactory::~TePDIRegGrowSegFactory()
+{
+}
+
+
+TePDIAlgorithm* TePDIRegGrowSegFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIRegGrowSeg();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIRegGrowSegFactory.hpp b/src/terralib/image_processing/TePDIRegGrowSegFactory.hpp
index 0893666..8d9b8ec 100644
--- a/src/terralib/image_processing/TePDIRegGrowSegFactory.hpp
+++ b/src/terralib/image_processing/TePDIRegGrowSegFactory.hpp
@@ -1,68 +1,68 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIREGGROWSEGFACTORY_HPP
-  #define TEPDIREGGROWSEGFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for region growing segmentation algorithm factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIRegGrowSegFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIRegGrowSegFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRegGrowSegFactory();
-      
-    protected :  
-      
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIRegGrowSegFactory TePDIRegGrowSegFactory_instance;
-  };  
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIREGGROWSEGFACTORY_HPP
+  #define TEPDIREGGROWSEGFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for region growing segmentation algorithm factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIRegGrowSegFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIRegGrowSegFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRegGrowSegFactory();
+      
+    protected :  
+      
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace {
+    static TePDIRegGrowSegFactory TePDIRegGrowSegFactory_instance;
+  };  
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIRegion.cpp b/src/terralib/image_processing/TePDIRegion.cpp
index 0f3f084..ce31fb2 100644
--- a/src/terralib/image_processing/TePDIRegion.cpp
+++ b/src/terralib/image_processing/TePDIRegion.cpp
@@ -1,43 +1,43 @@
-#include "TePDIRegion.hpp"
-#include <iostream>
-
-using namespace std;
-
-TePDIRegion::~TePDIRegion()
-{
-}
-
-// bool TePDIRegion::Init(int n, long a, TePDIStatistic s)
-bool TePDIRegion::Init(int n, long a, vector<double> m, TeMatrix c)
-{
-  // sets the number of bands
-  TEAGN_TRUE_OR_RETURN(n > 0, "Invalid number of bands");
-  nbands = n;
-  // sets the area
-  npix = a;
-  // sets the mean vector
-  mean = m;
-  // sets the covariance matrix
-  covariance = c;
-
-  return true;
-};
-
-// Returns the mean value.
-double TePDIRegion::Mean(int ind)
-{
-  TEAGN_TRUE_OR_RETURN((ind >= 0 && ind < nbands), "Invalid index in Mean Vector")
-  return mean[ind];
-}
-
-// Returns the covarariance value.
-double TePDIRegion::Covar(int i, int j)
-{
-  TEAGN_TRUE_OR_RETURN((i >= 0 && i < nbands) && (j >= 0 && j < nbands), "Invalid index in Covariance Matrix")
-  return covariance(i, j);
-}
-
-vector<double> TePDIRegion::GetMean()
-{
-  return mean;
-}
+#include "TePDIRegion.hpp"
+#include <iostream>
+
+using namespace std;
+
+TePDIRegion::~TePDIRegion()
+{
+}
+
+// bool TePDIRegion::Init(int n, long a, TePDIStatistic s)
+bool TePDIRegion::Init(int n, long a, vector<double> m, TeMatrix c)
+{
+  // sets the number of bands
+  TEAGN_TRUE_OR_RETURN(n > 0, "Invalid number of bands");
+  nbands = n;
+  // sets the area
+  npix = a;
+  // sets the mean vector
+  mean = m;
+  // sets the covariance matrix
+  covariance = c;
+
+  return true;
+};
+
+// Returns the mean value.
+double TePDIRegion::Mean(int ind)
+{
+  TEAGN_TRUE_OR_RETURN((ind >= 0 && ind < nbands), "Invalid index in Mean Vector")
+  return mean[ind];
+}
+
+// Returns the covarariance value.
+double TePDIRegion::Covar(int i, int j)
+{
+  TEAGN_TRUE_OR_RETURN((i >= 0 && i < nbands) && (j >= 0 && j < nbands), "Invalid index in Covariance Matrix")
+  return covariance(i, j);
+}
+
+vector<double> TePDIRegion::GetMean()
+{
+  return mean;
+}
diff --git a/src/terralib/image_processing/TePDIRegion.hpp b/src/terralib/image_processing/TePDIRegion.hpp
index 64bf18a..fb9bf12 100644
--- a/src/terralib/image_processing/TePDIRegion.hpp
+++ b/src/terralib/image_processing/TePDIRegion.hpp
@@ -1,172 +1,172 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIREGION_HPP
-  #define TEPDIREGION_HPP
-
-#include <vector>
-#include <iostream>
-#include <TeMatrix.h>
-#include <TePDIStatistic.hpp>
-#include "TePDIEspecData.hpp"
-#include <TeAgnostic.h>
-
-using namespace std;
-
-  /**
-   * @brief This is the class for dealing with image regions.
-   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
-   *
-   */
-
-class PDI_DLL TePDIRegion
-{
-  private:
-    /**
-    * @brief identifier
-    */
-    long id;
-
-    /**
-    * @brief area
-    */
-    long npix;
-
-    /**
-    * @brief class of region
-    */
-    int region_class;
-
-    /**
-    * @brief number of bands
-    */
-    int nbands;
-
-    /**
-    * @brief mean of the pixel values
-    */
-    vector<double> mean;
-
-    /**
-    * @brief statistics of region
-    */
-    TeMatrix covariance;
-
-  public:
-    /**
-    * Default Constructor.
-    *
-    * @param id_region The ID of the region
-    */
-    TePDIRegion(long id_region)
-    { SetId(id_region); nbands = npix = region_class = 0; }
-
-    /**
-    * Default Destructor.
-    */
-    ~TePDIRegion();
-
-    /**
-    * Initializes Region
-    *
-    * @param n number of bands
-    * @param a the area
-    * @param m mean vector
-    * @param c covariance matrix
-    */
-    bool Init(int n, long a, vector<double> m, TeMatrix c);
-
-    /**
-    * Sets the region idtity.
-    *
-    * @param id_region The ID of the region
-    */
-    void SetId(long id_region)
-    { id = id_region; }
-
-    /**
-    * Gets the ID
-    */
-    long GetId()
-    { return id; }
-
-    /**
-    * Get the number of bands.
-    */
-    int GetNban()
-    { return nbands; }
-
-    /**
-    * Set the class.
-    *
-    * @param clas The class of the Region
-    */
-    void SetClass(int clas)
-    { region_class = clas; }
-
-    /**
-    * Get the class.
-    */
-    int GetClass()
-    { return region_class; }
-
-    /**
-    * Returns the mean value
-    *
-    * @param ind The mean of band 'ind'
-    */
-    double Mean(int ind);
-
-    /**
-    * Returns all the means
-    */
-    vector<double> GetMean();
-
-    /**
-    * Returns the covariance value at position (i, j)
-    */
-    double Covar(int i, int j);
-
-    /**
-    * Returns the covariance matrix
-    */
-    TeMatrix GetCovar()
-    { return covariance; }
-
-    /**
-    * Sets the area of the region
-    *
-    * @param a The new area
-    */
-    void SetArea(long a)
-    { npix = a; }
-
-    /**
-    * Returns the area of the region
-    */
-    long GetArea()
-    { return npix; }
-};
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIREGION_HPP
+  #define TEPDIREGION_HPP
+
+#include <vector>
+#include <iostream>
+#include <TeMatrix.h>
+#include <TePDIStatistic.hpp>
+#include "TePDIEspecData.hpp"
+#include <TeAgnostic.h>
+
+using namespace std;
+
+  /**
+   * @class TePDIRegion
+   * @brief This is the class for dealing with image regions.
+   * @author Thales Sehn Korting <tkorting at dpi.inpe.br>
+   *
+   */
+class PDI_DLL TePDIRegion
+{
+  private:
+    /**
+    * @brief identifier
+    */
+    long id;
+
+    /**
+    * @brief area
+    */
+    long npix;
+
+    /**
+    * @brief class of region
+    */
+    int region_class;
+
+    /**
+    * @brief number of bands
+    */
+    int nbands;
+
+    /**
+    * @brief mean of the pixel values
+    */
+    vector<double> mean;
+
+    /**
+    * @brief statistics of region
+    */
+    TeMatrix covariance;
+
+  public:
+    /**
+    * Default Constructor.
+    *
+    * @param id_region The ID of the region
+    */
+    TePDIRegion(long id_region)
+    { SetId(id_region); nbands = npix = region_class = 0; }
+
+    /**
+    * Default Destructor.
+    */
+    ~TePDIRegion();
+
+    /**
+    * Initializes Region
+    *
+    * @param n number of bands
+    * @param a the area
+    * @param m mean vector
+    * @param c covariance matrix
+    */
+    bool Init(int n, long a, vector<double> m, TeMatrix c);
+
+    /**
+    * Sets the region idtity.
+    *
+    * @param id_region The ID of the region
+    */
+    void SetId(long id_region)
+    { id = id_region; }
+
+    /**
+    * Gets the ID
+    */
+    long GetId()
+    { return id; }
+
+    /**
+    * Get the number of bands.
+    */
+    int GetNban()
+    { return nbands; }
+
+    /**
+    * Set the class.
+    *
+    * @param clas The class of the Region
+    */
+    void SetClass(int clas)
+    { region_class = clas; }
+
+    /**
+    * Get the class.
+    */
+    int GetClass()
+    { return region_class; }
+
+    /**
+    * Returns the mean value
+    *
+    * @param ind The mean of band 'ind'
+    */
+    double Mean(int ind);
+
+    /**
+    * Returns all the means
+    */
+    vector<double> GetMean();
+
+    /**
+    * Returns the covariance value at position (i, j)
+    */
+    double Covar(int i, int j);
+
+    /**
+    * Returns the covariance matrix
+    */
+    TeMatrix GetCovar()
+    { return covariance; }
+
+    /**
+    * Sets the area of the region
+    *
+    * @param a The new area
+    */
+    void SetArea(long a)
+    { npix = a; }
+
+    /**
+    * Returns the area of the region
+    */
+    long GetArea()
+    { return npix; }
+};
+
+#endif
diff --git a/src/terralib/image_processing/TePDIRegister.cpp b/src/terralib/image_processing/TePDIRegister.cpp
old mode 100755
new mode 100644
index f933b86..0db1ac1
--- a/src/terralib/image_processing/TePDIRegister.cpp
+++ b/src/terralib/image_processing/TePDIRegister.cpp
@@ -1,330 +1,349 @@
-#include "TePDIRegister.hpp"
-#include <TeAgnostic.h>
-#include <TePDITypes.hpp>
-#include <TePDIUtils.hpp>
-
-#include <TeGTFactory.h>
-#include <TeDefines.h>
-#include <TeUtils.h>
-
-#include <string>
-
-#include <math.h>
-#include <float.h>
-
-TePDIRegister::TePDIRegister()
-{
-}
-
-
-TePDIRegister::~TePDIRegister()
-{
-}
-
-
-void TePDIRegister::ResetState( const TePDIParameters& )
-{
-}
-
-
-bool TePDIRegister::CheckParameters( const TePDIParameters& parameters ) const
-{
-  /* Checking adjust_raster */
-    
-  TePDITypes::TePDIRasterPtrType adjust_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "adjust_raster", 
-    adjust_raster ),
-    "Missing parameter: adjust_raster" );
-  TEAGN_TRUE_OR_RETURN( adjust_raster.isActive(),
-    "Invalid parameter: adjust_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( adjust_raster->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: adjust_raster not ready" );
-    
-  /* adjust_channels parameter checking */
-
-  std::vector< int > adjust_channels;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "adjust_channels", adjust_channels ), 
-    "Missing parameter: adjust_channels" );
-  for( unsigned int adjust_channels_index = 0 ; 
-    adjust_channels_index < adjust_channels.size() ; 
-    ++adjust_channels_index ) {
-    
-    TEAGN_TRUE_OR_RETURN(
-      ( adjust_channels[ adjust_channels_index ] < adjust_raster->nBands() ),
-      "Invalid parameter: channels" );
-  }
-    
-  /* Checking output_raster */
-    
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
-    output_raster ),
-    "Missing parameter: output_raster" );
-  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
-    "Invalid parameter: output_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: output_raster not ready" );    
-    
-  /* Checking the geometric transformation */
-    
-  std::string gt_name;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "gt_name", 
-    gt_name ), "Missing parameter: gt_name" );
-    
-  TeGTFactory::TeFactoryMap::iterator gt_it = 
-    TeGTFactory::instance().find( gt_name );  
-  TEAGN_TRUE_OR_RETURN( ( gt_it != TeGTFactory::instance().end() ),
-     "Invalid parameter: gt_name" );    
-    
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = gt_name;          
-  TeSharedPtr< TeGeometricTransformation > geotransf_ptr( 
-    TeGTFactory::make( gt_params ) );
-  TEAGN_TRUE_OR_THROW( geotransf_ptr.isActive(),
-     "Geometric transformation factory product instatiation error" );
-     
-  /* Checking tie points */
-  
-  unsigned int adjust_raster_lines = 
-    (unsigned int)adjust_raster->params().nlines_;
-  unsigned int adjust_raster_cols = 
-    (unsigned int)adjust_raster->params().ncols_;
-
-  TePDITypes::TeCoordPairVectPtrType tie_points;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "tie_points", 
-    tie_points ), "Missing parameter: tie_points" );
-  TEAGN_TRUE_OR_RETURN( 
-    ( tie_points->size() >= geotransf_ptr->getMinRequiredTiePoints() ),
-    "Invalid parameter: insufficient tie_points for the required "
-    "transformation" );
-    
-  for( unsigned int tie_points_index = 0 ; 
-    tie_points_index < tie_points->size() ; ++ tie_points_index ) {
-    
-    TEAGN_TRUE_OR_RETURN( 
-      ( (*tie_points)[ tie_points_index ].pt1.x() >= ( -0.5 ) ) &&
-      ( (*tie_points)[ tie_points_index ].pt1.x() <= 
-        ( ( (double)( adjust_raster_cols ) ) - 0.5 ) ) &&
-      ( (*tie_points)[ tie_points_index ].pt1.y() >= ( -0.5 ) ) &&
-      ( (*tie_points)[ tie_points_index ].pt1.y() <= 
-        ( ( (double)( adjust_raster_lines  ) - 0.5 ) ) ),
-      "Invalid parameter: tie_points - pt1 coords out of range" );
-  }
-    
-  /* Checking the interpolator method */
-  
-  TePDIInterpolator::InterpMethod interpolator;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "interpolator", 
-    interpolator ), "Missing parameter: interpolator" );  
-  
-  TePDIInterpolator interp;
-  TEAGN_TRUE_OR_RETURN( interp.reset( adjust_raster, 
-    (TePDIInterpolator::InterpMethod)interpolator, 0 ), 
-    "Invalid parameter: interpolator" );
-    
-  /* Checking proj_params parameter */
-  
-  TePDITypes::TeProjParamsPtrType proj_params;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "proj_params", proj_params ),
-    "Missing paramter : proj_params" );
-    
-  TeSharedPtr< TeProjection > proj_ptr( TeProjectionFactory::make( 
-    *proj_params ) );
-  TEAGN_TRUE_OR_THROW( proj_ptr.isActive(), 
-    "Invalid parameter : proj_params" );
-    
-  /* Checking res_x and res_y */
-  
-  double res_x = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "res_x", res_x ),
-    "Missing parameter : res_x" );
-
-  double res_y = 0;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "res_y", res_y ),
-    "Missing parameter : res_y" );
-        
-  return true;
-}
-
-
-bool TePDIRegister::RunImplementation()
-{
-  /* Retriving parameters */
-  
-  TePDITypes::TeProjParamsPtrType proj_params;
-  params_.GetParameter( "proj_params", proj_params );
-  
-  double res_x = 0;
-  params_.GetParameter( "res_x", res_x );
-
-  double res_y = 0;
-  params_.GetParameter( "res_y", res_y );
-    
-  TePDITypes::TePDIRasterPtrType adjust_raster;
-  params_.GetParameter( "adjust_raster", adjust_raster );
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params_.GetParameter( "output_raster", output_raster );
-  
-  std::string gt_name;
-  params_.GetParameter( "gt_name", gt_name );
-  
-  TePDITypes::TeCoordPairVectPtrType tie_points;
-  params_.GetParameter( "tie_points", tie_points );
-  
-  double dummy_value = 0;
-  bool use_dummy = false;
-  if( params_.CheckParameter< double >( "dummy_value" ) ) {
-    
-    params_.GetParameter( "dummy_value", dummy_value );
-    use_dummy = true;
-  } else {
-    if( adjust_raster->params().useDummy_ ) {
-      dummy_value = adjust_raster->params().dummy_[ 0 ];
-      use_dummy = true;
-    }
-  }
-  
-  std::vector< int > adjust_channels;
-  params_.GetParameter( "adjust_channels", adjust_channels );
-  
-  /* Instantiating the interpolator */
-  
-  TePDIInterpolator::InterpMethod interpolator;
-  params_.GetParameter( "interpolator", interpolator );
-  
-  TePDIInterpolator interp;
-  TEAGN_TRUE_OR_RETURN( interp.reset( adjust_raster, 
-    (TePDIInterpolator::InterpMethod)interpolator, dummy_value ),
-    "Interpolator reset error" );
-    
-  /* Instantiating the geometric transformation mapping adjust raster indexes
-     to projected space coordinates */
-  
-  TeGTParams gt_params;
-  gt_params.transformation_name_ = gt_name;
-  gt_params.tiepoints_ = *tie_points;
-  TeSharedPtr< TeGeometricTransformation > geotransf_ptr( 
-    TeGTFactory::make( gt_params ) );
-  TEAGN_TRUE_OR_THROW( geotransf_ptr->reset( gt_params ),
-    "Unable to generate the geometric transformation" );
-    
-  /* Guessing the output raster geometry */
-  
-  TePolygon adjust_raster_detailed_box_wi;/* world indexes */
-  TePolygon adjust_raster_detailed_box_mi;/* matricial indexes */
-  TEAGN_TRUE_OR_RETURN( TePDIUtils::buildDetailedBox( adjust_raster, 
-    adjust_raster_detailed_box_wi ), 
-    "Unable to build detailed box from adjust raster" );
-  TePDIUtils::MapCoords2RasterIndexes( adjust_raster_detailed_box_wi, 
-    adjust_raster, adjust_raster_detailed_box_mi );
-    
-  TeCoord2D transformed_point;
-  double min_x = DBL_MAX;
-  double min_y = DBL_MAX;
-  double max_x = ( -1.0 ) * DBL_MAX;
-  double max_y = ( -1.0 ) * DBL_MAX;
-  
-  for( unsigned int ardb_index = 0 ; 
-    ardb_index < adjust_raster_detailed_box_mi[ 0 ].size() ;
-    ++ardb_index ) {
-            
-    geotransf_ptr->directMap( 
-      adjust_raster_detailed_box_mi[ 0 ][ ardb_index ],
-      transformed_point );
-      
-    if( transformed_point.x() < min_x ) {
-      min_x = transformed_point.x();
-    }
-    if( transformed_point.y() < min_y ) {
-      min_y = transformed_point.y();
-    }
-    if( transformed_point.x() > max_x ) {
-      max_x = transformed_point.x();
-    }
-    if( transformed_point.y() > max_y ) {
-      max_y = transformed_point.y();
-    }
-  }
-  
-  TeSharedPtr< TeProjection > proj_ptr( TeProjectionFactory::make( 
-    *proj_params ) );
-  TEAGN_TRUE_OR_THROW( proj_ptr.isActive(), 
-    "Projection factory instatiation error" );
-  
-  TeRasterParams output_raster_params = output_raster->params();
-  output_raster_params.nBands( adjust_channels.size() );
-  output_raster_params.projection( proj_ptr.nakedPointer() );
-  if( use_dummy )
-  {
-    output_raster_params.setDummy( dummy_value, -1 );
-  }
-  else
-  {
-    output_raster_params.useDummy_ = false;
-  }
-
-  TeCoord2D output_raster_box_ll( min_x, min_y );
-  TeCoord2D output_raster_box_ur( max_x, max_y );
-  
-  output_raster_params.boxResolution( output_raster_box_ll.x(), 
-    output_raster_box_ll.y(), output_raster_box_ur.x(), 
-    output_raster_box_ur.y(), res_x, res_y );
-    
-  TEAGN_TRUE_OR_RETURN( output_raster->init( output_raster_params ),
-    "output_raster init error" );
-    
-  /* Rendering output raster */
-  
-  TeGeometricTransformation& geotransf = *geotransf_ptr;
-  TeRaster& output_raster_ref = *output_raster;
-  unsigned int output_raster_lines = output_raster_ref.params().nlines_;
-  unsigned int output_raster_cols = output_raster_ref.params().ncols_;
-  unsigned int line = 0;
-  unsigned int col = 0;
-  TeCoord2D output_raster_pt_mi; /* matricial indexes */
-  TeCoord2D output_raster_pt_pi; /* projected indexes */
-  TeCoord2D adjust_raster_pt_mi;
-  double interpolated_value = 0;
-  
-  StartProgInt( "Rendering output", adjust_channels.size() * 
-    output_raster_lines );  
-  
-  for( unsigned int adjust_channels_index = 0 ; 
-    adjust_channels_index < adjust_channels.size() ; 
-    ++adjust_channels_index ) {
-    
-    unsigned int adjust_channel = 
-      (unsigned int)adjust_channels[ adjust_channels_index ];
-    
-    for( line = 0 ; line < output_raster_lines ; ++line ) {
-      for( col = 0 ; col < output_raster_cols ; ++col ) {
-        output_raster_pt_mi.setXY( (double)col, (double)line );
-        output_raster_pt_pi = output_raster_ref.index2Coord( 
-          output_raster_pt_mi );
-        
-        geotransf.inverseMap( output_raster_pt_pi, adjust_raster_pt_mi );
-      
-        interp.interpolate( adjust_raster_pt_mi.y(), adjust_raster_pt_mi.x(),
-          adjust_channel, interpolated_value );
-      
-        TEAGN_TRUE_OR_RETURN( 
-          output_raster_ref.setElement( 
-          col, line, interpolated_value, adjust_channels_index ), 
-          "output_raster write error at line=" +
-          Te2String( line ) + " col=" + Te2String( col ) + " channel=" +
-          Te2String( adjust_channels_index ) );
-      }
-      
-      TEAGN_FALSE_OR_RETURN( IncProgInt(), "Canceled by the user" );
-    }
-  }
-  
-  StopProgInt();
-  
-  return true;
-}
-
+#include "TePDIRegister.hpp"
+#include <TeAgnostic.h>
+#include <TePDITypes.hpp>
+#include <TePDIUtils.hpp>
+
+#include <TeGTFactory.h>
+#include <TeDefines.h>
+#include <TeUtils.h>
+
+#include <string>
+
+#include <math.h>
+#include <float.h>
+
+TePDIRegister::TePDIRegister()
+{
+}
+
+
+TePDIRegister::~TePDIRegister()
+{
+}
+
+
+void TePDIRegister::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDIRegister::CheckParameters( const TePDIParameters& parameters ) const
+{
+  /* Checking adjust_raster */
+    
+  TePDITypes::TePDIRasterPtrType adjust_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "adjust_raster", 
+    adjust_raster ),
+    "Missing parameter: adjust_raster" );
+  TEAGN_TRUE_OR_RETURN( adjust_raster.isActive(),
+    "Invalid parameter: adjust_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( adjust_raster->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: adjust_raster not ready" );
+    
+  /* adjust_channels parameter checking */
+
+  std::vector< int > adjust_channels;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "adjust_channels", adjust_channels ), 
+    "Missing parameter: adjust_channels" );
+  for( unsigned int adjust_channels_index = 0 ; 
+    adjust_channels_index < adjust_channels.size() ; 
+    ++adjust_channels_index ) {
+    
+    TEAGN_TRUE_OR_RETURN(
+      ( adjust_channels[ adjust_channels_index ] < adjust_raster->nBands() ),
+      "Invalid parameter: channels" );
+  }
+    
+  /* Checking output_raster */
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
+    output_raster ),
+    "Missing parameter: output_raster" );
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
+    "Invalid parameter: output_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: output_raster not ready" );    
+    
+  /* Checking the geometric transformation */
+
+  
+  if( ! parameters.CheckParameter< TeGTParams >( "transf_params" ) )
+  {
+    std::string gt_name;
+    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "gt_name", 
+      gt_name ), "Missing parameter: gt_name" );
+      
+    TeGTFactory::TeFactoryMap::iterator gt_it = 
+      TeGTFactory::instance().find( gt_name );  
+    TEAGN_TRUE_OR_RETURN( ( gt_it != TeGTFactory::instance().end() ),
+       "Invalid parameter: gt_name" );    
+
+    TeGTParams gt_params;
+    gt_params.transformation_name_ = gt_name;          
+    TeSharedPtr< TeGeometricTransformation > geotransf_ptr( 
+      TeGTFactory::make( gt_params ) );
+    TEAGN_TRUE_OR_THROW( geotransf_ptr.isActive(),
+       "Geometric transformation factory product instatiation error" );
+    
+    /* Checking tie points */
+    
+    unsigned int adjust_raster_lines = 
+      (unsigned int)adjust_raster->params().nlines_;
+    unsigned int adjust_raster_cols = 
+      (unsigned int)adjust_raster->params().ncols_;
+  
+    TePDITypes::TeCoordPairVectPtrType tie_points;
+    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "tie_points", 
+      tie_points ), "Missing parameter: tie_points" );
+    TEAGN_TRUE_OR_RETURN( 
+      ( tie_points->size() >= geotransf_ptr->getMinRequiredTiePoints() ),
+      "Invalid parameter: insufficient tie_points for the required "
+      "transformation" );
+      
+    for( unsigned int tie_points_index = 0 ; 
+      tie_points_index < tie_points->size() ; ++ tie_points_index ) {
+      
+      TEAGN_TRUE_OR_RETURN( 
+        ( (*tie_points)[ tie_points_index ].pt1.x() >= ( -0.5 ) ) &&
+        ( (*tie_points)[ tie_points_index ].pt1.x() <= 
+          ( ( (double)( adjust_raster_cols ) ) - 0.5 ) ) &&
+        ( (*tie_points)[ tie_points_index ].pt1.y() >= ( -0.5 ) ) &&
+        ( (*tie_points)[ tie_points_index ].pt1.y() <= 
+          ( ( (double)( adjust_raster_lines  ) - 0.5 ) ) ),
+        "Invalid parameter: tie_points - pt1 coords out of range" );
+    }
+  }
+    
+  /* Checking the interpolator method */
+  
+  TePDIInterpolator::InterpMethod interpolator;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "interpolator", 
+    interpolator ), "Missing parameter: interpolator" );  
+  
+  TePDIInterpolator interp;
+  TEAGN_TRUE_OR_RETURN( interp.reset( adjust_raster, 
+    (TePDIInterpolator::InterpMethod)interpolator, 0 ), 
+    "Invalid parameter: interpolator" );
+    
+  /* Checking proj_params parameter */
+  
+  TePDITypes::TeProjParamsPtrType proj_params;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "proj_params", proj_params ),
+    "Missing paramter : proj_params" );
+    
+  TeSharedPtr< TeProjection > proj_ptr( TeProjectionFactory::make( 
+    *proj_params ) );
+  TEAGN_TRUE_OR_THROW( proj_ptr.isActive(), 
+    "Invalid parameter : proj_params" );
+    
+  /* Checking res_x and res_y */
+  
+  double res_x = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "res_x", res_x ),
+    "Missing parameter : res_x" );
+
+  double res_y = 0;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "res_y", res_y ),
+    "Missing parameter : res_y" );
+        
+  return true;
+}
+
+
+bool TePDIRegister::RunImplementation()
+{
+  /* Retriving parameters */
+  
+  TePDITypes::TeProjParamsPtrType proj_params;
+  params_.GetParameter( "proj_params", proj_params );
+  
+  double res_x = 0;
+  params_.GetParameter( "res_x", res_x );
+
+  double res_y = 0;
+  params_.GetParameter( "res_y", res_y );
+    
+  TePDITypes::TePDIRasterPtrType adjust_raster;
+  params_.GetParameter( "adjust_raster", adjust_raster );
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter( "output_raster", output_raster );
+  
+  TeGTParams transf_params;
+  if( params_.CheckParameter< TeGTParams >( "transf_params" ) ) 
+  {
+    params_.GetParameter( "transf_params", transf_params );
+  }
+  else
+  {
+    params_.GetParameter( "gt_name", transf_params.transformation_name_ );
+    
+    TePDITypes::TeCoordPairVectPtrType tie_points;
+    params_.GetParameter( "tie_points", tie_points );
+    transf_params.tiepoints_ = *tie_points;
+  }
+  
+  double dummy_value = 0;
+  bool use_dummy = false;
+  if( params_.CheckParameter< double >( "dummy_value" ) ) {
+    
+    params_.GetParameter( "dummy_value", dummy_value );
+    use_dummy = true;
+  } else {
+    if( adjust_raster->params().useDummy_ ) {
+      dummy_value = adjust_raster->params().dummy_[ 0 ];
+      use_dummy = true;
+    }
+  }
+  
+  std::vector< int > adjust_channels;
+  params_.GetParameter( "adjust_channels", adjust_channels );
+  
+  /* Instantiating the interpolator */
+  
+  TePDIInterpolator::InterpMethod interpolator;
+  params_.GetParameter( "interpolator", interpolator );
+  
+  TePDIInterpolator interp;
+  TEAGN_TRUE_OR_RETURN( interp.reset( adjust_raster, 
+    (TePDIInterpolator::InterpMethod)interpolator, dummy_value ),
+    "Interpolator reset error" );
+    
+  /* Instantiating the geometric transformation mapping adjust raster indexes
+     to projected space coordinates */
+     
+  TeSharedPtr< TeGeometricTransformation > geotransf_ptr(
+    TeGTFactory::make( transf_params ) );
+  TEAGN_TRUE_OR_RETURN( geotransf_ptr.isActive(),
+    "Unable to generate the geometric transformation" );    
+  TEAGN_TRUE_OR_RETURN( geotransf_ptr->reset( transf_params ),
+    "Unable to generate the geometric transformation" );      
+    
+  /* Guessing the output raster geometry */
+  
+  TePolygon adjust_raster_detailed_box_wi;/* world indexes */
+  TePolygon adjust_raster_detailed_box_mi;/* matricial indexes */
+  TEAGN_TRUE_OR_RETURN( TePDIUtils::buildDetailedBox( adjust_raster, 
+    adjust_raster_detailed_box_wi ), 
+    "Unable to build detailed box from adjust raster" );
+  TePDIUtils::MapCoords2RasterIndexes( adjust_raster_detailed_box_wi, 
+    adjust_raster, adjust_raster_detailed_box_mi );
+    
+  TeCoord2D transformed_point;
+  double min_x = DBL_MAX;
+  double min_y = DBL_MAX;
+  double max_x = ( -1.0 ) * DBL_MAX;
+  double max_y = ( -1.0 ) * DBL_MAX;
+  
+  for( unsigned int ardb_index = 0 ; 
+    ardb_index < adjust_raster_detailed_box_mi[ 0 ].size() ;
+    ++ardb_index ) {
+            
+    geotransf_ptr->directMap( 
+      adjust_raster_detailed_box_mi[ 0 ][ ardb_index ],
+      transformed_point );
+      
+    if( transformed_point.x() < min_x ) {
+      min_x = transformed_point.x();
+    }
+    if( transformed_point.y() < min_y ) {
+      min_y = transformed_point.y();
+    }
+    if( transformed_point.x() > max_x ) {
+      max_x = transformed_point.x();
+    }
+    if( transformed_point.y() > max_y ) {
+      max_y = transformed_point.y();
+    }
+  }
+  
+  TeSharedPtr< TeProjection > proj_ptr( TeProjectionFactory::make( 
+    *proj_params ) );
+  TEAGN_TRUE_OR_THROW( proj_ptr.isActive(), 
+    "Projection factory instatiation error" );
+  
+  TeRasterParams output_raster_params = output_raster->params();
+  output_raster_params.nBands( adjust_channels.size() );
+  output_raster_params.projection( proj_ptr.nakedPointer() );
+  if( use_dummy )
+  {
+    output_raster_params.setDummy( dummy_value, -1 );
+  }
+  else
+  {
+    output_raster_params.useDummy_ = false;
+  }
+
+  TeCoord2D output_raster_box_ll( min_x, min_y );
+  TeCoord2D output_raster_box_ur( max_x, max_y );
+  
+  output_raster_params.boxResolution( output_raster_box_ll.x(), 
+    output_raster_box_ll.y(), output_raster_box_ur.x(), 
+    output_raster_box_ur.y(), res_x, res_y );
+    
+  TEAGN_TRUE_OR_RETURN( output_raster->init( output_raster_params ),
+    "output_raster init error" );
+    
+  /* Rendering output raster */
+  
+  TeGeometricTransformation& geotransf = *geotransf_ptr;
+  TeRaster& output_raster_ref = *output_raster;
+  unsigned int output_raster_lines = output_raster_ref.params().nlines_;
+  unsigned int output_raster_cols = output_raster_ref.params().ncols_;
+  unsigned int line = 0;
+  unsigned int col = 0;
+  TeCoord2D output_raster_pt_mi; /* matricial indexes */
+  TeCoord2D output_raster_pt_pi; /* projected indexes */
+  TeCoord2D adjust_raster_pt_mi;
+  double interpolated_value = 0;
+  double outMax = 0;
+  double outMin = 0;   
+  
+  StartProgInt( "Rendering output", adjust_channels.size() * 
+    output_raster_lines );  
+  
+  for( unsigned int adjust_channels_index = 0 ; 
+    adjust_channels_index < adjust_channels.size() ; 
+    ++adjust_channels_index ) {
+    
+    unsigned int adjust_channel = 
+      (unsigned int)adjust_channels[ adjust_channels_index ];
+      
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds( output_raster,
+      adjust_channels_index, outMin, outMax ), "Internal error" );      
+    
+    for( line = 0 ; line < output_raster_lines ; ++line ) {
+      for( col = 0 ; col < output_raster_cols ; ++col ) {
+        output_raster_pt_mi.setXY( (double)col, (double)line );
+        output_raster_pt_pi = output_raster_ref.index2Coord( 
+          output_raster_pt_mi );
+        
+        geotransf.inverseMap( output_raster_pt_pi, adjust_raster_pt_mi );
+      
+        interp.interpolate( adjust_raster_pt_mi.y(), adjust_raster_pt_mi.x(),
+          adjust_channel, interpolated_value );
+          
+        interpolated_value = MIN( interpolated_value, outMax );
+        interpolated_value = MAX( interpolated_value, outMin );              
+      
+        TEAGN_TRUE_OR_RETURN( 
+          output_raster_ref.setElement( 
+          col, line, interpolated_value, adjust_channels_index ), 
+          "output_raster write error at line=" +
+          Te2String( line ) + " col=" + Te2String( col ) + " channel=" +
+          Te2String( adjust_channels_index ) );
+      }
+      
+      TEAGN_FALSE_OR_RETURN( IncProgInt(), "Canceled by the user" );
+    }
+  }
+  
+  StopProgInt();
+  
+  return true;
+}
+
diff --git a/src/terralib/image_processing/TePDIRegister.hpp b/src/terralib/image_processing/TePDIRegister.hpp
old mode 100755
new mode 100644
index 38188bb..7dfcbdd
--- a/src/terralib/image_processing/TePDIRegister.hpp
+++ b/src/terralib/image_processing/TePDIRegister.hpp
@@ -1,111 +1,119 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIREGISTER_HPP
-  #define TEPDIREGISTER_HPP
-
-  #include <TePDIAlgorithm.hpp>
-  #include <TePDIParameters.hpp>
-  #include <TeSharedPtr.h>
-  #include <TePDIInterpolator.hpp>
-
-  /**
-   * @brief This is the class for digital image registering.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIGeneralAlgoGroup
-   *
-   * @note The general required parameters:
-   *
-   * @param proj_params ( TePDITypes::TeProjParamsPtrType ) - The 
-   * output projection parameters.
-   * @param res_x ( double ) - X Axis output resolution.
-   * @param res_y ( double ) - Y Axis output resolution.
-   * @param adjust_raster ( TePDITypes::TePDIRasterPtrType ) - The 
-   * input raster that needs to be registered.
-   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - The 
-   * output raster.
-   * @param tie_points ( TePDITypes::TeCoordPairVectPtrType ) -
-   * The input tie-points where TeCoordPair.pt1 are adjust_rater matricial
-   * indexes (They must be inside the respective raster to be valid) and
-   * TeCoordPair.pt2 are the respective projected coordinates.
-   * @param gt_name ( std::string ) - Geometric transformation name ( see
-   * TeGTFactory documentation for reference ).
-   * @param interpolator ( TePDIInterpolator::InterpMethod ) - Interpolator
-   * method to use when rendering output_raster ( For rasters with
-   * internal palletes only TePDIInterpolator::NNMethod can be used ).
-   * @param adjust_channels (std::vector<int>) - Band(s) to process from
-   * adjust_raster.
-   *
-   * @note The optional parameters are:
-   *
-   * @param dummy_value (double) - A dummy pixel value for use 
-   * in pixels where no data is available.  
-   */
-  class PDI_DLL TePDIRegister : public TePDIAlgorithm {
-    public :
-      
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIRegister();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRegister();
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;      
-
-    protected :
-    
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );    
-     
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();      
-  };
-  
-/** @example TePDIRegister_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIREGISTER_HPP
+  #define TEPDIREGISTER_HPP
+
+  #include <TePDIAlgorithm.hpp>
+  #include <TePDIParameters.hpp>
+  #include <TeSharedPtr.h>
+  #include <TePDIInterpolator.hpp>
+
+  /**
+   * @brief This is the class for digital image registering.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIGeneralAlgoGroup
+   *
+   * @note The general required parameters:
+   *
+   * @param proj_params ( TePDITypes::TeProjParamsPtrType ) - The 
+   * output projection parameters.
+   * @param res_x ( double ) - X Axis output resolution.
+   * @param res_y ( double ) - Y Axis output resolution.
+   * @param adjust_raster ( TePDITypes::TePDIRasterPtrType ) - The 
+   * input raster that needs to be registered.
+   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - The 
+   * output raster.
+   * @param interpolator ( TePDIInterpolator::InterpMethod ) - Interpolator
+   * method to use when rendering output_raster ( For rasters with
+   * internal palletes only TePDIInterpolator::NNMethod can be used ).
+   * @param adjust_channels (std::vector<int>) - Band(s) to process from
+   * adjust_raster.
+   *
+   * @note The optional parameters are:
+   *
+   * @param dummy_value (double) - A dummy pixel value for use 
+   * in pixels where no data is available.  
+   *
+   * @param tie_points ( TePDITypes::TeCoordPairVectPtrType ) -
+   * The input tie-points where TeCoordPair.pt1 are adjust_rater matricial
+   * indexes (They must be inside the respective raster to be valid) and
+   * TeCoordPair.pt2 are the respective projected coordinates (this
+   * parameter is not necessary if the parameter "transf_params" is given).
+   *
+   * @param gt_name ( std::string ) - Geometric transformation name ( see
+   * TeGTFactory documentation for reference; this
+   * parameter is not necessary if the parameter "transf_params" is given ).
+   *
+   * @param transf_params ( TeGTParams ) - The geometric transformation 
+   * parameters (if this parameter is given, the "tie_points" and
+   * "gt_name" parameters will be ignored).
+   */
+  class PDI_DLL TePDIRegister : public TePDIAlgorithm {
+    public :
+      
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIRegister();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRegister();
+      
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;      
+
+    protected :
+    
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );    
+     
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();      
+  };
+  
+/** @example TePDIRegister_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif
diff --git a/src/terralib/image_processing/TePDIRegisterFactory.cpp b/src/terralib/image_processing/TePDIRegisterFactory.cpp
old mode 100755
new mode 100644
index a83ffc0..7601230
--- a/src/terralib/image_processing/TePDIRegisterFactory.cpp
+++ b/src/terralib/image_processing/TePDIRegisterFactory.cpp
@@ -1,26 +1,26 @@
- 
-#include "TePDIRegisterFactory.hpp"
-#include "TePDIRegister.hpp"
-#include <TeAgnostic.h>
-
-
-TePDIRegisterFactory::TePDIRegisterFactory()
-: TePDIAlgorithmFactory( std::string( "TePDIRegister" ) )
-{
-};      
-
-
-TePDIRegisterFactory::~TePDIRegisterFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDIRegisterFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDIRegister();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+ 
+#include "TePDIRegisterFactory.hpp"
+#include "TePDIRegister.hpp"
+#include <TeAgnostic.h>
+
+
+TePDIRegisterFactory::TePDIRegisterFactory()
+: TePDIAlgorithmFactory( std::string( "TePDIRegister" ) )
+{
+};      
+
+
+TePDIRegisterFactory::~TePDIRegisterFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDIRegisterFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDIRegister();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDIRegisterFactory.hpp b/src/terralib/image_processing/TePDIRegisterFactory.hpp
old mode 100755
new mode 100644
index 151acba..18d901e
--- a/src/terralib/image_processing/TePDIRegisterFactory.hpp
+++ b/src/terralib/image_processing/TePDIRegisterFactory.hpp
@@ -1,68 +1,68 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIREGISTERFACTORY_HPP
-  #define TEPDIREGISTERFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for image registering algorithms factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDIRegisterFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIRegisterFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRegisterFactory();
-      
-    protected :  
-      
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDIRegisterFactory TePDIRegisterFactory_instance;
-  };  
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIREGISTERFACTORY_HPP
+  #define TEPDIREGISTERFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for image registering algorithms factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDIRegisterFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TePDIRegisterFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRegisterFactory();
+      
+    protected :  
+      
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace {
+    static TePDIRegisterFactory TePDIRegisterFactory_instance;
+  };  
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIRgbPalette.cpp b/src/terralib/image_processing/TePDIRgbPalette.cpp
old mode 100755
new mode 100644
index 937cfd7..10b6765
--- a/src/terralib/image_processing/TePDIRgbPalette.cpp
+++ b/src/terralib/image_processing/TePDIRgbPalette.cpp
@@ -1,12 +1,12 @@
-#include "TePDIRgbPalette.hpp"
-
-
-TePDIRgbPalette::TePDIRgbPalette()
-{
-}
-
-
-TePDIRgbPalette::~TePDIRgbPalette()
-{
-}
-
+#include "TePDIRgbPalette.hpp"
+
+
+TePDIRgbPalette::TePDIRgbPalette()
+{
+}
+
+
+TePDIRgbPalette::~TePDIRgbPalette()
+{
+}
+
diff --git a/src/terralib/image_processing/TePDIRgbPalette.hpp b/src/terralib/image_processing/TePDIRgbPalette.hpp
old mode 100755
new mode 100644
index f696d66..38d65eb
--- a/src/terralib/image_processing/TePDIRgbPalette.hpp
+++ b/src/terralib/image_processing/TePDIRgbPalette.hpp
@@ -1,66 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRGBPALETTE_HPP
-  #define TEPDIRGBPALETTE_HPP
-
-  #include "TePDIRgbPaletteNode.hpp"
-  
-  #include <TeSharedPtr.h>
-
-  #include <map>
-
-  /**
-   * @brief This is the class for RGB Palettes.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAux
-   */  
-  class PDI_DLL TePDIRgbPalette : public std::map< double, TePDIRgbPaletteNode >
-  {
-    public :
-      /** @typedef TeSharedPtr< TePDIRgbPalette > pointer 
-          Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIRgbPalette > pointer;
-      
-      /** @typedef const TeSharedPtr< TePDIRgbPalette > const_pointer 
-        Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIRgbPalette > const_pointer;
-
-      /**
-       * @brief Default Constructor
-       *
-       */
-      TePDIRgbPalette();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRgbPalette();
-  };
-  
-/** @example TePDIRgbPalette_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDIRGBPALETTE_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRGBPALETTE_HPP
+  #define TEPDIRGBPALETTE_HPP
+
+  #include "TePDIRgbPaletteNode.hpp"
+  
+  #include <TeSharedPtr.h>
+
+  #include <map>
+
+  /**
+   * @class TePDIRgbPalette
+   * @brief This is the class for RGB Palettes.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAux
+   */  
+  class PDI_DLL TePDIRgbPalette : public std::map< double, TePDIRgbPaletteNode >
+  {
+    public :
+      /** @typedef TeSharedPtr< TePDIRgbPalette > pointer 
+          Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIRgbPalette > pointer;
+      
+      /** @typedef const TeSharedPtr< TePDIRgbPalette > const_pointer 
+        Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIRgbPalette > const_pointer;
+
+      /**
+       * @brief Default Constructor
+       *
+       */
+      TePDIRgbPalette();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRgbPalette();
+  };
+  
+/** @example TePDIRgbPalette_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDIRGBPALETTE_HPP
diff --git a/src/terralib/image_processing/TePDIRgbPaletteFunctions.cpp b/src/terralib/image_processing/TePDIRgbPaletteFunctions.cpp
old mode 100755
new mode 100644
index 6d6b6cc..382edd5
--- a/src/terralib/image_processing/TePDIRgbPaletteFunctions.cpp
+++ b/src/terralib/image_processing/TePDIRgbPaletteFunctions.cpp
@@ -1,57 +1,57 @@
-#include "TePDIRgbPaletteFunctions.hpp"
-
-#include <TeAgnostic.h>
-
-#include <TeUtils.h>
-
-#include <math.h>
-
-namespace TePDIRgbPaletteFunctions
-{
-
-  TePDIRgbPalette::pointer createLSBPalette( unsigned int levels )
-  {
-    TEAGN_TRUE_OR_THROW( levels > 0, "Invalid supplied Levels" );
-  
-    unsigned int channel_levels =
-      (unsigned int) ceil( TeCubicRoot( (double)levels ) );
-  
-    unsigned int channel_step =
-      (unsigned int) floor( 256. / (float)(channel_levels + 1) );
-  
-    TePDIRgbPalette::pointer outPal( new TePDIRgbPalette );
-  
-    unsigned int level = 0;
-    
-    TePDIRgbPaletteNode temp_node;
-  
-    while( level < levels ) {
-      if( temp_node.red_ > 255 ) {
-        temp_node.red_ = temp_node.red_ % 255;
-  
-        temp_node.green_ += channel_step;
-  
-        if( temp_node.green_ > 255 ) {
-          temp_node.green_ = temp_node.green_ % 255;
-  
-          temp_node.blue_ += channel_step;
-  
-          if( temp_node.blue_ > 255 ) {
-            temp_node.blue_ = temp_node.blue_ % 255;
-          }
-        }
-      }
-      
-      (*outPal)[ level ] = temp_node;
-  
-      temp_node.red_ += channel_step;
-  
-      ++level;
-    }
-  
-    return outPal;
-  }
-  
-};
-
-
+#include "TePDIRgbPaletteFunctions.hpp"
+
+#include <TeAgnostic.h>
+
+#include <TeUtils.h>
+
+#include <math.h>
+
+namespace TePDIRgbPaletteFunctions
+{
+
+  TePDIRgbPalette::pointer createLSBPalette( unsigned int levels )
+  {
+    TEAGN_TRUE_OR_THROW( levels > 0, "Invalid supplied Levels" );
+  
+    unsigned int channel_levels =
+      (unsigned int) ceil( TeCubicRoot( (double)levels ) );
+  
+    unsigned int channel_step =
+      (unsigned int) floor( 256. / (float)(channel_levels + 1) );
+  
+    TePDIRgbPalette::pointer outPal( new TePDIRgbPalette );
+  
+    unsigned int level = 0;
+    
+    TePDIRgbPaletteNode temp_node;
+  
+    while( level < levels ) {
+      if( temp_node.red_ > 255 ) {
+        temp_node.red_ = temp_node.red_ % 255;
+  
+        temp_node.green_ += channel_step;
+  
+        if( temp_node.green_ > 255 ) {
+          temp_node.green_ = temp_node.green_ % 255;
+  
+          temp_node.blue_ += channel_step;
+  
+          if( temp_node.blue_ > 255 ) {
+            temp_node.blue_ = temp_node.blue_ % 255;
+          }
+        }
+      }
+      
+      (*outPal)[ level ] = temp_node;
+  
+      temp_node.red_ += channel_step;
+  
+      ++level;
+    }
+  
+    return outPal;
+  }
+  
+};
+
+
diff --git a/src/terralib/image_processing/TePDIRgbPaletteFunctions.hpp b/src/terralib/image_processing/TePDIRgbPaletteFunctions.hpp
old mode 100755
new mode 100644
index 99ab311..7ebe3bd
--- a/src/terralib/image_processing/TePDIRgbPaletteFunctions.hpp
+++ b/src/terralib/image_processing/TePDIRgbPaletteFunctions.hpp
@@ -1,45 +1,45 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRGBPALETTEFUNCTIONS_HPP
-  #define TEPDIRGBPALETTEFUNCTIONS_HPP
-
-  #include <TePDIRgbPalette.hpp>
-  
-  /**
-   * @brief This namespace contains TePDIRgbPalette related methods.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   */  
-  namespace TePDIRgbPaletteFunctions
-  {
-    /**
-     * @brief Creates a level step based Palette creation.
-     *
-     * @param levels The number of levels.
-     * @return The generated palette.
-    */
-    PDI_DLL TePDIRgbPalette::pointer createLSBPalette( unsigned int levels );
-  };
-
-#endif //TEPDIRGBPALETTE_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRGBPALETTEFUNCTIONS_HPP
+  #define TEPDIRGBPALETTEFUNCTIONS_HPP
+
+  #include <TePDIRgbPalette.hpp>
+  
+  /**
+   * @brief This namespace contains TePDIRgbPalette related methods.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   */  
+  namespace TePDIRgbPaletteFunctions
+  {
+    /**
+     * @brief Creates a level step based Palette creation.
+     *
+     * @param levels The number of levels.
+     * @return The generated palette.
+    */
+    PDI_DLL TePDIRgbPalette::pointer createLSBPalette( unsigned int levels );
+  };
+
+#endif //TEPDIRGBPALETTE_HPP
diff --git a/src/terralib/image_processing/TePDIRgbPaletteNode.hpp b/src/terralib/image_processing/TePDIRgbPaletteNode.hpp
old mode 100755
new mode 100644
index 9ef5f90..6ffa38f
--- a/src/terralib/image_processing/TePDIRgbPaletteNode.hpp
+++ b/src/terralib/image_processing/TePDIRgbPaletteNode.hpp
@@ -1,94 +1,95 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIRGBPALETTENODE_HPP
-  #define TEPDIRGBPALETTENODE_HPP
-
-  #include "TePDIDefines.hpp"
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for RGB Palette Node.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIAux
-   */  
-  class PDI_DLL TePDIRgbPaletteNode {
-    public :
-      /** @typedef TeSharedPtr< TePDIRgbPaletteNode > pointer 
-        Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIRgbPaletteNode > pointer;
-      
-      /** @typedef const TeSharedPtr< TePDIRgbPaletteNode > const_pointer 
-        Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIRgbPaletteNode > const_pointer;
-      
-      /**
-       * @brief Red channel value.
-       *
-       */
-      unsigned int red_;
-
-      /**
-       * @brief Green channel value.
-       *
-       */
-      unsigned int green_;
-
-      /**
-       * @brief Blue channel value.
-       *
-       */
-      unsigned int blue_;
-            
-      
-      /**
-       * @brief Default Constructor
-       *
-       */
-      TePDIRgbPaletteNode()
-      {
-        red_ = green_ = blue_ = 0;
-      };
-
-      /**
-       * @brief Alternative Constructor
-       *
-       */
-      TePDIRgbPaletteNode( unsigned int red, unsigned int green,
-        unsigned int blue )
-      {
-        red_ = red;
-        green_ = green;
-        blue_ = blue;
-      };
-            
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIRgbPaletteNode()
-      {};
-
-  };
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIRGBPALETTENODE_HPP
+  #define TEPDIRGBPALETTENODE_HPP
+
+  #include "TePDIDefines.hpp"
+  #include <TeSharedPtr.h>
+
+  /**
+   * @class TePDIRgbPaletteNode
+   * @brief This is the class for RGB Palette Node.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIAux
+   */  
+  class PDI_DLL TePDIRgbPaletteNode {
+    public :
+      /** @typedef TeSharedPtr< TePDIRgbPaletteNode > pointer 
+        Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIRgbPaletteNode > pointer;
+      
+      /** @typedef const TeSharedPtr< TePDIRgbPaletteNode > const_pointer 
+        Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIRgbPaletteNode > const_pointer;
+      
+      /**
+       * @brief Red channel value.
+       *
+       */
+      unsigned int red_;
+
+      /**
+       * @brief Green channel value.
+       *
+       */
+      unsigned int green_;
+
+      /**
+       * @brief Blue channel value.
+       *
+       */
+      unsigned int blue_;
+            
+      
+      /**
+       * @brief Default Constructor
+       *
+       */
+      TePDIRgbPaletteNode()
+      {
+        red_ = green_ = blue_ = 0;
+      };
+
+      /**
+       * @brief Alternative Constructor
+       *
+       */
+      TePDIRgbPaletteNode( unsigned int red, unsigned int green,
+        unsigned int blue )
+      {
+        red_ = red;
+        green_ = green;
+        blue_ = blue;
+      };
+            
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIRgbPaletteNode()
+      {};
+
+  };
+  
+#endif
diff --git a/src/terralib/image_processing/TePDISAMClassifier.cpp b/src/terralib/image_processing/TePDISAMClassifier.cpp
new file mode 100644
index 0000000..1f771ec
--- /dev/null
+++ b/src/terralib/image_processing/TePDISAMClassifier.cpp
@@ -0,0 +1,392 @@
+#include "TePDISAMClassifier.hpp"
+
+#include "TePDIPIManager.hpp"
+
+#include <TeUtils.h>
+#include <TeAgnostic.h>
+
+#include <math.h>
+
+TePDISAMClassifier::ClassSpectralSamples::ClassSpectralSamples()
+: classId_( 0 ), maxAngularDist_( 0.1 )
+{
+  samplesMatrix_.Reset( TePDIMatrix< double >::RAMMemPol );
+}
+
+TePDISAMClassifier::ClassSpectralSamples::~ClassSpectralSamples()
+{
+}
+
+TePDISAMClassifier::SegThread::SegThread( bool progEnabled, TeRaster& inRaster, 
+  const std::vector< unsigned int >& inRasterBands,
+  const std::vector< ClassReferenceData >& refDataVector,
+  TeMutex& inMutex, TeMutex& outMutex, std::vector< bool >& linesProcStatusVec,
+  bool& abortFlag, TeRaster& outRaster )
+  : progEnabled_( progEnabled ), returnValue_( false ), inRaster_( inRaster ),
+  inRasterBands_( inRasterBands ), refDataVector_( refDataVector ),
+  inMutex_( inMutex ), outMutex_( outMutex ), 
+  linesProcStatusVec_( linesProcStatusVec ), abortFlag_( abortFlag ),
+  outRaster_( outRaster )
+{
+}
+
+TePDISAMClassifier::ClassReferenceData::ClassReferenceData()
+: classId_( 0 ), maxAngularDist_( 0.1 )
+{
+}
+
+TePDISAMClassifier::ClassReferenceData::~ClassReferenceData()
+{
+}
+
+TePDISAMClassifier::SegThread::~SegThread()
+{
+}
+
+void TePDISAMClassifier::SegThread::run()
+{
+  returnValue_ = false;
+  
+  const long int rasterLines = (long int)inRaster_.params().nlines_;
+  const unsigned int rasterCols = (unsigned int)inRaster_.params().ncols_;
+  const unsigned int inRasterBandsSize = (unsigned int)inRasterBands_.size();
+  
+  TePDIPIManager progress( "Classifying", rasterLines , progEnabled_ );
+  
+  // The memory buffer for one readed raster data
+  
+  TePDIMatrix< double > lineDataMtx; // One band per line
+  if( ! lineDataMtx.Reset( inRasterBandsSize, rasterCols, 
+    TePDIMatrix< double >::RAMMemPol ) )
+  {
+    TEAGN_LOGERR( "Matrix creation error" );
+    abortFlag_ = true;
+    return;
+  }
+  
+  // The memory buffer for the generated classified pixels for one raster line
+  
+  std::vector< unsigned int > classifyingResultVector;
+  classifyingResultVector.resize( rasterCols, 0 );
+  
+  // classifying the entire raster....
+  
+  long int rasterLine = 0;
+  unsigned int rasterCol = 0;
+  unsigned int inRasterBandsIdx = 0;
+  unsigned int inRasterBand = 0;
+  unsigned int lDMLine = 0;
+  unsigned int lDMCol = 0;
+  const unsigned int refDataVectorSize = (unsigned int)refDataVector_.size();
+  unsigned int refDataVectorIdx = 0;
+  double angularTR = 0;
+  double angularTT = 0;
+  double angularRR = 0;
+  double angularDist = 0;
+  double minAngularDist = DBL_MAX;
+  unsigned int minAngularDistClassID = 0;
+  double meanValue = 0;
+  double dataValue = 0;
+  
+  for( rasterLine = 0 ; rasterLine < rasterLines ; ++rasterLine )
+  {
+    if( progress.Increment() || abortFlag_ )
+    { 
+      TEAGN_LOGMSG( "Canceled by the user" );
+      abortFlag_ = true;
+      return;
+    }
+    else
+    {
+      inMutex_.lock();
+      
+      if( linesProcStatusVec_[ rasterLine ] == 0 )
+      {
+        linesProcStatusVec_[ rasterLine ] = 1;
+        
+        // load line data into lineData matrix (all used bands)
+        
+        for( inRasterBandsIdx = 0 ; inRasterBandsIdx < inRasterBandsSize ;
+          ++inRasterBandsIdx )
+        {
+          inRasterBand = inRasterBands_[ inRasterBandsIdx ];
+          
+          for( rasterCol = 0 ; rasterCol < rasterCols ; ++rasterCol )
+          {
+            inRaster_.getElement( rasterCol, rasterLine, lineDataMtx[ 
+              inRasterBandsIdx ][ rasterCol ], inRasterBand );
+          }
+        }
+        
+        inMutex_.unLock();
+        
+        // Classifying each pixel of the loaded line
+        
+        for( lDMCol = 0 ; lDMCol < rasterCols ; ++lDMCol )
+        {
+          // looking for the best class (min angular distance)
+          
+          minAngularDist = DBL_MAX;
+          minAngularDistClassID = 0;          
+          
+          for(  refDataVectorIdx = 0 ;  refDataVectorIdx <  refDataVectorSize ;
+            ++refDataVectorIdx )
+          {
+            const ClassReferenceData& classRefData = 
+              refDataVector_[ refDataVectorIdx ];
+              
+            angularTR = 0;
+            angularTT = 0;
+            angularRR = 0;   
+            
+            for( lDMLine = 0 ; lDMLine < inRasterBandsSize ; ++lDMLine )
+            {
+              meanValue = classRefData.samplesMeansVec_[ lDMLine ];
+              dataValue = lineDataMtx[ lDMLine ][ lDMCol ];
+              
+              angularTR += dataValue * meanValue;
+              angularRR += meanValue * meanValue;
+              angularTT += dataValue * dataValue;
+            }
+            
+            angularDist = angularTR / ( sqrt( angularTT ) *
+              sqrt( angularRR ) );
+            if( ABS( angularDist ) > 1.0 )
+            {
+              angularDist = DBL_MAX;
+            }
+            else
+            {
+              angularDist = acos( angularDist );
+            }
+          
+            if( ( angularDist < minAngularDist ) && ( angularDist < 
+              classRefData.maxAngularDist_ ) )
+            {
+              minAngularDist = angularDist;
+              minAngularDistClassID = classRefData.classId_;
+            }
+          }
+          
+          // Saving the best class id to the output result vector
+          
+          classifyingResultVector[ lDMCol ] = minAngularDistClassID;
+        }
+        
+        // Saving the classification result for the current line
+        
+        outMutex_.lock();
+        
+        for( rasterCol = 0 ; rasterCol < rasterCols ; ++rasterCol )
+        {
+          if( ! outRaster_.setElement( rasterCol, rasterLine, 
+            classifyingResultVector[ rasterCol ], 0 ) )
+          {
+            outMutex_.unLock();
+            TEAGN_LOGMSG( "Error writing to the output raster" );
+            abortFlag_ = true;
+            return;
+          }
+        }   
+             
+        outMutex_.unLock();
+      }
+      else
+      {
+        inMutex_.unLock();
+      }
+    }
+  }
+
+  returnValue_ = true;
+}
+
+TePDISAMClassifier::TePDISAMClassifier()
+{
+};
+
+TePDISAMClassifier::~TePDISAMClassifier()
+{
+};
+
+bool TePDISAMClassifier::CheckParameters(const TePDIParameters& parameters) const
+{
+  // Checking input_raster
+  
+  TePDITypes::TePDIRasterPtrType input_raster;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_raster", input_raster), 
+    "Missing parameter: input_raster");
+  TEAGN_TRUE_OR_RETURN( input_raster.isActive(), 
+    "Invalid parameter: input_raster" );
+  TEAGN_TRUE_OR_RETURN( input_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: input_raster" );    
+
+  /* bands parameter checking */
+
+  std::vector< unsigned int > bands;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "bands", bands ), 
+    "Missing parameter: bands" );
+  for( unsigned int bands_index = 0 ; bands_index < bands.size() ; 
+    ++bands_index ) 
+  {
+    TEAGN_TRUE_OR_RETURN(
+      ( (int)bands[ bands_index ] < input_raster->nBands() ),
+      "Invalid parameter: channels" );
+  }
+  
+  // Checking output_raster
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_raster", output_raster), 
+    "Missing parameter: output_raster");
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(), 
+    "Invalid parameter: output_raster" );
+  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: output_raster" );   
+    
+  // Checking spectral_samples
+    
+  SpectralSamplesVecPtrT spectral_samples;
+  TEAGN_TRUE_OR_RETURN(parameters.GetParameter("spectral_samples", 
+    spectral_samples), "Missing parameter: spectral_samples");
+  TEAGN_TRUE_OR_RETURN( spectral_samples.isActive(), 
+    "Invalid parameter: spectral_samples" );
+  TEAGN_TRUE_OR_RETURN( spectral_samples->size(), 
+    "Invalid parameter: spectral_samples" );
+    
+  return true;
+}
+
+void TePDISAMClassifier::ResetState( const TePDIParameters& )
+{
+}
+
+bool TePDISAMClassifier::RunImplementation()
+{
+  // Extracting parameters
+  
+  TePDITypes::TePDIRasterPtrType input_raster;
+  params_.GetParameter("input_raster", input_raster);  
+  
+  std::vector< unsigned int > bands;
+  params_.GetParameter("bands", bands);  
+    
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter("output_raster", output_raster);
+  
+  SpectralSamplesVecPtrT spectral_samples;
+  params_.GetParameter("spectral_samples", spectral_samples);  
+  
+  // Calc samples means
+  
+  std::vector< ClassReferenceData > refDataVector;
+  TEAGN_TRUE_OR_RETURN( calcClassRefData( *spectral_samples, refDataVector ), 
+    "Internal error" );
+    
+  // Init the output image
+  
+  TeRasterParams outputImgParams = output_raster->params();
+  outputImgParams.nBands( 1 );
+  outputImgParams.setDataType( TeUNSIGNEDLONG, -1 );
+  outputImgParams.projection( input_raster->params().projection() );
+  outputImgParams.boundingBoxLinesColumns( 
+    input_raster->params().boundingBox().x1(), 
+    input_raster->params().boundingBox().y1(), 
+    input_raster->params().boundingBox().x2(), 
+    input_raster->params().boundingBox().y2(), 
+    input_raster->params().nlines_, 
+    input_raster->params().ncols_ );    
+  
+  TEAGN_TRUE_OR_RETURN( output_raster->init( outputImgParams ),
+    "Output raster init error" ); 
+     
+  // Starting segmentation threads
+  
+  TeMutex inMutex;
+  TeMutex& outMutex = inMutex;
+  bool abortFlag = false;
+  const unsigned int maxSegThreads = TeGetPhysProcNumber();
+  
+  std::vector< bool > linesProcStatusVec;
+  linesProcStatusVec.resize( input_raster->params().nlines_, 0 );
+  
+  if( params_.CheckParameter< int >( "enable_multi_thread" ) &&
+    ( maxSegThreads > 1 ) )
+  {
+    std::vector< TeSharedPtr< SegThread > > threadsVec;
+    
+    unsigned int threadIdx = 0;
+    
+    for( threadIdx = 0 ; threadIdx < maxSegThreads ; ++threadIdx )
+    {
+      TeSharedPtr< SegThread > threadPtr( new SegThread( progress_enabled_,
+        *input_raster, bands, refDataVector, inMutex, outMutex, 
+        linesProcStatusVec, abortFlag, *output_raster ) );
+      threadPtr->start();
+      threadsVec.push_back( threadPtr );
+    }
+  
+    // Wait all threads to finish
+    
+    bool returnValue = true;
+    
+    for( threadIdx = 0 ; threadIdx < maxSegThreads ; ++threadIdx )
+    {
+      threadsVec[ threadIdx ]->waitToFinish();
+      returnValue &= threadsVec[ threadIdx ]->getReturnValue();
+    }    
+    
+    return returnValue;  
+  }
+  else
+  {
+    SegThread threadInstance( progress_enabled_, *input_raster, bands, 
+      refDataVector, inMutex, outMutex, linesProcStatusVec, abortFlag, 
+      *output_raster );
+      
+    threadInstance.run();
+    
+    return threadInstance.getReturnValue();
+  }
+}
+
+bool TePDISAMClassifier::calcClassRefData( const SpectralSamplesVectorT& 
+  spectralSamples, std::vector< ClassReferenceData >& refDataVector ) const
+{
+  refDataVector.clear();
+  
+  const ClassReferenceData dummyRefData;
+  
+  for( unsigned int sSIdx = 0 ; sSIdx < spectralSamples.size() ; ++sSIdx )
+  {
+    const ClassSpectralSamples& cSSamples = spectralSamples[ sSIdx ];
+    const unsigned int mCols = cSSamples.samplesMatrix_.GetColumns();
+    const unsigned int mLines = cSSamples.samplesMatrix_.GetLines();
+    unsigned int sMtxCol = 0;
+    unsigned int sMtxLine = 0;
+    double colMean = 0;
+    
+    refDataVector.push_back( dummyRefData );
+    ClassReferenceData& newRefData = refDataVector[ refDataVector.size() - 1 ];
+    
+    TEAGN_TRUE_OR_RETURN( cSSamples.classId_ > 0, "Invalid class ID" );
+    newRefData.classId_ = cSSamples.classId_;
+    
+    newRefData.maxAngularDist_ = cSSamples.maxAngularDist_;
+    
+    for( sMtxCol = 0 ; sMtxCol < mCols ; ++sMtxCol )
+    {
+      colMean = 0;
+      
+      for( sMtxLine = 0 ; sMtxLine < mLines ; ++sMtxLine )
+      {
+        colMean += cSSamples.samplesMatrix_[ sMtxLine ][ sMtxCol ];
+      }
+    
+      newRefData.samplesMeansVec_.push_back( colMean / ((double)mLines) );
+    }
+  }
+  
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDISAMClassifier.hpp b/src/terralib/image_processing/TePDISAMClassifier.hpp
new file mode 100644
index 0000000..7c34f8d
--- /dev/null
+++ b/src/terralib/image_processing/TePDISAMClassifier.hpp
@@ -0,0 +1,238 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDISAMCLASSIFIER_HPP
+  #define TEPDISAMCLASSIFIER_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIMatrix.hpp"
+  
+  #include <TeSharedPtr.h>
+  #include <TeThread.h>
+  #include <TeMutex.h>
+  
+  #include <vector>
+
+  /**
+   * @class TePDISAMClassifier
+   * @brief Spectral Angle Mapper classification algorithm.
+   * @details This algorithm maps the spectral similarity of input raster
+   * to the given reference spectra wich can be either laboratory of field spectra.
+   * This method assumes that the data have been reduced to apparent reflectance 
+   * with all dark current and path radiance biases removed.
+   * Reference: The spectral image processing system (SIPS)- interactive 
+   * visualization and analysis of imaging spectrometer data. Kruse, F. A.; 
+   * Lefkoff, A. B.; Boardman, J. W.; Heidebrecht, K. B.; Shapiro, A. T.; 
+   * Barloon, P. J.; Goetz, A. F. H. The earth and space science information 
+   * system (ESSIS). AIP Conference Proceedings, Volume 283, pp. 192-201 (1993).
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIClassificationAlgorithms
+   *
+   * @note The required parameters are:
+   *
+   * @param input_raster (TePDITypes::TePDIRasterPtrType) - Input raster.
+   * @param bands ( std::vector< unsigned int > ) - Bands to process from the 
+   * input raster.
+   * @param spectral_samples ( TePDISAMClassifier::SpectralSamplesVecPtrT ) -
+   * Reference spectral samples of all required classes.
+   * @param output_raster (TePDITypes::TePDIRasterPtrType) - Output raster.
+   *
+   * @note The optional parameters are:
+   *
+   * @param enable_multi_thread (int) - If present (any value) multi-threaded
+   * processing will be used (default:multi-threaded processing disabled).
+   * @example TePDIClassification_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDISAMClassifier : public TePDIAlgorithm
+  {
+  
+    public :
+    
+      /**
+       * @class ClassSpectralSamples
+       * @brief Class spectral samples.
+       */    
+      class PDI_DLL ClassSpectralSamples
+      {
+        public :
+        
+          /**
+           * @brief Class ID. (this ID will be used when generating the output
+           * result raster ).
+           * @details Only positive values are valid (the default value is zero 
+           * wich means invalid class).
+           */            
+          unsigned int classId_;
+          
+          /**
+           * @brief Maximum angular distance.
+           * @details This is the maximum acceptable angle (radians) between 
+           * one pixel spectra and the reference spectra (pixels with angular 
+           * distance higher than this value will not be classifyed as 
+           * belonging to this class (default:0.1 radians).
+           */            
+          double maxAngularDist_;          
+          
+          /**
+           * @brief Class samples (on sample per line ).
+           * @note The number of columns must match the number of bands
+           * to process from the input raster.
+           */          
+          TePDIMatrix< double > samplesMatrix_;
+        
+          ClassSpectralSamples();
+          
+          ~ClassSpectralSamples();
+      };
+      
+      /**
+       * @brief Samples vector.
+       */
+      typedef std::vector< ClassSpectralSamples > SpectralSamplesVectorT;
+        
+      /**
+       * @brief Samples vector pointer.
+       */        
+      typedef TeSharedPtr< SpectralSamplesVectorT > SpectralSamplesVecPtrT;
+  
+      TePDISAMClassifier();
+  
+      ~TePDISAMClassifier();
+  
+      // Overloaded
+      bool CheckParameters(const TePDIParameters& parameters) const;
+  
+    protected :
+    
+      /**
+       * @class ClassReferenceData
+       * @brief Class classification reference data.
+       */    
+      class PDI_DLL ClassReferenceData
+      {
+        public :
+        
+          /**
+           * @brief Class ID. (this ID will be used when generating the output
+           * result raster ).
+           * @details Only positive values are valid (the default value is zero 
+           * wich means invalid class).
+           */            
+          unsigned int classId_;
+          
+          /**
+           * @brief Maximum angular distance.
+           * @details This is the maximum acceptable angle (radians) between 
+           * one pixel spectra and a reference spectra (pixels with angular 
+           * distance higher than this value will not be classifyed as 
+           * belonging to this class (default:0.1 radians).
+           */            
+          double maxAngularDist_;          
+          
+          /**
+           * @brief The means vector for the class.
+           */          
+          std::vector< double > samplesMeansVec_;
+        
+          ClassReferenceData();
+          
+          ~ClassReferenceData();
+      };    
+    
+      /**
+       * @class SegThread
+       * @brief Segmentation thread class
+       */    
+      class PDI_DLL SegThread : public TeThread
+      {
+        public :
+        
+          SegThread( bool progEnabled, TeRaster& inRaster, 
+            const std::vector< unsigned int >& inRasterBands,
+            const std::vector< ClassReferenceData >& refDataVector,
+            TeMutex& inMutex, TeMutex& outMutex, 
+            std::vector< bool >& linesProcStatusVec, bool& abortFlag,
+            TeRaster& outRaster );
+          
+          ~SegThread();
+          
+          inline bool getReturnValue() const
+          {
+            return returnValue_;
+          };
+          
+          //overload
+          void run();          
+          
+        protected :
+        
+          /** Progress enabled/disabled flat. */        
+          bool progEnabled_;
+          
+          /** The return value for this thread instance execution
+          ( true if ok, false on errors). */
+          bool returnValue_;
+          
+          /** Input raster to process. */          
+          TeRaster& inRaster_;
+          
+          /** Input raster bands to process. */          
+          const std::vector< unsigned int >& inRasterBands_;
+          
+          /** The reference classes data vector. */          
+          const std::vector< ClassReferenceData >& refDataVector_;
+          
+          /** The mutex to use when reading input data. */          
+          TeMutex& inMutex_;
+          
+          /** The mutex to use when writing output data. */          
+          TeMutex& outMutex_;
+          
+          /** The processing status vector of each line. */          
+          std::vector< bool >& linesProcStatusVec_;
+          
+          /** The abort flag to be checked/set when an error occurs. */          
+          bool& abortFlag_;
+          
+          /** The output raster where to save the result. */          
+          TeRaster& outRaster_;
+      };      
+    
+      //Overloaded
+      void ResetState( const TePDIParameters& );
+    
+      //Overloaded
+      bool RunImplementation();
+      
+      /**
+       * @brief Calc the classes reference data required by the
+       * classification process.
+       * @param spectralSamples - Input spectral samples.
+       * @param refDataVector - The generated output reference data vector.
+       */      
+      bool calcClassRefData( const SpectralSamplesVectorT& spectralSamples,
+        std::vector< ClassReferenceData >& refDataVector ) const;
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDISensorSimulator.cpp b/src/terralib/image_processing/TePDISensorSimulator.cpp
index a4dd4bd..d41fcca 100644
--- a/src/terralib/image_processing/TePDISensorSimulator.cpp
+++ b/src/terralib/image_processing/TePDISensorSimulator.cpp
@@ -1,259 +1,259 @@
-#include "TePDISensorSimulator.hpp"
-#include "TePDILinearFilter.hpp"
-#include "TePDITypes.hpp"
-#include "TePDIUtils.hpp"
-
-#include <string>
-
-#include <math.h>
-#include <float.h>
-
-//#include <string>
-
-//#include <math.h>
-//#include <float.h>
-
-
-TePDISensorSimulator::TePDISensorSimulator()
-{
-}
-
-
-TePDISensorSimulator::~TePDISensorSimulator()
-{
-}
-
-
-void TePDISensorSimulator::ResetState( const TePDIParameters& )
-{
-}
-
-
-bool TePDISensorSimulator::CheckParameters( const TePDIParameters& parameters ) const
-{
-  /* Checking input raster */
-
-  TePDITypes::TePDIRasterPtrType input_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster", 
-    input_raster ),
-    "Missing parameter: input_raster" );
-  TEAGN_TRUE_OR_RETURN( input_raster.isActive(),
-    "Invalid parameter: input_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( input_raster->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: input_raster not ready" );
-
-
-  /* Checking output_raster */
-
-    TePDITypes::TePDIRasterPtrType output_raster;
-    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
-      output_raster ),
-      "Missing parameter: output_raster" );
-    TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
-      "Invalid parameter: output_raster inactive" );
-    TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
-      TeRasterParams::TeNotReady, 
-      "Invalid parameter: output_raster not ready" );    
-
-
-  /* channels parameter checking */
-
-  std::vector< int > channels;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "channels", channels ), 
-    "Missing parameter: channels" );
-  for( unsigned int channels_index = 0 ; 
-    channels_index < channels.size() ; 
-    ++channels_index ) {
-
-      TEAGN_TRUE_OR_RETURN(
-        ( channels[ channels_index ] < input_raster->nBands() ),
-        "Invalid parameter: channels" );
-    }
-
-    
-    /* ifov_in parameter checking */
-
-    double ifov_in;
-    if( ! parameters.GetParameter( "ifov_in", ifov_in ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: ifov_in" );
-      return false;
-    }
-    TEAGN_TRUE_OR_RETURN( ifov_in > 0, "Invalid input ifov" );
-
-    /* eifov_in_across parameter checking */
-
-    double eifov_in_across;
-    if( ! parameters.GetParameter( "eifov_in_across", eifov_in_across ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: eifov_in_across" );
-      return false;
-    }
-    TEAGN_TRUE_OR_RETURN( eifov_in_across > ifov_in, "Invalid input eifov across track" );
-
-    /* eifov_in_long parameter checking */
-
-    double eifov_in_long;
-    if( ! parameters.GetParameter( "eifov_in_long", eifov_in_long ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: eifov_in_long" );
-      return false;
-    }
-    TEAGN_TRUE_OR_RETURN( eifov_in_long > ifov_in, "Invalid input eifov long track" );
-
-    /* ifov_out parameter checking */
-
-    double ifov_out;
-    if( ! parameters.GetParameter( "ifov_out", ifov_out ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: ifov_out" );
-      return false;
-    }
-    TEAGN_TRUE_OR_RETURN( ifov_out > ifov_in, "Invalid output ifov" );
-
-    /* eifov_out_across parameter checking */
-
-    double eifov_out_across;
-    if( ! parameters.GetParameter( "eifov_out_across", eifov_out_across ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: eifov_out_across" );
-      return false;
-    }
-    TEAGN_TRUE_OR_RETURN( eifov_out_across > ifov_out, "Invalid output eifov across track" );
-
-    /* eifov_out_long parameter checking */
-
-    double eifov_out_long;
-    if( ! parameters.GetParameter( "eifov_out_long", eifov_out_long ) ) {
-
-      TEAGN_LOGERR( "Missing parameter: eifov_out_long" );
-      return false;
-    }
-    TEAGN_TRUE_OR_RETURN( eifov_out_long > ifov_out, "Invalid output eifov long track" );
-
-    return true;
-}
-
-
-bool TePDISensorSimulator::RunImplementation()
-{
-  /* Retriving parameters */
-  
-  TePDITypes::TePDIRasterPtrType input_raster;
-  params_.GetParameter( "input_raster", input_raster );
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params_.GetParameter( "output_raster", output_raster );
-  
-  std::vector< int > channels;
-  params_.GetParameter( "channels", channels );
-  
-  double ifov_in;
-  params_.GetParameter( "ifov_in", ifov_in );
-
-  double eifov_in_across;
-  params_.GetParameter( "eifov_in_across", eifov_in_across );
-
-  double eifov_in_long;
-  params_.GetParameter( "eifov_in_long", eifov_in_long );
-
-  double ifov_out;
-  params_.GetParameter( "ifov_out", ifov_out );
-
-  double eifov_out_across;
-  params_.GetParameter( "eifov_out_across", eifov_out_across );
-
-  double eifov_out_long;
-  params_.GetParameter( "eifov_out_long", eifov_out_long );
-
-  /* calculating images parameters */
-
-  double sigma_in_across, sigma_in_long, sigma_out_across, sigma_out_long;
-  double varF1, varF2;
-  int n;
-  double alfa1, alfa2, a1, a2, b1, b2;
-
-  sigma_in_across = (1/TePI) * sqrt(2*log(2.0)) * eifov_in_across; //original sensor
-  sigma_in_long = (1/TePI) * sqrt(2*log(2.0)) * eifov_in_long;
-
-  sigma_out_across = (1/TePI) * sqrt(2*log(2.0)) * eifov_out_across; //desired output sensor
-  sigma_out_long = (1/TePI) * sqrt(2*log(2.0)) * eifov_out_long;
-
-  varF1 = pow(sigma_out_across,2) - pow(sigma_in_across,2);
-  varF2 = pow(sigma_out_long,2) - pow(sigma_in_long,2);
-
-  n = int(ceil((1.5/(pow(ifov_in,2))) * MAX(varF1, varF2)));
-
-  alfa1 = (varF1)/(2*(n*pow(ifov_in,2)-varF1));
-  alfa2 = (varF2)/(2*(n*pow(ifov_in,2)-varF2));
-
-  a1 = 1/(1+2*alfa1);
-  a2 = 1/(1+2*alfa2);
-
-  b1 = alfa1/(1+2*alfa1);
-  b2 = alfa2/(1+2*alfa2);
-
-  TePDIFilterMask::pointer filter_mask( new TePDIFilterMask( 3, 0 ) );
-  filter_mask->set(0,0,b1*b2);
-  filter_mask->set(1,0,a1*b2);
-  filter_mask->set(2,0,b1*b2);
-  filter_mask->set(0,1,b1*a2);
-  filter_mask->set(1,1,a1*a2);
-  filter_mask->set(2,1,b1*a2);
-  filter_mask->set(0,2,b1*b2);
-  filter_mask->set(1,2,a1*b2);
-  filter_mask->set(2,2,b1*b2);
-
-  TePDIParameters new_params = params_;
-
-  new_params.SetParameter("input_image",input_raster);
-  new_params.SetParameter( "filter_mask", filter_mask );
-  new_params.SetParameter( "iterations", n );
-
-  TePDILinearFilter filter;
-  
-  if( ifov_in == ifov_out ) {
-    /* No Ressampling required */
-    
-    new_params.SetParameter("output_image",output_raster);
-    
-    TEAGN_TRUE_OR_THROW( filter.Reset( new_params ), "Invalid Parameters" );
-    TEAGN_TRUE_OR_RETURN( filter.Apply(), "Linear filter error" );
-  } else {
-    /* Ressampling is required */
-
-    TePDITypes::TePDIRasterPtrType non_resssampled_output_raster;
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster(
-      non_resssampled_output_raster, input_raster->params(), 
-        TePDIUtils::TePDIUtilsAutoMemPol ), "Temporary raster allocation error" )
-        
-    new_params.SetParameter( "output_image", non_resssampled_output_raster );
-    
-    TEAGN_TRUE_OR_THROW( filter.Reset( new_params ), "Invalid Parameters" );
-    TEAGN_TRUE_OR_RETURN( filter.Apply(), "Linear filter error" );
-    
-    /* Ressampling raster */
-    
-    TePDIInterpolator::InterpMethod interpolator = 
-      TePDIInterpolator::BicubicMethod;
-    
-    if( params_.CheckParameter<TePDIInterpolator::InterpMethod>( 
-      "interpolator" ) ) {
-      
-      params_.GetParameter( "interpolator", interpolator );
-    }
-    
-    double x_resolution_ratio = ( ifov_out / ifov_in );
-    double y_resolution_ratio = x_resolution_ratio;
-    
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::resampleRasterByRes( 
-      non_resssampled_output_raster, output_raster, x_resolution_ratio,
-      y_resolution_ratio, interpolator, progress_enabled_ ), 
-      "Output raster resample error" )
-  }
-  
-  return true;
-}
-
+#include "TePDISensorSimulator.hpp"
+#include "TePDILinearFilter.hpp"
+#include "TePDITypes.hpp"
+#include "TePDIUtils.hpp"
+
+#include <string>
+
+#include <math.h>
+#include <float.h>
+
+//#include <string>
+
+//#include <math.h>
+//#include <float.h>
+
+
+TePDISensorSimulator::TePDISensorSimulator()
+{
+}
+
+
+TePDISensorSimulator::~TePDISensorSimulator()
+{
+}
+
+
+void TePDISensorSimulator::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDISensorSimulator::CheckParameters( const TePDIParameters& parameters ) const
+{
+  /* Checking input raster */
+
+  TePDITypes::TePDIRasterPtrType input_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster", 
+    input_raster ),
+    "Missing parameter: input_raster" );
+  TEAGN_TRUE_OR_RETURN( input_raster.isActive(),
+    "Invalid parameter: input_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( input_raster->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: input_raster not ready" );
+
+
+  /* Checking output_raster */
+
+    TePDITypes::TePDIRasterPtrType output_raster;
+    TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
+      output_raster ),
+      "Missing parameter: output_raster" );
+    TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
+      "Invalid parameter: output_raster inactive" );
+    TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
+      TeRasterParams::TeNotReady, 
+      "Invalid parameter: output_raster not ready" );    
+
+
+  /* channels parameter checking */
+
+  std::vector< int > channels;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "channels", channels ), 
+    "Missing parameter: channels" );
+  for( unsigned int channels_index = 0 ; 
+    channels_index < channels.size() ; 
+    ++channels_index ) {
+
+      TEAGN_TRUE_OR_RETURN(
+        ( channels[ channels_index ] < input_raster->nBands() ),
+        "Invalid parameter: channels" );
+    }
+
+    
+    /* ifov_in parameter checking */
+
+    double ifov_in;
+    if( ! parameters.GetParameter( "ifov_in", ifov_in ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: ifov_in" );
+      return false;
+    }
+    TEAGN_TRUE_OR_RETURN( ifov_in > 0, "Invalid input ifov" );
+
+    /* eifov_in_across parameter checking */
+
+    double eifov_in_across;
+    if( ! parameters.GetParameter( "eifov_in_across", eifov_in_across ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: eifov_in_across" );
+      return false;
+    }
+    TEAGN_TRUE_OR_RETURN( eifov_in_across > ifov_in, "Invalid input eifov across track" );
+
+    /* eifov_in_long parameter checking */
+
+    double eifov_in_long;
+    if( ! parameters.GetParameter( "eifov_in_long", eifov_in_long ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: eifov_in_long" );
+      return false;
+    }
+    TEAGN_TRUE_OR_RETURN( eifov_in_long > ifov_in, "Invalid input eifov long track" );
+
+    /* ifov_out parameter checking */
+
+    double ifov_out;
+    if( ! parameters.GetParameter( "ifov_out", ifov_out ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: ifov_out" );
+      return false;
+    }
+    TEAGN_TRUE_OR_RETURN( ifov_out > ifov_in, "Invalid output ifov" );
+
+    /* eifov_out_across parameter checking */
+
+    double eifov_out_across;
+    if( ! parameters.GetParameter( "eifov_out_across", eifov_out_across ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: eifov_out_across" );
+      return false;
+    }
+    TEAGN_TRUE_OR_RETURN( eifov_out_across > ifov_out, "Invalid output eifov across track" );
+
+    /* eifov_out_long parameter checking */
+
+    double eifov_out_long;
+    if( ! parameters.GetParameter( "eifov_out_long", eifov_out_long ) ) {
+
+      TEAGN_LOGERR( "Missing parameter: eifov_out_long" );
+      return false;
+    }
+    TEAGN_TRUE_OR_RETURN( eifov_out_long > ifov_out, "Invalid output eifov long track" );
+
+    return true;
+}
+
+
+bool TePDISensorSimulator::RunImplementation()
+{
+  /* Retriving parameters */
+  
+  TePDITypes::TePDIRasterPtrType input_raster;
+  params_.GetParameter( "input_raster", input_raster );
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter( "output_raster", output_raster );
+  
+  std::vector< int > channels;
+  params_.GetParameter( "channels", channels );
+  
+  double ifov_in;
+  params_.GetParameter( "ifov_in", ifov_in );
+
+  double eifov_in_across;
+  params_.GetParameter( "eifov_in_across", eifov_in_across );
+
+  double eifov_in_long;
+  params_.GetParameter( "eifov_in_long", eifov_in_long );
+
+  double ifov_out;
+  params_.GetParameter( "ifov_out", ifov_out );
+
+  double eifov_out_across;
+  params_.GetParameter( "eifov_out_across", eifov_out_across );
+
+  double eifov_out_long;
+  params_.GetParameter( "eifov_out_long", eifov_out_long );
+
+  /* calculating images parameters */
+
+  double sigma_in_across, sigma_in_long, sigma_out_across, sigma_out_long;
+  double varF1, varF2;
+  int n;
+  double alfa1, alfa2, a1, a2, b1, b2;
+
+  sigma_in_across = (1/TePI) * sqrt(2*log(2.0)) * eifov_in_across; //original sensor
+  sigma_in_long = (1/TePI) * sqrt(2*log(2.0)) * eifov_in_long;
+
+  sigma_out_across = (1/TePI) * sqrt(2*log(2.0)) * eifov_out_across; //desired output sensor
+  sigma_out_long = (1/TePI) * sqrt(2*log(2.0)) * eifov_out_long;
+
+  varF1 = pow(sigma_out_across,2) - pow(sigma_in_across,2);
+  varF2 = pow(sigma_out_long,2) - pow(sigma_in_long,2);
+
+  n = int(ceil((1.5/(pow(ifov_in,2))) * MAX(varF1, varF2)));
+
+  alfa1 = (varF1)/(2*(n*pow(ifov_in,2)-varF1));
+  alfa2 = (varF2)/(2*(n*pow(ifov_in,2)-varF2));
+
+  a1 = 1/(1+2*alfa1);
+  a2 = 1/(1+2*alfa2);
+
+  b1 = alfa1/(1+2*alfa1);
+  b2 = alfa2/(1+2*alfa2);
+
+  TePDIFilterMask::pointer filter_mask( new TePDIFilterMask( 3, 0 ) );
+  filter_mask->set(0,0,b1*b2);
+  filter_mask->set(1,0,a1*b2);
+  filter_mask->set(2,0,b1*b2);
+  filter_mask->set(0,1,b1*a2);
+  filter_mask->set(1,1,a1*a2);
+  filter_mask->set(2,1,b1*a2);
+  filter_mask->set(0,2,b1*b2);
+  filter_mask->set(1,2,a1*b2);
+  filter_mask->set(2,2,b1*b2);
+
+  TePDIParameters new_params = params_;
+
+  new_params.SetParameter("input_image",input_raster);
+  new_params.SetParameter( "filter_mask", filter_mask );
+  new_params.SetParameter( "iterations", n );
+
+  TePDILinearFilter filter;
+  
+  if( ifov_in == ifov_out ) {
+    /* No Ressampling required */
+    
+    new_params.SetParameter("output_image",output_raster);
+    
+    TEAGN_TRUE_OR_THROW( filter.Reset( new_params ), "Invalid Parameters" );
+    TEAGN_TRUE_OR_RETURN( filter.Apply(), "Linear filter error" );
+  } else {
+    /* Ressampling is required */
+
+    TePDITypes::TePDIRasterPtrType non_resssampled_output_raster;
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeAllocRAMRaster(
+      non_resssampled_output_raster, input_raster->params(), 
+        TePDIUtils::TePDIUtilsAutoMemPol ), "Temporary raster allocation error" )
+        
+    new_params.SetParameter( "output_image", non_resssampled_output_raster );
+    
+    TEAGN_TRUE_OR_THROW( filter.Reset( new_params ), "Invalid Parameters" );
+    TEAGN_TRUE_OR_RETURN( filter.Apply(), "Linear filter error" );
+    
+    /* Ressampling raster */
+    
+    TePDIInterpolator::InterpMethod interpolator = 
+      TePDIInterpolator::BicubicMethod;
+    
+    if( params_.CheckParameter<TePDIInterpolator::InterpMethod>( 
+      "interpolator" ) ) {
+      
+      params_.GetParameter( "interpolator", interpolator );
+    }
+    
+    double x_resolution_ratio = ( ifov_out / ifov_in );
+    double y_resolution_ratio = x_resolution_ratio;
+    
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::resampleRasterByRes( 
+      non_resssampled_output_raster, output_raster, x_resolution_ratio,
+      y_resolution_ratio, interpolator, progress_enabled_ ), 
+      "Output raster resample error" )
+  }
+  
+  return true;
+}
+
diff --git a/src/terralib/image_processing/TePDISensorSimulator.hpp b/src/terralib/image_processing/TePDISensorSimulator.hpp
index b0a614e..257cabc 100644
--- a/src/terralib/image_processing/TePDISensorSimulator.hpp
+++ b/src/terralib/image_processing/TePDISensorSimulator.hpp
@@ -1,107 +1,107 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDISENSORSIMULATOR_HPP
-  #define TEPDISENSORSIMULATOR_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIParameters.hpp"
-  #include "TePDIInterpolator.hpp"
-  
-  #include <TeSharedPtr.h>
-
-  /**
-   * @brief This is the class for simulating an image from a sensor. 
-   * Given an image generated by sensor 1, with known ifov and eifovs, this class generates another image, 
-   * as if it was generated by sensor 2, with another ifov and eifovs values.
-   * @author Eliana Pantale�o <elianap at dpi.inpe.br>
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIGeneralAlgoGroup
-   *
-   * @note The general required parameters:
-   *
-   * @param input_raster ( TePDITypes::TePDIRasterPtrType ) - The original input raster.
-   * @param channels ( std::vector<int> ) - The band(s) to be simulated.
-   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - The output raster.
-   * @param ifov_in ( double ) - The ifov of the input raster.
-   * @param eifov_in_across ( double ) - The eifov of the input raster across track.
-   * @param eifov_in_long ( double ) - The eifov of the input raster long track.
-   * @param ifov_out ( double ) - The ifov of the output raster.
-   * @param eifov_out_across ( double ) - The eifov of the output raster across track.
-   * @param eifov_out_long ( double ) - The eifov of the output raster long track.
-   *
-   * @note Optional parameters:
-   *
-   * @param interpolator (TePDIInterpolator::NNMethod) - The interpolation method to use when raster resampling is needed (default:TePDIInterpolator::BicubicMethod).
-   *
-   */
-  class PDI_DLL TePDISensorSimulator : public TePDIAlgorithm {
-    public :
-      typedef TeSharedPtr< TePDISensorSimulator > pointer;
-      typedef const TeSharedPtr< TePDISensorSimulator> const_pointer;
-      
-      /**
-       * Default Constructor.
-       *
-       */
-      TePDISensorSimulator();
-
-      /**
-       * Default Destructor
-       */
-      ~TePDISensorSimulator();
-      
-      /**
-       * Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;      
-
-    protected :
-    
-      /**
-       * Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );    
-     
-      /**
-       * Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();      
-  };
-  
-/** @example TePDISensorSimulator_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDISENSORSIMULATOR_HPP
+  #define TEPDISENSORSIMULATOR_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIParameters.hpp"
+  #include "TePDIInterpolator.hpp"
+  
+  #include <TeSharedPtr.h>
+
+  /**
+   * @brief This is the class for simulating an image from a sensor. 
+   * Given an image generated by sensor 1, with known ifov and eifovs, this class generates another image, 
+   * as if it was generated by sensor 2, with another ifov and eifovs values.
+   * @author Eliana Pantale�o <elianap at dpi.inpe.br>
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIGeneralAlgoGroup
+   *
+   * @note The general required parameters:
+   *
+   * @param input_raster ( TePDITypes::TePDIRasterPtrType ) - The original input raster.
+   * @param channels ( std::vector<int> ) - The band(s) to be simulated.
+   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - The output raster.
+   * @param ifov_in ( double ) - The ifov of the input raster.
+   * @param eifov_in_across ( double ) - The eifov of the input raster across track.
+   * @param eifov_in_long ( double ) - The eifov of the input raster long track.
+   * @param ifov_out ( double ) - The ifov of the output raster.
+   * @param eifov_out_across ( double ) - The eifov of the output raster across track.
+   * @param eifov_out_long ( double ) - The eifov of the output raster long track.
+   *
+   * @note Optional parameters:
+   *
+   * @param interpolator (TePDIInterpolator::NNMethod) - The interpolation method to use when raster resampling is needed (default:TePDIInterpolator::BicubicMethod).
+   *
+   */
+  class PDI_DLL TePDISensorSimulator : public TePDIAlgorithm {
+    public :
+      typedef TeSharedPtr< TePDISensorSimulator > pointer;
+      typedef const TeSharedPtr< TePDISensorSimulator> const_pointer;
+      
+      /**
+       * Default Constructor.
+       *
+       */
+      TePDISensorSimulator();
+
+      /**
+       * Default Destructor
+       */
+      ~TePDISensorSimulator();
+      
+      /**
+       * Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;      
+
+    protected :
+    
+      /**
+       * Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );    
+     
+      /**
+       * Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();      
+  };
+  
+/** @example TePDISensorSimulator_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif
diff --git a/src/terralib/image_processing/TePDISensorSimulatorFactory.cpp b/src/terralib/image_processing/TePDISensorSimulatorFactory.cpp
index ff8be9e..b1d88f4 100644
--- a/src/terralib/image_processing/TePDISensorSimulatorFactory.cpp
+++ b/src/terralib/image_processing/TePDISensorSimulatorFactory.cpp
@@ -1,27 +1,27 @@
-
-#include "TePDISensorSimulatorFactory.hpp"
-#include "TePDISensorSimulator.hpp"
-
-#include <TeAgnostic.h>
-
-
-TePDISensorSimulatorFactory::TePDISensorSimulatorFactory()
-: TePDIAlgorithmFactory( std::string( "TePDISensorSimulator" ) )
-{
-};      
-
-
-TePDISensorSimulatorFactory::~TePDISensorSimulatorFactory()
-{
-};
-
-
-TePDIAlgorithm* TePDISensorSimulatorFactory::build ( const TePDIParameters& arg )
-{
-  TePDIAlgorithm* instance_ptr = new TePDISensorSimulator();
-  
-  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
-    "Invalid parameters" );
-  
-  return instance_ptr;
-}
+
+#include "TePDISensorSimulatorFactory.hpp"
+#include "TePDISensorSimulator.hpp"
+
+#include <TeAgnostic.h>
+
+
+TePDISensorSimulatorFactory::TePDISensorSimulatorFactory()
+: TePDIAlgorithmFactory( std::string( "TePDISensorSimulator" ) )
+{
+};      
+
+
+TePDISensorSimulatorFactory::~TePDISensorSimulatorFactory()
+{
+};
+
+
+TePDIAlgorithm* TePDISensorSimulatorFactory::build ( const TePDIParameters& arg )
+{
+  TePDIAlgorithm* instance_ptr = new TePDISensorSimulator();
+  
+  TEAGN_TRUE_OR_THROW( instance_ptr->Reset( arg ),
+    "Invalid parameters" );
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/image_processing/TePDISensorSimulatorFactory.hpp b/src/terralib/image_processing/TePDISensorSimulatorFactory.hpp
index 2b4fb0e..0b1186c 100644
--- a/src/terralib/image_processing/TePDISensorSimulatorFactory.hpp
+++ b/src/terralib/image_processing/TePDISensorSimulatorFactory.hpp
@@ -1,68 +1,68 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDISENSORSIMULATORFACTORY_HPP
-  #define TEPDISENSORSIMULATORFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIAlgorithmFactory.hpp"
-  #include "TePDIParameters.hpp"
-  
-  /**
-   * @brief This is the class for TePDISensorSimulator factory.
-   * @author Eliana Pantale�o <elianap at dpi.inpe.br>
-   * @ingroup PDIAlgorithmsFactories
-   */
-  class PDI_DLL TePDISensorSimulatorFactory : public TePDIAlgorithmFactory
-  {
-    public :
-      
-      /**
-       * Default constructor
-       */
-      TePDISensorSimulatorFactory();      
-      
-      /**
-       * Default Destructor
-       */
-      ~TePDISensorSimulatorFactory();
-      
-    protected :  
-      
-      /**
-       * Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated algorithm instance.
-       */
-      TePDIAlgorithm* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace {
-    static TePDISensorSimulatorFactory TePDISensorSimulatorFactory_instance;
-  };  
-  
-#endif
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDISENSORSIMULATORFACTORY_HPP
+  #define TEPDISENSORSIMULATORFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIAlgorithmFactory.hpp"
+  #include "TePDIParameters.hpp"
+  
+  /**
+   * @brief This is the class for TePDISensorSimulator factory.
+   * @author Eliana Pantale�o <elianap at dpi.inpe.br>
+   * @ingroup PDIAlgorithmsFactories
+   */
+  class PDI_DLL TePDISensorSimulatorFactory : public TePDIAlgorithmFactory
+  {
+    public :
+      
+      /**
+       * Default constructor
+       */
+      TePDISensorSimulatorFactory();      
+      
+      /**
+       * Default Destructor
+       */
+      ~TePDISensorSimulatorFactory();
+      
+    protected :  
+      
+      /**
+       * Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the parameters used by the
+       * algorithm.
+       * @return A pointer to the new generated algorithm instance.
+       */
+      TePDIAlgorithm* build( const TePDIParameters& arg );
+      
+  };
+
+  namespace {
+    static TePDISensorSimulatorFactory TePDISensorSimulatorFactory_instance;
+  };  
+  
+#endif
diff --git a/src/terralib/image_processing/TePDIStatistic.cpp b/src/terralib/image_processing/TePDIStatistic.cpp
old mode 100755
new mode 100644
index c09abd2..3437b11
--- a/src/terralib/image_processing/TePDIStatistic.cpp
+++ b/src/terralib/image_processing/TePDIStatistic.cpp
@@ -1,1172 +1,1197 @@
-#include "TePDIStatistic.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-
-#include <TeUtils.h>
-#include <TeBox.h>
-#include <TeGeometryAlgorithms.h>
-
-#include <math.h>
-#include <float.h>
-
-
-TePDIStatistic::TePDIStatistic()
-{
-  iterator_strat_ = TeBoxPixelIn;
-  
-  polygonset_.reset( new TePolygonSet );
-}
-
-
-TePDIStatistic::~TePDIStatistic()
-{
-}
-
-
-void TePDIStatistic::ResetState( const TePDIParameters& params )
-{
-  if( params_ != params ) {
-    clear();
-    
-    /* Updating the iterator strategy ( if available ) */
-    
-    if( params.CheckParameter< TeStrategicIterator > ( 
-      "iterator_strat" ) ) {    
-      
-      params.GetParameter( "iterator_strat", iterator_strat_ );   
-    }
-    
-    
-    /* Extracting parameters */
-    
-    TEAGN_TRUE_OR_THROW( 
-      params.GetParameter( "rasters", rasters_ ),
-      "Missing parameter: rasters" );
-    
-    TEAGN_TRUE_OR_THROW( 
-      params.GetParameter( "bands", bands_ ),
-      "Missing parameter: bands" );     
-    
-    /* updating the local polygon set pointer */
-    
-    if( params.CheckParameter< TePDITypes::TePDIPolygonSetPtrType > ( 
-      "polygonset" ) ) {
-      
-      params.GetParameter( "polygonset", polygonset_ );
-    } else {
-      polygonset_.reset( new TePolygonSet );
-      
-      TeBox rasterbox = rasters_[ 0 ]->params().boundingBox();
-      TePolygon rasterpol = polygonFromBox( rasterbox );
-      
-      polygonset_->add( rasterpol );
-    }
-    
-    /* Building histogram cache if histograms are provided */
-  
-    if( params.CheckParameter< std::vector< TePDIHistogram::pointer > >( 
-      "histograms" ) ) {
-      
-      std::vector< TePDIHistogram::pointer > histograms;
-      TEAGN_TRUE_OR_THROW( params.GetParameter( "histograms", 
-        histograms ), "Missing parameter: histograms" );
-        
-      for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
-        std::pair< unsigned int, unsigned int  > key;
-        key.first = index;
-        key.second = 0;
-      
-        histo_cache_[ key ] = histograms[ index ];
-      }
-    }
-  }
-}
-
-
-bool TePDIStatistic::RunImplementation()
-{
-  TEAGN_LOG_AND_THROW( "This function cannot be used for this class" );
-  return false;
-}
-
-
-bool TePDIStatistic::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking input rasters */
-  
-  TePDITypes::TePDIRasterVectorType rasters;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "rasters", rasters ),
-    "Missing parameter: rasters" );
-    
-  std::vector< int > bands;
-  TEAGN_TRUE_OR_RETURN( 
-    parameters.GetParameter( "bands", bands ),
-    "Missing parameter: bands" );
-    
-  TEAGN_TRUE_OR_RETURN( rasters.size() == bands.size(),
-    "The number of rasters doesn't match the number of bands" );
-    
-  TEAGN_TRUE_OR_RETURN( rasters.size() > 0, "Invalid number of rasters" );
-    
-  for( unsigned int index = 0 ; index < rasters.size() ; ++index ) {
-    TEAGN_TRUE_OR_RETURN( rasters[ index ].isActive(),
-      "Invalid parameter: raster " + 
-      Te2String( index ) + " inactive" );
-      
-    TEAGN_TRUE_OR_RETURN( 
-      rasters[ index ]->params().status_ != TeRasterParams::TeNotReady,
-      "Invalid parameter: raster " + 
-      Te2String( index ) + " not ready" );
-        
-    TEAGN_TRUE_OR_RETURN( 
-      rasters[ 0 ]->params().nlines_ == rasters[ index ]->params().nlines_,
-      "Lines number mismatch between raster 0 and raster " +
-      Te2String( index ) );
-      
-    TEAGN_TRUE_OR_RETURN( 
-      rasters[ 0 ]->params().ncols_ == rasters[ index ]->params().ncols_,
-      "Columns number mismatch between raster 0 and raster " +
-      Te2String( index ) );
-      
-    TEAGN_TRUE_OR_RETURN( 
-      rasters[ 0 ]->params().resx_ == rasters[ index ]->params().resx_,
-      "Pixel X resolution mismatch between raster 0 and raster " +
-      Te2String( index ) );      
-
-    TEAGN_TRUE_OR_RETURN( 
-      rasters[ 0 ]->params().resy_ == rasters[ index ]->params().resy_,
-      "Pixel Y resolution mismatch between raster 0 and raster " +
-      Te2String( index ) );      
-            
-    TEAGN_TRUE_OR_RETURN( 
-      bands[ index ] >= 0, "Invalid band number (" + 
-      Te2String( index ) + ")" );
-    TEAGN_TRUE_OR_RETURN( 
-      bands[ index ] < rasters[ index ]->nBands(), "Invalid band number (" + 
-      Te2String( index ) + ")" );
-      
-    /* Checking photometric interpretation */
-    
-    TEAGN_TRUE_OR_RETURN( ( 
-      ( rasters[ index ]->params().photometric_[ 
-        bands[ index ] ] == TeRasterParams::TeRGB ) ||
-      ( rasters[ index ]->params().photometric_[ 
-        bands[ index ] ] == TeRasterParams::TeMultiBand ) ),
-      "Invalid parameter - rasters (invalid photometric "
-      "interpretation)" );      
-  }
-  
-  /* Checking the restriction polygon set if avaliable */
-  
-  TePDITypes::TePDIPolygonSetPtrType polygonset;  
-  
-  if( parameters.CheckParameter< TePDITypes::TePDIPolygonSetPtrType >( 
-    "polygonset" ) ) {
-    
-    parameters.GetParameter( "polygonset", polygonset );
-    
-    TEAGN_TRUE_OR_RETURN( polygonset.isActive(), 
-      "Invalid parameter : polygonset" );
-      
-    TEAGN_TRUE_OR_RETURN( ( polygonset->size() > 0 ), 
-      "Invalid parameter : polygonset" );      
-      
-    TeBox rasterbbox = rasters[ 0 ]->params().boundingBox();
-    TePolygon raster_bpol = polygonFromBox( rasterbbox );
-    
-    TePolygonSet::iterator it = polygonset->begin();
-    TePolygonSet::iterator it_end = polygonset->end();
-    
-    while( it != it_end ) {
-      TEAGN_TRUE_OR_RETURN( 
-        ( TeRelation( raster_bpol, *it ) != TeDISJOINT ),
-        "Invalid parameter : polygonset" );
-      
-      ++it;
-    }
-  }
-  
-  /* Checking user histograms if available */
-  
-  if( parameters.CheckParameter< std::vector< TePDIHistogram::pointer > > ( 
-    "histograms" ) ) {
-    
-    TEAGN_TRUE_OR_RETURN( ( ! polygonset.isActive() ),
-      "Invalid parameter: histograms cannot be used when polygonset is "
-      "present" );
-    
-    std::vector< TePDIHistogram::pointer > histograms;
-    
-    TEAGN_TRUE_OR_THROW( parameters.GetParameter( "histograms", 
-      histograms ), "Invalid parameter: histograms" );
-    TEAGN_TRUE_OR_RETURN( ( histograms.size() == rasters.size() ),
-      "Invalid parameter: histograms" );
-      
-    std::vector< TePDIHistogram::pointer >::iterator it =
-      histograms.begin();
-    std::vector< TePDIHistogram::pointer >::iterator it_end =
-      histograms.end();
-      
-    while( it != it_end ) {
-      TEAGN_TRUE_OR_RETURN( ( (*it)->size() > 0 ),
-        "Invalid parameter: histograms" );    
-        
-      ++it;
-    }
-  }  
-  
-  return true;
-}
-
-
-const TePDIHistogram& TePDIStatistic::getHistogram( 
-  unsigned int raster_index,  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-  
-  std::pair< unsigned int, unsigned int  > temp_pair;
-  temp_pair.first = raster_index;
-  temp_pair.second = pol_index;
-  
-  std::map< std::pair< unsigned int, unsigned int  >,
-    TePDIHistogram::pointer >::const_iterator it_cache = 
-    histo_cache_.find( temp_pair );
-    
-  if( it_cache == histo_cache_.end() ) {
-    unsigned int histo_levels = 0; // auto levels
-    
-    if( ( rasters_[ raster_index ]->params().dataType_[ bands_[ raster_index ] ]
-      == TeFLOAT ) ||
-      ( rasters_[ raster_index ]->params().dataType_[ bands_[ raster_index ] ]
-      == TeDOUBLE ) ) 
-    {
-      histo_levels = 256;
-    }
-        
-    TePDITypes::TePDIPolygonSetPtrType local_polygonset( new TePolygonSet );
-    local_polygonset->add( polygonset_->operator[]( pol_index ) );
-    
-    TePDIHistogram::pointer output_histogram;
-    output_histogram.reset( new TePDIHistogram );
-    output_histogram->ToggleProgressInt(progress_enabled_);
-    
-    TEAGN_TRUE_OR_THROW( output_histogram->reset( 
-      rasters_[ raster_index ],
-      bands_[ raster_index ], histo_levels, false, iterator_strat_,
-      local_polygonset ),
-      "Histogram generation error" );
-      
-    histo_cache_[ temp_pair ] = output_histogram;
-      
-    return *(histo_cache_[ temp_pair ]);
-  } else {
-    return *(it_cache->second);
-  }
-}
-
-const TePDIJointHistogram& TePDIStatistic::getJointHistogram( 
-  unsigned int raster1_index, unsigned int raster2_index,
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster1_index < rasters_.size(), 
-    "Invalid raster 1 index" );
-  TEAGN_TRUE_OR_THROW( raster2_index < rasters_.size(), 
-    "Invalid raster 2 index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-  
-  CoupleRasterCachesKeyT temp_pair;
-  temp_pair.first = raster1_index;
-  temp_pair.second.first = raster2_index;
-  temp_pair.second.second = pol_index;
-  
-  std::map< CoupleRasterCachesKeyT, TePDIJointHistogram* >::iterator it_cache = 
-    jHistoCache_.find( temp_pair );
-    
-  if( it_cache == jHistoCache_.end() ) {
-    unsigned int histo_levels = 0; // auto levels
-    
-    if( ( rasters_[ raster1_index ]->params().dataType_[ bands_[ raster1_index ] ]
-      == TeFLOAT ) ||
-      ( rasters_[ raster1_index ]->params().dataType_[ bands_[ raster1_index ] ]
-      == TeDOUBLE ) ||
-      ( rasters_[ raster2_index ]->params().dataType_[ bands_[ raster2_index ] ]
-      == TeFLOAT ) ||
-      ( rasters_[ raster2_index ]->params().dataType_[ bands_[ raster2_index ] ]
-      == TeDOUBLE ) ) 
-    {
-      histo_levels = 256;
-    }
-      
-    TePolygonSet local_polygonset;
-    local_polygonset.add( polygonset_->operator[]( pol_index ) );
-
-    TePDIJointHistogram* newR1R2HistoPtr = new TePDIJointHistogram;
-    newR1R2HistoPtr->toggleProgress( progress_enabled_ );
-      
-    TEAGN_TRUE_OR_THROW( newR1R2HistoPtr->update( *rasters_[ raster1_index ],
-      bands_[ raster1_index ], *rasters_[ raster2_index ],
-      bands_[ raster2_index ], iterator_strat_, histo_levels, local_polygonset ),
-      "Joint Histogram generation error" );
-        
-    jHistoCache_[ temp_pair ] = newR1R2HistoPtr;
-
-    // Updating each raster histogram cache too
-
-    TePDIHistogram::pointer r1HistPtr( new TePDIHistogram );
-    *r1HistPtr = newR1R2HistoPtr->getRaster1Hist();
-    SingleRasterCachesKeyT r1key;
-    r1key.first = raster1_index;
-    r1key.second = pol_index;
-    histo_cache_[ r1key ] = r1HistPtr;
-
-    TePDIHistogram::pointer r2HistPtr( new TePDIHistogram );
-    *r2HistPtr = newR1R2HistoPtr->getRaster2Hist();
-    SingleRasterCachesKeyT r2key;
-    r2key.first = raster2_index;
-    r2key.second = pol_index;
-    histo_cache_[ r2key ] = r2HistPtr;
-    
-    // Generating the joint histogram of raster2 x raster1 using the
-    // joint histogram of raster1 x raster 2
-
-    TePDIJointHistogram* newR2R1HistoPtr = new TePDIJointHistogram;
-    newR1R2HistoPtr->getInverseJHist( *newR2R1HistoPtr );
-    
-    CoupleRasterCachesKeyT inv_temp_pair;
-    inv_temp_pair.first = raster2_index;
-    inv_temp_pair.second.first = raster1_index;
-    inv_temp_pair.second.second = pol_index;
-    
-    jHistoCache_[ inv_temp_pair ] = newR2R1HistoPtr;    
-      
-    return *newR1R2HistoPtr;
-  } else {
-    return *(it_cache->second);
-  }
-}
-
-double TePDIStatistic::getSum( unsigned int raster_index,
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-  
-  const TePDIHistogram& hist = getHistogram( raster_index, 
-    pol_index );
-    
-  if( hist.size() == 0 )
-  {
-    return DBL_MAX;
-  }
-  else
-  {
-    TePDIHistogram::const_iterator it_hist = hist.begin();
-    TePDIHistogram::const_iterator it_hist_end = hist.end();
-     
-    double result = 0;
-          
-    while( it_hist != it_hist_end ) {
-      result += it_hist->first * (double)it_hist->second;
-          
-      ++it_hist;
-    }
-          
-    return result;
-  }
-}
-
-
-double TePDIStatistic::getSum3( unsigned int raster_index, 
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-    
-  const TePDIHistogram& hist = getHistogram( raster_index, 
-    pol_index );
-    
-  if( hist.size() == 0 )
-  {
-    return DBL_MAX;
-  }
-  else
-  {  
-    TePDIHistogram::const_iterator it = hist.begin();
-    TePDIHistogram::const_iterator it_end = hist.end();
-    
-    double sum = 0;
-    double value = 0;
-      
-    while( it != it_end ) {
-      value = it->first;
-      
-      sum += ( value * value * value * ( ( double ) it->second ) );
-      
-      ++it;
-    }
-    
-    return sum;     
-  }
-}
-
-
-double TePDIStatistic::getSum4( unsigned int raster_index, 
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-    
-  const TePDIHistogram& hist = getHistogram( raster_index, 
-    pol_index );
-    
-  if( hist.size() == 0 )
-  {
-    return DBL_MAX;
-  }
-  else
-  {  
-    TePDIHistogram::const_iterator it = hist.begin();
-    TePDIHistogram::const_iterator it_end = hist.end();
-    
-    double sum = 0;
-    double value = 0;
-      
-    while( it != it_end ) {
-      value = it->first;
-      
-      sum += ( value * value * value * value * ( ( double ) it->second ) );
-      
-      ++it;
-    }
-    
-    return sum;  
-  }
-}
-
-double TePDIStatistic::getSumPB1B2( unsigned int raster1_index,
-  unsigned int raster2_index, unsigned int pol_index )
-{
-  const TePDIJointHistogram& jHisto = getJointHistogram( raster1_index,
-    raster2_index, pol_index );
-
-  TePDIJointHistogram::const_iterator it = jHisto.begin();
-  TePDIJointHistogram::const_iterator it_end = jHisto.end();
-
-  double sum = 0;
-
-  while( it != it_end )
-  {
-    sum += ( it->first.first * it->first.second ) * (double)it->second;
-    ++it;
-  }
-
-  return sum;
-}
-
-
-double TePDIStatistic::getMean( unsigned int raster_index, 
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), "Invalid index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
-  
-  /* Trying to use the histogram method */
-  
-  const TePDIHistogram& hist = getHistogram( raster_index, 
-    pol_index );
-    
-  if( hist.size() == 0 )
-  {
-    return DBL_MAX;
-  }
-  else
-  {    
-    TePDIHistogram::const_iterator it_hist = hist.begin();
-    TePDIHistogram::const_iterator it_hist_end = hist.end();
-     
-    double sum = 0;
-    double elem_nmb = 0.0;
-          
-    while( it_hist != it_hist_end ) {
-      sum += it_hist->first * ( (double)it_hist->second );
-      elem_nmb += (double)it_hist->second;
-          
-      ++it_hist;
-    }
-        
-    if( elem_nmb != 0.0 ) {
-      return ( sum / ( (double)elem_nmb ) ) ;
-    } else {
-      return DBL_MAX;
-    }
-  }
-}
-
-
-TeMatrix TePDIStatistic::getMeanMatrix( unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
-
-  TeMatrix outmatrix;
-  outmatrix.Init( 1, rasters_.size(), 0. );
-
-  for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
-    outmatrix( 0, index ) = getMean( index, pol_index );
-  }
-
-  return outmatrix;
-}
-
-
-double TePDIStatistic::getCovariance( unsigned int raster1_index,  
-  unsigned int raster2_index, unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster1_index < rasters_.size(), 
-    "Invalid raster 1 index" );
-  TEAGN_TRUE_OR_THROW( raster2_index < rasters_.size(), 
-    "Invalid raster 2 index" );    
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-    
-  double sum_pb1b2 = getSumPB1B2( raster1_index, raster2_index, pol_index );
-  double mean1 = getMean( raster1_index );
-  double mean2 = getMean( raster2_index );  
-  
-  if( ( sum_pb1b2 == DBL_MAX ) || ( mean1 == DBL_MAX ) ||
-    ( mean2 == DBL_MAX) )
-  {
-    return DBL_MAX;
-  }
-  
-  /* Finding the elements number */
-  
-  double elem_nmb = (double)getJointHistogram( raster1_index, 
-    raster2_index, pol_index ).getFreqSum();
-  
-  if( elem_nmb != 0.0 ) {
-    return ( ( sum_pb1b2 / elem_nmb ) - ( mean1 * mean2 ) );
-  } else {
-    return DBL_MAX;
-  }
-}
-
-
-double TePDIStatistic::getVariance( unsigned int raster_index,
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-    
-  const TePDIHistogram& hist = getHistogram( raster_index, 
-    pol_index );
-    
-  double elements_number = (double)hist.getTotalCount();    
-  
-  if( elements_number == 0.0 ) {
-    return DBL_MAX;
-  } else {
-    /* Calculating variance */
-      
-    TePDIHistogram::const_iterator it_hist = hist.begin();
-    TePDIHistogram::const_iterator it_hist_end = hist.end();
-    
-    double mean = getMean( raster_index, pol_index );
-    double variance = 0;
-    
-    while( it_hist != it_hist_end ) {
-      variance += ( ( (double)it_hist->second ) / elements_number ) *
-        ( it_hist->first - mean ) * ( it_hist->first - mean );
-      
-      ++it_hist;
-    }
-    
-    return variance;  
-  }
-}
-
-
-double TePDIStatistic::getStdDev( unsigned int raster_index,
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-    
-  double variance = getVariance( raster_index, pol_index );
-    
-  if( variance == DBL_MAX )
-  {
-    return DBL_MAX;
-  }
-  else
-  {
-    return sqrt( variance );
-  }
-}
-
-
-double TePDIStatistic::getEntropy( unsigned int raster_index,
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-
-  const TePDIHistogram& hist = getHistogram( raster_index, 
-    pol_index );
-  
-  double elements_number = (double)hist.getTotalCount();
-  
-  if( elements_number == 0.0 ) {
-    return DBL_MAX;
-  }  
-  
-  /* Calculating entropy */
-    
-  TePDIHistogram::const_iterator it = hist.begin();
-  TePDIHistogram::const_iterator it_end = hist.end();
-  
-  double entropy = 0;
-  double probability = 0;
-  
-  while( it != it_end ) {
-    probability = ( (double)(it->second) ) / elements_number;
-    
-    if( probability > 0.0 ) {
-      entropy += ( probability * ( log( probability ) /
-        log( (double)2 ) ) );
-    }
-
-    ++it;
-  }
-  
-  entropy = (-1.0) * entropy;
-
-  return entropy;
-}
-
-
-double TePDIStatistic::getMin( unsigned int raster_index,
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-  
-  const TePDIHistogram& hist = getHistogram( raster_index, 
-    pol_index );
-    
-  if( hist.size() == 0 )
-  {
-    return DBL_MAX;
-  }
-  else
-  {
-    return hist.GetMinLevel();
-  }
-}
-
-
-double TePDIStatistic::getMax( unsigned int raster_index,
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-  
-  const TePDIHistogram& hist = getHistogram( raster_index, 
-    pol_index );
-    
-  if( hist.size() == 0 )
-  {
-    return DBL_MAX;
-  }
-  else
-  {
-    return hist.GetMaxLevel();
-  }
-}
-
-
-double TePDIStatistic::getMode( unsigned int raster_index,
-  unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-  
-  const TePDIHistogram& hist = getHistogram( raster_index, pol_index );
-  
-  if( hist.size() == 0 )
-  {
-    return DBL_MAX;
-  }
-  else
-  {
-    TePDIHistogram::const_iterator it_hist = hist.begin();
-    TePDIHistogram::const_iterator it_hist_end = hist.end();
-    
-    unsigned int frequency = 0;
-    double mode = 0;
-    
-    while( it_hist != it_hist_end ) {
-      if( it_hist->second > frequency ) {
-        mode = it_hist->first;
-        frequency = it_hist->second;
-      }
-      
-      ++it_hist;
-    }
-    
-    return mode;
-  }
-}
-
-
-double TePDIStatistic::getCorrelation( unsigned int raster1_index,  
-  unsigned int raster2_index, unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( raster1_index < rasters_.size(), 
-    "Invalid raster 1 index" );
-  TEAGN_TRUE_OR_THROW( raster2_index < rasters_.size(), 
-    "Invalid raster 2 index" );    
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
-    "Invalid polygon index" );
-    
-  double covariance = getCovariance( raster1_index, raster2_index, 
-    pol_index );
-    
-  if( covariance == DBL_MAX )
-  {
-    return DBL_MAX;
-  }
-  else
-  {
-    double cov1 = getCovariance( raster1_index, raster1_index, 
-      pol_index );
-    double cov2 = getCovariance( raster2_index, raster2_index, 
-      pol_index );
-      
-    if( ( cov1 == DBL_MAX ) || ( cov2 == DBL_MAX ) )
-    {
-      return DBL_MAX;
-    }
-    else
-    {
-      double sqrt_c_1 = sqrt( cov1 );
-      double sqrt_c_2 = sqrt( cov2 );
-      double multi = ( sqrt_c_1 * sqrt_c_2 );
-
-      if( multi == 0.0 ) {
-        return DBL_MAX;
-      } else {
-        return ( covariance / multi );
-      }
-    }
-  }
-}
-
-
-
-double TePDIStatistic::getPercentile( double sample_index, 
-  unsigned int raster_index, unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( ( raster_index < rasters_.size() ), 
-    "Invalid raster index" );
-  TEAGN_TRUE_OR_THROW( ( pol_index < polygonset_->size() ), 
-    "Invalid polygon index" );
-  TEAGN_TRUE_OR_THROW( ( ( sample_index >= 0.0 ) && 
-    ( sample_index <= 100.0 ) ), "Invalid sample index" );    
-  
-  const TePDIHistogram& hist = getHistogram( raster_index, pol_index );
-
-  if( hist.size() == 0 )
-  {
-    return DBL_MAX;
-  }
-  else if( hist.size() == 1 ) 
-  {
-    return hist.begin()->first;
-  } 
-  else 
-  {
-    TePDIHistogram::const_iterator it;
-    TePDIHistogram::const_iterator it_end = hist.end();
-    
-    unsigned int lastindex = hist.getTotalCount() - 1;
-    
-    double target_sample_index_double = 
-      ( (double)( lastindex ) ) * ( sample_index / 100.0 );
-    unsigned int target_sample_index_floor = 
-      (unsigned int)ceil( target_sample_index_double );
-    
-    if( target_sample_index_double == 
-      ( (double) target_sample_index_floor ) ) {
-      
-      it = hist.begin();
-      
-      unsigned int counted_elements = 0;
-      unsigned int target_index1 = target_sample_index_floor;
-      unsigned int target_index2 = ( target_index1 == lastindex ) ?
-        target_index1 : ( target_index1 + 1 );
-      double target1_value = 0;
-      double target2_value = 0;
-      unsigned int curr_index_range_bound = 0;
-      
-      while( it != it_end ) {
-        curr_index_range_bound = counted_elements + it->second;
-        
-        if( ( counted_elements <= target_index1 ) &&
-          ( target_index1 < curr_index_range_bound ) ) {
-          
-          target1_value = it->first;
-        }
-        
-        if( ( counted_elements <= target_index2 ) &&
-          ( target_index2 < curr_index_range_bound ) ) {
-          
-          target2_value = it->first;
-          
-          break;
-        }
-        
-        counted_elements += it->second;
-        
-        ++it;
-      }
-      
-      return ( ( target1_value + target2_value ) / 2.0 );
-    } else {
-      it = hist.begin();
-      
-      unsigned int counted_elements = 0;
-      unsigned int target_index1 = target_sample_index_floor + 1;
-      unsigned int curr_index_range_bound = 0;
-      
-      while( it != it_end ) {
-        curr_index_range_bound = counted_elements + it->second;
-        
-        if( ( counted_elements <= target_index1 ) &&
-          ( target_index1 < curr_index_range_bound ) ) {
-          
-          return it->first;
-        }
-        
-        counted_elements += it->second;
-        
-        ++it;
-      }
-      
-      TEAGN_LOG_AND_THROW( "Target value not found" );
-      
-      return 0;
-    }
-  }
-}
-
-TeMatrix TePDIStatistic::getCMMatrix( unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
-  
-  TeMatrix outmatrix;
-  outmatrix.Init( 3, rasters_.size(), 0. );
-
-  double sum3 = 0;
-  double sum4 = 0;
-  double mean = 0;
-  double sumpb1b2 = 0;
-  double sumpb1b2_norm = 0;
-  double pixels_nmb = 0;
-
-  for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
-    sumpb1b2 = getSumPB1B2( index, index, pol_index );
-    const TePDIHistogram& histo = getHistogram( index, pol_index );
-    
-    if( histo.size() == 0 )
-    {
-      outmatrix( 0, index ) = DBL_MAX;
-      outmatrix( 1, index ) = DBL_MAX;
-      outmatrix( 2, index ) = DBL_MAX;
-    }
-    else
-    {
-      sum3 = getSum3( index, pol_index );
-      sum4 = getSum4( index, pol_index );
-      mean = getMean( index, pol_index );
-      pixels_nmb = (double)histo.getTotalCount();
-      sumpb1b2_norm = sumpb1b2 / pixels_nmb;    
-      
-      outmatrix( 0, index ) = getCovariance( index, index, pol_index );
-
-      if( pixels_nmb == 0 ) {
-        outmatrix( 1, index ) = DBL_MAX;
-      } else {
-        outmatrix( 1, index ) = sum3 / pixels_nmb - 3 * mean * sumpb1b2_norm +
-                              2 * pow( mean, 3 );
-      }
-
-      if( pixels_nmb == 0 ) {
-        outmatrix( 2, index ) = DBL_MAX;
-      } else {
-        outmatrix( 2, index ) = sum4 / pixels_nmb - 4 * mean * sum3 / pixels_nmb +
-                              6 * pow( mean, 2 ) * sumpb1b2_norm -
-                              3 * pow( mean, 4 );
-      }
-    }
-  }
-
-  return outmatrix;
-}
-
-
-TeMatrix TePDIStatistic::getAssimetryMatrix( unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
-
-  TeMatrix outmatrix;
-  outmatrix.Init( 1, rasters_.size(), 0. );
-
-  double sum3 = 0;
-  double mean = 0;
-  double cov = 0;
-  double sigma = 0;
-  double sigma3 = 0;
-  double pixels_nmb = 0;
-  double sumpb1b2 = 0;
-  double sumpb1b2_norm = 0;  
-
-  for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
-    cov = getCovariance( index, index, pol_index );
-    const TePDIHistogram& histo = getHistogram( index, pol_index );
-    
-    if( histo.size() == 0 )
-    {
-      outmatrix( 0, index ) = DBL_MAX;
-    }
-    else
-    {
-      sigma = sqrt( cov );
-      sigma3 = sigma * sigma * sigma;
-
-      if( sigma3 != 0 ) {
-        sumpb1b2 = getSumPB1B2( index, index, pol_index );
-        sum3 = getSum3( index, pol_index );
-        mean = getMean( index, pol_index );
-        pixels_nmb = (double)histo.getTotalCount();
-        sumpb1b2_norm = sumpb1b2 / pixels_nmb;      
-        
-        if( ( pixels_nmb == 0 ) || ( sigma3 == 0 ) ) {
-          outmatrix( 0, index ) = 0;
-        } else {
-          outmatrix( 0, index ) = ( sum3 / pixels_nmb -  3 * mean * sumpb1b2_norm +
-                                  2 * pow( mean, 3 ) ) / sigma3;
-        }
-      } else {
-        outmatrix( 0, index ) = 0;
-      }
-    }
-  }
-
-  return outmatrix;
-}
-
-
-TeMatrix TePDIStatistic::getKurtosisMatrix( unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
-
-  TeMatrix outmatrix;
-  outmatrix.Init( 1, rasters_.size(), 0. );
-
-  double sum3;
-  double sum4;
-  double mean;
-  double cov;
-  double sigma;
-  double sigma4;
-  double sumpb1b2 = 0;
-  double sumpb1b2_norm = 0;
-  double pixels_nmb = 0;  
-
-  for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
-    cov = getCovariance( index, index, pol_index );
-    const TePDIHistogram& histo = getHistogram( index, pol_index );
-    
-    if( histo.size() == 0 )
-    {
-      outmatrix( 0, index ) = DBL_MAX;
-    }
-    else
-    {
-      sigma = sqrt( cov );
-      sigma4 = sigma * sigma * sigma * sigma;
-
-      if( sigma4 != 0 ) {
-        sumpb1b2 = getSumPB1B2( index, index, pol_index );
-        sum3 = getSum3( index, pol_index );
-        sum4 = getSum4( index, pol_index );
-        mean = getMean( index, pol_index );
-        pixels_nmb = (double)histo.getTotalCount();
-        sumpb1b2_norm = sumpb1b2 / pixels_nmb;
-        
-        if( pixels_nmb == 0 ) {
-          outmatrix( 0, index ) = DBL_MAX;
-        } else {
-          outmatrix( 0, index ) = ( sum4 / pixels_nmb - 4 * mean * sum3 /
-            pixels_nmb  + 6 * pow( mean, 2 ) * sumpb1b2_norm - 3 * pow( mean, 4 ) ) /
-            sigma4 - 3.;
-        }
-      } else {
-        outmatrix( 0, index ) = DBL_MAX;
-      }
-    }
-  }
-
-  return outmatrix;
-}
-
-
-TeMatrix TePDIStatistic::getVarCoefMatrix( unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
-  
-  TeMatrix outmatrix;
-  outmatrix.Init( 1, rasters_.size(), 0. );
-
-  double mean = 0.0;
-  double cov = 0.0;
-
-  for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
-    mean = getMean( index, pol_index );
-
-    if( mean == DBL_MAX ) 
-    {
-      outmatrix( 0, index ) = DBL_MAX;
-    }
-    else if( mean == 0 ) 
-    {
-      outmatrix( 0, index ) = DBL_MAX;
-    }
-    else
-    {
-      cov = getCovariance( index, index, pol_index );
-      
-      if( cov == DBL_MAX )
-      {
-        outmatrix( 0, index ) = DBL_MAX;
-      }
-      else
-      {
-        outmatrix( 0, index ) = sqrt(
-          getCovariance( index, index, pol_index ) ) / mean;
-      }
-    }
-  }
-
-  return outmatrix;
-}
-
-
-TeMatrix TePDIStatistic::getCovMatrix( unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
-  
-  TeMatrix outmatrix;
-  outmatrix.Init( rasters_.size(), rasters_.size(), 0. );
-
-  for( unsigned int band1 = 0 ; band1 < rasters_.size() ; ++band1 ) {
-    for( unsigned int band2 = 0 ; band2 < rasters_.size() ; ++band2 ) {
-      outmatrix( band1, band2 ) = 
-        getCovariance( band1, band2, pol_index );
-    }
-  }
-
-  return outmatrix;
-}
-
-
-TeMatrix TePDIStatistic::getCorMatrix( unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
-  
-  TeMatrix outmatrix;
-  outmatrix.Init( rasters_.size(), rasters_.size(), 0. );
-
-  for( unsigned int band1 = 0 ; band1 < rasters_.size() ; ++band1 ) {
-    for( unsigned int band2 = 0 ; band2 < rasters_.size() ; ++band2 ) {
-      outmatrix( band1, band2 ) = 
-        getCorrelation( band1, band2, pol_index );
-    }
-  }
-
-  return outmatrix;
-}
-
-
-TeMatrix TePDIStatistic::getVarMatrix( unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
-  
-  TeMatrix outmatrix;
-  outmatrix.Init( rasters_.size(), 1, 0. );
-
-  for( unsigned int band = 0 ; band < rasters_.size() ; ++band ) {
-    outmatrix( band, 0 ) = getVariance( band, pol_index );
-  }
-
-  return outmatrix;
-}
-
-TeMatrix TePDIStatistic::getStdDevMatrix( unsigned int pol_index )
-{
-  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
-  
-  TeMatrix outmatrix;
-  outmatrix.Init( rasters_.size(), 1, 0. );
-
-  for( unsigned int band = 0 ; band < rasters_.size() ; ++band ) {
-    outmatrix( band, 0 ) = getStdDev( band, pol_index );
-  }
-
-  return outmatrix;
-}
-
-void TePDIStatistic::clear()
-{
-  polygonset_.reset();
-  rasters_.clear();
-  bands_.clear();
-
-  std::map< CoupleRasterCachesKeyT, TePDIJointHistogram* >::iterator jhcit =
-    jHistoCache_.begin();
-  while( jhcit != jHistoCache_.end() )
-  {
-    delete jhcit->second;
-    ++jhcit;
-  }
-  jHistoCache_.clear();
-
-  histo_cache_.clear();
-}
-
-
+#include "TePDIStatistic.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+
+#include <TeUtils.h>
+#include <TeBox.h>
+#include <TeGeometryAlgorithms.h>
+
+#include <math.h>
+#include <float.h>
+
+
+TePDIStatistic::TePDIStatistic()
+{
+  iterator_strat_ = TeBoxPixelIn;
+  
+  polygonset_.reset( new TePolygonSet );
+}
+
+
+TePDIStatistic::~TePDIStatistic()
+{
+  clear();
+}
+
+
+void TePDIStatistic::ResetState( const TePDIParameters& params )
+{
+  if( params_ != params ) {
+    clear();
+    
+    /* Updating the iterator strategy ( if available ) */
+    
+    if( params.CheckParameter< TeStrategicIterator > ( 
+      "iterator_strat" ) ) {    
+      
+      params.GetParameter( "iterator_strat", iterator_strat_ );   
+    }
+    
+    
+    /* Extracting parameters */
+    
+    TEAGN_TRUE_OR_THROW( 
+      params.GetParameter( "rasters", rasters_ ),
+      "Missing parameter: rasters" );
+    
+    TEAGN_TRUE_OR_THROW( 
+      params.GetParameter( "bands", bands_ ),
+      "Missing parameter: bands" );     
+    
+    /* updating the local polygon set pointer */
+    
+    if( params.CheckParameter< TePDITypes::TePDIPolygonSetPtrType > ( 
+      "polygonset" ) ) {
+      
+      params.GetParameter( "polygonset", polygonset_ );
+    } else {
+      polygonset_.reset( new TePolygonSet );
+      
+      TeBox rasterbox = rasters_[ 0 ]->params().boundingBox();
+      TePolygon rasterpol = polygonFromBox( rasterbox );
+      
+      polygonset_->add( rasterpol );
+    }
+    
+    /* Building histogram cache if histograms are provided */
+  
+    if( params.CheckParameter< std::vector< TePDIHistogram::pointer > >( 
+      "histograms" ) ) {
+      
+      std::vector< TePDIHistogram::pointer > histograms;
+      TEAGN_TRUE_OR_THROW( params.GetParameter( "histograms", 
+        histograms ), "Missing parameter: histograms" );
+      TePDIHistogram* histoPtr = 0;
+        
+      for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) 
+      {
+        SingleRasterCachesKeyT key;
+        key.first = index;
+        key.second = 0;
+        
+        histoPtr = new TePDIHistogram;
+        (*histoPtr) = (*histograms[ index ]);
+      
+        histo_cache_[ key ] = histoPtr;
+      }
+    }
+  }
+}
+
+
+bool TePDIStatistic::RunImplementation()
+{
+  TEAGN_LOG_AND_THROW( "This function cannot be used for this class" );
+  return false;
+}
+
+
+bool TePDIStatistic::CheckParameters( 
+  const TePDIParameters& parameters ) const
+{
+  /* Checking input rasters */
+  
+  TePDITypes::TePDIRasterVectorType rasters;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "rasters", rasters ),
+    "Missing parameter: rasters" );
+    
+  std::vector< int > bands;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "bands", bands ),
+    "Missing parameter: bands" );
+    
+  TEAGN_TRUE_OR_RETURN( rasters.size() == bands.size(),
+    "The number of rasters doesn't match the number of bands" );
+    
+  TEAGN_TRUE_OR_RETURN( rasters.size() > 0, "Invalid number of rasters" );
+    
+  for( unsigned int index = 0 ; index < rasters.size() ; ++index ) {
+    TEAGN_TRUE_OR_RETURN( rasters[ index ].isActive(),
+      "Invalid parameter: raster " + 
+      Te2String( index ) + " inactive" );
+      
+    TEAGN_TRUE_OR_RETURN( 
+      rasters[ index ]->params().status_ != TeRasterParams::TeNotReady,
+      "Invalid parameter: raster " + 
+      Te2String( index ) + " not ready" );
+            
+    TEAGN_TRUE_OR_RETURN( 
+      bands[ index ] >= 0, "Invalid band number (" + 
+      Te2String( index ) + ")" );
+    TEAGN_TRUE_OR_RETURN( 
+      bands[ index ] < rasters[ index ]->nBands(), "Invalid band number (" + 
+      Te2String( index ) + ")" );
+      
+    /* Checking photometric interpretation */
+    
+    TEAGN_TRUE_OR_RETURN( ( 
+      ( rasters[ index ]->params().photometric_[ 
+        bands[ index ] ] == TeRasterParams::TeRGB ) ||
+      ( rasters[ index ]->params().photometric_[ 
+        bands[ index ] ] == TeRasterParams::TeMultiBand ) ),
+      "Invalid parameter - rasters (invalid photometric "
+      "interpretation)" );      
+  }
+  
+  /* Checking the restriction polygon set if avaliable */
+  
+  TePDITypes::TePDIPolygonSetPtrType polygonset;  
+  
+  if( parameters.CheckParameter< TePDITypes::TePDIPolygonSetPtrType >( 
+    "polygonset" ) ) {
+    
+    parameters.GetParameter( "polygonset", polygonset );
+    
+    TEAGN_TRUE_OR_RETURN( polygonset.isActive(), 
+      "Invalid parameter : polygonset" );
+      
+    TEAGN_TRUE_OR_RETURN( ( polygonset->size() > 0 ), 
+      "Invalid parameter : polygonset" );      
+      
+    TeBox rasterbbox = rasters[ 0 ]->params().boundingBox();
+    TePolygon raster_bpol = polygonFromBox( rasterbbox );
+    
+    TePolygonSet::iterator it = polygonset->begin();
+    TePolygonSet::iterator it_end = polygonset->end();
+    
+    while( it != it_end ) {
+      TEAGN_TRUE_OR_RETURN( 
+        ( TeRelation( raster_bpol, *it ) != TeDISJOINT ),
+        "Invalid parameter : polygonset" );
+      
+      ++it;
+    }
+  }
+  
+  /* Checking user histograms if available */
+  
+  if( parameters.CheckParameter< std::vector< TePDIHistogram::pointer > > ( 
+    "histograms" ) ) {
+    
+    TEAGN_TRUE_OR_RETURN( ( ! polygonset.isActive() ),
+      "Invalid parameter: histograms cannot be used when polygonset is "
+      "present" );
+    
+    std::vector< TePDIHistogram::pointer > histograms;
+    
+    TEAGN_TRUE_OR_THROW( parameters.GetParameter( "histograms", 
+      histograms ), "Invalid parameter: histograms" );
+    TEAGN_TRUE_OR_RETURN( ( histograms.size() == rasters.size() ),
+      "Invalid parameter: histograms" );
+      
+    std::vector< TePDIHistogram::pointer >::iterator it =
+      histograms.begin();
+    std::vector< TePDIHistogram::pointer >::iterator it_end =
+      histograms.end();
+      
+    while( it != it_end ) {
+      TEAGN_TRUE_OR_RETURN( ( (*it)->size() > 0 ),
+        "Invalid parameter: histograms" );    
+        
+      ++it;
+    }
+  }  
+  
+  return true;
+}
+
+
+const TePDIHistogram& TePDIStatistic::getHistogram( 
+  unsigned int raster_index,  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+  
+  std::pair< unsigned int, unsigned int  > temp_pair;
+  temp_pair.first = raster_index;
+  temp_pair.second = pol_index;
+  
+  HistoCacheT::const_iterator it_cache = 
+    histo_cache_.find( temp_pair );
+    
+  if( it_cache == histo_cache_.end() ) {
+    unsigned int histo_levels = 0; // auto levels
+    
+    if( ( rasters_[ raster_index ]->params().dataType_[ bands_[ raster_index ] ]
+      == TeFLOAT ) ||
+      ( rasters_[ raster_index ]->params().dataType_[ bands_[ raster_index ] ]
+      == TeDOUBLE ) ) 
+    {
+      histo_levels = 256;
+    }
+        
+    TePDITypes::TePDIPolygonSetPtrType local_polygonset( new TePolygonSet );
+    local_polygonset->add( polygonset_->operator[]( pol_index ) );
+    
+    TePDIHistogram* output_histogram = new TePDIHistogram;
+    output_histogram->ToggleProgressInt(progress_enabled_);
+    
+    TEAGN_TRUE_OR_LOG( output_histogram->reset( 
+      rasters_[ raster_index ],
+      bands_[ raster_index ], histo_levels, iterator_strat_,
+      local_polygonset ),
+      "Histogram generation error" );
+      
+    histo_cache_[ temp_pair ] = output_histogram;
+      
+    return *(histo_cache_[ temp_pair ]);
+  } else {
+    return *(it_cache->second);
+  }
+}
+
+const TePDIJointHistogram& TePDIStatistic::getJointHistogram( 
+  unsigned int raster1_index, unsigned int raster2_index,
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster1_index < rasters_.size(), 
+    "Invalid raster 1 index" );
+  TEAGN_TRUE_OR_THROW( raster2_index < rasters_.size(), 
+    "Invalid raster 2 index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+  
+  CoupleRasterCachesKeyT temp_pair;
+  temp_pair.first = raster1_index;
+  temp_pair.second.first = raster2_index;
+  temp_pair.second.second = pol_index;
+  
+  JHistoCacheT::iterator it_cache = jHistoCache_.find( temp_pair );
+    
+  if( it_cache == jHistoCache_.end() ) 
+  {
+    // Cleaning the inverse histogram if it exists */
+    
+    CoupleRasterCachesKeyT inv_temp_pair;
+    inv_temp_pair.first = raster2_index;
+    inv_temp_pair.second.first = raster1_index;
+    inv_temp_pair.second.second = pol_index;  
+    
+    if( jHistoCache_[ inv_temp_pair ] ) 
+      delete jHistoCache_[ inv_temp_pair ];
+      
+    // Generating the joint histogram
+  
+    unsigned int histo_levels = 0; // auto levels
+    
+    if( ( rasters_[ raster1_index ]->params().dataType_[ bands_[ raster1_index ] ]
+      == TeFLOAT ) ||
+      ( rasters_[ raster1_index ]->params().dataType_[ bands_[ raster1_index ] ]
+      == TeDOUBLE ) ||
+      ( rasters_[ raster2_index ]->params().dataType_[ bands_[ raster2_index ] ]
+      == TeFLOAT ) ||
+      ( rasters_[ raster2_index ]->params().dataType_[ bands_[ raster2_index ] ]
+      == TeDOUBLE ) ) 
+    {
+      histo_levels = 256;
+    }
+      
+    TePolygonSet local_polygonset;
+    local_polygonset.add( polygonset_->operator[]( pol_index ) );
+
+    TePDIJointHistogram* newR1R2HistoPtr = new TePDIJointHistogram;
+    newR1R2HistoPtr->toggleProgress( progress_enabled_ );
+      
+    TEAGN_TRUE_OR_LOG( newR1R2HistoPtr->update( *rasters_[ raster1_index ],
+      bands_[ raster1_index ], *rasters_[ raster2_index ],
+      bands_[ raster2_index ], iterator_strat_, histo_levels, local_polygonset ),
+      "Joint Histogram generation error" );
+        
+    jHistoCache_[ temp_pair ] = newR1R2HistoPtr;
+
+    // Updating each raster histogram cache too
+
+    TePDIHistogram* r1HistPtr = new TePDIHistogram;
+    *r1HistPtr = newR1R2HistoPtr->getRaster1Hist();
+    SingleRasterCachesKeyT r1key;
+    r1key.first = raster1_index;
+    r1key.second = pol_index;
+    if( histo_cache_[ r1key ] != 0 ) delete histo_cache_[ r1key ];
+    histo_cache_[ r1key ] = r1HistPtr;
+
+    TePDIHistogram* r2HistPtr( new TePDIHistogram );
+    *r2HistPtr = newR1R2HistoPtr->getRaster2Hist();
+    SingleRasterCachesKeyT r2key;
+    r2key.first = raster2_index;
+    r2key.second = pol_index;
+    if( histo_cache_[ r2key ] != 0 ) delete histo_cache_[ r2key ];
+    histo_cache_[ r2key ] = r2HistPtr;
+    
+    // Generating the joint histogram of raster2 x raster1 using the
+    // joint histogram of raster1 x raster 2
+
+    TePDIJointHistogram* newR2R1HistoPtr = new TePDIJointHistogram;
+    newR1R2HistoPtr->getInverseJHist( *newR2R1HistoPtr );
+    
+    jHistoCache_[ inv_temp_pair ] = newR2R1HistoPtr;    
+      
+    return *newR1R2HistoPtr;
+  } else {
+    return *(it_cache->second);
+  }
+}
+
+double TePDIStatistic::getSum( unsigned int raster_index,
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+  
+  const TePDIHistogram& hist = getHistogram( raster_index, 
+    pol_index );
+    
+  if( hist.size() == 0 )
+  {
+    return DBL_MAX;
+  }
+  else
+  {
+    TePDIHistogram::const_iterator it_hist = hist.begin();
+    TePDIHistogram::const_iterator it_hist_end = hist.end();
+     
+    double result = 0;
+          
+    while( it_hist != it_hist_end ) {
+      result += it_hist->first * (double)it_hist->second;
+          
+      ++it_hist;
+    }
+          
+    return result;
+  }
+}
+
+
+double TePDIStatistic::getSum3( unsigned int raster_index, 
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+    
+  const TePDIHistogram& hist = getHistogram( raster_index, 
+    pol_index );
+    
+  if( hist.size() == 0 )
+  {
+    return DBL_MAX;
+  }
+  else
+  {  
+    TePDIHistogram::const_iterator it = hist.begin();
+    TePDIHistogram::const_iterator it_end = hist.end();
+    
+    double sum = 0;
+    double value = 0;
+      
+    while( it != it_end ) {
+      value = it->first;
+      
+      sum += ( value * value * value * ( ( double ) it->second ) );
+      
+      ++it;
+    }
+    
+    return sum;     
+  }
+}
+
+
+double TePDIStatistic::getSum4( unsigned int raster_index, 
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+    
+  const TePDIHistogram& hist = getHistogram( raster_index, 
+    pol_index );
+    
+  if( hist.size() == 0 )
+  {
+    return DBL_MAX;
+  }
+  else
+  {  
+    TePDIHistogram::const_iterator it = hist.begin();
+    TePDIHistogram::const_iterator it_end = hist.end();
+    
+    double sum = 0;
+    double value = 0;
+      
+    while( it != it_end ) {
+      value = it->first;
+      
+      sum += ( value * value * value * value * ( ( double ) it->second ) );
+      
+      ++it;
+    }
+    
+    return sum;  
+  }
+}
+
+double TePDIStatistic::getSumPB1B2( unsigned int raster1_index,
+  unsigned int raster2_index, unsigned int pol_index )
+{
+  const TePDIJointHistogram& jHisto = getJointHistogram( raster1_index,
+    raster2_index, pol_index );
+
+  TePDIJointHistogram::const_iterator it = jHisto.begin();
+  TePDIJointHistogram::const_iterator it_end = jHisto.end();
+
+  double sum = 0;
+
+  while( it != it_end )
+  {
+    sum += ( it->first.first * it->first.second ) * (double)it->second;
+    ++it;
+  }
+
+  return sum;
+}
+
+
+double TePDIStatistic::getMean( unsigned int raster_index, 
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), "Invalid index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
+  
+  /* Trying to use the histogram method */
+  
+  const TePDIHistogram& hist = getHistogram( raster_index, 
+    pol_index );
+    
+  if( hist.size() == 0 )
+  {
+    return DBL_MAX;
+  }
+  else
+  {    
+    TePDIHistogram::const_iterator it_hist = hist.begin();
+    TePDIHistogram::const_iterator it_hist_end = hist.end();
+     
+    double sum = 0;
+    double elem_nmb = 0.0;
+          
+    while( it_hist != it_hist_end ) {
+      sum += it_hist->first * ( (double)it_hist->second );
+      elem_nmb += (double)it_hist->second;
+          
+      ++it_hist;
+    }
+        
+    if( elem_nmb != 0.0 ) {
+      return ( sum / ( (double)elem_nmb ) ) ;
+    } else {
+      return DBL_MAX;
+    }
+  }
+}
+
+
+TeMatrix TePDIStatistic::getMeanMatrix( unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
+
+  TeMatrix outmatrix;
+  outmatrix.Init( 1, rasters_.size(), 0. );
+
+  for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
+    outmatrix( 0, index ) = getMean( index, pol_index );
+  }
+
+  return outmatrix;
+}
+
+
+double TePDIStatistic::getCovariance( unsigned int raster1_index,  
+  unsigned int raster2_index, unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster1_index < rasters_.size(), 
+    "Invalid raster 1 index" );
+  TEAGN_TRUE_OR_THROW( raster2_index < rasters_.size(), 
+    "Invalid raster 2 index" );    
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+    
+  const TePDIJointHistogram& jHist = getJointHistogram( raster1_index, 
+    raster2_index, pol_index );
+    
+  double mean1 = getMean( raster1_index );
+  double mean2 = getMean( raster2_index );  
+  
+  if( ( mean1 == DBL_MAX ) || ( mean2 == DBL_MAX) )
+  {
+    return DBL_MAX;
+  }
+    
+  /* Finding the elements number */
+  
+  double elem_nmb = (double)jHist.getFreqSum();
+  
+  if( elem_nmb != 0.0 ) 
+  {
+    double covariance = 0;  
+    TePDIJointHistogram::const_iterator jHIt = jHist.begin();
+    TePDIJointHistogram::const_iterator jHItEnd = jHist.end();
+    
+    while( jHIt != jHItEnd )
+    {
+      if( jHIt->second )
+      {
+        covariance += ( ( jHIt->first.first - mean1 ) *
+          ( jHIt->first.second - mean2 ) *
+          ( (double)jHIt->second ) );
+      }
+      
+      ++jHIt;
+    }
+    
+    covariance /= elem_nmb;
+    
+    return covariance;
+  } 
+  else 
+  {
+    return DBL_MAX;
+  }
+}
+
+
+double TePDIStatistic::getVariance( unsigned int raster_index,
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+    
+  const TePDIHistogram& hist = getHistogram( raster_index, 
+    pol_index );
+    
+  double elements_number = (double)hist.getTotalCount();    
+  
+  if( elements_number == 0.0 ) {
+    return DBL_MAX;
+  } else {
+    /* Calculating variance */
+      
+    TePDIHistogram::const_iterator it_hist = hist.begin();
+    TePDIHistogram::const_iterator it_hist_end = hist.end();
+    
+    double mean = getMean( raster_index, pol_index );
+    double variance = 0;
+    
+    while( it_hist != it_hist_end ) {
+      variance += ( ( (double)it_hist->second ) / elements_number ) *
+        ( it_hist->first - mean ) * ( it_hist->first - mean );
+      
+      ++it_hist;
+    }
+    
+    return variance;  
+  }
+}
+
+
+double TePDIStatistic::getStdDev( unsigned int raster_index,
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+    
+  double variance = getVariance( raster_index, pol_index );
+    
+  if( variance == DBL_MAX )
+  {
+    return DBL_MAX;
+  }
+  else
+  {
+    return sqrt( variance );
+  }
+}
+
+
+double TePDIStatistic::getEntropy( unsigned int raster_index,
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+
+  const TePDIHistogram& hist = getHistogram( raster_index, 
+    pol_index );
+  
+  double elements_number = (double)hist.getTotalCount();
+  
+  if( elements_number == 0.0 ) {
+    return DBL_MAX;
+  }  
+  
+  /* Calculating entropy */
+    
+  TePDIHistogram::const_iterator it = hist.begin();
+  TePDIHistogram::const_iterator it_end = hist.end();
+  
+  double entropy = 0;
+  double probability = 0;
+  
+  while( it != it_end ) {
+    probability = ( (double)(it->second) ) / elements_number;
+    
+    if( probability > 0.0 ) {
+      entropy += ( probability * ( log( probability ) /
+        log( (double)2 ) ) );
+    }
+
+    ++it;
+  }
+  
+  entropy = (-1.0) * entropy;
+
+  return entropy;
+}
+
+
+double TePDIStatistic::getMin( unsigned int raster_index,
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+  
+  const TePDIHistogram& hist = getHistogram( raster_index, 
+    pol_index );
+    
+  if( hist.size() == 0 )
+  {
+    return DBL_MAX;
+  }
+  else
+  {
+    return hist.GetMinLevel();
+  }
+}
+
+
+double TePDIStatistic::getMax( unsigned int raster_index,
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+  
+  const TePDIHistogram& hist = getHistogram( raster_index, 
+    pol_index );
+    
+  if( hist.size() == 0 )
+  {
+    return DBL_MAX;
+  }
+  else
+  {
+    return hist.GetMaxLevel();
+  }
+}
+
+
+double TePDIStatistic::getMode( unsigned int raster_index,
+  unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster_index < rasters_.size(), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+  
+  const TePDIHistogram& hist = getHistogram( raster_index, pol_index );
+  
+  if( hist.size() == 0 )
+  {
+    return DBL_MAX;
+  }
+  else
+  {
+    TePDIHistogram::const_iterator it_hist = hist.begin();
+    TePDIHistogram::const_iterator it_hist_end = hist.end();
+    
+    unsigned int frequency = 0;
+    double mode = 0;
+    
+    while( it_hist != it_hist_end ) {
+      if( it_hist->second > frequency ) {
+        mode = it_hist->first;
+        frequency = it_hist->second;
+      }
+      
+      ++it_hist;
+    }
+    
+    return mode;
+  }
+}
+
+
+double TePDIStatistic::getCorrelation( unsigned int raster1_index,  
+  unsigned int raster2_index, unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( raster1_index < rasters_.size(), 
+    "Invalid raster 1 index" );
+  TEAGN_TRUE_OR_THROW( raster2_index < rasters_.size(), 
+    "Invalid raster 2 index" );    
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), 
+    "Invalid polygon index" );
+    
+  double covariance = getCovariance( raster1_index, raster2_index, 
+    pol_index );
+    
+  if( covariance == DBL_MAX )
+  {
+    return DBL_MAX;
+  }
+  else
+  {
+    double cov1 = getCovariance( raster1_index, raster1_index, 
+      pol_index );
+    double cov2 = getCovariance( raster2_index, raster2_index, 
+      pol_index );
+      
+    if( ( cov1 == DBL_MAX ) || ( cov2 == DBL_MAX ) )
+    {
+      return DBL_MAX;
+    }
+    else
+    {
+      double sqrt_c_1 = sqrt( cov1 );
+      double sqrt_c_2 = sqrt( cov2 );
+      double multi = ( sqrt_c_1 * sqrt_c_2 );
+
+      if( multi == 0.0 ) {
+        return DBL_MAX;
+      } else {
+        return ( covariance / multi );
+      }
+    }
+  }
+}
+
+
+
+double TePDIStatistic::getPercentile( double sample_index, 
+  unsigned int raster_index, unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( ( raster_index < rasters_.size() ), 
+    "Invalid raster index" );
+  TEAGN_TRUE_OR_THROW( ( pol_index < polygonset_->size() ), 
+    "Invalid polygon index" );
+  TEAGN_TRUE_OR_THROW( ( ( sample_index >= 0.0 ) && 
+    ( sample_index <= 100.0 ) ), "Invalid sample index" );    
+  
+  const TePDIHistogram& hist = getHistogram( raster_index, pol_index );
+
+  if( hist.size() == 0 )
+  {
+    return DBL_MAX;
+  }
+  else if( hist.size() == 1 ) 
+  {
+    return hist.begin()->first;
+  } 
+  else 
+  {
+    TePDIHistogram::const_iterator it;
+    TePDIHistogram::const_iterator it_end = hist.end();
+    
+    unsigned int lastindex = hist.getTotalCount() - 1;
+    
+    double target_sample_index_double = 
+      ( (double)( lastindex ) ) * ( sample_index / 100.0 );
+    unsigned int target_sample_index_floor = 
+      (unsigned int)ceil( target_sample_index_double );
+    
+    if( target_sample_index_double == 
+      ( (double) target_sample_index_floor ) ) {
+      
+      it = hist.begin();
+      
+      unsigned int counted_elements = 0;
+      unsigned int target_index1 = target_sample_index_floor;
+      unsigned int target_index2 = ( target_index1 == lastindex ) ?
+        target_index1 : ( target_index1 + 1 );
+      double target1_value = 0;
+      double target2_value = 0;
+      unsigned int curr_index_range_bound = 0;
+      
+      while( it != it_end ) {
+        curr_index_range_bound = counted_elements + it->second;
+        
+        if( ( counted_elements <= target_index1 ) &&
+          ( target_index1 < curr_index_range_bound ) ) {
+          
+          target1_value = it->first;
+        }
+        
+        if( ( counted_elements <= target_index2 ) &&
+          ( target_index2 < curr_index_range_bound ) ) {
+          
+          target2_value = it->first;
+          
+          break;
+        }
+        
+        counted_elements += it->second;
+        
+        ++it;
+      }
+      
+      return ( ( target1_value + target2_value ) / 2.0 );
+    } else {
+      it = hist.begin();
+      
+      unsigned int counted_elements = 0;
+      unsigned int target_index1 = target_sample_index_floor + 1;
+      unsigned int curr_index_range_bound = 0;
+      
+      while( it != it_end ) {
+        curr_index_range_bound = counted_elements + it->second;
+        
+        if( ( counted_elements <= target_index1 ) &&
+          ( target_index1 < curr_index_range_bound ) ) {
+          
+          return it->first;
+        }
+        
+        counted_elements += it->second;
+        
+        ++it;
+      }
+      
+      TEAGN_LOG_AND_THROW( "Target value not found" );
+      
+      return 0;
+    }
+  }
+}
+
+TeMatrix TePDIStatistic::getCMMatrix( unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
+  
+  TeMatrix outmatrix;
+  outmatrix.Init( 3, rasters_.size(), 0. );
+
+  double sum3 = 0;
+  double sum4 = 0;
+  double mean = 0;
+  double sumpb1b2 = 0;
+  double sumpb1b2_norm = 0;
+  double pixels_nmb = 0;
+
+  for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
+    sumpb1b2 = getSumPB1B2( index, index, pol_index );
+    const TePDIHistogram& histo = getHistogram( index, pol_index );
+    
+    if( histo.size() == 0 )
+    {
+      outmatrix( 0, index ) = DBL_MAX;
+      outmatrix( 1, index ) = DBL_MAX;
+      outmatrix( 2, index ) = DBL_MAX;
+    }
+    else
+    {
+      sum3 = getSum3( index, pol_index );
+      sum4 = getSum4( index, pol_index );
+      mean = getMean( index, pol_index );
+      pixels_nmb = (double)histo.getTotalCount();
+      sumpb1b2_norm = sumpb1b2 / pixels_nmb;    
+      
+      outmatrix( 0, index ) = getCovariance( index, index, pol_index );
+
+      if( pixels_nmb == 0 ) {
+        outmatrix( 1, index ) = DBL_MAX;
+      } else {
+        outmatrix( 1, index ) = sum3 / pixels_nmb - 3 * mean * sumpb1b2_norm +
+                              2 * pow( mean, 3 );
+      }
+
+      if( pixels_nmb == 0 ) {
+        outmatrix( 2, index ) = DBL_MAX;
+      } else {
+        outmatrix( 2, index ) = sum4 / pixels_nmb - 4 * mean * sum3 / pixels_nmb +
+                              6 * pow( mean, 2 ) * sumpb1b2_norm -
+                              3 * pow( mean, 4 );
+      }
+    }
+  }
+
+  return outmatrix;
+}
+
+
+TeMatrix TePDIStatistic::getAssimetryMatrix( unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
+
+  TeMatrix outmatrix;
+  outmatrix.Init( 1, rasters_.size(), 0. );
+
+  double sum3 = 0;
+  double mean = 0;
+  double cov = 0;
+  double sigma = 0;
+  double sigma3 = 0;
+  double pixels_nmb = 0;
+  double sumpb1b2 = 0;
+  double sumpb1b2_norm = 0;  
+
+  for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
+    cov = getCovariance( index, index, pol_index );
+    const TePDIHistogram& histo = getHistogram( index, pol_index );
+    
+    if( histo.size() == 0 )
+    {
+      outmatrix( 0, index ) = DBL_MAX;
+    }
+    else
+    {
+      sigma = sqrt( cov );
+      sigma3 = sigma * sigma * sigma;
+
+      if( sigma3 != 0 ) {
+        sumpb1b2 = getSumPB1B2( index, index, pol_index );
+        sum3 = getSum3( index, pol_index );
+        mean = getMean( index, pol_index );
+        pixels_nmb = (double)histo.getTotalCount();
+        sumpb1b2_norm = sumpb1b2 / pixels_nmb;      
+        
+        if( ( pixels_nmb == 0 ) || ( sigma3 == 0 ) ) {
+          outmatrix( 0, index ) = 0;
+        } else {
+          outmatrix( 0, index ) = ( sum3 / pixels_nmb -  3 * mean * sumpb1b2_norm +
+                                  2 * pow( mean, 3 ) ) / sigma3;
+        }
+      } else {
+        outmatrix( 0, index ) = 0;
+      }
+    }
+  }
+
+  return outmatrix;
+}
+
+
+TeMatrix TePDIStatistic::getKurtosisMatrix( unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
+
+  TeMatrix outmatrix;
+  outmatrix.Init( 1, rasters_.size(), 0. );
+
+  double sum3;
+  double sum4;
+  double mean;
+  double cov;
+  double sigma;
+  double sigma4;
+  double sumpb1b2 = 0;
+  double sumpb1b2_norm = 0;
+  double pixels_nmb = 0;  
+
+  for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
+    cov = getCovariance( index, index, pol_index );
+    const TePDIHistogram& histo = getHistogram( index, pol_index );
+    
+    if( histo.size() == 0 )
+    {
+      outmatrix( 0, index ) = DBL_MAX;
+    }
+    else
+    {
+      sigma = sqrt( cov );
+      sigma4 = sigma * sigma * sigma * sigma;
+
+      if( sigma4 != 0 ) {
+        sumpb1b2 = getSumPB1B2( index, index, pol_index );
+        sum3 = getSum3( index, pol_index );
+        sum4 = getSum4( index, pol_index );
+        mean = getMean( index, pol_index );
+        pixels_nmb = (double)histo.getTotalCount();
+        sumpb1b2_norm = sumpb1b2 / pixels_nmb;
+        
+        if( pixels_nmb == 0 ) {
+          outmatrix( 0, index ) = DBL_MAX;
+        } else {
+          outmatrix( 0, index ) = ( sum4 / pixels_nmb - 4 * mean * sum3 /
+            pixels_nmb  + 6 * pow( mean, 2 ) * sumpb1b2_norm - 3 * pow( mean, 4 ) ) /
+            sigma4 - 3.;
+        }
+      } else {
+        outmatrix( 0, index ) = DBL_MAX;
+      }
+    }
+  }
+
+  return outmatrix;
+}
+
+
+TeMatrix TePDIStatistic::getVarCoefMatrix( unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
+  
+  TeMatrix outmatrix;
+  outmatrix.Init( 1, rasters_.size(), 0. );
+
+  double mean = 0.0;
+  double cov = 0.0;
+
+  for( unsigned int index = 0 ; index < rasters_.size() ; ++index ) {
+    mean = getMean( index, pol_index );
+
+    if( mean == DBL_MAX ) 
+    {
+      outmatrix( 0, index ) = DBL_MAX;
+    }
+    else if( mean == 0 ) 
+    {
+      outmatrix( 0, index ) = DBL_MAX;
+    }
+    else
+    {
+      cov = getCovariance( index, index, pol_index );
+      
+      if( cov == DBL_MAX )
+      {
+        outmatrix( 0, index ) = DBL_MAX;
+      }
+      else
+      {
+        outmatrix( 0, index ) = sqrt(
+          getCovariance( index, index, pol_index ) ) / mean;
+      }
+    }
+  }
+
+  return outmatrix;
+}
+
+
+TeMatrix TePDIStatistic::getCovMatrix( unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
+  
+  TeMatrix outmatrix;
+  outmatrix.Init( rasters_.size(), rasters_.size(), 0. );
+
+  for( unsigned int band1 = 0 ; band1 < rasters_.size() ; ++band1 ) {
+    for( unsigned int band2 = 0 ; band2 < rasters_.size() ; ++band2 ) {
+      outmatrix( band1, band2 ) = 
+        getCovariance( band1, band2, pol_index );
+    }
+  }
+
+  return outmatrix;
+}
+
+
+TeMatrix TePDIStatistic::getCorMatrix( unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
+  
+  TeMatrix outmatrix;
+  outmatrix.Init( rasters_.size(), rasters_.size(), 0. );
+
+  for( unsigned int band1 = 0 ; band1 < rasters_.size() ; ++band1 ) {
+    for( unsigned int band2 = 0 ; band2 < rasters_.size() ; ++band2 ) {
+      outmatrix( band1, band2 ) = 
+        getCorrelation( band1, band2, pol_index );
+    }
+  }
+
+  return outmatrix;
+}
+
+
+TeMatrix TePDIStatistic::getVarMatrix( unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
+  
+  TeMatrix outmatrix;
+  outmatrix.Init( rasters_.size(), 1, 0. );
+
+  for( unsigned int band = 0 ; band < rasters_.size() ; ++band ) {
+    outmatrix( band, 0 ) = getVariance( band, pol_index );
+  }
+
+  return outmatrix;
+}
+
+TeMatrix TePDIStatistic::getStdDevMatrix( unsigned int pol_index )
+{
+  TEAGN_TRUE_OR_THROW( pol_index < polygonset_->size(), "Invalid index" );
+  
+  TeMatrix outmatrix;
+  outmatrix.Init( rasters_.size(), 1, 0. );
+
+  for( unsigned int band = 0 ; band < rasters_.size() ; ++band ) {
+    outmatrix( band, 0 ) = getStdDev( band, pol_index );
+  }
+
+  return outmatrix;
+}
+
+void TePDIStatistic::clear()
+{
+  polygonset_.reset();
+  rasters_.clear();
+  bands_.clear();
+  
+  // Clean joint histograms
+
+  JHistoCacheT::iterator jhcit =
+    jHistoCache_.begin();
+  while( jhcit != jHistoCache_.end() )
+  {
+    delete jhcit->second;
+    ++jhcit;
+  }
+  jHistoCache_.clear();
+  
+  // Clean histograms
+  
+  HistoCacheT::iterator histCacheIt = histo_cache_.begin();
+  while( histCacheIt != histo_cache_.end() )
+  {
+    delete histCacheIt->second;
+    ++histCacheIt;
+  }
+
+  histo_cache_.clear();
+}
+
+
diff --git a/src/terralib/image_processing/TePDIStatistic.hpp b/src/terralib/image_processing/TePDIStatistic.hpp
old mode 100755
new mode 100644
index 6918b45..58a0662
--- a/src/terralib/image_processing/TePDIStatistic.hpp
+++ b/src/terralib/image_processing/TePDIStatistic.hpp
@@ -1,505 +1,513 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDISTATISTIC_HPP
-  #define TEPDISTATISTIC_HPP
-
-  #include "TePDIAlgorithm.hpp"
-  #include "TePDIParameters.hpp"
-  #include "TePDIJointHistogram.hpp"
-  #include "TePDIHistogram.hpp"
-  #include <TeSharedPtr.h>
-  #include "TePDITypes.hpp"
-
-  #include <TeMatrix.h>
-  #include <TeGeometry.h>
-
-  #include <map>
-
-  /**
-   * @brief This is the class for statistic calcules over raster data.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TePDIGeneralAlgoGroup
-   *
-   * @note The general required parameters are:
-   *
-   * @param rasters ( TePDITypes::TePDIRasterVectorType ) - A vector of all used 
-   * rasters ( NOTE: When more then one band is used from the same raster,
-   * this raster must appear more then one time ).
-   * @param bands ( std::vector< int > ) - A vector of all used bands
-   * for each raster inside the reasters vector above respectively.
-   *
-   * @note The following parameters are optional, and will be used if
-   * present.
-   *
-   * @param polygonset ( TePDITypes::TePDIPolygonSetPtrType ) - Restriction 
-   * polygon set - The area where to do calcules over all rasters - If
-   * not present the entire raster area will be used.   
-   * @param histograms ( std::vector< TePDIHistogram::pointer > ) - 
-   * A vector of all raster histogram references ( internal histogram 
-   * generation will be disabled - This parameter cannot be used 
-   * when the parameter polygonset is present );
-   * @param iterator_strat ( TeStrategicIterator ) - The iteration strategy
-   * used when analysing the raster elements ( default value:
-   * TeBoxPixelIn - Only pixels with center inside the polygonset will be
-   * considered ).
-   *
-   * @note For the methods using two or more channels(bands):
-   * No spatial overlay is checked. Images with the same
-   * number of lines and columns are required.
-   */
-  class PDI_DLL TePDIStatistic : public TePDIAlgorithm {
-    public :
-    
-      /** @typedef TeSharedPtr< TePDIStatistic > pointer 
-          Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIStatistic > pointer;
-      
-      /** @typedef const TeSharedPtr< TePDIStatistic > const_pointer 
-          Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIStatistic > const_pointer;    
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIStatistic();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIStatistic();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-      
-      /**
-       * @brief Generates the histogram for a given raster/band.
-       * 
-       * @note The internal histogram generation will use 256 levels
-       * for interpolated histograms when generated from floating point
-       * data type rasters.
-       * @param raster_index Index for the raster ( using the
-       * supplied parameters ).
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The histogram pointer.
-       */
-      const TePDIHistogram& getHistogram( unsigned int raster_index, 
-        unsigned int pol_index = 0 );      
-      
-      /**
-       * @brief Generates the joint histogram for a given raster/band pair.
-       * 
-       * @param raster1_index Index for the first raster.
-       * @param raster2_index Index for the second raster.
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The histogram reference.
-       */
-      const TePDIJointHistogram& getJointHistogram( 
-        unsigned int raster1_index, unsigned int raster2_index,
-        unsigned int pol_index = 0 );
-
-      /**
-       * @brief Sum of all pixels values.
-       *
-       * @param raster_index Index for the raster ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The sum value or DBL_MAX when an error occurs.
-       */
-      double getSum( unsigned int raster_index, unsigned int pol_index = 0 );
-      
-      /**
-       * @brief The cubic sum of pixels values.
-       *
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters ).
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The pixel level sum or DBL_MAX when an error occurs.
-       */
-      double getSum3( unsigned int raster_index, unsigned int pol_index = 0 );
-
-      /**
-       * @brief The quartic sum of pixels values.
-       *
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters ).
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The pixel level sum or DBL_MAX when an error occurs.
-       */
-      double getSum4( unsigned int raster_index, unsigned int pol_index = 0 );      
-      
-      /**
-       * @brief Mean pixels value for input_image1.
-       *
-       * @param raster_index Index for the raster ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The mean value or DBL_MAX when an error occurs.
-       */
-      double getMean( unsigned int raster_index, unsigned int pol_index = 0 );      
-
-      /**
-       * @brief Covariance between two bands.
-       *
-       * @param raster1_index Index for the first used raster / band ( using the
-       * supplied parameters )
-       * @param raster2_index Index for the second used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The covariance value or DBL_MAX when an error occurs.
-       */
-      double getCovariance( unsigned int raster1_index,  
-        unsigned int raster2_index, unsigned int pol_index = 0 );
-
-      /**
-       * @brief Variance of one band data.
-       *
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The variance value or DBL_MAX when an error occurs.
-       */
-      double getVariance( unsigned int raster_index, 
-        unsigned int pol_index = 0 );
-      
-      /**
-       * @brief Standard deviation of one band data.
-       *
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The Standard deviation value or DBL_MAX when an 
-       * error occurs.
-       */
-      double getStdDev( unsigned int raster_index,
-        unsigned int pol_index = 0 );      
-                
-      /**
-       * @brief Entropy of one band data.
-       *
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The entropy value or DBL_MAX when an 
-       * error occurs.
-       */
-      double getEntropy( unsigned int raster_index,
-        unsigned int pol_index = 0 );
-      
-      /**
-       * @brief The minimum pixel value of one band data.
-       *
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The minimum pixel value value or DBL_MAX when an 
-       * error occurs.
-       */
-      double getMin( unsigned int raster_index, unsigned int pol_index = 0 );      
-
-      /**
-       * @brief The maximum pixel value of one band data.
-       *
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The maximum pixel value value or DBL_MAX when an 
-       * error occurs.
-       */
-      double getMax( unsigned int raster_index, unsigned int pol_index = 0 );      
-
-      /**
-       * @brief The highest frequency pixel value of one band data (mode).
-       *
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The highest frequency pixel value of one band data (mode)
-       * or DBL_MAX when an error occurs.
-       */
-      double getMode( unsigned int raster_index, unsigned int pol_index = 0 );      
-                  
-      /**
-       * @brief Correlation between two bands.
-       *
-       * @param raster1_index Index for the first used raster / band ( using the
-       * supplied parameters )
-       * @param raster2_index Index for the second used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The correlation value or DBL_MAX when an error occurs.
-       */
-      double getCorrelation( unsigned int raster1_index,  
-        unsigned int raster2_index, unsigned int pol_index = 0 );
-
-      /**
-       * @brief The Percentile value of one band data.
-       *
-       * @param sample_index Sample index ( 0 -> 100 );
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The highest frequency pixel value of one band data (mode)
-       * or DBL_MAX when an error occurs.
-       */
-      double getPercentile( double sample_index, unsigned int raster_index, 
-        unsigned int pol_index = 0 );
-
-      /**
-       * @brief Mean matrix calcule.
-       *
-       * @note Lines = 1, Columns = total bands/rasters number.
-       *
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The mean matrix.
-       * @note Those matrix elements where an error ocurred are
-       * marked with value DBL_MAX;
-       */
-      TeMatrix getMeanMatrix( unsigned int pol_index = 0 );
-
-      /**
-       * @brief Central moments matrix.
-       *
-       * @note Lines = 3, Columns = total bands/rasters number.
-       *
-       * @param raster_index Index for the used raster / band ( using the
-       * supplied parameters )
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The central moments matrix.
-       * @note Those matrix elements where an error ocurred are
-       * marked with value DBL_MAX;       
-       */
-      TeMatrix getCMMatrix( unsigned int pol_index = 0 );
-
-      /**
-       * @brief Assimetry coefficients matrix.
-       *
-       * @note Lines = 1, Columns = total bands/rasters number.
-       *
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The Assimetry coefficients matrix.
-       * @note Those matrix elements where an error ocurred are
-       * marked with value DBL_MAX;          
-       */
-      TeMatrix getAssimetryMatrix( unsigned int pol_index = 0 );
-
-      /**
-       * @brief Kurtosis coefficients matrix.
-       *
-       * @note Lines = 1, Columns = total bands/rasters number.
-       *
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The Kurtosis coefficients matrix.
-       * @note Those matrix elements where an error ocurred are
-       * marked with value DBL_MAX;               
-       */
-      TeMatrix getKurtosisMatrix( unsigned int pol_index = 0 );
-
-      /**
-       * @brief Variation coefficients matrix.
-       *
-       * @note Lines = 1, Columns = total bands/rasters number.
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).*
-       * @return The Variation coefficients matrix.
-       * @note Those matrix elements where an error ocurred are
-       * marked with value DBL_MAX;                  
-       */
-      TeMatrix getVarCoefMatrix( unsigned int pol_index = 0 );
-      
-      /**
-       * @brief Covariance matrix.
-       *
-       * @note Lines = total bands/rasters number, 
-       *       Columns = total bands/rasters number.
-       *
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).*
-       * @return The Covariance matrix.
-       * @note Those matrix elements where an error ocurred are
-       * marked with value DBL_MAX;         
-       */
-      TeMatrix getCovMatrix( unsigned int pol_index = 0 );      
-      
-      /**
-       * @brief Correlation matrix.
-       *
-       * @note Lines = total bands/rasters number, 
-       *       Columns = total bands/rasters number.
-       *
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).*
-       * @return The Correlation matrix.
-       * @note Those matrix elements where an error ocurred are
-       * marked with value DBL_MAX;        
-       */
-      TeMatrix getCorMatrix( unsigned int pol_index = 0 );        
-      
-      /**
-       * @brief Variance matrix.
-       *
-       * @note Lines = total bands/rasters number, 
-       *       Columns = 1.
-       *
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).*
-       * @return The Variance matrix.
-       * @note Those matrix elements where an error ocurred are
-       * marked with value DBL_MAX;        
-       */
-      TeMatrix getVarMatrix( unsigned int pol_index = 0 );       
-      
-      /**
-       * @brief Standard deviation matrix.
-       *
-       * @note Lines = total bands/rasters number, 
-       *       Columns = 1.
-       *
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).*
-       * @return The Standard deviation matrix.
-       * @note Those matrix elements where an error ocurred are
-       * marked with value DBL_MAX;        
-       */
-      TeMatrix getStdDevMatrix( unsigned int pol_index = 0 );          
-
-    protected :
-    
-      /**
-       * @typedef std::pair< unsigned int, unsigned int  > SingleRasterCachesKeyT
-       * A type definition for a cache related to a single raster.
-       * @param "unsigned int" Raster index.
-       * @param "unsigned int" Polygon index.       
-       */    
-      typedef std::pair< unsigned int, unsigned int  > SingleRasterCachesKeyT;
-      
-      /**
-       * @typedef std::pair< unsigned int, SingleRasterCachesKeyT  > CoupleRasterCachesKeyT
-       * A type definition for a cache related to a couple of rasters.
-       * @param "unsigned int" Raster1 index.
-       * @param "SingleRasterCachesKeyT" Raster2 index / polygon index.       
-       */    
-      typedef std::pair< unsigned int, SingleRasterCachesKeyT  > 
-        CoupleRasterCachesKeyT;      
-    
-      /**
-       * @brief The current restriction polygon set.
-       */
-      TePDITypes::TePDIPolygonSetPtrType polygonset_;
-      
-      /**
-       * @brief The current rasters.
-       */
-      TePDITypes::TePDIRasterVectorType rasters_;
-      
-      /**
-       * @brief The current rasters bands.
-       */
-      std::vector< int > bands_;
-
-      /**
-       * @brief Joint histograms cache.
-       */
-      std::map< CoupleRasterCachesKeyT, TePDIJointHistogram* > jHistoCache_;
-        
-      /**
-       * @brief A cache of level ordered histograms to avoid rebuilding
-       * histograms all the times.
-       */
-      std::map< SingleRasterCachesKeyT, TePDIHistogram::pointer > histo_cache_;
-      
-      /**
-       * @brief The current iterator strategy.
-       */      
-      TeStrategicIterator iterator_strat_;
-      
-      /**
-       * @brief Runs the current algorithm implementation.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-        
-      /**
-       * @brief Sum of products between all pixels from different bands.
-       *
-       * @param raster1_index Index for the first used raster / band ( 
-       * using the supplied parameters ).
-       * @param raster2_index Index for the second used raster / band ( 
-       * using the supplied parameters ).
-       * @param pol_index The polygon index inside the polygon set
-       * ( if no polygon set is present, use de default zero value ).
-       * @return The Sum of products or DBL_MAX when an 
-       * error occurs.
-       */
-      double getSumPB1B2( unsigned int raster1_index,
-        unsigned int raster2_index, unsigned int pol_index );
-
-      //! Clears all internal allocated structures.
-      void clear();       
-   
-  };
-  
-/** @example TePDIStatistic_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDISTATISTIC_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDISTATISTIC_HPP
+  #define TEPDISTATISTIC_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIParameters.hpp"
+  #include "TePDIJointHistogram.hpp"
+  #include "TePDIHistogram.hpp"
+  #include <TeSharedPtr.h>
+  #include "TePDITypes.hpp"
+
+  #include <TeMatrix.h>
+  #include <TeGeometry.h>
+
+  #include <map>
+
+  /**
+   * @brief This is the class for statistic calcules over raster data.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIGeneralAlgoGroup
+   *
+   * @note The general required parameters are:
+   *
+   * @param rasters ( TePDITypes::TePDIRasterVectorType ) - A vector of all used 
+   * rasters ( NOTE: When more then one band is used from the same raster,
+   * this raster must appear more then one time ).
+   * @param bands ( std::vector< int > ) - A vector of all used bands
+   * for each raster inside the reasters vector above respectively.
+   *
+   * @note The following parameters are optional, and will be used if
+   * present.
+   *
+   * @param polygonset ( TePDITypes::TePDIPolygonSetPtrType ) - Restriction 
+   * polygon set - The area where to do calcules over all rasters - If
+   * not present the entire raster area will be used.   
+   * @param histograms ( std::vector< TePDIHistogram::pointer > ) - 
+   * A vector of all raster histogram references ( internal histogram 
+   * generation will be disabled - This parameter cannot be used 
+   * when the parameter polygonset is present );
+   * @param iterator_strat ( TeStrategicIterator ) - The iteration strategy
+   * used when analysing the raster elements ( default value:
+   * TeBoxPixelIn - Only pixels with center inside the polygonset will be
+   * considered ).
+   *
+   * @note For the methods using two or more channels(bands):
+   * No spatial overlay is checked. Images with the same
+   * number of lines and columns are required.
+   */
+  class PDI_DLL TePDIStatistic : public TePDIAlgorithm {
+    public :
+    
+      /** @typedef TeSharedPtr< TePDIStatistic > pointer 
+          Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIStatistic > pointer;
+      
+      /** @typedef const TeSharedPtr< TePDIStatistic > const_pointer 
+          Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIStatistic > const_pointer;    
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIStatistic();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIStatistic();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+      
+      /**
+       * @brief Generates the histogram for a given raster/band.
+       * 
+       * @note The internal histogram generation will use 256 levels
+       * for interpolated histograms when generated from floating point
+       * data type rasters.
+       * @param raster_index Index for the raster ( using the
+       * supplied parameters ).
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The histogram pointer.
+       */
+      const TePDIHistogram& getHistogram( unsigned int raster_index, 
+        unsigned int pol_index = 0 );      
+      
+      /**
+       * @brief Generates the joint histogram for a given raster/band pair.
+       * 
+       * @param raster1_index Index for the first raster.
+       * @param raster2_index Index for the second raster.
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The histogram reference.
+       */
+      const TePDIJointHistogram& getJointHistogram( 
+        unsigned int raster1_index, unsigned int raster2_index,
+        unsigned int pol_index = 0 );
+
+      /**
+       * @brief Sum of all pixels values.
+       *
+       * @param raster_index Index for the raster ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The sum value or DBL_MAX when an error occurs.
+       */
+      double getSum( unsigned int raster_index, unsigned int pol_index = 0 );
+      
+      /**
+       * @brief The cubic sum of pixels values.
+       *
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters ).
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The pixel level sum or DBL_MAX when an error occurs.
+       */
+      double getSum3( unsigned int raster_index, unsigned int pol_index = 0 );
+
+      /**
+       * @brief The quartic sum of pixels values.
+       *
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters ).
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The pixel level sum or DBL_MAX when an error occurs.
+       */
+      double getSum4( unsigned int raster_index, unsigned int pol_index = 0 );      
+      
+      /**
+       * @brief Mean pixels value for input_image1.
+       *
+       * @param raster_index Index for the raster ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The mean value or DBL_MAX when an error occurs.
+       */
+      double getMean( unsigned int raster_index, unsigned int pol_index = 0 );      
+
+      /**
+       * @brief Covariance between two bands.
+       *
+       * @param raster1_index Index for the first used raster / band ( using the
+       * supplied parameters )
+       * @param raster2_index Index for the second used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The covariance value or DBL_MAX when an error occurs.
+       */
+      double getCovariance( unsigned int raster1_index,  
+        unsigned int raster2_index, unsigned int pol_index = 0 );
+
+      /**
+       * @brief Variance of one band data.
+       *
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The variance value or DBL_MAX when an error occurs.
+       */
+      double getVariance( unsigned int raster_index, 
+        unsigned int pol_index = 0 );
+      
+      /**
+       * @brief Standard deviation of one band data.
+       *
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The Standard deviation value or DBL_MAX when an 
+       * error occurs.
+       */
+      double getStdDev( unsigned int raster_index,
+        unsigned int pol_index = 0 );      
+                
+      /**
+       * @brief Entropy of one band data.
+       *
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The entropy value or DBL_MAX when an 
+       * error occurs.
+       */
+      double getEntropy( unsigned int raster_index,
+        unsigned int pol_index = 0 );
+      
+      /**
+       * @brief The minimum pixel value of one band data.
+       *
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The minimum pixel value value or DBL_MAX when an 
+       * error occurs.
+       */
+      double getMin( unsigned int raster_index, unsigned int pol_index = 0 );      
+
+      /**
+       * @brief The maximum pixel value of one band data.
+       *
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The maximum pixel value value or DBL_MAX when an 
+       * error occurs.
+       */
+      double getMax( unsigned int raster_index, unsigned int pol_index = 0 );      
+
+      /**
+       * @brief The highest frequency pixel value of one band data (mode).
+       *
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The highest frequency pixel value of one band data (mode)
+       * or DBL_MAX when an error occurs.
+       */
+      double getMode( unsigned int raster_index, unsigned int pol_index = 0 );      
+                  
+      /**
+       * @brief Correlation between two bands.
+       *
+       * @param raster1_index Index for the first used raster / band ( using the
+       * supplied parameters )
+       * @param raster2_index Index for the second used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The correlation value or DBL_MAX when an error occurs.
+       */
+      double getCorrelation( unsigned int raster1_index,  
+        unsigned int raster2_index, unsigned int pol_index = 0 );
+
+      /**
+       * @brief The Percentile value of one band data.
+       *
+       * @param sample_index Sample index ( 0 -> 100 );
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The highest frequency pixel value of one band data (mode)
+       * or DBL_MAX when an error occurs.
+       */
+      double getPercentile( double sample_index, unsigned int raster_index, 
+        unsigned int pol_index = 0 );
+
+      /**
+       * @brief Mean matrix calcule.
+       *
+       * @note Lines = 1, Columns = total bands/rasters number.
+       *
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The mean matrix.
+       * @note Those matrix elements where an error ocurred are
+       * marked with value DBL_MAX;
+       */
+      TeMatrix getMeanMatrix( unsigned int pol_index = 0 );
+
+      /**
+       * @brief Central moments matrix.
+       *
+       * @note Lines = 3, Columns = total bands/rasters number.
+       *
+       * @param raster_index Index for the used raster / band ( using the
+       * supplied parameters )
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The central moments matrix.
+       * @note Those matrix elements where an error ocurred are
+       * marked with value DBL_MAX;       
+       */
+      TeMatrix getCMMatrix( unsigned int pol_index = 0 );
+
+      /**
+       * @brief Assimetry coefficients matrix.
+       *
+       * @note Lines = 1, Columns = total bands/rasters number.
+       *
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The Assimetry coefficients matrix.
+       * @note Those matrix elements where an error ocurred are
+       * marked with value DBL_MAX;          
+       */
+      TeMatrix getAssimetryMatrix( unsigned int pol_index = 0 );
+
+      /**
+       * @brief Kurtosis coefficients matrix.
+       *
+       * @note Lines = 1, Columns = total bands/rasters number.
+       *
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The Kurtosis coefficients matrix.
+       * @note Those matrix elements where an error ocurred are
+       * marked with value DBL_MAX;               
+       */
+      TeMatrix getKurtosisMatrix( unsigned int pol_index = 0 );
+
+      /**
+       * @brief Variation coefficients matrix.
+       *
+       * @note Lines = 1, Columns = total bands/rasters number.
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).*
+       * @return The Variation coefficients matrix.
+       * @note Those matrix elements where an error ocurred are
+       * marked with value DBL_MAX;                  
+       */
+      TeMatrix getVarCoefMatrix( unsigned int pol_index = 0 );
+      
+      /**
+       * @brief Covariance matrix.
+       *
+       * @note Lines = total bands/rasters number, 
+       *       Columns = total bands/rasters number.
+       *
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).*
+       * @return The Covariance matrix.
+       * @note Those matrix elements where an error ocurred are
+       * marked with value DBL_MAX;         
+       */
+      TeMatrix getCovMatrix( unsigned int pol_index = 0 );      
+      
+      /**
+       * @brief Correlation matrix.
+       *
+       * @note Lines = total bands/rasters number, 
+       *       Columns = total bands/rasters number.
+       *
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).*
+       * @return The Correlation matrix.
+       * @note Those matrix elements where an error ocurred are
+       * marked with value DBL_MAX;        
+       */
+      TeMatrix getCorMatrix( unsigned int pol_index = 0 );        
+      
+      /**
+       * @brief Variance matrix.
+       *
+       * @note Lines = total bands/rasters number, 
+       *       Columns = 1.
+       *
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).*
+       * @return The Variance matrix.
+       * @note Those matrix elements where an error ocurred are
+       * marked with value DBL_MAX;        
+       */
+      TeMatrix getVarMatrix( unsigned int pol_index = 0 );       
+      
+      /**
+       * @brief Standard deviation matrix.
+       *
+       * @note Lines = total bands/rasters number, 
+       *       Columns = 1.
+       *
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).*
+       * @return The Standard deviation matrix.
+       * @note Those matrix elements where an error ocurred are
+       * marked with value DBL_MAX;        
+       */
+      TeMatrix getStdDevMatrix( unsigned int pol_index = 0 );          
+
+    protected :
+    
+      /**
+       * @typedef std::pair< unsigned int, unsigned int  > SingleRasterCachesKeyT
+       * A type definition for a cache related to a single raster.
+       * @param "unsigned int" Raster index.
+       * @param "unsigned int" Polygon index.       
+       */    
+      typedef std::pair< unsigned int, unsigned int  > SingleRasterCachesKeyT;
+      
+      /**
+       * @typedef std::pair< unsigned int, SingleRasterCachesKeyT  > CoupleRasterCachesKeyT
+       * A type definition for a cache related to a couple of rasters.
+       * @param "unsigned int" Raster1 index.
+       * @param "SingleRasterCachesKeyT" Raster2 index / polygon index.       
+       */    
+      typedef std::pair< unsigned int, SingleRasterCachesKeyT  > 
+        CoupleRasterCachesKeyT;      
+        
+      /** Histogram cache type definition */
+      typedef std::map< SingleRasterCachesKeyT, TePDIHistogram* > 
+        HistoCacheT;
+        
+      /** Joint histogram cache type definition */  
+      typedef std::map< CoupleRasterCachesKeyT, TePDIJointHistogram* >
+        JHistoCacheT;
+    
+      /**
+       * @brief The current restriction polygon set.
+       */
+      TePDITypes::TePDIPolygonSetPtrType polygonset_;
+      
+      /**
+       * @brief The current rasters.
+       */
+      TePDITypes::TePDIRasterVectorType rasters_;
+      
+      /**
+       * @brief The current rasters bands.
+       */
+      std::vector< int > bands_;
+
+      /**
+       * @brief Joint histograms cache.
+       */
+      JHistoCacheT jHistoCache_;
+        
+      /**
+       * @brief A cache of level ordered histograms to avoid rebuilding
+       * histograms all the times.
+       */
+      HistoCacheT histo_cache_;
+      
+      /**
+       * @brief The current iterator strategy.
+       */      
+      TeStrategicIterator iterator_strat_;
+      
+      /**
+       * @brief Runs the current algorithm implementation.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * params The new parameters referente at initial state.
+       */
+      void ResetState( const TePDIParameters& params );
+        
+      /**
+       * @brief Sum of products between all pixels from different bands.
+       *
+       * @param raster1_index Index for the first used raster / band ( 
+       * using the supplied parameters ).
+       * @param raster2_index Index for the second used raster / band ( 
+       * using the supplied parameters ).
+       * @param pol_index The polygon index inside the polygon set
+       * ( if no polygon set is present, use de default zero value ).
+       * @return The Sum of products or DBL_MAX when an 
+       * error occurs.
+       */
+      double getSumPB1B2( unsigned int raster1_index,
+        unsigned int raster2_index, unsigned int pol_index );
+
+      //! Clears all internal allocated structures.
+      void clear();       
+   
+  };
+  
+/** @example TePDIStatistic_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif //TEPDISTATISTIC_HPP
diff --git a/src/terralib/image_processing/TePDIStrategy.cpp b/src/terralib/image_processing/TePDIStrategy.cpp
old mode 100755
new mode 100644
index 17ee28e..b5562fc
--- a/src/terralib/image_processing/TePDIStrategy.cpp
+++ b/src/terralib/image_processing/TePDIStrategy.cpp
@@ -1,35 +1,35 @@
-#include "TePDIStrategy.hpp"
-#include <TeAgnostic.h>
-
-TePDIStrategy::TePDIStrategy()
-{
-  progress_interface_enabled_ = true;
-};      
-
-
-TePDIStrategy::~TePDIStrategy()
-{
-};
-
-
-TePDIStrategy* TePDIStrategy::DefaultObject( const TePDIParameters& )
-{
-  TEAGN_LOG_AND_THROW( "Trying to build an invalid strategy instance" );
-  return 0;
-}
-
-
-bool TePDIStrategy::Apply( const TePDIParameters& params )
-{
-  TEAGN_TRUE_OR_RETURN( CheckParameters( params ), 
-    "Parameter checking failed" );
-    
-  return Implementation( params );
-}
-
-
-void TePDIStrategy::ToggleProgInt( bool enabled )
-{
-  progress_interface_enabled_ = enabled;
-}
-
+#include "TePDIStrategy.hpp"
+#include <TeAgnostic.h>
+
+TePDIStrategy::TePDIStrategy()
+{
+  progress_interface_enabled_ = true;
+};      
+
+
+TePDIStrategy::~TePDIStrategy()
+{
+};
+
+
+TePDIStrategy* TePDIStrategy::DefaultObject( const TePDIParameters& )
+{
+  TEAGN_LOG_AND_THROW( "Trying to build an invalid strategy instance" );
+  return 0;
+}
+
+
+bool TePDIStrategy::Apply( const TePDIParameters& params )
+{
+  TEAGN_TRUE_OR_RETURN( CheckParameters( params ), 
+    "Parameter checking failed" );
+    
+  return Implementation( params );
+}
+
+
+void TePDIStrategy::ToggleProgInt( bool enabled )
+{
+  progress_interface_enabled_ = enabled;
+}
+
diff --git a/src/terralib/image_processing/TePDIStrategy.hpp b/src/terralib/image_processing/TePDIStrategy.hpp
old mode 100755
new mode 100644
index 8ec84b9..7bfe272
--- a/src/terralib/image_processing/TePDIStrategy.hpp
+++ b/src/terralib/image_processing/TePDIStrategy.hpp
@@ -1,119 +1,119 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDISTRATEGY_HPP
-  #define TEPDISTRATEGY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIParameters.hpp"
-  
-  #include <string>
-
-  /**
-   * @brief This is the base class for digital image processing algorithms 
-   * strategies.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @note All TePDIStrategy derived classes must be a friend of the respective
-   * TePDIStrategyFactory derived class ( for private constructor access ).
-   * @ingroup PDIStrategies
-   */
-  class PDI_DLL TePDIStrategy
-  {
-//    friend class TePDIStrategyFactory;
-  
-    public :
-      /** @typedef TeSharedPtr< TePDIStrategy > pointer 
-        Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIStrategy > pointer;
-      
-      /** @typedef const TeSharedPtr< TePDIStrategy > const_pointer 
-        Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIStrategy > const_pointer;
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIStrategy();
-      
-      /**
-       * @brief Returns a default object.
-       *
-       * @return A default object.
-       */
-      static TePDIStrategy* DefaultObject( 
-        const TePDIParameters& params );     
-        
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI strategy.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      virtual bool CheckParameters( 
-        const TePDIParameters& parameters ) const = 0;
-        
-      /**
-       * @brief Applies the strategy.
-       *
-       * @note Parameters checking will be performed.
-       *
-       * @return true if OK. false on error.
-       */
-      bool Apply( const TePDIParameters& params );
-      
-      /**
-       * @brief Enable / Disable the progress interface.
-       *
-       * @param enabled Flag to enable ( true ) or disable ( false ).
-       */
-      void ToggleProgInt( bool enabled );                          
-
-    protected :
-    
-      /** @brief Progress interface enabled/disable flag */
-      mutable bool progress_interface_enabled_;
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIStrategy();
-      
-      /**
-       * @brief Runs the algorithm implementation.
-       *
-       * @return true if OK. false on errors.
-       */
-      virtual bool Implementation( const TePDIParameters& params ) = 0;
-      
-  };
-  
-#endif
-
-
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDISTRATEGY_HPP
+  #define TEPDISTRATEGY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIParameters.hpp"
+  
+  #include <string>
+
+  /**
+   * @brief This is the base class for digital image processing algorithms 
+   * strategies.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @note All TePDIStrategy derived classes must be a friend of the respective
+   * TePDIStrategyFactory derived class ( for private constructor access ).
+   * @ingroup PDIStrategies
+   */
+  class PDI_DLL TePDIStrategy
+  {
+//    friend class TePDIStrategyFactory;
+  
+    public :
+      /** @typedef TeSharedPtr< TePDIStrategy > pointer 
+        Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIStrategy > pointer;
+      
+      /** @typedef const TeSharedPtr< TePDIStrategy > const_pointer 
+        Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIStrategy > const_pointer;
+      
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TePDIStrategy();
+      
+      /**
+       * @brief Returns a default object.
+       *
+       * @return A default object.
+       */
+      static TePDIStrategy* DefaultObject( 
+        const TePDIParameters& params );     
+        
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI strategy.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      virtual bool CheckParameters( 
+        const TePDIParameters& parameters ) const = 0;
+        
+      /**
+       * @brief Applies the strategy.
+       *
+       * @note Parameters checking will be performed.
+       *
+       * @return true if OK. false on error.
+       */
+      bool Apply( const TePDIParameters& params );
+      
+      /**
+       * @brief Enable / Disable the progress interface.
+       *
+       * @param enabled Flag to enable ( true ) or disable ( false ).
+       */
+      void ToggleProgInt( bool enabled );                          
+
+    protected :
+    
+      /** @brief Progress interface enabled/disable flag */
+      mutable bool progress_interface_enabled_;
+      
+      /**
+       * @brief Default constructor
+       *
+       * @param factoryName Factory name.
+       */
+      TePDIStrategy();
+      
+      /**
+       * @brief Runs the algorithm implementation.
+       *
+       * @return true if OK. false on errors.
+       */
+      virtual bool Implementation( const TePDIParameters& params ) = 0;
+      
+  };
+  
+#endif
+
+
+
diff --git a/src/terralib/image_processing/TePDIStrategyFactory.cpp b/src/terralib/image_processing/TePDIStrategyFactory.cpp
old mode 100755
new mode 100644
index ce21aa4..49bb39f
--- a/src/terralib/image_processing/TePDIStrategyFactory.cpp
+++ b/src/terralib/image_processing/TePDIStrategyFactory.cpp
@@ -1,11 +1,11 @@
- 
-#include "TePDIStrategyFactory.hpp"
-
-TePDIStrategyFactory::TePDIStrategyFactory( const std::string& factoryName )
-: TeFactory< TePDIStrategy, TePDIParameters >( factoryName )
-{
-};      
-
-TePDIStrategyFactory::~TePDIStrategyFactory()
-{
-};
+ 
+#include "TePDIStrategyFactory.hpp"
+
+TePDIStrategyFactory::TePDIStrategyFactory( const std::string& factoryName )
+: TeFactory< TePDIStrategy, TePDIParameters >( factoryName )
+{
+};      
+
+TePDIStrategyFactory::~TePDIStrategyFactory()
+{
+};
diff --git a/src/terralib/image_processing/TePDIStrategyFactory.hpp b/src/terralib/image_processing/TePDIStrategyFactory.hpp
old mode 100755
new mode 100644
index a73c4f9..daa138b
--- a/src/terralib/image_processing/TePDIStrategyFactory.hpp
+++ b/src/terralib/image_processing/TePDIStrategyFactory.hpp
@@ -1,79 +1,73 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef PDI_STRATEGY_FACTORIES_REGISTERED
-  #define PDI_STRATEGY_FACTORIES_REGISTERED
-  
-  /* Fusion Strategies Factories */
-  
-  #include "TePDIGarguetFusionSF.hpp"
-  #include "TePDIVenturaFusionSF.hpp"
-  #include "TePDIIHSFusionSF.hpp"
-  
-#endif 
-
-#ifndef TEPDISTRATEGYFACTORY_HPP
-  #define TEPDISTRATEGYFACTORY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIStrategy.hpp"
-  #include "TePDIParameters.hpp"
-  
-  #include <TeFactory.h>
-  
-  #include <string>
-
-  /**
-   * @brief This is the class for digital image processing strategy factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategyFactories
-   */
-  class PDI_DLL TePDIStrategyFactory : 
-    public TeFactory< TePDIStrategy, TePDIParameters >
-  {
-    public :
-      /** @typedef Type definition for a instance pointer */
-      typedef TeSharedPtr< TePDIStrategyFactory > pointer;
-      /** @typedef Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TePDIStrategyFactory > const_pointer;
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TePDIStrategyFactory();
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIStrategyFactory( const std::string& factoryName );
-  };
-  
-#endif
-
-
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef PDI_STRATEGY_FACTORIES_REGISTERED
+  #define PDI_STRATEGY_FACTORIES_REGISTERED
+
+#endif 
+
+#ifndef TEPDISTRATEGYFACTORY_HPP
+  #define TEPDISTRATEGYFACTORY_HPP
+
+  #include <TeSharedPtr.h>
+  #include "TePDIStrategy.hpp"
+  #include "TePDIParameters.hpp"
+  
+  #include <TeFactory.h>
+  
+  #include <string>
+
+  /**
+   * @brief This is the class for digital image processing strategy factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIStrategyFactories
+   */
+  class PDI_DLL TePDIStrategyFactory : 
+    public TeFactory< TePDIStrategy, TePDIParameters >
+  {
+    public :
+      /** @typedef Type definition for a instance pointer */
+      typedef TeSharedPtr< TePDIStrategyFactory > pointer;
+      /** @typedef Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TePDIStrategyFactory > const_pointer;
+      
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TePDIStrategyFactory();
+      
+    protected :
+      
+      /**
+       * @brief Default constructor
+       *
+       * @param factoryName Factory name.
+       */
+      TePDIStrategyFactory( const std::string& factoryName );
+  };
+  
+#endif
+
+
+
diff --git a/src/terralib/image_processing/TePDITPMosaic.cpp b/src/terralib/image_processing/TePDITPMosaic.cpp
new file mode 100644
index 0000000..39c091a
--- /dev/null
+++ b/src/terralib/image_processing/TePDITPMosaic.cpp
@@ -0,0 +1,540 @@
+#include "TePDITPMosaic.hpp"
+
+#include "TePDIBlender.hpp"
+#include "TePDIUtils.hpp"
+#include "TePDIPIManager.hpp"
+
+#include <TeGTFactory.h>
+#include <TeGeometryAlgorithms.h>
+#include <TeGeometricTransformation.h>
+#include <TeOverlay.h>
+#include <TeAgnostic.h>
+
+
+TePDITPMosaic::TePDITPMosaic()
+{
+}
+
+
+TePDITPMosaic::~TePDITPMosaic()
+{
+}
+
+
+void TePDITPMosaic::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDITPMosaic::CheckParameters( const TePDIParameters& parameters ) const
+{
+  /* Checking input_raster1 */
+  
+  TePDITypes::TePDIRasterPtrType input_raster1;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster1", 
+    input_raster1 ),
+    "Missing parameter: input_raster1" );
+  TEAGN_TRUE_OR_RETURN( input_raster1.isActive(),
+    "Invalid parameter: input_raster1 inactive" );
+  TEAGN_TRUE_OR_RETURN( input_raster1->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: input_raster1 not ready" );    
+    
+  /* Checking input_raster2 */
+  
+  TePDITypes::TePDIRasterPtrType input_raster2;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "input_raster2", 
+    input_raster2 ),
+    "Missing parameter: input_raster2" );
+  TEAGN_TRUE_OR_RETURN( input_raster2.isActive(),
+    "Invalid parameter: input_raster2 inactive" );
+  TEAGN_TRUE_OR_RETURN( input_raster2->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: input_raster2 not ready" );    
+    
+  /* channels1 parameter checking */
+
+  std::vector< unsigned int > channels1;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "channels1", channels1 ), 
+    "Missing parameter: channels1" );
+  for( unsigned int channels1_index = 0 ; 
+    channels1_index < channels1.size() ; 
+    ++channels1_index ) {
+    
+    TEAGN_TRUE_OR_RETURN( ( (int)channels1[ channels1_index ] < 
+      input_raster1->nBands() ),
+      "Invalid parameter: channels1" );
+  }
+  
+  /* channels2 parameter checking */
+
+  std::vector< unsigned int > channels2;
+  TEAGN_TRUE_OR_RETURN( 
+    parameters.GetParameter( "channels2", channels2 ), 
+    "Missing parameter: channels2" );
+  TEAGN_TRUE_OR_RETURN( ( channels2.size() == channels1.size() ),
+    "Size mismatch between channels1 and channels2" );
+  for( unsigned int channels2_index = 0 ; 
+    channels2_index < channels2.size() ; 
+    ++channels2_index ) {
+    
+    TEAGN_TRUE_OR_RETURN( ( (int)channels2[ channels2_index ] < 
+      input_raster2->nBands() ),
+      "Invalid parameter: channels2" );
+  }     
+    
+  /* Checking output_raster */
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
+    output_raster ),
+    "Missing parameter: output_raster" );
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
+    "Invalid parameter: output_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );
+    
+  // Checking transParams
+  
+  TeGTParams trans_params;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "trans_params", 
+    trans_params ),
+    "Missing parameter: trans_params" );  
+    
+  return true;
+}
+
+
+bool TePDITPMosaic::RunImplementation()
+{
+  // Extracting user supplied parameters
+  
+  TePDITypes::TePDIRasterPtrType input_raster1;
+  params_.GetParameter( "input_raster1", input_raster1 );
+
+  TePDITypes::TePDIRasterPtrType input_raster2;
+  params_.GetParameter( "input_raster2", input_raster2 );
+  
+  std::vector< unsigned int > channels1;
+  params_.GetParameter( "channels1", channels1 );
+
+  std::vector< unsigned int > channels2;
+  params_.GetParameter( "channels2", channels2 ); 
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter( "output_raster", output_raster );
+  
+  TeGTParams trans_params;
+  params_.GetParameter( "trans_params", trans_params );   
+  
+  TePDIBlender::BlendMethod blend_method = TePDIBlender::NoBlendMethod;
+  if( params_.CheckParameter< TePDIBlender::BlendMethod >(
+    "blend_method" ) )
+  {
+    params_.GetParameter( "blend_method", blend_method );
+  }  
+  
+  TePDIInterpolator::InterpMethod interp_method = TePDIInterpolator::NNMethod;
+  if( params_.CheckParameter< TePDIInterpolator::InterpMethod >(
+    "interp_method" ) )
+  {
+    params_.GetParameter( "interp_method", interp_method );
+  }
+  
+  bool auto_equalize = false;
+  if( params_.CheckParameter< int >( "auto_equalize" ) )
+  {
+    auto_equalize = true;
+  }
+  
+  /* Dumyy value definition */
+ 
+  double dummy_value = 0;
+  if( params_.CheckParameter< double >( "dummy_value" ) ) 
+  {
+    params_.GetParameter( "dummy_value", dummy_value );
+  }
+  else if( output_raster->params().useDummy_ )
+  {
+    dummy_value = output_raster->params().dummy_[ 0 ];
+  }
+  else if( input_raster1->params().useDummy_ )
+  {
+    dummy_value = input_raster1->params().dummy_[ 0 ];
+  }  
+  else if( input_raster2->params().useDummy_ )
+  {
+    dummy_value = input_raster2->params().dummy_[ 0 ];
+  }    
+  
+  // Creating the geometric transformation instance
+  // Direct mapping raster 1 indexed space into raster 2 indexed space
+  
+  TeGeometricTransformation::pointer transPrt( 
+    TeGTFactory::make( trans_params ) );
+  TEAGN_TRUE_OR_RETURN( transPrt.isActive(), 
+    "Invalid transformation parameters" );  
+    
+  if( ! transPrt->reset( trans_params ) )
+  {
+    TEAGN_LOG_AND_RETURN( "Invalid transformation parameters" );
+  }   
+  
+  // Guessing intersection polygon on each raster reference
+  // and the global bounding box on raster 1 projected reference
+  
+  TePolygon interPolR1Ref;
+  TePolygon interPolR2Ref;
+  TeBox globalBBoxR1Ref;
+  
+  {
+    // Raster 2 bounding box - raster 2 reference
+    TePolygon r2BBoxR2Ref;
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::buildDetailedBBox( input_raster2,
+      r2BBoxR2Ref ), "Internal error" );
+      
+    // Raster 2 bounding box - raster 2 indexed reference
+    TePolygon r2BBoxR2IdxRef;
+    TePDIUtils::MapCoords2RasterIndexes( r2BBoxR2Ref, input_raster2, 
+      r2BBoxR2IdxRef );
+      
+    // Raster 2 bounding box - raster 1 indexed reference
+    TePolygon r2BBoxR1IdxRef;
+    {
+      TeLine2D line;
+      TeCoord2D pt1;
+      TeCoord2D pt2;
+      
+      TEAGN_DEBUG_CONDITION( r2BBoxR2IdxRef.size() == 1,
+        "Invalid number of polygon rings" );
+      
+      for( unsigned int pointIdx = 0 ; pointIdx < r2BBoxR2IdxRef[ 0 ].size() ;
+        ++pointIdx )
+      {
+        pt2 = r2BBoxR2IdxRef[ 0 ][ pointIdx ];
+        
+        transPrt->inverseMap( pt2, pt1 );
+        
+        line.add( pt1 );
+      }
+      
+      r2BBoxR1IdxRef.add( TeLinearRing( line ) );
+    }  
+    
+    // Raster 1 bounding box - raster 1 reference
+    TePolygon r1BBoxR1Ref;
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::buildDetailedBBox( input_raster1,
+      r1BBoxR1Ref ), "Internal error" ); 
+       
+    // Raster 1 bounding box - raster 1 indexed reference
+    TePolygon r1BBoxR1IdxRef;
+    TePDIUtils::MapCoords2RasterIndexes( r1BBoxR1Ref, input_raster1, 
+      r1BBoxR1IdxRef ); 
+      
+    // Raster 1 bounding box PS - raster 1 indexed reference
+    TePolygonSet r1BBoxPSR1IdxRef;
+    r1BBoxPSR1IdxRef.add( r1BBoxR1IdxRef );
+    
+    // Raster 2 bounding box PS - raster 1 indexed reference
+    TePolygonSet r2BBoxPSR1IdxRef;
+    r2BBoxPSR1IdxRef.add( r2BBoxR1IdxRef );    
+          
+    // Calculating the intersection polygon - raster 1 indexed reference 
+    TePolygon interPolR1IdxRef;
+    {
+      TePolygonSet auxPs;
+      
+      TeOVERLAY::TeIntersection( r1BBoxPSR1IdxRef, r2BBoxPSR1IdxRef, 
+        auxPs );
+        
+      if( auxPs.size() )
+      {
+        TEAGN_DEBUG_CONDITION( auxPs.size() == 1, "Invalid PS size" );
+        
+        interPolR1IdxRef = auxPs[ 0 ];
+      }
+    }
+      
+    // Calculating the intersection polygon - raster 2 indexed reference 
+    TePolygon interPolR2IdxRef;
+    
+    if( interPolR1IdxRef.size() )
+    {
+      TeLine2D line;
+      TeCoord2D pt1;
+      TeCoord2D pt2;
+      
+      TEAGN_DEBUG_CONDITION( interPolR1IdxRef.size() == 1, 
+        "Invalid intersection polygon rings number" );
+      
+      for( unsigned int pointIdx = 0 ; pointIdx < interPolR1IdxRef[ 0 ].size() ;
+        ++pointIdx )
+      {
+        pt1 = interPolR1IdxRef[ 0 ][ pointIdx ];
+        
+        transPrt->directMap( pt1, pt2 );
+        
+        line.add( pt2 );
+      }
+      
+      interPolR2IdxRef.add( TeLinearRing( line ) );
+    }    
+    
+    // Intersection polygon - raster 1 projected reference 
+    TePDIUtils::MapRasterIndexes2Coords( interPolR1IdxRef, input_raster1, 
+      interPolR1Ref );   
+      
+    // Intersection polygon - raster 2 projected reference 
+    TePDIUtils::MapRasterIndexes2Coords( interPolR2IdxRef, input_raster2, 
+      interPolR2Ref ); 
+      
+    // Raster 2 bounding box - Raster 1 projected reference
+    TePolygon r2BBoxR1Ref;
+    TePDIUtils::MapRasterIndexes2Coords( r2BBoxR1IdxRef, input_raster1, 
+      r2BBoxR1Ref );
+           
+    // Global bounding box - raster 1 projected reference
+    
+    globalBBoxR1Ref = r1BBoxR1Ref.box();
+    updateBox( globalBBoxR1Ref, r2BBoxR1Ref.box() );
+  }
+  
+  // Calc auto equalizing parameters
+  
+  std::vector< double > pixelOffsets1;
+  std::vector< double > pixelScales1;
+  std::vector< double > pixelOffsets2;
+  std::vector< double > pixelScales2;
+  
+  if( auto_equalize && ( interPolR1Ref.size() > 0 ) )
+  {
+    TEAGN_TRUE_OR_RETURN( calcEqParams( input_raster1, channels1,
+      interPolR1Ref, input_raster2, channels2, interPolR2Ref,
+      dummy_value, pixelOffsets1, pixelScales1, pixelOffsets2, pixelScales2 ), 
+      "Error calculating equalization parameters" );
+  }
+  else
+  {
+    for( unsigned int idx = 0 ; idx < channels1.size() ; ++idx )
+    {
+      pixelOffsets1.push_back( 0 );
+      pixelScales1.push_back( 1 );
+      pixelOffsets2.push_back( 0 );
+      pixelScales2.push_back( 1 );      
+    }
+  }
+  
+  // Initiating blender
+  
+  TePDIBlender blender;
+
+  TEAGN_TRUE_OR_RETURN( blender.init( input_raster1, channels1,
+    input_raster2, channels2, blend_method,
+    interp_method, transPrt->getParameters(), dummy_value, pixelOffsets1, pixelScales1, 
+    pixelOffsets2, pixelScales2 ),
+    "Blender initiation error" );
+    
+  // Updating output image geometry
+  
+  TeRasterParams outputRasterParams = output_raster->params();
+  
+  outputRasterParams.nBands( channels1.size() );
+  
+  outputRasterParams.boundingBoxResolution( globalBBoxR1Ref.x1(),
+    globalBBoxR1Ref.y1(), globalBBoxR1Ref.x2(),
+    globalBBoxR1Ref.y2(), input_raster1->params().resx_,
+    input_raster1->params().resy_ );
+    
+  outputRasterParams.projection( input_raster1->projection() );
+    
+  outputRasterParams.setDummy( dummy_value, -1 );
+  
+  TePDITypes::TePDIRasterVectorType rastersVec;
+  rastersVec.push_back( input_raster1 );
+  rastersVec.push_back( input_raster2 );
+  outputRasterParams.setDataType( TePDIUtils::chooseBestPixelType(
+    rastersVec ), -1 );
+  
+  TEAGN_TRUE_OR_RETURN( output_raster->init( outputRasterParams ), 
+    "Output raster init error" );    
+  
+  // Generate output raster blended values
+  
+  const unsigned int outNLines = (unsigned int)output_raster->params().nlines_;
+  const unsigned int outNCols = (unsigned int)output_raster->params().ncols_;
+  const unsigned int outNBands = (unsigned int)output_raster->params().nBands();
+  double value = 0;
+  unsigned int band = 0;
+  unsigned int line = 0;
+  unsigned int col = 0;
+  TeRaster& outRasterRef = *output_raster;
+  const double colOff = ( outRasterRef.params().boundingBox().x1() -
+    input_raster1->params().boundingBox().x1() ) /
+    outRasterRef.params().resx_;
+  const double lineOff = -1.0 * ( outRasterRef.params().boundingBox().y2() -
+    input_raster1->params().boundingBox().y2() ) /
+    outRasterRef.params().resy_;    
+  double outMax = 0;
+  double outMin = 0;
+  
+  TePDIPIManager progress( "Rendering mosaic", outNBands * outNLines,
+    progress_enabled_ );
+  
+  for( band = 0 ; band < outNBands ; ++band )
+  {
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds( output_raster,
+      band, outMin, outMax ), "Internal error" );
+       
+    for( line = 0 ; line < outNLines ; ++line )  
+    {
+      for( col = 0 ; col < outNCols ; ++col )
+      {
+        blender.blend( ((double)line) + lineOff, ((double)col) + colOff, band, 
+          value );
+          
+        value = MIN( value, outMax );
+        value = MAX( value, outMin );
+        
+        TEAGN_TRUE_OR_RETURN( outRasterRef.setElement( col, line, value, 
+          band ), "Error writing value to output raster" );
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+    }
+  }
+  
+  return true;
+}
+
+bool TePDITPMosaic::calcEqParams( 
+  const TePDITypes::TePDIRasterPtrType& raster1, 
+  const std::vector< unsigned int >& channels1,
+  TePolygon& interPolR1Ref,
+  const TePDITypes::TePDIRasterPtrType& raster2,
+  const std::vector< unsigned int >& channels2,
+  TePolygon& interPolR2Ref,
+  const double& dummyValue,
+  std::vector< double >& pixelOffsets1, 
+  std::vector< double >& pixelScales1,
+  std::vector< double >& pixelOffsets2, 
+  std::vector< double >& pixelScales2 ) const
+{
+  TEAGN_DEBUG_CONDITION( raster1.isActive(), "Invalid pointer" );
+  TEAGN_DEBUG_CONDITION( channels1.size(), "Invalid vector" );
+  TEAGN_DEBUG_CONDITION( interPolR1Ref.size() == 1, "Invalid interpol 1" )
+  TEAGN_DEBUG_CONDITION( raster2.isActive(), "Invalid pointer" );
+  TEAGN_DEBUG_CONDITION( channels2.size(), "Invalid vector" );
+  TEAGN_DEBUG_CONDITION( channels1.size() == channels2.size(), 
+    "Vectors size mismatch" );
+  TEAGN_DEBUG_CONDITION( interPolR2Ref.size() == 1, "Invalid interpol 2" )    
+  
+  pixelOffsets1.clear();
+  pixelScales1.clear();       
+  pixelOffsets2.clear();
+  pixelScales2.clear();      
+
+  // calculating statistic attributes
+  
+  std::vector< double > r1Means;
+  std::vector< double > r1Variances;
+  TEAGN_TRUE_OR_RETURN( calcStats( raster1, channels1, interPolR1Ref,
+    dummyValue, r1Means, r1Variances ), "Error calculating statistics" );
+
+  std::vector< double > r2Means;
+  std::vector< double > r2Variances;
+  TEAGN_TRUE_OR_RETURN( calcStats( raster2, channels2, interPolR2Ref,
+    dummyValue, r2Means, r2Variances ), "Error calculating statistics" );
+    
+  // generating output values
+
+  for( unsigned int idx = 0 ; idx < r1Means.size() ; ++idx )
+  {
+    if( r1Variances[ idx ] > r2Variances[ idx ] )
+    {
+      pixelOffsets1.push_back( 0 );
+      pixelScales1.push_back( 1 );         
+      pixelScales2.push_back( sqrt( r1Variances[ idx ] / r2Variances[ idx ] ) );
+      pixelOffsets2.push_back( r1Means[ idx ] - ( pixelScales2[ idx ] * 
+        r2Means[ idx ] ) );      
+    }
+    else
+    {
+      pixelOffsets2.push_back( 0 );
+      pixelScales2.push_back( 1 );         
+      pixelScales1.push_back( sqrt( r2Variances[ idx ] / r1Variances[ idx ] ) );
+      pixelOffsets1.push_back( r2Means[ idx ] - ( pixelScales1[ idx ] * 
+        r1Means[ idx ] ) ); 
+    }
+  }
+
+  return true;
+}
+
+bool TePDITPMosaic::calcStats( const TePDITypes::TePDIRasterPtrType& raster,
+  const std::vector< unsigned int >& channels,
+  TePolygon& interPol,
+  const double& dummyValue,
+  std::vector< double >& means,
+  std::vector< double >& variances ) const
+{
+  TEAGN_DEBUG_CONDITION( raster.isActive(), "Invalid pointer" );
+  TEAGN_DEBUG_CONDITION( channels.size(), "Invalid vector" );
+  TEAGN_DEBUG_CONDITION( interPol.size() == 1, "Invalid polygon" );
+    
+  means.clear();
+  variances.clear();
+  
+  // Creating the statistic algorithm parameters
+  
+  TePDITypes::TePDIPolygonSetPtrType polsetptr( new TePolygonSet );
+  polsetptr->add( interPol );
+  
+  for( unsigned int cIdx = 0 ; cIdx < channels.size() ; ++cIdx )
+  {
+    TePDIHistogram histo;
+    histo.ToggleProgressInt( progress_enabled_ );
+    TEAGN_TRUE_OR_RETURN( histo.reset( raster, channels[ cIdx ], 0,
+      TeBoxPixelIn, polsetptr ),
+      "Histogram reset error" );
+      
+    TePDIHistogram::const_iterator it = histo.begin();
+    const TePDIHistogram::const_iterator itEnd = histo.end();
+    
+    double pixelsNumber = 0;
+    double sum = 0;
+    
+    while( it != itEnd )
+    {
+      if( it->first != dummyValue )
+      {
+        sum += ( it->first * ((double)it->second) );
+        pixelsNumber += it->second;
+      }
+      
+      ++it;
+    }
+    
+    double mean = sum / pixelsNumber;      
+    
+    it = histo.begin();
+    
+    double variance = 0;
+      
+    while( it != itEnd )
+    {
+      if( it->first != dummyValue )
+      {
+        variance += ( ( (double)it->second ) / pixelsNumber ) *
+          ( it->first - mean ) * ( it->first - mean );
+      }
+      
+      ++it;
+    }      
+  
+    means.push_back( mean );
+    variances.push_back( variance );
+  }
+
+  return true;
+}
+
+
diff --git a/src/terralib/image_processing/TePDITPMosaic.hpp b/src/terralib/image_processing/TePDITPMosaic.hpp
new file mode 100644
index 0000000..25583f4
--- /dev/null
+++ b/src/terralib/image_processing/TePDITPMosaic.hpp
@@ -0,0 +1,137 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDITPMOSAIC_HPP
+  #define TEPDITPMOSAIC_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  
+  #include "TePDIHistogram.hpp"
+
+  /**
+   * @class TePDITPMosaic 
+   * @brief Mosaic of two rasters linked by a tie-points set.
+   * strategy.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup TePDIMosaicGroup
+   *
+   * @note The required parameters are:
+   * @param input_raster1 ( TePDITypes::TePDIRasterPtrType ) - 
+   *  Input raster 1 (this will be the reference raster).
+   * @param input_raster2 ( TePDITypes::TePDIRasterPtrType ) - 
+   *  Input raster 2.
+   * @param channels1 ( std::vector< unsigned int > ) - The channels to process from 
+   * input_raster1.
+   * @param channels2 ( std::vector< unsigned int > ) - The channels to process from 
+   * input_raster2. 
+   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
+   * @param trans_params ( TeGTParams ) - Geometric transformation parameters. 
+   *
+   * @note The optional parameters are:
+   * @param blend_method ( TePDIBlender::BlendMethod ) - Blending method
+   * (default: TePDIBlender::NoBlendMethod).   
+   * @param interp_method ( TePDIInterpolator::InterpMethod ) - Interpolation
+   * method (default TePDIInterpolator::NNMethod) .
+   * @param dummy_value (double) - A dummy pixel value for use 
+   * in pixels where no data is available.     
+   * @param auto_equalize ( int ) - If present ( any value ) 
+   * auto-equalizing will be made ( using overlap area reference ).   
+   *
+   * @note The output_raster parameters will take the reference
+   * raster parameters.   
+   * @note The output raster data type will be automatically to fit the
+   * range of both input rasters.
+   * @note Transformation tie-points: TeCoordPair::pt1 are raster 1 indexed 
+   * (line, column) coordinates and TeCoordPair::pt2 are raster 2 indexed 
+   * (line, column) coordinates.   
+   * @example TePDIMosaic_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDITPMosaic : public TePDIAlgorithm {
+    public :
+      
+
+      TePDITPMosaic();
+
+      ~TePDITPMosaic();
+      
+      //overloaded
+      bool CheckParameters( const TePDIParameters& parameters ) const;      
+
+    protected :
+    
+      //overloaded
+      void ResetState( const TePDIParameters& params );    
+     
+      //overloaded
+      bool RunImplementation();    
+        
+    /**
+     * @brief Calc equalization parameters.
+     * @param raster1 Raster 1 pointer.
+     * @param channels1 Raster 1 channels.
+     * @param interPolR1Ref Intersection polygon - Raster 1 projected reference 
+     * coords.
+     * @param raster1 Raster 2 pointer.
+     * @param channels1 Raster 2 channels.
+     * @param interPolR2Ref Intersection polygon - Raster 2 projected reference 
+     * coords.
+     * @param dummyValue Dummy value.
+     * @param pixelOffsets2 The generated offsets values for raster 1.
+     * @param pixelScales2 The generated scales values for raster 1.
+     * @param pixelOffsets2 The generated offsets values for raster 2.
+     * @param pixelScales2 The generated scales values for raster 2.
+     * @return true if OK, false on errors.
+     */        
+      bool calcEqParams( const TePDITypes::TePDIRasterPtrType& raster1, 
+        const std::vector< unsigned int >& channels1,
+        TePolygon& interPolR1Ref,
+        const TePDITypes::TePDIRasterPtrType& raster2,
+        const std::vector< unsigned int >& channels2,
+        TePolygon& interPolR2Ref,
+        const double& dummyValue,
+        std::vector< double >& pixelOffsets1, 
+        std::vector< double >& pixelScales1,
+        std::vector< double >& pixelOffsets2, 
+        std::vector< double >& pixelScales2 ) const;
+        
+    /**
+     * @brief Calc mean and variances for each raster channel.
+     * @param raster Raster pointer.
+     * @param channels Raster channels.
+     * @param interPol The restriction polygon over input raster (projected
+     * coords).
+     * @param dummyValue Dummy value.
+     * @param means The generated mean values.
+     * @param means The generated variance values.
+     * @return true if OK, false on errors.
+     */           
+      bool calcStats( const TePDITypes::TePDIRasterPtrType& raster,
+        const std::vector< unsigned int >& channels,
+        TePolygon& interPol,
+        const double& dummyValue,
+        std::vector< double >& means,
+        std::vector< double >& variances ) const;
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDITileIndexer.hpp b/src/terralib/image_processing/TePDITileIndexer.hpp
new file mode 100644
index 0000000..91e049f
--- /dev/null
+++ b/src/terralib/image_processing/TePDITileIndexer.hpp
@@ -0,0 +1,242 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDITILEINDEXER_HPP
+#define TEPDITILEINDEXER_HPP
+
+#include <TeGeometry.h>
+#include <TeAgnostic.h>
+
+#include <algorithm>
+
+#include <math.h>
+
+/**
+ * @class Polygon tile indexing class for optmized geometrical relational tests.
+ * @author Gilberto Ribeiro <gribeiro at dpi.inpe.br>
+ * @note The related polygon instance must always be valid ( only the polygon
+ * reference is stored internally ).
+ */
+class PDI_DLL TePDITileIndexer
+{
+  public :
+  
+    /**
+     * @typedef Indexed elements node type( pair< ring index, seg index  ).
+     */
+    typedef vector< pair< unsigned int, unsigned int > > TeTileSegIndex;
+
+  protected:
+    
+    //!< Reference polygon.
+    const TePolygon& refPol_;
+    
+    //!< Tile resolution along "y" axis.
+    double dy_;
+
+    //!< Each tile segments index vector.
+    std::vector<TeTileSegIndex*> tileIndex_;
+    
+    TePDITileIndexer( const TePDITileIndexer& );
+    
+    /** Copy overload */
+    const TePDITileIndexer& operator=( const TePDITileIndexer& );
+    
+    /*! Gets tile index intervals in y direction for a given segment (it does 
+        NOT need to be oriented).
+      \param c1         First segment coordinate.
+      \param c2         Second segment coordinate.
+      \param firstTile  The first tile index that this segment intersects.
+      \param lastTile   The last tile index that this segment intersects.
+     */
+    void getTileIndex(const TeCoord2D& c1, const TeCoord2D& c2, 
+      unsigned int& firstTile, unsigned int& lastTile) const
+    {
+      TEAGN_DEBUG_CONDITION( ( dy_ > 0 ), 
+        "Invalid tile indexer Y resolution" );
+            
+      double lowerY = ((c1.y_ < c2.y_) ? c1.y_ : c2.y_);
+      double upperY = ((c1.y_ > c2.y_) ? c1.y_ : c2.y_);
+
+      firstTile = int((lowerY - refPol_.box().y1()) / dy_);
+      lastTile  = int((upperY - refPol_.box().y1()) / dy_);  
+    }    
+    
+    //! Gets tile index for y coordinate value.
+    /*!
+      \param y         Value of "y" coordinate.
+      \param tileIndex Index of corresponding tile.
+     */
+    void getTileIndex(const double& y, unsigned int& tileIndex) const
+    {
+      TEAGN_DEBUG_CONDITION( ( dy_ > 0 ), 
+        "Invalid tile indexer Y resolution" );
+        
+      tileIndex = int( (y - refPol_.box().y1() ) / dy_ );
+    }    
+    
+    /**
+     * @brief Init internal variables.
+     */
+    void init()
+    {
+      dy_ = 0;
+    }      
+    
+  public:
+  
+    //! Alternative Constructor.
+    /*!
+      \param pol The polygon to index.
+      \param dy Tile size along "y" axis.
+     */
+    TePDITileIndexer( const TePolygon& pol, const double& dy )
+      : refPol_( pol )
+    {
+      TEAGN_DEBUG_CONDITION( ( dy > 0 ),
+        "Invalid tile index dy" );
+        
+      init();
+      
+      dy_ = dy;
+      
+      /* Building new index */
+      
+      if( refPol_.size() > 0 ) {
+        TEAGN_DEBUG_CONDITION( ( dy_ > 0 ), 
+          "Invalid tile indexer Y resolution" );
+              
+        unsigned int total_tiles_number = 1 + 
+          ( (unsigned int)floor( refPol_.box().height() / dy_ ) );
+              
+        for(unsigned int i = 0; i < total_tiles_number; ++i)
+        {
+          tileIndex_.push_back( new TeTileSegIndex );
+        }
+
+        const unsigned int rings_number = refPol_.size();
+
+        // for each polygon ring, we need to index its segments
+        for(unsigned int i = 0; i < rings_number; ++i)
+        {
+          addRing( i );
+        }
+      }
+    }    
+    
+    /**
+     * @brief Clear all internal resources.
+     */
+    void clear()
+    {
+      vector<TeTileSegIndex*>::iterator it = tileIndex_.begin();
+      vector<TeTileSegIndex*>::iterator it_end = tileIndex_.end();
+      
+      while( it != it_end ) {
+        delete ( *it );
+        
+        ++it;
+      }
+      
+      tileIndex_.clear();
+      
+      init();
+    }     
+
+    ~TePDITileIndexer()
+    {
+      clear();
+    }
+    
+    //! Update the tile index with the information of the supplied ring.
+    void addRing( const unsigned int& ring_index )
+    {
+      TEAGN_DEBUG_CONDITION( ( ring_index < refPol_.size() ),
+        "Invalid ring_index" );
+
+      unsigned int num_points = refPol_[ring_index].size();
+        
+      if( num_points > 0 ) {
+        unsigned int numSegments = num_points - 1;
+  
+        for(unsigned int j = 0; j < numSegments; ++j)
+        {
+          // creates a pointer to the segment
+          pair<unsigned int, unsigned int> segPointer(
+            ring_index, j);
+  
+          // finds the tiles that this segments intersects
+          unsigned int firstTileIndex = 0;
+          unsigned int lastTileIndex = 0;
+            
+          getTileIndex( refPol_[ring_index][j], 
+            refPol_[ring_index][j + 1], 
+            firstTileIndex, lastTileIndex);
+              
+          TEAGN_DEBUG_CONDITION( 
+            ( firstTileIndex < tileIndex_.size() ),
+            "Invalid firstTileIndex" );
+          TEAGN_DEBUG_CONDITION(
+            ( lastTileIndex < tileIndex_.size() ),
+            "Invalid lastTileIndex" );
+  
+          // associates the pointer segment to the tiles
+          for(unsigned int k = firstTileIndex; k <= lastTileIndex; ++k)
+          {
+            tileIndex_[k]->push_back(segPointer);
+          }
+        }
+      }
+    }     
+    
+    /*! Gets tile index.
+      \param y Y value.
+      \param index Output tile pointer ( NULL if not found ).
+    */    
+    void getTile( const double& y, TeTileSegIndex** index ) const
+    {
+      unsigned int tidx;
+      getTileIndex( y, tidx );
+      
+      if( tidx < tileIndex_.size() ) {
+        ( *index ) = tileIndex_[ tidx ];
+      } else {
+        ( *index ) = 0;
+      }
+    }
+    
+    const TePolygon& getPol() const
+    {
+      return refPol_;
+    }
+    
+    unsigned int getTilesNumber()
+    {
+      return (unsigned int)tileIndex_.size();
+    }
+
+};
+
+
+#endif
diff --git a/src/terralib/image_processing/TePDITypes.hpp b/src/terralib/image_processing/TePDITypes.hpp
old mode 100755
new mode 100644
index dcbc541..c6b4522
--- a/src/terralib/image_processing/TePDITypes.hpp
+++ b/src/terralib/image_processing/TePDITypes.hpp
@@ -1,136 +1,136 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-/**
- * @file TePDITypes.hpp
- * @brief This file contains a set of type definitions used by PDI module
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- */
-
-#ifndef TEPDITYPES_HPP
-  #define TEPDITYPES_HPP
-
-  #include "TePDIDefines.hpp"
-  #include <TeSharedPtr.h>
-
-  #include <TeRaster.h>
-  #include <TeMatrix.h>
-  #include <TeLayer.h>
-  #include <TeGeometry.h>
-  #include <TeCoord2D.h>
-  #include <TeProjection.h>
-
-  #include <map>
-  #include <vector>
-
-  /**
-   * @brief This namespace contains the global types used by all PDI classes.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIModule
-   */
-  namespace TePDITypes
-  {
-    /**
-     * @brief Type definition for a simple LUT - Look-Up Table.
-     *
-     * @param double (First) input level.
-     * @param double (Second) output level.
-     */
-    typedef std::map< double, double > TePDILutType;
-    
-    /**
-     * @brief Type definition for a simple LUT pointer.
-     */
-    typedef TeSharedPtr< TePDILutType > TePDILutPtrType;    
-
-    /**
-     * @brief Type definition for a two dimentional LUT - Look-Up Table.
-     *
-     * @param double Input level from the first source image.
-     * @param TePDILutType A lut with input levels from the second source image.
-     */
-    typedef std::map< double, TePDILutType > TePDI2DLutType;
-
-    /**
-     * @brief Look-Up Table vector alias definition.
-     */
-    typedef std::vector< TePDILutType > TePDILutsVectorType;
-
-    /**
-     * @brief TeRaster pointer definition.
-     */
-    typedef TeSharedPtr< TeRaster > TePDIRasterPtrType;
-
-    /**
-     * @brief TeRasters vector definition.
-     */
-    typedef std::vector< TePDIRasterPtrType > TePDIRasterVectorType;
-    
-    /**
-     * @brief TeRasters vector pointer definition.
-     */
-    typedef TeSharedPtr< TePDIRasterVectorType > TePDIRasterVectorPtrType;    
-
-    /**
-     * @brief TeLayer pointer definition.
-     */
-    typedef TeSharedPtr< TeLayer > TePDILayerPtrType;
-    
-    /**
-     * @brief TePolygon pointer definition.
-     */
-    typedef TeSharedPtr< TePolygon > TePDIPolygonPtrType;    
-
-    /**
-     * @brief TePolygonSet pointer definition.
-     */
-    typedef TeSharedPtr< TePolygonSet > TePDIPolygonSetPtrType; 
-        
-    /**
-     * @brief TePolygonSet map definition.
-     */    
-    typedef std::map< double, TePolygonSet > TePDIPolSetMapType;      
-    
-    /**
-     * @brief TePolygonSet map pointer definition.
-     */
-    typedef TeSharedPtr< TePDIPolSetMapType > TePDIPolSetMapPtrType;      
-
-    /**
-     * @brief TeMatrix pointer definition.
-     */
-    typedef TeSharedPtr< TeMatrix > TePDIMatrixPtrType;
-    
-    /**
-     * @brief TeCoordPairVect pointer definition.
-     */
-    typedef TeSharedPtr< TeCoordPairVect > TeCoordPairVectPtrType;    
-    
-    /**
-     * @brief TeProjectionParams pointer definition.
-     */
-    typedef TeSharedPtr< TeProjectionParams > TeProjParamsPtrType;    
-  };
-
-#endif //TEPDITYPES_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+/**
+ * @file TePDITypes.hpp
+ * @brief This file contains a set of type definitions used by PDI module
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ */
+
+#ifndef TEPDITYPES_HPP
+  #define TEPDITYPES_HPP
+
+  #include "TePDIDefines.hpp"
+  #include <TeSharedPtr.h>
+
+  #include <TeRaster.h>
+  #include <TeMatrix.h>
+  #include <TeLayer.h>
+  #include <TeGeometry.h>
+  #include <TeCoord2D.h>
+  #include <TeProjection.h>
+
+  #include <map>
+  #include <vector>
+
+  /**
+   * @brief This namespace contains the global types used by all PDI classes.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIModule
+   */
+  namespace TePDITypes
+  {
+    /**
+     * @brief Type definition for a simple LUT - Look-Up Table.
+     *
+     * @param double (First) input level.
+     * @param double (Second) output level.
+     */
+    typedef std::map< double, double > TePDILutType;
+    
+    /**
+     * @brief Type definition for a simple LUT pointer.
+     */
+    typedef TeSharedPtr< TePDILutType > TePDILutPtrType;    
+
+    /**
+     * @brief Type definition for a two dimentional LUT - Look-Up Table.
+     *
+     * @param double Input level from the first source image.
+     * @param TePDILutType A lut with input levels from the second source image.
+     */
+    typedef std::map< double, TePDILutType > TePDI2DLutType;
+
+    /**
+     * @brief Look-Up Table vector alias definition.
+     */
+    typedef std::vector< TePDILutType > TePDILutsVectorType;
+
+    /**
+     * @brief TeRaster pointer definition.
+     */
+    typedef TeSharedPtr< TeRaster > TePDIRasterPtrType;
+
+    /**
+     * @brief TeRasters vector definition.
+     */
+    typedef std::vector< TePDIRasterPtrType > TePDIRasterVectorType;
+    
+    /**
+     * @brief TeRasters vector pointer definition.
+     */
+    typedef TeSharedPtr< TePDIRasterVectorType > TePDIRasterVectorPtrType;    
+
+    /**
+     * @brief TeLayer pointer definition.
+     */
+    typedef TeSharedPtr< TeLayer > TePDILayerPtrType;
+    
+    /**
+     * @brief TePolygon pointer definition.
+     */
+    typedef TeSharedPtr< TePolygon > TePDIPolygonPtrType;    
+
+    /**
+     * @brief TePolygonSet pointer definition.
+     */
+    typedef TeSharedPtr< TePolygonSet > TePDIPolygonSetPtrType; 
+        
+    /**
+     * @brief TePolygonSet map definition.
+     */    
+    typedef std::map< double, TePolygonSet > TePDIPolSetMapType;      
+    
+    /**
+     * @brief TePolygonSet map pointer definition.
+     */
+    typedef TeSharedPtr< TePDIPolSetMapType > TePDIPolSetMapPtrType;      
+
+    /**
+     * @brief TeMatrix pointer definition.
+     */
+    typedef TeSharedPtr< TeMatrix > TePDIMatrixPtrType;
+    
+    /**
+     * @brief TeCoordPairVect pointer definition.
+     */
+    typedef TeSharedPtr< TeCoordPairVect > TeCoordPairVectPtrType;    
+    
+    /**
+     * @brief TeProjectionParams pointer definition.
+     */
+    typedef TeSharedPtr< TeProjectionParams > TeProjParamsPtrType;    
+  };
+
+#endif //TEPDITYPES_HPP
diff --git a/src/terralib/image_processing/TePDIUtils.cpp b/src/terralib/image_processing/TePDIUtils.cpp
old mode 100755
new mode 100644
index 456089f..8c12a5e
--- a/src/terralib/image_processing/TePDIUtils.cpp
+++ b/src/terralib/image_processing/TePDIUtils.cpp
@@ -1,1594 +1,1828 @@
-#include "TePDIUtils.hpp"
-
-#include "TePDIInterpolator.hpp"
-#include "TePDIPIManager.hpp"
-
-#include <TeDecoderMemory.h>
-#include <TeDecoderMemoryMap.h>
-#include <TeDecoderTIFF.h>
-#include <TeRaster.h>
-#include <TeRasterParams.h>
-#include <TeDataTypes.h>
-#include <TeUtils.h>
-#include <TeDefines.h>
-#include <TeVectorRemap.h>
-#include <TeRasterTransform.h>
-#include <TeRasterRemap.h>
-#include <TeProgress.h>
-#include <TeAgnostic.h>
-
-#include <float.h>
-#include <math.h>
-#include <stdio.h>
-
-
-namespace TePDIUtils{
-
-
-  bool TeAllocRAMRaster(
-    TePDITypes::TePDIRasterPtrType& template_raster,
-    TePDITypes::TePDIRasterPtrType& RAMRaster,
-    unsigned int bands, bool force_new_dt, bool force_mm,
-    TeDataType pixel_type )
-  {
-    TEAGN_TRUE_OR_RETURN( template_raster.isActive(),
-      "Inactive Input Raster" );
-    TEAGN_TRUE_OR_RETURN( template_raster->params().status_ != TeRasterParams::TeNotReady,
-      "Input not Ready" );
-
-    TeRasterParams temp_params = template_raster->params();
-
-    if( bands != 0 ) {
-      temp_params.nBands( bands );
-    }
-
-    if( force_new_dt ) {
-      temp_params.setDataType( pixel_type, -1 );
-    }
-
-    return TeAllocRAMRaster( RAMRaster, temp_params, force_mm );
-  }
-
-
-  bool TeAllocRAMRaster(
-    TePDITypes::TePDIRasterPtrType& RAMRaster,
-    unsigned int bands, unsigned int lines, unsigned int columns,
-    bool force_mm, TeDataType pixel_type, TePDIRgbPalette* palette )
-  {
-    TEAGN_TRUE_OR_RETURN( bands > 0, "Invalid bands number" );
-    TEAGN_TRUE_OR_RETURN( lines > 0, "Invalid lines number" );
-    TEAGN_TRUE_OR_RETURN( columns > 0, "Invalid columns number" );
-
-    TeRasterParams temp_params;
-
-    temp_params.nBands( bands );
-
-    temp_params.setDataType( pixel_type, -1 );
-    
-    temp_params.setNLinesNColumns( lines, columns );
-    
-    if( palette != 0 ) {
-      temp_params.setPhotometric( TeRasterParams::TePallete );
-
-      temp_params.lutr_.clear();
-      temp_params.lutg_.clear();
-      temp_params.lutb_.clear();
-
-      TePDIRgbPalette::iterator pal_it = palette->begin();
-      TePDIRgbPalette::iterator pal_it_end = palette->end();
-
-      for( unsigned int lut_index = 0 ; lut_index < palette->size() ;
-           ++lut_index ) {
-
-        temp_params.lutr_.push_back( (unsigned short)pal_it->second.red_ );
-        temp_params.lutg_.push_back( (unsigned short)pal_it->second.green_ );
-        temp_params.lutb_.push_back( (unsigned short)pal_it->second.blue_ );
-
-        ++pal_it;
-      }
-    }    
-
-    return TeAllocRAMRaster( RAMRaster, temp_params, force_mm );
-  }
-  
-  bool TeAllocRAMRaster( TePDITypes::TePDIRasterPtrType& RAMRaster,
-    const TeRasterParams& params, bool force_mm )
-  {
-    return TeAllocRAMRaster( RAMRaster, params,
-      ( force_mm ? TePDIUtilsDiskMemPol : TePDIUtilsAutoMemPol ) );
-  }
-
-  
-  bool TeAllocRAMRaster( TePDITypes::TePDIRasterPtrType& RAMRaster,
-    const TeRasterParams& params, TePDIUtilsMemPol mempol )
-  {
-    TeRasterParams internal_params = params;
-    
-    internal_params.mode_ = 'c';
-  
-    if( mempol == TePDIUtilsRamMemPol ) {
-      internal_params.decoderIdentifier_ = "MEM";
-    } else if( mempol == TePDIUtilsDiskMemPol ) {
-      internal_params.decoderIdentifier_ = "MEMMAP";
-      
-      TEAGN_TRUE_OR_RETURN( TeGetTempFileName( internal_params.fileName_ ),
-        "Unable to get temporary file name" );         
-    } else {
-      /* Auto mem pol */
-      internal_params.decoderIdentifier_ = "SMARTMEM";
-    }
-    
-    if( RAMRaster.isActive() ) {
-      RAMRaster->updateParams( internal_params );
-      return RAMRaster->init( internal_params );
-    } else {
-      RAMRaster.reset( new TeRaster( internal_params ) );
-      return RAMRaster->init();
-    }
-  }
-  
-  
-  bool TeRaster2Geotiff(
-    const TePDITypes::TePDIRasterPtrType& in_raster,
-    const std::string& file_name )
-  {
-    return TeRaster2Geotiff( in_raster, file_name, false );
-  }  
-    
-
-  bool TeRaster2Geotiff(
-    const TePDITypes::TePDIRasterPtrType& in_raster,
-    const std::string& file_name, TeDataType pixel_type )
-  {
-    TEAGN_TRUE_OR_RETURN( in_raster.isActive(),
-      "Inactive Input Raster" );
-    TEAGN_TRUE_OR_RETURN( in_raster->params().status_ != 
-      TeRasterParams::TeNotReady, "Input not Ready" );
-    TEAGN_TRUE_OR_RETURN( file_name.size() != 0,
-      "Invalid file name" );
-
-    TeRasterParams temp_params = in_raster->params();
-
-    temp_params.mode_ = 'c';
-    temp_params.fileName_ = file_name;
-    temp_params.setDataType( pixel_type, -1 );
-    
-    /* Creating disk output raster */
-    
-    TeRaster outRaster;
-
-    outRaster.setDecoder( new TeDecoderTIFF( temp_params ) );
-
-    TEAGN_TRUE_OR_RETURN( outRaster.init(),
-      "Unable to init GeoTIFF Raster" );
-      
-    const unsigned int nlines = outRaster.params().nlines_;
-    const unsigned int ncols = outRaster.params().ncols_;
-    const unsigned int nbands = outRaster.params().nBands();
-    unsigned int line = 0 , col = 0 , band = 0;
-    double value = 0.0;
-    TeRaster& ir = (*in_raster);
-    
-    for( line = 0 ; line < nlines ; ++line )
-      for( band = 0 ; band < nbands ; ++band )
-        for( col = 0 ; col < ncols ; ++col )
-        {
-          ir.getElement( col, line, value, band );
-          outRaster.setElement( col, line, value, band );
-        }
-      
-    return true;
-  }
-  
-  
-
-  bool TeRaster2Geotiff(
-    const TePDITypes::TePDIRasterPtrType& in_raster,
-    const std::string& file_name, bool enable_progress )
-  {
-    TEAGN_TRUE_OR_RETURN( in_raster.isActive(),
-      "Inactive Input Raster" );
-    TEAGN_TRUE_OR_RETURN( in_raster->params().status_ != 
-      TeRasterParams::TeNotReady, "Input not Ready" );
-    TEAGN_TRUE_OR_RETURN( file_name.size() != 0,
-      "Invalid file name" );
-
-    TeRasterParams temp_params = in_raster->params();
-
-    temp_params.mode_ = 'c';
-    temp_params.fileName_ = file_name;
-    
-    /* Creating disk output raster */
-    
-    TeRaster outRaster;
-
-    outRaster.setDecoder( new TeDecoderTIFF( temp_params ) );
-
-    TEAGN_TRUE_OR_RETURN( outRaster.init(),
-      "Unable to init GeoTIFF Raster" );
-      
-    const unsigned int nlines = outRaster.params().nlines_;
-    const unsigned int ncols = outRaster.params().ncols_;
-    const unsigned int nbands = outRaster.params().nBands();
-    unsigned int line = 0 , col = 0 , band = 0;
-    double value = 0.0;
-    TeRaster& ir = (*in_raster);
-    
-    TePDIPIManager progress( "Generating GeoTIFF raster", 
-      nlines, enable_progress );      
-    
-    for( line = 0 ; line < nlines ; ++line )
-    {
-      for( band = 0 ; band < nbands ; ++band )
-      {
-        for( col = 0 ; col < ncols ; ++col )
-        {
-          ir.getElement( col, line, value, band );
-          outRaster.setElement( col, line, value, band );
-        }
-      }
-       
-      TEAGN_FALSE_OR_RETURN( progress.Increment(),
-        "Canceled by the user" )
-    }
-      
-    return true;
-  }  
-
-
-  bool TeCopyRasterPixels(
-    TePDITypes::TePDIRasterPtrType& source_raster,
-    unsigned int source_band,
-    TePDITypes::TePDIRasterPtrType& target_raster,
-    unsigned int target_band,
-    bool discretize_levels,
-    bool trunc_levels )
-  {
-    TEAGN_TRUE_OR_RETURN( source_raster.isActive(),
-      "Inactive Input Raster" );
-    TEAGN_TRUE_OR_RETURN( target_raster.isActive(),
-      "Inactive Output Raster" );
-    TEAGN_TRUE_OR_RETURN( source_raster->params().status_ != TeRasterParams::TeNotReady,
-      "Input not Ready" );
-    TEAGN_TRUE_OR_RETURN( target_raster->params().status_ == TeRasterParams::TeReadyToWrite,
-      "OutPut not Ready" );
-
-    TeRasterParams& source_params = source_raster->params();
-    TeRasterParams& target_params = target_raster->params();
-
-    TEAGN_TRUE_OR_RETURN( (int)source_band < source_params.nBands(),
-      "Invalid source band" );
-    TEAGN_TRUE_OR_RETURN( (int)target_band < target_params.nBands(),
-      "Invalid target band" );
-    TEAGN_TRUE_OR_RETURN( (
-      ( source_params.nlines_ == target_params.nlines_ ) &&
-      ( source_params.ncols_ == target_params.ncols_ ) ),
-      "Input and Output Raster's have different dimentions" );
-      
-    /* Dummy support */
-    
-    const bool source_raster_uses_dummy = source_raster->params().useDummy_;
-    double source_raster_dummy = 0;
-    if( source_raster_uses_dummy ) {
-      source_raster_dummy = source_raster->params().dummy_[ source_band ];
-    }
-    
-    const bool target_raster_uses_dummy = target_raster->params().useDummy_;
-    double target_raster_dummy = 0;
-    if( target_raster_uses_dummy ) {
-      target_raster_dummy = target_raster->params().dummy_[ target_band ];
-    } else if( source_raster_uses_dummy ) {
-      target_raster_dummy = source_raster_dummy;
-    }
-
-    /* Defining the valid values range base on the output raster pixel type */
-
-    double min_value = 0;
-    double max_value = 0;
-
-    TEAGN_TRUE_OR_RETURN(
-      TeGetRasterMinMaxBounds( target_raster, target_band, min_value, max_value ),
-      "Unable to get raster level bounds" );
-
-    /* Pixel by pixel copy loop */
-
-    double pixel_value;
-
-    for( int line = 0 ; line < source_params.nlines_ ; ++line ) {
-      for( int column = 0 ; column < source_params.ncols_ ; ++column ) {
-        if( source_raster->getElement( column, line, pixel_value, 
-          source_band ) ) {
-          
-          if( discretize_levels ) {
-            pixel_value = TeRound( pixel_value );
-          }
-
-          if( trunc_levels ) {
-            if( pixel_value < min_value ) {
-              pixel_value = min_value;
-            } else if( pixel_value > max_value ) {
-              pixel_value = max_value;
-            }
-          }
-
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement( column, line,
-            pixel_value, target_band ), "Pixel copy error" );
-        } else {
-          TEAGN_TRUE_OR_RETURN( source_raster_uses_dummy,
-            "Unable to read from input raster" );
-            
-          TEAGN_TRUE_OR_RETURN( target_raster->setElement( column, line,
-            target_raster_dummy, target_band ), "Pixel copy error" );          
-        }
-      }
-    }
-
-    return true;
-  }
-
-
-  bool TeCopyRasterBands(
-    TePDITypes::TePDIRasterPtrType& source_raster,
-    TePDITypes::TePDIRasterPtrType& target_raster,
-    bool discretize_levels,
-    bool trunc_levels )
-  {
-    TEAGN_TRUE_OR_RETURN( source_raster.isActive(),
-      "Inactive Input Raster" );
-    TEAGN_TRUE_OR_RETURN( target_raster.isActive(),
-      "Inactive Output Raster" );
-    TEAGN_TRUE_OR_RETURN( source_raster->params().status_ != TeRasterParams::TeNotReady,
-      "Input not Ready" );
-    TEAGN_TRUE_OR_RETURN( target_raster->params().status_ == TeRasterParams::TeReadyToWrite,
-      "OutPut not Ready" );
-
-    TeRasterParams& source_params = source_raster->params();
-    TeRasterParams& target_params = target_raster->params();
-
-    TEAGN_TRUE_OR_RETURN(
-      ( ( source_params.nBands() == target_params.nBands() ) &&
-      ( source_params.nlines_ == target_params.nlines_ ) &&
-      ( source_params.ncols_ == target_params.ncols_ ) ),
-      "Input and Output Raster's have different dimentions" );
-
-    for( int band = 0 ; band < source_params.nBands() ; ++band ) {
-      TEAGN_TRUE_OR_RETURN( TeCopyRasterPixels( source_raster, band, target_raster,
-        band, discretize_levels,trunc_levels ), "Unable to copy band " +
-        Te2String( band ) );
-    }
-
-    return true;
-  }
-
-  
-  bool TeGetRasterMinMaxBounds( 
-    const TePDITypes::TePDIRasterPtrType& raster,
-    unsigned int band, double& min, double& max )
-  {
-    TEAGN_TRUE_OR_RETURN( raster.isActive(),
-      "Inactive Input Raster" );
-
-    TeRasterParams& params = raster->params();
-
-    TEAGN_TRUE_OR_RETURN( (int)band < params.nBands(),
-      "Invalid source band" );
-
-    switch( params.dataType_[ band ] ) {
-      case TeBIT :
-      {
-        max = 1;
-        min = 0;
-        break;
-      }
-      case TeUNSIGNEDCHAR :
-      {
-        max = pow( 2., (double)sizeof( unsigned char ) * 8. ) - 1;
-        min = 0;
-        break;
-      }
-      case TeUNSIGNEDSHORT :
-      {
-        max = pow( 2., (double)sizeof( short ) * 8. ) - 1;
-        min = 0;
-        break;
-      }
-      case TeUNSIGNEDLONG :
-      {
-        max = pow( 2., (double)sizeof( unsigned long ) * 8. ) - 1;
-        min = 0;
-        break;
-      }
-      case TeCHAR :
-      {
-        max = ( pow( 2., (double)sizeof( char ) * 8. ) ) / 2;
-        min = -1 * max;
-        break;
-      }
-      case TeSHORT :
-      {
-        max = ( pow( 2., (double)sizeof( short ) * 8. ) ) / 2;
-        min = -1 * max;
-        break;
-      }
-      case TeINTEGER :
-      {
-        max = ( pow( 2., (double)sizeof( int ) * 8. ) ) / 2;
-        min = -1 * max;
-        break;
-      }
-      case TeLONG :
-      {
-        max = ( pow( 2., (double)sizeof( long ) * 8. ) ) / 2;
-        min = -1 * max;
-        break;
-      }
-      case TeFLOAT :
-      {
-        max = FLT_MAX;
-        min = -1 * max;
-        break;
-      }
-      case TeDOUBLE :
-      {
-        max = DBL_MAX;
-        min = -1 * max;
-        break;
-      }
-      default :
-      {
-        TEAGN_LOG_AND_RETURN( "Invalid raster pixel type" );
-        break;
-      }
-    }
-
-    return true;
-  }
-  
-  
-  unsigned long int TeGetRasterReqMem( TeRasterParams& params )
-  {
-    unsigned long int req_mem = 0;
-
-    for( int band = 0 ; band < params.nBands() ; ++band ) {
-      req_mem += params.elementSize( band ) * 
-        params.nlines_ * params.ncols_;
-    }
-    
-    req_mem += sizeof( unsigned short ) * params.lutr_.size();
-    req_mem += sizeof( unsigned short ) * params.lutg_.size();
-    req_mem += sizeof( unsigned short ) * params.lutb_.size();  
-    
-    return req_mem;
-  }
-
-  
-  bool rasterCompare( TePDITypes::TePDIRasterPtrType& raster1,
-    TePDITypes::TePDIRasterPtrType& raster2 )
-  {
-    TEAGN_TRUE_OR_THROW( raster1.isActive(), "Raster1 not active" );
-    TEAGN_TRUE_OR_THROW( raster2.isActive(), "Raster2 not active" );
-    TEAGN_TRUE_OR_THROW( raster1->params().status_ != TeRasterParams::TeNotReady,
-      "Raster1 not ready" );
-    TEAGN_TRUE_OR_THROW( raster2->params().status_ != TeRasterParams::TeNotReady,
-      "Raster2 not ready" );
-
-    TeRasterParams par1 = raster1->params();
-    TeRasterParams par2 = raster2->params();
-
-    if( ( par1.nBands() != par2.nBands() ) ||
-        ( par1.ncols_ != par2.ncols_ ) ||
-        ( par1.nlines_ != par2.nlines_ ) ) {
-
-      return false;
-    }
-
-    for( int bandt = 0 ; bandt < par1.nBands() ; ++bandt ) {
-      if( ( par1.dataType_[ bandt ] != par2.dataType_[ bandt ] ) ||
-          ( par1.photometric_[ bandt ] != par2.photometric_[ bandt ] ) ) {
-
-        return false;
-      }
-    }
-
-    unsigned int lines = ( unsigned int ) par1.nlines_;
-    unsigned int columns = ( unsigned int ) par1.ncols_;
-    double value1 = 0;
-    double value2 = 0;
-
-    for( int band = 0 ; band < par1.nBands() ; ++band ) {
-      for( unsigned int line = 0 ; line < lines ; ++line ) {
-        for( unsigned int column = 0 ; column < columns ; ++column ) {
-          if( raster1->getElement( column, line, value1, band ) !=
-              raster2->getElement( column, line, value2, band ) ) {
-
-            return false;
-          }
-
-          if( value1 != value2 ) {
-            return false;
-          }
-        }
-      }
-    }
-
-    return true;
-  }
-  
-  
-  bool IsFloatBand( const TePDITypes::TePDIRasterPtrType& raster, 
-    unsigned int band  )
-  {
-    TEAGN_TRUE_OR_THROW( raster.isActive(),
-      "Inactive Input Raster" );
-
-    TeRasterParams& params = raster->params();
-
-    TEAGN_TRUE_OR_THROW( (int)band < params.nBands(),
-      "Invalid source band" );
-
-    switch( params.dataType_[ band ] ) {
-      case TeBIT :
-      {
-        return false;
-        break;
-      }
-      case TeUNSIGNEDCHAR :
-      {
-        return false;
-        break;
-      }
-      case TeUNSIGNEDSHORT :
-      {
-        return false;
-        break;
-      }
-      case TeUNSIGNEDLONG :
-      {
-        return false;
-        break;
-      }
-      case TeCHAR :
-      {
-        return false;
-        break;
-      }
-      case TeSHORT :
-      {
-        return false;
-        break;
-      }
-      case TeINTEGER :
-      {
-        return false;
-        break;
-      }
-      case TeLONG :
-      {
-        return false;
-        break;
-      }
-      case TeFLOAT :
-      {
-        return true;
-        break;
-      }
-      case TeDOUBLE :
-      {
-        return true;
-        break;
-      }
-      default :
-      {
-        TEAGN_LOG_AND_THROW( "Invalid raster pixel type" );
-        return false;
-        break;
-      }
-    }
-  }
-  
-  
-  void MapCoords2RasterIndexes( const TeCoord2D& g_in, 
-    const TePDITypes::TePDIRasterPtrType& raster, TeCoord2D& g_out )
-  {
-    TEAGN_TRUE_OR_THROW( raster.isActive(), "Inactive raster" );
-    
-    g_out = raster->coord2Index( g_in );
-  };
-  
-  
-  void MapCoords2RasterIndexes( const TeBox& box_in, 
-      const TePDITypes::TePDIRasterPtrType& raster, TeBox& box_out )
-  {
-    TEAGN_TRUE_OR_THROW( raster.isActive(), "Inactive raster" );
-    
-    TeBox temp_box( raster->coord2Index( box_in.lowerLeft() ),
-      raster->coord2Index( box_in.upperRight() ) );
-      
-    box_out = temp_box;
-  };  
-  
-  
-  void MapRasterIndexes2Coords( const TeCoord2D& g_in, 
-    const TePDITypes::TePDIRasterPtrType& raster, TeCoord2D& g_out )
-  {
-    TEAGN_TRUE_OR_THROW( raster.isActive(), "Inactive raster" );
-      
-    g_out = raster->index2Coord( g_in );
-  };  
-  
-  
-  void MapRasterIndexes2Coords( const TeBox& box_in, 
-      const TePDITypes::TePDIRasterPtrType& raster, TeBox& box_out )
-  {
-    TEAGN_TRUE_OR_THROW( raster.isActive(), "Inactive raster" );
-    
-    TeBox temp_box( raster->index2Coord( box_in.lowerLeft() ),
-      raster->index2Coord( box_in.upperRight() ) );
-      
-    box_out = temp_box;
-  };   
-  
-  
-  void makeSegmentSet( const TeLinearRing& g_in, TeLineSet& g_out )
-  {
-    g_out.clear();
-    
-    const int bound = g_in.size() - 1 ;
-    
-    for( int index = 0 ; index < bound ; ++index ) {
-      TeLine2D line;
-      
-      line.add( g_in[ index ] );
-      line.add( g_in[ index + 1 ] );
-      
-      g_out.add( line );
-    }
-  }
-  
-  
-  bool IsDiscreteLut( const TePDITypes::TePDILutType& lut )
-  {
-    TEAGN_TRUE_OR_THROW( ( lut.size() > 0 ), "Emptry lut" );
-  
-    TePDITypes::TePDILutType::const_iterator it = lut.begin();
-    const TePDITypes::TePDILutType::const_iterator it_end = lut.end();
-  
-    while( it != it_end ) {
-      if( it->first != floor( it->first ) ) {
-        return false;
-      }
-      
-      ++it;
-    }
-    
-    return true;
-  }
-  
-  
-  bool buildDetailedBox( const TePDITypes::TePDIRasterPtrType& raster,
-    TePolygon& box )
-  {
-    box.clear();
-    
-    TEAGN_TRUE_OR_RETURN( raster.isActive(), "raster inactive" );
-    
-    TeLinearRing lr;
-    double lines = (double)raster->params().nlines_;
-    double cols = (double)raster->params().ncols_;
-    double offset = 0;
-    
-    /* Adding top box border ( direction left -> right )*/
-    
-    for( offset = 0 ; offset < cols ; ++offset ) {
-      lr.add( raster->index2Coord( TeCoord2D( offset, 0 ) ) );
-    }
-    
-    /* Adding right box border ( direction up -> down) */
-    
-    for( offset = 1 ; offset < lines ; ++offset ) {
-      lr.add( raster->index2Coord( TeCoord2D( cols - 1, offset ) ) );
-    }
-    
-    /* Adding bottom box border ( direction right ->left )*/
-    
-    for( offset = 1 ; offset < cols ; ++offset ) {
-      lr.add( raster->index2Coord( 
-        TeCoord2D( cols - 1 - offset, lines - 1 ) ) );
-    }      
-    
-    /* Adding left box border ( bottom -> top )*/
-    
-    for( offset = 1 ; offset < lines ; ++offset ) {
-      lr.add( raster->index2Coord( 
-        TeCoord2D( 0, lines - 1 - offset ) ) );
-    }
-        
-    box.add( lr );
-    
-    return true;
-  }
-  
-  
-  bool buildDetailedBBox( const TePDITypes::TePDIRasterPtrType& raster,
-    TePolygon& box )
-  {
-    box.clear();
-    
-    TEAGN_TRUE_OR_RETURN( raster.isActive(), "raster inactive" );
-    
-    TeLinearRing lr;
-    const double lines = (double)raster->params().nlines_;
-    const double cols = (double)raster->params().ncols_;
-    double offset = 0;
-    
-    /* Adding top box border ( direction left -> right )*/
-    
-    for( offset = 0 ; offset <= cols ; ++offset ) {
-      lr.add( raster->index2Coord( TeCoord2D( ( offset - 0.5 ), -0.5 ) ) );
-    }
-    
-    /* Adding right box border ( direction up -> down) */
-    
-    for( offset = 0 ; offset < lines ; ++offset ) {
-      lr.add( raster->index2Coord( 
-        TeCoord2D( ( cols - 0.5 ), offset + 0.5) ) );
-    }
-    
-    /* Adding bottom box border ( direction right ->left )*/
-    
-    for( offset = 0 ; offset < cols ; ++offset ) {
-      lr.add( raster->index2Coord( 
-        TeCoord2D( ( cols - 1.5 - offset ), ( lines - 0.5 ) ) ) );
-    }      
-    
-    /* Adding left box border ( bottom -> top )*/
-    
-    for( offset = 0 ; offset < lines ; ++offset ) {
-      lr.add( raster->index2Coord( 
-        TeCoord2D( -0.5, ( lines - 1.5 - offset ) ) ) );
-    }
-        
-    box.add( lr );
-    
-    return true;
-  }  
-  
-  
-  void getGeodeticPixelRes( TeRasterParams& params,
-    double& x_res, double& y_res )
-  {
-    TEAGN_TRUE_OR_THROW( ( params.projection() != 0 ),
-      "Missing projection" )
-    TEAGN_TRUE_OR_THROW( ( params.projection()->name() != "NoProjection" ),
-      "Invalid projection" );
-      
-    TeCoord2D pixel00( 0, 0 );
-    TeCoord2D rightpixel( 1, 0 );
-    TeCoord2D bottompixel( 0, 1 );
-      
-    pixel00 = params.index2Coord( pixel00 );
-    rightpixel = params.index2Coord( rightpixel );
-    bottompixel = params.index2Coord( bottompixel );
-    
-    pixel00 = params.projection()->PC2LL( pixel00 );
-    rightpixel = params.projection()->PC2LL( rightpixel );
-    bottompixel = params.projection()->PC2LL( bottompixel );
-    
-    x_res = TeDistance( rightpixel, pixel00 );
-    y_res = TeDistance( bottompixel, pixel00 );  
-  }
-  
-    
-  bool reprojectRaster( const TePDITypes::TePDIRasterPtrType& input_raster,
-    TeProjection& target_projection, double target_resx, double target_resy,
-    TePDITypes::TePDIRasterPtrType& output_raster )
-  {
-    TEAGN_TRUE_OR_RETURN( input_raster.isActive(), 
-      "input_raster not active" );
-    TEAGN_TRUE_OR_RETURN( output_raster.isActive(), "Raster2 not active" );
-    TEAGN_TRUE_OR_RETURN( 
-      input_raster->params().status_ != TeRasterParams::TeNotReady,
-      "input_raster not ready" );
-    TEAGN_TRUE_OR_RETURN( 
-      output_raster->params().status_ != TeRasterParams::TeNotReady,
-      "output_raster not ready" ); 
-    TEAGN_TRUE_OR_RETURN( ( input_raster->params().projection() != 0 ),
-      "Missing input_raster projection" )
-    TEAGN_TRUE_OR_RETURN( 
-      ( input_raster->params().projection()->name() != "NoProjection" ),
-      "Invalid input_raster projection" );
-      
-    /* Building the remmaped box */
-      
-    TePolygon original_box_pol;
-    TEAGN_TRUE_OR_RETURN( TePDIUtils::buildDetailedBox( input_raster,
-      original_box_pol ), 
-      "Unable to build detailed box" );
-        
-    TePolygon reprojected_box_pol;  
-    TeVectorRemap( original_box_pol, input_raster->params().projection(),
-      reprojected_box_pol, &target_projection );    
-      
-    /* Remmaping raster */
-  
-    TeRasterParams output_raster_params = output_raster->params();
-    
-    output_raster_params.projection( &target_projection );
-    
-    output_raster_params.nBands( input_raster->params().nBands() );
-    output_raster_params.setDataType( 
-      input_raster->params().dataType_[ 0 ] );
-    output_raster_params.setPhotometric( 
-      input_raster->params().photometric_[ 0 ] );
-    if( input_raster->params().useDummy_ ) {
-      output_raster_params.setDummy( 
-        input_raster->params().dummy_[ 0 ], -1 );
-    }    
-    
-    TeBox reprojected_box = reprojected_box_pol.box();
-    output_raster_params.boxResolution( reprojected_box.x1(), 
-      reprojected_box.y1(), reprojected_box.x2(), reprojected_box.y2(), 
-      target_resx, target_resy );
-      
-    TEAGN_TRUE_OR_RETURN( output_raster->init( output_raster_params ),
-      "Output raster init error" );
-      
-    TeRasterTransform transf( input_raster.nakedPointer(),
-      output_raster.nakedPointer() );
-    transf.setTransfFunction( TeRasterTransform::TeBand2Band );
-      
-    TeRasterRemap remap( input_raster.nakedPointer(), 
-      output_raster.nakedPointer() ) ;
-    remap.setTransformer( &transf );
-    
-    bool progress_interface_enabled = false;
-    if( TeProgress::instance() != 0 ) {
-      progress_interface_enabled = true;
-    }
-    
-    TEAGN_TRUE_OR_RETURN( remap.apply( progress_interface_enabled ),
-      "Raster remapping error" );
-      
-    return true;
-  }
-  
-  
-  short TeRelation( const TeCoord2D& c, const TeTileIndexer& indexer )
-  {
-    TeTileIndexer::TeTileSegIndex* tindex_ptr;
-    const TePolygon& pol = indexer.getPol();
-    
-    indexer.getTile( c.y(), &tindex_ptr );
-    
-    if( tindex_ptr == 0 ) {
-      return TeOUTSIDE;
-    }
-    
-    register double ty, tx;
-    register bool inside_flag = false;
-    register int yflag0, yflag1;
-  
-    TeLinearRing::iterator vtx0, vtx1;
-  
-    tx = c.x();
-    ty = c.y();
-    
-    for( unsigned int i = 0 ; i < tindex_ptr->size() ; ++i ) {
-      TEAGN_DEBUG_CONDITION( ( ( *tindex_ptr )[ i ].first < pol.size() ),
-        "Invalid ring index" );
-      TEAGN_DEBUG_CONDITION( ( ( ( *tindex_ptr )[ i ].second + 1 ) < 
-        pol[ ( *tindex_ptr )[ i ].first ].size() ),
-        "Invalid segment index" );
-    
-      const TeCoord2D& vtx0 = 
-        pol[ ( *tindex_ptr )[ i ].first ][ ( *tindex_ptr )[ i ].second ];
-      const TeCoord2D& vtx1 = 
-      pol[ ( *tindex_ptr )[ i ].first ][ ( *tindex_ptr )[ i ].second + 1 ];
-      
-      yflag0 = (vtx0.y() >= ty);
-      
-      yflag1 = (vtx1.y() >= ty);
-    
-      if(yflag0 != yflag1)
-      {
-        /* TODO - Check Boundary case */
-      
-        if(((vtx1.y() - ty) * (vtx0.x() - vtx1.x()) >=
-              (vtx1.x() - tx) * (vtx0.y() - vtx1.y())) == yflag1)
-        {
-          inside_flag = !inside_flag ;
-        }
-      }
-    
-    }
-    
-    if( inside_flag ) {
-      return TeINSIDE;
-    }
-    
-    return TeOUTSIDE;
-  }  
-  
-  
-  void TeSegSetIntersection( const TeLineSet& ls1, const TeLineSet& ls2,
-    TePointSet& ps )
-  {
-    ps.clear();
-    
-    const unsigned int ls1_size = ls1.size();
-    const unsigned int ls2_size = ls2.size();
-    
-    unsigned int ls1_index = 0;
-    unsigned int ls2_index = 0;
-     
-    bool line1_is_vertical = false;
-    double line1_vertical_x_value = 0;
-    double line1_m = 0;
-    double line1_q = 0;
-    
-    double line2_m = 0;
-    double line2_q = 0;    
-    
-    TeCoord2D candidate_pt;
-    double canditate_pt_x = 0;
-    bool candidate_pt_found = false;
-    
-    double line1_min_x = 0;
-    double line1_min_y = 0;
-    double line1_max_x = 0;
-    double line1_max_y = 0;
-    
-    double line2_min_x = 0;
-    double line2_min_y = 0;
-    double line2_max_x = 0;
-    double line2_max_y = 0;
-    
-    for( ls1_index = 0 ; ls1_index < ls1_size ; ++ls1_index ) {
-      const TeLine2D& line1 = ls1[ ls1_index ];
-      
-      TEAGN_TRUE_OR_THROW( ( line1.size() == 2 ), "Invalid line size" );
-      
-      const TeCoord2D& line1_p1 = line1[ 0 ];
-      const TeCoord2D& line1_p2 = line1[ 1 ];
-      
-      line1_min_x = MIN( line1_p1.x(), line1_p2.x() );
-      line1_min_y = MIN( line1_p1.y(), line1_p2.y() );
-      line1_max_x = MAX( line1_p1.x(), line1_p2.x() );
-      line1_max_y = MAX( line1_p1.y(), line1_p2.y() );
-      
-      if( line1_p1.x() == line1_p2.x() ) {
-        line1_is_vertical = true;
-        
-        line1_vertical_x_value = line1_p1.x();
-      } else {
-        line1_is_vertical = false;
-        
-        line1_m = ( line1_p1.y() - line1_p2.y() ) /
-          ( line1_p1.x() - line1_p2.x() );
-        line1_q = line1_p1.y() - ( line1_m * line1_p1.x() );
-      }
-    
-      for( ls2_index = 0 ; ls2_index < ls2_size ; ++ls2_index ) {
-        candidate_pt_found = false;
-        const TeLine2D& line2 = ls2[ ls2_index ];
-        
-        TEAGN_TRUE_OR_THROW( ( line2.size() == 2 ), "Invalid line size" );
-        
-        const TeCoord2D& line2_p1 = line2[ 0 ];
-        const TeCoord2D& line2_p2 = line2[ 1 ];
-        
-        if( line2_p1.x() == line2_p2.x() ) {
-          if( ! line1_is_vertical ) {
-            candidate_pt.setXY( line2_p1.x(), ( line1_m * line2_p1.x() ) +
-              line1_q );
-            candidate_pt_found = true;
-          }
-        } else {
-          line2_m = ( line2_p1.y() - line2_p2.y() ) /
-            ( line2_p1.x() - line2_p2.x() );
-          line2_q = line2_p1.y() - ( line2_m * line2_p1.x() );        
-        
-          if( line1_is_vertical ) {
-            candidate_pt.setXY( line1_vertical_x_value, 
-              ( line2_m * line1_vertical_x_value ) + line2_q );
-            candidate_pt_found = true;
-          } else {
-            if( line1_m != line2_m ) {
-              canditate_pt_x = (  line2_q - line1_q ) / ( line1_m - line2_m );
-              candidate_pt.setXY( canditate_pt_x, ( line2_m * canditate_pt_x ) + 
-                line2_q );
-              candidate_pt_found = true;
-            }
-          }
-        }
-        
-        if( candidate_pt_found ) {
-          line2_min_x = MIN( line2_p1.x(), line2_p2.x() );
-          line2_min_y = MIN( line2_p1.y(), line2_p2.y() );
-          line2_max_x = MAX( line2_p1.x(), line2_p2.x() );
-          line2_max_y = MAX( line2_p1.y(), line2_p2.y() );        
-          
-          if( ( candidate_pt.x() >= line1_min_x  ) &&
-            ( candidate_pt.y() >= line1_min_y  ) &&
-            ( candidate_pt.x() <= line1_max_x  ) &&
-            ( candidate_pt.y() <= line1_max_y  ) &&
-            ( candidate_pt.x() >= line2_min_x  ) &&
-            ( candidate_pt.y() >= line2_min_y  ) &&
-            ( candidate_pt.x() <= line2_max_x  ) &&
-            ( candidate_pt.y() <= line2_max_y  ) ) {
-            
-            ps.add( candidate_pt );
-          }
-          
-        }
-      }
-    }
-  
-  }
-  
-  TeDataType chooseBestPixelType( TePDITypes::TePDIRasterVectorType& rasters )
-  {
-    TeDataType best_dt = TeUNSIGNEDCHAR;
-    double best_min = 0;
-    double best_max = 255;
-  
-    TePDITypes::TePDIRasterVectorType::iterator it = rasters.begin();
-    TePDITypes::TePDIRasterVectorType::iterator it_end = rasters.end();
-    
-    double curr_min = 0;
-    double curr_max = 0;
-    
-    unsigned int bands_number = 0;
-    unsigned int curr_band = 0;
-    
-    while( it != it_end ) {
-      bands_number = (*it)->params().nBands();
-      
-      curr_band = 0;
-      
-      while( curr_band < bands_number ) {
-        if( TeGetRasterMinMaxBounds( *it, curr_band, curr_min, curr_max ) ) {
-          if( curr_min == best_min ) {
-            if( curr_max > best_max ) {
-              best_dt = (*it)->params().dataType_[ curr_band ];
-              best_max = curr_max;
-              best_min = curr_min;
-            }
-          } else if( curr_max == best_max ) {
-            if( curr_min < best_min ) {
-              best_dt = (*it)->params().dataType_[ curr_band ];
-              best_max = curr_max;
-              best_min = curr_min;
-            }
-          } else {
-            if( ( curr_min < best_min ) || ( curr_max > best_max ) ) {
-              best_dt = (*it)->params().dataType_[ curr_band ];
-              best_max = curr_max;
-              best_min = curr_min;
-            }
-          }
-        }
-        
-        ++curr_band;
-      }
-      
-      ++it;
-    }
-    
-    return best_dt;
-  }
-  
-  
-  void getBandMinMaxValues( const TePDITypes::TePDIRasterPtrType& raster, 
-    unsigned int channel, bool progress_enabled, unsigned int sample_step,  
-    double& min, double& max )
-  {
-    TEAGN_TRUE_OR_THROW( raster.isActive(),
-      "Inactive Input Raster" );
-
-    TeRasterParams& params = raster->params();
-
-    TEAGN_TRUE_OR_THROW( (int)channel < params.nBands(),
-      "Invalid input channel" );  
-  
-    if ( params.decoderIdentifier_ == "DB" ) {
-      
-      min = params.vmin_[ channel ];
-      max = params.vmax_[ channel ];
-    } else {
-      min = DBL_MAX;
-      max = ( -1.0 ) * DBL_MAX;  
-      
-      const unsigned int in_lines_number = params.nlines_;
-      const unsigned int in_columns_number = params.ncols_;
-      const bool use_dummy = params.useDummy_;
-  
-      TePDIPIManager progress( "Guessing channel bounds...", 
-        (unsigned int)ceil( ( (double)in_lines_number ) / 
-        ( (double)( sample_step + 1 ) ) ), progress_enabled );      
-    
-      unsigned int rasterline = 0;
-      unsigned int rastercolumn = 0;
-      double current_raster_level = 0;
-      TeRaster& in_raster_ref = *(raster.nakedPointer());
-      
-      for( rasterline = 0 ; rasterline < in_lines_number ; 
-        rasterline += ( 1 + sample_step ) ) {
-        
-        for( rastercolumn = 0 ; rastercolumn < in_columns_number ; 
-          rastercolumn += ( 1 + sample_step ) ) 
-        {  
-          if( in_raster_ref.getElement( rastercolumn, rasterline,
-              current_raster_level, channel ) ) {
-              
-            if( current_raster_level > max ) {
-              max = current_raster_level;
-            }
-            if( current_raster_level < min ) {
-              min = current_raster_level;
-            }
-          } else {
-            TEAGN_TRUE_OR_THROW( use_dummy,
-              "Unable to read from input raster at line=" +
-              Te2String( rasterline ) + " column=" +
-              Te2String( rastercolumn ) + "channel=" +
-              Te2String( channel ) );
-          }
-        }
-        
-        progress.Increment();
-      }
-    }      
-  }
-  
-  
-  bool convert2MultiBand( const TePDITypes::TePDIRasterPtrType& in_raster,
-    bool progress_enabled, TePDITypes::TePDIRasterPtrType& out_raster )
-  {
-    TEAGN_TRUE_OR_THROW( in_raster.isActive(), 
-      "in_raster pointer inactive" );
-    TEAGN_TRUE_OR_THROW( ( in_raster->params().projection() != 0 ), 
-      "in_raster do not have a projection" );
-      
-    /* Checking if we need a conversion */
-      
-    int in_raster_band = 0;
-    bool conversion_required = false;
-        
-    for( in_raster_band = 0 ; in_raster_band < in_raster->params().nBands() ;
-      ++in_raster_band ) {
-      
-      if( ( in_raster->params().photometric_[ in_raster_band ] !=
-        TeRasterParams::TeMultiBand ) &&
-        ( in_raster->params().photometric_[ in_raster_band ] !=
-        TeRasterParams::TeRGB ) ) {
-      
-        conversion_required = true;
-        in_raster_band = in_raster->params().nBands();
-      }
-    }
-  
-    if( conversion_required ) {
-      TeRasterParams out_raster_params;
-    
-      if( out_raster.isActive() ) {
-        TEAGN_TRUE_OR_THROW( ( out_raster->params().status_ != 
-          TeRasterParams::TeNotReady ), "out_raster not ready" );
-          
-        out_raster_params = out_raster->params();
-      }
-      
-      if( in_raster->params().photometric_[ 0 ] == 
-        TeRasterParams::TePallete ) { 
-                 
-        out_raster_params.nBands( 3 );
-      } else {
-        out_raster_params.nBands( in_raster->params().nBands() );
-      }
-                  
-      TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
-        in_raster->projection()->params() ) );          
-      out_raster_params.projection( proj.nakedPointer() );      
-      
-      out_raster_params.boxResolution( in_raster->params().box().x1(), 
-        in_raster->params().box().y1(), in_raster->params().box().x2(), 
-        in_raster->params().box().y2(), 
-        in_raster->params().resx_, in_raster->params().resy_ );      
-      
-      out_raster_params.setPhotometric( TeRasterParams::TeMultiBand );
-      
-      out_raster_params.setDataType( in_raster->params().dataType_[ 0 ], -1 );
-      
-      if( in_raster->params().useDummy_ ) {
-        out_raster_params.setDummy( in_raster->params().dummy_[ 0 ], -1 );
-      } else {
-        out_raster_params.useDummy_ = false;
-      }
-        
-      if( out_raster.isActive() ) {
-        TEAGN_TRUE_OR_RETURN( out_raster->init( out_raster_params ),
-          "Output raster init error" );
-      } else {
-        TEAGN_TRUE_OR_RETURN( TeAllocRAMRaster( out_raster,
-          out_raster_params, TePDIUtilsAutoMemPol ),
-          "Output raster allocation error" );
-      }
-          
-      /* Creating the transformer instance */
-        
-      TeRasterTransform transformer( in_raster.nakedPointer(), 
-        out_raster.nakedPointer() );
-          
-      if( in_raster->params().photometric_[ 0 ] == 
-        TeRasterParams::TePallete ) {
-          
-        transformer.setTransfFunction( TeRasterTransform::TePall2Three );
-      } else {
-        transformer.setTransfFunction( TeRasterTransform::TeBand2Band );
-      }
-        
-      /* Creating the remapper instance */
-          
-      TeRasterRemap remapper( in_raster.nakedPointer(), 
-        out_raster.nakedPointer(), progress_enabled );
-        
-      remapper.setTransformer( &transformer );
-      
-      TEAGN_TRUE_OR_RETURN( remapper.apply( progress_enabled),
-        "Raster remapping error" );
-    } else {
-      out_raster = in_raster;
-    }
-    
-    return true;
-  }
-  
-  bool compareGeometryPoints( const TeLinearRing& geom1, 
-    const TeLinearRing& geom2 )
-  {
-    unsigned int geom1_size = geom1.size();
-    
-    if( geom1_size == geom2.size() ) {
-    
-      unsigned int index2 = 0;
-      bool point_found = false;
-      
-      for( unsigned int index1 = 0 ; index1 < geom1_size ; ++index1 ) {
-        point_found = false;
-        
-        for( index2 = 0 ; index2 < geom1_size ; ++index2 ) {
-          if( geom1[ index1 ] == geom2[ index2 ] ) {
-            point_found = true;
-            break;    
-          }
-        }
-        
-        if( ! point_found ) {
-          return false;
-        }
-      }
-      
-      return true;
-    } else {
-      return false;
-    }
-  }
-  
-
-  bool resampleRasterByRes( const TePDITypes::TePDIRasterPtrType& input_raster,
-    const TePDITypes::TePDIRasterPtrType& output_raster,
-    double x_resolution_ratio, double y_resolution_ratio, 
-    TePDIInterpolator::InterpMethod interpol, 
-    bool enable_progress ) 
-  {
-      
-    TEAGN_TRUE_OR_RETURN( input_raster.isActive(), "Inactive input raster" );
-    TEAGN_TRUE_OR_RETURN( 
-      input_raster->params().status_ != TeRasterParams::TeNotReady,
-      "Input raster not ready" )
-    
-    TEAGN_TRUE_OR_RETURN( output_raster.isActive(), 
-      "Inactive output raster" );
-    TEAGN_TRUE_OR_RETURN( 
-      output_raster->params().status_ != TeRasterParams::TeNotReady,
-      "Output raster not ready" )
-      
-    TEAGN_TRUE_OR_RETURN( ( x_resolution_ratio > 0.0 ), "Invalid X ratio" )
-    TEAGN_TRUE_OR_RETURN( ( y_resolution_ratio > 0.0 ), "Invalid X ratio" )
-    
-    unsigned int out_lines = TeRound( 
-      ( (double)input_raster->params().nlines_ ) / 
-      y_resolution_ratio );
-    unsigned int out_cols = TeRound( 
-      ( (double)input_raster->params().ncols_ ) / 
-      x_resolution_ratio );      
-    
-    return resampleRasterByLinsCols( input_raster, output_raster, 
-      out_lines, out_cols, enable_progress, interpol );
-  }
-
-
-  bool resampleRasterByLinsCols( 
-    const TePDITypes::TePDIRasterPtrType& input_raster,
-    const TePDITypes::TePDIRasterPtrType& output_raster,
-    unsigned int out_lines, 
-    unsigned int out_cols,
-    bool enable_progress, 
-    TePDIInterpolator::InterpMethod interpol ) 
-  {
-      
-    TEAGN_TRUE_OR_THROW( input_raster.isActive(), "Inactive input raster" );
-    TEAGN_TRUE_OR_RETURN( 
-      input_raster->params().status_ != TeRasterParams::TeNotReady,
-      "Input raster not ready" )
-    
-    TEAGN_TRUE_OR_THROW( output_raster.isActive(), 
-      "Inactive output raster" );
-    TEAGN_TRUE_OR_RETURN( 
-      output_raster->params().status_ != TeRasterParams::TeNotReady,
-      "Output raster not ready" )
-      
-    TEAGN_TRUE_OR_RETURN( ( out_lines > 0 ), "Invalid out_lines" )
-    TEAGN_TRUE_OR_RETURN( ( out_cols > 0 ), "Invalid out_cols" )
-    
-    /* Reseting the output raster to the new geometry */
-    
-    TeRasterParams& input_raster_params = input_raster->params();
-    
-    TeRasterParams new_output_raster_params = output_raster->params();
-    
-    new_output_raster_params.nBands( input_raster_params.nBands() );
-    new_output_raster_params.setPhotometric( 
-      input_raster_params.photometric_[ 0 ], -1 );
-    new_output_raster_params.boxLinesColumns( 
-      input_raster_params.box().x1(), 
-      input_raster_params.box().y1(), 
-      input_raster_params.box().x2(), 
-      input_raster_params.box().y2(), 
-      out_lines, out_cols );
-      
-    TEAGN_TRUE_OR_RETURN( output_raster->init( 
-      new_output_raster_params ),
-      "Output raster reset error" )
-
-    TEAGN_DEBUG_CONDITION( 
-      ( output_raster->params().nlines_ == (int)out_lines ),
-      "Invalid nlines_" )
-    TEAGN_DEBUG_CONDITION( 
-      ( output_raster->params().ncols_ == (int)out_cols ),
-      "Invalid ncols_" )
-      
-    /* interpolating pixel values */
-    
-    const TeRasterParams& output_raster_params = 
-      output_raster->params();
-    
-    const unsigned int out_bands = output_raster_params.nBands();
-    
-    double in_col = 0;
-    double in_line = 0;
-    unsigned int out_col = 0;
-    unsigned int out_line = 0;
-    unsigned int out_band = 0;
-    double value = 0;
-    const double y_resolution_ratio = 
-      ( (double) input_raster->params().nlines_ ) /
-      ( (double) out_lines );
-    const double x_resolution_ratio = 
-      ( (double) input_raster->params().ncols_ ) /
-      ( (double) out_cols );
-    
-    double dummy_value = 0;
-    if( input_raster_params.useDummy_ ) {
-      dummy_value = input_raster_params.dummy_[ 0 ];
-    }
-    
-    TeRaster& output_raster_ref = *( output_raster.nakedPointer() );
-    
-    TePDIInterpolator interpolator;
-    TEAGN_TRUE_OR_RETURN( interpolator.reset( input_raster, 
-      interpol,
-      dummy_value), "Interpolator reset error" )
-      
-    TePDIPIManager progress( "Ressampling raster", 
-      ( out_bands * out_lines ), enable_progress );
-    
-    for( out_band = 0 ; out_band < out_bands ; ++out_band ) {
-      for( out_line = 0 ; out_line < out_lines ; ++out_line ) {
-        in_line = ( (double)out_line) * y_resolution_ratio;
-      
-        for( out_col = 0 ; out_col < out_cols ; ++out_col ) {
-          in_col = ( (double)out_col) * x_resolution_ratio;
-        
-          interpolator.interpolate( in_line, in_col, out_band, 
-            value );
-      
-          TEAGN_TRUE_OR_RETURN( output_raster_ref.setElement( 
-            out_col, out_line, value, out_band ), 
-            "Output raster writing error" )
-        }
-        
-        TEAGN_FALSE_OR_RETURN( progress.Increment(), 
-          "Canceled by user" );
-      }
-    }
-    
-    return true;
-  }
-  
-  
-  bool composeRaster( 
-    const TePDITypes::TePDIRasterVectorType& input_rasters,
-    const std::vector< unsigned int > input_channels,
-    TePDITypes::TePDIRasterPtrType& output_raster,
-    bool enable_progress )
-  {
-    TEAGN_TRUE_OR_THROW( ( input_rasters.size() == input_channels.size() ),
-      "Invalid input channels number" )
-    TEAGN_TRUE_OR_THROW( output_raster.isActive(), 
-      "Inactive output raster" );      
-  
-    if( input_rasters.size() == 0 )
-    { 
-      output_raster.reset();
-      return true;
-    }
-    else
-    {
-      /* Checking reference raster */
-      
-      TEAGN_TRUE_OR_THROW( input_rasters[ 0 ].isActive(),
-        "Invalid input reference raster pointer" )
-            
-      TeRasterParams ref_params = input_rasters[ 0 ]->params();
-      
-      TEAGN_TRUE_OR_THROW( 
-        ( ref_params.status_ != TeRasterParams::TeNotReady ),
-        "Invalid input reference raster" )
-      
-      /* creating the output parameters */
-      
-      {
-        TeRasterParams newoutpars = output_raster->params();
-        TeBox ref_bbox = ref_params.boundingBox();
-        newoutpars.boundingBoxLinesColumns( 
-          ref_bbox.x1(), 
-          ref_bbox.y1(), 
-          ref_bbox.x2(), 
-          ref_bbox.y2(), 
-          ref_params.nlines_, ref_params.ncols_ );
-        newoutpars.nBands( input_rasters.size() );
-        newoutpars.projection( ref_params.projection() );
-        newoutpars.setPhotometric( TeRasterParams::TeMultiBand, -1 );
-        
-        for( unsigned int input_channels_idx = 0 ; 
-          input_channels_idx < input_channels.size() ; ++input_channels_idx )
-        {
-          /* Checking input raster pointers */
-          
-          TEAGN_TRUE_OR_THROW( 
-            ( input_rasters[ input_channels_idx ].isActive() ),
-            "Invalid input raster pointer" )
-            
-          /* Checking input raster status */
-          
-          TEAGN_TRUE_OR_THROW( 
-            ( input_rasters[ input_channels_idx ]->params().status_ != 
-            TeRasterParams::TeNotReady ),
-            "Invalid input raster" )            
-                      
-          /* Checking input_channels indexes */
-          
-          const int& curr_input_channel = input_channels[ 
-            input_channels_idx ];
-          
-          TEAGN_TRUE_OR_THROW( 
-            ( curr_input_channel < 
-            input_rasters[ input_channels_idx ]->nBands() ),
-            "Invalid band index" )
-            
-          /* Checking input raster lines and columns */
-          
-          TEAGN_TRUE_OR_THROW( 
-            ( input_rasters[ input_channels_idx ]->params().nlines_ == 
-            ref_params.nlines_ ),
-            "Invalid input raster lines number" )     
-          TEAGN_TRUE_OR_THROW( 
-            ( input_rasters[ input_channels_idx ]->params().ncols_ == 
-            ref_params.ncols_ ),
-            "Invalid input raster columns number" )                                 
-          
-          /* Seting the output data type */
-          
-          newoutpars.setDataType(
-            input_rasters[ input_channels_idx ]->params().dataType_[ 
-            curr_input_channel ], (int)input_channels_idx );
-        }
-        
-        /* Reseting output raster */
-        
-        TEAGN_TRUE_OR_RETURN( output_raster->init( newoutpars ),
-          "Error initiating output raster" )
-          
-        /* Copying data */
-        
-        const unsigned int lines_per_raster = (unsigned int)
-          ref_params.nlines_;
-        const unsigned int cols_per_raster = (unsigned int)
-          ref_params.ncols_;
-        TeRaster& out_raster_ref = *output_raster;
-        unsigned int curr_line = 0;
-        unsigned int curr_col = 0;
-        double value = 0;
-          
-        TePDIPIManager progress( "Composing raster", 
-          input_channels.size() * lines_per_raster, enable_progress );            
-        
-        for( unsigned int input_channels_idx = 0 ; 
-          input_channels_idx < input_channels.size() ; ++input_channels_idx )
-        {
-          const int& curr_input_channel = input_channels[ 
-            input_channels_idx ];
-          TeRaster& cur_in_raster = 
-            *( input_rasters[ input_channels_idx ] );
-            
-          for( curr_line = 0 ; curr_line < lines_per_raster ; ++curr_line )
-          {
-            for( curr_col = 0 ; curr_col < cols_per_raster ; ++curr_col )
-            {
-              cur_in_raster.getElement( curr_col, curr_line, value, 
-                curr_input_channel );
-              TEAGN_TRUE_OR_RETURN( out_raster_ref.setElement( curr_col, 
-                curr_line, value, input_channels_idx ),
-                "Error writting output raster" );
-            }
-            
-            TEAGN_FALSE_OR_RETURN( progress.Increment(),
-              "Canceled by the user" )
-          }
-        }        
-      }
-      
-      return true;
-    }
-  }
-  
-  bool loadRaster( const std::string& fileName, 
-      TePDITypes::TePDIRasterPtrType& memRasterPtr, bool enable_progress )
-  {
-    TeRaster inRaster( fileName, 'r' );
-    TEAGN_TRUE_OR_RETURN( inRaster.init(), "Input disk raster init error" );
-    
-    TEAGN_TRUE_OR_RETURN( TeAllocRAMRaster( memRasterPtr, inRaster.params(), 
-      TePDIUtilsAutoMemPol ), "Memory raster allocation error" );
-    
-    unsigned int band = 0;
-    const unsigned int bandsN = (unsigned int)inRaster.params().nBands();
-    unsigned int line = 0;
-    const unsigned int linesN = (unsigned int)inRaster.params().nlines_;
-    unsigned int col = 0;
-    const unsigned int colsN = (unsigned int)inRaster.params().ncols_;
-    TeRaster& memRaster = *memRasterPtr;
-    double value = 0;
-    
-    TePDIPIManager progress( "Loading raster", 
-      bandsN * linesN, enable_progress );       
-    
-    for( band = 0 ; band < bandsN ; ++band )
-      for( line = 0 ; line < linesN ; ++line )
-      {
-        for( col = 0 ; col < colsN ; ++col )
-        {
-          inRaster.getElement( col, line, value, band );
-          memRaster.setElement( col, line, value, band );
-        }
-        
-        TEAGN_FALSE_OR_RETURN( progress.Increment(),  
-          "Canceled by the user" );
-      }
-    
-    return true;
-  }
-  
-} // namespace TeUtils
-
+#include "TePDIUtils.hpp"
+
+#include "TePDIInterpolator.hpp"
+#include "TePDIPIManager.hpp"
+
+#include <TeRaster.h>
+#include <TeRasterParams.h>
+#include <TeDataTypes.h>
+#include <TeUtils.h>
+#include <TeDefines.h>
+#include <TeVectorRemap.h>
+#include <TeRasterTransform.h>
+#include <TeRasterRemap.h>
+#include <TeProgress.h>
+#include <TeAgnostic.h>
+#include <TeDecoderJPEG.h>
+#include <TeDecoder.h>
+
+
+#include <float.h>
+#include <math.h>
+#include <stdio.h>
+
+
+namespace TePDIUtils{
+
+
+  bool TeAllocRAMRaster(
+    TePDITypes::TePDIRasterPtrType& template_raster,
+    TePDITypes::TePDIRasterPtrType& RAMRaster,
+    unsigned int bands, bool force_new_dt, bool force_mm,
+    TeDataType pixel_type )
+  {
+    TEAGN_TRUE_OR_RETURN( template_raster.isActive(),
+      "Inactive Input Raster" );
+    TEAGN_TRUE_OR_RETURN( template_raster->params().status_ != TeRasterParams::TeNotReady,
+      "Input not Ready" );
+
+    TeRasterParams temp_params = template_raster->params();
+
+    if( bands != 0 ) {
+      temp_params.nBands( bands );
+    }
+
+    if( force_new_dt ) {
+      temp_params.setDataType( pixel_type, -1 );
+    }
+
+    return TeAllocRAMRaster( RAMRaster, temp_params, force_mm );
+  }
+
+
+  bool TeAllocRAMRaster(
+    TePDITypes::TePDIRasterPtrType& RAMRaster,
+    unsigned int bands, unsigned int lines, unsigned int columns,
+    bool force_mm, TeDataType pixel_type, TePDIRgbPalette* palette )
+  {
+    TEAGN_TRUE_OR_RETURN( bands > 0, "Invalid bands number" );
+    TEAGN_TRUE_OR_RETURN( lines > 0, "Invalid lines number" );
+    TEAGN_TRUE_OR_RETURN( columns > 0, "Invalid columns number" );
+
+    TeRasterParams temp_params;
+
+    temp_params.nBands( bands );
+
+    temp_params.setDataType( pixel_type, -1 );
+    
+    temp_params.setNLinesNColumns( lines, columns );
+    
+    if( palette != 0 ) {
+      temp_params.setPhotometric( TeRasterParams::TePallete );
+
+      temp_params.lutr_.clear();
+      temp_params.lutg_.clear();
+      temp_params.lutb_.clear();
+
+      TePDIRgbPalette::iterator pal_it = palette->begin();
+      TePDIRgbPalette::iterator pal_it_end = palette->end();
+
+      for( unsigned int lut_index = 0 ; lut_index < palette->size() ;
+           ++lut_index ) {
+
+        temp_params.lutr_.push_back( (unsigned short)pal_it->second.red_ );
+        temp_params.lutg_.push_back( (unsigned short)pal_it->second.green_ );
+        temp_params.lutb_.push_back( (unsigned short)pal_it->second.blue_ );
+
+        ++pal_it;
+      }
+    }    
+
+    return TeAllocRAMRaster( RAMRaster, temp_params, force_mm );
+  }
+  
+  bool TeAllocRAMRaster( TePDITypes::TePDIRasterPtrType& RAMRaster,
+    const TeRasterParams& params, bool force_mm )
+  {
+    return TeAllocRAMRaster( RAMRaster, params,
+      ( force_mm ? TePDIUtilsDiskMemPol : TePDIUtilsAutoMemPol ) );
+  }
+
+  
+  bool TeAllocRAMRaster( TePDITypes::TePDIRasterPtrType& RAMRaster,
+    const TeRasterParams& params, TePDIUtilsMemPol mempol )
+  {
+    TeRasterParams internal_params = params;
+    internal_params.mode_ = 'c';
+    internal_params.decoderIdentifier_ = "SMARTMEM";
+    
+    switch( mempol )
+    {
+      case TePDIUtilsAutoMemPol :
+      {
+        // use the default
+        break;
+      }
+      case TePDIUtilsRamMemPol :
+      {
+        internal_params.decoderParams_.push_back( std::pair< std::string, 
+          std::string >( "MaxMemPercentUsage", "100" ) );
+        break;
+      }      
+      case TePDIUtilsDiskMemPol :
+      {
+        internal_params.decoderParams_.push_back( std::pair< std::string, 
+          std::string >( "MaxMemPercentUsage", "0" ) );
+        break;
+      }     
+      default :
+      {
+        TEAGN_LOG_AND_THROW( "Invalid memory policy" );
+        break;
+      }
+    }
+    
+    RAMRaster.reset( new TeRaster( internal_params ) );
+  
+    return RAMRaster->init();
+  }
+  
+  bool TeAllocRAMRaster( const TeRasterParams& params,
+      TePDITypes::TePDIRasterPtrType& rasterPointer )
+  {
+    return TeAllocRAMRaster( rasterPointer, params, 
+      TePDIUtilsAutoMemPol );
+  }  
+  
+  bool TeRaster2Geotiff(
+    const TePDITypes::TePDIRasterPtrType& in_raster,
+    const std::string& file_name )
+  {
+    return TeRaster2Geotiff( in_raster, file_name, false );
+  }  
+    
+
+  bool TeRaster2Geotiff(
+    const TePDITypes::TePDIRasterPtrType& in_raster,
+    const std::string& file_name, TeDataType pixel_type )
+  {
+    TEAGN_TRUE_OR_RETURN( in_raster.isActive(),
+      "Inactive Input Raster" );
+    TEAGN_TRUE_OR_RETURN( in_raster->params().status_ != 
+      TeRasterParams::TeNotReady, "Input not Ready" );
+    TEAGN_TRUE_OR_RETURN( file_name.size() != 0,
+      "Invalid file name" );
+
+    TeRasterParams temp_params = in_raster->params();
+
+    temp_params.mode_ = 'c';
+    temp_params.fileName_ = file_name;
+    temp_params.decoderIdentifier_ = "TIF";
+    temp_params.setDataType( pixel_type, -1 );
+    
+    /* Creating disk output raster */
+    
+    TeRaster outRaster( temp_params );
+
+    TEAGN_TRUE_OR_RETURN( outRaster.init(),
+      "Unable to init GeoTIFF Raster" );
+      
+    const unsigned int nlines = outRaster.params().nlines_;
+    const unsigned int ncols = outRaster.params().ncols_;
+    const unsigned int nbands = outRaster.params().nBands();
+    unsigned int line = 0 , col = 0 , band = 0;
+    double value = 0.0;
+    TeRaster& ir = (*in_raster);
+    
+    for( line = 0 ; line < nlines ; ++line )
+      for( band = 0 ; band < nbands ; ++band )
+        for( col = 0 ; col < ncols ; ++col )
+        {
+          ir.getElement( col, line, value, band );
+          outRaster.setElement( col, line, value, band );
+        }
+      
+    return true;
+  }
+
+  bool TeRaster2Geotiff(
+    const TePDITypes::TePDIRasterPtrType& in_raster,
+    const std::string& file_name, bool enable_progress )
+  {
+    TEAGN_TRUE_OR_RETURN( in_raster.isActive(),
+      "Inactive Input Raster" );
+    TEAGN_TRUE_OR_RETURN( in_raster->params().status_ != 
+      TeRasterParams::TeNotReady, "Input not Ready" );
+    TEAGN_TRUE_OR_RETURN( file_name.size() != 0,
+      "Invalid file name" );
+
+    TeRasterParams temp_params = in_raster->params();
+
+    temp_params.mode_ = 'c';
+    temp_params.fileName_ = file_name;
+    temp_params.decoderIdentifier_ = "TIF";
+    
+    /* Creating disk output raster */
+    
+    TeRaster outRaster( temp_params );
+
+    TEAGN_TRUE_OR_RETURN( outRaster.init(),
+      "Unable to init GeoTIFF Raster" );
+      
+    const unsigned int nlines = outRaster.params().nlines_;
+    const unsigned int ncols = outRaster.params().ncols_;
+    const unsigned int nbands = outRaster.params().nBands();
+    unsigned int line = 0 , col = 0 , band = 0;
+    double value = 0.0;
+    TeRaster& ir = (*in_raster);
+    
+    TePDIPIManager progress( "Generating GeoTIFF raster", 
+      nlines, enable_progress );      
+    
+    for( line = 0 ; line < nlines ; ++line )
+    {
+      for( band = 0 ; band < nbands ; ++band )
+      {
+        for( col = 0 ; col < ncols ; ++col )
+        {
+          ir.getElement( col, line, value, band );
+          outRaster.setElement( col, line, value, band );
+        }
+      }
+       
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" )
+    }
+      
+    return true;
+  }  
+  
+  bool TeRaster2RGBGeotiff(
+    const TePDITypes::TePDIRasterPtrType& in_raster,
+    const std::string& file_name, bool enable_progress )
+  {
+    TEAGN_TRUE_OR_RETURN( in_raster.isActive(),
+      "Inactive Input Raster" );
+    TEAGN_TRUE_OR_RETURN( in_raster->params().status_ != 
+      TeRasterParams::TeNotReady, "Input not Ready" );
+    TEAGN_TRUE_OR_RETURN( in_raster->params().nBands() == 3,
+      "Invalid input raster" );      
+    TEAGN_TRUE_OR_RETURN( file_name.size() != 0,
+      "Invalid file name" );
+
+    TeRasterParams temp_params = in_raster->params();
+    temp_params.setPhotometric( TeRasterParams::TeRGB, -1 );
+    temp_params.mode_ = 'c';
+    temp_params.fileName_ = file_name;
+    temp_params.decoderIdentifier_ = "TIF";
+    
+    /* Creating disk output raster */
+    
+    TeRaster outRaster( temp_params );
+    TEAGN_TRUE_OR_RETURN( outRaster.init(),
+      "Unable to init GeoTIFF Raster" );
+      
+    const unsigned int nlines = outRaster.params().nlines_;
+    const unsigned int ncols = outRaster.params().ncols_;
+    const unsigned int nbands = outRaster.params().nBands();
+    unsigned int line = 0 , col = 0 , band = 0;
+    double value = 0.0;
+    TeRaster& ir = (*in_raster);
+    
+    TePDIPIManager progress( "Generating RGB GeoTIFF raster", 
+      nlines, enable_progress );      
+    
+    for( line = 0 ; line < nlines ; ++line )
+    {
+      for( band = 0 ; band < nbands ; ++band )
+      {
+        for( col = 0 ; col < ncols ; ++col )
+        {
+          ir.getElement( col, line, value, band );
+          outRaster.setElement( col, line, value, band );
+        }
+      }
+       
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" )
+    }
+      
+    return true;
+  }  
+  
+  bool TeRaster2Jpeg(
+    const TePDITypes::TePDIRasterPtrType& in_raster,
+    const std::string& file_name, bool enable_progress,
+    unsigned int qualityFactor )
+  {
+    TEAGN_TRUE_OR_RETURN( in_raster.isActive(),
+      "Inactive Input Raster" );
+    TEAGN_TRUE_OR_RETURN( in_raster->params().status_ != 
+      TeRasterParams::TeNotReady, "Input not Ready" );
+    TEAGN_TRUE_OR_RETURN( file_name.size() != 0,
+      "Invalid file name" );
+      
+    // Create a decoder instance
+
+    TeRasterParams temp_params = in_raster->params();
+
+    temp_params.mode_ = 'c';
+    temp_params.fileName_ = file_name;
+    temp_params.decoderIdentifier_ = "JPEG";
+    
+    TeDecoderJPEG* decPtr = dynamic_cast< TeDecoderJPEG* >(
+      TeDecoderFactory::make( "JPEG", temp_params ) );
+    TEAGN_TRUE_OR_RETURN( decPtr != 0, "Unable to build a decoder instance" );    
+    decPtr->setQualityFactor( qualityFactor );
+    
+    /* Creating disk output raster */
+    
+    TeRaster outRaster;
+    outRaster.setDecoder( decPtr );
+
+    TEAGN_TRUE_OR_RETURN( outRaster.init(),
+      "Unable to init Jpeg Raster" );
+      
+    // Copying data
+      
+    const unsigned int nlines = outRaster.params().nlines_;
+    const unsigned int ncols = outRaster.params().ncols_;
+    const unsigned int nbands = outRaster.params().nBands();
+    unsigned int line = 0 , col = 0 , band = 0;
+    double value = 0.0;
+    TeRaster& ir = (*in_raster);
+    
+    TePDIPIManager progress( "Generating Jpeg raster", 
+      nlines, enable_progress );      
+    
+    for( line = 0 ; line < nlines ; ++line )
+    {
+      for( band = 0 ; band < nbands ; ++band )
+      {
+        for( col = 0 ; col < ncols ; ++col )
+        {
+          ir.getElement( col, line, value, band );
+          outRaster.setElement( col, line, value, band );
+        }
+      }
+       
+      TEAGN_FALSE_OR_RETURN( progress.Increment(),
+        "Canceled by the user" )
+    }
+      
+    return true;
+  }
+
+
+  bool TeCopyRasterPixels(
+    TePDITypes::TePDIRasterPtrType& source_raster,
+    unsigned int source_band,
+    TePDITypes::TePDIRasterPtrType& target_raster,
+    unsigned int target_band,
+    bool discretize_levels,
+    bool trunc_levels )
+  {
+    TEAGN_TRUE_OR_RETURN( source_raster.isActive(),
+      "Inactive Input Raster" );
+    TEAGN_TRUE_OR_RETURN( target_raster.isActive(),
+      "Inactive Output Raster" );
+    TEAGN_TRUE_OR_RETURN( source_raster->params().status_ != TeRasterParams::TeNotReady,
+      "Input not Ready" );
+    TEAGN_TRUE_OR_RETURN( target_raster->params().status_ == TeRasterParams::TeReadyToWrite,
+      "OutPut not Ready" );
+
+    TeRasterParams& source_params = source_raster->params();
+    TeRasterParams& target_params = target_raster->params();
+
+    TEAGN_TRUE_OR_RETURN( (int)source_band < source_params.nBands(),
+      "Invalid source band" );
+    TEAGN_TRUE_OR_RETURN( (int)target_band < target_params.nBands(),
+      "Invalid target band" );
+    TEAGN_TRUE_OR_RETURN( (
+      ( source_params.nlines_ == target_params.nlines_ ) &&
+      ( source_params.ncols_ == target_params.ncols_ ) ),
+      "Input and Output Raster's have different dimentions" );
+      
+    /* Dummy support */
+    
+    const bool source_raster_uses_dummy = source_raster->params().useDummy_;
+    double source_raster_dummy = 0;
+    if( source_raster_uses_dummy ) {
+      source_raster_dummy = source_raster->params().dummy_[ source_band ];
+    }
+    
+    const bool target_raster_uses_dummy = target_raster->params().useDummy_;
+    double target_raster_dummy = 0;
+    if( target_raster_uses_dummy ) {
+      target_raster_dummy = target_raster->params().dummy_[ target_band ];
+    } else if( source_raster_uses_dummy ) {
+      target_raster_dummy = source_raster_dummy;
+    }
+
+    /* Defining the valid values range base on the output raster pixel type */
+
+    double min_value = 0;
+    double max_value = 0;
+
+    TEAGN_TRUE_OR_RETURN(
+      TeGetRasterMinMaxBounds( target_raster, target_band, min_value, max_value ),
+      "Unable to get raster level bounds" );
+
+    /* Pixel by pixel copy loop */
+
+    double pixel_value;
+
+    for( int line = 0 ; line < source_params.nlines_ ; ++line ) {
+      for( int column = 0 ; column < source_params.ncols_ ; ++column ) {
+        if( source_raster->getElement( column, line, pixel_value, 
+          source_band ) ) {
+          
+          if( discretize_levels ) {
+            pixel_value = TeRound( pixel_value );
+          }
+
+          if( trunc_levels ) {
+            if( pixel_value < min_value ) {
+              pixel_value = min_value;
+            } else if( pixel_value > max_value ) {
+              pixel_value = max_value;
+            }
+          }
+
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement( column, line,
+            pixel_value, target_band ), "Pixel copy error" );
+        } else {
+          TEAGN_TRUE_OR_RETURN( source_raster_uses_dummy,
+            "Unable to read from input raster" );
+            
+          TEAGN_TRUE_OR_RETURN( target_raster->setElement( column, line,
+            target_raster_dummy, target_band ), "Pixel copy error" );          
+        }
+      }
+    }
+
+    return true;
+  }
+
+
+  bool TeCopyRasterBands(
+    TePDITypes::TePDIRasterPtrType& source_raster,
+    TePDITypes::TePDIRasterPtrType& target_raster,
+    bool discretize_levels,
+    bool trunc_levels )
+  {
+    TEAGN_TRUE_OR_RETURN( source_raster.isActive(),
+      "Inactive Input Raster" );
+    TEAGN_TRUE_OR_RETURN( target_raster.isActive(),
+      "Inactive Output Raster" );
+    TEAGN_TRUE_OR_RETURN( source_raster->params().status_ != TeRasterParams::TeNotReady,
+      "Input not Ready" );
+    TEAGN_TRUE_OR_RETURN( target_raster->params().status_ == TeRasterParams::TeReadyToWrite,
+      "OutPut not Ready" );
+
+    TeRasterParams& source_params = source_raster->params();
+    TeRasterParams& target_params = target_raster->params();
+
+    TEAGN_TRUE_OR_RETURN(
+      ( ( source_params.nBands() == target_params.nBands() ) &&
+      ( source_params.nlines_ == target_params.nlines_ ) &&
+      ( source_params.ncols_ == target_params.ncols_ ) ),
+      "Input and Output Raster's have different dimentions" );
+
+    for( int band = 0 ; band < source_params.nBands() ; ++band ) {
+      TEAGN_TRUE_OR_RETURN( TeCopyRasterPixels( source_raster, band, target_raster,
+        band, discretize_levels,trunc_levels ), "Unable to copy band " +
+        Te2String( band ) );
+    }
+
+    return true;
+  }
+
+  
+  bool TeGetRasterMinMaxBounds( 
+    const TePDITypes::TePDIRasterPtrType& raster,
+    unsigned int band, double& min, double& max )
+  {
+    TEAGN_TRUE_OR_RETURN( raster.isActive(),
+      "Inactive Input Raster" );
+
+    TeRasterParams& params = raster->params();
+
+    TEAGN_TRUE_OR_RETURN( (int)band < params.nBands(),
+      "Invalid source band" );
+
+    switch( params.dataType_[ band ] ) {
+      case TeBIT :
+      {
+        max = 1;
+        min = 0;
+        break;
+      }
+      case TeUNSIGNEDCHAR :
+      {
+        max = pow( 2., (double)sizeof( unsigned char ) * 8. ) - 1;
+        min = 0;
+        break;
+      }
+      case TeUNSIGNEDSHORT :
+      {
+        max = pow( 2., (double)sizeof( short ) * 8. ) - 1;
+        min = 0;
+        break;
+      }
+      case TeUNSIGNEDLONG :
+      {
+        max = pow( 2., (double)sizeof( unsigned long ) * 8. ) - 1;
+        min = 0;
+        break;
+      }
+      case TeCHAR :
+      {
+        max = ( pow( 2., (double)sizeof( char ) * 8. ) ) / 2;
+        min = -1 * max;
+        break;
+      }
+      case TeSHORT :
+      {
+        max = ( pow( 2., (double)sizeof( short ) * 8. ) ) / 2;
+        min = -1 * max;
+        break;
+      }
+      case TeINTEGER :
+      {
+        max = ( pow( 2., (double)sizeof( int ) * 8. ) ) / 2;
+        min = -1 * max;
+        break;
+      }
+      case TeLONG :
+      {
+        max = ( pow( 2., (double)sizeof( long ) * 8. ) ) / 2;
+        min = -1 * max;
+        break;
+      }
+      case TeFLOAT :
+      {
+        max = FLT_MAX;
+        min = -1 * max;
+        break;
+      }
+      case TeDOUBLE :
+      {
+        max = DBL_MAX;
+        min = -1 * max;
+        break;
+      }
+      default :
+      {
+        TEAGN_LOG_AND_RETURN( "Invalid raster pixel type" );
+        break;
+      }
+    }
+
+    return true;
+  }
+  
+  
+  unsigned long int TeGetRasterReqMem( TeRasterParams& params )
+  {
+    unsigned long int req_mem = 0;
+
+    for( int band = 0 ; band < params.nBands() ; ++band ) {
+      req_mem += params.elementSize( band ) * 
+        params.nlines_ * params.ncols_;
+    }
+    
+    req_mem += sizeof( unsigned short ) * params.lutr_.size();
+    req_mem += sizeof( unsigned short ) * params.lutg_.size();
+    req_mem += sizeof( unsigned short ) * params.lutb_.size();  
+    
+    return req_mem;
+  }
+
+  
+  bool rasterCompare( TePDITypes::TePDIRasterPtrType& raster1,
+    TePDITypes::TePDIRasterPtrType& raster2 )
+  {
+    TEAGN_TRUE_OR_THROW( raster1.isActive(), "Raster1 not active" );
+    TEAGN_TRUE_OR_THROW( raster2.isActive(), "Raster2 not active" );
+    TEAGN_TRUE_OR_THROW( raster1->params().status_ != TeRasterParams::TeNotReady,
+      "Raster1 not ready" );
+    TEAGN_TRUE_OR_THROW( raster2->params().status_ != TeRasterParams::TeNotReady,
+      "Raster2 not ready" );
+
+    TeRasterParams par1 = raster1->params();
+    TeRasterParams par2 = raster2->params();
+
+    if( ( par1.nBands() != par2.nBands() ) ||
+        ( par1.ncols_ != par2.ncols_ ) ||
+        ( par1.nlines_ != par2.nlines_ ) ) {
+
+      return false;
+    }
+
+    for( int bandt = 0 ; bandt < par1.nBands() ; ++bandt ) {
+      if( ( par1.dataType_[ bandt ] != par2.dataType_[ bandt ] ) ||
+          ( par1.photometric_[ bandt ] != par2.photometric_[ bandt ] ) ) {
+
+        return false;
+      }
+    }
+
+    unsigned int lines = ( unsigned int ) par1.nlines_;
+    unsigned int columns = ( unsigned int ) par1.ncols_;
+    double value1 = 0;
+    double value2 = 0;
+
+    for( int band = 0 ; band < par1.nBands() ; ++band ) {
+      for( unsigned int line = 0 ; line < lines ; ++line ) {
+        for( unsigned int column = 0 ; column < columns ; ++column ) {
+          if( raster1->getElement( column, line, value1, band ) !=
+              raster2->getElement( column, line, value2, band ) ) {
+
+            return false;
+          }
+
+          if( value1 != value2 ) {
+            return false;
+          }
+        }
+      }
+    }
+
+    return true;
+  }
+  
+  
+  bool IsFloatBand( const TePDITypes::TePDIRasterPtrType& raster, 
+    unsigned int band  )
+  {
+    TEAGN_TRUE_OR_THROW( raster.isActive(),
+      "Inactive Input Raster" );
+
+    TeRasterParams& params = raster->params();
+
+    TEAGN_TRUE_OR_THROW( (int)band < params.nBands(),
+      "Invalid source band" );
+
+    switch( params.dataType_[ band ] ) {
+      case TeBIT :
+      {
+        return false;
+        break;
+      }
+      case TeUNSIGNEDCHAR :
+      {
+        return false;
+        break;
+      }
+      case TeUNSIGNEDSHORT :
+      {
+        return false;
+        break;
+      }
+      case TeUNSIGNEDLONG :
+      {
+        return false;
+        break;
+      }
+      case TeCHAR :
+      {
+        return false;
+        break;
+      }
+      case TeSHORT :
+      {
+        return false;
+        break;
+      }
+      case TeINTEGER :
+      {
+        return false;
+        break;
+      }
+      case TeLONG :
+      {
+        return false;
+        break;
+      }
+      case TeFLOAT :
+      {
+        return true;
+        break;
+      }
+      case TeDOUBLE :
+      {
+        return true;
+        break;
+      }
+      default :
+      {
+        TEAGN_LOG_AND_THROW( "Invalid raster pixel type" );
+        return false;
+        break;
+      }
+    }
+  }
+  
+  
+  void MapCoords2RasterIndexes( const TeCoord2D& g_in, 
+    const TePDITypes::TePDIRasterPtrType& raster, TeCoord2D& g_out )
+  {
+    TEAGN_TRUE_OR_THROW( raster.isActive(), "Inactive raster" );
+    
+    g_out = raster->coord2Index( g_in );
+  };
+  
+  
+  void MapCoords2RasterIndexes( const TeBox& box_in, 
+      const TePDITypes::TePDIRasterPtrType& raster, TeBox& box_out )
+  {
+    TEAGN_TRUE_OR_THROW( raster.isActive(), "Inactive raster" );
+    
+    TeBox temp_box( raster->coord2Index( box_in.lowerLeft() ),
+      raster->coord2Index( box_in.upperRight() ) );
+      
+    box_out = temp_box;
+  };  
+  
+  
+  void MapRasterIndexes2Coords( const TeCoord2D& g_in, 
+    const TePDITypes::TePDIRasterPtrType& raster, TeCoord2D& g_out )
+  {
+    TEAGN_TRUE_OR_THROW( raster.isActive(), "Inactive raster" );
+      
+    g_out = raster->index2Coord( g_in );
+  };  
+  
+  
+  void MapRasterIndexes2Coords( const TeBox& box_in, 
+      const TePDITypes::TePDIRasterPtrType& raster, TeBox& box_out )
+  {
+    TEAGN_TRUE_OR_THROW( raster.isActive(), "Inactive raster" );
+    
+    TeBox temp_box( raster->index2Coord( box_in.lowerLeft() ),
+      raster->index2Coord( box_in.upperRight() ) );
+      
+    box_out = temp_box;
+  };   
+  
+  
+  void makeSegmentSet( const TeLinearRing& g_in, TeLineSet& g_out )
+  {
+    g_out.clear();
+    
+    const int bound = g_in.size() - 1 ;
+    
+    for( int index = 0 ; index < bound ; ++index ) {
+      TeLine2D line;
+      
+      line.add( g_in[ index ] );
+      line.add( g_in[ index + 1 ] );
+      
+      g_out.add( line );
+    }
+  }
+  
+  
+  bool IsDiscreteLut( const TePDITypes::TePDILutType& lut )
+  {
+    TEAGN_TRUE_OR_THROW( ( lut.size() > 0 ), "Emptry lut" );
+  
+    TePDITypes::TePDILutType::const_iterator it = lut.begin();
+    const TePDITypes::TePDILutType::const_iterator it_end = lut.end();
+  
+    while( it != it_end ) {
+      if( it->first != floor( it->first ) ) {
+        return false;
+      }
+      
+      ++it;
+    }
+    
+    return true;
+  }
+  
+  bool buildDetailedBox( TeRaster& raster, TePolygon& box )
+  {
+    box.clear();
+    
+    TEAGN_TRUE_OR_RETURN( raster.params().status_ != 
+      TeRasterParams::TeNotReady, "raster inactive" );
+    
+    TeLine2D line2D;
+    double lines = (double)raster.params().nlines_;
+    double cols = (double)raster.params().ncols_;
+    double offset = 0;
+    
+    /* Adding top box border ( direction left -> right )*/
+    
+    for( offset = 0 ; offset < cols ; ++offset ) {
+      line2D.add( raster.index2Coord( TeCoord2D( offset, 0 ) ) );
+    }
+    
+    /* Adding right box border ( direction up -> down) */
+    
+    for( offset = 1 ; offset < lines ; ++offset ) {
+      line2D.add( raster.index2Coord( TeCoord2D( cols - 1, offset ) ) );
+    }
+    
+    /* Adding bottom box border ( direction right ->left )*/
+    
+    for( offset = 1 ; offset < cols ; ++offset ) {
+      line2D.add( raster.index2Coord( 
+        TeCoord2D( cols - 1 - offset, lines - 1 ) ) );
+    }      
+    
+    /* Adding left box border ( bottom -> top )*/
+    
+    for( offset = 1 ; offset < lines ; ++offset ) {
+      line2D.add( raster.index2Coord( 
+        TeCoord2D( 0, lines - 1 - offset ) ) );
+    }
+        
+    TeLinearRing lr( line2D );    
+    box.add( lr );
+    
+    return true;
+  }
+  
+  bool buildDetailedBox( const TePDITypes::TePDIRasterPtrType& raster,
+    TePolygon& box )
+  {
+    return buildDetailedBox( *raster, box );
+  }
+  
+  bool buildDetailedBBox( TeRaster& raster, TePolygon& box )
+  {
+    box.clear();
+    
+    TEAGN_TRUE_OR_RETURN( raster.params().status_ != 
+      TeRasterParams::TeNotReady, "raster inactive" );
+    
+    TeLine2D line2D;
+    const double lines = (double)raster.params().nlines_;
+    const double cols = (double)raster.params().ncols_;
+    double offset = 0;
+    
+    /* Adding top box border ( direction left -> right )*/
+    
+    for( offset = 0 ; offset <= cols ; ++offset ) {
+      line2D.add( raster.index2Coord( TeCoord2D( ( offset - 0.5 ), -0.5 ) ) );
+    }
+    
+    /* Adding right box border ( direction up -> down) */
+    
+    for( offset = 0 ; offset < lines ; ++offset ) {
+      line2D.add( raster.index2Coord( 
+        TeCoord2D( ( cols - 0.5 ), offset + 0.5) ) );
+    }
+    
+    /* Adding bottom box border ( direction right ->left )*/
+    
+    for( offset = 0 ; offset < cols ; ++offset ) {
+      line2D.add( raster.index2Coord( 
+        TeCoord2D( ( cols - 1.5 - offset ), ( lines - 0.5 ) ) ) );
+    }      
+    
+    /* Adding left box border ( bottom -> top )*/
+    
+    for( offset = 0 ; offset < lines ; ++offset ) {
+      line2D.add( raster.index2Coord( 
+        TeCoord2D( -0.5, ( lines - 1.5 - offset ) ) ) );
+    }
+        
+    TeLinearRing lr( line2D );    
+    box.add( lr );
+    
+    return true;
+  }  
+  
+  bool buildDetailedBBox( const TePDITypes::TePDIRasterPtrType& raster,
+    TePolygon& box )
+  {
+    return buildDetailedBBox( *raster, box );
+  }  
+    
+  bool reprojectRaster( TeRaster& input_raster,
+    unsigned int outNLines, unsigned int outNCols, 
+    TeProjection& target_projection,
+    bool enableProgress,
+    TeRaster& output_raster )
+  {
+    TEAGN_TRUE_OR_RETURN( 
+      input_raster.params().status_ != TeRasterParams::TeNotReady,
+      "input_raster not ready" );
+    TEAGN_TRUE_OR_RETURN( 
+      output_raster.params().status_ != TeRasterParams::TeNotReady,
+      "output_raster not ready" ); 
+    TEAGN_TRUE_OR_RETURN( ( input_raster.params().projection() != 0 ),
+      "Missing input_raster projection" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_raster.params().projection()->name() != "NoProjection" ),
+      "Invalid input_raster projection" );
+      
+    /* Building the remmaped box */
+      
+    TePolygon original_bbox_pol;
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::buildDetailedBBox( input_raster,
+      original_bbox_pol ), 
+      "Unable to build detailed box" );
+        
+    TePolygon reprojected_bbox_pol;  
+    TeVectorRemap( original_bbox_pol, input_raster.params().projection(),
+      reprojected_bbox_pol, &target_projection );    
+      
+    /* Remmaping raster */
+  
+    TeRasterParams output_raster_params = output_raster.params();
+    
+    output_raster_params.projection( &target_projection );
+    
+    output_raster_params.nBands( input_raster.params().nBands() );
+    output_raster_params.setDataType( 
+      input_raster.params().dataType_[ 0 ] );
+    output_raster_params.setPhotometric( 
+      input_raster.params().photometric_[ 0 ] );
+    if( input_raster.params().useDummy_ ) {
+      output_raster_params.setDummy( 
+        input_raster.params().dummy_[ 0 ], -1 );
+    }
+    
+    TeBox reprojected_bbox = reprojected_bbox_pol.box();
+    output_raster_params.boundingBoxLinesColumns( reprojected_bbox.x1(), 
+      reprojected_bbox.y1(), reprojected_bbox.x2(), reprojected_bbox.y2(), 
+      outNLines, outNCols );
+      
+    TEAGN_TRUE_OR_RETURN( output_raster.init( output_raster_params ),
+      "Output raster init error" );
+      
+    TeRasterTransform transf( &input_raster, &output_raster );
+    transf.setTransfFunction( TeRasterTransform::TeBand2Band );
+      
+    TeRasterRemap remap( &input_raster,  &output_raster );
+    remap.setTransformer( &transf );
+    
+    TEAGN_TRUE_OR_RETURN( remap.apply( enableProgress ),
+      "Raster remapping error" );
+      
+    return true;
+  }
+  
+  bool reprojectRaster( TeRaster& input_raster,
+    TeProjection& target_projection, double target_resx, double target_resy,
+    bool enableProgress,
+    TeRaster& output_raster )
+  {
+    TEAGN_TRUE_OR_RETURN( 
+      input_raster.params().status_ != TeRasterParams::TeNotReady,
+      "input_raster not ready" );
+    TEAGN_TRUE_OR_RETURN( 
+      output_raster.params().status_ != TeRasterParams::TeNotReady,
+      "output_raster not ready" ); 
+    TEAGN_TRUE_OR_RETURN( ( input_raster.params().projection() != 0 ),
+      "Missing input_raster projection" )
+    TEAGN_TRUE_OR_RETURN( 
+      ( input_raster.params().projection()->name() != "NoProjection" ),
+      "Invalid input_raster projection" );
+      
+    /* Building the remmaped box */
+      
+    TePolygon original_bbox_pol;
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::buildDetailedBBox( input_raster,
+      original_bbox_pol ), 
+      "Unable to build detailed box" );
+        
+    TePolygon reprojected_bbox_pol;  
+    TeVectorRemap( original_bbox_pol, input_raster.params().projection(),
+      reprojected_bbox_pol, &target_projection );    
+      
+    // Number of output lines
+    
+    const unsigned int outNLines = (unsigned int)ceil(
+      reprojected_bbox_pol.box().height() / target_resy );
+    const unsigned int outNCols = (unsigned int)ceil(
+      reprojected_bbox_pol.box().width() / target_resx );
+      
+    return reprojectRaster( input_raster, outNLines, outNCols,
+      target_projection, enableProgress, output_raster);
+  }  
+  
+  short TeRelation( const TeCoord2D& c, const TePDITileIndexer& indexer )
+  {
+    TePDITileIndexer::TeTileSegIndex* tindex_ptr;
+    const TePolygon& pol = indexer.getPol();
+    
+    indexer.getTile( c.y(), &tindex_ptr );
+    
+    if( tindex_ptr == 0 ) {
+      return TeOUTSIDE;
+    }
+    
+    register double ty, tx;
+    register bool inside_flag = false;
+    register int yflag0, yflag1;
+  
+    TeLinearRing::iterator vtx0, vtx1;
+  
+    tx = c.x();
+    ty = c.y();
+    
+    for( unsigned int i = 0 ; i < tindex_ptr->size() ; ++i ) {
+      TEAGN_DEBUG_CONDITION( ( ( *tindex_ptr )[ i ].first < pol.size() ),
+        "Invalid ring index" );
+      TEAGN_DEBUG_CONDITION( ( ( ( *tindex_ptr )[ i ].second + 1 ) < 
+        pol[ ( *tindex_ptr )[ i ].first ].size() ),
+        "Invalid segment index" );
+    
+      const TeCoord2D& vtx0 = 
+        pol[ ( *tindex_ptr )[ i ].first ][ ( *tindex_ptr )[ i ].second ];
+      const TeCoord2D& vtx1 = 
+      pol[ ( *tindex_ptr )[ i ].first ][ ( *tindex_ptr )[ i ].second + 1 ];
+      
+      yflag0 = (vtx0.y() >= ty);
+      
+      yflag1 = (vtx1.y() >= ty);
+    
+      if(yflag0 != yflag1)
+      {
+        /* TODO - Check Boundary case */
+      
+        if(((vtx1.y() - ty) * (vtx0.x() - vtx1.x()) >=
+              (vtx1.x() - tx) * (vtx0.y() - vtx1.y())) == yflag1)
+        {
+          inside_flag = !inside_flag ;
+        }
+      }
+    
+    }
+    
+    if( inside_flag ) {
+      return TeINSIDE;
+    }
+    
+    return TeOUTSIDE;
+  }  
+  
+  
+  void TeSegSetIntersection( const TeLineSet& ls1, const TeLineSet& ls2,
+    TePointSet& ps )
+  {
+    ps.clear();
+    
+    const unsigned int ls1_size = ls1.size();
+    const unsigned int ls2_size = ls2.size();
+    
+    unsigned int ls1_index = 0;
+    unsigned int ls2_index = 0;
+     
+    bool line1_is_vertical = false;
+    double line1_vertical_x_value = 0;
+    double line1_m = 0;
+    double line1_q = 0;
+    
+    double line2_m = 0;
+    double line2_q = 0;    
+    
+    TeCoord2D candidate_pt;
+    double canditate_pt_x = 0;
+    bool candidate_pt_found = false;
+    
+    double line1_min_x = 0;
+    double line1_min_y = 0;
+    double line1_max_x = 0;
+    double line1_max_y = 0;
+    
+    double line2_min_x = 0;
+    double line2_min_y = 0;
+    double line2_max_x = 0;
+    double line2_max_y = 0;
+    
+    for( ls1_index = 0 ; ls1_index < ls1_size ; ++ls1_index ) {
+      const TeLine2D& line1 = ls1[ ls1_index ];
+      
+      TEAGN_TRUE_OR_THROW( ( line1.size() == 2 ), "Invalid line size" );
+      
+      const TeCoord2D& line1_p1 = line1[ 0 ];
+      const TeCoord2D& line1_p2 = line1[ 1 ];
+      
+      line1_min_x = MIN( line1_p1.x(), line1_p2.x() );
+      line1_min_y = MIN( line1_p1.y(), line1_p2.y() );
+      line1_max_x = MAX( line1_p1.x(), line1_p2.x() );
+      line1_max_y = MAX( line1_p1.y(), line1_p2.y() );
+      
+      if( line1_p1.x() == line1_p2.x() ) {
+        line1_is_vertical = true;
+        
+        line1_vertical_x_value = line1_p1.x();
+      } else {
+        line1_is_vertical = false;
+        
+        line1_m = ( line1_p1.y() - line1_p2.y() ) /
+          ( line1_p1.x() - line1_p2.x() );
+        line1_q = line1_p1.y() - ( line1_m * line1_p1.x() );
+      }
+    
+      for( ls2_index = 0 ; ls2_index < ls2_size ; ++ls2_index ) {
+        candidate_pt_found = false;
+        const TeLine2D& line2 = ls2[ ls2_index ];
+        
+        TEAGN_TRUE_OR_THROW( ( line2.size() == 2 ), "Invalid line size" );
+        
+        const TeCoord2D& line2_p1 = line2[ 0 ];
+        const TeCoord2D& line2_p2 = line2[ 1 ];
+        
+        if( line2_p1.x() == line2_p2.x() ) {
+          if( ! line1_is_vertical ) {
+            candidate_pt.setXY( line2_p1.x(), ( line1_m * line2_p1.x() ) +
+              line1_q );
+            candidate_pt_found = true;
+          }
+        } else {
+          line2_m = ( line2_p1.y() - line2_p2.y() ) /
+            ( line2_p1.x() - line2_p2.x() );
+          line2_q = line2_p1.y() - ( line2_m * line2_p1.x() );        
+        
+          if( line1_is_vertical ) {
+            candidate_pt.setXY( line1_vertical_x_value, 
+              ( line2_m * line1_vertical_x_value ) + line2_q );
+            candidate_pt_found = true;
+          } else {
+            if( line1_m != line2_m ) {
+              canditate_pt_x = (  line2_q - line1_q ) / ( line1_m - line2_m );
+              candidate_pt.setXY( canditate_pt_x, ( line2_m * canditate_pt_x ) + 
+                line2_q );
+              candidate_pt_found = true;
+            }
+          }
+        }
+        
+        if( candidate_pt_found ) {
+          line2_min_x = MIN( line2_p1.x(), line2_p2.x() );
+          line2_min_y = MIN( line2_p1.y(), line2_p2.y() );
+          line2_max_x = MAX( line2_p1.x(), line2_p2.x() );
+          line2_max_y = MAX( line2_p1.y(), line2_p2.y() );        
+          
+          if( ( candidate_pt.x() >= line1_min_x  ) &&
+            ( candidate_pt.y() >= line1_min_y  ) &&
+            ( candidate_pt.x() <= line1_max_x  ) &&
+            ( candidate_pt.y() <= line1_max_y  ) &&
+            ( candidate_pt.x() >= line2_min_x  ) &&
+            ( candidate_pt.y() >= line2_min_y  ) &&
+            ( candidate_pt.x() <= line2_max_x  ) &&
+            ( candidate_pt.y() <= line2_max_y  ) ) {
+            
+            ps.add( candidate_pt );
+          }
+          
+        }
+      }
+    }
+  
+  }
+  
+  TeDataType chooseBestPixelType( TePDITypes::TePDIRasterVectorType& rasters )
+  {
+    TeDataType best_dt = TeUNSIGNEDCHAR;
+    double best_min = 0;
+    double best_max = 255;
+  
+    TePDITypes::TePDIRasterVectorType::iterator it = rasters.begin();
+    TePDITypes::TePDIRasterVectorType::iterator it_end = rasters.end();
+    
+    double curr_min = 0;
+    double curr_max = 0;
+    
+    unsigned int bands_number = 0;
+    unsigned int curr_band = 0;
+    
+    while( it != it_end ) {
+      bands_number = (*it)->params().nBands();
+      
+      curr_band = 0;
+      
+      while( curr_band < bands_number ) {
+        if( TeGetRasterMinMaxBounds( *it, curr_band, curr_min, curr_max ) ) {
+          if( curr_min == best_min ) {
+            if( curr_max > best_max ) {
+              best_dt = (*it)->params().dataType_[ curr_band ];
+              best_max = curr_max;
+              best_min = curr_min;
+            }
+          } else if( curr_max == best_max ) {
+            if( curr_min < best_min ) {
+              best_dt = (*it)->params().dataType_[ curr_band ];
+              best_max = curr_max;
+              best_min = curr_min;
+            }
+          } else {
+            if( ( curr_min < best_min ) || ( curr_max > best_max ) ) {
+              best_dt = (*it)->params().dataType_[ curr_band ];
+              best_max = curr_max;
+              best_min = curr_min;
+            }
+          }
+        }
+        
+        ++curr_band;
+      }
+      
+      ++it;
+    }
+    
+    return best_dt;
+  }
+  
+  
+  void getBandMinMaxValues( const TePDITypes::TePDIRasterPtrType& raster, 
+    unsigned int channel, bool progress_enabled, unsigned int sample_step,  
+    double& min, double& max )
+  {
+    TEAGN_TRUE_OR_THROW( raster.isActive(),
+      "Inactive Input Raster" );
+
+    TeRasterParams& params = raster->params();
+
+    TEAGN_TRUE_OR_THROW( (int)channel < params.nBands(),
+      "Invalid input channel" );  
+  
+    if ( params.decoderIdentifier_ == "DB" ) {
+      
+      min = params.vmin_[ channel ];
+      max = params.vmax_[ channel ];
+    } else {
+      min = DBL_MAX;
+      max = ( -1.0 ) * DBL_MAX;  
+      
+      const unsigned int in_lines_number = params.nlines_;
+      const unsigned int in_columns_number = params.ncols_;
+      const bool use_dummy = params.useDummy_;
+  
+      TePDIPIManager progress( "Guessing channel bounds...", 
+        (unsigned int)ceil( ( (double)in_lines_number ) / 
+        ( (double)( sample_step + 1 ) ) ), progress_enabled );      
+    
+      unsigned int rasterline = 0;
+      unsigned int rastercolumn = 0;
+      double current_raster_level = 0;
+      TeRaster& in_raster_ref = *(raster.nakedPointer());
+      
+      for( rasterline = 0 ; rasterline < in_lines_number ; 
+        rasterline += ( 1 + sample_step ) ) {
+        
+        for( rastercolumn = 0 ; rastercolumn < in_columns_number ; 
+          rastercolumn += ( 1 + sample_step ) ) 
+        {  
+          if( in_raster_ref.getElement( rastercolumn, rasterline,
+              current_raster_level, channel ) ) {
+              
+            if( current_raster_level > max ) {
+              max = current_raster_level;
+            }
+            if( current_raster_level < min ) {
+              min = current_raster_level;
+            }
+          } else {
+            TEAGN_TRUE_OR_THROW( use_dummy,
+              "Unable to read from input raster at line=" +
+              Te2String( rasterline ) + " column=" +
+              Te2String( rastercolumn ) + "channel=" +
+              Te2String( channel ) );
+          }
+        }
+        
+        progress.Increment();
+      }
+    }      
+  }
+  
+  
+  bool convert2MultiBand( const TePDITypes::TePDIRasterPtrType& in_raster,
+    bool progress_enabled, TePDITypes::TePDIRasterPtrType& out_raster )
+  {
+    TEAGN_TRUE_OR_THROW( in_raster.isActive(), 
+      "in_raster pointer inactive" );
+    TEAGN_TRUE_OR_THROW( ( in_raster->params().projection() != 0 ), 
+      "in_raster do not have a projection" );
+      
+    /* Checking if we need a conversion */
+      
+    int in_raster_band = 0;
+    bool conversion_required = false;
+        
+    for( in_raster_band = 0 ; in_raster_band < in_raster->params().nBands() ;
+      ++in_raster_band ) {
+      
+      if( ( in_raster->params().photometric_[ in_raster_band ] !=
+        TeRasterParams::TeMultiBand ) &&
+        ( in_raster->params().photometric_[ in_raster_band ] !=
+        TeRasterParams::TeRGB ) ) {
+      
+        conversion_required = true;
+        in_raster_band = in_raster->params().nBands();
+      }
+    }
+  
+    if( conversion_required ) {
+      TeRasterParams out_raster_params;
+    
+      if( out_raster.isActive() ) {
+        TEAGN_TRUE_OR_THROW( ( out_raster->params().status_ != 
+          TeRasterParams::TeNotReady ), "out_raster not ready" );
+          
+        out_raster_params = out_raster->params();
+      }
+      
+      if( in_raster->params().photometric_[ 0 ] == 
+        TeRasterParams::TePallete ) { 
+                 
+        out_raster_params.nBands( 3 );
+      } else {
+        out_raster_params.nBands( in_raster->params().nBands() );
+      }
+                  
+      TeSharedPtr< TeProjection > proj( TeProjectionFactory::make( 
+        in_raster->projection()->params() ) );          
+      out_raster_params.projection( proj.nakedPointer() );      
+      
+      out_raster_params.boxResolution( in_raster->params().box().x1(), 
+        in_raster->params().box().y1(), in_raster->params().box().x2(), 
+        in_raster->params().box().y2(), 
+        in_raster->params().resx_, in_raster->params().resy_ );      
+      
+      out_raster_params.setPhotometric( TeRasterParams::TeMultiBand );
+      
+      out_raster_params.setDataType( in_raster->params().dataType_[ 0 ], -1 );
+      
+      if( in_raster->params().useDummy_ ) {
+        out_raster_params.setDummy( in_raster->params().dummy_[ 0 ], -1 );
+      } else {
+        out_raster_params.useDummy_ = false;
+      }
+        
+      if( out_raster.isActive() ) {
+        TEAGN_TRUE_OR_RETURN( out_raster->init( out_raster_params ),
+          "Output raster init error" );
+      } else {
+        TEAGN_TRUE_OR_RETURN( TeAllocRAMRaster( out_raster,
+          out_raster_params, TePDIUtilsAutoMemPol ),
+          "Output raster allocation error" );
+      }
+          
+      /* Creating the transformer instance */
+        
+      TeRasterTransform transformer( in_raster.nakedPointer(), 
+        out_raster.nakedPointer() );
+          
+      if( in_raster->params().photometric_[ 0 ] == 
+        TeRasterParams::TePallete ) {
+          
+        transformer.setTransfFunction( TeRasterTransform::TePall2Three );
+      } else {
+        transformer.setTransfFunction( TeRasterTransform::TeBand2Band );
+      }
+        
+      /* Creating the remapper instance */
+          
+      TeRasterRemap remapper( in_raster.nakedPointer(), 
+        out_raster.nakedPointer(), progress_enabled );
+        
+      remapper.setTransformer( &transformer );
+      
+      TEAGN_TRUE_OR_RETURN( remapper.apply( progress_enabled),
+        "Raster remapping error" );
+    } else {
+      out_raster = in_raster;
+    }
+    
+    return true;
+  }
+  
+  bool compareGeometryPoints( const TeLinearRing& geom1, 
+    const TeLinearRing& geom2 )
+  {
+    unsigned int geom1_size = geom1.size();
+    
+    if( geom1_size == geom2.size() ) {
+    
+      unsigned int index2 = 0;
+      bool point_found = false;
+      
+      for( unsigned int index1 = 0 ; index1 < geom1_size ; ++index1 ) {
+        point_found = false;
+        
+        for( index2 = 0 ; index2 < geom1_size ; ++index2 ) {
+          if( geom1[ index1 ] == geom2[ index2 ] ) {
+            point_found = true;
+            break;    
+          }
+        }
+        
+        if( ! point_found ) {
+          return false;
+        }
+      }
+      
+      return true;
+    } else {
+      return false;
+    }
+  }
+  
+
+  bool resampleRasterByRes( const TePDITypes::TePDIRasterPtrType& input_raster,
+    const TePDITypes::TePDIRasterPtrType& output_raster,
+    double x_resolution_ratio, double y_resolution_ratio, 
+    TePDIInterpolator::InterpMethod interpol, 
+    bool enable_progress ) 
+  {
+      
+    TEAGN_TRUE_OR_RETURN( input_raster.isActive(), "Inactive input raster" );
+    TEAGN_TRUE_OR_RETURN( 
+      input_raster->params().status_ != TeRasterParams::TeNotReady,
+      "Input raster not ready" )
+    
+    TEAGN_TRUE_OR_RETURN( output_raster.isActive(), 
+      "Inactive output raster" );
+    TEAGN_TRUE_OR_RETURN( 
+      output_raster->params().status_ != TeRasterParams::TeNotReady,
+      "Output raster not ready" )
+      
+    TEAGN_TRUE_OR_RETURN( ( x_resolution_ratio > 0.0 ), "Invalid X ratio" )
+    TEAGN_TRUE_OR_RETURN( ( y_resolution_ratio > 0.0 ), "Invalid X ratio" )
+    
+    unsigned int out_lines = TeRound( 
+      ( (double)input_raster->params().nlines_ ) / 
+      y_resolution_ratio );
+    unsigned int out_cols = TeRound( 
+      ( (double)input_raster->params().ncols_ ) / 
+      x_resolution_ratio );      
+    
+    return resampleRasterByLinsCols( input_raster, output_raster, 
+      out_lines, out_cols, enable_progress, interpol );
+  }
+  
+  bool resampleRasterByLinsCols( 
+    const TePDITypes::TePDIRasterPtrType& input_raster,
+    const TePDITypes::TePDIRasterPtrType& output_raster,
+    unsigned int out_lines, 
+    unsigned int out_cols,
+    bool enable_progress, 
+    TePDIInterpolator::InterpMethod interpol ) 
+  {
+    std::vector< unsigned int > inputBands;
+    
+    for( int idx = 0 ; idx < input_raster->params().nBands() ;
+      ++idx )
+    {
+      inputBands.push_back( (unsigned int)idx );
+    }
+    
+    return resampleRasterByLinsCols( input_raster, inputBands,
+      out_lines, out_cols, enable_progress, interpol, output_raster );
+  }
+
+
+  bool resampleRasterByLinsCols( 
+    const TePDITypes::TePDIRasterPtrType& input_raster,
+    const std::vector< unsigned int >& inputBands,
+    unsigned int out_lines, 
+    unsigned int out_cols, 
+    bool enable_progress,
+    TePDIInterpolator::InterpMethod interpol,
+    const TePDITypes::TePDIRasterPtrType& output_raster ) 
+  {
+      
+    TEAGN_TRUE_OR_THROW( input_raster.isActive(), "Inactive input raster" );
+    TEAGN_TRUE_OR_RETURN( 
+      input_raster->params().status_ != TeRasterParams::TeNotReady,
+      "Input raster not ready" )
+    
+    TEAGN_TRUE_OR_THROW( output_raster.isActive(), 
+      "Inactive output raster" );
+    TEAGN_TRUE_OR_RETURN( 
+      output_raster->params().status_ != TeRasterParams::TeNotReady,
+      "Output raster not ready" )
+      
+    TEAGN_TRUE_OR_RETURN( ( out_lines > 0 ), "Invalid out_lines" )
+    TEAGN_TRUE_OR_RETURN( ( out_cols > 0 ), "Invalid out_cols" )
+    
+    /* Reseting the output raster to the new geometry */
+    
+    {
+      TeRasterParams new_output_raster_params = output_raster->params();
+      
+      new_output_raster_params.nBands( inputBands.size() );
+      new_output_raster_params.setPhotometric( 
+        input_raster->params().photometric_[ 0 ], -1 );
+      new_output_raster_params.boxLinesColumns( 
+        input_raster->params().box().x1(), 
+        input_raster->params().box().y1(), 
+        input_raster->params().box().x2(), 
+        input_raster->params().box().y2(), 
+        out_lines, out_cols );
+      new_output_raster_params.projection( 
+        input_raster->params().projection() );
+        
+      TEAGN_TRUE_OR_RETURN( output_raster->init( 
+        new_output_raster_params ),
+        "Output raster reset error" )
+  
+      TEAGN_DEBUG_CONDITION( 
+        ( output_raster->params().nlines_ == (int)out_lines ),
+        "Invalid nlines_" )
+      TEAGN_DEBUG_CONDITION( 
+        ( output_raster->params().ncols_ == (int)out_cols ),
+        "Invalid ncols_" )
+    }
+      
+    /* interpolating pixel values */
+    
+    const TeRasterParams& output_raster_params = 
+      output_raster->params();
+    
+    const unsigned int out_bands = (unsigned int)
+      output_raster_params.nBands();
+    
+    double in_col = 0;
+    double in_line = 0;
+    unsigned int out_col = 0;
+    unsigned int out_line = 0;
+    unsigned int out_band = 0;
+    double value = 0;
+    const double y_resolution_ratio = 
+      ( (double) input_raster->params().nlines_ ) /
+      ( (double) out_lines );
+    const double x_resolution_ratio = 
+      ( (double) input_raster->params().ncols_ ) /
+      ( (double) out_cols );
+    
+    double dummy_value = 0;
+    if( input_raster->params().useDummy_ ) {
+      dummy_value = input_raster->params().dummy_[ 0 ];
+    }
+    
+    TeRaster& output_raster_ref = *output_raster;
+    
+    TePDIInterpolator interpolator;
+    TEAGN_TRUE_OR_RETURN( interpolator.reset( input_raster, 
+      interpol,
+      dummy_value), "Interpolator reset error" )
+    unsigned int inputBand = 0;  
+    TePDIPIManager progress( "Resampling raster", 
+      ( out_bands * out_lines ), enable_progress );
+    double outMax = 0;
+    double outMin = 0;      
+    
+    for( out_band = 0 ; out_band < out_bands ; ++out_band ) 
+    {
+      TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds( output_raster,
+        out_band, outMin, outMax ), "Internal error" );
+          
+      inputBand = inputBands[ out_band ];
+      
+      for( out_line = 0 ; out_line < out_lines ; ++out_line ) {
+        in_line = ( (double)out_line) * y_resolution_ratio;
+      
+        for( out_col = 0 ; out_col < out_cols ; ++out_col ) {
+          in_col = ( (double)out_col) * x_resolution_ratio;
+        
+          interpolator.interpolate( in_line, in_col, inputBand, 
+            value );
+            
+          value = MIN( value, outMax );
+          value = MAX( value, outMin );                
+      
+          TEAGN_TRUE_OR_RETURN( output_raster_ref.setElement( 
+            out_col, out_line, value, out_band ), 
+            "Output raster writing error" )
+        }
+        
+        TEAGN_FALSE_OR_RETURN( progress.Increment(), 
+          "Canceled by user" );
+      }
+    }
+    
+    return true;
+  }
+  
+  
+  bool composeRaster( 
+    const TePDITypes::TePDIRasterVectorType& input_rasters,
+    const std::vector< unsigned int >& input_channels,
+    TePDITypes::TePDIRasterPtrType& output_raster,
+    bool enable_progress )
+  {
+    TEAGN_TRUE_OR_THROW( ( input_rasters.size() == input_channels.size() ),
+      "Invalid input channels number" )
+    TEAGN_TRUE_OR_THROW( output_raster.isActive(), 
+      "Inactive output raster" );      
+  
+    if( input_rasters.size() == 0 )
+    { 
+      output_raster.reset();
+      return true;
+    }
+    else
+    {
+      /* Checking reference raster */
+      
+      TEAGN_TRUE_OR_THROW( input_rasters[ 0 ].isActive(),
+        "Invalid input reference raster pointer" )
+            
+      TeRasterParams ref_params = input_rasters[ 0 ]->params();
+      
+      TEAGN_TRUE_OR_THROW( 
+        ( ref_params.status_ != TeRasterParams::TeNotReady ),
+        "Invalid input reference raster" )
+      
+      /* creating the output parameters */
+      
+      {
+        TeRasterParams newoutpars = output_raster->params();
+        TeBox ref_bbox = ref_params.boundingBox();
+        newoutpars.boundingBoxLinesColumns( 
+          ref_bbox.x1(), 
+          ref_bbox.y1(), 
+          ref_bbox.x2(), 
+          ref_bbox.y2(), 
+          ref_params.nlines_, ref_params.ncols_ );
+        newoutpars.nBands( input_rasters.size() );
+        newoutpars.projection( ref_params.projection() );
+        newoutpars.setPhotometric( TeRasterParams::TeMultiBand, -1 );
+        
+        for( unsigned int input_channels_idx = 0 ; 
+          input_channels_idx < input_channels.size() ; ++input_channels_idx )
+        {
+          /* Checking input raster pointers */
+          
+          TEAGN_TRUE_OR_THROW( 
+            ( input_rasters[ input_channels_idx ].isActive() ),
+            "Invalid input raster pointer" )
+            
+          /* Checking input raster status */
+          
+          TEAGN_TRUE_OR_THROW( 
+            ( input_rasters[ input_channels_idx ]->params().status_ != 
+            TeRasterParams::TeNotReady ),
+            "Invalid input raster" )            
+                      
+          /* Checking input_channels indexes */
+          
+          const int& curr_input_channel = input_channels[ 
+            input_channels_idx ];
+          
+          TEAGN_TRUE_OR_THROW( 
+            ( curr_input_channel < 
+            input_rasters[ input_channels_idx ]->nBands() ),
+            "Invalid band index" )
+            
+          /* Checking input raster lines and columns */
+          
+          TEAGN_TRUE_OR_THROW( 
+            ( input_rasters[ input_channels_idx ]->params().nlines_ == 
+            ref_params.nlines_ ),
+            "Invalid input raster lines number" )     
+          TEAGN_TRUE_OR_THROW( 
+            ( input_rasters[ input_channels_idx ]->params().ncols_ == 
+            ref_params.ncols_ ),
+            "Invalid input raster columns number" )                                 
+          
+          /* Seting the output data type */
+          
+          newoutpars.setDataType(
+            input_rasters[ input_channels_idx ]->params().dataType_[ 
+            curr_input_channel ], (int)input_channels_idx );
+        }
+        
+        /* Reseting output raster */
+        
+        TEAGN_TRUE_OR_RETURN( output_raster->init( newoutpars ),
+          "Error initiating output raster" )
+          
+        /* Copying data */
+        
+        const unsigned int lines_per_raster = (unsigned int)
+          ref_params.nlines_;
+        const unsigned int cols_per_raster = (unsigned int)
+          ref_params.ncols_;
+        TeRaster& out_raster_ref = *output_raster;
+        unsigned int curr_line = 0;
+        unsigned int curr_col = 0;
+        double value = 0;
+          
+        TePDIPIManager progress( "Composing raster", 
+          input_channels.size() * lines_per_raster, enable_progress );            
+        
+        for( unsigned int input_channels_idx = 0 ; 
+          input_channels_idx < input_channels.size() ; ++input_channels_idx )
+        {
+          const unsigned int& curr_input_channel = input_channels[ 
+            input_channels_idx ];
+          TeRaster& cur_in_raster = 
+            *( input_rasters[ input_channels_idx ] );
+            
+          for( curr_line = 0 ; curr_line < lines_per_raster ; ++curr_line )
+          {
+            for( curr_col = 0 ; curr_col < cols_per_raster ; ++curr_col )
+            {
+              cur_in_raster.getElement( curr_col, curr_line, value, 
+                curr_input_channel );
+              TEAGN_TRUE_OR_RETURN( out_raster_ref.setElement( curr_col, 
+                curr_line, value, input_channels_idx ),
+                "Error writting output raster" );
+            }
+            
+            TEAGN_FALSE_OR_RETURN( progress.Increment(),
+              "Canceled by the user" )
+          }
+        }        
+      }
+      
+      return true;
+    }
+  }
+  
+  bool decomposeRaster( TeRaster& inputRaster,
+    const std::vector< unsigned int >& inputChannels,
+    TePDITypes::TePDIRasterVectorType& outputRasters,
+    bool enableProgress )
+  {
+    TEAGN_TRUE_OR_RETURN( inputRaster.params().status_ != 
+      TeRasterParams::TeNotReady,
+      "Input raster not ready" )
+      
+    outputRasters.clear();
+      
+    TeRasterParams newRasterParams = inputRaster.params();
+    newRasterParams.nBands( 1 );
+    const unsigned int nLines = (unsigned int)inputRaster.params().nlines_;
+    const unsigned int nCols = (unsigned int)inputRaster.params().ncols_;
+    unsigned int col = 0;
+    unsigned int line = 0;
+    double value = 0;
+    
+    TePDIPIManager progress( "Decomposing raster", inputChannels.size() * 
+      inputRaster.params().nlines_, enableProgress ); 
+      
+    for( unsigned int iCIdx = 0 ; iCIdx < inputChannels.size() ; ++iCIdx )
+    {
+      const unsigned int& inputChannel = inputChannels[ iCIdx ];
+      TEAGN_TRUE_OR_RETURN( ((int)inputChannel) < inputRaster.params().nBands(),
+        "Invalid input channel " + Te2String( inputChannel ) );
+        
+      newRasterParams.setDataType( inputRaster.params().dataType_[ 
+        inputChannel ], -1 );
+        
+      TePDITypes::TePDIRasterPtrType newRasterPtr;
+      TEAGN_TRUE_OR_RETURN( TeAllocRAMRaster( newRasterParams,
+        newRasterPtr ), "Raster alloc error" )
+        
+      TeRaster& outRaster = (*newRasterPtr);
+        
+      for( line = 0 ; line < nLines ; ++line )
+      {
+        for( col = 0 ; col < nCols ; ++col )
+        {
+          inputRaster.getElement( col, line, value, inputChannel );
+          TEAGN_TRUE_OR_RETURN( outRaster.setElement( col, line, value, 
+            0 ), "Error writing raster" );
+        }
+        
+        TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" )
+      }
+      
+      outputRasters.push_back( newRasterPtr );
+    }
+    
+    return true;
+  }
+  
+  bool loadRaster( const std::string& fileName, 
+      TePDITypes::TePDIRasterPtrType& memRasterPtr, bool enable_progress )
+  {
+    TeRaster inRaster( fileName, 'r' );
+    TEAGN_TRUE_OR_RETURN( inRaster.init(), "Input disk raster init error" );
+    
+    TEAGN_TRUE_OR_RETURN( TeAllocRAMRaster( memRasterPtr, inRaster.params(), 
+      TePDIUtilsAutoMemPol ), "Memory raster allocation error" );
+    
+    unsigned int band = 0;
+    const unsigned int bandsN = (unsigned int)inRaster.params().nBands();
+    unsigned int line = 0;
+    const unsigned int linesN = (unsigned int)inRaster.params().nlines_;
+    unsigned int col = 0;
+    const unsigned int colsN = (unsigned int)inRaster.params().ncols_;
+    TeRaster& memRaster = *memRasterPtr;
+    double value = 0;
+    
+    TePDIPIManager progress( "Loading raster", 
+      bandsN * linesN, enable_progress );       
+    
+    for( band = 0 ; band < bandsN ; ++band )
+      for( line = 0 ; line < linesN ; ++line )
+      {
+        for( col = 0 ; col < colsN ; ++col )
+        {
+          inRaster.getElement( col, line, value, band );
+          memRaster.setElement( col, line, value, band );
+        }
+        
+        TEAGN_FALSE_OR_RETURN( progress.Increment(),  
+          "Canceled by the user" );
+      }
+    
+    return true;
+  }
+  
+} // namespace TeUtils
+
diff --git a/src/terralib/image_processing/TePDIUtils.hpp b/src/terralib/image_processing/TePDIUtils.hpp
old mode 100755
new mode 100644
index e2792ec..c20d2ef
--- a/src/terralib/image_processing/TePDIUtils.hpp
+++ b/src/terralib/image_processing/TePDIUtils.hpp
@@ -1,631 +1,746 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-/**
- * @file TePDIUtils.hpp
- * @brief This file contains utilitary functions used by PDI algorithms. 
- * THEY SHOLD NOT BE USED BY ANYONE. The support and interfaces 
- * can be changed in future. THIS IS FOR INTERNAL USE ONLY.
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- */
-
-#ifndef TEPDIUTILS_HPP
-  #define TEPDIUTILS_HPP
-
-  #include "TePDIRgbPalette.hpp"
-  #include "TePDITypes.hpp"
-  #include "TePDIMathFunctions.hpp"
-  #include "TePDIInterpolator.hpp"
-  
-  #include "data_structs/TeTileIndexer.h"
-
-  #include <TeAgnostic.h>
-  #include <TeRaster.h>
-  #include <TeDataTypes.h>
-  #include <TeBox.h>
-
-  #include <string>
-  #include <map>
-
- 
-    /**
-     * @namespace TePDIUtils This namespace contains base utilitary functions used by PDI classes.
-     * @note THEY SHOLD NOT BE USED BY ANYONE. The support and interfaces 
-     * can be changed in future. THIS IS FOR INTERNAL USE ONLY.     
-     * @ingroup PDIModule
-     */
-  namespace TePDIUtils
-  {
-    /**
-     * @enum PDIUtils memory policies.
-     */
-    enum TePDIUtilsMemPol {
-      /** The memory policy will be choosed following the free RAM */
-      TePDIUtilsAutoMemPol = 1,
-      /** Use RAM memory */
-      TePDIUtilsRamMemPol = 2,
-      /** Use memory mapped disk files */
-      TePDIUtilsDiskMemPol = 3
-    };  
-
-    /**
-     * @brief Allocates one RAM raster using another raster as template base.
-     *
-     * @note If there are not enought memory, memory mapping to disk files 
-     * will be used.
-     *
-     * @param template_raster Input raster.
-     * @param RAMRaster Output raster.
-     * @param bands Number of bands for the generated RAMRaster. If zero, the
-     * number of bands will match the input raster.
-     * @param force_new_dt If true, a new pixel data type will be used for 
-     * all bands.
-     * @param force_mm Force disk memory mapped raster creation.
-     * @param pixel_type Pixel data type.
-     * @return true if OK. false on error.
-     */
-    PDI_DLL bool TeAllocRAMRaster(
-      TePDITypes::TePDIRasterPtrType& template_raster,
-      TePDITypes::TePDIRasterPtrType& RAMRaster,
-      unsigned int bands, bool force_new_dt, bool force_mm,
-      TeDataType pixel_type = TeDOUBLE );
-
-    /**
-     * @brief Allocates a brand new RAM raster.
-     *
-     * @note If there are not enought memory, memory mapping to disk files 
-     * will be used.
-     *
-     * @param RAMRaster Output raster.
-     * @param bands Number of bands for the generated RAMRaster.
-     * @param lines Number of lines.
-     * @param columns Number of Columns
-     * @param force_mm Force disk memory mapped raster creation.
-     * @param pixel_type Pixel data type.
-     * @param palette A palette reference, for generation of a paletted
-     * raster ( must be 0 if not used ).
-     * @return true if OK. false on error.
-     */
-    PDI_DLL bool TeAllocRAMRaster(
-      TePDITypes::TePDIRasterPtrType& RAMRaster,
-      unsigned int bands, unsigned int lines, unsigned int columns,
-      bool force_mm, TeDataType pixel_type, TePDIRgbPalette* palette );
-      
-    /**
-     * @brief Allocates a brand new RAM raster using the supplied parameters.
-     *
-     * @note If there are not enought memory, memory mapping to disk files 
-     * will be used.
-     *
-     * @param RAMRaster Output raster.
-     * @param params Raster parameters.
-     * @param force_mm Force disk memory mapped raster creation.
-     * @return true if OK. false on error.
-     */      
-    PDI_DLL bool TeAllocRAMRaster( TePDITypes::TePDIRasterPtrType& RAMRaster,
-      const TeRasterParams& params, bool force_mm );
-      
-    /**
-     * @brief Allocates a brand new RAM raster using the supplied parameters.
-     *
-     * @param RAMRaster Output raster.
-     * @param params Raster parameters.
-     * @param mempol Memory policy.
-     */      
-    PDI_DLL bool TeAllocRAMRaster( TePDITypes::TePDIRasterPtrType& RAMRaster,
-      const TeRasterParams& params, 
-      TePDIUtilsMemPol mempol = TePDIUtilsAutoMemPol );      
-      
-    /**
-     * @brief Save the raster to a GeoTIFF file.
-     *
-     * @param in_raster Input raster.
-     * @param file_name Output file name.
-     * @return true if OK. false on error.
-     * @note DEPRECATED: Use other TeRaster2Geotiff implementation.
-     */
-    PDI_DLL bool TeRaster2Geotiff(
-      const TePDITypes::TePDIRasterPtrType& in_raster,
-      const std::string& file_name );      
-
-    /**
-     * @brief Save the raster to a GeoTIFF file.
-     *
-     * @param in_raster Input raster.
-     * @param file_name Output file name.
-     * @param pixel_type The type of pixels.
-     * @return true if OK. false on error.
-     * @note DEPRECATED: Use other TeRaster2Geotiff implementation.
-     */
-    PDI_DLL bool TeRaster2Geotiff(
-      const TePDITypes::TePDIRasterPtrType& in_raster,
-      const std::string& file_name,
-      TeDataType pixel_type );
-      
-    /**
-     * @brief Save the raster to a GeoTIFF file.
-     *
-     * @param in_raster Input raster.
-     * @param file_name Output file name.
-     * @param enable_progress Enable/disable progress interface.
-     * @return true if OK. false on error.
-     */
-    PDI_DLL bool TeRaster2Geotiff(
-      const TePDITypes::TePDIRasterPtrType& in_raster,
-      const std::string& file_name,
-      bool enable_progress );      
-
-    /**
-     * @brief Do pixel by pixel copy from one raster to another.
-     *
-     * @param source_raster Input raster.
-     * @param source_band Souce band.
-     * @param target_raster Output raster.
-     * @param target_band Target band.
-     * @param discretize_levels Levels will be rounded to the near integer.
-     * @param trunc_levels Levels outside a range ( from zero
-     * to the maximum Output raster allowed pixel value ) will be rounded to 
-     * zero or the maximum Output raster allowed pixel value.
-     * @return true if OK. false on error.
-     */
-    PDI_DLL bool TeCopyRasterPixels(
-      TePDITypes::TePDIRasterPtrType& source_raster,
-      unsigned int source_band,
-      TePDITypes::TePDIRasterPtrType& target_raster,
-      unsigned int target_band,
-      bool discretize_levels,
-      bool trunc_levels );
-
-    /**
-     * @brief Do pixel by pixel copy from one raster to another ( all bands ).
-     *
-     * @param source_raster Input raster.
-     * @param target_raster Output raster.
-     * @param discretize_levels Levels will be rounded to the near integer.
-     * @param trunc_levels Levels outside a range ( from zero
-     * to the maximum Output raster allowed pixel value ) will be rounded to 
-     * zero or the maximum Output raster allowed pixel value.
-     * @return true if OK. false on error.
-     */
-    PDI_DLL bool TeCopyRasterBands(
-      TePDITypes::TePDIRasterPtrType& source_raster,
-      TePDITypes::TePDIRasterPtrType& target_raster,
-      bool discretize_levels,
-      bool trunc_levels );
-
-    /**
-     * @brief Used to find the allowed maximum and minimum level values
-     * that the supplied TeRaster band can have.
-     *
-     * @param raster Input raster.
-     * @param band Band number.
-     * @param min Minimum allowed value.
-     * @param max Maximum allowed value..
-     * @return true if OK, false on error.
-     */
-    PDI_DLL bool TeGetRasterMinMaxBounds( 
-      const TePDITypes::TePDIRasterPtrType& raster,
-      unsigned int band, double& min, double& max );
-      
-    /**
-     * @brief Used to find the raster required memory.
-     *
-     * @param params Input raster parameters.
-     * @return The amount of required memory.
-     */
-    PDI_DLL unsigned long int TeGetRasterReqMem( TeRasterParams& params );      
-
-    /**
-     * @brief Compares two rasters.
-     *
-     * @param raster1 Input raster 1.
-     * @param raster2 Input raster 2.
-     * @return true if all the pixels from both rasters have the same levels,
-     * false if not.
-     */
-    PDI_DLL bool rasterCompare( TePDITypes::TePDIRasterPtrType& raster1,
-      TePDITypes::TePDIRasterPtrType& raster2 );
-      
-    /**
-     * @brief Given a raster band, verifies if the pixels are floating point
-     * pixels.
-     *
-     * @param raster The input raster.
-     * @param band Band number.
-     * @return true if the the pixels are floating point pixels.
-     */      
-    PDI_DLL bool IsFloatBand( const TePDITypes::TePDIRasterPtrType& raster, 
-      unsigned int band );
-    
-    /**
-     * @brief Convert a TeCoord2D with projected coordinates to a geometry with
-     * indexed coordinates ( following the raster reference of lines and
-     * columns ).
-     *
-     * @param g_in Input geometry.
-     * @param raster Reference raster.
-     * @param g_out Output geometry.
-     */       
-    PDI_DLL void MapCoords2RasterIndexes( const TeCoord2D& g_in, 
-      const TePDITypes::TePDIRasterPtrType& raster, TeCoord2D& g_out );
-      
-    /**
-     * @brief Convert a TeBox with projected coordinates to a TeBox with
-     * indexed coordinates ( following the raster reference of lines and
-     * columns ).
-     *
-     * @param box_in Input box.
-     * @param raster Reference raster.
-     * @param box_out Output box.
-     */       
-    PDI_DLL void MapCoords2RasterIndexes( const TeBox& box_in, 
-      const TePDITypes::TePDIRasterPtrType& raster, TeBox& box_out );      
-      
-   /**
-     * @brief Convert a geometry with projected coordinates to a geometry with
-     * indexed coordinates ( following the raster reference of lines and
-     * columns ).
-     *
-     * @param g_in Input geometry.
-     * @param raster Reference raster.
-     * @param g_out Output geometry.
-     */        
-    template< typename Geometry >
-    void MapCoords2RasterIndexes( const Geometry& g_in, 
-      const TePDITypes::TePDIRasterPtrType& raster, Geometry& g_out )
-    {
-        unsigned int nItens = (unsigned int)g_in.size();
-        
-        for (unsigned int i=0; i < nItens ; i++ ) {
-                typename Geometry::value_type e1 = g_in[i];
-                typename Geometry::value_type e2;
-                
-                MapCoords2RasterIndexes( e1, raster, e2 );
-                
-                g_out.add( e2 );
-        }
-    }
-    
-    /**
-     * @brief Convert TeCoord2D with matrix indexed coordinates to a TeCoord2D with 
-     * projected coordinates folowing a raster reference.
-     *
-     * @param g_in Input geometry.
-     * @param raster Reference raster.
-     * @param g_out Output geometry.
-     */       
-    PDI_DLL void MapRasterIndexes2Coords( const TeCoord2D& g_in, 
-      const TePDITypes::TePDIRasterPtrType& raster, TeCoord2D& g_out );     
-      
-    /**
-     * @brief Convert TeBox with matrix indexed coordinates to a TeBox with 
-     * projected coordinates folowing a raster reference.
-     *
-     * @param g_in Input geometry.
-     * @param raster Reference raster.
-     * @param g_out Output geometry.
-     */       
-    PDI_DLL void MapRasterIndexes2Coords( const TeBox& g_in, 
-      const TePDITypes::TePDIRasterPtrType& raster, TeBox& g_out );       
-    
-   /**
-     * @brief Convert geometry with matrix indexed coordinates to a geometry with 
-     * projected coordinates folowing a raster reference.
-     *
-     * @param g_in Input geometry.
-     * @param raster Reference raster.
-     * @param g_out Output geometry.
-     */        
-    template< typename Geometry >
-    void MapRasterIndexes2Coords( const Geometry& g_in, 
-      const TePDITypes::TePDIRasterPtrType& raster, Geometry& g_out )
-    {
-        unsigned int nItens = (unsigned int)g_in.size();
-        
-        for (unsigned int i=0; i < nItens ; i++ ) {
-                typename Geometry::value_type e1 = g_in[i];
-                typename Geometry::value_type e2;
-                
-                MapRasterIndexes2Coords( e1, raster, e2 );
-                
-                g_out.add( e2 );
-        }
-    }
-    
-   /**
-     * @brief Breaks a TeLinearRing geometry into an segment set ( line segments of 
-     * two points ).
-     *
-     * @param g_in Input geometry.
-     * @param g_out Output geometry.
-     */        
-    PDI_DLL void makeSegmentSet( const TeLinearRing& g_in, TeLineSet& g_out );
-    
-   /**
-     * @brief Breaks a geometry into an segment set ( line segments of two points ).
-     *
-     * @param g_in Input geometry.
-     * @param g_out Output geometry.
-     */        
-    template< typename Geometry >
-    void makeSegmentSet( const Geometry& g_in, TeLineSet& g_out )
-    {
-      g_out.clear();
-        
-      for ( unsigned int i = 0 ; i < g_in.size() ; i++ ) {
-        TeLineSet temp_ls;
-        
-        makeSegmentSet( g_in[i], temp_ls );
-          
-        const unsigned int temp_ls_size = temp_ls.size();
-                
-        for( unsigned int temp_ls_index = 0 ; temp_ls_index < temp_ls_size ; 
-          ++temp_ls_index ) {
-            
-          g_out.add( temp_ls[ temp_ls_index ] );
-        }
-       }
-    };
-        
-    /**
-     * @brief Virifies if the lut has only discrete reference values ( integer ).
-     *
-     * @param lut Lut.
-     * @return true if only discrete values were found, otherwise false
-     * will be returned.
-     */
-    PDI_DLL bool IsDiscreteLut( const TePDITypes::TePDILutType& lut );
-    
-    /**
-     * @brief Builds a detailed box (world indexes) using all raster border pixels.
-     *
-     * @param raster Input raster.
-     * @param box_polygon The generated box (polygon representation).
-     * @return true if OK, false on errors.
-     */
-    PDI_DLL bool buildDetailedBox( const TePDITypes::TePDIRasterPtrType& raster,
-      TePolygon& box_polygon );
-      
-    /**
-     * @brief Builds a detailed bounding box (world indexes) using all raster 
-     * border pixels.
-     *
-     * @param raster Input raster.
-     * @param box_polygon The generated box (polygon representation).
-     * @return true if OK, false on errors.
-     */
-    PDI_DLL bool buildDetailedBBox( const TePDITypes::TePDIRasterPtrType& raster,
-      TePolygon& box_polygon );
-      
-    /**
-     * @brief Calculate the pixel size in geodetic units.
-     *
-     * @param params Raster params.
-     * @param x_res Pixel size ( X Axis - Geodetic units ).
-     * @param y_res Pixel size ( Y Axis - Geodetic units ).
-     */
-    PDI_DLL void getGeodeticPixelRes( TeRasterParams& params,
-      double& x_res, double& y_res );
-      
-    /**
-     * @brief Reproject a raster geometry.
-     *
-     * @param input_raster Input raster.
-     * @param target_projection Target projection.
-     * @param target_resx Target X resolution following the target projection.
-     * @param target_resy Target Y resolution following the target projection.
-     * @param output_raster Output raster.
-     *
-     * @return true if OK, false on errors.
-     */
-    PDI_DLL bool reprojectRaster( const TePDITypes::TePDIRasterPtrType& input_raster,
-      TeProjection& target_projection, double target_resx, double target_resy,
-      TePDITypes::TePDIRasterPtrType& output_raster );
-      
-    /**
-     * @brief Tells the relation between a point and a polygon by using a 
-     * polygon tile indexer.
-     *
-     * @note The boundary case is not checked.
-     *
-     * @param c The input point.
-     * @param indexer The polygon tile indexer.
-     *
-     * @return TeINSIDE or TeOUTSIDE.
-     */      
-    PDI_DLL short TeRelation( const TeCoord2D& c, const TeTileIndexer& indexer );
-    
-    /**
-     * @brief Calculates the intersection set operation between two line segments
-     * sets.
-     *
-     * @note Each line must have just 2 points.
-     *
-     * @param ls1 The input line set 1.
-     * @param ls2 The input line set 2.
-     * @param ps The output point set.
-     */     
-    PDI_DLL void TeSegSetIntersection( const TeLineSet& ls1, const TeLineSet& ls2,
-      TePointSet& ps );
-      
-    /**
-     * @brief Chooses the best pixel data type betweenn rasters.
-     * 
-     * @param rasters Input rasters.
-     * @return The best data type
-     */        
-    PDI_DLL TeDataType chooseBestPixelType( 
-      TePDITypes::TePDIRasterVectorType& rasters );      
-      
-    /**
-     * @brief Returns the minimum and maximum pixel values inside one raster channel.
-     * 
-     * @param raster Input raster.
-     * @param channel Input channel.
-     * @param min The minimum level.
-     * @param max The maximum level.
-     * @param progress_enabled Enable/disable the progress interface.
-     * @param sample_step The step size between lines/columns ( to
-     * use all lines/columns use sample_step = 0 ).
-     */        
-    PDI_DLL void getBandMinMaxValues( 
-      const TePDITypes::TePDIRasterPtrType& raster, unsigned int channel,
-      bool progress_enabled, unsigned int sample_step,  
-      double& min, double& max );      
-      
-    /**
-     * @brief Generates a multi-band copy from the given raster.
-     * 
-     * @param in_raster Input raster (must have a projection).
-     * @param progress_enabled Progress interface enable/disable flag.
-     * @param out_raster Output raster.
-     * @return true if ok, false on errors.
-     * @note If out_raster isn't active, a new raster ( SMARMEM decoder )
-     * will be returned.
-     * @note If no conversion was made, the returned pointer will point
-     * to the input raster.
-     */        
-    PDI_DLL bool convert2MultiBand( const TePDITypes::TePDIRasterPtrType& in_raster,
-      bool progress_enabled, TePDITypes::TePDIRasterPtrType& out_raster );
-      
-    /**
-     * @brief Compares two TeLinerRing ignoring the points order.
-     * @param geom1 The first geometry.
-     * @param geom2 The second geometry.
-     * @return true if both geometries has the same points, false otherwise.
-     */        
-    PDI_DLL bool compareGeometryPoints( const TeLinearRing& geom1, 
-      const TeLinearRing& geom2 );      
-      
-    /**
-     * @brief Compares two geometries ignoring the points order inside each
-     * composite elemeent.
-     * @param geom1 The first polygon.
-     * @param geom2 The second polygon.
-     * @return true if both polygons has the same points on each ring.
-     */        
-    template< typename Geometry >
-    bool compareGeometryPoints( const Geometry& geom1, const Geometry& geom2 )
-    {
-      if( geom1.size() == geom2.size() ) {
-        const unsigned geom_size = geom1.size();
-
-        for( unsigned int elem_index = 0 ; elem_index < geom_size ; 
-          ++elem_index ) {
-            
-          if( ! compareGeometryPoints( geom1[ elem_index ], 
-            geom2[ elem_index ] ) ) {
-            
-            return false;
-          }
-        }
-        
-        return true;
-      } else {
-        return false;
-      }
-    };     
-
-    /**
-     * @brief Raster resampling to new resolution, 
-     * keeping the original box and projection.
-     * @param input_raster Input raster.
-     * @param output_raster Output raster.
-     * @param out_lines The number of output lines.
-     * @param out_cols The number of output columns.
-     * @param interpol Interpolation method.
-     * @param enable_progress Enable/disable the progress interface.
-     * @return true if OK, false on errors.
-     * 
-     * @note ( resolution_ratio = output_resolution / input_resolution ).
-     */      
-    PDI_DLL bool resampleRasterByLinsCols( 
-      const TePDITypes::TePDIRasterPtrType& input_raster,
-      const TePDITypes::TePDIRasterPtrType& output_raster,
-      unsigned int out_lines, 
-      unsigned int out_cols, 
-      bool enable_progress,
-      TePDIInterpolator::InterpMethod interpol );  
-    
-    /**
-     * @brief Raster resampling to new resolution, keeping the original box and projection.
-     * @param input_raster Input raster.
-     * @param output_raster Output raster.
-     * @param x_resolution_ratio X resolution ratio.
-     * @param y_resolution_ratio Y resolution ratio.
-     * @param interpol Interpolation method.
-     * @param enable_progress Enable/disable the progress interface.
-     * @return true if OK, false on errors.
-     * 
-     * @note ( resolution_ratio = output_resolution / input_resolution ).
-     */      
-    PDI_DLL bool resampleRasterByRes( 
-      const TePDITypes::TePDIRasterPtrType& input_raster,
-      const TePDITypes::TePDIRasterPtrType& output_raster,
-      double x_resolution_ratio, 
-      double y_resolution_ratio, 
-      TePDIInterpolator::InterpMethod interpol, 
-      bool enable_progress );    
-      
-    /**
-     * @brief Compose raster channels into one single raster.
-     * @param input_rasters Input rasters vector.
-     * @param input_channels Input rasters channels/bands vector.
-     * @param output_raster Output raster.
-     * @param enable_progress Enable/disable the progress interface.
-     * @return true if OK, false on errors.
-     * 
-     * @note The reference (projection, resolution, box) for the output 
-     * raster will be taken from the first
-     * input channel (with index zero).
-     * @note All input raster must have the same number of lines and columns.
-     */      
-    PDI_DLL bool composeRaster( 
-      const TePDITypes::TePDIRasterVectorType& input_rasters,
-      const std::vector< unsigned int > input_channels,
-      TePDITypes::TePDIRasterPtrType& output_raster,
-      bool enable_progress );       
-    
-    /**
-     * @brief Load a raster data file into RAM (using a SMARTMEM decoder)
-     * @param fileName Raster file name
-     * @param memRasterPtr The output memory raster pointer.
-     * @param enable_progress Enable/disable the progress interface.
-     * @return true if OK, false on errors.
-     * 
-     * @note The reference (projection, resolution, box) for the output 
-     * raster will be taken from the first
-     * input channel (with index zero).
-     * @note All input raster must have the same number of lines and columns.
-     */      
-    PDI_DLL bool loadRaster( const std::string& fileName, 
-      TePDITypes::TePDIRasterPtrType& memRasterPtr, bool enable_progress );        
-      
-  };
-  
-/** @example TePDIUtils_test.cpp
- *    Shows how to use this namespace functions.
- */    
-
-#endif //TEPDIUTILS_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+/**
+ * @file TePDIUtils.hpp
+ * @brief This file contains utilitary functions used by PDI algorithms. 
+ * THEY SHOLD NOT BE USED BY ANYONE. The support and interfaces 
+ * can be changed in future. THIS IS FOR INTERNAL USE ONLY.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ */
+
+#ifndef TEPDIUTILS_HPP
+  #define TEPDIUTILS_HPP
+
+  #include "TePDIRgbPalette.hpp"
+  #include "TePDITypes.hpp"
+  #include "TePDIMathFunctions.hpp"
+  #include "TePDIInterpolator.hpp"
+  
+  #include "TePDITileIndexer.hpp"
+
+  #include <TeAgnostic.h>
+  #include <TeRaster.h>
+  #include <TeDataTypes.h>
+  #include <TeBox.h>
+
+  #include <string>
+  #include <map>
+
+ 
+    /**
+     * @namespace TePDIUtils This namespace contains base utilitary functions used by PDI classes.
+     * @note THEY SHOLD NOT BE USED BY ANYONE. The support and interfaces 
+     * can be changed in future. THIS IS FOR INTERNAL USE ONLY.     
+     * @ingroup PDIModule
+     */
+  namespace TePDIUtils
+  {
+    /**
+     * @enum PDIUtils memory policies.
+     */
+    enum TePDIUtilsMemPol {
+      /** The memory policy will be choosed following the free RAM */
+      TePDIUtilsAutoMemPol = 1,
+      /** Use RAM memory */
+      TePDIUtilsRamMemPol = 2,
+      /** Use memory mapped disk files */
+      TePDIUtilsDiskMemPol = 3
+    };  
+
+    /**
+     * @brief Allocates one RAM raster using another raster as template base.
+     * @deprecated DEPRECATED - Use another implementation of this method 
+     * because it will be removed in the future.
+     * @note If there are not enought memory, memory mapping to disk files 
+     * will be used.
+     *
+     * @param template_raster Input raster.
+     * @param RAMRaster Output raster.
+     * @param bands Number of bands for the generated RAMRaster. If zero, the
+     * number of bands will match the input raster.
+     * @param force_new_dt If true, a new pixel data type will be used for 
+     * all bands.
+     * @param force_mm Force disk memory mapped raster creation.
+     * @param pixel_type Pixel data type.
+     * @return true if OK. false on error.
+     */
+    PDI_DLL bool TeAllocRAMRaster(
+      TePDITypes::TePDIRasterPtrType& template_raster,
+      TePDITypes::TePDIRasterPtrType& RAMRaster,
+      unsigned int bands, bool force_new_dt, bool force_mm,
+      TeDataType pixel_type );
+
+    /**
+     * @brief Allocates a brand new RAM raster.
+     *
+     * @note If there are not enought memory, memory mapping to disk files 
+     * will be used.
+     * @deprecated DEPRECATED - Use another implementation of this method 
+     * because it will be removed in the future.
+     * @param RAMRaster Output raster.
+     * @param bands Number of bands for the generated RAMRaster.
+     * @param lines Number of lines.
+     * @param columns Number of Columns
+     * @param force_mm Force disk memory mapped raster creation.
+     * @param pixel_type Pixel data type.
+     * @param palette A palette reference, for generation of a paletted
+     * raster ( must be 0 if not used ).
+     * @return true if OK. false on error.
+     */
+    PDI_DLL bool TeAllocRAMRaster(
+      TePDITypes::TePDIRasterPtrType& RAMRaster,
+      unsigned int bands, unsigned int lines, unsigned int columns,
+      bool force_mm, TeDataType pixel_type, TePDIRgbPalette* palette );
+      
+    /**
+     * @brief Allocates a brand new RAM raster using the supplied parameters.
+     * @deprecated DEPRECATED - Use another implementation of this method 
+     * because it will be removed in the future.
+     * @note If there are not enought memory, memory mapping to disk files 
+     * will be used.
+     *
+     * @param RAMRaster Output raster.
+     * @param params Raster parameters.
+     * @param force_mm Force disk memory mapped raster creation.
+     * @return true if OK. false on error.
+     */      
+    PDI_DLL bool TeAllocRAMRaster( TePDITypes::TePDIRasterPtrType& RAMRaster,
+      const TeRasterParams& params, bool force_mm );
+      
+    /**
+     * @brief Allocates a brand new RAM raster using the supplied parameters.
+     * @deprecated DEPRECATED - Use another implementation of this method 
+     * because it will be removed in the future.
+     * @param RAMRaster Output raster.
+     * @param params Raster parameters.
+     * @param mempol Memory policy.
+     */      
+    PDI_DLL bool TeAllocRAMRaster( TePDITypes::TePDIRasterPtrType& RAMRaster,
+      const TeRasterParams& params, 
+      TePDIUtilsMemPol mempol ); 
+       
+    /**
+     * @brief Create a new raster instance into memory using the supplied 
+     * parameters.
+     *
+     * @param rasterPointer Output raster pointer.
+     * @param params Raster parameters.
+     */      
+    PDI_DLL bool TeAllocRAMRaster( 
+      const TeRasterParams& params,
+      TePDITypes::TePDIRasterPtrType& rasterPointer );        
+      
+    /**
+     * @brief Save the raster to a GeoTIFF file.
+     *
+     * @param in_raster Input raster.
+     * @param file_name Output file name.
+     * @return true if OK. false on error.
+     * @note DEPRECATED: Use other TeRaster2Geotiff implementation.
+     */
+    PDI_DLL bool TeRaster2Geotiff(
+      const TePDITypes::TePDIRasterPtrType& in_raster,
+      const std::string& file_name );      
+
+    /**
+     * @brief Save the raster to a GeoTIFF file.
+     *
+     * @param in_raster Input raster.
+     * @param file_name Output file name.
+     * @param pixel_type The type of pixels.
+     * @return true if OK. false on error.
+     * @note DEPRECATED: Use other TeRaster2Geotiff implementation.
+     */
+    PDI_DLL bool TeRaster2Geotiff(
+      const TePDITypes::TePDIRasterPtrType& in_raster,
+      const std::string& file_name,
+      TeDataType pixel_type );
+      
+    /**
+     * @brief Save the raster to a GeoTIFF file.
+     *
+     * @param in_raster Input raster.
+     * @param file_name Output file name.
+     * @param enable_progress Enable/disable progress interface.
+     * @return true if OK. false on error.
+     */
+    PDI_DLL bool TeRaster2Geotiff(
+      const TePDITypes::TePDIRasterPtrType& in_raster,
+      const std::string& file_name,
+      bool enable_progress );
+      
+    /**
+     * @brief Save a 3 bands/channels raster to a RGB GeoTIFF file.
+     *
+     * @param in_raster 3 band/channels input raster.
+     * @param file_name Output file name.
+     * @param enable_progress Enable/disable progress interface.
+     * @return true if OK. false on error.
+     */
+    PDI_DLL bool TeRaster2RGBGeotiff(
+      const TePDITypes::TePDIRasterPtrType& in_raster,
+      const std::string& file_name,
+      bool enable_progress );      
+            
+    /**
+     * @brief Save the raster to a Jpeg file.
+     *
+     * @param in_raster Input raster.
+     * @param file_name Output file name.
+     * @param enable_progress Enable/disable progress interface.
+     * @param qualityFactor Quality factor from 0% to 100%.
+     * @return true if OK. false on error.
+     */
+    PDI_DLL bool TeRaster2Jpeg(
+      const TePDITypes::TePDIRasterPtrType& in_raster,
+      const std::string& file_name,
+      bool enable_progress, unsigned int qualityFactor );                
+
+    /**
+     * @brief Do pixel by pixel copy from one raster to another.
+     *
+     * @param source_raster Input raster.
+     * @param source_band Souce band.
+     * @param target_raster Output raster.
+     * @param target_band Target band.
+     * @param discretize_levels Levels will be rounded to the near integer.
+     * @param trunc_levels Levels outside a range ( from zero
+     * to the maximum Output raster allowed pixel value ) will be rounded to 
+     * zero or the maximum Output raster allowed pixel value.
+     * @return true if OK. false on error.
+     */
+    PDI_DLL bool TeCopyRasterPixels(
+      TePDITypes::TePDIRasterPtrType& source_raster,
+      unsigned int source_band,
+      TePDITypes::TePDIRasterPtrType& target_raster,
+      unsigned int target_band,
+      bool discretize_levels,
+      bool trunc_levels );
+
+    /**
+     * @brief Do pixel by pixel copy from one raster to another ( all bands ).
+     *
+     * @param source_raster Input raster.
+     * @param target_raster Output raster.
+     * @param discretize_levels Levels will be rounded to the near integer.
+     * @param trunc_levels Levels outside a range ( from zero
+     * to the maximum Output raster allowed pixel value ) will be rounded to 
+     * zero or the maximum Output raster allowed pixel value.
+     * @return true if OK. false on error.
+     */
+    PDI_DLL bool TeCopyRasterBands(
+      TePDITypes::TePDIRasterPtrType& source_raster,
+      TePDITypes::TePDIRasterPtrType& target_raster,
+      bool discretize_levels,
+      bool trunc_levels );
+
+    /**
+     * @brief Used to find the allowed maximum and minimum level values
+     * that the supplied TeRaster band can have.
+     *
+     * @param raster Input raster.
+     * @param band Band number.
+     * @param min Minimum allowed value.
+     * @param max Maximum allowed value..
+     * @return true if OK, false on error.
+     */
+    PDI_DLL bool TeGetRasterMinMaxBounds( 
+      const TePDITypes::TePDIRasterPtrType& raster,
+      unsigned int band, double& min, double& max );
+      
+    /**
+     * @brief Used to find the raster required memory.
+     *
+     * @param params Input raster parameters.
+     * @return The amount of required memory.
+     */
+    PDI_DLL unsigned long int TeGetRasterReqMem( TeRasterParams& params );      
+
+    /**
+     * @brief Compares two rasters.
+     *
+     * @param raster1 Input raster 1.
+     * @param raster2 Input raster 2.
+     * @return true if all the pixels from both rasters have the same levels,
+     * false if not.
+     */
+    PDI_DLL bool rasterCompare( TePDITypes::TePDIRasterPtrType& raster1,
+      TePDITypes::TePDIRasterPtrType& raster2 );
+      
+    /**
+     * @brief Given a raster band, verifies if the pixels are floating point
+     * pixels.
+     *
+     * @param raster The input raster.
+     * @param band Band number.
+     * @return true if the the pixels are floating point pixels.
+     */      
+    PDI_DLL bool IsFloatBand( const TePDITypes::TePDIRasterPtrType& raster, 
+      unsigned int band );
+    
+    /**
+     * @brief Convert a TeCoord2D with projected coordinates to a geometry with
+     * indexed coordinates ( following the raster reference of lines and
+     * columns ).
+     *
+     * @param g_in Input geometry.
+     * @param raster Reference raster.
+     * @param g_out Output geometry.
+     */       
+    PDI_DLL void MapCoords2RasterIndexes( const TeCoord2D& g_in, 
+      const TePDITypes::TePDIRasterPtrType& raster, TeCoord2D& g_out );
+      
+    /**
+     * @brief Convert a TeBox with projected coordinates to a TeBox with
+     * indexed coordinates ( following the raster reference of lines and
+     * columns ).
+     *
+     * @param box_in Input box.
+     * @param raster Reference raster.
+     * @param box_out Output box.
+     */       
+    PDI_DLL void MapCoords2RasterIndexes( const TeBox& box_in, 
+      const TePDITypes::TePDIRasterPtrType& raster, TeBox& box_out );      
+      
+   /**
+     * @brief Convert a geometry with projected coordinates to a geometry with
+     * indexed coordinates ( following the raster reference of lines and
+     * columns ).
+     *
+     * @param g_in Input geometry.
+     * @param raster Reference raster.
+     * @param g_out Output geometry.
+     */        
+    template< typename Geometry >
+    void MapCoords2RasterIndexes( const Geometry& g_in, 
+      const TePDITypes::TePDIRasterPtrType& raster, Geometry& g_out )
+    {
+        unsigned int nItens = (unsigned int)g_in.size();
+        
+        for (unsigned int i=0; i < nItens ; i++ ) {
+                typename Geometry::value_type e1 = g_in[i];
+                typename Geometry::value_type e2;
+                
+                MapCoords2RasterIndexes( e1, raster, e2 );
+                
+                g_out.add( e2 );
+        }
+    }
+    
+    /**
+     * @brief Convert TeCoord2D with matrix indexed coordinates to a TeCoord2D with 
+     * projected coordinates folowing a raster reference.
+     *
+     * @param g_in Input geometry.
+     * @param raster Reference raster.
+     * @param g_out Output geometry.
+     */       
+    PDI_DLL void MapRasterIndexes2Coords( const TeCoord2D& g_in, 
+      const TePDITypes::TePDIRasterPtrType& raster, TeCoord2D& g_out );     
+      
+    /**
+     * @brief Convert TeBox with matrix indexed coordinates to a TeBox with 
+     * projected coordinates folowing a raster reference.
+     *
+     * @param g_in Input geometry.
+     * @param raster Reference raster.
+     * @param g_out Output geometry.
+     */       
+    PDI_DLL void MapRasterIndexes2Coords( const TeBox& g_in, 
+      const TePDITypes::TePDIRasterPtrType& raster, TeBox& g_out );       
+    
+   /**
+     * @brief Convert geometry with matrix indexed coordinates to a geometry with 
+     * projected coordinates folowing a raster reference.
+     *
+     * @param g_in Input geometry.
+     * @param raster Reference raster.
+     * @param g_out Output geometry.
+     */        
+    template< typename Geometry >
+    void MapRasterIndexes2Coords( const Geometry& g_in, 
+      const TePDITypes::TePDIRasterPtrType& raster, Geometry& g_out )
+    {
+        unsigned int nItens = (unsigned int)g_in.size();
+        
+        for (unsigned int i=0; i < nItens ; i++ ) {
+                typename Geometry::value_type e1 = g_in[i];
+                typename Geometry::value_type e2;
+                
+                MapRasterIndexes2Coords( e1, raster, e2 );
+                
+                g_out.add( e2 );
+        }
+    }
+    
+   /**
+     * @brief Breaks a TeLinearRing geometry into an segment set ( line segments of 
+     * two points ).
+     *
+     * @param g_in Input geometry.
+     * @param g_out Output geometry.
+     */        
+    PDI_DLL void makeSegmentSet( const TeLinearRing& g_in, TeLineSet& g_out );
+    
+   /**
+     * @brief Breaks a geometry into an segment set ( line segments of two points ).
+     *
+     * @param g_in Input geometry.
+     * @param g_out Output geometry.
+     */        
+    template< typename Geometry >
+    void makeSegmentSet( const Geometry& g_in, TeLineSet& g_out )
+    {
+      g_out.clear();
+        
+      for ( unsigned int i = 0 ; i < g_in.size() ; i++ ) {
+        TeLineSet temp_ls;
+        
+        makeSegmentSet( g_in[i], temp_ls );
+          
+        const unsigned int temp_ls_size = temp_ls.size();
+                
+        for( unsigned int temp_ls_index = 0 ; temp_ls_index < temp_ls_size ; 
+          ++temp_ls_index ) {
+            
+          g_out.add( temp_ls[ temp_ls_index ] );
+        }
+       }
+    };
+        
+    /**
+     * @brief Virifies if the lut has only discrete reference values ( integer ).
+     *
+     * @param lut Lut.
+     * @return true if only discrete values were found, otherwise false
+     * will be returned.
+     */
+    PDI_DLL bool IsDiscreteLut( const TePDITypes::TePDILutType& lut );
+    
+    /**
+     * @brief Builds a detailed box (world indexes) using all raster border pixels.
+     *
+     * @param raster Input raster.
+     * @param box_polygon The generated box (polygon representation).
+     * @return true if OK, false on errors.
+     */
+    PDI_DLL bool buildDetailedBox( TeRaster& raster,
+      TePolygon& box_polygon );
+    
+    /**
+     * @deprecated This method will be removed in the future, please
+     * use the other buildDetailedBox implementation.
+     * @brief DEPRECATED - Builds a detailed box (world indexes) using all raster border pixels.
+     * @param raster Input raster.
+     * @param box_polygon The generated box (polygon representation).
+     * @return true if OK, false on errors.
+     */
+    PDI_DLL bool buildDetailedBox( const TePDITypes::TePDIRasterPtrType& raster,
+      TePolygon& box_polygon );
+      
+    /**
+     * @brief Builds a detailed bounding box (world indexes) using all raster 
+     * border pixels.
+     *
+     * @param raster Input raster.
+     * @param box_polygon The generated box (polygon representation).
+     * @return true if OK, false on errors.
+     */
+    PDI_DLL bool buildDetailedBBox( TeRaster& raster,
+      TePolygon& box_polygon );      
+      
+    /**
+     * @deprecated This method will be removed in the future, please
+     * use the other buildDetailedBox implementation.    
+     * @brief DEPRECATED - Builds a detailed bounding box (world indexes) using all raster 
+     * border pixels.
+     * @param raster Input raster.
+     * @param box_polygon The generated box (polygon representation).
+     * @return true if OK, false on errors.
+     */
+    PDI_DLL bool buildDetailedBBox( const TePDITypes::TePDIRasterPtrType& raster,
+      TePolygon& box_polygon );
+      
+    /**
+     * @brief Reproject a raster geometry.
+     *
+     * @param input_raster Input raster.
+     * @param target_projection Target projection.
+     * @param outNLines Output raster lines number.
+     * @param outNCols Output raster columns number.
+     * @param enableProgress Enable the progress interface.
+     * @param output_raster Output raster.
+     *
+     * @return true if OK, false on errors.
+     */
+    PDI_DLL bool reprojectRaster( TeRaster& input_raster,
+      unsigned int outNLines, unsigned int outNCols, 
+      TeProjection& target_projection,
+      bool enableProgress,
+      TeRaster& output_raster );      
+      
+    /**
+     * @brief Reproject a raster geometry.
+     *
+     * @param input_raster Input raster.
+     * @param target_projection Target projection.
+     * @param target_resx Target X resolution following the target projection.
+     * @param target_resy Target Y resolution following the target projection.
+     * @param enableProgress Enable the progress interface.
+     * @param output_raster Output raster.
+     *
+     * @return true if OK, false on errors.
+     */
+    PDI_DLL bool reprojectRaster( TeRaster& input_raster,
+      TeProjection& target_projection, double target_resx, 
+      double target_resy,
+      bool enableProgress,
+      TeRaster& output_raster );
+      
+    /**
+     * @brief Tells the relation between a point and a polygon by using a 
+     * polygon tile indexer.
+     *
+     * @note The boundary case is not checked.
+     *
+     * @param c The input point.
+     * @param indexer The polygon tile indexer.
+     *
+     * @return TeINSIDE or TeOUTSIDE.
+     */      
+    PDI_DLL short TeRelation( const TeCoord2D& c, const TePDITileIndexer& indexer );
+    
+    /**
+     * @brief Calculates the intersection set operation between two line segments
+     * sets.
+     *
+     * @note Each line must have just 2 points.
+     *
+     * @param ls1 The input line set 1.
+     * @param ls2 The input line set 2.
+     * @param ps The output point set.
+     */     
+    PDI_DLL void TeSegSetIntersection( const TeLineSet& ls1, const TeLineSet& ls2,
+      TePointSet& ps );
+      
+    /**
+     * @brief Chooses the best pixel data type betweenn rasters.
+     * 
+     * @param rasters Input rasters.
+     * @return The best data type
+     */        
+    PDI_DLL TeDataType chooseBestPixelType( 
+      TePDITypes::TePDIRasterVectorType& rasters );      
+      
+    /**
+     * @brief Returns the minimum and maximum pixel values inside one raster channel.
+     * 
+     * @param raster Input raster.
+     * @param channel Input channel.
+     * @param min The minimum level.
+     * @param max The maximum level.
+     * @param progress_enabled Enable/disable the progress interface.
+     * @param sample_step The step size between lines/columns ( to
+     * use all lines/columns use sample_step = 0 ).
+     */        
+    PDI_DLL void getBandMinMaxValues( 
+      const TePDITypes::TePDIRasterPtrType& raster, unsigned int channel,
+      bool progress_enabled, unsigned int sample_step,  
+      double& min, double& max );      
+      
+    /**
+     * @brief Generates a multi-band copy from the given raster.
+     * 
+     * @param in_raster Input raster (must have a projection).
+     * @param progress_enabled Progress interface enable/disable flag.
+     * @param out_raster Output raster.
+     * @return true if ok, false on errors.
+     * @note If out_raster isn't active, a new raster ( SMARMEM decoder )
+     * will be returned.
+     * @note If no conversion was made, the returned pointer will point
+     * to the input raster.
+     */        
+    PDI_DLL bool convert2MultiBand( const TePDITypes::TePDIRasterPtrType& in_raster,
+      bool progress_enabled, TePDITypes::TePDIRasterPtrType& out_raster );
+      
+    /**
+     * @brief Compares two TeLinerRing ignoring the points order.
+     * @param geom1 The first geometry.
+     * @param geom2 The second geometry.
+     * @return true if both geometries has the same points, false otherwise.
+     */        
+    PDI_DLL bool compareGeometryPoints( const TeLinearRing& geom1, 
+      const TeLinearRing& geom2 );      
+      
+    /**
+     * @brief Compares two geometries ignoring the points order inside each
+     * composite elemeent.
+     * @param geom1 The first polygon.
+     * @param geom2 The second polygon.
+     * @return true if both polygons has the same points on each ring.
+     */        
+    template< typename Geometry >
+    bool compareGeometryPoints( const Geometry& geom1, const Geometry& geom2 )
+    {
+      if( geom1.size() == geom2.size() ) {
+        const unsigned geom_size = geom1.size();
+
+        for( unsigned int elem_index = 0 ; elem_index < geom_size ; 
+          ++elem_index ) {
+            
+          if( ! compareGeometryPoints( geom1[ elem_index ], 
+            geom2[ elem_index ] ) ) {
+            
+            return false;
+          }
+        }
+        
+        return true;
+      } else {
+        return false;
+      }
+    };     
+
+    /**
+     * @brief Raster resampling to new resolution, 
+     * keeping the original box and projection.
+     * @param input_raster Input raster.
+     * @param out_lines The number of output lines.
+     * @param out_cols The number of output columns.
+     * @param interpol Interpolation method.
+     * @param enable_progress Enable/disable the progress interface.
+     * @param output_raster Output raster.
+     * @return true if OK, false on errors.
+     * @ All bands will be resampled.
+     * @note ( resolution_ratio = output_resolution / input_resolution ).
+     */   
+    PDI_DLL bool resampleRasterByLinsCols( 
+      const TePDITypes::TePDIRasterPtrType& input_raster,
+      const TePDITypes::TePDIRasterPtrType& output_raster,
+      unsigned int out_lines, 
+      unsigned int out_cols, 
+      bool enable_progress,
+      TePDIInterpolator::InterpMethod interpol );  
+      
+    /**
+     * @brief Raster resampling to new resolution, 
+     * keeping the original box and projection.
+     * @param input_raster Input raster.
+     * @param inputBands Input raster used bands.
+     * @param out_lines The number of output lines.
+     * @param out_cols The number of output columns.
+     * @param interpol Interpolation method.
+     * @param enable_progress Enable/disable the progress interface.
+     * @param output_raster Output raster.
+     * @return true if OK, false on errors.
+     * 
+     * @note ( resolution_ratio = output_resolution / input_resolution ).
+     */      
+    PDI_DLL bool resampleRasterByLinsCols( 
+      const TePDITypes::TePDIRasterPtrType& input_raster,
+      const std::vector< unsigned int >& inputBands,
+      unsigned int out_lines, 
+      unsigned int out_cols, 
+      bool enable_progress,
+      TePDIInterpolator::InterpMethod interpol,
+      const TePDITypes::TePDIRasterPtrType& output_raster );        
+    
+    /**
+     * @brief Raster resampling to new resolution, keeping the original box and projection.
+     * @param input_raster Input raster.
+     * @param output_raster Output raster.
+     * @param x_resolution_ratio X resolution ratio.
+     * @param y_resolution_ratio Y resolution ratio.
+     * @param interpol Interpolation method.
+     * @param enable_progress Enable/disable the progress interface.
+     * @return true if OK, false on errors.
+     * 
+     * @note ( resolution_ratio = output_resolution / input_resolution ).
+     */      
+    PDI_DLL bool resampleRasterByRes( 
+      const TePDITypes::TePDIRasterPtrType& input_raster,
+      const TePDITypes::TePDIRasterPtrType& output_raster,
+      double x_resolution_ratio, 
+      double y_resolution_ratio, 
+      TePDIInterpolator::InterpMethod interpol, 
+      bool enable_progress );    
+      
+    /**
+     * @brief Compose raster channels into one single raster.
+     * @param input_rasters Input rasters vector.
+     * @param input_channels Input rasters channels/bands vector.
+     * @param output_raster Output raster.
+     * @param enable_progress Enable/disable the progress interface.
+     * @return true if OK, false on errors.
+     * 
+     * @note The reference (projection, resolution, box) for the output 
+     * raster will be taken from the first
+     * input channel (with index zero).
+     * @note All input raster must have the same number of lines and columns.
+     */      
+    PDI_DLL bool composeRaster( 
+      const TePDITypes::TePDIRasterVectorType& input_rasters,
+      const std::vector< unsigned int >& input_channels,
+      TePDITypes::TePDIRasterPtrType& output_raster,
+      bool enable_progress );       
+      
+    /**
+     * @brief Decompose raster channels into many single rasters with
+     * one channel/band each.
+     * @param inputRaster Input raster.
+     * @param inputChannels Input rasters channels/bands vector.
+     * @param outputRasters Output rasters vector.
+     * @param enable_progress Enable/disable the progress interface.
+     * @return true if OK, false on errors.
+     * @note There is no need to pre-initialize the outputRasters vector.
+     */      
+    PDI_DLL bool decomposeRaster( 
+      TeRaster& inputRaster,
+      const std::vector< unsigned int >& inputChannels,
+      TePDITypes::TePDIRasterVectorType& outputRasters,
+      bool enableProgress );      
+    
+    /**
+     * @brief Load a raster data file into RAM (using a SMARTMEM decoder)
+     * @param fileName Raster file name
+     * @param memRasterPtr The output memory raster pointer.
+     * @param enable_progress Enable/disable the progress interface.
+     * @return true if OK, false on errors.
+     * 
+     * @note The reference (projection, resolution, box) for the output 
+     * raster will be taken from the first
+     * input channel (with index zero).
+     * @note All input raster must have the same number of lines and columns.
+     */      
+    PDI_DLL bool loadRaster( const std::string& fileName, 
+      TePDITypes::TePDIRasterPtrType& memRasterPtr, bool enable_progress );        
+      
+  };
+  
+/** @example TePDIUtils_test.cpp
+ *    Shows how to use this namespace functions.
+ */    
+
+#endif //TEPDIUTILS_HPP
diff --git a/src/terralib/image_processing/TePDIVenturaFusion.cpp b/src/terralib/image_processing/TePDIVenturaFusion.cpp
new file mode 100644
index 0000000..3057436
--- /dev/null
+++ b/src/terralib/image_processing/TePDIVenturaFusion.cpp
@@ -0,0 +1,527 @@
+#include "TePDIVenturaFusion.hpp"
+#include "TePDIUtils.hpp"
+#include "TePDIMallatWavelets.hpp"
+#include "TePDIMatrixFunctions.hpp"
+
+TePDIVenturaFusion::TePDIVenturaFusion()
+{
+}
+
+TePDIVenturaFusion::~TePDIVenturaFusion()
+{
+}
+
+
+void TePDIVenturaFusion::ResetState( const TePDIParameters& )
+{
+}
+
+
+bool TePDIVenturaFusion::CheckParameters( const TePDIParameters& parameters ) 
+  const
+{
+  /* Checking reference_raster */
+  
+  TePDITypes::TePDIRasterPtrType reference_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster", 
+    reference_raster ),
+    "Missing parameter: reference_raster" );
+  TEAGN_TRUE_OR_RETURN( reference_raster.isActive(),
+    "Invalid parameter: reference_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( reference_raster->params().status_ != 
+    TeRasterParams::TeNotReady, 
+    "Invalid parameter: reference_raster not ready" );    
+    
+  /* Checking lowres_raster */
+  
+  TePDITypes::TePDIRasterPtrType lowres_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "lowres_raster", 
+    lowres_raster ),
+    "Missing parameter: lowres_raster" );
+  TEAGN_TRUE_OR_RETURN( lowres_raster.isActive(),
+    "Invalid parameter: lowres_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( lowres_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: lowres_raster not ready" );    
+    
+  double max_low_res_raster_res =
+    MAX( lowres_raster->params().resx_, 
+    lowres_raster->params().resy_ );
+  double max_reference_raster_res =
+    MAX( reference_raster->params().resx_, 
+    reference_raster->params().resy_ );
+    
+  TEAGN_TRUE_OR_RETURN(     
+    ( max_low_res_raster_res > max_reference_raster_res ),
+    "Invalid low resolution raster resolution" );
+        
+  /* Checking output_raster */
+  
+  TePDITypes::TePDIRasterPtrType output_raster;
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
+    output_raster ),
+    "Missing parameter: output_raster" );
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
+    "Invalid parameter: output_raster inactive" );
+  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
+    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );    
+    
+  /* Checking bands */    
+    
+  int reference_raster_band = 0;    
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster_band", 
+    reference_raster_band ), "Missing parameter : reference_raster_band" );
+  TEAGN_TRUE_OR_RETURN( ( reference_raster->nBands() > reference_raster_band ),
+    "Invalid parameter : reference_raster_band" );
+    
+  int lowres_raster_band = 0;    
+  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "lowres_raster_band", 
+    lowres_raster_band ), "Missing parameter : lowres_raster_band" );
+  TEAGN_TRUE_OR_RETURN( ( lowres_raster->nBands() > lowres_raster_band ),
+    "Invalid parameter : lowres_raster_band" ); 
+    
+  /* Checking photometric interpretation */
+  
+  TEAGN_TRUE_OR_RETURN( ( 
+    ( reference_raster->params().photometric_[ reference_raster_band ] == 
+      TeRasterParams::TeRGB ) ||
+    ( reference_raster->params().photometric_[ reference_raster_band ] == 
+      TeRasterParams::TeMultiBand ) ),
+  "Invalid parameter - reference_raster (invalid photometric interpretation)" );   
+
+  TEAGN_TRUE_OR_RETURN( ( 
+    ( lowres_raster->params().photometric_[ lowres_raster_band ] == 
+      TeRasterParams::TeRGB ) ||
+    ( lowres_raster->params().photometric_[ lowres_raster_band ] == 
+      TeRasterParams::TeMultiBand ) ),
+  "Invalid parameter - lowres_raster (invalid photometric interpretation)" );   
+      
+  return true;
+}
+
+
+bool TePDIVenturaFusion::RunImplementation()
+{
+  TePDITypes::TePDIRasterPtrType reference_raster;
+  params_.GetParameter( "reference_raster", reference_raster );
+
+  TePDITypes::TePDIRasterPtrType lowres_raster;
+  params_.GetParameter( "lowres_raster", lowres_raster );
+
+  TePDITypes::TePDIRasterPtrType output_raster;
+  params_.GetParameter( "output_raster", output_raster );
+  
+  int reference_raster_band = 0;
+  params_.GetParameter( "reference_raster_band", reference_raster_band );
+
+  int lowres_raster_band = 0;
+  params_.GetParameter( "lowres_raster_band", lowres_raster_band );
+  
+  TePDITypes::TePDIRasterPtrType lowlow;
+  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( lowlow, 1, 1, 1, false,
+    TeDOUBLE, 0 ), "Unable to create temporary low-low raster" );  
+    
+  /* Finding the best decomposition levels for both rasters */
+  
+  unsigned long int reference_raster_best_level = 0;
+  unsigned long int lowres_raster_best_level = 0;
+  unsigned long int decim_error = 0;
+  findBestDecimLevels( reference_raster, lowres_raster, 
+    reference_raster_best_level, lowres_raster_best_level, decim_error );
+  
+ /* Building default wavelet filters  - Reference coef 07 */
+ 
+  double filters_scale = 0.71;
+  if( params_.CheckParameter< double >( "filters_scale" ) ) {
+      
+    params_.GetParameter( "filters_scale", filters_scale );
+  }
+    
+  std::vector< double > a_filter_l;
+  a_filter_l.push_back( -0.05 );
+  a_filter_l.push_back( 0.25 );
+  a_filter_l.push_back( 0.6 );
+  a_filter_l.push_back( 0.25 );
+  a_filter_l.push_back( -0.05 );
+  
+  std::vector< double > a_filter_h;
+  a_filter_h.push_back( 0.0107143 );
+  a_filter_h.push_back( -0.0535714 );
+  a_filter_h.push_back( -0.2607143 );
+  a_filter_h.push_back( 0.6071429 );
+  a_filter_h.push_back( -0.2607143 );
+  a_filter_h.push_back( -0.0535714 );
+  a_filter_h.push_back( 0.0107143 );
+  
+  std::vector< double > s_filter_l;
+  s_filter_l.push_back( -0.0107143 );
+  s_filter_l.push_back( -0.0535714 );
+  s_filter_l.push_back( 0.2607143 );
+  s_filter_l.push_back( 0.6071429 );
+  s_filter_l.push_back( 0.2607143 );
+  s_filter_l.push_back( -0.0535714 );
+  s_filter_l.push_back( -0.0107143 );
+  
+  std::vector< double > s_filter_h;
+  s_filter_h.push_back( -0.05 );
+  s_filter_h.push_back( -0.25 );
+  s_filter_h.push_back( 0.6 );
+  s_filter_h.push_back( -0.25 );
+  s_filter_h.push_back( -0.05 );
+  
+  /* Checking for user supplied wavelet filters */
+  
+  if( params_.CheckParameter< std::vector< double > >( "a_filter_l" ) ) {
+      
+    params_.GetParameter( "a_filter_l", a_filter_l );
+  }
+  if( params_.CheckParameter< std::vector< double > >( "a_filter_h" ) ) {
+      
+    params_.GetParameter( "a_filter_h", a_filter_h );
+  }  
+  if( params_.CheckParameter< std::vector< double > >( "s_filter_l" ) ) {
+      
+    params_.GetParameter( "s_filter_l", s_filter_l );
+  }
+  if( params_.CheckParameter< std::vector< double > >( "s_filter_h" ) ) {
+      
+    params_.GetParameter( "s_filter_h", s_filter_h );
+  }  
+  
+  /* Step 1 - pyramid1 generation  */
+  
+  TePDITypes::TePDIRasterVectorPtrType pyramid1( new
+    TePDITypes::TePDIRasterVectorType );
+  
+  TePDIParameters step1_params;
+  step1_params.SetParameter( "wavelets_type", std::string( "mallat" ) );
+  step1_params.SetParameter( "filter_task", std::string( "GetPyramid" ) );
+  step1_params.SetParameter( "input_image", lowres_raster );
+  step1_params.SetParameter( "band", lowres_raster_band );
+  step1_params.SetParameter( "a_filter_l", a_filter_l );
+  step1_params.SetParameter( "a_filter_h", a_filter_h );
+  step1_params.SetParameter( "s_filter_l", s_filter_l );
+  step1_params.SetParameter( "s_filter_h", s_filter_h );
+  step1_params.SetParameter( "filters_scale", filters_scale );         
+  step1_params.SetParameter( "levels", (int)lowres_raster_best_level );
+  step1_params.SetParameter( "pyramid", pyramid1 );
+  
+  TePDIMallatWavelets wavelet_filter;
+  wavelet_filter.ToggleProgInt( progress_enabled_ );  
+  
+  TEAGN_TRUE_OR_THROW( wavelet_filter.Reset( step1_params ),
+    "Unable to set wavelet filter Parameters ( step 1 )" );
+  TEAGN_TRUE_OR_THROW( wavelet_filter.Apply(), 
+    "Wavelet Filter apply error ( step 1 )" );  
+  
+  step1_params.Clear();
+  
+  /* Step 2 - pyramid2 generation */
+  
+  TePDITypes::TePDIRasterVectorPtrType pyramid2( new
+    TePDITypes::TePDIRasterVectorType );
+  
+  TePDIParameters step2_params;
+  step2_params.SetParameter( "wavelets_type", std::string( "mallat" ) );
+  step2_params.SetParameter( "filter_task", std::string( "GetPyramid" ) );
+  step2_params.SetParameter( "input_image", reference_raster );
+  step2_params.SetParameter( "band", (int)reference_raster_band );
+  step2_params.SetParameter( "a_filter_l", a_filter_l );
+  step2_params.SetParameter( "a_filter_h", a_filter_h );
+  step2_params.SetParameter( "s_filter_l", s_filter_l );
+  step2_params.SetParameter( "s_filter_h", s_filter_h );
+  step2_params.SetParameter( "filters_scale", filters_scale );         
+  step2_params.SetParameter( "levels", (int)reference_raster_best_level );      
+  step2_params.SetParameter( "pyramid", pyramid2 );
+  
+  TEAGN_TRUE_OR_THROW( wavelet_filter.Reset( step2_params ),
+    "Unable to set wavelet filter Parameters ( step 2 )" );
+  TEAGN_TRUE_OR_THROW( wavelet_filter.Apply(), 
+    "Wavelet Filter apply error ( step 2 )" );  
+  
+  step2_params.Clear();
+  
+  TEAGN_DEBUG_CONDITION( ( pyramid1->size() / 4 ) == 
+    lowres_raster_best_level, 
+    "Invalid pyramid" );
+  TEAGN_DEBUG_CONDITION( ( pyramid2->size() / 4 ) == 
+    reference_raster_best_level, 
+    "Invalid pyramid" );
+  TEAGN_DEBUG_CONDITION(
+    ( (*pyramid1)[ pyramid1->size() - 4 ]->params().nlines_ ==
+    (*pyramid2)[ pyramid2->size() - 4 ]->params().nlines_ ),
+    "Pyramids lines mismatch" );
+  TEAGN_DEBUG_CONDITION(
+    ( (*pyramid1)[ pyramid1->size() - 4 ]->params().ncols_ ==
+    (*pyramid2)[ pyramid2->size() - 4 ]->params().ncols_ ),
+    "Pyramids columns mismatch" );  
+  
+  /* Step 3 - Pyramid2 enhencement */
+  
+  TePDIMatrix< double > sb1matrix;
+  TEAGN_TRUE_OR_RETURN( sb1matrix.Reset( 0, 0, 
+    TePDIMatrix< double >::AutoMemPol ), "Matrix reset error" );
+  
+  TePDIMatrix< double > sb2matrix;
+  TEAGN_TRUE_OR_RETURN( sb2matrix.Reset( 0, 0, 
+    TePDIMatrix< double >::AutoMemPol ), "Matrix reset error" );    
+    
+  const unsigned int pys_levels_bound = MIN( reference_raster_best_level,
+    lowres_raster_best_level );
+  unsigned int py1_sb00_index = 0;
+  unsigned int py2_sb00_index = 0;
+  
+  TePDIPIManager progress( "Pyramid enhencement", pys_levels_bound, 
+    progress_enabled_ );
+  
+  for( unsigned int pys_levels_off = 0 ; /* low-low skipping */
+       pys_levels_off < pys_levels_bound ;
+       ++pys_levels_off ) {
+       
+    py1_sb00_index = pyramid1->size() - ( 4 * ( pys_levels_off + 1 ) );
+    py2_sb00_index = pyramid2->size() - ( 4 * ( pys_levels_off + 1 ) );
+    
+    TEAGN_TRUE_OR_RETURN( RasterBand2Matrix( (*pyramid1)[ py1_sb00_index ], 
+      sb1matrix ), "Cannot convert sub-band from pyramid1" );
+    TEAGN_TRUE_OR_RETURN( RasterBand2Matrix( (*pyramid2)[ py2_sb00_index ], 
+      sb2matrix ), "Cannot convert sub-band from pyramid2" );    
+       
+    double sb00_correlation = TePDIMatrixFunctions::GetCorrelation( sb1matrix,
+      sb2matrix );
+      
+    TePDIMatrix< double > absmatrix1;
+    TEAGN_TRUE_OR_RETURN( absmatrix1.Reset( 0, 0, 
+      TePDIMatrix< double >::AutoMemPol ), "Matrix reset error" );         
+      
+    TePDIMatrix< double > absmatrix2; 
+    TEAGN_TRUE_OR_RETURN( absmatrix2.Reset( 0, 0, 
+      TePDIMatrix< double >::AutoMemPol ), "Matrix reset error" );           
+           
+    TePDIMatrix< double > gtmatrix;
+    TEAGN_TRUE_OR_RETURN( gtmatrix.Reset( 0, 0, 
+      TePDIMatrix< double >::AutoMemPol ), "Matrix reset error" );
+                  
+    TePDIMatrix< double > notmatrix;  
+    TEAGN_TRUE_OR_RETURN( notmatrix.Reset( 0, 0, 
+      TePDIMatrix< double >::AutoMemPol ), "Matrix reset error" );          
+      
+    for( unsigned int subband = 1 ; subband < 4 ; ++subband ) {
+      TEAGN_TRUE_OR_RETURN( RasterBand2Matrix( 
+        (*pyramid1)[ py1_sb00_index + subband ], 
+        sb1matrix ), "Cannot convert sub-band from pyramid1" );
+      TEAGN_TRUE_OR_RETURN( RasterBand2Matrix( 
+        (*pyramid2)[ py2_sb00_index + subband ], 
+        sb2matrix ), "Cannot convert sub-band from pyramid2" );       
+        
+      TEAGN_TRUE_OR_RETURN( 
+        TePDIMatrixFunctions::Abs( sb1matrix, absmatrix1 ), 
+        "Abs1 matrix calcule error" );
+      TEAGN_TRUE_OR_RETURN( 
+        TePDIMatrixFunctions::Abs( sb2matrix, absmatrix2 ), 
+        "Abs2 matrix calcule error" );
+      TEAGN_TRUE_OR_RETURN( 
+        TePDIMatrixFunctions::WhereIsGreater( absmatrix2, absmatrix1, 
+        gtmatrix ), "GT matrix calcule error" );        
+      TEAGN_TRUE_OR_RETURN( 
+        TePDIMatrixFunctions::Negate( gtmatrix, notmatrix ), 
+        "NOT matrix calcule error" );
+        
+      const unsigned int valid_lines = MIN( sb1matrix.GetLines(),
+        sb2matrix.GetLines() );
+      const unsigned int valid_cols = MIN( sb2matrix.GetColumns(),
+        sb2matrix.GetColumns() );
+      const unsigned int sb2matrix_lines = sb2matrix.GetLines();
+      const unsigned int sb2matrix_cols = sb2matrix.GetColumns();
+      unsigned int line = 0;
+      unsigned int col = 0;
+      TeRaster* outraster_ptr = 
+        (*pyramid2)[ py2_sb00_index + subband ].nakedPointer();
+      bool result = false;
+      double value1 = 0;
+      double value2 = 0;
+      
+      for( line = 0 ; line < sb2matrix_lines ; ++line ) {
+        for( col = 0 ; col < sb2matrix_cols ; ++col ) {
+          if( ( line < valid_lines ) && ( col < valid_cols ) ) {
+            value1 = ( gtmatrix( line, col ) * sb1matrix( line, col ) ) +
+              ( notmatrix( line, col ) * sb2matrix( line, col ) );
+            value2 = ( notmatrix( line, col ) * sb1matrix( line, col ) ) +
+              ( gtmatrix( line, col ) * sb2matrix( line, col ) );              
+          
+            result = outraster_ptr->setElement( col, line, 
+              ( value1 + ( ABS( 1 - sb00_correlation ) * value2 ) ), 0 );
+            TEAGN_DEBUG_CONDITION( result, "Raster write error" );
+          } else {
+            result = outraster_ptr->setElement( col, line, 0.0, 0 );
+            TEAGN_DEBUG_CONDITION( result, "Raster write error" );
+          }
+        }
+      }
+    }
+
+    TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
+  }
+  
+  progress.Toggle( false );
+  
+  sb1matrix.clear();
+  sb2matrix.clear();
+  
+  /* Step 4 - Low-low swap */
+  
+  TePDITypes::TePDIRasterPtrType py1_raster = (*pyramid1)[ pyramid1->size() - 4 ];
+  TePDITypes::TePDIRasterPtrType py2_raster = 
+    (*pyramid2)[ pyramid2->size() - 4 ];
+  const unsigned int py_lines_bound = py1_raster->params().nlines_;
+  const unsigned int py_cols_bound = py1_raster->params().ncols_;
+  double value = 0;
+  unsigned int py_line;
+  unsigned int py_col;
+  bool get_result = false;
+  bool set_result = false;
+  
+  for( py_line = 0 ; py_line < py_lines_bound ; ++py_line ) {
+    for( py_col = 0 ; py_col < py_cols_bound ; ++py_col ) {
+      get_result = py1_raster->getElement( py_col, py_line, value, 0 );
+      
+      TEAGN_DEBUG_CONDITION( get_result, 
+        "Unable to read from low resolution pyramid" );
+        
+      set_result = py2_raster->setElement( py_col, py_line, value, 0 );
+        
+      TEAGN_DEBUG_CONDITION( set_result, 
+        "Unable to write to high resolution pyramid" );
+    }
+  }
+  
+  pyramid1->clear();
+  
+  /* Step 5 - Pyramid 2 recomposition */
+  
+  TePDIParameters step5_params;
+  step5_params.SetParameter( "wavelets_type", std::string( "mallat" ) );
+  step5_params.SetParameter( "filter_task", std::string( "RecomposePyramid" ) );
+  step5_params.SetParameter( "input_image", reference_raster );
+  step5_params.SetParameter( "band", (int)reference_raster_band );
+  step5_params.SetParameter( "output_image", output_raster );
+  step5_params.SetParameter( "a_filter_l", a_filter_l );
+  step5_params.SetParameter( "a_filter_h", a_filter_h );
+  step5_params.SetParameter( "s_filter_l", s_filter_l );
+  step5_params.SetParameter( "s_filter_h", s_filter_h );
+  step5_params.SetParameter( "filters_scale", filters_scale );         
+  step5_params.SetParameter( "pyramid", pyramid2 );      
+  
+  TEAGN_TRUE_OR_THROW( wavelet_filter.Reset( step5_params ),
+    "Unable to set wavelet filter Parameters ( step 5 )" );
+  TEAGN_TRUE_OR_THROW( wavelet_filter.Apply(), 
+    "Wavelet Filter apply error ( step 5 )" );
+     
+  return true;
+}
+
+bool TePDIVenturaFusion::RasterBand2Matrix( 
+  const TePDITypes::TePDIRasterPtrType& raster,
+  TePDIMatrix< double >& matrix )
+{
+  TEAGN_TRUE_OR_RETURN( raster.isActive(), "Inactive raster" );
+  
+  unsigned int lines_bound = raster->params().nlines_;
+  unsigned int cols_bound = raster->params().ncols_;
+  unsigned int line = 0;
+  unsigned int col = 0;
+  double value = 0;
+  bool result = false;
+  
+  TEAGN_TRUE_OR_RETURN( matrix.Reset( lines_bound, cols_bound ),
+    "Matrix reset error" );
+    
+  TeRaster* raster_ptr = raster.nakedPointer();
+  
+  for( line = 0 ; line < lines_bound ; ++line ) {
+    for( col = 0 ; col < cols_bound ; ++col ) {
+      result = raster_ptr->getElement( col, line, value, 0 );
+      TEAGN_DEBUG_CONDITION( result, "Unable to read from raster" );
+      
+      matrix( line, col ) = value;
+    }
+  }
+  
+  return true;
+}
+        
+     
+bool TePDIVenturaFusion::findBestDecimLevels( 
+  const TePDITypes::TePDIRasterPtrType& raster1,
+  const TePDITypes::TePDIRasterPtrType& raster2,
+  unsigned long int& r1_level, unsigned long int& r2_level,
+  unsigned long int& decim_error )
+{
+  TEAGN_TRUE_OR_RETURN( raster1.isActive(), "raster1 inactive" );
+  TEAGN_TRUE_OR_RETURN( raster2.isActive(), "raster2 inactive" );
+
+  const unsigned long int r1_lines = raster1->params().nlines_;
+  const unsigned long int r1_cols = raster1->params().ncols_;
+  const unsigned long int r2_lines = raster2->params().nlines_;
+  const unsigned long int r2_cols = raster2->params().ncols_;
+
+  const unsigned long int r1_max_levels = MIN(
+    TePDIMathFunctions::DecimLevels( r1_lines ),
+    TePDIMathFunctions::DecimLevels( r1_cols ) );  
+  const unsigned long int r2_max_levels = MIN(
+    TePDIMathFunctions::DecimLevels( r2_lines ),
+    TePDIMathFunctions::DecimLevels( r2_cols ) );
+  
+  if( ( r1_max_levels < 1 ) || ( r2_max_levels < 1 ) ) {
+    r1_level = r2_level = 0;
+    return false;
+  } else {
+    bool best_level_diff_found = false;
+    
+    unsigned long int curr_diff = 0;
+    long int curr_r1_lines = r1_lines;
+    long int curr_r1_cols = r1_cols;
+    long int curr_r2_lines = 0;
+    long int curr_r2_cols = 0;
+    
+    for( unsigned long int curr_r1_level = 1 ; 
+      curr_r1_level <= r1_max_levels ; 
+      ++curr_r1_level ) {
+      
+      curr_r1_lines = ( long int )
+        ceil( ( (double)curr_r1_lines ) / 2 );
+      curr_r1_cols = ( long int )
+        ceil( ( (double)curr_r1_cols ) / 2 );      
+        
+      curr_r2_lines = r2_lines;
+      curr_r2_cols = r2_cols;        
+    
+      for( unsigned long int curr_r2_level = 1 ; 
+        curr_r2_level <= r2_max_levels ; 
+        ++curr_r2_level ) {
+      
+        curr_r2_lines = ( long int )
+          ceil( ( (double)curr_r2_lines ) / 2 );
+        curr_r2_cols = ( long int )
+          ceil( ( (double)curr_r2_cols ) / 2 );
+          
+        curr_diff = ABS( curr_r1_lines - curr_r2_lines ) +
+          ABS( curr_r1_cols - curr_r2_cols );
+          
+        if( best_level_diff_found ) {
+          if( curr_diff < decim_error ) {
+            r1_level = curr_r1_level;
+            r2_level = curr_r2_level;
+            decim_error = curr_diff;
+          }
+        } else {
+          r1_level = curr_r1_level;
+          r2_level = curr_r2_level;
+          decim_error = curr_diff;
+          best_level_diff_found = true;
+        }
+      }
+    }
+    
+    return true;
+  }
+}        
+
diff --git a/src/terralib/image_processing/TePDIVenturaFusion.hpp b/src/terralib/image_processing/TePDIVenturaFusion.hpp
new file mode 100644
index 0000000..194cb95
--- /dev/null
+++ b/src/terralib/image_processing/TePDIVenturaFusion.hpp
@@ -0,0 +1,121 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIVENTURAFUSION_HPP
+  #define TEPDIVENTURAFUSION_HPP
+
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIMatrix.hpp"
+
+  /**
+   * @class TePDIVenturaFusion 
+   * @brief This is the class for Ventura fusion.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup PDIFusionAlgorithms
+   *
+   * @note The required parameters are:
+   * @param reference_raster ( TePDITypes::TePDIRasterPtrType ) - 
+   *  Reference raster ( higher quality ).
+   * @param lowres_raster ( TePDITypes::TePDIRasterPtrType ) - 
+   *  Low resolution raster ( will be improved ).
+   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
+   * @param reference_raster_band ( int ) - The band to process for 
+   * reference_raster.
+   * @param lowres_raster_band ( int ) - The band to process for lowres_raster.
+   *
+   * @note The following parameters are optional, and will be used if present:
+   *
+   * @param filters_scale ( double ) - The wavelet filters scale.
+   * @param a_filter_l ( std::vector< double > ) - Wavelet Analysis filter, 
+   * low pass, non
+   * normalized ( used in decomposition ).
+   * @param a_filter_h ( std::vector< double > ) - Wavelet Analysis filter, 
+   * high pass, non
+   * normalized ( used in decomposition ).
+   * @param s_filter_l ( std::vector< double > ) - Wavelet Synthesis filter, 
+   * low pass, non
+   * normalized ( used in recomposition ).
+   * @param s_filter_h ( std::vector< double > ) - Wavelet Synthesis filter, 
+   * high pass, non
+   * normalized ( used in recomposition ).    
+   *
+   * @note The reference_raster lines number must be a multiple
+   * of two multiplied by lowres_raster lines number.
+   * @note The reference_raster columns number must be a multiple
+   * of two multiplied by lowres_raster columns number.
+   * @note This algorithm is base on the work: Fernando N. Ventura, 
+   * Leila M. G. Fonseca. Remotely Sensed Image Fusion Using The Wavelet 
+   * Transform. International Symposium on Remote Sensing of Environment. 
+   * Buenos Aires, Argentina. 2002.
+   *
+   * @example TePDIFusion_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIVenturaFusion : public TePDIAlgorithm
+  {
+    public :
+      
+      TePDIVenturaFusion();      
+
+      ~TePDIVenturaFusion();
+
+      //Overloaded
+      bool CheckParameters( const TePDIParameters& parameters ) const;   
+            
+    protected :
+    
+      //Overloaded
+      void ResetState( const TePDIParameters& params );    
+     
+      //Overloaded
+      bool RunImplementation();      
+  
+      /**
+       * @brief Extracts the band 0 from the raster into the matrix.
+       *
+       * @param raster Input raster.
+       * @param matrix Input matrix.
+       * @return true if ok, valse on errors.
+       */      
+      bool RasterBand2Matrix( const TePDITypes::TePDIRasterPtrType& raster,
+        TePDIMatrix< double >& matrix );
+        
+      /**
+      * @brief Find the best decimation levels bringging the two rasters to
+      * closer sizes.
+      *
+      * @param raster1 Input raster1.
+      * @param raster2 Input raster2.
+      * @param r1_level Raster 1 best decomposition level.
+      * @param r2_level Raster 2 best decomposition level.
+      * @param decim_error The error ( pixels number ) for the best level found.
+      * @return true if OK. false on errors.
+      */
+      bool findBestDecimLevels( 
+        const TePDITypes::TePDIRasterPtrType& raster1,
+        const TePDITypes::TePDIRasterPtrType& raster2,
+        unsigned long int& r1_level, unsigned long int& r2_level,
+        unsigned long int& decim_error );    
+  };
+
+#endif
diff --git a/src/terralib/image_processing/TePDIVenturaFusionSF.cpp b/src/terralib/image_processing/TePDIVenturaFusionSF.cpp
deleted file mode 100755
index 327c7ee..0000000
--- a/src/terralib/image_processing/TePDIVenturaFusionSF.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "TePDIVenturaFusionSF.hpp"
-#include "TePDIVenturaFusionStrategy.hpp"
-
-TePDIVenturaFusionSF::TePDIVenturaFusionSF()
-: TePDIStrategyFactory( std::string( "ventura" ) )
-{
-};
-
-
-TePDIVenturaFusionSF::~TePDIVenturaFusionSF()
-{
-};
-
-
-TePDIStrategy* TePDIVenturaFusionSF::build ( const TePDIParameters& )
-{
-  TePDIStrategy* instance_ptr = new TePDIVenturaFusionStrategy();
-  
-  return instance_ptr;
-}
-
diff --git a/src/terralib/image_processing/TePDIVenturaFusionSF.hpp b/src/terralib/image_processing/TePDIVenturaFusionSF.hpp
deleted file mode 100755
index d88066c..0000000
--- a/src/terralib/image_processing/TePDIVenturaFusionSF.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIVENTURAFUSIONSF_HPP
-  #define TEPDIVENTURAFUSIONSF_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIStrategyFactory.hpp"
-  #include "TePDIParameters.hpp"
-  #include "TePDIStrategy.hpp"
-  
-  /**
-   * @brief This is the class for Ventura fusion strategy factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategiesFactories
-   */
-  class PDI_DLL TePDIVenturaFusionSF : public TePDIStrategyFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TePDIVenturaFusionSF();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIVenturaFusionSF();
-      
-    protected :  
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the parameters used by the
-       * algorithm.
-       * @return A pointer to the new generated strategy instance.
-       */
-      TePDIStrategy* build( const TePDIParameters& arg );
-      
-  };
-
-  namespace
-  {  
-    static TePDIVenturaFusionSF TePDIVenturaFusionSF_instance;
-  };
-
-#endif
-
diff --git a/src/terralib/image_processing/TePDIVenturaFusionStrategy.cpp b/src/terralib/image_processing/TePDIVenturaFusionStrategy.cpp
deleted file mode 100755
index b3b5731..0000000
--- a/src/terralib/image_processing/TePDIVenturaFusionStrategy.cpp
+++ /dev/null
@@ -1,522 +0,0 @@
- 
-#include "TePDIVenturaFusionStrategy.hpp"
-#include "TePDIMathFunctions.hpp"
-#include "TePDIStrategyFactory.hpp"
-#include "TePDIMallatWavelets.hpp"
-#include "TePDIStatistic.hpp"
-#include "TePDIMatrix.hpp"
-#include "TePDIMatrixFunctions.hpp"
-#include "TePDIUtils.hpp"
-#include "TePDIPIManager.hpp"
-
-#include <TeBox.h>
-#include <TeUtils.h>
-#include <TeRasterParams.h>
-
-TePDIVenturaFusionStrategy::TePDIVenturaFusionStrategy()
-{
-};      
-
-TePDIVenturaFusionStrategy::~TePDIVenturaFusionStrategy()
-{
-};
-
-
-bool TePDIVenturaFusionStrategy::CheckParameters( 
-  const TePDIParameters& parameters ) const
-{
-  /* Checking reference_raster */
-  
-  TePDITypes::TePDIRasterPtrType reference_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster", 
-    reference_raster ),
-    "Missing parameter: reference_raster" );
-  TEAGN_TRUE_OR_RETURN( reference_raster.isActive(),
-    "Invalid parameter: reference_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( reference_raster->params().status_ != 
-    TeRasterParams::TeNotReady, 
-    "Invalid parameter: reference_raster not ready" );    
-    
-  /* Checking lowres_raster */
-  
-  TePDITypes::TePDIRasterPtrType lowres_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "lowres_raster", 
-    lowres_raster ),
-    "Missing parameter: lowres_raster" );
-  TEAGN_TRUE_OR_RETURN( lowres_raster.isActive(),
-    "Invalid parameter: lowres_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( lowres_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: lowres_raster not ready" );    
-    
-  double max_low_res_raster_res =
-    MAX( lowres_raster->params().resx_, 
-    lowres_raster->params().resy_ );
-  double max_reference_raster_res =
-    MAX( reference_raster->params().resx_, 
-    reference_raster->params().resy_ );
-    
-  TEAGN_TRUE_OR_RETURN(     
-    ( max_low_res_raster_res > max_reference_raster_res ),
-    "Invalid low resolution raster resolution" );
-        
-  /* Checking output_raster */
-  
-  TePDITypes::TePDIRasterPtrType output_raster;
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "output_raster", 
-    output_raster ),
-    "Missing parameter: output_raster" );
-  TEAGN_TRUE_OR_RETURN( output_raster.isActive(),
-    "Invalid parameter: output_raster inactive" );
-  TEAGN_TRUE_OR_RETURN( output_raster->params().status_ != 
-    TeRasterParams::TeNotReady, "Invalid parameter: output_raster not ready" );    
-    
-  /* Checking bands */    
-    
-  int reference_raster_band = 0;    
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "reference_raster_band", 
-    reference_raster_band ), "Missing parameter : reference_raster_band" );
-  TEAGN_TRUE_OR_RETURN( ( reference_raster->nBands() > reference_raster_band ),
-    "Invalid parameter : reference_raster_band" );
-    
-  int lowres_raster_band = 0;    
-  TEAGN_TRUE_OR_RETURN( parameters.GetParameter( "lowres_raster_band", 
-    lowres_raster_band ), "Missing parameter : lowres_raster_band" );
-  TEAGN_TRUE_OR_RETURN( ( lowres_raster->nBands() > lowres_raster_band ),
-    "Invalid parameter : lowres_raster_band" ); 
-    
-  /* Checking photometric interpretation */
-  
-  TEAGN_TRUE_OR_RETURN( ( 
-    ( reference_raster->params().photometric_[ reference_raster_band ] == 
-      TeRasterParams::TeRGB ) ||
-    ( reference_raster->params().photometric_[ reference_raster_band ] == 
-      TeRasterParams::TeMultiBand ) ),
-  "Invalid parameter - reference_raster (invalid photometric interpretation)" );   
-
-  TEAGN_TRUE_OR_RETURN( ( 
-    ( lowres_raster->params().photometric_[ lowres_raster_band ] == 
-      TeRasterParams::TeRGB ) ||
-    ( lowres_raster->params().photometric_[ lowres_raster_band ] == 
-      TeRasterParams::TeMultiBand ) ),
-  "Invalid parameter - lowres_raster (invalid photometric interpretation)" );   
-      
-  return true;
-}
-
-
-bool TePDIVenturaFusionStrategy::Implementation( const TePDIParameters& params )
-{
-  TePDITypes::TePDIRasterPtrType reference_raster;
-  params.GetParameter( "reference_raster", reference_raster );
-
-  TePDITypes::TePDIRasterPtrType lowres_raster;
-  params.GetParameter( "lowres_raster", lowres_raster );
-
-  TePDITypes::TePDIRasterPtrType output_raster;
-  params.GetParameter( "output_raster", output_raster );
-  
-  int reference_raster_band = 0;
-  params.GetParameter( "reference_raster_band", reference_raster_band );
-
-  int lowres_raster_band = 0;
-  params.GetParameter( "lowres_raster_band", lowres_raster_band );
-  
-  TePDITypes::TePDIRasterPtrType lowlow;
-  TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( lowlow, 1, 1, 1, false,
-    TeDOUBLE, 0 ), "Unable to create temporary low-low raster" );  
-    
-  /* Finding the best decomposition levels for both rasters */
-  
-  unsigned long int reference_raster_best_level = 0;
-  unsigned long int lowres_raster_best_level = 0;
-  unsigned long int decim_error = 0;
-  findBestDecimLevels( reference_raster, lowres_raster, 
-    reference_raster_best_level, lowres_raster_best_level, decim_error );
-  
- /* Building default wavelet filters  - Reference coef 07 */
- 
-  double filters_scale = 0.71;
-  if( params.CheckParameter< double >( "filters_scale" ) ) {
-      
-    params.GetParameter( "filters_scale", filters_scale );
-  }
-    
-  std::vector< double > a_filter_l;
-  a_filter_l.push_back( -0.05 );
-  a_filter_l.push_back( 0.25 );
-  a_filter_l.push_back( 0.6 );
-  a_filter_l.push_back( 0.25 );
-  a_filter_l.push_back( -0.05 );
-  
-  std::vector< double > a_filter_h;
-  a_filter_h.push_back( 0.0107143 );
-  a_filter_h.push_back( -0.0535714 );
-  a_filter_h.push_back( -0.2607143 );
-  a_filter_h.push_back( 0.6071429 );
-  a_filter_h.push_back( -0.2607143 );
-  a_filter_h.push_back( -0.0535714 );
-  a_filter_h.push_back( 0.0107143 );
-  
-  std::vector< double > s_filter_l;
-  s_filter_l.push_back( -0.0107143 );
-  s_filter_l.push_back( -0.0535714 );
-  s_filter_l.push_back( 0.2607143 );
-  s_filter_l.push_back( 0.6071429 );
-  s_filter_l.push_back( 0.2607143 );
-  s_filter_l.push_back( -0.0535714 );
-  s_filter_l.push_back( -0.0107143 );
-  
-  std::vector< double > s_filter_h;
-  s_filter_h.push_back( -0.05 );
-  s_filter_h.push_back( -0.25 );
-  s_filter_h.push_back( 0.6 );
-  s_filter_h.push_back( -0.25 );
-  s_filter_h.push_back( -0.05 );
-  
-  /* Checking for user supplied wavelet filters */
-  
-  if( params.CheckParameter< std::vector< double > >( "a_filter_l" ) ) {
-      
-    params.GetParameter( "a_filter_l", a_filter_l );
-  }
-  if( params.CheckParameter< std::vector< double > >( "a_filter_h" ) ) {
-      
-    params.GetParameter( "a_filter_h", a_filter_h );
-  }  
-  if( params.CheckParameter< std::vector< double > >( "s_filter_l" ) ) {
-      
-    params.GetParameter( "s_filter_l", s_filter_l );
-  }
-  if( params.CheckParameter< std::vector< double > >( "s_filter_h" ) ) {
-      
-    params.GetParameter( "s_filter_h", s_filter_h );
-  }  
-  
-  /* Step 1 - pyramid1 generation  */
-  
-  TePDITypes::TePDIRasterVectorPtrType pyramid1( new
-    TePDITypes::TePDIRasterVectorType );
-  
-  TePDIParameters step1_params;
-  step1_params.SetParameter( "wavelets_type", std::string( "mallat" ) );
-  step1_params.SetParameter( "filter_task", std::string( "GetPyramid" ) );
-  step1_params.SetParameter( "input_image", lowres_raster );
-  step1_params.SetParameter( "band", lowres_raster_band );
-  step1_params.SetParameter( "a_filter_l", a_filter_l );
-  step1_params.SetParameter( "a_filter_h", a_filter_h );
-  step1_params.SetParameter( "s_filter_l", s_filter_l );
-  step1_params.SetParameter( "s_filter_h", s_filter_h );
-  step1_params.SetParameter( "filters_scale", filters_scale );         
-  step1_params.SetParameter( "levels", (int)lowres_raster_best_level );
-  step1_params.SetParameter( "pyramid", pyramid1 );
-  
-  TePDIMallatWavelets wavelet_filter;
-  wavelet_filter.ToggleProgInt( progress_interface_enabled_ );  
-  
-  TEAGN_TRUE_OR_THROW( wavelet_filter.Reset( step1_params ),
-    "Unable to set wavelet filter Parameters ( step 1 )" );
-  TEAGN_TRUE_OR_THROW( wavelet_filter.Apply(), 
-    "Wavelet Filter apply error ( step 1 )" );  
-  
-  step1_params.Clear();
-  
-  /* Step 2 - pyramid2 generation */
-  
-  TePDITypes::TePDIRasterVectorPtrType pyramid2( new
-    TePDITypes::TePDIRasterVectorType );
-  
-  TePDIParameters step2_params;
-  step2_params.SetParameter( "wavelets_type", std::string( "mallat" ) );
-  step2_params.SetParameter( "filter_task", std::string( "GetPyramid" ) );
-  step2_params.SetParameter( "input_image", reference_raster );
-  step2_params.SetParameter( "band", (int)reference_raster_band );
-  step2_params.SetParameter( "a_filter_l", a_filter_l );
-  step2_params.SetParameter( "a_filter_h", a_filter_h );
-  step2_params.SetParameter( "s_filter_l", s_filter_l );
-  step2_params.SetParameter( "s_filter_h", s_filter_h );
-  step2_params.SetParameter( "filters_scale", filters_scale );         
-  step2_params.SetParameter( "levels", (int)reference_raster_best_level );      
-  step2_params.SetParameter( "pyramid", pyramid2 );
-  
-  TEAGN_TRUE_OR_THROW( wavelet_filter.Reset( step2_params ),
-    "Unable to set wavelet filter Parameters ( step 2 )" );
-  TEAGN_TRUE_OR_THROW( wavelet_filter.Apply(), 
-    "Wavelet Filter apply error ( step 2 )" );  
-  
-  step2_params.Clear();
-  
-  TEAGN_DEBUG_CONDITION( ( pyramid1->size() / 4 ) == 
-    lowres_raster_best_level, 
-    "Invalid pyramid" );
-  TEAGN_DEBUG_CONDITION( ( pyramid2->size() / 4 ) == 
-    reference_raster_best_level, 
-    "Invalid pyramid" );
-  TEAGN_DEBUG_CONDITION(
-    ( (*pyramid1)[ pyramid1->size() - 4 ]->params().nlines_ ==
-    (*pyramid2)[ pyramid2->size() - 4 ]->params().nlines_ ),
-    "Pyramids lines mismatch" );
-  TEAGN_DEBUG_CONDITION(
-    ( (*pyramid1)[ pyramid1->size() - 4 ]->params().ncols_ ==
-    (*pyramid2)[ pyramid2->size() - 4 ]->params().ncols_ ),
-    "Pyramids columns mismatch" );  
-  
-  /* Step 3 - Pyramid2 enhencement */
-  
-  TePDIMatrix< double > sb1matrix( 0, 0, 
-    TePDIMatrix< double >::AutoMemPol );
-  TePDIMatrix< double > sb2matrix( 0, 0, 
-    TePDIMatrix< double >::AutoMemPol );
-  const unsigned int pys_levels_bound = MIN( reference_raster_best_level,
-    lowres_raster_best_level );
-  unsigned int py1_sb00_index = 0;
-  unsigned int py2_sb00_index = 0;
-  
-  TePDIPIManager progress( "Pyramid enhencement", pys_levels_bound, 
-    progress_interface_enabled_ );
-  
-  for( unsigned int pys_levels_off = 0 ; /* low-low skipping */
-       pys_levels_off < pys_levels_bound ;
-       ++pys_levels_off ) {
-       
-    py1_sb00_index = pyramid1->size() - ( 4 * ( pys_levels_off + 1 ) );
-    py2_sb00_index = pyramid2->size() - ( 4 * ( pys_levels_off + 1 ) );
-    
-    TEAGN_TRUE_OR_RETURN( RasterBand2Matrix( (*pyramid1)[ py1_sb00_index ], 
-      sb1matrix ), "Cannot convert sub-band from pyramid1" );
-    TEAGN_TRUE_OR_RETURN( RasterBand2Matrix( (*pyramid2)[ py2_sb00_index ], 
-      sb2matrix ), "Cannot convert sub-band from pyramid2" );    
-       
-    double sb00_correlation = TePDIMatrixFunctions::GetCorrelation( sb1matrix,
-      sb2matrix );
-      
-    TePDIMatrix< double > absmatrix1( 0, 0, 
-      TePDIMatrix< double >::AutoMemPol );
-    TePDIMatrix< double > absmatrix2( 0, 0, 
-      TePDIMatrix< double >::AutoMemPol );      
-    TePDIMatrix< double > gtmatrix( 0, 0, 
-      TePDIMatrix< double >::AutoMemPol );      
-    TePDIMatrix< double > notmatrix( 0, 0, 
-      TePDIMatrix< double >::AutoMemPol );      
-      
-    for( unsigned int subband = 1 ; subband < 4 ; ++subband ) {
-      TEAGN_TRUE_OR_RETURN( RasterBand2Matrix( 
-        (*pyramid1)[ py1_sb00_index + subband ], 
-        sb1matrix ), "Cannot convert sub-band from pyramid1" );
-      TEAGN_TRUE_OR_RETURN( RasterBand2Matrix( 
-        (*pyramid2)[ py2_sb00_index + subband ], 
-        sb2matrix ), "Cannot convert sub-band from pyramid2" );       
-        
-      TEAGN_TRUE_OR_RETURN( 
-        TePDIMatrixFunctions::Abs( sb1matrix, absmatrix1 ), 
-        "Abs1 matrix calcule error" );
-      TEAGN_TRUE_OR_RETURN( 
-        TePDIMatrixFunctions::Abs( sb2matrix, absmatrix2 ), 
-        "Abs2 matrix calcule error" );
-      TEAGN_TRUE_OR_RETURN( 
-        TePDIMatrixFunctions::WhereIsGreater( absmatrix2, absmatrix1, 
-        gtmatrix ), "GT matrix calcule error" );        
-      TEAGN_TRUE_OR_RETURN( 
-        TePDIMatrixFunctions::Negate( gtmatrix, notmatrix ), 
-        "NOT matrix calcule error" );
-        
-      const unsigned int valid_lines = MIN( sb1matrix.GetLines(),
-        sb2matrix.GetLines() );
-      const unsigned int valid_cols = MIN( sb2matrix.GetColumns(),
-        sb2matrix.GetColumns() );
-      const unsigned int sb2matrix_lines = sb2matrix.GetLines();
-      const unsigned int sb2matrix_cols = sb2matrix.GetColumns();
-      unsigned int line = 0;
-      unsigned int col = 0;
-      TeRaster* outraster_ptr = 
-        (*pyramid2)[ py2_sb00_index + subband ].nakedPointer();
-      bool result = false;
-      double value1 = 0;
-      double value2 = 0;
-      
-      for( line = 0 ; line < sb2matrix_lines ; ++line ) {
-        for( col = 0 ; col < sb2matrix_cols ; ++col ) {
-          if( ( line < valid_lines ) && ( col < valid_cols ) ) {
-            value1 = ( gtmatrix( line, col ) * sb1matrix( line, col ) ) +
-              ( notmatrix( line, col ) * sb2matrix( line, col ) );
-            value2 = ( notmatrix( line, col ) * sb1matrix( line, col ) ) +
-              ( gtmatrix( line, col ) * sb2matrix( line, col ) );              
-          
-            result = outraster_ptr->setElement( col, line, 
-              ( value1 + ( ABS( 1 - sb00_correlation ) * value2 ) ), 0 );
-            TEAGN_DEBUG_CONDITION( result, "Raster write error" );
-          } else {
-            result = outraster_ptr->setElement( col, line, 0.0, 0 );
-            TEAGN_DEBUG_CONDITION( result, "Raster write error" );
-          }
-        }
-      }
-    }
-
-    TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by the user" );
-  }
-  
-  progress.Toggle( false );
-  
-  sb1matrix.Reset();
-  sb2matrix.Reset();
-  
-  /* Step 4 - Low-low swap */
-  
-  TePDITypes::TePDIRasterPtrType py1_raster = (*pyramid1)[ pyramid1->size() - 4 ];
-  TePDITypes::TePDIRasterPtrType py2_raster = 
-    (*pyramid2)[ pyramid2->size() - 4 ];
-  const unsigned int py_lines_bound = py1_raster->params().nlines_;
-  const unsigned int py_cols_bound = py1_raster->params().ncols_;
-  double value = 0;
-  unsigned int py_line;
-  unsigned int py_col;
-  bool get_result = false;
-  bool set_result = false;
-  
-  for( py_line = 0 ; py_line < py_lines_bound ; ++py_line ) {
-    for( py_col = 0 ; py_col < py_cols_bound ; ++py_col ) {
-      get_result = py1_raster->getElement( py_col, py_line, value, 0 );
-      
-      TEAGN_DEBUG_CONDITION( get_result, 
-        "Unable to read from low resolution pyramid" );
-        
-      set_result = py2_raster->setElement( py_col, py_line, value, 0 );
-        
-      TEAGN_DEBUG_CONDITION( set_result, 
-        "Unable to write to high resolution pyramid" );
-    }
-  }
-  
-  pyramid1->clear();
-  
-  /* Step 5 - Pyramid 2 recomposition */
-  
-  TePDIParameters step5_params;
-  step5_params.SetParameter( "wavelets_type", std::string( "mallat" ) );
-  step5_params.SetParameter( "filter_task", std::string( "RecomposePyramid" ) );
-  step5_params.SetParameter( "input_image", reference_raster );
-  step5_params.SetParameter( "band", (int)reference_raster_band );
-  step5_params.SetParameter( "output_image", output_raster );
-  step5_params.SetParameter( "a_filter_l", a_filter_l );
-  step5_params.SetParameter( "a_filter_h", a_filter_h );
-  step5_params.SetParameter( "s_filter_l", s_filter_l );
-  step5_params.SetParameter( "s_filter_h", s_filter_h );
-  step5_params.SetParameter( "filters_scale", filters_scale );         
-  step5_params.SetParameter( "pyramid", pyramid2 );      
-  
-  TEAGN_TRUE_OR_THROW( wavelet_filter.Reset( step5_params ),
-    "Unable to set wavelet filter Parameters ( step 5 )" );
-  TEAGN_TRUE_OR_THROW( wavelet_filter.Apply(), 
-    "Wavelet Filter apply error ( step 5 )" );
-     
-  return true;
-}
-
-
-bool TePDIVenturaFusionStrategy::RasterBand2Matrix( 
-  const TePDITypes::TePDIRasterPtrType& raster,
-  TePDIMatrix< double >& matrix )
-{
-  TEAGN_TRUE_OR_RETURN( raster.isActive(), "Inactive raster" );
-  
-  unsigned int lines_bound = raster->params().nlines_;
-  unsigned int cols_bound = raster->params().ncols_;
-  unsigned int line = 0;
-  unsigned int col = 0;
-  double value = 0;
-  bool result = false;
-  
-  TEAGN_TRUE_OR_RETURN( matrix.Reset( lines_bound, cols_bound ),
-    "Matrix reset error" );
-    
-  TeRaster* raster_ptr = raster.nakedPointer();
-  
-  for( line = 0 ; line < lines_bound ; ++line ) {
-    for( col = 0 ; col < cols_bound ; ++col ) {
-      result = raster_ptr->getElement( col, line, value, 0 );
-      TEAGN_DEBUG_CONDITION( result, "Unable to read from raster" );
-      
-      matrix( line, col ) = value;
-    }
-  }
-  
-  return true;
-}
-        
-     
-bool TePDIVenturaFusionStrategy::findBestDecimLevels( 
-  const TePDITypes::TePDIRasterPtrType& raster1,
-  const TePDITypes::TePDIRasterPtrType& raster2,
-  unsigned long int& r1_level, unsigned long int& r2_level,
-  unsigned long int& decim_error )
-{
-  TEAGN_TRUE_OR_RETURN( raster1.isActive(), "raster1 inactive" );
-  TEAGN_TRUE_OR_RETURN( raster2.isActive(), "raster2 inactive" );
-
-  const unsigned long int r1_lines = raster1->params().nlines_;
-  const unsigned long int r1_cols = raster1->params().ncols_;
-  const unsigned long int r2_lines = raster2->params().nlines_;
-  const unsigned long int r2_cols = raster2->params().ncols_;
-
-  const unsigned long int r1_max_levels = MIN(
-    TePDIMathFunctions::DecimLevels( r1_lines ),
-    TePDIMathFunctions::DecimLevels( r1_cols ) );  
-  const unsigned long int r2_max_levels = MIN(
-    TePDIMathFunctions::DecimLevels( r2_lines ),
-    TePDIMathFunctions::DecimLevels( r2_cols ) );
-  
-  if( ( r1_max_levels < 1 ) || ( r2_max_levels < 1 ) ) {
-    r1_level = r2_level = 0;
-    return false;
-  } else {
-    bool best_level_diff_found = false;
-    
-    unsigned long int curr_diff = 0;
-    long int curr_r1_lines = r1_lines;
-    long int curr_r1_cols = r1_cols;
-    long int curr_r2_lines = 0;
-    long int curr_r2_cols = 0;
-    
-    for( unsigned long int curr_r1_level = 1 ; 
-      curr_r1_level <= r1_max_levels ; 
-      ++curr_r1_level ) {
-      
-      curr_r1_lines = ( long int )
-        ceil( ( (double)curr_r1_lines ) / 2 );
-      curr_r1_cols = ( long int )
-        ceil( ( (double)curr_r1_cols ) / 2 );      
-        
-      curr_r2_lines = r2_lines;
-      curr_r2_cols = r2_cols;        
-    
-      for( unsigned long int curr_r2_level = 1 ; 
-        curr_r2_level <= r2_max_levels ; 
-        ++curr_r2_level ) {
-      
-        curr_r2_lines = ( long int )
-          ceil( ( (double)curr_r2_lines ) / 2 );
-        curr_r2_cols = ( long int )
-          ceil( ( (double)curr_r2_cols ) / 2 );
-          
-        curr_diff = ABS( curr_r1_lines - curr_r2_lines ) +
-          ABS( curr_r1_cols - curr_r2_cols );
-          
-        if( best_level_diff_found ) {
-          if( curr_diff < decim_error ) {
-            r1_level = curr_r1_level;
-            r2_level = curr_r2_level;
-            decim_error = curr_diff;
-          }
-        } else {
-          r1_level = curr_r1_level;
-          r2_level = curr_r2_level;
-          decim_error = curr_diff;
-          best_level_diff_found = true;
-        }
-      }
-    }
-    
-    return true;
-  }
-}        
-
diff --git a/src/terralib/image_processing/TePDIVenturaFusionStrategy.hpp b/src/terralib/image_processing/TePDIVenturaFusionStrategy.hpp
deleted file mode 100755
index 9102cf1..0000000
--- a/src/terralib/image_processing/TePDIVenturaFusionStrategy.hpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIVENTURAFUSIONSTRATEGY_HPP
-  #define TEPDIVENTURAFUSIONSTRATEGY_HPP
-
-  #include <TeSharedPtr.h>
-  #include "TePDIStrategy.hpp"
-  #include "TePDIParameters.hpp"
-  #include "TePDIMatrix.hpp"
-  
-  #include <string>
-
-  /**
-   * @brief This is the class for Ventura fusion strategy.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup PDIStrategies
-   *
-   * @note The required parameters are:
-   * @param fusion_type ( std::string ) : Must be "ventura".
-   * @param reference_raster ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Reference raster ( higher quality ).
-   * @param lowres_raster ( TePDITypes::TePDIRasterPtrType ) - 
-   *  Low resolution raster ( will be improved ).
-   * @param output_raster ( TePDITypes::TePDIRasterPtrType ) - Output raster.
-   * @param reference_raster_band ( int ) - The band to process for 
-   * reference_raster.
-   * @param lowres_raster_band ( int ) - The band to process for lowres_raster.
-   *
-   * @note The following parameters are optional, and will be used if present:
-   *
-   * @param filters_scale ( double ) - The wavelet filters scale.
-   * @param a_filter_l ( std::vector< double > ) - Wavelet Analysis filter, 
-   * low pass, non
-   * normalized ( used in decomposition ).
-   * @param a_filter_h ( std::vector< double > ) - Wavelet Analysis filter, 
-   * high pass, non
-   * normalized ( used in decomposition ).
-   * @param s_filter_l ( std::vector< double > ) - Wavelet Synthesis filter, 
-   * low pass, non
-   * normalized ( used in recomposition ).
-   * @param s_filter_h ( std::vector< double > ) - Wavelet Synthesis filter, 
-   * high pass, non
-   * normalized ( used in recomposition ).    
-   *
-   * @note The reference_raster lines number must be a multiple
-   * of two multiplied by lowres_raster lines number.
-   * @note The reference_raster columns number must be a multiple
-   * of two multiplied by lowres_raster columns number.
-   */
-  class PDI_DLL TePDIVenturaFusionStrategy : public TePDIStrategy
-  {
-    friend class TePDIVenturaFusionSF;
-  
-    public :
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIVenturaFusionStrategy();
-      
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI strategy.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( 
-        const TePDIParameters& parameters ) const;       
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TePDIVenturaFusionStrategy();
-      
-      /**
-       * @brief Runs the algorithm implementation.
-       *
-       * @return true if OK. false on errors.
-       */
-      bool Implementation( const TePDIParameters& params );
-      
-      /**
-       * @brief Extracts the band 0 from the raster into the matrix.
-       *
-       * @param raster Input raster.
-       * @param matrix Input matrix.
-       * @return true if ok, valse on errors.
-       */      
-      bool RasterBand2Matrix( const TePDITypes::TePDIRasterPtrType& raster,
-        TePDIMatrix< double >& matrix );
-        
-      /**
-      * @brief Find the best decimation levels bringging the two rasters to
-      * closer sizes.
-      *
-      * @param raster1 Input raster1.
-      * @param raster2 Input raster2.
-      * @param r1_level Raster 1 best decomposition level.
-      * @param r2_level Raster 2 best decomposition level.
-      * @param decim_error The error ( pixels number ) for the best level found.
-      * @return true if OK. false on errors.
-      */
-      bool findBestDecimLevels( 
-        const TePDITypes::TePDIRasterPtrType& raster1,
-        const TePDITypes::TePDIRasterPtrType& raster2,
-        unsigned long int& r1_level, unsigned long int& r2_level,
-        unsigned long int& decim_error );        
-
-  };
-  
-#endif
-
-
-
diff --git a/src/terralib/image_processing/TePDIWaveletAtrous.cpp b/src/terralib/image_processing/TePDIWaveletAtrous.cpp
index 0687c87..a05598c 100644
--- a/src/terralib/image_processing/TePDIWaveletAtrous.cpp
+++ b/src/terralib/image_processing/TePDIWaveletAtrous.cpp
@@ -1,375 +1,387 @@
-#include "TePDIWaveletAtrous.hpp"
-
-#include <TeAgnostic.h>
-#include "TePDIUtils.hpp"
-#include "TePDITypes.hpp"
-#include "TePDIStatistic.hpp"
-#include "TePDIPrincipalComponents.hpp"
-#include "TeRasterRemap.h"
-#include <TeMatrix.h>
-#include <TeUtils.h>
-#include <math.h>
-#include <queue>
-
-TePDIWaveletAtrous::TePDIWaveletAtrous()
-{
-}
-
-TePDIWaveletAtrous::~TePDIWaveletAtrous()
-{
-}
-
-void TePDIWaveletAtrous::ResetState(const TePDIParameters& params)
-{
-}
-
-bool TePDIWaveletAtrous::CheckParameters(const TePDIParameters& parameters) const
-{
-	TeWaveletAtrousDirection direction;
-	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("direction", direction), "Missing parameter: direction");
-
-	if (direction == DECOMPOSE)
-	{
-		TePDITypes::TePDIRasterPtrType input_raster;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_raster", input_raster), "Missing parameter: input_raster");
-		TEAGN_TRUE_OR_RETURN(input_raster.isActive(), "Invalid parameter: input_raster inactive");
-		TEAGN_TRUE_OR_RETURN(input_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster not ready");
-	
-		int band;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("band", band), "Missing parameter: band");
-		TEAGN_TRUE_OR_RETURN(band < input_raster->nBands(), "Invalid parameter: band number");
-	
-		int levels;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("levels", levels), "Missing parameter: levels");
-	
-		TeFilterBanks filterType;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("filterType", filterType), "Missing parameter: filterType");
-	
-		TePDITypes::TePDIRasterPtrType multi_raster;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("multi_raster", multi_raster), "Missing parameter: multi_raster");
-
-		bool fit_histogram;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
-
-		TePDITypes::TePDIRasterVectorType output_wavelets;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_wavelets", output_wavelets), "Missing parameter: output_wavelets");
-		TEAGN_TRUE_OR_RETURN((int)output_wavelets.size() == (levels + 1), "Invalid output rasters number");
-	
-		for(unsigned int b = 0; b < output_wavelets.size(); b++)
-		{
-			TEAGN_TRUE_OR_RETURN(output_wavelets[b].isActive(), "Invalid parameter: output_wavelets " + Te2String(b) + " inactive");
-			TEAGN_TRUE_OR_RETURN(output_wavelets[b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_wavelets " + Te2String(b) + " not ready");
-		}
-	}
-	else if (direction == RECOMPOSE)
-	{
-		std::vector<TePDITypes::TePDIRasterVectorType> input_rasters_wavelets;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters_wavelets", input_rasters_wavelets), "Missing parameter: input_rasters_wavelets");
-		for(unsigned int w = 0; w < input_rasters_wavelets.size(); w++)
-			for(unsigned int b = 0; b < input_rasters_wavelets[w].size(); b++)
-			{
-				TEAGN_TRUE_OR_RETURN(input_rasters_wavelets[w][b].isActive(), "Invalid parameter: input_rasters_wavelets inactive");
-				TEAGN_TRUE_OR_RETURN(input_rasters_wavelets[w][b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_rasters_wavelets not ready");
-			}
-	
-		int rasters_levels;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("rasters_levels", rasters_levels), "Missing parameter: rasters_levels");
-		for(unsigned int w = 0; w < input_rasters_wavelets.size(); w++)
-			TEAGN_TRUE_OR_RETURN((rasters_levels + 1) == (int)input_rasters_wavelets[w].size(), "Invalid parameter: rasters_levels not ready");
-	
-		std::vector<TePDITypes::TePDIRasterVectorType> reference_raster_wavelets;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster_wavelets", reference_raster_wavelets), "Missing parameter: reference_raster_wavelets");
-		for(unsigned int w = 0; w < reference_raster_wavelets.size(); w++)
-			for(unsigned int b = 0; b < reference_raster_wavelets[w].size(); b++)
-			{
-				TEAGN_TRUE_OR_RETURN(reference_raster_wavelets[w][b].isActive(), "Invalid parameter: reference_raster_wavelets inactive");
-				TEAGN_TRUE_OR_RETURN(reference_raster_wavelets[w][b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: reference_raster_wavelets not ready");
-			}
-	
-		int reference_levels;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
-		for(unsigned int w = 0; w < reference_raster_wavelets.size(); w++)
-			TEAGN_TRUE_OR_RETURN((reference_levels + 1) == (int)reference_raster_wavelets[w].size(), "Invalid parameter: reference_levels not ready");
-	
-		double channel_min_level;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("channel_min_level", channel_min_level), "Missing parameter: channel_min_level");
-	
-		double channel_max_level;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("channel_max_level", channel_max_level), "Missing parameter: channel_max_level");
-	
-		TePDITypes::TePDIRasterVectorType output_rasters;
-		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
-	
-		for(unsigned int b = 0; b < output_rasters.size(); b++)
-		{
-			TEAGN_TRUE_OR_RETURN(output_rasters[b].isActive(), "Invalid parameter: output_rasters " + Te2String(b) + " inactive");
-			TEAGN_TRUE_OR_RETURN(output_rasters[b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_rasters " + Te2String(b) + " not ready");
-		}
-
-	}
-	else
-		return false;
-
-	return true;
-}
-
-bool filterBank(int filterBankType,TeMatrix &filter)
-{	
-	if (filterBankType == TePDIWaveletAtrous::B3SPLINE)
-	{
-		filter.Init(5, 5, 0.0);
-		std::queue<double> maskWeights;
-		maskWeights.push(1.0/256.0);maskWeights.push(1.0/64.0);maskWeights.push(3.0/128.0);maskWeights.push(1.0/64.0);maskWeights.push(1.0/256.0);
-		maskWeights.push(1.0/64.0);maskWeights.push(1.0/16.0);maskWeights.push(3.0/32.0);maskWeights.push(1.0/16.0);maskWeights.push(1.0/64.0);
-		maskWeights.push(3.0/128.0);maskWeights.push(3.0/32.0);maskWeights.push(9.0/64.0);maskWeights.push(3.0/32.0);maskWeights.push(3.0/128.0);
-		maskWeights.push(1.0/64.0);maskWeights.push(1.0/16.0);maskWeights.push(3.0/32.0);maskWeights.push(1.0/16.0);maskWeights.push(1.0/64.0);
-		maskWeights.push(1.0/256.0);maskWeights.push(1.0/64.0);maskWeights.push(3.0/128.0);maskWeights.push(1.0/64.0);maskWeights.push(1.0/256.0);
-
-		for (int i = 0; i < 5; i++)
-			for (int j = 0; j < 5; j++)
-			{
-				filter(i, j) = maskWeights.front();
-				maskWeights.pop();
-			}
-	}
- 	else if (filterBankType == TePDIWaveletAtrous::SMALLB3SPLINE)
-	{
-		filter.Init(3, 3, 0.0);
-		std::queue<double> maskWeights;
-		maskWeights.push(1.0/16.0);maskWeights.push(1.0/8.0);maskWeights.push(1.0/16.0);
-		maskWeights.push(1.0/8.0);maskWeights.push(1.0/4.0);maskWeights.push(1.0/8.0);
-		maskWeights.push(1.0/16.0);maskWeights.push(1.0/8.0);maskWeights.push(1.0/16.0);
-	
-		for (int i = 0; i < 3; i++)
-			for (int j = 0; j < 3; j++)
-			{
-				filter(i, j) = maskWeights.front();
-				maskWeights.pop();
-			}
-	}
-	else
-		return false;
-
-	return true;
-}
-
-bool TePDIWaveletAtrous::RunImplementation_decompose()
-{
-	TePDITypes::TePDIRasterPtrType input_raster;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_raster", input_raster), "Missing parameter: input_raster");
-
-	int band;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("band", band), "Missing parameter: band");
-
-	int levels;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("levels", levels), "Missing parameter: levels");
-
-	TeFilterBanks filterType;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("filterType", filterType), "Missing parameter: filterType");
-
-	TePDITypes::TePDIRasterPtrType multi_raster;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("multi_raster", multi_raster), "Missing parameter: multi_raster");
-
-	bool fit_histogram;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
-
-	TePDITypes::TePDIRasterVectorType output_wavelets;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_wavelets", output_wavelets), "Missing parameter: output_wavelets");
-
-	TeMatrix filter;
-	TEAGN_TRUE_OR_THROW(filterBank(filterType, filter), "Filter Bank generation failed");
-
-	/*for(unsigned int l = 1; l <= levels; l++)
-	{
-		TeRasterParams input_raster_params = input_raster->params();
-		input_raster_params.nBands(waveletPlanes);
-		if (input_raster_params.projection() != 0)
-		{
-			TeSharedPtr<TeProjection> proj(TeProjectionFactory::make(input_raster_params.projection()->params())); 
-			input_raster_params.projection(proj.nakedPointer());
-		}
-		input_raster_params.boxResolution(input_raster_params.box().x1(), input_raster_params.box().y1(), input_raster_params.box().x2(), input_raster_params.box().y2(), input_raster_params.resx_, input_raster_params.resy_);
-		input_raster_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
-		input_raster_params.setDataType(TeFLOAT, -1);
-		TEAGN_TRUE_OR_RETURN(output_wavelets[l]->init(input_raster_params), "Output wavelets reset error " + Te2String(l));
-	}*/
-
-	int	l,
-		multi,
-		x,
-		y,
-		i,
-		j,
-		filter_dim = filter.Nrow(),
-		offset = (int)(filter_dim / 2),
-		k,
-		m,
-		lines = input_raster->params().nlines_,
-		columns = input_raster->params().ncols_;
-	double	fit_gain = 1.0,
-		fit_offset = 0.0,
-		p_ori,
-		p_ant,
-		p_new;
-	TeMatrix	inputImageMatrix,
-			std_matrix,
-			mean_matrix;
-	inputImageMatrix.Init(lines, columns, 0.0);
-
-/* Computing statistics to fit the histograms */
-	
-	if (fit_histogram)
-	{
-		TePDIStatistic stat1;
-		TePDIParameters stat1_pars;
-		TePDITypes::TePDIRasterVectorType stat1_rasters;
-		std::vector<int> stat1_bands;
-
-		stat1_rasters.push_back(multi_raster);
-		stat1_pars.SetParameter("rasters", stat1_rasters);
-		stat1_bands.push_back(0);
-		stat1_pars.SetParameter("bands", stat1_bands);
-		TEAGN_TRUE_OR_RETURN(stat1.Reset(stat1_pars), "Unable to inialize the statistc module");
-		stat1.ToggleProgInt(false);
-		double	std1 = stat1.getStdDev(0),
-			mean1 = stat1.getMean(0);
-	
-		TePDIStatistic stat2;
-		TePDIParameters stat2_pars;
-		TePDITypes::TePDIRasterVectorType stat2_rasters;
-		std::vector<int> stat2_bands;
-
-		stat2_rasters.push_back(input_raster);
-		stat2_pars.SetParameter("rasters", stat2_rasters);
-		stat2_bands.push_back(band);
-		stat2_pars.SetParameter("bands", stat2_bands);
-		TEAGN_TRUE_OR_RETURN(stat2.Reset(stat2_pars), "Unable to inialize the statistc module");
-		stat2.ToggleProgInt(false);
-		double	std2 = stat2.getStdDev(0),
-			mean2 = stat2.getMean(0);
-
-		fit_gain = std1 / std2;
-		fit_offset = mean1 - (fit_gain * mean2);
-	}
-
-	double p_fit;
-	for (j = 0; j < lines; j++)
-	{
-		for (i = 0; i < columns; i++)
-		{
-			input_raster->getElement(i, j, p_ant, band);
-			p_fit = fit_gain * p_ant + fit_offset;
-			inputImageMatrix(j, i) = p_fit;
-			input_raster->setElement(i, j, p_fit, band);
-		}
-	}
-
-	for(l = 1; l <= levels; l++)
-	{
-		multi = (int)pow(2., l-1);
-		TePDIPIManager progress("Decomposing Wavelets", (int)(input_raster->params().nlines_), progress_enabled_);
-		for (j = 0; j < lines; j++)
-		{
-			for (i = 0; i < columns; i++)
- 			{
-				p_ori = p_ant = p_new = 0.0;
-				for (k = 0; k < filter_dim; k++)
-				{
-					for (m = 0; m < filter_dim; m++)
-					{
-						x = i+(k-offset)*multi;
-						y = j+(m-offset)*multi;
-						if (x < 0)
-							x = columns + x;
-						else if (x >= columns)
-							x = x - columns;
-						if (y < 0)
-							y = lines + y;
-						else if (y >= lines)
-							y = y - lines;
-						p_new += filter(k, m) * inputImageMatrix(y, x);
-					}
-				}
-				output_wavelets[l]->setElement(i, j, p_new, 0);
-				output_wavelets[l-1]->getElement(i, j, p_ori, band);
-				output_wavelets[l]->setElement(i, j, p_ori-p_new, 1);
-			}
-			progress.Increment();
-		}
-	}
-
-	inputImageMatrix.Clear();
-
-	return true;
-}
-
-bool TePDIWaveletAtrous::RunImplementation_recompose()
-{
-	std::vector<TePDITypes::TePDIRasterVectorType> input_rasters_wavelets;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_rasters_wavelets", input_rasters_wavelets), "Missing parameter: input_rasters_wavelets");
-
-	int rasters_levels;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("rasters_levels", rasters_levels), "Missing parameter: rasters_levels");
-
-	std::vector<TePDITypes::TePDIRasterVectorType> reference_raster_wavelets;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster_wavelets", reference_raster_wavelets), "Missing parameter: reference_raster_wavelets");
-
-	int reference_levels;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
-
-	double channel_min_level;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("channel_min_level", channel_min_level), "Missing parameter: channel_min_level");
-
-	double channel_max_level;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("channel_max_level", channel_max_level), "Missing parameter: channel_max_level");
-
-	TePDITypes::TePDIRasterVectorType output_rasters;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
-
-	unsigned int b;
-	int	i,
-		j,
-		l;
-	double	pixel,
-			p_pan;
-
-	TePDIPIManager progress("Recomposing wavelets", input_rasters_wavelets.size()*input_rasters_wavelets[0][0]->params().nlines_, progress_enabled_);
-	for(b = 0; b < input_rasters_wavelets.size(); b++)
-	{
-		int	lines = input_rasters_wavelets[b][0]->params().nlines_,
-			columns = input_rasters_wavelets[b][0]->params().ncols_;
-		for (j = 0; j < lines; j++)
-		{
-			for (i = 0; i < columns; i++)
-			{
-				input_rasters_wavelets[b][rasters_levels]->getElement(i, j, pixel, 0);
-				for(l = 1; l <= reference_levels; l++)
-				{
-					reference_raster_wavelets[b][l]->getElement(i, j, p_pan, 1);
-					pixel += p_pan;
-				}
-				pixel = (pixel > channel_max_level?channel_max_level:(pixel < channel_min_level?channel_min_level:pixel));
-				output_rasters[b]->setElement(i, j, pixel, 0);
-			}
-			
-			progress.Increment();
-		}
-	}
-
-	return true;
-}
-
-bool TePDIWaveletAtrous::RunImplementation()
-{
-/* Getting parameters */
-
-	int direction;
-	TEAGN_TRUE_OR_RETURN(params_.GetParameter("direction", direction), "Missing parameter: direction");
-
-	if (direction == DECOMPOSE)
-		return RunImplementation_decompose();
-	else if (direction == RECOMPOSE)
-		return RunImplementation_recompose();
-
-	return false;
-}
+#include "TePDIWaveletAtrous.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+#include "TePDITypes.hpp"
+#include "TePDIStatistic.hpp"
+#include "TePDIPrincipalComponents.hpp"
+#include "TeRasterRemap.h"
+#include <TeMatrix.h>
+#include <TeUtils.h>
+#include <math.h>
+#include <queue>
+
+TePDIWaveletAtrous::TePDIWaveletAtrous()
+{
+}
+
+TePDIWaveletAtrous::~TePDIWaveletAtrous()
+{
+}
+
+void TePDIWaveletAtrous::ResetState(const TePDIParameters&)
+{
+}
+
+bool TePDIWaveletAtrous::CheckParameters(const TePDIParameters& parameters) const
+{
+	int direction;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("direction", direction), "Missing parameter: direction");
+
+	if (direction == DECOMPOSE)
+	{
+		TePDITypes::TePDIRasterPtrType input_raster;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_raster", input_raster), "Missing parameter: input_raster");
+		TEAGN_TRUE_OR_RETURN(input_raster.isActive(), "Invalid parameter: input_raster inactive");
+		TEAGN_TRUE_OR_RETURN(input_raster->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster not ready");
+	
+		int band;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("band", band), "Missing parameter: band");
+		TEAGN_TRUE_OR_RETURN(band < input_raster->nBands(), "Invalid parameter: band number");
+	
+		int levels;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("levels", levels), "Missing parameter: levels");
+	
+		TePDITypes::TePDIRasterVectorType output_wavelets;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_wavelets", output_wavelets), "Missing parameter: output_wavelets");
+
+		TEAGN_TRUE_OR_RETURN((int)output_wavelets.size() == (levels + 1), "Invalid output rasters number");
+	
+		for(unsigned int b = 0; b < output_wavelets.size(); b++)
+		{
+			TEAGN_TRUE_OR_RETURN(output_wavelets[b].isActive(), "Invalid parameter: output_wavelets " + Te2String(b) + " inactive");
+			TEAGN_TRUE_OR_RETURN(output_wavelets[b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_wavelets " + Te2String(b) + " not ready");
+		}
+	}
+	else if (direction == RECOMPOSE)
+	{
+		std::vector<TePDITypes::TePDIRasterVectorType> input_rasters_wavelets;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters_wavelets", input_rasters_wavelets), "Missing parameter: input_rasters_wavelets");
+		for(unsigned int w = 0; w < input_rasters_wavelets.size(); w++)
+			for(unsigned int b = 0; b < input_rasters_wavelets[w].size(); b++)
+			{
+				TEAGN_TRUE_OR_RETURN(input_rasters_wavelets[w][b].isActive(), "Invalid parameter: input_rasters_wavelets inactive");
+				TEAGN_TRUE_OR_RETURN(input_rasters_wavelets[w][b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_rasters_wavelets not ready");
+			}
+	
+		int rasters_levels;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("rasters_levels", rasters_levels), "Missing parameter: rasters_levels");
+		for(unsigned int w = 0; w < input_rasters_wavelets.size(); w++)
+			TEAGN_TRUE_OR_RETURN((rasters_levels + 1) == (int)input_rasters_wavelets[w].size(), "Invalid parameter: rasters_levels not ready");
+	
+		TePDITypes::TePDIRasterVectorType reference_raster_wavelets;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster_wavelets", reference_raster_wavelets), "Missing parameter: reference_raster_wavelets");
+		for(unsigned int b = 0; b < reference_raster_wavelets.size(); b++)
+		{
+			TEAGN_TRUE_OR_RETURN(reference_raster_wavelets[b].isActive(), "Invalid parameter: reference_raster_wavelets inactive");
+			TEAGN_TRUE_OR_RETURN(reference_raster_wavelets[b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: reference_raster_wavelets not ready");
+		}
+	
+		int reference_levels;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
+		TEAGN_TRUE_OR_RETURN((reference_levels + 1) == (int)reference_raster_wavelets.size(), "Invalid parameter: reference_levels not ready");
+	
+		TePDITypes::TePDIRasterVectorType output_rasters;
+		TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+	
+		for(unsigned int b = 0; b < output_rasters.size(); b++)
+		{
+			TEAGN_TRUE_OR_RETURN(output_rasters[b].isActive(), "Invalid parameter: output_rasters " + Te2String(b) + " inactive");
+			TEAGN_TRUE_OR_RETURN(output_rasters[b]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_rasters " + Te2String(b) + " not ready");
+		}
+	}
+	else
+		return false;
+
+	return true;
+}
+
+bool TePDIWaveletAtrous::filterBank(string filterFile,TeMatrix &filter)
+{
+	FILE *ff;
+	int l,
+		c;
+	double	t,
+			w;
+	
+
+	if ((ff = fopen(filterFile.c_str(), "r")) != NULL)
+	{
+		fscanf(ff, "%d %d %lf", &l, &c, &t);
+		filter.Init(l, c, 0.0);
+
+		std::queue<double> maskWeights;
+		while(fscanf(ff, "%lf", &w) == 1)
+			maskWeights.push(w/t);
+
+		for (int i = 0; i < l; i++)
+			for (int j = 0; j < c; j++)
+			{
+				filter(i, j) = maskWeights.front();
+				maskWeights.pop();
+			}
+
+		fclose(ff);
+	}
+	else
+		return false;
+
+	return true;
+}
+
+bool TePDIWaveletAtrous::filterBank(FilterType filtertype,TeMatrix &filter)
+{
+  switch( filtertype )
+  {
+    case B3SplineFilter :
+    {
+      TEAGN_TRUE_OR_RETURN( filter.Init( 5, 5, 0.0 ), "Filter init error" );
+      const double weight = 256;
+      
+      filter(0,0) = 1/weight; filter(0,1) = 4/weight; filter(0,2) = 6/weight; filter(0,3) = 4/weight; filter(0,4) = 1/weight;
+      filter(1,0) = 4/weight; filter(1,1) = 16/weight; filter(1,2) = 24/weight; filter(1,3) = 16/weight; filter(1,4) = 4/weight;
+      filter(2,0) = 6/weight; filter(2,1) = 24/weight; filter(2,2) = 36/weight; filter(2,3) = 24/weight; filter(2,4) = 6/weight;
+      filter(3,0) = 4/weight; filter(3,1) = 16/weight; filter(3,2) = 24/weight; filter(3,3) = 16/weight; filter(3,4) = 4/weight;
+      filter(4,0) = 1/weight; filter(4,1) = 4/weight; filter(4,2) = 6/weight; filter(4,3) = 4/weight; filter(4,4) = 1/weight;
+      
+      break;
+    }
+    case TriangleFilter :
+    {
+      TEAGN_TRUE_OR_RETURN( filter.Init( 3, 3, 0.0 ), "Filter init error" );
+      const double weight = 16;
+      
+      filter(0,0) = 1/weight; filter(0,1) = 2/weight; filter(0,2) = 1/weight;
+      filter(1,0) = 2/weight; filter(1,1) = 4/weight; filter(1,2) = 2/weight;
+      filter(2,0) = 1/weight; filter(2,1) = 2/weight; filter(2,2) = 1/weight;
+      
+      break;
+    }  
+    default :
+    {
+      TEAGN_LOG_AND_RETURN( "Invalid filter type" )
+      break;
+    }
+  }
+  
+  return true;
+}
+
+bool TePDIWaveletAtrous::RunImplementation_decompose()
+{
+/* Getting parameters */
+	TePDITypes::TePDIRasterPtrType input_raster;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_raster", input_raster), "Missing parameter: input_raster");
+
+	int band;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("band", band), "Missing parameter: band");
+
+	int levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("levels", levels), "Missing parameter: levels");
+
+	TePDITypes::TePDIRasterVectorType output_wavelets;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_wavelets", output_wavelets), "Missing parameter: output_wavelets");
+  
+  // Retriving filter matrix
+
+	TeMatrix filter;
+  if( params_.CheckParameter< FilterType > ( "filter_type" ) )
+  {
+    FilterType filterType;
+    TEAGN_TRUE_OR_RETURN( params_.GetParameter( "filter_type",
+      filterType ), "Missin parameter filter_type" );
+      
+    TEAGN_TRUE_OR_THROW( filterBank( filterType, filter ), 
+      "Filter matrix generation failed");
+  }
+  else if( params_.CheckParameter< std::string > ( "filter_file" ) )
+  {
+    std::string filter_file;
+    TEAGN_TRUE_OR_RETURN( params_.GetParameter( "filter_file",
+      filter_file ), "Missin parameter filter_file" );
+  
+	  TEAGN_TRUE_OR_THROW( filterBank( filter_file, filter), 
+      "Filter matrix generation failed");
+  }
+  else
+  {
+    TEAGN_TRUE_OR_THROW( filterBank( TriangleFilter, filter ), 
+      "Filter matrix generation failed");
+  }
+
+/* Allocating output rasters */	
+	/*TeRasterParams base_raster_params = input_raster->params();
+	for(int l = 1; l <= levels; l++)
+	{
+		TeRasterParams input_raster_params = base_raster_params;
+		input_raster_params.nBands(waveletPlanes);
+		if (input_raster_params.projection() != 0)
+		{
+			TeSharedPtr<TeProjection> proj(TeProjectionFactory::make(base_raster_params.projection()->params()));
+			input_raster_params.projection(proj.nakedPointer());
+		}
+		input_raster_params.boxResolution(base_raster_params.box().x1(), base_raster_params.box().y1(), base_raster_params.box().x2(), base_raster_params.box().y2(), base_raster_params.resx_, base_raster_params.resy_);
+		input_raster_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
+		input_raster_params.setDataType(TeFLOAT, -1);
+		input_raster_params.setDummy(0.0, -1);
+		for(int n = 0; n < waveletPlanes; n++)
+			input_raster_params.nbitsperPixel_[n] = base_raster_params.nbitsperPixel_[band];
+		TEAGN_TRUE_OR_RETURN(output_wavelets[l]->init(input_raster_params), "Output wavelets reset error " + Te2String(l));
+	}*/
+
+/* Setting variables */
+	int	l,
+		multi,
+		x,
+		y,
+		i,
+		j,
+		filter_dim = filter.Nrow(),
+		offset = (int)(filter_dim / 2),
+		k,
+		m,
+		lines = input_raster->params().nlines_,
+		columns = input_raster->params().ncols_;
+	double	p_ori,
+			p_ant,
+			p_new;
+
+/* Computing wavelet decomposition */
+	for(l = 1; l <= levels; l++)
+	{
+		multi = (int)pow(2.0, l-1);
+		TePDIPIManager progress("Decomposing Wavelet Level " + Te2String(l), input_raster->params().nlines_, progress_enabled_);
+		for (j = 0; j < lines; j++)
+		{
+			for (i = 0; i < columns; i++)
+ 			{
+				p_ori = p_ant = p_new = 0.0;
+				for (k = 0; k < filter_dim; k++)
+				{
+					for (m = 0; m < filter_dim; m++)
+					{
+						x = i+(k-offset)*multi;
+						y = j+(m-offset)*multi;
+						if (x < 0)
+							x = columns + x;
+						else if (x >= columns)
+							x = x - columns;
+						if (y < 0)
+							y = lines + y;
+						else if (y >= lines)
+							y = y - lines;
+						output_wavelets[l-1]->getElement(x, y, p_ori, 0);
+						p_new += p_ori * filter(k, m);
+					}
+				}
+				output_wavelets[l]->setElement(i, j, p_new, 0);
+				output_wavelets[l-1]->getElement(i, j, p_ori, 0);
+				output_wavelets[l]->setElement(i, j, p_ori-p_new, 1);
+			}
+			progress.Increment();
+		}
+	}
+
+	return true;
+}
+
+bool TePDIWaveletAtrous::RunImplementation_recompose()
+{
+/* Getting parameters */
+	std::vector<TePDITypes::TePDIRasterVectorType> input_rasters_wavelets;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_rasters_wavelets", input_rasters_wavelets), "Missing parameter: input_rasters_wavelets");
+
+	int rasters_levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("rasters_levels", rasters_levels), "Missing parameter: rasters_levels");
+
+	TePDITypes::TePDIRasterVectorType reference_raster_wavelets;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster_wavelets", reference_raster_wavelets), "Missing parameter: reference_raster_wavelets");
+
+	int reference_levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+
+/* Setting variables */
+	unsigned int b;
+	int	i,
+		j,
+		l;
+	double	pixel,
+			p_pan;
+	std::vector<double> channelMinLevel,
+						channelMaxLevel;
+
+	for(b = 0; b < input_rasters_wavelets.size(); b++)
+	{
+		channelMinLevel.push_back(0.0);
+		//channelMaxLevel.push_back(pow(2.0, (double)input_rasters_wavelets[b][0]->params().nbitsperPixel_[0])-1.0);
+		channelMaxLevel.push_back(255.0);
+	}
+
+/* Allocating output rasters */
+	for(b = 0; b < input_rasters_wavelets.size(); b++)
+	{
+		TeRasterParams base_raster_params = input_rasters_wavelets[b][0]->params();
+		TeRasterParams output_rasters_params = base_raster_params;
+		output_rasters_params.nBands(1);
+    output_rasters_params.projection( base_raster_params.projection() );
+    output_rasters_params.boxResolution(base_raster_params.box().x1(), base_raster_params.box().y1(), base_raster_params.box().x2(), base_raster_params.box().y2(), base_raster_params.resx_, base_raster_params.resy_);
+		output_rasters_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
+		output_rasters_params.setDummy(0.0, -1);
+    output_rasters_params.setDataType(TeFLOAT, -1);  
+		TEAGN_TRUE_OR_RETURN(output_rasters[b]->init(output_rasters_params), "Output rasters reset error " + Te2String(b));
+	}
+
+/* Computing wavelet recomposition */
+	for(b = 0; b < input_rasters_wavelets.size(); b++)
+	{
+		int	lines = input_rasters_wavelets[b][0]->params().nlines_,
+			columns = input_rasters_wavelets[b][0]->params().ncols_;
+      
+    double maxOutValue = 0;
+    double minOutValue = 0;
+    TEAGN_TRUE_OR_RETURN( TePDIUtils::TeGetRasterMinMaxBounds(
+      output_rasters[b], 0, minOutValue, maxOutValue ),
+      "Unable to determine the min/max output values" )
+      
+		TePDIPIManager progress("Recomposing Wavelet Band " + Te2String(b+1), input_rasters_wavelets[0][0]->params().nlines_, progress_enabled_);
+		for (j = 0; j < lines; j++)
+		{
+			for (i = 0; i < columns; i++)
+			{
+				input_rasters_wavelets[b][rasters_levels]->getElement(i, j, pixel, 0);
+				for(l = 1; l <= reference_levels; l++)
+				{
+					reference_raster_wavelets[l]->getElement(i, j, p_pan, 1);
+					pixel += p_pan;
+				}
+				//pixel = (pixel > channelMaxLevel[b]?channelMaxLevel[b]:(pixel < channelMinLevel[b]?channelMinLevel[b]:pixel));
+        
+        pixel = MIN( pixel, maxOutValue );
+        pixel = MAX( pixel, minOutValue );
+        
+				output_rasters[b]->setElement(i, j, pixel, 0);
+			}
+			progress.Increment();
+		}
+	}
+
+	return true;
+}
+
+bool TePDIWaveletAtrous::RunImplementation()
+{
+/* Getting parameters */
+
+	int direction;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("direction", direction), "Missing parameter: direction");
+
+	if (direction == DECOMPOSE)
+		return RunImplementation_decompose();
+	else if (direction == RECOMPOSE)
+		return RunImplementation_recompose();
+
+	return false;
+}
diff --git a/src/terralib/image_processing/TePDIWaveletAtrous.hpp b/src/terralib/image_processing/TePDIWaveletAtrous.hpp
index 2828aed..acfed2c 100644
--- a/src/terralib/image_processing/TePDIWaveletAtrous.hpp
+++ b/src/terralib/image_processing/TePDIWaveletAtrous.hpp
@@ -1,113 +1,138 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPDIWAVELETATROUS_HPP
-  #define TEPDIWAVELETATROUS_HPP
-
-	#include "TePDIAlgorithm.hpp"
-
-	#define waveletPlanes 2
-
-  /**
-   * @brief WaveletAtrous.
-   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
-   * @ingroup PDIWaveletsAlgorithms
-   *
-   * @note The required parameters are:
-   *
-   * @param input_raster (TePDITypes::TePDIRasterPtrType) - Input raster.
-   * @param band (int) - Raster band.
-   * @param levels (int) - Levels to decompose the raster.
-   * @param filterType (TeFilterBanks) - Filter type.
-   * @param multi_raster (TePDITypes::TePDIRasterPtrType) - ?
-   * @param fit_histogram (bool) - ?
-   * @param output_wavelets (TePDITypes::TePDIRasterVectorType) - ?
-   * @param direction (TeWaveletAtrousDirection) - Direction.
-   *
-   */
-  class TePDIWaveletAtrous : public TePDIAlgorithm {
-    public :
-      /** @enum TeWaveletAtrousDirection Decompose or Compose */
-      enum TeWaveletAtrousDirection {DECOMPOSE, RECOMPOSE};
-      /** @enum TeFilterBanks Filter Banks available */
-      enum TeFilterBanks {B3SPLINE, SMALLB3SPLINE};
-
-      /**
-       * @brief Default Constructor.
-       *
-       */
-      TePDIWaveletAtrous();
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TePDIWaveletAtrous();
-
-      /**
-       * @brief Checks if the supplied parameters fits the requirements of each
-       * PDI algorithm implementation.
-       *
-       * @note Error log messages must be generated. No exceptions generated.
-       *
-       * @param parameters The parameters to be checked.
-       * @return true if the parameters are OK. false if not.
-       */
-      bool CheckParameters( const TePDIParameters& parameters ) const;
-      
-    protected :
-      
-      /**
-       * @brief Decide the direction of the analysis based on the direction parameter.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation();
-
-      /**
-       * @brief Decomposition.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation_decompose();
-
-      /**
-       * @brief Recomposition.
-       *
-       * @return true if OK. false on error.
-       */
-      bool RunImplementation_recompose();
-
-      /**
-       * @brief Reset the internal state to the initial state.
-       *
-       * @param params The new parameters referente at initial state.
-       */
-      void ResetState( const TePDIParameters& params );
-  };
-  
-/** @example TePDIWavelets_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif //TEPDIWaveletAtrous_HPP
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIWAVELETATROUS_HPP
+  #define TEPDIWAVELETATROUS_HPP
+
+	#include "TePDILevelRemap.hpp"
+	#include "TePDIAlgorithm.hpp"
+	#include "TePDIParameters.hpp"
+	#include <TeSharedPtr.h>
+
+	#define waveletPlanes 2
+
+  /**
+   * @class TePDIWaveletAtrous
+   * @brief This is the class for principal components generation.
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @ingroup PDIWaveletsAlgorithms
+   *
+   * @note The general required parameters are:
+   * @param direction (TeWaveletAtrousDirection) - Decompose or Recompose.
+   *
+   * @note The required parameters for the DECOMPOSE are:
+   * @param input_raster (TePDITypes::TePDIRasterPtrType) - Raster to do 
+   * wavelet analysis.
+   * @param band (int) - Raster band.
+   * @param levels (int) - Levels to decompose the raster.
+   * @param output_wavelets (TePDITypes::TePDIRasterVectorType) - Raster 
+   * vector to store de residual and coefficients planes - All output rasters
+   * must be pre-initiated with the same number of lines and columns
+   * of the input_raster and with the number of bands related to the
+   * desired wavelet planes.
+   *
+   * @note The DECOMPOSE optional parameters are: 
+   * @param filter_file (std::string) - Input filter file name (default:
+   * Use internal filter bank TriangleFilter).
+   * @param filter_type (TePDIWaveletAtrous::FilterType) - 
+   * Filter type (default:TriangleFilter).
+   *
+   * @note The required parameters for the RECOMPOSE are:
+   * @param input_rasters_wavelets (std::vector<TePDITypes::TePDIRasterVectorType>) - Residual and coefficient planes for each band.
+   * @param rasters_levels (int) - Number of decomposition in the input_rasters_wavelets.
+   * @param reference_raster_wavelets (TePDITypes::TePDIRasterVectorType) - Residual and coefficient planes for the reference band.
+   * @param reference_levels (int) - Number of decomposition in the reference_raster_wavelets.
+   * @param output_rasters (TePDITypes::TePDIRasterVectorType) - Output raster after recomposing the wavelet analysis.
+   *
+   * @example TePDIWavelets_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIWaveletAtrous : public TePDIAlgorithm {
+    public :
+      /** @enum TeWaveletAtrousDirection Decompose or Compose */
+      enum TeWaveletAtrousDirection {DECOMPOSE, RECOMPOSE};
+      
+      /** @enum TeFilterBanks Filter typs available */
+      enum FilterType 
+      {
+        B3SplineFilter, 
+        TriangleFilter
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIWaveletAtrous();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIWaveletAtrous();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+      
+    protected :
+      
+      /**
+       * @brief Decide the direction of the analysis based on the direction parameter.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Decomposition.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation_decompose();
+
+      /**
+       * @brief Recomposition.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation_recompose();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState(const TePDIParameters&);
+      
+      bool filterBank(string filterFile,TeMatrix &filter);
+      bool filterBank(FilterType filtertype,TeMatrix &filter);
+  };
+
+#endif //TEPDIWaveletAtrous_HPP
diff --git a/src/terralib/image_processing/TePDIWaveletAtrousFusion.cpp b/src/terralib/image_processing/TePDIWaveletAtrousFusion.cpp
new file mode 100644
index 0000000..cfeb0be
--- /dev/null
+++ b/src/terralib/image_processing/TePDIWaveletAtrousFusion.cpp
@@ -0,0 +1,414 @@
+#include "TePDIWaveletAtrousFusion.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+#include "TePDITypes.hpp"
+#include "TePDIStatistic.hpp"
+#include "TePDIWaveletAtrous.hpp"
+#include "TeRasterRemap.h"
+#include <TeMatrix.h>
+#include <TeUtils.h>
+#include <math.h>
+#include <queue>
+
+TePDIWaveletAtrousFusion::TePDIWaveletAtrousFusion()
+{
+}
+
+TePDIWaveletAtrousFusion::~TePDIWaveletAtrousFusion()
+{
+}
+
+void TePDIWaveletAtrousFusion::ResetState(const TePDIParameters&)
+{
+}
+
+bool TePDIWaveletAtrousFusion::CheckParameters(const TePDIParameters& parameters) const
+{
+/* Input rasters and bands checking */
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+	TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
+	
+	std::vector<int> bands;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+	TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), "Invalid parameter: bands number");
+
+	for(unsigned int input_rasters_index = 0; input_rasters_index < input_rasters.size(); input_rasters_index++)
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
+		TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[" + Te2String(input_rasters_index) + "]");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String( input_rasters_index ) + " with imcompatible number of columns" );
+		TEAGN_TRUE_OR_RETURN(((input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeRGB) || (input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeMultiBand)), "Invalid parameter - input_rasters (invalid photometric interpretation)");
+	}
+
+/* Reference raster checking */
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+	TEAGN_TRUE_OR_RETURN(((reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeRGB ) || (reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeMultiBand)), "Invalid parameter - reference_raster (invalid photometric interpretation)");
+
+	TEAGN_TRUE_OR_RETURN(reference_raster_band < reference_raster->nBands(), "Invalid parameter - reference_raster_band");
+
+/* Output rasters checking */
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() == input_rasters.size(), "Invalid parameter: output rasters size");
+
+	for(unsigned int output_rasters_index = 0; output_rasters_index < output_rasters.size(); output_rasters_index++)
+	{
+		TEAGN_TRUE_OR_RETURN(output_rasters[output_rasters_index].isActive(), "Invalid parameter: output_rasters " + Te2String(output_rasters_index) + " inactive");
+		TEAGN_TRUE_OR_RETURN(output_rasters[output_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_rasters " + Te2String(output_rasters_index) + " not ready");
+	}
+
+	int rasters_levels;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("rasters_levels", rasters_levels), "Missing parameter: rasters_levels");
+
+	int reference_levels;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
+
+	TePDIWaveletAtrousFusion::InterpMethod resampling_type;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
+
+	bool fit_histogram;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
+
+	return true;
+}
+
+bool TePDIWaveletAtrousFusion::RunImplementation()
+{
+/* Getting parameters */
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+
+	std::vector<int> bands;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("bands", bands), "Missing parameter: bands");
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+
+	int rasters_levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("rasters_levels", rasters_levels), "Missing parameter: rasters_levels");
+
+	int reference_levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
+
+	TePDIWaveletAtrousFusion::InterpMethod resampling_type;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
+
+	bool fit_histogram;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
+  
+  std::string filter_file;
+  TePDIWaveletAtrous::FilterType filter_type = 
+    TePDIWaveletAtrous::TriangleFilter;
+  if( params_.CheckParameter< TePDIWaveletAtrous::FilterType > ( 
+    "filter_type" ) )
+  {
+    TEAGN_TRUE_OR_RETURN( params_.GetParameter( "filter_type",
+      filter_type ), "Missin parameter filter_type" );
+  }
+  else if( params_.CheckParameter< std::string > ( "filter_file" ) )
+  {
+    TEAGN_TRUE_OR_RETURN( params_.GetParameter( "filter_file",
+      filter_file ), "Missin parameter filter_file" );
+  }
+
+/* Setting variables */
+	unsigned int b;
+	int i,
+		j,
+		l;
+	double	pixel;
+	std::vector<double> channelMinLevel,
+						channelMaxLevel;
+
+	for(b = 0; b < input_rasters.size(); b++)
+	{
+		channelMinLevel.push_back(0.0);
+		channelMaxLevel.push_back(255.0);
+	}
+
+/* Resampling the input raster */
+	TeRasterParams reference_params = reference_raster->params();
+	TePDITypes::TePDIRasterVectorType resampled_input_rasters;
+	for(b = 0; b < input_rasters.size(); b++)
+	{
+		if (resampling_type != TePDIWaveletAtrousFusion::Nothing)
+		{
+		  TePDIInterpolator::InterpMethod intMethod;
+		  switch( resampling_type )
+		  {
+		    case TePDIWaveletAtrousFusion::NNMethod :
+		    {
+		      intMethod =  TePDIInterpolator::NNMethod;
+		      break;
+		    }
+		    case TePDIWaveletAtrousFusion::BilinearMethod :
+		    {
+		      intMethod =  TePDIInterpolator::BilinearMethod;
+		      break;
+		    }		  
+		    case TePDIWaveletAtrousFusion::BicubicMethod :
+		    {
+		      intMethod =  TePDIInterpolator::BicubicMethod;
+		      break;
+		    }				      
+		    default :
+		    {
+		      TEAGN_LOG_AND_THROW( "Invalid resampling type" );
+		    }
+		  }		
+		  		
+			TePDITypes::TePDIRasterPtrType resampled_input_rasters_temp;
+			TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(resampled_input_rasters_temp,  reference_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create the resampled input rasters");
+			resampleRasterByResLinsCols(input_rasters[b], resampled_input_rasters_temp, reference_params.resx_ / input_rasters[b]->params().resx_, reference_params.resy_ / input_rasters[b]->params().resy_, reference_params.nlines_,  reference_params.ncols_, intMethod, progress_enabled_);
+			resampled_input_rasters.push_back(resampled_input_rasters_temp);
+		}
+		else
+			resampled_input_rasters.push_back(input_rasters[b]);
+	}
+
+/* Creating wavelet planes */
+	std::vector<TePDITypes::TePDIRasterVectorType> input_rasters_wavelets;
+	for(b = 0; b < resampled_input_rasters.size(); b++)
+	{
+		TePDITypes::TePDIRasterVectorType input_rasters_wavelets_vector_temp;
+		input_rasters_wavelets_vector_temp.push_back(resampled_input_rasters[b]);
+		for(l = 1; l <= rasters_levels; l++)
+		{
+			TePDITypes::TePDIRasterPtrType input_rasters_wavelets_temp;
+			TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(input_rasters_wavelets_temp, waveletPlanes, reference_params.nlines_, reference_params.ncols_, false, TeFLOAT, 0), "Unable to alloc input rasters wavelet planes");
+			input_rasters_wavelets_vector_temp.push_back(input_rasters_wavelets_temp);
+		}
+		input_rasters_wavelets.push_back(input_rasters_wavelets_vector_temp);
+	}
+
+/* Extracting input rasters wavelets planes */
+	for(b = 0; b < resampled_input_rasters.size(); b++)
+	{
+		TePDIParameters waveletAtrousParamsDecompose;
+		waveletAtrousParamsDecompose.SetParameter("direction", (int)TePDIWaveletAtrous::DECOMPOSE);
+		waveletAtrousParamsDecompose.SetParameter("input_raster", resampled_input_rasters[b]);
+		waveletAtrousParamsDecompose.SetParameter("band", bands[b]);
+		waveletAtrousParamsDecompose.SetParameter("levels", rasters_levels);
+    
+    if( filter_file.size() )
+		  waveletAtrousParamsDecompose.SetParameter("filter_file", filter_file);
+    else
+      waveletAtrousParamsDecompose.SetParameter("filter_type", filter_type);  
+        
+		waveletAtrousParamsDecompose.SetParameter("output_wavelets", input_rasters_wavelets[b]);
+		TePDIWaveletAtrous waDecompose;
+		TEAGN_TRUE_OR_THROW(waDecompose.Reset(waveletAtrousParamsDecompose), "Invalid Parameters");
+		waDecompose.ToggleProgInt(progress_enabled_);
+		TEAGN_TRUE_OR_THROW(waDecompose.Apply(), "Apply error");
+	}
+
+/* Creating reference raster wavelet planes */
+	TePDITypes::TePDIRasterVectorType reference_raster_wavelets;
+	for(l = 0; l <= reference_levels; l++)
+	{
+		TePDITypes::TePDIRasterPtrType reference_raster_wavelets_temp;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(reference_raster_wavelets_temp, waveletPlanes, reference_params.nlines_, reference_params.ncols_, false, TeFLOAT, 0), "Reference raster wavelets Alloc error");
+		if (l == 0)
+		{
+			for (j = 0; j < reference_params.nlines_; j++)
+			{
+				for (i = 0; i < reference_params.ncols_; i++)
+				{
+					reference_raster->getElement(i, j, pixel, reference_raster_band);
+					reference_raster_wavelets_temp->setElement(i, j, pixel, 0);
+				}
+			}
+		}
+		reference_raster_wavelets.push_back(reference_raster_wavelets_temp);
+	}
+
+/* Extracting reference raster wavelet planes */
+	TePDIParameters waveletAtrousParamsDecompose;
+	waveletAtrousParamsDecompose.SetParameter("direction", (int)TePDIWaveletAtrous::DECOMPOSE);
+	waveletAtrousParamsDecompose.SetParameter("input_raster", reference_raster);
+	waveletAtrousParamsDecompose.SetParameter("band", reference_raster_band);
+	waveletAtrousParamsDecompose.SetParameter("levels", reference_levels);
+  
+  if( filter_file.size() )
+    waveletAtrousParamsDecompose.SetParameter("filter_file", filter_file);
+  else
+    waveletAtrousParamsDecompose.SetParameter("filter_type", filter_type);  
+        
+	waveletAtrousParamsDecompose.SetParameter("output_wavelets", reference_raster_wavelets);
+	TePDIWaveletAtrous warDecompose;
+	TEAGN_TRUE_OR_THROW(warDecompose.Reset(waveletAtrousParamsDecompose), "Invalid Parameters");
+	warDecompose.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(warDecompose.Apply(), "Apply error");
+
+	/*for(int l = 0; l <= reference_levels; l++)
+	{
+		TePDITypes::TePDIRasterPtrType reference_raster_wavelets_temp;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(reference_raster_wavelets_temp, 1, reference_params.nlines_, reference_params.ncols_, false, TeFLOAT, 0), "Reference raster wavelets Alloc error");
+		for (int w = 0; w < waveletPlanes; w++)
+		{
+			for (int j = 0; j < reference_params.nlines_; j++)
+			{
+				for (int i = 0; i < reference_params.ncols_; i++)
+				{
+					reference_raster_wavelets[l]->getElement(i, j, p, w);
+					reference_raster_wavelets_temp->setElement(i, j, p, 0);
+				}
+			}
+			TEAGN_TRUE_OR_THROW(TePDIUtils::TeRaster2Geotiff(reference_raster_wavelets_temp, "w" + Te2String(l) + Te2String(w) + ".tif"), "GeoTIFF" + Te2String(l) + " generation error");
+		}
+	}*/
+
+/* Recomposing wavelets */
+	TePDIParameters waveletAtrousParamsRecompose;
+	waveletAtrousParamsRecompose.SetParameter("direction", (int)TePDIWaveletAtrous::RECOMPOSE);
+	waveletAtrousParamsRecompose.SetParameter("input_rasters_wavelets", input_rasters_wavelets);
+	waveletAtrousParamsRecompose.SetParameter("rasters_levels", rasters_levels);
+	waveletAtrousParamsRecompose.SetParameter("reference_raster_wavelets", reference_raster_wavelets);
+	waveletAtrousParamsRecompose.SetParameter("reference_levels", reference_levels);
+	waveletAtrousParamsRecompose.SetParameter("output_rasters", output_rasters);
+	TePDIWaveletAtrous waRecompose;
+	TEAGN_TRUE_OR_THROW(waRecompose.Reset(waveletAtrousParamsRecompose), "Invalid Parameters");
+	waRecompose.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(waRecompose.Apply(), "Apply error");
+
+	for(b = 0; b < resampled_input_rasters.size(); b++)
+	{
+		for (int j = 0; j < reference_params.nlines_; j++)
+		{
+			for (int i = 0; i < reference_params.ncols_; i++)
+			{
+				output_rasters[b]->getElement(i, j, pixel, 0);
+				if (pixel > channelMaxLevel[b])
+				{
+					output_rasters[b]->setElement(i, j, channelMaxLevel[b], 0);
+				}
+				else if (pixel < channelMinLevel[b])
+				{
+					output_rasters[b]->setElement(i, j, channelMinLevel[b], 0);
+				}
+			}
+		}
+	}
+	
+
+	return true;
+}
+
+bool TePDIWaveletAtrousFusion::resampleRasterByResLinsCols( 
+  const TePDITypes::TePDIRasterPtrType& input_raster,
+  const TePDITypes::TePDIRasterPtrType& output_raster,
+  double x_resolution_ratio, double y_resolution_ratio, int l, int c,
+  TePDIInterpolator::InterpMethod interpol, bool enable_progress ) 
+{
+    
+  TEAGN_TRUE_OR_RETURN( input_raster.isActive(), "Inactive input raster" );
+  TEAGN_TRUE_OR_RETURN( 
+    input_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Input raster not ready" )
+  
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(), 
+    "Inactive output raster" );
+  TEAGN_TRUE_OR_RETURN( 
+    output_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Output raster not ready" )
+    
+  TEAGN_TRUE_OR_RETURN( ( x_resolution_ratio > 0.0 ), "Invalid X ratio" )
+  TEAGN_TRUE_OR_RETURN( ( y_resolution_ratio > 0.0 ), "Invalid X ratio" )
+  
+  /* Reseting the output raster to the new geometry */
+  
+  TeRasterParams& input_raster_params = input_raster->params();
+  
+  TeRasterParams new_output_raster_params = output_raster->params();
+  
+  new_output_raster_params.nBands( input_raster_params.nBands() );
+  new_output_raster_params.setPhotometric( 
+    input_raster_params.photometric_[ 0 ], -1 );
+  if( input_raster_params.projection() != 0 ) {
+    new_output_raster_params.projection( input_raster_params.projection() );
+  }
+  new_output_raster_params.boxResolution( 
+    input_raster_params.box().x1(), 
+    input_raster_params.box().y1(), input_raster_params.box().x2(), 
+    input_raster_params.box().y2(), 
+    ( input_raster_params.resx_ * x_resolution_ratio ), 
+    ( input_raster_params.resy_ * y_resolution_ratio ) );
+  new_output_raster_params.lowerLeftResolutionSize(input_raster_params.box().lowerLeft().x(), input_raster_params.box().lowerLeft().y(), ( input_raster_params.resx_ * x_resolution_ratio ), ( input_raster_params.resy_ * y_resolution_ratio ), c, l);
+
+    
+  TEAGN_TRUE_OR_RETURN( output_raster->init( new_output_raster_params ),
+    "Output raster reset error" )
+//cout << output_raster->params().resx_ << endl;
+    
+  /* interpolating pixel values */
+  
+  const TeRasterParams& output_raster_params = output_raster->params();
+  
+  const unsigned int out_lines = output_raster_params.nlines_;
+  const unsigned int out_cols = output_raster_params.ncols_;
+  const unsigned int out_bands = output_raster_params.nBands();
+  
+  double in_col = 0;
+  double in_line = 0;
+  unsigned int out_col = 0;
+  unsigned int out_line = 0;
+  unsigned int out_band = 0;
+  double value = 0;
+  
+  double dummy_value = 0;
+  if( input_raster_params.useDummy_ ) {
+    dummy_value = input_raster_params.dummy_[ 0 ];
+  }
+  
+  TeRaster& output_raster_ref = *( output_raster.nakedPointer() );
+  
+  TePDIInterpolator interpolator;
+  TEAGN_TRUE_OR_RETURN( interpolator.reset( input_raster, interpol,
+    dummy_value), "Interpolator reset error" )
+    
+  TePDIPIManager progress( "Resampling raster", ( out_bands * out_lines ),
+    enable_progress );
+  
+  for( out_band = 0 ; out_band < out_bands ; ++out_band ) {
+    for( out_line = 0 ; out_line < out_lines ; ++out_line ) {
+      in_line = ( (double)out_line) * y_resolution_ratio;
+if ((int)in_line >= (input_raster->params().nlines_-1))
+  in_line = (double)(input_raster->params().nlines_-1);
+    
+      for( out_col = 0 ; out_col < out_cols ; ++out_col ) {
+        in_col = ( (double)out_col) * x_resolution_ratio;
+  if ((int)in_col >= (input_raster->params().ncols_-1))
+  in_col = (double)(input_raster->params().ncols_-1);
+      
+        interpolator.interpolate( in_line, in_col, out_band, value );
+
+    if (value>255)
+      value=255;
+    else if (value<0)
+      value=0;
+    
+        TEAGN_TRUE_OR_RETURN( output_raster_ref.setElement( out_col, 
+          out_line, value, out_band ), "Output raster writing error" )
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by user" );
+    }
+  }
+  
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIWaveletAtrousFusion.hpp b/src/terralib/image_processing/TePDIWaveletAtrousFusion.hpp
new file mode 100644
index 0000000..eea9b71
--- /dev/null
+++ b/src/terralib/image_processing/TePDIWaveletAtrousFusion.hpp
@@ -0,0 +1,142 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIWAVELETATROUSFUSION_HPP
+  #define TEPDIWAVELETATROUSFUSION_HPP
+
+  #include "TePDILevelRemap.hpp"
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIParameters.hpp"
+  #include "TePDIWaveletAtrous.hpp"
+  #include "TePDIInterpolator.hpp"
+  
+  #include <TeSharedPtr.h>
+
+  /**
+   * @class TePDIWaveletAtrousFusion 
+   * @brief Wavelets Atrous Fusion.
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @ingroup PDIFusionAlgorithms
+   *
+   * @note The required parameters are:
+   *
+   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Low resolution rasters.
+   * @param bands (std::vector< int >) - The bands from each low resolution raster.
+   * @param output_rasters (TePDITypes::TePDIRasterVectorType) - High resolution fused rasters.
+   * @param reference_raster (TePDITypes::TePDIRasterPtrType) - High resolution raster.
+   * @param reference_raster_band (int) - Reference raster band number.
+   * @param rasters_levels (int) - Decomposition levels for each low resolution raster.
+   * @param reference_levels (int) - Decomposition levels for each reference raster.
+   * @param resampling_type (TePDIWaveletAtrousFusion::InterpMethod) - Resampling type.
+   * @param fit_histogram (bool) - Fit histogram before the substitution.
+   *
+   * @note The optional parameters are:
+   * @param filter_file (std::string) - Input filter file name (default:
+   * Use internal default TePDIWaveletAtrous filter bank).
+   * @param filter_type (TePDIWaveletAtrous::FilterType) - Filter type
+   * (default:Use internal default TePDIWaveletAtrous filter bank).   
+   *
+   * @example TePDIFusion_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIWaveletAtrousFusion : public TePDIAlgorithm {
+    public :
+      /**
+       * @enum Allowed interpolation methods.
+       */      
+      enum InterpMethod {
+        /** No interpolation method. */
+        Nothing = 0,
+        /** Near neighborhood interpolation method. */
+        NNMethod = 1,
+        /** Bilinear interpolation method. */
+        BilinearMethod = 2,
+        /** Bicubic interpolation method. */
+        BicubicMethod = 3      
+      };
+
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIWaveletAtrousFusion();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIWaveletAtrousFusion();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+      
+    protected :
+      
+      /**
+       * @brief Run the wavelet fusion method.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState(const TePDIParameters&);
+      
+      /**
+       * @brief Raster resampling to new resolution, forcing lines and columns.
+       * @param input_raster Input raster.
+       * @param output_raster Output raster.
+       * @param x_resolution_ratio X resolution ratio.
+       * @param y_resolution_ratio Y resolution ratio.
+       * @param l Output raster Lines.
+       * @param c Output raster Columns.
+       * @param interpol Interpolation method.
+       * @param enable_progress Enable/disable the progress interface.
+       * @return true if OK, false on errors.
+       * 
+       * @note ( resolution_ratio = output_resolution / input_resolution ).
+       */      
+      bool resampleRasterByResLinsCols(
+        const TePDITypes::TePDIRasterPtrType& input_raster,
+        const TePDITypes::TePDIRasterPtrType& output_raster,
+        double x_resolution_ratio,
+        double y_resolution_ratio,
+        int l,
+        int c,
+        TePDIInterpolator::InterpMethod interpol,
+        bool enable_progress );  
+  };
+
+
+#endif //TEPDIWaveletAtrous_HPP
diff --git a/src/terralib/image_processing/TePDIWiSpeRFusion.cpp b/src/terralib/image_processing/TePDIWiSpeRFusion.cpp
new file mode 100644
index 0000000..01aed0e
--- /dev/null
+++ b/src/terralib/image_processing/TePDIWiSpeRFusion.cpp
@@ -0,0 +1,516 @@
+#include "TePDIWiSpeRFusion.hpp"
+
+#include <TeAgnostic.h>
+#include "TePDIUtils.hpp"
+#include "TePDITypes.hpp"
+#include "TePDIStatistic.hpp"
+#include "TePDIWaveletAtrous.hpp"
+#include "TeRasterRemap.h"
+#include <TeMatrix.h>
+#include <TeUtils.h>
+#include <math.h>
+#include <queue>
+
+TePDIWiSpeRFusion::TePDIWiSpeRFusion()
+{
+}
+
+TePDIWiSpeRFusion::~TePDIWiSpeRFusion()
+{
+}
+
+void TePDIWiSpeRFusion::ResetState(const TePDIParameters&)
+{
+}
+
+bool TePDIWiSpeRFusion::CheckParameters(const TePDIParameters& parameters) const
+{
+/* Input rasters and bands checking */
+
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+	TEAGN_TRUE_OR_RETURN(input_rasters.size() > 1, "Invalid input rasters number");
+	
+	std::vector<int> bands;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands", bands), "Missing parameter: bands");
+	TEAGN_TRUE_OR_RETURN(bands.size() == input_rasters.size(), "Invalid parameter: bands number");
+
+	for(unsigned int input_rasters_index = 0; input_rasters_index < input_rasters.size(); input_rasters_index++)
+	{
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index].isActive(), "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " inactive");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " not ready");
+		TEAGN_TRUE_OR_RETURN(bands[input_rasters_index] < input_rasters[input_rasters_index]->nBands(), "Invalid parameter: bands[" + Te2String(input_rasters_index) + "]");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().nlines_ == input_rasters[0]->params().nlines_, "Invalid parameter: input_raster " + Te2String(input_rasters_index) + " with imcompatible number of lines");
+		TEAGN_TRUE_OR_RETURN(input_rasters[input_rasters_index]->params().ncols_ == input_rasters[0]->params().ncols_, "Invalid parameter: input_raster " + Te2String( input_rasters_index ) + " with imcompatible number of columns" );
+		TEAGN_TRUE_OR_RETURN(((input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeRGB) || (input_rasters[input_rasters_index]->params().photometric_[bands[input_rasters_index]] == TeRasterParams::TeMultiBand)), "Invalid parameter - input_rasters (invalid photometric interpretation)");
+	}
+
+/* Reference raster checking */
+
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+	TEAGN_TRUE_OR_RETURN(((reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeRGB ) || (reference_raster->params().photometric_[reference_raster_band] == TeRasterParams::TeMultiBand)), "Invalid parameter - reference_raster (invalid photometric interpretation)");
+
+	TEAGN_TRUE_OR_RETURN(reference_raster_band < reference_raster->nBands(), "Invalid parameter - reference_raster_band");
+
+/* Output rasters checking */
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() > 1, "Invalid output rasters number");
+	TEAGN_TRUE_OR_RETURN(output_rasters.size() == input_rasters.size(), "Invalid parameter: output rasters size");
+
+	for(unsigned int output_rasters_index = 0; output_rasters_index < output_rasters.size(); output_rasters_index++)
+	{
+		TEAGN_TRUE_OR_RETURN(output_rasters[output_rasters_index].isActive(), "Invalid parameter: output_rasters " + Te2String(output_rasters_index) + " inactive");
+		TEAGN_TRUE_OR_RETURN(output_rasters[output_rasters_index]->params().status_ != TeRasterParams::TeNotReady, "Invalid parameter: output_rasters " + Te2String(output_rasters_index) + " not ready");
+	}
+
+	int rasters_levels;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("rasters_levels", rasters_levels), "Missing parameter: rasters_levels");
+
+	int reference_levels;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
+
+	string filter_file;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("filter_file", filter_file), "Missing parameter: filter_file");
+
+	TePDIWiSpeRFusion::InterpMethod resampling_type;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
+
+	bool fit_histogram;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
+
+	string satelliteName;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("satelliteName", satelliteName), "Missing parameter: satelliteName");
+
+	std::vector<int> bands_order;
+	TEAGN_TRUE_OR_RETURN(parameters.GetParameter("bands_order", bands_order), "Missing parameter: bands_order");
+	TEAGN_TRUE_OR_RETURN(bands_order.size() == input_rasters.size(), "Invalid parameter: bands_order size");
+
+	return true;
+}
+
+bool TePDIWiSpeRFusion::fractions(TeMatrix &p_multi_pan, string satellite, int &pan_index)
+{
+	FILE *srf_file = fopen(satellite.c_str(), "r");
+  TEAGN_TRUE_OR_RETURN( srf_file, "Error opening sitelite SRF file" );
+
+	int	srfs_points,
+		bands_number;
+	fscanf(srf_file,"%d %d %d", &srfs_points, &bands_number, &pan_index);
+	pan_index--;
+
+	double	wavelength;
+	TeMatrix srfs;
+	srfs.Init(bands_number, srfs_points);
+	p_multi_pan.Init(bands_number, bands_number, 0.0);
+
+	for (int i = 0; i < srfs_points; i++)
+	{
+		fscanf(srf_file,"%lf", &wavelength);
+		for (int b = 0; b < bands_number; b++)
+			fscanf(srf_file,"%lf", &srfs(b, i));
+		for (int x = 0; x < bands_number; x++)
+		{
+			for (int y = x; y < bands_number; y++)
+			{
+				if ((x == pan_index) && (y == pan_index))
+				{
+					double max = 0.0;
+					for (int z = 0; z < bands_number; z++)
+					{
+						if (z != pan_index)
+							if (srfs(z, i) > max)
+								max = srfs(z, i);
+					}
+					p_multi_pan(pan_index, pan_index) += MIN(srfs(pan_index, i), max);
+				}
+				else
+				{
+					p_multi_pan(x, y) += MIN(srfs(x, i), srfs(y, i));
+					p_multi_pan(y, x) = p_multi_pan(x, y);
+ 				}
+			}
+		}
+	}
+	fclose(srf_file);
+
+	return true;
+}
+
+bool TePDIWiSpeRFusion::RunImplementation()
+{
+/* Getting parameters */
+	TePDITypes::TePDIRasterVectorType input_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("input_rasters", input_rasters), "Missing parameter: input_rasters");
+
+	std::vector<int> bands;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("bands", bands), "Missing parameter: bands");
+
+	TePDITypes::TePDIRasterVectorType output_rasters;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("output_rasters", output_rasters), "Missing parameter: output_rasters");
+
+	TePDITypes::TePDIRasterPtrType reference_raster;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster", reference_raster), "Missing parameter: reference_raster");
+
+	int reference_raster_band;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_raster_band", reference_raster_band), "Missing parameter: reference_raster_band");
+
+	int rasters_levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("rasters_levels", rasters_levels), "Missing parameter: rasters_levels");
+
+	int reference_levels;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("reference_levels", reference_levels), "Missing parameter: reference_levels");
+
+	string filter_file;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("filter_file", filter_file), "Missing parameter: filter_file");
+
+	TePDIWiSpeRFusion::InterpMethod resampling_type;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("resampling_type", resampling_type), "Missing parameter: resampling_type");
+
+	bool fit_histogram;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("fit_histogram", fit_histogram), "Missing parameter: fit_histogram");
+
+	string satelliteName;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("satelliteName", satelliteName), "Missing parameter: satelliteName");
+
+	std::vector<int> bands_order;
+	TEAGN_TRUE_OR_RETURN(params_.GetParameter("bands_order", bands_order), "Missing parameter: bands_order");
+
+/* Setting variables */
+	unsigned int b;
+	int	i,
+		j,
+		l;
+	double	pixel;
+	std::vector<double> channelMinLevel,
+						channelMaxLevel;
+
+	for(b = 0; b < input_rasters.size(); b++)
+	{
+		channelMinLevel.push_back(0.0);
+		//channelMaxLevel.push_back(pow(2.0, (double)input_rasters_wavelets[b][0]->params().nbitsperPixel_[0])-1.0);
+		channelMaxLevel.push_back(255.0);
+	}
+
+/* Allocating output rasters */
+	TeRasterParams base_raster_params = reference_raster->params();
+	for(b = 0; b < output_rasters.size(); b++)
+	{
+		TeRasterParams outRaster_params = output_rasters[b]->params();
+		outRaster_params.nBands(1);
+		if (base_raster_params.projection() != 0)
+		{
+			TeSharedPtr<TeProjection> proj(TeProjectionFactory::make(base_raster_params.projection()->params())); 
+			outRaster_params.projection(proj.nakedPointer());
+		}
+		outRaster_params.boxResolution(base_raster_params.box().x1(), base_raster_params.box().y1(), base_raster_params.box().x2(), base_raster_params.box().y2(), base_raster_params.resx_, base_raster_params.resy_);
+		outRaster_params.setPhotometric(TeRasterParams::TeMultiBand, -1);
+		outRaster_params.setDummy(0.0, -1);
+		outRaster_params.setDataType(TeUNSIGNEDCHAR, -1);
+		TEAGN_TRUE_OR_RETURN(output_rasters[b]->init(outRaster_params), "Raster reset error - Raster index " + Te2String(b));
+	}
+
+/* Resampling the input raster */
+	TeRasterParams reference_params = reference_raster->params();
+  
+	TePDITypes::TePDIRasterVectorType resampled_input_rasters;
+	for(b = 0; b < input_rasters.size(); b++)
+	{
+		if (resampling_type != TePDIWiSpeRFusion::Nothing)
+		{
+		  TePDIInterpolator::InterpMethod intMethod;
+		  switch( resampling_type )
+		  {
+		    case TePDIWiSpeRFusion::NNMethod :
+		    {
+		      intMethod =  TePDIInterpolator::NNMethod;
+		      break;
+		    }
+		    case TePDIWiSpeRFusion::BilinearMethod :
+		    {
+		      intMethod =  TePDIInterpolator::BilinearMethod;
+		      break;
+		    }		  
+		    case TePDIWiSpeRFusion::BicubicMethod :
+		    {
+		      intMethod =  TePDIInterpolator::BicubicMethod;
+		      break;
+		    }				      
+		    default :
+		    {
+		      TEAGN_LOG_AND_THROW( "Invalid resampling type" );
+		    }
+		  }		
+		
+			TePDITypes::TePDIRasterPtrType resampled_input_rasters_temp;
+			TEAGN_TRUE_OR_RETURN(TePDIUtils::TeAllocRAMRaster(resampled_input_rasters_temp,  reference_params, TePDIUtils::TePDIUtilsAutoMemPol), "Unable create the resampled input rasters");
+			resampleRasterByResLinsCols(input_rasters[b], resampled_input_rasters_temp, (double)reference_params.resx_ / (double)input_rasters[b]->params().resx_, (double)reference_params.resy_ / (double)input_rasters[b]->params().resy_, reference_params.nlines_,  reference_params.ncols_, intMethod, progress_enabled_);
+			resampled_input_rasters.push_back(resampled_input_rasters_temp);
+		}
+		else
+			resampled_input_rasters.push_back(input_rasters[b]);
+	}
+
+// Creating wavelet planes
+	std::vector<TePDITypes::TePDIRasterVectorType> input_rasters_wavelets;
+	for(b = 0; b < resampled_input_rasters.size(); b++)
+	{
+		TePDITypes::TePDIRasterVectorType input_rasters_wavelets_vector_temp;
+		input_rasters_wavelets_vector_temp.push_back(resampled_input_rasters[b]);
+		for(l = 1; l <= rasters_levels; l++)
+		{
+			TePDITypes::TePDIRasterPtrType input_rasters_wavelets_temp;
+			TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(input_rasters_wavelets_temp, waveletPlanes, reference_params.nlines_, reference_params.ncols_, false, TeFLOAT, 0), "Unable to alloc input rasters wavelet planes");
+			input_rasters_wavelets_vector_temp.push_back(input_rasters_wavelets_temp);
+		}
+		input_rasters_wavelets.push_back(input_rasters_wavelets_vector_temp);
+	}
+
+// Extracting input rasters wavelets planes
+	for(b = 0; b < resampled_input_rasters.size(); b++)
+	{
+		TePDIParameters waveletAtrousParams;
+		waveletAtrousParams.SetParameter("direction", (int)TePDIWaveletAtrous::DECOMPOSE);
+		waveletAtrousParams.SetParameter("input_raster", resampled_input_rasters[b]);
+		waveletAtrousParams.SetParameter("band", bands[b]);
+		waveletAtrousParams.SetParameter("levels", rasters_levels);
+		waveletAtrousParams.SetParameter("filter_file", filter_file);
+		waveletAtrousParams.SetParameter("output_wavelets", input_rasters_wavelets[b]);
+		waveletAtrousParams.SetParameter("fit_histogram", false);
+		TePDIWaveletAtrous wa;
+		TEAGN_TRUE_OR_THROW(wa.Reset(waveletAtrousParams), "Invalid Parameters");
+		wa.ToggleProgInt(progress_enabled_);
+		TEAGN_TRUE_OR_THROW(wa.Apply(), "Apply error");
+	}
+
+// Creating reference raster wavelet planes
+	TePDITypes::TePDIRasterVectorType reference_raster_wavelets;
+	for(l = 0; l <= reference_levels; l++)
+	{
+		TePDITypes::TePDIRasterPtrType reference_raster_wavelets_temp;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(reference_raster_wavelets_temp, waveletPlanes, reference_params.nlines_, reference_params.ncols_, false, TeFLOAT, 0), "Reference raster wavelets Alloc error");
+		if (l == 0)
+		{
+			for (int j = 0; j < reference_params.nlines_; j++)
+			{
+				for (int i = 0; i < reference_params.ncols_; i++)
+				{
+					reference_raster->getElement(i, j, pixel, reference_raster_band);
+					reference_raster_wavelets_temp->setElement(i, j, pixel, 0);
+				}
+			}
+		}
+		reference_raster_wavelets.push_back(reference_raster_wavelets_temp);
+	}
+
+// Extracting reference raster wavelet planes
+	TePDIParameters waveletAtrousParams;
+	waveletAtrousParams.SetParameter("direction", (int)TePDIWaveletAtrous::DECOMPOSE);
+	waveletAtrousParams.SetParameter("input_raster", reference_raster);
+	waveletAtrousParams.SetParameter("band", reference_raster_band);
+	waveletAtrousParams.SetParameter("levels", reference_levels);
+	waveletAtrousParams.SetParameter("filter_file", filter_file);
+	waveletAtrousParams.SetParameter("output_wavelets", reference_raster_wavelets);
+	TePDIWaveletAtrous wa;
+	TEAGN_TRUE_OR_THROW(wa.Reset(waveletAtrousParams), "Invalid Parameters");
+	wa.ToggleProgInt(progress_enabled_);
+	TEAGN_TRUE_OR_THROW(wa.Apply(), "Apply error");
+
+// Creating weights planes
+	TePDITypes::TePDIRasterVectorType input_rasters_weights;
+	for(b = 0; b < resampled_input_rasters.size(); b++)
+	{
+		TePDITypes::TePDIRasterPtrType input_rasters_weights_temp;
+		TEAGN_TRUE_OR_THROW(TePDIUtils::TeAllocRAMRaster(input_rasters_weights_temp, reference_levels+1, reference_params.nlines_, reference_params.ncols_, false, TeFLOAT, 0), "Input rasters weights alloc error");
+		input_rasters_weights.push_back(input_rasters_weights_temp);
+	}
+
+// WiSpeR
+	TeMatrix p_multi_pan;
+	int pan_index;
+	fractions(p_multi_pan, satelliteName, pan_index);
+
+	for (b = 0; b < bands_order.size(); b++)
+	{
+		bands_order[b]--;
+	}
+
+	TePDIPIManager progress("Pondering coefficients", resampled_input_rasters[0]->params().ncols_, progress_enabled_);
+	progress.Toggle(progress_enabled_);
+	for (j = 0; j < reference_params.nlines_; j++)
+	{
+		for (i = 0; i < reference_params.ncols_; i++)
+		{
+			std::vector<double>	p_multi(resampled_input_rasters.size(), 0.0),
+						n_p_i(resampled_input_rasters.size(), 0.0),
+						pho_p_i(resampled_input_rasters.size(), 0.0);
+			double	p_pan,
+				n_p_i_sum = 0.0,
+				pho_p_mean = 0.0;
+				//alpha = p_multi_pan(pan_index, pan_index) / 82.808534682;
+			//reference_raster->getElement(i, j, p_pan, 0);
+			reference_raster_wavelets[0]->getElement(i, j, p_pan, 0);
+			for(b = 0; b < resampled_input_rasters.size(); b++)
+			{
+				resampled_input_rasters[b]->getElement(i, j, p_multi[b], 0);
+				n_p_i[b] = (p_multi_pan(bands_order[b], pan_index) / p_multi_pan(bands_order[b], bands_order[b])) * p_multi[b];
+				//n_p_i[b] = (p_multi_pan(bands_order[b], pan_index) / p_multi_pan(pan_index, pan_index)) * alpha * p_pan;
+				n_p_i_sum += n_p_i[b];
+				pho_p_i[b] = n_p_i[b] / p_multi_pan(bands_order[b], pan_index);
+				pho_p_mean += pho_p_i[b];
+			}
+			pho_p_mean /= (double)resampled_input_rasters.size();
+			for(b = 0; b < resampled_input_rasters.size(); b++)
+			{
+				double	ponder = 0.0,
+						beta = p_multi_pan(bands_order[b], (bands_order[b]+1 < (int)resampled_input_rasters.size())?bands_order[b]+1:bands_order[b]-1) / p_multi_pan(bands_order[b], bands_order[b]);
+				//reference_raster_wavelets[b][reference_levels]->getElement(i, j, p_pan_res, 0);
+				for (int l = 1; l <= reference_levels; l++)
+				{
+					double	p_pan_wavelet,
+						p_pan_res;
+					reference_raster_wavelets[l]->getElement(i, j, p_pan_res, 0);
+					reference_raster_wavelets[l]->getElement(i, j, p_pan_wavelet, 1);
+					//ponder += (pho_p_i[b] / pho_p_mean) * (((n_p_i_sum / p_pan_res) * (p_multi_pan(bands_order[b], pan_index) / p_multi_pan(pan_index, pan_index))) / (p_multi_pan(b, pan_index) / p_multi_pan(bands_order[b], bands_order[b]))) * (1.0 - (beta/2.0)) * p_pan_wavelet;
+					ponder += (pho_p_i[b] / pho_p_mean) * (((n_p_i_sum / p_pan_res) * (p_multi_pan(bands_order[b], pan_index) / p_multi_pan(pan_index, pan_index))) / ((p_multi_pan(bands_order[b], pan_index) / p_multi_pan(bands_order[b], bands_order[b])) * (1.0 - (beta/2.0)))) * p_pan_wavelet;
+				}
+				input_rasters_weights[b]->setElement(i, j, ponder, 0);
+			}
+		}
+		progress.Increment();
+	}
+	progress.Toggle(false);
+
+
+// Fusing input rasters and reference raster
+	progress.Reset("Fusing input raster and reference raster", resampled_input_rasters.size()*reference_params.nlines_);
+	progress.Toggle(progress_enabled_);
+	double	p_pon = 0.0;
+	for(b = 0; b < resampled_input_rasters.size(); b++)
+	{
+		for (j = 0; j < reference_params.nlines_; j++)
+		{
+			for (i = 0; i < reference_params.ncols_; i++)
+			{
+				input_rasters_wavelets[b][rasters_levels]->getElement(i, j, pixel, 0);
+				input_rasters_weights[b]->getElement(i, j, p_pon, 0);
+				pixel += p_pon;
+				pixel = (pixel > channelMaxLevel[b]?channelMaxLevel[b]:(pixel < channelMinLevel[b]?channelMinLevel[b]:pixel));
+				output_rasters[b]->setElement(i, j, pixel, 0);
+			}
+			progress.Increment();
+		}
+	}
+	progress.Toggle(false);
+
+	return true;
+}
+
+bool TePDIWiSpeRFusion::resampleRasterByResLinsCols( 
+  const TePDITypes::TePDIRasterPtrType& input_raster,
+  const TePDITypes::TePDIRasterPtrType& output_raster,
+  double x_resolution_ratio, double y_resolution_ratio, int l, int c,
+  TePDIInterpolator::InterpMethod interpol, bool enable_progress ) 
+{
+    
+  TEAGN_TRUE_OR_RETURN( input_raster.isActive(), "Inactive input raster" );
+  TEAGN_TRUE_OR_RETURN( 
+    input_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Input raster not ready" )
+  
+  TEAGN_TRUE_OR_RETURN( output_raster.isActive(), 
+    "Inactive output raster" );
+  TEAGN_TRUE_OR_RETURN( 
+    output_raster->params().status_ != TeRasterParams::TeNotReady,
+    "Output raster not ready" )
+    
+  TEAGN_TRUE_OR_RETURN( ( x_resolution_ratio > 0.0 ), "Invalid X ratio" )
+  TEAGN_TRUE_OR_RETURN( ( y_resolution_ratio > 0.0 ), "Invalid X ratio" )
+  
+  /* Reseting the output raster to the new geometry */
+  
+  TeRasterParams& input_raster_params = input_raster->params();
+  
+  TeRasterParams new_output_raster_params = output_raster->params();
+  
+  new_output_raster_params.nBands( input_raster_params.nBands() );
+  new_output_raster_params.setPhotometric( 
+    input_raster_params.photometric_[ 0 ], -1 );
+  if( input_raster_params.projection() != 0 ) {
+    new_output_raster_params.projection( input_raster_params.projection() );
+  }
+  new_output_raster_params.boxResolution( 
+    input_raster_params.box().x1(), 
+    input_raster_params.box().y1(), input_raster_params.box().x2(), 
+    input_raster_params.box().y2(), 
+    ( input_raster_params.resx_ * x_resolution_ratio ), 
+    ( input_raster_params.resy_ * y_resolution_ratio ) );
+  new_output_raster_params.lowerLeftResolutionSize(input_raster_params.box().lowerLeft().x(), input_raster_params.box().lowerLeft().y(), ( input_raster_params.resx_ * x_resolution_ratio ), ( input_raster_params.resy_ * y_resolution_ratio ), c, l);
+
+    
+  TEAGN_TRUE_OR_RETURN( output_raster->init( new_output_raster_params ),
+    "Output raster reset error" )
+//cout << output_raster->params().resx_ << endl;
+    
+  /* interpolating pixel values */
+  
+  const TeRasterParams& output_raster_params = output_raster->params();
+  
+  const unsigned int out_lines = output_raster_params.nlines_;
+  const unsigned int out_cols = output_raster_params.ncols_;
+  const unsigned int out_bands = output_raster_params.nBands();
+  
+  double in_col = 0;
+  double in_line = 0;
+  unsigned int out_col = 0;
+  unsigned int out_line = 0;
+  unsigned int out_band = 0;
+  double value = 0;
+  
+  double dummy_value = 0;
+  if( input_raster_params.useDummy_ ) {
+    dummy_value = input_raster_params.dummy_[ 0 ];
+  }
+  
+  TeRaster& output_raster_ref = *( output_raster.nakedPointer() );
+  
+  TePDIInterpolator interpolator;
+  TEAGN_TRUE_OR_RETURN( interpolator.reset( input_raster, interpol,
+    dummy_value), "Interpolator reset error" )
+    
+  TePDIPIManager progress( "Resampling raster", ( out_bands * out_lines ),
+    enable_progress );
+  
+  for( out_band = 0 ; out_band < out_bands ; ++out_band ) {
+    for( out_line = 0 ; out_line < out_lines ; ++out_line ) {
+      in_line = ( (double)out_line) * y_resolution_ratio;
+if ((int)in_line >= (input_raster->params().nlines_-1))
+  in_line = (double)(input_raster->params().nlines_-1);
+    
+      for( out_col = 0 ; out_col < out_cols ; ++out_col ) {
+        in_col = ( (double)out_col) * x_resolution_ratio;
+  if ((int)in_col >= (input_raster->params().ncols_-1))
+  in_col = (double)(input_raster->params().ncols_-1);
+      
+        interpolator.interpolate( in_line, in_col, out_band, value );
+
+    if (value>255)
+      value=255;
+    else if (value<0)
+      value=0;
+    
+        TEAGN_TRUE_OR_RETURN( output_raster_ref.setElement( out_col, 
+          out_line, value, out_band ), "Output raster writing error" )
+      }
+      
+      TEAGN_FALSE_OR_RETURN( progress.Increment(), "Canceled by user" );
+    }
+  }
+  
+  return true;
+}
diff --git a/src/terralib/image_processing/TePDIWiSpeRFusion.hpp b/src/terralib/image_processing/TePDIWiSpeRFusion.hpp
new file mode 100644
index 0000000..b39935e
--- /dev/null
+++ b/src/terralib/image_processing/TePDIWiSpeRFusion.hpp
@@ -0,0 +1,153 @@
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPDIWISPERFUSION_HPP
+  #define TEPDIWISPERFUSION_HPP
+
+  #include "TePDILevelRemap.hpp"
+  #include "TePDIAlgorithm.hpp"
+  #include "TePDIInterpolator.hpp"
+  #include <TeSharedPtr.h>
+
+  #define waveletPlanes 2
+
+  /**
+   * @class TePDIWiSpeRFusion
+   * @brief WiSpeR Fusion.
+   * @warning This class is under development and may produce incorrect 
+   * results or generate execution errors, please wait for the next version.   
+   * @author Felipe Castro da Silva <felipe at dpi.inpe.br>
+   * @ingroup PDIFusionAlgorithms
+   *
+   * @note The required parameters are:
+   *
+   * @param input_rasters (TePDITypes::TePDIRasterVectorType) - Low resolution rasters.
+   * @param bands (std::vector< int >) - The bands from each low resolution raster.
+   * @param output_rasters (TePDITypes::TePDIRasterVectorType) - High resolution fused rasters.
+   * @param reference_raster (TePDITypes::TePDIRasterPtrType) - High resolution raster.
+   * @param reference_raster_band (int) - Reference raster band number.
+   * @param rasters_levels (int) - input_rasters decomposition levels.
+   * @param filter_file (string) - External wavelets filter parameters file.
+   * @param reference_levels (int) - Decomposition levels for each reference raster.
+   * @param resampling_type (TePDIWiSpeRFusion::InterpMethod) - Resampling type.
+   * @param fit_histogram (bool) - Fit histogram before the substitutionion raster.
+   * @param satelliteName (std::string) - File name where are the SRF functions.
+   * @param bands_order (std::vector<int>) - The relation between the 
+   * input images and their spectral response functions. For example: 
+   * the CBERS-2B satellite have four CCD multispectral bands: blue, green, 
+   * red, and nir. If the user selects the input images as red, green and 
+   * blue, the bands ordering are 3, 2, and 1.
+   * @example TePDIFusion_test.cpp Shows how to use this class.
+   */
+  class PDI_DLL TePDIWiSpeRFusion : public TePDIAlgorithm {
+    public :
+      /** @enum TeSatellitesTypes Satellites spectral functions available */
+      enum TeSatellitesTypes {CBERS, CBERS2B, IKONOS, QUICKBIRD, SPOT4, SPOT5};
+      
+      /**
+       * @enum Allowed interpolation methods.
+       */      
+      enum InterpMethod {
+        /** No interpolation method. */
+        Nothing = 0,
+        /** Near neighborhood interpolation method. */
+        NNMethod = 1,
+        /** Bilinear interpolation method. */
+        BilinearMethod = 2,
+        /** Bicubic interpolation method. */
+        BicubicMethod = 3      
+      };
+      
+      /**
+       * @brief Default Constructor.
+       *
+       */
+      TePDIWiSpeRFusion();
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePDIWiSpeRFusion();
+
+      /**
+       * @brief Checks if the supplied parameters fits the requirements of each
+       * PDI algorithm implementation.
+       *
+       * @note Error log messages must be generated. No exceptions generated.
+       *
+       * @param parameters The parameters to be checked.
+       * @return true if the parameters are OK. false if not.
+       */
+      bool CheckParameters( const TePDIParameters& parameters ) const;
+
+    protected :
+      /**
+       * @brief Decide the direction of the analysis based on the analysis_type parameter.
+       *
+       * @return true if OK. false on error.
+       */
+      bool RunImplementation();
+
+      /**
+       * @brief Reset the internal state to the initial state.
+       *
+       * @param params The new parameters referente at initial state.
+       */
+      void ResetState(const TePDIParameters&);
+
+      /**
+       * @brief Load spectral function from file.
+       *
+       * @param p_multi_pan Intersection matrix between satellite bands
+       * @param satellitesType Satellite type
+       * @param pan_index Panchromatic index in the p_multi_pan matrix
+       */
+      bool fractions(TeMatrix &p_multi_pan, string satellite, int &pan_index);
+      
+      /**
+       * @brief Raster resampling to new resolution, forcing lines and columns.
+       * @param input_raster Input raster.
+       * @param output_raster Output raster.
+       * @param x_resolution_ratio X resolution ratio.
+       * @param y_resolution_ratio Y resolution ratio.
+       * @param l Output raster Lines.
+       * @param c Output raster Columns.
+       * @param interpol Interpolation method.
+       * @param enable_progress Enable/disable the progress interface.
+       * @return true if OK, false on errors.
+       * 
+       * @note ( resolution_ratio = output_resolution / input_resolution ).
+       */      
+      bool resampleRasterByResLinsCols(
+        const TePDITypes::TePDIRasterPtrType& input_raster,
+        const TePDITypes::TePDIRasterPtrType& output_raster,
+        double x_resolution_ratio,
+        double y_resolution_ratio,
+        int l,
+        int c,
+        TePDIInterpolator::InterpMethod interpol,
+        bool enable_progress );        
+  };
+  
+#endif //TEPDIWaveletAtrous_HPP
diff --git a/src/terralib/image_processing/data_structs/TeTileIndexer.h b/src/terralib/image_processing/data_structs/TeTileIndexer.h
deleted file mode 100755
index 604b897..0000000
--- a/src/terralib/image_processing/data_structs/TeTileIndexer.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TETILEINDEXER_H
-#define TETILEINDEXER_H
-
-#include <TeGeometry.h>
-#include <TeAgnostic.h>
-
-#include <algorithm>
-
-#include <math.h>
-
-/**
- * @class Polygon tile indexing class for optmized geometrical relational tests.
- * @author Gilberto Ribeiro <gribeiro at dpi.inpe.br>
- * @note The related polygon instance must always be valid ( only the polygon
- * reference is stored internally ).
- */
-class PDI_DLL TeTileIndexer
-{
-  public :
-  
-    /**
-     * @typedef Indexed elements node type( pair< ring index, seg index  ).
-     */
-    typedef vector< pair< unsigned int, unsigned int > > TeTileSegIndex;
-
-  protected:
-    
-    //!< Reference polygon.
-    const TePolygon& refPol_;
-    
-    //!< Tile resolution along "y" axis.
-    double dy_;
-
-    //!< Each tile segments index vector.
-    std::vector<TeTileSegIndex*> tileIndex_;
-    
-    TeTileIndexer( const TeTileIndexer& );
-    
-    /** Copy overload */
-    const TeTileIndexer& operator=( const TeTileIndexer& );
-    
-    /*! Gets tile index intervals in y direction for a given segment (it does 
-        NOT need to be oriented).
-      \param c1         First segment coordinate.
-      \param c2         Second segment coordinate.
-      \param firstTile  The first tile index that this segment intersects.
-      \param lastTile   The last tile index that this segment intersects.
-     */
-    void getTileIndex(const TeCoord2D& c1, const TeCoord2D& c2, 
-      unsigned int& firstTile, unsigned int& lastTile) const
-    {
-      TEAGN_DEBUG_CONDITION( ( dy_ > 0 ), 
-        "Invalid tile indexer Y resolution" );
-            
-      double lowerY = ((c1.y_ < c2.y_) ? c1.y_ : c2.y_);
-      double upperY = ((c1.y_ > c2.y_) ? c1.y_ : c2.y_);
-
-      firstTile = int((lowerY - refPol_.box().y1()) / dy_);
-      lastTile  = int((upperY - refPol_.box().y1()) / dy_);  
-    }    
-    
-    //! Gets tile index for y coordinate value.
-    /*!
-      \param y         Value of "y" coordinate.
-      \param tileIndex Index of corresponding tile.
-     */
-    void getTileIndex(const double& y, unsigned int& tileIndex) const
-    {
-      TEAGN_DEBUG_CONDITION( ( dy_ > 0 ), 
-        "Invalid tile indexer Y resolution" );
-        
-      tileIndex = int( (y - refPol_.box().y1() ) / dy_ );
-    }    
-    
-    /**
-     * @brief Init internal variables.
-     */
-    void init()
-    {
-      dy_ = 0;
-    }      
-    
-  public:
-  
-    //! Alternative Constructor.
-    /*!
-      \param pol The polygon to index.
-      \param dy Tile size along "y" axis.
-     */
-    TeTileIndexer( const TePolygon& pol, const double& dy )
-      : refPol_( pol )
-    {
-      TEAGN_DEBUG_CONDITION( ( dy > 0 ),
-        "Invalid tile index dy" );
-        
-      init();
-      
-      dy_ = dy;
-      
-      /* Building new index */
-      
-      if( refPol_.size() > 0 ) {
-        TEAGN_DEBUG_CONDITION( ( dy_ > 0 ), 
-          "Invalid tile indexer Y resolution" );
-              
-        unsigned int total_tiles_number = 1 + 
-          ( (unsigned int)floor( refPol_.box().height() / dy_ ) );
-              
-        for(unsigned int i = 0; i < total_tiles_number; ++i)
-        {
-          tileIndex_.push_back( new TeTileSegIndex );
-        }
-
-        const unsigned int rings_number = refPol_.size();
-
-        // for each polygon ring, we need to index its segments
-        for(unsigned int i = 0; i < rings_number; ++i)
-        {
-          addRing( i );
-        }
-      }
-    }    
-    
-    /**
-     * @brief Clear all internal resources.
-     */
-    void clear()
-    {
-      vector<TeTileSegIndex*>::iterator it = tileIndex_.begin();
-      vector<TeTileSegIndex*>::iterator it_end = tileIndex_.end();
-      
-      while( it != it_end ) {
-        delete ( *it );
-        
-        ++it;
-      }
-      
-      tileIndex_.clear();
-      
-      init();
-    }     
-
-    ~TeTileIndexer()
-    {
-      clear();
-    }
-    
-    //! Update the tile index with the information of the supplied ring.
-    void addRing( const unsigned int& ring_index )
-    {
-      TEAGN_DEBUG_CONDITION( ( ring_index < refPol_.size() ),
-        "Invalid ring_index" );
-
-      unsigned int num_points = refPol_[ring_index].size();
-        
-      if( num_points > 0 ) {
-        unsigned int numSegments = num_points - 1;
-  
-        for(unsigned int j = 0; j < numSegments; ++j)
-        {
-          // creates a pointer to the segment
-          pair<unsigned int, unsigned int> segPointer(
-            ring_index, j);
-  
-          // finds the tiles that this segments intersects
-          unsigned int firstTileIndex = 0;
-          unsigned int lastTileIndex = 0;
-            
-          getTileIndex( refPol_[ring_index][j], 
-            refPol_[ring_index][j + 1], 
-            firstTileIndex, lastTileIndex);
-              
-          TEAGN_DEBUG_CONDITION( 
-            ( firstTileIndex < tileIndex_.size() ),
-            "Invalid firstTileIndex" );
-          TEAGN_DEBUG_CONDITION(
-            ( lastTileIndex < tileIndex_.size() ),
-            "Invalid lastTileIndex" );
-  
-          // associates the pointer segment to the tiles
-          for(unsigned int k = firstTileIndex; k <= lastTileIndex; ++k)
-          {
-            tileIndex_[k]->push_back(segPointer);
-          }
-        }
-      }
-    }     
-    
-    /*! Gets tile index.
-      \param y Y value.
-      \param index Output tile pointer ( NULL if not found ).
-    */    
-    void getTile( const double& y, TeTileSegIndex** index ) const
-    {
-      unsigned int tidx;
-      getTileIndex( y, tidx );
-      
-      if( tidx < tileIndex_.size() ) {
-        ( *index ) = tileIndex_[ tidx ];
-      } else {
-        ( *index ) = 0;
-      }
-    }
-    
-    const TePolygon& getPol() const
-    {
-      return refPol_;
-    }
-    
-    unsigned int getTilesNumber()
-    {
-      return (unsigned int)tileIndex_.size();
-    }
-
-};
-
-
-#endif
diff --git a/src/terralib/kernel/Gra_algo.h b/src/terralib/kernel/Gra_algo.h
old mode 100755
new mode 100644
index 80d910f..2c868e3
--- a/src/terralib/kernel/Gra_algo.h
+++ b/src/terralib/kernel/Gra_algo.h
@@ -1,195 +1,195 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-//  include/gra_algo.h
-#ifndef GRAPH_ALGORITHMS_H
-#define GRAPH_ALGORITHMS_H 
-#include <dynpq.h>
-#include <graph.h>
-#include <limits>
-#include <iostream>
-
-namespace br_stl {
-
-template<class GraphType, class EdgeType>
-void Dijkstra(
-       GraphType& Gr,
-       std::vector<EdgeType>& Dist,
-       std::vector<int>& Pred,
-       int Start) {
-    /* The algorithm proceeds in such a way that the distances are
-       estimated and the estimates gradually improved. The distance to
-       the starting point is known (0). For all other vertices, the
-       worst possible estimate is entered.*/
-
-    Dist = std::vector<EdgeType>(Gr.size(),
-          TeMAXFLOAT); // as good as infinity
-    Dist[Start] = (EdgeType)0;
-
-    /* The predecessor vector too is initialized with `impossible'
-       values. Subsequently, a dynamic priority queue is defined and
-       initialized with the distance vector: */
-
-	Pred = std::vector<int>(Gr.size(), -1);
-    dynamic_priority_queue<EdgeType> Q(Dist);
-
-    // In the next step, all vertices are extracted  one by one from
-    //  the priority queue, and precisely in the order of the estimated
-    // distance towards the starting vertex. Obviously, the starting
-    //vertex is dealt with first. No vertex is looked at twice. 
-
-    int u;
-    while(!Q.empty()) {
-       u = Q.topIndex();   // extract vertex with minimum
-       Q.pop();
-
-       // Now, the distance estimates for all neighboring vertices of
-       //  u are updated. If the previous estimate of the distance
-        //  between the current neighbor of u and the starting vertex
-       //   (Dist[Neighbor]) is worse than the distance between vertex u
-        //  and the starting vertex (Dist[u]) plus the distance between
-       //   u and the neighboring vertex (dist), the estimate is
-        //  improved: this process is called relaxation. In this case,
-        //  the path from the starting vertex to the neighbor cannot be
-        //  longer than (Dist[u] + dist). In this case, u would have to
-        //  be regarded as predecessor of the neighbor. 
-          
-        // improve estimates for all neighbors of u
-        typename GraphType::Successor::const_iterator
-                   I = Gr[u].second.begin();
-
-        while(I != Gr[u].second.end()) {
-            int Neighbor = (*I).first;
-            EdgeType dist = (*I).second;
-
-            // relaxation
-            if(Dist[Neighbor] > Dist[u] + dist) {
-               // improve estimate
-               Q.changeKeyAt(Neighbor, Dist[u] + dist);
-               // u is predecessor of the neighbor
-               Pred[Neighbor] = u;
-            }
-            ++I;
-        }
-    }
-	return;
-}
-
-template<class GraphType>
-bool topoSort(
-       GraphType& G,
-       std::vector<int>& Result) {
-    assert(G.isDirected());           // let's play this safe!
-    int ResCounter = 0;
-    Result = std::vector<int>(G.size(), -1);
-
-    /* The vector Result takes the indices of the correspondingly
-       distributed vertices. The counter ResCounter is the position in
-       Result where the next entry belongs. */
-
-    vector<int> PredecessorCount(G.size(), 0);
-    int VerticesWithoutSuccessor = 0;
-
-    /* For each vertex, the vector PredecessorCount counts how many
-       predecessors it has. There are vertices without successors,
-       whose number is kept in VerticesWithoutSuccessor. Furthermore,
-       the algorithm remains stable if the precondition that a graph
-       must not have cycles is violated. The variable
-       VerticesWithoutSuccessor is used to recognize this situation
-       (see below). */
-
-    /* 
-	for(size_t iv = 0; iv < G.size(); ++iv) {
-        if(G[iv].second.size() > 0) {    // is predecessor
-           typename GraphType::Successor::const_iterator I =
-                G[iv].second.begin();
-           while(I != G[iv].second.end())
-               // update number of predecessors
-               ++PredecessorCount[(*I++).first];
-        }
-        else  { // Vertex is no predecessor, that is, without successor
-             // an excessively high number of predecessors is used 
-             // for later recognition
-             PredecessorCount[iv] =   G.size(); // too many!
-             ++VerticesWithoutSuccessor;
-        }
-    }
-	*/
-
-    /* The dynamic priority queue is initialized with the vector of
-       numbers of predecessors. At the beginning of the queue we find
-       those vertices that have no predecessors and therefore are to
-       be processed next. Only the vertices which are predecessors
-       themselves, that is that have successors are processed. The
-       subsequent loop is terminated when the queue only contains
-       successor vertices which themselves are not predecessors. Their
-       number of predecessors can never be 0 because further above
-       they were initialized with too high a value.*/
-       
-    /* 
-	dynamic_priority_queue<int> Q(PredecessorCount);
-
-    // process all predecessors
-    while(Q.topKey() == 0) {
-        // determine vertex with predecessor number 0
-       int oV = Q.topIndex();
-       Q.pop();
-
-       Result[ResCounter++] = oV;
-
-       // In order to ensure that this vertex without predecessors oV
-        //  is no longer considered in the next cycle, the number of
-       //   predecessors of all its successors is decreased by 1. 
-          
-       typename GraphType::Successor::const_iterator
-             I = G[oV].second.begin();
-       while(I != G[oV].second.end()) {
-          // decrease number of predecessors with 
-          // changeKeyAt()}. Do not change directly!
-          int V = (*I).first;
-          Q.changeKeyAt(V, PredecessorCount[V] -1);
-          ++I;
-       }
-    }
-
-    // Now, all vertices without successors are entered. As a
-    //   countercheck, the variable VerticesWithoutSuccessor is
-    //   decreased. If the queue contains too many vertices, an error
-    //   message is displayed.  
-       
-    while(!Q.empty()) {
-         Result[ResCounter++] = Q.topIndex();
-         Q.pop();
-         --VerticesWithoutSuccessor;
-    }
-
-    if(VerticesWithoutSuccessor < 0)
-       std::cerr << "Error: graph contains a cycle!\n";
-    return VerticesWithoutSuccessor == 0;
-	*/
-	return;
-}
-
-} // namespace br_stl
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+//  include/gra_algo.h
+#ifndef GRAPH_ALGORITHMS_H
+#define GRAPH_ALGORITHMS_H 
+#include <dynpq.h>
+#include <graph.h>
+#include <limits>
+#include <iostream>
+
+namespace br_stl {
+
+template<class GraphType, class EdgeType>
+void Dijkstra(
+       GraphType& Gr,
+       std::vector<EdgeType>& Dist,
+       std::vector<int>& Pred,
+       int Start) {
+    /* The algorithm proceeds in such a way that the distances are
+       estimated and the estimates gradually improved. The distance to
+       the starting point is known (0). For all other vertices, the
+       worst possible estimate is entered.*/
+
+    Dist = std::vector<EdgeType>(Gr.size(),
+          TeMAXFLOAT); // as good as infinity
+    Dist[Start] = (EdgeType)0;
+
+    /* The predecessor vector too is initialized with `impossible'
+       values. Subsequently, a dynamic priority queue is defined and
+       initialized with the distance vector: */
+
+	Pred = std::vector<int>(Gr.size(), -1);
+    dynamic_priority_queue<EdgeType> Q(Dist);
+
+    // In the next step, all vertices are extracted  one by one from
+    //  the priority queue, and precisely in the order of the estimated
+    // distance towards the starting vertex. Obviously, the starting
+    //vertex is dealt with first. No vertex is looked at twice. 
+
+    int u;
+    while(!Q.empty()) {
+       u = Q.topIndex();   // extract vertex with minimum
+       Q.pop();
+
+       // Now, the distance estimates for all neighboring vertices of
+       //  u are updated. If the previous estimate of the distance
+        //  between the current neighbor of u and the starting vertex
+       //   (Dist[Neighbor]) is worse than the distance between vertex u
+        //  and the starting vertex (Dist[u]) plus the distance between
+       //   u and the neighboring vertex (dist), the estimate is
+        //  improved: this process is called relaxation. In this case,
+        //  the path from the starting vertex to the neighbor cannot be
+        //  longer than (Dist[u] + dist). In this case, u would have to
+        //  be regarded as predecessor of the neighbor. 
+          
+        // improve estimates for all neighbors of u
+        typename GraphType::Successor::const_iterator
+                   I = Gr[u].second.begin();
+
+        while(I != Gr[u].second.end()) {
+            int Neighbor = (*I).first;
+            EdgeType dist = (*I).second;
+
+            // relaxation
+            if(Dist[Neighbor] > Dist[u] + dist) {
+               // improve estimate
+               Q.changeKeyAt(Neighbor, Dist[u] + dist);
+               // u is predecessor of the neighbor
+               Pred[Neighbor] = u;
+            }
+            ++I;
+        }
+    }
+	return;
+}
+
+template<class GraphType>
+bool topoSort(
+       GraphType& G,
+       std::vector<int>& Result) {
+    assert(G.isDirected());           // let's play this safe!
+    int ResCounter = 0;
+    Result = std::vector<int>(G.size(), -1);
+
+    /* The vector Result takes the indices of the correspondingly
+       distributed vertices. The counter ResCounter is the position in
+       Result where the next entry belongs. */
+
+    vector<int> PredecessorCount(G.size(), 0);
+    int VerticesWithoutSuccessor = 0;
+
+    /* For each vertex, the vector PredecessorCount counts how many
+       predecessors it has. There are vertices without successors,
+       whose number is kept in VerticesWithoutSuccessor. Furthermore,
+       the algorithm remains stable if the precondition that a graph
+       must not have cycles is violated. The variable
+       VerticesWithoutSuccessor is used to recognize this situation
+       (see below). */
+
+    /* 
+	for(size_t iv = 0; iv < G.size(); ++iv) {
+        if(G[iv].second.size() > 0) {    // is predecessor
+           typename GraphType::Successor::const_iterator I =
+                G[iv].second.begin();
+           while(I != G[iv].second.end())
+               // update number of predecessors
+               ++PredecessorCount[(*I++).first];
+        }
+        else  { // Vertex is no predecessor, that is, without successor
+             // an excessively high number of predecessors is used 
+             // for later recognition
+             PredecessorCount[iv] =   G.size(); // too many!
+             ++VerticesWithoutSuccessor;
+        }
+    }
+	*/
+
+    /* The dynamic priority queue is initialized with the vector of
+       numbers of predecessors. At the beginning of the queue we find
+       those vertices that have no predecessors and therefore are to
+       be processed next. Only the vertices which are predecessors
+       themselves, that is that have successors are processed. The
+       subsequent loop is terminated when the queue only contains
+       successor vertices which themselves are not predecessors. Their
+       number of predecessors can never be 0 because further above
+       they were initialized with too high a value.*/
+       
+    /* 
+	dynamic_priority_queue<int> Q(PredecessorCount);
+
+    // process all predecessors
+    while(Q.topKey() == 0) {
+        // determine vertex with predecessor number 0
+       int oV = Q.topIndex();
+       Q.pop();
+
+       Result[ResCounter++] = oV;
+
+       // In order to ensure that this vertex without predecessors oV
+        //  is no longer considered in the next cycle, the number of
+       //   predecessors of all its successors is decreased by 1. 
+          
+       typename GraphType::Successor::const_iterator
+             I = G[oV].second.begin();
+       while(I != G[oV].second.end()) {
+          // decrease number of predecessors with 
+          // changeKeyAt()}. Do not change directly!
+          int V = (*I).first;
+          Q.changeKeyAt(V, PredecessorCount[V] -1);
+          ++I;
+       }
+    }
+
+    // Now, all vertices without successors are entered. As a
+    //   countercheck, the variable VerticesWithoutSuccessor is
+    //   decreased. If the queue contains too many vertices, an error
+    //   message is displayed.  
+       
+    while(!Q.empty()) {
+         Result[ResCounter++] = Q.topIndex();
+         Q.pop();
+         --VerticesWithoutSuccessor;
+    }
+
+    if(VerticesWithoutSuccessor < 0)
+       std::cerr << "Error: graph contains a cycle!\n";
+    return VerticesWithoutSuccessor == 0;
+	*/
+	return;
+}
+
+} // namespace br_stl
+#endif
+
diff --git a/src/terralib/kernel/Te2ndDegPolinomialGT.cpp b/src/terralib/kernel/Te2ndDegPolinomialGT.cpp
new file mode 100644
index 0000000..cf23feb
--- /dev/null
+++ b/src/terralib/kernel/Te2ndDegPolinomialGT.cpp
@@ -0,0 +1,245 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "Te2ndDegPolinomialGT.h"
+
+#include "TeAgnostic.h"
+
+
+Te2ndDegPolinomialGT::Te2ndDegPolinomialGT()
+{
+}
+
+
+Te2ndDegPolinomialGT::~Te2ndDegPolinomialGT()
+{
+}
+
+
+void Te2ndDegPolinomialGT::directMap( const TeGTParams& params, const TeCoord2D& pt1, 
+  TeCoord2D& pt2 ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ), 
+    "Transformation not defined" );
+  
+  double x = pt1.x();
+  double y = pt1.y();
+
+  pt2.x( 
+      params.direct_parameters_( 0, 0 ) +
+    ( params.direct_parameters_( 0, 1 ) * x ) +
+    ( params.direct_parameters_( 0, 2 ) * y ) +
+    ( params.direct_parameters_( 0, 3 ) * x * y ) +
+    ( params.direct_parameters_( 0, 4 ) * x * x ) +
+    ( params.direct_parameters_( 0, 5 ) * y * y ) );
+  
+  pt2.y( 
+      params.direct_parameters_( 1, 0 ) +
+    ( params.direct_parameters_( 1, 1 ) * x ) +
+    ( params.direct_parameters_( 1, 2 ) * y ) +
+    ( params.direct_parameters_( 1, 3 ) * x * y ) +
+    ( params.direct_parameters_( 1, 4 ) * x * x ) +
+    ( params.direct_parameters_( 1, 5 ) * y * y ) );
+}
+
+
+void Te2ndDegPolinomialGT::inverseMap( const TeGTParams& params, const TeCoord2D& pt2, 
+  TeCoord2D& pt1 ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ), 
+    "Transformation not defined" );
+  
+  double x = pt2.x();
+  double y = pt2.y();
+
+  pt1.x( 
+      params.inverse_parameters_( 0, 0 ) +
+    ( params.inverse_parameters_( 0, 1 ) * x ) +
+    ( params.inverse_parameters_( 0, 2 ) * y ) +
+    ( params.inverse_parameters_( 0, 3 ) * x * y ) +
+    ( params.inverse_parameters_( 0, 4 ) * x * x ) +
+    ( params.inverse_parameters_( 0, 5 ) * y * y ) );
+  
+  pt1.y( 
+      params.inverse_parameters_( 1, 0 ) +
+    ( params.inverse_parameters_( 1, 1 ) * x ) +
+    ( params.inverse_parameters_( 1, 2 ) * y ) +
+    ( params.inverse_parameters_( 1, 3 ) * x * y ) +
+    ( params.inverse_parameters_( 1, 4 ) * x * x ) +
+    ( params.inverse_parameters_( 1, 5 ) * y * y ) );
+}
+
+
+unsigned int Te2ndDegPolinomialGT::getMinRequiredTiePoints() const
+{
+  return 6;
+}
+
+
+bool Te2ndDegPolinomialGT::computeParameters( TeGTParams& params ) const
+{
+    /* Reference: Remote Sensing - Models and Methods For Image Processing
+                  Second Edition
+                  Robert A. Schowengerdt
+                  Academic Press
+    */
+
+  const unsigned int tiepointsSize = params.tiepoints_.size();
+  TEAGN_DEBUG_CONDITION( ( tiepointsSize > 5 ),
+    "Invalid tie-points size" )
+  TEAGN_DEBUG_CONDITION( params.transformation_name_ == "2ndDegPolinomial",
+    "Invalid transformation name" )     
+    
+  // Initiating matrixes
+    
+  TeMatrix W;
+  TEAGN_TRUE_OR_THROW( W.Init( tiepointsSize, 6 ), "Matrix init error" );
+  
+  TeMatrix WI;
+  TEAGN_TRUE_OR_THROW( WI.Init( tiepointsSize, 6 ), "Matrix init error" );  
+  
+  TeMatrix X;
+  TEAGN_TRUE_OR_THROW( X.Init( tiepointsSize, 1 ), "Matrix init error" );
+  
+  TeMatrix XI;
+  TEAGN_TRUE_OR_THROW( XI.Init( tiepointsSize, 1 ), "Matrix init error" );
+  
+  TeMatrix Y;
+  TEAGN_TRUE_OR_THROW( Y.Init( tiepointsSize, 1 ), "Matrix init error" );
+  
+  TeMatrix YI;
+  TEAGN_TRUE_OR_THROW( YI.Init( tiepointsSize, 1 ), "Matrix init error" );
+  
+  // Creating the equation system parameters
+  
+  double* linePtr = 0;
+    
+  for ( unsigned int tpIdx = 0 ; tpIdx < tiepointsSize ; ++tpIdx ) 
+  {
+    const TeCoordPair& tp = params.tiepoints_[ tpIdx ];
+    
+    linePtr = W[ tpIdx ];
+    linePtr[ 0 ] = 1;
+    linePtr[ 1 ] = tp.pt1.x();
+    linePtr[ 2 ] = tp.pt1.y();
+    linePtr[ 3 ] = tp.pt1.x() * tp.pt1.y();
+    linePtr[ 4 ] = tp.pt1.x() * tp.pt1.x();
+    linePtr[ 5 ] = tp.pt1.y() * tp.pt1.y();
+    
+    linePtr = WI[ tpIdx ];
+    linePtr[ 0 ] = 1;
+    linePtr[ 1 ] = tp.pt2.x();
+    linePtr[ 2 ] = tp.pt2.y();
+    linePtr[ 3 ] = tp.pt2.x() * tp.pt2.y();
+    linePtr[ 4 ] = tp.pt2.x() * tp.pt2.x();
+    linePtr[ 5 ] = tp.pt2.y() * tp.pt2.y();    
+    
+    X( tpIdx, 0 ) = tp.pt2.x();
+    
+    XI( tpIdx, 0 ) = tp.pt1.x();
+    
+    Y( tpIdx, 0 ) = tp.pt2.y();
+    
+    YI( tpIdx, 0 ) = tp.pt1.y();    
+  }
+  
+  // Solving...
+  
+  TeMatrix PinvW;
+  if( ! W.getPinv( PinvW ) ) return false;
+  
+  TeMatrix PinvWI;
+  if( ! WI.getPinv( PinvWI ) ) return false;  
+  
+  TeMatrix A;
+  TEAGN_TRUE_OR_THROW( TeMatrix::getProduct( PinvW, X, A ), "Internal error" );
+  TEAGN_DEBUG_CONDITION( A.Nrow() == 6, "Invalid matrix" );
+  TEAGN_DEBUG_CONDITION( A.Ncol() == 1, "Invalid matrix" );
+    
+  TeMatrix AI;
+  TEAGN_TRUE_OR_THROW( TeMatrix::getProduct( PinvWI, XI, AI ), "Internal error" );
+  TEAGN_DEBUG_CONDITION( AI.Nrow() == 6, "Invalid matrix" );
+  TEAGN_DEBUG_CONDITION( AI.Ncol() == 1, "Invalid matrix" );  
+        
+  TeMatrix B;
+  TEAGN_TRUE_OR_THROW( TeMatrix::getProduct( PinvW, Y, B ), "Internal error" );
+  TEAGN_DEBUG_CONDITION( B.Nrow() == 6, "Invalid matrix" );
+  TEAGN_DEBUG_CONDITION( B.Ncol() == 1, "Invalid matrix" );  
+    
+  TeMatrix BI;
+  TEAGN_TRUE_OR_THROW( TeMatrix::getProduct( PinvWI, YI, BI ), "Internal error" );              
+  TEAGN_DEBUG_CONDITION( BI.Nrow() == 6, "Invalid matrix" );
+  TEAGN_DEBUG_CONDITION( BI.Ncol() == 1, "Invalid matrix" );  
+  
+  // Copying the parameters to output
+  
+  TEAGN_TRUE_OR_THROW( params.direct_parameters_.Init( 2, 6 ), 
+    "Matrix init error" );
+  params.direct_parameters_( 0, 0 ) = A( 0, 0 );
+  params.direct_parameters_( 0, 1 ) = A( 1, 0 );
+  params.direct_parameters_( 0, 2 ) = A( 2, 0 );
+  params.direct_parameters_( 0, 3 ) = A( 3, 0 );
+  params.direct_parameters_( 0, 4 ) = A( 4, 0 );
+  params.direct_parameters_( 0, 5 ) = A( 5, 0 );
+  params.direct_parameters_( 1, 0 ) = B( 0, 0 );
+  params.direct_parameters_( 1, 1 ) = B( 1, 0 );
+  params.direct_parameters_( 1, 2 ) = B( 2, 0 );
+  params.direct_parameters_( 1, 3 ) = B( 3, 0 );
+  params.direct_parameters_( 1, 4 ) = B( 4, 0 );
+  params.direct_parameters_( 1, 5 ) = B( 5, 0 );  
+  
+  TEAGN_TRUE_OR_THROW( params.inverse_parameters_.Init( 2, 6 ), 
+    "Matrix init error" );
+  params.inverse_parameters_( 0, 0 ) = AI( 0, 0 );
+  params.inverse_parameters_( 0, 1 ) = AI( 1, 0 );
+  params.inverse_parameters_( 0, 2 ) = AI( 2, 0 );
+  params.inverse_parameters_( 0, 3 ) = AI( 3, 0 );
+  params.inverse_parameters_( 0, 4 ) = AI( 4, 0 );
+  params.inverse_parameters_( 0, 5 ) = AI( 5, 0 );
+  params.inverse_parameters_( 1, 0 ) = BI( 0, 0 );
+  params.inverse_parameters_( 1, 1 ) = BI( 1, 0 );
+  params.inverse_parameters_( 1, 2 ) = BI( 2, 0 );
+  params.inverse_parameters_( 1, 3 ) = BI( 3, 0 );
+  params.inverse_parameters_( 1, 4 ) = BI( 4, 0 );
+  params.inverse_parameters_( 1, 5 ) = BI( 5, 0 );   
+
+  return true;
+}
+
+
+bool Te2ndDegPolinomialGT::isTransDefined( const TeGTParams& params )  const
+{
+  if( ( params.transformation_name_ == "2ndDegPolinomial" ) &&
+    ( params.direct_parameters_.Nrow() == 2 ) &&
+    ( params.direct_parameters_.Ncol() == 6 ) &&
+    ( params.inverse_parameters_.Nrow() == 2 ) &&
+    ( params.inverse_parameters_.Ncol() == 6 ) )
+  {
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
diff --git a/src/terralib/kernel/Te2ndDegPolinomialGT.h b/src/terralib/kernel/Te2ndDegPolinomialGT.h
new file mode 100644
index 0000000..e6ceaf2
--- /dev/null
+++ b/src/terralib/kernel/Te2ndDegPolinomialGT.h
@@ -0,0 +1,69 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file Te2ndDegPolinomialGT.h
+   \brief Second degree polinomial model geometric trasformation.
+*/
+
+
+#ifndef TE2NDDEGPOLINOMIALGT_H
+  #define TE2NDDEGPOLINOMIALGT_H
+  
+  #include <TeDefines.h>
+  #include <TeGeometricTransformation.h>
+
+  /**
+   * @brief Second degree polinomial model geometric trasformation
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup GeometricTransformationGroup
+   *
+   * @note The pseudo-inverse aproach is used to find the equation system parameters.
+   */
+  class TL_DLL Te2ndDegPolinomialGT : public TeGeometricTransformation {
+    public :
+
+      Te2ndDegPolinomialGT();
+    
+      ~Te2ndDegPolinomialGT();
+      
+      //overload       
+      unsigned int getMinRequiredTiePoints() const;      
+      
+    protected :
+    
+      //overload    
+      void directMap( const TeGTParams& params, const TeCoord2D& pt1, 
+        TeCoord2D& pt2 ) const;
+      
+      //overload      
+      void inverseMap( const TeGTParams& params, const TeCoord2D& pt2, 
+        TeCoord2D& pt1 ) const;      
+      
+      //overload     
+      bool computeParameters( TeGTParams& params ) const;
+      
+      //overload      
+      bool isTransDefined( const TeGTParams& params ) const;        
+  };
+  
+#endif
+
diff --git a/src/terralib/kernel/Te2ndDegPolinomialGTFactory.cpp b/src/terralib/kernel/Te2ndDegPolinomialGTFactory.cpp
new file mode 100644
index 0000000..52b9de5
--- /dev/null
+++ b/src/terralib/kernel/Te2ndDegPolinomialGTFactory.cpp
@@ -0,0 +1,48 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "Te2ndDegPolinomialGTFactory.h"
+#include "Te2ndDegPolinomialGT.h"
+#include "TeException.h"
+
+Te2ndDegPolinomialGTFactory::Te2ndDegPolinomialGTFactory()
+: TeGTFactory( std::string( "2ndDegPolinomial" ) )
+{
+};      
+
+Te2ndDegPolinomialGTFactory::~Te2ndDegPolinomialGTFactory()
+{
+};
+
+
+TeGeometricTransformation* Te2ndDegPolinomialGTFactory::build ( 
+  const TeGTParams& )
+{
+  TeGeometricTransformation* instance_ptr = new Te2ndDegPolinomialGT();
+  
+  if( ! instance_ptr ) {
+    throw TeException( FACTORY_PRODUCT_INSTATIATION_ERROR );
+  }
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/kernel/Te2ndDegPolinomialGTFactory.h b/src/terralib/kernel/Te2ndDegPolinomialGTFactory.h
new file mode 100644
index 0000000..2c87516
--- /dev/null
+++ b/src/terralib/kernel/Te2ndDegPolinomialGTFactory.h
@@ -0,0 +1,60 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file Te2ndDegPolinomialGTFactory.h
+    \brief Second degree polinomial model geometric trasformation factory
+*/
+
+#ifndef TE2NDDEGPOLINOMIALGTFACCTORY_H
+  #define TE2NDDEGPOLINOMIALGTFACCTORY_H
+  
+  #include "TeDefines.h"
+  #include "TeGTFactory.h"
+
+  /**
+   * @brief Second degree polinomial model geometric trasformation factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup GeometricTransformationGroup
+   */
+  class TL_DLL Te2ndDegPolinomialGTFactory : public TeGTFactory
+  {
+    public :
+
+      Te2ndDegPolinomialGTFactory();      
+
+      ~Te2ndDegPolinomialGTFactory();
+      
+    protected :  
+    
+      //overload
+      TeGeometricTransformation* build( const TeGTParams& arg );
+      
+  };
+
+  namespace
+  {  
+    /** @brief A concrete factory instance for registering into the factory dictionary */
+    static Te2ndDegPolinomialGTFactory Te2ndDegPolinomialGTFactory_instance;
+  };
+  
+#endif
+
diff --git a/src/terralib/kernel/TeAbstractFactory.h b/src/terralib/kernel/TeAbstractFactory.h
old mode 100755
new mode 100644
index 46a1d4a..ead298a
--- a/src/terralib/kernel/TeAbstractFactory.h
+++ b/src/terralib/kernel/TeAbstractFactory.h
@@ -1,145 +1,145 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeAbstractFactory.h
-	\brief Implements a template for the Abstract Factory pattern
-*/
-#ifndef  __TERRALIB_INTERNAL_NEW_FACTORY_H
-#define  __TERRALIB_INTERNAL_NEW_FACTORY_H
-
-#include "TeDefines.h"
-#include <map>
-#include <string>
-
-using std::map;
-using std::string;
-
-//!  Implements a template for the Abstract Factory pattern.
-/*
-    This file implements a templated version of the Abstract Factory Pattern 
-	See: "Design Patterns - Elements of Reusable Object-Oriented Software", by Gamma et. al
-	page 87.
-  \author Gilberto Camara, L�bia Vinhas
-*/
-template <typename PRODUCT,						// The product to be made
-		  typename PARAMS,						// The parameter necessary to make the product
-		  typename PRODUCTIDTYPE=std::string>	// The type used to identify the product
-class TeAbstractFactory
-{
-public:
-
-	//! To link each product to its factory
-	typedef map<PRODUCTIDTYPE, TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>* > TeFactoryMap; 
-
-	//! Returns the single instance of the factory registration
-	static TeFactoryMap& instance()
-	{ 
-		static TeFactoryMap Fmap_;
-		return Fmap_;
-	}
-
-protected:
-
-	//!  Builds a new product from a set of parameters (should be implemented by descendants)
-    virtual PRODUCT* build(PARAMS* /*arg*/)
-	{ 
-		return PRODUCT::DefaultObject(); 
-	}
-
- 	//!  Builds a new product without parameters (should be implemented by descendants)
-   virtual PRODUCT* build()
-	{ 
-		return PRODUCT::DefaultObject(); 
-	}
-
-public:
-	//! Factory Constructor
-	/*
-		\param prodId the identification of the product that the factory produces
-	*/
-	TeAbstractFactory(PRODUCTIDTYPE prodId);
-
-	//! Destructor
-	virtual ~TeAbstractFactory() {}
-
-	//! Virtual constructor: make the product from some arguments
-	/*
-		\param arg a pointer to an structure that contains the arguments
-		necessary to build the product. The type of product has to be extracted
-		from the arguments
-	*/
-	static PRODUCT* make(PARAMS* arg);
-
-	//! Virtual constructor: explictly identifies which product should be made
-	static PRODUCT* make(PRODUCTIDTYPE prodId);
-
-private:
-	PRODUCTIDTYPE  productIdentification_;
-};
-
-// Factor Constructor
-template <typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE>
-TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::TeAbstractFactory(PRODUCTIDTYPE prodId):
-	productIdentification_(prodId)
-{
-	TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance()[prodId] = this;
-}
-
-//! Builds an object, based on the input parameters
-template <typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE> 
-PRODUCT*
-TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::make(PRODUCTIDTYPE producId)
-{
-	// try to find the name on the factory dictionary
-	typename TeFactoryMap::iterator i = TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().find(producId);
-
-	// Not found ?  return the Default Object   
-	if (i == TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().end())
-		return PRODUCT::DefaultObject();
-
-	// Create an object, based on the input parameters
-	return (*i).second->build();
-}
-
-//! Builds an object, based on the input parameters
-template <typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE> 
-PRODUCT*
-TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::make(PARAMS* arg)
-{
-	// If there are no arguments or factory identification return the default object
-	if (!arg)
-		return PRODUCT::DefaultObject();
-
-	PRODUCTIDTYPE productId = arg->getProductId(); 
-
-	// try to find the name on the factory dictionary
-	typename TeFactoryMap::iterator i = TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().find(productId);
-
-	// Not found ?  return the Default Object   
-	if (i == TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().end())
-		return PRODUCT::DefaultObject();
-
-	// Create an object, based on the input parameters
-		return (*i).second->build(arg);
-}
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAbstractFactory.h
+	\brief Implements a template for the Abstract Factory pattern
+*/
+#ifndef  __TERRALIB_INTERNAL_NEW_FACTORY_H
+#define  __TERRALIB_INTERNAL_NEW_FACTORY_H
+
+#include "TeDefines.h"
+#include <map>
+#include <string>
+
+using std::map;
+using std::string;
+
+//!  Implements a template for the Abstract Factory pattern.
+/*
+    This file implements a templated version of the Abstract Factory Pattern 
+	See: "Design Patterns - Elements of Reusable Object-Oriented Software", by Gamma et. al
+	page 87.
+  \author Gilberto Camara, L�bia Vinhas
+*/
+template <typename PRODUCT,						// The product to be made
+		  typename PARAMS,						// The parameter necessary to make the product
+		  typename PRODUCTIDTYPE=std::string>	// The type used to identify the product
+class TeAbstractFactory
+{
+public:
+
+	//! To link each product to its factory
+	typedef map<PRODUCTIDTYPE, TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>* > TeFactoryMap; 
+
+	//! Returns the single instance of the factory registration
+	static TeFactoryMap& instance()
+	{ 
+		static TeFactoryMap Fmap_;
+		return Fmap_;
+	}
+
+protected:
+
+	//!  Builds a new product from a set of parameters (should be implemented by descendants)
+    virtual PRODUCT* build(PARAMS* /*arg*/)
+	{ 
+		return PRODUCT::DefaultObject(); 
+	}
+
+ 	//!  Builds a new product without parameters (should be implemented by descendants)
+   virtual PRODUCT* build()
+	{ 
+		return PRODUCT::DefaultObject(); 
+	}
+
+public:
+	//! Factory Constructor
+	/*
+		\param prodId the identification of the product that the factory produces
+	*/
+	TeAbstractFactory(PRODUCTIDTYPE prodId);
+
+	//! Destructor
+	virtual ~TeAbstractFactory() {}
+
+	//! Virtual constructor: make the product from some arguments
+	/*
+		\param arg a pointer to an structure that contains the arguments
+		necessary to build the product. The type of product has to be extracted
+		from the arguments
+	*/
+	static PRODUCT* make(PARAMS* arg);
+
+	//! Virtual constructor: explictly identifies which product should be made
+	static PRODUCT* make(PRODUCTIDTYPE prodId);
+
+private:
+	PRODUCTIDTYPE  productIdentification_;
+};
+
+// Factor Constructor
+template <typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE>
+TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::TeAbstractFactory(PRODUCTIDTYPE prodId):
+	productIdentification_(prodId)
+{
+	TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance()[prodId] = this;
+}
+
+//! Builds an object, based on the input parameters
+template <typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE> 
+PRODUCT*
+TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::make(PRODUCTIDTYPE producId)
+{
+	// try to find the name on the factory dictionary
+	typename TeFactoryMap::iterator i = TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().find(producId);
+
+	// Not found ?  return the Default Object   
+	if (i == TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().end())
+		return PRODUCT::DefaultObject();
+
+	// Create an object, based on the input parameters
+	return (*i).second->build();
+}
+
+//! Builds an object, based on the input parameters
+template <typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE> 
+PRODUCT*
+TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::make(PARAMS* arg)
+{
+	// If there are no arguments or factory identification return the default object
+	if (!arg)
+		return PRODUCT::DefaultObject();
+
+	PRODUCTIDTYPE productId = arg->getProductId(); 
+
+	// try to find the name on the factory dictionary
+	typename TeFactoryMap::iterator i = TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().find(productId);
+
+	// Not found ?  return the Default Object   
+	if (i == TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().end())
+		return PRODUCT::DefaultObject();
+
+	// Create an object, based on the input parameters
+		return (*i).second->build(arg);
+}
+#endif
+
diff --git a/src/terralib/kernel/TeAbstractTheme.cpp b/src/terralib/kernel/TeAbstractTheme.cpp
index fdddf9f..4514b68 100644
--- a/src/terralib/kernel/TeAbstractTheme.cpp
+++ b/src/terralib/kernel/TeAbstractTheme.cpp
@@ -1,1294 +1,1329 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeAbstractTheme.h"
-#include "TeVisual.h"
-#include "TeRasterTransform.h"
-#include "TeDatabase.h"
-
-extern int  yyparse(string& sqlOut);
-extern int  initParse(const string& strIn, TeDatabase* db);
-
-TeAbstractTheme::TeAbstractTheme(const string& name, TeViewNode* parent, const int& view, const int& id, const TeViewNodeType& nodeType)
-		: TeViewNode(name, parent, view, id, nodeType),
-		generateAttributeRest_(""),
-		generateTemporalRest_(""),
-		hasSpatialRes_(false),
-		geomRest_(0),
-		minScale_(0.0),
-		maxScale_(0.0),
-		visibleRep_(0),
-		enableVisibility_(1),
-		rasterVisual_(0),
-		themeBox_(TeBox())
-{
-	grouping_.groupMode_ = TeNoGrouping;
-
-	//default legends
-	TeVisual* visp = new TeVisual(TePOLYGONS);
-	TeVisual* visl = new TeVisual(TeLINES);
-	TeVisual* vispt = new TeVisual(TePOINTS);
-	TeVisual* vist = new TeVisual(TeTEXT);
-
-	TeColor	color;
-	color.init(100, 220, 220);
-	visp->color(color);
-	visl->color(color);
-	vispt->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);
-	visl->contourColor(color);
-	vispt->contourColor(color);
-
-	outOfCollectionLegend_.setVisual(visp->copy(), TePOLYGONS);		
-	outOfCollectionLegend_.setVisual(visl->copy(), TeLINES);		
-	outOfCollectionLegend_.setVisual(vispt->copy(), TePOINTS);		
-	outOfCollectionLegend_.setVisual(vist->copy(), TeTEXT);	
-
-	color.init(220, 100, 220);
-	visp->color(color);
-	visl->color(color);
-	vispt->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);
-	visl->contourColor(color);
-	vispt->contourColor(color);
-
-	withoutDataConnectionLegend_.setVisual(visp->copy(), TePOLYGONS);		
-	withoutDataConnectionLegend_.setVisual(visl->copy(), TeLINES);		
-	withoutDataConnectionLegend_.setVisual(vispt->copy(), TePOINTS);		
-	withoutDataConnectionLegend_.setVisual(vist->copy(), TeTEXT);	
-
-	color.init(220, 0, 0);
-	visp->color(color);
-	color.init(0, 220, 220);
-	visl->color(color);
-	color.init(220, 90, 180);
-	vispt->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);
-	visl->contourColor(color);
-	vispt->contourColor(color);
-	color.init(0, 0, 0);
-	vist->color(color);
-
-	defaultLegend_.setVisual(visp->copy(), TePOLYGONS);		
-	defaultLegend_.setVisual(visl->copy(), TeLINES);		
-	defaultLegend_.setVisual(vispt->copy(), TePOINTS);		
-	defaultLegend_.setVisual(vist->copy(), TeTEXT);		
-	
-	color.init(80, 240, 100);
-	visp->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);
-	pointingLegend_.setVisual(visp->copy(), TePOLYGONS);		
-	pointingLegend_.setVisual(visl->copy(), TeLINES);		
-	pointingLegend_.setVisual(vispt->copy(), TePOINTS);		
-	pointingLegend_.setVisual(vist->copy(), TeTEXT);	
-
-	color.init(210, 210, 0);
-	visp->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);		
-	queryLegend_.setVisual(visp->copy(), TePOLYGONS);		
-	queryLegend_.setVisual(visl->copy(), TeLINES);		
-	queryLegend_.setVisual(vispt->copy(), TePOINTS);		
-	queryLegend_.setVisual(vist->copy(), TeTEXT);	
-							
-	color.init(255, 255, 0);
-	visp->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);		
-	queryAndPointingLegend_.setVisual(visp->copy(), TePOLYGONS);	
-	queryAndPointingLegend_.setVisual(visl->copy(), TeLINES);		
-	queryAndPointingLegend_.setVisual(vispt->copy(), TePOINTS);		
-	queryAndPointingLegend_.setVisual(vist->copy(), TeTEXT);	
-
-	delete visp;
-	delete visl;
-	delete vispt;
-	delete vist;
-
-	creationTime_.now();
-}
-
-TeAbstractTheme::TeAbstractTheme(const TeViewNodeParams& params) : 
-		TeViewNode(params),
-		generateAttributeRest_(""),
-		generateTemporalRest_(""),
-		hasSpatialRes_(false),
-		geomRest_(0),
-		minScale_(0.0),
-		maxScale_(0.0),
-		visibleRep_(0),
-		enableVisibility_(1),
-		rasterVisual_(0),
-		themeBox_(TeBox())
-{
-	grouping_.groupMode_ = TeNoGrouping;
-	//default legends
-	TeVisual* visp = new TeVisual(TePOLYGONS);
-	TeVisual* visl = new TeVisual(TeLINES);
-	TeVisual* vispt = new TeVisual(TePOINTS);
-	TeVisual* vist = new TeVisual(TeTEXT);
-	TeColor	color;
-	color.init(100, 220, 220);
-	visp->color(color);
-	visl->color(color);
-	vispt->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);
-	visl->contourColor(color);
-	vispt->contourColor(color);
-
-	outOfCollectionLegend_.setVisual(visp->copy(), TePOLYGONS);		
-	outOfCollectionLegend_.setVisual(visl->copy(), TeLINES);		
-	outOfCollectionLegend_.setVisual(vispt->copy(), TePOINTS);		
-	outOfCollectionLegend_.setVisual(vist->copy(), TeTEXT);	
-
-	color.init(220, 100, 220);
-	visp->color(color);
-	visl->color(color);
-	vispt->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);
-	visl->contourColor(color);
-	vispt->contourColor(color);
-
-	withoutDataConnectionLegend_.setVisual(visp->copy(), TePOLYGONS);		
-	withoutDataConnectionLegend_.setVisual(visl->copy(), TeLINES);		
-	withoutDataConnectionLegend_.setVisual(vispt->copy(), TePOINTS);		
-	withoutDataConnectionLegend_.setVisual(vist->copy(), TeTEXT);	
-
-	color.init(220, 0, 0);
-	visp->color(color);
-	color.init(0, 220, 220);
-	visl->color(color);
-	color.init(220, 90, 180);
-	vispt->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);
-	visl->contourColor(color);
-	vispt->contourColor(color);
-	color.init(0, 0, 0);
-	vist->color(color);
-
-	defaultLegend_.setVisual(visp->copy(), TePOLYGONS);		
-	defaultLegend_.setVisual(visl->copy(), TeLINES);		
-	defaultLegend_.setVisual(vispt->copy(), TePOINTS);		
-	defaultLegend_.setVisual(vist->copy(), TeTEXT);		
-	
-	color.init(80, 240, 100);
-	visp->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);
-	pointingLegend_.setVisual(visp->copy(), TePOLYGONS);		
-	pointingLegend_.setVisual(visl->copy(), TeLINES);		
-	pointingLegend_.setVisual(vispt->copy(), TePOINTS);		
-	pointingLegend_.setVisual(vist->copy(), TeTEXT);	
-
-	color.init(210, 210, 0);
-	visp->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);		
-	queryLegend_.setVisual(visp->copy(), TePOLYGONS);		
-	queryLegend_.setVisual(visl->copy(), TeLINES);		
-	queryLegend_.setVisual(vispt->copy(), TePOINTS);		
-	queryLegend_.setVisual(vist->copy(), TeTEXT);	
-							
-	color.init(255, 255, 0);
-	visp->color(color);
-	color.init(100, 100, 100);
-	visp->contourColor(color);		
-	queryAndPointingLegend_.setVisual(visp->copy(), TePOLYGONS);	
-	queryAndPointingLegend_.setVisual(visl->copy(), TeLINES);		
-	queryAndPointingLegend_.setVisual(vispt->copy(), TePOINTS);		
-	queryAndPointingLegend_.setVisual(vist->copy(), TeTEXT);
-
-	delete visp;
-	delete visl;
-	delete vispt;
-	delete vist;
-
-	creationTime_.now();
-}
-
-//! Copy constructor
-TeAbstractTheme::TeAbstractTheme (const TeAbstractTheme& other) : 
-	TeViewNode(other.viewNodeParams_) 
-{
-	generateAttributeRest_ = other.generateAttributeRest_;
-	generateTemporalRest_ = other.generateTemporalRest_;
-	generateSpatialRest_ = other.generateSpatialRest_; 
-	spatialRelation_ = other.spatialRelation_;
-	hasSpatialRes_ =  other.hasSpatialRes_;
-	boxRest_ = other.boxRest_;
-	geomRest_ = other.geomRest_; 
-	geomRepRest_ = other.geomRepRest_;	
-	minScale_ = other.minScale_;
-	maxScale_ = other.maxScale_;
-	visibleRep_ = other.visibleRep_;
-	enableVisibility_ = other.enableVisibility_;
-
-	grouping_ = other.grouping_;
-
-	cleanLegend();
-	legend_.resize(other.legend_.size());
-	copy(other.legend_.begin(),other.legend_.end(),legend_.begin());
-	outOfCollectionLegend_ = other.outOfCollectionLegend_;
-	withoutDataConnectionLegend_ = other.withoutDataConnectionLegend_;	
-	defaultLegend_ = other.defaultLegend_;
-	pointingLegend_ = other.pointingLegend_;
-	queryLegend_ = other.queryLegend_;
-	queryAndPointingLegend_ = other.queryAndPointingLegend_; 
-	
-	objectSet_ = other.objectSet_;
-	numLayerObjects_ = other.numLayerObjects_;
-	itemStatusMap_ = other.itemStatusMap_;
-	objStatusMap_ = other.objStatusMap_;
-	rasterVisual_ = 0;
-	if(other.rasterVisual_)
-	{
-		rasterVisual_ = new TeRasterTransform();
-		(*rasterVisual_) = (*other.rasterVisual_);
-	}
-	themeBox_ = other.themeBox_;
-	creationTime_ = other.creationTime_;
-}
-
-//! Destructor
-TeAbstractTheme::~TeAbstractTheme () 
-{ 
-	if (rasterVisual_)
-		delete rasterVisual_;
-	generateAttributeRest_.clear();
-	generateTemporalRest_.clear();
-	generateSpatialRest_.clear();
-	cleanLegend();
-	outOfCollectionLegend_.clear();
-	withoutDataConnectionLegend_.clear();
-	defaultLegend_.clear(); 
-	pointingLegend_.clear(); 
-	queryLegend_.clear(); 
-	queryAndPointingLegend_.clear();
-}
-
-TeAbstractTheme& 
-TeAbstractTheme::operator= (const TeAbstractTheme& other)
-{
-	if ( this != &other )
-	{
-		viewNodeParams_ = other.viewNodeParams_;
-		
-		generateAttributeRest_ = other.generateAttributeRest_;
-		generateTemporalRest_ = other.generateTemporalRest_;
-		generateSpatialRest_ = other.generateSpatialRest_; 
-		spatialRelation_ = other.spatialRelation_;
-		hasSpatialRes_ =  other.hasSpatialRes_;
-		boxRest_ = other.boxRest_;
-		geomRest_ = other.geomRest_; 
-		geomRepRest_ = other.geomRepRest_;	
-		minScale_ = other.minScale_;
-		maxScale_ = other.maxScale_;
-		visibleRep_ = other.visibleRep_;
-		enableVisibility_ = other.enableVisibility_;
-
-		grouping_ = other.grouping_;
-
-		cleanLegend();
-		legend_.resize(other.legend_.size());
-		copy(other.legend_.begin(),other.legend_.end(),legend_.begin());
-		outOfCollectionLegend_ = other.outOfCollectionLegend_;
-		withoutDataConnectionLegend_ = other.withoutDataConnectionLegend_;	
-		defaultLegend_ = other.defaultLegend_;
-		pointingLegend_ = other.pointingLegend_;
-		queryLegend_ = other.queryLegend_;
-		queryAndPointingLegend_ = other.queryAndPointingLegend_; 
-		
-		objectSet_ = other.objectSet_;
-		numLayerObjects_ = other.numLayerObjects_;
-		itemStatusMap_ = other.itemStatusMap_;
-		objStatusMap_ = other.objStatusMap_;
-	
-		if(rasterVisual_)
-			delete rasterVisual_;
-		rasterVisual_ = 0;
-		if(other.rasterVisual_)
-		{
-			rasterVisual_ = new TeRasterTransform();
-			(*rasterVisual_) = (*other.rasterVisual_);
-		}
-		themeBox_ = other.themeBox_;
-		creationTime_ = other.creationTime_;
-	}
-	return *this;
-}
-
-int TeAbstractTheme::visibleGeoRep()
-{
-	return (visibleRep_ & ~0x40000000 & ~0x80000000 & ~0x20000000);
-}
-
-void TeAbstractTheme::removeRasterVisual()
-{ 
-	if (rasterVisual_)
-	{
-		delete rasterVisual_;
-		rasterVisual_ = 0;
-	}
-}
-
-void TeAbstractTheme::cleanLegend()
-{
-   while (legend_.size())     
-   {
-       legend_[0].clear();
-       legend_.erase(legend_.begin());
-   }
-   legend_.clear(); 
-}
-
-void 
-TeAbstractTheme::setSpatialRest(TeBox& box, TeGeomRep rep, TeSpatialRelation relation)
-{
-	hasSpatialRes_ = true;
-	boxRest_ = box;
-	spatialRelation_ = relation;
-	geomRepRest_ = rep;
-	geomRest_ = 0;
-}
-
-void 
-TeAbstractTheme::setSpatialRest(TeGeometry* geom, TeGeomRep rep, TeSpatialRelation relation)
-{
-	hasSpatialRes_ = true;
-	geomRest_ = geom;
-	spatialRelation_ = relation;
-	geomRepRest_ = rep;
-	boxRest_ = TeBox();
-}
-
-void TeAbstractTheme::legend (TeLegendEntry& leg)
-{
-	if(leg.group() == -6)	// queried and pointed objects visual
-		queryAndPointingLegend_ = leg;
-	else if(leg.group() == -5)	// queried objects visual
-		queryLegend_ = leg;
-	else if (leg.group() == -4)
-		pointingLegend_ = leg;
-	else if (leg.group() == -3)
-		defaultLegend_ = leg;
-	else if (leg.group() == -2)
-		withoutDataConnectionLegend_ = leg;
-	else if (leg.group() == -1)
-		outOfCollectionLegend_ = leg;
-	else if (leg.group() > -1)
-		legend_.push_back (leg);
-}
-
-void 
-TeAbstractTheme::resetGrouping ()
-{
-	if((grouping_.groupMode_ == TeRasterSlicing) && rasterVisual_)
-			this->removeRasterVisual();
-
-	grouping_.groupMode_ = TeNoGrouping;
-	legend_.clear();
-	return;
-}
-
-bool 
-TeAbstractTheme::buildGrouping(const TeGrouping& g, vector<TeSlice>& slices)
-{
-	grouping_ = g;
-	legend_.clear(); 
-	
-	for(unsigned int j=0; j<slices.size(); j++)
-	{
-		TeLegendEntry legend(slices[j]);
-		legend.group(j);
-		legend.theme(id());
-		legend_.push_back(legend);
-	}	
-	return true;
-}
-
-bool
-TeAbstractTheme::setGroupingVisual(int n, TeVisual* visual, TeGeomRep rep)
-{
-	if(	(n > grouping_.groupNumSlices_)	||
-		((int)legend_.size() < n)				|| 
-		(legend_.empty()) )
-		return false;
-	legend_[(n-1)].setVisual (visual->copy(), rep); 
-	return true;
-}
-
-bool
-TeAbstractTheme::setGroupingVisual(int n, TeGeomRepVisualMap& vismap)
-{
-	if(	(n > grouping_.groupNumSlices_)	||
-		((int)legend_.size() < n)		|| 
-		(legend_.empty()) )
-		return false;
-
-	TeGeomRepVisualMap::iterator it = vismap.begin();
-	while (it != vismap.end())
-	{
-		legend_[(n-1)].setVisual(it->second->copy(),it->first);
-		++it;
-	}
-	return true;
-}
-
-TeSliceVector 
-TeAbstractTheme::getSlices()
-{
-	TeSliceVector sliceVec;
-	for(unsigned int x=0; x<legend_.size(); ++x)
-	{
-		TeSlice slice = legend_[x].slice();
-		sliceVec.push_back (slice);
-	}
-	return sliceVec;
-}
-
-
-
-void TeAbstractTheme::createRasterVisual(TeRaster* rst)
-{
-	if (rasterVisual_)
-		delete rasterVisual_;
-
-	if (!rst)
-		return;
-
-	rasterVisual_ = new TeRasterTransform();
-										
-	if (rst->params().photometric_[0] == TeRasterParams::TePallete)  // raster palette -> uses its palette
-	{
-		rasterVisual_->setTransfFunction(&TeRasterTransform::Pallete2ThreeBand);
-		rasterVisual_->setLutSize(rst->params().lutr_.size());
-		return;
-	}
-
-	if (visibleRep_ & 0x40000000  &&		// sliced raster -> generate the
-		grouping_.groupMode_ == TeRasterSlicing)	// appropriate palette
-	{
-		int band = atoi(grouping_.groupAttribute_.name_.c_str());
-		rasterVisual_->setSrcBand(band);
-		if (rst->params().dataType_[band] != TeUNSIGNEDCHAR)
-			rasterVisual_->generateLUT(legend_, 1024, defaultLegend_.visual(TePOLYGONS)->color());
-		else
-			rasterVisual_->generateLUT(legend_, 256, defaultLegend_.visual(TePOLYGONS)->color());
-		rasterVisual_->setTransfFunction(&TeRasterTransform::LUT2ThreeBand);
-		return;
-	}
-
-	if (rst->params().dataType_[0] != TeUNSIGNEDCHAR)	// non unsigned char -> generate linear transformation
-		rasterVisual_->setLinearTransfParameters(rst->params().vmin_[0],rst->params().vmax_[0], 0, 255);
-
-	if (rst->params().nBands() == 1)				
-		rasterVisual_->setTransfFunction(&TeRasterTransform::Mono2ThreeBand);
-	else if (rst->params().nBands() == 3)
-		rasterVisual_->setTransfFunction(&TeRasterTransform::ThreeBand2RGB);
-	else
-		rasterVisual_->setTransfFunction(&TeRasterTransform::Band2Band);
-}
-
-void TeAbstractTheme::setParent (TeViewNode* )
-{
-}
-
-void TeAbstractTheme::setStatus(vector<string>& oidVec, vector<string>& itemVec, int status)
-{
-	vector<string>::iterator it;
-
-	if(status == 0)
-	{
-		for(it=oidVec.begin(); it!=oidVec.end();++it)
-		{
-			string s = *it;
-			if(objStatusMap_.find(s) != objStatusMap_.end())
-				objStatusMap_.erase(s);
-		}
-		for(it=itemVec.begin(); it!=itemVec.end();++it)
-		{
-			string s = *it;
-			if(itemStatusMap_.find(s) != itemStatusMap_.end())
-				itemStatusMap_.erase(s);
-		}
-	}
-	else
-	{
-		for(it=oidVec.begin(); it!=oidVec.end();++it)
-		{
-			string s = *it;
-			objStatusMap_[s] = status;
-		}
-		for(it=itemVec.begin(); it!=itemVec.end();++it)
-		{
-			string s = *it;
-			itemStatusMap_[s] = status;
-		}
-	}
-}
-
-void TeAbstractTheme::setStatusForObjectToggled(string oid)
-{
-	string uid;
-
-	int& oidStatus = objStatusMap_[oid];
-	if (oidStatus == TeDEFAULT)
-		oidStatus = TePOINTED;
-	else if (oidStatus == TePOINTED)
-		oidStatus = TeDEFAULT;
-	else if (oidStatus == TeQUERIED)
-		oidStatus = TePOINTED_QUERIED;
-	else if (oidStatus == TePOINTED_QUERIED)
-		oidStatus = TeQUERIED;
-
-	set<string> oidSet;
-	oidSet.insert(oid);
-	vector<string> uidVec = getItemVector(oidSet);
-	for (unsigned int i = 0; i < uidVec.size(); ++i)
-	{
-		uid = uidVec[i];
-		int& uidStatus = itemStatusMap_[uidVec[i]];
-		if (uidStatus == TeDEFAULT)
-		{
-			if (oidStatus == TePOINTED || oidStatus == TePOINTED_QUERIED)
-				uidStatus = TePOINTED;
-		}
-		else if (uidStatus == TePOINTED)
-		{
-			if (oidStatus == TeDEFAULT || oidStatus == TeQUERIED)
-				itemStatusMap_.erase(uid);
-		}
-		else if (uidStatus == TeQUERIED)
-		{
-			if (oidStatus == TePOINTED || oidStatus == TePOINTED_QUERIED)
-				uidStatus = TePOINTED_QUERIED;
-		}
-		else if (uidStatus == TePOINTED_QUERIED)
-		{
-			if (oidStatus == TeDEFAULT || oidStatus == TeQUERIED)
-				uidStatus = TeQUERIED;
-		}
-	}
-	
-	// Save the status id of the object
-	if (oidStatus == TeDEFAULT)
-		objStatusMap_.erase(oid);
-}
-
-void TeAbstractTheme::setStatusForItemsToggled(set<string>& oidSet, vector<string>& uidVec)
-{
-	unsigned int i;
-	int oidStatus;
-	string oid, uid;
-	set<string>::iterator it;
-
-	// Set the new status of the uids
-	for (i = 0; i < uidVec.size(); ++i)
-	{
-		uid = uidVec[i];
-		if (itemStatusMap_[uid] == TeDEFAULT)
-			itemStatusMap_[uid] = TePOINTED;
-		else if (itemStatusMap_[uid] == TePOINTED)
-			itemStatusMap_.erase(uid);
-		else if (itemStatusMap_[uid] == TeQUERIED)
-			itemStatusMap_[uid] = TePOINTED_QUERIED;
-		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
-			itemStatusMap_[uid] = TeQUERIED;
-	}
-
-
-	// Set the new status of the oids
-	for (it = oidSet.begin(); it != oidSet.end(); ++it)
-	{
-		oid = *it;
-		oidStatus = 0;
-		set<string> objSet;
-		objSet.insert(oid);
-		vector<string> uidVec = getItemVector(objSet);
-		for (i = 0; i < uidVec.size(); ++i)
-		{
-			uid = uidVec[i];
-			if (itemStatusMap_[uid] == TePOINTED_QUERIED)
-			{
-				oidStatus = TePOINTED_QUERIED;
-				break;
-			}
-			oidStatus = MAX(oidStatus, itemStatusMap_[uid]);
-			if (itemStatusMap_[uid] == TeDEFAULT)
-				itemStatusMap_.erase(uid);
-		}	
-		
-		if (oidStatus == 0)
-			objStatusMap_.erase(oid);
-		else
-			objStatusMap_[oid] = oidStatus;
-	}
-}
-
-void TeAbstractTheme::setStatusForNewItemsQueried(set<string>& oidSet, vector<string>& uidVec)
-{
-	unsigned int i;
-	string oid, uid;
-	vector<string> prevOidQVec;		// previous oids queried
-	vector<string> notInOidSetVec;	// oid is not in oidSet
-	vector<string> defaultVec;		// vector with oids or uids to be set as default
-	map<string, int>::iterator mapIt;
-	set<string>::iterator setIt;
-
-	// Get the previous oids queried
-	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
-	{
-		oid = mapIt->first;
-		if (objStatusMap_[oid] == TeQUERIED || objStatusMap_[oid] == TePOINTED_QUERIED)
-			prevOidQVec.push_back(mapIt->first);
-	}
-
-	// Check if the previous oids queried are in the oidSet; in positive case, remove
-	// them from the oidSet; in negative case, put them in the vector notInOidSetVec
-	for (i = 0; i < prevOidQVec.size(); ++i)
-	{
-		oid = prevOidQVec[i];
-		if (oidSet.find(oid) != oidSet.end())			
-			oidSet.erase(oid);				// object is in the input oidSet
-		else
-			notInOidSetVec.push_back(oid);	// object is not in the input oidSet
-	}
-
-	// For the objects in oidSet, set the queried status for them
-	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
-	{
-		oid = *setIt;
-		if (objStatusMap_[oid] == TeDEFAULT)
-			objStatusMap_[oid] = TeQUERIED;
-		else if (objStatusMap_[oid] == TePOINTED)
-			objStatusMap_[oid] = TePOINTED_QUERIED;
-	}
-
-	// For the objects not in oidSet, insert it in oidSet, and remove their queried status
-	for (i = 0; i < notInOidSetVec.size(); ++i)
-	{
-		oid = notInOidSetVec[i];
-		if (objStatusMap_[oid] == TeQUERIED)
-			defaultVec.push_back(oid);
-		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
-			objStatusMap_[oid] = TePOINTED;
-		
-		oidSet.insert(oid);
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		objStatusMap_.erase(defaultVec[i]);
-
-	// Remove the queried status for the uids that were previously queried
-	defaultVec.clear();
-	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
-	{
-		uid = mapIt->first;
-		if (itemStatusMap_[uid] == TeQUERIED)
-			defaultVec.push_back(uid);
-		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
-			itemStatusMap_[uid] = TePOINTED;			
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		itemStatusMap_.erase(defaultVec[i]);
-
-	// Set the queried status for the input uidVec
-	for (i = 0; i < uidVec.size(); ++i)
-	{
-		uid = uidVec[i];
-		if (itemStatusMap_[uid] == TeDEFAULT)
-			itemStatusMap_[uid] = TeQUERIED;
-		else if (itemStatusMap_[uid] == TePOINTED)
-			itemStatusMap_[uid] = TePOINTED_QUERIED;
-	}
-}
-
-void TeAbstractTheme::setStatusForNewObjectsPointed(set<string>& oidSet)
-{
-	unsigned int i;
-	string oid, uid;
-	set<string> prevOidPointedSet;		// previous oids pointed
-	set<string> objInInputOidSet;		// set containing objects in oidSet
-	set<string> objNotInInputOidSet;	// set containing objects not in oidSet
-	vector<string> defaultVec;		    // vector with oids or uids to be set as default
-	vector<string> uidVec;				// vector of uids
-	map<string, int>::iterator mapIt;
-	set<string>::iterator setIt;
-
-	// Get the previous oids pointed
-	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
-	{
-		oid = mapIt->first;
-		if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TePOINTED_QUERIED)
-			prevOidPointedSet.insert(mapIt->first);
-	}
-
-	// If the set of objects is empty, remove the pointed status of the previous oids and uids
-	if (oidSet.empty())
-	{
-		for (setIt = prevOidPointedSet.begin(); setIt != prevOidPointedSet.end(); ++setIt)
-		{
-			oid = *setIt;
-			if (objStatusMap_[oid] == TePOINTED)
-				defaultVec.push_back(oid);
-			else if (objStatusMap_[oid] == TePOINTED_QUERIED)
-				objStatusMap_[oid] = TeQUERIED;
-
-			oidSet.insert(oid);
-		}
-
-		for (i = 0; i < defaultVec.size(); ++i)
-			objStatusMap_.erase(defaultVec[i]);
-
-		defaultVec.clear();
-//		uidVec = getUidVec(prevOidPointedVec.begin(), prevOidPointedVec.end(), this); 
-		uidVec = getItemVector(prevOidPointedSet); 
-		for (i = 0; i < uidVec.size(); ++i)
-		{
-			uid = uidVec[i];
-			if (itemStatusMap_[uid] == TePOINTED)
-				defaultVec.push_back(uid);
-			else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
-				itemStatusMap_[uid] = TeQUERIED;
-		}
-
-		for (i = 0; i < defaultVec.size(); ++i)
-			itemStatusMap_.erase(defaultVec[i]);
-
-		return;
-	}
-
-	// Check if the previous oids pointed are in the oidSet; in positive case, put
-	// them in objInOidSetVec; in negative case, put them in the objNotInOidSetVec
-	for (setIt = prevOidPointedSet.begin(); setIt != prevOidPointedSet.end(); ++setIt)
-	{
-		oid = *setIt;
-		if (oidSet.find(oid) != oidSet.end())
-			objInInputOidSet.insert(oid);		// object is in the input oidSet
-		else
-			objNotInInputOidSet.insert(oid);	// object is not in the input oidSet
-	}
-
-	// For the objects in oidSet, set the pointed status for them
-	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
-	{
-		oid = *setIt;
-		if (objStatusMap_[oid] == TeDEFAULT)
-			objStatusMap_[oid] = TePOINTED;
-		else if (objStatusMap_[oid] == TeQUERIED)
-			objStatusMap_[oid] = TePOINTED_QUERIED;
-	}
-
-	// For the objects not in oidSet, remove their pointed status
-	defaultVec.clear();
-	for (setIt = objNotInInputOidSet.begin(); setIt != objNotInInputOidSet.end(); ++setIt)
-	{
-		oid = *setIt;
-		if (objStatusMap_[oid] == TePOINTED)
-			defaultVec.push_back(oid);
-		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
-			objStatusMap_[oid] = TeQUERIED;
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		objStatusMap_.erase(defaultVec[i]);
-
-	// For the objects in oidSet, set the pointed status for their uids
-	uidVec = getItemVector(oidSet);
-	for (i = 0; i < uidVec.size(); ++i)
-	{
-		uid = uidVec[i];
-		if (itemStatusMap_[uid] == TeDEFAULT)
-			itemStatusMap_[uid] = TePOINTED;
-		else if (itemStatusMap_[uid] == TeQUERIED)
-			itemStatusMap_[uid] = TePOINTED_QUERIED;
-	}
-
-	// For the objects not in oidSet, remove the pointed status for their uids
-	defaultVec.clear();
-	uidVec = getItemVector(objNotInInputOidSet);
-	for (i = 0; i < uidVec.size(); ++i)
-	{
-		uid = uidVec[i];
-		if (itemStatusMap_[uid] == TePOINTED)
-			defaultVec.push_back(uid);
-		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
-			itemStatusMap_[uid] = TeQUERIED;
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		itemStatusMap_.erase(defaultVec[i]);
-
-	// Insert in the oidSet the objects that are not in the input oidSet
-	for (setIt = objNotInInputOidSet.begin(); setIt != objNotInInputOidSet.end(); ++setIt)
-		oidSet.insert(*setIt);
-
-	// Remove from the oidSet the objects that were in the input oidSet
-	for (setIt = objInInputOidSet.begin(); setIt != objInInputOidSet.end(); ++setIt)
-		oidSet.erase(*setIt);
-}
-
-void TeAbstractTheme::setStatusForNewItemsPointed(vector<string>& itemVec)
-{
-	unsigned int i;
-	string oid, item;
-	map<string, int>::iterator mapIt;
-	vector<string> defaultVec;
-
-	//-----------------------------------------------------------------------
-	// Set the pointing status for the input items
-	//-----------------------------------------------------------------------
-
-	// Remove the pointing status for all the items
-	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
-	{
-		item = mapIt->first;
-		if (itemStatusMap_[item] == TePOINTED)
-			defaultVec.push_back(item);
-		else if (objStatusMap_[item] == TePOINTED_QUERIED)
-			itemStatusMap_[item] = TeQUERIED;
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		itemStatusMap_.erase(defaultVec[i]);
-
-	for (i = 0; i < itemVec.size(); ++i)
-	{
-		item = itemVec[i];
-		if (itemStatusMap_[item] == TeDEFAULT)
-			itemStatusMap_[item] = TePOINTED;
-		else if (itemStatusMap_[item] == TeQUERIED)
-			itemStatusMap_[item] = TePOINTED_QUERIED;	
-	}
-
-	//-----------------------------------------------------------------------
-	// Set the pointing status for the objects associated to the input items
-	//-----------------------------------------------------------------------
-	
-	// Remove the pointing status for all the objects
-	defaultVec.clear();
-	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
-	{
-		oid = mapIt->first;
-		if (objStatusMap_[oid] == TePOINTED)
-			defaultVec.push_back(oid);
-		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
-			objStatusMap_[oid] = TeQUERIED;
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		objStatusMap_.erase(defaultVec[i]);
-
-	// Set the pointing status for the objects associated to the input items
-	set<string> oidSet = getObjects(itemVec);
-	set<string>::iterator setIt;
-	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
-	{
-		oid = *setIt;
-		if (objStatusMap_[oid] == TeDEFAULT)
-			objStatusMap_[oid] = TePOINTED;
-		else if (objStatusMap_[oid] == TeQUERIED)
-			objStatusMap_[oid] = TePOINTED_QUERIED;	
-	}
-}
-
-
-
-void TeAbstractTheme::setStatusForObjectsAddedByPointing(set<string>& oidSet)
-{
-	if (oidSet.empty())
-		return;
-
-	unsigned int i;
-	string oid, uid;
-	vector<string> prevOidPointedVec;	// previous oids pointed
-	vector<string> uidVec;				// vector of uids
-	map<string, int>::iterator mapIt;
-	set<string>::iterator setIt;
-
-	// Get the previous oids pointed
-	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
-	{
-		oid = mapIt->first;
-		if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TePOINTED_QUERIED)
-			prevOidPointedVec.push_back(mapIt->first);
-	}
-
-	// If there is any object in the oidSet that is already in the previous oids pointed,
-	// remove it from the oidSet
-	for (i = 0; i < prevOidPointedVec.size(); ++i)
-	{
-		oid = prevOidPointedVec[i];
-		if (oidSet.find(prevOidPointedVec[i]) != oidSet.end())
-			oidSet.erase(oid);
-	}
-
-	// Set the pointed status for the objects added by pointing
-	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
-	{
-		oid = *setIt;
-		if (objStatusMap_[oid] == TeDEFAULT)
-			objStatusMap_[oid] = TePOINTED;
-		if (objStatusMap_[oid] == TeQUERIED)
-			objStatusMap_[oid] = TePOINTED_QUERIED;
-	}
-
-	// Set the pointed status for the uids of the objects added by pointing
-	uidVec = getItemVector(oidSet);
-	for (i = 0; i < uidVec.size(); ++i)
-	{
-		uid = uidVec[i];
-		if (itemStatusMap_[uid] == TeDEFAULT)
-			itemStatusMap_[uid] = TePOINTED;
-		else if (itemStatusMap_[uid] == TeQUERIED)
-			itemStatusMap_[uid] = TePOINTED_QUERIED;
-	}
-}
-
-void TeAbstractTheme::setStatusForItemsAddedByPointing(vector<string>& itemVec)
-{
-	unsigned int i;
-	string oid, item;
-
-	//-----------------------------------------------------------------------
-	// Set the pointing status for the input items
-	//-----------------------------------------------------------------------
-	for (i = 0; i < itemVec.size(); ++i)
-	{
-		item = itemVec[i];
-		if (itemStatusMap_[item] == TeDEFAULT)
-			itemStatusMap_[item] = TePOINTED;
-		else if (objStatusMap_[item] == TeQUERIED)
-			itemStatusMap_[item] = TePOINTED_QUERIED;
-
-	}
-
-	//-----------------------------------------------------------------------
-	// Set the pointing status for the objects associated to the input items
-	//-----------------------------------------------------------------------
-	set<string> oidSet = getObjects(itemVec);
-	set<string>::iterator setIt;
-	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
-	{
-		oid = *setIt;
-		if (objStatusMap_[oid] == TeDEFAULT)
-			objStatusMap_[oid] = TePOINTED;
-		else if (objStatusMap_[oid] == TeQUERIED)
-			objStatusMap_[oid] = TePOINTED_QUERIED;	
-	}
-}
-
-
-void TeAbstractTheme::setStatusForItemsAddedByQuerying(set<string>& oidSet, vector<string>& uidVec)
-{
-	unsigned int i;
-	string oid, uid;
-	set<string>::iterator setIt;
-
-	// Set the status for the oids in oidSet as "queried"
-	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
-	{
-		oid = *setIt;
-		if (objStatusMap_[oid] == TeDEFAULT)
-			objStatusMap_[oid] = TeQUERIED;
-		else if (objStatusMap_[oid] == TePOINTED)
-			objStatusMap_[oid] = TePOINTED_QUERIED;
-	}
-
-	// Set the new status for the uidVec
-	for (i = 0; i < uidVec.size(); ++i)
-	{
-		uid = uidVec[i];
-		if (itemStatusMap_[uid] == TeDEFAULT)
-			itemStatusMap_[uid] = TeQUERIED;
-		else if (itemStatusMap_[uid] == TePOINTED)
-			itemStatusMap_[uid] = TePOINTED_QUERIED;
-	}
-}
-
-
-void TeAbstractTheme::setStatusForItemsFilteredByQuerying(set<string>& oidSet, vector<string>& uidVec)
-{
-	unsigned int i;
-	string oid, uid;
-	vector<string> prevOidQVec;		// previous oids queried
-	vector<string> notInOidSetVec;	// oid is not in oidSet
-	vector<string> defaultVec;		// vector with oids or uids to be set as default
-	map<string, int>::iterator mapIt;
-	set<string>::iterator setIt;
-
-	// Get the previous oids queried
-	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
-	{
-		oid = mapIt->first;
-		if (objStatusMap_[oid] == TeQUERIED || objStatusMap_[oid] == TePOINTED_QUERIED)
-			prevOidQVec.push_back(mapIt->first);
-	}
-
-	// Check if the previous oids queried are in the oidSet; in positive case, remove
-	// them from the oidSet; in negative case, put them in the vector notInOidSetVec
-	for (i = 0; i < prevOidQVec.size(); ++i)
-	{
-		oid = prevOidQVec[i];
-		if (oidSet.find(oid) != oidSet.end())			
-			oidSet.erase(oid);				// object is in the input oidSet
-		else
-			notInOidSetVec.push_back(oid);	// object is not in the input oidSet
-	}
-
-	// For the objects not in oidSet, insert it in oidSet, and remove their queried status
-	for (i = 0; i < notInOidSetVec.size(); ++i)
-	{
-		oid = notInOidSetVec[i];
-		if (objStatusMap_[oid] == TeQUERIED)
-			defaultVec.push_back(oid);
-		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
-			objStatusMap_[oid] = TePOINTED;
-		
-		oidSet.insert(oid);
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		objStatusMap_.erase(defaultVec[i]);
-
-	// Remove the queried status for the uids that were previously queried
-	defaultVec.clear();
-	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
-	{
-		uid = mapIt->first;
-		if (itemStatusMap_[uid] == TeQUERIED)
-			defaultVec.push_back(uid);
-		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
-			itemStatusMap_[uid] = TePOINTED;			
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		itemStatusMap_.erase(defaultVec[i]);
-
-	// Set the queried status for the input uidVec
-	for (i = 0; i < uidVec.size(); ++i)
-	{
-		uid = uidVec[i];
-		if (itemStatusMap_[uid] == TeDEFAULT)
-			itemStatusMap_[uid] = TeQUERIED;
-		else if (itemStatusMap_[uid] == TePOINTED)
-			itemStatusMap_[uid] = TePOINTED_QUERIED;
-	}
-}
-
-void TeAbstractTheme::removePointingColor()
-{
-	unsigned int i;
-	string oid, uid;
-	vector<string> defaultVec;
-	map<string, int>::iterator mapIt;
-
-	// Remove the pointed status for the objects
-	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
-	{
-		oid = mapIt->first;
-		if (objStatusMap_[oid] == TePOINTED)
-			defaultVec.push_back(oid);
-		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
-			objStatusMap_[oid] = TeQUERIED;
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		objStatusMap_.erase(defaultVec[i]);
-
-	// Remove the pointed status for the uids
-	defaultVec.clear();
-	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
-	{
-		uid = mapIt->first;
-		if (itemStatusMap_[uid] == TePOINTED)
-			defaultVec.push_back(uid);
-		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
-			itemStatusMap_[uid] = TeQUERIED;
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		itemStatusMap_.erase(defaultVec[i]);
-}
-
-
-void TeAbstractTheme::removeQueryColor()
-{
-	unsigned int i;
-	string oid, uid;
-	vector<string> defaultVec;
-	map<string, int>::iterator mapIt;
-
-	// Remove the pointed status for the objects
-	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
-	{
-		oid = mapIt->first;
-		if (objStatusMap_[oid] == TeQUERIED)
-			defaultVec.push_back(oid);
-		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
-			objStatusMap_[oid] = TePOINTED;
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		objStatusMap_.erase(defaultVec[i]);
-
-	// Remove the pointed status for the uids
-	defaultVec.clear();
-	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
-	{
-		uid = mapIt->first;
-		if (itemStatusMap_[uid] == TeQUERIED)
-			defaultVec.push_back(uid);
-		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
-			itemStatusMap_[uid] = TePOINTED;
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		itemStatusMap_.erase(defaultVec[i]);
-}
-
-
-void TeAbstractTheme::invertObjectStatus()
-{
-	unsigned int i;
-	string oid, uid;
-	set<string> objInvToPointedStatusSet;	// objects to be inverted to the pointed status
-	set<string> objInvToDefaultStatusSet;	// objects to be inverted to the default status
-	vector<string> defaultVec;
-	map<string, int>::iterator mapIt;
-	set<string>::const_iterator setIt;
-
-	// Get all the theme objects
-	const set<string>& oidSet = getObjects();
-
-	// Get the objects that are pointed, queried, or pointed and queried
-	// and put their status to the default status, and get the objects
-	// that are in the default status and put them in the pointed status
-	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
-	{
-		oid = *setIt;
-		if (objStatusMap_[oid] == TeDEFAULT)
-		{
-			objStatusMap_[oid] = TePOINTED;
-			objInvToPointedStatusSet.insert(oid);
-		}
-		else if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TeQUERIED ||
-			     objStatusMap_[oid] == TePOINTED_QUERIED)
-		{
-			defaultVec.push_back(oid);
-			objInvToDefaultStatusSet.insert(oid);
-		}
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		objStatusMap_.erase(defaultVec[i]);
-
-	// Set the status for the uids according the status of their objects
-	vector<string> uidVec = getItemVector(objInvToPointedStatusSet);
-	for (i = 0; i < uidVec.size(); ++i)
-		itemStatusMap_[uidVec[i]] = TePOINTED;
-
-	uidVec = getItemVector(objInvToDefaultStatusSet);
-	for (i = 0; i < uidVec.size(); ++i)
-		itemStatusMap_.erase(uidVec[i]);
-}
-
-
-void TeAbstractTheme::setObjectsToDefaultStatus()
-{
-	unsigned int i;
-	string oid, uid;
-	vector<string> defaultVec;
-	map<string, int>::iterator mapIt;
-
-	// Set the default status for objects that are pointed, queried, or pointed and queried
-	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
-	{
-		oid = mapIt->first;
-		if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TeQUERIED ||
-			objStatusMap_[oid] == TePOINTED_QUERIED)
-			defaultVec.push_back(oid);
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		objStatusMap_.erase(defaultVec[i]);
-
-	// Set the default status for uids that are pointed, queried, or pointed and queried
-	defaultVec.clear();
-	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
-	{
-		uid = mapIt->first;
-		if (itemStatusMap_[uid] == TePOINTED || itemStatusMap_[uid] == TeQUERIED ||
-			itemStatusMap_[uid] == TePOINTED_QUERIED)
-			defaultVec.push_back(uid);
-	}
-
-	for (i = 0; i < defaultVec.size(); ++i)
-		itemStatusMap_.erase(defaultVec[i]);
-}
-
-TeTime TeAbstractTheme::getCreationTime() const
-{
-	return creationTime_;
-}
-
-void TeAbstractTheme::setCreationTime(const TeTime& creationTime)
-{
-	creationTime_ = creationTime;
-}
-
-bool TeAbstractTheme::updateThemeCreationTime(TeDatabase* database)
-{
-	if(database == NULL)
-	{
-		return false;
-	}
-
-	if(!creationTime_.isValid())
-	{
-		return false;
-	}
-	
-	std::string sql = "UPDATE te_theme";
-	sql += " SET creation_time = " + database->getSQLTime(creationTime_);
-	sql += " WHERE theme_id = " + Te2String(this->id());
-
-	if(!database->execute(sql))
-	{
-		return false;
-	}
-
-	return true;
-}
-
-bool TeAbstractTheme::isUpdated()
-{
-	return true;
-}
\ No newline at end of file
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeAbstractTheme.h"
+#include "TeVisual.h"
+#include "TeRasterTransform.h"
+#include "TeDatabase.h"
+
+extern int  yyparse(string& sqlOut);
+extern int  initParse(const string& strIn, TeDatabase* db);
+
+TeAbstractTheme::TeAbstractTheme(const string& name, TeViewNode* parent, const int& view, const int& id, const TeViewNodeType& nodeType)
+		: TeViewNode(name, parent, view, id, nodeType),
+		generateAttributeRest_(""),
+		generateTemporalRest_(""),
+		hasSpatialRes_(false),
+		geomRest_(0),
+		minScale_(0.0),
+		maxScale_(0.0),
+		visibleRep_(0),
+		enableVisibility_(1),
+		rasterVisual_(0),
+		isAvailable_(true),
+		isEditable_(false),
+    themeBox_(TeBox())  
+{
+	grouping_.groupMode_ = TeNoGrouping;
+
+	//default legends
+	TeVisual* visp = new TeVisual(TePOLYGONS);
+	TeVisual* visl = new TeVisual(TeLINES);
+	TeVisual* vispt = new TeVisual(TePOINTS);
+	TeVisual* vist = new TeVisual(TeTEXT);
+
+	TeColor	color;
+	color.init(100, 220, 220);
+	visp->color(color);
+	visl->color(color);
+	vispt->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);
+	visl->contourColor(color);
+	vispt->contourColor(color);
+
+	outOfCollectionLegend_.setVisual(visp->copy(), TePOLYGONS);		
+	outOfCollectionLegend_.setVisual(visl->copy(), TeLINES);		
+	outOfCollectionLegend_.setVisual(vispt->copy(), TePOINTS);		
+	outOfCollectionLegend_.setVisual(vist->copy(), TeTEXT);	
+
+	color.init(220, 100, 220);
+	visp->color(color);
+	visl->color(color);
+	vispt->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);
+	visl->contourColor(color);
+	vispt->contourColor(color);
+
+	withoutDataConnectionLegend_.setVisual(visp->copy(), TePOLYGONS);		
+	withoutDataConnectionLegend_.setVisual(visl->copy(), TeLINES);		
+	withoutDataConnectionLegend_.setVisual(vispt->copy(), TePOINTS);		
+	withoutDataConnectionLegend_.setVisual(vist->copy(), TeTEXT);	
+
+	color.init(220, 0, 0);
+	visp->color(color);
+	color.init(0, 220, 220);
+	visl->color(color);
+	color.init(220, 90, 180);
+	vispt->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);
+	visl->contourColor(color);
+	vispt->contourColor(color);
+	color.init(0, 0, 0);
+	vist->color(color);
+
+	defaultLegend_.setVisual(visp->copy(), TePOLYGONS);		
+	defaultLegend_.setVisual(visl->copy(), TeLINES);		
+	defaultLegend_.setVisual(vispt->copy(), TePOINTS);		
+	defaultLegend_.setVisual(vist->copy(), TeTEXT);		
+	
+	color.init(80, 240, 100);
+	visp->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);
+	pointingLegend_.setVisual(visp->copy(), TePOLYGONS);		
+	pointingLegend_.setVisual(visl->copy(), TeLINES);		
+	pointingLegend_.setVisual(vispt->copy(), TePOINTS);		
+	pointingLegend_.setVisual(vist->copy(), TeTEXT);	
+
+	color.init(210, 210, 0);
+	visp->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);		
+	queryLegend_.setVisual(visp->copy(), TePOLYGONS);		
+	queryLegend_.setVisual(visl->copy(), TeLINES);		
+	queryLegend_.setVisual(vispt->copy(), TePOINTS);		
+	queryLegend_.setVisual(vist->copy(), TeTEXT);	
+							
+	color.init(255, 255, 0);
+	visp->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);		
+	queryAndPointingLegend_.setVisual(visp->copy(), TePOLYGONS);	
+	queryAndPointingLegend_.setVisual(visl->copy(), TeLINES);		
+	queryAndPointingLegend_.setVisual(vispt->copy(), TePOINTS);		
+	queryAndPointingLegend_.setVisual(vist->copy(), TeTEXT);	
+
+	delete visp;
+	delete visl;
+	delete vispt;
+	delete vist;
+
+	temporaryVisibility_=0;
+	temporaryRepresentation_=-1;
+
+	creationTime_.now();
+}
+
+TeAbstractTheme::TeAbstractTheme(const TeViewNodeParams& params) : 
+		TeViewNode(params),
+		generateAttributeRest_(""),
+		generateTemporalRest_(""),
+		hasSpatialRes_(false),
+		geomRest_(0),
+		minScale_(0.0),
+		maxScale_(0.0),
+		visibleRep_(0),
+		enableVisibility_(1),
+		rasterVisual_(0),
+		isAvailable_(true),
+		isEditable_(false),
+    themeBox_(TeBox())  
+{
+	grouping_.groupMode_ = TeNoGrouping;
+	//default legends
+	TeVisual* visp = new TeVisual(TePOLYGONS);
+	TeVisual* visl = new TeVisual(TeLINES);
+	TeVisual* vispt = new TeVisual(TePOINTS);
+	TeVisual* vist = new TeVisual(TeTEXT);
+	TeColor	color;
+	color.init(100, 220, 220);
+	visp->color(color);
+	visl->color(color);
+	vispt->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);
+	visl->contourColor(color);
+	vispt->contourColor(color);
+
+	outOfCollectionLegend_.setVisual(visp->copy(), TePOLYGONS);		
+	outOfCollectionLegend_.setVisual(visl->copy(), TeLINES);		
+	outOfCollectionLegend_.setVisual(vispt->copy(), TePOINTS);		
+	outOfCollectionLegend_.setVisual(vist->copy(), TeTEXT);	
+
+	color.init(220, 100, 220);
+	visp->color(color);
+	visl->color(color);
+	vispt->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);
+	visl->contourColor(color);
+	vispt->contourColor(color);
+
+	withoutDataConnectionLegend_.setVisual(visp->copy(), TePOLYGONS);		
+	withoutDataConnectionLegend_.setVisual(visl->copy(), TeLINES);		
+	withoutDataConnectionLegend_.setVisual(vispt->copy(), TePOINTS);		
+	withoutDataConnectionLegend_.setVisual(vist->copy(), TeTEXT);	
+
+	color.init(220, 0, 0);
+	visp->color(color);
+	color.init(0, 220, 220);
+	visl->color(color);
+	color.init(220, 90, 180);
+	vispt->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);
+	visl->contourColor(color);
+	vispt->contourColor(color);
+	color.init(0, 0, 0);
+	vist->color(color);
+
+	defaultLegend_.setVisual(visp->copy(), TePOLYGONS);		
+	defaultLegend_.setVisual(visl->copy(), TeLINES);		
+	defaultLegend_.setVisual(vispt->copy(), TePOINTS);		
+	defaultLegend_.setVisual(vist->copy(), TeTEXT);		
+	
+	color.init(80, 240, 100);
+	visp->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);
+	pointingLegend_.setVisual(visp->copy(), TePOLYGONS);		
+	pointingLegend_.setVisual(visl->copy(), TeLINES);		
+	pointingLegend_.setVisual(vispt->copy(), TePOINTS);		
+	pointingLegend_.setVisual(vist->copy(), TeTEXT);	
+
+	color.init(210, 210, 0);
+	visp->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);		
+	queryLegend_.setVisual(visp->copy(), TePOLYGONS);		
+	queryLegend_.setVisual(visl->copy(), TeLINES);		
+	queryLegend_.setVisual(vispt->copy(), TePOINTS);		
+	queryLegend_.setVisual(vist->copy(), TeTEXT);	
+							
+	color.init(255, 255, 0);
+	visp->color(color);
+	color.init(100, 100, 100);
+	visp->contourColor(color);		
+	queryAndPointingLegend_.setVisual(visp->copy(), TePOLYGONS);	
+	queryAndPointingLegend_.setVisual(visl->copy(), TeLINES);		
+	queryAndPointingLegend_.setVisual(vispt->copy(), TePOINTS);		
+	queryAndPointingLegend_.setVisual(vist->copy(), TeTEXT);
+
+	delete visp;
+	delete visl;
+	delete vispt;
+	delete vist;
+
+	temporaryVisibility_=0;
+	temporaryRepresentation_=-1;
+
+	creationTime_.now();
+}
+
+//! Copy constructor
+TeAbstractTheme::TeAbstractTheme (const TeAbstractTheme& other) : 
+	TeViewNode(other.viewNodeParams_),
+	isAvailable_(true),
+	isEditable_(false)
+{
+	generateAttributeRest_ = other.generateAttributeRest_;
+	generateTemporalRest_ = other.generateTemporalRest_;
+	generateSpatialRest_ = other.generateSpatialRest_; 
+	spatialRelation_ = other.spatialRelation_;
+	hasSpatialRes_ =  other.hasSpatialRes_;
+	boxRest_ = other.boxRest_;
+	geomRest_ = other.geomRest_; 
+	geomRepRest_ = other.geomRepRest_;	
+	minScale_ = other.minScale_;
+	maxScale_ = other.maxScale_;
+	visibleRep_ = other.visibleRep_;
+	enableVisibility_ = other.enableVisibility_;
+
+	grouping_ = other.grouping_;
+
+	cleanLegend();
+	legend_.resize(other.legend_.size());
+	copy(other.legend_.begin(),other.legend_.end(),legend_.begin());
+	outOfCollectionLegend_ = other.outOfCollectionLegend_;
+	withoutDataConnectionLegend_ = other.withoutDataConnectionLegend_;	
+	defaultLegend_ = other.defaultLegend_;
+	pointingLegend_ = other.pointingLegend_;
+	queryLegend_ = other.queryLegend_;
+	queryAndPointingLegend_ = other.queryAndPointingLegend_; 
+	
+	objectSet_ = other.objectSet_;
+	numLayerObjects_ = other.numLayerObjects_;
+	itemStatusMap_ = other.itemStatusMap_;
+	objStatusMap_ = other.objStatusMap_;
+	rasterVisual_ = 0;
+	if(other.rasterVisual_)
+	{
+		rasterVisual_ = new TeRasterTransform();
+		(*rasterVisual_) = (*other.rasterVisual_);
+	}
+	themeBox_ = other.themeBox_;
+	creationTime_ = other.creationTime_;
+	temporaryVisibility_=other.temporaryVisibility_;
+	temporaryRepresentation_=other.temporaryRepresentation_;
+}
+
+//! Destructor
+TeAbstractTheme::~TeAbstractTheme () 
+{ 
+	if (rasterVisual_)
+		delete rasterVisual_;
+	generateAttributeRest_.clear();
+	generateTemporalRest_.clear();
+	generateSpatialRest_.clear();
+	cleanLegend();
+	outOfCollectionLegend_.clear();
+	withoutDataConnectionLegend_.clear();
+	defaultLegend_.clear(); 
+	pointingLegend_.clear(); 
+	queryLegend_.clear(); 
+	queryAndPointingLegend_.clear();
+}
+
+TeAbstractTheme& 
+TeAbstractTheme::operator= (const TeAbstractTheme& other)
+{
+	if ( this != &other )
+	{
+		viewNodeParams_ = other.viewNodeParams_;
+		
+		generateAttributeRest_ = other.generateAttributeRest_;
+		generateTemporalRest_ = other.generateTemporalRest_;
+		generateSpatialRest_ = other.generateSpatialRest_; 
+		spatialRelation_ = other.spatialRelation_;
+		hasSpatialRes_ =  other.hasSpatialRes_;
+		boxRest_ = other.boxRest_;
+		geomRest_ = other.geomRest_; 
+		geomRepRest_ = other.geomRepRest_;	
+		minScale_ = other.minScale_;
+		maxScale_ = other.maxScale_;
+		visibleRep_ = other.visibleRep_;
+		enableVisibility_ = other.enableVisibility_;
+
+		grouping_ = other.grouping_;
+
+		cleanLegend();
+		legend_.resize(other.legend_.size());
+		copy(other.legend_.begin(),other.legend_.end(),legend_.begin());
+		outOfCollectionLegend_ = other.outOfCollectionLegend_;
+		withoutDataConnectionLegend_ = other.withoutDataConnectionLegend_;	
+		defaultLegend_ = other.defaultLegend_;
+		pointingLegend_ = other.pointingLegend_;
+		queryLegend_ = other.queryLegend_;
+		queryAndPointingLegend_ = other.queryAndPointingLegend_; 
+		
+		objectSet_ = other.objectSet_;
+		numLayerObjects_ = other.numLayerObjects_;
+		itemStatusMap_ = other.itemStatusMap_;
+		objStatusMap_ = other.objStatusMap_;
+	
+		if(rasterVisual_)
+			delete rasterVisual_;
+		rasterVisual_ = 0;
+		if(other.rasterVisual_)
+		{
+			rasterVisual_ = new TeRasterTransform();
+			(*rasterVisual_) = (*other.rasterVisual_);
+		}
+		themeBox_ = other.themeBox_;
+		creationTime_ = other.creationTime_;
+		isEditable_ = other.isEditable_;
+	}
+	return *this;
+}
+
+int TeAbstractTheme::visibleGeoRep()
+{
+	return (visibleRep_ & ~0x40000000 & ~0x80000000 & ~0x20000000);
+}
+
+void TeAbstractTheme::setAvailability(const bool& availability)
+{
+	isAvailable_ = availability;
+}
+
+const bool& TeAbstractTheme::isAvailable() const
+{
+	return isAvailable_;
+}
+
+bool TeAbstractTheme::isEditable() const
+{
+	return isEditable_;
+}
+
+void TeAbstractTheme::setEditable(const bool& editable)
+{
+	isEditable_ = editable;
+}
+
+void TeAbstractTheme::removeRasterVisual()
+{ 
+	if (rasterVisual_)
+	{
+		delete rasterVisual_;
+		rasterVisual_ = 0;
+	}
+}
+
+void TeAbstractTheme::cleanLegend()
+{
+   while (legend_.size())     
+   {
+       legend_[0].clear();
+       legend_.erase(legend_.begin());
+   }
+   legend_.clear(); 
+}
+
+void 
+TeAbstractTheme::setSpatialRest(TeBox& box, TeGeomRep rep, TeSpatialRelation relation)
+{
+	hasSpatialRes_ = true;
+	boxRest_ = box;
+	spatialRelation_ = relation;
+	geomRepRest_ = rep;
+	geomRest_ = 0;
+}
+
+void 
+TeAbstractTheme::setSpatialRest(TeGeometry* geom, TeGeomRep rep, TeSpatialRelation relation)
+{
+	hasSpatialRes_ = true;
+	geomRest_ = geom;
+	spatialRelation_ = relation;
+	geomRepRest_ = rep;
+	boxRest_ = TeBox();
+}
+
+void TeAbstractTheme::legend (TeLegendEntry& leg)
+{
+	if(leg.group() == -6)	// queried and pointed objects visual
+		queryAndPointingLegend_ = leg;
+	else if(leg.group() == -5)	// queried objects visual
+		queryLegend_ = leg;
+	else if (leg.group() == -4)
+		pointingLegend_ = leg;
+	else if (leg.group() == -3)
+		defaultLegend_ = leg;
+	else if (leg.group() == -2)
+		withoutDataConnectionLegend_ = leg;
+	else if (leg.group() == -1)
+		outOfCollectionLegend_ = leg;
+	else if (leg.group() > -1)
+		legend_.push_back (leg);
+}
+
+void 
+TeAbstractTheme::resetGrouping ()
+{
+	if((grouping_.groupMode_ == TeRasterSlicing) && rasterVisual_)
+			this->removeRasterVisual();
+
+	grouping_.groupMode_ = TeNoGrouping;
+	legend_.clear();
+	return;
+}
+
+bool 
+TeAbstractTheme::buildGrouping(const TeGrouping& g, vector<TeSlice>& slices)
+{
+	grouping_ = g;
+	legend_.clear(); 
+	
+	for(unsigned int j=0; j<slices.size(); j++)
+	{
+		TeLegendEntry legend(slices[j]);
+		legend.group(j);
+		legend.theme(id());
+		legend_.push_back(legend);
+	}	
+	return true;
+}
+
+bool
+TeAbstractTheme::setGroupingVisual(int n, TeVisual* visual, TeGeomRep rep)
+{
+	if(	(n > grouping_.groupNumSlices_)	||
+		((int)legend_.size() < n)				|| 
+		(legend_.empty()) )
+		return false;
+	legend_[(n-1)].setVisual (visual->copy(), rep); 
+	return true;
+}
+
+bool
+TeAbstractTheme::setGroupingVisual(int n, TeGeomRepVisualMap& vismap)
+{
+	if(	(n > grouping_.groupNumSlices_)	||
+		((int)legend_.size() < n)		|| 
+		(legend_.empty()) )
+		return false;
+
+	TeGeomRepVisualMap::iterator it = vismap.begin();
+	while (it != vismap.end())
+	{
+		legend_[(n-1)].setVisual(it->second->copy(),it->first);
+		++it;
+	}
+	return true;
+}
+
+TeSliceVector 
+TeAbstractTheme::getSlices()
+{
+	TeSliceVector sliceVec;
+	for(unsigned int x=0; x<legend_.size(); ++x)
+	{
+		TeSlice slice = legend_[x].slice();
+		sliceVec.push_back (slice);
+	}
+	return sliceVec;
+}
+
+
+
+void TeAbstractTheme::createRasterVisual(TeRaster* rst)
+{
+	if (rasterVisual_)
+		delete rasterVisual_;
+
+	if (!rst)
+		return;
+
+	rasterVisual_ = new TeRasterTransform();
+										
+	if (rst->params().photometric_[0] == TeRasterParams::TePallete)  // raster palette -> uses its palette
+	{
+		rasterVisual_->setTransfFunction(&TeRasterTransform::Pallete2ThreeBand);
+		rasterVisual_->setLutSize(rst->params().lutr_.size());
+		return;
+	}
+
+	if (visibleRep_ & 0x40000000  &&		// sliced raster -> generate the
+		grouping_.groupMode_ == TeRasterSlicing)	// appropriate palette
+	{
+		int band = atoi(grouping_.groupAttribute_.name_.c_str());
+		rasterVisual_->setSrcBand(band);
+		if (rst->params().dataType_[band] != TeUNSIGNEDCHAR)
+			rasterVisual_->generateLUT(legend_, 1024, defaultLegend_.visual(TePOLYGONS)->color());
+		else
+			rasterVisual_->generateLUT(legend_, 256, defaultLegend_.visual(TePOLYGONS)->color());
+		rasterVisual_->setTransfFunction(&TeRasterTransform::LUT2ThreeBand);
+		return;
+	}
+
+	if (rst->params().dataType_[0] != TeUNSIGNEDCHAR)	// non unsigned char -> generate linear transformation
+		rasterVisual_->setLinearTransfParameters(rst->params().vmin_[0],rst->params().vmax_[0], 0, 255);
+
+	if (rst->params().nBands() == 1)				
+		rasterVisual_->setTransfFunction(&TeRasterTransform::Mono2ThreeBand);
+	else if (rst->params().nBands() == 3)
+		rasterVisual_->setTransfFunction(&TeRasterTransform::ThreeBand2RGB);
+	else
+		rasterVisual_->setTransfFunction(&TeRasterTransform::Band2Band);
+}
+
+void TeAbstractTheme::setParent (TeViewNode* )
+{
+}
+
+void TeAbstractTheme::setStatus(vector<string>& oidVec, vector<string>& itemVec, int status)
+{
+	vector<string>::iterator it;
+
+	if(status == 0)
+	{
+		for(it=oidVec.begin(); it!=oidVec.end();++it)
+		{
+			string s = *it;
+			if(objStatusMap_.find(s) != objStatusMap_.end())
+				objStatusMap_.erase(s);
+		}
+		for(it=itemVec.begin(); it!=itemVec.end();++it)
+		{
+			string s = *it;
+			if(itemStatusMap_.find(s) != itemStatusMap_.end())
+				itemStatusMap_.erase(s);
+		}
+	}
+	else
+	{
+		for(it=oidVec.begin(); it!=oidVec.end();++it)
+		{
+			string s = *it;
+			objStatusMap_[s] = status;
+		}
+		for(it=itemVec.begin(); it!=itemVec.end();++it)
+		{
+			string s = *it;
+			itemStatusMap_[s] = status;
+		}
+	}
+}
+
+void TeAbstractTheme::setStatusForObjectToggled(string oid)
+{
+	string uid;
+
+	int& oidStatus = objStatusMap_[oid];
+	if (oidStatus == TeDEFAULT)
+		oidStatus = TePOINTED;
+	else if (oidStatus == TePOINTED)
+		oidStatus = TeDEFAULT;
+	else if (oidStatus == TeQUERIED)
+		oidStatus = TePOINTED_QUERIED;
+	else if (oidStatus == TePOINTED_QUERIED)
+		oidStatus = TeQUERIED;
+
+	set<string> oidSet;
+	oidSet.insert(oid);
+	vector<string> uidVec = getItemVector(oidSet);
+	for (unsigned int i = 0; i < uidVec.size(); ++i)
+	{
+		uid = uidVec[i];
+		int& uidStatus = itemStatusMap_[uidVec[i]];
+		if (uidStatus == TeDEFAULT)
+		{
+			if (oidStatus == TePOINTED || oidStatus == TePOINTED_QUERIED)
+				uidStatus = TePOINTED;
+		}
+		else if (uidStatus == TePOINTED)
+		{
+			if (oidStatus == TeDEFAULT || oidStatus == TeQUERIED)
+				itemStatusMap_.erase(uid);
+		}
+		else if (uidStatus == TeQUERIED)
+		{
+			if (oidStatus == TePOINTED || oidStatus == TePOINTED_QUERIED)
+				uidStatus = TePOINTED_QUERIED;
+		}
+		else if (uidStatus == TePOINTED_QUERIED)
+		{
+			if (oidStatus == TeDEFAULT || oidStatus == TeQUERIED)
+				uidStatus = TeQUERIED;
+		}
+	}
+	
+	// Save the status id of the object
+	if (oidStatus == TeDEFAULT)
+		objStatusMap_.erase(oid);
+}
+
+void TeAbstractTheme::setStatusForItemsToggled(set<string>& oidSet, vector<string>& uidVec)
+{
+	unsigned int i;
+	int oidStatus;
+	string oid, uid;
+	set<string>::iterator it;
+
+	// Set the new status of the uids
+	for (i = 0; i < uidVec.size(); ++i)
+	{
+		uid = uidVec[i];
+		if (itemStatusMap_[uid] == TeDEFAULT)
+			itemStatusMap_[uid] = TePOINTED;
+		else if (itemStatusMap_[uid] == TePOINTED)
+			itemStatusMap_.erase(uid);
+		else if (itemStatusMap_[uid] == TeQUERIED)
+			itemStatusMap_[uid] = TePOINTED_QUERIED;
+		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
+			itemStatusMap_[uid] = TeQUERIED;
+	}
+
+
+	// Set the new status of the oids
+	for (it = oidSet.begin(); it != oidSet.end(); ++it)
+	{
+		oid = *it;
+		oidStatus = 0;
+		set<string> objSet;
+		objSet.insert(oid);
+		vector<string> uidVec = getItemVector(objSet);
+		for (i = 0; i < uidVec.size(); ++i)
+		{
+			uid = uidVec[i];
+			if (itemStatusMap_[uid] == TePOINTED_QUERIED)
+			{
+				oidStatus = TePOINTED_QUERIED;
+				break;
+			}
+			oidStatus = MAX(oidStatus, itemStatusMap_[uid]);
+			if (itemStatusMap_[uid] == TeDEFAULT)
+				itemStatusMap_.erase(uid);
+		}	
+		
+		if (oidStatus == 0)
+			objStatusMap_.erase(oid);
+		else
+			objStatusMap_[oid] = oidStatus;
+	}
+}
+
+void TeAbstractTheme::setStatusForNewItemsQueried(set<string>& oidSet, vector<string>& uidVec)
+{
+	unsigned int i;
+	string oid, uid;
+	vector<string> prevOidQVec;		// previous oids queried
+	vector<string> notInOidSetVec;	// oid is not in oidSet
+	vector<string> defaultVec;		// vector with oids or uids to be set as default
+	map<string, int>::iterator mapIt;
+	set<string>::iterator setIt;
+
+	// Get the previous oids queried
+	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
+	{
+		oid = mapIt->first;
+		if (objStatusMap_[oid] == TeQUERIED || objStatusMap_[oid] == TePOINTED_QUERIED)
+			prevOidQVec.push_back(mapIt->first);
+	}
+
+	// Check if the previous oids queried are in the oidSet; in positive case, remove
+	// them from the oidSet; in negative case, put them in the vector notInOidSetVec
+	for (i = 0; i < prevOidQVec.size(); ++i)
+	{
+		oid = prevOidQVec[i];
+		if (oidSet.find(oid) != oidSet.end())			
+			oidSet.erase(oid);				// object is in the input oidSet
+		else
+			notInOidSetVec.push_back(oid);	// object is not in the input oidSet
+	}
+
+	// For the objects in oidSet, set the queried status for them
+	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+	{
+		oid = *setIt;
+		if (objStatusMap_[oid] == TeDEFAULT)
+			objStatusMap_[oid] = TeQUERIED;
+		else if (objStatusMap_[oid] == TePOINTED)
+			objStatusMap_[oid] = TePOINTED_QUERIED;
+	}
+
+	// For the objects not in oidSet, insert it in oidSet, and remove their queried status
+	for (i = 0; i < notInOidSetVec.size(); ++i)
+	{
+		oid = notInOidSetVec[i];
+		if (objStatusMap_[oid] == TeQUERIED)
+			defaultVec.push_back(oid);
+		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
+			objStatusMap_[oid] = TePOINTED;
+		
+		oidSet.insert(oid);
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		objStatusMap_.erase(defaultVec[i]);
+
+	// Remove the queried status for the uids that were previously queried
+	defaultVec.clear();
+	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
+	{
+		uid = mapIt->first;
+		if (itemStatusMap_[uid] == TeQUERIED)
+			defaultVec.push_back(uid);
+		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
+			itemStatusMap_[uid] = TePOINTED;			
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		itemStatusMap_.erase(defaultVec[i]);
+
+	// Set the queried status for the input uidVec
+	for (i = 0; i < uidVec.size(); ++i)
+	{
+		uid = uidVec[i];
+		if (itemStatusMap_[uid] == TeDEFAULT)
+			itemStatusMap_[uid] = TeQUERIED;
+		else if (itemStatusMap_[uid] == TePOINTED)
+			itemStatusMap_[uid] = TePOINTED_QUERIED;
+	}
+}
+
+void TeAbstractTheme::setStatusForNewObjectsPointed(set<string>& oidSet)
+{
+	unsigned int i;
+	string oid, uid;
+	set<string> prevOidPointedSet;		// previous oids pointed
+	set<string> objInInputOidSet;		// set containing objects in oidSet
+	set<string> objNotInInputOidSet;	// set containing objects not in oidSet
+	vector<string> defaultVec;		    // vector with oids or uids to be set as default
+	vector<string> uidVec;				// vector of uids
+	map<string, int>::iterator mapIt;
+	set<string>::iterator setIt;
+
+	// Get the previous oids pointed
+	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
+	{
+		oid = mapIt->first;
+		if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TePOINTED_QUERIED)
+			prevOidPointedSet.insert(mapIt->first);
+	}
+
+	// If the set of objects is empty, remove the pointed status of the previous oids and uids
+	if (oidSet.empty())
+	{
+		for (setIt = prevOidPointedSet.begin(); setIt != prevOidPointedSet.end(); ++setIt)
+		{
+			oid = *setIt;
+			if (objStatusMap_[oid] == TePOINTED)
+				defaultVec.push_back(oid);
+			else if (objStatusMap_[oid] == TePOINTED_QUERIED)
+				objStatusMap_[oid] = TeQUERIED;
+
+			oidSet.insert(oid);
+		}
+
+		for (i = 0; i < defaultVec.size(); ++i)
+			objStatusMap_.erase(defaultVec[i]);
+
+		defaultVec.clear();
+//		uidVec = getUidVec(prevOidPointedVec.begin(), prevOidPointedVec.end(), this); 
+		uidVec = getItemVector(prevOidPointedSet); 
+		for (i = 0; i < uidVec.size(); ++i)
+		{
+			uid = uidVec[i];
+			if (itemStatusMap_[uid] == TePOINTED)
+				defaultVec.push_back(uid);
+			else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
+				itemStatusMap_[uid] = TeQUERIED;
+		}
+
+		for (i = 0; i < defaultVec.size(); ++i)
+			itemStatusMap_.erase(defaultVec[i]);
+
+		return;
+	}
+
+	// Check if the previous oids pointed are in the oidSet; in positive case, put
+	// them in objInOidSetVec; in negative case, put them in the objNotInOidSetVec
+	for (setIt = prevOidPointedSet.begin(); setIt != prevOidPointedSet.end(); ++setIt)
+	{
+		oid = *setIt;
+		if (oidSet.find(oid) != oidSet.end())
+			objInInputOidSet.insert(oid);		// object is in the input oidSet
+		else
+			objNotInInputOidSet.insert(oid);	// object is not in the input oidSet
+	}
+
+	// For the objects in oidSet, set the pointed status for them
+	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+	{
+		oid = *setIt;
+		if (objStatusMap_[oid] == TeDEFAULT)
+			objStatusMap_[oid] = TePOINTED;
+		else if (objStatusMap_[oid] == TeQUERIED)
+			objStatusMap_[oid] = TePOINTED_QUERIED;
+	}
+
+	// For the objects not in oidSet, remove their pointed status
+	defaultVec.clear();
+	for (setIt = objNotInInputOidSet.begin(); setIt != objNotInInputOidSet.end(); ++setIt)
+	{
+		oid = *setIt;
+		if (objStatusMap_[oid] == TePOINTED)
+			defaultVec.push_back(oid);
+		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
+			objStatusMap_[oid] = TeQUERIED;
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		objStatusMap_.erase(defaultVec[i]);
+
+	// For the objects in oidSet, set the pointed status for their uids
+	uidVec = getItemVector(oidSet);
+	for (i = 0; i < uidVec.size(); ++i)
+	{
+		uid = uidVec[i];
+		if (itemStatusMap_[uid] == TeDEFAULT)
+			itemStatusMap_[uid] = TePOINTED;
+		else if (itemStatusMap_[uid] == TeQUERIED)
+			itemStatusMap_[uid] = TePOINTED_QUERIED;
+	}
+
+	// For the objects not in oidSet, remove the pointed status for their uids
+	defaultVec.clear();
+	uidVec = getItemVector(objNotInInputOidSet);
+	for (i = 0; i < uidVec.size(); ++i)
+	{
+		uid = uidVec[i];
+		if (itemStatusMap_[uid] == TePOINTED)
+			defaultVec.push_back(uid);
+		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
+			itemStatusMap_[uid] = TeQUERIED;
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		itemStatusMap_.erase(defaultVec[i]);
+
+	// Insert in the oidSet the objects that are not in the input oidSet
+	for (setIt = objNotInInputOidSet.begin(); setIt != objNotInInputOidSet.end(); ++setIt)
+		oidSet.insert(*setIt);
+
+	// Remove from the oidSet the objects that were in the input oidSet
+	for (setIt = objInInputOidSet.begin(); setIt != objInInputOidSet.end(); ++setIt)
+		oidSet.erase(*setIt);
+}
+
+void TeAbstractTheme::setStatusForNewItemsPointed(vector<string>& itemVec)
+{
+	unsigned int i;
+	string oid, item;
+	map<string, int>::iterator mapIt;
+	vector<string> defaultVec;
+
+	//-----------------------------------------------------------------------
+	// Set the pointing status for the input items
+	//-----------------------------------------------------------------------
+
+	// Remove the pointing status for all the items
+	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
+	{
+		item = mapIt->first;
+		if (itemStatusMap_[item] == TePOINTED)
+			defaultVec.push_back(item);
+		else if (objStatusMap_[item] == TePOINTED_QUERIED)
+			itemStatusMap_[item] = TeQUERIED;
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		itemStatusMap_.erase(defaultVec[i]);
+
+	for (i = 0; i < itemVec.size(); ++i)
+	{
+		item = itemVec[i];
+		if (itemStatusMap_[item] == TeDEFAULT)
+			itemStatusMap_[item] = TePOINTED;
+		else if (itemStatusMap_[item] == TeQUERIED)
+			itemStatusMap_[item] = TePOINTED_QUERIED;	
+	}
+
+	//-----------------------------------------------------------------------
+	// Set the pointing status for the objects associated to the input items
+	//-----------------------------------------------------------------------
+	
+	// Remove the pointing status for all the objects
+	defaultVec.clear();
+	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
+	{
+		oid = mapIt->first;
+		if (objStatusMap_[oid] == TePOINTED)
+			defaultVec.push_back(oid);
+		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
+			objStatusMap_[oid] = TeQUERIED;
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		objStatusMap_.erase(defaultVec[i]);
+
+	// Set the pointing status for the objects associated to the input items
+	set<string> oidSet = getObjects(itemVec);
+	set<string>::iterator setIt;
+	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+	{
+		oid = *setIt;
+		if (objStatusMap_[oid] == TeDEFAULT)
+			objStatusMap_[oid] = TePOINTED;
+		else if (objStatusMap_[oid] == TeQUERIED)
+			objStatusMap_[oid] = TePOINTED_QUERIED;	
+	}
+}
+
+
+
+void TeAbstractTheme::setStatusForObjectsAddedByPointing(set<string>& oidSet)
+{
+	if (oidSet.empty())
+		return;
+
+	unsigned int i;
+	string oid, uid;
+	vector<string> prevOidPointedVec;	// previous oids pointed
+	vector<string> uidVec;				// vector of uids
+	map<string, int>::iterator mapIt;
+	set<string>::iterator setIt;
+
+	// Get the previous oids pointed
+	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
+	{
+		oid = mapIt->first;
+		if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TePOINTED_QUERIED)
+			prevOidPointedVec.push_back(mapIt->first);
+	}
+
+	// If there is any object in the oidSet that is already in the previous oids pointed,
+	// remove it from the oidSet
+	for (i = 0; i < prevOidPointedVec.size(); ++i)
+	{
+		oid = prevOidPointedVec[i];
+		if (oidSet.find(prevOidPointedVec[i]) != oidSet.end())
+			oidSet.erase(oid);
+	}
+
+	// Set the pointed status for the objects added by pointing
+	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+	{
+		oid = *setIt;
+		if (objStatusMap_[oid] == TeDEFAULT)
+			objStatusMap_[oid] = TePOINTED;
+		if (objStatusMap_[oid] == TeQUERIED)
+			objStatusMap_[oid] = TePOINTED_QUERIED;
+	}
+
+	// Set the pointed status for the uids of the objects added by pointing
+	uidVec = getItemVector(oidSet);
+	for (i = 0; i < uidVec.size(); ++i)
+	{
+		uid = uidVec[i];
+		if (itemStatusMap_[uid] == TeDEFAULT)
+			itemStatusMap_[uid] = TePOINTED;
+		else if (itemStatusMap_[uid] == TeQUERIED)
+			itemStatusMap_[uid] = TePOINTED_QUERIED;
+	}
+}
+
+void TeAbstractTheme::setStatusForItemsAddedByPointing(vector<string>& itemVec)
+{
+	unsigned int i;
+	string oid, item;
+
+	//-----------------------------------------------------------------------
+	// Set the pointing status for the input items
+	//-----------------------------------------------------------------------
+	for (i = 0; i < itemVec.size(); ++i)
+	{
+		item = itemVec[i];
+		if (itemStatusMap_[item] == TeDEFAULT)
+			itemStatusMap_[item] = TePOINTED;
+		else if (objStatusMap_[item] == TeQUERIED)
+			itemStatusMap_[item] = TePOINTED_QUERIED;
+
+	}
+
+	//-----------------------------------------------------------------------
+	// Set the pointing status for the objects associated to the input items
+	//-----------------------------------------------------------------------
+	set<string> oidSet = getObjects(itemVec);
+	set<string>::iterator setIt;
+	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+	{
+		oid = *setIt;
+		if (objStatusMap_[oid] == TeDEFAULT)
+			objStatusMap_[oid] = TePOINTED;
+		else if (objStatusMap_[oid] == TeQUERIED)
+			objStatusMap_[oid] = TePOINTED_QUERIED;	
+	}
+}
+
+
+void TeAbstractTheme::setStatusForItemsAddedByQuerying(set<string>& oidSet, vector<string>& uidVec)
+{
+	unsigned int i;
+	string oid, uid;
+	set<string>::iterator setIt;
+
+	// Set the status for the oids in oidSet as "queried"
+	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+	{
+		oid = *setIt;
+		if (objStatusMap_[oid] == TeDEFAULT)
+			objStatusMap_[oid] = TeQUERIED;
+		else if (objStatusMap_[oid] == TePOINTED)
+			objStatusMap_[oid] = TePOINTED_QUERIED;
+	}
+
+	// Set the new status for the uidVec
+	for (i = 0; i < uidVec.size(); ++i)
+	{
+		uid = uidVec[i];
+		if (itemStatusMap_[uid] == TeDEFAULT)
+			itemStatusMap_[uid] = TeQUERIED;
+		else if (itemStatusMap_[uid] == TePOINTED)
+			itemStatusMap_[uid] = TePOINTED_QUERIED;
+	}
+}
+
+
+void TeAbstractTheme::setStatusForItemsFilteredByQuerying(set<string>& oidSet, vector<string>& uidVec)
+{
+	unsigned int i;
+	string oid, uid;
+	vector<string> prevOidQVec;		// previous oids queried
+	vector<string> notInOidSetVec;	// oid is not in oidSet
+	vector<string> defaultVec;		// vector with oids or uids to be set as default
+	map<string, int>::iterator mapIt;
+	set<string>::iterator setIt;
+
+	// Get the previous oids queried
+	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
+	{
+		oid = mapIt->first;
+		if (objStatusMap_[oid] == TeQUERIED || objStatusMap_[oid] == TePOINTED_QUERIED)
+			prevOidQVec.push_back(mapIt->first);
+	}
+
+	// Check if the previous oids queried are in the oidSet; in positive case, remove
+	// them from the oidSet; in negative case, put them in the vector notInOidSetVec
+	for (i = 0; i < prevOidQVec.size(); ++i)
+	{
+		oid = prevOidQVec[i];
+		if (oidSet.find(oid) != oidSet.end())			
+			oidSet.erase(oid);				// object is in the input oidSet
+		else
+			notInOidSetVec.push_back(oid);	// object is not in the input oidSet
+	}
+
+	// For the objects not in oidSet, insert it in oidSet, and remove their queried status
+	for (i = 0; i < notInOidSetVec.size(); ++i)
+	{
+		oid = notInOidSetVec[i];
+		if (objStatusMap_[oid] == TeQUERIED)
+			defaultVec.push_back(oid);
+		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
+			objStatusMap_[oid] = TePOINTED;
+		
+		oidSet.insert(oid);
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		objStatusMap_.erase(defaultVec[i]);
+
+	// Remove the queried status for the uids that were previously queried
+	defaultVec.clear();
+	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
+	{
+		uid = mapIt->first;
+		if (itemStatusMap_[uid] == TeQUERIED)
+			defaultVec.push_back(uid);
+		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
+			itemStatusMap_[uid] = TePOINTED;			
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		itemStatusMap_.erase(defaultVec[i]);
+
+	// Set the queried status for the input uidVec
+	for (i = 0; i < uidVec.size(); ++i)
+	{
+		uid = uidVec[i];
+		if (itemStatusMap_[uid] == TeDEFAULT)
+			itemStatusMap_[uid] = TeQUERIED;
+		else if (itemStatusMap_[uid] == TePOINTED)
+			itemStatusMap_[uid] = TePOINTED_QUERIED;
+	}
+}
+
+void TeAbstractTheme::removePointingColor()
+{
+	unsigned int i;
+	string oid, uid;
+	vector<string> defaultVec;
+	map<string, int>::iterator mapIt;
+
+	// Remove the pointed status for the objects
+	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
+	{
+		oid = mapIt->first;
+		if (objStatusMap_[oid] == TePOINTED)
+			defaultVec.push_back(oid);
+		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
+			objStatusMap_[oid] = TeQUERIED;
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		objStatusMap_.erase(defaultVec[i]);
+
+	// Remove the pointed status for the uids
+	defaultVec.clear();
+	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
+	{
+		uid = mapIt->first;
+		if (itemStatusMap_[uid] == TePOINTED)
+			defaultVec.push_back(uid);
+		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
+			itemStatusMap_[uid] = TeQUERIED;
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		itemStatusMap_.erase(defaultVec[i]);
+}
+
+
+void TeAbstractTheme::removeQueryColor()
+{
+	unsigned int i;
+	string oid, uid;
+	vector<string> defaultVec;
+	map<string, int>::iterator mapIt;
+
+	// Remove the pointed status for the objects
+	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
+	{
+		oid = mapIt->first;
+		if (objStatusMap_[oid] == TeQUERIED)
+			defaultVec.push_back(oid);
+		else if (objStatusMap_[oid] == TePOINTED_QUERIED)
+			objStatusMap_[oid] = TePOINTED;
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		objStatusMap_.erase(defaultVec[i]);
+
+	// Remove the pointed status for the uids
+	defaultVec.clear();
+	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
+	{
+		uid = mapIt->first;
+		if (itemStatusMap_[uid] == TeQUERIED)
+			defaultVec.push_back(uid);
+		else if (itemStatusMap_[uid] == TePOINTED_QUERIED)
+			itemStatusMap_[uid] = TePOINTED;
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		itemStatusMap_.erase(defaultVec[i]);
+}
+
+
+void TeAbstractTheme::invertObjectStatus()
+{
+	unsigned int i;
+	string oid, uid;
+	set<string> objInvToPointedStatusSet;	// objects to be inverted to the pointed status
+	set<string> objInvToDefaultStatusSet;	// objects to be inverted to the default status
+	vector<string> defaultVec;
+	map<string, int>::iterator mapIt;
+	set<string>::const_iterator setIt;
+
+	// Get all the theme objects
+	const set<string>& oidSet = getObjects();
+
+	// Get the objects that are pointed, queried, or pointed and queried
+	// and put their status to the default status, and get the objects
+	// that are in the default status and put them in the pointed status
+	for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+	{
+		oid = *setIt;
+		if (objStatusMap_[oid] == TeDEFAULT)
+		{
+			objStatusMap_[oid] = TePOINTED;
+			objInvToPointedStatusSet.insert(oid);
+		}
+		else if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TeQUERIED ||
+			     objStatusMap_[oid] == TePOINTED_QUERIED)
+		{
+			defaultVec.push_back(oid);
+			objInvToDefaultStatusSet.insert(oid);
+		}
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		objStatusMap_.erase(defaultVec[i]);
+
+	// Set the status for the uids according the status of their objects
+	vector<string> uidVec = getItemVector(objInvToPointedStatusSet);
+	for (i = 0; i < uidVec.size(); ++i)
+		itemStatusMap_[uidVec[i]] = TePOINTED;
+
+	uidVec = getItemVector(objInvToDefaultStatusSet);
+	for (i = 0; i < uidVec.size(); ++i)
+		itemStatusMap_.erase(uidVec[i]);
+}
+
+
+void TeAbstractTheme::setObjectsToDefaultStatus()
+{
+	unsigned int i;
+	string oid, uid;
+	vector<string> defaultVec;
+	map<string, int>::iterator mapIt;
+
+	// Set the default status for objects that are pointed, queried, or pointed and queried
+	for (mapIt = objStatusMap_.begin(); mapIt != objStatusMap_.end(); ++mapIt)
+	{
+		oid = mapIt->first;
+		if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TeQUERIED ||
+			objStatusMap_[oid] == TePOINTED_QUERIED)
+			defaultVec.push_back(oid);
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		objStatusMap_.erase(defaultVec[i]);
+
+	// Set the default status for uids that are pointed, queried, or pointed and queried
+	defaultVec.clear();
+	for (mapIt = itemStatusMap_.begin(); mapIt != itemStatusMap_.end(); ++mapIt)
+	{
+		uid = mapIt->first;
+		if (itemStatusMap_[uid] == TePOINTED || itemStatusMap_[uid] == TeQUERIED ||
+			itemStatusMap_[uid] == TePOINTED_QUERIED)
+			defaultVec.push_back(uid);
+	}
+
+	for (i = 0; i < defaultVec.size(); ++i)
+		itemStatusMap_.erase(defaultVec[i]);
+}
+
+TeTime TeAbstractTheme::getCreationTime() const
+{
+	return creationTime_;
+}
+
+void TeAbstractTheme::setCreationTime(const TeTime& creationTime)
+{
+	creationTime_ = creationTime;
+}
+
+bool TeAbstractTheme::updateThemeCreationTime(TeDatabase* database)
+{
+	if(database == NULL)
+	{
+		return false;
+	}
+
+	if(!creationTime_.isValid())
+	{
+		return false;
+	}
+	
+	std::string sql = "UPDATE te_theme";
+	sql += " SET creation_time = " + database->getSQLTime(creationTime_);
+	sql += " WHERE theme_id = " + Te2String(this->id());
+
+	if(!database->execute(sql))
+	{
+		return false;
+	}
+
+	return true;
+}
+
+bool TeAbstractTheme::isUpdated()
+{
+	return true;
+}
diff --git a/src/terralib/kernel/TeAbstractTheme.h b/src/terralib/kernel/TeAbstractTheme.h
index 6a7dbea..68b7b50 100644
--- a/src/terralib/kernel/TeAbstractTheme.h
+++ b/src/terralib/kernel/TeAbstractTheme.h
@@ -1,688 +1,725 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeAbstractTheme.h
-	\brief This file contains definitions about an abstract theme in TerraLib. 
-*/
-#ifndef  __TERRALIB_INTERNAL_ABSTRACT_THEME_H
-#define  __TERRALIB_INTERNAL_ABSTRACT_THEME_H
-
-#include "TeDefines.h"
-#include "TeLegendEntry.h"
-#include "TeGeometry.h"
-#include "TeViewNode.h"
-#include "TeAttribute.h"
-
-class TeRasterTransform;
-class TeRaster;
-class TeDatabase;
-struct TeRepresentation;
-
-#include <string>
-#include <set>
-
-//! A grouping structure
-/*!
-	The TeGrouping is a structure that describes how the objects of a theme should
-	be grouped, or separated in groups.
-*/
-struct TL_DLL TeGrouping
-{
-	//! Returns the attribute used to group the objects of the theme
-	TeAttributeRep	groupAttribute_;
-	
-	//! Returns the attribute used to normalize a grouping 
-	string	groupNormAttribute_;
-	
-	//! Returns the grouping mode 
-	TeGroupingMode	groupMode_;			
-	
-	//! Returns the number of groups
-	int	groupNumSlices_;	
-	
-	//! Returns the numeric precision used to group objects
-	int	groupPrecision_;
-
-	//! Returns the deviation parameter used to group objects
-	double	groupStdDev_;
-
-	//! Aggregate function
-	string	groupFunction_; 
-
-	//! Show missing data
-	bool	groupNullAttr_; 
-
-	//! Minimum value used to calculate a equal step grouping
-	double groupMinVal_;
-
-	//! Maximum value used to calculate a equal step grouping 
-	double groupMaxVal_;
-
-	//! Chronon used for grouping
-	TeChronon groupChronon_;
-
-	//! Constructor
-	TeGrouping(TeAttributeRep att=TeAttributeRep(), const string& normAttr="", 
-				TeGroupingMode gMode=TeNoGrouping, int numSlice=0, int gPrecision=6,  
-				double	gStDev=1.0, const string& func="", TeChronon gChronon = TeNOCHRONON): 
-			groupAttribute_(att),
-			groupNormAttribute_(normAttr),
-			groupMode_(gMode),
-			groupNumSlices_(numSlice),
-			groupPrecision_(gPrecision),
-			groupStdDev_(gStDev),
-			groupFunction_(func),
-			groupNullAttr_(false),
-			groupMinVal_(TeMAXFLOAT),
-			groupMaxVal_(TeMINFLOAT),
-			groupChronon_(gChronon)
-			{}
-
-	//! Copy constructor
-	TeGrouping(const TeGrouping& other)
-	{	
-		groupAttribute_		= other.groupAttribute_;
-		groupNormAttribute_	= other.groupNormAttribute_;
-		groupMode_			= other.groupMode_;
-		groupNumSlices_		= other.groupNumSlices_;
-		groupPrecision_		= other.groupPrecision_;
-		groupStdDev_		= other.groupStdDev_;
-		groupFunction_		= other.groupFunction_;
-		groupNullAttr_		= other.groupNullAttr_;
-		groupMinVal_		= other.groupMinVal_;
-		groupMaxVal_		= other.groupMaxVal_;
-		groupChronon_			= other.groupChronon_;
-	}
-			
-	//! Destructor
-	~TeGrouping() {}
-	
-	//! Copy constructor
-	TeGrouping& operator= (const TeGrouping& other)
-	{	
-		if ( this != &other )
-		{		
-			groupAttribute_		= other.groupAttribute_;
-			groupNormAttribute_	= other.groupNormAttribute_;
-			groupMode_			= other.groupMode_;
-			groupNumSlices_		= other.groupNumSlices_;
-			groupPrecision_		= other.groupPrecision_;
-			groupStdDev_		= other.groupStdDev_;
-			groupFunction_		= other.groupFunction_;
-			groupNullAttr_		= other.groupNullAttr_;
-			groupNullAttr_		= other.groupNullAttr_;
-			groupMinVal_		= other.groupMinVal_;
-			groupMaxVal_		= other.groupMaxVal_;
-			groupChronon_		= other.groupChronon_;
-		}
-		return *this;
-	}
-};
-
-using namespace std;
-
-
-//! An abstract theme class
-class TL_DLL TeAbstractTheme: public TeViewNode
-{
-
-	friend class TeDatabase;
-	
-public:
-	//! Constructor
-    TeAbstractTheme(const string& name, TeViewNode* parent, const int& view, const int& id, const TeViewNodeType& nodeType);
-
-	//! Constructor
-	TeAbstractTheme(const TeViewNodeParams& params);
-
-	//! Copy constructor
-	TeAbstractTheme(const TeAbstractTheme& other);
-
-	//! Destructor
-	virtual ~TeAbstractTheme();
-
-	//! Assignment operator
-	TeAbstractTheme& operator= (const TeAbstractTheme& other); 
-
-	/** @name Scale
-		Methods related to the range of scales where this theme should be visible
-	*/
-	//@{	
-
-	//! Returns a pointer to a projection that is the spatial reference for the objects of this theme
-	/*! Concrete classes should reimplement this method.*/
-	virtual TeProjection* getThemeProjection() = 0;
-
-	//! Returns the minimum scale in which the theme is visible
-	virtual double minScale() { return minScale_; }
-
-	//! Sets the minimum scale in which the theme is visible
-	virtual void minScale(double s) { minScale_ = s; }
-
-	//! Returns the maximum scale in which the theme is visible
-	virtual double maxScale() { return maxScale_; }
-
-	//! Sets the maximum scale in which the theme is visible
-	virtual void maxScale(double s) { maxScale_ = s; }
-	//@}
-
-	/** @name Restrictions
-		Methods related to the restrictions over the theme used to generate this theme
-	*/
-	//@{
-	//! Verifies if this theme has any kind of restrictions
-	virtual bool hasRestriction() { return (!(generateAttributeRest_.empty() || 
-									  generateTemporalRest_.empty()) && hasSpatialRes_); }
-
-	//! Returns the attribute restriction (where clause) used to generate the theme  
-	virtual string attributeRest() { return generateAttributeRest_; }
-
-	//! Sets the attribute restriction (where clause) used to generate the theme
-	virtual void attributeRest(const string& s) { generateAttributeRest_ = s; }
-
-	//! Returns if there is an attribute restriction  
-	virtual bool hasAttrRest () { return (!generateAttributeRest_.empty());}
-
-	//! Returns the temporal restriction used to generate the theme
-	virtual string temporalRest() { return generateTemporalRest_; }
-
-	//! Sets the temporal restriction used to generate the theme
-	virtual void temporalRest(const string& t) { generateTemporalRest_ = t; };
-
-	//! Returns TRUE if there is a temporal restriction defined in the theme 
-	virtual bool hasTemporalRest() { return (!generateTemporalRest_.empty());}
-
-	//! Returns the spatial restriction used to generate the theme
-	virtual string spatialRest() { return generateSpatialRest_; }
-
-	//! Sets the spatial restriction used to generate the theme
-	virtual void spatialRest(const string& s) { generateSpatialRest_ = s; };
-	
-	//! Returns the spatial relation (e.g WITHIN, COVERED BY, etc.) associate to the spatial restriction
-	virtual TeSpatialRelation	spatialRelation() { return spatialRelation_;}
-
-	//! Sets the spatial relation (e.g WITHIN, COVERED BY, etc.) associate to the spatial restriction
-	virtual void spatialRelation(TeSpatialRelation s) {spatialRelation_=s;}
-	
-	//! Returns TRUE if this theme has a spatial restriction  
-	virtual bool hasSpatialRest() { return hasSpatialRes_;}
-
-	//! Sets the flag that indicates that there is a spatial restriction 
-	virtual void hasSpatialRest(bool a) {hasSpatialRes_ = a;}
-	
-	//! Returns the box associated with the spatial restriction
-	virtual TeBox boxRestriction() { return boxRest_;}
-
-	//! Sets the box associated with the spatial restriction
-	virtual void boxRestriction(TeBox& b) {boxRest_ = b;}
-
-	//! Returns a pointer to the geometry associated with the spatial restriction
-	virtual TeGeometry* geomRestriction() { return geomRest_;}
-
-	//! Sets a pointer to the geometry associated with the spatial restriction
-	virtual void geomRestriction(TeGeometry* g) {geomRest_ = g;}
-
-	//! Returns the geometry representation of the theme which will be considered in the spatial restriction  
-	virtual TeGeomRep geomRepRestriction() { return geomRepRest_; }
-
-	//! Sets the geometry representation of the theme which will be considered in the spatial restriction  
-	virtual void geomRepRestriction (TeGeomRep& rep) { geomRepRest_ = rep; }
-
-	//! Sets the spatial restriction to be a spatial relation with a box
-	virtual void setSpatialRest(TeBox& box, TeGeomRep rep, TeSpatialRelation relation = TeWITHIN); 
-
-	//! Sets the spatial restriction to be a spatial relation with a geometry
-	virtual void setSpatialRest(TeGeometry* geom, TeGeomRep rep, TeSpatialRelation relation = TeWITHIN); 
-	//@}
-	
-	
-	/** @name Visibility/Status
-		Methods related to the visibility/status of the theme and its components: graphs,
-		geometrical representations of the objects, grouping.
-	*/
-	//@{
-	//! Sets the components or representations of the theme that are visible
-	/*!
-		The param rep is a combination of any type of geometrical representation (TeGeomRep) plus:
-		- 0x20000000: representing the visibility of the legend
-		- 0x40000000: representing the visibility of the groupings
-		- 0x80000000: representing the visibility of the pie/chart graphs
-	*/
-	virtual void visibleRep(int rep) { visibleRep_ = rep; }
-
-	//! Returns the components or representations of the theme that are visible 
-	/*!
-		The result is a combination of any type of geometrical representation (TeGeomRep) plus:
-		- 0x20000000: representing the visibility of the legend
-		- 0x40000000: representing the visibility of the groupings
-		- 0x80000000: representing the visibility of the pie/chart graphs
-	*/
-	virtual int visibleRep() { return visibleRep_; }
-
-	//! Returns the geometrical representations of the theme that are visible
-	virtual int visibleGeoRep();
-
-	//! Returns a status of a theme
-	/*! 
-		- Returns 0 if the theme is not visible and not active
-		- Returns 1 if the theme is visible and not active
-		- Returns 2 if theme is and active and not visible
-		- Returns 3 if theme is and visible and active
-	 */
-	virtual int visibility()
-	{	return enableVisibility_; }
-
-	//! Sets whether the theme should be visible and/or active
-	/*! 
-		- Returns 0 if the theme is not visible and not active
-		- Returns 1 if the theme is visible and not active
-		- Returns 2 if theme is and active and not visible
-		- Returns 3 if theme is and visible and active
-	 */
-	virtual void visibility(int v)
-	{	enableVisibility_ = v; }
-	//@}
-	
-	/** @name Grouping
-		Methods related to grouping of objects of the theme. Each group is
-		represented by a specific presentation visual called legend. An slice
-		represents the range of values of an attribute that characterizes a group.
-	*/
-	//@{
-	//! Returns a grouping associated the theme 
-	virtual TeGrouping& grouping() { return grouping_; }
-	
-	//! Sets a grouping associated to the theme
-	virtual void grouping(const TeGrouping& g) 
-	{ grouping_ = g; }
-
-	//! Returns the vector of legends of the theme
-	virtual TeLegendEntryVector& legend() { return legend_; }
-
-	//! Sets the visual associated to a geometric representation in the n-th group of the theme 
-	virtual bool setGroupingVisual(int n, TeVisual* visual, TeGeomRep rep);
-
-	//! Sets the visual of the n-th group of the theme
-	virtual bool setGroupingVisual(int n, TeGeomRepVisualMap& vismap);
-
-	//! Clear the existing grouping of objects of this theme
-	virtual void resetGrouping ();
-
-	//! Clear the vector of legends
-	virtual void cleanLegend(); 
-
-	//! Save grouping parameters in memory passing an arbitrary set of slices
-	virtual bool buildGrouping(const TeGrouping& g, vector<TeSlice>& slices);
-
-	//! Returns the slices associated to the grouping of the theme
-	virtual TeSliceVector getSlices();
-	//@}
-
-	/** @name Legends
-		Legends are also used to define presentation characteristics of the objets
-		of the theme that aren't grouped, according to some specific characteristics
-		(such as being pointed, being queried, among others).
-	*/
-	//@{	
-	//! Sets a default legend of the objects of the theme
-	virtual void defaultLegend (TeLegendEntry& leg) 
-	{ defaultLegend_ = leg; }
-
-	//! Returns the default legend of the objects of the theme
-	virtual TeLegendEntry& defaultLegend () 
-	{ return defaultLegend_; }
-
-	//! Sets the visual of the default legend for a specific geometrical representation
-	virtual void setVisualDefault (TeVisual* visual, TeGeomRep rep)
-	{ defaultLegend_.setVisual(visual, rep); }
-
-	//! Sets a legend for objects of the layer that weren't selected in this theme
-	/*! Useful when is necessary to see the theme in the context of the layer */
-	virtual void outOfCollectionLegend (TeLegendEntry &leg) 
-	{ outOfCollectionLegend_ = leg;}
-
-	//! Returns the legend of the layer objects that are not selected in this layer.
-	virtual TeLegendEntry& outOfCollectionLegend () 
-	{ return outOfCollectionLegend_; } 
-	
-	//! Sets the visual of the non-selected objects legend for a specific geometrical representation
-	virtual void setVisualOutOfCollection (TeVisual* visual, TeGeomRep rep)
-	{ outOfCollectionLegend_.setVisual(visual, rep); }
-
-	//! Sets a legend for objects that have geometries but not descriptive attributes
-	/*! Useful when in intermediary situations such as editing */
-	virtual void withoutDataConnectionLegend (TeLegendEntry &leg) 
-	{ withoutDataConnectionLegend_ = leg; }
-
-	//! Returns the legend of objects that have geometries but not descriptive attributes
-	virtual TeLegendEntry& withoutDataConnectionLegend () 
-	{ return withoutDataConnectionLegend_; }
-
-	//! Sets the visual of the without-attributes objects legend for a specific geometrical representation
-	virtual void setVisualWithoutDataConnection (TeVisual* visual, TeGeomRep rep)
-	{ withoutDataConnectionLegend_.setVisual(visual, rep); }
-	
-	//! Sets a legend for the theme objects selected by pointing
-	virtual void pointingLegend (TeLegendEntry &leg) 
-	{ pointingLegend_ = leg; }
-
-	//! Returns the legend of the theme objects selected by pointing
-	virtual TeLegendEntry& pointingLegend () 
-	{ return pointingLegend_; }
-
-	//! Sets the visual of the pointed objects legend for a specific geometrical representation
-	virtual void setVisualPointing (TeVisual* visual, TeGeomRep rep)
-	{ pointingLegend_.setVisual(visual, rep); }
-
-	//! Sets a legend for the theme objects selected by a query
-	virtual void queryLegend (TeLegendEntry &leg) 
-	{ queryLegend_ = leg; }
-
-	//! Returns the legend of the theme objects selected by a query
-	virtual TeLegendEntry& queryLegend () 
-	{ return queryLegend_; }
-	
-	//! Sets the visual of the queried objects legend for a specific geometrical representation
-	virtual void setVisualQuery (TeVisual* visual, TeGeomRep rep)
-	{ queryLegend_.setVisual(visual, rep); }
-
-	//! Sets a legend for the theme objects selected by query and pointing
-	virtual void queryAndPointingLegend (TeLegendEntry &leg) 
-	{ queryAndPointingLegend_ = leg; }
-
-	//! Returns the legend of the theme objects selected by query and pointing
-	virtual TeLegendEntry& queryAndPointingLegend () 
-	{ return queryAndPointingLegend_; }
-
-    //! Returns the map of legend ids associated to each object
-	virtual map<string, int>& getObjLegendMap() 
-	{ return objLegendMap_; }
-
-	//! Returns the map of legend ids associated to each object
-	virtual map<string, int>& getObjOwnLegendMap() 
-	{ return objOwnLegendMap_; }
-
-	//! Sets the visual of the queried and pointed objects legend for a specific geometrical representation
-	virtual void setVisualQueryAndPointing (TeVisual* visual, TeGeomRep rep)
-	{ queryAndPointingLegend_.setVisual(visual, rep); }
-
-	//! Sets a legend for the theme objects
-	virtual void legend(TeLegendEntry& leg); 
-
-	/** @name Raster Visual
-	*  Methods to deal with the visual presentation of the raster representations
-	*/
-	//@{ 
-	//! Returns the visual presentation of raster geometry
-	virtual TeRasterTransform* rasterVisual() 
-	{ return rasterVisual_; }
-
-	//! Sets the visual presentation of raster geometry
-	virtual void rasterVisual(TeRasterTransform* r) 
-	{ rasterVisual_ = r; } 
-
-	//! Removes the visual presentation of the raster
-	virtual void removeRasterVisual();
-
-	//! Creates an appropriate visual presentation to the raster of the theme
-	virtual void createRasterVisual(TeRaster* rst=0);
-	//@}
-	//@}
-
-	/** @name Box
-	    Methods related to the bounding box of a theme
-	*/
-	//@{ 
-	//! Returns the theme box 
-	virtual TeBox& getThemeBox()
-	{	return themeBox_; }
-
-	//! Sets the theme box 
-	virtual void setThemeBox(const TeBox& box)
-	{	themeBox_ = box; }
-
-	//! Returns the theme box 
-	virtual TeBox& box()
-	{	return themeBox_; }
-	//@}
-
-	//! Sets the parent node. The abstract theme does not have parent node.
-	virtual void setParent (TeViewNode* );
-	
-	//! Returns TRUE if a theme has lower priority than another
-	virtual bool operator< (const TeAbstractTheme& r) const
-	{	return viewNodeParams_.priority_ < r.viewNodeParams_.priority_; }
-
-	//! Clear the set containing the objects of the theme
-	virtual void clearObjectSet()
-	{ objectSet_.clear(); }
-
-	//! Return the number of objects of the layer
-	virtual int getNumLayerObjects()
-	{ return numLayerObjects_; }
-
-	//! Return the map containing the status of the objects
-	virtual map<string, int>& getObjStatusMap()
-	{ return objStatusMap_; }
-
-	//! Set the status of the objects to the default state
-	virtual void clearObjStatus()
-	{ objStatusMap_.clear(); }
-
-	//! Set the status of the items to the default state
-	virtual void clearItemStatus()
-	{ itemStatusMap_.clear(); }
-
-	//! Return the map containing the status of the items
-	virtual map<string, int>& getItemStatusMap()
-	{ return itemStatusMap_; }
-
-	//! the status
-	virtual void setStatus(vector<string>& oidVec, vector<string>& itemVec, int status);
-
-	//! the status for the items that were toggled
-	virtual void setStatusForItemsToggled(set<string>& oidSet, vector<string>& itemVec);
-
-	//! Set the status for the objects that were toggled
-	virtual void setStatusForObjectToggled(string oid);
-
-	//! Set the status for the new set of objects that were pointed
-	virtual void setStatusForNewObjectsPointed(set<string>& oidSet);
-
-	//! Set the status for the additional set of objects that were pointed
-	virtual void setStatusForObjectsAddedByPointing(set<string>& oidSet);
-
-	//! Set the status for the new set of items that were pointed
-	virtual void setStatusForNewItemsPointed(vector<string>& itemVec);
-
-	//! Set the status for the additional set of items that were pointed
-	virtual void setStatusForItemsAddedByPointing(vector<string>& itemVec);
-
-	//! Set the status for the new set of items that were queried
-	virtual void setStatusForNewItemsQueried(set<string>& oidSet, vector<string>& uidVec);
-
-	//! Set the status for the additional set of items that were queried
-	virtual void setStatusForItemsAddedByQuerying(set<string>& oidSet, vector<string>& uidVec);
-
-	//! Set the status for the set of items that were filtered by a query operation
-	virtual void setStatusForItemsFilteredByQuerying(set<string>& oidSet, vector<string>& uidVec);
-
-	//! Remove the pointing color
-	virtual void removePointingColor();
-
-	//! Remove the query color
-	virtual void removeQueryColor();
-
-	//! Invert the pointing status of the objects
-	virtual void invertObjectStatus();
-
-	//! Set the objects to the default status
-	virtual void setObjectsToDefaultStatus();
-
-	//! Gets the creation time of the theme
-	virtual TeTime getCreationTime() const;
-
-	//! Sets in memory the creation time of the theme
-	virtual void setCreationTime(const TeTime& creationTime);
-
-	//! Updates the creation in memory and in the database
-	virtual bool updateThemeCreationTime(TeDatabase* database);
-
-	//! Checks if the theme is update. If FALSE, the theme may be not be updated.
-	virtual bool isUpdated();
-
-	//! Save the theme parameters
-	virtual bool save() = 0;
-
-	//! Save the grouping parameters in memory when there is no chronon
-	virtual bool buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll,
-		               vector<double>* dValuesVec = 0) = 0;
-
-	//! Save the grouping parameters in memory when there is chronon
-	virtual bool buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec) = 0;
-	
-	
-	//! Build the grouping and associate each object to its group  
-	virtual bool saveGrouping(TeSelectedObjects selectedObjects = TeAll) = 0;
-
-	//! Delete grouping
-	virtual bool deleteGrouping() = 0; 
-
-	//! Set the legend id for each object of the theme 
-	virtual void setLegendsForObjects() = 0;
-
-	//! Set the own legend id for each object of the theme 
-	virtual void setOwnLegendsForObjects() = 0;
-
-	/** @name Locate geometries
-	    Returns the geometry(ies) of the theme given coordinate
-	*/
-	//@{ 	
-	virtual bool locatePolygon		(TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0) = 0;
-	virtual bool locatePolygonSet   (TeCoord2D &pt, double tol, TePolygonSet &polygons) = 0;
-	virtual bool locateLine		(TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0) = 0;
-	virtual bool locatePoint	(TeCoord2D &pt, TePoint &point, const double& tol = 0.0) = 0;
-	virtual bool locateCell		(TeCoord2D &pt, TeCell &c, const double& tol = 0.0) = 0;
-	//@}
-
-	//! Get the set of objects corresponding to the object selection criteria
-	virtual set<string> getObjects(TeSelectedObjects selectedObjects = TeAll) = 0;
-
-	//! Get the set of objects corresponding to the list of items
-	virtual set<string> getObjects(const vector<string>& itemVec) = 0;
-
-	//! Get the set of items corresponding to the object selection criteria
-	virtual vector<string> getItemVector(TeSelectedObjects selectedObjects) = 0;
-
-	//! Get the set of items corresponding to the set of objects
-	virtual vector<string> getItemVector(const set<string>& oidSet) = 0;
-
-	//! Get the number of objects acessible by this theme
-	virtual unsigned int getNumberOfObjects()=0; 
-
-	//! Save (insert or update) the theme metadata in the database
-	virtual bool saveMetadata(TeDatabase* ) = 0;	
-	
-protected:
-	string		generateAttributeRest_;
-	string		generateTemporalRest_;
-	string		generateSpatialRest_; //future use
-
-	TeSpatialRelation	spatialRelation_;
-	bool				hasSpatialRes_;
-	TeBox				boxRest_;		//box which defines the spatial restriction 
-	TeGeometry*			geomRest_;		//geometry which defines the spatial restriction 
-	TeGeomRep			geomRepRest_;	//geometry representation of the theme which will be 
-										//considered in the spatial restriction  
-	// Display scale
-	double	minScale_;
-	double	maxScale_;
-
-	//representation visible in the theme
-	int visibleRep_;
-
-	//Theme status
-	int	enableVisibility_;
-
-	// ----------------- grouping information -----------------
-	TeGrouping		grouping_;
-
-	// ----------------- legend information -----------------
-	TeLegendEntryVector	legend_;
-
-	// Background Legend
-	TeLegendEntry		outOfCollectionLegend_;			//group(-1) 
-	TeLegendEntry		withoutDataConnectionLegend_;	//group(-2) 
-	TeLegendEntry		defaultLegend_;					//group(-3) 
-	TeLegendEntry		pointingLegend_;				//group(-4) 
-	TeLegendEntry		queryLegend_;					//group(-5) 
-	TeLegendEntry		queryAndPointingLegend_;		//group(-6)
-
-	map<string, int>	objLegendMap_;					// object legend
-	map<string, int>	objOwnLegendMap_;				// object own legend
-		
-	//! visual of raster
-	TeRasterTransform*	rasterVisual_;
-	
-	TeBox	themeBox_;
-
-	//! A set containing the theme objects
-	set<string> objectSet_;
-
-	//! Number of objects of the layer
-	int numLayerObjects_;
-
-	//! Status of the item (concatenation of the unique names of each theme table)
-	map<string, int> itemStatusMap_;
-
-	//! Status of the object
-	map<string, int> objStatusMap_;
-
-	//! Stores the creation time of the theme
-	TeTime creationTime_;
-
-	//! Load the theme metadata from database
-	virtual bool loadMetadata(TeDatabase* ) = 0;
-
-	//! Erase the theme metadata in the database
-	virtual bool eraseMetadata(TeDatabase* ) = 0;
-};
-
-//! A vector of pointers to theme
-typedef vector<TeAbstractTheme*>	TeThemeVector;
-
-//! A map from theme identifiers to pointers to theme
-typedef map<int, TeAbstractTheme*>	TeThemeMap;
-
-/*! \example creaTeAbstractTheme.cpp
-	Shows how to create themes in TerraLib.
- */
-
-/*! \example themeGrouping.cpp
-	Shows how to do a grouping on the objects of a TerraLib theme.
- */
-
-/*! \example rasterSlicing.cpp
-	Shows how to  create a legend over a raster data, stored in a layer TerraLib.
- */
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAbstractTheme.h
+	\brief This file contains definitions about an abstract theme in TerraLib. 
+*/
+#ifndef  __TERRALIB_INTERNAL_ABSTRACT_THEME_H
+#define  __TERRALIB_INTERNAL_ABSTRACT_THEME_H
+
+#include "TeDefines.h"
+#include "TeLegendEntry.h"
+#include "TeGeometry.h"
+#include "TeViewNode.h"
+#include "TeAttribute.h"
+
+class TeRasterTransform;
+class TeRaster;
+class TeDatabase;
+struct TeRepresentation;
+
+#include <string>
+#include <set>
+
+//! A grouping structure
+/*!
+	The TeGrouping is a structure that describes how the objects of a theme should
+	be grouped, or separated in groups.
+*/
+struct TL_DLL TeGrouping
+{
+	//! Returns the attribute used to group the objects of the theme
+	TeAttributeRep	groupAttribute_;
+	
+	//! Returns the attribute used to normalize a grouping 
+	string	groupNormAttribute_;
+	
+	//! Returns the grouping mode 
+	TeGroupingMode	groupMode_;			
+	
+	//! Returns the number of groups
+	int	groupNumSlices_;	
+	
+	//! Returns the numeric precision used to group objects
+	int	groupPrecision_;
+
+	//! Returns the deviation parameter used to group objects
+	double	groupStdDev_;
+
+	//! Aggregate function
+	string	groupFunction_; 
+
+	//! Show missing data
+	bool	groupNullAttr_; 
+
+	//! Minimum value used to calculate a equal step grouping
+	double groupMinVal_;
+
+	//! Maximum value used to calculate a equal step grouping 
+	double groupMaxVal_;
+
+	//! Chronon used for grouping
+	TeChronon groupChronon_;
+
+	//! Constructor
+	TeGrouping(TeAttributeRep att=TeAttributeRep(), const string& normAttr="", 
+				TeGroupingMode gMode=TeNoGrouping, int numSlice=0, int gPrecision=6,  
+				double	gStDev=1.0, const string& func="", TeChronon gChronon = TeNOCHRONON): 
+			groupAttribute_(att),
+			groupNormAttribute_(normAttr),
+			groupMode_(gMode),
+			groupNumSlices_(numSlice),
+			groupPrecision_(gPrecision),
+			groupStdDev_(gStDev),
+			groupFunction_(func),
+			groupNullAttr_(false),
+			groupMinVal_(TeMAXFLOAT),
+			groupMaxVal_(TeMINFLOAT),
+			groupChronon_(gChronon)
+			{}
+
+	//! Copy constructor
+	TeGrouping(const TeGrouping& other)
+	{	
+		groupAttribute_		= other.groupAttribute_;
+		groupNormAttribute_	= other.groupNormAttribute_;
+		groupMode_			= other.groupMode_;
+		groupNumSlices_		= other.groupNumSlices_;
+		groupPrecision_		= other.groupPrecision_;
+		groupStdDev_		= other.groupStdDev_;
+		groupFunction_		= other.groupFunction_;
+		groupNullAttr_		= other.groupNullAttr_;
+		groupMinVal_		= other.groupMinVal_;
+		groupMaxVal_		= other.groupMaxVal_;
+		groupChronon_			= other.groupChronon_;
+	}
+			
+	//! Destructor
+	~TeGrouping() {}
+	
+	//! Copy constructor
+	TeGrouping& operator= (const TeGrouping& other)
+	{	
+		if ( this != &other )
+		{		
+			groupAttribute_		= other.groupAttribute_;
+			groupNormAttribute_	= other.groupNormAttribute_;
+			groupMode_			= other.groupMode_;
+			groupNumSlices_		= other.groupNumSlices_;
+			groupPrecision_		= other.groupPrecision_;
+			groupStdDev_		= other.groupStdDev_;
+			groupFunction_		= other.groupFunction_;
+			groupNullAttr_		= other.groupNullAttr_;
+			groupNullAttr_		= other.groupNullAttr_;
+			groupMinVal_		= other.groupMinVal_;
+			groupMaxVal_		= other.groupMaxVal_;
+			groupChronon_		= other.groupChronon_;
+		}
+		return *this;
+	}
+};
+
+using namespace std;
+
+
+//! An abstract theme class
+class TL_DLL TeAbstractTheme: public TeViewNode
+{
+
+	friend class TeDatabase;
+public :
+	//! return the temporary state of theme
+	short temporaryVisibility(void) { return temporaryVisibility_;}
+	//! set the temporary state of theme
+	void temporaryVisibility(short state) { temporaryVisibility_=state;}
+	//! Set the visible temporary representation
+	void temporaryRepresentation(int rep) { temporaryRepresentation_=rep;}
+	//! Return the visible temporary representation
+	int temporaryRepresentation(void) { return temporaryRepresentation_;}
+
+protected :
+
+	// if theme is visible or not only memory (TeCanvas)
+	short		temporaryVisibility_;
+	
+	// set the active representation on memory (TeCanvas);
+	int			temporaryRepresentation_;
+
+public:
+	//! Constructor
+    TeAbstractTheme(const string& name, TeViewNode* parent, const int& view, const int& id, const TeViewNodeType& nodeType);
+
+	//! Constructor
+	TeAbstractTheme(const TeViewNodeParams& params);
+
+	//! Copy constructor
+	TeAbstractTheme(const TeAbstractTheme& other);
+
+	//! Destructor
+	virtual ~TeAbstractTheme();
+
+	//! Assignment operator
+	TeAbstractTheme& operator= (const TeAbstractTheme& other); 
+
+	/** @name Scale
+		Methods related to the range of scales where this theme should be visible
+	*/
+	//@{	
+
+	//! Returns a pointer to a projection that is the spatial reference for the objects of this theme
+	/*! Concrete classes should reimplement this method.*/
+	virtual TeProjection* getThemeProjection() = 0;
+
+	//! Returns the minimum scale in which the theme is visible
+	virtual double minScale() { return minScale_; }
+
+	//! Sets the minimum scale in which the theme is visible
+	virtual void minScale(double s) { minScale_ = s; }
+
+	//! Returns the maximum scale in which the theme is visible
+	virtual double maxScale() { return maxScale_; }
+
+	//! Sets the maximum scale in which the theme is visible
+	virtual void maxScale(double s) { maxScale_ = s; }
+	//@}
+
+	/** @name Restrictions
+		Methods related to the restrictions over the theme used to generate this theme
+	*/
+	//@{
+	//! Verifies if this theme has any kind of restrictions
+	virtual bool hasRestriction() { return (!(generateAttributeRest_.empty() || 
+									  generateTemporalRest_.empty()) && hasSpatialRes_); }
+
+	//! Returns the attribute restriction (where clause) used to generate the theme  
+	virtual string attributeRest() { return generateAttributeRest_; }
+
+	//! Sets the attribute restriction (where clause) used to generate the theme
+	virtual void attributeRest(const string& s) { generateAttributeRest_ = s; }
+
+	//! Returns if there is an attribute restriction  
+	virtual bool hasAttrRest () { return (!generateAttributeRest_.empty());}
+
+	//! Returns the temporal restriction used to generate the theme
+	virtual string temporalRest() { return generateTemporalRest_; }
+
+	//! Sets the temporal restriction used to generate the theme
+	virtual void temporalRest(const string& t) { generateTemporalRest_ = t; };
+
+	//! Returns TRUE if there is a temporal restriction defined in the theme 
+	virtual bool hasTemporalRest() { return (!generateTemporalRest_.empty());}
+
+	//! Returns the spatial restriction used to generate the theme
+	virtual string spatialRest() { return generateSpatialRest_; }
+
+	//! Sets the spatial restriction used to generate the theme
+	virtual void spatialRest(const string& s) { generateSpatialRest_ = s; };
+	
+	//! Returns the spatial relation (e.g WITHIN, COVERED BY, etc.) associate to the spatial restriction
+	virtual TeSpatialRelation	spatialRelation() { return spatialRelation_;}
+
+	//! Sets the spatial relation (e.g WITHIN, COVERED BY, etc.) associate to the spatial restriction
+	virtual void spatialRelation(TeSpatialRelation s) {spatialRelation_=s;}
+	
+	//! Returns TRUE if this theme has a spatial restriction  
+	virtual bool hasSpatialRest() { return hasSpatialRes_;}
+
+	//! Sets the flag that indicates that there is a spatial restriction 
+	virtual void hasSpatialRest(bool a) {hasSpatialRes_ = a;}
+	
+	//! Returns the box associated with the spatial restriction
+	virtual TeBox boxRestriction() { return boxRest_;}
+
+	//! Sets the box associated with the spatial restriction
+	virtual void boxRestriction(TeBox& b) {boxRest_ = b;}
+
+	//! Returns a pointer to the geometry associated with the spatial restriction
+	virtual TeGeometry* geomRestriction() { return geomRest_;}
+
+	//! Sets a pointer to the geometry associated with the spatial restriction
+	virtual void geomRestriction(TeGeometry* g) {geomRest_ = g;}
+
+	//! Returns the geometry representation of the theme which will be considered in the spatial restriction  
+	virtual TeGeomRep geomRepRestriction() { return geomRepRest_; }
+
+	//! Sets the geometry representation of the theme which will be considered in the spatial restriction  
+	virtual void geomRepRestriction (TeGeomRep& rep) { geomRepRest_ = rep; }
+
+	//! Sets the spatial restriction to be a spatial relation with a box
+	virtual void setSpatialRest(TeBox& box, TeGeomRep rep, TeSpatialRelation relation = TeWITHIN); 
+
+	//! Sets the spatial restriction to be a spatial relation with a geometry
+	virtual void setSpatialRest(TeGeometry* geom, TeGeomRep rep, TeSpatialRelation relation = TeWITHIN); 
+	//@}
+	
+	
+	/** @name Visibility/Status
+		Methods related to the visibility/status of the theme and its components: graphs,
+		geometrical representations of the objects, grouping.
+	*/
+	//@{
+	//! Sets the components or representations of the theme that are visible
+	/*!
+		The param rep is a combination of any type of geometrical representation (TeGeomRep) plus:
+		- 0x20000000: representing the visibility of the legend
+		- 0x40000000: representing the visibility of the groupings
+		- 0x80000000: representing the visibility of the pie/chart graphs
+	*/
+	virtual void visibleRep(int rep) { visibleRep_ = rep; }
+
+	//! Returns the components or representations of the theme that are visible 
+	/*!
+		The result is a combination of any type of geometrical representation (TeGeomRep) plus:
+		- 0x20000000: representing the visibility of the legend
+		- 0x40000000: representing the visibility of the groupings
+		- 0x80000000: representing the visibility of the pie/chart graphs
+	*/
+	virtual int visibleRep() { return visibleRep_; }
+
+	//! Returns the geometrical representations of the theme that are visible
+	virtual int visibleGeoRep();
+
+	virtual void setAvailability(const bool& avaiability);
+
+	const bool& isAvailable() const;
+
+	/** \brief
+	 * 	\return
+	 */
+	bool isEditable() const;
+
+	/**	\brief
+	 * 	\param editable
+	 */
+	void setEditable(const bool& editable);
+
+	//! Returns a status of a theme
+	/*! 
+		- Returns 0 if the theme is not visible and not active
+		- Returns 1 if the theme is visible and not active
+		- Returns 2 if theme is and active and not visible
+		- Returns 3 if theme is and visible and active
+	 */
+	virtual int visibility()
+	{	return enableVisibility_; }
+
+	//! Sets whether the theme should be visible and/or active
+	/*! 
+		- Returns 0 if the theme is not visible and not active
+		- Returns 1 if the theme is visible and not active
+		- Returns 2 if theme is and active and not visible
+		- Returns 3 if theme is and visible and active
+	 */
+	virtual void visibility(int v)
+	{	enableVisibility_ = v; }
+	//@}
+	
+	/** @name Grouping
+		Methods related to grouping of objects of the theme. Each group is
+		represented by a specific presentation visual called legend. An slice
+		represents the range of values of an attribute that characterizes a group.
+	*/
+	//@{
+	//! Returns a grouping associated the theme 
+	virtual TeGrouping& grouping() { return grouping_; }
+	
+	//! Sets a grouping associated to the theme
+	virtual void grouping(const TeGrouping& g) 
+	{ grouping_ = g; }
+
+	//! Returns the vector of legends of the theme
+	virtual TeLegendEntryVector& legend() { return legend_; }
+
+	//! Sets the visual associated to a geometric representation in the n-th group of the theme 
+	virtual bool setGroupingVisual(int n, TeVisual* visual, TeGeomRep rep);
+
+	//! Sets the visual of the n-th group of the theme
+	virtual bool setGroupingVisual(int n, TeGeomRepVisualMap& vismap);
+
+	//! Clear the existing grouping of objects of this theme
+	virtual void resetGrouping ();
+
+	//! Clear the vector of legends
+	virtual void cleanLegend(); 
+
+	//! Save grouping parameters in memory passing an arbitrary set of slices
+	virtual bool buildGrouping(const TeGrouping& g, vector<TeSlice>& slices);
+
+	//! Returns the slices associated to the grouping of the theme
+	virtual TeSliceVector getSlices();
+	//@}
+
+	/** @name Legends
+		Legends are also used to define presentation characteristics of the objets
+		of the theme that aren't grouped, according to some specific characteristics
+		(such as being pointed, being queried, among others).
+	*/
+	//@{	
+	//! Sets a default legend of the objects of the theme
+	virtual void defaultLegend (TeLegendEntry& leg) 
+	{ defaultLegend_ = leg; }
+
+	//! Returns the default legend of the objects of the theme
+	virtual TeLegendEntry& defaultLegend () 
+	{ return defaultLegend_; }
+
+	//! Sets the visual of the default legend for a specific geometrical representation
+	virtual void setVisualDefault (TeVisual* visual, TeGeomRep rep)
+	{ defaultLegend_.setVisual(visual, rep); }
+
+	//! Sets a legend for objects of the layer that weren't selected in this theme
+	/*! Useful when is necessary to see the theme in the context of the layer */
+	virtual void outOfCollectionLegend (TeLegendEntry &leg) 
+	{ outOfCollectionLegend_ = leg;}
+
+	//! Returns the legend of the layer objects that are not selected in this layer.
+	virtual TeLegendEntry& outOfCollectionLegend () 
+	{ return outOfCollectionLegend_; } 
+	
+	//! Sets the visual of the non-selected objects legend for a specific geometrical representation
+	virtual void setVisualOutOfCollection (TeVisual* visual, TeGeomRep rep)
+	{ outOfCollectionLegend_.setVisual(visual, rep); }
+
+	//! Sets a legend for objects that have geometries but not descriptive attributes
+	/*! Useful when in intermediary situations such as editing */
+	virtual void withoutDataConnectionLegend (TeLegendEntry &leg) 
+	{ withoutDataConnectionLegend_ = leg; }
+
+	//! Returns the legend of objects that have geometries but not descriptive attributes
+	virtual TeLegendEntry& withoutDataConnectionLegend () 
+	{ return withoutDataConnectionLegend_; }
+
+	//! Sets the visual of the without-attributes objects legend for a specific geometrical representation
+	virtual void setVisualWithoutDataConnection (TeVisual* visual, TeGeomRep rep)
+	{ withoutDataConnectionLegend_.setVisual(visual, rep); }
+	
+	//! Sets a legend for the theme objects selected by pointing
+	virtual void pointingLegend (TeLegendEntry &leg) 
+	{ pointingLegend_ = leg; }
+
+	//! Returns the legend of the theme objects selected by pointing
+	virtual TeLegendEntry& pointingLegend () 
+	{ return pointingLegend_; }
+
+	//! Sets the visual of the pointed objects legend for a specific geometrical representation
+	virtual void setVisualPointing (TeVisual* visual, TeGeomRep rep)
+	{ pointingLegend_.setVisual(visual, rep); }
+
+	//! Sets a legend for the theme objects selected by a query
+	virtual void queryLegend (TeLegendEntry &leg) 
+	{ queryLegend_ = leg; }
+
+	//! Returns the legend of the theme objects selected by a query
+	virtual TeLegendEntry& queryLegend () 
+	{ return queryLegend_; }
+	
+	//! Sets the visual of the queried objects legend for a specific geometrical representation
+	virtual void setVisualQuery (TeVisual* visual, TeGeomRep rep)
+	{ queryLegend_.setVisual(visual, rep); }
+
+	//! Sets a legend for the theme objects selected by query and pointing
+	virtual void queryAndPointingLegend (TeLegendEntry &leg) 
+	{ queryAndPointingLegend_ = leg; }
+
+	//! Returns the legend of the theme objects selected by query and pointing
+	virtual TeLegendEntry& queryAndPointingLegend () 
+	{ return queryAndPointingLegend_; }
+
+    //! Returns the map of legend ids associated to each object
+	virtual map<string, int>& getObjLegendMap() 
+	{ return objLegendMap_; }
+
+	//! Returns the map of legend ids associated to each object
+	virtual map<string, int>& getObjOwnLegendMap() 
+	{ return objOwnLegendMap_; }
+
+	//! Sets the visual of the queried and pointed objects legend for a specific geometrical representation
+	virtual void setVisualQueryAndPointing (TeVisual* visual, TeGeomRep rep)
+	{ queryAndPointingLegend_.setVisual(visual, rep); }
+
+	//! Sets a legend for the theme objects
+	virtual void legend(TeLegendEntry& leg); 
+
+	/** @name Raster Visual
+	*  Methods to deal with the visual presentation of the raster representations
+	*/
+	//@{ 
+	//! Returns the visual presentation of raster geometry
+	virtual TeRasterTransform* rasterVisual() 
+	{ return rasterVisual_; }
+
+	//! Sets the visual presentation of raster geometry
+	virtual void rasterVisual(TeRasterTransform* r) 
+	{ rasterVisual_ = r; } 
+
+	//! Removes the visual presentation of the raster
+	virtual void removeRasterVisual();
+
+	//! Creates an appropriate visual presentation to the raster of the theme
+	virtual void createRasterVisual(TeRaster* rst=0);
+	//@}
+	//@}
+
+	/** @name Box
+	    Methods related to the bounding box of a theme
+	*/
+	//@{ 
+	//! Returns the theme box 
+	virtual TeBox& getThemeBox()
+	{	return themeBox_; }
+
+	//! Sets the theme box 
+	virtual void setThemeBox(const TeBox& box)
+	{	themeBox_ = box; }
+
+	//! Returns the theme box 
+	virtual TeBox& box()
+	{	return themeBox_; }
+	//@}
+
+	//! Sets the parent node. The abstract theme does not have parent node.
+	virtual void setParent (TeViewNode* );
+	
+	//! Returns TRUE if a theme has lower priority than another
+	virtual bool operator< (const TeAbstractTheme& r) const
+	{	return viewNodeParams_.priority_ < r.viewNodeParams_.priority_; }
+
+	//! Clear the set containing the objects of the theme
+	virtual void clearObjectSet()
+	{ objectSet_.clear(); }
+
+	//! Return the number of objects of the layer
+	virtual int getNumLayerObjects()
+	{ return numLayerObjects_; }
+
+	//! Return the map containing the status of the objects
+	virtual map<string, int>& getObjStatusMap()
+	{ return objStatusMap_; }
+
+	//! Set the status of the objects to the default state
+	virtual void clearObjStatus()
+	{ objStatusMap_.clear(); }
+
+	//! Set the status of the items to the default state
+	virtual void clearItemStatus()
+	{ itemStatusMap_.clear(); }
+
+	//! Return the map containing the status of the items
+	virtual map<string, int>& getItemStatusMap()
+	{ return itemStatusMap_; }
+
+	//! the status
+	virtual void setStatus(vector<string>& oidVec, vector<string>& itemVec, int status);
+
+	//! the status for the items that were toggled
+	virtual void setStatusForItemsToggled(set<string>& oidSet, vector<string>& itemVec);
+
+	//! Set the status for the objects that were toggled
+	virtual void setStatusForObjectToggled(string oid);
+
+	//! Set the status for the new set of objects that were pointed
+	virtual void setStatusForNewObjectsPointed(set<string>& oidSet);
+
+	//! Set the status for the additional set of objects that were pointed
+	virtual void setStatusForObjectsAddedByPointing(set<string>& oidSet);
+
+	//! Set the status for the new set of items that were pointed
+	virtual void setStatusForNewItemsPointed(vector<string>& itemVec);
+
+	//! Set the status for the additional set of items that were pointed
+	virtual void setStatusForItemsAddedByPointing(vector<string>& itemVec);
+
+	//! Set the status for the new set of items that were queried
+	virtual void setStatusForNewItemsQueried(set<string>& oidSet, vector<string>& uidVec);
+
+	//! Set the status for the additional set of items that were queried
+	virtual void setStatusForItemsAddedByQuerying(set<string>& oidSet, vector<string>& uidVec);
+
+	//! Set the status for the set of items that were filtered by a query operation
+	virtual void setStatusForItemsFilteredByQuerying(set<string>& oidSet, vector<string>& uidVec);
+
+	//! Remove the pointing color
+	virtual void removePointingColor();
+
+	//! Remove the query color
+	virtual void removeQueryColor();
+
+	//! Invert the pointing status of the objects
+	virtual void invertObjectStatus();
+
+	//! Set the objects to the default status
+	virtual void setObjectsToDefaultStatus();
+
+	//! Gets the creation time of the theme
+	virtual TeTime getCreationTime() const;
+
+	//! Sets in memory the creation time of the theme
+	virtual void setCreationTime(const TeTime& creationTime);
+
+	//! Updates the creation in memory and in the database
+	virtual bool updateThemeCreationTime(TeDatabase* database);
+
+	//! Checks if the theme is update. If FALSE, the theme may be not be updated.
+	virtual bool isUpdated();
+
+	//! Save the theme parameters
+	virtual bool save() = 0;
+
+	//! Save the grouping parameters in memory when there is no chronon
+	virtual bool buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll,
+		               vector<double>* dValuesVec = 0) = 0;
+
+	//! Save the grouping parameters in memory when there is chronon
+	virtual bool buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec) = 0;
+	
+	
+	//! Build the grouping and associate each object to its group  
+	virtual bool saveGrouping(TeSelectedObjects selectedObjects = TeAll) = 0;
+
+	//! Delete grouping
+	virtual bool deleteGrouping() = 0; 
+
+	//! Set the legend id for each object of the theme 
+	virtual void setLegendsForObjects() = 0;
+
+	//! Set the own legend id for each object of the theme 
+	virtual void setOwnLegendsForObjects() = 0;
+
+	/** @name Locate geometries
+	    Returns the geometry(ies) of the theme given coordinate
+	*/
+	//@{ 	
+	virtual bool locatePolygon		(TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0) = 0;
+	virtual bool locatePolygonSet   (TeCoord2D &pt, double tol, TePolygonSet &polygons) = 0;
+	virtual bool locateLine		(TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0) = 0;
+	virtual bool locatePoint	(TeCoord2D &pt, TePoint &point, const double& tol = 0.0) = 0;
+	virtual bool locateCell		(TeCoord2D &pt, TeCell &c, const double& tol = 0.0) = 0;
+	//@}
+
+	//! Get the set of objects corresponding to the object selection criteria
+	virtual set<string> getObjects(TeSelectedObjects selectedObjects = TeAll) = 0;
+
+	//! Get the set of objects corresponding to the list of items
+	virtual set<string> getObjects(const vector<string>& itemVec) = 0;
+
+	//! Get the set of items corresponding to the object selection criteria
+	virtual vector<string> getItemVector(TeSelectedObjects selectedObjects) = 0;
+
+	//! Get the set of items corresponding to the set of objects
+	virtual vector<string> getItemVector(const set<string>& oidSet) = 0;
+
+	//! Get the number of objects acessible by this theme
+	virtual unsigned int getNumberOfObjects()=0; 
+
+	//! Save (insert or update) the theme metadata in the database
+	virtual bool saveMetadata(TeDatabase* ) = 0;	
+	
+protected:
+	string		generateAttributeRest_;
+	string		generateTemporalRest_;
+	string		generateSpatialRest_; //future use
+
+	TeSpatialRelation	spatialRelation_;
+	bool				hasSpatialRes_;
+	TeBox				boxRest_;		//box which defines the spatial restriction 
+	TeGeometry*			geomRest_;		//geometry which defines the spatial restriction 
+	TeGeomRep			geomRepRest_;	//geometry representation of the theme which will be 
+										//considered in the spatial restriction  
+	// Display scale
+	double	minScale_;
+	double	maxScale_;
+
+	//representation visible in the theme
+	int visibleRep_;
+
+	//Theme status
+	int	enableVisibility_;
+
+	// ----------------- grouping information -----------------
+	TeGrouping		grouping_;
+
+	// ----------------- legend information -----------------
+	TeLegendEntryVector	legend_;
+
+	// Background Legend
+	TeLegendEntry		outOfCollectionLegend_;			//group(-1) 
+	TeLegendEntry		withoutDataConnectionLegend_;	//group(-2) 
+	TeLegendEntry		defaultLegend_;					//group(-3) 
+	TeLegendEntry		pointingLegend_;				//group(-4) 
+	TeLegendEntry		queryLegend_;					//group(-5) 
+	TeLegendEntry		queryAndPointingLegend_;		//group(-6)
+
+	map<string, int>	objLegendMap_;					// object legend
+	map<string, int>	objOwnLegendMap_;				// object own legend
+		
+	//! visual of raster
+	TeRasterTransform*	rasterVisual_;
+
+	bool isAvailable_, //!< Theme source can be accessed.
+		isEditable_; 	//!< Theme can be edited.
+	
+	TeBox	themeBox_;
+
+	//! A set containing the theme objects
+	set<string> objectSet_;
+
+	//! Number of objects of the layer
+	int numLayerObjects_;
+
+	//! Status of the item (concatenation of the unique names of each theme table)
+	map<string, int> itemStatusMap_;
+
+	//! Status of the object
+	map<string, int> objStatusMap_;
+
+	//! Stores the creation time of the theme
+	TeTime creationTime_;
+
+public:
+	//! Load the theme metadata from database
+	virtual bool loadMetadata(TeDatabase* ) = 0;
+
+protected:
+
+	//! Erase the theme metadata in the database
+	virtual bool eraseMetadata(TeDatabase* ) = 0;
+};
+
+//! A vector of pointers to theme
+typedef vector<TeAbstractTheme*>	TeThemeVector;
+
+//! A map from theme identifiers to pointers to theme
+typedef map<int, TeAbstractTheme*>	TeThemeMap;
+
+/*! \example creaTeAbstractTheme.cpp
+	Shows how to create themes in TerraLib.
+ */
+
+/*! \example themeGrouping.cpp
+	Shows how to do a grouping on the objects of a TerraLib theme.
+ */
+
+/*! \example rasterSlicing.cpp
+	Shows how to  create a legend over a raster data, stored in a layer TerraLib.
+ */
+#endif
+
diff --git a/src/terralib/kernel/TeAffineGT.cpp b/src/terralib/kernel/TeAffineGT.cpp
old mode 100755
new mode 100644
index 67e2147..734edc4
--- a/src/terralib/kernel/TeAffineGT.cpp
+++ b/src/terralib/kernel/TeAffineGT.cpp
@@ -1,227 +1,276 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeAffineGT.h"
-
-#include "TeAgnostic.h"
-
-
-TeAffineGT::TeAffineGT()
-{
-}
-
-
-TeAffineGT::~TeAffineGT()
-{
-}
-
-
-void TeAffineGT::directMap( const TeGTParams& params, const TeCoord2D& pt1, 
-  TeCoord2D& pt2 ) const
-{
-  TEAGN_DEBUG_CONDITION( ( params.direct_parameters_.Ncol() == 3 ),
-    "Invalid number of columns" )
-  TEAGN_DEBUG_CONDITION( ( params.direct_parameters_.Nrow() == 3 ),
-    "Invalid number of rows" )
-  
-  double x = pt1.x();
-  double y = pt1.y();
-
-  pt2.x( params.direct_parameters_(0,0) * x + 
-         params.direct_parameters_(0,1) * y + 
-         params.direct_parameters_(0,2) );
-  pt2.y( params.direct_parameters_(1,0) * x + 
-         params.direct_parameters_(1,1) * y + 
-         params.direct_parameters_(1,2) );  
-}
-
-
-void TeAffineGT::inverseMap( const TeGTParams& params, const TeCoord2D& pt2, 
-  TeCoord2D& pt1 ) const
-{
-  TEAGN_DEBUG_CONDITION( ( params.inverse_parameters_.Ncol() == 3 ),
-    "Invalid number of columns" )
-  TEAGN_DEBUG_CONDITION( ( params.inverse_parameters_.Nrow() == 3 ),
-    "Invalid number of rows" )
-
-  double u = pt2.x();
-  double v = pt2.y();
-  
-  pt1.x( params.inverse_parameters_(0,0) * u +
-         params.inverse_parameters_(0,1) * v + 
-         params.inverse_parameters_(0,2) );
-  pt1.y( params.inverse_parameters_(1,0) * u + 
-         params.inverse_parameters_(1,1) * v + 
-         params.inverse_parameters_(1,2) );  
-}
-
-
-unsigned int TeAffineGT::getMinRequiredTiePoints() const
-{
-  return 3;
-}
-
-
-bool TeAffineGT::computeParameters( TeGTParams& params ) const
-{
-    /*
-            u = a1.x + a2.y + a3
-            v = b1.x + b2.y + b3
-
-            A . X + L = 0
-            N = At . A
-            U = At . L
-            X = - (N ^ -1) . U
-
-            A = |x1 y1 1  0  0  0|     Xt = |a1 a2 a3 b1 b2 b3|
-                |0  0  0  x1 y1 1|
-                |x2 y2 1  0  0  0|
-                |0  0  0  x2 y2 1|     Lt = |u1 v1 u2 v2 ... un vn|
-                |.  .  .  .  .  .|
-                |xn yn 1  0  0  0|
-                |0  0  0  xn yn 1|
-
-    */
-
-  const unsigned int tiepoints_size = params.tiepoints_.size();
-  TEAGN_DEBUG_CONDITION( ( tiepoints_size > 2 ),
-    "Invalid tie-points size" )
-
-  TeMatrix A;
-  if( ! A.Init( 2*tiepoints_size, 6 ) ) {
-    return false;
-  }
-    
-  TeMatrix L;
-  if( ! L.Init( 2*tiepoints_size, 1 ) ) {
-    return false;
-  }
-
-  TeMatrix At;
-  TeMatrix N;
-  TeMatrix U;
-  TeMatrix X;
-  TeMatrix N_inv;
-
-  std::vector< TeCoordPair >::const_iterator iterator;
-
-  TeCoord2D x_y;
-  TeCoord2D u_v;
-  double x = 0;
-  double y = 0;
-  
-  /* L calcule */
-
-  iterator = params.tiepoints_.begin() ;
-  for ( unsigned int L_block_offset = 0 ; ( L_block_offset < tiepoints_size ); 
-    ++L_block_offset ) {
-    
-    u_v = iterator->pt2;
-    
-    L( L_block_offset*2     , 0) = u_v.x();
-    L( L_block_offset*2 + 1 , 0) = u_v.y();
-    
-    ++iterator ;
-  }
-  
-  /* A calcule */
-
-  iterator = params.tiepoints_.begin();
-  for ( unsigned int A_block_offset = 0 ; (A_block_offset < tiepoints_size) ; 
-        ++A_block_offset) {
-        
-    x_y = iterator->pt1;    
-    x = x_y.x();
-    y = x_y.y();
-    
-    A( A_block_offset*2  , 0 ) = x ;
-    A( A_block_offset*2  , 1 ) = y ;
-    A( A_block_offset*2  , 2 ) = 1 ;
-    A( A_block_offset*2  , 3 ) = 0 ;
-    A( A_block_offset*2  , 4 ) = 0 ;
-    A( A_block_offset*2  , 5 ) = 0 ;
-    A( A_block_offset*2+1, 0 ) = 0 ;
-    A( A_block_offset*2+1, 1 ) = 0 ;
-    A( A_block_offset*2+1, 2 ) = 0 ;
-    A( A_block_offset*2+1, 3 ) = x ;
-    A( A_block_offset*2+1, 4 ) = y ;
-    A( A_block_offset*2+1, 5 ) = 1 ; 
-    
-    ++iterator;
-  }
-
-  /* At calcule */
-  A.Transpose( At );
-
-  /* N calcule */
-  N = At * A;
-
-  /* U calcule */
-  U = At * L;
-
-  /* N_inv calcule */
-  if ( N.Inverse( N_inv ) ) {
-    /* X calcule */
-
-    X = N_inv * U;
-    
-    if( ! params.direct_parameters_.Init( 3, 3 ) ) {
-      return false;
-    }    
-
-    params.direct_parameters_(0,0) = X(0,0);
-    params.direct_parameters_(0,1) = X(1,0);
-    params.direct_parameters_(0,2) = X(2,0);
-    params.direct_parameters_(1,0) = X(3,0);
-    params.direct_parameters_(1,1) = X(4,0);
-    params.direct_parameters_(1,2) = X(5,0);
-    params.direct_parameters_(2,0) = 0;
-    params.direct_parameters_(2,1) = 0;
-    params.direct_parameters_(2,2) = 1;
-
-    if( params.direct_parameters_.Inverse( params.inverse_parameters_ ) ) {
-      return true;
-    } else {
-      return false;
-    }
-  } else {
-    return false;   
-  }
-}
-
-
-bool TeAffineGT::isTransDefined( const TeGTParams& params )  const
-{
-  if( ( params.direct_parameters_.Nrow() == 3 ) &&
-    ( params.direct_parameters_.Ncol() == 3 ) &&
-    ( params.inverse_parameters_.Nrow() == 3 ) &&
-    ( params.inverse_parameters_.Ncol() == 3 ) )
-  {
-    return true;
-  }
-  else
-  {
-    return false;
-  }
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeAffineGT.h"
+
+#include "TeAgnostic.h"
+
+#include <math.h>
+
+TeAffineGT::TeAffineGT()
+{
+}
+
+
+TeAffineGT::~TeAffineGT()
+{
+}
+
+
+void TeAffineGT::directMap( const TeGTParams& params, const TeCoord2D& pt1, 
+  TeCoord2D& pt2 ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ), 
+    "Transformation not defined" );     
+  
+  double x = pt1.x();
+  double y = pt1.y();
+
+  pt2.x( params.direct_parameters_(0,0) * x + 
+         params.direct_parameters_(0,1) * y + 
+         params.direct_parameters_(0,2) );
+  pt2.y( params.direct_parameters_(1,0) * x + 
+         params.direct_parameters_(1,1) * y + 
+         params.direct_parameters_(1,2) );  
+}
+
+
+void TeAffineGT::inverseMap( const TeGTParams& params, const TeCoord2D& pt2, 
+  TeCoord2D& pt1 ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ), 
+    "Transformation not defined" );      
+
+  double u = pt2.x();
+  double v = pt2.y();
+  
+  pt1.x( params.inverse_parameters_(0,0) * u +
+         params.inverse_parameters_(0,1) * v + 
+         params.inverse_parameters_(0,2) );
+  pt1.y( params.inverse_parameters_(1,0) * u + 
+         params.inverse_parameters_(1,1) * v + 
+         params.inverse_parameters_(1,2) );  
+}
+
+
+unsigned int TeAffineGT::getMinRequiredTiePoints() const
+{
+  return 3;
+}
+
+bool TeAffineGT::decompose( const TeMatrix& inputMtx, double& translationX, 
+  double& translationY, double& scalingFactorX, double& scalingFactorY, 
+  double& skew, double& squeeze, double& scaling, double& rotation )
+{
+  TEAGN_TRUE_OR_THROW( inputMtx.Ncol() == 3, "invalid input matrix" );
+  TEAGN_TRUE_OR_THROW( inputMtx.Nrow() == 3, "invalid input matrix" );  
+  
+  double APar = inputMtx( 0, 0 );
+  double BPar = inputMtx( 0, 1 );
+  double CPar = inputMtx( 1, 0 );
+  double DPar = inputMtx( 1, 1 );
+  
+  double determinant = ( APar * DPar ) - ( BPar * CPar );
+  
+  if( determinant == 0.0 )
+  {
+    return false;
+  }
+  else if( determinant < 0.0 )
+  {
+    APar = inputMtx( 0, 1 );
+    BPar = inputMtx( 0, 0 );
+    CPar = inputMtx( 1, 1 );
+    DPar = inputMtx( 1, 0 );  
+    
+    determinant = ( APar * DPar ) - ( BPar * CPar );
+  }  
+  
+  const double FVar = 1.0 / ( ( APar * APar ) +
+    ( CPar * CPar ) );
+    
+  skew = ( ( APar * BPar ) + ( CPar * DPar ) ) * FVar;
+  
+  squeeze = 1.0 / sqrt( FVar * determinant );
+    
+  scaling = sqrt( determinant );
+  
+  scalingFactorX = scaling * squeeze;
+  
+  scalingFactorY = scaling / squeeze;
+  
+  translationX = inputMtx( 0 , 2 );
+  
+  translationY = inputMtx( 1 , 2 );
+  
+  rotation = atan( CPar / APar );
+  
+  return true;
+}
+
+bool TeAffineGT::computeParameters( TeGTParams& params ) const
+{
+    /*
+            u = a1.x + a2.y + a3
+            v = b1.x + b2.y + b3
+
+            A . X + L = 0
+            N = At . A
+            U = At . L
+            X = - (N ^ -1) . U
+
+            A = |x1 y1 1  0  0  0|     Xt = |a1 a2 a3 b1 b2 b3|
+                |0  0  0  x1 y1 1|
+                |x2 y2 1  0  0  0|
+                |0  0  0  x2 y2 1|     Lt = |u1 v1 u2 v2 ... un vn|
+                |.  .  .  .  .  .|
+                |xn yn 1  0  0  0|
+                |0  0  0  xn yn 1|
+
+    */
+
+  const unsigned int tiepoints_size = params.tiepoints_.size();
+  TEAGN_DEBUG_CONDITION( ( tiepoints_size > 2 ),
+    "Invalid tie-points size" )
+  TEAGN_DEBUG_CONDITION( params.transformation_name_ == "affine",
+    "Invalid transformation name" )    
+
+  TeMatrix A;
+  if( ! A.Init( 2*tiepoints_size, 6 ) ) {
+    return false;
+  }
+    
+  TeMatrix L;
+  if( ! L.Init( 2*tiepoints_size, 1 ) ) {
+    return false;
+  }
+
+  TeMatrix At;
+  TeMatrix N;
+  TeMatrix U;
+  TeMatrix X;
+  TeMatrix N_inv;
+
+  std::vector< TeCoordPair >::const_iterator iterator;
+
+  TeCoord2D x_y;
+  TeCoord2D u_v;
+  double x = 0;
+  double y = 0;
+  
+  /* L calcule */
+
+  iterator = params.tiepoints_.begin() ;
+  for ( unsigned int L_block_offset = 0 ; ( L_block_offset < tiepoints_size ); 
+    ++L_block_offset ) {
+    
+    u_v = iterator->pt2;
+    
+    L( L_block_offset*2     , 0) = u_v.x();
+    L( L_block_offset*2 + 1 , 0) = u_v.y();
+    
+    ++iterator ;
+  }
+  
+  /* A calcule */
+
+  iterator = params.tiepoints_.begin();
+  for ( unsigned int A_block_offset = 0 ; (A_block_offset < tiepoints_size) ; 
+        ++A_block_offset) {
+        
+    x_y = iterator->pt1;    
+    x = x_y.x();
+    y = x_y.y();
+    
+    A( A_block_offset*2  , 0 ) = x ;
+    A( A_block_offset*2  , 1 ) = y ;
+    A( A_block_offset*2  , 2 ) = 1 ;
+    A( A_block_offset*2  , 3 ) = 0 ;
+    A( A_block_offset*2  , 4 ) = 0 ;
+    A( A_block_offset*2  , 5 ) = 0 ;
+    A( A_block_offset*2+1, 0 ) = 0 ;
+    A( A_block_offset*2+1, 1 ) = 0 ;
+    A( A_block_offset*2+1, 2 ) = 0 ;
+    A( A_block_offset*2+1, 3 ) = x ;
+    A( A_block_offset*2+1, 4 ) = y ;
+    A( A_block_offset*2+1, 5 ) = 1 ; 
+    
+    ++iterator;
+  }
+
+  /* At calcule */
+  A.Transpose( At );
+
+  /* N calcule */
+  N = At * A;
+
+  /* U calcule */
+  U = At * L;
+
+  /* N_inv calcule */
+  if ( N.Inverse( N_inv ) ) {
+    /* X calcule */
+
+    X = N_inv * U;
+    
+    if( ! params.direct_parameters_.Init( 3, 3 ) ) {
+      return false;
+    }    
+
+    params.direct_parameters_(0,0) = X(0,0);
+    params.direct_parameters_(0,1) = X(1,0);
+    params.direct_parameters_(0,2) = X(2,0);
+    params.direct_parameters_(1,0) = X(3,0);
+    params.direct_parameters_(1,1) = X(4,0);
+    params.direct_parameters_(1,2) = X(5,0);
+    params.direct_parameters_(2,0) = 0;
+    params.direct_parameters_(2,1) = 0;
+    params.direct_parameters_(2,2) = 1;
+
+    if( params.direct_parameters_.Inverse( params.inverse_parameters_ ) ) {
+      return true;
+    } else {
+      return false;
+    }
+  } else {
+    return false;   
+  }
+}
+
+
+bool TeAffineGT::isTransDefined( const TeGTParams& params )  const
+{
+  if( ( params.transformation_name_ == "affine" ) &&
+    ( params.direct_parameters_.Nrow() == 3 ) &&
+    ( params.direct_parameters_.Ncol() == 3 ) &&
+    ( params.inverse_parameters_.Nrow() == 3 ) &&
+    ( params.inverse_parameters_.Ncol() == 3 ) )
+  {
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
diff --git a/src/terralib/kernel/TeAffineGT.h b/src/terralib/kernel/TeAffineGT.h
old mode 100755
new mode 100644
index 37a1e79..2c20d0f
--- a/src/terralib/kernel/TeAffineGT.h
+++ b/src/terralib/kernel/TeAffineGT.h
@@ -1,103 +1,122 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeAffineGT.h
-   \brief Affine geometric trasformation.
-*/
-
-
-#ifndef TEAFFINEGT_H
-  #define TEAFFINEGT_H
-  
-  #include "TeDefines.h"
-  #include <TeGeometricTransformation.h>
-
-  /**
-   * @brief This is the class to deal affine geometric trasformation.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup Utils
-   */
-  class TL_DLL TeAffineGT : public TeGeometricTransformation {
-    public :
-
-      /**
-       * @brief Default Constructor.
-       */
-      TeAffineGT();
-    
-      /**
-       * @brief Default Destructor
-       */
-      ~TeAffineGT();
-      
-      /**
-       * @brief Returns the minimum number of required tie-points for the current
-       * transformation.
-       *
-       * @return The minimum number of required tie-points for the current
-       * transformation.
-       */       
-      unsigned int getMinRequiredTiePoints() const;      
-      
-    protected :
-    
-      /**
-       * @brief Direct mapping ( from pt1 space into pt2 space ).
-       *
-       * @param params Transformation parameters.
-       * @param pt1 pt1 coordinate.
-       * @param pt2 pt2 coordinate.
-       */      
-      void directMap( const TeGTParams& params, const TeCoord2D& pt1, 
-        TeCoord2D& pt2 ) const;
-      
-      /**
-       * @brief Inverse mapping ( from pt2 space into pt1 space ).
-       *
-       * @param params Transformation parameters.
-       * @param pt2 pt2 coordinate.
-       * @param pt1 pt1 coordinate.
-       */      
-      void inverseMap( const TeGTParams& params, const TeCoord2D& pt2, 
-        TeCoord2D& pt1 ) const;      
-      
-      /**
-       * @brief Calculate the transformation parameters following the
-       * new supplied tie-points.
-       *
-       * @param params Transformation parameters.
-       * @return true if OK, false on errors.
-       */       
-      bool computeParameters( TeGTParams& params ) const;
-      
-      /**
-       * @brief Verifies if the supplied parameters already
-       * has a defined transformation.
-       * @param params Transformation parameters.
-       * @return true if a transformation is already defined, 
-       * false otherwise.
-       */       
-      bool isTransDefined( const TeGTParams& params ) const;        
-  };
-  
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAffineGT.h
+   \brief Affine geometric trasformation.
+*/
+
+
+#ifndef TEAFFINEGT_H
+  #define TEAFFINEGT_H
+  
+  #include "TeDefines.h"
+  #include <TeGeometricTransformation.h>
+
+  /**
+   * @brief 2D affine geometric trasformation.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup GeometricTransformationGroup
+   */
+  class TL_DLL TeAffineGT : public TeGeometricTransformation {
+    public :
+
+      /**
+       * @brief Default Constructor.
+       */
+      TeAffineGT();
+    
+      /**
+       * @brief Default Destructor
+       */
+      ~TeAffineGT();
+      
+      /**
+       * @brief Returns the minimum number of required tie-points for the current
+       * transformation.
+       *
+       * @return The minimum number of required tie-points for the current
+       * transformation.
+       */       
+      unsigned int getMinRequiredTiePoints() const;      
+      
+      /**
+       * @brief Returns the basic set of transform parameters given by
+       * the decomposition of a given affine transformation matrix.
+       * @param inputMtx Input affine transformation parameters.
+       * @param translationX X axis translation (combination of a squeeze and scaling).
+       * @param translationY Y axis translation (combination of a squeeze and scaling).
+       * @param scalingFactorX X axis scaling.
+       * @param scalingFactorX Y axis scaling.
+       * @param skew Skew.
+       * @param squeeze Aspect ratio changes.
+       * @param scaling Uniform scaling.
+       * @param rotation Rotation angle (radians).
+       * @return true if ok, false on errors.
+       */       
+      static bool decompose( const TeMatrix& inputMtx,
+        double& translationX, double& translationY,
+        double& scalingFactorX, double& scalingFactorY, double& skew,
+        double& squeeze, double& scaling, double& rotation ); 
+      
+    protected :
+    
+      /**
+       * @brief Direct mapping ( from pt1 space into pt2 space ).
+       *
+       * @param params Transformation parameters.
+       * @param pt1 pt1 coordinate.
+       * @param pt2 pt2 coordinate.
+       */      
+      void directMap( const TeGTParams& params, const TeCoord2D& pt1, 
+        TeCoord2D& pt2 ) const;
+      
+      /**
+       * @brief Inverse mapping ( from pt2 space into pt1 space ).
+       *
+       * @param params Transformation parameters.
+       * @param pt2 pt2 coordinate.
+       * @param pt1 pt1 coordinate.
+       */      
+      void inverseMap( const TeGTParams& params, const TeCoord2D& pt2, 
+        TeCoord2D& pt1 ) const;      
+      
+      /**
+       * @brief Calculate the transformation parameters following the
+       * new supplied tie-points.
+       *
+       * @param params Transformation parameters.
+       * @return true if OK, false on errors.
+       */       
+      bool computeParameters( TeGTParams& params ) const;
+      
+      /**
+       * @brief Verifies if the supplied parameters already
+       * has a defined transformation.
+       * @param params Transformation parameters.
+       * @return true if a transformation is already defined, 
+       * false otherwise.
+       */       
+      bool isTransDefined( const TeGTParams& params ) const;        
+  };
+  
+#endif
+
diff --git a/src/terralib/kernel/TeAffineGTFactory.cpp b/src/terralib/kernel/TeAffineGTFactory.cpp
old mode 100755
new mode 100644
index 85ab8ab..49e8fd9
--- a/src/terralib/kernel/TeAffineGTFactory.cpp
+++ b/src/terralib/kernel/TeAffineGTFactory.cpp
@@ -1,48 +1,48 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeAffineGTFactory.h"
-#include <TeAffineGT.h>
-#include <TeException.h>
-
-TeAffineGTFactory::TeAffineGTFactory()
-: TeGTFactory( std::string( "affine" ) )
-{
-};      
-
-TeAffineGTFactory::~TeAffineGTFactory()
-{
-};
-
-
-TeGeometricTransformation* TeAffineGTFactory::build ( 
-  const TeGTParams& )
-{
-  TeGeometricTransformation* instance_ptr = new TeAffineGT();
-  
-  if( ! instance_ptr ) {
-    throw TeException( FACTORY_PRODUCT_INSTATIATION_ERROR );
-  }
-  
-  return instance_ptr;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeAffineGTFactory.h"
+#include <TeAffineGT.h>
+#include <TeException.h>
+
+TeAffineGTFactory::TeAffineGTFactory()
+: TeGTFactory( std::string( "affine" ) )
+{
+};      
+
+TeAffineGTFactory::~TeAffineGTFactory()
+{
+};
+
+
+TeGeometricTransformation* TeAffineGTFactory::build ( 
+  const TeGTParams& )
+{
+  TeGeometricTransformation* instance_ptr = new TeAffineGT();
+  
+  if( ! instance_ptr ) {
+    throw TeException( FACTORY_PRODUCT_INSTATIATION_ERROR );
+  }
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/kernel/TeAffineGTFactory.h b/src/terralib/kernel/TeAffineGTFactory.h
old mode 100755
new mode 100644
index 64ab728..4b2e38d
--- a/src/terralib/kernel/TeAffineGTFactory.h
+++ b/src/terralib/kernel/TeAffineGTFactory.h
@@ -1,71 +1,71 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeAffineGTFactory.h
-    \brief This file contains the affine geometric trasformation factory
-*/
-
-#ifndef TEAFFINEGTFACTORY_H
-  #define TEAFFINEGTFACTORY_H
-  
-  #include "TeDefines.h"
-  #include <TeGTFactory.h>
-
-  /**
-   * @brief This is the affine geometric trasformation factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup Utils
-   */
-  class TL_DLL TeAffineGTFactory : public TeGTFactory
-  {
-    public :
-      
-      /**
-       * @brief Default constructor
-       */
-      TeAffineGTFactory();      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TeAffineGTFactory();
-      
-    protected :  
-    
-      /**
-       * @brief Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the used parameters.
-       * @return A pointer to the new generated instance.
-       */
-      TeGeometricTransformation* build( const TeGTParams& arg );
-      
-  };
-
-  namespace
-  {  
-    /** @brief A concrete factory instance for registering into the factory dictionary */
-    static TeAffineGTFactory TeAffineGTFactory_instance;
-  };
-  
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAffineGTFactory.h
+    \brief This file contains the affine geometric trasformation factory
+*/
+
+#ifndef TEAFFINEGTFACTORY_H
+  #define TEAFFINEGTFACTORY_H
+  
+  #include "TeDefines.h"
+  #include <TeGTFactory.h>
+
+  /**
+   * @brief This is the affine geometric trasformation factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup GeometricTransformationGroup
+   */
+  class TL_DLL TeAffineGTFactory : public TeGTFactory
+  {
+    public :
+      
+      /**
+       * @brief Default constructor
+       */
+      TeAffineGTFactory();      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TeAffineGTFactory();
+      
+    protected :  
+    
+      /**
+       * @brief Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the used parameters.
+       * @return A pointer to the new generated instance.
+       */
+      TeGeometricTransformation* build( const TeGTParams& arg );
+      
+  };
+
+  namespace
+  {  
+    /** @brief A concrete factory instance for registering into the factory dictionary */
+    static TeAffineGTFactory TeAffineGTFactory_instance;
+  };
+  
+#endif
+
diff --git a/src/terralib/kernel/TeAgnostic.cpp b/src/terralib/kernel/TeAgnostic.cpp
index f3f3fd9..76bcb8e 100644
--- a/src/terralib/kernel/TeAgnostic.cpp
+++ b/src/terralib/kernel/TeAgnostic.cpp
@@ -1,14 +1,14 @@
-#include "TeAgnostic.h"
-
-namespace TeAgnostic{
-
-  bool debugModeCheck()
-  {
-    #ifdef TEAGN_DEBUG_MODE
-      return true;
-    #else
-      return false;
-    #endif
-  }
-
-};
+#include "TeAgnostic.h"
+
+namespace TeAgnostic{
+
+  bool debugModeCheck()
+  {
+    #ifdef TEAGN_DEBUG_MODE
+      return true;
+    #else
+      return false;
+    #endif
+  }
+
+};
diff --git a/src/terralib/kernel/TeAgnostic.h b/src/terralib/kernel/TeAgnostic.h
index 2e06811..a66281f 100644
--- a/src/terralib/kernel/TeAgnostic.h
+++ b/src/terralib/kernel/TeAgnostic.h
@@ -1,397 +1,397 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/**
- * @file TeAgnostic.h
- * @brief This file contains a set of macros, routines and classes to deal with
- * system checking and logging facility.
- * They should NOT be used by anyone because the support and interfaces 
- * can be changed in future. THIS IS FOR INTERNAL USE ONLY.
- * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
- *
- * @note The following macros will be used:
- * 
- * @param TEAGN_DEBUG_MODE If defined, debug code macros will be compiled and
- * used or if not defined the compiler debug flag will be used.
- * @param TEAGN_ENABLE_STDOUT_LOG If defined, messages also will be logged
- * to STDOUT ( otherwise only TeErrorLog will log messages )
- * or if not defined the compiler debug flag will be used.
- */
-
-#ifndef TEAGNOSTIC_H
-  #define TEAGNOSTIC_H
-
-  #include <sstream>
-  #include <string>
-  #include <iostream>
-  
-  #include <TeException.h>
-  #include <TeErrorLog.h>   
-
-  /**
-   * @brief TeAgnostic debug mode selection based on NDEBUG define.
-   */
-  #ifndef TEAGN_DEBUG_MODE
-    #ifndef NDEBUG
-      /** @brief Debug mode selection flag. */
-      #define TEAGN_DEBUG_MODE
-      
-      /** @brief STDOUT logging selection flag. */
-      #ifndef TEAGN_ENABLE_STDOUT_LOG
-        #define TEAGN_ENABLE_STDOUT_LOG
-      #endif
-    #endif
-  #endif   
-
-  /**
-   * @brief Logs a message to stdout
-   *
-   * @param message Message to be logged.
-   */
-  #ifdef TEAGN_ENABLE_STDOUT_LOG
-    #define TEAGN_LOGMSG_STDOUT( message ) \
-      std::cout << std::endl << "Message : " \
-        << __FILE__ \
-        << ":" << __LINE__ \
-        << " - " << TeAgnostic::to_string( message ) \
-        << std::endl;
-  #else
-    #define TEAGN_LOGMSG_STDOUT( message ) {};
-  #endif
-
-    /**
-    * @brief Logs a error message to stderr
-    *
-    * @param message Message to be logged.
-    */
-  #ifdef TEAGN_ENABLE_STDOUT_LOG
-    #define TEAGN_LOGERR_STDOUT( message ) \
-      std::cerr << std::endl << "Error : " \
-        << __FILE__ \
-        << ":" << __LINE__ \
-        << " - " << TeAgnostic::to_string( message ) \
-        << std::endl;
-  #else
-    #define TEAGN_LOGERR_STDOUT( message ) {};
-  #endif
-
-    /**
-    * @brief Logs a warning message to stdout
-    *
-    * @param message Message to be logged.
-    */
-  #ifdef TEAGN_ENABLE_STDOUT_LOG
-    #define TEAGN_LOGWARN_STDOUT( message ) \
-      std::cout << std::endl << "Warning : " \
-        << __FILE__ \
-        << ":" << __LINE__ \
-        << " - " << TeAgnostic::to_string( message ) \
-        << std::endl;
-  #else
-    #define TEAGN_LOGWARN_STDOUT( message ) {};
-  #endif
-        
-
-  /**
-   * @brief Logs a message.
-   *
-   * @param message Message to be logged.
-   */
-  #define TEAGN_LOGMSG( message ) \
-  { \
-    TeErrorLog::instance().insert( LOG_MESSAGE, \
-      TeAgnostic::to_string( message ) ); \
-    TEAGN_LOGMSG_STDOUT( message ); \
-  };
-
-  /**
-   * @brief Logs a message.
-   *
-   * @param message Message to be logged.
-   */
-  #define TEAGN_LOGERR( message ) \
-  { \
-    TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE, \
-      TeAgnostic::to_string( message ) ); \
-    TEAGN_LOGERR_STDOUT( message ); \
-  };
-      
-  /**
-   * @brief Logs a warning message.
-   *
-   * @param message Message to be logged.
-   */
-  #define TEAGN_LOGWARN( message ) \
-  { \
-    TeErrorLog::instance().insert( LOG_MESSAGE, \
-     TeAgnostic::to_string( message ) ); \
-    TEAGN_LOGWARN_STDOUT( message ); \
-  };
-      
-  /**
-   * @brief Logs a message to stderr and throws.
-   *
-   * @param message Message to be logged.
-   */
-  #define TEAGN_LOG_AND_THROW( message ) \
-  { \
-    TEAGN_LOGERR_STDOUT( message ); \
-    throw TeException( UNKNOWN_ERROR_TYPE, \
-      TeAgnostic::to_string( message ), false ); \
-  };
-      
-  /**
-   * @brief Checks if value is true and throws an exception if not.
-   *
-   * @param value Value to be checked.
-   * @param message Message to be logged.
-   */
-  #define TEAGN_TRUE_OR_THROW( value , message ) \
-    if( value == 0 ) { \
-      TEAGN_LOGERR_STDOUT( TeAgnostic::to_string( message ) + \
-        " - " + TeAgnostic::to_string( #value ) ); \
-      throw TeException( UNKNOWN_ERROR_TYPE, \
-        TeAgnostic::to_string( message ), false ); \
-    };      
-
-  /**
-   * @brief Variable watching.
-   *
-   * @param variable Variable to be logged.
-   */
-  #define TEAGN_WATCH( variable ) \
-    { \
-      TEAGN_LOGMSG( "WATCH - " + TeAgnostic::to_string( #variable ) + \
-        "=" + TeAgnostic::to_string( variable ) ); \
-    };
-
-  /**
-   * @brief Checks if value is true and logs an warning message if not.
-   *
-   * @param value Value to be checked.
-   * @param message Message to be logged.
-   */
-  #define TEAGN_TRUE_OR_LOG( value , message ) \
-    if( value == 0 ) { \
-      TEAGN_LOGWARN( TeAgnostic::to_string( message ) + \
-        " - " + TeAgnostic::to_string( #value ) ); \
-    };
-
-  /**
-   * @brief Checks if value is true. For false values a warning message will be logged 
-   * and a return of context with false value will be done.
-   *
-   * @param value Value to be checked.
-   * @param message Message to be logged.
-   */
-  #define TEAGN_TRUE_OR_RETURN( value , message ) \
-    if( value == 0 ) { \
-      TEAGN_LOGWARN( TeAgnostic::to_string( message ) + \
-        " - " + TeAgnostic::to_string( #value ) ); \
-      return false; \
-    };
-    
-  /**
-   * @brief Checks if value is false. For true values a warning message 
-   * will be logged 
-   * and a return of context with false value will be done.
-   *
-   * @param value Value to be checked.
-   * @param message Message to be logged.
-   */
-  #define TEAGN_FALSE_OR_RETURN( value , message ) \
-    if( value != 0 ) { \
-      TEAGN_LOGWARN( TeAgnostic::to_string( message ) + \
-        " - " + TeAgnostic::to_string( #value ) ); \
-      return false; \
-    };    
-
-  /**
-   * @brief Logs a warning message will and return false.
-   *
-   * @param message Message to be logged.
-   */
-  #define TEAGN_LOG_AND_RETURN( message ) \
-    { \
-      TEAGN_LOGWARN( message ); \
-      return false; \
-    };
-
-  /**
-   * @brief Checks if value is false and logs an warning message if not.
-   *
-   * @param value Value to be checked.
-   * @param message Message to be logged.
-   */
-  #define TEAGN_FALSE_OR_LOG( value , message ) \
-    if( value != 0 ) { \
-      TEAGN_LOGWARN( TeAgnostic::to_string( message ) + \
-        " - " + TeAgnostic::to_string( #value ) ); \
-    };
-
-  /**
-   * @brief Checks if two values are equal and throws an exception if not.
-   *
-   * @param value1 Value to be checked.
-   * @param value2 Value to be checked.
-   * @param message Message to be logged.
-   */
-  #define TEAGN_CHECK_EQUAL( value1 , value2 , message ) \
-    TEAGN_TRUE_OR_THROW( ( ((double)value1) == ((double)value2) ), \
-    std::string( "Values must be equal [" ) + \
-    TeAgnostic::to_string( value1 ) + "!=" + \
-    TeAgnostic::to_string( value2 ) + "] - " + \
-    TeAgnostic::to_string( message ) );
-
-  /**
-   * @brief Checks if two values are diferent and throws an exception if not.
-   *
-   * @param value1 Value to be checked.
-   * @param value2 Value to be checked.
-   * @param message Message to be logged.
-   */
-  #define TEAGN_CHECK_NOTEQUAL( value1 , value2 , message ) \
-    TEAGN_TRUE_OR_THROW( ( ((double)value1) != ((double)value2) ), \
-    std::string( "Values can't be equal [" ) + \
-    TeAgnostic::to_string( #value1 ) + std::string( "==" ) + \
-    TeAgnostic::to_string( #value2 ) + std::string( "==" ) + \
-    TeAgnostic::to_string( value1 ) + std::string( "]" ) );
-
-  /**
-   * @brief  Checks if two values are equal ( within an EPS ) and
-   *  throws an exception if not.
-   *
-   * @param value1 Value to be checked.
-   * @param value2 Value to be checked.
-   * @param eps EPS ( threshold )
-   * @param message Message to be logged.
-   */
-  #define TEAGN_CHECK_EPS( value1 , value2 , eps , message ) \
-    { \
-      TEAGN_TRUE_OR_THROW( ( eps >= 0), "Invalid eps" ); \
-      double TEAGN_CHECK_EPS_double_diff = 0; \
-      double TEAGN_CHECK_EPS_double_value1 = (double)value1; \
-      double TEAGN_CHECK_EPS_double_value2 = (double)value2; \
-      double TEAGN_CHECK_EPS_double_eps = (double)eps; \
-      if( TEAGN_CHECK_EPS_double_value1 < TEAGN_CHECK_EPS_double_value2 ) { \
-        TEAGN_CHECK_EPS_double_diff = ( TEAGN_CHECK_EPS_double_value2 - \
-          TEAGN_CHECK_EPS_double_value1 ); \
-      } else { \
-        TEAGN_CHECK_EPS_double_diff = ( TEAGN_CHECK_EPS_double_value1 - \
-          TEAGN_CHECK_EPS_double_value2 ); \
-      }; \
-      TEAGN_TRUE_OR_THROW( \
-        ( TEAGN_CHECK_EPS_double_diff <= TEAGN_CHECK_EPS_double_eps ), \
-        std::string( "Values are not equal: " ) + \
-        TeAgnostic::to_string( #value1 ) + \
-        std::string( "=[") + \
-        TeAgnostic::to_string( TEAGN_CHECK_EPS_double_value1 ) + \
-        std::string( "] " ) + \
-        TeAgnostic::to_string( #value2 ) + \
-        std::string( "=[") + \
-        TeAgnostic::to_string( TEAGN_CHECK_EPS_double_value2 ) + \
-        std::string( "] eps=[") + \
-        TeAgnostic::to_string( TEAGN_CHECK_EPS_double_eps ) + \
-        std::string( "] diff=[") + \
-        TeAgnostic::to_string( TEAGN_CHECK_EPS_double_diff ) + \
-        std::string( "] - " ) + \
-        TeAgnostic::to_string( message ) \
-        ); \
-    };
-
-  /**
-   * @brief Throws an exception for not implemented source.
-   */
-  #define TEAGN_NOT_IMPLEMENTED \
-    TEAGN_LOG_AND_THROW( "Not Implemented." );
-
-  /**
-   *  @brief Checks if Debug mode is enabled and throws an exception if not.
-   */
-  #define TEAGN_DEBUG_MODE_CHECK \
-    TEAGN_TRUE_OR_THROW( TeAgnostic::debugModeCheck() , \
-    "Code not compiled with debug" );
-    
-  /**
-   * @brief Checks if value is true and throws an exception if not.
-   *
-   * @note This macro will be disabled for non debug mode.
-   *
-   * @param value Value to be checked.
-   * @param message Message to be logged.
-   */
-  #ifdef TEAGN_DEBUG_MODE
-    #define TEAGN_DEBUG_CONDITION( value , message ) \
-      TEAGN_TRUE_OR_THROW( value , message );
-  #else
-    #define TEAGN_DEBUG_CONDITION( value , message ) {};
-  #endif
-  
-  /**
-   * @brief Checks if value is true. For false values a warning message will be logged 
-   * and a return of context with false value will be done.
-   *
-   * @note This macro will be disabled for non debug mode.
-   *
-   * @param value Value to be checked.
-   * @param message Message to be logged.
-   */
-  #ifdef TEAGN_DEBUG_MODE
-    #define TEAGN_DEBUG_RETURN( value , message ) \
-      TEAGN_TRUE_OR_RETURN( value , message );
-  #else
-    #define TEAGN_DEBUG_RETURN( value , message ) {};
-  #endif  
-
-  /**
-   * @brief This namespace contains a set of routines and classes to deal with
-   *  system checking and logging facility.
-   * @ingroup Utils
-   */
-  namespace TeAgnostic{
-
-    /**
-     * @brief Data conversion to string.
-     *
-     * @param data Data to be converted.
-     * @return The converted string.
-     */
-     template< class T >
-     std::string to_string( const T& data )
-     {
-        std::stringstream temp_ss;
-        temp_ss.setf(std::ios_base::fixed);
-        temp_ss << data;
-        return temp_ss.str();
-     }
-
-    /**
-     * @brief Checks if the code was compiled with debug mode.
-     *
-     * @return true if debug mode was used at compilation time. false if not.
-     */
-     TL_DLL bool debugModeCheck();
-
-  };
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/**
+ * @file TeAgnostic.h
+ * @brief This file contains a set of macros, routines and classes to deal with
+ * system checking and logging facility.
+ * They should NOT be used by anyone because the support and interfaces 
+ * can be changed in future. THIS IS FOR INTERNAL USE ONLY.
+ * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ *
+ * @note The following macros will be used:
+ * 
+ * @param TEAGN_DEBUG_MODE If defined, debug code macros will be compiled and
+ * used or if not defined the compiler debug flag will be used.
+ * @param TEAGN_ENABLE_STDOUT_LOG If defined, messages also will be logged
+ * to STDOUT ( otherwise only TeErrorLog will log messages )
+ * or if not defined the compiler debug flag will be used.
+ */
+
+#ifndef TEAGNOSTIC_H
+  #define TEAGNOSTIC_H
+
+  #include <sstream>
+  #include <string>
+  #include <iostream>
+  
+  #include <TeException.h>
+  #include <TeErrorLog.h>   
+
+  /**
+   * @brief TeAgnostic debug mode selection based on NDEBUG define.
+   */
+  #ifndef TEAGN_DEBUG_MODE
+    #ifndef NDEBUG
+      /** @brief Debug mode selection flag. */
+      #define TEAGN_DEBUG_MODE
+      
+      /** @brief STDOUT logging selection flag. */
+      #ifndef TEAGN_ENABLE_STDOUT_LOG
+        #define TEAGN_ENABLE_STDOUT_LOG
+      #endif
+    #endif
+  #endif   
+
+  /**
+   * @brief Logs a message to stdout
+   *
+   * @param message Message to be logged.
+   */
+  #ifdef TEAGN_ENABLE_STDOUT_LOG
+    #define TEAGN_LOGMSG_STDOUT( message ) \
+      std::cout << std::endl << "Message : " \
+        << __FILE__ \
+        << ":" << __LINE__ \
+        << " - " << TeAgnostic::to_string( message ) \
+        << std::endl;
+  #else
+    #define TEAGN_LOGMSG_STDOUT( message ) {};
+  #endif
+
+    /**
+    * @brief Logs a error message to stderr
+    *
+    * @param message Message to be logged.
+    */
+  #ifdef TEAGN_ENABLE_STDOUT_LOG
+    #define TEAGN_LOGERR_STDOUT( message ) \
+      std::cerr << std::endl << "Error : " \
+        << __FILE__ \
+        << ":" << __LINE__ \
+        << " - " << TeAgnostic::to_string( message ) \
+        << std::endl;
+  #else
+    #define TEAGN_LOGERR_STDOUT( message ) {};
+  #endif
+
+    /**
+    * @brief Logs a warning message to stdout
+    *
+    * @param message Message to be logged.
+    */
+  #ifdef TEAGN_ENABLE_STDOUT_LOG
+    #define TEAGN_LOGWARN_STDOUT( message ) \
+      std::cout << std::endl << "Warning : " \
+        << __FILE__ \
+        << ":" << __LINE__ \
+        << " - " << TeAgnostic::to_string( message ) \
+        << std::endl;
+  #else
+    #define TEAGN_LOGWARN_STDOUT( message ) {};
+  #endif
+        
+
+  /**
+   * @brief Logs a message.
+   *
+   * @param message Message to be logged.
+   */
+  #define TEAGN_LOGMSG( message ) \
+  { \
+    TeErrorLog::instance().insert( LOG_MESSAGE, \
+      TeAgnostic::to_string( message ) ); \
+    TEAGN_LOGMSG_STDOUT( message ); \
+  };
+
+  /**
+   * @brief Logs a message.
+   *
+   * @param message Message to be logged.
+   */
+  #define TEAGN_LOGERR( message ) \
+  { \
+    TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE, \
+      TeAgnostic::to_string( message ) ); \
+    TEAGN_LOGERR_STDOUT( message ); \
+  };
+      
+  /**
+   * @brief Logs a warning message.
+   *
+   * @param message Message to be logged.
+   */
+  #define TEAGN_LOGWARN( message ) \
+  { \
+    TeErrorLog::instance().insert( LOG_MESSAGE, \
+     TeAgnostic::to_string( message ) ); \
+    TEAGN_LOGWARN_STDOUT( message ); \
+  };
+      
+  /**
+   * @brief Logs a message to stderr and throws.
+   *
+   * @param message Message to be logged.
+   */
+  #define TEAGN_LOG_AND_THROW( message ) \
+  { \
+    TEAGN_LOGERR_STDOUT( message ); \
+    throw TeException( UNKNOWN_ERROR_TYPE, \
+      TeAgnostic::to_string( message ), false ); \
+  };
+      
+  /**
+   * @brief Checks if value is true and throws an exception if not.
+   *
+   * @param value Value to be checked.
+   * @param message Message to be logged.
+   */
+  #define TEAGN_TRUE_OR_THROW( value , message ) \
+    if( ( value ) == 0 ) { \
+      TEAGN_LOGERR_STDOUT( TeAgnostic::to_string( message ) + \
+        " - " + TeAgnostic::to_string( #value ) ); \
+      throw TeException( UNKNOWN_ERROR_TYPE, \
+        TeAgnostic::to_string( message ), false ); \
+    };      
+
+  /**
+   * @brief Variable watching.
+   *
+   * @param variable Variable to be logged.
+   */
+  #define TEAGN_WATCH( variable ) \
+    { \
+      TEAGN_LOGMSG( "WATCH - " + TeAgnostic::to_string( #variable ) + \
+        "=[" + TeAgnostic::to_string( variable ) +"]" ); \
+    };
+
+  /**
+   * @brief Checks if value is true and logs an warning message if not.
+   *
+   * @param value Value to be checked.
+   * @param message Message to be logged.
+   */
+  #define TEAGN_TRUE_OR_LOG( value , message ) \
+    if( ( value ) == 0 ) { \
+      TEAGN_LOGWARN( TeAgnostic::to_string( message ) + \
+        " - " + TeAgnostic::to_string( #value ) ); \
+    };
+
+  /**
+   * @brief Checks if value is true. For false values a warning message will be logged 
+   * and a return of context with false value will be done.
+   *
+   * @param value Value to be checked.
+   * @param message Message to be logged.
+   */
+  #define TEAGN_TRUE_OR_RETURN( value , message ) \
+    if( ( value ) == 0 ) { \
+      TEAGN_LOGWARN( TeAgnostic::to_string( message ) + \
+        " - " + TeAgnostic::to_string( #value ) ); \
+      return false; \
+    };
+    
+  /**
+   * @brief Checks if value is false. For true values a warning message 
+   * will be logged 
+   * and a return of context with false value will be done.
+   *
+   * @param value Value to be checked.
+   * @param message Message to be logged.
+   */
+  #define TEAGN_FALSE_OR_RETURN( value , message ) \
+    if( ( value ) != 0 ) { \
+      TEAGN_LOGWARN( TeAgnostic::to_string( message ) + \
+        " - " + TeAgnostic::to_string( #value ) ); \
+      return false; \
+    };    
+
+  /**
+   * @brief Logs a warning message will and return false.
+   *
+   * @param message Message to be logged.
+   */
+  #define TEAGN_LOG_AND_RETURN( message ) \
+    { \
+      TEAGN_LOGWARN( message ); \
+      return false; \
+    };
+
+  /**
+   * @brief Checks if value is false and logs an warning message if not.
+   *
+   * @param value Value to be checked.
+   * @param message Message to be logged.
+   */
+  #define TEAGN_FALSE_OR_LOG( value , message ) \
+    if( ( value ) != 0 ) { \
+      TEAGN_LOGWARN( TeAgnostic::to_string( message ) + \
+        " - " + TeAgnostic::to_string( #value ) ); \
+    };
+
+  /**
+   * @brief Checks if two values are equal and throws an exception if not.
+   *
+   * @param value1 Value to be checked.
+   * @param value2 Value to be checked.
+   * @param message Message to be logged.
+   */
+  #define TEAGN_CHECK_EQUAL( value1 , value2 , message ) \
+    TEAGN_TRUE_OR_THROW( ( ((double)( value1 ) ) == ((double)( value2 ) ) ), \
+    std::string( "Values must be equal [" ) + \
+    TeAgnostic::to_string( value1 ) + "!=" + \
+    TeAgnostic::to_string( value2 ) + "] - " + \
+    TeAgnostic::to_string( message ) );
+
+  /**
+   * @brief Checks if two values are diferent and throws an exception if not.
+   *
+   * @param value1 Value to be checked.
+   * @param value2 Value to be checked.
+   * @param message Message to be logged.
+   */
+  #define TEAGN_CHECK_NOTEQUAL( value1 , value2 , message ) \
+    TEAGN_TRUE_OR_THROW( ( ((double)( value1 )) != ((double)( value2 )) ), \
+    std::string( "Values can't be equal [" ) + \
+    TeAgnostic::to_string( #value1 ) + std::string( "==" ) + \
+    TeAgnostic::to_string( #value2 ) + std::string( "==" ) + \
+    TeAgnostic::to_string( value1 ) + std::string( "]" ) );
+
+  /**
+   * @brief  Checks if two values are equal ( within an EPS ) and
+   *  throws an exception if not.
+   *
+   * @param value1 Value to be checked.
+   * @param value2 Value to be checked.
+   * @param eps EPS ( threshold )
+   * @param message Message to be logged.
+   */
+  #define TEAGN_CHECK_EPS( value1 , value2 , eps , message ) \
+    { \
+      TEAGN_TRUE_OR_THROW( ( (eps) >= 0), "Invalid eps" ); \
+      double TEAGN_CHECK_EPS_double_diff = 0; \
+      double TEAGN_CHECK_EPS_double_value1 = (double)(value1); \
+      double TEAGN_CHECK_EPS_double_value2 = (double)(value2); \
+      double TEAGN_CHECK_EPS_double_eps = (double)(eps); \
+      if( TEAGN_CHECK_EPS_double_value1 < TEAGN_CHECK_EPS_double_value2 ) { \
+        TEAGN_CHECK_EPS_double_diff = ( TEAGN_CHECK_EPS_double_value2 - \
+          TEAGN_CHECK_EPS_double_value1 ); \
+      } else { \
+        TEAGN_CHECK_EPS_double_diff = ( TEAGN_CHECK_EPS_double_value1 - \
+          TEAGN_CHECK_EPS_double_value2 ); \
+      }; \
+      TEAGN_TRUE_OR_THROW( \
+        TEAGN_CHECK_EPS_double_diff <= TEAGN_CHECK_EPS_double_eps, \
+        std::string( "Values are not equal: " ) + \
+        TeAgnostic::to_string( #value1 ) + \
+        std::string( "=[") + \
+        TeAgnostic::to_string( TEAGN_CHECK_EPS_double_value1 ) + \
+        std::string( "] " ) + \
+        TeAgnostic::to_string( #value2 ) + \
+        std::string( "=[") + \
+        TeAgnostic::to_string( TEAGN_CHECK_EPS_double_value2 ) + \
+        std::string( "] eps=[") + \
+        TeAgnostic::to_string( TEAGN_CHECK_EPS_double_eps ) + \
+        std::string( "] diff=[") + \
+        TeAgnostic::to_string( TEAGN_CHECK_EPS_double_diff ) + \
+        std::string( "] - " ) + \
+        TeAgnostic::to_string( message ) \
+        ); \
+    };
+
+  /**
+   * @brief Throws an exception for not implemented source.
+   */
+  #define TEAGN_NOT_IMPLEMENTED \
+    TEAGN_LOG_AND_THROW( "Not Implemented." );
+
+  /**
+   *  @brief Checks if Debug mode is enabled and throws an exception if not.
+   */
+  #define TEAGN_DEBUG_MODE_CHECK \
+    TEAGN_TRUE_OR_THROW( TeAgnostic::debugModeCheck() , \
+    "Code not compiled with debug" );
+    
+  /**
+   * @brief Checks if value is true and throws an exception if not.
+   *
+   * @note This macro will be disabled for non debug mode.
+   *
+   * @param value Value to be checked.
+   * @param message Message to be logged.
+   */
+  #ifdef TEAGN_DEBUG_MODE
+    #define TEAGN_DEBUG_CONDITION( value , message ) \
+      TEAGN_TRUE_OR_THROW( value , message );
+  #else
+    #define TEAGN_DEBUG_CONDITION( value , message );
+  #endif
+  
+  /**
+   * @brief Checks if value is true. For false values a warning message will be logged 
+   * and a return of context with false value will be done.
+   *
+   * @note This macro will be disabled for non debug mode.
+   *
+   * @param value Value to be checked.
+   * @param message Message to be logged.
+   */
+  #ifdef TEAGN_DEBUG_MODE
+    #define TEAGN_DEBUG_RETURN( value , message ) \
+      TEAGN_TRUE_OR_RETURN( value , message );
+  #else
+    #define TEAGN_DEBUG_RETURN( value , message );
+  #endif  
+
+  /**
+   * @brief This namespace contains a set of routines and classes to deal with
+   *  system checking and logging facility.
+   * @ingroup Utils
+   */
+  namespace TeAgnostic{
+
+    /**
+     * @brief Data conversion to string.
+     *
+     * @param data Data to be converted.
+     * @return The converted string.
+     */
+     template< class T >
+     std::string to_string( const T& data )
+     {
+        std::stringstream temp_ss;
+        temp_ss.setf(std::ios_base::fixed);
+        temp_ss << data;
+        return temp_ss.str();
+     }
+
+    /**
+     * @brief Checks if the code was compiled with debug mode.
+     *
+     * @return true if debug mode was used at compilation time. false if not.
+     */
+     TL_DLL bool debugModeCheck();
+
+  };
+
+#endif
diff --git a/src/terralib/kernel/TeAsciiFile.cpp b/src/terralib/kernel/TeAsciiFile.cpp
old mode 100755
new mode 100644
index f0983cb..3ca40e6
--- a/src/terralib/kernel/TeAsciiFile.cpp
+++ b/src/terralib/kernel/TeAsciiFile.cpp
@@ -1,362 +1,409 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeAsciiFile.h"
-#include "TeErrorLog.h"
-#include "TeException.h"
-#include "TeAssertions.h"
-#include "TeDefines.h"
-#include <cstdlib>
-
-TeAsciiFile::TeAsciiFile ( const string& name, const char* mode ): 	
-	TeStdFile ( name, mode  ) 
-{
-}  
-
-TeAsciiFile::~TeAsciiFile() 
-{ 	
-}  
-
-void
-TeAsciiFile::findNewLine ()
-{
-	if ( feof ( file_ ) != 0 )
-		return;
-	char ch = '0';
-
-	while ( ch != '\n' )
-	{
-		fscanf ( file_, "%c", &ch );
-		if ( feof ( file_ ) != 0 )
-			return;
-	}
-}
-
-char 
-TeAsciiFile::readQuotedChar()
-{
-	require ( feof ( file_ ) == 0 );
-
-	char ch = ',', ch2;
-
-	while ( ch != '"' )
-	{
-		fscanf ( file_, "%c", &ch );
-	}
-	fscanf ( file_, "%c", &ch );
-	fscanf ( file_, "%c", &ch2 );
-
-	ensure ( ch2 == '"' ); // just to make sure
-return ch;
-}
-
-char 
-TeAsciiFile::readChar()
-{
-	char ch=' ';
-	require ( feof ( file_ ) == 0 );
-	while ( ch == ' ' )
-	{
-		fscanf ( file_, "%c", &ch );
-	}
-	return ch;
-}
-
-
-string
-TeAsciiFile::readString ()
-{
-	if ( feof ( file_ ) != 0 )
-		throw TeException ( END_OF_FILE_REACHED, name(), true );
-
-	char input [TeNAME_LENGTH];
-	input[0]=0;
-	fscanf ( file_, "%s", input );
-
-return input;
-}
-
-void
-TeAsciiFile::writeString (const string& s)
-{
-	fprintf ( file_, "%s", s.c_str() );
-}
-
-string
-TeAsciiFile::readLine ()
-{
-	if ( feof ( file_ ) != 0 )
-		throw TeException ( END_OF_FILE_REACHED, name(), true );
-
-	char input [TeNAME_LENGTH];
-	fgets ( input, TeNAME_LENGTH, file_ );
-
-return input;
-}
-
-string 
-TeAsciiFile::readQuotedString()
-{
-	require ( feof ( file_ ) == 0 );
-
-	char ch = ' ';
-
-	string quote;
-
-	while ( ch != '"' )
-	{
-		fscanf ( file_, "%c", &ch );
-	}
-
-	while ( true )
-	{
-		fscanf ( file_, "%c", &ch );
-		if ( ch == '\n' || ch == '\r') 
-		{
-			ungetc ( ch, file_ );
-			break;
-		}
-		if ( ch == '"'  ) break;
-
-		quote = quote + ch;
-	}
-return quote;
-}
-
-void
-TeAsciiFile::readStringList ( vector<string>& strlist )
-{
-	require ( file_ != 0 );
-
-	this->readStringListCSV ( strlist, ' ');
-}
-
-void
-TeAsciiFile::readStringListCSV ( vector<string>& strlist, const char sep)
-{
-
-	if ( feof ( file_ ) != 0 )
-		throw TeException ( END_OF_FILE_REACHED, name(), true );
-
-	char ch, lastChr = 0;
-	while (fscanf ( file_, "%c", &ch ) !=  EOF )
-	{
-		if ( ch == '\n' || ch == '\r') 
-		{ 
-			if(lastChr==sep)
-				strlist.push_back ( "" );
-
-			ungetc ( ch, file_ );
-			return;
-		}
-		ungetc ( ch, file_ );
-		// there are still more values to be read
-		string name = readStringCSV (sep);
-		if ( name.size() !=  0 || sep != ' ')
-			strlist.push_back ( name );
-		
-		lastChr = ch;
-	}
-}
-
-void
-TeAsciiFile::readNStringCSV ( vector<string>& strlist, unsigned int n, const char sep)
-{
-
-	if ( feof ( file_ ) != 0 )
-		throw TeException ( END_OF_FILE_REACHED, name(), true );
-
-	strlist.clear();
-	char ch, lastChr = 0;
-	while (fscanf ( file_, "%c", &ch ) !=  EOF )
-	{
-		if ( ch == '\n' || ch == '\r') 
-		{ 
-			if(lastChr==sep)
-				strlist.push_back ( "" );
-
-			ungetc ( ch, file_ );
-			return;
-		}
-		ungetc ( ch, file_ );
-		// there are still more values to be read
-		string name = readStringCSV (sep);
-		if ( name.size() !=  0 || sep != ' ')
-			strlist.push_back ( name );
-		if (strlist.size() == n)
-			break;
-		
-		lastChr = ch;
-	}
-}
-
-string
-TeAsciiFile::readStringCSV( const char del, bool skip, const char skip_char )
-{
-	require ( file_ != 0 );
-
-	if ( feof ( file_ ) != 0 )
-		throw TeException ( END_OF_FILE_REACHED, name(), true );
-
-	char ch = '0';
-	string line;
-	bool inQuotes = false;
-
-	int ret;
-	while ( (ret=fscanf ( file_, "%c", &ch )) != EOF)
-	{
-		if ( ch == '\n' || ch == '\r') 
-		{
-			ungetc ( ch, file_ );
-			break;
-		}
-		if ( ch == del  && !inQuotes ) break;
-		if (skip)
-			if (ch == skip_char) 
-			{
-				if (skip_char == '"')
-					inQuotes = !inQuotes;
-				continue;
-			}
-		line = line + ch;
-	}
-	return line;
-}
-
-string
-TeAsciiFile::readStringCSVNoSpace( const char del )
-{
-	char blank = ' ';
-	string line = readStringCSV ( del, true, blank );
-return line;
-}
-
-string
-TeAsciiFile::readStringCSVNoQuote( const char del )
-{
-	char quote = '"';
-	string line = readStringCSV ( del, true, quote );
-return line;
-}
-
-int
-TeAsciiFile::readInt ()
-{
-	require ( file_ != 0 );
-
-	if ( feof ( file_ ) != 0 )
-		throw TeException ( END_OF_FILE_REACHED, name(), true );
-	
-	int value;
-	fscanf ( file_, "%d", &value );
-
-return value;
-}
-
-int
-TeAsciiFile::readIntCSV ( const char del )
-{
-	char blank  = ' ';
-	string line = readStringCSV ( del, true, blank );
-
-return atoi(line.c_str());
-}
-
-double
-TeAsciiFile::readFloatCSV ( const char del )
-{
-	char blank = ' ';
-	string line = readStringCSV ( del, true, blank );
-
-return atof(line.c_str());
-}
-
-
-double
-TeAsciiFile::readFloat ()
-{
-	require ( file_ != 0 );
-
-	if ( feof ( file_ ) != 0 )
-		throw TeException ( END_OF_FILE_REACHED, name(), true );
-	
-	double value;
-	fscanf ( file_, "%lf", &value );
-
-return value;
-}
-
-TeCoord2D
-TeAsciiFile::readCoord2D ()
-{
-	require ( file_ != 0 );
-
-	if ( feof ( file_ ) != 0 )
-		throw TeException ( END_OF_FILE_REACHED, name(), true );
-
-	double x, y;
-	fscanf ( file_, "%lf %lf", &x, &y);
-
-return TeCoord2D( x,  y );
-}
-
-TeBox
-TeAsciiFile::readBox() 
-{
-	require ( file_ != 0 );
-
-	if ( feof ( file_ ) != 0 )
-	{
-		throw TeException ( END_OF_FILE_REACHED, name(), true );
-	}
-	double x1, y1, x2, y2;
-
-
-	fscanf ( file_, "%lf %lf %lf %lf", &x1, &y1, &x2, &y2 );
-
-return TeBox ( x1, y1, x2, y2 );
-
-}
-
-string
-TeAsciiFile::readAll()
-{
-	require ( file_ != 0 );
-	if ( feof ( file_ ) != 0 )
-		throw TeException ( END_OF_FILE_REACHED, name(), true );
-
-	char ch = '0';
-	string text="";
-	int ret;
-	while ((ret=fscanf ( file_, "%c", &ch )) != EOF)
-	{
-		if (ch != '\n') 
-			text = text + ch;
-	}
-	return text;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeAsciiFile.h"
+#include "TeErrorLog.h"
+#include "TeException.h"
+#include "TeAssertions.h"
+#include "TeDefines.h"
+#include <cstdlib>
+
+TeAsciiFile::TeAsciiFile ( const string& name, const char* mode ): 	
+	TeStdFile ( name, mode  ) 
+{
+}  
+
+TeAsciiFile::~TeAsciiFile() 
+{ 	
+}  
+
+void
+TeAsciiFile::findNewLine ()
+{
+	if ( feof ( file_ ) != 0 )
+		return;
+	char ch = '0';
+
+	while ( ch != '\n' )
+	{
+		fscanf ( file_, "%c", &ch );
+		if ( feof ( file_ ) != 0 )
+			return;
+	}
+}
+
+char 
+TeAsciiFile::readQuotedChar()
+{
+	require ( feof ( file_ ) == 0 );
+
+	char ch = ',', ch2;
+
+	while ( ch != '"' )
+	{
+		fscanf ( file_, "%c", &ch );
+	}
+	fscanf ( file_, "%c", &ch );
+	fscanf ( file_, "%c", &ch2 );
+
+	ensure ( ch2 == '"' ); // just to make sure
+return ch;
+}
+
+char 
+TeAsciiFile::readChar()
+{
+	char ch=' ';
+	require ( feof ( file_ ) == 0 );
+	while ( ch == ' ' )
+	{
+		fscanf ( file_, "%c", &ch );
+	}
+	return ch;
+}
+
+
+string
+TeAsciiFile::readString ()
+{
+	if ( feof ( file_ ) != 0 )
+		throw TeException ( END_OF_FILE_REACHED, name(), true );
+
+	char input [TeNAME_LENGTH];
+	input[0]=0;
+	fscanf ( file_, "%s", input );
+
+return input;
+}
+
+void
+TeAsciiFile::writeString (const string& s)
+{
+	fprintf ( file_, "%s", s.c_str() );
+}
+
+string
+TeAsciiFile::readLine ()
+{
+	if ( feof ( file_ ) != 0 )
+		throw TeException ( END_OF_FILE_REACHED, name(), true );
+
+	char input [TeNAME_LENGTH];
+	fgets ( input, TeNAME_LENGTH, file_ );
+
+return input;
+}
+
+string 
+TeAsciiFile::readQuotedString()
+{
+	require ( feof ( file_ ) == 0 );
+
+	char ch = ' ';
+
+	string quote;
+
+	while ( ch != '"' )
+	{
+		fscanf ( file_, "%c", &ch );
+	}
+
+	while ( true )
+	{
+		fscanf ( file_, "%c", &ch );
+		if ( ch == '\n' || ch == '\r') 
+		{
+			ungetc ( ch, file_ );
+			break;
+		}
+		if ( ch == '"'  ) break;
+
+		quote = quote + ch;
+	}
+return quote;
+}
+
+void
+TeAsciiFile::readStringList ( vector<string>& strlist )
+{
+	require ( file_ != 0 );
+
+	this->readStringListCSV ( strlist, ' ');
+}
+
+void
+TeAsciiFile::readStringListCSV ( vector<string>& strlist, const char sep)
+{
+
+	if ( feof ( file_ ) != 0 )
+		throw TeException ( END_OF_FILE_REACHED, name(), true );
+
+	char ch, lastChr = 0;
+	while (fscanf ( file_, "%c", &ch ) !=  EOF )
+	{
+		if ( ch == '\n' || ch == '\r') 
+		{ 
+			if(lastChr==sep)
+				strlist.push_back ( "" );
+
+			ungetc ( ch, file_ );
+			return;
+		}
+		ungetc ( ch, file_ );
+		// there are still more values to be read
+		string name = readStringCSV (sep);
+		if ( name.size() !=  0 || sep != ' ')
+			strlist.push_back ( name );
+		
+		lastChr = ch;
+	}
+}
+
+void
+TeAsciiFile::readNStringCSV ( vector<string>& strlist, unsigned int n, const char sep)
+{
+
+	if ( feof ( file_ ) != 0 )
+		throw TeException ( END_OF_FILE_REACHED, name(), true );
+
+	strlist.clear();
+	char ch, lastChr = 0;
+	while (fscanf ( file_, "%c", &ch ) !=  EOF )
+	{
+		if ( ch == '\n' || ch == '\r') 
+		{ 
+			if(lastChr==sep)
+				strlist.push_back ( "" );
+
+			ungetc ( ch, file_ );
+			return;
+		}
+		ungetc ( ch, file_ );
+		// there are still more values to be read
+		string name = readStringCSV (sep);
+		if ( name.size() !=  0 || sep != ' ')
+			strlist.push_back ( name );
+		if (strlist.size() == n)
+			break;
+		
+		lastChr = ch;
+	}
+}
+
+string
+TeAsciiFile::readStringCSV( const char del, bool skip, const char skip_char )
+{
+	require ( file_ != 0 );
+
+	if ( feof ( file_ ) != 0 )
+		throw TeException ( END_OF_FILE_REACHED, name(), true );
+
+	char ch = '0';
+	string line;
+	bool inQuotes = false;
+
+	int ret;
+	while ( (ret=fscanf ( file_, "%c", &ch )) != EOF)
+	{
+		if ( ch == '\n' || ch == '\r') 
+		{
+			ungetc ( ch, file_ );
+			break;
+		}
+		if ( ch == del  && !inQuotes ) break;
+		if (skip)
+			if (ch == skip_char) 
+			{
+				if (skip_char == '"')
+					inQuotes = !inQuotes;
+				continue;
+			}
+		line = line + ch;
+	}
+	return line;
+}
+
+string
+TeAsciiFile::readStringCSVNoSpace( const char del )
+{
+	char blank = ' ';
+	string line = readStringCSV ( del, true, blank );
+return line;
+}
+
+string
+TeAsciiFile::readStringCSVNoQuote( const char del )
+{
+	char quote = '"';
+	string line = readStringCSV ( del, true, quote );
+return line;
+}
+
+int
+TeAsciiFile::readInt ()
+{
+	require ( file_ != 0 );
+
+	if ( feof ( file_ ) != 0 )
+		throw TeException ( END_OF_FILE_REACHED, name(), true );
+	
+	int value;
+	fscanf ( file_, "%d", &value );
+
+return value;
+}
+
+int
+TeAsciiFile::readIntCSV ( const char del )
+{
+	char blank  = ' ';
+	string line = readStringCSV ( del, true, blank );
+
+return atoi(line.c_str());
+}
+
+double
+TeAsciiFile::readFloatCSV ( const char del )
+{
+	char blank = ' ';
+	string line = readStringCSV ( del, true, blank );
+
+return atof(line.c_str());
+}
+
+
+double
+TeAsciiFile::readFloat ()
+{
+	require ( file_ != 0 );
+
+	if ( feof ( file_ ) != 0 )
+		throw TeException ( END_OF_FILE_REACHED, name(), true );
+	
+	double value;
+	fscanf ( file_, "%lf", &value );
+
+return value;
+}
+
+TeCoord2D
+TeAsciiFile::readCoord2D ()
+{
+	require ( file_ != 0 );
+
+	if ( feof ( file_ ) != 0 )
+		throw TeException ( END_OF_FILE_REACHED, name(), true );
+
+	double x, y;
+	fscanf ( file_, "%lf %lf", &x, &y);
+
+return TeCoord2D( x,  y );
+}
+
+TeBox
+TeAsciiFile::readBox() 
+{
+	require ( file_ != 0 );
+
+	if ( feof ( file_ ) != 0 )
+	{
+		throw TeException ( END_OF_FILE_REACHED, name(), true );
+	}
+	double x1, y1, x2, y2;
+
+
+	fscanf ( file_, "%lf %lf %lf %lf", &x1, &y1, &x2, &y2 );
+
+return TeBox ( x1, y1, x2, y2 );
+
+}
+
+string
+TeAsciiFile::readAll()
+{
+	require ( file_ != 0 );
+	if ( feof ( file_ ) != 0 )
+		throw TeException ( END_OF_FILE_REACHED, name(), true );
+
+	char ch = '0';
+	string text="";
+	int ret;
+	while ((ret=fscanf ( file_, "%c", &ch )) != EOF)
+	{
+		if (ch != '\n') 
+			text = text + ch;
+	}
+	return text;
+}
+
+bool TeAsciiFile::writeCoordPairVect2CSV( const TeCoordPairVect& coordsVec )
+{
+  if( file_ )
+  {    
+    for( TeCoordPairVect::size_type idx = 0 ; idx < coordsVec.size() ; ++idx )
+    {
+      if( fprintf( file_, "%.15f;%.15f;%.15f;%.15f\n", 
+        coordsVec[ idx ].pt1.x_, coordsVec[ idx ].pt1.y_, 
+        coordsVec[ idx ].pt2.x_, coordsVec[ idx ].pt2.y_ ) <
+        1 )
+      {
+        return false;
+      }
+    }
+    
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+
+bool TeAsciiFile::readCoordPairVect2CSV( TeCoordPairVect& coordsVec )
+{
+  coordsVec.clear();
+  
+  if( file_ )
+  {    
+    TeCoordPair auxPair;
+    
+    while( fscanf( file_, "%lf;%lf;%lf;%lf", &auxPair.pt1.x_, &auxPair.pt1.y_, 
+      &auxPair.pt2.x_, &auxPair.pt2.y_ ) == 4 )
+    {
+      coordsVec.push_back( auxPair );
+    }
+    
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+
diff --git a/src/terralib/kernel/TeAsciiFile.h b/src/terralib/kernel/TeAsciiFile.h
old mode 100755
new mode 100644
index 69e5631..b1642f2
--- a/src/terralib/kernel/TeAsciiFile.h
+++ b/src/terralib/kernel/TeAsciiFile.h
@@ -1,132 +1,147 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeAsciiFile.h
-    \brief This file contains structures and definitions to deal ASCII files
-*/
-#ifndef  __TERRALIB_INTERNAL_ASCIIFILE_H
-#define  __TERRALIB_INTERNAL_ASCIIFILE_H
-
-#include "TeDefines.h"
-#include "TeStdFile.h"
-#include "TeCoord2D.h"
-#include "TeBox.h"
-
-#include <stdio.h>
-
-#include <vector> 
-#include <string>
-using namespace std;
-
-//!  A class for handling reading/writing for ASCII files
-/*!  Simple wrapper around a stdio file. Clientes are all the 
-	 functions that imports from ASCII files. 
-
- \sa
-  TeStdFile, TeSPRFile
-*/
-class TL_DLL TeAsciiFile: public TeStdFile {
-
-public:
-
-	//! Contructors
-	TeAsciiFile(const string& name, const char* mode = "r");
-	
-	//! Destructor
-	virtual ~TeAsciiFile();
-
-	//! Writes a carriage return character
-	void writeNewLine ()
-	{ fprintf ( file_, "\n" ); } 
-	
-	//! Goes to a new line 
-	void findNewLine () ; 
-
-	//! Reads a string
-	string readString(); 
-
-	//! Reads a full line up to carriage return
-	string readLine(); 
-
-	//! Writes a generic string to the file
-	void writeString (const string& s);
-
-	//! Reads a string whithin quotes
-	string readQuotedString(); 
-
-	//! Reads a comma-separated string ( with a skip character )
-	string readStringCSV( const char sep = ',', bool skip = false, 
-						  const char skip_char = ' ');
-
-	//! Reads a character whithin quotes
-	char readQuotedChar();
-
-	//! Reads a character
-	char readChar();
-
-	//! Reads a comma-separated string(ignore spaces)
-	string readStringCSVNoSpace( const char del = ',');
-
-	//! Reads a comma-separated string (ignore quote )
-	string readStringCSVNoQuote ( const char del = ',' );
-
-	//! Reads an integer
-	int readInt();
-
-	//! Reads a comma-separated int
-	int readIntCSV( const char del = ',');
-
-	//! Reads a float
-	double readFloat();
-
-	//! Reads a comma-separated float
-	double readFloatCSV( const char del = ',');
-
-	//! Reads a 2D coordinate ( x, y )
-	TeCoord2D readCoord2D();
-
-	//! Reads a line and put in a stringlist
-	void readStringList ( vector<string>& );
-
-	//! Reads a comma-separated line string and put in a string list
-	void readStringListCSV ( vector<string>&, const char sep = ',');
-
-	//! Reads the first n strings from a comma separated line string and put in a string list
-	void readNStringCSV ( vector<string>&, unsigned int n, const char sep = ',');
-
-	//! Reads a bounding box
-	TeBox readBox();
-
-	//! Reads the entire content of the file, skipping new line characters only
-	string readAll();
-
-private:
-	
-// No copy allowed
-
-	TeAsciiFile(const TeAsciiFile&);
-	TeAsciiFile& operator=(const TeAsciiFile&);
-
-};
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAsciiFile.h
+    \brief This file contains structures and definitions to deal ASCII files
+*/
+#ifndef  __TERRALIB_INTERNAL_ASCIIFILE_H
+#define  __TERRALIB_INTERNAL_ASCIIFILE_H
+
+#include "TeDefines.h"
+#include "TeStdFile.h"
+#include "TeCoord2D.h"
+#include "TeBox.h"
+
+#include <stdio.h>
+
+#include <vector> 
+#include <string>
+using namespace std;
+
+//!  A class for handling reading/writing for ASCII files
+/*!  Simple wrapper around a stdio file. Clientes are all the 
+	 functions that imports from ASCII files. 
+
+ \sa
+  TeStdFile, TeSPRFile
+*/
+class TL_DLL TeAsciiFile: public TeStdFile {
+
+public:
+
+	//! Contructors
+	TeAsciiFile(const string& name, const char* mode = "r");
+	
+	//! Destructor
+	virtual ~TeAsciiFile();
+
+	//! Writes a carriage return character
+	void writeNewLine ()
+	{ fprintf ( file_, "\n" ); } 
+	
+	//! Goes to a new line 
+	void findNewLine () ; 
+
+	//! Reads a string
+	string readString(); 
+
+	//! Reads a full line up to carriage return
+	string readLine(); 
+
+	//! Writes a generic string to the file
+	void writeString (const string& s);
+
+	//! Reads a string whithin quotes
+	string readQuotedString(); 
+
+	//! Reads a comma-separated string ( with a skip character )
+	string readStringCSV( const char sep = ',', bool skip = false, 
+						  const char skip_char = ' ');
+
+	//! Reads a character whithin quotes
+	char readQuotedChar();
+
+	//! Reads a character
+	char readChar();
+
+	//! Reads a comma-separated string(ignore spaces)
+	string readStringCSVNoSpace( const char del = ',');
+
+	//! Reads a comma-separated string (ignore quote )
+	string readStringCSVNoQuote ( const char del = ',' );
+
+	//! Reads an integer
+	int readInt();
+
+	//! Reads a comma-separated int
+	int readIntCSV( const char del = ',');
+
+	//! Reads a float
+	double readFloat();
+
+	//! Reads a comma-separated float
+	double readFloatCSV( const char del = ',');
+
+	//! Reads a 2D coordinate ( x, y )
+	TeCoord2D readCoord2D();
+
+	//! Reads a line and put in a stringlist
+	void readStringList ( vector<string>& );
+
+	//! Reads a comma-separated line string and put in a string list
+	void readStringListCSV ( vector<string>&, const char sep = ',');
+
+	//! Reads the first n strings from a comma separated line string and put in a string list
+	void readNStringCSV ( vector<string>&, unsigned int n, const char sep = ',');
+
+	//! Reads a bounding box
+	TeBox readBox();
+
+	//! Reads the entire content of the file, skipping new line characters only
+	string readAll();
+  
+  /*!  Write a vector os coordinates pairs using the CSV file format (one line per coordinate
+     pair).
+    \param coordsVec The input coordinate pairs vector.
+    \return true if ok, false on errors.
+    \note 15 digits precision
+  */
+  bool writeCoordPairVect2CSV( const TeCoordPairVect& coordsVec );
+
+  /*!  Read a vector os coordinates pairs using the CSV file format (one line per coordinate
+     pair).
+    \param coordsVec The input coordinate pairs vector.
+    \return true if ok, false on errors.
+  */
+  bool readCoordPairVect2CSV( TeCoordPairVect& coordsVec );
+  
+private:
+	
+// No copy allowed
+
+	TeAsciiFile(const TeAsciiFile&);
+	TeAsciiFile& operator=(const TeAsciiFile&);
+
+};
+#endif
+
+
diff --git a/src/terralib/kernel/TeAssertions.h b/src/terralib/kernel/TeAssertions.h
old mode 100755
new mode 100644
index 787e8f7..e940b50
--- a/src/terralib/kernel/TeAssertions.h
+++ b/src/terralib/kernel/TeAssertions.h
@@ -1,35 +1,35 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeAssertions.h
-    \brief This file contains definitions for require and ensure macros
-*/
-
-#ifndef TeAssertions_H
-#define TeAssertions_H
-#include <assert.h>
-
-#define require(statement)    assert(statement)
-#define ensure(statement)     assert(statement)
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAssertions.h
+    \brief This file contains definitions for require and ensure macros
+*/
+
+#ifndef TeAssertions_H
+#define TeAssertions_H
+#include <assert.h>
+
+#define require(statement)    assert(statement)
+#define ensure(statement)     assert(statement)
+
+#endif
+
diff --git a/src/terralib/kernel/TeAttribute.h b/src/terralib/kernel/TeAttribute.h
old mode 100755
new mode 100644
index ad86724..743230b
--- a/src/terralib/kernel/TeAttribute.h
+++ b/src/terralib/kernel/TeAttribute.h
@@ -1,174 +1,198 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeAttribute.h
-    \brief This file contains structures and definitions about attributes of geographical objects
-*/
-#ifndef  __TERRALIB_INTERNAL_ATTRIBUTE_H
-#define  __TERRALIB_INTERNAL_ATTRIBUTE_H
-
-#include "TeDefines.h"
-#include "TeDataTypes.h"
-#include "TeTime.h"
-
-/*! \enum TeMeasurementScale 
-	\brief Sscale of measurement according to Stevens (1949) 
-           modified by Chrisman (1998) to include CYCLIC and PROBABILITY
-           we also include FUZZY (possibility scale) 
-*/
-enum TeMeasurementScale 
-{ ORDINAL, NOMINAL, RATIO, INTERVAL, CYCLIC, PROBABILITY, FUZZY };
-
-/*! \struct TeAttributeRep
-	\brief Attribute physical representation
-*/
-struct TL_DLL TeAttributeRep
-{
-	string			name_;		//!< attribute name	
-	TeAttrDataType  type_;		//!< attribute type
-	int				numChar_;   //!< width of an attribute
-	int				decimals_;	//!< number of decimal digits
-	bool			isPrimaryKey_;	//!< flag to indicate that the attribute is part of primary key
-	bool			isAutoNumber_; 	//!< flag to indicate that the attribute is auto number
-	bool            null_;			//!< flag to indicate that attribute can be a null value (true) or not (false)
-	string			defaultValue_;	//!< default value (without "'")
-
-	//! Empty constructor
-	TeAttributeRep():
-		name_(""),
-		type_(TeSTRING),
-		numChar_(0),
-		decimals_(0),
-		isPrimaryKey_(false),
-		isAutoNumber_(false),
-		null_(true),
-		defaultValue_("")
-		{}
-
-	//! Constructor
-	TeAttributeRep(const string& name):
-		name_(name),
-		type_(TeSTRING),
-		numChar_(0),
-		decimals_(0),
-		isPrimaryKey_(false),
-		isAutoNumber_(false),
-		null_(true),
-		defaultValue_("")
-		{}
-
-	//! Operator =
-	TeAttributeRep& operator= ( const TeAttributeRep& at )
-	{
-		if ( this != &at )
-		{	
-			name_ = at.name_;
-			type_ = at.type_;
-			numChar_ = at.numChar_;
-			decimals_ = at.decimals_;
-			isPrimaryKey_ = at.isPrimaryKey_;
-			isAutoNumber_ = at.isAutoNumber_;
-			null_ = at.null_;
-			defaultValue_ = at.defaultValue_;
-		}
-		return *this;
-	}
-
-	//! Operator ==
-	bool operator== ( const TeAttributeRep& at )
-	{
-		return (name_==at.name_ && type_ == at.type_
-			&& numChar_ == at.numChar_ && decimals_ == at.decimals_ &&
-            isPrimaryKey_ == at.isPrimaryKey_ && 
-			isAutoNumber_ == at.isAutoNumber_ && 
-			null_ == at.null_ && defaultValue_ == at.defaultValue_);
-	}
-
-	//! Operator <
-	bool	operator< (const TeAttributeRep& at) const 
-	{return (name_ < at.name_);}	
-};
-
-/*! \struct TeAttribute
-	\brief Attribute description
-*/
-struct TL_DLL TeAttribute
-{
-	TeAttributeRep	rep_;		//!< representation of attribute	
-	string	semantic_;			//!< reference in a Ontology database (e.g., entry in WordNet )	
-	string	unit_;				//!< measurement unit ( e.g., m ) if applicable
-	TeMeasurementScale  scale_;	//!< scale of measurement
-
-	// for RATIO data sets
-	string				minValue_;	//!< minimum value of the attribute
-	string				maxValue_;	//!< maximum value of the attrbute	
-
-	// for NOMINAL or ORDINAL data sets
-	vector<string>		validValueList_; //!< list of valid values
-
-	// for INTERVAL data sets (??)
-	string				origin_;	//!< origin of the intervals	
-	string				interval_;	//!< mesurement interval
-
-	string				dateTimeFormat_;	//!< format for date and time values
-	string				indicatorAM_;		//!< AM indicator for a 12 hour clock
-	string				indicatorPM_;		//!< PM indicator for a 12 hour clock
-	string				dateSeparator_;		//!< date separator
-	string				timeSeparator_;		//!< time separator
-	TeChronon			dateChronon_;		//!< date chronon
-
-	//! Empty constructor
-	TeAttribute():
-		rep_			(TeAttributeRep()),
-		dateTimeFormat_	("DsMsYYYYsHHsmmsSS"), 
-		indicatorAM_	("AM"),
-		indicatorPM_	("PM"),
-		dateSeparator_	("/"),
-		timeSeparator_	(":"), 
-		dateChronon_    (TeSECOND)
-		{}
-};
-
-/*! \struct TeProperty
-	\brief A property of an object
- */
-struct TL_DLL TeProperty
-{
-	TeAttribute		attr_;		//!< attribute description
-    string			value_;		//!< its value stored as an string
-};
-
-//! A vector of TeProperties
-typedef vector<TeProperty> TePropertyVector;
-
-//! A vector of attributes representation
-typedef vector<TeAttributeRep>  TeAttributeRepList;
-
-//! A vector of attributes 
-typedef vector<TeAttribute>		TeAttributeList;
-
-//! A Map of the attribute names to the statistical types 
-typedef vector< pair<TeAttributeRep, TeStatisticType> > TeGroupingAttr;
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeAttribute.h
+    \brief This file contains structures and definitions about attributes of geographical objects
+*/
+#ifndef  __TERRALIB_INTERNAL_ATTRIBUTE_H
+#define  __TERRALIB_INTERNAL_ATTRIBUTE_H
+
+#include "TeDefines.h"
+#include "TeDataTypes.h"
+#include "TeTime.h"
+
+/*! \enum TeMeasurementScale 
+	\brief Sscale of measurement according to Stevens (1949) 
+           modified by Chrisman (1998) to include CYCLIC and PROBABILITY
+           we also include FUZZY (possibility scale) 
+*/
+enum TeMeasurementScale 
+{ ORDINAL, NOMINAL, RATIO, INTERVAL, CYCLIC, PROBABILITY, FUZZY };
+
+/*! \struct TeAttributeRep
+	\brief Attribute physical representation
+*/
+struct TL_DLL TeAttributeRep
+{
+	string			name_;		//!< attribute name	
+	TeAttrDataType  type_;		//!< attribute type
+	int				numChar_;   //!< width of an attribute
+	int				decimals_;	//!< number of decimal digits
+	bool			isPrimaryKey_;	//!< flag to indicate that the attribute is part of primary key
+	bool			isAutoNumber_; 	//!< flag to indicate that the attribute is auto number
+	bool            null_;			//!< flag to indicate that attribute can be a null value (true) or not (false)
+	string			defaultValue_;	//!< default value (without "'")
+
+	//! Empty constructor
+	TeAttributeRep():
+		name_(""),
+		type_(TeSTRING),
+		numChar_(0),
+		decimals_(0),
+		isPrimaryKey_(false),
+		isAutoNumber_(false),
+		null_(true),
+		defaultValue_("")
+		{}
+
+	//! Constructor
+	TeAttributeRep(const string& name):
+		name_(name),
+		type_(TeSTRING),
+		numChar_(0),
+		decimals_(0),
+		isPrimaryKey_(false),
+		isAutoNumber_(false),
+		null_(true),
+		defaultValue_("")
+		{}
+
+	//! Operator =
+	TeAttributeRep& operator= ( const TeAttributeRep& at )
+	{
+		if ( this != &at )
+		{	
+			name_ = at.name_;
+			type_ = at.type_;
+			numChar_ = at.numChar_;
+			decimals_ = at.decimals_;
+			isPrimaryKey_ = at.isPrimaryKey_;
+			isAutoNumber_ = at.isAutoNumber_;
+			null_ = at.null_;
+			defaultValue_ = at.defaultValue_;
+		}
+		return *this;
+	}
+
+	//! Operator ==
+	bool operator== ( const TeAttributeRep& at )
+	{
+		return (name_==at.name_ && type_ == at.type_
+			&& numChar_ == at.numChar_ && decimals_ == at.decimals_ &&
+            isPrimaryKey_ == at.isPrimaryKey_ && 
+			isAutoNumber_ == at.isAutoNumber_ && 
+			null_ == at.null_ && defaultValue_ == at.defaultValue_);
+	}
+
+	//! Operator <
+	bool	operator< (const TeAttributeRep& at) const 
+	{return (name_ < at.name_);}	
+};
+
+/*! \struct TeAttribute
+	\brief Attribute description
+*/
+struct TL_DLL TeAttribute
+{
+	TeAttributeRep	rep_;		//!< representation of attribute	
+	string	semantic_;			//!< reference in a Ontology database (e.g., entry in WordNet )	
+	string	unit_;				//!< measurement unit ( e.g., m ) if applicable
+	TeMeasurementScale  scale_;	//!< scale of measurement
+
+	// for RATIO data sets
+	string				minValue_;	//!< minimum value of the attribute
+	string				maxValue_;	//!< maximum value of the attrbute	
+
+	// for NOMINAL or ORDINAL data sets
+	vector<string>		validValueList_; //!< list of valid values
+
+	// for INTERVAL data sets (??)
+	string				origin_;	//!< origin of the intervals	
+	string				interval_;	//!< mesurement interval
+
+	string				dateTimeFormat_;	//!< format for date and time values
+	string				indicatorAM_;		//!< AM indicator for a 12 hour clock
+	string				indicatorPM_;		//!< PM indicator for a 12 hour clock
+	string				dateSeparator_;		//!< date separator
+	string				timeSeparator_;		//!< time separator
+	TeChronon			dateChronon_;		//!< date chronon
+
+	//! Empty constructor
+	TeAttribute():
+		rep_			(TeAttributeRep()),
+		dateTimeFormat_	("DsMsYYYYsHHsmmsSS"), 
+		indicatorAM_	("AM"),
+		indicatorPM_	("PM"),
+		dateSeparator_	("/"),
+		timeSeparator_	(":"), 
+		dateChronon_    (TeSECOND)
+		{}
+
+	TeAttribute& operator= ( const TeAttribute& at )
+	{
+		if ( this != &at )
+		{
+			rep_ = at.rep_;
+			semantic_ = at.semantic_;
+			unit_ = at.unit_;
+			scale_ = at.scale_;
+			minValue_ = at.minValue_;
+			maxValue_ = at.maxValue_;
+			validValueList_ = at.validValueList_;
+			origin_ = at.origin_;
+			interval_ = at.interval_;
+			dateTimeFormat_ = at.dateTimeFormat_;
+			indicatorAM_ = at.indicatorAM_;
+			indicatorPM_ = at.indicatorPM_;
+			dateSeparator_ = at.dateSeparator_;
+			timeSeparator_ = at.timeSeparator_;
+			dateChronon_ = at.dateChronon_;
+		}
+
+		return *this;
+	}
+};
+
+/*! \struct TeProperty
+	\brief A property of an object
+ */
+struct TL_DLL TeProperty
+{
+	TeAttribute		attr_;		//!< attribute description
+    string			value_;		//!< its value stored as an string
+};
+
+//! A vector of TeProperties
+typedef vector<TeProperty> TePropertyVector;
+
+//! A vector of attributes representation
+typedef vector<TeAttributeRep>  TeAttributeRepList;
+
+//! A vector of attributes 
+typedef vector<TeAttribute>		TeAttributeList;
+
+//! A Map of the attribute names to the statistical types 
+typedef vector< pair<TeAttributeRep, TeStatisticType> > TeGroupingAttr;
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeBaseSTInstance.h b/src/terralib/kernel/TeBaseSTInstance.h
index 742b0f0..abb17e6 100644
--- a/src/terralib/kernel/TeBaseSTInstance.h
+++ b/src/terralib/kernel/TeBaseSTInstance.h
@@ -1,552 +1,552 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeBaseSTInstance.h
-	\brief This file contains a base class called TeBaseSTInstance that represents 
-	an instance in time of a geographical object or element.  
-*/
-
-#ifndef  __TERRALIB_INTERNAL_BASESTINSTANCE_H
-#define  __TERRALIB_INTERNAL_BASESTINSTANCE_H
-
-#include "TeCoord2D.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeAttribute.h"
-#include "TeSharedPtr.h"
-
-#include <string>
-#include <map> 
-#include <vector>
-
-using namespace std;
-
-class TeTheme;
-
-/*! \class TeBaseSTInstance
-	\brief A base class that represents an instance in a time of a spatial object.
-
-	A spatio-temporal instance (STInstance) is composite of an attribute set and geometries 
-	of a spatial element or object that are valid in a specific time. This class implements
-	a base generic spatio-temporal instance that can be specialized according to the
-	types that represent its geometries and its valid time.
-	
-*/
-template<typename GeometryType, typename TimeType>
-class TeBaseSTInstance
-{
-	
-protected:
-	//! object identification
-	string					object_id_;		
-	//! unique identification in each attribute table
-	vector<string>			unique_id_;	
-	//! set of properties or attributes values
-	vector<string>			properties_;	
-	//! geometries
-	GeometryType			geometries_;	
-	//! valid time 
-	TimeType				time_;		
-	//! the slice or group that contains this instance  
-	int						slice_;		
-	//! a shared pointer to the descriptions of all attributes
-	TeSharedPtr<TeAttributeList> 	attrList_;			
-		
-public:		
-
-	//! Empty constructor
-	TeBaseSTInstance() : object_id_(""), slice_(-1), attrList_(0)
-	{ }
-
-	//! Constructor
-	TeBaseSTInstance (const string& object_id, const vector<string>& prop, TeAttributeList* attList = 0, const int& s = -1) : 
-		object_id_(object_id), 
-		properties_(prop),
-		slice_(s),
-		attrList_(TeSharedPtr<TeAttributeList>(attList))
-		{ } 
-
-	//! Constructor
-	TeBaseSTInstance (const string& object_id, const GeometryType& geometries, const TimeType& time, 
-		const int& s = -1) : 
-		object_id_(object_id), 
-		geometries_(geometries),
-		time_(time),
-		slice_(s),
-		attrList_(0)
-		{ } 
-
-	//! Constructor
-	TeBaseSTInstance (const string& object_id, const vector<string>& prop, TeAttributeList* attList,
-		const GeometryType& geometries,	const int& slice, const TimeType& time ) :
-		object_id_(object_id), 
-		properties_(prop),
-		geometries_(geometries),
-		time_(time),
-		slice_(slice),
-		attrList_(TeSharedPtr<TeAttributeList>(attList))
-		{ } 
-			
-	//! Destructor
-	virtual ~TeBaseSTInstance() 
-	{ } 
-
-	//! Equal operator 
-	virtual bool operator== (const TeBaseSTInstance<GeometryType, TimeType>& other);
-
-	//! Returns the object identification
-	virtual string getObjectId () 
-	{	return object_id_;	}
-	
-	//! Sets the object identification
-	virtual void setObjectId (const string& id) 
-	{	object_id_ = id;	}
-
-	//! Deprecated: Returns the object identification 
-	virtual string objectId () 
-	{	return getObjectId();	}
-	
-	//! Deprecated: Sets the object identification 
-	virtual void objectId (const string& id) 
-	{	setObjectId(id);	}
-
-	//! Returns the unique identification in all attribute tables
-	virtual vector<string>& getUniqueId() 
-	{	return unique_id_;	}
-
-	//! Returns the unique identification of the i-th attribute table
-	virtual string getUniqueId(const int& i); 
-	
-	//! Sets the unique identification in all attribute tables
-	virtual void setUniqueId (const vector<string>& id) 
-	{	unique_id_ = id;	}
-
-	//! Adds an unique identification
-	virtual void addUniqueId (const string& id) 
-	{	unique_id_.push_back(id);	}
-
-	//! Deprecated: Returns the instance identification in all attribute tables
-	virtual vector<string>& uniqueId () 
-	{	return getUniqueId();	}
-
-	//! Deprecated: Returns the instance identification in the index-th attribute table
-	virtual string uniqueId (int index) 
-	{	return getUniqueId(index);	}
-	
-	//! Deprecated: Sets the instance identifications in all attribute tables
-	virtual void uniqueId (const vector<string>& ids) 
-	{	setUniqueId(ids);	}
-
-	//! Returns the valid time 
-	virtual TimeType getTime() 
-	{	return time_;	}
-	
-	//! Sets the valid time 
-	virtual void setTime (const TimeType& t) 
-	{	time_ = t;	}
-
-	//! Sets the property value vector 
-	virtual void setProperties(const vector<string>& p) 
-	{	properties_ = p;	}
-
-	//! Deprecated: Sets the property vector to the ST instance 
-	virtual void setProperties(TePropertyVector& p); 
-
-	//! Sets the value (as a string) of the i-th property 
-	virtual bool setPropertyValue (const int& i, const string& val); 
-
-	//! Sets the value (as a string) of a property named 'name'
-	virtual bool setPropertyValue (const string& name, const string& val); 
-
-	//! Adds a new property value
-	virtual void addPropertyValue (const string& val)
-	{	properties_.push_back (val); }
-
-	//! Removes the i-th property value
-	virtual bool removePropertyValue (const int& i); 
-
-	//! Adds a new property or set its value   
-	/*!
-		Verifies if there is this property in the attribute list.
-		If not, adds it in the ST instance and in the attribute list. 
-		Otherwise, set the property value
-	*/
-	virtual bool addProperty(TeProperty& prop); 
-
-	//! Adds a new attribute in the attribute list 
-	virtual bool addProperty(TeAttribute& rep); 
-	
-	//! Returns the property value vector 
-	virtual vector<string>& getProperties()
-	{	return properties_;	}
-
-	//! Gets the property vector 
-	virtual void getPropertyVector(TePropertyVector& propVec); 
-
-	//! Deprecated: Returns the property vector from the ST instance
-	TePropertyVector getPropertyVector(); 
-	
-	//! Gets the i-th property
-	virtual bool getProperty (TeProperty& prop, unsigned int i = 0);	
-	
-	//! Gets the property named "name"
-	virtual bool getProperty (TeProperty& prop, string name); 
-	
-	//! Gets the value (as a string) of the i-th property
-	virtual bool getPropertyValue (string& val, const int& i = 0); 
-
-	//! Gets the the value (as a string) of a property named "name"
-	virtual bool getPropertyValue (const string& name, string& val); 
-	
-	//! Returns the value (as a double) of the i-th property
-	virtual double operator[](int i); 
-
-	//! Deprecated: Sets the property vector to the ST instance
-	virtual void properties(TePropertyVector& p)
-	{	setProperties(p); }
-
-	//! Returns the geometries
-	virtual GeometryType& getGeometries() 
-	{	return geometries_;}
-
-	//! Sets the geometries  
-	virtual void setGeometry(const GeometryType& g)
-	{	geometries_ = g; }
-
-	//! Deprecated: Returns the geometries
-	virtual GeometryType& geometries() 
-	{	return getGeometries();}
-
-	//! Sets the group or slice that contains this instance 
-	virtual void setSlice (int s) 
-	{	slice_ = s; }
-
-	//! Returns the group or slice that contains this instance
-	virtual int getSlice()
-	{	return slice_; }
-
-	//! Deprecated: Sets the group or slice that contains this instance 
-	virtual void slice (int s) 
-	{	setSlice(s); }
-
-	//! Deprecated: Returns the group or slice that contains this instance
-	virtual int slice()
-	{	return getSlice(); }
-
-	//! Gets a pointer to attribute desciptions
-	const TeAttributeList*	getAttrList()
-	{	return attrList_.nakedPointer(); }
-
-	//! Creates a new internal copy of the attribute description
-	void setAttrList(const TeAttributeList& attList); 
-
-	//! Sets a shared pointer to attribute descriptions
-	void setAttrList(TeSharedPtr<TeAttributeList>& attrList);
-
-	//! Clears the instance, its attributes. It must be implemented by specialized classes to clear its geometries.
-	virtual void clear();
-
-	//! Returns a centroid associated to the geometries of the instance
-	virtual TeCoord2D getCentroid();
-
-	//! Returns an area the geometries of the instance
-	virtual double getArea();
-
-	//! Verifies if the time associated with this instance is valid. It must be implemented by specialized classes.
-	virtual bool isTimeValid()
-	{	return false; } 
-	
-	//! Deprecated: Returns the theme pointer that contains this instance. 
-	virtual TeTheme* theme() 
-	{ return 0; }
-
-	//! Deprecated: Sets the theme that contains this instance.
-	virtual void theme(TeTheme*)  
-	{  }
-};
-
-template<typename GeometryType, typename TimeType> bool
-TeBaseSTInstance<GeometryType, TimeType>::operator== (const TeBaseSTInstance<GeometryType, TimeType>& other)
-{
-	return ( (object_id_ == other.object_id_) && 
-			 (time_ == other.time_) &&
-			 (slice_ == other.slice_));
-}
-
-template<typename GeometryType, typename TimeType> string 
-TeBaseSTInstance<GeometryType, TimeType>::getUniqueId(const int& i) 
-{	
-	if(i<(int)unique_id_.size())
-		return unique_id_[i];	
-	return "";
-}
-
-template<typename GeometryType, typename TimeType> void 
-TeBaseSTInstance<GeometryType, TimeType>::setAttrList(const TeAttributeList& attList)
-{
-	attrList_.reset(new TeAttributeList()); 
-	*attrList_ = attList;
-}
-
-template<typename GeometryType, typename TimeType> void 
-TeBaseSTInstance<GeometryType, TimeType>::setAttrList(TeSharedPtr<TeAttributeList>& attList)
-{
-	attrList_ = attList;
-}
-
-template<typename GeometryType, typename TimeType> void 
-TeBaseSTInstance<GeometryType, TimeType>::setProperties(TePropertyVector& p)
-{
-	properties_.clear();
-	TePropertyVector::iterator it = p.begin();
-	while(it!=p.end())
-	{
-		addPropertyValue(it->value_); 
-		++it;
-	}
-}
-
-template<typename GeometryType, typename TimeType> bool 
-TeBaseSTInstance<GeometryType, TimeType>::setPropertyValue (const int& i, const string& val)
-{	
-	if(i<0 || i>=(int)properties_.size())
-		return false;
-	properties_[i] = val;
-	return true;
-}
-
-template<typename GeometryType, typename TimeType> bool 
-TeBaseSTInstance<GeometryType, TimeType>::setPropertyValue (const string& name, const string& val)
-{	
-	if(!attrList_.isActive())
-		return false;
-
-	string newName = TeConvertToUpperCase(name); 
-	size_t pos = name.find(".", 0, 1);
-	if (pos != string::npos)
-		newName = TeConvertToUpperCase((name.substr(pos+1)));
-
-	for(unsigned int i=0; i<attrList_->size(); ++i)
-	{
-		string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_);
-		if( (s == TeConvertToUpperCase(name)) || (s == newName))
-		{
-			if(i>=properties_.size())
-				return false;
-			properties_[i] = val;
-			return true;
-		}
-	}
-	return false; 
-}
-
-template<typename GeometryType, typename TimeType> void  
-TeBaseSTInstance<GeometryType, TimeType>::getPropertyVector(TePropertyVector& propVec)
-{
-	if(!attrList_.isActive())
-		return;
-    if(properties_.size()!=attrList_->size())
-		return;
-	propVec.clear();
-	for(unsigned int i=0; i<properties_.size(); ++i)
-	{
-		TeProperty p;
-		p.value_ = properties_[i];
-		p.attr_ = attrList_->operator[](i);
-		propVec.push_back(p);
-	}
-}
-
-template<typename GeometryType, typename TimeType> TePropertyVector  
-TeBaseSTInstance<GeometryType, TimeType>::getPropertyVector()
-{
-	TePropertyVector vec; 
-	this->getPropertyVector(vec);
-	return vec;
-}
-
-template<typename GeometryType, typename TimeType> bool 
-TeBaseSTInstance<GeometryType, TimeType>::getProperty (TeProperty& prop, unsigned int i)
-{
-	if(!attrList_.isActive())
-		return false;
-
-	if(i>=properties_.size() || i>=attrList_->size())
-		return false;
-	prop.value_ = properties_[i];
-	prop.attr_ = (*attrList_)[i];
-	return true;
-}
-
-template<typename GeometryType, typename TimeType> bool 
-TeBaseSTInstance<GeometryType, TimeType>::getProperty (TeProperty& prop, string name)
-{
-	if(!attrList_.isActive())
-		return false;
-	 if(properties_.size()!=attrList_->size())
-		return false;
-
-	string newName = TeConvertToUpperCase(name); 
-	size_t pos = name.find(".", 0, 1);
-	if (pos != string::npos)
-		newName = TeConvertToUpperCase(name.substr(pos+1));
-
-	for(unsigned int i=0; i<attrList_->size(); ++i)
-	{
-		string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_); 
-		if((s == TeConvertToUpperCase(name)) || (s == newName))
-		{
-			prop.value_ = properties_[i];
-			prop.attr_ = attrList_->operator[](i);
-			return true;
-		}
-	}
-	return false; 
-}
-	
-template<typename GeometryType, typename TimeType> bool 
-TeBaseSTInstance<GeometryType, TimeType>::getPropertyValue (string& val, const int& i)
-{
-	if(i<0 || i>= (int)properties_.size())
-		return false;
-	val = properties_[i];
-	return true;
-}
-
-template<typename GeometryType, typename TimeType> bool 
-TeBaseSTInstance<GeometryType, TimeType>::getPropertyValue (const string& name, string& val)
-{	
-	if(!attrList_.isActive())
-		return false;
-
-	if(properties_.size()!=attrList_->size())
-		return false;
-
-	string newName = TeConvertToUpperCase(name); 
-	size_t pos = name.find(".", 0, 1);
-	if (pos != string::npos)
-		newName = TeConvertToUpperCase(name.substr(pos+1));
-
-	for(unsigned int i=0; i<attrList_->size(); ++i)
-	{
-		string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_); 
-		if((s == TeConvertToUpperCase(name)) || (s == newName))
-		{
-			val = properties_[i];
-			return true;
-		}
-	}
-	return false; 
-}
-
-template<typename GeometryType, typename TimeType> bool 
-TeBaseSTInstance<GeometryType, TimeType>::addProperty(TeProperty& prop)
-{
-	if(!attrList_.isActive())
-		return false;
-
-	string newName = TeConvertToUpperCase(prop.attr_.rep_.name_); 
-	size_t pos = (prop.attr_.rep_.name_).find(".", 0, 1);
-	if (pos != string::npos)
-		newName = TeConvertToUpperCase(prop.attr_.rep_.name_.substr(pos+1));
-
-	for(unsigned int i=0; i<attrList_->size(); ++i)
-	{
-		string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_); 
-		if((s == TeConvertToUpperCase(prop.attr_.rep_.name_)) || (s == newName))
-		{
-			//the property already exists
-			if(i>=properties_.size())
-				properties_.push_back (prop.value_);
-			else
-				properties_[i] = prop.value_;
-			return true;
-		}
-	}
-
-	// Adds a new property
-	attrList_->push_back(prop.attr_);
-	properties_.push_back (prop.value_);
-	return true; 
-}
-
-template<typename GeometryType, typename TimeType> bool 
-TeBaseSTInstance<GeometryType, TimeType>::addProperty(TeAttribute& attr)
-{
-	if(!attrList_.isActive())
-		return false;
-	attrList_->push_back(attr);
-	return true; 
-}
-
-template<typename GeometryType, typename TimeType> bool 
-TeBaseSTInstance<GeometryType, TimeType>::removePropertyValue(const int& i)
-{
-	int index = 0;
-	vector<string>::iterator it = properties_.begin();
-	while(it!=properties_.end())
-	{
-		if(index==i)
-		{
-			properties_.erase(it);
-			return true;
-		}
-		++it;
-		++index;
-	}
-	return false;
-}
-
-template<typename GeometryType, typename TimeType> double 
-TeBaseSTInstance<GeometryType, TimeType>::operator[](int i)
-{	
-	double val = TeMAXFLOAT; 
-	if(i<0 || i>=(int)properties_.size() || properties_[i].empty())
-		return val;
-	val = atof(properties_[i].c_str()); 
-	return val;  
-}
-	
-template<typename GeometryType, typename TimeType> void
-TeBaseSTInstance<GeometryType, TimeType>::clear()
-{
-	object_id_ = ""; 
-	slice_ = -1; 
-    properties_.clear(); 
-	unique_id_.clear();
-	attrList_.reset(0);
-}
-
-
-template<typename GeometryType, typename TimeType> TeCoord2D
-TeBaseSTInstance<GeometryType, TimeType>::getCentroid()
-{
-	return TeFindCentroid(this->getGeometries());
-}
-
-template<typename GeometryType, typename TimeType> double
-TeBaseSTInstance<GeometryType, TimeType>::getArea()
-{
-	return TeGeometryArea(this->getGeometries());
-}
-
-			
-#endif 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeBaseSTInstance.h
+	\brief This file contains a base class called TeBaseSTInstance that represents 
+	an instance in time of a geographical object or element.  
+*/
+
+#ifndef  __TERRALIB_INTERNAL_BASESTINSTANCE_H
+#define  __TERRALIB_INTERNAL_BASESTINSTANCE_H
+
+#include "TeCoord2D.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeAttribute.h"
+#include "TeSharedPtr.h"
+
+#include <string>
+#include <map> 
+#include <vector>
+
+using namespace std;
+
+class TeTheme;
+
+/*! \class TeBaseSTInstance
+	\brief A base class that represents an instance in a time of a spatial object.
+
+	A spatio-temporal instance (STInstance) is composite of an attribute set and geometries 
+	of a spatial element or object that are valid in a specific time. This class implements
+	a base generic spatio-temporal instance that can be specialized according to the
+	types that represent its geometries and its valid time.
+	
+*/
+template<typename GeometryType, typename TimeType>
+class TeBaseSTInstance
+{
+	
+protected:
+	//! object identification
+	string					object_id_;		
+	//! unique identification in each attribute table
+	vector<string>			unique_id_;	
+	//! set of properties or attributes values
+	vector<string>			properties_;	
+	//! geometries
+	GeometryType			geometries_;	
+	//! valid time 
+	TimeType				time_;		
+	//! the slice or group that contains this instance  
+	int						slice_;		
+	//! a shared pointer to the descriptions of all attributes
+	TeSharedPtr<TeAttributeList> 	attrList_;			
+		
+public:		
+
+	//! Empty constructor
+	TeBaseSTInstance() : object_id_(""), slice_(-1), attrList_(0)
+	{ }
+
+	//! Constructor
+	TeBaseSTInstance (const string& object_id, const vector<string>& prop, TeAttributeList* attList = 0, const int& s = -1) : 
+		object_id_(object_id), 
+		properties_(prop),
+		slice_(s),
+		attrList_(TeSharedPtr<TeAttributeList>(attList))
+		{ } 
+
+	//! Constructor
+	TeBaseSTInstance (const string& object_id, const GeometryType& geometries, const TimeType& time, 
+		const int& s = -1) : 
+		object_id_(object_id), 
+		geometries_(geometries),
+		time_(time),
+		slice_(s),
+		attrList_(0)
+		{ } 
+
+	//! Constructor
+	TeBaseSTInstance (const string& object_id, const vector<string>& prop, TeAttributeList* attList,
+		const GeometryType& geometries,	const int& slice, const TimeType& time ) :
+		object_id_(object_id), 
+		properties_(prop),
+		geometries_(geometries),
+		time_(time),
+		slice_(slice),
+		attrList_(TeSharedPtr<TeAttributeList>(attList))
+		{ } 
+			
+	//! Destructor
+	virtual ~TeBaseSTInstance() 
+	{ } 
+
+	//! Equal operator 
+	virtual bool operator== (const TeBaseSTInstance<GeometryType, TimeType>& other);
+
+	//! Returns the object identification
+	virtual string getObjectId () 
+	{	return object_id_;	}
+	
+	//! Sets the object identification
+	virtual void setObjectId (const string& id) 
+	{	object_id_ = id;	}
+
+	//! Deprecated: Returns the object identification 
+	virtual string objectId () 
+	{	return getObjectId();	}
+	
+	//! Deprecated: Sets the object identification 
+	virtual void objectId (const string& id) 
+	{	setObjectId(id);	}
+
+	//! Returns the unique identification in all attribute tables
+	virtual vector<string>& getUniqueId() 
+	{	return unique_id_;	}
+
+	//! Returns the unique identification of the i-th attribute table
+	virtual string getUniqueId(const int& i); 
+	
+	//! Sets the unique identification in all attribute tables
+	virtual void setUniqueId (const vector<string>& id) 
+	{	unique_id_ = id;	}
+
+	//! Adds an unique identification
+	virtual void addUniqueId (const string& id) 
+	{	unique_id_.push_back(id);	}
+
+	//! Deprecated: Returns the instance identification in all attribute tables
+	virtual vector<string>& uniqueId () 
+	{	return getUniqueId();	}
+
+	//! Deprecated: Returns the instance identification in the index-th attribute table
+	virtual string uniqueId (int index) 
+	{	return getUniqueId(index);	}
+	
+	//! Deprecated: Sets the instance identifications in all attribute tables
+	virtual void uniqueId (const vector<string>& ids) 
+	{	setUniqueId(ids);	}
+
+	//! Returns the valid time 
+	virtual TimeType getTime() 
+	{	return time_;	}
+	
+	//! Sets the valid time 
+	virtual void setTime (const TimeType& t) 
+	{	time_ = t;	}
+
+	//! Sets the property value vector 
+	virtual void setProperties(const vector<string>& p) 
+	{	properties_ = p;	}
+
+	//! Deprecated: Sets the property vector to the ST instance 
+	virtual void setProperties(TePropertyVector& p); 
+
+	//! Sets the value (as a string) of the i-th property 
+	virtual bool setPropertyValue (const int& i, const string& val); 
+
+	//! Sets the value (as a string) of a property named 'name'
+	virtual bool setPropertyValue (const string& name, const string& val); 
+
+	//! Adds a new property value
+	virtual void addPropertyValue (const string& val)
+	{	properties_.push_back (val); }
+
+	//! Removes the i-th property value
+	virtual bool removePropertyValue (const int& i); 
+
+	//! Adds a new property or set its value   
+	/*!
+		Verifies if there is this property in the attribute list.
+		If not, adds it in the ST instance and in the attribute list. 
+		Otherwise, set the property value
+	*/
+	virtual bool addProperty(TeProperty& prop); 
+
+	//! Adds a new attribute in the attribute list 
+	virtual bool addProperty(TeAttribute& rep); 
+	
+	//! Returns the property value vector 
+	virtual vector<string>& getProperties()
+	{	return properties_;	}
+
+	//! Gets the property vector 
+	virtual void getPropertyVector(TePropertyVector& propVec); 
+
+	//! Deprecated: Returns the property vector from the ST instance
+	TePropertyVector getPropertyVector(); 
+	
+	//! Gets the i-th property
+	virtual bool getProperty (TeProperty& prop, unsigned int i = 0);	
+	
+	//! Gets the property named "name"
+	virtual bool getProperty (TeProperty& prop, string name); 
+	
+	//! Gets the value (as a string) of the i-th property
+	virtual bool getPropertyValue (string& val, const int& i = 0); 
+
+	//! Gets the the value (as a string) of a property named "name"
+	virtual bool getPropertyValue (const string& name, string& val); 
+	
+	//! Returns the value (as a double) of the i-th property
+	virtual double operator[](int i); 
+
+	//! Deprecated: Sets the property vector to the ST instance
+	virtual void properties(TePropertyVector& p)
+	{	setProperties(p); }
+
+	//! Returns the geometries
+	virtual GeometryType& getGeometries() 
+	{	return geometries_;}
+
+	//! Sets the geometries  
+	virtual void setGeometry(const GeometryType& g)
+	{	geometries_ = g; }
+
+	//! Deprecated: Returns the geometries
+	virtual GeometryType& geometries() 
+	{	return getGeometries();}
+
+	//! Sets the group or slice that contains this instance 
+	virtual void setSlice (int s) 
+	{	slice_ = s; }
+
+	//! Returns the group or slice that contains this instance
+	virtual int getSlice()
+	{	return slice_; }
+
+	//! Deprecated: Sets the group or slice that contains this instance 
+	virtual void slice (int s) 
+	{	setSlice(s); }
+
+	//! Deprecated: Returns the group or slice that contains this instance
+	virtual int slice()
+	{	return getSlice(); }
+
+	//! Gets a pointer to attribute desciptions
+	const TeAttributeList*	getAttrList()
+	{	return attrList_.nakedPointer(); }
+
+	//! Creates a new internal copy of the attribute description
+	void setAttrList(const TeAttributeList& attList); 
+
+	//! Sets a shared pointer to attribute descriptions
+	void setAttrList(TeSharedPtr<TeAttributeList>& attrList);
+
+	//! Clears the instance, its attributes. It must be implemented by specialized classes to clear its geometries.
+	virtual void clear();
+
+	//! Returns a centroid associated to the geometries of the instance
+	virtual TeCoord2D getCentroid();
+
+	//! Returns an area the geometries of the instance
+	virtual double getArea();
+
+	//! Verifies if the time associated with this instance is valid. It must be implemented by specialized classes.
+	virtual bool isTimeValid()
+	{	return false; } 
+	
+	//! Deprecated: Returns the theme pointer that contains this instance. 
+	virtual TeTheme* theme() 
+	{ return 0; }
+
+	//! Deprecated: Sets the theme that contains this instance.
+	virtual void theme(TeTheme*)  
+	{  }
+};
+
+template<typename GeometryType, typename TimeType> bool
+TeBaseSTInstance<GeometryType, TimeType>::operator== (const TeBaseSTInstance<GeometryType, TimeType>& other)
+{
+	return ( (object_id_ == other.object_id_) && 
+			 (time_ == other.time_) &&
+			 (slice_ == other.slice_));
+}
+
+template<typename GeometryType, typename TimeType> string 
+TeBaseSTInstance<GeometryType, TimeType>::getUniqueId(const int& i) 
+{	
+	if(i<(int)unique_id_.size())
+		return unique_id_[i];	
+	return "";
+}
+
+template<typename GeometryType, typename TimeType> void 
+TeBaseSTInstance<GeometryType, TimeType>::setAttrList(const TeAttributeList& attList)
+{
+	attrList_.reset(new TeAttributeList()); 
+	*attrList_ = attList;
+}
+
+template<typename GeometryType, typename TimeType> void 
+TeBaseSTInstance<GeometryType, TimeType>::setAttrList(TeSharedPtr<TeAttributeList>& attList)
+{
+	attrList_ = attList;
+}
+
+template<typename GeometryType, typename TimeType> void 
+TeBaseSTInstance<GeometryType, TimeType>::setProperties(TePropertyVector& p)
+{
+	properties_.clear();
+	TePropertyVector::iterator it = p.begin();
+	while(it!=p.end())
+	{
+		addPropertyValue(it->value_); 
+		++it;
+	}
+}
+
+template<typename GeometryType, typename TimeType> bool 
+TeBaseSTInstance<GeometryType, TimeType>::setPropertyValue (const int& i, const string& val)
+{	
+	if(i<0 || i>=(int)properties_.size())
+		return false;
+	properties_[i] = val;
+	return true;
+}
+
+template<typename GeometryType, typename TimeType> bool 
+TeBaseSTInstance<GeometryType, TimeType>::setPropertyValue (const string& name, const string& val)
+{	
+	if(!attrList_.isActive())
+		return false;
+
+	string newName = TeConvertToUpperCase(name); 
+	size_t pos = name.find(".", 0, 1);
+	if (pos != string::npos)
+		newName = TeConvertToUpperCase((name.substr(pos+1)));
+
+	for(unsigned int i=0; i<attrList_->size(); ++i)
+	{
+		string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_);
+		if( (s == TeConvertToUpperCase(name)) || (s == newName))
+		{
+			if(i>=properties_.size())
+				return false;
+			properties_[i] = val;
+			return true;
+		}
+	}
+	return false; 
+}
+
+template<typename GeometryType, typename TimeType> void  
+TeBaseSTInstance<GeometryType, TimeType>::getPropertyVector(TePropertyVector& propVec)
+{
+	if(!attrList_.isActive())
+		return;
+    if(properties_.size()!=attrList_->size())
+		return;
+	propVec.clear();
+	for(unsigned int i=0; i<properties_.size(); ++i)
+	{
+		TeProperty p;
+		p.value_ = properties_[i];
+		p.attr_ = attrList_->operator[](i);
+		propVec.push_back(p);
+	}
+}
+
+template<typename GeometryType, typename TimeType> TePropertyVector  
+TeBaseSTInstance<GeometryType, TimeType>::getPropertyVector()
+{
+	TePropertyVector vec; 
+	this->getPropertyVector(vec);
+	return vec;
+}
+
+template<typename GeometryType, typename TimeType> bool 
+TeBaseSTInstance<GeometryType, TimeType>::getProperty (TeProperty& prop, unsigned int i)
+{
+	if(!attrList_.isActive())
+		return false;
+
+	if(i>=properties_.size() || i>=attrList_->size())
+		return false;
+	prop.value_ = properties_[i];
+	prop.attr_ = (*attrList_)[i];
+	return true;
+}
+
+template<typename GeometryType, typename TimeType> bool 
+TeBaseSTInstance<GeometryType, TimeType>::getProperty (TeProperty& prop, string name)
+{
+	if(!attrList_.isActive())
+		return false;
+	 if(properties_.size()!=attrList_->size())
+		return false;
+
+	string newName = TeConvertToUpperCase(name); 
+	size_t pos = name.find(".", 0, 1);
+	if (pos != string::npos)
+		newName = TeConvertToUpperCase(name.substr(pos+1));
+
+	for(unsigned int i=0; i<attrList_->size(); ++i)
+	{
+		string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_); 
+		if((s == TeConvertToUpperCase(name)) || (s == newName))
+		{
+			prop.value_ = properties_[i];
+			prop.attr_ = attrList_->operator[](i);
+			return true;
+		}
+	}
+	return false; 
+}
+	
+template<typename GeometryType, typename TimeType> bool 
+TeBaseSTInstance<GeometryType, TimeType>::getPropertyValue (string& val, const int& i)
+{
+	if(i<0 || i>= (int)properties_.size())
+		return false;
+	val = properties_[i];
+	return true;
+}
+
+template<typename GeometryType, typename TimeType> bool 
+TeBaseSTInstance<GeometryType, TimeType>::getPropertyValue (const string& name, string& val)
+{	
+	if(!attrList_.isActive())
+		return false;
+
+	if(properties_.size()!=attrList_->size())
+		return false;
+
+	string newName = TeConvertToUpperCase(name); 
+	size_t pos = name.find(".", 0, 1);
+	if (pos != string::npos)
+		newName = TeConvertToUpperCase(name.substr(pos+1));
+
+	for(unsigned int i=0; i<attrList_->size(); ++i)
+	{
+		string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_); 
+		if((s == TeConvertToUpperCase(name)) || (s == newName))
+		{
+			val = properties_[i];
+			return true;
+		}
+	}
+	return false; 
+}
+
+template<typename GeometryType, typename TimeType> bool 
+TeBaseSTInstance<GeometryType, TimeType>::addProperty(TeProperty& prop)
+{
+	if(!attrList_.isActive())
+		return false;
+
+	string newName = TeConvertToUpperCase(prop.attr_.rep_.name_); 
+	size_t pos = (prop.attr_.rep_.name_).find(".", 0, 1);
+	if (pos != string::npos)
+		newName = TeConvertToUpperCase(prop.attr_.rep_.name_.substr(pos+1));
+
+	for(unsigned int i=0; i<attrList_->size(); ++i)
+	{
+		string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_); 
+		if((s == TeConvertToUpperCase(prop.attr_.rep_.name_)) || (s == newName))
+		{
+			//the property already exists
+			if(i>=properties_.size())
+				properties_.push_back (prop.value_);
+			else
+				properties_[i] = prop.value_;
+			return true;
+		}
+	}
+
+	// Adds a new property
+	attrList_->push_back(prop.attr_);
+	properties_.push_back (prop.value_);
+	return true; 
+}
+
+template<typename GeometryType, typename TimeType> bool 
+TeBaseSTInstance<GeometryType, TimeType>::addProperty(TeAttribute& attr)
+{
+	if(!attrList_.isActive())
+		return false;
+	attrList_->push_back(attr);
+	return true; 
+}
+
+template<typename GeometryType, typename TimeType> bool 
+TeBaseSTInstance<GeometryType, TimeType>::removePropertyValue(const int& i)
+{
+	int index = 0;
+	vector<string>::iterator it = properties_.begin();
+	while(it!=properties_.end())
+	{
+		if(index==i)
+		{
+			properties_.erase(it);
+			return true;
+		}
+		++it;
+		++index;
+	}
+	return false;
+}
+
+template<typename GeometryType, typename TimeType> double 
+TeBaseSTInstance<GeometryType, TimeType>::operator[](int i)
+{	
+	double val = TeMAXFLOAT; 
+	if(i<0 || i>=(int)properties_.size() || properties_[i].empty())
+		return val;
+	val = atof(properties_[i].c_str()); 
+	return val;  
+}
+	
+template<typename GeometryType, typename TimeType> void
+TeBaseSTInstance<GeometryType, TimeType>::clear()
+{
+	object_id_ = ""; 
+	slice_ = -1; 
+    properties_.clear(); 
+	unique_id_.clear();
+	attrList_.reset(0);
+}
+
+
+template<typename GeometryType, typename TimeType> TeCoord2D
+TeBaseSTInstance<GeometryType, TimeType>::getCentroid()
+{
+	return TeFindCentroid(this->getGeometries());
+}
+
+template<typename GeometryType, typename TimeType> double
+TeBaseSTInstance<GeometryType, TimeType>::getArea()
+{
+	return TeGeometryArea(this->getGeometries());
+}
+
+			
+#endif 
diff --git a/src/terralib/kernel/TeBaseSTInstanceSet.h b/src/terralib/kernel/TeBaseSTInstanceSet.h
index 04cdea1..de71c7a 100644
--- a/src/terralib/kernel/TeBaseSTInstanceSet.h
+++ b/src/terralib/kernel/TeBaseSTInstanceSet.h
@@ -1,1212 +1,1220 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeBaseSTInstanceSet.h
-	\brief This file contains structures to deal with a set of spatio-temporal 
-	instances. These instances can belong to a specific layer or theme.
-*/
-
-#ifndef  __TERRALIB_INTERNAL_STINSTANCESET_H
-#define  __TERRALIB_INTERNAL_STINSTANCESET_H
-
-#include "TeBaseSTInstance.h"
-#include "TeRTree.h"
-#include "TeTheme.h"
-#include "TeLayer.h"
-#include "TeQuerierParams.h"
-#include "TeQuerier.h"
-#include "TeSharedPtr.h"
-
-/*! \class TeBaseSTInstanceSet
-	\brief A abstract class that represents a set of spatial temporal instances.
-
-	This abstract class implements a generic spatio-temporal instance set. It must 
-	be specialized according to the instance type (its geometry type, its time type
-	and its own type). 
-
-	\sa TeBaseSTInstance TeTheme TeLayer
-	
-*/
-template< typename GeometryType, typename TimeType, typename InstanceType >
-class TeBaseSTInstanceSet  
-{
-
-protected:
-
-	//! Set of spatio temporal instances
-	vector<InstanceType>	instances_;		
-
-	//! Minimal time associated to spatial temporal instances
-	TimeType				minTime_;
-	//! Maximal time associated to spatial temporal instances
-	TimeType				maxTime_;
-
-	//! Description of all attributes 
-	TeSharedPtr<TeAttributeList>	attrList_;
-
-	//! A pointer to a theme
-	TeTheme*				theme_;
-	//! A pointer to a layer
-	TeLayer*				layer_;	
-	//! A bounding box that contains all geometries of the spatial temporal instances
-	TeBox					box_;
-	
-	//! A map from object identity to its associated instances in the set 
-	map<string, vector<int> >		objectIdToInstances_;
-	//! A map from time to its associated instances in the set
-	map<TimeType, vector<int> >		timeToInstances_;
-	//! A map from slice to its associated instances in the set
-	map<int, vector<int> >			sliceToInstances_;
-	//! A struture to index the geometries: RTree
-	TeSAM::TeRTree<int>*			rTree_;		
-
-	//! Builds the set using a given querier and a specific slice
-	virtual bool buildImpl(TeQuerier* querier, const int& slide = -1) = 0;
-
-public:
-
-	//! An iterator that traverse each instance in the set
-	typedef typename vector<InstanceType>::iterator iterator;
-	
-	//! Constructor. It does not initialize the rTree. 
-	TeBaseSTInstanceSet(); 
-
-	//! Constructor. It initializes the rTree based on theme box.
-	TeBaseSTInstanceSet(TeTheme* theme, const TeAttributeList& attrList = TeAttributeList()); 
-
-	//! Constructor. It initializes the rTree based on layer box.
-	TeBaseSTInstanceSet(TeLayer* layer, const TeAttributeList& attrList = TeAttributeList());  
-
-	//! Constructor. It initializes the rTree based on the given box. 
-	TeBaseSTInstanceSet(const TeBox& box, const TeAttributeList& attrList = TeAttributeList());
-
-	//! Copy constructor
-	TeBaseSTInstanceSet (const TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>& other); 
-
-	//! Destructor
-	virtual ~TeBaseSTInstanceSet();  
-	
-	//! Assignment operator
-	virtual TeBaseSTInstanceSet& operator= (const TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>& other);
-
-	//! Gets minimal time
-	virtual TimeType getMinTime()
-	{ return minTime_; }
-
-	//! Sets minimal time
-	virtual void setMinTime(TimeType& t)
-	{ minTime_ = t; } 
-
-	//! Gets maximal time
-	virtual TimeType getMaxTime()
-	{ return maxTime_; }
-
-	//! Sets maximal time
-	virtual void setMaxTime(TimeType& t)
-	{ maxTime_ = t; } 
-
-	//! Gets the attribute list, that is, the description of all attributes
-	virtual TeAttributeList& getAttributeList()
-	{	return (*attrList_);  }
-
-	//! Sets the attribute list, that is, the description of all attributes
-	virtual void setAttributeList(TeAttributeList& attrs); 
-
-	//! Returns the index of an attribute named "attrName"
-	virtual int getAttributeIndex(const string& attrName);
-
-	//! Gets theme pointer
-	virtual TeTheme* getTheme()
-	{	return theme_;  }
-
-	//! Sets theme pointer
-	virtual void setTheme(TeTheme* t)
-	{	theme_ = t; }
-
-	//! Deprecated: Returns a theme pointer
-	TeTheme* theme()
-	{	return getTheme(); }
-
-	//! Gets layer pointer 
-	virtual TeLayer* getLayer()
-	{	return layer_;  }
-
-	//! Sets layer pointer
-	virtual void setLayer(TeLayer* l)
-	{	layer_ = l; }
-	
-	//! Gets a reference to the instance set 
-	virtual vector<InstanceType>& getSTInstances()
-	{	return instances_; }
-
-	//! Gets a pointer to the index-th ST instance
-	virtual InstanceType* getSTInstance(const unsigned int& index);
-
-	//! Gets a pointer to a ST instance of an object in a specific slice  
-	virtual InstanceType* getSTInstance(const string& objectId, const int& slice = -1);
-
-	//! Gets a pointer to a ST instance of an object in a specific time and slice
-	virtual InstanceType* getSTInstance(const string& objectId, TimeType& time, const int& slice = -1);
-
-	//! Gets pointers to all ST instances of a specific object in a specific slice
-	virtual void getSTInstances(vector<InstanceType*>& set, const string& objectId, const int& slice = -1);
-
-	//! Gets pointers to all ST instances of a specific object in a specific time and slice
-	virtual void getSTInstances(vector<InstanceType*>& set, const string& objectId, TimeType& time, const int& slice = -1);
-	
-	///! Gets pointers to all ST instances of a specific time
-	virtual void getSTInstances(vector<InstanceType*>& set, TimeType& time, const int& slice = -1);
-
-	//! Gets pointers to all ST instances of a specific slice
-	virtual void getSTInstances(vector<InstanceType*>& set, const int& slice);
-
-	//! Inserts a new ST instance in the set 
-	virtual bool insertSTInstance (InstanceType& object);
-		
-	//! Returns the number of instances 
-	virtual int numSTInstance(); 
-	
-	//! Returns the number of instances of an object or element
-	virtual int numSTInstance(const string& objectId); 
-
-	//! Returns the number of instances in a specific slice
-	virtual int numSTInstance(const int& slice);
-
-	//! Returns the number of instances in a specific time
-	virtual int numSTInstance(TimeType& time);
-
-	//! Returns the number of elements or objects in the set
-	virtual int numElements()
-	{	return objectIdToInstances_.size(); }
-
-	//! Sets a geometry of an object in a specific slice
-	virtual bool setGeometry(const string& object_id, GeometryType& geom, const int& slice = -1);
-
-	//! Sets a geometry of an object in a specific time and slice
-	virtual bool setGeometry(const string& object_id, GeometryType& geom, TimeType& time,  const int& slice = -1);
-
-	//! Gets the geometry of an object in a specific slice 
-	virtual bool getGeometry(const string& object_id, GeometryType& geom, const int& slice = -1);
-
-	//! Gets the geometry of an object in a specific time and slice
-	virtual bool getGeometry(const string& object_id, GeometryType& geom, TimeType& time, const int& slice = -1);
-
-	//! Gets a vector of attributes or properties of a object that is valid in a slice 
-	virtual bool getPropertyVector (const string& object_id, TePropertyVector& propVec, const int& slice = -1);
-
-	//! Gets a vector of attributes or properties of a object that is valid in a time and slice
-	virtual bool getPropertyVector (const string& object_id, TePropertyVector& propVec, TimeType& time, const int& slice = -1);
-
-	//! Sets a vector of attribute values of a object that is valid in a slice 
-	virtual bool setProperties (const string& object_id, const vector<string>& values, const int& slice = -1);
-
-	//! Sets a vector of attribute values of a object that is valid in a time and slice
-	virtual bool setProperties (const string& object_id, const vector<string>& values, TimeType& time, const int& slice = -1);
-	
-	//! Gets a vector of attribute values of a object that is valid in a slice 
-	virtual bool getProperties (const string& object_id, vector<string>& values, const int& slice = -1);
-
-	//! Gets a vector of attribute values of a object that is valid in a time and slice
-	virtual bool getProperties (const string& object_id, vector<string>& values, TimeType& time, const int& slice = -1);
-
-	//! Sets the value of the attribute named "attr_name" of an object that is valid in a slice 
-	virtual bool setAttributeValue (const string& object_id, const string& attr_name,  const string& val, const int& slice = -1);
-
-	//! Sets the value of the attribute named "attr_name" of an object that is valid in a time and slice
-	virtual bool setAttributeValue (const string& object_id, const string& attr_name,  const string& val, TimeType& time, const int& slice = -1);
-
-	//! Sets the value of the i-th attribute of an object that is valid in a slice 
-	virtual bool setAttributeValue (const string& object_id, const int& i, const string& val, const int& slice = -1); 
-
-	//! Sets the value of the i-th attribute of an object that is valid in a time and slice
-	virtual bool setAttributeValue (const string& object_id, const int& i, const string& val, TimeType& time, const int& slice = -1); 
-	
-	//! Get the value of the attribute named "attr_name" of an object that is valid in a slice 
-	virtual bool getAttributeValue (const string& object_id, const string& attr_name,  string& val, const int& slice = -1);
-
-	//! Get the value of the attribute named "attr_name" of an object that is valid in a time and slice
-	virtual bool getAttributeValue (const string& object_id, const string& attr_name,  string& val, TimeType& time, const int& slice = -1);
-
-	//! Gets the value of the i-th attribute of an object that is valid in a slice 
-	virtual bool getAttributeValue (const string& object_id, const int& i, string& val, const int& slice = -1); 
-
-	//! Gets the value of the i-th attribute of an object that is valid in a time and slice
-	virtual bool getAttributeValue (const string& object_id, const int& i, string& val, TimeType& time, const int& slice = -1); 
-
-	//! Adds a new attribute in the attribute list and adds it in all instances in the set using a default value
-	virtual bool addProperty(TeAttributeRep& attr, const string& defaultValue);
-
-	//! Adds a new attribute only in the attribute list
-	virtual bool addProperty(TeAttribute& attr);
-
-	/*!
-		\brief Adds the property or sets its value in the object in a valid slice.
-
-		If there is already the property in the attribute list, sets the value of the instances of an object  
-		valid in a specific slice. If there is no this property in the attribute list, adds it in the attribute
-		list and in all instances in the set. After that, sets the value of the instances of an object  
-		valid in a specific slice.
-	*/
-	virtual bool addProperty(const string& object_id, TeProperty& prop, const int& slice=-1);
-
-	/*!
-		\brief Adds the property or sets its value in the object in a valid time and slice.
-
-		If there is already the property in the attribute list, sets the value of the instances of an object  
-		valid in a specific time and slice. If there is no this property in the attribute list, adds it in the attribute
-		list and in all instances in the set. After that, sets the value of the instances of an object  
-		valid in a specific time and slice.
-	*/
-	virtual bool addProperty(const string& object_id, TeProperty& prop, TimeType& time, const int& slice = -1);
-
-	//! Removes an attribute of the attribute list and removes it of all instances in the set 
-	virtual void removeProperty(TeAttributeRep& attr);
-
-	//! Calculates the bounding box of all instances of all objects included in the set
-	virtual TeBox& getBox();
-
-	//! Sets the bounding box of all instances of all objects included in the set
-	virtual void setBox(TeBox& b)
-	{	box_ = b; }
-
-	//! Clears the set 
-	virtual void clear();  
-		
-	//! Returns an iterator to the first element of the set
-	virtual iterator begin()
-	{	return instances_.begin(); }
-	
-	//! Returns an iterator to the one past last element of the set
-	virtual iterator end()
-	{	return instances_.end(); }
-
-	//! Searchs the instances which bounding boxes intersect a specific bounding box, using the R Tree.
-	virtual bool search(const TeBox& b, vector<InstanceType* >& result);
-
-	//! Fills the ST instance set from a layer or theme, using the given filled parameters
-	virtual bool build(bool loadGeometries=false, bool loadAllAttributes=true, vector<string> attrNames=vector<string>(), int slide=-1); 
-
-	//! Fills the ST instance set from a layer or theme, using the given filled parameters
-	virtual bool build(TeGroupingAttr& groupAttr, bool loadGeometries=false, int slide=-1); 
-
-	
-	/*! \class propertyIterator
-		\brief This class implements an iterator concept over the instance set.
-		
-		A structure that allows the traversal ST element set
-		in a similar way as the STL iterators. This iterator passes over each 
-		ST instance of the ST element set and returns a specific numerical property.
-	*/
-	class propertyIterator
-	{
-		public:
-			//! Constructor
-			propertyIterator (TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>* setIt,
-				typename std::vector<InstanceType>::iterator it,  
-				const string& attrName):
-				attrName_(attrName), attrIndex_(-1), it_(it), setIt_(setIt)
-				{
-					attrIndex_ = setIt_->getAttributeIndex(attrName);
-				}
-
-			//! Constructor
-			propertyIterator (TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>* setIt,
-				typename std::vector<InstanceType>::iterator it,
-				const int& attrIndex):
-				attrName_ (""), attrIndex_(attrIndex), it_(it), setIt_(setIt)
-				{ }
-
-			//! Constructor
-			propertyIterator (typename vector<InstanceType>::iterator it,
-				const int& attrIndex):
-				attrName_ (""), attrIndex_(attrIndex), it_(it)
-				{}
-		
-			//! Moves to the next attribute in the set
-			propertyIterator& operator++()
-			{	
-				++it_;
-				return (*this);
-			}
-
-			//! Returns the current attribute as double
-			double operator*()
-			{	return (*it_)[attrIndex_]; 	}
-			
-			//! Sets a new value to the attrIndex_-th attribute of the element pointed by the iterator
-			void setValue(const double& val)
-			{	it_->setPropertyValue(attrIndex_, Te2String(val)); }
-
-			//! Returns a pointer to the instance set 
-			TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>* elemSet()
-			{	return setIt_; 	}
-
-			//! Equal operator
-			bool operator==(const propertyIterator& rhs) const
-			{	return (this->attrIndex_ == rhs.attrIndex_ && this->it_== rhs.it_); }
-
-			//! Unequal operator
-			bool operator!=(const propertyIterator& rhs) const
-			{	return (this->attrIndex_ != rhs.attrIndex_ || this->it_!= rhs.it_);	}
-
-			//! Deprecated: Returns the numerical property of the current instance.
-			bool getProperty(TeProperty& prop)
-			{	return (*it_).getProperty(prop, attrIndex_); }
-				
-		protected:
-			string										attrName_;	//<! the numerical property name
-			int											attrIndex_;	//<! the numerical property index
-			typename vector<InstanceType>::iterator		it_; 
-			TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>* setIt_; 
-
-	};
-
-	//! Returns a property iterator to the attribute named "attName" of the first instance in the set.
-	propertyIterator begin(const string& attName)
-	{
-		return propertyIterator(this, instances_.begin(), attName); 
-	}
-
-	//! Returns a property iterator to the attIndex-th attribute of the first instance in the set.
-	propertyIterator begin(const int& attIndex)
-	{
-		return propertyIterator(this, instances_.begin(), attIndex); 
-	}
-
-	//! Returns a property iterator to the attribute named "attName" of the one past last element of the set
-	propertyIterator end(const string& attName)
-	{
-		return propertyIterator(this, instances_.end(), attName); 
-	}
-
-	//! Returns a property iterator to the attIndex-th attribute of the one past last element of the set
-	propertyIterator end(const int& attIndex)
-	{
-		return propertyIterator(this, instances_.end(), attIndex); 
-	}
-};
-
-template<typename GeometryType, typename TimeType, typename InstanceType>
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::TeBaseSTInstanceSet() :
-	  theme_(0),  layer_(0), rTree_(0)
-{ 
-	TeAttributeList* att = new TeAttributeList();
-	attrList_ = TeSharedPtr<TeAttributeList>(att);
-}
-
-
-template<typename GeometryType, typename TimeType, typename InstanceType>
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::TeBaseSTInstanceSet(TeTheme* theme, const TeAttributeList& attrList) 
-{
-	layer_ = 0;
-	theme_ = 0;
-	rTree_ = 0;
-	TeAttributeList* att = new TeAttributeList(attrList);
-	attrList_ = TeSharedPtr<TeAttributeList>(att);
-	if(!theme)
-		return;
-	theme_ = theme;
-	rTree_ = new TeSAM::TeRTree<int>(theme_->box());
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType>
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::TeBaseSTInstanceSet(TeLayer* layer, const TeAttributeList& attrList) 
-{
-	layer_ = 0;
-	theme_ = 0;
-	rTree_ = 0;
-	TeAttributeList* att = new TeAttributeList(attrList);
-	attrList_ = TeSharedPtr<TeAttributeList>(att);
-	if(!layer)
-		return;
-	layer_ = layer;
-	rTree_ = new TeSAM::TeRTree<int>(layer_->box());
-}
-
-
-template<typename GeometryType, typename TimeType, typename InstanceType>
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::TeBaseSTInstanceSet(const TeBox& box, const TeAttributeList& attrList)
-{
-	layer_ = 0;
-	theme_ = 0;
-	rTree_ = 0;
-	box_ = box;
-	TeAttributeList* att = new TeAttributeList(attrList);
-	attrList_ = TeSharedPtr< TeAttributeList >(att);
-	if(!box_.isValid())
-		return;
-	rTree_ = new TeSAM::TeRTree<int>(box);
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType>
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::TeBaseSTInstanceSet(const TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>& other) 
-{
-	instances_ = other.instances_;		
-	minTime_ = other.minTime_;
-	maxTime_ = other.maxTime_;
-	attrList_ = other.attrList_;
-	theme_ = other.theme_;	
-	layer_ = other.layer_;	
-	box_ = other.box_;
-	objectIdToInstances_ = other.objectIdToInstances_;
-	timeToInstances_ = other.timeToInstances_;
-	sliceToInstances_ = other.sliceToInstances_;
-	rTree_ = 0;
-		
-	if(other.rTree_)
-	{
-		//Operador de copia nao implementado!
-		//rTree_ = new TeSAM::TeRTree<int>(other.rTree_->getBox());
-		//*rTree_ = *other.rTree_; 
-	}
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType>
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::~TeBaseSTInstanceSet() 
-{
-	if(rTree_)
-		delete rTree_;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>& 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::operator= (const TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>& other)
-{
-	if ( this != &other )
-	{
-		instances_ = other.instances_;		
-		minTime_ = other.minTime_;
-		maxTime_ = other.maxTime_;
-		attrList_ = other.attrList_;
-		theme_ = other.theme_;	
-		layer_ = other.layer_;	
-		box_ = other.box_;
-		objectIdToInstances_ = other.objectIdToInstances_;
-		timeToInstances_ = other.timeToInstances_;
-		sliceToInstances_ = other.sliceToInstances_;
-		if(rTree_)
-			delete rTree_;
-		rTree_ = 0;
-		
-		if(other.rTree_)
-		{
-			//Operador de copia nao implementado!
-			//rTree_ = new TeSAM::TeRTree<int>(other.rTree_->getBox());
-			//*rTree_ = *other.rTree_; 
-		}
-	}
-	return *this;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> void 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setAttributeList(TeAttributeList& attrs)
-{	
-	if(!attrList_.isActive())
-		return;
-	
-	attrList_->clear();
-	TeAttributeList::iterator it = attrs.begin();
-	while(it!=attrs.end())
-	{
-		attrList_->push_back(*it);
-		++it;
-	}
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> int
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getAttributeIndex(const string& attrName) 
-{
-	string newName = TeConvertToUpperCase(attrName); 
-	size_t pos = newName.find(".", 0, 1);
-	if (pos != string::npos)
-		newName = TeConvertToUpperCase(attrName.substr(pos+1));
-	
-	for(unsigned int i=0; i<attrList_->size(); ++i)
-	{
-		string s = TeConvertToUpperCase((*attrList_)[i].rep_.name_); 
-		if((s == TeConvertToUpperCase(attrName)) || (s == newName))
-			return i;
-	}
-	return -1;
-}
-
-
-
-template<typename GeometryType, typename TimeType, typename InstanceType> InstanceType* 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstance(const unsigned int& index)
-{
-	if(index<instances_.size())
-		return &(instances_[index]);
-
-	return 0;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> InstanceType* 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstance(const string& objectId, const int& slice)
-{
-	map<string, vector<int> >::iterator itObj = objectIdToInstances_.find(objectId);
-	if(itObj==objectIdToInstances_.end())
-		return 0;
-
-	if(slice<0)
-	{
-		//The slice is not considered
-		vector<int>::iterator it = itObj->second.begin();
-		if(it==itObj->second.end())
-			return 0;
-		return getSTInstance(*it);
-	}
-
-	map<int, vector<int> >::iterator itSlice = sliceToInstances_.find(slice);
-	if(itSlice==sliceToInstances_.end())
-		return 0;
-
-	vector<int>::iterator it = itObj->second.begin();
-	while(it != itObj->second.end())
-	{
-		vector<int>::iterator it2;
-		it2 = find(itSlice->second.begin(), itSlice->second.end(), *it);
-		if(it2!=itSlice->second.end())
-			return getSTInstance(*it2);
-		++it;
-	}
-	return 0;		
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> InstanceType* 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstance(const string& objectId, TimeType& time, const int& slice)
-{
-	map<string, vector<int> >::iterator itObj = objectIdToInstances_.find(objectId);
-	if(itObj==objectIdToInstances_.end())
-		return 0;
-
-	typename map<TimeType, vector<int> >::iterator itTime = timeToInstances_.find(time);
-	if(itTime==timeToInstances_.end())
-		return 0;
-	
-	if(slice<0)
-	{
-		//The slice is not considered
-		vector<int>::iterator it = itObj->second.begin();
-		while(it != itObj->second.end())
-		{
-			vector<int>::iterator it2;
-			it2 = find(itTime->second.begin(), itTime->second.end(), *it);
-			if(it2!=itTime->second.end())
-				return getSTInstance(*it2);
-			++it;
-		}
-		return 0;
-	}
-	
-	map<int, vector<int> >::iterator itSlice = sliceToInstances_.find(slice);
-	if(itSlice==sliceToInstances_.end())
-		return 0;
-
-	vector<int>::iterator it = itObj->second.begin();
-	while(it != itObj->second.end())
-	{
-		vector<int>::iterator it2, it3;
-		it2 = find(itTime->second.begin(), itTime->second.end(), *it);
-		it3 = find(itSlice->second.begin(), itSlice->second.end(), *it);
-		if((it2!=itTime->second.end()) && (it3!=itSlice->second.end()))
-			return getSTInstance(*it2);
-		++it;
-	}
-	return 0;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> void
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstances(vector<InstanceType* >& set, const string& objectId, const int& slice)
-{
-	set.clear();
-	map<string, vector<int> >::iterator itObj = objectIdToInstances_.find(objectId);
-	if(itObj==objectIdToInstances_.end())
-		return;
-
-	vector<int>::iterator it = itObj->second.begin();
-	while(it != itObj->second.end())
-	{
-		InstanceType* inst = getSTInstance(*it);
-		if((slice<0) || (inst->getSlice()==slice))
-			set.push_back(inst);
-		++it;
-	}
-	return;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> void
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstances(vector<InstanceType* >& set, const string& objectId, TimeType& time, const int& slice)
-{
-	set.clear();
-	map<string, vector<int> >::iterator itObj = objectIdToInstances_.find(objectId);
-	if(itObj==objectIdToInstances_.end())
-		return;
-
-	vector<int>::iterator it = itObj->second.begin();
-	while(it != itObj->second.end())
-	{
-		InstanceType* inst = getSTInstance(*it);
-		if(((slice<0) || (inst->getSlice()==slice)) && (inst->getTime()== time))
-			set.push_back(inst);
-		++it;
-	}
-	return;
-}
-	
-template<typename GeometryType, typename TimeType, typename InstanceType> void
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstances(vector<InstanceType* >& set, TimeType& time, const int& slice)
-{
-	set.clear();
-	typename map<TimeType, vector<int> >::iterator itTime = timeToInstances_.find(time);
-	if(itTime==timeToInstances_.end())
-		return;
-
-	vector<int>::iterator it = itTime->second.begin();
-	while(it != itTime->second.end())
-	{
-		InstanceType* inst = getSTInstance(*it);
-		if((slice<0) || (inst->getSlice()==slice))
-			set.push_back(inst);
-		++it;
-	}
-	return;
-
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> void
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstances(vector<InstanceType* >& set, const int& slice)
-{
-	set.clear();
-	map<int, vector<int> >::iterator itSlice = sliceToInstances_.find(slice);
-	if(itSlice==sliceToInstances_.end())
-		return;
-
-	vector<int>::iterator it = itSlice->second.begin();
-	while(it != itSlice->second.end())
-	{
-		set.push_back(getSTInstance(*it));
-		++it;
-	}
-	return;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::insertSTInstance (InstanceType& inst)
-{
-	inst.setAttrList(attrList_);
-	instances_.push_back(inst);
-	int index = (instances_.size()-1);
-	vector<int> aux;
-	aux.push_back(index);
-	
-	//object identity information
-	map<string, vector<int> >::iterator itObj = objectIdToInstances_.find(inst.getObjectId());
-	if(itObj!=objectIdToInstances_.end())
-		itObj->second.push_back(index);
-	else
-		objectIdToInstances_[inst.getObjectId()] = aux;
-
-	//time information
-	if(inst.isTimeValid())
-	{
-		typename map<TimeType, vector<int> >::iterator itTime = timeToInstances_.find(inst.getTime());
-		if(itTime!=timeToInstances_.end())
-			itTime->second.push_back(index);
-		else
-			timeToInstances_[inst.getTime()] = aux;
-	}
-
-	//slice information
-	if(inst.getSlice()>=0)
-	{
-		map<int, vector<int> >::iterator itSlice = sliceToInstances_.find(inst.getSlice());
-		if(itSlice!=sliceToInstances_.end())
-			itSlice->second.push_back(index);
-		else
-			sliceToInstances_[inst.getSlice()] = aux;
-	}
-	
-	//insert in the RTree
-	TeBox b = inst.getGeometries().box();
-	if(b.isValid())
-	{
-		if(rTree_)
-			rTree_->insert(b, index);
-		updateBox(box_, b);
-	}
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> int 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::numSTInstance()
-{
-	return instances_.size();
-}
-		
-template<typename GeometryType, typename TimeType, typename InstanceType> int 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::numSTInstance(const string& objectId)
-{
-	map<string, vector<int> >::iterator it = objectIdToInstances_.find(objectId);
-	if(it==objectIdToInstances_.end())
-		return 0;
-	return it->second.size();
-
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> int 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::numSTInstance(const int& slice)
-{
-	map<int, vector<int> >::iterator it = sliceToInstances_.find(slice);
-	if(it==sliceToInstances_.end())
-		return 0;
-	return it->second.size();
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> int 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::numSTInstance(TimeType& time)
-{
-	typename map<TimeType, vector<int> >::iterator it = timeToInstances_.find(time);
-	if(it==timeToInstances_.end())
-		return 0;
-	return it->second.size();
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setGeometry(const string& object_id, GeometryType& geom, const int& slice)
-{
-	InstanceType* aux = this->getSTInstance(object_id, slice);
-	if(!aux)
-		return false;
-	aux->setGeometry(geom);
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setGeometry(const string& object_id, GeometryType& geom, TimeType& time, const int& slice)
-{
-	InstanceType* aux = this->getSTInstance(object_id, time, slice);
-	if(!aux)
-		return false;
-	aux->setGeometry(geom);
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getGeometry(const string& object_id, GeometryType& geom, const int& slice)
-{
-	InstanceType* aux = this->getSTInstance(object_id, slice);
-	if(!aux)
-		return false;
-	geom = aux->getGeometries(); 
-	return true;
-
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getGeometry(const string& object_id, GeometryType& geom, TimeType& time, const int& slice)
-{
-	InstanceType* aux = this->getSTInstance(object_id, time, slice);
-	if(!aux)
-		return false;
-	geom = aux->getGeometries(); 
-	return true;
-}
-
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getPropertyVector (const string& object_id, TePropertyVector& propVec, const int& slice)
-{
-	propVec.clear();
-	InstanceType* aux = this->getSTInstance(object_id, slice);
-	if(!aux)
-		return false;
-	
-	for(unsigned int i=0; i<aux->getProperties().size(); ++i)
-	{
-		TeProperty prop;
-		prop.value_ = aux->getProperties()[i];
-		if(i<attrList_->size())
-			prop.attr_ = (*attrList_)[i];
-		propVec.push_back(prop);
-	}
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getPropertyVector (const string& object_id, 
-	TePropertyVector& propVec, TimeType& time, const int& slice)
-{
-	propVec.clear();
-	InstanceType* aux = this->getSTInstance(object_id, time, slice);
-	if(!aux)
-		return false;
-	
-	for(unsigned int i=0; i<aux->getProperties().size(); ++i)
-	{
-		TeProperty prop;
-		prop.value_ = aux->getProperties()[i];
-		if(i<attrList_->size())
-			prop.attr_ = (*attrList_)[i];
-		propVec.push_back(prop);
-	}
-	return true;
-
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setProperties (const string& object_id, const vector<string>& values, const int& slice)
-{
-	//the number of attributes in each instance must be equal to the number of attibutes
-	//in the attribute list. 
-	if(values.size() != attrList_->size())
-		return false;
-
-	InstanceType* aux = this->getSTInstance(object_id, slice);
-	if(!aux)
-		return false;
-	aux->setProperties(values);
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setProperties (const string& object_id, const vector<string>& values, TimeType& time, const int& slice)
-{
-	//the number of attributes in each instance must be equal to the number of attibutes
-	//in the attribute list. 
-	if(values.size() != attrList_->size())
-		return false;
-
-	InstanceType* aux = this->getSTInstance(object_id, time, slice);
-	if(!aux)
-		return false;
-	aux->setProperties(values);
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getProperties (const string& object_id, vector<string>& values, const int& slice)
-{
-	values.clear();
-	InstanceType* aux = this->getSTInstance(object_id, slice);
-	if(!aux)
-		return false;
-	values = aux->getProperties();
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getProperties (const string& object_id, vector<string>& values, TimeType& time, const int& slice)
-{
-	values.clear();
-	InstanceType* aux = this->getSTInstance(object_id, time, slice);
-	if(!aux)
-		return false;
-	values = aux->getProperties();
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setAttributeValue (const string& object_id, const string& attr_name,  const string& val, const int& slice)
-{
-	int index = this->getAttributeIndex(attr_name);
-	return this->setAttributeValue(object_id, index, val, slice);
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setAttributeValue (const string& object_id, const string& attr_name, const string& val, TimeType& time, const int& slice)
-{
-	int index = this->getAttributeIndex(attr_name);
-	return this->setAttributeValue(object_id, index, val, time, slice);
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setAttributeValue (const string& object_id, const int& i, const string& val, const int& slice)
-{
-	if(i<0 || i>=(int)attrList_->size()) //if there is not this attribute, return false 
-		return false;
-	InstanceType* aux = this->getSTInstance(object_id, slice);
-	if(!aux)
-		return false;
-	aux->setPropertyValue(i, val); 
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setAttributeValue (const string& object_id, const int& i, const string& val, TimeType& time, const int& slice)
-{
-	if(i<0 || i>=(int)attrList_->size()) //if there is not this attribute, return false 
-		return false;
-	InstanceType* aux = this->getSTInstance(object_id, time, slice);
-	if(!aux)
-		return false;
-	aux->setPropertyValue(i, val); 
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getAttributeValue (const string& object_id, const string& attr_name,  string& val, const int& slice)
-{
-	int index = this->getAttributeIndex(attr_name);
-	return this->getAttributeValue(object_id, index, val, slice);
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getAttributeValue (const string& object_id, const string& attr_name,  string& val, TimeType& time, const int& slice)
-{
-	int index = this->getAttributeIndex(attr_name);
-	return this->getAttributeValue(object_id, index, val, time, slice);
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getAttributeValue (const string& object_id, const int& i, string& val, const int& slice)
-{
-	if(i<0 || i>=(int)attrList_->size())
-		return false;
-	InstanceType* aux = this->getSTInstance(object_id, slice);
-	if(!aux)
-		return false;
-	val = aux->getProperties()[i];
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getAttributeValue (const string& object_id, const int& i, string& val, TimeType& time, const int& slice)
-{
-	if(i<0 || i>=(int)attrList_->size())
-		return false;
-	InstanceType* aux = this->getSTInstance(object_id, time, slice);
-	if(!aux)
-		return false;
-	val = aux->getProperties()[i];
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::addProperty(TeAttributeRep& attr, const string& defaultValue)
-{
-	//verify if there is this attribute
-	if(getAttributeIndex(attr.name_)>=0) 
-		return true;
-
-	TeAttribute at;
-	at.rep_ = attr;
-	attrList_->push_back(at);
-	typename vector<InstanceType>::iterator it = instances_.begin();	
-	
-	//the number of attributes in each instance must be equal to the number of attibutes
-	//in the attribute list.
-	if((attrList_->size()-1) != it->getProperties().size())
-		return false;
-	while(it!=instances_.end())
-	{	
-		it->addPropertyValue(defaultValue);
-		++it;
-	}
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::addProperty(TeAttribute& attr)
-{
-	//verify if there is this attribute
-	if(getAttributeIndex(attr.rep_.name_)<0) 
-		attrList_->push_back(attr);
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::addProperty(const string& object_id, TeProperty& prop, const int& slice)
-{
-	int index = this->getAttributeIndex(prop.attr_.rep_.name_); 
-	if(index<0)
-	{
-		//adds this new attribute in the attr list and in all instances
-		attrList_->push_back(prop.attr_);
-		typename vector<InstanceType>::iterator it =	instances_.begin();		
-		while(it!=instances_.end())
-		{
-			if( (object_id == it->getObjectId()) && ((slice<0) || (slice==it->getSlice())))  
-				it->addPropertyValue(prop.value_);
-			else
-				it->addPropertyValue(string(""));
-			++it;
-		}
-		return true;
-	}
-	
-	//Sets this attribute value
-	typename vector<InstanceType>::iterator it =	instances_.begin();		
-	while(it!=instances_.end())
-	{
-		if( (object_id == it->getObjectId()) && ((slice<0) || (slice==it->getSlice())))  
-			it->setPropertyValue(index, prop.value_);
-		++it;
-	}
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::addProperty(const string& object_id, TeProperty& prop, TimeType& time, const int& slice)
-{
-	int index = this->getAttributeIndex(prop.attr_.rep_.name_); 
-	if(index<0)
-	{
-		//adds this new attribute in the attr list and in all instances
-		attrList_->push_back(prop.attr_);
-		typename vector<InstanceType>::iterator it =	instances_.begin();		
-		while(it!=instances_.end())
-		{
-			if( (object_id == it->getObjectId()) && 
-				(time == it->getTime()) && 
-				((slice<0) || (slice==it->getSlice())))  
-				it->addPropertyValue(prop.value_);
-			else
-				it->addPropertyValue(string(""));
-			++it;
-		}
-		return true;
-	}
-	
-	//Sets this attribute value
-	typename vector<InstanceType>::iterator it =	instances_.begin();		
-	while(it!=instances_.end())
-	{
-		if( (object_id == it->getObjectId()) && 
-			(time == it->getTime()) && 
-			((slice<0) || (slice==it->getSlice())))  
-			it->setPropertyValue(index, prop.value_);
-		++it;
-	}
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> void
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::removeProperty(TeAttributeRep& attr)
-{
-	//Remove of the attribute list
-	string newName = TeConvertToUpperCase(attr.name_); 
-	size_t pos = attr.name_.find(".", 0, 1);
-	if (pos != string::npos)
-		newName = TeConvertToUpperCase(attr.name_.substr(pos+1));
-	
-	unsigned int index = 0;
-	TeAttributeList::iterator it = attrList_->begin();
-	while(it!=attrList_->end())
-	{
-		string s = TeConvertToUpperCase(it->rep_.name_); 
-		if((s == TeConvertToUpperCase(attr.name_)) || (s == newName))
-		{
-			attrList_->erase(it);
-			break;
-		}
-		++it;
-		++index;
-	}
-
-	//Remove of all instances
-	typename vector<InstanceType>::iterator it2 = instances_.begin();		
-	while(it2!=instances_.end())
-	{
-		it2->removePropertyValue(index);
-		++it;
-	}
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> TeBox& 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getBox()
-{
-	if(box_.isValid())
-		return box_;
-
-	if (instances_.size() <= 0)
-		return box_;
-
-	typename TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::iterator it = this->begin();
-	
-	while (it != this->end())
-	{
-		updateBox(box_,it->getGeometries().box());
-		++it;
-	}
-	return box_;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> void 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::clear()
-{
-	instances_.clear();
-	attrList_->clear();
-	objectIdToInstances_.clear();
-	timeToInstances_.clear();
-	sliceToInstances_.clear();
-	if(rTree_)
-		rTree_->clear(); 
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::search(const TeBox& b, vector<InstanceType* >& result)
-{
-	if(!rTree_ )
-		return false;
-
-	vector<int> intResult;
-	rTree_->search(b, intResult);
-	for(unsigned int i=0; i<intResult.size(); ++i)
-		result.push_back(getSTInstance(intResult[i])); 
-	return true;
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::build(bool loadGeometries, bool loadAllAttributes, vector<string> attrNames, int slide)
-{
-	TeQuerierParams param;
-	if(theme_)
-		param.setParams(theme_);
-	else if(layer_)
-		param.setParams(layer_);
-	else
-		return false;
-
-	param.setFillParams(loadGeometries, loadAllAttributes, attrNames);
-	TeQuerier querier(param);
-	return(buildImpl(&querier, slide));
-}
-
-template<typename GeometryType, typename TimeType, typename InstanceType> bool 
-TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::build(TeGroupingAttr& groupAttr, bool loadGeometries, int slide)
-{
-	TeQuerierParams param;
-	if(theme_)
-		param.setParams(theme_);
-	else if(layer_)
-		param.setParams(layer_);
-	else
-		return false;
-
-	param.setFillParams(loadGeometries, groupAttr);
-	TeQuerier querier(param);
-	return(buildImpl(&querier, slide));
-}
-
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeBaseSTInstanceSet.h
+	\brief This file contains structures to deal with a set of spatio-temporal 
+	instances. These instances can belong to a specific layer or theme.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_STINSTANCESET_H
+#define  __TERRALIB_INTERNAL_STINSTANCESET_H
+
+#include "TeBaseSTInstance.h"
+#include "TeRTree.h"
+#include "TeTheme.h"
+#include "TeLayer.h"
+#include "TeQuerierParams.h"
+#include "TeQuerier.h"
+#include "TeSharedPtr.h"
+
+/*! \class TeBaseSTInstanceSet
+	\brief A abstract class that represents a set of spatial temporal instances.
+
+	This abstract class implements a generic spatio-temporal instance set. It must 
+	be specialized according to the instance type (its geometry type, its time type
+	and its own type). 
+
+	\sa TeBaseSTInstance TeTheme TeLayer
+	
+*/
+template< typename GeometryType, typename TimeType, typename InstanceType >
+class TeBaseSTInstanceSet  
+{
+
+protected:
+
+	//! Set of spatio temporal instances
+	vector<InstanceType>	instances_;		
+
+	//! Minimal time associated to spatial temporal instances
+	TimeType				minTime_;
+	//! Maximal time associated to spatial temporal instances
+	TimeType				maxTime_;
+
+	//! Description of all attributes 
+	TeSharedPtr<TeAttributeList>	attrList_;
+
+	//! A pointer to a theme
+	TeTheme*				theme_;
+	//! A pointer to a layer
+	TeLayer*				layer_;	
+	//! A bounding box that contains all geometries of the spatial temporal instances
+	TeBox					box_;
+	
+	//! A map from object identity to its associated instances in the set 
+	map<string, vector<int> >		objectIdToInstances_;
+	//! A map from time to its associated instances in the set
+	map<TimeType, vector<int> >		timeToInstances_;
+	//! A map from slice to its associated instances in the set
+	map<int, vector<int> >			sliceToInstances_;
+	//! A struture to index the geometries: RTree
+	TeSAM::TeRTree<int>*			rTree_;		
+
+	//! Builds the set using a given querier and a specific slice
+	virtual bool buildImpl(TeQuerier* querier, const int& slide = -1) = 0;
+
+public:
+
+	//! An iterator that traverse each instance in the set
+	typedef typename vector<InstanceType>::iterator iterator;
+	
+	//! Constructor. It does not initialize the rTree. 
+	TeBaseSTInstanceSet(); 
+
+	//! Constructor. It initializes the rTree based on theme box.
+	TeBaseSTInstanceSet(TeTheme* theme, const TeAttributeList& attrList = TeAttributeList()); 
+
+	//! Constructor. It initializes the rTree based on layer box.
+	TeBaseSTInstanceSet(TeLayer* layer, const TeAttributeList& attrList = TeAttributeList());  
+
+	//! Constructor. It initializes the rTree based on the given box. 
+	TeBaseSTInstanceSet(const TeBox& box, const TeAttributeList& attrList = TeAttributeList());
+
+	//! Copy constructor
+	TeBaseSTInstanceSet (const TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>& other); 
+
+	//! Destructor
+	virtual ~TeBaseSTInstanceSet();  
+	
+	//! Assignment operator
+	virtual TeBaseSTInstanceSet& operator= (const TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>& other);
+
+	//! Gets minimal time
+	virtual TimeType getMinTime()
+	{ return minTime_; }
+
+	//! Sets minimal time
+	virtual void setMinTime(TimeType& t)
+	{ minTime_ = t; } 
+
+	//! Gets maximal time
+	virtual TimeType getMaxTime()
+	{ return maxTime_; }
+
+	//! Sets maximal time
+	virtual void setMaxTime(TimeType& t)
+	{ maxTime_ = t; } 
+
+	//! Gets the attribute list, that is, the description of all attributes
+	virtual TeAttributeList& getAttributeList()
+	{	return (*attrList_);  }
+
+	//! Sets the attribute list, that is, the description of all attributes
+	virtual void setAttributeList(const TeAttributeList& attrs);
+
+	//! Returns the index of an attribute named "attrName"
+	virtual int getAttributeIndex(const string& attrName);
+
+	//! Gets theme pointer
+	virtual TeTheme* getTheme()
+	{	return theme_;  }
+
+	//! Sets theme pointer
+	virtual void setTheme(TeTheme* t)
+	{	theme_ = t; }
+
+	//! Deprecated: Returns a theme pointer
+	TeTheme* theme()
+	{	return getTheme(); }
+
+	//! Gets layer pointer 
+	virtual TeLayer* getLayer()
+	{	return layer_;  }
+
+	//! Sets layer pointer
+	virtual void setLayer(TeLayer* l)
+	{	layer_ = l; }
+	
+	//! Gets a reference to the instance set 
+	virtual vector<InstanceType>& getSTInstances()
+	{	return instances_; }
+
+	//! Gets a pointer to the index-th ST instance
+	virtual InstanceType* getSTInstance(const unsigned int& index);
+
+	//! Gets a pointer to a ST instance of an object in a specific slice  
+	virtual InstanceType* getSTInstance(const string& objectId, const int& slice = -1);
+
+	//! Gets a pointer to a ST instance of an object in a specific time and slice
+	virtual InstanceType* getSTInstance(const string& objectId, TimeType& time, const int& slice = -1);
+
+	//! Gets pointers to all ST instances of a specific object in a specific slice
+	virtual void getSTInstances(vector<InstanceType*>& set, const string& objectId, const int& slice = -1);
+
+	//! Gets pointers to all ST instances of a specific object in a specific time and slice
+	virtual void getSTInstances(vector<InstanceType*>& set, const string& objectId, TimeType& time, const int& slice = -1);
+	
+	///! Gets pointers to all ST instances of a specific time
+	virtual void getSTInstances(vector<InstanceType*>& set, TimeType& time, const int& slice = -1);
+
+	//! Gets pointers to all ST instances of a specific slice
+	virtual void getSTInstances(vector<InstanceType*>& set, const int& slice);
+
+	//! Inserts a new ST instance in the set 
+	virtual bool insertSTInstance (InstanceType& object);
+		
+	//! Returns the number of instances 
+	virtual int numSTInstance(); 
+	
+	//! Returns the number of instances of an object or element
+	virtual int numSTInstance(const string& objectId); 
+
+	//! Returns the number of instances in a specific slice
+	virtual int numSTInstance(const int& slice);
+
+	//! Returns the number of instances in a specific time
+	virtual int numSTInstance(TimeType& time);
+
+	//! Returns the number of elements or objects in the set
+	virtual int numElements()
+	{	return objectIdToInstances_.size(); }
+
+	//! Sets a geometry of an object in a specific slice
+	virtual bool setGeometry(const string& object_id, GeometryType& geom, const int& slice = -1);
+
+	//! Sets a geometry of an object in a specific time and slice
+	virtual bool setGeometry(const string& object_id, GeometryType& geom, TimeType& time,  const int& slice = -1);
+
+	//! Gets the geometry of an object in a specific slice 
+	virtual bool getGeometry(const string& object_id, GeometryType& geom, const int& slice = -1);
+
+	//! Gets the geometry of an object in a specific time and slice
+	virtual bool getGeometry(const string& object_id, GeometryType& geom, TimeType& time, const int& slice = -1);
+
+	//! Gets a vector of attributes or properties of a object that is valid in a slice 
+	virtual bool getPropertyVector (const string& object_id, TePropertyVector& propVec, const int& slice = -1);
+
+	//! Gets a vector of attributes or properties of a object that is valid in a time and slice
+	virtual bool getPropertyVector (const string& object_id, TePropertyVector& propVec, TimeType& time, const int& slice = -1);
+
+	//! Sets a vector of attribute values of a object that is valid in a slice 
+	virtual bool setProperties (const string& object_id, const vector<string>& values, const int& slice = -1);
+
+	//! Sets a vector of attribute values of a object that is valid in a time and slice
+	virtual bool setProperties (const string& object_id, const vector<string>& values, TimeType& time, const int& slice = -1);
+	
+	//! Gets a vector of attribute values of a object that is valid in a slice 
+	virtual bool getProperties (const string& object_id, vector<string>& values, const int& slice = -1);
+
+	//! Gets a vector of attribute values of a object that is valid in a time and slice
+	virtual bool getProperties (const string& object_id, vector<string>& values, TimeType& time, const int& slice = -1);
+
+	//! Sets the value of the attribute named "attr_name" of an object that is valid in a slice 
+	virtual bool setAttributeValue (const string& object_id, const string& attr_name,  const string& val, const int& slice = -1);
+
+	//! Sets the value of the attribute named "attr_name" of an object that is valid in a time and slice
+	virtual bool setAttributeValue (const string& object_id, const string& attr_name,  const string& val, TimeType& time, const int& slice = -1);
+
+	//! Sets the value of the i-th attribute of an object that is valid in a slice 
+	virtual bool setAttributeValue (const string& object_id, const int& i, const string& val, const int& slice = -1); 
+
+	//! Sets the value of the i-th attribute of an object that is valid in a time and slice
+	virtual bool setAttributeValue (const string& object_id, const int& i, const string& val, TimeType& time, const int& slice = -1); 
+	
+	//! Get the value of the attribute named "attr_name" of an object that is valid in a slice 
+	virtual bool getAttributeValue (const string& object_id, const string& attr_name,  string& val, const int& slice = -1);
+
+	//! Get the value of the attribute named "attr_name" of an object that is valid in a time and slice
+	virtual bool getAttributeValue (const string& object_id, const string& attr_name,  string& val, TimeType& time, const int& slice = -1);
+
+	//! Gets the value of the i-th attribute of an object that is valid in a slice 
+	virtual bool getAttributeValue (const string& object_id, const int& i, string& val, const int& slice = -1); 
+
+	//! Gets the value of the i-th attribute of an object that is valid in a time and slice
+	virtual bool getAttributeValue (const string& object_id, const int& i, string& val, TimeType& time, const int& slice = -1); 
+
+	//! Adds a new attribute in the attribute list and adds it in all instances in the set using a default value
+	virtual bool addProperty(TeAttributeRep& attr, const string& defaultValue);
+
+	//! Adds a new attribute only in the attribute list
+	virtual bool addProperty(TeAttribute& attr);
+
+	/*!
+		\brief Adds the property or sets its value in the object in a valid slice.
+
+		If there is already the property in the attribute list, sets the value of the instances of an object  
+		valid in a specific slice. If there is no this property in the attribute list, adds it in the attribute
+		list and in all instances in the set. After that, sets the value of the instances of an object  
+		valid in a specific slice.
+	*/
+	virtual bool addProperty(const string& object_id, TeProperty& prop, const int& slice=-1);
+
+	/*!
+		\brief Adds the property or sets its value in the object in a valid time and slice.
+
+		If there is already the property in the attribute list, sets the value of the instances of an object  
+		valid in a specific time and slice. If there is no this property in the attribute list, adds it in the attribute
+		list and in all instances in the set. After that, sets the value of the instances of an object  
+		valid in a specific time and slice.
+	*/
+	virtual bool addProperty(const string& object_id, TeProperty& prop, TimeType& time, const int& slice = -1);
+
+	//! Removes an attribute of the attribute list and removes it of all instances in the set 
+	virtual void removeProperty(TeAttributeRep& attr);
+
+	//! Calculates the bounding box of all instances of all objects included in the set
+	virtual TeBox& getBox();
+
+	//! Sets the bounding box of all instances of all objects included in the set
+	virtual void setBox(const TeBox& b)
+	{	box_ = b; }
+
+	//! Clears the set 
+	virtual void clear();  
+
+	void clearInstances();
+		
+	//! Returns an iterator to the first element of the set
+	virtual iterator begin()
+	{	return instances_.begin(); }
+	
+	//! Returns an iterator to the one past last element of the set
+	virtual iterator end()
+	{	return instances_.end(); }
+
+	//! Searchs the instances which bounding boxes intersect a specific bounding box, using the R Tree.
+	virtual bool search(const TeBox& b, vector<InstanceType* >& result);
+
+	//! Fills the ST instance set from a layer or theme, using the given filled parameters
+	virtual bool build(bool loadGeometries=false, bool loadAllAttributes=true, vector<string> attrNames=vector<string>(), int slide=-1); 
+
+	//! Fills the ST instance set from a layer or theme, using the given filled parameters
+	virtual bool build(TeGroupingAttr& groupAttr, bool loadGeometries=false, int slide=-1); 
+
+	
+	/*! \class propertyIterator
+		\brief This class implements an iterator concept over the instance set.
+		
+		A structure that allows the traversal ST element set
+		in a similar way as the STL iterators. This iterator passes over each 
+		ST instance of the ST element set and returns a specific numerical property.
+	*/
+	class propertyIterator
+	{
+		public:
+			//! Constructor
+			propertyIterator (TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>* setIt,
+				typename std::vector<InstanceType>::iterator it,  
+				const string& attrName):
+				attrName_(attrName), attrIndex_(-1), it_(it), setIt_(setIt)
+				{
+					attrIndex_ = setIt_->getAttributeIndex(attrName);
+				}
+
+			//! Constructor
+			propertyIterator (TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>* setIt,
+				typename std::vector<InstanceType>::iterator it,
+				const int& attrIndex):
+				attrName_ (""), attrIndex_(attrIndex), it_(it), setIt_(setIt)
+				{ }
+
+			//! Constructor
+			propertyIterator (typename vector<InstanceType>::iterator it,
+				const int& attrIndex):
+				attrName_ (""), attrIndex_(attrIndex), it_(it)
+				{}
+		
+			//! Moves to the next attribute in the set
+			propertyIterator& operator++()
+			{	
+				++it_;
+				return (*this);
+			}
+
+			//! Returns the current attribute as double
+			double operator*()
+			{	return (*it_)[attrIndex_]; 	}
+			
+			//! Sets a new value to the attrIndex_-th attribute of the element pointed by the iterator
+			void setValue(const double& val)
+			{	it_->setPropertyValue(attrIndex_, Te2String(val)); }
+
+			//! Returns a pointer to the instance set 
+			TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>* elemSet()
+			{	return setIt_; 	}
+
+			//! Equal operator
+			bool operator==(const propertyIterator& rhs) const
+			{	return (this->attrIndex_ == rhs.attrIndex_ && this->it_== rhs.it_); }
+
+			//! Unequal operator
+			bool operator!=(const propertyIterator& rhs) const
+			{	return (this->attrIndex_ != rhs.attrIndex_ || this->it_!= rhs.it_);	}
+
+			//! Deprecated: Returns the numerical property of the current instance.
+			bool getProperty(TeProperty& prop)
+			{	return (*it_).getProperty(prop, attrIndex_); }
+				
+		protected:
+			string										attrName_;	//<! the numerical property name
+			int											attrIndex_;	//<! the numerical property index
+			typename vector<InstanceType>::iterator		it_; 
+			TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>* setIt_; 
+
+	};
+
+	//! Returns a property iterator to the attribute named "attName" of the first instance in the set.
+	propertyIterator begin(const string& attName)
+	{
+		return propertyIterator(this, instances_.begin(), attName); 
+	}
+
+	//! Returns a property iterator to the attIndex-th attribute of the first instance in the set.
+	propertyIterator begin(const int& attIndex)
+	{
+		return propertyIterator(this, instances_.begin(), attIndex); 
+	}
+
+	//! Returns a property iterator to the attribute named "attName" of the one past last element of the set
+	propertyIterator end(const string& attName)
+	{
+		return propertyIterator(this, instances_.end(), attName); 
+	}
+
+	//! Returns a property iterator to the attIndex-th attribute of the one past last element of the set
+	propertyIterator end(const int& attIndex)
+	{
+		return propertyIterator(this, instances_.end(), attIndex); 
+	}
+};
+
+template<typename GeometryType, typename TimeType, typename InstanceType>
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::TeBaseSTInstanceSet() :
+	  theme_(0),  layer_(0), rTree_(0)
+{ 
+	TeAttributeList* att = new TeAttributeList();
+	attrList_ = TeSharedPtr<TeAttributeList>(att);
+}
+
+
+template<typename GeometryType, typename TimeType, typename InstanceType>
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::TeBaseSTInstanceSet(TeTheme* theme, const TeAttributeList& attrList) 
+{
+	layer_ = 0;
+	theme_ = 0;
+	rTree_ = 0;
+	TeAttributeList* att = new TeAttributeList(attrList);
+	attrList_ = TeSharedPtr<TeAttributeList>(att);
+	if(!theme)
+		return;
+	theme_ = theme;
+	rTree_ = new TeSAM::TeRTree<int>(theme_->box());
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType>
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::TeBaseSTInstanceSet(TeLayer* layer, const TeAttributeList& attrList) 
+{
+	layer_ = 0;
+	theme_ = 0;
+	rTree_ = 0;
+	TeAttributeList* att = new TeAttributeList(attrList);
+	attrList_ = TeSharedPtr<TeAttributeList>(att);
+	if(!layer)
+		return;
+	layer_ = layer;
+	rTree_ = new TeSAM::TeRTree<int>(layer_->box());
+}
+
+
+template<typename GeometryType, typename TimeType, typename InstanceType>
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::TeBaseSTInstanceSet(const TeBox& box, const TeAttributeList& attrList)
+{
+	layer_ = 0;
+	theme_ = 0;
+	rTree_ = 0;
+	box_ = box;
+	TeAttributeList* att = new TeAttributeList(attrList);
+	attrList_ = TeSharedPtr< TeAttributeList >(att);
+	if(!box_.isValid())
+		return;
+	rTree_ = new TeSAM::TeRTree<int>(box);
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType>
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::TeBaseSTInstanceSet(const TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>& other) 
+{
+	instances_ = other.instances_;		
+	minTime_ = other.minTime_;
+	maxTime_ = other.maxTime_;
+	attrList_ = other.attrList_;
+	theme_ = other.theme_;	
+	layer_ = other.layer_;	
+	box_ = other.box_;
+	objectIdToInstances_ = other.objectIdToInstances_;
+	timeToInstances_ = other.timeToInstances_;
+	sliceToInstances_ = other.sliceToInstances_;
+	rTree_ = 0;
+		
+	if(other.rTree_)
+	{
+		//Operador de copia nao implementado!
+		//rTree_ = new TeSAM::TeRTree<int>(other.rTree_->getBox());
+		//*rTree_ = *other.rTree_; 
+	}
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType>
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::~TeBaseSTInstanceSet() 
+{
+	if(rTree_)
+		delete rTree_;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>& 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::operator= (const TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>& other)
+{
+	if ( this != &other )
+	{
+		instances_ = other.instances_;		
+		minTime_ = other.minTime_;
+		maxTime_ = other.maxTime_;
+		attrList_ = other.attrList_;
+		theme_ = other.theme_;	
+		layer_ = other.layer_;	
+		box_ = other.box_;
+		objectIdToInstances_ = other.objectIdToInstances_;
+		timeToInstances_ = other.timeToInstances_;
+		sliceToInstances_ = other.sliceToInstances_;
+		if(rTree_)
+			delete rTree_;
+		rTree_ = 0;
+		
+		if(other.rTree_)
+		{
+			//Operador de copia nao implementado!
+			//rTree_ = new TeSAM::TeRTree<int>(other.rTree_->getBox());
+			//*rTree_ = *other.rTree_; 
+		}
+	}
+	return *this;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> void 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setAttributeList(const TeAttributeList& attrs)
+{	
+	if(!attrList_.isActive())
+		return;
+	
+	attrList_->clear();
+	TeAttributeList::const_iterator it = attrs.begin();
+	while(it!=attrs.end())
+	{
+		attrList_->push_back(*it);
+		++it;
+	}
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> int
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getAttributeIndex(const string& attrName) 
+{
+	string newName = TeConvertToUpperCase(attrName); 
+	size_t pos = newName.find(".", 0, 1);
+	if (pos != string::npos)
+		newName = TeConvertToUpperCase(attrName.substr(pos+1));
+	
+	for(unsigned int i=0; i<attrList_->size(); ++i)
+	{
+		string s = TeConvertToUpperCase((*attrList_)[i].rep_.name_); 
+		if((s == TeConvertToUpperCase(attrName)) || (s == newName))
+			return i;
+	}
+	return -1;
+}
+
+
+
+template<typename GeometryType, typename TimeType, typename InstanceType> InstanceType* 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstance(const unsigned int& index)
+{
+	if(index<instances_.size())
+		return &(instances_[index]);
+
+	return 0;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> InstanceType* 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstance(const string& objectId, const int& slice)
+{
+	map<string, vector<int> >::iterator itObj = objectIdToInstances_.find(objectId);
+	if(itObj==objectIdToInstances_.end())
+		return 0;
+
+	if(slice<0)
+	{
+		//The slice is not considered
+		vector<int>::iterator it = itObj->second.begin();
+		if(it==itObj->second.end())
+			return 0;
+		return getSTInstance(*it);
+	}
+
+	map<int, vector<int> >::iterator itSlice = sliceToInstances_.find(slice);
+	if(itSlice==sliceToInstances_.end())
+		return 0;
+
+	vector<int>::iterator it = itObj->second.begin();
+	while(it != itObj->second.end())
+	{
+		vector<int>::iterator it2;
+		it2 = find(itSlice->second.begin(), itSlice->second.end(), *it);
+		if(it2!=itSlice->second.end())
+			return getSTInstance(*it2);
+		++it;
+	}
+	return 0;		
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> InstanceType* 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstance(const string& objectId, TimeType& time, const int& slice)
+{
+	map<string, vector<int> >::iterator itObj = objectIdToInstances_.find(objectId);
+	if(itObj==objectIdToInstances_.end())
+		return 0;
+
+	typename map<TimeType, vector<int> >::iterator itTime = timeToInstances_.find(time);
+	if(itTime==timeToInstances_.end())
+		return 0;
+	
+	if(slice<0)
+	{
+		//The slice is not considered
+		vector<int>::iterator it = itObj->second.begin();
+		while(it != itObj->second.end())
+		{
+			vector<int>::iterator it2;
+			it2 = find(itTime->second.begin(), itTime->second.end(), *it);
+			if(it2!=itTime->second.end())
+				return getSTInstance(*it2);
+			++it;
+		}
+		return 0;
+	}
+	
+	map<int, vector<int> >::iterator itSlice = sliceToInstances_.find(slice);
+	if(itSlice==sliceToInstances_.end())
+		return 0;
+
+	vector<int>::iterator it = itObj->second.begin();
+	while(it != itObj->second.end())
+	{
+		vector<int>::iterator it2, it3;
+		it2 = find(itTime->second.begin(), itTime->second.end(), *it);
+		it3 = find(itSlice->second.begin(), itSlice->second.end(), *it);
+		if((it2!=itTime->second.end()) && (it3!=itSlice->second.end()))
+			return getSTInstance(*it2);
+		++it;
+	}
+	return 0;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> void
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstances(vector<InstanceType* >& set, const string& objectId, const int& slice)
+{
+	set.clear();
+	map<string, vector<int> >::iterator itObj = objectIdToInstances_.find(objectId);
+	if(itObj==objectIdToInstances_.end())
+		return;
+
+	vector<int>::iterator it = itObj->second.begin();
+	while(it != itObj->second.end())
+	{
+		InstanceType* inst = getSTInstance(*it);
+		if((slice<0) || (inst->getSlice()==slice))
+			set.push_back(inst);
+		++it;
+	}
+	return;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> void
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstances(vector<InstanceType* >& set, const string& objectId, TimeType& time, const int& slice)
+{
+	set.clear();
+	map<string, vector<int> >::iterator itObj = objectIdToInstances_.find(objectId);
+	if(itObj==objectIdToInstances_.end())
+		return;
+
+	vector<int>::iterator it = itObj->second.begin();
+	while(it != itObj->second.end())
+	{
+		InstanceType* inst = getSTInstance(*it);
+		if(((slice<0) || (inst->getSlice()==slice)) && (inst->getTime()== time))
+			set.push_back(inst);
+		++it;
+	}
+	return;
+}
+	
+template<typename GeometryType, typename TimeType, typename InstanceType> void
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstances(vector<InstanceType* >& set, TimeType& time, const int& slice)
+{
+	set.clear();
+	typename map<TimeType, vector<int> >::iterator itTime = timeToInstances_.find(time);
+	if(itTime==timeToInstances_.end())
+		return;
+
+	vector<int>::iterator it = itTime->second.begin();
+	while(it != itTime->second.end())
+	{
+		InstanceType* inst = getSTInstance(*it);
+		if((slice<0) || (inst->getSlice()==slice))
+			set.push_back(inst);
+		++it;
+	}
+	return;
+
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> void
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getSTInstances(vector<InstanceType* >& set, const int& slice)
+{
+	set.clear();
+	map<int, vector<int> >::iterator itSlice = sliceToInstances_.find(slice);
+	if(itSlice==sliceToInstances_.end())
+		return;
+
+	vector<int>::iterator it = itSlice->second.begin();
+	while(it != itSlice->second.end())
+	{
+		set.push_back(getSTInstance(*it));
+		++it;
+	}
+	return;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::insertSTInstance (InstanceType& inst)
+{
+	inst.setAttrList(attrList_);
+	instances_.push_back(inst);
+	int index = (instances_.size()-1);
+	vector<int> aux;
+	aux.push_back(index);
+	
+	//object identity information
+	map<string, vector<int> >::iterator itObj = objectIdToInstances_.find(inst.getObjectId());
+	if(itObj!=objectIdToInstances_.end())
+		itObj->second.push_back(index);
+	else
+		objectIdToInstances_[inst.getObjectId()] = aux;
+
+	//time information
+	if(inst.isTimeValid())
+	{
+		typename map<TimeType, vector<int> >::iterator itTime = timeToInstances_.find(inst.getTime());
+		if(itTime!=timeToInstances_.end())
+			itTime->second.push_back(index);
+		else
+			timeToInstances_[inst.getTime()] = aux;
+	}
+
+	//slice information
+	if(inst.getSlice()>=0)
+	{
+		map<int, vector<int> >::iterator itSlice = sliceToInstances_.find(inst.getSlice());
+		if(itSlice!=sliceToInstances_.end())
+			itSlice->second.push_back(index);
+		else
+			sliceToInstances_[inst.getSlice()] = aux;
+	}
+	
+	//insert in the RTree
+	TeBox b = inst.getGeometries().box();
+	if(b.isValid())
+	{
+		if(rTree_)
+			rTree_->insert(b, index);
+		updateBox(box_, b);
+	}
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> int 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::numSTInstance()
+{
+	return instances_.size();
+}
+		
+template<typename GeometryType, typename TimeType, typename InstanceType> int 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::numSTInstance(const string& objectId)
+{
+	map<string, vector<int> >::iterator it = objectIdToInstances_.find(objectId);
+	if(it==objectIdToInstances_.end())
+		return 0;
+	return it->second.size();
+
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> int 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::numSTInstance(const int& slice)
+{
+	map<int, vector<int> >::iterator it = sliceToInstances_.find(slice);
+	if(it==sliceToInstances_.end())
+		return 0;
+	return it->second.size();
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> int 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::numSTInstance(TimeType& time)
+{
+	typename map<TimeType, vector<int> >::iterator it = timeToInstances_.find(time);
+	if(it==timeToInstances_.end())
+		return 0;
+	return it->second.size();
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setGeometry(const string& object_id, GeometryType& geom, const int& slice)
+{
+	InstanceType* aux = this->getSTInstance(object_id, slice);
+	if(!aux)
+		return false;
+	aux->setGeometry(geom);
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setGeometry(const string& object_id, GeometryType& geom, TimeType& time, const int& slice)
+{
+	InstanceType* aux = this->getSTInstance(object_id, time, slice);
+	if(!aux)
+		return false;
+	aux->setGeometry(geom);
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getGeometry(const string& object_id, GeometryType& geom, const int& slice)
+{
+	InstanceType* aux = this->getSTInstance(object_id, slice);
+	if(!aux)
+		return false;
+	geom = aux->getGeometries(); 
+	return true;
+
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getGeometry(const string& object_id, GeometryType& geom, TimeType& time, const int& slice)
+{
+	InstanceType* aux = this->getSTInstance(object_id, time, slice);
+	if(!aux)
+		return false;
+	geom = aux->getGeometries(); 
+	return true;
+}
+
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getPropertyVector (const string& object_id, TePropertyVector& propVec, const int& slice)
+{
+	propVec.clear();
+	InstanceType* aux = this->getSTInstance(object_id, slice);
+	if(!aux)
+		return false;
+	
+	for(unsigned int i=0; i<aux->getProperties().size(); ++i)
+	{
+		TeProperty prop;
+		prop.value_ = aux->getProperties()[i];
+		if(i<attrList_->size())
+			prop.attr_ = (*attrList_)[i];
+		propVec.push_back(prop);
+	}
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getPropertyVector (const string& object_id, 
+	TePropertyVector& propVec, TimeType& time, const int& slice)
+{
+	propVec.clear();
+	InstanceType* aux = this->getSTInstance(object_id, time, slice);
+	if(!aux)
+		return false;
+	
+	for(unsigned int i=0; i<aux->getProperties().size(); ++i)
+	{
+		TeProperty prop;
+		prop.value_ = aux->getProperties()[i];
+		if(i<attrList_->size())
+			prop.attr_ = (*attrList_)[i];
+		propVec.push_back(prop);
+	}
+	return true;
+
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setProperties (const string& object_id, const vector<string>& values, const int& slice)
+{
+	//the number of attributes in each instance must be equal to the number of attibutes
+	//in the attribute list. 
+	if(values.size() != attrList_->size())
+		return false;
+
+	InstanceType* aux = this->getSTInstance(object_id, slice);
+	if(!aux)
+		return false;
+	aux->setProperties(values);
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setProperties (const string& object_id, const vector<string>& values, TimeType& time, const int& slice)
+{
+	//the number of attributes in each instance must be equal to the number of attibutes
+	//in the attribute list. 
+	if(values.size() != attrList_->size())
+		return false;
+
+	InstanceType* aux = this->getSTInstance(object_id, time, slice);
+	if(!aux)
+		return false;
+	aux->setProperties(values);
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getProperties (const string& object_id, vector<string>& values, const int& slice)
+{
+	values.clear();
+	InstanceType* aux = this->getSTInstance(object_id, slice);
+	if(!aux)
+		return false;
+	values = aux->getProperties();
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getProperties (const string& object_id, vector<string>& values, TimeType& time, const int& slice)
+{
+	values.clear();
+	InstanceType* aux = this->getSTInstance(object_id, time, slice);
+	if(!aux)
+		return false;
+	values = aux->getProperties();
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setAttributeValue (const string& object_id, const string& attr_name,  const string& val, const int& slice)
+{
+	int index = this->getAttributeIndex(attr_name);
+	return this->setAttributeValue(object_id, index, val, slice);
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setAttributeValue (const string& object_id, const string& attr_name, const string& val, TimeType& time, const int& slice)
+{
+	int index = this->getAttributeIndex(attr_name);
+	return this->setAttributeValue(object_id, index, val, time, slice);
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setAttributeValue (const string& object_id, const int& i, const string& val, const int& slice)
+{
+	if(i<0 || i>=(int)attrList_->size()) //if there is not this attribute, return false 
+		return false;
+	InstanceType* aux = this->getSTInstance(object_id, slice);
+	if(!aux)
+		return false;
+	aux->setPropertyValue(i, val); 
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::setAttributeValue (const string& object_id, const int& i, const string& val, TimeType& time, const int& slice)
+{
+	if(i<0 || i>=(int)attrList_->size()) //if there is not this attribute, return false 
+		return false;
+	InstanceType* aux = this->getSTInstance(object_id, time, slice);
+	if(!aux)
+		return false;
+	aux->setPropertyValue(i, val); 
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getAttributeValue (const string& object_id, const string& attr_name,  string& val, const int& slice)
+{
+	int index = this->getAttributeIndex(attr_name);
+	return this->getAttributeValue(object_id, index, val, slice);
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getAttributeValue (const string& object_id, const string& attr_name,  string& val, TimeType& time, const int& slice)
+{
+	int index = this->getAttributeIndex(attr_name);
+	return this->getAttributeValue(object_id, index, val, time, slice);
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getAttributeValue (const string& object_id, const int& i, string& val, const int& slice)
+{
+	if(i<0 || i>=(int)attrList_->size())
+		return false;
+	InstanceType* aux = this->getSTInstance(object_id, slice);
+	if(!aux)
+		return false;
+	val = aux->getProperties()[i];
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getAttributeValue (const string& object_id, const int& i, string& val, TimeType& time, const int& slice)
+{
+	if(i<0 || i>=(int)attrList_->size())
+		return false;
+	InstanceType* aux = this->getSTInstance(object_id, time, slice);
+	if(!aux)
+		return false;
+	val = aux->getProperties()[i];
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::addProperty(TeAttributeRep& attr, const string& defaultValue)
+{
+	//verify if there is this attribute
+	if(getAttributeIndex(attr.name_)>=0) 
+		return true;
+
+	TeAttribute at;
+	at.rep_ = attr;
+	attrList_->push_back(at);
+	typename vector<InstanceType>::iterator it = instances_.begin();	
+	
+	//the number of attributes in each instance must be equal to the number of attibutes
+	//in the attribute list.
+	if((attrList_->size()-1) != it->getProperties().size())
+		return false;
+	while(it!=instances_.end())
+	{	
+		it->addPropertyValue(defaultValue);
+		++it;
+	}
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::addProperty(TeAttribute& attr)
+{
+	//verify if there is this attribute
+	if(getAttributeIndex(attr.rep_.name_)<0) 
+		attrList_->push_back(attr);
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::addProperty(const string& object_id, TeProperty& prop, const int& slice)
+{
+	int index = this->getAttributeIndex(prop.attr_.rep_.name_); 
+	if(index<0)
+	{
+		//adds this new attribute in the attr list and in all instances
+		attrList_->push_back(prop.attr_);
+		typename vector<InstanceType>::iterator it =	instances_.begin();		
+		while(it!=instances_.end())
+		{
+			if( (object_id == it->getObjectId()) && ((slice<0) || (slice==it->getSlice())))  
+				it->addPropertyValue(prop.value_);
+			else
+				it->addPropertyValue(string(""));
+			++it;
+		}
+		return true;
+	}
+	
+	//Sets this attribute value
+	typename vector<InstanceType>::iterator it =	instances_.begin();		
+	while(it!=instances_.end())
+	{
+		if( (object_id == it->getObjectId()) && ((slice<0) || (slice==it->getSlice())))  
+			it->setPropertyValue(index, prop.value_);
+		++it;
+	}
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::addProperty(const string& object_id, TeProperty& prop, TimeType& time, const int& slice)
+{
+	int index = this->getAttributeIndex(prop.attr_.rep_.name_); 
+	if(index<0)
+	{
+		//adds this new attribute in the attr list and in all instances
+		attrList_->push_back(prop.attr_);
+		typename vector<InstanceType>::iterator it =	instances_.begin();		
+		while(it!=instances_.end())
+		{
+			if( (object_id == it->getObjectId()) && 
+				(time == it->getTime()) && 
+				((slice<0) || (slice==it->getSlice())))  
+				it->addPropertyValue(prop.value_);
+			else
+				it->addPropertyValue(string(""));
+			++it;
+		}
+		return true;
+	}
+	
+	//Sets this attribute value
+	typename vector<InstanceType>::iterator it =	instances_.begin();		
+	while(it!=instances_.end())
+	{
+		if( (object_id == it->getObjectId()) && 
+			(time == it->getTime()) && 
+			((slice<0) || (slice==it->getSlice())))  
+			it->setPropertyValue(index, prop.value_);
+		++it;
+	}
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> void
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::removeProperty(TeAttributeRep& attr)
+{
+	//Remove of the attribute list
+	string newName = TeConvertToUpperCase(attr.name_); 
+	size_t pos = attr.name_.find(".", 0, 1);
+	if (pos != string::npos)
+		newName = TeConvertToUpperCase(attr.name_.substr(pos+1));
+	
+	unsigned int index = 0;
+	TeAttributeList::iterator it = attrList_->begin();
+	while(it!=attrList_->end())
+	{
+		string s = TeConvertToUpperCase(it->rep_.name_); 
+		if((s == TeConvertToUpperCase(attr.name_)) || (s == newName))
+		{
+			attrList_->erase(it);
+			break;
+		}
+		++it;
+		++index;
+	}
+
+	//Remove of all instances
+	typename vector<InstanceType>::iterator it2 = instances_.begin();		
+	while(it2!=instances_.end())
+	{
+		it2->removePropertyValue(index);
+		++it2;
+	}
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> TeBox& 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::getBox()
+{
+	if(box_.isValid())
+		return box_;
+
+	if (instances_.size() <= 0)
+		return box_;
+
+	typename TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::iterator it = this->begin();
+	
+	while (it != this->end())
+	{
+		updateBox(box_,it->getGeometries().box());
+		++it;
+	}
+	return box_;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> void 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::clear()
+{
+	instances_.clear();
+	attrList_->clear();
+	objectIdToInstances_.clear();
+	timeToInstances_.clear();
+	sliceToInstances_.clear();
+	if(rTree_)
+		rTree_->clear(); 
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> void 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::clearInstances()
+{
+	instances_.clear();
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::search(const TeBox& b, vector<InstanceType* >& result)
+{
+	if(!rTree_ )
+		return false;
+
+	vector<int> intResult;
+	rTree_->search(b, intResult);
+	for(unsigned int i=0; i<intResult.size(); ++i)
+		result.push_back(getSTInstance(intResult[i])); 
+	return true;
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::build(bool loadGeometries, bool loadAllAttributes, vector<string> attrNames, int slide)
+{
+	TeQuerierParams param;
+	if(theme_)
+		param.setParams(theme_);
+	else if(layer_)
+		param.setParams(layer_);
+	else
+		return false;
+
+	param.setFillParams(loadGeometries, loadAllAttributes, attrNames);
+	TeQuerier querier(param);
+	return(buildImpl(&querier, slide));
+}
+
+template<typename GeometryType, typename TimeType, typename InstanceType> bool 
+TeBaseSTInstanceSet<GeometryType, TimeType, InstanceType>::build(TeGroupingAttr& groupAttr, bool loadGeometries, int slide)
+{
+	TeQuerierParams param;
+	if(theme_)
+		param.setParams(theme_);
+	else if(layer_)
+		param.setParams(layer_);
+	else
+		return false;
+
+	param.setFillParams(loadGeometries, groupAttr);
+	TeQuerier querier(param);
+	return(buildImpl(&querier, slide));
+}
+
+
+#endif
+
diff --git a/src/terralib/kernel/TeBlockLoader.cpp b/src/terralib/kernel/TeBlockLoader.cpp
index ef6655d..a0168cb 100644
--- a/src/terralib/kernel/TeBlockLoader.cpp
+++ b/src/terralib/kernel/TeBlockLoader.cpp
@@ -1,171 +1,171 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*
-** ----------------------------------------------------------------------------
-** Includes:
-*/
-
-#include "TeBlockLoader.h"
-
-/*
-** ----------------------------------------------------------------------------
-** Definitions:
-*/
-
-/*
-** ----------------------------------------------------------------------------
-** Methods Implementation:
-*/
-
-TeBlockLoader::TeBlockLoader(const TeBlockLoaderParams& params)
-{
-    params_ = params;
-}
-
-TeBlockLoader::~TeBlockLoader()
-{
-}
-
-bool
-TeBlockLoader::loadBlocks()
-{
-    portal_ = params_.db->getPortal();
-    portal_->freeResult();
-
-    if (!portal_)
-    {
-        return false; // Error opening portal.
-    }
-
-    // Set columns to be retrieved.
-    std::string cols;
-    if (params_.load_all_attrs)
-    {
-        cols = "*";
-    }
-    else
-    {
-        cols = "";
-        std::vector<std::string>::iterator it = params_.attrs.begin();
-        std::vector<std::string>::iterator end = params_.attrs.end();
-        while(it != end)
-        {
-            cols.append(*(it++));
-            if (it != end)
-            {
-                cols.append(", ");
-            }
-        }
-    }
-
-    // Set spatial restrictions.
-    std::string rest;
-    rest += " NOT( ";
-    rest += "lower_x > " + Te2String(params_.selection_box.x2_, 12) + " OR ";
-    rest += "upper_x < " + Te2String(params_.selection_box.x1_, 12) + " OR ";
-    rest += "lower_y > " + Te2String(params_.selection_box.y2_, 12) + " OR ";
-    rest += "upper_y < " + Te2String(params_.selection_box.y1_, 12) + " )";
-
-    // Set block id restrictions.
-    if (params_.dont_load_ids.size() > 0)
-    {
-        std::set<int>::iterator it = params_.dont_load_ids.begin();
-        std::set<int>::iterator end = params_.dont_load_ids.end();
-        while (it != end)
-        {
-            rest += " AND block_id <> " + Te2String(*(it++));
-        }
-    }
-
-    // Set other restrictions.
-    if (params_.attrs_rest.length() > 0)
-    {
-        rest += " AND (" + params_.attrs_rest + ")";
-    }
-
-    // Mount SQL query.
-    std::string sql = "SELECT " + cols + " FROM " + params_.table_name + " WHERE " + rest;
-
-    return portal_->query(sql);
-
-}
-		
-bool
-TeBlockLoader::fetchNext()
-{
-    return portal_->fetchRow();
-}
-
-int
-TeBlockLoader::getID()
-{
-    return portal_->getInt("block_id");
-}
-
-void
-TeBlockLoader::getSpatialData(unsigned char* &data, long& size)
-{
-    portal_->getBlob("spatial_data", data, size);
-}
-
-char*
-TeBlockLoader::getData(const std::string& name)
-{
-    return portal_->getData(name);
-}
-
-int
-TeBlockLoader::getInt(const std::string& name)
-{
-    return portal_->getInt(name);
-}
-
-double
-TeBlockLoader::getDouble(const std::string& name)
-{
-    return portal_->getDouble(name);
-}
-
-bool
-TeBlockLoader::getBool(const std::string& name)
-{
-    return portal_->getBool(name);
-}
-
-TeTime
-TeBlockLoader::getDate(const std::string& name)
-{
-    return portal_->getDate(name);
-}
-
-std::string
-TeBlockLoader::getDateAsString(const std::string& name)
-{
-    return portal_->getDateAsString(name);
-}
-
-/*
-** ----------------------------------------------------------------------------
-** End:
-*/
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*
+** ----------------------------------------------------------------------------
+** Includes:
+*/
+
+#include "TeBlockLoader.h"
+
+/*
+** ----------------------------------------------------------------------------
+** Definitions:
+*/
+
+/*
+** ----------------------------------------------------------------------------
+** Methods Implementation:
+*/
+
+TeBlockLoader::TeBlockLoader(const TeBlockLoaderParams& params)
+{
+    params_ = params;
+}
+
+TeBlockLoader::~TeBlockLoader()
+{
+}
+
+bool
+TeBlockLoader::loadBlocks()
+{
+    portal_ = params_.db->getPortal();
+    portal_->freeResult();
+
+    if (!portal_)
+    {
+        return false; // Error opening portal.
+    }
+
+    // Set columns to be retrieved.
+    std::string cols;
+    if (params_.load_all_attrs)
+    {
+        cols = "*";
+    }
+    else
+    {
+        cols = "";
+        std::vector<std::string>::iterator it = params_.attrs.begin();
+        std::vector<std::string>::iterator end = params_.attrs.end();
+        while(it != end)
+        {
+            cols.append(*(it++));
+            if (it != end)
+            {
+                cols.append(", ");
+            }
+        }
+    }
+
+    // Set spatial restrictions.
+    std::string rest;
+    rest += " NOT( ";
+    rest += "lower_x > " + Te2String(params_.selection_box.x2_, 12) + " OR ";
+    rest += "upper_x < " + Te2String(params_.selection_box.x1_, 12) + " OR ";
+    rest += "lower_y > " + Te2String(params_.selection_box.y2_, 12) + " OR ";
+    rest += "upper_y < " + Te2String(params_.selection_box.y1_, 12) + " )";
+
+    // Set block id restrictions.
+    if (params_.dont_load_ids.size() > 0)
+    {
+        std::set<int>::iterator it = params_.dont_load_ids.begin();
+        std::set<int>::iterator end = params_.dont_load_ids.end();
+        while (it != end)
+        {
+            rest += " AND block_id <> " + Te2String(*(it++));
+        }
+    }
+
+    // Set other restrictions.
+    if (params_.attrs_rest.length() > 0)
+    {
+        rest += " AND (" + params_.attrs_rest + ")";
+    }
+
+    // Mount SQL query.
+    std::string sql = "SELECT " + cols + " FROM " + params_.table_name + " WHERE " + rest;
+
+    return portal_->query(sql);
+
+}
+		
+bool
+TeBlockLoader::fetchNext()
+{
+    return portal_->fetchRow();
+}
+
+int
+TeBlockLoader::getID()
+{
+    return portal_->getInt("block_id");
+}
+
+void
+TeBlockLoader::getSpatialData(unsigned char* &data, long& size)
+{
+    portal_->getBlob("spatial_data", data, size);
+}
+
+char*
+TeBlockLoader::getData(const std::string& name)
+{
+    return portal_->getData(name);
+}
+
+int
+TeBlockLoader::getInt(const std::string& name)
+{
+    return portal_->getInt(name);
+}
+
+double
+TeBlockLoader::getDouble(const std::string& name)
+{
+    return portal_->getDouble(name);
+}
+
+bool
+TeBlockLoader::getBool(const std::string& name)
+{
+    return portal_->getBool(name);
+}
+
+TeTime
+TeBlockLoader::getDate(const std::string& name)
+{
+    return portal_->getDate(name);
+}
+
+std::string
+TeBlockLoader::getDateAsString(const std::string& name)
+{
+    return portal_->getDateAsString(name);
+}
+
+/*
+** ----------------------------------------------------------------------------
+** End:
+*/
diff --git a/src/terralib/kernel/TeBlockLoader.h b/src/terralib/kernel/TeBlockLoader.h
index e9bd718..41b3cc7 100644
--- a/src/terralib/kernel/TeBlockLoader.h
+++ b/src/terralib/kernel/TeBlockLoader.h
@@ -1,95 +1,95 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeBlockLoader.h
-    \brief This file contains structures and definitions for loading data blocks.
-*/
-#ifndef  __TERRALIB_INTERNAL_BLOCKLOADER_H
-#define  __TERRALIB_INTERNAL_BLOCKLOADER_H
-
-/*
-** ----------------------------------------------------------------------------
-** Includes:
-*/
-#include "TeDatabase.h"
-#include "TeBox.h"
-#include "TeTime.h"
-#include <string>
-#include <vector>
-
-/*
-** ----------------------------------------------------------------------------
-** Definitions:
-*/
-
-typedef struct 
-{
-    TeDatabase* db;
-
-    std::string table_name;
-    TeBox selection_box;
-
-    bool load_all_attrs;
-	std::vector<std::string> attrs;
-    std::string attrs_rest;
-
-    std::set<int> dont_load_ids;
-	
-} TeBlockLoaderParams;
-
-class TL_DLL TeBlockLoader
-{
-public:
-
-    /// Default constructor.
-	TeBlockLoader(const TeBlockLoaderParams& params);
-
-    /// Virtual destructor.
-    virtual ~TeBlockLoader();
-
-	bool loadBlocks();
-		
-	bool fetchNext();
-
-    int getID();
-	void getSpatialData(unsigned char* &data, long& size);
-
-    char* getData(const std::string& name);
-    int getInt(const std::string& name);
-    double getDouble(const std::string& name);
-    bool getBool(const std::string& name);
-    TeTime getDate(const std::string& name);
-    std::string getDateAsString(const std::string& name);
-
-protected:
-
-    TeBlockLoaderParams params_;
-    TeDatabasePortal* portal_;
-
-};
-
-#endif // __TERRALIB_INTERNAL_BLOCKLOADER_H
-
-/*
-** ----------------------------------------------------------------------------
-** End:
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeBlockLoader.h
+    \brief This file contains structures and definitions for loading data blocks.
+*/
+#ifndef  __TERRALIB_INTERNAL_BLOCKLOADER_H
+#define  __TERRALIB_INTERNAL_BLOCKLOADER_H
+
+/*
+** ----------------------------------------------------------------------------
+** Includes:
+*/
+#include "TeDatabase.h"
+#include "TeBox.h"
+#include "TeTime.h"
+#include <string>
+#include <vector>
+
+/*
+** ----------------------------------------------------------------------------
+** Definitions:
+*/
+
+typedef struct 
+{
+    TeDatabase* db;
+
+    std::string table_name;
+    TeBox selection_box;
+
+    bool load_all_attrs;
+	std::vector<std::string> attrs;
+    std::string attrs_rest;
+
+    std::set<int> dont_load_ids;
+	
+} TeBlockLoaderParams;
+
+class TL_DLL TeBlockLoader
+{
+public:
+
+    /// Default constructor.
+	TeBlockLoader(const TeBlockLoaderParams& params);
+
+    /// Virtual destructor.
+    virtual ~TeBlockLoader();
+
+	bool loadBlocks();
+		
+	bool fetchNext();
+
+    int getID();
+	void getSpatialData(unsigned char* &data, long& size);
+
+    char* getData(const std::string& name);
+    int getInt(const std::string& name);
+    double getDouble(const std::string& name);
+    bool getBool(const std::string& name);
+    TeTime getDate(const std::string& name);
+    std::string getDateAsString(const std::string& name);
+
+protected:
+
+    TeBlockLoaderParams params_;
+    TeDatabasePortal* portal_;
+
+};
+
+#endif // __TERRALIB_INTERNAL_BLOCKLOADER_H
+
+/*
+** ----------------------------------------------------------------------------
+** End:
 */
\ No newline at end of file
diff --git a/src/terralib/kernel/TeBox.cpp b/src/terralib/kernel/TeBox.cpp
old mode 100755
new mode 100644
index 51dfa62..0d2c7da
--- a/src/terralib/kernel/TeBox.cpp
+++ b/src/terralib/kernel/TeBox.cpp
@@ -1,213 +1,213 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeBox.h"
-#include "TeGeometry.h"
-
-void zoomIn ( TeBox& box, double t )
-{
-		TeCoord2D c = box.center ();
-		double w    = box.width ()*t/2.;
-		double h    = box.height ()*t/2.;
-		box.x1_ = c.x() - w;
-		box.x2_ = c.x() + w;
-		box.y1_ = c.y() - h;
-		box.y2_ = c.y() + h;
-}
-
-
-void zoomOut ( TeBox& box, double t )
-{
-		TeCoord2D c = box.center ();
-		double w = box.width ()/t/2.;
-		double h = box.height ()/t/2.;
-		box.x1_ = c.x() - w;
-		box.x2_ = c.x() + w;
-		box.y1_ = c.y() - h;
-		box.y2_ = c.y() + h;
-}
-
-// --- UPDATE BOX
-
-void
-updateBox ( TeBox& box, const TeCoord2D& pt )
-{
-	if ( pt.x() <= box.x1_ )
-		box.x1_  = pt.x();
-	
-	if ( pt.x() >= box.x2_ )
-		 box.x2_ =  pt.x();
-
-	if ( pt.y() <= box.y1_ )
-		box.y1_ =  pt.y();
-
-	if ( pt.y() >= box.y2_ )
-		box.y2_ =  pt.y();
-}
-
-void
-updateBox ( TeBox& box, const TeBox& other )
-{
-		if ( other.x1_ <= box.x1_ ) 
-			box.x1_ = other.x1_;
-		if ( other.x2_ >= box.x2_ )
-			box.x2_ = other.x2_;
-		if ( other.y1_ <= box.y1_ )
-			box.y1_ = other.y1_;
-		if ( other.y2_ >= box.y2_ )
-			box.y2_ = other.y2_;
-}
-
-void
-updateBox ( TeBox& box, const TeGeometry& geo )
-{
-		updateBox ( box, geo.box() );
-}
-
-TeBox 
-makeBox(double x1, double y1, double x2, double y2, const double& tol)
-{
-	double xlo, xhi;
-
-	if(x1 > x2)
-	{
-		xhi = x1;
-		xlo = x2;
-	}
-	else
-	{
-		xhi = x2;
-		xlo = x1;
-	}
-
-	double ylo, yhi;	
-	if(y1 > y2)
-	{
-		yhi = y1;
-		ylo = y2;
-	}
-	else
-	{
-		yhi = y2;
-		ylo = y1;
-	}
-
-	return TeBox(xlo - tol, ylo - tol, xhi + tol, yhi + tol);
-}
-
-
-TeBox 
-adjustToCut(TeBox& box, double bWidth, double bHeight)
-{
-	double auxD;
-	int auxI;
-
-	int magicX; 
-	auxD = box.x1()/bWidth;
-	auxI = (int)(box.x1()/bWidth);
-	if (box.x1() < 0 && (auxD - auxI) != 0)
-		magicX = (int) (box.x1()/bWidth - 1);
-	else
-		magicX = auxI;
-
-	int magicY;
-	auxD = box.y1()/bHeight;
-	auxI = (int)(box.y1()/bHeight);
-	if (box.y1() < 0 && (auxD - auxI) != 0)
-		magicY  = (int)(box.y1()/bHeight - 1);
-	else
-		magicY  = auxI;
-		
-	double xi = magicX*bWidth;
-	double yi = magicY*bHeight;
-
-	int magicX2;
-	auxD = box.x2()/bWidth;
-	auxI = (int)(box.x2()/bWidth);
-	if ((box.x2() < 0) || (auxD - auxI) == 0)
-		magicX2 = (int) (box.x2()/bWidth);
-	else
-		magicX2 = (int) (box.x2()/bWidth + 1);
-
-
-	int magicY2;
-	auxD = box.y2()/bHeight;
-	auxI = (int)(box.y2()/bHeight);
-	if ((box.y2() < 0) || (auxD - auxI) == 0)
-		magicY2 = (int) (box.y2()/bHeight);
-	else
-		magicY2 = (int) (box.y2()/bHeight + 1);
-
-
-	double xf = (magicX2)*bWidth;
-	double yf = (magicY2)*bHeight;
-
-	return TeBox(xi,yi,xf,yf);
-}
-
-TePolygon polygonFromBox( const TeBox& bb )
-{
-	TePolygon poly;
-	TeLine2D line;
-	
-	TeCoord2D ll (bb.x1_, bb.y1_);
-	TeCoord2D ul (bb.x1_, bb.y2_);
-	TeCoord2D ur (bb.x2_, bb.y2_);
-	TeCoord2D lr (bb.x2_, bb.y1_);
-
-	line.add(ll);
-	line.add(ul);
-	line.add(ur);
-	line.add(lr);
-	line.add(ll);
-
-	TeLinearRing ring(line);
-	poly.add(ring);
-	return poly;
-}
-
-int adjustBox( TeBox& bb )
-{
-	int precision = 4;
-	double factor =  pow(10., precision);
-	double tol = 1 / factor;
-	while (( TeCompareDouble( bb.x1_, bb.x2_, precision ) == true ) || 
-		   ( TeCompareDouble( bb.y1_, bb.y2_, precision ) == true ) )
-	{
-		precision--;
-		tol = 1 / pow(10., precision);
-		if ( TeCompareDouble( bb.x1_, bb.x2_, precision ) == true )
-		{
-			bb.x1_ -= tol;
-			bb.x2_ += tol;
-		}
-		if ( TeCompareDouble( bb.y1_, bb.y2_, precision ) == true )
-		{
-			bb.y1_ -= tol;
-			bb.y2_ += tol;
-		}
-		if (precision == 0)
-			break;		
-	}
-	return precision;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeBox.h"
+#include "TeGeometry.h"
+
+void zoomIn ( TeBox& box, double t )
+{
+		TeCoord2D c = box.center ();
+		double w    = box.width ()*t/2.;
+		double h    = box.height ()*t/2.;
+		box.x1_ = c.x() - w;
+		box.x2_ = c.x() + w;
+		box.y1_ = c.y() - h;
+		box.y2_ = c.y() + h;
+}
+
+
+void zoomOut ( TeBox& box, double t )
+{
+		TeCoord2D c = box.center ();
+		double w = box.width ()/t/2.;
+		double h = box.height ()/t/2.;
+		box.x1_ = c.x() - w;
+		box.x2_ = c.x() + w;
+		box.y1_ = c.y() - h;
+		box.y2_ = c.y() + h;
+}
+
+// --- UPDATE BOX
+
+void
+updateBox ( TeBox& box, const TeCoord2D& pt )
+{
+	if ( pt.x() <= box.x1_ )
+		box.x1_  = pt.x();
+	
+	if ( pt.x() >= box.x2_ )
+		 box.x2_ =  pt.x();
+
+	if ( pt.y() <= box.y1_ )
+		box.y1_ =  pt.y();
+
+	if ( pt.y() >= box.y2_ )
+		box.y2_ =  pt.y();
+}
+
+void
+updateBox ( TeBox& box, const TeBox& other )
+{
+		if ( other.x1_ <= box.x1_ ) 
+			box.x1_ = other.x1_;
+		if ( other.x2_ >= box.x2_ )
+			box.x2_ = other.x2_;
+		if ( other.y1_ <= box.y1_ )
+			box.y1_ = other.y1_;
+		if ( other.y2_ >= box.y2_ )
+			box.y2_ = other.y2_;
+}
+
+void
+updateBox ( TeBox& box, const TeGeometry& geo )
+{
+		updateBox ( box, geo.box() );
+}
+
+TeBox 
+makeBox(double x1, double y1, double x2, double y2, const double& tol)
+{
+	double xlo, xhi;
+
+	if(x1 > x2)
+	{
+		xhi = x1;
+		xlo = x2;
+	}
+	else
+	{
+		xhi = x2;
+		xlo = x1;
+	}
+
+	double ylo, yhi;	
+	if(y1 > y2)
+	{
+		yhi = y1;
+		ylo = y2;
+	}
+	else
+	{
+		yhi = y2;
+		ylo = y1;
+	}
+
+	return TeBox(xlo - tol, ylo - tol, xhi + tol, yhi + tol);
+}
+
+
+TeBox 
+adjustToCut(TeBox& box, double bWidth, double bHeight)
+{
+	double auxD;
+	int auxI;
+
+	int magicX; 
+	auxD = box.x1()/bWidth;
+	auxI = (int)(box.x1()/bWidth);
+	if (box.x1() < 0 && (auxD - auxI) != 0)
+		magicX = (int) (box.x1()/bWidth - 1);
+	else
+		magicX = auxI;
+
+	int magicY;
+	auxD = box.y1()/bHeight;
+	auxI = (int)(box.y1()/bHeight);
+	if (box.y1() < 0 && (auxD - auxI) != 0)
+		magicY  = (int)(box.y1()/bHeight - 1);
+	else
+		magicY  = auxI;
+		
+	double xi = magicX*bWidth;
+	double yi = magicY*bHeight;
+
+	int magicX2;
+	auxD = box.x2()/bWidth;
+	auxI = (int)(box.x2()/bWidth);
+	if ((box.x2() < 0) || (auxD - auxI) == 0)
+		magicX2 = (int) (box.x2()/bWidth);
+	else
+		magicX2 = (int) (box.x2()/bWidth + 1);
+
+
+	int magicY2;
+	auxD = box.y2()/bHeight;
+	auxI = (int)(box.y2()/bHeight);
+	if ((box.y2() < 0) || (auxD - auxI) == 0)
+		magicY2 = (int) (box.y2()/bHeight);
+	else
+		magicY2 = (int) (box.y2()/bHeight + 1);
+
+
+	double xf = (magicX2)*bWidth;
+	double yf = (magicY2)*bHeight;
+
+	return TeBox(xi,yi,xf,yf);
+}
+
+TePolygon polygonFromBox( const TeBox& bb )
+{
+	TePolygon poly;
+	TeLine2D line;
+	
+	TeCoord2D ll (bb.x1_, bb.y1_);
+	TeCoord2D ul (bb.x1_, bb.y2_);
+	TeCoord2D ur (bb.x2_, bb.y2_);
+	TeCoord2D lr (bb.x2_, bb.y1_);
+
+	line.add(ll);
+	line.add(ul);
+	line.add(ur);
+	line.add(lr);
+	line.add(ll);
+
+	TeLinearRing ring(line);
+	poly.add(ring);
+	return poly;
+}
+
+int adjustBox( TeBox& bb )
+{
+	int precision = 4;
+	double factor =  pow(10., precision);
+	double tol = 1 / factor;
+	while (( TeCompareDouble( bb.x1_, bb.x2_, precision ) == true ) || 
+		   ( TeCompareDouble( bb.y1_, bb.y2_, precision ) == true ) )
+	{
+		precision--;
+		tol = 1 / pow(10., precision);
+		if ( TeCompareDouble( bb.x1_, bb.x2_, precision ) == true )
+		{
+			bb.x1_ -= tol;
+			bb.x2_ += tol;
+		}
+		if ( TeCompareDouble( bb.y1_, bb.y2_, precision ) == true )
+		{
+			bb.y1_ -= tol;
+			bb.y2_ += tol;
+		}
+		if (precision == 0)
+			break;		
+	}
+	return precision;
+}
diff --git a/src/terralib/kernel/TeBox.h b/src/terralib/kernel/TeBox.h
old mode 100755
new mode 100644
index 9c1e544..7c40f3e
--- a/src/terralib/kernel/TeBox.h
+++ b/src/terralib/kernel/TeBox.h
@@ -1,218 +1,218 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeBox.h
-    \brief This file contains structures and definitions to deal with a box
-*/
-#ifndef  __TERRALIB_INTERNAL_BOX_H
-#define  __TERRALIB_INTERNAL_BOX_H
-
-#include "TeDefines.h"
-#include "TeCoord2D.h"
-#include "TeDefines.h"
-#include "float.h"
-
-class TeGeometry;
-class TePolygon;
-
-//! Provides support for dealing with a rectangular a box. Used by all geometrical representations
-/*!
- \sa
-	TeCoord2D
- */
-struct TL_DLL TeBox {
-
-	enum TeBoxCorner { TeLOWERLEFT=0, TeUPPERLEFT=1, TeLOWERRIGHT=2, TeUPPERRIGHT=3 };
-
-//! Default constructor 
-/*!
-	\param x1 X value of the lower left box coordinate 
-	\param y1 Y value of the lower left box coordinate 
-	\param x2 X value of the upper right box coordinate 
-	\param y2 Y value of the upper right box coordinate 
-*/
-	TeBox ( const double& x1 = TeMAXFLOAT, const double y1 = TeMAXFLOAT,
-		  const double& x2 = -TeMAXFLOAT, const double y2 = -TeMAXFLOAT ):
-		  x1_ ( x1 ), y1_ ( y1 ), x2_ ( x2 ), y2_ ( y2 ) {}
-
-//! Constructor from corners as TeCoord2D objects
-/*!
-	\param p1 lower left box coordinate
-	\param p2 upper right box coordinate
-*/
-	TeBox( const TeCoord2D& p1, const TeCoord2D& p2 ):
-		x1_ ( p1.x() ), y1_ ( p1.y() ),
-		x2_ ( p2.x() ), y2_ ( p2.y() )
-		{}
-
-//! Copy constructor
-	TeBox ( const TeBox& rhs )
-	{
-		x1_ = rhs.x1_;
-		x2_ = rhs.x2_;
-		y1_ = rhs.y1_;
-		y2_ = rhs.y2_;
-	}
-
-//! Operator =
-	TeBox& operator=(const TeBox& rhs)
-	{
-		if ( this == &rhs )
-			return *this;
-		else
-		{
-		x1_ = rhs.x1_;
-		x2_ = rhs.x2_;
-		y1_ = rhs.y1_;
-		y2_ = rhs.y2_;
-		}
-		return *this;
-	}
-
-//!	Returns TRUE if current TeBox is equal to box; otherwise returns FALSE 
-	bool operator== (const TeBox& box) const 
-	{return (  ( fabs (y1_ - box.y1_) < TePrecision::instance().precision() ) 
-			&& ( fabs (x1_ - box.x1_) < TePrecision::instance().precision() ) 
-			&& ( fabs (y2_ - box.y2_) < TePrecision::instance().precision() ) 
-			&& ( fabs (x2_ - box.x2_) < TePrecision::instance().precision() ) 
-			); }
-      
-//! Returns FALSE if current TeBox is equal to box; otherwise returns TRUE 
-  bool operator!= (const TeBox& box) const
-  {
-    return ( ! operator==( box ) );
-  }      
-
-//! Returns the coordinate corresponding to the geometric center of the  box
-	TeCoord2D center() const
-	{	
-		TeCoord2D p ( (  ( x1_ + x2_ ) / 2.), ( ( y1_ + y2_ ) / 2.) );
-		return p;
-	}	
-
-//!	Returns TRUE if current box is valid; otherwise returns FALSE 
-	bool isValid() const
-	{
-		if (x1_ == TeMAXFLOAT || y1_ == TeMAXFLOAT || 
-		    x2_ == -TeMAXFLOAT || y2_ == -TeMAXFLOAT  ||
-			x1_ > x2_ || y1_ > y2_)
-			return false;
-		if( TeISNAN(x1_) || TeISNAN(y1_) || TeISNAN(x2_) || TeISNAN(y2_))
-			return false;
-		return true;
-	}
-
-//! Returns the x component of the lower left corner
-	const double& x1 () const 
-	{ return x1_;}
-
-//! Returns the y component of the lower left corner
-	const double& y1 () const 
-	{ return y1_;}
-
-//! Returns the x component of the upper right corner
-	const double& x2 () const 
-	{ return x2_;}
-
-//! Returns the y component of the upper right corner
-	const double& y2 () const 
-	{ return y2_;}
-
-//! Returns the box width 
-	double width () const 
-	{ return x2_ - x1_; }
-	
-//! Returns the box height 
-	double height () const 
-	{ return y2_ - y1_; }
-	
-//! Returns the lower left coordinate of the box 
-	TeCoord2D lowerLeft() const 
-	{ return TeCoord2D ( x1_, y1_ );}
-
-//! Returns the upper right coordinate of the box 
-	TeCoord2D upperRight() const
-	{ return TeCoord2D (x2_,y2_);}
-
-//! Destructor
-	~TeBox() {}  
-	
-	double x1_, //!< x coordinate of the lower left corner
-		   y1_,	//!< y coordinate of the lower left corner
-		   x2_,	//!< x coordinate of the upper right corner
-		   y2_;	//!< y coordinate of the upper right corner	
-
-};
-
-// ALGORITHMS THAT USE A BOX
-
-/*! \fn void updateBox void updateBox ( TeBox& box, const TeCoord2D& pt ) 
-   \brief update a box to include a coordinate
- */
-TL_DLL void updateBox ( TeBox& box, const TeCoord2D& pt );  
-
-/*! \fn void updateBox void updateBox ( TeBox& box, const TeBox& other ) 
-   \brief update a box to include another box
- */
-TL_DLL void updateBox ( TeBox& box, const TeBox& other );
-
-/*! \fn void updateBox ( TeBox& box, const TeGeometry& geo ) 
-   \brief update a box to include a geometry
- */
-TL_DLL void updateBox ( TeBox& box, const TeGeometry& geo );
-
-
-// ZOOMING FUNCTIONS 
-
-/*! \fn void zoomIn void zoomIn ( TeBox& box, double t = .8) 
-   \brief increases the box by a factor t
- */
-TL_DLL void zoomIn ( TeBox& box, double t = .8); 
-
-/*! \fn  void zoomOut void zoomOut ( TeBox& box, double t = .8) 
-   \brief decreases box by a factor of t
- */
-TL_DLL void zoomOut ( TeBox& box, double t = .8);
- 
-/*! \fn  TeBox makeBox(double x1, double y1, double x2, double y2, const double& tol = 0.0) 
-   \brief builds a box 
- */
-TL_DLL TeBox makeBox(double x1, double y1, double x2, double y2, const double& tol = 0.0);
-
-/*! \fn  TeBox adjustToCut(TeBox& box, double bWidth, double bHeight) 
-   \brief finds the correspondent smallest box that allows a box to be cut in blocks of a given size 
- */
-TL_DLL TeBox adjustToCut(TeBox& box, double bWidth, double bHeight);
-
-/*! \fn TePolygon polygonFromBox(TeBox& bb) 
-   \brief builds a TePolygon geometry from a box
- */
-TL_DLL TePolygon polygonFromBox( const TeBox& bb );
-
-/*! \fn  TeBox adjust()
-\brief Expands the box when has not width or height. Returns the precision level needed.
-*/
-TL_DLL int adjustBox( TeBox& bb );
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeBox.h
+    \brief This file contains structures and definitions to deal with a box
+*/
+#ifndef  __TERRALIB_INTERNAL_BOX_H
+#define  __TERRALIB_INTERNAL_BOX_H
+
+#include "TeDefines.h"
+#include "TeCoord2D.h"
+#include "TeDefines.h"
+#include "float.h"
+
+class TeGeometry;
+class TePolygon;
+
+//! Provides support for dealing with a rectangular a box. Used by all geometrical representations
+/*!
+ \sa
+	TeCoord2D
+ */
+struct TL_DLL TeBox {
+
+	enum TeBoxCorner { TeLOWERLEFT=0, TeUPPERLEFT=1, TeLOWERRIGHT=2, TeUPPERRIGHT=3 };
+
+//! Default constructor 
+/*!
+	\param x1 X value of the lower left box coordinate 
+	\param y1 Y value of the lower left box coordinate 
+	\param x2 X value of the upper right box coordinate 
+	\param y2 Y value of the upper right box coordinate 
+*/
+	TeBox ( const double& x1 = TeMAXFLOAT, const double y1 = TeMAXFLOAT,
+		  const double& x2 = -TeMAXFLOAT, const double y2 = -TeMAXFLOAT ):
+		  x1_ ( x1 ), y1_ ( y1 ), x2_ ( x2 ), y2_ ( y2 ) {}
+
+//! Constructor from corners as TeCoord2D objects
+/*!
+	\param p1 lower left box coordinate
+	\param p2 upper right box coordinate
+*/
+	TeBox( const TeCoord2D& p1, const TeCoord2D& p2 ):
+		x1_ ( p1.x() ), y1_ ( p1.y() ),
+		x2_ ( p2.x() ), y2_ ( p2.y() )
+		{}
+
+//! Copy constructor
+	TeBox ( const TeBox& rhs )
+	{
+		x1_ = rhs.x1_;
+		x2_ = rhs.x2_;
+		y1_ = rhs.y1_;
+		y2_ = rhs.y2_;
+	}
+
+//! Operator =
+	TeBox& operator=(const TeBox& rhs)
+	{
+		if ( this == &rhs )
+			return *this;
+		else
+		{
+		x1_ = rhs.x1_;
+		x2_ = rhs.x2_;
+		y1_ = rhs.y1_;
+		y2_ = rhs.y2_;
+		}
+		return *this;
+	}
+
+//!	Returns TRUE if current TeBox is equal to box; otherwise returns FALSE 
+	bool operator== (const TeBox& box) const 
+	{return (  ( fabs (y1_ - box.y1_) < TePrecision::instance().precision() ) 
+			&& ( fabs (x1_ - box.x1_) < TePrecision::instance().precision() ) 
+			&& ( fabs (y2_ - box.y2_) < TePrecision::instance().precision() ) 
+			&& ( fabs (x2_ - box.x2_) < TePrecision::instance().precision() ) 
+			); }
+      
+//! Returns FALSE if current TeBox is equal to box; otherwise returns TRUE 
+  bool operator!= (const TeBox& box) const
+  {
+    return ( ! operator==( box ) );
+  }      
+
+//! Returns the coordinate corresponding to the geometric center of the  box
+	TeCoord2D center() const
+	{	
+		TeCoord2D p ( (  ( x1_ + x2_ ) / 2.), ( ( y1_ + y2_ ) / 2.) );
+		return p;
+	}	
+
+//!	Returns TRUE if current box is valid; otherwise returns FALSE 
+	bool isValid() const
+	{
+		if (x1_ == TeMAXFLOAT || y1_ == TeMAXFLOAT || 
+		    x2_ == -TeMAXFLOAT || y2_ == -TeMAXFLOAT  ||
+			x1_ > x2_ || y1_ > y2_)
+			return false;
+		if( TeISNAN(x1_) || TeISNAN(y1_) || TeISNAN(x2_) || TeISNAN(y2_))
+			return false;
+		return true;
+	}
+
+//! Returns the x component of the lower left corner
+	const double& x1 () const 
+	{ return x1_;}
+
+//! Returns the y component of the lower left corner
+	const double& y1 () const 
+	{ return y1_;}
+
+//! Returns the x component of the upper right corner
+	const double& x2 () const 
+	{ return x2_;}
+
+//! Returns the y component of the upper right corner
+	const double& y2 () const 
+	{ return y2_;}
+
+//! Returns the box width 
+	double width () const 
+	{ return x2_ - x1_; }
+	
+//! Returns the box height 
+	double height () const 
+	{ return y2_ - y1_; }
+	
+//! Returns the lower left coordinate of the box 
+	TeCoord2D lowerLeft() const 
+	{ return TeCoord2D ( x1_, y1_ );}
+
+//! Returns the upper right coordinate of the box 
+	TeCoord2D upperRight() const
+	{ return TeCoord2D (x2_,y2_);}
+
+//! Destructor
+	~TeBox() {}  
+	
+	double x1_, //!< x coordinate of the lower left corner
+		   y1_,	//!< y coordinate of the lower left corner
+		   x2_,	//!< x coordinate of the upper right corner
+		   y2_;	//!< y coordinate of the upper right corner	
+
+};
+
+// ALGORITHMS THAT USE A BOX
+
+/*! \fn void updateBox void updateBox ( TeBox& box, const TeCoord2D& pt ) 
+   \brief update a box to include a coordinate
+ */
+TL_DLL void updateBox ( TeBox& box, const TeCoord2D& pt );  
+
+/*! \fn void updateBox void updateBox ( TeBox& box, const TeBox& other ) 
+   \brief update a box to include another box
+ */
+TL_DLL void updateBox ( TeBox& box, const TeBox& other );
+
+/*! \fn void updateBox ( TeBox& box, const TeGeometry& geo ) 
+   \brief update a box to include a geometry
+ */
+TL_DLL void updateBox ( TeBox& box, const TeGeometry& geo );
+
+
+// ZOOMING FUNCTIONS 
+
+/*! \fn void zoomIn void zoomIn ( TeBox& box, double t = .8) 
+   \brief increases the box by a factor t
+ */
+TL_DLL void zoomIn ( TeBox& box, double t = .8); 
+
+/*! \fn  void zoomOut void zoomOut ( TeBox& box, double t = .8) 
+   \brief decreases box by a factor of t
+ */
+TL_DLL void zoomOut ( TeBox& box, double t = .8);
+ 
+/*! \fn  TeBox makeBox(double x1, double y1, double x2, double y2, const double& tol = 0.0) 
+   \brief builds a box 
+ */
+TL_DLL TeBox makeBox(double x1, double y1, double x2, double y2, const double& tol = 0.0);
+
+/*! \fn  TeBox adjustToCut(TeBox& box, double bWidth, double bHeight) 
+   \brief finds the correspondent smallest box that allows a box to be cut in blocks of a given size 
+ */
+TL_DLL TeBox adjustToCut(TeBox& box, double bWidth, double bHeight);
+
+/*! \fn TePolygon polygonFromBox(TeBox& bb) 
+   \brief builds a TePolygon geometry from a box
+ */
+TL_DLL TePolygon polygonFromBox( const TeBox& bb );
+
+/*! \fn  TeBox adjust()
+\brief Expands the box when has not width or height. Returns the precision level needed.
+*/
+TL_DLL int adjustBox( TeBox& bb );
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeBufferRegion.cpp b/src/terralib/kernel/TeBufferRegion.cpp
old mode 100755
new mode 100644
index ed3a73b..a20456a
--- a/src/terralib/kernel/TeBufferRegion.cpp
+++ b/src/terralib/kernel/TeBufferRegion.cpp
@@ -1,1073 +1,1073 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*
-   TODO: 1. tentar otimizar as rotinas auxilixares (elementares) de forma que o sentido do segmento nao seja importante
-            e que possamos garantir a orientacao da linha que iremos tracar ao redor de um segmento de reta (acabar dom didswap!)
-*/
-
-#include "TeBufferRegion.h"
-#include "TeOverlay.h"
-#include "TeGeometry.h" 
-#include "TeGeometryAlgorithms.h"
-
-#include <map>
-#include <algorithm>
-#include <cmath>
-
-using namespace std;
-
-namespace TeBUFFERREGION
-{
-
-//---------------- Auxiliary Constants ----------------//
-const double bufferPI       = 3.14159265358979323846;
-const double doubleBufferPI = 6.28318530717958647692;
-const double halfBufferPI   = 1.57079632679489661923;
-
-//---------------- Auxiliary Functions ----------------//
-
-/** Rotina auxiliar que define o angulo inicial utilizado para tracar o buffer ao redor de um segmento de reta (rotina de uso interno - nao deve ser utilizada diretamente).
-		\param first	primeiro ponto que define o segmento de reta: a rotina pode inverter seu conteudo com o parametro "last"
-		\param last		segundo ponto que define o segmento de reta: a rotina pode inverter seu conteudo com o parametro "first"
-		\param ang		angulo que define uma linha perpendicular ao segmento passando pela coordenada first
-		\param didswap	indica se as coordenadas first e last foram trocadas (se foi realizado o swap delas)
-		\note As coordenadas first e last devem ser necessariamente diferentes.
-  */
-inline void TeFindInitialAng(TeCoord2D& first, TeCoord2D& last, double& ang, bool& didswap)
-{
-	double xLength  = 0.0;
-	double val_ang  = 0.0;
-	
-	if(first.x_ > last.x_)
-	{
-	    swap(first, last);
-		didswap = true;
-	}
-	else if(first.x_ == last.x_)
-	{
-		if(first.y_ < last.y_)
-		{
-			swap(first, last);
-			didswap = true;
-		}
-	}
-
-// cumprimeto do segmento ao longo do eixo "x"
-	xLength = last.x_ - first.x_;
-
-// cumprimento do segmento 
-	double segmentLength = TeDistance(first, last);
-
-// inclinacao do segmento
-	val_ang = xLength / segmentLength;
-
-	if(val_ang > 1.0)	// erros de arredondamento podem definir um valor um "pouco" maior que 1, e nesse caso arredondamos para 1.
-	{
-		val_ang = 1.0;
-	}
-	else if(val_ang < -1.0)	// erros de arredondamento podem definir um valor um "pouco" menor que -1, e nesse caso arredondamos para 1.
-	{
-		val_ang = -1.0;
-	}
-	else if(fabs(val_ang) <= 0.000000000000001)	// erros de arredondamento podem definir um valor um "pouco" maior que zero, e nesse caso arredondamos para 0.
-	{
-		ang = 0.0;
-	}
-	else
-	{
-		if(first.y_ == last.y_)		// se o segmento for horizontal, o angulo inicial sera: (pi / 2)
-			ang = halfBufferPI;
-		else
-			if(first.y() > last.y())
-				ang = asin(val_ang);
-			else
-				ang = acos(val_ang) + halfBufferPI;
-	}
-
-	return;
-}
-
-/** Rotina auxiliar que traca um buffer elementar ao redor de um segmento, arredondando apenas um dos cantos do segmento: a linha do buffer tera orientacao horaria.
-		\param first	       primeiro ponto que define o segmento de reta.
-		\param last		       segundo ponto que define o segmento de reta.
-		\param bufferDistance  distancia utilizada para tracar o buffer.
-		\param numPoints       numero de pontos utilizado na definicao da semi-circunferencia ao redor dos vertices.
-		\param bufferLevels	   numero de niveis do buffer.
-		\param bufferPols	   linhas no sentido horario que definem a linha de buffer de cada nivel.
-  */
-inline void TeElementarBuffer(TeCoord2D first, TeCoord2D last, const double& bufferDistance,
-                              const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygon>& bufferPols)
-{
-	bufferPols.clear();
-
-	double ang = 0.0;		// angulo que define uma linha perpendicular ao primeiro vertice do segmento
-	bool didswap = false;	// indica se a rotina TeFindInitialAng fez o swap das coordenadas first e last
-
-	TeFindInitialAng(first, last, ang, didswap);
-
-	ang += bufferPI;	// como vamos tracar as linhas no sentido horario, vamos comecar 180 graus depois e entao vamos decrementando
-
-	double deltaAng = bufferPI / (numPoints - 1);	// angulo de cada setor que compoem o buffer
-	double c = 0.0; // variavel que contera o resultado do cosseno de um angulo
-	double s = 0.0;	// variavel que contera o resultado do seno de um angulo
-	double x = 0.0;	// variavel que contera a coordenada x transladada
-	double y = 0.0; // variavel que contera a coordenada y transladada
-
-// incializa a linha que delimitara cada nivel de buffer
-	vector<TeLine2D> bufferLines;
-
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-		TeLine2D newLine;
-		bufferLines.push_back(newLine);
-	}
-
-// verifica se o segmento foi ou nao invertido: isso eh importante para podermos manter a orientacao da linha de buffer
-// que estamos criando
-	if(didswap)
-	{
-// para cada extremo, calcula uma semi-circunferencia
-		for(unsigned int i = 1; i < numPoints; ++i)
-		{
-			c = cos(ang);
-			s = sin(ang);
-
-// repete o procedimento para cada nivel do buffer
-			for(unsigned int j = 0; j < bufferLevels; ++j)
-			{
-				x = first.x() + bufferDistance * (j + 1) * c ;
-				y = first.y() + bufferDistance * (j + 1) * s ;
-				bufferLines[j].add(TeCoord2D(x, y));
-			}
-	
-			ang -= deltaAng;
-		}
-
-// coloca o ultimo ponto do primeiro arco
-		c = cos(ang);
-		s = sin(ang);		
-
-		for(unsigned int j = 0; j < bufferLevels; ++j)
-		{
-// coloca o ultimo ponto do primeiro arco
-			x = first.x() + bufferDistance * (j + 1) * c; 
-			y = first.y() + bufferDistance * (j + 1) * s;
-			bufferLines[j].add(TeCoord2D(x, y));
-
-// coloca o primeiro ponto do segundo arco
-			x = last.x() + bufferDistance * (j + 1) * c ; 
-			y = last.y() + bufferDistance * (j + 1) * s;
-			bufferLines[j].add(TeCoord2D(x, y));
-		}
-
-// coloca o ultimo ponto do segundo arco
-		ang -= bufferPI;
-
-		c = cos(ang);
-		s = sin(ang);
-
-		for(unsigned int j = 0; j < bufferLevels; ++j)
-		{		
-			x = last.x() + bufferDistance * (j + 1) * c; 
-			y = last.y() + bufferDistance * (j + 1) * s;
-			bufferLines[j].add(TeCoord2D(x, y));
-
-// fecha a linha: que jah se encontra no sentido horario
-			bufferLines[j].add(bufferLines[j][0]);
-
-// cria o poligono correspondente e coloca no vetor de saida
-			TePolygon pol;
-			pol.add(TeLinearRing(bufferLines[j]));
-			bufferPols.push_back(pol);
-		}
-	}
-	else
-	{
-// coloca o primeiro ponto do primeiro arco
-		c = cos(ang);
-		s = sin(ang);
-
-		for(unsigned int j = 0; j < bufferLevels; ++j)
-		{		
-			x = first.x() + bufferDistance * (j + 1) * c; 
-			y = first.y() + bufferDistance * (j + 1) * s;
-			bufferLines[j].add(TeCoord2D(x, y));
-		}
-
-// coloca o ultimo ponto do primeiro arco
-		ang -= bufferPI;
-
-		c = cos(ang);
-		s = sin(ang);
-		
-		for(unsigned int j = 0; j < bufferLevels; ++j)
-		{		
-// coloca o ultimo ponto do primeiro arco
-			x = first.x() + bufferDistance * (j + 1) * c; 
-			y = first.y() + bufferDistance * (j + 1) * s;
-			bufferLines[j].add(TeCoord2D(x, y));
-
-// coloca o primeiro ponto do segundo arco
-			x = last.x() + bufferDistance * (j + 1) * c ; 
-			y = last.y() + bufferDistance * (j + 1) * s ;
-			bufferLines[j].add(TeCoord2D(x, y));
-		}
-
-// coloca os pontos do ultimo arco
-		for(unsigned int i = 1; i < numPoints; ++i)
-		{
-			ang -= deltaAng;
-
-			c = cos(ang);
-			s = sin(ang);
-
-			for(unsigned int j = 0; j < bufferLevels; ++j)
-			{		
-				x = last.x() + bufferDistance * (j + 1) * c ; 
-				y = last.y() + bufferDistance * (j + 1) * s ;
-				bufferLines[j].add(TeCoord2D(x, y));
-			}
-		}
-
-// fecha cada linha, que jah deve estar no sentido horario
-		for(unsigned int j = 0; j < bufferLevels; ++j)
-		{
-			bufferLines[j].add(bufferLines[j][0]);
-
-// cria o poligono correspondente e coloca no vetor de saida
-			TePolygon pol;
-			pol.add(TeLinearRing(bufferLines[j]));
-			bufferPols.push_back(pol);
-		}
-	}
-
-	return;
-}
-
-/** Rotina auxiliar que traca um buffer elementar ao redor de um segmento, arredondando os dois cantos do segmento: a linha do buffer tera orientacao horaria.
-		\param first	       primeiro ponto que define o segmento de reta.
-		\param last		       segundo ponto que define o segmento de reta.
-		\param bufferDistance  distancia utilizada para tracar o buffer.
-		\param numPoints       numero de pontos utilizado na definicao da semi-circunferencia ao redor dos vertices.
-		\param bufferLevels	   numero de niveis do buffer.
-		\param bufferPols	   linhas no sentido horario que definem a linha de buffer de cada nivel.
-  */
-inline void TeFullElementarBuffer(TeCoord2D first, TeCoord2D last, const double& bufferDistance,
-							      const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygon>& bufferPols)
-{
-	bufferPols.clear();
-
-	double ang = 0.0;		// angulo que define uma linha perpendicular ao primeiro vertice do segmento
-	bool didswap = false;	// indica se a rotina TeFindInitialAng fez o swap das coordenadas first e last
-
-	TeFindInitialAng(first, last, ang, didswap);
-
-	ang += bufferPI;	// como vamos tracar as linhas no sentido horario, vamos comecar 180 graus depois e entao vamos decrementando
-
-	double deltaAng = bufferPI / (numPoints - 1);	// angulo de cada setor que compoem o buffer
-	double c = 0.0; // variavel que contera o resultado do cosseno de um angulo
-	double s = 0.0;	// variavel que contera o resultado do seno de um angulo
-	double x = 0.0;	// variavel que contera a coordenada x transladada
-	double y = 0.0; // variavel que contera a coordenada y transladada
-
-// incializa a linha que delimitara cada nivel de buffer
-	vector<TeLine2D> bufferLines;
-
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-		TeLine2D newLine;
-		bufferLines.push_back(newLine);
-	}
-
-// para cada extremo, calcula uma semi-circunferencia
-	for(unsigned int i = 1; i < numPoints; ++i)
-	{
-		c = cos(ang);
-		s = sin(ang);
-
-		for(unsigned int j = 0; j < bufferLevels; ++j)
-		{		
-			x = first.x() + bufferDistance * (j + 1) * c; 
-			y = first.y() + bufferDistance * (j + 1) * s;
-			bufferLines[j].add(TeCoord2D(x, y));
-		}
-
-		ang -= deltaAng;
-	}
-
-	c = cos(ang);
-	s = sin(ang);
-
-	for(unsigned int j = 0; j < bufferLevels; ++j)
-	{	
-// coloca o ultimo ponto da primeira semi-circunferencia
-		x = first.x() + bufferDistance * (j + 1) * c; 
-		y = first.y() + bufferDistance * (j + 1) * s;
-		bufferLines[j].add(TeCoord2D(x, y));
-
-// coloca o primeiro ponto da segunda semi-circunferencia
-		x = last.x() + bufferDistance * (j + 1) * c; 
-		y = last.y() + bufferDistance * (j + 1) * s;
-		bufferLines[j].add(TeCoord2D(x, y));
-	}
-
-// coloca os demais pontos da segunda semi-circunferencia
-	for(unsigned int i = 1; i < numPoints; ++i)
-	{
-		ang -= deltaAng;
-
-		c = cos(ang);
-		s = sin(ang);
-
-		for(unsigned int j = 0; j < bufferLevels; ++j)
-		{		
-			x = last.x() + bufferDistance * (j + 1) * c; 
-			y = last.y() + bufferDistance * (j + 1) * s;
-			bufferLines[j].add(TeCoord2D(x, y));
-		}
-	}
-
-// fecha cada linha, que jah deve estar no sentido horario
-	for(unsigned int j = 0; j < bufferLevels; ++j)
-	{
-		bufferLines[j].add(bufferLines[j][0]);
-
-// cria o poligono correspondente e coloca no vetor de saida
-		TePolygon pol;
-		pol.add(TeLinearRing(bufferLines[j]));
-		bufferPols.push_back(pol);
-	}
-
-	return;
-}
-
-/** Rotina auxiliar que traca um buffer ao redor de uma linha, tracando varios niveis independentemente um do outro: para cada nivel de buffer, o anel externo do poligono estara no sentido horario e os buracos estarao no sentido anti-horario.
-		\param line	           linha para a qual os buffers serao tracados.
-		\param bufferDistance  distancia utilizada para tracar o buffer.
-		\param numPoints       numero de pontos utilizados para construcao dos semi-circulos de cada segmento.
-		\param bufferLevels    numero de niveis do buffer.
-		\param polVec          vetor de saida com os poligonos de buffer de cada nivel: nao aninhados, isto e, possivelmente estao sobrepostos, sendo o ratamento dado em outras rotinas de mais alto nivel (que utilizam esta como suporte).
-  */
-inline bool TeLineBuffer(const TeLine2D& line, const double& bufferDistance, const unsigned int& numPoints,
-						 const unsigned int& bufferLevels, vector<TePolygon>& polVec)
-{
-	polVec.clear();
-
-	unsigned int nStep = line.size();
-
-	if(nStep < 2)
-		return false;
-
-// vetor auxiliar que contera em cada posicao um polygonset
-// com todos os poligonos elementares de um determinado nivel de buffer
-	vector<TePolygonSet> psAux;
-
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-		TePolygonSet pset;
-		psAux.push_back(pset);
-	}
-
-// para linhas fechadas poderemos tracar somente buffer elementares com metade dos arcos
-// enquanto que para linhas abertas, o buffer do primeiro segmento sera feito com um buffer elementar completo (os dois semi-circulos serao tracados).
-// a seguir, computaremos os buffers elementares de cada nivel.
-	if(line.isRing())
-	{
-		for(unsigned int i = 1; i < nStep; ++i)
-		{
-// gera os poliginos elementares a partir dos segmentos definidos por cada par de vertice
-			vector<TePolygon> pols;
-			TeElementarBuffer(line[i - 1], line[i], bufferDistance, numPoints, bufferLevels, pols);
-
-			for(unsigned int j = 0; j < bufferLevels; ++j)
-				psAux[j].add(pols[j]);
-		}
-	}
-	else
-	{
-// para linhas abertas, o primeiro segmento tem um tratamento diferenciado enquanto os demais nao terao
-		vector<TePolygon> pols;
-		TeFullElementarBuffer(line[0], line[1], bufferDistance, numPoints, bufferLevels, pols);
-
-		for(unsigned int j = 0; j < bufferLevels; ++j)
-			psAux[j].add(pols[j]);
-
-		for(unsigned int i = 2; i < nStep; ++i)
-		{
-// gera os poliginos elementares a partir dos segmentos definidos por cada par de vertice
-			TeElementarBuffer(line[i - 1], line[i], bufferDistance, numPoints, bufferLevels, pols);
-
-			for(unsigned int j = 0; j < bufferLevels; ++j)
-				psAux[j].add(pols[j]);
-		}
-	}
-
-// agora, com os buffers elementares de cada nivel jah computados, vamos fazer
-// a uniao dos buffers elementares de cada nivel individualmente
-	for(unsigned int j = 0; j < bufferLevels; ++j)
-	{
-		TePolygonSet polSetOut;
-
-// caso a uniao falhe, interrompe a execucao sinalizando o problema!
-		if(TeOVERLAY::TePairUnion(psAux[j], polSetOut) == false)
-			return false;
-
-// teoricamente o buffer de cada nivel sera formado por um unico poligono com ou sem buracos.
-		if(polSetOut.size() != 1)
-			return false;
-
-		polVec.push_back(polSetOut[0]);
-	}
-
-	return true;
-}
-
-/** Rotina auxiliar que traca um buffer interno (negativo) no interior de um poligono, tracando varios niveis independentemente um do outro: para cada nivel de buffer, o anel externo do poligono estara no sentido horario e os buracos estarao no sentido anti-horario.
-		\param pol	           poligono para a qual os buffers serao tracados.
-		\param bufferDistance  distancia utilizada para tracar o buffer.
-		\param numPoints       numero de pontos utilizados para construcao dos semi-circulos de cada segmento.
-		\param bufferLevels    numero de niveis do buffer.
-		\param polsVec         vetor de saida com os poligonos de buffer de cada nivel: jah aninhados, isto e, os poligonos do nivel "n" jah consideram os do nivel "n-1".
-  */
-inline bool TeInsideBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polsVec)
-{
-	polsVec.clear();	
-
-	unsigned int nRings = pol.size();
-
-	//vetor de polygonset, onde cada poligonset est� associado a um nivel
-	//cada nivel contem os buffers internos do pai
-	vector<TePolygonSet> internalBuffers;
-	
-	//vetor de polygonset, onde cada poligonset est� associado a um nivel
-	//cada nivel contem os buffers externos dos buracos
-	vector<TePolygonSet> externalBuffers;
-
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-		TePolygonSet pset;
-		polsVec.push_back(pset);
-		TePolygonSet pset2;
-		internalBuffers.push_back(pset2);
-		TePolygonSet pset3;
-		externalBuffers.push_back(pset3);
-	}
-
-	// para cada anel vamos tracar o buffer e armazenar somente a parte de interesse: 
-	// no caso de aneis externos vamos
-	// ficar com o buffer interno e no caso de buracos vamos ficar com os buffer externos
-	for(unsigned int i = 0; i < nRings; ++i)
-	{
-		vector<TePolygon> buffVec;
-		
-		if(TeLineBuffer(pol[i], bufferDistance, numPoints, bufferLevels, buffVec) == false)
-			return false;
-
-		if(i == 0)
-		{
-// para o anel externo ficamos com os aneis internos do buffer
-			for(unsigned int j = 0; j < bufferLevels; ++j)
-			{
-				unsigned int rsize = buffVec[j].size();
-				for(unsigned int k = 1; k < rsize; ++k)
-				{
-					TePolygon paux; paux.add(buffVec[j][k]); //comeca em 1 ate k
-					internalBuffers[j].add(paux);
-				}
-			}
-		}
-		else
-		{
-// para um anel interno ficamos com os aneis externos do buffer
-			for(unsigned int j = 0; j < bufferLevels; ++j)
-			{
-				TePolygon paux; paux.add(buffVec[j][0]); 
-				externalBuffers[j].add(paux);
-			}
-		}
-	}
-	//para cada nivel, calcular o buraco do resultado que ser�
-	//a diferenca entre os buffers internos e 
-	//a uniao dos buffers externos 
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-		TePolygonSet holes;
-
-		if(externalBuffers[i].size()>0)
-		{
-			TePolygonSet externalBuffersUnion;
-			//uniao dos buffers externos
-			if(TeOVERLAY::TePairUnion(externalBuffers[i], externalBuffersUnion) == false)
-				return false;
-
-			// o buffer interno ao pai pode nao existir se a distancia for muito grande  
-			if(internalBuffers[i].size()>0)
-			{
-				//diferenca
-				if(TeOVERLAY::TeDifference(internalBuffers[i], externalBuffersUnion, holes) == false)
-					return false;
-			}
-
-			//se o resultado da diferenca der vazio, significa que os buffers internos entao
-			//contidos nos buffer externos
-			//assim temos que adicionar como buracos, os buracos originais
-			if(holes.size()==0)
-			{
-				TePolygon h;
-				for(unsigned j=1; j<pol.size(); ++j) // buracos originais 
-				{
-					h.add(pol[j]); 
-					holes.add(h);
-				}
-			}
-		}
-		else
-		{
-			//o unico buraco e o internal buffer do pai
-			holes = internalBuffers[i];
-		}
-		
-		//montar o buffer final
-		TePolygon result;
-		result.add(pol[0]); // pai do original
-		for(unsigned j=0; j<holes.size(); ++j) // buracos calculados
-            result.add(holes[j][0]);
-		
-		polsVec[i].add(result);
-	}
-
-	return true;
-}
-
-/** Rotina auxiliar que traca um buffer externo (positivo) ao redor de um poligono, tracando varios niveis independentemente um do outro: para cada nivel de buffer, o anel externo do poligono estara no sentido horario e os buracos estarao no sentido anti-horario.
-		\param pol	           poligono para a qual os buffers serao tracados.
-		\param bufferDistance  distancia utilizada para tracar o buffer.
-		\param numPoints       numero de pontos utilizados para construcao dos semi-circulos de cada segmento.
-		\param bufferLevels    numero de niveis do buffer.
-		\param polsVec         vetor de saida com os poligonos de buffer de cada nivel: jah aninhados, isto e, os poligonos do nivel "n" jah consideram os do nivel "n-1".
-  */
-inline bool TeOutsideBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polsVec)
-{
-	polsVec.clear();	
-
-	unsigned int nRings = pol.size();
-
-// jah coloca um objeto polygonset correspondente a cada nivel
-	vector<TePolygonSet> outPutPolsVec;
-
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-		TePolygonSet pset;
-		outPutPolsVec.push_back(pset);
-		TePolygonSet pset2;
-		polsVec.push_back(pset2);
-	}
-
-// para cada anel vamos tracar o buffer e armazenar somente a parte de interesse: no caso de aneis externos vamos
-// ficar com o buffer externo e no caso de buracos vamos ficar com os buffer internos
-	for(unsigned int i = 0; i < nRings; ++i)
-	{
-		vector<TePolygon> buffVec;
-		
-		if(TeLineBuffer(pol[i], bufferDistance, numPoints, bufferLevels, buffVec) == false)
-			return false;
-
-		if(i == 0)
-		{
-// para o anel externo ficamos com o anel externo do buffer
-			for(unsigned int j = 0; j < bufferLevels; ++j)
-			{
-				TePolygon paux; paux.add(buffVec[j][0]);
-				outPutPolsVec[j].add(paux);
-			}
-		}
-		else
-		{
-// para um anel interno ficamos com os aneis internos do buffer
-			for(unsigned int j = 0; j < bufferLevels; ++j)
-			{
-				unsigned int rsize = buffVec[j].size();
-
-				for(unsigned int k = 1; k < rsize; ++k)
-				{
-					TePolygon paux; paux.add(buffVec[j][k]);
-					outPutPolsVec[j].add(paux);
-				}
-			}
-		}
-	}
-
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-// no caso de buffers positivos (para fora) pelo menos o buffer do anel externo devera aparecer em cada nivel
-		if(outPutPolsVec[i].size() == 0)
-			return false;
-
-		TePolygonSet psetOut = outPutPolsVec[i];
-
-// LOGICA PARA O ANEL EXTERNO
-		if(i == 0)
-		{
-// o primeiro buffer pegara como buraco o anel externo original
-			psetOut[0].add(pol[0]);	
-			polsVec[i].add(psetOut[0]);
-		}
-		else
-		{
-			TeLine2D laux;
-			laux.copyElements(outPutPolsVec[i - 1][0][0]);
-			psetOut[0].add(TeLinearRing(laux));
-			polsVec[i].add(psetOut[0]);
-		}
-
-// se nao temos buracos no corrente, entao nao precisamos nos preocupar com diferencas e etc...
-		if(psetOut.size() == 1)
-			continue;
-
-		
-// LOGICA PARA OS ANEIS INTERNOS
-		if(i == 0)
-		{			
-// vamos montar um polygonset com os buracos do poligono original
-			TePolygonSet psetOriginalInnerRings;
-
-			for(unsigned int j = 1; j < nRings; ++j)
-			{
-				TePolygon paux; paux.add(pol[j]);
-				psetOriginalInnerRings.add(paux);
-			}
-
-// agora vamos montar um polygonset com os buracos (que jah estao como poligonos) do primeiro nivel
-			TePolygonSet currentPset;
-
-			for(unsigned int j = 1; j < psetOut.size(); ++j)
-			{
-				currentPset.add(psetOut[j]);
-			}
-
-// agora fazemos a diferena dos originais com o do primeiro nivel
-			TePolygonSet resultPset;
-
-			if(TeOVERLAY::TeDifference(psetOriginalInnerRings, currentPset, resultPset) == false)
-				return false;
-
-			for(unsigned int j = 0; j < resultPset.size(); ++j)
-			{
-				polsVec[i].add(resultPset[j]);
-			}
-		}
-		else
-		{
-// vamos montar um polygonset com os buracos do "n-1" e um com o corrente ("n")
-			TePolygonSet previousPset;
-
-			for(unsigned int j = 1; j < outPutPolsVec[i - 1].size(); ++j)
-			{
-				previousPset.add(outPutPolsVec[i - 1][j]);
-			}
-
-			TePolygonSet currentPset;
-
-			for(unsigned int j = 1; j < psetOut.size(); ++j)
-			{
-				currentPset.add(psetOut[j]);
-			}
-
-// agora fazemos a diferena do nivel anterior com o do nivel corrente
-			TePolygonSet resultPset;
-
-			if(TeOVERLAY::TeDifference(previousPset, currentPset, resultPset) == false)
-				return false;
-
-			for(unsigned int j = 0; j < resultPset.size(); ++j)
-			{
-				polsVec[i].add(resultPset[j]);
-			}
-		}
-	}
-
-	return true;
-}
-
-inline bool TeInOutBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polsVec)
-{
-	polsVec.clear();	
-
-	unsigned int nRings = pol.size();
-
-	//vetor de polygonset, onde cada polygonset est� associado a um nivel
-	//cada nivel contem os buffers internos e externos  
-	// de cada anel do poligono
-	vector<TePolygonSet> polVecBuffers;
-	
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-		TePolygonSet pset;
-		polsVec.push_back(pset);
-		TePolygonSet pset2;
-		polVecBuffers.push_back(pset2);
-	}
-
-	// para cada anel vamos tracar o buffer e armazenar o poligono gerado (com aneis externo e internos)
-	for(unsigned int i = 0; i < nRings; ++i)
-	{
-		vector<TePolygon> buffVec;
-		
-		if(TeLineBuffer(pol[i], bufferDistance, numPoints, bufferLevels, buffVec) == false)
-			return false;
-
-		//adicona o buffer gerado em cada polygonset
-		for(unsigned int j=0; j<buffVec.size(); ++j)
-			polVecBuffers[j].add(buffVec[j]);
-
-	}
-
-
-    //para cada nivel, fazer a uniao de todos os buffers gerados
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-		//uniao dos buffers 
-		if(TeOVERLAY::TePairUnion(polVecBuffers[i], polsVec[i]) == false)
-			return false;
-	}
-
-	return true;
-}
-
-}	// end namespace TeBUFFERREGION
-
-//---------------- Buffer Algorithm ----------------//
-
-bool TeBUFFERREGION::TeBufferRegion(const TeCoord2D& coord, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygon>& bufferPols)
-{
-// limpa o vetor de poligonos de saida
-	bufferPols.clear();
-
-// cria um vetor de linhas que contera a linha de buffer a cada nivel
-	vector<TeLine2D> contourLines;
-
-// cria a linha de cada nivel e jah acrescenta a coordenada inicial do canto esquerdo
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-// linha de buffer do i-th nivel
-		TeLine2D newLine;
-		newLine.add(TeCoord2D((coord.x() - (bufferDistance * (i + 1))), (coord.y())));
-
-		contourLines.push_back(newLine);
-	}
-
-	double initialAng = bufferPI;							// angulo inicial
-	const double deltaAng = doubleBufferPI / numPoints;		// angulo de cada setor que compoem o buffer
-
-	double x = 0.0;	// variavel que contera a coordenada x transladada
-	double y = 0.0;	// variavel que contera a coordenada y transladada
-	double c = 0.0;	// variavel que contera o resultado do cosseno de um angulo
-	double s = 0.0;	// variavel que contera o resultado do seno de um angulo
-
-
-// calcula as coordenadas que formarao a linha de buffer de cada nivel
-	for(unsigned int i = 1; i < numPoints; ++i)
-	{
-		initialAng -= deltaAng;
-		
-		c = cos(initialAng);
-		s = sin(initialAng);
-
-// gera o ponto equivalente para cada nivel de buffer
-		for(unsigned int k = 0; k < bufferLevels; ++k)
-		{		
-			x = coord.x_ + bufferDistance * (k + 1) * c; 
-			y = coord.y_ + bufferDistance * (k + 1) * s;
-
-			contourLines[k].add(TeCoord2D(x, y));
-		}
-	}
-
-// fecha cada uma das linhas de buffer,
-// repetindo o primeiro ponto e cria os poligonos de buffer de cada nivel formado pela respectiva
-// linha de buffer
-	for(unsigned int i = 0; i < bufferLevels; ++i)
-	{
-		contourLines[i].add(contourLines[i][0]);		
-
-		TePolygon pol;
-		pol.add(TeLinearRing(contourLines[i]));
-		bufferPols.push_back(pol);
-	}
-
-// coloca o anel externo do nivel "n-1" como anel interno do nivel "n"
-	for(unsigned int i = 1; i < bufferLevels; ++i)
-	{
-// clona a linha externa do nivel "n-1"
-		TeLine2D laux;
-		laux.copyElements(bufferPols[i - 1][0]);
-
-// deixa no sentido anti-horario a linha que servira de buraco para o buffer do nivel "n"
-		reverse(laux.begin(), laux.end());
-
-// e, finalmente, coloca a linha do nivel "n-1" como buraco do nivel "n"
-		bufferPols[i].add(TeLinearRing(laux));
-	}
-
-	return true;
-}
-
-bool TeBUFFERREGION::TeBufferRegion(const TeCoord2D& coord, const double& bufferDistance, const unsigned int& numPoints, TePolygon& pol)
-{
-	pol.clear();
-
-// define um vetor temporario para chamar a rotina acima, que realmente implementa o buffer de um ponto
-	vector<TePolygon> bufferPols;
-
-// solicita o buffer de um unico nivel ao redor do ponto
-	TeBufferRegion(coord, bufferDistance, numPoints, 1, bufferPols);
-
-	if(bufferPols.empty())
-		return false;
-
-	pol = bufferPols[0];
-
-	return true;
-}
-
-bool TeBUFFERREGION::TeBufferRegion(const TeLine2D& line, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polVec)
-{
-	polVec.clear();
-
-	for(unsigned int level=0; level<bufferLevels; ++level)
-	{
-		TePolygonSet aux;
-		polVec.push_back(aux);
-	}
-
-// para tracar o semi-circulo ao redor do canto do segmento precisamos de pelo menos tres pontos
-	unsigned int cornerPts = numPoints;
-
-	if(numPoints < 3)
-		cornerPts = 3;
-
-// traca os buffers de cada nivel ao redor da linha: cada posicao do vetor "outPutPolVec" contera o poligono de cada nivel
-	vector<TePolygon> outPutPolVec;
-
-	if(TeLineBuffer(line, bufferDistance, cornerPts, bufferLevels, outPutPolVec) == false)
-		return false;
-
-// se o numero de poligonos da saida for diferente do numero de niveis desejado, algum erro ocorreu
-	if(outPutPolVec.size() != bufferLevels)
-		return false;
-
-// para cada nivel de buffer precisamos acomodar os aneis do nivel anterior:
-// no caso do buffer de linhas, o buffer do nivel "n" eh exatamente a diferenca do resultado que temos ate aqui menos o resultado
-// do buffer do nivel "n-1"
-	polVec[0].add(outPutPolVec[0]);
-
-	for(unsigned int i = 1; i < bufferLevels; ++i)
-	{
-		TePolygonSet currentPSet;  currentPSet.add(outPutPolVec[i]);
-		TePolygonSet previousPSet; previousPSet.add(outPutPolVec[i - 1]);
-
-		TePolygonSet polSetOut;
-
-		if(TeOVERLAY::TeDifference(currentPSet, previousPSet, polSetOut) == false)
-			return false;
-
-// esperamos que o resultado da diferenca seja sempre um poligono (com zero ou mais buracos)
-		//if(polSetOut.size() != 1)
-		//	return false;
-		//polVec.push_back(polSetOut[0]);
-
-		for(unsigned int j=0; j<polSetOut.size(); ++j)
-			polVec[i].add(polSetOut[j]);
-	}
-
-	return true;	
-}
-
-bool TeBUFFERREGION::TeBufferRegion(const TeLine2D& line, const double& bufferDistance, const unsigned int& numPoints, TePolygonSet& ps)
-{
-	ps.clear();
-
-	vector<TePolygonSet> polVec;
-
-	if(TeBufferRegion(line, bufferDistance, numPoints, 1, polVec) == false)
-		return false;
-
-	ps.copyElements(polVec[0]);
-	
-	return true;
-}
-
-bool TeBUFFERREGION::TeBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& buffType, vector<TePolygonSet>& polsVec)
-{
-	if(buffType == TeINSIDEBUFFER)
-	{
-		return TeInsideBufferRegion(pol, bufferDistance, numPoints, bufferLevels, polsVec);
-	}
-	else if(buffType == TeOUTSIDEBUFFER)
-	{
-		return TeOutsideBufferRegion(pol, bufferDistance, numPoints, bufferLevels, polsVec);
-	}
-	else
-	{
-		return TeInOutBufferRegion(pol, bufferDistance, numPoints, bufferLevels, polsVec);
-	}	
-}
-
-bool TeBUFFERREGION::TeBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, TePolygonSet& ps)
-{
-	ps.clear();
-
-	vector<TePolygonSet> pols;
-	
-	if(!TeBufferRegion(pol, bufferDistance, numPoints, 1, TeOUTSIDEBUFFER, pols))
-		return false;
-
-	ps = pols[0];
-
-	return true;
-}
-
-bool TeBUFFERREGION::TeBufferRegion(const TePolygonSet& polSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& bufferType, vector<TePolygonSet>& polyVecOut)
-{
-	polyVecOut.clear();
-	
-	for(unsigned int j=0; j<polSetIn.size(); ++j)
-	{
-		vector<TePolygonSet> auxPolVec;
-		if(!TeBUFFERREGION::TeBufferRegion(polSetIn[j], bufferDistance, numPoints, bufferLevels, bufferType, auxPolVec))
-			return false;
-
-		if(j==0)
-		{
-			for(unsigned int i=0; i<auxPolVec.size(); ++i)
-				polyVecOut.push_back(auxPolVec[i]);
-		}
-		else
-		{
-			for(unsigned int i=0; i<auxPolVec.size(); ++i)
-			{
-				TePolygonSet polUnion;
-				if(!TeOVERLAY::TeUnion(polyVecOut[i], auxPolVec[i], polUnion))
-					return false;
-				polyVecOut[i]=polUnion;
-			}
-		}
-	}
-	return true;
-}
-
-
-bool TeBUFFERREGION::TeBufferRegion(const TeLineSet& lineSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polyVecOut)
-{
-	polyVecOut.clear();
-
-    for(unsigned int j=0; j<lineSetIn.size(); ++j)
-	{
-		vector<TePolygonSet> currentPolVec;
-		if(!TeBUFFERREGION::TeBufferRegion(lineSetIn[j], bufferDistance, numPoints, bufferLevels, currentPolVec))
-			return false;
-
-		if(j==0)
-		{
-			for(unsigned int i=0; i<currentPolVec.size(); ++i)
-				polyVecOut.push_back(currentPolVec[i]);
-		}
-		else
-		{
-			for(unsigned int i=0; i<currentPolVec.size(); ++i)
-			{
-				TePolygonSet polUnion;
-				if(!TeOVERLAY::TeUnion(polyVecOut[i], currentPolVec[i], polUnion))
-					return false;
-				polyVecOut[i]=polUnion;
-			}
-		}
-	}
-	return true;
-}
-
-
-bool TeBUFFERREGION::TeBufferRegion(const TePointSet& pointSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polyVecOut)
-{
-	polyVecOut.clear();
-	
-	for(unsigned int j=0; j<pointSetIn.size(); ++j)
-	{
-		vector<TePolygon> currentPolVec;
-		if(!TeBUFFERREGION::TeBufferRegion(pointSetIn[j].location(), bufferDistance, numPoints, bufferLevels, currentPolVec))
-			return false;
-
-		if(j==0)
-		{
-			for(unsigned int i=0; i<currentPolVec.size(); ++i)
-			{
-				TePolygonSet currentPolSet; currentPolSet.add(currentPolVec[i]);
-				polyVecOut.push_back(currentPolSet);
-			}
-		}
-		else
-		{
-			for(unsigned int i=0; i<currentPolVec.size(); ++i)
-			{
-				TePolygonSet polUnion, currentPolSet;
-				currentPolSet.add(currentPolVec[i]);
-				if(!TeOVERLAY::TeUnion(polyVecOut[i], currentPolSet, polUnion))
-					return false;
-				polyVecOut[i]=polUnion;
-			}
-		}
-	}
-	return true;
-}
-
-	
-bool  TeBUFFERREGION::TeBufferRegion(const TeCellSet& cellSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& bufferType, vector<TePolygonSet>& polyVecOut)
-{
-	polyVecOut.clear();
-	
-	for(unsigned int j=0; j<cellSetIn.size(); ++j)
-	{
-		vector<TePolygonSet> auxPolVec;
-		if(!TeBUFFERREGION::TeBufferRegion(TeMakePolygon(cellSetIn[j].box()), bufferDistance, numPoints, bufferLevels, bufferType, auxPolVec))
-			return false;
-
-		if(j==0)
-		{
-			for(unsigned int i=0; i<auxPolVec.size(); ++i)
-				polyVecOut.push_back(auxPolVec[i]);
-		}
-		else
-		{
-			for(unsigned int i=0; i<auxPolVec.size(); ++i)
-			{
-				TePolygonSet polUnion;
-				if(!TeOVERLAY::TeUnion(polyVecOut[i], auxPolVec[i], polUnion))
-					return false;
-				polyVecOut[i]=polUnion;
-			}
-		}
-	}
-	return true;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*
+   TODO: 1. tentar otimizar as rotinas auxilixares (elementares) de forma que o sentido do segmento nao seja importante
+            e que possamos garantir a orientacao da linha que iremos tracar ao redor de um segmento de reta (acabar dom didswap!)
+*/
+
+#include "TeBufferRegion.h"
+#include "TeOverlay.h"
+#include "TeGeometry.h" 
+#include "TeGeometryAlgorithms.h"
+
+#include <map>
+#include <algorithm>
+#include <cmath>
+
+using namespace std;
+
+namespace TeBUFFERREGION
+{
+
+//---------------- Auxiliary Constants ----------------//
+const double bufferPI       = 3.14159265358979323846;
+const double doubleBufferPI = 6.28318530717958647692;
+const double halfBufferPI   = 1.57079632679489661923;
+
+//---------------- Auxiliary Functions ----------------//
+
+/** Rotina auxiliar que define o angulo inicial utilizado para tracar o buffer ao redor de um segmento de reta (rotina de uso interno - nao deve ser utilizada diretamente).
+		\param first	primeiro ponto que define o segmento de reta: a rotina pode inverter seu conteudo com o parametro "last"
+		\param last		segundo ponto que define o segmento de reta: a rotina pode inverter seu conteudo com o parametro "first"
+		\param ang		angulo que define uma linha perpendicular ao segmento passando pela coordenada first
+		\param didswap	indica se as coordenadas first e last foram trocadas (se foi realizado o swap delas)
+		\note As coordenadas first e last devem ser necessariamente diferentes.
+  */
+inline void TeFindInitialAng(TeCoord2D& first, TeCoord2D& last, double& ang, bool& didswap)
+{
+	double xLength  = 0.0;
+	double val_ang  = 0.0;
+	
+	if(first.x_ > last.x_)
+	{
+	    swap(first, last);
+		didswap = true;
+	}
+	else if(first.x_ == last.x_)
+	{
+		if(first.y_ < last.y_)
+		{
+			swap(first, last);
+			didswap = true;
+		}
+	}
+
+// cumprimeto do segmento ao longo do eixo "x"
+	xLength = last.x_ - first.x_;
+
+// cumprimento do segmento 
+	double segmentLength = TeDistance(first, last);
+
+// inclinacao do segmento
+	val_ang = xLength / segmentLength;
+
+	if(val_ang > 1.0)	// erros de arredondamento podem definir um valor um "pouco" maior que 1, e nesse caso arredondamos para 1.
+	{
+		val_ang = 1.0;
+	}
+	else if(val_ang < -1.0)	// erros de arredondamento podem definir um valor um "pouco" menor que -1, e nesse caso arredondamos para 1.
+	{
+		val_ang = -1.0;
+	}
+	else if(fabs(val_ang) <= 0.000000000000001)	// erros de arredondamento podem definir um valor um "pouco" maior que zero, e nesse caso arredondamos para 0.
+	{
+		ang = 0.0;
+	}
+	else
+	{
+		if(first.y_ == last.y_)		// se o segmento for horizontal, o angulo inicial sera: (pi / 2)
+			ang = halfBufferPI;
+		else
+			if(first.y() > last.y())
+				ang = asin(val_ang);
+			else
+				ang = acos(val_ang) + halfBufferPI;
+	}
+
+	return;
+}
+
+/** Rotina auxiliar que traca um buffer elementar ao redor de um segmento, arredondando apenas um dos cantos do segmento: a linha do buffer tera orientacao horaria.
+		\param first	       primeiro ponto que define o segmento de reta.
+		\param last		       segundo ponto que define o segmento de reta.
+		\param bufferDistance  distancia utilizada para tracar o buffer.
+		\param numPoints       numero de pontos utilizado na definicao da semi-circunferencia ao redor dos vertices.
+		\param bufferLevels	   numero de niveis do buffer.
+		\param bufferPols	   linhas no sentido horario que definem a linha de buffer de cada nivel.
+  */
+inline void TeElementarBuffer(TeCoord2D first, TeCoord2D last, const double& bufferDistance,
+                              const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygon>& bufferPols)
+{
+	bufferPols.clear();
+
+	double ang = 0.0;		// angulo que define uma linha perpendicular ao primeiro vertice do segmento
+	bool didswap = false;	// indica se a rotina TeFindInitialAng fez o swap das coordenadas first e last
+
+	TeFindInitialAng(first, last, ang, didswap);
+
+	ang += bufferPI;	// como vamos tracar as linhas no sentido horario, vamos comecar 180 graus depois e entao vamos decrementando
+
+	double deltaAng = bufferPI / (numPoints - 1);	// angulo de cada setor que compoem o buffer
+	double c = 0.0; // variavel que contera o resultado do cosseno de um angulo
+	double s = 0.0;	// variavel que contera o resultado do seno de um angulo
+	double x = 0.0;	// variavel que contera a coordenada x transladada
+	double y = 0.0; // variavel que contera a coordenada y transladada
+
+// incializa a linha que delimitara cada nivel de buffer
+	vector<TeLine2D> bufferLines;
+
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+		TeLine2D newLine;
+		bufferLines.push_back(newLine);
+	}
+
+// verifica se o segmento foi ou nao invertido: isso eh importante para podermos manter a orientacao da linha de buffer
+// que estamos criando
+	if(didswap)
+	{
+// para cada extremo, calcula uma semi-circunferencia
+		for(unsigned int i = 1; i < numPoints; ++i)
+		{
+			c = cos(ang);
+			s = sin(ang);
+
+// repete o procedimento para cada nivel do buffer
+			for(unsigned int j = 0; j < bufferLevels; ++j)
+			{
+				x = first.x() + bufferDistance * (j + 1) * c ;
+				y = first.y() + bufferDistance * (j + 1) * s ;
+				bufferLines[j].add(TeCoord2D(x, y));
+			}
+	
+			ang -= deltaAng;
+		}
+
+// coloca o ultimo ponto do primeiro arco
+		c = cos(ang);
+		s = sin(ang);		
+
+		for(unsigned int j = 0; j < bufferLevels; ++j)
+		{
+// coloca o ultimo ponto do primeiro arco
+			x = first.x() + bufferDistance * (j + 1) * c; 
+			y = first.y() + bufferDistance * (j + 1) * s;
+			bufferLines[j].add(TeCoord2D(x, y));
+
+// coloca o primeiro ponto do segundo arco
+			x = last.x() + bufferDistance * (j + 1) * c ; 
+			y = last.y() + bufferDistance * (j + 1) * s;
+			bufferLines[j].add(TeCoord2D(x, y));
+		}
+
+// coloca o ultimo ponto do segundo arco
+		ang -= bufferPI;
+
+		c = cos(ang);
+		s = sin(ang);
+
+		for(unsigned int j = 0; j < bufferLevels; ++j)
+		{		
+			x = last.x() + bufferDistance * (j + 1) * c; 
+			y = last.y() + bufferDistance * (j + 1) * s;
+			bufferLines[j].add(TeCoord2D(x, y));
+
+// fecha a linha: que jah se encontra no sentido horario
+			bufferLines[j].add(bufferLines[j][0]);
+
+// cria o poligono correspondente e coloca no vetor de saida
+			TePolygon pol;
+			pol.add(TeLinearRing(bufferLines[j]));
+			bufferPols.push_back(pol);
+		}
+	}
+	else
+	{
+// coloca o primeiro ponto do primeiro arco
+		c = cos(ang);
+		s = sin(ang);
+
+		for(unsigned int j = 0; j < bufferLevels; ++j)
+		{		
+			x = first.x() + bufferDistance * (j + 1) * c; 
+			y = first.y() + bufferDistance * (j + 1) * s;
+			bufferLines[j].add(TeCoord2D(x, y));
+		}
+
+// coloca o ultimo ponto do primeiro arco
+		ang -= bufferPI;
+
+		c = cos(ang);
+		s = sin(ang);
+		
+		for(unsigned int j = 0; j < bufferLevels; ++j)
+		{		
+// coloca o ultimo ponto do primeiro arco
+			x = first.x() + bufferDistance * (j + 1) * c; 
+			y = first.y() + bufferDistance * (j + 1) * s;
+			bufferLines[j].add(TeCoord2D(x, y));
+
+// coloca o primeiro ponto do segundo arco
+			x = last.x() + bufferDistance * (j + 1) * c ; 
+			y = last.y() + bufferDistance * (j + 1) * s ;
+			bufferLines[j].add(TeCoord2D(x, y));
+		}
+
+// coloca os pontos do ultimo arco
+		for(unsigned int i = 1; i < numPoints; ++i)
+		{
+			ang -= deltaAng;
+
+			c = cos(ang);
+			s = sin(ang);
+
+			for(unsigned int j = 0; j < bufferLevels; ++j)
+			{		
+				x = last.x() + bufferDistance * (j + 1) * c ; 
+				y = last.y() + bufferDistance * (j + 1) * s ;
+				bufferLines[j].add(TeCoord2D(x, y));
+			}
+		}
+
+// fecha cada linha, que jah deve estar no sentido horario
+		for(unsigned int j = 0; j < bufferLevels; ++j)
+		{
+			bufferLines[j].add(bufferLines[j][0]);
+
+// cria o poligono correspondente e coloca no vetor de saida
+			TePolygon pol;
+			pol.add(TeLinearRing(bufferLines[j]));
+			bufferPols.push_back(pol);
+		}
+	}
+
+	return;
+}
+
+/** Rotina auxiliar que traca um buffer elementar ao redor de um segmento, arredondando os dois cantos do segmento: a linha do buffer tera orientacao horaria.
+		\param first	       primeiro ponto que define o segmento de reta.
+		\param last		       segundo ponto que define o segmento de reta.
+		\param bufferDistance  distancia utilizada para tracar o buffer.
+		\param numPoints       numero de pontos utilizado na definicao da semi-circunferencia ao redor dos vertices.
+		\param bufferLevels	   numero de niveis do buffer.
+		\param bufferPols	   linhas no sentido horario que definem a linha de buffer de cada nivel.
+  */
+inline void TeFullElementarBuffer(TeCoord2D first, TeCoord2D last, const double& bufferDistance,
+							      const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygon>& bufferPols)
+{
+	bufferPols.clear();
+
+	double ang = 0.0;		// angulo que define uma linha perpendicular ao primeiro vertice do segmento
+	bool didswap = false;	// indica se a rotina TeFindInitialAng fez o swap das coordenadas first e last
+
+	TeFindInitialAng(first, last, ang, didswap);
+
+	ang += bufferPI;	// como vamos tracar as linhas no sentido horario, vamos comecar 180 graus depois e entao vamos decrementando
+
+	double deltaAng = bufferPI / (numPoints - 1);	// angulo de cada setor que compoem o buffer
+	double c = 0.0; // variavel que contera o resultado do cosseno de um angulo
+	double s = 0.0;	// variavel que contera o resultado do seno de um angulo
+	double x = 0.0;	// variavel que contera a coordenada x transladada
+	double y = 0.0; // variavel que contera a coordenada y transladada
+
+// incializa a linha que delimitara cada nivel de buffer
+	vector<TeLine2D> bufferLines;
+
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+		TeLine2D newLine;
+		bufferLines.push_back(newLine);
+	}
+
+// para cada extremo, calcula uma semi-circunferencia
+	for(unsigned int i = 1; i < numPoints; ++i)
+	{
+		c = cos(ang);
+		s = sin(ang);
+
+		for(unsigned int j = 0; j < bufferLevels; ++j)
+		{		
+			x = first.x() + bufferDistance * (j + 1) * c; 
+			y = first.y() + bufferDistance * (j + 1) * s;
+			bufferLines[j].add(TeCoord2D(x, y));
+		}
+
+		ang -= deltaAng;
+	}
+
+	c = cos(ang);
+	s = sin(ang);
+
+	for(unsigned int j = 0; j < bufferLevels; ++j)
+	{	
+// coloca o ultimo ponto da primeira semi-circunferencia
+		x = first.x() + bufferDistance * (j + 1) * c; 
+		y = first.y() + bufferDistance * (j + 1) * s;
+		bufferLines[j].add(TeCoord2D(x, y));
+
+// coloca o primeiro ponto da segunda semi-circunferencia
+		x = last.x() + bufferDistance * (j + 1) * c; 
+		y = last.y() + bufferDistance * (j + 1) * s;
+		bufferLines[j].add(TeCoord2D(x, y));
+	}
+
+// coloca os demais pontos da segunda semi-circunferencia
+	for(unsigned int i = 1; i < numPoints; ++i)
+	{
+		ang -= deltaAng;
+
+		c = cos(ang);
+		s = sin(ang);
+
+		for(unsigned int j = 0; j < bufferLevels; ++j)
+		{		
+			x = last.x() + bufferDistance * (j + 1) * c; 
+			y = last.y() + bufferDistance * (j + 1) * s;
+			bufferLines[j].add(TeCoord2D(x, y));
+		}
+	}
+
+// fecha cada linha, que jah deve estar no sentido horario
+	for(unsigned int j = 0; j < bufferLevels; ++j)
+	{
+		bufferLines[j].add(bufferLines[j][0]);
+
+// cria o poligono correspondente e coloca no vetor de saida
+		TePolygon pol;
+		pol.add(TeLinearRing(bufferLines[j]));
+		bufferPols.push_back(pol);
+	}
+
+	return;
+}
+
+/** Rotina auxiliar que traca um buffer ao redor de uma linha, tracando varios niveis independentemente um do outro: para cada nivel de buffer, o anel externo do poligono estara no sentido horario e os buracos estarao no sentido anti-horario.
+		\param line	           linha para a qual os buffers serao tracados.
+		\param bufferDistance  distancia utilizada para tracar o buffer.
+		\param numPoints       numero de pontos utilizados para construcao dos semi-circulos de cada segmento.
+		\param bufferLevels    numero de niveis do buffer.
+		\param polVec          vetor de saida com os poligonos de buffer de cada nivel: nao aninhados, isto e, possivelmente estao sobrepostos, sendo o ratamento dado em outras rotinas de mais alto nivel (que utilizam esta como suporte).
+  */
+inline bool TeLineBuffer(const TeLine2D& line, const double& bufferDistance, const unsigned int& numPoints,
+						 const unsigned int& bufferLevels, vector<TePolygon>& polVec)
+{
+	polVec.clear();
+
+	unsigned int nStep = line.size();
+
+	if(nStep < 2)
+		return false;
+
+// vetor auxiliar que contera em cada posicao um polygonset
+// com todos os poligonos elementares de um determinado nivel de buffer
+	vector<TePolygonSet> psAux;
+
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+		TePolygonSet pset;
+		psAux.push_back(pset);
+	}
+
+// para linhas fechadas poderemos tracar somente buffer elementares com metade dos arcos
+// enquanto que para linhas abertas, o buffer do primeiro segmento sera feito com um buffer elementar completo (os dois semi-circulos serao tracados).
+// a seguir, computaremos os buffers elementares de cada nivel.
+	if(line.isRing())
+	{
+		for(unsigned int i = 1; i < nStep; ++i)
+		{
+// gera os poliginos elementares a partir dos segmentos definidos por cada par de vertice
+			vector<TePolygon> pols;
+			TeElementarBuffer(line[i - 1], line[i], bufferDistance, numPoints, bufferLevels, pols);
+
+			for(unsigned int j = 0; j < bufferLevels; ++j)
+				psAux[j].add(pols[j]);
+		}
+	}
+	else
+	{
+// para linhas abertas, o primeiro segmento tem um tratamento diferenciado enquanto os demais nao terao
+		vector<TePolygon> pols;
+		TeFullElementarBuffer(line[0], line[1], bufferDistance, numPoints, bufferLevels, pols);
+
+		for(unsigned int j = 0; j < bufferLevels; ++j)
+			psAux[j].add(pols[j]);
+
+		for(unsigned int i = 2; i < nStep; ++i)
+		{
+// gera os poliginos elementares a partir dos segmentos definidos por cada par de vertice
+			TeElementarBuffer(line[i - 1], line[i], bufferDistance, numPoints, bufferLevels, pols);
+
+			for(unsigned int j = 0; j < bufferLevels; ++j)
+				psAux[j].add(pols[j]);
+		}
+	}
+
+// agora, com os buffers elementares de cada nivel jah computados, vamos fazer
+// a uniao dos buffers elementares de cada nivel individualmente
+	for(unsigned int j = 0; j < bufferLevels; ++j)
+	{
+		TePolygonSet polSetOut;
+
+// caso a uniao falhe, interrompe a execucao sinalizando o problema!
+		if(TeOVERLAY::TePairUnion(psAux[j], polSetOut) == false)
+			return false;
+
+// teoricamente o buffer de cada nivel sera formado por um unico poligono com ou sem buracos.
+		if(polSetOut.size() != 1)
+			return false;
+
+		polVec.push_back(polSetOut[0]);
+	}
+
+	return true;
+}
+
+/** Rotina auxiliar que traca um buffer interno (negativo) no interior de um poligono, tracando varios niveis independentemente um do outro: para cada nivel de buffer, o anel externo do poligono estara no sentido horario e os buracos estarao no sentido anti-horario.
+		\param pol	           poligono para a qual os buffers serao tracados.
+		\param bufferDistance  distancia utilizada para tracar o buffer.
+		\param numPoints       numero de pontos utilizados para construcao dos semi-circulos de cada segmento.
+		\param bufferLevels    numero de niveis do buffer.
+		\param polsVec         vetor de saida com os poligonos de buffer de cada nivel: jah aninhados, isto e, os poligonos do nivel "n" jah consideram os do nivel "n-1".
+  */
+inline bool TeInsideBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polsVec)
+{
+	polsVec.clear();	
+
+	unsigned int nRings = pol.size();
+
+	//vetor de polygonset, onde cada poligonset est� associado a um nivel
+	//cada nivel contem os buffers internos do pai
+	vector<TePolygonSet> internalBuffers;
+	
+	//vetor de polygonset, onde cada poligonset est� associado a um nivel
+	//cada nivel contem os buffers externos dos buracos
+	vector<TePolygonSet> externalBuffers;
+
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+		TePolygonSet pset;
+		polsVec.push_back(pset);
+		TePolygonSet pset2;
+		internalBuffers.push_back(pset2);
+		TePolygonSet pset3;
+		externalBuffers.push_back(pset3);
+	}
+
+	// para cada anel vamos tracar o buffer e armazenar somente a parte de interesse: 
+	// no caso de aneis externos vamos
+	// ficar com o buffer interno e no caso de buracos vamos ficar com os buffer externos
+	for(unsigned int i = 0; i < nRings; ++i)
+	{
+		vector<TePolygon> buffVec;
+		
+		if(TeLineBuffer(pol[i], bufferDistance, numPoints, bufferLevels, buffVec) == false)
+			return false;
+
+		if(i == 0)
+		{
+// para o anel externo ficamos com os aneis internos do buffer
+			for(unsigned int j = 0; j < bufferLevels; ++j)
+			{
+				unsigned int rsize = buffVec[j].size();
+				for(unsigned int k = 1; k < rsize; ++k)
+				{
+					TePolygon paux; paux.add(buffVec[j][k]); //comeca em 1 ate k
+					internalBuffers[j].add(paux);
+				}
+			}
+		}
+		else
+		{
+// para um anel interno ficamos com os aneis externos do buffer
+			for(unsigned int j = 0; j < bufferLevels; ++j)
+			{
+				TePolygon paux; paux.add(buffVec[j][0]); 
+				externalBuffers[j].add(paux);
+			}
+		}
+	}
+	//para cada nivel, calcular o buraco do resultado que ser�
+	//a diferenca entre os buffers internos e 
+	//a uniao dos buffers externos 
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+		TePolygonSet holes;
+
+		if(externalBuffers[i].size()>0)
+		{
+			TePolygonSet externalBuffersUnion;
+			//uniao dos buffers externos
+			if(TeOVERLAY::TePairUnion(externalBuffers[i], externalBuffersUnion) == false)
+				return false;
+
+			// o buffer interno ao pai pode nao existir se a distancia for muito grande  
+			if(internalBuffers[i].size()>0)
+			{
+				//diferenca
+				if(TeOVERLAY::TeDifference(internalBuffers[i], externalBuffersUnion, holes) == false)
+					return false;
+			}
+
+			//se o resultado da diferenca der vazio, significa que os buffers internos entao
+			//contidos nos buffer externos
+			//assim temos que adicionar como buracos, os buracos originais
+			if(holes.size()==0)
+			{
+				TePolygon h;
+				for(unsigned j=1; j<pol.size(); ++j) // buracos originais 
+				{
+					h.add(pol[j]); 
+					holes.add(h);
+				}
+			}
+		}
+		else
+		{
+			//o unico buraco e o internal buffer do pai
+			holes = internalBuffers[i];
+		}
+		
+		//montar o buffer final
+		TePolygon result;
+		result.add(pol[0]); // pai do original
+		for(unsigned j=0; j<holes.size(); ++j) // buracos calculados
+            result.add(holes[j][0]);
+		
+		polsVec[i].add(result);
+	}
+
+	return true;
+}
+
+/** Rotina auxiliar que traca um buffer externo (positivo) ao redor de um poligono, tracando varios niveis independentemente um do outro: para cada nivel de buffer, o anel externo do poligono estara no sentido horario e os buracos estarao no sentido anti-horario.
+		\param pol	           poligono para a qual os buffers serao tracados.
+		\param bufferDistance  distancia utilizada para tracar o buffer.
+		\param numPoints       numero de pontos utilizados para construcao dos semi-circulos de cada segmento.
+		\param bufferLevels    numero de niveis do buffer.
+		\param polsVec         vetor de saida com os poligonos de buffer de cada nivel: jah aninhados, isto e, os poligonos do nivel "n" jah consideram os do nivel "n-1".
+  */
+inline bool TeOutsideBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polsVec)
+{
+	polsVec.clear();	
+
+	unsigned int nRings = pol.size();
+
+// jah coloca um objeto polygonset correspondente a cada nivel
+	vector<TePolygonSet> outPutPolsVec;
+
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+		TePolygonSet pset;
+		outPutPolsVec.push_back(pset);
+		TePolygonSet pset2;
+		polsVec.push_back(pset2);
+	}
+
+// para cada anel vamos tracar o buffer e armazenar somente a parte de interesse: no caso de aneis externos vamos
+// ficar com o buffer externo e no caso de buracos vamos ficar com os buffer internos
+	for(unsigned int i = 0; i < nRings; ++i)
+	{
+		vector<TePolygon> buffVec;
+		
+		if(TeLineBuffer(pol[i], bufferDistance, numPoints, bufferLevels, buffVec) == false)
+			return false;
+
+		if(i == 0)
+		{
+// para o anel externo ficamos com o anel externo do buffer
+			for(unsigned int j = 0; j < bufferLevels; ++j)
+			{
+				TePolygon paux; paux.add(buffVec[j][0]);
+				outPutPolsVec[j].add(paux);
+			}
+		}
+		else
+		{
+// para um anel interno ficamos com os aneis internos do buffer
+			for(unsigned int j = 0; j < bufferLevels; ++j)
+			{
+				unsigned int rsize = buffVec[j].size();
+
+				for(unsigned int k = 1; k < rsize; ++k)
+				{
+					TePolygon paux; paux.add(buffVec[j][k]);
+					outPutPolsVec[j].add(paux);
+				}
+			}
+		}
+	}
+
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+// no caso de buffers positivos (para fora) pelo menos o buffer do anel externo devera aparecer em cada nivel
+		if(outPutPolsVec[i].size() == 0)
+			return false;
+
+		TePolygonSet psetOut = outPutPolsVec[i];
+
+// LOGICA PARA O ANEL EXTERNO
+		if(i == 0)
+		{
+// o primeiro buffer pegara como buraco o anel externo original
+			psetOut[0].add(pol[0]);	
+			polsVec[i].add(psetOut[0]);
+		}
+		else
+		{
+			TeLine2D laux;
+			laux.copyElements(outPutPolsVec[i - 1][0][0]);
+			psetOut[0].add(TeLinearRing(laux));
+			polsVec[i].add(psetOut[0]);
+		}
+
+// se nao temos buracos no corrente, entao nao precisamos nos preocupar com diferencas e etc...
+		if(psetOut.size() == 1)
+			continue;
+
+		
+// LOGICA PARA OS ANEIS INTERNOS
+		if(i == 0)
+		{			
+// vamos montar um polygonset com os buracos do poligono original
+			TePolygonSet psetOriginalInnerRings;
+
+			for(unsigned int j = 1; j < nRings; ++j)
+			{
+				TePolygon paux; paux.add(pol[j]);
+				psetOriginalInnerRings.add(paux);
+			}
+
+// agora vamos montar um polygonset com os buracos (que jah estao como poligonos) do primeiro nivel
+			TePolygonSet currentPset;
+
+			for(unsigned int j = 1; j < psetOut.size(); ++j)
+			{
+				currentPset.add(psetOut[j]);
+			}
+
+// agora fazemos a diferena dos originais com o do primeiro nivel
+			TePolygonSet resultPset;
+
+			if(TeOVERLAY::TeDifference(psetOriginalInnerRings, currentPset, resultPset) == false)
+				return false;
+
+			for(unsigned int j = 0; j < resultPset.size(); ++j)
+			{
+				polsVec[i].add(resultPset[j]);
+			}
+		}
+		else
+		{
+// vamos montar um polygonset com os buracos do "n-1" e um com o corrente ("n")
+			TePolygonSet previousPset;
+
+			for(unsigned int j = 1; j < outPutPolsVec[i - 1].size(); ++j)
+			{
+				previousPset.add(outPutPolsVec[i - 1][j]);
+			}
+
+			TePolygonSet currentPset;
+
+			for(unsigned int j = 1; j < psetOut.size(); ++j)
+			{
+				currentPset.add(psetOut[j]);
+			}
+
+// agora fazemos a diferena do nivel anterior com o do nivel corrente
+			TePolygonSet resultPset;
+
+			if(TeOVERLAY::TeDifference(previousPset, currentPset, resultPset) == false)
+				return false;
+
+			for(unsigned int j = 0; j < resultPset.size(); ++j)
+			{
+				polsVec[i].add(resultPset[j]);
+			}
+		}
+	}
+
+	return true;
+}
+
+inline bool TeInOutBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polsVec)
+{
+	polsVec.clear();	
+
+	unsigned int nRings = pol.size();
+
+	//vetor de polygonset, onde cada polygonset est� associado a um nivel
+	//cada nivel contem os buffers internos e externos  
+	// de cada anel do poligono
+	vector<TePolygonSet> polVecBuffers;
+	
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+		TePolygonSet pset;
+		polsVec.push_back(pset);
+		TePolygonSet pset2;
+		polVecBuffers.push_back(pset2);
+	}
+
+	// para cada anel vamos tracar o buffer e armazenar o poligono gerado (com aneis externo e internos)
+	for(unsigned int i = 0; i < nRings; ++i)
+	{
+		vector<TePolygon> buffVec;
+		
+		if(TeLineBuffer(pol[i], bufferDistance, numPoints, bufferLevels, buffVec) == false)
+			return false;
+
+		//adicona o buffer gerado em cada polygonset
+		for(unsigned int j=0; j<buffVec.size(); ++j)
+			polVecBuffers[j].add(buffVec[j]);
+
+	}
+
+
+    //para cada nivel, fazer a uniao de todos os buffers gerados
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+		//uniao dos buffers 
+		if(TeOVERLAY::TePairUnion(polVecBuffers[i], polsVec[i]) == false)
+			return false;
+	}
+
+	return true;
+}
+
+}	// end namespace TeBUFFERREGION
+
+//---------------- Buffer Algorithm ----------------//
+
+bool TeBUFFERREGION::TeBufferRegion(const TeCoord2D& coord, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygon>& bufferPols)
+{
+// limpa o vetor de poligonos de saida
+	bufferPols.clear();
+
+// cria um vetor de linhas que contera a linha de buffer a cada nivel
+	vector<TeLine2D> contourLines;
+
+// cria a linha de cada nivel e jah acrescenta a coordenada inicial do canto esquerdo
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+// linha de buffer do i-th nivel
+		TeLine2D newLine;
+		newLine.add(TeCoord2D((coord.x() - (bufferDistance * (i + 1))), (coord.y())));
+
+		contourLines.push_back(newLine);
+	}
+
+	double initialAng = bufferPI;							// angulo inicial
+	const double deltaAng = doubleBufferPI / numPoints;		// angulo de cada setor que compoem o buffer
+
+	double x = 0.0;	// variavel que contera a coordenada x transladada
+	double y = 0.0;	// variavel que contera a coordenada y transladada
+	double c = 0.0;	// variavel que contera o resultado do cosseno de um angulo
+	double s = 0.0;	// variavel que contera o resultado do seno de um angulo
+
+
+// calcula as coordenadas que formarao a linha de buffer de cada nivel
+	for(unsigned int i = 1; i < numPoints; ++i)
+	{
+		initialAng -= deltaAng;
+		
+		c = cos(initialAng);
+		s = sin(initialAng);
+
+// gera o ponto equivalente para cada nivel de buffer
+		for(unsigned int k = 0; k < bufferLevels; ++k)
+		{		
+			x = coord.x_ + bufferDistance * (k + 1) * c; 
+			y = coord.y_ + bufferDistance * (k + 1) * s;
+
+			contourLines[k].add(TeCoord2D(x, y));
+		}
+	}
+
+// fecha cada uma das linhas de buffer,
+// repetindo o primeiro ponto e cria os poligonos de buffer de cada nivel formado pela respectiva
+// linha de buffer
+	for(unsigned int i = 0; i < bufferLevels; ++i)
+	{
+		contourLines[i].add(contourLines[i][0]);		
+
+		TePolygon pol;
+		pol.add(TeLinearRing(contourLines[i]));
+		bufferPols.push_back(pol);
+	}
+
+// coloca o anel externo do nivel "n-1" como anel interno do nivel "n"
+	for(unsigned int i = 1; i < bufferLevels; ++i)
+	{
+// clona a linha externa do nivel "n-1"
+		TeLine2D laux;
+		laux.copyElements(bufferPols[i - 1][0]);
+
+// deixa no sentido anti-horario a linha que servira de buraco para o buffer do nivel "n"
+		reverse(laux.begin(), laux.end());
+
+// e, finalmente, coloca a linha do nivel "n-1" como buraco do nivel "n"
+		bufferPols[i].add(TeLinearRing(laux));
+	}
+
+	return true;
+}
+
+bool TeBUFFERREGION::TeBufferRegion(const TeCoord2D& coord, const double& bufferDistance, const unsigned int& numPoints, TePolygon& pol)
+{
+	pol.clear();
+
+// define um vetor temporario para chamar a rotina acima, que realmente implementa o buffer de um ponto
+	vector<TePolygon> bufferPols;
+
+// solicita o buffer de um unico nivel ao redor do ponto
+	TeBufferRegion(coord, bufferDistance, numPoints, 1, bufferPols);
+
+	if(bufferPols.empty())
+		return false;
+
+	pol = bufferPols[0];
+
+	return true;
+}
+
+bool TeBUFFERREGION::TeBufferRegion(const TeLine2D& line, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polVec)
+{
+	polVec.clear();
+
+	for(unsigned int level=0; level<bufferLevels; ++level)
+	{
+		TePolygonSet aux;
+		polVec.push_back(aux);
+	}
+
+// para tracar o semi-circulo ao redor do canto do segmento precisamos de pelo menos tres pontos
+	unsigned int cornerPts = numPoints;
+
+	if(numPoints < 3)
+		cornerPts = 3;
+
+// traca os buffers de cada nivel ao redor da linha: cada posicao do vetor "outPutPolVec" contera o poligono de cada nivel
+	vector<TePolygon> outPutPolVec;
+
+	if(TeLineBuffer(line, bufferDistance, cornerPts, bufferLevels, outPutPolVec) == false)
+		return false;
+
+// se o numero de poligonos da saida for diferente do numero de niveis desejado, algum erro ocorreu
+	if(outPutPolVec.size() != bufferLevels)
+		return false;
+
+// para cada nivel de buffer precisamos acomodar os aneis do nivel anterior:
+// no caso do buffer de linhas, o buffer do nivel "n" eh exatamente a diferenca do resultado que temos ate aqui menos o resultado
+// do buffer do nivel "n-1"
+	polVec[0].add(outPutPolVec[0]);
+
+	for(unsigned int i = 1; i < bufferLevels; ++i)
+	{
+		TePolygonSet currentPSet;  currentPSet.add(outPutPolVec[i]);
+		TePolygonSet previousPSet; previousPSet.add(outPutPolVec[i - 1]);
+
+		TePolygonSet polSetOut;
+
+		if(TeOVERLAY::TeDifference(currentPSet, previousPSet, polSetOut) == false)
+			return false;
+
+// esperamos que o resultado da diferenca seja sempre um poligono (com zero ou mais buracos)
+		//if(polSetOut.size() != 1)
+		//	return false;
+		//polVec.push_back(polSetOut[0]);
+
+		for(unsigned int j=0; j<polSetOut.size(); ++j)
+			polVec[i].add(polSetOut[j]);
+	}
+
+	return true;	
+}
+
+bool TeBUFFERREGION::TeBufferRegion(const TeLine2D& line, const double& bufferDistance, const unsigned int& numPoints, TePolygonSet& ps)
+{
+	ps.clear();
+
+	vector<TePolygonSet> polVec;
+
+	if(TeBufferRegion(line, bufferDistance, numPoints, 1, polVec) == false)
+		return false;
+
+	ps.copyElements(polVec[0]);
+	
+	return true;
+}
+
+bool TeBUFFERREGION::TeBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& buffType, vector<TePolygonSet>& polsVec)
+{
+	if(buffType == TeINSIDEBUFFER)
+	{
+		return TeInsideBufferRegion(pol, bufferDistance, numPoints, bufferLevels, polsVec);
+	}
+	else if(buffType == TeOUTSIDEBUFFER)
+	{
+		return TeOutsideBufferRegion(pol, bufferDistance, numPoints, bufferLevels, polsVec);
+	}
+	else
+	{
+		return TeInOutBufferRegion(pol, bufferDistance, numPoints, bufferLevels, polsVec);
+	}	
+}
+
+bool TeBUFFERREGION::TeBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, TePolygonSet& ps)
+{
+	ps.clear();
+
+	vector<TePolygonSet> pols;
+	
+	if(!TeBufferRegion(pol, bufferDistance, numPoints, 1, TeOUTSIDEBUFFER, pols))
+		return false;
+
+	ps = pols[0];
+
+	return true;
+}
+
+bool TeBUFFERREGION::TeBufferRegion(const TePolygonSet& polSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& bufferType, vector<TePolygonSet>& polyVecOut)
+{
+	polyVecOut.clear();
+	
+	for(unsigned int j=0; j<polSetIn.size(); ++j)
+	{
+		vector<TePolygonSet> auxPolVec;
+		if(!TeBUFFERREGION::TeBufferRegion(polSetIn[j], bufferDistance, numPoints, bufferLevels, bufferType, auxPolVec))
+			return false;
+
+		if(j==0)
+		{
+			for(unsigned int i=0; i<auxPolVec.size(); ++i)
+				polyVecOut.push_back(auxPolVec[i]);
+		}
+		else
+		{
+			for(unsigned int i=0; i<auxPolVec.size(); ++i)
+			{
+				TePolygonSet polUnion;
+				if(!TeOVERLAY::TeUnion(polyVecOut[i], auxPolVec[i], polUnion))
+					return false;
+				polyVecOut[i]=polUnion;
+			}
+		}
+	}
+	return true;
+}
+
+
+bool TeBUFFERREGION::TeBufferRegion(const TeLineSet& lineSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polyVecOut)
+{
+	polyVecOut.clear();
+
+    for(unsigned int j=0; j<lineSetIn.size(); ++j)
+	{
+		vector<TePolygonSet> currentPolVec;
+		if(!TeBUFFERREGION::TeBufferRegion(lineSetIn[j], bufferDistance, numPoints, bufferLevels, currentPolVec))
+			return false;
+
+		if(j==0)
+		{
+			for(unsigned int i=0; i<currentPolVec.size(); ++i)
+				polyVecOut.push_back(currentPolVec[i]);
+		}
+		else
+		{
+			for(unsigned int i=0; i<currentPolVec.size(); ++i)
+			{
+				TePolygonSet polUnion;
+				if(!TeOVERLAY::TeUnion(polyVecOut[i], currentPolVec[i], polUnion))
+					return false;
+				polyVecOut[i]=polUnion;
+			}
+		}
+	}
+	return true;
+}
+
+
+bool TeBUFFERREGION::TeBufferRegion(const TePointSet& pointSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polyVecOut)
+{
+	polyVecOut.clear();
+	
+	for(unsigned int j=0; j<pointSetIn.size(); ++j)
+	{
+		vector<TePolygon> currentPolVec;
+		if(!TeBUFFERREGION::TeBufferRegion(pointSetIn[j].location(), bufferDistance, numPoints, bufferLevels, currentPolVec))
+			return false;
+
+		if(j==0)
+		{
+			for(unsigned int i=0; i<currentPolVec.size(); ++i)
+			{
+				TePolygonSet currentPolSet; currentPolSet.add(currentPolVec[i]);
+				polyVecOut.push_back(currentPolSet);
+			}
+		}
+		else
+		{
+			for(unsigned int i=0; i<currentPolVec.size(); ++i)
+			{
+				TePolygonSet polUnion, currentPolSet;
+				currentPolSet.add(currentPolVec[i]);
+				if(!TeOVERLAY::TeUnion(polyVecOut[i], currentPolSet, polUnion))
+					return false;
+				polyVecOut[i]=polUnion;
+			}
+		}
+	}
+	return true;
+}
+
+	
+bool  TeBUFFERREGION::TeBufferRegion(const TeCellSet& cellSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& bufferType, vector<TePolygonSet>& polyVecOut)
+{
+	polyVecOut.clear();
+	
+	for(unsigned int j=0; j<cellSetIn.size(); ++j)
+	{
+		vector<TePolygonSet> auxPolVec;
+		if(!TeBUFFERREGION::TeBufferRegion(TeMakePolygon(cellSetIn[j].box()), bufferDistance, numPoints, bufferLevels, bufferType, auxPolVec))
+			return false;
+
+		if(j==0)
+		{
+			for(unsigned int i=0; i<auxPolVec.size(); ++i)
+				polyVecOut.push_back(auxPolVec[i]);
+		}
+		else
+		{
+			for(unsigned int i=0; i<auxPolVec.size(); ++i)
+			{
+				TePolygonSet polUnion;
+				if(!TeOVERLAY::TeUnion(polyVecOut[i], auxPolVec[i], polUnion))
+					return false;
+				polyVecOut[i]=polUnion;
+			}
+		}
+	}
+	return true;
+}
+
diff --git a/src/terralib/kernel/TeBufferRegion.h b/src/terralib/kernel/TeBufferRegion.h
old mode 100755
new mode 100644
index 818e390..855bf74
--- a/src/terralib/kernel/TeBufferRegion.h
+++ b/src/terralib/kernel/TeBufferRegion.h
@@ -1,156 +1,156 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file   TeBufferRegion.h
-	\brief  This file contains structures and definitions for buffer region (map distance) operation on objects.
-	\author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
- */
-
-#ifndef  __TERRALIB_INTERNAL_BUFFER_H
-#define  __TERRALIB_INTERNAL_BUFFER_H
-
-#include "TeCoord2D.h"
-
-class TeLine2D;
-class TePolygon;
-class TePolygonSet;
-class TeLineSet;
-class TePointSet;
-class TeCellSet;
-
-/*! \brief Contains structures and definitions needed to execute Buffer Region operation
-*/
-namespace TeBUFFERREGION
-{	
-	//!	Buffer type.
-	/*!
-		- TeINSIDEBUFFER			used to make only inside buffer lines
-		- TeOUTSIDEBUFFER			used to make only outside buffer lines
-		- TeINSIDEOUTSIDEBUFFER		used to make inside and outside buffer lines
-	*/ 
-	enum TeBufferType { TeINSIDEBUFFER, TeOUTSIDEBUFFER, TeINSIDEOUTSIDEBUFFER };
-
-	/** \brief Calculates a buffer region around a point (DEPRECATED: use TeBufferRegion with buffer levels instead).
-		\param coord			the location of the point
-		\param bufferDistance	the desired distance in the same unit as coord
-		\param numPoints		the number of points that should be used to describe the buffer zone (a circle in this case)
-		\param pol				to return the buffer zone: a circle polygon in clockwise order
-		\return Returns true if operation succeed otherwise returns false.
-	*/
-	TL_DLL bool TeBufferRegion(const TeCoord2D& coord, const double& bufferDistance, const unsigned int& numPoints, TePolygon& pol);
-
-	/** \brief Calculates a buffer region around a point.
-		\param coord			the location of the point
-		\param bufferDistance	the desired distance in the same unit as coord
-		\param numPoints		the number of points that should be used to describe the buffer zone (a circle in this case)
-		\param bufferLevels		the number of buffer intervals
-		\param bufferPols		to return the buffer intervals: a circle polygon in clockwise order with holes in counterclockwise order
-		\return Returns true if operation succeed otherwise returns false.
-	*/
-	TL_DLL bool TeBufferRegion(const TeCoord2D& coord, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygon>& bufferPols);
-
-	/** \brief Calculates a buffer region around a line (DEPRECATED: use TeBufferRegion with buffer levels instead).
-		\param line				the line 
-		\param bufferDistance	the desired distance in the same unit as line coordinates
-		\param numPoints		the number of points that should be used to describe the curved corners of the buffer zone
-		\param ps				to return the buffer zone: a set of polygons
-		\return Returns true if operation succeed otherwise returns false.
-	*/	
-	TL_DLL bool TeBufferRegion(const TeLine2D& line, const double& bufferDistance, const unsigned int& numPoints, TePolygonSet& ps);
-	
-	/** \brief Calculates a buffer region around a line.
-		\param line				the line 
-		\param bufferDistance	the desired distance in the same unit as line coordinates
-		\param numPoints		the number of points that should be used to describe the curved corners of the buffer zone
-		\param bufferLevels		the number of buffer intervals
-		\param polVec			to return the buffer zone: a vector of polygons
-		\return Returns true if operation succeed otherwise returns false.
-	*/	
-	TL_DLL bool TeBufferRegion(const TeLine2D& line, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polVec);
-
-	
-	/** \brief Calculates a buffer region around a polygon (DEPRECATED: use TeBufferRegion with buffer levels instead).
-		\param pol				the polygon 
-		\param bufferDistance	the desired distance in the same unit as polygon rings coordinates
-		\param numPoints		the number of points that should be used to describe the curved corners of the buffer zone
-		\param ps				to return the buffer zone: a set of polygons
-		\return Returns true if operation succeed otherwise returns false.
-	*/	
-	TL_DLL bool TeBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, TePolygonSet& ps);
-
-	/** \brief Calculates a buffer region around a polygon (DEPRECATED: use TeBufferRegion with buffer levels instead).
-		\param pol				the polygon 
-		\param bufferDistance	the desired distance in the same unit as polygon rings coordinates
-		\param numPoints		the number of points that should be used to describe the curved corners of the buffer zone
-		\param bufferLevels		the number of buffer intervals
-		\param buffType		    the buffer type: inside/outside/inside+outside
-		\param polsVec			to return the buffer zone: a vector of polygon set
-		\return Returns true if operation succeed otherwise returns false.
-	*/	
-	TL_DLL bool TeBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& buffType, vector<TePolygonSet>& polsVec);
-
-	/** \brief Calculates a buffer region around an object polygon set.
-		\param polSetIn				the object polygon set
-		\param bufferDistance		the desired distance in the same unit as polygon rings coordinates
-		\param numPoints			the number of points that should be used to describe the curved corners of the buffer zone
-		\param bufferLevels			the number of buffer intervals
-		\param bufferType			the buffer type: inside/outside/inside+outside
-		\param polyVecOut			to return the buffers of the object, each level in a position of the vector
-		\return Returns true if operation succeed otherwise returns false.
-	*/	
-	TL_DLL bool TeBufferRegion(const TePolygonSet& polSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& bufferType, vector<TePolygonSet>& polyVecOut);
-
-	/** \brief Calculates a buffer region around an object line set.
-		\param lineSetIn			the object line set
-		\param bufferDistance		the desired distance in the same unit as lines coordinates
-		\param numPoints			the number of points that should be used to describe the curved corners of the buffer zone
-		\param bufferLevels			the number of buffer intervals
-		\param polyVecOut			to return the buffers of the object, each level in a position of the vector
-		\return Returns true if operation succeed otherwise returns false.
-	*/	
-	TL_DLL bool TeBufferRegion(const TeLineSet& lineSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polyVecOut);
-
-	/** \brief Calculates a buffer region around an object point set.
-		\param pointSetIn			the object point set
-		\param bufferDistance		the desired distance in the same unit as points coordinates
-		\param numPoints			the number of points that should be used to describe the curved corners of the buffer zone
-		\param bufferLevels			the number of buffer intervals
-		\param polyVecOut			to return the buffers of the object, each level in a position of the vector
-		\return Returns true if operation succeed otherwise returns false.
-	*/			
-	TL_DLL bool TeBufferRegion(const TePointSet& pointSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polyVecOut);
-	
-	/** \brief Calculates a buffer region around an object cell set.
-		\param cellSetIn			the object cell set
-		\param bufferDistance		the desired distance in the same unit as cells coordinates
-		\param numPoints			the number of points that should be used to describe the curved corners of the buffer zone
-		\param bufferLevels			the number of buffer intervals
-		\param bufferType			the buffer type: inside/outside/inside+outside
-		\param polyVecOut			to return the buffers of the object, each level in a position of the vector
-		\return Returns true if operation succeed otherwise returns false.
-	*/			
-	TL_DLL bool TeBufferRegion(const TeCellSet& cellSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& bufferType, vector<TePolygonSet>& polyVecOut);
-
-}	// end namespace TeBUFFER
-
-#endif //__TERRALIB_INTERNAL_BUFFER_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file   TeBufferRegion.h
+	\brief  This file contains structures and definitions for buffer region (map distance) operation on objects.
+	\author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+ */
+
+#ifndef  __TERRALIB_INTERNAL_BUFFER_H
+#define  __TERRALIB_INTERNAL_BUFFER_H
+
+#include "TeCoord2D.h"
+
+class TeLine2D;
+class TePolygon;
+class TePolygonSet;
+class TeLineSet;
+class TePointSet;
+class TeCellSet;
+
+/*! \brief Contains structures and definitions needed to execute Buffer Region operation
+*/
+namespace TeBUFFERREGION
+{	
+	//!	Buffer type.
+	/*!
+		- TeINSIDEBUFFER			used to make only inside buffer lines
+		- TeOUTSIDEBUFFER			used to make only outside buffer lines
+		- TeINSIDEOUTSIDEBUFFER		used to make inside and outside buffer lines
+	*/ 
+	enum TeBufferType { TeINSIDEBUFFER, TeOUTSIDEBUFFER, TeINSIDEOUTSIDEBUFFER };
+
+	/** \brief Calculates a buffer region around a point (DEPRECATED: use TeBufferRegion with buffer levels instead).
+		\param coord			the location of the point
+		\param bufferDistance	the desired distance in the same unit as coord
+		\param numPoints		the number of points that should be used to describe the buffer zone (a circle in this case)
+		\param pol				to return the buffer zone: a circle polygon in clockwise order
+		\return Returns true if operation succeed otherwise returns false.
+	*/
+	TL_DLL bool TeBufferRegion(const TeCoord2D& coord, const double& bufferDistance, const unsigned int& numPoints, TePolygon& pol);
+
+	/** \brief Calculates a buffer region around a point.
+		\param coord			the location of the point
+		\param bufferDistance	the desired distance in the same unit as coord
+		\param numPoints		the number of points that should be used to describe the buffer zone (a circle in this case)
+		\param bufferLevels		the number of buffer intervals
+		\param bufferPols		to return the buffer intervals: a circle polygon in clockwise order with holes in counterclockwise order
+		\return Returns true if operation succeed otherwise returns false.
+	*/
+	TL_DLL bool TeBufferRegion(const TeCoord2D& coord, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygon>& bufferPols);
+
+	/** \brief Calculates a buffer region around a line (DEPRECATED: use TeBufferRegion with buffer levels instead).
+		\param line				the line 
+		\param bufferDistance	the desired distance in the same unit as line coordinates
+		\param numPoints		the number of points that should be used to describe the curved corners of the buffer zone
+		\param ps				to return the buffer zone: a set of polygons
+		\return Returns true if operation succeed otherwise returns false.
+	*/	
+	TL_DLL bool TeBufferRegion(const TeLine2D& line, const double& bufferDistance, const unsigned int& numPoints, TePolygonSet& ps);
+	
+	/** \brief Calculates a buffer region around a line.
+		\param line				the line 
+		\param bufferDistance	the desired distance in the same unit as line coordinates
+		\param numPoints		the number of points that should be used to describe the curved corners of the buffer zone
+		\param bufferLevels		the number of buffer intervals
+		\param polVec			to return the buffer zone: a vector of polygons
+		\return Returns true if operation succeed otherwise returns false.
+	*/	
+	TL_DLL bool TeBufferRegion(const TeLine2D& line, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polVec);
+
+	
+	/** \brief Calculates a buffer region around a polygon (DEPRECATED: use TeBufferRegion with buffer levels instead).
+		\param pol				the polygon 
+		\param bufferDistance	the desired distance in the same unit as polygon rings coordinates
+		\param numPoints		the number of points that should be used to describe the curved corners of the buffer zone
+		\param ps				to return the buffer zone: a set of polygons
+		\return Returns true if operation succeed otherwise returns false.
+	*/	
+	TL_DLL bool TeBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, TePolygonSet& ps);
+
+	/** \brief Calculates a buffer region around a polygon (DEPRECATED: use TeBufferRegion with buffer levels instead).
+		\param pol				the polygon 
+		\param bufferDistance	the desired distance in the same unit as polygon rings coordinates
+		\param numPoints		the number of points that should be used to describe the curved corners of the buffer zone
+		\param bufferLevels		the number of buffer intervals
+		\param buffType		    the buffer type: inside/outside/inside+outside
+		\param polsVec			to return the buffer zone: a vector of polygon set
+		\return Returns true if operation succeed otherwise returns false.
+	*/	
+	TL_DLL bool TeBufferRegion(const TePolygon& pol, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& buffType, vector<TePolygonSet>& polsVec);
+
+	/** \brief Calculates a buffer region around an object polygon set.
+		\param polSetIn				the object polygon set
+		\param bufferDistance		the desired distance in the same unit as polygon rings coordinates
+		\param numPoints			the number of points that should be used to describe the curved corners of the buffer zone
+		\param bufferLevels			the number of buffer intervals
+		\param bufferType			the buffer type: inside/outside/inside+outside
+		\param polyVecOut			to return the buffers of the object, each level in a position of the vector
+		\return Returns true if operation succeed otherwise returns false.
+	*/	
+	TL_DLL bool TeBufferRegion(const TePolygonSet& polSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& bufferType, vector<TePolygonSet>& polyVecOut);
+
+	/** \brief Calculates a buffer region around an object line set.
+		\param lineSetIn			the object line set
+		\param bufferDistance		the desired distance in the same unit as lines coordinates
+		\param numPoints			the number of points that should be used to describe the curved corners of the buffer zone
+		\param bufferLevels			the number of buffer intervals
+		\param polyVecOut			to return the buffers of the object, each level in a position of the vector
+		\return Returns true if operation succeed otherwise returns false.
+	*/	
+	TL_DLL bool TeBufferRegion(const TeLineSet& lineSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polyVecOut);
+
+	/** \brief Calculates a buffer region around an object point set.
+		\param pointSetIn			the object point set
+		\param bufferDistance		the desired distance in the same unit as points coordinates
+		\param numPoints			the number of points that should be used to describe the curved corners of the buffer zone
+		\param bufferLevels			the number of buffer intervals
+		\param polyVecOut			to return the buffers of the object, each level in a position of the vector
+		\return Returns true if operation succeed otherwise returns false.
+	*/			
+	TL_DLL bool TeBufferRegion(const TePointSet& pointSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, vector<TePolygonSet>& polyVecOut);
+	
+	/** \brief Calculates a buffer region around an object cell set.
+		\param cellSetIn			the object cell set
+		\param bufferDistance		the desired distance in the same unit as cells coordinates
+		\param numPoints			the number of points that should be used to describe the curved corners of the buffer zone
+		\param bufferLevels			the number of buffer intervals
+		\param bufferType			the buffer type: inside/outside/inside+outside
+		\param polyVecOut			to return the buffers of the object, each level in a position of the vector
+		\return Returns true if operation succeed otherwise returns false.
+	*/			
+	TL_DLL bool TeBufferRegion(const TeCellSet& cellSetIn, const double& bufferDistance, const unsigned int& numPoints, const unsigned int& bufferLevels, const TeBufferType& bufferType, vector<TePolygonSet>& polyVecOut);
+
+}	// end namespace TeBUFFER
+
+#endif //__TERRALIB_INTERNAL_BUFFER_H
+
diff --git a/src/terralib/kernel/TeCentroid.cpp b/src/terralib/kernel/TeCentroid.cpp
old mode 100755
new mode 100644
index 69245fb..fe44829
--- a/src/terralib/kernel/TeCentroid.cpp
+++ b/src/terralib/kernel/TeCentroid.cpp
@@ -1,416 +1,416 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <vector>
-#include <functional>
-#include <algorithm>
-
-#include "TeAssertions.h"
-#include "TeException.h"
-#include "TeGeometryAlgorithms.h"
-
-using namespace std;
-
-
-// Prototypes for internal routines - NOT seen from the outside
-
-TeCoord2D TeFindBaricenter (const TeLinearRing& ring ); // general method ( solves most cases)
-TeCoord2D TeFindCentroidConcavePolygon (const TePolygon& poly ); // brute-force approach (use if above fails)
-
-TeCoord2D
-TeFindCentroid(TeMultiGeometry& mGeom )
-{
-	TeBox bb;
-	TeCoord2D ct;
-	if(mGeom.hasPolygons())
-	{
-		ct = TeFindCentroid(mGeom.getPolygons());
-		updateBox(bb,ct);
-	}
-	if(mGeom.hasCells())
-	{
-		ct = TeFindCentroid(mGeom.getCells());
-		updateBox(bb,ct);
-	}
-	if(mGeom.hasLines())
-	{
-		ct = TeFindCentroid(mGeom.getLines());
-		updateBox(bb,ct);
-	}
-	else if(mGeom.hasPoints())
-	{
-		ct = TeFindCentroid(mGeom.getPoints());
-		updateBox(bb,ct);
-	}
-	return bb.center();
-}
-
-TeCoord2D
-TeFindCentroid(const TePolygon& poly )
-{
-	// This is a two-step algorithm
-
-	// First, try a simple geometric solution
-	// that works for convex polygons and some concave ones
-
-	TeCoord2D pt = TeFindBaricenter( poly[0] );
-
-	if ( TeWithin ( TePoint(pt), poly) )
-		return pt;
-	
-	// No, try a more general approach
-
-	pt = TeFindCentroidConcavePolygon( poly );
-
-return pt;
-}
-
-TeCoord2D
-TeFindCentroid (const TeLine2D& line )
-{
-	int midpoint = (line.size()/2) - 1 ;
-	TeCoord2D middle;
-	
-	TeGetMiddlePoint(line[midpoint], line[midpoint+1], middle);
-	return middle;
-}
-
-TeCoord2D 
-TeFindCentroid(const TeCell& c) 
-{
-	return c.box().center();
-}
-
-TeCoord2D 
-TeFindCentroid(const TePoint& p) 
-{
-	return p.location();
-}
-
-TeCoord2D 
-TeFindCentroid(const TeText& t) 
-{
-	return t.location();
-}
-
-TeCoord2D 
-TeFindCentroid(const TePolygonSet& s)
-{
-	TeCoord2D p;
-	if (s.empty())
-		return p;
-	double sx = 0.0;
-	double sy = 0.0;
-	unsigned int n = 0;
-
-	TeBox bb = s.box();
-	TePolygonSet::iterator it1 = s.begin(); 
-	while (it1 != s.end())
-	{
-		TeCoord2D p1 = TeFindCentroid (*it1);
-		sx += p1.x();
-		sy += p1.y();
-		++n;
-		++it1;
-	}
-	double ssx = sx/n;
-	double ssy = sy/n;
-	p.setXY(ssx,ssy);
-	return p;
-}
-
-
-TeCoord2D 
-TeFindCentroid(const TeLineSet& s)
-{
-	TeCoord2D p;
-	if (s.empty())
-		return p;
-	double sx = 0.0;
-	double sy = 0.0;
-	unsigned int n = 0;
-	TeLineSet::iterator it1 = s.begin(); 
-	while (it1 != s.end())
-	{
-		TeCoord2D p1 = TeFindCentroid (*it1);
-		sx += p1.x();
-		sy += p1.y();
-		++n;
-		it1++;
-	}
-	sx = sx/n;
-	sy = sy/n;
-	p.setXY(sx,sy);
-	return p;
-}
-
-
-TeCoord2D 
-TeFindCentroid(const TeCellSet& s)
-{
-	TeCoord2D p;
-	if (s.empty())
-		return p;
-	double sx = 0.0;
-	double sy = 0.0;
-	unsigned int n = 0;
-	TeCellSet::iterator it1 = s.begin(); 
-	while (it1 != s.end())
-	{
-		TeCoord2D p1 = TeFindCentroid (*it1);
-		sx += p1.x();
-		sy += p1.y();
-		++n;
-		it1++;
-	}
-	sx = sx/n;
-	sy = sy/n;
-	p.setXY(sx,sy);
-	return p;
-}
-
-TeCoord2D 
-TeFindCentroid(TePointSet& points)
-{
-	TeCoord2D p;
-	if (points.empty())
-		return p;
-	if (points.size() == 1)
-		p = (points[0]).location();
-	else
-		p = points.box().center();
-	return p;
-}
-
-TeCoord2D 
-TeFindCentroid(TeTextSet& texts)
-{
-	return texts.box().center();
-}
-/*
- * ANSI C++ code from the article
- * "Centroid of a Polygon"
- * by Gerard Bashein and Paul R. Detmer,
- * in "Graphics Gems IV", Academic Press, 1994
- */
-
-/*********************************************************************
-Centroid: Calculates the centroid (xCentroid, yCentroid) 
-of a polygon, given its vertices (x[0], y[0]) ... (x[n-1], y[n-1]). It
-is assumed that the contour is closed, i.e., that the vertex following
-(x[n-1], y[n-1]) is (x[0], y[0]).  
-
-**********************************************************************/
-
-TeCoord2D
-TeFindBaricenter ( const TeLinearRing& ring )
-{
-
-    double ai, atmp = 0, xtmp = 0, ytmp = 0;
-         
-    int n = ring.size() - 1; // our polygons wrap around
-	int i, j;
-
-    if (n < 3) return TeCoord2D (0., 0.);
-
-	for ( i = n-1, j = 0; j < n; i = j, j++)
- 	{
- 	  	ai = ring[i].x() * ring[j].y() - ring[j].x() * ring[i].y();
-	  	atmp += ai;
-	  	xtmp += (ring[j].x() + ring[i].x()) * ai;
-	  	ytmp += (ring[j].y() + ring[i].y()) * ai;
-	}
-
-    if (atmp != 0)
-	{
-		return TeCoord2D ( (xtmp / (3. * atmp)), ( ytmp / (3. * atmp)));
-	}
-	return TeCoord2D ( 0., 0. );
-}
-
-
-
-//
-//	TeFindCentroidConcavePolygon 
-//
-//  This algorithm is based on the idea of a plane-sweep
-//
-//  1. Divide the box into horizontal slices
-//
-//  2. Sweep the plane, starting from the bottom
-//
-//  3. For each y-slice, find the horizontal intersections in the 
-//     forward direction (if it exists)
-//
-//  4. Sort these intersections
-//
-//  5. Order the intersections 
-//
-//  6. For all possible "intersections", select a mid-point and
-//     test if this point is inside the polygon
-//
-//  7. If a centroid has not been found, cut the box into
-//     "smaller" slices and repeat steps 2-6
-
-
-
-// Defines a function object for sorting coordinates in ascending x-order
- 
-struct x_order : public binary_function<TeCoord2D, TeCoord2D, bool>
-{
-        bool operator()(TeCoord2D& pt1, TeCoord2D& pt2) { return pt1.x() < pt2.x(); }
-};
-
-// Defines a distance measure between two Coordinate pairs (used for sorting)
-
-struct x_dist : public binary_function<TeCoordPair, TeCoordPair, bool>
-{
-		bool operator()(TeCoordPair c1, TeCoordPair c2)
-		{
-			return ( ( c1.pt2.x() - c1.pt1.x() ) > ( c2.pt2.x() - c2.pt1.x() ) ); 
-		}
-};
-
-
-typedef vector<double> doubleVect;
-
-TeCoord2D
-TeFindCentroidConcavePolygon ( const TePolygon& poly )
-{
-
-	TeLinearRing coords = poly[0];
-
-	TeBox box = coords.box();
-
-	int NSLICES = 10;
-
-	int NMAXSLICES = 400;
-
-	double yinit = box.lowerLeft().y();
-		
-	while ( true )
-	{
-		int nparts = NSLICES + 2; // divide the box into slices
-
-		double increm = ( box.upperRight().y() - box.lowerLeft().y() ) / nparts; // y-increment
-
-		double yslice = yinit; // start at the bottom
-
-		TeCoordPairVect intersecList;  //vector of horizontal intersections
-
-		doubleVect crossList; //vector of x-crossings
-
-		for ( int i = 0; i < NSLICES; i++ )
-		{
-			yslice += increm; //next slice
-
-			for (unsigned int x = 0; x < ( coords.size() - 1 ); x++ )
-				TeCoord2D cd= coords[x];
-
-			for  (unsigned int j = 0;  j < ( coords.size() - 1 ); j++ ) 		
-			{
-
-				TeCoord2D vtx0 = coords[j];
-				TeCoord2D vtx1 = coords[j+1];
-
-				bool yflag0 = ( vtx0.y() >= yslice );
-				bool yflag1 = ( vtx1.y() >= yslice ) ;
-				/* check if endpoints straddle (are on opposite sides) of X axis
-				* (i.e. the Y's differ); if so, +X ray could intersect this edge.
-				*/
-
-				if ( yflag0 != yflag1 )
-				{
-					// line crosses ring horizontally 
-
-					double slope =  ( vtx1.x() - vtx0.x() ) / ( vtx1.y() - vtx0.y());
-					double xcross = ( yslice -   vtx0.y() )* slope + vtx0.x();
-			
-					crossList.push_back ( xcross );	
-				}
-
-			}
-
-			// Sort the x-intersections
-
-			sort ( crossList.begin(), crossList.end() );
-
-			doubleVect::iterator it = crossList.begin();
-			
-			// Create a list of intersection points
-
-			while ( it != crossList.end() )
-			{
-				TeCoordPair cp;
-
-				cp.pt1 = TeCoord2D ( (*it), yslice );
-				++it;
-				if ( it == crossList.end() ) break;
-
-				cp.pt2 = TeCoord2D ( (*it), yslice );
-				++it;
-
-				intersecList.push_back ( cp );
-			}
-					
-		} // for all slices
-
-		// Now sort all the intersections
-
-		sort ( intersecList.begin(), intersecList.end(), x_dist() );
-
-		// Go through the intersection list
-		// Find the mid-point
-
-		TeCoordPairVect::iterator it = intersecList.begin();
-		
-		while ( it != intersecList.end() )
-		{
-			double xmid = (*it).pt1.x() + ( (*it).pt2.x() - (*it).pt1.x() ) / 2;
-
-			TeCoord2D pt ( xmid, (*it).pt2.y() );
-
-
-			if ( TeWithin (TePoint(pt), poly) ) // have we found it ???
-				return pt;
-
-			++it;  // try the next largest x-intersection
-		}
-
-		NSLICES *= 2;  // double the number of slices
-
-		// iterate until a maximum number of slices
-		// if not able to find a centroid, log an error, but don't stop
-		if ( NSLICES > NMAXSLICES ) 
-		{
-			string userText = "Polygon number " + poly.geomId ();
-
-			TeErrorLog::instance().insert ( CENTROID_NOT_FOUND, userText );
-
-			return TeCoord2D ( TeMAXFLOAT, TeMAXFLOAT );
-		}
-	}
-
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <vector>
+#include <functional>
+#include <algorithm>
+
+#include "TeAssertions.h"
+#include "TeException.h"
+#include "TeGeometryAlgorithms.h"
+
+using namespace std;
+
+
+// Prototypes for internal routines - NOT seen from the outside
+
+TeCoord2D TeFindBaricenter (const TeLinearRing& ring ); // general method ( solves most cases)
+TeCoord2D TeFindCentroidConcavePolygon (const TePolygon& poly ); // brute-force approach (use if above fails)
+
+TeCoord2D
+TeFindCentroid(TeMultiGeometry& mGeom )
+{
+	TeBox bb;
+	TeCoord2D ct;
+	if(mGeom.hasPolygons())
+	{
+		ct = TeFindCentroid(mGeom.getPolygons());
+		updateBox(bb,ct);
+	}
+	if(mGeom.hasCells())
+	{
+		ct = TeFindCentroid(mGeom.getCells());
+		updateBox(bb,ct);
+	}
+	if(mGeom.hasLines())
+	{
+		ct = TeFindCentroid(mGeom.getLines());
+		updateBox(bb,ct);
+	}
+	else if(mGeom.hasPoints())
+	{
+		ct = TeFindCentroid(mGeom.getPoints());
+		updateBox(bb,ct);
+	}
+	return bb.center();
+}
+
+TeCoord2D
+TeFindCentroid(const TePolygon& poly )
+{
+	// This is a two-step algorithm
+
+	// First, try a simple geometric solution
+	// that works for convex polygons and some concave ones
+
+	TeCoord2D pt = TeFindBaricenter( poly[0] );
+
+	if ( TeWithin ( TePoint(pt), poly) )
+		return pt;
+	
+	// No, try a more general approach
+
+	pt = TeFindCentroidConcavePolygon( poly );
+
+return pt;
+}
+
+TeCoord2D
+TeFindCentroid (const TeLine2D& line )
+{
+	int midpoint = (line.size()/2) - 1 ;
+	TeCoord2D middle;
+	
+	TeGetMiddlePoint(line[midpoint], line[midpoint+1], middle);
+	return middle;
+}
+
+TeCoord2D 
+TeFindCentroid(const TeCell& c) 
+{
+	return c.box().center();
+}
+
+TeCoord2D 
+TeFindCentroid(const TePoint& p) 
+{
+	return p.location();
+}
+
+TeCoord2D 
+TeFindCentroid(const TeText& t) 
+{
+	return t.location();
+}
+
+TeCoord2D 
+TeFindCentroid(const TePolygonSet& s)
+{
+	TeCoord2D p;
+	if (s.empty())
+		return p;
+	double sx = 0.0;
+	double sy = 0.0;
+	unsigned int n = 0;
+
+	TeBox bb = s.box();
+	TePolygonSet::iterator it1 = s.begin(); 
+	while (it1 != s.end())
+	{
+		TeCoord2D p1 = TeFindCentroid (*it1);
+		sx += p1.x();
+		sy += p1.y();
+		++n;
+		++it1;
+	}
+	double ssx = sx/n;
+	double ssy = sy/n;
+	p.setXY(ssx,ssy);
+	return p;
+}
+
+
+TeCoord2D 
+TeFindCentroid(const TeLineSet& s)
+{
+	TeCoord2D p;
+	if (s.empty())
+		return p;
+	double sx = 0.0;
+	double sy = 0.0;
+	unsigned int n = 0;
+	TeLineSet::iterator it1 = s.begin(); 
+	while (it1 != s.end())
+	{
+		TeCoord2D p1 = TeFindCentroid (*it1);
+		sx += p1.x();
+		sy += p1.y();
+		++n;
+		it1++;
+	}
+	sx = sx/n;
+	sy = sy/n;
+	p.setXY(sx,sy);
+	return p;
+}
+
+
+TeCoord2D 
+TeFindCentroid(const TeCellSet& s)
+{
+	TeCoord2D p;
+	if (s.empty())
+		return p;
+	double sx = 0.0;
+	double sy = 0.0;
+	unsigned int n = 0;
+	TeCellSet::iterator it1 = s.begin(); 
+	while (it1 != s.end())
+	{
+		TeCoord2D p1 = TeFindCentroid (*it1);
+		sx += p1.x();
+		sy += p1.y();
+		++n;
+		it1++;
+	}
+	sx = sx/n;
+	sy = sy/n;
+	p.setXY(sx,sy);
+	return p;
+}
+
+TeCoord2D 
+TeFindCentroid(TePointSet& points)
+{
+	TeCoord2D p;
+	if (points.empty())
+		return p;
+	if (points.size() == 1)
+		p = (points[0]).location();
+	else
+		p = points.box().center();
+	return p;
+}
+
+TeCoord2D 
+TeFindCentroid(TeTextSet& texts)
+{
+	return texts.box().center();
+}
+/*
+ * ANSI C++ code from the article
+ * "Centroid of a Polygon"
+ * by Gerard Bashein and Paul R. Detmer,
+ * in "Graphics Gems IV", Academic Press, 1994
+ */
+
+/*********************************************************************
+Centroid: Calculates the centroid (xCentroid, yCentroid) 
+of a polygon, given its vertices (x[0], y[0]) ... (x[n-1], y[n-1]). It
+is assumed that the contour is closed, i.e., that the vertex following
+(x[n-1], y[n-1]) is (x[0], y[0]).  
+
+**********************************************************************/
+
+TeCoord2D
+TeFindBaricenter ( const TeLinearRing& ring )
+{
+
+    double ai, atmp = 0, xtmp = 0, ytmp = 0;
+         
+    int n = ring.size() - 1; // our polygons wrap around
+	int i, j;
+
+    if (n < 3) return TeCoord2D (0., 0.);
+
+	for ( i = n-1, j = 0; j < n; i = j, j++)
+ 	{
+ 	  	ai = ring[i].x() * ring[j].y() - ring[j].x() * ring[i].y();
+	  	atmp += ai;
+	  	xtmp += (ring[j].x() + ring[i].x()) * ai;
+	  	ytmp += (ring[j].y() + ring[i].y()) * ai;
+	}
+
+    if (atmp != 0)
+	{
+		return TeCoord2D ( (xtmp / (3. * atmp)), ( ytmp / (3. * atmp)));
+	}
+	return TeCoord2D ( 0., 0. );
+}
+
+
+
+//
+//	TeFindCentroidConcavePolygon 
+//
+//  This algorithm is based on the idea of a plane-sweep
+//
+//  1. Divide the box into horizontal slices
+//
+//  2. Sweep the plane, starting from the bottom
+//
+//  3. For each y-slice, find the horizontal intersections in the 
+//     forward direction (if it exists)
+//
+//  4. Sort these intersections
+//
+//  5. Order the intersections 
+//
+//  6. For all possible "intersections", select a mid-point and
+//     test if this point is inside the polygon
+//
+//  7. If a centroid has not been found, cut the box into
+//     "smaller" slices and repeat steps 2-6
+
+
+
+// Defines a function object for sorting coordinates in ascending x-order
+ 
+struct x_order : public binary_function<TeCoord2D, TeCoord2D, bool>
+{
+        bool operator()(TeCoord2D& pt1, TeCoord2D& pt2) { return pt1.x() < pt2.x(); }
+};
+
+// Defines a distance measure between two Coordinate pairs (used for sorting)
+
+struct x_dist : public binary_function<TeCoordPair, TeCoordPair, bool>
+{
+		bool operator()(TeCoordPair c1, TeCoordPair c2)
+		{
+			return ( ( c1.pt2.x() - c1.pt1.x() ) > ( c2.pt2.x() - c2.pt1.x() ) ); 
+		}
+};
+
+
+typedef vector<double> doubleVect;
+
+TeCoord2D
+TeFindCentroidConcavePolygon ( const TePolygon& poly )
+{
+
+	TeLinearRing coords = poly[0];
+
+	TeBox box = coords.box();
+
+	int NSLICES = 10;
+
+	int NMAXSLICES = 400;
+
+	double yinit = box.lowerLeft().y();
+		
+	while ( true )
+	{
+		int nparts = NSLICES + 2; // divide the box into slices
+
+		double increm = ( box.upperRight().y() - box.lowerLeft().y() ) / nparts; // y-increment
+
+		double yslice = yinit; // start at the bottom
+
+		TeCoordPairVect intersecList;  //vector of horizontal intersections
+
+		doubleVect crossList; //vector of x-crossings
+
+		for ( int i = 0; i < NSLICES; i++ )
+		{
+			yslice += increm; //next slice
+
+			for (unsigned int x = 0; x < ( coords.size() - 1 ); x++ )
+				TeCoord2D cd= coords[x];
+
+			for  (unsigned int j = 0;  j < ( coords.size() - 1 ); j++ ) 		
+			{
+
+				TeCoord2D vtx0 = coords[j];
+				TeCoord2D vtx1 = coords[j+1];
+
+				bool yflag0 = ( vtx0.y() >= yslice );
+				bool yflag1 = ( vtx1.y() >= yslice ) ;
+				/* check if endpoints straddle (are on opposite sides) of X axis
+				* (i.e. the Y's differ); if so, +X ray could intersect this edge.
+				*/
+
+				if ( yflag0 != yflag1 )
+				{
+					// line crosses ring horizontally 
+
+					double slope =  ( vtx1.x() - vtx0.x() ) / ( vtx1.y() - vtx0.y());
+					double xcross = ( yslice -   vtx0.y() )* slope + vtx0.x();
+			
+					crossList.push_back ( xcross );	
+				}
+
+			}
+
+			// Sort the x-intersections
+
+			sort ( crossList.begin(), crossList.end() );
+
+			doubleVect::iterator it = crossList.begin();
+			
+			// Create a list of intersection points
+
+			while ( it != crossList.end() )
+			{
+				TeCoordPair cp;
+
+				cp.pt1 = TeCoord2D ( (*it), yslice );
+				++it;
+				if ( it == crossList.end() ) break;
+
+				cp.pt2 = TeCoord2D ( (*it), yslice );
+				++it;
+
+				intersecList.push_back ( cp );
+			}
+					
+		} // for all slices
+
+		// Now sort all the intersections
+
+		sort ( intersecList.begin(), intersecList.end(), x_dist() );
+
+		// Go through the intersection list
+		// Find the mid-point
+
+		TeCoordPairVect::iterator it = intersecList.begin();
+		
+		while ( it != intersecList.end() )
+		{
+			double xmid = (*it).pt1.x() + ( (*it).pt2.x() - (*it).pt1.x() ) / 2;
+
+			TeCoord2D pt ( xmid, (*it).pt2.y() );
+
+
+			if ( TeWithin (TePoint(pt), poly) ) // have we found it ???
+				return pt;
+
+			++it;  // try the next largest x-intersection
+		}
+
+		NSLICES *= 2;  // double the number of slices
+
+		// iterate until a maximum number of slices
+		// if not able to find a centroid, log an error, but don't stop
+		if ( NSLICES > NMAXSLICES ) 
+		{
+			string userText = "Polygon number " + poly.geomId ();
+
+			TeErrorLog::instance().insert ( CENTROID_NOT_FOUND, userText );
+
+			return TeCoord2D ( TeMAXFLOAT, TeMAXFLOAT );
+		}
+	}
+
+}
+
+
diff --git a/src/terralib/kernel/TeCommunicator.h b/src/terralib/kernel/TeCommunicator.h
old mode 100755
new mode 100644
index 7b3916d..68d41b5
--- a/src/terralib/kernel/TeCommunicator.h
+++ b/src/terralib/kernel/TeCommunicator.h
@@ -1,413 +1,409 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeCommunicator.h
-    \brief This file contains  class to deal with inter-class communication.
-	\author Emiliano F. Castejon <castejon at dpi.inpe.br>
-*/
-
-#ifndef TECOMMUNICATOR_H
-  #define TECOMMUNICATOR_H
-  
-  #include "TeMutex.h"
-  #include "TeAgnostic.h"
-
-  #include <list>
-  #include <algorithm>
-  
-  /**
-   * @brief A macro for use when declaring class wrapper functions that will
-   * be connected to a TeCommunicator instance.
-   *
-   * @param function_name The function name.
-   * @param param_type The function pamrameter data type.
-   * @param class_name The function's host class name.
-   * @note The function body must be implemented.
-   */
-  #define TECOMMWRAPPER( function_name, param_type, class_name ) \
-    protected : void function_name( const param_type& x ); \
-    public : static void function_name( const param_type& x, void* objptr ) \
-    { \
-      class_name * casted_ptr = ( class_name * ) objptr; \
-      casted_ptr->function_name( x ); \
-    };
-    
-  /**
-   * @brief This is the template class to deal with inter-class communication.
-   * @note This is a thread-safe class.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup Utils
-   */
-  template< typename DataType >
-  class TeCommunicator 
-  {
-    public :
-    
-      /**
-       * @brief The objects wrapper function pointer.
-       *
-       * @param DataType The data type.
-       * @param void A cast pointer to the active object instance.
-       */        
-      typedef void (*WrapperFuncPtrT)( const DataType&, void* );
-            
-      /**
-       * @brief Default Constructor.
-       *
-       * @param host_obj_ptr A pointer to the active class instance.
-       * @param wrapper_func_ptr A pointer to the class wrapper static
-       * function.
-       * @param enabled_flag The emission/reception enabling/disabling flag.
-       */
-      TeCommunicator( void* host_obj_ptr = 0,
-        WrapperFuncPtrT wrapper_func_ptr = 0,
-        bool enabled_flag = true );
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TeCommunicator();
-      
-      /**
-       * @brief Connects the current instance to a class wrapper function.
-       *
-       * @param host_obj_ptr A pointer to the active class instance.
-       * @param wrapper_func_ptr A pointer to the class wrapper static
-       * function.
-       */      
-      void setHostObj( void* host_obj_ptr = 0, 
-        WrapperFuncPtrT wrapper_func_ptr = 0 );
-      
-      /**
-       * @brief Connects the current instance to another active instance.
-       *
-       * @param external The external active instance reference.
-       * @return true if OK, false on errors.
-       */         
-      bool connect( TeCommunicator< DataType>& external );
-      
-      /**
-       * @brief Disconnects the current instance from all connected instances.
-       */         
-      void disconnect();
-      
-      /**
-       * @brief Disconnects the current instance from another instance.
-       *
-       * @param external The external active instance reference.
-       */        
-      void disconnect( TeCommunicator< DataType>& external );
-      
-      /**
-       * @brief Send data to all connected instances.
-       *
-       * @param data The data to be sent.
-       */        
-      void send( const DataType& data ) const;
-      
-      /**
-       * @brief Enables/disables the data emission and rececption.
-       *
-       * @param enabled_flag The emission/reception enabling/disabling flag.
-       */        
-      void toggle( bool enabled_flag );      
-      
-      /**
-       * @brief Check if this instance emission/reception is enabled.
-       * @return true if enabled, false if disabled.
-       */        
-      bool isEnabled();          
-      
-    protected :
-      
-      /** @typedef TeCommunicator< DataType >* ComPtrT
-       *  Communicator pointer type definition.
-       */
-      typedef TeCommunicator< DataType >* ComPtrT;
-      
-      /** @typedef std::list< ComPtrT > ContainerT
-       *  Connected communicators pointers container type definition.
-       */ 
-      typedef std::list< ComPtrT > ContainerT;
-      
-      /** @typedef typename ContainerT::iterator ContItT
-       *  Connected communicators pointers container iterator type definition.
-       */       
-      typedef typename ContainerT::iterator ContItT;      
-      
-      /**
-       * @brief Used when another active instance requests to be connected to this
-       * instance.
-       *
-       * @param my_pointer The pointer of the active instance.
-       */       
-      void ConnectMe( ComPtrT my_pointer );
-      
-      /**
-       * @brief Used when another active instance requests to be disconnected from 
-       * this instance.
-       *
-       * @param my_pointer The pointer of the active instance.
-       */       
-      void DisconnectMe( ComPtrT my_pointer );
-      
-      /**
-       * @brief Used when another active instance sends data to this instance.
-       *
-       * @param data The sent data.
-       */        
-      inline void Receive( const DataType& data ) const; 
-      
-    private :
-    
-      /**
-       * @brief A flag indication for enabled/disabled.
-       */     
-      bool emission_reception_enabled_;
-    
-      /**
-       * @brief A pointer to the host object wrapper function.
-       */      
-      WrapperFuncPtrT wrapper_func_ptr_;
-      
-      /**
-       * @brief A pointer to the host object active instance.
-       */
-      void* host_obj_ptr_;
-      
-      /**
-       * @brief A list of pointers to the connected active instances.
-       */
-      mutable ContainerT connections_;
-      
-      /** @brief Thread lock instance. */
-      mutable TeMutex lock_instance_;      
-      
-      /**
-       * @brief Copy constructor not allowed.
-       */
-      TeCommunicator( const TeCommunicator< DataType >& ) {};
-      
-      /**
-       * @brief Copy operation not allowed.
-       */
-      const TeCommunicator< DataType >& operator=( 
-        const TeCommunicator< DataType >& ) {};
-      
-  };
-  
-
-  template< typename DataType >  
-  TeCommunicator< DataType >::TeCommunicator( void* host_obj_ptr,
-    WrapperFuncPtrT wrapper_func_ptr, bool enabled_flag )
-  {
-    wrapper_func_ptr_ = 0;
-    host_obj_ptr_ = 0;
-    emission_reception_enabled_ = enabled_flag;
-    
-    setHostObj( host_obj_ptr, wrapper_func_ptr );
-  }
-  
-  
-  template< typename DataType >  
-  TeCommunicator< DataType >::~TeCommunicator()
-  {
-    disconnect();
-  }
-  
-  
-  template< typename DataType >  
-  void TeCommunicator< DataType >::setHostObj( void* host_obj_ptr,
-    WrapperFuncPtrT wrapper_func_ptr )
-  {
-    lock_instance_.lock();
-    
-//   TEAGN_TRUE_OR_THROW( (wrapper_func_ptr != 0), 
-//      ( ( wrapper_func_ptr == 0 ) && ( host_obj_ptr == 0 ) ) || 
-//      ( ( wrapper_func_ptr != 0 ) && ( host_obj_ptr != 0 ) ) ), 
-//      "Invalid receiver_func_ptr/host_obj_ptr parameters" );
-      
-    wrapper_func_ptr_ = wrapper_func_ptr;
-    host_obj_ptr_ = host_obj_ptr;
-    
-    lock_instance_.unLock();
-  }
-  
-  
-  template< typename DataType >
-  bool TeCommunicator< DataType >::connect( 
-    TeCommunicator< DataType>& external )
-  {
-    lock_instance_.lock();
-    
-//    if( ( wrapper_func_ptr_ == 0 ) || ( host_obj_ptr_ == 0 ) ) {
-	  if( wrapper_func_ptr_ == 0 ) {
-      lock_instance_.unLock();
-      
-      TEAGN_LOGERR( "Connecting a inactive communicator instance" );
-      
-      return false;
-    }
-    
-    ContItT it = find( connections_.begin(), connections_.end(),
-      &external );
-
-    if( it == connections_.end() ) {
-      connections_.push_back( &external );
-      external.ConnectMe( this );
-    }
-    
-    lock_instance_.unLock();
-    
-    return true;
-  }
-  
-
-  template< typename DataType >
-  void TeCommunicator< DataType >::disconnect()
-  {
-    lock_instance_.lock();
-    
-    ContItT it = connections_.begin();
-    ContItT it_end = connections_.end();
-
-    while( it != it_end ) {
-      (*it)->DisconnectMe( this );
-      
-      ++it;
-    }
-    
-    connections_.clear();
-    
-    lock_instance_.unLock();
-  }
-  
-  
-  template< typename DataType >
-  void TeCommunicator< DataType >::disconnect( 
-    TeCommunicator< DataType>& external )
-  {
-    lock_instance_.lock();
-    
-    ContItT it = find( connections_.begin(), connections_.end(),
-      &external );
-      
-    if( it != connections_.end() ) {
-      (*it)->DisconnectMe( this );
-      connections_.erase( it );
-    }
-    
-    lock_instance_.unLock();
-  }
-
-  
-  template< typename DataType >
-  void TeCommunicator< DataType >::ConnectMe( 
-    ComPtrT my_pointer )
-  {
-    lock_instance_.lock();
-    
-    ContItT it = find( connections_.begin(), connections_.end(),
-      my_pointer );
-      
-    if( it == connections_.end() ) {
-      connections_.push_back( my_pointer );
-    }
-    
-    lock_instance_.unLock();
-  }
-
-  
-  template< typename DataType >
-  void TeCommunicator< DataType >::DisconnectMe( 
-    ComPtrT my_pointer )
-  {
-    lock_instance_.lock();
-    
-    ContItT it = find( connections_.begin(), connections_.end(),
-      my_pointer );
-      
-    if( it != connections_.end() ) {
-      connections_.erase( it );
-    }
-    
-    lock_instance_.unLock();
-  }
-  
-  
-  template< typename DataType >
-  void  TeCommunicator< DataType >::send( const DataType& data ) const
-  {
-    lock_instance_.lock();
-    
-    if( emission_reception_enabled_ ) {
-      ContItT it = connections_.begin();
-      ContItT it_end = connections_.end();
-      
-      while( it != it_end ) {
-        (*it)->Receive( data );
-        
-        ++it;  
-      }
-    }
-    
-    lock_instance_.unLock();
-  }
-  
-  
-  template< typename DataType >
-  void  TeCommunicator< DataType >::toggle( bool enabled_flag )
-  {
-    lock_instance_.lock();
-    
-    emission_reception_enabled_ = enabled_flag;
-    
-    lock_instance_.unLock();
-  }
-  
-  
-  template< typename DataType >
-  bool TeCommunicator< DataType >::isEnabled()
-  {
-    return emission_reception_enabled_;
-  }  
-
-  
-  template< typename DataType >
-  inline void  TeCommunicator< DataType >::Receive( 
-    const DataType& data ) const
-  {
-    lock_instance_.lock();
-    
-    if( emission_reception_enabled_ && ( wrapper_func_ptr_ != 0 ) ) {
-      wrapper_func_ptr_( data, host_obj_ptr_ );
-    }
-    
-    lock_instance_.unLock();
-  }
-  
-/** @example TeCommunicator_test.cpp
- *    Shows how to use this class.
- */  
-    
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeCommunicator.h
+    \brief This file contains  class to deal with inter-class communication.
+	\author Emiliano F. Castejon <castejon at dpi.inpe.br>
+*/
+
+#ifndef TECOMMUNICATOR_H
+  #define TECOMMUNICATOR_H
+  
+  #include "TeMutex.h"
+  #include "TeAgnostic.h"
+
+  #include <list>
+  #include <algorithm>
+  
+  /**
+   * @brief A macro for use when declaring class wrapper functions that will
+   * be connected to a TeCommunicator instance.
+   *
+   * @param function_name The function name.
+   * @param param_type The function pamrameter data type.
+   * @param class_name The function's host class name.
+   * @note The function body must be implemented.
+   */
+  #define TECOMMWRAPPER( function_name, param_type, class_name ) \
+    protected : void function_name( const param_type& x ); \
+    public : static void function_name( const param_type& x, void* objptr ) \
+    { \
+      class_name * casted_ptr = ( class_name * ) objptr; \
+      casted_ptr->function_name( x ); \
+    };
+    
+  /**
+   * @class TeCommunicator
+   * @brief This is the template class to deal with inter-class communication.
+   * @note This is a thread-safe class.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup Utils
+   * @example TeCommunicator_test.cpp Shows how to use this class.
+   */
+  template< typename DataType >
+  class TeCommunicator 
+  {
+    public :
+    
+      /**
+       * @brief The objects wrapper function pointer.
+       *
+       * @param DataType The data type.
+       * @param void A cast pointer to the active object instance.
+       */        
+      typedef void (*WrapperFuncPtrT)( const DataType&, void* );
+            
+      /**
+       * @brief Default Constructor.
+       *
+       * @param host_obj_ptr A pointer to the active class instance.
+       * @param wrapper_func_ptr A pointer to the class wrapper static
+       * function.
+       * @param enabled_flag The emission/reception enabling/disabling flag.
+       */
+      TeCommunicator( void* host_obj_ptr = 0,
+        WrapperFuncPtrT wrapper_func_ptr = 0,
+        bool enabled_flag = true );
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TeCommunicator();
+      
+      /**
+       * @brief Connects the current instance to a class wrapper function.
+       *
+       * @param host_obj_ptr A pointer to the active class instance.
+       * @param wrapper_func_ptr A pointer to the class wrapper static
+       * function.
+       */      
+      void setHostObj( void* host_obj_ptr = 0, 
+        WrapperFuncPtrT wrapper_func_ptr = 0 );
+      
+      /**
+       * @brief Connects the current instance to another active instance.
+       *
+       * @param external The external active instance reference.
+       * @return true if OK, false on errors.
+       */         
+      bool connect( TeCommunicator< DataType>& external );
+      
+      /**
+       * @brief Disconnects the current instance from all connected instances.
+       */         
+      void disconnect();
+      
+      /**
+       * @brief Disconnects the current instance from another instance.
+       *
+       * @param external The external active instance reference.
+       */        
+      void disconnect( TeCommunicator< DataType>& external );
+      
+      /**
+       * @brief Send data to all connected instances.
+       *
+       * @param data The data to be sent.
+       */        
+      void send( const DataType& data ) const;
+      
+      /**
+       * @brief Enables/disables the data emission and rececption.
+       *
+       * @param enabled_flag The emission/reception enabling/disabling flag.
+       */        
+      void toggle( bool enabled_flag );      
+      
+      /**
+       * @brief Check if this instance emission/reception is enabled.
+       * @return true if enabled, false if disabled.
+       */        
+      bool isEnabled();          
+      
+    protected :
+      
+      /** @typedef TeCommunicator< DataType >* ComPtrT
+       *  Communicator pointer type definition.
+       */
+      typedef TeCommunicator< DataType >* ComPtrT;
+      
+      /** @typedef std::list< ComPtrT > ContainerT
+       *  Connected communicators pointers container type definition.
+       */ 
+      typedef std::list< ComPtrT > ContainerT;
+      
+      /** @typedef typename ContainerT::iterator ContItT
+       *  Connected communicators pointers container iterator type definition.
+       */       
+      typedef typename ContainerT::iterator ContItT;      
+      
+      /**
+       * @brief Used when another active instance requests to be connected to this
+       * instance.
+       *
+       * @param my_pointer The pointer of the active instance.
+       */       
+      void ConnectMe( ComPtrT my_pointer );
+      
+      /**
+       * @brief Used when another active instance requests to be disconnected from 
+       * this instance.
+       *
+       * @param my_pointer The pointer of the active instance.
+       */       
+      void DisconnectMe( ComPtrT my_pointer );
+      
+      /**
+       * @brief Used when another active instance sends data to this instance.
+       *
+       * @param data The sent data.
+       */        
+      inline void Receive( const DataType& data ) const; 
+      
+    private :
+    
+      /**
+       * @brief A flag indication for enabled/disabled.
+       */     
+      bool emission_reception_enabled_;
+    
+      /**
+       * @brief A pointer to the host object wrapper function.
+       */      
+      WrapperFuncPtrT wrapper_func_ptr_;
+      
+      /**
+       * @brief A pointer to the host object active instance.
+       */
+      void* host_obj_ptr_;
+      
+      /**
+       * @brief A list of pointers to the connected active instances.
+       */
+      mutable ContainerT connections_;
+      
+      /** @brief Thread lock instance. */
+      mutable TeMutex lock_instance_;      
+      
+      /**
+       * @brief Copy constructor not allowed.
+       */
+      TeCommunicator( const TeCommunicator< DataType >& ) {};
+      
+      /**
+       * @brief Copy operation not allowed.
+       */
+      const TeCommunicator< DataType >& operator=( 
+        const TeCommunicator< DataType >& ) {};
+      
+  };
+  
+
+  template< typename DataType >  
+  TeCommunicator< DataType >::TeCommunicator( void* host_obj_ptr,
+    WrapperFuncPtrT wrapper_func_ptr, bool enabled_flag )
+  {
+    wrapper_func_ptr_ = 0;
+    host_obj_ptr_ = 0;
+    emission_reception_enabled_ = enabled_flag;
+    
+    setHostObj( host_obj_ptr, wrapper_func_ptr );
+  }
+  
+  
+  template< typename DataType >  
+  TeCommunicator< DataType >::~TeCommunicator()
+  {
+    disconnect();
+  }
+  
+  
+  template< typename DataType >  
+  void TeCommunicator< DataType >::setHostObj( void* host_obj_ptr,
+    WrapperFuncPtrT wrapper_func_ptr )
+  {
+    lock_instance_.lock();
+    
+//   TEAGN_TRUE_OR_THROW( (wrapper_func_ptr != 0), 
+//      ( ( wrapper_func_ptr == 0 ) && ( host_obj_ptr == 0 ) ) || 
+//      ( ( wrapper_func_ptr != 0 ) && ( host_obj_ptr != 0 ) ) ), 
+//      "Invalid receiver_func_ptr/host_obj_ptr parameters" );
+      
+    wrapper_func_ptr_ = wrapper_func_ptr;
+    host_obj_ptr_ = host_obj_ptr;
+    
+    lock_instance_.unLock();
+  }
+  
+  
+  template< typename DataType >
+  bool TeCommunicator< DataType >::connect( 
+    TeCommunicator< DataType>& external )
+  {
+    lock_instance_.lock();
+    
+//    if( ( wrapper_func_ptr_ == 0 ) || ( host_obj_ptr_ == 0 ) ) {
+	  if( wrapper_func_ptr_ == 0 ) {
+      lock_instance_.unLock();
+      
+      TEAGN_LOGERR( "Connecting a inactive communicator instance" );
+      
+      return false;
+    }
+    
+    ContItT it = find( connections_.begin(), connections_.end(),
+      &external );
+
+    if( it == connections_.end() ) {
+      connections_.push_back( &external );
+      external.ConnectMe( this );
+    }
+    
+    lock_instance_.unLock();
+    
+    return true;
+  }
+  
+
+  template< typename DataType >
+  void TeCommunicator< DataType >::disconnect()
+  {
+    lock_instance_.lock();
+    
+    ContItT it = connections_.begin();
+    ContItT it_end = connections_.end();
+
+    while( it != it_end ) {
+      (*it)->DisconnectMe( this );
+      
+      ++it;
+    }
+    
+    connections_.clear();
+    
+    lock_instance_.unLock();
+  }
+  
+  
+  template< typename DataType >
+  void TeCommunicator< DataType >::disconnect( 
+    TeCommunicator< DataType>& external )
+  {
+    lock_instance_.lock();
+    
+    ContItT it = find( connections_.begin(), connections_.end(),
+      &external );
+      
+    if( it != connections_.end() ) {
+      (*it)->DisconnectMe( this );
+      connections_.erase( it );
+    }
+    
+    lock_instance_.unLock();
+  }
+
+  
+  template< typename DataType >
+  void TeCommunicator< DataType >::ConnectMe( 
+    ComPtrT my_pointer )
+  {
+    lock_instance_.lock();
+    
+    ContItT it = find( connections_.begin(), connections_.end(),
+      my_pointer );
+      
+    if( it == connections_.end() ) {
+      connections_.push_back( my_pointer );
+    }
+    
+    lock_instance_.unLock();
+  }
+
+  
+  template< typename DataType >
+  void TeCommunicator< DataType >::DisconnectMe( 
+    ComPtrT my_pointer )
+  {
+    lock_instance_.lock();
+    
+    ContItT it = find( connections_.begin(), connections_.end(),
+      my_pointer );
+      
+    if( it != connections_.end() ) {
+      connections_.erase( it );
+    }
+    
+    lock_instance_.unLock();
+  }
+  
+  
+  template< typename DataType >
+  void  TeCommunicator< DataType >::send( const DataType& data ) const
+  {
+    if( emission_reception_enabled_ )
+    {
+      lock_instance_.lock();
+      
+      ContItT it = connections_.begin();
+      ContItT it_end = connections_.end();
+      
+      while( it != it_end ) {
+        (*it)->Receive( data );
+        
+        ++it;  
+      }
+      
+      lock_instance_.unLock();
+    }
+  }
+  
+  
+  template< typename DataType >
+  void  TeCommunicator< DataType >::toggle( bool enabled_flag )
+  {
+    emission_reception_enabled_ = enabled_flag;
+  }
+  
+  
+  template< typename DataType >
+  bool TeCommunicator< DataType >::isEnabled()
+  {
+    return emission_reception_enabled_;
+  }  
+
+  
+  template< typename DataType >
+  inline void  TeCommunicator< DataType >::Receive( 
+    const DataType& data ) const
+  {
+    if( emission_reception_enabled_ && ( wrapper_func_ptr_ != 0 ) ) 
+    {
+      lock_instance_.lock();
+      
+      wrapper_func_ptr_( data, host_obj_ptr_ );
+      
+      lock_instance_.unLock();
+    }
+  }
+    
+#endif
+
diff --git a/src/terralib/kernel/TeComposite.h b/src/terralib/kernel/TeComposite.h
old mode 100755
new mode 100644
index c946903..6ad4868
--- a/src/terralib/kernel/TeComposite.h
+++ b/src/terralib/kernel/TeComposite.h
@@ -1,184 +1,184 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeComposite.h
-    \brief This file contains definition of composite structures in TerraLib
-*/
-
-#ifndef  __TERRALIB_INTERNAL_COMPOSITE_H
-#define  __TERRALIB_INTERNAL_COMPOSITE_H
-
-#include "TeCounted.h"
-
-#include <vector>
-#include <algorithm>
-using namespace std;
-
-//!  Defines a templated class for handling an object built of one single atomic element
-template <class T>
-class TeSingle
-{
-public:
-	//! Constructor
-	TeSingle<T>() {}
-
-	//! Destructor
-	virtual ~TeSingle<T>() {}
-
-	//! Copy constructor
-	TeSingle<T> ( T& elem ): elem_ ( elem  ) {}
-
-	//! Adds the single element
-	void add ( T& elem )
-	{	elem_ = elem; }
-
-	//! Returns a referency to the single element
-	T&	location ()
-	{	return elem_; }
-
-	//! Returns a constant reference to the single element
-	const T& location() const
-	{
-		return elem_;
-	}
-
-	//! Returns a referency to the single element
-	T&	elem ()
-	{	return elem_; }
-
-protected:
-	T	elem_;	//!< the single element
-
-};
-
-//! Defines a template for handling a composite object
-/*! 
-	Provides a vector for storing components and ensures 
-	proper destruction of them, by means of a handle/body idiom. 
-	Provide a handle to an implementation and thus allow efficient 
-	copying of derived objects
-
-	\note This is a specialised example of the "Composite"
-	design pattern, with support for the "Bridge" pattern
-	(also known as the handle/body idiom).
-*/
-template <class T>
-class TeComposite: public TeCounted
-{
-public:
-	
-	using TeCounted::attach;
-	using TeCounted::detach;
-
-	//! An iterator to the composite elements 
-	typedef typename vector<T>::iterator iterator;
-	typedef typename vector<T>::const_iterator const_iterator;
-
-	//! Adds a new component
-	void add ( const T& elem )
-	{ components_.push_back ( elem ); }
-
-	//! Removes the i-th component
-	bool erase ( unsigned int i )
-	{ 	
-		if ( components_.size() < i )
-			return false;
-		return ! ( components_.erase ( components_.begin() + i ) == components_.end() );
-	}
-
-	//! Removes a specific element 
-	/*!
-		\param elem the element to be removed
-	*/
-	bool erase ( T& elem )
-	{ 
-		typename vector<T>::iterator location = find(components_.begin(),components_.end(), elem);
-		if ( location != components_.end())
-		{
-			components_.erase(location);
-			return true;
-		}
-		else
-			return false; 
-	}
-
-	//! Removes an element pointed by an iterator
-	iterator erase(iterator it)
-	{
-		return components_.erase(it);
-	}
-
-	//! Removes all elements
-	void clear ()
-	{	components_.clear (); }
-
-	//! Returns the size of the composite
-	size_t size() const
-	{ return components_.size(); }
-
-	//! Returns the i-th element
-	T& operator [] ( int i )
-	{ return components_[ i ]; }
-
-	//! Returns TRUE if the composite is empty
-	bool empty() const
-	{ return components_.empty(); }
-
-	//! Reserves space for n elements (reserve is available for vectors)  
-	void reserve(int nelem)
-	{ components_.reserve(nelem); }
-
-	//! Returns an iterator to the composite first element
-	iterator begin(void)
-	{
-		return components_.begin();
-	}
-
-	//! Returns a iterator to the composite last plus one element
-    iterator end(void)
-	{
-		return components_.end();
-	}
-
-	//! A reverse iterator to the composite elements 
-	typedef typename vector<T>::reverse_iterator reverse_iterator;
-
-	//! The iterator to the first position in the TeComposite in reverse order
-	reverse_iterator rbegin(void) 
-	{
-		return components_.rbegin();
-	}
-
-	//! The iterator to the last plus one position in the TeComposite in reverse order
-    reverse_iterator rend(void) 
-	{
-		return components_.rend();
-	}
-
-
-protected:
-	vector<T>	components_; //!< a vector of components
-};
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeComposite.h
+    \brief This file contains definition of composite structures in TerraLib
+*/
+
+#ifndef  __TERRALIB_INTERNAL_COMPOSITE_H
+#define  __TERRALIB_INTERNAL_COMPOSITE_H
+
+#include "TeCounted.h"
+
+#include <vector>
+#include <algorithm>
+using namespace std;
+
+//!  Defines a templated class for handling an object built of one single atomic element
+template <class T>
+class TeSingle
+{
+public:
+	//! Constructor
+	TeSingle<T>() {}
+
+	//! Destructor
+	virtual ~TeSingle<T>() {}
+
+	//! Copy constructor
+	TeSingle<T> ( T& elem ): elem_ ( elem  ) {}
+
+	//! Adds the single element
+	void add ( T& elem )
+	{	elem_ = elem; }
+
+	//! Returns a referency to the single element
+	T&	location ()
+	{	return elem_; }
+
+	//! Returns a constant reference to the single element
+	const T& location() const
+	{
+		return elem_;
+	}
+
+	//! Returns a referency to the single element
+	T&	elem ()
+	{	return elem_; }
+
+protected:
+	T	elem_;	//!< the single element
+
+};
+
+//! Defines a template for handling a composite object
+/*! 
+	Provides a vector for storing components and ensures 
+	proper destruction of them, by means of a handle/body idiom. 
+	Provide a handle to an implementation and thus allow efficient 
+	copying of derived objects
+
+	\note This is a specialised example of the "Composite"
+	design pattern, with support for the "Bridge" pattern
+	(also known as the handle/body idiom).
+*/
+template <class T>
+class TeComposite: public TeCounted
+{
+public:
+	
+	using TeCounted::attach;
+	using TeCounted::detach;
+
+	//! An iterator to the composite elements 
+	typedef typename vector<T>::iterator iterator;
+	typedef typename vector<T>::const_iterator const_iterator;
+
+	//! Adds a new component
+	void add ( const T& elem )
+	{ components_.push_back ( elem ); }
+
+	//! Removes the i-th component
+	bool erase ( unsigned int i )
+	{ 	
+		if ( components_.size() < i )
+			return false;
+		return ! ( components_.erase ( components_.begin() + i ) == components_.end() );
+	}
+
+	//! Removes a specific element 
+	/*!
+		\param elem the element to be removed
+	*/
+	bool erase ( T& elem )
+	{ 
+		typename vector<T>::iterator location = find(components_.begin(),components_.end(), elem);
+		if ( location != components_.end())
+		{
+			components_.erase(location);
+			return true;
+		}
+		else
+			return false; 
+	}
+
+	//! Removes an element pointed by an iterator
+	iterator erase(iterator it)
+	{
+		return components_.erase(it);
+	}
+
+	//! Removes all elements
+	void clear ()
+	{	components_.clear (); }
+
+	//! Returns the size of the composite
+	size_t size() const
+	{ return components_.size(); }
+
+	//! Returns the i-th element
+	T& operator [] ( int i )
+	{ return components_[ i ]; }
+
+	//! Returns TRUE if the composite is empty
+	bool empty() const
+	{ return components_.empty(); }
+
+	//! Reserves space for n elements (reserve is available for vectors)  
+	void reserve(int nelem)
+	{ components_.reserve(nelem); }
+
+	//! Returns an iterator to the composite first element
+	iterator begin(void)
+	{
+		return components_.begin();
+	}
+
+	//! Returns a iterator to the composite last plus one element
+    iterator end(void)
+	{
+		return components_.end();
+	}
+
+	//! A reverse iterator to the composite elements 
+	typedef typename vector<T>::reverse_iterator reverse_iterator;
+
+	//! The iterator to the first position in the TeComposite in reverse order
+	reverse_iterator rbegin(void) 
+	{
+		return components_.rbegin();
+	}
+
+	//! The iterator to the last plus one position in the TeComposite in reverse order
+    reverse_iterator rend(void) 
+	{
+		return components_.rend();
+	}
+
+
+protected:
+	vector<T>	components_; //!< a vector of components
+};
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeComputeAttributeStrategies.cpp b/src/terralib/kernel/TeComputeAttributeStrategies.cpp
old mode 100755
new mode 100644
index e5fe25f..1683866
--- a/src/terralib/kernel/TeComputeAttributeStrategies.cpp
+++ b/src/terralib/kernel/TeComputeAttributeStrategies.cpp
@@ -1,462 +1,462 @@
-
-#include "TeComputeAttributeStrategies.h"
-#include "TeSTElementSet.h"
-#include "TeOverlay.h"
-#include <TeGeometryAlgorithms.h>
-#include <TeSTEFunctionsDB.h>
-#include <TeRaster.h>
-#include <TeQuerier.h>
-#include <TeQuerierParams.h>
-
-using namespace TeOVERLAY;
-
-// For relative values to be weighted in space (e.g., population densitity, malaria per number of inhabitants, etc.)	
-string TeAverageWeighByAreaStrategy::compute (TeBox box)  
-{
-	double weigh_val = 0.0;
-
-	TeQuerier* querier = getWithinGeometry(box, attribute);
-
-    int quant = querier->numElemInstances();			
-	
-	TePolygonSet box_ps, intersect, objGeom;
-	TeSTInstance sti;
-	TePolygon pol = polygonFromBox(box);
-	box_ps.add(pol);
-
-	double areaBox = TeGeometryArea(box);
-	if (areaBox <= 0.0) return Te2String(0);
-
-	for(int i = 0; i < quant; i++)
-	{
-		querier->fetchInstance (sti);
-		objGeom = sti.geometries().getPolygons();
-
-		string val;
-		sti.getPropertyValue(attribute, val);
-		double num_val = atof(val.c_str());
-	
-		TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
-		double intersectArea = TeGeometryArea (intersect);
-		weigh_val += num_val*(intersectArea/areaBox); // suppose objects are disjoint
-	}
-
-	delete querier;
-	return Te2String (weigh_val);
-}
-
-string TeCategoryMajorityStrategy::compute (TeBox box)  
-{
-	map<string, double>  areaMap;
-
-	// initialize areMap
-	map<string, string>::iterator itMap = classesMap.begin();
-	while( itMap != classesMap.end() )
-	{
-		areaMap[(*itMap).second] = 0;
-		++itMap;
-	}
-
-	TeQuerier* querier = getWithinGeometry(box, attribute);
-
-    int quant = querier->numElemInstances();			
-	
-	TePolygonSet box_ps, intersect, objGeom;
-	TeSTInstance sti;
-	TePolygon pol = polygonFromBox(box);
-	box_ps.add(pol);
-
-	for(int i = 0; i < quant; i++)
-	{
-		querier->fetchInstance (sti);
-		objGeom = sti.geometries().getPolygons();
-	
-		string category;
-		sti.getPropertyValue(attribute, category);
-
-		TePolygonSet intersect;
-		TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
-		double intersectArea = TeGeometryArea (intersect);
-		areaMap[classesMap[category]] += intersectArea; // suppose objects are disjoint
-	}
-
-	delete querier;
-
-	double max = 0.0;
-	string value;
-
-	map <string, double>:: iterator it = areaMap.begin();
-	while(it != areaMap.end())  
-	{
-		if ((*it).second > max)
-		{
-			value = (*it).first;
-			max   = (*it).second;
-		}
-		++it;		
-	}
-
-	return value;
-}
-
-
-string TeTotalAreaPercentageStrategy::compute (TeBox box)
-{  
-	double area = TeGeometryArea(box);
-	double totArea = 0.0;
-
-	if (area <= 0.0) return Te2String(0);
-
-	TeQuerier* querier = getWithinGeometry(box);
-    int quant = querier->numElemInstances();			
-	
-	TePolygonSet box_ps, intersect, objGeom;
-	TeSTInstance sti;
-	TePolygon pol = polygonFromBox(box);
-	box_ps.add(pol);
-
-	for(int i = 0; i < quant; i++)
-	{
-		querier->fetchInstance (sti);
-		objGeom = sti.geometries().getPolygons();
-	
-		TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
-			
-		double intersectArea = TeGeometryArea (intersect);
-		totArea += intersectArea; // suppose objects are disjoint
-	}
-	
-	double percentage = totArea/area;
-
-	if (percentage > 0.999) percentage = 1;
-
-	delete querier;
-	return Te2String (percentage);
-}
-
-
-string TeCountObjectsStrategy::compute(TeBox box)
-{
-	TeQuerier* querier = getWithinGeometry(box);
-    int quant = querier->numElemInstances();
-	delete querier;
-	return Te2String (quant);
-}
-
-string TeCountLineObjectsStrategy::compute(TeBox box)
-{
-	TeQuerier* querier = getWithinGeometry(box);
-    int quant = querier->numElemInstances();
-	int found = 0;
-	
-	TePolygonSet box_ps;
-	TeLineSet intersect, objGeom;
-	TeSTInstance sti;
-	TeMultiGeometry mg;
-    TePolygon pol = polygonFromBox(box);
-    box_ps.add(pol);
-
-	for(int i = 0; i < quant; i++)
-	{
-		querier->fetchInstance (sti);
-		objGeom = sti.geometries().getLines();
-
-        TeLineSet intersect;
-        mg = TeOverlay(objGeom, box_ps, TeINTERSECTION);
-
-        intersect = mg.getLines();
-        if(!intersect.empty()) found++;
-	}
-	
-	delete querier;
-	return Te2String (found);
-}
-
-
-string TeCountPolygonalObjectsStrategy::compute(TeBox box)
-{
-	TeQuerier* querier = getWithinGeometry(box);
-    int quant = querier->numElemInstances();
-	int found = 0;
-	
-	TePolygonSet box_ps, intersect, objGeom;
-	TeSTInstance sti;
-    TePolygon pol = polygonFromBox(box);
-    box_ps.add(pol);
-
-	for(int i = 0; i < quant; i++)
-	{
-		querier->fetchInstance (sti);
-		objGeom = sti.geometries().getPolygons();
-	
-		TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
-        if(!intersect.empty()) found++;
-	}
-	
-	delete querier;
-	return Te2String (found);
-}
-
-
-TeQuerier* TeComputeSpatialStrategy::getWithinGeometry(TeBox box, string attribute)
-{
-	vector<string> attrNames;
-	
-	if(attribute != "") attrNames.push_back (attribute);
-    TeQuerierParams params(true, attrNames);
-
-    params.setParams (theme);
-	params.setSpatialRest(box, TeWITHIN, rep);
-    TeQuerier* querier = new TeQuerier(params);
-	querier->loadInstances();
-	return querier;
-}
-
-string TeLineLengthStrategy::compute (TeBox box)
-{
-	double length = 0;
-
-	TeQuerier* querier = getWithinGeometry(box);
-    int quant = querier->numElemInstances();			
-	
-	TePolygonSet box_ps;
-	TeLineSet intersect, objGeom;
-	TeSTInstance sti;
-	TePolygon pol = polygonFromBox(box);
-	box_ps.add(pol);
-
-	for(int i = 0; i < quant; i++)
-	{
-		querier->fetchInstance (sti);
-		objGeom = sti.geometries().getLines();
-        TeMultiGeometry mg;
-					
-		mg = TeOverlay(objGeom, box_ps, TeINTERSECTION);
-				
-		intersect = mg.getLines();
-		for(TeLineSet::iterator lineIt = intersect.begin(); lineIt != intersect.end(); lineIt++)
-		{
-			length += TeLength (*lineIt);
-		}
-	}
-
-	delete querier;
-	return Te2String (length);
-}
-
-// For absolute values to be partinioned in space (e.g., population, number of malaria cases, etc.)	
-string TeSumWeighByAreaStrategy::compute (TeBox box)
-{
-	double weigh_val = 0.0;
-	double area = TeGeometryArea(box);
-
-	if (area <= 0.0) return Te2String(0);
-
-	TeQuerier* querier = getWithinGeometry(box, attribute);
-    int quant = querier->numElemInstances();			
-	
-	TePolygonSet box_ps, intersect, objGeom;
-	TeSTInstance sti;
-	TePolygon pol = polygonFromBox(box);
-	box_ps.add(pol);
-
-	for(int i = 0; i < quant; i++)
-	{
-		querier->fetchInstance (sti);
-		objGeom = sti.geometries().getPolygons();
-	
-		string val;
-		sti.getPropertyValue(attribute, val);
-		double num_val = atof(val.c_str());
-
-		double geomArea = TeGeometryArea (objGeom);
-		if (geomArea > 0.0)
-		{
-			TePolygonSet intersect;
-			TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
-			double intersectArea = TeGeometryArea (intersect);
-			weigh_val += num_val*(intersectArea/geomArea); 
-		}
-	}
-
-	delete querier;
-	return Te2String (weigh_val);
-}
-
-TeMinimumDistanceStrategy::TeMinimumDistanceStrategy(TeTheme* theme_, TeGeomRep rep_, double distError_) 
-: TeComputeSpatialStrategy(theme_, rep_) 
-{ 
-	maxDist = distError_; tree = NULL; 
-}
-
-void TeMinimumDistanceStrategy::CreatePoints(TeCoord2D p1, TeCoord2D p2)
-{
-	double dist = TeDistance(p1, p2);
-	if(dist > maxDist)
-	{
-		TeCoord2D p3;
-
-		TeGetMiddlePoint (p1, p2, p3);
-
-		dataSet.push_back(pair<TeCoord2D, TePoint>(p3, p3));
-		
-		CreatePoints(p1, p3);
-		CreatePoints(p2, p3);
-	}
-}
-
-TeMinimumDistanceLinesStrategy::TeMinimumDistanceLinesStrategy(TeTheme* theme_, double dist_)
-	:TeMinimumDistanceStrategy(theme_, TeLINES, dist_)
-{
-	vector<string> attrNames;
-    TeQuerierParams params(true, attrNames);
-
-    params.setParams (theme);
-    TeQuerier* querier = new TeQuerier(params);
-	querier->loadInstances();
-    int quant = querier->numElemInstances();
-
-    TeSTInstance sti;
-	TeLineSet ls;
-
-    for(int c = 0; c < quant; c++)
-    {
-        querier->fetchInstance (sti);
-        ls = sti.geometries().getLines();
-
-		for(unsigned i = 0; i < ls.size(); i++)
-		{
-			dataSet.push_back(pair<TeCoord2D, TePoint>(ls[i][0], ls[i][0]));
-			for(unsigned j = 1; j < ls[i].size(); j++)
-			{
-				dataSet.push_back(pair<TeCoord2D, TePoint>(ls[i][j], ls[i][j]));
-	
-				TeCoord2D p1 = ls[i][j-1];
-				TeCoord2D p2 = ls[i][j];
-				
-				CreatePoints(p1, p2);
-			}
-		}
-	}
-
-	tree = new KDTREE(theme_->getThemeBox(), 5); // bucketSize == 5
-	tree->build(dataSet);
-	delete querier;
-}
-
-TeMinimumDistancePointsStrategy::TeMinimumDistancePointsStrategy(TeTheme* theme_)
-	:TeMinimumDistanceStrategy(theme_, TePOINTS, 0)
-{
-	vector<string> attrNames;
-    TeQuerierParams params(true, attrNames);
-
-    params.setParams (theme);
-    TeQuerier* querier = new TeQuerier(params);
-	querier->loadInstances();
-    int quant = querier->numElemInstances();
-
-    TeSTInstance sti;
-	TePointSet ps;
-
-    for(int c = 0; c < quant; c++)
-    {
-        querier->fetchInstance (sti);
-        ps = sti.geometries().getPoints();
-
-		for(unsigned i = 0; i < ps.size(); i++)
-		{
-			dataSet.push_back(pair<TeCoord2D, TePoint>(ps[i].location(), ps[i]));
-		}
-	}
-
-	tree = new KDTREE(theme_->getThemeBox(), 5); // bucketSize == 5
-	tree->build(dataSet);
-	delete querier;
-}
-
-TeMinimumDistancePolygonsStrategy::TeMinimumDistancePolygonsStrategy(TeTheme* theme_, double dist_)
-    :TeMinimumDistanceStrategy(theme_, TePOLYGONS, dist_)
-{
-	vector<string> attrNames;
-    TeQuerierParams params(true, attrNames);
-
-    params.setParams (theme);
-    TeQuerier* querier = new TeQuerier(params);
-	querier->loadInstances();
-    int quant = querier->numElemInstances();
-
-    TeSTInstance sti;
-	TePolygonSet ps;
-
-    for(int c = 0; c < quant; c++)
-    {
-        querier->fetchInstance (sti);
-        ps = sti.geometries().getPolygons();
-
-		for(unsigned i = 0; i < ps.size(); i++)
-		{
-			for(unsigned j = 0; j < ps[i].size(); j++)
-			{
-				dataSet.push_back(pair<TeCoord2D, TePoint>(ps[i][j][0], ps[i][j][0]));
-	
-	            for(unsigned k = 1; k < ps[i][j].size(); k++)
-	            {
-					dataSet.push_back(pair<TeCoord2D, TePoint>(ps[i][j][k], ps[i][j][k]));
-					
-					TeCoord2D p1 = ps[i][j][k-1];
-					TeCoord2D p2 = ps[i][j][k];
-					CreatePoints(p1, p2);
-				}
-							
-				TeCoord2D p1 = ps[i][j][0];
-				TeCoord2D p2 = ps[i][j][ps[i][j].size()-1];
-				CreatePoints(p1, p2);
-			}
-		}
-	}
-
-	tree = new KDTREE(theme_->getThemeBox(), 5); // bucketSize == 5
-	tree->build(dataSet);
-	delete querier;
-}
-
-string TeMinimumDistanceStrategy::compute (TeBox box)
-{
-	vector<TePoint> report;
-	vector<double> sqrDists;
-	TeCoord2D c(TeMAXFLOAT, TeMAXFLOAT);
-	TeCoord2D key = box.center();
-	TePoint item(c);
-
-	report.push_back(item);
-
-	tree->nearestNeighborSearch(key, report, sqrDists, 1);
-
-	double dist = sqrt(sqrDists[0]);
-	return Te2String (dist);
-}
-
-string TeMinimumDistancePolygonsStrategy::compute (TeBox box)
-{
-	TeQuerier* querier = getWithinGeometry(box);
-    int quant = querier->numElemInstances();			
-		
-	TePolygonSet box_ps, intersect, objGeom;
-	TeSTInstance sti;
-    TePolygon pol = polygonFromBox(box);
-    box_ps.add(pol);
-
-	for(int i = 0; i < quant; i++)
-	{
-		querier->fetchInstance (sti);
-		objGeom = sti.geometries().getPolygons();
-	
-		TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
-        if(!intersect.empty()) return Te2String (0);
-	}
-	
-	delete querier;
-
-	return TeMinimumDistanceStrategy::compute(box);
-}
-
+
+#include "TeComputeAttributeStrategies.h"
+#include "TeSTElementSet.h"
+#include "TeOverlay.h"
+#include <TeGeometryAlgorithms.h>
+#include <TeSTEFunctionsDB.h>
+#include <TeRaster.h>
+#include <TeQuerier.h>
+#include <TeQuerierParams.h>
+
+using namespace TeOVERLAY;
+
+// For relative values to be weighted in space (e.g., population densitity, malaria per number of inhabitants, etc.)	
+string TeAverageWeighByAreaStrategy::compute (TeBox box)  
+{
+	double weigh_val = 0.0;
+
+	TeQuerier* querier = getWithinGeometry(box, attribute);
+
+    int quant = querier->numElemInstances();			
+	
+	TePolygonSet box_ps, intersect, objGeom;
+	TeSTInstance sti;
+	TePolygon pol = polygonFromBox(box);
+	box_ps.add(pol);
+
+	double areaBox = TeGeometryArea(box);
+	if (areaBox <= 0.0) return Te2String(0);
+
+	for(int i = 0; i < quant; i++)
+	{
+		querier->fetchInstance (sti);
+		objGeom = sti.geometries().getPolygons();
+
+		string val;
+		sti.getPropertyValue(attribute, val);
+		double num_val = atof(val.c_str());
+	
+		TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
+		double intersectArea = TeGeometryArea (intersect);
+		weigh_val += num_val*(intersectArea/areaBox); // suppose objects are disjoint
+	}
+
+	delete querier;
+	return Te2String (weigh_val);
+}
+
+string TeCategoryMajorityStrategy::compute (TeBox box)  
+{
+	map<string, double>  areaMap;
+
+	// initialize areMap
+	map<string, string>::iterator itMap = classesMap.begin();
+	while( itMap != classesMap.end() )
+	{
+		areaMap[(*itMap).second] = 0;
+		++itMap;
+	}
+
+	TeQuerier* querier = getWithinGeometry(box, attribute);
+
+    int quant = querier->numElemInstances();			
+	
+	TePolygonSet box_ps, intersect, objGeom;
+	TeSTInstance sti;
+	TePolygon pol = polygonFromBox(box);
+	box_ps.add(pol);
+
+	for(int i = 0; i < quant; i++)
+	{
+		querier->fetchInstance (sti);
+		objGeom = sti.geometries().getPolygons();
+	
+		string category;
+		sti.getPropertyValue(attribute, category);
+
+		TePolygonSet intersect;
+		TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
+		double intersectArea = TeGeometryArea (intersect);
+		areaMap[classesMap[category]] += intersectArea; // suppose objects are disjoint
+	}
+
+	delete querier;
+
+	double max = 0.0;
+	string value;
+
+	map <string, double>:: iterator it = areaMap.begin();
+	while(it != areaMap.end())  
+	{
+		if ((*it).second > max)
+		{
+			value = (*it).first;
+			max   = (*it).second;
+		}
+		++it;		
+	}
+
+	return value;
+}
+
+
+string TeTotalAreaPercentageStrategy::compute (TeBox box)
+{  
+	double area = TeGeometryArea(box);
+	double totArea = 0.0;
+
+	if (area <= 0.0) return Te2String(0);
+
+	TeQuerier* querier = getWithinGeometry(box);
+    int quant = querier->numElemInstances();			
+	
+	TePolygonSet box_ps, intersect, objGeom;
+	TeSTInstance sti;
+	TePolygon pol = polygonFromBox(box);
+	box_ps.add(pol);
+
+	for(int i = 0; i < quant; i++)
+	{
+		querier->fetchInstance (sti);
+		objGeom = sti.geometries().getPolygons();
+	
+		TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
+			
+		double intersectArea = TeGeometryArea (intersect);
+		totArea += intersectArea; // suppose objects are disjoint
+	}
+	
+	double percentage = totArea/area;
+
+	if (percentage > 0.999) percentage = 1;
+
+	delete querier;
+	return Te2String (percentage);
+}
+
+
+string TeCountObjectsStrategy::compute(TeBox box)
+{
+	TeQuerier* querier = getWithinGeometry(box);
+    int quant = querier->numElemInstances();
+	delete querier;
+	return Te2String (quant);
+}
+
+string TeCountLineObjectsStrategy::compute(TeBox box)
+{
+	TeQuerier* querier = getWithinGeometry(box);
+    int quant = querier->numElemInstances();
+	int found = 0;
+	
+	TePolygonSet box_ps;
+	TeLineSet intersect, objGeom;
+	TeSTInstance sti;
+	TeMultiGeometry mg;
+    TePolygon pol = polygonFromBox(box);
+    box_ps.add(pol);
+
+	for(int i = 0; i < quant; i++)
+	{
+		querier->fetchInstance (sti);
+		objGeom = sti.geometries().getLines();
+
+        TeLineSet intersect;
+        mg = TeOverlay(objGeom, box_ps, TeINTERSECTION);
+
+        intersect = mg.getLines();
+        if(!intersect.empty()) found++;
+	}
+	
+	delete querier;
+	return Te2String (found);
+}
+
+
+string TeCountPolygonalObjectsStrategy::compute(TeBox box)
+{
+	TeQuerier* querier = getWithinGeometry(box);
+    int quant = querier->numElemInstances();
+	int found = 0;
+	
+	TePolygonSet box_ps, intersect, objGeom;
+	TeSTInstance sti;
+    TePolygon pol = polygonFromBox(box);
+    box_ps.add(pol);
+
+	for(int i = 0; i < quant; i++)
+	{
+		querier->fetchInstance (sti);
+		objGeom = sti.geometries().getPolygons();
+	
+		TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
+        if(!intersect.empty()) found++;
+	}
+	
+	delete querier;
+	return Te2String (found);
+}
+
+
+TeQuerier* TeComputeSpatialStrategy::getWithinGeometry(TeBox box, string attribute)
+{
+	vector<string> attrNames;
+	
+	if(attribute != "") attrNames.push_back (attribute);
+    TeQuerierParams params(true, attrNames);
+
+    params.setParams (theme);
+	params.setSpatialRest(box, TeWITHIN, rep);
+    TeQuerier* querier = new TeQuerier(params);
+	querier->loadInstances();
+	return querier;
+}
+
+string TeLineLengthStrategy::compute (TeBox box)
+{
+	double length = 0;
+
+	TeQuerier* querier = getWithinGeometry(box);
+    int quant = querier->numElemInstances();			
+	
+	TePolygonSet box_ps;
+	TeLineSet intersect, objGeom;
+	TeSTInstance sti;
+	TePolygon pol = polygonFromBox(box);
+	box_ps.add(pol);
+
+	for(int i = 0; i < quant; i++)
+	{
+		querier->fetchInstance (sti);
+		objGeom = sti.geometries().getLines();
+        TeMultiGeometry mg;
+					
+		mg = TeOverlay(objGeom, box_ps, TeINTERSECTION);
+				
+		intersect = mg.getLines();
+		for(TeLineSet::iterator lineIt = intersect.begin(); lineIt != intersect.end(); lineIt++)
+		{
+			length += TeLength (*lineIt);
+		}
+	}
+
+	delete querier;
+	return Te2String (length);
+}
+
+// For absolute values to be partinioned in space (e.g., population, number of malaria cases, etc.)	
+string TeSumWeighByAreaStrategy::compute (TeBox box)
+{
+	double weigh_val = 0.0;
+	double area = TeGeometryArea(box);
+
+	if (area <= 0.0) return Te2String(0);
+
+	TeQuerier* querier = getWithinGeometry(box, attribute);
+    int quant = querier->numElemInstances();			
+	
+	TePolygonSet box_ps, intersect, objGeom;
+	TeSTInstance sti;
+	TePolygon pol = polygonFromBox(box);
+	box_ps.add(pol);
+
+	for(int i = 0; i < quant; i++)
+	{
+		querier->fetchInstance (sti);
+		objGeom = sti.geometries().getPolygons();
+	
+		string val;
+		sti.getPropertyValue(attribute, val);
+		double num_val = atof(val.c_str());
+
+		double geomArea = TeGeometryArea (objGeom);
+		if (geomArea > 0.0)
+		{
+			TePolygonSet intersect;
+			TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
+			double intersectArea = TeGeometryArea (intersect);
+			weigh_val += num_val*(intersectArea/geomArea); 
+		}
+	}
+
+	delete querier;
+	return Te2String (weigh_val);
+}
+
+TeMinimumDistanceStrategy::TeMinimumDistanceStrategy(TeTheme* theme_, TeGeomRep rep_, double distError_) 
+: TeComputeSpatialStrategy(theme_, rep_) 
+{ 
+	maxDist = distError_; tree = NULL; 
+}
+
+void TeMinimumDistanceStrategy::CreatePoints(TeCoord2D p1, TeCoord2D p2)
+{
+	double dist = TeDistance(p1, p2);
+	if(dist > maxDist)
+	{
+		TeCoord2D p3;
+
+		TeGetMiddlePoint (p1, p2, p3);
+
+		dataSet.push_back(pair<TeCoord2D, TePoint>(p3, p3));
+		
+		CreatePoints(p1, p3);
+		CreatePoints(p2, p3);
+	}
+}
+
+TeMinimumDistanceLinesStrategy::TeMinimumDistanceLinesStrategy(TeTheme* theme_, double dist_)
+	:TeMinimumDistanceStrategy(theme_, TeLINES, dist_)
+{
+	vector<string> attrNames;
+    TeQuerierParams params(true, attrNames);
+
+    params.setParams (theme);
+    TeQuerier* querier = new TeQuerier(params);
+	querier->loadInstances();
+    int quant = querier->numElemInstances();
+
+    TeSTInstance sti;
+	TeLineSet ls;
+
+    for(int c = 0; c < quant; c++)
+    {
+        querier->fetchInstance (sti);
+        ls = sti.geometries().getLines();
+
+		for(unsigned i = 0; i < ls.size(); i++)
+		{
+			dataSet.push_back(pair<TeCoord2D, TePoint>(ls[i][0], ls[i][0]));
+			for(unsigned j = 1; j < ls[i].size(); j++)
+			{
+				dataSet.push_back(pair<TeCoord2D, TePoint>(ls[i][j], ls[i][j]));
+	
+				TeCoord2D p1 = ls[i][j-1];
+				TeCoord2D p2 = ls[i][j];
+				
+				CreatePoints(p1, p2);
+			}
+		}
+	}
+
+	tree = new KDTREE(theme_->getThemeBox(), 5); // bucketSize == 5
+	tree->build(dataSet);
+	delete querier;
+}
+
+TeMinimumDistancePointsStrategy::TeMinimumDistancePointsStrategy(TeTheme* theme_)
+	:TeMinimumDistanceStrategy(theme_, TePOINTS, 0)
+{
+	vector<string> attrNames;
+    TeQuerierParams params(true, attrNames);
+
+    params.setParams (theme);
+    TeQuerier* querier = new TeQuerier(params);
+	querier->loadInstances();
+    int quant = querier->numElemInstances();
+
+    TeSTInstance sti;
+	TePointSet ps;
+
+    for(int c = 0; c < quant; c++)
+    {
+        querier->fetchInstance (sti);
+        ps = sti.geometries().getPoints();
+
+		for(unsigned i = 0; i < ps.size(); i++)
+		{
+			dataSet.push_back(pair<TeCoord2D, TePoint>(ps[i].location(), ps[i]));
+		}
+	}
+
+	tree = new KDTREE(theme_->getThemeBox(), 5); // bucketSize == 5
+	tree->build(dataSet);
+	delete querier;
+}
+
+TeMinimumDistancePolygonsStrategy::TeMinimumDistancePolygonsStrategy(TeTheme* theme_, double dist_)
+    :TeMinimumDistanceStrategy(theme_, TePOLYGONS, dist_)
+{
+	vector<string> attrNames;
+    TeQuerierParams params(true, attrNames);
+
+    params.setParams (theme);
+    TeQuerier* querier = new TeQuerier(params);
+	querier->loadInstances();
+    int quant = querier->numElemInstances();
+
+    TeSTInstance sti;
+	TePolygonSet ps;
+
+    for(int c = 0; c < quant; c++)
+    {
+        querier->fetchInstance (sti);
+        ps = sti.geometries().getPolygons();
+
+		for(unsigned i = 0; i < ps.size(); i++)
+		{
+			for(unsigned j = 0; j < ps[i].size(); j++)
+			{
+				dataSet.push_back(pair<TeCoord2D, TePoint>(ps[i][j][0], ps[i][j][0]));
+	
+	            for(unsigned k = 1; k < ps[i][j].size(); k++)
+	            {
+					dataSet.push_back(pair<TeCoord2D, TePoint>(ps[i][j][k], ps[i][j][k]));
+					
+					TeCoord2D p1 = ps[i][j][k-1];
+					TeCoord2D p2 = ps[i][j][k];
+					CreatePoints(p1, p2);
+				}
+							
+				TeCoord2D p1 = ps[i][j][0];
+				TeCoord2D p2 = ps[i][j][ps[i][j].size()-1];
+				CreatePoints(p1, p2);
+			}
+		}
+	}
+
+	tree = new KDTREE(theme_->getThemeBox(), 5); // bucketSize == 5
+	tree->build(dataSet);
+	delete querier;
+}
+
+string TeMinimumDistanceStrategy::compute (TeBox box)
+{
+	vector<TePoint> report;
+	vector<double> sqrDists;
+	TeCoord2D c(TeMAXFLOAT, TeMAXFLOAT);
+	TeCoord2D key = box.center();
+	TePoint item(c);
+
+	report.push_back(item);
+
+	tree->nearestNeighborSearch(key, report, sqrDists, 1);
+
+	double dist = sqrt(sqrDists[0]);
+	return Te2String (dist);
+}
+
+string TeMinimumDistancePolygonsStrategy::compute (TeBox box)
+{
+	TeQuerier* querier = getWithinGeometry(box);
+    int quant = querier->numElemInstances();			
+		
+	TePolygonSet box_ps, intersect, objGeom;
+	TeSTInstance sti;
+    TePolygon pol = polygonFromBox(box);
+    box_ps.add(pol);
+
+	for(int i = 0; i < quant; i++)
+	{
+		querier->fetchInstance (sti);
+		objGeom = sti.geometries().getPolygons();
+	
+		TeOverlay(box_ps, objGeom, intersect, TeINTERSECTION);
+        if(!intersect.empty()) return Te2String (0);
+	}
+	
+	delete querier;
+
+	return TeMinimumDistanceStrategy::compute(box);
+}
+
diff --git a/src/terralib/kernel/TeComputeAttributeStrategies.h b/src/terralib/kernel/TeComputeAttributeStrategies.h
old mode 100755
new mode 100644
index 92f933c..eec16ac
--- a/src/terralib/kernel/TeComputeAttributeStrategies.h
+++ b/src/terralib/kernel/TeComputeAttributeStrategies.h
@@ -1,1055 +1,1055 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*! \file TeComputeAttributeStrategies.h
-    This file contains functions to compute attributes based on 
-	alternative strategies. These strategies (Strategy Design Pattern)
-	correspond to operations to derive information based on other  layers attributes and/or
-	spatial components (polygonal, raster, point, raster or other cells). 
-*/
-#ifndef TeComputeAttrStrategies_H
-#define TeComputeAttrStrategies_H
-
-#include <TeAttribute.h>
-#include <TeBox.h>
-#include <TeUtils.h>
-#include <TeNetwork.h>
-#include <TeKdTree.h>
-#include <TeLayer.h>
-
-typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, vector<TePoint>, TePoint> KDNODE;
-typedef TeSAM::TeAdaptativeKdTree<KDNODE> KDTREE;
-
-class TeTheme;
-class TeRaster;
-class TeQuerier;
-
-/** @defgroup NSCellFillStrategies Non-spatial strategy hierarchy to compute cells attributes
-    @ingroup FillCellAlg
-	Abstract class in the strategies hierarchy for computing attribute values based on other layers 
-	(Strategy Design Pattern). 
-	@{
- */
-//!  Abstract class in the strategies hierarchy for computing attribute values based on other layers (Strategy Design Pattern). 
-template<class Iterator>
-class TeComputeAttrStrategy  
-{
-	public:
-		//! Function to access the default value
-		TeProperty  defaultValue () { return defaultValue_; }
-
-		//! Virtual function to compute the attribute based on the iterator
-		/* 
-			\param first		the first element of the Iterator
-			\param last			the last element of the Iterator
-			\param columnName	the attribute name to be generated in the TeProperty's
-		*/
-		virtual  vector<TeProperty> compute (Iterator /*first*/, Iterator /*last*/, const string& /*columnName*/)
-		{
-			vector<TeProperty> result;
-			result.push_back (defaultValue_);
-			return result;
-		}
-
-		//! Destructor
-		virtual ~TeComputeAttrStrategy(){}
-
-		bool ComputeAttrIsDummy(double value, double dummy)
-		{
-			return (ABS(value - dummy) < 0.001);
-		}
-
-
-	protected:
-		//! Empty constructor
-		TeComputeAttrStrategy () {};
-
-		//! The default returning value
-		TeProperty	defaultValue_;
-};
-
-
-//! Class to compute the average given some elements of an iterator
-template<class Iterator>
-class TeAverageStrategy: public TeComputeAttrStrategy<Iterator>  
-{
-	public:
-		//! Constructor
-		/* 
-			\param defaultValue		the returned value of the compute method when the iterator is empty	
-		*/	
-		TeAverageStrategy (double dummyV = 0.0, double defaultV = 0.0) {this->defaultValue_.value_ = Te2String (defaultV); dummy = dummyV; }
-
-		//! Destructor
-		virtual ~TeAverageStrategy() {}
-
-		//! Function to compute the average based on the iterator
-		/* 
-			\param first		the first element of the Iterator
-			\param last			the last element of the Iterator
-			\param columnName	the attribute name to be generated in the TeProperty's
-		*/
-		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
-		{
-			double	tot_val = 0.0;
-			int		num = 0;
-
-			Iterator it = first;
-			while (it != last)
-			{
-				if( !ComputeAttrIsDummy((*it), dummy) )
-				{
-					tot_val += (*it);
-					num++;
-				}
-				++it;
-			}
-	
-			TeProperty  prop;
-			prop.attr_.rep_.name_ = columnName;
-			prop.attr_.rep_.type_ = TeREAL;
-			prop.attr_.rep_.numChar_ = 48;
-			if (num > 0)
-			{
-				double val = tot_val/num;
-				prop.value_ = Te2String (val);
-			}
-			else prop.value_ = this->defaultValue_.value_;
-	
-			TePropertyVector  result;
-			result.push_back (prop);
-			return result;
-		}
-	private:
-		double dummy;
-};
-
-
-//! Class to compute the average given some elements of an iterator
-template<class Iterator>
-class TeSTDevStrategy: public TeComputeAttrStrategy<Iterator>  
-{
-	public:
-		//! Constructor
-		/* 
-			\param defaultValue		the returned value of the compute method when the iterator is empty	
-		*/	
-		TeSTDevStrategy (double dummyV = 0.0, double defaultV = 0.0) {this->defaultValue_.value_ = Te2String (defaultV); dummy = dummyV; }
-
-		//! Destructor
-		virtual ~TeSTDevStrategy() {}
-
-		//! Function to compute the average based on the iterator
-		/* 
-			\param first		the first element of the Iterator
-			\param last			the last element of the Iterator
-			\param columnName	the attribute name to be generated in the TeProperty's
-		*/
-		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
-		{
-			double tot_val = 0.0;
-			double stdev = 0.0;
-			int	   num = 0;
-			
-			Iterator it = first;
-			while (it != last)
-			{
-				if( !ComputeAttrIsDummy((*it), dummy) )
-				{
-					tot_val += (*it);
-					num++;
-				}
-				++it;
-			}
-			if(num > 0)
-			{
-				double mean = tot_val / num;
-				it = first;
-				while (it != last)
-				{
-					if( !ComputeAttrIsDummy((*it), dummy) ) stdev += pow((*it) - mean, 2);
-
-					++it;
-				}
-				stdev = stdev / num;
-				stdev = sqrt(stdev);
-			}
-
-			TeProperty  prop;
-			prop.attr_.rep_.name_ = columnName;
-			prop.attr_.rep_.type_ = TeREAL;
-			prop.attr_.rep_.numChar_ = 48;
-
-			if (num > 0) prop.value_ = Te2String (stdev);
-			else         prop.value_ = this->defaultValue_.value_;
-	
-			TePropertyVector  result;
-			result.push_back (prop);
-			return result;
-		}	
-	private:
-		double dummy;
-};
-
-
-//! Class to compute the sum of the elements of an iterator
-template<class Iterator>
-class TeSumStrategy: public TeComputeAttrStrategy<Iterator>   
-{
-	public:
-		//! Constructor
-		/* 
-			\param defaultValue		the returned value of the compute method when the iterator is empty	
-		*/	
-		TeSumStrategy (double dummyV = 0.0, double defaultV = 0.0) {this->defaultValue_.value_ = Te2String (defaultV); dummy = dummyV; }
-
-		//! Destructor
-		virtual ~TeSumStrategy() {}
-
-		//! Function to compute the sum of the iterator
-		/* 
-			\param first		the first element of the Iterator
-			\param last			the last element of the Iterator
-			\param columnName	the attribute name to be generated in the TeProperty's
-		*/
-		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
-		{  
-			double sum = 0.0;
-			Iterator it = first;
-			bool found = false;
-			while (it != last)
-			{
-				if( !ComputeAttrIsDummy((*it), dummy) )
-				{
-					sum += (*it);
-					found = true;
-				}
-				++it;
-			}
-
-			TeProperty  prop;
-
-			if (first == last || !found) prop = this->defaultValue_;
-			else  prop.value_ = Te2String (sum);
-
-			prop.attr_.rep_.name_ = columnName;
-			prop.attr_.rep_.type_ = TeREAL;
-			prop.attr_.rep_.numChar_ = 48;
-			TePropertyVector  result;
-			result.push_back (prop);
-			return result;
-		}
-	private:
-		double dummy;
-};
-
-
-//! Class to compute the minimum value of an iterator
-template<class Iterator>
-class TeMinimumStrategy: public TeComputeAttrStrategy<Iterator>   
-{
-	public:
-		//! Constructor
-		/* 
-			\param defaultValue		the returned value of the compute method when the iterator is empty	
-		*/	
-		TeMinimumStrategy (double dummyV = 0.0, double defaultV = 0.0) {this->defaultValue_.value_ = Te2String (defaultV); dummy = dummyV; }
-
-		//! Destructor
-		virtual ~TeMinimumStrategy() {}
-
-		//! Function to compute the minimum value of the iterator
-		/* 
-			\param first		the first element of the Iterator
-			\param last			the last element of the Iterator
-			\param columnName	the attribute name to be generated in the TeProperty's
-		*/
-		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
-		{
-			double min = TeMAXFLOAT;
-			Iterator it = first;
-			while (it != last)
-			{
-				if( !ComputeAttrIsDummy((*it), dummy) )
-				{
-					double val = (*it);
-					if (val < min) min = val;
-				}
-				++it;
-			}
-
-			TeProperty  prop;
-			prop.attr_.rep_.name_ = columnName;
-			prop.attr_.rep_.type_ = TeREAL;
-			prop.attr_.rep_.numChar_ = 48;
-
-			if (first == last || min == TeMAXFLOAT)
-				prop.value_ = this->defaultValue_.value_; 
-			else  
-				prop.value_ = Te2String (min);
-
-			TePropertyVector  result;
-			result.push_back (prop);
-			return result;
-		}
-	private:
-		double dummy;
-};
-
-
-//! Class to compute the maximum value of an iterator
-template<class Iterator>
-class TeMaximumStrategy: public TeComputeAttrStrategy<Iterator>   
-{
-	public:
-		//! Constructor
-		/* 
-			\param defaultValue		the returned value of the compute method when the iterator is empty	
-		*/	
-		TeMaximumStrategy (double dummyV = 0.0, double defaultV = 0.0) {this->defaultValue_.value_ = Te2String (defaultV); dummy = dummyV; }
-
-		//! Destructor
-		virtual ~TeMaximumStrategy() {}
-
-		//! Function to compute the maximum value of the iterator
-		/* 
-			\param first		the first element of the Iterator
-			\param last			the last element of the Iterator
-			\param columnName	the attribute name to be generated in the TeProperty's
-		*/
-		virtual vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
-		{
-			double	max =  TeMINFLOAT;
-			Iterator it = first;
-			while (it != last)
-			{
-				if( !ComputeAttrIsDummy((*it), dummy) )
-				{
-					double val = (*it);
-					if (val > max) max = val;
-				}
-				++it;
-			}
-
-			TeProperty  prop;
-			prop.attr_.rep_.name_ = columnName;
-			prop.attr_.rep_.type_ = TeREAL;
-			prop.attr_.rep_.numChar_ = 48;
-
-			if (first == last || max == TeMINFLOAT)
-				prop.value_ = this->defaultValue_.value_; 
-			else  
-				prop.value_ = Te2String (max);
-
-			TePropertyVector  result;
-			result.push_back (prop);
-			return result;
-		}
-	private:
-		double dummy;
-};
-
-
-//! Class to compute the percentages of each class (described in a map) of an iterator
-template<class Iterator>
-class TeCategoryPercentageStrategy: public TeComputeAttrStrategy<Iterator>   
-{
-	public:
-		//! Constructor
-		/* 
-			\param defaultValue		the returned value of the compute method when the iterator is empty	
-			\param classes			classes for regrouping the values	
-		*/	
-		TeCategoryPercentageStrategy (map<string, string>& classes, double defaultValue = 0.0) 
-		{
-			this->defaultValue_.value_ = Te2String (defaultValue); 
-			classesMap_ = classes;
-			usingMap = true;
-		}
-
-		//! Constructor
-		/* 
-			\param defaultValue		the returned value of the compute method when the iterator is empty	
-			\param dummyV			the ignored value
-		*/	
-
-		TeCategoryPercentageStrategy(double defaultValue = 0.0, string dummyV = "")
-		{
-			usingMap = false;
-			this->defaultValue_.value_ = Te2String (defaultValue); 
-			dummy = dummyV;
-		}
-
-		//! Destructor
-		virtual ~TeCategoryPercentageStrategy() {}
-
-		//! Function to compute the percentages based on the iterator
-		/* 
-			\param first		the first element of the Iterator
-			\param last			the last element of the Iterator
-			\param columnName	the attribute name to be generated in the TeProperty's
-		*/
-		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
-		{
-			TeProperty category;
-			int num = 0;
-
-			// initialize count
-			map<string, int>  count;
-
-			if(usingMap)
-			{
-				map<string, string>::iterator itMap = classesMap_.begin();
-				while (itMap != classesMap_.end())
-				{
-					count[(*itMap).second] = 0;
-					++itMap;
-				}
-
-				Iterator it = first;
-				while (it != last)
-				{
-					if (it.getProperty (category))
-					{
-						count[classesMap_[category.value_]]++;
-						num++;
-					}
-					++it;
-				}
-			}
-			else // use the data to initialize the counter
-			{
-				Iterator it = first;
-				while (it != last)
-				{
-					if (it.getProperty (category) && category.value_ != dummy)
-						count[category.value_] = 0;
-
-					++it;
-				}
-
-				it = first;
-				while (it != last)
-				{
-					if (it.getProperty (category) && category.value_ != dummy)
-					{
-						count[category.value_]++;
-						num++;
-					}
-					++it;
-				}
-			}
-
-			TePropertyVector  result;
-			map <string, int>:: iterator count_it = count.begin();
-
-			while(count_it != count.end())  
-			{
-				string value_ =  (*count_it).first;
-				for (unsigned i = 0; i < value_.size(); i++)
-					if(value_[i] == '.' || value_[i] == '+')
-						// remove them from value because they cant be part of a column name
-						value_[i] = '_';
-
-				TeProperty prop;
-				prop.attr_.rep_.name_ = columnName + value_;
-				prop.attr_.rep_.type_ = TeREAL;
-				prop.attr_.rep_.numChar_ = 48;
-
-				double percent = 0.0;
-				double value = (double)(*count_it).second;
-				if (num != 0) percent = value/num;
-				prop.value_    = Te2String (percent);
-				result.push_back (prop);
-				++count_it;
-			}
-			return result;
-		}
-
-	private:
-		//! Map of classes
-		map<string, string> classesMap_;
-		bool usingMap;
-		string dummy;
-};
-
-
-//! Class to compute if there is any value in an iterator
-template<class Iterator>
-class TePresenceStrategy: public TeComputeAttrStrategy<Iterator>
-{
-	public:
-		//! Constructor
-		/* 
-			\param defaultValue		the returned value of the compute method when the iterator is empty	
-		*/	
-		TePresenceStrategy (bool defaultValue = 0) 
-		{
-			this->defaultValue_.attr_.rep_.type_ = TeINT;
-			this->defaultValue_.value_ = Te2String (defaultValue); 
-			this->defaultValue_.attr_.rep_.numChar_ = 48;
-		}
-
-		//! Destructor
-		virtual ~TePresenceStrategy() {}
-
-		//! Function to compute the presence based on the iterator
-		//! It has value "1" if there is any element, otherwise it has the value of the constructor
-		/* 
-			\param first		the first element of the Iterator
-			\param last			the last element of the Iterator
-			\param columnName	the attribute name to be generated in the TeProperty's
-		*/
-		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
-		{
-			TeProperty prop;
-			if (first != last) 
-				prop.value_ = "1";
-			else
-				prop = this->defaultValue_;
-	
-			TePropertyVector  result;
-			prop.attr_.rep_.name_ = columnName; 
-			prop.attr_.rep_.type_ = TeINT;
-			prop.attr_.rep_.numChar_ = 48;
-			result.push_back (prop);
-			return result;
-		}
-};
-
-//! Class for computing the majority in a given iterator of values without classes
-template<class Iterator>
-class TeMajorityStrategy: public TeComputeAttrStrategy<Iterator>
-{
-	public:
-		//! Constructor
-		/* 
-			\param defaultType		the type of the default value	
-		*/	
-		TeMajorityStrategy (TeAttrDataType defaultType = TeINT, string defaultValue = "", string dummyV = "")
-		{
-			this->defaultValue_.attr_.rep_.type_ = defaultType;
-			this->defaultValue_.value_ = defaultValue; 
-			dummy = dummyV;
-		}
-
-		//! Destructor
-		virtual ~TeMajorityStrategy() {}
-
-		//! Function to compute the majority of the iterator
-		/* 
-			\param first		the first element of the Iterator
-			\param last			the last element of the Iterator
-			\param columnName	the attribute name to be generated in the TeProperty's
-		*/
-		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
-		{
-			TeProperty category;
-			category.attr_.rep_.type_ = this->defaultValue_.attr_.rep_.type_;
-	
-			map<string, int>  count;
-			Iterator it = first;
-			while (it != last)
-			{
-				if (it.getProperty (category) && category.value_ != dummy)
-					count[category.value_]++;
-
-				++it;
-			}
-	
-			TeProperty prop;
-			prop.attr_.rep_.type_ = category.attr_.rep_.type_;
-			prop.value_ = this->defaultValue_.value_;
-			prop.attr_.rep_.name_ = columnName; 
-			prop.attr_.rep_.numChar_ = 48;
-
-			int max = 0;
-			map <string, int>:: iterator count_it = count.begin();
-			while(count_it != count.end())  
-			{
-				if ((*count_it).second > max)
-				{
-					prop.value_ = (*count_it).first;
-					max = (*count_it).second;
-				}
-				++count_it;		
-			}
-			TePropertyVector  result;
-			result.push_back (prop);
-			return result;
-		}
-	private:
-		string dummy;
-};
-
-
-//! Class for compute the category with more occurences in the elements of a given iterator, using classes
-template<class Iterator>
-class TeMajorityCategoryStrategy: public TeComputeAttrStrategy<Iterator>   
-{
-	public:
-		//! Constructor
-		/*
-			\param classesMap		the returning values for each categoty
-			\param defaultValue		the type of the attribute to be created
-		*/	
-		TeMajorityCategoryStrategy (const map<string, string>& classesMap, TeAttrDataType defaultType = TeINT) 
-		{
-			this->defaultValue_.attr_.rep_.type_ = defaultType;
-			this->defaultValue_.value_ = "0"; 
-			classesMap_ = classesMap;
-		}
-
-		//! Destructor
-		virtual ~TeMajorityCategoryStrategy() {}
-
-		//! Function to compute the category with more occurrences
-		/* 
-			\param first		the first element of the Iterator
-			\param last			the last element of the Iterator
-			\param columnName	the attribute name to be generated in the TeProperty's
-		*/
-		virtual vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
-		{
-			TeProperty category;
-			category.attr_.rep_.type_ = this->defaultValue_.attr_.rep_.type_;
-
-			// initialize count
-			map<string, int>  count;
-			map<string, string>::iterator itMap = classesMap_.begin();
-			while (itMap != classesMap_.end())
-			{
-				count[(*itMap).second] = 0;
-				++itMap;
-			}
-
-			Iterator it = first;
-			while (it != last)
-			{
-				if (it.getProperty (category))
-				{
-					count[classesMap_[category.value_]]++;
-				}
-				++it;
-			}
-
-			TePropertyVector  result;
-			TeProperty prop;
-			prop.attr_.rep_.type_ = TeSTRING;
-			//	prop.value_ = defaultValue_.value_;
-			prop.attr_.rep_.name_ = columnName; 
-			prop.attr_.rep_.numChar_ = 48;
-
-			int max = 0;
-			map <string, int>:: iterator count_it = count.begin();
-			while(count_it != count.end())  
-			{
-				if ((*count_it).second > max)
-				{
-					prop.value_ = (*count_it).first;
-					max = (*count_it).second;
-				}
-				++count_it;		
-			}
-
-			result.push_back (prop);
-			return result;
-		}
-
-	protected:
-			map<string, string> classesMap_;
-};
-/** @} */   
-
-
-
-/** @defgroup CellFillStrategies Spatial strategy hierarchy to compute cells attributes
-    @ingroup FillCellAlg
-	Abstract class in the strategies hierarchy for computing attribute values based on other layers 
-	(Strategy Design Pattern). 
-	@{
- */
-//! Virtual class for computing attributes based on the spatial characteristics of the objects (Strategy Design Pattern)
-class TL_DLL TeComputeSpatialStrategy  
-{
-	public:
-		//! Destructor
-		virtual ~TeComputeSpatialStrategy() {}
-
-		//! Virtual function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual string compute(TeBox box) = 0;
-
-		//! The type of attriute generated by the class. Default is TeREAL
-		virtual TeAttrDataType Type() { return TeREAL; }
-
-		//! Return all the geometries within a given box
-		/* 
-			\param box		the box to be used
-			\patam att		the attribute returned together with the objects. If none, this function returns only the geometries
-		*/
-		TeQuerier* getWithinGeometry(TeBox box, string att = "");
-
-	protected:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-			\param rep_			the representation to be used	
-		*/	
-		TeComputeSpatialStrategy (TeTheme* theme_, TeGeomRep rep_) { theme = theme_; rep = rep_; }
-
-		//! Theme used to compute the attributes
-		TeTheme* theme;
-
-		//! The geometry of the theme used
-		TeGeomRep rep;
-};
-
-
-//! Class to compute the average of elements weighted by their areas
-//! It is useful when working with values representing averages
-class TL_DLL TeAverageWeighByAreaStrategy: public TeComputeSpatialStrategy 
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-			\param att_			the attribute used to compute the sum. It must be numerical
-			\param rep_			the representation to be used	
-		*/	
-		TeAverageWeighByAreaStrategy  (TeTheme* theme_, string att_, TeGeomRep rep_) : TeComputeSpatialStrategy(theme_, rep_) { attribute = att_; }
-
-		//! Destructor
-		virtual ~TeAverageWeighByAreaStrategy() {}
-
-		//! Function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual string compute (TeBox box);
-
-	private:
-		//! The attribute used to calculate the average
-		string attribute;
-};
-
-
-//! Class to compute the sum of elements weighted by their areas
-//! This function distribute the values keeping the overall sum of the elements on the layer
-class TL_DLL TeSumWeighByAreaStrategy: public TeComputeSpatialStrategy  
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-			\param att_			the attribute used to compute the sum. It must be numerical
-			\param rep_			the representation to be used	
-		*/	
-		TeSumWeighByAreaStrategy (TeTheme* theme_, string att_, TeGeomRep rep_) : TeComputeSpatialStrategy(theme_, rep_) { attribute = att_; }
-
-		//! Destructor
-		virtual ~TeSumWeighByAreaStrategy() {}
-
-		//! Function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual  string compute (TeBox box);
-
-	private:
-		//! The attribute used to calculate the average
-		string attribute;
-};
-
-
-//! Class to compute the value that occurs more frequently in a given box 
-class TL_DLL TeCategoryMajorityStrategy: public TeComputeSpatialStrategy  
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-			\param att_			the attribute used to compute the majority
-			\param classesMap	a map to reclassify the values
-		*/	
-		TeCategoryMajorityStrategy (TeTheme* theme_, string att_, map<string, string>& classesMap) : TeComputeSpatialStrategy(theme_, TePOLYGONS) 
-        	{classesMap = classesMap; attribute = att_;}
-
-		//! Destructor
-		virtual ~TeCategoryMajorityStrategy() {}
-
-		//! Function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual  string compute (TeBox box);	
-
-	protected:
-			//! The map of values
-			map<string, string> classesMap;
-
-			//! The attribute used in the majority
-			string attribute;
-};
-
-
-//! Class to count the elements in a given box 
-//! This class returns the number of elements whose BOX intercepts the box in the argument of compute
-//! For safety, use the count classes that inherit this one
-class TL_DLL TeCountObjectsStrategy: public TeComputeSpatialStrategy  
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-			\param geom_		the representation to be used	
-		*/	
-		TeCountObjectsStrategy (TeTheme* theme_, TeGeomRep geom_) : TeComputeSpatialStrategy(theme_, geom_) { }
-
-		//! Destructor
-		virtual ~TeCountObjectsStrategy() { }
-
-		//! Function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual string compute (TeBox box);
-
-		//! This class generates TeINT attributes
-		virtual TeAttrDataType Type() { return TeINT; }
-};
-
-
-//! Class to compute the number of polygons in a given box
-class TL_DLL TeCountPolygonalObjectsStrategy: public TeCountObjectsStrategy
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-		*/	
-		TeCountPolygonalObjectsStrategy (TeTheme* theme_) : TeCountObjectsStrategy(theme_, TePOLYGONS) {}
-
-		//! Function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual string compute (TeBox box);
-};
-
-
-//! Class to compute the number of lines in a given box
-class TL_DLL TeCountLineObjectsStrategy: public TeCountObjectsStrategy
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-		*/	
-		TeCountLineObjectsStrategy (TeTheme* theme_) : TeCountObjectsStrategy(theme_, TeLINES) {}
-
-		//! Function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual string compute (TeBox box);
-};
-
-
-//! Class to count the number of points in a given box
-class TL_DLL TeCountPointObjectsStrategy: public TeCountObjectsStrategy 
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-		*/	
-		TeCountPointObjectsStrategy (TeTheme* theme_) : TeCountObjectsStrategy(theme_, TePOINTS) {}
-};
-
-
-//! Class to compute the length of lines within a given box 
-class TL_DLL TeLineLengthStrategy: public TeComputeSpatialStrategy 
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-		*/	
-		TeLineLengthStrategy (TeTheme* theme_) : TeComputeSpatialStrategy(theme_, TeLINES){}
-
-		//! Destructor
-		virtual ~TeLineLengthStrategy() {}
-
-		//! Function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual  string compute (TeBox box);
-};
-
-
-//! Class to compute the area of polygons covering a given box
-class TL_DLL TeTotalAreaPercentageStrategy: public TeComputeSpatialStrategy  
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-		*/	
-		TeTotalAreaPercentageStrategy (TeTheme* theme_) : TeComputeSpatialStrategy(theme_, TePOLYGONS){}
-
-		//! Destructor
-		virtual ~TeTotalAreaPercentageStrategy() {}
-
-		//! Function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual string compute (TeBox box);
-};
-
-/*
-// pedro at 20061214
-//! Class to compute the distance based on a net 
-class TeMinimumDistanceNetStrategy:  public TeComputeSpatialStrategy
-{
-	public:
-		//! Constructor
-		TeMinimumDistanceNetStrategy(TeTheme* theme_, TeGeomRep rep_, TeGraphNetwork* net, double dist_ = 50) : TeComputeSpatialStrategy(theme_, rep_) { maxDist = dist_; tree = NULL; }
-		
-		//! Destructor
-		virtual ~TeMinimumDistanceNetStrategy() { if(tree) delete tree; }
-
-        void CreatePoints(TeCoord2D p1, TeCoord2D p2); // create all intermediate points between them, using the maximum distance
-
-		virtual string compute (TeBox box);
-
-		virtual TeAttrDataType Type() { return TeREAL; }
-
-	private:	
-
-		double maxDist;
-
-		vector<pair<TeCoord2D, TePoint> > dataSet;
-
-		KDTREE* tree;
-};
-*/
-
-
-//! Class to compute distances using KD-trees
-class TL_DLL TeMinimumDistanceStrategy:  public TeComputeSpatialStrategy
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-			\param gep_			the geometry to be used
-			\param distError_	the maximum error tolerated by this operator
-		*/	
-		TeMinimumDistanceStrategy(TeTheme* theme_, TeGeomRep rep_, double distError_ = 50); 
-
-		//! Destructor
-		virtual ~TeMinimumDistanceStrategy() { if(tree) delete tree; }
-
-		//! Function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual string compute (TeBox box);
-
-	protected:
-		//! Create intermediate points between two given points, using the maximum distance
-        void CreatePoints(TeCoord2D p1, TeCoord2D p2);
-
-		//! The maximum error in the computation
-		double maxDist;
-
-		//!
-		vector<pair<TeCoord2D, TePoint> > dataSet;
-
-		//! The tree to store the points
-		KDTREE* tree;
-};
-
-
-//! Class to compute the minimum distance to a theme of polygons. The calculatd distance is approximated, and has an error of at most
-//! the parameter dist_ in the constructor
-class TL_DLL TeMinimumDistancePolygonsStrategy: public TeMinimumDistanceStrategy
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-			\param distError_	the maximum error tolerated by this operator
-		*/	
-		TeMinimumDistancePolygonsStrategy(TeTheme* theme_, double distError_ = 150);
-
-		//! Destructor
-		virtual ~TeMinimumDistancePolygonsStrategy() {}
-
-		//! Function to compute the attribute
-		/* 
-			\param box		compute the attribute of a cell having this box
-		*/
-		virtual string compute (TeBox box);
-};
-
-
-//! Class to compute 
-class TL_DLL TeMinimumDistanceLinesStrategy : public TeMinimumDistanceStrategy
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-			\param distError_	the maximum error tolerated by this operator
-		*/	
-		TeMinimumDistanceLinesStrategy(TeTheme* theme_, double distError_ = 150);
-
-		//! Destructor
-		virtual ~TeMinimumDistanceLinesStrategy() {}
-};
-
-
-//! Class to calculate the minimum distance of a box to points.
-//! It calculates the exact value once the KD-tree calculates the exact distance to points
-class TL_DLL TeMinimumDistancePointsStrategy: public TeMinimumDistanceStrategy
-{
-	public:
-		//! Constructor
-		/* 
-			\param theme_		the theme to be used as basis for computing the attribute
-		*/	
-		TeMinimumDistancePointsStrategy(TeTheme* theme_);
-
-		//! Destructor
-		virtual ~TeMinimumDistancePointsStrategy() {}
-};
-
-/** @} */
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*! \file TeComputeAttributeStrategies.h
+    This file contains functions to compute attributes based on 
+	alternative strategies. These strategies (Strategy Design Pattern)
+	correspond to operations to derive information based on other  layers attributes and/or
+	spatial components (polygonal, raster, point, raster or other cells). 
+*/
+#ifndef TeComputeAttrStrategies_H
+#define TeComputeAttrStrategies_H
+
+#include <TeAttribute.h>
+#include <TeBox.h>
+#include <TeUtils.h>
+#include <TeNetwork.h>
+#include <TeKdTree.h>
+#include <TeLayer.h>
+
+typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, vector<TePoint>, TePoint> KDNODE;
+typedef TeSAM::TeAdaptativeKdTree<KDNODE> KDTREE;
+
+class TeTheme;
+class TeRaster;
+class TeQuerier;
+
+/** @defgroup NSCellFillStrategies Non-spatial strategy hierarchy to compute cells attributes
+    @ingroup FillCellAlg
+	Abstract class in the strategies hierarchy for computing attribute values based on other layers 
+	(Strategy Design Pattern). 
+	@{
+ */
+//!  Abstract class in the strategies hierarchy for computing attribute values based on other layers (Strategy Design Pattern). 
+template<class Iterator>
+class TeComputeAttrStrategy  
+{
+	public:
+		//! Function to access the default value
+		TeProperty  defaultValue () { return defaultValue_; }
+
+		//! Virtual function to compute the attribute based on the iterator
+		/* 
+			\param first		the first element of the Iterator
+			\param last			the last element of the Iterator
+			\param columnName	the attribute name to be generated in the TeProperty's
+		*/
+		virtual  vector<TeProperty> compute (Iterator /*first*/, Iterator /*last*/, const string& /*columnName*/)
+		{
+			vector<TeProperty> result;
+			result.push_back (defaultValue_);
+			return result;
+		}
+
+		//! Destructor
+		virtual ~TeComputeAttrStrategy(){}
+
+		bool ComputeAttrIsDummy(double value, double dummy)
+		{
+			return (ABS(value - dummy) < 0.001);
+		}
+
+
+	protected:
+		//! Empty constructor
+		TeComputeAttrStrategy () {};
+
+		//! The default returning value
+		TeProperty	defaultValue_;
+};
+
+
+//! Class to compute the average given some elements of an iterator
+template<class Iterator>
+class TeAverageStrategy: public TeComputeAttrStrategy<Iterator>  
+{
+	public:
+		//! Constructor
+		/* 
+			\param defaultValue		the returned value of the compute method when the iterator is empty	
+		*/	
+		TeAverageStrategy (double dummyV = 0.0, double defaultV = 0.0) {this->defaultValue_.value_ = Te2String (defaultV); dummy = dummyV; }
+
+		//! Destructor
+		virtual ~TeAverageStrategy() {}
+
+		//! Function to compute the average based on the iterator
+		/* 
+			\param first		the first element of the Iterator
+			\param last			the last element of the Iterator
+			\param columnName	the attribute name to be generated in the TeProperty's
+		*/
+		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
+		{
+			double	tot_val = 0.0;
+			int		num = 0;
+
+			Iterator it = first;
+			while (it != last)
+			{
+				if( !ComputeAttrIsDummy((*it), dummy) )
+				{
+					tot_val += (*it);
+					num++;
+				}
+				++it;
+			}
+	
+			TeProperty  prop;
+			prop.attr_.rep_.name_ = columnName;
+			prop.attr_.rep_.type_ = TeREAL;
+			prop.attr_.rep_.numChar_ = 48;
+			if (num > 0)
+			{
+				double val = tot_val/num;
+				prop.value_ = Te2String (val);
+			}
+			else prop.value_ = this->defaultValue_.value_;
+	
+			TePropertyVector  result;
+			result.push_back (prop);
+			return result;
+		}
+	private:
+		double dummy;
+};
+
+
+//! Class to compute the average given some elements of an iterator
+template<class Iterator>
+class TeSTDevStrategy: public TeComputeAttrStrategy<Iterator>  
+{
+	public:
+		//! Constructor
+		/* 
+			\param defaultValue		the returned value of the compute method when the iterator is empty	
+		*/	
+		TeSTDevStrategy (double dummyV = 0.0, double defaultV = 0.0) {this->defaultValue_.value_ = Te2String (defaultV); dummy = dummyV; }
+
+		//! Destructor
+		virtual ~TeSTDevStrategy() {}
+
+		//! Function to compute the average based on the iterator
+		/* 
+			\param first		the first element of the Iterator
+			\param last			the last element of the Iterator
+			\param columnName	the attribute name to be generated in the TeProperty's
+		*/
+		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
+		{
+			double tot_val = 0.0;
+			double stdev = 0.0;
+			int	   num = 0;
+			
+			Iterator it = first;
+			while (it != last)
+			{
+				if( !ComputeAttrIsDummy((*it), dummy) )
+				{
+					tot_val += (*it);
+					num++;
+				}
+				++it;
+			}
+			if(num > 0)
+			{
+				double mean = tot_val / num;
+				it = first;
+				while (it != last)
+				{
+					if( !ComputeAttrIsDummy((*it), dummy) ) stdev += pow((*it) - mean, 2);
+
+					++it;
+				}
+				stdev = stdev / num;
+				stdev = sqrt(stdev);
+			}
+
+			TeProperty  prop;
+			prop.attr_.rep_.name_ = columnName;
+			prop.attr_.rep_.type_ = TeREAL;
+			prop.attr_.rep_.numChar_ = 48;
+
+			if (num > 0) prop.value_ = Te2String (stdev);
+			else         prop.value_ = this->defaultValue_.value_;
+	
+			TePropertyVector  result;
+			result.push_back (prop);
+			return result;
+		}	
+	private:
+		double dummy;
+};
+
+
+//! Class to compute the sum of the elements of an iterator
+template<class Iterator>
+class TeSumStrategy: public TeComputeAttrStrategy<Iterator>   
+{
+	public:
+		//! Constructor
+		/* 
+			\param defaultValue		the returned value of the compute method when the iterator is empty	
+		*/	
+		TeSumStrategy (double dummyV = 0.0, double defaultV = 0.0) {this->defaultValue_.value_ = Te2String (defaultV); dummy = dummyV; }
+
+		//! Destructor
+		virtual ~TeSumStrategy() {}
+
+		//! Function to compute the sum of the iterator
+		/* 
+			\param first		the first element of the Iterator
+			\param last			the last element of the Iterator
+			\param columnName	the attribute name to be generated in the TeProperty's
+		*/
+		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
+		{  
+			double sum = 0.0;
+			Iterator it = first;
+			bool found = false;
+			while (it != last)
+			{
+				if( !ComputeAttrIsDummy((*it), dummy) )
+				{
+					sum += (*it);
+					found = true;
+				}
+				++it;
+			}
+
+			TeProperty  prop;
+
+			if (first == last || !found) prop = this->defaultValue_;
+			else  prop.value_ = Te2String (sum);
+
+			prop.attr_.rep_.name_ = columnName;
+			prop.attr_.rep_.type_ = TeREAL;
+			prop.attr_.rep_.numChar_ = 48;
+			TePropertyVector  result;
+			result.push_back (prop);
+			return result;
+		}
+	private:
+		double dummy;
+};
+
+
+//! Class to compute the minimum value of an iterator
+template<class Iterator>
+class TeMinimumStrategy: public TeComputeAttrStrategy<Iterator>   
+{
+	public:
+		//! Constructor
+		/* 
+			\param defaultValue		the returned value of the compute method when the iterator is empty	
+		*/	
+		TeMinimumStrategy (double dummyV = 0.0, double defaultV = 0.0) {this->defaultValue_.value_ = Te2String (defaultV); dummy = dummyV; }
+
+		//! Destructor
+		virtual ~TeMinimumStrategy() {}
+
+		//! Function to compute the minimum value of the iterator
+		/* 
+			\param first		the first element of the Iterator
+			\param last			the last element of the Iterator
+			\param columnName	the attribute name to be generated in the TeProperty's
+		*/
+		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
+		{
+			double min = TeMAXFLOAT;
+			Iterator it = first;
+			while (it != last)
+			{
+				if( !ComputeAttrIsDummy((*it), dummy) )
+				{
+					double val = (*it);
+					if (val < min) min = val;
+				}
+				++it;
+			}
+
+			TeProperty  prop;
+			prop.attr_.rep_.name_ = columnName;
+			prop.attr_.rep_.type_ = TeREAL;
+			prop.attr_.rep_.numChar_ = 48;
+
+			if (first == last || min == TeMAXFLOAT)
+				prop.value_ = this->defaultValue_.value_; 
+			else  
+				prop.value_ = Te2String (min);
+
+			TePropertyVector  result;
+			result.push_back (prop);
+			return result;
+		}
+	private:
+		double dummy;
+};
+
+
+//! Class to compute the maximum value of an iterator
+template<class Iterator>
+class TeMaximumStrategy: public TeComputeAttrStrategy<Iterator>   
+{
+	public:
+		//! Constructor
+		/* 
+			\param defaultValue		the returned value of the compute method when the iterator is empty	
+		*/	
+		TeMaximumStrategy (double dummyV = 0.0, double defaultV = 0.0) {this->defaultValue_.value_ = Te2String (defaultV); dummy = dummyV; }
+
+		//! Destructor
+		virtual ~TeMaximumStrategy() {}
+
+		//! Function to compute the maximum value of the iterator
+		/* 
+			\param first		the first element of the Iterator
+			\param last			the last element of the Iterator
+			\param columnName	the attribute name to be generated in the TeProperty's
+		*/
+		virtual vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
+		{
+			double	max =  TeMINFLOAT;
+			Iterator it = first;
+			while (it != last)
+			{
+				if( !ComputeAttrIsDummy((*it), dummy) )
+				{
+					double val = (*it);
+					if (val > max) max = val;
+				}
+				++it;
+			}
+
+			TeProperty  prop;
+			prop.attr_.rep_.name_ = columnName;
+			prop.attr_.rep_.type_ = TeREAL;
+			prop.attr_.rep_.numChar_ = 48;
+
+			if (first == last || max == TeMINFLOAT)
+				prop.value_ = this->defaultValue_.value_; 
+			else  
+				prop.value_ = Te2String (max);
+
+			TePropertyVector  result;
+			result.push_back (prop);
+			return result;
+		}
+	private:
+		double dummy;
+};
+
+
+//! Class to compute the percentages of each class (described in a map) of an iterator
+template<class Iterator>
+class TeCategoryPercentageStrategy: public TeComputeAttrStrategy<Iterator>   
+{
+	public:
+		//! Constructor
+		/* 
+			\param defaultValue		the returned value of the compute method when the iterator is empty	
+			\param classes			classes for regrouping the values	
+		*/	
+		TeCategoryPercentageStrategy (map<string, string>& classes, double defaultValue = 0.0) 
+		{
+			this->defaultValue_.value_ = Te2String (defaultValue); 
+			classesMap_ = classes;
+			usingMap = true;
+		}
+
+		//! Constructor
+		/* 
+			\param defaultValue		the returned value of the compute method when the iterator is empty	
+			\param dummyV			the ignored value
+		*/	
+
+		TeCategoryPercentageStrategy(double defaultValue = 0.0, string dummyV = "")
+		{
+			usingMap = false;
+			this->defaultValue_.value_ = Te2String (defaultValue); 
+			dummy = dummyV;
+		}
+
+		//! Destructor
+		virtual ~TeCategoryPercentageStrategy() {}
+
+		//! Function to compute the percentages based on the iterator
+		/* 
+			\param first		the first element of the Iterator
+			\param last			the last element of the Iterator
+			\param columnName	the attribute name to be generated in the TeProperty's
+		*/
+		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
+		{
+			TeProperty category;
+			int num = 0;
+
+			// initialize count
+			map<string, int>  count;
+
+			if(usingMap)
+			{
+				map<string, string>::iterator itMap = classesMap_.begin();
+				while (itMap != classesMap_.end())
+				{
+					count[(*itMap).second] = 0;
+					++itMap;
+				}
+
+				Iterator it = first;
+				while (it != last)
+				{
+					if (it.getProperty (category))
+					{
+						count[classesMap_[category.value_]]++;
+						num++;
+					}
+					++it;
+				}
+			}
+			else // use the data to initialize the counter
+			{
+				Iterator it = first;
+				while (it != last)
+				{
+					if (it.getProperty (category) && category.value_ != dummy)
+						count[category.value_] = 0;
+
+					++it;
+				}
+
+				it = first;
+				while (it != last)
+				{
+					if (it.getProperty (category) && category.value_ != dummy)
+					{
+						count[category.value_]++;
+						num++;
+					}
+					++it;
+				}
+			}
+
+			TePropertyVector  result;
+			map <string, int>:: iterator count_it = count.begin();
+
+			while(count_it != count.end())  
+			{
+				string value_ =  (*count_it).first;
+				for (unsigned i = 0; i < value_.size(); i++)
+					if(value_[i] == '.' || value_[i] == '+' || value_[i] == '-')
+						// remove them from value because they cant be part of a column name
+						value_[i] = '_';
+
+				TeProperty prop;
+				prop.attr_.rep_.name_ = columnName + value_;
+				prop.attr_.rep_.type_ = TeREAL;
+				prop.attr_.rep_.numChar_ = 48;
+
+				double percent = 0.0;
+				double value = (double)(*count_it).second;
+				if (num != 0) percent = value/num;
+				prop.value_    = Te2String (percent);
+				result.push_back (prop);
+				++count_it;
+			}
+			return result;
+		}
+
+	private:
+		//! Map of classes
+		map<string, string> classesMap_;
+		bool usingMap;
+		string dummy;
+};
+
+
+//! Class to compute if there is any value in an iterator
+template<class Iterator>
+class TePresenceStrategy: public TeComputeAttrStrategy<Iterator>
+{
+	public:
+		//! Constructor
+		/* 
+			\param defaultValue		the returned value of the compute method when the iterator is empty	
+		*/	
+		TePresenceStrategy (bool defaultValue = 0) 
+		{
+			this->defaultValue_.attr_.rep_.type_ = TeINT;
+			this->defaultValue_.value_ = Te2String (defaultValue); 
+			this->defaultValue_.attr_.rep_.numChar_ = 48;
+		}
+
+		//! Destructor
+		virtual ~TePresenceStrategy() {}
+
+		//! Function to compute the presence based on the iterator
+		//! It has value "1" if there is any element, otherwise it has the value of the constructor
+		/* 
+			\param first		the first element of the Iterator
+			\param last			the last element of the Iterator
+			\param columnName	the attribute name to be generated in the TeProperty's
+		*/
+		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
+		{
+			TeProperty prop;
+			if (first != last) 
+				prop.value_ = "1";
+			else
+				prop = this->defaultValue_;
+	
+			TePropertyVector  result;
+			prop.attr_.rep_.name_ = columnName; 
+			prop.attr_.rep_.type_ = TeINT;
+			prop.attr_.rep_.numChar_ = 48;
+			result.push_back (prop);
+			return result;
+		}
+};
+
+//! Class for computing the majority in a given iterator of values without classes
+template<class Iterator>
+class TeMajorityStrategy: public TeComputeAttrStrategy<Iterator>
+{
+	public:
+		//! Constructor
+		/* 
+			\param defaultType		the type of the default value	
+		*/	
+		TeMajorityStrategy (TeAttrDataType defaultType = TeINT, string defaultValue = "", string dummyV = "")
+		{
+			this->defaultValue_.attr_.rep_.type_ = defaultType;
+			this->defaultValue_.value_ = defaultValue; 
+			dummy = dummyV;
+		}
+
+		//! Destructor
+		virtual ~TeMajorityStrategy() {}
+
+		//! Function to compute the majority of the iterator
+		/* 
+			\param first		the first element of the Iterator
+			\param last			the last element of the Iterator
+			\param columnName	the attribute name to be generated in the TeProperty's
+		*/
+		virtual  vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
+		{
+			TeProperty category;
+			category.attr_.rep_.type_ = this->defaultValue_.attr_.rep_.type_;
+	
+			map<string, int>  count;
+			Iterator it = first;
+			while (it != last)
+			{
+				if (it.getProperty (category) && category.value_ != dummy)
+					count[category.value_]++;
+
+				++it;
+			}
+	
+			TeProperty prop;
+			prop.attr_.rep_.type_ = category.attr_.rep_.type_;
+			prop.value_ = this->defaultValue_.value_;
+			prop.attr_.rep_.name_ = columnName; 
+			prop.attr_.rep_.numChar_ = 48;
+
+			int max = 0;
+			map <string, int>:: iterator count_it = count.begin();
+			while(count_it != count.end())  
+			{
+				if ((*count_it).second > max)
+				{
+					prop.value_ = (*count_it).first;
+					max = (*count_it).second;
+				}
+				++count_it;		
+			}
+			TePropertyVector  result;
+			result.push_back (prop);
+			return result;
+		}
+	private:
+		string dummy;
+};
+
+
+//! Class for compute the category with more occurences in the elements of a given iterator, using classes
+template<class Iterator>
+class TeMajorityCategoryStrategy: public TeComputeAttrStrategy<Iterator>   
+{
+	public:
+		//! Constructor
+		/*
+			\param classesMap		the returning values for each categoty
+			\param defaultValue		the type of the attribute to be created
+		*/	
+		TeMajorityCategoryStrategy (const map<string, string>& classesMap, TeAttrDataType defaultType = TeINT) 
+		{
+			this->defaultValue_.attr_.rep_.type_ = defaultType;
+			this->defaultValue_.value_ = "0"; 
+			classesMap_ = classesMap;
+		}
+
+		//! Destructor
+		virtual ~TeMajorityCategoryStrategy() {}
+
+		//! Function to compute the category with more occurrences
+		/* 
+			\param first		the first element of the Iterator
+			\param last			the last element of the Iterator
+			\param columnName	the attribute name to be generated in the TeProperty's
+		*/
+		virtual vector<TeProperty> compute (Iterator first, Iterator last, const string& columnName)
+		{
+			TeProperty category;
+			category.attr_.rep_.type_ = this->defaultValue_.attr_.rep_.type_;
+
+			// initialize count
+			map<string, int>  count;
+			map<string, string>::iterator itMap = classesMap_.begin();
+			while (itMap != classesMap_.end())
+			{
+				count[(*itMap).second] = 0;
+				++itMap;
+			}
+
+			Iterator it = first;
+			while (it != last)
+			{
+				if (it.getProperty (category))
+				{
+					count[classesMap_[category.value_]]++;
+				}
+				++it;
+			}
+
+			TePropertyVector  result;
+			TeProperty prop;
+			prop.attr_.rep_.type_ = TeSTRING;
+			//	prop.value_ = defaultValue_.value_;
+			prop.attr_.rep_.name_ = columnName; 
+			prop.attr_.rep_.numChar_ = 48;
+
+			int max = 0;
+			map <string, int>:: iterator count_it = count.begin();
+			while(count_it != count.end())  
+			{
+				if ((*count_it).second > max)
+				{
+					prop.value_ = (*count_it).first;
+					max = (*count_it).second;
+				}
+				++count_it;		
+			}
+
+			result.push_back (prop);
+			return result;
+		}
+
+	protected:
+			map<string, string> classesMap_;
+};
+/** @} */   
+
+
+
+/** @defgroup CellFillStrategies Spatial strategy hierarchy to compute cells attributes
+    @ingroup FillCellAlg
+	Abstract class in the strategies hierarchy for computing attribute values based on other layers 
+	(Strategy Design Pattern). 
+	@{
+ */
+//! Virtual class for computing attributes based on the spatial characteristics of the objects (Strategy Design Pattern)
+class TL_DLL TeComputeSpatialStrategy  
+{
+	public:
+		//! Destructor
+		virtual ~TeComputeSpatialStrategy() {}
+
+		//! Virtual function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual string compute(TeBox box) = 0;
+
+		//! The type of attriute generated by the class. Default is TeREAL
+		virtual TeAttrDataType Type() { return TeREAL; }
+
+		//! Return all the geometries within a given box
+		/* 
+			\param box		the box to be used
+			\patam att		the attribute returned together with the objects. If none, this function returns only the geometries
+		*/
+		TeQuerier* getWithinGeometry(TeBox box, string att = "");
+
+	protected:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+			\param rep_			the representation to be used	
+		*/	
+		TeComputeSpatialStrategy (TeTheme* theme_, TeGeomRep rep_) { theme = theme_; rep = rep_; }
+
+		//! Theme used to compute the attributes
+		TeTheme* theme;
+
+		//! The geometry of the theme used
+		TeGeomRep rep;
+};
+
+
+//! Class to compute the average of elements weighted by their areas
+//! It is useful when working with values representing averages
+class TL_DLL TeAverageWeighByAreaStrategy: public TeComputeSpatialStrategy 
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+			\param att_			the attribute used to compute the sum. It must be numerical
+			\param rep_			the representation to be used	
+		*/	
+		TeAverageWeighByAreaStrategy  (TeTheme* theme_, string att_, TeGeomRep rep_) : TeComputeSpatialStrategy(theme_, rep_) { attribute = att_; }
+
+		//! Destructor
+		virtual ~TeAverageWeighByAreaStrategy() {}
+
+		//! Function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual string compute (TeBox box);
+
+	private:
+		//! The attribute used to calculate the average
+		string attribute;
+};
+
+
+//! Class to compute the sum of elements weighted by their areas
+//! This function distribute the values keeping the overall sum of the elements on the layer
+class TL_DLL TeSumWeighByAreaStrategy: public TeComputeSpatialStrategy  
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+			\param att_			the attribute used to compute the sum. It must be numerical
+			\param rep_			the representation to be used	
+		*/	
+		TeSumWeighByAreaStrategy (TeTheme* theme_, string att_, TeGeomRep rep_) : TeComputeSpatialStrategy(theme_, rep_) { attribute = att_; }
+
+		//! Destructor
+		virtual ~TeSumWeighByAreaStrategy() {}
+
+		//! Function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual  string compute (TeBox box);
+
+	private:
+		//! The attribute used to calculate the average
+		string attribute;
+};
+
+
+//! Class to compute the value that occurs more frequently in a given box 
+class TL_DLL TeCategoryMajorityStrategy: public TeComputeSpatialStrategy  
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+			\param att_			the attribute used to compute the majority
+			\param classesMap	a map to reclassify the values
+		*/	
+		TeCategoryMajorityStrategy (TeTheme* theme_, string att_, map<string, string>& classesMap) : TeComputeSpatialStrategy(theme_, TePOLYGONS) 
+        	{classesMap = classesMap; attribute = att_;}
+
+		//! Destructor
+		virtual ~TeCategoryMajorityStrategy() {}
+
+		//! Function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual  string compute (TeBox box);	
+
+	protected:
+			//! The map of values
+			map<string, string> classesMap;
+
+			//! The attribute used in the majority
+			string attribute;
+};
+
+
+//! Class to count the elements in a given box 
+//! This class returns the number of elements whose BOX intercepts the box in the argument of compute
+//! For safety, use the count classes that inherit this one
+class TL_DLL TeCountObjectsStrategy: public TeComputeSpatialStrategy  
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+			\param geom_		the representation to be used	
+		*/	
+		TeCountObjectsStrategy (TeTheme* theme_, TeGeomRep geom_) : TeComputeSpatialStrategy(theme_, geom_) { }
+
+		//! Destructor
+		virtual ~TeCountObjectsStrategy() { }
+
+		//! Function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual string compute (TeBox box);
+
+		//! This class generates TeINT attributes
+		virtual TeAttrDataType Type() { return TeINT; }
+};
+
+
+//! Class to compute the number of polygons in a given box
+class TL_DLL TeCountPolygonalObjectsStrategy: public TeCountObjectsStrategy
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+		*/	
+		TeCountPolygonalObjectsStrategy (TeTheme* theme_) : TeCountObjectsStrategy(theme_, TePOLYGONS) {}
+
+		//! Function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual string compute (TeBox box);
+};
+
+
+//! Class to compute the number of lines in a given box
+class TL_DLL TeCountLineObjectsStrategy: public TeCountObjectsStrategy
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+		*/	
+		TeCountLineObjectsStrategy (TeTheme* theme_) : TeCountObjectsStrategy(theme_, TeLINES) {}
+
+		//! Function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual string compute (TeBox box);
+};
+
+
+//! Class to count the number of points in a given box
+class TL_DLL TeCountPointObjectsStrategy: public TeCountObjectsStrategy 
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+		*/	
+		TeCountPointObjectsStrategy (TeTheme* theme_) : TeCountObjectsStrategy(theme_, TePOINTS) {}
+};
+
+
+//! Class to compute the length of lines within a given box 
+class TL_DLL TeLineLengthStrategy: public TeComputeSpatialStrategy 
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+		*/	
+		TeLineLengthStrategy (TeTheme* theme_) : TeComputeSpatialStrategy(theme_, TeLINES){}
+
+		//! Destructor
+		virtual ~TeLineLengthStrategy() {}
+
+		//! Function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual  string compute (TeBox box);
+};
+
+
+//! Class to compute the area of polygons covering a given box
+class TL_DLL TeTotalAreaPercentageStrategy: public TeComputeSpatialStrategy  
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+		*/	
+		TeTotalAreaPercentageStrategy (TeTheme* theme_) : TeComputeSpatialStrategy(theme_, TePOLYGONS){}
+
+		//! Destructor
+		virtual ~TeTotalAreaPercentageStrategy() {}
+
+		//! Function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual string compute (TeBox box);
+};
+
+/*
+// pedro at 20061214
+//! Class to compute the distance based on a net 
+class TeMinimumDistanceNetStrategy:  public TeComputeSpatialStrategy
+{
+	public:
+		//! Constructor
+		TeMinimumDistanceNetStrategy(TeTheme* theme_, TeGeomRep rep_, TeGraphNetwork* net, double dist_ = 50) : TeComputeSpatialStrategy(theme_, rep_) { maxDist = dist_; tree = NULL; }
+		
+		//! Destructor
+		virtual ~TeMinimumDistanceNetStrategy() { if(tree) delete tree; }
+
+        void CreatePoints(TeCoord2D p1, TeCoord2D p2); // create all intermediate points between them, using the maximum distance
+
+		virtual string compute (TeBox box);
+
+		virtual TeAttrDataType Type() { return TeREAL; }
+
+	private:	
+
+		double maxDist;
+
+		vector<pair<TeCoord2D, TePoint> > dataSet;
+
+		KDTREE* tree;
+};
+*/
+
+
+//! Class to compute distances using KD-trees
+class TL_DLL TeMinimumDistanceStrategy:  public TeComputeSpatialStrategy
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+			\param gep_			the geometry to be used
+			\param distError_	the maximum error tolerated by this operator
+		*/	
+		TeMinimumDistanceStrategy(TeTheme* theme_, TeGeomRep rep_, double distError_ = 50); 
+
+		//! Destructor
+		virtual ~TeMinimumDistanceStrategy() { if(tree) delete tree; }
+
+		//! Function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual string compute (TeBox box);
+
+	protected:
+		//! Create intermediate points between two given points, using the maximum distance
+        void CreatePoints(TeCoord2D p1, TeCoord2D p2);
+
+		//! The maximum error in the computation
+		double maxDist;
+
+		//!
+		vector<pair<TeCoord2D, TePoint> > dataSet;
+
+		//! The tree to store the points
+		KDTREE* tree;
+};
+
+
+//! Class to compute the minimum distance to a theme of polygons. The calculatd distance is approximated, and has an error of at most
+//! the parameter dist_ in the constructor
+class TL_DLL TeMinimumDistancePolygonsStrategy: public TeMinimumDistanceStrategy
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+			\param distError_	the maximum error tolerated by this operator
+		*/	
+		TeMinimumDistancePolygonsStrategy(TeTheme* theme_, double distError_ = 150);
+
+		//! Destructor
+		virtual ~TeMinimumDistancePolygonsStrategy() {}
+
+		//! Function to compute the attribute
+		/* 
+			\param box		compute the attribute of a cell having this box
+		*/
+		virtual string compute (TeBox box);
+};
+
+
+//! Class to compute 
+class TL_DLL TeMinimumDistanceLinesStrategy : public TeMinimumDistanceStrategy
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+			\param distError_	the maximum error tolerated by this operator
+		*/	
+		TeMinimumDistanceLinesStrategy(TeTheme* theme_, double distError_ = 150);
+
+		//! Destructor
+		virtual ~TeMinimumDistanceLinesStrategy() {}
+};
+
+
+//! Class to calculate the minimum distance of a box to points.
+//! It calculates the exact value once the KD-tree calculates the exact distance to points
+class TL_DLL TeMinimumDistancePointsStrategy: public TeMinimumDistanceStrategy
+{
+	public:
+		//! Constructor
+		/* 
+			\param theme_		the theme to be used as basis for computing the attribute
+		*/	
+		TeMinimumDistancePointsStrategy(TeTheme* theme_);
+
+		//! Destructor
+		virtual ~TeMinimumDistancePointsStrategy() {}
+};
+
+/** @} */
+#endif
+
diff --git a/src/terralib/kernel/TeConsoleErrorMessage.cpp b/src/terralib/kernel/TeConsoleErrorMessage.cpp
old mode 100755
new mode 100644
index 451cc51..020ea6e
--- a/src/terralib/kernel/TeConsoleErrorMessage.cpp
+++ b/src/terralib/kernel/TeConsoleErrorMessage.cpp
@@ -1,51 +1,51 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include <iostream>
-#include "TeErrorMessage.h"
-
-using namespace std;
-
-class TeConsoleErrorMessage: public TeErrorMessage
-{
-public:
-   
-	TeConsoleErrorMessage(){}
-	~TeConsoleErrorMessage(){}
-	virtual TeMessageReturn apply ( 
-				  const string& appName, 
-				  const string & msgText, 
-				  TeMessageType	/* msgType */,
-				  TeMessageIcon /* iconType */ )
-	{ cout << appName << msgText; return Te_IDOK; }
-
-
-
-};
-
-
-class TeConsoleErrorMessagePrototype: public TeErrorMessagePrototype
-{
-	virtual TeErrorMessage* build()
-	{ return new TeConsoleErrorMessage(); }
-
-}consoleInstance;
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include <iostream>
+#include "TeErrorMessage.h"
+
+using namespace std;
+
+class TeConsoleErrorMessage: public TeErrorMessage
+{
+public:
+   
+	TeConsoleErrorMessage(){}
+	~TeConsoleErrorMessage(){}
+	virtual TeMessageReturn apply ( 
+				  const string& appName, 
+				  const string & msgText, 
+				  TeMessageType	/* msgType */,
+				  TeMessageIcon /* iconType */ )
+	{ cout << appName << msgText; return Te_IDOK; }
+
+
+
+};
+
+
+class TeConsoleErrorMessagePrototype: public TeErrorMessagePrototype
+{
+	virtual TeErrorMessage* build()
+	{ return new TeConsoleErrorMessage(); }
+
+}consoleInstance;
diff --git a/src/terralib/kernel/TeConsoleErrorMessage.h b/src/terralib/kernel/TeConsoleErrorMessage.h
old mode 100755
new mode 100644
index 8f697a1..52e0b78
--- a/src/terralib/kernel/TeConsoleErrorMessage.h
+++ b/src/terralib/kernel/TeConsoleErrorMessage.h
@@ -1,68 +1,68 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeConsoleErrorMessage.h
-    \brief This file deals with the display of error messages in a console
-*/
-#ifndef TeConsoleErrorMessage_H
-#define TeConsoleErrorMessage_H
-
-#include <iostream>
-#include "TeErrorMessage.h"
-
-using namespace std;
-
-//! A class to handle the display of error messages in a console
-class TeConsoleErrorMessage: public TeErrorMessage
-{
-public:
-   
-	//! Constructor
-	TeConsoleErrorMessage()
-	{}
-
-	//! Destructor
-	~TeConsoleErrorMessage()
-	{}
-
-	//! Display the message
-	virtual TeMessageReturn apply ( 
-				  const string& appName, 
-				  const string & msgText, 
-				  TeMessageType	msgType,
-				  TeMessageIcon iconType )
-	{ cout << appName << msgText; return Te_IDOK; }
-
-};
-
-//! A prototype of a Console Error Message handler
-class TeConsoleErrorMessagePrototype: public TeErrorMessagePrototype
-{
-	virtual TeErrorMessage* build()
-	{ return new TeConsoleErrorMessage(); }
-
-};
-
-//! A single instance of the console error message handler
-static TeConsoleErrorMessagePrototype consoleInstance;
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeConsoleErrorMessage.h
+    \brief This file deals with the display of error messages in a console
+*/
+#ifndef TeConsoleErrorMessage_H
+#define TeConsoleErrorMessage_H
+
+#include <iostream>
+#include "TeErrorMessage.h"
+
+using namespace std;
+
+//! A class to handle the display of error messages in a console
+class TeConsoleErrorMessage: public TeErrorMessage
+{
+public:
+   
+	//! Constructor
+	TeConsoleErrorMessage()
+	{}
+
+	//! Destructor
+	~TeConsoleErrorMessage()
+	{}
+
+	//! Display the message
+	virtual TeMessageReturn apply ( 
+				  const string& appName, 
+				  const string & msgText, 
+				  TeMessageType	msgType,
+				  TeMessageIcon iconType )
+	{ cout << appName << msgText; return Te_IDOK; }
+
+};
+
+//! A prototype of a Console Error Message handler
+class TeConsoleErrorMessagePrototype: public TeErrorMessagePrototype
+{
+	virtual TeErrorMessage* build()
+	{ return new TeConsoleErrorMessage(); }
+
+};
+
+//! A single instance of the console error message handler
+static TeConsoleErrorMessagePrototype consoleInstance;
+#endif
+
diff --git a/src/terralib/kernel/TeCoord2D.h b/src/terralib/kernel/TeCoord2D.h
old mode 100755
new mode 100644
index b10ec47..3c22d57
--- a/src/terralib/kernel/TeCoord2D.h
+++ b/src/terralib/kernel/TeCoord2D.h
@@ -1,160 +1,166 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeCoord2D.h
-    \brief This file contains the definition of a classes to handle 2D coordinates
-*/
-#ifndef  __TERRALIB_INTERNAL_COORD2D_H
-#define  __TERRALIB_INTERNAL_COORD2D_H
-
-#include <math.h>
-#include "TeDefines.h"
-#include "TePrecision.h"
-
-#include <vector>
-
-using namespace std;
-
-//! A class for handling 2D coordinates
-class TL_DLL TeCoord2D
-{
-public:
-
-	double	x_;		//!< x coordinate
-	double	y_;		//!< y coordinate
-
-	//! Default contructor
-	TeCoord2D ( const double& x = 0., const double& y = 0. ):
-		x_ ( x ), y_ ( y ) {}
-
-	//! Copy constructor
-	TeCoord2D (const TeCoord2D& cd) 			
-		{x_ = cd.x_; y_ = cd.y_;}
-
-	//! Operator =
-	TeCoord2D& operator= ( const TeCoord2D& cd )
-	{
-		if ( this != &cd )
-		{	
-			x_ = cd.x_; y_ = cd.y_;
-		}
-		return *this;
-	}
-		
-	//!	Empty destructor.
-	~TeCoord2D () { }
-
-	//!	Returns the X componente of the coordinate
-	const double&	x () const 				
-	{	return x_;	}
-
-	//!	Sets the X componente of the coordinate
-	void x ( const double& valX )
-	{	x_ = valX; }
-
-	//!	Returns the Y componente of the coordinate
-	const double& 	y () 		const		
-	{	return y_;	}
-
-	//!	Sets the Y componente of the coordinate
-	void y(const double& valY)
-	{	y_ = valY; }
-
-	//!	Sets the X and Y componentes of the coordinate
-	void setXY(const double& xVal, const double& yVal )
-	{	x_= xVal; y_= yVal; }
-
-	//!	Adds two coordinates
-	void 	operator+=(const TeCoord2D& cd)	{x_ += cd.x_; y_ += cd.y_;}
-
-	//!	Returns TRUE if current coordinate is smaller than or equal	to TeCoord2D cd; returns FALSE otherwise 
-	bool  operator<= (const TeCoord2D& cd) const 
-		{return (( y_ - cd.y_ <= TePrecision::instance().precision() ) && 
-		         ( x_ - cd.x_ <= TePrecision::instance().precision() ) );}	
-
-	//!	Returns TRUE if current coordinate is equal	to TeCoord2D cd; returns FALSE otherwise 
-	bool operator== (const TeCoord2D& cd) const 
-	{return (  ( fabs (y_ - cd.y_) < TePrecision::instance().precision() ) 
-			&& ( fabs (x_ - cd.x_) < TePrecision::instance().precision() ) ); }
-
-	//!	Returns TRUE if current coordinate is not equal to TeCoord2D cd; returns FALSE otherwise 
-	bool	operator!= (const TeCoord2D& cd) const 
-		{return ( ( fabs (y_ - cd.y_) >= TePrecision::instance().precision() ) 
-		       || ( fabs (x_ - cd.x_) >= TePrecision::instance().precision() ) );}	
-
-	//!	Returns TRUE if current coordinate is smaller than TeCoord2D cd; returns FALSE otherwise 
-	bool	operator< (const TeCoord2D& cd) const 
-		{return ( y_ - cd.y_ < TePrecision::instance().precision() 
-		       && x_ - cd.x_ < TePrecision::instance().precision() );}	
-
-	//!	Returns TRUE if current coordinate greater than maximum allowed; returns FALSE otherwise 
-	bool	tooBig ()
-		{return ( y_ > TeMAXFLOAT/10.|| x_ > TeMAXFLOAT/10.);}	
-
-	//!	Rescales the coordinate by a value in X (xscale) and in Y (yscale)
-	void	scale ( const double xscale, const double yscale )
-	{ x_ = x_* xscale; y_ = y_ * yscale; }
-
-
-	//!	Returns the middle coordinate in horizontal direction between current coordinate and rhs
-	TeCoord2D halfWayHoriz ( TeCoord2D& rhs )
-	{
-		TeCoord2D mid (( rhs.x() + x() ) / 2., y() );
-		return mid;
-	}
-
-	//!	Returns the middle coordinate in vertical direction between current coordinate and rhs
-	TeCoord2D halfWayVert  ( TeCoord2D& rhs )
-	{
-		TeCoord2D mid ( x(), ( y() + rhs.y() ) / 2. );
-		return mid;
-	}
-
-	//! A false interface to set an obejct identifier
-	void objectId(const string& /* id */ ) 
-	{	return;  }
-};
-
-//! An structure that contains a pair of coordinates
-struct TL_DLL TeCoordPair
-{
-	TeCoord2D pt1;	//!< First coordinate value.
-	TeCoord2D pt2;	//!< Second coordinate value.
-
-	//! Default contructor: [(0.0),(0.0)]
-	TeCoordPair():
-		pt1(TeCoord2D(0.0,0.0)),
-		pt2(TeCoord2D(0.0,0.0))
-	{}
-
-	//! Constructor with parameters
-	TeCoordPair(const TeCoord2D& p1, const TeCoord2D& p2):
-		pt1(p1),
-		pt2(p2)
-		{}
-};
-
-//! A vector of pairs of coordinates
-typedef vector<TeCoordPair> TeCoordPairVect;
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeCoord2D.h
+    \brief This file contains the definition of a classes to handle 2D coordinates
+*/
+#ifndef  __TERRALIB_INTERNAL_COORD2D_H
+#define  __TERRALIB_INTERNAL_COORD2D_H
+
+#include <math.h>
+#include "TeDefines.h"
+#include "TePrecision.h"
+
+#include <vector>
+
+using namespace std;
+
+//! A class for handling 2D coordinates
+class TL_DLL TeCoord2D
+{
+public:
+
+	double	x_;		//!< x coordinate
+	double	y_;		//!< y coordinate
+
+	//! Default contructor
+	TeCoord2D ( const double& x = 0., const double& y = 0. ):
+		x_ ( x ), y_ ( y ) {}
+
+	//! Copy constructor
+	TeCoord2D (const TeCoord2D& cd) 			
+		{x_ = cd.x_; y_ = cd.y_;}
+
+	//! Operator =
+	TeCoord2D& operator= ( const TeCoord2D& cd )
+	{
+		if ( this != &cd )
+		{	
+			x_ = cd.x_; y_ = cd.y_;
+		}
+		return *this;
+	}
+		
+	//!	Empty destructor.
+	~TeCoord2D () { }
+
+	//!	Returns the X componente of the coordinate
+	const double&	x () const 				
+	{	return x_;	}
+
+	//!	Sets the X componente of the coordinate
+	void x ( const double& valX )
+	{	x_ = valX; }
+
+	//!	Returns the Y componente of the coordinate
+	const double& 	y () 		const		
+	{	return y_;	}
+
+	//!	Sets the Y componente of the coordinate
+	void y(const double& valY)
+	{	y_ = valY; }
+
+	//!	Sets the X and Y componentes of the coordinate
+	void setXY(const double& xVal, const double& yVal )
+	{	x_= xVal; y_= yVal; }
+
+	//!	Adds two coordinates
+	void 	operator+=(const TeCoord2D& cd)	{x_ += cd.x_; y_ += cd.y_;}
+
+	//!	Returns TRUE if current coordinate is smaller than or equal	to TeCoord2D cd; returns FALSE otherwise 
+	bool  operator<= (const TeCoord2D& cd) const 
+		{return (( y_ - cd.y_ <= TePrecision::instance().precision() ) && 
+		         ( x_ - cd.x_ <= TePrecision::instance().precision() ) );}	
+
+	//!	Returns TRUE if current coordinate is equal	to TeCoord2D cd; returns FALSE otherwise 
+	bool operator== (const TeCoord2D& cd) const 
+	{return (  ( fabs (y_ - cd.y_) < TePrecision::instance().precision() ) 
+			&& ( fabs (x_ - cd.x_) < TePrecision::instance().precision() ) ); }
+
+	//!	Returns TRUE if current coordinate is not equal to TeCoord2D cd; returns FALSE otherwise 
+	bool	operator!= (const TeCoord2D& cd) const 
+		{return ( ( fabs (y_ - cd.y_) >= TePrecision::instance().precision() ) 
+		       || ( fabs (x_ - cd.x_) >= TePrecision::instance().precision() ) );}	
+
+	//!	Returns TRUE if current coordinate is smaller than TeCoord2D cd; returns FALSE otherwise 
+	bool	operator< (const TeCoord2D& cd) const 
+		{return ( y_ - cd.y_ < TePrecision::instance().precision() 
+		       && x_ - cd.x_ < TePrecision::instance().precision() );}	
+
+	//!	Returns TRUE if current coordinate greater than maximum allowed; returns FALSE otherwise 
+	bool	tooBig ()
+		{return ( y_ > TeMAXFLOAT/10.|| x_ > TeMAXFLOAT/10.);}	
+
+	//!	Rescales the coordinate by a value in X (xscale) and in Y (yscale)
+	void	scale ( const double xscale, const double yscale )
+	{ x_ = x_* xscale; y_ = y_ * yscale; }
+
+
+	//!	Returns the middle coordinate in horizontal direction between current coordinate and rhs
+	TeCoord2D halfWayHoriz ( TeCoord2D& rhs )
+	{
+		TeCoord2D mid (( rhs.x() + x() ) / 2., y() );
+		return mid;
+	}
+
+	//!	Returns the middle coordinate in vertical direction between current coordinate and rhs
+	TeCoord2D halfWayVert  ( TeCoord2D& rhs )
+	{
+		TeCoord2D mid ( x(), ( y() + rhs.y() ) / 2. );
+		return mid;
+	}
+
+	//! A false interface to set an obejct identifier
+	void objectId(const string& /* id */ ) 
+	{	return;  }
+};
+
+//! An structure that contains a pair of coordinates
+struct TL_DLL TeCoordPair
+{
+	TeCoord2D pt1;	//!< First coordinate value.
+	TeCoord2D pt2;	//!< Second coordinate value.
+
+	//! Default contructor: [(0.0),(0.0)]
+	TeCoordPair():
+		pt1(TeCoord2D(0.0,0.0)),
+		pt2(TeCoord2D(0.0,0.0))
+	{}
+
+	//! Constructor with parameters
+	TeCoordPair(const TeCoord2D& p1, const TeCoord2D& p2):
+		pt1(p1),
+		pt2(p2)
+		{}
+    
+  // overload
+  bool operator==( const TeCoordPair& external ) const
+  {
+    return ( ( pt1 == external.pt1 ) && ( pt2 == external.pt2 ) );
+  }
+};
+
+//! A vector of pairs of coordinates
+typedef vector<TeCoordPair> TeCoordPairVect;
+
+#endif
+
diff --git a/src/terralib/kernel/TeCounted.h b/src/terralib/kernel/TeCounted.h
old mode 100755
new mode 100644
index e13ce40..7096c07
--- a/src/terralib/kernel/TeCounted.h
+++ b/src/terralib/kernel/TeCounted.h
@@ -1,77 +1,77 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeCounted.h
-    \brief This file contains classes to support the counted object idiom
-*/
-
-//! Supports the counted object idiom
-/*! 
-	A counted class keeps track of how many abstract instances are pointing
-	to the same implementation.
-*/
-
-#ifndef  __TERRALIB_INTERNAL_COUNTED_H
-#define  __TERRALIB_INTERNAL_COUNTED_H
-
-#include "TeDefines.h"
-
-class TL_DLL TeCounted {
-public:
-
-// -- Contructors
-
-	//! Constructor: sets zero references when the object is  built
-	TeCounted(): refCount_ ( 0 ){}
-	
-// -- Methods
-
-	//! Increases the number of references to this object
-	void attach ()
-		{ refCount_++; }
-
-	//! Decreases the number of references to this object. Destroy it if there are no more references to it
-	void detach ()
-		{ if ( --refCount_ == 0 )
-			delete this; }
-
-	//! Returns the number of references to this object
-	int refCount()
-	{ return refCount_; }
-
-	//! Destructor
-	virtual ~TeCounted(){}
-
-private:
-
-	//! No copy allowed
-	TeCounted(const TeCounted&);
-
-	//! No copy allowed
-	TeCounted& operator=(const TeCounted&){return *this;}
-
-// -- Members
-	int refCount_; 	//!< the number of references to this class
-};
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeCounted.h
+    \brief This file contains classes to support the counted object idiom
+*/
+
+//! Supports the counted object idiom
+/*! 
+	A counted class keeps track of how many abstract instances are pointing
+	to the same implementation.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_COUNTED_H
+#define  __TERRALIB_INTERNAL_COUNTED_H
+
+#include "TeDefines.h"
+
+class TL_DLL TeCounted {
+public:
+
+// -- Contructors
+
+	//! Constructor: sets zero references when the object is  built
+	TeCounted(): refCount_ ( 0 ){}
+	
+// -- Methods
+
+	//! Increases the number of references to this object
+	void attach ()
+		{ refCount_++; }
+
+	//! Decreases the number of references to this object. Destroy it if there are no more references to it
+	void detach ()
+		{ if ( --refCount_ == 0 )
+			delete this; }
+
+	//! Returns the number of references to this object
+	int refCount()
+	{ return refCount_; }
+
+	//! Destructor
+	virtual ~TeCounted(){}
+
+private:
+
+	//! No copy allowed
+	TeCounted(const TeCounted&);
+
+	//! No copy allowed
+	TeCounted& operator=(const TeCounted&){return *this;}
+
+// -- Members
+	int refCount_; 	//!< the number of references to this class
+};
+
+#endif
+
diff --git a/src/terralib/kernel/TeCoverage.h b/src/terralib/kernel/TeCoverage.h
index 617c7b0..a73ce76 100644
--- a/src/terralib/kernel/TeCoverage.h
+++ b/src/terralib/kernel/TeCoverage.h
@@ -1,378 +1,378 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*!
-  \file TeCoverage.h
-
-  \par This file contains structures and definitions for a generic
-       Coverage representation.
-*/
-#ifndef  __TERRALIB_INTERNAL_COVERAGE_H
-#define  __TERRALIB_INTERNAL_COVERAGE_H
-
-#include "TeGeometry.h"
-#include "TeDataTypes.h"
-#include "TeCoverageParams.h"
-#include "TeCoverageDecoder.h"
-#include "TeCoverageDecoderCacheLRU.h"
-#include "TeCoverageDecoderDatabase.h"
-#include "TeCoverageInterpolator.h"
-#include "TeCoverageInterpolatorNN.h"
-#include <vector>
-
-/*!
-  \class TeCoverage
-  \brief A generic Coverage class.
-
-  \par Coverage is a way of representing geographic information that
-       emphasizes relationships and the spatial distribution of earth
-       phenomena, rather than emphasizing features of independent locations.
-  \par This class represents a generic Coverage, which is a Coverage
-       with a generic geographic domain, e.g. a set of points or a set
-       of surfaces. Each element of the domain is associated to a value vector
-       that represents the different dimensions of the coverage information.
-  \par Each coverage is connected to a decoder, which provides a common
-       interface for retrieving coverage data wherever it is stored.
-  \par The elements of the domain can be traversed and its values can be
-       consulted using the coverage iterator. Also, the values on arbitrary
-       locations can be consulted using interpolation methods.
-  \sa TeCoverageParams TeCoverageDecoder TeCoverageInterpolator
-*/
-template <class T>
-class TeCoverage : public TeGeometry
-{
-public:
-
-    //! Constructor from parameters and interpolator
-    /*!
-      Construct a coverage object, but do not initialize the internal
-      structures. The interpolator provided must be for exclusive use of
-      this coverage, any external use of the interpolator is discouraged.
-      \param params information about the coverage
-      \param interpolator pointer to a coverage iterpolator
-    */
-    TeCoverage(TeCoverageParams& params, TeCoverageInterpolator<T>* interpolator = NULL) :
-        params_(params),
-        interpolator_(interpolator),
-        decoder_(NULL)
-    {
-    }
-
-    //! Coverage destructor
-    /*!
-      Clear internal structures before destroying the coverage object.
-    */
-    virtual ~TeCoverage()
-    {
-        clear();
-    }
-
-    //! Initalize the coverage
-    /*!
-      Instantiate internal structures, preparing the coverage for actual use.
-      Must be called before any attempt to read from the coverage.
-    */
-    virtual void init()
-    {
-        // Initialize decoder according to persistence type
-        if (!decoder_)
-        {
-            if (params_.getPersistenceType() == TePERSISTENCE_DATABASE)
-            {
-                decoder_ = new TeCoverageDecoderDatabase<T>(params_);
-                decoder_->init();
-            }
-            else if (params_.getPersistenceType() == TePERSISTENCE_DATABASE_CACHELRU)
-            {
-                decoder_ = new TeCoverageDecoderCacheLRU<T>(params_);
-                decoder_->init();
-            }
-        }
-
-        // Initialize interpolator
-        if (!interpolator_)
-        {
-            // If undefined, create default interpolator
-            interpolator_ = createDefaultInterpolator();
-        }
-        interpolator_->setDecoder(decoder_);
-
-        // Set box according to params
-        setBox(params_.getBoundingBox());
-    }
-
-    //! Clear internal structures
-    /*!
-      Clear internal structures such as de decoder and the interpolator.
-    */
-    virtual void clear()
-    {
-        if (decoder_)
-        {
-            delete(decoder_);
-            decoder_ = NULL;
-        }
-        if (interpolator_)
-        {
-            delete(interpolator_);
-            interpolator_ = NULL;
-        }
-    }
-
-    //! Return the type of the geometry
-    /*!
-      \return the type of the geometry
-    */
-    TeGeomRep elemType()
-    {
-        return TeCOVERAGE;
-    }
-
-    //! Return the coverage parameters
-    /*!
-      \return the coverage parameters
-    */
-    TeCoverageParams& getParameters()
-    {
-        return params_;
-    }
-
-    /*!
-      \class iterator
-      \brief A generic Coverage iterator.
-
-      \par An iterator for a Coverage representation. This iterator
-           is specific for traversing a set of generic geometries and basically
-           it encapsulates a generic geometry-value pair iterator.
-      \par The move-forward operators are used to traverse the coverage data.
-           At any point of the traversal, dereferencing operators might be used
-           to access the generic geometry, while the "[]" operator might be
-           used to access the values in different dimensions of the coverage.
-      \sa TeCoverage
-    */
-    class iterator
-    {
-        /*!
-          \typedef geom_it
-          \brief Generic geometry-value pair vector iterator.
-        */
-        typedef typename std::vector<TeGeomValuePair<T> >::iterator geom_it;
-    public:
-
-        //! Constructor from the base iterator
-        iterator(geom_it it) :
-            it_(it)
-        {
-        }
-          
-        //! Destructor
-        virtual ~iterator()
-        {
-        }
-
-        //! Prefix move-forward operator
-        iterator operator++()
-        {
-            it_++;
-            return *this;
-        }
-    
-        //! Posfix move-forward operator
-        iterator operator++(int)
-        {
-            iterator temp = *this;
-            ++it_;
-            return temp;
-        }
-
-        //! Operator for retrieving an instance of a generic geometry
-        /*!
-          \return an instance of a generic geometry
-        */
-        T operator*()
-        {
-            return it_->geom;
-        }
-
-        //! Operator for retrieving a pointer to a generic geometry
-        /*!
-          \return a pointer to a generic geometry
-        */
-        T* operator->()
-        {
-            return &(it_->geom);
-        }
-        
-        //! Operator for getting the value at a dimension of the coverage
-        /*!
-          \param dimension the dimension to be retrieved
-          \return a double value
-        */
-        double operator[](int dimension)
-        {
-            return it_->value[dimension];
-        }
-        
-        //! Return whether two iterators point to the same element
-        bool operator==(const iterator& rhs)
-        {
-            return it_ == rhs.it_;
-        }
-
-        //! Return whether two iterators point to the different elements
-        bool operator!=(const iterator& rhs)
-        {
-            return it_ != rhs.it_;
-        }
-
-    protected:
-        geom_it it_; //!< Generic geometry-value pair vector iterator
-    };   
-
-    // ---------------------  End of class TeCoverage::iterator
-
-    //! Return the beginning iterator
-    /*!
-      \par Return the beginning iterator for traversing the generic geometries
-           that form the spatial domain of this coverage.
-      \par The polygon parameter may be used to define a selection area. If no
-           polygon is provided, the selection area includes all the domain.
-      \par The relation parameter may be used to specify the kind of relation
-           (e.g. intersection, crossing, overlapping) that holds between the
-           selection area and the geometries to be selected . If no relation
-           is provided, it defaults to intersection.
-      \param poly an instance of TePolygon representing a selection area
-      \param relation a spatial relation
-      \return the beginning iterator
-    */
-    typename TeCoverage<T>::iterator begin(
-            TePolygon& poly = TePolygon(),
-            TeSpatialRelation relation = TeINTERSECTS)
-    {
-        std::vector<TeGeomValuePair<T> >& selected = selectGeomValuePairs(poly, relation);
-        TeCoverage<T>::iterator beginIt = TeCoverage<T>::iterator(selected.begin());
-        return beginIt;
-    }
-
-    //! Return the ending iterator
-    /*!
-      \par Return the beginning iterator for traversing the generic geometries
-           that form the spatial domain of this coverage.
-      \par The polygon parameter may be used to define a selection area. If no
-           polygon is provided, the selection area includes all the domain.
-      \par The relation parameter may be used to specify the kind of relation
-           (e.g. intersection, crossing, overlapping) that holds between the
-           selection area and the geometries to be selected . If no relation
-           is provided, it defaults to intersection.
-      \param poly an instance of TePolygon representing a selection area
-      \param relation a spatial relation
-      \return the ending iterator
-    */
-    typename TeCoverage<T>::iterator end(
-            TePolygon& poly = TePolygon(),
-            TeSpatialRelation relation = TeINTERSECTS)
-    {
-        std::vector<TeGeomValuePair<T> >& selected = selectGeomValuePairs(poly, relation);
-        TeCoverage<T>::iterator endIt = TeCoverage<T>::iterator(selected.end());
-        return endIt;
-    }
-
-    //! Evaluate the value of this coverage at an arbitrary location.
-    /*!
-      Evaluate the value of this coverage at an arbitrary location, using
-      the auxiliary interpolator object.
-      \param position the arbitrary location to be evaluated
-      \param the value vector, to be filled by this method
-    */
-    void evaluate(const TeCoord2D& location, std::vector<double>& value)
-    {
-        interpolator_->evaluate(location, value);
-    }
-
-    //! Fill a region of a raster with interpolated coverage data.
-    /*!
-      \par Fill the pixels of a squared region of a raster with
-           coverage data, using an interpolation method.
-      \param raster the raster to be filled with coverage data
-      \param rasterBand the raster band to be filled
-      \param coverageDimension the coverage dimension to be evaluated
-      \param box defines the raster region to be filled
-    */
-    void evaluate(TeRaster& raster, const int rasterBand, const int coverageDimension, const TeBox& box = TeBox())
-    {
-        interpolator_->evaluate(raster, rasterBand, coverageDimension, box);
-    }
-
-protected:
-
-    TeCoverageParams& params_; //!< stores information about this coverage
-    TeCoverageDecoder<T>* decoder_; //!< provides access to the coverage data
-    TeCoverageInterpolator<T>* interpolator_; //!< provides interpolation methods
-
-    //! Create a default interpolator
-    /*!
-      Create a default interpolator. This method is used in case no other
-      interpolator was provided on construction.
-    */
-    TeCoverageInterpolator<T>* createDefaultInterpolator()
-    {
-        // Default Coverage interpolator is nearest neighbour
-        return new TeCoverageInterpolatorNN<T>();
-    }
-
-    //! Select generic geometry-value pairs from the coverage
-    /*!
-      \par Select generic geometry-value pairs from the coverage, using the
-           decoder to access the coverage data.
-      \par The polygon parameter defines a selection area and the relation
-           parameter specifies the kind of relation (e.g. intersection,
-           crossing, overlapping) that holds between the selection area and
-           the geometries to be selected.
-      \param poly an instance of TePolygon representing a selection area
-      \param relation a spatial relation
-    */
-    std::vector<TeGeomValuePair<T> >& selectGeomValuePairs(const TePolygon& poly, const TeSpatialRelation relation)
-    {
-        std::vector<TeGeomValuePair<T> >& selected = lastSelectionResult_;
-
-        // Search decoder only if the selection is different from the last one
-        if ((!TeEquals(lastSelectionPolygon_, poly)) || lastSelectionRelation_ != relation)
-        {
-            decoder_->selectGeomValuePairs(poly, relation, selected);
-
-            // Save selection parameters and result
-            lastSelectionPolygon_ = poly;
-            lastSelectionRelation_ = relation;
-            lastSelectionResult_ = selected;
-        }
-        return selected;
-    }
-
-private:
-
-    TePolygon lastSelectionPolygon_; //!< the last polygon used for a selection
-    TeSpatialRelation lastSelectionRelation_; //!< the last relation used for a selection
-    std::vector<TeGeomValuePair<T> > lastSelectionResult_; //!< the last result of a selection
-};
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*!
+  \file TeCoverage.h
+
+  \par This file contains structures and definitions for a generic
+       Coverage representation.
+*/
+#ifndef  __TERRALIB_INTERNAL_COVERAGE_H
+#define  __TERRALIB_INTERNAL_COVERAGE_H
+
+#include "TeGeometry.h"
+#include "TeDataTypes.h"
+#include "TeCoverageParams.h"
+#include "TeCoverageDecoder.h"
+#include "TeCoverageDecoderCacheLRU.h"
+#include "TeCoverageDecoderDatabase.h"
+#include "TeCoverageInterpolator.h"
+#include "TeCoverageInterpolatorNN.h"
+#include <vector>
+
+/*!
+  \class TeCoverage
+  \brief A generic Coverage class.
+
+  \par Coverage is a way of representing geographic information that
+       emphasizes relationships and the spatial distribution of earth
+       phenomena, rather than emphasizing features of independent locations.
+  \par This class represents a generic Coverage, which is a Coverage
+       with a generic geographic domain, e.g. a set of points or a set
+       of surfaces. Each element of the domain is associated to a value vector
+       that represents the different dimensions of the coverage information.
+  \par Each coverage is connected to a decoder, which provides a common
+       interface for retrieving coverage data wherever it is stored.
+  \par The elements of the domain can be traversed and its values can be
+       consulted using the coverage iterator. Also, the values on arbitrary
+       locations can be consulted using interpolation methods.
+  \sa TeCoverageParams TeCoverageDecoder TeCoverageInterpolator
+*/
+template <class T>
+class TeCoverage : public TeGeometry
+{
+public:
+
+    //! Constructor from parameters and interpolator
+    /*!
+      Construct a coverage object, but do not initialize the internal
+      structures. The interpolator provided must be for exclusive use of
+      this coverage, any external use of the interpolator is discouraged.
+      \param params information about the coverage
+      \param interpolator pointer to a coverage iterpolator
+    */
+    TeCoverage(TeCoverageParams& params, TeCoverageInterpolator<T>* interpolator = NULL) :
+        params_(params),
+        interpolator_(interpolator),
+        decoder_(NULL)
+    {
+    }
+
+    //! Coverage destructor
+    /*!
+      Clear internal structures before destroying the coverage object.
+    */
+    virtual ~TeCoverage()
+    {
+        clear();
+    }
+
+    //! Initalize the coverage
+    /*!
+      Instantiate internal structures, preparing the coverage for actual use.
+      Must be called before any attempt to read from the coverage.
+    */
+    virtual void init()
+    {
+        // Initialize decoder according to persistence type
+        if (!decoder_)
+        {
+            if (params_.getPersistenceType() == TePERSISTENCE_DATABASE)
+            {
+                decoder_ = new TeCoverageDecoderDatabase<T>(params_);
+                decoder_->init();
+            }
+            else if (params_.getPersistenceType() == TePERSISTENCE_DATABASE_CACHELRU)
+            {
+                decoder_ = new TeCoverageDecoderCacheLRU<T>(params_);
+                decoder_->init();
+            }
+        }
+
+        // Initialize interpolator
+        if (!interpolator_)
+        {
+            // If undefined, create default interpolator
+            interpolator_ = createDefaultInterpolator();
+        }
+        interpolator_->setDecoder(decoder_);
+
+        // Set box according to params
+        setBox(params_.getBoundingBox());
+    }
+
+    //! Clear internal structures
+    /*!
+      Clear internal structures such as de decoder and the interpolator.
+    */
+    virtual void clear()
+    {
+        if (decoder_)
+        {
+            delete(decoder_);
+            decoder_ = NULL;
+        }
+        if (interpolator_)
+        {
+            delete(interpolator_);
+            interpolator_ = NULL;
+        }
+    }
+
+    //! Return the type of the geometry
+    /*!
+      \return the type of the geometry
+    */
+    TeGeomRep elemType()
+    {
+        return TeCOVERAGE;
+    }
+
+    //! Return the coverage parameters
+    /*!
+      \return the coverage parameters
+    */
+    TeCoverageParams& getParameters()
+    {
+        return params_;
+    }
+
+    /*!
+      \class iterator
+      \brief A generic Coverage iterator.
+
+      \par An iterator for a Coverage representation. This iterator
+           is specific for traversing a set of generic geometries and basically
+           it encapsulates a generic geometry-value pair iterator.
+      \par The move-forward operators are used to traverse the coverage data.
+           At any point of the traversal, dereferencing operators might be used
+           to access the generic geometry, while the "[]" operator might be
+           used to access the values in different dimensions of the coverage.
+      \sa TeCoverage
+    */
+    class iterator
+    {
+        /*!
+          \typedef geom_it
+          \brief Generic geometry-value pair vector iterator.
+        */
+        typedef typename std::vector<TeGeomValuePair<T> >::iterator geom_it;
+    public:
+
+        //! Constructor from the base iterator
+        iterator(geom_it it) :
+            it_(it)
+        {
+        }
+          
+        //! Destructor
+        virtual ~iterator()
+        {
+        }
+
+        //! Prefix move-forward operator
+        iterator operator++()
+        {
+            it_++;
+            return *this;
+        }
+    
+        //! Posfix move-forward operator
+        iterator operator++(int)
+        {
+            iterator temp = *this;
+            ++it_;
+            return temp;
+        }
+
+        //! Operator for retrieving an instance of a generic geometry
+        /*!
+          \return an instance of a generic geometry
+        */
+        T operator*()
+        {
+            return it_->geom;
+        }
+
+        //! Operator for retrieving a pointer to a generic geometry
+        /*!
+          \return a pointer to a generic geometry
+        */
+        T* operator->()
+        {
+            return &(it_->geom);
+        }
+        
+        //! Operator for getting the value at a dimension of the coverage
+        /*!
+          \param dimension the dimension to be retrieved
+          \return a double value
+        */
+        double operator[](int dimension)
+        {
+            return it_->value[dimension];
+        }
+        
+        //! Return whether two iterators point to the same element
+        bool operator==(const iterator& rhs)
+        {
+            return it_ == rhs.it_;
+        }
+
+        //! Return whether two iterators point to the different elements
+        bool operator!=(const iterator& rhs)
+        {
+            return it_ != rhs.it_;
+        }
+
+    protected:
+        geom_it it_; //!< Generic geometry-value pair vector iterator
+    };   
+
+    // ---------------------  End of class TeCoverage::iterator
+
+    //! Return the beginning iterator
+    /*!
+      \par Return the beginning iterator for traversing the generic geometries
+           that form the spatial domain of this coverage.
+      \par The polygon parameter may be used to define a selection area. If no
+           polygon is provided, the selection area includes all the domain.
+      \par The relation parameter may be used to specify the kind of relation
+           (e.g. intersection, crossing, overlapping) that holds between the
+           selection area and the geometries to be selected . If no relation
+           is provided, it defaults to intersection.
+      \param poly an instance of TePolygon representing a selection area
+      \param relation a spatial relation
+      \return the beginning iterator
+    */
+    typename TeCoverage<T>::iterator begin(
+            TePolygon& poly = TePolygon(),
+            TeSpatialRelation relation = TeINTERSECTS)
+    {
+        std::vector<TeGeomValuePair<T> >& selected = selectGeomValuePairs(poly, relation);
+        TeCoverage<T>::iterator beginIt = TeCoverage<T>::iterator(selected.begin());
+        return beginIt;
+    }
+
+    //! Return the ending iterator
+    /*!
+      \par Return the beginning iterator for traversing the generic geometries
+           that form the spatial domain of this coverage.
+      \par The polygon parameter may be used to define a selection area. If no
+           polygon is provided, the selection area includes all the domain.
+      \par The relation parameter may be used to specify the kind of relation
+           (e.g. intersection, crossing, overlapping) that holds between the
+           selection area and the geometries to be selected . If no relation
+           is provided, it defaults to intersection.
+      \param poly an instance of TePolygon representing a selection area
+      \param relation a spatial relation
+      \return the ending iterator
+    */
+    typename TeCoverage<T>::iterator end(
+            TePolygon& poly = TePolygon(),
+            TeSpatialRelation relation = TeINTERSECTS)
+    {
+        std::vector<TeGeomValuePair<T> >& selected = selectGeomValuePairs(poly, relation);
+        TeCoverage<T>::iterator endIt = TeCoverage<T>::iterator(selected.end());
+        return endIt;
+    }
+
+    //! Evaluate the value of this coverage at an arbitrary location.
+    /*!
+      Evaluate the value of this coverage at an arbitrary location, using
+      the auxiliary interpolator object.
+      \param position the arbitrary location to be evaluated
+      \param the value vector, to be filled by this method
+    */
+    void evaluate(const TeCoord2D& location, std::vector<double>& value)
+    {
+        interpolator_->evaluate(location, value);
+    }
+
+    //! Fill a region of a raster with interpolated coverage data.
+    /*!
+      \par Fill the pixels of a squared region of a raster with
+           coverage data, using an interpolation method.
+      \param raster the raster to be filled with coverage data
+      \param rasterBand the raster band to be filled
+      \param coverageDimension the coverage dimension to be evaluated
+      \param box defines the raster region to be filled
+    */
+    void evaluate(TeRaster& raster, const int rasterBand, const int coverageDimension, const TeBox& box = TeBox())
+    {
+        interpolator_->evaluate(raster, rasterBand, coverageDimension, box);
+    }
+
+protected:
+
+    TeCoverageParams& params_; //!< stores information about this coverage
+    TeCoverageDecoder<T>* decoder_; //!< provides access to the coverage data
+    TeCoverageInterpolator<T>* interpolator_; //!< provides interpolation methods
+
+    //! Create a default interpolator
+    /*!
+      Create a default interpolator. This method is used in case no other
+      interpolator was provided on construction.
+    */
+    TeCoverageInterpolator<T>* createDefaultInterpolator()
+    {
+        // Default Coverage interpolator is nearest neighbour
+        return new TeCoverageInterpolatorNN<T>();
+    }
+
+    //! Select generic geometry-value pairs from the coverage
+    /*!
+      \par Select generic geometry-value pairs from the coverage, using the
+           decoder to access the coverage data.
+      \par The polygon parameter defines a selection area and the relation
+           parameter specifies the kind of relation (e.g. intersection,
+           crossing, overlapping) that holds between the selection area and
+           the geometries to be selected.
+      \param poly an instance of TePolygon representing a selection area
+      \param relation a spatial relation
+    */
+    std::vector<TeGeomValuePair<T> >& selectGeomValuePairs(const TePolygon& poly, const TeSpatialRelation relation)
+    {
+        std::vector<TeGeomValuePair<T> >& selected = lastSelectionResult_;
+
+        // Search decoder only if the selection is different from the last one
+        if ((!TeEquals(lastSelectionPolygon_, poly)) || lastSelectionRelation_ != relation)
+        {
+            decoder_->selectGeomValuePairs(poly, relation, selected);
+
+            // Save selection parameters and result
+            lastSelectionPolygon_ = poly;
+            lastSelectionRelation_ = relation;
+            lastSelectionResult_ = selected;
+        }
+        return selected;
+    }
+
+private:
+
+    TePolygon lastSelectionPolygon_; //!< the last polygon used for a selection
+    TeSpatialRelation lastSelectionRelation_; //!< the last relation used for a selection
+    std::vector<TeGeomValuePair<T> > lastSelectionResult_; //!< the last result of a selection
+};
+
+
 #endif // __TERRALIB_INTERNAL_COVERAGE_H
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageDecoder.h b/src/terralib/kernel/TeCoverageDecoder.h
index 6ef7358..55970d7 100644
--- a/src/terralib/kernel/TeCoverageDecoder.h
+++ b/src/terralib/kernel/TeCoverageDecoder.h
@@ -1,186 +1,186 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*!
-  \file TeCoverageDecoder.h
-
-  \par This file contains definitions and algorithms for accessing persistent
-       representations of a generic Coverage.
-*/
-#ifndef  __TERRALIB_INTERNAL_COVERAGEDECODER_H
-#define  __TERRALIB_INTERNAL_COVERAGEDECODER_H
-
-#include "TeCoord2D.h"
-#include "TeException.h"
-#include "TeBlockLoader.h"
-#include "TeCoverageParams.h"
-#include "TeCoverageUtils.h"
-#include "TeSpatialOperations.h"
-#include <map>
-#include <vector>
-
-/*!
-  \def READ
-  \brief Read a value of some type from a pointer to a block of raw data.
-*/
-#define READ(data, t) *(t*)data; data += sizeof(t)
-
-/*!
-  \struct TeGeomValuePair
-  \brief A generic geometry-value pair.
-*/
-template <class T>
-struct TeGeomValuePair
-{
-    T geom; //!< A generic geometry
-    std::vector<double> value; //!< a value vector
-
-    //! Default constructor.
-    TeGeomValuePair(){}
-
-    //! Constructor for a generic geometry-value pair
-    TeGeomValuePair(const T& geom,
-                     const std::vector<double>& value):
-            geom(geom),
-            value(value){}
-};
-
-
-
-/*!
-  \struct TeCoverageBlock
-  \brief A generic coverage block.
-
-  \par A generic coverage block contais a set of generic geometry-value pairs.
-  \par This coverage block has a box, which is the minimum box enclosing all
-       the generic geometries that are in the block.
-*/
-template <class T>
-struct TeCoverageBlock
-{
-    int id; //!< The identifier of the block
-    TeBox box; //!< The minimum box enclosing all elements of the block
-    std::vector<TeGeomValuePair<T> > pairs; //!< vector of geometry-value pairs
-};
-
-/*!
-  \class TeCoverageDecoder
-  \brief Abstract class of a coverage data decoder.
-
-  \par The decoder is used to provide a common interface for accessing
-       coverage data regardless of where and how it is stored.
-  \sa TeGeomValuePair TeCoverageBlock
-*/
-template <class T>
-class TeCoverageDecoder
-{
-public:
-
-    //! Constructor from coverage parameters
-    TeCoverageDecoder(TeCoverageParams& params) :
-        params_(params)
-    {
-    }
-
-    //! Destructor
-    virtual ~TeCoverageDecoder()
-    {
-        clear();
-    }
-
-    //! Return the coverage parameters
-    virtual TeCoverageParams& getParameters()
-    {
-        return params_;
-    }
-
-    //! Initialize internal structures
-    /*!
-      Instantiate internal structures, must be called before any attempt
-      to access the coverage data.
-    */
-    virtual void init()
-    {
-    }
-
-    //! Clear internal structures
-    /*!
-      Clear internal structures, must be called before disposing of the
-      decoder.
-    */
-    virtual void clear()
-    {
-    }
-
-    //! Select generic geometry-value pairs from the coverage data
-    /*!
-      \par Select generic geometry-value pairs from the coverage data.
-      \par The polygon parameter defines a selection area and the relation
-           parameter specifies the kind of relation (e.g. intersection,
-           crossing, overlapping) that holds between the selection area and
-           the geometries to be selected.
-      \param poly an instance of TePolygon representing a selection area
-      \param relation a spatial relation
-      \sa TeGeomValuePair
-    */
-    virtual void selectGeomValuePairs(const TePolygon& poly, const TeSpatialRelation relation, std::vector<TeGeomValuePair<T> >& selected)
-    {
-        // Select blocks which contain geometries that might respect the
-        // spatial relation with the polygon
-        std::vector<TeCoverageBlock<T> >& blocks = std::vector<TeCoverageBlock<T> >();
-        selectBlocks(poly, TeINTERSECTS, blocks);
-
-        for (std::vector<TeCoverageBlock<T> >::iterator itBlocks = blocks.begin(); itBlocks != blocks.end(); ++itBlocks)
-        {
-            // Look at all geometry-value pairs of selected blocks
-            std::vector<TeGeomValuePair<T> >& pairs = itBlocks->pairs;
-            for (std::vector<TeGeomValuePair<T> >::iterator it = pairs.begin(); it != pairs.end(); ++it)
-            {
-                // If the spatial relation holds, add geom-value pair to the result
-                if (TeTopologicalRelation(&poly, &it->geom, relation))
-                {
-                    selected.push_back(*it);
-                }
-            }
-        }
-    }
-
-    //! Select generic coverage blocks from the coverage data
-    /*!
-      \par Select generic coverage blocks from the coverage data.
-      \par The polygon parameter defines a selection area and the relation
-           parameter specifies the kind of relation (e.g. intersection,
-           crossing, overlapping) that holds between the selection area and
-           at least one geometry in each block to be selected.
-      \param poly an instance of TePolygon representing a selection area
-      \param relation a spatial relation
-      \param dontSelect list IDs of blocks that must not be retrieved
-      \sa TeCoverageBlock TeSpatialRelation
-    */
-    virtual void selectBlocks(const TePolygon& poly, const TeSpatialRelation relation, std::vector<TeCoverageBlock<T> >& selected, std::set<int>& dontSelect = std::set<int>()) = 0;
-
-protected:
-
-    TeCoverageParams& params_;  //!< Coverage parameters.
-};
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*!
+  \file TeCoverageDecoder.h
+
+  \par This file contains definitions and algorithms for accessing persistent
+       representations of a generic Coverage.
+*/
+#ifndef  __TERRALIB_INTERNAL_COVERAGEDECODER_H
+#define  __TERRALIB_INTERNAL_COVERAGEDECODER_H
+
+#include "TeCoord2D.h"
+#include "TeException.h"
+#include "TeBlockLoader.h"
+#include "TeCoverageParams.h"
+#include "TeCoverageUtils.h"
+#include "TeSpatialOperations.h"
+#include <map>
+#include <vector>
+
+/*!
+  \def READ
+  \brief Read a value of some type from a pointer to a block of raw data.
+*/
+#define READ(data, t) *(t*)data; data += sizeof(t)
+
+/*!
+  \struct TeGeomValuePair
+  \brief A generic geometry-value pair.
+*/
+template <class T>
+struct TeGeomValuePair
+{
+    T geom; //!< A generic geometry
+    std::vector<double> value; //!< a value vector
+
+    //! Default constructor.
+    TeGeomValuePair(){}
+
+    //! Constructor for a generic geometry-value pair
+    TeGeomValuePair(const T& geom,
+                     const std::vector<double>& value):
+            geom(geom),
+            value(value){}
+};
+
+
+
+/*!
+  \struct TeCoverageBlock
+  \brief A generic coverage block.
+
+  \par A generic coverage block contais a set of generic geometry-value pairs.
+  \par This coverage block has a box, which is the minimum box enclosing all
+       the generic geometries that are in the block.
+*/
+template <class T>
+struct TeCoverageBlock
+{
+    int id; //!< The identifier of the block
+    TeBox box; //!< The minimum box enclosing all elements of the block
+    std::vector<TeGeomValuePair<T> > pairs; //!< vector of geometry-value pairs
+};
+
+/*!
+  \class TeCoverageDecoder
+  \brief Abstract class of a coverage data decoder.
+
+  \par The decoder is used to provide a common interface for accessing
+       coverage data regardless of where and how it is stored.
+  \sa TeGeomValuePair TeCoverageBlock
+*/
+template <class T>
+class TeCoverageDecoder
+{
+public:
+
+    //! Constructor from coverage parameters
+    TeCoverageDecoder(TeCoverageParams& params) :
+        params_(params)
+    {
+    }
+
+    //! Destructor
+    virtual ~TeCoverageDecoder()
+    {
+        clear();
+    }
+
+    //! Return the coverage parameters
+    virtual TeCoverageParams& getParameters()
+    {
+        return params_;
+    }
+
+    //! Initialize internal structures
+    /*!
+      Instantiate internal structures, must be called before any attempt
+      to access the coverage data.
+    */
+    virtual void init()
+    {
+    }
+
+    //! Clear internal structures
+    /*!
+      Clear internal structures, must be called before disposing of the
+      decoder.
+    */
+    virtual void clear()
+    {
+    }
+
+    //! Select generic geometry-value pairs from the coverage data
+    /*!
+      \par Select generic geometry-value pairs from the coverage data.
+      \par The polygon parameter defines a selection area and the relation
+           parameter specifies the kind of relation (e.g. intersection,
+           crossing, overlapping) that holds between the selection area and
+           the geometries to be selected.
+      \param poly an instance of TePolygon representing a selection area
+      \param relation a spatial relation
+      \sa TeGeomValuePair
+    */
+    virtual void selectGeomValuePairs(const TePolygon& poly, const TeSpatialRelation relation, std::vector<TeGeomValuePair<T> >& selected)
+    {
+        // Select blocks which contain geometries that might respect the
+        // spatial relation with the polygon
+        std::vector<TeCoverageBlock<T> >& blocks = std::vector<TeCoverageBlock<T> >();
+        selectBlocks(poly, TeINTERSECTS, blocks);
+
+        for (std::vector<TeCoverageBlock<T> >::iterator itBlocks = blocks.begin(); itBlocks != blocks.end(); ++itBlocks)
+        {
+            // Look at all geometry-value pairs of selected blocks
+            std::vector<TeGeomValuePair<T> >& pairs = itBlocks->pairs;
+            for (std::vector<TeGeomValuePair<T> >::iterator it = pairs.begin(); it != pairs.end(); ++it)
+            {
+                // If the spatial relation holds, add geom-value pair to the result
+                if (TeTopologicalRelation(&poly, &it->geom, relation))
+                {
+                    selected.push_back(*it);
+                }
+            }
+        }
+    }
+
+    //! Select generic coverage blocks from the coverage data
+    /*!
+      \par Select generic coverage blocks from the coverage data.
+      \par The polygon parameter defines a selection area and the relation
+           parameter specifies the kind of relation (e.g. intersection,
+           crossing, overlapping) that holds between the selection area and
+           at least one geometry in each block to be selected.
+      \param poly an instance of TePolygon representing a selection area
+      \param relation a spatial relation
+      \param dontSelect list IDs of blocks that must not be retrieved
+      \sa TeCoverageBlock TeSpatialRelation
+    */
+    virtual void selectBlocks(const TePolygon& poly, const TeSpatialRelation relation, std::vector<TeCoverageBlock<T> >& selected, std::set<int>& dontSelect = std::set<int>()) = 0;
+
+protected:
+
+    TeCoverageParams& params_;  //!< Coverage parameters.
+};
+
 #endif // __TERRALIB_INTERNAL_COVERAGEDECODER_H
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageDecoderCacheLRU.h b/src/terralib/kernel/TeCoverageDecoderCacheLRU.h
index 73fc76d..58337e6 100644
--- a/src/terralib/kernel/TeCoverageDecoderCacheLRU.h
+++ b/src/terralib/kernel/TeCoverageDecoderCacheLRU.h
@@ -1,190 +1,190 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*!
-  \file TeCoverageDecoderCacheLRU.h
-  
-  \par This file defines a memory caching method for accessing data from
-       generic Coverages.
-*/
-#ifndef  __TERRALIB_INTERNAL_COVERAGEDECODERCACHELRU_H
-#define  __TERRALIB_INTERNAL_COVERAGEDECODERCACHELRU_H
-
-#include "TeCoverageDecoder.h"
-#include "TeCoverageDecoderDatabase.h"
-
-/*!
-  \def DEFAULT_CACHE_CAPACITY
-  \brief The default cache capacity (in number of blocks).
-*/
-#define DEFAULT_CACHE_CAPACITY 20
-
-/*!
-  \struct TeBoxIntersectionPredicate
-  \brief A predicate used to check intersection with a box.
-*/
-template <class T>
-struct TeBoxIntersectionPredicate
-{
-    TeBox box; //!< Box to be checked for intersection with blocks
-    std::set<int>& dontSelect; // IDs of blocks that must not be included
-
-    //! Constructor from box
-    TeBoxIntersectionPredicate(const TeBox& box, std::set<int>& dontSelect):
-            box(box), dontSelect(dontSelect){}
-
-    //! Return whether the block parameter intersects the box attribute
-    /*!
-      \param block coverage block to be checked for intersection
-      \return whether the block parameter intersects the box attribute
-    */
-    bool operator()(const TeCoverageBlock<T>& block) const {
-        if (dontSelect.find(block.id) == dontSelect.end()
-                && TeIntersects(box, block.box))
-        {
-            dontSelect.insert(block.id);
-            return true;
-        }
-        return false;
-    }
-};
-
-/*!
-  \class TeCoverageDecoderCacheLRU
-  \brief Class to decode a generic Coverage using LRU caching method.
-
-  \par This class assumes that the coverage data will be provided as
-       coverage blocks by a support decoder, and uses a memory caching method
-       to access this this support decoder less often.
-  \par The caching policy used is LRU (which stands for Least Recently
-       Used), meaning that the most recently used blocks are kept available,
-       whereas the least recently used blocks are discarded.
-  \par The cache capacity (in number of blocks) may be specified in the
-       constructor, otherwise a default capacity is used.
-*/
-template <class T>
-class TeCoverageDecoderCacheLRU : public TeCoverageDecoder<T>
-{
-public:
-
-    //! Constructor from parameters and capacity
-    TeCoverageDecoderCacheLRU(TeCoverageParams& params, const unsigned int capacity = 0) :
-        TeCoverageDecoder<T>(params),
-        capacity_(capacity),
-        decoder_(NULL)
-    {
-    }
-
-    //! Destructor
-    virtual ~TeCoverageDecoderCacheLRU()
-    {
-        clear();
-    }
-
-    //! Initialize internal structures
-    /*!
-      Instantiate internal structures, must be called before any
-      attempt to access the coverage data.
-    */
-    virtual void init()
-    {
-        if (capacity_ == 0)
-        {
-            capacity_ = DEFAULT_CACHE_CAPACITY;
-        }
-
-        if (!decoder_)
-        {
-            // Initialize the support decoder according to coverage parameters.
-            if (params_.getPersistenceType() == TePERSISTENCE_DATABASE_CACHELRU)
-            {
-                decoder_ = new TeCoverageDecoderDatabase<T>(params_);
-                decoder_->init();
-            }
-        }
-    }
-
-    //! Clear internal structures
-    /*!
-      Clear internal structures, must be called before disposing of the
-      decoder.
-    */
-    virtual void clear()
-    {
-        if (decoder_)
-        {
-            delete(decoder_); // Destroy the support decoder. 
-            decoder_ = NULL;
-        }
-    }
-
-    //! Select generic coverage blocks from the coverage data
-    /*!
-      \par Select generic coverage blocks from the coverage data.
-      \par The polygon parameter defines a selection area and the relation
-           parameter specifies the kind of relation (e.g. intersection,
-           crossing, overlapping) that holds between the selection area and
-           at least one geometry in each block to be selected.
-      \param poly an instance of TePolygon representing a selection area
-      \param relation a spatial relation
-      \param dontSelect list IDs of blocks that must not be retrieved
-      \sa TeCoverageBlock TeSpatialRelation
-    */
-    virtual void selectBlocks(const TePolygon& poly, const TeSpatialRelation relation, std::vector<TeCoverageBlock<T> >& selected, std::set<int>& dontSelect)
-    {
-        selected.clear();
-
-        // Move to the beginning the blocks on cache intersecting box
-        std::list<TeCoverageBlock<T> >::iterator bound;
-        bound = stable_partition(cache_.begin(), cache_.end(), TeBoxIntersectionPredicate<T>(poly.box(), dontSelect));
-
-        // Include blocks on the beginning of the cache in the return
-        selected.insert(selected.begin(), cache_.begin(), bound);
-
-        // Find other blocks on the support decoder
-        std::vector<TeCoverageBlock<T> >& blocksFromDecoder = std::vector<TeCoverageBlock<T> >();
-        decoder_->selectBlocks(poly, relation, blocksFromDecoder, dontSelect);
-
-        // For each block selected from the support decoder
-        for (std::vector<TeCoverageBlock<T> >::iterator it = blocksFromDecoder.begin(); it != blocksFromDecoder.end(); it++)
-        {
-            if (cache_.size() >= capacity_) // Check if cache is full
-            {
-                cache_.pop_back(); // Remove the least recently used block
-            }
-            cache_.push_front(*it); // Put new block on the head of the list
-
-            selected.push_back(*it); // And add block to the result
-        }
-    }
-
-protected:
-
-    TeCoverageDecoder<T>* decoder_; //!< Support coverage decoder
-
-    std::list<TeCoverageBlock<T> > cache_; //!< List of cached blocks
-
-    unsigned int capacity_; //!< Cache capacity
-
-};
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*!
+  \file TeCoverageDecoderCacheLRU.h
+  
+  \par This file defines a memory caching method for accessing data from
+       generic Coverages.
+*/
+#ifndef  __TERRALIB_INTERNAL_COVERAGEDECODERCACHELRU_H
+#define  __TERRALIB_INTERNAL_COVERAGEDECODERCACHELRU_H
+
+#include "TeCoverageDecoder.h"
+#include "TeCoverageDecoderDatabase.h"
+
+/*!
+  \def DEFAULT_CACHE_CAPACITY
+  \brief The default cache capacity (in number of blocks).
+*/
+#define DEFAULT_CACHE_CAPACITY 20
+
+/*!
+  \struct TeBoxIntersectionPredicate
+  \brief A predicate used to check intersection with a box.
+*/
+template <class T>
+struct TeBoxIntersectionPredicate
+{
+    TeBox box; //!< Box to be checked for intersection with blocks
+    std::set<int>& dontSelect; // IDs of blocks that must not be included
+
+    //! Constructor from box
+    TeBoxIntersectionPredicate(const TeBox& box, std::set<int>& dontSelect):
+            box(box), dontSelect(dontSelect){}
+
+    //! Return whether the block parameter intersects the box attribute
+    /*!
+      \param block coverage block to be checked for intersection
+      \return whether the block parameter intersects the box attribute
+    */
+    bool operator()(const TeCoverageBlock<T>& block) const {
+        if (dontSelect.find(block.id) == dontSelect.end()
+                && TeIntersects(box, block.box))
+        {
+            dontSelect.insert(block.id);
+            return true;
+        }
+        return false;
+    }
+};
+
+/*!
+  \class TeCoverageDecoderCacheLRU
+  \brief Class to decode a generic Coverage using LRU caching method.
+
+  \par This class assumes that the coverage data will be provided as
+       coverage blocks by a support decoder, and uses a memory caching method
+       to access this this support decoder less often.
+  \par The caching policy used is LRU (which stands for Least Recently
+       Used), meaning that the most recently used blocks are kept available,
+       whereas the least recently used blocks are discarded.
+  \par The cache capacity (in number of blocks) may be specified in the
+       constructor, otherwise a default capacity is used.
+*/
+template <class T>
+class TeCoverageDecoderCacheLRU : public TeCoverageDecoder<T>
+{
+public:
+
+    //! Constructor from parameters and capacity
+    TeCoverageDecoderCacheLRU(TeCoverageParams& params, const unsigned int capacity = 0) :
+        TeCoverageDecoder<T>(params),
+        capacity_(capacity),
+        decoder_(NULL)
+    {
+    }
+
+    //! Destructor
+    virtual ~TeCoverageDecoderCacheLRU()
+    {
+        clear();
+    }
+
+    //! Initialize internal structures
+    /*!
+      Instantiate internal structures, must be called before any
+      attempt to access the coverage data.
+    */
+    virtual void init()
+    {
+        if (capacity_ == 0)
+        {
+            capacity_ = DEFAULT_CACHE_CAPACITY;
+        }
+
+        if (!decoder_)
+        {
+            // Initialize the support decoder according to coverage parameters.
+            if (params_.getPersistenceType() == TePERSISTENCE_DATABASE_CACHELRU)
+            {
+                decoder_ = new TeCoverageDecoderDatabase<T>(params_);
+                decoder_->init();
+            }
+        }
+    }
+
+    //! Clear internal structures
+    /*!
+      Clear internal structures, must be called before disposing of the
+      decoder.
+    */
+    virtual void clear()
+    {
+        if (decoder_)
+        {
+            delete(decoder_); // Destroy the support decoder. 
+            decoder_ = NULL;
+        }
+    }
+
+    //! Select generic coverage blocks from the coverage data
+    /*!
+      \par Select generic coverage blocks from the coverage data.
+      \par The polygon parameter defines a selection area and the relation
+           parameter specifies the kind of relation (e.g. intersection,
+           crossing, overlapping) that holds between the selection area and
+           at least one geometry in each block to be selected.
+      \param poly an instance of TePolygon representing a selection area
+      \param relation a spatial relation
+      \param dontSelect list IDs of blocks that must not be retrieved
+      \sa TeCoverageBlock TeSpatialRelation
+    */
+    virtual void selectBlocks(const TePolygon& poly, const TeSpatialRelation relation, std::vector<TeCoverageBlock<T> >& selected, std::set<int>& dontSelect)
+    {
+        selected.clear();
+
+        // Move to the beginning the blocks on cache intersecting box
+        std::list<TeCoverageBlock<T> >::iterator bound;
+        bound = stable_partition(cache_.begin(), cache_.end(), TeBoxIntersectionPredicate<T>(poly.box(), dontSelect));
+
+        // Include blocks on the beginning of the cache in the return
+        selected.insert(selected.begin(), cache_.begin(), bound);
+
+        // Find other blocks on the support decoder
+        std::vector<TeCoverageBlock<T> >& blocksFromDecoder = std::vector<TeCoverageBlock<T> >();
+        decoder_->selectBlocks(poly, relation, blocksFromDecoder, dontSelect);
+
+        // For each block selected from the support decoder
+        for (std::vector<TeCoverageBlock<T> >::iterator it = blocksFromDecoder.begin(); it != blocksFromDecoder.end(); it++)
+        {
+            if (cache_.size() >= capacity_) // Check if cache is full
+            {
+                cache_.pop_back(); // Remove the least recently used block
+            }
+            cache_.push_front(*it); // Put new block on the head of the list
+
+            selected.push_back(*it); // And add block to the result
+        }
+    }
+
+protected:
+
+    TeCoverageDecoder<T>* decoder_; //!< Support coverage decoder
+
+    std::list<TeCoverageBlock<T> > cache_; //!< List of cached blocks
+
+    unsigned int capacity_; //!< Cache capacity
+
+};
+
 #endif // __TERRALIB_INTERNAL_COVERAGEDECODERCACHELRU_H
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageDecoderDatabase.h b/src/terralib/kernel/TeCoverageDecoderDatabase.h
index 83d2403..6dc72e1 100644
--- a/src/terralib/kernel/TeCoverageDecoderDatabase.h
+++ b/src/terralib/kernel/TeCoverageDecoderDatabase.h
@@ -1,391 +1,391 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*!
-  \file TeCoverageDecoderDatabase.h
-
-  \par This file contains definitions and algorithms for accessing a
-       generic Coverage from a TerraLib database.
-*/
-#ifndef  __TERRALIB_INTERNAL_COVERAGEDECODERDATABASE_H
-#define  __TERRALIB_INTERNAL_COVERAGEDECODERDATABASE_H
-
-#include "TeCoverageDecoder.h"
-
-/*!
-  \class TeCoverageDecoderDatabase
-  \brief Class to decode a generic Coverage from a TerraLib database.
-*/
-template <class T>
-class TeCoverageDecoderDatabase : public TeCoverageDecoder<T>
-{
-public:
-
-    //! Constructor from parameters
-    TeCoverageDecoderDatabase(TeCoverageParams& params) :
-        TeCoverageDecoder<T>(params)
-    {
-    }
-
-    //! Initialize internal structures
-    /*!
-      Instantiate internal structures, must be called before any
-      attempt to access the coverage data.
-    */
-    virtual void init()
-    {
-        TeLayer* layer = TeRetrieveLayer(params_.getDatabase(), params_.getLayerId());
-
-        // Check if the coverage ID is specified
-        if (params_.getCoverageId().empty())
-        {
-            // Otherwise, get the first coverage (if any)
-            std::vector<std::string> coverageIds;
-            TeRetrieveCoverageIds(layer, coverageIds);
-            if (coverageIds.empty())
-            {
-                std::string errorMsg = "No coverage defined on layer " + Te2String(layer->id()) + ".";
-                throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-            }
-            // New coverage ID is the first coverage found on layer
-            params_.setCoverageId(coverageIds.at(0));
-        }
-
-        // Set coverage table name
-        params_.setCoverageTable(TeRetrieveCoverageTable(layer, params_.getCoverageId()));
-
-        // Retrieve coverage dimensions information from the database
-        std::vector<TeCoverageDimension> dimensions;
-        TeRetrieveDimensions(layer, params_.getCoverageId(), dimensions);
-        params_.setDimensions(dimensions);
-
-        // Set coverage projection
-        params_.setProjection(layer->projection());
-
-        // Set coverage bounding box
-        params_.setBoundingBox(TeRetrieveCoverageBox(layer, params_.getCoverageId()));
-
-        // Set number of elements of the coverage
-        params_.setNumElements(TeRetrieveCoverageNumElements(layer, params_.getCoverageId()));
-    }
-
-    //! Select generic coverage blocks from the database.
-    /*!
-      \par Select generic coverage blocks from a TerraLib database. Uses
-           a TeBlockLoader object for retrieving blocks from the database.
-      \par The polygon parameter defines a selection area and the relation
-           parameter specifies the kind of relation (e.g. intersection,
-           crossing, overlapping) that holds between the selection area and
-           at least one geometry in each block to be selected.
-      \param poly an instance of TePolygon representing a selection area
-      \param relation a spatial relation
-      \param dontSelect list IDs of blocks that must not be retrieved
-      \sa TeCoverageBlock TeSpatialRelation TeBlockLoader
-    */
-    void selectBlocks(const TePolygon& poly, const TeSpatialRelation relation, std::vector<TeCoverageBlock<T> >& selected, std::set<int>& dontSelect)
-    {
-        selected.clear();
-
-        TeBox queryBox = poly.box();
-
-        // Set block loader parameters.
-        TeBlockLoaderParams loaderParams;
-        loaderParams.db = params_.getDatabase();
-        loaderParams.table_name = params_.getCoverageTable();
-        loaderParams.selection_box = queryBox;
-        loaderParams.load_all_attrs = true;
-        loaderParams.dont_load_ids = dontSelect;
-
-        // Construct loader and load blocks.
-        TeBlockLoader loader(loaderParams);
-        loader.loadBlocks();
-
-        // Iterate over blocks loaded
-        while (loader.fetchNext()) {
-
-            TeBox blockBox(loader.getDouble("lower_x"),
-                        loader.getDouble("lower_y"),
-                        loader.getDouble("upper_x"),
-                        loader.getDouble("upper_y"));
-
-            TePolygon& blockPoly = polygonFromBox(blockBox);
-
-            // If the spatial relation doesn't hold, proceed to the next block
-            if (!TeTopologicalRelation(&blockPoly, &poly, relation))
-            {
-                continue;
-            }
-
-            // Extract block contents.
-            long blockSize = 0;
-            unsigned char* data = NULL;
-            loader.getSpatialData(data, blockSize);
-            
-            // Decode block contents.
-            TeCoverageBlock<T>& block = decodeCoverageBlock(data, blockSize, params_.getDimensions());
-
-            // Set other block attributes
-            block.id = loader.getID();
-            block.box = blockBox;
-
-            // Add block to result
-            selected.push_back(block);
-        }
-    }
-
-protected:
-
-    //! Decode a generic geometry-value pair
-    /*!
-      \par Decode a generic geometry-value pair from a block of raw data.
-           As a side effect, the pointer to the data is moved forward to the
-           end of the decoded chunk.
-        \param data pointer to the memory location where the raw data starts
-        \param dimensions information about the coverage dimensions
-        \return a generic geometry-value pair
-    */
-    TeGeomValuePair<T> decodeGeomValuePair(unsigned char*& data, std::vector<TeCoverageDimension>& dimensions);
-
-    //! Decode a generic coverage block
-    /*!
-        \par Decode coverage block contents that are stored in the database
-             as raw binary data. As a side effect, the pointer to the data
-             is moved forward to the end of the decoded chunk.
-        \param data pointer to the memory location where the raw data starts
-        \param dataSize size of the raw data block to be decoded
-        \param dimensions information about the coverage dimensions
-        \return a generic coverage block
-    */
-    TeCoverageBlock<T> decodeCoverageBlock(unsigned char*& data, const long dataSize, std::vector<TeCoverageDimension>& dimensions)
-    {
-        TeCoverageBlock<T> block;
-
-        unsigned char* dataEnd = data + dataSize;
-
-        // Decode geom-value pairs from chunks of the block
-        unsigned int count = 0;
-        while (data < dataEnd)
-        {
-            TeGeomValuePair<T>& gvPair = decodeGeomValuePair(data, dimensions);
-            gvPair.geom.objectId(Te2String(count++));
-
-            block.pairs.push_back(gvPair); // Insert geom-value pair in block
-        }
-        return block;
-    }
-};
-
-//! Specialization for decoding a TePoint instead of a generic geometry
-TeGeomValuePair<TePoint>
-TeCoverageDecoderDatabase<TePoint>::decodeGeomValuePair(unsigned char*& data, std::vector<TeCoverageDimension>& dimensions)
-{
-    TeGeomValuePair<TePoint> gvPair = TeGeomValuePair<TePoint>();
-
-    // Set coordinates
-    double x = READ(data, double);
-    double y = READ(data, double);
-
-    gvPair.geom = TePoint(x, y);
-    
-    // Set values
-    gvPair.value = std::vector<double>();
-    std::vector<TeCoverageDimension>::iterator it = dimensions.begin();
-    std::vector<TeCoverageDimension>::iterator end = dimensions.end();
-    while (it != end)
-    {
-        double val = 0;
-
-        switch (it->type)
-        {
-        case (TeUNSIGNEDSHORT):
-            val = READ(data, unsigned short);
-            break;
-        case (TeSHORT):
-            val = READ(data, short);
-            break;
-        case (TeINTEGER):
-            val = READ(data, int);
-            break;                
-        case (TeUNSIGNEDLONG):
-            val = READ(data, unsigned long);
-            break;
-        case (TeLONG):
-            val = READ(data, long);
-            break;
-        case (TeFLOAT):
-            val = READ(data, float);
-            break;
-        case (TeDOUBLE):
-            val = READ(data, double);
-            break;
-        default:
-            // Exception (invalid type)
-            break;
-        }
-
-        gvPair.value.push_back(val);
-        it++;
-    }
-
-    return gvPair;
-}
-
-//! Specialization for decoding a TeLine2D instead of a generic geometry
-TeGeomValuePair<TeLine2D>
-TeCoverageDecoderDatabase<TeLine2D>::decodeGeomValuePair(unsigned char*& data, std::vector<TeCoverageDimension>& dimensions)
-{
-    TeGeomValuePair<TeLine2D> gvPair = TeGeomValuePair<TeLine2D>();
-
-    TeLine2D line = TeLine2D();
-
-    // Check number of points in the line
-    unsigned int numPoints = READ(data, unsigned int);
-
-    // Decode points and add to the line
-    for (unsigned int i = 0; i < numPoints; ++i)
-    {
-        double x = READ(data, double);
-        double y = READ(data, double);
-
-        line.add(TeCoord2D(x, y));
-    }
-
-    gvPair.geom = line;
-    
-    // Set values
-    gvPair.value = std::vector<double>();
-    std::vector<TeCoverageDimension>::iterator it = dimensions.begin();
-    std::vector<TeCoverageDimension>::iterator end = dimensions.end();
-    while (it != end)
-    {
-        double val = 0;
-
-        switch (it->type)
-        {
-        case (TeUNSIGNEDSHORT):
-            val = READ(data, unsigned short);
-            break;
-        case (TeSHORT):
-            val = READ(data, short);
-            break;
-        case (TeINTEGER):
-            val = READ(data, int);
-            break;                
-        case (TeUNSIGNEDLONG):
-            val = READ(data, unsigned long);
-            break;
-        case (TeLONG):
-            val = READ(data, long);
-            break;
-        case (TeFLOAT):
-            val = READ(data, float);
-            break;
-        case (TeDOUBLE):
-            val = READ(data, double);
-            break;
-        default:
-            // Exception (invalid type)
-            break;
-        }
-
-        gvPair.value.push_back(val);
-        it++;
-    }
-
-    return gvPair;
-}
-
-//! Specialization for decoding a TePolygon instead of a generic geometry
-TeGeomValuePair<TePolygon>
-TeCoverageDecoderDatabase<TePolygon>::decodeGeomValuePair(unsigned char*& data, std::vector<TeCoverageDimension>& dimensions)
-{
-    TeGeomValuePair<TePolygon> gvPair = TeGeomValuePair<TePolygon>();
-
-    TePolygon poly = TePolygon();
-    // Check number of linear rings in the polygon
-    unsigned int numLines = READ(data, unsigned int);
-
-    for (unsigned int i = 0; i < numLines; ++i)
-    {
-        TeLine2D line = TeLine2D();
-
-        // Check number of points in the line
-        unsigned int numPoints = READ(data, unsigned int);
-
-        // Decode points and add to the line
-        for (unsigned int i = 0; i < numPoints; ++i)
-        {
-            double x = READ(data, double);
-            double y = READ(data, double);
-
-            line.add(TeCoord2D(x, y));
-        }
-
-        TeLinearRing ring = TeLinearRing(line);
-        poly.add(ring);
-    }
-    gvPair.geom = poly;
-    
-    // Set values
-    gvPair.value = std::vector<double>();
-    std::vector<TeCoverageDimension>::iterator it = dimensions.begin();
-    std::vector<TeCoverageDimension>::iterator end = dimensions.end();
-    while (it != end)
-    {
-        double val = 0;
-
-        switch (it->type)
-        {
-        case (TeUNSIGNEDSHORT):
-            val = READ(data, unsigned short);
-            break;
-        case (TeSHORT):
-            val = READ(data, short);
-            break;
-        case (TeINTEGER):
-            val = READ(data, int);
-            break;                
-        case (TeUNSIGNEDLONG):
-            val = READ(data, unsigned long);
-            break;
-        case (TeLONG):
-            val = READ(data, long);
-            break;
-        case (TeFLOAT):
-            val = READ(data, float);
-            break;
-        case (TeDOUBLE):
-            val = READ(data, double);
-            break;
-        default:
-            // Exception (invalid type)
-            break;
-        }
-
-        gvPair.value.push_back(val);
-        it++;
-    }
-
-    return gvPair;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*!
+  \file TeCoverageDecoderDatabase.h
+
+  \par This file contains definitions and algorithms for accessing a
+       generic Coverage from a TerraLib database.
+*/
+#ifndef  __TERRALIB_INTERNAL_COVERAGEDECODERDATABASE_H
+#define  __TERRALIB_INTERNAL_COVERAGEDECODERDATABASE_H
+
+#include "TeCoverageDecoder.h"
+
+/*!
+  \class TeCoverageDecoderDatabase
+  \brief Class to decode a generic Coverage from a TerraLib database.
+*/
+template <class T>
+class TeCoverageDecoderDatabase : public TeCoverageDecoder<T>
+{
+public:
+
+    //! Constructor from parameters
+    TeCoverageDecoderDatabase(TeCoverageParams& params) :
+        TeCoverageDecoder<T>(params)
+    {
+    }
+
+    //! Initialize internal structures
+    /*!
+      Instantiate internal structures, must be called before any
+      attempt to access the coverage data.
+    */
+    virtual void init()
+    {
+        TeLayer* layer = TeRetrieveLayer(params_.getDatabase(), params_.getLayerId());
+
+        // Check if the coverage ID is specified
+        if (params_.getCoverageId().empty())
+        {
+            // Otherwise, get the first coverage (if any)
+            std::vector<std::string> coverageIds;
+            TeRetrieveCoverageIds(layer, coverageIds);
+            if (coverageIds.empty())
+            {
+                std::string errorMsg = "No coverage defined on layer " + Te2String(layer->id()) + ".";
+                throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+            }
+            // New coverage ID is the first coverage found on layer
+            params_.setCoverageId(coverageIds.at(0));
+        }
+
+        // Set coverage table name
+        params_.setCoverageTable(TeRetrieveCoverageTable(layer, params_.getCoverageId()));
+
+        // Retrieve coverage dimensions information from the database
+        std::vector<TeCoverageDimension> dimensions;
+        TeRetrieveDimensions(layer, params_.getCoverageId(), dimensions);
+        params_.setDimensions(dimensions);
+
+        // Set coverage projection
+        params_.setProjection(layer->projection());
+
+        // Set coverage bounding box
+        params_.setBoundingBox(TeRetrieveCoverageBox(layer, params_.getCoverageId()));
+
+        // Set number of elements of the coverage
+        params_.setNumElements(TeRetrieveCoverageNumElements(layer, params_.getCoverageId()));
+    }
+
+    //! Select generic coverage blocks from the database.
+    /*!
+      \par Select generic coverage blocks from a TerraLib database. Uses
+           a TeBlockLoader object for retrieving blocks from the database.
+      \par The polygon parameter defines a selection area and the relation
+           parameter specifies the kind of relation (e.g. intersection,
+           crossing, overlapping) that holds between the selection area and
+           at least one geometry in each block to be selected.
+      \param poly an instance of TePolygon representing a selection area
+      \param relation a spatial relation
+      \param dontSelect list IDs of blocks that must not be retrieved
+      \sa TeCoverageBlock TeSpatialRelation TeBlockLoader
+    */
+    void selectBlocks(const TePolygon& poly, const TeSpatialRelation relation, std::vector<TeCoverageBlock<T> >& selected, std::set<int>& dontSelect)
+    {
+        selected.clear();
+
+        TeBox queryBox = poly.box();
+
+        // Set block loader parameters.
+        TeBlockLoaderParams loaderParams;
+        loaderParams.db = params_.getDatabase();
+        loaderParams.table_name = params_.getCoverageTable();
+        loaderParams.selection_box = queryBox;
+        loaderParams.load_all_attrs = true;
+        loaderParams.dont_load_ids = dontSelect;
+
+        // Construct loader and load blocks.
+        TeBlockLoader loader(loaderParams);
+        loader.loadBlocks();
+
+        // Iterate over blocks loaded
+        while (loader.fetchNext()) {
+
+            TeBox blockBox(loader.getDouble("lower_x"),
+                        loader.getDouble("lower_y"),
+                        loader.getDouble("upper_x"),
+                        loader.getDouble("upper_y"));
+
+            TePolygon& blockPoly = polygonFromBox(blockBox);
+
+            // If the spatial relation doesn't hold, proceed to the next block
+            if (!TeTopologicalRelation(&blockPoly, &poly, relation))
+            {
+                continue;
+            }
+
+            // Extract block contents.
+            long blockSize = 0;
+            unsigned char* data = NULL;
+            loader.getSpatialData(data, blockSize);
+            
+            // Decode block contents.
+            TeCoverageBlock<T>& block = decodeCoverageBlock(data, blockSize, params_.getDimensions());
+
+            // Set other block attributes
+            block.id = loader.getID();
+            block.box = blockBox;
+
+            // Add block to result
+            selected.push_back(block);
+        }
+    }
+
+protected:
+
+    //! Decode a generic geometry-value pair
+    /*!
+      \par Decode a generic geometry-value pair from a block of raw data.
+           As a side effect, the pointer to the data is moved forward to the
+           end of the decoded chunk.
+        \param data pointer to the memory location where the raw data starts
+        \param dimensions information about the coverage dimensions
+        \return a generic geometry-value pair
+    */
+    TeGeomValuePair<T> decodeGeomValuePair(unsigned char*& data, std::vector<TeCoverageDimension>& dimensions);
+
+    //! Decode a generic coverage block
+    /*!
+        \par Decode coverage block contents that are stored in the database
+             as raw binary data. As a side effect, the pointer to the data
+             is moved forward to the end of the decoded chunk.
+        \param data pointer to the memory location where the raw data starts
+        \param dataSize size of the raw data block to be decoded
+        \param dimensions information about the coverage dimensions
+        \return a generic coverage block
+    */
+    TeCoverageBlock<T> decodeCoverageBlock(unsigned char*& data, const long dataSize, std::vector<TeCoverageDimension>& dimensions)
+    {
+        TeCoverageBlock<T> block;
+
+        unsigned char* dataEnd = data + dataSize;
+
+        // Decode geom-value pairs from chunks of the block
+        unsigned int count = 0;
+        while (data < dataEnd)
+        {
+            TeGeomValuePair<T>& gvPair = decodeGeomValuePair(data, dimensions);
+            gvPair.geom.objectId(Te2String(count++));
+
+            block.pairs.push_back(gvPair); // Insert geom-value pair in block
+        }
+        return block;
+    }
+};
+
+//! Specialization for decoding a TePoint instead of a generic geometry
+TeGeomValuePair<TePoint>
+TeCoverageDecoderDatabase<TePoint>::decodeGeomValuePair(unsigned char*& data, std::vector<TeCoverageDimension>& dimensions)
+{
+    TeGeomValuePair<TePoint> gvPair = TeGeomValuePair<TePoint>();
+
+    // Set coordinates
+    double x = READ(data, double);
+    double y = READ(data, double);
+
+    gvPair.geom = TePoint(x, y);
+    
+    // Set values
+    gvPair.value = std::vector<double>();
+    std::vector<TeCoverageDimension>::iterator it = dimensions.begin();
+    std::vector<TeCoverageDimension>::iterator end = dimensions.end();
+    while (it != end)
+    {
+        double val = 0;
+
+        switch (it->type)
+        {
+        case (TeUNSIGNEDSHORT):
+            val = READ(data, unsigned short);
+            break;
+        case (TeSHORT):
+            val = READ(data, short);
+            break;
+        case (TeINTEGER):
+            val = READ(data, int);
+            break;                
+        case (TeUNSIGNEDLONG):
+            val = READ(data, unsigned long);
+            break;
+        case (TeLONG):
+            val = READ(data, long);
+            break;
+        case (TeFLOAT):
+            val = READ(data, float);
+            break;
+        case (TeDOUBLE):
+            val = READ(data, double);
+            break;
+        default:
+            // Exception (invalid type)
+            break;
+        }
+
+        gvPair.value.push_back(val);
+        it++;
+    }
+
+    return gvPair;
+}
+
+//! Specialization for decoding a TeLine2D instead of a generic geometry
+TeGeomValuePair<TeLine2D>
+TeCoverageDecoderDatabase<TeLine2D>::decodeGeomValuePair(unsigned char*& data, std::vector<TeCoverageDimension>& dimensions)
+{
+    TeGeomValuePair<TeLine2D> gvPair = TeGeomValuePair<TeLine2D>();
+
+    TeLine2D line = TeLine2D();
+
+    // Check number of points in the line
+    unsigned int numPoints = READ(data, unsigned int);
+
+    // Decode points and add to the line
+    for (unsigned int i = 0; i < numPoints; ++i)
+    {
+        double x = READ(data, double);
+        double y = READ(data, double);
+
+        line.add(TeCoord2D(x, y));
+    }
+
+    gvPair.geom = line;
+    
+    // Set values
+    gvPair.value = std::vector<double>();
+    std::vector<TeCoverageDimension>::iterator it = dimensions.begin();
+    std::vector<TeCoverageDimension>::iterator end = dimensions.end();
+    while (it != end)
+    {
+        double val = 0;
+
+        switch (it->type)
+        {
+        case (TeUNSIGNEDSHORT):
+            val = READ(data, unsigned short);
+            break;
+        case (TeSHORT):
+            val = READ(data, short);
+            break;
+        case (TeINTEGER):
+            val = READ(data, int);
+            break;                
+        case (TeUNSIGNEDLONG):
+            val = READ(data, unsigned long);
+            break;
+        case (TeLONG):
+            val = READ(data, long);
+            break;
+        case (TeFLOAT):
+            val = READ(data, float);
+            break;
+        case (TeDOUBLE):
+            val = READ(data, double);
+            break;
+        default:
+            // Exception (invalid type)
+            break;
+        }
+
+        gvPair.value.push_back(val);
+        it++;
+    }
+
+    return gvPair;
+}
+
+//! Specialization for decoding a TePolygon instead of a generic geometry
+TeGeomValuePair<TePolygon>
+TeCoverageDecoderDatabase<TePolygon>::decodeGeomValuePair(unsigned char*& data, std::vector<TeCoverageDimension>& dimensions)
+{
+    TeGeomValuePair<TePolygon> gvPair = TeGeomValuePair<TePolygon>();
+
+    TePolygon poly = TePolygon();
+    // Check number of linear rings in the polygon
+    unsigned int numLines = READ(data, unsigned int);
+
+    for (unsigned int i = 0; i < numLines; ++i)
+    {
+        TeLine2D line = TeLine2D();
+
+        // Check number of points in the line
+        unsigned int numPoints = READ(data, unsigned int);
+
+        // Decode points and add to the line
+        for (unsigned int i = 0; i < numPoints; ++i)
+        {
+            double x = READ(data, double);
+            double y = READ(data, double);
+
+            line.add(TeCoord2D(x, y));
+        }
+
+        TeLinearRing ring = TeLinearRing(line);
+        poly.add(ring);
+    }
+    gvPair.geom = poly;
+    
+    // Set values
+    gvPair.value = std::vector<double>();
+    std::vector<TeCoverageDimension>::iterator it = dimensions.begin();
+    std::vector<TeCoverageDimension>::iterator end = dimensions.end();
+    while (it != end)
+    {
+        double val = 0;
+
+        switch (it->type)
+        {
+        case (TeUNSIGNEDSHORT):
+            val = READ(data, unsigned short);
+            break;
+        case (TeSHORT):
+            val = READ(data, short);
+            break;
+        case (TeINTEGER):
+            val = READ(data, int);
+            break;                
+        case (TeUNSIGNEDLONG):
+            val = READ(data, unsigned long);
+            break;
+        case (TeLONG):
+            val = READ(data, long);
+            break;
+        case (TeFLOAT):
+            val = READ(data, float);
+            break;
+        case (TeDOUBLE):
+            val = READ(data, double);
+            break;
+        default:
+            // Exception (invalid type)
+            break;
+        }
+
+        gvPair.value.push_back(val);
+        it++;
+    }
+
+    return gvPair;
+}
+
 #endif // __TERRALIB_INTERNAL_COVERAGEDECODERDATABASE_H
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageImport.h b/src/terralib/kernel/TeCoverageImport.h
index ca2cba9..017fd3c 100644
--- a/src/terralib/kernel/TeCoverageImport.h
+++ b/src/terralib/kernel/TeCoverageImport.h
@@ -1,678 +1,678 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*!
-  \file TeCoverageImport.h
-
-  \par This file contains algorithms for importing Coverage data
-       to a TerraLib database.
-*/
-#ifndef  __TERRALIB_INTERNAL_COVERAGEIMPORT_H
-#define  __TERRALIB_INTERNAL_COVERAGEIMPORT_H
-
-#include <sstream>
-
-#include "TeCoverageParams.h"
-#include "TeCoverageUtils.h"
-#include "TeCoverageImportUtils.h"
-#include <TeQuerier.h>
-#include <TeQuerierParams.h>
-//#include "TeDriverSHPDBF.h"
-
-/*!
-  \def WRITE
-  \brief Write a value of some type in a block of raw data.
-*/
-#define WRITE(data, t, v) *((t*)(data)) = v;  data += sizeof(t)
-
-
-/*!
-  \struct SerializedGeomValuePair
-  \brief A geometry and raw data that is the serialization of a geometry-value pair.
-*/
-template <class T>
-struct SerializedPair {
-    T geom;
-    unsigned char* data;
-    unsigned long size;
-};
-
-template <class T>
-struct CmpSerializedX {
-    bool operator() (SerializedPair<T>* s1, SerializedPair<T>* s2)
-    {
-        return s1->geom.box().center().x() < s2->geom.box().center().x();
-    }
-};
-
-template <class T>
-struct CmpSerializedY {
-    bool operator() (SerializedPair<T>* s1, SerializedPair<T>* s2)
-    {
-        return s1->geom.box().center().y() < s2->geom.box().center().y();
-    }
-};
-
-template <class T>
-void
-splitSerialized(std::vector<SerializedPair<T>* >& src,
-                typename std::vector<SerializedPair<T>* >::iterator& begin,
-                typename std::vector<SerializedPair<T>* >::iterator& end,
-                std::vector<std::vector<SerializedPair<T> > >& clusters)
-{
-    const int CLUSTER_CAPACITY = 300;
-    if ((end - begin) <= CLUSTER_CAPACITY)
-    {
-        std::vector<SerializedPair<T> >& cluster = std::vector<SerializedPair<T> >();
-        for (std::vector<SerializedPair<T>* >::iterator it = begin; it != end; it++)
-        {
-            SerializedPair<T>* pair = *it;
-            cluster.push_back(*pair);
-        }
-        clusters.push_back(cluster);
-        return;
-    }
-
-    TeBox box = TeBox();
-    for (std::vector<SerializedPair<T>* >::iterator it = begin; it != end; it++)
-    {
-        SerializedPair<T>* pair = (*it);
-        updateBox(box, pair->geom.box());
-    }
-
-    // split geom set horizontaly if width is larger than height
-    if ((box.x2_ - box.x1_) > (box.y2_ - box.y1_))
-    {
-        sort(begin, end, CmpSerializedX<T>());
-    }
-    // split verticaly otherwise
-    else
-    {
-        sort(begin, end, CmpSerializedX<T>());
-    }
-
-    std::vector<SerializedPair<T> *>::iterator mid = begin + (((end - begin) + 1) / 2);
-    splitSerialized(src, mid, end, clusters);
-    splitSerialized(src, begin, mid, clusters);
-}
-
-template <class T>
-void
-clusterSerialized(std::vector<SerializedPair<T> >& srcGroup, std::vector<std::vector<SerializedPair<T> > >& clusters)
-{
-    std::vector<SerializedPair<T>* >& pairs = std::vector<SerializedPair<T>* >();
-
-    for (std::vector<SerializedPair<T> >::iterator it = srcGroup.begin(); it != srcGroup.end(); it++)
-    {
-        SerializedPair<T>& pair = *it;
-        pairs.push_back(&pair);
-    }
-    splitSerialized(pairs, pairs.begin(), pairs.end(), clusters);
-}
-
-template <class T>
-void
-populateDatabase(TeLayer* layer, const std::string& coverageId, std::vector<std::vector<SerializedPair<T> > >& groups)
-{
-    TeDatabase* db = layer->database();
-
-    std::string& tableName = TeDefaultCoverageTable(layer, coverageId);
-    if (!db->tableExist(tableName))
-    {
-        createCoverageTable(layer, tableName);
-    }
-
-    // Bounding box of the coverage, to be calculated
-    TeBox coverageBox = TeBox();
-
-    // Iterate over the  collection of grouped points
-    std::vector<std::vector<SerializedPair<T> > >::iterator itGroups = groups.begin();
-    std::vector<std::vector<SerializedPair<T> > >::iterator endGroups = groups.end();
-    int count = 0;
-    while (itGroups != endGroups)
-    {
-        std::vector<SerializedPair<T> >& group = *(itGroups++);
-        std::vector<SerializedPair<T> >::iterator itPoints = group.begin();
-        std::vector<SerializedPair<T> >::iterator endPoints = group.end();
-
-        // Calculate block size, according to sizes of serialized points
-        unsigned long blockSize = 0;
-        while (itPoints != endPoints)
-        {
-            blockSize += itPoints->size;
-            itPoints++;
-        }
-
-        // Allocate enough memory for the block data
-        unsigned char* blockData = NULL;
-        blockData = (unsigned char*)malloc(blockSize);
-
-        unsigned char* dest = blockData;
-
-        // Create bounding box of the group
-        TeBox blockBox = TeBox();
-
-        // Reset iterator and iterate over the serialized points in the group
-        itPoints = group.begin();
-        while (itPoints != endPoints)
-        {
-            // Join chunks to the block data
-            unsigned char* src = itPoints->data;
-            for (unsigned int i = 0; i < itPoints->size; i++)
-            {
-                *dest++ = *src++;
-            }
-
-            // Update block bounding box
-            updateBox(blockBox, itPoints->geom.box());
-
-            itPoints++;
-        }
-
-        // Update coverage bounding box
-        updateBox(coverageBox, blockBox);
-
-        count++;
-
-        // Insert block data as an entry in the coverage block table
-        insertToCoverageTable(layer, tableName, count, blockBox, group.size(), blockData, blockSize);
-    }
-
-    // Create coverage layer, if it does not exist
-    std::string& layerTableName = TeDefaultCoverageLayerTable(layer);
-    if (!db->tableExist(layerTableName))
-    {   
-        createCoverageLayerTable(layer, layerTableName);
-    }
-    insertToCoverageLayerTable(layer, layerTableName, tableName, coverageId, coverageBox);
-
-    // Check if this coverage layer is in the representations table
-    TeRepresentation* rep = layer->getRepresentation(TeCOVERAGE, layerTableName);
-    if (rep != NULL)
-    {
-        // Update bounding box of the representation
-        updateBox(rep->box_, coverageBox);
-        
-        if (!db->updateRepresentation(layer->id(), *rep))
-        {
-            std::string errorMsg = "Couldn't update representation on layer '" + Te2String(layer->id()) + "'. DB error: \"" + db->errorMessage() + "\"";
-            throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-        }
-    }
-    else
-    {
-        // Insert entry in the representations table
-        TeRepresentation* rep = new TeRepresentation();
-        rep->box_ = coverageBox;
-        rep->geomRep_ = TeCOVERAGE;
-        rep->tableName_ = layerTableName;
-        layer->addVectRepres(rep);
-
-        if (!db->insertRepresentation(layer->id(), *rep))
-        {
-            std::string errorMsg = "Couldn't insert representation on layer '" + Te2String(layer->id()) + "'. DB error: \"" + db->errorMessage() + "\"";
-            throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-        }
-    }
-
-    // Update bounding box of the layer
-    layer->updateLayerBox(coverageBox);
-    if (!db->updateLayer(layer))
-    {
-        std::string errorMsg = "Couldn't update layer '" + Te2String(layer->id()) + "'. DB error: \"" + db->errorMessage() + "\"";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-}
-
-//! Specialization for decoding a point layer
-bool
-decodeLayer(TeLayer* srcLayer, const std::vector<std::string>& columns, std::vector<SerializedPair<TePoint> >& serializedVector, std::vector<TeCoverageDimension>& dimensions)
-{
-    TeQuerierParams querierParams(true, columns);
-    querierParams.setParams(srcLayer);
-    TeQuerier querier(querierParams);
-    querier.loadInstances();
-
-    // Set information about the coverage dimensions
-    TeAttributeList attList = querier.getAttrList();
-    attributeListToCoverageDimensions(attList, dimensions);
-    
-    // Size of (x, y) pair
-    int chunkSize = (2 * sizeof(double)) + TeCoverageDimensionsSize(dimensions);
-
-    // Extract coverage data
-    unsigned int instanceCount = 0;
-    TeSTInstance sti;
-    while(querier.fetchInstance(sti))
-    {
-        if(!sti.hasPoints())
-        {
-            // If it doesn't have a point, proceed to the next instance
-            continue;
-        }
-
-        SerializedPair<TePoint> serialized;
-        serialized.size = chunkSize;
-
-        // Get only the first point
-        TePointSet pointSet;
-        sti.getGeometry(pointSet);
-        TePoint point = *(pointSet.begin());
-    
-        serialized.geom = point;
-
-        serialized.data = (unsigned char*)malloc(serialized.size);
-
-        unsigned char* temp = serialized.data;
-
-        // Write coordinates
-        WRITE(temp, double, point.location().x_);
-        WRITE(temp, double, point.location().y_);
-
-        // Write dimensions values
-        TePropertyVector vec = sti.getPropertyVector();
-        for(unsigned int i = 0; i < vec.size(); i++)
-        {
-            if (dimensions[i].type == TeINTEGER)
-            {
-                std::stringstream buf;
-                buf << vec[i].value_;
-                int val;
-                buf >> val;
-                WRITE(temp, int, val);
-                buf.clear();
-            }
-            else
-            {
-                std::stringstream buf;
-                buf << vec[i].value_;
-                double val;
-                buf >> val;
-                WRITE(temp, double, val);
-                buf.clear();
-            }
-        }
-        serializedVector.push_back(serialized);
-
-    }
-    return true;
-}
-
-bool
-decodeLayer(TeLayer* srcLayer, const std::vector<std::string>& columns, std::vector<SerializedPair<TeLine2D> >& serializedVector, std::vector<TeCoverageDimension>& dimensions)
-{
-    TeQuerierParams querierParams(true, columns);
-    querierParams.setParams(srcLayer);
-    TeQuerier querier(querierParams);
-    querier.loadInstances();
-
-    // Set information about the coverage dimensions
-    TeAttributeList attList = querier.getAttrList();
-    attributeListToCoverageDimensions(attList, dimensions);
-
-    int dimensionsSize = TeCoverageDimensionsSize(dimensions);
-    
-    // Extract coverage data
-    unsigned int instanceCount = 0;
-    TeSTInstance sti;
-    while(querier.fetchInstance(sti))
-    {
-        if(!sti.hasLines())
-        {
-            // If it doesn't have a line, proceed to the next instance
-            continue;
-        }
-
-        SerializedPair<TeLine2D> serialized;
-
-        // Get only the first line
-        TeLineSet lineSet;
-        sti.getGeometry(lineSet);
-        TeLine2D line = *(lineSet.begin());
-
-        serialized.geom = line;
-
-        int pointSize = (2 * sizeof(double));
-        serialized.size = sizeof(unsigned int) + (line.size() * pointSize) + dimensionsSize;
-
-        serialized.data = (unsigned char*)malloc(serialized.size);
-
-        unsigned char* temp = serialized.data;
-
-        WRITE(temp, unsigned int, line.size());
-
-        // Write point coordinates
-        for (unsigned int i = 0; i < line.size(); ++i)
-        {
-            TePoint point = line[i];
-            WRITE(temp, double, point.location().x_);
-            WRITE(temp, double, point.location().y_);
-        }
-
-        // Write dimensions values
-        TePropertyVector vec = sti.getPropertyVector();
-        for(unsigned int i = 0; i < vec.size(); i++)
-        {
-            if (dimensions[i].type == TeINTEGER)
-            {
-                std::stringstream buf;
-                buf << vec[i].value_;
-                int val;
-                buf >> val;
-                WRITE(temp, int, val);
-                buf.clear();
-            }
-            else
-            {
-                std::stringstream buf;
-                buf << vec[i].value_;
-                double val;
-                buf >> val;
-                WRITE(temp, double, val);
-                buf.clear();
-            }
-        }
-        serializedVector.push_back(serialized);
-
-    }
-    return true;
-}
-
-bool
-decodeLayer(TeLayer* srcLayer, const std::vector<std::string>& columns, std::vector<SerializedPair<TePolygon> >& serializedVector, std::vector<TeCoverageDimension>& dimensions)
-{
-    TeQuerierParams querierParams(true, columns);
-    querierParams.setParams(srcLayer);
-    TeQuerier querier(querierParams);
-    querier.loadInstances();
-
-    // Set information about the coverage dimensions
-    TeAttributeList attList = querier.getAttrList();
-    attributeListToCoverageDimensions(attList, dimensions);
-
-    int dimensionsSize = TeCoverageDimensionsSize(dimensions);
-    
-    // Extract coverage data
-    unsigned int instanceCount = 0;
-    TeSTInstance sti;
-    while(querier.fetchInstance(sti))
-    {
-        if(!sti.hasPolygons())
-        {
-            // If it doesn't have a polygon, proceed to the next instance
-            continue;
-        }
-
-        SerializedPair<TePolygon> serialized;
-
-        // Get only the first polygon
-        TePolygonSet polySet;
-        sti.getGeometry(polySet);
-        TePolygon poly = *(polySet.begin());
-
-        serialized.geom = poly;
-        
-        // Count number of lines and points that make this polygon
-        unsigned int numLines = 0;
-        unsigned int numPoints = 0;
-        for(unsigned int i = 0; i < poly.size(); ++i)
-        {
-            numLines += 1;
-            numPoints += poly[i].size();
-        }
-
-        int coordSize = (2 * sizeof(double));
-        serialized.size = sizeof(unsigned int) + (numLines * sizeof(unsigned int)) + (numPoints * coordSize) + dimensionsSize;
-
-        serialized.data = (unsigned char*)malloc(serialized.size);
-
-        unsigned char* temp = serialized.data;
-
-        // Write Polygon serialization
-        WRITE(temp, unsigned int, numLines);
-        for (unsigned int i = 0; i < numLines; ++i)
-        {
-            TeLine2D line = poly[i];
-            WRITE(temp, unsigned int, line.size());
-
-            // Write point coordinates
-            for (unsigned int j = 0; j < line.size(); ++j)
-            {
-                TePoint point = line[j];
-                WRITE(temp, double, point.location().x());
-                WRITE(temp, double, point.location().y());
-            }
-        }
-
-        // Write dimensions serialization
-        TePropertyVector vec = sti.getPropertyVector();
-        for(unsigned int i = 0; i < vec.size(); i++)
-        {
-            if (dimensions[i].type == TeINTEGER)
-            {
-                std::stringstream buf;
-                buf << vec[i].value_;
-                int val;
-                buf >> val;
-                WRITE(temp, int, val);
-                buf.clear();
-            }
-            else
-            {
-                std::stringstream buf;
-                buf << vec[i].value_;
-                double val;
-                buf >> val;
-                WRITE(temp, double, val);
-                buf.clear();
-            }
-        }
-        serializedVector.push_back(serialized);
-
-    }
-    return true;
-}
-
-//! Import Coverage from a layer of geometries, creating a new layer
-/*!
-  \par Import a Coverage from an existing layer of geometries in
-       a TerraLib database, creating a new layer where the coverage is stored.
-  \param database a pointer to the database to where the coverage will be imported
-  \param layerName name of the layer to be created
-  \param srcLayer pointer to the existing layer of geometries
-  \param srcAttrTableName name of an existing attributes table
-  \param columns columns of the attributes table to be imported
-  \param coverageId identifier of the coverage to be imported
-  \return a pointer to the generated layer
-*/
-template <class T>
-bool
-TeCoverageImportLayer(TeLayer* layer, TeLayer* srcLayer, const std::vector<std::string>& columns, const std::string& coverageId)
-{
-    if (!layer || !srcLayer)
-    {
-        std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-    // Check if the layer has a coverage with the same coverage id
-    std::vector<std::string> coverageIds;
-    TeRetrieveCoverageIds(layer, coverageIds);
-    if (find(coverageIds.begin(), coverageIds.end(), coverageId) != coverageIds.end())
-    {
-        std::string errorMsg = "Couldn't import Coverage. Coverage ID already in use.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-    
-    std::vector<SerializedPair<T> > serialized;
-    std::vector<TeCoverageDimension> dimensions;
-
-    // Get data (geometry-value pairs) and metadata (dimensions) from the source layer
-    if (!decodeLayer(srcLayer, columns, serialized, dimensions))
-    {
-        std::string errorMsg = "Couldn't import Coverage. Error decoding source layer.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-    // Set metadata table with dimensions information
-    std::string& metadataTableName = TeDefaultCoverageMetadataTable(layer);
-    fillCoverageMetadataTable(layer, metadataTableName, coverageId, dimensions);
-
-    // Partition geometries in clusters
-    std::vector<std::vector<SerializedPair<T> > > clusterGroups;
-    clusterSerialized<T>(serialized, clusterGroups);
-
-    // Add clusters to the database and update layer and representations info
-    populateDatabase<T>(layer, coverageId, clusterGroups);
-
-    return true;
-}
-
-//! Import Coverage from a layer of geometries
-/*!
-  \par Import a Coverage from an existing layer of geometries in
-       a TerraLib database to an existing layer of a TerraLib database.
-  \param layer pointer to a layer already created
-  \param srcLayer pointer to the existing layer of geometries
-  \param srcAttrTableName name of an existing attributes table
-  \param columns columns of the attributes table to be imported
-  \param coverageId identifier of the coverage to be imported
-  \return a pointer to the generated layer
-*/
-template <class T>
-TeLayer*
-TeCoverageImportLayer(TeDatabase* database, const std::string& layerName, TeLayer* srcLayer, const std::vector<std::string>& columns, const std::string& coverageId)
-{
-    if (!database || layerName.empty() || !srcLayer)
-    {
-        std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-    TeLayer* newLayer = createNewCoverageLayer(database, layerName, srcLayer->projection());
-    try {
-        TeCoverageImportLayer<T>(newLayer, srcLayer, columns, coverageId);
-    }
-    catch (TeException e)
-    {
-	    database->deleteLayer(newLayer->id());
-        throw e;
-    }
-
-	return newLayer;
-}
-
-//! Import Point Coverage from a Shape File, creating a new layer.
-/*!
-  \par Import a Point Coverage from a Shape File to a TerraLib
-       database, creating a new layer where the coverage is stored.
-  \param database a pointer to the database to where the coverage will
-         be imported
-  \param layerName name of the layer to be created
-  \param projection projection used in shape file
-  \param fileName name of the shape file to be read
-  \param columns columns of the shape file to be imported
-  \param coverageId identifier of the coverage to be imported
-  \return a pointer to the generated layer
-*/
-//TeLayer* TePointCoverageImportSHP(TeDatabase* database, const std::string& layerName, TeProjection* projection, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId = "0");
-
-//! Import Point Coverage from a Shape File.
-/*!
-  \par Import a Point Coverage from a Shape File to an existing
-       layer of a TerraLib database.
-  \param layer pointer to a layer already created
-  \param fileName name of the shape file to be read
-  \param columns columns of the shape file to be imported
-  \param coverageId identifier of the coverage to be imported
-  \return whether the coverage was imported successfully
-*/
-//bool TePointCoverageImportSHP(TeLayer* layer, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId = "0");
-
-
-/*
-bool
-TePointCoverageImportSHP(TeLayer* layer, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId)
-{
-    if (!layer || fileName.empty())
-    {
-        std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-    // Check if the layer has a coverage with the same coverage id
-    std::vector<std::string> coverageIds;
-    TeRetrieveCoverageIds(layer, coverageIds);
-    if (find(coverageIds.begin(), coverageIds.end(), coverageId) != coverageIds.end())
-    {
-        std::string errorMsg = "Couldn't import Point Coverage. Coverage ID already in use.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-    
-    SerializedPointVector serializedPoints;
-    std::vector<TeCoverageDimension> dimensions;
-
-    // Get data (point-value pairs) and metadata (dimensions) from a ShapeFile
-    if (!decodeSHPFile(fileName, columns, serializedPoints, dimensions))
-    {
-        std::string errorMsg = "Couldn't import Point Coverage. Error decoding Shape File.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-    // Set metadata table with dimensions information
-    std::string& metadataTableName = TeDefaultCoverageMetadataTable(layer);
-    fillCoverageMetadataTable(layer, metadataTableName, coverageId, dimensions);
-
-    // Partition points in clusters
-    std::vector<SerializedPointVector> clusterGroups;
-    clusterSerializedPoints(serializedPoints, clusterGroups);
-
-    // Add clusters to the database and update layer and representations info
-    populateDatabase(layer, coverageId, clusterGroups);
-
-    return true;
-}
-
-TeLayer*
-TePointCoverageImportSHP(TeDatabase* database, const std::string& layerName, TeProjection* projection, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId)
-{	
-    if (!database || !projection || layerName.empty() || fileName.empty())
-    {
-        std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-    TeLayer* newLayer = createNewCoverageLayer(database, layerName, projection);
-    try {
-        TePointCoverageImportSHP(newLayer, fileName, columns, coverageId);
-    }
-    catch (TeException e)
-    {
-	    database->deleteLayer(newLayer->id());
-        throw e;
-    }
-
-	return newLayer;
-}
-*/
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*!
+  \file TeCoverageImport.h
+
+  \par This file contains algorithms for importing Coverage data
+       to a TerraLib database.
+*/
+#ifndef  __TERRALIB_INTERNAL_COVERAGEIMPORT_H
+#define  __TERRALIB_INTERNAL_COVERAGEIMPORT_H
+
+#include <sstream>
+
+#include "TeCoverageParams.h"
+#include "TeCoverageUtils.h"
+#include "TeCoverageImportUtils.h"
+#include <TeQuerier.h>
+#include <TeQuerierParams.h>
+//#include "TeDriverSHPDBF.h"
+
+/*!
+  \def WRITE
+  \brief Write a value of some type in a block of raw data.
+*/
+#define WRITE(data, t, v) *((t*)(data)) = v;  data += sizeof(t)
+
+
+/*!
+  \struct SerializedGeomValuePair
+  \brief A geometry and raw data that is the serialization of a geometry-value pair.
+*/
+template <class T>
+struct SerializedPair {
+    T geom;
+    unsigned char* data;
+    unsigned long size;
+};
+
+template <class T>
+struct CmpSerializedX {
+    bool operator() (SerializedPair<T>* s1, SerializedPair<T>* s2)
+    {
+        return s1->geom.box().center().x() < s2->geom.box().center().x();
+    }
+};
+
+template <class T>
+struct CmpSerializedY {
+    bool operator() (SerializedPair<T>* s1, SerializedPair<T>* s2)
+    {
+        return s1->geom.box().center().y() < s2->geom.box().center().y();
+    }
+};
+
+template <class T>
+void
+splitSerialized(std::vector<SerializedPair<T>* >& src,
+                typename std::vector<SerializedPair<T>* >::iterator& begin,
+                typename std::vector<SerializedPair<T>* >::iterator& end,
+                std::vector<std::vector<SerializedPair<T> > >& clusters)
+{
+    const int CLUSTER_CAPACITY = 300;
+    if ((end - begin) <= CLUSTER_CAPACITY)
+    {
+        std::vector<SerializedPair<T> >& cluster = std::vector<SerializedPair<T> >();
+        for (std::vector<SerializedPair<T>* >::iterator it = begin; it != end; it++)
+        {
+            SerializedPair<T>* pair = *it;
+            cluster.push_back(*pair);
+        }
+        clusters.push_back(cluster);
+        return;
+    }
+
+    TeBox box = TeBox();
+    for (std::vector<SerializedPair<T>* >::iterator it = begin; it != end; it++)
+    {
+        SerializedPair<T>* pair = (*it);
+        updateBox(box, pair->geom.box());
+    }
+
+    // split geom set horizontaly if width is larger than height
+    if ((box.x2_ - box.x1_) > (box.y2_ - box.y1_))
+    {
+        sort(begin, end, CmpSerializedX<T>());
+    }
+    // split verticaly otherwise
+    else
+    {
+        sort(begin, end, CmpSerializedX<T>());
+    }
+
+    std::vector<SerializedPair<T> *>::iterator mid = begin + (((end - begin) + 1) / 2);
+    splitSerialized(src, mid, end, clusters);
+    splitSerialized(src, begin, mid, clusters);
+}
+
+template <class T>
+void
+clusterSerialized(std::vector<SerializedPair<T> >& srcGroup, std::vector<std::vector<SerializedPair<T> > >& clusters)
+{
+    std::vector<SerializedPair<T>* >& pairs = std::vector<SerializedPair<T>* >();
+
+    for (std::vector<SerializedPair<T> >::iterator it = srcGroup.begin(); it != srcGroup.end(); it++)
+    {
+        SerializedPair<T>& pair = *it;
+        pairs.push_back(&pair);
+    }
+    splitSerialized(pairs, pairs.begin(), pairs.end(), clusters);
+}
+
+template <class T>
+void
+populateDatabase(TeLayer* layer, const std::string& coverageId, std::vector<std::vector<SerializedPair<T> > >& groups)
+{
+    TeDatabase* db = layer->database();
+
+    std::string& tableName = TeDefaultCoverageTable(layer, coverageId);
+    if (!db->tableExist(tableName))
+    {
+        createCoverageTable(layer, tableName);
+    }
+
+    // Bounding box of the coverage, to be calculated
+    TeBox coverageBox = TeBox();
+
+    // Iterate over the  collection of grouped points
+    std::vector<std::vector<SerializedPair<T> > >::iterator itGroups = groups.begin();
+    std::vector<std::vector<SerializedPair<T> > >::iterator endGroups = groups.end();
+    int count = 0;
+    while (itGroups != endGroups)
+    {
+        std::vector<SerializedPair<T> >& group = *(itGroups++);
+        std::vector<SerializedPair<T> >::iterator itPoints = group.begin();
+        std::vector<SerializedPair<T> >::iterator endPoints = group.end();
+
+        // Calculate block size, according to sizes of serialized points
+        unsigned long blockSize = 0;
+        while (itPoints != endPoints)
+        {
+            blockSize += itPoints->size;
+            itPoints++;
+        }
+
+        // Allocate enough memory for the block data
+        unsigned char* blockData = NULL;
+        blockData = (unsigned char*)malloc(blockSize);
+
+        unsigned char* dest = blockData;
+
+        // Create bounding box of the group
+        TeBox blockBox = TeBox();
+
+        // Reset iterator and iterate over the serialized points in the group
+        itPoints = group.begin();
+        while (itPoints != endPoints)
+        {
+            // Join chunks to the block data
+            unsigned char* src = itPoints->data;
+            for (unsigned int i = 0; i < itPoints->size; i++)
+            {
+                *dest++ = *src++;
+            }
+
+            // Update block bounding box
+            updateBox(blockBox, itPoints->geom.box());
+
+            itPoints++;
+        }
+
+        // Update coverage bounding box
+        updateBox(coverageBox, blockBox);
+
+        count++;
+
+        // Insert block data as an entry in the coverage block table
+        insertToCoverageTable(layer, tableName, count, blockBox, group.size(), blockData, blockSize);
+    }
+
+    // Create coverage layer, if it does not exist
+    std::string& layerTableName = TeDefaultCoverageLayerTable(layer);
+    if (!db->tableExist(layerTableName))
+    {   
+        createCoverageLayerTable(layer, layerTableName);
+    }
+    insertToCoverageLayerTable(layer, layerTableName, tableName, coverageId, coverageBox);
+
+    // Check if this coverage layer is in the representations table
+    TeRepresentation* rep = layer->getRepresentation(TeCOVERAGE, layerTableName);
+    if (rep != NULL)
+    {
+        // Update bounding box of the representation
+        updateBox(rep->box_, coverageBox);
+        
+        if (!db->updateRepresentation(layer->id(), *rep))
+        {
+            std::string errorMsg = "Couldn't update representation on layer '" + Te2String(layer->id()) + "'. DB error: \"" + db->errorMessage() + "\"";
+            throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+        }
+    }
+    else
+    {
+        // Insert entry in the representations table
+        TeRepresentation* rep = new TeRepresentation();
+        rep->box_ = coverageBox;
+        rep->geomRep_ = TeCOVERAGE;
+        rep->tableName_ = layerTableName;
+        layer->addVectRepres(rep);
+
+        if (!db->insertRepresentation(layer->id(), *rep))
+        {
+            std::string errorMsg = "Couldn't insert representation on layer '" + Te2String(layer->id()) + "'. DB error: \"" + db->errorMessage() + "\"";
+            throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+        }
+    }
+
+    // Update bounding box of the layer
+    layer->updateLayerBox(coverageBox);
+    if (!db->updateLayer(layer))
+    {
+        std::string errorMsg = "Couldn't update layer '" + Te2String(layer->id()) + "'. DB error: \"" + db->errorMessage() + "\"";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+}
+
+//! Specialization for decoding a point layer
+bool
+decodeLayer(TeLayer* srcLayer, const std::vector<std::string>& columns, std::vector<SerializedPair<TePoint> >& serializedVector, std::vector<TeCoverageDimension>& dimensions)
+{
+    TeQuerierParams querierParams(true, columns);
+    querierParams.setParams(srcLayer);
+    TeQuerier querier(querierParams);
+    querier.loadInstances();
+
+    // Set information about the coverage dimensions
+    TeAttributeList attList = querier.getAttrList();
+    attributeListToCoverageDimensions(attList, dimensions);
+    
+    // Size of (x, y) pair
+    int chunkSize = (2 * sizeof(double)) + TeCoverageDimensionsSize(dimensions);
+
+    // Extract coverage data
+    unsigned int instanceCount = 0;
+    TeSTInstance sti;
+    while(querier.fetchInstance(sti))
+    {
+        if(!sti.hasPoints())
+        {
+            // If it doesn't have a point, proceed to the next instance
+            continue;
+        }
+
+        SerializedPair<TePoint> serialized;
+        serialized.size = chunkSize;
+
+        // Get only the first point
+        TePointSet pointSet;
+        sti.getGeometry(pointSet);
+        TePoint point = *(pointSet.begin());
+    
+        serialized.geom = point;
+
+        serialized.data = (unsigned char*)malloc(serialized.size);
+
+        unsigned char* temp = serialized.data;
+
+        // Write coordinates
+        WRITE(temp, double, point.location().x_);
+        WRITE(temp, double, point.location().y_);
+
+        // Write dimensions values
+        TePropertyVector vec = sti.getPropertyVector();
+        for(unsigned int i = 0; i < vec.size(); i++)
+        {
+            if (dimensions[i].type == TeINTEGER)
+            {
+                std::stringstream buf;
+                buf << vec[i].value_;
+                int val;
+                buf >> val;
+                WRITE(temp, int, val);
+                buf.clear();
+            }
+            else
+            {
+                std::stringstream buf;
+                buf << vec[i].value_;
+                double val;
+                buf >> val;
+                WRITE(temp, double, val);
+                buf.clear();
+            }
+        }
+        serializedVector.push_back(serialized);
+
+    }
+    return true;
+}
+
+bool
+decodeLayer(TeLayer* srcLayer, const std::vector<std::string>& columns, std::vector<SerializedPair<TeLine2D> >& serializedVector, std::vector<TeCoverageDimension>& dimensions)
+{
+    TeQuerierParams querierParams(true, columns);
+    querierParams.setParams(srcLayer);
+    TeQuerier querier(querierParams);
+    querier.loadInstances();
+
+    // Set information about the coverage dimensions
+    TeAttributeList attList = querier.getAttrList();
+    attributeListToCoverageDimensions(attList, dimensions);
+
+    int dimensionsSize = TeCoverageDimensionsSize(dimensions);
+    
+    // Extract coverage data
+    unsigned int instanceCount = 0;
+    TeSTInstance sti;
+    while(querier.fetchInstance(sti))
+    {
+        if(!sti.hasLines())
+        {
+            // If it doesn't have a line, proceed to the next instance
+            continue;
+        }
+
+        SerializedPair<TeLine2D> serialized;
+
+        // Get only the first line
+        TeLineSet lineSet;
+        sti.getGeometry(lineSet);
+        TeLine2D line = *(lineSet.begin());
+
+        serialized.geom = line;
+
+        int pointSize = (2 * sizeof(double));
+        serialized.size = sizeof(unsigned int) + (line.size() * pointSize) + dimensionsSize;
+
+        serialized.data = (unsigned char*)malloc(serialized.size);
+
+        unsigned char* temp = serialized.data;
+
+        WRITE(temp, unsigned int, line.size());
+
+        // Write point coordinates
+        for (unsigned int i = 0; i < line.size(); ++i)
+        {
+            TePoint point = line[i];
+            WRITE(temp, double, point.location().x_);
+            WRITE(temp, double, point.location().y_);
+        }
+
+        // Write dimensions values
+        TePropertyVector vec = sti.getPropertyVector();
+        for(unsigned int i = 0; i < vec.size(); i++)
+        {
+            if (dimensions[i].type == TeINTEGER)
+            {
+                std::stringstream buf;
+                buf << vec[i].value_;
+                int val;
+                buf >> val;
+                WRITE(temp, int, val);
+                buf.clear();
+            }
+            else
+            {
+                std::stringstream buf;
+                buf << vec[i].value_;
+                double val;
+                buf >> val;
+                WRITE(temp, double, val);
+                buf.clear();
+            }
+        }
+        serializedVector.push_back(serialized);
+
+    }
+    return true;
+}
+
+bool
+decodeLayer(TeLayer* srcLayer, const std::vector<std::string>& columns, std::vector<SerializedPair<TePolygon> >& serializedVector, std::vector<TeCoverageDimension>& dimensions)
+{
+    TeQuerierParams querierParams(true, columns);
+    querierParams.setParams(srcLayer);
+    TeQuerier querier(querierParams);
+    querier.loadInstances();
+
+    // Set information about the coverage dimensions
+    TeAttributeList attList = querier.getAttrList();
+    attributeListToCoverageDimensions(attList, dimensions);
+
+    int dimensionsSize = TeCoverageDimensionsSize(dimensions);
+    
+    // Extract coverage data
+    unsigned int instanceCount = 0;
+    TeSTInstance sti;
+    while(querier.fetchInstance(sti))
+    {
+        if(!sti.hasPolygons())
+        {
+            // If it doesn't have a polygon, proceed to the next instance
+            continue;
+        }
+
+        SerializedPair<TePolygon> serialized;
+
+        // Get only the first polygon
+        TePolygonSet polySet;
+        sti.getGeometry(polySet);
+        TePolygon poly = *(polySet.begin());
+
+        serialized.geom = poly;
+        
+        // Count number of lines and points that make this polygon
+        unsigned int numLines = 0;
+        unsigned int numPoints = 0;
+        for(unsigned int i = 0; i < poly.size(); ++i)
+        {
+            numLines += 1;
+            numPoints += poly[i].size();
+        }
+
+        int coordSize = (2 * sizeof(double));
+        serialized.size = sizeof(unsigned int) + (numLines * sizeof(unsigned int)) + (numPoints * coordSize) + dimensionsSize;
+
+        serialized.data = (unsigned char*)malloc(serialized.size);
+
+        unsigned char* temp = serialized.data;
+
+        // Write Polygon serialization
+        WRITE(temp, unsigned int, numLines);
+        for (unsigned int i = 0; i < numLines; ++i)
+        {
+            TeLine2D line = poly[i];
+            WRITE(temp, unsigned int, line.size());
+
+            // Write point coordinates
+            for (unsigned int j = 0; j < line.size(); ++j)
+            {
+                TePoint point = line[j];
+                WRITE(temp, double, point.location().x());
+                WRITE(temp, double, point.location().y());
+            }
+        }
+
+        // Write dimensions serialization
+        TePropertyVector vec = sti.getPropertyVector();
+        for(unsigned int i = 0; i < vec.size(); i++)
+        {
+            if (dimensions[i].type == TeINTEGER)
+            {
+                std::stringstream buf;
+                buf << vec[i].value_;
+                int val;
+                buf >> val;
+                WRITE(temp, int, val);
+                buf.clear();
+            }
+            else
+            {
+                std::stringstream buf;
+                buf << vec[i].value_;
+                double val;
+                buf >> val;
+                WRITE(temp, double, val);
+                buf.clear();
+            }
+        }
+        serializedVector.push_back(serialized);
+
+    }
+    return true;
+}
+
+//! Import Coverage from a layer of geometries, creating a new layer
+/*!
+  \par Import a Coverage from an existing layer of geometries in
+       a TerraLib database, creating a new layer where the coverage is stored.
+  \param database a pointer to the database to where the coverage will be imported
+  \param layerName name of the layer to be created
+  \param srcLayer pointer to the existing layer of geometries
+  \param srcAttrTableName name of an existing attributes table
+  \param columns columns of the attributes table to be imported
+  \param coverageId identifier of the coverage to be imported
+  \return a pointer to the generated layer
+*/
+template <class T>
+bool
+TeCoverageImportLayer(TeLayer* layer, TeLayer* srcLayer, const std::vector<std::string>& columns, const std::string& coverageId)
+{
+    if (!layer || !srcLayer)
+    {
+        std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+    // Check if the layer has a coverage with the same coverage id
+    std::vector<std::string> coverageIds;
+    TeRetrieveCoverageIds(layer, coverageIds);
+    if (find(coverageIds.begin(), coverageIds.end(), coverageId) != coverageIds.end())
+    {
+        std::string errorMsg = "Couldn't import Coverage. Coverage ID already in use.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+    
+    std::vector<SerializedPair<T> > serialized;
+    std::vector<TeCoverageDimension> dimensions;
+
+    // Get data (geometry-value pairs) and metadata (dimensions) from the source layer
+    if (!decodeLayer(srcLayer, columns, serialized, dimensions))
+    {
+        std::string errorMsg = "Couldn't import Coverage. Error decoding source layer.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+    // Set metadata table with dimensions information
+    std::string& metadataTableName = TeDefaultCoverageMetadataTable(layer);
+    fillCoverageMetadataTable(layer, metadataTableName, coverageId, dimensions);
+
+    // Partition geometries in clusters
+    std::vector<std::vector<SerializedPair<T> > > clusterGroups;
+    clusterSerialized<T>(serialized, clusterGroups);
+
+    // Add clusters to the database and update layer and representations info
+    populateDatabase<T>(layer, coverageId, clusterGroups);
+
+    return true;
+}
+
+//! Import Coverage from a layer of geometries
+/*!
+  \par Import a Coverage from an existing layer of geometries in
+       a TerraLib database to an existing layer of a TerraLib database.
+  \param layer pointer to a layer already created
+  \param srcLayer pointer to the existing layer of geometries
+  \param srcAttrTableName name of an existing attributes table
+  \param columns columns of the attributes table to be imported
+  \param coverageId identifier of the coverage to be imported
+  \return a pointer to the generated layer
+*/
+template <class T>
+TeLayer*
+TeCoverageImportLayer(TeDatabase* database, const std::string& layerName, TeLayer* srcLayer, const std::vector<std::string>& columns, const std::string& coverageId)
+{
+    if (!database || layerName.empty() || !srcLayer)
+    {
+        std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+    TeLayer* newLayer = createNewCoverageLayer(database, layerName, srcLayer->projection());
+    try {
+        TeCoverageImportLayer<T>(newLayer, srcLayer, columns, coverageId);
+    }
+    catch (TeException e)
+    {
+	    database->deleteLayer(newLayer->id());
+        throw e;
+    }
+
+	return newLayer;
+}
+
+//! Import Point Coverage from a Shape File, creating a new layer.
+/*!
+  \par Import a Point Coverage from a Shape File to a TerraLib
+       database, creating a new layer where the coverage is stored.
+  \param database a pointer to the database to where the coverage will
+         be imported
+  \param layerName name of the layer to be created
+  \param projection projection used in shape file
+  \param fileName name of the shape file to be read
+  \param columns columns of the shape file to be imported
+  \param coverageId identifier of the coverage to be imported
+  \return a pointer to the generated layer
+*/
+//TeLayer* TePointCoverageImportSHP(TeDatabase* database, const std::string& layerName, TeProjection* projection, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId = "0");
+
+//! Import Point Coverage from a Shape File.
+/*!
+  \par Import a Point Coverage from a Shape File to an existing
+       layer of a TerraLib database.
+  \param layer pointer to a layer already created
+  \param fileName name of the shape file to be read
+  \param columns columns of the shape file to be imported
+  \param coverageId identifier of the coverage to be imported
+  \return whether the coverage was imported successfully
+*/
+//bool TePointCoverageImportSHP(TeLayer* layer, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId = "0");
+
+
+/*
+bool
+TePointCoverageImportSHP(TeLayer* layer, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId)
+{
+    if (!layer || fileName.empty())
+    {
+        std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+    // Check if the layer has a coverage with the same coverage id
+    std::vector<std::string> coverageIds;
+    TeRetrieveCoverageIds(layer, coverageIds);
+    if (find(coverageIds.begin(), coverageIds.end(), coverageId) != coverageIds.end())
+    {
+        std::string errorMsg = "Couldn't import Point Coverage. Coverage ID already in use.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+    
+    SerializedPointVector serializedPoints;
+    std::vector<TeCoverageDimension> dimensions;
+
+    // Get data (point-value pairs) and metadata (dimensions) from a ShapeFile
+    if (!decodeSHPFile(fileName, columns, serializedPoints, dimensions))
+    {
+        std::string errorMsg = "Couldn't import Point Coverage. Error decoding Shape File.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+    // Set metadata table with dimensions information
+    std::string& metadataTableName = TeDefaultCoverageMetadataTable(layer);
+    fillCoverageMetadataTable(layer, metadataTableName, coverageId, dimensions);
+
+    // Partition points in clusters
+    std::vector<SerializedPointVector> clusterGroups;
+    clusterSerializedPoints(serializedPoints, clusterGroups);
+
+    // Add clusters to the database and update layer and representations info
+    populateDatabase(layer, coverageId, clusterGroups);
+
+    return true;
+}
+
+TeLayer*
+TePointCoverageImportSHP(TeDatabase* database, const std::string& layerName, TeProjection* projection, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId)
+{	
+    if (!database || !projection || layerName.empty() || fileName.empty())
+    {
+        std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+    TeLayer* newLayer = createNewCoverageLayer(database, layerName, projection);
+    try {
+        TePointCoverageImportSHP(newLayer, fileName, columns, coverageId);
+    }
+    catch (TeException e)
+    {
+	    database->deleteLayer(newLayer->id());
+        throw e;
+    }
+
+	return newLayer;
+}
+*/
+
 #endif // __TERRALIB_INTERNAL_COVERAGEIMPORT_H
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageImportUtils.cpp b/src/terralib/kernel/TeCoverageImportUtils.cpp
index 0fc4932..8009bac 100644
--- a/src/terralib/kernel/TeCoverageImportUtils.cpp
+++ b/src/terralib/kernel/TeCoverageImportUtils.cpp
@@ -1,286 +1,286 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*
-** ----------------------------------------------------------------------------
-** Includes:
-*/
-
-#include "TeCoverageImportUtils.h"
-
-/*
-** ----------------------------------------------------------------------------
-** Definitions:
-*/
-
-/*
-** ----------------------------------------------------------------------------
-** Methods Implementation:
-*/
-
-void attributeListToCoverageDimensions(const TeAttributeList& attributes, std::vector<TeCoverageDimension>& dimensions)
-{
-    dimensions.clear();
-
-    unsigned int count = 0;
-    for (TeAttributeList::const_iterator it = attributes.begin(); it != attributes.end(); it++)
-    {
-        TeDataType dimensionType = (it->rep_.type_ == TeINT) ? TeINTEGER : TeDOUBLE;
-        dimensions.push_back(TeCoverageDimension(count, it->rep_.name_, dimensionType));
-        count++;
-    }
-}
-
-void
-createCoverageTable(TeLayer* layer, std::string& tableName)
-{
-    TeAttributeList attList;
-    
-    TeAttribute blockIdAtt;
-
-    blockIdAtt.rep_.type_ = TeINT;
-    blockIdAtt.rep_.name_ = "block_id";
-    blockIdAtt.rep_.isPrimaryKey_ = true;
-    attList.push_back(blockIdAtt);
-
-    TeAttribute lowerXAtt;
-    lowerXAtt.rep_.type_ = TeREAL;
-    lowerXAtt.rep_.name_ = "lower_x";
-    attList.push_back(lowerXAtt);
-
-    TeAttribute lowerYAtt;
-    lowerYAtt.rep_.type_ = TeREAL;
-    lowerYAtt.rep_.name_ = "lower_y";
-    attList.push_back(lowerYAtt);
-
-    TeAttribute upperXAtt;
-    upperXAtt.rep_.type_ = TeREAL;
-    upperXAtt.rep_.name_ = "upper_x";
-    attList.push_back(upperXAtt);
-
-    TeAttribute upperYAtt;
-    upperYAtt.rep_.type_ = TeREAL;
-    upperYAtt.rep_.name_ = "upper_y";
-    attList.push_back(upperYAtt);
-
-    TeAttribute numElementsAtt;
-    numElementsAtt.rep_.type_ = TeINT;
-    numElementsAtt.rep_.name_ = "num_elements";
-    attList.push_back(numElementsAtt);
-
-    TeAttribute spatialDataAtt;
-    spatialDataAtt.rep_.type_ = TeBLOB;
-    spatialDataAtt.rep_.name_ = "spatial_data";
-    attList.push_back(spatialDataAtt);
-
-    if (!layer->database()->createTable(tableName, attList))
-    {
-        std::string errorMsg = "Couldn't create table '" + tableName + "'.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-}
-
-void
-insertToCoverageTable(TeLayer* layer, std::string& tableName, const unsigned int blockId, const TeBox& blockBox, const unsigned int numElements, unsigned char* data, const unsigned long dataSize)
-{
-    // Insert block info into the coverage table
-    std::string sqlInsert = "INSERT INTO " + tableName + " (block_id, lower_x, lower_y, upper_x, upper_y, num_elements) VALUES ('" + Te2String(blockId) + "', " + Te2String(blockBox.x1_) + ", " + Te2String(blockBox.y1_) + ", " + Te2String(blockBox.x2_) + ", " + Te2String(blockBox.y2_) + ", " + Te2String(numElements) + ")";
-    if (!layer->database()->execute(sqlInsert))
-    {
-        std::string errorMsg = "Couldn't insert block '" + Te2String(blockId) + "' to coverage table '" + tableName + "'.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-    // Insert block data into the coverage table
-    std::string whereClause = "block_id = " + Te2String(blockId);
-    if (!layer->database()->insertBlob(tableName, "spatial_data", whereClause , data, dataSize))
-    {
-        std::string errorMsg = "Couldn't insert block '" + Te2String(blockId) + "' to coverage table '" + tableName + "'.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-}
-
-void
-createCoverageLayerTable(TeLayer* layer, std::string& tableName)
-{
-    TeAttributeList attList;
-    
-    TeAttribute geomIdAtt;
-    geomIdAtt.rep_.type_ = TeINT;
-    geomIdAtt.rep_.name_ = "geom_id";
-    geomIdAtt.rep_.isPrimaryKey_ = true;
-    geomIdAtt.rep_.isAutoNumber_ = true;
-    attList.push_back(geomIdAtt);
-
-    TeAttribute coverageIdAtt;
-    coverageIdAtt.rep_.type_ = TeSTRING;
-    coverageIdAtt.rep_.numChar_ = 25;
-    coverageIdAtt.rep_.name_ = "coverage_id";
-    coverageIdAtt.rep_.isPrimaryKey_ = false;
-	attList.push_back(coverageIdAtt);
-
-    TeAttribute coverageTableAtt;
-    coverageTableAtt.rep_.type_ = TeSTRING;
-    coverageTableAtt.rep_.numChar_ = 255;
-    coverageTableAtt.rep_.name_ = "coverage_table";
-    coverageTableAtt.rep_.isPrimaryKey_ = false;
-	attList.push_back(coverageTableAtt);
-
-    TeAttribute lowerXAtt;
-    lowerXAtt.rep_.type_ = TeREAL;
-    lowerXAtt.rep_.name_ = "lower_x";
-    attList.push_back(lowerXAtt);
-
-    TeAttribute lowerYAtt;
-    lowerYAtt.rep_.type_ = TeREAL;
-    lowerYAtt.rep_.name_ = "lower_y";
-    attList.push_back(lowerYAtt);
-
-    TeAttribute upperXAtt;
-    upperXAtt.rep_.type_ = TeREAL;
-    upperXAtt.rep_.name_ = "upper_x";
-    attList.push_back(upperXAtt);
-
-    TeAttribute upperYAtt;
-    upperYAtt.rep_.type_ = TeREAL;
-    upperYAtt.rep_.name_ = "upper_y";
-    attList.push_back(upperYAtt);
-
-    if (!layer->database()->createTable(tableName, attList))
-    {
-        std::string errorMsg = "Couldn't create table '" + tableName + "'.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-}
-
-void
-insertToCoverageLayerTable(TeLayer* layer, std::string& coverageLayerTableName, std::string& coverageTableName, const std::string& coverageId, TeBox& coverageBox)
-{
-    // Insert entry in the coverage layer table
-    std::string sqlInsert = "INSERT INTO " + coverageLayerTableName + " (coverage_id, coverage_table, lower_x, lower_y, upper_x, upper_y) VALUES ('" + coverageId + "', '" + coverageTableName + "', " + Te2String(coverageBox.x1_) + ", " + Te2String(coverageBox.y1_) + ", " + Te2String(coverageBox.x2_) + ", " + Te2String(coverageBox.y2_) + ")";
-    if (!layer->database()->execute(sqlInsert))
-    {
-        std::string errorMsg = "Couldn't insert coverage '" + coverageId + "' to layer table '" + coverageLayerTableName + "'.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-}
-
-void
-createCoverageMetadataTable(TeLayer* layer, std::string& metadataTableName)
-{
-    TeAttributeList attList;
-
-    TeAttribute coverageIdAtt;
-    coverageIdAtt.rep_.type_ = TeSTRING;
-    coverageIdAtt.rep_.numChar_ = 25;
-    coverageIdAtt.rep_.name_ = "coverage_id";
-    coverageIdAtt.rep_.isPrimaryKey_ = true;
-	attList.push_back(coverageIdAtt);
-
-    TeAttribute dimensionIdAtt;
-    dimensionIdAtt.rep_.type_ = TeINT;
-    dimensionIdAtt.rep_.name_ = "dimension_id";
-    dimensionIdAtt.rep_.isPrimaryKey_ = true;
-    attList.push_back(dimensionIdAtt);
-
-    TeAttribute dataTypeAtt;
-    dataTypeAtt.rep_.type_ = TeINT;
-    dataTypeAtt.rep_.name_ = "data_type";
-    dataTypeAtt.rep_.isPrimaryKey_ = false;
-    attList.push_back(dataTypeAtt);
-
-    TeAttribute nameAtt;
-    nameAtt.rep_.type_ = TeSTRING;
-    nameAtt.rep_.numChar_ = 25;
-    nameAtt.rep_.name_ = "name";
-    nameAtt.rep_.isPrimaryKey_ = false;
-	attList.push_back(nameAtt);
-
-    if (!layer->database()->createTable(metadataTableName, attList))
-    {
-        std::string errorMsg = "Couldn't create table '" + metadataTableName + "'.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-}
-
-void
-fillCoverageMetadataTable(TeLayer* layer, std::string& metadataTableName, const std::string& coverageId, std::vector<TeCoverageDimension>& dimensions)
-{
-    TeDatabase* db = layer->database();
-    if (!db->tableExist(metadataTableName))
-    {   
-        createCoverageMetadataTable(layer, metadataTableName);
-    }
-
-    for (std::vector<TeCoverageDimension>::iterator it = dimensions.begin(); it != dimensions.end(); it++)
-    {
-        const std::string& coverageIdStr = coverageId;
-        const std::string dimensionIdStr = Te2String(it->dimension_id);
-        const std::string dataTypeStr = Te2String(static_cast<TeDataType>(it->type));
-        const std::string& nameStr = it->name;
-
-        std::string sqlInsert = "INSERT INTO " + metadataTableName + " (coverage_id, dimension_id, data_type, name) VALUES ('" + coverageIdStr + "', '" + dimensionIdStr + "', '" + dataTypeStr + "', '" + nameStr + "')";
-
-        if (!db->execute(sqlInsert))
-        {
-            std::string errorMsg = "Couldn't insert values to metadata table '" + metadataTableName + "'.";
-            throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-        }
-    }
-}
-
-TeLayer* createNewCoverageLayer(TeDatabase* database, const std::string& layerName, TeProjection* projection)
-{
-    // Find a valid layer name
-    std::string newLayerName = layerName;
-    TeLayerMap& layerMap = database->layerMap();
-    TeLayerMap::iterator it = layerMap.begin();
-    int n = 0;
-    while (it != layerMap.end())
-    {
-        if (TeStringCompare(it->second->name(),newLayerName))
-        {
-            // Try another name and restart search
-            newLayerName = layerName + "_" + Te2String(n++);
-            it = layerMap.begin();
-            continue;
-        }
-        it++;
-    }
-
-    // Create new layer
-	TeLayer* newLayer = new TeLayer(newLayerName, database, projection);
-	if (!newLayer || newLayer->id() <= 0)
-    {
-        std::string errorMsg = "Layer creation failed.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-    return newLayer;
-}
-
-/*
-** ----------------------------------------------------------------------------
-** End:
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*
+** ----------------------------------------------------------------------------
+** Includes:
+*/
+
+#include "TeCoverageImportUtils.h"
+
+/*
+** ----------------------------------------------------------------------------
+** Definitions:
+*/
+
+/*
+** ----------------------------------------------------------------------------
+** Methods Implementation:
+*/
+
+void attributeListToCoverageDimensions(const TeAttributeList& attributes, std::vector<TeCoverageDimension>& dimensions)
+{
+    dimensions.clear();
+
+    unsigned int count = 0;
+    for (TeAttributeList::const_iterator it = attributes.begin(); it != attributes.end(); it++)
+    {
+        TeDataType dimensionType = (it->rep_.type_ == TeINT) ? TeINTEGER : TeDOUBLE;
+        dimensions.push_back(TeCoverageDimension(count, it->rep_.name_, dimensionType));
+        count++;
+    }
+}
+
+void
+createCoverageTable(TeLayer* layer, std::string& tableName)
+{
+    TeAttributeList attList;
+    
+    TeAttribute blockIdAtt;
+
+    blockIdAtt.rep_.type_ = TeINT;
+    blockIdAtt.rep_.name_ = "block_id";
+    blockIdAtt.rep_.isPrimaryKey_ = true;
+    attList.push_back(blockIdAtt);
+
+    TeAttribute lowerXAtt;
+    lowerXAtt.rep_.type_ = TeREAL;
+    lowerXAtt.rep_.name_ = "lower_x";
+    attList.push_back(lowerXAtt);
+
+    TeAttribute lowerYAtt;
+    lowerYAtt.rep_.type_ = TeREAL;
+    lowerYAtt.rep_.name_ = "lower_y";
+    attList.push_back(lowerYAtt);
+
+    TeAttribute upperXAtt;
+    upperXAtt.rep_.type_ = TeREAL;
+    upperXAtt.rep_.name_ = "upper_x";
+    attList.push_back(upperXAtt);
+
+    TeAttribute upperYAtt;
+    upperYAtt.rep_.type_ = TeREAL;
+    upperYAtt.rep_.name_ = "upper_y";
+    attList.push_back(upperYAtt);
+
+    TeAttribute numElementsAtt;
+    numElementsAtt.rep_.type_ = TeINT;
+    numElementsAtt.rep_.name_ = "num_elements";
+    attList.push_back(numElementsAtt);
+
+    TeAttribute spatialDataAtt;
+    spatialDataAtt.rep_.type_ = TeBLOB;
+    spatialDataAtt.rep_.name_ = "spatial_data";
+    attList.push_back(spatialDataAtt);
+
+    if (!layer->database()->createTable(tableName, attList))
+    {
+        std::string errorMsg = "Couldn't create table '" + tableName + "'.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+}
+
+void
+insertToCoverageTable(TeLayer* layer, std::string& tableName, const unsigned int blockId, const TeBox& blockBox, const unsigned int numElements, unsigned char* data, const unsigned long dataSize)
+{
+    // Insert block info into the coverage table
+    std::string sqlInsert = "INSERT INTO " + tableName + " (block_id, lower_x, lower_y, upper_x, upper_y, num_elements) VALUES ('" + Te2String(blockId) + "', " + Te2String(blockBox.x1_) + ", " + Te2String(blockBox.y1_) + ", " + Te2String(blockBox.x2_) + ", " + Te2String(blockBox.y2_) + ", " + Te2String(numElements) + ")";
+    if (!layer->database()->execute(sqlInsert))
+    {
+        std::string errorMsg = "Couldn't insert block '" + Te2String(blockId) + "' to coverage table '" + tableName + "'.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+    // Insert block data into the coverage table
+    std::string whereClause = "block_id = " + Te2String(blockId);
+    if (!layer->database()->insertBlob(tableName, "spatial_data", whereClause , data, dataSize))
+    {
+        std::string errorMsg = "Couldn't insert block '" + Te2String(blockId) + "' to coverage table '" + tableName + "'.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+}
+
+void
+createCoverageLayerTable(TeLayer* layer, std::string& tableName)
+{
+    TeAttributeList attList;
+    
+    TeAttribute geomIdAtt;
+    geomIdAtt.rep_.type_ = TeINT;
+    geomIdAtt.rep_.name_ = "geom_id";
+    geomIdAtt.rep_.isPrimaryKey_ = true;
+    geomIdAtt.rep_.isAutoNumber_ = true;
+    attList.push_back(geomIdAtt);
+
+    TeAttribute coverageIdAtt;
+    coverageIdAtt.rep_.type_ = TeSTRING;
+    coverageIdAtt.rep_.numChar_ = 25;
+    coverageIdAtt.rep_.name_ = "coverage_id";
+    coverageIdAtt.rep_.isPrimaryKey_ = false;
+	attList.push_back(coverageIdAtt);
+
+    TeAttribute coverageTableAtt;
+    coverageTableAtt.rep_.type_ = TeSTRING;
+    coverageTableAtt.rep_.numChar_ = 255;
+    coverageTableAtt.rep_.name_ = "coverage_table";
+    coverageTableAtt.rep_.isPrimaryKey_ = false;
+	attList.push_back(coverageTableAtt);
+
+    TeAttribute lowerXAtt;
+    lowerXAtt.rep_.type_ = TeREAL;
+    lowerXAtt.rep_.name_ = "lower_x";
+    attList.push_back(lowerXAtt);
+
+    TeAttribute lowerYAtt;
+    lowerYAtt.rep_.type_ = TeREAL;
+    lowerYAtt.rep_.name_ = "lower_y";
+    attList.push_back(lowerYAtt);
+
+    TeAttribute upperXAtt;
+    upperXAtt.rep_.type_ = TeREAL;
+    upperXAtt.rep_.name_ = "upper_x";
+    attList.push_back(upperXAtt);
+
+    TeAttribute upperYAtt;
+    upperYAtt.rep_.type_ = TeREAL;
+    upperYAtt.rep_.name_ = "upper_y";
+    attList.push_back(upperYAtt);
+
+    if (!layer->database()->createTable(tableName, attList))
+    {
+        std::string errorMsg = "Couldn't create table '" + tableName + "'.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+}
+
+void
+insertToCoverageLayerTable(TeLayer* layer, std::string& coverageLayerTableName, std::string& coverageTableName, const std::string& coverageId, TeBox& coverageBox)
+{
+    // Insert entry in the coverage layer table
+    std::string sqlInsert = "INSERT INTO " + coverageLayerTableName + " (coverage_id, coverage_table, lower_x, lower_y, upper_x, upper_y) VALUES ('" + coverageId + "', '" + coverageTableName + "', " + Te2String(coverageBox.x1_) + ", " + Te2String(coverageBox.y1_) + ", " + Te2String(coverageBox.x2_) + ", " + Te2String(coverageBox.y2_) + ")";
+    if (!layer->database()->execute(sqlInsert))
+    {
+        std::string errorMsg = "Couldn't insert coverage '" + coverageId + "' to layer table '" + coverageLayerTableName + "'.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+}
+
+void
+createCoverageMetadataTable(TeLayer* layer, std::string& metadataTableName)
+{
+    TeAttributeList attList;
+
+    TeAttribute coverageIdAtt;
+    coverageIdAtt.rep_.type_ = TeSTRING;
+    coverageIdAtt.rep_.numChar_ = 25;
+    coverageIdAtt.rep_.name_ = "coverage_id";
+    coverageIdAtt.rep_.isPrimaryKey_ = true;
+	attList.push_back(coverageIdAtt);
+
+    TeAttribute dimensionIdAtt;
+    dimensionIdAtt.rep_.type_ = TeINT;
+    dimensionIdAtt.rep_.name_ = "dimension_id";
+    dimensionIdAtt.rep_.isPrimaryKey_ = true;
+    attList.push_back(dimensionIdAtt);
+
+    TeAttribute dataTypeAtt;
+    dataTypeAtt.rep_.type_ = TeINT;
+    dataTypeAtt.rep_.name_ = "data_type";
+    dataTypeAtt.rep_.isPrimaryKey_ = false;
+    attList.push_back(dataTypeAtt);
+
+    TeAttribute nameAtt;
+    nameAtt.rep_.type_ = TeSTRING;
+    nameAtt.rep_.numChar_ = 25;
+    nameAtt.rep_.name_ = "name";
+    nameAtt.rep_.isPrimaryKey_ = false;
+	attList.push_back(nameAtt);
+
+    if (!layer->database()->createTable(metadataTableName, attList))
+    {
+        std::string errorMsg = "Couldn't create table '" + metadataTableName + "'.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+}
+
+void
+fillCoverageMetadataTable(TeLayer* layer, std::string& metadataTableName, const std::string& coverageId, std::vector<TeCoverageDimension>& dimensions)
+{
+    TeDatabase* db = layer->database();
+    if (!db->tableExist(metadataTableName))
+    {   
+        createCoverageMetadataTable(layer, metadataTableName);
+    }
+
+    for (std::vector<TeCoverageDimension>::iterator it = dimensions.begin(); it != dimensions.end(); it++)
+    {
+        const std::string& coverageIdStr = coverageId;
+        const std::string dimensionIdStr = Te2String(it->dimension_id);
+        const std::string dataTypeStr = Te2String(static_cast<TeDataType>(it->type));
+        const std::string& nameStr = it->name;
+
+        std::string sqlInsert = "INSERT INTO " + metadataTableName + " (coverage_id, dimension_id, data_type, name) VALUES ('" + coverageIdStr + "', '" + dimensionIdStr + "', '" + dataTypeStr + "', '" + nameStr + "')";
+
+        if (!db->execute(sqlInsert))
+        {
+            std::string errorMsg = "Couldn't insert values to metadata table '" + metadataTableName + "'.";
+            throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+        }
+    }
+}
+
+TeLayer* createNewCoverageLayer(TeDatabase* database, const std::string& layerName, TeProjection* projection)
+{
+    // Find a valid layer name
+    std::string newLayerName = layerName;
+    TeLayerMap& layerMap = database->layerMap();
+    TeLayerMap::iterator it = layerMap.begin();
+    int n = 0;
+    while (it != layerMap.end())
+    {
+        if (TeStringCompare(it->second->name(),newLayerName))
+        {
+            // Try another name and restart search
+            newLayerName = layerName + "_" + Te2String(n++);
+            it = layerMap.begin();
+            continue;
+        }
+        it++;
+    }
+
+    // Create new layer
+	TeLayer* newLayer = new TeLayer(newLayerName, database, projection);
+	if (!newLayer || newLayer->id() <= 0)
+    {
+        std::string errorMsg = "Layer creation failed.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+    return newLayer;
+}
+
+/*
+** ----------------------------------------------------------------------------
+** End:
 */
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageImportUtils.h b/src/terralib/kernel/TeCoverageImportUtils.h
index fe990d1..751cda7 100644
--- a/src/terralib/kernel/TeCoverageImportUtils.h
+++ b/src/terralib/kernel/TeCoverageImportUtils.h
@@ -1,48 +1,48 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeCoverageImportUtils.h
-    \brief This file contains utility functions for importing coverages.
-*/
-#ifndef  __TERRALIB_INTERNAL_COVERAGEIMPORTUTILS_H
-#define  __TERRALIB_INTERNAL_COVERAGEIMPORTUTILS_H
-
-#include "TeCoverageParams.h"
-#include "TeCoverageUtils.h"
-
-TL_DLL void attributeListToCoverageDimensions(const TeAttributeList& attributes, std::vector<TeCoverageDimension>& dimensions);
-
-TL_DLL void createCoverageTable(TeLayer* layer, std::string& tableName);
-
-TL_DLL void insertToCoverageTable(TeLayer* layer, std::string& tableName, const unsigned int blockId, const TeBox& blockBox, const unsigned int numElements, unsigned char* data, const unsigned long dataSize);
-
-TL_DLL void createCoverageLayerTable(TeLayer* layer, std::string& tableName);
-
-TL_DLL void insertToCoverageLayerTable(TeLayer* layer, std::string& coverageLayerTableName, std::string& coverageTableName, const std::string& coverageId, TeBox& coverageBox);
-
-TL_DLL void createCoverageMetadataTable(TeLayer* layer, std::string& metadataTableName);
-
-TL_DLL void fillCoverageMetadataTable(TeLayer* layer, std::string& metadataTableName, const std::string& coverageId, std::vector<TeCoverageDimension>& dimensions);
-
-TL_DLL TeLayer* createNewCoverageLayer(TeDatabase* database, const std::string& layerName, TeProjection* projection = NULL);
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeCoverageImportUtils.h
+    \brief This file contains utility functions for importing coverages.
+*/
+#ifndef  __TERRALIB_INTERNAL_COVERAGEIMPORTUTILS_H
+#define  __TERRALIB_INTERNAL_COVERAGEIMPORTUTILS_H
+
+#include "TeCoverageParams.h"
+#include "TeCoverageUtils.h"
+
+TL_DLL void attributeListToCoverageDimensions(const TeAttributeList& attributes, std::vector<TeCoverageDimension>& dimensions);
+
+TL_DLL void createCoverageTable(TeLayer* layer, std::string& tableName);
+
+TL_DLL void insertToCoverageTable(TeLayer* layer, std::string& tableName, const unsigned int blockId, const TeBox& blockBox, const unsigned int numElements, unsigned char* data, const unsigned long dataSize);
+
+TL_DLL void createCoverageLayerTable(TeLayer* layer, std::string& tableName);
+
+TL_DLL void insertToCoverageLayerTable(TeLayer* layer, std::string& coverageLayerTableName, std::string& coverageTableName, const std::string& coverageId, TeBox& coverageBox);
+
+TL_DLL void createCoverageMetadataTable(TeLayer* layer, std::string& metadataTableName);
+
+TL_DLL void fillCoverageMetadataTable(TeLayer* layer, std::string& metadataTableName, const std::string& coverageId, std::vector<TeCoverageDimension>& dimensions);
+
+TL_DLL TeLayer* createNewCoverageLayer(TeDatabase* database, const std::string& layerName, TeProjection* projection = NULL);
+
 #endif // __TERRALIB_INTERNAL_COVERAGEIMPORTUTILS_H
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageInterpolator.h b/src/terralib/kernel/TeCoverageInterpolator.h
index fc8f1e4..1250a82 100644
--- a/src/terralib/kernel/TeCoverageInterpolator.h
+++ b/src/terralib/kernel/TeCoverageInterpolator.h
@@ -1,102 +1,102 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*!
-  \file TeCoverageInterpolator.h
-  
-  \par This file defines an interpolation method for using with 
-       Coverage representations
-*/
-#ifndef  __TERRALIB_INTERNAL_COVERAGEINTERPOLATOR_H
-#define  __TERRALIB_INTERNAL_COVERAGEINTERPOLATOR_H
-
-#include "TeCoverageDecoder.h"
-
-/*!
-  \class TeCoverageInterpolator
-  \brief Provides an interpolation method for coverages.
-
-  \par Abstract class for providing an interpolation method for generic
-       Coverages.
-  \par Assumes that the coverage decoder will be provided, for more efficient
-       access to the the coverage data.
-*/
-template <class T>
-class TeCoverageInterpolator
-{
-public:
-
-    //! Default constructor
-    TeCoverageInterpolator() :
-        decoder_(NULL)
-    {
-    }
-
-    //! Destructor
-    virtual ~TeCoverageInterpolator()
-    {
-    }
-
-    //! Set the decoder
-    /*!
-      \param decoder the coverage decoder
-    */
-    virtual void setDecoder(TeCoverageDecoder<T>* decoder)
-    {
-        decoder_ = decoder;
-    }
-
-    //! Return the decoder
-    /*!
-      \return the coverage decoder
-    */
-    virtual TeCoverageDecoder<T>* getDecoder() const
-    {
-        return decoder_;
-    }
-
-    //! Retrieve the coverage value at an arbitrary location.
-    /*!
-      \par Retrieve the coverage value at an arbitrary location, using the
-           coverage decoder to access the coverage data.
-      \param position the arbitrary location to be evaluated
-      \param the value vector, to be filled by this method
-    */
-    virtual void evaluate(const TeCoord2D& position, std::vector<double>& value) = 0;
-
-    //! Fill a region of a raster with interpolated coverage data.
-    /*!
-      \par Fill the pixels of a squared region of a raster with
-           coverage data, using an interpolation method.
-      \param raster the raster to be filled with coverage data
-      \param rasterBand the raster band to be filled
-      \param coverageDimension the coverage dimension to be evaluated
-      \param box defines the raster region to be filled
-    */
-    virtual void evaluate(TeRaster& raster, const int rasterBand, const int coverageDimension, const TeBox& box = TeBox()) = 0;
-
-protected:
-
-    TeCoverageDecoder<T>* decoder_; //!< The coverage decoder.
-};
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*!
+  \file TeCoverageInterpolator.h
+  
+  \par This file defines an interpolation method for using with 
+       Coverage representations
+*/
+#ifndef  __TERRALIB_INTERNAL_COVERAGEINTERPOLATOR_H
+#define  __TERRALIB_INTERNAL_COVERAGEINTERPOLATOR_H
+
+#include "TeCoverageDecoder.h"
+
+/*!
+  \class TeCoverageInterpolator
+  \brief Provides an interpolation method for coverages.
+
+  \par Abstract class for providing an interpolation method for generic
+       Coverages.
+  \par Assumes that the coverage decoder will be provided, for more efficient
+       access to the the coverage data.
+*/
+template <class T>
+class TeCoverageInterpolator
+{
+public:
+
+    //! Default constructor
+    TeCoverageInterpolator() :
+        decoder_(NULL)
+    {
+    }
+
+    //! Destructor
+    virtual ~TeCoverageInterpolator()
+    {
+    }
+
+    //! Set the decoder
+    /*!
+      \param decoder the coverage decoder
+    */
+    virtual void setDecoder(TeCoverageDecoder<T>* decoder)
+    {
+        decoder_ = decoder;
+    }
+
+    //! Return the decoder
+    /*!
+      \return the coverage decoder
+    */
+    virtual TeCoverageDecoder<T>* getDecoder() const
+    {
+        return decoder_;
+    }
+
+    //! Retrieve the coverage value at an arbitrary location.
+    /*!
+      \par Retrieve the coverage value at an arbitrary location, using the
+           coverage decoder to access the coverage data.
+      \param position the arbitrary location to be evaluated
+      \param the value vector, to be filled by this method
+    */
+    virtual void evaluate(const TeCoord2D& position, std::vector<double>& value) = 0;
+
+    //! Fill a region of a raster with interpolated coverage data.
+    /*!
+      \par Fill the pixels of a squared region of a raster with
+           coverage data, using an interpolation method.
+      \param raster the raster to be filled with coverage data
+      \param rasterBand the raster band to be filled
+      \param coverageDimension the coverage dimension to be evaluated
+      \param box defines the raster region to be filled
+    */
+    virtual void evaluate(TeRaster& raster, const int rasterBand, const int coverageDimension, const TeBox& box = TeBox()) = 0;
+
+protected:
+
+    TeCoverageDecoder<T>* decoder_; //!< The coverage decoder.
+};
+
 #endif // __TERRALIB_INTERNAL_COVERAGEINTERPOLATOR_H
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageInterpolatorNN.h b/src/terralib/kernel/TeCoverageInterpolatorNN.h
index 6f6f7e1..e42d8c2 100644
--- a/src/terralib/kernel/TeCoverageInterpolatorNN.h
+++ b/src/terralib/kernel/TeCoverageInterpolatorNN.h
@@ -1,256 +1,256 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*!
-  \file TeCoverageInterpolatorNN.h
-
-  \par This file defines a Nearest Neighbour interpolation method for
-       using with generic Coverage representations.
-*/
-#ifndef  __TERRALIB_INTERNAL_COVERAGEINTERPOLATORNN_H
-#define  __TERRALIB_INTERNAL_COVERAGEINTERPOLATORNN_H
-
-#include "TeCoverageInterpolator.h"
-
-/*!
-  \class TeCoverageInterpolatorNN
-  \brief Provides a Nearest Neighbour interpolation method for coverages.
-*/
-template <class T>
-class TeCoverageInterpolatorNN : public TeCoverageInterpolator<T>
-{
-public:
-
-    //! Set the decoder
-    /*!
-      \param decoder the coverage decoder
-    */
-    virtual void setDecoder(TeCoverageDecoder<T>* decoder)
-    {
-        decoder_ = decoder;
-
-        // Get global bounding box and total number of coverage elements
-        int numElements = decoder->getParameters().getNumElements();
-        TeBox& decoderBox = decoder->getParameters().getBoundingBox();
-        double boxArea = decoderBox.width() * decoderBox.height();
-
-        // Calculate the initial radius for nearest neighbour interpolation
-        // There is no need to be precise, this is just an heuristic.
-
-        // search area = total area / number of elements
-        // pi * r^2 = search area  -->  r = sqrt(search area / pi)
-        initialNeighbourhoodRadius_ = sqrt((boxArea / numElements) / 3.14159);
-    }
-
-
-    //! Retrieve the coverage value at an arbitrary location.
-    /*!
-      \par Retrieve the coverage value at an arbitrary location, using the
-           coverage decoder to access the coverage data.
-      \par This implementation looks for the generic geometry that is the
-           nearest neighbour of the position passed as parameter and returns
-           the value associated to it.
-      \param position the arbitrary location to be evaluated
-      \param the value vector, to be filled by this method
-    */
-    virtual void evaluate(const TeCoord2D& position, std::vector<double>& value)
-    {
-        TeGeomValuePair<T> nearestPoint = nearestNeighbour(position);
-        value = nearestPoint.value;
-    }
-
-    //! Fill a region of a raster with interpolated coverage data.
-    /*!
-      \par Fill the pixels of a squared region of a raster with coverage
-           data. The value of each pixel coordinate is retrieved from
-           the coverage, using an interpolation method (nearest neighbour).
-      \param raster the raster to be filled with coverage data
-      \param rasterBand the raster band to be filled
-      \param coverageDimension the coverage dimension to be evaluated
-      \param box defines the raster region to be filled
-    */
-    virtual void evaluate(TeRaster& raster, const int rasterBand, const int coverageDimension, const TeBox& box = TeBox())
-    {
-        // Setup iterators for traversing raster pixels
-        TeRaster::iterator it, end;
-        if (box == TeBox())
-        {
-            it = raster.begin();
-            end = raster.end();
-        }
-        else
-        {
-            it = raster.begin(TeMakePolygon(box), TeBBoxPixelInters, rasterBand);
-            end = raster.end(TeMakePolygon(box), TeBBoxPixelInters, rasterBand);
-        }
-        
-        while(it != end)
-        {
-            // Get raster and coverage projections
-            TeProjection* coverageProj = decoder_->getParameters().getProjection();
-            TeProjection* rasterProj = raster.projection();
-            rasterProj->setDestinationProjection(coverageProj);
-
-            // Get pixel coordinate
-            TeCoord2D coord = raster.index2Coord(
-                    TeCoord2D(it.currentColumn(), it.currentLine()));
-            
-            // Convert to the intermediate projection
-            coord = rasterProj->PC2LL(coord);
-
-            // Convert to the coverage projection
-            coord = coverageProj->LL2PC(coord);
-
-            // Find coverage value and set raster element
-            std::vector<double> value = std::vector<double>();
-            evaluate(coord, value);
-            raster.setElement(it.currentColumn(), it.currentLine(), value[coverageDimension], rasterBand);
-
-            it++;
-        }
-    }
-
-protected:
-
-    double initialNeighbourhoodRadius_; //!< The initial radius used for interpolation.
-
-    //! Find nearest generic geometry-value pair.
-    /*!
-      \par Retrieve the generic geometry value-pair that is the nearest
-           neighbour of the arbitrary location passed as parameter.
-      \par The radius parameter is used to specify the size of the
-           neighbourhood to be checked first. If no neighbours can be
-           found, the radius is increased until at least one neighbour
-           is found.
-      \param position an arbitrary location
-      \param radius the size of the neighbourhood to be checked initially.
-    */
-    virtual TeGeomValuePair<T> nearestNeighbour(const TeCoord2D& position, double radius = 0)
-    {
-        if (!decoder_)
-        {
-            std::string errorMsg = "Couldn't evaluate position in coverage. Decoder is NULL.";
-            throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-        }
-        if (!radius)
-        {
-            radius = initialNeighbourhoodRadius_;
-        }
-
-        TeBox box = TeBox(position.x_ - radius,
-                        position.y_ - radius,
-                        position.x_ + radius,
-                        position.y_ + radius);
-
-        std::vector<TeGeomValuePair<T> >& selected = std::vector<TeGeomValuePair<T> >();
-        decoder_->selectGeomValuePairs(TeMakePolygon(box), TeINTERSECTS, selected);
-
-        if (selected.size() > 0)
-        {
-            // Find nearest geometry, among the selected set
-            double minDist = TeMAXFLOAT;
-            double dist = TeMAXFLOAT;
-            std::vector<TeGeomValuePair<T> >::iterator itNearest = selected.begin();
-            for(std::vector<TeGeomValuePair<T> >::iterator it = selected.begin(); it != selected.end(); ++it)
-            {
-                dist = distanceToGeom(position, it->geom);
-                if (dist < minDist)
-                {
-                    minDist = dist;
-                    itNearest = it;
-                }
-            }
-            
-            // Check if the distance is less than the radius
-            // Otherwise, there might be a closer geometry, outside the box
-            if (minDist <= radius)
-            {
-                return (*itNearest);
-            }
-            else
-            {
-                return nearestNeighbour(position, minDist);
-            }
-        }
-        else
-        {
-            // If coudn't find any geometries, search in a larger area
-            return nearestNeighbour(position, radius * 2);
-        }
-    }
-
-    //! Evaluate distance from a position to a point
-    double distanceToGeom(const TeCoord2D& position, TePoint point)
-    {
-        return TeDistance(position, point.location());
-    }
-
-    //! Evaluate distance from a position to a line
-    double distanceToGeom(const TeCoord2D& position, TeLine2D line)
-    {
-        double minDist = TeMAXFLOAT;
-        double dist = TeMAXFLOAT;
-
-        // Evaluate the distance to the line segment-by-segment
-        for (unsigned int i = 0; i < (line.size() - 1); ++i)
-        {
-            dist = TeMinimumDistance (line[i], line[i + 1], position, TeCoord2D(), 0);
-            if (dist < minDist)
-            {
-                minDist = dist;
-            }
-        }
-        return minDist;
-    }
-
-    //! Evaluate distance from a position to a polygon
-    double distanceToGeom(const TeCoord2D& position, TePolygon poly)
-    {
-        // If the position is inside the polygon, return zero
-        if (TeWithin(position, poly))
-        {
-            return 0.0;
-        }
-
-        double minDist = TeMAXFLOAT;
-        double dist = TeMAXFLOAT;
-
-        // Evaluate the distance to each ring of the polygon segment-by-segment
-        for(TePolygon::iterator itPoly = poly.begin(); itPoly != poly.end(); ++itPoly)
-        {
-            TeLine2D line = *itPoly;
-
-            for (unsigned int i = 0; i < (line.size() - 1); ++i)
-            {
-                dist = TeMinimumDistance (line[i], line[i + 1], position, TeCoord2D(), 0);
-                if (dist < minDist)
-                {
-                    minDist = dist;
-                }
-            }
-        }
-        return minDist;
-    }
-
-};
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*!
+  \file TeCoverageInterpolatorNN.h
+
+  \par This file defines a Nearest Neighbour interpolation method for
+       using with generic Coverage representations.
+*/
+#ifndef  __TERRALIB_INTERNAL_COVERAGEINTERPOLATORNN_H
+#define  __TERRALIB_INTERNAL_COVERAGEINTERPOLATORNN_H
+
+#include "TeCoverageInterpolator.h"
+
+/*!
+  \class TeCoverageInterpolatorNN
+  \brief Provides a Nearest Neighbour interpolation method for coverages.
+*/
+template <class T>
+class TeCoverageInterpolatorNN : public TeCoverageInterpolator<T>
+{
+public:
+
+    //! Set the decoder
+    /*!
+      \param decoder the coverage decoder
+    */
+    virtual void setDecoder(TeCoverageDecoder<T>* decoder)
+    {
+        decoder_ = decoder;
+
+        // Get global bounding box and total number of coverage elements
+        int numElements = decoder->getParameters().getNumElements();
+        TeBox& decoderBox = decoder->getParameters().getBoundingBox();
+        double boxArea = decoderBox.width() * decoderBox.height();
+
+        // Calculate the initial radius for nearest neighbour interpolation
+        // There is no need to be precise, this is just an heuristic.
+
+        // search area = total area / number of elements
+        // pi * r^2 = search area  -->  r = sqrt(search area / pi)
+        initialNeighbourhoodRadius_ = sqrt((boxArea / numElements) / 3.14159);
+    }
+
+
+    //! Retrieve the coverage value at an arbitrary location.
+    /*!
+      \par Retrieve the coverage value at an arbitrary location, using the
+           coverage decoder to access the coverage data.
+      \par This implementation looks for the generic geometry that is the
+           nearest neighbour of the position passed as parameter and returns
+           the value associated to it.
+      \param position the arbitrary location to be evaluated
+      \param the value vector, to be filled by this method
+    */
+    virtual void evaluate(const TeCoord2D& position, std::vector<double>& value)
+    {
+        TeGeomValuePair<T> nearestPoint = nearestNeighbour(position);
+        value = nearestPoint.value;
+    }
+
+    //! Fill a region of a raster with interpolated coverage data.
+    /*!
+      \par Fill the pixels of a squared region of a raster with coverage
+           data. The value of each pixel coordinate is retrieved from
+           the coverage, using an interpolation method (nearest neighbour).
+      \param raster the raster to be filled with coverage data
+      \param rasterBand the raster band to be filled
+      \param coverageDimension the coverage dimension to be evaluated
+      \param box defines the raster region to be filled
+    */
+    virtual void evaluate(TeRaster& raster, const int rasterBand, const int coverageDimension, const TeBox& box = TeBox())
+    {
+        // Setup iterators for traversing raster pixels
+        TeRaster::iterator it, end;
+        if (box == TeBox())
+        {
+            it = raster.begin();
+            end = raster.end();
+        }
+        else
+        {
+            it = raster.begin(TeMakePolygon(box), TeBBoxPixelInters, rasterBand);
+            end = raster.end(TeMakePolygon(box), TeBBoxPixelInters, rasterBand);
+        }
+        
+        while(it != end)
+        {
+            // Get raster and coverage projections
+            TeProjection* coverageProj = decoder_->getParameters().getProjection();
+            TeProjection* rasterProj = raster.projection();
+            rasterProj->setDestinationProjection(coverageProj);
+
+            // Get pixel coordinate
+            TeCoord2D coord = raster.index2Coord(
+                    TeCoord2D(it.currentColumn(), it.currentLine()));
+            
+            // Convert to the intermediate projection
+            coord = rasterProj->PC2LL(coord);
+
+            // Convert to the coverage projection
+            coord = coverageProj->LL2PC(coord);
+
+            // Find coverage value and set raster element
+            std::vector<double> value = std::vector<double>();
+            evaluate(coord, value);
+            raster.setElement(it.currentColumn(), it.currentLine(), value[coverageDimension], rasterBand);
+
+            it++;
+        }
+    }
+
+protected:
+
+    double initialNeighbourhoodRadius_; //!< The initial radius used for interpolation.
+
+    //! Find nearest generic geometry-value pair.
+    /*!
+      \par Retrieve the generic geometry value-pair that is the nearest
+           neighbour of the arbitrary location passed as parameter.
+      \par The radius parameter is used to specify the size of the
+           neighbourhood to be checked first. If no neighbours can be
+           found, the radius is increased until at least one neighbour
+           is found.
+      \param position an arbitrary location
+      \param radius the size of the neighbourhood to be checked initially.
+    */
+    virtual TeGeomValuePair<T> nearestNeighbour(const TeCoord2D& position, double radius = 0)
+    {
+        if (!decoder_)
+        {
+            std::string errorMsg = "Couldn't evaluate position in coverage. Decoder is NULL.";
+            throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+        }
+        if (!radius)
+        {
+            radius = initialNeighbourhoodRadius_;
+        }
+
+        TeBox box = TeBox(position.x_ - radius,
+                        position.y_ - radius,
+                        position.x_ + radius,
+                        position.y_ + radius);
+
+        std::vector<TeGeomValuePair<T> >& selected = std::vector<TeGeomValuePair<T> >();
+        decoder_->selectGeomValuePairs(TeMakePolygon(box), TeINTERSECTS, selected);
+
+        if (selected.size() > 0)
+        {
+            // Find nearest geometry, among the selected set
+            double minDist = TeMAXFLOAT;
+            double dist = TeMAXFLOAT;
+            std::vector<TeGeomValuePair<T> >::iterator itNearest = selected.begin();
+            for(std::vector<TeGeomValuePair<T> >::iterator it = selected.begin(); it != selected.end(); ++it)
+            {
+                dist = distanceToGeom(position, it->geom);
+                if (dist < minDist)
+                {
+                    minDist = dist;
+                    itNearest = it;
+                }
+            }
+            
+            // Check if the distance is less than the radius
+            // Otherwise, there might be a closer geometry, outside the box
+            if (minDist <= radius)
+            {
+                return (*itNearest);
+            }
+            else
+            {
+                return nearestNeighbour(position, minDist);
+            }
+        }
+        else
+        {
+            // If coudn't find any geometries, search in a larger area
+            return nearestNeighbour(position, radius * 2);
+        }
+    }
+
+    //! Evaluate distance from a position to a point
+    double distanceToGeom(const TeCoord2D& position, TePoint point)
+    {
+        return TeDistance(position, point.location());
+    }
+
+    //! Evaluate distance from a position to a line
+    double distanceToGeom(const TeCoord2D& position, TeLine2D line)
+    {
+        double minDist = TeMAXFLOAT;
+        double dist = TeMAXFLOAT;
+
+        // Evaluate the distance to the line segment-by-segment
+        for (unsigned int i = 0; i < (line.size() - 1); ++i)
+        {
+            dist = TeMinimumDistance (line[i], line[i + 1], position, TeCoord2D(), 0);
+            if (dist < minDist)
+            {
+                minDist = dist;
+            }
+        }
+        return minDist;
+    }
+
+    //! Evaluate distance from a position to a polygon
+    double distanceToGeom(const TeCoord2D& position, TePolygon poly)
+    {
+        // If the position is inside the polygon, return zero
+        if (TeWithin(position, poly))
+        {
+            return 0.0;
+        }
+
+        double minDist = TeMAXFLOAT;
+        double dist = TeMAXFLOAT;
+
+        // Evaluate the distance to each ring of the polygon segment-by-segment
+        for(TePolygon::iterator itPoly = poly.begin(); itPoly != poly.end(); ++itPoly)
+        {
+            TeLine2D line = *itPoly;
+
+            for (unsigned int i = 0; i < (line.size() - 1); ++i)
+            {
+                dist = TeMinimumDistance (line[i], line[i + 1], position, TeCoord2D(), 0);
+                if (dist < minDist)
+                {
+                    minDist = dist;
+                }
+            }
+        }
+        return minDist;
+    }
+
+};
+
 #endif // __TERRALIB_INTERNAL_COVERAGEINTERPOLATORNN_H
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageParams.h b/src/terralib/kernel/TeCoverageParams.h
index fd55338..23396cd 100644
--- a/src/terralib/kernel/TeCoverageParams.h
+++ b/src/terralib/kernel/TeCoverageParams.h
@@ -1,249 +1,249 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*!
-  \file TeCoverageParams.h
-  \brief This file contains definitions about parameters of a coverage.
-*/
-#ifndef  __TERRALIB_INTERNAL_COVERAGEPARAMS_H
-#define  __TERRALIB_INTERNAL_COVERAGEPARAMS_H
-
-#include "TeDataTypes.h"
-#include "TeDatabase.h"
-
-/*!
-  \enum TeCoveragePersistenceType
-  \brief Defines the type of persistence used in the coverage.
-*/
-enum TeCoveragePersistenceType
-{	TePERSISTENCE_NONE, TePERSISTENCE_DATABASE, TePERSISTENCE_DATABASE_CACHELRU };
-
-/*!
-  \struct TeCoverageDimension
-  \brief Information about a single dimension of a coverage
-*/
-struct TL_DLL TeCoverageDimension
-{
-    int dimension_id;   //!< Dimension identifier
-    std::string name;   //!< Dimension name
-    TeDataType type;    //!< Data type of this dimension
-
-    //! Default constructor.
-    TeCoverageDimension(){}
-
-    //! Constructor with attributes.
-    TeCoverageDimension(const int& dimension_id, const std::string& name, const TeDataType& type):
-            dimension_id(dimension_id),
-            name(name),
-            type(type){}
-};
-
-/*!
-  \class TeCoverageParams
-  \brief A class to handle the parameters set associated with a coverage
-
-  \par This class is a data structure to store and manipulate a set of
-       parameters and definitions that characterizes a coverage. It contains
-       parameters relative to storaging, geographical or interpretation aspects.
-  \par Not all parameters are valid, or make sense, for all coverages. Private
-       parameters should be accessed through the methods provided.
-*/
-class TL_DLL TeCoverageParams
-{
-public:
-
-    //! Default constructor
-    TeCoverageParams () :
-      database_(NULL),
-      layerId_(-1),
-      coverageId_(""),
-      coverageTable_(""),
-      fileName_(""),
-      dimensions_(NULL),
-      projection_(NULL),
-      boundingBox_(TeBox()),
-      numElements_(-1),
-      persistenceType_(TePERSISTENCE_DATABASE_CACHELRU)
-    {
-    }
-
-    //! Constructor specifying database access
-    TeCoverageParams (TeDatabase* database, const int layerId, const std::string& coverageId = "0") :
-      database_(database),
-      layerId_(layerId),
-      coverageId_(coverageId),
-      coverageTable_(""),
-      fileName_(""),
-      dimensions_(NULL),
-      projection_(NULL),
-      boundingBox_(TeBox()),
-      numElements_(-1),
-      persistenceType_(TePERSISTENCE_DATABASE_CACHELRU)
-    {
-        
-    }
-
-    //! Copy constructor
-    TeCoverageParams(const TeCoverageParams& other);
-
-    //! Operator=
-    TeCoverageParams& operator=(const TeCoverageParams& rhs);
-
-    //! Destructor
-    virtual ~TeCoverageParams()
-    {
-    }
-
-    //! Set pointer to the database
-    void setDatabase(TeDatabase* database)
-    {
-        database_ = database;
-    }
-
-    //! Return a pointer to the database
-    TeDatabase* getDatabase() const
-    {
-        return database_;
-    }
-
-    //! Set layer identifier
-    void setLayerId(const int layerId)
-    {
-        layerId_ = layerId;
-    }
-
-    //! Return the layer identifier
-    int getLayerId() const
-    {
-        return layerId_;
-    }
-
-    //! Set coverage identifier
-    void setCoverageId(std::string& coverageId)
-    {
-        coverageId_ = coverageId;
-    }
-
-    //! Return the coverage identifier
-    std::string getCoverageId() const
-    {
-        return coverageId_;
-    }
-
-    //! Set the name of the coverage table
-    void setCoverageTable(std::string& coverageTable)
-    {
-        coverageTable_ = coverageTable;
-    }
-
-    //! Return the name of the coverage table
-    std::string getCoverageTable() const
-    {
-        return coverageTable_;
-    }
-
-    //! Set the name of the coverage source file
-    void setFileName(std::string& fileName)
-    {
-        fileName_ = fileName;
-    }
-
-    //! Return the name of the coverage source file
-    std::string getFileName() const
-    {
-        return fileName_;
-    }
-
-    //! Set information about the dimensions of a coverage
-    void setDimensions(std::vector<TeCoverageDimension>& dimensions)
-    {
-        dimensions_ = dimensions;
-    }
-
-    //! Return information about the dimensions of a coverage
-    std::vector<TeCoverageDimension> getDimensions() const
-    {
-        return dimensions_;
-    }
-
-    //! Set the projection
-    void setProjection(TeProjection* projection)
-    {
-        projection_ = projection;
-    }
-
-    //! Return the projection
-    TeProjection* getProjection() const
-    {
-        return projection_;
-    }
-
-    //! Set bounding box of a coverage
-    void setBoundingBox(TeBox& boundingBox)
-    {
-        boundingBox_ = boundingBox;
-    }
-
-    //! Return the bounding box of a coverage
-    TeBox getBoundingBox() const
-    {
-        return boundingBox_;
-    }
-
-    //! Set number of elements of a coverage
-    void setNumElements(const int numElements)
-    {
-        numElements_ = numElements;
-    }
-
-    //! Return the number of elements of a coverage
-    int getNumElements() const
-    {
-        return numElements_;
-    }
-
-    //! Set persistence type of the coverage
-    void setPersistenceType(const TeCoveragePersistenceType persistenceType)
-    {
-        persistenceType_ = persistenceType;
-    }
-
-    //! Return the persistence type of the coverage
-    TeCoveragePersistenceType getPersistenceType() const
-    {
-        return persistenceType_;
-    }
-
-protected:
-    TeDatabase* database_;          //!< Pointer to the TerraLib database
-    int layerId_;                   //!< Layer identifier
-    std::string coverageId_;        //!< Coverage identifier
-    std::string coverageTable_;     //!< Coverage table name
-    std::string fileName_;          //!< Name of a coverage source file
-    std::vector<TeCoverageDimension> dimensions_;   //!< Dimensions information
-    TeProjection* projection_;      //!< Projection used in a coverage
-    TeBox boundingBox_;             //!< Bounding box for all elements of a coverage
-    int numElements_;               //!< Number of elements of the coverage
-    TeCoveragePersistenceType persistenceType_; //!< Type of data persistence
-};
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*!
+  \file TeCoverageParams.h
+  \brief This file contains definitions about parameters of a coverage.
+*/
+#ifndef  __TERRALIB_INTERNAL_COVERAGEPARAMS_H
+#define  __TERRALIB_INTERNAL_COVERAGEPARAMS_H
+
+#include "TeDataTypes.h"
+#include "TeDatabase.h"
+
+/*!
+  \enum TeCoveragePersistenceType
+  \brief Defines the type of persistence used in the coverage.
+*/
+enum TeCoveragePersistenceType
+{	TePERSISTENCE_NONE, TePERSISTENCE_DATABASE, TePERSISTENCE_DATABASE_CACHELRU };
+
+/*!
+  \struct TeCoverageDimension
+  \brief Information about a single dimension of a coverage
+*/
+struct TL_DLL TeCoverageDimension
+{
+    int dimension_id;   //!< Dimension identifier
+    std::string name;   //!< Dimension name
+    TeDataType type;    //!< Data type of this dimension
+
+    //! Default constructor.
+    TeCoverageDimension(){}
+
+    //! Constructor with attributes.
+    TeCoverageDimension(const int& dimension_id, const std::string& name, const TeDataType& type):
+            dimension_id(dimension_id),
+            name(name),
+            type(type){}
+};
+
+/*!
+  \class TeCoverageParams
+  \brief A class to handle the parameters set associated with a coverage
+
+  \par This class is a data structure to store and manipulate a set of
+       parameters and definitions that characterizes a coverage. It contains
+       parameters relative to storaging, geographical or interpretation aspects.
+  \par Not all parameters are valid, or make sense, for all coverages. Private
+       parameters should be accessed through the methods provided.
+*/
+class TL_DLL TeCoverageParams
+{
+public:
+
+    //! Default constructor
+    TeCoverageParams () :
+      database_(NULL),
+      layerId_(-1),
+      coverageId_(""),
+      coverageTable_(""),
+      fileName_(""),
+      dimensions_(NULL),
+      projection_(NULL),
+      boundingBox_(TeBox()),
+      numElements_(-1),
+      persistenceType_(TePERSISTENCE_DATABASE_CACHELRU)
+    {
+    }
+
+    //! Constructor specifying database access
+    TeCoverageParams (TeDatabase* database, const int layerId, const std::string& coverageId = "0") :
+      database_(database),
+      layerId_(layerId),
+      coverageId_(coverageId),
+      coverageTable_(""),
+      fileName_(""),
+      dimensions_(NULL),
+      projection_(NULL),
+      boundingBox_(TeBox()),
+      numElements_(-1),
+      persistenceType_(TePERSISTENCE_DATABASE_CACHELRU)
+    {
+        
+    }
+
+    //! Copy constructor
+    TeCoverageParams(const TeCoverageParams& other);
+
+    //! Operator=
+    TeCoverageParams& operator=(const TeCoverageParams& rhs);
+
+    //! Destructor
+    virtual ~TeCoverageParams()
+    {
+    }
+
+    //! Set pointer to the database
+    void setDatabase(TeDatabase* database)
+    {
+        database_ = database;
+    }
+
+    //! Return a pointer to the database
+    TeDatabase* getDatabase() const
+    {
+        return database_;
+    }
+
+    //! Set layer identifier
+    void setLayerId(const int layerId)
+    {
+        layerId_ = layerId;
+    }
+
+    //! Return the layer identifier
+    int getLayerId() const
+    {
+        return layerId_;
+    }
+
+    //! Set coverage identifier
+    void setCoverageId(std::string& coverageId)
+    {
+        coverageId_ = coverageId;
+    }
+
+    //! Return the coverage identifier
+    std::string getCoverageId() const
+    {
+        return coverageId_;
+    }
+
+    //! Set the name of the coverage table
+    void setCoverageTable(std::string& coverageTable)
+    {
+        coverageTable_ = coverageTable;
+    }
+
+    //! Return the name of the coverage table
+    std::string getCoverageTable() const
+    {
+        return coverageTable_;
+    }
+
+    //! Set the name of the coverage source file
+    void setFileName(std::string& fileName)
+    {
+        fileName_ = fileName;
+    }
+
+    //! Return the name of the coverage source file
+    std::string getFileName() const
+    {
+        return fileName_;
+    }
+
+    //! Set information about the dimensions of a coverage
+    void setDimensions(std::vector<TeCoverageDimension>& dimensions)
+    {
+        dimensions_ = dimensions;
+    }
+
+    //! Return information about the dimensions of a coverage
+    std::vector<TeCoverageDimension> getDimensions() const
+    {
+        return dimensions_;
+    }
+
+    //! Set the projection
+    void setProjection(TeProjection* projection)
+    {
+        projection_ = projection;
+    }
+
+    //! Return the projection
+    TeProjection* getProjection() const
+    {
+        return projection_;
+    }
+
+    //! Set bounding box of a coverage
+    void setBoundingBox(TeBox& boundingBox)
+    {
+        boundingBox_ = boundingBox;
+    }
+
+    //! Return the bounding box of a coverage
+    TeBox getBoundingBox() const
+    {
+        return boundingBox_;
+    }
+
+    //! Set number of elements of a coverage
+    void setNumElements(const int numElements)
+    {
+        numElements_ = numElements;
+    }
+
+    //! Return the number of elements of a coverage
+    int getNumElements() const
+    {
+        return numElements_;
+    }
+
+    //! Set persistence type of the coverage
+    void setPersistenceType(const TeCoveragePersistenceType persistenceType)
+    {
+        persistenceType_ = persistenceType;
+    }
+
+    //! Return the persistence type of the coverage
+    TeCoveragePersistenceType getPersistenceType() const
+    {
+        return persistenceType_;
+    }
+
+protected:
+    TeDatabase* database_;          //!< Pointer to the TerraLib database
+    int layerId_;                   //!< Layer identifier
+    std::string coverageId_;        //!< Coverage identifier
+    std::string coverageTable_;     //!< Coverage table name
+    std::string fileName_;          //!< Name of a coverage source file
+    std::vector<TeCoverageDimension> dimensions_;   //!< Dimensions information
+    TeProjection* projection_;      //!< Projection used in a coverage
+    TeBox boundingBox_;             //!< Bounding box for all elements of a coverage
+    int numElements_;               //!< Number of elements of the coverage
+    TeCoveragePersistenceType persistenceType_; //!< Type of data persistence
+};
+
 #endif // __TERRALIB_INTERNAL_COVERAGEPARAMS_H
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageUtils.cpp b/src/terralib/kernel/TeCoverageUtils.cpp
index d961fbc..e5e20b5 100644
--- a/src/terralib/kernel/TeCoverageUtils.cpp
+++ b/src/terralib/kernel/TeCoverageUtils.cpp
@@ -1,293 +1,293 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*
-** ----------------------------------------------------------------------------
-** Includes:
-*/
-
-#include "TeCoverageUtils.h"
-
-/*
-** ----------------------------------------------------------------------------
-** Definitions:
-*/
-
-/*
-** ----------------------------------------------------------------------------
-** Methods Implementation:
-*/
-
-std::string
-TeDefaultCoverageLayerTable(TeLayer* layer)
-{
-    return "Coverage_" + Te2String(layer->id());
-}
-
-std::string
-TeDefaultCoverageTable(TeLayer* layer, const std::string& coverageId)
-{
-    return TeDefaultCoverageLayerTable(layer) + "_" + coverageId;
-}
-
-std::string
-TeDefaultCoverageMetadataTable(TeLayer* layer)
-{
-    return TeDefaultCoverageLayerTable(layer) + "_metadata";
-}
-
-void
-TeRetrieveCoverageLayerTables(TeLayer* layer, std::vector<std::string>& coverageLayerTables)
-{
-    coverageLayerTables.clear();
-
-    // Get coverage layer tables
-    TeRepresPointerVector representations;
-    layer->getRepresentation(TeCOVERAGE, representations);
-    for (TeRepresPointerVector::iterator it = representations.begin(); it != representations.end(); it++)
-    {
-        coverageLayerTables.push_back((*it)->tableName_);
-    }
-}
-
-void
-TeRetrieveCoverageIds(TeLayer* layer, std::vector<std::string>& coverageIds)
-{
-    coverageIds.clear();
-
-    // Get coverage layer table
-    std::vector<std::string> coverageLayerTables;
-    TeRetrieveCoverageLayerTables(layer, coverageLayerTables);
-
-    for (std::vector<std::string>::iterator it = coverageLayerTables.begin(); it != coverageLayerTables.end(); it++)
-    {
-        // Find coverage IDs
-        TeDatabasePortal* portal = layer->database()->getPortal();
-        portal->query("SELECT coverage_id FROM " + (*it));
-        while (portal->fetchRow())
-        {
-            coverageIds.push_back(portal->getData("coverage_id"));
-        }
-        portal->freeResult();
-    }
-}
-
-std::string
-TeRetrieveCoverageTable(TeLayer* layer, const std::string& coverageId)
-{
-    std::string coverageTable = "";
-    
-    // Get coverage layer table
-    std::vector<std::string> coverageLayerTables;
-    TeRetrieveCoverageLayerTables(layer, coverageLayerTables);
-
-    for (std::vector<std::string>::iterator it = coverageLayerTables.begin(); it != coverageLayerTables.end(); it++)
-    {
-        // Find coverage IDs
-        TeDatabasePortal* portal = layer->database()->getPortal();
-        portal->query("SELECT coverage_table FROM " + (*it) + " WHERE coverage_id = '" + coverageId + "'");
-        if (portal->fetchRow())
-        {
-            coverageTable = portal->getData("coverage_table");
-            portal->freeResult();
-            break;
-        }
-        portal->freeResult();
-    }
-    if (coverageTable.empty())
-    {
-        std::string errorMsg = "Couldn't find coverage " + coverageId + " on layer " + Te2String(layer->id()) + ".";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-    return coverageTable;
-}
-
-std::string
-TeRetrieveCoverageLayerTable(TeLayer* layer, const std::string& coverageId)
-{
-    std::string coverageLayerTable = "";
-    
-    // Get coverage layer tables associated to this layer
-    std::vector<std::string> coverageLayerTables;
-    TeRetrieveCoverageLayerTables(layer, coverageLayerTables);
-
-    // Find the coverage layer table to which this coverage ID belongs
-    for (std::vector<std::string>::iterator it = coverageLayerTables.begin(); it != coverageLayerTables.end(); it++)
-    {
-        // Look for coverage ID
-        TeDatabasePortal* portal = layer->database()->getPortal();
-        portal->query("SELECT coverage_id FROM " + (*it) + " WHERE coverage_id = '" + coverageId + "'");
-        if (portal->fetchRow())
-        {
-            coverageLayerTable = (*it);
-            portal->freeResult();
-            break;
-        }
-        portal->freeResult();
-    }
-    if (coverageLayerTable.empty())
-    {
-        std::string errorMsg = "Couldn't find coverage " + coverageId + " on layer " + Te2String(layer->id()) + ".";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-    return coverageLayerTable;
-}
-
-TeLayer*
-TeRetrieveLayer(TeDatabase* database, const int layerId)
-{
-	TeLayerMap& layerMap = database->layerMap();
-    TeLayerMap::iterator match = layerMap.find(layerId);
-    if (match == layerMap.end())
-    {
-        std::string errorMsg = "Layer " + Te2String(layerId) + " not found in database.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-    return match->second;
-}
-
-void
-TeRetrieveDimensions(TeLayer* layer, const std::string& coverageId, std::vector<TeCoverageDimension>& dimensions)
-{
-    dimensions.clear();
-
-    TeRepresentation* rep = layer->getRepresentation(TeCOVERAGE);
-    std::string metadataTable = rep->tableName_ + "_metadata";
-
-    TeDatabasePortal* portal = layer->database()->getPortal();
-
-    std::string sql = "SELECT * FROM " + metadataTable + " WHERE coverage_id = '" + coverageId + "'";
-    if (portal->query(sql))
-    {
-        while (portal->fetchRow())
-        {
-            int dimensionId = portal->getInt("dimension_id");
-            int dataType = portal->getInt("data_type");
-            std::string name = portal->getData("name");
-
-            TeCoverageDimension dimension = TeCoverageDimension(dimensionId, name, static_cast<TeDataType>(dataType));
-            dimensions.push_back(dimension);
-        }
-    }
-    else
-    {
-        std::string errorMsg = "Couldn't retrieve dimensions for coverage " + coverageId + " on layer " + Te2String(layer->id()) + ".";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-}
-
-int
-TeCoverageDimensionsSize(std::vector<TeCoverageDimension>& dimensions)
-{
-    int dimensionsSize = 0;
-
-    std::vector<TeCoverageDimension>::iterator it = dimensions.begin();
-    std::vector<TeCoverageDimension>::iterator end = dimensions.end();
-
-    while (it != end)
-    {
-        switch (it->type)
-        {
-        case (TeUNSIGNEDSHORT):
-            dimensionsSize += sizeof(unsigned short);
-            break;
-        case (TeSHORT):
-            dimensionsSize += sizeof(short);
-            break;
-        case (TeINTEGER):
-            dimensionsSize += sizeof(int);
-            break;                
-        case (TeUNSIGNEDLONG):
-            dimensionsSize += sizeof(unsigned long);
-            break;
-        case (TeLONG):
-            dimensionsSize += sizeof(long);
-            break;
-        case (TeFLOAT):
-            dimensionsSize += sizeof(float);
-            break;
-        case (TeDOUBLE):
-            dimensionsSize += sizeof(double);
-            break;
-        default:
-            std::string errorMsg = "Illegal type found on dimensions vector.";
-            throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-            break;
-        }
-        it++;
-    }
-    return dimensionsSize;
-}
-
-TeBox
-TeRetrieveCoverageBox(TeLayer* layer, const std::string& coverageId)
-{
-    TeBox box;
-
-    std::string coverageTable = TeRetrieveCoverageLayerTable(layer, coverageId);
-
-    std::string sql = "SELECT * FROM " + coverageTable + " WHERE coverage_id = '" + coverageId + "'";
-
-    TeDatabasePortal* portal = layer->database()->getPortal();
-    if (portal->query(sql) && portal->fetchRow())
-    {
-        box = TeBox(portal->getDouble("lower_x"),
-                    portal->getDouble("lower_y"),
-                    portal->getDouble("upper_x"),
-                    portal->getDouble("upper_y"));
-    }
-    else
-    {
-        std::string errorMsg = "Couldn't retrieve box for coverage " + coverageId + " on layer " + Te2String(layer->id()) + ".";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-    return box;
-}
-
-int
-TeRetrieveCoverageNumElements(TeLayer* layer, const std::string& coverageId)
-{
-    int numElements = -1;
-    std::string coverageTable = TeRetrieveCoverageTable(layer, coverageId);
-
-    // Sum number of elements of all blocks
-    std::string sql = "SELECT SUM(num_elements) as sum_num_elements FROM " + coverageTable;
-
-    TeDatabasePortal* portal = layer->database()->getPortal();
-    if (portal->query(sql) && portal->fetchRow())
-    {
-        numElements = portal->getInt("sum_num_elements");
-    }
-    else
-    {
-        std::string errorMsg = "Couldn't retrieve number of elements for coverage " + coverageId + " on layer " + Te2String(layer->id()) + ".";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-    portal->freeResult();
-    return numElements;
-}
-
-/*
-** ----------------------------------------------------------------------------
-** End:
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*
+** ----------------------------------------------------------------------------
+** Includes:
+*/
+
+#include "TeCoverageUtils.h"
+
+/*
+** ----------------------------------------------------------------------------
+** Definitions:
+*/
+
+/*
+** ----------------------------------------------------------------------------
+** Methods Implementation:
+*/
+
+std::string
+TeDefaultCoverageLayerTable(TeLayer* layer)
+{
+    return "Coverage_" + Te2String(layer->id());
+}
+
+std::string
+TeDefaultCoverageTable(TeLayer* layer, const std::string& coverageId)
+{
+    return TeDefaultCoverageLayerTable(layer) + "_" + coverageId;
+}
+
+std::string
+TeDefaultCoverageMetadataTable(TeLayer* layer)
+{
+    return TeDefaultCoverageLayerTable(layer) + "_metadata";
+}
+
+void
+TeRetrieveCoverageLayerTables(TeLayer* layer, std::vector<std::string>& coverageLayerTables)
+{
+    coverageLayerTables.clear();
+
+    // Get coverage layer tables
+    TeRepresPointerVector representations;
+    layer->getRepresentation(TeCOVERAGE, representations);
+    for (TeRepresPointerVector::iterator it = representations.begin(); it != representations.end(); it++)
+    {
+        coverageLayerTables.push_back((*it)->tableName_);
+    }
+}
+
+void
+TeRetrieveCoverageIds(TeLayer* layer, std::vector<std::string>& coverageIds)
+{
+    coverageIds.clear();
+
+    // Get coverage layer table
+    std::vector<std::string> coverageLayerTables;
+    TeRetrieveCoverageLayerTables(layer, coverageLayerTables);
+
+    for (std::vector<std::string>::iterator it = coverageLayerTables.begin(); it != coverageLayerTables.end(); it++)
+    {
+        // Find coverage IDs
+        TeDatabasePortal* portal = layer->database()->getPortal();
+        portal->query("SELECT coverage_id FROM " + (*it));
+        while (portal->fetchRow())
+        {
+            coverageIds.push_back(portal->getData("coverage_id"));
+        }
+        portal->freeResult();
+    }
+}
+
+std::string
+TeRetrieveCoverageTable(TeLayer* layer, const std::string& coverageId)
+{
+    std::string coverageTable = "";
+    
+    // Get coverage layer table
+    std::vector<std::string> coverageLayerTables;
+    TeRetrieveCoverageLayerTables(layer, coverageLayerTables);
+
+    for (std::vector<std::string>::iterator it = coverageLayerTables.begin(); it != coverageLayerTables.end(); it++)
+    {
+        // Find coverage IDs
+        TeDatabasePortal* portal = layer->database()->getPortal();
+        portal->query("SELECT coverage_table FROM " + (*it) + " WHERE coverage_id = '" + coverageId + "'");
+        if (portal->fetchRow())
+        {
+            coverageTable = portal->getData("coverage_table");
+            portal->freeResult();
+            break;
+        }
+        portal->freeResult();
+    }
+    if (coverageTable.empty())
+    {
+        std::string errorMsg = "Couldn't find coverage " + coverageId + " on layer " + Te2String(layer->id()) + ".";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+    return coverageTable;
+}
+
+std::string
+TeRetrieveCoverageLayerTable(TeLayer* layer, const std::string& coverageId)
+{
+    std::string coverageLayerTable = "";
+    
+    // Get coverage layer tables associated to this layer
+    std::vector<std::string> coverageLayerTables;
+    TeRetrieveCoverageLayerTables(layer, coverageLayerTables);
+
+    // Find the coverage layer table to which this coverage ID belongs
+    for (std::vector<std::string>::iterator it = coverageLayerTables.begin(); it != coverageLayerTables.end(); it++)
+    {
+        // Look for coverage ID
+        TeDatabasePortal* portal = layer->database()->getPortal();
+        portal->query("SELECT coverage_id FROM " + (*it) + " WHERE coverage_id = '" + coverageId + "'");
+        if (portal->fetchRow())
+        {
+            coverageLayerTable = (*it);
+            portal->freeResult();
+            break;
+        }
+        portal->freeResult();
+    }
+    if (coverageLayerTable.empty())
+    {
+        std::string errorMsg = "Couldn't find coverage " + coverageId + " on layer " + Te2String(layer->id()) + ".";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+    return coverageLayerTable;
+}
+
+TeLayer*
+TeRetrieveLayer(TeDatabase* database, const int layerId)
+{
+	TeLayerMap& layerMap = database->layerMap();
+    TeLayerMap::iterator match = layerMap.find(layerId);
+    if (match == layerMap.end())
+    {
+        std::string errorMsg = "Layer " + Te2String(layerId) + " not found in database.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+    return match->second;
+}
+
+void
+TeRetrieveDimensions(TeLayer* layer, const std::string& coverageId, std::vector<TeCoverageDimension>& dimensions)
+{
+    dimensions.clear();
+
+    TeRepresentation* rep = layer->getRepresentation(TeCOVERAGE);
+    std::string metadataTable = rep->tableName_ + "_metadata";
+
+    TeDatabasePortal* portal = layer->database()->getPortal();
+
+    std::string sql = "SELECT * FROM " + metadataTable + " WHERE coverage_id = '" + coverageId + "'";
+    if (portal->query(sql))
+    {
+        while (portal->fetchRow())
+        {
+            int dimensionId = portal->getInt("dimension_id");
+            int dataType = portal->getInt("data_type");
+            std::string name = portal->getData("name");
+
+            TeCoverageDimension dimension = TeCoverageDimension(dimensionId, name, static_cast<TeDataType>(dataType));
+            dimensions.push_back(dimension);
+        }
+    }
+    else
+    {
+        std::string errorMsg = "Couldn't retrieve dimensions for coverage " + coverageId + " on layer " + Te2String(layer->id()) + ".";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+}
+
+int
+TeCoverageDimensionsSize(std::vector<TeCoverageDimension>& dimensions)
+{
+    int dimensionsSize = 0;
+
+    std::vector<TeCoverageDimension>::iterator it = dimensions.begin();
+    std::vector<TeCoverageDimension>::iterator end = dimensions.end();
+
+    while (it != end)
+    {
+        switch (it->type)
+        {
+        case (TeUNSIGNEDSHORT):
+            dimensionsSize += sizeof(unsigned short);
+            break;
+        case (TeSHORT):
+            dimensionsSize += sizeof(short);
+            break;
+        case (TeINTEGER):
+            dimensionsSize += sizeof(int);
+            break;                
+        case (TeUNSIGNEDLONG):
+            dimensionsSize += sizeof(unsigned long);
+            break;
+        case (TeLONG):
+            dimensionsSize += sizeof(long);
+            break;
+        case (TeFLOAT):
+            dimensionsSize += sizeof(float);
+            break;
+        case (TeDOUBLE):
+            dimensionsSize += sizeof(double);
+            break;
+        default:
+            std::string errorMsg = "Illegal type found on dimensions vector.";
+            throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+            break;
+        }
+        it++;
+    }
+    return dimensionsSize;
+}
+
+TeBox
+TeRetrieveCoverageBox(TeLayer* layer, const std::string& coverageId)
+{
+    TeBox box;
+
+    std::string coverageTable = TeRetrieveCoverageLayerTable(layer, coverageId);
+
+    std::string sql = "SELECT * FROM " + coverageTable + " WHERE coverage_id = '" + coverageId + "'";
+
+    TeDatabasePortal* portal = layer->database()->getPortal();
+    if (portal->query(sql) && portal->fetchRow())
+    {
+        box = TeBox(portal->getDouble("lower_x"),
+                    portal->getDouble("lower_y"),
+                    portal->getDouble("upper_x"),
+                    portal->getDouble("upper_y"));
+    }
+    else
+    {
+        std::string errorMsg = "Couldn't retrieve box for coverage " + coverageId + " on layer " + Te2String(layer->id()) + ".";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+    return box;
+}
+
+int
+TeRetrieveCoverageNumElements(TeLayer* layer, const std::string& coverageId)
+{
+    int numElements = -1;
+    std::string coverageTable = TeRetrieveCoverageTable(layer, coverageId);
+
+    // Sum number of elements of all blocks
+    std::string sql = "SELECT SUM(num_elements) as sum_num_elements FROM " + coverageTable;
+
+    TeDatabasePortal* portal = layer->database()->getPortal();
+    if (portal->query(sql) && portal->fetchRow())
+    {
+        numElements = portal->getInt("sum_num_elements");
+    }
+    else
+    {
+        std::string errorMsg = "Couldn't retrieve number of elements for coverage " + coverageId + " on layer " + Te2String(layer->id()) + ".";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+    portal->freeResult();
+    return numElements;
+}
+
+/*
+** ----------------------------------------------------------------------------
+** End:
 */
\ No newline at end of file
diff --git a/src/terralib/kernel/TeCoverageUtils.h b/src/terralib/kernel/TeCoverageUtils.h
index d73da8e..bc0a295 100644
--- a/src/terralib/kernel/TeCoverageUtils.h
+++ b/src/terralib/kernel/TeCoverageUtils.h
@@ -1,56 +1,56 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeCoverageUtils.h
-    \brief This file contains utility functions for working with coverages.
-*/
-#ifndef  __TERRALIB_INTERNAL_COVERAGEUTILS_H
-#define  __TERRALIB_INTERNAL_COVERAGEUTILS_H
-
-#include "TeCoverageParams.h"
-#include "TeException.h"
-
-TL_DLL std::string TeDefaultCoverageLayerTable(TeLayer* layer);
-
-TL_DLL std::string TeDefaultCoverageTable(TeLayer* layer, const std::string& coverageId);
-
-TL_DLL std::string TeDefaultCoverageMetadataTable(TeLayer* layer);
-
-TL_DLL void TeRetrieveCoverageLayerTables(TeLayer* layer, std::vector<std::string>& coverageLayerTables);
-
-TL_DLL void TeRetrieveCoverageIds(TeLayer* layer, std::vector<std::string>& coverageIds);
-
-TL_DLL std::string TeRetrieveCoverageTable(TeLayer* layer, const std::string& coverageId);
-
-TL_DLL std::string TeRetrieveCoverageLayerTable(TeLayer* layer, const std::string& coverageId);
-
-TL_DLL TeLayer* TeRetrieveLayer(TeDatabase* database, const int layerId);
-
-TL_DLL void TeRetrieveDimensions(TeLayer* layer, const std::string& coverageId, std::vector<TeCoverageDimension>& dimensions);
-
-TL_DLL int TeCoverageDimensionsSize(std::vector<TeCoverageDimension>& dimensions);
-
-TL_DLL TeBox TeRetrieveCoverageBox(TeLayer* layer, const std::string& coverageId);
-
-TL_DLL int TeRetrieveCoverageNumElements(TeLayer* layer, const std::string& coverageId);
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeCoverageUtils.h
+    \brief This file contains utility functions for working with coverages.
+*/
+#ifndef  __TERRALIB_INTERNAL_COVERAGEUTILS_H
+#define  __TERRALIB_INTERNAL_COVERAGEUTILS_H
+
+#include "TeCoverageParams.h"
+#include "TeException.h"
+
+TL_DLL std::string TeDefaultCoverageLayerTable(TeLayer* layer);
+
+TL_DLL std::string TeDefaultCoverageTable(TeLayer* layer, const std::string& coverageId);
+
+TL_DLL std::string TeDefaultCoverageMetadataTable(TeLayer* layer);
+
+TL_DLL void TeRetrieveCoverageLayerTables(TeLayer* layer, std::vector<std::string>& coverageLayerTables);
+
+TL_DLL void TeRetrieveCoverageIds(TeLayer* layer, std::vector<std::string>& coverageIds);
+
+TL_DLL std::string TeRetrieveCoverageTable(TeLayer* layer, const std::string& coverageId);
+
+TL_DLL std::string TeRetrieveCoverageLayerTable(TeLayer* layer, const std::string& coverageId);
+
+TL_DLL TeLayer* TeRetrieveLayer(TeDatabase* database, const int layerId);
+
+TL_DLL void TeRetrieveDimensions(TeLayer* layer, const std::string& coverageId, std::vector<TeCoverageDimension>& dimensions);
+
+TL_DLL int TeCoverageDimensionsSize(std::vector<TeCoverageDimension>& dimensions);
+
+TL_DLL TeBox TeRetrieveCoverageBox(TeLayer* layer, const std::string& coverageId);
+
+TL_DLL int TeRetrieveCoverageNumElements(TeLayer* layer, const std::string& coverageId);
+
 #endif // __TERRALIB_INTERNAL_COVERAGEUTILS_H
\ No newline at end of file
diff --git a/src/terralib/kernel/TeDBConnectionsPool.cpp b/src/terralib/kernel/TeDBConnectionsPool.cpp
index ef98936..cf95df9 100644
--- a/src/terralib/kernel/TeDBConnectionsPool.cpp
+++ b/src/terralib/kernel/TeDBConnectionsPool.cpp
@@ -1,524 +1,527 @@
-//STL include files
-#include <string>
-
-//TerraLib include files
-#include <TeDatabase.h>
-#include <TeDatabaseFactory.h>
-#include <TeDBConnectionsPool.h>
-
-TeDBConnectionsPool::~TeDBConnectionsPool()
-{
-	clear();
-}
-
-TeDatabase* TeDBConnectionsPool::getDatabase(std::string& dbmsName, 
-											 std::string& dbName, 
-											 std::string& host, std::string& user, 
-											 std::string& passwd, int& portNumber)
-{
-	verifyDbParams(dbmsName, dbName, host, user, passwd, portNumber);
-
-	TeDatabaseFactoryParams params = asFactoryParams(dbmsName, dbName, host, user, passwd, portNumber);
-
-    TeDatabase* db = NULL;
-
-	std::map<std::string, int>::iterator conIt = _dbConns.find(getDbKey(params));
-
-	db = (conIt == _dbConns.end()) ?
-		TeDatabaseFactory::make(params) :
-		getDatabase(conIt->second); 
-
-    return db;
-}
-
-TeDatabase* TeDBConnectionsPool::getDatabase(const int& dbIdx)
-{
-    TeDatabase* db = NULL;
-
-    std::map<int, TeDatabase*>::iterator dbIt = _dbs.find(dbIdx);
-
-    if(dbIt != _dbs.end())
-    {
-        db = dbIt->second;
-    }
-
-	if((db != NULL) && (!db->isConnected()))
-	{
-		if(!db->connect(db->host(), db->user(), db->password(), db->databaseName(), 
-			db->portNumber()))
-		{
-			removeDatabase(dbIdx);
-			db = NULL;
-		}
-	}
-
-    return db;
-}
-
-int TeDBConnectionsPool::getDatabaseIdx(TeDatabase* db)
-{
-    int res = -1;
-
-	std::map<std::string, int>::iterator conIt = _dbConns.find(
-		getDbKey(asFactoryParams(db->dbmsName(), db->databaseName(), db->host(), db->user(),
-		db->password(), db->portNumber())));
-
-    if(conIt != _dbConns.end())
-    {
-        res = conIt->second;
-    }
-
-    return res;
-}
-
-void TeDBConnectionsPool::removeDatabase(const int& dbId)
-{
-    std::map<int, TeDatabase*>::iterator dbIt = _dbs.find(dbId);
-
-    if(dbIt == _dbs.end())
-    {
-        throw;
-    }
-
-    TeDatabase* db = dbIt->second;
-
-    std::string dbKey = getDbKey(asFactoryParams(db->dbmsName(), db->databaseName(), db->host(), 
-        db->user(), db->password(), db->portNumber()));
-
-    std::map<std::string, int>::iterator conIt = _dbConns.find(dbKey);
-
-    if(conIt == _dbConns.end())
-    {
-        throw;
-    }
-
-    _dbs.erase(dbIt);
-    _dbConns.erase(conIt);
-
-    if(db->isConnected())
-    {
-        db->clear();
-        db->close();
-    }
-
-    delete db;
-}
-//
-void TeDBConnectionsPool::clear()
-{
-	std::map<int, TeDatabase*>::iterator it;
-
-	for(it = _dbs.begin(); it != _dbs.end(); ++it)
-	{
-        if(it->second->isConnected())
-        {
-            it->second->clear();
-            it->second->close();
-        }
-        
-        delete it->second;
-	}
-
-	_dbs.clear();
-	_dbConns.clear();
-}
-
-void TeDBConnectionsPool::saveExternalDBConnection(TeDatabase* mainDb, 
-												   TeDatabase* externalDb)
-{
-    std::string host = (externalDb->host().empty()) ? "host_name IS NULL" : 
-                                                      "host_name = '" + externalDb->host() + "'";
-    std::string user = (externalDb->user().empty()) ? "user_name IS NULL" : 
-                                                      "user_name = '" + externalDb->user() + "'";
-    std::string passwd = (externalDb->password().empty()) ? "user_password IS NULL" : 
-                                                        "user_password = '" + externalDb->password() + "'";
-
-    std::string selClause = "SELECT * FROM te_database_connection ";
-    std::string whereClause = "WHERE dbms_name = '" + 
-        externalDb->dbmsName() + "' AND " + host + " AND database_name = '" +
-        externalDb->databaseName() + "' AND " + user + " AND " + passwd + " AND port_number = " + 
-        Te2String(externalDb->portNumber());
-
-	TeDatabasePortal* portal = mainDb->getPortal();
-
-	if(!portal)
-    {
-        std::string errorMsg = "Fail getting database portal.";
-
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-	if(!portal->query(selClause + whereClause))
-	{
-		portal->freeResult();
-		delete portal;
-
-        std::string errorMsg = "Fail on external connections SQL.";
-
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-	if(portal->fetchRow())
-    {
-        if(getDatabaseIdx(externalDb) == -1)
-        {
-            int id = portal->getInt("connection_id");
-            insertDatabase(externalDb, id);
-        }
-
-	    portal->freeResult();
-	    delete portal;
-        return;
-    }
-
-	portal->freeResult();
-
-	std::string strSQL = "";
-
-    strSQL  = "INSERT INTO te_database_connection(dbms_name, host_name, database_name, ";
-    strSQL += "user_name, user_password, port_number) ";
-    strSQL += "VALUES ('" + externalDb->dbmsName();
-    strSQL += "', ";
-    strSQL += externalDb->host().empty() ? "NULL" : "'" + externalDb->host() + "'";
-    strSQL += ", '" + externalDb->databaseName();
-    strSQL += "', ";
-    strSQL += externalDb->user().empty() ? "NULL" : "'" + externalDb->user() + "'"; 
-    strSQL += ", ";
-    strSQL += externalDb->password().empty() ? "NULL" : "'" + externalDb->password() + "'";
-    strSQL += ", " + Te2String(externalDb->portNumber());
-    strSQL += ")";
-
-    if(!mainDb->execute(strSQL))
-    {
-        std::string errorMsg = "Fail on inserting external connection on database connections table.";
-
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-	selClause = "SELECT connection_id FROM te_database_connection ";
-
-	if(!portal->query(selClause + whereClause))
-	{
-		portal->freeResult();
-		delete portal;
-
-        std::string errorMsg = "Fail on external connections SQL.";
-
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-
-	if(!portal->fetchRow())
-    {
-        std::string errorMsg = "Fail on saving external database connection.";
-
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-
-		portal->freeResult();
-	    delete portal;
-        return;
-    }
-
-	int dbId = portal->getInt(0);
-
-	portal->freeResult();
-    delete portal;
-
-    insertDatabase(externalDb, dbId);
-}
-
-void TeDBConnectionsPool::loadExternalDBConnections(TeDatabase* mainDb)
-{
-	TeDatabasePortal* portal = mainDb->getPortal();
-
-	if(portal == NULL)
-	{
-        std::string errorMsg = "Fail getting database portal.";
-
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-	}
-
-	if(!mainDb->tableExist("te_database_connection"))
-	{
-		return;
-	}
-
-	std::string sql = "SELECT * FROM te_database_connection ORDER BY connection_id";
-
-	if(!portal->query(sql))
-	{
-		portal->freeResult();
-		delete portal;
-
-        return;
-	}
-
-    bool flag = portal->fetchRow();
-    
-    while(flag)
-    {
-	    std::string host(portal->getData("host_name")),
-				    dbName(portal->getData("database_name")),
-				    user(portal->getData("user_name")),
-				    dbmsName(portal->getData("dbms_name")),
-				    passwd(portal->getData("user_password"));
-	    int portNumber = portal->getInt("port_number");
-        int dbId = portal->getInt("connection_id");
-
-		TeDatabase* database = getDatabase(dbmsName, dbName, host, user, passwd, portNumber);
-		if(database != NULL)
-		{
-			insertDatabase(database, dbId);
-		}
-
-        flag = portal->fetchRow();
-    }
-
-	if(portal != NULL)
-	{
-		portal->freeResult();
-		delete portal;
-	}
-}
-
-std::vector<int> TeDBConnectionsPool::getConnectionsIdVector()
-{
-	std::vector<int> dbIds;
-	std::map<std::string, int>::iterator it;
-	
-	for(it = _dbConns.begin(); it != _dbConns.end(); ++it)
-	{
-        int dbId = it->second;
-		dbIds.push_back(dbId);
-	}
-
-	return dbIds;
-}
-
-void TeDBConnectionsPool::createDBConnectionTable(TeDatabase* db)
-{
-	if(db->tableExist("te_database_connection"))
-    {
-        return;
-    }
-
-	TeAttributeList attList;
-
-	TeAttribute att1;
-	att1.rep_.name_ = "connection_id";
-	att1.rep_.isAutoNumber_ = true;
-	att1.rep_.isPrimaryKey_ = true;
-	att1.rep_.null_ = false;
-	att1.rep_.type_ = TeINT;
-	att1.rep_.numChar_ = 0;
-	attList.push_back(att1);
-
-	TeAttribute att2;
-	att2.rep_.name_ = "dbms_name";
-	att2.rep_.isAutoNumber_ = false;
-	att2.rep_.isPrimaryKey_ = false;
-	att2.rep_.null_ = true;
-	att2.rep_.type_ = TeSTRING;
-	att2.rep_.numChar_ = 255;
-	attList.push_back(att2);
-
-	TeAttribute att3;
-	att3.rep_.name_ = "host_name";
-	att3.rep_.isAutoNumber_ = false;
-	att3.rep_.isPrimaryKey_ = false;
-	att3.rep_.null_ = true;
-	att3.rep_.type_ = TeSTRING;
-	att3.rep_.numChar_ = 255;
-	attList.push_back(att3);
-
-	TeAttribute att4;
-	att4.rep_.name_ = "database_name";
-	att4.rep_.isAutoNumber_ = false;
-	att4.rep_.isPrimaryKey_ = false;
-	att4.rep_.null_ = true;
-	att4.rep_.type_ = TeSTRING;
-	att4.rep_.numChar_ = 255;
-	attList.push_back(att4);
-
-	TeAttribute att5;
-	att5.rep_.name_ = "user_name";
-	att5.rep_.isAutoNumber_ = false;
-	att5.rep_.isPrimaryKey_ = false;
-	att5.rep_.null_ = true;
-	att5.rep_.type_ = TeSTRING;
-	att5.rep_.numChar_ = 255;
-	attList.push_back(att5);
-
-	TeAttribute att6;
-	att6.rep_.name_ = "user_password";
-	att6.rep_.isAutoNumber_ = false;
-	att6.rep_.isPrimaryKey_ = false;
-	att6.rep_.null_ = true;
-	att6.rep_.type_ = TeSTRING;
-	att6.rep_.numChar_ = 255;
-	attList.push_back(att6);
-
-	TeAttribute att7;
-	att7.rep_.name_ = "port_number";
-	att7.rep_.isAutoNumber_ = false;
-	att7.rep_.isPrimaryKey_ = false;
-	att7.rep_.null_ = true;
-	att7.rep_.type_ = TeINT;
-	att7.rep_.numChar_ = 0;
-	attList.push_back(att7);
-
-	if(!db->createTable("te_database_connection", attList))
-    {
-        std::string errorMsg = "Fail creating te_dabase_connection table.";
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-    }
-}
-
-void TeDBConnectionsPool::deleteExternalDBConnection(TeDatabase* mainDb, const int& externalDbId)
-{
-    std::string strSQL = "DELETE FROM te_database_connection WHERE connection_id = " + 
-        Te2String(externalDbId);
-
-    if(!mainDb->execute(strSQL))
-    {
-        throw;
-    }
-
-    removeDatabase(externalDbId);
-}
-
-void TeDBConnectionsPool::insertDatabase(TeDatabase* db, const int& dbId)
-{
-    if(_dbs.find(dbId) != _dbs.end())
-    {
-        return;
-    }
-
-	TeDatabaseFactoryParams params;
-	params.database_ = db->databaseName();
-	params.dbms_name_ = db->dbmsName();
-	params.host_ = db->host();
-	params.user_ = db->user();
-	params.password_ = db->password();
-	params.port_ = db->portNumber();
-	
-	_dbConns[getDbKey(params)] = dbId;
-	_dbs[dbId] = db;
-}
-
-std::string TeDBConnectionsPool::getDbKey(const TeDatabaseFactoryParams& dbParams) const
-{
-	std::string dbKey = dbParams.dbms_name_,
-                pv(";");
-
-	dbKey += pv + dbParams.database_ + pv + dbParams.host_ + pv + dbParams.user_ + pv + 
-		dbParams.password_ + pv + Te2String(dbParams.port_);
-
-    return dbKey;
-}
-
-void TeDBConnectionsPool::verifyDbParams(std::string& dbmsName, std::string& /*dbName*/, 
-								  std::string& host, std::string& user, 
-								  std::string& passwd, int& portNumber)
-{
-    if(dbmsName == "Access" || dbmsName == "Ado")
-	{
-		dbmsName = "Ado";
-        host = "";
-        user = "";
-        passwd = "";
-        portNumber = -1;
-	}
-    else if(dbmsName == "SQL Server")
-    {
-        dbmsName = "SqlServerAdo";
-    }
-	else if(dbmsName == "Oracle")
-	{
-		dbmsName = "OracleAdo";
-	}
-	else if(dbmsName == "OracleOCI")
-	{
-		dbmsName = "OracleOCI";
-	}
-    else 
-	{
-		if(host.empty())
-		{
-			host = "localhost";
-		}
-		
-		if(dbmsName == "MySQL")
-		{
-			portNumber = 0;
-		}
-	}
-}
-
-TeDatabaseFactoryParams TeDBConnectionsPool::asFactoryParams(const std::string& dbmsName, 
-															 const std::string& dbName, 
-															 const std::string& host, 
-															 const std::string& user, 
-															 const std::string& passwd, 
-															 const int& portNumber)
-{
-	TeDatabaseFactoryParams params;
-
-	params.dbms_name_ = dbmsName;
-	params.database_ = dbName;
-	params.host_ = host;
-	params.user_ = user;
-	params.password_ = passwd;
-	params.port_ = portNumber;
-
-	return params;
-}
-
-bool TeDBConnectionsPool::getConnectionInfo(TeDatabase* mainDb, const int& connId, 
-											std::string& hostName, std::string& dbmsName, std::string& dbName, 
-											std::string& userName, std::string& password, int& port)
-{
-	TeDatabasePortal* portal = mainDb->getPortal();
-
-	if(portal == NULL)
-	{
-        std::string errorMsg = "Fail getting database portal.";
-
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-	}
-
-	if(!mainDb->tableExist("te_database_connection"))
-	{
-		return false;
-	}
-
-	std::string sql = "SELECT * FROM te_database_connection WHERE connection_id = " + Te2String(connId);
-
-	if(!portal->query(sql))
-	{
-		portal->freeResult();
-		delete portal;
-
-		std::string errorMsg = "Fail querying data - " + mainDb->errorMessage();
-
-        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
-	}
-    
-	bool found = false;
-	if(portal->fetchRow())
-    {
-		found = true;
-
-	    hostName = portal->getData("host_name");
-		dbName = portal->getData("database_name");
-		userName = portal->getData("user_name");
-		dbmsName = portal->getData("dbms_name");
-		password = portal->getData("user_password");
-	    port = portal->getInt("port_number");
-    }
-
-	portal->freeResult();
-	delete portal;
-	portal = NULL;
-
-	return found;
-}
+//STL include files
+#include <string>
+
+//TerraLib include files
+#include <TeDatabase.h>
+#include <TeDatabaseFactory.h>
+#include <TeDBConnectionsPool.h>
+
+TeDBConnectionsPool::~TeDBConnectionsPool()
+{
+	clear();
+}
+
+TeDatabase* TeDBConnectionsPool::getDatabase(std::string& dbmsName, 
+											 std::string& dbName, 
+											 std::string& host, std::string& user, 
+											 std::string& passwd, int& portNumber)
+{
+	verifyDbParams(dbmsName, dbName, host, user, passwd, portNumber);
+
+	TeDatabaseFactoryParams params = asFactoryParams(dbmsName, dbName, host, user, passwd, portNumber);
+
+    TeDatabase* db = NULL;
+
+	std::map<std::string, int>::iterator conIt = _dbConns.find(getDbKey(params));
+
+	db = (conIt == _dbConns.end()) ?
+		TeDatabaseFactory::make(params) :
+		getDatabase(conIt->second); 
+
+    return db;
+}
+
+TeDatabase* TeDBConnectionsPool::getDatabase(const int& dbIdx)
+{
+    TeDatabase* db = NULL;
+
+    std::map<int, TeDatabase*>::iterator dbIt = _dbs.find(dbIdx);
+
+    if(dbIt != _dbs.end())
+    {
+        db = dbIt->second;
+    }
+
+	/*if((db != NULL) && (!db->isConnected()))
+	{
+		if(!db->connect(db->host(), db->user(), db->password(), db->databaseName(), 
+			db->portNumber()))
+		{
+			removeDatabase(dbIdx);
+			db = NULL;
+		}
+	}*/
+
+    return db;
+}
+
+int TeDBConnectionsPool::getDatabaseIdx(TeDatabase* db)
+{
+    int res = -1;
+
+	std::map<std::string, int>::iterator conIt = _dbConns.find(
+		getDbKey(asFactoryParams(db->dbmsName(), db->databaseName(), db->host(), db->user(),
+		db->password(), db->portNumber())));
+
+    if(conIt != _dbConns.end())
+    {
+        res = conIt->second;
+    }
+
+    return res;
+}
+
+void TeDBConnectionsPool::removeDatabase(const int& dbId)
+{
+    std::map<int, TeDatabase*>::iterator dbIt = _dbs.find(dbId);
+
+    if(dbIt == _dbs.end())
+    {
+        throw;
+    }
+
+    TeDatabase* db = dbIt->second;
+
+    std::string dbKey = getDbKey(asFactoryParams(db->dbmsName(), db->databaseName(), db->host(), 
+        db->user(), db->password(), db->portNumber()));
+
+    std::map<std::string, int>::iterator conIt = _dbConns.find(dbKey);
+
+    if(conIt == _dbConns.end())
+    {
+        throw;
+    }
+
+    _dbs.erase(dbIt);
+    _dbConns.erase(conIt);
+
+    if(db->isConnected())
+    {
+        db->clear();
+        db->close();
+    }
+
+    delete db;
+}
+//
+void TeDBConnectionsPool::clear()
+{
+	std::map<int, TeDatabase*>::iterator it;
+
+	for(it = _dbs.begin(); it != _dbs.end(); ++it)
+	{
+        if(it->second->isConnected())
+        {
+            it->second->clear();
+            it->second->close();
+        }
+        
+        delete it->second;
+	}
+
+	_dbs.clear();
+	_dbConns.clear();
+}
+
+void TeDBConnectionsPool::saveExternalDBConnection(TeDatabase* mainDb, 
+												   TeDatabase* externalDb)
+{
+    std::string host = (externalDb->host().empty()) ? "host_name IS NULL" : 
+                                                      "host_name = '" + externalDb->host() + "'";
+    std::string user = (externalDb->user().empty()) ? "user_name IS NULL" : 
+                                                      "user_name = '" + externalDb->user() + "'";
+    std::string passwd = (externalDb->password().empty()) ? "user_password IS NULL" : 
+                                                        "user_password = '" + externalDb->password() + "'";
+
+    std::string selClause = "SELECT * FROM te_database_connection ";
+    std::string whereClause = "WHERE dbms_name = '" + 
+        externalDb->dbmsName() + "' AND " + host + " AND database_name = '" +
+        externalDb->databaseName() + "' AND " + user + " AND " + passwd + " AND port_number = " + 
+        Te2String(externalDb->portNumber());
+
+	TeDatabasePortal* portal = mainDb->getPortal();
+
+	if(!portal)
+    {
+        std::string errorMsg = "Fail getting database portal.";
+
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+	if(!portal->query(selClause + whereClause))
+	{
+		portal->freeResult();
+		delete portal;
+
+        std::string errorMsg = "Fail on external connections SQL.";
+
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+	if(portal->fetchRow())
+    {
+        if(getDatabaseIdx(externalDb) == -1)
+        {
+            int id = portal->getInt("connection_id");
+            insertDatabase(externalDb, id);
+        }
+
+	    portal->freeResult();
+	    delete portal;
+        return;
+    }
+
+	portal->freeResult();
+
+	std::string strSQL = "";
+
+    strSQL  = "INSERT INTO te_database_connection(dbms_name, host_name, database_name, ";
+    strSQL += "user_name, user_password, port_number) ";
+    strSQL += "VALUES ('" + externalDb->dbmsName();
+    strSQL += "', ";
+    strSQL += externalDb->host().empty() ? "NULL" : "'" + externalDb->host() + "'";
+    strSQL += ", '" + externalDb->databaseName();
+    strSQL += "', ";
+    strSQL += externalDb->user().empty() ? "NULL" : "'" + externalDb->user() + "'"; 
+    strSQL += ", ";
+    strSQL += externalDb->password().empty() ? "NULL" : "'" + externalDb->password() + "'";
+    strSQL += ", " + Te2String(externalDb->portNumber());
+    strSQL += ")";
+
+    if(!mainDb->execute(strSQL))
+    {
+        std::string errorMsg = "Fail on inserting external connection on database connections table.";
+
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+	selClause = "SELECT connection_id FROM te_database_connection ";
+
+	if(!portal->query(selClause + whereClause))
+	{
+		portal->freeResult();
+		delete portal;
+
+        std::string errorMsg = "Fail on external connections SQL.";
+
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+
+	if(!portal->fetchRow())
+    {
+        std::string errorMsg = "Fail on saving external database connection.";
+
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+
+		portal->freeResult();
+	    delete portal;
+        return;
+    }
+
+	int dbId = portal->getInt(0);
+
+	portal->freeResult();
+    delete portal;
+
+    insertDatabase(externalDb, dbId);
+}
+
+void TeDBConnectionsPool::loadExternalDBConnections(TeDatabase* mainDb)
+{
+	TeDatabasePortal* portal = mainDb->getPortal();
+
+	if(portal == NULL)
+	{
+        std::string errorMsg = "Fail getting database portal.";
+
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+	}
+
+	if(!mainDb->tableExist("te_database_connection"))
+	{
+		return;
+	}
+
+	std::string sql = "SELECT * FROM te_database_connection ORDER BY connection_id";
+
+	if(!portal->query(sql))
+	{
+		portal->freeResult();
+		delete portal;
+
+        return;
+	}
+
+    bool flag = portal->fetchRow();
+    
+    while(flag)
+    {
+	    std::string host(portal->getData("host_name")),
+				    dbName(portal->getData("database_name")),
+				    user(portal->getData("user_name")),
+				    dbmsName(portal->getData("dbms_name")),
+				    passwd(portal->getData("user_password"));
+	    int portNumber = portal->getInt("port_number");
+        int dbId = portal->getInt("connection_id");
+
+		TeDatabase* database = getDatabase(dbmsName, dbName, host, user, passwd, portNumber);
+		if(database != NULL)
+		{
+			insertDatabase(database, dbId);
+		}
+
+        flag = portal->fetchRow();
+    }
+
+	if(portal != NULL)
+	{
+		portal->freeResult();
+		delete portal;
+	}
+}
+
+std::vector<int> TeDBConnectionsPool::getConnectionsIdVector()
+{
+	std::vector<int> dbIds;
+	std::map<std::string, int>::iterator it;
+	
+	for(it = _dbConns.begin(); it != _dbConns.end(); ++it)
+	{
+        int dbId = it->second;
+		dbIds.push_back(dbId);
+	}
+
+	return dbIds;
+}
+
+void TeDBConnectionsPool::createDBConnectionTable(TeDatabase* db)
+{
+	if(db->tableExist("te_database_connection"))
+    {
+        return;
+    }
+
+	TeAttributeList attList;
+
+	TeAttribute att1;
+	att1.rep_.name_ = "connection_id";
+	att1.rep_.isAutoNumber_ = true;
+	att1.rep_.isPrimaryKey_ = true;
+	att1.rep_.null_ = false;
+	att1.rep_.type_ = TeINT;
+	att1.rep_.numChar_ = 0;
+	attList.push_back(att1);
+
+	TeAttribute att2;
+	att2.rep_.name_ = "dbms_name";
+	att2.rep_.isAutoNumber_ = false;
+	att2.rep_.isPrimaryKey_ = false;
+	att2.rep_.null_ = true;
+	att2.rep_.type_ = TeSTRING;
+	att2.rep_.numChar_ = 255;
+	attList.push_back(att2);
+
+	TeAttribute att3;
+	att3.rep_.name_ = "host_name";
+	att3.rep_.isAutoNumber_ = false;
+	att3.rep_.isPrimaryKey_ = false;
+	att3.rep_.null_ = true;
+	att3.rep_.type_ = TeSTRING;
+	att3.rep_.numChar_ = 255;
+	attList.push_back(att3);
+
+	TeAttribute att4;
+	att4.rep_.name_ = "database_name";
+	att4.rep_.isAutoNumber_ = false;
+	att4.rep_.isPrimaryKey_ = false;
+	att4.rep_.null_ = true;
+	att4.rep_.type_ = TeSTRING;
+	att4.rep_.numChar_ = 255;
+	attList.push_back(att4);
+
+	TeAttribute att5;
+	att5.rep_.name_ = "user_name";
+	att5.rep_.isAutoNumber_ = false;
+	att5.rep_.isPrimaryKey_ = false;
+	att5.rep_.null_ = true;
+	att5.rep_.type_ = TeSTRING;
+	att5.rep_.numChar_ = 255;
+	attList.push_back(att5);
+
+	TeAttribute att6;
+	att6.rep_.name_ = "user_password";
+	att6.rep_.isAutoNumber_ = false;
+	att6.rep_.isPrimaryKey_ = false;
+	att6.rep_.null_ = true;
+	att6.rep_.type_ = TeSTRING;
+	att6.rep_.numChar_ = 255;
+	attList.push_back(att6);
+
+	TeAttribute att7;
+	att7.rep_.name_ = "port_number";
+	att7.rep_.isAutoNumber_ = false;
+	att7.rep_.isPrimaryKey_ = false;
+	att7.rep_.null_ = true;
+	att7.rep_.type_ = TeINT;
+	att7.rep_.numChar_ = 0;
+	attList.push_back(att7);
+
+	if(!db->createTable("te_database_connection", attList))
+    {
+        std::string errorMsg = "Fail creating te_dabase_connection table.";
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+    }
+}
+
+void TeDBConnectionsPool::deleteExternalDBConnection(TeDatabase* mainDb, const int& externalDbId)
+{
+    std::string strSQL = "DELETE FROM te_database_connection WHERE connection_id = " + 
+        Te2String(externalDbId);
+
+    if(!mainDb->execute(strSQL))
+    {
+        throw;
+    }
+
+    removeDatabase(externalDbId);
+}
+
+void TeDBConnectionsPool::insertDatabase(TeDatabase* db, const int& dbId)
+{
+    if(_dbs.find(dbId) != _dbs.end())
+    {
+        return;
+    }
+
+	TeDatabaseFactoryParams params;
+	params.database_ = db->databaseName();
+	params.dbms_name_ = db->dbmsName();
+	params.host_ = db->host();
+	params.user_ = db->user();
+	params.password_ = db->password();
+	params.port_ = db->portNumber();
+	
+	_dbConns[getDbKey(params)] = dbId;
+	_dbs[dbId] = db;
+}
+
+std::string TeDBConnectionsPool::getDbKey(const TeDatabaseFactoryParams& dbParams) const
+{
+	std::string dbKey = dbParams.dbms_name_,
+                pv(";");
+
+	dbKey += pv + dbParams.database_ + pv + dbParams.host_ + pv + dbParams.user_ + pv + 
+		dbParams.password_ + pv + Te2String(dbParams.port_);
+
+    return dbKey;
+}
+
+void TeDBConnectionsPool::verifyDbParams(std::string& dbmsName, std::string& /*dbName*/, 
+								  std::string& host, std::string& user, 
+								  std::string& passwd, int& portNumber)
+{
+    if(dbmsName == "Access" || dbmsName == "Ado")
+	{
+		dbmsName = "Ado";
+        host = "";
+        user = "";
+        passwd = "";
+        portNumber = -1;
+	}
+    else if(dbmsName == "SQL Server")
+    {
+        dbmsName = "SqlServerAdo";
+    }else if(dbmsName == "SQL Server Spatial")
+	{
+		dbmsName="SqlServerAdoSpatial";
+	}
+	else if(dbmsName == "Oracle")
+	{
+		dbmsName = "OracleAdo";
+	}
+	else if(dbmsName == "OracleOCI")
+	{
+		dbmsName = "OracleOCI";
+	}
+    else 
+	{
+		if(host.empty())
+		{
+			host = "localhost";
+		}
+		
+		if(dbmsName == "MySQL")
+		{
+			portNumber = 0;
+		}
+	}
+}
+
+TeDatabaseFactoryParams TeDBConnectionsPool::asFactoryParams(const std::string& dbmsName, 
+															 const std::string& dbName, 
+															 const std::string& host, 
+															 const std::string& user, 
+															 const std::string& passwd, 
+															 const int& portNumber)
+{
+	TeDatabaseFactoryParams params;
+
+	params.dbms_name_ = dbmsName;
+	params.database_ = dbName;
+	params.host_ = host;
+	params.user_ = user;
+	params.password_ = passwd;
+	params.port_ = portNumber;
+
+	return params;
+}
+
+bool TeDBConnectionsPool::getConnectionInfo(TeDatabase* mainDb, const int& connId, 
+											std::string& hostName, std::string& dbmsName, std::string& dbName, 
+											std::string& userName, std::string& password, int& port)
+{
+	TeDatabasePortal* portal = mainDb->getPortal();
+
+	if(portal == NULL)
+	{
+        std::string errorMsg = "Fail getting database portal.";
+
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+	}
+
+	if(!mainDb->tableExist("te_database_connection"))
+	{
+		return false;
+	}
+
+	std::string sql = "SELECT * FROM te_database_connection WHERE connection_id = " + Te2String(connId);
+
+	if(!portal->query(sql))
+	{
+		portal->freeResult();
+		delete portal;
+
+		std::string errorMsg = "Fail querying data - " + mainDb->errorMessage();
+
+        throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
+	}
+    
+	bool found = false;
+	if(portal->fetchRow())
+    {
+		found = true;
+
+	    hostName = portal->getData("host_name");
+		dbName = portal->getData("database_name");
+		userName = portal->getData("user_name");
+		dbmsName = portal->getData("dbms_name");
+		password = portal->getData("user_password");
+	    port = portal->getInt("port_number");
+    }
+
+	portal->freeResult();
+	delete portal;
+	portal = NULL;
+
+	return found;
+}
diff --git a/src/terralib/kernel/TeDBConnectionsPool.h b/src/terralib/kernel/TeDBConnectionsPool.h
index 3d72107..ffdf383 100644
--- a/src/terralib/kernel/TeDBConnectionsPool.h
+++ b/src/terralib/kernel/TeDBConnectionsPool.h
@@ -1,75 +1,76 @@
-#ifndef TDK_DB_CONNECTIONSPOOL_H
-#define TDK_DB_CONNECTIONSPOOL_H
-
-//STL include files
-#include <iostream>
-#include <map>
-#include <string>
-
-//TerraLib include files
-#include <TeSingleton.h>
-#include <TeDatabaseFactoryParams.h>
-#include <TeException.h>
-
-//foward declarations
-class TeDatabase;
-
-class TL_DLL TeDBConnectionsPool : public TeSingleton<TeDBConnectionsPool>
-{
-public:
-
-	~TeDBConnectionsPool();
-
-	TeDatabase* getDatabase(std::string& dbmsName, std::string& dbName, 
-                            std::string& host, std::string& user, 
-                            std::string& passwd, int& portNumber);
-
-public:
-
-    TeDatabase* getDatabase(const int& dbIdx);
-
-    int getDatabaseIdx(TeDatabase* db);
-
-	void clear();
-
-    void saveExternalDBConnection(TeDatabase* mainDb, TeDatabase* externalDb);
-
-	void loadExternalDBConnections(TeDatabase* mainDb);
-
-	void deleteExternalDBConnection(TeDatabase* mainDb, const int& externalDbId);
-
-	std::vector<int> getConnectionsIdVector();
-
-    static void createDBConnectionTable(TeDatabase* db);
-
-	bool getConnectionInfo(TeDatabase* mainDb, 
-									const int& connId, 
-									std::string& hostName, 
-									std::string& dbmsName, 
-									std::string& dbName, 
-									std::string& userName, 
-									std::string& password, 
-									int& port);
-
-private:
-
-	void insertDatabase(TeDatabase* db, const int& dbId);
-
-	void removeDatabase(const int& dbId);
-
-	std::string getDbKey(const TeDatabaseFactoryParams& dbParams) const;
-
-	void verifyDbParams(std::string& dbmsName, std::string& dbName, 
-								  std::string& host, std::string& user, 
-								  std::string& passwd, int& portNumber);
-
-	TeDatabaseFactoryParams asFactoryParams(const std::string& dbmsName, 
-											const std::string& dbName, 
-											const std::string& host, const std::string& user, 
-											const std::string& passwd, const int& portNumber);
-
-    std::map<std::string, int> _dbConns;
-    std::map<int, TeDatabase*> _dbs;
-};
-
-#endif //TDK_DB_CONNECTIONSPOOL_H
+#ifndef TDK_DB_CONNECTIONSPOOL_H
+#define TDK_DB_CONNECTIONSPOOL_H
+
+//STL include files
+#include <iostream>
+#include <map>
+#include <string>
+#include <vector>
+
+//TerraLib include files
+#include <TeSingleton.h>
+#include <TeDatabaseFactoryParams.h>
+#include <TeException.h>
+
+//foward declarations
+class TeDatabase;
+
+class TL_DLL TeDBConnectionsPool : public TeSingleton<TeDBConnectionsPool>
+{
+public:
+
+	~TeDBConnectionsPool();
+
+	TeDatabase* getDatabase(std::string& dbmsName, std::string& dbName, 
+                            std::string& host, std::string& user, 
+                            std::string& passwd, int& portNumber);
+
+public:
+
+    TeDatabase* getDatabase(const int& dbIdx);
+
+    int getDatabaseIdx(TeDatabase* db);
+
+	void clear();
+
+    void saveExternalDBConnection(TeDatabase* mainDb, TeDatabase* externalDb);
+
+	void loadExternalDBConnections(TeDatabase* mainDb);
+
+	void deleteExternalDBConnection(TeDatabase* mainDb, const int& externalDbId);
+
+	std::vector<int> getConnectionsIdVector();
+
+    static void createDBConnectionTable(TeDatabase* db);
+
+	bool getConnectionInfo(TeDatabase* mainDb, 
+									const int& connId, 
+									std::string& hostName, 
+									std::string& dbmsName, 
+									std::string& dbName, 
+									std::string& userName, 
+									std::string& password, 
+									int& port);
+
+private:
+
+	void insertDatabase(TeDatabase* db, const int& dbId);
+
+	void removeDatabase(const int& dbId);
+
+	std::string getDbKey(const TeDatabaseFactoryParams& dbParams) const;
+
+	void verifyDbParams(std::string& dbmsName, std::string& dbName, 
+								  std::string& host, std::string& user, 
+								  std::string& passwd, int& portNumber);
+
+	TeDatabaseFactoryParams asFactoryParams(const std::string& dbmsName, 
+											const std::string& dbName, 
+											const std::string& host, const std::string& user, 
+											const std::string& passwd, const int& portNumber);
+
+    std::map<std::string, int> _dbConns;
+    std::map<int, TeDatabase*> _dbs;
+};
+
+#endif //TDK_DB_CONNECTIONSPOOL_H
diff --git a/src/terralib/kernel/TeDataTypes.h b/src/terralib/kernel/TeDataTypes.h
old mode 100755
new mode 100644
index dfbb667..86672ec
--- a/src/terralib/kernel/TeDataTypes.h
+++ b/src/terralib/kernel/TeDataTypes.h
@@ -1,182 +1,189 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDataTypes.h
-    \brief This file contains enumerators and data types used by TerraLib
-*/
-#ifndef  __TERRALIB_INTERNAL_DATATYPE_H
-#define  __TERRALIB_INTERNAL_DATATYPE_H
-
-#ifdef WIN32 
-#pragma warning ( disable: 4786 ) 
-#endif
-
-#include <vector>
-#include <string>
-#include <map> 
-
-using namespace std;
-
-//! SPRING�s data model entities
-enum TeSpringModels
-{   TeSPRCadastral=0, TeSPRNetwork=1, TeSPRThematic=2, TeSPRMNT=3 };
-
-
-//!  Types for Attributes (stored in object-relational databases)
-enum TeAttrDataType 
-{TeSTRING, TeREAL, TeINT, TeDATETIME, TeBLOB, TeOBJECT, TeCHARACTER, TeUNKNOWN, TeUNSIGNEDINT,
- TePOINTTYPE, TeLINE2DTYPE, TePOLYGONTYPE, TeCELLTYPE, TeTEXTTYPE, TeNODETYPE,
- TePOINTSETTYPE, TeLINESETTYPE, TePOLYGONSETTYPE, TeCELLSETTYPE, TeTEXTSETTYPE, TeNODESETTYPE,
- TeRASTERTYPE};
-
-
-//! Geometrical representations 
-/*! Uses a binary ennumeration since the same layer 
-    may contain more than one geometrical representation
-*/
-enum TeGeomRep 
-{	TePOLYGONS = 1, TeLINES = 2, TePOINTS = 4, TeSAMPLES = 8, TeCONTOURS = 16,
-	TeARCS = 32, TeNODES = 64  , TeTEXT = 128, TeCELLS = 256 , TeRASTER = 512,
-	TeRASTERFILE = 1024, TeGEOMETRYNONE = 2048, TeSHAPEFILE = 4096, TeCOVERAGE = 8192};
-
-//! Chart types
-enum TeChartType
-{   TeBarChart, TePieChart };
-
-//! Objects that will be grouped or used in a chart
-enum TeSelectedObjects
-{	TeAll, TeSelectedByPointing, TeNotSelectedByPointing, TeSelectedByQuery, TeNotSelectedByQuery,
-	TeSelectedByPointingAndQuery, TeSelectedByPointingOrQuery, TeGrouped, TeNotGrouped };
-
-//! Modes of object selection
-enum TeObjectSelectionMode
-{   TeDefaultSelection, TePointingSelection, TeQuerySelection, TePointingAndQuerySelection };
-
-//! Modes of grouping objects
-enum TeGroupingMode
-{ TeEqualSteps = 0, TeQuantil = 1, TeStdDeviation = 2, TeUniqueValue = 3,
-  TeRasterSlicing = 4, TeNoGrouping = 100 };
-
-//! Direction of use in a ramp color
-enum TeColorDirection
-{	TeColorAscSatEnd, TeColorDescSatEnd, TeColorAscSatBegin, TeColorDescSatBegin };
-
-//! Types of attribute tables in a layer
-enum TeAttrTableType
-{	TeAllAttrTypes, TeAttrStatic, TeAttrMedia, TeAttrExternal, TeAttrEvent, TeFixedGeomDynAttr, 
-	TeDynGeomDynAttr, TeGeomAttrLinkTime, TeGeocodingData };
-
-//! Types of integrity relations among tables in a database
-enum TeDBRelationType
-{	TeNoRelation, TeRINoCascadeDeletion, TeRICascadeDeletion };
-
-//! Data types
-enum TeDataType 
-{	TeBIT, TeUNSIGNEDCHAR, TeCHAR, TeUNSIGNEDSHORT, TeSHORT, TeINTEGER, TeUNSIGNEDLONG, TeLONG, TeFLOAT, TeDOUBLE };
-
-
-//!	Statistics
-/*!
-	 - TeSUM				sum of the values
-	 - TeMAXVALUE			maximum value
-	 - TeMINVALUE			minimal value
-	 - TeCOUNT				total number of the values
-	 - TeVALIDCOUNT			valid number of the values
-	 - TeSTANDARDDEVIATION	standard deviation 
-	 - TeKERNEL				kernel
-	 - TeMEAN				mean
-	 - TeVARIANCE			variance
-	 - TeSKEWNESS			third moment about the Mean 			
-	 - TeKURTOSIS			forth moment about the Mean
-	 - TeAMPLITUDE			maximum value minus minimal value
-	 - TeMEDIAN				median value
-	 - TeVARCOEFF			coefficient of variation 
-	 - TeMODE				value more frequent 
-*/ 
-enum TeStatisticType
-{	TeNOSTATISTIC, TeSUM, TeMAXVALUE, TeMINVALUE, TeCOUNT, TeVALIDCOUNT, TeSTANDARDDEVIATION, TeKERNEL,  
-	TeMEAN, TeVARIANCE, TeSKEWNESS, TeKURTOSIS, TeAMPLITUDE, TeMEDIAN, TeVARCOEFF, TeMODE};
-
-//! A map of an statistic to its value
-typedef map<TeStatisticType, double> TeStatisticValMap;
-
-//! A map of an statistic to its string value
-typedef map<TeStatisticType, string> TeStatisticStringValMap;
-
-//! A map of an object id to its statistics
-typedef map<string, TeStatisticValMap> TeObjStatisticsMap;
-
-//! A map of an statistic to the column name where its value is stored
-typedef map<TeStatisticType, string> TeStatisticsMap;
-
-//! Intersection Algorithms.
-enum TeIntersectorAlgorithm { TeBentleyOttman, TeRedBlue, TeTrivial };
-
-//! Topological relations
-enum TeSpatialRelation	
-{	TeDISJOINT = 1, TeTOUCHES = 2, TeCROSSES = 4, TeWITHIN = 8, 
-	TeOVERLAPS = 16, TeCONTAINS = 32, TeINTERSECTS = 64, TeEQUALS = 128, TeCOVERS = 256,
-	TeCOVEREDBY = 512, TeUNDEFINEDREL = 1024};
-
-//! Temporal predicates
-enum TeTemporalRelation { TeTIMEUNDEFINED, TeTIMEEQUAL, TeTIMEBEFORE, TeTIMEAFTER, TeTIMEMEETS, TeTIMEDURING, TeTIMEOVERLAPS, TeTIMEENDS, TeTIMESTARTS };
-
-//! Logical predicates
-enum TeLogicalOperator { TeAND = 1, TeOR = 2 };
-
-//! Time chronons
-enum TeChronon {	TeNOCHRONON, TeSECOND, TeMINUTE, TeHOUR, TeDAY, TeMONTH, TeYEAR,
-					TeDAYOFWEEK, TeDAYOFMONTH, TeDAYOFYEAR, TeMONTHOFYEAR, TeSEASON, TeWEEKOFYEAR, 
-					TeHOUROFDAY, TeMINUTEOFHOUR, TeSECONDOFMINUTE };
-
-//! Polygon style types
-enum TePolyBasicType { TePolyTypeTransparent=0, TePolyTypeFill=1, TePolyTypeHorizontal=2,
-					 TePolyTypeVertical=3, TePolyTypeFDiagonal=4, TePolyTypeBDiagonal=5,
-					 TePolyTypeCross=6, TePolyTypeDiagonalCross=7 };
-//! Line style types
-enum TeLnBasicType { TeLnTypeContinuous=0, TeLnTypeDashed=1, TeLnTypeDotted=2,  
-					 TeLnTypeDashDot=3, TeLnTypeDashDotDot=4, TeLnTypeNone=5,
-					 TeLnTypeCustom=6 };
-//! Point style types
-enum TePtBasicType { TePtTypePlus=0, TePtTypeStar=1, TePtTypeCircle=2, TePtTypeX=3,  
-					 TePtTypeBox=4, TePtTypeDiamond=5, TePtTypeHollowCircle=6, 
-					 TePtTypeHollowBox=7, TePtTypeHollowDiamond=8 };
-
-//! Type of segment intersection
-enum TeSegmentIntersectionType { TeProperIntersection, TeImproperIntersection };
-
-//! Types of implementations of a generalized proximity matrix 
-enum TeGPMImplementation { TeGraphBreymann };
-
-//! Construction strategies to the generalized proximity matrix 
-enum TeGPMConstructionStrategy { TeAdjacencyStrategy, TeDistanceStrategy, TeNearestNeighboursStrategy,
-								 TeClosedNetworkStrategy, TeOpenNetworkStrategy, TeOpenNetworkStrategy2 };
-
-//! Slicing strategies to the generalized proximity matrix 
-enum TeGPMSlicingStrategy { TeNoSlicingStrategy, TeZonesSlicingStrategy };
-	
-//! Weight strategies to the generalized proximity matrix 
-enum TeGPMWeightsStrategy { TeNoWeightsStrategy, TeInverseDistanceStrategy, 
-							TeSquaredInverseDistStrategy, TeConnectionStrenghtStrategy};
-
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDataTypes.h
+    \brief This file contains enumerators and data types used by TerraLib
+*/
+#ifndef  __TERRALIB_INTERNAL_DATATYPE_H
+#define  __TERRALIB_INTERNAL_DATATYPE_H
+
+#ifdef WIN32 
+#pragma warning ( disable: 4786 ) 
+#endif
+
+#include <vector>
+#include <string>
+#include <map> 
+
+using namespace std;
+
+//! SPRING�s data model entities
+enum TeSpringModels
+{   TeSPRCadastral=0, TeSPRNetwork=1, TeSPRThematic=2, TeSPRMNT=3 };
+
+
+//!  Types for Attributes (stored in object-relational databases)
+enum TeAttrDataType 
+{TeSTRING, TeREAL, TeINT, TeDATETIME, TeBLOB, TeOBJECT, TeCHARACTER, TeUNKNOWN, TeUNSIGNEDINT,
+ TePOINTTYPE, TeLINE2DTYPE, TePOLYGONTYPE, TeCELLTYPE, TeTEXTTYPE, TeNODETYPE,
+ TePOINTSETTYPE, TeLINESETTYPE, TePOLYGONSETTYPE, TeCELLSETTYPE, TeTEXTSETTYPE, TeNODESETTYPE,
+ TeRASTERTYPE, TeBOOLEAN};
+
+
+//! Geometrical representations 
+/*! Uses a binary ennumeration since the same layer 
+    may contain more than one geometrical representation
+*/
+enum TeGeomRep 
+{	TePOLYGONS = 1, TeLINES = 2, TePOINTS = 4, TeSAMPLES = 8, TeCONTOURS = 16,
+	TeARCS = 32, TeNODES = 64  , TeTEXT = 128, TeCELLS = 256 , TeRASTER = 512,
+	TeRASTERFILE = 1024, TeGEOMETRYNONE = 2048, TeSHAPEFILE = 4096, TeCOVERAGE = 8192};
+
+//! Chart types
+enum TeChartType
+{   TeBarChart, TePieChart };
+
+//! Objects that will be grouped or used in a chart
+enum TeSelectedObjects
+{	TeAll, TeSelectedByPointing, TeNotSelectedByPointing, TeSelectedByQuery, TeNotSelectedByQuery,
+	TeSelectedByPointingAndQuery, TeSelectedByPointingOrQuery, TeGrouped, TeNotGrouped };
+
+//! Modes of object selection
+enum TeObjectSelectionMode
+{   TeDefaultSelection, TePointingSelection, TeQuerySelection, TePointingAndQuerySelection };
+
+//! Modes of grouping objects
+enum TeGroupingMode
+{ TeEqualSteps = 0, TeQuantil = 1, TeStdDeviation = 2, TeUniqueValue = 3,
+  TeRasterSlicing = 4, TeCustomGroup = 5, TeNoGrouping = 100 };
+
+//! Direction of use in a ramp color
+enum TeColorDirection
+{	TeColorAscSatEnd, TeColorDescSatEnd, TeColorAscSatBegin, TeColorDescSatBegin };
+
+//! Types of attribute tables in a layer
+enum TeAttrTableType
+{	TeAllAttrTypes, TeAttrStatic, TeAttrMedia, TeAttrExternal, TeAttrEvent, TeFixedGeomDynAttr, 
+	TeDynGeomDynAttr, TeGeomAttrLinkTime, TeGeocodingData };
+
+//! Types of integrity relations among tables in a database
+enum TeDBRelationType
+{	TeNoRelation, TeRINoCascadeDeletion, TeRICascadeDeletion };
+
+//! Data types
+enum TeDataType 
+{	TeBIT, TeUNSIGNEDCHAR, TeCHAR, TeUNSIGNEDSHORT, TeSHORT, TeINTEGER, TeUNSIGNEDLONG, TeLONG, TeFLOAT, TeDOUBLE };
+
+
+//!	Statistics
+/*!
+	 - TeSUM				sum of the values
+	 - TeMAXVALUE			maximum value
+	 - TeMINVALUE			minimal value
+	 - TeCOUNT				total number of the values
+	 - TeVALIDCOUNT			valid number of the values
+	 - TeSTANDARDDEVIATION	standard deviation 
+	 - TeKERNEL				kernel
+	 - TeMEAN				mean
+	 - TeVARIANCE			variance
+	 - TeSKEWNESS			third moment about the Mean 			
+	 - TeKURTOSIS			forth moment about the Mean
+	 - TeAMPLITUDE			maximum value minus minimal value
+	 - TeMEDIAN				median value
+	 - TeVARCOEFF			coefficient of variation 
+	 - TeMODE				value more frequent 
+*/ 
+enum TeStatisticType
+{	TeNOSTATISTIC, TeSUM, TeMAXVALUE, TeMINVALUE, TeCOUNT, TeVALIDCOUNT, TeSTANDARDDEVIATION, TeKERNEL,  
+	TeMEAN, TeVARIANCE, TeSKEWNESS, TeKURTOSIS, TeAMPLITUDE, TeMEDIAN, TeVARCOEFF, TeMODE};
+
+//! A map of an statistic to its value
+typedef map<TeStatisticType, double> TeStatisticValMap;
+
+//! A map of an statistic to its string value
+typedef map<TeStatisticType, string> TeStatisticStringValMap;
+
+//! A map of an object id to its statistics
+typedef map<string, TeStatisticValMap> TeObjStatisticsMap;
+
+//! A map of an statistic to the column name where its value is stored
+typedef map<TeStatisticType, string> TeStatisticsMap;
+
+//! Intersection Algorithms.
+enum TeIntersectorAlgorithm { TeBentleyOttman, TeRedBlue, TeTrivial };
+
+//! Topological relations
+enum TeSpatialRelation	
+{	TeDISJOINT = 1, TeTOUCHES = 2, TeCROSSES = 4, TeWITHIN = 8, 
+	TeOVERLAPS = 16, TeCONTAINS = 32, TeINTERSECTS = 64, TeEQUALS = 128, TeCOVERS = 256,
+	TeCOVEREDBY = 512, TeUNDEFINEDREL = 1024};
+
+//! Temporal predicates
+enum TeTemporalRelation { TeTIMEUNDEFINED, TeTIMEEQUAL, TeTIMEBEFORE, TeTIMEAFTER, TeTIMEMEETS, TeTIMEDURING, TeTIMEOVERLAPS, TeTIMEENDS, TeTIMESTARTS };
+
+//! Logical predicates
+enum TeLogicalOperator { TeAND = 1, TeOR = 2 };
+
+//! Time chronons
+enum TeChronon {	TeNOCHRONON, TeSECOND, TeMINUTE, TeHOUR, TeDAY, TeMONTH, TeYEAR,
+					TeDAYOFWEEK, TeDAYOFMONTH, TeDAYOFYEAR, TeMONTHOFYEAR, TeSEASON, TeWEEKOFYEAR, 
+					TeHOUROFDAY, TeMINUTEOFHOUR, TeSECONDOFMINUTE };
+
+//! Polygon style types
+enum TePolyBasicType { TePolyTypeTransparent=0, TePolyTypeFill=1, TePolyTypeHorizontal=2,
+					 TePolyTypeVertical=3, TePolyTypeFDiagonal=4, TePolyTypeBDiagonal=5,
+					 TePolyTypeCross=6, TePolyTypeDiagonalCross=7,  TePolyTypeCustom=8 };
+//! Line style types
+enum TeLnBasicType { TeLnTypeContinuous=0, TeLnTypeDashed=1, TeLnTypeDotted=2,  
+					 TeLnTypeDashDot=3, TeLnTypeDashDotDot=4, TeLnTypeNone=5,
+					 TeLnTypeCustom=6, TeLnTypeArrow=7, TeLnTypeMiddleArrow=8 };
+
+//! Line cap styles
+enum TeLnCapStyle { TeLnFlatCap=0, TeLnSquareCap=1, TeLnRoundCap=2 };
+
+//! Line join styles
+enum TeLnJoinStyle { TeLnMiterJoin=0, TeLnBevelJoin=1, TeLnRoundJoin=2 };
+
+//! Point style types
+enum TePtBasicType { TePtTypePlus=0, TePtTypeStar=1, TePtTypeCircle=2, TePtTypeX=3,  
+					 TePtTypeBox=4, TePtTypeDiamond=5, TePtTypeHollowCircle=6, 
+					 TePtTypeHollowBox=7, TePtTypeHollowDiamond=8, TePtTypeCustom=9 };
+
+//! Type of segment intersection
+enum TeSegmentIntersectionType { TeProperIntersection, TeImproperIntersection };
+
+//! Types of implementations of a generalized proximity matrix 
+enum TeGPMImplementation { TeGraphBreymann };
+
+//! Construction strategies to the generalized proximity matrix 
+enum TeGPMConstructionStrategy { TeAdjacencyStrategy, TeDistanceStrategy, TeNearestNeighboursStrategy,
+								 TeClosedNetworkStrategy, TeOpenNetworkStrategy, TeOpenNetworkStrategy2 };
+
+//! Slicing strategies to the generalized proximity matrix 
+enum TeGPMSlicingStrategy { TeNoSlicingStrategy, TeZonesSlicingStrategy };
+	
+//! Weight strategies to the generalized proximity matrix 
+enum TeGPMWeightsStrategy { TeNoWeightsStrategy, TeInverseDistanceStrategy, 
+							TeSquaredInverseDistStrategy, TeConnectionStrenghtStrategy};
+
+
+#endif
diff --git a/src/terralib/kernel/TeDatabase.cpp b/src/terralib/kernel/TeDatabase.cpp
old mode 100755
new mode 100644
index 78c8b8a..9a4d862
--- a/src/terralib/kernel/TeDatabase.cpp
+++ b/src/terralib/kernel/TeDatabase.cpp
@@ -1,10008 +1,10554 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeDatabase.h"
-#include "TeDecoderDatabase.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeSpatialOperations.h"
-#include "TeImportRaster.h"
-#include "TeLayer.h"
-#include "TeAbstractTheme.h"
-#include "TeExternalTheme.h"
-#include "TeDatabaseFactoryParams.h"
-#include <TeRasterTransform.h>
-#include <TeTimeInterval.h>
-
-#include <sys/stat.h>
-#include <stdio.h>
-#include <sstream>
-
-typedef map<int,TeNode> TeNodeMap;
-
-static const int scales [] =
-{	150000,
-	80000,
-	40000,
-	20000,
-	10000,
-	3000,
-	1500,
-	800,
-	400,
-	200,
-	100,
-	30,
-	15,
-	8,
-	4,
-	2,
-	1
-};
-
-//-*********************
-
-TeDatabase::TeDatabase() :
-	isConnected_ (false),
-	host_(""),
-	user_(""),
-	password_(""),
-	database_(""),
-	portNumber_(-1),
-	errorNumber_(0),
-	errorMessage_(""),
-	transactionCounter_(0)
-{
-	metaModel_.reset(new TeMetaModelCache);
-}
-
-TeDatabase& TeDatabase::operator=(const TeDatabase& other)
-{
-	if(this != &other)
-		metaModel_ = other.metaModel_;	
-
-	return *this;
-}
-
-TeDatabase::~TeDatabase()
-{
-}
-
-string
-TeDatabase::getDatabaseDescription()
-{
-    std::stringstream desc;
-    const char sep = ';';
-
-    desc << dbmsName_;
-    desc << sep << host_;
-    desc << sep << portNumber_;
-    desc << sep << database_;
-    desc << sep << user_;
-    desc << sep << password_;
-
-    return desc.str();
-} 
-
-void TeDatabase::alterTableInfoInMemory(const string& updatedTableName, string oldTableName)
-{
-	//update table in memory
-	TeTable updatedTable(updatedTableName);
-	loadTableInfo(updatedTable);
-	if(oldTableName.empty())
-		oldTableName = updatedTableName;
-
-	TeLayerMap::iterator itLayer = metaModel_->layerMap().begin();
-	while(itLayer!=metaModel_->layerMap().end())
-	{
-		TeAttrTableVector::iterator itAttr = itLayer->second->attrTables().begin();
-		while(itAttr!=itLayer->second->attrTables().end())
-		{
-			if(TeConvertToUpperCase(itAttr->name())==TeConvertToUpperCase(oldTableName))
-			{
-				(*itAttr)=updatedTable;
-				break;
-			}
-			++itAttr;
-		}
-		++itLayer;
-	}
-	TeThemeMap::iterator itTheme = metaModel_->themeMap().begin();
-	while(itTheme!=metaModel_->themeMap().end())
-	{
-		if(itTheme->second->getProductId() != TeTHEME)
-		{
-			++itTheme; 
-			continue;
-		}
-
-		TeTheme* theme = static_cast<TeTheme*>(itTheme->second);
-				
-		TeAttrTableVector::iterator itAttr = theme->attrTables().begin();
-		while(itAttr!=theme->attrTables().end())
-		{
-			if(TeConvertToUpperCase(itAttr->name())==TeConvertToUpperCase(oldTableName))
-			{
-				(*itAttr)=updatedTable;
-				theme->loadAliasVector();
-				theme->loadAttrLists();
-				theme->loadTablesJoin(); 
-				break;
-			}
-			++itAttr;
-		}
-		++itTheme;
-	}
-	return;
-}
-
-bool TeDatabase::validTable (TeTable& table)
-{
-	int cont=0;
-	bool change = false;
-	bool changeTable = false;
-	bool uniqueName, linkName; 
-	
-	TeAttributeList::iterator it = table.attributeList().begin();
-	TeAttributeList::iterator it2;  
-	while(it != table.attributeList().end())
-	{
-		uniqueName = false;
-		linkName = false;
-
-		if((*it).rep_.name_==table.uniqueName())
-			uniqueName=true;
-		
-		if((*it).rep_.name_==table.linkName())
-			linkName=true;
-
-		string errorMess;
-		string temp = TeCheckName((*it).rep_.name_, change, errorMess);
-		
-		if(change)
-		{
-			it2 = table.attributeList().begin();
-			while(it2!=table.attributeList().end())
-			{
-				if(temp==(*it2).rep_.name_)
-				{
-					temp += Te2String(cont);
-					it2 = table.attributeList().begin();
-					++cont;
-				}
-				else
-					++it2;
-			}
-
-			changeTable = true;
-		}
-
-		if(change && uniqueName)
-			table.setUniqueName(temp);
-		if(change && linkName)
-			table.setLinkName (temp);
-
-		(*it).rep_.name_ = temp;
-		++it;
-		++cont;
-	}
-	
-	return changeTable;
-}
-
-string TeDatabase::getTableName(int tableId)
-{
-	string tableName;
-
-	TeDatabasePortal* pt = getPortal();
-	string q = "SELECT attr_table FROM te_layer_table";
-	q += " WHERE table_id = " + Te2String(tableId);
-	if (pt->query(q) == true && pt->fetchRow())
-		tableName = pt->getData("attr_table");
-	delete pt;
-	return tableName;
-}
-
-bool
-TeDatabase::deleteTable (const string& table)
-{
-//	int f =	table.find ("te_collection", std::string::npos);
-	int f =	table.find ("te_collection");
-
-	if( table=="te_theme" ||
-		table=="te_layer" ||
-		table=="te_representation" ||
-		table=="te_tables_relation" ||
-		table=="te_layer_table" ||
-		table=="te_raster_metadata" ||
-		table=="te_projection" ||
-		table=="te_view" ||
-		table=="te_legend" ||
-		table=="te_visual" ||
-		table=="te_database" ||
-		f == 0)
-	{
-		errorMessage_ = "N�o � poss�vel deletar tabelas do modelo!";
-		return false;
-	}
-
-	string del = "DROP TABLE " + table;
-	if(tableExist(table))
-	{
-		if(!execute(del))
-			return false;
-	}
-
-	return true;
-}
-
-
-bool 
-TeDatabase::deleteColumn (const string& table, const string& colName)
-{
-	if(!tableExist(table))
-		return false;
-	TeAttribute attr;
-	if (!columnExist(table,colName,attr))
-		return true;
-	string drop = "ALTER  TABLE "+ table +" DROP COLUMN "+ colName;
-	if(execute(drop) == false)
-		return false;
-
-	string tableId;
-	TeDatabasePortal* portal = getPortal();
-	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + table + "'";
-	if(portal->query(sql) && portal->fetchRow())
-		tableId = portal->getData(0);
-
-	delete portal;
-	if(tableId.empty() == false)
-	{
-		// delete relation
-		sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
-		sql += " AND related_attr = '" + colName + "')";
-		sql += " OR (external_table_name = '" + table + "'";
-		sql += " AND external_attr = '" + colName + "')";
-		if(execute(sql) == false)
-			return false;
-
-		// delete grouping
-		TeDatabasePortal* portal = getPortal();
-		sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + table + "." + colName + "'";
-		if(portal->query(sql) && portal->fetchRow())
-		{
-			string themeId = portal->getData(0);
-
-			sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
-			if(execute(sql) == false)
-			{
-				delete portal;
-				return false;
-			}
-		}
-		delete portal;
-
-		sql = "DELETE FROM te_grouping";
-		sql += " WHERE grouping_attr = '" + table + "." + colName + "'";
-		if(execute(sql) == false)
-			return false;
-	}
-	alterTableInfoInMemory(table);
-	return true;
-}
-
-bool 
-TeDatabase::defineIntegrity(void)
-{
-	if (existRelation("te_layer","fk_layer_proj_id") == TeNoRelation )
-		if (!createRelation("fk_layer_proj_id", "te_layer", "projection_id", "te_projection", "projection_id", false))
-			return false;
-        
-	if (existRelation("te_representation","fk_rep_layer_id") == TeNoRelation )
-		if (!createRelation("fk_rep_layer_id", "te_representation", "layer_id", "te_layer", "layer_id", true))
-			return false;
-
-	if (existRelation("te_view","fk_view_proj_id") == TeNoRelation )
-		if (!createRelation("fk_view_proj_id", "te_view", "projection_id", "te_projection", "projection_id", false))
-			return false;
-
-	if (existRelation("te_view", "fk_view_current_theme") == TeNoRelation )
-		if (!createRelation("fk_view_current_theme", "te_view", "current_theme", "te_theme", "theme_id", false))
-			return false;
-	
-	if (existRelation("te_theme","fk_theme_layer_id") == TeNoRelation )
-		if (!createRelation("fk_theme_layer_id", "te_theme", "layer_id", "te_layer", "layer_id", true))
-			return false;
-
-	if (existRelation("te_theme","fk_theme_view_id") == TeNoRelation )
-		if (!createRelation("fk_theme_view_id", "te_theme", "view_id", "te_view", "view_id", true))
-			return false;
-
-	if (existRelation("te_theme_table","fk_thmtable_theme_id") == TeNoRelation )
-		if (!createRelation("fk_thmtable_theme_id", "te_theme_table", "theme_id", "te_theme", "theme_id", true))
-			return false;
-
-	if (existRelation("te_theme_table","fk_thmtable_lytable_id") == TeNoRelation )
-		if (!createRelation("fk_thmtable_lytable_id", "te_theme_table", "table_id", "te_layer_table", "table_id", false))
-			return false;
-
-	if (existRelation("te_theme_table","fk_thmtable_relation_id") == TeNoRelation )
-		if (!createRelation("fk_thmtable_relation_id", "te_theme_table", "relation_id", "te_tables_relation", "relation_id", false))
-			return false;
-
-	if (existRelation("te_grouping","fk_group_theme_id") == TeNoRelation )
-		if (!createRelation("fk_group_theme_id", "te_grouping", "theme_id", "te_theme", "theme_id", true))
-			return false;
-
-	if (existRelation("te_legend","fk_legend_theme_id") == TeNoRelation )
-		if (!createRelation("fk_legend_theme_id", "te_legend", "theme_id", "te_theme", "theme_id", true))
-			return false;
-
-	if (existRelation("te_visual","fk_visual_legend_id") == TeNoRelation )
-		if (!createRelation("fk_visual_legend_id", "te_visual", "legend_id", "te_legend", "legend_id", true))
-			return false;
-        
-	if (existRelation("te_layer_table","fk_laytable_layer_id") == TeNoRelation )
-		if (!createRelation ("fk_laytable_layer_id", "te_layer_table", "layer_id", "te_layer", "layer_id", true))
-			return false;
-        
-	if (existRelation("te_tables_relation","fk_tabrelation_laytable_id") == TeNoRelation )
-		if (!createRelation("fk_tabrelation_laytable_id", "te_tables_relation", "related_table_id", "te_layer_table", "table_id", true))
-			return false;
-
-	if (existRelation("te_visual_raster","fk_visrast_theme_id") == TeNoRelation )
-		if (!createRelation("fk_visrast_theme_id", "te_visual_raster", "theme_id", "te_theme", "theme_id", true))
-			return false;
-
-	if (existRelation("te_project_view","fk_projectview_project_id") == TeNoRelation )
-		if (!createRelation("fk_projectview_project_id", "te_project_view", "project_id", "te_project", "project_id", true))
-			return false;
-
-	if (existRelation("te_project_view","fk_projectview_view_id") == TeNoRelation )
-		if (!createRelation("fk_projectview_view_id", "te_project_view", "view_id", "te_view", "view_id", true))
-			return false;
-
-	return true;
-}
-
-bool 
-TeDatabase::createConceptualModel(bool withIntegrity, bool newDatabase, bool /* createIndex */)
-{
-	bool status = true;
-	bool createMainTables = false;
-	
-	if (!this->tableExist("te_projection"))
-	{
-		status = this->createProjectionTable();
-		if (!status)
-			return false;	
-		createMainTables = true;
-	}
-
-	if (!this->tableExist("te_layer"))
-	{
-		status = this->createLayerTable();
-		if (!status)
-			return false;
-		createMainTables = true;
-	}
-
-	if (!this->tableExist("te_layer_table"))
-	{
-		status = this->createLayerTableTable();
-		if (!status)
-			return false;
-		createMainTables = true;
-	}
-
-	if (!this->tableExist("te_tables_relation"))
-	{
-		status = this->createTablesRelationTable();
-		if (!status)
-			return false;
-		createMainTables = true;
-	}
-	
-	if (!this->tableExist("te_representation"))
-	{
-		status = this->createRepresentationTable();
-		if (!status)
-			return false;
-		createMainTables = true;
-	}
-
-	if (!this->tableExist("te_theme"))
-	{
-		status = this->createThemeTable();
-		if (!status)
-			return false;
-		createMainTables = true;
-	}
-
-	if (!this->tableExist("te_view"))
-	{
-		status = this->createViewTable();
-		if (!status)
-			return false;
-		createMainTables = true;
-	}
-
-	if (!this->tableExist("te_grouping"))
-	{
-		status = this->createGroupingTable();
-		if (!status)
-			return false;
-	}
-
-	if (!this->tableExist("te_theme_table"))
-	{
-		status = this->createThemeTablesTable();
-		if (!status)
-			return false;
-	}
-
-	if (!this->tableExist("te_legend"))
-	{
-		status = this->createLegendTable();
-		if (!status)
-			return false;	
-	}
-
-	if (!this->tableExist("te_visual"))
-	{
-		status = this->createVisualTable();
-		if (!status)
-			return false;	
-	}
-
-	if (!this->tableExist("te_visual_raster"))
-	{
-		status = this->createVisualRasterTable();
-		if (!status)
-			return false;	
-	}
-
-	if (!this->tableExist("te_database"))
-	{
-		status = this->createDatabaseTable();
-		if (!status)
-			return false;
-	}
-
-	if (!this->tableExist("te_project"))
-	{
-		status = this->createProjectTable();
-		if (!status)
-			return false;
-	}
-
-	if (!this->tableExist("te_project_view"))
-	{
-		status = this->createProjectViewTable();
-		if (!status)
-			return false;
-	}
-	if (newDatabase || createMainTables)
-	{
-		string ins = "INSERT INTO te_database (db_version) VALUES ('" + TeDBVERSION + "')";
-		if (!execute(ins))
-			return false;
-	}
-
-	if (withIntegrity)
-		status = defineIntegrity();
-
-	return status;
-}
-
-bool
-TeDatabase::createIndex(const string& tableName, const string& indexName, const string& columnsName)
-{
-	string sql = "CREATE INDEX " + indexName + " ON " + tableName + "(" + columnsName + ")";	
-	return execute (sql);
-}
-
-bool 
-TeDatabase::createDatabaseTable()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attDBVersion;
-	attDBVersion.rep_.name_ = "db_version";
-	attDBVersion.rep_.type_ = TeSTRING;
-	attDBVersion.rep_.numChar_ = 50;
-	attDBVersion.rep_.isPrimaryKey_ = true;
-	attDBVersion.rep_.null_ = false;
-	attList.push_back(attDBVersion);}
-
-	{TeAttribute attDBCreation;
-	attDBCreation.rep_.name_ = "db_creation";
-	attDBCreation.rep_.type_ = TeDATETIME;
-	attList.push_back(attDBCreation);}
-
-	return createTable("te_database", attList);
-}
-
-bool 
-TeDatabase::createProjectTable()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attProjectId;
-	attProjectId.rep_.name_ = "project_id";
-	attProjectId.rep_.type_ = TeUNSIGNEDINT;
-	attProjectId.rep_.isAutoNumber_ = true;
-	attProjectId.rep_.isPrimaryKey_ = true;
-	attProjectId.rep_.null_ = false;
-	attList.push_back(attProjectId);}
-
-	{TeAttribute attName;
-	attName.rep_.name_ = "name";
-	attName.rep_.type_ = TeSTRING;
-	attName.rep_.numChar_ = 50;
-	attName.rep_.null_ = false;
-	attList.push_back(attName);}
-
-	{TeAttribute attDescription;
-	attDescription.rep_.name_ = "description";
-	attDescription.rep_.type_ = TeSTRING;
-	attDescription.rep_.numChar_ = 255;
-	attDescription.rep_.null_ = true;
-	attList.push_back(attDescription);}
-
-	{TeAttribute attCurrentView;
-	attCurrentView.rep_.name_ = "current_view";
-	attCurrentView.rep_.type_ = TeINT;
-	attList.push_back(attCurrentView);}
-
-	return createTable("te_project", attList);
-}
-
-bool 
-TeDatabase::createProjectViewTable()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attProjectId;
-	attProjectId.rep_.name_ = "project_id";
-	attProjectId.rep_.type_ = TeUNSIGNEDINT;
-	attProjectId.rep_.isPrimaryKey_ = true;
-	attProjectId.rep_.null_ = false;
-	attList.push_back(attProjectId);}
-
-	{TeAttribute attViewId;
-	attViewId.rep_.name_ = "view_id";
-	attViewId.rep_.type_ = TeUNSIGNEDINT;
-	attViewId.rep_.isPrimaryKey_ = true;
-	attViewId.rep_.null_ = false;
-	attList.push_back(attViewId);}
-
-	return createTable("te_project_view", attList);
-}
-
-bool 
-TeDatabase::createProjectionTable ()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attProjectId;
-	attProjectId.rep_.name_ = "projection_id";
-	attProjectId.rep_.type_ = TeUNSIGNEDINT;
-	attProjectId.rep_.isPrimaryKey_ = true;
-	attProjectId.rep_.isAutoNumber_ = true;
-	attProjectId.rep_.null_ = false;
-	attList.push_back(attProjectId);}
-
-	{TeAttribute attName;
-	attName.rep_.name_ = "name";
-	attName.rep_.type_ = TeSTRING;
-	attName.rep_.numChar_ = 50;
-	attName.rep_.null_ = false;
-	attList.push_back(attName);}
-
-	{TeAttribute attLong0;
-	attLong0.rep_.name_ = "long0";
-	attLong0.rep_.type_ = TeREAL;
-	attLong0.rep_.decimals_ = 15;
-	attLong0.rep_.defaultValue_ = "0.0";
-	attList.push_back(attLong0);}
-
-	{TeAttribute attLat0;
-	attLat0.rep_.name_ = "lat0";
-	attLat0.rep_.type_ = TeREAL;
-	attLat0.rep_.decimals_ = 15;
-	attLat0.rep_.defaultValue_ = "0.0";
-	attList.push_back(attLat0);}
-
-	{TeAttribute attOffX;
-	attOffX.rep_.name_ = "offx";
-	attOffX.rep_.type_ = TeREAL;
-	attOffX.rep_.decimals_ = 15;
-	attOffX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attOffX);}
-
-	{TeAttribute attOffY;
-	attOffY.rep_.name_ = "offy";
-	attOffY.rep_.type_ = TeREAL;
-	attOffY.rep_.decimals_ = 15;
-	attOffY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attOffY);}
-
-	{TeAttribute attSlat1;
-	attSlat1.rep_.name_ = "stlat1";
-	attSlat1.rep_.type_ = TeREAL;
-	attSlat1.rep_.decimals_ = 15;
-	attSlat1.rep_.defaultValue_ = "0.0";
-	attList.push_back(attSlat1);}
-
-	{TeAttribute attSlat2;
-	attSlat2.rep_.name_ = "stlat2";
-	attSlat2.rep_.type_ = TeREAL;
-	attSlat2.rep_.decimals_ = 15;
-	attSlat2.rep_.defaultValue_ = "0.0";
-	attList.push_back(attSlat2);}
-
-	{TeAttribute attUnit;
-	attUnit.rep_.name_ = "unit";
-	attUnit.rep_.type_ = TeSTRING;
-	attUnit.rep_.numChar_ = 50;
-	attUnit.rep_.null_ = false;
-	attList.push_back(attUnit);}
-
-	{TeAttribute attScale;
-	attScale.rep_.name_ = "scale";
-	attScale.rep_.type_ = TeREAL;
-	attScale.rep_.decimals_ = 15;
-	attScale.rep_.defaultValue_ = "0.0";
-	attList.push_back(attScale);}
-
-	{TeAttribute attHemis;
-	attHemis.rep_.name_ = "hemis";
-	attHemis.rep_.type_ = TeINT;
-	attHemis.rep_.null_ = false;
-	attList.push_back(attHemis);}
-
-	{TeAttribute attDatum;
-	attDatum.rep_.name_ = "datum";
-	attDatum.rep_.type_ = TeSTRING;
-	attDatum.rep_.numChar_ = 50;
-	attDatum.rep_.null_ = false;
-	attList.push_back(attDatum);}
-
-	{TeAttribute attRadius;
-	attRadius.rep_.name_ = "radius";
-	attRadius.rep_.type_ = TeREAL;
-	attRadius.rep_.decimals_ = 15;
-	attRadius.rep_.defaultValue_ = "0.0";
-	attList.push_back(attRadius);}
-
-	{TeAttribute attFlattening;
-	attFlattening.rep_.name_ = "flattening";
-	attFlattening.rep_.type_ = TeREAL;
-	attFlattening.rep_.decimals_ = 15;
-	attFlattening.rep_.defaultValue_ = "0.0";
-	attList.push_back(attFlattening);}
-
-	{TeAttribute attDX;
-	attDX.rep_.name_ = "dx";
-	attDX.rep_.type_ = TeREAL;
-	attDX.rep_.decimals_ = 15;
-	attDX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attDX);}
-
-	{TeAttribute attDY;
-	attDY.rep_.name_ = "dy";
-	attDY.rep_.type_ = TeREAL;
-	attDY.rep_.decimals_ = 15;
-	attDY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attDY);}
-
-	{TeAttribute attDZ;
-	attDZ.rep_.name_ = "dz";
-	attDZ.rep_.type_ = TeREAL;
-	attDZ.rep_.decimals_ = 15;
-	attDZ.rep_.defaultValue_ = "0.0";
-	attList.push_back(attDZ);}
-
-	return createTable("te_projection", attList);
-}
-
-bool TeDatabase::createLayerTable ()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attLayerId;
-	attLayerId.rep_.name_ = "layer_id";
-	attLayerId.rep_.type_ = TeUNSIGNEDINT;
-	attLayerId.rep_.isPrimaryKey_ = true;
-	attLayerId.rep_.isAutoNumber_ = true;
-	attLayerId.rep_.null_ = false;
-	attList.push_back(attLayerId);}
-
-	{TeAttribute attProjectionId;
-	attProjectionId.rep_.name_ = "projection_id";
-	attProjectionId.rep_.type_ = TeUNSIGNEDINT;
-	attProjectionId.rep_.null_ = false;
-	attList.push_back(attProjectionId);}
-
-	{TeAttribute attName;
-	attName.rep_.name_ = "name";
-	attName.rep_.type_ = TeSTRING;
-	attName.rep_.numChar_ = 255;
-	attName.rep_.null_ = false;
-	attList.push_back(attName);}
-
-	{TeAttribute attLowerX;
-	attLowerX.rep_.name_ = "lower_x";
-	attLowerX.rep_.type_ = TeREAL;
-	attLowerX.rep_.decimals_ = 15;
-	attLowerX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attLowerX);}
-
-	{TeAttribute attLowerY;
-	attLowerY.rep_.name_ = "lower_y";
-	attLowerY.rep_.type_ = TeREAL;
-	attLowerY.rep_.decimals_ = 15;
-	attLowerY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attLowerY);}
-
-	{TeAttribute attUpperX;
-	attUpperX.rep_.name_ = "upper_x";
-	attUpperX.rep_.type_ = TeREAL;
-	attUpperX.rep_.decimals_ = 15;
-	attUpperX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attUpperX);}
-
-	{TeAttribute attUpperY;
-	attUpperY.rep_.name_ = "upper_y";
-	attUpperY.rep_.type_ = TeREAL;
-	attUpperY.rep_.decimals_ = 15;
-	attUpperY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attUpperY);}
-
-	{TeAttribute attInitialTime;
-	attInitialTime.rep_.name_ = "initial_time";
-	attInitialTime.rep_.type_ = TeDATETIME;
-	attList.push_back(attInitialTime);}
-
-	{TeAttribute attFinalTime;
-	attFinalTime.rep_.name_ = "final_time";
-	attFinalTime.rep_.type_ = TeDATETIME;
-	attList.push_back(attFinalTime);}
-
-	{TeAttribute attEditionTime;
-	attEditionTime.rep_.name_ = "edition_time";
-	attEditionTime.rep_.type_ = TeDATETIME;
-	attList.push_back(attEditionTime);}
-
-	if(!createTable("te_layer", attList))
-		return false;
-
-	string idxName = "te_idx_layer_proj";
-
-	if(!createIndex("te_layer", idxName, "projection_id"))
-		return false;
-
-	idxName = "te_idx_layer_name";
-
-	return createIndex("te_layer", idxName, "name");
-}
-
-bool TeDatabase::createLayerTableTable()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attTableId;
-	attTableId.rep_.name_ = "table_id";
-	attTableId.rep_.type_ = TeUNSIGNEDINT;
-	attTableId.rep_.isPrimaryKey_ = true;
-	attTableId.rep_.isAutoNumber_ = true;
-	attTableId.rep_.null_ = false;
-	attList.push_back(attTableId);}
-
-	{TeAttribute attLayerId;
-	attLayerId.rep_.name_ = "layer_id";
-	attLayerId.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attLayerId);}
-
-	{TeAttribute attTable;
-	attTable.rep_.name_ = "attr_table";
-	attTable.rep_.type_ = TeSTRING;
-	attTable.rep_.numChar_ = 255;
-	attTable.rep_.null_ = false;
-	attList.push_back(attTable);}
-
-	{TeAttribute attUniqueID;
-	attUniqueID.rep_.name_ = "unique_id";
-	attUniqueID.rep_.type_ = TeSTRING;
-	attUniqueID.rep_.numChar_ = 255;
-	attList.push_back(attUniqueID);}
-
-	{TeAttribute attLink;
-	attLink.rep_.name_ = "attr_link";
-	attLink.rep_.type_ = TeSTRING;
-	attLink.rep_.numChar_ = 255;
-	attList.push_back(attLink);}
-
-	{TeAttribute attAttrInitialTime;
-	attAttrInitialTime.rep_.name_ = "attr_initial_time";
-	attAttrInitialTime.rep_.type_ = TeSTRING;
-	attAttrInitialTime.rep_.numChar_ = 255;
-	attList.push_back(attAttrInitialTime);}
-
-	{TeAttribute attAttrFinalTime;
-	attAttrFinalTime.rep_.name_ = "attr_final_time";
-	attAttrFinalTime.rep_.type_ = TeSTRING;
-	attAttrFinalTime.rep_.numChar_ = 255;
-	attList.push_back(attAttrFinalTime);}
-
-	{TeAttribute attTimeUnit;
-	attTimeUnit.rep_.name_ = "attr_time_unit";
-	attTimeUnit.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attTimeUnit);}
-
-	{TeAttribute attTableType;
-	attTableType.rep_.name_ = "attr_table_type";
-	attTableType.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attTableType);}
-
-	{TeAttribute attUserName;
-	attUserName.rep_.name_ = "user_name";
-	attUserName.rep_.type_ = TeSTRING;
-	attUserName.rep_.numChar_ = 255;
-	attList.push_back(attUserName);}
-
-	{TeAttribute attInitialTime;
-	attInitialTime.rep_.name_ = "initial_time";
-	attInitialTime.rep_.type_ = TeDATETIME;
-	attList.push_back(attInitialTime);}
-
-	{TeAttribute attFinalTime;
-	attFinalTime.rep_.name_ = "final_time";
-	attFinalTime.rep_.type_ = TeDATETIME;
-	attList.push_back(attFinalTime);}
-
-	if(!createTable("te_layer_table", attList))
-		return false;
-
-	string idxName = "te_idx_layertable_layer";
-
-	if(!createIndex("te_layer_table", idxName, "layer_id"))
-		return false;
-
-	idxName = "te_idx_layertable_att";
-
-	return createIndex("te_layer_table", idxName, "attr_table");
-}
-
-bool 
-TeDatabase::updateTableInfo(int layerId, TeTable &table, const string user)
-{
-	if (table.id() <= 0 )  // table information doesn�t exist in database yet
-		return this->insertTableInfo(layerId,table,user);
-	string sql;
-	sql = "UPDATE te_layer_table SET ";
-	sql += "unique_id='" + table.uniqueName() + "', ";
-	sql += "attr_link='" + table.linkName() + "', ";
-	sql += "attr_initial_time='" + table.attInitialTime() + "', ";
-	sql += "attr_final_time='" + table.attFinalTime() + "', ";
-	sql += "attr_time_unit=" + Te2String(table.attTimeUnit()) + ", ";
-	sql += "attr_table_type="+ Te2String(table.tableType()) + ", ";
-	sql += "user_name='" + user + "' WHERE ";
-	sql += "layer_id=" + Te2String(layerId) + " AND ";
-	sql += "attr_table_name='" + table.name() + "'";
-	return execute (sql);
-}
-
-bool 
-TeDatabase::loadTableInfo(TeTable& table)
-{
-	if (table.name().empty())
-		return false;
-
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-	{
-		this->errorMessage_ = "N�o foi poss�vel abrir portal para o banco";
-		return false;
-	}
-	
-	//theme tables
-	string sel = " SELECT table_id, layer_id, attr_table, unique_id, ";
-	sel += " attr_link, attr_initial_time, attr_final_time, attr_time_unit, ";
-	sel += " attr_table_type, user_name, initial_time, final_time ";
-	sel += " FROM te_layer_table ";
-	sel += " WHERE  attr_table = '" + table.name() + "'";
-		
-	if ((!portal->query(sel)) || (!portal->fetchRow()))
-	{	
-		delete portal;
-		return false;
-	}
-	
-	if(!portal->getAttrTable(table))
-	{
-		delete portal;
-		return false;
-	}
-
-	TeAttributeList attrList;
-	getAttributeList(table.name(), attrList);
-	table.setAttributeList(attrList);
-	
-	if (table.tableType() == TeAttrExternal) //information about external table 
-	{
-		portal->freeResult();
-
-		sel = " SELECT te_layer_table.attr_table, te_tables_relation.related_table_id, ";
-		sel += " te_tables_relation.related_attr, te_tables_relation.external_attr  ";
-		sel += " FROM te_layer_table INNER JOIN te_tables_relation";
-		sel += " ON te_layer_table.table_id = te_tables_relation.related_table_id ";
-		sel += " WHERE  te_tables_relation.external_table_name = '" + table.name() + "'";
-
-		if (!portal->query(sel))
-		{	
-			delete portal;
-			return false;
-		}
-
-		if (!portal->fetchRow())
-		{
-			delete portal;
-			return true;
-		}
-		
-		int relatedTableId = portal->getInt(1); //related_table_id
-		string relatedTable = portal->getData(0); //static table name 
-		string relatedAttr = portal->getData(2); // static column name - related_attr
-        		
-		table.setTableType(TeAttrExternal, relatedTableId, relatedAttr);
-		table.relatedTableName(relatedTable);
-		table.setLinkName(portal->getData(3));  //external column name - external_attr
-	}
-	
-	delete portal;
-	return true;
-}
-
-
-bool TeDatabase::createLUTTable(const string& name)
-{
-	if(name.empty())
-		return false;
-
-	TeAttributeList attList;
-
-	{TeAttribute attIndexId;
-	attIndexId.rep_.name_ = "index_id";
-	attIndexId.rep_.type_ = TeUNSIGNEDINT;
-	attIndexId.rep_.isPrimaryKey_ = true;
-	attIndexId.rep_.null_ = false;
-	attList.push_back(attIndexId);}
-
-	{TeAttribute attRVal;
-	attRVal.rep_.name_ = "r_val";
-	attRVal.rep_.type_ = TeUNSIGNEDINT;
-	attRVal.rep_.null_ = false;
-	attList.push_back(attRVal);}
-
-	{TeAttribute attGVal;
-	attGVal.rep_.name_ = "g_val";
-	attGVal.rep_.type_ = TeUNSIGNEDINT;
-	attGVal.rep_.null_ = false;
-	attList.push_back(attGVal);}
-
-	{TeAttribute attBVal;
-	attBVal.rep_.name_ = "b_val";
-	attBVal.rep_.type_ = TeUNSIGNEDINT;
-	attBVal.rep_.null_ = false;
-	attList.push_back(attBVal);}
-
-	return createTable(name, attList);
-}
-
-bool TeDatabase::createTablesRelationTable()
-{
-	TeAttributeList attList;
-	
-	{TeAttribute attRelationId;
-	attRelationId.rep_.name_ = "relation_id";
-	attRelationId.rep_.type_ = TeUNSIGNEDINT;
-	attRelationId.rep_.isAutoNumber_ = true;
-	attRelationId.rep_.isPrimaryKey_ = true;
-	attRelationId.rep_.null_ = false;
-	attList.push_back(attRelationId);}
-
-	{TeAttribute attRelatedTableId;
-	attRelatedTableId.rep_.name_ = "related_table_id";
-	attRelatedTableId.rep_.type_ = TeINT;
-	attRelatedTableId.rep_.null_ = false;
-	attList.push_back(attRelatedTableId);}
-
-	{TeAttribute attRelatedAttr;
-	attRelatedAttr.rep_.name_ = "related_attr";
-	attRelatedAttr.rep_.type_ = TeSTRING;
-	attRelatedAttr.rep_.numChar_ = 255;
-	attRelatedAttr.rep_.null_ = false;
-	attList.push_back(attRelatedAttr);}
-
-	{TeAttribute attExternalTableName;
-	attExternalTableName.rep_.name_ = "external_table_name";
-	attExternalTableName.rep_.type_ = TeSTRING;
-	attExternalTableName.rep_.numChar_ = 255;
-	attExternalTableName.rep_.null_ = false;
-	attList.push_back(attExternalTableName);}
-
-	{TeAttribute attExternalAttr;
-	attExternalAttr.rep_.name_ = "external_attr";
-	attExternalAttr.rep_.type_ = TeSTRING;
-	attExternalAttr.rep_.numChar_ = 255;
-	attExternalAttr.rep_.null_ = false;
-	attList.push_back(attExternalAttr);}
-
-	return createTable("te_tables_relation", attList);
-}
-
-bool TeDatabase::createRepresentationTable ()
-{
-	TeAttributeList attList;
-	
-	{TeAttribute attRepresId;
-	attRepresId.rep_.name_ = "repres_id";
-	attRepresId.rep_.type_ = TeUNSIGNEDINT;
-	attRepresId.rep_.isAutoNumber_ = true;
-	attRepresId.rep_.isPrimaryKey_ = true;
-	attRepresId.rep_.null_ = false;
-	attList.push_back(attRepresId);}
-
-	{TeAttribute attLayerId;
-	attLayerId.rep_.name_ = "layer_id";
-	attLayerId.rep_.type_ = TeUNSIGNEDINT;
-	attLayerId.rep_.null_ = false;
-	attList.push_back(attLayerId);}
-
-	{TeAttribute attGeomType;
-	attGeomType.rep_.name_ = "geom_type";
-	attGeomType.rep_.type_ = TeINT;
-	attGeomType.rep_.null_ = false;
-	attList.push_back(attGeomType);}
-
-	{TeAttribute attGeomTable;
-	attGeomTable.rep_.name_ = "geom_table";
-	attGeomTable.rep_.type_ = TeSTRING;
-	attGeomTable.rep_.numChar_ = 255;
-	attGeomTable.rep_.null_ = false;
-	attList.push_back(attGeomTable);}
-
-	{TeAttribute attDescription;
-	attDescription.rep_.name_ = "description";
-	attDescription.rep_.type_ = TeSTRING;
-	attDescription.rep_.numChar_ = 255;
-	attList.push_back(attDescription);}
-
-	{TeAttribute attLowerX;
-	attLowerX.rep_.name_ = "lower_x";
-	attLowerX.rep_.type_ = TeREAL;
-	attLowerX.rep_.decimals_ = 15;
-	attLowerX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attLowerX);}
-
-	{TeAttribute attLowerY;
-	attLowerY.rep_.name_ = "lower_y";
-	attLowerY.rep_.type_ = TeREAL;
-	attLowerY.rep_.decimals_ = 15;
-	attLowerY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attLowerY);}
-
-	{TeAttribute attUpperX;
-	attUpperX.rep_.name_ = "upper_x";
-	attUpperX.rep_.type_ = TeREAL;
-	attUpperX.rep_.decimals_ = 15;
-	attUpperX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attUpperX);}
-
-	{TeAttribute attUpperY;
-	attUpperY.rep_.name_ = "upper_y";
-	attUpperY.rep_.type_ = TeREAL;
-	attUpperY.rep_.decimals_ = 15;
-	attUpperY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attUpperY);}
-
-	{TeAttribute attResX;
-	attResX.rep_.name_ = "res_x";
-	attResX.rep_.type_ = TeREAL;
-	attResX.rep_.decimals_ = 15;
-	attResX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attResX);}
-
-	{TeAttribute attResY;
-	attResY.rep_.name_ = "res_y";
-	attResY.rep_.type_ = TeREAL;
-	attResY.rep_.decimals_ = 15;
-	attResY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attResY);}
-
-	{TeAttribute attNumCols;
-	attNumCols.rep_.name_ = "num_cols";
-	attNumCols.rep_.type_ = TeINT;
-	attList.push_back(attNumCols);}
-
-	{TeAttribute attNumRows;
-	attNumRows.rep_.name_ = "num_rows";
-	attNumRows.rep_.type_ = TeINT;
-	attList.push_back(attNumRows);}
-
-	{TeAttribute attInitialTime;
-	attInitialTime.rep_.name_ = "initial_time";
-	attInitialTime.rep_.type_ = TeDATETIME;
-	attList.push_back(attInitialTime);}
-
-	{TeAttribute attFinalTime;
-	attFinalTime.rep_.name_ = "final_time";
-	attFinalTime.rep_.type_ = TeDATETIME;
-	attList.push_back(attFinalTime);}
-
-	if(!createTable("te_representation", attList))
-		return false;
-
-	string idxName = "te_idx_representation";
-
-	return createIndex("te_representation", idxName, "layer_id");
-}
-
-bool TeDatabase::createRasterMetadataTable(const string& tableName)
-{
-	if(tableName.empty())
-		return false;
-
-	TeAttributeList attList;
-	
-	{TeAttribute attGeomId;
-	attGeomId.rep_.name_ = "geom_id";
-	attGeomId.rep_.type_ = TeUNSIGNEDINT;
-	attGeomId.rep_.isPrimaryKey_ = true;
-	attGeomId.rep_.null_ = false;
-	attList.push_back(attGeomId);}
-
-	{TeAttribute attBandId;
-	attBandId.rep_.name_ = "band_id";
-	attBandId.rep_.type_ = TeUNSIGNEDINT;
-	attBandId.rep_.isPrimaryKey_ = true;
-	attBandId.rep_.null_ = false;
-	attList.push_back(attBandId);}
-
-	{TeAttribute attMinValue;
-	attMinValue.rep_.name_ = "min_value";
-	attMinValue.rep_.type_ = TeREAL;
-	attMinValue.rep_.decimals_ = 15;
-	attMinValue.rep_.defaultValue_ = "0.0";
-	attList.push_back(attMinValue);}
-
-	{TeAttribute attMaxValue;
-	attMaxValue.rep_.name_ = "max_value";
-	attMaxValue.rep_.type_ = TeREAL;
-	attMaxValue.rep_.decimals_ = 15;
-	attMaxValue.rep_.defaultValue_ = "0.0";
-	attList.push_back(attMaxValue);}
-
-	{TeAttribute attNumBits;
-	attNumBits.rep_.name_ = "num_bits";
-	attNumBits.rep_.type_ = TeINT;
-	attList.push_back(attNumBits);}
-
-	{TeAttribute attDatatype;
-	attDatatype.rep_.name_ = "data_type";
-	attDatatype.rep_.type_ = TeINT;
-	attList.push_back(attDatatype);}
-
-	{TeAttribute attPhotoType;
-	attPhotoType.rep_.name_ = "photometric_type";
-	attPhotoType.rep_.type_ = TeINT;
-	attList.push_back(attPhotoType);}
-
-	{TeAttribute attCompressType;
-	attCompressType.rep_.name_ = "compression_type";
-	attCompressType.rep_.type_ = TeINT;
-	attList.push_back(attCompressType);}
-
-	{TeAttribute attDummy;
-	attDummy.rep_.name_ = "dummy";
-	attDummy.rep_.type_ = TeREAL;
-	attDummy.rep_.decimals_ = 15;
-	attList.push_back(attDummy);}
-
-	return createTable(tableName, attList);
-}
-
-bool TeDatabase::createRasterTable(const string& tableName)
-{
-	if(tableName.empty())
-		return false;
-
-	TeAttributeList attList;
-	
-	{TeAttribute attGeomId;
-	attGeomId.rep_.name_ = "block_id";
-	attGeomId.rep_.type_ = TeSTRING;
-	attGeomId.rep_.numChar_ = 50;
-	attGeomId.rep_.isPrimaryKey_ = true;
-	attGeomId.rep_.null_ = false;
-	attList.push_back(attGeomId);}
-
-	{TeAttribute attSpatialData;
-	attSpatialData.rep_.name_ = "spatial_data";
-	attSpatialData.rep_.type_ = TeRASTERTYPE;
-	attList.push_back(attSpatialData);}
-
-	if(!createTable(tableName, attList))
-		return false;
-
-	string idxName = "te_idx_" + tableName + "_b";
-
-	return createIndex(tableName, idxName, "band_id");
-}
-
-bool TeDatabase::createRasterGeometry(const string& tableName)
-{
-	if(tableName.empty())
-		return false;
-
-	TeAttributeList attList;
-
-	{TeAttribute attGeomId;
-	attGeomId.rep_.name_ = "geom_id";
-	attGeomId.rep_.type_ = TeUNSIGNEDINT;
-	attGeomId.rep_.isAutoNumber_ = true;
-	attGeomId.rep_.isPrimaryKey_ = true;
-	attGeomId.rep_.null_ = false;
-	attList.push_back(attGeomId);}
-
-	{TeAttribute attObjId;
-	attObjId.rep_.name_ = "object_id";
-	attObjId.rep_.type_ = TeSTRING;
-	attObjId.rep_.numChar_ = 255;
-	attObjId.rep_.null_ = false;
-	attList.push_back(attObjId);}
-
-	{TeAttribute attRasterTable;
-	attRasterTable.rep_.name_ = "raster_table";
-	attRasterTable.rep_.type_ = TeSTRING;
-	attRasterTable.rep_.numChar_ = 255;
-	attRasterTable.rep_.null_ = false;
-	attList.push_back(attRasterTable);}
-
-	{TeAttribute attLutTable;
-	attLutTable.rep_.name_ = "lut_table";
-	attLutTable.rep_.type_ = TeSTRING;
-	attLutTable.rep_.numChar_ = 255;
-	attList.push_back(attLutTable);}
-
-	{TeAttribute attResX;
-	attResX.rep_.name_ = "res_x";
-	attResX.rep_.type_ = TeREAL;
-	attResX.rep_.decimals_ = 15;
-	attResX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attResX);}
-
-	{TeAttribute attResY;
-	attResY.rep_.name_ = "res_y";
-	attResY.rep_.type_ = TeREAL;
-	attResY.rep_.decimals_ = 15;
-	attResY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attResY);}
-
-	{TeAttribute attNumBands;
-	attNumBands.rep_.name_ = "num_bands";
-	attNumBands.rep_.type_ = TeINT;
-	attList.push_back(attNumBands);}
-
-	{TeAttribute attNumCols;
-	attNumCols.rep_.name_ = "num_cols";
-	attNumCols.rep_.type_ = TeINT;
-	attList.push_back(attNumCols);}
-
-	{TeAttribute attNumRows;
-	attNumRows.rep_.name_ = "num_rows";
-	attNumRows.rep_.type_ = TeINT;
-	attList.push_back(attNumRows);}
-
-	{TeAttribute attBlockHeight;
-	attBlockHeight.rep_.name_ = "block_height";
-	attBlockHeight.rep_.type_ = TeINT;
-	attList.push_back(attBlockHeight);}
-
-	{TeAttribute attBlockWidth;
-	attBlockWidth.rep_.name_ = "block_width";
-	attBlockWidth.rep_.type_ = TeINT;
-	attList.push_back(attBlockWidth);}
-
-	{TeAttribute attLowerX;
-	attLowerX.rep_.name_ = "lower_x";
-	attLowerX.rep_.type_ = TeREAL;
-	attLowerX.rep_.decimals_ = 15;
-	attLowerX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attLowerX);}
-
-	{TeAttribute attLowerY;
-	attLowerY.rep_.name_ = "lower_y";
-	attLowerY.rep_.type_ = TeREAL;
-	attLowerY.rep_.decimals_ = 15;
-	attLowerY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attLowerY);}
-
-	{TeAttribute attUpperX;
-	attUpperX.rep_.name_ = "upper_x";
-	attUpperX.rep_.type_ = TeREAL;
-	attUpperX.rep_.decimals_ = 15;
-	attUpperX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attUpperX);}
-
-	{TeAttribute attUpperY;
-	attUpperY.rep_.name_ = "upper_y";
-	attUpperY.rep_.type_ = TeREAL;
-	attUpperY.rep_.decimals_ = 15;
-	attUpperY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attUpperY);}
-
-	{TeAttribute attTilingType;
-	attTilingType.rep_.name_ = "tiling_type";
-	attTilingType.rep_.type_ = TeINT;
-	attList.push_back(attTilingType);}
-
-	if(!createTable(tableName, attList))
-		return  false;
-
-	string idxName = "te_idx_" + tableName;
-
-	return createIndex(tableName,  idxName, "object_id");
-}
-
-bool TeDatabase::createViewTable ()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attViewId;
-	attViewId.rep_.name_ = "view_id";
-	attViewId.rep_.type_ = TeUNSIGNEDINT;
-	attViewId.rep_.isPrimaryKey_ = true;
-	attViewId.rep_.isAutoNumber_ = true;
-	attViewId.rep_.null_ = false;
-	attList.push_back(attViewId);}
-
-	{TeAttribute attProjectionId;
-	attProjectionId.rep_.name_ = "projection_id";
-	attProjectionId.rep_.type_ = TeUNSIGNEDINT;
-	attProjectionId.rep_.null_ = false;
-	attList.push_back(attProjectionId);}
-
-	{TeAttribute attName;
-	attName.rep_.name_ = "name";
-	attName.rep_.type_ = TeSTRING;
-	attName.rep_.numChar_ = 255;
-	attName.rep_.null_ = false;
-	attList.push_back(attName);}
-
-	{TeAttribute attUserName;
-	attUserName.rep_.name_ = "user_name";
-	attUserName.rep_.type_ = TeSTRING;
-	attUserName.rep_.numChar_ = 255;
-	attList.push_back(attUserName);}
-
-	{TeAttribute attVisibility;
-	attVisibility.rep_.name_ = "visibility";
-	attVisibility.rep_.type_ = TeINT;
-	attList.push_back(attVisibility);}
-
-	{TeAttribute attLowerX;
-	attLowerX.rep_.name_ = "lower_x";
-	attLowerX.rep_.type_ = TeREAL;
-	attLowerX.rep_.decimals_ = 15;
-	attList.push_back(attLowerX);}
-
-	{TeAttribute attLowerY;
-	attLowerY.rep_.name_ = "lower_y";
-	attLowerY.rep_.type_ = TeREAL;
-	attLowerY.rep_.decimals_ = 15;
-	attList.push_back(attLowerY);}
-
-	{TeAttribute attUpperX;
-	attUpperX.rep_.name_ = "upper_x";
-	attUpperX.rep_.type_ = TeREAL;
-	attUpperX.rep_.decimals_ = 15;
-	attList.push_back(attUpperX);}
-
-	{TeAttribute attUpperY;
-	attUpperY.rep_.name_ = "upper_y";
-	attUpperY.rep_.type_ = TeREAL;
-	attUpperY.rep_.decimals_ = 15;
-	attList.push_back(attUpperY);}
-
-	{TeAttribute attCurrentTheme;
-	attCurrentTheme.rep_.name_ = "current_theme";
-	attCurrentTheme.rep_.type_ = TeINT;
-	attList.push_back(attCurrentTheme);}
-
-	if(!createTable("te_view", attList))
-		return false;
-
-	string idxName = "te_idx_view_projid";
-
-	if(!createIndex("te_view", idxName, "projection_id"))
-		return false;
-
-	idxName = "te_idx_view_name";
-
-	if(!createIndex("te_view", idxName, "name"))
-		return false;
-
-	idxName = "te_idx_view_user_name";
-
-	return createIndex("te_view", idxName, "user_name");
-}
-
-bool TeDatabase::createThemeTable ()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attThemeId;
-	attThemeId.rep_.name_ = "theme_id";
-	attThemeId.rep_.type_ = TeUNSIGNEDINT;
-	attThemeId.rep_.isPrimaryKey_ = true;
-	attThemeId.rep_.isAutoNumber_ = true;
-	attThemeId.rep_.null_ = false;
-	attList.push_back(attThemeId);}
-
-	{TeAttribute attLayerId;
-	attLayerId.rep_.name_ = "layer_id";
-	attLayerId.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attLayerId);}
-
-	{TeAttribute attViewId;
-	attViewId.rep_.name_ = "view_id";
-	attViewId.rep_.type_ = TeUNSIGNEDINT;
-	attViewId.rep_.null_ = false;
-	attList.push_back(attViewId);}
-
-	{TeAttribute attName;
-	attName.rep_.name_ = "name";
-	attName.rep_.type_ = TeSTRING;
-	attName.rep_.numChar_ = 255;
-	attName.rep_.null_ = false;
-	attList.push_back(attName);}
-
-	{TeAttribute attParentId;
-	attParentId.rep_.name_ = "parent_id";
-	attParentId.rep_.type_ = TeUNSIGNEDINT;
-	attParentId.rep_.null_ = false;
-	attList.push_back(attParentId);}
-
-	{TeAttribute attPriority;
-	attPriority.rep_.name_ = "priority";
-	attPriority.rep_.type_ = TeUNSIGNEDINT;
-	attPriority.rep_.null_ = false;
-	attList.push_back(attPriority);}
-
-	{TeAttribute attNodeType;
-	attNodeType.rep_.name_ = "node_type";
-	attNodeType.rep_.type_ = TeUNSIGNEDINT;
-	attNodeType.rep_.null_ = false;
-	attList.push_back(attNodeType);}
-
-	{TeAttribute attMinScale;
-	attMinScale.rep_.name_ = "min_scale";
-	attMinScale.rep_.type_ = TeREAL;
-	attMinScale.rep_.decimals_ = 15;
-	attList.push_back(attMinScale);}
-
-	{TeAttribute attMaxScale;
-	attMaxScale.rep_.name_ = "max_scale";
-	attMaxScale.rep_.type_ = TeREAL;
-	attMaxScale.rep_.decimals_ = 15;
-	attList.push_back(attMaxScale);}
-
-	{TeAttribute attGenAttWhere;
-	attGenAttWhere.rep_.name_ = "generate_attribute_where";
-	attGenAttWhere.rep_.type_ = TeSTRING;
-	attGenAttWhere.rep_.numChar_ = 0;
-	attList.push_back(attGenAttWhere);}
-
-	{TeAttribute attGenSpatWhere;
-	attGenSpatWhere.rep_.name_ = "generate_spatial_where";
-	attGenSpatWhere.rep_.type_ = TeSTRING;
-	attGenSpatWhere.rep_.numChar_ = 0;
-	attList.push_back(attGenSpatWhere);}
-
-	{TeAttribute attGenTempWhere;
-	attGenTempWhere.rep_.name_ = "generate_temporal_where";
-	attGenTempWhere.rep_.type_ = TeSTRING;
-	attGenTempWhere.rep_.numChar_ = 0;
-	attList.push_back(attGenTempWhere);}
-
-	{TeAttribute attCollectionT;
-	attCollectionT.rep_.name_ = "collection_table";
-	attCollectionT.rep_.type_ = TeSTRING;
-	attCollectionT.rep_.numChar_ = 255;
-	attList.push_back(attCollectionT);}
-
-	{TeAttribute attVisiRep;
-	attVisiRep.rep_.name_ = "visible_rep";
-	attVisiRep.rep_.type_ = TeINT;
-	attList.push_back(attVisiRep);}
-
-	{TeAttribute attEnableVis;
-	attEnableVis.rep_.name_ = "enable_visibility";
-	attEnableVis.rep_.type_ = TeINT;
-	attList.push_back(attEnableVis);}
-
-	{TeAttribute attLowerX;
-	attLowerX.rep_.name_ = "lower_x";
-	attLowerX.rep_.type_ = TeREAL;
-	attLowerX.rep_.decimals_ = 15;
-	attLowerX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attLowerX);}
-
-	{TeAttribute attLowerY;
-	attLowerY.rep_.name_ = "lower_y";
-	attLowerY.rep_.type_ = TeREAL;
-	attLowerY.rep_.decimals_ = 15;
-	attLowerY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attLowerY);}
-
-	{TeAttribute attUpperX;
-	attUpperX.rep_.name_ = "upper_x";
-	attUpperX.rep_.type_ = TeREAL;
-	attUpperX.rep_.decimals_ = 15;
-	attUpperX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attUpperX);}
-
-	{TeAttribute attUpperY;
-	attUpperY.rep_.name_ = "upper_y";
-	attUpperY.rep_.type_ = TeREAL;
-	attUpperY.rep_.decimals_ = 15;
-	attUpperY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attUpperY);}
-
-	{TeAttribute attCreationTime;
-	attCreationTime.rep_.name_ = "creation_time";
-	attCreationTime.rep_.type_ = TeDATETIME;
-	attList.push_back(attCreationTime);}
-
-	if(!createTable("te_theme", attList))
-		return false;	
-
-	string idxName = "te_idx_theme_view_id";
-
-	if(!createIndex("te_theme", idxName, "view_id"))
-		return false;
-
-	idxName = "te_idx_theme_name";
-
-	if(!createIndex("te_theme", idxName, "name"))
-		return false;
-
-	idxName = "te_idx_theme_layer_id";
-
-	return createIndex("te_theme", idxName, "layer_id");
-}
-
-bool TeDatabase::createGroupingTable()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attThemeId;
-	attThemeId.rep_.name_ = "theme_id";
-	attThemeId.rep_.type_ = TeUNSIGNEDINT;
-	attThemeId.rep_.isPrimaryKey_ = true;
-	attThemeId.rep_.null_ = false;
-	attList.push_back(attThemeId);}
-
-	{TeAttribute attGNumber;
-	attGNumber.rep_.name_ = "grouping_number";
-	attGNumber.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attGNumber);}
-
-	{TeAttribute attGAttr;
-	attGAttr.rep_.name_ = "grouping_attr";
-	attGAttr.rep_.type_ = TeSTRING;
-	attGAttr.rep_.numChar_ = 255;
-	attList.push_back(attGAttr);}
-
-	{TeAttribute attGAttrType;
-	attGAttrType.rep_.name_ = "grouping_attr_type";
-	attGAttrType.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attGAttrType);}
-
-	{TeAttribute attGMode;
-	attGMode.rep_.name_ = "grouping_mode";
-	attGMode.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attGMode);}
-
-	{TeAttribute attGNormAttr;
-	attGNormAttr.rep_.name_ = "grouping_norm_attr";
-	attGNormAttr.rep_.type_ = TeSTRING;
-	attGNormAttr.rep_.numChar_ = 255;
-	attList.push_back(attGNormAttr);}
-
-	{TeAttribute attGStdDev;
-	attGStdDev.rep_.name_ = "grouping_std_dev";
-	attGStdDev.rep_.type_ = TeREAL;
-	attGStdDev.rep_.decimals_ = 15;
-	attGStdDev.rep_.defaultValue_ = "0.0";
-	attList.push_back(attGStdDev);}
-
-	{TeAttribute attGPrec;
-	attGPrec.rep_.name_ = "grouping_precision";
-	attGPrec.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attGPrec);}
-
-	{TeAttribute attGFunc;
-	attGFunc.rep_.name_ = "grouping_function";
-	attGFunc.rep_.type_ = TeSTRING;
-	attGFunc.rep_.numChar_ = 20;
-	attList.push_back(attGFunc);}
-
-	{TeAttribute attGChronon;
-	attGChronon.rep_.name_ = "grouping_chronon";
-	attGChronon.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attGChronon);}
-
-	return createTable("te_grouping", attList);
-}
-
-bool TeDatabase::createThemeTablesTable()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attThemeTableId;
-	attThemeTableId.rep_.name_ = "theme_table_id";
-	attThemeTableId.rep_.type_ = TeUNSIGNEDINT;
-	attThemeTableId.rep_.isPrimaryKey_ = true;
-	attThemeTableId.rep_.isAutoNumber_ = true;
-	attThemeTableId.rep_.null_ = false;
-	attList.push_back(attThemeTableId);}
-
-	{TeAttribute attThemeId;
-	attThemeId.rep_.name_ = "theme_id";
-	attThemeId.rep_.type_ = TeUNSIGNEDINT;
-	attThemeId.rep_.null_ = false;
-	attList.push_back(attThemeId);}
-
-	{TeAttribute attTableId;
-	attTableId.rep_.name_ = "table_id";
-	attTableId.rep_.type_ = TeUNSIGNEDINT;
-	attTableId.rep_.null_ = false;
-	attList.push_back(attTableId);}
-
-	{TeAttribute attRelationId;
-	attRelationId.rep_.name_ = "relation_id";
-	attRelationId.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attRelationId);}
-
-	{TeAttribute attTableOrderId;
-	attTableOrderId.rep_.name_ = "table_order";
-	attTableOrderId.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attTableOrderId);}
-
-	if(!createTable("te_theme_table", attList))
-		return false;
-
-	string idxName = "te_idx_theme_table_id";
-
-	if(!createIndex("te_theme_table", idxName, "table_id"))
-		return false;
-
-	idxName = "te_idx_theme_relat_id";
-
-	if(!createIndex("te_theme_table", idxName, "relation_id"))
-		return false;
-
-	idxName = "te_idx_themetable_theme";
-
-	return createIndex("te_theme_table", idxName, "theme_id");
-}
-
-bool TeDatabase::createLegendTable ()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attLegendId;
-	attLegendId.rep_.name_ = "legend_id";
-	attLegendId.rep_.type_ = TeUNSIGNEDINT;
-	attLegendId.rep_.isPrimaryKey_ = true;
-	attLegendId.rep_.isAutoNumber_ = true;
-	attLegendId.rep_.null_ = false;
-	attList.push_back(attLegendId);	}
-
-	{TeAttribute attThemeId;
-	attThemeId.rep_.name_ = "theme_id";
-	attThemeId.rep_.type_ = TeUNSIGNEDINT;
-	attThemeId.rep_.null_ = false;
-	attList.push_back(attThemeId);}
-
-	{TeAttribute attGId;
-	attGId.rep_.name_ = "group_id";
-	attGId.rep_.type_ = TeINT;
-	attList.push_back(attGId);}
-
-	{TeAttribute attNObjs;
-	attNObjs.rep_.name_ = "num_objs";
-	attNObjs.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attNObjs);}
-
-	{TeAttribute attLValue;
-	attLValue.rep_.name_ = "lower_value";
-	attLValue.rep_.type_ = TeSTRING;
-	attLValue.rep_.numChar_ = 255;
-	attList.push_back(attLValue);}
-
-	{TeAttribute attUValue;
-	attUValue.rep_.name_ = "upper_value";
-	attUValue.rep_.type_ = TeSTRING;
-	attUValue.rep_.numChar_ = 255;
-	attList.push_back(attUValue);}
-
-	{TeAttribute attLabel;
-	attLabel.rep_.name_ = "label";
-	attLabel.rep_.type_ = TeSTRING;
-	attLabel.rep_.numChar_ = 255;
-	attList.push_back(attLabel);}
-	
-	if(!createTable("te_legend", attList))
-		return false;
-
-	string idxName = "te_idx_legend_theme";
-
-	return createIndex("te_legend", idxName, "theme_id");
-}
-
-bool TeDatabase::createVisualTable()
-{
-	TeAttributeList attList;
-
-	{TeAttribute attLegendId;
-	attLegendId.rep_.name_ = "legend_id";
-	attLegendId.rep_.type_ = TeUNSIGNEDINT;
-	attLegendId.rep_.isPrimaryKey_ = true;
-	attLegendId.rep_.null_ = false;
-	attList.push_back(attLegendId);}
-
-	{TeAttribute attGeomType;
-	attGeomType.rep_.name_ = "geom_type";
-	attGeomType.rep_.type_ = TeUNSIGNEDINT;
-	attGeomType.rep_.isPrimaryKey_ = true;
-	attGeomType.rep_.null_ = false;
-	attList.push_back(attGeomType);}
-
-	{TeAttribute attSymbId;
-	attSymbId.rep_.name_ = "symb_id";
-	attSymbId.rep_.type_ = TeINT;
-	attList.push_back(attSymbId);}
-
-	{TeAttribute attRed;
-	attRed.rep_.name_ = "red";
-	attRed.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attRed);}
-
-	{TeAttribute attGreen;
-	attGreen.rep_.name_ = "green";
-	attGreen.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attGreen);}
-
-	{TeAttribute attBlue;
-	attBlue.rep_.name_ = "blue";
-	attBlue.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attBlue);}
-
-	{TeAttribute attTransp;
-	attTransp.rep_.name_ = "transparency";
-	attTransp.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attTransp);}
-
-	{TeAttribute attWidth;
-	attWidth.rep_.name_ = "width";
-	attWidth.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attWidth);}
-
-	{TeAttribute attContourSymbId;
-	attContourSymbId.rep_.name_ = "contour_symb_id";
-	attContourSymbId.rep_.type_ = TeINT;
-	attList.push_back(attContourSymbId);}
-
-	{TeAttribute attContourRed;
-	attContourRed.rep_.name_ = "contour_red";
-	attContourRed.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attContourRed);}
-
-	{TeAttribute attContourGreen;
-	attContourGreen.rep_.name_ = "contour_green";
-	attContourGreen.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attContourGreen);}
-
-	{TeAttribute attContourBlue;
-	attContourBlue.rep_.name_ = "contour_blue";
-	attContourBlue.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attContourBlue);}
-
-	{TeAttribute attContourTransp;
-	attContourTransp.rep_.name_ = "contour_transp";
-	attContourTransp.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attContourTransp);}
-
-	{TeAttribute attContourWidth;
-	attContourWidth.rep_.name_ = "contour_width";
-	attContourWidth.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attContourWidth);}
-
-	{TeAttribute attSizeValue;
-	attSizeValue.rep_.name_ = "size_value";
-	attSizeValue.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attSizeValue);}
-
-	{TeAttribute attPtAngle;
-	attPtAngle.rep_.name_ = "pt_angle";
-	attPtAngle.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attPtAngle);}
-
-	{TeAttribute attFamily;
-	attFamily.rep_.name_ = "family";
-	attFamily.rep_.type_ = TeSTRING;
-	attFamily.rep_.numChar_ = 255;
-	attList.push_back(attFamily);}
-
-	{TeAttribute attBold;
-	attBold.rep_.name_ = "bold";
-	attBold.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attBold);}
-
-	{TeAttribute attItalic;
-	attItalic.rep_.name_ = "italic";
-	attItalic.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attItalic);}
-
-	{TeAttribute attAlignVert;
-	attAlignVert.rep_.name_ = "alignment_vert";
-	attAlignVert.rep_.type_ = TeREAL;
-	attAlignVert.rep_.decimals_ = 15;
-	attList.push_back(attAlignVert);}
-
-	{TeAttribute attAlignHoriz;
-	attAlignHoriz.rep_.name_ = "alignment_horiz";
-	attAlignHoriz.rep_.type_ = TeREAL;
-	attAlignHoriz.rep_.decimals_ = 15;
-	attList.push_back(attAlignHoriz);}
-
-	{TeAttribute attTabSize;
-	attTabSize.rep_.name_ = "tab_size";
-	attTabSize.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attTabSize);}
-
-	{TeAttribute attLineSpace;
-	attLineSpace.rep_.name_ = "line_space";
-	attLineSpace.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attLineSpace);}
-
-	{TeAttribute attFixedSize;
-	attFixedSize.rep_.name_ = "fixed_size";
-	attFixedSize.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attFixedSize);}
-
-	return createTable("te_visual", attList);
-}
-
-
-bool TeDatabase::createVisualRasterTable()
-{	
-	TeAttributeList attList;
-
-	{TeAttribute attThemeId;
-	attThemeId.rep_.name_ = "theme_id";
-	attThemeId.rep_.type_ = TeUNSIGNEDINT;
-	attThemeId.rep_.isPrimaryKey_ = true;
-	attThemeId.rep_.null_ = false;
-	attList.push_back(attThemeId);}
-
-	{TeAttribute attBandIn;
-	attBandIn.rep_.name_ = "band_in";
-	attBandIn.rep_.type_ = TeUNSIGNEDINT;
-	attBandIn.rep_.isPrimaryKey_ = true;
-	attBandIn.rep_.null_ = false;
-	attList.push_back(attBandIn);}
-
-	{TeAttribute attBandOut;
-	attBandOut.rep_.name_ = "band_out";
-	attBandOut.rep_.type_ = TeUNSIGNEDINT;
-	attList.push_back(attBandOut);}
-
-	{TeAttribute attTransfType;
-	attTransfType.rep_.name_ = "transf_type";
-	attTransfType.rep_.type_ = TeINT;
-	attList.push_back(attTransfType);}
-
-	{TeAttribute attParam1;
-	attParam1.rep_.name_ = "param1";
-	attParam1.rep_.type_ = TeREAL;
-	attParam1.rep_.decimals_ = 15;
-	attList.push_back(attParam1);}
-
-	{TeAttribute attParam2;
-	attParam2.rep_.name_ = "param2";
-	attParam2.rep_.type_ = TeREAL;
-	attParam2.rep_.decimals_ = 15;
-	attList.push_back(attParam2);}
-
-	{TeAttribute attLutTable;
-	attLutTable.rep_.name_ = "lut_table";
-	attLutTable.rep_.type_ = TeSTRING;
-	attLutTable.rep_.numChar_ = 255;
-	attList.push_back(attLutTable);}
-
-	return createTable("te_visual_raster", attList);
-}
-
-bool TeDatabase::insertVisual (TeLegendEntry *legend)
-{
-	TeGeomRepVisualMap::iterator it = legend->getVisualMap().begin();
-	while ( it != legend->getVisualMap().end())
-	{ 
-		string style("0"), contourStyle("0"), sizeValue("0"), width("0");
-
-		if(it->first == TePOLYGONS || it->first == TeCELLS)
-		{
-			contourStyle = Te2String(it->second->contourStyle());
-			style = Te2String(it->second->style());
-		}
-		else if(it->first == TeLINES)
-		{
-			width = Te2String(it->second->width());
-			style = Te2String(it->second->style());
-		}
-		else if(it->first == TePOINTS)
-		{
-			sizeValue = Te2String(it->second->size());
-			style = Te2String(it->second->style());
-		}
-		else if(it->first == TeTEXT)
-		{
-			sizeValue = Te2String(it->second->size());
-		}
-		
-		string insert = "INSERT INTO te_visual(legend_id, geom_type, ";
-		insert += " symb_id, "; 
-		insert += "red, green, blue, transparency, width, ";
-		insert += " contour_symb_id, "; 
-		insert += "contour_red, contour_green,";
-		insert += "contour_blue, contour_transp, contour_width, size_value,";
-		insert += "pt_angle, family, bold, italic, ";
-		insert += "alignment_vert, alignment_horiz, tab_size, line_space, fixed_size) ";
-		insert += " VALUES (";	
-		insert += Te2String(legend->id()) + ", ";
-		insert += Te2String(it->first)+ ", ";
-		insert += style + ", ";
-		insert += Te2String(it->second->color().red_) + ", ";
-		insert += Te2String(it->second->color().green_) + ", ";
-		insert += Te2String(it->second->color().blue_) + ", ";
-		insert += Te2String(it->second->transparency()) + ", ";
-		insert += width +",";
-		insert += contourStyle + ", ";
-		insert += Te2String(it->second->contourColor().red_) + ", ";
-		insert += Te2String(it->second->contourColor().green_) + ", ";
-		insert += Te2String(it->second->contourColor().blue_) + ", ";
-		insert += Te2String(it->second->contourTransparency()) + ", ";	
-		insert += Te2String(it->second->contourWidth()) + ", ";
-
-		insert += sizeValue +",";
-		insert += Te2String(it->second->ptAngle()) +", ";
-
-		insert += "'" + it->second->family() + "', ";
-		if (it->second->bold())
-			insert += "1, ";
-		else
-			insert += "0, ";
-		if (it->second->italic())
-			insert += "1, ";
-		else
-			insert += "0, ";
-		insert += Te2String(it->second->alignmentVert()) + ",";
-		insert += Te2String(it->second->alignmentHoriz()) + ",";
-		insert += Te2String(it->second->tabSize()) + ",";
-		insert += Te2String(it->second->lineSpace()) +",";
-		if (it->second->fixedSize())
-			insert += "1 ";
-		else
-			insert += "0";			
-		insert += ")";	
-
-		if (!execute(insert))
-			return false;
-		++it;
-	}
-	return true;
-}
-
-bool TeDatabase::createCollectionTable(const string& tableName)
-{
-	if(tableName.empty())
-		return false;
-
-	TeAttributeList attList;
-
-	{TeAttribute attCObjId;
-	attCObjId.rep_.name_ = "c_object_id";
-	attCObjId.rep_.type_ = TeSTRING;
-	attCObjId.rep_.numChar_ = 255;
-	attCObjId.rep_.isPrimaryKey_ = true;
-	attCObjId.rep_.null_ = false;
-	attList.push_back(attCObjId);}
-
-	{TeAttribute attCLegendId;
-	attCLegendId.rep_.name_ = "c_legend_id";
-	attCLegendId.rep_.type_ = TeINT;
-	attList.push_back(attCLegendId);}
-
-	{TeAttribute attLabelX;
-	attLabelX.rep_.name_ = "label_x";
-	attLabelX.rep_.type_ = TeREAL;
-	attLabelX.rep_.decimals_ = 15;
-	attList.push_back(attLabelX);}
-
-	{TeAttribute attLabelY;
-	attLabelY.rep_.name_ = "label_y";
-	attLabelY.rep_.type_ = TeREAL;
-	attLabelY.rep_.decimals_ = 15;
-	attList.push_back(attLabelY);}
-
-	{TeAttribute attCLegendOwn;
-	attCLegendOwn.rep_.name_ = "c_legend_own";
-	attCLegendOwn.rep_.type_ = TeINT;
-	attList.push_back(attCLegendOwn);}
-
-	{TeAttribute attCObjStatus;
-	attCObjStatus.rep_.name_ = "c_object_status";
-	attCObjStatus.rep_.type_ = TeINT;
-	attList.push_back(attCObjStatus);}
-
-	if(!createTable(tableName, attList))
-		return false;
-
-	string collectionId;
-	unsigned int pos = tableName.rfind("_");
-	if ( (pos != std::string::npos ) && (pos+1<tableName.size()) )
-       collectionId = tableName.substr(pos+1); 
-
-	string idxName = "te_idx_c" + collectionId  + "_clegid";
-
-	if(!createIndex(tableName, idxName, "c_legend_id"))
-		return false;
-
-	idxName = "te_idx_c" + collectionId + "_clegown";
-
-	return createIndex(tableName, idxName, "c_legend_own");
-}
-
-bool TeDatabase::createCellGeometry (const string& table)
-{
-	if(table.empty())
-		return false;
-
-	TeAttributeList attList;
-
-	{TeAttribute attGeomId;
-	attGeomId.rep_.name_ = "geom_id";
-	attGeomId.rep_.type_ = TeUNSIGNEDINT;
-	attGeomId.rep_.isAutoNumber_ = true;
-	attGeomId.rep_.isPrimaryKey_ = true;
-	attGeomId.rep_.null_ = false;
-	attList.push_back(attGeomId);}
-
-	{TeAttribute attObjId;
-	attObjId.rep_.name_ = "object_id";
-	attObjId.rep_.type_ = TeSTRING;
-	attObjId.rep_.numChar_ = 255;
-	attObjId.rep_.null_ = false;
-	attList.push_back(attObjId);}
-
-	{TeAttribute attSpatial;
-	attSpatial.rep_.name_ = "spatial_data";
-	attSpatial.rep_.type_ = TeCELLTYPE;
-	attList.push_back(attSpatial);}
-
-	if(!createTable(table, attList))
-		return false;
-
-	string idxName = "te_idx_"  + table + "obj";
-
-	if(!createIndex(table, idxName, "object_id"))
-		return false;
-
-	idxName = "te_idx_" + table + "_lc";
-
-	return createIndex(table, idxName, "row_number, col_number");
-}
-
-bool TeDatabase::createTextGeometry(const string& table)
-{
-	if(table.empty())
-		return false;
-
-	TeAttributeList attList;
-
-	{TeAttribute attGeomId;
-	attGeomId.rep_.name_ = "geom_id";
-	attGeomId.rep_.type_ = TeUNSIGNEDINT;
-	attGeomId.rep_.isAutoNumber_ = true;
-	attGeomId.rep_.isPrimaryKey_ = true;
-	attGeomId.rep_.null_ = false;
-	attList.push_back(attGeomId);}
-
-	{TeAttribute attObjId;
-	attObjId.rep_.name_ = "object_id";
-	attObjId.rep_.type_ = TeSTRING;
-	attObjId.rep_.numChar_ = 255;
-	attObjId.rep_.null_ = false;
-	attList.push_back(attObjId);}
-
-	{TeAttribute attX;
-	attX.rep_.name_ = "x";
-	attX.rep_.type_ = TeREAL;
-	attX.rep_.decimals_ = 15;
-	attX.rep_.defaultValue_ = "0.0";
-	attList.push_back(attX);}
-
-	{TeAttribute attY;
-	attY.rep_.name_ = "y";
-	attY.rep_.type_ = TeREAL;
-	attY.rep_.decimals_ = 15;
-	attY.rep_.defaultValue_ = "0.0";
-	attList.push_back(attY);}
-
-	{TeAttribute attTextValue;
-	attTextValue.rep_.name_ = "text_value";
-	attTextValue.rep_.type_ = TeSTRING;
-	attTextValue.rep_.numChar_ = 255;
-	attList.push_back(attTextValue);}
-
-	{TeAttribute attAngle;
-	attAngle.rep_.name_ = "angle";
-	attAngle.rep_.type_ = TeREAL;
-	attAngle.rep_.decimals_ = 15;
-	attAngle.rep_.defaultValue_ = "0.0";
-	attList.push_back(attAngle);}
-
-	{TeAttribute attHeight;
-	attHeight.rep_.name_ = "height";
-	attHeight.rep_.type_ = TeREAL;
-	attHeight.rep_.decimals_ = 15;
-	attHeight.rep_.defaultValue_ = "0.0";
-	attList.push_back(attHeight);}
-
-	{TeAttribute attAlignVert;
-	attAlignVert.rep_.name_ = "alignment_vert";
-	attAlignVert.rep_.type_ = TeREAL;
-	attAlignVert.rep_.decimals_ = 15;
-	attList.push_back(attAlignVert);}
-
-	{TeAttribute attAlignHoriz;
-	attAlignHoriz.rep_.name_ = "alignment_horiz";
-	attAlignHoriz.rep_.type_ = TeREAL;
-	attAlignHoriz.rep_.decimals_ = 15;
-	attList.push_back(attAlignHoriz);}
-
-	if(!createTable(table, attList))
-		return false;
-
-	string idxName = "te_idx_"  + table + "_obj";
-
-	if(!createIndex(table, idxName, "object_id"))
-		return false;
-
-	idxName = "te_idx_"  + table + "_pos";
-
-	return createIndex(table, idxName, "x, y");
-}
-
-bool TeDatabase::createNodeGeometry(const string& table)
-{
-	if(table.empty())
-		return false;
-
-	TeAttributeList attList;
-
-	{TeAttribute attGeomId;
-	attGeomId.rep_.name_ = "geom_id";
-	attGeomId.rep_.type_ = TeUNSIGNEDINT;
-	attGeomId.rep_.isAutoNumber_ = true;
-	attGeomId.rep_.isPrimaryKey_ = true;
-	attGeomId.rep_.null_ = false;
-	attList.push_back(attGeomId);}
-
-	{TeAttribute attObjId;
-	attObjId.rep_.name_ = "object_id";
-	attObjId.rep_.type_ = TeSTRING;
-	attObjId.rep_.numChar_ = 255;
-	attObjId.rep_.null_ = false;
-	attList.push_back(attObjId);}
-
-	{TeAttribute attSpatial;
-	attSpatial.rep_.name_ = "spatial_data";
-	attSpatial.rep_.type_ = TeNODETYPE;
-	attList.push_back(attSpatial);}
-
-	if(!createTable(table, attList))
-		return false;
-
-	string idxName = "te_idx_"  + table + "_obj";
-
-	return createIndex(table, idxName, "object_id");
-}
-
-bool TeDatabase::createPointGeometry(const string& table)
-{
-	if(table.empty())
-		return false;
-
-	TeAttributeList attList;
-
-	{TeAttribute attGeomId;
-	attGeomId.rep_.name_ = "geom_id";
-	attGeomId.rep_.type_ = TeUNSIGNEDINT;
-	attGeomId.rep_.isAutoNumber_ = true;
-	attGeomId.rep_.isPrimaryKey_ = true;
-	attGeomId.rep_.null_ = false;
-	attList.push_back(attGeomId);}
-
-	{TeAttribute attObjId;
-	attObjId.rep_.name_ = "object_id";
-	attObjId.rep_.type_ = TeSTRING;
-	attObjId.rep_.numChar_ = 255;
-	attObjId.rep_.null_ = false;
-	attList.push_back(attObjId);}
-
-	{TeAttribute attSpatial;
-	attSpatial.rep_.name_ = "spatial_data";
-	attSpatial.rep_.type_ = TePOINTTYPE;
-	attList.push_back(attSpatial);}
-
-	if(!createTable(table, attList))
-		return false;
-
-	string idxName = "te_idx_"  + table + "_obj";
-
-	return createIndex(table, idxName, "object_id");
-}
-
-bool TeDatabase::createArcGeometry(const string& table)
-{
-	if(table.empty())
-		return false;
-
-	TeAttributeList attList;
-
-	{TeAttribute attGeomId;
-	attGeomId.rep_.name_ = "geom_id";
-	attGeomId.rep_.type_ = TeUNSIGNEDINT;
-	attGeomId.rep_.isAutoNumber_ = true;
-	attGeomId.rep_.isPrimaryKey_ = true;
-	attGeomId.rep_.null_ = false;
-	attList.push_back(attGeomId);}
-
-	{TeAttribute attObjId;
-	attObjId.rep_.name_ = "object_id";
-	attObjId.rep_.type_ = TeSTRING;
-	attObjId.rep_.numChar_ = 255;
-	attObjId.rep_.null_ = false;
-	attList.push_back(attObjId);}
-
-	{TeAttribute attFromNode;
-	attFromNode.rep_.name_ = "from_node";
-	attFromNode.rep_.type_ = TeINT;
-	attFromNode.rep_.null_ = false;
-	attList.push_back(attFromNode);}
-
-	{TeAttribute attToNode;
-	attToNode.rep_.name_ = "to_node";
-	attToNode.rep_.type_ = TeINT;
-	attToNode.rep_.null_ = false;
-	attList.push_back(attToNode);}
-
-	if(!createTable(table, attList))
-		return false;
-
-	string idxName = "te_idx_"  + table + "_obj";
-
-	if(!createIndex(table, idxName, "object_id"))
-		return false;
-
-	idxName = "te_idx_"  + table + "_from";
-
-	if(!createIndex(table, idxName, "from_node"))
-		return false;
-
-	idxName = "te_idx_"  + table + "_to";
-
-	return createIndex(table, idxName, "to_node");
-}
-
-
-bool
-TeDatabase::insertTable	(TeTable &table)
-{
-	string tableName = table.name();
-	int size = table.size();
-	TeAttributeList att = table.attributeList();
-	TeAttributeList::iterator it = att.begin();
-	TeAttributeList::iterator itEnd = att.end();
-	TeTableRow row;
-	
-	int blobIndex=-1;
-	if (!beginTransaction())
-		return false;
-
-	int i;
-	unsigned int j;
-	for ( i = 0; i < size; i++ )	
-	{
-		row = table[i];
-		it = att.begin();
-		string attrs;
-		string values;
-		j = 1;
-		int jj = 0;
-		while ( it != itEnd )
-		{
-			if (row[jj].empty() || (*it).rep_.isAutoNumber_)
-			{
-				++it;
-				j++;
-				jj++;
-				continue;
-			}
-			
-			if (!values.empty())
-			{
-				attrs += ", ";
-				values += ", ";
-			}			
-			attrs += (*it).rep_.name_;			
-			switch ((*it).rep_.type_)
-			{
-			case TeSTRING:
-				values += "'"+ escapeSequence( row[jj] ) +"'";
-				break;
-			case TeREAL:
-				{
-				std::string strValue = row[jj];
-				replace(strValue.begin(), strValue.end(), ',', '.');
-				values += strValue;
-				}
-				break;
-			case TeINT:
-				values += row[jj];
-				break;
-			case TeDATETIME:
-				{
-					const string temp_dt = string(row[jj].c_str());
-					TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
-					values += this->getSQLTime(t);
-				}
-				break;
-			case TeCHARACTER:
-				values += "'" + escapeSequence(row[jj]) + "'";
-				break;
-			case TeBLOB:
-				blobIndex = jj;
-			default:
-				values += "'"+ escapeSequence(row[jj]) +"'";
-				break;
-			}
-			++it;
-			j++;
-			jj++;
-		}
-
-		if (values.empty()) 
-			continue;
-
-		string q = "INSERT INTO "+tableName + " ("+ attrs+") " + " VALUES ("+values+") ";
-		if (!execute(q)) 
-			continue;
-
-		//If there were blob type 
-		if(blobIndex>=0)
-		{
-			TeAttribute uniqueAttr;
-			table.attrUnique(uniqueAttr);
-			string uniqueValue;
-			int indexUniquePos = table.attrUniquePosition();
-			if(uniqueAttr.rep_.isAutoNumber_)
-			{
-				//we have to get the last autonumber inserted
-				string sql = " SELECT MAX("+ uniqueAttr.rep_.name_ +") FROM ";
-				sql += tableName;
-				TeDatabasePortal* portal = getPortal();
-				if(!portal)
-				{
-					rollbackTransaction();
-					return false;
-				}
-				if(!portal->query(sql) || !portal->fetchRow())
-				{
-					delete portal;
-					rollbackTransaction();
-					return false;
-				}
-				uniqueValue = portal->getData(0);
-				delete portal;
-			}
-			else
-				//we can use the unique value
-				uniqueValue = row[indexUniquePos];
-			
-			if(!insertBlob(tableName, att[blobIndex].rep_.name_, uniqueAttr.rep_, uniqueValue, 
-				(unsigned char*) row[blobIndex].c_str(), row[blobIndex].size()))
-			{
-				rollbackTransaction();
-				return false;
-			} 
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName)
-{
-	if(!tableExist(tableName))
-		return false;
-
-	string tab;
-
-	if(oldColName.empty())
-	{
-		tab = " ALTER TABLE " + tableName + " MODIFY ";
-		tab += rep.name_ +"  ";
-	}
-	else
-	{
-		tab = " ALTER TABLE " + tableName + " CHANGE ";
-		tab += oldColName +" "+ rep.name_ +"  ";
-	}
-
-	switch (rep.type_)
-	{
-		case TeSTRING:
-			tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
-			break;
-			
-		case TeREAL:
-			tab += "DOUBLE(24, 15)";	
-			break;
-			
-		case TeINT:
-			tab += "INT";
-			break;
-
-		case TeDATETIME:
-			tab += "DATETIME";
-			break;
-
-		case TeCHARACTER:
-			tab += "CHAR";
-			break;
-
-		case TeBLOB:
-			tab += "LONGBLOB";
-			break; 
-		
-		default:
-			tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
-			break;
-	}
-
-	tab += " NULL ";
-
-	if(!execute(tab))
-	{
-		if(errorMessage_.empty())
-			errorMessage_ = "Error alter table " + tableName + " !";
-		return false;
-	}
-
-	string tableId;
-	TeDatabasePortal* portal = getPortal();
-	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + tableName + "'";
-	if(portal->query(sql) && portal->fetchRow())
-		tableId = portal->getData(0);
-
-	delete portal;
-
-	if(tableId.empty() == false)
-	{
-		if(oldColName.empty() == false) // column name changed
-		{
-			 // update relation
-			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
-			sql += " WHERE related_table_id = " + tableId;
-			sql += " AND related_attr = '" + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-
-			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
-			sql += " WHERE external_table_name = '" + tableName + "'";
-			sql += " AND external_attr = '" + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-
-			 // update grouping
-			sql = "UPDATE te_grouping SET grouping_attr = '" + tableName + "." + rep.name_ + "'";
-			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-		}
-		else // column type changed
-		{
-			// delete relation
-			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
-			sql += " AND related_attr = '" + rep.name_ + "')";
-			sql += " OR (external_table_name = '" + tableName + "'";
-			sql += " AND external_attr = '" + rep.name_ + "')";
-			if(execute(sql) == false)
-				return false;
-
-			// delete grouping
-			TeDatabasePortal* portal = getPortal();
-			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
-			if(portal->query(sql) && portal->fetchRow())
-			{
-				string themeId = portal->getData(0);
-
-				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
-				if(execute(sql) == false)
-				{
-					delete portal;
-					return false;
-				}
-			}
-			delete portal;
-
-			sql = "DELETE FROM te_grouping";
-			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
-			if(execute(sql) == false)
-				return false;
-		}
-	}
-
-	alterTableInfoInMemory(tableName);
-	return true;
-}
-
-bool 
-TeDatabase::alterTable(const string& oldTableName, const string& newTablename)
-{
-	string sql = " ALTER TABLE "+ oldTableName +" RENAME "+ newTablename;
-	if(!execute(sql))
-		return false;
-
-	//update te_layer_table
-	sql = " UPDATE te_layer_table ";
-	sql += " SET attr_table = '"+ newTablename +"'";
-	sql += " WHERE attr_table = '"+ oldTableName +"'";
-	execute(sql);
-
-	//update te_tables_relation
-	sql = " UPDATE te_tables_relation ";
-	sql += " SET external_table_name = '"+ newTablename +"'";
-	sql += " WHERE external_table_name = '"+ oldTableName +"'";
-	execute(sql);
-	
-	alterTableInfoInMemory(newTablename, oldTableName);
-	return true;
-}
-
-bool 
-TeDatabase::insertBlob (const string& tableName, const string& columnBlob, TeAttributeRep& columnId, const string& valueId, unsigned char* data, int size)
-{
-	string whereClause = columnId.name_ +" = ";
-	switch (columnId.type_ )
-	{
-		case TeSTRING:
-			whereClause += "'"+ valueId + "'";
-			break;
-		default:
-			whereClause += valueId;
-			break;
-	}
-	return (insertBlob (tableName, columnBlob, whereClause, data, size));
-}
-
-bool 
-TeDatabase::insertBlob (const string& tableName, const string& columnBlob, TeAttributeRep& columnId, const string& valueId, const string& fileName)
-{
-	string whereClause = columnId.name_ +" = ";
-	switch (columnId.type_ )
-	{
-		case TeSTRING:
-			whereClause += "'"+ valueId + "'";
-			break;
-		default:
-			whereClause += valueId;
-			break;
-	}
-	return (insertBlob(tableName, columnBlob, whereClause, fileName));
-}
-
-bool 
-TeDatabase::insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, const string& fileName)
-{
-	unsigned char	*cdata = 0;
-	int		size;
-	FILE	*fp = 0;
-	
-	struct	stat buf;
-	int		result;
-	
-	result = stat(fileName.c_str(), &buf);
-	
-	if( result != 0 )
-		return false;
-	
-	size = buf.st_size;
-
-	cdata = new unsigned char[size];
-	fp = fopen(fileName.c_str(), "rb");
-	fread(cdata, sizeof(unsigned char), size, fp); 
-
-	bool status = insertBlob (tableName, columnBlob, whereClause, cdata, size);
-
-	if(fp)
-		fclose(fp);
-
-	if (cdata)
-		delete []cdata;
-
-	return status;
-}
-
-bool 
-TeDatabase::getAttrTables(TeAttrTableVector& atts, TeAttrTableType attType)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-	{
-		this->errorMessage_ = "N�o foi poss�vel abrir portal para o banco";
-		return false;
-	}
-	
-	// Get layer tables	
-	string get =  " SELECT * FROM te_layer_table"; 
-	if (attType != TeAllAttrTypes)
-		get += " WHERE attr_table_type = " + Te2String(attType);
-	if (!portal->query(get))
-	{	
-		delete portal;
-		return false;
-	}
-
-	while (portal->fetchRow())
-	{
-		TeTable attTable;
-		if(!portal->getAttrTable(attTable))
-		{
-			delete portal;
-			return false;
-		}
-		
-		TeAttributeList attrList;
-		getAttributeList(attTable.name(), attrList);
-		atts.push_back(attTable);
-	}
-	delete portal;
-	return (atts.size() > 0);
-}
-
-bool
-TeDatabase::updateTable	(TeTable &table)
-{
-	TeAttributeList& att = table.attributeList();
-	unsigned int i;
-	string uniqueVal;
-	bool isUniqueValString = false;
-	
-	if (!beginTransaction())
-		return false;
-
-	string uniqueName = table.uniqueName(); // primary key explicitly defined or 
-	if (table.uniqueName().empty())			// check in the attribute list
-	{								
-		for (i=0; i<att.size(); ++i)
-			if (att[i].rep_.isPrimaryKey_)
-			{
-				uniqueName = att[i].rep_.name_;
-				table.setUniqueName(uniqueName);
-				break;
-			}
-	}
-
-	int blobIndex = -1;
-	TeAttributeList::iterator it;
-	TeTableRow row;
-	unsigned int j;
-	bool useComma = false;
-	for (i = 0; i < table.size(); i++  )
-	{
-		row = table[i];
-		it = att.begin();
-		string q;
-		j = 1;
-		int jj = 0;
-		while ( it != att.end() )
-		{
-			if (uniqueName != (*it).rep_.name_)
-			{
-				if ((*it).rep_.isAutoNumber_)
-				{
-					++it;
-					j++;
-					jj++;
-					continue;
-				}			
-
-				if ((*it).rep_.type_ != TeBLOB)
-				{
-					if(useComma == true)
-					{
-						q += ", ";
-					}
-					else
-					{
-						useComma = true;
-					}
-					
-					q += (*it).rep_.name_ + " = ";
-	  				
-					if(row[jj].empty())
-					{
-						q += " null";
-
-						++it;
-						j++;
-						jj++;
-						continue;
-					}
-				}
-				
-  				switch ((*it).rep_.type_)
-  				{
-  					case TeSTRING:						
-						q += "'"+escapeSequence(row[jj])+"'";
-  					break;
-  					case TeREAL:
-					{
-						std::string value = row[jj];
-						replace(value.begin(), value.end(), ',', '.');
-						q += value;
-					}
-  					break;
-  					case TeINT:
-						q += row[jj];
-  					break;
-					case TeDATETIME:
-					{
-						const string temp_dt = string(row[jj].c_str());
-						TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
-						q += this->getSQLTime(t);
-					}
-  					break;
-					case TeCHARACTER:
-						q += "'" + escapeSequence(row[jj]) + "'";
-  					break;
-					case TeBLOB:
-						blobIndex = jj;
-  					break;
-  					default:
-						q += "'"+escapeSequence(row[jj])+"'";
-  					break;
-  				}
-				
-			}
-			else
-			{
-				uniqueVal = row[jj];
-				isUniqueValString = ((*it).rep_.type_ == TeSTRING);
-			}
-			++it;
-			j++;
-			jj++;
-		}
-		if (q.empty())
-			continue;
-		
-		if (!uniqueName.empty() && !uniqueVal.empty())  
-		{
-			if(isUniqueValString)
-				q += " WHERE " + uniqueName + " = '" + uniqueVal +"'";
-			else
-				q += " WHERE " + uniqueName + " = " + uniqueVal;
-		}
-		string sql = "UPDATE "+ table.name() + " SET " + q;
-		if (!execute(sql))
-		{
-			rollbackTransaction();
-			return false;
-		}
-
-		//verify if there was blob type
-		if(blobIndex>=0)
-		{
-			TeAttribute uniqueAttr;
-			table.attrUnique(uniqueAttr);
-			if(!insertBlob (table.name(), att[blobIndex].rep_.name_, uniqueAttr.rep_, uniqueVal, 
-				(unsigned char*)row[blobIndex].c_str(), row[blobIndex].size()))
-			{
-				rollbackTransaction();
-				return false;
-			}
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-
-bool 
-TeDatabase::loadTable(const string& tableName, TeTable &table)
-{
-	bool isreg = false;
-	table.name(tableName);
-	if (loadTableInfo(table)) // this is not a registered table...
-		isreg = true;
-
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	string q ="SELECT * FROM " + tableName;
-	if (!portal->query(q))
-	{	
-		delete portal;
-		return false;
-	}
-	if (!isreg)
-		table.setAttributeList(portal->getAttributeList());
-	while (portal->fetchRow())
-	{
-		TeTableRow row;
-		for (int j = 0; j < portal->numFields(); j++)
-		{
-           TeAttribute& attr = table.attributeList()[j];
-           if (attr.rep_.type_ == TeBLOB)
-           {
-               unsigned char* data = NULL;
-               long size = 0;
-               portal->getBlob (attr.rep_.name_, data, size);
-               string blobValue;
-               if (data != NULL)
-               {                                      
-				   blobValue.assign((char*)data, size);
-				   delete [] data;
-                   data = NULL;
-               }
-               row.push_back(blobValue);
-           }
-           else
-               row.push_back (portal->getData (j)); 
-		}
-		table.add(row);
-	}
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::selectTable (const string& tableName, const string& criteria, TeTable &table)
-{
-	bool isreg = false;
-	table.name(tableName);
-	if (loadTableInfo(table)) // this is not a registered table...
-		isreg = true;
-
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	string q ="SELECT * FROM " + tableName;
-	if (!criteria.empty())
-		q += " WHERE " + criteria;
-
-	if (!portal->query(q))
-	{	
-		delete portal;
-		return false;
-	}
-	if (!isreg)
-		table.setAttributeList(portal->getAttributeList());
-	while (portal->fetchRow())
-	{
-		TeTableRow row;
-		for(int i = 0; i < portal->numFields(); i++)
-			row.push_back(portal->getData(i));
-		table.add(row);
-	}
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::updateView (TeView *view)
-{
-	TeProjection* proj = view->projection();
-	if (proj)
-	{
-		if (proj->id() <= 0)
-			this->insertProjection(view->projection());
-		else
-			this->updateProjection(view->projection());
-	}
-	else
-	{
-		errorMessage_ = "N�o � poss�vel atualizar vista sem proje��o!";
-		return false;
-	}
-
-	string sql = "UPDATE te_view SET projection_id=" + Te2String(proj->id());
-	sql+= ", name='" + view->name() + "'";
-	sql+= ", user_name='" + view->user() + "'";
-	sql+= ", visibility= " + Te2String((int)view->isVisible());
-	sql+= ", lower_x = " + Te2String(view->getCurrentBox().lowerLeft().x());
-	sql+= ", lower_y = " + Te2String(view->getCurrentBox().lowerLeft().y());
-	sql+= ", upper_x = " + Te2String(view->getCurrentBox().upperRight().x());
-	sql+= ", upper_y = " + Te2String(view->getCurrentBox().upperRight().y());
-	if(view->getCurrentTheme() > 0)
-		sql+= ", current_theme = " + Te2String(view->getCurrentTheme());
-	else
-		sql+= ", current_theme = null";
-	sql +=" WHERE view_id = " + Te2String(view->id());
-
-	if (!this->execute (sql))
-		return false;
-
-	TeViewTree* tree = view->root();
-	if (tree) 
-		return	updateViewTree(tree);
-	return true;
-
-}
-
-
-bool 
-TeDatabase::loadViewSet (const string& user, const bool& loadAttrList, const string& visualType)
-{
-	//clear view map
-	TeViewMap::iterator it = metaModel_->viewMap().begin();
-	while (it != metaModel_->viewMap().end())
-	{
-		if(it->second)
-			delete it->second;
-		++it;
-	}
-	metaModel_->viewMap().clear();
-
-	//clear theme map
-	TeThemeMap::iterator itTheme = metaModel_->themeMap().begin();
-	while (itTheme != metaModel_->themeMap().end())
-	{
-		if(itTheme->second)
-			delete itTheme->second;
-		++itTheme;
-	}
-
-	//clear invalid theme map
-	itTheme = metaModel_->invalidThemeMap().begin();
-	while (itTheme != metaModel_->invalidThemeMap().end())
-	{
-		if(itTheme->second)
-			delete itTheme->second;
-		++itTheme;
-	}
-	metaModel_->invalidThemeMap().clear();
-	metaModel_->themeMap().clear();
-	metaModel_->legendMap().clear();
-	
-	//load view, projection, themes and grouping
-	string sql = " SELECT ";
-	sql += " te_view.*, "; //0-9  (10 columns)
-	sql += " te_projection.*, "; //10 - 26 (17 columns)
-	sql += " te_theme.*, "; // 27 - 46 (20 columns)
-	sql += " te_grouping.*, "; //47 - 56 (10 columns)
-	sql += " te_legend.*,  "; // 57 - 63    (7 columns)
-	sql += " te_visual.*, "; //  64 - 87 (24 columns)
-	sql += " te_visual_raster.* "; //  88 (7 columns)
-
-	sql += " FROM ((((((te_view INNER JOIN te_projection ";
-	sql += " ON te_view.projection_id = te_projection.projection_id) ";
-	sql += " LEFT JOIN te_theme ON te_view.view_id = te_theme.view_id ) ";
-	sql += " LEFT JOIN te_grouping ON te_theme.theme_id = te_grouping.theme_id) ";
-	sql += " LEFT JOIN te_legend ON te_theme.theme_id = te_legend.theme_id) ";
-	sql += " LEFT JOIN te_visual ON te_visual.legend_id = te_legend.legend_id) ";
-	sql += " LEFT JOIN te_visual_raster ON te_theme.theme_id = te_visual_raster.theme_id) ";
-			
-	sql += " WHERE ";
-	if (!user.empty())
-		sql += " te_view.user_name = '" + user + "'";
-	else
-		sql += " te_view.user_name = '" + this->user() + "'";
-	sql += " ORDER BY te_view.view_id, te_theme.priority, te_theme.theme_id, te_legend.legend_id, ";
-	sql += " te_legend.group_id, te_visual.geom_type, te_visual_raster.band_in  "; 
-
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-	
-	if (!portal->query(sql))
-	{	
-		delete portal;
-		return false;
-	}
-	
-	int lastViewId = -1;
-	TeView *view = 0;
-	bool hasNewRow = portal->fetchRow(); //idicates that this portal was fetched 
-	while(hasNewRow)
-	{
-		//load view and its projection 
-		if(lastViewId!=atoi(portal->getData(0)))
-		{
-			//store the last view
-			if(view)
-			{
-				metaModel_->viewMap()[view->id()] = view;
-				view = 0;
-			}
-			TeProjection* proj = 0;
-			if(!portal->getProjection(&proj, 10)) //load projection
-			{
-				delete portal;
-				return false;
-			}
-			view = new TeView();
-			if(!portal->getView(*view, 0)) //load view
-			{
-				delete portal;
-				delete view;
-				return false;
-			}
-			if (proj != 0)
-				view->projection(proj);
-			lastViewId = view->id();
-		}  
-		
-		//make the rigth object
-		string aux = portal->getData(27);
-		if (aux.empty())
-		{
-			hasNewRow = portal->fetchRow();
-			continue;
-		}
-		TeViewNodeType viewNodeType = (TeViewNodeType)portal->getInt(33);
-		TeViewNode* viewNode = TeViewNodeFactory::make(viewNodeType);
-
-		if(!viewNode)
-		{
-			int currentThemeId = portal->getInt(27);
-
-			while((hasNewRow = portal->fetchRow()) && (portal->getInt(27) == currentThemeId))
-				;
-
-			continue;
-		}
-
-		if(viewNodeType == TeTREE)
-		{
-			viewNode = loadViewTree(view, portal->getInt(27), loadAttrList, visualType); 
-			view->add(viewNode);
-
-			hasNewRow = portal->fetchRow();
-			continue;
-		}
-		else 
-		{
-			if(!portal->getTheme(static_cast<TeAbstractTheme&>(*viewNode), 27))
-			{
-				delete viewNode;
-				delete portal;
-				return false;
-			}
-
-			if(viewNodeType == TeTHEME)
-			{
-				//load layer
-				int id = static_cast<TeTheme*>(viewNode)->layerId();
-				TeLayerMap::iterator it = metaModel_->layerMap().find(id);
-				if (it == metaModel_->layerMap().end())
-					loadLayerSet(loadAttrList);
-				
-				static_cast<TeTheme*>(viewNode)->layer(metaModel_->layerMap()[id]);
-			}
-		}
-		
-		TeAbstractTheme* theme = static_cast<TeAbstractTheme*>(viewNode);
-
-		//load grouping 
-		TeGrouping group;
-		if(portal->getGrouping(group, 47))
-			theme->grouping(group);
-
-		//load all legends of this theme
-		//and its visual
-		bool hasLegsToThisTheme = true;
-		while(hasLegsToThisTheme)
-		{
-			//legend
-			TeLegendEntry legend;
-			if(!portal->getLegend(legend, 57))
-			{
-				delete theme;
-				delete view;
-				delete portal;
-				return false;
-			}
-
-			//visual
-			TeRasterVisual* rasterVisual = new TeRasterVisual();
-			bool hasVisualToThisLeg = true;
-			bool hasRasterVisual = false;
-			while(hasVisualToThisLeg)
-			{
-				TeVisual* visual = TeVisualFactory::make(visualType);
-				TeGeomRep geomRep;
-				if(portal->getVisual(visual, geomRep, 64))
-					legend.setVisual(visual, geomRep);
-									
-				if(portal->getRasterVisual(*rasterVisual, 88))
-					hasRasterVisual=true;
-				
-				hasNewRow = portal->fetchRow();
-				if(!hasNewRow || portal->getInt(59)!= legend.group() || portal->getInt(57)!= legend.id())
-					hasVisualToThisLeg = false;
-			}
-
-			//Set raster visual to this theme
-			if(hasRasterVisual)
-				theme->rasterVisual(rasterVisual);
-			else
-				delete rasterVisual;
-
-			//Set legend to this theme
-			theme->legend(legend); 
-															
-			//fill legend buffer
-			if(legend.group() == -6)	
-				metaModel_->legendMap()[legend.id()] = &theme->queryAndPointingLegend();
-			else if(legend.group() == -5)	
-				metaModel_->legendMap()[legend.id()] = &theme->queryLegend(); 
-			else if (legend.group() == -4)
-				metaModel_->legendMap()[legend.id()] = &theme->pointingLegend(); 
-			else if (legend.group() == -3)
-				metaModel_->legendMap()[legend.id()] = &theme->defaultLegend(); 
-			else if (legend.group() == -2)
-				metaModel_->legendMap()[legend.id()] = &theme->withoutDataConnectionLegend(); 
-			else if (legend.group() == -1)
-				metaModel_->legendMap()[legend.id()] = &theme->outOfCollectionLegend(); 
-			else if (legend.group() == -10) //own legend
-			{
-				TeLegendEntry* legendTemp = new TeLegendEntry(legend);
-				metaModel_->legendMap()[legend.id()] = legendTemp;
-			}				
-			
-			if(!hasNewRow || portal->getInt(27)!= theme->id())
-				hasLegsToThisTheme = false;
-		}
-			
-		for (unsigned int i = 0; i < theme->legend().size(); ++i)
-			metaModel_->legendMap()[theme->legend()[i].id()] = &theme->legend()[i];
-
-		if(viewNode->type()==(int)TeTHEME)
-		{
-			//load theme table
-			if(!loadThemeTable(static_cast<TeTheme*>(theme), loadAttrList))
-			{
-				delete portal;
-				return false;
-			}
-		}
-		
-		//load specific theme parameters
-		if(!theme->loadMetadata(this))
-		{
-			metaModel_->invalidThemeMap()[viewNode->id()] = theme;
-			continue;
-		}
-
-		metaModel_->themeMap()[viewNode->id()] = theme;
-		view->add(viewNode);
-	}
-
-	//store the last view
-	if(view)
-	{
-		metaModel_->viewMap()[view->id()] = view;
-		view = 0;
-	}
-
-	delete portal;
-	return true;
-	
-}
-
-TeViewTree* 
-TeDatabase::loadViewTree(TeView* view, int id, const bool& loadAttrList, const string& visualType)
-{
-	if( view == 0) 
-		return 0;
-	
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return 0;
-
-	string q;
-	TeViewTree *node = 0;
-
-	if (id != 0)
-	{
-		q = "SELECT * FROM te_theme";
-		q += " WHERE view_id = " + Te2String (view->id());
-		q += " AND theme_id = " + Te2String(id);
-
-		if (!portal->query(q) || !portal->fetchRow())
-		{
-			delete portal;
-			return 0;
-		}
-		TeViewNodeType type = (TeViewNodeType)portal->getInt("node_type");
-		if(type != TeTREE)
-		{
-			portal->freeResult();
-			delete portal;
-			return NULL;
-		}
-		node = portal->getViewTree();
-		portal->freeResult();
-	}
-
-	q ="SELECT * FROM te_theme";
-	q += " WHERE view_id = " + Te2String (view->id());
-	q += " AND parent_id = " + Te2String(id);
-	q += " ORDER BY priority ASC";
-
-	if (!portal->query(q))
-	{
-		delete portal;
-		return node;
-	}
-
-	while (portal->fetchRow())
-	{
-		TeViewNodeType childType = (TeViewNodeType)portal->getInt("node_type");
-		TeViewNode *childNode;
-		if (childType == TeTHEME)
-		{
-			childNode = new TeTheme();
-			childNode->id(portal->getInt(0));
-			this->loadTheme((TeTheme*)childNode, loadAttrList, visualType);
-		} 
-		else
-		{
-			childNode = loadViewTree(view, portal->getInt("theme_id"), loadAttrList, visualType);
-		}
-
-		if(id == 0)
-		{
-			view->add(childNode);
-		} 
-		else
-		{
-//			view->addTheme(childNode);
-			node->add(childNode);
-		}
-	}
-	delete portal;
-	return node;
-}
-
-bool 
-TeDatabase::loadView (TeView* view, const bool& loadAttrList, const string& visualType)
-{
-	string rest;
-	if (view->id() > 0)
-		rest = " te_view.view_id=" + Te2String(view->id());
-	else if (!view->name().empty())
-	{
-		rest = " te_view.name='" + view->name() + "'";
-		
-		if(!view->user().empty())
-			rest += " AND te_view.user_name='" + view->user() + "'"; 
-	}
-	else
-		return false;
-	
-	//load view, projection, themes and grouping
-	string sql = " SELECT ";
-	sql += " te_view.*, "; //0-9  (10 columns)
-	sql += " te_projection.*, "; //10 - 26 (17 columns)
-	sql += " te_theme.*, "; // 27 - 46 (20 columns)
-	sql += " te_grouping.*, "; //47 - 56 (10 columns)
-	sql += " te_legend.*,  "; // 57 - 63    (7 columns)
-	sql += " te_visual.*, "; //  64 - 87 (24 columns)
-	sql += " te_visual_raster.* "; //  88 (7 columns)
-
-	sql += " FROM ((((((te_view INNER JOIN te_projection ";
-	sql += " ON te_view.projection_id = te_projection.projection_id) ";
-	sql += " LEFT JOIN te_theme ON te_view.view_id = te_theme.view_id ) ";
-	sql += " LEFT JOIN te_grouping ON te_theme.theme_id = te_grouping.theme_id) ";
-	sql += " LEFT JOIN te_legend ON te_theme.theme_id = te_legend.theme_id) ";
-	sql += " LEFT JOIN te_visual ON te_visual.legend_id = te_legend.legend_id) ";
-	sql += " LEFT JOIN te_visual_raster ON te_theme.theme_id = te_visual_raster.theme_id) ";
-			
-	sql += " WHERE "+ rest;
-	sql += " ORDER BY te_view.view_id, te_theme.priority, te_theme.theme_id, te_legend.legend_id, ";
-	sql += " te_legend.group_id, te_visual.geom_type, te_visual_raster.band_in  "; 
-
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-	
-	if (!portal->query(sql) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-	//load projection
-	TeProjection* proj = 0;
-	if(!portal->getProjection(&proj, 10)) 
-	{
-		delete portal;
-		return false;
-	}
-	//load view		
-	if(!portal->getView(*view, 0)) 
-	{
-		delete portal;
-		return false;
-	}
-	if (proj != 0)
-		view->projection(proj);
-	
-	bool hasNewRow = true;
-
-	while(hasNewRow)
-	{
-		string aux = portal->getData(27);
-		if (aux.empty())
-		{
-			hasNewRow = portal->fetchRow();
-			continue;
-		}
-		TeViewNodeType viewNodeType = (TeViewNodeType)portal->getInt(33);
-		//make the rigth object
-		TeViewNode* viewNode = TeViewNodeFactory::make(viewNodeType);
-
-		if(!viewNode)
-		{
-			int currentThemeId = portal->getInt(27);
-
-			while((hasNewRow = portal->fetchRow()) && (portal->getInt(27) == currentThemeId))
-				;
-
-			continue;
-		}
-
-		if(viewNodeType == TeTREE)
-		{
-			viewNode = loadViewTree(view, portal->getInt(27), loadAttrList, visualType); 
-			view->add(viewNode);
-			hasNewRow = portal->fetchRow();
-			continue;
-		}
-		else 
-		{
-			if(!portal->getTheme(static_cast<TeAbstractTheme&>(*viewNode), 27))
-			{
-				delete viewNode;
-				delete portal;
-				return false;
-			}
-
-			if(viewNodeType == TeTHEME)
-			{
-				//load layer
-				int id = static_cast<TeTheme*>(viewNode)->layerId();
-				TeLayerMap::iterator it = metaModel_->layerMap().find(id);
-				if (it == metaModel_->layerMap().end())
-					loadLayerSet(loadAttrList);
-				
-				static_cast<TeTheme*>(viewNode)->layer(metaModel_->layerMap()[id]);
-			}
-		}
-		
-		TeAbstractTheme* abstractTheme = static_cast<TeAbstractTheme*>(viewNode);
-
-		//load grouping 
-		TeGrouping group;
-		if(portal->getGrouping(group, 47))
-			abstractTheme->grouping(group);
-
-		//load all legends of this theme
-		//and its visual
-		bool hasLegsToThisTheme = true;
-		while(hasLegsToThisTheme)
-		{
-			//legend
-			TeLegendEntry legend;
-			if(!portal->getLegend(legend, 57))
-			{
-				delete viewNode;
-				delete portal;
-				return false;
-			}
-
-			//visual
-			TeRasterVisual* rasterVisual = new TeRasterVisual();
-			bool hasVisualToThisLeg = true;
-			bool hasRasterVisual = false;
-			while(hasVisualToThisLeg)
-			{
-				TeVisual* visual = TeVisualFactory::make(visualType);
-				TeGeomRep geomRep;
-				if(portal->getVisual(visual, geomRep, 64))
-					legend.setVisual(visual, geomRep);
-									
-				if(portal->getRasterVisual(*rasterVisual, 88))
-					hasRasterVisual=true;
-				
-				hasNewRow = portal->fetchRow();
-				if(!hasNewRow || portal->getInt(59)!= legend.group() || portal->getInt(57)!= legend.id())
-					hasVisualToThisLeg = false;
-			}
-
-			//Set raster visual to this theme
-			if(hasRasterVisual)
-				abstractTheme->rasterVisual(rasterVisual);
-			else
-				delete rasterVisual;
-
-			//Set legend to this theme
-			abstractTheme->legend(legend); 
-															
-			//fill legend buffer
-			if(legend.group() == -6)	
-				metaModel_->legendMap()[legend.id()] = & abstractTheme->queryAndPointingLegend();
-			else if(legend.group() == -5)	
-				metaModel_->legendMap()[legend.id()] = & abstractTheme->queryLegend(); 
-			else if (legend.group() == -4)
-				metaModel_->legendMap()[legend.id()] = & abstractTheme->pointingLegend(); 
-			else if (legend.group() == -3)
-				metaModel_->legendMap()[legend.id()] = & abstractTheme->defaultLegend(); 
-			else if (legend.group() == -2)
-				metaModel_->legendMap()[legend.id()] = & abstractTheme->withoutDataConnectionLegend(); 
-			else if (legend.group() == -1)
-				metaModel_->legendMap()[legend.id()] = & abstractTheme->outOfCollectionLegend(); 
-			else if (legend.group() == -10) //own legend
-			{
-				TeLegendEntry* legendTemp = new TeLegendEntry(legend);
-				metaModel_->legendMap()[legend.id()] = legendTemp;
-			}	
-			
-			if(!hasNewRow || portal->getInt(27)!= abstractTheme->id())
-				hasLegsToThisTheme = false;
-		}				
-			
-		for (unsigned int i = 0; i < abstractTheme->legend().size(); ++i)
-			metaModel_->legendMap()[abstractTheme->legend()[i].id()] = & abstractTheme->legend()[i];
-		
-		if(viewNode->type()==(int)TeTHEME)
-		{
-			//load theme table
-			if(!loadThemeTable(static_cast<TeTheme*>(abstractTheme), loadAttrList))
-			{
-				delete portal;
-				return false;
-			}
-		}
-		
-		//load specific theme parameters
-		if(!abstractTheme->loadMetadata(this))
-		{
-			metaModel_->invalidThemeMap()[viewNode->id()] = abstractTheme;
-			continue;
-		}
-		
-		metaModel_->themeMap()[viewNode->id()] = abstractTheme;
-		view->add(viewNode);
-	}
-
-	metaModel_->viewMap()[view->id()] = view;
-	delete portal;
-	return true;
-}
-
-
-void
-TeDatabase::clear()
-{
-	metaModel_->clear();
-}
-
-bool 
-TeDatabase::deleteView (int viewId)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	// view projection should be deleted manually
-	string sql =  "SELECT projection_id FROM te_view WHERE view_id=" + Te2String(viewId);
-	portal->freeResult();
-	if (!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-	if (!portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	string projId = portal->getData("projection_id");
-	portal->freeResult();
-	
-	// delete themes belonging to this view 
-	sql = "SELECT theme_id FROM te_theme WHERE view_id=" + Te2String(viewId);
-	if (!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-	while (portal->fetchRow())
-	{
-		int id = atoi(portal->getData(0));
-		if(deleteTheme(id) == false)
-		{	
-			delete portal;
-			return false;
-		}
-	}
-
-	//delete the entries in the project relation
-	if (existRelation("te_project_view","fk_projectview_view_id") != TeRICascadeDeletion)
-	{
-		sql = "DELETE FROM te_project_view WHERE view_id =" + Te2String(viewId);
-		if (!this->execute (sql))
-			return false;
-	}
-
-	// delete view
-	sql = "DELETE FROM te_view WHERE view_id = " + Te2String(viewId);
-	if (!this->execute (sql))
-	{
-		delete portal;
-		return false;
-	}
-
-	sql = "DELETE FROM te_projection WHERE  projection_id = " + projId;
-	if (!this->execute (sql))
-	{
-		delete portal;
-		return false;
-	}
-
-	// Delete the view and its themes
-	TeView* view = metaModel_->viewMap()[viewId];
-	metaModel_->viewMap().erase(viewId);
-	delete view;
-	delete portal;
-	return true;
-}
-
-bool
-TeDatabase::updateViewTree (TeViewTree *tree)
-{
-	if(tree ->type() == 1) //tree->id() > 0) //only for TeTREE
-	{
-		string sql;
-		sql = "UPDATE te_theme SET ";
-		sql += "name='" + tree->name()+"'";
-		sql += ", parent_id=" + Te2String (tree->parentId());
-		sql += ", node_type=" + Te2String (tree->type());
-		sql += " ,priority=" + Te2String (tree->priority());
-		sql += " WHERE theme_id = " + Te2String(tree->id());
-
-		if(!this->execute (sql)) return false;
-	}
-
-	for (unsigned int th=0; th<tree->size(); th++)
-	{
-		TeViewNode* node = tree->retrieve(th);
-		if (node->type() == TeTREE)
-		{
-			TeViewTree* tree = (TeViewTree*)node;
-			if(!updateViewTree(tree)) return false;
-		}
-		else
-		{
-			TeTheme *theme = (TeTheme*)node;
-			if(!updateTheme(theme)) return false;
-		}
-	}
-	return true;
-}
-
-bool 
-TeDatabase::viewExist(string viewName)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	viewName = TeConvertToUpperCase(viewName);
-
-	string sql = "SELECT name FROM te_view";
-	if (!portal->query(sql))
-	{	
-		delete portal;
-		return false;
-	}
-	while (portal->fetchRow())
-	{
-		string name = portal->getData(0);
-		name = TeConvertToUpperCase(name);
-		if (viewName == name)
-		{
-			delete portal;
-			return true;
-		}
-	}
-	delete portal;
-	return false;
-}
-
-
-bool
-TeDatabase::updateTheme (TeAbstractTheme *theme)
-{
-	string sql;
-
-	if (theme->id() <= 0 )  // theme doesn�t exist in the database yet
-	{
-		return this->insertTheme(theme);
-	}
-	
-	// update theme metadata
-	sql = "UPDATE te_theme SET ";
-	
-	if(theme->type()==TeTHEME)
-	{
-		sql += " layer_id=" + Te2String (static_cast<TeTheme*>(theme)->layerId());
-		sql += ", ";
-	}
-	
-	sql += "  view_id=" + Te2String (theme->view());
-	sql += ", name='" + escapeSequence(theme->name())+"'";
-	sql += ", parent_id=" + Te2String (theme->parentId());
-	sql += ", priority=" + Te2String (theme->priority());
-	sql += ", node_type=" + Te2String (theme->type());
-	sql += ", min_scale=" + Te2String (theme->minScale(),15);
-	sql += ", max_scale=" + Te2String (theme->maxScale(),15);
-	sql += ", generate_attribute_where='" + escapeSequence(theme->attributeRest())+"'";
-	sql += ", generate_spatial_where='" + escapeSequence(theme->spatialRest())+"'";
-	sql += ", generate_temporal_where='" + escapeSequence(theme->temporalRest())+"'";
-
-	if(theme->type()==TeTHEME || theme->type()==TeEXTERNALTHEME )
-		sql += ", collection_table='" + static_cast<TeTheme*>(theme)->collectionTable() + "'";
-
-	sql += ", visible_rep= " + Te2String(theme->visibleRep ());
-	sql += ", enable_visibility= " + Te2String(theme->visibility()); 
-	sql += ", lower_x = " + Te2String(theme->box().x1(), 15); 
-	sql += ", lower_y = " + Te2String(theme->box().y1(), 15); 
-	sql += ", upper_x = " + Te2String(theme->box().x2(), 15); 
-	sql += ", upper_y = " + Te2String(theme->box().y2(), 15);
-	if(theme->getCreationTime().isValid())
-	{
-		TeTime creationTime = theme->getCreationTime();
-		sql += ", creation_time = " + this->getSQLTime(creationTime);
-	}
-
-	sql += " WHERE theme_id=" + Te2String (theme->id(), 15);
-
-	if (!this->execute (sql))
-		return false;
-         
-	//delete grouping 
-	sql = "DELETE FROM te_grouping WHERE theme_id= "+ Te2String(theme->id());
-	this->execute (sql);
-		
-	if(theme->grouping().groupMode_ != TeNoGrouping)
-	{
-		if(!insertGrouping(theme->id(), theme->grouping()))
-			return false;
-	}
-	
-	// update each of its legends
-	bool status = true;
-	
-	if(theme->legend().size() == 0)
-	{
-		if(!deleteLegend(theme->id()))
-			return false;
-	}
-	else
-	{
-		status = updateLegend(theme->legend());
-		if (!status)
-			return status;
-	}
-
-	status = updateLegend(&(theme->withoutDataConnectionLegend()));
-	if (!status)
-		return status;
-
-	status = updateLegend(&(theme->outOfCollectionLegend()));
-	if (!status)
-		return status;
-
-	status = updateLegend(&(theme->defaultLegend()));
-	if (!status)
-		return status;
-
-	status = updateLegend(&(theme->pointingLegend()));
-	if (!status)
-		return status;
-
-	status = updateLegend(&(theme->queryLegend()));
-	if (!status)
-		return status;
-
-	status = updateLegend(&(theme->queryAndPointingLegend()));
-	if (!status)
-		return status;
-	
-	//insert metadata theme
-	if(!theme->saveMetadata(this))
-		return false;
-
-	// theme tables
-	if(theme->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(theme)))
-		return false;
-
-	return true;
-}
-
-bool
-TeDatabase::loadTheme (TeAbstractTheme* theme, const bool& loadAttrList, const string& visualType)
-{
-	if (theme == 0)
-		return false;
-
-	string rest;
-	if (theme->id() > 0)
-		rest = " te_theme.theme_id = "+  Te2String(theme->id());
-	else if (!theme->name().empty())
-		rest = " te_theme.name = '"+  theme->name() + "'";
-	else
-	{
-		this->errorMessage_ = "Theme procurado n�o possui nem id nem nome";
-		return false;
-	}
-	rest += " AND te_view.user_name = \'" + this->user() +"\'";
-	
-	//load view, projection, themes and grouping
-	string sql = " SELECT ";
-	sql += " te_theme.*, "; // 0 - 19 (20 columns)   
-	sql += " te_grouping.*, "; //20 - 29 (10 columns)
-	sql += " te_legend.*,  "; // 30 - 36    (7 columns)
-	sql += " te_visual.*, "; //  37 - 60 (24 columns)
-	sql += " te_visual_raster.* "; //  61 (7 columns)
-	sql += " FROM (((((te_view INNER JOIN te_theme ON te_view.view_id = te_theme.view_id) ";
-	sql += " LEFT JOIN te_grouping ON te_theme.theme_id = te_grouping.theme_id ) ";
-	sql += " LEFT JOIN te_legend ON te_theme.theme_id = te_legend.theme_id ) ";
-	sql += " LEFT JOIN te_visual ON te_legend.legend_id = te_visual.legend_id ) ";
-	sql += " LEFT JOIN te_visual_raster ON te_theme.theme_id = te_visual_raster.theme_id) ";
-	sql += " WHERE "+ rest;
-	sql += " ORDER BY te_theme.theme_id, te_legend.legend_id, te_legend.group_id, te_visual.geom_type, te_visual_raster.band_in  "; 
-
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return false;
-	
-	if(!portal->query(sql) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-	
-	TeViewNodeType viewNodeType = (TeViewNodeType)portal->getInt(6);
-	if(viewNodeType == TeTREE)
-	{		
-		TeViewNodeParams params;
-		portal->getViewNodeParams(params, 0);
-		theme->viewNodeParams(params);
-		delete portal;
-		return true;
-	}
-			
-	if(!portal->getTheme(*theme, 0))
-	{
-		delete portal;
-		return false;
-	}
-	
-	if(viewNodeType==(int)TeTHEME)
-	{
-		//load layer
-		int id = static_cast<TeTheme*>(theme)->layerId();
-		TeLayerMap::iterator it = metaModel_->layerMap().find(id);
-		if (it == metaModel_->layerMap().end())
-			loadLayerSet(loadAttrList);
-		
-		static_cast<TeTheme*>(theme)->layer(metaModel_->layerMap()[id]);
-	}
-		
-	//load grouping 
-	TeGrouping group;
-	if(portal->getGrouping(group, 20))
-		theme->grouping(group);
-
-	//load all legends of this theme
-	//and its visual
-	bool hasLegsToThisTheme = true;
-	bool hasNewRow = true;
-	while(hasLegsToThisTheme)
-	{
-		//legend
-		TeLegendEntry legend;
-		if(!portal->getLegend(legend, 30))
-		{
-			delete portal;
-			return false;
-		}
-
-		//visual
-		TeRasterVisual* rasterVisual = new TeRasterVisual();
-		bool hasVisualToThisLeg = true;
-		bool hasRasterVisual = false;
-		while(hasVisualToThisLeg)
-		{
-			TeVisual* visual = TeVisualFactory::make(visualType);
-			TeGeomRep geomRep;
-			if(portal->getVisual(visual, geomRep, 37))
-				legend.setVisual(visual, geomRep);
-								
-			if(portal->getRasterVisual(*rasterVisual, 61))
-				hasRasterVisual=true;
-			
-			hasNewRow = portal->fetchRow();
-			if(!hasNewRow || portal->getInt(32)!= legend.group() || portal->getInt(30)!= legend.id() )  //if legend_id and group_id
-				hasVisualToThisLeg = false;
-		}
-
-		//Set raster visual to this theme
-		if(hasRasterVisual)
-			theme->rasterVisual(rasterVisual);
-		else
-			delete rasterVisual;
-
-		//Set legend to this theme
-		theme->legend(legend); 
-														
-		//fill legend buffer
-		if(legend.group() == -6)	
-			metaModel_->legendMap()[legend.id()] = &theme->queryAndPointingLegend();
-		else if(legend.group() == -5)	
-			metaModel_->legendMap()[legend.id()] = &theme->queryLegend(); 
-		else if (legend.group() == -4)
-			metaModel_->legendMap()[legend.id()] = &theme->pointingLegend(); 
-		else if (legend.group() == -3)
-			metaModel_->legendMap()[legend.id()] = &theme->defaultLegend(); 
-		else if (legend.group() == -2)
-			metaModel_->legendMap()[legend.id()] = &theme->withoutDataConnectionLegend(); 
-		else if (legend.group() == -1)
-			metaModel_->legendMap()[legend.id()] = &theme->outOfCollectionLegend(); 
-		else if (legend.group() == -10) //own legend
-		{
-			TeLegendEntry* legendTemp = new TeLegendEntry(legend);
-			metaModel_->legendMap()[legend.id()] = legendTemp;
-		}	
-		
-		if(!hasNewRow || portal->getInt(0)!= theme->id())
-			hasLegsToThisTheme = false;
-	}
-
-	delete portal;
-			
-	for (unsigned int i = 0; i < theme->legend().size(); ++i)
-		metaModel_->legendMap()[theme->legend()[i].id()] = &theme->legend()[i];
-
-	//load theme table
-	if(theme->type()==(int)TeTHEME)
-	{
-		if(!loadThemeTable(static_cast<TeTheme*>(theme), loadAttrList))
-			return false;
-	}
-
-	//load specific theme parameters
-	if(!theme->loadMetadata(this))
-	{
-		metaModel_->invalidThemeMap()[theme->id()] = theme;
-		delete portal;
-		return false;
-	}
-			
-	metaModel_->themeMap()[theme->id()] = theme;
-	return true;
-}
-
-
-bool
-TeDatabase::loadThemeTable (TeTheme* theme, const bool& loadAttrList)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-	{
-		this->errorMessage_ = "N�o foi poss�vel abrir portal para o banco";
-		return false;
-	}
-	
-	//theme tables
-	string sel = "SELECT te_theme_table.*, ";  //0 - 4 (5 columnns)
-	sel += " te_tables_relation.*, ";          //5 - 9  (5 columns)
-	sel += " te_layer_table.* ";			   //10	
-	sel += " FROM (te_theme_table LEFT JOIN te_tables_relation";
-	sel += " ON te_theme_table.relation_id = te_tables_relation.relation_id)";
-	sel += " LEFT JOIN te_layer_table ON te_theme_table.table_id = te_layer_table.table_id";
-	sel += " WHERE  te_theme_table.theme_id = " + Te2String(theme->id());
-	sel += " ORDER BY table_order";
-	
-	if (!portal->query (sel))
-	{	
-		delete portal;
-		return false;
-	}
-
-	while(portal->fetchRow ())
-	{
-		string tableName = portal->getData(12);
-		if(tableName.empty())
-			continue;
-
-		TeTable table(tableName);
-
-		TeLayerMap::iterator itLayer = metaModel_->layerMap().find(theme->layerId());
-		if(itLayer!=metaModel_->layerMap().end() && (!itLayer->second->getAttrTablesByName(tableName, table)))
-		{
-			TeAttributeList attrList;
-			if(loadAttrList)
-				getAttributeList(tableName, attrList);
-			table.setAttributeList(attrList);
-			if(!portal->getAttrTable(table, 10))
-			{
-				delete portal;
-				return false;
-			}
-		}
-
-		table.setId(portal->getInt(2)); //"te_theme_table.table_id"
-		table.setOrder(portal->getInt(4)); //"table_order"
-		TeAttrTableType tableType = table.tableType(); //portal->getInt("attr_table_type");
-		if (tableType == TeAttrExternal)
-		{
-			int relatedTableId = portal->getInt(6); //"related_table_id"
-			table.relatedTableName(getTableName(relatedTableId));
-			int relationId = portal->getInt(3); //"te_theme_table.relation_id"
-			metaModel_->relationMSet().insert(relationId);
-
-			string relatedAttr = portal->getData(7); //"related_attr"
-			table.setTableType(TeAttrExternal, relatedTableId, relatedAttr);
-
-			table.setLinkName(portal->getData(9)); //"external_attr"
-		}
-		else
-			table.setTableType((TeAttrTableType)tableType);
-
-		theme->addThemeTable(table);
-	}
-
-	delete portal;
-	return true;
-}
-
-
-bool
-TeDatabase::insertThemeTable(TeTheme *theme, TeTable& inputTable)
-{
-	int themeId = theme->id();
-	int	tableOrder = 0;
-	int	relationId;
-	bool status;
-	string qString;
-
-	// Get the order of the last theme table
-	qString = "SELECT MAX(table_order) FROM te_theme_table";
-	qString += " WHERE theme_id = " + Te2String(themeId);
-
-	TeDatabasePortal* portal = getPortal();
-	if (portal->query(qString) == false || portal->fetchRow() == false)
-		return false;
-
-	string data = portal->getData(0);
-	if (data.empty())
-		tableOrder = 0;
-	else
-	{
-		tableOrder = atoi(portal->getData(0));
-		++tableOrder;
-	}
-	inputTable.setOrder(tableOrder);
-	delete portal;
-
-	if (inputTable.tableType() == TeAttrExternal)
-	{
-		status = insertRelationInfo(inputTable.relatedTableId(),inputTable.relatedAttribute(),
-									inputTable.name(),inputTable.linkName(),relationId);
-		if (status == false)
-			return false;
-		metaModel_->relationMSet().insert(relationId);
-
-		status = insertThemeTable(themeId, inputTable.id(), relationId, tableOrder);
-	}
-	else
-	{
-		// Insert the table in the te_theme_table
-		status = insertThemeTable(themeId, inputTable.id(), 0, tableOrder);
-	}
-	return status;
-}
-
-bool
-TeDatabase::removeThemeTable(TeTheme *theme, int tableOrder)
-{
-	if (tableOrder < 0)
-		return false;
-
-	int relationId = -1;
-	string qString;
-
-	TeAttrTableVector attrTableVector; 
-	theme->getAttTables(attrTableVector);
-
-	// If the table is external, find the relation id
-	qString = "SELECT relation_id FROM te_theme_table";
-	qString += " WHERE theme_id = " + Te2String(theme->id());
-	qString += " AND relation_id IS NOT NULL";
-	qString += " AND table_order = " + Te2String(tableOrder);
-
-	TeDatabasePortal* portal = getPortal();
-	if (portal->query(qString) && portal->fetchRow())
-		relationId = portal->getInt("relation_id");
-	else
-	{
-		delete portal;
-		return false;
-	}
-	delete portal;
-
-	// Remove the table from the te_theme_table
-	qString = "DELETE FROM te_theme_table WHERE theme_id = " + Te2String(theme->id());
-	qString += " AND table_order = " + Te2String(tableOrder);
-	if (execute(qString) == false)
-		return false;
-
-	// Remove the relation from the te_tables_relation
-	// table if only this theme is using it
-	if (relationId > 0)
-	{
-		if (metaModel_->relationMSet().count(relationId) == 1)
-		{
-			qString = "DELETE FROM te_tables_relation WHERE relation_id = " + Te2String(relationId);
-			if (execute(qString) == false)
-				return false;
-			metaModel_->relationMSet().erase(relationId);
-		}
-		else
-			metaModel_->relationMSet().erase(metaModel_->relationMSet().find(relationId));
-	}
-	return true;
-}
-
-
-bool 
-TeDatabase::updateThemeTable(TeTheme *theme)
-{
-	//Initially remove from te_theme_table all the records of this theme
-	string q = "SELECT * FROM te_theme_table WHERE theme_id = " + Te2String(theme->id());
-	TeDatabasePortal *portal = getPortal();
-
-	if (portal->query(q) == false)
-	{
-		delete portal;
-		return false;
-	}
-
-	while (portal->fetchRow())
-	{
-		int relationId;
-		int themeTableId = portal->getInt("theme_table_id");
-
-		string data = portal->getData("relation_id");
-		if (data.empty())
-			relationId = -1;
-		else
-			relationId = atoi(data.c_str());
-
-		// Remove the relation from the te_tables_relation
-		// table if only this theme is using it
-		bool b = false;
-		if (relationId > 0)
-		{
-			if (metaModel_->relationMSet().count(relationId) == 1)
-				b = true;
-			else
-				metaModel_->relationMSet().erase(metaModel_->relationMSet().find(relationId));
-		}
-
-		// Remove the table from the te_theme_table
-		q = "DELETE FROM te_theme_table WHERE theme_id = " + Te2String(theme->id());
-		q += " AND theme_table_id = " + Te2String(themeTableId);
-		if (execute(q) == false)
-		{
-			delete portal;
-			return false;
-		}
-		if(b)
-		{
-			q = "DELETE FROM te_tables_relation WHERE relation_id = " + Te2String(relationId);
-			if (execute(q) == false)
-			{
-				delete portal;
-				return false;
-			}
-			metaModel_->relationMSet().erase(relationId);
-		}
-	}
-	delete portal;
-
-	// Update te_theme_table and te_tables_relation(if there are any external tables)
-	// with the information provided from the new vector of theme tables
-	TeAttrTableVector tablesVector; 
-	theme->getAttTables(tablesVector);
-	for (unsigned i = 0; i < tablesVector.size(); ++i)
-		insertThemeTable(theme, tablesVector[i]);
-
-	return true;
-}
-
-
-bool 
-TeDatabase::insertGrouping (int themeId, const TeGrouping& grouping)
-{
-	if((themeId < 1) || (grouping.groupMode_ == TeNoGrouping) )
-		return false;
-
-	string ins = " INSERT INTO te_grouping (theme_id, grouping_number, ";
-	ins += " grouping_attr, grouping_attr_type, grouping_mode, "; 
-	ins += " grouping_norm_attr, grouping_std_dev, grouping_precision, "; 
-	ins += " grouping_function, grouping_chronon)"; 
-	ins += " VALUES ( ";
-	ins += Te2String(themeId);
-	ins += ", "+ Te2String(grouping.groupNumSlices_);
-
-	string attname = grouping.groupAttribute_.name_;
-	if(attname.empty() || (attname=="NONE") )
-		attname = "";
-	
-	string norname = grouping.groupNormAttribute_;
-	if(norname.empty() || (norname=="NONE"))
-		norname = "";
-
-	map<int, map<string, string> >::iterator it = metaModel_->mapThemeAlias().find(themeId);
-	if(it != metaModel_->mapThemeAlias().end())
-	{
-		map<string, string>::iterator tit = it->second.find(attname);
-		if(tit != it->second.end())
-		{
-			string alias = tit->second;
-			attname += "(" + alias + ")";
-		}
-		if(norname.empty() == false)
-		{
-			map<string, string>::iterator tit = it->second.find(norname);
-			if(tit != it->second.end())
-			{
-				string nalias = tit->second;
-				norname += "(" + nalias + ")";
-			}
-		}
-	}
-
-	ins += ", '"+ attname +"'";
-	ins += ", "+ Te2String(grouping.groupAttribute_.type_);
-	ins += ", "+ Te2String(grouping.groupMode_);
-	ins += ", '"+ norname +"'";
-	ins += ", "+ Te2String(grouping.groupStdDev_); 
-	ins += ", "+ Te2String(grouping.groupPrecision_);
-	ins += ", '"+ grouping.groupFunction_ +"'";
-	ins += ", "+ Te2String(grouping.groupChronon_);
-	ins += ")";
-
-	return (execute(ins));
-}
-
-bool 
-TeDatabase::updateGrouping (int themeId, const TeGrouping& grouping)
-{
-	if((themeId < 1) || (grouping.groupMode_ == TeNoGrouping))
-		return false;
-
-	string up = " UPDATE te_grouping SET ";
-	up += "  grouping_number = "+ Te2String(grouping.groupNumSlices_);
-
-	string attname = grouping.groupAttribute_.name_;
-	if(attname.empty() || (attname=="NONE"))
-		attname = "";
-
-	string norname = grouping.groupNormAttribute_;
-	if(norname.empty()|| (norname=="NONE"))
-		norname = "";
-
-	map<int, map<string, string> >::iterator it = metaModel_->mapThemeAlias().find(themeId);
-	if(it != metaModel_->mapThemeAlias().end())
-	{
-		map<string, string>::iterator tit = it->second.find(attname);
-		if(tit != it->second.end())
-		{
-			string alias = tit->second;
-			attname += "(" + alias + ")";
-		}
-		if(norname.empty() == false)
-		{
-			map<string, string>::iterator tit = it->second.find(norname);
-			if(tit != it->second.end())
-			{
-				string nalias = tit->second;
-				norname += "(" + nalias + ")";
-			}
-		}
-	}
-
-	up += ", grouping_attr = '"+ attname +"'";
-	up += ", grouping_attr_type = "+ Te2String(grouping.groupAttribute_.type_);
-	up += ", grouping_mode = "+ Te2String(grouping.groupMode_);
-	up += ", grouping_norm_attr = '"+ norname +"'";
-	up += ", grouping_std_dev = "+ Te2String(grouping.groupStdDev_); 
-	up += ", grouping_precision = "+ Te2String(grouping.groupPrecision_);
-	up += ", grouping_function = '"+ grouping.groupFunction_ +"'";
-	up += ", grouping_chronon = "+ Te2String(grouping.groupChronon_);
-	up += " WHERE theme_id = "+ Te2String(themeId);
-
-	return (execute(up));
-}
-
-bool 
-TeDatabase::generateLabelPositions(TeTheme *theme, const std::string& objectId)
-{
-	string	piebar, geomTable, upd;
-	string	collTable = theme->collectionTable();
-	
-	if((collTable.empty()) || (!tableExist(collTable)))
-		return false;
-
-	if (theme->layer()->hasGeometry(TeCELLS) )
-	{
-		geomTable = theme->layer()->tableName(TeCELLS);
-
-		piebar = "SELECT label_x, label_y, lower_x, lower_y, upper_x, upper_y";
-		piebar += " FROM " + collTable + " LEFT JOIN " + geomTable;
-		piebar += " ON " + collTable + ".c_object_id = " + geomTable + ".object_id";
-		if (!objectId.empty())
-			upd += " WHERE " +  collTable + ".c_object_id = '" + objectId + "'";
-
-		upd = " UPDATE (" + piebar + ") SET";
-		upd += " label_x = lower_x + (upper_x-lower_x)/2,";
-		upd += " label_y = lower_y + (upper_y-lower_y)/2";
-		
-
-		if(!execute(upd))
-			return false;
-	}
-
-	if( theme->layer()->hasGeometry(TePOLYGONS))
-	{
-		geomTable = theme->layer()->tableName(TePOLYGONS);
-
-		piebar = "SELECT label_x, label_y, lower_x, lower_y, upper_x, upper_y";
-		piebar += " FROM " + collTable + " LEFT JOIN " + geomTable;
-		piebar += " ON " + collTable + ".c_object_id = " + geomTable + ".object_id";
-		piebar += " WHERE label_x is null OR label_y is null";
-		if (!objectId.empty())
-			upd += " AND " +  collTable + ".c_object_id = '" + objectId + "'";
-		piebar += " ORDER BY c_object_id ASC, ext_max ASC";
-		
-		upd = " UPDATE (" + piebar + ") SET";
-		upd += " label_x = lower_x + (upper_x-lower_x)/2,";
-		upd += " label_y = lower_y + (upper_y-lower_y)/2";
-
-		if(!execute(upd))
-			return false;
-	}
-	
-	if (theme->layer()->hasGeometry(TePOINTS))
-	{
-		geomTable = theme->layer()->tableName(TePOINTS);
-
-		piebar = "SELECT label_x, label_y, x, y";
-		piebar += " FROM " + collTable + " LEFT JOIN " + geomTable;
-		piebar += " ON " + collTable + ".c_object_id = " + geomTable + ".object_id";
-		piebar += " WHERE label_x is null OR label_y is null";
-		if (!objectId.empty())
-			upd += " AND " +  collTable + ".c_object_id = '" + objectId + "'";
-
-		upd = " UPDATE (" + piebar + ") SET";
-		upd += " label_x = x,";
-		upd += " label_y = y";
-
-		if(!execute(upd))
-			return false;
-	}
-	
-	if(theme->layer()->hasGeometry(TeLINES))
-	{
-		geomTable = theme->layer()->tableName(TeLINES);
-
-		piebar = "SELECT label_x, label_y, lower_x, lower_y, upper_x, upper_y";
-		piebar += " FROM " + collTable + " LEFT JOIN " + geomTable;
-		piebar += " ON " + collTable + ".c_object_id = " + geomTable + ".object_id";
-		piebar += " WHERE label_x is null OR label_y is null";
-		if (!objectId.empty())
-			upd += " AND " +  collTable + ".c_object_id = '" + objectId + "'";
-		piebar += " ORDER BY c_object_id ASC, ext_max ASC";
-		
-		upd = " UPDATE (" + piebar + ") SET";
-		upd += " label_x = lower_x + (upper_x-lower_x)/2,";
-		upd += " label_y = lower_y + (upper_y-lower_y)/2";
-
-		if(!execute(upd))
-			return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::themeExist(string themeName)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	themeName = TeConvertToUpperCase(themeName);
-
-	string sql = "SELECT name FROM te_theme";
-	if (!portal->query(sql))
-	{	
-		delete portal;
-		return false;
-	}
-	while (portal->fetchRow())
-	{
-		string name = portal->getData(0);
-		name = TeConvertToUpperCase(name);
-		if (themeName == name)
-		{
-			delete portal;
-			return true;
-		}
-	}
-	delete portal;
-	return false;
-}
-
-string TeDatabase::getNewThemeName(const string& n)
-{
-	bool changed;
-	string invalidChar;
-	string name = TeCheckName(n, changed, invalidChar);
-	string newName = name;
-
-	string q = "SELECT name FROM te_theme WHERE name = '" + newName + "'";
-
-	TeDatabasePortal* portal = this->getPortal();
-	if(portal && portal->query(q) && portal->fetchRow())
-	{
-		// there is already a theme with this theme 
-		q = "SELECT name FROM te_theme WHERE name LIKE '" + name + "_%' ORDER BY name DESC";
-		portal->freeResult();
-		if(portal && portal->query(q))
-		{
-			newName.clear();
-			while(portal->fetchRow())
-			{
-				string s = portal->getData(0);
-				size_t i, f = s.rfind("_");
-				f++;
-				newName = s.substr(0, f);
-				string ss = s.substr(f);
-				for(i=0; i < ss.size(); ++i)
-				{
-					if(ss[i] < 0x30 || ss[i] > 0x39)
-						break;
-				}
-				if(i < ss.size())
-					continue;
-
-				int n = atoi(ss.c_str()) + 1;
-				s = Te2String(n);
-				newName += s;
-				break;
-			}
-			if(newName.empty())
-				newName = name + "_1";
-		}
-	}
-	delete portal;
-	return newName;
-}
-
-string TeDatabase::getNewTableName(const string& n)
-{
-	bool changed;
-	string invalidChar;
-	string name = TeCheckName(n, changed, invalidChar);
-	string newName = name;
-	int	i=1;
-	while (this->tableExist(newName))
-	{
-		newName = name + Te2String(i);
-		++i;
-	}
-	return newName;
-}
-
-string TeDatabase::getConcatFieldsExpression(const vector<string>& fNamesVec)
-{
-	string concatExp;
-	for (unsigned int i = 0; i < fNamesVec.size(); ++i)
-	{
-		if (i != 0)
-			concatExp += " & ";
-		concatExp += fNamesVec[i];
-	}
-	return concatExp;
-}
-
-
-bool
-TeDatabase::deleteTheme(int themeId)
-{
-	TeAbstractTheme* tema;
-	bool themeWasFound = false;
-	TeThemeMap::iterator it;
-
-	it = invalidThemeMap().find(themeId);
-	if (it != invalidThemeMap().end())
-	{
-		themeWasFound = true;
-		tema = it->second;
-		invalidThemeMap().erase(themeId);
-	}
-
-	if (themeWasFound == false)
-	{
-		it = themeMap().find(themeId);
-		if(it != themeMap().end())
-		{
-			themeWasFound = true;
-			tema = it->second;
-			themeMap().erase(themeId);
-		}
-	}
-
-	if (themeWasFound == false)
-		return false;
-	
-	if(!tema->eraseMetadata(this))
-		return false;
-	
-	string sql;
-	// delete the collection table associated to this theme
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return false;
-
-	sql = "SELECT collection_table FROM te_theme WHERE theme_id = " + Te2String(themeId);
-	if (!portal->query(sql) ||!portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-	string colTab = portal->getData("collection_table");
-	//delete collection table
-	if (this->tableExist(colTab))	
-	{
-		sql = "DROP TABLE " + colTab;
-		if (!this->execute(sql) )
-		{	
-			delete portal;
-			return false;
-		}
-	}
-	//delete auxiliar collection table
-	if (this->tableExist(colTab +"_aux"))	
-	{
-		sql = "DROP TABLE " +colTab +"_aux";
-		if (!this->execute(sql) )
-		{	
-			delete portal;
-			return false;
-		}
-	}
-	portal->freeResult();
-
-	//delete the visual associated to this theme
-	if (existRelation("te_visual","fk_visual_legend_id") != TeRICascadeDeletion)
-	{
-		sql = "SELECT legend_id FROM te_legend WHERE theme_id = " + Te2String(themeId);
-		if (!portal->query(sql))
-		{	
-			delete portal;
-			return false;
-		}
-		string wherec;
-		int c = 0;
-		while (portal->fetchRow())
-		{
-			if (c)
-				wherec += ",";
-			c++;
-			wherec += portal->getData(0);
-		}
-		portal->freeResult();
-        if (!wherec.empty()) 
-        {
-			sql = "DELETE FROM te_visual WHERE legend_id IN (" + wherec + ")";
-			if (!this->execute(sql))
-			{	
-				delete portal;
-				return false;
-			}
-	   }
-	}
-
-	//delete lut table from current raster visual, if it exist
-	if(tema->rasterVisual())
-	{
-		if(!tema->rasterVisual()->getLutTableName().empty())
-		{
-			std::string lutTableName = tema->rasterVisual()->getLutTableName();
-
-			if (this->tableExist(lutTableName))
-			{
-				if(!this->deleteTable(lutTableName))
-					return false;
-			}
-		}
-	}
-
-	//delete all visuals of raster associated to this theme
-	if (existRelation("te_visual_raster","fk_visrast_theme_id") != TeRICascadeDeletion)
-	{
-		sql = "DELETE FROM te_visual_raster WHERE theme_id =" + Te2String(themeId);
-		if (!this->execute (sql))
-		{	
-			delete portal;
-			return false;
-		}
-	}
-	
-	//delete all legends associated to this theme
-	if (existRelation("te_legend","fk_legend_theme_id") != TeRICascadeDeletion)
-	{
-		sql = "DELETE FROM te_legend WHERE theme_id =" + Te2String(themeId);
-		if (!this->execute (sql))
-		{	
-			delete portal;
-			return false;
-		}
-	}
-	
-	//select the view of this theme
-	sql = "SELECT view_id FROM te_theme WHERE theme_id = " + Te2String(themeId);
-	portal->freeResult();
-	if(!portal->query(sql) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	//delete theme of the view tree
-	int viewId = portal->getInt("view_id");
-	delete portal;
-
-	//delete the tables associated to this theme
-	if (existRelation("te_theme_table","fk_thmtable_theme_id") != TeRICascadeDeletion)
-	{
-		sql = "DELETE FROM te_theme_table WHERE theme_id =" + Te2String(themeId);
-		if (!this->execute (sql))
-			return false;
-	}
-		
-	//delete the grouping
-	if (existRelation("te_grouping","fk_group_theme_id")  != TeRICascadeDeletion)
-	{
-		sql = "DELETE FROM te_grouping WHERE theme_id =" + Te2String(themeId);
-		if (!this->execute (sql))
-			return false;
-	}
-
-	// delete raster visual
-	if (existRelation("te_visual_raster","fk_visrast_theme_id") == TeNoRelation )
-	{
-		sql = "DELETE FROM te_visual_raster WHERE theme_id =" + Te2String(themeId);
-		if (!this->execute (sql))
-			return false;
-	}
-
-	sql = " UPDATE te_view SET current_theme = NULL WHERE current_theme = "+ Te2String(themeId);
-	this->execute(sql);
-	
-	// delete the theme
-	sql = " DELETE FROM te_theme WHERE theme_id = " + Te2String(themeId);
-	if (!this->execute (sql))
-		return false;
-
-	//delete in the maps
-	TeView* view = viewMap()[viewId];
-	if (view) //this view exists
-		view->remove(themeId); 
-
-    unsigned int i;
-	TeLegendEntryVector& legendVector = tema->legend();
-	for (i = 0; i < legendVector.size(); ++i)
-		legendMap().erase(legendVector[i].id());
-	
-	delete tema;
-	return true;
-}
-
-bool
-TeDatabase::deleteThemeGroup(int themeId)
-{
-	string sql;
-	// delete the theme
-	sql = "DELETE FROM te_grouping WHERE theme_id = " + Te2String(themeId);
-	if (!this->execute (sql))
-		return false;
-	return true;
-}
-
-bool
-TeDatabase::deleteLegend(int themeId)
-{
-	// If there is a collection table update legend of the objects in it
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return false;
-	string sel = "SELECT collection_table FROM te_theme WHERE theme_id = " + Te2String(themeId);
-	string TC;
-	if (portal->query(sel) && portal->fetchRow())
-		TC = portal->getData(0);
-	delete portal;
-
-	if (!TC.empty() && this->tableExist(TC))
-	{
-		string up = "UPDATE " + TC + " SET c_legend_id = 0";
-		if (!execute(up))
-			return false;
-	}
-
-	// Delete visual of the legends
-	string del = "DELETE FROM te_visual WHERE legend_id IN ";
-	del += "(SELECT legend_id FROM te_legend WHERE theme_id = " + Te2String(themeId);
-	del += " AND group_id > -1)";
-	if (!execute(del))
-		return false;
-
-	del = "DELETE FROM te_legend WHERE theme_id = " + Te2String(themeId);
-	del += " AND group_id > -1";
-	if (!execute(del))
-		return false;
-
-	// Delete from memory the legends of the theme
-	unsigned int i;
-	TeAbstractTheme *theme = metaModel_->themeMap()[themeId];
-	TeLegendEntryVector& legendVector = theme->legend();
-	for (i = 0; i < legendVector.size(); ++i)
-		metaModel_->legendMap().erase(legendVector[i].id());
-	legendVector.clear();
-
-	//delete grouping
-	del = "DELETE FROM te_grouping WHERE theme_id =" + Te2String(themeId);
-	if (!execute (del))
-		return false;
-		
-	return true;
-}
-
-bool
-TeDatabase::updateLayer(TeLayer *layer)
-{
-	if (!layer)
-		return false;
-
-	if (layer->projection())
-		updateProjection(layer->projection());
-
-	string sql;
-	sql = "UPDATE te_layer SET ";
-	sql += "name = '" + layer->name() + "' ";
-	if (layer->box().isValid())
-	{
-		sql += ", lower_x = " + Te2String(layer->box().x1(),15) + " ";
-		sql += ", lower_y = " + Te2String(layer->box().y1(),15) + " ";
-		sql += ", upper_x = " + Te2String(layer->box().x2(),15) + " ";
-		sql += ", upper_y = " + Te2String(layer->box().y2(),15) + " ";
-	}else
-	{
-		sql += ", lower_x = " + Te2String(layer->box().x1()) + " ";
-		sql += ", lower_y = " + Te2String(layer->box().y1()) + " ";
-		sql += ", upper_x = " + Te2String(layer->box().x2()) + " ";
-		sql += ", upper_y = " + Te2String(layer->box().y2()) + " ";
-	}
-	if(layer->getEditionTime().isValid())
-	{
-		TeTime editionTime = layer->getEditionTime();
-		sql += ", edition_time = " + this->getSQLTime(editionTime);
-	}
-	sql +=  " WHERE layer_id = " + Te2String(layer->id());
-
-	return (this->execute (sql));
-}
-
-bool
-TeDatabase::loadLayerSet(const bool& loadAttrList)
-{
-	//clear layer map
-	TeLayerMap::iterator it = metaModel_->layerMap().begin();
-	while (it != metaModel_->layerMap().end())
-	{
-		if(it->second)
-			delete it->second;
-		++it;
-	}
-	metaModel_->layerMap().clear();
-	
-	string sql = " SELECT te_layer.*, "; // 0 - 9 (10 columns)
-	sql += " te_projection.*, "; // 10 - 26  (17 columns)
-	sql += " te_representation.*, "; // 27 - 41 (15 columns)
-	sql += " te_layer_table.* "; // 42 - 53 (12 columns)
-	
-	sql += " FROM (((te_layer INNER JOIN te_projection ";
-	sql += " ON te_layer.projection_id = te_projection.projection_id) ";
-	sql += " LEFT JOIN te_representation ON ";
-	sql += " te_layer.layer_id = te_representation.layer_id) ";
-	sql += " LEFT JOIN te_layer_table ON ";
-	sql += " te_layer.layer_id = te_layer_table.layer_id) ";
-
-	sql += " ORDER BY te_layer.layer_id, te_representation.geom_type, te_layer_table.table_id ";
-
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return false;
-
-	if (!portal->query(sql))
-	{	
-		delete portal;
-		return false;
-	}
-	
-	int lastLayerId = -1;
-	TeLayer *layer = 0;
-	bool hasNewRow = portal->fetchRow(); //idicates that this portal was fetched 
-	while(hasNewRow)
-	{
-		//load view and its projection 
-		if(lastLayerId!=atoi(portal->getData(0)))
-		{
-			TeProjection* proj = 0;
-			if(!portal->getProjection(&proj, 10)) //load projection
-			{
-				delete portal;
-				return false;
-			}
-			layer = new TeLayer();
-			if(!portal->getLayer(*layer, 0)) //load layer
-			{
-				delete portal;
-				delete layer;
-				return false;
-			}
-			if (proj != 0)
-				layer->setProjection(proj);
-			lastLayerId = layer->id();
-		}
-
-		//load its representation and its tables
-		bool hasRepsTablesToThisLayer = true;
-		vector<int> loadedTableId;
-		while(hasRepsTablesToThisLayer)
-		{
-			//load representation
-			string repId = portal->getData(27);
-
-			TeRepresPointerVector::iterator it;
-
-			//bool textLoaded = false;
-
-			//for(it = layer->vectRepres().begin(); it != layer->vectRepres().end(); ++it)
-			//{
-			//	if((*it)->id_ == atoi(repId.c_str()))
-			//	{
-			//		textLoaded = true;
-			//		break;
-			//	}
-			//}
-
-			if(!repId.empty() && 
-				(!layer->hasGeometry(TeGeomRep(portal->getInt(29))) || 
-				(TeGeomRep(portal->getInt(29)) == TeTEXT))/* && (!textLoaded)*/)
-			{
-				TeRepresentation* rep = new TeRepresentation();
-				if(!portal->getRepresentation(*rep, 27))
-				{
-					delete rep;
-					delete layer;
-					delete portal;
-				}
-				layer->addVectRepres(rep);
-			}
-			
-			//load tables
-			if( find(loadedTableId.begin(), loadedTableId.end(), portal->getInt(42)) == loadedTableId.end())
-			{
-				TeTable attrTable;
-				if(portal->getAttrTable(attrTable, 42))
-				{
-					TeAttributeList attrList;
-					if(loadAttrList)
-						getAttributeList(attrTable.name(), attrList);
-					attrTable.setAttributeList(attrList);
-					layer->addAttributeTable(attrTable);
-					loadedTableId.push_back(attrTable.id());
-				}
-			}
-			hasNewRow = portal->fetchRow();
-			if(!hasNewRow || portal->getInt(0)!= layer->id())
-				hasRepsTablesToThisLayer = false;
-		}
-
-		layer->setDatabase(this);
-		metaModel_->layerMap()[layer->id()] = layer;
-	}
-
-	delete portal;
-	return true;
-
-}
-
-string
-TeDatabase::getRasterTable(int layerId, const string& objectId)
-{
-	if (layerId <=0 )
-		return "";
-
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return "";
-
-	string get;
-	// get the raster representation
-	get = "SELECT geom_table FROM te_representation WHERE layer_id = "+Te2String(layerId);
-	get += " AND (geom_type= " + Te2String((int)TeRASTER) + " OR geom_type= " + Te2String((int)TeRASTERFILE) + ")";
-	
-	// error executing query or no there is no raster representation 
-	if (!portal->query(get) || !portal->fetchRow())
-	{
-		delete portal;
-		return "";
-	}
-
-	string tableName = portal->getData(0);
-	portal->freeResult();
-	if (tableName.empty())
-	{
-		delete portal;
-		return "";
-	}
-
-	// check if a specific object is being looked for
-	get = "SELECT raster_table FROM " + tableName + " WHERE object_id='" + objectId + "'";
-	if (!portal->query(get) || !portal->fetchRow())
-	{
-		delete portal;
-		return "";
-	}
-	tableName = portal->getData(0);
-	delete portal;
-	return tableName;
-}
-
-
-TeRaster*
-TeDatabase::loadLayerRaster(int layerId, const string& objectId, const char& mode)
-{
-	if (layerId <=0 )
-		return 0;
-
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return 0;
-
-	TeRaster* raster = 0;
-	string get;
-
-	// get the raster representation
-	get = "SELECT geom_table, geom_type, initial_time FROM te_representation WHERE layer_id = "+Te2String(layerId);
-	get += " AND (geom_type= " + Te2String((int)TeRASTER) + " OR geom_type= " + Te2String((int)TeRASTERFILE) + ")";
-	
-	// error executing query or no there is no raster representation 
-	if (!portal->query(get) || !portal->fetchRow())
-	{
-		delete portal;
-		return 0;
-	}
-	string tableName = portal->getData(0);
-	TeGeomRep rep = static_cast<TeGeomRep>(portal->getInt(1));
-	TeTime date = portal->getDate(2);
-	portal->freeResult();
-	if (tableName.empty())
-	{
-		delete portal;
-		return 0;
-	}
-
-	//--- this check is made for compatibility reasons with older terralib databases
-	TeAttributeRep	attrRep;
-	attrRep.name_ = "tiling_type";
-	attrRep.type_ = TeINT;
-		
-	TeAttribute att;
-	if(!columnExist(tableName, attrRep.name_,att))
-	{
-		addColumn (tableName, attrRep);
-		string sql = "UPDATE " + tableName + " SET tiling_type = " + Te2String(static_cast<int>(TeRasterParams::TeExpansible));
-		this->execute(sql);
-	}
-
-	// ---
-
-	// check if a specific object is being looked for
-	get = "SELECT * FROM " + tableName;
-	if (!objectId.empty())
-		get += " WHERE object_id='" + objectId + "'"; 
-	if (!portal->query(get) || !portal->fetchRow())
-	{
-		delete portal;
-		return 0;
-	}
-		
-	string oid = portal->getData("object_id");
-	int geomId = portal->getInt("geom_id"); // get raster representation id
-
-	// get raster parameters from te_raster_table table
-	TeRasterParams params;
-	params.fileName_ = portal->getData("raster_table");
-	params.lutName_ = portal->getData("lut_table");
-	params.nBands(portal->getInt("num_bands"));
-	params.boundingBoxResolution(portal->getDouble("lower_x"),portal->getDouble("lower_y"),
-								 portal->getDouble("upper_x"),portal->getDouble("upper_y"),
-							     portal->getDouble("res_x"),portal->getDouble("res_y"));
-	params.blockHeight_ = portal->getInt("block_height");
-	params.blockWidth_ = portal->getInt("block_width");
-	params.tiling_type_ = static_cast<TeRasterParams::TeRasterTilingType>(portal->getInt("tiling_type"));
-	if(date.isValid())
-	{
-		params.date_ = date;
-	}
-
-	portal->freeResult();
-
-	// get extra information from te_raster_metadata table
-	string metadatatable = tableName + "_metadata"; 
-	unsigned int nb = params.nBands();
-	unsigned int i;
-	for (i=0; i<nb; i++)
-	{
-		get = "SELECT * FROM " + metadatatable + " WHERE geom_id=" + Te2String(geomId);
-		get += " AND band_id=" + Te2String(i);
-		if (portal->query(get) && portal->fetchRow()) 
-		{
-			params.vmax_[i] = portal->getDouble("max_value");
-			params.vmin_[i] = portal->getDouble("min_value");
-			params.nbitsperPixel_[i] = portal->getInt("num_bits");
-			params.dataType_[i] =  static_cast<TeDataType>(portal->getInt("data_type"));
-			params.compression_[i] = static_cast<TeRasterParams::TeRasterCompressionMode>(portal->getInt("compression_type"));
-			params.photometric_[i] = static_cast<TeRasterParams::TeRasterPhotometricInterpretation>(portal->getInt("photometric_type"));
-		}
-		portal->freeResult();
-	}
-
-	// if raster is pallete get the associated LUT
-	if (params.photometric_[0] == TeRasterParams::TePallete && 	rep != TeRASTERFILE)
-		this->loadRasterLUT(&params);
-
-	// raster has the same projection as its layer
-	get = " SELECT te_projection.* FROM ";
-	get += " te_projection INNER JOIN te_layer ON ";
-	get += " te_projection.projection_id = te_layer.projection_id ";
-	get += " WHERE layer_id = " + Te2String(layerId);
-	
-	TeProjection* proj=0;
-	if (portal->query(get) && portal->fetchRow())
-		portal->getProjection(&proj);
-
-	portal->freeResult();
-	params.projection(proj);
-	if (proj)
-		delete proj;
-
-	bool hasDummy = false;
-	get = "SELECT band_id, dummy FROM " + metadatatable + " WHERE geom_id=" + Te2String(geomId);
-	get += " AND NOT (dummy IS NULL)";
-	if (portal->query(get))
-	{
-		while (portal->fetchRow())
-		{
-			int b = portal->getInt(0);
-			double d = portal->getDouble("dummy");
-			params.setDummy(d,b);
-			hasDummy = true;
-		}
-	}
-	params.useDummy_ = hasDummy;
-	params.mode_ = mode;
-	params.objectId_ = oid;
-	params.layerId_ = layerId;
-	delete portal;
-
-	if ( rep == TeRASTER)
-	{
-		params.nTilesInMemory_ = 0;
-		params.database_ = this;
-		TeDecoderDatabase* dec = new TeDecoderDatabase(params);
-		dec->init();
-		raster = new TeRaster();
-		raster->setDecoder(dec);
-		raster->objectId(oid);
-		return raster;
-	}
-	try
-	{
-		raster = new TeRaster(params);
-	}
-	catch(...)
-	{
-		if (params.fileName_.empty() == false)
-		{
-			errorMessage_ = "File doesn't exist: ";
-			errorMessage_ += params.fileName_;
-		}
-		else
-		{
-			errorMessage_ = "Raster file is not accessible.";
-		}
-		return 0;
-	} 
-	raster->init();
-	return raster;
-}
-
-bool 
-TeDatabase::loadRasterLUT(TeRasterParams* par)
-{
-	if (par->lutName_.empty())		
-		return false;
-	
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	string get = "SELECT COUNT(index_id) FROM " + par->lutName_;
-	if (!portal->query(get) || !portal->fetchRow())	 // if there is no table, or table is empty
-	{
-		delete portal;
-		return false;
-	}
-	int nentries = atoi(portal->getData(0));
-	if (nentries <= 0)
-	{
-		delete portal;
-		return false;
-	}
-	portal->freeResult();
-
-	par->lutr_.clear();
-	par->lutg_.clear();
-	par->lutb_.clear();
-
-	par->lutr_.resize(nentries);
-	par->lutg_.resize(nentries);
-	par->lutb_.resize(nentries);
-
-	par->lutr_.assign(nentries,0);
-	par->lutg_.assign(nentries,0);
-	par->lutb_.assign(nentries,0);
-
-	get = "SELECT * FROM " + par->lutName_ + " ORDER BY index_id ASC ";
-	if (!portal->query(get) || !portal->fetchRow())	 // if there is no table, or table is empty
-	{
-		delete portal;
-		return false;
-	}
-
-	do
-	{
-		int index = atoi(portal->getData(0));
-		par->lutr_[index] = atoi(portal->getData(1));
-		par->lutg_[index] = atoi(portal->getData(2));
-		par->lutb_[index] = atoi(portal->getData(3));
-	}while (portal->fetchRow());
-
-	delete portal;
-	return true;
-}
-
-bool
-TeDatabase::createSpatialIndex(const string& table, const string& columns, TeSpatialIndexType /*type*/, short /*level*/, short /*tile*/)
-{
-	string idxName = "sp_idx_" + table;
-	return createIndex(table, idxName, columns);
-}
-
-string TeDatabase::getSpatialIdxColumn(TeGeomRep rep)
-{
-	string columns = "";
-	switch(rep)
-	{
-		case TePOINTS:
-		case TeNODES:	columns = "x, y";
-						break;
-		case TeLINES:
-		case TePOLYGONS:
-		case TeCELLS:
-						columns = "lower_x, lower_y, upper_x, upper_y";
-						break;
-		case TeRASTER:
-						columns = " lower_x, lower_y, upper_x, upper_y, resolution_factor, subband ";
-						break;
-		default:		columns = "";
-	}
-	
-    return columns;
-}
-
-bool
-TeDatabase::loadLayer(TeLayer* layer, const bool& loadAttrList)
-{
-	if (layer == 0)
-		return false;
-
-	string rest;
-	if (layer->id() > 0)
-		rest = " te_layer.layer_id = "+  Te2String(layer->id());
-	else if (!layer->name().empty())
-		rest = " te_layer.name = '"+  layer->name() + "'";
-	else
-	{
-		this->errorMessage_ = "Layer procurado n�o possui nem id nem nome";
-		return false;
-	}
-	
-	string sql = " SELECT te_layer.*, "; // 0 - 9 (10 columns)
-	sql += " te_projection.*, "; // 10 - 26  (17 columns)
-	sql += " te_representation.*, "; // 27 - 41 (15 columns)
-	sql += " te_layer_table.* "; // 42 - 53 (12 columns)
-	
-	sql += " FROM (((te_layer INNER JOIN te_projection ";
-	sql += " ON te_layer.projection_id = te_projection.projection_id) ";
-	sql += " LEFT JOIN te_representation ON ";
-	sql += " te_layer.layer_id = te_representation.layer_id) ";
-	sql += " LEFT JOIN te_layer_table ON ";
-	sql += " te_layer.layer_id = te_layer_table.layer_id) ";
-
-	sql += " WHERE "+ rest;
-
-	sql += " ORDER BY te_representation.geom_type, te_layer_table.table_id ";
-
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return false;
-
-	if(!portal->query(sql) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool hasNewRow = true;
-	TeProjection* proj = 0;
-	if(!portal->getProjection(&proj, 10)) //load projection
-	{
-		delete portal;
-		return false;
-	}
-	
-	if(!portal->getLayer(*layer, 0)) //load layer
-	{
-		delete portal;
-		delete layer;
-		return false;
-	}
-	if (proj != 0)
-		layer->setProjection(proj);
-		
-	//load its representation and its tables
-	bool hasRepsTablesToThisLayer = true;
-	vector<int> loadedTableId;
-	while(hasRepsTablesToThisLayer)
-	{
-		string repId = portal->getData(27);
-		if(!repId.empty() && !layer->hasGeometry(TeGeomRep(portal->getInt(29))))
-		{
-			//load the geometry representation
-			TeRepresentation* rep = new TeRepresentation();
-			if(!portal->getRepresentation(*rep, 27))
-			{
-				delete rep;
-				delete layer;
-				delete portal;
-			}
-			layer->addVectRepres(rep);
-		}
-		
-		//load tables
-		if(find(loadedTableId.begin(), loadedTableId.end(), portal->getInt(42)) == loadedTableId.end())
-		{
-			TeTable attrTable;
-			if(portal->getAttrTable(attrTable, 42))
-			{
-				TeAttributeList attrList;
-				if(loadAttrList)
-					getAttributeList(attrTable.name(), attrList);
-				attrTable.setAttributeList(attrList);
-				layer->addAttributeTable(attrTable);
-				loadedTableId.push_back(attrTable.id());
-			}
-		}
-		
-		hasNewRow = portal->fetchRow();
-		if(!hasNewRow || portal->getInt(0)!= layer->id())
-			hasRepsTablesToThisLayer = false;
-	}
-	layer->setDatabase(this);
-	metaModel_->layerMap()[layer->id()] = layer;
-	
-	delete portal;
-	return true;
-}
-
-bool
-TeDatabase::loadLayerTable(TeLayer* layer, const bool& loadAttrList)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-	{
-		this->errorMessage_ = "N�o foi poss�vel abrir portal para o banco";
-		return false;
-	}
-	
-	// Get layer tables	
-	string get =  " SELECT * FROM te_layer_table"; 
-	get += " WHERE layer_id = " + Te2String(layer->id());
-	get += " ORDER BY attr_table_type, table_id";
-
-	if (!portal->query (get))
-	{	
-		delete portal;
-		return false;
-	}
-
-	while (portal->fetchRow())
-	{
-		TeTable attTable;
-		if(!portal->getAttrTable (attTable))
-		{
-			delete portal;
-			return false;
-		}
-		TeAttributeList attrList;
-		if(loadAttrList)
-			getAttributeList(attTable.name(), attrList);
-		attTable.setAttributeList(attrList);
-		layer->addAttributeTable(attTable);
-	}
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::layerExist(int layerId)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	string sql = "SELECT layer_id FROM te_layer WHERE layer_id = " + Te2String(layerId);
-	if (!portal->query(sql))
-	{	
-		delete portal;
-		return false;
-	}
-	if (!portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::layerExist(string layerName)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	layerName = TeConvertToUpperCase(layerName);
-
-	string sql = "SELECT name FROM te_layer";
-	if (!portal->query(sql))
-	{	
-		delete portal;
-		return false;
-	}
-	while (portal->fetchRow())
-	{
-		string name = portal->getData(0);
-		name = TeConvertToUpperCase(name);
-		if (layerName == name)
-		{
-			delete portal;
-			return true;
-		}
-	}
-	delete portal;
-	return false;
-}
-
-string TeDatabase::getNewLayerName(const string& n)
-{
-	bool changed;
-	string invalidChar;
-	string name = TeCheckName(n, changed, invalidChar);
-	string newName = name;
-	
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return "";
-	
-	bool flag = true;
-	int count = 0;
-	while(flag)
-	{
-		portal->freeResult();
-		string q = "SELECT name FROM te_layer WHERE name = '" + newName + "'";
-		if(portal->query(q) && portal->fetchRow())
-		{
-			// there is already this theme name 
-			newName = newName+"_"+Te2String(count);
-			++count;
-			flag = true;
-         }
-		else
-			flag = false; //found the new name
-	}
-	delete portal;
-	return newName;
-}
-
-bool
-TeDatabase::deleteLayer(int layerId)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-	
-	string sql = "SELECT projection_id FROM te_layer WHERE layer_id = ";
-	sql += Te2String(layerId);
-
-	if (!portal->query(sql))
-	{	
-		delete portal;
-		return false;
-	}
-
-	if (!portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	string projId = portal->getData("projection_id");
-	portal->freeResult();
-
-	// Get all representations that are associated to this layer
-	sql = "SELECT * FROM te_representation WHERE layer_id = "+ Te2String(layerId);
-	if (!portal->query (sql))
-	{
-		delete portal;
-		return false;
-	}
-
-	while (portal->fetchRow())
-	{	
-		// Save the name of the geometry table
-		string geomTable = portal->getData("geom_table");
-
-		// Delete lut table
-		TeGeomRep rep = TeGeomRep(portal->getInt("geom_type"));
-		if (rep == TeRASTER || rep == TeRASTERFILE)
-		{
-			TeDatabasePortal* portal2 = this->getPortal();
-			sql = "SELECT lut_table, raster_table FROM " + geomTable;
-			string tabName;
-			if (!portal2->query (sql))
-			{
-				delete portal2;
-				continue;
-			}
-
-			while (portal2->fetchRow())
-			{
-				// remove lut table
-				tabName = portal2->getData(0);
-				if (!tabName.empty() && this->tableExist(tabName))
-				{
-					sql = "DROP TABLE " + tabName;
-					this->execute(sql);
-				}
-				// remove raster table
-				tabName = portal2->getData(1);
-				if (!tabName.empty() && this->tableExist(tabName))
-				{
-					sql = "DROP TABLE " + tabName;
-					this->execute(sql);
-				}
-			}
-			delete portal2;
-			// remove raster metadata table
-			tabName = geomTable + "_metadata";
-			if (!tabName.empty() && this->tableExist(tabName))
-			{
-				sql = "DROP TABLE " + tabName;
-				this->execute(sql);
-			}
-		}
-		if (this->tableExist(geomTable))
-		{
-			sql = "DROP TABLE " + geomTable;
-			if (!this->execute(sql) )
-			{
-				delete portal;
-				return false;
-			}
-		}
-	}
-	portal->freeResult();
-
-	if (existRelation("te_representation","fk_rep_layer_id") != TeRICascadeDeletion)
-	{
-		// Delete entries into representations table
-		sql = "DELETE FROM te_representation WHERE layer_id = " +Te2String(layerId);
-		if (!this->execute(sql) )
-		{
-			delete portal;
-			return false;
-		}
-	}
-
-	// delete layer themes
-	sql = "SELECT theme_id FROM te_theme WHERE layer_id=" + Te2String(layerId);
-	if (!portal->query (sql))
-	{
-		delete portal;
-		return false;
-	}
-	
-	int themeId;
-	while (portal->fetchRow())
-	{	
-		themeId = portal->getInt("theme_id");
-		this->deleteTheme(themeId);
-	}
-
-	//Delete attributes tables
-	if(!deleteLayerTable(layerId))
-		return false;
-	
-	sql = "DELETE FROM te_layer WHERE layer_id=" + Te2String(layerId);
-	if (!this->execute(sql))
-	{
-		delete portal;
-		return false;
-	}
-
-	// delete layer projection
-	sql = "DELETE FROM te_projection WHERE projection_id = "+ projId;
-	if (!this->execute(sql))
-	{	
-		delete portal;
-		return false;
-	}
-
-	// remove all the items� themes associated to the layer to be removed
-	TeThemeMap::iterator it;
-	for (it = metaModel_->themeMap().begin(); it != metaModel_->themeMap().end();)
-	{
-		if(it->second->getProductId() != TeTHEME)
-		{
-			++it;
-			continue;
-		}
-		TeTheme *theme = static_cast<TeTheme*> (it->second);
-		++it;
-		if (theme && theme->layer() && (theme->layer()->id() == layerId))
-		{
-			metaModel_->themeMap().erase(theme->id());
-			delete theme;
-		}
-	}
-	// delete layer and its entry in the layer map
-	TeLayer* layer = metaModel_->layerMap()[layerId];
-	metaModel_->layerMap().erase(layerId);
-	delete layer;
-
-	delete portal;
-	return true;
-}
-
-
-bool
-TeDatabase::deleteLayerTable (int layerId, TeAttrTableType ttype)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return false;
-
-	//tables of the type 1 can be relationed with other layer ??? Conferir
-	string query = "SELECT attr_table, table_id FROM te_layer_table WHERE layer_id = " + Te2String(layerId);
-	query += " AND attr_table_type = " + Te2String(static_cast<int>(ttype));
-	if(!portal->query(query))
-	{
-		delete portal;
-		return false;
-	}
-		
-	vector<int> tableIds;
-	string attrTable;
-	string tableId;
-	string drop;
-	while (portal->fetchRow())
-	{
-		attrTable = portal->getData(0);
-		tableId = portal->getData(1);
-		drop = "DROP TABLE " + attrTable;
-		if(tableExist(attrTable))
-		{
-			if(!execute(drop))
-			{
-				delete portal;
-				return false;
-			}
-		}
-		tableIds.push_back(atoi(tableId.c_str()));
-
-		if(tableExist("te_address_locator"))
-		{
-			string del  = "DELETE FROM te_address_locator WHERE table_id = "+ tableId;
-			execute(del);
-		}
-	}
-
-	delete portal;
-	string del;
-	if (existRelation("te_tables_relation","fk_tabrelation_laytable_id") != TeRICascadeDeletion)
-	{
-		for (unsigned int i=0; i<tableIds.size();i++)
-		{
-			del = "DELETE FROM te_tables_relation WHERE relation_id = " + Te2String(tableIds[i]);
-			if (!execute (del))
-				return false;
-		}
-	}
-	del = "DELETE FROM te_layer_table WHERE layer_id = " + Te2String(layerId);
-	if (!execute (del))
-		return false;
-	return true;
-}
-
-bool 
-TeDatabase::updateRepresentation (int layerId, TeRepresentation& rep)
-{
-	if (layerId <= 0)
-		return false;
-
-	string sql;
-	sql  = "UPDATE te_representation SET ";
-	sql += " lower_x= " + Te2String(rep.box_.x1(),15);
-	sql += ", lower_y= " + Te2String(rep.box_.y1(),15);
-	sql += ", upper_x= " + Te2String(rep.box_.x2(),15);
-	sql += ", upper_y= " + Te2String(rep.box_.y2(),15);
-	sql += ", description= '" + rep.description_ + "'";
-	sql += ", res_x= " + Te2String(rep.resX_,15);
-	sql += ", res_y= " + Te2String(rep.resY_,15);
-	sql += ", num_cols=" + Te2String(rep.nCols_);
-	sql += ", num_rows=" + Te2String(rep.nLins_);
-
-	if (rep.geomRep_ != TeTEXT)
-		sql += ", geom_table='" + rep.tableName_ + "'";
-
-	sql += " WHERE layer_id=" + Te2String(layerId);
-	sql += " AND geom_type= " + Te2String(rep.geomRep_);
-
-	if (rep.geomRep_ == TeTEXT)
-		sql += " AND geom_table='" + rep.tableName_ + "'";
-
-	return this->execute(sql);
-}
-
-bool 
-TeDatabase::insertRasterGeometry(const string& tableName, TeRasterParams& par, const string& objectId)
-{
-	if (tableName.empty())
-		return false;
-	
-	string objId; 
-	if (objectId.empty())
-		objId = "O1";
-	else
-		objId = objectId;
-
-	//------ this check is made for compatibility reasons with old versions of TerraLib databases
-	TeAttributeRep	attrRep;
-	attrRep.name_ = "tiling_type";
-	attrRep.type_ = TeINT;
-		
-	TeAttribute att;
-	if(!columnExist(tableName, attrRep.name_,att))
-	{
-		addColumn (tableName, attrRep);
-		string sql = "UPDATE " + tableName + " SET tiling_type = " + Te2String(static_cast<int>(TeRasterParams::TeExpansible));
-		this->execute(sql);
-	}
-
-	//------
-
-	// finds the name of the raster geometry table
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return false;
-
-	TeBox box = par.boundingBox();
-
-	string ins = "INSERT INTO " + tableName + " (object_id, raster_table, lut_table, ";
-	ins += "res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, ";
-	ins += "lower_x, lower_y, upper_x, upper_y, tiling_type) ";
-	ins += " VALUES ('" + objId + "', '" + par.fileName_+ "', '" +  par.lutName_ + "', ";
-	ins += Te2String(par.resx_) + ", " + Te2String(par.resy_) + ", ";
-	ins += Te2String(par.nBands()) + ", " + Te2String(par.ncols_) + ", " + Te2String(par.nlines_) + ", ";
-	ins += Te2String(par.blockHeight_) + ", " + Te2String(par.blockWidth_) + ", ";
-	ins += Te2String(box.x1_,15) +", " + Te2String(box.y1_,15) + ", ";
-	ins += Te2String(box.x2_,15) +", " + Te2String(box.y2_,15) + ", ";
-	ins	+= Te2String(par.tiling_type_) + ")";
-	if (!this->execute(ins))
-	{
-		delete portal;
-		return false;
-	}
-
-	// save the pallete associated to the raster
-	// if it doesn�t exist yet
-	if (par.photometric_[0] == TeRasterParams::TePallete && !par.lutName_.empty()) 
-	{
-		 if (!this->tableExist(par.lutName_))
-		 {
-			 if (this->createLUTTable(par.lutName_))
-			{
-				for (unsigned int i=0; i<par.lutb_.size(); i++)
-				{
-					string sql = "INSERT INTO " + par.lutName_ + " VALUES(";
-					sql += Te2String(i) + ", ";
-					sql += Te2String(par.lutr_[i]) + ", ";
-					sql += Te2String(par.lutg_[i]) + ", ";
-					sql += Te2String(par.lutb_[i]) + ")";
-					this->execute(sql);
-				}
-			 }
-		 }
-	}
-	
-	ins = "SELECT geom_id FROM " + tableName + " WHERE object_id='" + objId + "'";
-	ins += " AND raster_table='" + par.fileName_+ "'";
-	if(!portal->query(ins) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	int geomId = atoi(portal->getData(0));
-	delete portal;
-	string 	metadataTableName = tableName+"_metadata";
-	insertRasterMetadata(metadataTableName, geomId,par);
-	 return true;
-}
-
-bool 
-TeDatabase::updateRasterRepresentation(int layerId, TeRasterParams& par, const string& objectId)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return false;
-
-	string sql = "SELECT repres_id, lower_x, lower_y, upper_x, upper_y, geom_table ";
-	sql += " FROM te_representation WHERE layer_id= " + Te2String(layerId);
-	sql += " AND geom_type= " + Te2String(TeRASTER);
-
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	TeBox box (portal->getDouble(1),portal->getDouble(2),
-		       portal->getDouble(3),portal->getDouble(4));
-	int represId = atoi(portal->getData(0));
-	string rasterrep = portal->getData(5);
-	portal->freeResult();
-
-	updateBox(box,par.boundingBox());
-	sql = "UPDATE te_representation SET lower_x = " + Te2String(box.x1_,15);
-	sql += ", lower_y = " + Te2String(box.y1_,15) + ", upper_x = " + Te2String(box.x2_,15);
-	sql += ", upper_y = " + Te2String(box.y2_,15);
-
-	if(par.date_.isValid())
-	{	
-		std::string sqlTime = getSQLTime(par.date_);
-		if(!sqlTime.empty())
-		{
-			sql += ", initial_time = " + sqlTime;
-			sql += ", final_time = " + sqlTime;
-		}
-	}
-	sql += " WHERE repres_id=" + Te2String(represId);
-	if(!execute(sql))
-	{
-		delete portal;
-		return false;
-	}	 
-
-	string objId; 
-	if (objectId.empty())
-		objId = "O1";
-	else
-		objId = objectId;
-
-	box = par.boundingBox();
-
-	sql = "UPDATE " + rasterrep + " SET lut_table ='" + par.lutName_ + "'";
-	sql += ", res_x= " + Te2String(par.resx_,15) + ", res_y=" + Te2String(par.resy_,15);
-	sql += ", num_bands=" + Te2String(par.nBands()) + ", num_cols=" + Te2String(par.ncols_);
-	sql += ", num_rows=" + Te2String(par.nlines_) + ", block_height=" +  Te2String(par.blockHeight_);
-	sql += ", block_width= " + Te2String(par.blockWidth_) + ", lower_x = " + Te2String(box.x1_,15);
-	sql += ", lower_y = " + Te2String(box.y1_,15) +  ", upper_x = " + Te2String(box.x2_,15);
-	sql += ", upper_y = " + Te2String(box.y2_,15);
-	sql += "  WHERE object_id='" + objId + "' AND raster_table='" + par.fileName_ + "'";
-	if (!this->execute(sql))
-	{
-		delete portal;
-		return false;
-	}
-	
-	sql = "SELECT geom_id FROM " + rasterrep + " WHERE object_id='" + objId + "'";
-	sql+= " AND raster_table='" + par.fileName_+ "'";
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	// save the pallete associated to the raster
-	// if it doesn�t exist yet
-	if (par.photometric_[0] == TeRasterParams::TePallete && !par.lutName_.empty()) 
-	{
-
-		 if (!this->tableExist(par.lutName_))
-		 {
-			 if (this->createLUTTable(par.lutName_))
-			{
-				for (unsigned int i=0; i<par.lutb_.size(); i++)
-				{
-					string sql = "INSERT INTO " + par.lutName_ + " VALUES(";
-					sql += Te2String(i) + ", ";
-					sql += Te2String(par.lutr_[i]) + ", ";
-					sql += Te2String(par.lutg_[i]) + ", ";
-					sql += Te2String(par.lutb_[i]) + ")";
-					if (!this->execute(sql) )	
-					{
-						delete portal;
-						return false;						
-					}
-				}
-			 }
-		 }
-	}
-
-	int geomId = atoi(portal->getData(0));
-	delete portal;
-	string metadatatabel = rasterrep + "_metadata";
-	return updateRasterMetadata(metadatatabel,geomId,par);
-}
-
-bool 
-TeDatabase::insertRasterMetadata (const string& tableName, int geomId, TeRasterParams& par)
-{
-	if (geomId <= 0)
-		return false;
-	
-	string ins;
-	unsigned int i;
-
-	unsigned int nb = par.nBands();
-	ins = "INSERT INTO " + tableName + " (geom_id, band_id, min_value, max_value, ";
-	ins += " num_bits, data_type, photometric_type, compression_type ) VALUES (";
-	string vals;
-	for (i=0; i<nb; i++)
-	{
-		vals = Te2String(geomId) + ", " + Te2String(i) + ", ";
-		vals += Te2String(par.vmin_[i]) + ", " +  Te2String(par.vmax_[i]) + ", ";
-		vals += Te2String(par.nbitsperPixel_[i]) + ", " +  Te2String(par.dataType_[i]) + ", " ;
-		vals += Te2String(par.photometric_[i]) + ", " +  Te2String(par.compression_[i]) + " )" ;
-		string sql = ins + vals;
-		if (!this->execute(sql))
-			return false;
-	}
-
-	// update dummy value
-	if (par.useDummy_)
-	{
-		ins = "UPDATE " + tableName + " SET dummy = ";
-		for (i=0; i<nb; i++)
-		{
-			vals = Te2String(par.dummy_[i]) + " WHERE geom_id = " +  Te2String(geomId);
-			vals += " AND band_id=" + Te2String(i);
-			string sql = ins + vals;
-			if (!this->execute(sql))
-				return false;
-		}
-	}
-	return true;
-}
-
-bool 
-TeDatabase::updateRasterMetadata (const string& tableName, int geomId, TeRasterParams& par)
-{
-	if (geomId <= 0)
-		return false;
-
-	string sql = "DELETE FROM " + tableName + " WHERE geom_id = " + Te2String(geomId);
-	if (!this->execute (sql))
-		return false;
-	return insertRasterMetadata(tableName,geomId,par);
-}
-
-bool 
-TeDatabase::updateLegend (TeLegendEntry *legend)
-{
-	if (!legend)
-		return false;
-
-	string sql;
-	if (legend->id() > 0 )
-	{
-		sql = "UPDATE te_legend SET ";
-		sql += " theme_id=" + Te2String (legend->theme());
-		sql += ",group_id=" + Te2String (legend->group());
-		sql += ",num_objs=" + Te2String (legend->count());
-		sql += ",lower_value='" + escapeSequence(legend->from())+"'";
-		sql += ",upper_value='" + escapeSequence(legend->to())+"'";
-		sql += ",label='" + escapeSequence(legend->label())+"'";
-		sql += " WHERE legend_id=" + Te2String (legend->id());
-
-		if (execute(sql) == false)
-			return false;
-	}
-	else
-	{
-		if (!insertLegend(legend))
-			return false;
-	}
-	metaModel_->legendMap()[legend->id()] = legend;
-
-	return updateVisual(legend);
-}
-
-bool 
-TeDatabase::updateLegend (vector<TeLegendEntry>& legVec)
-{
-	unsigned int i;
-	for (i = 0; i < legVec.size(); ++i)
-	{
-		if(!updateLegend(&legVec[i]))
-			return false;
-	}
-	return true;
-}
-
-bool
-TeDatabase::updateVisual(TeLegendEntry *legend)
-{
-	if (!legend)
-		return false;
-
-	TeGeomRepVisualMap& mapVis = legend->getVisualMap();
-	TeGeomRepVisualMap::iterator it =  mapVis.begin();
-	while ( it != mapVis.end())
-	{ 
-			
-		TeGeomRep rep = it->first;
-		TeVisual* vis = it->second;
-
-		TeColor cor = vis->color();				// filling color
-		TeColor contourCor = vis->contourColor();// contour color
-
-		string update = "UPDATE te_visual SET ";
-		update += "red = "+ Te2String(cor.red_) + ", ";
-		update += "green =" + Te2String(cor.green_) + ", ";
-		update += "blue =" + Te2String(cor.blue_) + ", ";
-		update += "transparency =" + Te2String(vis->transparency()) + ", ";
-		update += "contour_red=" + Te2String(contourCor.red_) + ", ";
-		update += "contour_green=" + Te2String(contourCor.green_) + ", ";
-		update += "contour_blue=" + Te2String(contourCor.blue_) + ", "; 
-		update += "contour_transp=" + Te2String(vis->contourTransparency()) + ", ";
-		update += "contour_width=" + Te2String(vis->contourWidth()) + ", ";
-
-		if(rep == TePOLYGONS)
-		{
-			update += "width=" + Te2String(vis->contourWidth()) + ", ";
-			update += "contour_symb_id=" + Te2String(vis->contourStyle()) + ", ";
-			update += "symb_id=" + Te2String(vis->style()) + ", ";
-		}
-		else if(rep == TeLINES)
-		{
-			update += "width=" + Te2String(vis->width()) + ", ";
-			update += "symb_id=" + Te2String(vis->style()) + ", ";
-		}
-		else if(rep == TePOINTS)
-		{
-			update += "size_value=" + Te2String(vis->size()) + ", ";
-			update += "symb_id=" + Te2String(vis->style ()) + ", ";
-		}
-		else if(rep == TeTEXT)
-		{
-			update += "size_value=" + Te2String(vis->size()) + ", ";
-			update += "pt_angle=" + Te2String(vis->ptAngle()) + ", ";
-		}
-
-		update += "family='" + vis->family() + "', ";
-		if (vis->bold())
-			update += "bold=1, ";
-		else
-			update += "bold=0, ";
-
-		if (vis->italic())
-			update += "italic=1, ";
-		else
-			update += "italic=0, ";
-
-		update += "fixed_size=" + Te2String(vis->fixedSize())+ ", ";
-		update += "alignment_vert=" + Te2String(vis->alignmentVert())+ ", ";
-		update += "alignment_horiz=" + Te2String(vis->alignmentHoriz())+ ", ";
-		update += "tab_size=" + Te2String(vis->tabSize())+ ", ";
-		update += "line_space=" + Te2String(vis->lineSpace());
-
-		update += " WHERE legend_id= " + Te2String(legend->id()) ;
-		update += " AND geom_type= " + Te2String(rep);
-
-		if (!execute(update))
-			return false;
-		++it;
-	}
-	return true;
-}
-
-bool
-TeDatabase::updateVisual(vector<TeLegendEntry>& legVec)
-{
-	unsigned int i;
-
-	// Update the te_visual table
-	TeTable visualTable;
-	selectTable("te_visual", "1=0", visualTable);
-	TeAttributeList& visualAttrList = visualTable.attributeList();
-	TeAttribute& visualAttr0 = visualAttrList[0];		// legend_id
-	visualAttr0.rep_.isPrimaryKey_ = true;
-	visualAttr0.rep_.isAutoNumber_ = false;
-	TeAttribute& visualAttr1 = visualAttrList[1];		// geom_type
-	visualAttr1.rep_.isPrimaryKey_ = true;
-	visualAttr1.rep_.isAutoNumber_ = false;
-
-	TeGeomRepVisualMap::iterator it;
-	for (i = 0; i < legVec.size(); ++i)
-	{
-		TeLegendEntry& leg = legVec[i];
-		for (it = leg.getVisualMap().begin(); it != leg.getVisualMap().end(); ++it)
-		{
-			string style, contourStyle, sizeValue, width;
-			int geomRep = it->first;
-			int legId = leg.id();
-			TeVisual* visual = it->second;
-			TeTableRow row;
-
-			if(geomRep == TePOLYGONS || geomRep == TeCELLS)
-			{
-				sizeValue = Te2String(0);
-				contourStyle = Te2String(visual->contourStyle());
-				width =  Te2String(0);
-				style = Te2String(it->second->style());
-			}
-			else if(geomRep == TeLINES)
-			{
-				sizeValue = Te2String(0);
-				contourStyle = Te2String(0);
-				width = Te2String(visual->width());
-				style = Te2String(visual->style());
-			}
-			else if(geomRep == TePOINTS)
-			{
-				sizeValue = Te2String(visual->size());
-				contourStyle = Te2String(0);
-				width = Te2String(0);
-				style = Te2String(visual->style());
-			}
-			else if(geomRep == TeTEXT)
-			{
-				sizeValue = Te2String(visual->size());
-				contourStyle = Te2String(0);
-				width = Te2String(0);
-				style = Te2String(0);
-			}
-		
-			row.push_back(Te2String(legId));						// legend_id
-			row.push_back(Te2String(geomRep));						// geom_type
-			row.push_back(style);									// symb_id
-			row.push_back(Te2String(visual->color().red_));			// red
-			row.push_back(Te2String(visual->color().green_));		// green
-			row.push_back(Te2String(visual->color().blue_));			// blue
-			row.push_back(Te2String(visual->transparency()));		// transparency
-			row.push_back(width);									// width
-			row.push_back(contourStyle);							// contour_symb_id
-			row.push_back(Te2String(visual->contourColor().red_));	// contour_red
-			row.push_back(Te2String(visual->contourColor().green_));	// contour_green
-			row.push_back(Te2String(visual->contourColor().blue_));	// contour_blue
-			row.push_back(Te2String(visual->contourTransparency()));	// contour_transp
-			row.push_back(Te2String(visual->contourWidth()));		// contour_width
-			row.push_back(sizeValue);								// size_value
-			row.push_back(Te2String(visual->ptAngle()));				// pt_angle
-			row.push_back(visual->family());							// family
-			if (visual->bold())										// bold
-				row.push_back("1");
-			else
-				row.push_back("0");
-			if (visual->italic())									// italic
-				row.push_back("1");
-			else
-				row.push_back("0");
-
-			row.push_back(Te2String(visual->alignmentVert()));		// alignment_vert
-			row.push_back(Te2String(visual->alignmentHoriz()));		// alignment_horiz
-			row.push_back(Te2String(visual->tabSize()));				// tab_size
-			row.push_back(Te2String(visual->lineSpace()));			// line_space
-
-			if (visual->fixedSize())									// fixed_size
-				row.push_back("1");
-			else
-				row.push_back("0");
-
-			visualTable.add(row);
-		}
-	}
-	return insertTable(visualTable);
-}
-
-bool 
-TeDatabase::loadLegend (TeAbstractTheme *theme, const string& visualType)
-{
-	if (!theme)
-		return false;
-	
-	theme->cleanLegend();
-
-	string rest;
-	if (theme->id() > 0)
-		rest = " te_theme.theme_id = "+  Te2String(theme->id());
-	else if (!theme->name().empty())
-		rest = " te_theme.name = '"+  theme->name() + "'";
-	else
-		return false;
-	
-	//load legend and visual
-	string sql = " SELECT ";
-	sql += " te_legend.*,  "; // 0 - 6  (7 columns)
-	sql += " te_visual.*  "; //  7		(24 columns)
-	sql += " FROM ((te_theme LEFT JOIN te_legend ON te_theme.theme_id = te_legend.theme_id ) ";
-	sql += " LEFT JOIN te_visual ON te_legend.legend_id = te_visual.legend_id ) ";
-	sql += " WHERE "+ rest;
-	sql += " ORDER BY te_legend.legend_id, te_legend.group_id, te_visual.geom_type  "; 
-
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-	
-	if (!portal->query(sql) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	//load all legends of this theme
-	//and its visual
-	bool hasLegsToThisTheme = true;
-	bool hasNewRow = true;
-	while(hasLegsToThisTheme)
-	{
-		//legend
-		TeLegendEntry legend;
-		if(!portal->getLegend(legend, 0))
-		{
-			delete portal;
-			return false;
-		}
-
-		//visual
-		bool hasVisualToThisLeg = true;
-		while(hasVisualToThisLeg)
-		{
-			TeVisual* visual = TeVisualFactory::make(visualType);
-			TeGeomRep geomRep;
-			if(portal->getVisual(visual, geomRep, 7))
-				legend.setVisual(visual, geomRep);
-								
-			hasNewRow = portal->fetchRow();
-			if(!hasNewRow || portal->getInt(2)!= legend.group() || portal->getInt(0)!= legend.id())
-				hasVisualToThisLeg = false;
-		}
-
-		//Set legend to this theme
-		theme->legend(legend); 
-														
-		//fill legend buffer
-		if(legend.group() == -6)	
-			metaModel_->legendMap()[legend.id()] = &theme->queryAndPointingLegend();
-		else if(legend.group() == -5)	
-			metaModel_->legendMap()[legend.id()] = &theme->queryLegend(); 
-		else if (legend.group() == -4)
-			metaModel_->legendMap()[legend.id()] = &theme->pointingLegend(); 
-		else if (legend.group() == -3)
-			metaModel_->legendMap()[legend.id()] = &theme->defaultLegend(); 
-		else if (legend.group() == -2)
-			metaModel_->legendMap()[legend.id()] = &theme->withoutDataConnectionLegend(); 
-		else if (legend.group() == -1)
-			metaModel_->legendMap()[legend.id()] = &theme->outOfCollectionLegend(); 
-		else if (legend.group() == -10) //own legend
-		{
-			TeLegendEntry* legendTemp = new TeLegendEntry(legend);
-			metaModel_->legendMap()[legend.id()] = legendTemp;
-		}
-		
-		if(!hasNewRow || portal->getInt(0)!= theme->id())
-			hasLegsToThisTheme = false;
-	}
-			
-	for (unsigned int i = 0; i < theme->legend().size(); ++i)
-		metaModel_->legendMap()[theme->legend()[i].id()] = &theme->legend()[i];
-
-	delete portal;
-	return true;
-}
-
-
-bool 
-TeDatabase::updateProjection (TeProjection *proj)
-{
-	if (proj->id() <= 0)
-		return false;
-	string sql;
-	sql = "UPDATE te_projection SET ";
-	sql += "name='" + proj->name() + "',";
-	sql += " long0=" + Te2String(proj->params().lon0*TeCRD,15)+ ",";
-	sql += " lat0=" + Te2String(proj->params().lat0*TeCRD,15) + ",";
-	sql += " offx=" +Te2String(proj->params().offx,15) + ",";
-	sql += " offy=" +Te2String(proj->params().offy,15) + ",";
-	sql += " stlat1="+ Te2String(proj->params().stlat1*TeCRD,15) + ",";
-	sql += " stlat2=" +Te2String(proj->params().stlat2*TeCRD,15) + ",";
-	sql += " unit='" + proj->params().units + "',";
-	sql += " scale=" + Te2String(proj->params().scale) + ",";
-	sql += " hemis=" + Te2String(proj->params().hemisphere) + ",";
-	sql += " datum='" + proj->datum().name() + "',";
-	sql += " radius=" + Te2String(proj->datum().radius(),15) + ",";
-	sql += " flattening=" + Te2String(proj->datum().flattening(),15) + ",";
-	sql += " dx=" + Te2String(proj->datum().xShift(),15) + ",";
-	sql += " dy=" + Te2String(proj->datum().yShift(),15) + ",";
-	sql += " dz=" + Te2String(proj->datum().zShift(),15) ;
-	sql += " WHERE projection_id = " + Te2String(proj->id());
-	return this->execute(sql);
-}
-
-TeProjection* 
-TeDatabase::loadProjection (int projId)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	string sql ="SELECT * FROM te_projection WHERE projection_id = " + Te2String (projId);
-
-	if (!portal->query(sql))
-	{
-		delete portal;
-		return 0;
-	}
-
-	// Look for the projection
-	if (!portal->fetchRow())
-	{
-		delete portal;
-		return 0;
-	}
-
-	TeProjection* proj = 0;
-	if(!portal->getProjection(&proj))
-	{
-		if(proj)
-			delete proj;
-		delete portal;
-		return 0;
-	}
-
-	delete portal;
-	return proj;
-}
-
-bool
-TeDatabase::insertPolygonSet(const string& table, TePolygonSet &ps)
-{
-	if (!beginTransaction())
-		return false;
-	for (unsigned int i = 0; i < ps.size(); i++ )
-	{
-		TePolygon& poly = ps [i];
-		if (!insertPolygon (table,poly))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::updatePolygonSet (const string& table, TePolygonSet &ps)
-{
- 	if (!beginTransaction())
-		return false;
-	for (unsigned int i = 0; i < ps.size(); i++ )
-	{
-		TePolygon& poly = ps [i];
-		if (!updatePolygon (table,poly))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::selectPolygonSet (const string& table, const string& criteria, TePolygonSet &ps)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	string sql ="SELECT * FROM " + table;
-	if (!criteria.empty())
-		sql += " WHERE " + criteria;
-	sql += " ORDER BY object_id ASC, parent_id, num_holes DESC, ext_max ASC";
-	 
-	if (!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-	if (!portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	bool flag = true;
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		ps.add(poly);
-	}
-	while (flag);
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::loadPointSet(TeTheme* theme, TePointSet &ps)
-{
-	string collTable = theme->collectionTable();
-	if (collTable.empty())
-		return false;
-
-	TeLayer* themeLayer = theme->layer();
-	if (!themeLayer->hasGeometry(TePOINTS))
-		return false;
-	
-	string pointTable = themeLayer->tableName(TePOINTS);
-	if (pointTable.empty())
-		return false;
-
-	string sql = "SELECT * FROM (" + pointTable + " RIGHT JOIN " + collTable;
-	sql = sql + " ON " + pointTable + ".object_id = " + collTable + ".c_object_id)";
-
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	if (!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-	do {
-		TePoint pt;
-		flag =  portal->fetchGeometry(pt);
-		ps.add(pt);
-	}
-	while (flag);
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::loadLineSet(TeTheme* theme, TeLineSet &ls)
-{
-	string collTable = theme->collectionTable();
-	if (collTable.empty())
-		return false;
-
-	TeLayer* themeLayer = theme->layer();
-	if (!themeLayer->hasGeometry(TeLINES))
-		return false;
-	
-	string lineTable = themeLayer->tableName(TeLINES);
-	if (lineTable.empty())
-		return false;
-
-	string sql = "SELECT * FROM (" + lineTable + " RIGHT JOIN " + collTable;
-	sql = sql + " ON " + lineTable + ".object_id = " + collTable + ".c_object_id)";
-
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	if (!portal->query(sql)  || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	bool flag;
-	do 
-	{
-		TeLine2D lin;
-		flag = portal->fetchGeometry(lin);
-		ls.add(lin);
-	}while(flag);
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::loadPolygonSet (const string& table, const string& geoid, TePolygonSet &ps)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	string q ="SELECT * FROM " + table;
-
-	if (!geoid.empty())
-		q += " WHERE object_id = '" + geoid +"'";
-	q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
-
-	if (!portal->query(q))
-	{	
-		delete portal;
-		return false;
-	}
-
-	if (!portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	bool flag = true;
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		ps.add(poly);
-	}
-	while (flag);
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::loadPolygonSet (const string& table, TeBox &bb, TePolygonSet &polSet)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	string q;
-	q = "SELECT * FROM " + table + " WHERE ";
-	q += this->getSQLBoxWhere (bb, TePOLYGONS);
-	q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-	bool flag = true;
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		polSet.add(poly);
-	}
-	while (flag);
-	delete portal;
-	return true;
-}
-
-TeDatabasePortal* 
-TeDatabase::loadPolygonSet(const string& table, TeBox &box)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return 0;
-
-	string q;
-	q = "SELECT * FROM " + table + " WHERE ";
-	q += this->getSQLBoxWhere (box, TePOLYGONS);
-	q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{	
-		delete portal;
-		return 0;
-	}
-	else 
-		return portal;
-}
-
-
-bool 
-TeDatabase::locatePolygon (const string& table, TeCoord2D &pt, TePolygon &polygon, const double& tol)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-
-	string q = "SELECT * FROM " + table + " WHERE " + getSQLBoxWhere(box, TePOLYGONS);
-	q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		if (TeWithin (TePoint(pt), poly))
-		{
-			polygon = poly;
-			delete portal;
-			return true;
-		}
-	}
-	while (flag);
-	delete portal;
-	return false;
-}
-
-
-bool 
-TeDatabase::locatePolygonSet (const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-
-	string q;
-	q = "SELECT * FROM " + table + " WHERE lower_x < " + Te2String(box.x2(),6);
-	q += " AND upper_x > " + Te2String(box.x1(),6);
-	q += " AND lower_y < " + Te2String(box.y2(),6);
-	q += " AND upper_y > " + Te2String(box.y1(),6);
-	q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-	bool flag = true;
-	polygons.clear();
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		if (TeWithin (TePoint(pt), poly))
-			polygons.add(poly);
-	}
-	while (flag);
-	delete portal;
-
-	if(polygons.size())
-		return (true);
-	return false;
-}
-
-bool 
-TeDatabase::loadPolygonSet(TeTheme* theme, TePolygonSet &ps)
-{
-	string collTable = theme->collectionTable();
-	if (collTable.empty())
-		return false;
-
-	TeLayer* themeLayer = theme->layer();
-	if (!themeLayer->hasGeometry(TePOLYGONS))
-		return false;
-	
-	string polygonTable = themeLayer->tableName(TePOLYGONS);
-	if (polygonTable.empty())
-		return false;
-
-	string sql = "SELECT * FROM (" + polygonTable + " RIGHT JOIN " + collTable;
-	sql = sql + " ON " + polygonTable + ".object_id = " + collTable + ".c_object_id)";
-	sql += " ORDER BY " + polygonTable + ".parent_id, ";
-	sql += polygonTable + ".num_holes DESC, " + polygonTable + ".ext_max ASC";
-
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	if (!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-		ps.add ( poly );
-	}
-	while (flag);		
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::insertLineSet	(const string& table, TeLineSet &ls)
-{
-	if (!beginTransaction())
-		return false;
-
-	for (unsigned int i = 0; i < ls.size(); i++ )
-	{
-		TeLine2D& line = ls [i];
-		if (!insertLine (table,line))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::updateLineSet	(const string& table, TeLineSet &ls)
-{
-	if (!beginTransaction())
-		return false;
-
-	for (unsigned int i = 0; i < ls.size(); i++ )
-	{
-		TeLine2D line = ls [i];
-		if (!updateLine (table,line))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::loadLineSet (const string& table, const string& geoid, TeLineSet &ls)
-{
-	TeDatabasePortal *portal = this->getPortal();
-
-	string q ="SELECT * FROM " + table;
-
-	if (!geoid.empty())
-		q += " WHERE object_id = '" + geoid +"'";
-
-	q += " ORDER BY ext_max DESC";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-	do 
-	{
-		TeLine2D line;
-		flag = portal->fetchGeometry(line);
-		ls.add ( line );
-	}while(flag);
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::loadLineSet (const string& table, TeBox &bb, TeLineSet &linSet)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	string q;
-	q = "SELECT * FROM " + table + " WHERE ";
-	q += this->getSQLBoxWhere (bb, TeLINES);
-	q += " ORDER BY ext_max DESC";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-	bool flag = true;
-	do
-	{
-		TeLine2D lin;
-		flag = portal->fetchGeometry(lin);
-		linSet.add(lin);
-	}
-	while (flag);
-	delete portal;
-	return true;
-}
-
-TeDatabasePortal* 
-TeDatabase::loadLineSet (const string& table, TeBox &box)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return 0;
-
-	string q;
-	q = "SELECT * FROM " + table + " WHERE ";
-	q += this->getSQLBoxWhere (box, TeLINES);
-	q += " ORDER BY ext_max DESC";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{	
-		delete portal;
-		return 0;
-	}
-	return portal;
-}
-
-bool 
-TeDatabase::selectLineSet (const string& table, const string& criteria, TeLineSet &ls)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	string q ="SELECT * FROM " + table;
-	if (!criteria.empty())
-		q += " WHERE " + criteria;
-	q += " ORDER BY object_id ASC, geom_id ASC";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-	do 
-	{
-		TeLine2D line;
-		flag = portal->fetchGeometry(line);
-		ls.add ( line );
-	}while(flag);
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::locateLine (const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-	string q ="SELECT * FROM " + table;
-	char buf [1024];
-	sprintf (buf," WHERE lower_x < %f AND upper_x > %f AND lower_y < %f AND upper_y > %f",
-		box.x2(),box.x1(),box.y2(),box.y1());
-	q += buf;
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	// Get all lines
-	TeLineSet ls;
-	int k;
-	bool flag = true;
-	do 
-	{
-		TeLine2D l;
-		flag = portal->fetchGeometry( l );
-		ls.add ( l );
-	} while (flag);
-
-	delete portal;
-
-	TeCoord2D paux;
-
-	if (TeNearest (pt, ls, k, paux, tol))
-	{
-		line = ls[k];
-		return true;
-	}
-	return false;
-}
-
-bool 
-TeDatabase::insertPointSet	(const string& table, TePointSet &ps)
-{
-	if (!beginTransaction())
-		return false;
-
-	for (unsigned int i = 0; i < ps.size(); i++ )
-	{
-		TePoint& point = ps [i];
-		if (!insertPoint (table,point))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::updatePointSet (const string& table, TePointSet &ps)
-{
-	if (!beginTransaction())
-		return false;
-	
-	for (unsigned int i = 0; i < ps.size(); i++ )
-	{
-		TePoint point = ps [i];
-		if (!updatePoint (table,point))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::loadPointSet (const string& table, const string& geoid, TePointSet &ps)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	string q ="SELECT * FROM " + table;
-
-	if (!geoid.empty())
-		q += " WHERE object_id = '" + geoid +"'";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-	do 
-	{
-		TePoint point;
-		flag = portal->fetchGeometry (point);
-		ps.add ( point );
-	}while (flag);
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::loadPointSet (const string& table, TeBox &bb, TePointSet &ps)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	string q;
-	q = "SELECT * FROM " + table + " WHERE ";
-	q += this->getSQLBoxWhere (bb, TePOINTS);
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-	bool flag = true;
-	do
-	{
-		TePoint pt;
-		flag = portal->fetchGeometry(pt);
-		ps.add(pt);
-	}
-	while (flag);
-	delete portal;
-	return true;
-}
-
-TeDatabasePortal* 
-TeDatabase::loadPointSet(const string& table, TeBox &box)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	if (!portal)
-		return 0;
-
-	string q;
-	q = "SELECT * FROM " + table + " WHERE ";
-	q += this->getSQLBoxWhere (box, TePOINTS);
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{	
-		delete portal;
-		return 0;
-	}
-	return portal;
-}
-
-bool 
-TeDatabase::selectPointSet (const string& table, const string& criteria, TePointSet &ps)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	string q ="SELECT * FROM " + table;
-	if (!criteria.empty())
-		q += " WHERE " + criteria;
-	q += " ORDER BY object_id ASC, geom_id ASC";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-	do 
-	{
-		TePoint point;
-		flag = portal->fetchGeometry (point);
-		ps.add ( point );
-	}while (flag);
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::locatePoint (const string& table, TeCoord2D &pt, TePoint &point, const double& tol)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-	string q ="SELECT * FROM " + table;
-	char buf [1024];
-	sprintf (buf," WHERE x < %f AND x > %f AND y < %f AND y > %f",
-		box.x2(),box.x1(),box.y2(),box.y1());
-	q += buf;
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	TePointSet ps;
-	bool flag = true;
-	do 
-	{
-		TePoint point;
-		flag = portal->fetchGeometry (point);
-		ps.add ( point );
-	}while (flag);
-
-	delete portal;
-	int k;
-	if (TeNearest (pt, ps, k, tol))
-	{
-		point = ps[k];
-		return true;
-	}
-	return false;
-}
-
-bool 
-TeDatabase::insertTextSet	(const string& table, TeTextSet &ts)
-{
-	if (!beginTransaction())
-		return false;
-
-	for (unsigned int i = 0; i < ts.size(); i++ )
-	{
-		TeText& text = ts [i];
-		if (!insertText (table,text))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::updateTextSet	(const string& table, TeTextSet &ts)
-{
-	if (!beginTransaction())
-		return false;
-	for ( unsigned int i = 0; i < ts.size(); i++ )
-	{
-		TeText text = ts [i];
-		if (!updateText (table,text))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::loadTextSet (const string& table, const string& geoid, TeTextSet &ts)
-{
-	TeDatabasePortal *portal = this->getPortal();
-	
-	string q ="SELECT * FROM " + table;
-	if (!geoid.empty())
-		q += " WHERE object_id = '" + geoid +"'";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	// Look for all texts
-	bool flag  = true;
-	do
-	{
-		TeText p;
-		flag = portal->fetchGeometry(p);
-		ts.add ( p );
-	} while (flag);
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::selectTextSet (const string& table, const string& criteria, TeTextSet &ts)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	string q ="SELECT * FROM " + table;
-	if (!criteria.empty())
-		q += " WHERE " + criteria;
-	q += " ORDER BY object_id ASC, geom_id ASC";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	// Look for all texts
-	bool flag = true;
-	do
-	{
-		TeText p;
-		flag = portal->fetchGeometry(p);
-		ts.add ( p );
-	} while (flag);
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::updateText(const string& table, TeText &t)
-{
-	string sql;
-	sql = "UPDATE " + table + " SET ";
-    sql += "x=" + Te2String(t.location().x(),15) + ", ";
-	sql += "y=" + Te2String(t.location().y(),15) + ", ";
-	sql += "text_value='" + t.textValue() + "', ";
-	sql += "angle=" + Te2String(t.angle(),15) + ", ";
-	sql += "height=" + Te2String(t.height(),15) + ",";
-	sql += "alignment_vert=" + Te2String(t.alignmentVert(),15) + ",";
-	sql += "alignment_horiz=" + Te2String(t.alignmentHoriz(),15);
-    sql += " WHERE geom_id=" + Te2String(t.geomId());
-	return (this->execute(sql));
-}
-
-bool 
-TeDatabase::updateNode(const string& table, TeNode &node)
-{
-	string sql;
-	sql = "UPDATE " + table + " SET ";
-    sql += "x=" + Te2String(node.location().x(),15) + ", ";
-	sql += "y=" + Te2String(node.location().y(),15);
-    sql += " WHERE geom_id = " + Te2String(node.geomId());
-	return (this->execute(sql));
-}
-
-bool 
-TeDatabase::updatePoint(const string& table, TePoint &p)
-{
-	string sql;
-	sql = "UPDATE " + table + " SET ";
-    sql += "x=" + Te2String(p.location().x(),15) + ", ";
-	sql += "y=" + Te2String(p.location().y(),15);
-    sql += " WHERE geom_id = " + Te2String(p.geomId());
-	return (this->execute(sql));
-}
-
-bool TeDatabase::locateText (const string& table, TeCoord2D &pt, TeText &text, const double& tol)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-	string q ="SELECT * FROM " + table;
-	char buf [1024];
-	sprintf (buf," WHERE x < %f AND x > %f AND y < %f AND y > %f",
-		box.x2(),box.x1(),box.y2(),box.y1());
-	q += buf;
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	// Look for all texts
-	bool flag = true;
-	TeTextSet ts;
-	do
-	{
-		TeText p;
-		flag = portal->fetchGeometry(p);
-		ts.add ( p );
-	} while (flag);
-
-	delete portal;
-
-	int k;
-	if (TeNearest (pt, ts, k, tol))
-	{
-		text = ts[k];
-		return true;
-	}
-	return false;
-}
-
-bool 
-TeDatabase::insertArcSet	(const string& table, TeArcSet &as)
-{
-	if (!beginTransaction())
-		return false;
-
-	for (unsigned int i = 0; i < as.size(); i++ )
-	{
-		TeArc& arc = as [i];
-		if (!insertArc (table,arc))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::updateArcSet	(const string& table, TeArcSet &as)
-{
-	if (!beginTransaction())
-		return false;
-
-	for ( unsigned int i = 0; i < as.size(); i++ )
-	{
-		TeArc arc = as [i];
-		if (!updateArc (table,arc))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::loadArcSet (const string& table, const string& geoid, TeArcSet &as)
-{
-
-	TeDatabasePortal* portal = this->getPortal();
-	string q ="SELECT * FROM " + table;
-	if (!geoid.empty())
-		q += " WHERE object_id = " + geoid;
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	// Look for all nodes
-	bool flag;
-	do 
-	{
-		TeArc arc;
-		flag = portal->fetchGeometry(arc);
-		as.add (arc);
-	} while (flag);
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::updateArc(const string& table, TeArc &arc)
-{
-	string sql;
-	sql = "UPDATE"+ table +" SET ";
-    sql += "from_node=" + Te2String(arc.fromNode().geomId()) + ", ";
-	sql += "to_node=" + Te2String(arc.toNode().geomId());
-    sql += " WHERE geom_id = " + arc.geomId();
-	return (this->execute(sql));
-}
-
-bool 
-TeDatabase::insertNodeSet	(const string& table, TeNodeSet &ns)
-{
-	if (!beginTransaction())
-		return false;
-
-	for (unsigned int i = 0; i < ns.size(); i++ )
-	{
-	     TeNode& no = ns [i];
-	     if (!insertNode (table,no))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::updateNodeSet	(const string& table, TeNodeSet &ns)
-{
-	if (!beginTransaction())
-		return false;
-
-	for (unsigned int i = 0; i < ns.size(); i++ )
-	{
-		TeNode no = ns [i];
-		if (!updateNode (table,no))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::loadNodeSet (const string& table, const string& geoid, TeNodeSet &ns)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	string q ="SELECT * FROM " + table;
-	if (!geoid.empty())
-		q += " WHERE object_id = " + geoid;
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	bool flag = true;
-	do 
-	{
-		TeNode n;
-		flag = portal->fetchGeometry(n);
-		ns.add ( n );
-	}while (flag);
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::insertCellSet	(const string& table, TeCellSet &cs)
-{
-	if (!beginTransaction())
-		return false;
-
-	for (unsigned int i = 0; i < cs.size(); i++ )
-	{
-		TeCell& cell = cs [i];
-		if (!insertCell (table,cell))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool
-TeDatabase::updateCellSet	(const string& table, TeCellSet &cs)
-{
-	if (!beginTransaction())
-		return false;
-
-	for (unsigned int i = 0; i < cs.size(); i++ )
-	{
-		TeCell cell = cs [i];
-		if (!updateCell (table,cell))
-		{
-			rollbackTransaction();
-			return false;
-		}
-	}
-	if (!commitTransaction())
-	{
-		rollbackTransaction();
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::loadCellSet (const int& layerId, const string& table, const string& geoid, TeCellSet &cs)
-{
-
-	TeDatabasePortal *portal = this->getPortal();
-
-	// Get the cell set resolution
-	string q  = "SELECT * FROM te_representation WHERE layer_id = " + Te2String(layerId);
-	q += " AND geom_type = " + Te2String(TeCELLS);
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	cs.resX(portal->getDouble("res_x"));
-	cs.resY(portal->getDouble("res_y"));
-	
-	portal->freeResult();
-		
-	q = "SELECT * FROM " + table;
-	if (!geoid.empty())
-		q += " WHERE object_id = '" + geoid +"'";
-	q += " ";
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	bool flag;
-	do 
-	{
-		TeCell cell;
-		flag = portal->fetchGeometry(cell);
-		cs.add ( cell );
-	} while (flag);
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::selectCellSet (const int& layerId, const string& table, const string& criteria, TeCellSet &cs)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	string q = "SELECT * FROM te_representation WHERE layer_id = " ;
-	q += Te2String(layerId) + " AND geom_type = " + Te2String(TeCELLS);
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	cs.resX(portal->getDouble("res_x"));
-	cs.resY(portal->getDouble("res_y"));
-	portal->freeResult();
-	
-	q ="SELECT * FROM " + table;
-	if (!criteria.empty())
-		q += " WHERE " + criteria;
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	bool flag;
-	do 
-	{
-		TeCell cell;
-		flag = portal->fetchGeometry(cell);
-		cs.add ( cell );
-	} while (flag);
-
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::updateCell(const string& table, TeCell &c)
-{
-	TeBox b = c.box();
-
-	string sql;
-	sql = "UPDATE "+ table +"  SET ";
-	sql += "lower_x=" + Te2String(b.lowerLeft().x(),15) + ", ";
-	sql += "lower_y=" + Te2String(b.lowerLeft().y(),15) + ", ";
-	sql += "upper_x=" + Te2String(b.upperRight().x(),15) + ", ";
-	sql += "upper_y=" + Te2String(b.upperRight().y(),15) + ", ";
-	sql += "col_number=" + Te2String(c.column()) + ", ";
-	sql += "row_number=" + Te2String(c.line());
-	sql += " WHERE geom_id = " + c.geomId();
-	return (this->execute(sql));
-}
-
-bool 
-TeDatabase::locateCell (const string& table, TeCoord2D &pt, TeCell &cell, const double& /* tol */)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	string q ="SELECT * FROM " + table;
-	char buf [1024];
-	sprintf (buf," WHERE lower_x < %f AND upper_x > %f AND lower_y < %f AND upper_y > %f",
-		pt.x(),pt.x(),pt.y(),pt.y());
-	q += buf;
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	portal->fetchGeometry(cell);
-	delete portal;
-	return true;
-}
-
-bool TeDatabase::removeGeometry(const string& tableName, const TeGeomRep& rep, const int& geomId)
-{
-	if(tableName.empty())
-	{
-		return false;
-	}
-
-	std::string remove = "DELETE FROM " + tableName;
-	if(rep == TePOLYGONS)
-	{
-		remove += " WHERE geom_id = " + geomId;
-	}
-	else
-	{
-		remove += " WHERE parent_id = " + geomId;
-	}
-
-	return execute(remove);
-}
-
-bool
-TeDatabase::inClauseValues(const string& query, const string& /* attribute */, vector<string>& inClauseVector)
-{
-	inClauseVector.push_back( "(" + query + ")" );
-	return true;
-}
-
-//Spatial query
-//retornam um portal
-
-bool 
-TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabasePortal *portal, int relate, const string& actCollTable)
-{
-	return (TeTopologicalRelation(actGeomTable, actRep, actIdsIn, portal, relate, actCollTable));
-}
-
-bool 
-TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, const string& visGeomTable, TeGeomRep visRep, TeDatabasePortal *portal, int relate, const string& visCollTable)
-{
-	return (TeTopologicalRelation(actGeomTable, actRep, actIdsIn, visGeomTable, visRep, portal, relate, visCollTable));
-}
-
-bool 
-TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, TeDatabasePortal *portal, int relate, const string& actCollTable)
-{
-	return (TeTopologicalRelation(actGeomTable, actRep, geom, portal, relate, actCollTable));
-}
-
-//retornam um vetor de object_ids resultantes da consulta
-bool 
-TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeKeys& actIdsOut, int relate, const string& actCollTable)
-{
-	return (TeTopologicalRelation(actGeomTable, actRep, actIdsIn, actIdsOut, this, relate, actCollTable));
-}
-
-bool 
-TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, const string& visGeomTable, TeGeomRep visRep, TeKeys& visIdsOut, int relate, const string& visCollTable, TeDatabase* dbVis)
-{
-	return (TeTopologicalRelation(actGeomTable, actRep, actIdsIn, visGeomTable, visRep, visIdsOut, this, relate, visCollTable, dbVis));
-}
-
-bool 
-TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, TeKeys& actIdsOut, int relate, const string& actCollTable)
-{
-	return (TeTopologicalRelation(actGeomTable, actRep, geom, actIdsOut, this, relate, actCollTable));
-}
-
-//metric functions
-bool
-TeDatabase::calculateArea(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, double &area)
-{
-	return (TeGetArea(actGeomTable, actRep, actIdsIn, this, area));
-}
-
-bool 
-TeDatabase::calculateLength(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn , double& length )
-{
-	return (TeGetLength(actGeomTable, actRep, actIdsIn, this, length));
-}
-
-bool 
-TeDatabase::calculateDistance(const string& actGeomTable, TeGeomRep actRep, TeKeys& Ids, double& distance)
-{
-	return (TeGetDistance(actGeomTable, actRep, Ids, this, distance));
-}
-
-bool 
-TeDatabase::calculateDistance(const string& /* actGeomTable */, TeGeomRep /*actRep */, const string& /* objId1 */, const string& /* visGeomTable */, TeGeomRep /* visRep */, const string& /* objId2 */, double& /* distance */)
-{
-	return false;
-}
-
-bool 
-TeDatabase::withinDistance(const string& actGeomTable, TeGeomRep actRep, const TeCoord2D& coord, TeKeysToDist& IdsDistOut, const double& max_distance, const string& actCollTable)
-{
-	return (TeGetWithinDistance(actGeomTable, actRep, coord, IdsDistOut, this, max_distance, actCollTable));
-}
-
-// functions that generate new geometry
-bool 
-TeDatabase::buffer(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TePolygonSet& bufferSet, double dist)
-{
-	return (TeGetBuffer(actGeomTable, actRep, actIds, this, bufferSet, dist));
-}
-
-bool 
-TeDatabase::centroid(const string&  actGeomTable , TeGeomRep actRep, TePointSet& centroidSet, TeKeys actIds, const string& actCollTable)
-{
-	return (TeGetCentroid(actGeomTable, actRep, this, centroidSet, actIds, actCollTable));
-}
-
-bool 
-TeDatabase::convexHull(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TePolygonSet& convexHullSet)
-{
-	return (TeGetConvexHull(actGeomTable, actRep, actIds, this, convexHullSet));
-}
-
-bool 
-TeDatabase::nearestNeighbors(const string& /* actGeomTable */, const string& /* actCollTable */, TeGeomRep /* actRep */, const string& /* objId1 */, TeKeys& /* actIdsOut */, int /* numRes */)
-{
-	return false;
-}
-
-bool 
-TeDatabase::nearestNeighbors(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, const string& /* visCollTable */, TeGeomRep /* visRep */, TeKeys& /* visIdsOut */, int /* numRes */)
-{
-	return false;
-}
-
-bool 
-TeDatabase::nearestNeighbors(const string& /* actGeomTable */, const string& /* actCollTable */, TeGeomRep /* actRep */, const string& /* objId1 */, TeDatabasePortal* /* portal */, int /* numRes */)
-{
-	return false;
-}
-	
-bool 
-TeDatabase::nearestNeighbors(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, const string& /* visCollTable */, TeGeomRep /* visRep */, TeDatabasePortal* /* portal */, int /* numRes */)
-{
-	return false;
-}
-
-bool 
-TeDatabase::geomIntersection(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeGeometryVect& geomVect)
-{
-	return (TeGetOverlay(actGeomTable, actRep, actIds, this, geomVect, TeINTERSECTION));
-}
-	
-bool 
-TeDatabase::geomIntersection(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, TeGeomRep /* visRep */, const string& /* objId2 */, TeGeometryVect& /* geomVect */)
-{
-	return false;
-}
-
-bool 
-TeDatabase::geomDifference(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& objId2, TeGeometryVect& geomVect)
-{
-	TeKeys actIds;
-	actIds.push_back(objId1);
-	actIds.push_back(objId2);
-
-	return (TeGetOverlay(actGeomTable, actRep, actIds, this, geomVect, TeDIFFERENCE));
-
-}
-
-bool 
-TeDatabase::geomDifference(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, TeGeomRep /* visRep */, const string& /* objId2 */, TeGeometryVect& /* geomVect */)
-{
-	return false;
-}
-
-bool 
-TeDatabase::geomUnion(const string&  actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeGeometryVect& geomVect)
-{
-    return (TeGetOverlay(actGeomTable, actRep, actIds, this, geomVect, TeUNION));
-}
-
-bool 
-TeDatabase::geomUnion(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, TeGeomRep /* visRep */, const string& /* objId2 */, TeGeometryVect& /* geomVect */)
-{
-	return false;
-}
-
-bool 
-TeDatabase::geomXOr(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* objId2 */, TeGeometryVect& /* geomVect */)
-{
-	return false;
-}
-
-bool 
-TeDatabase::geomXOr(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, TeGeomRep /* visRep */, const string& /* objId2 */, TeGeometryVect& /* geomVect */)
-{
-	return false;
-}
-
-// Operation with Image
-
-bool 
-TeDatabase::zonal(const string& rasterTable, const string& actGeomTable, TeKeys& Ids, TeObjectStatistics& result, const bool &useDummy)
-{
-	TeDatabasePortal* portal=getPortal();
-	if (!portal)
-		return false;
-	
-	//recuperar o raster!!!
-	string sql = "SELECT layer_id FROM te_representation";
-	sql += " WHERE geom_table = '" + rasterTable +"'";
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	int layerId = atoi(portal->getData(0));
-	TeRaster* raster = loadLayerRaster(layerId);
-
-	//recuperar as geometrias
-	portal->freeResult();
-	
-	string objIds = getStringIds(Ids);
-	sql = "SELECT * FROM "+ actGeomTable;
-	sql+= " WHERE object_id IN ("+ objIds +")";
-
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-
-		TeStatisticsDimensionVect st;
-
-		TeRaster::iteratorPoly itBegin = raster->begin(poly, TeBoxPixelIn);
-		TeRaster::iteratorPoly itEnd = raster->end(poly, TeBoxPixelIn);
-
-    if (itBegin == itEnd)  // try an approximation for the special case it is a special case
-    {
-      TeCoord2D pll = raster->coord2Index(TeCoord2D(poly.box().lowerLeft()));
-      TeCoord2D pur = raster->coord2Index(TeCoord2D(poly.box().upperRight()));
-
-      TeCoord2D ii(TeRoundRasterIndex(pll.x()),TeRoundRasterIndex(pll.y()));
-      TeCoord2D jj(TeRoundRasterIndex(pur.x()),TeRoundRasterIndex(pur.y()));
-
-      TeCoord2D ll = raster->index2Coord(pll);
-      TeCoord2D ur = raster->index2Coord(pur);
-
-      ll.x_-= raster->params().resx_/2.;
-      ll.y_-= raster->params().resy_/2.;
-      
-      ur.x_+= raster->params().resx_/2.;
-      ur.y_+= raster->params().resy_/2.;
-
-      TeBox bb(ll,ur);
-      TePolygon pol = polygonFromBox(bb);
-		  itBegin = raster->begin(pol, TeBoxPixelIn);
-		  itEnd = raster->end(pol, TeBoxPixelIn);
-      if (itBegin == itEnd)
-      {
-			  delete portal;
-			  return false;
-		  }
-   }
-	if(!TeCalculateStatistics (itBegin, itEnd, st, raster->params().dummy_,useDummy))
-		{
-			delete portal;
-			return false;
-		}
-	
-		result[poly.objectId()] = st;
-
-	}while (flag);
-
-	
-	delete raster;
-	delete portal;
-	return true;
-}
-	
-bool 
-TeDatabase::zonal(const string& rasterTable, const string& actGeomTable, const string& actCollTable, TeObjectStatistics& result,const bool &useDummy)
-{
-	TeDatabasePortal* portal=getPortal();
-	if (!portal)
-		return false;
-	
-	//recuperar o raster
-	string sql = "SELECT layer_id FROM te_representation";
-	sql += " WHERE geom_table = '" + rasterTable +"'";
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	int layerId = atoi(portal->getData(0));
-	TeRaster* raster = loadLayerRaster(layerId);
-
-	//recuperar as geometrias
-	portal->freeResult();
-	
-	sql = "SELECT * FROM "+ actGeomTable;
-
-	if(!actCollTable.empty())
-	{
-		sql += " ,"+ actCollTable;
-		sql += " WHERE object_id = c_object_id ";
-	}
-	
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-	do
-	{
-		TePolygon poly;
-		flag = portal->fetchGeometry(poly);
-
-		TeStatisticsDimensionVect st;
-		
-		TeRaster::iteratorPoly itBegin = raster->begin(poly, TeBoxPixelIn);
-		TeRaster::iteratorPoly itEnd = raster->end(poly, TeBoxPixelIn);
-	  if (itBegin == itEnd)  // try an approximation for the special case it is a special case
-    {
-      TeCoord2D pll = raster->coord2Index(TeCoord2D(poly.box().lowerLeft()));
-      TeCoord2D pur = raster->coord2Index(TeCoord2D(poly.box().upperRight()));
-
-      TeCoord2D ii(TeRoundRasterIndex(pll.x()),TeRoundRasterIndex(pll.y()));
-      TeCoord2D jj(TeRoundRasterIndex(pur.x()),TeRoundRasterIndex(pur.y()));
-
-      TeCoord2D ll = raster->index2Coord(pll);
-      TeCoord2D ur = raster->index2Coord(pur);
-
-      ll.x_-= raster->params().resx_/2.;
-      ll.y_-= raster->params().resy_/2.;
-      
-      ur.x_+= raster->params().resx_/2.;
-      ur.y_+= raster->params().resy_/2.;
-
-      TeBox bb(ll,ur);
-      TePolygon pol = polygonFromBox(bb);
-		  itBegin = raster->begin(pol, TeBoxPixelIn);
-		  itEnd = raster->end(pol, TeBoxPixelIn);
-      if (itBegin == itEnd)
-      {
-			  delete portal;
-			  return false;
-		  }
-    }
-		if(!TeCalculateStatistics (itBegin, itEnd, st,raster->params().dummy_,useDummy))
-		{
-			delete portal;
-			return false;
-		}
-		result[poly.objectId()] = st;
-
-	}while (flag);
-
-	
-	delete raster;
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::zonal(const string& rasterTable, TePolygon& poly, TeStatisticsDimensionVect& result, const bool &useDummy)
-{
-	TeDatabasePortal* portal=getPortal();
-	if (!portal)
-		return false;
-	
-	//recuperar o raster!!!
-	string sql = "SELECT layer_id FROM te_representation";
-	sql += " WHERE geom_table = '" + rasterTable +"'";
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	int layerId = atoi(portal->getData(0));
-	TeRaster* raster = loadLayerRaster(layerId);
-
-	delete portal;
-
-	TeRaster::iteratorPoly itBegin = raster->begin(poly, TeBoxPixelIn);
-	TeRaster::iteratorPoly itEnd = raster->end(poly, TeBoxPixelIn);
-	if (itBegin == itEnd)  // try an approximation for the special case it is a special case
-  {
-    TeCoord2D pll = raster->coord2Index(TeCoord2D(poly.box().lowerLeft()));
-    TeCoord2D pur = raster->coord2Index(TeCoord2D(poly.box().upperRight()));
-
-    TeCoord2D ii(TeRoundRasterIndex(pll.x()),TeRoundRasterIndex(pll.y()));
-    TeCoord2D jj(TeRoundRasterIndex(pur.x()),TeRoundRasterIndex(pur.y()));
-
-    TeCoord2D ll = raster->index2Coord(pll);
-    TeCoord2D ur = raster->index2Coord(pur);
-
-    ll.x_-= raster->params().resx_/2.;
-    ll.y_-= raster->params().resy_/2.;
-    
-    ur.x_+= raster->params().resx_/2.;
-    ur.y_+= raster->params().resy_/2.;
-
-    TeBox bb(ll,ur);
-    TePolygon pol = polygonFromBox(bb);
-		itBegin = raster->begin(pol, TeBoxPixelIn);
-		itEnd = raster->end(pol, TeBoxPixelIn);
-    if (itBegin == itEnd)
-			return false;
-  }
-	
-  if(!TeCalculateStatistics (itBegin, itEnd, result,raster->params().dummy_,useDummy))
-		return false;
-
-	delete raster;
-	return true;
-}
-
-
-bool 
-TeDatabase::mask(const string& rasterTable, const string& actGeomTable, const string& objId, const string& nameLayerOut, TeStrategicIterator st)
-{
-	TeDatabasePortal* portal=getPortal();
-	if (!portal)
-		return false;
-	
-	//recuperar o raster!!!
-	string sql = "SELECT layer_id FROM te_representation";
-	sql += " WHERE geom_table = '" + rasterTable +"'";
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	int layerId = atoi(portal->getData(0));
-	TeRaster* raster = loadLayerRaster(layerId);
-
-	//recuperar a geometria
-	portal->freeResult();
-	
-	sql = "SELECT * FROM "+ actGeomTable;
-	sql+= " WHERE object_id = '" + objId + "'"; 
-	
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	TePolygon poly;
-	portal->fetchGeometry(poly);
-	delete portal;
-
-	TeRaster* rasterOut = TeMask (raster, poly, st);
-	if(!rasterOut)
-		return false;
-
-	TeLayer* res = TeImportRaster(nameLayerOut, rasterOut, this);
-	delete raster;
-	delete rasterOut;
-	return (res != 0);
-}
-
-
-
-bool
-TeDatabase::mask(const string& rasterTable, TePolygon& poly, const string& nameLayerOut, TeStrategicIterator st)
-{
-	TeDatabasePortal* portal=getPortal();
-	if (!portal)
-		return false;
-	
-	string sql = "SELECT layer_id FROM te_representation";
-	sql += " WHERE geom_table = '" + rasterTable +"'";
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	TeRaster* raster = loadLayerRaster(atoi(portal->getData(0)));
-	delete portal;
-
-	TeRaster* rasterOut = TeMask (raster, poly, st);
-	if(!rasterOut)
-		return false;
-
-	TeLayer* res = TeImportRaster(nameLayerOut, rasterOut, this);
-	delete raster;
-	delete rasterOut;
-	return (res != 0);
-}
-
-
-string
-TeDatabase::getSQLBoxWhere (TeBox &box, TeGeomRep rep)
-{
-	string wherebox;
-	string lowerX, lowerY, upperX, upperY;
-	if(rep == TePOLYGONS || rep == TeLINES || rep == TeCELLS || rep == TeRASTER || rep == TeRASTERFILE)
-	{
-		lowerX = "lower_x";
-		lowerY = "lower_y";
-		upperX = "upper_x";
-		upperY = "upper_y";
-	}
-	else if(rep == TePOINTS || rep == TeTEXT)
-	{
-		lowerX = "x";
-		lowerY = "y";
-		upperX = "x";
-		upperY = "y";
-	}
-	wherebox = "NOT("+ lowerX +" > " + Te2String(box.x2_, 12) + " OR ";
-	wherebox += upperX +" < " + Te2String(box.x1_, 12) + " OR ";
-	wherebox += lowerY +" > " + Te2String(box.y2_, 12) + " OR ";
-	wherebox += upperY +" < " + Te2String(box.y1_, 12) + ")";
-	return wherebox;
-}
-
-
-string 
-TeDatabase::getSQLBoxWhere (const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep /* rep1 */)
-{
-	string wherebox;
-
-	if(rep2 == TePOLYGONS || rep2 == TeLINES || rep2 == TeCELLS || rep2 == TeRASTER || rep2 == TeRASTERFILE)
-	{
-		wherebox = " NOT( ";
-		wherebox += table2 +".lower_x > "+ table1 +".upper_x  OR ";
-		wherebox += table2 +".upper_x < "+ table1 +".lower_x  OR ";
-		wherebox += table2 +".lower_y > "+ table1 +".upper_y  OR ";
-		wherebox += table2 +".upper_y < "+ table1 +".lower_y )";
-	}
-	else if(rep2 == TePOINTS || rep2 == TeTEXT)
-	{
-		wherebox = " NOT( ";
-		wherebox += table2 +".x > "+ table1 +".upper_x  OR ";
-		wherebox += table2 +".x < "+ table1 +".lower_x  OR ";
-		wherebox += table2 +".y > "+ table1 +".upper_y  OR ";
-		wherebox += table2 +".y < "+ table1 +".lower_y )";
-	}
-	
-	return wherebox;
-}
-
-
-string 
-TeDatabase::getSQLBoxSelect (const string& tableName, TeGeomRep /* rep */)
-{
-	string sql = tableName +".* ";
-	return sql;
-}
-
-
-string
-TeDatabase::getSQLStatistics (TeGroupingAttr& attrs)
-{
-	string sql = "";
-	string virg = "";
-
-	TeGroupingAttr::iterator it = attrs.begin();
-	int count = 0;
-	while(it != attrs.end())
-	{
-		if(count>0)
-			virg = ",";
-
-		switch ((*it).second)
-		{
-			case TeSUM:
-				sql += virg +" SUM( "+ (*it).first.name_ +") AS SUM_"+ Te2String(count);
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			case TeMAXVALUE:
-				sql += virg +" MAX( "+ (*it).first.name_ +") AS MAX_"+ Te2String(count);
-				(*it).second = TeNOSTATISTIC; 
-				++count;
-				break;
-			case TeMINVALUE:
-				sql += virg +" MIN( "+ (*it).first.name_ +") AS MIN_"+ Te2String(count);
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			case TeCOUNT:
-				sql += virg +" COUNT( "+ (*it).first.name_ +") AS COUNT_"+ Te2String(count);
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			case TeMEAN:
-				sql += virg +" AVG( "+ (*it).first.name_ +") AS AVG_"+ Te2String(count);
-				(*it).second = TeNOSTATISTIC;
-				++count;
-				break;
-			default:
-				break;
-		}
-		++it;
-	}
-	return sql;
-}
-
-string 
-TeDatabase::getSQLAutoNumber(const string& /* table */)
-{
-	return "";
-}
-
-string 
-TeDatabase::getSQLTemporalWhere (TeTimeInterval& timeInterval, TeTemporalRelation timeOperator, const string& initialTime, const string& finalTime)
-{
-	string sql;
-	string t1 = getSQLTime(timeInterval.getT1()); 
-	string t2 = getSQLTime(timeInterval.getT2());
-	
-	switch(timeOperator)
-	{
-		case TeTIMEBEFORE:  
-			sql = finalTime +" < "+ t1;
-			break;
-		case TeTIMEAFTER:  
-			sql = initialTime +" > "+ t2;
-			break;
-		case TeTIMEEQUAL:             
-			sql = "( "+ initialTime +" >= "+ t1;
-			sql += " AND "+ initialTime +" <= "+ t2 +" )";
-			if (initialTime != finalTime)
-			{
-				sql += " AND ";
-				sql += "( "+ finalTime +" >= "+ t1;
-				sql += " AND "+ finalTime +" <= "+ t2 +" )";
-			}
-			break;
-
-		case TeTIMEMEETS:             
-			sql = finalTime +" = "+ t1;
-			sql += " OR "+ initialTime +" = "+ t2;
-			break;
-
-		case TeTIMEDURING: 
-			sql = initialTime +" >= "+ t1;
-			sql += " AND "+ initialTime +" <= "+ t2;
-			if (initialTime != finalTime)
-			{
-				sql += " AND "+ finalTime +" >= "+ t1;
-				sql += " AND "+ finalTime +" <= "+ t2;
-			}
-			break;
-
-		case TeTIMEOVERLAPS:             
-			sql = "( "+ initialTime +" < "+ t1;
-			sql += " AND "+ finalTime +" > "+ t1;
-			sql += " AND "+ finalTime +" < "+ t2 +" )";
-			sql += " OR ";
-			sql += "( "+ initialTime +" > "+ t1;
-			sql += " AND "+ initialTime +" < "+ t2;
-			sql += " AND "+ finalTime +" > "+ t2 +" )";
-			break;
-
-		case TeTIMEENDS:
-			sql = finalTime +" = "+ t2;
-			break;
-
-		case TeTIMESTARTS:
-			sql = initialTime +" = "+ t1;
-			break;
-
-        default:
-            break;
-	}
-
-	return sql; 
-}
-
-string
-TeDatabase::getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, 
-						   const string& initialTime, const string& finalTime)
-{
-	//rever os chronons definidos - alterar o parser para restri��o temporal
-	string func, sql;
-	switch(chr)
-	{
-		case TeSECONDOFMINUTE:  
-		   func = " second"; 
-		break;
-		
-		case TeMINUTEOFHOUR:  
-		   func = " minute";
-		break;
-		
-		case TeHOUROFDAY:             
-			func = " hour";
-		break;
-		
-		case TeDAYOFMONTH:             
-			func = " day";
-		break;
-
-		case TeDAYOFWEEK:
-			func = " weekday";
-		break;
-		
-		case TeMONTHOFYEAR:
-		   func = " month";
-		break;
-
-		case TeYEAR:             
-		   func = " year";
-		break;
-
-		default:
-			return "";
-	}
-
-	switch(rel)
-	{
-		case TeTIMEBEFORE:  
-			sql = func +"("+ finalTime +") < "+ Te2String(time1);
-		break;
-		
-		case TeTIMEAFTER:  
-			sql = func +"("+ initialTime +") > "+ Te2String(time2);
-		break;
-		
-		case TeTIMEEQUAL:  
-			sql = func +"("+ initialTime +") = "+ Te2String(time1);
-			sql += " AND "+ func +"(" + finalTime +") = "+ Te2String(time2);
-		break;
-
-		case TeTIMEMEETS:     
-			sql = func +"("+ finalTime +") = "+ Te2String(time1);
-			sql += " OR "+ func +"(" + initialTime +") = "+ Te2String(time2);
-		break;
-
-		case TeTIMEDURING: 
-			sql = func +"("+ initialTime +") >= "+ Te2String(time1);
-			sql += " AND "+ func +"("+ initialTime +") <= "+ Te2String(time2);
-			sql += " AND "+ func +"("+ finalTime +") >= "+ Te2String(time1);
-			sql += " AND "+ func +"("+ finalTime +") <= "+ Te2String(time2);
-		break;
-
-		case TeTIMEOVERLAPS:         
-			sql =  "("+ func +"("+ initialTime +") <= "+ Te2String(time1);
-			sql += " AND "+ func +"("+ finalTime +") >= "+ Te2String(time1);
-			sql += " AND "+ func +"("+ finalTime +") <= "+ Te2String(time2) +")";
-			sql += " OR ";
-			sql += "("+ func +"("+ initialTime +") >= "+ Te2String(time1);
-			sql += " AND "+ func +"("+ initialTime +") <= "+ Te2String(time2);
-			sql += " AND "+ func +"("+ finalTime +") >= "+ Te2String(time2) +")";
-		break;
-
-		case TeTIMEENDS:
-			sql = func +"("+ finalTime +") = "+ Te2String(time2);
-		break;
-
-		case TeTIMESTARTS:
-			sql = func +"("+ initialTime +") = "+ Te2String(time1);
-
-		default:
-			break;
-	}
-	
-	return sql;
-}
-
-string 
-TeDatabase::getSQLTemporalWhere (const string& temporalRest)
-{
-	string result, tableName, initialCol, finalCol, time1, time2, mask; 
-	TeTemporalRelation rel = TeTIMEUNDEFINED;
-	TeChronon chronon = TeNOCHRONON; 
-	
-	string temp = temporalRest;
-	bool flag = true;
-	int cont = 0;
-		
-	while(flag)
-	{
-		string element;
-		int pos = temp.find (";");
-		if(pos<0)
-		{
-			flag = false;
-			element = temp;
-		}
-		else
-		{
-			element = temp.substr(0, pos);
-			temp = temp.substr (pos+1);
-		}
-
-		if(cont==0) //table name
-			tableName = element;
-		else if(cont==1) //column name (initial time) 
-			initialCol = element; 
-		else if(cont==2) //column name (final time)
-			finalCol = element;
-		else if(cont==3) //TeTemporalRelation 
-		{
-			if(element=="TeTIMEEQUAL")
-				rel = TeTIMEEQUAL;
-			else if (element=="TeTIMEBEFORE")
-				rel = TeTIMEBEFORE;
-			else if (element=="TeTIMEAFTER")
-				rel = TeTIMEAFTER;
-			else if (element=="TeTIMEMEETS")
-				rel = TeTIMEMEETS;
-			else if (element=="TeTIMEDURING")
-				rel = TeTIMEDURING;
-			else if (element=="TeTIMEOVERLAPS")
-				rel = TeTIMEOVERLAPS;
-			else if (element=="TeTIMEENDS")
-				rel = TeTIMEENDS;
-			else if (element=="TeTIMESTARTS")
-				rel = TeTIMESTARTS;
-		}
-		else if(cont==4) //time 1
-			time1 = element;
-		else if(cont==5) //time 2
-		{
-			if(element.empty())
-				time1 = time2;
-			else
-				time2 = element;
-		}
-		else if(cont==6)
-			mask = element;
-		else if(cont==7) //TeChronon  
-		{
-			if (element=="TeSECOND")
-				chronon = TeSECOND;
-			else if (element=="TeMINUTE")
-				chronon = TeMINUTE;
-			else if (element=="TeHOUR")
-				chronon = TeHOUR;
-			else if (element=="TeDAY")
-				chronon = TeDAY;
-			else if (element=="TeMONTH")
-				chronon = TeMONTH;
-			else if (element=="TeYEAR")
-				chronon = TeYEAR;
-			else if (element=="TeDAYOFWEEK")
-				chronon = TeDAYOFWEEK;
-			else if (element=="TeMONTHOFYEAR")
-				chronon = TeMONTHOFYEAR;
-			else if (element=="TeSEASON")
-				chronon = TeSEASON;
-			else if (element=="TeWEEKOFYEAR")
-				chronon = TeWEEKOFYEAR;
-		}
-
-		++cont;
-	}
-
-	int posMask = mask.find ("s");
-	if(posMask<0) 
-	{
-		result = " "+ getSQLTemporalWhere(atoi(time1.c_str()), atoi(time2.c_str()), chronon, rel, (tableName+"."+initialCol), (tableName+"."+finalCol)) +" ";
-	}
-	else
-	{
-		TeTimeInterval interval(time1, time2, chronon, mask);
-		result = " "+ getSQLTemporalWhere(interval, rel, (tableName+"."+initialCol), (tableName+"."+finalCol)) + " "; 
-	}
-
-	return result;
-}
-
-
-string 
-TeDatabase::getSQLTemporalFunction (TeChronon chr, const string& colName)
-{
-	string func;
-	switch(chr)
-	{
-		case TeYEAR:             
-			func = " year ("+ colName +")";
-		break;
-
-		case TeMONTH:			// Fev/2003 != Fev/2004
-			func = " year ("+ colName +"), month ("+ colName +") ";
-		break;
-
-		case TeMONTHOFYEAR:		// Fev/2003 == Fev/2004
-			func = " month ("+ colName +")";
-		break;
-
-		case TeDAY:				// 01/01/2003 != 01/01/2004 != 01/02/2004             
-			func = " year ("+ colName +"), month ("+ colName +"), day("+ colName +") ";
-		break;
-
-		case TeDAYOFMONTH:		// 01/01/2003 == 01/01/2004 == 01/02/2004             
-			func = " day("+ colName +") ";
-		break;
-
-		case TeDAYOFYEAR:		// 01/01/2003 == 01/01/2004 != 01/02/2004             
-			func = " month ("+ colName +"), day("+ colName +") ";
-		break;
-
-		case TeDAYOFWEEK:		// 01/01/2003 != 01/01/2004 != 01/02/2004             
-			func = " weekday ("+ colName +") ";
-		break;
-
-		case TeHOUR:			// 01/01/2003 10:00 != 01/01/2004 10:00 != 01/02/2004 10:00             
-			func = " year ("+ colName +"), month ("+ colName +"), day("+ colName +"), hour("+ colName +") ";
-		break;
-
-		case TeHOUROFDAY:       // 01/01/2003 10:00 == 01/01/2004 10:00 == 01/02/2004 10:00    
-			func = " hour ("+ colName +")";
-		break;
-
-		case TeMINUTE:			// 01/01/2003 10:30 != 01/01/2004 10:30 != 01/02/2004 10:30 
-		   func = " year ("+ colName +"), month ("+ colName +"), day("+ colName +"), hour("+ colName +"), minute("+ colName +") ";
-		break;
-
-		case TeMINUTEOFHOUR:   // 01/01/2003 10:30 == 01/01/2004 10:30 == 01/02/2004 10:30 != 01/02/2004 10:31
-			func = " minute("+ colName +") ";
-		break;
-
-		case TeSECOND:  // 01/01/2003 10:30:04 != 01/01/2004 10:30:04 != 01/02/2004 10:30:04 
-		   func = " year ("+ colName +"), month ("+ colName +"), day("+ colName +"), hour("+ colName +"), minute("+ colName +"), second("+ colName +") ";
-		break;
-
-		case TeSECONDOFMINUTE:  // 01/01/2003 10:30:04 == 01/01/2004 10:30:04 == 01/02/2004 10:30:04 != 01/02/2004 10:30:07
-		   func = " second("+ colName +") "; 
-		break;
-		
-		default:
-			return "";
-	}
-	
-	return func;
-}
- 
-
-bool
-TeDatabase::getMBRGeom(string tableGeom, string object_id, TeBox& box, string /* colGeom */)
-{
-	double xmin = TeMAXFLOAT;
-	double xmax = -TeMAXFLOAT;
-	double ymin = TeMAXFLOAT;
-	double ymax = -TeMAXFLOAT;
-			
-	TeDatabasePortal* portal = getPortal();
-	if(!portal)
-		return false;
-
-	string sel = "SELECT lower_x, upper_x, lower_y, upper_y FROM " + tableGeom;
-	sel += " WHERE object_id = '" + object_id + "'";
-
-	if(!portal->query(sel))
-	{
-		delete portal;
-		return false;
-	}
-		
-	bool b = portal->fetchRow();
-	if(!b)
-	{
-		delete portal;
-		return false;
-	}
-	
-	while(b)
-	{
-		xmin = MIN(xmin, portal->getDouble(0));
-		xmax = MAX(xmax, portal->getDouble(1));
-		ymin = MIN(ymin, portal->getDouble(2));
-		ymax = MAX(ymax, portal->getDouble(3));
-		b = portal->fetchRow();	
-	}
-			
-	TeBox bb(xmin, ymin, xmax, ymax);
-	box = bb;
-	delete portal;
-	return true;
-}
-
-bool 
-TeDatabase::getMBRSelectedObjects(string /* geomTable */,string /* colGeom */, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType,TeBox &bout, const double& tol)
-{
-	string	fields;
-	string	query;
-	bool	status = false;
-
-	TeBox	box;
-	bout = box;
-
-	TeDatabasePortal* portal = this->getPortal();
-
-	switch(repType)
-	{
-		case TePOLYGONS:
-		case TeLINES:
-		case TeCELLS:
-			fields = "MIN(lower_x), MIN(lower_y), MAX(upper_x), MAX(upper_y)";
-			query =  " SELECT " + fields;
-			query += " FROM " + fromClause; 
-			if (!whereClause.empty())
-				query += " WHERE " + whereClause;
-			if (!afterWhereClause.empty())
-				query += afterWhereClause;
-
-			if (portal->query (query))
-			{
-				bool b = portal->fetchRow();
-				while(b)
-				{
-					string vxmin = portal->getData(0);
-					string vymin = portal->getData(1);
-					string vxmax = portal->getData(2);
-					string vymax = portal->getData(3);
-					if(vxmin.empty() || vymin.empty() || vxmax.empty() || vymax.empty())
-					{
-						b = portal->fetchRow();
-						continue;
-					}
-					double xmin = atof(vxmin.c_str());
-					double ymin = atof(vymin.c_str());
-					double xmax = atof(vxmax.c_str());
-					double ymax = atof(vymax.c_str());
-					TeBox	ibox(xmin, ymin, xmax, ymax);
-					updateBox (bout, ibox);
-					b = portal->fetchRow();
-					status = true;
-				}
-			}
-			break;
-
-		case TePOINTS:
-		case TeTEXT:
-			fields = "MIN(x), MIN(y), MAX(x), MAX(y)";
-			query =  " SELECT " + fields;
-			query += " FROM " + fromClause; 
-			if (!whereClause.empty())
-				query += " WHERE " + whereClause;
-			if (!afterWhereClause.empty())
-				query += afterWhereClause;
-			
-			if (portal->query (query))
-			{
-				bool b = portal->fetchRow();
-				while(b)
-				{
-          string vxmin = portal->getData(0);
-          string vymin = portal->getData(1);
-          string vxmax = portal->getData(2);
-          string vymax = portal->getData(3);
-          if(vxmin.empty() || vymin.empty() || vxmax.empty() || vymax.empty())
-          {
-            b = portal->fetchRow();
-            continue;
-          }
-          double xmin = atof(vxmin.c_str());
-          double ymin = atof(vymin.c_str());
-          double xmax = atof(vxmax.c_str());
-          double ymax = atof(vymax.c_str());
-          
-          TeBox ibox;
-          if (xmin == xmax) {
-            ibox.x1_ = xmin - tol;
-            ibox.x2_ = xmax + tol;
-          }
-          else{
-            ibox.x1_ = xmin;
-            ibox.x2_ = xmax;
-          }
-          if (ymin == ymax) {
-            ibox.y1_ = ymin - tol;
-            ibox.y2_ = ymax + tol;
-          }
-          else {
-            ibox.y1_ = ymin;
-            ibox.y2_ = ymax;
-          }
-					updateBox (bout, ibox);
-					b = portal->fetchRow();
-					status = true;
-				}
-			}
-			break;
-
-
-		default:
-			status = false;
-			break;
-	}
-	delete portal;
-	return status;
-}
-
-bool 
-TeDatabase::getAttributeList(const string& tableName,TeAttributeList& attList)
-{
-	TeDatabasePortal* portal = this->getPortal();
-	if (!portal)
-		return false;
-
-	string sql = "SELECT * FROM " + tableName + " WHERE 1=2";
-	if (!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-	else
-		attList = portal->getAttributeList();
-	delete portal;
-	return true;
-}
-
-
-bool TeDatabase::insertRasterVisual (int themeId , TeRasterVisual* vis)
-{
-	TeRasterTransform::TeRasterTransfFunctions tf = vis->getTransfFunction();
-
-	TeDatabasePortal* portal = this->getPortal();
-
-	std::string sqlLut = "SELECT lut_table from te_visual_raster where theme_id = " + Te2String(themeId);
-
-	if(portal->query(sqlLut) && portal->fetchRow())
-	{
-		std::string lutName = portal->getData(0);
-
-		if (this->tableExist(lutName))
-		{
-			if(!this->deleteTable(lutName))
-				return false;
-		}
-	}
-	delete portal;
-		
-	if (tf == TeRasterTransform::TeNoTransf)
-		return true;
-
-	string sql = "DELETE FROM te_visual_raster WHERE theme_id = " + Te2String(themeId);
-	if (!this->execute(sql))
-		return false;
-
-	if (tf == TeRasterTransform::TeMono2Three ||
-		tf == TeRasterTransform::TePall2Three || 
-		tf == TeRasterTransform::TeLUT2Three)
-	{
-		sql = "INSERT INTO te_visual_raster (theme_id, band_in, transf_type) VALUES (";
-		sql += Te2String(themeId) + "," + Te2String(vis->getSrcBand()) + ",";
-		sql += Te2String(static_cast<short>(tf)) + ")";
-		if (!this->execute(sql))
-			return false;
-		return true;
-	}
-
-	if (tf == TeRasterTransform::TeExtractBand)
-	{
-		sql = "INSERT INTO te_visual_raster (theme_id, band_in, band_out, transf_type) VALUES (";
-		sql += Te2String(themeId) + "," + Te2String(vis->getSrcBand()) + ",";
-		sql += Te2String(vis->getDestBand()) + "," + Te2String(static_cast<short>(tf))+ ")";
-		if (!this->execute(sql))
-			return false;
-		return true;
-	}
-
-	if (tf == TeRasterTransform::TeExtractBands || tf == TeRasterTransform::TeExtractRGB)
-	{
-		map<TeRasterTransform::TeRGBChannels,short>& RGBmap = vis->getRGBMap();
-		map<TeRasterTransform::TeRGBChannels,short>::iterator it = RGBmap.begin();
-		while (it != RGBmap.end())
-		{
-			sql = "INSERT INTO te_visual_raster (theme_id, band_in, band_out, transf_type) VALUES (";
-			sql += Te2String(themeId) + "," + Te2String(static_cast<short>(it->second)) + ",";
-			sql += Te2String(static_cast<short>(it->first)) + "," + Te2String(static_cast<short>(tf))+ ")";
-			if (!this->execute(sql))
-				return false;
-			++it;
-		}
-		return true;
-	}
-
-	if(tf == TeRasterTransform::TeThree2LUTThreeBand || tf == TeRasterTransform::TeMono2LUTMonoBand)
-	{
-		std::string lutName = vis->getLutTableName();
-
-		if(lutName.empty())
-			return false;
-
-		map<TeRasterTransform::TeRGBChannels,short>& RGBmap = vis->getRGBMap();
-		map<TeRasterTransform::TeRGBChannels,short>::iterator it = RGBmap.begin();
-		while (it != RGBmap.end())
-		{
-			sql = "INSERT INTO te_visual_raster (theme_id, band_in, band_out, transf_type, lut_table) VALUES (";
-			sql += Te2String(themeId) + "," + Te2String(static_cast<short>(it->second)) + ",";
-			sql += Te2String(static_cast<short>(it->first)) + "," + Te2String(static_cast<short>(tf))+ ",'";
-			sql += lutName + "')";
-			if (!this->execute(sql))
-				return false;
-			++it;
-		}
-		
-		if (this->tableExist(lutName))
-		{
-			if(!this->deleteTable(lutName))
-				return false;
-		}
-
-		if (this->createLUTTable(lutName))
-		{
-			for (unsigned int i = 0; i < vis->lutr_.size(); ++i)
-			{
-				std::string sql;
-				
-				if(tf == TeRasterTransform::TeThree2LUTThreeBand)
-				{
-					sql = "INSERT INTO " + lutName + " VALUES(";
-					sql += Te2String(i) + ", ";
-					sql += Te2String(vis->lutr_[i]) + ", ";
-					sql += Te2String(vis->lutg_[i]) + ", ";
-					sql += Te2String(vis->lutb_[i]) + ")";
-				}
-				else
-				{
-					sql = "INSERT INTO " + lutName + " VALUES(";
-					sql += Te2String(i) + ", ";
-					sql += Te2String(vis->lutr_[i]) + ", ";
-					sql += Te2String(vis->lutr_[i]) + ", ";
-					sql += Te2String(vis->lutr_[i]) + ")";
-				}
-				
-				if(!this->execute(sql))
-					return false;
-			}
-		 }
-
-		return true;
-	}
-
-	return false;
-}
-
-
-bool 
-TeDatabase::locateLineSet (const string& table, TeCoord2D &pt, TeLineSet &ls, const double& tol)
-{
-	bool located=false;
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-	string q ="SELECT * FROM " + table;
-	char buf [1024];
-	sprintf (buf," WHERE lower_x < %f AND upper_x > %f AND lower_y < %f AND upper_y > %f",
-		box.x2(),box.x1(),box.y2(),box.y1());
-	q += buf;
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	// Get all lines
-	bool flag = true;
-	do 
-	{
-		TeLine2D l;
-		TeLineSet tmp;
-		int index;
-		double dist;
-		TeCoord2D pout;
-
-		flag = portal->fetchGeometry( l );
-		tmp.add(l);
-		if(TeNearest(pt,tmp,index,pout,dist,tol))
-			{
-				ls.add ( l );
-				located=true;
-			}
-	} while (flag);
-
-	delete portal;
-	return located;
-}
-
-
-bool 
-TeDatabase::locatePointSet (const string& table, TeCoord2D &pt, TePointSet &pointSet, const double& tol)
-{
-	bool located=false;
-
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-	string q ="SELECT * FROM " + table;
-	char buf [1024];
-	sprintf (buf," WHERE x < %f AND x > %f AND y < %f AND y > %f",
-		box.x2(),box.x1(),box.y2(),box.y1());
-	q += buf;
-
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-	do 
-	{
-		TePoint point;
-		flag = portal->fetchGeometry (point);
-		pointSet.add ( point );
-		located=true;
-	}while (flag);
-
-	delete portal;
-	return located;
-}
-
-
-bool 
-TeDatabase::locateTextSet (const string& table, TeCoord2D &pt, TeTextSet& textSet, const double& tol)
-{
-	bool located=false;
-
-	TeDatabasePortal* portal = this->getPortal();
-
-	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
-	string q ="SELECT * FROM " + table;
-	char buf [1024];
-	sprintf (buf," WHERE x < %f AND x > %f AND y < %f AND y > %f",
-		box.x2(),box.x1(),box.y2(),box.y1());
-	q += buf;
-	if (!portal->query(q) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	// Look for all texts
-	bool flag = true;
-	
-	do
-	{
-		TeText p;
-		flag = portal->fetchGeometry(p);
-		textSet.add ( p );
-		located=true;
-	} while (flag);
-
-	delete portal;
-	return located;
-}
-
-bool 
-TeDatabase::updateVersionStamp(const string& DBversion )
-{
-	TeTable versionTable;
-	if( !loadTable( "te_database", versionTable ) )
-		return false;
-	if ( versionTable.size() ) //no empty
-	{
-		string deleteVersionTb = "DELETE FROM te_database";
-		if( !execute( deleteVersionTb ) )
-			return false;
-	}
-	//insert
-	string insVersionTb = "INSERT INTO te_database (db_version) VALUES('" + DBversion + "')";
-	if( !execute(insVersionTb) )
-		return false;
-	return true;
-}
-
-bool 
-TeDatabase::loadVersionStamp(string& DBversion)
-{
-	DBversion.clear();
-	TeTable versionTable;	
-	if( !loadTable("te_database",versionTable) )
-		return false;
-	if ( versionTable.size() == 0 )
-		return false;
-	std::vector<std::string> attrs;
-	versionTable.attributeNames( attrs );
-	for (unsigned int i = 0; i < attrs.size(); i++ )
-	{
-		if ( TeStringCompare(attrs[i], "db_version", false ) )
-		{
-			DBversion = versionTable(0, i);
-			break;
-		}
-	}
-	return false;
-}
-
-bool 
-TeDatabase::updateLayerBox(TeLayer* layer)
-{
-	if (!layer)
-		return false;
-	TeBox box = layer->box();
-	string sql = "UPDATE te_layer SET lower_x = " + Te2String(box.x1(),15);
-		   sql += ", lower_y = " + Te2String(box.y1(),15);
-		   sql += ", upper_x = " + Te2String(box.x2(),15);
-		   sql += ", upper_y = " + Te2String(box.y2(),15);
-		   sql += " WHERE layer_id=" + Te2String(layer->id());
-	return execute(sql);
-}
-
-//! Load information about all projects stored in the database
-bool 
-TeDatabase::loadProjectSet()
-{
-	//clear map
-	TeProjectMap::iterator projectIt;
-	for (projectIt = metaModel_->projectMap().begin(); projectIt != metaModel_->projectMap().end(); ++projectIt)
-	{
-		if (projectIt->second)
-			delete projectIt->second;
-	}
-	metaModel_->projectMap().clear();
-	
-	//sql
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return false;
-
-	string get = " SELECT te_project.*, te_project_view.* ";
-	get += " FROM ((te_project LEFT JOIN te_project_view ";
-	get += " ON te_project.project_id = te_project_view.project_id) ";
-	get += " LEFT JOIN te_view ON te_view.view_id = te_project_view.view_id)";
-	get += " WHERE te_view.user_name = '" + this->user() + "'";
-	get += " ORDER BY te_project.project_id, te_project_view.view_id";
-
-	if (!portal->query(get))
-	{	
-		delete portal;
-		return false;
-	}
-
-	bool flag = portal->fetchRow();
-	while (flag)
-	{
-		TeProject* project = new TeProject(portal->getInt(0), this);
-		project->setName(string(portal->getData(1)));
-		project->setDescription(string(portal->getData(2)));
-//		project->setCurrentViewId(portal->getInt(3));
-		int pId = portal->getInt(3);
-		
-		//load all views
-		bool hasViews = true;
-		while(hasViews)
-		{
-			project->addView(portal->getInt(5));
-			flag = portal->fetchRow();
-			if(!flag || (portal->getInt(0)!=project->id()))
-				hasViews = false;
-		}
-		
-		project->setCurrentViewId(pId);
-		metaModel_->projectMap()[project->id()] = project;
-	}
-
-	delete portal;
-	return true;
-
-}
-
-//! Load information about a particular project
-bool 
-TeDatabase::loadProject(TeProject* project)
-{
-	if(!project)
-		return false;
-	
-	//sql
-	string get = " SELECT te_project.*, te_project_view.* ";
-	get += " FROM te_project LEFT JOIN te_project_view ";
-	get += " ON te_project.project_id = te_project_view.project_id ";
-
-	if(project->id()>0)
-		get += " WHERE  te_project.project_id = "+ Te2String(project->id());
-	else if (!project->name().empty())
-		get += " WHERE  te_project.name = '"+ project->name() +"'";
-	else 
-		return false;
-
-	get += " ORDER BY te_project.project_id, te_project_view.view_id";
-
-	TeDatabasePortal* portal = this->getPortal();
-	if(!portal)
-		return false;
-	if (!portal->query(get) || !portal->fetchRow())
-	{	
-		delete portal;
-		return false;
-	}
-
-	project->setId (portal->getInt(0));
-	project->setDatabase(this);
-	project->setName(string(portal->getData(1)));
-	project->setDescription(string(portal->getData(2)));	
-	int currentViewId = portal->getInt(3);
-	
-	//load all views
-	bool hasViews = true;
-	while(hasViews)
-	{
-		project->addView(portal->getInt(5));
-		bool flag = portal->fetchRow();
-		if(!flag || (portal->getInt(0)!=project->id()))
-			hasViews = false;
-	}
-	project->setCurrentViewId(currentViewId); //the views vector need be filled
-		
-	metaModel_->projectMap()[project->id()] = project;
-	delete portal;
-	return true;
-}
-	
-//! Update information about a layer
-bool 
-TeDatabase::updateProject(TeProject *project)
-{
-	if (!project)
-		return false;
-	int projectId = project->id();
-	if (projectId <= 0)
-		return false;
-
-	//update project information
-	string sql = " UPDATE te_project SET ";
-	sql += " name = '" + project->name() +"'";
-	sql += ", description = '" + project->description() +"'";
-	sql += ", current_view = "+ Te2String(project->getCurrentViewId());
-	sql += " WHERE project_id = "+ Te2String(project->id());
-	if (!this->execute (sql))
-	{
-		this->errorMessage_ = "\nError updating project information";
-		return false;
-	}	
-	
-	//delete relation
-	sql = "DELETE FROM te_project_view WHERE project_id =" + Te2String(project->id());
-	if (!this->execute (sql))
-	{
-		this->errorMessage_ = "Error deleting project/view relation";
-		return false;
-	}
-	const TeViewVector vv = project->getViewVector();
-	for (unsigned int i=0; i<vv.size(); ++i)
-	{
-		sql = "INSERT INTO te_project_view VALUES(" + Te2String(projectId) + "," + Te2String(vv[i]) + ")";
-		if (!this->execute (sql))
-		{
-			this->errorMessage_ = "Error inserting project/view relation";
-			return false;
-		}
-	}
-	return true;
-}
-
-//! Delete a project from the database
-bool 
-TeDatabase::deleteProject(int projectId)
-{
-	string sql = "DELETE FROM te_project_view WHERE project_id =" + Te2String(projectId);
-	if (!this->execute (sql))
-	{
-		this->errorMessage_ = "Error deleting project/view relation";
-		return false;
-	}
-	sql = "DELETE FROM te_project WHERE project_id =" + Te2String(projectId);
-	if (!this->execute (sql))
-	{
-		this->errorMessage_ = "Error deleting te_project entry";
-		return false;
-	}
-	
-	// delete project and its entry in the project map
-	TeProject* proj = metaModel_->projectMap()[projectId];
-	metaModel_->projectMap().erase(projectId);
-	if(proj)
-		delete proj;
-	return true;
-}
-
-//! Insert a project/view relation
-bool 
-TeDatabase::insertProjectViewRel(int projectId, int viewId)
-{
-	string sql = "INSERT INTO te_project_view VALUES(" + Te2String(projectId) + "," + Te2String(viewId) + ")";
-	if (!this->execute (sql))
-	{
-		this->errorMessage_ = "Error inserting project/view relation";
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDatabase::deleteProjectViewRel(int projectId, int viewId)
-{
-	string sql ="DELETE FROM te_project_view WHERE project_id = ";
-	       sql += Te2String(projectId);
-		   sql += " AND view_id = ";
-		   sql += Te2String(viewId);
-	if (!this->execute (sql))
-	{
-		this->errorMessage_ = "Error removing project/view relation";
-		return false;
-	}
-	return true;
-}
-
-bool TeDatabase::projectExist(const string& projectName)
-{
-	TeDatabasePortal* portal = this->getPortal();
-
-	if(!portal)
-		return false;
-
-	string sql = "SELECT name FROM te_project WHERE " +  this->toUpper("name") + " = '" + TeConvertToUpperCase(projectName) + "'";
-
-	if(!portal->query(sql))
-	{	
-		portal->freeResult();
-		delete portal;
-		return false;
-	}
-
-	if(portal->fetchRow())
-	{
-		portal->freeResult();
-		delete portal;
-		return true;		
-	}
-
-	portal->freeResult();
-	delete portal;
-	return false;
-}
-
-bool TeDatabase::createPolygonGeometry(const string& tableName)
-{
-	if(tableName.empty())
-		return false;
-
-	TeAttributeList attList;
-
-	{TeAttribute attGeomId;
-	attGeomId.rep_.name_ = "geom_id";
-	attGeomId.rep_.type_ = TeUNSIGNEDINT;
-	attGeomId.rep_.isAutoNumber_ = true;
-	attGeomId.rep_.isPrimaryKey_ = true;
-	attGeomId.rep_.null_ = false;
-	attList.push_back(attGeomId);}
-
-	{TeAttribute attObjId;
-	attObjId.rep_.name_ = "object_id";
-	attObjId.rep_.type_ = TeSTRING;
-	attObjId.rep_.numChar_ = 255;
-	attObjId.rep_.null_ = false;
-	attList.push_back(attObjId);}
-
-	{TeAttribute attSpatial;
-	attSpatial.rep_.name_ = "spatial_data";
-	attSpatial.rep_.type_ = TePOLYGONTYPE;
-	attList.push_back(attSpatial);}
-
-	if(!createTable(tableName, attList))
-		return false;
-
-	string idxName = "te_idx_"  + tableName + "_obj";
-
-	return createIndex(tableName, idxName, "object_id");
-}
-
-bool TeDatabase::createLineGeometry(const string& tableName) 
-{
-	if(tableName.empty())
-		return false;
-
-	TeAttributeList attList;
-
-	{TeAttribute attGeomId;
-	attGeomId.rep_.name_ = "geom_id";
-	attGeomId.rep_.type_ = TeUNSIGNEDINT;
-	attGeomId.rep_.isAutoNumber_ = true;
-	attGeomId.rep_.isPrimaryKey_ = true;
-	attGeomId.rep_.null_ = false;
-	attList.push_back(attGeomId);}
-
-	{TeAttribute attObjId;
-	attObjId.rep_.name_ = "object_id";
-	attObjId.rep_.type_ = TeSTRING;
-	attObjId.rep_.numChar_ = 255;
-	attObjId.rep_.null_ = false;
-	attList.push_back(attObjId);}
-
-	{TeAttribute attSpatial;
-	attSpatial.rep_.name_ = "spatial_data";
-	attSpatial.rep_.type_ = TeLINE2DTYPE;
-	attList.push_back(attSpatial);}
-
-	if(!createTable(tableName, attList))
-		return false;
-
-	string idxName = "te_idx_"  + tableName + "_obj";
-
-	return createIndex(tableName, idxName, "object_id");
-}
-
-bool 
-TeDatabase::deleteRelation(const string& name, const string& table)
-{
-	string relation = "ALTER TABLE " + table + " DROP ";
-	relation += " CONSTRAINT " + name;
-	return execute(relation);
-}
-
-bool 
-TeDatabase::dropDBView(const string& dbViewName)
-{
-   string del = "DROP VIEW " + dbViewName;
-   return (execute(del));
-} 
-
-bool 
-TeDatabase::updateBBox(const string& tableName, const string& keyColumnName, int keyValue, const TeBox& box)
-{
-	string upd = "UPDATE "+tableName+" SET lower_x=" + Te2String(box.x1_,15);
-	upd += ", lower_y=" + Te2String(box.y1_, 15);
-	upd += ", upper_x=" + Te2String(box.x2_, 15);
-	upd += ", upper_y=" + Te2String(box.y2_, 15);
-	upd += " WHERE " + keyColumnName + "=" + Te2String(keyValue);
-	return execute(upd);
-}
-bool 
-TeDatabase::beginTransaction()
-{
-	transactionCounter_++; 
-	return true;
-} 
-
-bool 
-TeDatabase::commitTransaction()
-{
-	transactionCounter_ = max(transactionCounter_-1, 0);
-	return true;
-} 
-
-bool 
-TeDatabase::rollbackTransaction()
-{
-	transactionCounter_ = max(transactionCounter_-1, 0);
-	return true;
-} 
-
-TeBox 
-TeDatabase::getThemeBox(TeTheme* theme)
-{
-	TeBox bb;
-	if (!theme)
-		return bb;
-
-	TeLayer* layer = theme->layer();
-	if (layer->hasGeometry(TeRASTER))
-		bb = layer->box();
-
-	if (layer->hasGeometry(TeRASTERFILE))
-		updateBox(bb,layer->getRepresentation(TeRASTERFILE)->box_);
-
-	string colTabName = theme->collectionTable();
-	if (colTabName.empty())
-		return bb;
-
-	string sqlfrom;
-	string geomTable;
-	if (layer->hasGeometry(TePOINTS))
-	{
-		geomTable = layer->tableName(TePOINTS);
-		sqlfrom = colTabName + " LEFT JOIN " + geomTable;
-		sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
-		TeBox bpt;
-		if (getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TePOINTS,bpt))
-			updateBox(bb,bpt);
-	}
-	if (layer->hasGeometry(TeLINES))
-	{
-		geomTable = layer->tableName(TeLINES);
-		sqlfrom = colTabName + " LEFT JOIN " + geomTable;
-		sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
-		TeBox bln;
-		if (getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeLINES,bln))
-			updateBox(bb,bln);
-	}
-	if (layer->hasGeometry(TePOLYGONS))
-	{
-		geomTable = layer->tableName(TePOLYGONS);
-		sqlfrom = colTabName + " LEFT JOIN " + geomTable;
-		sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
-		TeBox bpol;
-		if (getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TePOLYGONS,bpol))
-			updateBox(bb,bpol);
-	}
-
-	if (layer->hasGeometry(TeCELLS))
-	{
-		geomTable = layer->tableName(TeCELLS);
-		sqlfrom = colTabName + " LEFT JOIN " + geomTable;
-		sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
-		TeBox bpol;
-		if (getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeCELLS,bpol))
-			updateBox(bb,bpol);
-	}
-
-	if (layer->hasGeometry(TeTEXT))
-	{
-		geomTable = layer->tableName(TeTEXT);
-		sqlfrom = colTabName + " LEFT JOIN " + geomTable;
-		sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
-		TeBox bpol;
-		if (getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeTEXT,bpol))
-			updateBox(bb,bpol);
-	}	
-
-	return bb;
-}
-
-// End TeDatabase Methods
-
-// Begin TeDatabasePortal Methods
-
-TeDatabasePortal::TeDatabasePortal():
-	db_(0),			
-	numRows_(0),
-	numFields_ (0),	
-	errorMessage_(""),
-	errorNumber_(0)
-	{}
-
-TeDatabasePortal::~TeDatabasePortal ()
-{
-}
-
-double 
-TeDatabasePortal::getDouble (int i)
-{  
-	char* val = getData(i); 
-	return atof(val); 
-}
-
-double 
-TeDatabasePortal::getDouble (const string& s)
-{  
-	char* val = getData(s); 
-	return atof(val); 
-}
-
-int 
-TeDatabasePortal::getInt (int i)
-{  
-	char* val = getData(i); 
-	return atoi(val); 
-}
-
-int 
-TeDatabasePortal::getInt (const string& s)
-{  
-	char* val = getData(s); 
-	return atoi(val); 
-}
-
-bool 
-TeDatabasePortal::fetchGeometry (TePolygon& geom, const unsigned int&)
-{
-	return fetchGeometry(geom);
-}
-
-bool 
-TeDatabasePortal::fetchGeometry (TeLine2D& geom, const unsigned int&)
-{
-	return fetchGeometry(geom);
-}
-	
-bool 
-TeDatabasePortal::fetchGeometry (TeNode& geom, const unsigned int&)
-{
-	return fetchGeometry(geom);
-}
-
-bool 
-TeDatabasePortal::fetchGeometry (TePoint& geom, const unsigned int&)
-{
-	return fetchGeometry(geom);
-}
-
-bool
-TeDatabasePortal::fetchGeometry (TeCell& cell)
-{
-	int index = atoi(getData("geom_id"));
-	string object_id = getData("object_id");
-	TeBox b (atof(getData("lower_x")),atof(getData("lower_y")),atof(getData("upper_x")),atof(getData("upper_y")));
-	cell.geomId(index);
-	cell.objectId(object_id);
-	cell.setBox (b);
-	cell.column(atoi(getData("col_number")));
-	cell.line(atoi(getData("row_number")));
-	return (fetchRow());
-}
-
-bool
-TeDatabasePortal::fetchGeometry (TeCell& cell, const unsigned int& initIndex)
-{
-	int index = atoi(getData(initIndex));
-	string object_id = getData(initIndex+1);
-	TeBox b (atof(getData(initIndex+2)),atof(getData(initIndex+3)),atof(getData(initIndex+4)),atof(getData(initIndex+5)));
-	cell.geomId(index);
-	cell.objectId(object_id);
-	cell.setBox (b);
-	cell.column(atoi(getData(initIndex+6)));
-	cell.line(atoi(getData(initIndex+7)));
-	return (fetchRow());
-}
-
-TeAttribute TeDatabasePortal::getAttribute (int i)
-{
-	TeAttributeList::iterator it = attList_.begin();
-	int j = 0;
-	while ( it != attList_.end() )
-	{
-		if (i == j)
-			return (*it);
-		++it;
-		j++;
-	}
-	return TeAttribute();
-}
-
-TeAttribute TeDatabasePortal::getAttribute (const string& s)
-{
-	TeAttributeList::iterator it = attList_.begin();
-	while ( it != attList_.end() )
-	{
-		if (TeConvertToUpperCase(s) == TeConvertToUpperCase((*it).rep_.name_))
-			return (*it);
-		++it;
-	}
-	return TeAttribute();
-}
-
-int 
-TeDatabasePortal::getColumnIndex (const string& s)
-{
-	TeAttributeList::iterator it = attList_.begin();
-	int j = 0;
-	while ( it != attList_.end() )
-	{
-		if (TeConvertToUpperCase(s) == TeConvertToUpperCase((*it).rep_.name_))
-			return j;
-		++it;
-		j++;
-	}
-	return -1;
-}
-
-string 
-TeDatabasePortal::getColumnName (int i)
-{
-	TeAttributeList::iterator it = attList_.begin();
-	int j=0;
-	while ( it != attList_.end() )
-	{
-		if (j==i)
-			return (*it).rep_.name_;
-		++it;
-		j++;
-	}
-	return "";
-}
-
-
-TeViewTree*
-TeDatabasePortal::getViewTree ()
-{
-	TeViewTree *tree = new TeViewTree();
-	tree->id (atoi(getData("theme_id")));
-	tree->name (getData("name"));
-	tree->priority(atoi(getData("priority")));
-	//Update the tree also with parent_id and node_type from te_theme table
-	tree->parentId(atoi(getData("parent_id")));
-	tree->type(atoi(getData("node_type")));	
-	//Is it necessary to set parent??
-	return tree;
-}
-
-TeLegendEntry 
-TeDatabasePortal::getLegend ()
-{
-	TeLegendEntry leg;
-	leg.id (atoi(getData("legend_id")));
-	leg.theme (atoi(getData("theme_id")));
-	leg.group (atoi(getData("group_id")));
-
-	string data;
-	data = getData("num_objs");
-	leg.count(atoi(data.c_str()));
-	data = getData("lower_value");
-	leg.from(data);
-	data = getData("upper_value");
-	leg.to(data);
-	data = getData("label");
-	leg.label(data);
-	return leg;
-}
-
-void
-TeDatabasePortal::getVisual(TeVisual* vis)
-{
-	TeGeomRep rep = (TeGeomRep)atoi (getData("geom_type"));
-
-	TeColor cor(atoi(getData("red")),atoi(getData("green")),atoi(getData("blue")));
-	vis->color(cor);
-	vis->transparency(atoi(getData("transparency")));
-
-	TeColor ccor(atoi(getData("contour_red")),atoi(getData("contour_green")),atoi(getData("contour_blue")));
-	vis->contourColor(ccor);
-	vis->contourWidth(atoi(getData("contour_width")));
-	vis->contourTransparency(atoi(getData("contour_transp")));
-
-	if(rep == TePOLYGONS || rep == TeCELLS)
-	{
-		vis->contourWidth(atoi(getData("width")));
-		vis->contourStyle(atoi(getData("contour_symb_id")));
-		vis->style(atoi(getData("symb_id")));
-	}
-	else if(rep == TeLINES)
-	{
-		vis->width(atoi(getData("width")));
-		vis->style(atoi(getData("symb_id")));
-	}
-	else if(rep == TePOINTS)
-	{
-		vis->size(atoi(getData("size_value")));
-		vis->style(atoi(getData("symb_id")));
-	}
-	else if(rep == TeTEXT)
-		vis->size(atoi(getData("size_value")));
-
-	vis->family(getData("family"));
-	vis->bold (getBool("bold"));
-	vis->italic (getBool("italic"));
-	vis->fixedSize (getBool("fixed_size"));
-
-	vis->alignmentVert(getDouble("alignment_vert"));
-	vis->alignmentHoriz(getDouble("alignment_horiz"));
-
-	vis->tabSize(atoi(getData("tab_size")));
-	vis->lineSpace(atoi(getData("line_space")));
-}
-
-bool 
-TeDatabasePortal::fetchGeometry (TeText& t)
-{
-	TeCoord2D c(getDouble("x"), getDouble("y"));
-	string txt = getData ("text_value");
-	TeText t2(c,txt);
-	t2.geomId(atoi(getData("geom_id")));
-	t2.objectId(string(getData("object_id")));
-	t2.setAngle (getDouble("angle"));
-	t2.setHeight (getDouble("height"));
-	t2.setAlignmentVert(getDouble("alignment_vert"));
-	t2.setAlignmentHoriz(getDouble("alignment_horiz"));
-	t = t2;
-	return (fetchRow());
-}
-
-bool 
-TeDatabasePortal::fetchGeometry (TeText& t, const unsigned int& initIndex)
-{
-	TeCoord2D c(getDouble(initIndex+2), getDouble(initIndex+3));
-	string txt = getData(initIndex+4);
-	TeText t2(c,txt);
-	t2.geomId(atoi(getData(initIndex)));
-	t2.objectId(string(getData(initIndex+1)));
-	t2.setAngle (getDouble(initIndex+5));
-	t2.setHeight (getDouble(initIndex+6));
-	t2.setAlignmentVert(getDouble(initIndex+7));
-	t2.setAlignmentHoriz(getDouble(initIndex+8));
-	t = t2;
-	return (fetchRow());
-}
-
-bool 
-TeDatabasePortal::fetchGeometry (TeArc& arc)
-{
-	arc.fromId(atoi(getData(2)));
-	arc.toId(atoi(getData(3)));
-	arc.geomId(atol(getData(0)));
-	arc.objectId(string(getData(1)));
-	return fetchRow();
-}
-
-bool 
-TeDatabasePortal::fetchGeometry (TeArc& arc, const unsigned int& initIndex)
-{
-	arc.fromId(atoi(getData(initIndex+2)));
-	arc.toId(atoi(getData(initIndex+3)));
-	arc.geomId(atol(getData(initIndex+0)));
-	arc.objectId(string(getData(initIndex+1)));
-	return fetchRow();
-}
-
-bool	
-TeDatabasePortal::getVisual(TeVisual* vis, TeGeomRep& rep, const unsigned int& initIndex)
-{
-	string legendId = this->getData(initIndex);
-	if(legendId.empty())
-		return false;
-
-	rep = (TeGeomRep)atoi (getData(initIndex+1)); //geom_type = 1
-
-	TeColor cor(atoi(getData(initIndex+3)),atoi(getData(initIndex+4)),atoi(getData(initIndex+5)));
-	vis->color(cor);
-	vis->transparency(atoi(getData(initIndex+6)));
-
-	TeColor ccor(atoi(getData(initIndex+9)),atoi(getData(initIndex+10)),atoi(getData(initIndex+11)));
-	vis->contourColor(ccor);
-	vis->contourWidth(atoi(getData(initIndex+13)));
-	vis->contourTransparency(atoi(getData(initIndex+12)));
-
-	if(rep == TePOLYGONS || rep == TeCELLS)
-	{
-		vis->contourWidth(atoi(getData(initIndex+13)));
-		vis->contourStyle(atoi(getData(initIndex+8)));
-		vis->style(atoi(getData(initIndex+2)));
-	}
-	else if(rep == TeLINES)
-	{
-		vis->width(atoi(getData(initIndex+7)));
-		vis->style(atoi(getData(initIndex+2)));
-	}
-	else if(rep == TePOINTS)
-	{
-		vis->size(atoi(getData(initIndex+14)));
-		vis->style(atoi(getData(initIndex+2)));
-	}
-	else if(rep == TeTEXT)
-		vis->size(atoi(getData(initIndex+14)));
-
-	vis->family(getData(initIndex+16));
-	vis->bold (getBool(initIndex+17));
-	vis->italic (getBool(initIndex+18));
-	vis->fixedSize (getBool(initIndex+23));
-
-	vis->alignmentVert(getDouble(initIndex+19));
-	vis->alignmentHoriz(getDouble(initIndex+20));
-
-	vis->tabSize(atoi(getData(initIndex+21)));
-	vis->lineSpace(atoi(getData(initIndex+22)));
-	return true;
-}
-
-bool	
-TeDatabasePortal::getRasterVisual(TeRasterVisual& vis, const unsigned int& initIndex)
-{
-	string themeId = getData(initIndex);
-	if(themeId.empty())
-		return false;
-
-	vis.setSrcBand(getInt(initIndex+1));
-	vis.setDestBand(getInt(initIndex+2));
-	vis.setTransfFunction(static_cast<TeRasterTransform::TeRasterTransfFunctions>(getInt(initIndex+3)));
-	if (vis.getTransfFunction() == TeRasterTransform::TeExtractRGB || 
-		vis.getTransfFunction() == TeRasterTransform::TeExtractBands)
-	{
-		vis.setBChannelMapping(getInt(initIndex+1),static_cast<TeRasterTransform::TeRGBChannels>(getInt(initIndex+2)));
-	}
-
-	if (vis.getTransfFunction() == TeRasterTransform::TeMono2LUTMonoBand ||
-		vis.getTransfFunction() == TeRasterTransform::TeThree2LUTThreeBand)
-	{
-		std::string lutName = getData(initIndex+6);
-
-		vis.setLutTableName(lutName);
-
-		vis.setBChannelMapping(getInt(initIndex+1),static_cast<TeRasterTransform::TeRGBChannels>(getInt(initIndex+2)));
-
-		TeDatabasePortal* portal = this->getDatabase()->getPortal();
-		if (!portal)
-			return false;
-
-		std::string get = "SELECT * FROM " + lutName + " ORDER BY index_id ASC ";
-
-		if (!portal->query(get) || !portal->fetchRow())	 // if there is no table, or table is empty
-		{
-			delete portal;
-			return false;
-		}
-
-		do
-		{
-			vis.lutr_.push_back(atoi(portal->getData(1)));
-			vis.lutg_.push_back(atoi(portal->getData(2)));
-			vis.lutb_.push_back(atoi(portal->getData(3)));
-		}while (portal->fetchRow());
-
-		vis.setLutSize(vis.lutr_.size());
-
-		delete portal;
-	}
-	
-	return true;
-}
-
-
-TeColor 
-TeDatabasePortal::getColor ()
-{
-	TeColor c(atoi(getData("red")), atoi(getData("green")), atoi(getData("blue")));
-	return c;
-}
-
-bool	
-TeDatabasePortal::getView(TeView& view, const unsigned int& initIndex)
-{
-	string viewId = getData(initIndex);
-	if(viewId.empty())
-		return false;
-	view.id(atoi(viewId.c_str()));
-	view.name(getData(initIndex+2));
-	view.user(getData(initIndex+3));
-	view.isVisible(getBool(initIndex+4));
-	view.setCurrentBox(TeBox(getDouble(initIndex+5), getDouble(initIndex+6), getDouble(initIndex+7), getDouble(initIndex+8)));
-	if(getData(initIndex+9) == "")
-		view.setCurrentTheme(-1);
-	else
-		view.setCurrentTheme(getInt(initIndex+9));
-	return true;
-}
-
-bool	
-TeDatabasePortal::getProjection(TeProjection** proj, const unsigned int& initIndex)
-{
-	string projId = getData(initIndex);
-	if(projId.empty())
-		return false;
-
-	TeDatum datum (	getData(initIndex+11),
-					getDouble(initIndex+12),
-					getDouble(initIndex+13),
-					getDouble(initIndex+14),
-					getDouble(initIndex+15),
-					getDouble(initIndex+16));
-
-	TeProjectionParams mProjPars;
-	mProjPars.datum = datum;
-	mProjPars.name = getData(initIndex+1);
-	mProjPars.lat0 = getDouble(initIndex+3)*TeCDR;
-	mProjPars.lon0 = getDouble(initIndex+2)*TeCDR;
-	mProjPars.offx = getDouble(initIndex+4);
-	mProjPars.offy = getDouble(initIndex+5);
-	mProjPars.stlat1 = getDouble(initIndex+6)*TeCDR;
-	mProjPars.stlat2 = getDouble(initIndex+7)*TeCDR;
-	mProjPars.units = getData(initIndex+8);
-	mProjPars.scale = getDouble(initIndex+9);
-	mProjPars.hemisphere = (TeHemisphere)getInt(initIndex+10);
-
-	*proj = TeProjectionFactory::make(mProjPars);
-	if(!*proj)
-		return false;
-
-	(*proj)->id(atoi(projId.c_str()));
-	return true;
-}
-
-void
-TeDatabasePortal::getViewNodeParams (TeViewNodeParams& params, const unsigned int& initIndex)
-{
-	params.name_ = string (this->getData(initIndex+3));	//name
-	params.id_ = this->getInt(initIndex);				// id
-	params.viewId_ = this->getInt(initIndex+2);			//view id
-	params.nodeType_ = 	this->getInt(initIndex+6);		//node type
-	params.priority_ = 	this->getInt(initIndex+5);		//priority  
-	params.myParentId_ = this->getInt(initIndex+4);	//parent id
-}
-
-bool
-TeDatabasePortal::getTheme(TeAbstractTheme& theme, const unsigned int& initIndex)
-{
-	string themeId = getData(initIndex);
-	if(themeId.empty())
-		return false;
-		
-	theme.id(atoi(themeId.c_str()));
-	theme.view (atoi(this->getData (initIndex+2)));
-	theme.name(string (this->getData(initIndex+3)));
-	theme.parentId( atoi(this->getData (initIndex+4)));
-	theme.type ((TeViewNodeType)this->getInt(initIndex+6));
-	theme.priority(this->getInt(initIndex+5));
-	theme.minScale (this->getDouble (initIndex+7));
-	theme.maxScale (this->getDouble (initIndex+8));
-	theme.attributeRest(string(this->getData (initIndex+9)));
-	theme.spatialRest(string(this->getData (initIndex+10)));
-	theme.temporalRest(string(this->getData (initIndex+11)));
-	theme.visibleRep(atoi(this->getData (initIndex+13)));
-	theme.visibility(atoi(this->getData (initIndex+14)));
-	theme.setThemeBox(TeBox(getDouble(initIndex+15), getDouble(initIndex+16), getDouble(initIndex+17), getDouble(initIndex+18)));
-
-	if(theme.type()==TeTHEME)
-	{
-		static_cast<TeTheme&>(theme).collectionTable(string(this->getData (initIndex+12)));
-		static_cast<TeTheme&>(theme).collectionAuxTable(static_cast<TeTheme&>(theme).collectionTable() + "_aux");
-		static_cast<TeTheme&>(theme).layerId (atoi(this->getData(initIndex+1)));
-	}
-	else if(theme.type()==TeEXTERNALTHEME)
-	{
-		static_cast<TeExternalTheme&>(theme).collectionTable(string(this->getData (initIndex+12)));
-		static_cast<TeExternalTheme&>(theme).collectionAuxTable(static_cast<TeExternalTheme&>(theme).collectionTable() + "_aux");
-	}
-	else if(theme.type()==TeEXTERNALTHEME)
-	{
-		static_cast<TeTheme&>(theme).collectionTable(string(this->getData (initIndex+12)));
-		static_cast<TeTheme&>(theme).collectionAuxTable(static_cast<TeTheme&>(theme).collectionTable() + "_aux");
-	}
-
-	theme.setCreationTime(this->getDate(initIndex+19));
-
-	return true;
-}
-
-bool	
-TeDatabasePortal::getGrouping(TeGrouping& group, const unsigned int& initIndex)
-{
-	string groupThemeId = getData(initIndex);
-	if(groupThemeId.empty())
-		return false;
-
-	TeAttributeRep atRep;
-	string attname = getData (initIndex+2);
-	string norname = getData (initIndex+5);
-	int f = attname.find("(");
-	if(f >= 0)
-	{
-		string alias = attname;
-		attname = attname.substr(0, f);
-		alias = alias.substr(f+1);
-		alias = alias.substr(0, alias.size()-1);
-		map<string, string>& m = this->getDatabase()->mapThemeAlias()[atoi(groupThemeId.c_str())];
-		m[attname] = alias;
-	}
-	f = norname.find("(");
-	if(f >= 0)
-	{
-		string alias = norname;
-		norname = norname.substr(0, f);
-		alias = alias.substr(f+1);
-		alias = alias.substr(0, alias.size()-1);
-		map<string, string>& m = this->getDatabase()->mapThemeAlias()[atoi(groupThemeId.c_str())];
-		m[norname] = alias;
-	}
-
-	if(attname=="NONE")
-		attname = "";
-	
-	if(norname=="NONE")
-		norname = "";
-		
-	atRep.name_ = attname;
-	atRep.type_ = TeAttrDataType(atoi(getData(initIndex+3)));
-	group.groupAttribute_ = atRep;
-	group.groupNormAttribute_ = norname;
-	group.groupMode_ = TeGroupingMode(getInt(initIndex+4));
-	group.groupNumSlices_ = getInt(initIndex+1);
-	group.groupPrecision_ = getInt(initIndex+7);
-	group.groupStdDev_ = getDouble(initIndex+6);
-	group.groupFunction_ = getData(initIndex+8);
-	group.groupChronon_ = TeChronon(getInt(initIndex+9));
-	return true;
-}
-
-bool 
-TeDatabasePortal::getLegend (TeLegendEntry& leg, const unsigned int& initIndex)
-{
-	string legId = getData(initIndex);
-	if(legId.empty())
-		return false;
-
-	leg.id(atoi(getData(initIndex)));
-	leg.theme (atoi(getData(initIndex+1)));
-	leg.group (atoi(getData(initIndex+2)));
-	leg.count (atoi(getData(initIndex+3)));
-
-  std::string lower_value_str( getData(initIndex+4) );
-  leg.from( lower_value_str );
-  
-  std::string upper_value_str( getData(initIndex+5) );
-  leg.to( upper_value_str );
-  
-  std::string label_str( getData(initIndex+6) );
-  leg.label( label_str );
-    
-	return true;
-}
-
-bool	
-TeDatabasePortal::getAttrTable(TeTable& table, const unsigned int& initIndex)
-{
-	string tableName = this->getData(initIndex+2);
-	if(tableName.empty())
-		return false;
-
-	table.name (tableName);
-	table.setId(this->getInt(initIndex+0));
-	table.setLinkName(this->getData(initIndex+4));
-	table.setUniqueName(this->getData(initIndex+3));
-	table.attInitialTime(this->getData(initIndex+5));
-	table.attFinalTime(this->getData(initIndex+6));
-	table.attTimeUnit(TeChronon(this->getInt(initIndex+7)));
-	table.setTableType((TeAttrTableType)this->getInt(initIndex+8));
-	return true;
-}
-
-bool	
-TeDatabasePortal::getLayer(TeLayer& layer, const unsigned int& initIndex)
-{
-	string layerId = this->getData(initIndex);
-	if(layerId.empty())
-		return false;
-
-    layer.id(atoi(layerId.c_str()));
-	layer.name(string (this->getData(initIndex+2)));
-
-	std::string x1 = this->getData("te_layer.lower_x");
-	std::string y1 = this->getData("te_layer.lower_y");
-	std::string x2 = this->getData("te_layer.upper_x");
-	std::string y2 = this->getData("te_layer.upper_y");
-
-	layer.setLayerBox(TeBox(this->getDouble(initIndex+3),
-						this->getDouble(initIndex+4),
-						this->getDouble(initIndex+5),
-						this->getDouble(initIndex+6)));
-
-	layer.setEditionTime(this->getDate(initIndex+9));
-
-	return true;
-}
-
-bool	
-TeDatabasePortal::getRepresentation(TeRepresentation& rep, const unsigned int& initIndex)
-{
-	string repId = this->getData(initIndex);
-	if(repId.empty())
-		return false;
-
-	rep.id_ = atoi(repId.c_str());
-	TeGeomRep g = (TeGeomRep)atoi(this->getData(initIndex+2));
-	rep.geomRep_ = g;
-	rep.tableName_ = this->getData(initIndex+3);
-	rep.description_ = this->getData(initIndex+4);
-	rep.box_ = TeBox(this->getDouble(initIndex+5),
-				this->getDouble(initIndex+6),
-				this->getDouble(initIndex+7),
-				this->getDouble(initIndex+8));
-	rep.resX_ = this->getDouble(initIndex+9);
-	rep.resY_ = this->getDouble(initIndex+10);
-	rep.nCols_ = this->getInt(initIndex+11);
-	rep.nLins_ = this->getInt(initIndex+12);
-	return true;
-}
-
-
-
-// End TeDatabasePortal Methods
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeDatabase.h"
+#include "TeDecoderDatabase.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeSpatialOperations.h"
+#include "TeImportRaster.h"
+#include "TeLayer.h"
+#include "TeAbstractTheme.h"
+#include "TeExternalTheme.h"
+#include "TeDatabaseFactoryParams.h"
+#include <TeRasterTransform.h>
+#include <TeTimeInterval.h>
+#include <TeDBConnectionsPool.h>
+
+#include <sys/stat.h>
+#include <stdio.h>
+#include <sstream>
+
+#include <string.h>
+
+typedef map<int,TeNode> TeNodeMap;
+
+static const int scales [] =
+{	150000,
+	80000,
+	40000,
+	20000,
+	10000,
+	3000,
+	1500,
+	800,
+	400,
+	200,
+	100,
+	30,
+	15,
+	8,
+	4,
+	2,
+	1
+};
+
+//-*********************
+
+TeDatabase::TeDatabase() :
+	isConnected_ (false),
+	host_(""),
+	user_(""),
+	password_(""),
+	database_(""),
+	portNumber_(-1),
+	errorNumber_(0),
+	errorMessage_(""),
+	transactionCounter_(0)
+{
+	metaModel_.reset(new TeMetaModelCache);
+}
+
+TeDatabase& TeDatabase::operator=(const TeDatabase& other)
+{
+	if(this != &other)
+		metaModel_ = other.metaModel_;	
+
+	return *this;
+}
+
+TeDatabase::~TeDatabase()
+{
+}
+
+string
+TeDatabase::getDatabaseDescription()
+{
+    std::stringstream desc;
+    const char sep = ';';
+
+    desc << dbmsName_;
+    desc << sep << host_;
+    desc << sep << portNumber_;
+    desc << sep << database_;
+    desc << sep << user_;
+    desc << sep << password_;
+
+    return desc.str();
+} 
+
+void TeDatabase::alterTableInfoInMemory(const string& updatedTableName, string oldTableName)
+{
+	//update table in memory
+	TeTable updatedTable(updatedTableName);
+	loadTableInfo(updatedTable);
+	if(oldTableName.empty())
+		oldTableName = updatedTableName;
+
+	TeLayerMap::iterator itLayer = metaModel_->layerMap().begin();
+	while(itLayer!=metaModel_->layerMap().end())
+	{
+		TeAttrTableVector::iterator itAttr = itLayer->second->attrTables().begin();
+		while(itAttr!=itLayer->second->attrTables().end())
+		{
+			if(TeConvertToUpperCase(itAttr->name())==TeConvertToUpperCase(oldTableName))
+			{
+				(*itAttr)=updatedTable;
+				break;
+			}
+			++itAttr;
+		}
+		++itLayer;
+	}
+	TeThemeMap::iterator itTheme = metaModel_->themeMap().begin();
+	while(itTheme!=metaModel_->themeMap().end())
+	{
+		if(itTheme->second->getProductId() != TeTHEME)
+		{
+			++itTheme; 
+			continue;
+		}
+
+		TeTheme* theme = static_cast<TeTheme*>(itTheme->second);
+				
+		TeAttrTableVector::iterator itAttr = theme->attrTables().begin();
+		while(itAttr!=theme->attrTables().end())
+		{
+			if(TeConvertToUpperCase(itAttr->name())==TeConvertToUpperCase(oldTableName))
+			{
+				(*itAttr)=updatedTable;
+				theme->loadAliasVector();
+				theme->loadAttrLists();
+				theme->loadTablesJoin(); 
+				break;
+			}
+			++itAttr;
+		}
+		++itTheme;
+	}
+	return;
+}
+
+bool TeDatabase::validTable (TeTable& table)
+{
+	int cont=0;
+	bool change = false;
+	bool changeTable = false;
+	bool uniqueName, linkName; 
+	
+	TeAttributeList::iterator it = table.attributeList().begin();
+	TeAttributeList::iterator it2;  
+	while(it != table.attributeList().end())
+	{
+		uniqueName = false;
+		linkName = false;
+
+		if((*it).rep_.name_==table.uniqueName())
+			uniqueName=true;
+		
+		if((*it).rep_.name_==table.linkName())
+			linkName=true;
+
+		string errorMess;
+		string temp = TeCheckName((*it).rep_.name_, change, errorMess);
+		
+		if(change)
+		{
+			it2 = table.attributeList().begin();
+			while(it2!=table.attributeList().end())
+			{
+				if(temp==(*it2).rep_.name_)
+				{
+					temp += Te2String(cont);
+					it2 = table.attributeList().begin();
+					++cont;
+				}
+				else
+					++it2;
+			}
+
+			changeTable = true;
+		}
+
+		if(change && uniqueName)
+			table.setUniqueName(temp);
+		if(change && linkName)
+			table.setLinkName (temp);
+
+		(*it).rep_.name_ = temp;
+		++it;
+		++cont;
+	}
+	
+	return changeTable;
+}
+
+string TeDatabase::getTableName(int tableId)
+{
+	string tableName;
+
+	TeDatabasePortal* pt = getPortal();
+	string q = "SELECT attr_table FROM te_layer_table";
+	q += " WHERE table_id = " + Te2String(tableId);
+	if (pt->query(q) == true && pt->fetchRow())
+		tableName = pt->getData("attr_table");
+	delete pt;
+	return tableName;
+}
+
+bool
+TeDatabase::deleteTable (const string& table)
+{
+//	int f =	table.find ("te_collection", std::string::npos);
+	int f =	table.find ("te_collection");
+
+	if( table=="te_theme" ||
+		table=="te_layer" ||
+		table=="te_representation" ||
+		table=="te_tables_relation" ||
+		table=="te_layer_table" ||
+		table=="te_raster_metadata" ||
+		table=="te_projection" ||
+		table=="te_view" ||
+		table=="te_legend" ||
+		table=="te_visual" ||
+		table=="te_database" ||
+		f == 0)
+	{
+		errorMessage_ = "N�o � poss�vel deletar tabelas do modelo!";
+		return false;
+	}
+
+	string del = "DROP TABLE " + table;
+	if(tableExist(table))
+	{
+		if(!execute(del))
+			return false;
+	}
+
+	return true;
+}
+
+
+bool 
+TeDatabase::deleteColumn (const string& table, const string& colName)
+{
+	if(!tableExist(table))
+		return false;
+	TeAttribute attr;
+	if (!columnExist(table,colName,attr))
+		return true;
+	string drop = "ALTER  TABLE "+ table +" DROP COLUMN "+ colName;
+	if(execute(drop) == false)
+		return false;
+
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + table + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+	if(tableId.empty() == false)
+	{
+		// delete relation
+		sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+		sql += " AND related_attr = '" + colName + "')";
+		sql += " OR (external_table_name = '" + table + "'";
+		sql += " AND external_attr = '" + colName + "')";
+		if(execute(sql) == false)
+			return false;
+
+		// delete grouping
+		TeDatabasePortal* portal = getPortal();
+		sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + table + "." + colName + "'";
+		if(portal->query(sql) && portal->fetchRow())
+		{
+			string themeId = portal->getData(0);
+
+			sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
+			if(execute(sql) == false)
+			{
+				delete portal;
+				return false;
+			}
+		}
+		delete portal;
+
+		sql = "DELETE FROM te_grouping";
+		sql += " WHERE grouping_attr = '" + table + "." + colName + "'";
+		if(execute(sql) == false)
+			return false;
+	}
+	alterTableInfoInMemory(table);
+	return true;
+}
+
+bool 
+TeDatabase::defineIntegrity(void)
+{
+	if (existRelation("te_layer","fk_layer_proj_id") == TeNoRelation )
+		if (!createRelation("fk_layer_proj_id", "te_layer", "projection_id", "te_projection", "projection_id", false))
+			return false;
+        
+	if (existRelation("te_representation","fk_rep_layer_id") == TeNoRelation )
+		if (!createRelation("fk_rep_layer_id", "te_representation", "layer_id", "te_layer", "layer_id", true))
+			return false;
+
+	if (existRelation("te_view","fk_view_proj_id") == TeNoRelation )
+		if (!createRelation("fk_view_proj_id", "te_view", "projection_id", "te_projection", "projection_id", false))
+			return false;
+
+	if (existRelation("te_view", "fk_view_current_theme") == TeNoRelation )
+		if (!createRelation("fk_view_current_theme", "te_view", "current_theme", "te_theme", "theme_id", false))
+			return false;
+	
+	if (existRelation("te_theme","fk_theme_layer_id") == TeNoRelation )
+		if (!createRelation("fk_theme_layer_id", "te_theme", "layer_id", "te_layer", "layer_id", true))
+			return false;
+
+	if (existRelation("te_theme","fk_theme_view_id") == TeNoRelation )
+		if (!createRelation("fk_theme_view_id", "te_theme", "view_id", "te_view", "view_id", true))
+			return false;
+
+	if (existRelation("te_theme_table","fk_thmtable_theme_id") == TeNoRelation )
+		if (!createRelation("fk_thmtable_theme_id", "te_theme_table", "theme_id", "te_theme", "theme_id", true))
+			return false;
+
+	if (existRelation("te_theme_table","fk_thmtable_lytable_id") == TeNoRelation )
+		if (!createRelation("fk_thmtable_lytable_id", "te_theme_table", "table_id", "te_layer_table", "table_id", false))
+			return false;
+
+	if (existRelation("te_theme_table","fk_thmtable_relation_id") == TeNoRelation )
+		if (!createRelation("fk_thmtable_relation_id", "te_theme_table", "relation_id", "te_tables_relation", "relation_id", false))
+			return false;
+
+	if (existRelation("te_grouping","fk_group_theme_id") == TeNoRelation )
+		if (!createRelation("fk_group_theme_id", "te_grouping", "theme_id", "te_theme", "theme_id", true))
+			return false;
+
+	if (existRelation("te_legend","fk_legend_theme_id") == TeNoRelation )
+		if (!createRelation("fk_legend_theme_id", "te_legend", "theme_id", "te_theme", "theme_id", true))
+			return false;
+
+	if (existRelation("te_visual","fk_visual_legend_id") == TeNoRelation )
+		if (!createRelation("fk_visual_legend_id", "te_visual", "legend_id", "te_legend", "legend_id", true))
+			return false;
+        
+	if (existRelation("te_layer_table","fk_laytable_layer_id") == TeNoRelation )
+		if (!createRelation ("fk_laytable_layer_id", "te_layer_table", "layer_id", "te_layer", "layer_id", true))
+			return false;
+        
+	if (existRelation("te_tables_relation","fk_tabrelation_laytable_id") == TeNoRelation )
+		if (!createRelation("fk_tabrelation_laytable_id", "te_tables_relation", "related_table_id", "te_layer_table", "table_id", true))
+			return false;
+
+	if (existRelation("te_visual_raster","fk_visrast_theme_id") == TeNoRelation )
+		if (!createRelation("fk_visrast_theme_id", "te_visual_raster", "theme_id", "te_theme", "theme_id", true))
+			return false;
+
+	if (existRelation("te_project_view","fk_projectview_project_id") == TeNoRelation )
+		if (!createRelation("fk_projectview_project_id", "te_project_view", "project_id", "te_project", "project_id", true))
+			return false;
+
+	if (existRelation("te_project_view","fk_projectview_view_id") == TeNoRelation )
+		if (!createRelation("fk_projectview_view_id", "te_project_view", "view_id", "te_view", "view_id", true))
+			return false;
+
+	return true;
+}
+
+bool 
+TeDatabase::createConceptualModel(bool withIntegrity, bool newDatabase, bool /* createIndex */)
+{
+	bool status = true;
+	bool createMainTables = false;
+	
+	if (!this->tableExist("te_projection"))
+	{
+		status = this->createProjectionTable();
+		if (!status)
+			return false;	
+		createMainTables = true;
+	}
+
+	if (!this->tableExist("te_layer"))
+	{
+		status = this->createLayerTable();
+		if (!status)
+			return false;
+		createMainTables = true;
+	}
+
+	if (!this->tableExist("te_layer_table"))
+	{
+		status = this->createLayerTableTable();
+		if (!status)
+			return false;
+		createMainTables = true;
+	}
+
+	if (!this->tableExist("te_tables_relation"))
+	{
+		status = this->createTablesRelationTable();
+		if (!status)
+			return false;
+		createMainTables = true;
+	}
+	
+	if (!this->tableExist("te_representation"))
+	{
+		status = this->createRepresentationTable();
+		if (!status)
+			return false;
+		createMainTables = true;
+	}
+
+	if (!this->tableExist("te_theme"))
+	{
+		status = this->createThemeTable();
+		if (!status)
+			return false;
+		createMainTables = true;
+	}
+
+	if (!this->tableExist("te_view"))
+	{
+		status = this->createViewTable();
+		if (!status)
+			return false;
+		createMainTables = true;
+	}
+
+	if (!this->tableExist("te_grouping"))
+	{
+		status = this->createGroupingTable();
+		if (!status)
+			return false;
+	}
+
+	if (!this->tableExist("te_theme_table"))
+	{
+		status = this->createThemeTablesTable();
+		if (!status)
+			return false;
+	}
+
+	if (!this->tableExist("te_legend"))
+	{
+		status = this->createLegendTable();
+		if (!status)
+			return false;	
+	}
+
+	if (!this->tableExist("te_visual"))
+	{
+		status = this->createVisualTable();
+		if (!status)
+			return false;	
+	}
+
+	if (!this->tableExist("te_visual_raster"))
+	{
+		status = this->createVisualRasterTable();
+		if (!status)
+			return false;	
+	}
+
+	if (!this->tableExist("te_database"))
+	{
+		status = this->createDatabaseTable();
+		if (!status)
+			return false;
+	}
+
+	if (!this->tableExist("te_project"))
+	{
+		status = this->createProjectTable();
+		if (!status)
+			return false;
+	}
+
+	if (!this->tableExist("te_project_view"))
+	{
+		status = this->createProjectViewTable();
+		if (!status)
+			return false;
+	}
+	if (newDatabase || createMainTables)
+	{
+		string ins = "INSERT INTO te_database (db_version) VALUES ('" + TeDBVERSION + "')";
+		if (!execute(ins))
+			return false;
+	}
+
+	if (withIntegrity)
+		status = defineIntegrity();
+
+	return status;
+}
+
+bool
+TeDatabase::createIndex(const string& tableName, const string& indexName, const string& columnsName)
+{
+	string sql = "CREATE INDEX " + indexName + " ON " + tableName + "(" + columnsName + ")";	
+	return execute (sql);
+}
+
+bool
+TeDatabase::deleteIndex(const string& , const string& indexName)
+{
+	string sql = "DROP INDEX " + indexName;	
+	return execute(sql);
+}
+
+bool
+TeDatabase::getIndexesFromTable(const string& , std::vector<TeDatabaseIndex>& )
+{
+	return true;
+}
+
+bool 
+TeDatabase::createDatabaseTable()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attDBVersion;
+	attDBVersion.rep_.name_ = "db_version";
+	attDBVersion.rep_.type_ = TeSTRING;
+	attDBVersion.rep_.numChar_ = 50;
+	attDBVersion.rep_.isPrimaryKey_ = true;
+	attDBVersion.rep_.null_ = false;
+	attList.push_back(attDBVersion);}
+
+	{TeAttribute attDBCreation;
+	attDBCreation.rep_.name_ = "db_creation";
+	attDBCreation.rep_.type_ = TeDATETIME;
+	attList.push_back(attDBCreation);}
+
+	return createTable("te_database", attList);
+}
+
+bool 
+TeDatabase::createProjectTable()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attProjectId;
+	attProjectId.rep_.name_ = "project_id";
+	attProjectId.rep_.type_ = TeUNSIGNEDINT;
+	attProjectId.rep_.isAutoNumber_ = true;
+	attProjectId.rep_.isPrimaryKey_ = true;
+	attProjectId.rep_.null_ = false;
+	attList.push_back(attProjectId);}
+
+	{TeAttribute attName;
+	attName.rep_.name_ = "name";
+	attName.rep_.type_ = TeSTRING;
+	attName.rep_.numChar_ = 50;
+	attName.rep_.null_ = false;
+	attList.push_back(attName);}
+
+	{TeAttribute attDescription;
+	attDescription.rep_.name_ = "description";
+	attDescription.rep_.type_ = TeSTRING;
+	attDescription.rep_.numChar_ = 255;
+	attDescription.rep_.null_ = true;
+	attList.push_back(attDescription);}
+
+	{TeAttribute attCurrentView;
+	attCurrentView.rep_.name_ = "current_view";
+	attCurrentView.rep_.type_ = TeINT;
+	attList.push_back(attCurrentView);}
+
+	return createTable("te_project", attList);
+}
+
+bool 
+TeDatabase::createProjectViewTable()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attProjectId;
+	attProjectId.rep_.name_ = "project_id";
+	attProjectId.rep_.type_ = TeUNSIGNEDINT;
+	attProjectId.rep_.isPrimaryKey_ = true;
+	attProjectId.rep_.null_ = false;
+	attList.push_back(attProjectId);}
+
+	{TeAttribute attViewId;
+	attViewId.rep_.name_ = "view_id";
+	attViewId.rep_.type_ = TeUNSIGNEDINT;
+	attViewId.rep_.isPrimaryKey_ = true;
+	attViewId.rep_.null_ = false;
+	attList.push_back(attViewId);}
+
+	return createTable("te_project_view", attList);
+}
+
+bool 
+TeDatabase::createProjectionTable ()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attProjectId;
+	attProjectId.rep_.name_ = "projection_id";
+	attProjectId.rep_.type_ = TeUNSIGNEDINT;
+	attProjectId.rep_.isPrimaryKey_ = true;
+	attProjectId.rep_.isAutoNumber_ = true;
+	attProjectId.rep_.null_ = false;
+	attList.push_back(attProjectId);}
+
+	{TeAttribute attName;
+	attName.rep_.name_ = "name";
+	attName.rep_.type_ = TeSTRING;
+	attName.rep_.numChar_ = 50;
+	attName.rep_.null_ = false;
+	attList.push_back(attName);}
+
+	{TeAttribute attLong0;
+	attLong0.rep_.name_ = "long0";
+	attLong0.rep_.type_ = TeREAL;
+	attLong0.rep_.decimals_ = 15;
+	attLong0.rep_.defaultValue_ = "0.0";
+	attList.push_back(attLong0);}
+
+	{TeAttribute attLat0;
+	attLat0.rep_.name_ = "lat0";
+	attLat0.rep_.type_ = TeREAL;
+	attLat0.rep_.decimals_ = 15;
+	attLat0.rep_.defaultValue_ = "0.0";
+	attList.push_back(attLat0);}
+
+	{TeAttribute attOffX;
+	attOffX.rep_.name_ = "offx";
+	attOffX.rep_.type_ = TeREAL;
+	attOffX.rep_.decimals_ = 15;
+	attOffX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attOffX);}
+
+	{TeAttribute attOffY;
+	attOffY.rep_.name_ = "offy";
+	attOffY.rep_.type_ = TeREAL;
+	attOffY.rep_.decimals_ = 15;
+	attOffY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attOffY);}
+
+	{TeAttribute attSlat1;
+	attSlat1.rep_.name_ = "stlat1";
+	attSlat1.rep_.type_ = TeREAL;
+	attSlat1.rep_.decimals_ = 15;
+	attSlat1.rep_.defaultValue_ = "0.0";
+	attList.push_back(attSlat1);}
+
+	{TeAttribute attSlat2;
+	attSlat2.rep_.name_ = "stlat2";
+	attSlat2.rep_.type_ = TeREAL;
+	attSlat2.rep_.decimals_ = 15;
+	attSlat2.rep_.defaultValue_ = "0.0";
+	attList.push_back(attSlat2);}
+
+	{TeAttribute attUnit;
+	attUnit.rep_.name_ = "unit";
+	attUnit.rep_.type_ = TeSTRING;
+	attUnit.rep_.numChar_ = 50;
+	attUnit.rep_.null_ = false;
+	attList.push_back(attUnit);}
+
+	{TeAttribute attScale;
+	attScale.rep_.name_ = "scale";
+	attScale.rep_.type_ = TeREAL;
+	attScale.rep_.decimals_ = 15;
+	attScale.rep_.defaultValue_ = "0.0";
+	attList.push_back(attScale);}
+
+	{TeAttribute attHemis;
+	attHemis.rep_.name_ = "hemis";
+	attHemis.rep_.type_ = TeINT;
+	attHemis.rep_.null_ = false;
+	attList.push_back(attHemis);}
+
+	{TeAttribute attDatum;
+	attDatum.rep_.name_ = "datum";
+	attDatum.rep_.type_ = TeSTRING;
+	attDatum.rep_.numChar_ = 50;
+	attDatum.rep_.null_ = false;
+	attList.push_back(attDatum);}
+
+	{TeAttribute attRadius;
+	attRadius.rep_.name_ = "radius";
+	attRadius.rep_.type_ = TeREAL;
+	attRadius.rep_.decimals_ = 15;
+	attRadius.rep_.defaultValue_ = "0.0";
+	attList.push_back(attRadius);}
+
+	{TeAttribute attFlattening;
+	attFlattening.rep_.name_ = "flattening";
+	attFlattening.rep_.type_ = TeREAL;
+	attFlattening.rep_.decimals_ = 15;
+	attFlattening.rep_.defaultValue_ = "0.0";
+	attList.push_back(attFlattening);}
+
+	{TeAttribute attDX;
+	attDX.rep_.name_ = "dx";
+	attDX.rep_.type_ = TeREAL;
+	attDX.rep_.decimals_ = 15;
+	attDX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attDX);}
+
+	{TeAttribute attDY;
+	attDY.rep_.name_ = "dy";
+	attDY.rep_.type_ = TeREAL;
+	attDY.rep_.decimals_ = 15;
+	attDY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attDY);}
+
+	{TeAttribute attDZ;
+	attDZ.rep_.name_ = "dz";
+	attDZ.rep_.type_ = TeREAL;
+	attDZ.rep_.decimals_ = 15;
+	attDZ.rep_.defaultValue_ = "0.0";
+	attList.push_back(attDZ);}
+
+	return createTable("te_projection", attList);
+}
+
+bool TeDatabase::createLayerTable ()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attLayerId;
+	attLayerId.rep_.name_ = "layer_id";
+	attLayerId.rep_.type_ = TeUNSIGNEDINT;
+	attLayerId.rep_.isPrimaryKey_ = true;
+	attLayerId.rep_.isAutoNumber_ = true;
+	attLayerId.rep_.null_ = false;
+	attList.push_back(attLayerId);}
+
+	{TeAttribute attProjectionId;
+	attProjectionId.rep_.name_ = "projection_id";
+	attProjectionId.rep_.type_ = TeUNSIGNEDINT;
+	attProjectionId.rep_.null_ = false;
+	attList.push_back(attProjectionId);}
+
+	{TeAttribute attName;
+	attName.rep_.name_ = "name";
+	attName.rep_.type_ = TeSTRING;
+	attName.rep_.numChar_ = 255;
+	attName.rep_.null_ = false;
+	attList.push_back(attName);}
+
+	{TeAttribute attLowerX;
+	attLowerX.rep_.name_ = "lower_x";
+	attLowerX.rep_.type_ = TeREAL;
+	attLowerX.rep_.decimals_ = 15;
+	attLowerX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attLowerX);}
+
+	{TeAttribute attLowerY;
+	attLowerY.rep_.name_ = "lower_y";
+	attLowerY.rep_.type_ = TeREAL;
+	attLowerY.rep_.decimals_ = 15;
+	attLowerY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attLowerY);}
+
+	{TeAttribute attUpperX;
+	attUpperX.rep_.name_ = "upper_x";
+	attUpperX.rep_.type_ = TeREAL;
+	attUpperX.rep_.decimals_ = 15;
+	attUpperX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attUpperX);}
+
+	{TeAttribute attUpperY;
+	attUpperY.rep_.name_ = "upper_y";
+	attUpperY.rep_.type_ = TeREAL;
+	attUpperY.rep_.decimals_ = 15;
+	attUpperY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attUpperY);}
+
+	{TeAttribute attInitialTime;
+	attInitialTime.rep_.name_ = "initial_time";
+	attInitialTime.rep_.type_ = TeDATETIME;
+	attList.push_back(attInitialTime);}
+
+	{TeAttribute attFinalTime;
+	attFinalTime.rep_.name_ = "final_time";
+	attFinalTime.rep_.type_ = TeDATETIME;
+	attList.push_back(attFinalTime);}
+
+	{TeAttribute attEditionTime;
+	attEditionTime.rep_.name_ = "edition_time";
+	attEditionTime.rep_.type_ = TeDATETIME;
+	attList.push_back(attEditionTime);}
+
+	if(!createTable("te_layer", attList))
+		return false;
+
+	string idxName = "te_idx_layer_proj";
+
+	if(!createIndex("te_layer", idxName, "projection_id"))
+		return false;
+
+	idxName = "te_idx_layer_name";
+
+	return createIndex("te_layer", idxName, "name");
+}
+
+bool TeDatabase::createLayerTableTable()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attTableId;
+	attTableId.rep_.name_ = "table_id";
+	attTableId.rep_.type_ = TeUNSIGNEDINT;
+	attTableId.rep_.isPrimaryKey_ = true;
+	attTableId.rep_.isAutoNumber_ = true;
+	attTableId.rep_.null_ = false;
+	attList.push_back(attTableId);}
+
+	{TeAttribute attLayerId;
+	attLayerId.rep_.name_ = "layer_id";
+	attLayerId.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attLayerId);}
+
+	{TeAttribute attTable;
+	attTable.rep_.name_ = "attr_table";
+	attTable.rep_.type_ = TeSTRING;
+	attTable.rep_.numChar_ = 255;
+	attTable.rep_.null_ = false;
+	attList.push_back(attTable);}
+
+	{TeAttribute attUniqueID;
+	attUniqueID.rep_.name_ = "unique_id";
+	attUniqueID.rep_.type_ = TeSTRING;
+	attUniqueID.rep_.numChar_ = 255;
+	attList.push_back(attUniqueID);}
+
+	{TeAttribute attLink;
+	attLink.rep_.name_ = "attr_link";
+	attLink.rep_.type_ = TeSTRING;
+	attLink.rep_.numChar_ = 255;
+	attList.push_back(attLink);}
+
+	{TeAttribute attAttrInitialTime;
+	attAttrInitialTime.rep_.name_ = "attr_initial_time";
+	attAttrInitialTime.rep_.type_ = TeSTRING;
+	attAttrInitialTime.rep_.numChar_ = 255;
+	attList.push_back(attAttrInitialTime);}
+
+	{TeAttribute attAttrFinalTime;
+	attAttrFinalTime.rep_.name_ = "attr_final_time";
+	attAttrFinalTime.rep_.type_ = TeSTRING;
+	attAttrFinalTime.rep_.numChar_ = 255;
+	attList.push_back(attAttrFinalTime);}
+
+	{TeAttribute attTimeUnit;
+	attTimeUnit.rep_.name_ = "attr_time_unit";
+	attTimeUnit.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attTimeUnit);}
+
+	{TeAttribute attTableType;
+	attTableType.rep_.name_ = "attr_table_type";
+	attTableType.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attTableType);}
+
+	{TeAttribute attUserName;
+	attUserName.rep_.name_ = "user_name";
+	attUserName.rep_.type_ = TeSTRING;
+	attUserName.rep_.numChar_ = 255;
+	attList.push_back(attUserName);}
+
+	{TeAttribute attInitialTime;
+	attInitialTime.rep_.name_ = "initial_time";
+	attInitialTime.rep_.type_ = TeDATETIME;
+	attList.push_back(attInitialTime);}
+
+	{TeAttribute attFinalTime;
+	attFinalTime.rep_.name_ = "final_time";
+	attFinalTime.rep_.type_ = TeDATETIME;
+	attList.push_back(attFinalTime);}
+
+	if(!createTable("te_layer_table", attList))
+		return false;
+
+	string idxName = "te_idx_layertable_layer";
+
+	if(!createIndex("te_layer_table", idxName, "layer_id"))
+		return false;
+
+	idxName = "te_idx_layertable_att";
+
+	return createIndex("te_layer_table", idxName, "attr_table");
+}
+
+bool 
+TeDatabase::updateTableInfo(int layerId, TeTable &table, const string user)
+{
+	if (table.id() <= 0 )  // table information doesn�t exist in database yet
+		return this->insertTableInfo(layerId,table,user);
+	string sql;
+	sql = "UPDATE te_layer_table SET ";
+	sql += "unique_id='" + table.uniqueName() + "', ";
+	sql += "attr_link='" + table.linkName() + "', ";
+	sql += "attr_initial_time='" + table.attInitialTime() + "', ";
+	sql += "attr_final_time='" + table.attFinalTime() + "', ";
+	sql += "attr_time_unit=" + Te2String(table.attTimeUnit()) + ", ";
+	sql += "attr_table_type="+ Te2String(table.tableType()) + ", ";
+	sql += "user_name='" + user + "' WHERE ";
+	sql += "layer_id=" + Te2String(layerId) + " AND ";
+	sql += "attr_table_name='" + table.name() + "'";
+	return execute (sql);
+}
+
+bool 
+TeDatabase::loadTableInfo(TeTable& table)
+{
+	if (table.name().empty())
+		return false;
+
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+	{
+		this->errorMessage_ = "N�o foi poss�vel abrir portal para o banco";
+		return false;
+	}
+	
+	//theme tables
+	string sel = " SELECT table_id, layer_id, attr_table, unique_id, ";
+	sel += " attr_link, attr_initial_time, attr_final_time, attr_time_unit, ";
+	sel += " attr_table_type, user_name, initial_time, final_time ";
+	sel += " FROM te_layer_table ";
+	sel += " WHERE  attr_table = '" + table.name() + "'";
+		
+	if ((!portal->query(sel)) || (!portal->fetchRow()))
+	{	
+		delete portal;
+		return false;
+	}
+	
+	if(!portal->getAttrTable(table))
+	{
+		delete portal;
+		return false;
+	}
+
+	TeAttributeList attrList;
+	getAttributeList(table.name(), attrList);
+	table.setAttributeList(attrList);
+	
+	if (table.tableType() == TeAttrExternal) //information about external table 
+	{
+		portal->freeResult();
+
+		sel = " SELECT te_layer_table.attr_table, te_tables_relation.related_table_id, ";
+		sel += " te_tables_relation.related_attr, te_tables_relation.external_attr  ";
+		sel += " FROM te_layer_table INNER JOIN te_tables_relation";
+		sel += " ON te_layer_table.table_id = te_tables_relation.related_table_id ";
+		sel += " WHERE  te_tables_relation.external_table_name = '" + table.name() + "'";
+
+		if (!portal->query(sel))
+		{	
+			delete portal;
+			return false;
+		}
+
+		if (!portal->fetchRow())
+		{
+			delete portal;
+			return true;
+		}
+		
+		int relatedTableId = portal->getInt(1); //related_table_id
+		string relatedTable = portal->getData(0); //static table name 
+		string relatedAttr = portal->getData(2); // static column name - related_attr
+        		
+		table.setTableType(TeAttrExternal, relatedTableId, relatedAttr);
+		table.relatedTableName(relatedTable);
+		table.setLinkName(portal->getData(3));  //external column name - external_attr
+	}
+	
+	delete portal;
+	return true;
+}
+
+
+bool TeDatabase::createLUTTable(const string& name)
+{
+	if(name.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attIndexId;
+	attIndexId.rep_.name_ = "index_id";
+	attIndexId.rep_.type_ = TeUNSIGNEDINT;
+	attIndexId.rep_.isPrimaryKey_ = true;
+	attIndexId.rep_.null_ = false;
+	attList.push_back(attIndexId);}
+
+	{TeAttribute attRVal;
+	attRVal.rep_.name_ = "r_val";
+	attRVal.rep_.type_ = TeUNSIGNEDINT;
+	attRVal.rep_.null_ = false;
+	attList.push_back(attRVal);}
+
+	{TeAttribute attGVal;
+	attGVal.rep_.name_ = "g_val";
+	attGVal.rep_.type_ = TeUNSIGNEDINT;
+	attGVal.rep_.null_ = false;
+	attList.push_back(attGVal);}
+
+	{TeAttribute attBVal;
+	attBVal.rep_.name_ = "b_val";
+	attBVal.rep_.type_ = TeUNSIGNEDINT;
+	attBVal.rep_.null_ = false;
+	attList.push_back(attBVal);}
+
+	{TeAttribute attName;
+	attName.rep_.name_ = "class_name";
+	attName.rep_.type_ = TeSTRING;
+	attName.rep_.numChar_ = 255;
+	attList.push_back(attName);}
+
+	return createTable(name, attList);
+}
+
+bool TeDatabase::createTablesRelationTable()
+{
+	TeAttributeList attList;
+	
+	{TeAttribute attRelationId;
+	attRelationId.rep_.name_ = "relation_id";
+	attRelationId.rep_.type_ = TeUNSIGNEDINT;
+	attRelationId.rep_.isAutoNumber_ = true;
+	attRelationId.rep_.isPrimaryKey_ = true;
+	attRelationId.rep_.null_ = false;
+	attList.push_back(attRelationId);}
+
+	{TeAttribute attRelatedTableId;
+	attRelatedTableId.rep_.name_ = "related_table_id";
+	attRelatedTableId.rep_.type_ = TeINT;
+	attRelatedTableId.rep_.null_ = false;
+	attList.push_back(attRelatedTableId);}
+
+	{TeAttribute attRelatedAttr;
+	attRelatedAttr.rep_.name_ = "related_attr";
+	attRelatedAttr.rep_.type_ = TeSTRING;
+	attRelatedAttr.rep_.numChar_ = 255;
+	attRelatedAttr.rep_.null_ = false;
+	attList.push_back(attRelatedAttr);}
+
+	{TeAttribute attExternalTableName;
+	attExternalTableName.rep_.name_ = "external_table_name";
+	attExternalTableName.rep_.type_ = TeSTRING;
+	attExternalTableName.rep_.numChar_ = 255;
+	attExternalTableName.rep_.null_ = false;
+	attList.push_back(attExternalTableName);}
+
+	{TeAttribute attExternalAttr;
+	attExternalAttr.rep_.name_ = "external_attr";
+	attExternalAttr.rep_.type_ = TeSTRING;
+	attExternalAttr.rep_.numChar_ = 255;
+	attExternalAttr.rep_.null_ = false;
+	attList.push_back(attExternalAttr);}
+
+	return createTable("te_tables_relation", attList);
+}
+
+bool TeDatabase::createRepresentationTable ()
+{
+	TeAttributeList attList;
+	
+	{TeAttribute attRepresId;
+	attRepresId.rep_.name_ = "repres_id";
+	attRepresId.rep_.type_ = TeUNSIGNEDINT;
+	attRepresId.rep_.isAutoNumber_ = true;
+	attRepresId.rep_.isPrimaryKey_ = true;
+	attRepresId.rep_.null_ = false;
+	attList.push_back(attRepresId);}
+
+	{TeAttribute attLayerId;
+	attLayerId.rep_.name_ = "layer_id";
+	attLayerId.rep_.type_ = TeUNSIGNEDINT;
+	attLayerId.rep_.null_ = false;
+	attList.push_back(attLayerId);}
+
+	{TeAttribute attGeomType;
+	attGeomType.rep_.name_ = "geom_type";
+	attGeomType.rep_.type_ = TeINT;
+	attGeomType.rep_.null_ = false;
+	attList.push_back(attGeomType);}
+
+	{TeAttribute attGeomTable;
+	attGeomTable.rep_.name_ = "geom_table";
+	attGeomTable.rep_.type_ = TeSTRING;
+	attGeomTable.rep_.numChar_ = 255;
+	attGeomTable.rep_.null_ = false;
+	attList.push_back(attGeomTable);}
+
+	{TeAttribute attDescription;
+	attDescription.rep_.name_ = "description";
+	attDescription.rep_.type_ = TeSTRING;
+	attDescription.rep_.numChar_ = 255;
+	attList.push_back(attDescription);}
+
+	{TeAttribute attLowerX;
+	attLowerX.rep_.name_ = "lower_x";
+	attLowerX.rep_.type_ = TeREAL;
+	attLowerX.rep_.decimals_ = 15;
+	attLowerX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attLowerX);}
+
+	{TeAttribute attLowerY;
+	attLowerY.rep_.name_ = "lower_y";
+	attLowerY.rep_.type_ = TeREAL;
+	attLowerY.rep_.decimals_ = 15;
+	attLowerY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attLowerY);}
+
+	{TeAttribute attUpperX;
+	attUpperX.rep_.name_ = "upper_x";
+	attUpperX.rep_.type_ = TeREAL;
+	attUpperX.rep_.decimals_ = 15;
+	attUpperX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attUpperX);}
+
+	{TeAttribute attUpperY;
+	attUpperY.rep_.name_ = "upper_y";
+	attUpperY.rep_.type_ = TeREAL;
+	attUpperY.rep_.decimals_ = 15;
+	attUpperY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attUpperY);}
+
+	{TeAttribute attResX;
+	attResX.rep_.name_ = "res_x";
+	attResX.rep_.type_ = TeREAL;
+	attResX.rep_.decimals_ = 15;
+	attResX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attResX);}
+
+	{TeAttribute attResY;
+	attResY.rep_.name_ = "res_y";
+	attResY.rep_.type_ = TeREAL;
+	attResY.rep_.decimals_ = 15;
+	attResY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attResY);}
+
+	{TeAttribute attNumCols;
+	attNumCols.rep_.name_ = "num_cols";
+	attNumCols.rep_.type_ = TeINT;
+	attList.push_back(attNumCols);}
+
+	{TeAttribute attNumRows;
+	attNumRows.rep_.name_ = "num_rows";
+	attNumRows.rep_.type_ = TeINT;
+	attList.push_back(attNumRows);}
+
+	{TeAttribute attInitialTime;
+	attInitialTime.rep_.name_ = "initial_time";
+	attInitialTime.rep_.type_ = TeDATETIME;
+	attList.push_back(attInitialTime);}
+
+	{TeAttribute attFinalTime;
+	attFinalTime.rep_.name_ = "final_time";
+	attFinalTime.rep_.type_ = TeDATETIME;
+	attList.push_back(attFinalTime);}
+
+	if(!createTable("te_representation", attList))
+		return false;
+
+	string idxName = "te_idx_representation";
+
+	return createIndex("te_representation", idxName, "layer_id");
+}
+
+bool TeDatabase::createRasterMetadataTable(const string& tableName)
+{
+	if(tableName.empty())
+		return false;
+
+	TeAttributeList attList;
+	
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "geom_id";
+	attGeomId.rep_.type_ = TeUNSIGNEDINT;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attBandId;
+	attBandId.rep_.name_ = "band_id";
+	attBandId.rep_.type_ = TeUNSIGNEDINT;
+	attBandId.rep_.isPrimaryKey_ = true;
+	attBandId.rep_.null_ = false;
+	attList.push_back(attBandId);}
+
+	{TeAttribute attMinValue;
+	attMinValue.rep_.name_ = "min_value";
+	attMinValue.rep_.type_ = TeREAL;
+	attMinValue.rep_.decimals_ = 15;
+	attMinValue.rep_.defaultValue_ = "0.0";
+	attList.push_back(attMinValue);}
+
+	{TeAttribute attMaxValue;
+	attMaxValue.rep_.name_ = "max_value";
+	attMaxValue.rep_.type_ = TeREAL;
+	attMaxValue.rep_.decimals_ = 15;
+	attMaxValue.rep_.defaultValue_ = "0.0";
+	attList.push_back(attMaxValue);}
+
+	{TeAttribute attNumBits;
+	attNumBits.rep_.name_ = "num_bits";
+	attNumBits.rep_.type_ = TeINT;
+	attList.push_back(attNumBits);}
+
+	{TeAttribute attDatatype;
+	attDatatype.rep_.name_ = "data_type";
+	attDatatype.rep_.type_ = TeINT;
+	attList.push_back(attDatatype);}
+
+	{TeAttribute attPhotoType;
+	attPhotoType.rep_.name_ = "photometric_type";
+	attPhotoType.rep_.type_ = TeINT;
+	attList.push_back(attPhotoType);}
+
+	{TeAttribute attCompressType;
+	attCompressType.rep_.name_ = "compression_type";
+	attCompressType.rep_.type_ = TeINT;
+	attList.push_back(attCompressType);}
+
+	{TeAttribute attDummy;
+	attDummy.rep_.name_ = "dummy";
+	attDummy.rep_.type_ = TeREAL;
+	attDummy.rep_.decimals_ = 15;
+	attList.push_back(attDummy);}
+
+	{TeAttribute attName;
+	attName.rep_.name_ = "band_name";
+	attName.rep_.type_ = TeSTRING;
+	attName.rep_.numChar_ = 255;
+	attList.push_back(attName);}
+
+	return createTable(tableName, attList);
+}
+
+bool TeDatabase::createRasterTable(const string& tableName)
+{
+	if(tableName.empty())
+		return false;
+
+	TeAttributeList attList;
+	
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "block_id";
+	attGeomId.rep_.type_ = TeSTRING;
+	attGeomId.rep_.numChar_ = 50;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attSpatialData;
+	attSpatialData.rep_.name_ = "spatial_data";
+	attSpatialData.rep_.type_ = TeRASTERTYPE;
+	attList.push_back(attSpatialData);}
+
+	if(!createTable(tableName, attList))
+		return false;
+
+	string idxName = "te_idx_" + tableName + "_b";
+
+	return createIndex(tableName, idxName, "band_id");
+}
+
+bool TeDatabase::createRasterGeometry(const string& tableName)
+{
+	if(tableName.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "geom_id";
+	attGeomId.rep_.type_ = TeUNSIGNEDINT;
+	attGeomId.rep_.isAutoNumber_ = true;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attObjId;
+	attObjId.rep_.name_ = "object_id";
+	attObjId.rep_.type_ = TeSTRING;
+	attObjId.rep_.numChar_ = 255;
+	attObjId.rep_.null_ = false;
+	attList.push_back(attObjId);}
+
+	{TeAttribute attRasterTable;
+	attRasterTable.rep_.name_ = "raster_table";
+	attRasterTable.rep_.type_ = TeSTRING;
+	attRasterTable.rep_.numChar_ = 255;
+	attRasterTable.rep_.null_ = false;
+	attList.push_back(attRasterTable);}
+
+	{TeAttribute attLutTable;
+	attLutTable.rep_.name_ = "lut_table";
+	attLutTable.rep_.type_ = TeSTRING;
+	attLutTable.rep_.numChar_ = 255;
+	attList.push_back(attLutTable);}
+
+	{TeAttribute attResX;
+	attResX.rep_.name_ = "res_x";
+	attResX.rep_.type_ = TeREAL;
+	attResX.rep_.decimals_ = 15;
+	attResX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attResX);}
+
+	{TeAttribute attResY;
+	attResY.rep_.name_ = "res_y";
+	attResY.rep_.type_ = TeREAL;
+	attResY.rep_.decimals_ = 15;
+	attResY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attResY);}
+
+	{TeAttribute attNumBands;
+	attNumBands.rep_.name_ = "num_bands";
+	attNumBands.rep_.type_ = TeINT;
+	attList.push_back(attNumBands);}
+
+	{TeAttribute attNumCols;
+	attNumCols.rep_.name_ = "num_cols";
+	attNumCols.rep_.type_ = TeINT;
+	attList.push_back(attNumCols);}
+
+	{TeAttribute attNumRows;
+	attNumRows.rep_.name_ = "num_rows";
+	attNumRows.rep_.type_ = TeINT;
+	attList.push_back(attNumRows);}
+
+	{TeAttribute attBlockHeight;
+	attBlockHeight.rep_.name_ = "block_height";
+	attBlockHeight.rep_.type_ = TeINT;
+	attList.push_back(attBlockHeight);}
+
+	{TeAttribute attBlockWidth;
+	attBlockWidth.rep_.name_ = "block_width";
+	attBlockWidth.rep_.type_ = TeINT;
+	attList.push_back(attBlockWidth);}
+
+	{TeAttribute attLowerX;
+	attLowerX.rep_.name_ = "lower_x";
+	attLowerX.rep_.type_ = TeREAL;
+	attLowerX.rep_.decimals_ = 15;
+	attLowerX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attLowerX);}
+
+	{TeAttribute attLowerY;
+	attLowerY.rep_.name_ = "lower_y";
+	attLowerY.rep_.type_ = TeREAL;
+	attLowerY.rep_.decimals_ = 15;
+	attLowerY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attLowerY);}
+
+	{TeAttribute attUpperX;
+	attUpperX.rep_.name_ = "upper_x";
+	attUpperX.rep_.type_ = TeREAL;
+	attUpperX.rep_.decimals_ = 15;
+	attUpperX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attUpperX);}
+
+	{TeAttribute attUpperY;
+	attUpperY.rep_.name_ = "upper_y";
+	attUpperY.rep_.type_ = TeREAL;
+	attUpperY.rep_.decimals_ = 15;
+	attUpperY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attUpperY);}
+
+	{TeAttribute attTilingType;
+	attTilingType.rep_.name_ = "tiling_type";
+	attTilingType.rep_.type_ = TeINT;
+	attList.push_back(attTilingType);}
+
+	if(!createTable(tableName, attList))
+		return  false;
+
+	string idxName = "te_idx_" + tableName;
+
+	return createIndex(tableName,  idxName, "object_id");
+}
+
+bool TeDatabase::createViewTable ()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attViewId;
+	attViewId.rep_.name_ = "view_id";
+	attViewId.rep_.type_ = TeUNSIGNEDINT;
+	attViewId.rep_.isPrimaryKey_ = true;
+	attViewId.rep_.isAutoNumber_ = true;
+	attViewId.rep_.null_ = false;
+	attList.push_back(attViewId);}
+
+	{TeAttribute attProjectionId;
+	attProjectionId.rep_.name_ = "projection_id";
+	attProjectionId.rep_.type_ = TeUNSIGNEDINT;
+	attProjectionId.rep_.null_ = false;
+	attList.push_back(attProjectionId);}
+
+	{TeAttribute attName;
+	attName.rep_.name_ = "name";
+	attName.rep_.type_ = TeSTRING;
+	attName.rep_.numChar_ = 255;
+	attName.rep_.null_ = false;
+	attList.push_back(attName);}
+
+	{TeAttribute attUserName;
+	attUserName.rep_.name_ = "user_name";
+	attUserName.rep_.type_ = TeSTRING;
+	attUserName.rep_.numChar_ = 255;
+	attList.push_back(attUserName);}
+
+	{TeAttribute attVisibility;
+	attVisibility.rep_.name_ = "visibility";
+	attVisibility.rep_.type_ = TeINT;
+	attList.push_back(attVisibility);}
+
+	{TeAttribute attLowerX;
+	attLowerX.rep_.name_ = "lower_x";
+	attLowerX.rep_.type_ = TeREAL;
+	attLowerX.rep_.decimals_ = 15;
+	attList.push_back(attLowerX);}
+
+	{TeAttribute attLowerY;
+	attLowerY.rep_.name_ = "lower_y";
+	attLowerY.rep_.type_ = TeREAL;
+	attLowerY.rep_.decimals_ = 15;
+	attList.push_back(attLowerY);}
+
+	{TeAttribute attUpperX;
+	attUpperX.rep_.name_ = "upper_x";
+	attUpperX.rep_.type_ = TeREAL;
+	attUpperX.rep_.decimals_ = 15;
+	attList.push_back(attUpperX);}
+
+	{TeAttribute attUpperY;
+	attUpperY.rep_.name_ = "upper_y";
+	attUpperY.rep_.type_ = TeREAL;
+	attUpperY.rep_.decimals_ = 15;
+	attList.push_back(attUpperY);}
+
+	{TeAttribute attCurrentTheme;
+	attCurrentTheme.rep_.name_ = "current_theme";
+	attCurrentTheme.rep_.type_ = TeINT;
+	attList.push_back(attCurrentTheme);}
+
+	if(!createTable("te_view", attList))
+		return false;
+
+	string idxName = "te_idx_view_projid";
+
+	if(!createIndex("te_view", idxName, "projection_id"))
+		return false;
+
+	idxName = "te_idx_view_name";
+
+	if(!createIndex("te_view", idxName, "name"))
+		return false;
+
+	idxName = "te_idx_view_user_name";
+
+	return createIndex("te_view", idxName, "user_name");
+}
+
+bool TeDatabase::createThemeTable ()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attThemeId;
+	attThemeId.rep_.name_ = "theme_id";
+	attThemeId.rep_.type_ = TeUNSIGNEDINT;
+	attThemeId.rep_.isPrimaryKey_ = true;
+	attThemeId.rep_.isAutoNumber_ = true;
+	attThemeId.rep_.null_ = false;
+	attList.push_back(attThemeId);}
+
+	{TeAttribute attLayerId;
+	attLayerId.rep_.name_ = "layer_id";
+	attLayerId.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attLayerId);}
+
+	{TeAttribute attViewId;
+	attViewId.rep_.name_ = "view_id";
+	attViewId.rep_.type_ = TeUNSIGNEDINT;
+	attViewId.rep_.null_ = false;
+	attList.push_back(attViewId);}
+
+	{TeAttribute attName;
+	attName.rep_.name_ = "name";
+	attName.rep_.type_ = TeSTRING;
+	attName.rep_.numChar_ = 255;
+	attName.rep_.null_ = false;
+	attList.push_back(attName);}
+
+	{TeAttribute attParentId;
+	attParentId.rep_.name_ = "parent_id";
+	attParentId.rep_.type_ = TeUNSIGNEDINT;
+	attParentId.rep_.null_ = false;
+	attList.push_back(attParentId);}
+
+	{TeAttribute attPriority;
+	attPriority.rep_.name_ = "priority";
+	attPriority.rep_.type_ = TeUNSIGNEDINT;
+	attPriority.rep_.null_ = false;
+	attList.push_back(attPriority);}
+
+	{TeAttribute attNodeType;
+	attNodeType.rep_.name_ = "node_type";
+	attNodeType.rep_.type_ = TeUNSIGNEDINT;
+	attNodeType.rep_.null_ = false;
+	attList.push_back(attNodeType);}
+
+	{TeAttribute attMinScale;
+	attMinScale.rep_.name_ = "min_scale";
+	attMinScale.rep_.type_ = TeREAL;
+	attMinScale.rep_.decimals_ = 15;
+	attList.push_back(attMinScale);}
+
+	{TeAttribute attMaxScale;
+	attMaxScale.rep_.name_ = "max_scale";
+	attMaxScale.rep_.type_ = TeREAL;
+	attMaxScale.rep_.decimals_ = 15;
+	attList.push_back(attMaxScale);}
+
+	{TeAttribute attGenAttWhere;
+	attGenAttWhere.rep_.name_ = "generate_attribute_where";
+	attGenAttWhere.rep_.type_ = TeSTRING;
+	attGenAttWhere.rep_.numChar_ = 0;
+	attList.push_back(attGenAttWhere);}
+
+	{TeAttribute attGenSpatWhere;
+	attGenSpatWhere.rep_.name_ = "generate_spatial_where";
+	attGenSpatWhere.rep_.type_ = TeSTRING;
+	attGenSpatWhere.rep_.numChar_ = 0;
+	attList.push_back(attGenSpatWhere);}
+
+	{TeAttribute attGenTempWhere;
+	attGenTempWhere.rep_.name_ = "generate_temporal_where";
+	attGenTempWhere.rep_.type_ = TeSTRING;
+	attGenTempWhere.rep_.numChar_ = 0;
+	attList.push_back(attGenTempWhere);}
+
+	{TeAttribute attCollectionT;
+	attCollectionT.rep_.name_ = "collection_table";
+	attCollectionT.rep_.type_ = TeSTRING;
+	attCollectionT.rep_.numChar_ = 255;
+	attList.push_back(attCollectionT);}
+
+	{TeAttribute attVisiRep;
+	attVisiRep.rep_.name_ = "visible_rep";
+	attVisiRep.rep_.type_ = TeINT;
+	attList.push_back(attVisiRep);}
+
+	{TeAttribute attEnableVis;
+	attEnableVis.rep_.name_ = "enable_visibility";
+	attEnableVis.rep_.type_ = TeINT;
+	attList.push_back(attEnableVis);}
+
+	{TeAttribute attLowerX;
+	attLowerX.rep_.name_ = "lower_x";
+	attLowerX.rep_.type_ = TeREAL;
+	attLowerX.rep_.decimals_ = 15;
+	attLowerX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attLowerX);}
+
+	{TeAttribute attLowerY;
+	attLowerY.rep_.name_ = "lower_y";
+	attLowerY.rep_.type_ = TeREAL;
+	attLowerY.rep_.decimals_ = 15;
+	attLowerY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attLowerY);}
+
+	{TeAttribute attUpperX;
+	attUpperX.rep_.name_ = "upper_x";
+	attUpperX.rep_.type_ = TeREAL;
+	attUpperX.rep_.decimals_ = 15;
+	attUpperX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attUpperX);}
+
+	{TeAttribute attUpperY;
+	attUpperY.rep_.name_ = "upper_y";
+	attUpperY.rep_.type_ = TeREAL;
+	attUpperY.rep_.decimals_ = 15;
+	attUpperY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attUpperY);}
+
+	{TeAttribute attCreationTime;
+	attCreationTime.rep_.name_ = "creation_time";
+	attCreationTime.rep_.type_ = TeDATETIME;
+	attList.push_back(attCreationTime);}
+
+	if(!createTable("te_theme", attList))
+		return false;	
+
+	string idxName = "te_idx_theme_view_id";
+
+	if(!createIndex("te_theme", idxName, "view_id"))
+		return false;
+
+	idxName = "te_idx_theme_name";
+
+	if(!createIndex("te_theme", idxName, "name"))
+		return false;
+
+	idxName = "te_idx_theme_layer_id";
+
+	return createIndex("te_theme", idxName, "layer_id");
+}
+
+bool TeDatabase::createGroupingTable()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attThemeId;
+	attThemeId.rep_.name_ = "theme_id";
+	attThemeId.rep_.type_ = TeUNSIGNEDINT;
+	attThemeId.rep_.isPrimaryKey_ = true;
+	attThemeId.rep_.null_ = false;
+	attList.push_back(attThemeId);}
+
+	{TeAttribute attGNumber;
+	attGNumber.rep_.name_ = "grouping_number";
+	attGNumber.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attGNumber);}
+
+	{TeAttribute attGAttr;
+	attGAttr.rep_.name_ = "grouping_attr";
+	attGAttr.rep_.type_ = TeSTRING;
+	attGAttr.rep_.numChar_ = 255;
+	attList.push_back(attGAttr);}
+
+	{TeAttribute attGAttrType;
+	attGAttrType.rep_.name_ = "grouping_attr_type";
+	attGAttrType.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attGAttrType);}
+
+	{TeAttribute attGMode;
+	attGMode.rep_.name_ = "grouping_mode";
+	attGMode.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attGMode);}
+
+	{TeAttribute attGNormAttr;
+	attGNormAttr.rep_.name_ = "grouping_norm_attr";
+	attGNormAttr.rep_.type_ = TeSTRING;
+	attGNormAttr.rep_.numChar_ = 255;
+	attList.push_back(attGNormAttr);}
+
+	{TeAttribute attGStdDev;
+	attGStdDev.rep_.name_ = "grouping_std_dev";
+	attGStdDev.rep_.type_ = TeREAL;
+	attGStdDev.rep_.decimals_ = 15;
+	attGStdDev.rep_.defaultValue_ = "0.0";
+	attList.push_back(attGStdDev);}
+
+	{TeAttribute attGPrec;
+	attGPrec.rep_.name_ = "grouping_precision";
+	attGPrec.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attGPrec);}
+
+	{TeAttribute attGFunc;
+	attGFunc.rep_.name_ = "grouping_function";
+	attGFunc.rep_.type_ = TeSTRING;
+	attGFunc.rep_.numChar_ = 20;
+	attList.push_back(attGFunc);}
+
+	{TeAttribute attGChronon;
+	attGChronon.rep_.name_ = "grouping_chronon";
+	attGChronon.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attGChronon);}
+
+	return createTable("te_grouping", attList);
+}
+
+bool TeDatabase::createThemeTablesTable()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attThemeTableId;
+	attThemeTableId.rep_.name_ = "theme_table_id";
+	attThemeTableId.rep_.type_ = TeUNSIGNEDINT;
+	attThemeTableId.rep_.isPrimaryKey_ = true;
+	attThemeTableId.rep_.isAutoNumber_ = true;
+	attThemeTableId.rep_.null_ = false;
+	attList.push_back(attThemeTableId);}
+
+	{TeAttribute attThemeId;
+	attThemeId.rep_.name_ = "theme_id";
+	attThemeId.rep_.type_ = TeUNSIGNEDINT;
+	attThemeId.rep_.null_ = false;
+	attList.push_back(attThemeId);}
+
+	{TeAttribute attTableId;
+	attTableId.rep_.name_ = "table_id";
+	attTableId.rep_.type_ = TeUNSIGNEDINT;
+	attTableId.rep_.null_ = false;
+	attList.push_back(attTableId);}
+
+	{TeAttribute attRelationId;
+	attRelationId.rep_.name_ = "relation_id";
+	attRelationId.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attRelationId);}
+
+	{TeAttribute attTableOrderId;
+	attTableOrderId.rep_.name_ = "table_order";
+	attTableOrderId.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attTableOrderId);}
+
+	if(!createTable("te_theme_table", attList))
+		return false;
+
+	string idxName = "te_idx_theme_table_id";
+
+	if(!createIndex("te_theme_table", idxName, "table_id"))
+		return false;
+
+	idxName = "te_idx_theme_relat_id";
+
+	if(!createIndex("te_theme_table", idxName, "relation_id"))
+		return false;
+
+	idxName = "te_idx_themetable_theme";
+
+	return createIndex("te_theme_table", idxName, "theme_id");
+}
+
+bool TeDatabase::createLegendTable ()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attLegendId;
+	attLegendId.rep_.name_ = "legend_id";
+	attLegendId.rep_.type_ = TeUNSIGNEDINT;
+	attLegendId.rep_.isPrimaryKey_ = true;
+	attLegendId.rep_.isAutoNumber_ = true;
+	attLegendId.rep_.null_ = false;
+	attList.push_back(attLegendId);	}
+
+	{TeAttribute attThemeId;
+	attThemeId.rep_.name_ = "theme_id";
+	attThemeId.rep_.type_ = TeUNSIGNEDINT;
+	attThemeId.rep_.null_ = false;
+	attList.push_back(attThemeId);}
+
+	{TeAttribute attGId;
+	attGId.rep_.name_ = "group_id";
+	attGId.rep_.type_ = TeINT;
+	attList.push_back(attGId);}
+
+	{TeAttribute attNObjs;
+	attNObjs.rep_.name_ = "num_objs";
+	attNObjs.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attNObjs);}
+
+	{TeAttribute attLValue;
+	attLValue.rep_.name_ = "lower_value";
+	attLValue.rep_.type_ = TeSTRING;
+	attLValue.rep_.numChar_ = 255;
+	attList.push_back(attLValue);}
+
+	{TeAttribute attUValue;
+	attUValue.rep_.name_ = "upper_value";
+	attUValue.rep_.type_ = TeSTRING;
+	attUValue.rep_.numChar_ = 255;
+	attList.push_back(attUValue);}
+
+	{TeAttribute attLabel;
+	attLabel.rep_.name_ = "label";
+	attLabel.rep_.type_ = TeSTRING;
+	attLabel.rep_.numChar_ = 255;
+	attList.push_back(attLabel);}
+	
+	if(!createTable("te_legend", attList))
+		return false;
+
+	string idxName = "te_idx_legend_theme";
+
+	return createIndex("te_legend", idxName, "theme_id");
+}
+
+bool TeDatabase::createVisualTable()
+{
+	TeAttributeList attList;
+
+	{TeAttribute attLegendId;
+	attLegendId.rep_.name_ = "legend_id";
+	attLegendId.rep_.type_ = TeUNSIGNEDINT;
+	attLegendId.rep_.isPrimaryKey_ = true;
+	attLegendId.rep_.null_ = false;
+	attList.push_back(attLegendId);}
+
+	{TeAttribute attGeomType;
+	attGeomType.rep_.name_ = "geom_type";
+	attGeomType.rep_.type_ = TeUNSIGNEDINT;
+	attGeomType.rep_.isPrimaryKey_ = true;
+	attGeomType.rep_.null_ = false;
+	attList.push_back(attGeomType);}
+
+	{TeAttribute attSymbId;
+	attSymbId.rep_.name_ = "symb_id";
+	attSymbId.rep_.type_ = TeINT;
+	attList.push_back(attSymbId);}
+
+	{TeAttribute attRed;
+	attRed.rep_.name_ = "red";
+	attRed.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attRed);}
+
+	{TeAttribute attGreen;
+	attGreen.rep_.name_ = "green";
+	attGreen.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attGreen);}
+
+	{TeAttribute attBlue;
+	attBlue.rep_.name_ = "blue";
+	attBlue.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attBlue);}
+
+	{TeAttribute attTransp;
+	attTransp.rep_.name_ = "transparency";
+	attTransp.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attTransp);}
+
+	{TeAttribute attWidth;
+	attWidth.rep_.name_ = "width";
+	attWidth.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attWidth);}
+
+	{TeAttribute attContourSymbId;
+	attContourSymbId.rep_.name_ = "contour_symb_id";
+	attContourSymbId.rep_.type_ = TeINT;
+	attList.push_back(attContourSymbId);}
+
+	{TeAttribute attContourRed;
+	attContourRed.rep_.name_ = "contour_red";
+	attContourRed.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attContourRed);}
+
+	{TeAttribute attContourGreen;
+	attContourGreen.rep_.name_ = "contour_green";
+	attContourGreen.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attContourGreen);}
+
+	{TeAttribute attContourBlue;
+	attContourBlue.rep_.name_ = "contour_blue";
+	attContourBlue.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attContourBlue);}
+
+	{TeAttribute attContourTransp;
+	attContourTransp.rep_.name_ = "contour_transp";
+	attContourTransp.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attContourTransp);}
+
+	{TeAttribute attContourWidth;
+	attContourWidth.rep_.name_ = "contour_width";
+	attContourWidth.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attContourWidth);}
+
+	{TeAttribute attSizeValue;
+	attSizeValue.rep_.name_ = "size_value";
+	attSizeValue.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attSizeValue);}
+
+	{TeAttribute attPtAngle;
+	attPtAngle.rep_.name_ = "pt_angle";
+	attPtAngle.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attPtAngle);}
+
+	{TeAttribute attFamily;
+	attFamily.rep_.name_ = "family";
+	attFamily.rep_.type_ = TeSTRING;
+	attFamily.rep_.numChar_ = 255;
+	attList.push_back(attFamily);}
+
+	{TeAttribute attBold;
+	attBold.rep_.name_ = "bold";
+	attBold.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attBold);}
+
+	{TeAttribute attItalic;
+	attItalic.rep_.name_ = "italic";
+	attItalic.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attItalic);}
+
+	{TeAttribute attAlignVert;
+	attAlignVert.rep_.name_ = "alignment_vert";
+	attAlignVert.rep_.type_ = TeREAL;
+	attAlignVert.rep_.decimals_ = 15;
+	attList.push_back(attAlignVert);}
+
+	{TeAttribute attAlignHoriz;
+	attAlignHoriz.rep_.name_ = "alignment_horiz";
+	attAlignHoriz.rep_.type_ = TeREAL;
+	attAlignHoriz.rep_.decimals_ = 15;
+	attList.push_back(attAlignHoriz);}
+
+	{TeAttribute attTabSize;
+	attTabSize.rep_.name_ = "tab_size";
+	attTabSize.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attTabSize);}
+
+	{TeAttribute attLineSpace;
+	attLineSpace.rep_.name_ = "line_space";
+	attLineSpace.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attLineSpace);}
+
+	{TeAttribute attFixedSize;
+	attFixedSize.rep_.name_ = "fixed_size";
+	attFixedSize.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attFixedSize);}
+
+	return createTable("te_visual", attList);
+}
+
+
+bool TeDatabase::createVisualRasterTable()
+{	
+	TeAttributeList attList;
+
+	{TeAttribute attThemeId;
+	attThemeId.rep_.name_ = "theme_id";
+	attThemeId.rep_.type_ = TeUNSIGNEDINT;
+	attThemeId.rep_.isPrimaryKey_ = true;
+	attThemeId.rep_.null_ = false;
+	attList.push_back(attThemeId);}
+
+	{TeAttribute attBandIn;
+	attBandIn.rep_.name_ = "band_in";
+	attBandIn.rep_.type_ = TeUNSIGNEDINT;
+	attBandIn.rep_.isPrimaryKey_ = true;
+	attBandIn.rep_.null_ = false;
+	attList.push_back(attBandIn);}
+
+	{TeAttribute attBandOut;
+	attBandOut.rep_.name_ = "band_out";
+	attBandOut.rep_.type_ = TeUNSIGNEDINT;
+	attList.push_back(attBandOut);}
+
+	{TeAttribute attTransfType;
+	attTransfType.rep_.name_ = "transf_type";
+	attTransfType.rep_.type_ = TeINT;
+	attList.push_back(attTransfType);}
+
+	{TeAttribute attParam1;
+	attParam1.rep_.name_ = "param1";
+	attParam1.rep_.type_ = TeREAL;
+	attParam1.rep_.decimals_ = 15;
+	attList.push_back(attParam1);}
+
+	{TeAttribute attParam2;
+	attParam2.rep_.name_ = "param2";
+	attParam2.rep_.type_ = TeREAL;
+	attParam2.rep_.decimals_ = 15;
+	attList.push_back(attParam2);}
+
+	{TeAttribute attLutTable;
+	attLutTable.rep_.name_ = "lut_table";
+	attLutTable.rep_.type_ = TeSTRING;
+	attLutTable.rep_.numChar_ = 255;
+	attList.push_back(attLutTable);}
+
+	return createTable("te_visual_raster", attList);
+}
+
+bool TeDatabase::insertVisual (TeLegendEntry *legend)
+{
+	TeGeomRepVisualMap::iterator it;
+
+	for ( it = legend->getVisualMap().begin(); it != legend->getVisualMap().end(); ++it)
+	{ 
+		string style("0"), contourStyle("0"), sizeValue("0"), width("0");
+
+		if(it->first == TePOLYGONS || it->first == TeCELLS)
+		{
+			contourStyle = Te2String(it->second->contourStyle());
+			style = Te2String(it->second->style());
+		}
+		else if(it->first == TeLINES)
+		{
+			width = Te2String(it->second->width());
+			style = Te2String(it->second->style());
+		}
+		else if(it->first == TePOINTS)
+		{
+			sizeValue = Te2String(it->second->size());
+			style = Te2String(it->second->style());
+		}
+		else if(it->first == TeTEXT)
+		{
+			sizeValue = Te2String(it->second->size());
+		}
+		
+		string insert = "INSERT INTO te_visual(legend_id, geom_type, ";
+		insert += " symb_id, "; 
+		insert += "red, green, blue, transparency, width, ";
+		insert += " contour_symb_id, "; 
+		insert += "contour_red, contour_green,";
+		insert += "contour_blue, contour_transp, contour_width, size_value,";
+		insert += "pt_angle, family, bold, italic, ";
+		insert += "alignment_vert, alignment_horiz, tab_size, line_space, fixed_size) ";
+		insert += " VALUES (";	
+		insert += Te2String(legend->id()) + ", ";
+		insert += Te2String(it->first)+ ", ";
+		insert += style + ", ";
+		insert += Te2String(it->second->color().red_) + ", ";
+		insert += Te2String(it->second->color().green_) + ", ";
+		insert += Te2String(it->second->color().blue_) + ", ";
+		insert += Te2String(it->second->transparency()) + ", ";
+		insert += width +",";
+		insert += contourStyle + ", ";
+		insert += Te2String(it->second->contourColor().red_) + ", ";
+		insert += Te2String(it->second->contourColor().green_) + ", ";
+		insert += Te2String(it->second->contourColor().blue_) + ", ";
+		insert += Te2String(it->second->contourTransparency()) + ", ";	
+		insert += Te2String(it->second->contourWidth()) + ", ";
+
+		insert += sizeValue +",";
+		insert += Te2String(it->second->ptAngle()) +", ";
+
+		insert += "'" + it->second->family() + "', ";
+		if (it->second->bold())
+			insert += "1, ";
+		else
+			insert += "0, ";
+		if (it->second->italic())
+			insert += "1, ";
+		else
+			insert += "0, ";
+		insert += Te2String(it->second->alignmentVert()) + ",";
+		insert += Te2String(it->second->alignmentHoriz()) + ",";
+		insert += Te2String(it->second->tabSize()) + ",";
+		insert += Te2String(it->second->lineSpace()) +",";
+		if (it->second->fixedSize())
+			insert += "1 ";
+		else
+			insert += "0";			
+		insert += ")";	
+
+		if (!execute(insert))
+			return false;
+	}
+	return true;
+}
+
+bool TeDatabase::createCollectionTable(const string& tableName)
+{
+	if(tableName.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attCObjId;
+	attCObjId.rep_.name_ = "c_object_id";
+	attCObjId.rep_.type_ = TeSTRING;
+	attCObjId.rep_.numChar_ = 255;
+	attCObjId.rep_.isPrimaryKey_ = true;
+	attCObjId.rep_.null_ = false;
+	attList.push_back(attCObjId);}
+
+	{TeAttribute attCLegendId;
+	attCLegendId.rep_.name_ = "c_legend_id";
+	attCLegendId.rep_.type_ = TeINT;
+	attList.push_back(attCLegendId);}
+
+	{TeAttribute attLabelX;
+	attLabelX.rep_.name_ = "label_x";
+	attLabelX.rep_.type_ = TeREAL;
+	attLabelX.rep_.decimals_ = 15;
+	attList.push_back(attLabelX);}
+
+	{TeAttribute attLabelY;
+	attLabelY.rep_.name_ = "label_y";
+	attLabelY.rep_.type_ = TeREAL;
+	attLabelY.rep_.decimals_ = 15;
+	attList.push_back(attLabelY);}
+
+	{TeAttribute attCLegendOwn;
+	attCLegendOwn.rep_.name_ = "c_legend_own";
+	attCLegendOwn.rep_.type_ = TeINT;
+	attList.push_back(attCLegendOwn);}
+
+	{TeAttribute attCObjStatus;
+	attCObjStatus.rep_.name_ = "c_object_status";
+	attCObjStatus.rep_.type_ = TeINT;
+	attList.push_back(attCObjStatus);}
+
+	if(!createTable(tableName, attList))
+		return false;
+
+	string collectionId;
+	unsigned int pos = tableName.rfind("_");
+	if ( (pos != std::string::npos ) && (pos+1<tableName.size()) )
+       collectionId = tableName.substr(pos+1); 
+
+	string idxName = "te_idx_c" + collectionId  + "_clegid";
+
+	if(!createIndex(tableName, idxName, "c_legend_id"))
+		return false;
+
+	idxName = "te_idx_c" + collectionId + "_clegown";
+
+	return createIndex(tableName, idxName, "c_legend_own");
+}
+
+bool TeDatabase::createCellGeometry (const string& table)
+{
+	if(table.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "geom_id";
+	attGeomId.rep_.type_ = TeUNSIGNEDINT;
+	attGeomId.rep_.isAutoNumber_ = true;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attObjId;
+	attObjId.rep_.name_ = "object_id";
+	attObjId.rep_.type_ = TeSTRING;
+	attObjId.rep_.numChar_ = 255;
+	attObjId.rep_.null_ = false;
+	attList.push_back(attObjId);}
+
+	{TeAttribute attSpatial;
+	attSpatial.rep_.name_ = "spatial_data";
+	attSpatial.rep_.type_ = TeCELLTYPE;
+	attList.push_back(attSpatial);}
+
+	if(!createTable(table, attList))
+		return false;
+
+	string idxName = "te_idx_"  + table + "obj";
+
+	if(!createIndex(table, idxName, "object_id"))
+		return false;
+
+	idxName = "te_idx_" + table + "_lc";
+
+	return createIndex(table, idxName, "row_number, col_number");
+}
+
+bool TeDatabase::createTextGeometry(const string& table)
+{
+	if(table.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "geom_id";
+	attGeomId.rep_.type_ = TeUNSIGNEDINT;
+	attGeomId.rep_.isAutoNumber_ = true;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attObjId;
+	attObjId.rep_.name_ = "object_id";
+	attObjId.rep_.type_ = TeSTRING;
+	attObjId.rep_.numChar_ = 255;
+	attObjId.rep_.null_ = false;
+	attList.push_back(attObjId);}
+
+	{TeAttribute attX;
+	attX.rep_.name_ = "x";
+	attX.rep_.type_ = TeREAL;
+	attX.rep_.decimals_ = 15;
+	attX.rep_.defaultValue_ = "0.0";
+	attList.push_back(attX);}
+
+	{TeAttribute attY;
+	attY.rep_.name_ = "y";
+	attY.rep_.type_ = TeREAL;
+	attY.rep_.decimals_ = 15;
+	attY.rep_.defaultValue_ = "0.0";
+	attList.push_back(attY);}
+
+	{TeAttribute attTextValue;
+	attTextValue.rep_.name_ = "text_value";
+	attTextValue.rep_.type_ = TeSTRING;
+	attTextValue.rep_.numChar_ = 255;
+	attList.push_back(attTextValue);}
+
+	{TeAttribute attAngle;
+	attAngle.rep_.name_ = "angle";
+	attAngle.rep_.type_ = TeREAL;
+	attAngle.rep_.decimals_ = 15;
+	attAngle.rep_.defaultValue_ = "0.0";
+	attList.push_back(attAngle);}
+
+	{TeAttribute attHeight;
+	attHeight.rep_.name_ = "height";
+	attHeight.rep_.type_ = TeREAL;
+	attHeight.rep_.decimals_ = 15;
+	attHeight.rep_.defaultValue_ = "0.0";
+	attList.push_back(attHeight);}
+
+	{TeAttribute attAlignVert;
+	attAlignVert.rep_.name_ = "alignment_vert";
+	attAlignVert.rep_.type_ = TeREAL;
+	attAlignVert.rep_.decimals_ = 15;
+	attList.push_back(attAlignVert);}
+
+	{TeAttribute attAlignHoriz;
+	attAlignHoriz.rep_.name_ = "alignment_horiz";
+	attAlignHoriz.rep_.type_ = TeREAL;
+	attAlignHoriz.rep_.decimals_ = 15;
+	attList.push_back(attAlignHoriz);}
+
+	if(!createTable(table, attList))
+		return false;
+
+	string idxName = "te_idx_"  + table + "_obj";
+
+	if(!createIndex(table, idxName, "object_id"))
+		return false;
+
+	idxName = "te_idx_"  + table + "_pos";
+
+	return createIndex(table, idxName, "x, y");
+}
+
+bool TeDatabase::createNodeGeometry(const string& table)
+{
+	if(table.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "geom_id";
+	attGeomId.rep_.type_ = TeUNSIGNEDINT;
+	attGeomId.rep_.isAutoNumber_ = true;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attObjId;
+	attObjId.rep_.name_ = "object_id";
+	attObjId.rep_.type_ = TeSTRING;
+	attObjId.rep_.numChar_ = 255;
+	attObjId.rep_.null_ = false;
+	attList.push_back(attObjId);}
+
+	{TeAttribute attSpatial;
+	attSpatial.rep_.name_ = "spatial_data";
+	attSpatial.rep_.type_ = TeNODETYPE;
+	attList.push_back(attSpatial);}
+
+	if(!createTable(table, attList))
+		return false;
+
+	string idxName = "te_idx_"  + table + "_obj";
+
+	return createIndex(table, idxName, "object_id");
+}
+
+bool TeDatabase::createPointGeometry(const string& table)
+{
+	if(table.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "geom_id";
+	attGeomId.rep_.type_ = TeUNSIGNEDINT;
+	attGeomId.rep_.isAutoNumber_ = true;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attObjId;
+	attObjId.rep_.name_ = "object_id";
+	attObjId.rep_.type_ = TeSTRING;
+	attObjId.rep_.numChar_ = 255;
+	attObjId.rep_.null_ = false;
+	attList.push_back(attObjId);}
+
+	{TeAttribute attSpatial;
+	attSpatial.rep_.name_ = "spatial_data";
+	attSpatial.rep_.type_ = TePOINTTYPE;
+	attList.push_back(attSpatial);}
+
+	if(!createTable(table, attList))
+		return false;
+
+	string idxName = "te_idx_"  + table + "_obj";
+
+	return createIndex(table, idxName, "object_id");
+}
+
+bool TeDatabase::createArcGeometry(const string& table)
+{
+	if(table.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "geom_id";
+	attGeomId.rep_.type_ = TeUNSIGNEDINT;
+	attGeomId.rep_.isAutoNumber_ = true;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attObjId;
+	attObjId.rep_.name_ = "object_id";
+	attObjId.rep_.type_ = TeSTRING;
+	attObjId.rep_.numChar_ = 255;
+	attObjId.rep_.null_ = false;
+	attList.push_back(attObjId);}
+
+	{TeAttribute attFromNode;
+	attFromNode.rep_.name_ = "from_node";
+	attFromNode.rep_.type_ = TeINT;
+	attFromNode.rep_.null_ = false;
+	attList.push_back(attFromNode);}
+
+	{TeAttribute attToNode;
+	attToNode.rep_.name_ = "to_node";
+	attToNode.rep_.type_ = TeINT;
+	attToNode.rep_.null_ = false;
+	attList.push_back(attToNode);}
+
+	if(!createTable(table, attList))
+		return false;
+
+	string idxName = "te_idx_"  + table + "_obj";
+
+	if(!createIndex(table, idxName, "object_id"))
+		return false;
+
+	idxName = "te_idx_"  + table + "_from";
+
+	if(!createIndex(table, idxName, "from_node"))
+		return false;
+
+	idxName = "te_idx_"  + table + "_to";
+
+	return createIndex(table, idxName, "to_node");
+}
+
+
+bool
+TeDatabase::insertTable	(TeTable &table)
+{
+	string tableName = table.name();
+	int size = table.size();
+	TeAttributeList att = table.attributeList();
+	TeAttributeList::iterator it = att.begin();
+	TeAttributeList::iterator itEnd = att.end();
+	TeTableRow row;
+	
+	int blobIndex=-1;
+	if (!beginTransaction())
+		return false;
+
+	int i;
+	unsigned int j;
+	for ( i = 0; i < size; i++ )	
+	{
+		row = table[i];
+		it = att.begin();
+		string attrs;
+		string values;
+		j = 1;
+		int jj = 0;
+		while ( it != itEnd )
+		{
+			if (row[jj].empty() || (*it).rep_.isAutoNumber_)
+			{
+				++it;
+				j++;
+				jj++;
+				continue;
+			}
+			
+			if (!values.empty())
+			{
+				attrs += ", ";
+				values += ", ";
+			}			
+			attrs += (*it).rep_.name_;			
+			switch ((*it).rep_.type_)
+			{
+			case TeSTRING:
+				values += "'"+ escapeSequence( row[jj] ) +"'";
+				break;
+			case TeREAL:
+				{
+				std::string strValue = row[jj];
+				replace(strValue.begin(), strValue.end(), ',', '.');
+				values += strValue;
+				}
+				break;
+			case TeINT:
+				values += row[jj];
+				break;
+			case TeDATETIME:
+				{
+					const string temp_dt = string(row[jj].c_str());
+					TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
+					values += this->getSQLTime(t);
+				}
+				break;
+			case TeCHARACTER:
+				values += "'" + escapeSequence(row[jj]) + "'";
+				break;
+			case TeBLOB:
+				blobIndex = jj;
+			default:
+				values += "'"+ escapeSequence(row[jj]) +"'";
+				break;
+			}
+			++it;
+			j++;
+			jj++;
+		}
+
+		if (values.empty()) 
+			continue;
+
+		string q = "INSERT INTO "+tableName + " ("+ attrs+") " + " VALUES ("+values+") ";
+		if (!execute(q)) 
+			continue;
+
+		//If there were blob type 
+		if(blobIndex>=0)
+		{
+			TeAttribute uniqueAttr;
+			table.attrUnique(uniqueAttr);
+			string uniqueValue;
+			int indexUniquePos = table.attrUniquePosition();
+			if(uniqueAttr.rep_.isAutoNumber_)
+			{
+				//we have to get the last autonumber inserted
+				string sql = " SELECT MAX("+ uniqueAttr.rep_.name_ +") FROM ";
+				sql += tableName;
+				TeDatabasePortal* portal = getPortal();
+				if(!portal)
+				{
+					rollbackTransaction();
+					return false;
+				}
+				if(!portal->query(sql) || !portal->fetchRow())
+				{
+					delete portal;
+					rollbackTransaction();
+					return false;
+				}
+				uniqueValue = portal->getData(0);
+				delete portal;
+			}
+			else
+				//we can use the unique value
+				uniqueValue = row[indexUniquePos];
+			
+			if(!insertBlob(tableName, att[blobIndex].rep_.name_, uniqueAttr.rep_, uniqueValue, 
+				(unsigned char*) row[blobIndex].c_str(), row[blobIndex].size()))
+			{
+				rollbackTransaction();
+				return false;
+			} 
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName)
+{
+	if(!tableExist(tableName))
+		return false;
+
+	string tab;
+
+	if(oldColName.empty())
+	{
+		tab = " ALTER TABLE " + tableName + " MODIFY ";
+		tab += rep.name_ +"  ";
+	}
+	else
+	{
+		tab = " ALTER TABLE " + tableName + " CHANGE ";
+		tab += oldColName +" "+ rep.name_ +"  ";
+	}
+
+	switch (rep.type_)
+	{
+		case TeSTRING:
+			tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+			
+		case TeREAL:
+			tab += "DOUBLE(24, 15)";	
+			break;
+			
+		case TeINT:
+			tab += "INT";
+			break;
+
+		case TeDATETIME:
+			tab += "DATETIME";
+			break;
+
+		case TeCHARACTER:
+			tab += "CHAR";
+			break;
+
+		case TeBLOB:
+			tab += "LONGBLOB";
+			break; 
+		
+		default:
+			tab += "VARCHAR(" + Te2String(rep.numChar_) + ") ";
+			break;
+	}
+
+	tab += " NULL ";
+
+	if(!execute(tab))
+	{
+		if(errorMessage_.empty())
+			errorMessage_ = "Error alter table " + tableName + " !";
+		return false;
+	}
+
+	string tableId;
+	TeDatabasePortal* portal = getPortal();
+	string sql = "SELECT table_id FROM te_layer_table WHERE attr_table = '" + tableName + "'";
+	if(portal->query(sql) && portal->fetchRow())
+		tableId = portal->getData(0);
+
+	delete portal;
+
+	if(tableId.empty() == false)
+	{
+		if(oldColName.empty() == false) // column name changed
+		{
+			 // update relation
+			sql = "UPDATE te_tables_relation SET related_attr = '" + rep.name_ + "'";
+			sql += " WHERE related_table_id = " + tableId;
+			sql += " AND related_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			sql = "UPDATE te_tables_relation SET external_attr = '" + rep.name_ + "'";
+			sql += " WHERE external_table_name = '" + tableName + "'";
+			sql += " AND external_attr = '" + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+
+			 // update grouping
+			sql = "UPDATE te_grouping SET grouping_attr = '" + tableName + "." + rep.name_ + "'";
+			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+		else // column type changed
+		{
+			// delete relation
+			sql = "DELETE FROM te_tables_relation WHERE (related_table_id = " + tableId;
+			sql += " AND related_attr = '" + rep.name_ + "')";
+			sql += " OR (external_table_name = '" + tableName + "'";
+			sql += " AND external_attr = '" + rep.name_ + "')";
+			if(execute(sql) == false)
+				return false;
+
+			// delete grouping
+			TeDatabasePortal* portal = getPortal();
+			sql = "SELECT theme_id FROM te_grouping WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(portal->query(sql) && portal->fetchRow())
+			{
+				string themeId = portal->getData(0);
+
+				sql = "DELETE FROM te_legend WHERE theme_id = " + themeId + " AND group_id >= 0";
+				if(execute(sql) == false)
+				{
+					delete portal;
+					return false;
+				}
+			}
+			delete portal;
+
+			sql = "DELETE FROM te_grouping";
+			sql += " WHERE grouping_attr = '" + tableName + "." + oldColName + "'";
+			if(execute(sql) == false)
+				return false;
+		}
+	}
+
+	alterTableInfoInMemory(tableName);
+	return true;
+}
+
+bool 
+TeDatabase::alterTable(const string& oldTableName, const string& newTablename)
+{
+	string sql = " ALTER TABLE "+ oldTableName +" RENAME "+ newTablename;
+	if(!execute(sql))
+		return false;
+
+	//update te_layer_table
+	sql = " UPDATE te_layer_table ";
+	sql += " SET attr_table = '"+ newTablename +"'";
+	sql += " WHERE attr_table = '"+ oldTableName +"'";
+	execute(sql);
+
+	//update te_tables_relation
+	sql = " UPDATE te_tables_relation ";
+	sql += " SET external_table_name = '"+ newTablename +"'";
+	sql += " WHERE external_table_name = '"+ oldTableName +"'";
+	execute(sql);
+	
+	alterTableInfoInMemory(newTablename, oldTableName);
+	return true;
+}
+
+bool 
+TeDatabase::insertBlob (const string& tableName, const string& columnBlob, TeAttributeRep& columnId, const string& valueId, unsigned char* data, int size)
+{
+	string whereClause = columnId.name_ +" = ";
+	switch (columnId.type_ )
+	{
+		case TeSTRING:
+			whereClause += "'"+ valueId + "'";
+			break;
+		default:
+			whereClause += valueId;
+			break;
+	}
+	return (insertBlob (tableName, columnBlob, whereClause, data, size));
+}
+
+bool 
+TeDatabase::insertBlob (const string& tableName, const string& columnBlob, TeAttributeRep& columnId, const string& valueId, const string& fileName)
+{
+	string whereClause = columnId.name_ +" = ";
+	switch (columnId.type_ )
+	{
+		case TeSTRING:
+			whereClause += "'"+ valueId + "'";
+			break;
+		default:
+			whereClause += valueId;
+			break;
+	}
+	return (insertBlob(tableName, columnBlob, whereClause, fileName));
+}
+
+bool 
+TeDatabase::insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, const string& fileName)
+{
+	unsigned char	*cdata = 0;
+	int		size;
+	FILE	*fp = 0;
+	
+	struct	stat buf;
+	int		result;
+	
+	result = stat(fileName.c_str(), &buf);
+	
+	if( result != 0 )
+		return false;
+	
+	size = buf.st_size;
+
+	cdata = new unsigned char[size];
+	fp = fopen(fileName.c_str(), "rb");
+	fread(cdata, sizeof(unsigned char), size, fp); 
+
+	bool status = insertBlob (tableName, columnBlob, whereClause, cdata, size);
+
+	if(fp)
+		fclose(fp);
+
+	if (cdata)
+		delete []cdata;
+
+	return status;
+}
+
+bool 
+TeDatabase::getAttrTables(TeAttrTableVector& atts, TeAttrTableType attType)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+	{
+		this->errorMessage_ = "N�o foi poss�vel abrir portal para o banco";
+		return false;
+	}
+	
+	// Get layer tables	
+	string get =  " SELECT * FROM te_layer_table"; 
+	if (attType != TeAllAttrTypes)
+		get += " WHERE attr_table_type = " + Te2String(attType);
+	if (!portal->query(get))
+	{	
+		delete portal;
+		return false;
+	}
+
+	while (portal->fetchRow())
+	{
+		TeTable attTable;
+		if(!portal->getAttrTable(attTable))
+		{
+			delete portal;
+			return false;
+		}
+		
+		TeAttributeList attrList;
+		getAttributeList(attTable.name(), attrList);
+
+		attTable.setAttributeList(attrList);
+
+		atts.push_back(attTable);
+	}
+	delete portal;
+	return (atts.size() > 0);
+}
+
+bool
+TeDatabase::updateTable	(TeTable &table)
+{
+	TeAttributeList& att = table.attributeList();
+	unsigned int i;
+	string uniqueVal;
+	bool isUniqueValString = false;
+	
+	if (!beginTransaction())
+		return false;
+
+	string uniqueName = table.uniqueName(); // primary key explicitly defined or 
+	if (table.uniqueName().empty())			// check in the attribute list
+	{								
+		for (i=0; i<att.size(); ++i)
+			if (att[i].rep_.isPrimaryKey_)
+			{
+				uniqueName = att[i].rep_.name_;
+				table.setUniqueName(uniqueName);
+				break;
+			}
+	}
+
+	int blobIndex = -1;
+	TeAttributeList::iterator it;
+	TeTableRow row;
+	unsigned int j;
+	bool useComma = false;
+	for (i = 0; i < table.size(); i++  )
+	{
+		row = table[i];
+		it = att.begin();
+		string q;
+		j = 1;
+		int jj = 0;
+    useComma = false;  
+		while ( it != att.end() )
+		{
+			if (uniqueName != (*it).rep_.name_)
+			{
+				if ((*it).rep_.isAutoNumber_)
+				{
+					++it;
+					j++;
+					jj++;
+					continue;
+				}			
+
+				if ((*it).rep_.type_ != TeBLOB)
+				{
+					if(useComma == true)
+					{
+						q += ", ";
+					}
+					else
+					{
+						useComma = true;
+					}
+					
+					q += (*it).rep_.name_ + " = ";
+	  				
+					if(row[jj].empty())
+					{
+						q += " null";
+
+						++it;
+						j++;
+						jj++;
+						continue;
+					}
+				}
+				
+  				switch ((*it).rep_.type_)
+  				{
+  					case TeSTRING:						
+						q += "'"+escapeSequence(row[jj])+"'";
+  					break;
+  					case TeREAL:
+					{
+						std::string value = row[jj];
+						replace(value.begin(), value.end(), ',', '.');
+						q += value;
+					}
+  					break;
+  					case TeINT:
+						q += row[jj];
+  					break;
+					case TeDATETIME:
+					{
+						const string temp_dt = string(row[jj].c_str());
+						TeTime t(temp_dt, (*it).dateChronon_, (*it).dateTimeFormat_, (*it).dateSeparator_, (*it).timeSeparator_, (*it).indicatorPM_);
+						q += this->getSQLTime(t);
+					}
+  					break;
+					case TeCHARACTER:
+						q += "'" + escapeSequence(row[jj]) + "'";
+  					break;
+					case TeBLOB:
+						blobIndex = jj;
+  					break;
+  					default:
+						q += "'"+escapeSequence(row[jj])+"'";
+  					break;
+  				}
+				
+			}
+			else
+			{
+				uniqueVal = row[jj];
+				isUniqueValString = ((*it).rep_.type_ == TeSTRING);
+			}
+			++it;
+			j++;
+			jj++;
+		}
+		if (q.empty())
+			continue;
+		
+		if (!uniqueName.empty() && !uniqueVal.empty())  
+		{
+			if(isUniqueValString)
+				q += " WHERE " + uniqueName + " = '" + uniqueVal +"'";
+			else
+				q += " WHERE " + uniqueName + " = " + uniqueVal;
+		}
+		string sql = "UPDATE "+ table.name() + " SET " + q;
+		if (!execute(sql))
+		{
+			rollbackTransaction();
+			return false;
+		}
+
+		//verify if there was blob type
+		if(blobIndex>=0)
+		{
+			TeAttribute uniqueAttr;
+			table.attrUnique(uniqueAttr);
+			if(!insertBlob (table.name(), att[blobIndex].rep_.name_, uniqueAttr.rep_, uniqueVal, 
+				(unsigned char*)row[blobIndex].c_str(), row[blobIndex].size()))
+			{
+				rollbackTransaction();
+				return false;
+			}
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+
+bool 
+TeDatabase::loadTable(const string& tableName, TeTable &table)
+{
+	bool isreg = false;
+	table.name(tableName);
+	if (loadTableInfo(table)) // this is not a registered table...
+		isreg = true;
+
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	string q ="SELECT * FROM " + tableName;
+	if (!portal->query(q))
+	{	
+		delete portal;
+		return false;
+	}
+	if (!isreg)
+		table.setAttributeList(portal->getAttributeList());
+	while (portal->fetchRow())
+	{
+		TeTableRow row;
+		for (int j = 0; j < portal->numFields(); j++)
+		{
+           TeAttribute& attr = table.attributeList()[j];
+           if (attr.rep_.type_ == TeBLOB)
+           {
+               unsigned char* data = NULL;
+               long size = 0;
+               portal->getBlob (attr.rep_.name_, data, size);
+               string blobValue;
+               if (data != NULL)
+               {                                      
+				   blobValue.assign((char*)data, size);
+				   delete [] data;
+                   data = NULL;
+               }
+               row.push_back(blobValue);
+           }
+           else
+               row.push_back (portal->getData (j)); 
+		}
+		table.add(row);
+	}
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::selectTable (const string& tableName, const string& criteria, TeTable &table)
+{
+	bool isreg = false;
+	table.name(tableName);
+	if (loadTableInfo(table)) // this is not a registered table...
+		isreg = true;
+
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	string q ="SELECT * FROM " + tableName;
+	if (!criteria.empty())
+		q += " WHERE " + criteria;
+
+	if (!portal->query(q))
+	{	
+		delete portal;
+		return false;
+	}
+	if (!isreg)
+		table.setAttributeList(portal->getAttributeList());
+	while (portal->fetchRow())
+	{
+		TeTableRow row;
+		for(int i = 0; i < portal->numFields(); i++)
+			row.push_back(portal->getData(i));
+		table.add(row);
+	}
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::updateView (TeView *view)
+{
+	TeProjection* proj = view->projection();
+	if (proj)
+	{
+		if (proj->id() <= 0)
+			this->insertProjection(view->projection());
+		else
+			this->updateProjection(view->projection());
+	}
+	else
+	{
+		errorMessage_ = "N�o � poss�vel atualizar vista sem proje��o!";
+		return false;
+	}
+
+	string sql = "UPDATE te_view SET projection_id=" + Te2String(proj->id());
+	sql+= ", name='" + view->name() + "'";
+	sql+= ", user_name='" + view->user() + "'";
+	sql+= ", visibility= " + Te2String((int)view->isVisible());
+	sql+= ", lower_x = " + Te2String(view->getCurrentBox().lowerLeft().x());
+	sql+= ", lower_y = " + Te2String(view->getCurrentBox().lowerLeft().y());
+	sql+= ", upper_x = " + Te2String(view->getCurrentBox().upperRight().x());
+	sql+= ", upper_y = " + Te2String(view->getCurrentBox().upperRight().y());
+	if(view->getCurrentTheme() > 0)
+		sql+= ", current_theme = " + Te2String(view->getCurrentTheme());
+	else
+		sql+= ", current_theme = null";
+	sql +=" WHERE view_id = " + Te2String(view->id());
+
+	if (!this->execute (sql))
+		return false;
+
+	TeViewTree* tree = view->root();
+	if (tree) 
+		return	updateViewTree(tree);
+	return true;
+
+}
+
+
+bool 
+TeDatabase::loadViewSet (const string& user, const bool& loadAttrList, const string& visualType)
+{
+	std::vector<TeAbstractTheme*> vecExternalThemes;
+
+	//clear view map
+	TeViewMap::iterator it = metaModel_->viewMap().begin();
+	while (it != metaModel_->viewMap().end())
+	{
+		if(it->second)
+			delete it->second;
+		++it;
+	}
+	metaModel_->viewMap().clear();
+
+	//clear theme map
+	TeThemeMap::iterator itTheme = metaModel_->themeMap().begin();
+	while (itTheme != metaModel_->themeMap().end())
+	{
+		if(itTheme->second)
+			delete itTheme->second;
+		++itTheme;
+	}
+
+	//clear invalid theme map
+	itTheme = metaModel_->invalidThemeMap().begin();
+	while (itTheme != metaModel_->invalidThemeMap().end())
+	{
+		if(itTheme->second)
+			delete itTheme->second;
+		++itTheme;
+	}
+	metaModel_->invalidThemeMap().clear();
+	metaModel_->themeMap().clear();
+	metaModel_->legendMap().clear();
+	
+	//load view, projection, themes and grouping
+	string sql = " SELECT ";
+	sql += " te_view.*, "; //0-9  (10 columns)
+	sql += " te_projection.*, "; //10 - 26 (17 columns)
+	sql += " te_theme.*, "; // 27 - 46 (20 columns)
+	sql += " te_grouping.*, "; //47 - 56 (10 columns)
+	sql += " te_legend.*,  "; // 57 - 63    (7 columns)
+	sql += " te_visual.*, "; //  64 - 87 (24 columns)
+	sql += " te_visual_raster.* "; //  88 (7 columns)
+
+	sql += " FROM ((((((te_view INNER JOIN te_projection ";
+	sql += " ON te_view.projection_id = te_projection.projection_id) ";
+	sql += " LEFT JOIN te_theme ON te_view.view_id = te_theme.view_id ) ";
+	sql += " LEFT JOIN te_grouping ON te_theme.theme_id = te_grouping.theme_id) ";
+	sql += " LEFT JOIN te_legend ON te_theme.theme_id = te_legend.theme_id) ";
+	sql += " LEFT JOIN te_visual ON te_visual.legend_id = te_legend.legend_id) ";
+	sql += " LEFT JOIN te_visual_raster ON te_theme.theme_id = te_visual_raster.theme_id) ";
+			
+	sql += " WHERE ";
+	if (!user.empty())
+		sql += " te_view.user_name = '" + user + "'";
+	else
+		sql += " te_view.user_name = '" + this->user() + "'";
+	sql += " ORDER BY te_view.view_id, te_theme.priority, te_theme.theme_id, te_legend.legend_id, ";
+	sql += " te_legend.group_id, te_visual.geom_type, te_visual_raster.band_in  "; 
+
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+	
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+	
+	int lastViewId = -1;
+	TeView *view = 0;
+	bool hasNewRow = portal->fetchRow(); //idicates that this portal was fetched 
+	while(hasNewRow)
+	{
+		//load view and its projection 
+		if(lastViewId!=atoi(portal->getData(0)))
+		{
+			//store the last view
+			if(view)
+			{
+				metaModel_->viewMap()[view->id()] = view;
+				view = 0;
+			}
+			TeProjection* proj = 0;
+			if(!portal->getProjection(&proj, 10)) //load projection
+			{
+				delete portal;
+				return false;
+			}
+			view = new TeView();
+			if(!portal->getView(*view, 0)) //load view
+			{
+				delete portal;
+				delete view;
+				return false;
+			}
+			if (proj != 0)
+				view->projection(proj);
+			lastViewId = view->id();
+		}  
+		
+		//make the rigth object
+		string aux = portal->getData(27);
+		if (aux.empty())
+		{
+			hasNewRow = portal->fetchRow();
+			continue;
+		}
+		TeViewNodeType viewNodeType = (TeViewNodeType)portal->getInt(33);
+		TeViewNode* viewNode = TeViewNodeFactory::make(viewNodeType);
+
+		if(!viewNode)
+		{
+			int currentThemeId = portal->getInt(27);
+
+			while((hasNewRow = portal->fetchRow()) && (portal->getInt(27) == currentThemeId))
+				;
+
+			continue;
+		}
+
+		if(viewNodeType == TeTREE)
+		{
+			viewNode = loadViewTree(view, portal->getInt(27), loadAttrList, visualType); 
+			view->add(viewNode);
+
+			hasNewRow = portal->fetchRow();
+			continue;
+		}
+		else 
+		{
+			if(!portal->getTheme(static_cast<TeAbstractTheme&>(*viewNode), 27))
+			{
+				delete viewNode;
+				delete portal;
+				return false;
+			}
+
+			if(viewNodeType == TeTHEME)
+			{
+				//load layer
+				int id = static_cast<TeTheme*>(viewNode)->layerId();
+				TeLayerMap::iterator it = metaModel_->layerMap().find(id);
+				if (it == metaModel_->layerMap().end())
+					loadLayerSet(loadAttrList);
+				
+				static_cast<TeTheme*>(viewNode)->layer(metaModel_->layerMap()[id]);
+			}
+		}
+		
+		TeAbstractTheme* theme = static_cast<TeAbstractTheme*>(viewNode);
+
+		//load grouping 
+		TeGrouping group;
+		if(portal->getGrouping(group, 47))
+			theme->grouping(group);
+
+		//load all legends of this theme
+		//and its visual
+		bool hasLegsToThisTheme = true;
+		while(hasLegsToThisTheme)
+		{
+			//legend
+			TeLegendEntry legend;
+			if(!portal->getLegend(legend, 57))
+			{
+				delete theme;
+				delete view;
+				delete portal;
+				return false;
+			}
+
+			//visual
+			TeRasterVisual* rasterVisual = theme->rasterVisual();
+			if(rasterVisual == NULL)
+			{
+				rasterVisual = new TeRasterVisual();
+			}
+			bool hasVisualToThisLeg = true;
+			bool hasRasterVisual = false;
+			while(hasVisualToThisLeg)
+			{
+				TeVisual* visual = TeVisualFactory::make(visualType);
+				TeGeomRep geomRep;
+				if(portal->getVisual(visual, geomRep, 64))
+					legend.setVisual(visual, geomRep);
+									
+				if(rasterVisual != NULL && portal->getRasterVisual(*rasterVisual, 88))
+					hasRasterVisual=true;
+				
+				hasNewRow = portal->fetchRow();
+				if(!hasNewRow || portal->getInt(59)!= legend.group() || portal->getInt(57)!= legend.id())
+					hasVisualToThisLeg = false;
+			}
+
+			//Set raster visual to this theme
+			if(hasRasterVisual)
+				theme->rasterVisual(rasterVisual);
+			else
+				delete rasterVisual;
+
+			//Set legend to this theme
+			theme->legend(legend); 
+															
+			//fill legend buffer
+			if(legend.group() == -6)	
+				metaModel_->legendMap()[legend.id()] = &theme->queryAndPointingLegend();
+			else if(legend.group() == -5)	
+				metaModel_->legendMap()[legend.id()] = &theme->queryLegend(); 
+			else if (legend.group() == -4)
+				metaModel_->legendMap()[legend.id()] = &theme->pointingLegend(); 
+			else if (legend.group() == -3)
+				metaModel_->legendMap()[legend.id()] = &theme->defaultLegend(); 
+			else if (legend.group() == -2)
+				metaModel_->legendMap()[legend.id()] = &theme->withoutDataConnectionLegend(); 
+			else if (legend.group() == -1)
+				metaModel_->legendMap()[legend.id()] = &theme->outOfCollectionLegend(); 
+			else if (legend.group() == -10) //own legend
+			{
+				TeLegendEntry* legendTemp = new TeLegendEntry(legend);
+				metaModel_->legendMap()[legend.id()] = legendTemp;
+			}				
+			
+			if(!hasNewRow || portal->getInt(27)!= theme->id())
+				hasLegsToThisTheme = false;
+		}
+			
+		for (unsigned int i = 0; i < theme->legend().size(); ++i)
+			metaModel_->legendMap()[theme->legend()[i].id()] = &theme->legend()[i];
+
+		if(viewNode->type()==(int)TeTHEME)
+		{
+			//load theme table
+			if(!loadThemeTable(static_cast<TeTheme*>(theme), loadAttrList))
+			{
+				delete portal;
+				return false;
+			}
+		}
+		
+		if(viewNode->type() != (int)TeEXTERNALTHEME)
+		{
+			//load specific theme parameters
+			if(!theme->loadMetadata(this))
+			{
+				metaModel_->invalidThemeMap()[viewNode->id()] = theme;
+				continue;
+			}
+			metaModel_->themeMap()[viewNode->id()] = theme;
+		}
+		else
+		{
+			vecExternalThemes.push_back(theme);
+		}
+		
+		view->add(viewNode);
+	}
+
+	//store the last view
+	if(view)
+	{
+		metaModel_->viewMap()[view->id()] = view;
+		view = 0;
+	}
+
+	if(!vecExternalThemes.empty())
+	{
+		if(!loadExternalThemes(vecExternalThemes))
+		{
+			//todos se tornam invalidos
+			for(unsigned int i = 0; i < vecExternalThemes.size(); ++i)
+			{
+				TeView* view = metaModel_->viewMap()[vecExternalThemes[i]->view()];
+
+				invalidThemeMap()[vecExternalThemes[i]->id()] = vecExternalThemes[i];
+				view->remove(vecExternalThemes[i]->id());
+			}
+			return true;
+		}
+
+		TeViewMap::iterator itView = metaModel_->viewMap().begin();
+		while(itView != metaModel_->viewMap().end())
+		{
+			unsigned int i = 0;
+			while(i < itView->second->themes().size())
+			{
+				unsigned int id = itView->second->themes()[i]->id();
+				if(invalidThemeMap().find(id) != invalidThemeMap().end())
+				{
+					itView->second->remove(id);
+				}
+				else
+				{
+					++i;
+				}
+			}
+			++itView;
+		}
+	}
+
+	delete portal;
+	return true;
+	
+}
+
+TeViewTree* 
+TeDatabase::loadViewTree(TeView* view, int id, const bool& loadAttrList, const string& visualType)
+{
+	if( view == 0) 
+		return 0;
+	
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return 0;
+
+	string q;
+	TeViewTree *node = 0;
+
+	if (id != 0)
+	{
+		q = "SELECT * FROM te_theme";
+		q += " WHERE view_id = " + Te2String (view->id());
+		q += " AND theme_id = " + Te2String(id);
+
+		if (!portal->query(q) || !portal->fetchRow())
+		{
+			delete portal;
+			return 0;
+		}
+		TeViewNodeType type = (TeViewNodeType)portal->getInt("node_type");
+		if(type != TeTREE)
+		{
+			portal->freeResult();
+			delete portal;
+			return NULL;
+		}
+		node = portal->getViewTree();
+		portal->freeResult();
+	}
+
+	q ="SELECT * FROM te_theme";
+	q += " WHERE view_id = " + Te2String (view->id());
+	q += " AND parent_id = " + Te2String(id);
+	q += " ORDER BY priority ASC";
+
+	if (!portal->query(q))
+	{
+		delete portal;
+		return node;
+	}
+
+	while (portal->fetchRow())
+	{
+		TeViewNodeType childType = (TeViewNodeType)portal->getInt("node_type");
+		TeViewNode *childNode;
+		if (childType == TeTHEME)
+		{
+			childNode = new TeTheme();
+			childNode->id(portal->getInt(0));
+			this->loadTheme((TeTheme*)childNode, loadAttrList, visualType);
+		} 
+		else
+		{
+			childNode = loadViewTree(view, portal->getInt("theme_id"), loadAttrList, visualType);
+		}
+
+		if(id == 0)
+		{
+			view->add(childNode);
+		} 
+		else
+		{
+//			view->addTheme(childNode);
+			node->add(childNode);
+		}
+	}
+	delete portal;
+	return node;
+}
+
+bool 
+TeDatabase::loadView (TeView* view, const bool& loadAttrList, const string& visualType)
+{
+	std::vector<TeAbstractTheme*> vecExternalThemes;
+
+	string rest;
+	if (view->id() > 0)
+		rest = " te_view.view_id=" + Te2String(view->id());
+	else if (!view->name().empty())
+	{
+		rest = " te_view.name='" + view->name() + "'";
+		
+		if(!view->user().empty())
+			rest += " AND te_view.user_name='" + view->user() + "'"; 
+	}
+	else
+		return false;
+	
+	//load view, projection, themes and grouping
+	string sql = " SELECT ";
+	sql += " te_view.*, "; //0-9  (10 columns)
+	sql += " te_projection.*, "; //10 - 26 (17 columns)
+	sql += " te_theme.*, "; // 27 - 46 (20 columns)
+	sql += " te_grouping.*, "; //47 - 56 (10 columns)
+	sql += " te_legend.*,  "; // 57 - 63    (7 columns)
+	sql += " te_visual.*, "; //  64 - 87 (24 columns)
+	sql += " te_visual_raster.* "; //  88 (7 columns)
+
+	sql += " FROM ((((((te_view INNER JOIN te_projection ";
+	sql += " ON te_view.projection_id = te_projection.projection_id) ";
+	sql += " LEFT JOIN te_theme ON te_view.view_id = te_theme.view_id ) ";
+	sql += " LEFT JOIN te_grouping ON te_theme.theme_id = te_grouping.theme_id) ";
+	sql += " LEFT JOIN te_legend ON te_theme.theme_id = te_legend.theme_id) ";
+	sql += " LEFT JOIN te_visual ON te_visual.legend_id = te_legend.legend_id) ";
+	sql += " LEFT JOIN te_visual_raster ON te_theme.theme_id = te_visual_raster.theme_id) ";
+			
+	sql += " WHERE "+ rest;
+	sql += " ORDER BY te_view.view_id, te_theme.priority, te_theme.theme_id, te_legend.legend_id, ";
+	sql += " te_legend.group_id, te_visual.geom_type, te_visual_raster.band_in  "; 
+
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+	
+	if (!portal->query(sql) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	//load projection
+	TeProjection* proj = 0;
+	if(!portal->getProjection(&proj, 10)) 
+	{
+		delete portal;
+		return false;
+	}
+	//load view		
+	if(!portal->getView(*view, 0)) 
+	{
+		delete portal;
+		return false;
+	}
+	if (proj != 0)
+		view->projection(proj);
+	
+	bool hasNewRow = true;
+
+	while(hasNewRow)
+	{
+		string aux = portal->getData(27);
+		if (aux.empty())
+		{
+			hasNewRow = portal->fetchRow();
+			continue;
+		}
+		TeViewNodeType viewNodeType = (TeViewNodeType)portal->getInt(33);
+		//make the rigth object
+		TeViewNode* viewNode = TeViewNodeFactory::make(viewNodeType);
+
+		if(!viewNode)
+		{
+			int currentThemeId = portal->getInt(27);
+
+			while((hasNewRow = portal->fetchRow()) && (portal->getInt(27) == currentThemeId))
+				;
+
+			continue;
+		}
+
+		if(viewNodeType == TeTREE)
+		{
+			viewNode = loadViewTree(view, portal->getInt(27), loadAttrList, visualType); 
+			view->add(viewNode);
+			hasNewRow = portal->fetchRow();
+			continue;
+		}
+		else 
+		{
+			if(!portal->getTheme(static_cast<TeAbstractTheme&>(*viewNode), 27))
+			{
+				delete viewNode;
+				delete portal;
+				return false;
+			}
+
+			if(viewNodeType == TeTHEME)
+			{
+				//load layer
+				int id = static_cast<TeTheme*>(viewNode)->layerId();
+				TeLayerMap::iterator it = metaModel_->layerMap().find(id);
+				if (it == metaModel_->layerMap().end())
+					loadLayerSet(loadAttrList);
+				
+				static_cast<TeTheme*>(viewNode)->layer(metaModel_->layerMap()[id]);
+			}
+		}
+		
+		TeAbstractTheme* abstractTheme = static_cast<TeAbstractTheme*>(viewNode);
+
+		//load grouping 
+		TeGrouping group;
+		if(portal->getGrouping(group, 47))
+			abstractTheme->grouping(group);
+
+		//load all legends of this theme
+		//and its visual
+		bool hasLegsToThisTheme = true;
+		while(hasLegsToThisTheme)
+		{
+			//legend
+			TeLegendEntry legend;
+			if(!portal->getLegend(legend, 57))
+			{
+				delete viewNode;
+				delete portal;
+				return false;
+			}
+
+			//visual
+			TeRasterVisual* rasterVisual = abstractTheme->rasterVisual();
+			if(rasterVisual == NULL)
+			{
+				rasterVisual = new TeRasterVisual();
+			}
+			bool hasVisualToThisLeg = true;
+			bool hasRasterVisual = false;
+			while(hasVisualToThisLeg)
+			{
+				TeVisual* visual = TeVisualFactory::make(visualType);
+				TeGeomRep geomRep;
+				if(portal->getVisual(visual, geomRep, 64))
+					legend.setVisual(visual, geomRep);
+									
+				if(rasterVisual != NULL && portal->getRasterVisual(*rasterVisual, 88))
+					hasRasterVisual=true;
+				
+				hasNewRow = portal->fetchRow();
+				if(!hasNewRow || portal->getInt(59)!= legend.group() || portal->getInt(57)!= legend.id())
+					hasVisualToThisLeg = false;
+			}
+
+			//Set raster visual to this theme
+			if(hasRasterVisual)
+				abstractTheme->rasterVisual(rasterVisual);
+			else
+				delete rasterVisual;
+
+			//Set legend to this theme
+			abstractTheme->legend(legend); 
+															
+			//fill legend buffer
+			if(legend.group() == -6)	
+				metaModel_->legendMap()[legend.id()] = & abstractTheme->queryAndPointingLegend();
+			else if(legend.group() == -5)	
+				metaModel_->legendMap()[legend.id()] = & abstractTheme->queryLegend(); 
+			else if (legend.group() == -4)
+				metaModel_->legendMap()[legend.id()] = & abstractTheme->pointingLegend(); 
+			else if (legend.group() == -3)
+				metaModel_->legendMap()[legend.id()] = & abstractTheme->defaultLegend(); 
+			else if (legend.group() == -2)
+				metaModel_->legendMap()[legend.id()] = & abstractTheme->withoutDataConnectionLegend(); 
+			else if (legend.group() == -1)
+				metaModel_->legendMap()[legend.id()] = & abstractTheme->outOfCollectionLegend(); 
+			else if (legend.group() == -10) //own legend
+			{
+				TeLegendEntry* legendTemp = new TeLegendEntry(legend);
+				metaModel_->legendMap()[legend.id()] = legendTemp;
+			}	
+			
+			if(!hasNewRow || portal->getInt(27)!= abstractTheme->id())
+				hasLegsToThisTheme = false;
+		}				
+			
+		for (unsigned int i = 0; i < abstractTheme->legend().size(); ++i)
+			metaModel_->legendMap()[abstractTheme->legend()[i].id()] = & abstractTheme->legend()[i];
+		
+		if(viewNode->type()==(int)TeTHEME)
+		{
+			//load theme table
+			if(!loadThemeTable(static_cast<TeTheme*>(abstractTheme), loadAttrList))
+			{
+				delete portal;
+				return false;
+			}
+		}
+		
+		if(viewNode->type() != (int)TeEXTERNALTHEME)
+		{
+			//load specific theme parameters
+			if(!abstractTheme->loadMetadata(this))
+			{
+				metaModel_->invalidThemeMap()[viewNode->id()] = abstractTheme;
+				continue;
+			}
+			metaModel_->themeMap()[viewNode->id()] = abstractTheme;
+		}
+		else
+		{
+			vecExternalThemes.push_back(abstractTheme);
+		}
+				
+		view->add(viewNode);
+	}
+
+	delete portal;
+	portal = NULL;
+
+	metaModel_->viewMap()[view->id()] = view;
+
+	if(!vecExternalThemes.empty())
+	{
+		if(!loadExternalThemes(vecExternalThemes))
+		{
+			//todos se tornam invalidos
+			for(unsigned int i = 0; i < vecExternalThemes.size(); ++i)
+			{
+				invalidThemeMap()[vecExternalThemes[i]->id()] = vecExternalThemes[i];
+				view->remove(vecExternalThemes[i]->id());
+			}
+		}
+		else
+		{
+			unsigned int i = 0;
+			while(i < view->themes().size())
+			{
+				unsigned int id = view->themes()[i]->id();
+				if(invalidThemeMap().find(id) != invalidThemeMap().end())
+				{
+					view->remove(id);
+				}
+				else
+				{
+					++i;
+				}
+			}
+		}
+	}
+	
+	return true;
+}
+
+
+void
+TeDatabase::clear()
+{
+	metaModel_->clear();
+}
+
+bool 
+TeDatabase::deleteView (int viewId)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	// view projection should be deleted manually
+	string sql =  "SELECT projection_id FROM te_view WHERE view_id=" + Te2String(viewId);
+	portal->freeResult();
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	string projId = portal->getData("projection_id");
+	portal->freeResult();
+	
+	// delete themes belonging to this view 
+	sql = "SELECT theme_id FROM te_theme WHERE view_id=" + Te2String(viewId);
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	while (portal->fetchRow())
+	{
+		int id = atoi(portal->getData(0));
+		if(deleteTheme(id) == false)
+		{	
+			delete portal;
+			return false;
+		}
+	}
+
+	//delete the entries in the project relation
+	if (existRelation("te_project_view","fk_projectview_view_id") != TeRICascadeDeletion)
+	{
+		sql = "DELETE FROM te_project_view WHERE view_id =" + Te2String(viewId);
+		if (!this->execute (sql))
+			return false;
+	}
+
+	// delete view
+	sql = "DELETE FROM te_view WHERE view_id = " + Te2String(viewId);
+	if (!this->execute (sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	sql = "DELETE FROM te_projection WHERE  projection_id = " + projId;
+	if (!this->execute (sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	// Delete the view and its themes
+	TeView* view = metaModel_->viewMap()[viewId];
+	metaModel_->viewMap().erase(viewId);
+	delete view;
+	delete portal;
+	return true;
+}
+
+bool
+TeDatabase::updateViewTree (TeViewTree *tree)
+{
+	if(tree ->type() == 1) //tree->id() > 0) //only for TeTREE
+	{
+		string sql;
+		sql = "UPDATE te_theme SET ";
+		sql += "name='" + tree->name()+"'";
+		sql += ", parent_id=" + Te2String (tree->parentId());
+		sql += ", node_type=" + Te2String (tree->type());
+		sql += " ,priority=" + Te2String (tree->priority());
+		sql += " WHERE theme_id = " + Te2String(tree->id());
+
+		if(!this->execute (sql)) return false;
+	}
+
+	for (unsigned int th=0; th<tree->size(); th++)
+	{
+		TeViewNode* node = tree->retrieve(th);
+		if (node->type() == TeTREE)
+		{
+			TeViewTree* tree = (TeViewTree*)node;
+			if(!updateViewTree(tree)) return false;
+		}
+		else
+		{
+			TeTheme *theme = (TeTheme*)node;
+			if(!updateTheme(theme)) return false;
+		}
+	}
+	return true;
+}
+
+bool 
+TeDatabase::viewExist(string viewName)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	viewName = TeConvertToUpperCase(viewName);
+
+	string sql = "SELECT name FROM te_view";
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+	while (portal->fetchRow())
+	{
+		string name = portal->getData(0);
+		name = TeConvertToUpperCase(name);
+		if (viewName == name)
+		{
+			delete portal;
+			return true;
+		}
+	}
+	delete portal;
+	return false;
+}
+
+
+bool
+TeDatabase::updateTheme (TeAbstractTheme *theme)
+{
+	string sql;
+
+	if (theme->id() <= 0 )  // theme doesn�t exist in the database yet
+	{
+		return this->insertTheme(theme);
+	}
+	
+	// update theme metadata
+	sql = "UPDATE te_theme SET ";
+	
+	if(theme->type()==TeTHEME)
+	{
+		sql += " layer_id=" + Te2String (static_cast<TeTheme*>(theme)->layerId());
+		sql += ", ";
+	}
+	
+	sql += "  view_id=" + Te2String (theme->view());
+	sql += ", name='" + escapeSequence(theme->name())+"'";
+	sql += ", parent_id=" + Te2String (theme->parentId());
+	sql += ", priority=" + Te2String (theme->priority());
+	sql += ", node_type=" + Te2String (theme->type());
+	sql += ", min_scale=" + Te2String (theme->minScale(),15);
+	sql += ", max_scale=" + Te2String (theme->maxScale(),15);
+	sql += ", generate_attribute_where='" + escapeSequence(theme->attributeRest())+"'";
+	sql += ", generate_spatial_where='" + escapeSequence(theme->spatialRest())+"'";
+	sql += ", generate_temporal_where='" + escapeSequence(theme->temporalRest())+"'";
+
+	if(theme->type()==TeTHEME || theme->type()==TeEXTERNALTHEME )
+		sql += ", collection_table='" + static_cast<TeTheme*>(theme)->collectionTable() + "'";
+
+	sql += ", visible_rep= " + Te2String(theme->visibleRep ());
+	sql += ", enable_visibility= " + Te2String(theme->visibility()); 
+	sql += ", lower_x = " + Te2String(theme->box().x1(), 15); 
+	sql += ", lower_y = " + Te2String(theme->box().y1(), 15); 
+	sql += ", upper_x = " + Te2String(theme->box().x2(), 15); 
+	sql += ", upper_y = " + Te2String(theme->box().y2(), 15);
+	if(theme->getCreationTime().isValid())
+	{
+		TeTime creationTime = theme->getCreationTime();
+		sql += ", creation_time = " + this->getSQLTime(creationTime);
+	}
+
+	sql += " WHERE theme_id=" + Te2String (theme->id(), 15);
+
+	if (!this->execute (sql))
+		return false;
+         
+	//delete grouping 
+	sql = "DELETE FROM te_grouping WHERE theme_id= "+ Te2String(theme->id());
+	this->execute (sql);
+		
+	if(theme->grouping().groupMode_ != TeNoGrouping)
+	{
+		if(!insertGrouping(theme->id(), theme->grouping()))
+			return false;
+	}
+	
+	// update each of its legends
+	bool status = true;
+	
+	if(theme->legend().size() == 0)
+	{
+		if(!deleteLegend(theme->id()))
+			return false;
+	}
+	else
+	{
+		status = updateLegend(theme->legend());
+		if (!status)
+			return status;
+	}
+
+	status = updateLegend(&(theme->withoutDataConnectionLegend()));
+	if (!status)
+		return status;
+
+	status = updateLegend(&(theme->outOfCollectionLegend()));
+	if (!status)
+		return status;
+
+	status = updateLegend(&(theme->defaultLegend()));
+	if (!status)
+		return status;
+
+	status = updateLegend(&(theme->pointingLegend()));
+	if (!status)
+		return status;
+
+	status = updateLegend(&(theme->queryLegend()));
+	if (!status)
+		return status;
+
+	status = updateLegend(&(theme->queryAndPointingLegend()));
+	if (!status)
+		return status;
+	
+	//insert metadata theme
+	if(!theme->saveMetadata(this))
+		return false;
+
+	// theme tables
+	if(theme->type()==TeTHEME && !updateThemeTable(static_cast<TeTheme*>(theme)))
+		return false;
+
+	return true;
+}
+
+bool
+TeDatabase::loadTheme (TeAbstractTheme* theme, const bool& loadAttrList, const string& visualType)
+{
+	if (theme == 0)
+		return false;
+
+	string rest;
+	if (theme->id() > 0)
+		rest = " te_theme.theme_id = "+  Te2String(theme->id());
+	else if (!theme->name().empty())
+		rest = " te_theme.name = '"+  theme->name() + "'";
+	else
+	{
+		this->errorMessage_ = "Theme procurado n�o possui nem id nem nome";
+		return false;
+	}
+	rest += " AND te_view.user_name = \'" + this->user() +"\'";
+	
+	//load view, projection, themes and grouping
+	string sql = " SELECT ";
+	sql += " te_theme.*, "; // 0 - 19 (20 columns)   
+	sql += " te_grouping.*, "; //20 - 29 (10 columns)
+	sql += " te_legend.*,  "; // 30 - 36    (7 columns)
+	sql += " te_visual.*, "; //  37 - 60 (24 columns)
+	sql += " te_visual_raster.* "; //  61 (7 columns)
+	sql += " FROM (((((te_view INNER JOIN te_theme ON te_view.view_id = te_theme.view_id) ";
+	sql += " LEFT JOIN te_grouping ON te_theme.theme_id = te_grouping.theme_id ) ";
+	sql += " LEFT JOIN te_legend ON te_theme.theme_id = te_legend.theme_id ) ";
+	sql += " LEFT JOIN te_visual ON te_legend.legend_id = te_visual.legend_id ) ";
+	sql += " LEFT JOIN te_visual_raster ON te_theme.theme_id = te_visual_raster.theme_id) ";
+	sql += " WHERE "+ rest;
+	sql += " ORDER BY te_theme.theme_id, te_legend.legend_id, te_legend.group_id, te_visual.geom_type, te_visual_raster.band_in  "; 
+
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	
+	TeViewNodeType viewNodeType = (TeViewNodeType)portal->getInt(6);
+	if(viewNodeType == TeTREE)
+	{		
+		TeViewNodeParams params;
+		portal->getViewNodeParams(params, 0);
+		theme->viewNodeParams(params);
+		delete portal;
+		return true;
+	}
+			
+	if(!portal->getTheme(*theme, 0))
+	{
+		delete portal;
+		return false;
+	}
+	
+	if(viewNodeType==(int)TeTHEME)
+	{
+		//load layer
+		int id = static_cast<TeTheme*>(theme)->layerId();
+		TeLayerMap::iterator it = metaModel_->layerMap().find(id);
+		if (it == metaModel_->layerMap().end())
+			loadLayerSet(loadAttrList);
+		
+		static_cast<TeTheme*>(theme)->layer(metaModel_->layerMap()[id]);
+	}
+		
+	//load grouping 
+	TeGrouping group;
+	if(portal->getGrouping(group, 20))
+		theme->grouping(group);
+
+	//load all legends of this theme
+	//and its visual
+	bool hasLegsToThisTheme = true;
+	bool hasNewRow = true;
+	while(hasLegsToThisTheme)
+	{
+		//legend
+		TeLegendEntry legend;
+		if(!portal->getLegend(legend, 30))
+		{
+			delete portal;
+			return false;
+		}
+
+		//visual
+		//TeRasterVisual* rasterVisual = new TeRasterVisual();
+		TeRasterVisual* rasterVisual = theme->rasterVisual();
+		if(rasterVisual == NULL)
+		{
+			rasterVisual = new TeRasterVisual();
+		}
+		
+		bool hasVisualToThisLeg = true;
+		bool hasRasterVisual = false;
+		while(hasVisualToThisLeg)
+		{
+			TeVisual* visual = TeVisualFactory::make(visualType);
+			TeGeomRep geomRep;
+			if(portal->getVisual(visual, geomRep, 37))
+				legend.setVisual(visual, geomRep);
+								
+			if(rasterVisual != NULL && portal->getRasterVisual(*rasterVisual, 61))
+				hasRasterVisual=true;
+			
+			hasNewRow = portal->fetchRow();
+			if(!hasNewRow || portal->getInt(32)!= legend.group() || portal->getInt(30)!= legend.id() )  //if legend_id and group_id
+				hasVisualToThisLeg = false;
+		}
+
+		//Set raster visual to this theme
+		if(hasRasterVisual)
+			theme->rasterVisual(rasterVisual);
+		else
+			delete rasterVisual;
+
+		//Set legend to this theme
+		theme->legend(legend); 
+														
+		//fill legend buffer
+		if(legend.group() == -6)	
+			metaModel_->legendMap()[legend.id()] = &theme->queryAndPointingLegend();
+		else if(legend.group() == -5)	
+			metaModel_->legendMap()[legend.id()] = &theme->queryLegend(); 
+		else if (legend.group() == -4)
+			metaModel_->legendMap()[legend.id()] = &theme->pointingLegend(); 
+		else if (legend.group() == -3)
+			metaModel_->legendMap()[legend.id()] = &theme->defaultLegend(); 
+		else if (legend.group() == -2)
+			metaModel_->legendMap()[legend.id()] = &theme->withoutDataConnectionLegend(); 
+		else if (legend.group() == -1)
+			metaModel_->legendMap()[legend.id()] = &theme->outOfCollectionLegend(); 
+		else if (legend.group() == -10) //own legend
+		{
+			TeLegendEntry* legendTemp = new TeLegendEntry(legend);
+			metaModel_->legendMap()[legend.id()] = legendTemp;
+		}	
+		
+		if(!hasNewRow || portal->getInt(0)!= theme->id())
+			hasLegsToThisTheme = false;
+	}
+
+	delete portal;
+			
+	for (unsigned int i = 0; i < theme->legend().size(); ++i)
+		metaModel_->legendMap()[theme->legend()[i].id()] = &theme->legend()[i];
+
+	//load theme table
+	if(theme->type()==(int)TeTHEME)
+	{
+		if(!loadThemeTable(static_cast<TeTheme*>(theme), loadAttrList))
+			return false;
+	}
+
+	//load specific theme parameters
+	if(!theme->loadMetadata(this))
+	{
+		metaModel_->invalidThemeMap()[theme->id()] = theme;
+		delete portal;
+		return false;
+	}
+			
+	metaModel_->themeMap()[theme->id()] = theme;
+	return true;
+}
+
+bool
+TeDatabase::loadThemes(std::vector<TeAbstractTheme*>& vecThemes, const bool& loadAttrList, const std::string& userName, const bool& loadMetadata, const string& visualType)
+{
+	if (vecThemes.empty())
+		return false;	
+
+	std::set<int> setThemes;
+
+	std::string rest = "";
+	std::string idClause = "";
+	std::string nameClause = "";
+	for(unsigned int i = 0; i < vecThemes.size(); ++i)
+	{
+		TeAbstractTheme* theme = vecThemes[i];
+		if(theme == NULL)
+		{
+			return false;
+		}
+
+		if (theme->id() > 0)
+		{
+			//rest = " te_theme.theme_id = "+  Te2String(theme->id());
+			if(!idClause.empty())
+			{
+				idClause += ",";
+			}
+			idClause += Te2String(theme->id());
+		}
+		else if (!theme->name().empty())
+		{
+			//rest = " te_theme.name = '"+  theme->name() + "'";
+			if(!nameClause.empty())
+			{
+				nameClause += ",";
+			}
+			nameClause += "'" + theme->name() + "'";
+		}
+		else
+		{
+			this->errorMessage_ = "Theme procurado n�o possui nem id nem nome";
+			return false;
+		}
+	}
+	if(!idClause.empty())
+	{
+		rest += "te_theme.theme_id in (" + idClause + ")";
+	}
+	if(!nameClause.empty())
+	{
+		if(!rest.empty())
+		{
+			rest += " AND ";
+		}
+		rest += "te_theme.name in (" + nameClause + ")";
+	}
+
+	rest += " AND te_view.user_name = \'" + userName +"\'";
+	//rest += " AND te_view.user_name = \'postgres\'";
+	
+	//load view, projection, themes and grouping
+	string sql = " SELECT ";
+	sql += " te_theme.*, "; // 0 - 19 (20 columns)   
+	sql += " te_grouping.*, "; //20 - 29 (10 columns)
+	sql += " te_legend.*,  "; // 30 - 36    (7 columns)
+	sql += " te_visual.*, "; //  37 - 60 (24 columns)
+	sql += " te_visual_raster.* "; //  61 (7 columns)
+	sql += " FROM (((((te_view INNER JOIN te_theme ON te_view.view_id = te_theme.view_id) ";
+	sql += " LEFT JOIN te_grouping ON te_theme.theme_id = te_grouping.theme_id ) ";
+	sql += " LEFT JOIN te_legend ON te_theme.theme_id = te_legend.theme_id ) ";
+	sql += " LEFT JOIN te_visual ON te_legend.legend_id = te_visual.legend_id ) ";
+	sql += " LEFT JOIN te_visual_raster ON te_theme.theme_id = te_visual_raster.theme_id) ";
+	sql += " WHERE "+ rest;
+	sql += " ORDER BY te_theme.theme_id, te_legend.legend_id, te_legend.group_id, te_visual.geom_type, te_visual_raster.band_in  "; 
+
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+	
+	if(!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool hasNewRow = portal->fetchRow();
+
+	while(hasNewRow)
+	{
+		TeAbstractTheme* theme = NULL;;
+		int id = portal->getInt(0);
+		for(unsigned int i = 0; i < vecThemes.size(); ++i)
+		{
+			if(id == vecThemes[i]->id())
+			{
+				theme = vecThemes[i];
+				setThemes.insert(id);
+				break;
+			}
+		}		
+
+		TeViewNodeType viewNodeType = (TeViewNodeType)portal->getInt(6);
+		if(viewNodeType == TeTREE)
+		{		
+			TeViewNodeParams params;
+			portal->getViewNodeParams(params, 0);
+			theme->viewNodeParams(params);
+			delete portal;
+			return true;
+		}
+				
+		if(!portal->getTheme(*theme, 0))
+		{
+			delete portal;
+			return false;
+		}		
+		
+		if(viewNodeType==(int)TeTHEME)
+		{
+			//load layer
+			int id = static_cast<TeTheme*>(theme)->layerId();
+			TeLayerMap::iterator it = metaModel_->layerMap().find(id);
+			if (it == metaModel_->layerMap().end())
+				loadLayerSet(loadAttrList);
+			
+			static_cast<TeTheme*>(theme)->layer(metaModel_->layerMap()[id]);
+		}
+			
+		//load grouping 
+		TeGrouping group;
+		if(portal->getGrouping(group, 20))
+			theme->grouping(group);
+
+		//load all legends of this theme
+		//and its visual
+		bool hasLegsToThisTheme = true;	
+		while(hasLegsToThisTheme)
+		{
+			//legend
+			TeLegendEntry legend;
+			if(!portal->getLegend(legend, 30))
+			{
+				delete portal;
+				return false;
+			}
+
+			//visual
+			//TeRasterVisual* rasterVisual = new TeRasterVisual();
+			TeRasterVisual* rasterVisual = theme->rasterVisual();
+			if(rasterVisual == NULL)
+			{
+				rasterVisual = new TeRasterVisual();
+			}
+			bool hasVisualToThisLeg = true;
+			bool hasRasterVisual = false;
+			while(hasVisualToThisLeg)
+			{
+				TeVisual* visual = TeVisualFactory::make(visualType);
+				TeGeomRep geomRep;
+				if(portal->getVisual(visual, geomRep, 37))
+					legend.setVisual(visual, geomRep);
+									
+				if(rasterVisual != NULL && portal->getRasterVisual(*rasterVisual, 61))
+					hasRasterVisual=true;
+				
+				hasNewRow = portal->fetchRow();
+				if(!hasNewRow || portal->getInt(32)!= legend.group() || portal->getInt(30)!= legend.id() )  //if legend_id and group_id
+					hasVisualToThisLeg = false;
+			}
+
+			//Set raster visual to this theme
+			if(hasRasterVisual)
+				theme->rasterVisual(rasterVisual);
+			else
+				delete rasterVisual;
+
+			//Set legend to this theme
+			theme->legend(legend); 
+															
+			//fill legend buffer
+			if(legend.group() == -6)	
+				metaModel_->legendMap()[legend.id()] = &theme->queryAndPointingLegend();
+			else if(legend.group() == -5)	
+				metaModel_->legendMap()[legend.id()] = &theme->queryLegend(); 
+			else if (legend.group() == -4)
+				metaModel_->legendMap()[legend.id()] = &theme->pointingLegend(); 
+			else if (legend.group() == -3)
+				metaModel_->legendMap()[legend.id()] = &theme->defaultLegend(); 
+			else if (legend.group() == -2)
+				metaModel_->legendMap()[legend.id()] = &theme->withoutDataConnectionLegend(); 
+			else if (legend.group() == -1)
+				metaModel_->legendMap()[legend.id()] = &theme->outOfCollectionLegend(); 
+			else if (legend.group() == -10) //own legend
+			{
+				TeLegendEntry* legendTemp = new TeLegendEntry(legend);
+				metaModel_->legendMap()[legend.id()] = legendTemp;
+			}	
+			
+			if(!hasNewRow || portal->getInt(0)!= theme->id())
+				hasLegsToThisTheme = false;
+		}		
+				
+		for (unsigned int i = 0; i < theme->legend().size(); ++i)
+			metaModel_->legendMap()[theme->legend()[i].id()] = &theme->legend()[i];
+
+		//load theme table
+		if(theme->type()==(int)TeTHEME)
+		{
+			if(!loadThemeTable(static_cast<TeTheme*>(theme), loadAttrList))
+				return false;
+		}
+
+		if(loadMetadata == true)
+		{
+			//load specific theme parameters
+			if(!theme->loadMetadata(this))
+			{
+				metaModel_->invalidThemeMap()[theme->id()] = theme;
+				delete portal;
+				return false;
+			}
+		}
+				
+		//metaModel_->themeMap()[theme->id()] = theme;
+	}
+
+	delete portal;
+
+	for(unsigned int i = 0; i < vecThemes.size(); ++i)
+	{
+		if(setThemes.find(vecThemes[i]->id()) != setThemes.end())
+		{
+			metaModel_->themeMap()[vecThemes[i]->id()] = vecThemes[i];
+		}
+		else
+		{
+			metaModel_->invalidThemeMap()[vecThemes[i]->id()] = vecThemes[i];
+		}
+	}
+
+	return true;
+}
+
+bool TeDatabase::loadExternalThemes(std::vector<TeAbstractTheme*>& vecExternalThemes)
+{
+	if(vecExternalThemes.empty())
+	{
+		return true;
+	}
+
+	std::map<int, std::vector< std::pair<int, TeAbstractTheme*> > > mapExternalThemes;
+
+	for(unsigned int i = 0; i < vecExternalThemes.size(); ++i)
+	{
+		TeAbstractTheme* abstractTheme = vecExternalThemes[i];
+
+		TeExternalTheme* extTheme = dynamic_cast<TeExternalTheme*>(abstractTheme);
+		if(extTheme != NULL)
+		{
+			extTheme->setSourceDatabase(this);
+			int remoteThemeId = -1;
+			int remoteDBId = -1;
+
+			if(!extTheme->getRemoteThemeInfo(remoteThemeId, remoteDBId))
+				return false;				
+
+			mapExternalThemes[remoteDBId].push_back(std::pair<int,TeAbstractTheme*>::pair(remoteThemeId, extTheme));
+		}
+	}
+
+	std::map<int, std::vector< std::pair<int, TeAbstractTheme*> > >::iterator itExtThemes = mapExternalThemes.begin();
+	while(itExtThemes != mapExternalThemes.end())
+	{
+		TeDatabase* remotedb = TeDBConnectionsPool::instance().getDatabase(itExtThemes->first);
+		if(remotedb == NULL)
+		{	
+			std::string hostName, dbmsName, dbName, userName, password;
+			int port = 0;
+			if(!TeDBConnectionsPool::instance().getConnectionInfo(this, itExtThemes->first, hostName, dbmsName, dbName, userName, password, port))
+			{
+				return false;
+			}
+
+			remotedb = TeDBConnectionsPool::instance().getDatabase(dbmsName, dbName, hostName, userName, password, port);
+
+			if(remotedb != NULL)
+			{
+				TeDBConnectionsPool::instance().saveExternalDBConnection(this, remotedb);
+			}
+		}
+		
+		if(remotedb == NULL || remotedb->isConnected() == false)
+		{
+			for(unsigned int i = 0; i < itExtThemes->second.size(); ++i)
+			{
+				metaModel_->invalidThemeMap()[itExtThemes->second[i].second->id()] = itExtThemes->second[i].second;
+			}
+			++itExtThemes;
+			continue;
+		}
+		
+		std::vector<TeAbstractTheme*> vecThemesToLoad;
+		for(unsigned int i = 0; i < itExtThemes->second.size(); ++i)
+		{
+			bool add = true;
+			for(unsigned int j = 0; j < vecThemesToLoad.size(); ++j)
+			{
+				if(itExtThemes->second[i].first == vecThemesToLoad[j]->id())
+				{
+					add = false;
+					break;
+				}
+			}
+			if(add == false)
+			{
+				continue;
+			}
+
+			TeTheme* remoteTheme = new TeTheme();
+			remoteTheme->id(itExtThemes->second[i].first);
+			vecThemesToLoad.push_back(remoteTheme);
+		}
+
+		if(!remotedb->loadThemes(vecThemesToLoad, true, remotedb->user(), false))
+		{
+			return false;
+		}
+
+		for(unsigned int i = 0; i < itExtThemes->second.size(); ++i)
+		{
+			TeExternalTheme* extTheme = dynamic_cast<TeExternalTheme*>(itExtThemes->second[i].second);			
+			if(extTheme != NULL)
+			{
+				//verifica se o tema eh invalido
+				TeThemeMap::iterator itTheme = remotedb->metaModel_->invalidThemeMap().find(itExtThemes->second[i].first);
+				if(itTheme != remotedb->metaModel_->invalidThemeMap().end())
+				{
+					metaModel_->invalidThemeMap()[extTheme->id()] = extTheme;
+				}
+				else
+				{
+					metaModel_->themeMap()[extTheme->id()] = extTheme;
+
+					TeThemeMap::iterator itTheme = remotedb->metaModel_->themeMap().find(itExtThemes->second[i].first);
+
+					if(itTheme == remotedb->metaModel_->themeMap().end())
+					{
+						return false;
+					}
+
+					extTheme->setRemoteTheme((TeTheme*)itTheme->second);
+					extTheme->loadObjectLegendMap();
+				}
+			}
+		}
+
+		remotedb->clear();
+
+		++itExtThemes;
+	}
+
+	return true;
+}
+
+bool
+TeDatabase::loadThemeTable (TeTheme* theme, const bool& loadAttrList)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+	{
+		this->errorMessage_ = "N�o foi poss�vel abrir portal para o banco";
+		return false;
+	}
+	
+	//theme tables
+	string sel = "SELECT te_theme_table.*, ";  //0 - 4 (5 columnns)
+	sel += " te_tables_relation.*, ";          //5 - 9  (5 columns)
+	sel += " te_layer_table.* ";			   //10	
+	sel += " FROM (te_theme_table LEFT JOIN te_tables_relation";
+	sel += " ON te_theme_table.relation_id = te_tables_relation.relation_id)";
+	sel += " LEFT JOIN te_layer_table ON te_theme_table.table_id = te_layer_table.table_id";
+	sel += " WHERE  te_theme_table.theme_id = " + Te2String(theme->id());
+	sel += " ORDER BY table_order";
+	
+	if (!portal->query (sel))
+	{	
+		delete portal;
+		return false;
+	}
+
+	while(portal->fetchRow ())
+	{
+		string tableName = portal->getData(12);
+		if(tableName.empty())
+			continue;
+
+		TeTable table(tableName);
+
+		TeLayerMap::iterator itLayer = metaModel_->layerMap().find(theme->layerId());
+		if(itLayer!=metaModel_->layerMap().end() && (!itLayer->second->getAttrTablesByName(tableName, table)))
+		{
+			TeAttributeList attrList;
+			if(loadAttrList)
+				getAttributeList(tableName, attrList);
+			table.setAttributeList(attrList);
+			if(!portal->getAttrTable(table, 10))
+			{
+				delete portal;
+				return false;
+			}
+		}
+
+		table.setId(portal->getInt(2)); //"te_theme_table.table_id"
+		table.setOrder(portal->getInt(4)); //"table_order"
+		TeAttrTableType tableType = table.tableType(); //portal->getInt("attr_table_type");
+		if (tableType == TeAttrExternal)
+		{
+			int relatedTableId = portal->getInt(6); //"related_table_id"
+			table.relatedTableName(getTableName(relatedTableId));
+			int relationId = portal->getInt(3); //"te_theme_table.relation_id"
+			metaModel_->relationMSet().insert(relationId);
+
+			string relatedAttr = portal->getData(7); //"related_attr"
+			table.setTableType(TeAttrExternal, relatedTableId, relatedAttr);
+
+			table.setLinkName(portal->getData(9)); //"external_attr"
+		}
+		else
+			table.setTableType((TeAttrTableType)tableType);
+
+		theme->addThemeTable(table);
+	}
+
+	delete portal;
+	return true;
+}
+
+
+bool
+TeDatabase::insertThemeTable(TeTheme *theme, TeTable& inputTable)
+{
+	int themeId = theme->id();
+	int	tableOrder = 0;
+	int	relationId;
+	bool status;
+	string qString;
+
+	// Get the order of the last theme table
+	qString = "SELECT MAX(table_order) FROM te_theme_table";
+	qString += " WHERE theme_id = " + Te2String(themeId);
+
+	TeDatabasePortal* portal = getPortal();
+	if (portal->query(qString) == false || portal->fetchRow() == false)
+		return false;
+
+	string data = portal->getData(0);
+	if (data.empty())
+		tableOrder = 0;
+	else
+	{
+		tableOrder = atoi(portal->getData(0));
+		++tableOrder;
+	}
+	inputTable.setOrder(tableOrder);
+	delete portal;
+
+	if (inputTable.tableType() == TeAttrExternal)
+	{
+		status = insertRelationInfo(inputTable.relatedTableId(),inputTable.relatedAttribute(),
+									inputTable.name(),inputTable.linkName(),relationId);
+		if (status == false)
+			return false;
+		metaModel_->relationMSet().insert(relationId);
+
+		status = insertThemeTable(themeId, inputTable.id(), relationId, tableOrder);
+	}
+	else
+	{
+		// Insert the table in the te_theme_table
+		status = insertThemeTable(themeId, inputTable.id(), 0, tableOrder);
+	}
+	return status;
+}
+
+bool
+TeDatabase::removeThemeTable(TeTheme *theme, int tableOrder)
+{
+	if (tableOrder < 0)
+		return false;
+
+	int relationId = -1;
+	string qString;
+
+	TeAttrTableVector attrTableVector; 
+	theme->getAttTables(attrTableVector);
+
+	// If the table is external, find the relation id
+	qString = "SELECT relation_id FROM te_theme_table";
+	qString += " WHERE theme_id = " + Te2String(theme->id());
+	qString += " AND relation_id IS NOT NULL";
+	qString += " AND table_order = " + Te2String(tableOrder);
+
+	TeDatabasePortal* portal = getPortal();
+	if (portal->query(qString) && portal->fetchRow())
+		relationId = portal->getInt("relation_id");
+	else
+	{
+		delete portal;
+		return false;
+	}
+	delete portal;
+
+	// Remove the table from the te_theme_table
+	qString = "DELETE FROM te_theme_table WHERE theme_id = " + Te2String(theme->id());
+	qString += " AND table_order = " + Te2String(tableOrder);
+	if (execute(qString) == false)
+		return false;
+
+	// Remove the relation from the te_tables_relation
+	// table if only this theme is using it
+	if (relationId > 0)
+	{
+		if (metaModel_->relationMSet().count(relationId) == 1)
+		{
+			qString = "DELETE FROM te_tables_relation WHERE relation_id = " + Te2String(relationId);
+			if (execute(qString) == false)
+				return false;
+			metaModel_->relationMSet().erase(relationId);
+		}
+		else
+			metaModel_->relationMSet().erase(metaModel_->relationMSet().find(relationId));
+	}
+	return true;
+}
+
+
+bool 
+TeDatabase::updateThemeTable(TeTheme *theme)
+{
+	//Initially remove from te_theme_table all the records of this theme
+	string q = "SELECT * FROM te_theme_table WHERE theme_id = " + Te2String(theme->id());
+	TeDatabasePortal *portal = getPortal();
+
+	if (portal->query(q) == false)
+	{
+		delete portal;
+		return false;
+	}
+
+	while (portal->fetchRow())
+	{
+		int relationId;
+		int themeTableId = portal->getInt("theme_table_id");
+
+		string data = portal->getData("relation_id");
+		if (data.empty())
+			relationId = -1;
+		else
+			relationId = atoi(data.c_str());
+
+		// Remove the relation from the te_tables_relation
+		// table if only this theme is using it
+		bool b = false;
+		if (relationId > 0)
+		{
+			if (metaModel_->relationMSet().count(relationId) == 1)
+				b = true;
+			else
+				metaModel_->relationMSet().erase(metaModel_->relationMSet().find(relationId));
+		}
+
+		// Remove the table from the te_theme_table
+		q = "DELETE FROM te_theme_table WHERE theme_id = " + Te2String(theme->id());
+		q += " AND theme_table_id = " + Te2String(themeTableId);
+		if (execute(q) == false)
+		{
+			delete portal;
+			return false;
+		}
+		if(b)
+		{
+			q = "DELETE FROM te_tables_relation WHERE relation_id = " + Te2String(relationId);
+			if (execute(q) == false)
+			{
+				delete portal;
+				return false;
+			}
+			metaModel_->relationMSet().erase(relationId);
+		}
+	}
+	delete portal;
+
+	// Update te_theme_table and te_tables_relation(if there are any external tables)
+	// with the information provided from the new vector of theme tables
+	TeAttrTableVector tablesVector; 
+	theme->getAttTables(tablesVector);
+	for (unsigned i = 0; i < tablesVector.size(); ++i)
+		insertThemeTable(theme, tablesVector[i]);
+
+	return true;
+}
+
+
+bool 
+TeDatabase::insertGrouping (int themeId, const TeGrouping& grouping)
+{
+	if((themeId < 1) || (grouping.groupMode_ == TeNoGrouping) )
+		return false;
+
+	string ins = " INSERT INTO te_grouping (theme_id, grouping_number, ";
+	ins += " grouping_attr, grouping_attr_type, grouping_mode, "; 
+	ins += " grouping_norm_attr, grouping_std_dev, grouping_precision, "; 
+	ins += " grouping_function, grouping_chronon)"; 
+	ins += " VALUES ( ";
+	ins += Te2String(themeId);
+	ins += ", "+ Te2String(grouping.groupNumSlices_);
+
+	string attname = grouping.groupAttribute_.name_;
+	if(attname.empty() || (attname=="NONE") )
+		attname = "";
+	
+	string norname = grouping.groupNormAttribute_;
+	if(norname.empty() || (norname=="NONE"))
+		norname = "";
+
+	map<int, map<string, string> >::iterator it = metaModel_->mapThemeAlias().find(themeId);
+	if(it != metaModel_->mapThemeAlias().end())
+	{
+		map<string, string>::iterator tit = it->second.find(attname);
+		if(tit != it->second.end())
+		{
+			string alias = tit->second;
+			attname += "(" + alias + ")";
+		}
+		if(norname.empty() == false)
+		{
+			map<string, string>::iterator tit = it->second.find(norname);
+			if(tit != it->second.end())
+			{
+				string nalias = tit->second;
+				norname += "(" + nalias + ")";
+			}
+		}
+	}
+
+	ins += ", '"+ attname +"'";
+	ins += ", "+ Te2String(grouping.groupAttribute_.type_);
+	ins += ", "+ Te2String(grouping.groupMode_);
+	ins += ", '"+ norname +"'";
+	ins += ", "+ Te2String(grouping.groupStdDev_); 
+	ins += ", "+ Te2String(grouping.groupPrecision_);
+	ins += ", '"+ grouping.groupFunction_ +"'";
+	ins += ", "+ Te2String(grouping.groupChronon_);
+	ins += ")";
+
+	return (execute(ins));
+}
+
+bool 
+TeDatabase::updateGrouping (int themeId, const TeGrouping& grouping)
+{
+	if((themeId < 1) || (grouping.groupMode_ == TeNoGrouping))
+		return false;
+
+	string up = " UPDATE te_grouping SET ";
+	up += "  grouping_number = "+ Te2String(grouping.groupNumSlices_);
+
+	string attname = grouping.groupAttribute_.name_;
+	if(attname.empty() || (attname=="NONE"))
+		attname = "";
+
+	string norname = grouping.groupNormAttribute_;
+	if(norname.empty()|| (norname=="NONE"))
+		norname = "";
+
+	map<int, map<string, string> >::iterator it = metaModel_->mapThemeAlias().find(themeId);
+	if(it != metaModel_->mapThemeAlias().end())
+	{
+		map<string, string>::iterator tit = it->second.find(attname);
+		if(tit != it->second.end())
+		{
+			string alias = tit->second;
+			attname += "(" + alias + ")";
+		}
+		if(norname.empty() == false)
+		{
+			map<string, string>::iterator tit = it->second.find(norname);
+			if(tit != it->second.end())
+			{
+				string nalias = tit->second;
+				norname += "(" + nalias + ")";
+			}
+		}
+	}
+
+	up += ", grouping_attr = '"+ attname +"'";
+	up += ", grouping_attr_type = "+ Te2String(grouping.groupAttribute_.type_);
+	up += ", grouping_mode = "+ Te2String(grouping.groupMode_);
+	up += ", grouping_norm_attr = '"+ norname +"'";
+	up += ", grouping_std_dev = "+ Te2String(grouping.groupStdDev_); 
+	up += ", grouping_precision = "+ Te2String(grouping.groupPrecision_);
+	up += ", grouping_function = '"+ grouping.groupFunction_ +"'";
+	up += ", grouping_chronon = "+ Te2String(grouping.groupChronon_);
+	up += " WHERE theme_id = "+ Te2String(themeId);
+
+	return (execute(up));
+}
+
+bool 
+TeDatabase::generateLabelPositions(TeTheme *theme, const std::string& objectId)
+{
+	string	piebar, geomTable, upd;
+	string	collTable = theme->collectionTable();
+	
+	if((collTable.empty()) || (!tableExist(collTable)))
+		return false;
+
+	if (theme->layer()->hasGeometry(TeCELLS) )
+	{
+		geomTable = theme->layer()->tableName(TeCELLS);
+
+		piebar = "SELECT label_x, label_y, lower_x, lower_y, upper_x, upper_y";
+		piebar += " FROM " + collTable + " LEFT JOIN " + geomTable;
+		piebar += " ON " + collTable + ".c_object_id = " + geomTable + ".object_id";
+		if (!objectId.empty())
+			upd += " WHERE " +  collTable + ".c_object_id = '" + objectId + "'";
+
+		upd = " UPDATE (" + piebar + ") SET";
+		upd += " label_x = lower_x + (upper_x-lower_x)/2,";
+		upd += " label_y = lower_y + (upper_y-lower_y)/2";
+		
+
+		if(!execute(upd))
+			return false;
+	}
+
+	if( theme->layer()->hasGeometry(TePOLYGONS))
+	{
+		geomTable = theme->layer()->tableName(TePOLYGONS);
+
+		piebar = "SELECT label_x, label_y, lower_x, lower_y, upper_x, upper_y";
+		piebar += " FROM " + collTable + " LEFT JOIN " + geomTable;
+		piebar += " ON " + collTable + ".c_object_id = " + geomTable + ".object_id";
+		piebar += " WHERE label_x is null OR label_y is null";
+		if (!objectId.empty())
+			upd += " AND " +  collTable + ".c_object_id = '" + objectId + "'";
+		piebar += " ORDER BY c_object_id ASC, ext_max ASC";
+		
+		upd = " UPDATE (" + piebar + ") SET";
+		upd += " label_x = lower_x + (upper_x-lower_x)/2,";
+		upd += " label_y = lower_y + (upper_y-lower_y)/2";
+
+		if(!execute(upd))
+			return false;
+	}
+	
+	if (theme->layer()->hasGeometry(TePOINTS))
+	{
+		geomTable = theme->layer()->tableName(TePOINTS);
+
+		piebar = "SELECT label_x, label_y, x, y";
+		piebar += " FROM " + collTable + " LEFT JOIN " + geomTable;
+		piebar += " ON " + collTable + ".c_object_id = " + geomTable + ".object_id";
+		piebar += " WHERE label_x is null OR label_y is null";
+		if (!objectId.empty())
+			upd += " AND " +  collTable + ".c_object_id = '" + objectId + "'";
+
+		upd = " UPDATE (" + piebar + ") SET";
+		upd += " label_x = x,";
+		upd += " label_y = y";
+
+		if(!execute(upd))
+			return false;
+	}
+	
+	if(theme->layer()->hasGeometry(TeLINES))
+	{
+		geomTable = theme->layer()->tableName(TeLINES);
+
+		piebar = "SELECT label_x, label_y, lower_x, lower_y, upper_x, upper_y";
+		piebar += " FROM " + collTable + " LEFT JOIN " + geomTable;
+		piebar += " ON " + collTable + ".c_object_id = " + geomTable + ".object_id";
+		piebar += " WHERE label_x is null OR label_y is null";
+		if (!objectId.empty())
+			upd += " AND " +  collTable + ".c_object_id = '" + objectId + "'";
+		piebar += " ORDER BY c_object_id ASC, ext_max ASC";
+		
+		upd = " UPDATE (" + piebar + ") SET";
+		upd += " label_x = lower_x + (upper_x-lower_x)/2,";
+		upd += " label_y = lower_y + (upper_y-lower_y)/2";
+
+		if(!execute(upd))
+			return false;
+	}
+	return true;
+}
+
+bool
+TeDatabase::themeExist(const std::string &viewName, const std::string &userName, const std::string &themeName)
+{
+	bool status=false;
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return status;
+
+	string sql = "SELECT name FROM te_theme ";
+	sql+= " where view_id=( select view_id from te_view where name='";
+	sql+=viewName;
+	sql+="' and user_name='";
+	sql+=userName;
+	sql+="')and name='";
+	sql+=themeName +  "'";
+
+	if (portal->query(sql) && portal->fetchRow()) status=true;
+	delete portal;
+	return status;
+}
+
+bool 
+TeDatabase::themeExist(string themeName)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	themeName = TeConvertToUpperCase(themeName);
+
+	string sql = "SELECT name FROM te_theme";
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+	while (portal->fetchRow())
+	{
+		string name = portal->getData(0);
+		name = TeConvertToUpperCase(name);
+		if (themeName == name)
+		{
+			delete portal;
+			return true;
+		}
+	}
+	delete portal;
+	return false;
+}
+
+string TeDatabase::getNewThemeName(const string& n)
+{
+	bool changed;
+	string invalidChar;
+	string name = TeCheckName(n, changed, invalidChar);
+	string newName = name;
+
+	string q = "SELECT name FROM te_theme WHERE name = '" + newName + "'";
+
+	TeDatabasePortal* portal = this->getPortal();
+	if(portal && portal->query(q) && portal->fetchRow())
+	{
+		// there is already a theme with this theme 
+		q = "SELECT name FROM te_theme WHERE name LIKE '" + name + "_%' ORDER BY name DESC";
+		portal->freeResult();
+		if(portal && portal->query(q))
+		{
+			newName.clear();
+			while(portal->fetchRow())
+			{
+				string s = portal->getData(0);
+				size_t i, f = s.rfind("_");
+				f++;
+				newName = s.substr(0, f);
+				string ss = s.substr(f);
+				for(i=0; i < ss.size(); ++i)
+				{
+					if(ss[i] < 0x30 || ss[i] > 0x39)
+						break;
+				}
+				if(i < ss.size())
+					continue;
+
+				int n = atoi(ss.c_str()) + 1;
+				s = Te2String(n);
+				newName += s;
+				break;
+			}
+			if(newName.empty())
+				newName = name + "_1";
+		}
+	}
+	delete portal;
+	return newName;
+}
+
+string TeDatabase::getNewTableName(const string& n)
+{
+	bool changed;
+	string invalidChar;
+	string name = TeCheckName(n, changed, invalidChar);
+	string newName = name;
+	int	i=1;
+	while (this->tableExist(newName))
+	{
+		newName = name + Te2String(i);
+		++i;
+	}
+	return newName;
+}
+
+string TeDatabase::getConcatFieldsExpression(const vector<string>& fNamesVec)
+{
+	string concatExp;
+	for (unsigned int i = 0; i < fNamesVec.size(); ++i)
+	{
+		if (i != 0)
+			concatExp += " & ";
+		concatExp += fNamesVec[i];
+	}
+	return concatExp;
+}
+
+
+bool
+TeDatabase::deleteTheme(int themeId)
+{
+	TeAbstractTheme* tema;
+	bool themeWasFound = false;
+	TeThemeMap::iterator it;
+
+	it = invalidThemeMap().find(themeId);
+	if (it != invalidThemeMap().end())
+	{
+		themeWasFound = true;
+		tema = it->second;
+		invalidThemeMap().erase(themeId);
+	}
+
+	if (themeWasFound == false)
+	{
+		it = themeMap().find(themeId);
+		if(it != themeMap().end())
+		{
+			themeWasFound = true;
+			tema = it->second;
+			themeMap().erase(themeId);
+		}
+	}
+
+	if (themeWasFound == false)
+		return false;
+	
+	if(!tema->eraseMetadata(this))
+		return false;
+	
+	string sql;
+	// delete the collection table associated to this theme
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+
+	sql = "SELECT collection_table FROM te_theme WHERE theme_id = " + Te2String(themeId);
+	if (!portal->query(sql) ||!portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	string colTab = portal->getData("collection_table");
+	//delete collection table
+	if (this->tableExist(colTab))	
+	{
+		sql = "DROP TABLE " + colTab;
+		if (!this->execute(sql) )
+		{	
+			delete portal;
+			return false;
+		}
+	}
+	//delete auxiliar collection table
+	if (this->tableExist(colTab +"_aux"))	
+	{
+		sql = "DROP TABLE " +colTab +"_aux";
+		if (!this->execute(sql) )
+		{	
+			delete portal;
+			return false;
+		}
+	}
+	portal->freeResult();
+
+	//delete the visual associated to this theme
+	if (existRelation("te_visual","fk_visual_legend_id") != TeRICascadeDeletion)
+	{
+		sql = "SELECT legend_id FROM te_legend WHERE theme_id = " + Te2String(themeId);
+		if (!portal->query(sql))
+		{	
+			delete portal;
+			return false;
+		}
+		string wherec;
+		int c = 0;
+		while (portal->fetchRow())
+		{
+			if (c)
+				wherec += ",";
+			c++;
+			wherec += portal->getData(0);
+		}
+		portal->freeResult();
+        if (!wherec.empty()) 
+        {
+			sql = "DELETE FROM te_visual WHERE legend_id IN (" + wherec + ")";
+			if (!this->execute(sql))
+			{	
+				delete portal;
+				return false;
+			}
+	   }
+	}
+
+	//delete lut table from current raster visual, if it exist
+	if(tema->rasterVisual())
+	{
+		if(!tema->rasterVisual()->getLutTableName().empty())
+		{
+			std::string lutTableName = tema->rasterVisual()->getLutTableName();
+
+			if (this->tableExist(lutTableName))
+			{
+				if(!this->deleteTable(lutTableName))
+					return false;
+			}
+		}
+	}
+
+	//delete all visuals of raster associated to this theme
+	if (existRelation("te_visual_raster","fk_visrast_theme_id") != TeRICascadeDeletion)
+	{
+		sql = "DELETE FROM te_visual_raster WHERE theme_id =" + Te2String(themeId);
+		if (!this->execute (sql))
+		{	
+			delete portal;
+			return false;
+		}
+	}
+	
+	//delete all legends associated to this theme
+	if (existRelation("te_legend","fk_legend_theme_id") != TeRICascadeDeletion)
+	{
+		sql = "DELETE FROM te_legend WHERE theme_id =" + Te2String(themeId);
+		if (!this->execute (sql))
+		{	
+			delete portal;
+			return false;
+		}
+	}
+	
+	//select the view of this theme
+	sql = "SELECT view_id FROM te_theme WHERE theme_id = " + Te2String(themeId);
+	portal->freeResult();
+	if(!portal->query(sql) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	//delete theme of the view tree
+	int viewId = portal->getInt("view_id");
+	delete portal;
+
+	//delete the tables associated to this theme
+	if (existRelation("te_theme_table","fk_thmtable_theme_id") != TeRICascadeDeletion)
+	{
+		sql = "DELETE FROM te_theme_table WHERE theme_id =" + Te2String(themeId);
+		if (!this->execute (sql))
+			return false;
+	}
+		
+	//delete the grouping
+	if (existRelation("te_grouping","fk_group_theme_id")  != TeRICascadeDeletion)
+	{
+		sql = "DELETE FROM te_grouping WHERE theme_id =" + Te2String(themeId);
+		if (!this->execute (sql))
+			return false;
+	}
+
+	// delete raster visual
+	if (existRelation("te_visual_raster","fk_visrast_theme_id") == TeNoRelation )
+	{
+		sql = "DELETE FROM te_visual_raster WHERE theme_id =" + Te2String(themeId);
+		if (!this->execute (sql))
+			return false;
+	}
+
+	sql = " UPDATE te_view SET current_theme = NULL WHERE current_theme = "+ Te2String(themeId);
+	this->execute(sql);
+	
+	// delete the theme
+	sql = " DELETE FROM te_theme WHERE theme_id = " + Te2String(themeId);
+	if (!this->execute (sql))
+		return false;
+
+	//delete in the maps
+	TeView* view = viewMap()[viewId];
+	if (view) //this view exists
+		view->remove(themeId); 
+
+    unsigned int i;
+	TeLegendEntryVector& legendVector = tema->legend();
+	for (i = 0; i < legendVector.size(); ++i)
+		legendMap().erase(legendVector[i].id());
+	
+	delete tema;
+	return true;
+}
+
+bool
+TeDatabase::deleteThemeGroup(int themeId)
+{
+	string sql;
+	// delete the theme
+	sql = "DELETE FROM te_grouping WHERE theme_id = " + Te2String(themeId);
+	if (!this->execute (sql))
+		return false;
+	return true;
+}
+
+bool
+TeDatabase::deleteLegend(int themeId)
+{
+	// If there is a collection table update legend of the objects in it
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+	string sel = "SELECT collection_table FROM te_theme WHERE theme_id = " + Te2String(themeId);
+	string TC;
+	if (portal->query(sel) && portal->fetchRow())
+		TC = portal->getData(0);
+	delete portal;
+
+	if (!TC.empty() && this->tableExist(TC))
+	{
+		string up = "UPDATE " + TC + " SET c_legend_id = 0";
+		if (!execute(up))
+			return false;
+	}
+
+	// Delete visual of the legends
+	string del = "DELETE FROM te_visual WHERE legend_id IN ";
+	del += "(SELECT legend_id FROM te_legend WHERE theme_id = " + Te2String(themeId);
+	del += " AND group_id > -1)";
+	if (!execute(del))
+		return false;
+
+	del = "DELETE FROM te_legend WHERE theme_id = " + Te2String(themeId);
+	del += " AND group_id > -1";
+	if (!execute(del))
+		return false;
+
+	// Delete from memory the legends of the theme
+	unsigned int i;
+	TeAbstractTheme *theme = metaModel_->themeMap()[themeId];
+	if(theme == NULL)
+	{
+		theme = metaModel_->invalidThemeMap()[themeId];
+		if(theme == NULL)
+		{
+			return false;
+		}
+	}
+	TeLegendEntryVector& legendVector = theme->legend();
+	for (i = 0; i < legendVector.size(); ++i)
+		metaModel_->legendMap().erase(legendVector[i].id());
+	legendVector.clear();
+
+	//delete grouping
+	del = "DELETE FROM te_grouping WHERE theme_id =" + Te2String(themeId);
+	if (!execute (del))
+		return false;
+		
+	return true;
+}
+
+bool
+TeDatabase::updateLayer(TeLayer *layer)
+{
+	if (!layer)
+		return false;
+
+	if (layer->projection())
+		updateProjection(layer->projection());
+
+	string sql;
+	sql = "UPDATE te_layer SET ";
+	sql += "name = '" + layer->name() + "' ";
+	if (layer->box().isValid())
+	{
+		sql += ", lower_x = " + Te2String(layer->box().x1(),15) + " ";
+		sql += ", lower_y = " + Te2String(layer->box().y1(),15) + " ";
+		sql += ", upper_x = " + Te2String(layer->box().x2(),15) + " ";
+		sql += ", upper_y = " + Te2String(layer->box().y2(),15) + " ";
+	}else
+	{
+		sql += ", lower_x = " + Te2String(layer->box().x1()) + " ";
+		sql += ", lower_y = " + Te2String(layer->box().y1()) + " ";
+		sql += ", upper_x = " + Te2String(layer->box().x2()) + " ";
+		sql += ", upper_y = " + Te2String(layer->box().y2()) + " ";
+	}
+	if(layer->getEditionTime().isValid())
+	{
+		TeTime editionTime = layer->getEditionTime();
+		sql += ", edition_time = " + this->getSQLTime(editionTime);
+	}
+	sql +=  " WHERE layer_id = " + Te2String(layer->id());
+
+	return (this->execute (sql));
+}
+
+bool
+TeDatabase::loadLayerSet(const bool& loadAttrList)
+{
+	//clear layer map
+	TeLayerMap::iterator it = metaModel_->layerMap().begin();
+	while (it != metaModel_->layerMap().end())
+	{
+		if(it->second)
+			delete it->second;
+		++it;
+	}
+	metaModel_->layerMap().clear();
+	
+	string sql = " SELECT te_layer.*, "; // 0 - 9 (10 columns)
+	sql += " te_projection.*, "; // 10 - 26  (17 columns)
+	sql += " te_representation.*, "; // 27 - 41 (15 columns)
+	sql += " te_layer_table.* "; // 42 - 53 (12 columns)
+	
+	sql += " FROM (((te_layer INNER JOIN te_projection ";
+	sql += " ON te_layer.projection_id = te_projection.projection_id) ";
+	sql += " LEFT JOIN te_representation ON ";
+	sql += " te_layer.layer_id = te_representation.layer_id) ";
+	sql += " LEFT JOIN te_layer_table ON ";
+	sql += " te_layer.layer_id = te_layer_table.layer_id) ";
+
+	sql += " ORDER BY te_layer.layer_id, te_representation.geom_type, te_layer_table.table_id ";
+
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+	
+	int lastLayerId = -1;
+	TeLayer *layer = 0;
+	bool hasNewRow = portal->fetchRow(); //idicates that this portal was fetched 
+	while(hasNewRow)
+	{
+		//load view and its projection 
+		if(lastLayerId!=atoi(portal->getData(0)))
+		{
+			TeProjection* proj = 0;
+			if(!portal->getProjection(&proj, 10)) //load projection
+			{
+				delete portal;
+				return false;
+			}
+			layer = new TeLayer();
+			if(!portal->getLayer(*layer, 0)) //load layer
+			{
+				delete portal;
+				delete layer;
+				return false;
+			}
+			if (proj != 0)
+				layer->setProjection(proj);
+			lastLayerId = layer->id();
+		}
+
+		//load its representation and its tables
+		bool hasRepsTablesToThisLayer = true;
+		vector<int> loadedTableId;
+		while(hasRepsTablesToThisLayer)
+		{
+			//load representation
+			string repId = portal->getData(27);
+
+			TeRepresPointerVector::iterator it;
+
+			//bool textLoaded = false;
+
+			//for(it = layer->vectRepres().begin(); it != layer->vectRepres().end(); ++it)
+			//{
+			//	if((*it)->id_ == atoi(repId.c_str()))
+			//	{
+			//		textLoaded = true;
+			//		break;
+			//	}
+			//}
+
+			if(!repId.empty() && 
+				(!layer->hasGeometry(TeGeomRep(portal->getInt(29))) || 
+				(TeGeomRep(portal->getInt(29)) == TeTEXT))/* && (!textLoaded)*/)
+			{
+				TeRepresentation* rep = new TeRepresentation();
+				if(!portal->getRepresentation(*rep, 27))
+				{
+					delete rep;
+					delete layer;
+					delete portal;
+				}
+				layer->addVectRepres(rep);
+			}
+			
+			//load tables
+			if( find(loadedTableId.begin(), loadedTableId.end(), portal->getInt(42)) == loadedTableId.end())
+			{
+				TeTable attrTable;
+				if(portal->getAttrTable(attrTable, 42))
+				{
+					TeAttributeList attrList;
+					if(loadAttrList)
+						getAttributeList(attrTable.name(), attrList);
+					attrTable.setAttributeList(attrList);
+					layer->addAttributeTable(attrTable);
+					loadedTableId.push_back(attrTable.id());
+				}
+			}
+			hasNewRow = portal->fetchRow();
+			if(!hasNewRow || portal->getInt(0)!= layer->id())
+				hasRepsTablesToThisLayer = false;
+		}
+
+		layer->setDatabase(this);
+		metaModel_->layerMap()[layer->id()] = layer;
+	}
+
+	delete portal;
+	return true;
+
+}
+
+string
+TeDatabase::getRasterTable(int layerId, const string& objectId)
+{
+	if (layerId <=0 )
+		return "";
+
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return "";
+
+	string get;
+	// get the raster representation
+	get = "SELECT geom_table FROM te_representation WHERE layer_id = "+Te2String(layerId);
+	get += " AND (geom_type= " + Te2String((int)TeRASTER) + " OR geom_type= " + Te2String((int)TeRASTERFILE) + ")";
+	
+	// error executing query or no there is no raster representation 
+	if (!portal->query(get) || !portal->fetchRow())
+	{
+		delete portal;
+		return "";
+	}
+
+	string tableName = portal->getData(0);
+	portal->freeResult();
+	if (tableName.empty())
+	{
+		delete portal;
+		return "";
+	}
+
+	// check if a specific object is being looked for
+	get = "SELECT raster_table FROM " + tableName + " WHERE object_id='" + objectId + "'";
+	if (!portal->query(get) || !portal->fetchRow())
+	{
+		delete portal;
+		return "";
+	}
+	tableName = portal->getData(0);
+	delete portal;
+	return tableName;
+}
+
+
+TeRaster*
+TeDatabase::loadLayerRaster(int layerId, const string& objectId, const char& mode)
+{
+	if (layerId <=0 )
+		return 0;
+
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return 0;
+
+	TeRaster* raster = 0;
+	string get;
+
+	// get the raster representation
+	get = "SELECT geom_table, geom_type, initial_time FROM te_representation WHERE layer_id = "+Te2String(layerId);
+	get += " AND (geom_type= " + Te2String((int)TeRASTER) + " OR geom_type= " + Te2String((int)TeRASTERFILE) + ")";
+	
+	// error executing query or no there is no raster representation 
+	if (!portal->query(get) || !portal->fetchRow())
+	{
+		delete portal;
+		return 0;
+	}
+	string tableName = portal->getData(0);
+	TeGeomRep rep = static_cast<TeGeomRep>(portal->getInt(1));
+	TeTime date = portal->getDate(2);
+	portal->freeResult();
+	if (tableName.empty())
+	{
+		delete portal;
+		return 0;
+	}
+
+	//--- this check is made for compatibility reasons with older terralib databases
+	TeAttributeRep	attrRep;
+	attrRep.name_ = "tiling_type";
+	attrRep.type_ = TeINT;
+		
+	TeAttribute att;
+	if(!columnExist(tableName, attrRep.name_,att))
+	{
+		addColumn (tableName, attrRep);
+		string sql = "UPDATE " + tableName + " SET tiling_type = " + Te2String(static_cast<int>(TeRasterParams::TeExpansible));
+		this->execute(sql);
+	}
+
+	// ---
+
+	// check if a specific object is being looked for
+	get = "SELECT * FROM " + tableName;
+	if (!objectId.empty())
+		get += " WHERE object_id='" + objectId + "'"; 
+	if (!portal->query(get, TeSERVERSIDE, TeUNIDIRECTIONAL, TeREADONLY, TeBINARYCURSOR) || !portal->fetchRow())
+	{
+		delete portal;
+		return 0;
+	}
+
+	string oid = portal->getData("object_id");
+	int geomId = portal->getInt("geom_id"); // get raster representation id
+
+	// get raster parameters from te_raster_table table
+	TeRasterParams params;
+	params.fileName_ = portal->getData("raster_table");
+	params.lutName_ = portal->getData("lut_table");
+	params.nBands(portal->getInt("num_bands"));
+	params.boundingBoxResolution(portal->getDouble("lower_x"),portal->getDouble("lower_y"),
+								 portal->getDouble("upper_x"),portal->getDouble("upper_y"),
+							     portal->getDouble("res_x"),portal->getDouble("res_y"));
+	params.blockHeight_ = portal->getInt("block_height");
+	params.blockWidth_ = portal->getInt("block_width");
+	params.tiling_type_ = static_cast<TeRasterParams::TeRasterTilingType>(portal->getInt("tiling_type"));
+
+	if(date.isValid())
+	{
+		params.date_ = date;
+	}
+
+	portal->freeResult();
+
+	// get extra information from te_raster_metadata table
+	string metadatatable = tableName + "_metadata"; 
+	unsigned int nb = params.nBands();
+	unsigned int i;
+	for (i=0; i<nb; i++)
+	{
+		get = "SELECT * FROM " + metadatatable + " WHERE geom_id=" + Te2String(geomId);
+		get += " AND band_id=" + Te2String(i);
+		if (portal->query(get) && portal->fetchRow()) 
+		{
+			params.vmax_[i] = portal->getDouble("max_value");
+			params.vmin_[i] = portal->getDouble("min_value");
+			params.nbitsperPixel_[i] = portal->getInt("num_bits");
+			params.dataType_[i] =  static_cast<TeDataType>(portal->getInt("data_type"));
+			params.compression_[i] = static_cast<TeRasterParams::TeRasterCompressionMode>(portal->getInt("compression_type"));
+			params.photometric_[i] = static_cast<TeRasterParams::TeRasterPhotometricInterpretation>(portal->getInt("photometric_type"));
+			params.bandName_[i] = portal->getData("band_name");
+		}
+		portal->freeResult();
+	}
+
+	// if raster is pallete get the associated LUT
+	if (params.photometric_[0] == TeRasterParams::TePallete && 	rep != TeRASTERFILE)
+		this->loadRasterLUT(&params);
+
+	// raster has the same projection as its layer
+	get = " SELECT te_projection.* FROM ";
+	get += " te_projection INNER JOIN te_layer ON ";
+	get += " te_projection.projection_id = te_layer.projection_id ";
+	get += " WHERE layer_id = " + Te2String(layerId);
+	
+	TeProjection* proj=0;
+	if (portal->query(get) && portal->fetchRow())
+		portal->getProjection(&proj);
+
+	portal->freeResult();
+	params.projection(proj);
+	if (proj)
+		delete proj;
+
+	bool hasDummy = false;
+	get = "SELECT band_id, dummy FROM " + metadatatable + " WHERE geom_id=" + Te2String(geomId);
+	get += " AND NOT (dummy IS NULL)";
+	if (portal->query(get))
+	{
+		while (portal->fetchRow())
+		{
+			int b = portal->getInt(0);
+			double d = portal->getDouble("dummy");
+			params.setDummy(d,b);
+			hasDummy = true;
+		}
+	}
+	params.useDummy_ = hasDummy;
+	params.mode_ = mode;
+	params.objectId_ = oid;
+	params.layerId_ = layerId;
+	delete portal;
+
+	if ( rep == TeRASTER)
+	{
+		params.nTilesInMemory_ = 0;
+		params.database_ = this;
+		TeDecoderDatabase* dec = new TeDecoderDatabase(params);
+		dec->init();
+		raster = new TeRaster();
+		raster->setDecoder(dec);
+		raster->objectId(oid);
+		return raster;
+	}
+	try
+	{
+		raster = new TeRaster(params);
+	}
+	catch(...)
+	{
+		if (params.fileName_.empty() == false)
+		{
+			errorMessage_ = "File doesn't exist: ";
+			errorMessage_ += params.fileName_;
+		}
+		else
+		{
+			errorMessage_ = "Raster file is not accessible.";
+		}
+		return 0;
+	} 
+	raster->init();
+	return raster;
+}
+
+bool 
+TeDatabase::loadRasterLUT(TeRasterParams* par)
+{
+	if (par->lutName_.empty())		
+		return false;
+	
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	string get = "SELECT COUNT(index_id) FROM " + par->lutName_;
+	if (!portal->query(get) || !portal->fetchRow())	 // if there is no table, or table is empty
+	{
+		delete portal;
+		return false;
+	}
+	int nentries = atoi(portal->getData(0));
+	if (nentries <= 0)
+	{
+		delete portal;
+		return false;
+	}
+	portal->freeResult();
+
+	par->lutr_.clear();
+	par->lutg_.clear();
+	par->lutb_.clear();
+	par->lutClassName_.clear();
+
+	par->lutr_.resize(nentries);
+	par->lutg_.resize(nentries);
+	par->lutb_.resize(nentries);
+	par->lutClassName_.resize(nentries);
+
+	par->lutr_.assign(nentries,0);
+	par->lutg_.assign(nentries,0);
+	par->lutb_.assign(nentries,0);
+	par->lutClassName_.assign(nentries,"");
+
+	get = "SELECT * FROM " + par->lutName_ + " ORDER BY index_id ASC ";
+	if (!portal->query(get) || !portal->fetchRow())	 // if there is no table, or table is empty
+	{
+		delete portal;
+		return false;
+	}
+
+	do
+	{
+		int index = atoi(portal->getData(0));
+		par->lutr_[index] = atoi(portal->getData(1));
+		par->lutg_[index] = atoi(portal->getData(2));
+		par->lutb_[index] = atoi(portal->getData(3));
+		par->lutClassName_[index] = portal->getData(4);
+	}while (portal->fetchRow());
+
+	delete portal;
+	return true;
+}
+
+bool
+TeDatabase::createSpatialIndex(const string& table, const string& columns, TeSpatialIndexType /*type*/, short /*level*/, short /*tile*/)
+{
+	string idxName = "sp_idx_" + table;
+	return createIndex(table, idxName, columns);
+}
+
+string TeDatabase::getSpatialIdxColumn(TeGeomRep rep)
+{
+	string columns = "";
+	switch(rep)
+	{
+		case TePOINTS:
+		case TeNODES:	columns = "x, y";
+						break;
+		case TeLINES:
+		case TePOLYGONS:
+		case TeCELLS:
+						columns = "lower_x, lower_y, upper_x, upper_y";
+						break;
+		case TeRASTER:
+						columns = " lower_x, lower_y, upper_x, upper_y, resolution_factor, subband ";
+						break;
+		default:		columns = "";
+	}
+	
+    return columns;
+}
+
+bool
+TeDatabase::loadLayer(TeLayer* layer, const bool& loadAttrList)
+{
+	if (layer == 0)
+		return false;
+
+	string rest;
+	if (layer->id() > 0)
+		rest = " te_layer.layer_id = "+  Te2String(layer->id());
+	else if (!layer->name().empty())
+		rest = " te_layer.name = '"+  layer->name() + "'";
+	else
+	{
+		this->errorMessage_ = "Layer procurado n�o possui nem id nem nome";
+		return false;
+	}
+	
+	string sql = " SELECT te_layer.*, "; // 0 - 9 (10 columns)
+	sql += " te_projection.*, "; // 10 - 26  (17 columns)
+	sql += " te_representation.*, "; // 27 - 41 (15 columns)
+	sql += " te_layer_table.* "; // 42 - 53 (12 columns)
+	
+	sql += " FROM (((te_layer INNER JOIN te_projection ";
+	sql += " ON te_layer.projection_id = te_projection.projection_id) ";
+	sql += " LEFT JOIN te_representation ON ";
+	sql += " te_layer.layer_id = te_representation.layer_id) ";
+	sql += " LEFT JOIN te_layer_table ON ";
+	sql += " te_layer.layer_id = te_layer_table.layer_id) ";
+
+	sql += " WHERE "+ rest;
+
+	sql += " ORDER BY te_representation.geom_type, te_layer_table.table_id ";
+
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool hasNewRow = true;
+	TeProjection* proj = 0;
+	if(!portal->getProjection(&proj, 10)) //load projection
+	{
+		delete portal;
+		return false;
+	}
+	
+	if(!portal->getLayer(*layer, 0)) //load layer
+	{
+		delete portal;
+		delete layer;
+		return false;
+	}
+	if (proj != 0)
+		layer->setProjection(proj);
+		
+	//load its representation and its tables
+	bool hasRepsTablesToThisLayer = true;
+	vector<int> loadedTableId;
+	while(hasRepsTablesToThisLayer)
+	{
+		string repId = portal->getData(27);
+		if(!repId.empty() && !layer->hasGeometry(TeGeomRep(portal->getInt(29))))
+		{
+			//load the geometry representation
+			TeRepresentation* rep = new TeRepresentation();
+			if(!portal->getRepresentation(*rep, 27))
+			{
+				delete rep;
+				delete layer;
+				delete portal;
+			}
+			layer->addVectRepres(rep);
+		}
+		
+		//load tables
+		if(find(loadedTableId.begin(), loadedTableId.end(), portal->getInt(42)) == loadedTableId.end())
+		{
+			TeTable attrTable;
+			if(portal->getAttrTable(attrTable, 42))
+			{
+				TeAttributeList attrList;
+				if(loadAttrList)
+					getAttributeList(attrTable.name(), attrList);
+				attrTable.setAttributeList(attrList);
+				layer->addAttributeTable(attrTable);
+				loadedTableId.push_back(attrTable.id());
+			}
+		}
+		
+		hasNewRow = portal->fetchRow();
+		if(!hasNewRow || portal->getInt(0)!= layer->id())
+			hasRepsTablesToThisLayer = false;
+	}
+	layer->setDatabase(this);
+	metaModel_->layerMap()[layer->id()] = layer;
+	
+	delete portal;
+	return true;
+}
+
+bool
+TeDatabase::loadLayerTable(TeLayer* layer, const bool& loadAttrList)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+	{
+		this->errorMessage_ = "N�o foi poss�vel abrir portal para o banco";
+		return false;
+	}
+	
+	// Get layer tables	
+	string get =  " SELECT * FROM te_layer_table"; 
+	get += " WHERE layer_id = " + Te2String(layer->id());
+	get += " ORDER BY attr_table_type, table_id";
+
+	if (!portal->query (get))
+	{	
+		delete portal;
+		return false;
+	}
+
+	while (portal->fetchRow())
+	{
+		TeTable attTable;
+		if(!portal->getAttrTable (attTable))
+		{
+			delete portal;
+			return false;
+		}
+		TeAttributeList attrList;
+		if(loadAttrList)
+			getAttributeList(attTable.name(), attrList);
+		attTable.setAttributeList(attrList);
+		layer->addAttributeTable(attTable);
+	}
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::layerExist(int layerId)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	string sql = "SELECT layer_id FROM te_layer WHERE layer_id = " + Te2String(layerId);
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::layerExist(string layerName)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	string sql = "SELECT name FROM te_layer WHERE " + this->toUpper("name") + " = " + this->toUpper("'" + layerName + "'");
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	delete portal;
+	return true;
+}
+
+string TeDatabase::getNewLayerName(const string& n)
+{
+	bool changed;
+	string invalidChar;
+	string name = TeCheckName(n, changed, invalidChar);
+	string newName = name;
+	
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return "";
+	
+	bool flag = true;
+	int count = 0;
+	while(flag)
+	{
+		portal->freeResult();
+		string q = "SELECT name FROM te_layer WHERE " + this->toUpper("name") + " = '" + TeConvertToUpperCase(newName) + "'";
+		if(portal->query(q) && portal->fetchRow())
+		{
+			// there is already this theme name 
+			newName = newName+"_"+Te2String(count);
+			++count;
+			flag = true;
+         }
+		else
+			flag = false; //found the new name
+	}
+	delete portal;
+	return newName;
+}
+
+bool
+TeDatabase::deleteLayer(int layerId)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+	
+	string sql = "SELECT projection_id FROM te_layer WHERE layer_id = ";
+	sql += Te2String(layerId);
+
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	string projId = portal->getData("projection_id");
+	portal->freeResult();
+
+	// Get all representations that are associated to this layer
+	sql = "SELECT * FROM te_representation WHERE layer_id = "+ Te2String(layerId);
+	if (!portal->query (sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	while (portal->fetchRow())
+	{	
+		// Save the name of the geometry table
+		string geomTable = portal->getData("geom_table");
+
+		// Delete lut table
+		TeGeomRep rep = TeGeomRep(portal->getInt("geom_type"));
+		if (rep == TeRASTER || rep == TeRASTERFILE)
+		{
+			if(!this->tableExist(geomTable))
+			{
+				continue;
+			}
+
+			TeDatabasePortal* portal2 = this->getPortal();
+			sql = "SELECT lut_table, raster_table FROM " + geomTable;
+			string tabName;
+			if (!portal2->query (sql))
+			{
+				delete portal2;
+				continue;
+			}
+
+			while (portal2->fetchRow())
+			{
+				// remove lut table
+				tabName = portal2->getData(0);
+				if (!tabName.empty() && this->tableExist(tabName))
+				{
+					sql = "DROP TABLE " + tabName;
+					this->execute(sql);
+				}
+				// remove raster table
+				tabName = portal2->getData(1);
+				if (!tabName.empty() && this->tableExist(tabName))
+				{
+					sql = "DROP TABLE " + tabName;
+					this->execute(sql);
+				}
+			}
+			delete portal2;
+			// remove raster metadata table
+			tabName = geomTable + "_metadata";
+			if (!tabName.empty() && this->tableExist(tabName))
+			{
+				sql = "DROP TABLE " + tabName;
+				this->execute(sql);
+			}
+		}
+		if (this->tableExist(geomTable))
+		{
+			sql = "DROP TABLE " + geomTable;
+			if (!this->execute(sql) )
+			{
+				delete portal;
+				return false;
+			}
+		}
+	}
+	portal->freeResult();
+
+	if (existRelation("te_representation","fk_rep_layer_id") != TeRICascadeDeletion)
+	{
+		// Delete entries into representations table
+		sql = "DELETE FROM te_representation WHERE layer_id = " +Te2String(layerId);
+		if (!this->execute(sql) )
+		{
+			delete portal;
+			return false;
+		}
+	}
+
+	// delete layer themes
+	sql = "SELECT theme_id FROM te_theme WHERE layer_id=" + Te2String(layerId);
+	if (!portal->query (sql))
+	{
+		delete portal;
+		return false;
+	}
+	
+	int themeId;
+	while (portal->fetchRow())
+	{	
+		themeId = portal->getInt("theme_id");
+		this->deleteTheme(themeId);
+	}
+
+	//Delete attributes tables
+	if(!deleteLayerTable(layerId))
+		return false;
+	
+	sql = "DELETE FROM te_layer WHERE layer_id=" + Te2String(layerId);
+	if (!this->execute(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	// delete layer projection
+	sql = "DELETE FROM te_projection WHERE projection_id = "+ projId;
+	if (!this->execute(sql))
+	{	
+		delete portal;
+		return false;
+	}
+
+	// remove all the items� themes associated to the layer to be removed
+	TeThemeMap::iterator it;
+	for (it = metaModel_->themeMap().begin(); it != metaModel_->themeMap().end();)
+	{
+		if(it->second->getProductId() != TeTHEME)
+		{
+			++it;
+			continue;
+		}
+		TeTheme *theme = static_cast<TeTheme*> (it->second);
+		++it;
+		if (theme && theme->layer() && (theme->layer()->id() == layerId))
+		{
+			metaModel_->themeMap().erase(theme->id());
+			delete theme;
+		}
+	}
+	// delete layer and its entry in the layer map
+	TeLayer* layer = metaModel_->layerMap()[layerId];
+	metaModel_->layerMap().erase(layerId);
+	delete layer;
+
+	delete portal;
+	return true;
+}
+
+
+bool
+TeDatabase::deleteLayerTable (int layerId, TeAttrTableType ttype)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+
+	//tables of the type 1 can be relationed with other layer ??? Conferir
+	string query = "SELECT attr_table, table_id FROM te_layer_table WHERE layer_id = " + Te2String(layerId);
+	query += " AND attr_table_type = " + Te2String(static_cast<int>(ttype));
+	if(!portal->query(query))
+	{
+		delete portal;
+		return false;
+	}
+		
+	vector<int> tableIds;
+	string attrTable;
+	string tableId;
+	string drop;
+	while (portal->fetchRow())
+	{
+		attrTable = portal->getData(0);
+		tableId = portal->getData(1);
+		if(tableExist(attrTable))
+		{
+			if(!deleteTable(attrTable))
+			{
+				delete portal;
+				return false;
+			}
+		}
+		tableIds.push_back(atoi(tableId.c_str()));
+
+		if(tableExist("te_address_locator"))
+		{
+			string del  = "DELETE FROM te_address_locator WHERE table_id = "+ tableId;
+			execute(del);
+		}
+	}
+
+	delete portal;
+	string del;
+	if (existRelation("te_tables_relation","fk_tabrelation_laytable_id") != TeRICascadeDeletion)
+	{
+		for (unsigned int i=0; i<tableIds.size();i++)
+		{
+			del = "DELETE FROM te_tables_relation WHERE relation_id = " + Te2String(tableIds[i]);
+			if (!execute (del))
+				return false;
+		}
+	}
+	del = "DELETE FROM te_layer_table WHERE layer_id = " + Te2String(layerId);
+	if (!execute (del))
+		return false;
+	return true;
+}
+
+bool 
+TeDatabase::updateRepresentation (int layerId, TeRepresentation& rep)
+{
+	if (layerId <= 0)
+		return false;
+
+	string sql;
+	sql  = "UPDATE te_representation SET ";
+	sql += " lower_x= " + Te2String(rep.box_.x1(),15);
+	sql += ", lower_y= " + Te2String(rep.box_.y1(),15);
+	sql += ", upper_x= " + Te2String(rep.box_.x2(),15);
+	sql += ", upper_y= " + Te2String(rep.box_.y2(),15);
+	sql += ", description= '" + rep.description_ + "'";
+	sql += ", res_x= " + Te2String(rep.resX_,15);
+	sql += ", res_y= " + Te2String(rep.resY_,15);
+	sql += ", num_cols=" + Te2String(rep.nCols_);
+	sql += ", num_rows=" + Te2String(rep.nLins_);
+
+	if (rep.geomRep_ != TeTEXT)
+		sql += ", geom_table='" + rep.tableName_ + "'";
+
+	sql += " WHERE layer_id=" + Te2String(layerId);
+	sql += " AND geom_type= " + Te2String(rep.geomRep_);
+
+	if (rep.geomRep_ == TeTEXT)
+		sql += " AND geom_table='" + rep.tableName_ + "'";
+
+	return this->execute(sql);
+}
+
+bool 
+TeDatabase::insertRasterGeometry(const string& tableName, TeRasterParams& par, const string& objectId)
+{
+	if (tableName.empty())
+		return false;
+	
+	string objId; 
+	if (objectId.empty())
+		objId = "O1";
+	else
+		objId = objectId;
+
+	//------ this check is made for compatibility reasons with old versions of TerraLib databases
+	TeAttributeRep	attrRep;
+	attrRep.name_ = "tiling_type";
+	attrRep.type_ = TeINT;
+		
+	TeAttribute att;
+	if(!columnExist(tableName, attrRep.name_,att))
+	{
+		addColumn (tableName, attrRep);
+		string sql = "UPDATE " + tableName + " SET tiling_type = " + Te2String(static_cast<int>(TeRasterParams::TeExpansible));
+		this->execute(sql);
+	}
+
+	//------
+
+	// finds the name of the raster geometry table
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+
+	TeBox box = par.boundingBox();
+
+	string ins = "INSERT INTO " + tableName + " (object_id, raster_table, lut_table, ";
+	ins += "res_x, res_y, num_bands, num_cols, num_rows, block_height, block_width, ";
+	ins += "lower_x, lower_y, upper_x, upper_y, tiling_type) ";
+	ins += " VALUES ('" + objId + "', '" + par.fileName_+ "', '" +  par.lutName_ + "', ";
+	ins += Te2String(par.resx_) + ", " + Te2String(par.resy_) + ", ";
+	ins += Te2String(par.nBands()) + ", " + Te2String(par.ncols_) + ", " + Te2String(par.nlines_) + ", ";
+	ins += Te2String(par.blockHeight_) + ", " + Te2String(par.blockWidth_) + ", ";
+	ins += Te2String(box.x1_,15) +", " + Te2String(box.y1_,15) + ", ";
+	ins += Te2String(box.x2_,15) +", " + Te2String(box.y2_,15) + ", ";
+	ins	+= Te2String(par.tiling_type_) + ")";
+	if (!this->execute(ins))
+	{
+		delete portal;
+		return false;
+	}
+
+	// save the pallete associated to the raster
+	// if it doesn�t exist yet
+	if (par.photometric_[0] == TeRasterParams::TePallete && !par.lutName_.empty()) 
+	{
+		 if (!this->tableExist(par.lutName_))
+		 {
+			 if (this->createLUTTable(par.lutName_))
+			{
+				for (unsigned int i=0; i<par.lutb_.size(); i++)
+				{
+					string sql = "INSERT INTO " + par.lutName_ + " VALUES(";
+					sql += Te2String(i) + ", ";
+					sql += Te2String(par.lutr_[i]) + ", ";
+					sql += Te2String(par.lutg_[i]) + ", ";
+					sql += Te2String(par.lutb_[i]) + ", '";
+					sql += par.lutClassName_[i] + "')";
+					this->execute(sql);
+				}
+			 }
+		 }
+	}
+	
+	ins = "SELECT geom_id FROM " + tableName + " WHERE object_id='" + objId + "'";
+	ins += " AND raster_table='" + par.fileName_+ "'";
+	if(!portal->query(ins) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	int geomId = atoi(portal->getData(0));
+	delete portal;
+	string 	metadataTableName = tableName+"_metadata";
+	insertRasterMetadata(metadataTableName, geomId,par);
+	 return true;
+}
+
+bool 
+TeDatabase::updateRasterRepresentation(int layerId, TeRasterParams& par, const string& objectId)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+
+	string sql = "SELECT repres_id, lower_x, lower_y, upper_x, upper_y, geom_table ";
+	sql += " FROM te_representation WHERE layer_id= " + Te2String(layerId);
+	sql += " AND geom_type= " + Te2String(TeRASTER);
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	TeBox box (portal->getDouble(1),portal->getDouble(2),
+		       portal->getDouble(3),portal->getDouble(4));
+	int represId = atoi(portal->getData(0));
+	string rasterrep = portal->getData(5);
+	portal->freeResult();
+
+	updateBox(box,par.boundingBox());
+	sql = "UPDATE te_representation SET lower_x = " + Te2String(box.x1_,15);
+	sql += ", lower_y = " + Te2String(box.y1_,15) + ", upper_x = " + Te2String(box.x2_,15);
+	sql += ", upper_y = " + Te2String(box.y2_,15);
+
+	if(par.date_.isValid())
+	{	
+		std::string sqlTime = getSQLTime(par.date_);
+		if(!sqlTime.empty())
+		{
+			sql += ", initial_time = " + sqlTime;
+			sql += ", final_time = " + sqlTime;
+		}
+	}
+	sql += " WHERE repres_id=" + Te2String(represId);
+	if(!execute(sql))
+	{
+		delete portal;
+		return false;
+	}	 
+
+	string objId; 
+	if (objectId.empty())
+		objId = "O1";
+	else
+		objId = objectId;
+
+	box = par.boundingBox();
+
+	sql = "UPDATE " + rasterrep + " SET lut_table ='" + par.lutName_ + "'";
+	sql += ", res_x= " + Te2String(par.resx_,15) + ", res_y=" + Te2String(par.resy_,15);
+	sql += ", num_bands=" + Te2String(par.nBands()) + ", num_cols=" + Te2String(par.ncols_);
+	sql += ", num_rows=" + Te2String(par.nlines_) + ", block_height=" +  Te2String(par.blockHeight_);
+	sql += ", block_width= " + Te2String(par.blockWidth_) + ", lower_x = " + Te2String(box.x1_,15);
+	sql += ", lower_y = " + Te2String(box.y1_,15) +  ", upper_x = " + Te2String(box.x2_,15);
+	sql += ", upper_y = " + Te2String(box.y2_,15);
+	sql += "  WHERE object_id='" + objId + "' AND raster_table='" + par.fileName_ + "'";
+	if (!this->execute(sql))
+	{
+		delete portal;
+		return false;
+	}
+	
+	sql = "SELECT geom_id FROM " + rasterrep + " WHERE object_id='" + objId + "'";
+	sql+= " AND raster_table='" + par.fileName_+ "'";
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	// save the pallete associated to the raster
+	// if it doesn�t exist yet
+	if (par.photometric_[0] == TeRasterParams::TePallete && !par.lutName_.empty()) 
+	{
+
+		 if (!this->tableExist(par.lutName_))
+		 {
+			 if (this->createLUTTable(par.lutName_))
+			{
+				for (unsigned int i=0; i<par.lutb_.size(); i++)
+				{
+					string sql = "INSERT INTO " + par.lutName_ + " VALUES(";
+					sql += Te2String(i) + ", ";
+					sql += Te2String(par.lutr_[i]) + ", ";
+					sql += Te2String(par.lutg_[i]) + ", ";
+					sql += Te2String(par.lutb_[i]) + ", '";
+					sql += par.lutClassName_[i] + "')";
+					if (!this->execute(sql) )	
+					{
+						delete portal;
+						return false;						
+					}
+				}
+			 }
+		 }
+	}
+
+	int geomId = atoi(portal->getData(0));
+	delete portal;
+	string metadatatabel = rasterrep + "_metadata";
+	return updateRasterMetadata(metadatatabel,geomId,par);
+}
+
+bool 
+TeDatabase::insertRasterMetadata (const string& tableName, int geomId, TeRasterParams& par)
+{
+	if (geomId <= 0)
+		return false;
+	
+	string ins;
+	unsigned int i;
+
+	unsigned int nb = par.nBands();
+	ins = "INSERT INTO " + tableName + " (geom_id, band_id, min_value, max_value, ";
+	ins += " num_bits, data_type, photometric_type, compression_type, band_name ) VALUES (";
+	string vals;
+	for (i=0; i<nb; i++)
+	{
+		vals = Te2String(geomId) + ", " + Te2String(i) + ", ";
+		vals += Te2String(par.vmin_[i]) + ", " +  Te2String(par.vmax_[i]) + ", ";
+		vals += Te2String(par.nbitsperPixel_[i]) + ", " +  Te2String(par.dataType_[i]) + ", " ;
+		vals += Te2String(par.photometric_[i]) + ", " +  Te2String(par.compression_[i]) + ", '" + par.bandName_[i] + "' )" ;
+		string sql = ins + vals;
+		if (!this->execute(sql))
+			return false;
+	}
+
+	// update dummy value
+	if (par.useDummy_)
+	{
+		ins = "UPDATE " + tableName + " SET dummy = ";
+		for (i=0; i<nb; i++)
+		{
+			vals = Te2String(par.dummy_[i]) + " WHERE geom_id = " +  Te2String(geomId);
+			vals += " AND band_id=" + Te2String(i);
+			string sql = ins + vals;
+			if (!this->execute(sql))
+				return false;
+		}
+	}
+	return true;
+}
+
+bool 
+TeDatabase::updateRasterMetadata (const string& tableName, int geomId, TeRasterParams& par)
+{
+	if (geomId <= 0)
+		return false;
+
+	string sql = "DELETE FROM " + tableName + " WHERE geom_id = " + Te2String(geomId);
+	if (!this->execute (sql))
+		return false;
+	return insertRasterMetadata(tableName,geomId,par);
+}
+
+bool 
+TeDatabase::updateLegend (TeLegendEntry *legend)
+{
+	if (!legend)
+		return false;
+
+	string sql;
+	if (legend->id() > 0 )
+	{
+		sql = "UPDATE te_legend SET ";
+		sql += " theme_id=" + Te2String (legend->theme());
+		sql += ",group_id=" + Te2String (legend->group());
+		sql += ",num_objs=" + Te2String (legend->count());
+		sql += ",lower_value='" + escapeSequence(legend->from())+"'";
+		sql += ",upper_value='" + escapeSequence(legend->to())+"'";
+		sql += ",label='" + escapeSequence(legend->label())+"'";
+		sql += " WHERE legend_id=" + Te2String (legend->id());
+
+		if (execute(sql) == false)
+			return false;
+	}
+	else
+	{
+		if (!insertLegend(legend))
+			return false;
+	}
+	metaModel_->legendMap()[legend->id()] = legend;
+
+	return updateVisual(legend);
+}
+
+bool 
+TeDatabase::updateLegend (vector<TeLegendEntry>& legVec)
+{
+	unsigned int i;
+	for (i = 0; i < legVec.size(); ++i)
+	{
+		if(!updateLegend(&legVec[i]))
+			return false;
+	}
+	return true;
+}
+
+bool
+TeDatabase::updateVisual(TeLegendEntry *legend)
+{
+	if (!legend)
+		return false;
+
+	TeGeomRepVisualMap& mapVis = legend->getVisualMap();
+	TeGeomRepVisualMap::iterator it =  mapVis.begin();
+	while ( it != mapVis.end())
+	{ 
+			
+		TeGeomRep rep = it->first;
+		TeVisual* vis = it->second;
+
+		TeColor cor = vis->color();				// filling color
+		TeColor contourCor = vis->contourColor();// contour color
+
+		string update = "UPDATE te_visual SET ";
+		update += "red = "+ Te2String(cor.red_) + ", ";
+		update += "green =" + Te2String(cor.green_) + ", ";
+		update += "blue =" + Te2String(cor.blue_) + ", ";
+		update += "transparency =" + Te2String(vis->transparency()) + ", ";
+		update += "contour_red=" + Te2String(contourCor.red_) + ", ";
+		update += "contour_green=" + Te2String(contourCor.green_) + ", ";
+		update += "contour_blue=" + Te2String(contourCor.blue_) + ", "; 
+		update += "contour_transp=" + Te2String(vis->contourTransparency()) + ", ";
+		update += "contour_width=" + Te2String(vis->contourWidth()) + ", ";
+
+		if(rep == TePOLYGONS)
+		{
+			update += "width=" + Te2String(vis->contourWidth()) + ", ";
+			update += "contour_symb_id=" + Te2String(vis->contourStyle()) + ", ";
+			update += "symb_id=" + Te2String(vis->style()) + ", ";
+		}
+		else if(rep == TeLINES)
+		{
+			update += "width=" + Te2String(vis->width()) + ", ";
+			update += "symb_id=" + Te2String(vis->style()) + ", ";
+		}
+		else if(rep == TePOINTS)
+		{
+			update += "size_value=" + Te2String(vis->size()) + ", ";
+			update += "symb_id=" + Te2String(vis->style ()) + ", ";
+		}
+		else if(rep == TeTEXT)
+		{
+			update += "size_value=" + Te2String(vis->size()) + ", ";
+			update += "pt_angle=" + Te2String(vis->ptAngle()) + ", ";
+		}
+
+		update += "family='" + vis->family() + "', ";
+		if (vis->bold())
+			update += "bold=1, ";
+		else
+			update += "bold=0, ";
+
+		if (vis->italic())
+			update += "italic=1, ";
+		else
+			update += "italic=0, ";
+
+		update += "fixed_size=" + Te2String(vis->fixedSize())+ ", ";
+		update += "alignment_vert=" + Te2String(vis->alignmentVert())+ ", ";
+		update += "alignment_horiz=" + Te2String(vis->alignmentHoriz())+ ", ";
+		update += "tab_size=" + Te2String(vis->tabSize())+ ", ";
+		update += "line_space=" + Te2String(vis->lineSpace());
+
+		update += " WHERE legend_id= " + Te2String(legend->id()) ;
+		update += " AND geom_type= " + Te2String(rep);
+
+		if (!execute(update))
+			return false;
+		++it;
+	}
+	return true;
+}
+
+bool
+TeDatabase::updateVisual(vector<TeLegendEntry>& legVec)
+{
+	unsigned int i;
+
+	// Update the te_visual table
+	TeTable visualTable;
+	selectTable("te_visual", "1=0", visualTable);
+	TeAttributeList& visualAttrList = visualTable.attributeList();
+	TeAttribute& visualAttr0 = visualAttrList[0];		// legend_id
+	visualAttr0.rep_.isPrimaryKey_ = true;
+	visualAttr0.rep_.isAutoNumber_ = false;
+	TeAttribute& visualAttr1 = visualAttrList[1];		// geom_type
+	visualAttr1.rep_.isPrimaryKey_ = true;
+	visualAttr1.rep_.isAutoNumber_ = false;
+
+	TeGeomRepVisualMap::iterator it;
+	for (i = 0; i < legVec.size(); ++i)
+	{
+		TeLegendEntry& leg = legVec[i];
+		for (it = leg.getVisualMap().begin(); it != leg.getVisualMap().end(); ++it)
+		{
+			string style, contourStyle, sizeValue, width;
+			int geomRep = it->first;
+			int legId = leg.id();
+			TeVisual* visual = it->second;
+			TeTableRow row;
+
+			if(geomRep == TePOLYGONS || geomRep == TeCELLS)
+			{
+				sizeValue = Te2String(0);
+				contourStyle = Te2String(visual->contourStyle());
+				width =  Te2String(0);
+				style = Te2String(it->second->style());
+			}
+			else if(geomRep == TeLINES)
+			{
+				sizeValue = Te2String(0);
+				contourStyle = Te2String(0);
+				width = Te2String(visual->width());
+				style = Te2String(visual->style());
+			}
+			else if(geomRep == TePOINTS)
+			{
+				sizeValue = Te2String(visual->size());
+				contourStyle = Te2String(0);
+				width = Te2String(0);
+				style = Te2String(visual->style());
+			}
+			else if(geomRep == TeTEXT)
+			{
+				sizeValue = Te2String(visual->size());
+				contourStyle = Te2String(0);
+				width = Te2String(0);
+				style = Te2String(0);
+			}
+		
+			row.push_back(Te2String(legId));						// legend_id
+			row.push_back(Te2String(geomRep));						// geom_type
+			row.push_back(style);									// symb_id
+			row.push_back(Te2String(visual->color().red_));			// red
+			row.push_back(Te2String(visual->color().green_));		// green
+			row.push_back(Te2String(visual->color().blue_));			// blue
+			row.push_back(Te2String(visual->transparency()));		// transparency
+			row.push_back(width);									// width
+			row.push_back(contourStyle);							// contour_symb_id
+			row.push_back(Te2String(visual->contourColor().red_));	// contour_red
+			row.push_back(Te2String(visual->contourColor().green_));	// contour_green
+			row.push_back(Te2String(visual->contourColor().blue_));	// contour_blue
+			row.push_back(Te2String(visual->contourTransparency()));	// contour_transp
+			row.push_back(Te2String(visual->contourWidth()));		// contour_width
+			row.push_back(sizeValue);								// size_value
+			row.push_back(Te2String(visual->ptAngle()));				// pt_angle
+			row.push_back(visual->family());							// family
+			if (visual->bold())										// bold
+				row.push_back("1");
+			else
+				row.push_back("0");
+			if (visual->italic())									// italic
+				row.push_back("1");
+			else
+				row.push_back("0");
+
+			row.push_back(Te2String(visual->alignmentVert()));		// alignment_vert
+			row.push_back(Te2String(visual->alignmentHoriz()));		// alignment_horiz
+			row.push_back(Te2String(visual->tabSize()));				// tab_size
+			row.push_back(Te2String(visual->lineSpace()));			// line_space
+
+			if (visual->fixedSize())									// fixed_size
+				row.push_back("1");
+			else
+				row.push_back("0");
+
+			visualTable.add(row);
+		}
+	}
+	return insertTable(visualTable);
+}
+
+bool 
+TeDatabase::loadLegend (TeAbstractTheme *theme, const string& visualType)
+{
+	if (!theme)
+		return false;
+	
+	theme->cleanLegend();
+
+	string rest;
+	if (theme->id() > 0)
+		rest = " te_theme.theme_id = "+  Te2String(theme->id());
+	else if (!theme->name().empty())
+		rest = " te_theme.name = '"+  theme->name() + "'";
+	else
+		return false;
+	
+	//load legend and visual
+	string sql = " SELECT ";
+	sql += " te_legend.*,  "; // 0 - 6  (7 columns)
+	sql += " te_visual.*  "; //  7		(24 columns)
+	sql += " FROM ((te_theme LEFT JOIN te_legend ON te_theme.theme_id = te_legend.theme_id ) ";
+	sql += " LEFT JOIN te_visual ON te_legend.legend_id = te_visual.legend_id ) ";
+	sql += " WHERE "+ rest;
+	sql += " ORDER BY te_legend.legend_id, te_legend.group_id, te_visual.geom_type  "; 
+
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+	
+	if (!portal->query(sql) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	//load all legends of this theme
+	//and its visual
+	bool hasLegsToThisTheme = true;
+	bool hasNewRow = true;
+	while(hasLegsToThisTheme)
+	{
+		//legend
+		TeLegendEntry legend;
+		if(!portal->getLegend(legend, 0))
+		{
+			delete portal;
+			return false;
+		}
+
+		//visual
+		bool hasVisualToThisLeg = true;
+		while(hasVisualToThisLeg)
+		{
+			TeVisual* visual = TeVisualFactory::make(visualType);
+			TeGeomRep geomRep;
+			if(portal->getVisual(visual, geomRep, 7))
+				legend.setVisual(visual, geomRep);
+								
+			hasNewRow = portal->fetchRow();
+			if(!hasNewRow || portal->getInt(2)!= legend.group() || portal->getInt(0)!= legend.id())
+				hasVisualToThisLeg = false;
+		}
+
+		//Set legend to this theme
+		theme->legend(legend); 
+														
+		//fill legend buffer
+		if(legend.group() == -6)	
+			metaModel_->legendMap()[legend.id()] = &theme->queryAndPointingLegend();
+		else if(legend.group() == -5)	
+			metaModel_->legendMap()[legend.id()] = &theme->queryLegend(); 
+		else if (legend.group() == -4)
+			metaModel_->legendMap()[legend.id()] = &theme->pointingLegend(); 
+		else if (legend.group() == -3)
+			metaModel_->legendMap()[legend.id()] = &theme->defaultLegend(); 
+		else if (legend.group() == -2)
+			metaModel_->legendMap()[legend.id()] = &theme->withoutDataConnectionLegend(); 
+		else if (legend.group() == -1)
+			metaModel_->legendMap()[legend.id()] = &theme->outOfCollectionLegend(); 
+		else if (legend.group() == -10) //own legend
+		{
+			TeLegendEntry* legendTemp = new TeLegendEntry(legend);
+			metaModel_->legendMap()[legend.id()] = legendTemp;
+		}
+		
+		if(!hasNewRow || portal->getInt(0)!= theme->id())
+			hasLegsToThisTheme = false;
+	}
+			
+	for (unsigned int i = 0; i < theme->legend().size(); ++i)
+		metaModel_->legendMap()[theme->legend()[i].id()] = &theme->legend()[i];
+
+	delete portal;
+	return true;
+}
+
+
+bool 
+TeDatabase::updateProjection (TeProjection *proj)
+{
+	if (proj->id() <= 0)
+		return false;
+	string sql;
+	sql = "UPDATE te_projection SET ";
+	sql += "name='" + proj->name() + "',";
+	sql += " long0=" + Te2String(proj->params().lon0*TeCRD,15)+ ",";
+	sql += " lat0=" + Te2String(proj->params().lat0*TeCRD,15) + ",";
+	sql += " offx=" +Te2String(proj->params().offx,15) + ",";
+	sql += " offy=" +Te2String(proj->params().offy,15) + ",";
+	sql += " stlat1="+ Te2String(proj->params().stlat1*TeCRD,15) + ",";
+	sql += " stlat2=" +Te2String(proj->params().stlat2*TeCRD,15) + ",";
+	sql += " unit='" + proj->params().units + "',";
+	sql += " scale=" + Te2String(proj->params().scale) + ",";
+	sql += " hemis=" + Te2String(proj->params().hemisphere) + ",";
+	sql += " datum='" + proj->datum().name() + "',";
+	sql += " radius=" + Te2String(proj->datum().radius(),15) + ",";
+	sql += " flattening=" + Te2String(proj->datum().flattening(),15) + ",";
+	sql += " dx=" + Te2String(proj->datum().xShift(),15) + ",";
+	sql += " dy=" + Te2String(proj->datum().yShift(),15) + ",";
+	sql += " dz=" + Te2String(proj->datum().zShift(),15) ;
+	sql += " WHERE projection_id = " + Te2String(proj->id());
+	return this->execute(sql);
+}
+
+TeProjection* 
+TeDatabase::loadProjection (int projId)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	string sql ="SELECT * FROM te_projection WHERE projection_id = " + Te2String (projId);
+
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return 0;
+	}
+
+	// Look for the projection
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return 0;
+	}
+
+	TeProjection* proj = 0;
+	if(!portal->getProjection(&proj))
+	{
+		if(proj)
+			delete proj;
+		delete portal;
+		return 0;
+	}
+
+	delete portal;
+	return proj;
+}
+
+bool
+TeDatabase::insertPolygonSet(const string& table, TePolygonSet &ps)
+{
+	if (!beginTransaction())
+		return false;
+	for (unsigned int i = 0; i < ps.size(); i++ )
+	{
+		TePolygon& poly = ps [i];
+		if (!insertPolygon (table,poly))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::updatePolygonSet (const string& table, TePolygonSet &ps)
+{
+ 	if (!beginTransaction())
+		return false;
+	for (unsigned int i = 0; i < ps.size(); i++ )
+	{
+		TePolygon& poly = ps [i];
+		if (!updatePolygon (table,poly))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::selectPolygonSet (const string& table, const string& criteria, TePolygonSet &ps)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	string sql ="SELECT * FROM " + table;
+	if (!criteria.empty())
+		sql += " WHERE " + criteria;
+	sql += " ORDER BY object_id ASC, parent_id, num_holes DESC, ext_max ASC";
+	 
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		ps.add(poly);
+	}
+	while (flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::loadPointSet(TeTheme* theme, TePointSet &ps)
+{
+	string collTable = theme->collectionTable();
+	if (collTable.empty())
+		return false;
+
+	TeLayer* themeLayer = theme->layer();
+	if (!themeLayer->hasGeometry(TePOINTS))
+		return false;
+	
+	string pointTable = themeLayer->tableName(TePOINTS);
+	if (pointTable.empty())
+		return false;
+
+	string sql = "SELECT * FROM (" + pointTable + " RIGHT JOIN " + collTable;
+	sql = sql + " ON " + pointTable + ".object_id = " + collTable + ".c_object_id)";
+
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	if (!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do {
+		TePoint pt;
+		flag =  portal->fetchGeometry(pt);
+		ps.add(pt);
+	}
+	while (flag);
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::loadLineSet(TeTheme* theme, TeLineSet &ls)
+{
+	string collTable = theme->collectionTable();
+	if (collTable.empty())
+		return false;
+
+	TeLayer* themeLayer = theme->layer();
+	if (!themeLayer->hasGeometry(TeLINES))
+		return false;
+	
+	string lineTable = themeLayer->tableName(TeLINES);
+	if (lineTable.empty())
+		return false;
+
+	string sql = "SELECT * FROM (" + lineTable + " RIGHT JOIN " + collTable;
+	sql = sql + " ON " + lineTable + ".object_id = " + collTable + ".c_object_id)";
+
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	if (!portal->query(sql)  || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag;
+	do 
+	{
+		TeLine2D lin;
+		flag = portal->fetchGeometry(lin);
+		ls.add(lin);
+	}while(flag);
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::loadPolygonSet (const string& table, const string& geoid, TePolygonSet &ps)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	string q ="SELECT * FROM " + table;
+
+	if (!geoid.empty())
+		q += " WHERE object_id = '" + geoid +"'";
+	q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
+
+	if (!portal->query(q))
+	{	
+		delete portal;
+		return false;
+	}
+
+	if (!portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		ps.add(poly);
+	}
+	while (flag);
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::loadPolygonSet (const string& table, TeBox &bb, TePolygonSet &polSet)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	string q;
+	q = "SELECT * FROM " + table + " WHERE ";
+	q += this->getSQLBoxWhere (bb, TePOLYGONS, table);
+	q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		polSet.add(poly);
+	}
+	while (flag);
+	delete portal;
+	return true;
+}
+
+TeDatabasePortal* 
+TeDatabase::loadPolygonSet(const string& table, TeBox &box)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return 0;
+
+	string q;
+	q = "SELECT * FROM " + table + " WHERE ";
+	q += this->getSQLBoxWhere (box, TePOLYGONS, table);
+	q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return 0;
+	}
+	else 
+		return portal;
+}
+
+
+bool 
+TeDatabase::locatePolygon (const string& table, TeCoord2D &pt, TePolygon &polygon, const double& tol)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+
+	string q = "SELECT * FROM " + table + " WHERE " + getSQLBoxWhere(box, TePOLYGONS, table);
+	q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		if (TeWithin (TePoint(pt), poly))
+		{
+			polygon = poly;
+			delete portal;
+			return true;
+		}
+	}
+	while (flag);
+	delete portal;
+	return false;
+}
+
+
+bool 
+TeDatabase::locatePolygonSet (const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+
+	string q;
+	q = "SELECT * FROM " + table + " WHERE lower_x < " + Te2String(box.x2(),6);
+	q += " AND upper_x > " + Te2String(box.x1(),6);
+	q += " AND lower_y < " + Te2String(box.y2(),6);
+	q += " AND upper_y > " + Te2String(box.y1(),6);
+	q += " ORDER BY parent_id, num_holes DESC, ext_max ASC";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	bool flag = true;
+	polygons.clear();
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		if (TeWithin (TePoint(pt), poly))
+			polygons.add(poly);
+	}
+	while (flag);
+	delete portal;
+
+	if(polygons.size())
+		return (true);
+	return false;
+}
+
+bool 
+TeDatabase::loadPolygonSet(TeTheme* theme, TePolygonSet &ps)
+{
+	string collTable = theme->collectionTable();
+	if (collTable.empty())
+		return false;
+
+	TeLayer* themeLayer = theme->layer();
+	if (!themeLayer->hasGeometry(TePOLYGONS))
+		return false;
+	
+	string polygonTable = themeLayer->tableName(TePOLYGONS);
+	if (polygonTable.empty())
+		return false;
+
+	string sql = "SELECT * FROM (" + polygonTable + " RIGHT JOIN " + collTable;
+	sql = sql + " ON " + polygonTable + ".object_id = " + collTable + ".c_object_id)";
+	sql += " ORDER BY " + polygonTable + ".parent_id, ";
+	sql += polygonTable + ".num_holes DESC, " + polygonTable + ".ext_max ASC";
+
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	if (!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+		ps.add ( poly );
+	}
+	while (flag);		
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::insertLineSet	(const string& table, TeLineSet &ls)
+{
+	if (!beginTransaction())
+		return false;
+
+	for (unsigned int i = 0; i < ls.size(); i++ )
+	{
+		TeLine2D& line = ls [i];
+		if (!insertLine (table,line))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::updateLineSet	(const string& table, TeLineSet &ls)
+{
+	if (!beginTransaction())
+		return false;
+
+	for (unsigned int i = 0; i < ls.size(); i++ )
+	{
+		TeLine2D line = ls [i];
+		if (!updateLine (table,line))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::loadLineSet (const string& table, const string& geoid, TeLineSet &ls)
+{
+	TeDatabasePortal *portal = this->getPortal();
+
+	string q ="SELECT * FROM " + table;
+
+	if (!geoid.empty())
+		q += " WHERE object_id = '" + geoid +"'";
+
+	q += " ORDER BY ext_max DESC";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		TeLine2D line;
+		flag = portal->fetchGeometry(line);
+		ls.add ( line );
+	}while(flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::loadLineSet (const string& table, TeBox &bb, TeLineSet &linSet)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	string q;
+	q = "SELECT * FROM " + table + " WHERE ";
+	q += this->getSQLBoxWhere (bb, TeLINES, table);
+	q += " ORDER BY ext_max DESC";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	bool flag = true;
+	do
+	{
+		TeLine2D lin;
+		flag = portal->fetchGeometry(lin);
+		linSet.add(lin);
+	}
+	while (flag);
+	delete portal;
+	return true;
+}
+
+TeDatabasePortal* 
+TeDatabase::loadLineSet (const string& table, TeBox &box)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return 0;
+
+	string q;
+	q = "SELECT * FROM " + table + " WHERE ";
+	q += this->getSQLBoxWhere (box, TeLINES, table);
+	q += " ORDER BY ext_max DESC";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return 0;
+	}
+	return portal;
+}
+
+bool 
+TeDatabase::selectLineSet (const string& table, const string& criteria, TeLineSet &ls)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	string q ="SELECT * FROM " + table;
+	if (!criteria.empty())
+		q += " WHERE " + criteria;
+	q += " ORDER BY object_id ASC, geom_id ASC";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		TeLine2D line;
+		flag = portal->fetchGeometry(line);
+		ls.add ( line );
+	}while(flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::locateLine (const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	string q ="SELECT * FROM " + table;
+	char buf [1024];
+	sprintf (buf," WHERE lower_x < %f AND upper_x > %f AND lower_y < %f AND upper_y > %f",
+		box.x2(),box.x1(),box.y2(),box.y1());
+	q += buf;
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	// Get all lines
+	TeLineSet ls;
+	int k;
+	bool flag = true;
+	do 
+	{
+		TeLine2D l;
+		flag = portal->fetchGeometry( l );
+		ls.add ( l );
+	} while (flag);
+
+	delete portal;
+
+	TeCoord2D paux;
+
+	if (TeNearest (pt, ls, k, paux, tol))
+	{
+		line = ls[k];
+		return true;
+	}
+	return false;
+}
+
+bool 
+TeDatabase::insertPointSet	(const string& table, TePointSet &ps)
+{
+	if (!beginTransaction())
+		return false;
+
+	for (unsigned int i = 0; i < ps.size(); i++ )
+	{
+		TePoint& point = ps [i];
+		if (!insertPoint (table,point))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::updatePointSet (const string& table, TePointSet &ps)
+{
+	if (!beginTransaction())
+		return false;
+	
+	for (unsigned int i = 0; i < ps.size(); i++ )
+	{
+		TePoint point = ps [i];
+		if (!updatePoint (table,point))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::loadPointSet (const string& table, const string& geoid, TePointSet &ps)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	string q ="SELECT * FROM " + table;
+
+	if (!geoid.empty())
+		q += " WHERE object_id = '" + geoid +"'";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+	do 
+	{
+		TePoint point;
+		flag = portal->fetchGeometry (point);
+		ps.add ( point );
+	}while (flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::loadPointSet (const string& table, TeBox &bb, TePointSet &ps)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	string q;
+	q = "SELECT * FROM " + table + " WHERE ";
+	q += this->getSQLBoxWhere (bb, TePOINTS, table);
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+	bool flag = true;
+	do
+	{
+		TePoint pt;
+		flag = portal->fetchGeometry(pt);
+		ps.add(pt);
+	}
+	while (flag);
+	delete portal;
+	return true;
+}
+
+TeDatabasePortal* 
+TeDatabase::loadPointSet(const string& table, TeBox &box)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	if (!portal)
+		return 0;
+
+	string q;
+	q = "SELECT * FROM " + table + " WHERE ";
+	q += this->getSQLBoxWhere (box, TePOINTS, table);
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{	
+		delete portal;
+		return 0;
+	}
+	return portal;
+}
+
+bool 
+TeDatabase::selectPointSet (const string& table, const string& criteria, TePointSet &ps)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	string q ="SELECT * FROM " + table;
+	if (!criteria.empty())
+		q += " WHERE " + criteria;
+	q += " ORDER BY object_id ASC, geom_id ASC";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+	do 
+	{
+		TePoint point;
+		flag = portal->fetchGeometry (point);
+		ps.add ( point );
+	}while (flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::locatePoint (const string& table, TeCoord2D &pt, TePoint &point, const double& tol)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	string q ="SELECT * FROM " + table;
+	char buf [1024];
+	sprintf (buf," WHERE x < %f AND x > %f AND y < %f AND y > %f",
+		box.x2(),box.x1(),box.y2(),box.y1());
+	q += buf;
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	TePointSet ps;
+	bool flag = true;
+	do 
+	{
+		TePoint point;
+		flag = portal->fetchGeometry (point);
+		ps.add ( point );
+	}while (flag);
+
+	delete portal;
+	int k;
+	if (TeNearest (pt, ps, k, tol))
+	{
+		point = ps[k];
+		return true;
+	}
+	return false;
+}
+
+bool 
+TeDatabase::insertTextSet	(const string& table, TeTextSet &ts)
+{
+	if (!beginTransaction())
+		return false;
+
+	for (unsigned int i = 0; i < ts.size(); i++ )
+	{
+		TeText& text = ts [i];
+		if (!insertText (table,text))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::updateTextSet	(const string& table, TeTextSet &ts)
+{
+	if (!beginTransaction())
+		return false;
+	for ( unsigned int i = 0; i < ts.size(); i++ )
+	{
+		TeText text = ts [i];
+		if (!updateText (table,text))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::loadTextSet (const string& table, const string& geoid, TeTextSet &ts)
+{
+	TeDatabasePortal *portal = this->getPortal();
+	
+	string q ="SELECT * FROM " + table;
+	if (!geoid.empty())
+		q += " WHERE object_id = '" + geoid +"'";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	// Look for all texts
+	bool flag  = true;
+	do
+	{
+		TeText p;
+		flag = portal->fetchGeometry(p);
+		ts.add ( p );
+	} while (flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::selectTextSet (const string& table, const string& criteria, TeTextSet &ts)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	string q ="SELECT * FROM " + table;
+	if (!criteria.empty())
+		q += " WHERE " + criteria;
+	q += " ORDER BY object_id ASC, geom_id ASC";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	// Look for all texts
+	bool flag = true;
+	do
+	{
+		TeText p;
+		flag = portal->fetchGeometry(p);
+		ts.add ( p );
+	} while (flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::updateText(const string& table, TeText &t)
+{
+	string sql;
+	sql = "UPDATE " + table + " SET ";
+    sql += "x=" + Te2String(t.location().x(),15) + ", ";
+	sql += "y=" + Te2String(t.location().y(),15) + ", ";
+	sql += "text_value='" + t.textValue() + "', ";
+	sql += "angle=" + Te2String(t.angle(),15) + ", ";
+	sql += "height=" + Te2String(t.height(),15) + ",";
+	sql += "alignment_vert=" + Te2String(t.alignmentVert(),15) + ",";
+	sql += "alignment_horiz=" + Te2String(t.alignmentHoriz(),15);
+    sql += " WHERE geom_id=" + Te2String(t.geomId());
+	return (this->execute(sql));
+}
+
+bool 
+TeDatabase::updateNode(const string& table, TeNode &node)
+{
+	string sql;
+	sql = "UPDATE " + table + " SET ";
+    sql += "x=" + Te2String(node.location().x(),15) + ", ";
+	sql += "y=" + Te2String(node.location().y(),15);
+    sql += " WHERE geom_id = " + Te2String(node.geomId());
+	return (this->execute(sql));
+}
+
+bool 
+TeDatabase::updatePoint(const string& table, TePoint &p)
+{
+	string sql;
+	sql = "UPDATE " + table + " SET ";
+    sql += "x=" + Te2String(p.location().x(),15) + ", ";
+	sql += "y=" + Te2String(p.location().y(),15);
+    sql += " WHERE geom_id = " + Te2String(p.geomId());
+	return (this->execute(sql));
+}
+
+bool TeDatabase::locateText (const string& table, TeCoord2D &pt, TeText &text, const double& tol)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	string q ="SELECT * FROM " + table;
+	char buf [1024];
+	sprintf (buf," WHERE x < %f AND x > %f AND y < %f AND y > %f",
+		box.x2(),box.x1(),box.y2(),box.y1());
+	q += buf;
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	// Look for all texts
+	bool flag = true;
+	TeTextSet ts;
+	do
+	{
+		TeText p;
+		flag = portal->fetchGeometry(p);
+		ts.add ( p );
+	} while (flag);
+
+	delete portal;
+
+	int k;
+	if (TeNearest (pt, ts, k, tol))
+	{
+		text = ts[k];
+		return true;
+	}
+	return false;
+}
+
+bool 
+TeDatabase::insertArcSet	(const string& table, TeArcSet &as)
+{
+	if (!beginTransaction())
+		return false;
+
+	for (unsigned int i = 0; i < as.size(); i++ )
+	{
+		TeArc& arc = as [i];
+		if (!insertArc (table,arc))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::updateArcSet	(const string& table, TeArcSet &as)
+{
+	if (!beginTransaction())
+		return false;
+
+	for ( unsigned int i = 0; i < as.size(); i++ )
+	{
+		TeArc arc = as [i];
+		if (!updateArc (table,arc))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::loadArcSet (const string& table, const string& geoid, TeArcSet &as)
+{
+
+	TeDatabasePortal* portal = this->getPortal();
+	string q ="SELECT * FROM " + table;
+	if (!geoid.empty())
+		q += " WHERE object_id = " + geoid;
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	// Look for all nodes
+	bool flag;
+	do 
+	{
+		TeArc arc;
+		flag = portal->fetchGeometry(arc);
+		as.add (arc);
+	} while (flag);
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::updateArc(const string& table, TeArc &arc)
+{
+	string sql;
+	sql = "UPDATE"+ table +" SET ";
+    sql += "from_node=" + Te2String(arc.fromNode().geomId()) + ", ";
+	sql += "to_node=" + Te2String(arc.toNode().geomId());
+    sql += " WHERE geom_id = " + arc.geomId();
+	return (this->execute(sql));
+}
+
+bool 
+TeDatabase::insertNodeSet	(const string& table, TeNodeSet &ns)
+{
+	if (!beginTransaction())
+		return false;
+
+	for (unsigned int i = 0; i < ns.size(); i++ )
+	{
+	     TeNode& no = ns [i];
+	     if (!insertNode (table,no))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::updateNodeSet	(const string& table, TeNodeSet &ns)
+{
+	if (!beginTransaction())
+		return false;
+
+	for (unsigned int i = 0; i < ns.size(); i++ )
+	{
+		TeNode no = ns [i];
+		if (!updateNode (table,no))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::loadNodeSet (const string& table, const string& geoid, TeNodeSet &ns)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	string q ="SELECT * FROM " + table;
+	if (!geoid.empty())
+		q += " WHERE object_id = " + geoid;
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag = true;
+	do 
+	{
+		TeNode n;
+		flag = portal->fetchGeometry(n);
+		ns.add ( n );
+	}while (flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::insertCellSet	(const string& table, TeCellSet &cs)
+{
+	if (!beginTransaction())
+		return false;
+
+	for (unsigned int i = 0; i < cs.size(); i++ )
+	{
+		TeCell& cell = cs [i];
+		if (!insertCell (table,cell))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool
+TeDatabase::updateCellSet	(const string& table, TeCellSet &cs)
+{
+	if (!beginTransaction())
+		return false;
+
+	for (unsigned int i = 0; i < cs.size(); i++ )
+	{
+		TeCell cell = cs [i];
+		if (!updateCell (table,cell))
+		{
+			rollbackTransaction();
+			return false;
+		}
+	}
+	if (!commitTransaction())
+	{
+		rollbackTransaction();
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::loadCellSet (const int& layerId, const string& table, const string& geoid, TeCellSet &cs)
+{
+
+	TeDatabasePortal *portal = this->getPortal();
+
+	// Get the cell set resolution
+	string q  = "SELECT * FROM te_representation WHERE layer_id = " + Te2String(layerId);
+	q += " AND geom_type = " + Te2String(TeCELLS);
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	cs.resX(portal->getDouble("res_x"));
+	cs.resY(portal->getDouble("res_y"));
+	
+	portal->freeResult();
+		
+	q = "SELECT * FROM " + table;
+	if (!geoid.empty())
+		q += " WHERE object_id = '" + geoid +"'";
+	q += " ";
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag;
+	do 
+	{
+		TeCell cell;
+		flag = portal->fetchGeometry(cell);
+		cs.add ( cell );
+	} while (flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::selectCellSet (const int& layerId, const string& table, const string& criteria, TeCellSet &cs)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	string q = "SELECT * FROM te_representation WHERE layer_id = " ;
+	q += Te2String(layerId) + " AND geom_type = " + Te2String(TeCELLS);
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	cs.resX(portal->getDouble("res_x"));
+	cs.resY(portal->getDouble("res_y"));
+	portal->freeResult();
+	
+	q ="SELECT * FROM " + table;
+	if (!criteria.empty())
+		q += " WHERE " + criteria;
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	bool flag;
+	do 
+	{
+		TeCell cell;
+		flag = portal->fetchGeometry(cell);
+		cs.add ( cell );
+	} while (flag);
+
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::updateCell(const string& table, TeCell &c)
+{
+	TeBox b = c.box();
+
+	string sql;
+	sql = "UPDATE "+ table +"  SET ";
+	sql += "lower_x=" + Te2String(b.lowerLeft().x(),15) + ", ";
+	sql += "lower_y=" + Te2String(b.lowerLeft().y(),15) + ", ";
+	sql += "upper_x=" + Te2String(b.upperRight().x(),15) + ", ";
+	sql += "upper_y=" + Te2String(b.upperRight().y(),15) + ", ";
+	sql += "col_number=" + Te2String(c.column()) + ", ";
+	sql += "row_number=" + Te2String(c.line());
+	sql += " WHERE geom_id = " + c.geomId();
+	return (this->execute(sql));
+}
+
+bool 
+TeDatabase::locateCell (const string& table, TeCoord2D &pt, TeCell &cell, const double& /* tol */)
+{
+	TeDatabasePortal* portal = this->getPortal();
+	string q ="SELECT * FROM " + table;
+	char buf [1024];
+	sprintf (buf," WHERE lower_x < %f AND upper_x > %f AND lower_y < %f AND upper_y > %f",
+		pt.x(),pt.x(),pt.y(),pt.y());
+	q += buf;
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	portal->fetchGeometry(cell);
+	delete portal;
+	return true;
+}
+
+bool TeDatabase::removeGeometry(const string& tableName, const TeGeomRep& rep, const int& geomId)
+{
+	if(tableName.empty())
+	{
+		return false;
+	}
+
+	std::string remove = "DELETE FROM " + tableName;
+	if(rep == TePOLYGONS)
+	{
+		remove += " WHERE geom_id = " + geomId;
+	}
+	else
+	{
+		remove += " WHERE parent_id = " + geomId;
+	}
+
+	return execute(remove);
+}
+
+bool
+TeDatabase::inClauseValues(const string& query, const string& /* attribute */, vector<string>& inClauseVector)
+{
+	inClauseVector.push_back( "(" + query + ")" );
+	return true;
+}
+
+//Spatial query
+//retornam um portal
+
+bool 
+TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabasePortal *portal, int relate, const string& actCollTable)
+{
+	return (TeTopologicalRelation(actGeomTable, actRep, actIdsIn, portal, relate, actCollTable));
+}
+
+bool 
+TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, const string& visGeomTable, TeGeomRep visRep, TeDatabasePortal *portal, int relate, const string& visCollTable)
+{
+	return (TeTopologicalRelation(actGeomTable, actRep, actIdsIn, visGeomTable, visRep, portal, relate, visCollTable));
+}
+
+bool 
+TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, TeDatabasePortal *portal, int relate, const string& actCollTable)
+{
+	return (TeTopologicalRelation(actGeomTable, actRep, geom, portal, relate, actCollTable));
+}
+
+//retornam um vetor de object_ids resultantes da consulta
+bool 
+TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeKeys& actIdsOut, int relate, const string& actCollTable)
+{
+	return (TeTopologicalRelation(actGeomTable, actRep, actIdsIn, actIdsOut, this, relate, actCollTable));
+}
+
+bool 
+TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, const string& visGeomTable, TeGeomRep visRep, TeKeys& visIdsOut, int relate, const string& visCollTable, TeDatabase* dbVis)
+{
+	return (TeTopologicalRelation(actGeomTable, actRep, actIdsIn, visGeomTable, visRep, visIdsOut, this, relate, visCollTable, dbVis));
+}
+
+bool 
+TeDatabase::spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, TeKeys& actIdsOut, int relate, const string& actCollTable)
+{
+	return (TeTopologicalRelation(actGeomTable, actRep, geom, actIdsOut, this, relate, actCollTable));
+}
+
+//metric functions
+bool
+TeDatabase::calculateArea(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, double &area)
+{
+	return (TeGetArea(actGeomTable, actRep, actIdsIn, this, area));
+}
+
+bool 
+TeDatabase::calculateLength(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn , double& length )
+{
+	return (TeGetLength(actGeomTable, actRep, actIdsIn, this, length));
+}
+
+bool 
+TeDatabase::calculateDistance(const string& actGeomTable, TeGeomRep actRep, TeKeys& Ids, double& distance)
+{
+	return (TeGetDistance(actGeomTable, actRep, Ids, this, distance));
+}
+
+bool 
+TeDatabase::calculateDistance(const string& /* actGeomTable */, TeGeomRep /*actRep */, const string& /* objId1 */, const string& /* visGeomTable */, TeGeomRep /* visRep */, const string& /* objId2 */, double& /* distance */)
+{
+	return false;
+}
+
+bool 
+TeDatabase::withinDistance(const string& actGeomTable, TeGeomRep actRep, const TeCoord2D& coord, TeKeysToDist& IdsDistOut, const double& max_distance, const string& actCollTable)
+{
+	return (TeGetWithinDistance(actGeomTable, actRep, coord, IdsDistOut, this, max_distance, actCollTable));
+}
+
+// functions that generate new geometry
+bool 
+TeDatabase::buffer(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TePolygonSet& bufferSet, double dist)
+{
+	return (TeGetBuffer(actGeomTable, actRep, actIds, this, bufferSet, dist));
+}
+
+bool 
+TeDatabase::centroid(const string&  actGeomTable , TeGeomRep actRep, TePointSet& centroidSet, TeKeys actIds, const string& actCollTable)
+{
+	return (TeGetCentroid(actGeomTable, actRep, this, centroidSet, actIds, actCollTable));
+}
+
+bool 
+TeDatabase::convexHull(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TePolygonSet& convexHullSet)
+{
+	return (TeGetConvexHull(actGeomTable, actRep, actIds, this, convexHullSet));
+}
+
+bool 
+TeDatabase::nearestNeighbors(const string& /* actGeomTable */, const string& /* actCollTable */, TeGeomRep /* actRep */, const string& /* objId1 */, TeKeys& /* actIdsOut */, int /* numRes */)
+{
+	return false;
+}
+
+bool 
+TeDatabase::nearestNeighbors(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, const string& /* visCollTable */, TeGeomRep /* visRep */, TeKeys& /* visIdsOut */, int /* numRes */)
+{
+	return false;
+}
+
+bool 
+TeDatabase::nearestNeighbors(const string& /* actGeomTable */, const string& /* actCollTable */, TeGeomRep /* actRep */, const string& /* objId1 */, TeDatabasePortal* /* portal */, int /* numRes */)
+{
+	return false;
+}
+	
+bool 
+TeDatabase::nearestNeighbors(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, const string& /* visCollTable */, TeGeomRep /* visRep */, TeDatabasePortal* /* portal */, int /* numRes */)
+{
+	return false;
+}
+
+bool 
+TeDatabase::geomIntersection(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeGeometryVect& geomVect)
+{
+	return (TeGetOverlay(actGeomTable, actRep, actIds, this, geomVect, TeINTERSECTION));
+}
+	
+bool 
+TeDatabase::geomIntersection(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, TeGeomRep /* visRep */, const string& /* objId2 */, TeGeometryVect& /* geomVect */)
+{
+	return false;
+}
+
+bool 
+TeDatabase::geomDifference(const string& actGeomTable, TeGeomRep actRep, const string& objId1, const string& objId2, TeGeometryVect& geomVect)
+{
+	TeKeys actIds;
+	actIds.push_back(objId1);
+	actIds.push_back(objId2);
+
+	return (TeGetOverlay(actGeomTable, actRep, actIds, this, geomVect, TeDIFFERENCE));
+
+}
+
+bool 
+TeDatabase::geomDifference(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, TeGeomRep /* visRep */, const string& /* objId2 */, TeGeometryVect& /* geomVect */)
+{
+	return false;
+}
+
+bool 
+TeDatabase::geomUnion(const string&  actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeGeometryVect& geomVect)
+{
+    return (TeGetOverlay(actGeomTable, actRep, actIds, this, geomVect, TeUNION));
+}
+
+bool 
+TeDatabase::geomUnion(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, TeGeomRep /* visRep */, const string& /* objId2 */, TeGeometryVect& /* geomVect */)
+{
+	return false;
+}
+
+bool 
+TeDatabase::geomXOr(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* objId2 */, TeGeometryVect& /* geomVect */)
+{
+	return false;
+}
+
+bool 
+TeDatabase::geomXOr(const string& /* actGeomTable */, TeGeomRep /* actRep */, const string& /* objId1 */, const string& /* visGeomTable */, TeGeomRep /* visRep */, const string& /* objId2 */, TeGeometryVect& /* geomVect */)
+{
+	return false;
+}
+
+// Operation with Image
+
+bool 
+TeDatabase::zonal(const string& rasterTable, const string& actGeomTable, TeKeys& Ids, TeObjectStatistics& result, const bool &useDummy)
+{
+	TeDatabasePortal* portal=getPortal();
+	if (!portal)
+		return false;
+	
+	//recuperar o raster!!!
+	string sql = "SELECT layer_id FROM te_representation";
+	sql += " WHERE geom_table = '" + rasterTable +"'";
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	int layerId = atoi(portal->getData(0));
+	TeRaster* raster = loadLayerRaster(layerId);
+
+	//recuperar as geometrias
+	portal->freeResult();
+	
+	string objIds = getStringIds(Ids);
+	sql = "SELECT * FROM "+ actGeomTable;
+	sql+= " WHERE object_id IN ("+ objIds +")";
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+
+		TeStatisticsDimensionVect st;
+
+		TeRaster::iteratorPoly itBegin = raster->begin(poly, TeBoxPixelIn);
+		TeRaster::iteratorPoly itEnd = raster->end(poly, TeBoxPixelIn);
+
+    if (itBegin == itEnd)  // try an approximation for the special case it is a special case
+    {
+      TeCoord2D pll = raster->coord2Index(TeCoord2D(poly.box().lowerLeft()));
+      TeCoord2D pur = raster->coord2Index(TeCoord2D(poly.box().upperRight()));
+
+      TeCoord2D ii(TeRoundRasterIndex(pll.x()),TeRoundRasterIndex(pll.y()));
+      TeCoord2D jj(TeRoundRasterIndex(pur.x()),TeRoundRasterIndex(pur.y()));
+
+      TeCoord2D ll = raster->index2Coord(pll);
+      TeCoord2D ur = raster->index2Coord(pur);
+
+      ll.x_-= raster->params().resx_/2.;
+      ll.y_-= raster->params().resy_/2.;
+      
+      ur.x_+= raster->params().resx_/2.;
+      ur.y_+= raster->params().resy_/2.;
+
+      TeBox bb(ll,ur);
+      TePolygon pol = polygonFromBox(bb);
+		  itBegin = raster->begin(pol, TeBoxPixelIn);
+		  itEnd = raster->end(pol, TeBoxPixelIn);
+      if (itBegin == itEnd)
+      {
+			  delete portal;
+			  return false;
+		  }
+   }
+	if(!TeCalculateStatistics (itBegin, itEnd, st, raster->params().dummy_,useDummy))
+		{
+			delete portal;
+			return false;
+		}
+	
+		result[poly.objectId()] = st;
+
+	}while (flag);
+
+	
+	delete raster;
+	delete portal;
+	return true;
+}
+	
+bool 
+TeDatabase::zonal(const string& rasterTable, const string& actGeomTable, const string& actCollTable, TeObjectStatistics& result,const bool &useDummy)
+{
+	TeDatabasePortal* portal=getPortal();
+	if (!portal)
+		return false;
+	
+	//recuperar o raster
+	string sql = "SELECT layer_id FROM te_representation";
+	sql += " WHERE geom_table = '" + rasterTable +"'";
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	int layerId = atoi(portal->getData(0));
+	TeRaster* raster = loadLayerRaster(layerId);
+
+	//recuperar as geometrias
+	portal->freeResult();
+	
+	sql = "SELECT * FROM "+ actGeomTable;
+
+	if(!actCollTable.empty())
+	{
+		sql += " ,"+ actCollTable;
+		sql += " WHERE object_id = c_object_id ";
+	}
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+	do
+	{
+		TePolygon poly;
+		flag = portal->fetchGeometry(poly);
+
+		TeStatisticsDimensionVect st;
+		
+		TeRaster::iteratorPoly itBegin = raster->begin(poly, TeBoxPixelIn);
+		TeRaster::iteratorPoly itEnd = raster->end(poly, TeBoxPixelIn);
+	  if (itBegin == itEnd)  // try an approximation for the special case it is a special case
+    {
+      TeCoord2D pll = raster->coord2Index(TeCoord2D(poly.box().lowerLeft()));
+      TeCoord2D pur = raster->coord2Index(TeCoord2D(poly.box().upperRight()));
+
+      TeCoord2D ii(TeRoundRasterIndex(pll.x()),TeRoundRasterIndex(pll.y()));
+      TeCoord2D jj(TeRoundRasterIndex(pur.x()),TeRoundRasterIndex(pur.y()));
+
+      TeCoord2D ll = raster->index2Coord(pll);
+      TeCoord2D ur = raster->index2Coord(pur);
+
+      ll.x_-= raster->params().resx_/2.;
+      ll.y_-= raster->params().resy_/2.;
+      
+      ur.x_+= raster->params().resx_/2.;
+      ur.y_+= raster->params().resy_/2.;
+
+      TeBox bb(ll,ur);
+      TePolygon pol = polygonFromBox(bb);
+		  itBegin = raster->begin(pol, TeBoxPixelIn);
+		  itEnd = raster->end(pol, TeBoxPixelIn);
+      if (itBegin == itEnd)
+      {
+			  delete portal;
+			  return false;
+		  }
+    }
+		if(!TeCalculateStatistics (itBegin, itEnd, st,raster->params().dummy_,useDummy))
+		{
+			delete portal;
+			return false;
+		}
+		result[poly.objectId()] = st;
+
+	}while (flag);
+
+	
+	delete raster;
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::zonal(const string& rasterTable, TePolygon& poly, TeStatisticsDimensionVect& result, const bool &useDummy)
+{
+	TeDatabasePortal* portal=getPortal();
+	if (!portal)
+		return false;
+	
+	//recuperar o raster!!!
+	string sql = "SELECT layer_id FROM te_representation";
+	sql += " WHERE geom_table = '" + rasterTable +"'";
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	int layerId = atoi(portal->getData(0));
+	TeRaster* raster = loadLayerRaster(layerId);
+
+	delete portal;
+
+	TeRaster::iteratorPoly itBegin = raster->begin(poly, TeBoxPixelIn);
+	TeRaster::iteratorPoly itEnd = raster->end(poly, TeBoxPixelIn);
+	if (itBegin == itEnd)  // try an approximation for the special case it is a special case
+  {
+    TeCoord2D pll = raster->coord2Index(TeCoord2D(poly.box().lowerLeft()));
+    TeCoord2D pur = raster->coord2Index(TeCoord2D(poly.box().upperRight()));
+
+    TeCoord2D ii(TeRoundRasterIndex(pll.x()),TeRoundRasterIndex(pll.y()));
+    TeCoord2D jj(TeRoundRasterIndex(pur.x()),TeRoundRasterIndex(pur.y()));
+
+    TeCoord2D ll = raster->index2Coord(pll);
+    TeCoord2D ur = raster->index2Coord(pur);
+
+    ll.x_-= raster->params().resx_/2.;
+    ll.y_-= raster->params().resy_/2.;
+    
+    ur.x_+= raster->params().resx_/2.;
+    ur.y_+= raster->params().resy_/2.;
+
+    TeBox bb(ll,ur);
+    TePolygon pol = polygonFromBox(bb);
+		itBegin = raster->begin(pol, TeBoxPixelIn);
+		itEnd = raster->end(pol, TeBoxPixelIn);
+    if (itBegin == itEnd)
+			return false;
+  }
+	
+  if(!TeCalculateStatistics (itBegin, itEnd, result,raster->params().dummy_,useDummy))
+		return false;
+
+	delete raster;
+	return true;
+}
+
+
+bool 
+TeDatabase::mask(const string& rasterTable, const string& actGeomTable, const string& objId, const string& nameLayerOut, TeStrategicIterator st)
+{
+	TeDatabasePortal* portal=getPortal();
+	if (!portal)
+		return false;
+	
+	//recuperar o raster!!!
+	string sql = "SELECT layer_id FROM te_representation";
+	sql += " WHERE geom_table = '" + rasterTable +"'";
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	int layerId = atoi(portal->getData(0));
+	TeRaster* raster = loadLayerRaster(layerId);
+
+	//recuperar a geometria
+	portal->freeResult();
+	
+	sql = "SELECT * FROM "+ actGeomTable;
+	sql+= " WHERE object_id = '" + objId + "'"; 
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	TePolygon poly;
+	portal->fetchGeometry(poly);
+	delete portal;
+
+	TeRaster* rasterOut = TeMask (raster, poly, st);
+	if(!rasterOut)
+		return false;
+
+	TeLayer* res = TeImportRaster(nameLayerOut, rasterOut, this);
+	delete raster;
+	delete rasterOut;
+	return (res != 0);
+}
+
+
+
+bool
+TeDatabase::mask(const string& rasterTable, TePolygon& poly, const string& nameLayerOut, TeStrategicIterator st)
+{
+	TeDatabasePortal* portal=getPortal();
+	if (!portal)
+		return false;
+	
+	string sql = "SELECT layer_id FROM te_representation";
+	sql += " WHERE geom_table = '" + rasterTable +"'";
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	TeRaster* raster = loadLayerRaster(atoi(portal->getData(0)));
+	delete portal;
+
+	TeRaster* rasterOut = TeMask (raster, poly, st);
+	if(!rasterOut)
+		return false;
+
+	TeLayer* res = TeImportRaster(nameLayerOut, rasterOut, this);
+	delete raster;
+	delete rasterOut;
+	return (res != 0);
+}
+
+
+string
+TeDatabase::getSQLBoxWhere(const TeBox& box, const TeGeomRep rep, const std::string& )
+{
+	string wherebox;
+	string lowerX, lowerY, upperX, upperY;
+	if(rep == TePOLYGONS || rep == TeLINES || rep == TeCELLS || rep == TeRASTER || rep == TeRASTERFILE)
+	{
+		lowerX = "lower_x";
+		lowerY = "lower_y";
+		upperX = "upper_x";
+		upperY = "upper_y";
+	}
+	else if(rep == TePOINTS || rep == TeTEXT)
+	{
+		lowerX = "x";
+		lowerY = "y";
+		upperX = "x";
+		upperY = "y";
+	}
+	wherebox = "NOT("+ lowerX +" > " + Te2String(box.x2_, 12) + " OR ";
+	wherebox += upperX +" < " + Te2String(box.x1_, 12) + " OR ";
+	wherebox += lowerY +" > " + Te2String(box.y2_, 12) + " OR ";
+	wherebox += upperY +" < " + Te2String(box.y1_, 12) + ")";
+	return wherebox;
+}
+
+
+string 
+TeDatabase::getSQLBoxWhere (const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep /* rep1 */)
+{
+	string wherebox;
+
+	if(rep2 == TePOLYGONS || rep2 == TeLINES || rep2 == TeCELLS || rep2 == TeRASTER || rep2 == TeRASTERFILE)
+	{
+		wherebox = " NOT( ";
+		wherebox += table2 +".lower_x > "+ table1 +".upper_x  OR ";
+		wherebox += table2 +".upper_x < "+ table1 +".lower_x  OR ";
+		wherebox += table2 +".lower_y > "+ table1 +".upper_y  OR ";
+		wherebox += table2 +".upper_y < "+ table1 +".lower_y )";
+	}
+	else if(rep2 == TePOINTS || rep2 == TeTEXT)
+	{
+		wherebox = " NOT( ";
+		wherebox += table2 +".x > "+ table1 +".upper_x  OR ";
+		wherebox += table2 +".x < "+ table1 +".lower_x  OR ";
+		wherebox += table2 +".y > "+ table1 +".upper_y  OR ";
+		wherebox += table2 +".y < "+ table1 +".lower_y )";
+	}
+	
+	return wherebox;
+}
+
+
+string 
+TeDatabase::getSQLBoxSelect (const string& tableName, TeGeomRep /* rep */)
+{
+	string sql = tableName +".* ";
+	return sql;
+}
+
+std::string TeDatabase::getSQLOrderBy(const TeGeomRep& rep) const
+{
+	std::string orderBy = "object_id ASC";
+	if(rep == TePOLYGONS)
+	{
+		orderBy += ", parent_id ASC, num_holes DESC";
+	}
+	return orderBy;
+}
+
+string
+TeDatabase::getSQLStatistics (TeGroupingAttr& attrs)
+{
+	string sql = "";
+	string virg = "";
+
+	TeGroupingAttr::iterator it = attrs.begin();
+	int count = 0;
+	while(it != attrs.end())
+	{
+		if(count>0)
+			virg = ",";
+
+		switch ((*it).second)
+		{
+			case TeSUM:
+				sql += virg +" SUM( "+ (*it).first.name_ +") AS SUM_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeMAXVALUE:
+				sql += virg +" MAX( "+ (*it).first.name_ +") AS MAX_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC; 
+				++count;
+				break;
+			case TeMINVALUE:
+				sql += virg +" MIN( "+ (*it).first.name_ +") AS MIN_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeCOUNT:
+				sql += virg +" COUNT( "+ (*it).first.name_ +") AS COUNT_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			case TeMEAN:
+				sql += virg +" AVG( "+ (*it).first.name_ +") AS AVG_"+ Te2String(count);
+				(*it).second = TeNOSTATISTIC;
+				++count;
+				break;
+			default:
+				break;
+		}
+		++it;
+	}
+	return sql;
+}
+
+string 
+TeDatabase::getSQLAutoNumber(const string& /* table */)
+{
+	return "";
+}
+
+string 
+TeDatabase::getSQLTemporalWhere (TeTimeInterval& timeInterval, TeTemporalRelation timeOperator, const string& initialTime, const string& finalTime)
+{
+	string sql;
+	string t1 = getSQLTime(timeInterval.getT1()); 
+	string t2 = getSQLTime(timeInterval.getT2());
+	
+	switch(timeOperator)
+	{
+		case TeTIMEBEFORE:  
+			sql = finalTime +" < "+ t1;
+			break;
+		case TeTIMEAFTER:  
+			sql = initialTime +" > "+ t2;
+			break;
+		case TeTIMEEQUAL:             
+			sql = "( "+ initialTime +" >= "+ t1;
+			sql += " AND "+ initialTime +" <= "+ t2 +" )";
+			if (initialTime != finalTime)
+			{
+				sql += " AND ";
+				sql += "( "+ finalTime +" >= "+ t1;
+				sql += " AND "+ finalTime +" <= "+ t2 +" )";
+			}
+			break;
+
+		case TeTIMEMEETS:             
+			sql = finalTime +" = "+ t1;
+			sql += " OR "+ initialTime +" = "+ t2;
+			break;
+
+		case TeTIMEDURING: 
+			sql = initialTime +" >= "+ t1;
+			sql += " AND "+ initialTime +" <= "+ t2;
+			if (initialTime != finalTime)
+			{
+				sql += " AND "+ finalTime +" >= "+ t1;
+				sql += " AND "+ finalTime +" <= "+ t2;
+			}
+			break;
+
+		case TeTIMEOVERLAPS:             
+			sql = "( "+ initialTime +" < "+ t1;
+			sql += " AND "+ finalTime +" > "+ t1;
+			sql += " AND "+ finalTime +" < "+ t2 +" )";
+			sql += " OR ";
+			sql += "( "+ initialTime +" > "+ t1;
+			sql += " AND "+ initialTime +" < "+ t2;
+			sql += " AND "+ finalTime +" > "+ t2 +" )";
+			break;
+
+		case TeTIMEENDS:
+			sql = finalTime +" = "+ t2;
+			break;
+
+		case TeTIMESTARTS:
+			sql = initialTime +" = "+ t1;
+			break;
+
+        default:
+            break;
+	}
+
+	return sql; 
+}
+
+string
+TeDatabase::getSQLTemporalWhere(int time1, int time2, TeChronon chr, TeTemporalRelation rel, 
+						   const string& initialTime, const string& finalTime)
+{
+	//rever os chronons definidos - alterar o parser para restri��o temporal
+	string func, sql;
+	switch(chr)
+	{
+		case TeSECONDOFMINUTE:  
+		   func = " second"; 
+		break;
+		
+		case TeMINUTEOFHOUR:  
+		   func = " minute";
+		break;
+		
+		case TeHOUROFDAY:             
+			func = " hour";
+		break;
+		
+		case TeDAYOFMONTH:             
+			func = " day";
+		break;
+
+		case TeDAYOFWEEK:
+			func = " weekday";
+		break;
+		
+		case TeMONTHOFYEAR:
+		   func = " month";
+		break;
+
+		case TeYEAR:             
+		   func = " year";
+		break;
+
+		default:
+			return "";
+	}
+
+	switch(rel)
+	{
+		case TeTIMEBEFORE:  
+			sql = func +"("+ finalTime +") < "+ Te2String(time1);
+		break;
+		
+		case TeTIMEAFTER:  
+			sql = func +"("+ initialTime +") > "+ Te2String(time2);
+		break;
+		
+		case TeTIMEEQUAL:  
+			sql = func +"("+ initialTime +") = "+ Te2String(time1);
+			sql += " AND "+ func +"(" + finalTime +") = "+ Te2String(time2);
+		break;
+
+		case TeTIMEMEETS:     
+			sql = func +"("+ finalTime +") = "+ Te2String(time1);
+			sql += " OR "+ func +"(" + initialTime +") = "+ Te2String(time2);
+		break;
+
+		case TeTIMEDURING: 
+			sql = func +"("+ initialTime +") >= "+ Te2String(time1);
+			sql += " AND "+ func +"("+ initialTime +") <= "+ Te2String(time2);
+			sql += " AND "+ func +"("+ finalTime +") >= "+ Te2String(time1);
+			sql += " AND "+ func +"("+ finalTime +") <= "+ Te2String(time2);
+		break;
+
+		case TeTIMEOVERLAPS:         
+			sql =  "("+ func +"("+ initialTime +") <= "+ Te2String(time1);
+			sql += " AND "+ func +"("+ finalTime +") >= "+ Te2String(time1);
+			sql += " AND "+ func +"("+ finalTime +") <= "+ Te2String(time2) +")";
+			sql += " OR ";
+			sql += "("+ func +"("+ initialTime +") >= "+ Te2String(time1);
+			sql += " AND "+ func +"("+ initialTime +") <= "+ Te2String(time2);
+			sql += " AND "+ func +"("+ finalTime +") >= "+ Te2String(time2) +")";
+		break;
+
+		case TeTIMEENDS:
+			sql = func +"("+ finalTime +") = "+ Te2String(time2);
+		break;
+
+		case TeTIMESTARTS:
+			sql = func +"("+ initialTime +") = "+ Te2String(time1);
+
+		default:
+			break;
+	}
+	
+	return sql;
+}
+
+string 
+TeDatabase::getSQLTemporalWhere (const string& temporalRest)
+{
+	string result, tableName, initialCol, finalCol, time1, time2, mask; 
+	TeTemporalRelation rel = TeTIMEUNDEFINED;
+	TeChronon chronon = TeNOCHRONON; 
+	
+	string temp = temporalRest;
+	bool flag = true;
+	int cont = 0;
+		
+	while(flag)
+	{
+		string element;
+		int pos = temp.find (";");
+		if(pos<0)
+		{
+			flag = false;
+			element = temp;
+		}
+		else
+		{
+			element = temp.substr(0, pos);
+			temp = temp.substr (pos+1);
+		}
+
+		if(cont==0) //table name
+			tableName = element;
+		else if(cont==1) //column name (initial time) 
+			initialCol = element; 
+		else if(cont==2) //column name (final time)
+			finalCol = element;
+		else if(cont==3) //TeTemporalRelation 
+		{
+			if(element=="TeTIMEEQUAL")
+				rel = TeTIMEEQUAL;
+			else if (element=="TeTIMEBEFORE")
+				rel = TeTIMEBEFORE;
+			else if (element=="TeTIMEAFTER")
+				rel = TeTIMEAFTER;
+			else if (element=="TeTIMEMEETS")
+				rel = TeTIMEMEETS;
+			else if (element=="TeTIMEDURING")
+				rel = TeTIMEDURING;
+			else if (element=="TeTIMEOVERLAPS")
+				rel = TeTIMEOVERLAPS;
+			else if (element=="TeTIMEENDS")
+				rel = TeTIMEENDS;
+			else if (element=="TeTIMESTARTS")
+				rel = TeTIMESTARTS;
+		}
+		else if(cont==4) //time 1
+			time1 = element;
+		else if(cont==5) //time 2
+		{
+			if(element.empty())
+				time1 = time2;
+			else
+				time2 = element;
+		}
+		else if(cont==6)
+			mask = element;
+		else if(cont==7) //TeChronon  
+		{
+			if (element=="TeSECOND")
+				chronon = TeSECOND;
+			else if (element=="TeMINUTE")
+				chronon = TeMINUTE;
+			else if (element=="TeHOUR")
+				chronon = TeHOUR;
+			else if (element=="TeDAY")
+				chronon = TeDAY;
+			else if (element=="TeMONTH")
+				chronon = TeMONTH;
+			else if (element=="TeYEAR")
+				chronon = TeYEAR;
+			else if (element=="TeDAYOFWEEK")
+				chronon = TeDAYOFWEEK;
+			else if (element=="TeMONTHOFYEAR")
+				chronon = TeMONTHOFYEAR;
+			else if (element=="TeSEASON")
+				chronon = TeSEASON;
+			else if (element=="TeWEEKOFYEAR")
+				chronon = TeWEEKOFYEAR;
+		}
+
+		++cont;
+	}
+
+	int posMask = mask.find ("s");
+	if(posMask<0) 
+	{
+		result = " "+ getSQLTemporalWhere(atoi(time1.c_str()), atoi(time2.c_str()), chronon, rel, (tableName+"."+initialCol), (tableName+"."+finalCol)) +" ";
+	}
+	else
+	{
+		TeTimeInterval interval(time1, time2, chronon, mask);
+		result = " "+ getSQLTemporalWhere(interval, rel, (tableName+"."+initialCol), (tableName+"."+finalCol)) + " "; 
+	}
+
+	return result;
+}
+
+
+string 
+TeDatabase::getSQLTemporalFunction (TeChronon chr, const string& colName)
+{
+	string func;
+	switch(chr)
+	{
+		case TeYEAR:             
+			func = " year ("+ colName +")";
+		break;
+
+		case TeMONTH:			// Fev/2003 != Fev/2004
+			func = " year ("+ colName +"), month ("+ colName +") ";
+		break;
+
+		case TeMONTHOFYEAR:		// Fev/2003 == Fev/2004
+			func = " month ("+ colName +")";
+		break;
+
+		case TeDAY:				// 01/01/2003 != 01/01/2004 != 01/02/2004             
+			func = " year ("+ colName +"), month ("+ colName +"), day("+ colName +") ";
+		break;
+
+		case TeDAYOFMONTH:		// 01/01/2003 == 01/01/2004 == 01/02/2004             
+			func = " day("+ colName +") ";
+		break;
+
+		case TeDAYOFYEAR:		// 01/01/2003 == 01/01/2004 != 01/02/2004             
+			func = " month ("+ colName +"), day("+ colName +") ";
+		break;
+
+		case TeDAYOFWEEK:		// 01/01/2003 != 01/01/2004 != 01/02/2004             
+			func = " weekday ("+ colName +") ";
+		break;
+
+		case TeHOUR:			// 01/01/2003 10:00 != 01/01/2004 10:00 != 01/02/2004 10:00             
+			func = " year ("+ colName +"), month ("+ colName +"), day("+ colName +"), hour("+ colName +") ";
+		break;
+
+		case TeHOUROFDAY:       // 01/01/2003 10:00 == 01/01/2004 10:00 == 01/02/2004 10:00    
+			func = " hour ("+ colName +")";
+		break;
+
+		case TeMINUTE:			// 01/01/2003 10:30 != 01/01/2004 10:30 != 01/02/2004 10:30 
+		   func = " year ("+ colName +"), month ("+ colName +"), day("+ colName +"), hour("+ colName +"), minute("+ colName +") ";
+		break;
+
+		case TeMINUTEOFHOUR:   // 01/01/2003 10:30 == 01/01/2004 10:30 == 01/02/2004 10:30 != 01/02/2004 10:31
+			func = " minute("+ colName +") ";
+		break;
+
+		case TeSECOND:  // 01/01/2003 10:30:04 != 01/01/2004 10:30:04 != 01/02/2004 10:30:04 
+		   func = " year ("+ colName +"), month ("+ colName +"), day("+ colName +"), hour("+ colName +"), minute("+ colName +"), second("+ colName +") ";
+		break;
+
+		case TeSECONDOFMINUTE:  // 01/01/2003 10:30:04 == 01/01/2004 10:30:04 == 01/02/2004 10:30:04 != 01/02/2004 10:30:07
+		   func = " second("+ colName +") "; 
+		break;
+		
+		default:
+			return "";
+	}
+	
+	return func;
+}
+ 
+
+bool
+TeDatabase::getMBRGeom(string tableGeom, string object_id, TeBox& box, string /* colGeom */)
+{
+	double xmin = TeMAXFLOAT;
+	double xmax = -TeMAXFLOAT;
+	double ymin = TeMAXFLOAT;
+	double ymax = -TeMAXFLOAT;
+			
+	TeDatabasePortal* portal = getPortal();
+	if(!portal)
+		return false;
+
+	string sel = "SELECT lower_x, upper_x, lower_y, upper_y FROM " + tableGeom;
+	sel += " WHERE object_id = '" + object_id + "'";
+
+	if(!portal->query(sel))
+	{
+		delete portal;
+		return false;
+	}
+		
+	bool b = portal->fetchRow();
+	if(!b)
+	{
+		delete portal;
+		return false;
+	}
+	
+	while(b)
+	{
+		xmin = MIN(xmin, portal->getDouble(0));
+		xmax = MAX(xmax, portal->getDouble(1));
+		ymin = MIN(ymin, portal->getDouble(2));
+		ymax = MAX(ymax, portal->getDouble(3));
+		b = portal->fetchRow();	
+	}
+			
+	TeBox bb(xmin, ymin, xmax, ymax);
+	box = bb;
+	delete portal;
+	return true;
+}
+
+bool 
+TeDatabase::getMBRSelectedObjects(string /* geomTable */,string /* colGeom */, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType,TeBox &bout, const double& tol)
+{
+	string	fields;
+	string	query;
+	bool	status = false;
+
+	TeBox	box;
+	bout = box;
+
+	TeDatabasePortal* portal = this->getPortal();
+
+	switch(repType)
+	{
+		case TePOLYGONS:
+		case TeLINES:
+		case TeCELLS:
+			fields = "MIN(lower_x), MIN(lower_y), MAX(upper_x), MAX(upper_y)";
+			query =  " SELECT " + fields;
+			query += " FROM " + fromClause; 
+			if (!whereClause.empty())
+				query += " WHERE " + whereClause;
+			if (!afterWhereClause.empty())
+				query += afterWhereClause;
+
+			if (portal->query (query))
+			{
+				bool b = portal->fetchRow();
+				while(b)
+				{
+					string vxmin = portal->getData(0);
+					string vymin = portal->getData(1);
+					string vxmax = portal->getData(2);
+					string vymax = portal->getData(3);
+					if(vxmin.empty() || vymin.empty() || vxmax.empty() || vymax.empty())
+					{
+						b = portal->fetchRow();
+						continue;
+					}
+					double xmin = atof(vxmin.c_str());
+					double ymin = atof(vymin.c_str());
+					double xmax = atof(vxmax.c_str());
+					double ymax = atof(vymax.c_str());
+					TeBox	ibox(xmin, ymin, xmax, ymax);
+					updateBox (bout, ibox);
+					b = portal->fetchRow();
+					status = true;
+				}
+			}
+			break;
+
+		case TePOINTS:
+		case TeTEXT:
+			fields = "MIN(x), MIN(y), MAX(x), MAX(y)";
+			query =  " SELECT " + fields;
+			query += " FROM " + fromClause; 
+			if (!whereClause.empty())
+				query += " WHERE " + whereClause;
+			if (!afterWhereClause.empty())
+				query += afterWhereClause;
+			
+			if (portal->query (query))
+			{
+				bool b = portal->fetchRow();
+				while(b)
+				{
+          string vxmin = portal->getData(0);
+          string vymin = portal->getData(1);
+          string vxmax = portal->getData(2);
+          string vymax = portal->getData(3);
+          if(vxmin.empty() || vymin.empty() || vxmax.empty() || vymax.empty())
+          {
+            b = portal->fetchRow();
+            continue;
+          }
+          double xmin = atof(vxmin.c_str());
+          double ymin = atof(vymin.c_str());
+          double xmax = atof(vxmax.c_str());
+          double ymax = atof(vymax.c_str());
+          
+          TeBox ibox;
+          if (xmin == xmax) {
+            ibox.x1_ = xmin - tol;
+            ibox.x2_ = xmax + tol;
+          }
+          else{
+            ibox.x1_ = xmin;
+            ibox.x2_ = xmax;
+          }
+          if (ymin == ymax) {
+            ibox.y1_ = ymin - tol;
+            ibox.y2_ = ymax + tol;
+          }
+          else {
+            ibox.y1_ = ymin;
+            ibox.y2_ = ymax;
+          }
+					updateBox (bout, ibox);
+					b = portal->fetchRow();
+					status = true;
+				}
+			}
+			break;
+
+
+		default:
+			status = false;
+			break;
+	}
+	delete portal;
+	return status;
+}
+
+bool 
+TeDatabase::getAttributeList(const string& tableName,TeAttributeList& attList)
+{
+	if(!tableExist(tableName))
+	{
+		return false;
+	}
+
+	TeDatabasePortal* portal = this->getPortal();
+	if (!portal)
+		return false;
+
+	string sql = "SELECT * FROM " + tableName + " WHERE 1=2";
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	else
+		attList = portal->getAttributeList();
+	delete portal;
+	return true;
+}
+
+
+bool TeDatabase::insertRasterVisual (int themeId , TeRasterVisual* vis)
+{
+	TeRasterTransform::TeRasterTransfFunctions tf = vis->getTransfFunction();
+
+	TeDatabasePortal* portal = this->getPortal();
+
+	std::string sqlLut = "SELECT lut_table from te_visual_raster where theme_id = " + Te2String(themeId);
+
+	if(portal->query(sqlLut) && portal->fetchRow())
+	{
+		std::string lutName = portal->getData(0);
+
+		if (this->tableExist(lutName))
+		{
+			if(!this->deleteTable(lutName))
+				return false;
+		}
+	}
+	delete portal;
+		
+	if (tf == TeRasterTransform::TeNoTransf)
+		return true;
+
+	string sql = "DELETE FROM te_visual_raster WHERE theme_id = " + Te2String(themeId);
+	if (!this->execute(sql))
+		return false;
+
+	if (tf == TeRasterTransform::TeMono2Three ||
+		tf == TeRasterTransform::TePall2Three || 
+		tf == TeRasterTransform::TeLUT2Three)
+	{
+		sql = "INSERT INTO te_visual_raster (theme_id, band_in, transf_type) VALUES (";
+		sql += Te2String(themeId) + "," + Te2String(vis->getSrcBand()) + ",";
+		sql += Te2String(static_cast<short>(tf)) + ")";
+		if (!this->execute(sql))
+			return false;
+		return true;
+	}
+
+	if (tf == TeRasterTransform::TeExtractBand)
+	{
+		sql = "INSERT INTO te_visual_raster (theme_id, band_in, band_out, transf_type) VALUES (";
+		sql += Te2String(themeId) + "," + Te2String(vis->getSrcBand()) + ",";
+		sql += Te2String(vis->getDestBand()) + "," + Te2String(static_cast<short>(tf))+ ")";
+		if (!this->execute(sql))
+			return false;
+		return true;
+	}
+
+	if (tf == TeRasterTransform::TeExtractBands || tf == TeRasterTransform::TeExtractRGB)
+	{
+		map<TeRasterTransform::TeRGBChannels,short>& RGBmap = vis->getRGBMap();
+		map<TeRasterTransform::TeRGBChannels,short>::iterator it = RGBmap.begin();
+		while (it != RGBmap.end())
+		{
+			sql = "INSERT INTO te_visual_raster (theme_id, band_in, band_out, transf_type) VALUES (";
+			sql += Te2String(themeId) + "," + Te2String(static_cast<short>(it->second)) + ",";
+			sql += Te2String(static_cast<short>(it->first)) + "," + Te2String(static_cast<short>(tf))+ ")";
+			if (!this->execute(sql))
+				return false;
+			++it;
+		}
+		return true;
+	}
+
+	if(tf == TeRasterTransform::TeThree2LUTThreeBand || tf == TeRasterTransform::TeMono2LUTMonoBand)
+	{
+		std::string lutName = vis->getLutTableName();
+
+		if(lutName.empty())
+			return false;
+
+		map<TeRasterTransform::TeRGBChannels,short>& RGBmap = vis->getRGBMap();
+		map<TeRasterTransform::TeRGBChannels,short>::iterator it = RGBmap.begin();
+		while (it != RGBmap.end())
+		{
+			sql = "INSERT INTO te_visual_raster (theme_id, band_in, band_out, transf_type, lut_table) VALUES (";
+			sql += Te2String(themeId) + "," + Te2String(static_cast<short>(it->second)) + ",";
+			sql += Te2String(static_cast<short>(it->first)) + "," + Te2String(static_cast<short>(tf))+ ",'";
+			sql += lutName + "')";
+			if (!this->execute(sql))
+				return false;
+			++it;
+		}
+		
+		if (this->tableExist(lutName))
+		{
+			if(!this->deleteTable(lutName))
+				return false;
+		}
+
+		if (this->createLUTTable(lutName))
+		{
+			for (unsigned int i = 0; i < vis->lutr_.size(); ++i)
+			{
+				std::string sql;
+				
+				if(tf == TeRasterTransform::TeThree2LUTThreeBand)
+				{
+					sql = "INSERT INTO " + lutName + " VALUES(";
+					sql += Te2String(i) + ", ";
+					sql += Te2String(vis->lutr_[i]) + ", ";
+					sql += Te2String(vis->lutg_[i]) + ", ";
+					sql += Te2String(vis->lutb_[i]) + ", ";
+					sql += "'' )";
+				}
+				else
+				{
+					sql = "INSERT INTO " + lutName + " VALUES(";
+					sql += Te2String(i) + ", ";
+					sql += Te2String(vis->lutr_[i]) + ", ";
+					sql += Te2String(vis->lutr_[i]) + ", ";
+					sql += Te2String(vis->lutr_[i]) + ", ";
+					sql += "'' )";
+				}
+				
+				if(!this->execute(sql))
+					return false;
+			}
+		 }
+
+		return true;
+	}
+
+	return false;
+}
+
+
+bool 
+TeDatabase::locateLineSet (const string& table, TeCoord2D &pt, TeLineSet &ls, const double& tol)
+{
+	bool located=false;
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	string q ="SELECT * FROM " + table;
+	char buf [1024];
+	sprintf (buf," WHERE lower_x < %f AND upper_x > %f AND lower_y < %f AND upper_y > %f",
+		box.x2(),box.x1(),box.y2(),box.y1());
+	q += buf;
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	// Get all lines
+	bool flag = true;
+	do 
+	{
+		TeLine2D l;
+		TeLineSet tmp;
+		int index;
+		double dist;
+		TeCoord2D pout;
+
+		flag = portal->fetchGeometry( l );
+		tmp.add(l);
+		if(TeNearest(pt,tmp,index,pout,dist,tol))
+			{
+				ls.add ( l );
+				located=true;
+			}
+	} while (flag);
+
+	delete portal;
+	return located;
+}
+
+
+bool 
+TeDatabase::locatePointSet (const string& table, TeCoord2D &pt, TePointSet &pointSet, const double& tol)
+{
+	bool located=false;
+
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	string q ="SELECT * FROM " + table;
+	char buf [1024];
+	sprintf (buf," WHERE x < %f AND x > %f AND y < %f AND y > %f",
+		box.x2(),box.x1(),box.y2(),box.y1());
+	q += buf;
+
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+	do 
+	{
+		TePoint point;
+		flag = portal->fetchGeometry (point);
+		pointSet.add ( point );
+		located=true;
+	}while (flag);
+
+	delete portal;
+	return located;
+}
+
+
+bool 
+TeDatabase::locateTextSet (const string& table, TeCoord2D &pt, TeTextSet& textSet, const double& tol)
+{
+	bool located=false;
+
+	TeDatabasePortal* portal = this->getPortal();
+
+	TeBox box (pt.x()-tol,pt.y()-tol,pt.x()+tol,pt.y()+tol);
+	string q ="SELECT * FROM " + table;
+	char buf [1024];
+	sprintf (buf," WHERE x < %f AND x > %f AND y < %f AND y > %f",
+		box.x2(),box.x1(),box.y2(),box.y1());
+	q += buf;
+	if (!portal->query(q) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	// Look for all texts
+	bool flag = true;
+	
+	do
+	{
+		TeText p;
+		flag = portal->fetchGeometry(p);
+		textSet.add ( p );
+		located=true;
+	} while (flag);
+
+	delete portal;
+	return located;
+}
+
+bool 
+TeDatabase::updateVersionStamp(const string& DBversion )
+{
+	TeTable versionTable;
+	if( !loadTable( "te_database", versionTable ) )
+		return false;
+	if ( versionTable.size() ) //no empty
+	{
+		string deleteVersionTb = "DELETE FROM te_database";
+		if( !execute( deleteVersionTb ) )
+			return false;
+	}
+	//insert
+	string insVersionTb = "INSERT INTO te_database (db_version) VALUES('" + DBversion + "')";
+	if( !execute(insVersionTb) )
+		return false;
+	return true;
+}
+
+bool 
+TeDatabase::loadVersionStamp(string& DBversion)
+{
+	DBversion.clear();
+	TeTable versionTable;	
+	if( !loadTable("te_database",versionTable) )
+		return false;
+	if ( versionTable.size() == 0 )
+		return false;
+	std::vector<std::string> attrs;
+	versionTable.attributeNames( attrs );
+	for (unsigned int i = 0; i < attrs.size(); i++ )
+	{
+		if ( TeStringCompare(attrs[i], "db_version", false ) )
+		{
+			DBversion = versionTable(0, i);
+			break;
+		}
+	}
+	return false;
+}
+
+bool 
+TeDatabase::updateLayerBox(TeLayer* layer)
+{
+	if (!layer)
+		return false;
+	TeBox box = layer->box();
+	string sql = "UPDATE te_layer SET lower_x = " + Te2String(box.x1(),15);
+		   sql += ", lower_y = " + Te2String(box.y1(),15);
+		   sql += ", upper_x = " + Te2String(box.x2(),15);
+		   sql += ", upper_y = " + Te2String(box.y2(),15);
+		   sql += " WHERE layer_id=" + Te2String(layer->id());
+	return execute(sql);
+}
+
+//! Load information about all projects stored in the database
+bool 
+TeDatabase::loadProjectSet()
+{
+	//clear map
+	TeProjectMap::iterator projectIt;
+	for (projectIt = metaModel_->projectMap().begin(); projectIt != metaModel_->projectMap().end(); ++projectIt)
+	{
+		if (projectIt->second)
+			delete projectIt->second;
+	}
+	metaModel_->projectMap().clear();
+	
+	//sql
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+
+	string get = " SELECT te_project.*, te_project_view.* ";
+	get += " FROM ((te_project LEFT JOIN te_project_view ";
+	get += " ON te_project.project_id = te_project_view.project_id) ";
+	get += " LEFT JOIN te_view ON te_view.view_id = te_project_view.view_id)";
+	get += " WHERE te_view.user_name = '" + this->user() + "'";
+	get += " ORDER BY te_project.project_id, te_project_view.view_id";
+
+	if (!portal->query(get))
+	{	
+		delete portal;
+		return false;
+	}
+
+	bool flag = portal->fetchRow();
+	while (flag)
+	{
+		TeProject* project = new TeProject(portal->getInt(0), this);
+		project->setName(string(portal->getData(1)));
+		project->setDescription(string(portal->getData(2)));
+//		project->setCurrentViewId(portal->getInt(3));
+		int pId = portal->getInt(3);
+		
+		//load all views
+		bool hasViews = true;
+		while(hasViews)
+		{
+			project->addView(portal->getInt(5));
+			flag = portal->fetchRow();
+			if(!flag || (portal->getInt(0)!=project->id()))
+				hasViews = false;
+		}
+		
+		project->setCurrentViewId(pId);
+		metaModel_->projectMap()[project->id()] = project;
+	}
+
+	delete portal;
+	return true;
+
+}
+
+//! Load information about a particular project
+bool 
+TeDatabase::loadProject(TeProject* project)
+{
+	if(!project)
+		return false;
+	
+	//sql
+	string get = " SELECT te_project.*, te_project_view.* ";
+	get += " FROM te_project LEFT JOIN te_project_view ";
+	get += " ON te_project.project_id = te_project_view.project_id ";
+
+	if(project->id()>0)
+		get += " WHERE  te_project.project_id = "+ Te2String(project->id());
+	else if (!project->name().empty())
+		get += " WHERE  te_project.name = '"+ project->name() +"'";
+	else 
+		return false;
+
+	get += " ORDER BY te_project.project_id, te_project_view.view_id";
+
+	TeDatabasePortal* portal = this->getPortal();
+	if(!portal)
+		return false;
+	if (!portal->query(get) || !portal->fetchRow())
+	{	
+		delete portal;
+		return false;
+	}
+
+	project->setId (portal->getInt(0));
+	project->setDatabase(this);
+	project->setName(string(portal->getData(1)));
+	project->setDescription(string(portal->getData(2)));	
+	int currentViewId = portal->getInt(3);
+	
+	//load all views
+	bool hasViews = true;
+	while(hasViews)
+	{
+		project->addView(portal->getInt(5));
+		bool flag = portal->fetchRow();
+		if(!flag || (portal->getInt(0)!=project->id()))
+			hasViews = false;
+	}
+	project->setCurrentViewId(currentViewId); //the views vector need be filled
+		
+	metaModel_->projectMap()[project->id()] = project;
+	delete portal;
+	return true;
+}
+	
+//! Update information about a layer
+bool 
+TeDatabase::updateProject(TeProject *project)
+{
+	if (!project)
+		return false;
+	int projectId = project->id();
+	if (projectId <= 0)
+		return false;
+
+	//update project information
+	string sql = " UPDATE te_project SET ";
+	sql += " name = '" + project->name() +"'";
+	sql += ", description = '" + project->description() +"'";
+	sql += ", current_view = "+ Te2String(project->getCurrentViewId());
+	sql += " WHERE project_id = "+ Te2String(project->id());
+	if (!this->execute (sql))
+	{
+		this->errorMessage_ = "\nError updating project information";
+		return false;
+	}	
+	
+	//delete relation
+	sql = "DELETE FROM te_project_view WHERE project_id =" + Te2String(project->id());
+	if (!this->execute (sql))
+	{
+		this->errorMessage_ = "Error deleting project/view relation";
+		return false;
+	}
+	const TeViewVector vv = project->getViewVector();
+	for (unsigned int i=0; i<vv.size(); ++i)
+	{
+		sql = "INSERT INTO te_project_view VALUES(" + Te2String(projectId) + "," + Te2String(vv[i]) + ")";
+		if (!this->execute (sql))
+		{
+			this->errorMessage_ = "Error inserting project/view relation";
+			return false;
+		}
+	}
+	return true;
+}
+
+//! Delete a project from the database
+bool 
+TeDatabase::deleteProject(int projectId)
+{
+	string sql = "DELETE FROM te_project_view WHERE project_id =" + Te2String(projectId);
+	if (!this->execute (sql))
+	{
+		this->errorMessage_ = "Error deleting project/view relation";
+		return false;
+	}
+	sql = "DELETE FROM te_project WHERE project_id =" + Te2String(projectId);
+	if (!this->execute (sql))
+	{
+		this->errorMessage_ = "Error deleting te_project entry";
+		return false;
+	}
+	
+	// delete project and its entry in the project map
+	TeProject* proj = metaModel_->projectMap()[projectId];
+	metaModel_->projectMap().erase(projectId);
+	if(proj)
+		delete proj;
+	return true;
+}
+
+//! Insert a project/view relation
+bool 
+TeDatabase::insertProjectViewRel(int projectId, int viewId)
+{
+	string sql = "INSERT INTO te_project_view VALUES(" + Te2String(projectId) + "," + Te2String(viewId) + ")";
+	if (!this->execute (sql))
+	{
+		this->errorMessage_ = "Error inserting project/view relation";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDatabase::deleteProjectViewRel(int projectId, int viewId)
+{
+	string sql ="DELETE FROM te_project_view WHERE project_id = ";
+	       sql += Te2String(projectId);
+		   sql += " AND view_id = ";
+		   sql += Te2String(viewId);
+	if (!this->execute (sql))
+	{
+		this->errorMessage_ = "Error removing project/view relation";
+		return false;
+	}
+	return true;
+}
+
+bool TeDatabase::projectExist(const string& projectName)
+{
+	TeDatabasePortal* portal = this->getPortal();
+
+	if(!portal)
+		return false;
+
+	string sql = "SELECT name FROM te_project WHERE " +  this->toUpper("name") + " = '" + TeConvertToUpperCase(projectName) + "'";
+
+	if(!portal->query(sql))
+	{	
+		portal->freeResult();
+		delete portal;
+		return false;
+	}
+
+	if(portal->fetchRow())
+	{
+		portal->freeResult();
+		delete portal;
+		return true;		
+	}
+
+	portal->freeResult();
+	delete portal;
+	return false;
+}
+
+bool TeDatabase::createPolygonGeometry(const string& tableName)
+{
+	if(tableName.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "geom_id";
+	attGeomId.rep_.type_ = TeUNSIGNEDINT;
+	attGeomId.rep_.isAutoNumber_ = true;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attObjId;
+	attObjId.rep_.name_ = "object_id";
+	attObjId.rep_.type_ = TeSTRING;
+	attObjId.rep_.numChar_ = 255;
+	attObjId.rep_.null_ = false;
+	attList.push_back(attObjId);}
+
+	{TeAttribute attSpatial;
+	attSpatial.rep_.name_ = "spatial_data";
+	attSpatial.rep_.type_ = TePOLYGONTYPE;
+	attList.push_back(attSpatial);}
+
+	if(!createTable(tableName, attList))
+		return false;
+
+	string idxName = "te_idx_"  + tableName + "_obj";
+
+	return createIndex(tableName, idxName, "object_id");
+}
+
+bool TeDatabase::createLineGeometry(const string& tableName) 
+{
+	if(tableName.empty())
+		return false;
+
+	TeAttributeList attList;
+
+	{TeAttribute attGeomId;
+	attGeomId.rep_.name_ = "geom_id";
+	attGeomId.rep_.type_ = TeUNSIGNEDINT;
+	attGeomId.rep_.isAutoNumber_ = true;
+	attGeomId.rep_.isPrimaryKey_ = true;
+	attGeomId.rep_.null_ = false;
+	attList.push_back(attGeomId);}
+
+	{TeAttribute attObjId;
+	attObjId.rep_.name_ = "object_id";
+	attObjId.rep_.type_ = TeSTRING;
+	attObjId.rep_.numChar_ = 255;
+	attObjId.rep_.null_ = false;
+	attList.push_back(attObjId);}
+
+	{TeAttribute attSpatial;
+	attSpatial.rep_.name_ = "spatial_data";
+	attSpatial.rep_.type_ = TeLINE2DTYPE;
+	attList.push_back(attSpatial);}
+
+	if(!createTable(tableName, attList))
+		return false;
+
+	string idxName = "te_idx_"  + tableName + "_obj";
+
+	return createIndex(tableName, idxName, "object_id");
+}
+
+bool 
+TeDatabase::deleteRelation(const string& name, const string& table)
+{
+	string relation = "ALTER TABLE " + table + " DROP ";
+	relation += " CONSTRAINT " + name;
+	return execute(relation);
+}
+
+bool 
+TeDatabase::dropDBView(const string& dbViewName)
+{
+   string del = "DROP VIEW " + dbViewName;
+   return (execute(del));
+} 
+
+bool 
+TeDatabase::updateBBox(const string& tableName, const string& keyColumnName, int keyValue, const TeBox& box)
+{
+	string upd = "UPDATE "+tableName+" SET lower_x=" + Te2String(box.x1_,15);
+	upd += ", lower_y=" + Te2String(box.y1_, 15);
+	upd += ", upper_x=" + Te2String(box.x2_, 15);
+	upd += ", upper_y=" + Te2String(box.y2_, 15);
+	upd += " WHERE " + keyColumnName + "=" + Te2String(keyValue);
+	return execute(upd);
+}
+bool 
+TeDatabase::beginTransaction()
+{
+	transactionCounter_++; 
+	return true;
+} 
+
+bool 
+TeDatabase::commitTransaction()
+{
+	transactionCounter_ = max(transactionCounter_-1, 0);
+	return true;
+} 
+
+bool 
+TeDatabase::rollbackTransaction()
+{
+	transactionCounter_ = max(transactionCounter_-1, 0);
+	return true;
+} 
+
+TeBox 
+TeDatabase::getThemeBox(TeTheme* theme)
+{
+	TeBox bb;
+	if (!theme)
+		return bb;
+
+	TeLayer* layer = theme->layer();
+	if (layer->hasGeometry(TeRASTER))
+		bb = layer->box();
+
+	if (layer->hasGeometry(TeRASTERFILE))
+		updateBox(bb,layer->getRepresentation(TeRASTERFILE)->box_);
+
+	string colTabName = theme->collectionTable();
+	if (colTabName.empty())
+		return bb;
+
+	string sqlfrom;
+	string geomTable;
+	if (layer->hasGeometry(TePOINTS))
+	{
+		geomTable = layer->tableName(TePOINTS);
+		sqlfrom = colTabName + " LEFT JOIN " + geomTable;
+		sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
+		TeBox bpt;
+		if (getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TePOINTS,bpt))
+			updateBox(bb,bpt);
+	}
+	if (layer->hasGeometry(TeLINES))
+	{
+		geomTable = layer->tableName(TeLINES);
+		sqlfrom = colTabName + " LEFT JOIN " + geomTable;
+		sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
+		TeBox bln;
+		if (getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeLINES,bln))
+			updateBox(bb,bln);
+	}
+	if (layer->hasGeometry(TePOLYGONS))
+	{
+		geomTable = layer->tableName(TePOLYGONS);
+		sqlfrom = colTabName + " LEFT JOIN " + geomTable;
+		sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
+		TeBox bpol;
+		if (getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TePOLYGONS,bpol))
+			updateBox(bb,bpol);
+	}
+
+	if (layer->hasGeometry(TeCELLS))
+	{
+		geomTable = layer->tableName(TeCELLS);
+		sqlfrom = colTabName + " LEFT JOIN " + geomTable;
+		sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
+		TeBox bpol;
+		if (getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeCELLS,bpol))
+			updateBox(bb,bpol);
+	}
+
+	if (layer->hasGeometry(TeTEXT))
+	{
+		geomTable = layer->tableName(TeTEXT);
+		sqlfrom = colTabName + " LEFT JOIN " + geomTable;
+		sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
+		TeBox bpol;
+		if (getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeTEXT,bpol))
+			updateBox(bb,bpol);
+	}	
+
+	return bb;
+}
+
+// End TeDatabase Methods
+
+// Begin TeDatabasePortal Methods
+
+TeDatabasePortal::TeDatabasePortal():
+	db_(0),			
+	numRows_(0),
+	numFields_ (0),	
+	errorMessage_(""),
+	errorNumber_(0)
+	{}
+
+TeDatabasePortal::~TeDatabasePortal ()
+{
+}
+
+double 
+TeDatabasePortal::getDouble (int i)
+{  
+	char* val = getData(i); 
+	return atof(val); 
+}
+
+double 
+TeDatabasePortal::getDouble (const string& s)
+{  
+	char* val = getData(s); 
+	return atof(val); 
+}
+
+int 
+TeDatabasePortal::getInt (int i)
+{  
+	char* val = getData(i); 
+	return atoi(val); 
+}
+
+int 
+TeDatabasePortal::getInt (const string& s)
+{  
+	char* val = getData(s); 
+	return atoi(val); 
+}
+
+bool 
+TeDatabasePortal::fetchGeometry (TePolygon& geom, const unsigned int&)
+{
+	return fetchGeometry(geom);
+}
+
+bool 
+TeDatabasePortal::fetchGeometry (TeLine2D& geom, const unsigned int&)
+{
+	return fetchGeometry(geom);
+}
+	
+bool 
+TeDatabasePortal::fetchGeometry (TeNode& geom, const unsigned int&)
+{
+	return fetchGeometry(geom);
+}
+
+bool 
+TeDatabasePortal::fetchGeometry (TePoint& geom, const unsigned int&)
+{
+	return fetchGeometry(geom);
+}
+
+bool
+TeDatabasePortal::fetchGeometry (TeCell& cell)
+{
+	int index = atoi(getData("geom_id"));
+	string object_id = getData("object_id");
+	TeBox b (atof(getData("lower_x")),atof(getData("lower_y")),atof(getData("upper_x")),atof(getData("upper_y")));
+	cell.geomId(index);
+	cell.objectId(object_id);
+	cell.setBox (b);
+	cell.column(atoi(getData("col_number")));
+	cell.line(atoi(getData("row_number")));
+	return (fetchRow());
+}
+
+bool
+TeDatabasePortal::fetchGeometry (TeCell& cell, const unsigned int& initIndex)
+{
+	int index = atoi(getData(initIndex));
+	string object_id = getData(initIndex+1);
+	TeBox b (atof(getData(initIndex+2)),atof(getData(initIndex+3)),atof(getData(initIndex+4)),atof(getData(initIndex+5)));
+	cell.geomId(index);
+	cell.objectId(object_id);
+	cell.setBox (b);
+	cell.column(atoi(getData(initIndex+6)));
+	cell.line(atoi(getData(initIndex+7)));
+	return (fetchRow());
+}
+
+TeAttribute TeDatabasePortal::getAttribute (int i)
+{
+	TeAttributeList::iterator it = attList_.begin();
+	int j = 0;
+	while ( it != attList_.end() )
+	{
+		if (i == j)
+			return (*it);
+		++it;
+		j++;
+	}
+	return TeAttribute();
+}
+
+TeAttribute TeDatabasePortal::getAttribute (const string& s)
+{
+	TeAttributeList::iterator it = attList_.begin();
+	while ( it != attList_.end() )
+	{
+		if (TeConvertToUpperCase(s) == TeConvertToUpperCase((*it).rep_.name_))
+			return (*it);
+		++it;
+	}
+	return TeAttribute();
+}
+
+int 
+TeDatabasePortal::getColumnIndex (const string& s)
+{
+	TeAttributeList::iterator it = attList_.begin();
+	int j = 0;
+	while ( it != attList_.end() )
+	{
+		if (TeConvertToUpperCase(s) == TeConvertToUpperCase((*it).rep_.name_))
+			return j;
+		++it;
+		j++;
+	}
+	return -1;
+}
+
+string 
+TeDatabasePortal::getColumnName (int i)
+{
+	TeAttributeList::iterator it = attList_.begin();
+	int j=0;
+	while ( it != attList_.end() )
+	{
+		if (j==i)
+			return (*it).rep_.name_;
+		++it;
+		j++;
+	}
+	return "";
+}
+
+
+TeViewTree*
+TeDatabasePortal::getViewTree ()
+{
+	TeViewTree *tree = new TeViewTree();
+	tree->id (atoi(getData("theme_id")));
+	tree->name (getData("name"));
+	tree->priority(atoi(getData("priority")));
+	//Update the tree also with parent_id and node_type from te_theme table
+	tree->parentId(atoi(getData("parent_id")));
+	tree->type(atoi(getData("node_type")));	
+	//Is it necessary to set parent??
+	return tree;
+}
+
+TeLegendEntry 
+TeDatabasePortal::getLegend ()
+{
+	TeLegendEntry leg;
+	leg.id (atoi(getData("legend_id")));
+	leg.theme (atoi(getData("theme_id")));
+	leg.group (atoi(getData("group_id")));
+
+	string data;
+	data = getData("num_objs");
+	leg.count(atoi(data.c_str()));
+	data = getData("lower_value");
+	leg.from(data);
+	data = getData("upper_value");
+	leg.to(data);
+	data = getData("label");
+	leg.label(data);
+	return leg;
+}
+
+void
+TeDatabasePortal::getVisual(TeVisual* vis)
+{
+	TeGeomRep rep = (TeGeomRep)atoi (getData("geom_type"));
+
+	TeColor cor(atoi(getData("red")),atoi(getData("green")),atoi(getData("blue")));
+	vis->color(cor);
+	vis->transparency(atoi(getData("transparency")));
+
+	TeColor ccor(atoi(getData("contour_red")),atoi(getData("contour_green")),atoi(getData("contour_blue")));
+	vis->contourColor(ccor);
+	vis->contourWidth(atoi(getData("contour_width")));
+	vis->contourTransparency(atoi(getData("contour_transp")));
+
+	if(rep == TePOLYGONS || rep == TeCELLS)
+	{
+		vis->contourWidth(atoi(getData("width")));
+		vis->contourStyle(atoi(getData("contour_symb_id")));
+		vis->style(atoi(getData("symb_id")));
+	}
+	else if(rep == TeLINES)
+	{
+		vis->width(atoi(getData("width")));
+		vis->style(atoi(getData("symb_id")));
+	}
+	else if(rep == TePOINTS)
+	{
+		vis->size(atoi(getData("size_value")));
+		vis->style(atoi(getData("symb_id")));
+	}
+	else if(rep == TeTEXT)
+		vis->size(atoi(getData("size_value")));
+
+	vis->family(getData("family"));
+	vis->bold (getBool("bold"));
+	vis->italic (getBool("italic"));
+	vis->fixedSize (getBool("fixed_size"));
+
+	vis->alignmentVert(getDouble("alignment_vert"));
+	vis->alignmentHoriz(getDouble("alignment_horiz"));
+
+	vis->tabSize(atoi(getData("tab_size")));
+	vis->lineSpace(atoi(getData("line_space")));
+}
+
+bool 
+TeDatabasePortal::fetchGeometry (TeText& t)
+{
+	TeCoord2D c(getDouble("x"), getDouble("y"));
+	string txt = getData ("text_value");
+	TeText t2(c,txt);
+	t2.geomId(atoi(getData("geom_id")));
+	t2.objectId(string(getData("object_id")));
+	t2.setAngle (getDouble("angle"));
+	t2.setHeight (getDouble("height"));
+	t2.setAlignmentVert(getDouble("alignment_vert"));
+	t2.setAlignmentHoriz(getDouble("alignment_horiz"));
+	t = t2;
+	return (fetchRow());
+}
+
+bool 
+TeDatabasePortal::fetchGeometry (TeText& t, const unsigned int& initIndex)
+{
+	TeCoord2D c(getDouble(initIndex+2), getDouble(initIndex+3));
+	string txt = getData(initIndex+4);
+	TeText t2(c,txt);
+	t2.geomId(atoi(getData(initIndex)));
+	t2.objectId(string(getData(initIndex+1)));
+	t2.setAngle (getDouble(initIndex+5));
+	t2.setHeight (getDouble(initIndex+6));
+	t2.setAlignmentVert(getDouble(initIndex+7));
+	t2.setAlignmentHoriz(getDouble(initIndex+8));
+	t = t2;
+	return (fetchRow());
+}
+
+bool 
+TeDatabasePortal::fetchGeometry (TeArc& arc)
+{
+	arc.fromId(atoi(getData(2)));
+	arc.toId(atoi(getData(3)));
+	arc.geomId(atol(getData(0)));
+	arc.objectId(string(getData(1)));
+	return fetchRow();
+}
+
+bool 
+TeDatabasePortal::fetchGeometry (TeArc& arc, const unsigned int& initIndex)
+{
+	arc.fromId(atoi(getData(initIndex+2)));
+	arc.toId(atoi(getData(initIndex+3)));
+	arc.geomId(atol(getData(initIndex+0)));
+	arc.objectId(string(getData(initIndex+1)));
+	return fetchRow();
+}
+
+bool	
+TeDatabasePortal::getVisual(TeVisual* vis, TeGeomRep& rep, const unsigned int& initIndex)
+{
+	string legendId = this->getData(initIndex);
+	if(legendId.empty())
+		return false;
+
+	rep = (TeGeomRep)atoi (getData(initIndex+1)); //geom_type = 1
+
+	TeColor cor(atoi(getData(initIndex+3)),atoi(getData(initIndex+4)),atoi(getData(initIndex+5)));
+	vis->color(cor);
+	vis->transparency(atoi(getData(initIndex+6)));
+
+	TeColor ccor(atoi(getData(initIndex+9)),atoi(getData(initIndex+10)),atoi(getData(initIndex+11)));
+	vis->contourColor(ccor);
+	vis->contourWidth(atoi(getData(initIndex+13)));
+	vis->contourTransparency(atoi(getData(initIndex+12)));
+
+	if(rep == TePOLYGONS || rep == TeCELLS)
+	{
+		vis->contourWidth(atoi(getData(initIndex+13)));
+		vis->contourStyle(atoi(getData(initIndex+8)));
+		vis->style(atoi(getData(initIndex+2)));
+	}
+	else if(rep == TeLINES)
+	{
+		vis->width(atoi(getData(initIndex+7)));
+		vis->style(atoi(getData(initIndex+2)));
+	}
+	else if(rep == TePOINTS)
+	{
+		vis->size(atoi(getData(initIndex+14)));
+		vis->style(atoi(getData(initIndex+2)));
+	}
+	else if(rep == TeTEXT)
+		vis->size(atoi(getData(initIndex+14)));
+
+	vis->family(getData(initIndex+16));
+	vis->bold (getBool(initIndex+17));
+	vis->italic (getBool(initIndex+18));
+	vis->fixedSize (getBool(initIndex+23));
+
+	vis->alignmentVert(getDouble(initIndex+19));
+	vis->alignmentHoriz(getDouble(initIndex+20));
+
+	vis->tabSize(atoi(getData(initIndex+21)));
+	vis->lineSpace(atoi(getData(initIndex+22)));
+	return true;
+}
+
+bool	
+TeDatabasePortal::getRasterVisual(TeRasterVisual& vis, const unsigned int& initIndex)
+{
+	string themeId = getData(initIndex);
+	if(themeId.empty())
+		return false;
+
+	vis.setSrcBand(getInt(initIndex+1));
+	vis.setDestBand(getInt(initIndex+2));
+	vis.setTransfFunction(static_cast<TeRasterTransform::TeRasterTransfFunctions>(getInt(initIndex+3)));
+	if (vis.getTransfFunction() == TeRasterTransform::TeExtractRGB || 
+		vis.getTransfFunction() == TeRasterTransform::TeExtractBands)
+	{
+		vis.setBChannelMapping(getInt(initIndex+1),static_cast<TeRasterTransform::TeRGBChannels>(getInt(initIndex+2)));
+	}
+
+	if (vis.getTransfFunction() == TeRasterTransform::TeMono2LUTMonoBand ||
+		vis.getTransfFunction() == TeRasterTransform::TeThree2LUTThreeBand)
+	{
+		vis.setBChannelMapping(getInt(initIndex+1),static_cast<TeRasterTransform::TeRGBChannels>(getInt(initIndex+2)));
+
+		std::string lutName = getData(initIndex+6);
+
+		if(lutName != vis.getLutTableName())
+		{
+			vis.setLutTableName(lutName);
+
+			TeDatabasePortal* portal = this->getDatabase()->getPortal();
+			if (!portal)
+				return false;
+
+			std::string get = "SELECT * FROM " + lutName + " ORDER BY index_id ASC ";
+
+			if (!portal->query(get) || !portal->fetchRow())	 // if there is no table, or table is empty
+			{
+				delete portal;
+				return false;
+			}
+
+			do
+			{
+				vis.lutr_.push_back(atoi(portal->getData(1)));
+				vis.lutg_.push_back(atoi(portal->getData(2)));
+				vis.lutb_.push_back(atoi(portal->getData(3)));
+			}while (portal->fetchRow());
+
+			vis.setLutSize(vis.lutr_.size());
+
+			delete portal;
+		}
+	}
+	
+	return true;
+}
+
+
+TeColor 
+TeDatabasePortal::getColor ()
+{
+	TeColor c(atoi(getData("red")), atoi(getData("green")), atoi(getData("blue")));
+	return c;
+}
+
+bool	
+TeDatabasePortal::getView(TeView& view, const unsigned int& initIndex)
+{
+	string viewId = getData(initIndex);
+	if(viewId.empty())
+		return false;
+	view.id(atoi(viewId.c_str()));
+	view.name(getData(initIndex+2));
+	view.user(getData(initIndex+3));
+	view.isVisible(getBool(initIndex+4));
+	view.setCurrentBox(TeBox(getDouble(initIndex+5), getDouble(initIndex+6), getDouble(initIndex+7), getDouble(initIndex+8)));
+	if( strlen( getData(initIndex+9) ) == 0 )
+		view.setCurrentTheme(-1);
+	else
+		view.setCurrentTheme(getInt(initIndex+9));
+	return true;
+}
+
+bool	
+TeDatabasePortal::getProjection(TeProjection** proj, const unsigned int& initIndex)
+{
+	string projId = getData(initIndex);
+	if(projId.empty())
+		return false;
+
+	TeDatum datum (	getData(initIndex+11),
+					getDouble(initIndex+12),
+					getDouble(initIndex+13),
+					getDouble(initIndex+14),
+					getDouble(initIndex+15),
+					getDouble(initIndex+16));
+
+	TeProjectionParams mProjPars;
+	mProjPars.datum = datum;
+	mProjPars.name = getData(initIndex+1);
+	mProjPars.lat0 = getDouble(initIndex+3)*TeCDR;
+	mProjPars.lon0 = getDouble(initIndex+2)*TeCDR;
+	mProjPars.offx = getDouble(initIndex+4);
+	mProjPars.offy = getDouble(initIndex+5);
+	mProjPars.stlat1 = getDouble(initIndex+6)*TeCDR;
+	mProjPars.stlat2 = getDouble(initIndex+7)*TeCDR;
+	mProjPars.units = getData(initIndex+8);
+	mProjPars.scale = getDouble(initIndex+9);
+	mProjPars.hemisphere = (TeHemisphere)getInt(initIndex+10);
+
+	*proj = TeProjectionFactory::make(mProjPars);
+	if(!*proj)
+		return false;
+
+	(*proj)->id(atoi(projId.c_str()));
+	return true;
+}
+
+void
+TeDatabasePortal::getViewNodeParams (TeViewNodeParams& params, const unsigned int& initIndex)
+{
+	params.name_ = string (this->getData(initIndex+3));	//name
+	params.id_ = this->getInt(initIndex);				// id
+	params.viewId_ = this->getInt(initIndex+2);			//view id
+	params.nodeType_ = 	this->getInt(initIndex+6);		//node type
+	params.priority_ = 	this->getInt(initIndex+5);		//priority  
+	params.myParentId_ = this->getInt(initIndex+4);	//parent id
+}
+
+bool
+TeDatabasePortal::getTheme(TeAbstractTheme& theme, const unsigned int& initIndex)
+{
+	string themeId = getData(initIndex);
+	if(themeId.empty())
+		return false;
+		
+	theme.id(atoi(themeId.c_str()));
+	theme.view (atoi(this->getData (initIndex+2)));
+	theme.name(string (this->getData(initIndex+3)));
+	theme.parentId( atoi(this->getData (initIndex+4)));
+	theme.type ((TeViewNodeType)this->getInt(initIndex+6));
+	theme.priority(this->getInt(initIndex+5));
+	theme.minScale (this->getDouble (initIndex+7));
+	theme.maxScale (this->getDouble (initIndex+8));
+	theme.attributeRest(string(this->getData (initIndex+9)));
+	theme.spatialRest(string(this->getData (initIndex+10)));
+	theme.temporalRest(string(this->getData (initIndex+11)));
+	theme.visibleRep(atoi(this->getData (initIndex+13)));
+	theme.visibility(atoi(this->getData (initIndex+14)));
+	theme.setThemeBox(TeBox(getDouble(initIndex+15), getDouble(initIndex+16), getDouble(initIndex+17), getDouble(initIndex+18)));
+
+	if(theme.type()==TeTHEME)
+	{
+		static_cast<TeTheme&>(theme).collectionTable(string(this->getData (initIndex+12)));
+		static_cast<TeTheme&>(theme).collectionAuxTable(static_cast<TeTheme&>(theme).collectionTable() + "_aux");
+		static_cast<TeTheme&>(theme).layerId (atoi(this->getData(initIndex+1)));
+	}
+	else if(theme.type()==TeEXTERNALTHEME)
+	{
+		static_cast<TeExternalTheme&>(theme).collectionTable(string(this->getData (initIndex+12)));
+		static_cast<TeExternalTheme&>(theme).collectionAuxTable(static_cast<TeExternalTheme&>(theme).collectionTable() + "_aux");
+	}
+	else if(theme.type()==TeEXTERNALTHEME)
+	{
+		static_cast<TeTheme&>(theme).collectionTable(string(this->getData (initIndex+12)));
+		static_cast<TeTheme&>(theme).collectionAuxTable(static_cast<TeTheme&>(theme).collectionTable() + "_aux");
+	}
+
+	theme.setCreationTime(this->getDate(initIndex+19));
+
+	return true;
+}
+
+bool	
+TeDatabasePortal::getGrouping(TeGrouping& group, const unsigned int& initIndex)
+{
+	string groupThemeId = getData(initIndex);
+	if(groupThemeId.empty())
+		return false;
+
+	TeAttributeRep atRep;
+	string attname = getData (initIndex+2);
+	string norname = getData (initIndex+5);
+	int f = attname.find("(");
+	if(f >= 0)
+	{
+		string alias = attname;
+		attname = attname.substr(0, f);
+		alias = alias.substr(f+1);
+		alias = alias.substr(0, alias.size()-1);
+		map<string, string>& m = this->getDatabase()->mapThemeAlias()[atoi(groupThemeId.c_str())];
+		m[attname] = alias;
+	}
+	f = norname.find("(");
+	if(f >= 0)
+	{
+		string alias = norname;
+		norname = norname.substr(0, f);
+		alias = alias.substr(f+1);
+		alias = alias.substr(0, alias.size()-1);
+		map<string, string>& m = this->getDatabase()->mapThemeAlias()[atoi(groupThemeId.c_str())];
+		m[norname] = alias;
+	}
+
+	if(attname=="NONE")
+		attname = "";
+	
+	if(norname=="NONE")
+		norname = "";
+		
+	atRep.name_ = attname;
+	atRep.type_ = TeAttrDataType(atoi(getData(initIndex+3)));
+	group.groupAttribute_ = atRep;
+	group.groupNormAttribute_ = norname;
+	group.groupMode_ = TeGroupingMode(getInt(initIndex+4));
+	group.groupNumSlices_ = getInt(initIndex+1);
+	group.groupPrecision_ = getInt(initIndex+7);
+	group.groupStdDev_ = getDouble(initIndex+6);
+	group.groupFunction_ = getData(initIndex+8);
+	group.groupChronon_ = TeChronon(getInt(initIndex+9));
+	return true;
+}
+
+bool 
+TeDatabasePortal::getLegend (TeLegendEntry& leg, const unsigned int& initIndex)
+{
+	string legId = getData(initIndex);
+	if(legId.empty())
+		return false;
+
+	leg.id(atoi(getData(initIndex)));
+	leg.theme (atoi(getData(initIndex+1)));
+	leg.group (atoi(getData(initIndex+2)));
+	leg.count (atoi(getData(initIndex+3)));
+
+  std::string lower_value_str( getData(initIndex+4) );
+  leg.from( lower_value_str );
+  
+  std::string upper_value_str( getData(initIndex+5) );
+  leg.to( upper_value_str );
+  
+  std::string label_str( getData(initIndex+6) );
+  leg.label( label_str );
+    
+	return true;
+}
+
+bool	
+TeDatabasePortal::getAttrTable(TeTable& table, const unsigned int& initIndex)
+{
+	string tableName = this->getData(initIndex+2);
+	if(tableName.empty())
+		return false;
+
+	table.name (tableName);
+	table.setId(this->getInt(initIndex+0));
+	table.setLinkName(this->getData(initIndex+4));
+	table.setUniqueName(this->getData(initIndex+3));
+	table.attInitialTime(this->getData(initIndex+5));
+	table.attFinalTime(this->getData(initIndex+6));
+	table.attTimeUnit(TeChronon(this->getInt(initIndex+7)));
+	table.setTableType((TeAttrTableType)this->getInt(initIndex+8));
+	return true;
+}
+
+bool	
+TeDatabasePortal::getLayer(TeLayer& layer, const unsigned int& initIndex)
+{
+	string layerId = this->getData(initIndex);
+	if(layerId.empty())
+		return false;
+
+    layer.id(atoi(layerId.c_str()));
+	layer.name(string (this->getData(initIndex+2)));
+
+	std::string x1 = this->getData("te_layer.lower_x");
+	std::string y1 = this->getData("te_layer.lower_y");
+	std::string x2 = this->getData("te_layer.upper_x");
+	std::string y2 = this->getData("te_layer.upper_y");
+
+	layer.setLayerBox(TeBox(this->getDouble(initIndex+3),
+						this->getDouble(initIndex+4),
+						this->getDouble(initIndex+5),
+						this->getDouble(initIndex+6)));
+
+	layer.setEditionTime(this->getDate(initIndex+9));
+
+	return true;
+}
+
+bool	
+TeDatabasePortal::getRepresentation(TeRepresentation& rep, const unsigned int& initIndex)
+{
+	string repId = this->getData(initIndex);
+	if(repId.empty())
+		return false;
+
+	rep.id_ = atoi(repId.c_str());
+	TeGeomRep g = (TeGeomRep)atoi(this->getData(initIndex+2));
+	rep.geomRep_ = g;
+	rep.tableName_ = this->getData(initIndex+3);
+	rep.description_ = this->getData(initIndex+4);
+	rep.box_ = TeBox(this->getDouble(initIndex+5),
+				this->getDouble(initIndex+6),
+				this->getDouble(initIndex+7),
+				this->getDouble(initIndex+8));
+	rep.resX_ = this->getDouble(initIndex+9);
+	rep.resY_ = this->getDouble(initIndex+10);
+	rep.nCols_ = this->getInt(initIndex+11);
+	rep.nLins_ = this->getInt(initIndex+12);
+	return true;
+}
+
+
+
+// End TeDatabasePortal Methods
+
+
diff --git a/src/terralib/kernel/TeDatabase.h b/src/terralib/kernel/TeDatabase.h
old mode 100755
new mode 100644
index 3f2413f..f3887b2
--- a/src/terralib/kernel/TeDatabase.h
+++ b/src/terralib/kernel/TeDatabase.h
@@ -1,1742 +1,1778 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDatabase.h
-    \brief This file contains structures and definitions about database support in TerraLib
-*/
-#ifndef  __TERRALIB_INTERNAL_DATABASE_H
-#define  __TERRALIB_INTERNAL_DATABASE_H
-
-#ifdef WIN32 
-#pragma warning ( disable: 4786 ) 
-#endif
-
-#include "TeDefines.h"
-#include "TeDataTypes.h"
-#include "TeTable.h"
-#include "TeGeometry.h"
-#include "TeStatistics.h"
-#include "TeProject.h"
-#include "TeRaster.h"
-#include "TeView.h"
-#include "TeVisual.h"
-#include "TeMetaModelCache.h"
-#include "TeSharedPtr.h"
-
-class TeLayer;
-class TeDatabaseFactoryParams;
-class TeRasterParams;
-class TeTheme;
-class TeTime;
-class TeTimeInterval;
-
-#include <set>
-using namespace std;
-
-          
-/*! \enum TeCursorLocation
-	Location of a cursor on record set
- */
-enum TeCursorLocation { TeCLIENTESIDE, TeSERVERSIDE };
-
-/*! \enum TeCursorType
-	Type of cursor on record set
- */
-enum TeCursorType { TeUNIDIRECTIONAL, TeBIDIRECTIONAL, TeRANDOMACCESS };
-
-/*! \enum TeCursorEditType
-	Type of edition on record set cursor
- */
-enum TeCursorEditType { TeREADONLY, TeREADWRITE };
-
-/*! \enum TeCursorDataType
-	Type of edition on record set cursor
- */
-enum TeCursorDataType { TeBINARYCURSOR, TeTEXTCURSOR };
-
-
-/*! \enum TeSpatialIndexType
-	Type of spatial index
- */
-enum TeSpatialIndexType {TeRTREE, TeQUADTREE};
-
-//! A vector of objects identifications (object_id)
-typedef vector<string>				TeKeys;
-
-//! A Map of objects identifications (object_id) to a distance value
-typedef map<string, double>			TeKeysToDist;
-
-//! A Vector of pointers to TeGeometry 
-typedef vector<TeGeometry*> TeGeometryVect;
-
-//! A Map of the objects identifications to a set of statistical values
-typedef map<string, TeStatisticsDimensionVect>  TeObjectStatistics;
-
-
-class TeDatabasePortal;
-
-
-//! An abstract database class
-/*!
-	Instances of this classes represent connections
-	to a database server. It includes the host name, 
-	user name and password parameters of the connection.
-	It should be implemented by the drivers to specific
-	database servers as: MySQL, Ado, PostgreSQL or any
-	other server to be used in TerraLib applications.
-	When possible, default implementations using ANSI SQL
-	are provided. 
-	Methods that rely on special features of the derived
-	driver are left as purely virtual.
-
-  \sa
-  TeTheme, TeView, TeLayer, TeAttribute
-*/
-class TL_DLL TeDatabase 
-{
-public: 
-	//! Empty constructor
-	TeDatabase();
-
-	//! Destructor
-	virtual ~TeDatabase();
-
-	//! Assignment operator
-	virtual TeDatabase& operator=(const TeDatabase& other);
-
-	//! Operator ==
-	virtual bool operator== (const TeDatabase& other) const
-	{	
-		if (dbmsName_ != other.dbmsName_ ||
-			database_ != other.database_ ||
-			host_  != other.host_ ||
-			user_ != other.user_ )
-			return false;
-		return true;
-	}
-	/** @name Members
-	*  Methods to access class private members
-	*/
-	//@{		
-	//! Returns the error message from the server
-	virtual string errorMessage ()
-	{ return errorMessage_; }
-
-	//! Returns the error number from the server
-	virtual int	errorNum ()
-	{	return errorNumber_; }
-
-	//! Return the user name of the connection opened
-	string	user () 
-	{ return user_; }
-
-	//! Set the current user name to view
-	void user(string value) { user_=value;}
-
-	//! Returns the host name of the connection opened
-	string	host () 
-	{ return host_; }
-
-	//! Returns the user's password of the connection opened
-	string	password () 
-	{ return password_; }
-
-	//! Returns the database name of the connection opened
-	string	databaseName () 
-	{ return database_; }
-	
-	//! Returns the Database Management System name
-	string	dbmsName () 
-	{ return dbmsName_; }
-
-	//! Returns the port number of the connection opened
-	int	portNumber () 
-	{ return portNumber_; }
-
-	//! Returns the  map of layers in the database
-	TeLayerMap&	layerMap () 
-	{ return metaModel_->layerMap(); }
-
-	//! Returns the  map of views in the database
-	TeViewMap&	viewMap () 
-	{ return metaModel_->viewMap(); }
-
-	//! Returns the  map of themes in the database
-	TeThemeMap&	themeMap () 
-	{ return metaModel_->themeMap(); }
-
-	//! Returns the map of invalid themes in the database
-	TeThemeMap&	invalidThemeMap() 
-	{ return metaModel_->invalidThemeMap(); }
-
-	//! Returns the  map of projects in the database
-	TeProjectMap&  projectMap ()
-   { return metaModel_->projectMap(); }
-
-	//! Returns the  map of legends in the database
-	TeLegendEntryMap& legendMap () 
-	{ return metaModel_->legendMap(); }
-
-	//! Returns the set of relations between tables
-	multiset<int>& relationMSet () 
-	{ return metaModel_->relationMSet(); }
-
-	//! Clears structures in memory (legendMap, layerMap, viewMap...) used to optimize database access
-	virtual void clear();
-
-	//@}
-
-	/** @name Database
-	*  Methods related to database and connection creation. 
-	*  These methods return TRUE when the operation was successfull.
-	*  Otherwise return FALSE and when possible an error message is captured.
-	*/
-	//@{	
-	//! Creates a new database and open a connection to it
-	virtual bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int &port=-1, bool terralibModel=true) = 0;
-	
-	//! Opens a connection to a database server passing all parameters needed
-	virtual bool connect (const string& host, const string& user, const string& password, const string& database, int port = -1) = 0;
-
-	//! Show the server databases (only for MySQL, Oracle and PostgreSQL)
-	virtual bool showDatabases (const string& /* host */, const string& /* user */, const string& /* password */, vector<string>& /* dbNames */ , int /* port */ = -1)
-	{ return true; }
-
-	//! Opens a connection without parameters. When possible, should be implemented by the derived classes 
-	virtual bool connect (const string&  = "") { return false; };
-
-	//! Check if there is an opened connection
-	bool isConnected () 
-	{ return isConnected_; }
-
-	//! Closes the connection
-	virtual void close() = 0;
-
-	//! Returns a string that the describes the parameters of the database connected
-	/*
-		The expected return value is similar to: dbms_server;hostname;portnumber;databasename;user;password
-	*/
-	virtual string getDatabaseDescription();
-	
-  
-  /**
-   *  This is for TeFactory compatibility ( Invalid TeDatabaseFactory
-   *  requests will try to create an default object using this function ).
-   */
-  static TeDatabase* DefaultObject( const TeDatabaseFactoryParams& )
-  {
-    std::cout << std::endl << "TeDatabase::DefaultObject - " <<
-      " - Trying to create an invalid TeDatabase default object." <<
-      std::endl;
-    throw;
-      
-    return 0;
-  };
-  
-	//@}
-
-	/** @name Tables
-	  Methods related to table manipulation.
-		\note refer to data model documentation in order to understand the meanning of 
-		each tables and its fields
-	*/
-	//@{	
-
-	//! Returns a list of tables in a database
-	virtual bool listTables(vector<string>& /* tableList */) { return false; }
-
-	//! Verifies if a table exist in the database
-	virtual bool tableExist(const string& table) = 0;
-	
-	//! Verifies if a table has a column
-	virtual bool columnExist(const string& table, const string& column, TeAttribute& attr) = 0;
-
-	//! Update a column
-	virtual bool allowEmptyString(const string& /* tableName */, const string& /* column */) { return false; }
-
-	//! Verifies and modifies the column names of the table. It returns if the table was modified  
-	virtual bool validTable (TeTable& table);
-
-	//! Return the name of an attribute table given its identifier
-	string getTableName(int tableId);
-
-	//! Return a valid name for a table from a initial one
-	string getNewTableName(const string& n);
-
-	//! Concatenate field values
-	/*!
-      \param fNamesVec vector containing the fields to be concatenated
-	*/
-	virtual string getConcatFieldsExpression(const vector<string>& fNamesVec);
-
-	//! Creates a table
-	/*!
-      \param table table name
-      \param attr table list of attributes
-	 */
-	virtual bool createTable(const string& table, TeAttributeList &attr) = 0;
-
-	//! Deletes a table. Do not allow the deletion of model tables
-	 virtual bool deleteTable (const string& table);
-
-	//! Adds a column to a table
-	/*!
-      \param table table name
-      \param rep representation of the column being created
-	*/
-	virtual bool addColumn (const string& table, TeAttributeRep &rep) = 0;
-
-	//! Deletes a column to a table
-	/*!
-      \param table table name
-      \param colName name of the column being deleted
-	*/
-	virtual bool deleteColumn (const string& table, const string& colName);
-	
-	//! Creates a reationship between two tables
-	/*!
-      \param relName relationship name
-      \param table table that will receive the foreign key
-	  \param fieldName column that will be foreign key
-	  \param relatedTable table that exports the foreign key
-	  \param relatedField field that will the exported foreign key
-	  \param cascadeDeletion flag that indicates if the deletion should be propagated
-	*/
-	virtual bool createRelation (const string& relName, const string& table, const string& fieldName, 
-						const string& relatedTable, const string& relatedField, bool cascadeDeletion) = 0;
-
-	//! Checks if a relation exist
-	/*!
-      \param tableName table where the relashionship exists
-	  \param relName relationship name
-	*/
-	virtual TeDBRelationType existRelation(const string& tableName, const string& relName) = 0;
-
-	//! Removes a relation exist
-	/*!
-	  \param name relationship name
-      \param table table where the relashionship exists
-	  \return TRUE if succeed and FALSE otherwise
-	*/
-	virtual bool deleteRelation(const string& name, const string& table);
-
-	//@}
-	
-	/** @name Query
-	*  Methods related to query the database
-	*/
-	//@{	
-	//! Executes a SQL command that doesnt return a record set. Tipically a data definition comand
-	virtual bool execute ( const string &sql) = 0;
-
-	//! Returns a database portal.
-	/*!
-		A database portal is used to submit queries to the database and to navigate over the
-		resulting record set
-	*/
-	virtual TeDatabasePortal* getPortal () = 0;
-
-	//! Get the values that satisfy the query 
-	virtual bool inClauseValues(const string& query , const string& attribute, vector<string>& inClauseVector);
-
-	//@}
-
-	/** @name  Data Model
-		 Methods that create the database model suggested in TerraLib. 
-		 Classes in TerraLib materialize the DataModel suggested.
-	*/
-	//@{
-	//! Creates the entire TerraLib conceptual model.
-	/*
-      \param withIntegrity flag that indicates that the referencial integrity should be implemented.
-	  \param createIndex flag that indicate that the indexes should be created
-	*/
-	virtual bool createConceptualModel(bool withIntegrity = true, bool newDatabase = true, bool createIndex = true);
-
-	//! Creates the referencial integrity of the conceptual model
-	virtual bool defineIntegrity(void);
-
-	//! Create the indexes for the tables in the conceptual model
-	virtual bool createIndex(const string& tableName, const string& indexName, const string& columnsName);
-
-	//! Creates a table to store version database information 
-	virtual bool createDatabaseTable(); 
-	
-	//! Creates a table to store projectinon information
-	virtual bool createProjectionTable();
-
-	//! Creates a table to store Layers information
-	virtual bool createLayerTable ();
-
-	//! Creates a table to store Representations information
-	virtual bool createRepresentationTable ();
-
-	//! Creates a table to store Views information
-	virtual bool createViewTable ();
-
-	//! Creates a table to store Themes information
-	virtual bool createThemeTable ();
-
-	//! Creates a table to store the groupings associated with a theme
-	virtual bool createGroupingTable();
-
-	//! Creates a table to store information about the attribute tables used by a theme
-	virtual bool createThemeTablesTable();
-
-	//! Creates a table to store legends
-	virtual bool createLegendTable ();
-
-	//! Creates a table to store visual definitions
-	virtual bool createVisualTable();
-
-	//! Creates a table to store raster visual definitions
-	virtual bool createVisualRasterTable();
-
-	//! Creates a table to store information about the non-spatial tables associated to this layer
-	virtual bool createLayerTableTable();
-
-	//! Creates a table to store information about the external tables related to non-spatial tables of layers
-	virtual bool createTablesRelationTable();
-
-	//! Creates a table to store information about projects: an structure that groups views
-	virtual bool createProjectTable();
-
-	//! Creates a table to store the relation between project/views information
-	virtual bool createProjectViewTable();
-	//@}
-
-	/** @name  Project
-		 Methods related to the manipulation of projects
-	*/
-	//@{
-	//! Load information about all projects stored in the database
-	virtual bool loadProjectSet(); 
-
-	//! Load information about a particular project
-	virtual bool loadProject(TeProject* project); 
-	
-	//! Insert information about a project
-	virtual bool insertProject(TeProject *project) = 0;
-	
-	//! Update information about a project
-	virtual bool updateProject(TeProject *project);	
-
-	//! Delete a project from the database
-	virtual bool deleteProject(int projectId);	
-
-	//! Insert a project/view relation
-	virtual bool insertProjectViewRel(int projectId, int viewId);
-
-	//! Deletes a project/view relation
-	virtual bool deleteProjectViewRel(int projectId, int viewId);
-
-	//! Check whether a given project already exists in the database (it is not case sensitive).
-	virtual bool projectExist(const string& projectName);
-	//@}
-
-	/** @name  Geometries
-		 Methods that create tables that store the spatial data
-	*/
-	//@{
-
-	//! Creates a table for a polygon geometries
-	virtual bool createPolygonGeometry (const string& tableName);
-
-	//! Creates a table for line geometries
-	virtual bool createLineGeometry (const string& tableName);
-
-	//! Creates a table for point geometries
-	virtual bool createPointGeometry (const string& tableName);
-
-	//! Creates a table for cell geometries
-	virtual bool createCellGeometry (const string& tableName);
- 
-	//! Creates a table for a text geometries
-	virtual bool createTextGeometry (const string& tableName);
-
-	//! Creates a table for a arc geometries
-	virtual bool createArcGeometry (const string& tableName);
-
-	//! Creates a table for a node geometries
-	virtual bool createNodeGeometry (const string& tableName);
-
-	//! Creates a table to store raster representations of objects
-	virtual bool createRasterGeometry(const string& tableName);
-
-	//! Creates a table to store information about raster representation
-	virtual bool createRasterMetadataTable(const string& tableName);
-	
-    //! Creates a table for raster geometries
-	virtual bool createRasterTable (const string& tableName);
-
-	//! Creates a table to store information about objects in a theme
-	virtual bool createCollectionTable(const string& tableName);
-	//@}
-
-	/** @name Non-spatial tables
-	*  Retrieving/Inserting/Modifying generic tables in the database. 
-	*/
-	//@{
-	//! Retrieves information about some tables
-	/*
-		\param atts returning vector of tables information 
-		\param attType type of the tables that are being looked for (optional)
-		\return TRUE if any table was found and FALSE otherwise
-	*/
-	virtual bool getAttrTables(TeAttrTableVector& atts, TeAttrTableType attType = TeAllAttrTypes);
-
-	//! Inserts information about a link to an external table
-	/*
-		\param tableId table identification (from te_layer_table)
-		\param tField link column name of the static table
-		\param eTable name of the external table
-		\param eField name of the link column of the related table
-		\param relId returns the identification of the relation
-	*/
-	virtual bool insertRelationInfo(const int tableId, const string& tField,
-									const string& rTable, const string& rField, int& relId) = 0;
-
-	//! Inserts information about an attribute table
-	virtual bool insertTableInfo (int layerId, TeTable &table, const string& user="") = 0;
-
-	//! Updates information about an attribute table
-	virtual bool updateTableInfo (int layerId, TeTable &table, const string user="");
-
-	//! Retrieves the metainformation about an attribute table
-	virtual bool loadTableInfo(TeTable& table);
-
-	//! Saves a table and its contents in the database
-	virtual bool insertTable(TeTable &table);
-
-	//! Alter a property of a table 
-	virtual bool alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName="");
-
-	//! Alter the table name 
-	virtual bool alterTable(const string& oldTableName, const string& newTablename);
-
-	//! Saves a large binary objects (BLOB) in a row table 
-	virtual bool insertBlob (const string& tableName, const string& columnBlob, TeAttributeRep& columnId, const string& valueId, unsigned char* data, int size);
-
-	//! Saves a large binary objects (BLOB) in a row table 
-	virtual bool insertBlob (const string& tableName, const string& columnBlob, TeAttributeRep& columnId, const string& valueId, const string& fileName);
-
-	//! Saves a large binary objects (BLOB) in a row table 
-	virtual bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size) = 0;
-
-	//! Saves a large binary objects (BLOB) in a row table 
-	virtual bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, const string& fileName);
-	
-	//! Updates a table and its contents in the database
-	virtual bool updateTable	(TeTable &table);
-
-	//! Retrieves a table and its contents from the database
-	virtual bool loadTable		(const string& tableName, TeTable &table);
-
-	//! Retrieves a table (or part of it) accordingly to a criteria written in SQL
-	virtual bool selectTable	(const string& tableName, const string& criteria, TeTable &table);
-
-	//!	Deletes all tables, of a particular type, associated to a layer
-	virtual bool deleteLayerTable	(int layerId, TeAttrTableType ttype = TeAttrStatic);
-	//@}
-
-	/** @name Projection
-	*  Accessing/Inserting/Modifying projection information into the database. 
-	*/
-	//@{ 	
-
-	//! Insert information about a geographical projection
-	virtual bool insertProjection (TeProjection *proj) = 0;	
-
-	//! Updates information about a geographical projection
-	virtual bool updateProjection (TeProjection *proj);	
-
-	//! Retrieves information about a geographical projection identified by its database id
-	virtual TeProjection* loadProjection (int id);
-	//@}
-
-	/** @name Layers
-	*  Retrieving/Inserting/Modifying/Deleting layers in the database. 
-	*/
-	//@{ 
-	//! Insert information about a layer
-	virtual bool insertLayer	(TeLayer *layer) = 0;
-	
-	//! Update information about a layer
-	virtual bool updateLayer	(TeLayer *layer);	
-
-	//! Load information about all layers stored in the database
-	/*
-		\param loadAttrList  indicates if the attribute list of each attribute table should be loaded
-	*/
-	virtual bool loadLayerSet	(const bool& loadAttrList = true);
-
-	//! Load information about a particular layer 
-	/*
-		\param layer		a pointer to a layer that will be loaded from database
-		\param loadAttrList indicates if the attribute list of each attribute table should be loaded
-	*/
-	virtual bool loadLayer		(TeLayer* layer, const bool& loadAttrList = true);
-
-	//! Load layer tables 
-	/*
-		\param layer		a pointer to a layer whose attribute table will be loaded from database
-		\param loadAttrList indicates if the attribute list of each attribute table should be loaded
-	*/
-	virtual bool loadLayerTable (TeLayer* layer, const bool& loadAttrList = true);
-
-	//! Delete a particular layer passing its id
-	virtual bool deleteLayer	(int layerId);
-
-	//! Check if a particular layer exists (passing its id)
-	virtual bool layerExist		(int id);
-
-	//! Check if a particular layer exists (passing its name)
-	virtual bool layerExist		(string layerName);
-
-	//! Checks whether a given layer name is valid or already exists in the database
-	/*!
-		\param n		layer name to be checked
-		\return the modified valid layer name
-	*/	
-	virtual string getNewLayerName(const string& n);
-	//@}
-
-	/** @name Representation
-	*  Retrieving/Inserting/Modifying/Deleting representations in the database. 
-	*/
-	//@{ 
-	//! Inserts information about a geometrical representation
-	virtual bool insertRepresentation (int layerId, TeRepresentation& rep) = 0;	
-
-	//! Updates information about a geometrical representation
-	virtual bool updateRepresentation (int layerId, TeRepresentation& rep);	
-
-	//! Updates the box information of a layer in the corresponding metadata table
-	virtual bool updateLayerBox(TeLayer* layer);
-
-	//@}
-
-	/** @name Raster Tables
-	*  Retrieving/Inserting/Modifying/Deleting raster representations in the database. 
-	*/
-	//@{ 
-	//! Inserts information about a raster geometry associated to an object
-	/*!
-		\param tableName name of the table that stores the raster representation
-		\param par raster parameters 
-		\param objectId identification of the object associated to the raster geometry
-	*/
-	virtual bool insertRasterGeometry(const string& tableName, TeRasterParams& par, const string& objectId = "");
-
-	//! Updates the information about the raster geometry associated to an object of a layer
-	/*!
-		\param layerId layer unique database identification
-		\param par raster parameters 
-		\param objectId identification of the object associated to the raster geometry
-	*/
-	virtual bool updateRasterRepresentation(int layerId, TeRasterParams& par, const string& objectId="");
-
-	//! Returns the name of the table where the raster geometry associated to an object of a leyr
-	/*!
-		\param layerId layer unique database identification
-		\param objectId identification of the object associated to the raster geometry
-	*/
-	virtual string getRasterTable(int layerId, const string& objectId);
-	
-	//! Inserts metadata information about a particular raster geometry
-	/*!
-		\param tableName name of the table that stores the metadata
-		\param geomId  geometry unique database identification
-		\param par raster parameters 
-	*/
-	virtual bool insertRasterMetadata (const string& tableName, int geomId, TeRasterParams& par);
-
-	//! Updates metadata information about a particular raster geometry
-	/*!
-		\param tableName name of the table that stores the metadata
-		\param geomId  geometry unique database identification
-		\param par raster parameters 
-
-	*/	
-	virtual bool updateRasterMetadata (const string& tableName, int geomId, TeRasterParams& par);
-	//@}
-	/** @name Views
-	*  Retrieving/Inserting/Modifying/Deleting views in the database. 
-	*/
-	//@{ 
-	//! Inserts a view
-	virtual bool insertView (TeView *view) = 0;	
-
-	//! Updates a view
-	virtual bool updateView (TeView *view);	
-
-	//! Loads a set of views belonging to a user
-	/*
-		\param user			 the user name 
-		\param loadAttrList  indicates if the attribute list of each attribute table should be loaded
-		\param visualClass  identifies which concrete class od visual should be instantiated.
-		The default is TerraLib basic visual.
-	*/
-	virtual bool loadViewSet (const string& user, const bool& loadAttrList = true, const string& visualClass="tevisual");
-
-	//! Load a view
-	/*
-		\param view			a pointer to a view that will be loaded from database
-		\param loadAttrList indicates if the attribute list of each attribute table should be loaded
-		\param visualClass  identifies which concrete class od visual should be instantiated.
-		The default is TerraLib basic visual.
-	*/
-	virtual bool loadView (TeView* view, const bool& loadAttrList = true, const string& visualClass="tevisual");
-
-	//! Delete a view
-	virtual bool deleteView (int viewId);
-
-	//! Recursive inserting of a view tree.
-	virtual bool insertViewTree (TeViewTree *tree) = 0;	
-
-	//! Recursive load view tree.
-	/*
-		\param view			a pointer to a view that will be loaded from database
-		\param id			a specific theme or viewtree id of this view that will be loaded from database
-		\param loadAttrList indicates if the attribute list of each attribute table should be loaded
-		\param visualClass  identifies which concrete class od visual should be instantiated.
-		The default is TerraLib basic visual.
-	*/
-	virtual TeViewTree* loadViewTree(TeView* view, int id, const bool& loadAttrList = true, const string& visualClass = "tevisual");
-
-	//! Recusive updating of a view tree.
-	virtual bool updateViewTree (TeViewTree *tree);
-	
-	//! Check whether a given view already exists in the database
-	virtual bool viewExist(string viewName);
-
-	//@}
-
-	/** @name Themes
-	*  Retrieving/Inserting/Modifying/Deleting themes and group of themes in the database. 
-	*/
-	//@{ 
-	//! Inserts a group of themes in the database
-	virtual bool insertThemeGroup	(TeViewTree* tree) = 0;
-
-	//! Inserts an abstract theme in the database.
-	virtual bool insertTheme		(TeAbstractTheme *theme) = 0; 	
-
-	//! Updates an asbtract theme in the database
-	virtual bool updateTheme		(TeAbstractTheme *theme);
-
-	//! Loads a theme from the database
-	virtual bool loadTheme			(TeAbstractTheme *theme, const bool& loadAttrList = true, const string& visualClass = "tevisual");
-
-	//! Loads all attribute tables of a theme
-	virtual bool loadThemeTable		(TeTheme* theme, const bool& loadAttrList = true);
-
-	//! Erases the theme group identified by themeId
-	virtual bool deleteThemeGroup	(int themeId);
-
-	//! Erases the theme identified by themeId
-	virtual bool deleteTheme		(int themeId);
-
-	//! Erases the legends of a theme identified by themeId
-	virtual bool deleteLegend		(int themeId);
-	
-	//! Inserts information about a table used by a theme 
-	bool insertThemeTable(TeTheme *theme, TeTable& inputTable);
-
-	//! Inserts information about a table used by a theme 
-	virtual bool insertThemeTable	(int themeId, int tableId, int relationId, int tableOrder) = 0; 
-
-	//! Updates  information about the tables used by a theme 
-	virtual bool updateThemeTable	(TeTheme *theme);
-	
-	//! Removes a table from the theme
-	bool removeThemeTable(TeTheme *theme, int tableOrder);
-
-	//! Inserts information about a grouping used in a theme
-	virtual bool insertGrouping (int themeId, const TeGrouping& grouping);
-
-	//! Updates information about a grouping used in a theme
-	virtual bool updateGrouping (int themeId, const TeGrouping& grouping);
-
-	//! Generates the label position (x,y) to each object of a theme or of a particular object
-	virtual bool generateLabelPositions(TeTheme *theme, const std::string& objectId = "");
-
-	//! Check whether a given theme already exists in the database
-	virtual bool themeExist(string themeName);
-
-	//! Checks whether a given theme name is valid or already exists in the database
-	/*!
-		\param n		theme name to be checked
-		\return the modified valid theme name
-	*/	
-	virtual string getNewThemeName(const string& n);
-
-	//@}
-
-	/** @name Legend
-	*  Retrieving/Inserting/Modifying/Deleting legends in the database. 
-	*/
-	//@{ 
-	//! Inserts legend in the database
-	virtual bool insertLegend	(TeLegendEntry *legend) = 0;	
-	//! Updates legend entries in the database
-	virtual bool updateLegend	(TeLegendEntry *legend);	
-
-	virtual bool updateLegend   (vector<TeLegendEntry>& legVec);
-	virtual bool loadLegend		(TeAbstractTheme *theme, const string& visualClass = "tevisual");
-	virtual bool updateVisual	(TeLegendEntry *legend);
-	virtual bool updateVisual   (vector<TeLegendEntry>& legVec);
-	//@}
-
-	/** @name Polygon
-	// Accessing/Inserting/Modifying polygon geometries into the database
-	*/
-	//@{ 
-	//! Inserts a polygon set in a geometry table
-	virtual bool insertPolygonSet (const string& table, TePolygonSet &ps);	
-
-	//! Updates a polygon set in a geometry table
-	virtual bool updatePolygonSet (const string& table, TePolygonSet &ps);	
-
-	//! Returns all polygons in a table given a criteria expressed as an SQL where statement
-	virtual bool selectPolygonSet (const string& table, const string& criteria, TePolygonSet &ps);
-
-	//! Returns all polygons that represents objects of a particular theme
-	virtual bool loadPolygonSet	(TeTheme* theme, TePolygonSet &ps);
-
-	//! Returns all polygons  that represents objects of a particular geoid
-	virtual bool loadPolygonSet	(const string& table, const string& geoid, TePolygonSet &ps);
-
-	//! Returns all polygons inside a given box
-	virtual bool loadPolygonSet	(const string& table, TeBox &box, TePolygonSet &ps);
-
-	//! Returns a database portal to iterate over the polygons that are inside a given box
-	/*
-		\return A database portal pointer if there is any polygons inside the box
-		\return A null pointer if there isn't polygons to iterate
-		\note The database portal pointer should be deleted by the application
-	*/
-	virtual TeDatabasePortal* loadPolygonSet(const string& table, TeBox &box);
-
-	//! Returns the first polygon that contais a given coordinate
-	virtual bool locatePolygon		(const string& table, TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0);
-
-	//! Returns the polygons that contains a give coordinate
-	virtual bool locatePolygonSet   (const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons);
-
-	//! Inserts a polygon in a geometry table
-	virtual bool insertPolygon		(const string& table, TePolygon &p) = 0;	
-
-	//! Updates a polygon in a geometry table
-	virtual bool updatePolygon		(const string& table, TePolygon &p) = 0;
-	//@}
-
-	/** @name Line
-	*  Accessing/Inserting/Modifying Line geometries into the database. 
-	*/
-	//@{ 	
-	// Accessing/Inserting line geometries into the database
-	virtual bool insertLineSet	(const string& table, TeLineSet &ls);	
-	virtual bool updateLineSet	(const string& table,TeLineSet &ls);
-	virtual bool loadLineSet	(const string& table, const string& geoid, TeLineSet &ls);
-    virtual bool loadLineSet	(TeTheme* theme, TeLineSet &ls);
-	virtual bool loadLineSet	(const string& table, TeBox &box, TeLineSet &linSet);
-	virtual TeDatabasePortal*    loadLineSet (const string& table, TeBox &box);
-	virtual bool selectLineSet	(const string& table, const string& criteria, TeLineSet &ls);
-
-    virtual bool insertLine		(const string& table, TeLine2D &l) = 0;		
-	virtual bool updateLine		(const string& table, TeLine2D &l) = 0;
-	virtual bool locateLine		(const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
-	virtual bool locateLineSet	(const string& table, TeCoord2D &pt, TeLineSet & ls, const double& tol = 0.0);
-
-	//@}
-
-	/** @name Point
-	*  Accessing/Inserting/Modifying Point geometries into the database. 
-	*/
-	//@{ 	
-	// Accessing/Inserting point geometries into the database
-	virtual bool insertPointSet	(const string& table, TePointSet &ps);	
-    virtual bool updatePointSet (const string& table, TePointSet &ps);
-	virtual bool loadPointSet	(const string& table, TeBox &box, TePointSet &ps);
-	virtual TeDatabasePortal* loadPointSet	(const string& table, TeBox &box);
-	virtual bool loadPointSet	(const string& table, const string& geoid, TePointSet &ps);
-	virtual bool loadPointSet	(TeTheme* theme, TePointSet &ps);
-	virtual bool selectPointSet (const string& table, const string& criteria, TePointSet &ps);
-
-    virtual bool insertPoint	(const string& table, TePoint &p) = 0;	
-	virtual bool updatePoint	(const string& table, TePoint &p);
-	virtual bool locatePoint	(const string& table, TeCoord2D &pt, TePoint &point, const double& tol = 0.0);
-	virtual bool locatePointSet (const string& table, TeCoord2D &pt, TePointSet &pointSet, const double& tol=0.0);
-	//@}
-
-	/** @name Text
-	*  Accessing/Inserting/Modifying Text geometries into the database. 
-	*/
-	//@{ 	
-	// Accessing/Inserting text geometries into the database
-	virtual bool insertTextSet	(const string& table, TeTextSet &ts);	
-	virtual bool updateTextSet	(const string& table, TeTextSet &ts);	
-	virtual bool loadTextSet	(const string& table, const string& geoid, TeTextSet &ts);
-	virtual bool selectTextSet	(const string& table, const string& criteria, TeTextSet &ts);
-
-	virtual bool insertText		(const string& table, TeText &t) = 0;	
-	virtual bool updateText		(const string& table, TeText &t);
-	virtual bool locateText		(const string& table, TeCoord2D &pt, TeText &text, const double& tol = 0.0);
-	virtual bool locateTextSet	(const string& table, TeCoord2D &pt, TeTextSet &textSet, const double& tol = 0.0);
-	//@}
-
-	/** @name Arc
-	*  Accessing/Inserting/Modifying Arc geometries  into the database. 
-	*/
-	//@{ 	
-	//! Inserts an arc set geometry in the database.
-	virtual bool insertArcSet	(const string& table, TeArcSet &as);	
-
-	//! Updates arc set geometry in the database.
-	virtual bool updateArcSet	(const string& table, TeArcSet &as);	
-
-	//! Loads an arc geometry from the database that has the specified object id (geoid).
-	virtual bool loadArcSet		(const string& table, const string& geoid, TeArcSet &as);
-
-	//! Inserts an arc geometry in the database.
-	virtual bool insertArc		(const string& table,TeArc &arc) = 0;
-
-	//! Updates an arc geometry in the database.
-	virtual bool updateArc		(const string& table,TeArc &arc);
-	//@}
-
-	/** @name Node
-	*  Accessing/Inserting/Modifying Node geometries into the database. 
-	*/
-	//@{ 	
-	// Accessing/Inserting node geometries into the database
-	virtual bool insertNodeSet	(const string& table, TeNodeSet &ns);	
-	virtual bool updateNodeSet	(const string& table, TeNodeSet &ns);	
-	virtual bool loadNodeSet	(const string& table, const string& geoid, TeNodeSet &ps);
-
-	virtual bool insertNode		(const string& table, TeNode &node) = 0;	
-	virtual bool updateNode		(const string& table, TeNode &node);	
-	//@}
-
-	/** @name Cell
-	*  Accessing/Inserting/Modifying Cell geometries  into the database. 
-	*/
-	//@{ 	
-	// Accessing/Inserting cell geometries into the database
-	virtual bool insertCellSet	(const string& table, TeCellSet &cs);	
-	virtual bool updateCellSet	(const string& table, TeCellSet &cs);	
-	virtual bool loadCellSet	(const int& layerId, const string& table, const string& geoid, TeCellSet &cs);
-	virtual bool selectCellSet	(const int& layerId, const string& table, const string& criteria, TeCellSet &cs);
-
-	virtual bool insertCell		(const string& table, TeCell &c) = 0;
-	virtual bool updateCell		(const string& table, TeCell &c);
-	virtual bool locateCell		(const string& table, TeCoord2D &pt, TeCell &c, const double& tol = 0.0);
-	//@}
-
-	//! Removes a geometry from the given tableName
-	virtual bool removeGeometry(const string& tableName, const TeGeomRep& rep, const int& geomId);
-	
-	//! Insert a raster block into the database
-	/*!
-      \param table table name
-	  \param blockId block unique identifier
-	  \param ll  block lower left coordinate
-	  \param ur  block upper right coordinate
-	  \param buf block binary data
-	  \param size block size
-	  \param band block band
-	  \param res block resolution factor
-	  \param subband sub band definitiion
-	*/
-	virtual	bool insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char *buf,unsigned long size, int band=0, unsigned int res=1, unsigned int subband=0) = 0;
-
-	//! Inserts the entire visual of a Legend
-	virtual	bool insertVisual (TeLegendEntry *legend);
-
-	//! Insert raster visual
-	virtual bool insertRasterVisual (int themeId , TeRasterVisual* rasterVisual);
-
-	//! Returns the raster associated to a layer
-	virtual TeRaster* loadLayerRaster(int layerId, const string& objectId="", const char& mode = 'r');
-
-	//! Creates a lookup table (used for pallete raster representations)
-	virtual bool createLUTTable(const string& name);
-
-	//! Loads a look up table associated to a raster and fills its parameters
-	virtual bool loadRasterLUT(TeRasterParams* par);
-
-	//! Creates a spatial index for a spatial table. In order to get correct column names to index, see getSpatialIdxColumn method.
-	virtual bool createSpatialIndex(const string& table, const string& columns, TeSpatialIndexType /*type*/ = TeRTREE,short /* level */ =0,short /* tile */ =0);
-
-	//! Creates a spatial metadata for a spatial table. It is implemented only in spatial databases.
-	virtual bool insertMetadata(const string& /* table */, const string& /* column */, double /* tolx */, double /* toly */,TeBox &/* box */,short /* srid */ =0) { return true; };
-
-	//! Returns the name of the column that wiil be the spatially indexed, for a given type of geometry table 
-	virtual string getSpatialIdxColumn(TeGeomRep rep);
-
-	//! Update box information in a table that has a set of columns to store a box value
-	/*
-		This method gives to the drivers the ability to update box columns, considering precision issues
-		that are particular to the driver. The box should be stored in 4 columns (lower_x, lower_y, upper_x, upper_y)
-		\param tableName table name
-		\param keyColumnName name of the column that is primary key
-		\param idValue key value of the row that should be updated
-		\param box new box value
-	*/
-   virtual bool updateBBox(const string& tableName, const string& keyColumnName, int keyValue, const TeBox& box);  
-
-
-	/** @name Spatial Operations with vector data
-	*  spatial operations over geometries into the database. 
-	*/
-	//@{ 	
-
-	/** @name topologic relation query
-	*  topologic relation query over geometries into the database. 
-	*/
-	//@{
-	/*!
-	  \brief Returns the geometries of a geometric table (actGeomTable) that have a specific spatial relation (relate) with a subset of geometries of this table (actGeomTable)   
-	  \param actGeomTable	geometric table name
-	  \param actRep			geometric representation of the geometric table
-	  \param actIdsIn		identifiers of a geometry subset of the actGeomTable table 
-	  \param portal			a pointer to a database portal that will contain the resulted geometries
-	  \param relate			spatial relation
-	  \param actCollTable	collection table name
-	 */
-	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-		TeDatabasePortal *portal, int relate, const string& actCollTable="");
-	
-	/*!
-	  \brief Returns the geometries of a geometric table (visGeomTable) that have a specific spatial relation (relate) with a subset of geometries of other geometric table (actGeomTable)   
-	  \param actGeomTable	geometric table name
-	  \param actRep			geometric representation of the actGeomTable table
-	  \param actIdsIn		identifiers of a geometry subset of the actGeomTable table 
-	  \param visGeomTable	geometric table name
-	  \param visRep			geometric representation of the visGeomTable table
-	  \param portal			a pointer to a database portal that will contain the resulted geometries
-	  \param relate		 	spatial relation
-	  \param visCollTable	collection table name associated with the visGeomTable table
-	 */
-	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-		const string& visGeomTable, TeGeomRep visRep, TeDatabasePortal *portal, 
-		int relate, const string& visCollTable=""); 
-
-	/*!
-	  \brief Returns the geometries of a geometric table (actGeomTable) that have a specific spatial relation (relate) with a geometry in memory (geom)
-	  \param actGeomTable	geometric table name
-	  \param actRep			geometric representation of the actGeomTable table
-	  \param geom			a pointer to a geometry in memory
-	  \param portal			a pointer to a database portal that will contain the resulted geometries
-	  \param relate			spatial relation
-	  \param actCollTable	collection table name associated with the actGeomTable table
-	 */
-	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
-		TeDatabasePortal *portal, int relate, const string& actCollTable=""); 
-		
-	/*!
-	  \brief Returns the geometries of a geometric table (actGeomTable) that have a specific spatial relation (relate) with a subset of geometries of this table (actGeomTable)   
-	  \param actGeomTable	geometric table name
-	  \param actRep			geometric representation of the geometric table
-	  \param actIdsIn		identifiers of a geometry subset of the actGeomTable table 
-	  \param actIdsOut		structure that will contain the identifiers of the resulted geometries
-	  \param relate			spatial relation
-	  \param actCollTable	collection table name
-	 */
-	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-		TeKeys& actIdsOut, int relate, const string& actCollTable="");
-
-	/*!
-	  \brief Returns the geometries of a geometric table (visGeomTable) that have a specific spatial relation (relate) with a subset of geometries of other geometric table (actGeomTable)   
-	  \param actGeomTable	geometric table name
-	  \param actRep			geometric representation of the actGeomTable table
-	  \param actIdsIn		identifiers of a geometry subset of the actGeomTable table 
-	  \param visGeomTable	geometric table name
-	  \param visRep			geometric representation of the visGeomTable table
-	  \param visIdsOut		structure that will contain the identifiers of the resulted geometries
-	  \param relate			spatial relation
-	  \param visCollTable	collection table name associated with the visGeomTable table
-	 */
-	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-		const string& visGeomTable, TeGeomRep visRep, TeKeys& visIdsOut, int relate, 
-		const string& visCollTable="", TeDatabase* = 0); 
-
-	/*!
-	  \brief Returns the geometries of a geometric table (actGeomTable) that have a specific spatial relation (relate) with a geometry in memory (geom)
-	  \param actGeomTable	geometric table name
-	  \param actRep			geometric representation of the actGeomTable table
-	  \param geom			a pointer to a geometry in memory
-	  \param actIdsOut		structure that will contain the identifiers of the resulted geometries
-	  \param relate			spatial relation
-	  \param actCollTable	collection table name associated with the actGeomTable table
-	*/
-	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
-		TeKeys& actIdsOut, int relate, const string& actCollTable=""); 
-	//@}
-	
-	/** @name metric functions
-	*  metric functions over geometries into the database. 
-	*/
-	//@{
-	/*!
-		\brief Calculates the area of a geometry set of the geometric table (actGeomTable) 
-		\param actGeomTable	geometric table name
-		\param actRep		geometric representation of the geometric table
-		\param actIdsIn		identifiers of the geometry set of the actGeomTable table 
-		\param area			the returned area value 
-	 */
-	virtual bool calculateArea(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, double &area);
-
-	/*!
-		\brief Calculates the length of a geometry set of the actGeomTable table 
-		\param actGeomTable	geometric table name
-		\param actRep		geometric representation of the geometric table
-		\param actIdsIn		identifiers of the geometry set of the actGeomTable table 
-		\param length		the returned length value 
-	 */
-	virtual bool calculateLength(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, double &length);
-	
-	/*!
-		\brief Calculates the distance between two geometries of the actGeomTable table 
-		\param actGeomTable	geometric table name
-		\param actRep		geometric representation of the geometric table
-		\param Ids			identifiers of the two geometries of the actGeomTable table 
-		\param distance		the returned distance value 
-	 */
-	virtual bool calculateDistance(const string& actGeomTable, TeGeomRep actRep, TeKeys& Ids, double& distance);
-
-	/*!
-		\brief Calculates the distance between a geometry of a geometric table (actGeomTable) and a geometry of other geometric table (visGeomTable)
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param objId1			identifier of the geometry of the actGeomTable table
-		\param visGeomTable		geometric table name
-		\param visRep			geometric representation of the visGeomTable table
-		\param objId2			identifier of the geometry of the visGeomTable table
-		\param distance			the returned distance value 
-	 */
-	virtual bool calculateDistance(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
-		const string& visGeomTable, TeGeomRep visRep, const string& objId2, double& distance);
-
-	/*!
-	  \brief Returns the geometries of a geometric table (actGeomTable) that are within a specific distance from a point in memory 
-	  \param actGeomTable	geometric table name
-	  \param actRep			geometric representation of the actGeomTable table
-	  \param point			a point in memory
-	  \param IdsDistOut		structure that will contain the identifiers of the resulted geometries and their distances
-	  \param max_distance	maximum distance 
-	  \param actCollTable	collection table name associated with the actGeomTable table
-	*/
-	virtual bool withinDistance(const string& actGeomTable, TeGeomRep actRep, const TeCoord2D& point, 
-		TeKeysToDist& IdsDistOut, const double& max_distance, const string& actCollTable="");
-	//@}
-
-
-	/** @name functions that generate new geometries 
-	*  functions that generate new geometries over geometries into the database. 
-	*/
-	//@{
-	/*!
-		\brief Returns the buffers with a specific distance of a geometry set of a geometric table (actGeomTable)
-		\param actGeomTable	geometric table name
-		\param actRep		geometric representation of the geometric table
-		\param actIds		identifiers of the geometry set of the actGeomTable table 
-		\param bufferSet	the returned buffers 
-		\param dist			the distance of the buffers
-	 */
-	virtual bool buffer(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TePolygonSet& bufferSet, double dist);
-
-	/*!
-		\brief Returns the centroids of a geometry set of a geometric table (actGeomTable)
-		\param actGeomTable	geometric table name
-		\param actRep		geometric representation of the geometric table
-		\param centroidSet	the returned centroids 
-		\param actIds		identifiers of the geometry set of the actGeomTable table 
-		\param actCollTable collection table name associated with the actGeomTable table 
-	*/
-	virtual bool centroid(const string& actGeomTable, TeGeomRep actRep, TePointSet& centroidSet, TeKeys actIds = vector<string>(), const string& actCollTable = "");
-
-	/*!
-		\brief Returns the convex geometries of a geometries set of a geometric table (actGeomTable)
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the geometric table
-		\param actIds			identifiers of the geometry set of the actGeomTable table 
-		\param convexHullSet	the returned convex geometries 
-	*/
-	virtual bool convexHull(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TePolygonSet& convexHullSet);
-	//@}
-
-	/*!
-		\brief Returns the nearest neighbors of a specific geometry of a geometric table (actGeomTable)
-		\param actGeomTable		geometric table name
-		\param actCollTable		collection table name associated with the actGeomTable table
-		\param actRep			geometric representation of the geometric table
-		\param objId1			identifier of the geometry of the actGeomTable table
-	    \param actIdsOut		structure that will contain the identifiers of the nearest neighbors 
-		\param numRes			the number of nearest neighbors that will be returned
-	*/
-	virtual bool nearestNeighbors(const string& actGeomTable, const string& actCollTable,
-		TeGeomRep actRep, const string& objId1, TeKeys& actIdsOut, int numRes=1);
-	
-	/*!
-		\brief Returns the nearest neighbors of a geometric table (visGeomTable) of a specific geometry of other geometric table (actGeomTable)
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param objId1			identifier of the geometry of the actGeomTable table
-		\param visGeomTable		geometric table name
-		\param visCollTable		collection table name associated with the visGeomTable table
-		\param visRep			geometric representation of the visGeomTable table
-	    \param visIdsOut		structure that will contain the identifiers of the nearest neighbors 
-		\param numRes			the number of nearest neighbors that will be returned
-	*/
-	virtual bool nearestNeighbors(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
-		const string& visGeomTable, const string& visCollTable, 
-		TeGeomRep visRep, TeKeys& visIdsOut, int numRes=1); 
-
-	/*!
-		\brief Returns the nearest neighbors of a specific geometry of a geometric table (actGeomTable)
-		\param actGeomTable		geometric table name
-		\param actCollTable		collection table name associated with the actGeomTable table
-		\param actRep			geometric representation of the geometric table
-		\param objId1			identifier of the geometry of the actGeomTable table
-	    \param portal			a pointer to a database portal that will contain the identifiers of the nearest neighbors 
-		\param numRes			the number of nearest neighbors that will be returned
-	*/
-	virtual bool nearestNeighbors(const string& actGeomTable, const string& actCollTable, 
-		TeGeomRep actRep, const string& objId1, TeDatabasePortal* portal, int numRes=1);
-
-	/*!
-		\brief Returns the nearest neighbors of a geometric table (visGeomTable) of a specific geometry of other geometric table (actGeomTable)
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param objId1			identifier of the geometry of the actGeomTable table
-		\param visGeomTable		geometric table name
-		\param visCollTable		collection table name associated with the visGeomTable table
-		\param visRep			geometric representation of the visGeomTable table
-	    \param portal			a pointer to a database portal that will contain the identifiers of the nearest neighbors 
-		\param numRes			the number of nearest neighbors that will be returned
-	*/
-	virtual bool nearestNeighbors(const string& actGeomTable, TeGeomRep actRep, 
-		const string& objId1, const string& visGeomTable, const string& visCollTable, 
-		TeGeomRep visRep, TeDatabasePortal* portal, int numRes=1); 
-
-	/** @name set functions
-	*  functions of set: union, intersection, difference and symmetrical difference. 
-	*/
-	//@{
-
-	/*!
-		\brief Returns the intersection between two geometries of a geometric table (actGeomTable) 
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param actIds		identifiers of the geometry set of the actGeomTable table 
-		\param geomVect			the returned intersection 
-	 */
-	virtual bool geomIntersection(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeGeometryVect& geomVect);
-
-	/*!
-		\brief Returns the intersection between a geometry of a geometric table (actGeomTable) and a geometry of other geometric table (visGeomTable)
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param objId1			identifier of a geometry of the actGeomTable table
-		\param visGeomTable		geometric table name
-		\param visRep			geometric representation of the visGeomTable table
-		\param objId2			identifier of other geometry of the visGeomTable table
-		\param geomVect			the returned intersection 
-	 */
-	virtual bool geomIntersection(const string& actGeomTable, TeGeomRep actRep, const string& objId1,
-		const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);
-
-	/*!
-		\brief Returns the difference between two geometries of a geometric table (actGeomTable) 
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param objId1			identifier of a geometry of the actGeomTable table
-		\param objId2			identifier of other geometry of the actGeomTable table
-		\param geomVect			the returned difference 
-	 */
-	virtual bool geomDifference(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
-		const string& objId2, TeGeometryVect& geomVect);
-
-	/*!
-		\brief Returns the difference between a geometry of a geometric table (actGeomTable) and a geometry of other geometric table (visGeomTable)
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param objId1			identifier of a geometry of the actGeomTable table
-		\param visGeomTable		geometric table name
-		\param visRep			geometric representation of the visGeomTable table
-		\param objId2			identifier of other geometry of the visGeomTable table
-		\param geomVect			the returned difference 
-	 */
-	virtual bool geomDifference(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
-		const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);
-
-	/*!
-		\brief Returns the union between geometries of a geometric table (actGeomTable) 
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param actIds			identifiers of the geometry set of the actGeomTable table 
-		\param geomVect			the returned union 
-	 */
-	virtual bool geomUnion(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeGeometryVect& geomVect);
-
-	/*!
-		\brief Returns the union between a geometry of a geometric table (actGeomTable) and a geometry of other geometric table (visGeomTable)
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param objId1			identifier of a geometry of the actGeomTable table
-		\param visGeomTable		geometric table name
-		\param visRep			geometric representation of the visGeomTable table
-		\param objId2			identifier of other geometry of the visGeomTable table
-		\param geomVect			the returned union 
-	 */
-	virtual bool geomUnion(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
-		const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);
-
-	/*!
-		\brief Returns the symmetrical difference between two geometries of a geometric table (actGeomTable) 
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param objId1			identifier of a geometry of the actGeomTable table
-		\param objId2			identifier of other geometry of the actGeomTable table
-		\param geomVect			the returned symmetrical difference 
-	 */
-	virtual bool geomXOr(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
-		const string& objId2, TeGeometryVect& geomVect);
-
-	/*!
-		\brief Returns the symmetrical difference between a geometry of a geometric table (actGeomTable) and a geometry of other geometric table (visGeomTable)
-		\param actGeomTable		geometric table name
-		\param actRep			geometric representation of the actGeomTable table
-		\param objId1			identifier of a geometry of the actGeomTable table
-		\param visGeomTable		geometric table name
-		\param visRep			geometric representation of the visGeomTable table
-		\param objId2			identifier of other geometry of the visGeomTable table
-		\param geomVect			the returned symmetrical difference 
-	 */
-	virtual bool geomXOr(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
-		const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);	
-	//@}
-
-	/** @name Spatial Operations with raster data
-	*  spatial operations over raster data into the database. 
-	*/
-	//@{ 	
-	/*!
-		\brief Returns the statistics of raster data regions inside a geometry set of a geometric table (actGeomTable)
-		\param rasterTable		raster table name
-		\param actGeomTable		geometric table name that contains polygons
-		\param Ids				identifiers of the geometries of the actGeomTable table that define the regions in the raster data  
-		\param result			structure that will contain the resulted statistics 
-	*/
-	virtual bool zonal(const string& rasterTable, const string& actGeomTable, TeKeys& Ids, TeObjectStatistics& result, const bool &useDummy=true);
-	
-	/*!
-		\brief Returns the statistics of raster data regions inside a geometry set of a geometric table (actGeomTable)
-		\param rasterTable		raster table name
-		\param actGeomTable		geometric table name that contains polygons
-		\param actCollTable		collection table that contains the identifiers of the geometries of the actGeomTable table that define the regions in the raster data  
-		\param result			structure that will contain the resulted statistics 
-	*/
-	virtual bool zonal(const string& rasterTable, const string& actGeomTable, const string& actCollTable, TeObjectStatistics& result, const bool &useDummy=true);
-	
-	/*!
-		\brief Returns the statistics of a raster data region inside a geometry in memory 
-		\param rasterTable		raster table name
-		\param poly				the geometry in memory that define a region in the raster data 
-		\param result			structure that will contain the resulted statistics 
-	*/
-	virtual bool zonal(const string& rasterTable, TePolygon& poly, TeStatisticsDimensionVect& result,const bool &useDummy=true);
-
-	/*!
-		\brief Clips a raster data from a geometry of a geometric table (actGeomTable)
-		\param rasterTable		raster table name
-		\param actGeomTable		geometric table name that contains polygons
-		\param objId			identifier of the geometry of the actGeomTable table 
-		\param nameLayerOut		the layer name that will contain the result 
-		\param st				the strategy used in the clipping of the raster data
-	*/
-	virtual bool mask(const string& rasterTable, const string& actGeomTable, const string& objId, const string& nameLayerOut, TeStrategicIterator st);
-	
-	/*!
-		\brief Clips a raster data from a geometry in memory (poly)
-		\param rasterTable		raster table name
-		\param poly				a geometry in memory 
-		\param nameLayerOut		the layer name that will contain the result 
-		\param st				the strategy used in the clipping of the raster data
-	*/
-	virtual bool mask(const string& rasterTable, TePolygon& poly, const string& nameLayerOut, TeStrategicIterator st);
-	//@}
-	
-	/** @name specifics SQLs
-	*  return SQL strings 
-	*/
-	//@{ 	
-	//! Return a string that describes a where clause in SQL to return the geometries inside the box
-	virtual string getSQLBoxWhere (TeBox &box, TeGeomRep rep);
-
-	//! Return a string that describes a where clause in SQL to return the geometries of the table2 that are 
-	//! inside the geometries box of the table1 (table1 must have lower_x, lower_y...) 
-	virtual string getSQLBoxWhere (const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1 = TePOLYGONS);
-
-	//! Return a string SQL to be used in the clause SELECT to select the box (lower_x, lower_y, upper_x, upper_y)
-	virtual string getSQLBoxSelect (const string& tableName, TeGeomRep rep);
-
-	//! Return a string SQL to calculate the statistics of some attributes
-	virtual string getSQLStatistics (TeGroupingAttr& attrs);
-	
-	//! Return the database function in SQL to generate autonumber values
-	virtual string getSQLAutoNumber(const string& table);
-
-	//! Return a string SQL to temporal where
-	virtual string getSQLTemporalWhere (TeTimeInterval& /* timeInterval */, TeTemporalRelation /* timeOperator */, const string& /* initialTime */, const string& /* finalTime */ );
-
-	//! Return a string SQL to temporal where 
-	virtual string getSQLTemporalWhere (const string& temporalRest);
-		
-	//! Return a string SQL to temporal where
-	virtual string getSQLTemporalWhere(int /* time1 */, int /* time2 */, TeChronon /* chr */, TeTemporalRelation /* rel */, const string& /* initialTime */, const string& /* finalTime */);
-
-	//! Returns a valid SQL time string
-	virtual string getSQLTime(TeTime& /* time */) { return ""; };
-
-	//! Returns a SQL temporal expression applied to a column
-	virtual string getSQLTemporalFunction (TeChronon chr, const string& colName);
-	//@}
-
-	//! Return the box of a specific geometry (object_id)  
-	virtual bool getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom);
-
-	//! Return the box of a select objects set 
-	virtual bool getMBRSelectedObjects(string geomTable,string colGeom, string fromClause, 
-		string whereClause, string afterWhereClause, TeGeomRep repType,TeBox &bout, const double& tol = 0.0);
-
-	//! Gets the list of attributes of a table
-	virtual bool getAttributeList(const string& tableName,TeAttributeList& attList);
-
-	//! Escape special characters in a string to be used in a SQL statement
-	virtual string  escapeSequence(const string& from) = 0;
-
-	//! Returns theme box
-	virtual TeBox getThemeBox(TeTheme* theme);
-
-	//! Returns the container of legend title alias
-	map<int, map<string, string> >& mapThemeAlias() {return metaModel_->mapThemeAlias();}
-
-	//! Concat values in a vector using unionString as the join between each value
-	virtual string concatValues(vector<string>& values, const string& unionString) = 0;
-
-	//! Returns the SQL function for upper case
-	virtual string toUpper(const string& value) = 0;
-
-	//! Returns the SQL function for substring that starts from left to right with informed length.
-	virtual string leftString(const string& /*name*/, const int& /*length*/){return "";}
-
-	//! Write the given version as the terralib version in the database
-	virtual	bool updateVersionStamp(const string& version ); 
-
-	//! Read and returns the terralib version from the database
-	virtual	bool loadVersionStamp( string& version ); 
-
-   /** @name Transaction control methods 
-	\Note should be implemented by the drivers that has it. Default implementation
-	is DO NOTHING.
-   */
-   //@{ 
-   //! Begins a transaction
-   virtual bool beginTransaction(); 
-
-   //! Commits a transaction
-   virtual bool commitTransaction();
-
-   //! Rollbacks a transaction
-   virtual bool rollbackTransaction();
-   //@}
-
-   //! Drops a database view
-   virtual bool dropDBView(const string& dbViewName);
-
-protected :
-
-	bool				isConnected_;			//!< indicates if the connection is open
-	string				host_;					//!< host name of the database server
-	string				user_;					//!< user name 
-	string				password_;				//!< user password
-	string				database_;				//!< database name
-	int					portNumber_;			//!< port number
-	int					errorNumber_;			//!< error number
-	string				errorMessage_;			//!< error message
-	string				dbmsName_;				//!< DBMS name (Ado, MySQL, Postgres, OracleSpatial)
-	TeSharedPtr<TeMetaModelCache> metaModel_;	//!< Meta model: Layers, Themes, Views...
-
-	//! Update metadata about an attribute table that had its name or columns changed
-	void alterTableInfoInMemory(const string& updatedTableName, string oldTableName="");
-
-	int               transactionCounter_;//!< counts how many nested transactions have been opened
-
-private:
-
-	TeDatabase(const TeDatabase& other);
-};
-
-//! An abstract access portal to a database
-/*! A portal has a concept of a record set, that is generated by a selection (query) on
-	the data accessible through a connection to a database server.
-  \sa TeDatabase, TeGeometry, TeTable, TeTheme, TeView, TeLayer
-
-  */
-class TL_DLL TeDatabasePortal {
-protected:
-	
-
-	TeDatabase*		db_;			//!< the database associated to this portal
-	TeAttributeList	attList_;		//!< the list of attributes associated to this portal
-	int				numRows_;		//!< the number of rows in this portal
-	int				numFields_;		//!< the number of fields in this portal
-	string          errorMessage_;	//!< error message
-	int				errorNumber_;	//!< error number
-
-public :
-
-	//!Constructor 
-	TeDatabasePortal ();
-
-	//! Destructor
-	virtual ~TeDatabasePortal ();
-	
-	//! Returns the database associated to this portal 
-	TeDatabase* getDatabase()
-	{ return db_; }
-
-	//! Executes a SQL query that opens a record set
-	virtual bool query ( const string &qry, TeCursorLocation l = TeSERVERSIDE, TeCursorType t = TeUNIDIRECTIONAL, TeCursorEditType e = TeREADONLY, TeCursorDataType dt = TeTEXTCURSOR ) = 0;
-
-	//! Fetchs the next row in a record set that shouldve been previously opened
-	virtual bool fetchRow () = 0;
-
-	//! Fetchs a particular row
-	virtual bool fetchRow (int i) = 0;
-
-	//! Frees the current record set
-	virtual void freeResult () = 0;
-
-	//! Gets the last error message
-	virtual string	errorMessage ()
-	{ return errorMessage_; }
-
-	//! Gets the number of the last error message
-	virtual int errorNum ()
-	{ return errorNumber_; }
-	
-//	virtual bool loadNetwork (TeLayer *layer) = 0;
-
-// specific SQL SELECT command methods
-
-	/*! \brief Retrieves the number of rows in a portal. Some drivers
-	           (like PostgreSQL and PostGIS) brings to the client only
-			   a part of the row, and then this number can be less than
-			   the number of rows returned by query.
-    */
-	int numRows () 
-	{ return numRows_;}
-
-	//! Retrieves the number of fields in this portal
-	int numFields () 
-	{ return numFields_; }
-
-	//! Retrieves attribute list in this portal
-	TeAttributeList& getAttributeList()	
-	{ return attList_; }
-
-	//! Retrieves the i-th attribute in this portal
-	TeAttribute getAttribute (int i);
-
-	//! Retrieves an attribute by name
-	TeAttribute getAttribute (const string& s);
-
-	//! Gets the value of the i-th attribute as a literal
-	virtual char* getData (int i) = 0;
-
-	//! Gets the value of a named attribute as a literal
-	virtual char* getData (const string& s) = 0;
-
-	//! Gets the value of the i-th attribute as a double
-	virtual double getDouble (int i);
-
-	//! Gets the value of a named attribute as a double
-	virtual double getDouble (const string& s);
-
-	//! Gets the value of the i-th attribute as an integer
-	virtual int getInt (int i);
-
-	//! Gets the value of a named attribute as an integer
-	virtual int getInt (const string& s);
-
-	//! Gets the value of a named attribute as a boolean
-	virtual bool getBool (const string& s) = 0;
-
-	//! Gets the value of the i-th attribute as a boolean
-	virtual bool getBool (int i) = 0;
-
-	//! Gets the value of the i-th attribute as a date 
-	virtual TeTime getDate (int i) = 0;
-
-	//! Gets the value of a named attribute as a date 
-	virtual TeTime getDate (const string& s) = 0;
-
-	//! Gets the of a date/time attribute as a string formatted as accepted in further SQL statements
-	virtual string getDateAsString(int i) = 0;
-
-	//! Gets the of a date/time attribute as a string formatted as accepted in further SQL statements
-	virtual string getDateAsString(const string& s) = 0;
-
-	//! Gets the value of a named BLOB attribute 
-	virtual bool getBlob(const string& s, unsigned char* &data, long& size) = 0;
-
-	//! Gets the index of a named attribute
-	int getColumnIndex (const string& s);
-
-	//! Gets the name of the i-th attribute
-	string getColumnName (int i);
-
-	/** @name Data Model
-	  The following methods decodify structures as stored 
-	  in the database according to the data model proposed in TerraLib. 
-	*/
-	//@{ 	
-	virtual TeViewTree*		getViewTree ();
-	virtual TeLegendEntry	getLegend();
-	virtual void			getVisual(TeVisual*);
-	virtual bool			getVisual(TeVisual* vis, TeGeomRep& rep, const unsigned int& initIndex);
-	virtual bool			getRasterVisual(TeRasterVisual& vis, const unsigned int& initIndex=0);
-	virtual TeColor			getColor(); 
-	virtual bool	getRasterBlock(unsigned long& size, unsigned char* ptData)=0;
-	virtual bool	getView(TeView& view, const unsigned int& initIndex=0);
-	virtual bool	getProjection(TeProjection** proj, const unsigned int& initIndex=0);
-	virtual void	getViewNodeParams (TeViewNodeParams& params, const unsigned int& initIndex=0);
-	virtual bool	getTheme(TeAbstractTheme& theme, const unsigned int& initIndex=0);
-	virtual bool	getGrouping(TeGrouping& group, const unsigned int& initIndex=0);
-	virtual bool	getLegend(TeLegendEntry& leg, const unsigned int& initIndex=0);
-	virtual bool	getAttrTable(TeTable& table, const unsigned int& initIndex=0);
-	virtual bool	getLayer(TeLayer& layer, const unsigned int& initIndex=0);
-	virtual bool	getRepresentation(TeRepresentation& rep, const unsigned int& initIndex=0);
-
-	//@}
-
-	/** @name Fetch Geometry
-	  The following methods decodify geometries as stored 
-	  in the database according to the data model proposed in TerraLib.
-	  \param geom		the geometry that will be filled from portal
-	  \param initIndex  the position index in the portal where begins the geometry information 
-	  \return The fetchGeometry methods advance the portal to the next record and 
-	  they return TRUE if there are more records to be read and FALSE otherwise.
-	*/
-	//@{ 	
-	virtual	bool fetchGeometry (TePolygon& geom) = 0;
-	virtual	bool fetchGeometry (TePolygon& geom, const unsigned int& initIndex); 
-	virtual	bool fetchGeometry (TeLine2D& geom) = 0;
-	virtual	bool fetchGeometry (TeLine2D& geom, const unsigned int& initIndex); 
-	virtual	bool fetchGeometry (TeNode& geom) = 0;
-	virtual	bool fetchGeometry (TeNode& geom, const unsigned int& initIndex);
-	virtual	bool fetchGeometry (TePoint& geom) = 0;
-	virtual	bool fetchGeometry (TePoint& geom, const unsigned int& initIndex);
-	virtual	bool fetchGeometry (TeCell& geom);
-	virtual	bool fetchGeometry (TeCell& geom, const unsigned int& initIndex);
-	virtual	bool fetchGeometry (TeArc& geom);
-	virtual	bool fetchGeometry (TeArc& geom, const unsigned int& initIndex);
-	virtual	bool fetchGeometry (TeText& geom);
-	virtual	bool fetchGeometry (TeText& geom, const unsigned int& initIndex);
-	//@}
-};
-
-
-//! Breaks a collection of strings into a series of IN clauses to be used in query expressions
-/*
-	\params begin Iterator that p oints to the beginning of the collection
-	\params end Iterator that points to the end of the collection
-	\param db pointer to the database where the query expression will be applied
-	\param addPlicae flat to indicate that the character ' should enclose each string
-*/
-template <typename Iterator>
-vector<string>
-generateInClauses(Iterator& begin, Iterator& end, TeDatabase* db, bool addPlicae=true)
-{
-	int i, chunkSize = 200;
-	string inClause;
-	vector<string> inClauseVector;
-
-	Iterator temp = begin;
-	i = 0;
-	while (temp != end)
-	{
-		if (i%chunkSize == 0)
-		{
-			if (!inClause.empty())
-			{
-				inClause[inClause.size() - 1] = ')';
-				inClauseVector.push_back(inClause);
-				inClause.clear();
-			}
-			inClause = "(";
-		}
-
-		if (addPlicae)
-			inClause += "'" + db->escapeSequence(*temp) + "',";
-		else
-			inClause += db->escapeSequence(*temp) + ",";
-		i++;
-		++temp;
-	}
-	if (!inClause.empty())
-	{
-		inClause[inClause.size() - 1] = ')';
-		inClauseVector.push_back(inClause);
-	}
-	return inClauseVector;
-}
-
-
-/*! \example createDatabase.cpp
-	Shows how to create a TerraLib database.
- */
-
-/*! \example databaseQuery.cpp
-	Shows how to retrieve an existing layer from a TerraLib database, 
-	and execute some queries on its polygon geometry table.
- */
-
-/*! \example databaseSQLQuery.cpp
-	Shows how retrieve geometries (polygons) using an SQL query.
- */
- 
-/*! \example spatialQuery.cpp
-	Shows how  to use the database interface to do some	spatial queries 
-	involving objects with points, lines and polygon geometries.
- */
-
-/*! \example spatialQueryAndBuffer.cpp
-	Shows to use the database interface to do some  spatial queries involving 
-	objects with points, lines and polygon geometries, and to generate a buffer operation.
- */
-#endif
-	
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDatabase.h
+    \brief This file contains structures and definitions about database support in TerraLib
+*/
+#ifndef  __TERRALIB_INTERNAL_DATABASE_H
+#define  __TERRALIB_INTERNAL_DATABASE_H
+
+#ifdef WIN32 
+#pragma warning ( disable: 4786 ) 
+#endif
+
+#include "TeDefines.h"
+#include "TeDataTypes.h"
+#include "TeTable.h"
+#include "TeGeometry.h"
+#include "TeStatistics.h"
+#include "TeProject.h"
+#include "TeRaster.h"
+#include "TeView.h"
+#include "TeVisual.h"
+#include "TeMetaModelCache.h"
+#include "TeSharedPtr.h"
+#include "TeDatabaseIndex.h"
+
+class TeLayer;
+class TeDatabaseFactoryParams;
+class TeRasterParams;
+class TeTheme;
+class TeTime;
+class TeTimeInterval;
+
+#include <set>
+using namespace std;
+
+          
+/*! \enum TeCursorLocation
+	Location of a cursor on record set
+ */
+enum TeCursorLocation { TeCLIENTESIDE, TeSERVERSIDE };
+
+/*! \enum TeCursorType
+	Type of cursor on record set
+ */
+enum TeCursorType { TeUNIDIRECTIONAL, TeBIDIRECTIONAL, TeRANDOMACCESS };
+
+/*! \enum TeCursorEditType
+	Type of edition on record set cursor
+ */
+enum TeCursorEditType { TeREADONLY, TeREADWRITE };
+
+/*! \enum TeCursorDataType
+	Type of edition on record set cursor
+ */
+enum TeCursorDataType { TeBINARYCURSOR, TeTEXTCURSOR };
+
+
+/*! \enum TeSpatialIndexType
+	Type of spatial index
+ */
+enum TeSpatialIndexType {TeRTREE, TeQUADTREE};
+
+//! A vector of objects identifications (object_id)
+typedef vector<string>				TeKeys;
+
+//! A Map of objects identifications (object_id) to a distance value
+typedef map<string, double>			TeKeysToDist;
+
+//! A Vector of pointers to TeGeometry 
+typedef vector<TeGeometry*> TeGeometryVect;
+
+//! A Map of the objects identifications to a set of statistical values
+typedef map<string, TeStatisticsDimensionVect>  TeObjectStatistics;
+
+
+class TeDatabasePortal;
+
+
+//! An abstract database class
+/*!
+	Instances of this classes represent connections
+	to a database server. It includes the host name, 
+	user name and password parameters of the connection.
+	It should be implemented by the drivers to specific
+	database servers as: MySQL, Ado, PostgreSQL or any
+	other server to be used in TerraLib applications.
+	When possible, default implementations using ANSI SQL
+	are provided. 
+	Methods that rely on special features of the derived
+	driver are left as purely virtual.
+
+  \sa
+  TeTheme, TeView, TeLayer, TeAttribute
+*/
+class TL_DLL TeDatabase 
+{
+public: 
+	//! Empty constructor
+	TeDatabase();
+
+	//! Destructor
+	virtual ~TeDatabase();
+
+	//! Assignment operator
+	virtual TeDatabase& operator=(const TeDatabase& other);
+
+	//! Operator ==
+	virtual bool operator== (const TeDatabase& other) const
+	{	
+		if (dbmsName_ != other.dbmsName_ ||
+			database_ != other.database_ ||
+			host_  != other.host_ ||
+			user_ != other.user_ )
+			return false;
+		return true;
+	}
+	/** @name Members
+	*  Methods to access class private members
+	*/
+	//@{		
+	//! Returns the error message from the server
+	virtual string errorMessage ()
+	{ return errorMessage_; }
+
+	//! Returns the error number from the server
+	virtual int	errorNum ()
+	{	return errorNumber_; }
+
+	//! Return the user name of the connection opened
+	string	user () 
+	{ return user_; }
+
+	//! Set the current user name to view
+	void user(string value) { user_=value;}
+
+	//! Returns the host name of the connection opened
+	string	host () 
+	{ return host_; }
+
+	//! Returns the user's password of the connection opened
+	string	password () 
+	{ return password_; }
+
+	//! Returns the database name of the connection opened
+	string	databaseName () 
+	{ return database_; }
+	
+	//! Returns the Database Management System name
+	string	dbmsName () 
+	{ return dbmsName_; }
+
+	//! Returns the port number of the connection opened
+	int	portNumber () 
+	{ return portNumber_; }
+
+	//! Returns the  map of layers in the database
+	TeLayerMap&	layerMap () 
+	{ return metaModel_->layerMap(); }
+
+	//! Returns the  map of views in the database
+	TeViewMap&	viewMap () 
+	{ return metaModel_->viewMap(); }
+
+	//! Returns the  map of themes in the database
+	TeThemeMap&	themeMap () 
+	{ return metaModel_->themeMap(); }
+
+	//! Returns the map of invalid themes in the database
+	TeThemeMap&	invalidThemeMap() 
+	{ return metaModel_->invalidThemeMap(); }
+
+	//! Returns the  map of projects in the database
+	TeProjectMap&  projectMap ()
+   { return metaModel_->projectMap(); }
+
+	//! Returns the  map of legends in the database
+	TeLegendEntryMap& legendMap () 
+	{ return metaModel_->legendMap(); }
+
+	//! Returns the set of relations between tables
+	multiset<int>& relationMSet () 
+	{ return metaModel_->relationMSet(); }
+
+	//! Clears structures in memory (legendMap, layerMap, viewMap...) used to optimize database access
+	virtual void clear();
+
+	//@}
+
+	/** @name Database
+	*  Methods related to database and connection creation. 
+	*  These methods return TRUE when the operation was successfull.
+	*  Otherwise return FALSE and when possible an error message is captured.
+	*/
+	//@{	
+	//! Creates a new database and open a connection to it
+	virtual bool newDatabase(const string& database, const string& user, const string& password, const string& host, const int &port=-1, bool terralibModel=true, const std::string& characterSet = "") = 0;
+	
+	//! Opens a connection to a database server passing all parameters needed
+	virtual bool connect (const string& host, const string& user, const string& password, const string& database, int port = -1) = 0;
+
+	//! Show the server databases (only for MySQL, Oracle and PostgreSQL)
+	virtual bool showDatabases (const string& /* host */, const string& /* user */, const string& /* password */, vector<string>& /* dbNames */ , int /* port */ = -1)
+	{ return true; }
+
+	//! Opens a connection without parameters. When possible, should be implemented by the derived classes 
+	virtual bool connect (const string&  = "") { return false; };
+
+	//! Check if there is an opened connection
+	bool isConnected () 
+	{ return isConnected_; }
+
+	//! Closes the connection
+	virtual void close() = 0;
+
+	//! Returns a string that the describes the parameters of the database connected
+	/*
+		The expected return value is similar to: dbms_server;hostname;portnumber;databasename;user;password
+	*/
+	virtual string getDatabaseDescription();
+	
+  
+  /**
+   *  This is for TeFactory compatibility ( Invalid TeDatabaseFactory
+   *  requests will try to create an default object using this function ).
+   */
+  static TeDatabase* DefaultObject( const TeDatabaseFactoryParams& )
+  {
+    std::cout << std::endl << "TeDatabase::DefaultObject - " <<
+      " - Trying to create an invalid TeDatabase default object." <<
+      std::endl;
+    throw;
+      
+    return 0;
+  };
+  
+	//@}
+
+	/** @name Tables
+	  Methods related to table manipulation.
+		\note refer to data model documentation in order to understand the meanning of 
+		each tables and its fields
+	*/
+	//@{	
+
+	//! Returns a list of tables in a database
+	virtual bool listTables(vector<string>& /* tableList */) { return false; }
+
+	//! Verifies if a table exist in the database
+	virtual bool tableExist(const string& table) = 0;
+	
+	//! Verifies if a table has a column
+	virtual bool columnExist(const string& table, const string& column, TeAttribute& attr) = 0;
+
+	//! Update a column
+	virtual bool allowEmptyString(const string& /* tableName */, const string& /* column */) { return false; }
+
+	//! Verifies and modifies the column names of the table. It returns if the table was modified  
+	virtual bool validTable (TeTable& table);
+
+	//! Return the name of an attribute table given its identifier
+	string getTableName(int tableId);
+
+	//! Return a valid name for a table from a initial one
+	string getNewTableName(const string& n);
+
+	//! Concatenate field values
+	/*!
+      \param fNamesVec vector containing the fields to be concatenated
+	*/
+	virtual string getConcatFieldsExpression(const vector<string>& fNamesVec);
+
+	//! Creates a table
+	/*!
+      \param table table name
+      \param attr table list of attributes
+	 */
+	virtual bool createTable(const string& table, TeAttributeList &attr) = 0;
+
+	//! Deletes a table. Do not allow the deletion of model tables
+	 virtual bool deleteTable (const string& table);
+
+	//! Adds a column to a table
+	/*!
+      \param table table name
+      \param rep representation of the column being created
+	*/
+	virtual bool addColumn (const string& table, TeAttributeRep &rep) = 0;
+
+	//! Deletes a column to a table
+	/*!
+      \param table table name
+      \param colName name of the column being deleted
+	*/
+	virtual bool deleteColumn (const string& table, const string& colName);
+	
+	//! Creates a reationship between two tables
+	/*!
+      \param relName relationship name
+      \param table table that will receive the foreign key
+	  \param fieldName column that will be foreign key
+	  \param relatedTable table that exports the foreign key
+	  \param relatedField field that will the exported foreign key
+	  \param cascadeDeletion flag that indicates if the deletion should be propagated
+	*/
+	virtual bool createRelation (const string& relName, const string& table, const string& fieldName, 
+						const string& relatedTable, const string& relatedField, bool cascadeDeletion) = 0;
+
+	//! Checks if a relation exist
+	/*!
+      \param tableName table where the relashionship exists
+	  \param relName relationship name
+	*/
+	virtual TeDBRelationType existRelation(const string& tableName, const string& relName) = 0;
+
+	//! Removes a relation exist
+	/*!
+	  \param name relationship name
+      \param table table where the relashionship exists
+	  \return TRUE if succeed and FALSE otherwise
+	*/
+	virtual bool deleteRelation(const string& name, const string& table);
+
+	//@}
+	
+	/** @name Query
+	*  Methods related to query the database
+	*/
+	//@{	
+	//! Executes a SQL command that doesnt return a record set. Tipically a data definition comand
+	virtual bool execute ( const string &sql) = 0;
+
+	//! Returns a database portal.
+	/*!
+		A database portal is used to submit queries to the database and to navigate over the
+		resulting record set
+	*/
+	virtual TeDatabasePortal* getPortal () = 0;
+
+	//! Get the values that satisfy the query 
+	virtual bool inClauseValues(const string& query , const string& attribute, vector<string>& inClauseVector);
+
+	//@}
+
+	/** @name  Data Model
+		 Methods that create the database model suggested in TerraLib. 
+		 Classes in TerraLib materialize the DataModel suggested.
+	*/
+	//@{
+	//! Creates the entire TerraLib conceptual model.
+	/*
+      \param withIntegrity flag that indicates that the referencial integrity should be implemented.
+	  \param createIndex flag that indicate that the indexes should be created
+	*/
+	virtual bool createConceptualModel(bool withIntegrity = true, bool newDatabase = true, bool createIndex = true);
+
+	//! Creates the referencial integrity of the conceptual model
+	virtual bool defineIntegrity(void);
+
+	//! Create the indexes for the tables in the conceptual model
+	virtual bool createIndex(const string& tableName, const string& indexName, const string& columnsName);
+
+	//! Delete the index from tables in the conceptual model
+	virtual bool deleteIndex(const string& tableName, const string& indexName);
+
+	//! Return a TeDatabaseIndex vector from a table
+	virtual bool getIndexesFromTable(const string& tableName, std::vector<TeDatabaseIndex>& vecIndexes);
+
+	//! Creates a table to store version database information 
+	virtual bool createDatabaseTable(); 
+	
+	//! Creates a table to store projectinon information
+	virtual bool createProjectionTable();
+
+	//! Creates a table to store Layers information
+	virtual bool createLayerTable ();
+
+	//! Creates a table to store Representations information
+	virtual bool createRepresentationTable ();
+
+	//! Creates a table to store Views information
+	virtual bool createViewTable ();
+
+	//! Creates a table to store Themes information
+	virtual bool createThemeTable ();
+
+	//! Creates a table to store the groupings associated with a theme
+	virtual bool createGroupingTable();
+
+	//! Creates a table to store information about the attribute tables used by a theme
+	virtual bool createThemeTablesTable();
+
+	//! Creates a table to store legends
+	virtual bool createLegendTable ();
+
+	//! Creates a table to store visual definitions
+	virtual bool createVisualTable();
+
+	//! Creates a table to store raster visual definitions
+	virtual bool createVisualRasterTable();
+
+	//! Creates a table to store information about the non-spatial tables associated to this layer
+	virtual bool createLayerTableTable();
+
+	//! Creates a table to store information about the external tables related to non-spatial tables of layers
+	virtual bool createTablesRelationTable();
+
+	//! Creates a table to store information about projects: an structure that groups views
+	virtual bool createProjectTable();
+
+	//! Creates a table to store the relation between project/views information
+	virtual bool createProjectViewTable();
+	//@}
+
+	/** @name  Project
+		 Methods related to the manipulation of projects
+	*/
+	//@{
+	//! Load information about all projects stored in the database
+	virtual bool loadProjectSet(); 
+
+	//! Load information about a particular project
+	virtual bool loadProject(TeProject* project); 
+	
+	//! Insert information about a project
+	virtual bool insertProject(TeProject *project) = 0;
+	
+	//! Update information about a project
+	virtual bool updateProject(TeProject *project);	
+
+	//! Delete a project from the database
+	virtual bool deleteProject(int projectId);	
+
+	//! Insert a project/view relation
+	virtual bool insertProjectViewRel(int projectId, int viewId);
+
+	//! Deletes a project/view relation
+	virtual bool deleteProjectViewRel(int projectId, int viewId);
+
+	//! Check whether a given project already exists in the database (it is not case sensitive).
+	virtual bool projectExist(const string& projectName);
+	//@}
+
+	/** @name  Geometries
+		 Methods that create tables that store the spatial data
+	*/
+	//@{
+
+	//! Creates a table for a polygon geometries
+	virtual bool createPolygonGeometry (const string& tableName);
+
+	//! Creates a table for line geometries
+	virtual bool createLineGeometry (const string& tableName);
+
+	//! Creates a table for point geometries
+	virtual bool createPointGeometry (const string& tableName);
+
+	//! Creates a table for cell geometries
+	virtual bool createCellGeometry (const string& tableName);
+ 
+	//! Creates a table for a text geometries
+	virtual bool createTextGeometry (const string& tableName);
+
+	//! Creates a table for a arc geometries
+	virtual bool createArcGeometry (const string& tableName);
+
+	//! Creates a table for a node geometries
+	virtual bool createNodeGeometry (const string& tableName);
+
+	//! Creates a table to store raster representations of objects
+	virtual bool createRasterGeometry(const string& tableName);
+
+	//! Creates a table to store information about raster representation
+	virtual bool createRasterMetadataTable(const string& tableName);
+	
+    //! Creates a table for raster geometries
+	virtual bool createRasterTable (const string& tableName);
+
+	//! Creates a table to store information about objects in a theme
+	virtual bool createCollectionTable(const string& tableName);
+	//@}
+
+	/** @name Non-spatial tables
+	*  Retrieving/Inserting/Modifying generic tables in the database. 
+	*/
+	//@{
+	//! Retrieves information about some tables
+	/*
+		\param atts returning vector of tables information 
+		\param attType type of the tables that are being looked for (optional)
+		\return TRUE if any table was found and FALSE otherwise
+	*/
+	virtual bool getAttrTables(TeAttrTableVector& atts, TeAttrTableType attType = TeAllAttrTypes);
+
+	//! Inserts information about a link to an external table
+	/*
+		\param tableId table identification (from te_layer_table)
+		\param tField link column name of the static table
+		\param eTable name of the external table
+		\param eField name of the link column of the related table
+		\param relId returns the identification of the relation
+	*/
+	virtual bool insertRelationInfo(const int tableId, const string& tField,
+									const string& rTable, const string& rField, int& relId) = 0;
+
+	//! Inserts information about an attribute table
+	virtual bool insertTableInfo (int layerId, TeTable &table, const string& user="") = 0;
+
+	//! Updates information about an attribute table
+	virtual bool updateTableInfo (int layerId, TeTable &table, const string user="");
+
+	//! Retrieves the metainformation about an attribute table
+	virtual bool loadTableInfo(TeTable& table);
+
+	//! Saves a table and its contents in the database
+	virtual bool insertTable(TeTable &table);
+
+	//! Alter a property of a table 
+	virtual bool alterTable(const string& tableName, TeAttributeRep& rep, const string& oldColName="");
+
+	//! Alter the table name 
+	virtual bool alterTable(const string& oldTableName, const string& newTablename);
+
+	//! Saves a large binary objects (BLOB) in a row table 
+	virtual bool insertBlob (const string& tableName, const string& columnBlob, TeAttributeRep& columnId, const string& valueId, unsigned char* data, int size);
+
+	//! Saves a large binary objects (BLOB) in a row table 
+	virtual bool insertBlob (const string& tableName, const string& columnBlob, TeAttributeRep& columnId, const string& valueId, const string& fileName);
+
+	//! Saves a large binary objects (BLOB) in a row table 
+	virtual bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, unsigned char* data, int size) = 0;
+
+	//! Saves a large binary objects (BLOB) in a row table 
+	virtual bool insertBlob (const string& tableName, const string& columnBlob, const string& whereClause, const string& fileName);
+	
+	//! Updates a table and its contents in the database
+	virtual bool updateTable	(TeTable &table);
+
+	//! Retrieves a table and its contents from the database
+	virtual bool loadTable		(const string& tableName, TeTable &table);
+
+	//! Retrieves a table (or part of it) accordingly to a criteria written in SQL
+	virtual bool selectTable	(const string& tableName, const string& criteria, TeTable &table);
+
+	//!	Deletes all tables, of a particular type, associated to a layer
+	virtual bool deleteLayerTable	(int layerId, TeAttrTableType ttype = TeAttrStatic);
+	//@}
+
+	/** @name Projection
+	*  Accessing/Inserting/Modifying projection information into the database. 
+	*/
+	//@{ 	
+
+	//! Insert information about a geographical projection
+	virtual bool insertProjection (TeProjection *proj) = 0;	
+
+	//! Updates information about a geographical projection
+	virtual bool updateProjection (TeProjection *proj);	
+
+	//! Retrieves information about a geographical projection identified by its database id
+	virtual TeProjection* loadProjection (int id);
+	//@}
+
+	/** @name Layers
+	*  Retrieving/Inserting/Modifying/Deleting layers in the database. 
+	*/
+	//@{ 
+	//! Insert information about a layer
+	virtual bool insertLayer	(TeLayer *layer) = 0;
+	
+	//! Update information about a layer
+	virtual bool updateLayer	(TeLayer *layer);	
+
+	//! Load information about all layers stored in the database
+	/*
+		\param loadAttrList  indicates if the attribute list of each attribute table should be loaded
+	*/
+	virtual bool loadLayerSet	(const bool& loadAttrList = true);
+
+	//! Load information about a particular layer 
+	/*
+		\param layer		a pointer to a layer that will be loaded from database
+		\param loadAttrList indicates if the attribute list of each attribute table should be loaded
+	*/
+	virtual bool loadLayer		(TeLayer* layer, const bool& loadAttrList = true);
+
+	//! Load layer tables 
+	/*
+		\param layer		a pointer to a layer whose attribute table will be loaded from database
+		\param loadAttrList indicates if the attribute list of each attribute table should be loaded
+	*/
+	virtual bool loadLayerTable (TeLayer* layer, const bool& loadAttrList = true);
+
+	//! Delete a particular layer passing its id
+	virtual bool deleteLayer	(int layerId);
+
+	//! Check if a particular layer exists (passing its id)
+	virtual bool layerExist		(int id);
+
+	//! Check if a particular layer exists (passing its name)
+	virtual bool layerExist		(string layerName);
+
+	//! Checks whether a given layer name is valid or already exists in the database
+	/*!
+		\param n		layer name to be checked
+		\return the modified valid layer name
+	*/	
+	virtual string getNewLayerName(const string& n);
+	//@}
+
+	/** @name Representation
+	*  Retrieving/Inserting/Modifying/Deleting representations in the database. 
+	*/
+	//@{ 
+	//! Inserts information about a geometrical representation
+	virtual bool insertRepresentation (int layerId, TeRepresentation& rep) = 0;	
+
+	//! Updates information about a geometrical representation
+	virtual bool updateRepresentation (int layerId, TeRepresentation& rep);	
+
+	//! Updates the box information of a layer in the corresponding metadata table
+	virtual bool updateLayerBox(TeLayer* layer);
+
+	//@}
+
+	/** @name Raster Tables
+	*  Retrieving/Inserting/Modifying/Deleting raster representations in the database. 
+	*/
+	//@{ 
+	//! Inserts information about a raster geometry associated to an object
+	/*!
+		\param tableName name of the table that stores the raster representation
+		\param par raster parameters 
+		\param objectId identification of the object associated to the raster geometry
+	*/
+	virtual bool insertRasterGeometry(const string& tableName, TeRasterParams& par, const string& objectId = "");
+
+	//! Updates the information about the raster geometry associated to an object of a layer
+	/*!
+		\param layerId layer unique database identification
+		\param par raster parameters 
+		\param objectId identification of the object associated to the raster geometry
+	*/
+	virtual bool updateRasterRepresentation(int layerId, TeRasterParams& par, const string& objectId="");
+
+	//! Returns the name of the table where the raster geometry associated to an object of a leyr
+	/*!
+		\param layerId layer unique database identification
+		\param objectId identification of the object associated to the raster geometry
+	*/
+	virtual string getRasterTable(int layerId, const string& objectId);
+	
+	//! Inserts metadata information about a particular raster geometry
+	/*!
+		\param tableName name of the table that stores the metadata
+		\param geomId  geometry unique database identification
+		\param par raster parameters 
+	*/
+	virtual bool insertRasterMetadata (const string& tableName, int geomId, TeRasterParams& par);
+
+	//! Updates metadata information about a particular raster geometry
+	/*!
+		\param tableName name of the table that stores the metadata
+		\param geomId  geometry unique database identification
+		\param par raster parameters 
+
+	*/	
+	virtual bool updateRasterMetadata (const string& tableName, int geomId, TeRasterParams& par);
+	//@}
+	/** @name Views
+	*  Retrieving/Inserting/Modifying/Deleting views in the database. 
+	*/
+	//@{ 
+	//! Inserts a view
+	virtual bool insertView (TeView *view) = 0;	
+
+	//! Updates a view
+	virtual bool updateView (TeView *view);	
+
+	//! Loads a set of views belonging to a user
+	/*
+		\param user			 the user name 
+		\param loadAttrList  indicates if the attribute list of each attribute table should be loaded
+		\param visualClass  identifies which concrete class od visual should be instantiated.
+		The default is TerraLib basic visual.
+	*/
+	virtual bool loadViewSet (const string& user, const bool& loadAttrList = true, const string& visualClass="tevisual");
+
+	//! Load a view
+	/*
+		\param view			a pointer to a view that will be loaded from database
+		\param loadAttrList indicates if the attribute list of each attribute table should be loaded
+		\param visualClass  identifies which concrete class od visual should be instantiated.
+		The default is TerraLib basic visual.
+	*/
+	virtual bool loadView (TeView* view, const bool& loadAttrList = true, const string& visualClass="tevisual");
+
+	//! Delete a view
+	virtual bool deleteView (int viewId);
+
+	//! Recursive inserting of a view tree.
+	virtual bool insertViewTree (TeViewTree *tree) = 0;	
+
+	//! Recursive load view tree.
+	/*
+		\param view			a pointer to a view that will be loaded from database
+		\param id			a specific theme or viewtree id of this view that will be loaded from database
+		\param loadAttrList indicates if the attribute list of each attribute table should be loaded
+		\param visualClass  identifies which concrete class od visual should be instantiated.
+		The default is TerraLib basic visual.
+	*/
+	virtual TeViewTree* loadViewTree(TeView* view, int id, const bool& loadAttrList = true, const string& visualClass = "tevisual");
+
+	//! Recusive updating of a view tree.
+	virtual bool updateViewTree (TeViewTree *tree);
+	
+	//! Check whether a given view already exists in the database
+	virtual bool viewExist(string viewName);
+
+	//@}
+
+	/** @name Themes
+	*  Retrieving/Inserting/Modifying/Deleting themes and group of themes in the database. 
+	*/
+	//@{ 
+	//! Inserts a group of themes in the database
+	virtual bool insertThemeGroup	(TeViewTree* tree) = 0;
+
+	//! Inserts an abstract theme in the database.
+	virtual bool insertTheme		(TeAbstractTheme *theme) = 0; 	
+
+	//! Updates an asbtract theme in the database
+	virtual bool updateTheme		(TeAbstractTheme *theme);
+
+	//! Loads a theme from the database
+	virtual bool loadTheme			(TeAbstractTheme *theme, const bool& loadAttrList = true, const string& visualClass = "tevisual");
+	
+	//! Loads several themes from the database. Created for otimization.
+	virtual bool loadThemes			(std::vector<TeAbstractTheme*>& vecThemes, const bool& loadAttrList, const std::string& userName, const bool& loadMetadata = true, const string& visualType = "tevisual");
+
+	//! Loads several external themes from the database. Created for otimization.
+	virtual bool loadExternalThemes	(std::vector<TeAbstractTheme*>& vecExternalThemes);
+
+	//! Loads all attribute tables of a theme
+	virtual bool loadThemeTable		(TeTheme* theme, const bool& loadAttrList = true);
+
+	//! Erases the theme group identified by themeId
+	virtual bool deleteThemeGroup	(int themeId);
+
+	//! Erases the theme identified by themeId
+	virtual bool deleteTheme		(int themeId);
+
+	//! Erases the legends of a theme identified by themeId
+	virtual bool deleteLegend		(int themeId);
+	
+	//! Inserts information about a table used by a theme 
+	bool insertThemeTable(TeTheme *theme, TeTable& inputTable);
+
+	//! Inserts information about a table used by a theme 
+	virtual bool insertThemeTable	(int themeId, int tableId, int relationId, int tableOrder) = 0; 
+
+	//! Updates  information about the tables used by a theme 
+	virtual bool updateThemeTable	(TeTheme *theme);
+	
+	//! Removes a table from the theme
+	bool removeThemeTable(TeTheme *theme, int tableOrder);
+
+	//! Inserts information about a grouping used in a theme
+	virtual bool insertGrouping (int themeId, const TeGrouping& grouping);
+
+	//! Updates information about a grouping used in a theme
+	virtual bool updateGrouping (int themeId, const TeGrouping& grouping);
+
+	//! Generates the label position (x,y) to each object of a theme or of a particular object
+	virtual bool generateLabelPositions(TeTheme *theme, const std::string& objectId = "");
+
+	//! Check whether a given theme already exists in the database
+	virtual bool themeExist(string themeName);
+	
+	//! Check whether a given theme from a specific view already exists in the database
+	virtual bool themeExist(const std::string &viewName, const std::string &userName, const std::string &themeName);
+
+	//! Checks whether a given theme name is valid or already exists in the database
+	/*!
+		\param n		theme name to be checked
+		\return the modified valid theme name
+	*/	
+	virtual string getNewThemeName(const string& n);
+
+	//@}
+
+	/** @name Legend
+	*  Retrieving/Inserting/Modifying/Deleting legends in the database. 
+	*/
+	//@{ 
+	//! Inserts legend in the database
+	virtual bool insertLegend	(TeLegendEntry *legend) = 0;	
+	//! Updates legend entries in the database
+	virtual bool updateLegend	(TeLegendEntry *legend);	
+
+	virtual bool updateLegend   (vector<TeLegendEntry>& legVec);
+	virtual bool loadLegend		(TeAbstractTheme *theme, const string& visualClass = "tevisual");
+	virtual bool updateVisual	(TeLegendEntry *legend);
+	virtual bool updateVisual   (vector<TeLegendEntry>& legVec);
+	//@}
+
+	/** @name Polygon
+	// Accessing/Inserting/Modifying polygon geometries into the database
+	*/
+	//@{ 
+	//! Inserts a polygon set in a geometry table
+	virtual bool insertPolygonSet (const string& table, TePolygonSet &ps);	
+
+	//! Updates a polygon set in a geometry table
+	virtual bool updatePolygonSet (const string& table, TePolygonSet &ps);	
+
+	//! Returns all polygons in a table given a criteria expressed as an SQL where statement
+	virtual bool selectPolygonSet (const string& table, const string& criteria, TePolygonSet &ps);
+
+	//! Returns all polygons that represents objects of a particular theme
+	virtual bool loadPolygonSet	(TeTheme* theme, TePolygonSet &ps);
+
+	//! Returns all polygons  that represents objects of a particular geoid
+	virtual bool loadPolygonSet	(const string& table, const string& geoid, TePolygonSet &ps);
+
+	//! Returns all polygons inside a given box
+	virtual bool loadPolygonSet	(const string& table, TeBox &box, TePolygonSet &ps);
+
+	//! Returns a database portal to iterate over the polygons that are inside a given box
+	/*
+		\return A database portal pointer if there is any polygons inside the box
+		\return A null pointer if there isn't polygons to iterate
+		\note The database portal pointer should be deleted by the application
+	*/
+	virtual TeDatabasePortal* loadPolygonSet(const string& table, TeBox &box);
+
+	//! Returns the first polygon that contais a given coordinate
+	virtual bool locatePolygon		(const string& table, TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0);
+
+	//! Returns the polygons that contains a give coordinate
+	virtual bool locatePolygonSet   (const string& table, TeCoord2D &pt, double tol, TePolygonSet &polygons);
+
+	//! Inserts a polygon in a geometry table
+	virtual bool insertPolygon		(const string& table, TePolygon &p) = 0;	
+
+	//! Updates a polygon in a geometry table
+	virtual bool updatePolygon		(const string& table, TePolygon &p) = 0;
+	//@}
+
+	/** @name Line
+	*  Accessing/Inserting/Modifying Line geometries into the database. 
+	*/
+	//@{ 	
+	// Accessing/Inserting line geometries into the database
+	virtual bool insertLineSet	(const string& table, TeLineSet &ls);	
+	virtual bool updateLineSet	(const string& table,TeLineSet &ls);
+	virtual bool loadLineSet	(const string& table, const string& geoid, TeLineSet &ls);
+    virtual bool loadLineSet	(TeTheme* theme, TeLineSet &ls);
+	virtual bool loadLineSet	(const string& table, TeBox &box, TeLineSet &linSet);
+	virtual TeDatabasePortal*    loadLineSet (const string& table, TeBox &box);
+	virtual bool selectLineSet	(const string& table, const string& criteria, TeLineSet &ls);
+
+    virtual bool insertLine		(const string& table, TeLine2D &l) = 0;		
+	virtual bool updateLine		(const string& table, TeLine2D &l) = 0;
+	virtual bool locateLine		(const string& table, TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
+	virtual bool locateLineSet	(const string& table, TeCoord2D &pt, TeLineSet & ls, const double& tol = 0.0);
+
+	//@}
+
+	/** @name Point
+	*  Accessing/Inserting/Modifying Point geometries into the database. 
+	*/
+	//@{ 	
+	// Accessing/Inserting point geometries into the database
+	virtual bool insertPointSet	(const string& table, TePointSet &ps);	
+    virtual bool updatePointSet (const string& table, TePointSet &ps);
+	virtual bool loadPointSet	(const string& table, TeBox &box, TePointSet &ps);
+	virtual TeDatabasePortal* loadPointSet	(const string& table, TeBox &box);
+	virtual bool loadPointSet	(const string& table, const string& geoid, TePointSet &ps);
+	virtual bool loadPointSet	(TeTheme* theme, TePointSet &ps);
+	virtual bool selectPointSet (const string& table, const string& criteria, TePointSet &ps);
+
+    virtual bool insertPoint	(const string& table, TePoint &p) = 0;	
+	virtual bool updatePoint	(const string& table, TePoint &p);
+	virtual bool locatePoint	(const string& table, TeCoord2D &pt, TePoint &point, const double& tol = 0.0);
+	virtual bool locatePointSet (const string& table, TeCoord2D &pt, TePointSet &pointSet, const double& tol=0.0);
+	//@}
+
+	/** @name Text
+	*  Accessing/Inserting/Modifying Text geometries into the database. 
+	*/
+	//@{ 	
+	// Accessing/Inserting text geometries into the database
+	virtual bool insertTextSet	(const string& table, TeTextSet &ts);	
+	virtual bool updateTextSet	(const string& table, TeTextSet &ts);	
+	virtual bool loadTextSet	(const string& table, const string& geoid, TeTextSet &ts);
+	virtual bool selectTextSet	(const string& table, const string& criteria, TeTextSet &ts);
+
+	virtual bool insertText		(const string& table, TeText &t) = 0;	
+	virtual bool updateText		(const string& table, TeText &t);
+	virtual bool locateText		(const string& table, TeCoord2D &pt, TeText &text, const double& tol = 0.0);
+	virtual bool locateTextSet	(const string& table, TeCoord2D &pt, TeTextSet &textSet, const double& tol = 0.0);
+	//@}
+
+	/** @name Arc
+	*  Accessing/Inserting/Modifying Arc geometries  into the database. 
+	*/
+	//@{ 	
+	//! Inserts an arc set geometry in the database.
+	virtual bool insertArcSet	(const string& table, TeArcSet &as);	
+
+	//! Updates arc set geometry in the database.
+	virtual bool updateArcSet	(const string& table, TeArcSet &as);	
+
+	//! Loads an arc geometry from the database that has the specified object id (geoid).
+	virtual bool loadArcSet		(const string& table, const string& geoid, TeArcSet &as);
+
+	//! Inserts an arc geometry in the database.
+	virtual bool insertArc		(const string& table,TeArc &arc) = 0;
+
+	//! Updates an arc geometry in the database.
+	virtual bool updateArc		(const string& table,TeArc &arc);
+	//@}
+
+	/** @name Node
+	*  Accessing/Inserting/Modifying Node geometries into the database. 
+	*/
+	//@{ 	
+	// Accessing/Inserting node geometries into the database
+	virtual bool insertNodeSet	(const string& table, TeNodeSet &ns);	
+	virtual bool updateNodeSet	(const string& table, TeNodeSet &ns);	
+	virtual bool loadNodeSet	(const string& table, const string& geoid, TeNodeSet &ps);
+
+	virtual bool insertNode		(const string& table, TeNode &node) = 0;	
+	virtual bool updateNode		(const string& table, TeNode &node);	
+	//@}
+
+	/** @name Cell
+	*  Accessing/Inserting/Modifying Cell geometries  into the database. 
+	*/
+	//@{ 	
+	// Accessing/Inserting cell geometries into the database
+	virtual bool insertCellSet	(const string& table, TeCellSet &cs);	
+	virtual bool updateCellSet	(const string& table, TeCellSet &cs);	
+	virtual bool loadCellSet	(const int& layerId, const string& table, const string& geoid, TeCellSet &cs);
+	virtual bool selectCellSet	(const int& layerId, const string& table, const string& criteria, TeCellSet &cs);
+
+	virtual bool insertCell		(const string& table, TeCell &c) = 0;
+	virtual bool updateCell		(const string& table, TeCell &c);
+	virtual bool locateCell		(const string& table, TeCoord2D &pt, TeCell &c, const double& tol = 0.0);
+	//@}
+
+	//! Removes a geometry from the given tableName
+	virtual bool removeGeometry(const string& tableName, const TeGeomRep& rep, const int& geomId);
+	
+	//! Insert a raster block into the database
+	/*!
+      \param table table name
+	  \param blockId block unique identifier
+	  \param ll  block lower left coordinate
+	  \param ur  block upper right coordinate
+	  \param buf block binary data
+	  \param size block size
+	  \param band block band
+	  \param res block resolution factor
+	  \param subband sub band definitiion
+	*/
+	virtual	bool insertRasterBlock(const string& table, const string& blockId, const TeCoord2D& ll, const TeCoord2D& ur, unsigned char *buf,unsigned long size, int band=0, unsigned int res=1, unsigned int subband=0) = 0;
+
+	//! Inserts the entire visual of a Legend
+	virtual	bool insertVisual (TeLegendEntry *legend);
+
+	//! Insert raster visual
+	virtual bool insertRasterVisual (int themeId , TeRasterVisual* rasterVisual);
+
+	//! Returns the raster associated to a layer
+	virtual TeRaster* loadLayerRaster(int layerId, const string& objectId="", const char& mode = 'r');
+
+	//! Creates a lookup table (used for pallete raster representations)
+	virtual bool createLUTTable(const string& name);
+
+	//! Loads a look up table associated to a raster and fills its parameters
+	virtual bool loadRasterLUT(TeRasterParams* par);
+
+	//! Creates a spatial index for a spatial table. In order to get correct column names to index, see getSpatialIdxColumn method.
+	virtual bool createSpatialIndex(const string& table, const string& columns, TeSpatialIndexType /*type*/ = TeRTREE,short /* level */ =0,short /* tile */ =0);
+
+	//! Creates a spatial metadata for a spatial table. It is implemented only in spatial databases.
+	virtual bool insertMetadata(const string& /* table */, const string& /* column */, double /* tolx */, double /* toly */,TeBox &/* box */,short /* srid */ =0) { return true; };
+
+	//! Returns the name of the column that wiil be the spatially indexed, for a given type of geometry table 
+	virtual string getSpatialIdxColumn(TeGeomRep rep);
+
+	//! Update box information in a table that has a set of columns to store a box value
+	/*
+		This method gives to the drivers the ability to update box columns, considering precision issues
+		that are particular to the driver. The box should be stored in 4 columns (lower_x, lower_y, upper_x, upper_y)
+		\param tableName table name
+		\param keyColumnName name of the column that is primary key
+		\param idValue key value of the row that should be updated
+		\param box new box value
+	*/
+   virtual bool updateBBox(const string& tableName, const string& keyColumnName, int keyValue, const TeBox& box);  
+
+
+	/** @name Spatial Operations with vector data
+	*  spatial operations over geometries into the database. 
+	*/
+	//@{ 	
+
+	/** @name topologic relation query
+	*  topologic relation query over geometries into the database. 
+	*/
+	//@{
+	/*!
+	  \brief Returns the geometries of a geometric table (actGeomTable) that have a specific spatial relation (relate) with a subset of geometries of this table (actGeomTable)   
+	  \param actGeomTable	geometric table name
+	  \param actRep			geometric representation of the geometric table
+	  \param actIdsIn		identifiers of a geometry subset of the actGeomTable table 
+	  \param portal			a pointer to a database portal that will contain the resulted geometries
+	  \param relate			spatial relation
+	  \param actCollTable	collection table name
+	 */
+	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+		TeDatabasePortal *portal, int relate, const string& actCollTable="");
+	
+	/*!
+	  \brief Returns the geometries of a geometric table (visGeomTable) that have a specific spatial relation (relate) with a subset of geometries of other geometric table (actGeomTable)   
+	  \param actGeomTable	geometric table name
+	  \param actRep			geometric representation of the actGeomTable table
+	  \param actIdsIn		identifiers of a geometry subset of the actGeomTable table 
+	  \param visGeomTable	geometric table name
+	  \param visRep			geometric representation of the visGeomTable table
+	  \param portal			a pointer to a database portal that will contain the resulted geometries
+	  \param relate		 	spatial relation
+	  \param visCollTable	collection table name associated with the visGeomTable table
+	 */
+	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+		const string& visGeomTable, TeGeomRep visRep, TeDatabasePortal *portal, 
+		int relate, const string& visCollTable=""); 
+
+	/*!
+	  \brief Returns the geometries of a geometric table (actGeomTable) that have a specific spatial relation (relate) with a geometry in memory (geom)
+	  \param actGeomTable	geometric table name
+	  \param actRep			geometric representation of the actGeomTable table
+	  \param geom			a pointer to a geometry in memory
+	  \param portal			a pointer to a database portal that will contain the resulted geometries
+	  \param relate			spatial relation
+	  \param actCollTable	collection table name associated with the actGeomTable table
+	 */
+	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
+		TeDatabasePortal *portal, int relate, const string& actCollTable=""); 
+		
+	/*!
+	  \brief Returns the geometries of a geometric table (actGeomTable) that have a specific spatial relation (relate) with a subset of geometries of this table (actGeomTable)   
+	  \param actGeomTable	geometric table name
+	  \param actRep			geometric representation of the geometric table
+	  \param actIdsIn		identifiers of a geometry subset of the actGeomTable table 
+	  \param actIdsOut		structure that will contain the identifiers of the resulted geometries
+	  \param relate			spatial relation
+	  \param actCollTable	collection table name
+	 */
+	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+		TeKeys& actIdsOut, int relate, const string& actCollTable="");
+
+	/*!
+	  \brief Returns the geometries of a geometric table (visGeomTable) that have a specific spatial relation (relate) with a subset of geometries of other geometric table (actGeomTable)   
+	  \param actGeomTable	geometric table name
+	  \param actRep			geometric representation of the actGeomTable table
+	  \param actIdsIn		identifiers of a geometry subset of the actGeomTable table 
+	  \param visGeomTable	geometric table name
+	  \param visRep			geometric representation of the visGeomTable table
+	  \param visIdsOut		structure that will contain the identifiers of the resulted geometries
+	  \param relate			spatial relation
+	  \param visCollTable	collection table name associated with the visGeomTable table
+	 */
+	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+		const string& visGeomTable, TeGeomRep visRep, TeKeys& visIdsOut, int relate, 
+		const string& visCollTable="", TeDatabase* = 0); 
+
+	/*!
+	  \brief Returns the geometries of a geometric table (actGeomTable) that have a specific spatial relation (relate) with a geometry in memory (geom)
+	  \param actGeomTable	geometric table name
+	  \param actRep			geometric representation of the actGeomTable table
+	  \param geom			a pointer to a geometry in memory
+	  \param actIdsOut		structure that will contain the identifiers of the resulted geometries
+	  \param relate			spatial relation
+	  \param actCollTable	collection table name associated with the actGeomTable table
+	*/
+	virtual bool spatialRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
+		TeKeys& actIdsOut, int relate, const string& actCollTable=""); 
+	//@}
+	
+	/** @name metric functions
+	*  metric functions over geometries into the database. 
+	*/
+	//@{
+	/*!
+		\brief Calculates the area of a geometry set of the geometric table (actGeomTable) 
+		\param actGeomTable	geometric table name
+		\param actRep		geometric representation of the geometric table
+		\param actIdsIn		identifiers of the geometry set of the actGeomTable table 
+		\param area			the returned area value 
+	 */
+	virtual bool calculateArea(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, double &area);
+
+	/*!
+		\brief Calculates the length of a geometry set of the actGeomTable table 
+		\param actGeomTable	geometric table name
+		\param actRep		geometric representation of the geometric table
+		\param actIdsIn		identifiers of the geometry set of the actGeomTable table 
+		\param length		the returned length value 
+	 */
+	virtual bool calculateLength(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, double &length);
+	
+	/*!
+		\brief Calculates the distance between two geometries of the actGeomTable table 
+		\param actGeomTable	geometric table name
+		\param actRep		geometric representation of the geometric table
+		\param Ids			identifiers of the two geometries of the actGeomTable table 
+		\param distance		the returned distance value 
+	 */
+	virtual bool calculateDistance(const string& actGeomTable, TeGeomRep actRep, TeKeys& Ids, double& distance);
+
+	/*!
+		\brief Calculates the distance between a geometry of a geometric table (actGeomTable) and a geometry of other geometric table (visGeomTable)
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param objId1			identifier of the geometry of the actGeomTable table
+		\param visGeomTable		geometric table name
+		\param visRep			geometric representation of the visGeomTable table
+		\param objId2			identifier of the geometry of the visGeomTable table
+		\param distance			the returned distance value 
+	 */
+	virtual bool calculateDistance(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
+		const string& visGeomTable, TeGeomRep visRep, const string& objId2, double& distance);
+
+	/*!
+	  \brief Returns the geometries of a geometric table (actGeomTable) that are within a specific distance from a point in memory 
+	  \param actGeomTable	geometric table name
+	  \param actRep			geometric representation of the actGeomTable table
+	  \param point			a point in memory
+	  \param IdsDistOut		structure that will contain the identifiers of the resulted geometries and their distances
+	  \param max_distance	maximum distance 
+	  \param actCollTable	collection table name associated with the actGeomTable table
+	*/
+	virtual bool withinDistance(const string& actGeomTable, TeGeomRep actRep, const TeCoord2D& point, 
+		TeKeysToDist& IdsDistOut, const double& max_distance, const string& actCollTable="");
+	//@}
+
+
+	/** @name functions that generate new geometries 
+	*  functions that generate new geometries over geometries into the database. 
+	*/
+	//@{
+	/*!
+		\brief Returns the buffers with a specific distance of a geometry set of a geometric table (actGeomTable)
+		\param actGeomTable	geometric table name
+		\param actRep		geometric representation of the geometric table
+		\param actIds		identifiers of the geometry set of the actGeomTable table 
+		\param bufferSet	the returned buffers 
+		\param dist			the distance of the buffers
+	 */
+	virtual bool buffer(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TePolygonSet& bufferSet, double dist);
+
+	/*!
+		\brief Returns the centroids of a geometry set of a geometric table (actGeomTable)
+		\param actGeomTable	geometric table name
+		\param actRep		geometric representation of the geometric table
+		\param centroidSet	the returned centroids 
+		\param actIds		identifiers of the geometry set of the actGeomTable table 
+		\param actCollTable collection table name associated with the actGeomTable table 
+	*/
+	virtual bool centroid(const string& actGeomTable, TeGeomRep actRep, TePointSet& centroidSet, TeKeys actIds = vector<string>(), const string& actCollTable = "");
+
+	/*!
+		\brief Returns the convex geometries of a geometries set of a geometric table (actGeomTable)
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the geometric table
+		\param actIds			identifiers of the geometry set of the actGeomTable table 
+		\param convexHullSet	the returned convex geometries 
+	*/
+	virtual bool convexHull(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TePolygonSet& convexHullSet);
+	//@}
+
+	/*!
+		\brief Returns the nearest neighbors of a specific geometry of a geometric table (actGeomTable)
+		\param actGeomTable		geometric table name
+		\param actCollTable		collection table name associated with the actGeomTable table
+		\param actRep			geometric representation of the geometric table
+		\param objId1			identifier of the geometry of the actGeomTable table
+	    \param actIdsOut		structure that will contain the identifiers of the nearest neighbors 
+		\param numRes			the number of nearest neighbors that will be returned
+	*/
+	virtual bool nearestNeighbors(const string& actGeomTable, const string& actCollTable,
+		TeGeomRep actRep, const string& objId1, TeKeys& actIdsOut, int numRes=1);
+	
+	/*!
+		\brief Returns the nearest neighbors of a geometric table (visGeomTable) of a specific geometry of other geometric table (actGeomTable)
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param objId1			identifier of the geometry of the actGeomTable table
+		\param visGeomTable		geometric table name
+		\param visCollTable		collection table name associated with the visGeomTable table
+		\param visRep			geometric representation of the visGeomTable table
+	    \param visIdsOut		structure that will contain the identifiers of the nearest neighbors 
+		\param numRes			the number of nearest neighbors that will be returned
+	*/
+	virtual bool nearestNeighbors(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
+		const string& visGeomTable, const string& visCollTable, 
+		TeGeomRep visRep, TeKeys& visIdsOut, int numRes=1); 
+
+	/*!
+		\brief Returns the nearest neighbors of a specific geometry of a geometric table (actGeomTable)
+		\param actGeomTable		geometric table name
+		\param actCollTable		collection table name associated with the actGeomTable table
+		\param actRep			geometric representation of the geometric table
+		\param objId1			identifier of the geometry of the actGeomTable table
+	    \param portal			a pointer to a database portal that will contain the identifiers of the nearest neighbors 
+		\param numRes			the number of nearest neighbors that will be returned
+	*/
+	virtual bool nearestNeighbors(const string& actGeomTable, const string& actCollTable, 
+		TeGeomRep actRep, const string& objId1, TeDatabasePortal* portal, int numRes=1);
+
+	/*!
+		\brief Returns the nearest neighbors of a geometric table (visGeomTable) of a specific geometry of other geometric table (actGeomTable)
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param objId1			identifier of the geometry of the actGeomTable table
+		\param visGeomTable		geometric table name
+		\param visCollTable		collection table name associated with the visGeomTable table
+		\param visRep			geometric representation of the visGeomTable table
+	    \param portal			a pointer to a database portal that will contain the identifiers of the nearest neighbors 
+		\param numRes			the number of nearest neighbors that will be returned
+	*/
+	virtual bool nearestNeighbors(const string& actGeomTable, TeGeomRep actRep, 
+		const string& objId1, const string& visGeomTable, const string& visCollTable, 
+		TeGeomRep visRep, TeDatabasePortal* portal, int numRes=1); 
+
+	/** @name set functions
+	*  functions of set: union, intersection, difference and symmetrical difference. 
+	*/
+	//@{
+
+	/*!
+		\brief Returns the intersection between two geometries of a geometric table (actGeomTable) 
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param actIds		identifiers of the geometry set of the actGeomTable table 
+		\param geomVect			the returned intersection 
+	 */
+	virtual bool geomIntersection(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeGeometryVect& geomVect);
+
+	/*!
+		\brief Returns the intersection between a geometry of a geometric table (actGeomTable) and a geometry of other geometric table (visGeomTable)
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param objId1			identifier of a geometry of the actGeomTable table
+		\param visGeomTable		geometric table name
+		\param visRep			geometric representation of the visGeomTable table
+		\param objId2			identifier of other geometry of the visGeomTable table
+		\param geomVect			the returned intersection 
+	 */
+	virtual bool geomIntersection(const string& actGeomTable, TeGeomRep actRep, const string& objId1,
+		const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);
+
+	/*!
+		\brief Returns the difference between two geometries of a geometric table (actGeomTable) 
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param objId1			identifier of a geometry of the actGeomTable table
+		\param objId2			identifier of other geometry of the actGeomTable table
+		\param geomVect			the returned difference 
+	 */
+	virtual bool geomDifference(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
+		const string& objId2, TeGeometryVect& geomVect);
+
+	/*!
+		\brief Returns the difference between a geometry of a geometric table (actGeomTable) and a geometry of other geometric table (visGeomTable)
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param objId1			identifier of a geometry of the actGeomTable table
+		\param visGeomTable		geometric table name
+		\param visRep			geometric representation of the visGeomTable table
+		\param objId2			identifier of other geometry of the visGeomTable table
+		\param geomVect			the returned difference 
+	 */
+	virtual bool geomDifference(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
+		const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);
+
+	/*!
+		\brief Returns the union between geometries of a geometric table (actGeomTable) 
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param actIds			identifiers of the geometry set of the actGeomTable table 
+		\param geomVect			the returned union 
+	 */
+	virtual bool geomUnion(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeGeometryVect& geomVect);
+
+	/*!
+		\brief Returns the union between a geometry of a geometric table (actGeomTable) and a geometry of other geometric table (visGeomTable)
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param objId1			identifier of a geometry of the actGeomTable table
+		\param visGeomTable		geometric table name
+		\param visRep			geometric representation of the visGeomTable table
+		\param objId2			identifier of other geometry of the visGeomTable table
+		\param geomVect			the returned union 
+	 */
+	virtual bool geomUnion(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
+		const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);
+
+	/*!
+		\brief Returns the symmetrical difference between two geometries of a geometric table (actGeomTable) 
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param objId1			identifier of a geometry of the actGeomTable table
+		\param objId2			identifier of other geometry of the actGeomTable table
+		\param geomVect			the returned symmetrical difference 
+	 */
+	virtual bool geomXOr(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
+		const string& objId2, TeGeometryVect& geomVect);
+
+	/*!
+		\brief Returns the symmetrical difference between a geometry of a geometric table (actGeomTable) and a geometry of other geometric table (visGeomTable)
+		\param actGeomTable		geometric table name
+		\param actRep			geometric representation of the actGeomTable table
+		\param objId1			identifier of a geometry of the actGeomTable table
+		\param visGeomTable		geometric table name
+		\param visRep			geometric representation of the visGeomTable table
+		\param objId2			identifier of other geometry of the visGeomTable table
+		\param geomVect			the returned symmetrical difference 
+	 */
+	virtual bool geomXOr(const string& actGeomTable, TeGeomRep actRep, const string& objId1, 
+		const string& visGeomTable, TeGeomRep visRep, const string& objId2, TeGeometryVect& geomVect);	
+	//@}
+
+	/** @name Spatial Operations with raster data
+	*  spatial operations over raster data into the database. 
+	*/
+	//@{ 	
+	/*!
+		\brief Returns the statistics of raster data regions inside a geometry set of a geometric table (actGeomTable)
+		\param rasterTable		raster table name
+		\param actGeomTable		geometric table name that contains polygons
+		\param Ids				identifiers of the geometries of the actGeomTable table that define the regions in the raster data  
+		\param result			structure that will contain the resulted statistics 
+	*/
+	virtual bool zonal(const string& rasterTable, const string& actGeomTable, TeKeys& Ids, TeObjectStatistics& result, const bool &useDummy=true);
+	
+	/*!
+		\brief Returns the statistics of raster data regions inside a geometry set of a geometric table (actGeomTable)
+		\param rasterTable		raster table name
+		\param actGeomTable		geometric table name that contains polygons
+		\param actCollTable		collection table that contains the identifiers of the geometries of the actGeomTable table that define the regions in the raster data  
+		\param result			structure that will contain the resulted statistics 
+	*/
+	virtual bool zonal(const string& rasterTable, const string& actGeomTable, const string& actCollTable, TeObjectStatistics& result, const bool &useDummy=true);
+	
+	/*!
+		\brief Returns the statistics of a raster data region inside a geometry in memory 
+		\param rasterTable		raster table name
+		\param poly				the geometry in memory that define a region in the raster data 
+		\param result			structure that will contain the resulted statistics 
+	*/
+	virtual bool zonal(const string& rasterTable, TePolygon& poly, TeStatisticsDimensionVect& result,const bool &useDummy=true);
+
+	/*!
+		\brief Clips a raster data from a geometry of a geometric table (actGeomTable)
+		\param rasterTable		raster table name
+		\param actGeomTable		geometric table name that contains polygons
+		\param objId			identifier of the geometry of the actGeomTable table 
+		\param nameLayerOut		the layer name that will contain the result 
+		\param st				the strategy used in the clipping of the raster data
+	*/
+	virtual bool mask(const string& rasterTable, const string& actGeomTable, const string& objId, const string& nameLayerOut, TeStrategicIterator st);
+	
+	/*!
+		\brief Clips a raster data from a geometry in memory (poly)
+		\param rasterTable		raster table name
+		\param poly				a geometry in memory 
+		\param nameLayerOut		the layer name that will contain the result 
+		\param st				the strategy used in the clipping of the raster data
+	*/
+	virtual bool mask(const string& rasterTable, TePolygon& poly, const string& nameLayerOut, TeStrategicIterator st);
+	//@}
+	
+	/** @name specifics SQLs
+	*  return SQL strings 
+	*/
+	//@{ 	
+	//! Return a string that describes a where clause in SQL to return the geometries inside the box
+	virtual string getSQLBoxWhere (const TeBox& box, const TeGeomRep rep, const std::string& tableName);
+
+	//! Return a string that describes a where clause in SQL to return the geometries of the table2 that are 
+	//! inside the geometries box of the table1 (table1 must have lower_x, lower_y...) 
+	virtual string getSQLBoxWhere (const string& table1, const string& table2, TeGeomRep rep2, TeGeomRep rep1 = TePOLYGONS);
+
+	//! Return a string SQL to be used in the clause SELECT to select the box (lower_x, lower_y, upper_x, upper_y)
+	virtual string getSQLBoxSelect (const string& tableName, TeGeomRep rep);
+
+	//!< Returns a string SQL to be used in the ORDER BY clause when querying geometries.
+	virtual std::string getSQLOrderBy(const TeGeomRep& rep) const;
+
+	//! Return a string SQL to calculate the statistics of some attributes
+	virtual string getSQLStatistics (TeGroupingAttr& attrs);
+	
+	//! Return the database function in SQL to generate autonumber values
+	virtual string getSQLAutoNumber(const string& table);
+
+	//! Return a string SQL to temporal where
+	virtual string getSQLTemporalWhere (TeTimeInterval& /* timeInterval */, TeTemporalRelation /* timeOperator */, const string& /* initialTime */, const string& /* finalTime */ );
+
+	//! Return a string SQL to temporal where 
+	virtual string getSQLTemporalWhere (const string& temporalRest);
+		
+	//! Return a string SQL to temporal where
+	virtual string getSQLTemporalWhere(int /* time1 */, int /* time2 */, TeChronon /* chr */, TeTemporalRelation /* rel */, const string& /* initialTime */, const string& /* finalTime */);
+
+	//! Returns a valid SQL time string
+	virtual string getSQLTime(const TeTime& /* time */) const { return ""; };
+
+	//! Returns a SQL temporal expression applied to a column
+	virtual string getSQLTemporalFunction (TeChronon chr, const string& colName);
+	//@}
+
+	//! Return the box of a specific geometry (object_id)  
+	virtual bool getMBRGeom(string tableGeom, string object_id, TeBox& box, string colGeom);
+
+	//! Return the box of a select objects set 
+	virtual bool getMBRSelectedObjects(string geomTable,string colGeom, string fromClause, 
+		string whereClause, string afterWhereClause, TeGeomRep repType,TeBox &bout, const double& tol = 0.0);
+
+	//! Gets the list of attributes of a table
+	virtual bool getAttributeList(const string& tableName,TeAttributeList& attList);
+
+	//! Escape special characters in a string to be used in a SQL statement
+	virtual string  escapeSequence(const string& from) = 0;
+
+	//! Returns theme box
+	virtual TeBox getThemeBox(TeTheme* theme);
+
+	//! Returns the container of legend title alias
+	map<int, map<string, string> >& mapThemeAlias() {return metaModel_->mapThemeAlias();}
+
+	//! Concat values in a vector using unionString as the join between each value
+	virtual string concatValues(vector<string>& values, const string& unionString) = 0;
+
+	//! Returns the SQL function for upper case
+	virtual string toUpper(const string& value) = 0;
+
+	//! Returns the SQL function for substring that starts from left to right with informed length.
+	virtual string leftString(const string& /*name*/, const int& /*length*/){return "";}
+
+	//! Write the given version as the terralib version in the database
+	virtual	bool updateVersionStamp(const string& version ); 
+
+	//! Read and returns the terralib version from the database
+	virtual	bool loadVersionStamp( string& version ); 
+
+   /** @name Transaction control methods 
+	\Note should be implemented by the drivers that has it. Default implementation
+	is DO NOTHING.
+   */
+   //@{ 
+   //! Begins a transaction
+   virtual bool beginTransaction(); 
+
+   //! Commits a transaction
+   virtual bool commitTransaction();
+
+   //! Rollbacks a transaction
+   virtual bool rollbackTransaction();
+   //@}
+
+   //! Drops a database view
+   virtual bool dropDBView(const string& dbViewName);
+   
+	//! Gets the client encoding
+   virtual std::string getClientEncoding()
+   { return ""; }
+
+	//! Sets the client encoding
+   virtual bool setClientEncoding(const std::string& /*characterSet*/)
+   { return true; }
+
+	//! Retrives the list of available character sets
+   virtual bool getEncodingList(std::vector<std::string>& /*vecEncodingList*/)
+   { return true; }
+
+   //! Retrives the list of available character sets
+   virtual bool getEncodingList(const std::string& /*host*/, const std::string& /*user*/, const std::string& /*password*/, const int& /*port*/, std::vector<std::string>& /*vecEncodingList*/)
+   { return true; }
+
+
+protected :
+
+	bool				isConnected_;			//!< indicates if the connection is open
+	string				host_;					//!< host name of the database server
+	string				user_;					//!< user name 
+	string				password_;				//!< user password
+	string				database_;				//!< database name
+	int					portNumber_;			//!< port number
+	int					errorNumber_;			//!< error number
+	string				errorMessage_;			//!< error message
+	string				dbmsName_;				//!< DBMS name (Ado, MySQL, Postgres, OracleSpatial)
+	TeSharedPtr<TeMetaModelCache> metaModel_;	//!< Meta model: Layers, Themes, Views...
+
+	//! Update metadata about an attribute table that had its name or columns changed
+	void alterTableInfoInMemory(const string& updatedTableName, string oldTableName="");
+
+	int               transactionCounter_;//!< counts how many nested transactions have been opened
+
+private:
+
+	TeDatabase(const TeDatabase& other);
+};
+
+//! An abstract access portal to a database
+/*! A portal has a concept of a record set, that is generated by a selection (query) on
+	the data accessible through a connection to a database server.
+  \sa TeDatabase, TeGeometry, TeTable, TeTheme, TeView, TeLayer
+
+  */
+class TL_DLL TeDatabasePortal {
+protected:
+	
+
+	TeDatabase*		db_;			//!< the database associated to this portal
+	TeAttributeList	attList_;		//!< the list of attributes associated to this portal
+	int				numRows_;		//!< the number of rows in this portal
+	int				numFields_;		//!< the number of fields in this portal
+	string          errorMessage_;	//!< error message
+	int				errorNumber_;	//!< error number
+
+public :
+
+	//!Constructor 
+	TeDatabasePortal ();
+
+	//! Destructor
+	virtual ~TeDatabasePortal ();
+	
+	//! Returns the database associated to this portal 
+	TeDatabase* getDatabase()
+	{ return db_; }
+
+	//! Executes a SQL query that opens a record set
+	virtual bool query ( const string &qry, TeCursorLocation l = TeSERVERSIDE, TeCursorType t = TeUNIDIRECTIONAL, TeCursorEditType e = TeREADONLY, TeCursorDataType dt = TeTEXTCURSOR ) = 0;
+
+	//! Fetchs the next row in a record set that shouldve been previously opened
+	virtual bool fetchRow () = 0;
+
+	//! Fetchs a particular row
+	virtual bool fetchRow (int i) = 0;
+
+	//! Frees the current record set
+	virtual void freeResult () = 0;
+
+	//! Gets the last error message
+	virtual string	errorMessage ()
+	{ return errorMessage_; }
+
+	//! Gets the number of the last error message
+	virtual int errorNum ()
+	{ return errorNumber_; }
+	
+//	virtual bool loadNetwork (TeLayer *layer) = 0;
+
+// specific SQL SELECT command methods
+
+	/*! \brief Retrieves the number of rows in a portal. Some drivers
+	           (like PostgreSQL and PostGIS) brings to the client only
+			   a part of the row, and then this number can be less than
+			   the number of rows returned by query.
+    */
+	int numRows () 
+	{ return numRows_;}
+
+	//! Retrieves the number of fields in this portal
+	int numFields () 
+	{ return numFields_; }
+
+	//! Retrieves attribute list in this portal
+	TeAttributeList& getAttributeList()	
+	{ return attList_; }
+
+	//! Retrieves the i-th attribute in this portal
+	TeAttribute getAttribute (int i);
+
+	//! Retrieves an attribute by name
+	TeAttribute getAttribute (const string& s);
+
+	//! Gets the value of the i-th attribute as a literal
+	virtual char* getData (int i) = 0;
+
+	//! Gets the value of a named attribute as a literal
+	virtual char* getData (const string& s) = 0;
+
+	//! Gets the value of the i-th attribute as a double
+	virtual double getDouble (int i);
+
+	//! Gets the value of a named attribute as a double
+	virtual double getDouble (const string& s);
+
+	//! Gets the value of the i-th attribute as an integer
+	virtual int getInt (int i);
+
+	//! Gets the value of a named attribute as an integer
+	virtual int getInt (const string& s);
+
+	//! Gets the value of a named attribute as a boolean
+	virtual bool getBool (const string& s) = 0;
+
+	//! Gets the value of the i-th attribute as a boolean
+	virtual bool getBool (int i) = 0;
+
+	//! Gets the value of the i-th attribute as a date 
+	virtual TeTime getDate (int i) = 0;
+
+	//! Gets the value of a named attribute as a date 
+	virtual TeTime getDate (const string& s) = 0;
+
+	//! Gets the of a date/time attribute as a string formatted as accepted in further SQL statements
+	virtual string getDateAsString(int i) = 0;
+
+	//! Gets the of a date/time attribute as a string formatted as accepted in further SQL statements
+	virtual string getDateAsString(const string& s) = 0;
+
+	//! Gets the value of a named BLOB attribute 
+	virtual bool getBlob(const string& s, unsigned char* &data, long& size) = 0;
+
+	//! Gets the index of a named attribute
+	int getColumnIndex (const string& s);
+
+	//! Gets the name of the i-th attribute
+	string getColumnName (int i);
+
+	/** @name Data Model
+	  The following methods decodify structures as stored 
+	  in the database according to the data model proposed in TerraLib. 
+	*/
+	//@{ 	
+	virtual TeViewTree*		getViewTree ();
+	virtual TeLegendEntry	getLegend();
+	virtual void			getVisual(TeVisual*);
+	virtual bool			getVisual(TeVisual* vis, TeGeomRep& rep, const unsigned int& initIndex);
+	virtual bool			getRasterVisual(TeRasterVisual& vis, const unsigned int& initIndex=0);
+	virtual TeColor			getColor(); 
+	virtual bool	getRasterBlock(unsigned long& size, unsigned char* ptData)=0;
+	virtual bool	getView(TeView& view, const unsigned int& initIndex=0);
+	virtual bool	getProjection(TeProjection** proj, const unsigned int& initIndex=0);
+	virtual void	getViewNodeParams (TeViewNodeParams& params, const unsigned int& initIndex=0);
+	virtual bool	getTheme(TeAbstractTheme& theme, const unsigned int& initIndex=0);
+	virtual bool	getGrouping(TeGrouping& group, const unsigned int& initIndex=0);
+	virtual bool	getLegend(TeLegendEntry& leg, const unsigned int& initIndex=0);
+	virtual bool	getAttrTable(TeTable& table, const unsigned int& initIndex=0);
+	virtual bool	getLayer(TeLayer& layer, const unsigned int& initIndex=0);
+	virtual bool	getRepresentation(TeRepresentation& rep, const unsigned int& initIndex=0);
+
+	//@}
+
+	/** @name Fetch Geometry
+	  The following methods decodify geometries as stored 
+	  in the database according to the data model proposed in TerraLib.
+	  \param geom		the geometry that will be filled from portal
+	  \param initIndex  the position index in the portal where begins the geometry information 
+	  \return The fetchGeometry methods advance the portal to the next record and 
+	  they return TRUE if there are more records to be read and FALSE otherwise.
+	*/
+	//@{ 	
+	virtual	bool fetchGeometry (TePolygon& geom) = 0;
+	virtual	bool fetchGeometry (TePolygon& geom, const unsigned int& initIndex); 
+	virtual	bool fetchGeometry (TeLine2D& geom) = 0;
+	virtual	bool fetchGeometry (TeLine2D& geom, const unsigned int& initIndex); 
+	virtual	bool fetchGeometry (TeNode& geom) = 0;
+	virtual	bool fetchGeometry (TeNode& geom, const unsigned int& initIndex);
+	virtual	bool fetchGeometry (TePoint& geom) = 0;
+	virtual	bool fetchGeometry (TePoint& geom, const unsigned int& initIndex);
+	virtual	bool fetchGeometry (TeCell& geom);
+	virtual	bool fetchGeometry (TeCell& geom, const unsigned int& initIndex);
+	virtual	bool fetchGeometry (TeArc& geom);
+	virtual	bool fetchGeometry (TeArc& geom, const unsigned int& initIndex);
+	virtual	bool fetchGeometry (TeText& geom);
+	virtual	bool fetchGeometry (TeText& geom, const unsigned int& initIndex);
+	//@}
+};
+
+
+//! Breaks a collection of strings into a series of IN clauses to be used in query expressions
+/*
+	\params begin Iterator that p oints to the beginning of the collection
+	\params end Iterator that points to the end of the collection
+	\param db pointer to the database where the query expression will be applied
+	\param addPlicae flat to indicate that the character ' should enclose each string
+*/
+template <typename Iterator>
+vector<string>
+generateInClauses(Iterator& begin, Iterator& end, TeDatabase* db, bool addPlicae=true)
+{
+	int i, chunkSize = 200;
+	string inClause;
+	vector<string> inClauseVector;
+
+	Iterator temp = begin;
+	i = 0;
+	while (temp != end)
+	{
+		if (i%chunkSize == 0)
+		{
+			if (!inClause.empty())
+			{
+				inClause[inClause.size() - 1] = ')';
+				inClauseVector.push_back(inClause);
+				inClause.clear();
+			}
+			inClause = "(";
+		}
+
+		if (addPlicae)
+			inClause += "'" + db->escapeSequence(*temp) + "',";
+		else
+			inClause += db->escapeSequence(*temp) + ",";
+		i++;
+		++temp;
+	}
+	if (!inClause.empty())
+	{
+		inClause[inClause.size() - 1] = ')';
+		inClauseVector.push_back(inClause);
+	}
+	return inClauseVector;
+}
+
+
+/*! \example createDatabase.cpp
+	Shows how to create a TerraLib database.
+ */
+
+/*! \example databaseQuery.cpp
+	Shows how to retrieve an existing layer from a TerraLib database, 
+	and execute some queries on its polygon geometry table.
+ */
+
+/*! \example databaseSQLQuery.cpp
+	Shows how retrieve geometries (polygons) using an SQL query.
+ */
+ 
+/*! \example spatialQuery.cpp
+	Shows how  to use the database interface to do some	spatial queries 
+	involving objects with points, lines and polygon geometries.
+ */
+
+/*! \example spatialQueryAndBuffer.cpp
+	Shows to use the database interface to do some  spatial queries involving 
+	objects with points, lines and polygon geometries, and to generate a buffer operation.
+ */
+#endif
+	
diff --git a/src/terralib/kernel/TeDatabaseFactory.cpp b/src/terralib/kernel/TeDatabaseFactory.cpp
old mode 100755
new mode 100644
index 15cc520..a6e16c8
--- a/src/terralib/kernel/TeDatabaseFactory.cpp
+++ b/src/terralib/kernel/TeDatabaseFactory.cpp
@@ -1,36 +1,36 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDatabaseFactory.cpp
-    \brief This file implements a factory of TerraLib database handlers
-*/
-
-#include <TeDatabaseFactory.h>
-
-TeDatabaseFactory::~TeDatabaseFactory() 
-{
-}
-  
-TeDatabaseFactory::TeDatabaseFactory( const std::string& factoryName )
-  : TeFactory< TeDatabase, TeDatabaseFactoryParams >( factoryName ) 
-{
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDatabaseFactory.cpp
+    \brief This file implements a factory of TerraLib database handlers
+*/
+
+#include <TeDatabaseFactory.h>
+
+TeDatabaseFactory::~TeDatabaseFactory() 
+{
+}
+  
+TeDatabaseFactory::TeDatabaseFactory( const std::string& factoryName )
+  : TeFactory< TeDatabase, TeDatabaseFactoryParams >( factoryName ) 
+{
+}
diff --git a/src/terralib/kernel/TeDatabaseFactory.h b/src/terralib/kernel/TeDatabaseFactory.h
old mode 100755
new mode 100644
index cfab040..81eac7e
--- a/src/terralib/kernel/TeDatabaseFactory.h
+++ b/src/terralib/kernel/TeDatabaseFactory.h
@@ -1,58 +1,58 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDatabaseFactory.h
-    \brief This file implements a factory of TerraLib database handlers
-*/
-
-#ifndef TEDATABASEFACTORY_H
-  #define TEDATABASEFACTORY_H
-
-  #include <TeDatabaseFactoryParams.h>
-  #include <TeDatabase.h>
-
-  /**
-   * @brief This is the class for TeDatabase factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup DatabaseUtils
-   */
-  class TL_DLL TeDatabaseFactory : 
-    public TeFactory< TeDatabase, TeDatabaseFactoryParams >
-  {
-    public :
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TeDatabaseFactory();
-      
-    protected :
-      
-      /**
-       * @brief Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TeDatabaseFactory(const std::string& factoryName);
-  };
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDatabaseFactory.h
+    \brief This file implements a factory of TerraLib database handlers
+*/
+
+#ifndef TEDATABASEFACTORY_H
+  #define TEDATABASEFACTORY_H
+
+  #include <TeDatabaseFactoryParams.h>
+  #include <TeDatabase.h>
+
+  /**
+   * @brief This is the class for TeDatabase factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup DatabaseUtils
+   */
+  class TL_DLL TeDatabaseFactory : 
+    public TeFactory< TeDatabase, TeDatabaseFactoryParams >
+  {
+    public :
+      
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TeDatabaseFactory();
+      
+    protected :
+      
+      /**
+       * @brief Default constructor
+       *
+       * @param factoryName Factory name.
+       */
+      TeDatabaseFactory(const std::string& factoryName);
+  };
+
+#endif
diff --git a/src/terralib/kernel/TeDatabaseFactoryParams.cpp b/src/terralib/kernel/TeDatabaseFactoryParams.cpp
old mode 100755
new mode 100644
index de05c58..2c78166
--- a/src/terralib/kernel/TeDatabaseFactoryParams.cpp
+++ b/src/terralib/kernel/TeDatabaseFactoryParams.cpp
@@ -1,77 +1,77 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeDatabaseFactoryParams.h"
-
-
-TeDatabaseFactoryParams::TeDatabaseFactoryParams()
-{
-  dbms_name_ = "";
-  host_ = "";
-  user_ = "";
-  password_ = "";
-  database_ = "";
-  port_ = 0;
-}
-
-
-TeDatabaseFactoryParams::~TeDatabaseFactoryParams()
-{
-}
-
-
-bool TeDatabaseFactoryParams::operator==( 
-  const TeDatabaseFactoryParams& external ) const
-{
-  if( ( dbms_name_ == external.dbms_name_ ) &&
-      ( host_ == external.host_ ) &&
-      ( user_ == external.user_ ) &&
-      ( password_ == external.password_ ) &&
-      ( database_ == external.database_ ) &&
-      ( port_ == external.port_ ) ) {
-  
-    return true;
-  } else {
-    return false;
-  }
-}
-
-
-const TeDatabaseFactoryParams& TeDatabaseFactoryParams::operator=( 
-  const TeDatabaseFactoryParams& external )
-{
-  dbms_name_ = external.dbms_name_;
-  host_ = external.host_;
-  user_ = external.user_;
-  password_ = external.password_;
-  database_ = external.database_;
-  port_ = external.port_;
-  
-  return external;
-}
-
-
-std::string TeDatabaseFactoryParams::decName() const
-{
-  return dbms_name_;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeDatabaseFactoryParams.h"
+
+
+TeDatabaseFactoryParams::TeDatabaseFactoryParams()
+{
+  dbms_name_ = "";
+  host_ = "";
+  user_ = "";
+  password_ = "";
+  database_ = "";
+  port_ = 0;
+}
+
+
+TeDatabaseFactoryParams::~TeDatabaseFactoryParams()
+{
+}
+
+
+bool TeDatabaseFactoryParams::operator==( 
+  const TeDatabaseFactoryParams& external ) const
+{
+  if( ( dbms_name_ == external.dbms_name_ ) &&
+      ( host_ == external.host_ ) &&
+      ( user_ == external.user_ ) &&
+      ( password_ == external.password_ ) &&
+      ( database_ == external.database_ ) &&
+      ( port_ == external.port_ ) ) {
+  
+    return true;
+  } else {
+    return false;
+  }
+}
+
+
+const TeDatabaseFactoryParams& TeDatabaseFactoryParams::operator=( 
+  const TeDatabaseFactoryParams& external )
+{
+  dbms_name_ = external.dbms_name_;
+  host_ = external.host_;
+  user_ = external.user_;
+  password_ = external.password_;
+  database_ = external.database_;
+  port_ = external.port_;
+  
+  return external;
+}
+
+
+std::string TeDatabaseFactoryParams::decName() const
+{
+  return dbms_name_;
+}
diff --git a/src/terralib/kernel/TeDatabaseFactoryParams.h b/src/terralib/kernel/TeDatabaseFactoryParams.h
old mode 100755
new mode 100644
index 544c201..82ecb4c
--- a/src/terralib/kernel/TeDatabaseFactoryParams.h
+++ b/src/terralib/kernel/TeDatabaseFactoryParams.h
@@ -1,71 +1,71 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDatabaseFactoryParams.h
-    \brief This file contains the definition of parameters necessary to build a TeDatabase
-*/
-
-#ifndef TEDATABASEFACTORYPARAMS_H
-  #define TEDATABASEFACTORYPARAMS_H
-
-  #include "TeDefines.h"
-  #include <string>
-
-  /**
-   * @brief This is the class for TeDatabase factory parameters .
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup DatabaseUtils
-   */
-  class TL_DLL TeDatabaseFactoryParams
-  {
-    public :
-    
-      std::string dbms_name_;	//!< DBMS name (like PostgreSQL, PostGIS, MySQL and others).
-      std::string host_;		//!< Host name.
-      std::string user_;		//!< User name in order to stabilish a connection.
-      std::string password_;	//!< User password.
-      std::string database_;	//!< Database name.
-      int port_;				//!< Port number for network connection.
-
-      //! Default constructor
-      TeDatabaseFactoryParams();
-      
-      //! Default Destructor
-      virtual ~TeDatabaseFactoryParams();
-      
-      //! operator== implementation.
-	  /*! \param external External reference.
-	      \return true if both instances are equal, false if not.
-      */
-      bool operator==( const TeDatabaseFactoryParams& external ) const;
-      
-      //! operator= implementation.
-	  /*! \param external External reference.
-	      \return A const reference to the external object instance.
-      */
-      const TeDatabaseFactoryParams& operator=( 
-        const TeDatabaseFactoryParams& external );      
-
-      //! This is for TeFactory compatibility.
-      std::string decName() const;
-  };
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDatabaseFactoryParams.h
+    \brief This file contains the definition of parameters necessary to build a TeDatabase
+*/
+
+#ifndef TEDATABASEFACTORYPARAMS_H
+  #define TEDATABASEFACTORYPARAMS_H
+
+  #include "TeDefines.h"
+  #include <string>
+
+  /**
+   * @brief This is the class for TeDatabase factory parameters .
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup DatabaseUtils
+   */
+  class TL_DLL TeDatabaseFactoryParams
+  {
+    public :
+    
+      std::string dbms_name_;	//!< DBMS name (like PostgreSQL, PostGIS, MySQL and others).
+      std::string host_;		//!< Host name.
+      std::string user_;		//!< User name in order to stabilish a connection.
+      std::string password_;	//!< User password.
+      std::string database_;	//!< Database name.
+      int port_;				//!< Port number for network connection.
+
+      //! Default constructor
+      TeDatabaseFactoryParams();
+      
+      //! Default Destructor
+      virtual ~TeDatabaseFactoryParams();
+      
+      //! operator== implementation.
+	  /*! \param external External reference.
+	      \return true if both instances are equal, false if not.
+      */
+      bool operator==( const TeDatabaseFactoryParams& external ) const;
+      
+      //! operator= implementation.
+	  /*! \param external External reference.
+	      \return A const reference to the external object instance.
+      */
+      const TeDatabaseFactoryParams& operator=( 
+        const TeDatabaseFactoryParams& external );      
+
+      //! This is for TeFactory compatibility.
+      std::string decName() const;
+  };
+#endif
diff --git a/src/terralib/kernel/TeDatabaseIndex.cpp b/src/terralib/kernel/TeDatabaseIndex.cpp
new file mode 100644
index 0000000..6d4ebff
--- /dev/null
+++ b/src/terralib/kernel/TeDatabaseIndex.cpp
@@ -0,0 +1,39 @@
+#include <TeDatabaseIndex.h>
+
+TeDatabaseIndex::TeDatabaseIndex()
+{
+}
+
+TeDatabaseIndex::~TeDatabaseIndex()
+{
+}
+
+void TeDatabaseIndex::setIndexName(const std::string& name)
+{
+	_indexName = name;
+}
+
+std::string TeDatabaseIndex::getIndexName()
+{
+	return _indexName;
+}
+
+void TeDatabaseIndex::setColumns(const std::vector<std::string>& columns)
+{
+	_indexColumns = columns;
+}
+
+std::vector<std::string> TeDatabaseIndex::getColumns()
+{
+	return _indexColumns;
+}
+
+void TeDatabaseIndex::setIsPrimaryKey(bool isPk)
+{
+	_isPrimaryKey = isPk;
+}
+
+bool TeDatabaseIndex::isPrimaryKey()
+{
+	return _isPrimaryKey;
+}
diff --git a/src/terralib/kernel/TeDatabaseIndex.h b/src/terralib/kernel/TeDatabaseIndex.h
new file mode 100644
index 0000000..855830b
--- /dev/null
+++ b/src/terralib/kernel/TeDatabaseIndex.h
@@ -0,0 +1,93 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDatabaseIndex.h
+    \brief This file contains structures and definitions about a database index support in TerraLib
+*/
+#ifndef  __TERRALIB_INTERNAL_DATABASEINDEX_H
+#define  __TERRALIB_INTERNAL_DATABASEINDEX_H
+
+#include "TeDefines.h"
+
+#include <vector>
+#include <string>
+
+
+//! An abstract database index class
+/*!
+	Instances of this classes represent a database index.
+	It includes the index name, a string vector of 
+	attributes names and a boolean that says if is a 
+	primary	key or not.	It should be used when is necessary
+	work with database indexes in TerraLib applications.
+  
+*/
+class TL_DLL TeDatabaseIndex
+{
+
+public:
+
+	//! Empty constructor
+	TeDatabaseIndex();
+
+	//! Destructor
+	virtual ~TeDatabaseIndex();
+
+private:
+
+	//! A string with the index name
+	std::string	_indexName;
+
+	//! A string Vector of attributes names 
+	std::vector<std::string> _indexColumns;
+
+	//! A boolean that says if is primary key or not
+	bool _isPrimaryKey;
+
+public:
+	
+	/** @name Members
+	*  Methods to access class private members
+	*/
+	//@{
+
+	//! Set the name of the index
+	void setIndexName(const std::string& name);
+
+	//! Return the name of the index
+	std::string getIndexName();
+
+	//! Set the attributes vector
+	void setColumns(const std::vector<std::string>& columns);
+
+	//! Return the attributes vector
+	std::vector<std::string> getColumns();
+
+	//! Set the primary key boolean
+	void setIsPrimaryKey(bool isPk);
+
+	//! return the primary key boolean
+	bool isPrimaryKey();		
+	//@}
+};
+
+#endif
diff --git a/src/terralib/kernel/TeDatum.cpp b/src/terralib/kernel/TeDatum.cpp
old mode 100755
new mode 100644
index 33315ca..14021a4
--- a/src/terralib/kernel/TeDatum.cpp
+++ b/src/terralib/kernel/TeDatum.cpp
@@ -1,522 +1,530 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include <cstring>
-#include <cstdlib>
-#include <map>
-
-using namespace std;
-
-#include "TeDatum.h"
-#include "TeException.h"
-#include "TeUtils.h"
-
-const int NUMDATUM = 9; // number of datum
-const int NUMSPH   = 8; // number of ellipsoids
-
-bool tokenizeWKT(char** wkt, vector<string>& tokens);
-
-struct SphParam 
-{
-	double rd;
-	double flt;
-};
-
-typedef map<string, SphParam> SphMap;
-
-// Spheroid       Radius(Semi Major Axis)        Flattening
-const char* ellipsoidList [] = 
-{ 
-"Airy",	       "6.3775634e+06", "3.340906e-03",	  
-"Clarke-1866", "6.378206e+06",	"3.390060e-03",	 
-"EarthRadius", "6.371000e+06",	"0.000000e+00",
-"Everest",     "6.3772763e+06", "3.324468e-03",
-"GRS80",       "6.378137e+06",  "3.352811e-03",
-"Hayford", 	   "6.378388e+06",  "3.367003e-03", 	 
-"UGGI67", 	   "6.378160e+06",	"3.352892e-03",	 
-"WGS84",	   "6.378137e+06",	"3.352811e-03"
-};
-
-
-
-// DatumName    Spheroid        Shift_X           Shift_Y           Shift_Z
-
-const char* datumList [] = 
-{ 
-"Astro-Chua",   "Hayford",      "-7.700000e+01",  "2.390000e+02",  "5.000000e+00",
-"CorregoAlegre","Hayford",	    "-1.387000e+02",  "1.644000e+02",  "3.440000e+01",
-"Indian",	    "Everest",	    "0.000000e+00",   "0.000000e+00",  "0.000000e+00",
-"NAD27",	    "Clarke-1866",	"0.000000e+00",   "0.000000e+00",  "0.000000e+00",
-"NAD83",	    "GRS80",	    "0.000000e+00",   "0.000000e+00",  "0.000000e+00",
-"SAD69", 	    "UGGI67",       "0.000000e+00",   "0.000000e+00",  "0.000000e+00",
-"Spherical",	"EarthRadius",  "0.000000e+00",   "0.000000e+00",  "0.000000e+00",
-"WGS84",	    "WGS84",	    "6.687000e+01",   "-4.370000e+00", "3.852000e+01",
-"Aratu",	    "Hayford",	    "-7.81300e+01",   "2.9163000e+02", "-1.08480e+02"
-};
-
-const char** TeGetDatumList()
-{
-	return datumList;
-}
-
-
-typedef map<string, TeDatum> DatumMap;
-
-
-TeDatum::TeDatum(const TeDatum& other)
-{
-	name_ = other.name_;
-	rd_ = other.rd_ ;
-	flt_= other.flt_;
-	dx_ = other.dx_;
-	dy_= other.dy_;
-	dz_ = other.dz_;
-}
-
-TeDatum&
-TeDatum::operator=(const TeDatum& rhs)
-{
-	if ( this != &rhs )
-	{
-		name_ = rhs.name_;
-		rd_ = rhs.rd_;
-		flt_= rhs.flt_;
-		dx_ = rhs.dx_;
-		dy_= rhs.dy_;
-		dz_ = rhs.dz_;
-	}
-	return *this;
-}
-
-string
-TeDatum::getProj4Description()
-{
-	double shiftX, shiftY,shiftZ;
-	shiftX = shiftY = shiftZ = 0.0;
-
-	string datumProj4 = "";
-	if (name_ == "WGS84")
-	{
-		datumProj4 += " +ellps=WGS84";
-		return datumProj4;
-	}
-	else if (name_ == "Spherical")
-	{
-		datumProj4 += " +R="  + Te2String(rd_,6);
-	}
-	else if (name_ == "SAD69")
-	{
-		shiftX = -66.87;
-		shiftY = 4.37;
-		shiftZ = -38.52;
-
-		datumProj4 += " +ellps=GRS67";
-	}
-	else if (name_ == "CorregoAlegre")
-	{
-		shiftX = -205.57;
-		shiftY = 168.77;
-		shiftZ = -4.12;
-		datumProj4 += " +ellps=intl";
-	}
-	else
-	{
-		datumProj4 += " +a="  + Te2String(rd_,6);
-		datumProj4 += " +f="  + Te2String(flt_,6);
-	}
-
-	if (shiftX != 0.0 && shiftY != 0.0 && shiftZ != 0.0)
-		datumProj4 += " +towgs84=" + Te2String(shiftX,4) + "," +  Te2String(shiftY,4)+ "," +  Te2String(shiftZ,4);
-	return datumProj4;
-}
-
-string
-TeDatum::getWKTDescription()
-{
-	string sph_epsgcode = "";
-	string dtm_epsgcode = "";
-	string spheroid = "";
-	string crs_epsgcode = "";
-	string datumWKT = "GEOGCS[\"" + name_ + "\"," + "DATUM[\"" + name_ + "\", SPHEROID[\"";
-	if (name_ == "Astro-Chua")
-	{
-		spheroid = "Hayford";
-		sph_epsgcode = "7022";
-		dtm_epsgcode = "6224";
-		crs_epsgcode = "4224";
-	}
-	else if (name_ == "CorregoAlegre")
-	{
-		spheroid = "Hayford";
-		sph_epsgcode = "7022";
-		dtm_epsgcode = "6225";
-		crs_epsgcode = "4225";
-	}
-	else if (name_ == "Indian")
-	{
-		spheroid = "Everest";
-		sph_epsgcode = "7015";
-		dtm_epsgcode = "6239";
-		crs_epsgcode = "4240";
-	}
-	else if (name_ == "NAD27")
-	{
-		spheroid = "Clarke 1866";
-		sph_epsgcode = "7008";
-		dtm_epsgcode = "6609";
-		crs_epsgcode = "4267";
-	}
-	else if (name_ == "NAD83")
-	{
-		spheroid = "GRS80";
-		sph_epsgcode = "7019";
-		dtm_epsgcode = "6326";
-		crs_epsgcode = "4269";
-	}
-	else if (name_ == "WGS84")
-	{
-		spheroid = "GRS80";
-		sph_epsgcode = "7019";
-		dtm_epsgcode = "6326";
-		crs_epsgcode = "4326";
-	}
-	else if (name_ == "SAD69")
-	{
-		spheroid = "UGGI67";
-		sph_epsgcode = "7036";
-		dtm_epsgcode = "6291";
-		crs_epsgcode = "4618";
-	}
-	else if (name_ == "Spherical")
-	{
-		spheroid = "EarthRadius";
-		sph_epsgcode = "7035";
-	}
-	else
-		spheroid = "UserDefined";
-	datumWKT += spheroid + "\"," + Te2String(rd_,6) + ", " + Te2String(1.0/flt_,6);
-	if (!sph_epsgcode.empty())
-		datumWKT +=",AUTHORITY[\"EPSG\"," + sph_epsgcode + "]";
-	datumWKT += "]";
-	double shiftX, shiftY, shiftZ;
-	shiftX = shiftY = shiftZ = 0.0;
-	if (name_ == "SAD69")
-	{
-		shiftX = -66.87;
-		shiftY = 4.37;
-		shiftZ = -38.52;
-	}
-	else if (name_ == "CorregoAlegre")
-	{
-		shiftX = -205.57;
-		shiftY = 168.77;
-		shiftZ = -4.12;
-	}
-	if (shiftX != 0.0 && shiftY != 0.0 && shiftZ != 0.0)
-		datumWKT += ",TOWGS84[" + Te2String(shiftX,4) + "," + Te2String(shiftY,4) + "," + Te2String(shiftZ,4) + ",0.0,0.0,0.0,0.0]";
-
-	if (!dtm_epsgcode.empty())
-		datumWKT += ",AUTHORITY[\"EPSG\"," + dtm_epsgcode + "]";
-	datumWKT += "]";
-	if (!crs_epsgcode.empty())
-		datumWKT += ",AUTHORITY[\"EPSG\"," + crs_epsgcode + "]";
-	datumWKT += "]";
-	return datumWKT;
-}
-
-TeDatum
-TeDatumFactory::make( const string& name )
-{
-
-	DatumMap datumMap_;
-	// Step 1 - Read the Spheroids - Put in a Map
-
-	SphMap sphMap;
-
-	SphParam sphPar;
-
-	int i, k = 0;
-
-	for ( i = 0; i < NUMSPH; i++ )
-	{
-		string name = ellipsoidList [k++];
-		sphPar.rd  = atof ( ellipsoidList [k++] );
-		sphPar.flt = atof ( ellipsoidList [k++] );
-
-		sphMap [ name ] = sphPar;
-	}
-	
-	// Step 2 - Read the Datum List, create a Map
-
-
-	k = 0;
-
-	for ( i = 0; i < NUMDATUM; i++ )
-	{
-			string name = datumList [k++];
-			
-			string sphname = datumList [ k++];
-
-			double 	dx  = atof ( datumList [k++] );
-			double  dy  = atof ( datumList [k++] );
-			double  dz  = atof ( datumList [k++] );
-
-			SphMap::iterator it = sphMap.find ( sphname );
-			
-			if ( it == sphMap.end() )
-			{
-				throw TeException ( DATUM_ERROR );
-			}
-			else 
-				sphPar = (*it).second;
-
-			TeDatum dat ( name, sphPar.rd, sphPar.flt, dx, dy, dz );
-
-			datumMap_ [ name ] = dat; // create a datum map
-	}
-
-	DatumMap::iterator it = datumMap_.find ( name );
-
-	if ( it != datumMap_.end() ) // found it
-		return (*it).second;
-
-	return TeDatum ("Spherical");
-}
-
-TeDatum 
-TeDatumFactory::makeFromEPSGCode(const std::string epsgCode)
-{
-	string dname;
-	if (epsgCode == "6224")
-	{
-		dname = "Astro-Chua";
-	}
-	else if (epsgCode == "6225")
-	{
-		dname = "CorregoAlegre";
-	}
-	else if (epsgCode == "6240")
-	{
-		dname = "Indian";
-	}
-	else if (epsgCode == "6609")
-	{
-		dname = "NAD27";
-	}
-	else if (epsgCode == "6152")
-	{
-		dname = "NAD83";
-	}
-	else if (epsgCode == "6326")
-	{
-		dname = "WGS84";
-	}
-	else if (epsgCode == "6618")
-	{
-		dname = "SAD69";
-	}
-	else 
-	{
-		dname = "Spherical";
-	}
-	TeDatum dat = TeDatumFactory::make(dname);
-	return dat;
-}
-
-
-TeDatum 
-TeDatumFactory::makeFromWKT(const std::string wktDatumDescription)
-{
-	TeDatum dat;
-	vector<string> tokens;
-	char* wktchar = new char[wktDatumDescription.size()];
-	strcpy(wktchar,wktDatumDescription.c_str());
-	if (!tokenizeWKT((char **) &wktchar, tokens))
-	{
-		return dat;
-	}
-	unsigned int i =0;
-	while (i<tokens.size() && tokens[i] != "DATUM")
-		++i;
-
-	if (i== tokens.size())
-		return dat;
-	++i;
-
-	map<string,string> ewktToTeDatum;
-	ewktToTeDatum["D_Chua"] = "Astro-Chua";
-	ewktToTeDatum["D_Corrego_Alegre"] = "CorregoAlegre";
-	ewktToTeDatum["D_Indian_1975"] = "Indian";
-	ewktToTeDatum["D_North_American_1927"] = "NAD27";
-	ewktToTeDatum["D_North_American_1983"] = "NAD83";
-	ewktToTeDatum["D_South_American_1969"] = "SAD69";
-	ewktToTeDatum["D_WGS_1984"] = "WGS84";
-	ewktToTeDatum["D_Aratu"] = "Aratu";
-	// lets the ESRI's WKT format 
-	TeTrim(tokens[i]);
-	map<string,string>::iterator it = ewktToTeDatum.find(tokens[i]);
-	if (it != ewktToTeDatum.end())
-	{
-		dat = TeDatumFactory::make(it->second);
-		return dat;
-	}
-
-	map<string,string> wktToTeDatum;
-	wktToTeDatum["Chua"] = "Astro-Chua";
-	wktToTeDatum["Corrego_Alegre"] = "CorregoAlegre";
-	wktToTeDatum["Indian_1975"] = "Indian";
-	wktToTeDatum["North_American_Datum_1927"] = "NAD27";
-	wktToTeDatum["North_American_Datum_1983"] = "NAD83";
-	wktToTeDatum["South_American_Datum_1969"] = "SAD69";
-	wktToTeDatum["Unknown"] = "Spherical";
-	wktToTeDatum["WGS_1984"] = "WGS84";
-	wktToTeDatum["Aratu"] = "Aratu";
-
-	// lets try OGC's SFS WKT format 
-	it = wktToTeDatum.find(tokens[i]);
-	if (it != wktToTeDatum.end())
-	{
-		dat = TeDatumFactory::make(it->second);
-		return dat;
-	}
-
-	// lets try EPSG authority codes 
-	unsigned int is = i;
-	while (i<tokens.size() && tokens[i] != "AUTHORITY")
-		++i;
-	if (i== tokens.size())
-		return dat;
-	++i;
-	if (tokens[i]=="EPSG")
-	{
-		++i;
-		dat = TeDatumFactory::makeFromEPSGCode(tokens[i]);
-		return dat;
-	}
-
-	// so let's try according to the parameters
-	i = is;	
-	dat.name(tokens[i]);
-	while (i<tokens.size() && tokens[i] != "SPHEROID")
-		++i;
-	if (i== tokens.size())
-		return dat;
-	++i; ++i;
-	dat.radius(atof(tokens[i].c_str()));
-	++i;
-	dat.flattening(1/atof(tokens[i].c_str()));
-	++i;
-	if (tokens[i] == "TOWGS84" && i<tokens.size())
-	{
-		++i;
-		double dx = (atof(tokens[i].c_str()));
-		++i;
-		double dy = (atof(tokens[i].c_str()));
-		++i;
-		double dz = (atof(tokens[i].c_str()));
-		++i;
-		++i;
-		++i;
-		++i;
-		if ( dx==0.0 && dy== 0 && dz == 0.0)
-		{
-			dat = TeDatum("WGS84",6378137,0.003352811,66.87,-4.37,38.52);
-		}
-		// this is a SAD69
-		else if (dx == -66.87 && dy == 4.37 && dz == -38.52)
-		{
-			dat = TeDatum("SAD69",6378160,0.003352892,0.0,0.0,0.0);
-		}
-		else
-		{
-			dat.dx_ = dx;
-			dat.dy_ = dy;
-			dat.dz_ = dz;
-		}
-	}
-	return dat;
-}
-
-
-bool findDatum(double semiMajor, double flatenning, TeDatum& datum)
-{
-	DatumMap datumMap_;
-
-	// Step 1 - Read the Spheroids - Put in a Map
-
-	SphMap sphMap;
-	SphParam sphPar;
-
-	int i, k = 0;
-
-	for ( i = 0; i < NUMSPH; i++ )
-	{
-		string name = ellipsoidList [k++];
-		sphPar.rd  = atof ( ellipsoidList [k++] );
-		sphPar.flt = atof ( ellipsoidList [k++] );
-
-		sphMap [ name ] = sphPar;
-	}
-	
-	// Step 2 - Read the Datum List, create a Map
-	k = 0;
-
-	for ( i = 0; i < NUMDATUM; i++ )
-	{
-		string name = datumList [k++];
-		string sphname = datumList [ k++];
-		double 	dx  = atof ( datumList [k++] );
-		double  dy  = atof ( datumList [k++] );
-		double  dz  = atof ( datumList [k++] );
-
-		SphMap::iterator it = sphMap.find ( sphname );
-			
-		if ( it == sphMap.end() )
-		{
-			throw TeException ( DATUM_ERROR );
-		}
-		else 
-			sphPar = (*it).second;
-		TeDatum dat ( name, sphPar.rd, sphPar.flt, dx, dy, dz );
-		datumMap_ [ name ] = dat; // create a datum map
-	}
-
-	DatumMap::iterator it = datumMap_.begin();
-	while (it != datumMap_.end())
-	{
-		TeDatum dt = (*it).second;
-		if ( TeCompareDouble(dt.radius(),semiMajor,6) &&
-			 TeCompareDouble(dt.flattening(),flatenning,6))
-		{
-
-			datum = dt;
-			return true;
-		}
-		++it;
-	}
-	return false;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include <cstring>
+#include <cstdlib>
+#include <map>
+
+using namespace std;
+
+#include "TeDatum.h"
+#include "TeException.h"
+#include "TeUtils.h"
+
+const int NUMDATUM = 11; // number of datum
+const int NUMSPH   = 10; // number of ellipsoids
+
+bool tokenizeWKT(char** wkt, vector<string>& tokens);
+
+struct SphParam 
+{
+	double rd;
+	double flt;
+};
+
+typedef map<string, SphParam> SphMap;
+
+// Spheroid       Radius(Semi Major Axis)        Flattening
+const char* ellipsoidList [] = 
+{ 
+"Airy",	       "6.3775634e+06", "3.340906e-03",	  
+"Clarke-1866", "6.378206e+06",	"3.390060e-03",	 
+"EarthRadius", "6.371000e+06",	"0.000000e+00",
+"Everest",     "6.3772763e+06", "3.324468e-03",
+"GRS80",       "6.378137e+06",  "3.352811e-03",
+"Hayford", 	   "6.378388e+06",  "3.367003e-03", 	 
+"UGGI67", 	   "6.378160e+06",	"3.352892e-03",	 
+"WGS84",	   "6.378137e+06",	"3.352811e-03",
+"WGS84/Spherical",	   "6.378137e+06",	"0.000000e+00",
+"SIRGAS2000",	   "6.3781370e+06",	"3.35281068e-03"
+};
+
+
+
+// DatumName    Spheroid        Shift_X           Shift_Y           Shift_Z
+
+const char* datumList [] = 
+{ 
+"Astro-Chua",   "Hayford",      "-7.700000e+01",  "2.390000e+02",  "5.000000e+00",
+"CorregoAlegre","Hayford",	    "-1.387000e+02",  "1.644000e+02",  "3.440000e+01",
+"Indian",	    "Everest",	    "0.000000e+00",   "0.000000e+00",  "0.000000e+00",
+"NAD27",	    "Clarke-1866",	"0.000000e+00",   "0.000000e+00",  "0.000000e+00",
+"NAD83",	    "GRS80",	    "0.000000e+00",   "0.000000e+00",  "0.000000e+00",
+"SAD69", 	    "UGGI67",       "0.000000e+00",   "0.000000e+00",  "0.000000e+00",
+"Spherical",	"EarthRadius",  "0.000000e+00",   "0.000000e+00",  "0.000000e+00",
+"WGS84",	    "WGS84",	    "6.687000e+01",   "-4.370000e+00", "3.852000e+01",
+"Aratu",	    "Hayford",	    "-7.81300e+01",   "2.9163000e+02", "-1.08480e+02",
+"WGS84/Spherical",	    "WGS84/Spherical",	    "6.687000e+01",   "-4.370000e+00", "3.852000e+01",
+"SIRGAS2000",	    "SIRGAS2000",	    "6.687000e+01",   "-4.370000e+00", "3.852000e+01"
+};
+
+const char** TeGetDatumList()
+{
+	return datumList;
+}
+
+
+typedef map<string, TeDatum> DatumMap;
+
+
+TeDatum::TeDatum(const TeDatum& other)
+{
+	name_ = other.name_;
+	rd_ = other.rd_ ;
+	flt_= other.flt_;
+	dx_ = other.dx_;
+	dy_= other.dy_;
+	dz_ = other.dz_;
+}
+
+TeDatum&
+TeDatum::operator=(const TeDatum& rhs)
+{
+	if ( this != &rhs )
+	{
+		name_ = rhs.name_;
+		rd_ = rhs.rd_;
+		flt_= rhs.flt_;
+		dx_ = rhs.dx_;
+		dy_= rhs.dy_;
+		dz_ = rhs.dz_;
+	}
+	return *this;
+}
+
+string
+TeDatum::getProj4Description()
+{
+	double shiftX, shiftY,shiftZ;
+	shiftX = shiftY = shiftZ = 0.0;
+
+	string datumProj4 = "";
+	if (name_ == "WGS84")
+	{
+		datumProj4 += " +ellps=WGS84";
+		return datumProj4;
+	}
+	else if (name_ == "Spherical")
+	{
+		datumProj4 += " +R="  + Te2String(rd_,6);
+	}
+	else if (name_ == "SAD69")
+	{
+		shiftX = -66.87;
+		shiftY = 4.37;
+		shiftZ = -38.52;
+
+		datumProj4 += " +ellps=GRS67";
+	}
+	else if (name_ == "CorregoAlegre")
+	{
+		shiftX = -205.57;
+		shiftY = 168.77;
+		shiftZ = -4.12;
+		datumProj4 += " +ellps=intl";
+	}
+	else
+	{
+		datumProj4 += " +a="  + Te2String(rd_,6);
+		datumProj4 += " +f="  + Te2String(flt_,6);
+	}
+
+	if (shiftX != 0.0 && shiftY != 0.0 && shiftZ != 0.0)
+		datumProj4 += " +towgs84=" + Te2String(shiftX,4) + "," +  Te2String(shiftY,4)+ "," +  Te2String(shiftZ,4);
+	return datumProj4;
+}
+
+string
+TeDatum::getWKTDescription()
+{
+	string sph_epsgcode = "";
+	string dtm_epsgcode = "";
+	string spheroid = "";
+	string crs_epsgcode = "";
+	string datumWKT = "GEOGCS[\"" + name_ + "\"," + "DATUM[\"" + name_ + "\", SPHEROID[\"";
+	if (name_ == "Astro-Chua")
+	{
+		spheroid = "Hayford";
+		sph_epsgcode = "7022";
+		dtm_epsgcode = "6224";
+		crs_epsgcode = "4224";
+	}
+	else if (name_ == "CorregoAlegre")
+	{
+		spheroid = "Hayford";
+		sph_epsgcode = "7022";
+		dtm_epsgcode = "6225";
+		crs_epsgcode = "4225";
+	}
+	else if (name_ == "Indian")
+	{
+		spheroid = "Everest";
+		sph_epsgcode = "7015";
+		dtm_epsgcode = "6239";
+		crs_epsgcode = "4240";
+	}
+	else if (name_ == "NAD27")
+	{
+		spheroid = "Clarke 1866";
+		sph_epsgcode = "7008";
+		dtm_epsgcode = "6609";
+		crs_epsgcode = "4267";
+	}
+	else if (name_ == "NAD83")
+	{
+		spheroid = "GRS80";
+		sph_epsgcode = "7019";
+		dtm_epsgcode = "6326";
+		crs_epsgcode = "4269";
+	}
+	else if (name_ == "WGS84")
+	{
+		spheroid = "GRS80";
+		sph_epsgcode = "7019";
+		dtm_epsgcode = "6326";
+		crs_epsgcode = "4326";
+	}
+	else if (name_ == "SAD69")
+	{
+		spheroid = "UGGI67";
+		sph_epsgcode = "7036";
+		dtm_epsgcode = "6291";
+		crs_epsgcode = "4618";
+	}
+	else if (name_ == "Spherical")
+	{
+		spheroid = "EarthRadius";
+		sph_epsgcode = "7035";
+	}
+	else
+		spheroid = "UserDefined";
+	datumWKT += spheroid + "\"," + Te2String(rd_,6) + ", " + Te2String(1.0/flt_,6);
+	if (!sph_epsgcode.empty())
+		datumWKT +=",AUTHORITY[\"EPSG\"," + sph_epsgcode + "]";
+	datumWKT += "]";
+	double shiftX, shiftY, shiftZ;
+	shiftX = shiftY = shiftZ = 0.0;
+	if (name_ == "SAD69")
+	{
+		shiftX = -66.87;
+		shiftY = 4.37;
+		shiftZ = -38.52;
+	}
+	else if (name_ == "CorregoAlegre")
+	{
+		shiftX = -205.57;
+		shiftY = 168.77;
+		shiftZ = -4.12;
+	}
+	if (shiftX != 0.0 && shiftY != 0.0 && shiftZ != 0.0)
+		datumWKT += ",TOWGS84[" + Te2String(shiftX,4) + "," + Te2String(shiftY,4) + "," + Te2String(shiftZ,4) + ",0.0,0.0,0.0,0.0]";
+
+	if (!dtm_epsgcode.empty())
+		datumWKT += ",AUTHORITY[\"EPSG\"," + dtm_epsgcode + "]";
+	datumWKT += "]";
+	if (!crs_epsgcode.empty())
+		datumWKT += ",AUTHORITY[\"EPSG\"," + crs_epsgcode + "]";
+	datumWKT += "]";
+	return datumWKT;
+}
+
+TeDatum
+TeDatumFactory::make( const string& name )
+{
+
+	DatumMap datumMap_;
+	// Step 1 - Read the Spheroids - Put in a Map
+
+	SphMap sphMap;
+
+	SphParam sphPar;
+
+	int i, k = 0;
+
+	for ( i = 0; i < NUMSPH; i++ )
+	{
+		string name = ellipsoidList [k++];
+		sphPar.rd  = atof ( ellipsoidList [k++] );
+		sphPar.flt = atof ( ellipsoidList [k++] );
+
+		sphMap [ name ] = sphPar;
+	}
+	
+	// Step 2 - Read the Datum List, create a Map
+
+
+	k = 0;
+
+	for ( i = 0; i < NUMDATUM; i++ )
+	{
+			string name = datumList [k++];
+			
+			string sphname = datumList [ k++];
+
+			double 	dx  = atof ( datumList [k++] );
+			double  dy  = atof ( datumList [k++] );
+			double  dz  = atof ( datumList [k++] );
+
+			SphMap::iterator it = sphMap.find ( sphname );
+			
+			if ( it == sphMap.end() )
+			{
+				throw TeException ( DATUM_ERROR );
+			}
+			else 
+				sphPar = (*it).second;
+
+			TeDatum dat ( name, sphPar.rd, sphPar.flt, dx, dy, dz );
+
+			datumMap_ [ name ] = dat; // create a datum map
+	}
+
+	DatumMap::iterator it = datumMap_.find ( name );
+
+	if ( it != datumMap_.end() ) // found it
+		return (*it).second;
+
+	return TeDatum ("Spherical");
+}
+
+TeDatum 
+TeDatumFactory::makeFromEPSGCode(const std::string epsgCode)
+{
+	string dname;
+	if (epsgCode == "6224")
+	{
+		dname = "Astro-Chua";
+	}
+	else if (epsgCode == "6225")
+	{
+		dname = "CorregoAlegre";
+	}
+	else if (epsgCode == "6240")
+	{
+		dname = "Indian";
+	}
+	else if (epsgCode == "6609")
+	{
+		dname = "NAD27";
+	}
+	else if (epsgCode == "6152")
+	{
+		dname = "NAD83";
+	}
+	else if (epsgCode == "6326")
+	{
+		dname = "WGS84";
+	}
+	else if (epsgCode == "6618")
+	{
+		dname = "SAD69";
+	}
+	else if (epsgCode == "6208")
+	{
+		dname = "Aratu";
+	}
+	else 
+	{
+		dname = "Spherical";
+	}
+	TeDatum dat = TeDatumFactory::make(dname);
+	return dat;
+}
+
+
+TeDatum 
+TeDatumFactory::makeFromWKT(const std::string wktDatumDescription)
+{
+	TeDatum dat;
+	vector<string> tokens;
+	char* wktchar = new char[wktDatumDescription.size()];
+	strcpy(wktchar,wktDatumDescription.c_str());
+	if (!tokenizeWKT((char **) &wktchar, tokens))
+	{
+		return dat;
+	}
+	unsigned int i =0;
+	while (i<tokens.size() && tokens[i] != "DATUM")
+		++i;
+
+	if (i== tokens.size())
+		return dat;
+	++i;
+
+	map<string,string> ewktToTeDatum;
+	ewktToTeDatum["D_Chua"] = "Astro-Chua";
+	ewktToTeDatum["D_Corrego_Alegre"] = "CorregoAlegre";
+	ewktToTeDatum["D_Indian_1975"] = "Indian";
+	ewktToTeDatum["D_North_American_1927"] = "NAD27";
+	ewktToTeDatum["D_North_American_1983"] = "NAD83";
+	ewktToTeDatum["D_South_American_1969"] = "SAD69";
+	ewktToTeDatum["D_WGS_1984"] = "WGS84";
+	ewktToTeDatum["D_Aratu"] = "Aratu";
+	// lets the ESRI's WKT format 
+	TeTrim(tokens[i]);
+	map<string,string>::iterator it = ewktToTeDatum.find(tokens[i]);
+	if (it != ewktToTeDatum.end())
+	{
+		dat = TeDatumFactory::make(it->second);
+		return dat;
+	}
+
+	map<string,string> wktToTeDatum;
+	wktToTeDatum["Chua"] = "Astro-Chua";
+	wktToTeDatum["Corrego_Alegre"] = "CorregoAlegre";
+	wktToTeDatum["Indian_1975"] = "Indian";
+	wktToTeDatum["North_American_Datum_1927"] = "NAD27";
+	wktToTeDatum["North_American_Datum_1983"] = "NAD83";
+	wktToTeDatum["South_American_Datum_1969"] = "SAD69";
+	wktToTeDatum["Unknown"] = "Spherical";
+	wktToTeDatum["WGS_1984"] = "WGS84";
+	wktToTeDatum["Aratu"] = "Aratu";
+
+	// lets try OGC's SFS WKT format 
+	it = wktToTeDatum.find(tokens[i]);
+	if (it != wktToTeDatum.end())
+	{
+		dat = TeDatumFactory::make(it->second);
+		return dat;
+	}
+
+	// lets try EPSG authority codes 
+	unsigned int is = i;
+	while (i<tokens.size() && tokens[i] != "AUTHORITY")
+		++i;
+	if (i== tokens.size())
+		return dat;
+	++i;
+	if (tokens[i]=="EPSG")
+	{
+		++i;
+		dat = TeDatumFactory::makeFromEPSGCode(tokens[i]);
+		return dat;
+	}
+
+	// so let's try according to the parameters
+	i = is;	
+	dat.name(tokens[i]);
+	while (i<tokens.size() && tokens[i] != "SPHEROID")
+		++i;
+	if (i== tokens.size())
+		return dat;
+	++i; ++i;
+	dat.radius(atof(tokens[i].c_str()));
+	++i;
+	dat.flattening(1/atof(tokens[i].c_str()));
+	++i;
+	if (tokens[i] == "TOWGS84" && i<tokens.size())
+	{
+		++i;
+		double dx = (atof(tokens[i].c_str()));
+		++i;
+		double dy = (atof(tokens[i].c_str()));
+		++i;
+		double dz = (atof(tokens[i].c_str()));
+		++i;
+		++i;
+		++i;
+		++i;
+		if ( dx==0.0 && dy== 0 && dz == 0.0)
+		{
+			dat = TeDatum("WGS84",6378137,0.003352811,66.87,-4.37,38.52);
+		}
+		// this is a SAD69
+		else if (dx == -66.87 && dy == 4.37 && dz == -38.52)
+		{
+			dat = TeDatum("SAD69",6378160,0.003352892,0.0,0.0,0.0);
+		}
+		else
+		{
+			dat.dx_ = dx;
+			dat.dy_ = dy;
+			dat.dz_ = dz;
+		}
+	}
+	return dat;
+}
+
+
+bool findDatum(double semiMajor, double flatenning, TeDatum& datum)
+{
+	DatumMap datumMap_;
+
+	// Step 1 - Read the Spheroids - Put in a Map
+
+	SphMap sphMap;
+	SphParam sphPar;
+
+	int i, k = 0;
+
+	for ( i = 0; i < NUMSPH; i++ )
+	{
+		string name = ellipsoidList [k++];
+		sphPar.rd  = atof ( ellipsoidList [k++] );
+		sphPar.flt = atof ( ellipsoidList [k++] );
+
+		sphMap [ name ] = sphPar;
+	}
+	
+	// Step 2 - Read the Datum List, create a Map
+	k = 0;
+
+	for ( i = 0; i < NUMDATUM; i++ )
+	{
+		string name = datumList [k++];
+		string sphname = datumList [ k++];
+		double 	dx  = atof ( datumList [k++] );
+		double  dy  = atof ( datumList [k++] );
+		double  dz  = atof ( datumList [k++] );
+
+		SphMap::iterator it = sphMap.find ( sphname );
+			
+		if ( it == sphMap.end() )
+		{
+			throw TeException ( DATUM_ERROR );
+		}
+		else 
+			sphPar = (*it).second;
+		TeDatum dat ( name, sphPar.rd, sphPar.flt, dx, dy, dz );
+		datumMap_ [ name ] = dat; // create a datum map
+	}
+
+	DatumMap::iterator it = datumMap_.begin();
+	while (it != datumMap_.end())
+	{
+		TeDatum dt = (*it).second;
+		if ( TeCompareDouble(dt.radius(),semiMajor,6) &&
+			 TeCompareDouble(dt.flattening(),flatenning,6))
+		{
+
+			datum = dt;
+			return true;
+		}
+		++it;
+	}
+	return false;
+}
diff --git a/src/terralib/kernel/TeDatum.h b/src/terralib/kernel/TeDatum.h
old mode 100755
new mode 100644
index 06768ea..a540353
--- a/src/terralib/kernel/TeDatum.h
+++ b/src/terralib/kernel/TeDatum.h
@@ -1,161 +1,161 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDatum.h
-    \brief This file contains structures and definitions to support the concept of a planimetric datum
-*/
-
-#ifndef  __TERRALIB_INTERNAL_DATUM_H
-#define  __TERRALIB_INTERNAL_DATUM_H
-
-#include <string>
-#include "TeUtils.h"
-
-//! Number of supported datum in TerraLib
-const int NUM_DATUM = 9; 
-
-TL_DLL const char** TeGetDatumList();
-
-
-//! Implements valid Datum options and related parameters which account for different earth spheroids.
-/*! Specifies planimetric TeDatum parameters to be used for defining geodetic
-	coordinates, which are necessary to establish a map projection system.
-	It encapsulates the following important information regarding 
-	a planimetric Datum such as:
-	\li	Datum name;
-	\li	Earth equatorial radius;
-	\li	Earth flatenning;
-	\li	Datum shifts. 
-
-	\author
-	 Ubirajara Freitas, Julio d'Alge.
-
-	\sa TeDatumFactory
-*/
-class TL_DLL TeDatum
-{
-private:
-	std::string	name_;		//!< Planimetric TeDatum name
-	double	rd_,		//!< Earth equatorial radius (m) 
-			flt_;		//!< Earth flattening 
-public:
-	double	dx_,		//!< TeDatum shift along x axis (m)
-			dy_,		//!< TeDatum shift along y axis (m)
-			dz_;		//!< TeDatum shift along z axis (m) 
-
-	//!	Constructor.
-	TeDatum ( std::string name = "Spherical", double rd = 6.371000e+06 , double flt = 0., 
-			  double dx = 0., double dy= 0., double dz = 0.):
-	name_ ( name ),
-	rd_   (  rd  ),
-	flt_  ( flt  ),
-	dx_   (  dx  ),
-	dy_   (  dy  ),
-	dz_   (  dz  )
-	{ }
-
-	//! Copy constructor
-	TeDatum(const TeDatum& other);
-
-	//! Operator =
-	TeDatum& operator=(const TeDatum& rhs);
-
-	//!	Destructor.
-	~TeDatum () {}
-
-	//! Returns the datum name
-	std::string 	name()	 const			
-	{ return name_;} 
-
-	//! Sets the datum name
-	void name(const std::string& name)	 			
-	{	name_ = name;	} 
-
-	//! Returns Earth equatorial radius (m)
-	double radius() const
-	{ return rd_; }
-
-	//! Sets Earth equatorial radius (m)
-	void radius(const double rd) 
-	{ rd_ = rd; }
-
-	//! Returns the Earth equatorial radius (m) (m)
-	double flattening() const
-	{ return flt_; }
-
-	//! Sets the Earth equatorial radius (m) (m)
-	void flattening(const double flt) 
-	{ flt_ = flt; }
-
-	//! Returns the shift along x axis (m)
-	double	xShift() const
-	{ return dx_; }
- 
-	//! Returns the shift along y axis (m)
-	double  yShift() const 
-	{ return dy_; }
-
-	//! Returns the shift along z axis (m)
-	double zShift()  const
-	{ return dz_; }
-
-
-//!		Verifies if current TeDatum is equal to TeDatum& dat. 
-	bool operator== (const TeDatum& dat) const 
-	{
-		return (TeFPEquals(rd_,dat.rd_,0.0000000001) 
-			   && TeFPEquals(flt_,dat.flt_,0.0000000001)
-			   && TeFPEquals(dx_,dat.dx_,0.0000000001) 
-			   && TeFPEquals(dy_,dat.dy_,0.0000000001) 
-			   && TeFPEquals(dz_,dat.dz_,0.0000000001)); 
-	}
-
-	//! Returns the Datum description in PROJ4 format
-	string getProj4Description();
-
-	//! Returns the Datum description in WKT format
-	string getWKTDescription();
-
-};
-
-//! Produces a Datum accordingly to an specified name
-class TL_DLL TeDatumFactory
-{
-public:
-	//! Builds a datum from a TerraLib name
-	static	TeDatum make ( const std::string& name );
-
-	//! Builds a datum from its EPSG code
-	static TeDatum makeFromEPSGCode(const std::string epsgCode);
-
-	//! Builds a datum from its OGC's WKT description
-	static TeDatum makeFromWKT(const std::string wktDatumDescription);
-};
-
-/*! 
-   \fn   findDatum(double semiMajor, double flatenning, TeDatum& datum)
-   \brief Tries to find the a TeDatum according to givem semi major axis and earth flattening
- */
-TL_DLL bool findDatum(double semiMajor, double flatenning, TeDatum& datum);
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDatum.h
+    \brief This file contains structures and definitions to support the concept of a planimetric datum
+*/
+
+#ifndef  __TERRALIB_INTERNAL_DATUM_H
+#define  __TERRALIB_INTERNAL_DATUM_H
+
+#include <string>
+#include "TeUtils.h"
+
+//! Number of supported datum in TerraLib
+const int NUM_DATUM = 11; 
+
+TL_DLL const char** TeGetDatumList();
+
+
+//! Implements valid Datum options and related parameters which account for different earth spheroids.
+/*! Specifies planimetric TeDatum parameters to be used for defining geodetic
+	coordinates, which are necessary to establish a map projection system.
+	It encapsulates the following important information regarding 
+	a planimetric Datum such as:
+	\li	Datum name;
+	\li	Earth equatorial radius;
+	\li	Earth flatenning;
+	\li	Datum shifts. 
+
+	\author
+	 Ubirajara Freitas, Julio d'Alge.
+
+	\sa TeDatumFactory
+*/
+class TL_DLL TeDatum
+{
+private:
+	std::string	name_;		//!< Planimetric TeDatum name
+	double	rd_,		//!< Earth equatorial radius (m) 
+			flt_;		//!< Earth flattening 
+public:
+	double	dx_,		//!< TeDatum shift along x axis (m)
+			dy_,		//!< TeDatum shift along y axis (m)
+			dz_;		//!< TeDatum shift along z axis (m) 
+
+	//!	Constructor.
+	TeDatum ( std::string name = "Spherical", double rd = 6.371000e+06 , double flt = 0., 
+			  double dx = 0., double dy= 0., double dz = 0.):
+	name_ ( name ),
+	rd_   (  rd  ),
+	flt_  ( flt  ),
+	dx_   (  dx  ),
+	dy_   (  dy  ),
+	dz_   (  dz  )
+	{ }
+
+	//! Copy constructor
+	TeDatum(const TeDatum& other);
+
+	//! Operator =
+	TeDatum& operator=(const TeDatum& rhs);
+
+	//!	Destructor.
+	~TeDatum () {}
+
+	//! Returns the datum name
+	std::string 	name()	 const			
+	{ return name_;} 
+
+	//! Sets the datum name
+	void name(const std::string& name)	 			
+	{	name_ = name;	} 
+
+	//! Returns Earth equatorial radius (m)
+	double radius() const
+	{ return rd_; }
+
+	//! Sets Earth equatorial radius (m)
+	void radius(const double rd) 
+	{ rd_ = rd; }
+
+	//! Returns the Earth equatorial radius (m) (m)
+	double flattening() const
+	{ return flt_; }
+
+	//! Sets the Earth equatorial radius (m) (m)
+	void flattening(const double flt) 
+	{ flt_ = flt; }
+
+	//! Returns the shift along x axis (m)
+	double	xShift() const
+	{ return dx_; }
+ 
+	//! Returns the shift along y axis (m)
+	double  yShift() const 
+	{ return dy_; }
+
+	//! Returns the shift along z axis (m)
+	double zShift()  const
+	{ return dz_; }
+
+
+//!		Verifies if current TeDatum is equal to TeDatum& dat. 
+	bool operator== (const TeDatum& dat) const 
+	{
+		return (TeFPEquals(rd_,dat.rd_,0.0000000001) 
+			   && TeFPEquals(flt_,dat.flt_,0.0000000001)
+			   && TeFPEquals(dx_,dat.dx_,0.0000000001) 
+			   && TeFPEquals(dy_,dat.dy_,0.0000000001) 
+			   && TeFPEquals(dz_,dat.dz_,0.0000000001)); 
+	}
+
+	//! Returns the Datum description in PROJ4 format
+	string getProj4Description();
+
+	//! Returns the Datum description in WKT format
+	string getWKTDescription();
+
+};
+
+//! Produces a Datum accordingly to an specified name
+class TL_DLL TeDatumFactory
+{
+public:
+	//! Builds a datum from a TerraLib name
+	static	TeDatum make ( const std::string& name );
+
+	//! Builds a datum from its EPSG code
+	static TeDatum makeFromEPSGCode(const std::string epsgCode);
+
+	//! Builds a datum from its OGC's WKT description
+	static TeDatum makeFromWKT(const std::string wktDatumDescription);
+};
+
+/*! 
+   \fn   findDatum(double semiMajor, double flatenning, TeDatum& datum)
+   \brief Tries to find the a TeDatum according to givem semi major axis and earth flattening
+ */
+TL_DLL bool findDatum(double semiMajor, double flatenning, TeDatum& datum);
+
+#endif
+
diff --git a/src/terralib/kernel/TeDecoder.h b/src/terralib/kernel/TeDecoder.h
old mode 100755
new mode 100644
index c9cf8af..adbc206
--- a/src/terralib/kernel/TeDecoder.h
+++ b/src/terralib/kernel/TeDecoder.h
@@ -1,214 +1,214 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2005 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoder.h
-    \brief This file deals with decoding of raster structures 
-*/
-#ifndef  __TERRALIB_INTERNAL_DECODER_H
-#define  __TERRALIB_INTERNAL_DECODER_H
-
-#include "TeDefines.h"
-#include "TeFactory.h"
-#include "TeCoord2D.h"
-#include "TeRasterParams.h"
-
-using namespace std;
-#include <string>
-#include <list>
-#include <map>
-
-class TeRaster;
-class TeDecoderMemory;
-class TeProjection;
-struct TeBox;
-
-//! An abstract class to decode raster data 
-/* 
-	A decoder keeps its own copy of the  parameters associated
-	to the raster being decoded.
-*/
-class TL_DLL TeDecoder {
-
-public:
-	//! Empty constructor
-	TeDecoder() {}
-
-	//! Constructor from  raster parameters
-	/*!
-		\param par raster parameters
-	*/
-	TeDecoder(const TeRasterParams& par) : params_(par) {}
-
-	//! Virtual destructor 
-	virtual ~TeDecoder() {}	
-
-	//! Returns the raster parameters
-	TeRasterParams& params()
-		{ return params_; }
-
-	//! Updates the raster parameters
-	void updateParams(TeRasterParams& par)
-	{	params_ = par; }
-
-	//! Sets the value of a specific raster element 
-	/*!
-		\param col	element column identifier
-		\param lin	element line identifier
-		\param val	element value being inserted
-		\param band element band identifier
-	*/
-	virtual bool setElement(int col, int lin, double val, int band=0 ) = 0;
-
-	//! An optimizated method to set values raster images
-	/*
-		This method should be used only to set the values of images with 3 bands associated
-		to the three colour channes: RGB
-		\param col column of the image
-		\param lin line of the image
-		\param Rval the value associated to the band 0 (associated to the R colour Channel)
-		\param Gval the value associated to the band 1 (associated to the G colour Channel)
-		\param Bval the value associated to the band 2 (associated to the B colour Channel)
-		\param transp an optional transparency degree, with a range of 0 (totally transparent) to 255 (totally opaque)
-		\return true if if succeed and false otherwise
-	*/
-	virtual bool setElementRGB(int col, int lin, double Rval, double Gval, double Bval, unsigned int /*transp*/ = 255)
-	{
-		if (!setElement(col,lin,Rval,0))
-			return false;
-		if (!setElement(col,lin,Gval,1))
-			return false;		
-		if (!setElement(col,lin,Bval,2))
-			return false;
-		return true;
-	}
-
-	//! Gets an specific element (col, lin, band) of a raster data
-	/*!
-		\param col	element column identifier
-		\param lin	element line identifier
-		\param val	element value being retrieved
-		\param band element band identifier
-	*/
-	virtual bool getElement(int col, int lin, double& val, int band=0 ) = 0;
-
-	//! Transforms a geographical coordinate to an index (lin, col) coordinate
-	virtual TeCoord2D coord2Index (const TeCoord2D &pt)
-	{	return params_.coord2Index(pt);	}
-
-	//! Transforms an index (lin, col) coordinate to a geographical coordinate
-	virtual TeCoord2D index2Coord (const TeCoord2D &pt)
-	{	return params_.index2Coord(pt);	}
-
-	//! Initializes the internal structures of the decoder from a raster parameters structure
-	/*  
-	    \param par the raster parameters structure
-	*/
-	virtual void init( TeRasterParams& par ) 
-	{ params_= par; init();}
-
-	//! Initializes the internal structures of the decoder
-	virtual void init() = 0;
-
-	//! Clears its internal structures
-	virtual bool clear() = 0;
-
-	//! Returns a default object - for compatibility reasons with TeDecoderFactory
-	static TeDecoder* DefaultObject( const TeRasterParams& /* par */) 
-	{ return 0; }
-
-/** @name Selection
-  These routines are used to implement a selection of blocks or tiles 
-  that intercept a given bounding box, and provide sequential access to them.
-  These routines should be implemented by concrete decoders to formats that support tilling.
-*/
-//@{ 
-	//! Returns TRUE if it there are raster blocks that intersect a given box
-	/*
-		\param bb		box	that represents the interest region
-		\param resFac	resolution factor
-		\param parBlock to return the common parameters of the blocks that are selected
-		\returns TRUE if could select at least one block and FALSE otherwise
-	*/
-	virtual bool selectBlocks(TeBox& /* bb */, int /* resFac */, TeRasterParams& /*parBlock*/)  
-	{ return false; }
-
-	//! Returns the number of blocks selected in the last block selection
-	virtual int numberOfSelectedBlocks()
-	{	return 0; }	
-	
-	//! Gets a decoder to the current selected block
-	virtual bool getSelectedRasterBlock(TeDecoderMemory* /* memDec */) 
-	{ return false; }
-
-	//! Clear a previous block selection
-	virtual void clearBlockSelection() {}
-
-	//! Returns the raster best resolution level available to fill a given bounding box with a given number of lines and columns in a given projection
-	/*
-		\param bb		box that represents the interest region
-		\param ncols	number of columns in the box
-		\param nlines	number of lines in the box
-		\param proj		pointer to the projection of the box
-	*/
-	virtual int bestResolution(TeBox& /*bb*/, int /*ncols*/, int /*nlines*/, TeProjection* /*proj*/)
-	{	return 1; }
-
-	//! Returns the raster resolution level available that is more similiar to a given desired resolution
-	virtual int bestResolution(double /*res*/)
-	{	return 1; }
-
-
-//@}
-
-protected:
-
-//! The parameters that describes a raster data
-	TeRasterParams  params_;	
-};
-
-//! A decoder abstract factory
-/*! 
-	Implements an abstract factory that builds appropriate decoders
-	according to a string identifier.
-*/
-class TL_DLL TeDecoderFactory: public TeFactory<TeDecoder,TeRasterParams> 
-{
-public:
-
-	//! Maps synonyms to decoders identifiers (example "TIFF" or "tif" to a decoder to TIFF format)
-	typedef map<string,string> TeNames2Decoders;
-
-	//! Unique instance instance of map from synonyms to decoder identifiers
-	static TeNames2Decoders& instanceName2Dec ()
-	{ 
-		static TeNames2Decoders names2dec_;
-		return names2dec_;
-	}
-
-	//! Builds an appropriate decoder from a identifier
-	TeDecoderFactory(const string& name) : TeFactory<TeDecoder,TeRasterParams>(name) { }
-
-	//! Virtual destructor
-	virtual ~TeDecoderFactory() {}
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2005 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoder.h
+    \brief This file deals with decoding of raster structures 
+*/
+#ifndef  __TERRALIB_INTERNAL_DECODER_H
+#define  __TERRALIB_INTERNAL_DECODER_H
+
+#include "TeDefines.h"
+#include "TeFactory.h"
+#include "TeCoord2D.h"
+#include "TeRasterParams.h"
+
+using namespace std;
+#include <string>
+#include <list>
+#include <map>
+
+class TeRaster;
+class TeDecoderMemory;
+class TeProjection;
+struct TeBox;
+
+//! An abstract class to decode raster data 
+/* 
+	A decoder keeps its own copy of the  parameters associated
+	to the raster being decoded.
+*/
+class TL_DLL TeDecoder {
+
+public:
+	//! Empty constructor
+	TeDecoder() {}
+
+	//! Constructor from  raster parameters
+	/*!
+		\param par raster parameters
+	*/
+	TeDecoder(const TeRasterParams& par) : params_(par) {}
+
+	//! Virtual destructor 
+	virtual ~TeDecoder() {}	
+
+	//! Returns the raster parameters
+	TeRasterParams& params()
+		{ return params_; }
+
+	//! Updates the raster parameters
+	void updateParams(TeRasterParams& par)
+	{	params_ = par; }
+
+	//! Sets the value of a specific raster element 
+	/*!
+		\param col	element column identifier
+		\param lin	element line identifier
+		\param val	element value being inserted
+		\param band element band identifier
+	*/
+	virtual bool setElement(int col, int lin, double val, int band=0 ) = 0;
+
+	//! An optimizated method to set values raster images
+	/*
+		This method should be used only to set the values of images with 3 bands associated
+		to the three colour channes: RGB
+		\param col column of the image
+		\param lin line of the image
+		\param Rval the value associated to the band 0 (associated to the R colour Channel)
+		\param Gval the value associated to the band 1 (associated to the G colour Channel)
+		\param Bval the value associated to the band 2 (associated to the B colour Channel)
+		\param transp an optional transparency degree, with a range of 0 (totally transparent) to 255 (totally opaque)
+		\return true if if succeed and false otherwise
+	*/
+	virtual bool setElementRGB(int col, int lin, double Rval, double Gval, double Bval, unsigned int /*transp*/ = 255)
+	{
+		if (!setElement(col,lin,Rval,0))
+			return false;
+		if (!setElement(col,lin,Gval,1))
+			return false;		
+		if (!setElement(col,lin,Bval,2))
+			return false;
+		return true;
+	}
+
+	//! Gets an specific element (col, lin, band) of a raster data
+	/*!
+		\param col	element column identifier
+		\param lin	element line identifier
+		\param val	element value being retrieved
+		\param band element band identifier
+	*/
+	virtual bool getElement(int col, int lin, double& val, int band=0 ) = 0;
+
+	//! Transforms a geographical coordinate to an index (lin, col) coordinate
+	virtual TeCoord2D coord2Index (const TeCoord2D &pt)
+	{	return params_.coord2Index(pt);	}
+
+	//! Transforms an index (lin, col) coordinate to a geographical coordinate
+	virtual TeCoord2D index2Coord (const TeCoord2D &pt)
+	{	return params_.index2Coord(pt);	}
+
+	//! Initializes the internal structures of the decoder from a raster parameters structure
+	/*  
+	    \param par the raster parameters structure
+	*/
+	virtual void init( TeRasterParams& par ) 
+	{ params_= par; init();}
+
+	//! Initializes the internal structures of the decoder
+	virtual void init() = 0;
+
+	//! Clears its internal structures
+	virtual bool clear() = 0;
+
+	//! Returns a default object - for compatibility reasons with TeDecoderFactory
+	static TeDecoder* DefaultObject( const TeRasterParams& /* par */) 
+	{ return 0; }
+
+/** @name Selection
+  These routines are used to implement a selection of blocks or tiles 
+  that intercept a given bounding box, and provide sequential access to them.
+  These routines should be implemented by concrete decoders to formats that support tilling.
+*/
+//@{ 
+	//! Returns TRUE if it there are raster blocks that intersect a given box
+	/*
+		\param bb		box	that represents the interest region
+		\param resFac	resolution factor
+		\param parBlock to return the common parameters of the blocks that are selected
+		\returns TRUE if could select at least one block and FALSE otherwise
+	*/
+	virtual bool selectBlocks(TeBox& /* bb */, int /* resFac */, TeRasterParams& /*parBlock*/)  
+	{ return false; }
+
+	//! Returns the number of blocks selected in the last block selection
+	virtual int numberOfSelectedBlocks()
+	{	return 0; }	
+	
+	//! Gets a decoder to the current selected block
+	virtual bool getSelectedRasterBlock(TeDecoderMemory* /* memDec */) 
+	{ return false; }
+
+	//! Clear a previous block selection
+	virtual void clearBlockSelection() {}
+
+	//! Returns the raster best resolution level available to fill a given bounding box with a given number of lines and columns in a given projection
+	/*
+		\param bb		box that represents the interest region
+		\param ncols	number of columns in the box
+		\param nlines	number of lines in the box
+		\param proj		pointer to the projection of the box
+	*/
+	virtual int bestResolution(TeBox& /*bb*/, int /*ncols*/, int /*nlines*/, TeProjection* /*proj*/)
+	{	return 1; }
+
+	//! Returns the raster resolution level available that is more similiar to a given desired resolution
+	virtual int bestResolution(double /*res*/)
+	{	return 1; }
+
+
+//@}
+
+protected:
+
+//! The parameters that describes a raster data
+	TeRasterParams  params_;	
+};
+
+//! A decoder abstract factory
+/*! 
+	Implements an abstract factory that builds appropriate decoders
+	according to a string identifier.
+*/
+class TL_DLL TeDecoderFactory: public TeFactory<TeDecoder,TeRasterParams> 
+{
+public:
+
+	//! Maps synonyms to decoders identifiers (example "TIFF" or "tif" to a decoder to TIFF format)
+	typedef map<string,string> TeNames2Decoders;
+
+	//! Unique instance instance of map from synonyms to decoder identifiers
+	static TeNames2Decoders& instanceName2Dec ()
+	{ 
+		static TeNames2Decoders names2dec_;
+		return names2dec_;
+	}
+
+	//! Builds an appropriate decoder from a identifier
+	TeDecoderFactory(const string& name) : TeFactory<TeDecoder,TeRasterParams>(name) { }
+
+	//! Virtual destructor
+	virtual ~TeDecoderFactory() {}
+};
+
+#endif
diff --git a/src/terralib/kernel/TeDecoderASCIIGrid.cpp b/src/terralib/kernel/TeDecoderASCIIGrid.cpp
old mode 100755
new mode 100644
index b0a9bad..584f7c7
--- a/src/terralib/kernel/TeDecoderASCIIGrid.cpp
+++ b/src/terralib/kernel/TeDecoderASCIIGrid.cpp
@@ -1,416 +1,416 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeException.h"
-#include "TeDecoderASCIIGrid.h"
-#include "TeAsciiFile.h"
-#include "TeUtils.h"
-
-#include <cstring>
-#include <fstream>
-using std::ifstream;
-using std::ofstream;
-
-/*
-Expected format for ESRI ASCII GRID Files (Copied from the ArcWorkstation 8.3 Help File):
-
-<NCOLS xxx>
-<NROWS xxx>
-<XLLCENTER xxx | XLLCORNER xxx>
-<YLLCENTER xxx | YLLCORNER xxx>
-<CELLSIZE xxx>
-{NODATA_VALUE xxx}
-row 1
-row 2
-.
-.
-.
-row n
-*/
-
-TeDecoderASCIIGrid::TeDecoderASCIIGrid (const TeRasterParams& par) : 
-	isModified_(false),
-	size_(0),
-	myData_(0)
-{	
-	params_.errorMessage_.clear();
-	if (par.fileName_.empty())
-		return;
-	params_ = par;
-	params_.decoderIdentifier_ = "ASCIIGRID";
-	if (params_.mode_ == 'w' || params_.mode_ == 'r')
-		readParameters();
-}
-
-TeDecoderASCIIGrid::~TeDecoderASCIIGrid ()
-{
-	if ( isModified_ && (params_.mode_ == 'w' || params_.mode_ == 'c'))
-	{			// save contents to disk
-		try
-		{
-			TeAsciiFile sFile(params_.fileName_,"w+");
-			if (writeParameters(sFile))
-				saveData(sFile);
-		}
-		catch (...)
-		{
-		}
-	}
-	delete [] myData_;
-}
-
-bool
-TeDecoderASCIIGrid::clear()
-{
-	if ( isModified_ && (params_.mode_ == 'w' || params_.mode_ == 'c'))
-	{			// save contents to disk
-		try
-		{
-			TeAsciiFile sFile(params_.fileName_,"w+");
-			if (writeParameters(sFile))
-				saveData(sFile);
-		}
-		catch (...)
-		{
-		}
-		isModified_ = false;
-	}
-	if (myData_)
-		delete [] myData_;
-	myData_ = 0;
-	return true;
-}
-
-bool 
-TeDecoderASCIIGrid::readParameters()
-{
-	try
-	{
-		TeAsciiFile	pFile (params_.fileName_);
-		string name;
-		while (pFile.isNotAtEOF())
-		{
-			name = pFile.readString();
-			if (TeStringCompare(name,"NCOLS"))
-				break;
-		}
-		if (!pFile.isNotAtEOF())					// unexpected end of file
-			return false;
-		params_.ncols_ = pFile.readInt();
-		pFile.findNewLine();
-
-		while (pFile.isNotAtEOF())
-		{
-			name = pFile.readString();
-			if (TeStringCompare(name,"NROWS"))
-				break;
-		}
-		if (!pFile.isNotAtEOF())					// unexpected end of file
-			return false;
-		params_.nlines_ = pFile.readInt();
-		pFile.findNewLine();
-
-		bool isCenter = false;
-		while (pFile.isNotAtEOF())
-		{
-			name = pFile.readString();
-			if (TeStringCompare(name,"XLLCENTER"))
-			{
-				isCenter = true; 
-				break;
-			}
-			else if (TeStringCompare(name,"XLLCORNER"))
-				break;
-		}
-		if (!pFile.isNotAtEOF())					// unexpected end of file
-			return false;
-		double llx = pFile.readFloat();
-		pFile.findNewLine();
-
-		while (pFile.isNotAtEOF())
-		{
-			name = pFile.readString();
-			if (TeStringCompare(name,"YLLCENTER"))
-			{
-				isCenter = true; 
-				break;
-			}
-			else if (TeStringCompare(name,"YLLCORNER"))
-				break;
-		}
-		if (!pFile.isNotAtEOF())					// unexpected end of file
-			return false;
-		double lly = pFile.readFloat();	
-		pFile.findNewLine();
-
-		while (pFile.isNotAtEOF())
-		{
-			name = pFile.readString();
-			if (TeStringCompare(name,"CELLSIZE"))
-				break;
-		}
-		if (!pFile.isNotAtEOF())					// unexpected end of file
-			return false;
-		params_.resx_ = params_.resy_ = pFile.readFloat();		
-		pFile.findNewLine();
-
-		while (pFile.isNotAtEOF())
-		{
-			name = pFile.readString();
-			if (TeStringCompare(name,"NODATA_VALUE"))
-				break;
-		}
-		double dummy = -9999.0;
-		if (pFile.isNotAtEOF())					// unexpected end of file: NODATA statment is not present
-			dummy = pFile.readFloat();		
-		params_.nBands(1);
-		params_.setDataType(TeFLOAT);		
-		params_.setDummy(dummy);
-		params_.setPhotometric(TeRasterParams::TeMultiBand);
-		params_.lowerLeftResolutionSize(llx,lly,params_.resx_,params_.resy_,
-				                      params_.ncols_,params_.nlines_,isCenter);
-		TeProjection* pp = new TeNoProjection();
-		params_.projection(pp);
-		delete pp;
-	}
-	catch(...)
-	{
-		params_.errorMessage_ = "Fail to read the parameters from the raster the file.";
-		return false;
-	}
-	return true;
-}
-
-bool
-TeDecoderASCIIGrid::readFile(const string& filename)
-{
-	string valstring;
-	try 
-	{
-		TeAsciiFile	pFile (filename);
-		string name;
-		while (pFile.isNotAtEOF() && !TeStringCompare(name,"NODATA_VALUE"))
-			name = pFile.readString();
-		if (!pFile.isNotAtEOF())					// unexpected end of file
-			return false;
-		pFile.findNewLine();
-		double val;
-		for (int lin = 0; lin < params_.nlines_; ++lin)
-		{
-			for (int col = 0; col < params_.ncols_; ++col)
-			{
-				val = pFile.readFloat();
-				if (val != params_.dummy_[0])
-				{
-					setElement(col,lin,val);
-					if (val < params_.vmin_[0])
-						params_.vmin_[0] = val;
-					if (val > params_.vmax_[0])
-						params_.vmax_[0] = val;
-				}
-			}
-		}
-	}
-	catch(...)
-	{
-		params_.errorMessage_ = "Fail to read the data from the raster the file.";
-		return false;
-	}
-	return true;
-}
-
-void
-TeDecoderASCIIGrid::init()
-{
-	params_.status_= TeRasterParams::TeNotReady;
-	int nb = params_.nBands();
-	if (nb != 1 )
-	{
-		params_.errorMessage_ = "Ascii-GRID can store raster with only 1 band.";
-		return;
-	}
-
-	// try to allocate enough memory to hold the data
-	if (size_ != params_.nlines_*params_.ncols_*params_.nBands())
-	{
-		size_ = params_.nlines_*params_.ncols_*params_.nBands();
-		if (myData_)
-			delete [] myData_;
-		myData_ = new float [size_];
-	}
-	if (!myData_)
-		return;
-
-	for (long i=0; i<size_; myData_[i]=static_cast<float>(params_.dummy_[0]),++i);
-
-	if (params_.mode_ == 'c')	// creating a new file
-	{
-		ofstream dataFile(params_.fileName_.c_str()); // try to (re)create the file
-		if (!dataFile)
-		{
-			params_.errorMessage_ = "Fail to (re)create the raster the file:" + params_.fileName_;
-			return;
-		}
-		dataFile.close();
-		try
-		{
-			TeAsciiFile sFile(params_.fileName_,"w+");
-			if (!writeParameters(sFile) || !saveData(sFile))
-			{
-				params_.errorMessage_ = "Fail to write the raster to file";
-				return;
-			}
-			else
-			{
-				params_.status_ = TeRasterParams::TeReadyToWrite;
-			}
-		}
-		catch (...)
-		{
-			params_.errorMessage_ = "Fail to write the raster to file";
-			return;
-		}
-	}
-	else if (params_.mode_ == 'w')
-	{
-		ifstream dataFile(params_.fileName_.c_str()); // check if file exists
-		if (!dataFile)
-		{
-			params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
-			return; 
-		}
-		dataFile.close();	
-		if (!readFile(params_.fileName_))
-		{
-			params_.errorMessage_ = "Fail to read the raster the file:" + params_.fileName_;
-			return; 
-		}
-		params_.status_ = TeRasterParams::TeReadyToWrite;
-	}
-	else if (params_.mode_ == 'r')
-	{
-		ifstream dataFile(params_.fileName_.c_str()); // check if file exists
-		if (!dataFile)
-		{
-			params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
-			return; 
-		}
-		dataFile.close();	
-		if (!readFile(params_.fileName_))
-		{
-			params_.errorMessage_ = "Fail to read the raster the file:" + params_.fileName_;
-			return; 
-		}
-		params_.status_ = TeRasterParams::TeReadyToRead;	
-	}
-}
-
-bool 
-TeDecoderASCIIGrid::writeParameters(TeAsciiFile& pFile)
-{
-	string name;
-	try
-	{
-		TeBox box = params_.box();
-		name = "NCOLS " + Te2String(params_.ncols_) + "\n";
-		pFile.writeString(name);
-		name = "NROWS " + Te2String(params_.nlines_) + "\n";
-		pFile.writeString(name);
-		name = "XLLCENTER " + Te2String(box.x1_,6) + "\n";
-		pFile.writeString(name);
-		name = "YLLCENTER " + Te2String(box.y2_,6) + "\n";
-		pFile.writeString(name);
-		name = "CELLSIZE " + Te2String(params_.resx_,6) + "\n";
-		pFile.writeString(name);
-		name = "NODATA_VALUE " + Te2String(params_.dummy_[0],6) + "\n";
-		pFile.writeString(name);
-	}
-	catch (...)
-	{
-		params_.errorMessage_ = "Fail to write raster parameters to the file";
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDecoderASCIIGrid::saveData(TeAsciiFile& pFile)
-{
-	bool isi = (params_.dataType_[0] != TeDOUBLE) && (params_.dataType_[0] != TeFLOAT);
-
-	FILE* fp = pFile.FilePtr();
-	char fmt[100];
-	if (isi)
-		strcpy(fmt,"%.0f ");
-	else
-		strcpy(fmt,"%f ");
-	try
-	{
-		double d;
-		for (int l=0; l<params_.nlines_; ++l)
-		{
-			for (int c=0; c<params_.ncols_; ++c)
-			{
-				getElement(c,l,d);
-				fprintf(fp,fmt,d);
-			}
-			pFile.writeNewLine();
-		}
-	}
-	catch(...)
-	{
-		params_.errorMessage_ = "Fail to write raster data to the file";
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDecoderASCIIGrid::getElement (int col,int lin, double& val,int band)
-{
-	if (col < 0 || lin < 0 || col >= params_.ncols_ || lin >= params_.nlines_)
-		return false;
-	
-	int position = params_.nBands()*(params_.ncols_*lin+col)+band;
-	val = myData_[position];
-	return true;
-}
-
-bool 
-TeDecoderASCIIGrid::setElement (int col, int lin, double val,int band)
-{
-	if (col < 0 || lin < 0 || col >= params_.ncols_ || lin >= params_.nlines_)
-		return false;
-	int position = params_.nBands()*(params_.ncols_*lin+col)+band;
-	myData_[position] = static_cast<float>(val);
-	isModified_ = true;
-	return true;
-}
-
-TeDecoderASCIIGridFactory::TeDecoderASCIIGridFactory(const string& name): 
-	TeDecoderFactory(name) 
-{
-	TeDecoderFactory::instanceName2Dec()["GRD"]  = "ASCIIGRID";	
-	TeDecoderFactory::instanceName2Dec()["ASC"]  = "ASCIIGRID";	
-	TeDecoderFactory::instanceName2Dec()["TXT"]  = "ASCIIGRID";	
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeException.h"
+#include "TeDecoderASCIIGrid.h"
+#include "TeAsciiFile.h"
+#include "TeUtils.h"
+
+#include <cstring>
+#include <fstream>
+using std::ifstream;
+using std::ofstream;
+
+/*
+Expected format for ESRI ASCII GRID Files (Copied from the ArcWorkstation 8.3 Help File):
+
+<NCOLS xxx>
+<NROWS xxx>
+<XLLCENTER xxx | XLLCORNER xxx>
+<YLLCENTER xxx | YLLCORNER xxx>
+<CELLSIZE xxx>
+{NODATA_VALUE xxx}
+row 1
+row 2
+.
+.
+.
+row n
+*/
+
+TeDecoderASCIIGrid::TeDecoderASCIIGrid (const TeRasterParams& par) : 
+	isModified_(false),
+	size_(0),
+	myData_(0)
+{	
+	params_.errorMessage_.clear();
+	if (par.fileName_.empty())
+		return;
+	params_ = par;
+	params_.decoderIdentifier_ = "ASCIIGRID";
+	if (params_.mode_ == 'w' || params_.mode_ == 'r')
+		readParameters();
+}
+
+TeDecoderASCIIGrid::~TeDecoderASCIIGrid ()
+{
+	if ( isModified_ && (params_.mode_ == 'w' || params_.mode_ == 'c'))
+	{			// save contents to disk
+		try
+		{
+			TeAsciiFile sFile(params_.fileName_,"w+");
+			if (writeParameters(sFile))
+				saveData(sFile);
+		}
+		catch (...)
+		{
+		}
+	}
+	delete [] myData_;
+}
+
+bool
+TeDecoderASCIIGrid::clear()
+{
+	if ( isModified_ && (params_.mode_ == 'w' || params_.mode_ == 'c'))
+	{			// save contents to disk
+		try
+		{
+			TeAsciiFile sFile(params_.fileName_,"w+");
+			if (writeParameters(sFile))
+				saveData(sFile);
+		}
+		catch (...)
+		{
+		}
+		isModified_ = false;
+	}
+	if (myData_)
+		delete [] myData_;
+	myData_ = 0;
+	return true;
+}
+
+bool
+TeDecoderASCIIGrid::readParameters()
+{
+    unsigned int npars = 0;
+    double llx, lly, dummy=-9999.0;
+	bool isCenter = false;
+    try
+    {
+        TeAsciiFile    pFile (params_.fileName_);
+        string name;
+        while (pFile.isNotAtEOF() && npars < 8)
+        {
+            name = pFile.readString();
+            if (TeStringCompare(name,"NCOLS"))
+            {
+                if (!pFile.isNotAtEOF())                    // unexpected end of file
+                    return false;
+                params_.ncols_ = pFile.readInt();
+                ++npars;
+                pFile.findNewLine();
+            }
+            else if (TeStringCompare(name,"NROWS"))
+            {
+                if (!pFile.isNotAtEOF())                    // unexpected end of file
+                    return false;
+                params_.nlines_ = pFile.readInt();
+                ++npars;
+                pFile.findNewLine();
+			}
+            else if (TeStringCompare(name,"XLLCENTER"))
+			{
+                isCenter = true;
+                if (!pFile.isNotAtEOF())                    // unexpected end of file
+                    return false;
+                llx = pFile.readFloat();
+                ++npars;
+                pFile.findNewLine();
+            }
+            else if (TeStringCompare(name,"XLLCORNER"))
+			{
+                if (!pFile.isNotAtEOF())                    // unexpected end of file
+                    return false;
+                llx = pFile.readFloat();
+                ++npars;
+                pFile.findNewLine();
+            }
+            else if (TeStringCompare(name,"YLLCENTER"))
+			{
+                isCenter = true;
+                if (!pFile.isNotAtEOF())                    // unexpected end of file
+                    return false;
+                lly = pFile.readFloat();
+                ++npars;
+                pFile.findNewLine();
+            }
+            else if (TeStringCompare(name,"YLLCORNER"))
+			{
+                if (!pFile.isNotAtEOF())                    // unexpected end of file
+                    return false;
+                lly = pFile.readFloat();
+                ++npars;
+                pFile.findNewLine();
+            }
+            else if (TeStringCompare(name,"CELLSIZE"))
+			{
+                if (!pFile.isNotAtEOF())                    // unexpected end of file
+                    return false;
+                params_.resx_ = params_.resy_ = pFile.readFloat();       
+                ++npars;
+                pFile.findNewLine();
+            }
+            else if (TeStringCompare(name,"NODATA_VALUE"))
+			{
+                if (!pFile.isNotAtEOF())                    // unexpected end of file
+                    return false;
+                dummy = pFile.readFloat();   
+                ++npars;
+                pFile.findNewLine();
+			}
+		}
+            
+        
+        params_.nBands(1);
+        params_.setDataType(TeDOUBLE);       
+        params_.setDummy(dummy);
+        params_.setPhotometric(TeRasterParams::TeMultiBand);
+        params_.lowerLeftResolutionSize(llx,lly,params_.resx_,params_.resy_,
+                                      params_.ncols_,params_.nlines_,isCenter);
+        TeProjection* pp = new TeNoProjection();
+        params_.projection(pp);
+        delete pp;
+    }
+    catch(...)
+    {
+        params_.errorMessage_ = "Fail to read the parameters from the raster the file.";
+        return false;
+    }
+    return true;
+}
+
+bool
+TeDecoderASCIIGrid::readFile(const string& filename)
+{
+	string valstring;
+	try 
+	{
+		TeAsciiFile	pFile (filename);
+		string name;
+		while (pFile.isNotAtEOF() && !TeStringCompare(name,"NODATA_VALUE"))
+			name = pFile.readString();
+		if (!pFile.isNotAtEOF())					// unexpected end of file
+			return false;
+		pFile.findNewLine();
+		double val;
+		for (int lin = 0; lin < params_.nlines_; ++lin)
+		{
+			for (int col = 0; col < params_.ncols_; ++col)
+			{
+				val = pFile.readFloat();
+				if (val != params_.dummy_[0])
+				{
+					setElement(col,lin,val);
+					if (val < params_.vmin_[0])
+						params_.vmin_[0] = val;
+					if (val > params_.vmax_[0])
+						params_.vmax_[0] = val;
+				}
+			}
+		}
+	}
+	catch(...)
+	{
+		params_.errorMessage_ = "Fail to read the data from the raster the file.";
+		return false;
+	}
+	return true;
+}
+
+void
+TeDecoderASCIIGrid::init()
+{
+	params_.status_= TeRasterParams::TeNotReady;
+	int nb = params_.nBands();
+	if (nb != 1 )
+	{
+		params_.errorMessage_ = "Ascii-GRID can store raster with only 1 band.";
+		return;
+	}
+
+	// try to allocate enough memory to hold the data
+	if (size_ != params_.nlines_*params_.ncols_*params_.nBands())
+	{
+		size_ = params_.nlines_*params_.ncols_*params_.nBands();
+		if (myData_)
+			delete [] myData_;
+		myData_ = new double [size_];
+	}
+	if (!myData_)
+		return;
+
+	for (long i=0; i<size_; myData_[i]=(params_.dummy_[0]),++i);
+
+	if (params_.mode_ == 'c')	// creating a new file
+	{
+		ofstream dataFile(params_.fileName_.c_str()); // try to (re)create the file
+		if (!dataFile)
+		{
+			params_.errorMessage_ = "Fail to (re)create the raster the file:" + params_.fileName_;
+			return;
+		}
+		dataFile.close();
+		try
+		{
+			TeAsciiFile sFile(params_.fileName_,"w+");
+			if (!writeParameters(sFile) || !saveData(sFile))
+			{
+				params_.errorMessage_ = "Fail to write the raster to file";
+				return;
+			}
+			else
+			{
+				params_.status_ = TeRasterParams::TeReadyToWrite;
+			}
+		}
+		catch (...)
+		{
+			params_.errorMessage_ = "Fail to write the raster to file";
+			return;
+		}
+	}
+	else if (params_.mode_ == 'w')
+	{
+		ifstream dataFile(params_.fileName_.c_str()); // check if file exists
+		if (!dataFile)
+		{
+			params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
+			return; 
+		}
+		dataFile.close();	
+		if (!readFile(params_.fileName_))
+		{
+			params_.errorMessage_ = "Fail to read the raster the file:" + params_.fileName_;
+			return; 
+		}
+		params_.status_ = TeRasterParams::TeReadyToWrite;
+	}
+	else if (params_.mode_ == 'r')
+	{
+		ifstream dataFile(params_.fileName_.c_str()); // check if file exists
+		if (!dataFile)
+		{
+			params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
+			return; 
+		}
+		dataFile.close();	
+		if (!readFile(params_.fileName_))
+		{
+			params_.errorMessage_ = "Fail to read the raster the file:" + params_.fileName_;
+			return; 
+		}
+		params_.status_ = TeRasterParams::TeReadyToRead;	
+	}
+}
+
+bool 
+TeDecoderASCIIGrid::writeParameters(TeAsciiFile& pFile)
+{
+	string name;
+	try
+	{
+		TeBox box = params_.box();
+		name = "NCOLS " + Te2String(params_.ncols_) + "\n";
+		pFile.writeString(name);
+		name = "NROWS " + Te2String(params_.nlines_) + "\n";
+		pFile.writeString(name);
+		name = "XLLCENTER " + Te2String(box.x1_,6) + "\n";
+		pFile.writeString(name);
+		name = "YLLCENTER " + Te2String(box.y1_,6) + "\n";
+		pFile.writeString(name);
+		name = "CELLSIZE " + Te2String(params_.resx_,6) + "\n";
+		pFile.writeString(name);
+		name = "NODATA_VALUE " + Te2String(params_.dummy_[0],6) + "\n";
+		pFile.writeString(name);
+	}
+	catch (...)
+	{
+		params_.errorMessage_ = "Fail to write raster parameters to the file";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDecoderASCIIGrid::saveData(TeAsciiFile& pFile)
+{
+	bool isi = (params_.dataType_[0] != TeDOUBLE) && (params_.dataType_[0] != TeFLOAT);
+
+	FILE* fp = pFile.FilePtr();
+	char fmt[100];
+	if (isi)
+		strcpy(fmt,"%.0f ");
+	else
+		strcpy(fmt,"%f ");
+	try
+	{
+		double d;
+		for (int l=0; l<params_.nlines_; ++l)
+		{
+			for (int c=0; c<params_.ncols_; ++c)
+			{
+				getElement(c,l,d);
+				fprintf(fp,fmt,d);
+			}
+			pFile.writeNewLine();
+		}
+	}
+	catch(...)
+	{
+		params_.errorMessage_ = "Fail to write raster data to the file";
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDecoderASCIIGrid::getElement (int col,int lin, double& val,int band)
+{
+	if (col < 0 || lin < 0 || col >= params_.ncols_ || lin >= params_.nlines_)
+		return false;
+	
+	int position = params_.nBands()*(params_.ncols_*lin+col)+band;
+	val = myData_[position];
+	return true;
+}
+
+bool 
+TeDecoderASCIIGrid::setElement (int col, int lin, double val,int band)
+{
+	if (col < 0 || lin < 0 || col >= params_.ncols_ || lin >= params_.nlines_)
+		return false;
+	int position = params_.nBands()*(params_.ncols_*lin+col)+band;
+	myData_[position] = (val);
+	isModified_ = true;
+	return true;
+}
+
+TeDecoderASCIIGridFactory::TeDecoderASCIIGridFactory(const string& name): 
+	TeDecoderFactory(name) 
+{
+	TeDecoderFactory::instanceName2Dec()["GRD"]  = "ASCIIGRID";	
+	TeDecoderFactory::instanceName2Dec()["ASC"]  = "ASCIIGRID";	
+	TeDecoderFactory::instanceName2Dec()["TXT"]  = "ASCIIGRID";	
+}
diff --git a/src/terralib/kernel/TeDecoderASCIIGrid.h b/src/terralib/kernel/TeDecoderASCIIGrid.h
old mode 100755
new mode 100644
index 57cfc08..31c515e
--- a/src/terralib/kernel/TeDecoderASCIIGrid.h
+++ b/src/terralib/kernel/TeDecoderASCIIGrid.h
@@ -1,97 +1,97 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderASCIIGrid.h
-    \brief This file deals with decoding of raster data in a ASCII SPRING format
-*/
-#ifndef  __TERRALIB_INTERNAL_DECODERASCIIGrid_H
-#define  __TERRALIB_INTERNAL_DECODERASCIIGrid_H
-
-#include "TeDecoder.h"
-
-class TeAsciiFile;
-
-//! Implements a decoder for rasters in ESRI, Inc.'s ASCII Grid format
-/*!
-	The default file extension associated to this decoder ".grd", ".asc" and ".txt".
-*/
-class TL_DLL TeDecoderASCIIGrid : public TeDecoder
-{
-public:
-	//! Empty constructor
-	TeDecoderASCIIGrid();
-
-	//! Constructor from some parameters
-	TeDecoderASCIIGrid(const TeRasterParams& par);
-
-	//! Destructor
-	~TeDecoderASCIIGrid();
-
-	//! Initializes the internal structures of the decoder.
-	void init();
-
-	//! Clears its internal structures.
-	bool clear();
-
-	//! Writes an element
-	bool setElement(int col,int lin, double val, int band=0);
-
-	//! Reads an element
-	bool getElement(int col,int lin, double &val,int band=0);
-
-private:
-
-	bool isModified_;
-	long size_;
-	float* myData_;
-
-	//! Reads the data from a raster file.
-    bool readFile(const string& filename);
-
-	//! Reads raster file header information.
-	bool readParameters();
-
-	//! Writes header information to raster file.
-	bool writeParameters(TeAsciiFile& pFile);
-
-	//! Saves data to raster file.
-	bool saveData(TeAsciiFile& pFile);
-
-};
-
-//! Implements a factory to build decoders for ESRI's ASCII Grid raster format
-class TL_DLL TeDecoderASCIIGridFactory : public TeDecoderFactory
-{
-public:
-	//! Constructor
-	TeDecoderASCIIGridFactory(const string& name);
-
-	//! Implementation for the abstract TeFactory::build.
-	/*!
-	    \param arg A const reference to the used parameters.
-		\return A pointer to the new generated instance.
-    */
-	TeDecoder* build (const TeRasterParams& arg)
-	{  return new TeDecoderASCIIGrid(arg); }
-
-};
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderASCIIGrid.h
+    \brief This file deals with decoding of raster data in a ASCII SPRING format
+*/
+#ifndef  __TERRALIB_INTERNAL_DECODERASCIIGrid_H
+#define  __TERRALIB_INTERNAL_DECODERASCIIGrid_H
+
+#include "TeDecoder.h"
+
+class TeAsciiFile;
+
+//! Implements a decoder for rasters in ESRI, Inc.'s ASCII Grid format
+/*!
+	The default file extension associated to this decoder ".grd", ".asc" and ".txt".
+*/
+class TL_DLL TeDecoderASCIIGrid : public TeDecoder
+{
+public:
+	//! Empty constructor
+	TeDecoderASCIIGrid();
+
+	//! Constructor from some parameters
+	TeDecoderASCIIGrid(const TeRasterParams& par);
+
+	//! Destructor
+	~TeDecoderASCIIGrid();
+
+	//! Initializes the internal structures of the decoder.
+	void init();
+
+	//! Clears its internal structures.
+	bool clear();
+
+	//! Writes an element
+	bool setElement(int col,int lin, double val, int band=0);
+
+	//! Reads an element
+	bool getElement(int col,int lin, double &val,int band=0);
+
+private:
+
+	bool isModified_;
+	long size_;
+	double* myData_;
+
+	//! Reads the data from a raster file.
+    bool readFile(const string& filename);
+
+	//! Reads raster file header information.
+	bool readParameters();
+
+	//! Writes header information to raster file.
+	bool writeParameters(TeAsciiFile& pFile);
+
+	//! Saves data to raster file.
+	bool saveData(TeAsciiFile& pFile);
+
+};
+
+//! Implements a factory to build decoders for ESRI's ASCII Grid raster format
+class TL_DLL TeDecoderASCIIGridFactory : public TeDecoderFactory
+{
+public:
+	//! Constructor
+	TeDecoderASCIIGridFactory(const string& name);
+
+	//! Implementation for the abstract TeFactory::build.
+	/*!
+	    \param arg A const reference to the used parameters.
+		\return A pointer to the new generated instance.
+    */
+	TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeDecoderASCIIGrid(arg); }
+
+};
+#endif
diff --git a/src/terralib/kernel/TeDecoderDatabase.cpp b/src/terralib/kernel/TeDecoderDatabase.cpp
old mode 100755
new mode 100644
index 0dc67bc..715f5ac
--- a/src/terralib/kernel/TeDecoderDatabase.cpp
+++ b/src/terralib/kernel/TeDecoderDatabase.cpp
@@ -1,525 +1,580 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeDecoderDatabase.h"
-#include "TeDecoderMemory.h"
-#include "TeRasterRemap.h"
-#include "TeVectorRemap.h"
-#include "TeDataTypes.h"
-#include "TeProgress.h"
-
-#include <zlib.h>
-#include "TeLibJpegWrapper.h"
-
-TeDecoderDatabase::TeDecoderDatabase(const TeRasterParams& par ):
-	TeDecoderVirtualMemory(par),
-	db_(par.database_),
-	blockPortal_(0),
-	memAux_(0),
-	nSelectedBlocks_(0)
-{
-	params_ = par;
-	params_.decoderIdentifier_ = "DB";
-	params_.errorMessage_.clear();
-}
-
-TeDecoderDatabase::~TeDecoderDatabase()
-{
-	if (blockPortal_)
-	{
-		delete blockPortal_;
-		blockPortal_ = 0;
-	}
-	clear();
-}
-
-bool
-TeDecoderDatabase::create()
-{
-	if (db_ == 0)
-		return false;
-
-	// Create raster table in database
-  	if (!db_->createRasterTable(params_.fileName_))
-		return false;
-	return true;
-}
-
-void
-TeDecoderDatabase::init()
-{
-	if (blockPortal_)
-	{
-		blockPortal_->freeResult();
-		delete blockPortal_;
-		blockPortal_ = 0;
-	}
-	clear();
-	params_.status_= TeRasterParams::TeNotReady;
-	if (db_ == 0)			// there is not valid database connection
-	{
-		params_.errorMessage_ = "There is no database pointer associated to raster.";
-		return;
-	}
-
-	if (params_.mode_ == 'c')
-	{
-		if (db_->tableExist(params_.fileName_))
-		{
-			string sql = "DROP TABLE " + params_.fileName_;
-			db_->execute(sql);
-		}
-  		if (!db_->createRasterTable(params_.fileName_))
-		{
-			params_.errorMessage_ = "Fail to create the raster table: " + params_.fileName_;
-			return;
-		}
-		else 
-			params_.status_ = TeRasterParams::TeReadyToWrite;
-	}
-	else if (params_.mode_ == 'w')
-	{
-		if (db_->tableExist(params_.fileName_))
-			params_.status_ = TeRasterParams::TeReadyToWrite;
-	}
-	else if (params_.mode_ == 'r')
-	{
-		if (db_->tableExist(params_.fileName_))
-			params_.status_ = TeRasterParams::TeReadyToRead;		
-	}
-	TeDecoderVirtualMemory::init();
-}
-
-bool
-TeDecoderDatabase::clear()
-{
-	if (db_ == 0)
-		return false;
-	TeDecoderVirtualMemory::clear();
-	if (blockPortal_)
-	{
-		blockPortal_->freeResult();
-	}
-	if (memAux_)
-		delete []memAux_;
-	memAux_ = 0;
-	params_.status_ = TeRasterParams::TeNotReady;
-  if (db_->isConnected() && (params_.mode_ == 'c' || params_.mode_ == 'w') && 
-    (!params_.objectId_.empty() && params_.layerId_ > 0))
-	{
-		TeDatabasePortal* portal = db_->getPortal();
-		string sql = "SELECT geom_table FROM te_representation WHERE geom_type = 512";
-		sql += " AND layer_id = " + Te2String(params_.layerId_);
-		if (portal->query(sql) && portal->fetchRow())
-		{
-			string tName = portal->getData(0);
-			portal->freeResult();
-			sql = "SELECT geom_id FROM " + tName + " WHERE object_id = '" + params_.objectId_ + "'";
-			if (portal->query(sql) && portal->fetchRow())
-			{
-				tName += "_metadata";
-				db_->updateRasterMetadata(tName,portal->getInt(0),params_);
-			}
-		}
-		delete portal;
-	}
-	return true;
-}
-
-string 
-TeDecoderDatabase::codifyId(int col, int lin, int band, int res, int subb)
-{
-	return codifyId(blockIndex(col, lin, band), res, subb);
-}
-
-string TeDecoderDatabase::codifyId(const TeBlockIndex& idx, int res, int subb)
-{
-	char id[32];
-	sprintf(id, "X%dY%dB%dR%dS%d", idx.col_, idx.lin_, idx.band_, res, subb);
-	return string(id);
-}
-
-
-TeBlockIndex 
-TeDecoderDatabase::blockIndex(int col, int lin, int band)
-{
-	if (params_.tiling_type_ != TeRasterParams::TeExpansible)
-		return TeDecoderVirtualMemory::blockIndex(col, lin, band);
-
-	TeBlockIndex bl_idx;
-	bl_idx.band_ = band;
-
-	TeCoord2D tmpCoord = TeCoord2D(col,lin);
-	TeCoord2D xy = params_.index2Coord(tmpCoord);
-
-	double bXSize = params_.blockWidth_*params_.resx_;
-	double bYSize = params_.blockHeight_*params_.resy_;
-
-	if ( xy.x() < 0)
-		bl_idx.col_ = (int)(xy.x()/bXSize - 1);
-	else
-		bl_idx.col_ = (int)(xy.x()/bXSize);
-
-	if (xy.y() < 0)
-		bl_idx.lin_ = (int) (xy.y()/bYSize-1);
-	else
-		bl_idx.lin_ = (int) (xy.y()/bYSize);
-
-	return bl_idx;
-}
-
-void 
-TeDecoderDatabase::decodifyId(const string& id, int& col,int& lin, int& band, int& res, int& subb)
-{
-	int r, s;
-	TeBlockIndex bl_idx;
-	sscanf(id.c_str(),"%*c%d%*c%d%*c%d%*c%d%*c%d", 
-		&bl_idx.col_, &bl_idx.lin_, &bl_idx.band_, &r, &s);
-	blockIndexPos(bl_idx, col, lin, band);
-	res = r;
-	subb = s;
-}
-
-void TeDecoderDatabase::blockIndexPos( const TeBlockIndex& index, int& ulCol, int& ulLin, int& band)
-{
-	if (params_.tiling_type_ != TeRasterParams::TeExpansible)
-		return TeDecoderVirtualMemory::blockIndexPos(index, ulCol, ulLin, band);
-
-	band = index.band();
-
-	double bXSize = params_.blockWidth_*params_.resx_;
-	double bYSize = params_.blockHeight_*params_.resy_;
-
-	TeCoord2D xy(index.column()*bXSize+params_.resx_/2,index.line()*bYSize+params_.resy_/2);
-	xy = params_.coord2Index(xy);
-	ulLin = TeRound(xy.y())-params_.blockHeight_+1;
-	ulCol = TeRound(xy.x());
-}
-
-
-bool TeDecoderDatabase::getRasterBlock(const TeBlockIndex& index, void *block)
-{
-	string index_str;
-	index_str = codifyId(index, params_.resolution_);
-	return getRasterBlock(index_str, block);
-}
-
-bool 
-TeDecoderDatabase::getRasterBlock(const string& index, void *block)
-{
-	TeDatabasePortal* portal = db_->getPortal();
-	if (!portal) 
-		return false;
-	
-	string q;					// try to get the tile from databatase
-	q ="SELECT * FROM " + params_.fileName_ + " WHERE block_id='" + index + "'";
-
-	if (!portal->query(q))		// error submting query 
-	{
-		delete portal;
-		return 0;
-	}
-	int band=0;
-	if (!portal->fetchRow())	// tile is not in the database
-	{
-		delete portal;
-		return 0;
-	}
-
-	unsigned char*  memread_ptr = 0;
-	if(params_.compression_[band] != TeRasterParams::TeNoCompression)
-	{
-		if(!memAux_)
-		{
-			long size = params_.blockHeight_ * params_.blockWidth_ * params_.elementSize();
-			memAux_ = new unsigned char[size];
-		}
-		memread_ptr = memAux_;
-	}
-	else
-		memread_ptr = reinterpret_cast<unsigned char*>(block);
-
-	// tile is already in the database
-	unsigned long blobLen;
-	if (!portal->getRasterBlock(blobLen,memread_ptr))
-	{
-		delete portal;
-		return false;
-	}
-
-	// decompress blob into a tile (previously allocated) 
-	if (params_.compression_[band] == TeRasterParams::TeZLib)		// zlib compression
-	{
-		unsigned long blockLen = params_.blockHeight_ * params_.blockWidth_ * params_.elementSize();	// size after decompression
-		uncompress (reinterpret_cast<unsigned char*>(block),&blockLen,memread_ptr,blobLen);
-	}
-	else if (params_.compression_[band] == TeRasterParams::TeJpeg) //jpeg compression
-	{
-		int nb;
-		if (!Jpeg::DecompressBuffer(memAux_,blobLen,reinterpret_cast<unsigned char*>(block),params_.blockWidth_,params_.blockHeight_,nb))
-		{
-			delete portal;
-			return false;
-		}
-	}
-	delete portal;
-	return true;
-}
-
-bool 
-TeDecoderDatabase::putRasterBlock(const TeBlockIndex& index, void *block, long bsize)
-{
-	string index_str;
-	index_str = codifyId(index, params_.resolution_);
-	return putRasterBlock(index_str, block, bsize);
-}
-
-bool 
-TeDecoderDatabase::putRasterBlock(const string& index, void *block, long bsize)
-{
-	if (db_ == 0 || index.empty())
-		return false;
-
-	// decodify tile parameters from index
-	int res, subb, band, blin, bcol;
-	decodifyId(index,bcol,blin,band,res, subb);
-
-	// calculates the box coordinates of the tile
-	TeCoord2D llt(bcol, blin+params_.blockHeight_-1);
-	TeCoord2D urt(bcol+params_.blockWidth_-1, blin);
-	TeCoord2D ll = params_.index2Coord(llt);
-	TeCoord2D ur = params_.index2Coord(urt);
-
-	TeBox blockbb(ll.x()-params_.resx_/2.,ll.y()-params_.resy_/2.,ur.x()+params_.resx_/2.,ur.y()+params_.resy_/2.);
-	bool status;
-
-	// verify compression option
-	if (params_.compression_[band] == TeRasterParams::TeNoCompression)
-	{
-		status = db_->insertRasterBlock(params_.fileName_,index,blockbb.lowerLeft(),blockbb.upperRight(),reinterpret_cast<unsigned char*>(block),bsize,band,res,subb);
-		return status;
-	}
-	unsigned long finalsize = bsize;  // final size after compression
-	if (!memAux_)
-	{
-		long size = params_.blockHeight_ * params_.blockWidth_ * params_.elementSize();
-		memAux_ = new unsigned char[int(size*1.1 + 12.)];
-	}
-	if (params_.compression_[band] == TeRasterParams::TeZLib)		// ZLib compression
-	{
-		// zlib needs some more space)
-		finalsize = (unsigned long)(bsize*1.1 + 12.);
-		compress (memAux_, &finalsize,reinterpret_cast<unsigned char*>(block),bsize);
-		return db_->insertRasterBlock(params_.fileName_,index,blockbb.lowerLeft(),blockbb.upperRight(),memAux_,finalsize,band,res,subb);
-	}
-	else if (params_.compression_[band] == TeRasterParams::TeJpeg)	// JPEG compression
-	{
-		int sizec = int(bsize*1.1 + 12.);
-		if (!Jpeg::CompressToBuffer(reinterpret_cast<unsigned char*>(block),params_.blockWidth_,params_.blockHeight_,1,memAux_,sizec,75))
-			return false;
-		finalsize = sizec;
-		return db_->insertRasterBlock(params_.fileName_,index,blockbb.lowerLeft(),blockbb.upperRight(),memAux_,finalsize,band,res,subb);
-	}
-	return false;
-}
-
-bool
-TeDecoderDatabase::saveLUTTable()
-{
-	if (params_.lutName_.empty())
-		return false;
-	if (!db_ || !db_->createLUTTable(params_.lutName_))
-		return false;
-	for (unsigned int i=0; i<params_.lutb_.size(); i++)
-	{
-		string sql = "INSERT INTO " + params_.lutName_ + " VALUES(";
-		sql += Te2String(i) + ", ";
-		sql += Te2String(params_.lutr_[i]) + ", ";
-		sql += Te2String(params_.lutg_[i]) + ", ";
-		sql += Te2String(params_.lutb_[i]) + ")";
-		if (!db_->execute(sql))
-			return false;
-	}
-	return true;
-}
-
-bool
-TeDecoderDatabase::selectBlocks(TeBox& bb, int resFac, TeRasterParams& parBlock)  
-{ 
-	if (!db_)
-		return false;
-
-	if (blockPortal_)
-		delete blockPortal_;
-
-	blockPortal_ = db_->getPortal();
-	if (!blockPortal_)
-		return false;
-
-	string sql;
-	string sel = db_->getSQLBoxSelect(params_.fileName_, TeRASTER);
-	string where = db_->getSQLBoxWhere (bb, TeRASTER);
-
-	sql = "SELECT "+ sel;
-	sql += " FROM " + params_.fileName_;
-	sql += " WHERE " + where + " AND resolution_factor = " + Te2String(resFac);
-	sql += " ORDER BY lower_x, lower_y, upper_x, upper_y, block_id";
-	
-	if (!blockPortal_->query(sql))
-	{
-		delete blockPortal_;
-		blockPortal_ = 0;
-		return false;
-	}
-	nSelectedBlocks_ = blockPortal_->numRows();
-	parBlock.projection(params_.projection());
-	parBlock.resx_ = params_.resx_*resFac;
-	parBlock.resy_ = params_.resy_*resFac;
-	parBlock.nlines_ = params_.blockHeight_;
-	parBlock.ncols_= params_.blockWidth_;
-	parBlock.nBands(params_.nBands());
-	parBlock.dataType_ = params_.dataType_;
-	parBlock.dummy_ = params_.dummy_;
-	parBlock.useDummy_ = params_.useDummy_;
-	parBlock.photometric_ = params_.photometric_;
-	parBlock.vmax_ = params_.vmax_;
-	parBlock.vmin_ = params_.vmin_;
-	parBlock.lutr_ = params_.lutr_;
-	parBlock.lutg_ = params_.lutg_;
-	parBlock.lutb_ = params_.lutb_;
-	parBlock.interleaving_ = TeRasterParams::TePerBand;
-	return blockPortal_->fetchRow();
-}
-
-bool
-TeDecoderDatabase::getSelectedRasterBlock(TeDecoderMemory* memDec) 
-{ 
-	if (!blockPortal_)
-		return 0;
-	unsigned long srcLen;
-	int i = 0;
-
-	if (!memAux_ )
-	{
-		long size = params_.blockHeight_ * params_.blockWidth_ * params_.elementSize();
-		memAux_ = new unsigned char[size];
-	}
-	int res;
-	TeBox bbBlock;
-	string blockId;
-	do
-	{
-		double lx = 0;
-		double ly = 0;
-		double ux = 0;
-		double uy = 0; 
-		lx = blockPortal_->getDouble("lower_x");
-		ly = blockPortal_->getDouble("lower_y");
-		ux = blockPortal_->getDouble("upper_x");
-		uy = blockPortal_->getDouble("upper_y");
-
-		bbBlock = TeBox(lx, ly, ux, uy);
-
-		blockId = blockPortal_->getData("block_id");
-		res = blockPortal_->getInt("resolution_factor");
-
-	int banda;
-    if(params_.nBands() > 1)
-    {
-		  int col, lin, res, subb;
-		  this->decodifyId(blockId, col, lin, banda, res, subb);
-    }
-	else
-      banda = 0;
-    
-	if (params_.compression_[banda] == TeRasterParams::TeNoCompression)
-		  blockPortal_->getRasterBlock(srcLen, reinterpret_cast<unsigned char*>(memDec->data(banda)));
-    else
-    {
-		blockPortal_->getRasterBlock(srcLen,memAux_);
-
-		if (params_.compression_[banda] == TeRasterParams::TeZLib)
-		{
-			TeRasterParams& par = memDec->params();
-			unsigned long destLen = par.ncols_ * par.nlines_ * par.elementSize();
-			int status;
-			status = uncompress (reinterpret_cast<unsigned char*>(memDec->data(banda)),&destLen,memAux_,srcLen);
-		}
-		else if (params_.compression_[banda] == TeRasterParams::TeJpeg)
-		{
-			int nb = 1;
-			Jpeg::DecompressBuffer(memAux_,srcLen,reinterpret_cast<unsigned char*>(memDec->data(banda)),params_.blockWidth_,params_.blockHeight_,nb);
-		}
-    }
-		i++;
-	}while (i<params_.nBands() && blockPortal_->fetchRow());
-	
-	memDec->params().boundingBoxResolution(bbBlock.x1(),bbBlock.y1(),bbBlock.x2(),bbBlock.y2(),
-		                                   params_.resx_*res,params_.resy_*res);
-	memDec->params().blockId_ = blockId;
-	return blockPortal_->fetchRow();
-}
-
-void
-TeDecoderDatabase::clearBlockSelection() 
-{
-	if (blockPortal_)
-		delete blockPortal_;
-	blockPortal_ = 0;
-	nSelectedBlocks_ = 0;
-}
-
-int 
-TeDecoderDatabase::bestResolution(TeBox& bb, int ncols, int nlines, TeProjection* proj)
-{
-	TeBox box = bb;
-	if (proj)
-		box = TeRemapBox(bb, proj, params_.projection());
-	
-	double resx = box.width()/ncols;
-	double resy = box.height()/nlines;
-	
-	double auxx = resx/params_.resx_;
-	double auxy = resy/params_.resy_;
-
-	int aux = (int) (min(auxx,auxy));
-
-	string sql = "SELECT resolution_factor FROM " + params_.fileName_;
-	sql += " WHERE resolution_factor <= " + Te2String(aux) + " ORDER BY resolution_factor DESC";
-
-	TeDatabasePortal* portal = params_.database_->getPortal();
-	if (!portal)
-		return 1;
-
-	if (!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return 1;
-	}
-
-	int res = atoi(portal->getData(0));
-	delete portal;
-	return res;
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeDecoderDatabase.h"
+#include "TeDecoderMemory.h"
+#include "TeRasterRemap.h"
+#include "TeVectorRemap.h"
+#include "TeDataTypes.h"
+#include "TeProgress.h"
+
+#include <zlib.h>
+#include "TeLibJpegWrapper.h"
+
+TeDecoderDatabase::TeDecoderDatabase(const TeRasterParams& par ):
+	TeDecoderVirtualMemory(par),
+	db_(par.database_),
+	blockPortal_(0),
+	memAux_(0),
+	nSelectedBlocks_(0)
+{
+	params_ = par;
+	params_.decoderIdentifier_ = "DB";
+	params_.errorMessage_.clear();
+}
+
+TeDecoderDatabase::~TeDecoderDatabase()
+{
+	if (blockPortal_)
+	{
+		delete blockPortal_;
+		blockPortal_ = 0;
+	}
+	clear();
+}
+
+bool
+TeDecoderDatabase::create()
+{
+	if (db_ == 0)
+		return false;
+
+	// Create raster table in database
+  	if (!db_->createRasterTable(params_.fileName_))
+		return false;
+	return true;
+}
+
+void
+TeDecoderDatabase::init()
+{
+	if (blockPortal_)
+	{
+		blockPortal_->freeResult();
+		delete blockPortal_;
+		blockPortal_ = 0;
+	}
+	clear();
+	params_.status_= TeRasterParams::TeNotReady;
+	if (db_ == 0)			// there is not valid database connection
+	{
+		params_.errorMessage_ = "There is no database pointer associated to raster.";
+		return;
+	}
+
+	if (params_.mode_ == 'c')
+	{
+		if (db_->tableExist(params_.fileName_))
+		{
+			string sql = "DROP TABLE " + params_.fileName_;
+			db_->execute(sql);
+		}
+  		if (!db_->createRasterTable(params_.fileName_))
+		{
+			params_.errorMessage_ = "Fail to create the raster table: " + params_.fileName_;
+			return;
+		}
+		else 
+			params_.status_ = TeRasterParams::TeReadyToWrite;
+	}
+	else if (params_.mode_ == 'w')
+	{
+		if (db_->tableExist(params_.fileName_))
+			params_.status_ = TeRasterParams::TeReadyToWrite;
+	}
+	else if (params_.mode_ == 'r')
+	{
+		if (db_->tableExist(params_.fileName_))
+			params_.status_ = TeRasterParams::TeReadyToRead;		
+	}
+	TeDecoderVirtualMemory::init();
+}
+
+bool
+TeDecoderDatabase::clear()
+{
+	if (db_ == 0)
+		return false;
+	TeDecoderVirtualMemory::clear();
+	if (blockPortal_)
+	{
+		blockPortal_->freeResult();
+	}
+	if (memAux_)
+		delete []memAux_;
+	memAux_ = 0;
+	params_.status_ = TeRasterParams::TeNotReady;
+  if (db_->isConnected() && (params_.mode_ == 'c' || params_.mode_ == 'w') && 
+    (!params_.objectId_.empty() && params_.layerId_ > 0))
+	{
+		TeDatabasePortal* portal = db_->getPortal();
+		string sql = "SELECT geom_table FROM te_representation WHERE geom_type = 512";
+		sql += " AND layer_id = " + Te2String(params_.layerId_);
+		if (portal->query(sql) && portal->fetchRow())
+		{
+			string tName = portal->getData(0);
+			portal->freeResult();
+			sql = "SELECT geom_id FROM " + tName + " WHERE object_id = '" + params_.objectId_ + "'";
+			if (portal->query(sql) && portal->fetchRow())
+			{
+				tName += "_metadata";
+				db_->updateRasterMetadata(tName,portal->getInt(0),params_);
+			}
+		}
+		delete portal;
+	}
+	return true;
+}
+
+string 
+TeDecoderDatabase::codifyId(int col, int lin, int band, int res, int subb)
+{
+	return codifyId(blockIndex(col, lin, band), res, subb);
+}
+
+string TeDecoderDatabase::codifyId(const TeBlockIndex& idx, int res, int subb)
+{
+	char id[32];
+	sprintf(id, "X%dY%dB%dR%dS%d", idx.col_, idx.lin_, idx.band_, res, subb);
+	return string(id);
+}
+
+
+TeBlockIndex 
+TeDecoderDatabase::blockIndex(int col, int lin, int band)
+{
+	if (params_.tiling_type_ != TeRasterParams::TeExpansible)
+		return TeDecoderVirtualMemory::blockIndex(col, lin, band);
+
+	TeBlockIndex bl_idx;
+	bl_idx.band_ = band;
+
+	TeCoord2D tmpCoord = TeCoord2D(col,lin);
+	TeCoord2D xy = params_.index2Coord(tmpCoord);
+
+	double bXSize = params_.blockWidth_*params_.resx_;
+	double bYSize = params_.blockHeight_*params_.resy_;
+
+	if ( xy.x() < 0)
+		bl_idx.col_ = (int)(xy.x()/bXSize - 1);
+	else
+		bl_idx.col_ = (int)(xy.x()/bXSize);
+
+	if (xy.y() < 0)
+		bl_idx.lin_ = (int) (xy.y()/bYSize-1);
+	else
+		bl_idx.lin_ = (int) (xy.y()/bYSize);
+
+	return bl_idx;
+}
+
+void 
+TeDecoderDatabase::decodifyId(const string& id, int& col,int& lin, int& band, int& res, int& subb)
+{
+	int r, s;
+	TeBlockIndex bl_idx;
+	sscanf(id.c_str(),"%*c%d%*c%d%*c%d%*c%d%*c%d", 
+		&bl_idx.col_, &bl_idx.lin_, &bl_idx.band_, &r, &s);
+	blockIndexPos(bl_idx, col, lin, band);
+	res = r;
+	subb = s;
+}
+
+void TeDecoderDatabase::blockIndexPos( const TeBlockIndex& index, int& ulCol, int& ulLin, int& band)
+{
+	if (params_.tiling_type_ != TeRasterParams::TeExpansible)
+		return TeDecoderVirtualMemory::blockIndexPos(index, ulCol, ulLin, band);
+
+	band = index.band();
+
+	double bXSize = params_.blockWidth_*params_.resx_;
+	double bYSize = params_.blockHeight_*params_.resy_;
+
+	TeCoord2D xy(index.column()*bXSize+params_.resx_/2,index.line()*bYSize+params_.resy_/2);
+	xy = params_.coord2Index(xy);
+	ulLin = TeRound(xy.y())-params_.blockHeight_+1;
+	ulCol = TeRound(xy.x());
+}
+
+
+bool TeDecoderDatabase::getRasterBlock(const TeBlockIndex& index, void *block)
+{
+	string index_str;
+	index_str = codifyId(index, params_.resolution_);
+	return getRasterBlock(index_str, block);
+}
+
+bool 
+TeDecoderDatabase::getRasterBlock(const string& index, void *block)
+{
+	TeDatabasePortal* portal = db_->getPortal();
+	if (!portal) 
+		return false;
+	
+	string q;					// try to get the tile from databatase
+	q ="SELECT * FROM " + params_.fileName_ + " WHERE block_id='" + index + "'";
+
+	if (!portal->query(q))		// error submting query 
+	{
+		delete portal;
+		return 0;
+	}
+	int band=0;
+	if (!portal->fetchRow())	// tile is not in the database
+	{
+		delete portal;
+		return 0;
+	}
+
+	unsigned char*  memread_ptr = 0;
+	if(params_.compression_[band] != TeRasterParams::TeNoCompression)
+	{
+		if(!memAux_)
+		{
+			long size = params_.blockHeight_ * params_.blockWidth_ * params_.elementSize();
+			memAux_ = new unsigned char[size];
+		}
+		memread_ptr = memAux_;
+	}
+	else
+		memread_ptr = reinterpret_cast<unsigned char*>(block);
+
+	// tile is already in the database
+	unsigned long blobLen;
+	if (!portal->getRasterBlock(blobLen,memread_ptr))
+	{
+		delete portal;
+		return false;
+	}
+
+	// decompress blob into a tile (previously allocated) 
+	if (params_.compression_[band] == TeRasterParams::TeZLib)		// zlib compression
+	{
+		unsigned long blockLen = params_.blockHeight_ * params_.blockWidth_ * params_.elementSize();	// size after decompression
+		uncompress (reinterpret_cast<unsigned char*>(block),&blockLen,memread_ptr,blobLen);
+	}
+	else if (params_.compression_[band] == TeRasterParams::TeJpeg) //jpeg compression
+	{
+		int nb;
+		if (!Jpeg::DecompressBuffer(memAux_,blobLen,reinterpret_cast<unsigned char*>(block),params_.blockWidth_,params_.blockHeight_,nb))
+		{
+			delete portal;
+			return false;
+		}
+	}
+	delete portal;
+	return true;
+}
+
+bool 
+TeDecoderDatabase::putRasterBlock(const TeBlockIndex& index, void *block, long bsize)
+{
+	string index_str;
+	index_str = codifyId(index, params_.resolution_);
+	return putRasterBlock(index_str, block, bsize);
+}
+
+bool 
+TeDecoderDatabase::putRasterBlock(const string& index, void *block, long bsize)
+{
+	if (db_ == 0 || index.empty())
+		return false;
+
+	// decodify tile parameters from index
+	int res, subb, band, blin, bcol;
+	decodifyId(index,bcol,blin,band,res, subb);
+
+	// calculates the box coordinates of the tile
+	TeCoord2D llt(bcol, blin+params_.blockHeight_-1);
+	TeCoord2D urt(bcol+params_.blockWidth_-1, blin);
+	TeCoord2D ll = params_.index2Coord(llt);
+	TeCoord2D ur = params_.index2Coord(urt);
+
+	TeBox blockbb(ll.x()-params_.resx_/2.,ll.y()-params_.resy_/2.,ur.x()+params_.resx_/2.,ur.y()+params_.resy_/2.);
+	bool status;
+
+	// verify compression option
+	if (params_.compression_[band] == TeRasterParams::TeNoCompression)
+	{
+		status = db_->insertRasterBlock(params_.fileName_,index,blockbb.lowerLeft(),blockbb.upperRight(),reinterpret_cast<unsigned char*>(block),bsize,band,res,subb);
+		return status;
+	}
+	unsigned long finalsize = bsize;  // final size after compression
+	if (!memAux_)
+	{
+		long size = params_.blockHeight_ * params_.blockWidth_ * params_.elementSize();
+		memAux_ = new unsigned char[int(size*1.1 + 12.)];
+	}
+	if (params_.compression_[band] == TeRasterParams::TeZLib)		// ZLib compression
+	{
+		// zlib needs some more space)
+		finalsize = (unsigned long)(bsize*1.1 + 12.);
+		compress (memAux_, &finalsize,reinterpret_cast<unsigned char*>(block),bsize);
+		return db_->insertRasterBlock(params_.fileName_,index,blockbb.lowerLeft(),blockbb.upperRight(),memAux_,finalsize,band,res,subb);
+	}
+	else if (params_.compression_[band] == TeRasterParams::TeJpeg)	// JPEG compression
+	{
+		int sizec = int(bsize*1.1 + 12.);
+		if (!Jpeg::CompressToBuffer(reinterpret_cast<unsigned char*>(block),params_.blockWidth_,params_.blockHeight_,1,memAux_,sizec,75))
+			return false;
+		finalsize = sizec;
+		return db_->insertRasterBlock(params_.fileName_,index,blockbb.lowerLeft(),blockbb.upperRight(),memAux_,finalsize,band,res,subb);
+	}
+	return false;
+}
+
+bool
+TeDecoderDatabase::saveLUTTable()
+{
+	if (params_.lutName_.empty())
+		return false;
+	if (!db_ || !db_->createLUTTable(params_.lutName_))
+		return false;
+	for (unsigned int i=0; i<params_.lutb_.size(); i++)
+	{
+		string sql = "INSERT INTO " + params_.lutName_ + " VALUES(";
+		sql += Te2String(i) + ", ";
+		sql += Te2String(params_.lutr_[i]) + ", ";
+		sql += Te2String(params_.lutg_[i]) + ", ";
+		sql += Te2String(params_.lutb_[i]) + ", '";
+		sql += params_.lutClassName_[i] + "')";
+		if (!db_->execute(sql))
+			return false;
+	}
+	return true;
+}
+
+bool
+TeDecoderDatabase::selectBlocks(TeBox& bb, int resFac, TeRasterParams& parBlock)  
+{ 
+	if (!db_)
+		return false;
+
+	if (blockPortal_)
+		delete blockPortal_;
+
+	blockPortal_ = db_->getPortal();
+	if (!blockPortal_)
+		return false;
+
+	string sql;
+	string sel = db_->getSQLBoxSelect(params_.fileName_, TeRASTER);
+	string where = db_->getSQLBoxWhere (bb, TeRASTER, params_.fileName_);
+
+	sql = "SELECT "+ sel;
+	sql += " FROM " + params_.fileName_;
+	sql += " WHERE " + where + " AND resolution_factor = " + Te2String(resFac);
+	sql += " ORDER BY lower_x, lower_y, upper_x, upper_y, block_id";
+	
+	if (!blockPortal_->query(sql))
+	{
+		delete blockPortal_;
+		blockPortal_ = 0;
+		return false;
+	}
+	nSelectedBlocks_ = blockPortal_->numRows();
+	parBlock.projection(params_.projection());
+	parBlock.resx_ = params_.resx_*resFac;
+	parBlock.resy_ = params_.resy_*resFac;
+	parBlock.nlines_ = params_.blockHeight_;
+	parBlock.ncols_= params_.blockWidth_;
+	parBlock.nBands(params_.nBands());
+	parBlock.dataType_ = params_.dataType_;
+	parBlock.dummy_ = params_.dummy_;
+	parBlock.useDummy_ = params_.useDummy_;
+	parBlock.photometric_ = params_.photometric_;
+	parBlock.vmax_ = params_.vmax_;
+	parBlock.vmin_ = params_.vmin_;
+	parBlock.lutr_ = params_.lutr_;
+	parBlock.lutg_ = params_.lutg_;
+	parBlock.lutb_ = params_.lutb_;
+	parBlock.interleaving_ = TeRasterParams::TePerBand;
+	return blockPortal_->fetchRow();
+}
+
+bool
+TeDecoderDatabase::selectBlocks(TeBox& bb, int resFac, TeRasterParams& parBlock, const std::string& blockId)  
+{ 
+	if (!db_)
+		return false;
+
+	if (blockPortal_)
+		delete blockPortal_;
+
+	blockPortal_ = db_->getPortal();
+	if (!blockPortal_)
+		return false;
+
+	string sql;
+	string sel = db_->getSQLBoxSelect(params_.fileName_, TeRASTER);
+	string where = db_->getSQLBoxWhere (bb, TeRASTER, params_.fileName_);
+
+	sql = "SELECT "+ sel;
+	sql += " FROM " + params_.fileName_;
+	sql += " WHERE " + where + " AND resolution_factor = " + Te2String(resFac);
+
+	if(!blockId.empty())
+	{
+		sql += " AND block_id = '" + blockId + "'";
+	}
+
+	sql += " ORDER BY lower_x, lower_y, upper_x, upper_y, block_id";
+	
+	if (!blockPortal_->query(sql))
+	{
+		delete blockPortal_;
+		blockPortal_ = 0;
+		return false;
+	}
+	nSelectedBlocks_ = blockPortal_->numRows();
+	parBlock.projection(params_.projection());
+	parBlock.resx_ = params_.resx_*resFac;
+	parBlock.resy_ = params_.resy_*resFac;
+	parBlock.nlines_ = params_.blockHeight_;
+	parBlock.ncols_= params_.blockWidth_;
+	parBlock.nBands(params_.nBands());
+	parBlock.dataType_ = params_.dataType_;
+	parBlock.dummy_ = params_.dummy_;
+	parBlock.useDummy_ = params_.useDummy_;
+	parBlock.photometric_ = params_.photometric_;
+	parBlock.vmax_ = params_.vmax_;
+	parBlock.vmin_ = params_.vmin_;
+	parBlock.lutr_ = params_.lutr_;
+	parBlock.lutg_ = params_.lutg_;
+	parBlock.lutb_ = params_.lutb_;
+	parBlock.interleaving_ = TeRasterParams::TePerBand;
+	return blockPortal_->fetchRow();
+}
+
+bool
+TeDecoderDatabase::getSelectedRasterBlock(TeDecoderMemory* memDec) 
+{ 
+	if (!blockPortal_)
+		return 0;
+	unsigned long srcLen;
+	int i = 0;
+
+	if (!memAux_ )
+	{
+		long size = params_.blockHeight_ * params_.blockWidth_ * params_.elementSize();
+		memAux_ = new unsigned char[size];
+	}
+	int res;
+	TeBox bbBlock;
+	string blockId;
+	do
+	{
+		double lx = 0;
+		double ly = 0;
+		double ux = 0;
+		double uy = 0; 
+		lx = blockPortal_->getDouble("lower_x");
+		ly = blockPortal_->getDouble("lower_y");
+		ux = blockPortal_->getDouble("upper_x");
+		uy = blockPortal_->getDouble("upper_y");
+
+		bbBlock = TeBox(lx, ly, ux, uy);
+
+		blockId = blockPortal_->getData("block_id");
+		res = blockPortal_->getInt("resolution_factor");
+
+	int banda;
+    if(params_.nBands() > 1)
+    {
+		  int col, lin, res, subb;
+		  this->decodifyId(blockId, col, lin, banda, res, subb);
+    }
+	else
+      banda = 0;
+    
+	if (params_.compression_[banda] == TeRasterParams::TeNoCompression)
+		  blockPortal_->getRasterBlock(srcLen, reinterpret_cast<unsigned char*>(memDec->data(banda)));
+    else
+    {
+		blockPortal_->getRasterBlock(srcLen,memAux_);
+
+		if (params_.compression_[banda] == TeRasterParams::TeZLib)
+		{
+			TeRasterParams& par = memDec->params();
+			unsigned long destLen = par.ncols_ * par.nlines_ * par.elementSize();
+			int status;
+			status = uncompress (reinterpret_cast<unsigned char*>(memDec->data(banda)),&destLen,memAux_,srcLen);
+		}
+		else if (params_.compression_[banda] == TeRasterParams::TeJpeg)
+		{
+			int nb = 1;
+			Jpeg::DecompressBuffer(memAux_,srcLen,reinterpret_cast<unsigned char*>(memDec->data(banda)),params_.blockWidth_,params_.blockHeight_,nb);
+		}
+    }
+		i++;
+	}while (i<params_.nBands() && blockPortal_->fetchRow());
+	
+	memDec->params().boundingBoxResolution(bbBlock.x1(),bbBlock.y1(),bbBlock.x2(),bbBlock.y2(),
+		                                   params_.resx_*res,params_.resy_*res);
+	memDec->params().blockId_ = blockId;
+	return blockPortal_->fetchRow();
+}
+
+void
+TeDecoderDatabase::clearBlockSelection() 
+{
+	if (blockPortal_)
+		delete blockPortal_;
+	blockPortal_ = 0;
+	nSelectedBlocks_ = 0;
+}
+
+int 
+TeDecoderDatabase::bestResolution(TeBox& bb, int ncols, int nlines, TeProjection* proj)
+{
+	TeBox box = bb;
+	if (proj)
+		box = TeRemapBox(bb, proj, params_.projection());
+	
+	double resx = box.width()/ncols;
+	double resy = box.height()/nlines;
+	
+	double auxx = resx/params_.resx_;
+	double auxy = resy/params_.resy_;
+
+	int aux = (int) (min(auxx,auxy));
+
+	string sql = "SELECT resolution_factor FROM " + params_.fileName_;
+	sql += " WHERE resolution_factor <= " + Te2String(aux) + " ORDER BY resolution_factor DESC";
+
+	TeDatabasePortal* portal = params_.database_->getPortal();
+	if (!portal)
+		return 1;
+
+	if (!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return 1;
+	}
+
+	int res = atoi(portal->getData(0));
+	delete portal;
+	return res;
+}
+
+
diff --git a/src/terralib/kernel/TeDecoderDatabase.h b/src/terralib/kernel/TeDecoderDatabase.h
old mode 100755
new mode 100644
index b7e67d5..cdbe80b
--- a/src/terralib/kernel/TeDecoderDatabase.h
+++ b/src/terralib/kernel/TeDecoderDatabase.h
@@ -1,158 +1,168 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderDatabase.h
-    \brief This file deals with decoding of raster structures stored in a TerraLib database
-*/
-
-#ifndef  __TERRALIB_INTERNAL_DECODERDATADASE_H
-#define  __TERRALIB_INTERNAL_DECODERDATABASE_H
-
-#include "TeDefines.h"
-#include "TeDecoderVirtualMemory.h"
-#include "TeDatabase.h"
-
-//! A concrete class to manipulate raster data stored in a TerraLib database
-/*
-	TeDecoderDatabase uses a virtual memory, to handle the raster blocks 
-	(as proposed by the TerraLib data model to store raster data) traffic from
-	memory to database and vice versa.
-
-	\sa TeDatabase TeDecoderVirtualMemory
-*/
-class TL_DLL TeDecoderDatabase: public TeDecoderVirtualMemory
-{
-public:
-	//! Empty constructor
-	TeDecoderDatabase() :
-		db_(0),	
-		blockPortal_(0),
-		memAux_(0),
-		nSelectedBlocks_(0)
-	{	params_.decoderIdentifier_ = "DB"; }
-
-	//! Constructor from parameters
-	TeDecoderDatabase( const TeRasterParams& par );
-
-	//! Destructor
-	~TeDecoderDatabase();
-
-	//! Sets the database pointer associated to this decoder
-	void setDB (TeDatabase* db) 
-	{ db_ = db; }
-
-	//! Initializes the decoder
-	virtual void init();
-
-	//! Creates the decoder
-	virtual bool create();
-
-	//! Clears the decoder
-	virtual bool clear();
-
-	//! Gets the raster block with index identifier
-	/*!
-		\param index tile unique identifier
-		\param buf pointer to a raster tile in memory
-	*/
-	bool getRasterBlock(const string& index, void *buf);
-
-	//! Saves a raster tile from a virtual memory to permanent storage
-	/*! 
-	    \param index tile unique identifier 
-		\param buf pointer to a raster tile in memory
-		\param bsize size of the block in bytes
-	*/	
-	bool putRasterBlock(const string& index, void *buf, long bsize);
-
-	//! Codifiy the index for the block that contains an element
-	string codifyId(int col, int lin, int band, int res, int subb);
-
-	//! Decodify the parameters of the block that has an index 
-	void decodifyId(const string& id, int& col,int& lin, int& band, int& res, int& subb);
-
-
-	//! Saves the lut table of the raster associated to this decoder
-	bool saveLUTTable();
-
-	//! Search for tiles of image that intersects a certain bounding box in a given resolution
-	/* 
-		\param bb bounding box that should be filled
-		\param resFac resolution factor that identify a level of resolution
-		\param parBlock returns the basic parameters  of the selected tiles
-		\note Resolution factor in decoder database is a multiplier of the original resolution
-		and assume integer multiples of two. Smaller resolution has resolution factor
-		of 1 and the higher resolution have multiple of two values (2,4,8, 16...)
-	*/
-	int bestResolution(TeBox& bb, int ncols, int nlines, TeProjection* proj);
-
-	//! Select the stored raster blocks with a certain resolution to fill a given bounding box
-	/*
-		\param bb bounding box that should be filled 
-		\param the resolution factor desired
-		\param parBlock common parameters of the blocks selected
-		\returns TRUE if could select at least one block and FALSE otherwise
-	*/
-	bool selectBlocks(TeBox& bb, int resFac, TeRasterParams& parBlock);
-
-	//! Gets current raster block an outputs it in a memory decoder
-	bool getSelectedRasterBlock(TeDecoderMemory* memDec);
-
-	//! Clears selected blocks portal
-	void clearBlockSelection();
-
-	//! Returns the number of selectd raster blocks
-	int numberOfSelectedBlocks()
-	{	return nSelectedBlocks_; }
-
-	//! Decodifies the position of a block within the raster from its index
-	virtual void blockIndexPos( const TeBlockIndex& index, int& ulCol, int& ulLin, int& band); 
-
-protected:
-
-	virtual TeBlockIndex blockIndex(int col, int lin, int band);  
-	virtual string codifyId(const TeBlockIndex& idx, int res = 1, int subb = 0); 
-
-	bool getRasterBlock(const TeBlockIndex& index, void *buf);
-	bool putRasterBlock(const TeBlockIndex& index, void *buf, long bsize);
-
-private:
-	TeDatabase			*db_;
-	TeDatabasePortal	*blockPortal_;
-	unsigned char		*memAux_;
-	int					nSelectedBlocks_;
-};
-
-//! Implements a factory to build database decoders
-class TL_DLL TeDecoderDatabaseFactory : public TeDecoderFactory
-{
-public:
-
-	//! Constructor
-	TeDecoderDatabaseFactory(const string& name) : TeDecoderFactory(name) {}
-
-	//! Builds a database decoder
-	virtual TeDecoder* build (const TeRasterParams& arg)
-	{  return new TeDecoderDatabase(arg); }
-};
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderDatabase.h
+    \brief This file deals with decoding of raster structures stored in a TerraLib database
+*/
+
+#ifndef  __TERRALIB_INTERNAL_DECODERDATADASE_H
+#define  __TERRALIB_INTERNAL_DECODERDATABASE_H
+
+#include "TeDefines.h"
+#include "TeDecoderVirtualMemory.h"
+#include "TeDatabase.h"
+
+//! A concrete class to manipulate raster data stored in a TerraLib database
+/*
+	TeDecoderDatabase uses a virtual memory, to handle the raster blocks 
+	(as proposed by the TerraLib data model to store raster data) traffic from
+	memory to database and vice versa.
+
+	\sa TeDatabase TeDecoderVirtualMemory
+*/
+class TL_DLL TeDecoderDatabase: public TeDecoderVirtualMemory
+{
+public:
+	//! Empty constructor
+	TeDecoderDatabase() :
+		db_(0),	
+		blockPortal_(0),
+		memAux_(0),
+		nSelectedBlocks_(0)
+	{	params_.decoderIdentifier_ = "DB"; }
+
+	//! Constructor from parameters
+	TeDecoderDatabase( const TeRasterParams& par );
+
+	//! Destructor
+	~TeDecoderDatabase();
+
+	//! Sets the database pointer associated to this decoder
+	void setDB (TeDatabase* db) 
+	{ db_ = db; }
+
+	//! Initializes the decoder
+	virtual void init();
+
+	//! Creates the decoder
+	virtual bool create();
+
+	//! Clears the decoder
+	virtual bool clear();
+
+	//! Gets the raster block with index identifier
+	/*!
+		\param index tile unique identifier
+		\param buf pointer to a raster tile in memory
+	*/
+	bool getRasterBlock(const string& index, void *buf);
+
+	//! Saves a raster tile from a virtual memory to permanent storage
+	/*! 
+	    \param index tile unique identifier 
+		\param buf pointer to a raster tile in memory
+		\param bsize size of the block in bytes
+	*/	
+	bool putRasterBlock(const string& index, void *buf, long bsize);
+
+	//! Codifiy the index for the block that contains an element
+	string codifyId(int col, int lin, int band, int res, int subb);
+
+	//! Decodify the parameters of the block that has an index 
+	void decodifyId(const string& id, int& col,int& lin, int& band, int& res, int& subb);
+
+
+	//! Saves the lut table of the raster associated to this decoder
+	bool saveLUTTable();
+
+	//! Search for tiles of image that intersects a certain bounding box in a given resolution
+	/* 
+		\param bb bounding box that should be filled
+		\param resFac resolution factor that identify a level of resolution
+		\param parBlock returns the basic parameters  of the selected tiles
+		\note Resolution factor in decoder database is a multiplier of the original resolution
+		and assume integer multiples of two. Smaller resolution has resolution factor
+		of 1 and the higher resolution have multiple of two values (2,4,8, 16...)
+	*/
+	int bestResolution(TeBox& bb, int ncols, int nlines, TeProjection* proj);
+
+	//! Select the stored raster blocks with a certain resolution to fill a given bounding box
+	/*
+		\param bb bounding box that should be filled 
+		\param the resolution factor desired
+		\param parBlock common parameters of the blocks selected
+		\returns TRUE if could select at least one block and FALSE otherwise
+	*/
+	bool selectBlocks(TeBox& bb, int resFac, TeRasterParams& parBlock);
+
+	//! Select the stored raster blocks with a certain resolution to fill a given bounding box
+	/*
+		\param bb bounding box that should be filled 
+		\param the resolution factor desired
+		\param parBlock common parameters of the blocks selected
+		\param blockId to select a just one block in database
+		\returns TRUE if could select at least one block and FALSE otherwise
+	*/
+	bool selectBlocks(TeBox& bb, int resFac, TeRasterParams& parBlock, const std::string& blockId);
+
+	//! Gets current raster block an outputs it in a memory decoder
+	bool getSelectedRasterBlock(TeDecoderMemory* memDec);
+
+	//! Clears selected blocks portal
+	void clearBlockSelection();
+
+	//! Returns the number of selectd raster blocks
+	int numberOfSelectedBlocks()
+	{	return nSelectedBlocks_; }
+
+	//! Decodifies the position of a block within the raster from its index
+	virtual void blockIndexPos( const TeBlockIndex& index, int& ulCol, int& ulLin, int& band); 
+
+protected:
+
+	virtual TeBlockIndex blockIndex(int col, int lin, int band);  
+	virtual string codifyId(const TeBlockIndex& idx, int res = 1, int subb = 0); 
+
+	bool getRasterBlock(const TeBlockIndex& index, void *buf);
+	bool putRasterBlock(const TeBlockIndex& index, void *buf, long bsize);
+
+private:
+	TeDatabase			*db_;
+	TeDatabasePortal	*blockPortal_;
+	unsigned char		*memAux_;
+	int					nSelectedBlocks_;
+};
+
+//! Implements a factory to build database decoders
+class TL_DLL TeDecoderDatabaseFactory : public TeDecoderFactory
+{
+public:
+
+	//! Constructor
+	TeDecoderDatabaseFactory(const string& name) : TeDecoderFactory(name) {}
+
+	//! Builds a database decoder
+	virtual TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeDecoderDatabase(arg); }
+};
+#endif
+
diff --git a/src/terralib/kernel/TeDecoderFile.cpp b/src/terralib/kernel/TeDecoderFile.cpp
old mode 100755
new mode 100644
index b1b0f61..f8e5589
--- a/src/terralib/kernel/TeDecoderFile.cpp
+++ b/src/terralib/kernel/TeDecoderFile.cpp
@@ -1,361 +1,361 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <TeDecoderFile.h>
-
-#ifdef WIN32
-
-TeDecoderFile::TeDecoderFile ( const TeRasterParams& par )
-{
-	params_ = par;
-	dataInitPos_ = 0;
-	dataInitPos_ = par.offset_;
-	m_dwPosition = 0;
-	m_dwWordSize = params_.elementSize();
-	params_.blockHeight_ = 1;
-	params_.blockWidth_ = params_.ncols_;
-	params_.decoderIdentifier_ = "RAW";
-}
-
-TeDecoderFile::~TeDecoderFile ()
-{
-	if (m_hFile != NULL)
-		clear();
-}
-
-void
-TeDecoderFile::init()
-{
-	clear();
-
-	// First open the file
-	m_hFile = CreateFileA(
-		params_.fileName_.c_str(),	// File name
-		GENERIC_READ | GENERIC_WRITE,	// Read-write
-		FILE_SHARE_READ
-		| FILE_SHARE_WRITE,		// Allow sharing-- we're only doing a quick scan
-		NULL,					// No security attributes
-		OPEN_EXISTING,			// Only open an existing file
-		0,						// Ignore file attributes
-		NULL);					// Ignore hTemplateFile
-
-	if (m_hFile == INVALID_HANDLE_VALUE) 
-			return ;		// could not open file
-
-// Get the file's size
-	m_dwSize = GetFileSize(m_hFile, NULL);
-	if (m_dwSize == 0xffffffff)
-	{
-		m_hFile = NULL;
-		return ;
-	}
-
-// Allocate buffer to get raster line from file
-
-	long mBufferSize = params_.ncols_;
-	if (params_.interleaving_ == TeRasterParams::TePerPixel)
-		mBufferSize *= params_.nBands();
-
-	switch (params_.dataType_[0]) {
-	case (TeUNSIGNEDCHAR):
-		m_buffer = new unsigned char[mBufferSize];
-		break;
-	case (TeCHAR) :
-		m_buffer = new char[mBufferSize];
-		break;
-	case (TeUNSIGNEDSHORT):
-		m_buffer = new unsigned short[mBufferSize];
-		break;
-	case (TeSHORT):
-		m_buffer = new short[mBufferSize];
-		break;
-	case (TeUNSIGNEDLONG):
-		m_buffer = new unsigned long[mBufferSize];
-		break;
-	case (TeLONG):
-		m_buffer = new long[mBufferSize];
-		break;
-	case (TeFLOAT):
-		m_buffer = new float[mBufferSize];
-		break;
-	case (TeDOUBLE):
-		m_buffer = new double[mBufferSize];
-		break;
-	}
-	if ( m_buffer == NULL )
-		return ;
-	else
-		return ;
-		
-}
-
-bool
-TeDecoderFile::create()
-{
-	m_hFile = CreateFileA(
-		params_.fileName_.c_str(),	// File name
-		GENERIC_READ | GENERIC_WRITE,	// Read-write
-		FILE_SHARE_READ
-		| FILE_SHARE_WRITE,		// Allow sharing-- we're only doing a quick scan
-		NULL,					// No security attributes
-		CREATE_NEW,			    // Open a new file
-		0,						// Ignore file attributes
-		NULL);					// Ignore hTemplateFile
-  
-	if ( m_hFile == INVALID_HANDLE_VALUE) 
-		return false;		// could not open file
-
-	char			lpBuffer[1024];
-	unsigned long	nNumberOfBytesToWrite=(long)params_.nBands() * (long)params_.ncols_ * (long)params_.nlines_;    // number of bytes to write
-	nNumberOfBytesToWrite *= (long)params_.nbitsperPixel_[0]/8;    // number of bytes to write
-	unsigned long	nNumberOfBytesWritten;  // pointer to number of bytes written
-
-	for (;nNumberOfBytesToWrite > 1024; nNumberOfBytesToWrite-=1024)
-	{
-		if ( !WriteFile(
-			m_hFile,                // handle to file to write to
-			lpBuffer,               // pointer to data to write to file
-			1024,					// number of bytes to write
-			&nNumberOfBytesWritten,  // pointer to number of bytes written
-			NULL					// pointer to structure for overlapped I/O
-			))
- 			return false;			// could not write to file
-	}
-
-	if ( !WriteFile(
-		m_hFile,                // handle to file to write to
-		lpBuffer,               // pointer to data to write to file
-		nNumberOfBytesToWrite,	// number of bytes to write
-		&nNumberOfBytesWritten,  // pointer to number of bytes written
-		NULL					// pointer to structure for overlapped I/O
-		))
- 		return false;			// could not write to file
-	
-	SetFilePointer (m_hFile, NULL, NULL, FILE_BEGIN);
-
-// Allocate buffer to get raster line from file
-
-	switch (params_.dataType_[0]) {
-	case (TeUNSIGNEDCHAR):
-		m_buffer = new unsigned char[params_.ncols_];
-		break;
-	case (TeCHAR) :
-		m_buffer = new char[params_.ncols_];
-		break;
-	case (TeUNSIGNEDSHORT):
-		m_buffer = new unsigned short[params_.ncols_];
-		break;
-	case (TeSHORT):
-		m_buffer = new short[params_.ncols_];
-		break;
-	case (TeUNSIGNEDLONG):
-		m_buffer = new unsigned long[params_.ncols_];
-		break;
-	case (TeLONG):
-		m_buffer = new long[params_.ncols_];
-		break;
-	case (TeFLOAT):
-		m_buffer = new float[params_.ncols_];
-		break;
-	case (TeDOUBLE):
-		m_buffer = new double[params_.ncols_];
-		break;
-	}
-
-	if ( m_buffer == NULL )
-		return false;
-
-	if (params_.dummy_[0])
-	{
-		for (int b=0; b<params_.nBands();b++)
-			for (int l=0; l<params_.nlines_;l++)
-				for (int c=0; c<params_.ncols_;c++)
-					setElement ( c, l, params_.dummy_[0], b);
-	}
-	return true;
-}
-
-bool
-TeDecoderFile::clear()
-{
-	if (!m_hFile)
-		return true;
-
-	CloseHandle(m_hFile);
-	m_hFile = NULL;
-	delete m_buffer;
-	m_buffer = 0;
-	params_.status_ = TeRasterParams::TeNotReady;
-	return true;
-}
-
-
-bool
-TeDecoderFile::getRasterBlock(const TeBlockIndex& index, void *buf)
-{   
-	int ulCol, ulLin, band;
-        blockIndexPos(index, ulCol, ulLin, band);
-
-	int nb = params_.nBands();
-	DWORD position;
-	DWORD nBytesToRead;
-	int inc, inic;
-	if (params_.interleaving_ == TeRasterParams::TePerPixel)
-	{
-		inc = nb;
-		inic = index.band();
-		position = dataInitPos_ + params_.ncols_*(nb* ulLin);
-		nBytesToRead = m_dwWordSize*params_.ncols_*nb;
-	}
-	else
-	{
-		inc = 1;
-		inic = 0;
-		position = dataInitPos_ + params_.ncols_*(nb*ulLin + band);
-		nBytesToRead = m_dwWordSize*params_.ncols_;
-	}
-	DWORD diff = position - m_dwPosition;
-	if (diff != 0)
-		m_dwPosition = SetFilePointer (m_hFile, diff, NULL, FILE_CURRENT);
-	unsigned long nBytesRead;
-	if (!ReadFile(m_hFile, m_buffer, nBytesToRead, &nBytesRead, NULL))
-		return false;
-	m_dwPosition += nBytesRead;
-
-	int i,n;
-	switch (params_.dataType_[0]) 
-	{
-	case (TeUNSIGNEDCHAR):
-		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
-			((unsigned char*)buf)[n] = ((unsigned char*)m_buffer)[i];
-		break;
-	case (TeCHAR) :
-		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
-			((char*)buf)[n] = ((char*)m_buffer)[i];
-		break;
-	case (TeUNSIGNEDSHORT):
-		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
-			((unsigned short*)buf)[n] = ((unsigned short*)m_buffer)[i];
-		break;
-	case (TeSHORT):
-		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
-			((short*)buf)[n] = ((short*)m_buffer)[i];
-		break;
-	case (TeUNSIGNEDLONG):
-		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
-			((unsigned long*)buf)[n] = ((unsigned long*)m_buffer)[i];
-		break;
-	case (TeLONG):
-		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
-			((long*)buf)[n] = ((long*)m_buffer)[i];
-		break;
-	case (TeFLOAT):
-		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
-			((float*)buf)[n] = ((float*)m_buffer)[i];
-		break;
-	case (TeDOUBLE):
-		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
-			((double*)buf)[n] = ((double*)m_buffer)[i];
-		break;
-	}
-
-	return true;
-}
-
-
-
-bool 
-TeDecoderFile::putRasterBlock(const TeBlockIndex& index, void *buf, long bsize)
-{
-	int band,ulCol,ulLin;
-  blockIndexPos(index, ulCol, ulLin, band);
-
-	DWORD position = dataInitPos_ + params_.ncols_*(params_.nBands()*ulLin + band);
-	DWORD diff = position - m_dwPosition;
-	if (diff != 0)
-		SetFilePointer (m_hFile, diff, NULL, FILE_CURRENT);
-	DWORD nBytesToWrite = m_dwWordSize*params_.ncols_,
-		nBytesWritten;
-	int i;
-	switch (params_.dataType_[0]) 
-	{
-	case (TeUNSIGNEDCHAR):
-		for (i=0;i<params_.ncols_;i++)
-			((unsigned char*)m_buffer)[i] = ((unsigned char*)buf)[i];
-		break;
-	case (TeCHAR) :
-		for (i=0;i<params_.ncols_;i++)
-			((char*)m_buffer)[i] = ((char*)buf)[i];
-		break;
-	case (TeUNSIGNEDSHORT):
-		for (i=0;i<params_.ncols_;i++)
-			((unsigned short*)m_buffer)[i] = ((unsigned short*)buf)[i];
-		break;
-	case (TeSHORT):
-		for (i=0;i<params_.ncols_;i++)
-			((short*)m_buffer)[i] = ((short*)buf)[i];
-		break;
-	case (TeUNSIGNEDLONG):
-		for (i=0;i<params_.ncols_;i++)
-			((unsigned long*)m_buffer)[i] = ((unsigned long*)buf)[i];
-		break;
-	case (TeLONG):
-		for (i=0;i<params_.ncols_;i++)
-			((long*)m_buffer)[i] = ((long*)buf)[i];
-		break;
-	case (TeFLOAT):
-		for (i=0;i<params_.ncols_;i++)
-			((float*)m_buffer)[i] = ((float*)buf)[i];
-		break;
-	case (TeDOUBLE):
-		memcpy (m_buffer,buf,params_.ncols_);
-		break;
-	}
-
-	if (!WriteFile(m_hFile, m_buffer, nBytesToWrite, &nBytesWritten, NULL))
-		return false;
-
-	m_dwPosition += nBytesWritten;
-
-	return true;
-}
-
-TeBlockIndex TeDecoderFile::blockIndex(int col, int lin, int band)
-{
-  TeBlockIndex bl_index;
-
-  bl_index.band_ = band;
-  bl_index.lin_ = lin;
-  bl_index.col_ = 0;
-
-  return bl_index;
-}
-
-void TeDecoderFile::blockIndexPos(const TeBlockIndex& index, int& ulCol, int& ulLin, int& band)
-{
-  ulCol = 0;
-  ulLin = index.line() * params_.blockWidth_;
-  band = index.band();
-}
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <TeDecoderFile.h>
+
+#ifdef WIN32
+
+TeDecoderFile::TeDecoderFile ( const TeRasterParams& par )
+{
+	params_ = par;
+	dataInitPos_ = 0;
+	dataInitPos_ = par.offset_;
+	m_dwPosition = 0;
+	m_dwWordSize = params_.elementSize();
+	params_.blockHeight_ = 1;
+	params_.blockWidth_ = params_.ncols_;
+	params_.decoderIdentifier_ = "RAW";
+}
+
+TeDecoderFile::~TeDecoderFile ()
+{
+	if (m_hFile != NULL)
+		clear();
+}
+
+void
+TeDecoderFile::init()
+{
+	clear();
+
+	// First open the file
+	m_hFile = CreateFileA(
+		params_.fileName_.c_str(),	// File name
+		GENERIC_READ | GENERIC_WRITE,	// Read-write
+		FILE_SHARE_READ
+		| FILE_SHARE_WRITE,		// Allow sharing-- we're only doing a quick scan
+		NULL,					// No security attributes
+		OPEN_EXISTING,			// Only open an existing file
+		0,						// Ignore file attributes
+		NULL);					// Ignore hTemplateFile
+
+	if (m_hFile == INVALID_HANDLE_VALUE) 
+			return ;		// could not open file
+
+// Get the file's size
+	m_dwSize = GetFileSize(m_hFile, NULL);
+	if (m_dwSize == 0xffffffff)
+	{
+		m_hFile = NULL;
+		return ;
+	}
+
+// Allocate buffer to get raster line from file
+
+	long mBufferSize = params_.ncols_;
+	if (params_.interleaving_ == TeRasterParams::TePerPixel)
+		mBufferSize *= params_.nBands();
+
+	switch (params_.dataType_[0]) {
+	case (TeUNSIGNEDCHAR):
+		m_buffer = new unsigned char[mBufferSize];
+		break;
+	case (TeCHAR) :
+		m_buffer = new char[mBufferSize];
+		break;
+	case (TeUNSIGNEDSHORT):
+		m_buffer = new unsigned short[mBufferSize];
+		break;
+	case (TeSHORT):
+		m_buffer = new short[mBufferSize];
+		break;
+	case (TeUNSIGNEDLONG):
+		m_buffer = new unsigned long[mBufferSize];
+		break;
+	case (TeLONG):
+		m_buffer = new long[mBufferSize];
+		break;
+	case (TeFLOAT):
+		m_buffer = new float[mBufferSize];
+		break;
+	case (TeDOUBLE):
+		m_buffer = new double[mBufferSize];
+		break;
+	}
+	if ( m_buffer == NULL )
+		return ;
+	else
+		return ;
+		
+}
+
+bool
+TeDecoderFile::create()
+{
+	m_hFile = CreateFileA(
+		params_.fileName_.c_str(),	// File name
+		GENERIC_READ | GENERIC_WRITE,	// Read-write
+		FILE_SHARE_READ
+		| FILE_SHARE_WRITE,		// Allow sharing-- we're only doing a quick scan
+		NULL,					// No security attributes
+		CREATE_NEW,			    // Open a new file
+		0,						// Ignore file attributes
+		NULL);					// Ignore hTemplateFile
+  
+	if ( m_hFile == INVALID_HANDLE_VALUE) 
+		return false;		// could not open file
+
+	char			lpBuffer[1024];
+	unsigned long	nNumberOfBytesToWrite=(long)params_.nBands() * (long)params_.ncols_ * (long)params_.nlines_;    // number of bytes to write
+	nNumberOfBytesToWrite *= (long)params_.nbitsperPixel_[0]/8;    // number of bytes to write
+	unsigned long	nNumberOfBytesWritten;  // pointer to number of bytes written
+
+	for (;nNumberOfBytesToWrite > 1024; nNumberOfBytesToWrite-=1024)
+	{
+		if ( !WriteFile(
+			m_hFile,                // handle to file to write to
+			lpBuffer,               // pointer to data to write to file
+			1024,					// number of bytes to write
+			&nNumberOfBytesWritten,  // pointer to number of bytes written
+			NULL					// pointer to structure for overlapped I/O
+			))
+ 			return false;			// could not write to file
+	}
+
+	if ( !WriteFile(
+		m_hFile,                // handle to file to write to
+		lpBuffer,               // pointer to data to write to file
+		nNumberOfBytesToWrite,	// number of bytes to write
+		&nNumberOfBytesWritten,  // pointer to number of bytes written
+		NULL					// pointer to structure for overlapped I/O
+		))
+ 		return false;			// could not write to file
+	
+	SetFilePointer (m_hFile, NULL, NULL, FILE_BEGIN);
+
+// Allocate buffer to get raster line from file
+
+	switch (params_.dataType_[0]) {
+	case (TeUNSIGNEDCHAR):
+		m_buffer = new unsigned char[params_.ncols_];
+		break;
+	case (TeCHAR) :
+		m_buffer = new char[params_.ncols_];
+		break;
+	case (TeUNSIGNEDSHORT):
+		m_buffer = new unsigned short[params_.ncols_];
+		break;
+	case (TeSHORT):
+		m_buffer = new short[params_.ncols_];
+		break;
+	case (TeUNSIGNEDLONG):
+		m_buffer = new unsigned long[params_.ncols_];
+		break;
+	case (TeLONG):
+		m_buffer = new long[params_.ncols_];
+		break;
+	case (TeFLOAT):
+		m_buffer = new float[params_.ncols_];
+		break;
+	case (TeDOUBLE):
+		m_buffer = new double[params_.ncols_];
+		break;
+	}
+
+	if ( m_buffer == NULL )
+		return false;
+
+	if (params_.dummy_[0])
+	{
+		for (int b=0; b<params_.nBands();b++)
+			for (int l=0; l<params_.nlines_;l++)
+				for (int c=0; c<params_.ncols_;c++)
+					setElement ( c, l, params_.dummy_[0], b);
+	}
+	return true;
+}
+
+bool
+TeDecoderFile::clear()
+{
+	if (!m_hFile)
+		return true;
+
+	CloseHandle(m_hFile);
+	m_hFile = NULL;
+	delete m_buffer;
+	m_buffer = 0;
+	params_.status_ = TeRasterParams::TeNotReady;
+	return true;
+}
+
+
+bool
+TeDecoderFile::getRasterBlock(const TeBlockIndex& index, void *buf)
+{   
+	int ulCol, ulLin, band;
+        blockIndexPos(index, ulCol, ulLin, band);
+
+	int nb = params_.nBands();
+	DWORD position;
+	DWORD nBytesToRead;
+	int inc, inic;
+	if (params_.interleaving_ == TeRasterParams::TePerPixel)
+	{
+		inc = nb;
+		inic = index.band();
+		position = dataInitPos_ + params_.ncols_*(nb* ulLin);
+		nBytesToRead = m_dwWordSize*params_.ncols_*nb;
+	}
+	else
+	{
+		inc = 1;
+		inic = 0;
+		position = dataInitPos_ + params_.ncols_*(nb*ulLin + band);
+		nBytesToRead = m_dwWordSize*params_.ncols_;
+	}
+	DWORD diff = position - m_dwPosition;
+	if (diff != 0)
+		m_dwPosition = SetFilePointer (m_hFile, diff, NULL, FILE_CURRENT);
+	unsigned long nBytesRead;
+	if (!ReadFile(m_hFile, m_buffer, nBytesToRead, &nBytesRead, NULL))
+		return false;
+	m_dwPosition += nBytesRead;
+
+	int i,n;
+	switch (params_.dataType_[0]) 
+	{
+	case (TeUNSIGNEDCHAR):
+		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
+			((unsigned char*)buf)[n] = ((unsigned char*)m_buffer)[i];
+		break;
+	case (TeCHAR) :
+		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
+			((char*)buf)[n] = ((char*)m_buffer)[i];
+		break;
+	case (TeUNSIGNEDSHORT):
+		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
+			((unsigned short*)buf)[n] = ((unsigned short*)m_buffer)[i];
+		break;
+	case (TeSHORT):
+		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
+			((short*)buf)[n] = ((short*)m_buffer)[i];
+		break;
+	case (TeUNSIGNEDLONG):
+		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
+			((unsigned long*)buf)[n] = ((unsigned long*)m_buffer)[i];
+		break;
+	case (TeLONG):
+		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
+			((long*)buf)[n] = ((long*)m_buffer)[i];
+		break;
+	case (TeFLOAT):
+		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
+			((float*)buf)[n] = ((float*)m_buffer)[i];
+		break;
+	case (TeDOUBLE):
+		for (i=inic,n=0;i<params_.ncols_*nb;i+=inc, n++)
+			((double*)buf)[n] = ((double*)m_buffer)[i];
+		break;
+	}
+
+	return true;
+}
+
+
+
+bool 
+TeDecoderFile::putRasterBlock(const TeBlockIndex& index, void *buf, long bsize)
+{
+	int band,ulCol,ulLin;
+  blockIndexPos(index, ulCol, ulLin, band);
+
+	DWORD position = dataInitPos_ + params_.ncols_*(params_.nBands()*ulLin + band);
+	DWORD diff = position - m_dwPosition;
+	if (diff != 0)
+		SetFilePointer (m_hFile, diff, NULL, FILE_CURRENT);
+	DWORD nBytesToWrite = m_dwWordSize*params_.ncols_,
+		nBytesWritten;
+	int i;
+	switch (params_.dataType_[0]) 
+	{
+	case (TeUNSIGNEDCHAR):
+		for (i=0;i<params_.ncols_;i++)
+			((unsigned char*)m_buffer)[i] = ((unsigned char*)buf)[i];
+		break;
+	case (TeCHAR) :
+		for (i=0;i<params_.ncols_;i++)
+			((char*)m_buffer)[i] = ((char*)buf)[i];
+		break;
+	case (TeUNSIGNEDSHORT):
+		for (i=0;i<params_.ncols_;i++)
+			((unsigned short*)m_buffer)[i] = ((unsigned short*)buf)[i];
+		break;
+	case (TeSHORT):
+		for (i=0;i<params_.ncols_;i++)
+			((short*)m_buffer)[i] = ((short*)buf)[i];
+		break;
+	case (TeUNSIGNEDLONG):
+		for (i=0;i<params_.ncols_;i++)
+			((unsigned long*)m_buffer)[i] = ((unsigned long*)buf)[i];
+		break;
+	case (TeLONG):
+		for (i=0;i<params_.ncols_;i++)
+			((long*)m_buffer)[i] = ((long*)buf)[i];
+		break;
+	case (TeFLOAT):
+		for (i=0;i<params_.ncols_;i++)
+			((float*)m_buffer)[i] = ((float*)buf)[i];
+		break;
+	case (TeDOUBLE):
+		memcpy (m_buffer,buf,params_.ncols_);
+		break;
+	}
+
+	if (!WriteFile(m_hFile, m_buffer, nBytesToWrite, &nBytesWritten, NULL))
+		return false;
+
+	m_dwPosition += nBytesWritten;
+
+	return true;
+}
+
+TeBlockIndex TeDecoderFile::blockIndex(int col, int lin, int band)
+{
+  TeBlockIndex bl_index;
+
+  bl_index.band_ = band;
+  bl_index.lin_ = lin;
+  bl_index.col_ = 0;
+
+  return bl_index;
+}
+
+void TeDecoderFile::blockIndexPos(const TeBlockIndex& index, int& ulCol, int& ulLin, int& band)
+{
+  ulCol = 0;
+  ulLin = index.line() * params_.blockWidth_;
+  band = index.band();
+}
+
+#endif
diff --git a/src/terralib/kernel/TeDecoderFile.h b/src/terralib/kernel/TeDecoderFile.h
old mode 100755
new mode 100644
index d4f4afc..42988fc
--- a/src/terralib/kernel/TeDecoderFile.h
+++ b/src/terralib/kernel/TeDecoderFile.h
@@ -1,84 +1,84 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderFile.h
-    \brief This file deals with decoding of raster structures in a binary file using Windows support
-*/
-#ifndef  __TERRALIB_INTERNAL_DECODERFILE_H
-#define  __TERRALIB_INTERNAL_DECODERFILE_H
-
-#ifdef WIN32
-#include "TeDecoderVirtualMemory.h"
-#include <windows.h>
-#include <winbase.h>
-
-//! Implements decoder to raster data stored in a file in a binary raw format
-/*	\note This implementation is valid only for the windows platform
-*/
-class TL_DLL TeDecoderFile : public TeDecoderVirtualMemory
-{
-public:
-	//! Constructor
-	TeDecoderFile ( const TeRasterParams& );
-
-	//! Destructor
-	~TeDecoderFile ();
-
-	//! Initalizes its internal structures
-	void init	();
-
-	//! Created a handle
-	bool create	();
-
-	//! Releases the internal structures
-	bool clear	();
-
-protected:
-	bool	getRasterBlock(const TeBlockIndex& index, void *buf); 
-	bool	putRasterBlock(const TeBlockIndex& index, void *buf, long bsize);
-	TeBlockIndex blockIndex(int col, int lin, int band);
-	void blockIndexPos(const TeBlockIndex& index, int& ulCol, int& ulLin, int& band);
-	
-private:
-
-	unsigned long	dataInitPos_;
-	HANDLE  m_hFile;			// Handle to file we're currently zapping
-	LPVOID  m_buffer;			// Pointer to view of file mapped to memory
-	DWORD	m_dwSize;			// File size in bytes
-	DWORD	m_dwPosition;		// Current file pointer position
-	DWORD	m_dwWordSize;		// word size in bytes
-};
-
-//! Implements a factory to build file decoders
-class TL_DLL TeDecoderFileFactory : public TeDecoderFactory
-{
-public:
-
-	TeDecoderFileFactory(const string& name) : TeDecoderFactory(name) {}
-
-	//! Builds a file decoder
-	virtual TeDecoder* build (const TeRasterParams& arg)
-	{  return new TeDecoderFile(arg); }
-};
-
-#endif
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderFile.h
+    \brief This file deals with decoding of raster structures in a binary file using Windows support
+*/
+#ifndef  __TERRALIB_INTERNAL_DECODERFILE_H
+#define  __TERRALIB_INTERNAL_DECODERFILE_H
+
+#ifdef WIN32
+#include "TeDecoderVirtualMemory.h"
+#include <windows.h>
+#include <winbase.h>
+
+//! Implements decoder to raster data stored in a file in a binary raw format
+/*	\note This implementation is valid only for the windows platform
+*/
+class TL_DLL TeDecoderFile : public TeDecoderVirtualMemory
+{
+public:
+	//! Constructor
+	TeDecoderFile ( const TeRasterParams& );
+
+	//! Destructor
+	~TeDecoderFile ();
+
+	//! Initalizes its internal structures
+	void init	();
+
+	//! Created a handle
+	bool create	();
+
+	//! Releases the internal structures
+	bool clear	();
+
+protected:
+	bool	getRasterBlock(const TeBlockIndex& index, void *buf); 
+	bool	putRasterBlock(const TeBlockIndex& index, void *buf, long bsize);
+	TeBlockIndex blockIndex(int col, int lin, int band);
+	void blockIndexPos(const TeBlockIndex& index, int& ulCol, int& ulLin, int& band);
+	
+private:
+
+	unsigned long	dataInitPos_;
+	HANDLE  m_hFile;			// Handle to file we're currently zapping
+	LPVOID  m_buffer;			// Pointer to view of file mapped to memory
+	DWORD	m_dwSize;			// File size in bytes
+	DWORD	m_dwPosition;		// Current file pointer position
+	DWORD	m_dwWordSize;		// word size in bytes
+};
+
+//! Implements a factory to build file decoders
+class TL_DLL TeDecoderFileFactory : public TeDecoderFactory
+{
+public:
+
+	TeDecoderFileFactory(const string& name) : TeDecoderFactory(name) {}
+
+	//! Builds a file decoder
+	virtual TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeDecoderFile(arg); }
+};
+
+#endif
+#endif
diff --git a/src/terralib/kernel/TeDecoderJPEG.cpp b/src/terralib/kernel/TeDecoderJPEG.cpp
old mode 100755
new mode 100644
index 58a33a8..45201f6
--- a/src/terralib/kernel/TeDecoderJPEG.cpp
+++ b/src/terralib/kernel/TeDecoderJPEG.cpp
@@ -1,233 +1,247 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include <TeDecoderJPEG.h>
-#include <TeAsciiFile.h>
-#include <TeUtils.h>
-#include <TeLibJpegWrapper.h>
-
-#include <fstream>
-using std::ifstream;
-using std::ofstream;
-
-TeDecoderJPEG::TeDecoderJPEG():
-	isModified_(false),
-	size_(0),
-	myData_(0)
-{	
-	params_.decoderIdentifier_ = "JPEG";	
-}
-
-
-TeDecoderJPEG::TeDecoderJPEG (const TeRasterParams& par):
-	isModified_(false),
-	size_(0),
-	myData_(0)
-{	
-	params_ = par; 
-	params_.errorMessage_.clear();
-	// 'w' and 'r' modes suppose that the file already exists: try to read the basic information
-	if (params_.mode_ == 'w' || params_.mode_ == 'r')
-	{
-		ifstream dataFile(params_.fileName_.c_str());
-		if (!dataFile)
-		{
-			params_.errorMessage_ = "Fail to access the raster file:" + params_.fileName_;
-			return;
-		}
-		dataFile.close();
-		
-		int nb;
-		if (!Jpeg::ReadFileParams(params_.fileName_, params_.ncols_, params_.nlines_, nb))
-		{
-			params_.errorMessage_ = "Fail to read the parameters from the raster the file.";
-			return;
-		}
-		params_.nBands(nb);
-		params_.setDataType(TeUNSIGNEDCHAR);
-		params_.setPhotometric(TeRasterParams::TeMultiBand);
-		params_.decoderIdentifier_ = "JPEG";
-		params_.blockWidth_ = params_.ncols_;
-		params_.blockHeight_ = params_.nlines_;
-		params_.interleaving_ = TeRasterParams::TePerPixel;
-		TeProjection* proj = new TeNoProjection();
-		params_.projection(proj);
-		delete proj;
-
-		// Try reading navigation parameters from auxiliary file
-		string jgwFile = TeGetName(params_.fileName_.c_str()) +".jgw";
-		try
-		{
-			vector<double> jgw;
-			TeAsciiFile	pFile(jgwFile.c_str());
-			jgw.push_back(pFile.readFloat());
-			jgw.push_back(pFile.readFloat());
-			jgw.push_back(pFile.readFloat());
-			jgw.push_back(pFile.readFloat());
-			jgw.push_back(pFile.readFloat());
-			jgw.push_back(pFile.readFloat());
-			params_.setNavigationParameters(jgw);
-		}
-		catch (...)
-		{
-			// no .jgw inexistent or inconsistent, uses resolution of 1 unit 
-			// and box lower left coordinate of (0.5,0.5)
-			params_.lowerLeftResolutionSize(0.5,0.5,1.0,1.0,params_.ncols_,params_.nlines_,true);
-		}
-	}
-}
-
-TeDecoderJPEG::~TeDecoderJPEG()
-{
-	clear();
-}
-
-
-bool
-TeDecoderJPEG::clear()
-{
-	size_ = 0;
-	if (myData_ == 0)
-	    return true;
-	if ( isModified_ && (params_.mode_ == 'w' || params_.mode_ == 'c') )	// save contents to disk
-	{
-		ofstream dataFile(params_.fileName_.c_str());
-		if (dataFile)
-		{
-			dataFile.close();
-			Jpeg::CompressToFile(myData_, params_.ncols_, params_.nlines_, params_.nBands(), params_.fileName_);
-			isModified_ = false;
-		}
-	}
-	delete [] myData_;
-	myData_ = 0;
-	return true;
-}
-
-
-void
-TeDecoderJPEG::init()
-{
-	params_.status_= TeRasterParams::TeNotReady;
-	params_.interleaving_ = TeRasterParams::TePerPixel;
-
-	// try to allocate enough memory to hold the data
-	if (size_ != params_.nlines_*params_.ncols_*params_.nBands())
-	{
-		size_ = params_.nlines_*params_.ncols_*params_.nBands();
-		if (myData_)
-			delete [] myData_;
-		myData_ = new unsigned char [size_];
-	}
-	if (!myData_)
-		return;
-
-	for (long i=0; i<size_; myData_[i]=static_cast<unsigned char>(params_.dummy_[0]),++i);
-
-	if (params_.mode_ == 'c')	// creating a new file
-	{
-		int nb = params_.nBands();
-		if (nb != 1 && nb != 3)
-		{
-			params_.errorMessage_ = "JPEG files can have only 1 or 3 bands.";
-			return;
-		}
-		ofstream dataFile(params_.fileName_.c_str());
-		if (!dataFile)
-		{
-			params_.errorMessage_ = "Fail to (re)create the raster the file:" + params_.fileName_;
-			return;
-		}
-		dataFile.close();
-		
-		// write navigation file
-		string jgw = TeGetName(params_.fileName_.c_str())+".jgw";
-		try {
-			TeAsciiFile jgwFile(jgw,"w");
-			vector<double> jgw;
-			params_.getNavigationParameters(jgw);
-			for (unsigned int nl=0; nl<6; ++nl)
-			{
-				string line;
-				line = Te2String(jgw[nl]) + "\n";
-				jgwFile.writeString(line);
-			}
-		}
-		catch(...)
-		{}
-		// write initial dummy  data
-		if (!Jpeg::CompressToFile(myData_, params_.ncols_, params_.nlines_, params_.nBands(), params_.fileName_))
-			return;
-		params_.status_ = TeRasterParams::TeReadyToWrite;
-	}
-	else if (params_.mode_ == 'w' || params_.mode_ == 'r')
-	{
-		ifstream dataFile(params_.fileName_.c_str());
-		if (!dataFile)
-		{
-			params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
-			return;
-		}
-		dataFile.close();
-		
-		int nb;
-		if (!Jpeg::DecompressFile(params_.fileName_.c_str(), myData_, params_.ncols_, params_.nlines_, nb))
-		{
-			params_.errorMessage_ = "Fail to decompress JPEG file.";
-			return;
-		}
-		params_.nBands(nb);
-		if (params_.mode_ == 'w')
-			params_.status_ = TeRasterParams::TeReadyToWrite;
-		else
-			params_.status_ = TeRasterParams::TeReadyToRead;	
-	}
-}
-
-bool 
-TeDecoderJPEG::getElement (int col,int lin, double& val,int band)
-{
-	if (col < 0 || lin < 0 || col >= params_.ncols_ || lin >= params_.nlines_)
-		return false;
-	
-	int position = params_.nBands()*(params_.ncols_*lin+col)+band;
-	val = myData_[position];
-	return true;
-}
-
-bool 
-TeDecoderJPEG::setElement (int col, int lin, double val,int band)
-{
-	if (col < 0 || lin < 0 || col >= params_.ncols_ || lin >= params_.nlines_)
-		return false;
-	int position = params_.nBands()*(params_.ncols_*lin+col)+band;
-	myData_[position] = static_cast<unsigned char>(val);
-	isModified_ = true;
-	return true;
-}
-
-TeDecoderJPEGFactory::TeDecoderJPEGFactory(const string& name): 
-	TeDecoderFactory(name) 
-{
-	TeDecoderFactory::instanceName2Dec()["JPG"]  = "JPEG";	
-	TeDecoderFactory::instanceName2Dec()["JPEG"] = "JPEG";
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include <TeDecoderJPEG.h>
+#include <TeAsciiFile.h>
+#include <TeUtils.h>
+#include <TeLibJpegWrapper.h>
+#include <TeAgnostic.h>
+
+#include <fstream>
+using std::ifstream;
+using std::ofstream;
+
+TeDecoderJPEG::TeDecoderJPEG():
+	isModified_(false),
+	size_(0),
+	myData_(0),
+  qualityFactor_( 75 )  
+{	
+	params_.decoderIdentifier_ = "JPEG";	
+}
+
+
+TeDecoderJPEG::TeDecoderJPEG (const TeRasterParams& par):
+	isModified_(false),
+	size_(0),
+	myData_(0),
+  qualityFactor_( 75 ) 
+{	
+	params_ = par; 
+	params_.errorMessage_.clear();
+	// 'w' and 'r' modes suppose that the file already exists: try to read the basic information
+	if (params_.mode_ == 'w' || params_.mode_ == 'r')
+	{
+		ifstream dataFile(params_.fileName_.c_str());
+		if (!dataFile)
+		{
+			params_.errorMessage_ = "Fail to access the raster file:" + params_.fileName_;
+			return;
+		}
+		dataFile.close();
+		
+		int nb;
+		if (!Jpeg::ReadFileParams(params_.fileName_, params_.ncols_, params_.nlines_, nb))
+		{
+			params_.errorMessage_ = "Fail to read the parameters from the raster the file.";
+			return;
+		}
+		params_.nBands(nb);
+		params_.setDataType(TeUNSIGNEDCHAR);
+		params_.setPhotometric(TeRasterParams::TeMultiBand);
+		params_.decoderIdentifier_ = "JPEG";
+		params_.blockWidth_ = params_.ncols_;
+		params_.blockHeight_ = params_.nlines_;
+		params_.interleaving_ = TeRasterParams::TePerPixel;
+		TeProjection* proj = new TeNoProjection();
+		params_.projection(proj);
+		delete proj;
+
+		// Try reading navigation parameters from auxiliary file
+		string jgwFile = TeGetName(params_.fileName_.c_str()) +".jgw";
+		try
+		{
+			vector<double> jgw;
+			TeAsciiFile	pFile(jgwFile.c_str());
+			jgw.push_back(pFile.readFloat());
+			jgw.push_back(pFile.readFloat());
+			jgw.push_back(pFile.readFloat());
+			jgw.push_back(pFile.readFloat());
+			jgw.push_back(pFile.readFloat());
+			jgw.push_back(pFile.readFloat());
+			params_.setNavigationParameters(jgw);
+		}
+		catch (...)
+		{
+			// no .jgw inexistent or inconsistent, uses resolution of 1 unit 
+			// and box lower left coordinate of (0.5,0.5)
+			params_.lowerLeftResolutionSize(0.5,0.5,1.0,1.0,params_.ncols_,params_.nlines_,true);
+		}
+	}
+}
+
+TeDecoderJPEG::~TeDecoderJPEG()
+{
+	clear();
+}
+
+
+bool
+TeDecoderJPEG::clear()
+{
+	size_ = 0;
+	if (myData_ == 0)
+	    return true;
+	if ( isModified_ && (params_.mode_ == 'w' || params_.mode_ == 'c') )	// save contents to disk
+	{
+		ofstream dataFile(params_.fileName_.c_str());
+		if (dataFile)
+		{
+			dataFile.close();
+			Jpeg::CompressToFile(myData_, params_.ncols_, params_.nlines_, 
+        params_.nBands(), params_.fileName_, qualityFactor_ );
+			isModified_ = false;
+		}
+	}
+	delete [] myData_;
+	myData_ = 0;
+	return true;
+}
+
+
+void
+TeDecoderJPEG::init()
+{
+	params_.status_= TeRasterParams::TeNotReady;
+	params_.interleaving_ = TeRasterParams::TePerPixel;
+
+	// try to allocate enough memory to hold the data
+	if (size_ != params_.nlines_*params_.ncols_*params_.nBands())
+	{
+		size_ = params_.nlines_*params_.ncols_*params_.nBands();
+		if (myData_)
+			delete [] myData_;
+		myData_ = new unsigned char [size_];
+	}
+	if (!myData_)
+		return;
+
+	for (long i=0; i<size_; myData_[i]=static_cast<unsigned char>(params_.dummy_[0]),++i);
+
+	if (params_.mode_ == 'c')	// creating a new file
+	{
+		int nb = params_.nBands();
+		if (nb != 1 && nb != 3)
+		{
+			params_.errorMessage_ = "JPEG files can have only 1 or 3 bands.";
+			return;
+		}
+		ofstream dataFile(params_.fileName_.c_str());
+		if (!dataFile)
+		{
+			params_.errorMessage_ = "Fail to (re)create the raster the file:" + params_.fileName_;
+			return;
+		}
+		dataFile.close();
+		
+		// write navigation file
+		string jgw = TeGetName(params_.fileName_.c_str())+".jgw";
+		try {
+			TeAsciiFile jgwFile(jgw,"w");
+			vector<double> jgw;
+			params_.getNavigationParameters(jgw);
+			for (unsigned int nl=0; nl<6; ++nl)
+			{
+				string line;
+				line = Te2String(jgw[nl]) + "\n";
+				jgwFile.writeString(line);
+			}
+		}
+		catch(...)
+		{}
+		// write initial dummy  data
+		if (!Jpeg::CompressToFile(myData_, params_.ncols_, params_.nlines_, 
+      params_.nBands(), params_.fileName_, qualityFactor_ ) )
+    {
+			return;
+    }
+     
+		params_.status_ = TeRasterParams::TeReadyToWrite;
+	}
+	else if (params_.mode_ == 'w' || params_.mode_ == 'r')
+	{
+		ifstream dataFile(params_.fileName_.c_str());
+		if (!dataFile)
+		{
+			params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
+			return;
+		}
+		dataFile.close();
+		
+		int nb;
+		if (!Jpeg::DecompressFile(params_.fileName_.c_str(), myData_, params_.ncols_, params_.nlines_, nb))
+		{
+			params_.errorMessage_ = "Fail to decompress JPEG file.";
+			return;
+		}
+		params_.nBands(nb);
+		if (params_.mode_ == 'w')
+			params_.status_ = TeRasterParams::TeReadyToWrite;
+		else
+			params_.status_ = TeRasterParams::TeReadyToRead;	
+	}
+}
+
+bool 
+TeDecoderJPEG::getElement (int col,int lin, double& val,int band)
+{
+	if (col < 0 || lin < 0 || col >= params_.ncols_ || lin >= params_.nlines_)
+		return false;
+	
+	int position = params_.nBands()*(params_.ncols_*lin+col)+band;
+	val = myData_[position];
+	return true;
+}
+
+bool 
+TeDecoderJPEG::setElement (int col, int lin, double val,int band)
+{
+	if (col < 0 || lin < 0 || col >= params_.ncols_ || lin >= params_.nlines_)
+		return false;
+	int position = params_.nBands()*(params_.ncols_*lin+col)+band;
+	myData_[position] = static_cast<unsigned char>(val);
+	isModified_ = true;
+	return true;
+}
+
+void TeDecoderJPEG::setQualityFactor( unsigned int qualityFactor )
+{
+  TEAGN_TRUE_OR_THROW( ( qualityFactor <= 100 ), "Invalid quality factor" );
+  qualityFactor_ = qualityFactor;
+}
+
+TeDecoderJPEGFactory::TeDecoderJPEGFactory(const string& name): 
+	TeDecoderFactory(name) 
+{
+	TeDecoderFactory::instanceName2Dec()["JPG"]  = "JPEG";	
+	TeDecoderFactory::instanceName2Dec()["JPEG"] = "JPEG";
+}
diff --git a/src/terralib/kernel/TeDecoderJPEG.h b/src/terralib/kernel/TeDecoderJPEG.h
old mode 100755
new mode 100644
index 0b8b9c1..d5d332a
--- a/src/terralib/kernel/TeDecoderJPEG.h
+++ b/src/terralib/kernel/TeDecoderJPEG.h
@@ -1,81 +1,88 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderJPEG.h
-    \brief This file deals with decoding of raster structures in JPEG format
-*/
-#ifndef  __TERRALIB_INTERNAL_DECODERJPEG_H
-#define  __TERRALIB_INTERNAL_DECODERJPEG_H
-
-#include "TeDecoder.h"
-
-//! Implements a decoder for images in JPEG format
-/*  
-	This implementation compress/decompress the entire JPEG image in memory and  
-	access its pixels acessed directly. \par
-	The default file extensions associated to this decoder are ".jpg" and ".jpeg".
-*/
-class TL_DLL TeDecoderJPEG: public TeDecoder
-{
-public:
-	//! Empty constructor
-	TeDecoderJPEG();
-
-	//! Constructor from some parameters
-	TeDecoderJPEG(const TeRasterParams& par);
-
-	//! Destructor
-	~TeDecoderJPEG();
-
-	//! Initializes the internal structures
-	void init();
-
-	//! Releases the internal structures
-	bool clear();
-
-	//! Writes an element
-	bool setElement(int col,int lin, double val, int band=0);
-
-	//! Reads an element
-	bool getElement(int col,int lin, double &val,int band=0);
-
-private:
-	bool isModified_;
-	long size_;
-	unsigned char* myData_;
-};
-
-//! Implements a factory to build decoders to JPEG raster
-class TL_DLL TeDecoderJPEGFactory : public TeDecoderFactory
-{
-public:
-
-	//! Constructor for the factory
-	TeDecoderJPEGFactory(const string& name);
-
-	//! Built the object
-	TeDecoder* build (const TeRasterParams& arg)
-	{  return new TeDecoderJPEG(arg); }
-};
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderJPEG.h
+    \brief This file deals with decoding of raster structures in JPEG format
+*/
+#ifndef  __TERRALIB_INTERNAL_DECODERJPEG_H
+#define  __TERRALIB_INTERNAL_DECODERJPEG_H
+
+#include "TeDecoder.h"
+
+//! Implements a decoder for images in JPEG format
+/*  
+	This implementation compress/decompress the entire JPEG image in memory and  
+	access its pixels acessed directly. \par
+	The default file extensions associated to this decoder are ".jpg" and ".jpeg".
+*/
+class TL_DLL TeDecoderJPEG: public TeDecoder
+{
+public:
+	//! Empty constructor
+	TeDecoderJPEG();
+
+	//! Constructor from some parameters
+	TeDecoderJPEG(const TeRasterParams& par);
+
+	//! Destructor
+	~TeDecoderJPEG();
+
+	//! Initializes the internal structures
+	void init();
+
+	//! Releases the internal structures
+	bool clear();
+
+	//! Writes an element
+	bool setElement(int col,int lin, double val, int band=0);
+
+	//! Reads an element
+	bool getElement(int col,int lin, double &val,int band=0);
+  
+  //! @brief Set the quality factor. 
+  /*!
+    \param compression Quality factor from 0% to 100% (default:75).
+  */    
+  void setQualityFactor( unsigned int qualityFactor );
+
+private:
+	bool isModified_;
+	long size_;
+	unsigned char* myData_;
+  unsigned int qualityFactor_; 
+};
+
+//! Implements a factory to build decoders to JPEG raster
+class TL_DLL TeDecoderJPEGFactory : public TeDecoderFactory
+{
+public:
+
+	//! Constructor for the factory
+	TeDecoderJPEGFactory(const string& name);
+
+	//! Built the object
+	TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeDecoderJPEG(arg); }
+};
+
+#endif
+
diff --git a/src/terralib/kernel/TeDecoderMemory.cpp b/src/terralib/kernel/TeDecoderMemory.cpp
old mode 100755
new mode 100644
index 3ef7f2f..14b6986
--- a/src/terralib/kernel/TeDecoderMemory.cpp
+++ b/src/terralib/kernel/TeDecoderMemory.cpp
@@ -1,591 +1,591 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeDecoderMemory.h"
-#include "TeException.h"
-
-#include <assert.h>
-#include <cstring>
-
-TeDecoderMemory::TeDecoderMemory(): 
-	nelems_(0),
-	size_(0),
-	getelement_ptr_(0),
-	setelement_ptr_(0),	
-	data_TeUNSIGNEDCHAR_(0),  
-	data_TeCHAR_(0),  
-	data_TeUNSIGNEDSHORT_(0),  
-	data_TeSHORT_(0),  
-	data_TeINTEGER_(0), 
-	data_TeUNSIGNEDLONG_(0), 
-	data_TeLONG_(0),  
-	data_TeFLOAT_(0),
-	data_TeDOUBLE_(0)
-{
-	 params_.decoderIdentifier_ = "MEM";
-}
-
-TeDecoderMemory::TeDecoderMemory(const TeRasterParams& par): 
-	nelems_(0),
-	size_(0),
-	getelement_ptr_(0),
-	setelement_ptr_(0),	
-	data_TeUNSIGNEDCHAR_(0),  
-	data_TeCHAR_(0),  
-	data_TeUNSIGNEDSHORT_(0),  
-	data_TeSHORT_(0),  
-	data_TeINTEGER_(0), 
-	data_TeUNSIGNEDLONG_(0), 
-	data_TeLONG_(0),  
-	data_TeFLOAT_(0),
-	data_TeDOUBLE_(0)
-{	
-	params_ = par; 
-	params_.decoderIdentifier_ = "MEM"; 
-}
-
-TeDecoderMemory::~TeDecoderMemory ()
-{
-	clear();
-}
-
-void*	
-TeDecoderMemory::data(int band)
-{
-	// this is possible when band interleaved data
-	if (params_.interleaving_ != TeRasterParams::TePerBand)
-		return 0;
-
-	void* pt = 0;
-	switch (params_.dataType_[band]) 
-	{
-	case TeUNSIGNEDCHAR:
-		pt =  (data_TeUNSIGNEDCHAR_) + (params_.ncols_ * params_.nlines_*band);
-		break;
-	case TeCHAR:
-		pt =  (data_TeCHAR_) + (params_.ncols_ * params_.nlines_*band);
-		break;
-	case TeUNSIGNEDSHORT:
-		pt = (data_TeUNSIGNEDSHORT_) + (params_.ncols_ * params_.nlines_*band);
-		break;
-	case (TeSHORT):
-		pt = (data_TeSHORT_) + (params_.ncols_ * params_.nlines_*band);
-		break;
-    case (TeINTEGER):
-        pt = (data_TeINTEGER_) + (params_.ncols_ * params_.nlines_*band);
-        break;                
-	case (TeUNSIGNEDLONG):
-		pt = (data_TeUNSIGNEDLONG_) + (params_.ncols_ * params_.nlines_*band);
-		break;
-	case (TeLONG):
-		pt = (data_TeLONG_) + (params_.ncols_ * params_.nlines_*band);
-		break;
-	case (TeFLOAT):
-		pt = (data_TeFLOAT_) + (params_.ncols_ * params_.nlines_*band);
-		break;
-	case (TeDOUBLE):
-		pt = (data_TeDOUBLE_) + (params_.ncols_ * params_.nlines_*band);
-		break;
-	default:
-		break;
-	}
-	return (void*) pt;
-}
-
-void 
-TeDecoderMemory::init()
-{	
-	params_.errorMessage_.clear();
-	params_.status_= TeRasterParams::TeNotReady;
-	nelems_ = params_.nlines_*params_.ncols_*params_.nBands();
-	if (!allocateMemory() || !resetMemory())
-	{
-		params_.errorMessage_ = "Fail to allocate enough memory to hold the raster.";
-		return;
-	}
-	updateFuncPtr();
-
-	// this decoder always grant an read/write access
-	params_.status_ = TeRasterParams::TeReadyToWrite;
-}
-
-bool 
-TeDecoderMemory::getElement (int col,int lin, double& val,int band)
-{
-	unsigned long position = 0;
-	switch (params_.interleaving_)
-	{
-	case TeRasterParams::TePerPixel:
-		position = params_.nBands()*(params_.ncols_*lin+col)+band;
-		break;
-	case TeRasterParams::TePerLine:
-		position = (params_.nBands()*params_.ncols_*lin)+band*params_.ncols_+col;
-		break;
-	case TeRasterParams::TePerBand:
-		position = band*(params_.ncols_*params_.nlines_)+(params_.ncols_*lin+col);
-		break;
-	}
-	assert(position < nelems_);
-	(this->*( getelement_ptr_))(position,val);
-	return true;
-}
-
-bool 
-TeDecoderMemory::setElement (int col, int lin, double val,int band)
-{
-	unsigned long position = 0;
-	switch (params_.interleaving_)
-	{
-	case TeRasterParams::TePerPixel:
-		position = params_.nBands()*(params_.ncols_*lin+col)+band;
-		break;
-	case TeRasterParams::TePerLine:
-		position = (params_.nBands()*params_.ncols_*lin)+band*params_.ncols_+col;
-		break;
-	case TeRasterParams::TePerBand:
-		position = band*(params_.ncols_*params_.nlines_)+(params_.ncols_*lin+col);
-		break;
-	}
-	assert(position < nelems_);
-	(this->*( setelement_ptr_))(position,val);
-	return true;
-}
-
-void TeDecoderMemory::updateFuncPtr()
-{
-	if ( getelement_ptr_ != 0 ) 
-		getelement_ptr_ = 0;
-
-	if ( setelement_ptr_ != 0 ) 
-		setelement_ptr_ = 0;
-
-	switch ( params_.dataType_[0] ) 
-	{
-		case (TeCHAR) :
-		{
-			getelement_ptr_ = &TeDecoderMemory::getElement_TeCHAR;
-			setelement_ptr_ = &TeDecoderMemory::setElement_TeCHAR;
-			break;
-		}
-		case (TeUNSIGNEDSHORT):
-		{
-			getelement_ptr_ = &TeDecoderMemory::getElement_TeUNSIGNEDSHORT;
-			setelement_ptr_ = &TeDecoderMemory::setElement_TeUNSIGNEDSHORT;
-			break;
-		}
-		case (TeSHORT):
-		{
-			getelement_ptr_ = &TeDecoderMemory::getElement_TeSHORT;
-			setelement_ptr_ = &TeDecoderMemory::setElement_TeSHORT;
-			break;
-		}
-		case (TeINTEGER):
-		{
-			getelement_ptr_ = &TeDecoderMemory::getElement_TeINTEGER;
-			setelement_ptr_ = &TeDecoderMemory::setElement_TeINTEGER;
-			break;
-		}
-		case (TeUNSIGNEDLONG):
-		{
-			getelement_ptr_ = &TeDecoderMemory::getElement_TeUNSIGNEDLONG;
-			setelement_ptr_ = &TeDecoderMemory::setElement_TeUNSIGNEDLONG;
-			break;
-		}
-		case (TeLONG):
-		{
-			getelement_ptr_ = &TeDecoderMemory::getElement_TeLONG;
-			setelement_ptr_ = &TeDecoderMemory::setElement_TeLONG;
-			break;
-		}
-		case (TeFLOAT):
-		{
-			getelement_ptr_ = &TeDecoderMemory::getElement_TeFLOAT;
-			setelement_ptr_ = &TeDecoderMemory::setElement_TeFLOAT;
-			break;
-		}
-		case (TeDOUBLE):
-		{
-			getelement_ptr_ = &TeDecoderMemory::getElement_TeDOUBLE;
-			setelement_ptr_ = &TeDecoderMemory::setElement_TeDOUBLE;
-			break;
-		}
-		default:
-		{
-			getelement_ptr_ = &TeDecoderMemory::getElement_TeUNSIGNEDCHAR;
-			setelement_ptr_ = &TeDecoderMemory::setElement_TeUNSIGNEDCHAR;
-			break;
-		}				
-	}
-}
-
-bool 
-TeDecoderMemory::allocateMemory()
-{
-	long nelems = params_.nlines_*params_.ncols_*params_.nBands();
-
-	// allocate necessary memory
-	switch (params_.dataType_[0]) 
-	{
-	case (TeUNSIGNEDCHAR):
-		if ((nelems*sizeof(unsigned char)) == (nelems_*sizeof(unsigned char)) && data_TeUNSIGNEDCHAR_)
-			return true;
-        data_TeUNSIGNEDCHAR_ = new unsigned char [nelems_];
-		if (!data_TeUNSIGNEDCHAR_)
-			return false;
-		size_ = nelems_ * sizeof(unsigned char);
-		break;
-
-	case (TeCHAR):
-		if ((nelems*sizeof(char)) == (nelems_*sizeof(char)) && data_TeCHAR_)
-			return true;
-		data_TeCHAR_ = new char [nelems_];
-		if (!data_TeCHAR_)
-			return false;
-		size_ = nelems_ * sizeof(char);
-		break;
-
-	case (TeUNSIGNEDSHORT):
-		if ((nelems*sizeof(unsigned short)) == (nelems_*sizeof(unsigned short)) && data_TeUNSIGNEDSHORT_)
-			return true;
-		data_TeUNSIGNEDSHORT_ = new unsigned short [nelems_];
-		if (!data_TeUNSIGNEDSHORT_)
-			return false;
-		size_ = nelems_ * sizeof(unsigned short);
-		break;
-
-	case (TeSHORT):
-		if ((nelems*sizeof( short)) == (nelems_*sizeof(short)) && data_TeSHORT_)
-			return true;
-		data_TeSHORT_ = new short [nelems_];
-		if (!data_TeSHORT_)
-			return false;
-		size_ = nelems_ * sizeof(short);
-		break;
-
-    case (TeINTEGER):
- 		if ((nelems*sizeof(int)) == (nelems_*sizeof(int)) && data_TeINTEGER_)
-			return true;
-       data_TeINTEGER_ = new int [nelems_];
-        if (!data_TeINTEGER_)
-			return false;
-        size_ = nelems_ * sizeof(int);
-        break;
-
-	case (TeUNSIGNEDLONG):
-		if ((nelems*sizeof(unsigned long)) == (nelems_*sizeof(unsigned long)) && data_TeUNSIGNEDLONG_)
-			return true;
-		data_TeUNSIGNEDLONG_ = new unsigned long [nelems_];
-		if (!data_TeUNSIGNEDLONG_)
-			return false;
-		size_ = nelems_ * sizeof(unsigned long);
-		break;
-
-	case (TeLONG):
-		if ((nelems*sizeof(long)) == (nelems_*sizeof(long)) && data_TeLONG_)
-			return true;
-		data_TeLONG_ = new long [nelems_];
-		if (!data_TeLONG_)
-			return false;
-		size_ = nelems_ * sizeof(long);
-		break;
-
-	case (TeFLOAT):
-		if ((nelems*sizeof(float)) == (nelems_*sizeof(float)) && data_TeFLOAT_)
-			return true;
-		data_TeFLOAT_ = new float [nelems_];
-		if (!data_TeFLOAT_)
-			return false;
-		size_ = nelems_ * sizeof(float);
-		break;
-
-	case (TeDOUBLE):
-		if ((nelems*sizeof(double)) == (nelems_*sizeof(double)) && data_TeDOUBLE_)
-			return true;
-		data_TeDOUBLE_ = new double [nelems_];
-		if (!data_TeDOUBLE_)
-			return false;
-		size_ = nelems_ * sizeof(double);
-		break;
-
-	default:
-		return false;
-	}
-	return true;
-}
-
-
-bool 
-TeDecoderMemory::resetMemory()
-{
-	unsigned int i;
-	switch (params_.dataType_[0]) 
-	{
-	case (TeBIT):
-	case (TeCHAR):
-		if (!data_TeCHAR_)
-			return false;
-		for(i=0; i<nelems_; data_TeCHAR_[i]=static_cast<char>(params_.dummy_[0]),++i);
-		break;
-
-	case (TeUNSIGNEDCHAR):
-		if (!data_TeUNSIGNEDCHAR_)
-			return false;
-		for(i=0; i<nelems_; data_TeUNSIGNEDCHAR_[i]=static_cast<unsigned char>(params_.dummy_[0]),++i);
-		break;
-
-	case (TeUNSIGNEDSHORT):
-		if (!data_TeUNSIGNEDSHORT_)
-			return false;
-		for(i=0; i<nelems_; data_TeUNSIGNEDSHORT_[i]=static_cast<unsigned short>(params_.dummy_[0]),++i);
-		break;
-
-	case (TeSHORT):
-		if (!data_TeSHORT_)
-			return false;
-		for(i=0; i<nelems_; data_TeSHORT_[i]=static_cast<short>(params_.dummy_[0]),++i);
-		break;
-
-	case (TeINTEGER):
-		if (!data_TeINTEGER_)
-			return false;
-		for(i=0; i<nelems_; data_TeINTEGER_[i]=static_cast<int>(params_.dummy_[0]),++i);
-		break;
-
-	case (TeUNSIGNEDLONG):
-		if (!data_TeUNSIGNEDLONG_)
-			return false;
-		for(i=0; i<nelems_; data_TeUNSIGNEDLONG_[i]=static_cast<unsigned long>(params_.dummy_[0]),++i);
-		break;
-
-	case (TeLONG):
-		if (!data_TeLONG_)
-			return false;
-		for(i=0; i<nelems_; data_TeLONG_[i]=static_cast<long>(params_.dummy_[0]),++i);
-		break;
-
-	case (TeFLOAT):
-		if (!data_TeFLOAT_)
-			return false;
-		for(i=0; i<nelems_; data_TeFLOAT_[i]=static_cast<float>(params_.dummy_[0]),++i);
-		break;
-
-	case (TeDOUBLE):
-		if (!data_TeDOUBLE_)
-			return false;
-		for(i=0; i<nelems_; data_TeDOUBLE_[i]=static_cast<double>(params_.dummy_[0]),++i);
-		break;
-
-	default:
-		break;	
-}
-
-	return true;
-}
-
-bool
-TeDecoderMemory::clear()
-{
-	if (data_TeUNSIGNEDCHAR_)
-	{
-		delete [] data_TeUNSIGNEDCHAR_;
-		data_TeUNSIGNEDCHAR_ = 0;
-		return true;
-	}
-	if (data_TeCHAR_)
-	{
-		delete [] data_TeCHAR_; 
-		data_TeCHAR_ = 0;
-		return true;
-	}
-	if (data_TeUNSIGNEDSHORT_)
-	{
-		delete [] data_TeUNSIGNEDSHORT_;  
-		data_TeUNSIGNEDSHORT_ = 0;
-		return true;
-	}
-	if (data_TeSHORT_)
-	{
-		delete [] data_TeSHORT_;  
-		data_TeSHORT_ = 0;
-		return true;
-	}
-	if (data_TeINTEGER_) 
-	{
-		delete [] data_TeINTEGER_;  
-		data_TeINTEGER_ = 0;
-		return true;
-	}
-	if (data_TeUNSIGNEDLONG_)
-	{
-		delete [] data_TeUNSIGNEDLONG_;  
-		data_TeUNSIGNEDLONG_ = 0;
-		return true;
-	}
-	if (data_TeLONG_)
-	{
-		delete [] data_TeLONG_;  
-		data_TeLONG_ = 0;
-		return true;
-	}
-	if (data_TeFLOAT_)
-	{
-		delete [] data_TeFLOAT_;
-		data_TeFLOAT_ = 0;
-		return true;
-	}
-	if (data_TeDOUBLE_)
-	{
-		delete [] data_TeDOUBLE_;
-		data_TeDOUBLE_ = 0;
-		return true;
-	}
-	params_.status_ = TeRasterParams::TeNotReady;
-	return true;
-}
-
-
-inline void TeDecoderMemory::setElement_TeUNSIGNEDCHAR(const long& pos, const double& val)
-{
-	assert(data_TeUNSIGNEDCHAR_ != 0 );
-	data_TeUNSIGNEDCHAR_[pos] = (unsigned char)val;
-}
-
-
-inline void TeDecoderMemory::setElement_TeCHAR(const long& pos, const double& val)
-{
-	assert(data_TeCHAR_ != 0 );
-	data_TeCHAR_[pos] = (char)val;
-}
-
-
-inline void TeDecoderMemory::setElement_TeUNSIGNEDSHORT(const long& pos, const double& val)
-{
-	assert(data_TeUNSIGNEDSHORT_ != 0 );
-	data_TeUNSIGNEDSHORT_[pos] = (unsigned short)val;
-}
-
-
-inline void TeDecoderMemory::setElement_TeSHORT(const long& pos, const double& val)
-{
-	assert(data_TeSHORT_ != 0 );
-	data_TeSHORT_[pos] = (short)val;
-}
-
-
-inline void TeDecoderMemory::setElement_TeINTEGER(const long& pos, const double& val)
-{
-	assert(data_TeINTEGER_ != 0 );
-	data_TeINTEGER_[pos] = (int)val;
-}
-
-
-inline void TeDecoderMemory::setElement_TeUNSIGNEDLONG(const long& pos, const double& val)
-{
-	assert(data_TeUNSIGNEDLONG_ != 0 );
-	data_TeUNSIGNEDLONG_[pos] = (unsigned long)val;
-}
-
-
-inline void TeDecoderMemory::setElement_TeLONG(const long& pos, const double& val)
-{
-	assert(data_TeLONG_ != 0 );
-	data_TeLONG_[pos] = (long)val;
-}
-
-
-inline void TeDecoderMemory::setElement_TeFLOAT(const long& pos, const double& val)
-{
-	assert(data_TeFLOAT_ != 0 );
-	data_TeFLOAT_[pos] = (float)val;
-}
-
-
-inline void TeDecoderMemory::setElement_TeDOUBLE(const long& pos, const double& val)
-{
-	assert(data_TeDOUBLE_ != 0 );
-	data_TeDOUBLE_[pos] = val;
-}
-
-
-inline void TeDecoderMemory::getElement_TeUNSIGNEDCHAR(const long& pos, double& val)
-{
-	assert(data_TeUNSIGNEDCHAR_ != 0 );
-	val = (double)data_TeUNSIGNEDCHAR_[pos];
-}
-
-
-inline void TeDecoderMemory::getElement_TeCHAR(const long& pos, double& val)
-{
-	assert(data_TeCHAR_ != 0 );
-	val = (double)data_TeCHAR_[pos];
-}
-
-
-inline void TeDecoderMemory::getElement_TeUNSIGNEDSHORT(const long& pos, double& val)
-{
-	assert(data_TeUNSIGNEDSHORT_ != 0 );
-	val = (double)data_TeUNSIGNEDSHORT_[pos];
-}
-
-
-inline void TeDecoderMemory::getElement_TeSHORT(const long& pos, double& val)
-{
-	assert(data_TeSHORT_ != 0 );
-	val = (double)data_TeSHORT_[pos];
-}
-
-
-inline void TeDecoderMemory::getElement_TeINTEGER(const long& pos, double& val)
-{
-	assert(data_TeINTEGER_ != 0 );
-	val = (double)data_TeINTEGER_[pos];
-}
-
-
-inline void TeDecoderMemory::getElement_TeUNSIGNEDLONG(const long& pos, double& val)
-{
-	assert(data_TeUNSIGNEDLONG_ != 0 );
-	val = (double)data_TeUNSIGNEDLONG_[pos];
-}
-
-
-inline void TeDecoderMemory::getElement_TeLONG(const long& pos,double& val)
-{
-	assert(data_TeLONG_ != 0 );
-	val = (double)data_TeLONG_[pos];
-}
-
-
-inline void TeDecoderMemory::getElement_TeFLOAT(const long& pos, double& val)
-{
-	assert(data_TeFLOAT_ != 0 );
-	val = (double)data_TeFLOAT_[pos];
-}
-
-
-inline void TeDecoderMemory::getElement_TeDOUBLE(const long& pos, double& val)
-{
-	assert(data_TeDOUBLE_ != 0 );
-	val = (double)data_TeDOUBLE_[pos];
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeDecoderMemory.h"
+#include "TeException.h"
+
+#include <assert.h>
+#include <cstring>
+
+TeDecoderMemory::TeDecoderMemory(): 
+	nelems_(0),
+	size_(0),
+	getelement_ptr_(0),
+	setelement_ptr_(0),	
+	data_TeUNSIGNEDCHAR_(0),  
+	data_TeCHAR_(0),  
+	data_TeUNSIGNEDSHORT_(0),  
+	data_TeSHORT_(0),  
+	data_TeINTEGER_(0), 
+	data_TeUNSIGNEDLONG_(0), 
+	data_TeLONG_(0),  
+	data_TeFLOAT_(0),
+	data_TeDOUBLE_(0)
+{
+	 params_.decoderIdentifier_ = "MEM";
+}
+
+TeDecoderMemory::TeDecoderMemory(const TeRasterParams& par): 
+	nelems_(0),
+	size_(0),
+	getelement_ptr_(0),
+	setelement_ptr_(0),	
+	data_TeUNSIGNEDCHAR_(0),  
+	data_TeCHAR_(0),  
+	data_TeUNSIGNEDSHORT_(0),  
+	data_TeSHORT_(0),  
+	data_TeINTEGER_(0), 
+	data_TeUNSIGNEDLONG_(0), 
+	data_TeLONG_(0),  
+	data_TeFLOAT_(0),
+	data_TeDOUBLE_(0)
+{	
+	params_ = par; 
+	params_.decoderIdentifier_ = "MEM"; 
+}
+
+TeDecoderMemory::~TeDecoderMemory ()
+{
+	clear();
+}
+
+void*	
+TeDecoderMemory::data(int band)
+{
+	// this is possible when band interleaved data
+	if (params_.interleaving_ != TeRasterParams::TePerBand)
+		return 0;
+
+	void* pt = 0;
+	switch (params_.dataType_[band]) 
+	{
+	case TeUNSIGNEDCHAR:
+		pt =  (data_TeUNSIGNEDCHAR_) + (params_.ncols_ * params_.nlines_*band);
+		break;
+	case TeCHAR:
+		pt =  (data_TeCHAR_) + (params_.ncols_ * params_.nlines_*band);
+		break;
+	case TeUNSIGNEDSHORT:
+		pt = (data_TeUNSIGNEDSHORT_) + (params_.ncols_ * params_.nlines_*band);
+		break;
+	case (TeSHORT):
+		pt = (data_TeSHORT_) + (params_.ncols_ * params_.nlines_*band);
+		break;
+    case (TeINTEGER):
+        pt = (data_TeINTEGER_) + (params_.ncols_ * params_.nlines_*band);
+        break;                
+	case (TeUNSIGNEDLONG):
+		pt = (data_TeUNSIGNEDLONG_) + (params_.ncols_ * params_.nlines_*band);
+		break;
+	case (TeLONG):
+		pt = (data_TeLONG_) + (params_.ncols_ * params_.nlines_*band);
+		break;
+	case (TeFLOAT):
+		pt = (data_TeFLOAT_) + (params_.ncols_ * params_.nlines_*band);
+		break;
+	case (TeDOUBLE):
+		pt = (data_TeDOUBLE_) + (params_.ncols_ * params_.nlines_*band);
+		break;
+	default:
+		break;
+	}
+	return (void*) pt;
+}
+
+void 
+TeDecoderMemory::init()
+{	
+	params_.errorMessage_.clear();
+	params_.status_= TeRasterParams::TeNotReady;
+	nelems_ = params_.nlines_*params_.ncols_*params_.nBands();
+	if (!allocateMemory() || !resetMemory())
+	{
+		params_.errorMessage_ = "Fail to allocate enough memory to hold the raster.";
+		return;
+	}
+	updateFuncPtr();
+
+	// this decoder always grant an read/write access
+	params_.status_ = TeRasterParams::TeReadyToWrite;
+}
+
+bool 
+TeDecoderMemory::getElement (int col,int lin, double& val,int band)
+{
+	unsigned long position = 0;
+	switch (params_.interleaving_)
+	{
+	case TeRasterParams::TePerPixel:
+		position = params_.nBands()*(params_.ncols_*lin+col)+band;
+		break;
+	case TeRasterParams::TePerLine:
+		position = (params_.nBands()*params_.ncols_*lin)+band*params_.ncols_+col;
+		break;
+	case TeRasterParams::TePerBand:
+		position = band*(params_.ncols_*params_.nlines_)+(params_.ncols_*lin+col);
+		break;
+	}
+	assert(position < nelems_);
+	(this->*( getelement_ptr_))(position,val);
+	return true;
+}
+
+bool 
+TeDecoderMemory::setElement (int col, int lin, double val,int band)
+{
+	unsigned long position = 0;
+	switch (params_.interleaving_)
+	{
+	case TeRasterParams::TePerPixel:
+		position = params_.nBands()*(params_.ncols_*lin+col)+band;
+		break;
+	case TeRasterParams::TePerLine:
+		position = (params_.nBands()*params_.ncols_*lin)+band*params_.ncols_+col;
+		break;
+	case TeRasterParams::TePerBand:
+		position = band*(params_.ncols_*params_.nlines_)+(params_.ncols_*lin+col);
+		break;
+	}
+	assert(position < nelems_);
+	(this->*( setelement_ptr_))(position,val);
+	return true;
+}
+
+void TeDecoderMemory::updateFuncPtr()
+{
+	if ( getelement_ptr_ != 0 ) 
+		getelement_ptr_ = 0;
+
+	if ( setelement_ptr_ != 0 ) 
+		setelement_ptr_ = 0;
+
+	switch ( params_.dataType_[0] ) 
+	{
+		case (TeCHAR) :
+		{
+			getelement_ptr_ = &TeDecoderMemory::getElement_TeCHAR;
+			setelement_ptr_ = &TeDecoderMemory::setElement_TeCHAR;
+			break;
+		}
+		case (TeUNSIGNEDSHORT):
+		{
+			getelement_ptr_ = &TeDecoderMemory::getElement_TeUNSIGNEDSHORT;
+			setelement_ptr_ = &TeDecoderMemory::setElement_TeUNSIGNEDSHORT;
+			break;
+		}
+		case (TeSHORT):
+		{
+			getelement_ptr_ = &TeDecoderMemory::getElement_TeSHORT;
+			setelement_ptr_ = &TeDecoderMemory::setElement_TeSHORT;
+			break;
+		}
+		case (TeINTEGER):
+		{
+			getelement_ptr_ = &TeDecoderMemory::getElement_TeINTEGER;
+			setelement_ptr_ = &TeDecoderMemory::setElement_TeINTEGER;
+			break;
+		}
+		case (TeUNSIGNEDLONG):
+		{
+			getelement_ptr_ = &TeDecoderMemory::getElement_TeUNSIGNEDLONG;
+			setelement_ptr_ = &TeDecoderMemory::setElement_TeUNSIGNEDLONG;
+			break;
+		}
+		case (TeLONG):
+		{
+			getelement_ptr_ = &TeDecoderMemory::getElement_TeLONG;
+			setelement_ptr_ = &TeDecoderMemory::setElement_TeLONG;
+			break;
+		}
+		case (TeFLOAT):
+		{
+			getelement_ptr_ = &TeDecoderMemory::getElement_TeFLOAT;
+			setelement_ptr_ = &TeDecoderMemory::setElement_TeFLOAT;
+			break;
+		}
+		case (TeDOUBLE):
+		{
+			getelement_ptr_ = &TeDecoderMemory::getElement_TeDOUBLE;
+			setelement_ptr_ = &TeDecoderMemory::setElement_TeDOUBLE;
+			break;
+		}
+		default:
+		{
+			getelement_ptr_ = &TeDecoderMemory::getElement_TeUNSIGNEDCHAR;
+			setelement_ptr_ = &TeDecoderMemory::setElement_TeUNSIGNEDCHAR;
+			break;
+		}				
+	}
+}
+
+bool 
+TeDecoderMemory::allocateMemory()
+{
+	long nelems = params_.nlines_*params_.ncols_*params_.nBands();
+
+	// allocate necessary memory
+	switch (params_.dataType_[0]) 
+	{
+	case (TeUNSIGNEDCHAR):
+		if ((nelems*sizeof(unsigned char)) == (nelems_*sizeof(unsigned char)) && data_TeUNSIGNEDCHAR_)
+			return true;
+        data_TeUNSIGNEDCHAR_ = new unsigned char [nelems_];
+		if (!data_TeUNSIGNEDCHAR_)
+			return false;
+		size_ = nelems_ * sizeof(unsigned char);
+		break;
+
+	case (TeCHAR):
+		if ((nelems*sizeof(char)) == (nelems_*sizeof(char)) && data_TeCHAR_)
+			return true;
+		data_TeCHAR_ = new char [nelems_];
+		if (!data_TeCHAR_)
+			return false;
+		size_ = nelems_ * sizeof(char);
+		break;
+
+	case (TeUNSIGNEDSHORT):
+		if ((nelems*sizeof(unsigned short)) == (nelems_*sizeof(unsigned short)) && data_TeUNSIGNEDSHORT_)
+			return true;
+		data_TeUNSIGNEDSHORT_ = new unsigned short [nelems_];
+		if (!data_TeUNSIGNEDSHORT_)
+			return false;
+		size_ = nelems_ * sizeof(unsigned short);
+		break;
+
+	case (TeSHORT):
+		if ((nelems*sizeof( short)) == (nelems_*sizeof(short)) && data_TeSHORT_)
+			return true;
+		data_TeSHORT_ = new short [nelems_];
+		if (!data_TeSHORT_)
+			return false;
+		size_ = nelems_ * sizeof(short);
+		break;
+
+    case (TeINTEGER):
+ 		if ((nelems*sizeof(int)) == (nelems_*sizeof(int)) && data_TeINTEGER_)
+			return true;
+       data_TeINTEGER_ = new int [nelems_];
+        if (!data_TeINTEGER_)
+			return false;
+        size_ = nelems_ * sizeof(int);
+        break;
+
+	case (TeUNSIGNEDLONG):
+		if ((nelems*sizeof(unsigned long)) == (nelems_*sizeof(unsigned long)) && data_TeUNSIGNEDLONG_)
+			return true;
+		data_TeUNSIGNEDLONG_ = new unsigned long [nelems_];
+		if (!data_TeUNSIGNEDLONG_)
+			return false;
+		size_ = nelems_ * sizeof(unsigned long);
+		break;
+
+	case (TeLONG):
+		if ((nelems*sizeof(long)) == (nelems_*sizeof(long)) && data_TeLONG_)
+			return true;
+		data_TeLONG_ = new long [nelems_];
+		if (!data_TeLONG_)
+			return false;
+		size_ = nelems_ * sizeof(long);
+		break;
+
+	case (TeFLOAT):
+		if ((nelems*sizeof(float)) == (nelems_*sizeof(float)) && data_TeFLOAT_)
+			return true;
+		data_TeFLOAT_ = new float [nelems_];
+		if (!data_TeFLOAT_)
+			return false;
+		size_ = nelems_ * sizeof(float);
+		break;
+
+	case (TeDOUBLE):
+		if ((nelems*sizeof(double)) == (nelems_*sizeof(double)) && data_TeDOUBLE_)
+			return true;
+		data_TeDOUBLE_ = new double [nelems_];
+		if (!data_TeDOUBLE_)
+			return false;
+		size_ = nelems_ * sizeof(double);
+		break;
+
+	default:
+		return false;
+	}
+	return true;
+}
+
+
+bool 
+TeDecoderMemory::resetMemory()
+{
+	unsigned int i;
+	switch (params_.dataType_[0]) 
+	{
+	case (TeBIT):
+	case (TeCHAR):
+		if (!data_TeCHAR_)
+			return false;
+		for(i=0; i<nelems_; data_TeCHAR_[i]=static_cast<char>(params_.dummy_[0]),++i);
+		break;
+
+	case (TeUNSIGNEDCHAR):
+		if (!data_TeUNSIGNEDCHAR_)
+			return false;
+		for(i=0; i<nelems_; data_TeUNSIGNEDCHAR_[i]=static_cast<unsigned char>(params_.dummy_[0]),++i);
+		break;
+
+	case (TeUNSIGNEDSHORT):
+		if (!data_TeUNSIGNEDSHORT_)
+			return false;
+		for(i=0; i<nelems_; data_TeUNSIGNEDSHORT_[i]=static_cast<unsigned short>(params_.dummy_[0]),++i);
+		break;
+
+	case (TeSHORT):
+		if (!data_TeSHORT_)
+			return false;
+		for(i=0; i<nelems_; data_TeSHORT_[i]=static_cast<short>(params_.dummy_[0]),++i);
+		break;
+
+	case (TeINTEGER):
+		if (!data_TeINTEGER_)
+			return false;
+		for(i=0; i<nelems_; data_TeINTEGER_[i]=static_cast<int>(params_.dummy_[0]),++i);
+		break;
+
+	case (TeUNSIGNEDLONG):
+		if (!data_TeUNSIGNEDLONG_)
+			return false;
+		for(i=0; i<nelems_; data_TeUNSIGNEDLONG_[i]=static_cast<unsigned long>(params_.dummy_[0]),++i);
+		break;
+
+	case (TeLONG):
+		if (!data_TeLONG_)
+			return false;
+		for(i=0; i<nelems_; data_TeLONG_[i]=static_cast<long>(params_.dummy_[0]),++i);
+		break;
+
+	case (TeFLOAT):
+		if (!data_TeFLOAT_)
+			return false;
+		for(i=0; i<nelems_; data_TeFLOAT_[i]=static_cast<float>(params_.dummy_[0]),++i);
+		break;
+
+	case (TeDOUBLE):
+		if (!data_TeDOUBLE_)
+			return false;
+		for(i=0; i<nelems_; data_TeDOUBLE_[i]=static_cast<double>(params_.dummy_[0]),++i);
+		break;
+
+	default:
+		break;	
+}
+
+	return true;
+}
+
+bool
+TeDecoderMemory::clear()
+{
+	if (data_TeUNSIGNEDCHAR_)
+	{
+		delete [] data_TeUNSIGNEDCHAR_;
+		data_TeUNSIGNEDCHAR_ = 0;
+		return true;
+	}
+	if (data_TeCHAR_)
+	{
+		delete [] data_TeCHAR_; 
+		data_TeCHAR_ = 0;
+		return true;
+	}
+	if (data_TeUNSIGNEDSHORT_)
+	{
+		delete [] data_TeUNSIGNEDSHORT_;  
+		data_TeUNSIGNEDSHORT_ = 0;
+		return true;
+	}
+	if (data_TeSHORT_)
+	{
+		delete [] data_TeSHORT_;  
+		data_TeSHORT_ = 0;
+		return true;
+	}
+	if (data_TeINTEGER_) 
+	{
+		delete [] data_TeINTEGER_;  
+		data_TeINTEGER_ = 0;
+		return true;
+	}
+	if (data_TeUNSIGNEDLONG_)
+	{
+		delete [] data_TeUNSIGNEDLONG_;  
+		data_TeUNSIGNEDLONG_ = 0;
+		return true;
+	}
+	if (data_TeLONG_)
+	{
+		delete [] data_TeLONG_;  
+		data_TeLONG_ = 0;
+		return true;
+	}
+	if (data_TeFLOAT_)
+	{
+		delete [] data_TeFLOAT_;
+		data_TeFLOAT_ = 0;
+		return true;
+	}
+	if (data_TeDOUBLE_)
+	{
+		delete [] data_TeDOUBLE_;
+		data_TeDOUBLE_ = 0;
+		return true;
+	}
+	params_.status_ = TeRasterParams::TeNotReady;
+	return true;
+}
+
+
+inline void TeDecoderMemory::setElement_TeUNSIGNEDCHAR(const long& pos, const double& val)
+{
+	assert(data_TeUNSIGNEDCHAR_ != 0 );
+	data_TeUNSIGNEDCHAR_[pos] = (unsigned char)val;
+}
+
+
+inline void TeDecoderMemory::setElement_TeCHAR(const long& pos, const double& val)
+{
+	assert(data_TeCHAR_ != 0 );
+	data_TeCHAR_[pos] = (char)val;
+}
+
+
+inline void TeDecoderMemory::setElement_TeUNSIGNEDSHORT(const long& pos, const double& val)
+{
+	assert(data_TeUNSIGNEDSHORT_ != 0 );
+	data_TeUNSIGNEDSHORT_[pos] = (unsigned short)val;
+}
+
+
+inline void TeDecoderMemory::setElement_TeSHORT(const long& pos, const double& val)
+{
+	assert(data_TeSHORT_ != 0 );
+	data_TeSHORT_[pos] = (short)val;
+}
+
+
+inline void TeDecoderMemory::setElement_TeINTEGER(const long& pos, const double& val)
+{
+	assert(data_TeINTEGER_ != 0 );
+	data_TeINTEGER_[pos] = (int)val;
+}
+
+
+inline void TeDecoderMemory::setElement_TeUNSIGNEDLONG(const long& pos, const double& val)
+{
+	assert(data_TeUNSIGNEDLONG_ != 0 );
+	data_TeUNSIGNEDLONG_[pos] = (unsigned long)val;
+}
+
+
+inline void TeDecoderMemory::setElement_TeLONG(const long& pos, const double& val)
+{
+	assert(data_TeLONG_ != 0 );
+	data_TeLONG_[pos] = (long)val;
+}
+
+
+inline void TeDecoderMemory::setElement_TeFLOAT(const long& pos, const double& val)
+{
+	assert(data_TeFLOAT_ != 0 );
+	data_TeFLOAT_[pos] = (float)val;
+}
+
+
+inline void TeDecoderMemory::setElement_TeDOUBLE(const long& pos, const double& val)
+{
+	assert(data_TeDOUBLE_ != 0 );
+	data_TeDOUBLE_[pos] = val;
+}
+
+
+inline void TeDecoderMemory::getElement_TeUNSIGNEDCHAR(const long& pos, double& val)
+{
+	assert(data_TeUNSIGNEDCHAR_ != 0 );
+	val = (double)data_TeUNSIGNEDCHAR_[pos];
+}
+
+
+inline void TeDecoderMemory::getElement_TeCHAR(const long& pos, double& val)
+{
+	assert(data_TeCHAR_ != 0 );
+	val = (double)data_TeCHAR_[pos];
+}
+
+
+inline void TeDecoderMemory::getElement_TeUNSIGNEDSHORT(const long& pos, double& val)
+{
+	assert(data_TeUNSIGNEDSHORT_ != 0 );
+	val = (double)data_TeUNSIGNEDSHORT_[pos];
+}
+
+
+inline void TeDecoderMemory::getElement_TeSHORT(const long& pos, double& val)
+{
+	assert(data_TeSHORT_ != 0 );
+	val = (double)data_TeSHORT_[pos];
+}
+
+
+inline void TeDecoderMemory::getElement_TeINTEGER(const long& pos, double& val)
+{
+	assert(data_TeINTEGER_ != 0 );
+	val = (double)data_TeINTEGER_[pos];
+}
+
+
+inline void TeDecoderMemory::getElement_TeUNSIGNEDLONG(const long& pos, double& val)
+{
+	assert(data_TeUNSIGNEDLONG_ != 0 );
+	val = (double)data_TeUNSIGNEDLONG_[pos];
+}
+
+
+inline void TeDecoderMemory::getElement_TeLONG(const long& pos,double& val)
+{
+	assert(data_TeLONG_ != 0 );
+	val = (double)data_TeLONG_[pos];
+}
+
+
+inline void TeDecoderMemory::getElement_TeFLOAT(const long& pos, double& val)
+{
+	assert(data_TeFLOAT_ != 0 );
+	val = (double)data_TeFLOAT_[pos];
+}
+
+
+inline void TeDecoderMemory::getElement_TeDOUBLE(const long& pos, double& val)
+{
+	assert(data_TeDOUBLE_ != 0 );
+	val = (double)data_TeDOUBLE_[pos];
+}
+
diff --git a/src/terralib/kernel/TeDecoderMemory.h b/src/terralib/kernel/TeDecoderMemory.h
old mode 100755
new mode 100644
index 25c9523..335d6d1
--- a/src/terralib/kernel/TeDecoderMemory.h
+++ b/src/terralib/kernel/TeDecoderMemory.h
@@ -1,279 +1,279 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderMemory.h
-    \brief This file deals with decoding of raster structures as a mulitdimensional matrix in memory.
-*/
-#ifndef  __TERRALIB_INTERNAL_DECODERMEMORY_H
-#define  __TERRALIB_INTERNAL_DECODERMEMORY_H
-
-#include "TeDecoder.h"
-
-//! Implements a decoder to a raster stored as a as a mulitdimensional matrix in memory
-/*
-	This classes tries to allocate the matrix in the memory RAM. No strategies or policies
-	to allocate huge matrices are applied. It also doesn't support multiple bands with different types.
-	For overcome this limitations use the class TeDecoderSmartMem.
-	\sa TeDecoderSmartMem
-*/
-class TL_DLL TeDecoderMemory : public TeDecoder
-{
-public:
-	//! Empty constructor
-	TeDecoderMemory();
-
-	//! Constructor from parameters
-	TeDecoderMemory (const TeRasterParams& par);
-
-	//! Destructor
-	~TeDecoderMemory ();
-
-	//! Writes an element
-	bool setElement (int col,int lin, double val, int band=0);
-
-	//! Reads an element
-	bool getElement (int col,int lin, double &val,int band=0);
-
-	//! Retuns a pointer to a given band
-	/*
-		\note This method is applicable only when band interleaved organization
-	*/
-	void* data (int band=0);
-
-	//! Initalizes the internal structures
-	void init();
-
-	//! Releases the internal structures
-	bool clear();
-
-	//! Allocates the necessary memory
-	bool allocateMemory();
-
-	//! Deallocates the used memory
-	bool resetMemory();
-
-private:
-
-	unsigned int nelems_;
-	unsigned int size_;
-
-	//! Type definition for the getElement function pointer      
-	typedef void (TeDecoderMemory::*GetEleFunctPtrT)( const long& pos, double& val );
-
-	//! Type definition for the setElement function pointer     
-	typedef void (TeDecoderMemory::*SetEleFunctPtrT)( const long& pos, const double& val );
-
-	//! A pointer to the current getElement method following the current data type
-	GetEleFunctPtrT getelement_ptr_;
-
-	//! A pointer to the current setElement method following the current data
-	SetEleFunctPtrT setelement_ptr_;
-
-	//! A casted pointer to the current data
-	unsigned char* data_TeUNSIGNEDCHAR_;  
-
-	//! A casted pointer to the current data
-	char* data_TeCHAR_;  
-
-	//! A casted pointer to the current data
-	unsigned short* data_TeUNSIGNEDSHORT_;  
-
-	//! A casted pointer to the current data
-	short* data_TeSHORT_;  
-
-	//! A casted pointer to the current data
-	int* data_TeINTEGER_;  
-
-	//! A casted pointer to the current data
-	unsigned long* data_TeUNSIGNEDLONG_;  
-
-	//! A casted pointer to the current data
-	long* data_TeLONG_;  
-
-	//! A casted pointer to the current data
-	float* data_TeFLOAT_;
-
-	//! A casted pointer to the current data
-	double* data_TeDOUBLE_;  
-
-	//! Update the function pointer using the current raster parameters   
-	void updateFuncPtr();  
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/      
-	inline void setElement_TeUNSIGNEDCHAR( const long& pos, const double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/   
-	inline void setElement_TeCHAR( const long& pos, const double& val );  
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/   
-	inline void setElement_TeUNSIGNEDSHORT( const long& pos, const double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/   
-	inline void setElement_TeSHORT( const long& pos, const double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/   
-	inline void setElement_TeINTEGER( const long& pos, const double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/   
-	inline void setElement_TeUNSIGNEDLONG( const long& pos, const double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/      
-	inline void setElement_TeLONG( const long& pos, const double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/     
-	inline void setElement_TeFLOAT( const long& pos, const double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/    
-	inline void setElement_TeDOUBLE( const long& pos, const double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/     
-	inline void getElement_TeUNSIGNEDCHAR( const long& pos, double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/  
-	inline void getElement_TeCHAR( const long& pos, double& val );  
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/  
-	inline void getElement_TeUNSIGNEDSHORT( const long& pos, double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/   
-	inline void getElement_TeSHORT( const long& pos, double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/    
-	inline void getElement_TeINTEGER( const long& pos, double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/      
-	inline void getElement_TeUNSIGNEDLONG( const long& pos, double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/      
-	inline void getElement_TeLONG( const long& pos, double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/      
-	inline void getElement_TeFLOAT( const long& pos, double& val );
-
-	/*! \brief Method overload.
-		\param line Line.
-		\param col Column.
-		\param band Band.
-		\param val Pixel value.
-	*/
-	inline void getElement_TeDOUBLE( const long& pos, double& val );  
-};
-
-//! Implements a factory to build decoder to MEMORY raster
-class TL_DLL TeDecoderMemoryFactory : public TeDecoderFactory
-{
-public:
-
-	//! Factory constructor
-	TeDecoderMemoryFactory(const string& name) : TeDecoderFactory(name) {}
-
-	//! Build an object
-	TeDecoder* build (const TeRasterParams& arg)
-	{  return new TeDecoderMemory(arg); }
-};
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderMemory.h
+    \brief This file deals with decoding of raster structures as a mulitdimensional matrix in memory.
+*/
+#ifndef  __TERRALIB_INTERNAL_DECODERMEMORY_H
+#define  __TERRALIB_INTERNAL_DECODERMEMORY_H
+
+#include "TeDecoder.h"
+
+//! Implements a decoder to a raster stored as a as a mulitdimensional matrix in memory
+/*
+	This classes tries to allocate the matrix in the memory RAM. No strategies or policies
+	to allocate huge matrices are applied. It also doesn't support multiple bands with different types.
+	For overcome this limitations use the class TeDecoderSmartMem.
+	\sa TeDecoderSmartMem
+*/
+class TL_DLL TeDecoderMemory : public TeDecoder
+{
+public:
+	//! Empty constructor
+	TeDecoderMemory();
+
+	//! Constructor from parameters
+	TeDecoderMemory (const TeRasterParams& par);
+
+	//! Destructor
+	~TeDecoderMemory ();
+
+	//! Writes an element
+	bool setElement (int col,int lin, double val, int band=0);
+
+	//! Reads an element
+	bool getElement (int col,int lin, double &val,int band=0);
+
+	//! Retuns a pointer to a given band
+	/*
+		\note This method is applicable only when band interleaved organization
+	*/
+	void* data (int band=0);
+
+	//! Initalizes the internal structures
+	void init();
+
+	//! Releases the internal structures
+	bool clear();
+
+	//! Allocates the necessary memory
+	bool allocateMemory();
+
+	//! Deallocates the used memory
+	bool resetMemory();
+
+private:
+
+	unsigned int nelems_;
+	unsigned int size_;
+
+	//! Type definition for the getElement function pointer      
+	typedef void (TeDecoderMemory::*GetEleFunctPtrT)( const long& pos, double& val );
+
+	//! Type definition for the setElement function pointer     
+	typedef void (TeDecoderMemory::*SetEleFunctPtrT)( const long& pos, const double& val );
+
+	//! A pointer to the current getElement method following the current data type
+	GetEleFunctPtrT getelement_ptr_;
+
+	//! A pointer to the current setElement method following the current data
+	SetEleFunctPtrT setelement_ptr_;
+
+	//! A casted pointer to the current data
+	unsigned char* data_TeUNSIGNEDCHAR_;  
+
+	//! A casted pointer to the current data
+	char* data_TeCHAR_;  
+
+	//! A casted pointer to the current data
+	unsigned short* data_TeUNSIGNEDSHORT_;  
+
+	//! A casted pointer to the current data
+	short* data_TeSHORT_;  
+
+	//! A casted pointer to the current data
+	int* data_TeINTEGER_;  
+
+	//! A casted pointer to the current data
+	unsigned long* data_TeUNSIGNEDLONG_;  
+
+	//! A casted pointer to the current data
+	long* data_TeLONG_;  
+
+	//! A casted pointer to the current data
+	float* data_TeFLOAT_;
+
+	//! A casted pointer to the current data
+	double* data_TeDOUBLE_;  
+
+	//! Update the function pointer using the current raster parameters   
+	void updateFuncPtr();  
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/      
+	inline void setElement_TeUNSIGNEDCHAR( const long& pos, const double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/   
+	inline void setElement_TeCHAR( const long& pos, const double& val );  
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/   
+	inline void setElement_TeUNSIGNEDSHORT( const long& pos, const double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/   
+	inline void setElement_TeSHORT( const long& pos, const double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/   
+	inline void setElement_TeINTEGER( const long& pos, const double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/   
+	inline void setElement_TeUNSIGNEDLONG( const long& pos, const double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/      
+	inline void setElement_TeLONG( const long& pos, const double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/     
+	inline void setElement_TeFLOAT( const long& pos, const double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/    
+	inline void setElement_TeDOUBLE( const long& pos, const double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/     
+	inline void getElement_TeUNSIGNEDCHAR( const long& pos, double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/  
+	inline void getElement_TeCHAR( const long& pos, double& val );  
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/  
+	inline void getElement_TeUNSIGNEDSHORT( const long& pos, double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/   
+	inline void getElement_TeSHORT( const long& pos, double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/    
+	inline void getElement_TeINTEGER( const long& pos, double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/      
+	inline void getElement_TeUNSIGNEDLONG( const long& pos, double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/      
+	inline void getElement_TeLONG( const long& pos, double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/      
+	inline void getElement_TeFLOAT( const long& pos, double& val );
+
+	/*! \brief Method overload.
+		\param line Line.
+		\param col Column.
+		\param band Band.
+		\param val Pixel value.
+	*/
+	inline void getElement_TeDOUBLE( const long& pos, double& val );  
+};
+
+//! Implements a factory to build decoder to MEMORY raster
+class TL_DLL TeDecoderMemoryFactory : public TeDecoderFactory
+{
+public:
+
+	//! Factory constructor
+	TeDecoderMemoryFactory(const string& name) : TeDecoderFactory(name) {}
+
+	//! Build an object
+	TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeDecoderMemory(arg); }
+};
+#endif
+
diff --git a/src/terralib/kernel/TeDecoderMemoryMap.cpp b/src/terralib/kernel/TeDecoderMemoryMap.cpp
old mode 100755
new mode 100644
index 58e4486..57ed38b
--- a/src/terralib/kernel/TeDecoderMemoryMap.cpp
+++ b/src/terralib/kernel/TeDecoderMemoryMap.cpp
@@ -1,430 +1,430 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeDecoderMemoryMap.h"
-#include "TeUtils.h"
-#include "TeAsciiFile.h"
-#include <map>
-#include <string>
-
-TeDecoderMemoryMap::TeDecoderMemoryMap ( const TeRasterParams& par )
-{
-	params_ = par;
-	dataInitPos_ = 0;
-	dataInitPos_ = par.offset_;
-	m_lpszFile = 0;
-	m_hFile = 0;
-	params_.decoderIdentifier_ = "MEMMAP";
-	params_.errorMessage_.clear();
-}
-
-TeDecoderMemoryMap::~TeDecoderMemoryMap ()
-{
-	if (m_hFile != 0)
-		clear();
-}
-bool
-TeDecoderMemoryMap::getElement (int col,int lin, double& val,int band)
-{
-	unsigned long position = 0;
-	switch (params_.interleaving_)
-	{
-	case TeRasterParams::TePerPixel:
-		position = params_.nBands()*(params_.ncols_*lin+col)+band;
-		break;
-	case TeRasterParams::TePerLine:
-		position = (params_.nBands()*params_.ncols_*lin)+band*params_.ncols_+col;
-		break;
-	case TeRasterParams::TePerBand:
-		position = band*(params_.ncols_*params_.nlines_)+(params_.ncols_*lin+col);
-		break;
-	}
-	
-	position += dataInitPos_;
-    switch (params_.dataType_[0])
-	{
-	case (TeUNSIGNEDCHAR):
-		val = ((unsigned char*)m_lpszFile)[position];
-		break;
-	case (TeCHAR) :
-		val = ((char*) m_lpszFile)[position];
-		break;
-	case (TeUNSIGNEDSHORT):
-		unsigned short uval;
-		if (params_.swap_)
-			uval = swaps(((unsigned short*)m_lpszFile)[position]);
-		else
-			uval = ((unsigned short*)m_lpszFile)[position];
-		val = uval;
-		break;
-	case (TeSHORT):
-		if (params_.swap_)
-			val = swaps(((short*)m_lpszFile)[position]);
-		else
-			val = ((short*)m_lpszFile)[position];
-		break;
-	case (TeINTEGER):
-		val = ((int*)m_lpszFile)[position];
-		break;
-	case (TeUNSIGNEDLONG):
-		val = ((unsigned long*)m_lpszFile)[position];
-		break;
-	case (TeLONG):
-		val = ((long*)m_lpszFile)[position];
-		break;
-	case (TeFLOAT):
-		val = ((float*)m_lpszFile)[position];
-		break;
-	case (TeDOUBLE):
-		val = ((double*)m_lpszFile)[position];
-		break;
-	default:
-		return false;
-	}
-	return true;
-}
-
-bool
-TeDecoderMemoryMap::setElement (int col,int lin, double val, int band)
-{
-	unsigned long position = 0;
-	switch (params_.interleaving_)
-	{
-	case TeRasterParams::TePerPixel:
-		position = params_.nBands()*(params_.ncols_*lin+col)+band;
-		break;
-	case TeRasterParams::TePerLine:
-		position = (params_.nBands()*params_.ncols_*lin)+band*params_.ncols_+col;
-		break;
-	case TeRasterParams::TePerBand:
-		position = band*(params_.ncols_*params_.nlines_)+(params_.ncols_*lin+col);
-		break;
-	}
-	
-	position += dataInitPos_;
-	switch (params_.dataType_[0])
-	{
-	case (TeUNSIGNEDCHAR):
-		((unsigned char*)m_lpszFile)[position] = (unsigned char) val;
-		break;
-	
-	case (TeCHAR) :
-		((char*) m_lpszFile)[position] = (char) val;
-		break;
-
-	case (TeUNSIGNEDSHORT):
-		if (params_.swap_)
-			((unsigned short*)m_lpszFile)[position] = swaps((unsigned short) val);
-		else
-			((unsigned short*)m_lpszFile)[position] = (unsigned short) val;
-		break;
-
-	case (TeSHORT):
-		if (params_.swap_)
-			((short*)m_lpszFile)[position] = swaps((short) val);
-		else
-			((short*)m_lpszFile)[position] = (short) val;
-		break;
-
-	case (TeINTEGER):
-		((int*)m_lpszFile)[position] = (int) val;
-		break;
-
-	case (TeUNSIGNEDLONG):
-		((unsigned long*)m_lpszFile)[position] = (unsigned long) val;
-		break;
-	
-	case (TeLONG):
-		((long*)m_lpszFile)[position] = (long) val;
-		break;
-
-	case (TeFLOAT):
-		((float*)m_lpszFile)[position] = (float) val;
-		break;
-	
-	case (TeDOUBLE):
-		((double*)m_lpszFile)[position] = val;
-    break;
-    
-	default:
-		return false;
-	}
-	return true;
-}
-
-#ifdef WIN32
-void
-TeDecoderMemoryMap::init()
-{
-	clear();
-	DWORD dwDesiredAccess, dwCreationDisposition, flProtect,dwDesiredAccessV ;
-	if (params_.mode_ == 'c')
-	{
-		params_.writeParametersFile();
-		dwCreationDisposition = CREATE_ALWAYS;
-		dwDesiredAccess = GENERIC_READ | GENERIC_WRITE;
-		flProtect = PAGE_READWRITE;
-		dwDesiredAccessV = FILE_MAP_WRITE;
-	}
-	else if (params_.mode_ == 'w')
-	{
-		params_.readParametersFile();
-		dwCreationDisposition = OPEN_ALWAYS;
-		dwDesiredAccess = GENERIC_READ | GENERIC_WRITE;		
-		flProtect = PAGE_READWRITE;
-		dwDesiredAccessV = FILE_MAP_WRITE;
-	}
-	else 	// default mode: reading
-	{
-		params_.readParametersFile();
-		dwCreationDisposition = OPEN_EXISTING;
-		dwDesiredAccess = GENERIC_READ;		
-		flProtect = PAGE_READONLY;
-		dwDesiredAccessV = FILE_MAP_READ;
-	}
-
-	
-	// calculate the expected file size accordingly to the parameters
-	unsigned long fsize = (long)(params_.nBands()*params_.ncols_*params_.nlines_);    
-	fsize *= params_.elementSize(0);
-	
-	if (fsize <= 0)
-		return;
-	
-	// First open the file
-	m_hFile = CreateFileA(
-		params_.fileName_.c_str(),	// File name
-		dwDesiredAccess,			// Desired access
-		FILE_SHARE_READ| FILE_SHARE_WRITE,	// Allow sharing-- we're only doing a quick scan
-		NULL,								// No security attributes
-		dwCreationDisposition,				// Creation disposition
-		0,									// Ignore file attributes
-		NULL);								// Ignore hTemplateFile
-
-	if (m_hFile == INVALID_HANDLE_VALUE)
-		return;		// could not open file
-			
-	// get the file's size
-	m_dwSize = GetFileSize(m_hFile, NULL);
-	if (m_dwSize == 0xffffffff)
-	{
-		m_hFile = NULL;
-		return;
-	}
-	
-	if (params_.mode_ == 'c')	
-	{
-		if (m_dwSize < fsize)
-		{
-			char lpBuffer[1024];
-			int nNumberOfBytesToWrite = fsize-m_dwSize;
-			unsigned long nNumberOfBytesWritten;  // pointer to number of bytes written
-			for (;nNumberOfBytesToWrite > 1024; nNumberOfBytesToWrite-=1024)
-			{
-				if (!WriteFile(m_hFile, lpBuffer, 1024, &nNumberOfBytesWritten, NULL))
-				{
-					CloseHandle(m_hFile);
-					m_hFile = NULL;
-					return;
-				}
-			}
-			if (!WriteFile(m_hFile, lpBuffer, nNumberOfBytesToWrite, &nNumberOfBytesWritten, NULL))
-			{
-				CloseHandle(m_hFile);
-				m_hFile = NULL;
-				return;
-			}	
-		}
-	}
-	else
-	{
-		if (m_dwSize < fsize)
-			return;
-	}
-
-	// Create a mapping object from the file
-	m_hMapping = CreateFileMapping(
-		m_hFile,		// Handle we got from CreateFile
-		NULL,			// No security attributes
-		flProtect,		// read-write
-		0, 0,			// Max size = current size of file
-		NULL);			// Don't name the mapping object
-		
-	if ( m_hMapping == NULL )
-	{
-		CloseHandle(m_hFile);
-		m_hFile = NULL;
-		return;
-	}
-
-	// Map the file to memory
-	switch (params_.dataType_[0]) {
-	case (TeUNSIGNEDCHAR):
-		m_lpszFile = (unsigned char*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0,	0);
-		break;
-	case (TeCHAR) :
-		m_lpszFile = (char*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0, 0);
-		break;
-	case (TeUNSIGNEDSHORT):
-		m_lpszFile = (unsigned short*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0, 0);
-		break;
-	case (TeSHORT):
-		m_lpszFile = (short*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0,	0);
-		break;
-	case (TeUNSIGNEDLONG):
-		m_lpszFile = (unsigned long*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0,	0);
-		break;
-	case (TeLONG):
-		m_lpszFile = (long*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0, 0);
-		break;
-	case (TeFLOAT):
-		m_lpszFile = (float*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0,	0);
-		break;
-	case (TeDOUBLE):
-		m_lpszFile = (double*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0, 0);
-		break;
-	}
-	if ( m_lpszFile == NULL )
-		return ;
-
-	if (params_.mode_ == 'c')
-	{
-		int b, l, c;
-		for (b=0; b<params_.nBands();++b)
-			for (l=0; l<params_.nlines_;++l)
-				for (c=0; c<params_.ncols_;++c)
-					setElement(c, l, params_.dummy_[b], b);
-	}
-	if (params_.mode_ =='c' || params_.mode_ == 'w')
-		params_.status_ = TeRasterParams::TeReadyToWrite;
-	else 
-		params_.status_ = TeRasterParams::TeReadyToRead;	
-	return;
-}
-
-bool
-TeDecoderMemoryMap::clear()
-{
-	params_.status_ = TeRasterParams::TeNotReady;
-	params_.errorMessage_.clear();
-	if (m_hFile == NULL)
-		return true;
-
-	if ( !UnmapViewOfFile(m_lpszFile) )
-		return false;
-
-	CloseHandle(m_hMapping);
-	CloseHandle(m_hFile);
-	m_hFile = NULL;
-	return true;
-}
-#else
-// Linux version: uses mmap
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-void
-TeDecoderMemoryMap::init()
-{
-	clear();
-	mode_t	mode=0;
-	if (params_.mode_ == 'c') 
-	{
-		m_dwSize = (long)(params_.nBands()*params_.ncols_*params_.nlines_);    
-		m_dwSize *= params_.elementSize(0);
-		if (m_dwSize <= 0)
-			return;
-		params_.writeParametersFile();
-		m_hFile = open(params_.fileName_.c_str(),O_RDWR|O_CREAT,S_IRWXU);
-		mode =  (PROT_READ | PROT_WRITE);
-      		lseek(m_hFile, m_dwSize - 1, SEEK_SET);
-      		write(m_hFile, '\0', 1);	
-	}
-	else if (params_.mode_ == 'r') 
-	{	
-		params_.readParametersFile();
-		m_dwSize = (long)(params_.nBands()*params_.ncols_*params_.nlines_);    
-		m_dwSize *= params_.elementSize(0);
-		if (m_dwSize <= 0)
-			return;
-		m_hFile = open(params_.fileName_.c_str(),O_RDONLY,S_IRWXU);	
-		mode = PROT_READ;
-	}
-	else
-	{
-		params_.readParametersFile();
-		m_dwSize = (long)(params_.nBands()*params_.ncols_*params_.nlines_);    
-		m_dwSize *= params_.elementSize(0);
-		if (m_dwSize <= 0)
-			return;	
-		m_hFile = open(params_.fileName_.c_str(),O_RDWR,S_IRWXU);
-		mode = (PROT_READ | PROT_WRITE);
-	}
-	
-	if (m_hFile == -1)
-		return;				// could not open file
-
-	m_lpszFile  =  mmap(0, m_dwSize, mode, MAP_SHARED, m_hFile, 0);
-	if (((long) m_lpszFile)  == -1 )
-		return;
-
-	if (params_.mode_ == 'c')	
-	{
-		int b, l, c;
-		for (b=0; b<params_.nBands();++b)
-			for (l=0; l<params_.nlines_;++l)
-				for (c=0; c<params_.ncols_;++c)
-					setElement(c, l, params_.dummy_[b], b);
-	}
-	
-	if (params_.mode_ =='c' || params_.mode_ == 'w')
-		params_.status_ = TeRasterParams::TeReadyToWrite;
-	else 
-		params_.status_ = TeRasterParams::TeReadyToRead;	
-	return;
-}
-
-bool
-TeDecoderMemoryMap::clear()
-{
-	params_.status_ = TeRasterParams::TeNotReady;
-	params_.errorMessage_.clear();
-	if (m_lpszFile == 0)
-		return true;
-
-	if ( munmap(m_lpszFile, m_dwSize) == -1)
-		return false;
-	m_lpszFile = 0;
-	close(m_hFile);
-	m_hFile = 0;
-	return true;
-}
-#endif
-
-TeDecoderMemoryMapFactory::TeDecoderMemoryMapFactory(const string& name) : 
-	TeDecoderFactory(name) 
-{
-	TeDecoderFactory::instanceName2Dec()["RAW"] = "MEMMAP";
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeDecoderMemoryMap.h"
+#include "TeUtils.h"
+#include "TeAsciiFile.h"
+#include <map>
+#include <string>
+
+TeDecoderMemoryMap::TeDecoderMemoryMap ( const TeRasterParams& par )
+{
+	params_ = par;
+	dataInitPos_ = 0;
+	dataInitPos_ = par.offset_;
+	m_lpszFile = 0;
+	m_hFile = 0;
+	params_.decoderIdentifier_ = "MEMMAP";
+	params_.errorMessage_.clear();
+}
+
+TeDecoderMemoryMap::~TeDecoderMemoryMap ()
+{
+	if (m_hFile != 0)
+		clear();
+}
+bool
+TeDecoderMemoryMap::getElement (int col,int lin, double& val,int band)
+{
+	unsigned long position = 0;
+	switch (params_.interleaving_)
+	{
+	case TeRasterParams::TePerPixel:
+		position = params_.nBands()*(params_.ncols_*lin+col)+band;
+		break;
+	case TeRasterParams::TePerLine:
+		position = (params_.nBands()*params_.ncols_*lin)+band*params_.ncols_+col;
+		break;
+	case TeRasterParams::TePerBand:
+		position = band*(params_.ncols_*params_.nlines_)+(params_.ncols_*lin+col);
+		break;
+	}
+	
+	position += dataInitPos_;
+    switch (params_.dataType_[0])
+	{
+	case (TeUNSIGNEDCHAR):
+		val = ((unsigned char*)m_lpszFile)[position];
+		break;
+	case (TeCHAR) :
+		val = ((char*) m_lpszFile)[position];
+		break;
+	case (TeUNSIGNEDSHORT):
+		unsigned short uval;
+		if (params_.swap_)
+			uval = swaps(((unsigned short*)m_lpszFile)[position]);
+		else
+			uval = ((unsigned short*)m_lpszFile)[position];
+		val = uval;
+		break;
+	case (TeSHORT):
+		if (params_.swap_)
+			val = swaps(((short*)m_lpszFile)[position]);
+		else
+			val = ((short*)m_lpszFile)[position];
+		break;
+	case (TeINTEGER):
+		val = ((int*)m_lpszFile)[position];
+		break;
+	case (TeUNSIGNEDLONG):
+		val = ((unsigned long*)m_lpszFile)[position];
+		break;
+	case (TeLONG):
+		val = ((long*)m_lpszFile)[position];
+		break;
+	case (TeFLOAT):
+		val = ((float*)m_lpszFile)[position];
+		break;
+	case (TeDOUBLE):
+		val = ((double*)m_lpszFile)[position];
+		break;
+	default:
+		return false;
+	}
+	return true;
+}
+
+bool
+TeDecoderMemoryMap::setElement (int col,int lin, double val, int band)
+{
+	unsigned long position = 0;
+	switch (params_.interleaving_)
+	{
+	case TeRasterParams::TePerPixel:
+		position = params_.nBands()*(params_.ncols_*lin+col)+band;
+		break;
+	case TeRasterParams::TePerLine:
+		position = (params_.nBands()*params_.ncols_*lin)+band*params_.ncols_+col;
+		break;
+	case TeRasterParams::TePerBand:
+		position = band*(params_.ncols_*params_.nlines_)+(params_.ncols_*lin+col);
+		break;
+	}
+	
+	position += dataInitPos_;
+	switch (params_.dataType_[0])
+	{
+	case (TeUNSIGNEDCHAR):
+		((unsigned char*)m_lpszFile)[position] = (unsigned char) val;
+		break;
+	
+	case (TeCHAR) :
+		((char*) m_lpszFile)[position] = (char) val;
+		break;
+
+	case (TeUNSIGNEDSHORT):
+		if (params_.swap_)
+			((unsigned short*)m_lpszFile)[position] = swaps((unsigned short) val);
+		else
+			((unsigned short*)m_lpszFile)[position] = (unsigned short) val;
+		break;
+
+	case (TeSHORT):
+		if (params_.swap_)
+			((short*)m_lpszFile)[position] = swaps((short) val);
+		else
+			((short*)m_lpszFile)[position] = (short) val;
+		break;
+
+	case (TeINTEGER):
+		((int*)m_lpszFile)[position] = (int) val;
+		break;
+
+	case (TeUNSIGNEDLONG):
+		((unsigned long*)m_lpszFile)[position] = (unsigned long) val;
+		break;
+	
+	case (TeLONG):
+		((long*)m_lpszFile)[position] = (long) val;
+		break;
+
+	case (TeFLOAT):
+		((float*)m_lpszFile)[position] = (float) val;
+		break;
+	
+	case (TeDOUBLE):
+		((double*)m_lpszFile)[position] = val;
+    break;
+    
+	default:
+		return false;
+	}
+	return true;
+}
+
+#ifdef WIN32
+void
+TeDecoderMemoryMap::init()
+{
+	clear();
+	DWORD dwDesiredAccess, dwCreationDisposition, flProtect,dwDesiredAccessV ;
+	if (params_.mode_ == 'c')
+	{
+		params_.writeParametersFile();
+		dwCreationDisposition = CREATE_ALWAYS;
+		dwDesiredAccess = GENERIC_READ | GENERIC_WRITE;
+		flProtect = PAGE_READWRITE;
+		dwDesiredAccessV = FILE_MAP_WRITE;
+	}
+	else if (params_.mode_ == 'w')
+	{
+		params_.readParametersFile();
+		dwCreationDisposition = OPEN_ALWAYS;
+		dwDesiredAccess = GENERIC_READ | GENERIC_WRITE;		
+		flProtect = PAGE_READWRITE;
+		dwDesiredAccessV = FILE_MAP_WRITE;
+	}
+	else 	// default mode: reading
+	{
+		params_.readParametersFile();
+		dwCreationDisposition = OPEN_EXISTING;
+		dwDesiredAccess = GENERIC_READ;		
+		flProtect = PAGE_READONLY;
+		dwDesiredAccessV = FILE_MAP_READ;
+	}
+
+	
+	// calculate the expected file size accordingly to the parameters
+	unsigned long fsize = (long)(params_.nBands()*params_.ncols_*params_.nlines_);    
+	fsize *= params_.elementSize(0);
+	
+	if (fsize <= 0)
+		return;
+	
+	// First open the file
+	m_hFile = CreateFileA(
+		params_.fileName_.c_str(),	// File name
+		dwDesiredAccess,			// Desired access
+		FILE_SHARE_READ| FILE_SHARE_WRITE,	// Allow sharing-- we're only doing a quick scan
+		NULL,								// No security attributes
+		dwCreationDisposition,				// Creation disposition
+		0,									// Ignore file attributes
+		NULL);								// Ignore hTemplateFile
+
+	if (m_hFile == INVALID_HANDLE_VALUE)
+		return;		// could not open file
+			
+	// get the file's size
+	m_dwSize = GetFileSize(m_hFile, NULL);
+	if (m_dwSize == 0xffffffff)
+	{
+		m_hFile = NULL;
+		return;
+	}
+	
+	if (params_.mode_ == 'c')	
+	{
+		if (m_dwSize < fsize)
+		{
+			char lpBuffer[1024];
+			int nNumberOfBytesToWrite = fsize-m_dwSize;
+			unsigned long nNumberOfBytesWritten;  // pointer to number of bytes written
+			for (;nNumberOfBytesToWrite > 1024; nNumberOfBytesToWrite-=1024)
+			{
+				if (!WriteFile(m_hFile, lpBuffer, 1024, &nNumberOfBytesWritten, NULL))
+				{
+					CloseHandle(m_hFile);
+					m_hFile = NULL;
+					return;
+				}
+			}
+			if (!WriteFile(m_hFile, lpBuffer, nNumberOfBytesToWrite, &nNumberOfBytesWritten, NULL))
+			{
+				CloseHandle(m_hFile);
+				m_hFile = NULL;
+				return;
+			}	
+		}
+	}
+	else
+	{
+		if (m_dwSize < fsize)
+			return;
+	}
+
+	// Create a mapping object from the file
+	m_hMapping = CreateFileMapping(
+		m_hFile,		// Handle we got from CreateFile
+		NULL,			// No security attributes
+		flProtect,		// read-write
+		0, 0,			// Max size = current size of file
+		NULL);			// Don't name the mapping object
+		
+	if ( m_hMapping == NULL )
+	{
+		CloseHandle(m_hFile);
+		m_hFile = NULL;
+		return;
+	}
+
+	// Map the file to memory
+	switch (params_.dataType_[0]) {
+	case (TeUNSIGNEDCHAR):
+		m_lpszFile = (unsigned char*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0,	0);
+		break;
+	case (TeCHAR) :
+		m_lpszFile = (char*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0, 0);
+		break;
+	case (TeUNSIGNEDSHORT):
+		m_lpszFile = (unsigned short*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0, 0);
+		break;
+	case (TeSHORT):
+		m_lpszFile = (short*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0,	0);
+		break;
+	case (TeUNSIGNEDLONG):
+		m_lpszFile = (unsigned long*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0,	0);
+		break;
+	case (TeLONG):
+		m_lpszFile = (long*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0, 0);
+		break;
+	case (TeFLOAT):
+		m_lpszFile = (float*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0,	0);
+		break;
+	case (TeDOUBLE):
+		m_lpszFile = (double*) MapViewOfFile(m_hMapping, dwDesiredAccessV, 0, 0, 0);
+		break;
+	}
+	if ( m_lpszFile == NULL )
+		return ;
+
+	if (params_.mode_ == 'c')
+	{
+		int b, l, c;
+		for (b=0; b<params_.nBands();++b)
+			for (l=0; l<params_.nlines_;++l)
+				for (c=0; c<params_.ncols_;++c)
+					setElement(c, l, params_.dummy_[b], b);
+	}
+	if (params_.mode_ =='c' || params_.mode_ == 'w')
+		params_.status_ = TeRasterParams::TeReadyToWrite;
+	else 
+		params_.status_ = TeRasterParams::TeReadyToRead;	
+	return;
+}
+
+bool
+TeDecoderMemoryMap::clear()
+{
+	params_.status_ = TeRasterParams::TeNotReady;
+	params_.errorMessage_.clear();
+	if (m_hFile == NULL)
+		return true;
+
+	if ( !UnmapViewOfFile(m_lpszFile) )
+		return false;
+
+	CloseHandle(m_hMapping);
+	CloseHandle(m_hFile);
+	m_hFile = NULL;
+	return true;
+}
+#else
+// Linux version: uses mmap
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+void
+TeDecoderMemoryMap::init()
+{
+	clear();
+	mode_t	mode=0;
+	if (params_.mode_ == 'c') 
+	{
+		m_dwSize = (long)(params_.nBands()*params_.ncols_*params_.nlines_);    
+		m_dwSize *= params_.elementSize(0);
+		if (m_dwSize <= 0)
+			return;
+		params_.writeParametersFile();
+		m_hFile = open(params_.fileName_.c_str(),O_RDWR|O_CREAT,S_IRWXU);
+		mode =  (PROT_READ | PROT_WRITE);
+      		lseek(m_hFile, m_dwSize - 1, SEEK_SET);
+      		write(m_hFile, '\0', 1);	
+	}
+	else if (params_.mode_ == 'r') 
+	{	
+		params_.readParametersFile();
+		m_dwSize = (long)(params_.nBands()*params_.ncols_*params_.nlines_);    
+		m_dwSize *= params_.elementSize(0);
+		if (m_dwSize <= 0)
+			return;
+		m_hFile = open(params_.fileName_.c_str(),O_RDONLY,S_IRWXU);	
+		mode = PROT_READ;
+	}
+	else
+	{
+		params_.readParametersFile();
+		m_dwSize = (long)(params_.nBands()*params_.ncols_*params_.nlines_);    
+		m_dwSize *= params_.elementSize(0);
+		if (m_dwSize <= 0)
+			return;	
+		m_hFile = open(params_.fileName_.c_str(),O_RDWR,S_IRWXU);
+		mode = (PROT_READ | PROT_WRITE);
+	}
+	
+	if (m_hFile == -1)
+		return;				// could not open file
+
+	m_lpszFile  =  mmap(0, m_dwSize, mode, MAP_SHARED, m_hFile, 0);
+	if (((long) m_lpszFile)  == -1 )
+		return;
+
+	if (params_.mode_ == 'c')	
+	{
+		int b, l, c;
+		for (b=0; b<params_.nBands();++b)
+			for (l=0; l<params_.nlines_;++l)
+				for (c=0; c<params_.ncols_;++c)
+					setElement(c, l, params_.dummy_[b], b);
+	}
+	
+	if (params_.mode_ =='c' || params_.mode_ == 'w')
+		params_.status_ = TeRasterParams::TeReadyToWrite;
+	else 
+		params_.status_ = TeRasterParams::TeReadyToRead;	
+	return;
+}
+
+bool
+TeDecoderMemoryMap::clear()
+{
+	params_.status_ = TeRasterParams::TeNotReady;
+	params_.errorMessage_.clear();
+	if (m_lpszFile == 0)
+		return true;
+
+	if ( munmap(m_lpszFile, m_dwSize) == -1)
+		return false;
+	m_lpszFile = 0;
+	close(m_hFile);
+	m_hFile = 0;
+	return true;
+}
+#endif
+
+TeDecoderMemoryMapFactory::TeDecoderMemoryMapFactory(const string& name) : 
+	TeDecoderFactory(name) 
+{
+	TeDecoderFactory::instanceName2Dec()["RAW"] = "MEMMAP";
+}
diff --git a/src/terralib/kernel/TeDecoderMemoryMap.h b/src/terralib/kernel/TeDecoderMemoryMap.h
old mode 100755
new mode 100644
index a89e282..93783c3
--- a/src/terralib/kernel/TeDecoderMemoryMap.h
+++ b/src/terralib/kernel/TeDecoderMemoryMap.h
@@ -1,94 +1,94 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderMemoryMap.h
-    \brief This file deals with decoding of raster data in a bynary file, using the memory map operation system functionality
-*/
-#ifndef  __TERRALIB_INTERNAL_DECODERMEMORYMAP_H
-#define  __TERRALIB_INTERNAL_DECODERMEMORYMAP_H
-
-#include "TeDecoder.h"
-
-#ifdef WIN32
-#include <windows.h>
-#include <winbase.h>
-#else
-#include <sys/mman.h>
-#endif
-
- 
-//! Implements a decoder to raster data in a bynary file, using the memory map operation system functionality
-/*
-	Due to limits set by the operating system, the maximum amount of data you can map 
-	with a single instance of a memory map is 2^31 - 1 (or 2 GB).
-*/
-class TL_DLL TeDecoderMemoryMap : public TeDecoder
-{
-public:
-	//! Constructor
-	TeDecoderMemoryMap ( const TeRasterParams& );
-
-	//! Destructor
-	~TeDecoderMemoryMap ();
-
-	//! Reads an element
-	bool setElement (int col,int lin, double val, int band=0);
-
-	//! Writes an element
-	bool getElement (int col,int lin, double &val,int band=0);
-
-	//! Initalizes the internal structures
-	virtual void init();
-
-	//! Releases the internal structures
-	virtual bool clear();
-
-private:
-	long	dataInitPos_;
-#ifdef WIN32
-// Windows support to file memory mapping
-	HANDLE  m_hFile;			// Handle to file we're currently zapping
-	HANDLE	m_hMapping;			// Handle to memory-mapping of that file
-	LPVOID  m_lpszFile;			// Pointer to view of file mapped to memory
-	DWORD	m_dwSize;
-#else
-// Linux support to file memory mapping
-	int	m_hFile;			//(fd) Handle to file we're currently zapping
-	void*	m_lpszFile;			// Pointer to view of file mapped to memory
-	long	m_dwSize;
-#endif
-};
-
-//! Implements a factory to build memory map decoder
-class TL_DLL TeDecoderMemoryMapFactory : public TeDecoderFactory
-{
-public:
-
-	//! Factory constructor
-	TeDecoderMemoryMapFactory(const string& name);
-
-	//! Builds the object
-	virtual TeDecoder* build (const TeRasterParams& arg)
-	{  return new TeDecoderMemoryMap(arg); }
-};
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderMemoryMap.h
+    \brief This file deals with decoding of raster data in a bynary file, using the memory map operation system functionality
+*/
+#ifndef  __TERRALIB_INTERNAL_DECODERMEMORYMAP_H
+#define  __TERRALIB_INTERNAL_DECODERMEMORYMAP_H
+
+#include "TeDecoder.h"
+
+#ifdef WIN32
+#include <windows.h>
+#include <winbase.h>
+#else
+#include <sys/mman.h>
+#endif
+
+ 
+//! Implements a decoder to raster data in a bynary file, using the memory map operation system functionality
+/*
+	Due to limits set by the operating system, the maximum amount of data you can map 
+	with a single instance of a memory map is 2^31 - 1 (or 2 GB).
+*/
+class TL_DLL TeDecoderMemoryMap : public TeDecoder
+{
+public:
+	//! Constructor
+	TeDecoderMemoryMap ( const TeRasterParams& );
+
+	//! Destructor
+	~TeDecoderMemoryMap ();
+
+	//! Reads an element
+	bool setElement (int col,int lin, double val, int band=0);
+
+	//! Writes an element
+	bool getElement (int col,int lin, double &val,int band=0);
+
+	//! Initalizes the internal structures
+	virtual void init();
+
+	//! Releases the internal structures
+	virtual bool clear();
+
+private:
+	long	dataInitPos_;
+#ifdef WIN32
+// Windows support to file memory mapping
+	HANDLE  m_hFile;			// Handle to file we're currently zapping
+	HANDLE	m_hMapping;			// Handle to memory-mapping of that file
+	LPVOID  m_lpszFile;			// Pointer to view of file mapped to memory
+	DWORD	m_dwSize;
+#else
+// Linux support to file memory mapping
+	int	m_hFile;			//(fd) Handle to file we're currently zapping
+	void*	m_lpszFile;			// Pointer to view of file mapped to memory
+	long	m_dwSize;
+#endif
+};
+
+//! Implements a factory to build memory map decoder
+class TL_DLL TeDecoderMemoryMapFactory : public TeDecoderFactory
+{
+public:
+
+	//! Factory constructor
+	TeDecoderMemoryMapFactory(const string& name);
+
+	//! Builds the object
+	virtual TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeDecoderMemoryMap(arg); }
+};
+#endif
+
diff --git a/src/terralib/kernel/TeDecoderSPR.cpp b/src/terralib/kernel/TeDecoderSPR.cpp
old mode 100755
new mode 100644
index eb22cdf..e378cd2
--- a/src/terralib/kernel/TeDecoderSPR.cpp
+++ b/src/terralib/kernel/TeDecoderSPR.cpp
@@ -1,402 +1,402 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeException.h"
-#include "TeDecoderSPR.h"
-#include "TeAsciiFile.h"
-#include "TeUtils.h"
-
-#include <cstring>
-#include <cstdlib>
-#include <fstream>
-using std::ifstream;
-using std::ofstream;
-
-TeDecoderSPR::TeDecoderSPR() : 
-	TeDecoderSmartMem(),
-	isModified_(false)
-{	
-	params_.decoderIdentifier_ = "SPR";	
-}
-
-TeDecoderSPR::TeDecoderSPR (const TeRasterParams& par) : 
-	TeDecoderSmartMem(),
-	isModified_(false)
-{	
-	params_.errorMessage_.clear();
-	if (par.fileName_.empty())
-		return;
-	params_ = par;
-	params_.decoderIdentifier_ = "SPR";
-	if (params_.mode_ == 'w' || params_.mode_ == 'r')
-		readParameters();
-}
-
-TeDecoderSPR::~TeDecoderSPR()
-{
-	if ( isModified_ && (params_.mode_ == 'w' || params_.mode_ == 'c'))
-	{			// save contents to disk
-		try
-		{
-			TeAsciiFile sFile(params_.fileName_,"w+");
-			if (writeParameters(sFile))
-				saveData(sFile);
-		}
-		catch (...)
-		{
-		}
-	}
-	TeDecoderSmartMem::clear();
-}
-
-bool
-TeDecoderSPR::clear()
-{
-	if ( isModified_ && (params_.mode_ == 'w' || params_.mode_ == 'c'))
-	{			// save contents to disk
-		try
-		{
-			TeAsciiFile sFile(params_.fileName_,"w+");
-			if (writeParameters(sFile))
-				saveData(sFile);
-		}
-		catch (...)
-		{
-		}
-		isModified_ = false;
-	}
-	TeDecoderSmartMem::clear();
-	return true;
-}
-
-bool 
-TeDecoderSPR::readParameters()
-{
-	try
-	{
-		TeAsciiFile	pFile (params_.fileName_);
-		string name;
-
-		// check if there is the GRIDDEF section
-		while (pFile.isNotAtEOF())
-		{
-			name = pFile.readString();
-			if (name[0] =='/' && name[1] == '/')	// skip comments
-				pFile.findNewLine();
-			else if (name == "GRIDDEF")
-				break;
-		}
-		if (!pFile.isNotAtEOF())					// unexpected end of file
-			return false;
-		
-		// read INFO section
-		double x1, y2;
-		int ncols;
-		double dummy;
-
-		// Expected format to grid definition:
-		// GRIDDEF  <ncols>  <nlins>  <X1>  <Y2>  <resX>  <resY>  <nodatavalue>
-		params_.ncols_ = ncols = pFile.readInt();
-		params_.nlines_ = pFile.readInt();
-		x1 = pFile.readFloat();
-		y2 = pFile.readFloat();
-		params_.resx_ = pFile.readFloat();
-		params_.resy_ = pFile.readFloat();
-		params_.nBands(1);
-		dummy = pFile.readFloat();
-		params_.useDummy_ = true;
-		params_.setDummy(dummy);
-
-		do
-		{
-			name = pFile.readString();
-			if (name[0] =='/' && name[1] == '/')	// skip comments
-				pFile.findNewLine();
-		} while (pFile.isNotAtEOF() && name != "GRIDCLASS" && name != "INFO_END");
-		
-		if (name == "GRIDCLASS" )
-		{
-			params_.setPhotometric(TeRasterParams::TePallete);
-			params_.setDataType(TeUNSIGNEDCHAR);
-
-			// Expected format GRIDCLASS  <nclass>  <ncolorR>  <ncolorG>  <ncolorB>  <nameclass>
-			params_.lutr_.clear();
-			params_.lutg_.clear();
-			params_.lutb_.clear();
-
-			params_.lutr_.insert(params_.lutr_.begin(),256,0);
-			params_.lutg_.insert(params_.lutg_.begin(),256,0);
-			params_.lutb_.insert(params_.lutb_.begin(),256,0);
-			
-			vector<string> lnames;
-			name = pFile.readString();
-			while (pFile.isNotAtEOF() && name != "INFO_END") // loop through all class definitions
-			{
-				int index = atoi(name.c_str());
-				params_.lutr_[index] = pFile.readInt(); 
-				params_.lutg_[index] = pFile.readInt(); 
-				params_.lutb_[index] = pFile.readInt(); 
-				lnames.clear();
-				pFile.readStringList(lnames);   // class name			
-				name = pFile.readString();	 // next index		
-			} 
-
-			if (!pFile.isNotAtEOF())	// unexpected end of file
-				return false;
-		}
-		else if (name == "INFO_END")
-		{
-			params_.setDataType(TeDOUBLE);
-			params_.setPhotometric(TeRasterParams::TeMultiBand);
-		}
-		params_.topLeftResolutionSize(x1,y2,params_.resx_,params_.resy_,
-				                      params_.ncols_,params_.nlines_,false);
-		TeProjection* pp = new TeNoProjection();
-		params_.projection(pp);
-		delete pp;
-	}
-	catch(...)
-	{
-		return false;
-	}
-	return true;
-}
-
-bool
-TeDecoderSPR::readFile(const string& filename)
-{
-	string valstring;
-	try 
-	{
-		TeAsciiFile	pFile (filename);
-		string name;
-		while (pFile.isNotAtEOF() && name != "INFO_END")
-		{
-			name = pFile.readString();
-			if (name[0] =='/' && name[1] == '/')	// skip comments
-				pFile.findNewLine();
-		}
-		if (!pFile.isNotAtEOF())					// unexpected end of file
-			return false;
-
-		for (int lin = 0; lin < params_.nlines_; lin++)
-		{
-			for (int col = 0; col < params_.ncols_; col++)
-			{
-				valstring = pFile.readString();
-				setElement(col,lin,atof(valstring.c_str()));
-			}
-		}
-	}
-	catch(...)
-	{
-		return false;
-	}
-	return true;
-}
-
-void
-TeDecoderSPR::init()
-{
-	params_.status_= TeRasterParams::TeNotReady;
-	int nb = params_.nBands();
-	if (nb != 1 )
-	{
-		params_.errorMessage_ = "Ascii SPRING can store raster with only 1 band.";
-		return;
-	}
-
-	// 1 - check if file exists and has the necessary permission
-	if (params_.mode_ == 'c')	// creating a new file
-	{
-		ofstream dataFile(params_.fileName_.c_str()); // try to (re)create the file
-		if (!dataFile)
-		{
-			params_.errorMessage_ = "Fail to (re)create the raster the file:" + params_.fileName_;
-			return;
-		}
-	}
-	else if (params_.mode_ == 'w')
-	{
-		ifstream dataFile(params_.fileName_.c_str()); // check if file exists
-		if (!dataFile)
-		{
-			params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
-			return; 
-		}
-		dataFile.close();
-	}
-	else if (params_.mode_ == 'r')
-	{
-		ifstream dataFile(params_.fileName_.c_str()); // check if file exists
-		if (!dataFile)
-		{
-			params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
-			return; 
-		}
-		dataFile.close();	
-	}
-
-	// 2 - check if there is memory enough to handle the data
-	TeDecoderSmartMem::init();		
-	if (params_.status_ == TeRasterParams::TeNotReady)
-		return;
-
-	// 3 - try to read the data
-	if (params_.mode_ == 'c')	// creating a new file
-	{
-		try
-		{
-			params_.status_ = TeRasterParams::TeNotReady;
-			TeAsciiFile sFile(params_.fileName_,"w+");
-			if (!writeParameters(sFile) || !saveData(sFile))
-			{
-				params_.errorMessage_ = "Fail to write the raster to file";
-				return;
-			}
-			params_.status_ = TeRasterParams::TeReadyToWrite;
-		}
-		catch (...)
-		{
-			params_.errorMessage_ = "Fail to write the raster to file";
-		}
-	}
-	else if (params_.mode_ == 'w')
-	{
-		if (!readFile(params_.fileName_))
-		{
-			params_.status_ = TeRasterParams::TeNotReady;
-			params_.errorMessage_ = "Fail to read the raster the file:" + params_.fileName_;
-			return; 
-		}
-		params_.status_ = TeRasterParams::TeReadyToWrite;
-	}
-	else if (params_.mode_ == 'r')
-	{
-		if (!readFile(params_.fileName_))
-		{
-			params_.status_ = TeRasterParams::TeNotReady;
-			params_.errorMessage_ = "Fail to read the raster the file:" + params_.fileName_;
-			return; 
-		}
-		params_.status_ = TeRasterParams::TeReadyToRead;	
-	}
-}
-
-bool 
-TeDecoderSPR::writeParameters(TeAsciiFile& pFile)
-{
-	string name;
-	try
-	{
-		TeBox box = params_.boundingBox();
-		name = "GRIDREG\nINFO\n";
-		pFile.writeString(name);
-		name = "//Formato GRIDDEF  <ncols>  <nlins>  <X1>  <Y2>  <resX>  <resY>  <nodatavalue>\n";
-		pFile.writeString(name);
-		name = "GRIDDEF ";
-		pFile.writeString(name);
-		name = Te2String(params_.ncols_) + " " + Te2String(params_.nlines_) + " ";
-		pFile.writeString(name);
-		name = Te2String(box.x1_,6) + " " + Te2String(box.y2_,6) + " ";
-		pFile.writeString(name);
-		name = Te2String(params_.resx_,6) + " " + Te2String(params_.resy_,6) + " ";
-		pFile.writeString(name);
-		name = Te2String(params_.dummy_[0],6) + "\n";
-		pFile.writeString(name);
-
-		if (params_.photometric_[0] == TeRasterParams::TePallete)
-		{
-			name = "//Formato GRIDCLASS  <nclass>  <ncolorR>  <ncolorG>  <ncolorB>  <nameclass>\n";
-			pFile.writeString(name);
-			name = "GRIDCLASS\n";
-			pFile.writeString(name);
-			for (unsigned int nc=0; nc<params_.lutr_.size(); ++nc)
-			{
-				name = Te2String(nc) + " " + Te2String(params_.lutr_[nc]);
-				name += " " + Te2String(params_.lutg_[nc]) + " " + Te2String(params_.lutb_[nc]);
-				name += " c" + Te2String(nc) + "\n";
-				pFile.writeString(name);
-			}
-		}
-		name = "INFO_END\n";
-		pFile.writeString(name);
-	}
-	catch (...)
-	{
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDecoderSPR::saveData(TeAsciiFile& pFile)
-{
-	bool isi = (params_.dataType_[0] != TeDOUBLE) && (params_.dataType_[0] != TeFLOAT);
-
-	FILE* fp = pFile.FilePtr();
-	char fmt[100];
-	if (isi)
-		strcpy(fmt,"%.0f ");
-	else
-		strcpy(fmt,"%f ");
-	try
-	{
-		double d;
-		for (int l=0; l<params_.nlines_; ++l)
-		{
-			for (int c=0; c<params_.ncols_; ++c)
-			{
-				TeDecoderSmartMem::getElement(c,l,d);
-				fprintf(fp,fmt,d);
-			}
-			pFile.writeNewLine();
-		}
-		string spc = "END\n";
-		pFile.writeString(spc);
-	}
-	catch(...)
-	{
-		return false;
-	}
-	return true;
-}
-
-bool 
-TeDecoderSPR::setElement (int col,int lin, double val, int band)
-{
-	if (TeDecoderSmartMem::setElement(col,lin,val,band))
-	{
-		isModified_ = true;
-		return true;
-	}
-	else
-		return false;
-}
-
-
-TeDecoderSPRFactory::TeDecoderSPRFactory(const string& name): 
-	TeDecoderFactory(name) 
-{
-	TeDecoderFactory::instanceName2Dec()["SPR"] = "SPR";
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeException.h"
+#include "TeDecoderSPR.h"
+#include "TeAsciiFile.h"
+#include "TeUtils.h"
+
+#include <cstring>
+#include <cstdlib>
+#include <fstream>
+using std::ifstream;
+using std::ofstream;
+
+TeDecoderSPR::TeDecoderSPR() : 
+	TeDecoderSmartMem(),
+	isModified_(false)
+{	
+	params_.decoderIdentifier_ = "SPR";	
+}
+
+TeDecoderSPR::TeDecoderSPR (const TeRasterParams& par) : 
+	TeDecoderSmartMem(),
+	isModified_(false)
+{	
+	params_.errorMessage_.clear();
+	if (par.fileName_.empty())
+		return;
+	params_ = par;
+	params_.decoderIdentifier_ = "SPR";
+	if (params_.mode_ == 'w' || params_.mode_ == 'r')
+		readParameters();
+}
+
+TeDecoderSPR::~TeDecoderSPR()
+{
+	if ( isModified_ && (params_.mode_ == 'w' || params_.mode_ == 'c'))
+	{			// save contents to disk
+		try
+		{
+			TeAsciiFile sFile(params_.fileName_,"w+");
+			if (writeParameters(sFile))
+				saveData(sFile);
+		}
+		catch (...)
+		{
+		}
+	}
+	TeDecoderSmartMem::clear();
+}
+
+bool
+TeDecoderSPR::clear()
+{
+	if ( isModified_ && (params_.mode_ == 'w' || params_.mode_ == 'c'))
+	{			// save contents to disk
+		try
+		{
+			TeAsciiFile sFile(params_.fileName_,"w+");
+			if (writeParameters(sFile))
+				saveData(sFile);
+		}
+		catch (...)
+		{
+		}
+		isModified_ = false;
+	}
+	TeDecoderSmartMem::clear();
+	return true;
+}
+
+bool 
+TeDecoderSPR::readParameters()
+{
+	try
+	{
+		TeAsciiFile	pFile (params_.fileName_);
+		string name;
+
+		// check if there is the GRIDDEF section
+		while (pFile.isNotAtEOF())
+		{
+			name = pFile.readString();
+			if (name[0] =='/' && name[1] == '/')	// skip comments
+				pFile.findNewLine();
+			else if (name == "GRIDDEF")
+				break;
+		}
+		if (!pFile.isNotAtEOF())					// unexpected end of file
+			return false;
+		
+		// read INFO section
+		double x1, y2;
+		int ncols;
+		double dummy;
+
+		// Expected format to grid definition:
+		// GRIDDEF  <ncols>  <nlins>  <X1>  <Y2>  <resX>  <resY>  <nodatavalue>
+		params_.ncols_ = ncols = pFile.readInt();
+		params_.nlines_ = pFile.readInt();
+		x1 = pFile.readFloat();
+		y2 = pFile.readFloat();
+		params_.resx_ = pFile.readFloat();
+		params_.resy_ = pFile.readFloat();
+		params_.nBands(1);
+		dummy = pFile.readFloat();
+		params_.useDummy_ = true;
+		params_.setDummy(dummy);
+
+		do
+		{
+			name = pFile.readString();
+			if (name[0] =='/' && name[1] == '/')	// skip comments
+				pFile.findNewLine();
+		} while (pFile.isNotAtEOF() && name != "GRIDCLASS" && name != "INFO_END");
+		
+		if (name == "GRIDCLASS" )
+		{
+			params_.setPhotometric(TeRasterParams::TePallete);
+			params_.setDataType(TeUNSIGNEDCHAR);
+
+			// Expected format GRIDCLASS  <nclass>  <ncolorR>  <ncolorG>  <ncolorB>  <nameclass>
+			params_.lutr_.clear();
+			params_.lutg_.clear();
+			params_.lutb_.clear();
+
+			params_.lutr_.insert(params_.lutr_.begin(),256,0);
+			params_.lutg_.insert(params_.lutg_.begin(),256,0);
+			params_.lutb_.insert(params_.lutb_.begin(),256,0);
+			
+			vector<string> lnames;
+			name = pFile.readString();
+			while (pFile.isNotAtEOF() && name != "INFO_END") // loop through all class definitions
+			{
+				int index = atoi(name.c_str());
+				params_.lutr_[index] = pFile.readInt(); 
+				params_.lutg_[index] = pFile.readInt(); 
+				params_.lutb_[index] = pFile.readInt(); 
+				lnames.clear();
+				pFile.readStringList(lnames);   // class name			
+				name = pFile.readString();	 // next index		
+			} 
+
+			if (!pFile.isNotAtEOF())	// unexpected end of file
+				return false;
+		}
+		else if (name == "INFO_END")
+		{
+			params_.setDataType(TeDOUBLE);
+			params_.setPhotometric(TeRasterParams::TeMultiBand);
+		}
+		params_.topLeftResolutionSize(x1,y2,params_.resx_,params_.resy_,
+				                      params_.ncols_,params_.nlines_,false);
+		TeProjection* pp = new TeNoProjection();
+		params_.projection(pp);
+		delete pp;
+	}
+	catch(...)
+	{
+		return false;
+	}
+	return true;
+}
+
+bool
+TeDecoderSPR::readFile(const string& filename)
+{
+	string valstring;
+	try 
+	{
+		TeAsciiFile	pFile (filename);
+		string name;
+		while (pFile.isNotAtEOF() && name != "INFO_END")
+		{
+			name = pFile.readString();
+			if (name[0] =='/' && name[1] == '/')	// skip comments
+				pFile.findNewLine();
+		}
+		if (!pFile.isNotAtEOF())					// unexpected end of file
+			return false;
+
+		for (int lin = 0; lin < params_.nlines_; lin++)
+		{
+			for (int col = 0; col < params_.ncols_; col++)
+			{
+				valstring = pFile.readString();
+				setElement(col,lin,atof(valstring.c_str()));
+			}
+		}
+	}
+	catch(...)
+	{
+		return false;
+	}
+	return true;
+}
+
+void
+TeDecoderSPR::init()
+{
+	params_.status_= TeRasterParams::TeNotReady;
+	int nb = params_.nBands();
+	if (nb != 1 )
+	{
+		params_.errorMessage_ = "Ascii SPRING can store raster with only 1 band.";
+		return;
+	}
+
+	// 1 - check if file exists and has the necessary permission
+	if (params_.mode_ == 'c')	// creating a new file
+	{
+		ofstream dataFile(params_.fileName_.c_str()); // try to (re)create the file
+		if (!dataFile)
+		{
+			params_.errorMessage_ = "Fail to (re)create the raster the file:" + params_.fileName_;
+			return;
+		}
+	}
+	else if (params_.mode_ == 'w')
+	{
+		ifstream dataFile(params_.fileName_.c_str()); // check if file exists
+		if (!dataFile)
+		{
+			params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
+			return; 
+		}
+		dataFile.close();
+	}
+	else if (params_.mode_ == 'r')
+	{
+		ifstream dataFile(params_.fileName_.c_str()); // check if file exists
+		if (!dataFile)
+		{
+			params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
+			return; 
+		}
+		dataFile.close();	
+	}
+
+	// 2 - check if there is memory enough to handle the data
+	TeDecoderSmartMem::init();		
+	if (params_.status_ == TeRasterParams::TeNotReady)
+		return;
+
+	// 3 - try to read the data
+	if (params_.mode_ == 'c')	// creating a new file
+	{
+		try
+		{
+			params_.status_ = TeRasterParams::TeNotReady;
+			TeAsciiFile sFile(params_.fileName_,"w+");
+			if (!writeParameters(sFile) || !saveData(sFile))
+			{
+				params_.errorMessage_ = "Fail to write the raster to file";
+				return;
+			}
+			params_.status_ = TeRasterParams::TeReadyToWrite;
+		}
+		catch (...)
+		{
+			params_.errorMessage_ = "Fail to write the raster to file";
+		}
+	}
+	else if (params_.mode_ == 'w')
+	{
+		if (!readFile(params_.fileName_))
+		{
+			params_.status_ = TeRasterParams::TeNotReady;
+			params_.errorMessage_ = "Fail to read the raster the file:" + params_.fileName_;
+			return; 
+		}
+		params_.status_ = TeRasterParams::TeReadyToWrite;
+	}
+	else if (params_.mode_ == 'r')
+	{
+		if (!readFile(params_.fileName_))
+		{
+			params_.status_ = TeRasterParams::TeNotReady;
+			params_.errorMessage_ = "Fail to read the raster the file:" + params_.fileName_;
+			return; 
+		}
+		params_.status_ = TeRasterParams::TeReadyToRead;	
+	}
+}
+
+bool 
+TeDecoderSPR::writeParameters(TeAsciiFile& pFile)
+{
+	string name;
+	try
+	{
+		TeBox box = params_.boundingBox();
+		name = "GRIDREG\nINFO\n";
+		pFile.writeString(name);
+		name = "//Formato GRIDDEF  <ncols>  <nlins>  <X1>  <Y2>  <resX>  <resY>  <nodatavalue>\n";
+		pFile.writeString(name);
+		name = "GRIDDEF ";
+		pFile.writeString(name);
+		name = Te2String(params_.ncols_) + " " + Te2String(params_.nlines_) + " ";
+		pFile.writeString(name);
+		name = Te2String(box.x1_,6) + " " + Te2String(box.y2_,6) + " ";
+		pFile.writeString(name);
+		name = Te2String(params_.resx_,6) + " " + Te2String(params_.resy_,6) + " ";
+		pFile.writeString(name);
+		name = Te2String(params_.dummy_[0],6) + "\n";
+		pFile.writeString(name);
+
+		if (params_.photometric_[0] == TeRasterParams::TePallete)
+		{
+			name = "//Formato GRIDCLASS  <nclass>  <ncolorR>  <ncolorG>  <ncolorB>  <nameclass>\n";
+			pFile.writeString(name);
+			name = "GRIDCLASS\n";
+			pFile.writeString(name);
+			for (unsigned int nc=0; nc<params_.lutr_.size(); ++nc)
+			{
+				name = Te2String(nc) + " " + Te2String(params_.lutr_[nc]);
+				name += " " + Te2String(params_.lutg_[nc]) + " " + Te2String(params_.lutb_[nc]);
+				name += " c" + Te2String(nc) + "\n";
+				pFile.writeString(name);
+			}
+		}
+		name = "INFO_END\n";
+		pFile.writeString(name);
+	}
+	catch (...)
+	{
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDecoderSPR::saveData(TeAsciiFile& pFile)
+{
+	bool isi = (params_.dataType_[0] != TeDOUBLE) && (params_.dataType_[0] != TeFLOAT);
+
+	FILE* fp = pFile.FilePtr();
+	char fmt[100];
+	if (isi)
+		strcpy(fmt,"%.0f ");
+	else
+		strcpy(fmt,"%f ");
+	try
+	{
+		double d;
+		for (int l=0; l<params_.nlines_; ++l)
+		{
+			for (int c=0; c<params_.ncols_; ++c)
+			{
+				TeDecoderSmartMem::getElement(c,l,d);
+				fprintf(fp,fmt,d);
+			}
+			pFile.writeNewLine();
+		}
+		string spc = "END\n";
+		pFile.writeString(spc);
+	}
+	catch(...)
+	{
+		return false;
+	}
+	return true;
+}
+
+bool 
+TeDecoderSPR::setElement (int col,int lin, double val, int band)
+{
+	if (TeDecoderSmartMem::setElement(col,lin,val,band))
+	{
+		isModified_ = true;
+		return true;
+	}
+	else
+		return false;
+}
+
+
+TeDecoderSPRFactory::TeDecoderSPRFactory(const string& name): 
+	TeDecoderFactory(name) 
+{
+	TeDecoderFactory::instanceName2Dec()["SPR"] = "SPR";
+}
diff --git a/src/terralib/kernel/TeDecoderSPR.h b/src/terralib/kernel/TeDecoderSPR.h
old mode 100755
new mode 100644
index 782ea78..3586944
--- a/src/terralib/kernel/TeDecoderSPR.h
+++ b/src/terralib/kernel/TeDecoderSPR.h
@@ -1,80 +1,80 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderSPR.h
-    \brief This file deals with decoding of raster data in a ASCII SPRING format
-*/
-#ifndef  __TERRALIB_INTERNAL_DECODERSPR_H
-#define  __TERRALIB_INTERNAL_DECODERSPR_H
-
-#include "TeDecoderSmartMem.h"
-
-class TeAsciiFile;
-
-//! Implements a decoder for raster data in ASCII-SPRING format
-/*! The description of this format can be found at SPRING website <http://www.dpi.inpe.br/spring>.\par
-	The default file extension associated to this format is ".spr".
-*/
-class TL_DLL TeDecoderSPR : public TeDecoderSmartMem
-{
-public:
-	//! Empty constructor
-	TeDecoderSPR();
-
-	//! Constructor from some parameters
-	TeDecoderSPR(const TeRasterParams& par);
-
-	//! Destructor
-	~TeDecoderSPR();
-
-	//! Intializes the internal structures
-	void init();
-
-	//! Releases the internal structures
-	bool clear();
-
-	//! Writes an element
-	bool setElement (int col,int lin, double val, int band=0);
-
-private:
-
-	bool isModified_;
-
-    bool readFile(const string& filename);
-	bool readParameters();
-	bool writeParameters(TeAsciiFile& pFile);
-	bool saveData(TeAsciiFile& pFile);
-};
-
-//! Implements a factory to build decoders to ASCII-SPRING raster
-class TL_DLL TeDecoderSPRFactory : public TeDecoderFactory
-{
-public:
-	//! Factory constructor
-	TeDecoderSPRFactory(const string& name);
-
-	//! Builds the object
-	TeDecoder* build (const TeRasterParams& arg)
-	{  return new TeDecoderSPR(arg); }
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderSPR.h
+    \brief This file deals with decoding of raster data in a ASCII SPRING format
+*/
+#ifndef  __TERRALIB_INTERNAL_DECODERSPR_H
+#define  __TERRALIB_INTERNAL_DECODERSPR_H
+
+#include "TeDecoderSmartMem.h"
+
+class TeAsciiFile;
+
+//! Implements a decoder for raster data in ASCII-SPRING format
+/*! The description of this format can be found at SPRING website <http://www.dpi.inpe.br/spring>.\par
+	The default file extension associated to this format is ".spr".
+*/
+class TL_DLL TeDecoderSPR : public TeDecoderSmartMem
+{
+public:
+	//! Empty constructor
+	TeDecoderSPR();
+
+	//! Constructor from some parameters
+	TeDecoderSPR(const TeRasterParams& par);
+
+	//! Destructor
+	~TeDecoderSPR();
+
+	//! Intializes the internal structures
+	void init();
+
+	//! Releases the internal structures
+	bool clear();
+
+	//! Writes an element
+	bool setElement (int col,int lin, double val, int band=0);
+
+private:
+
+	bool isModified_;
+
+    bool readFile(const string& filename);
+	bool readParameters();
+	bool writeParameters(TeAsciiFile& pFile);
+	bool saveData(TeAsciiFile& pFile);
+};
+
+//! Implements a factory to build decoders to ASCII-SPRING raster
+class TL_DLL TeDecoderSPRFactory : public TeDecoderFactory
+{
+public:
+	//! Factory constructor
+	TeDecoderSPRFactory(const string& name);
+
+	//! Builds the object
+	TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeDecoderSPR(arg); }
+};
+
+#endif
diff --git a/src/terralib/kernel/TeDecoderSmartMem.cpp b/src/terralib/kernel/TeDecoderSmartMem.cpp
old mode 100755
new mode 100644
index fa9ca37..9fbadea
--- a/src/terralib/kernel/TeDecoderSmartMem.cpp
+++ b/src/terralib/kernel/TeDecoderSmartMem.cpp
@@ -1,539 +1,446 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeDecoderSmartMem.h"
-
-#include "TeException.h"
-#include "TeAgnostic.h"
-
-
-TeDecoderSmartMem::TeDecoderSmartMem ()
-{ 
-  initVars();
-  
-  params_.decoderIdentifier_ = "SMARTMEM";
-};
-
-
-TeDecoderSmartMem::TeDecoderSmartMem ( const TeRasterParams& par )
-{
-  initVars();
-  
-  params_ = par; 
-  params_.decoderIdentifier_ = "SMARTMEM"; 
-};
-
-
-
-TeDecoderSmartMem::~TeDecoderSmartMem ()
-{
-  clear();
-}
-
-void TeDecoderSmartMem::init()
-{
-  clear();
-  
-  /* Creating the new data structures */
-
-  if( ( params_.nBands() > 0 ) && 
-      ( params_.nlines_ > 0 ) &&
-      ( params_.ncols_ > 0 ) ) {
-  
-    std::vector< unsigned int > tiles_sizes;
-    
-    for( int band_index = 0 ; band_index < params_.nBands() ; 
-      ++band_index ) {
-      
-      tiles_sizes.push_back( params_.elementSize( band_index ) * params_.ncols_ );
-    }
-
-    if( man_manager_.reset( params_.nBands(), params_.nlines_, 
-      tiles_sizes, TeRasterMemManager::AutoMemPol ) ) {
-      
-      if (params_.mode_ == 'c' || params_.mode_ == 'w') // creating a new file
-      {
-        params_.status_ = TeRasterParams::TeReadyToWrite;
-      } else if (params_.mode_ == 'r') {
-        params_.status_ = TeRasterParams::TeReadyToRead;      
-      }
-      
-      updateFuncPtrVectors();
-      dummyFill();    
-    } else {
-      clear();
-    }
-  }
-}
-
-bool TeDecoderSmartMem::clear()
-{
-  man_manager_.clear();
-  
-  if( getelement_ptrs_vec_ != 0 ) {
-    delete[] getelement_ptrs_vec_;
-    getelement_ptrs_vec_ = 0;
-  }
-  
-  if( setelement_ptrs_vec_ != 0 ) {
-    delete[] setelement_ptrs_vec_;
-    setelement_ptrs_vec_ = 0;
-  }
-  
-  params_.status_= TeRasterParams::TeNotReady;
-  
-  return true;
-}
-
-
-void TeDecoderSmartMem::initVars()
-{ 
-  getelement_ptrs_vec_ = 0;
-  setelement_ptrs_vec_ = 0;
-};
-
-
-void TeDecoderSmartMem::updateFuncPtrVectors()
-{
-  if( params_.nBands() > 0 ) {
-    getelement_ptrs_vec_ = new GetEleFunctPtrT[ params_.nBands() ];
-    if( getelement_ptrs_vec_ == 0 ) {
-      throw TeException( UNKNOWN_ERROR_TYPE, 
-        "Unable to allocate GET function pointers vector", false );
-    }
-
-    setelement_ptrs_vec_ = new SetEleFunctPtrT[ params_.nBands() ];
-    if( setelement_ptrs_vec_ == 0 ) {
-      throw TeException( UNKNOWN_ERROR_TYPE, 
-        "Unable to allocate SET function pointers vector", false );
-    }
-    
-    for( int band = 0 ; band < params_.nBands() ; ++band ) {
-      switch ( params_.dataType_[ band ] ) {
-        case (TeUNSIGNEDCHAR):
-          {
-            getelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::getElement_TeUNSIGNEDCHAR;
-            setelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::setElement_TeUNSIGNEDCHAR;
-            break;
-          }
-        case (TeCHAR) :
-          {
-            getelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::getElement_TeCHAR;
-            setelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::setElement_TeCHAR;          
-            break;
-          }
-        case (TeUNSIGNEDSHORT):
-          {
-            getelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::getElement_TeUNSIGNEDSHORT;
-            setelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::setElement_TeUNSIGNEDSHORT;
-            break;
-          }
-        case (TeSHORT):
-          {
-            getelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::getElement_TeSHORT;
-            setelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::setElement_TeSHORT;
-            break;
-          }
-        case (TeINTEGER):
-          {
-            getelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::getElement_TeINTEGER;
-            setelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::setElement_TeINTEGER;
-            break;
-          }
-        case (TeUNSIGNEDLONG):
-          {
-            getelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::getElement_TeUNSIGNEDLONG;
-            setelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::setElement_TeUNSIGNEDLONG;
-            break;
-          }
-        case (TeLONG):
-          {
-            getelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::getElement_TeLONG;
-            setelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::setElement_TeLONG;
-            break;
-          }
-        case (TeFLOAT):
-          {
-            getelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::getElement_TeFLOAT;
-            setelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::setElement_TeFLOAT;
-            break;
-          }
-        case (TeDOUBLE):
-          {
-            getelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::getElement_TeDOUBLE;
-            setelement_ptrs_vec_[ band ] = 
-              &TeDecoderSmartMem::setElement_TeDOUBLE;
-            break;
-          }
-        default:
-          {
-            TEAGN_LOG_AND_THROW( "Invalid raster data type" );
-            break;
-          }
-      }
-    }
-  }
-}
-
-
-void TeDecoderSmartMem::dummyFill()
-{
-  TEAGN_DEBUG_CONDITION( 
-    ( params_.status_ != TeRasterParams::TeNotReady),
-    "Raster not Ready" );
-  
-  /* Checking if dummy fill is required */
-  
-  if( ! params_.useDummy_ ) {
-    return;
-  }
-  
-  /* Dummy fill */
-      
-  const unsigned int nlines = (unsigned int )params_.nlines_;
-  const unsigned int ncols = (unsigned int )params_.ncols_;
-
-  unsigned int line = 0;
-  unsigned int col = 0;
-  double double_dummy_value = 0;
-  
-  for( int band = 0 ; band < params_.nBands() ; ++band ) {
-    if( params_.useDummy_ ) {
-      double_dummy_value = params_.dummy_[ band ];
-    } else {
-      double_dummy_value = 0;
-    }
-  
-    switch ( params_.dataType_[ band ] ) {
-      case (TeUNSIGNEDCHAR):
-        {
-          unsigned char dummy_value = (unsigned char)double_dummy_value;
-          unsigned char* line_ptr = 0;
-          
-          for( line = 0 ; line < nlines ; ++line ) {
-            line_ptr = (unsigned char*) man_manager_.getTilePointer( band, 
-              line );
-          
-            for( col = 0 ; col < ncols ; ++col ) {
-              line_ptr[ col ] = dummy_value;
-            }
-          }
-          
-          break;
-        }
-      case (TeCHAR) :
-        {
-          char dummy_value = (char)double_dummy_value;
-          char* line_ptr = 0;
-          
-          for( line = 0 ; line < nlines ; ++line ) {
-            line_ptr = (char*) man_manager_.getTilePointer( band, 
-              line );
-          
-            for( col = 0 ; col < ncols ; ++col ) {
-              line_ptr[ col ] = dummy_value;
-            }
-          }
-          
-          break;
-        }
-      case (TeUNSIGNEDSHORT):
-        {
-          unsigned short dummy_value = (unsigned short)double_dummy_value;
-          unsigned short* line_ptr = 0;
-          
-          for( line = 0 ; line < nlines ; ++line ) {
-            line_ptr = (unsigned short*) man_manager_.getTilePointer( band, 
-              line );
-          
-            for( col = 0 ; col < ncols ; ++col ) {
-              line_ptr[ col ] = dummy_value;
-            }
-          }
-          
-          break;
-        }
-      case (TeSHORT):
-        {
-          short dummy_value = (short)double_dummy_value;
-          short* line_ptr = 0;
-          
-          for( line = 0 ; line < nlines ; ++line ) {
-            line_ptr = (short*) man_manager_.getTilePointer( band, 
-              line );
-          
-            for( col = 0 ; col < ncols ; ++col ) {
-              line_ptr[ col ] = dummy_value;
-            }
-          }
-          
-          break;
-        }
-      case (TeINTEGER):
-        {
-          int dummy_value = (int)double_dummy_value;
-          int* line_ptr = 0;
-          
-          for( line = 0 ; line < nlines ; ++line ) {
-            line_ptr = (int*) man_manager_.getTilePointer( band, 
-              line );
-          
-            for( col = 0 ; col < ncols ; ++col ) {
-              line_ptr[ col ] = dummy_value;
-            }
-          }
-          
-          break;
-        }
-      case (TeUNSIGNEDLONG):
-        {
-          unsigned long dummy_value = (unsigned long)double_dummy_value;
-          unsigned long* line_ptr = 0;
-          
-          for( line = 0 ; line < nlines ; ++line ) {
-            line_ptr = (unsigned long*) man_manager_.getTilePointer( band, 
-              line );
-          
-            for( col = 0 ; col < ncols ; ++col ) {
-              line_ptr[ col ] = dummy_value;
-            }
-          }
-          
-          break;
-        }
-      case (TeLONG):
-        {
-          long dummy_value = (long)double_dummy_value;
-          long* line_ptr = 0;
-          
-          for( line = 0 ; line < nlines ; ++line ) {
-            line_ptr = (long*) man_manager_.getTilePointer( band, 
-              line );
-          
-            for( col = 0 ; col < ncols ; ++col ) {
-              line_ptr[ col ] = dummy_value;
-            }
-          }
-          
-          break;
-        }
-      case (TeFLOAT):
-        {
-          float dummy_value = (float)double_dummy_value;
-          float* line_ptr = 0;
-          
-          for( line = 0 ; line < nlines ; ++line ) {
-            line_ptr = (float*) man_manager_.getTilePointer( band, 
-              line );
-          
-            for( col = 0 ; col < ncols ; ++col ) {
-              line_ptr[ col ] = dummy_value;
-            }
-          }
-          
-          break;
-        }
-      case (TeDOUBLE):
-        {
-          double* line_ptr = 0;
-          
-          for( line = 0 ; line < nlines ; ++line ) {
-            line_ptr = (double*) man_manager_.getTilePointer( band, 
-              line );
-          
-            for( col = 0 ; col < ncols ; ++col ) {
-              line_ptr[ col ] = double_dummy_value;
-            }
-          }
-          
-          break;
-        }
-      default:
-        {
-          TEAGN_LOG_AND_THROW( "Invalid raster data type" );
-          break;
-        }
-    }
-  }  
-}
-
-
-inline void TeDecoderSmartMem::setElement_TeUNSIGNEDCHAR( const int& col, 
-  const int& lin, const double& val, const int& band )
-{
-  *( ( (unsigned char*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
-    (unsigned char)val;
-}
-
-
-inline void TeDecoderSmartMem::setElement_TeCHAR(const int& col, 
-  const int& lin, const double& val, const int& band )
-{
-  *( ( (char*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
-    (char)val;  
-}
-
-
-inline void TeDecoderSmartMem::setElement_TeUNSIGNEDSHORT(const int& col, 
-  const int& lin, const double& val, const int& band )
-{
-  *( ( (unsigned short*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
-    (unsigned short)val;  
-}
-
-
-inline void TeDecoderSmartMem::setElement_TeSHORT(const int& col, 
-  const int& lin, const double& val, const int& band )
-{
-  *( ( (short*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
-    (short)val;
-}
-
-
-inline void TeDecoderSmartMem::setElement_TeINTEGER(const int& col, 
-  const int& lin, const double& val, const int& band )
-{
-  *( ( (int*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
-    (int)val;
-}
-
-
-inline void TeDecoderSmartMem::setElement_TeUNSIGNEDLONG(const int& col, 
-  const int& lin, const double& val, const int& band )
-{
-  *( ( (unsigned long*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
-    (unsigned long)val;  
-}
-
-
-inline void TeDecoderSmartMem::setElement_TeLONG(const int& col, 
-  const int& lin, const double& val, const int& band )
-{
-  *( ( (long*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
-    (long)val;  
-}
-
-
-inline void TeDecoderSmartMem::setElement_TeFLOAT(const int& col, 
-  const int& lin, const double& val, const int& band )
-{
-  *( ( (float*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
-    (float)val;    
-}
-
-
-inline void TeDecoderSmartMem::setElement_TeDOUBLE(const int& col, 
-  const int& lin, const double& val, const int& band )
-{
-  *( ( (double*)man_manager_.getTilePointer( band, lin ) ) + col ) = val;    
-}
-
-
-inline void TeDecoderSmartMem::getElement_TeUNSIGNEDCHAR( const int& col, 
-  const int& lin, double& val, const int& band )
-{
-  val = (double)( *( ( (unsigned char*)man_manager_.getTilePointer( band, 
-    lin ) ) + col ) );
-}
-
-
-inline void TeDecoderSmartMem::getElement_TeCHAR(const int& col, 
-  const int& lin, double& val, const int& band )
-{
-  val = (double)( *( ( (char*)man_manager_.getTilePointer( band, 
-    lin ) ) + col ) );
-}
-
-
-inline void TeDecoderSmartMem::getElement_TeUNSIGNEDSHORT(const int& col, 
-  const int& lin, double& val, const int& band )
-{
-  val = (double)( *( ( (unsigned short*)man_manager_.getTilePointer( band, 
-    lin ) ) + col ) );
-}
-
-
-inline void TeDecoderSmartMem::getElement_TeSHORT(const int& col, 
-  const int& lin, double& val, const int& band )
-{
-  val = (double)( *( ( (short*)man_manager_.getTilePointer( band, 
-    lin ) ) + col ) );
-}
-
-
-inline void TeDecoderSmartMem::getElement_TeINTEGER(const int& col, 
-  const int& lin, double& val, const int& band )
-{
-  val = (double)( *( ( (int*)man_manager_.getTilePointer( band, 
-    lin ) ) + col ) );
-}
-
-
-inline void TeDecoderSmartMem::getElement_TeUNSIGNEDLONG(const int& col, 
-  const int& lin, double& val, const int& band )
-{
-  val = (double)( *( ( (unsigned long*)man_manager_.getTilePointer( band, 
-    lin ) ) + col ) );
-}
-
-
-inline void TeDecoderSmartMem::getElement_TeLONG(const int& col, 
-  const int& lin, double& val, const int& band )
-{
-  val = (double)( *( ( (long*)man_manager_.getTilePointer( band, 
-    lin ) ) + col ) );
-}
-
-
-inline void TeDecoderSmartMem::getElement_TeFLOAT(const int& col, 
-  const int& lin, double& val, const int& band )
-{
-  val = (double)( *( ( (float*)man_manager_.getTilePointer( band, 
-    lin ) ) + col ) );
-}
-
-
-inline void TeDecoderSmartMem::getElement_TeDOUBLE(const int& col, 
-  const int& lin, double& val, const int& band )
-{
-  val = ( *( ( (double*)man_manager_.getTilePointer( band, 
-    lin ) ) + col ) );
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeDecoderSmartMem.h"
+
+#include "TeException.h"
+#include "TeAgnostic.h"
+
+#include <stdlib.h>
+
+TeDecoderSmartMem::TeDecoderSmartMem ()
+{ 
+  initVars();
+  
+  params_.decoderIdentifier_ = "SMARTMEM";
+};
+
+
+TeDecoderSmartMem::TeDecoderSmartMem ( const TeRasterParams& par )
+{
+  initVars();
+  
+  params_ = par; 
+  params_.decoderIdentifier_ = "SMARTMEM"; 
+};
+
+
+
+TeDecoderSmartMem::~TeDecoderSmartMem ()
+{
+  clear();
+}
+
+void TeDecoderSmartMem::init()
+{
+  clear();
+  
+  // reading decoder specific parameters 
+  
+  for( unsigned int parsVecIdx = 0 ; parsVecIdx < params_.decoderParams_.size() ;
+    ++parsVecIdx )
+  {
+    if( params_.decoderParams_[ parsVecIdx ].first == "MaxMemPercentUsage" )
+    {
+      int maxMemPercentUsage = atoi( params_.decoderParams_[ 
+        parsVecIdx ].second.c_str() );
+      
+      if( ( maxMemPercentUsage >= 0 ) && ( maxMemPercentUsage <= 100 ) )
+      {
+        man_manager_.setMaxMemPercentUsage( (unsigned char)maxMemPercentUsage );
+      }
+      else
+      {
+        TEAGN_LOG_AND_THROW( "Invalid decoder specific parameter: " +
+          params_.decoderParams_[ parsVecIdx ].first + "=" +
+          params_.decoderParams_[ parsVecIdx ].second );
+      }
+    }
+  }
+  
+  /* Creating the new data structures */
+
+  if( ( params_.nBands() > 0 ) && 
+      ( params_.nlines_ > 0 ) &&
+      ( params_.ncols_ > 0 ) ) {
+  
+    std::vector< unsigned int > tiles_sizes;
+    
+    for( int band_index = 0 ; band_index < params_.nBands() ; 
+      ++band_index ) {
+      
+      tiles_sizes.push_back( params_.elementSize( band_index ) * params_.ncols_ );
+    }
+
+    if( man_manager_.reset( params_.nBands(), params_.nlines_, 
+      tiles_sizes, TeRasterMemManager::AutoMemPol ) ) {
+      
+      if (params_.mode_ == 'c' || params_.mode_ == 'w') // creating a new file
+      {
+        params_.status_ = TeRasterParams::TeReadyToWrite;
+      } else if (params_.mode_ == 'r') {
+        params_.status_ = TeRasterParams::TeReadyToRead;      
+      }
+      
+      updateFuncPtrVectors();
+      dummyFill();    
+    } else {
+      clear();
+    }
+  }
+}
+
+bool TeDecoderSmartMem::clear()
+{
+  man_manager_.clear();
+  
+  if( getelement_ptrs_vec_ != 0 ) {
+    delete[] getelement_ptrs_vec_;
+    getelement_ptrs_vec_ = 0;
+  }
+  
+  if( setelement_ptrs_vec_ != 0 ) {
+    delete[] setelement_ptrs_vec_;
+    setelement_ptrs_vec_ = 0;
+  }
+  
+  params_.status_= TeRasterParams::TeNotReady;
+  
+  return true;
+}
+
+
+void TeDecoderSmartMem::initVars()
+{ 
+  getelement_ptrs_vec_ = 0;
+  setelement_ptrs_vec_ = 0;
+};
+
+
+void TeDecoderSmartMem::updateFuncPtrVectors()
+{
+  if( params_.nBands() > 0 ) {
+    getelement_ptrs_vec_ = new GetEleFunctPtrT[ params_.nBands() ];
+    if( getelement_ptrs_vec_ == 0 ) {
+      throw TeException( UNKNOWN_ERROR_TYPE, 
+        "Unable to allocate GET function pointers vector", false );
+    }
+
+    setelement_ptrs_vec_ = new SetEleFunctPtrT[ params_.nBands() ];
+    if( setelement_ptrs_vec_ == 0 ) {
+      throw TeException( UNKNOWN_ERROR_TYPE, 
+        "Unable to allocate SET function pointers vector", false );
+    }
+    
+    for( int band = 0 ; band < params_.nBands() ; ++band ) {
+      switch ( params_.dataType_[ band ] ) {
+        case (TeBIT):
+          {
+            getelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::getElement_TeBIT;
+            setelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::setElement_TeBIT;
+            break;
+          }      
+        case (TeUNSIGNEDCHAR):
+          {
+            getelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::getElement_TeUNSIGNEDCHAR;
+            setelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::setElement_TeUNSIGNEDCHAR;
+            break;
+          }
+        case (TeCHAR) :
+          {
+            getelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::getElement_TeCHAR;
+            setelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::setElement_TeCHAR;          
+            break;
+          }
+        case (TeUNSIGNEDSHORT):
+          {
+            getelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::getElement_TeUNSIGNEDSHORT;
+            setelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::setElement_TeUNSIGNEDSHORT;
+            break;
+          }
+        case (TeSHORT):
+          {
+            getelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::getElement_TeSHORT;
+            setelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::setElement_TeSHORT;
+            break;
+          }
+        case (TeINTEGER):
+          {
+            getelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::getElement_TeINTEGER;
+            setelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::setElement_TeINTEGER;
+            break;
+          }
+        case (TeUNSIGNEDLONG):
+          {
+            getelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::getElement_TeUNSIGNEDLONG;
+            setelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::setElement_TeUNSIGNEDLONG;
+            break;
+          }
+        case (TeLONG):
+          {
+            getelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::getElement_TeLONG;
+            setelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::setElement_TeLONG;
+            break;
+          }
+        case (TeFLOAT):
+          {
+            getelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::getElement_TeFLOAT;
+            setelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::setElement_TeFLOAT;
+            break;
+          }
+        case (TeDOUBLE):
+          {
+            getelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::getElement_TeDOUBLE;
+            setelement_ptrs_vec_[ band ] = 
+              &TeDecoderSmartMem::setElement_TeDOUBLE;
+            break;
+          }
+        default:
+          {
+            TEAGN_LOG_AND_THROW( "Invalid raster data type" );
+            break;
+          }
+      }
+    }
+  }
+}
+
+
+void TeDecoderSmartMem::dummyFill()
+{
+  TEAGN_DEBUG_CONDITION( 
+    ( params_.status_ != TeRasterParams::TeNotReady),
+    "Raster not Ready" );
+  
+  /* Checking if dummy fill is required */
+  
+  if( ! params_.useDummy_ ) {
+    return;
+  }
+  
+  /* Dummy fill */
+      
+  const unsigned int nlines = (unsigned int )params_.nlines_;
+  const unsigned int ncols = (unsigned int )params_.ncols_;
+
+  unsigned int line = 0;
+  unsigned int col = 0;
+  double double_dummy_value = 0;
+  
+  for( int band = 0 ; band < params_.nBands() ; ++band ) {
+    if( params_.useDummy_ ) {
+      double_dummy_value = params_.dummy_[ band ];
+    } else {
+      double_dummy_value = 0;
+    }
+  
+    switch ( params_.dataType_[ band ] ) {
+      case (TeBIT):
+        {
+          unsigned char dummy_value = (unsigned char)double_dummy_value;
+          unsigned char* line_ptr = 0;
+          
+          for( line = 0 ; line < nlines ; ++line ) {
+            line_ptr = (unsigned char*) man_manager_.getTilePointer( band, 
+              line );
+          
+            for( col = 0 ; col < ncols ; ++col ) {
+              line_ptr[ col ] = dummy_value;
+            }
+          }
+          
+          break;
+        }    
+      case (TeUNSIGNEDCHAR):
+        {
+          unsigned char dummy_value = (unsigned char)double_dummy_value;
+          unsigned char* line_ptr = 0;
+          
+          for( line = 0 ; line < nlines ; ++line ) {
+            line_ptr = (unsigned char*) man_manager_.getTilePointer( band, 
+              line );
+          
+            for( col = 0 ; col < ncols ; ++col ) {
+              line_ptr[ col ] = dummy_value;
+            }
+          }
+          
+          break;
+        }
+      case (TeCHAR) :
+        {
+          char dummy_value = (char)double_dummy_value;
+          char* line_ptr = 0;
+          
+          for( line = 0 ; line < nlines ; ++line ) {
+            line_ptr = (char*) man_manager_.getTilePointer( band, 
+              line );
+          
+            for( col = 0 ; col < ncols ; ++col ) {
+              line_ptr[ col ] = dummy_value;
+            }
+          }
+          
+          break;
+        }
+      case (TeUNSIGNEDSHORT):
+        {
+          unsigned short dummy_value = (unsigned short)double_dummy_value;
+          unsigned short* line_ptr = 0;
+          
+          for( line = 0 ; line < nlines ; ++line ) {
+            line_ptr = (unsigned short*) man_manager_.getTilePointer( band, 
+              line );
+          
+            for( col = 0 ; col < ncols ; ++col ) {
+              line_ptr[ col ] = dummy_value;
+            }
+          }
+          
+          break;
+        }
+      case (TeSHORT):
+        {
+          short dummy_value = (short)double_dummy_value;
+          short* line_ptr = 0;
+          
+          for( line = 0 ; line < nlines ; ++line ) {
+            line_ptr = (short*) man_manager_.getTilePointer( band, 
+              line );
+          
+            for( col = 0 ; col < ncols ; ++col ) {
+              line_ptr[ col ] = dummy_value;
+            }
+          }
+          
+          break;
+        }
+      case (TeINTEGER):
+        {
+          int dummy_value = (int)double_dummy_value;
+          int* line_ptr = 0;
+          
+          for( line = 0 ; line < nlines ; ++line ) {
+            line_ptr = (int*) man_manager_.getTilePointer( band, 
+              line );
+          
+            for( col = 0 ; col < ncols ; ++col ) {
+              line_ptr[ col ] = dummy_value;
+            }
+          }
+          
+          break;
+        }
+      case (TeUNSIGNEDLONG):
+        {
+          unsigned long dummy_value = (unsigned long)double_dummy_value;
+          unsigned long* line_ptr = 0;
+          
+          for( line = 0 ; line < nlines ; ++line ) {
+            line_ptr = (unsigned long*) man_manager_.getTilePointer( band, 
+              line );
+          
+            for( col = 0 ; col < ncols ; ++col ) {
+              line_ptr[ col ] = dummy_value;
+            }
+          }
+          
+          break;
+        }
+      case (TeLONG):
+        {
+          long dummy_value = (long)double_dummy_value;
+          long* line_ptr = 0;
+          
+          for( line = 0 ; line < nlines ; ++line ) {
+            line_ptr = (long*) man_manager_.getTilePointer( band, 
+              line );
+          
+            for( col = 0 ; col < ncols ; ++col ) {
+              line_ptr[ col ] = dummy_value;
+            }
+          }
+          
+          break;
+        }
+      case (TeFLOAT):
+        {
+          float dummy_value = (float)double_dummy_value;
+          float* line_ptr = 0;
+          
+          for( line = 0 ; line < nlines ; ++line ) {
+            line_ptr = (float*) man_manager_.getTilePointer( band, 
+              line );
+          
+            for( col = 0 ; col < ncols ; ++col ) {
+              line_ptr[ col ] = dummy_value;
+            }
+          }
+          
+          break;
+        }
+      case (TeDOUBLE):
+        {
+          double* line_ptr = 0;
+          
+          for( line = 0 ; line < nlines ; ++line ) {
+            line_ptr = (double*) man_manager_.getTilePointer( band, 
+              line );
+          
+            for( col = 0 ; col < ncols ; ++col ) {
+              line_ptr[ col ] = double_dummy_value;
+            }
+          }
+          
+          break;
+        }
+      default:
+        {
+          TEAGN_LOG_AND_THROW( "Invalid raster data type" );
+          break;
+        }
+    }
+  }  
+}
+
+
+
diff --git a/src/terralib/kernel/TeDecoderSmartMem.h b/src/terralib/kernel/TeDecoderSmartMem.h
old mode 100755
new mode 100644
index e2abcc8..7e7597b
--- a/src/terralib/kernel/TeDecoderSmartMem.h
+++ b/src/terralib/kernel/TeDecoderSmartMem.h
@@ -1,382 +1,573 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderSmartMem.h
-    \brief This file deals with decoding of raster structures as a mulitdimensional matrix in memory
-*/
-#ifndef  __TERRALIB_INTERNAL_DECODERSMARTMEM_H
-#define  __TERRALIB_INTERNAL_DECODERSMARTMEM_H
-
-#include "TeDecoder.h"
-#include "TeRasterMemManager.h"
-#include "TeAgnostic.h"
-
-/** 
- * @brief Implements a decoder to a raster stored as a as a mulitdimensional 
- * matrix in memory.
- * @note The used memory ( RAM or mapped memory ) will be automatically choosed
- * following the current system resources.
- * @note No interleaving support.
- */
-class TL_DLL TeDecoderSmartMem : public TeDecoder
-{
-
-public:
-
-  //! @brief Empty constructor
-  TeDecoderSmartMem ();
-
-  //! @brief Constructor from parameters
-  TeDecoderSmartMem ( const TeRasterParams& par );
-
-  //! @brief Destructor
-  virtual ~TeDecoderSmartMem ();
-
-  //! @brief Sets the value of a specific raster element 
-  /*!
-    \param col  element column identifier
-    \param lin  element line identifier
-    \param val  element value being inserted
-    \param band element band identifier
-  */  
-  inline bool setElement (int col,int lin, double val, int band=0)
-  {
-    TEAGN_DEBUG_CONDITION( ( setelement_ptrs_vec_ != 0 ),
-      "invalid setElement function pointers vector" )
-    TEAGN_DEBUG_CONDITION( ( col < params_.ncols_ ),
-      "Invalid number of columns" )
-    TEAGN_DEBUG_CONDITION( ( lin < params_.nlines_ ),
-      "Invalid number of lines" )
-    TEAGN_DEBUG_CONDITION( ( band < params_.nBands() ),
-      "Invalid band" )
-    TEAGN_DEBUG_CONDITION( 
-      ( params_.status_ != TeRasterParams::TeNotReady),
-      "Raster not Ready" );      
-    
-    ( this->*( setelement_ptrs_vec_[ band ] ) )( col, lin, val, band );
-  
-    return true;  
-  };
-  
-  //! @brief Gets an specific element (col, lin, band) of a raster data
-  /*!
-    \param col  element column identifier
-    \param lin  element line identifier
-    \param val  element value being retrieved
-    \param band element band identifier
-  */  
-  inline bool getElement (int col,int lin, double &val,int band=0)
-  {
-    TEAGN_DEBUG_CONDITION( ( getelement_ptrs_vec_ != 0 ),
-      "invalid getElement function pointers vector" )
-    TEAGN_DEBUG_CONDITION( ( col < params_.ncols_ ),
-      "Invalid number of columns" )
-    TEAGN_DEBUG_CONDITION( ( lin < params_.nlines_ ),
-      "Invalid number of lines" )
-    TEAGN_DEBUG_CONDITION( ( band < params_.nBands() ),
-      "Invalid band" )    
-    TEAGN_DEBUG_CONDITION( 
-      ( params_.status_ != TeRasterParams::TeNotReady),
-      "Raster not Ready" );      
-    
-    ( this->*( getelement_ptrs_vec_[ band ] ) )( col, lin, val, band );
-    
-    return true;  
-  };
-
-  //! @brief Initializes the internal structures of the decoder
-  virtual void  init  ();
-  
-  //! @brief Clears its internal structures
-  virtual bool  clear  ();
-
-protected:
-
-  /**
-   * @brief Type definition for the getElement function pointer.
-   *
-   * @param line Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  typedef void (TeDecoderSmartMem::*GetEleFunctPtrT)( const int& col,
-    const int& lin, double& val, const int& band );
-
-  /**
-   * @brief Type definition for the setElement function pointer.
-   *
-   * @param line Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  typedef void (TeDecoderSmartMem::*SetEleFunctPtrT)( const int& col, 
-    const int& lin, const double& val, const int& band );
-  
-  /**
-   * @brief Internal memory manager instance.
-   */
-  TeRasterMemManager man_manager_;
-
-  /**
-   * @brief A vector of pointers to the current getElement method following the 
-   * current data bype of each band (indexed by the band index).
-   */
-  GetEleFunctPtrT* getelement_ptrs_vec_;
-
-  /**
-   * @brief A vector of pointers to the current setElement method following the 
-   * current data bype of each band (indexed by the band index).
-   */
-  SetEleFunctPtrT* setelement_ptrs_vec_;
-  
-  /**
-   * @brief Set all internal variables to their initial values.
-   */   
-  void initVars();
-  
-  /**
-   * @brief Update the function pointers vectors using the current
-   * raster parameters.
-   */   
-  void updateFuncPtrVectors();  
-  
-  /**
-   * @brief Fill data with dummy values.
-   */   
-  void dummyFill();    
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void setElement_TeUNSIGNEDCHAR( const int& col, const int& lin, 
-    const double& val, const int& band );
-  
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void setElement_TeCHAR( const int& col, const int& lin, 
-    const double& val, const int& band );  
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void setElement_TeUNSIGNEDSHORT( const int& col, const int& lin, 
-    const double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void setElement_TeSHORT( const int& col, const int& lin, 
-    const double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void setElement_TeINTEGER( const int& col, const int& lin, 
-    const double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void setElement_TeUNSIGNEDLONG( const int& col, const int& lin, 
-    const double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void setElement_TeLONG( const int& col, const int& lin, 
-    const double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void setElement_TeFLOAT( const int& col, const int& lin, 
-    const double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void setElement_TeDOUBLE( const int& col, const int& lin, 
-    const double& val, const int& band );
-  
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void getElement_TeUNSIGNEDCHAR( const int& col, const int& lin, 
-    double& val, const int& band );
-  
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void getElement_TeCHAR( const int& col, const int& lin, 
-    double& val, const int& band );  
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void getElement_TeUNSIGNEDSHORT( const int& col, const int& lin, 
-    double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void getElement_TeSHORT( const int& col, const int& lin, 
-    double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void getElement_TeINTEGER( const int& col, const int& lin, 
-    double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void getElement_TeUNSIGNEDLONG( const int& col, const int& lin, 
-    double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void getElement_TeLONG( const int& col, const int& lin, 
-    double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param line Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void getElement_TeFLOAT( const int& col, const int& lin, 
-    double& val, const int& band );
-
-  /**
-   * @brief Method overload.
-   *
-   * @param lin Line.
-   * @param col Column.
-   * @param band Band.
-   * @param val Pixel value.
-   */      
-  inline void getElement_TeDOUBLE( const int& col, const int& lin, 
-    double& val, const int& band );  
-  
-};
-
-//! Implements a factory to build decoder to MEMORY raster
-class TL_DLL TeDecoderSmartMemFactory : public TeDecoderFactory
-{
-public:
-
-  //! Factory constructor
-  TeDecoderSmartMemFactory(const string& name) : TeDecoderFactory(name) {}
-
-  //! Builds the object
-  virtual TeDecoder* build (const TeRasterParams& arg)
-  {  return new TeDecoderSmartMem(arg); }
-};
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderSmartMem.h
+    \brief This file deals with decoding of raster structures as a mulitdimensional matrix in memory
+*/
+#ifndef  __TERRALIB_INTERNAL_DECODERSMARTMEM_H
+#define  __TERRALIB_INTERNAL_DECODERSMARTMEM_H
+
+#include "TeDecoder.h"
+#include "TeRasterMemManager.h"
+#include "TeAgnostic.h"
+
+/** 
+ * @brief Implements a decoder to a raster stored as a as a mulitdimensional 
+ * matrix in memory (and disk when necessary).
+ * @note This decoder accepts the following optional parameters from TeRasterParams::decoderParams_
+ * - Name:"MaxMemPercentUsage" Type:unsigned char Description: The maximum amount of RAM memory to use when necessary - valid range: [0,100] - See TeRasterMemManager::setMaxMemPercentUsage for reference.
+ * @note No interleaving support.
+ */
+class TL_DLL TeDecoderSmartMem : public TeDecoder
+{
+
+public:
+
+  //! @brief Empty constructor
+  TeDecoderSmartMem ();
+
+  //! @brief Constructor from parameters
+  TeDecoderSmartMem ( const TeRasterParams& par );
+
+  //! @brief Destructor
+  virtual ~TeDecoderSmartMem ();
+
+  //! @brief Sets the value of a specific raster element 
+  /*!
+    \param col  element column identifier
+    \param lin  element line identifier
+    \param val  element value being inserted
+    \param band element band identifier
+  */  
+  inline bool setElement (int col,int lin, double val, int band=0)
+  {
+    TEAGN_DEBUG_CONDITION( ( setelement_ptrs_vec_ != 0 ),
+      "invalid setElement function pointers vector" )
+    TEAGN_DEBUG_CONDITION( ( col < params_.ncols_ ),
+      "Invalid number of columns" )
+    TEAGN_DEBUG_CONDITION( ( lin < params_.nlines_ ),
+      "Invalid number of lines" )
+    TEAGN_DEBUG_CONDITION( ( band < params_.nBands() ),
+      "Invalid band" )
+    TEAGN_DEBUG_CONDITION( 
+      ( params_.status_ != TeRasterParams::TeNotReady),
+      "Raster not Ready" );      
+    
+    ( this->*( setelement_ptrs_vec_[ band ] ) )( col, lin, val, band );
+  
+    return true;  
+  };
+  
+  //! @brief Gets an specific element (col, lin, band) of a raster data
+  /*!
+    \param col  element column identifier
+    \param lin  element line identifier
+    \param val  element value being retrieved
+    \param band element band identifier
+  */  
+  inline bool getElement (int col,int lin, double &val,int band=0)
+  {
+    TEAGN_DEBUG_CONDITION( ( getelement_ptrs_vec_ != 0 ),
+      "invalid getElement function pointers vector" )
+    TEAGN_DEBUG_CONDITION( ( col < params_.ncols_ ),
+      "Invalid number of columns" )
+    TEAGN_DEBUG_CONDITION( ( lin < params_.nlines_ ),
+      "Invalid number of lines" )
+    TEAGN_DEBUG_CONDITION( ( band < params_.nBands() ),
+      "Invalid band" )    
+    TEAGN_DEBUG_CONDITION( 
+      ( params_.status_ != TeRasterParams::TeNotReady),
+      "Raster not Ready" );      
+    
+    ( this->*( getelement_ptrs_vec_[ band ] ) )( col, lin, val, band );
+    
+    return true;  
+  };
+  
+  /**
+   * @brief Optmized method to set an element value.
+   * @note Use this method only if the used ValueType matches 
+   * the target band data type otherwise memory corruption may occur..
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  template< typename ValueType > 
+  inline void setValue( const int& col, const int& lin, 
+    const ValueType& val, const int& band )
+  {
+    TEAGN_DEBUG_CONDITION( ( getelement_ptrs_vec_ != 0 ),
+      "invalid getElement function pointers vector" )
+    TEAGN_DEBUG_CONDITION( ( col < params_.ncols_ ),
+      "Invalid number of columns" )
+    TEAGN_DEBUG_CONDITION( ( lin < params_.nlines_ ),
+      "Invalid number of lines" )
+    TEAGN_DEBUG_CONDITION( ( band < params_.nBands() ),
+      "Invalid band" )    
+    TEAGN_DEBUG_CONDITION( 
+      ( params_.status_ != TeRasterParams::TeNotReady),
+      "Raster not Ready" );  
+        
+    *( ( (ValueType*)man_manager_.getTilePointer( band, lin ) ) + col ) = val;  
+  };  
+  
+  /**
+   * @brief Optmized method to get an element value.
+   * @note Use this method only if the used ValueType matches 
+   * the target band data type otherwise memory corruption may occur.
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */    
+  template< typename ValueType >    
+  inline void getValue( const int& col, const int& lin, 
+    ValueType& val, const int& band ) const
+  {
+    TEAGN_DEBUG_CONDITION( ( getelement_ptrs_vec_ != 0 ),
+      "invalid getElement function pointers vector" )
+    TEAGN_DEBUG_CONDITION( ( col < params_.ncols_ ),
+      "Invalid number of columns" )
+    TEAGN_DEBUG_CONDITION( ( lin < params_.nlines_ ),
+      "Invalid number of lines" )
+    TEAGN_DEBUG_CONDITION( ( band < params_.nBands() ),
+      "Invalid band" )    
+    TEAGN_DEBUG_CONDITION( 
+      ( params_.status_ != TeRasterParams::TeNotReady),
+      "Raster not Ready" );  
+        
+    val = ( *( ( (ValueType*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };  
+
+  /**
+   * @brief Provides direct access to each line.
+   * @param lin Line.
+   * @param band Band.
+   * @return A pointer the the required line.
+   * @note Use this method only if the target band data type is known
+   * otherwise memory corruption may occur.   
+   * @note Further accesses to this class instance invalidates the pointer.
+   */  
+  inline void* getScanLine( const int& lin, const int& band )
+  {
+    TEAGN_DEBUG_CONDITION( ( lin < params_.nlines_ ),
+      "Invalid number of lines" )
+    TEAGN_DEBUG_CONDITION( ( band < params_.nBands() ),
+      "Invalid band" )    
+    TEAGN_DEBUG_CONDITION( 
+      ( params_.status_ != TeRasterParams::TeNotReady),
+      "Raster not Ready" );  
+        
+    return man_manager_.getTilePointer( band, lin );
+  };    
+
+  //! @brief Initializes the internal structures of the decoder
+  virtual void  init  ();
+  
+  //! @brief Clears its internal structures
+  virtual bool  clear  ();
+  
+  /**
+   * @brief Set the max amount of RAM memory to use when necessary.
+   * @param maxMemPercentUsage The max amount of RAM memory to use when 
+   * necessary - valid range: [0,100].
+   * @sa See TeRasterMemManager::setMaxMemPercentUsage for reference.
+   */          
+  inline void setMaxMemPercentUsage( unsigned char maxMemPercentUsage )
+  {
+    man_manager_.setMaxMemPercentUsage( maxMemPercentUsage );
+  };
+
+protected:
+
+  /**
+   * @brief Type definition for the getElement function pointer.
+   *
+   * @param line Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  typedef void (TeDecoderSmartMem::*GetEleFunctPtrT)( const int& col,
+    const int& lin, double& val, const int& band );
+
+  /**
+   * @brief Type definition for the setElement function pointer.
+   *
+   * @param line Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  typedef void (TeDecoderSmartMem::*SetEleFunctPtrT)( const int& col, 
+    const int& lin, const double& val, const int& band );
+  
+  /**
+   * @brief Internal memory manager instance.
+   */
+  mutable TeRasterMemManager man_manager_;
+
+  /**
+   * @brief A vector of pointers to the current getElement method following the 
+   * current data bype of each band (indexed by the band index).
+   */
+  GetEleFunctPtrT* getelement_ptrs_vec_;
+
+  /**
+   * @brief A vector of pointers to the current setElement method following the 
+   * current data bype of each band (indexed by the band index).
+   */
+  SetEleFunctPtrT* setelement_ptrs_vec_;
+  
+  /**
+   * @brief Set all internal variables to their initial values.
+   */   
+  void initVars();
+  
+  /**
+   * @brief Update the function pointers vectors using the current
+   * raster parameters.
+   */   
+  void updateFuncPtrVectors();  
+  
+  /**
+   * @brief Fill data with dummy values.
+   */   
+  void dummyFill();    
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void setElement_TeBIT( const int& col, const int& lin, 
+    const double& val, const int& band )
+  {
+    *( ( (unsigned char*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
+      (unsigned char)val;  
+  };
+  
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void setElement_TeUNSIGNEDCHAR( const int& col, const int& lin, 
+    const double& val, const int& band )
+  {
+    *( ( (unsigned char*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
+      (unsigned char)val;  
+  };  
+  
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void setElement_TeCHAR( const int& col, const int& lin, 
+    const double& val, const int& band )
+  {
+    *( ( (char*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
+      (char)val;  
+  };      
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void setElement_TeUNSIGNEDSHORT( const int& col, const int& lin, 
+    const double& val, const int& band )
+  {
+    *( ( (unsigned short*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
+      (unsigned short)val;  
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void setElement_TeSHORT( const int& col, const int& lin, 
+    const double& val, const int& band )
+  {
+    *( ( (short*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
+      (short)val;
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void setElement_TeINTEGER( const int& col, const int& lin, 
+    const double& val, const int& band )
+  {
+    *( ( (int*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
+      (int)val;
+  }
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void setElement_TeUNSIGNEDLONG( const int& col, const int& lin, 
+    const double& val, const int& band )
+  {
+    *( ( (unsigned long*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
+      (unsigned long)val;  
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void setElement_TeLONG( const int& col, const int& lin, 
+    const double& val, const int& band )
+  {
+    *( ( (long*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
+      (long)val;  
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void setElement_TeFLOAT( const int& col, const int& lin, 
+    const double& val, const int& band )
+  {
+    *( ( (float*)man_manager_.getTilePointer( band, lin ) ) + col ) = 
+      (float)val;    
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void setElement_TeDOUBLE( const int& col, const int& lin, 
+    const double& val, const int& band )
+  {
+    *( ( (double*)man_manager_.getTilePointer( band, lin ) ) + col ) = val;    
+  };
+  
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void getElement_TeBIT( const int& col, const int& lin, 
+    double& val, const int& band )
+  {
+    val = (double)( *( ( (unsigned char*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };
+    
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void getElement_TeUNSIGNEDCHAR( const int& col, const int& lin, 
+    double& val, const int& band )
+  {
+    val = (double)( *( ( (unsigned char*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };
+  
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void getElement_TeCHAR( const int& col, const int& lin, 
+    double& val, const int& band )
+  {
+    val = (double)( *( ( (char*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void getElement_TeUNSIGNEDSHORT( const int& col, const int& lin, 
+    double& val, const int& band )
+  {
+    val = (double)( *( ( (unsigned short*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void getElement_TeSHORT( const int& col, const int& lin, 
+    double& val, const int& band )
+  {
+    val = (double)( *( ( (short*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void getElement_TeINTEGER( const int& col, const int& lin, 
+    double& val, const int& band )
+  {
+    val = (double)( *( ( (int*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void getElement_TeUNSIGNEDLONG( const int& col, const int& lin, 
+    double& val, const int& band )
+  {
+    val = (double)( *( ( (unsigned long*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void getElement_TeLONG( const int& col, const int& lin, 
+    double& val, const int& band )
+  {
+    val = (double)( *( ( (long*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param line Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void getElement_TeFLOAT( const int& col, const int& lin, 
+    double& val, const int& band )
+  {
+    val = (double)( *( ( (float*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };
+
+  /**
+   * @brief Method overload.
+   *
+   * @param lin Line.
+   * @param col Column.
+   * @param band Band.
+   * @param val Pixel value.
+   */      
+  inline void getElement_TeDOUBLE( const int& col, const int& lin, 
+    double& val, const int& band )
+  {
+    val = ( *( ( (double*)man_manager_.getTilePointer( band, 
+      lin ) ) + col ) );
+  };
+  
+};
+
+//! Implements a factory to build decoder to MEMORY raster
+class TL_DLL TeDecoderSmartMemFactory : public TeDecoderFactory
+{
+public:
+
+  //! Factory constructor
+  TeDecoderSmartMemFactory(const string& name) : TeDecoderFactory(name) {}
+
+  //! Builds the object
+  virtual TeDecoder* build (const TeRasterParams& arg)
+  {  return new TeDecoderSmartMem(arg); }
+};
+#endif
+
diff --git a/src/terralib/kernel/TeDecoderTIFF.cpp b/src/terralib/kernel/TeDecoderTIFF.cpp
old mode 100755
new mode 100644
index 8e7e4ac..8d67d2d
--- a/src/terralib/kernel/TeDecoderTIFF.cpp
+++ b/src/terralib/kernel/TeDecoderTIFF.cpp
@@ -1,1220 +1,1225 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeDecoderTIFF.h"
-#include "TeUtils.h"
-#include "TeException.h"
-#include <geovalues.h>
-#include <geo_normalize.h>
-#include <geo_tiffp.h>
-
-#include <fstream>
-#include <cassert>
-using std::ifstream;
-using std::ofstream;
-
-// ---- Public Methods ----- 
-
-TeDecoderTIFF::TeDecoderTIFF(const TeRasterParams& par):
-	tif(0),
-	gtif(0),
-	dataBuffer_(0),
-	nplanes_(0),
-	isGeoTiff_(false),
-	TImage_(0),
-	planar_(PLANARCONFIG_CONTIG),
-	isTiled_(false),
-	tilew_(0),
-	tileh_(0),
-	tilesacross_(0),
-	bytespertile_(0),
-	TCurTile_(-1),
-	rowsperstrip_(0),
-	nstripsperplane_(0),
-	stripsize_(0),
-	TCurStrip_(-1),
-	nBands_(1),
-	data_TeUNSIGNEDCHAR_(0), 
-	data_TeCHAR_(0),   
-	data_TeUNSIGNEDSHORT_(0),  
-	data_TeSHORT_(0),   
-	data_TeINTEGER_(0),   
-	data_TeUNSIGNEDLONG_(0),   
-	data_TeLONG_(0),  
-	data_TeFLOAT_(0), 
-	data_TeDOUBLE_(0)  
-{
-	params_ = par;
-	params_.status_= TeRasterParams::TeNotReady;
-	if (params_.mode_ == 'r')		// file should exists
-	{								// read tiff/geotiff parameters
-		tif=XTIFFOpen(params_.fileName_.c_str(),"r");
-		if (!tif)
-			return;
-
-		gtif = (GTIF*)GTIFNew(tif);
-		readTiffDirectory();
-		if (gtif)
-		{
-			GTIFFree(gtif);
-			gtif = 0;
-		}
-		if (tif)
-		{
-			XTIFFClose(tif); 
-			tif = 0;
-		}
-		params_.decoderIdentifier_ = "TIF";
-	}
-}
-
-void
-TeDecoderTIFF::init()
-{
-	clear();		// reset existent internal structures
-	params_.status_= TeRasterParams::TeNotReady;
-
-	// TIFF image files may not be opened for both reading and writing; 
-	// there is no support for altering the contents of a TIFF file. So
-	// mode == 'w' never initializes this decoder.
-	if (params_.mode_ == 'w')
-	{
-		params_.errorMessage_ = "There is no support for altering the contents of a TIFF file.";
-		return;
-	}
-	if (params_.mode_ != 'r' && params_.mode_ != 'c')	// unknown mode
-	{
-		params_.errorMessage_ = "Invalid access mode.";
-		return;
-	}
-
-	// check the initial permissions on the file
-	if (params_.mode_ == 'c')		// creating a new raster file
-	{
-		ofstream dataFile(params_.fileName_.c_str()); // try to (re)create the file
-		if (!dataFile)
-		{
-			params_.errorMessage_ = "Fail to (re)create the raster the file:" + params_.fileName_;
-			return;
-		}
-		dataFile.close();
-		memManager_.updateParams(params_);
-		memManager_.params().decoderIdentifier_ = "SMARTMEM";
-		memManager_.params().mode_ = 'c';
-		memManager_.init();
-		if (memManager_.params().status_ != TeRasterParams::TeReadyToWrite)
-		{
-			params_.errorMessage_ = "Fail to create the raster the file:" + params_.fileName_;
-			return;
-		}
-		else
-			params_.status_ = TeRasterParams::TeReadyToWrite;
-
-		tif=XTIFFOpen(params_.fileName_.c_str(),"a");
-		if (!tif)
-		{
-			params_.errorMessage_ = "Fail to create a tiff file.";
-			params_.status_= TeRasterParams::TeNotReady;
-			return;
-		}
-
-		// try to create a geotiff instance on the tiff file 
-		gtif = (GTIF*)GTIFNew(tif);
-		if (!gtif)
-		{
-			params_.errorMessage_ = "Fail to instantiate a geotiff file.";
-			params_.status_= TeRasterParams::TeNotReady;
-			return;
-		}
-		return;
-	}
-	
-	ifstream dataFile(params_.fileName_.c_str()); // check if file exists
-	if (!dataFile)
-	{
-		params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
-		return; 
-	}
-	dataFile.close();				
-	// try to open the tiff file with the desired mode
-	tif=XTIFFOpen(params_.fileName_.c_str(),"r");
-	if (!tif)
-	{
-		params_.errorMessage_ = "Fail to instantiate a tiff file.";
-		return;
-	}
-
-	isTiled_ = TIFFIsTiled(tif) != 0;						// return non-zero if is organized in tiles 
-	TIFFGetField(tif,TIFFTAG_PLANARCONFIG,&planar_);	// storage organization
-	if (isTiled_ && (planar_== PLANARCONFIG_SEPARATE))
-	{
-		XTIFFClose(tif); 
-		tif = 0;
-		params_.errorMessage_ = "There is no support to decode tiff files that are tiled and organized in separate planes.";
-		return;
-	}
-
-	// try to create a geotiff instance on the tiff file 
-	gtif = (GTIF*)GTIFNew(tif);
-	if (!gtif)
-	{
-		XTIFFClose(tif); 
-		tif = 0;
-		params_.errorMessage_ = "Fail to instantiate a geotiff file.";
-		return;
-	}
-	readTiffDirectory();			// read tiff keys
-	getGeoTIFF();					// read geotiff keys
-	params_.errorMessage_.clear();
-	if (allocateWorkMemory())
-		params_.status_ = TeRasterParams::TeReadyToRead;
-	else
-	{
-		XTIFFClose(tif); 
-		tif = 0;
-		GTIFFree(gtif);
-		gtif = 0;
-		params_.errorMessage_ = "Fail to allocate necessary work memory.";
-	}
-}
-
-
-bool 
-TeDecoderTIFF::clear()
-{
-	if (!tif || !gtif)
-		return true;
-    
-  TeRasterParams& mmpars = memManager_.params();  
-
-	if (mmpars.mode_== 'c')
-	{
-		setGeoKeys();
-		int row, col, b;
-		double val=0.0;
-		int nb = mmpars.nBands();
-		long ssize = TIFFScanlineSize(tif);
-		unsigned char* obuf = (unsigned char*)_TIFFmalloc(ssize);
-    
-		for (row=0; row<mmpars.nlines_; ++row)
-		{
-			for (col=0; col<mmpars.ncols_; ++col)
-			{			
-				for (b=0; b<nb; ++b)
-				{
-					if (!memManager_.getElement(col,row,val,b))
-						continue;
-
-					if (mmpars.dataType_[0] == TeDOUBLE)			
-					{
-						((double*)obuf)[col*nb+b] = (double)val;
-					}
-					else if (mmpars.dataType_[0] == TeFLOAT)			
-					{
-						((float*)obuf)[col*nb+b] = (float)val;
-					}
-					else if (mmpars.dataType_[0] == TeLONG)	
-					{
-						((long*)obuf)[col*nb+b] = (long)val;
-					}
-					else if (mmpars.dataType_[0] == TeUNSIGNEDLONG)	
-					{
-						((unsigned long*)obuf)[col*nb+b] = (unsigned long)val;
-					}
-					else if (mmpars.dataType_[0] == TeINTEGER)	
-					{
-						((int*)obuf)[col*nb+b] = (int)val;
-					}
-					else if (mmpars.dataType_[0] == TeUNSIGNEDSHORT)	
-					{
-						((unsigned short*)obuf)[col*nb+b] = (unsigned short)val;
-					}
-					else if (mmpars.dataType_[0] == TeSHORT)	
-					{
-						((short*)obuf)[col*nb+b] = (short)val;
-					}
-					else if (mmpars.dataType_[0] == TeCHAR)											
-					{
-						obuf[col*nb+b] = (char)val;
-					}
-					else											
-					{
-						obuf[col*nb+b] = (unsigned char)val;
-					}
-
-				}
-			}
-			if (!TIFFWriteScanline(tif, obuf, row, 0))
-			{
-				TIFFFlushData(tif);
-				_TIFFfree(obuf);
-				return false;
-			}
-		}
-		TIFFFlushData(tif);
-		_TIFFfree(obuf);
-	}
-	
-	if (dataBuffer_)
-	{
-		for (unsigned int p=0; p<nplanes_; ++p)
-			delete []dataBuffer_[p];
-		delete []dataBuffer_;
-	}
-	dataBuffer_ = 0;
-
-	if (gtif)
-		GTIFFree(gtif);
-	gtif = 0;
-
-	if (tif)
-		XTIFFClose(tif); 
-	tif = 0;
-
-	memManager_.clear();
-	params_.status_ = TeRasterParams::TeNotReady;
-	params_.errorMessage_.clear();
-	return true;
-}
-
-TeDecoderTIFF::~TeDecoderTIFF()
-{
-	clear();
-}
-
-bool
-TeDecoderTIFF::setElement(int col, int lin, double val, int band)
-{
-	return memManager_.setElement(col,lin,val,band);
-}
-
-
-bool
-TeDecoderTIFF::getElement(int col,int lin, double &val,int band)
-{
-	unsigned int pos;
-	unsigned long plane;
-	if (isTiled_)  // tiled organization
-	{
-		if (TCurTile_ != (long)(lin/tileh_))
-		{
-			if (!readTileImageContig(lin/tileh_))
-				return false;
-			else
-				TCurTile_ = (long)(lin/tileh_);
-		}
-		plane = (col/tilew_);
-		lin = lin - TCurTile_*tileh_;
-		col = col - (int)(col/tilew_)*tilew_;
-		pos = lin*tilew_*nBands_+col*nBands_+band; 
-	}	
-	else			// striped organization
-	{
-		if (TCurStrip_ != (long)(lin/rowsperstrip_))
-		{
-			if (!readStrip(lin/rowsperstrip_)) // strip is not in memory
-				return false;
-			else
-				TCurStrip_ = (long)(lin/rowsperstrip_);
-		}
-		lin = lin-(TCurStrip_*rowsperstrip_);
-		plane = 0;
-		if (planar_ == PLANARCONFIG_CONTIG)
-		{
-			pos = lin*params_.ncols_*nBands_+col*nBands_+band;
-		}
-		else
-		{
-			pos = lin*params_.ncols_+col;
-			plane = band;
-		}
-	}
-	(this->*( getelement_ptr_))(plane,pos,val);
-	return true;
-}
-
-
-// --- Internal Methods ---
-void
-TeDecoderTIFF::readTiffDirectory()
-{
-	int ncols=0, nlins = 0;
-	TIFFGetField(tif,TIFFTAG_IMAGEWIDTH,&ncols);
-	TIFFGetField(tif,TIFFTAG_IMAGELENGTH,&nlins);
-	params_.ncols_ = ncols;
-	params_.nlines_ = nlins;
-		
-	short samplesperPixel;
-	if (!TIFFGetField(tif,TIFFTAG_SAMPLESPERPIXEL,&samplesperPixel) )
-		params_.nBands(1);
-	else
-		params_.nBands(samplesperPixel);
-	nBands_ = params_.nBands();
-
-	unsigned long nbitsperpixel_ = 0;
-	if( !TIFFGetField(tif,TIFFTAG_BITSPERSAMPLE,&nbitsperpixel_) )
-	{
-		nbitsperpixel_ = 1;
-		params_.setDataType(TeBIT);
-	}
-	else
-	{
-		short sampleformat;
-		if (!TIFFGetField(tif,TIFFTAG_SAMPLEFORMAT,&sampleformat))
-			sampleformat = 0;
-
-		TeDataType tifType;
-		if (nbitsperpixel_ == 8)
-		{
-			if (sampleformat == SAMPLEFORMAT_INT)
-				tifType = TeCHAR;
-			else 
-				tifType = TeUNSIGNEDCHAR;
-		}
-		else if (nbitsperpixel_ == 16)
-		{
-			if (sampleformat == SAMPLEFORMAT_INT)
-				tifType = TeSHORT;
-			else 
-				tifType = TeUNSIGNEDSHORT;
-		}
-		else if (nbitsperpixel_ == 32)
-		{
-			if (sampleformat == SAMPLEFORMAT_INT)
-				tifType = TeLONG;
-			else if (sampleformat == SAMPLEFORMAT_UINT)
-				tifType = TeUNSIGNEDLONG;
-			else
-				tifType = TeFLOAT;		
-		}
-		else 
-			tifType = TeDOUBLE;
-		params_.setDataType(tifType);
-	}
-	unsigned short	photom_;    // photometric interpretation
-	TIFFGetField(tif,TIFFTAG_PHOTOMETRIC,&photom_);     // photometric interpretation
-	if (samplesperPixel == 3 && 
-	   (photom_ == PHOTOMETRIC_MINISWHITE || 
-	    photom_ == PHOTOMETRIC_MINISBLACK))
-		photom_ = PHOTOMETRIC_RGB;
-	
-	switch (photom_)
-	{
-	case PHOTOMETRIC_PALETTE:
-		params_.setPhotometric(TeRasterParams::TePallete);
-		TImage_ = 2;
-		readLut();
-		break;
-	case PHOTOMETRIC_RGB:
-		params_.setPhotometric(TeRasterParams::TeRGB);
-		TImage_ = 1;
-		break;
-	default:
-		params_.setPhotometric(TeRasterParams::TeMultiBand);
-		TImage_ = 0;
-	}
-	TIFFGetField(tif,TIFFTAG_PLANARCONFIG,&planar_);	// storage organization
-	isTiled_ = TIFFIsTiled(tif) != 0;						// return non-zero if is organized in tiles 
-	if (isTiled_)
-	{
-		TIFFGetField(tif,TIFFTAG_TILEWIDTH,&tilew_);
-		TIFFGetField(tif,TIFFTAG_TILELENGTH,&tileh_);
-		bytespertile_ = TIFFTileSize(tif);
-		tilesacross_ = (params_.ncols_ + tilew_ - 1) / tilew_;
-		params_.blockWidth_ = tilew_;
-		params_.blockWidth_ = tileh_;
-	}
-	else
-	{
-		TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip_);
-		nstripsperplane_ =  TIFFNumberOfStrips(tif)/nBands_;	
-		stripsize_ = TIFFStripSize(tif);
-	}
-
-	unsigned short compress_;    // photometric interpretation
-	TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress_);
-	if (compress_ != COMPRESSION_NONE)
-		params_.setCompressionMode(TeRasterParams::TeTiffCompression);
-
-	char* text = "";
-	if(TIFFGetField(tif,TIFFTAG_DATETIME,&text)) //creation date
-	{
-		std::string strDate(text);
-		TeTime imageDate(strDate, TeSECOND, "YYYYsMMsDDsHHsmmsSS24", ":");
-		if(imageDate.isValid())
-		{
-			params_.date_ = imageDate;
-		}
-	}
-
-	// Read georeference parameters
-	getGeoTIFF();
-	if (!params_.box().isValid())
-		params_.lowerLeftResolutionSize(0.5,0.5,1,1,params_.ncols_,params_.nlines_);
-}
-
-bool 
-TeDecoderTIFF::allocateWorkMemory()
-{
-	if (dataBuffer_ && nplanes_>0)	// release previously used buffer
-	{
-		for (unsigned int p=0; p<nplanes_; ++p)
-			delete []dataBuffer_[p];
-		delete []dataBuffer_;
-	}
-	dataBuffer_ = 0;
-	unsigned long buffersize;
-	if (isTiled_)			
-	{
-		nplanes_ = tilesacross_;
-		buffersize = bytespertile_;
-	}
-	else 
-	{
-		if (planar_ == PLANARCONFIG_SEPARATE)
-			nplanes_ = nBands_;
-		else
-			nplanes_ = 1;
-		buffersize = stripsize_;
-	}
-
-	dataBuffer_ = new unsigned char*[nplanes_];
-	unsigned int i;
-	for (i=0; i<nplanes_; ++i)
-	{
-		dataBuffer_[i] = new unsigned char [buffersize];
-		if (!dataBuffer_[i])
-		{
-			for (unsigned int j=0; j<i; ++j)
-				delete []dataBuffer_[j];
-			delete []dataBuffer_;
-			dataBuffer_=0;
-			return false;
-		}
-	}
-	data_TeUNSIGNEDCHAR_ = (unsigned char**)dataBuffer_;
-	data_TeCHAR_ = (char**)dataBuffer_;
-	data_TeUNSIGNEDSHORT_ = (unsigned short**)dataBuffer_;
-	data_TeSHORT_ = (short**)dataBuffer_;
-	data_TeINTEGER_ = (int**)dataBuffer_;
-	data_TeUNSIGNEDLONG_ = (unsigned long**)dataBuffer_;
-	data_TeLONG_ = (long**)dataBuffer_;
-	data_TeFLOAT_ = (float**)dataBuffer_;
-	data_TeDOUBLE_ = (double**)dataBuffer_;
-
-	switch ( params_.dataType_[0] ) 
-	{
-	case (TeUNSIGNEDCHAR):
-		getelement_ptr_ = &TeDecoderTIFF::getElement_TeUNSIGNEDCHAR;
-		break;
-	case (TeCHAR) :
-		getelement_ptr_ = &TeDecoderTIFF::getElement_TeCHAR;
-		break;
-	case (TeUNSIGNEDSHORT):
-		getelement_ptr_ = &TeDecoderTIFF::getElement_TeUNSIGNEDSHORT;
-		break;
-	case (TeSHORT):
-		getelement_ptr_ = &TeDecoderTIFF::getElement_TeSHORT;
-		break;
-	case (TeINTEGER):
-		getelement_ptr_ = &TeDecoderTIFF::getElement_TeINTEGER;
-		break;
-	case (TeUNSIGNEDLONG):
-		getelement_ptr_ = &TeDecoderTIFF::getElement_TeUNSIGNEDLONG;
-		break;
-	case (TeLONG):
-		getelement_ptr_ = &TeDecoderTIFF::getElement_TeLONG;
-		break;
-	case (TeFLOAT):
-		getelement_ptr_ = &TeDecoderTIFF::getElement_TeFLOAT;
-		break;
-	case (TeDOUBLE):
-		getelement_ptr_ = &TeDecoderTIFF::getElement_TeDOUBLE;
-		break;
-	default:
-		throw TeException( UNKNOWN_ERROR_TYPE, "Invalid raster data type", false );
-	}
-	return true;
-}
-void 
-TeDecoderTIFF::setGeoKeys()
-{
-  TeRasterParams& mmparams = memManager_.params();  
-  
-// Image Size
-	TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, mmparams.ncols_);
-	TIFFSetField(tif, TIFFTAG_IMAGELENGTH, mmparams.nlines_);
-
-// Orientation
-	TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
-
-// Number of bits
-	int nb = mmparams.nbitsperPixel_[0];
-	TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, nb);
-	switch (mmparams.dataType_[0]) 
-	{
-		case TeUNSIGNEDCHAR:
-		case TeUNSIGNEDSHORT:
-		case TeUNSIGNEDLONG:
-			TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
-			break;
-		case TeCHAR:
-		case TeSHORT:
-		case TeINTEGER:
-		case TeLONG:
-			TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT);
-			break;
-		case TeFLOAT:
-		case TeDOUBLE:
-			TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP);
-			break;
-		default:
-			TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_VOID);
-			break;
-	}
-// Number of bands
-	TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, mmparams.nBands() );
-
-// Compression
-	TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
-
-// Planar configuration
-	TIFFSetField(tif,TIFFTAG_PLANARCONFIG,  PLANARCONFIG_CONTIG);
-
-// Photometric type
-	if (mmparams.nBands() == 1) // monobands
-	{
-		if (mmparams.photometric_[0] == TeRasterParams::TePallete)
-		{
-			TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE);
-			saveLut();
-			TImage_ = 2;
-		} 
-		else 
-		{
-			TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
-			TImage_ = 0;
-		}
-	} 
-	else if (mmparams.nBands() == 3) 
-	{
-		if ( mmparams.photometric_[0] == TeRasterParams::TeRGB ) 
-		{
-			TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
-			TImage_ = 1;
-		} 
-		else 
-		{
-			TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
-			TImage_ = 0;
-		}
-	} 
-	else 
-	{
-		TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
-		TImage_ = 0;
-	}
-	TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1);
-
-	if(mmparams.date_.isValid())
-	{
-		std::string creationDate = mmparams.date_.getDateTime("YYYYsMMsDDsHHsmmsSS", ":");
-		TIFFSetField(tif, TIFFTAG_DATETIME, creationDate.c_str());
-	}
-
-	if (mmparams.dxI_ != 0. || mmparams.dyJ_ != 0.) // there is a rotation defined
-	{
-		//	It seems that most viewers are not able to deal with GTIFF_TRANSMATRIX...
-		// ... so let's write a navigation file instead...
-		string tfw = TeGetName(mmparams.fileName_.c_str())+".tfw";
-		FILE* fp = fopen(tfw.c_str(),"w");
-		if (fp)
-		{
-			fprintf(fp,"%.6f\n",mmparams.dxJ_);
-			fprintf(fp,"%.6f\n",mmparams.dyI_);
-			fprintf(fp,"%.6f\n",mmparams.dxI_);
-			fprintf(fp,"%.6f\n",mmparams.dyJ_);
-			fprintf(fp,"%.6f\n",mmparams.x0_);
-			fprintf(fp,"%.6f\n",mmparams.y0_);
-			
-			fclose( fp );
-		}
-	}
-	else // tf there is no rotation use one tie point and pixel scale
-	{
-		double tiepoint[6];
-		tiepoint[0] = 0;
-		tiepoint[1] = 0;
-		tiepoint[2] = 0;
-		tiepoint[3] = mmparams.boundingBox().x1_;
-		tiepoint[4] = mmparams.boundingBox().y2_;
-		tiepoint[5] = 0;
-		TIFFSetField(tif, GTIFF_TIEPOINTS, 6,&tiepoint); 
-
-		double resolution[3];
-		resolution[0] = mmparams.resx_;
-		resolution[1] = mmparams.resy_;
-		resolution[2] = 0;
-		TIFFSetField(tif, GTIFF_PIXELSCALE, 3,&resolution);
-	}
-
-	// projection parameters
-	if (!mmparams.projection() || mmparams.projection()->name() == "NoProjection")
-	{
-		// at least try to write a tfw file
-		string tfw = TeGetName(mmparams.fileName_.c_str())+".tfw";
-		FILE* fp = fopen(tfw.c_str(),"w");
-		if (fp)
-		{
-			vector<double> tfw;
-			mmparams.getNavigationParameters(tfw);
-			for (unsigned int nl=0; nl<6; ++nl)
-				fprintf(fp,"%8.4f\n",tfw[nl]);
-				
-		  fclose( fp );
-		}
-		return;
-	}
-	GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsArea);
-	const TeProjectionParams& paramas = mmparams.projection()->params();
-	const string& projname = mmparams.projection()->name();
-	if (projname == "LatLong")
-	{
-		GTIFKeySet(gtif, GTModelTypeGeoKey, TYPE_SHORT, 1, ModelTypeGeographic);
-		GTIFKeySet(gtif, GeogAngularUnitsGeoKey, TYPE_SHORT, 1, Angular_Degree);
-	}
-	else
-	{
-		GTIFKeySet(gtif, GTModelTypeGeoKey, TYPE_SHORT, 1, ModelTypeProjected);
-		GTIFKeySet(gtif, ProjLinearUnitsGeoKey, TYPE_SHORT, 1,Linear_Meter);
-		if (projname == "UTM")
-		{
-			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_TransverseMercator);
-			GTIFKeySet(gtif, ProjNatOriginLatGeoKey, TYPE_DOUBLE,1,paramas.lat0*TeCRD);
-			GTIFKeySet(gtif, ProjNatOriginLongGeoKey, TYPE_DOUBLE,1,paramas.lon0*TeCRD);
-			GTIFKeySet(gtif, ProjScaleAtNatOriginGeoKey, TYPE_DOUBLE,1,paramas.scale);
-			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE,1,paramas.offx);
-			GTIFKeySet(gtif, ProjFalseNorthingGeoKey, TYPE_DOUBLE,1,paramas.offy);
-		}
-		else if (projname == "Mercator")
-		{
-			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_Mercator);
-			GTIFKeySet(gtif, ProjNatOriginLongGeoKey, TYPE_DOUBLE,1,paramas.lon0*TeCRD);
-			GTIFKeySet(gtif, ProjNatOriginLatGeoKey, TYPE_DOUBLE,1,paramas.stlat1*TeCRD);
-			GTIFKeySet(gtif, ProjScaleAtNatOriginGeoKey, TYPE_DOUBLE,1,paramas.scale);
-			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE,1,paramas.offx);
-			GTIFKeySet(gtif, ProjFalseNorthingGeoKey, TYPE_DOUBLE,1,paramas.offy);
-		}
-		else if (projname == "LambertConformal")
-		{
-			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_LambertConfConic_2SP);
-			GTIFKeySet(gtif, ProjFalseOriginLatGeoKey,TYPE_DOUBLE, 1, paramas.lat0*TeCRD);
-			GTIFKeySet(gtif, ProjFalseOriginLongGeoKey, TYPE_DOUBLE, 1, paramas.lon0*TeCRD);
-			GTIFKeySet(gtif, ProjStdParallel1GeoKey, TYPE_DOUBLE, 1, paramas.stlat1*TeCRD);
-			GTIFKeySet(gtif, ProjStdParallel2GeoKey, TYPE_DOUBLE, 1, paramas.stlat2*TeCRD);
-			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE, 1,paramas.offx);
-			GTIFKeySet(gtif, ProjFalseNorthingGeoKey,TYPE_DOUBLE, 1,paramas.offy);
-		}
-		else if (projname == "Polyconic")
-		{
-			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_Polyconic);
-			GTIFKeySet(gtif, ProjNatOriginLatGeoKey,TYPE_DOUBLE, 1, paramas.lat0*TeCRD);
-			GTIFKeySet(gtif, ProjNatOriginLongGeoKey, TYPE_DOUBLE, 1, paramas.lon0*TeCRD);
-			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE, 1,paramas.offx);
-			GTIFKeySet(gtif, ProjFalseNorthingGeoKey,TYPE_DOUBLE, 1,paramas.offy);
-			GTIFKeySet(gtif, ProjScaleAtNatOriginGeoKey, TYPE_DOUBLE,1,paramas.scale);
-		}
-		else if (projname == "CylindricalEquidistant")
-		{
-			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_Equirectangular);
-			GTIFKeySet(gtif, ProjCenterLatGeoKey,TYPE_DOUBLE, 1, paramas.stlat1*TeCRD);
-			GTIFKeySet(gtif, ProjCenterLongGeoKey, TYPE_DOUBLE, 1, paramas.lon0*TeCRD);
-			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE, 1,paramas.offx);
-			GTIFKeySet(gtif, ProjFalseNorthingGeoKey,TYPE_DOUBLE, 1,paramas.offy);
-		}
-		else if (projname == "PolarStereographic")
-		{
-			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_PolarStereographic);
-			GTIFKeySet(gtif, ProjNatOriginLatGeoKey, TYPE_DOUBLE,1,paramas.lat0*TeCRD);
-			GTIFKeySet(gtif, ProjStraightVertPoleLongGeoKey, TYPE_DOUBLE,1,paramas.lon0*TeCRD);
-			GTIFKeySet(gtif, ProjScaleAtNatOriginGeoKey, TYPE_DOUBLE,1,paramas.scale);
-			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE,1,paramas.offx);
-			GTIFKeySet(gtif, ProjFalseNorthingGeoKey, TYPE_DOUBLE,1,paramas.offy);
-		}
-		else if (projname == "Albers")
-		{
-			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_AlbersEqualArea);
-			GTIFKeySet(gtif, ProjStdParallel1GeoKey, TYPE_DOUBLE, 1, paramas.stlat1*TeCRD);
-			GTIFKeySet(gtif, ProjStdParallel2GeoKey, TYPE_DOUBLE, 1, paramas.stlat2*TeCRD);
-			GTIFKeySet(gtif, ProjNatOriginLatGeoKey,TYPE_DOUBLE, 1, paramas.lat0*TeCRD);
-			GTIFKeySet(gtif, ProjNatOriginLongGeoKey, TYPE_DOUBLE, 1, paramas.lon0*TeCRD);
-			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE, 1,paramas.offx);
-			GTIFKeySet(gtif, ProjFalseNorthingGeoKey,TYPE_DOUBLE, 1,paramas.offy);
-		}
-		else if (projname == "Miller")
-		{
-			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_MillerCylindrical);
-			GTIFKeySet(gtif, ProjCenterLatGeoKey, TYPE_DOUBLE, 1, paramas.lat0*TeCRD);
-			GTIFKeySet(gtif, ProjCenterLongGeoKey, TYPE_DOUBLE, 1, paramas.lon0*TeCRD);
-			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE, 1,paramas.offx);
-			GTIFKeySet(gtif, ProjFalseNorthingGeoKey,TYPE_DOUBLE, 1,paramas.offy);
-		}
-	}
-
-	// datum parameters
-	if (paramas.datum.name() == "CorregoAlegre")
-		GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,Datum_Corrego_Alegre);
-	else if (paramas.datum.name() == "WGS84")
-		GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,Datum_WGS84);
-	else if (paramas.datum.name() == "SAD69")
-		GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,Datum_South_American_Datum_1969);
-	else if (paramas.datum.name() == "Aratu")
-		GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,Datum_Aratu);
-	else
-		GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,32767);
-
-	GTIFKeySet(gtif, GeogCitationGeoKey, TYPE_ASCII,1,paramas.datum.name().c_str());
-	GTIFKeySet(gtif, GeogSemiMajorAxisGeoKey,TYPE_DOUBLE, 1, paramas.datum.radius());
-	GTIFKeySet(gtif, GeogSemiMinorAxisGeoKey,TYPE_DOUBLE, 1, paramas.datum.radius()*(1-paramas.datum.flattening()));
-	GTIFWriteKeys(gtif);
-}
-
-bool
-TeDecoderTIFF::getGeoTIFF()
-{
-	params_.resx_ = params_.resy_ = 1;
-
-	//---------------- navigation parameters 
-
-	bool isGeoreferenced_ = false;
-	// The three tags defined below may be used for defining the relationship between R (raster space)
-	// and M (model space), and the relationship may be diagrammed as: 
-	//           ModelPixelScaleTag 
-	//           ModelTiepointTag         
-	//    R  ------------ OR --------------> M
-	//  (I,J,K)  ModelTransformationTag   (X,Y,Z)
-
-	double *tiepoints = 0;
-	double *pixel_scale = 0;
-	double *transform   = 0;
-
-	int count=0, tiepoint_count=0, transform_count=0;
-  	TIFFGetField(tif, GTIFF_TIEPOINTS, &tiepoint_count,&tiepoints);
-	TIFFGetField(tif, GTIFF_PIXELSCALE, &count, &pixel_scale); 
- 	TIFFGetField(tif, GTIFF_TRANSMATRIX, &transform_count, &transform); 
-
-	GTIFDefn defn;
-	int hasGTifDefn;
-	hasGTifDefn = GTIFGetDefn(gtif, &defn);
-	bool isCentreOfPixel = false;
-	if (hasGTifDefn)
-	{
-		short mtype;
-		GTIFKeyGet(gtif,GTRasterTypeGeoKey,&mtype,0,1);
-		if (mtype == RasterPixelIsPoint)
-			isCentreOfPixel = true;
-	}
-
-	// if we couldn't get the georrefencing information from the tags
-	// try to get if from an external (.tfw) world file
-	if (!isGeoreferenced_) 
-	{
-		size_t dotpos = params_.fileName_.rfind('.');
-		if (dotpos != std::string::npos)
-		{
-			vector<double> wf;
-			wf.resize(6);
-			string tfwfile = params_.fileName_.substr(0,dotpos+1) + "tfw";
-			FILE* fp = fopen(tfwfile.c_str(),"r");
-			if (!fp)
-			{
-				tfwfile = params_.fileName_.substr(0,dotpos+1) + "TFW";
-				fp = fopen(tfwfile.c_str(),"r");
-			}
-
-			if (fp)
-			{
-				isGeoreferenced_ = true;
-				char val[40];
-				for (int ii=0; ii<6; ++ii)
-				{
-					if (fscanf(fp,"%s",val))
-						wf[ii] = TeRoundD(atof(val)); 
-					else
-					{
-						isGeoreferenced_ = false;
-						break;
-					}
-				}
-				fclose(fp);
-			}
-			if (isGeoreferenced_)
-				params_.setNavigationParameters(wf);
-		}
-	}
-
-	if (!isGeoreferenced_) 
-	{
-		if (count >= 3 && tiepoint_count >= 6) // if we have 1 tie point and pixel scale
-		{
-			params_.topLeftResolutionSize(tiepoints[3]-tiepoints[0]*pixel_scale[0],
-											tiepoints[4]-tiepoints[1]*pixel_scale[1],
-											pixel_scale[0],pixel_scale[1],
-											params_.ncols_,params_.nlines_,isCentreOfPixel);
-			isGeoreferenced_ = true;
-		}
-		else if (transform_count == 16) // if we have a transformation matrix
-		{
-			vector<double> wf;
-			wf.push_back(transform[0]);
-			wf.push_back(transform[1]);
-			wf.push_back(transform[4]);
-			wf.push_back(transform[5]);
-			wf.push_back(transform[3]);
-			wf.push_back(transform[7]);
-			params_.setNavigationParameters(wf);
-			isGeoreferenced_ = true;
-
-		}
-		// else if (tiepoint_count > 6)
-		// {
-		//		we should use the set of tiepoints to interpolate... not implemented yet...
-		// }
-	}
-
-	//---------------- projection parameters 
-	if (!hasGTifDefn)
-	{
-		if (!params_.projection())
-		{
-			TeProjection* noproj = new TeNoProjection();
-			params_.projection(noproj);
-			delete noproj;
-		}
-		return false;
-	}
-	else
-	{
-		// 1) Get Datum parameters
-		TeDatum mDatum;
-		if (defn.Datum == Datum_South_American_Datum_1969)
-			mDatum = TeDatumFactory::make("SAD69");
-		else if (defn.Datum == Datum_WGS84)
-			mDatum = TeDatumFactory::make("WGS84");
-		else if (defn.Datum == Datum_Corrego_Alegre)
-			mDatum = TeDatumFactory::make("CorregoAlegre");
-		else if (defn.Datum == Datum_Aratu)
-			mDatum = TeDatumFactory::make("Aratu");
-		else
-		{
-			if(params_.projection())
-				mDatum = params_.projection()->datum();
-			else
-            {
-				double TISemiMajor = defn.SemiMajor, TISemiMinor = defn.SemiMinor;
-				// unknown datum... try to find a similar one based on SemiAxis values
-				if (defn.SemiMajor == 0. && defn.SemiMinor == 0.)
-				{
-					TISemiMajor =6.371000e+06;		// default parameter of a spherical ellipsoid
-					TISemiMinor =6.371000e+06;            
-				}
-				if (!findDatum(TISemiMajor,(TISemiMajor - TISemiMinor)/TISemiMajor,mDatum))
-					mDatum = TeDatum("UserDefined",TISemiMajor,(TISemiMajor - TISemiMinor)/TISemiMajor,0.,0.,0.);
-			}
-		}
-
-		// 2) Get projection parameters
-		// if geographical model
-		short mtype = 0;
-
-		GTIFKeyGet(gtif, GTModelTypeGeoKey,&mtype, 0, 1 );
-
-		if (mtype == ModelTypeGeographic)	 
-		{
-			TeProjection* latlong = new TeLatLong(mDatum);
-			params_.projection(latlong);
-			delete latlong;
-			return true;
-		}		
-
-		if (mtype != ModelTypeProjected)
-		{
-			if (!params_.projection())
-			{
-				TeProjection* noproj = new TeNoProjection();
-				params_.projection(noproj);
-				delete noproj;
-				return false;
-			}
-			return true;
-		}
-		TeProjectionParams mProjPars;	
-		mProjPars.units = "Meters"; // == not necessarily true... we should check for the units as defined in geotiff	
-		mProjPars.datum = mDatum;
-
-		// just set all parameters available from defn... some of them will not be used by some projections
-		mProjPars.lat0 = defn.ProjParm[0]*defn.UOMAngleInDegrees*TeCDR;
-		mProjPars.lon0 = defn.ProjParm[1]*defn.UOMAngleInDegrees*TeCDR;
-		mProjPars.stlat1 = defn.ProjParm[2]*defn.UOMAngleInDegrees*TeCDR;
-		mProjPars.stlat2 = defn.ProjParm[3]*defn.UOMAngleInDegrees*TeCDR;
-		mProjPars.scale = defn.ProjParm[4];
-		mProjPars.offx = defn.ProjParm[5];
-		mProjPars.offy = defn.ProjParm[6];
-		if (mProjPars.offy > 0)
-			mProjPars.hemisphere = TeSOUTH_HEM;
-		else
-			mProjPars.hemisphere = TeNORTH_HEM;
-
-		// now make the correspondence between geotiff projections and terralib projections
-		switch (defn.CTProjection)
-		{
-			case CT_TransverseMercator : 
-				mProjPars.name = "UTM";
-			break;
-			case CT_Mercator :
-				mProjPars.name = "Mercator";
-			break;
-			case CT_LambertConfConic_2SP :
-				mProjPars.name = "LambertConformal";
-			break;
-			case CT_Polyconic : 
-				mProjPars.name = "Polyconic";
-			break;
-			case CT_Equirectangular :
-				mProjPars.name = "CylindricalEquidistant";
-			break;
-			case CT_PolarStereographic :
-				mProjPars.name = "PolarStereographic";
-			break;
-			case CT_AlbersEqualArea :
-				mProjPars.name = "Albers";
-			break;
-			case CT_MillerCylindrical:
-				mProjPars.name = "Miller";
-			break;
-			case CT_Sinusoidal:
-				mProjPars.name = "TeSinusoidal";
-			break;
-			default:
-				TeBox bb = params_.boundingBox();
-				if (bb.x1_ >= -180 && bb.x1_ <= 180 && bb.y1_ >= -90 && bb.y2_ <= 90)
-					mProjPars.name = "LatLong";
-				else
-				{
-					TeProjection* noproj = TeProjectionFactory::make(mProjPars);
-					params_.projection(noproj);
-					delete noproj;
-					return false;
-				}
-			break;
-		}
-		TeProjection* proj = TeProjectionFactory::make(mProjPars);
-		params_.projection(proj);
-		delete proj;
-		return true;
-	}
-}
-
-bool 
-TeDecoderTIFF::readStrip(unsigned long strip)
-{
-	assert(tif);
-	if (planar_ == PLANARCONFIG_CONTIG)	// for planar config all planes are in the strip
-		return (TIFFReadEncodedStrip(tif, strip, dataBuffer_[0], -1) > 0);
-	
-	for (unsigned int i=0; i<nBands_; ++i)	// for separated config we have to read each plane individually
-	{
-		if (TIFFReadEncodedStrip(tif, (strip+i*nstripsperplane_), dataBuffer_[i],-1) == -1)
-			return false;
-	}
-	return true;
-}
-
-bool 
-TeDecoderTIFF::readTileImageContig(unsigned long tiler) 
-{
-	tiler *= tilesacross_;
-	unsigned long i;
-	for (i=0; i<tilesacross_; ++i)
-	{
-		if (TIFFReadEncodedTile(tif,tiler+i,dataBuffer_[i],-1) == -1)
-			return false;
-	}
-	return true;
-}
-
-// --- To read and set a LUT table ---
-
-static int checkmap(int n, unsigned short *r, unsigned short *g, unsigned short *b,long val)
-{
-    while (n-- >= 0)
-		if (*r++ > val || *g++ > val || *b++ > val)
-			return (16);
-    return (8);
-}
-
-static unsigned short CVT1 (unsigned long x,long value)	//CVT is used in DEC station
-{
-	unsigned long den = (1L << 16) -1L;
-	unsigned short num = (unsigned short)((x*value)/den); // normalize lut value
-	return num;
-}
-
-bool
-TeDecoderTIFF::readLut()
-{
-	unsigned short *rmap,*gmap,*bmap;
-	if (!TIFFGetField(tif, TIFFTAG_COLORMAP, &rmap, &gmap, &bmap))
-		return false;
-	params_.lutr_.clear();
-	params_.lutb_.clear();
-	params_.lutg_.clear();
-
-	unsigned int n = params_.lutr_.size();
-	
-	int nindexes = (1 << params_.nbitsperPixel_[0]);
-	long maxval = (long)pow(2.,params_.nbitsperPixel_[0])-1;
-
-	int x;
-	if (checkmap (nindexes,rmap,gmap,bmap,maxval) == 16)
-	{
-		for(x=0; x<nindexes; ++x)
-		{
-			params_.lutr_.push_back(CVT1(rmap[x],maxval)); 
-			params_.lutg_.push_back(CVT1(gmap[x],maxval));
-			params_.lutb_.push_back(CVT1(bmap[x],maxval));
-		}
-	}
-	else
-	{
-		for(x=0; x<nindexes; ++x)
-		{
-			params_.lutr_.push_back(rmap[x]);
-			params_.lutg_.push_back(gmap[x]);
-			params_.lutb_.push_back(bmap[x]);
-		}
-	}
-	n = params_.lutr_.size();
-	return true;
-}
-
-void
-TeDecoderTIFF::saveLut()
-{
-	if (!tif)
-		return;
-    
-  TeRasterParams& mmparams = memManager_.params();  
-
-	int nentries = mmparams.lutr_.size();
-	if (nentries <= 0) 
-		return;
-
-	unsigned short* lutr = new unsigned short[nentries];
-	unsigned short* lutg = new unsigned short[nentries];
-	unsigned short* lutb = new unsigned short[nentries];
-
-	for (int i=0; i<nentries; i++)
-	{
-		lutr[i] = mmparams.lutr_[i]*255;
-		lutg[i] = mmparams.lutg_[i]*255;
-		lutb[i] = mmparams.lutb_[i]*255;
-	}
-	TIFFSetField(tif, TIFFTAG_COLORMAP,lutr,lutg,lutb);
-	delete [] lutr;
-	delete [] lutg;
-	delete [] lutb;
-}
-
-
-inline void TeDecoderTIFF::getElement_TeUNSIGNEDCHAR(const long& plane, const long& pos, double& val)
-{
-	assert(data_TeUNSIGNEDCHAR_ != 0 );
-	val = (double)data_TeUNSIGNEDCHAR_[plane][pos];
-}
-
-
-inline void TeDecoderTIFF::getElement_TeCHAR(const long& plane, const long& pos, double& val)
-{
-	assert(data_TeCHAR_ != 0 );
-	val = (double)data_TeCHAR_[plane][pos];
-}
-
-
-inline void TeDecoderTIFF::getElement_TeUNSIGNEDSHORT(const long& plane, const long& pos, double& val)
-{
-	assert(data_TeUNSIGNEDSHORT_ != 0 );
-	val = (double)data_TeUNSIGNEDSHORT_[plane][pos];
-}
-
-
-inline void TeDecoderTIFF::getElement_TeSHORT(const long& plane, const long& pos, double& val)
-{
-	assert(data_TeSHORT_ != 0 );
-	val = (double)data_TeSHORT_[plane][pos];
-}
-
-
-inline void TeDecoderTIFF::getElement_TeINTEGER(const long& plane, const long& pos, double& val)
-{
-	assert(data_TeINTEGER_ != 0 );
-	val = (double)data_TeINTEGER_[plane][pos];
-}
-
-
-inline void TeDecoderTIFF::getElement_TeUNSIGNEDLONG(const long& plane, const long& pos, double& val)
-{
-	assert(data_TeUNSIGNEDLONG_ != 0 );
-	val = (double)data_TeUNSIGNEDLONG_[plane][pos];
-}
-
-
-inline void TeDecoderTIFF::getElement_TeLONG(const long& plane, const long& pos,double& val)
-{
-	assert(data_TeLONG_ != 0 );
-	val = (double)data_TeLONG_[plane][pos];
-}
-
-
-inline void TeDecoderTIFF::getElement_TeFLOAT(const long& plane, const long& pos, double& val)
-{
-	assert(data_TeFLOAT_ != 0 );
-	val = (double)data_TeFLOAT_[plane][pos];
-}
-
-
-inline void TeDecoderTIFF::getElement_TeDOUBLE(const long& plane, const long& pos, double& val)
-{
-	assert(data_TeDOUBLE_ != 0 );
-	val = (double)data_TeDOUBLE_[plane][pos];
-}
-
-
-TeDecoderTIFFFactory::TeDecoderTIFFFactory(const string& name): 
-	TeDecoderFactory(name) 
-{
-	// Defines the decoder identifiers synonyms
-	TeDecoderFactory::instanceName2Dec()["TIF"] = "TIF";	
-	TeDecoderFactory::instanceName2Dec()["TIFF"] = "TIF";
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeDecoderTIFF.h"
+#include "TeUtils.h"
+#include "TeException.h"
+#include <geovalues.h>
+#include <geo_normalize.h>
+#include <geo_tiffp.h>
+
+#include <fstream>
+#include <cassert>
+using std::ifstream;
+using std::ofstream;
+
+// ---- Public Methods ----- 
+
+TeDecoderTIFF::TeDecoderTIFF(const TeRasterParams& par):
+	tif(0),
+	gtif(0),
+	dataBuffer_(0),
+	nplanes_(0),
+	isGeoTiff_(false),
+	TImage_(0),
+	planar_(PLANARCONFIG_CONTIG),
+	isTiled_(false),
+	tilew_(0),
+	tileh_(0),
+	tilesacross_(0),
+	bytespertile_(0),
+	TCurTile_(-1),
+	rowsperstrip_(0),
+	nstripsperplane_(0),
+	stripsize_(0),
+	TCurStrip_(-1),
+	nBands_(1),
+	data_TeUNSIGNEDCHAR_(0), 
+	data_TeCHAR_(0),   
+	data_TeUNSIGNEDSHORT_(0),  
+	data_TeSHORT_(0),   
+	data_TeINTEGER_(0),   
+	data_TeUNSIGNEDLONG_(0),   
+	data_TeLONG_(0),  
+	data_TeFLOAT_(0), 
+	data_TeDOUBLE_(0)  
+{
+	params_ = par;
+	params_.status_= TeRasterParams::TeNotReady;
+	if (params_.mode_ == 'r')		// file should exists
+	{								// read tiff/geotiff parameters
+		tif=XTIFFOpen(params_.fileName_.c_str(),"r");
+		if (!tif)
+			return;
+
+		gtif = (GTIF*)GTIFNew(tif);
+    
+		if(gtif) readTiffDirectory();
+    
+		if (gtif)
+		{
+			GTIFFree(gtif);
+			gtif = 0;
+		}
+		if (tif)
+		{
+			XTIFFClose(tif); 
+			tif = 0;
+		}
+		params_.decoderIdentifier_ = "TIF";
+	}
+}
+
+void
+TeDecoderTIFF::init()
+{
+	clear();		// reset existent internal structures
+	params_.status_= TeRasterParams::TeNotReady;
+
+	// TIFF image files may not be opened for both reading and writing; 
+	// there is no support for altering the contents of a TIFF file. So
+	// mode == 'w' never initializes this decoder.
+	if (params_.mode_ == 'w')
+	{
+		params_.errorMessage_ = "There is no support for altering the contents of a TIFF file.";
+		return;
+	}
+	if (params_.mode_ != 'r' && params_.mode_ != 'c')	// unknown mode
+	{
+		params_.errorMessage_ = "Invalid access mode.";
+		return;
+	}
+
+	// check the initial permissions on the file
+	if (params_.mode_ == 'c')		// creating a new raster file
+	{
+		ofstream dataFile(params_.fileName_.c_str()); // try to (re)create the file
+		if (!dataFile)
+		{
+			params_.errorMessage_ = "Fail to (re)create the raster the file:" + params_.fileName_;
+			return;
+		}
+		dataFile.close();
+		memManager_.updateParams(params_);
+		memManager_.params().decoderIdentifier_ = "SMARTMEM";
+		memManager_.params().mode_ = 'c';
+		memManager_.init();
+		if (memManager_.params().status_ != TeRasterParams::TeReadyToWrite)
+		{
+			params_.errorMessage_ = "Fail to create the raster the file:" + params_.fileName_;
+			return;
+		}
+		else
+			params_.status_ = TeRasterParams::TeReadyToWrite;
+
+		tif=XTIFFOpen(params_.fileName_.c_str(),"a");
+		if (!tif)
+		{
+			params_.errorMessage_ = "Fail to create a tiff file.";
+			params_.status_= TeRasterParams::TeNotReady;
+			return;
+		}
+
+		// try to create a geotiff instance on the tiff file 
+		gtif = (GTIF*)GTIFNew(tif);
+		if (!gtif)
+		{
+			params_.errorMessage_ = "Fail to instantiate a geotiff file.";
+			params_.status_= TeRasterParams::TeNotReady;
+			return;
+		}
+		return;
+	}
+	
+	ifstream dataFile(params_.fileName_.c_str()); // check if file exists
+	if (!dataFile)
+	{
+		params_.errorMessage_ = "Fail to open the raster the file:" + params_.fileName_;
+		return; 
+	}
+	dataFile.close();				
+	// try to open the tiff file with the desired mode
+	tif=XTIFFOpen(params_.fileName_.c_str(),"r");
+	if (!tif)
+	{
+		params_.errorMessage_ = "Fail to instantiate a tiff file.";
+		return;
+	}
+
+	isTiled_ = TIFFIsTiled(tif) != 0;						// return non-zero if is organized in tiles 
+	TIFFGetField(tif,TIFFTAG_PLANARCONFIG,&planar_);	// storage organization
+	if (isTiled_ && (planar_== PLANARCONFIG_SEPARATE))
+	{
+		XTIFFClose(tif); 
+		tif = 0;
+		params_.errorMessage_ = "There is no support to decode tiff files that are tiled and organized in separate planes.";
+		return;
+	}
+
+	// try to create a geotiff instance on the tiff file 
+	gtif = (GTIF*)GTIFNew(tif);
+	if (!gtif)
+	{
+		XTIFFClose(tif); 
+		tif = 0;
+		params_.errorMessage_ = "Fail to instantiate a geotiff file.";
+		return;
+	}
+	readTiffDirectory();			// read tiff keys
+	getGeoTIFF();					// read geotiff keys
+	params_.errorMessage_.clear();
+	if (allocateWorkMemory())
+		params_.status_ = TeRasterParams::TeReadyToRead;
+	else
+	{
+		XTIFFClose(tif); 
+		tif = 0;
+		GTIFFree(gtif);
+		gtif = 0;
+		params_.errorMessage_ = "Fail to allocate necessary work memory.";
+	}
+}
+
+
+bool 
+TeDecoderTIFF::clear()
+{
+	if (!tif || !gtif)
+		return true;
+    
+  TeRasterParams& mmpars = memManager_.params();  
+
+	if (mmpars.mode_== 'c')
+	{
+		setGeoKeys();
+		int row, col, b;
+		double val=0.0;
+		int nb = mmpars.nBands();
+		long ssize = TIFFScanlineSize(tif);
+		unsigned char* obuf = (unsigned char*)_TIFFmalloc(ssize);
+    
+		for (row=0; row<mmpars.nlines_; ++row)
+		{
+			for (col=0; col<mmpars.ncols_; ++col)
+			{			
+				for (b=0; b<nb; ++b)
+				{
+					if (!memManager_.getElement(col,row,val,b))
+						continue;
+
+					if (mmpars.dataType_[0] == TeDOUBLE)			
+					{
+						((double*)obuf)[col*nb+b] = (double)val;
+					}
+					else if (mmpars.dataType_[0] == TeFLOAT)			
+					{
+						((float*)obuf)[col*nb+b] = (float)val;
+					}
+					else if (mmpars.dataType_[0] == TeLONG)	
+					{
+						((long*)obuf)[col*nb+b] = (long)val;
+					}
+					else if (mmpars.dataType_[0] == TeUNSIGNEDLONG)	
+					{
+						((unsigned long*)obuf)[col*nb+b] = (unsigned long)val;
+					}
+					else if (mmpars.dataType_[0] == TeINTEGER)	
+					{
+						((int*)obuf)[col*nb+b] = (int)val;
+					}
+					else if (mmpars.dataType_[0] == TeUNSIGNEDSHORT)	
+					{
+						((unsigned short*)obuf)[col*nb+b] = (unsigned short)val;
+					}
+					else if (mmpars.dataType_[0] == TeSHORT)	
+					{
+						((short*)obuf)[col*nb+b] = (short)val;
+					}
+					else if (mmpars.dataType_[0] == TeCHAR)											
+					{
+						obuf[col*nb+b] = (char)val;
+					}
+					else											
+					{
+						obuf[col*nb+b] = (unsigned char)val;
+					}
+
+				}
+			}
+			if (!TIFFWriteScanline(tif, obuf, row, 0))
+			{
+				TIFFFlushData(tif);
+				_TIFFfree(obuf);
+				return false;
+			}
+		}
+		TIFFFlushData(tif);
+		_TIFFfree(obuf);
+	}
+	
+	if (dataBuffer_)
+	{
+		for (unsigned int p=0; p<nplanes_; ++p)
+			delete []dataBuffer_[p];
+		delete []dataBuffer_;
+	}
+	dataBuffer_ = 0;
+
+	if (gtif)
+		GTIFFree(gtif);
+	gtif = 0;
+
+	if (tif)
+		XTIFFClose(tif); 
+	tif = 0;
+
+	memManager_.clear();
+	params_.status_ = TeRasterParams::TeNotReady;
+	params_.errorMessage_.clear();
+	return true;
+}
+
+TeDecoderTIFF::~TeDecoderTIFF()
+{
+	clear();
+}
+
+bool
+TeDecoderTIFF::setElement(int col, int lin, double val, int band)
+{
+	return memManager_.setElement(col,lin,val,band);
+}
+
+
+bool
+TeDecoderTIFF::getElement(int col,int lin, double &val,int band)
+{
+	unsigned int pos;
+	unsigned long plane;
+	if (isTiled_)  // tiled organization
+	{
+		if (TCurTile_ != (long)(lin/tileh_))
+		{
+			if (!readTileImageContig(lin/tileh_))
+				return false;
+			else
+				TCurTile_ = (long)(lin/tileh_);
+		}
+		plane = (col/tilew_);
+		lin = lin - TCurTile_*tileh_;
+		col = col - (int)(col/tilew_)*tilew_;
+		pos = lin*tilew_*nBands_+col*nBands_+band; 
+	}	
+	else			// striped organization
+	{
+		if (TCurStrip_ != (long)(lin/rowsperstrip_))
+		{
+			if (!readStrip(lin/rowsperstrip_)) // strip is not in memory
+				return false;
+			else
+				TCurStrip_ = (long)(lin/rowsperstrip_);
+		}
+		lin = lin-(TCurStrip_*rowsperstrip_);
+		plane = 0;
+		if (planar_ == PLANARCONFIG_CONTIG)
+		{
+			pos = lin*params_.ncols_*nBands_+col*nBands_+band;
+		}
+		else
+		{
+			pos = lin*params_.ncols_+col;
+			plane = band;
+		}
+	}
+	(this->*( getelement_ptr_))(plane,pos,val);
+	return true;
+}
+
+
+// --- Internal Methods ---
+void
+TeDecoderTIFF::readTiffDirectory()
+{
+	int ncols=0, nlins = 0;
+	TIFFGetField(tif,TIFFTAG_IMAGEWIDTH,&ncols);
+	TIFFGetField(tif,TIFFTAG_IMAGELENGTH,&nlins);
+	params_.ncols_ = ncols;
+	params_.nlines_ = nlins;
+		
+	short samplesperPixel;
+	if (!TIFFGetField(tif,TIFFTAG_SAMPLESPERPIXEL,&samplesperPixel) )
+		params_.nBands(1);
+	else
+		params_.nBands(samplesperPixel);
+	nBands_ = params_.nBands();
+
+	unsigned long nbitsperpixel_ = 0;
+	if( !TIFFGetField(tif,TIFFTAG_BITSPERSAMPLE,&nbitsperpixel_) )
+	{
+		nbitsperpixel_ = 1;
+		params_.setDataType(TeBIT);
+	}
+	else
+	{
+		short sampleformat;
+		if (!TIFFGetField(tif,TIFFTAG_SAMPLEFORMAT,&sampleformat))
+			sampleformat = 0;
+
+		TeDataType tifType;
+		if (nbitsperpixel_ == 8)
+		{
+			if (sampleformat == SAMPLEFORMAT_INT)
+				tifType = TeCHAR;
+			else 
+				tifType = TeUNSIGNEDCHAR;
+		}
+		else if (nbitsperpixel_ == 16)
+		{
+			if (sampleformat == SAMPLEFORMAT_INT)
+				tifType = TeSHORT;
+			else 
+				tifType = TeUNSIGNEDSHORT;
+		}
+		else if (nbitsperpixel_ == 32)
+		{
+			if (sampleformat == SAMPLEFORMAT_INT)
+				tifType = TeLONG;
+			else if (sampleformat == SAMPLEFORMAT_UINT)
+				tifType = TeUNSIGNEDLONG;
+			else
+				tifType = TeFLOAT;		
+		}
+		else 
+			tifType = TeDOUBLE;
+		params_.setDataType(tifType);
+	}
+	unsigned short	photom_;    // photometric interpretation
+	TIFFGetField(tif,TIFFTAG_PHOTOMETRIC,&photom_);     // photometric interpretation
+	if (samplesperPixel == 3 && 
+	   (photom_ == PHOTOMETRIC_MINISWHITE || 
+	    photom_ == PHOTOMETRIC_MINISBLACK))
+		photom_ = PHOTOMETRIC_RGB;
+	
+	switch (photom_)
+	{
+	case PHOTOMETRIC_PALETTE:
+		params_.setPhotometric(TeRasterParams::TePallete);
+		TImage_ = 2;
+		readLut();
+		break;
+	case PHOTOMETRIC_RGB:
+		params_.setPhotometric(TeRasterParams::TeRGB);
+		TImage_ = 1;
+		break;
+	default:
+		params_.setPhotometric(TeRasterParams::TeMultiBand);
+		TImage_ = 0;
+	}
+	TIFFGetField(tif,TIFFTAG_PLANARCONFIG,&planar_);	// storage organization
+	isTiled_ = TIFFIsTiled(tif) != 0;						// return non-zero if is organized in tiles 
+	if (isTiled_)
+	{
+		TIFFGetField(tif,TIFFTAG_TILEWIDTH,&tilew_);
+		TIFFGetField(tif,TIFFTAG_TILELENGTH,&tileh_);
+		bytespertile_ = TIFFTileSize(tif);
+		tilesacross_ = (params_.ncols_ + tilew_ - 1) / tilew_;
+		params_.blockWidth_ = tilew_;
+		params_.blockWidth_ = tileh_;
+	}
+	else
+	{
+		TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip_);
+		nstripsperplane_ =  TIFFNumberOfStrips(tif)/nBands_;	
+		stripsize_ = TIFFStripSize(tif);
+	}
+
+	unsigned short compress_;    // photometric interpretation
+	TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress_);
+	if (compress_ != COMPRESSION_NONE)
+		params_.setCompressionMode(TeRasterParams::TeTiffCompression);
+
+	char* text = 0;
+	if(TIFFGetField(tif,TIFFTAG_DATETIME,&text)) //creation date
+	{
+		std::string strDate(text);
+		TeTime imageDate(strDate, TeSECOND, "YYYYsMMsDDsHHsmmsSS24", ":");
+		if(imageDate.isValid())
+		{
+			params_.date_ = imageDate;
+		}
+	}
+
+	// Read georeference parameters
+	getGeoTIFF();
+	if (!params_.box().isValid())
+		params_.lowerLeftResolutionSize(0.5,0.5,1,1,params_.ncols_,params_.nlines_);
+}
+
+bool 
+TeDecoderTIFF::allocateWorkMemory()
+{
+	if (dataBuffer_ && nplanes_>0)	// release previously used buffer
+	{
+		for (unsigned int p=0; p<nplanes_; ++p)
+			delete []dataBuffer_[p];
+		delete []dataBuffer_;
+	}
+	dataBuffer_ = 0;
+	unsigned long buffersize;
+	if (isTiled_)			
+	{
+		nplanes_ = tilesacross_;
+		buffersize = bytespertile_;
+	}
+	else 
+	{
+		if (planar_ == PLANARCONFIG_SEPARATE)
+			nplanes_ = nBands_;
+		else
+			nplanes_ = 1;
+		buffersize = stripsize_;
+	}
+
+	dataBuffer_ = new unsigned char*[nplanes_];
+	unsigned int i;
+	for (i=0; i<nplanes_; ++i)
+	{
+		dataBuffer_[i] = new unsigned char [buffersize];
+		if (!dataBuffer_[i])
+		{
+			for (unsigned int j=0; j<i; ++j)
+				delete []dataBuffer_[j];
+			delete []dataBuffer_;
+			dataBuffer_=0;
+			return false;
+		}
+	}
+	data_TeUNSIGNEDCHAR_ = (unsigned char**)dataBuffer_;
+	data_TeCHAR_ = (char**)dataBuffer_;
+	data_TeUNSIGNEDSHORT_ = (unsigned short**)dataBuffer_;
+	data_TeSHORT_ = (short**)dataBuffer_;
+	data_TeINTEGER_ = (int**)dataBuffer_;
+	data_TeUNSIGNEDLONG_ = (unsigned long**)dataBuffer_;
+	data_TeLONG_ = (long**)dataBuffer_;
+	data_TeFLOAT_ = (float**)dataBuffer_;
+	data_TeDOUBLE_ = (double**)dataBuffer_;
+
+	switch ( params_.dataType_[0] ) 
+	{
+	case (TeUNSIGNEDCHAR):
+		getelement_ptr_ = &TeDecoderTIFF::getElement_TeUNSIGNEDCHAR;
+		break;
+	case (TeCHAR) :
+		getelement_ptr_ = &TeDecoderTIFF::getElement_TeCHAR;
+		break;
+	case (TeUNSIGNEDSHORT):
+		getelement_ptr_ = &TeDecoderTIFF::getElement_TeUNSIGNEDSHORT;
+		break;
+	case (TeSHORT):
+		getelement_ptr_ = &TeDecoderTIFF::getElement_TeSHORT;
+		break;
+	case (TeINTEGER):
+		getelement_ptr_ = &TeDecoderTIFF::getElement_TeINTEGER;
+		break;
+	case (TeUNSIGNEDLONG):
+		getelement_ptr_ = &TeDecoderTIFF::getElement_TeUNSIGNEDLONG;
+		break;
+	case (TeLONG):
+		getelement_ptr_ = &TeDecoderTIFF::getElement_TeLONG;
+		break;
+	case (TeFLOAT):
+		getelement_ptr_ = &TeDecoderTIFF::getElement_TeFLOAT;
+		break;
+	case (TeDOUBLE):
+		getelement_ptr_ = &TeDecoderTIFF::getElement_TeDOUBLE;
+		break;
+	default:
+		throw TeException( UNKNOWN_ERROR_TYPE, "Invalid raster data type", false );
+	}
+	return true;
+}
+void 
+TeDecoderTIFF::setGeoKeys()
+{
+  TeRasterParams& mmparams = memManager_.params();  
+  
+// Image Size
+	TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, mmparams.ncols_);
+	TIFFSetField(tif, TIFFTAG_IMAGELENGTH, mmparams.nlines_);
+
+// Orientation
+	TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
+
+// Number of bits
+	int nb = mmparams.nbitsperPixel_[0];
+	TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, nb);
+	switch (mmparams.dataType_[0]) 
+	{
+		case TeUNSIGNEDCHAR:
+		case TeUNSIGNEDSHORT:
+		case TeUNSIGNEDLONG:
+			TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
+			break;
+		case TeCHAR:
+		case TeSHORT:
+		case TeINTEGER:
+		case TeLONG:
+			TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT);
+			break;
+		case TeFLOAT:
+		case TeDOUBLE:
+			TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP);
+			break;
+		default:
+			TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_VOID);
+			break;
+	}
+// Number of bands
+	TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, mmparams.nBands() );
+
+// Compression
+	TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+
+// Planar configuration
+	TIFFSetField(tif,TIFFTAG_PLANARCONFIG,  PLANARCONFIG_CONTIG);
+
+// Photometric type
+	if (mmparams.nBands() == 1) // monobands
+	{
+		if (mmparams.photometric_[0] == TeRasterParams::TePallete)
+		{
+			TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE);
+			saveLut();
+			TImage_ = 2;
+		} 
+		else 
+		{
+			TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
+			TImage_ = 0;
+		}
+	} 
+	else if (mmparams.nBands() == 3) 
+	{
+		if ( mmparams.photometric_[0] == TeRasterParams::TeRGB ) 
+		{
+			TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
+			TImage_ = 1;
+		} 
+		else 
+		{
+			TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
+			TImage_ = 0;
+		}
+	} 
+	else 
+	{
+		TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
+		TImage_ = 0;
+	}
+	TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1);
+
+	if(mmparams.date_.isValid())
+	{
+		std::string creationDate = mmparams.date_.getDateTime("YYYYsMMsDDsHHsmmsSS", ":");
+		TIFFSetField(tif, TIFFTAG_DATETIME, creationDate.c_str());
+	}
+
+	if (mmparams.dxI_ != 0. || mmparams.dyJ_ != 0.) // there is a rotation defined
+	{
+		//	It seems that most viewers are not able to deal with GTIFF_TRANSMATRIX...
+		// ... so let's write a navigation file instead...
+		string tfw = TeGetName(mmparams.fileName_.c_str())+".tfw";
+		FILE* fp = fopen(tfw.c_str(),"w");
+		if (fp)
+		{
+			fprintf(fp,"%.6f\n",mmparams.dxJ_);
+			fprintf(fp,"%.6f\n",mmparams.dyI_);
+			fprintf(fp,"%.6f\n",mmparams.dxI_);
+			fprintf(fp,"%.6f\n",mmparams.dyJ_);
+			fprintf(fp,"%.6f\n",mmparams.x0_);
+			fprintf(fp,"%.6f\n",mmparams.y0_);
+			
+			fclose( fp );
+		}
+	}
+	else // tf there is no rotation use one tie point and pixel scale
+	{
+		double tiepoint[6];
+		tiepoint[0] = 0;
+		tiepoint[1] = 0;
+		tiepoint[2] = 0;
+		tiepoint[3] = mmparams.boundingBox().x1_;
+		tiepoint[4] = mmparams.boundingBox().y2_;
+		tiepoint[5] = 0;
+		TIFFSetField(tif, GTIFF_TIEPOINTS, 6,&tiepoint); 
+
+		double resolution[3];
+		resolution[0] = mmparams.resx_;
+		resolution[1] = mmparams.resy_;
+		resolution[2] = 0;
+		TIFFSetField(tif, GTIFF_PIXELSCALE, 3,&resolution);
+	}
+
+	// projection parameters
+	if (!mmparams.projection() || mmparams.projection()->name() == "NoProjection")
+	{
+		// at least try to write a tfw file
+		string tfw = TeGetName(mmparams.fileName_.c_str())+".tfw";
+		FILE* fp = fopen(tfw.c_str(),"w");
+		if (fp)
+		{
+			vector<double> tfw;
+			mmparams.getNavigationParameters(tfw);
+			for (unsigned int nl=0; nl<6; ++nl)
+				fprintf(fp,"%8.4f\n",tfw[nl]);
+				
+		  fclose( fp );
+		}
+		return;
+	}
+	GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsArea);
+	const TeProjectionParams& paramas = mmparams.projection()->params();
+	const string& projname = mmparams.projection()->name();
+	if (projname == "LatLong")
+	{
+		GTIFKeySet(gtif, GTModelTypeGeoKey, TYPE_SHORT, 1, ModelTypeGeographic);
+		GTIFKeySet(gtif, GeogAngularUnitsGeoKey, TYPE_SHORT, 1, Angular_Degree);
+	}
+	else
+	{
+		GTIFKeySet(gtif, GTModelTypeGeoKey, TYPE_SHORT, 1, ModelTypeProjected);
+		GTIFKeySet(gtif, ProjLinearUnitsGeoKey, TYPE_SHORT, 1,Linear_Meter);
+		if (projname == "UTM")
+		{
+			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_TransverseMercator);
+			GTIFKeySet(gtif, ProjNatOriginLatGeoKey, TYPE_DOUBLE,1,paramas.lat0*TeCRD);
+			GTIFKeySet(gtif, ProjNatOriginLongGeoKey, TYPE_DOUBLE,1,paramas.lon0*TeCRD);
+			GTIFKeySet(gtif, ProjScaleAtNatOriginGeoKey, TYPE_DOUBLE,1,paramas.scale);
+			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE,1,paramas.offx);
+			GTIFKeySet(gtif, ProjFalseNorthingGeoKey, TYPE_DOUBLE,1,paramas.offy);
+		}
+		else if (projname == "Mercator")
+		{
+			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_Mercator);
+			GTIFKeySet(gtif, ProjNatOriginLongGeoKey, TYPE_DOUBLE,1,paramas.lon0*TeCRD);
+			GTIFKeySet(gtif, ProjNatOriginLatGeoKey, TYPE_DOUBLE,1,paramas.stlat1*TeCRD);
+			GTIFKeySet(gtif, ProjScaleAtNatOriginGeoKey, TYPE_DOUBLE,1,paramas.scale);
+			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE,1,paramas.offx);
+			GTIFKeySet(gtif, ProjFalseNorthingGeoKey, TYPE_DOUBLE,1,paramas.offy);
+		}
+		else if (projname == "LambertConformal")
+		{
+			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_LambertConfConic_2SP);
+			GTIFKeySet(gtif, ProjFalseOriginLatGeoKey,TYPE_DOUBLE, 1, paramas.lat0*TeCRD);
+			GTIFKeySet(gtif, ProjFalseOriginLongGeoKey, TYPE_DOUBLE, 1, paramas.lon0*TeCRD);
+			GTIFKeySet(gtif, ProjStdParallel1GeoKey, TYPE_DOUBLE, 1, paramas.stlat1*TeCRD);
+			GTIFKeySet(gtif, ProjStdParallel2GeoKey, TYPE_DOUBLE, 1, paramas.stlat2*TeCRD);
+			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE, 1,paramas.offx);
+			GTIFKeySet(gtif, ProjFalseNorthingGeoKey,TYPE_DOUBLE, 1,paramas.offy);
+		}
+		else if (projname == "Polyconic")
+		{
+			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_Polyconic);
+			GTIFKeySet(gtif, ProjNatOriginLatGeoKey,TYPE_DOUBLE, 1, paramas.lat0*TeCRD);
+			GTIFKeySet(gtif, ProjNatOriginLongGeoKey, TYPE_DOUBLE, 1, paramas.lon0*TeCRD);
+			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE, 1,paramas.offx);
+			GTIFKeySet(gtif, ProjFalseNorthingGeoKey,TYPE_DOUBLE, 1,paramas.offy);
+			GTIFKeySet(gtif, ProjScaleAtNatOriginGeoKey, TYPE_DOUBLE,1,paramas.scale);
+		}
+		else if (projname == "CylindricalEquidistant")
+		{
+			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_Equirectangular);
+			GTIFKeySet(gtif, ProjCenterLatGeoKey,TYPE_DOUBLE, 1, paramas.stlat1*TeCRD);
+			GTIFKeySet(gtif, ProjCenterLongGeoKey, TYPE_DOUBLE, 1, paramas.lon0*TeCRD);
+			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE, 1,paramas.offx);
+			GTIFKeySet(gtif, ProjFalseNorthingGeoKey,TYPE_DOUBLE, 1,paramas.offy);
+		}
+		else if (projname == "PolarStereographic")
+		{
+			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_PolarStereographic);
+			GTIFKeySet(gtif, ProjNatOriginLatGeoKey, TYPE_DOUBLE,1,paramas.lat0*TeCRD);
+			GTIFKeySet(gtif, ProjStraightVertPoleLongGeoKey, TYPE_DOUBLE,1,paramas.lon0*TeCRD);
+			GTIFKeySet(gtif, ProjScaleAtNatOriginGeoKey, TYPE_DOUBLE,1,paramas.scale);
+			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE,1,paramas.offx);
+			GTIFKeySet(gtif, ProjFalseNorthingGeoKey, TYPE_DOUBLE,1,paramas.offy);
+		}
+		else if (projname == "Albers")
+		{
+			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_AlbersEqualArea);
+			GTIFKeySet(gtif, ProjStdParallel1GeoKey, TYPE_DOUBLE, 1, paramas.stlat1*TeCRD);
+			GTIFKeySet(gtif, ProjStdParallel2GeoKey, TYPE_DOUBLE, 1, paramas.stlat2*TeCRD);
+			GTIFKeySet(gtif, ProjNatOriginLatGeoKey,TYPE_DOUBLE, 1, paramas.lat0*TeCRD);
+			GTIFKeySet(gtif, ProjNatOriginLongGeoKey, TYPE_DOUBLE, 1, paramas.lon0*TeCRD);
+			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE, 1,paramas.offx);
+			GTIFKeySet(gtif, ProjFalseNorthingGeoKey,TYPE_DOUBLE, 1,paramas.offy);
+		}
+		else if (projname == "Miller")
+		{
+			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, CT_MillerCylindrical);
+			GTIFKeySet(gtif, ProjCenterLatGeoKey, TYPE_DOUBLE, 1, paramas.lat0*TeCRD);
+			GTIFKeySet(gtif, ProjCenterLongGeoKey, TYPE_DOUBLE, 1, paramas.lon0*TeCRD);
+			GTIFKeySet(gtif, ProjFalseEastingGeoKey, TYPE_DOUBLE, 1,paramas.offx);
+			GTIFKeySet(gtif, ProjFalseNorthingGeoKey,TYPE_DOUBLE, 1,paramas.offy);
+		}
+	}
+
+	// datum parameters
+	if (paramas.datum.name() == "CorregoAlegre")
+		GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,Datum_Corrego_Alegre);
+	else if (paramas.datum.name() == "WGS84")
+		GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,Datum_WGS84);
+	else if (paramas.datum.name() == "SAD69")
+		GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,Datum_South_American_Datum_1969);
+	else if (paramas.datum.name() == "Aratu")
+		GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,Datum_Aratu);
+	else
+		GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,32767);
+
+	GTIFKeySet(gtif, GeogCitationGeoKey, TYPE_ASCII,1,paramas.datum.name().c_str());
+	GTIFKeySet(gtif, GeogSemiMajorAxisGeoKey,TYPE_DOUBLE, 1, paramas.datum.radius());
+	GTIFKeySet(gtif, GeogSemiMinorAxisGeoKey,TYPE_DOUBLE, 1, paramas.datum.radius()*(1-paramas.datum.flattening()));
+	GTIFWriteKeys(gtif);
+}
+
+bool
+TeDecoderTIFF::getGeoTIFF()
+{
+	params_.resx_ = params_.resy_ = 1;
+
+	//---------------- navigation parameters 
+
+	bool isGeoreferenced_ = false;
+	// The three tags defined below may be used for defining the relationship between R (raster space)
+	// and M (model space), and the relationship may be diagrammed as: 
+	//           ModelPixelScaleTag 
+	//           ModelTiepointTag         
+	//    R  ------------ OR --------------> M
+	//  (I,J,K)  ModelTransformationTag   (X,Y,Z)
+
+	double *tiepoints = 0;
+	double *pixel_scale = 0;
+	double *transform   = 0;
+
+	int count=0, tiepoint_count=0, transform_count=0;
+  	TIFFGetField(tif, GTIFF_TIEPOINTS, &tiepoint_count,&tiepoints);
+	TIFFGetField(tif, GTIFF_PIXELSCALE, &count, &pixel_scale); 
+ 	TIFFGetField(tif, GTIFF_TRANSMATRIX, &transform_count, &transform); 
+
+	GTIFDefn defn;
+	int hasGTifDefn;
+	hasGTifDefn = GTIFGetDefn(gtif, &defn);
+	bool isCentreOfPixel = false;
+	if (hasGTifDefn)
+	{
+		short mtype;
+		GTIFKeyGet(gtif,GTRasterTypeGeoKey,&mtype,0,1);
+		if (mtype == RasterPixelIsPoint)
+			isCentreOfPixel = true;
+	}
+
+	// if we couldn't get the georrefencing information from the tags
+	// try to get if from an external (.tfw) world file
+	if (!isGeoreferenced_) 
+	{
+		size_t dotpos = params_.fileName_.rfind('.');
+		if (dotpos != std::string::npos)
+		{
+			vector<double> wf;
+			wf.resize(6);
+			string tfwfile = params_.fileName_.substr(0,dotpos+1) + "tfw";
+			FILE* fp = fopen(tfwfile.c_str(),"r");
+			if (!fp)
+			{
+				tfwfile = params_.fileName_.substr(0,dotpos+1) + "TFW";
+				fp = fopen(tfwfile.c_str(),"r");
+			}
+
+			if (fp)
+			{
+				isGeoreferenced_ = true;
+				char val[40];
+				for (int ii=0; ii<6; ++ii)
+				{
+					if (fscanf(fp,"%s",val))
+						wf[ii] = TeRoundD(atof(val)); 
+					else
+					{
+						isGeoreferenced_ = false;
+						break;
+					}
+				}
+				fclose(fp);
+			}
+			if (isGeoreferenced_)
+				params_.setNavigationParameters(wf);
+		}
+	}
+
+	if (!isGeoreferenced_) 
+	{
+		if (count >= 3 && tiepoint_count >= 6) // if we have 1 tie point and pixel scale
+		{
+			params_.topLeftResolutionSize(tiepoints[3]-tiepoints[0]*pixel_scale[0],
+											tiepoints[4]-tiepoints[1]*pixel_scale[1],
+											pixel_scale[0],pixel_scale[1],
+											params_.ncols_,params_.nlines_,isCentreOfPixel);
+			isGeoreferenced_ = true;
+		}
+		else if (transform_count == 16) // if we have a transformation matrix
+		{
+			vector<double> wf;
+			wf.push_back(transform[0]);
+			wf.push_back(transform[1]);
+			wf.push_back(transform[4]);
+			wf.push_back(transform[5]);
+			wf.push_back(transform[3]);
+			wf.push_back(transform[7]);
+			params_.setNavigationParameters(wf);
+			isGeoreferenced_ = true;
+
+		}
+		// else if (tiepoint_count > 6)
+		// {
+		//		we should use the set of tiepoints to interpolate... not implemented yet...
+		// }
+	}
+
+	//---------------- projection parameters 
+	if (!hasGTifDefn)
+	{
+		if (!params_.projection())
+		{
+			TeProjection* noproj = new TeNoProjection();
+			params_.projection(noproj);
+			delete noproj;
+		}
+		return false;
+	}
+	else
+	{
+		// 1) Get Datum parameters
+		TeDatum mDatum;
+		if (defn.Datum == Datum_South_American_Datum_1969)
+			mDatum = TeDatumFactory::make("SAD69");
+		else if (defn.Datum == Datum_WGS84)
+			mDatum = TeDatumFactory::make("WGS84");
+		else if (defn.Datum == Datum_Corrego_Alegre)
+			mDatum = TeDatumFactory::make("CorregoAlegre");
+		else if (defn.Datum == Datum_Aratu)
+			mDatum = TeDatumFactory::make("Aratu");
+		else
+		{
+			if(params_.projection())
+				mDatum = params_.projection()->datum();
+			else
+            {
+				double TISemiMajor = defn.SemiMajor, TISemiMinor = defn.SemiMinor;
+				// unknown datum... try to find a similar one based on SemiAxis values
+				if (defn.SemiMajor == 0. && defn.SemiMinor == 0.)
+				{
+					TISemiMajor =6.371000e+06;		// default parameter of a spherical ellipsoid
+					TISemiMinor =6.371000e+06;            
+				}
+				if (!findDatum(TISemiMajor,(TISemiMajor - TISemiMinor)/TISemiMajor,mDatum))
+					mDatum = TeDatum("UserDefined",TISemiMajor,(TISemiMajor - TISemiMinor)/TISemiMajor,0.,0.,0.);
+			}
+		}
+
+		// 2) Get projection parameters
+		// if geographical model
+		short mtype = 0;
+
+		GTIFKeyGet(gtif, GTModelTypeGeoKey,&mtype, 0, 1 );
+
+		if (mtype == ModelTypeGeographic)	 
+		{
+			TeProjection* latlong = new TeLatLong(mDatum);
+			params_.projection(latlong);
+			delete latlong;
+			return true;
+		}		
+		
+		if (defn.PCS != KvUserDefined)
+			GTIFGetProjTRFInfo(defn.ProjCode, 0, &(defn.Projection), defn.ProjParm);
+
+		if (mtype != ModelTypeProjected)
+		{
+			if (!params_.projection())
+			{
+				TeProjection* noproj = new TeNoProjection();
+				params_.projection(noproj);
+				delete noproj;
+				return false;
+			}
+			return true;
+		}
+		TeProjectionParams mProjPars;	
+		mProjPars.units = "Meters"; // == not necessarily true... we should check for the units as defined in geotiff	
+		mProjPars.datum = mDatum;
+
+		// just set all parameters available from defn... some of them will not be used by some projections
+		mProjPars.lat0 = defn.ProjParm[0]*defn.UOMAngleInDegrees*TeCDR;
+		mProjPars.lon0 = defn.ProjParm[1]*defn.UOMAngleInDegrees*TeCDR;
+		mProjPars.stlat1 = defn.ProjParm[2]*defn.UOMAngleInDegrees*TeCDR;
+		mProjPars.stlat2 = defn.ProjParm[3]*defn.UOMAngleInDegrees*TeCDR;
+		mProjPars.scale = defn.ProjParm[4];
+		mProjPars.offx = defn.ProjParm[5];
+		mProjPars.offy = defn.ProjParm[6];
+		if (mProjPars.offy > 0)
+			mProjPars.hemisphere = TeSOUTH_HEM;
+		else
+			mProjPars.hemisphere = TeNORTH_HEM;
+
+		// now make the correspondence between geotiff projections and terralib projections
+		switch (defn.CTProjection)
+		{
+			case CT_TransverseMercator : 
+				mProjPars.name = "UTM";
+			break;
+			case CT_Mercator :
+				mProjPars.name = "Mercator";
+			break;
+			case CT_LambertConfConic_2SP :
+				mProjPars.name = "LambertConformal";
+			break;
+			case CT_Polyconic : 
+				mProjPars.name = "Polyconic";
+			break;
+			case CT_Equirectangular :
+				mProjPars.name = "CylindricalEquidistant";
+			break;
+			case CT_PolarStereographic :
+				mProjPars.name = "PolarStereographic";
+			break;
+			case CT_AlbersEqualArea :
+				mProjPars.name = "Albers";
+			break;
+			case CT_MillerCylindrical:
+				mProjPars.name = "Miller";
+			break;
+			case CT_Sinusoidal:
+				mProjPars.name = "Sinusoidal";
+			break;
+			default:
+				TeBox bb = params_.boundingBox();
+				if (bb.x1_ >= -180 && bb.x1_ <= 180 && bb.y1_ >= -90 && bb.y2_ <= 90)
+					mProjPars.name = "LatLong";
+				else
+				{
+					TeProjection* noproj = TeProjectionFactory::make(mProjPars);
+					params_.projection(noproj);
+					delete noproj;
+					return false;
+				}
+			break;
+		}
+		TeProjection* proj = TeProjectionFactory::make(mProjPars);
+		params_.projection(proj);
+		delete proj;
+		return true;
+	}
+}
+
+bool 
+TeDecoderTIFF::readStrip(unsigned long strip)
+{
+	assert(tif);
+	if (planar_ == PLANARCONFIG_CONTIG)	// for planar config all planes are in the strip
+		return (TIFFReadEncodedStrip(tif, strip, dataBuffer_[0], -1) > 0);
+	
+	for (unsigned int i=0; i<nBands_; ++i)	// for separated config we have to read each plane individually
+	{
+		if (TIFFReadEncodedStrip(tif, (strip+i*nstripsperplane_), dataBuffer_[i],-1) == -1)
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeDecoderTIFF::readTileImageContig(unsigned long tiler) 
+{
+	tiler *= tilesacross_;
+	unsigned long i;
+	for (i=0; i<tilesacross_; ++i)
+	{
+		if (TIFFReadEncodedTile(tif,tiler+i,dataBuffer_[i],-1) == -1)
+			return false;
+	}
+	return true;
+}
+
+// --- To read and set a LUT table ---
+
+static int checkmap(int n, unsigned short *r, unsigned short *g, unsigned short *b,long val)
+{
+    while (n-- >= 0)
+		if (*r++ > val || *g++ > val || *b++ > val)
+			return (16);
+    return (8);
+}
+
+static unsigned short CVT1 (unsigned long x,long value)	//CVT is used in DEC station
+{
+	unsigned long den = (1L << 16) -1L;
+	unsigned short num = (unsigned short)((x*value)/den); // normalize lut value
+	return num;
+}
+
+bool
+TeDecoderTIFF::readLut()
+{
+	unsigned short *rmap,*gmap,*bmap;
+	if (!TIFFGetField(tif, TIFFTAG_COLORMAP, &rmap, &gmap, &bmap))
+		return false;
+	params_.lutr_.clear();
+	params_.lutb_.clear();
+	params_.lutg_.clear();
+
+	unsigned int n = params_.lutr_.size();
+	
+	int nindexes = (1 << params_.nbitsperPixel_[0]);
+	long maxval = (long)pow(2.,params_.nbitsperPixel_[0])-1;
+
+	int x;
+	if (checkmap (nindexes,rmap,gmap,bmap,maxval) == 16)
+	{
+		for(x=0; x<nindexes; ++x)
+		{
+			params_.lutr_.push_back(CVT1(rmap[x],maxval)); 
+			params_.lutg_.push_back(CVT1(gmap[x],maxval));
+			params_.lutb_.push_back(CVT1(bmap[x],maxval));
+		}
+	}
+	else
+	{
+		for(x=0; x<nindexes; ++x)
+		{
+			params_.lutr_.push_back(rmap[x]);
+			params_.lutg_.push_back(gmap[x]);
+			params_.lutb_.push_back(bmap[x]);
+		}
+	}
+	n = params_.lutr_.size();
+	return true;
+}
+
+void
+TeDecoderTIFF::saveLut()
+{
+	if (!tif)
+		return;
+    
+  TeRasterParams& mmparams = memManager_.params();  
+
+	int nentries = mmparams.lutr_.size();
+	if (nentries <= 0) 
+		return;
+
+	unsigned short* lutr = new unsigned short[nentries];
+	unsigned short* lutg = new unsigned short[nentries];
+	unsigned short* lutb = new unsigned short[nentries];
+
+	for (int i=0; i<nentries; i++)
+	{
+		lutr[i] = mmparams.lutr_[i]*255;
+		lutg[i] = mmparams.lutg_[i]*255;
+		lutb[i] = mmparams.lutb_[i]*255;
+	}
+	TIFFSetField(tif, TIFFTAG_COLORMAP,lutr,lutg,lutb);
+	delete [] lutr;
+	delete [] lutg;
+	delete [] lutb;
+}
+
+
+inline void TeDecoderTIFF::getElement_TeUNSIGNEDCHAR(const long& plane, const long& pos, double& val)
+{
+	assert(data_TeUNSIGNEDCHAR_ != 0 );
+	val = (double)data_TeUNSIGNEDCHAR_[plane][pos];
+}
+
+
+inline void TeDecoderTIFF::getElement_TeCHAR(const long& plane, const long& pos, double& val)
+{
+	assert(data_TeCHAR_ != 0 );
+	val = (double)data_TeCHAR_[plane][pos];
+}
+
+
+inline void TeDecoderTIFF::getElement_TeUNSIGNEDSHORT(const long& plane, const long& pos, double& val)
+{
+	assert(data_TeUNSIGNEDSHORT_ != 0 );
+	val = (double)data_TeUNSIGNEDSHORT_[plane][pos];
+}
+
+
+inline void TeDecoderTIFF::getElement_TeSHORT(const long& plane, const long& pos, double& val)
+{
+	assert(data_TeSHORT_ != 0 );
+	val = (double)data_TeSHORT_[plane][pos];
+}
+
+
+inline void TeDecoderTIFF::getElement_TeINTEGER(const long& plane, const long& pos, double& val)
+{
+	assert(data_TeINTEGER_ != 0 );
+	val = (double)data_TeINTEGER_[plane][pos];
+}
+
+
+inline void TeDecoderTIFF::getElement_TeUNSIGNEDLONG(const long& plane, const long& pos, double& val)
+{
+	assert(data_TeUNSIGNEDLONG_ != 0 );
+	val = (double)data_TeUNSIGNEDLONG_[plane][pos];
+}
+
+
+inline void TeDecoderTIFF::getElement_TeLONG(const long& plane, const long& pos,double& val)
+{
+	assert(data_TeLONG_ != 0 );
+	val = (double)data_TeLONG_[plane][pos];
+}
+
+
+inline void TeDecoderTIFF::getElement_TeFLOAT(const long& plane, const long& pos, double& val)
+{
+	assert(data_TeFLOAT_ != 0 );
+	val = (double)data_TeFLOAT_[plane][pos];
+}
+
+
+inline void TeDecoderTIFF::getElement_TeDOUBLE(const long& plane, const long& pos, double& val)
+{
+	assert(data_TeDOUBLE_ != 0 );
+	val = (double)data_TeDOUBLE_[plane][pos];
+}
+
+
+TeDecoderTIFFFactory::TeDecoderTIFFFactory(const string& name): 
+	TeDecoderFactory(name) 
+{
+	// Defines the decoder identifiers synonyms
+	TeDecoderFactory::instanceName2Dec()["TIF"] = "TIF";	
+	TeDecoderFactory::instanceName2Dec()["TIFF"] = "TIF";
+}
+
diff --git a/src/terralib/kernel/TeDecoderTIFF.h b/src/terralib/kernel/TeDecoderTIFF.h
old mode 100755
new mode 100644
index 5dc9d6b..2a51b2e
--- a/src/terralib/kernel/TeDecoderTIFF.h
+++ b/src/terralib/kernel/TeDecoderTIFF.h
@@ -1,185 +1,185 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderTIFF.h
-    \brief This file contais functions to deal with raster images in Tiff/GeoTIFF format.
-*/
-
-#ifndef  __TERRALIB_INTERNAL_DECODERTIFF_H
-#define  __TERRALIB_INTERNAL_DECODERTIFF_H
-
-#include "TeDecoder.h"
-#include "TeDecoderSmartMem.h"
-
-// LibTIFF includes
-#include "geotiff.h"
-#include "xtiffio.h"
-
-
-//! Implements a decoder to a raster in TIFF (Tagged Image File Format) format with or without geographical tags (geotiff)
-/*!
-	Decoder TIFF is based on geotiff libray (http://remotesensing.org/geotiff/geotiff.html).
-	This imposes some restrictions to this decoder. Using libtiff TIFF image files may not 
-	be opened for both reading and writing access, or, there is no support for altering the contents of 
-	a TIFF file. So this decoder is limited to create new tiff files or to read existing ones. \par
-	The default file extensions associated to this decoder are ".tif" or ".tiff". \par
-	\note This decoder doesn't support tiff files that are organizes in tiles and in separated planes.
-*/
-class TL_DLL TeDecoderTIFF: public TeDecoder
-{
-	TIFF 	*tif;       		// TIFF directory structure
-	GTIF	*gtif;			// GEOTIFF directory structure
-
-	unsigned char** dataBuffer_;	// buffer to hold decoded data
-					// for tile data it holds 1 tile
-					// for stripped data it holds 1 strip with all the planes
-
-	unsigned int	nplanes_;	// number of planes or logical division of the data within the files
-
-	bool		isGeoTiff_;	// indicates if the data has geographical information
-	short 		TImage_;	// 0=MONOIMAGE, 1=RGBIMAGE, 2=PALLETE 
-	unsigned short	planar_;	// storage organization : PLANARCONFIG_CONTIG or PLANARCONFIG_SEPARATE
-	
-	bool		isTiled_;	// indicates if the data is organizes in tiles 
-	unsigned long	tilew_,tileh_;	// tile and height
-	unsigned long	tilesacross_;	// number of tiles to compose a row of image
-	unsigned long	bytespertile_;	// number of bytes per tile
-	long		TCurTile_;	// current tile decoded in internal memory
-
-	unsigned long	rowsperstrip_;	// number of rows per strip
-	unsigned long	nstripsperplane_;	// number of strips per plane of data
-	unsigned long	stripsize_;	// number of bytes per strip
-	long		TCurStrip_;	// current line in memory
-	
-	unsigned int	nBands_;		// number of samples per data
-
-	// This is an internal smart manager to support the creation of tiffs 
-	TeDecoderSmartMem memManager_;
-    
-	//	Reads TIFF Directory and fills tif structure
-	void readTiffDirectory();
-
-	// Reads the georeferencing keys of a geotiff data
-	bool getGeoTIFF();
-
-	// Sets the georeferencing keys of a geotiff data
-	void setGeoKeys();
-
-	// Reads LUT information
-	bool readLut();
-
-	// Saves LUT information
-	void saveLut();
-
-	// Reads enough tiles to compose a row of data
-	bool readTileImageContig(unsigned long tiler);
-
-	// Reads a strip
-	bool readStrip(unsigned long strip);
-
-	// Allocates te internal memory
-	bool allocateWorkMemory();
-
-	//! Type definition for the getElement function pointer      
-	typedef void (TeDecoderTIFF::*GetEleFunctPtrT)( const long& plane, const long& pos, double& val );
-
-	//! A pointer to the current getElement method following the current data type
-	GetEleFunctPtrT getelement_ptr_;
-
-	//! A casted pointer to the current data
-	unsigned char** data_TeUNSIGNEDCHAR_;  
-
-	//! A casted pointer to the current data
-	char** data_TeCHAR_;  
-
-	//! A casted pointer to the current data
-	unsigned short** data_TeUNSIGNEDSHORT_;  
-
-	//! A casted pointer to the current data
-	short** data_TeSHORT_;  
-
-	//! A casted pointer to the current data
-	int** data_TeINTEGER_;  
-
-	//! A casted pointer to the current data
-	unsigned long** data_TeUNSIGNEDLONG_;  
-
-	//! A casted pointer to the current data
-	long** data_TeLONG_;  
-
-	//! A casted pointer to the current data
-	float** data_TeFLOAT_;
-
-	//! A casted pointer to the current data
-	double** data_TeDOUBLE_;  
-
-	inline void getElement_TeUNSIGNEDCHAR(const long& plane, const long& pos, double& val );  
-
-	inline void getElement_TeCHAR(const long& plane, const long& pos, double& val );  
-
-	inline void getElement_TeUNSIGNEDSHORT(const long& plane, const long& pos, double& val );
-
-	inline void getElement_TeSHORT(const long& plane, const long& pos, double& val );
-
-	inline void getElement_TeINTEGER(const long& plane, const long& pos, double& val );
-
-	inline void getElement_TeUNSIGNEDLONG( const long& plane, const long& pos, double& val );
-
-	inline void getElement_TeLONG(const long& plane, const long& pos, double& val );
-
-	inline void getElement_TeFLOAT(const long& plane, const long& pos, double& val );
-
-	inline void getElement_TeDOUBLE(const long& plane, const long& pos, double& val );  
-
-public:
-
-	//! Construtor from parameters 
-	TeDecoderTIFF( const TeRasterParams& );
-
-	//!	Normal destructor
-	~TeDecoderTIFF();
-
-	//! Initializes the internal structures
-	void init();
-
-	//! Clear internal structures
-	bool clear();
-
-	//! Reads an element
-	bool setElement (int col,int lin, double val, int band=0);
-
-	//! Writes an element
-	bool getElement (int col,int lin, double &val,int band=0);
-};
-
-//! Implements a tiff decoder factory
-class TL_DLL TeDecoderTIFFFactory : public TeDecoderFactory
-{
-public:
-
-	TeDecoderTIFFFactory(const string& name);
-
-	TeDecoder* build (const TeRasterParams& arg)
-	{  return new TeDecoderTIFF(arg); }
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderTIFF.h
+    \brief This file contais functions to deal with raster images in Tiff/GeoTIFF format.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_DECODERTIFF_H
+#define  __TERRALIB_INTERNAL_DECODERTIFF_H
+
+#include "TeDecoder.h"
+#include "TeDecoderSmartMem.h"
+
+// LibTIFF includes
+#include "geotiff.h"
+#include "xtiffio.h"
+
+
+//! Implements a decoder to a raster in TIFF (Tagged Image File Format) format with or without geographical tags (geotiff)
+/*!
+	Decoder TIFF is based on geotiff libray (http://remotesensing.org/geotiff/geotiff.html).
+	This imposes some restrictions to this decoder. Using libtiff TIFF image files may not 
+	be opened for both reading and writing access, or, there is no support for altering the contents of 
+	a TIFF file. So this decoder is limited to create new tiff files or to read existing ones. \par
+	The default file extensions associated to this decoder are ".tif" or ".tiff". \par
+	\note This decoder doesn't support tiff files that are organizes in tiles and in separated planes.
+*/
+class TL_DLL TeDecoderTIFF: public TeDecoder
+{
+	TIFF 	*tif;       		// TIFF directory structure
+	GTIF	*gtif;			// GEOTIFF directory structure
+
+	unsigned char** dataBuffer_;	// buffer to hold decoded data
+					// for tile data it holds 1 tile
+					// for stripped data it holds 1 strip with all the planes
+
+	unsigned int	nplanes_;	// number of planes or logical division of the data within the files
+
+	bool		isGeoTiff_;	// indicates if the data has geographical information
+	short 		TImage_;	// 0=MONOIMAGE, 1=RGBIMAGE, 2=PALLETE 
+	unsigned short	planar_;	// storage organization : PLANARCONFIG_CONTIG or PLANARCONFIG_SEPARATE
+	
+	bool		isTiled_;	// indicates if the data is organizes in tiles 
+	unsigned long	tilew_,tileh_;	// tile and height
+	unsigned long	tilesacross_;	// number of tiles to compose a row of image
+	unsigned long	bytespertile_;	// number of bytes per tile
+	long		TCurTile_;	// current tile decoded in internal memory
+
+	unsigned long	rowsperstrip_;	// number of rows per strip
+	unsigned long	nstripsperplane_;	// number of strips per plane of data
+	unsigned long	stripsize_;	// number of bytes per strip
+	long		TCurStrip_;	// current line in memory
+	
+	unsigned int	nBands_;		// number of samples per data
+
+	// This is an internal smart manager to support the creation of tiffs 
+	TeDecoderSmartMem memManager_;
+    
+	//	Reads TIFF Directory and fills tif structure
+	void readTiffDirectory();
+
+	// Reads the georeferencing keys of a geotiff data
+	bool getGeoTIFF();
+
+	// Sets the georeferencing keys of a geotiff data
+	void setGeoKeys();
+
+	// Reads LUT information
+	bool readLut();
+
+	// Saves LUT information
+	void saveLut();
+
+	// Reads enough tiles to compose a row of data
+	bool readTileImageContig(unsigned long tiler);
+
+	// Reads a strip
+	bool readStrip(unsigned long strip);
+
+	// Allocates te internal memory
+	bool allocateWorkMemory();
+
+	//! Type definition for the getElement function pointer      
+	typedef void (TeDecoderTIFF::*GetEleFunctPtrT)( const long& plane, const long& pos, double& val );
+
+	//! A pointer to the current getElement method following the current data type
+	GetEleFunctPtrT getelement_ptr_;
+
+	//! A casted pointer to the current data
+	unsigned char** data_TeUNSIGNEDCHAR_;  
+
+	//! A casted pointer to the current data
+	char** data_TeCHAR_;  
+
+	//! A casted pointer to the current data
+	unsigned short** data_TeUNSIGNEDSHORT_;  
+
+	//! A casted pointer to the current data
+	short** data_TeSHORT_;  
+
+	//! A casted pointer to the current data
+	int** data_TeINTEGER_;  
+
+	//! A casted pointer to the current data
+	unsigned long** data_TeUNSIGNEDLONG_;  
+
+	//! A casted pointer to the current data
+	long** data_TeLONG_;  
+
+	//! A casted pointer to the current data
+	float** data_TeFLOAT_;
+
+	//! A casted pointer to the current data
+	double** data_TeDOUBLE_;  
+
+	inline void getElement_TeUNSIGNEDCHAR(const long& plane, const long& pos, double& val );  
+
+	inline void getElement_TeCHAR(const long& plane, const long& pos, double& val );  
+
+	inline void getElement_TeUNSIGNEDSHORT(const long& plane, const long& pos, double& val );
+
+	inline void getElement_TeSHORT(const long& plane, const long& pos, double& val );
+
+	inline void getElement_TeINTEGER(const long& plane, const long& pos, double& val );
+
+	inline void getElement_TeUNSIGNEDLONG( const long& plane, const long& pos, double& val );
+
+	inline void getElement_TeLONG(const long& plane, const long& pos, double& val );
+
+	inline void getElement_TeFLOAT(const long& plane, const long& pos, double& val );
+
+	inline void getElement_TeDOUBLE(const long& plane, const long& pos, double& val );  
+
+public:
+
+	//! Construtor from parameters 
+	TeDecoderTIFF( const TeRasterParams& );
+
+	//!	Normal destructor
+	~TeDecoderTIFF();
+
+	//! Initializes the internal structures
+	void init();
+
+	//! Clear internal structures
+	bool clear();
+
+	//! Reads an element
+	bool setElement (int col,int lin, double val, int band=0);
+
+	//! Writes an element
+	bool getElement (int col,int lin, double &val,int band=0);
+};
+
+//! Implements a tiff decoder factory
+class TL_DLL TeDecoderTIFFFactory : public TeDecoderFactory
+{
+public:
+
+	TeDecoderTIFFFactory(const string& name);
+
+	TeDecoder* build (const TeRasterParams& arg)
+	{  return new TeDecoderTIFF(arg); }
+};
+
+#endif
diff --git a/src/terralib/kernel/TeDecoderVirtualMemory.cpp b/src/terralib/kernel/TeDecoderVirtualMemory.cpp
old mode 100755
new mode 100644
index a067b7b..e971c7a
--- a/src/terralib/kernel/TeDecoderVirtualMemory.cpp
+++ b/src/terralib/kernel/TeDecoderVirtualMemory.cpp
@@ -1,473 +1,536 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeDecoderVirtualMemory.h"
-#include <cstring>
-
-TeMemoryPage::TeMemoryPage(const TeMemoryPage& rhs)
-{
-	data_ = rhs.data_;
-	used_ = rhs.used_;
-	defValue_ = rhs.defValue_;
-	dataType_ = rhs.dataType_;
-}
-
-//! Operator =
-TeMemoryPage& 
-TeMemoryPage::operator=(const TeMemoryPage& rhs)
-{
-	if (this != &rhs)
-	{
-		data_ = rhs.data_;
-		used_ = rhs.used_;
-		size_ = rhs.size_;
-		defValue_ = rhs.defValue_;
-		dataType_ = rhs.dataType_;
-	}
-	return *this;
-}
-
-//! Destructor
-TeMemoryPage::~TeMemoryPage()
-{
-	if (this->data_ != 0)
-	{
-		switch (dataType_)
-		{
-		case (TeUNSIGNEDCHAR):
-			delete [](unsigned char*)data_;
-			break;
-		case (TeCHAR) :
-			delete (char*)data_;
-			break;
-		case (TeUNSIGNEDSHORT):
-			delete [](unsigned short*)data_;
-			break;
-		case (TeSHORT):
-			delete (short*) data_;
-			break;
-		case (TeUNSIGNEDLONG):
-			delete [](unsigned long*)data_;
-			break;
-		case (TeLONG):
-			delete [](long*) data_;
-			break;
-		case (TeFLOAT):
-			delete [](float*)data_;
-			break;
-		case (TeDOUBLE):
-			delete [](double*) data_;
-			break;
-		default:
-			break;
-		}
-		data_ = 0;
-	}
-}
-
-TeMemoryPage::TeMemoryPage(unsigned long size, double defValue, TeDataType dataType):
-		used_(false),
-		size_(size),
-		defValue_(defValue),
-		dataType_(dataType)
-{
-	data_ = 0;
-	try 
-	{
-		unsigned int i;
-		// Try to allocate the necessary memory
-		switch (dataType_) {
-		case (TeUNSIGNEDCHAR):
-			data_ = new unsigned char [size_];
-			memset(data_, (int)defValue, size);
-			break;
-		case (TeCHAR) :
-			data_ = new char [size_];
-			memset(data_, (int)defValue, size);
-			break;
-		case (TeUNSIGNEDSHORT):
-			data_ = new unsigned short [size_];
-			for (i=0;i<size;((unsigned short*)data_)[i]= (unsigned short) defValue_,i++);
-			break;
-		case (TeSHORT):
-			data_ = new short [size_];
-			for (i=0;i<size;((short*)data_)[i]=(short)defValue_,i++);
-			break;
-		case (TeUNSIGNEDLONG):
-			data_ = new unsigned long [size_];
-			for (i=0;i<size;((unsigned long*)data_)[i]=(unsigned long)defValue_,i++);
-			break;
-		case (TeLONG):
-			data_ = new long [size_];
-			for (i=0;i<size;((long*)data_)[i]=(long)defValue_,i++);
-			break;
-		case (TeFLOAT):
-			data_ = new float [size_];
-			for (i=0;i<size;((float*)data_)[i]=(float)defValue_,i++);
-			break;
-		case (TeDOUBLE):
-			data_ = new double [size_];
-			for (i=0;i<size;((double*)data_)[i]=(double)defValue_,i++);
-			break;
-		default:
-			break;
-		}
-	}
-	catch (...)
-	{
-	}
-}
-
-void
-TeMemoryPage::clear()
-{	
-	unsigned int i;
-	switch (dataType_) 
-	{
-	case (TeUNSIGNEDCHAR):
-	case (TeCHAR) :
-		memset((void*)data_, (int)defValue_, size_);
-		break;
-	case (TeUNSIGNEDSHORT):
-		for (i=0;i<size_;((unsigned short*)data_)[i]= (unsigned short) defValue_,i++);
-		break;
-	case (TeSHORT):
-		for (i=0;i<size_;((short*)data_)[i]=(short)defValue_,i++);
-		break;
-	case (TeUNSIGNEDLONG):
-		for (i=0;i<size_;((unsigned long*)data_)[i]=(unsigned long)defValue_,i++);
-		break;
-	case (TeLONG):
-		for (i=0;i<size_;((long*)data_)[i]=(long)defValue_,i++);
-		break;
-	case (TeFLOAT):
-		for (i=0;i<size_;((float*)data_)[i]=(float)defValue_,i++);
-		break;
-	case (TeDOUBLE):
-		for (i=0;i<size_;((double*)data_)[i]=(double)defValue_,i++);
-		break;
-	default:
-		break;
-	}
-}
-
-long
-TeMemoryPage::pageSize()
-{
-	long s;
-	switch (dataType_) 
-	{
-	case (TeCHAR) :
-		s = size_*sizeof(char);
-		break;
-	case (TeUNSIGNEDSHORT):
-		s = size_*sizeof(unsigned short);
-		break;
-	case (TeSHORT):
-		s = size_*sizeof(short);
-		break;
-	case (TeUNSIGNEDLONG):
-		s = size_*sizeof(unsigned long);
-		break;
-	case (TeLONG):
-		s = size_*sizeof(long);
-		break;
-	case (TeFLOAT):
-		s = size_*sizeof(float);
-		break;
-	case (TeDOUBLE):
-		s = size_*sizeof(double);
-		break;
-	default:
-		s = size_*sizeof(unsigned char);
-	}
-	return s;
-}
-
-double 
-TeMemoryPage::getVal(int col,int lin, int nCols)
-{
-	unsigned long offset = (lin-ulLin_)*nCols+(col-ulCol_);
-	double val = defValue_;
-
-	if (offset < size_) // solucao temporaria, rever
-	{
-		switch (dataType_) 
-		{
-		case (TeUNSIGNEDCHAR):
-			val = ((unsigned char*)data_)[offset];
-			break;
-		case (TeCHAR) :
-			val = ((char*) data_)[offset];
-			break;
-		case (TeUNSIGNEDSHORT):
-			val = ((unsigned short*)data_)[offset];
-			break;
-		case (TeSHORT):
-			val = ((short*)data_)[offset];
-			break;
-		case (TeUNSIGNEDLONG):
-			val = ((unsigned long*)data_)[offset];
-			break;
-		case (TeLONG):
-			val = ((long*)data_)[offset];
-			break;
-		case (TeFLOAT):
-			val = ((float*)data_)[offset];
-			break;
-		case (TeDOUBLE):
-			val = ((double*)data_)[offset];
-			break;
-		default:
-			break;
-		}
-	}
-
-	return val;
-}
-
-void 
-TeMemoryPage::setVal(int col,int lin,int nCols, double val)
-{
-	unsigned long offset = (lin-ulLin_)*nCols+(col-ulCol_);
-	if (offset < size_) 
-	{
-		switch (dataType_) 
-		{
-		case (TeUNSIGNEDCHAR):
-			((unsigned char*)data_)[offset] = (unsigned char) val;
-			break;
-		
-		case (TeCHAR) :
-			((char*) data_)[offset] = (char) val;
-			break;
-		
-		case (TeUNSIGNEDSHORT):
-			((unsigned short*)data_)[offset] = (unsigned short) val;
-			break;
-		
-		case (TeSHORT):
-			((short*)data_)[offset] = (short) val;
-			break;
-		
-		case (TeUNSIGNEDLONG):
-			((unsigned long*)data_)[offset] = (unsigned long) val;
-			break;
-		
-		case (TeLONG):
-			((long*)data_)[offset] = (long) val;
-			break;
-		
-		case (TeFLOAT):
-			((float*)data_)[offset] = (float) val;
-			break;
-		
-		case (TeDOUBLE):
-			((double*)data_)[offset] = val;
-
-		default:
-			break;
-		}
-	}
-	return;
-}
-
-TeDecoderVirtualMemory::TeDecoderVirtualMemory(const TeRasterParams par)
-{
-	params_ = par;
-}
-
-TeDecoderVirtualMemory::~TeDecoderVirtualMemory()
-{
-	if (!pagesQueue_.empty())
-		TeDecoderVirtualMemory::clear();
-}
-
-TeMemoryPage* TeDecoderVirtualMemory::loadBlock(int col,int lin, int band)
-{
-	// If element is outside raster boundaries return
-	if(col < 0 || lin < 0 || col > params_.ncols_ || lin > params_.nlines_)
-		return NULL;
-
-	TeBlockIndex index = blockIndex(col,lin,band);
-	TeMemoryPage* block = NULL;
-
-	// check band cache first
-	if (pageCache_[band] != NULL && indexCache_[band] == index)
-		block = pageCache_[band];
-	else
-	{
-		// check if page is already in memory
-		MapMemoryPageIterator p = virtualMemory_.find(index);
-		if (p != virtualMemory_.end()) // use it
-			block = p->second;
-		else
-		{
-			// page is not in memory
-			// check whether there is space in memory to bring another page
-			if (virtualMemory_.size() >= (unsigned int)params_.nTilesInMemory_)
-			{
-				// FIFO strategy: replace the oldest page in memory
-				TeBlockIndex first = pagesQueue_.front();
-				pagesQueue_.pop();
-				p = virtualMemory_.find(first); 
-				if (p != virtualMemory_.end())
-				{
-					block = p->second;
-					if (block->used_)
-						putRasterBlock(first,block->data_,block->pageSize());
-
-					block->used_ = false;
-					block->clear();				// reuse the allocated memory
-					virtualMemory_.erase(first);
-				}
-			}
-			else // bring the page to memory
-				block = new TeMemoryPage(params_.blockHeight_*params_.blockWidth_, params_.dummy_[band],params_.dataType_[band]);
-
-			virtualMemory_.insert(MapMemoryPage::value_type(index,block));
-			pagesQueue_.push(index);
-			getRasterBlock(index,block->data_);
-			int band_out;
-			blockIndexPos(index, block->ulCol_, block->ulLin_, band_out);
-		}
-		indexCache_[band] = index;
-		pageCache_[band] = block;
-	}
-  return block;
-}
-
-bool
-TeDecoderVirtualMemory::getElement(int col,int lin, double &val,int band)
-{
-	TeMemoryPage* block = loadBlock(col, lin, band);
-	if(block == NULL)
-	{
-		val = params_.dummy_[band];
-		return false;
-	}
-	val = block->getVal(col,lin,params_.blockWidth_);
-	return true;
-}
-
-bool
-TeDecoderVirtualMemory::setElement(int col, int lin, double val,int band)
-{
-	TeMemoryPage* block = loadBlock(col, lin, band);
-	if(block == NULL)
-		return false;
-
-	block->setVal(col,lin,params_.blockWidth_,val);
-	block->used_ = true;
-	return true;
-}
-
-TeBlockIndex TeDecoderVirtualMemory::blockIndex(int col, int lin, int band)
-{
-	TeBlockIndex bl_idx;
-
-	bl_idx.band_ = band;
-	bl_idx.col_ = (int)(col/params_.blockWidth_);
-	bl_idx.lin_ = (int)(lin/params_.blockHeight_);
-	return bl_idx;
-}
-
-void TeDecoderVirtualMemory::blockIndexPos( const TeBlockIndex& index, int& ulCol, int& ulLin, int& band)
-{
-	ulCol = index.column()*params_.blockWidth_;
-	ulLin = index.line()*params_.blockHeight_;
-	band = index.band();
-}
-
-void
-TeDecoderVirtualMemory::init()
-{
-	TeDecoderVirtualMemory::clear();
-	if (params_.nBands() == 0 || params_.ncols_ <= 0 || params_.nlines_ == 0)
-	{
-		params_.errorMessage_ = "Raster doesnt have valid dimensions.";
-		params_.status_ = TeRasterParams::TeNotReady;
-		return;
-	}
-	if ( params_.nTilesInMemory_ == 0 )
-		params_.nTilesInMemory_ = params_.nBands() * (params_.ncols_ / params_.blockWidth_+1) ;
-}
-
-bool
-TeDecoderVirtualMemory::clear()
-{
-	TeMemoryPage* block;
-	TeBlockIndex index;
-	MapMemoryPageIterator p;
-	while (!pagesQueue_.empty() )
-	{
-		index = pagesQueue_.front();
-		pagesQueue_.pop();
-		p = virtualMemory_.find(index);
-		if (p != virtualMemory_.end())
-		{
-			block = p->second;
-			if (block->used_)
-				putRasterBlock(index,block->data_,block->pageSize());
-			delete block;
-			virtualMemory_.erase(index);
-		}
-	}
-	
-	pageCache_.resize(params_.nBands());
-	for(unsigned int i = 0; i < pageCache_.size(); ++i)
-	{
-		pageCache_[i] = NULL;
-	}
-
-	indexCache_.resize(params_.nBands());
-	for(unsigned int i = 0; i < indexCache_.size(); ++i)
-	{
-		indexCache_[i] = TeBlockIndex();
-	}
-
-	return true;
-}
-
-void TeDecoderVirtualMemory::setCacheSize(int size)
-{
-	int block_size = params_.blockHeight_ * params_.blockWidth_;
-	setCacheNTiles((int)(size / block_size));  
-}
-
-int TeDecoderVirtualMemory::getCacheSize()
-{
-	int block_size = params_.blockHeight_ * params_.blockWidth_;
-	return getCacheNTiles() * block_size;
-}
-
-void TeDecoderVirtualMemory::setCacheNTiles(int n)
-{
-	params_.nTilesInMemory_ = n;
-	TeDecoderVirtualMemory::clear();
-}
-
-int TeDecoderVirtualMemory::getCacheNTiles()
-{
-	return params_.nTilesInMemory_;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeDecoderVirtualMemory.h"
+#include "TeException.h"
+
+#include <cstring>
+
+TeMemoryPage::TeMemoryPage(const TeMemoryPage& rhs)
+{
+	data_ = rhs.data_;
+	used_ = rhs.used_;
+	defValue_ = rhs.defValue_;
+	dataType_ = rhs.dataType_;
+}
+
+//! Operator =
+TeMemoryPage& 
+TeMemoryPage::operator=(const TeMemoryPage& rhs)
+{
+	if (this != &rhs)
+	{
+		data_ = rhs.data_;
+		used_ = rhs.used_;
+		size_ = rhs.size_;
+		defValue_ = rhs.defValue_;
+		dataType_ = rhs.dataType_;
+	}
+	return *this;
+}
+
+//! Destructor
+TeMemoryPage::~TeMemoryPage()
+{
+	if (this->data_ != 0)
+	{
+    switch (dataType_)
+    {
+      case (TeBIT):
+        delete [](unsigned char*)data_;
+        break;    
+      case (TeUNSIGNEDCHAR):
+        delete [](unsigned char*)data_;
+        break;
+      case (TeCHAR) :
+        delete (char*)data_;
+        break;
+      case (TeUNSIGNEDSHORT):
+        delete [](unsigned short*)data_;
+        break;
+      case (TeSHORT):
+        delete (short*) data_;
+        break;
+      case (TeINTEGER):
+        delete (int*) data_;
+        break;      
+      case (TeUNSIGNEDLONG):
+        delete [](unsigned long*)data_;
+        break;
+      case (TeLONG):
+        delete [](long*) data_;
+        break;
+      case (TeFLOAT):
+        delete [](float*)data_;
+        break;
+      case (TeDOUBLE):
+        delete [](double*) data_;
+        break;
+      default:
+      { 
+        throw( TeException( UNKNOWN_ERROR_TYPE, "Invalid data type" ) );
+        break;
+      }   
+		}
+		data_ = 0;
+	}
+}
+
+TeMemoryPage::TeMemoryPage(unsigned long size, double defValue, TeDataType dataType):
+		used_(false),
+		size_(size),
+		defValue_(defValue),
+		dataType_(dataType)
+{
+	data_ = 0;
+	try 
+	{
+		unsigned int i;
+		// Try to allocate the necessary memory
+		switch (dataType_) 
+    {
+      case (TeBIT):
+        data_ = new unsigned char [size_];
+        memset(data_, (unsigned char)defValue, size);
+        break;    
+      case (TeUNSIGNEDCHAR):
+        data_ = new unsigned char [size_];
+        memset(data_, (int)defValue, size);
+        break;
+      case (TeCHAR) :
+        data_ = new char [size_];
+        memset(data_, (int)defValue, size);
+        break;
+      case (TeUNSIGNEDSHORT):
+        data_ = new unsigned short [size_];
+        for (i=0;i<size;((unsigned short*)data_)[i]= (unsigned short) defValue_,i++);
+        break;
+      case (TeSHORT):
+        data_ = new short [size_];
+        for (i=0;i<size;((short*)data_)[i]=(short)defValue_,i++);
+        break;
+      case (TeINTEGER):
+        data_ = new int [size_];
+        for (i=0;i<size;((int*)data_)[i]=(int)defValue_,i++);
+        break;      
+      case (TeUNSIGNEDLONG):
+        data_ = new unsigned long [size_];
+        for (i=0;i<size;((unsigned long*)data_)[i]=(unsigned long)defValue_,i++);
+        break;
+      case (TeLONG):
+        data_ = new long [size_];
+        for (i=0;i<size;((long*)data_)[i]=(long)defValue_,i++);
+        break;
+      case (TeFLOAT):
+        data_ = new float [size_];
+        for (i=0;i<size;((float*)data_)[i]=(float)defValue_,i++);
+        break;
+      case (TeDOUBLE):
+        data_ = new double [size_];
+        for (i=0;i<size;((double*)data_)[i]=(double)defValue_,i++);
+        break;
+      default:
+      {
+        throw( TeException( UNKNOWN_ERROR_TYPE, "Invalid data type" ) );
+        break;
+      }
+		}
+	}
+	catch (...)
+	{
+	}
+}
+
+void
+TeMemoryPage::clear()
+{	
+	unsigned int i;
+	switch (dataType_) 
+	{
+    case (TeBIT): 
+    case (TeUNSIGNEDCHAR):
+    case (TeCHAR) :
+      memset((void*)data_, (int)defValue_, size_);
+      break;
+    case (TeUNSIGNEDSHORT):
+      for (i=0;i<size_;((unsigned short*)data_)[i]= (unsigned short) defValue_,i++);
+      break;
+    case (TeSHORT):
+      for (i=0;i<size_;((short*)data_)[i]=(short)defValue_,i++);
+      break;
+    case (TeINTEGER):
+      for (i=0;i<size_;((int*)data_)[i]=(int)defValue_,i++);
+      break;      
+    case (TeUNSIGNEDLONG):
+      for (i=0;i<size_;((unsigned long*)data_)[i]=(unsigned long)defValue_,i++);
+      break;
+    case (TeLONG):
+      for (i=0;i<size_;((long*)data_)[i]=(long)defValue_,i++);
+      break;
+    case (TeFLOAT):
+      for (i=0;i<size_;((float*)data_)[i]=(float)defValue_,i++);
+      break;
+    case (TeDOUBLE):
+      for (i=0;i<size_;((double*)data_)[i]=(double)defValue_,i++);
+      break;
+    default:
+    {
+      throw( TeException( UNKNOWN_ERROR_TYPE, "Invalid data type" ) );
+      break;
+    }
+	}
+}
+
+long
+TeMemoryPage::pageSize()
+{
+	long s;
+	switch (dataType_) 
+	{
+    case (TeBIT) :
+      s = size_*sizeof(char);
+      break;  
+    case (TeUNSIGNEDCHAR) :
+      s = size_*sizeof(unsigned char);   
+      break;   
+    case (TeCHAR) :
+      s = size_*sizeof(char);
+      break;
+    case (TeUNSIGNEDSHORT):
+      s = size_*sizeof(unsigned short);
+      break;
+    case (TeSHORT):
+      s = size_*sizeof(short);
+      break;
+    case (TeINTEGER):
+      s = size_*sizeof(int);
+      break;      
+    case (TeUNSIGNEDLONG):
+      s = size_*sizeof(unsigned long);
+      break;
+    case (TeLONG):
+      s = size_*sizeof(long);
+      break;
+    case (TeFLOAT):
+      s = size_*sizeof(float);
+      break;
+    case (TeDOUBLE):
+      s = size_*sizeof(double);
+      break;
+    default:
+    {
+      throw( TeException( UNKNOWN_ERROR_TYPE, "Invalid data type" ) );
+      break;
+    }
+	}
+	return s;
+}
+
+double 
+TeMemoryPage::getVal(int col,int lin, int nCols)
+{
+	unsigned long offset = (lin-ulLin_)*nCols+(col-ulCol_);
+	double val = defValue_;
+
+	if (offset < size_) // solucao temporaria, rever
+	{
+		switch (dataType_) 
+		{
+      case (TeBIT):
+        val = ((unsigned char*)data_)[offset];
+        break;    
+      case (TeUNSIGNEDCHAR):
+        val = ((unsigned char*)data_)[offset];
+        break;
+      case (TeCHAR) :
+        val = ((char*) data_)[offset];
+        break;
+      case (TeUNSIGNEDSHORT):
+        val = ((unsigned short*)data_)[offset];
+        break;
+      case (TeSHORT):
+        val = ((short*)data_)[offset];
+        break;
+      case (TeINTEGER):
+        val = ((int*)data_)[offset];
+        break;      
+      case (TeUNSIGNEDLONG):
+        val = ((unsigned long*)data_)[offset];
+        break;
+      case (TeLONG):
+        val = ((long*)data_)[offset];
+        break;
+      case (TeFLOAT):
+        val = ((float*)data_)[offset];
+        break;
+      case (TeDOUBLE):
+        val = ((double*)data_)[offset];
+        break;
+      default:
+      {
+        throw( TeException( UNKNOWN_ERROR_TYPE, "Invalid data type" ) );
+        break;
+      }
+		}
+	}
+
+	return val;
+}
+
+void 
+TeMemoryPage::setVal(int col,int lin,int nCols, double val)
+{
+	unsigned long offset = (lin-ulLin_)*nCols+(col-ulCol_);
+	if (offset < size_) 
+	{
+		switch (dataType_) 
+		{
+      case (TeBIT):
+        ((unsigned char*)data_)[offset] = (unsigned char) val;
+        break;
+            
+      case (TeUNSIGNEDCHAR):
+        ((unsigned char*)data_)[offset] = (unsigned char) val;
+        break;
+      
+      case (TeCHAR) :
+        ((char*) data_)[offset] = (char) val;
+        break;
+      
+      case (TeUNSIGNEDSHORT):
+        ((unsigned short*)data_)[offset] = (unsigned short) val;
+        break;
+      
+      case (TeSHORT):
+        ((short*)data_)[offset] = (short) val;
+        break;
+        
+      case (TeINTEGER):
+        ((int*)data_)[offset] = (int) val;
+        break;        
+      
+      case (TeUNSIGNEDLONG):
+        ((unsigned long*)data_)[offset] = (unsigned long) val;
+        break;
+      
+      case (TeLONG):
+        ((long*)data_)[offset] = (long) val;
+        break;
+      
+      case (TeFLOAT):
+        ((float*)data_)[offset] = (float) val;
+        break;
+      
+      case (TeDOUBLE):
+        ((double*)data_)[offset] = val;
+        break;   
+  
+      default:
+      {
+        throw( TeException( UNKNOWN_ERROR_TYPE, "Invalid data type" ) );
+        break;
+      }
+		}
+	}
+	return;
+}
+
+TeDecoderVirtualMemory::TeDecoderVirtualMemory(const TeRasterParams par)
+{
+	params_ = par;
+}
+
+TeDecoderVirtualMemory::~TeDecoderVirtualMemory()
+{
+	if (!pagesQueue_.empty())
+		TeDecoderVirtualMemory::clear();
+}
+
+TeMemoryPage* TeDecoderVirtualMemory::loadBlock(int col,int lin, int band)
+{
+	// If element is outside raster boundaries return
+	if(col < 0 || lin < 0 || col > params_.ncols_ || lin > params_.nlines_)
+		return NULL;
+
+	TeBlockIndex index = blockIndex(col,lin,band);
+	TeMemoryPage* block = NULL;
+
+	// check band cache first
+	if (pageCache_[band] != NULL && indexCache_[band] == index)
+		block = pageCache_[band];
+	else
+	{
+		// check if page is already in memory
+		MapMemoryPageIterator p = virtualMemory_.find(index);
+		if (p != virtualMemory_.end()) // use it
+			block = p->second;
+		else
+		{
+			// page is not in memory
+			// check whether there is space in memory to bring another page
+			if (virtualMemory_.size() >= (unsigned int)params_.nTilesInMemory_)
+			{
+				// FIFO strategy: replace the oldest page in memory
+				TeBlockIndex first = pagesQueue_.front();
+				pagesQueue_.pop();
+				p = virtualMemory_.find(first); 
+				if (p != virtualMemory_.end())
+				{
+					block = p->second;
+					if (block->used_)
+						putRasterBlock(first,block->data_,block->pageSize());
+
+					block->used_ = false;
+					block->clear();				// reuse the allocated memory
+					virtualMemory_.erase(first);
+				}
+			}
+			else // bring the page to memory
+				block = new TeMemoryPage(params_.blockHeight_*params_.blockWidth_, params_.dummy_[band],params_.dataType_[band]);
+
+			virtualMemory_.insert(MapMemoryPage::value_type(index,block));
+			pagesQueue_.push(index);
+			getRasterBlock(index,block->data_);
+			int band_out;
+			blockIndexPos(index, block->ulCol_, block->ulLin_, band_out);
+		}
+		indexCache_[band] = index;
+		pageCache_[band] = block;
+	}
+  return block;
+}
+
+bool
+TeDecoderVirtualMemory::getElement(int col,int lin, double &val,int band)
+{
+	TeMemoryPage* block = loadBlock(col, lin, band);
+	if(block == NULL)
+	{
+		val = params_.dummy_[band];
+		return false;
+	}
+	val = block->getVal(col,lin,params_.blockWidth_);
+	return true;
+}
+
+bool
+TeDecoderVirtualMemory::setElement(int col, int lin, double val,int band)
+{
+	TeMemoryPage* block = loadBlock(col, lin, band);
+	if(block == NULL)
+		return false;
+
+	block->setVal(col,lin,params_.blockWidth_,val);
+	block->used_ = true;
+	return true;
+}
+
+TeBlockIndex TeDecoderVirtualMemory::blockIndex(int col, int lin, int band)
+{
+	TeBlockIndex bl_idx;
+
+	bl_idx.band_ = band;
+	bl_idx.col_ = (int)(col/params_.blockWidth_);
+	bl_idx.lin_ = (int)(lin/params_.blockHeight_);
+	return bl_idx;
+}
+
+void TeDecoderVirtualMemory::blockIndexPos( const TeBlockIndex& index, int& ulCol, int& ulLin, int& band)
+{
+	ulCol = index.column()*params_.blockWidth_;
+	ulLin = index.line()*params_.blockHeight_;
+	band = index.band();
+}
+
+void
+TeDecoderVirtualMemory::init()
+{
+	TeDecoderVirtualMemory::clear();
+	if (params_.nBands() == 0 || params_.ncols_ <= 0 || params_.nlines_ == 0)
+	{
+		params_.errorMessage_ = "Raster doesnt have valid dimensions.";
+		params_.status_ = TeRasterParams::TeNotReady;
+		return;
+	}
+	if ( params_.nTilesInMemory_ == 0 )
+		params_.nTilesInMemory_ = params_.nBands() * (params_.ncols_ / params_.blockWidth_+1) ;
+}
+
+bool
+TeDecoderVirtualMemory::clear()
+{
+	TeMemoryPage* block;
+	TeBlockIndex index;
+	MapMemoryPageIterator p;
+	while (!pagesQueue_.empty() )
+	{
+		index = pagesQueue_.front();
+		pagesQueue_.pop();
+		p = virtualMemory_.find(index);
+		if (p != virtualMemory_.end())
+		{
+			block = p->second;
+			if (block->used_)
+				putRasterBlock(index,block->data_,block->pageSize());
+			delete block;
+			virtualMemory_.erase(index);
+		}
+	}
+	
+	pageCache_.resize(params_.nBands());
+	for(unsigned int i = 0; i < pageCache_.size(); ++i)
+	{
+		pageCache_[i] = NULL;
+	}
+
+	indexCache_.resize(params_.nBands());
+	for(unsigned int i = 0; i < indexCache_.size(); ++i)
+	{
+		indexCache_[i] = TeBlockIndex();
+	}
+
+	return true;
+}
+
+void TeDecoderVirtualMemory::setCacheSize(int size)
+{
+	int block_size = params_.blockHeight_ * params_.blockWidth_;
+	setCacheNTiles((int)(size / block_size));  
+}
+
+int TeDecoderVirtualMemory::getCacheSize()
+{
+	int block_size = params_.blockHeight_ * params_.blockWidth_;
+	return getCacheNTiles() * block_size;
+}
+
+void TeDecoderVirtualMemory::setCacheNTiles(int n)
+{
+	params_.nTilesInMemory_ = n;
+	TeDecoderVirtualMemory::clear();
+}
+
+int TeDecoderVirtualMemory::getCacheNTiles()
+{
+	return params_.nTilesInMemory_;
+}
diff --git a/src/terralib/kernel/TeDecoderVirtualMemory.h b/src/terralib/kernel/TeDecoderVirtualMemory.h
old mode 100755
new mode 100644
index 99f33d6..099d36a
--- a/src/terralib/kernel/TeDecoderVirtualMemory.h
+++ b/src/terralib/kernel/TeDecoderVirtualMemory.h
@@ -1,241 +1,241 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDecoderVirtualMemory.h
-    \brief This file supports a virtual memory strategy to deal whith raster structures
-*/
-#ifndef  __TERRALIB_INTERNAL_DECODERVIRTUALMEMORY_H
-#define  __TERRALIB_INTERNAL_DECODERVIRTUALMEMORY_H
-
-#include "TeDefines.h"
-#include "TeDecoder.h"
-
-#include <queue>
-#include <vector>
-
-using namespace std;
-
-//! A page of memory
-class TL_DLL TeMemoryPage
-{
-public:
-	void*   data_;			//<! Pointer to the data in memory
-	bool	used_;			//<! Flag that indicate if the page was modified in memory
-	unsigned long size_;	//<! Page number of elements
-
-	int ulLin_;				//<! Line index of the upper-left corner
-	int ulCol_;				//<! Column index of the upper-left corner
-	double   defValue_;		//<! Default value (fo initially fill the page)
-	TeDataType dataType_;	//<! Pixel data type
-
-	//! Constructor
-	TeMemoryPage(unsigned long size, double defValue, TeDataType dataType = TeDOUBLE);
-	
-	//! Destructor
-	~TeMemoryPage();
-
-	//! Copy constructor
-	TeMemoryPage(const TeMemoryPage& rhs);
-	
-	//! Operator =
-	TeMemoryPage& operator=(const TeMemoryPage& rhs);
-
-	//! Returns the value of on position within the block
-	/*
-		\par col column identifier of the position
-		\par lin line identifier of the position
-		\par nCols number of columns per line of the block
-		\returns the value of the position indicated by (col x lin)
-	*/
-	double getVal(int col,int lin, int nCols);
-
-	//! Sets the value of a position within the block
-	/*
-		\par col column identifier of the position
-		\par lin line identifier of the position
-		\par nCols number of columns per line of the block
-		\par val the value to be put in the position
-	*/
-	void setVal(int col,int lin,int nCols, double val);
-
-	//! Set all positions of the page to the default value;
-	void clear();
-
-	//! Returns the physical size of a memory page
-	long pageSize();
-};
-
-class TL_DLL TeBlockIndex{
-public:
-	TeBlockIndex()
-	{
-		col_ = 0;
-		lin_ = 0;
-		band_ = -1;
-	}
-
-	int col_;
-	int lin_;
-	int band_;
-
-	int column()  const
-	{
-		return col_;
-	}
-
-	int line() const
-	{
-		return lin_;
-	}
-
-	int band() const
-	{
-		return band_;
-	}
-
-	int operator==(const TeBlockIndex& idx2) const
-	{
-		if(col_ != idx2.col_)
-			return 0;
-
-		if(lin_ != idx2.lin_)
-			return 0;
-
-		return (band_ == idx2.band_);
-	}
-};
-
-//! Implements a virtual memory strategy to decode raster in blocks
-/*
-	It should be used as a parent class of decoder that access raster
-	blocks from a physical storage
-*/
-class TL_DLL TeDecoderVirtualMemory: public TeDecoder
-{
-public:
-
-	//! Empty constructor
-	TeDecoderVirtualMemory() {};
-	
-	//! Constructor from parameters
-	TeDecoderVirtualMemory( const TeRasterParams par);
-
-	//! Destructor
-	virtual ~TeDecoderVirtualMemory();
-
-	//! Sets the value of a specific raster pixel 
-	/*!
-		\param col pixel column identifier
-		\param lin pixel line identifier
-		\param val pixel value being inserted
-		\param band pixel band identifier
-	*/
-	bool getElement(int col,int lin, double &val,int band);
-
-	//! Gets an specific element (col, lin, band) of a raster data
-	/*!
-		\param col pixel column identifier
-		\param lin pixel line identifier
-		\param val pixel value being retrieved
-		\param band pixel band identifier
-	*/
-	bool setElement(int col, int lin, double val,int band);
-
-	//! Initializes the internal structures of the decoder, from its raster parameters structure.
-	void init();
-
-	//! Clears  the decoder internal structures
-	bool clear();
-
-	//! Defines the physical size of the cache
-	void setCacheSize(int size);  
-
-	//! Returns the physical size of the cache
-	int getCacheSize();
-
-	//! Defines the number of tiles in the cache
-	void setCacheNTiles(int n);
-
-	//! Returns the number of tiles in the cache
-	int getCacheNTiles();
-
-protected:
-	struct TeBlockIndexMapFunc
-	{
-		bool operator()(const TeBlockIndex& idx1, const TeBlockIndex& idx2) const;
-	};
-
-	//! Saves a raster tile from a virtual memory to permanent storage
-	/*! 
-	    \param index block index
-		\param buf pointer to a raster tile in memory
-		\param bsize block size
-	*/	
-	virtual bool putRasterBlock(const TeBlockIndex& index, void *buf, long bsize) = 0; /******/
-
-	//! Gets the raster block with index identifier
-	/*!
-		\param index block index
-		\param buf pointer to a raster tile in memory
-	*/
-	virtual bool getRasterBlock(const TeBlockIndex& index, void *buf) = 0; /******/
-
-	//! Codifies the unique identifier of the raster block that contains a certain pixel
-	/*!
-		\param col column number
-		\param lin  pixel line number
-		\param band pixel band 
-		\return block index
-	*/
-	virtual TeBlockIndex blockIndex(int col, int lin, int band); 
-
-	//! Returns the parameters of a tile from its indexs
-	virtual void blockIndexPos( const TeBlockIndex& index, int& ulCol, int& ulLin, int& band); /******/
-
-	//! Retrieve a block of the cache that contains an element
-	TeMemoryPage* loadBlock(int col,int lin, int band);
-
-private:
-
-	//! A map of string identifiers to pointer to memory pages 
-	typedef map<TeBlockIndex, TeMemoryPage*, TeBlockIndexMapFunc> MapMemoryPage; 
-
-	//! A const iterator to a map of pages
-	typedef MapMemoryPage::const_iterator MapMemoryPageIterator;
-
-	MapMemoryPage virtualMemory_;
-	queue<TeBlockIndex> pagesQueue_; 
-	vector<TeBlockIndex> indexCache_; 
-	vector<TeMemoryPage*> pageCache_;
-};
-
-inline bool TeDecoderVirtualMemory::TeBlockIndexMapFunc::operator()(const TeBlockIndex& idx1, const TeBlockIndex& idx2) const
-{
-  if(idx1.band_ != idx2.band_)
-    return (idx1.band_ < idx2.band_);
-
-  if(idx1.lin_ != idx2.lin_)
-    return idx1.lin_ < idx2.lin_;
-
-  return (idx1.col_ < idx2.col_);
-}
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDecoderVirtualMemory.h
+    \brief This file supports a virtual memory strategy to deal whith raster structures
+*/
+#ifndef  __TERRALIB_INTERNAL_DECODERVIRTUALMEMORY_H
+#define  __TERRALIB_INTERNAL_DECODERVIRTUALMEMORY_H
+
+#include "TeDefines.h"
+#include "TeDecoder.h"
+
+#include <queue>
+#include <vector>
+
+using namespace std;
+
+//! A page of memory
+class TL_DLL TeMemoryPage
+{
+public:
+	void*   data_;			//<! Pointer to the data in memory
+	bool	used_;			//<! Flag that indicate if the page was modified in memory
+	unsigned long size_;	//<! Page number of elements
+
+	int ulLin_;				//<! Line index of the upper-left corner
+	int ulCol_;				//<! Column index of the upper-left corner
+	double   defValue_;		//<! Default value (fo initially fill the page)
+	TeDataType dataType_;	//<! Pixel data type
+
+	//! Constructor
+	TeMemoryPage(unsigned long size, double defValue, TeDataType dataType = TeDOUBLE);
+	
+	//! Destructor
+	~TeMemoryPage();
+
+	//! Copy constructor
+	TeMemoryPage(const TeMemoryPage& rhs);
+	
+	//! Operator =
+	TeMemoryPage& operator=(const TeMemoryPage& rhs);
+
+	//! Returns the value of on position within the block
+	/*
+		\par col column identifier of the position
+		\par lin line identifier of the position
+		\par nCols number of columns per line of the block
+		\returns the value of the position indicated by (col x lin)
+	*/
+	double getVal(int col,int lin, int nCols);
+
+	//! Sets the value of a position within the block
+	/*
+		\par col column identifier of the position
+		\par lin line identifier of the position
+		\par nCols number of columns per line of the block
+		\par val the value to be put in the position
+	*/
+	void setVal(int col,int lin,int nCols, double val);
+
+	//! Set all positions of the page to the default value;
+	void clear();
+
+	//! Returns the physical size of a memory page
+	long pageSize();
+};
+
+class TL_DLL TeBlockIndex{
+public:
+	TeBlockIndex()
+	{
+		col_ = 0;
+		lin_ = 0;
+		band_ = -1;
+	}
+
+	int col_;
+	int lin_;
+	int band_;
+
+	int column()  const
+	{
+		return col_;
+	}
+
+	int line() const
+	{
+		return lin_;
+	}
+
+	int band() const
+	{
+		return band_;
+	}
+
+	int operator==(const TeBlockIndex& idx2) const
+	{
+		if(col_ != idx2.col_)
+			return 0;
+
+		if(lin_ != idx2.lin_)
+			return 0;
+
+		return (band_ == idx2.band_);
+	}
+};
+
+//! Implements a virtual memory strategy to decode raster in blocks
+/*
+	It should be used as a parent class of decoder that access raster
+	blocks from a physical storage
+*/
+class TL_DLL TeDecoderVirtualMemory: public TeDecoder
+{
+public:
+
+	//! Empty constructor
+	TeDecoderVirtualMemory() {};
+	
+	//! Constructor from parameters
+	TeDecoderVirtualMemory( const TeRasterParams par);
+
+	//! Destructor
+	virtual ~TeDecoderVirtualMemory();
+
+	//! Sets the value of a specific raster pixel 
+	/*!
+		\param col pixel column identifier
+		\param lin pixel line identifier
+		\param val pixel value being inserted
+		\param band pixel band identifier
+	*/
+	bool getElement(int col,int lin, double &val,int band);
+
+	//! Gets an specific element (col, lin, band) of a raster data
+	/*!
+		\param col pixel column identifier
+		\param lin pixel line identifier
+		\param val pixel value being retrieved
+		\param band pixel band identifier
+	*/
+	bool setElement(int col, int lin, double val,int band);
+
+	//! Initializes the internal structures of the decoder, from its raster parameters structure.
+	void init();
+
+	//! Clears  the decoder internal structures
+	bool clear();
+
+	//! Defines the physical size of the cache
+	void setCacheSize(int size);  
+
+	//! Returns the physical size of the cache
+	int getCacheSize();
+
+	//! Defines the number of tiles in the cache
+	void setCacheNTiles(int n);
+
+	//! Returns the number of tiles in the cache
+	int getCacheNTiles();
+
+protected:
+	struct TeBlockIndexMapFunc
+	{
+		bool operator()(const TeBlockIndex& idx1, const TeBlockIndex& idx2) const;
+	};
+
+	//! Saves a raster tile from a virtual memory to permanent storage
+	/*! 
+	    \param index block index
+		\param buf pointer to a raster tile in memory
+		\param bsize block size
+	*/	
+	virtual bool putRasterBlock(const TeBlockIndex& index, void *buf, long bsize) = 0; /******/
+
+	//! Gets the raster block with index identifier
+	/*!
+		\param index block index
+		\param buf pointer to a raster tile in memory
+	*/
+	virtual bool getRasterBlock(const TeBlockIndex& index, void *buf) = 0; /******/
+
+	//! Codifies the unique identifier of the raster block that contains a certain pixel
+	/*!
+		\param col column number
+		\param lin  pixel line number
+		\param band pixel band 
+		\return block index
+	*/
+	virtual TeBlockIndex blockIndex(int col, int lin, int band); 
+
+	//! Returns the parameters of a tile from its indexs
+	virtual void blockIndexPos( const TeBlockIndex& index, int& ulCol, int& ulLin, int& band); /******/
+
+	//! Retrieve a block of the cache that contains an element
+	TeMemoryPage* loadBlock(int col,int lin, int band);
+
+private:
+
+	//! A map of string identifiers to pointer to memory pages 
+	typedef map<TeBlockIndex, TeMemoryPage*, TeBlockIndexMapFunc> MapMemoryPage; 
+
+	//! A const iterator to a map of pages
+	typedef MapMemoryPage::const_iterator MapMemoryPageIterator;
+
+	MapMemoryPage virtualMemory_;
+	queue<TeBlockIndex> pagesQueue_; 
+	vector<TeBlockIndex> indexCache_; 
+	vector<TeMemoryPage*> pageCache_;
+};
+
+inline bool TeDecoderVirtualMemory::TeBlockIndexMapFunc::operator()(const TeBlockIndex& idx1, const TeBlockIndex& idx2) const
+{
+  if(idx1.band_ != idx2.band_)
+    return (idx1.band_ < idx2.band_);
+
+  if(idx1.lin_ != idx2.lin_)
+    return idx1.lin_ < idx2.lin_;
+
+  return (idx1.col_ < idx2.col_);
+}
+#endif
diff --git a/src/terralib/kernel/TeDefines.h b/src/terralib/kernel/TeDefines.h
old mode 100755
new mode 100644
index b7a13a9..cf3b801
--- a/src/terralib/kernel/TeDefines.h
+++ b/src/terralib/kernel/TeDefines.h
@@ -1,234 +1,242 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDefines.h
-    \brief Provides a set of general definitions used by Terralib
-*/
-#ifndef  __TERRALIB_INTERNAL_DEFINES_H
-#define  __TERRALIB_INTERNAL_DEFINES_H
-
-#include <string> 
-
-/** @defgroup Defines Defines and constants
-  @{
- */
-
- 
-/** @defgroup PlatformDetection Platform detection macros.
-  @{
- */
-/** @brief Microsoft Windows platform code */ 
-#define TePLATFORMCODE_MSWINDOWS 1
-/** @brief Generic Linux platform code */ 
-#define TePLATFORMCODE_LINUX 2
-/** @brief Solaris platform code */ 
-#define TePLATFORMCODE_SOLARIS 3
-/** @brief Apple platform code */ 
-#define TePLATFORMCODE_APPLE 4
-/** @brief IBM AIX platform code */ 
-#define TePLATFORMCODE_AIX 5
-
-#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
-  #define TePLATFORM TePLATFORMCODE_MSWINDOWS
-#elif defined( __LINUX__ ) || defined( linux ) || defined( __linux__ ) ||defined( __FreeBSD__ ) //FAMI
-  #define TePLATFORM TePLATFORMCODE_LINUX
-#elif defined( __APPLE_CC__ ) || defined( APPLE_CC )
-  #define TePLATFORM TePLATFORMCODE_APPLE
-#elif defined(sparc) && defined(sun) && defined(unix) 
-  #define TePLATFORM TePLATFORMCODE_SOLARIS
-#elif defined(_AIX)
-  #define TePLATFORM TePLATFORMCODE_AIX
-  #define __unix__
-#else
-  #error "ERROR: Unknown platform"
-#endif
-/** @} */ 
-
-/** @defgroup CompilerDetection Compiler detection macros.
-  @{
- */
-/** @brief MS Visual Studio c++ code */ 
-#define TeCOMPILERCODE_VCPLUSPLUS 1
-/** @brief Borland c++ code */ 
-#define TeCOMPILERCODE_BCPLUSPLUS 2
-/** @brief GNU Compiler code */ 
-#define TeCOMPILERCODE_GNUC 3
-/** @brief CodeWarrior code */ 
-#define TeCOMPILERCODE_CODEWARRIOR 4
-/** @brief Sun Forte code */ 
-#define TeCOMPILERCODE_SUNFORTE7 5
-/** @brief AIX xlC code */ 
-#define TeCOMPILERCODE_XLC 6
-
-#if defined( _MSC_VER )
-  #define TeCOMPILER TeCOMPILERCODE_VCPLUSPLUS
-#elif defined( __BORLANDC__ ) || defined( __BCPLUSPLUS__ )
-  #define TeCOMPILER TeCOMPILERCODE_BCPLUSPLUS
-#elif defined( __GNUC__ )
-  #define TeCOMPILER TeCOMPILERCODE_GNUC
-#elif defined( __MWERKS__ )
-  #define TeCOMPILER TeCOMPILERCODE_CODEWARRIOR
-#elif defined( __SUNPRO_CC)
-  #define TeCOMPILER TeCOMPILERCODE_SUNFORTE7
-#elif defined( __xlC__ )
-  #define TeCOMPILER TeCOMPILERCODE_XLC
-#else
-  #error "ERROR: Unknown compiler"
-#endif
-/** @} */ 
-
-
-/** @defgroup MathConst Mathematical constants and macro definitions
-  @{
- */
-//! A default name length
-const int	TeNAME_LENGTH = 2000;			//!< A default name length
-const double	TeMAXFLOAT =	3.4E37;			//!< Maximum float value
-const double	TeMINFLOAT =	3.4E-37;		//!< Minimum float value
-const double	TePI  =	3.14159265358979323846;		//!< The ratio of the circumference to the diameter of a circle
-const double	TeCDR =	0.01745329251994329576;		//!< Conversion factor: degrees to radians
-const double	TeCRD = 57.29577951308232087679;	//!< Conversion factor: radians to degrees
-const double 	TeEARTHRADIUS   = 6378160.;		//!< Int. Astronomical Union - 1965
-
-#ifndef MAX
-#define MAX(a,b) ( (a>b) ? a : b )	//!< Macro that returns max between two values
-#endif
-
-#ifndef MIN
-#define MIN(a,b) ( (a<b) ? a : b )	//!< Macro that returns min between two values
-#endif
-
-#ifndef ABS
-#define ABS(x) 	( ((x) >= 0) ? (x) : -(x) )	//!< Macro that returns the absolute value
-#endif
-/** @} */
-
-
-/** @defgroup Selection Mode for the objects
-	@{
- */
-#define TeDEFAULT			0	//!< default selection
-#define TePOINTED			1	//!< object pointed
-#define TeQUERIED   		2	//!< object queried
-#define TePOINTED_QUERIED	3	//!< object pointed and queried
-/** @} */	// end Selection Mode
-
-
-/** @defgroup Orient Ring orientation
-	@{
- */
-#define TeNOTURN			 0	//!< Unknown orientation
-#define TeCOLLINEAR			 0	//!< Collinear
-#define TeCLOCKWISE   		-1	//!< Clockwise orientation
-#define TeCOUNTERCLOCKWISE	 1	//!< Counter-Clockwise orientation
-/** @} */	// end Orientation
-
-/** @defgroup TopDefines Topology related defines
-    @{
- */
-/** @defgroup InOut Inside/Outside positioning
-	@ingroup TopDefines
-    @{
- */
-#define	TeUNKNOWNPOSITION  0	//!< unknown position
-#define	TeINSIDE		   1	//!< inside position
-#define	TeOUTSIDE		   2	//!< outside position
-#define	TeBOUNDARY		   4	//!< on the boundary position
-/** @} */
-
-
-/** @defgroup Inter Intersection types
-	@ingroup TopDefines
-    @{
- */
-/** @defgroup GeneralInter General intersection
-	@ingroup Inter
-	@{
- */
-#define TeINTERIORINTERIOR 8	//!< interior and interior intersection
-#define TeINTERIORBOUNDARY 16	//!< interior and boundary intersection
-#define TeINTERIOREXTERIOR 32	//!< interior and exterior intersection
-#define TeBOUNDARYINTERIOR 64	//!< boundary and interior intersection
-#define TeBOUNDARYBOUNDARY 128	//!< boundary and boundary intersection
-#define TeBOUNDARYEXTERIOR 256	//!< boundary and exterior intersection
-#define TeEXTERIORINTERIOR 512	//!< exterior and interior intersection
-#define TeEXTERIORBOUNDARY 1024	//!< exterior and boundary intersection
-#define TeEXTERIOREXTERIOR 2048	//!< exterior and exterior intersection
-/** @} */ // end GeneralInter
-
-/** @defgroup SegInter Segments intersection
-	@ingroup Inter
-	@{
- */
-#define TeDONT_INTERSECT 0		//!< segments don't intersects
-#define TeDO_INTERSECT   1		//!< segments intersects
-#define TeAT_ENDPOINT    4		//!< segments intersects at end points
-/** @} */	// end SegInter
-/** @} */  // end Inte
-
-/** @defgroup TopOper Topological operations
-	@{
- */
-#define TeDIFFERENCE   1	//!< Difference operation
-#define TeUNION        2	//!< Union operation
-#define TeINTERSECTION 4	//!< Intersection operation
-/** @} */ // end TopOper
-/** @} */ // end TopDefines
-/** @} */ // end Defines
-
-//! Current terralib database version
-const std::string TeDBVERSION = "3.3.1"; 		
-
-/* @brief TeISNAN definition */
-
-#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  #include <float.h>
-  #define TeISNAN( x ) _isnan( x )
-#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-  #include <math.h>
-  #define TeISNAN( x ) isnan( x )
-#else
-  #error "ERROR: Unsupported platform"
-#endif
-
-/** @defgroup TerraLib_AS_DLL macros.
-  @{
- */
-#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
-
-#if defined(_MSC_VER) /* MSVC Compiler */
-#pragma warning(disable: 4251)
-#endif
-
-#ifdef TL_AS_DLL
-#define TL_DLL __declspec(dllexport)
-#else
-#define TL_DLL __declspec(dllimport)
-#endif
-
-#else
-#define TL_DLL
-#endif
-/** @} */ 
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDefines.h
+    \brief Provides a set of general definitions used by Terralib
+*/
+#ifndef  __TERRALIB_INTERNAL_DEFINES_H
+#define  __TERRALIB_INTERNAL_DEFINES_H
+
+#include <string> 
+
+/** @defgroup Defines Defines and constants
+  @{
+ */
+
+ 
+/** @defgroup PlatformDetection Platform detection macros.
+  @{
+ */
+/** @brief Microsoft Windows platform code */ 
+#define TePLATFORMCODE_MSWINDOWS 1
+/** @brief Generic Linux platform code */ 
+#define TePLATFORMCODE_LINUX 2
+/** @brief Solaris platform code */ 
+#define TePLATFORMCODE_SOLARIS 3
+/** @brief Apple platform code */ 
+#define TePLATFORMCODE_APPLE 4
+/** @brief IBM AIX platform code */ 
+#define TePLATFORMCODE_AIX 5
+
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+  #define TePLATFORM TePLATFORMCODE_MSWINDOWS
+#elif defined( __LINUX__ ) || defined( linux ) || defined( __linux__ ) ||defined( __FreeBSD__ ) //FAMI
+  #define TePLATFORM TePLATFORMCODE_LINUX
+#elif defined( __APPLE_CC__ ) || defined( APPLE_CC )
+  #define TePLATFORM TePLATFORMCODE_APPLE
+#elif defined(sparc) && defined(sun) && defined(unix) 
+  #define TePLATFORM TePLATFORMCODE_SOLARIS
+#elif defined(_AIX)
+  #define TePLATFORM TePLATFORMCODE_AIX
+  #define __unix__
+#else
+  #error "ERROR: Unknown platform"
+#endif
+/** @} */ 
+
+/** @defgroup CompilerDetection Compiler detection macros.
+  @{
+ */
+/** @brief MS Visual Studio c++ code */ 
+#define TeCOMPILERCODE_VCPLUSPLUS 1
+/** @brief Borland c++ code */ 
+#define TeCOMPILERCODE_BCPLUSPLUS 2
+/** @brief GNU Compiler code */ 
+#define TeCOMPILERCODE_GNUC 3
+/** @brief CodeWarrior code */ 
+#define TeCOMPILERCODE_CODEWARRIOR 4
+/** @brief Sun Forte code */ 
+#define TeCOMPILERCODE_SUNFORTE7 5
+/** @brief AIX xlC code */ 
+#define TeCOMPILERCODE_XLC 6
+
+#if defined( _MSC_VER )
+  #define TeCOMPILER TeCOMPILERCODE_VCPLUSPLUS
+#elif defined( __BORLANDC__ ) || defined( __BCPLUSPLUS__ )
+  #define TeCOMPILER TeCOMPILERCODE_BCPLUSPLUS
+#elif defined( __GNUC__ )
+  #define TeCOMPILER TeCOMPILERCODE_GNUC
+#elif defined( __MWERKS__ )
+  #define TeCOMPILER TeCOMPILERCODE_CODEWARRIOR
+#elif defined( __SUNPRO_CC)
+  #define TeCOMPILER TeCOMPILERCODE_SUNFORTE7
+#elif defined( __xlC__ )
+  #define TeCOMPILER TeCOMPILERCODE_XLC
+#else
+  #error "ERROR: Unknown compiler"
+#endif
+/** @} */ 
+
+
+/** @defgroup MathConst Mathematical constants and macro definitions
+  @{
+ */
+//! A default name length
+const int	TeNAME_LENGTH = 2000;			//!< A default name length
+const double	TeMAXFLOAT =	3.4E37;			//!< Maximum float value
+const double	TeMINFLOAT =	3.4E-37;		//!< Minimum float value
+const double	TePI  =	3.14159265358979323846;		//!< The ratio of the circumference to the diameter of a circle
+const double	TeCDR =	0.01745329251994329576;		//!< Conversion factor: degrees to radians
+const double	TeCRD = 57.29577951308232087679;	//!< Conversion factor: radians to degrees
+const double 	TeEARTHRADIUS   = 6378160.;		//!< Int. Astronomical Union - 1965
+
+#ifndef MAX
+#define MAX(a,b) ( (a>b) ? a : b )	//!< Macro that returns max between two values
+#endif
+
+#ifndef MIN
+#define MIN(a,b) ( (a<b) ? a : b )	//!< Macro that returns min between two values
+#endif
+
+#ifndef ABS
+#define ABS(x) 	( ((x) >= 0) ? (x) : -(x) )	//!< Macro that returns the absolute value
+#endif
+/** @} */
+
+
+/** @defgroup Selection Mode for the objects
+	@{
+ */
+#define TeDEFAULT			0	//!< default selection
+#define TePOINTED			1	//!< object pointed
+#define TeQUERIED   		2	//!< object queried
+#define TePOINTED_QUERIED	3	//!< object pointed and queried
+/** @} */	// end Selection Mode
+
+
+/** @defgroup Orient Ring orientation
+	@{
+ */
+#define TeNOTURN			 0	//!< Unknown orientation
+#define TeCOLLINEAR			 0	//!< Collinear
+#define TeCLOCKWISE   		-1	//!< Clockwise orientation
+#define TeCOUNTERCLOCKWISE	 1	//!< Counter-Clockwise orientation
+/** @} */	// end Orientation
+
+/** @defgroup TopDefines Topology related defines
+    @{
+ */
+/** @defgroup InOut Inside/Outside positioning
+	@ingroup TopDefines
+    @{
+ */
+#define	TeUNKNOWNPOSITION  0	//!< unknown position
+#define	TeINSIDE		   1	//!< inside position
+#define	TeOUTSIDE		   2	//!< outside position
+#define	TeBOUNDARY		   4	//!< on the boundary position
+/** @} */
+
+
+/** @defgroup Inter Intersection types
+	@ingroup TopDefines
+    @{
+ */
+/** @defgroup GeneralInter General intersection
+	@ingroup Inter
+	@{
+ */
+#define TeINTERIORINTERIOR 8	//!< interior and interior intersection
+#define TeINTERIORBOUNDARY 16	//!< interior and boundary intersection
+#define TeINTERIOREXTERIOR 32	//!< interior and exterior intersection
+#define TeBOUNDARYINTERIOR 64	//!< boundary and interior intersection
+#define TeBOUNDARYBOUNDARY 128	//!< boundary and boundary intersection
+#define TeBOUNDARYEXTERIOR 256	//!< boundary and exterior intersection
+#define TeEXTERIORINTERIOR 512	//!< exterior and interior intersection
+#define TeEXTERIORBOUNDARY 1024	//!< exterior and boundary intersection
+#define TeEXTERIOREXTERIOR 2048	//!< exterior and exterior intersection
+/** @} */ // end GeneralInter
+
+/** @defgroup SegInter Segments intersection
+	@ingroup Inter
+	@{
+ */
+#define TeDONT_INTERSECT 0		//!< segments don't intersects
+#define TeDO_INTERSECT   1		//!< segments intersects
+#define TeAT_ENDPOINT    4		//!< segments intersects at end points
+/** @} */	// end SegInter
+/** @} */  // end Inte
+
+/** @defgroup TopOper Topological operations
+	@{
+ */
+#define TeDIFFERENCE   1	//!< Difference operation
+#define TeUNION        2	//!< Union operation
+#define TeINTERSECTION 4	//!< Intersection operation
+/** @} */ // end TopOper
+/** @} */ // end TopDefines
+/** @} */ // end Defines
+
+//! Current terralib database version
+const std::string TeDBVERSION = "4.0.0"; 		
+
+/* @brief TeISNAN definition */
+
+#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  #include <float.h>
+  #define TeISNAN( x ) _isnan( x )
+#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+  #include <math.h>
+  #define TeISNAN( x ) isnan( x )
+#else
+  #error "ERROR: Unsupported platform"
+#endif
+
+/** @defgroup TerraLib_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TL_AS_DLL
+#define TL_DLL __declspec(dllexport)
+#else
+#define TL_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TL_DLL
+#endif
+/** @} */ 
+               
+/**
+ * @defgroup MultProgToolsGroup Multi-programming tools.
+ */                
+  
+/**
+ * @defgroup GeometricTransformationGroup Geometric transformation.
+ */       
+
+#endif
+
diff --git a/src/terralib/kernel/TeErrorLog.cpp b/src/terralib/kernel/TeErrorLog.cpp
old mode 100755
new mode 100644
index f104ed8..93e31b3
--- a/src/terralib/kernel/TeErrorLog.cpp
+++ b/src/terralib/kernel/TeErrorLog.cpp
@@ -1,184 +1,184 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeErrorLog.h"
-#include "TeAsciiFile.h"
-#include "TeUtils.h"
-#include "TeException.h"
-
-TeErrorLog::TeErrorLog():logFile_ ( 0 )
-{
-	errorMessage_ [ LOG_MESSAGE             ] = "Message ";
-
-	errorMessage_ [ EMPTY_FILE_NAME         ] = "Empty File Name";
-	errorMessage_ [ CANNOT_OPEN_FILE        ] = "Could Not Open File";
-    errorMessage_ [ CANNOT_READ_FILE		] = "Could Not Read File";
-    errorMessage_ [ CANNOT_WRITE_FILE   	] = "Could Not Write File";
-    errorMessage_ [ CANNOT_CLOSE_FILE		] = "Could Not Close File";
-    errorMessage_ [ END_OF_FILE_REACHED 	] = "End of File Reached";
-
-
-// Errors associated with projection
-
-    errorMessage_ [  DATUM_ERROR              ] = "Error when creating Datum";
-    errorMessage_ [  PROJECTION_NOT_AVAILABLE ] = "Projection not available in TerraLib";
-
-// Error codes for MIF files
-    errorMessage_ [   NOT_MIF_FILE			] = "Not a MIF File";
-    errorMessage_ [   MIF_REGION_CLOSE		] = "Error - MIF Region is not Closed";
-    errorMessage_ [   MIF_CONVERSION_ERROR	] = "Error during conversion of MIF data";
-    errorMessage_ [   NOT_CSV               ] = "Data not separated by commas";
-    errorMessage_ [   NOT_ENOUGH_ROWS       ] = "Less rows in MID file than regions in MIF file";
-    errorMessage_ [   NOT_POLYGON_FILE		] = "Not a polygon (planar areas) file";
-    errorMessage_ [   PLINE_ERROR			] = "Wrongly defined PLINE attribute"; 
-    errorMessage_ [   NO_DTM_QUOTE_VALUE    ] = "Unable to define an attribute as a DTM quote file";
-
-// Error Codes for shapefiles
-    errorMessage_ [  POLYSHAPE_IS_NOT_RING  ] = "Shape PolyShape is not a ring";
-    errorMessage_ [  UNHANDLED_SHP_TYPE     ] = "Shape type unhandled currently";
-
-// Error Codes for DBF files
-
-    errorMessage_ [  UNABLE_TO_OPEN_DBF_FILE  ] = "Unable to Open DBF file";
-    errorMessage_ [  NO_DATA_IN_DBF_FILE      ] = "No Data in DBF File";
-    errorMessage_ [  ATTRIBUTE_INDEX_MISMATCH ] = "Mismatch between attribute index and number of geometries";
-
-// Error codes for E00 Files
-    errorMessage_ [  NOT_E00_FILE            ] = "Not an E00 File";
-
-// Error codes for algorithms
-    errorMessage_ [  CENTROID_NOT_FOUND   ] = "Could not find centroid of a polygon";
-    errorMessage_ [  REGIONS_WITH_HOLES   ] = "Problems in regions with holes";
-    errorMessage_ [  LINE_IS_NOT_RING	  ] = "Tried to a create a ring from a non-closed line";
-
-// Error codes for tables
-
-    errorMessage_ [  ROW_MISMATCH		  ] = "Unable to insert a row into a table (attribute mismatch)";
-    errorMessage_ [  NO_SUCH_ATTRIBUTE    ] = "Attribute does not exist in the table";
-
-	// Error codes for Raster stuff
-    errorMessage_ [  UNKNOWN_DECODER_TECHNOLOGY_TYPE ] = "Decoder technology not specified";
-    errorMessage_ [  UNKNOWN_RASTER_FORMAT	         ] = "Raster format not supported";
-
-	// Error codes for layer stuff
-	errorMessage_ [  GEOMETRY_REPRESENTATION_MISMATCH ] = "Geometry representation has not been created";
-  
-  // TeFactory related errors
-  errorMessage_ [  FACTORY_PRODUCT_INSTATIATION_ERROR ] = 
-    "Factory product instatiation error";
-
-	errorMessage_ [  UNKNOWN_ERROR_TYPE ] = "";
-}
-
-TeErrorLog::~TeErrorLog()
-{
-  endSession();
-}
-string
-TeErrorLog::message( const TeErrorType msgCode )
-{
-	// find the message associated to the errorcode
-	map <TeErrorType, string>::iterator it = errorMessage_.find ( msgCode );
-	if ( it != errorMessage_.end()  )
-		return (*it).second;
-	else
-		return errorMessage_ [ UNKNOWN_ERROR_TYPE ];
-}
-
-void
-TeErrorLog::insert ( TeErrorType code, const string& msg )
-{
-	// create a new logfile, if needed
-	if ( logFile_  == 0 )
-		//logFile_ = new TeAsciiFile ( "terralib.err", "rw" );
-		return;
-
-	string log = errorMessage_ [ code ] + " " + msg;
-	logFile_->writeString ( log );
-  logFile_->writeNewLine();
-
-	// increment the count associated to this error type
-	map<TeErrorType, int>::iterator it = errorLog_.find( code );
-	if ( it == errorLog_.end() )
-		errorLog_[ code ] = 1;
-	else
-	{ 
-		int count = (*it).second;
-		errorLog_[ code ] = ++count;
-	}
-}
-
-
-void 
-TeErrorLog::startSession ( const string& errLogFileName)
-{
-  endSession();
-  
-	// create a new logfile
-	logFile_ = new TeAsciiFile ( errLogFileName, "w+" );
-  
-  if( logFile_ == 0 ) {
-    throw TeException( UNKNOWN_ERROR_TYPE, "Unable to create log file", 
-      false );
-  }
-}
-
-int
-TeErrorLog::endSession ()
-{
-  if( logFile_ == 0 ) {
-    errorLog_.clear ();
-    return 0;
-  }
-
-	int numerr =  errorLog_.size();
-
-	// increment the count associated to this error type
-	map<TeErrorType, int>::iterator it = errorLog_.begin();
-
-	while ( it != errorLog_.end() )
-	{
-		int count = (*it).second;
-		string log = "Number of Error of Type " + errorMessage_ [ (*it).first ] 
-			+ " = " + Te2String ( count );
-		logFile_->writeString ( log );
-    logFile_->writeNewLine();
-    
-    ++it;
-	}
-
-	// close the log file
-	delete logFile_;
-  logFile_ = 0;
-
-	// clear the stack
-	errorLog_.clear ();
-
-  return numerr;
-}
- 
- 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeErrorLog.h"
+#include "TeAsciiFile.h"
+#include "TeUtils.h"
+#include "TeException.h"
+
+TeErrorLog::TeErrorLog():logFile_ ( 0 )
+{
+	errorMessage_ [ LOG_MESSAGE             ] = "Message ";
+
+	errorMessage_ [ EMPTY_FILE_NAME         ] = "Empty File Name";
+	errorMessage_ [ CANNOT_OPEN_FILE        ] = "Could Not Open File";
+    errorMessage_ [ CANNOT_READ_FILE		] = "Could Not Read File";
+    errorMessage_ [ CANNOT_WRITE_FILE   	] = "Could Not Write File";
+    errorMessage_ [ CANNOT_CLOSE_FILE		] = "Could Not Close File";
+    errorMessage_ [ END_OF_FILE_REACHED 	] = "End of File Reached";
+
+
+// Errors associated with projection
+
+    errorMessage_ [  DATUM_ERROR              ] = "Error when creating Datum";
+    errorMessage_ [  PROJECTION_NOT_AVAILABLE ] = "Projection not available in TerraLib";
+
+// Error codes for MIF files
+    errorMessage_ [   NOT_MIF_FILE			] = "Not a MIF File";
+    errorMessage_ [   MIF_REGION_CLOSE		] = "Error - MIF Region is not Closed";
+    errorMessage_ [   MIF_CONVERSION_ERROR	] = "Error during conversion of MIF data";
+    errorMessage_ [   NOT_CSV               ] = "Data not separated by commas";
+    errorMessage_ [   NOT_ENOUGH_ROWS       ] = "Less rows in MID file than regions in MIF file";
+    errorMessage_ [   NOT_POLYGON_FILE		] = "Not a polygon (planar areas) file";
+    errorMessage_ [   PLINE_ERROR			] = "Wrongly defined PLINE attribute"; 
+    errorMessage_ [   NO_DTM_QUOTE_VALUE    ] = "Unable to define an attribute as a DTM quote file";
+
+// Error Codes for shapefiles
+    errorMessage_ [  POLYSHAPE_IS_NOT_RING  ] = "Shape PolyShape is not a ring";
+    errorMessage_ [  UNHANDLED_SHP_TYPE     ] = "Shape type unhandled currently";
+
+// Error Codes for DBF files
+
+    errorMessage_ [  UNABLE_TO_OPEN_DBF_FILE  ] = "Unable to Open DBF file";
+    errorMessage_ [  NO_DATA_IN_DBF_FILE      ] = "No Data in DBF File";
+    errorMessage_ [  ATTRIBUTE_INDEX_MISMATCH ] = "Mismatch between attribute index and number of geometries";
+
+// Error codes for E00 Files
+    errorMessage_ [  NOT_E00_FILE            ] = "Not an E00 File";
+
+// Error codes for algorithms
+    errorMessage_ [  CENTROID_NOT_FOUND   ] = "Could not find centroid of a polygon";
+    errorMessage_ [  REGIONS_WITH_HOLES   ] = "Problems in regions with holes";
+    errorMessage_ [  LINE_IS_NOT_RING	  ] = "Tried to a create a ring from a non-closed line";
+
+// Error codes for tables
+
+    errorMessage_ [  ROW_MISMATCH		  ] = "Unable to insert a row into a table (attribute mismatch)";
+    errorMessage_ [  NO_SUCH_ATTRIBUTE    ] = "Attribute does not exist in the table";
+
+	// Error codes for Raster stuff
+    errorMessage_ [  UNKNOWN_DECODER_TECHNOLOGY_TYPE ] = "Decoder technology not specified";
+    errorMessage_ [  UNKNOWN_RASTER_FORMAT	         ] = "Raster format not supported";
+
+	// Error codes for layer stuff
+	errorMessage_ [  GEOMETRY_REPRESENTATION_MISMATCH ] = "Geometry representation has not been created";
+  
+  // TeFactory related errors
+  errorMessage_ [  FACTORY_PRODUCT_INSTATIATION_ERROR ] = 
+    "Factory product instatiation error";
+
+	errorMessage_ [  UNKNOWN_ERROR_TYPE ] = "";
+}
+
+TeErrorLog::~TeErrorLog()
+{
+  endSession();
+}
+string
+TeErrorLog::message( const TeErrorType msgCode )
+{
+	// find the message associated to the errorcode
+	map <TeErrorType, string>::iterator it = errorMessage_.find ( msgCode );
+	if ( it != errorMessage_.end()  )
+		return (*it).second;
+	else
+		return errorMessage_ [ UNKNOWN_ERROR_TYPE ];
+}
+
+void
+TeErrorLog::insert ( TeErrorType code, const string& msg )
+{
+	// create a new logfile, if needed
+	if ( logFile_  == 0 )
+		//logFile_ = new TeAsciiFile ( "terralib.err", "rw" );
+		return;
+
+	string log = errorMessage_ [ code ] + " " + msg;
+	logFile_->writeString ( log );
+  logFile_->writeNewLine();
+
+	// increment the count associated to this error type
+	map<TeErrorType, int>::iterator it = errorLog_.find( code );
+	if ( it == errorLog_.end() )
+		errorLog_[ code ] = 1;
+	else
+	{ 
+		int count = (*it).second;
+		errorLog_[ code ] = ++count;
+	}
+}
+
+
+void 
+TeErrorLog::startSession ( const string& errLogFileName)
+{
+  endSession();
+  
+	// create a new logfile
+	logFile_ = new TeAsciiFile ( errLogFileName, "w+" );
+  
+  if( logFile_ == 0 ) {
+    throw TeException( UNKNOWN_ERROR_TYPE, "Unable to create log file", 
+      false );
+  }
+}
+
+int
+TeErrorLog::endSession ()
+{
+  if( logFile_ == 0 ) {
+    errorLog_.clear ();
+    return 0;
+  }
+
+	int numerr =  errorLog_.size();
+
+	// increment the count associated to this error type
+	map<TeErrorType, int>::iterator it = errorLog_.begin();
+
+	while ( it != errorLog_.end() )
+	{
+		int count = (*it).second;
+		string log = "Number of Error of Type " + errorMessage_ [ (*it).first ] 
+			+ " = " + Te2String ( count );
+		logFile_->writeString ( log );
+    logFile_->writeNewLine();
+    
+    ++it;
+	}
+
+	// close the log file
+	delete logFile_;
+  logFile_ = 0;
+
+	// clear the stack
+	errorLog_.clear ();
+
+  return numerr;
+}
+ 
+ 
diff --git a/src/terralib/kernel/TeErrorLog.h b/src/terralib/kernel/TeErrorLog.h
old mode 100755
new mode 100644
index 53bc89a..3a39ef6
--- a/src/terralib/kernel/TeErrorLog.h
+++ b/src/terralib/kernel/TeErrorLog.h
@@ -1,142 +1,142 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeErrorLog.h
-    \brief This file deals log of errors in TerraLib
-*/
-#ifndef  __TERRALIB_INTERNAL_ERRORLOG_H
-#define  __TERRALIB_INTERNAL_ERRORLOG_H
-
-#include "TeSingleton.h"
-
-#include <string>
-#include <stack>
-#include <map>
-using namespace std;
-
-class TeAsciiFile;
-
-enum TeErrorType
-{
-
-	// Generic message inserted to log file
-	LOG_MESSAGE,
-
-	// Errors associated to files
-	EMPTY_FILE_NAME,
-	CANNOT_OPEN_FILE,
-    CANNOT_READ_FILE,
-    CANNOT_WRITE_FILE,
-    CANNOT_CLOSE_FILE,
-    END_OF_FILE_REACHED,
-
-	// Errors associated with projection
-    DATUM_ERROR,
-    PROJECTION_NOT_AVAILABLE,
-
-// Error codes for MIF files
-    NOT_MIF_FILE,
-    MIF_REGION_CLOSE,
-    MIF_CONVERSION_ERROR,
-    NOT_CSV,
-    NOT_ENOUGH_ROWS,
-    NOT_POLYGON_FILE,
-    PLINE_ERROR,
-    NO_DTM_QUOTE_VALUE,
-
-// Error Codes for shapefiles
-    POLYSHAPE_IS_NOT_RING,
-    UNHANDLED_SHP_TYPE,
-
-// Error Codes for DBF files
-
-    UNABLE_TO_OPEN_DBF_FILE,
-    NO_DATA_IN_DBF_FILE,
-    ATTRIBUTE_INDEX_MISMATCH,
-
-	// Error codes for E00 Files
-    NOT_E00_FILE,
-
-	// Error codes for algorithms
-    CENTROID_NOT_FOUND,
-    REGIONS_WITH_HOLES,
-    LINE_IS_NOT_RING,
-
-	// Error codes for tables
-
-    ROW_MISMATCH,
-    NO_SUCH_ATTRIBUTE,
-
-	// Error codes for Raster stuff
-    UNKNOWN_DECODER_TECHNOLOGY_TYPE,
-    UNKNOWN_RASTER_FORMAT,
-
-	// Layer stuff
-	GEOMETRY_REPRESENTATION_MISMATCH,
-  
-  // TeFactory related errors
-  FACTORY_PRODUCT_INSTATIATION_ERROR,
-
-	// Other
-	UNKNOWN_ERROR_TYPE
-};
-
-typedef map<TeErrorType, string> TeErrorTypeMap;
-
-typedef map<TeErrorType, int> TeErrorLogMap;
-
-//! Describes a class for describing error logging in TerraLib
-/*!
-	All errors in TerraLib may be  logged into an error file. 
-	The error logging facilities include the notion of a 
-	session, using the "start" and "end" methods, of a 
-	dump method for acessing the contenst
-
-\sa TeException, TeSingleton
-*/
-class TL_DLL TeErrorLog: public TeSingleton<TeErrorLog>
-{
-public:
-	TeErrorLog();
-
-	~TeErrorLog();
-	
-	string message(const TeErrorType code);
-	
-	virtual void insert ( TeErrorType code, const string& msg = "" );
-
-	virtual void startSession ( const string& errLogFileName = "terralib.err");
-
-	virtual int endSession ();
-
-private:
-		
-    TeAsciiFile* logFile_;
-
-	TeErrorLogMap errorLog_;
-
-	TeErrorTypeMap  errorMessage_;
-};
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeErrorLog.h
+    \brief This file deals log of errors in TerraLib
+*/
+#ifndef  __TERRALIB_INTERNAL_ERRORLOG_H
+#define  __TERRALIB_INTERNAL_ERRORLOG_H
+
+#include "TeSingleton.h"
+
+#include <string>
+#include <stack>
+#include <map>
+using namespace std;
+
+class TeAsciiFile;
+
+enum TeErrorType
+{
+
+	// Generic message inserted to log file
+	LOG_MESSAGE,
+
+	// Errors associated to files
+	EMPTY_FILE_NAME,
+	CANNOT_OPEN_FILE,
+    CANNOT_READ_FILE,
+    CANNOT_WRITE_FILE,
+    CANNOT_CLOSE_FILE,
+    END_OF_FILE_REACHED,
+
+	// Errors associated with projection
+    DATUM_ERROR,
+    PROJECTION_NOT_AVAILABLE,
+
+// Error codes for MIF files
+    NOT_MIF_FILE,
+    MIF_REGION_CLOSE,
+    MIF_CONVERSION_ERROR,
+    NOT_CSV,
+    NOT_ENOUGH_ROWS,
+    NOT_POLYGON_FILE,
+    PLINE_ERROR,
+    NO_DTM_QUOTE_VALUE,
+
+// Error Codes for shapefiles
+    POLYSHAPE_IS_NOT_RING,
+    UNHANDLED_SHP_TYPE,
+
+// Error Codes for DBF files
+
+    UNABLE_TO_OPEN_DBF_FILE,
+    NO_DATA_IN_DBF_FILE,
+    ATTRIBUTE_INDEX_MISMATCH,
+
+	// Error codes for E00 Files
+    NOT_E00_FILE,
+
+	// Error codes for algorithms
+    CENTROID_NOT_FOUND,
+    REGIONS_WITH_HOLES,
+    LINE_IS_NOT_RING,
+
+	// Error codes for tables
+
+    ROW_MISMATCH,
+    NO_SUCH_ATTRIBUTE,
+
+	// Error codes for Raster stuff
+    UNKNOWN_DECODER_TECHNOLOGY_TYPE,
+    UNKNOWN_RASTER_FORMAT,
+
+	// Layer stuff
+	GEOMETRY_REPRESENTATION_MISMATCH,
+  
+  // TeFactory related errors
+  FACTORY_PRODUCT_INSTATIATION_ERROR,
+
+	// Other
+	UNKNOWN_ERROR_TYPE
+};
+
+typedef map<TeErrorType, string> TeErrorTypeMap;
+
+typedef map<TeErrorType, int> TeErrorLogMap;
+
+//! Describes a class for describing error logging in TerraLib
+/*!
+	All errors in TerraLib may be  logged into an error file. 
+	The error logging facilities include the notion of a 
+	session, using the "start" and "end" methods, of a 
+	dump method for acessing the contenst
+
+\sa TeException, TeSingleton
+*/
+class TL_DLL TeErrorLog: public TeSingleton<TeErrorLog>
+{
+public:
+	TeErrorLog();
+
+	~TeErrorLog();
+	
+	string message(const TeErrorType code);
+	
+	virtual void insert ( TeErrorType code, const string& msg = "" );
+
+	virtual void startSession ( const string& errLogFileName = "terralib.err");
+
+	virtual int endSession ();
+
+private:
+		
+    TeAsciiFile* logFile_;
+
+	TeErrorLogMap errorLog_;
+
+	TeErrorTypeMap  errorMessage_;
+};
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeErrorMessage.cpp b/src/terralib/kernel/TeErrorMessage.cpp
old mode 100755
new mode 100644
index 2916e6d..1091eed
--- a/src/terralib/kernel/TeErrorMessage.cpp
+++ b/src/terralib/kernel/TeErrorMessage.cpp
@@ -1,33 +1,33 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeErrorMessage.h"
-#include <map>
-using namespace std;
-static map<string, string> errorMessage_;
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeErrorMessage.h"
+#include <map>
+using namespace std;
+static map<string, string> errorMessage_;
+
+
diff --git a/src/terralib/kernel/TeErrorMessage.h b/src/terralib/kernel/TeErrorMessage.h
old mode 100755
new mode 100644
index 9aaf752..e2c4eb9
--- a/src/terralib/kernel/TeErrorMessage.h
+++ b/src/terralib/kernel/TeErrorMessage.h
@@ -1,110 +1,110 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeErrorMessage.h
-    \brief This file contains some definitions issuing error messages to the user
-*/
-#ifndef TeErrorMessage_H
-#define TeErrorMessage_H
-
-#include <string>
-using namespace std;
-
-#include "TePrototype.h"
-#include "TeSingleton.h"
-
-/*!
-\enum TeMessageType 
-
-Te_ABORTRETRYIGNORE   
-	The message box contains three pushbuttons: Abort, Retry, and Ignore.
-Te_OK   The message box contains one pushbutton: OK.
-Te_OKCANCEL   The message box contains two pushbuttons: OK and Cancel.
-Te_RETRYCANCEL   The message box contains two pushbuttons: Retry and Cancel.
-Te_YESNO   The message box contains two pushbuttons: Yes and No.
-Te_YESNOCANCEL   The message box contains three pushbuttons: Yes, No, and Cancel. 
-
----*/
-enum TeMessageType
-{ Te_ABORTRETRYIGNORE, Te_OK, Te_OKCANCEL, Te_RETRYCANCEL, Te_YESNO, Te_YESNOCANCEL };
-
-  
-/*!
-\enum TeMessageIcon
-
-Te_ICONEXCLAMATION   An exclamation-point icon appears in the message box.
-Te_ICONINFORMATION   An icon consisting of an �i� in a circle appears in the message box.
-Te_ICONQUESTION   A question-mark icon appears in the message box.
-Te_ICONSTOP   A stop-sign icon appears in the message box. 
------*/
-  
-enum TeMessageIcon
-{	Te_ICONEXCLAMATION, Te_ICONINFORMATION, Te_ICONQUESTION, Te_ICONSTOP };
-
-/*---------
-Return Value
-
-Zero if there is not enough memory to display the message box; 
-otherwise one of the following values is returned: 
-
-Te_IDABORT   The Abort button was selected.
-Te_IDCANCEL   The Cancel button was selected.
-Te_IDIGNORE   The Ignore button was selected.
-Te_IDNO   The No button was selected.
-Te_IDOK   The OK button was selected.
-Te_IDRETRY   The Retry button was selected.
-Te_IDYES   The Yes button was selected. 
-
-----*/
-
-enum TeMessageReturn
-{ Te_IDABORT, Te_IDCANCEL, Te_IDIGNORE, Te_IDNO, Te_IDOK, Te_IDRETRY, Te_IDYES };
-
-//!  Provides a convenience class for issuing error messages to the user
-/*
-	  Based on a configuration parameter, provide implementations
-	  for console (stdio), MFC and QT
-  
-	  \sa TeException 
-*/
-class TL_DLL TeErrorMessage
-{
-public:
-	//! Constructor
-	TeErrorMessage(){}
-
-	virtual ~TeErrorMessage(){}
-
-	virtual TeMessageReturn apply ( 
-				  const string& appName, 
-				  const string & msgText, 
-				  TeMessageType	msgType,
-				  TeMessageIcon iconType ) = 0; 
-};
-
-class TL_DLL TeErrorMessagePrototype: public TePrototype<TeErrorMessage>
-{
-	virtual TeErrorMessage* build() = 0;
-};
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeErrorMessage.h
+    \brief This file contains some definitions issuing error messages to the user
+*/
+#ifndef TeErrorMessage_H
+#define TeErrorMessage_H
+
+#include <string>
+using namespace std;
+
+#include "TePrototype.h"
+#include "TeSingleton.h"
+
+/*!
+\enum TeMessageType 
+
+Te_ABORTRETRYIGNORE   
+	The message box contains three pushbuttons: Abort, Retry, and Ignore.
+Te_OK   The message box contains one pushbutton: OK.
+Te_OKCANCEL   The message box contains two pushbuttons: OK and Cancel.
+Te_RETRYCANCEL   The message box contains two pushbuttons: Retry and Cancel.
+Te_YESNO   The message box contains two pushbuttons: Yes and No.
+Te_YESNOCANCEL   The message box contains three pushbuttons: Yes, No, and Cancel. 
+
+---*/
+enum TeMessageType
+{ Te_ABORTRETRYIGNORE, Te_OK, Te_OKCANCEL, Te_RETRYCANCEL, Te_YESNO, Te_YESNOCANCEL };
+
+  
+/*!
+\enum TeMessageIcon
+
+Te_ICONEXCLAMATION   An exclamation-point icon appears in the message box.
+Te_ICONINFORMATION   An icon consisting of an �i� in a circle appears in the message box.
+Te_ICONQUESTION   A question-mark icon appears in the message box.
+Te_ICONSTOP   A stop-sign icon appears in the message box. 
+-----*/
+  
+enum TeMessageIcon
+{	Te_ICONEXCLAMATION, Te_ICONINFORMATION, Te_ICONQUESTION, Te_ICONSTOP };
+
+/*---------
+Return Value
+
+Zero if there is not enough memory to display the message box; 
+otherwise one of the following values is returned: 
+
+Te_IDABORT   The Abort button was selected.
+Te_IDCANCEL   The Cancel button was selected.
+Te_IDIGNORE   The Ignore button was selected.
+Te_IDNO   The No button was selected.
+Te_IDOK   The OK button was selected.
+Te_IDRETRY   The Retry button was selected.
+Te_IDYES   The Yes button was selected. 
+
+----*/
+
+enum TeMessageReturn
+{ Te_IDABORT, Te_IDCANCEL, Te_IDIGNORE, Te_IDNO, Te_IDOK, Te_IDRETRY, Te_IDYES };
+
+//!  Provides a convenience class for issuing error messages to the user
+/*
+	  Based on a configuration parameter, provide implementations
+	  for console (stdio), MFC and QT
+  
+	  \sa TeException 
+*/
+class TL_DLL TeErrorMessage
+{
+public:
+	//! Constructor
+	TeErrorMessage(){}
+
+	virtual ~TeErrorMessage(){}
+
+	virtual TeMessageReturn apply ( 
+				  const string& appName, 
+				  const string & msgText, 
+				  TeMessageType	msgType,
+				  TeMessageIcon iconType ) = 0; 
+};
+
+class TL_DLL TeErrorMessagePrototype: public TePrototype<TeErrorMessage>
+{
+	virtual TeErrorMessage* build() = 0;
+};
+
+#endif
+
diff --git a/src/terralib/kernel/TeException.cpp b/src/terralib/kernel/TeException.cpp
old mode 100755
new mode 100644
index 82e4021..a3befc7
--- a/src/terralib/kernel/TeException.cpp
+++ b/src/terralib/kernel/TeException.cpp
@@ -1,52 +1,52 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeException.h"
-#include "TeErrorLog.h"
-#include <cstring>
-#include <errno.h>
-
-TeException::TeException ( TeErrorType msgCode, const string& userText, bool haserrno ):
-		userText_ ( userText )
-{			
-		if ( haserrno )
-			userText_ = userText + " " + strerror ( errno );
-		
-		TeErrorLog::instance().insert( msgCode, userText_ );
-}
-
-string 
-TeException::message() const
-{
-	return TeErrorLog::instance().message ( msgCode_ ) + " " + userText_;
-}
-
-TeErrorType
-TeException::code () const
-{
-	return msgCode_;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeException.h"
+#include "TeErrorLog.h"
+#include <cstring>
+#include <errno.h>
+
+TeException::TeException ( TeErrorType msgCode, const string& userText, bool haserrno ):
+		userText_ ( userText )
+{			
+		if ( haserrno )
+			userText_ = userText + " " + strerror ( errno );
+		
+		TeErrorLog::instance().insert( msgCode, userText_ );
+}
+
+string 
+TeException::message() const
+{
+	return TeErrorLog::instance().message ( msgCode_ ) + " " + userText_;
+}
+
+TeErrorType
+TeException::code () const
+{
+	return msgCode_;
+}
diff --git a/src/terralib/kernel/TeException.h b/src/terralib/kernel/TeException.h
old mode 100755
new mode 100644
index ea5dad2..d883f72
--- a/src/terralib/kernel/TeException.h
+++ b/src/terralib/kernel/TeException.h
@@ -1,72 +1,72 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeException.h
-    \brief This file deals Eexception throwing in TerraLib
-*/
-#ifndef  __TERRALIB_INTERNAL_EXCEPTION_H
-#define  __TERRALIB_INTERNAL_EXCEPTION_H
-
-#ifdef WIN32
-#pragma warning ( disable: 4355 )
-#endif
-
-#include "TeSingleton.h"
-#include "TeErrorLog.h"
-
-#include <string>
-#include <map>
-using namespace std;
-
-
-//!  Provides a class for handling exceptions on Terralib
-class TL_DLL TeException {
-public:
-
-// -- Contructors
-	
-	TeException ( TeErrorType msgCode, const string& userText = "", bool hasErrno = false );
-
-// -- Destructor
-
-	virtual ~TeException() {}  // base class
-
-// --  Members
-
-	string			message () const;
-	TeErrorType	    code() const;
-	
-protected:
-	
-// -- Members
-
-//! code associated with TeException
-	TeErrorType 	msgCode_;   
-
-//! message associated with TeException
-	string			userText_;
-
-private:
-
-};
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeException.h
+    \brief This file deals Eexception throwing in TerraLib
+*/
+#ifndef  __TERRALIB_INTERNAL_EXCEPTION_H
+#define  __TERRALIB_INTERNAL_EXCEPTION_H
+
+#ifdef WIN32
+#pragma warning ( disable: 4355 )
+#endif
+
+#include "TeSingleton.h"
+#include "TeErrorLog.h"
+
+#include <string>
+#include <map>
+using namespace std;
+
+
+//!  Provides a class for handling exceptions on Terralib
+class TL_DLL TeException {
+public:
+
+// -- Contructors
+	
+	TeException ( TeErrorType msgCode, const string& userText = "", bool hasErrno = false );
+
+// -- Destructor
+
+	virtual ~TeException() {}  // base class
+
+// --  Members
+
+	string			message () const;
+	TeErrorType	    code() const;
+	
+protected:
+	
+// -- Members
+
+//! code associated with TeException
+	TeErrorType 	msgCode_;   
+
+//! message associated with TeException
+	string			userText_;
+
+private:
+
+};
+#endif
+
diff --git a/src/terralib/kernel/TeExternalTheme.cpp b/src/terralib/kernel/TeExternalTheme.cpp
index 4fc5157..c783c57 100644
--- a/src/terralib/kernel/TeExternalTheme.cpp
+++ b/src/terralib/kernel/TeExternalTheme.cpp
@@ -1,1486 +1,1508 @@
-#include "TeExternalTheme.h"
-#include "TeLayer.h"
-#include "TeDatabase.h"
-#include "TeDatabaseFactoryParams.h"
-#include "TeDBConnectionsPool.h"
-#include "TeGroupingAlgorithms.h"
-#include "TeQuerier.h"
-#include "TeQuerierParams.h"
-#include "TeRasterTransform.h"
-
-
-TeExternalTheme::TeExternalTheme(TeDatabase* sourceDb, TeTheme* remoteTheme, const int& viewId, 
-                                 const string& name) :
-TeTheme(name, 0, 0, viewId),
-remoteTheme_(NULL),
-sourceDB_(sourceDb),
-remoteDbId_(-1)
-{
-    type(TeEXTERNALTHEME);
-
-    if(remoteTheme != NULL)
-    {
-        setRemoteTheme(remoteTheme);
-    }
-}
-
-TeExternalTheme::~TeExternalTheme()
-{
-    if(remoteTheme_ != NULL)
-    {
-        delete remoteTheme_;
-    }
-}
-
-TeExternalTheme& TeExternalTheme::operator=(TeExternalTheme& rhs)
-{
-	*(TeTheme*)this = rhs;
-	remoteTheme_ = rhs.remoteTheme_;
-
-    return *this;
-}
-
-TeTheme* 
-TeExternalTheme::getRemoteTheme() const
-{
-	return remoteTheme_;
-}
-
-void TeExternalTheme::setRemoteTheme(TeTheme* theme)
-{
-    remoteTheme_ = new TeTheme(*theme);
-    TeLayer* remoteLayer = new TeLayer(*theme->layer());
-
-    grouping_ = remoteTheme_->grouping();
-
-    remoteTheme_->layer(remoteLayer);
-    remoteDbId_ = TeDBConnectionsPool::instance().getDatabaseIdx(remoteLayer->database());
-}
-
-TeDatabase* TeExternalTheme::getSourceDatabase()
-{
-    return sourceDB_;
-}
-
-void TeExternalTheme::setSourceDatabase(TeDatabase* srcDB)
-{
-	sourceDB_ = srcDB;
-}
-
-string 
-TeExternalTheme::getRemoteThemeName()
-{ 
-	return remoteTheme_->name();
-}
-
-void 
-TeExternalTheme::loadObjectLegendMap()
-{
-	objLegendMap_.clear();
-	objOwnLegendMap_.clear();
-	objStatusMap_.clear();
-	itemStatusMap_.clear();
-
-	TeDatabasePortal* portal = sourceDB_->getPortal();
-
-	if(!portal->query("SELECT c_object_id, c_legend_id, c_legend_own, c_object_status FROM " + collectionTable()))
-		return;
-
-	while(portal->fetchRow())
-	{
-		string objId = portal->getData(0);
-		int status = portal->getInt(3);
-		if(portal->getInt(1) != 0)
-			objLegendMap_[portal->getData(0)] = portal->getInt(1);
-		if(portal->getInt(2) != 0)
-			objOwnLegendMap_[portal->getData(0)] = portal->getInt(2);
-		if(status != 0)
-			objStatusMap_[objId] = status;
-	}
-
-	portal->freeResult();
-
-	if(!portal->query("SELECT object_id, unique_id, grid_status FROM " + collectionAuxTable()))
-		return;
-	
-	while(portal->fetchRow())
-	{
-		if(portal->getInt(2) != 0)
-		{
-			itemStatusMap_[portal->getData(1)] = portal->getInt(2);
-		}
-	}
-
-	portal->freeResult();
-	delete portal;
-}
-
-int 
-TeExternalTheme::getGridStatus(const int uniqueId, const std::string /* objectId */)
-{
-	string aux = Te2String(uniqueId);
-	std::map<std::string, int >::iterator itGridStatus = itemStatusMap_.find(aux);
-	if(itGridStatus == itemStatusMap_.end())
-		return 0;
-	return itGridStatus->second;
-}
-		
-int 
-TeExternalTheme::getObjectStatus(const std::string objectId)
-{
-	std::map<std::string, int>::iterator it = objStatusMap_.find(objectId);
-	if(it == objStatusMap_.end())
-		return 0;
-	
-	return it->second;
-}
-
-bool 
-TeExternalTheme::setObjectLegendStatusMap(const std::string objId, const int status)
-{
-	if(objId.empty())
-		return false;
-	
-	if( status == 0)
-	{
-		map<std::string, int>::iterator itLegStatus = objStatusMap_.find(objId);
-
-		if(itLegStatus != objStatusMap_.end())
-		{
-			objStatusMap_.erase(itLegStatus);
-			return true;
-		}
-		return false;
-	}
-	
-	objStatusMap_[objId] = status;
-
-	return true;
-}
-
-bool 
-TeExternalTheme::setObjectGridStatusMap(const std::string objId, const int uniqueId, const int status)
-{
-	string aux = Te2String(uniqueId);
-	if(objId.empty() || aux.empty())
-		return false;
-	
-	if( status == 0 )
-	{
-		std::map<std::string, int >::iterator itGridStatus = itemStatusMap_.find(aux);
-
-		if(itGridStatus != itemStatusMap_.end())
-		{
-			itemStatusMap_.erase(itGridStatus);
-			return true;
-		}
-		return false;
-	}
-	
-	itemStatusMap_[aux] = status;
-
-	return true;
-}
-
-int 
-TeExternalTheme::layerId()
-{
-	return -1;
-}
-
-void 
-TeExternalTheme::layerId(int)
-{
-}
-
-void 
-TeExternalTheme::layer(TeLayer* layer)
-{
-	if(remoteTheme_)
-		remoteTheme_->layer(layer);
-}
-
-TeLayer*  
-TeExternalTheme::layer()
-{
-	if(remoteTheme_)
-		return remoteTheme_->layer();
-	return 0;
-}
-
-TeProjection* 
-TeExternalTheme::getThemeProjection()
-{
-	if(remoteTheme_ && remoteTheme_->layer())
-		return remoteTheme_->layer()->projection();
-	return 0;
-}
-
-bool 
-TeExternalTheme::hasRestriction()
-{
-	return false;
-}
-
-bool TeExternalTheme::hasAttrRest()
-{
-	return false;
-}
-
-bool TeExternalTheme::hasTemporalRest()
-{
-	return false;
-}
-
-bool TeExternalTheme::hasSpatialRest()
-{
-	return false;
-}
-
-string TeExternalTheme::sqlWhereRestrictions(TeRepresentation* /* rep */)
-{
-	return string("");
-}
-
-void TeExternalTheme::loadTablesJoin(const string& geomTable)
-{
-	remoteTheme_->loadTablesJoin(geomTable);
-}
-
-string TeExternalTheme::sqlGridJoin()
-{
-	return remoteTheme_->sqlGridJoin();
-}
-
-string TeExternalTheme::sqlGridFrom(const string& geomTable)
-{
-	return remoteTheme_->sqlGridFrom(geomTable);
-}
-
-bool TeExternalTheme::save(TeDatabase* db, const bool& copyExternalCollection)  
-{
-	if(!db)
-		return false;
-
-	//insert theme in database 
-	//TeDatabase::insertTheme and TeDatabase::updateTheme use the method saveMetadata
-	if(id()==0)
-	{
-		if(!db->insertTheme(this)) //updateThemeTable
-		{
-			db->deleteTheme(this->id());
-			return false;
-		}
-	}
-	else
-	{
-		if(!db->updateTheme(this)) //updateThemeTable
-		{
-			db->deleteTheme(this->id());
-			return false;
-		}
-	}
-	
-    if(copyExternalCollection)
-    {
-	//collection table 
-	    if(collectionTable().empty())
-		    collectionTable("te_collection_"+ Te2String(id())); 
-
-	    if(!db->createCollectionTable(collectionTable_))
-	    {
-		    db->deleteTheme(this->id());
-		    return false;
-	    }
-
-	    //collection aux table
-	    collectionAuxTable(collectionTable() + "_aux");
-    	
-	    if(!TeTheme::createCollectionAuxTable(db))
-	    {
-		    db->deleteTheme(this->id());
-		    return false;
-	    }
-    }
-
-	return true;
-}
-
-bool TeExternalTheme::save(const bool& copyExternalCollection)
-{
-	if(!save(sourceDB_, copyExternalCollection))
-		return false;
-	
-	// a map to identify legends id between local theme and remote theme during copy.
-	std::map<int, int> mapIdLegend;	
-
-    if(copyExternalCollection)
-    {
-	    createLegendMapId(mapIdLegend);
-
-	    if(!mapIdLegend.empty())
-		    copyRemoteCollection(mapIdLegend);
-    	
-	    mapIdLegend.clear();
-
-	    loadObjectLegendMap();
-    }
-
-	return true;
-}
-
-bool TeExternalTheme::createCollectionAuxTable()
-{
-	return TeTheme::createCollectionAuxTable(sourceDB_);
-}
-
-bool TeExternalTheme::populateCollectionAux(std::string /* objectId */)
-{
-	throw;
-	return false;
-}
-
-bool TeExternalTheme::buildGrouping(const TeGrouping& g, TeSelectedObjects /* selectedObjects */,
-				                  vector<double>* dValuesVec)
-{
-	TeDatabase* db = remoteTheme_->layer()->database();
-	if(!db)
-		return false;
-	
-	grouping_ = g;
-	unsigned int i;
-	vector<TeSlice> slices;
-	int	nullValues = 0;
-	if (grouping_.groupMode_ == TeRasterSlicing)
-	{
-		int b = atoi(grouping_.groupAttribute_.name_.c_str());
-		if (!remoteTheme_->layer()->raster() ||  
-			b < 0 ||
-			b > remoteTheme_->layer()->raster()->params().nBands() ||
-			grouping_.groupNumSlices_ <= 0)
-			return false;
-
-		if (grouping_.groupMaxVal_ == TeMINFLOAT)
-			grouping_.groupMaxVal_ = remoteTheme_->layer()->raster()->params().vmax_[b];
-
-		if (grouping_.groupMinVal_ == TeMAXFLOAT)
-			grouping_.groupMinVal_ = remoteTheme_->layer()->raster()->params().vmin_[b];
-
-		TeGroupByEqualStep(grouping_.groupMinVal_, grouping_.groupMaxVal_,
-			grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-	}
-	else
-	{
-        if(grouping_.groupAttribute_.name_.empty())
-			return false;
-
-		TeDatabasePortal* portal = db->getPortal();
-		string query;
-		bool normal = false;
-		string aggrFunc = "";
-		if(grouping_.groupFunction_.empty())
-			aggrFunc = " MIN";
-		else
-			aggrFunc = grouping_.groupFunction_;
-
-		if(grouping_.groupNormAttribute_.empty())
-		{
-			query = " SELECT "+ aggrFunc +"("+ grouping_.groupAttribute_.name_ +")";  
-		}
-		else
-		{
-			query = " SELECT "+ aggrFunc +"("+ grouping_.groupAttribute_.name_ +") / "+ aggrFunc +"("+ grouping_.groupNormAttribute_ + ")";
-			normal = true;
-		}
-		query += sqlGridFrom(); 
-		query += " GROUP BY " + remoteTheme_->collectionTable() + ".c_object_id";
-		if(!portal->query(query) || !portal->fetchRow())
-		{
-			delete portal;
-			return false;
-		}
-		vector<double> dValues;  //inputvect
-		vector<string> sValues;	//svec
-		double mean, sum; 
-		mean = sum = 0.;
-		do  
-		{
-			string val = portal->getData(0);
-			string valNorm = Te2String(atof(val.c_str()), grouping_.groupPrecision_);
-
-			if (!val.empty())
-			{
-				if(grouping_.groupMode_== TeUniqueValue)
-				{
-					if(normal)
-						sValues.push_back(valNorm);
-					else
-						sValues.push_back(val);
-				}
-				else
-				{
-					dValues.push_back(atof(valNorm.c_str()));
-					sum += atof(valNorm.c_str());
-				}
-
-			}
-			else
-				nullValues++;
-		}while(portal->fetchRow());
-		
-		delete portal;
-		
-		if(dValues.empty() && sValues.empty())
-			return false;
-
-		if(grouping_.groupMode_== TeEqualSteps)
-			TeGroupByEqualStep(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-		else if(grouping_.groupMode_== TeQuantil)
-			TeGroupByQuantil(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-		else if(grouping_.groupMode_== TeStdDeviation)
-		{
-			string m = Te2String(mean);
-			TeGroupByStdDev(dValues.begin(), dValues.end(), grouping_.groupStdDev_, slices, m, grouping_.groupPrecision_);
-		}
-		else if(grouping_.groupMode_== TeUniqueValue)
-		{
-			if(grouping_.groupFunction_ == "COUNT")
-				TeGroupByUniqueValue(sValues, TeINT, slices, grouping_.groupPrecision_);
-			else
-				TeGroupByUniqueValue(sValues, grouping_.groupAttribute_.type_, slices, grouping_.groupPrecision_);
-		}
-
-		if (dValuesVec)
-		{
-			for (i = 0; i < dValues.size(); ++i)
-				dValuesVec->push_back(dValues[i]);
-		}
-	}
-	if(grouping_.groupNullAttr_ && nullValues > 0)
-	{
-		TeSlice ps;
-		ps.count_ = nullValues;
-		ps.from_ = "Missing Data";
-		slices.push_back(ps);
-		grouping_.groupNumSlices_ = slices.size() - 1;
-	}
-	else
-		grouping_.groupNumSlices_ = slices.size();
-
-	legend_.clear(); 
-	for(i=0; i<slices.size(); ++i)
-	{
-		TeLegendEntry legend(slices[i]);
-		legend.group(i);
-		legend.theme(id());
-		legend_.push_back(legend);
-	}
-	return true;
-}
-
-bool TeExternalTheme::buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec)
-{
-	TeDatabase* db = remoteTheme_->layer()->database();
-
-	if(!db || chr == TeNOCHRONON)
-		return false;
-
-	grouping_ = g;
-
-	unsigned int i;
-	vector<TeSlice> slices;
-	vector<double> dValues;  //inputvect
-	vector<string> sValues;	//svec
-	double mean, sum; 
-	mean = sum = 0.;
-	int	nullValues = 0;
-	string val;
-
-	if (grouping_.groupMode_ == TeRasterSlicing)
-	{
-		int b = atoi(grouping_.groupAttribute_.name_.c_str());
-		if (!remoteTheme_->layer()->raster() ||  
-			b < 0 ||
-			b > remoteTheme_->layer()->raster()->params().nBands() ||
-			grouping_.groupNumSlices_ <= 0)
-			return false;
-
-		if (grouping_.groupMaxVal_ == TeMINFLOAT)
-			grouping_.groupMaxVal_ = remoteTheme_->layer()->raster()->params().vmax_[b];
-
-		if (grouping_.groupMinVal_ == TeMAXFLOAT)
-			grouping_.groupMinVal_ = remoteTheme_->layer()->raster()->params().vmin_[b];
-
-		TeGroupByEqualStep(grouping_.groupMinVal_, grouping_.groupMaxVal_,
-			grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-	}
-	else
-	{
-		string func;
-		TeStatisticType statType = TeNOSTATISTIC;
-		if (grouping_.groupMode_ == TeUniqueValue && grouping_.groupAttribute_.type_ == TeSTRING)
-			func = "MIN";
-		else
-			func = grouping_.groupFunction_;
-
-		if (func == "MIN")
-			statType = TeMINVALUE;
-		else if (func == "MAX")
-			statType = TeMAXVALUE;
-		else if (func == "MEAN")
-			statType = TeMEAN;
-		else if (func == "SUM")
-			statType = TeSUM;
-		else if (func == "COUNT")
-			statType = TeCOUNT;
-
-		// Set the flag that indicates the geometries must not be loaded
-		bool loadGeometries = false;
-
-		// Insert the attributes in a multimap that relates the attribute 
-		// representation and its statistic type
-		TeGroupingAttr attrMMap;
-		pair<TeAttributeRep, TeStatisticType> attr1 (
-			TeAttributeRep(grouping_.groupAttribute_), statType);
-		attrMMap.push_back(attr1);
-
-		// Set querier parameters
-		TeQuerierParams querierParams(loadGeometries, attrMMap);
-		querierParams.setParams(this, chr);
-
-		TeQuerier querier(querierParams);
-
-		// Load instances based on the querier parameters given
-		int numFrames = querier.getNumTimeFrames();
-		TeSTInstance sti;
-		string objId;
-		TePropertyVector vec;
-		mapObjValVec.resize(numFrames);
-
-		for (int frame = 0; frame < numFrames; ++frame)
-		{
-			if (querier.loadInstances(frame) == false)
-				continue;
-
-			// Traverse all the instances
-			while(querier.fetchInstance(sti))
-			{
-				objId = sti.objectId();
-				vec = sti.getPropertyVector();
-				val = vec[0].value_;
-				dValues.push_back(atof(val.c_str()));
-				sValues.push_back(val);
-				map<string, string>& objValMap = mapObjValVec[frame];
-				objValMap.insert(make_pair(objId, val));
-			}
-		}
-
-		if(grouping_.groupMode_== TeEqualSteps)
-			TeGroupByEqualStep(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-		else if(grouping_.groupMode_== TeQuantil)
-			TeGroupByQuantil(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-		else if(grouping_.groupMode_== TeStdDeviation)
-		{
-			string m = Te2String(mean);
-			TeGroupByStdDev(dValues.begin(), dValues.end(), grouping_.groupStdDev_, slices, m, grouping_.groupPrecision_);
-		}
-		else if(grouping_.groupMode_== TeUniqueValue)
-		{
-			if(grouping_.groupFunction_ == "COUNT")
-				TeGroupByUniqueValue(sValues, TeINT, slices, grouping_.groupPrecision_);
-			else
-				TeGroupByUniqueValue(sValues, grouping_.groupAttribute_.type_, slices, grouping_.groupPrecision_);
-		}
-	}
-
-	if(grouping_.groupNullAttr_ && nullValues > 0)
-	{
-		TeSlice ps;
-		ps.count_ = nullValues;
-		ps.from_ = "Missing Data";
-		slices.push_back(ps);
-		grouping_.groupNumSlices_ = slices.size() - 1;
-	}
-	else
-		grouping_.groupNumSlices_ = slices.size();
-
-	legend_.clear(); 
-	for(i=0; i<slices.size(); ++i)
-	{
-		TeLegendEntry legend(slices[i]);
-		legend.group(i);
-		legend.theme(id());
-		legend_.push_back(legend);
-	}
-	
-	return true;
-}
-					
-bool TeExternalTheme::saveGrouping(TeSelectedObjects selectedObjects)
-{
-	return TeTheme::saveGrouping(sourceDB_, selectedObjects);
-}
-
-bool TeExternalTheme::saveLegendInCollection(TeSelectedObjects selectedObjects, std::string objectId)
-{
-	return saveLegendInCollection(sourceDB_, selectedObjects, objectId);
-}
-
-bool TeExternalTheme::saveLegendInCollection(TeDatabase* db, TeSelectedObjects /* selectedObjects */, std::string objectId)
-{
-	unsigned int i;
-	if(grouping_.groupMode_ == TeNoGrouping)
-		return false; 
-
-	TeAttrDataType		type = grouping_.groupAttribute_.type_;
-	TeLegendEntryVector legVec = legend_;
-	string			groupingAttr = grouping_.groupAttribute_.name_;
-
-	string collectionTableRemote = remoteTheme_->collectionTable();
-	string func;
-
-	if(grouping_.groupFunction_.empty())
-		func = " MIN";
-	else
-		func = grouping_.groupFunction_;
-
-	if(grouping_.groupFunction_ == "COUNT")
-		type = TeINT;
-
-	string query = "SELECT MIN(" + collectionTableRemote + ".c_object_id)";
-	if(grouping_.groupNormAttribute_.empty())
-		query += ", "+ func +"(" + groupingAttr + ")" + remoteTheme_->sqlGridFrom();
-	else
-		query += ", "+ func +"(" + groupingAttr + ") / "+ func +"(" + grouping_.groupNormAttribute_ + ")" + remoteTheme_->sqlGridFrom();
-	
-	query += " GROUP BY " + collectionTableRemote + ".c_object_id";
-
-	map<int, vector<string> > legMap;
-	
-	TeDatabasePortal* portal = remoteTheme_->layer()->database()->getPortal();
-	if(portal->query(query) == false)
-	{
-		delete portal;
-		return false;
-	}
-
-	vector<string> idVec;
-	vector<string> nullIdVec;
-	vector<string> valVec;
-	while(portal->fetchRow())
-	{
-		
-		string val = portal->getData(1);
-		string oid = portal->getData(0);
-		if (val.empty() == false)
-		{
-			idVec.push_back(oid);
-			valVec.push_back(val);
-		}
-		else
-			nullIdVec.push_back(oid);
-	}
-	if (grouping_.groupMode_ == TeUniqueValue)
-	{
-		unsigned int j = 0;
-		while( j < idVec.size())
-		{
-			string val = valVec[j];
-			string oid = idVec[j];
-			if(type == TeREAL)
-			{
-				double a = atof(val.c_str());
-				val = Te2String(a, grouping_.groupPrecision_);
-			}
-			else if(type == TeINT)
-			{
-				int a = atoi(val.c_str());
-				val = Te2String(a);
-			}
-				
-			unsigned int siz = legend_.size();
-			if(grouping_.groupNullAttr_ && nullIdVec.size() > 0)
-				--siz;
-			for(i=0; i < siz; i++)
-			{
-				TeLegendEntry& leg = legend_[i];
-				if(val == leg.from())
-				{
-					legMap[leg.id()].push_back(oid);
-					break;
-				}
-			}
-			j++;
-		}
-	}
-	else
-	{
-		unsigned int j = 0;
-		while(j < idVec.size())
-		{
-			string val = valVec[j];
-			string oid = idVec[j];
-			if(type == TeREAL)
-			{
-				double a = atof(val.c_str());
-				val = Te2String(a, grouping_.groupPrecision_);
-			}
-			
-			unsigned int siz = legend_.size();
-			if(grouping_.groupNullAttr_ && !nullIdVec.empty())
-               --siz; 
-			for(i=0; i < siz; i++)
-			{
-				TeLegendEntry& leg = legend_[i];
-				int f = leg.from().find("mean");
-				if(f >= 0)
-					continue;
-				double dval = atof(val.c_str());
-				double dfrom = atof(leg.from().c_str());
-				double dto = atof(leg.to().c_str());
-				if(i < legend_.size()-1)
-				{
-					if(dval >= dfrom && dval < dto)
-					{
-						legMap[leg.id()].push_back(oid);
-						break;
-					}
-				}
-				else
-				{
-					if(dval >= dfrom && dval <= dto)
-					{
-						legMap[leg.id()].push_back(oid);
-						break;
-					}
-				}
-			}
-			j++;
-		}
-	}
-	delete portal;
-
-	int legId = defaultLegend_.id();
-	if (grouping_.groupNullAttr_)
-		legId = legend_[legend_.size()-1].id();	
-	for(i = 0; i < nullIdVec.size(); ++i)
-	{
-		string oid = nullIdVec[i];
-		legMap[legId].push_back(oid);
-	}
-
-	vector<string> svec;
-	map<int, vector<string> > :: iterator it = legMap.begin();
-	while(it != legMap.end())
-	{
-    	// --- Generate In Clauses ----
-		unsigned int i, j, k, size, chunkSize = 200, nChunks;
-		string inClause;
-		size = it->second.size();
-		if (size % chunkSize)
-			nChunks = size / chunkSize + 1;
-		else
-			nChunks = size / chunkSize;
-
-		j = 0;		
-		for (k = 0; k < nChunks; ++k)
-		{
-			i = 0;
-			inClause = "(";
-			while (j < size && i < chunkSize)
-			{
-				inClause += "'" + db->escapeSequence(it->second[j]) + "',";
-				i++;
-				j++;
-			}
-			inClause[inClause.size() - 1] = ')';
-			svec.push_back(inClause);
-		}
-
-		//--- generateInClause
-
-		for(i=0; i<svec.size(); ++i)
-		{
-			string up = "UPDATE " + collectionTable_ + " SET c_legend_id = " + Te2String(it->first);
-			up += " WHERE c_object_id IN " + svec[i];
-			if (!objectId.empty())
-				up += " AND c_object_id='"+objectId+"'";
-			if(db->execute(up) == false)
-				continue;
-		}
-		it++;
-		svec.clear();
-	}
-	if(legend_.size())
-		visibleRep_ = visibleRep_ | 0x40000000;
-	else
-		visibleRep_ = visibleRep_ | 0xbfffffff;
-	string upVis = "UPDATE te_theme SET visible_rep=" + Te2String(visibleRep_) + " WHERE theme_id=" + Te2String(id());
-	
-	if(!db->execute(upVis))
-		return false;
-	
-	loadObjectLegendMap();
-
-	return true;
-}
-
-void TeExternalTheme::setLegendsForObjects()
-{
-}
-
-bool TeExternalTheme::generateLabelPositions(const std::string& /* objectId */)
-{
-	throw;
-	return false;
-}
-
-bool TeExternalTheme::deleteGrouping()
-{
-	if(!sourceDB_)
-		return false;
-
-	resetGrouping();
-	
-	//delete te_legend table
-	if(!sourceDB_->deleteLegend (this->id()))
-		return false;
-	
-	//delete te_grouping table
-	string sql = "DELETE FROM te_grouping WHERE theme_id= "+ Te2String(this->id());
-	sourceDB_->execute (sql);
-
-	return true;
-}
-
-void TeExternalTheme::createRasterVisual(TeRaster* rst)
-{
-	if (rasterVisual_)
-		delete rasterVisual_;
-
-	if (!rst)
-		rst = remoteTheme_->layer()->raster();
-
-	if (!rst)
-		return;
-
-	rasterVisual_ = new TeRasterTransform();
-										
-	if (rst->params().photometric_[0] == TeRasterParams::TePallete)  // raster palette -> uses its palette
-	{
-		rasterVisual_->setTransfFunction(&TeRasterTransform::Pallete2ThreeBand);
-		rasterVisual_->setLutSize(rst->params().lutr_.size());
-		return;
-	}
-
-	if (visibleRep_ & 0x40000000  &&		// sliced raster -> generate the
-		grouping_.groupMode_ == TeRasterSlicing)	// appropriate palette
-	{
-		int band = atoi(grouping_.groupAttribute_.name_.c_str());
-		rasterVisual_->setSrcBand(band);
-		if (rst->params().dataType_[band] != TeUNSIGNEDCHAR)
-			rasterVisual_->generateLUT(legend_, 1024, defaultLegend_.visual(TePOLYGONS)->color());
-		else
-			rasterVisual_->generateLUT(legend_, 256, defaultLegend_.visual(TePOLYGONS)->color());
-		rasterVisual_->setTransfFunction(&TeRasterTransform::LUT2ThreeBand);
-		return;
-	}
-
-	if (rst->params().dataType_[0] != TeUNSIGNEDCHAR)	// non unsigned char -> generate linear transformation
-		rasterVisual_->setLinearTransfParameters(rst->params().vmin_[0],rst->params().vmax_[0], 0, 255);
-
-	if (rst->params().nBands() == 1)				
-		rasterVisual_->setTransfFunction(&TeRasterTransform::Mono2ThreeBand);
-	else if (rst->params().nBands() == 3)
-		rasterVisual_->setTransfFunction(&TeRasterTransform::ThreeBand2RGB);
-	else
-		rasterVisual_->setTransfFunction(&TeRasterTransform::Band2Band);
-}
-
-bool TeExternalTheme::addThemeTable(TeTable& table)
-{
-	if( remoteTheme_ )
-		return remoteTheme_->addThemeTable(table);
-
-	return false;
-}
-
-void TeExternalTheme::addThemeTable(string tableName)
-{
-	if( remoteTheme_ )
-		return remoteTheme_->addThemeTable(tableName);
-
-	return;
-}
-
-bool TeExternalTheme::isThemeTable(int tableId)
-{
-	if( remoteTheme_ )
-		return remoteTheme_->isThemeTable(tableId);
-
-	return false;
-}
-
-bool TeExternalTheme::isThemeTable(string tableName)
-{
-	if( remoteTheme_ )
-		return remoteTheme_->isThemeTable(tableName);
-
-	return false;
-}
-
-TeAttrTableVector& TeExternalTheme::attrTables()
-{
-	if( remoteTheme_ )
-		return remoteTheme_->attrTables();
-	attTableVector_.clear();
-	return attTableVector_;
-}
-
-bool TeExternalTheme::setAttTables(TeAttrTableVector& attrs)
-{
-	if( remoteTheme_ )
-		return remoteTheme_->setAttTables(attrs);
-
-	return false;
-}
-
-bool TeExternalTheme::getAttTables(TeAttrTableVector& attrs, TeAttrTableType attType)
-{
-	if(remoteTheme_)
-		return remoteTheme_->getAttTables(attrs, attType);
-
-	return false;
-}
-
-bool TeExternalTheme::getTable(TeTable& table, const string tableName)
-{
-	if(remoteTheme_)
-		return remoteTheme_->getTable(table, tableName);
-
-	return false;
-}
-
-void TeExternalTheme::clearAttTableVector() 
-{
-	if(remoteTheme_)
-		remoteTheme_->clearAttTableVector();
-}
-
-bool TeExternalTheme::getTemporalTable(TeTable& table)
-{
-	if(remoteTheme_)
-		return remoteTheme_->getTemporalTable(table);
-
-	return false;
-}
-
-bool TeExternalTheme::removeThemeTable(unsigned int index)
-{
-	if(remoteTheme_)
-		return remoteTheme_->removeThemeTable(index);
-
-	return false;
-}
-
-string TeExternalTheme::getTableName(const string& attrName)
-{
-	if(remoteTheme_)
-		return remoteTheme_->getTableName(attrName);
-
-	return "";
-}
-
-string TeExternalTheme::getAttribute(unsigned int index)
-{
-	if(remoteTheme_)
-		return remoteTheme_->getAttribute(index);
-
-	return "";
-}
-
-
-bool TeExternalTheme::loadThemeTables()
-{
-	if(!remoteTheme_)
-		return false;
-
-	bool result = remoteTheme_->loadThemeTables();
-
-	if(result)
-	{
-		clearAttTableVector();
-		attrTables() = remoteTheme_->attrTables();
-	}
-
-	return result;
-}
-
-
-TeAttributeList TeExternalTheme::sqlAttList()
-{
-	if(remoteTheme_)
-		return remoteTheme_->sqlAttList();
-
-	return TeAttributeList();
-}
-
-void TeExternalTheme::clearAttList()
-{
-	if(remoteTheme_)
-		return remoteTheme_->clearAttList();
-}
-
-TeAttributeList TeExternalTheme::sqlNumAttList()
-{
-	if(remoteTheme_)
-		return remoteTheme_->sqlNumAttList();
-
-	return TeAttributeList();
-}
-
-void TeExternalTheme::clearNumAttList()
-{
-	if(remoteTheme_)
-		remoteTheme_->clearNumAttList();
-}
-
-string TeExternalTheme::sqlJoin()
-{
-	if(remoteTheme_)
-		return remoteTheme_->sqlJoin();
-
-	return "";
-}
-
-string TeExternalTheme::sqlFrom()
-{
-	if(remoteTheme_)
-		return remoteTheme_->sqlFrom();
-
-	return "";
-}
-
-vector<string>&	TeExternalTheme::aliasVector()
-{
-	if(remoteTheme_)
-		return remoteTheme_->aliasVector();
-	aliasVector_.clear();
-	return aliasVector_;
-}
-
-void TeExternalTheme::loadAliasVector()
-{
-	if(remoteTheme_)
-		return remoteTheme_->loadAliasVector();
-
-	return;
-}
-
-void TeExternalTheme::loadAttrLists()
-{
-	if(!remoteTheme_)
-		return;
-
-	remoteTheme_->loadAttrLists();
-
-	sqlAttList_.clear();
-	sqlNumAttList_.clear();
-
-	sqlAttList_ = remoteTheme_->sqlAttList();
-	sqlNumAttList_ = remoteTheme_->sqlNumAttList();
-
-}
-
-bool TeExternalTheme::locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol)
-{
-	if(!remoteTheme_)
-		return false;
-
-	return remoteTheme_->locatePolygon(pt, polygon, tol);
-}
-
-bool TeExternalTheme::locatePolygonSet(TeCoord2D &pt, double tol, TePolygonSet &polygons)
-{
-	if(!remoteTheme_)
-		return false;
-
-	return remoteTheme_->locatePolygonSet(pt, tol, polygons);
-}
-
-bool TeExternalTheme::locateLine(TeCoord2D &pt, TeLine2D &line, const double& tol)
-{
-	if(!remoteTheme_)
-		return false;
-
-	return remoteTheme_->locateLine(pt, line, tol);
-}
-
-bool TeExternalTheme::locatePoint(TeCoord2D &pt, TePoint &point, const double& tol)
-{
-	if(!remoteTheme_)
-		return false;
-
-	return remoteTheme_->locatePoint(pt, point, tol);
-}
-
-bool TeExternalTheme::locateCell(TeCoord2D &pt, TeCell &c, const double& tol)
-{
-	if(!remoteTheme_)
-		return false;
-
-	return remoteTheme_->locateCell(pt, c, tol);
-}
-
-bool TeExternalTheme::hasObjectsWithoutGeometries(TeGeomRep geomRep)
-{
-	if(!remoteTheme_)
-		return false;
-
-	return remoteTheme_->hasObjectsWithoutGeometries(geomRep);
-}
-
-bool TeExternalTheme::removeObjectsWithoutGeometries(TeGeomRep geomRep)
-{
-	if(!remoteTheme_)
-		return false;
-
-	return remoteTheme_->removeObjectsWithoutGeometries(geomRep);
-}
-
-int TeExternalTheme::createExternalThemeTable(TeDatabase* sourceDB)
-{
-	if(!sourceDB)
-		return 0;
-
-	if(sourceDB->tableExist("te_external_theme"))
-		return -1;
-
-	TeAttributeList attList;
-
-	TeAttribute att1;
-	att1.rep_.name_ = "theme_id";
-	att1.rep_.isAutoNumber_ = false;
-	att1.rep_.isPrimaryKey_ = true;
-	att1.rep_.null_ = false;
-	att1.rep_.type_ = TeINT;
-	att1.rep_.numChar_ = 0;
-	attList.push_back(att1);
-
-	TeAttribute att2;
-	att2.rep_.name_ = "database_id";
-	att2.rep_.isAutoNumber_ = false;
-	att2.rep_.isPrimaryKey_ = false;
-	att2.rep_.null_ = false;
-	att2.rep_.type_ = TeINT;
-	att2.rep_.numChar_ = 0;
-	attList.push_back(att2);
-
-	TeAttribute att3;
-	att3.rep_.name_ = "external_theme_id";
-	att3.rep_.isAutoNumber_ = false;
-	att3.rep_.isPrimaryKey_ = false;
-	att3.rep_.null_ = false;
-	att3.rep_.type_ = TeINT;
-	att3.rep_.numChar_ = 0;
-	attList.push_back(att3);
-
-	if(!sourceDB->createTable("te_external_theme", attList))
-		return 0;
-
-	return 1;
-}
-
-bool TeExternalTheme::populateCollection(std::string /* objectId */)
-{
-	throw;
-	return false;
-}
-
-void TeExternalTheme::createLegendMapId(std::map<int, int>& mapIdLegend)
-{
-	mapIdLegend.clear();
-
-	mapIdLegend[remoteTheme_->outOfCollectionLegend().id()] = outOfCollectionLegend().id();
-	mapIdLegend[remoteTheme_->withoutDataConnectionLegend().id()] = withoutDataConnectionLegend().id();
-	mapIdLegend[remoteTheme_->defaultLegend().id()] = defaultLegend().id();
-	mapIdLegend[remoteTheme_->pointingLegend().id()] = pointingLegend().id();
-	mapIdLegend[remoteTheme_->queryLegend().id()] = queryLegend().id();
-	mapIdLegend[remoteTheme_->queryAndPointingLegend().id()] = queryAndPointingLegend().id();
-
-	for (int i = 0; i < remoteTheme_->grouping().groupNumSlices_; ++i)
-	{
-		mapIdLegend[remoteTheme_->legend()[i].id()] = legend()[i].id();
-	}
-	
-	return;
-}
-
-bool TeExternalTheme::copyRemoteCollection(std::map<int, int>& mapIdLegend)
-{
-	if(mapIdLegend.empty())
-		return false;
-//copy collectionTable
-	TeDatabasePortal* remotePortal = remoteTheme_->layer()->database()->getPortal();
-	string strSQL  = "SELECT * from ";
-	strSQL	+= remoteTheme_->collectionTable();
-
-	if(remotePortal->query(strSQL))
-	{
-		while(remotePortal->fetchRow())
-		{
-			string c_obj_id = remotePortal->getData(0);
-			int c_leg_id = atoi(remotePortal->getData(1));
-			string lab_x = remotePortal->getData(2);
-			string lab_y = remotePortal->getData(3);
-//			string c_leg_own = remotePortal->getData(4);
-			string c_leg_own = "0";
-			string c_obj_stat = remotePortal->getData(5);
-
-			int new_c_leg_id = mapIdLegend[c_leg_id];
-
-			string strINS = "INSERT INTO ";
-			strINS += this->collectionTable();
-			strINS += " (c_object_id, c_legend_id, label_x, label_y, c_legend_own, c_object_status) ";
-			strINS += "VALUES (";
-			strINS += (c_obj_id.empty() ? "''" : "'" + c_obj_id + "'");
-			strINS += ", ";
-			strINS += Te2String(new_c_leg_id);
-			strINS += ", ";
-			strINS += (lab_x.empty() ?  "''" : lab_x);
-			strINS += ", ";
-			strINS += (lab_y.empty() ? "''" : lab_y);
-			strINS += ", ";
-			strINS += (c_leg_own.empty() ? "''" : c_leg_own);
-			strINS += ", ";
-			strINS += (c_obj_stat.empty() ? "''" : c_obj_stat);
-			strINS += ")";
-
-			if(!sourceDB_->execute(strINS))
-				return false;
-		}
-	}
-	else
-		return false;
-
-	remotePortal->freeResult();
-
-//copy collectionTableAux
-	string strSQLAux  = "SELECT * from ";
-	strSQLAux	+= remoteTheme_->collectionAuxTable();
-
-	if(remotePortal->query(strSQLAux))
-	{
-		while(remotePortal->fetchRow())
-		{
-			string c_obj_id = remotePortal->getData(0);
-			string unique_id = remotePortal->getData(1);
-			string grid_status = remotePortal->getData(2);
-
-			string strINSAux = "INSERT INTO ";
-			strINSAux +=collectionAuxTable();
-			strINSAux += " (object_id, unique_id, grid_status) ";
-			strINSAux += "VALUES ("; 
-			strINSAux += (c_obj_id.empty() ? "''" : "'" + c_obj_id + "'");
-			strINSAux += ", ";
-			strINSAux += (unique_id.empty() ? "''" : unique_id);
-			strINSAux += ", ";
-			strINSAux += (grid_status.empty() ? "''" : grid_status);
-			strINSAux += ")";
-
-			if(!sourceDB_->execute(strINSAux))
-				return false;
-		}
-	}
-	else
-		return false;
-
-	remotePortal->freeResult();
-	delete remotePortal;
-
-	return true;
-}
-
-
-
-bool TeExternalTheme::getRemoteThemeInfo(int& remoteThemeId, int& databaseId)
-{
-	if(!sourceDB_)
-		return false;
-
-	try
-	{
-		TeDatabasePortal* dbPortal = sourceDB_->getPortal();
-
-		if(!dbPortal)
-		{
-			return false;
-		}
-
-		std::string strSQL = "SELECT external_theme_id, database_id FROM te_external_theme ";
-		strSQL += "WHERE theme_id = " + Te2String(id());
-
- 	    if(!dbPortal->query(strSQL) || !dbPortal->fetchRow())
-		{
-			dbPortal->freeResult();
-			delete dbPortal;
-			return false;
-		}
-
-		remoteThemeId = dbPortal->getInt("external_theme_id");
-		databaseId = dbPortal->getInt("database_id");
-
-		dbPortal->freeResult();
-		delete dbPortal;
-	}
-	catch(TeException&)
-	{
-	}
-	
-	return true;
-}
-
-bool 
-TeExternalTheme::loadMetadata(TeDatabase* db)
-{
-	if(remoteTheme_ || !db)
-		return false;
-
-	int remoteThemeId = -1;
-	int remoteDBId = -1;
-
-	setSourceDatabase(db);
-
-	if(!getRemoteThemeInfo(remoteThemeId, remoteDBId))
-		return false;	
-
-	TeDatabase* remotedb = TeDBConnectionsPool::instance().getDatabase(remoteDBId);
-	if(remotedb == NULL)
-	{	
-		std::string hostName, dbmsName, dbName, userName, password;
-		int port = 0;
-		if(!TeDBConnectionsPool::instance().getConnectionInfo(db, remoteDBId, hostName, dbmsName, dbName, userName, password, port))
-		{
-			return false;
-		}
-
-		remotedb = TeDBConnectionsPool::instance().getDatabase(dbmsName, dbName, hostName, userName, password, port);
-
-		if(remotedb != NULL)
-		{
-			TeDBConnectionsPool::instance().saveExternalDBConnection(db, remotedb);
-		}
-	}
-	
-	if(!remotedb || !remotedb->isConnected())
-		return false;
-
-	TeThemeMap::iterator itTheme = remotedb->themeMap().find(remoteThemeId);
-
-    TeTheme* remoteTheme = NULL;
-
-	if(itTheme != remotedb->themeMap().end())
-	{
-// is theme already loaded?
-		if(itTheme->second->getProductId()!=TeTHEME)
-			return false;
-        
-        remoteTheme = dynamic_cast<TeTheme*>(itTheme->second);
-	}
-	else
-	{
-// if theme is not loaded... we load it.
-		remoteTheme = new TeTheme();
-		remoteTheme->id(remoteThemeId);
-		try
-		{
-			if(!remotedb->loadTheme(remoteTheme))
-				return false;
-		}
-		catch(...)
-		{
-			return false;
-		}
-	}
-
-    if(remoteTheme == NULL)
-    {
-        return false;
-    }
-	if(remoteTheme->layer() == NULL)
-    {
-        return false;
-    }
-
-    setRemoteTheme(remoteTheme);
-
-	remotedb->clear();
-
-	loadObjectLegendMap();
-	return true;
-}
-
-bool TeExternalTheme::saveMetadata(TeDatabase* dstDB)
-{
-	if(!remoteTheme_ || !remoteTheme_->layer() || !remoteTheme_->layer()->database())
-		return false;
-	
-	int themeId = id();
-	int remoteThemeId = remoteTheme_->id();
-
-	TeDatabasePortal* portal = dstDB->getPortal();
-	if(!portal)
-		return false;
-	
-	string sql = "SELECT * FROM te_external_theme WHERE theme_id = "+ Te2String(themeId);
-	bool isUpdate = false;
-	if(!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-	if(portal->fetchRow())
-		isUpdate = true;
-	delete portal;
-
-	string strSQL;
-	if(isUpdate)
-	{
-		strSQL  = "UPDATE te_external_theme SET ";
-		strSQL += " theme_id = "+ Te2String(themeId);
-		strSQL += ", ";
-		strSQL += " database_id = "+ Te2String(remoteDbId_);
-		strSQL += ", ";
-		strSQL += " external_theme_id = "+ Te2String(remoteThemeId);
-		strSQL += " WHERE theme_id = "+ Te2String(themeId);
-	}
-	else
-	{
-		strSQL  = "INSERT INTO te_external_theme (theme_id, database_id, external_theme_id) VALUES (";
-		strSQL += Te2String(themeId);
-		strSQL += ", ";
-		strSQL += Te2String(remoteDbId_);
-		strSQL += ", ";
-		strSQL += Te2String(remoteThemeId);
-		strSQL += ")";
-	}
-
-	if(!dstDB->execute(strSQL))
-		return false;
-
-	return true;
-}
-
-bool TeExternalTheme::eraseMetadata(TeDatabase* db)
-{
-	int themeId = id();
-	
-    std::string strSQL  = " DELETE FROM te_external_theme ";
-    strSQL += " WHERE theme_id = "+ Te2String(themeId);
-	
-	if(!db->execute(strSQL))
-		return false;
-
-	return true;
-}
-
+#include "TeExternalTheme.h"
+#include "TeLayer.h"
+#include "TeDatabase.h"
+#include "TeDatabaseFactoryParams.h"
+#include "TeDBConnectionsPool.h"
+#include "TeGroupingAlgorithms.h"
+#include "TeQuerier.h"
+#include "TeQuerierParams.h"
+#include "TeRasterTransform.h"
+
+
+TeExternalTheme::TeExternalTheme(TeDatabase* sourceDb, TeTheme* remoteTheme, const int& viewId, 
+                                 const string& name) :
+TeTheme(name, 0, 0, viewId),
+remoteTheme_(NULL),
+sourceDB_(sourceDb),
+remoteDbId_(-1)
+{
+    type(TeEXTERNALTHEME);
+
+    if(remoteTheme != NULL)
+    {
+        setRemoteTheme(remoteTheme);
+    }
+}
+
+TeExternalTheme::~TeExternalTheme()
+{
+    if(remoteTheme_ != NULL)
+    {
+        delete remoteTheme_;
+    }
+}
+
+TeExternalTheme& TeExternalTheme::operator=(TeExternalTheme& rhs)
+{
+	*(TeTheme*)this = rhs;
+	remoteTheme_ = rhs.remoteTheme_;
+
+    return *this;
+}
+
+TeViewNode* TeExternalTheme::clone()
+{
+	TeExternalTheme* extTheme = new TeExternalTheme(this->sourceDB_, this->remoteTheme_, this->view(), this->name());
+	*extTheme = *this;
+
+	return extTheme;
+}
+
+TeTheme* 
+TeExternalTheme::getRemoteTheme() const
+{
+	return remoteTheme_;
+}
+
+void TeExternalTheme::setRemoteTheme(TeTheme* theme)
+{
+    remoteTheme_ = new TeTheme(*theme);
+    TeLayer* remoteLayer = new TeLayer(*theme->layer());
+
+    remoteTheme_->layer(remoteLayer);
+    remoteDbId_ = TeDBConnectionsPool::instance().getDatabaseIdx(remoteLayer->database());
+}
+
+TeDatabase* TeExternalTheme::getSourceDatabase()
+{
+    return sourceDB_;
+}
+
+void TeExternalTheme::setSourceDatabase(TeDatabase* srcDB)
+{
+	sourceDB_ = srcDB;
+}
+
+string 
+TeExternalTheme::getRemoteThemeName()
+{ 
+	return remoteTheme_->name();
+}
+
+void 
+TeExternalTheme::loadObjectLegendMap()
+{
+	objLegendMap_.clear();
+	objOwnLegendMap_.clear();
+	objStatusMap_.clear();
+	itemStatusMap_.clear();
+
+	TeDatabasePortal* portal = sourceDB_->getPortal();
+
+	if(!portal->query("SELECT c_object_id, c_legend_id, c_legend_own, c_object_status FROM " + collectionTable()))
+		return;
+
+	while(portal->fetchRow())
+	{
+		string objId = portal->getData(0);
+		int status = portal->getInt(3);
+		if(portal->getInt(1) != 0)
+			objLegendMap_[portal->getData(0)] = portal->getInt(1);
+		if(portal->getInt(2) != 0)
+			objOwnLegendMap_[portal->getData(0)] = portal->getInt(2);
+		if(status != 0)
+			objStatusMap_[objId] = status;
+	}
+
+	portal->freeResult();
+
+	if(!portal->query("SELECT object_id, unique_id, grid_status FROM " + collectionAuxTable()))
+		return;
+	
+	while(portal->fetchRow())
+	{
+		if(portal->getInt(2) != 0)
+		{
+			itemStatusMap_[portal->getData(1)] = portal->getInt(2);
+		}
+	}
+
+	portal->freeResult();
+	delete portal;
+}
+
+int 
+TeExternalTheme::getGridStatus(const int uniqueId, const std::string /* objectId */)
+{
+	string aux = Te2String(uniqueId);
+	std::map<std::string, int >::iterator itGridStatus = itemStatusMap_.find(aux);
+	if(itGridStatus == itemStatusMap_.end())
+		return 0;
+	return itGridStatus->second;
+}
+		
+int 
+TeExternalTheme::getObjectStatus(const std::string objectId)
+{
+	std::map<std::string, int>::iterator it = objStatusMap_.find(objectId);
+	if(it == objStatusMap_.end())
+		return 0;
+	
+	return it->second;
+}
+
+bool 
+TeExternalTheme::setObjectLegendStatusMap(const std::string objId, const int status)
+{
+	if(objId.empty())
+		return false;
+	
+	if( status == 0)
+	{
+		map<std::string, int>::iterator itLegStatus = objStatusMap_.find(objId);
+
+		if(itLegStatus != objStatusMap_.end())
+		{
+			objStatusMap_.erase(itLegStatus);
+			return true;
+		}
+		return false;
+	}
+	
+	objStatusMap_[objId] = status;
+
+	return true;
+}
+
+bool 
+TeExternalTheme::setObjectGridStatusMap(const std::string objId, const int uniqueId, const int status)
+{
+	string aux = Te2String(uniqueId);
+	if(objId.empty() || aux.empty())
+		return false;
+	
+	if( status == 0 )
+	{
+		std::map<std::string, int >::iterator itGridStatus = itemStatusMap_.find(aux);
+
+		if(itGridStatus != itemStatusMap_.end())
+		{
+			itemStatusMap_.erase(itGridStatus);
+			return true;
+		}
+		return false;
+	}
+	
+	itemStatusMap_[aux] = status;
+
+	return true;
+}
+
+int 
+TeExternalTheme::layerId()
+{
+	return -1;
+}
+
+void 
+TeExternalTheme::layerId(int)
+{
+}
+
+void 
+TeExternalTheme::layer(TeLayer* layer)
+{
+	if(remoteTheme_)
+		remoteTheme_->layer(layer);
+}
+
+TeLayer*  
+TeExternalTheme::layer()
+{
+	if(remoteTheme_)
+		return remoteTheme_->layer();
+	return 0;
+}
+
+TeProjection* 
+TeExternalTheme::getThemeProjection()
+{
+	if(remoteTheme_ && remoteTheme_->layer())
+		return remoteTheme_->layer()->projection();
+	return 0;
+}
+
+bool 
+TeExternalTheme::hasRestriction()
+{
+	return false;
+}
+
+bool TeExternalTheme::hasAttrRest()
+{
+	return false;
+}
+
+bool TeExternalTheme::hasTemporalRest()
+{
+	return false;
+}
+
+bool TeExternalTheme::hasSpatialRest()
+{
+	return false;
+}
+
+string TeExternalTheme::sqlWhereRestrictions(TeRepresentation* /* rep */)
+{
+	return string("");
+}
+
+void TeExternalTheme::loadTablesJoin(const string& geomTable)
+{
+	remoteTheme_->loadTablesJoin(geomTable);
+}
+
+string TeExternalTheme::sqlGridJoin()
+{
+	return remoteTheme_->sqlGridJoin();
+}
+
+string TeExternalTheme::sqlGridFrom(const string& geomTable)
+{
+	return remoteTheme_->sqlGridFrom(geomTable);
+}
+
+bool TeExternalTheme::save(TeDatabase* db, const bool& copyExternalCollection)  
+{
+	if(!db)
+		return false;
+
+	//insert theme in database 
+	//TeDatabase::insertTheme and TeDatabase::updateTheme use the method saveMetadata
+	if(id()==0)
+	{
+		if(!db->insertTheme(this)) //updateThemeTable
+		{
+			db->deleteTheme(this->id());
+			return false;
+		}
+	}
+	else
+	{
+		if(!db->updateTheme(this)) //updateThemeTable
+		{
+			db->deleteTheme(this->id());
+			return false;
+		}
+	}
+	
+    if(copyExternalCollection)
+    {
+	//collection table 
+	    if(collectionTable().empty())
+		    collectionTable("te_collection_"+ Te2String(id())); 
+
+	    if(!db->createCollectionTable(collectionTable_))
+	    {
+		    db->deleteTheme(this->id());
+		    return false;
+	    }
+
+	    //collection aux table
+	    collectionAuxTable(collectionTable() + "_aux");
+    	
+	    if(!TeTheme::createCollectionAuxTable(db))
+	    {
+		    db->deleteTheme(this->id());
+		    return false;
+	    }
+    }
+
+	return true;
+}
+
+bool TeExternalTheme::save(const bool& copyExternalCollection)
+{
+	if(!save(sourceDB_, copyExternalCollection))
+		return false;
+	
+	// a map to identify legends id between local theme and remote theme during copy.
+	std::map<int, int> mapIdLegend;	
+
+    if(copyExternalCollection)
+    {
+	    createLegendMapId(mapIdLegend);
+
+	    if(!mapIdLegend.empty())
+		    copyRemoteCollection(mapIdLegend);
+    	
+	    mapIdLegend.clear();
+
+	    loadObjectLegendMap();
+    }
+
+	return true;
+}
+
+bool TeExternalTheme::createCollectionAuxTable()
+{
+	return TeTheme::createCollectionAuxTable(sourceDB_);
+}
+
+bool TeExternalTheme::populateCollectionAux(std::string /* objectId */)
+{
+	throw;
+	return false;
+}
+
+bool TeExternalTheme::buildGrouping(const TeGrouping& g, TeSelectedObjects /* selectedObjects */,
+				                  vector<double>* dValuesVec)
+{
+	TeDatabase* db = remoteTheme_->layer()->database();
+	if(!db)
+		return false;
+	
+	grouping_ = g;
+	unsigned int i;
+	vector<TeSlice> slices;
+	int	nullValues = 0;
+	if (grouping_.groupMode_ == TeRasterSlicing)
+	{
+		int b = atoi(grouping_.groupAttribute_.name_.c_str());
+		if (!remoteTheme_->layer()->raster() ||  
+			b < 0 ||
+			b > remoteTheme_->layer()->raster()->params().nBands() ||
+			grouping_.groupNumSlices_ <= 0)
+			return false;
+
+		if (grouping_.groupMaxVal_ == TeMINFLOAT)
+			grouping_.groupMaxVal_ = remoteTheme_->layer()->raster()->params().vmax_[b];
+
+		if (grouping_.groupMinVal_ == TeMAXFLOAT)
+			grouping_.groupMinVal_ = remoteTheme_->layer()->raster()->params().vmin_[b];
+
+		TeGroupByEqualStep(grouping_.groupMinVal_, grouping_.groupMaxVal_,
+			grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+	}
+	else
+	{
+        if(grouping_.groupAttribute_.name_.empty())
+			return false;
+
+		TeDatabasePortal* portal = db->getPortal();
+		string query;
+		bool normal = false;
+		string aggrFunc = "";
+		if(grouping_.groupFunction_.empty())
+			aggrFunc = " MIN";
+		else
+			aggrFunc = grouping_.groupFunction_;
+
+		if(grouping_.groupNormAttribute_.empty())
+		{
+			query = " SELECT "+ aggrFunc +"("+ grouping_.groupAttribute_.name_ +")";  
+		}
+		else
+		{
+			query = " SELECT "+ aggrFunc +"("+ grouping_.groupAttribute_.name_ +") / "+ aggrFunc +"("+ grouping_.groupNormAttribute_ + ")";
+			normal = true;
+		}
+		query += sqlGridFrom(); 
+		query += " GROUP BY " + remoteTheme_->collectionTable() + ".c_object_id";
+		if(!portal->query(query) || !portal->fetchRow())
+		{
+			delete portal;
+			return false;
+		}
+		vector<double> dValues;  //inputvect
+		vector<string> sValues;	//svec
+		double mean, sum; 
+		mean = sum = 0.;
+		do  
+		{
+			string val = portal->getData(0);
+			string valNorm = Te2String(atof(val.c_str()), grouping_.groupPrecision_);
+
+			if (!val.empty())
+			{
+				if(grouping_.groupMode_== TeUniqueValue)
+				{
+					if(normal)
+						sValues.push_back(valNorm);
+					else
+						sValues.push_back(val);
+				}
+				else
+				{
+					dValues.push_back(atof(valNorm.c_str()));
+					sum += atof(valNorm.c_str());
+				}
+
+			}
+			else
+				nullValues++;
+		}while(portal->fetchRow());
+		
+		delete portal;
+		
+		if(dValues.empty() && sValues.empty())
+			return false;
+
+		if(grouping_.groupMode_== TeEqualSteps)
+			TeGroupByEqualStep(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+		else if(grouping_.groupMode_== TeQuantil)
+			TeGroupByQuantil(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+		else if(grouping_.groupMode_== TeStdDeviation)
+		{
+			string m = Te2String(mean);
+			TeGroupByStdDev(dValues.begin(), dValues.end(), grouping_.groupStdDev_, slices, m, grouping_.groupPrecision_);
+		}
+		else if(grouping_.groupMode_== TeUniqueValue)
+		{
+			if(grouping_.groupFunction_ == "COUNT")
+				TeGroupByUniqueValue(sValues, TeINT, slices, grouping_.groupPrecision_);
+			else
+				TeGroupByUniqueValue(sValues, grouping_.groupAttribute_.type_, slices, grouping_.groupPrecision_);
+		}
+
+		if (dValuesVec)
+		{
+			for (i = 0; i < dValues.size(); ++i)
+				dValuesVec->push_back(dValues[i]);
+		}
+	}
+	if(grouping_.groupNullAttr_ && nullValues > 0)
+	{
+		TeSlice ps;
+		ps.count_ = nullValues;
+		ps.from_ = "Missing Data";
+		slices.push_back(ps);
+		grouping_.groupNumSlices_ = slices.size() - 1;
+	}
+	else
+		grouping_.groupNumSlices_ = slices.size();
+
+	legend_.clear(); 
+	for(i=0; i<slices.size(); ++i)
+	{
+		TeLegendEntry legend(slices[i]);
+		legend.group(i);
+		legend.theme(id());
+		legend_.push_back(legend);
+	}
+	return true;
+}
+
+bool TeExternalTheme::buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec)
+{
+	TeDatabase* db = remoteTheme_->layer()->database();
+
+	if(!db || chr == TeNOCHRONON)
+		return false;
+
+	grouping_ = g;
+
+	unsigned int i;
+	vector<TeSlice> slices;
+	vector<double> dValues;  //inputvect
+	vector<string> sValues;	//svec
+	double mean, sum; 
+	mean = sum = 0.;
+	int	nullValues = 0;
+	string val;
+
+	if (grouping_.groupMode_ == TeRasterSlicing)
+	{
+		int b = atoi(grouping_.groupAttribute_.name_.c_str());
+		if (!remoteTheme_->layer()->raster() ||  
+			b < 0 ||
+			b > remoteTheme_->layer()->raster()->params().nBands() ||
+			grouping_.groupNumSlices_ <= 0)
+			return false;
+
+		if (grouping_.groupMaxVal_ == TeMINFLOAT)
+			grouping_.groupMaxVal_ = remoteTheme_->layer()->raster()->params().vmax_[b];
+
+		if (grouping_.groupMinVal_ == TeMAXFLOAT)
+			grouping_.groupMinVal_ = remoteTheme_->layer()->raster()->params().vmin_[b];
+
+		TeGroupByEqualStep(grouping_.groupMinVal_, grouping_.groupMaxVal_,
+			grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+	}
+	else
+	{
+		string func;
+		TeStatisticType statType = TeNOSTATISTIC;
+		if (grouping_.groupMode_ == TeUniqueValue && grouping_.groupAttribute_.type_ == TeSTRING)
+			func = "MIN";
+		else
+			func = grouping_.groupFunction_;
+
+		if (func == "MIN")
+			statType = TeMINVALUE;
+		else if (func == "MAX")
+			statType = TeMAXVALUE;
+		else if (func == "MEAN")
+			statType = TeMEAN;
+		else if (func == "SUM")
+			statType = TeSUM;
+		else if (func == "COUNT")
+			statType = TeCOUNT;
+
+		// Set the flag that indicates the geometries must not be loaded
+		bool loadGeometries = false;
+
+		// Insert the attributes in a multimap that relates the attribute 
+		// representation and its statistic type
+		TeGroupingAttr attrMMap;
+		pair<TeAttributeRep, TeStatisticType> attr1 (
+			TeAttributeRep(grouping_.groupAttribute_), statType);
+		attrMMap.push_back(attr1);
+
+		// Set querier parameters
+		TeQuerierParams querierParams(loadGeometries, attrMMap);
+		querierParams.setParams(this, chr);
+
+		TeQuerier querier(querierParams);
+
+		// Load instances based on the querier parameters given
+		int numFrames = querier.getNumTimeFrames();
+		TeSTInstance sti;
+		string objId;
+		TePropertyVector vec;
+		mapObjValVec.resize(numFrames);
+
+		for (int frame = 0; frame < numFrames; ++frame)
+		{
+			if (querier.loadInstances(frame) == false)
+				continue;
+
+			// Traverse all the instances
+			while(querier.fetchInstance(sti))
+			{
+				objId = sti.objectId();
+				vec = sti.getPropertyVector();
+				val = vec[0].value_;
+				dValues.push_back(atof(val.c_str()));
+				sValues.push_back(val);
+				map<string, string>& objValMap = mapObjValVec[frame];
+				objValMap.insert(make_pair(objId, val));
+			}
+		}
+
+		if(grouping_.groupMode_== TeEqualSteps)
+			TeGroupByEqualStep(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+		else if(grouping_.groupMode_== TeQuantil)
+			TeGroupByQuantil(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+		else if(grouping_.groupMode_== TeStdDeviation)
+		{
+			string m = Te2String(mean);
+			TeGroupByStdDev(dValues.begin(), dValues.end(), grouping_.groupStdDev_, slices, m, grouping_.groupPrecision_);
+		}
+		else if(grouping_.groupMode_== TeUniqueValue)
+		{
+			if(grouping_.groupFunction_ == "COUNT")
+				TeGroupByUniqueValue(sValues, TeINT, slices, grouping_.groupPrecision_);
+			else
+				TeGroupByUniqueValue(sValues, grouping_.groupAttribute_.type_, slices, grouping_.groupPrecision_);
+		}
+	}
+
+	if(grouping_.groupNullAttr_ && nullValues > 0)
+	{
+		TeSlice ps;
+		ps.count_ = nullValues;
+		ps.from_ = "Missing Data";
+		slices.push_back(ps);
+		grouping_.groupNumSlices_ = slices.size() - 1;
+	}
+	else
+		grouping_.groupNumSlices_ = slices.size();
+
+	legend_.clear(); 
+	for(i=0; i<slices.size(); ++i)
+	{
+		TeLegendEntry legend(slices[i]);
+		legend.group(i);
+		legend.theme(id());
+		legend_.push_back(legend);
+	}
+	
+	return true;
+}
+					
+bool TeExternalTheme::saveGrouping(TeSelectedObjects selectedObjects)
+{
+	return TeTheme::saveGrouping(sourceDB_, selectedObjects);
+}
+
+bool TeExternalTheme::saveLegendInCollection(TeSelectedObjects selectedObjects, std::string objectId)
+{
+	return saveLegendInCollection(sourceDB_, selectedObjects, objectId);
+}
+
+bool TeExternalTheme::saveLegendInCollection(TeDatabase* db, TeSelectedObjects /* selectedObjects */, std::string objectId)
+{
+	unsigned int i;
+	if(grouping_.groupMode_ == TeNoGrouping)
+		return false; 
+
+	TeAttrDataType		type = grouping_.groupAttribute_.type_;
+	TeLegendEntryVector legVec = legend_;
+	string			groupingAttr = grouping_.groupAttribute_.name_;
+
+	string collectionTableRemote = remoteTheme_->collectionTable();
+	string func;
+
+	if(grouping_.groupFunction_.empty())
+		func = " MIN";
+	else
+		func = grouping_.groupFunction_;
+
+	if(grouping_.groupFunction_ == "COUNT")
+		type = TeINT;
+
+	string query = "SELECT MIN(" + collectionTableRemote + ".c_object_id)";
+	if(grouping_.groupNormAttribute_.empty())
+		query += ", "+ func +"(" + groupingAttr + ")" + remoteTheme_->sqlGridFrom();
+	else
+		query += ", "+ func +"(" + groupingAttr + ") / "+ func +"(" + grouping_.groupNormAttribute_ + ")" + remoteTheme_->sqlGridFrom();
+	
+	query += " GROUP BY " + collectionTableRemote + ".c_object_id";
+
+	map<int, vector<string> > legMap;
+	
+	TeDatabasePortal* portal = remoteTheme_->layer()->database()->getPortal();
+	if(portal->query(query) == false)
+	{
+		delete portal;
+		return false;
+	}
+
+	vector<string> idVec;
+	vector<string> nullIdVec;
+	vector<string> valVec;
+	while(portal->fetchRow())
+	{
+		
+		string val = portal->getData(1);
+		string oid = portal->getData(0);
+		if (val.empty() == false)
+		{
+			idVec.push_back(oid);
+			valVec.push_back(val);
+		}
+		else
+			nullIdVec.push_back(oid);
+	}
+	if (grouping_.groupMode_ == TeUniqueValue)
+	{
+		unsigned int j = 0;
+		while( j < idVec.size())
+		{
+			string val = valVec[j];
+			string oid = idVec[j];
+			if(type == TeREAL)
+			{
+				double a = atof(val.c_str());
+				val = Te2String(a, grouping_.groupPrecision_);
+			}
+			else if(type == TeINT)
+			{
+				int a = atoi(val.c_str());
+				val = Te2String(a);
+			}
+				
+			unsigned int siz = legend_.size();
+			if(grouping_.groupNullAttr_ && nullIdVec.size() > 0)
+				--siz;
+			for(i=0; i < siz; i++)
+			{
+				TeLegendEntry& leg = legend_[i];
+				if(val == leg.from())
+				{
+					legMap[leg.id()].push_back(oid);
+					break;
+				}
+			}
+			j++;
+		}
+	}
+	else
+	{
+		unsigned int j = 0;
+		while(j < idVec.size())
+		{
+			string val = valVec[j];
+			string oid = idVec[j];
+			if(type == TeREAL)
+			{
+				double a = atof(val.c_str());
+				val = Te2String(a, grouping_.groupPrecision_);
+			}
+			
+			unsigned int siz = legend_.size();
+			if(grouping_.groupNullAttr_ && !nullIdVec.empty())
+               --siz; 
+			for(i=0; i < siz; i++)
+			{
+				TeLegendEntry& leg = legend_[i];
+				int f = leg.from().find("mean");
+				if(f >= 0)
+					continue;
+				double dval = atof(val.c_str());
+				double dfrom = atof(leg.from().c_str());
+				double dto = atof(leg.to().c_str());
+				if(i < legend_.size()-1)
+				{
+					if(dval >= dfrom && dval < dto)
+					{
+						legMap[leg.id()].push_back(oid);
+						break;
+					}
+				}
+				else
+				{
+					if(dval >= dfrom && dval <= dto)
+					{
+						legMap[leg.id()].push_back(oid);
+						break;
+					}
+				}
+			}
+			j++;
+		}
+	}
+	delete portal;
+
+	int legId = defaultLegend_.id();
+	if (grouping_.groupNullAttr_)
+		legId = legend_[legend_.size()-1].id();	
+	for(i = 0; i < nullIdVec.size(); ++i)
+	{
+		string oid = nullIdVec[i];
+		legMap[legId].push_back(oid);
+	}
+
+	vector<string> svec;
+	map<int, vector<string> > :: iterator it = legMap.begin();
+	while(it != legMap.end())
+	{
+    	// --- Generate In Clauses ----
+		unsigned int i, j, k, size, chunkSize = 200, nChunks;
+		string inClause;
+		size = it->second.size();
+		if (size % chunkSize)
+			nChunks = size / chunkSize + 1;
+		else
+			nChunks = size / chunkSize;
+
+		j = 0;		
+		for (k = 0; k < nChunks; ++k)
+		{
+			i = 0;
+			inClause = "(";
+			while (j < size && i < chunkSize)
+			{
+				inClause += "'" + db->escapeSequence(it->second[j]) + "',";
+				i++;
+				j++;
+			}
+			inClause[inClause.size() - 1] = ')';
+			svec.push_back(inClause);
+		}
+
+		//--- generateInClause
+
+		for(i=0; i<svec.size(); ++i)
+		{
+			string up = "UPDATE " + collectionTable_ + " SET c_legend_id = " + Te2String(it->first);
+			up += " WHERE c_object_id IN " + svec[i];
+			if (!objectId.empty())
+				up += " AND c_object_id='"+objectId+"'";
+			if(db->execute(up) == false)
+				continue;
+		}
+		it++;
+		svec.clear();
+	}
+	if(legend_.size())
+		visibleRep_ = visibleRep_ | 0x40000000;
+	else
+		visibleRep_ = visibleRep_ | 0xbfffffff;
+	string upVis = "UPDATE te_theme SET visible_rep=" + Te2String(visibleRep_) + " WHERE theme_id=" + Te2String(id());
+	
+	if(!db->execute(upVis))
+		return false;
+	
+	loadObjectLegendMap();
+
+	return true;
+}
+
+void TeExternalTheme::setLegendsForObjects()
+{
+}
+
+bool TeExternalTheme::generateLabelPositions(const std::string& /* objectId */)
+{
+	throw;
+	return false;
+}
+
+bool TeExternalTheme::deleteGrouping()
+{
+	if(!sourceDB_)
+		return false;
+
+	resetGrouping();
+	
+	//delete te_legend table
+	if(!sourceDB_->deleteLegend (this->id()))
+		return false;
+	
+	//delete te_grouping table
+	string sql = "DELETE FROM te_grouping WHERE theme_id= "+ Te2String(this->id());
+	sourceDB_->execute (sql);
+
+	return true;
+}
+
+void TeExternalTheme::createRasterVisual(TeRaster* rst)
+{
+	if (rasterVisual_)
+		delete rasterVisual_;
+
+	if (!rst)
+		rst = remoteTheme_->layer()->raster();
+
+	if (!rst)
+		return;
+
+	rasterVisual_ = new TeRasterTransform();
+										
+	if (rst->params().photometric_[0] == TeRasterParams::TePallete)  // raster palette -> uses its palette
+	{
+		rasterVisual_->setTransfFunction(&TeRasterTransform::Pallete2ThreeBand);
+		rasterVisual_->setLutSize(rst->params().lutr_.size());
+		return;
+	}
+
+	if (visibleRep_ & 0x40000000  &&		// sliced raster -> generate the
+		grouping_.groupMode_ == TeRasterSlicing)	// appropriate palette
+	{
+		int band = atoi(grouping_.groupAttribute_.name_.c_str());
+		rasterVisual_->setSrcBand(band);
+		if (rst->params().dataType_[band] != TeUNSIGNEDCHAR)
+			rasterVisual_->generateLUT(legend_, 1024, defaultLegend_.visual(TePOLYGONS)->color());
+		else
+			rasterVisual_->generateLUT(legend_, 256, defaultLegend_.visual(TePOLYGONS)->color());
+		rasterVisual_->setTransfFunction(&TeRasterTransform::LUT2ThreeBand);
+		return;
+	}
+
+	if (rst->params().dataType_[0] != TeUNSIGNEDCHAR)	// non unsigned char -> generate linear transformation
+		rasterVisual_->setLinearTransfParameters(rst->params().vmin_[0],rst->params().vmax_[0], 0, 255);
+
+	if (rst->params().nBands() == 1)				
+		rasterVisual_->setTransfFunction(&TeRasterTransform::Mono2ThreeBand);
+	else if (rst->params().nBands() == 3)
+		rasterVisual_->setTransfFunction(&TeRasterTransform::ThreeBand2RGB);
+	else
+		rasterVisual_->setTransfFunction(&TeRasterTransform::Band2Band);
+}
+
+bool TeExternalTheme::addThemeTable(TeTable& table)
+{
+	if( remoteTheme_ )
+		return remoteTheme_->addThemeTable(table);
+
+	return false;
+}
+
+void TeExternalTheme::addThemeTable(string tableName)
+{
+	if( remoteTheme_ )
+		return remoteTheme_->addThemeTable(tableName);
+
+	return;
+}
+
+bool TeExternalTheme::isThemeTable(int tableId)
+{
+	if( remoteTheme_ )
+		return remoteTheme_->isThemeTable(tableId);
+
+	return false;
+}
+
+bool TeExternalTheme::isThemeTable(string tableName)
+{
+	if( remoteTheme_ )
+		return remoteTheme_->isThemeTable(tableName);
+
+	return false;
+}
+
+TeAttrTableVector& TeExternalTheme::attrTables()
+{
+	if( remoteTheme_ )
+		return remoteTheme_->attrTables();
+	attTableVector_.clear();
+	return attTableVector_;
+}
+
+bool TeExternalTheme::setAttTables(TeAttrTableVector& attrs)
+{
+	if( remoteTheme_ )
+		return remoteTheme_->setAttTables(attrs);
+
+	return false;
+}
+
+bool TeExternalTheme::getAttTables(TeAttrTableVector& attrs, TeAttrTableType attType)
+{
+	if(remoteTheme_)
+		return remoteTheme_->getAttTables(attrs, attType);
+
+	return false;
+}
+
+bool TeExternalTheme::getTable(TeTable& table, const string tableName)
+{
+	if(remoteTheme_)
+		return remoteTheme_->getTable(table, tableName);
+
+	return false;
+}
+
+void TeExternalTheme::clearAttTableVector() 
+{
+	if(remoteTheme_)
+		remoteTheme_->clearAttTableVector();
+}
+
+bool TeExternalTheme::getTemporalTable(TeTable& table)
+{
+	if(remoteTheme_)
+		return remoteTheme_->getTemporalTable(table);
+
+	return false;
+}
+
+bool TeExternalTheme::removeThemeTable(unsigned int index)
+{
+	if(remoteTheme_)
+		return remoteTheme_->removeThemeTable(index);
+
+	return false;
+}
+
+string TeExternalTheme::getTableName(const string& attrName)
+{
+	if(remoteTheme_)
+		return remoteTheme_->getTableName(attrName);
+
+	return "";
+}
+
+string TeExternalTheme::getAttribute(unsigned int index)
+{
+	if(remoteTheme_)
+		return remoteTheme_->getAttribute(index);
+
+	return "";
+}
+
+
+bool TeExternalTheme::loadThemeTables()
+{
+	if(!remoteTheme_)
+		return false;
+
+	bool result = remoteTheme_->loadThemeTables();
+
+	if(result)
+	{
+		clearAttTableVector();
+		attrTables() = remoteTheme_->attrTables();
+	}
+
+	return result;
+}
+
+
+TeAttributeList TeExternalTheme::sqlAttList()
+{
+	if(remoteTheme_)
+		return remoteTheme_->sqlAttList();
+
+	return TeAttributeList();
+}
+
+void TeExternalTheme::clearAttList()
+{
+	if(remoteTheme_)
+		return remoteTheme_->clearAttList();
+}
+
+TeAttributeList TeExternalTheme::sqlNumAttList()
+{
+	if(remoteTheme_)
+		return remoteTheme_->sqlNumAttList();
+
+	return TeAttributeList();
+}
+
+void TeExternalTheme::clearNumAttList()
+{
+	if(remoteTheme_)
+		remoteTheme_->clearNumAttList();
+}
+
+string TeExternalTheme::sqlJoin()
+{
+	if(remoteTheme_)
+		return remoteTheme_->sqlJoin();
+
+	return "";
+}
+
+string TeExternalTheme::sqlFrom()
+{
+	if(remoteTheme_)
+		return remoteTheme_->sqlFrom();
+
+	return "";
+}
+
+vector<string>&	TeExternalTheme::aliasVector()
+{
+	if(remoteTheme_)
+		return remoteTheme_->aliasVector();
+	aliasVector_.clear();
+	return aliasVector_;
+}
+
+void TeExternalTheme::loadAliasVector()
+{
+	if(remoteTheme_)
+		return remoteTheme_->loadAliasVector();
+
+	return;
+}
+
+void TeExternalTheme::loadAttrLists()
+{
+	if(!remoteTheme_)
+		return;
+
+	remoteTheme_->loadAttrLists();
+
+	sqlAttList_.clear();
+	sqlNumAttList_.clear();
+
+	sqlAttList_ = remoteTheme_->sqlAttList();
+	sqlNumAttList_ = remoteTheme_->sqlNumAttList();
+
+}
+
+bool TeExternalTheme::locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol)
+{
+	if(!remoteTheme_)
+		return false;
+
+	return remoteTheme_->locatePolygon(pt, polygon, tol);
+}
+
+bool TeExternalTheme::locatePolygonSet(TeCoord2D &pt, double tol, TePolygonSet &polygons)
+{
+	if(!remoteTheme_)
+		return false;
+
+	return remoteTheme_->locatePolygonSet(pt, tol, polygons);
+}
+
+bool TeExternalTheme::locateLine(TeCoord2D &pt, TeLine2D &line, const double& tol)
+{
+	if(!remoteTheme_)
+		return false;
+
+	return remoteTheme_->locateLine(pt, line, tol);
+}
+
+bool TeExternalTheme::locatePoint(TeCoord2D &pt, TePoint &point, const double& tol)
+{
+	if(!remoteTheme_)
+		return false;
+
+	return remoteTheme_->locatePoint(pt, point, tol);
+}
+
+bool TeExternalTheme::locateCell(TeCoord2D &pt, TeCell &c, const double& tol)
+{
+	if(!remoteTheme_)
+		return false;
+
+	return remoteTheme_->locateCell(pt, c, tol);
+}
+
+bool TeExternalTheme::hasObjectsWithoutGeometries(TeGeomRep geomRep)
+{
+	if(!remoteTheme_)
+		return false;
+
+	return remoteTheme_->hasObjectsWithoutGeometries(geomRep);
+}
+
+bool TeExternalTheme::removeObjectsWithoutGeometries(TeGeomRep geomRep)
+{
+	if(!remoteTheme_)
+		return false;
+
+	return remoteTheme_->removeObjectsWithoutGeometries(geomRep);
+}
+
+int TeExternalTheme::createExternalThemeTable(TeDatabase* sourceDB)
+{
+	if(!sourceDB)
+		return 0;
+
+	if(sourceDB->tableExist("te_external_theme"))
+		return -1;
+
+	TeAttributeList attList;
+
+	TeAttribute att1;
+	att1.rep_.name_ = "theme_id";
+	att1.rep_.isAutoNumber_ = false;
+	att1.rep_.isPrimaryKey_ = true;
+	att1.rep_.null_ = false;
+	att1.rep_.type_ = TeINT;
+	att1.rep_.numChar_ = 0;
+	attList.push_back(att1);
+
+	TeAttribute att2;
+	att2.rep_.name_ = "database_id";
+	att2.rep_.isAutoNumber_ = false;
+	att2.rep_.isPrimaryKey_ = false;
+	att2.rep_.null_ = false;
+	att2.rep_.type_ = TeINT;
+	att2.rep_.numChar_ = 0;
+	attList.push_back(att2);
+
+	TeAttribute att3;
+	att3.rep_.name_ = "external_theme_id";
+	att3.rep_.isAutoNumber_ = false;
+	att3.rep_.isPrimaryKey_ = false;
+	att3.rep_.null_ = false;
+	att3.rep_.type_ = TeINT;
+	att3.rep_.numChar_ = 0;
+	attList.push_back(att3);
+
+	if(!sourceDB->createTable("te_external_theme", attList))
+		return 0;
+
+	return 1;
+}
+
+bool TeExternalTheme::populateCollection(std::string /* objectId */, const bool& /* sincronize */)
+{
+	throw;
+	return false;
+}
+
+void TeExternalTheme::createLegendMapId(std::map<int, int>& mapIdLegend)
+{
+	mapIdLegend.clear();
+
+	mapIdLegend[remoteTheme_->outOfCollectionLegend().id()] = outOfCollectionLegend().id();
+	mapIdLegend[remoteTheme_->withoutDataConnectionLegend().id()] = withoutDataConnectionLegend().id();
+	mapIdLegend[remoteTheme_->defaultLegend().id()] = defaultLegend().id();
+	mapIdLegend[remoteTheme_->pointingLegend().id()] = pointingLegend().id();
+	mapIdLegend[remoteTheme_->queryLegend().id()] = queryLegend().id();
+	mapIdLegend[remoteTheme_->queryAndPointingLegend().id()] = queryAndPointingLegend().id();
+
+	for (int i = 0; i < remoteTheme_->grouping().groupNumSlices_; ++i)
+	{
+		mapIdLegend[remoteTheme_->legend()[i].id()] = legend()[i].id();
+	}
+	
+	return;
+}
+
+bool TeExternalTheme::copyRemoteCollection(std::map<int, int>& mapIdLegend)
+{
+	if(mapIdLegend.empty())
+		return false;
+
+	if(remoteTheme_->collectionTable().empty())
+	{
+		return false; 
+	}
+
+	if(!remoteTheme_->layer()->database()->tableExist(remoteTheme_->collectionTable()))
+	{
+		return false;
+	}
+
+//copy collectionTable
+	TeDatabasePortal* remotePortal = remoteTheme_->layer()->database()->getPortal();
+	string strSQL  = "SELECT * from ";
+	strSQL	+= remoteTheme_->collectionTable();
+
+	if(remotePortal->query(strSQL))
+	{
+		while(remotePortal->fetchRow())
+		{
+			string c_obj_id = remotePortal->getData(0);
+			int c_leg_id = atoi(remotePortal->getData(1));
+			string lab_x = remotePortal->getData(2);
+			string lab_y = remotePortal->getData(3);
+//			string c_leg_own = remotePortal->getData(4);
+			string c_leg_own = "0";
+			string c_obj_stat = remotePortal->getData(5);
+
+			int new_c_leg_id = mapIdLegend[c_leg_id];
+
+			string strINS = "INSERT INTO ";
+			strINS += this->collectionTable();
+			strINS += " (c_object_id, c_legend_id, label_x, label_y, c_legend_own, c_object_status) ";
+			strINS += "VALUES (";
+			strINS += (c_obj_id.empty() ? "''" : "'" + c_obj_id + "'");
+			strINS += ", ";
+			strINS += Te2String(new_c_leg_id);
+			strINS += ", ";
+			strINS += (lab_x.empty() ?  "''" : lab_x);
+			strINS += ", ";
+			strINS += (lab_y.empty() ? "''" : lab_y);
+			strINS += ", ";
+			strINS += (c_leg_own.empty() ? "''" : c_leg_own);
+			strINS += ", ";
+			strINS += (c_obj_stat.empty() ? "''" : c_obj_stat);
+			strINS += ")";
+
+			if(!sourceDB_->execute(strINS))
+				return false;
+		}
+	}
+	else
+		return false;
+
+	remotePortal->freeResult();
+
+//copy collectionTableAux
+	string strSQLAux  = "SELECT * from ";
+	strSQLAux	+= remoteTheme_->collectionAuxTable();
+
+	if(remotePortal->query(strSQLAux))
+	{
+		while(remotePortal->fetchRow())
+		{
+			string c_obj_id = remotePortal->getData(0);
+			string unique_id = remotePortal->getData(1);
+			string grid_status = remotePortal->getData(2);
+
+			string strINSAux = "INSERT INTO ";
+			strINSAux +=collectionAuxTable();
+			strINSAux += " (object_id, unique_id, grid_status) ";
+			strINSAux += "VALUES ("; 
+			strINSAux += (c_obj_id.empty() ? "''" : "'" + c_obj_id + "'");
+			strINSAux += ", ";
+			strINSAux += (unique_id.empty() ? "''" : unique_id);
+			strINSAux += ", ";
+			strINSAux += (grid_status.empty() ? "''" : grid_status);
+			strINSAux += ")";
+
+			if(!sourceDB_->execute(strINSAux))
+				return false;
+		}
+	}
+	else
+		return false;
+
+	remotePortal->freeResult();
+	delete remotePortal;
+
+	return true;
+}
+
+
+
+bool TeExternalTheme::getRemoteThemeInfo(int& remoteThemeId, int& databaseId)
+{
+	if(!sourceDB_)
+		return false;
+
+	try
+	{
+		TeDatabasePortal* dbPortal = sourceDB_->getPortal();
+
+		if(!dbPortal)
+		{
+			return false;
+		}
+
+		std::string strSQL = "SELECT external_theme_id, database_id FROM te_external_theme ";
+		strSQL += "WHERE theme_id = " + Te2String(id());
+
+ 	    if(!dbPortal->query(strSQL) || !dbPortal->fetchRow())
+		{
+			dbPortal->freeResult();
+			delete dbPortal;
+			return false;
+		}
+
+		remoteThemeId = dbPortal->getInt("external_theme_id");
+		databaseId = dbPortal->getInt("database_id");
+
+		dbPortal->freeResult();
+		delete dbPortal;
+	}
+	catch(TeException&)
+	{
+	}
+	
+	return true;
+}
+
+void TeExternalTheme::setRemoteDbId(const int& removeDbId)
+{
+	remoteDbId_ = removeDbId;
+}
+
+bool 
+TeExternalTheme::loadMetadata(TeDatabase* db)
+{
+	if(remoteTheme_ || !db)
+		return false;
+
+	int remoteThemeId = -1;
+	int remoteDBId = -1;
+
+	setSourceDatabase(db);
+
+	if(!getRemoteThemeInfo(remoteThemeId, remoteDBId))
+		return false;	
+
+	TeDatabase* remotedb = TeDBConnectionsPool::instance().getDatabase(remoteDBId);
+	if(remotedb == NULL)
+	{	
+		std::string hostName, dbmsName, dbName, userName, password;
+		int port = 0;
+		if(!TeDBConnectionsPool::instance().getConnectionInfo(db, remoteDBId, hostName, dbmsName, dbName, userName, password, port))
+		{
+			return false;
+		}
+
+		remotedb = TeDBConnectionsPool::instance().getDatabase(dbmsName, dbName, hostName, userName, password, port);
+
+		if(remotedb != NULL)
+		{
+			TeDBConnectionsPool::instance().saveExternalDBConnection(db, remotedb);
+		}
+	}
+	
+	if(!remotedb || !remotedb->isConnected())
+		return false;
+
+	TeThemeMap::iterator itTheme = remotedb->themeMap().find(remoteThemeId);
+
+    TeTheme* remoteTheme = NULL;
+
+	if(itTheme != remotedb->themeMap().end())
+	{
+// is theme already loaded?
+		if(itTheme->second->getProductId()!=TeTHEME)
+			return false;
+        
+        remoteTheme = dynamic_cast<TeTheme*>(itTheme->second);
+	}
+	else
+	{
+// if theme is not loaded... we load it.
+		remoteTheme = new TeTheme();
+		remoteTheme->id(remoteThemeId);
+		try
+		{
+			if(!remotedb->loadTheme(remoteTheme))
+				return false;
+		}
+		catch(...)
+		{
+			return false;
+		}
+	}
+
+    if(remoteTheme == NULL)
+    {
+        return false;
+    }
+	if(remoteTheme->layer() == NULL)
+    {
+        return false;
+    }
+
+    setRemoteTheme(remoteTheme);
+
+	remotedb->clear();
+
+	loadObjectLegendMap();
+	return true;
+}
+
+bool TeExternalTheme::saveMetadata(TeDatabase* dstDB)
+{
+	if(!remoteTheme_ || !remoteTheme_->layer() || !remoteTheme_->layer()->database())
+		return false;
+	
+	int themeId = id();
+	int remoteThemeId = remoteTheme_->id();
+
+	TeDatabasePortal* portal = dstDB->getPortal();
+	if(!portal)
+		return false;
+	
+	string sql = "SELECT * FROM te_external_theme WHERE theme_id = "+ Te2String(themeId);
+	bool isUpdate = false;
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+	if(portal->fetchRow())
+		isUpdate = true;
+	delete portal;
+
+	string strSQL;
+	if(isUpdate)
+	{
+		strSQL  = "UPDATE te_external_theme SET ";
+		strSQL += " theme_id = "+ Te2String(themeId);
+		strSQL += ", ";
+		strSQL += " database_id = "+ Te2String(remoteDbId_);
+		strSQL += ", ";
+		strSQL += " external_theme_id = "+ Te2String(remoteThemeId);
+		strSQL += " WHERE theme_id = "+ Te2String(themeId);
+	}
+	else
+	{
+		strSQL  = "INSERT INTO te_external_theme (theme_id, database_id, external_theme_id) VALUES (";
+		strSQL += Te2String(themeId);
+		strSQL += ", ";
+		strSQL += Te2String(remoteDbId_);
+		strSQL += ", ";
+		strSQL += Te2String(remoteThemeId);
+		strSQL += ")";
+	}
+
+	if(!dstDB->execute(strSQL))
+		return false;
+
+	return true;
+}
+
+bool TeExternalTheme::eraseMetadata(TeDatabase* db)
+{
+	int themeId = id();
+	
+    std::string strSQL  = " DELETE FROM te_external_theme ";
+    strSQL += " WHERE theme_id = "+ Te2String(themeId);
+	
+	if(!db->execute(strSQL))
+		return false;
+
+	return true;
+}
+
diff --git a/src/terralib/kernel/TeExternalTheme.h b/src/terralib/kernel/TeExternalTheme.h
index 0e04032..eb675f4 100644
--- a/src/terralib/kernel/TeExternalTheme.h
+++ b/src/terralib/kernel/TeExternalTheme.h
@@ -1,404 +1,409 @@
-/************************************************************************************
- TerraLib - a library for developing GIS applications.
-Copyright � 2001-2006 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/** \file TeExternalTheme.h
-    \brief This file contains direct implementation of TeTheme in order to 
-	support themes from another TerraLib databases (remote databases).
-*/
-
-#ifndef  __TERRALIB_INTERNAL_EXTERNALTHEME_H
-#define  __TERRALIB_INTERNAL_EXTERNALTHEME_H
-
-#include <map>
-#include <string>
-
-#include "TeTheme.h"
-
-/** \fn bool TeLoadConnectionsInfo(TeDatabase* sourceDB)
-    \brief Loads all connections information from source database and populates Remote theme database index.
-	\param sourceDB A connection to a TerraLib database that stores information about others databases that can be used by remote themes. (Input)
- */
-TL_DLL bool TeLoadConnectionsInfo(TeDatabase* sourceDB);
-
-
-//! A class that implements the external theme concept  
-/*!
-	A external theme is a theme stored in a remote TerraLib database.
-	Some information about the external theme is stored in the local database, but
-	its geometries and attributes are stored in the remote database. 
-
-	\sa TeTheme
-  
- */
-class TL_DLL TeExternalTheme : public TeTheme
-{
-	public:
-
-		//! Constructor.
-		TeExternalTheme(TeDatabase* sourceDb, TeTheme* remoteTheme, const int& viewId, 
-                                 const string& name = "");
-
-		//! Destructor.
-		virtual ~TeExternalTheme();
-	
-		//! Operator =
-		TeExternalTheme& operator=(TeExternalTheme& rhs);
-
-		/** @name Remote Theme Accessor Methods
-		  * Methods related to the remote theme reference.
-		  */
-		//@{
-
-        virtual TeTheme* getRemoteTheme() const;
-
-		virtual void setRemoteTheme(TeTheme* theme);
-
-        virtual TeDatabase* getSourceDatabase();
-
-		virtual void setSourceDatabase(TeDatabase* srcDB);
-		
-		virtual string getRemoteThemeName(); 
-		//@}
-
-
-		/** @name Object status containers
-		  * Methods to handle object status containers
-		  */
-		//@{
-		virtual void loadObjectLegendMap();
-		
-		virtual int getGridStatus(const int uniqueId, const std::string objectId);
-
-		virtual int getObjectStatus(const std::string objectId);
-
-		virtual bool setObjectLegendStatusMap(const std::string objId, const int status);
-		
-		virtual bool setObjectGridStatusMap(const std::string objId, const int uniqueId, const int status);
-		//@}
-
-		/** @name Layer accessor methods
-		  * Methods related to the layer that gives origin to this theme.
-		  */
-		//@{
-
-		/** \brief Returns the identification of the source layer.
-		    \note In a Remote Theme this will be always -1.
-		  */
-		virtual int layerId();
-
-		/** \brief Sets the identification of the source layer.
-		    \param i Layer identification value that will be used to set the source layer. (Input)
-			\note In a Remote Theme this method does nothing.
-		  */
-		virtual void layerId(int i);
-
-		/** \brief Sets the layer that is the source of objects of the theme.
-		    \param layer A pointer to a TeLayer. (Input)
-          */
-		virtual void layer(TeLayer* layer);
-
-		/** \brief Returns a pointer to the layer from which the theme get its objects.
-		    \note In a Remote Theme this method returns a NULL pointer.
-		  */
-		virtual TeLayer* layer();
-
-		//! Returns a pointer to the projection of the remote layer
-		virtual TeProjection* getThemeProjection();
-
-		//@}
-
-		/** @name 
-		  * Methods related to the restrictions over the theme used to generate this theme
-          */
-		//@{
-
-		/** \brief Verifies if this theme has any kind of restrictions.
-		    \note In a Remote Theme this method always returns FALSE.
-		  */
-		virtual bool hasRestriction();
-
-		/** \brief Returns if there is an attribute restriction.
-		    \note In a Remote Theme this method always returns FALSE.
-		  */
-		virtual bool hasAttrRest();
-
-		/** \brief Returns TRUE if there is a temporal restriction defined in the theme.
-		    \note In a Remote Theme this method always returns FALSE. 
-		  */
-		virtual bool hasTemporalRest();
-
-		/** \brief Returns TRUE if this theme has a spatial restriction.
-		    \note In a Remote Theme this method always returns FALSE.
-		  */
-		virtual bool hasSpatialRest();
-
-		/** \brief Returns the clause WHERE derived from the combination of all restricitions (spatial, attribute and temporal).
-		    \note In a Remote Theme this method always returns an empty string.
-		  */
-		virtual string sqlWhereRestrictions(TeRepresentation* rep = 0);
-
-		//@}
-
-		/** @name Collection
-		  * Methods related to the materialization in the database of the theme as a collection of objects 
-          */
-		//@{
-
-		/** \brief Fills the sqlGridJoin_ and sqlGridFrom_ statements according to the status of the database.
-		    \note In a Remote Theme this method does nothing.
-		  */
-		virtual void loadTablesJoin(const string& geomTable = "");
-
-		/** \brief Returns a SQL JOIN statement to get all the attributes of the theme objects, 
-		           the attributes of the collection table, and the attributes of the extended 
-                   collection table.
-		    \note In a Remote Theme this method returns an empty string.
-	      */
-		virtual string sqlGridJoin();
-
-		/** \brief Returns a FROM clause of a SQL statement to get attributes of the theme objects,
-		           the attributes of the collection table, and the attributes of the
-				   extended collection table .
-		    \note In a Remote Theme this method returns an empty string.
-	      */
-		virtual string sqlGridFrom(const string& geomTable="");
-
-        virtual bool save(const bool& copyExternalCollection = true);
-		//! Save the the theme parameters in the database.
-		virtual bool save(TeDatabase* db, const bool& copyExternalCollection = true); 
-		
-		/** \brief Create the auxiliar collection table used to represent objects with multiple versions in time.
-		    \note In a Remote Theme this method creates a local auxiliary collection table.
-		  */
-		virtual bool createCollectionAuxTable();
-
-		/** \brief Populate the auxiliar collection table used to represent objects with multiple versions in time.
-		    \note In a Remote Theme this method populates the local auxiliary collection.
-		  */
-		virtual bool populateCollectionAux(std::string objectId = "");
-
-		//@}
-
-		//! Save the grouping parameters in memory when there is no chronon.
-		virtual bool buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll,
-			                       vector<double>* dValuesVec = 0);
-
-		//! Save the grouping parameters in memory when there is chronon.
-		virtual bool buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec);
-						   
-		//! Build the grouping and associate each object to its group in the collection table.
-		virtual bool saveGrouping(TeSelectedObjects selectedObjects = TeAll);
-
-		//! Save the theme grouping legends in the collection table.
-		virtual bool saveLegendInCollection(TeSelectedObjects selectedObjects = TeAll, std::string objectId = "");
-
-		//! Save the theme grouping legends in the collection table  
-		virtual bool saveLegendInCollection(TeDatabase* db, TeSelectedObjects selectedObjects = TeAll, std::string objectId = "");
-
-		///! Set the legend id for each object of the theme.
-		virtual void setLegendsForObjects();
-
-		//! Generates a optimized position (x,y) in the spatial extention of each object to position label or graphs.
-		virtual bool generateLabelPositions(const std::string& objectId = "");  
-
-		//! Delete grouping.
-		virtual bool deleteGrouping(); 
-		
-		//! Creates an appropriate visual presentation to the raster of the theme.
-		virtual void createRasterVisual(TeRaster* rst = 0);
-
-		/** @name Attribute Tables
-		  * A theme can use one or more attribute tables of the layer that gives its data.
-		  * These methods are related to the manipulation of these tables.
-          */
-		//@{	
-
-		//! Add a new attribute table to a theme.
-		virtual bool addThemeTable(TeTable& table);
-
-		//! Add a new attribute table to a theme.
-		virtual void addThemeTable(string tableName);
-
-		//! Verify if an attribute table is part of a theme.
-		virtual bool isThemeTable(int tableId);
-
-		//! Verify if an attribute table is part of a theme.
-		virtual bool isThemeTable(string tableName);
-
-		//! Returns the list of attribute tables used by this theme.
-		virtual TeAttrTableVector& attrTables();
-
-		//! Sets the entire list of attribute tables used by this theme.
-		virtual bool setAttTables(TeAttrTableVector& attrs);  
-
-		//! Returns a vector of attribute tables, of a specific type, used by this theme.
-		virtual bool getAttTables(TeAttrTableVector& attrs, TeAttrTableType attType = TeAllAttrTypes); 
-
-		//! Returns a representation of an attribute table  given name.
-		virtual bool getTable(TeTable& table, const string tableName);
-
-		//! Clears the list of attribute tables used by this theme.
-		virtual void clearAttTableVector();
-
-		/** \brief Returns the temporal attribute table of the theme (TeEvent or TeFixedGeomDynAttr).
-		    \note A theme supports only one temporal attribute table.
-		  */
-		virtual bool getTemporalTable(TeTable& table);
-
-		//! Removes an attribute table from the list of tables of a theme.
-		virtual bool removeThemeTable(unsigned int index);
-
-		//! Returns the the name of an attribute table that contains a given attribute.
-		virtual string getTableName(const string& attrName);
-
-		//! Returns the name of the index-th attribute resulting of the join of all attribute tables associated to the theme tables 
-		virtual string getAttribute(unsigned int index);
-
-		//! Loads the theme tables in the database
-		virtual bool loadThemeTables();
-		
-		//! Returns the list of attributes of theme tables.
-		virtual  TeAttributeList sqlAttList();
-		
-		//! Clears the list of attributes associated to the theme tables.
-		virtual void clearAttList();
-
-		//! Returns the list of numerical attributes of the theme tables.
-		virtual TeAttributeList sqlNumAttList();
-
-		//! Clears the list of numerical attributes associated to the theme tables.
-		virtual void clearNumAttList();
-
-		///! Returns a SQL JOIN statement to reach to all attribute tables used by this theme.
-		virtual string sqlJoin();
-
-		//! Returns a SQL FROM CLAUSE that gives access to all attribute tables used by this theme.
-		virtual string sqlFrom();
-
-		//! Returns the alias vector of the names of the theme tables.
-		virtual vector<string>&	aliasVector();
-
-		//! Fills aliasVector_.
-		virtual void loadAliasVector();
-
-		/** \brief Refresh list of attributes of all the theme tables.
-		    \note All attributes are stored into sqlAttList_ and numeric attributes are stored into sqlNumAttList_.
-          */
-		virtual void loadAttrLists();
-		//@}
-
-		/** @name Locate geometries
-		  * Returns the geometry(ies) of the theme given coordinate
-          */
-		//@{ 	
-
-		virtual bool locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0);
-		virtual bool locatePolygonSet(TeCoord2D &pt, double tol, TePolygonSet &polygons);
-		virtual bool locateLine(TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
-		virtual bool locatePoint(TeCoord2D &pt, TePoint &point, const double& tol = 0.0);
-		virtual bool locateCell(TeCoord2D &pt, TeCell &c, const double& tol = 0.0);
-
-		//@}
-
-		/** \brief Verifies if there are objects without geometries of a specific geometry representation.
-		  */
-		virtual bool hasObjectsWithoutGeometries(TeGeomRep geomRep);
-
-		/** \brief Removes the objects without geometries of a specific geometry representation.
-		  */
-		virtual bool removeObjectsWithoutGeometries(TeGeomRep geomRep);
-
-		/** \brief Creates a table to store information on how to connect to others databases and get remote theme.
-		    \param sourceDB A connection to a TerraLib database that stores information about others databases that can be used by remote themes. (Input)
-			\return Returns 1 if the table was created, -1 if it already exists and 0 on error.
-		  */
-		static int createExternalThemeTable(TeDatabase* sourceDB);
-
-		//! Save the theme metadata in database. 
-		virtual bool saveMetadata(TeDatabase* db); 
-
-	protected:
-
-		/** \brief Fill the sqlJoin_ and sqlFrom_ .
-		  */
-		//virtual void loadThemeTablesJoin();
-		
-		/** \brief Populate the collection table based in the theme restrictions.
-		  */
-		virtual bool populateCollection(std::string objectId = "");
-
-		/** \brief Populate map with relationateds ids from local theme and remote theme.
-		  */
-		virtual void createLegendMapId(std::map<int, int>& mapIdLegend);
-
-		/** \brief Copy the respective collection table from remoteTheme to localTheme.
-		  */
-		virtual bool copyRemoteCollection(std::map<int, int>& mapIdLegend);
-
-				
-		/** \brief Retrieves remote theme information from the database.
-		  */
-		bool getRemoteThemeInfo(int& remoteThemeId, int& databaseId);
-
-		//! Load the external theme metadata from database. 
-		virtual bool loadMetadata(TeDatabase* db);
-
-		//! Erase the theme metadata in database. 
-		virtual bool eraseMetadata(TeDatabase* db); 
-
-	protected:
-        //! A pointer to a theme in a remote database.
-		TeTheme* remoteTheme_;
-        TeDatabase* sourceDB_;
-        int remoteDbId_;
-};
-
-
-//!  This class implements a factory to create external theme objects. 
-class TL_DLL TeExternalThemeFactory : public TeViewNodeFactory
-{
-public:
-	//! Constructor 
-	TeExternalThemeFactory() : TeViewNodeFactory((int)TeEXTERNALTHEME)
-	{}
-
-	//! Created theme objects 
-	TeViewNode* build(TeViewNodeParams* params)
-	{	
-		TeViewNodeParams auxParams = *params;
-        return new TeExternalTheme(NULL, NULL, params->viewId_, params->name_);	
-	}
-	
-	//! Created theme objects 
-	TeViewNode* build()
-	{	
-		return new TeExternalTheme(NULL, NULL, -1);	
-	}
-};
-
-namespace 
-{
-  static TeExternalThemeFactory externalThemeFactory;
-}; 
-
-#endif	// __TERRALIB_INTERNAL_REMOTETHEME_H
-
+/************************************************************************************
+ TerraLib - a library for developing GIS applications.
+Copyright � 2001-2006 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/** \file TeExternalTheme.h
+    \brief This file contains direct implementation of TeTheme in order to 
+	support themes from another TerraLib databases (remote databases).
+*/
+
+#ifndef  __TERRALIB_INTERNAL_EXTERNALTHEME_H
+#define  __TERRALIB_INTERNAL_EXTERNALTHEME_H
+
+#include <map>
+#include <string>
+
+#include "TeTheme.h"
+
+/** \fn bool TeLoadConnectionsInfo(TeDatabase* sourceDB)
+    \brief Loads all connections information from source database and populates Remote theme database index.
+	\param sourceDB A connection to a TerraLib database that stores information about others databases that can be used by remote themes. (Input)
+ */
+TL_DLL bool TeLoadConnectionsInfo(TeDatabase* sourceDB);
+
+
+//! A class that implements the external theme concept  
+/*!
+	A external theme is a theme stored in a remote TerraLib database.
+	Some information about the external theme is stored in the local database, but
+	its geometries and attributes are stored in the remote database. 
+
+	\sa TeTheme
+  
+ */
+class TL_DLL TeExternalTheme : public TeTheme
+{
+	public:
+
+		//! Constructor.
+		TeExternalTheme(TeDatabase* sourceDb, TeTheme* remoteTheme, const int& viewId, 
+                                 const string& name = "");
+
+		//! Destructor.
+		virtual ~TeExternalTheme();
+	
+		//! Operator =
+		TeExternalTheme& operator=(TeExternalTheme& rhs);
+
+		/** @name Remote Theme Accessor Methods
+		  * Methods related to the remote theme reference.
+		  */
+		//@{
+
+		virtual TeViewNode* clone();
+
+        virtual TeTheme* getRemoteTheme() const;
+
+		virtual void setRemoteTheme(TeTheme* theme);
+
+        virtual TeDatabase* getSourceDatabase();
+
+		virtual void setSourceDatabase(TeDatabase* srcDB);
+		
+		virtual string getRemoteThemeName(); 
+		//@}
+
+
+		/** @name Object status containers
+		  * Methods to handle object status containers
+		  */
+		//@{
+		virtual void loadObjectLegendMap();
+		
+		virtual int getGridStatus(const int uniqueId, const std::string objectId);
+
+		virtual int getObjectStatus(const std::string objectId);
+
+		virtual bool setObjectLegendStatusMap(const std::string objId, const int status);
+		
+		virtual bool setObjectGridStatusMap(const std::string objId, const int uniqueId, const int status);
+		//@}
+
+		/** @name Layer accessor methods
+		  * Methods related to the layer that gives origin to this theme.
+		  */
+		//@{
+
+		/** \brief Returns the identification of the source layer.
+		    \note In a Remote Theme this will be always -1.
+		  */
+		virtual int layerId();
+
+		/** \brief Sets the identification of the source layer.
+		    \param i Layer identification value that will be used to set the source layer. (Input)
+			\note In a Remote Theme this method does nothing.
+		  */
+		virtual void layerId(int i);
+
+		/** \brief Sets the layer that is the source of objects of the theme.
+		    \param layer A pointer to a TeLayer. (Input)
+          */
+		virtual void layer(TeLayer* layer);
+
+		/** \brief Returns a pointer to the layer from which the theme get its objects.
+		    \note In a Remote Theme this method returns a NULL pointer.
+		  */
+		virtual TeLayer* layer();
+
+		//! Returns a pointer to the projection of the remote layer
+		virtual TeProjection* getThemeProjection();
+
+		//@}
+
+		/** @name 
+		  * Methods related to the restrictions over the theme used to generate this theme
+          */
+		//@{
+
+		/** \brief Verifies if this theme has any kind of restrictions.
+		    \note In a Remote Theme this method always returns FALSE.
+		  */
+		virtual bool hasRestriction();
+
+		/** \brief Returns if there is an attribute restriction.
+		    \note In a Remote Theme this method always returns FALSE.
+		  */
+		virtual bool hasAttrRest();
+
+		/** \brief Returns TRUE if there is a temporal restriction defined in the theme.
+		    \note In a Remote Theme this method always returns FALSE. 
+		  */
+		virtual bool hasTemporalRest();
+
+		/** \brief Returns TRUE if this theme has a spatial restriction.
+		    \note In a Remote Theme this method always returns FALSE.
+		  */
+		virtual bool hasSpatialRest();
+
+		/** \brief Returns the clause WHERE derived from the combination of all restricitions (spatial, attribute and temporal).
+		    \note In a Remote Theme this method always returns an empty string.
+		  */
+		virtual string sqlWhereRestrictions(TeRepresentation* rep = 0);
+
+		//@}
+
+		/** @name Collection
+		  * Methods related to the materialization in the database of the theme as a collection of objects 
+          */
+		//@{
+
+		/** \brief Fills the sqlGridJoin_ and sqlGridFrom_ statements according to the status of the database.
+		    \note In a Remote Theme this method does nothing.
+		  */
+		virtual void loadTablesJoin(const string& geomTable = "");
+
+		/** \brief Returns a SQL JOIN statement to get all the attributes of the theme objects, 
+		           the attributes of the collection table, and the attributes of the extended 
+                   collection table.
+		    \note In a Remote Theme this method returns an empty string.
+	      */
+		virtual string sqlGridJoin();
+
+		/** \brief Returns a FROM clause of a SQL statement to get attributes of the theme objects,
+		           the attributes of the collection table, and the attributes of the
+				   extended collection table .
+		    \note In a Remote Theme this method returns an empty string.
+	      */
+		virtual string sqlGridFrom(const string& geomTable="");
+
+        virtual bool save(const bool& copyExternalCollection = true);
+		//! Save the the theme parameters in the database.
+		virtual bool save(TeDatabase* db, const bool& copyExternalCollection = true); 
+		
+		/** \brief Create the auxiliar collection table used to represent objects with multiple versions in time.
+		    \note In a Remote Theme this method creates a local auxiliary collection table.
+		  */
+		virtual bool createCollectionAuxTable();
+
+		/** \brief Populate the auxiliar collection table used to represent objects with multiple versions in time.
+		    \note In a Remote Theme this method populates the local auxiliary collection.
+		  */
+		virtual bool populateCollectionAux(std::string objectId = "");
+
+		//@}
+
+		//! Save the grouping parameters in memory when there is no chronon.
+		virtual bool buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll,
+			                       vector<double>* dValuesVec = 0);
+
+		//! Save the grouping parameters in memory when there is chronon.
+		virtual bool buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec);
+						   
+		//! Build the grouping and associate each object to its group in the collection table.
+		virtual bool saveGrouping(TeSelectedObjects selectedObjects = TeAll);
+
+		//! Save the theme grouping legends in the collection table.
+		virtual bool saveLegendInCollection(TeSelectedObjects selectedObjects = TeAll, std::string objectId = "");
+
+		//! Save the theme grouping legends in the collection table  
+		virtual bool saveLegendInCollection(TeDatabase* db, TeSelectedObjects selectedObjects = TeAll, std::string objectId = "");
+
+		///! Set the legend id for each object of the theme.
+		virtual void setLegendsForObjects();
+
+		//! Generates a optimized position (x,y) in the spatial extention of each object to position label or graphs.
+		virtual bool generateLabelPositions(const std::string& objectId = "");  
+
+		//! Delete grouping.
+		virtual bool deleteGrouping(); 
+		
+		//! Creates an appropriate visual presentation to the raster of the theme.
+		virtual void createRasterVisual(TeRaster* rst = 0);
+
+		/** @name Attribute Tables
+		  * A theme can use one or more attribute tables of the layer that gives its data.
+		  * These methods are related to the manipulation of these tables.
+          */
+		//@{	
+
+		//! Add a new attribute table to a theme.
+		virtual bool addThemeTable(TeTable& table);
+
+		//! Add a new attribute table to a theme.
+		virtual void addThemeTable(string tableName);
+
+		//! Verify if an attribute table is part of a theme.
+		virtual bool isThemeTable(int tableId);
+
+		//! Verify if an attribute table is part of a theme.
+		virtual bool isThemeTable(string tableName);
+
+		//! Returns the list of attribute tables used by this theme.
+		virtual TeAttrTableVector& attrTables();
+
+		//! Sets the entire list of attribute tables used by this theme.
+		virtual bool setAttTables(TeAttrTableVector& attrs);  
+
+		//! Returns a vector of attribute tables, of a specific type, used by this theme.
+		virtual bool getAttTables(TeAttrTableVector& attrs, TeAttrTableType attType = TeAllAttrTypes); 
+
+		//! Returns a representation of an attribute table  given name.
+		virtual bool getTable(TeTable& table, const string tableName);
+
+		//! Clears the list of attribute tables used by this theme.
+		virtual void clearAttTableVector();
+
+		/** \brief Returns the temporal attribute table of the theme (TeEvent or TeFixedGeomDynAttr).
+		    \note A theme supports only one temporal attribute table.
+		  */
+		virtual bool getTemporalTable(TeTable& table);
+
+		//! Removes an attribute table from the list of tables of a theme.
+		virtual bool removeThemeTable(unsigned int index);
+
+		//! Returns the the name of an attribute table that contains a given attribute.
+		virtual string getTableName(const string& attrName);
+
+		//! Returns the name of the index-th attribute resulting of the join of all attribute tables associated to the theme tables 
+		virtual string getAttribute(unsigned int index);
+
+		//! Loads the theme tables in the database
+		virtual bool loadThemeTables();
+		
+		//! Returns the list of attributes of theme tables.
+		virtual  TeAttributeList sqlAttList();
+		
+		//! Clears the list of attributes associated to the theme tables.
+		virtual void clearAttList();
+
+		//! Returns the list of numerical attributes of the theme tables.
+		virtual TeAttributeList sqlNumAttList();
+
+		//! Clears the list of numerical attributes associated to the theme tables.
+		virtual void clearNumAttList();
+
+		///! Returns a SQL JOIN statement to reach to all attribute tables used by this theme.
+		virtual string sqlJoin();
+
+		//! Returns a SQL FROM CLAUSE that gives access to all attribute tables used by this theme.
+		virtual string sqlFrom();
+
+		//! Returns the alias vector of the names of the theme tables.
+		virtual vector<string>&	aliasVector();
+
+		//! Fills aliasVector_.
+		virtual void loadAliasVector();
+
+		/** \brief Refresh list of attributes of all the theme tables.
+		    \note All attributes are stored into sqlAttList_ and numeric attributes are stored into sqlNumAttList_.
+          */
+		virtual void loadAttrLists();
+		//@}
+
+		/** @name Locate geometries
+		  * Returns the geometry(ies) of the theme given coordinate
+          */
+		//@{ 	
+
+		virtual bool locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0);
+		virtual bool locatePolygonSet(TeCoord2D &pt, double tol, TePolygonSet &polygons);
+		virtual bool locateLine(TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
+		virtual bool locatePoint(TeCoord2D &pt, TePoint &point, const double& tol = 0.0);
+		virtual bool locateCell(TeCoord2D &pt, TeCell &c, const double& tol = 0.0);
+
+		//@}
+
+		/** \brief Verifies if there are objects without geometries of a specific geometry representation.
+		  */
+		virtual bool hasObjectsWithoutGeometries(TeGeomRep geomRep);
+
+		/** \brief Removes the objects without geometries of a specific geometry representation.
+		  */
+		virtual bool removeObjectsWithoutGeometries(TeGeomRep geomRep);
+
+		/** \brief Creates a table to store information on how to connect to others databases and get remote theme.
+		    \param sourceDB A connection to a TerraLib database that stores information about others databases that can be used by remote themes. (Input)
+			\return Returns 1 if the table was created, -1 if it already exists and 0 on error.
+		  */
+		static int createExternalThemeTable(TeDatabase* sourceDB);
+
+		//! Save the theme metadata in database. 
+		virtual bool saveMetadata(TeDatabase* db); 
+
+		/** \brief Retrieves remote theme information from the database.
+		  */
+		bool getRemoteThemeInfo(int& remoteThemeId, int& databaseId);
+
+		/** \brief Sets the remote the id for this external theme
+		  */
+		void setRemoteDbId(const int& removeDbId);
+
+	protected:
+
+		/** \brief Fill the sqlJoin_ and sqlFrom_ .
+		  */
+		//virtual void loadThemeTablesJoin();
+		
+		/** \brief Populate the collection table based in the theme restrictions.
+		  */
+		virtual bool populateCollection(std::string objectId = "", const bool& sincronize = true);
+
+		/** \brief Populate map with relationateds ids from local theme and remote theme.
+		  */
+		virtual void createLegendMapId(std::map<int, int>& mapIdLegend);
+
+		/** \brief Copy the respective collection table from remoteTheme to localTheme.
+		  */
+		virtual bool copyRemoteCollection(std::map<int, int>& mapIdLegend);
+
+		//! Load the external theme metadata from database. 
+		virtual bool loadMetadata(TeDatabase* db);
+
+		//! Erase the theme metadata in database. 
+		virtual bool eraseMetadata(TeDatabase* db); 
+
+	protected:
+        //! A pointer to a theme in a remote database.
+		TeTheme* remoteTheme_;
+        TeDatabase* sourceDB_;
+        int remoteDbId_;
+};
+
+
+//!  This class implements a factory to create external theme objects. 
+class TL_DLL TeExternalThemeFactory : public TeViewNodeFactory
+{
+public:
+	//! Constructor 
+	TeExternalThemeFactory() : TeViewNodeFactory((int)TeEXTERNALTHEME)
+	{}
+
+	//! Created theme objects 
+	TeViewNode* build(TeViewNodeParams* params)
+	{	
+		TeViewNodeParams auxParams = *params;
+        return new TeExternalTheme(NULL, NULL, params->viewId_, params->name_);	
+	}
+	
+	//! Created theme objects 
+	TeViewNode* build()
+	{	
+		return new TeExternalTheme(NULL, NULL, -1);	
+	}
+};
+
+namespace 
+{
+  static TeExternalThemeFactory externalThemeFactory;
+}; 
+
+#endif	// __TERRALIB_INTERNAL_REMOTETHEME_H
+
diff --git a/src/terralib/kernel/TeFactory.h b/src/terralib/kernel/TeFactory.h
old mode 100755
new mode 100644
index 653eee2..db0dac8
--- a/src/terralib/kernel/TeFactory.h
+++ b/src/terralib/kernel/TeFactory.h
@@ -1,145 +1,145 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeFactory.h
-    \brief This file deals with the Factory Pattern 
-*/
-#ifndef  __TERRALIB_INTERNAL_FACTORY_H
-#define  __TERRALIB_INTERNAL_FACTORY_H
-
-#include <map>
-#include <string>
-
-using namespace std;
-
-//!  Implements a template for the "TeFactory" pattern.
-/*
-  The "factory" pattern is a technique for creating new
-  instances of objects which defines an abstract interface,
-  (represented by the "Make" module). The subclasses of
-  factory decide which class to instantiate.
-  
-
-  Each subclass of factory "registers" itself at compile time;
-  therefore, the addition of a new factory requires no change
-  the parent class. 
-
-  \author Gilberto Camara
-*/
-template <class T, class Arg>
-class TeFactory
-{
-public:
-
-//! Dictionary of factories (indexed by name)
-	typedef map<string, TeFactory<T,Arg>* > TeFactoryMap; 
-
-//! Returns the single instance of the factory dictionay
-	static TeFactoryMap& instance ()
-	{ 
-		static TeFactoryMap Fmap_;
-		return Fmap_;
-		
-	}
-	
-	//! Normal Constructor
-	TeFactory (const string& factoryName);
-
-	virtual ~TeFactory() {}
-
-	//! Virtual constructor using name
-	static T* make  ( string name, const Arg& arg );
-
-	//! Virtual constructor using arguments
-	static T* make  ( const Arg& arg  );
-
-
-protected:
-
-	//!  Builds a new type (should be implemented by descendants)
-    virtual T* build ( const Arg& arg ) = 0;
-
-private:
-	string  Fname_;
-};
-
-// Initialisation of static variable
-//template <class T, class Arg>
-//TeFactory<T,Arg>::TeFactoryMap TeFactory<T,Arg>::Fmap_;
-
-
-// Constructor
-template <class T, class Arg>
-TeFactory<T,Arg>::TeFactory(const string& name):
-	Fname_(name)
-{
-	TeFactory<T,Arg>::instance()[name] = this;
-
-}
-
-// Destructor
-//template <class T, class Arg>
-//TeFactory<T,Arg>::~TeFactory<T,Arg> ()
-//{
-	// Remove the object from the factory dictionary
-	// Fmap_.erase ( Fname_ );
-//}
-
-//! Builds an object, based on the input parameters
-template <class T, class Arg> 
-T*
-TeFactory<T,Arg>::make ( string name, const Arg& arg )
-{
-	// try to find the name on the factory dictionary
-	typename TeFactoryMap::iterator i = TeFactory<T,Arg>::instance().find ( name );
-
-	// Not found ?  return the Default Object   
-	if ( i == TeFactory<T,Arg>::instance().end() )
-		return T::DefaultObject( arg );
-
-	// Create an object, based on the input parameters
-	return (*i).second->build ( arg );
-	return 0;
-
-}
-
-//! Builds an object, based on the input parameters
-template <class T, class Arg> 
-T*
-TeFactory<T,Arg>::make (const Arg& arg )
-{
-	string name = arg.decName();
-
-	// try to find the name on the factory dictionary
-	typename TeFactoryMap::iterator i = TeFactory<T,Arg>::instance().find ( name );
-
-	// Not found ?  return the Default Object   
-	if ( i == TeFactory<T,Arg>::instance().end() )
-		return T::DefaultObject( arg );
-
-	// Create an object, based on the input parameters
-	return (*i).second->build ( arg );
-	return 0;
-
-}
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeFactory.h
+    \brief This file deals with the Factory Pattern 
+*/
+#ifndef  __TERRALIB_INTERNAL_FACTORY_H
+#define  __TERRALIB_INTERNAL_FACTORY_H
+
+#include <map>
+#include <string>
+
+using namespace std;
+
+//!  Implements a template for the "TeFactory" pattern.
+/*
+  The "factory" pattern is a technique for creating new
+  instances of objects which defines an abstract interface,
+  (represented by the "Make" module). The subclasses of
+  factory decide which class to instantiate.
+  
+
+  Each subclass of factory "registers" itself at compile time;
+  therefore, the addition of a new factory requires no change
+  the parent class. 
+
+  \author Gilberto Camara
+*/
+template <class T, class Arg>
+class TeFactory
+{
+public:
+
+//! Dictionary of factories (indexed by name)
+	typedef map<string, TeFactory<T,Arg>* > TeFactoryMap; 
+
+//! Returns the single instance of the factory dictionay
+	static TeFactoryMap& instance ()
+	{ 
+		static TeFactoryMap Fmap_;
+		return Fmap_;
+		
+	}
+	
+	//! Normal Constructor
+	TeFactory (const string& factoryName);
+
+	virtual ~TeFactory() {}
+
+	//! Virtual constructor using name
+	static T* make  ( string name, const Arg& arg );
+
+	//! Virtual constructor using arguments
+	static T* make  ( const Arg& arg  );
+
+
+protected:
+
+	//!  Builds a new type (should be implemented by descendants)
+    virtual T* build ( const Arg& arg ) = 0;
+
+private:
+	string  Fname_;
+};
+
+// Initialisation of static variable
+//template <class T, class Arg>
+//TeFactory<T,Arg>::TeFactoryMap TeFactory<T,Arg>::Fmap_;
+
+
+// Constructor
+template <class T, class Arg>
+TeFactory<T,Arg>::TeFactory(const string& name):
+	Fname_(name)
+{
+	TeFactory<T,Arg>::instance()[name] = this;
+
+}
+
+// Destructor
+//template <class T, class Arg>
+//TeFactory<T,Arg>::~TeFactory<T,Arg> ()
+//{
+	// Remove the object from the factory dictionary
+	// Fmap_.erase ( Fname_ );
+//}
+
+//! Builds an object, based on the input parameters
+template <class T, class Arg> 
+T*
+TeFactory<T,Arg>::make ( string name, const Arg& arg )
+{
+	// try to find the name on the factory dictionary
+	typename TeFactoryMap::iterator i = TeFactory<T,Arg>::instance().find ( name );
+
+	// Not found ?  return the Default Object   
+	if ( i == TeFactory<T,Arg>::instance().end() )
+		return T::DefaultObject( arg );
+
+	// Create an object, based on the input parameters
+	return (*i).second->build ( arg );
+	return 0;
+
+}
+
+//! Builds an object, based on the input parameters
+template <class T, class Arg> 
+T*
+TeFactory<T,Arg>::make (const Arg& arg )
+{
+	string name = arg.decName();
+
+	// try to find the name on the factory dictionary
+	typename TeFactoryMap::iterator i = TeFactory<T,Arg>::instance().find ( name );
+
+	// Not found ?  return the Default Object   
+	if ( i == TeFactory<T,Arg>::instance().end() )
+		return T::DefaultObject( arg );
+
+	// Create an object, based on the input parameters
+	return (*i).second->build ( arg );
+	return 0;
+
+}
+#endif
+
diff --git a/src/terralib/kernel/TeFileTheme.cpp b/src/terralib/kernel/TeFileTheme.cpp
index 4f94a17..fe11185 100644
--- a/src/terralib/kernel/TeFileTheme.cpp
+++ b/src/terralib/kernel/TeFileTheme.cpp
@@ -1,496 +1,559 @@
-#include "TeFileTheme.h"
-#include "TeDatabase.h"
-#include "TeSTElementSet.h"
-#include "TeGeoDataDriver.h"
-
-bool 
-TeFileTheme::createFileThemeTable(TeDatabase* db)
-{
-	if (!db)
-		return false;
-
-	if(db->tableExist("te_file_theme"))
-		return true;
-
-	TeAttributeList attList;
-
-	TeAttribute att1;
-	att1.rep_.name_ = "theme_id";
-	att1.rep_.isAutoNumber_ = false;
-	att1.rep_.isPrimaryKey_ = true;
-	att1.rep_.null_ = false;
-	att1.rep_.type_ = TeINT;
-	att1.rep_.numChar_ = 0;
-	attList.push_back(att1);
-
-	TeAttribute att2;
-	att2.rep_.name_ = "file_name";
-	att2.rep_.isAutoNumber_ = false;
-	att2.rep_.isPrimaryKey_ = false;
-	att2.rep_.null_ = false;
-	att2.rep_.type_ = TeSTRING;
-	att2.rep_.numChar_ = 255;
-	attList.push_back(att2);
-
-	TeAttribute att3;
-	att3.rep_.name_ = "geom_rep";
-	att3.rep_.isAutoNumber_ = false;
-	att3.rep_.isPrimaryKey_ = false;
-	att3.rep_.null_ = false;
-	att3.rep_.type_ = TeINT;
-	att3.rep_.numChar_ = 0;
-	attList.push_back(att3);
-
-	TeAttribute att4;
-	att4.rep_.name_ = "proj_id";
-	att4.rep_.isAutoNumber_ = false;
-	att4.rep_.isPrimaryKey_ = false;
-	att4.rep_.null_ = false;
-	att4.rep_.type_ = TeINT;
-	att4.rep_.numChar_ = 0;
-	attList.push_back(att4);
-
-	if (!db->createTable("te_file_theme", attList)||
-		!db->createRelation("fk_file_theme_id", "te_file_theme", "theme_id", "te_theme", "theme_id", true) ||
-		!db->createRelation("fk_file_theme_proj_id", "te_file_theme", "proj_id", "te_projection", "projection_id", false))
-		return false;
-	return 1;
-}
-
-
-
-TeFileTheme::TeFileTheme(const string& name, TeViewNode* parent, int view, int id):
-		TeAbstractTheme(name, parent, view, id, TeFILETHEME),
-		data_(0), 
-		fileName_(""), 
-		localDb_(0),
-		numObjects_(0),
-		projection_(0),
-		dataDriver_(0)
-{}
-
-TeFileTheme::TeFileTheme(const std::string& themeName, TeGeoDataDriver* dataDriver, TeDatabase* localDb, TeViewNode* parent, int view):
-		TeAbstractTheme(themeName, parent, view, 0, TeFILETHEME), 
-		data_(0),
-		localDb_(localDb),
-		numObjects_(0),
-		projection_(0),
-		dataDriver_(dataDriver)
-{
-	if (dataDriver_)
-	{
-		TeBox bb;
-		TeGeomRep aux;
-		dataDriver_->getDataInfo(numObjects_, bb, aux);
-		this->visibleRep(aux);
-		this->setThemeBox(bb);
-		fileName_= dataDriver->getFileName();
-	}
-}
-
-TeFileTheme::TeFileTheme(const TeFileTheme& other):
-		TeAbstractTheme(static_cast<const TeAbstractTheme&>(other))
-{
-	fileName_ = other.fileName_;
-	localDb_ = other.localDb_;
-	data_ = other.data_;  
-	projection_ = other.projection_;
-}
-
-TeFileTheme::~TeFileTheme()
-{
-	if(data_)
-		delete data_;
-	data_ = 0;
-	if (dataDriver_)
-		delete dataDriver_;
-	dataDriver_ = 0; 
-}
-
-TeFileTheme& 
-TeFileTheme::operator=(TeFileTheme& rhs)
-{
-	if ( this != &rhs )
-	{
-		*(TeAbstractTheme*)this = rhs;
-		fileName_ = rhs.fileName_;
-		localDb_ = rhs.localDb_;
-
-		if(data_)
-			delete data_;
-		data_ = rhs.data_;  
-		projection_ = rhs.projection_;
-		dataDriver_ = rhs.dataDriver_;
-	}
-	return *this;
-}
-
-
-void
-TeFileTheme::setDataDriver(TeGeoDataDriver* dataDriver)
-{ 
-	if (!dataDriver)
-		return;
-
-	if (dataDriver_)
-		delete dataDriver_;
-
-	dataDriver_ = dataDriver;
-
-	TeBox bb;
-	TeGeomRep aux;
-	dataDriver_->getDataInfo(numObjects_, bb, aux);
-	this->visibleRep(aux);
-    this->setThemeBox(bb);
-}
-
-TeGeoDataDriver* 
-TeFileTheme::getDataDriver()
-{
-	return dataDriver_;
-}
-
-TeSTElementSet* 
-TeFileTheme::getData()
-{
-	return data_;
-}
-
-void 
-TeFileTheme::setFileName(const std::string& fileName)
-{
-	fileName_ = fileName;
-}
-
-std::string 
-TeFileTheme::getFileName()
-{
-	return fileName_;
-}
-
-void 
-TeFileTheme::setLocalDatabase(TeDatabase* db)
-{	
-	this->localDb_ = db; 
-}
-
-TeDatabase* 
-TeFileTheme::getLocalDatabase()
-{ 
-	return localDb_; 
-}
-
-void 
-TeFileTheme::clearData() 
-{ 
-	data_->clear(); 
-}
-
-unsigned int 
-TeFileTheme::getNumberOfObjects()
-{	
-	return numObjects_; 
-}
-
-void 
-TeFileTheme::setNumberOfObjects(unsigned int n)
-{
-	numObjects_ = n;
-}
-
-
-
-bool
-TeFileTheme::retrieveDataFromFile()
-{
-    if(!dataDriver_)
-		return false;
-
-	TeAttributeList att;
-	dataDriver_->getDataAttributesList(att);
-	data_ = new TeSTElementSet(this->box(),att);
-
-	if (!dataDriver_->loadData(data_))
-	{
-		delete data_;
-		data_ = 0;
-		return false;
-	}
-	return true;
-}
-
-bool
-TeFileTheme::loadMetadata(TeDatabase* localDb_)
-{
-	if(!localDb_)
-		return false;
-
-	//second: load specific theme information from te_file_theme table
-	TeDatabasePortal* portal = localDb_->getPortal();
-	if(!portal)
-		return false;
-
-	//table: theme_id, file_name, geom_rep
-	std::string sql = " SELECT te_file_theme.*, ";	
-	sql += " te_projection.* ";						 
-	sql += " FROM te_file_theme, te_projection ";
-	sql += " WHERE te_file_theme.proj_id = te_projection.projection_id ";
-	sql += " AND theme_id = "+ Te2String(id());
-
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	fileName_ = portal->getData(1);
-	TeAbstractTheme::visibleRep(portal->getInt(2));
-
-	FILE* fp = fopen(fileName_.c_str(), "r");
-	if(!fp)
-		return false;
-	else
-		fclose(fp);
-	
-	delete projection_;
-	portal->getProjection(&projection_, 4);
-	return true;
-}
-
-bool 
-TeFileTheme::saveMetadata(TeDatabase* localDb_)
-{
-	if(!localDb_)
-		return false;
-
-	//insert theme in database 
-	if(id()==0)
-	{
-		if(!localDb_->insertTheme(this)) //updateThemeTable
-		{
-			localDb_->deleteTheme(this->id());
-			return false;
-		}
-	}
-
-	if (!projection_)
-		projection_ = new TeNoProjection();
-	if (projection_->id() <= 0)
-		localDb_->insertProjection(projection_);
-
-	// remove the metadata currently stored
-	string strSQL;
-	strSQL = "DELETE FROM te_file_theme WHERE theme_id = ";
- 	strSQL += Te2String(id());
-    localDb_->execute(strSQL);
-
-	// insert the current metadata
-	strSQL  = "INSERT INTO te_file_theme (theme_id, file_name, geom_rep, proj_id) VALUES (";
-	strSQL += Te2String(id());
-	strSQL += ", '";
-	strSQL += fileName_;
-	strSQL += "', ";
-	strSQL += Te2String(visibleRep_);
-	strSQL += ", ";
-	strSQL += Te2String(projection_->id());
-	strSQL += ")";
-
-	if(!localDb_->execute(strSQL))
-	{
-		localDb_->deleteTheme(this->id());
-		return false;
-	}
-	return true;
-}
-
-
-bool 
-TeFileTheme::eraseMetadata(TeDatabase* localDb_)
-{
-	if (!localDb_)
-		return false;
-
-	int proid = -1;
-	string strSQL = "SELECT proj_id FROM te_file_theme WHERE theme_id = "+ Te2String(this->id());
-	TeDatabasePortal* portal = localDb_->getPortal();
-	if (portal->query(strSQL) && portal->fetchRow())
-		proid = portal->getInt(0);
-	delete portal;
-
-	strSQL  = " DELETE FROM te_file_theme ";
-    strSQL += " WHERE theme_id = "+ Te2String(this->id());
-	
-	if (!localDb_->execute(strSQL))
-		return false;
-
-	if (proid > 0)
-	{
-		strSQL = "DELETE FROM te_projection WHERE projection_id = " + Te2String(proid);
-		localDb_->execute(strSQL);
-	}
-	return true;
-}
-
-
-TeProjection* 
-TeFileTheme::getThemeProjection()
-{	
-	return projection_; 
-}
-
-void 
-TeFileTheme::setThemeProjection(TeProjection* proj)
-{ 
-	if (projection_)
-		delete projection_;
-	projection_ = proj; 
-}
-
-bool 
-TeFileTheme::buildGrouping(const TeGrouping& , TeSelectedObjects , vector<double>* )
-{
-	return true;
-}
-
-bool 
-TeFileTheme::buildGrouping(const TeGrouping& , TeChronon , vector<map<string, string> >& )
-{
-	return true;
-}
-
-bool 
-TeFileTheme::saveGrouping(TeSelectedObjects )
-{
-	return true;
-}
-        
-
-void 
-TeFileTheme::setLegendsForObjects()
-{
-}
-
-bool 
-TeFileTheme::deleteGrouping()
-{
-	return true;
-}
-
-bool 
-TeFileTheme::save()
-{
-	//insert theme in database 
-	if(id()==0)
-	{
-		if(!localDb_->insertTheme(this)) //updateThemeTable
-		{
-			localDb_->deleteTheme(this->id());
-			return false;
-		}
-	}
-	else
-	{
-		if(!localDb_->updateTheme(this)) //updateThemeTable
-		{
-			localDb_->deleteTheme(this->id());
-			return false;
-		}
-	}
-	return true;
-}
-
-bool 
-TeFileTheme::locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol)
-{
-    TePolygonSet aux;
-	if(!locatePolygonSet(pt, tol, aux))
-		return false;
-	if(aux.empty())
-		return false;
-	
-	polygon = aux[0];
-	return true;	
-}
-
-bool 
-TeFileTheme::locatePolygonSet(TeCoord2D& /*pt*/, double /*tol*/, TePolygonSet& /*polygons*/)
-{
-	if(!data_)
-		return false;
-//	if(!data_->locateGeometry(pt, polygons, tol))
-//		return false;
-	return true;
-}
-
-bool 
-TeFileTheme::locateLine(TeCoord2D& /*pt*/, TeLine2D& line, const double& /*tol*/)
-{
-	TeLineSet aux;
-	if(!data_)
-		return false;
-//	if(!data_->locateGeometry(pt, aux, tol))
-//		return false;
-	if(aux.empty())
-		return false;
-	line = aux[0];
-	return true;
-}
-
-bool 
-TeFileTheme::locatePoint(TeCoord2D& /*pt*/, TePoint &point, const double& /*tol*/)
-{
-	TePointSet aux;
-	if(!data_)
-		return false;
-//	if(!data_->locateGeometry(pt, aux, tol))
-//		return false;
-	if(aux.empty())
-		return false;
-	point = aux[0];
-	return true;
-}
-
-bool 
-TeFileTheme::locateCell(TeCoord2D&, TeCell&, const double&)
-{
-	return false;
-}
-
-
-std::set<std::string> 
-TeFileTheme::getObjects(TeSelectedObjects )
-{
-	std::set<std::string> set;
-	return set;
-}
-
-
-std::set<std::string> 
-TeFileTheme::getObjects(const vector<string>& )
-{
-	std::set<std::string> set;
-	return set;
-}
-
-
-std::vector<std::string>  
-TeFileTheme::getItemVector(TeSelectedObjects )
-{
-	std::vector<std::string> set;
-	return set;
-}
-
-
-std::vector<std::string>  
-TeFileTheme::getItemVector(const set<string>& )
-{
-	std::vector<std::string> set;
-	return set;
-}
-
-void
-TeFileTheme::setOwnLegendsForObjects()
-{
-
-}
-
+#include "TeFileTheme.h"
+#include "TeDatabase.h"
+#include "TeSTElementSet.h"
+#include "TeGeoDataDriver.h"
+#include "TeRaster.h"
+
+bool 
+TeFileTheme::createFileThemeTable(TeDatabase* db)
+{
+	if (!db)
+		return false;
+
+	if(db->tableExist("te_file_theme"))
+		return true;
+
+	TeAttributeList attList;
+
+	TeAttribute att1;
+	att1.rep_.name_ = "theme_id";
+	att1.rep_.isAutoNumber_ = false;
+	att1.rep_.isPrimaryKey_ = true;
+	att1.rep_.null_ = false;
+	att1.rep_.type_ = TeINT;
+	att1.rep_.numChar_ = 0;
+	attList.push_back(att1);
+
+	TeAttribute att2;
+	att2.rep_.name_ = "file_name";
+	att2.rep_.isAutoNumber_ = false;
+	att2.rep_.isPrimaryKey_ = false;
+	att2.rep_.null_ = false;
+	att2.rep_.type_ = TeSTRING;
+	att2.rep_.numChar_ = 255;
+	attList.push_back(att2);
+
+	TeAttribute att3;
+	att3.rep_.name_ = "geom_rep";
+	att3.rep_.isAutoNumber_ = false;
+	att3.rep_.isPrimaryKey_ = false;
+	att3.rep_.null_ = false;
+	att3.rep_.type_ = TeINT;
+	att3.rep_.numChar_ = 0;
+	attList.push_back(att3);
+
+	TeAttribute att4;
+	att4.rep_.name_ = "proj_id";
+	att4.rep_.isAutoNumber_ = false;
+	att4.rep_.isPrimaryKey_ = false;
+	att4.rep_.null_ = false;
+	att4.rep_.type_ = TeINT;
+	att4.rep_.numChar_ = 0;
+	attList.push_back(att4);
+
+	if (!db->createTable("te_file_theme", attList)||
+		!db->createRelation("fk_file_theme_id", "te_file_theme", "theme_id", "te_theme", "theme_id", true) ||
+		!db->createRelation("fk_file_theme_proj_id", "te_file_theme", "proj_id", "te_projection", "projection_id", false))
+		return false;
+	return 1;
+}
+
+
+
+TeFileTheme::TeFileTheme(const string& name, TeViewNode* parent, int view, int id):
+		TeAbstractTheme(name, parent, view, id, TeFILETHEME),
+		data_(0), 
+		fileName_(""), 
+		localDb_(0),
+		numObjects_(0),
+		projection_(0),
+		dataDriver_(0),
+		raster_(0)
+{
+	setRasterFile(name);
+}
+
+TeFileTheme::TeFileTheme(const std::string& themeName, TeGeoDataDriver* dataDriver, TeDatabase* localDb, TeViewNode* parent, int view):
+TeAbstractTheme(themeName, parent, view, 0, TeFILETHEME), 
+data_(0),
+localDb_(localDb),
+numObjects_(0),
+projection_(0),
+dataDriver_(0),
+raster_(0)
+{
+	if(dataDriver != 0)
+	{
+		fileName_= dataDriver->getFileName();
+		setDataDriver(dataDriver);
+	}
+}
+
+TeFileTheme::TeFileTheme(const TeFileTheme& other):
+TeAbstractTheme(static_cast<const TeAbstractTheme&>(other)),
+dataDriver_(0)
+{
+	fileName_ = other.fileName_;
+	localDb_ = other.localDb_;
+	data_ = other.data_;  
+	projection_ = other.projection_;
+
+	if(other.dataDriver_ != 0)
+		setDataDriver(other.dataDriver_);
+
+	if(other.raster_ != 0)
+		setRasterFile(other.fileName_);
+}
+
+TeFileTheme::~TeFileTheme()
+{
+	if(data_)
+		delete data_;
+	data_ = 0;
+	if (dataDriver_)
+		delete dataDriver_;
+	dataDriver_ = 0; 
+
+	delete projection_;
+
+	delete raster_;
+}
+
+TeFileTheme& 
+TeFileTheme::operator=(TeFileTheme& rhs)
+{
+	if ( this != &rhs )
+	{
+		*(TeAbstractTheme*)this = rhs;
+		fileName_ = rhs.fileName_;
+		localDb_ = rhs.localDb_;
+
+		if(data_)
+			delete data_;
+		data_ = rhs.data_;  
+		projection_ = rhs.projection_;
+
+		if(rhs.dataDriver_ != 0)
+			setDataDriver(rhs.dataDriver_);
+	
+		if(rhs.raster_ != 0)
+			setRasterFile(rhs.fileName_);
+
+	}
+	return *this;
+}
+
+TeViewNode* TeFileTheme::clone()
+{
+	TeFileTheme* theme = new TeFileTheme();
+	*theme = *this;
+	return theme;
+}
+
+void 
+TeFileTheme::setRasterFile(const std::string& fileName)
+{
+	if(fileName.empty())
+		return;
+
+	delete raster_;
+	
+	raster_ = new TeRaster(fileName);
+
+	if(!raster_->init())
+	{
+		delete raster_;
+		raster_ = 0;
+	}
+	else
+	{
+		this->fileName_ = fileName;
+		this->visibleRep(TeRASTERFILE);
+		this->setThemeBox(raster_->box());
+	}
+}
+
+TeRaster* 
+TeFileTheme::getRasterFile()
+{
+	return raster_;
+}
+
+void
+TeFileTheme::setDataDriver(TeGeoDataDriver* dataDriver)
+{ 
+	if (!dataDriver)
+		return;
+
+	if (dataDriver_)
+		delete dataDriver_;
+
+	dataDriver_ = dataDriver;
+
+	TeBox bb;
+	TeGeomRep aux;
+	dataDriver_->getDataInfo(numObjects_, bb, aux);
+	this->visibleRep(aux);
+    this->setThemeBox(bb);
+}
+
+TeGeoDataDriver* 
+TeFileTheme::getDataDriver()
+{
+	return dataDriver_;
+}
+
+TeSTElementSet* 
+TeFileTheme::getData()
+{
+	return data_;
+}
+
+void 
+TeFileTheme::setFileName(const std::string& fileName)
+{
+	fileName_ = fileName;
+}
+
+std::string 
+TeFileTheme::getFileName()
+{
+	return fileName_;
+}
+
+void 
+TeFileTheme::setLocalDatabase(TeDatabase* db)
+{	
+	this->localDb_ = db; 
+}
+
+TeDatabase* 
+TeFileTheme::getLocalDatabase()
+{ 
+	return localDb_; 
+}
+
+void 
+TeFileTheme::clearData() 
+{ 
+	data_->clear(); 
+}
+
+unsigned int 
+TeFileTheme::getNumberOfObjects()
+{	
+	return numObjects_; 
+}
+
+void 
+TeFileTheme::setNumberOfObjects(unsigned int n)
+{
+	numObjects_ = n;
+}
+
+
+
+bool
+TeFileTheme::retrieveDataFromFile()
+{
+    if(!dataDriver_)
+		return false;
+
+	TeBox bb;
+	TeGeomRep aux;
+	dataDriver_->getDataInfo(numObjects_, bb, aux);
+	this->visibleRep(aux);
+	this->setThemeBox(bb);
+	fileName_= dataDriver_->getFileName();
+
+	TeAttributeList att;
+	dataDriver_->getDataAttributesList(att);
+	data_ = new TeSTElementSet(this->box(),att);
+
+	if(!dataDriver_->loadData(data_))
+	{
+		delete data_;
+		data_ = 0;
+		return false;
+	}
+
+	return true;
+}
+
+bool
+TeFileTheme::loadMetadata(TeDatabase* localDb)
+{
+	if(!localDb)
+		return false;
+
+	localDb_ = localDb;
+
+	//second: load specific theme information from te_file_theme table
+	TeDatabasePortal* portal = localDb_->getPortal();
+	if(!portal)
+		return false;
+
+	//table: theme_id, file_name, geom_rep
+	std::string sql = " SELECT te_file_theme.*, ";	
+	sql += " te_projection.* ";						 
+	sql += " FROM te_file_theme, te_projection ";
+	sql += " WHERE te_file_theme.proj_id = te_projection.projection_id ";
+	sql += " AND theme_id = "+ Te2String(id());
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	fileName_ = portal->getData(1);
+	TeAbstractTheme::visibleRep(portal->getInt(2));
+
+	FILE* fp = fopen(fileName_.c_str(), "r");
+	if(!fp)
+		return false;
+	else
+		fclose(fp);
+	
+	delete projection_;
+	portal->getProjection(&projection_, 4);
+	return true;
+}
+
+bool 
+TeFileTheme::saveMetadata(TeDatabase* localDb_)
+{
+	if(!localDb_)
+		return false;
+
+	//insert theme in database 
+	if(id()==0)
+	{
+		if(!localDb_->insertTheme(this)) //updateThemeTable
+		{
+			localDb_->deleteTheme(this->id());
+			return false;
+		}
+	}
+
+	if (!projection_)
+		projection_ = new TeNoProjection();
+	if (projection_->id() <= 0)
+		localDb_->insertProjection(projection_);
+
+	// remove the metadata currently stored
+	string strSQL;
+	strSQL = "DELETE FROM te_file_theme WHERE theme_id = ";
+ 	strSQL += Te2String(id());
+    localDb_->execute(strSQL);
+
+	// insert the current metadata
+	strSQL  = "INSERT INTO te_file_theme (theme_id, file_name, geom_rep, proj_id) VALUES (";
+	strSQL += Te2String(id());
+	strSQL += ", '";
+	strSQL += fileName_;
+	strSQL += "', ";
+	strSQL += Te2String(visibleRep_);
+	strSQL += ", ";
+	strSQL += Te2String(projection_->id());
+	strSQL += ")";
+
+	if(!localDb_->execute(strSQL))
+	{
+		localDb_->deleteTheme(this->id());
+		return false;
+	}
+	return true;
+}
+
+
+bool 
+TeFileTheme::eraseMetadata(TeDatabase* localDb_)
+{
+	if (!localDb_)
+		return false;
+
+	int proid = -1;
+	string strSQL = "SELECT proj_id FROM te_file_theme WHERE theme_id = "+ Te2String(this->id());
+	TeDatabasePortal* portal = localDb_->getPortal();
+	if (portal->query(strSQL) && portal->fetchRow())
+		proid = portal->getInt(0);
+	delete portal;
+
+	strSQL  = " DELETE FROM te_file_theme ";
+    strSQL += " WHERE theme_id = "+ Te2String(this->id());
+	
+	if (!localDb_->execute(strSQL))
+		return false;
+
+	if (proid > 0)
+	{
+		strSQL = "DELETE FROM te_projection WHERE projection_id = " + Te2String(proid);
+		localDb_->execute(strSQL);
+	}
+	return true;
+}
+
+
+TeProjection* 
+TeFileTheme::getThemeProjection()
+{	
+	return projection_; 
+}
+
+void 
+TeFileTheme::setThemeProjection(TeProjection* proj)
+{ 
+	if (projection_)
+		delete projection_;
+	projection_ = proj; 
+}
+
+bool 
+TeFileTheme::buildGrouping(const TeGrouping& , TeSelectedObjects , vector<double>* )
+{
+	return true;
+}
+
+bool 
+TeFileTheme::buildGrouping(const TeGrouping& , TeChronon , vector<map<string, string> >& )
+{
+	return true;
+}
+
+bool 
+TeFileTheme::saveGrouping(TeSelectedObjects )
+{
+	return true;
+}
+        
+
+void 
+TeFileTheme::setLegendsForObjects()
+{
+}
+
+bool 
+TeFileTheme::deleteGrouping()
+{
+	return true;
+}
+
+bool 
+TeFileTheme::save()
+{
+	//insert theme in database 
+	if(id()==0)
+	{
+		if(!localDb_->insertTheme(this)) //updateThemeTable
+		{
+			localDb_->deleteTheme(this->id());
+			return false;
+		}
+	}
+	else
+	{
+		if(!localDb_->updateTheme(this)) //updateThemeTable
+		{
+			localDb_->deleteTheme(this->id());
+			return false;
+		}
+	}
+	return true;
+}
+
+bool 
+TeFileTheme::locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol)
+{
+    TePolygonSet aux;
+	if(!locatePolygonSet(pt, tol, aux))
+		return false;
+	if(aux.empty())
+		return false;
+	
+	polygon = aux[0];
+	return true;	
+}
+
+bool 
+TeFileTheme::locatePolygonSet(TeCoord2D& /*pt*/, double /*tol*/, TePolygonSet& /*polygons*/)
+{
+	if(!data_)
+		return false;
+//	if(!data_->locateGeometry(pt, polygons, tol))
+//		return false;
+	return true;
+}
+
+bool 
+TeFileTheme::locateLine(TeCoord2D& /*pt*/, TeLine2D& line, const double& /*tol*/)
+{
+	TeLineSet aux;
+	if(!data_)
+		return false;
+//	if(!data_->locateGeometry(pt, aux, tol))
+//		return false;
+	if(aux.empty())
+		return false;
+	line = aux[0];
+	return true;
+}
+
+bool 
+TeFileTheme::locatePoint(TeCoord2D& /*pt*/, TePoint &point, const double& /*tol*/)
+{
+	TePointSet aux;
+	if(!data_)
+		return false;
+//	if(!data_->locateGeometry(pt, aux, tol))
+//		return false;
+	if(aux.empty())
+		return false;
+	point = aux[0];
+	return true;
+}
+
+bool 
+TeFileTheme::locateCell(TeCoord2D&, TeCell&, const double&)
+{
+	return false;
+}
+
+
+std::set<std::string> 
+TeFileTheme::getObjects(TeSelectedObjects )
+{
+	std::set<std::string> set;
+	return set;
+}
+
+
+std::set<std::string> 
+TeFileTheme::getObjects(const vector<string>& )
+{
+	std::set<std::string> set;
+	return set;
+}
+
+
+std::vector<std::string>  
+TeFileTheme::getItemVector(TeSelectedObjects )
+{
+	std::vector<std::string> set;
+	return set;
+}
+
+
+std::vector<std::string>  
+TeFileTheme::getItemVector(const set<string>& )
+{
+	std::vector<std::string> set;
+	return set;
+}
+
+void
+TeFileTheme::setOwnLegendsForObjects()
+{
+
+}
+
diff --git a/src/terralib/kernel/TeFileTheme.h b/src/terralib/kernel/TeFileTheme.h
index 9ae465b..97ffed6 100644
--- a/src/terralib/kernel/TeFileTheme.h
+++ b/src/terralib/kernel/TeFileTheme.h
@@ -1,212 +1,223 @@
-/************************************************************************************
- TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/** \file TeFileTheme.h
-    \brief This file contains direct implementation of TeTheme in order to support themes 
-	created directly from shapefiles.
-*/
-
-#ifndef  __TERRALIB_INTERNAL_FILETHEME_H
-#define  __TERRALIB_INTERNAL_FILETHEME_H
-
-#include "TeDefines.h"
-
-// STL's include files
-#include <map>
-#include <vector>
-#include <string>
-
-// TerraLib's include files and forward declarations
-#include "TeAbstractTheme.h"
-
-class TeDatabase;
-class TeSTElementSet;
-class TeProjection;
-class TeGeoDataDriver;
-
-class TL_DLL TeFileTheme : public TeAbstractTheme
-{
-protected:
-	TeSTElementSet*		data_;			// data is kept internally in a TeSTElementSet
-	std::string			fileName_;		// location of the file	
-	TeDatabase*			localDb_;		// a pointer to the database that stores the theme
-	unsigned int		numObjects_;	// number of objects that the theme has access to
-	TeProjection*		projection_;	// spatial reference of the objects in the file
-	TeGeoDataDriver*	dataDriver_;	// a pointer to decoder to get an specific data 
-
-public:
-	//! Default constructor
-	TeFileTheme(const std::string& name = "", TeViewNode* parent = 0, int view = 0, int id = 0);
-
-	//! Constructor from specific parameters
-	TeFileTheme(const std::string& name, TeGeoDataDriver* dataDriver, TeDatabase* localDb, TeViewNode* parent = 0, int view = 0);
-
-	//! Copy constructor
-	TeFileTheme(const TeFileTheme& other);
-
-	//! Operator =
-	TeFileTheme& operator=(TeFileTheme& rhs);
-
-	//! Destructor
-	~TeFileTheme();
-
-	//! Set the data driver that will handle this file
-	void setDataDriver(TeGeoDataDriver* dataDriver);
-
-	//! Get the data driver that will handle this file
-	TeGeoDataDriver* getDataDriver();
-
-	//! Give access to theme data as stored internally
-    TeSTElementSet* getData();
-	
-	//! Set the name of the file that contains the data
-	void setFileName(const std::string& fileName);
-
-	//! Get the name of the file that contains the data
-	std::string getFileName();
-
-	//! Set the pointer to the database where the theme is stored
-	void setLocalDatabase(TeDatabase* db); 
-	
-	//! Get the pointer to the database where the theme is stored
-	TeDatabase* getLocalDatabase(); 
-
-// --- Methods responsible to the persistence of this kind of theme
-
-	//! An static method to create a metadata table to store information about this type of theme
-	static bool createFileThemeTable(TeDatabase* db);
-
-	//! Load the basic information about the data set from the file
-	bool retrieveMetadataFromFile();
-
-	//! Load the objects from the file and fills the set of elements
-	bool retrieveDataFromFile();
-
-	//! Releases the internal data set
-	void clearData(); 	
-
-//--- Methods that reimplement the interface defined by the abstract theme
-
-	//! Return a pointer to the projection of the geometries accessible by this theme
-	TeProjection* getThemeProjection();
-
-	//! Set the projection of the geometries accessible by this theme
-	void setThemeProjection(TeProjection* proj);
-
-	//! Get the number of objects acessible by this theme
-	unsigned int getNumberOfObjects(); 
-
-	//! Set the number of objects acessible by this theme
-	void setNumberOfObjects(unsigned int); 
-
-	//! Load metadata information about this theme
-	bool loadMetadata(TeDatabase*);
-
-	//! Save metadata information about this theme
-	bool saveMetadata(TeDatabase* );
-
-	//! Erase the theme metadata in the database
-	bool eraseMetadata(TeDatabase* );
-
-	//! This method is kept for compatibility reasons with the abstract theme it doesn't do anything
-	bool save();
-
-	//! Save the grouping parameters in memory when there is no chronon
-	bool buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll, vector<double>* dValuesVec = 0);
-
-	//! Save the grouping parameters in memory when there is chronon
-	bool buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec);
-
-	//! Build the grouping and associate each object to its group 
-	bool saveGrouping(TeSelectedObjects selectedObjects = TeAll);
-
-	//! Delete grouping
-	bool deleteGrouping(); 
-
-	//! Set the legend id for each object of the theme 
-	void setLegendsForObjects();
-
-	//! Set the own legend id for each object of the theme 
-	void setOwnLegendsForObjects();
-
-/** @name Locate geometries
-	Returns the geometry(ies) of the theme given coordinate
-*/
-//@{
-	bool locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol);
-
-	bool locatePolygonSet(TeCoord2D &pt, double tol, TePolygonSet &polygons);
-	
-	bool locateLine(TeCoord2D &pt, TeLine2D &line, const double& tol);
-
-	bool locatePoint(TeCoord2D &pt, TePoint &point, const double& tol);
-
-	bool locateCell(TeCoord2D &pt, TeCell &c, const double& tol);
-//@}
-
-	//! Get the set of objects corresponding to the object selection criteria
-	set<string> getObjects(TeSelectedObjects selectedObjects = TeAll);
-
-	//! Get the set of objects corresponding to the list of items
-	set<string> getObjects(const vector<string>& itemVec);
-
-	//! Get the set of items corresponding to the object selection criteria
-	vector<string> getItemVector(TeSelectedObjects selectedObjects);
-
-	//! Get the set of items corresponding to the set of objects
-	vector<string> getItemVector(const set<string>& oidSet);
-
-};
-
-
-//!  This class implements a factory to create remote theme objects. 
-/*!  
-	
-*/
-class TeFileThemeFactory : public TeViewNodeFactory
-{
-public:
-	//! Constructor 
-	TeFileThemeFactory() : TeViewNodeFactory((int)TeFILETHEME)
-	{}
-
-	//! Created theme objects 
-	TeViewNode* build(TeViewNodeParams* params)
-	{	
-		TeViewNodeParams auxParams = *params;
-		return new TeFileTheme(auxParams.name_, auxParams.myParent_, auxParams.viewId_, auxParams.id_);	
-	}
-	
-	TeViewNode* build()
-	{
-		return new TeFileTheme();
-	}
-};
-
-namespace 
-{
-  static TeFileThemeFactory fileThemeFactory;
-}; 
-
-
-#endif	// __TERRALIB_INTERNAL_FILETHEME_H
-
+/************************************************************************************
+ TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/** \file TeFileTheme.h
+    \brief This file contains direct implementation of TeTheme in order to support themes 
+	created directly from shapefiles.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_FILETHEME_H
+#define  __TERRALIB_INTERNAL_FILETHEME_H
+
+#include "TeDefines.h"
+
+// STL's include files
+#include <map>
+#include <vector>
+#include <string>
+
+// TerraLib's include files and forward declarations
+#include "TeAbstractTheme.h"
+
+class TeDatabase;
+class TeSTElementSet;
+class TeProjection;
+class TeGeoDataDriver;
+class TeRaster;
+
+class TL_DLL TeFileTheme : public TeAbstractTheme
+{
+protected:
+	TeSTElementSet*		data_;			// data is kept internally in a TeSTElementSet
+	std::string			fileName_;		// location of the file	
+	TeDatabase*			localDb_;		// a pointer to the database that stores the theme
+	unsigned int		numObjects_;	// number of objects that the theme has access to
+	TeProjection*		projection_;	// spatial reference of the objects in the file
+	TeGeoDataDriver*	dataDriver_;	// a pointer to decoder to get an specific data
+	TeRaster*			raster_;		// a pointer to a raster file
+
+public:
+	//! Default constructor
+	TeFileTheme(const std::string& name = "", TeViewNode* parent = 0, int view = 0, int id = 0);
+
+	//! Constructor from specific parameters
+	TeFileTheme(const std::string& name, TeGeoDataDriver* dataDriver, TeDatabase* localDb, TeViewNode* parent = 0, int view = 0);
+
+	//! Copy constructor
+	TeFileTheme(const TeFileTheme& other);
+
+	//! Operator =
+	TeFileTheme& operator=(TeFileTheme& rhs);	
+
+	//! Destructor
+	~TeFileTheme();
+
+	//! Clones the object
+	virtual TeViewNode* clone();
+
+	//! Set the raste file name
+	void setRasterFile(const std::string& fileName);
+
+	//! Get a pointer to a raste file
+	TeRaster* getRasterFile();
+
+	//! Set the data driver that will handle this file
+	void setDataDriver(TeGeoDataDriver* dataDriver);
+
+	//! Get the data driver that will handle this file
+	TeGeoDataDriver* getDataDriver();
+
+	//! Give access to theme data as stored internally
+    TeSTElementSet* getData();
+	
+	//! Set the name of the file that contains the data
+	void setFileName(const std::string& fileName);
+
+	//! Get the name of the file that contains the data
+	std::string getFileName();
+
+	//! Set the pointer to the database where the theme is stored
+	void setLocalDatabase(TeDatabase* db); 
+	
+	//! Get the pointer to the database where the theme is stored
+	TeDatabase* getLocalDatabase(); 
+
+// --- Methods responsible to the persistence of this kind of theme
+
+	//! An static method to create a metadata table to store information about this type of theme
+	static bool createFileThemeTable(TeDatabase* db);
+
+	//! Load the basic information about the data set from the file
+	bool retrieveMetadataFromFile();
+
+	//! Load the objects from the file and fills the set of elements
+	bool retrieveDataFromFile();
+
+	//! Releases the internal data set
+	void clearData(); 	
+
+//--- Methods that reimplement the interface defined by the abstract theme
+
+	//! Return a pointer to the projection of the geometries accessible by this theme
+	TeProjection* getThemeProjection();
+
+	//! Set the projection of the geometries accessible by this theme
+	void setThemeProjection(TeProjection* proj);
+
+	//! Get the number of objects acessible by this theme
+	unsigned int getNumberOfObjects(); 
+
+	//! Set the number of objects acessible by this theme
+	void setNumberOfObjects(unsigned int); 
+
+	//! Load metadata information about this theme
+	bool loadMetadata(TeDatabase*);
+
+	//! Save metadata information about this theme
+	bool saveMetadata(TeDatabase* );
+
+	//! Erase the theme metadata in the database
+	bool eraseMetadata(TeDatabase* );
+
+	//! This method is kept for compatibility reasons with the abstract theme it doesn't do anything
+	bool save();
+
+	//! Save the grouping parameters in memory when there is no chronon
+	bool buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll, vector<double>* dValuesVec = 0);
+
+	//! Save the grouping parameters in memory when there is chronon
+	bool buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec);
+
+	//! Build the grouping and associate each object to its group 
+	bool saveGrouping(TeSelectedObjects selectedObjects = TeAll);
+
+	//! Delete grouping
+	bool deleteGrouping(); 
+
+	//! Set the legend id for each object of the theme 
+	void setLegendsForObjects();
+
+	//! Set the own legend id for each object of the theme 
+	void setOwnLegendsForObjects();
+
+/** @name Locate geometries
+	Returns the geometry(ies) of the theme given coordinate
+*/
+//@{
+	bool locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol);
+
+	bool locatePolygonSet(TeCoord2D &pt, double tol, TePolygonSet &polygons);
+	
+	bool locateLine(TeCoord2D &pt, TeLine2D &line, const double& tol);
+
+	bool locatePoint(TeCoord2D &pt, TePoint &point, const double& tol);
+
+	bool locateCell(TeCoord2D &pt, TeCell &c, const double& tol);
+//@}
+
+	//! Get the set of objects corresponding to the object selection criteria
+	set<string> getObjects(TeSelectedObjects selectedObjects = TeAll);
+
+	//! Get the set of objects corresponding to the list of items
+	set<string> getObjects(const vector<string>& itemVec);
+
+	//! Get the set of items corresponding to the object selection criteria
+	vector<string> getItemVector(TeSelectedObjects selectedObjects);
+
+	//! Get the set of items corresponding to the set of objects
+	vector<string> getItemVector(const set<string>& oidSet);
+
+};
+
+
+//!  This class implements a factory to create remote theme objects. 
+/*!  
+	
+*/
+class TeFileThemeFactory : public TeViewNodeFactory
+{
+public:
+	//! Constructor 
+	TeFileThemeFactory() : TeViewNodeFactory((int)TeFILETHEME)
+	{}
+
+	//! Created theme objects 
+	TeViewNode* build(TeViewNodeParams* params)
+	{	
+		TeViewNodeParams auxParams = *params;
+		return new TeFileTheme(auxParams.name_, auxParams.myParent_, auxParams.viewId_, auxParams.id_);	
+	}
+	
+	TeViewNode* build()
+	{
+		return new TeFileTheme();
+	}
+};
+
+namespace 
+{
+  static TeFileThemeFactory fileThemeFactory;
+}; 
+
+
+#endif	// __TERRALIB_INTERNAL_FILETHEME_H
+
diff --git a/src/terralib/kernel/TeFragmentation.cpp b/src/terralib/kernel/TeFragmentation.cpp
old mode 100755
new mode 100644
index 790d947..d56f26a
--- a/src/terralib/kernel/TeFragmentation.cpp
+++ b/src/terralib/kernel/TeFragmentation.cpp
@@ -1,666 +1,666 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeFragmentation.h"
-#include "TeGeometryAlgorithms.h"
-#include <algorithm>
-
-using namespace std;
-
-// estrutura auxiliar para implementar o funtor de ordenacao do algoritmo sort da STL:
-// os pontos de intersecao de um segmento de uma dada linha eh agrupado usando esse funtor.
-struct ipRedOrder	// XY order
-{
-	bool operator()(const TeINTERSECTOR2::TeBoundaryIP& ip1, const TeINTERSECTOR2::TeBoundaryIP& ip2) const
-	{
-		if(ip1.redPartNum_ < ip2.redPartNum_)
-			return true;
-
-		if(ip1.redPartNum_ > ip2.redPartNum_)
-			return false;
-
-		if(ip1.redSegNum_ < ip2.redSegNum_)
-			return true;
-
-		if(ip1.redSegNum_ > ip2.redSegNum_)
-			return false;
-
-		return false;
-	}
-};
-
-// estrutura auxiliar para implementar o funtor de ordenacao do algoritmo sort da STL:
-// os pontos de intersecao de um segmento de uma dada linha eh agrupado usando esse funtor.
-struct ipRedOrder2	// XY order
-{
-	bool operator()(const TeINTERSECTOR2::TeBoundaryIP& ip1, const TeINTERSECTOR2::TeBoundaryIP& ip2) const
-	{
-		if(ip1.redPolNum_ < ip2.redPolNum_)
-			return true;
-
-		if(ip1.redPolNum_ > ip2.redPolNum_)
-			return false;
-
-		if(ip1.redPartNum_ < ip2.redPartNum_)
-			return true;
-
-		if(ip1.redPartNum_ > ip2.redPartNum_)
-			return false;
-
-		if(ip1.redSegNum_ < ip2.redSegNum_)
-			return true;
-
-		if(ip1.redSegNum_ > ip2.redSegNum_)
-			return false;
-
-		if(ip1.coords_[0].x_ < ip2.coords_[0].x_)
-			return true;
-
-		if(ip1.coords_[0].x_ > ip2.coords_[0].x_)
-			return false;
-
-		if(ip1.coords_[0].y_ < ip2.coords_[0].y_)
-			return true;
-
-		if(ip1.coords_[0].y_ > ip2.coords_[0].y_)
-			return false;
-		
-		if(ip1.coords_.size() < ip2.coords_.size())
-			return true;
-
-		if(ip1.coords_.size() > ip2.coords_.size())
-			return false;
-
-		if((ip1.coords_.size() == 2) && (ip2.coords_.size() == 2))
-		{
-			if(ip1.coords_[1].x_ < ip2.coords_[1].x_)
-				return true;
-
-			if(ip1.coords_[1].x_ > ip2.coords_[1].x_)
-				return false;
-
-			if(ip1.coords_[1].y_ < ip2.coords_[1].y_)
-				return true;
-
-			if(ip1.coords_[1].y_ > ip2.coords_[1].y_)
-				return false;
-		}
-
-		return false;
-	}
-};
-
-// estrutura auxiliar para colocar os pontos de intersecao ao longo de um segment ordenados,
-// de modo a facilitar a fragmentacao do segmento.
-struct TeIPAux
-{
-	double x_;
-	double y_;
-	int type_;	//0 - Unico; 1 - Inicial de Overlap; 2 - Final de Overlap
-
-	TeIPAux(const double& x, const double& y, const int& t)
-		: x_(x), y_(y), type_(t)
-	{
-	}
-};
-
-// estrutura auxiliar para implementar o funtor de ordenacao do algoritmo sort da STL:
-// os pontos de intersecao de um segmento de uma dada linha serao ordenados por esse funtor.
-struct sortDist
-{
-	TeCoord2D c_;	// cordenada de referencia
-
-	sortDist(const TeCoord2D& c)
-		: c_(c)
-	{
-	}
-
-	bool operator()(const TeIPAux& ip1, const TeIPAux& ip2) const
-	{
-		double dist1 = ((ip1.x_ - c_.x_) * (ip1.x_ - c_.x_)) + ((ip1.y_ - c_.y_) * (ip1.y_ - c_.y_));
-		double dist2 = ((ip2.x_ - c_.x_) * (ip2.x_ - c_.x_)) + ((ip2.y_ - c_.y_) * (ip2.y_ - c_.y_));
-		if(dist1 < dist2)
-			return true;
-		return false;
-	}
-};
-
-
-// mario + gribeiro - 2006-03
-// remove pontos de intersecao com a mesma localizacao que foram reportados por segmentos diferentes,
-// deixandoo vetor "ips" na sequencia correta para uso da etapa de fragmentacao do segmento.
-// Essa rotin pode lancar uma excessao em um caso muito especial: um ponto final de overlap veio ante do ponto inicial de overlap.
-inline void cleanIntersections(TeINTERSECTOR2::TeVectorBoundaryIP& ips, const TeCoord2D& refCoord)
-{
-	vector<TeIPAux> vecips;
-	for(unsigned int i = 0; i < ips.size(); ++i)
-	{
-		if(ips[i].coords_.size() == 2)
-		{
-			double dist1 = ((ips[i].coords_[0].x_ - refCoord.x_) * (ips[i].coords_[0].x_ - refCoord.x_)) + ((ips[i].coords_[0].y_ - refCoord.y_) * (ips[i].coords_[0].y_ - refCoord.y_));
-			double dist2 = ((ips[i].coords_[1].x_ - refCoord.x_) * (ips[i].coords_[1].x_ - refCoord.x_)) + ((ips[i].coords_[1].y_ - refCoord.y_) * (ips[i].coords_[1].y_ - refCoord.y_)); 
-
-			if(dist1 < dist2)
-			{
-				TeIPAux ip1(ips[i].coords_[0].x_, ips[i].coords_[0].y_, 1);
-				TeIPAux ip2(ips[i].coords_[1].x_, ips[i].coords_[1].y_, 2);
-				vecips.push_back(ip1);
-				vecips.push_back(ip2);
-			}
-			else
-			{
-				TeIPAux ip1(ips[i].coords_[0].x_, ips[i].coords_[0].y_, 2);
-				TeIPAux ip2(ips[i].coords_[1].x_, ips[i].coords_[1].y_, 1);
-				vecips.push_back(ip1);
-				vecips.push_back(ip2);
-			}			
-		}
-		else
-		{
-			TeIPAux ip(ips[i].coords_[0].x_, ips[i].coords_[0].y_, 0);
-			vecips.push_back(ip);
-		}
-	}
-
-	sort(vecips.begin(), vecips.end(), sortDist(refCoord));
-
-    TeINTERSECTOR2::TeVectorBoundaryIP newips;
-
-	int cont = 0;
-
-	TeLine2D l;
-	TeLineSet lset;
-
-	for(unsigned int i = 0; i < vecips.size(); ++i)
-	{
-		TeCoord2D c(vecips[i].x_, vecips[i].y_);
-
-		if(vecips[i].type_ == 0)
-		{
-			if(l.size() > 0)
-			{
-				if(TeEquals(c, l[l.size() - 1]))
-				{
-					continue;
-				}
-				else if(cont == 0)
-				{
-					lset.add(l);
-					l = TeLine2D();
-					l.add(c);
-				}
-				else
-				{
-					l.add(c);
-				}
-			}
-			else
-			{				
-				l.add(c);
-			}
-		}
-		else if(vecips[i].type_ == 1)
-		{
-			if(l.size() > 0)
-			{
-				if(TeEquals(c, l[l.size() - 1]))
-				{
-					++cont;
-					continue;
-				}
-				else if(cont == 0)
-				{
-					lset.add(l);
-					l = TeLine2D();
-					l.add(c);
-				}
-				else
-				{
-					l.add(c);
-				}
-			}
-			else
-			{
-				l.add(c);
-			}
-
-			++cont;
-		}
-		else //else if(vecips[i].type == 2)
-		{
-			if(l.size() > 0)
-			{
-				if(TeEquals(c, l[l.size() - 1]))
-				{
-					--cont;
-					continue;
-				}
-				else if(cont == 0)
-				{
-					throw string("An overlap end point started before an overlap begin!");		// nao podia ter chegado ate aqui
-				}
-				else
-				{
-					l.add(c);
-				}
-			}
-			else
-			{
-				l.add(c);
-			}
-
-			--cont;
-		}
-	}
-
-	if(l.size() > 0)
-	{
-		lset.add(l);
-	}
-
-	for(unsigned int i = 0; i < lset.size(); ++i)
-	{
-		if(lset[i].size() == 1)
-		{
-			TeINTERSECTOR2::TeBoundaryIP newIp;
-			newIp.coords_.push_back(lset[i][0]);
-			newips.push_back(newIp);
-		}
-		else
-		{
-			for(unsigned int j = 1; j < lset[i].size(); ++j)
-			{
-				TeINTERSECTOR2::TeBoundaryIP newIp;
-				newIp.coords_.push_back(lset[i][j-1]);
-				newIp.coords_.push_back(lset[i][j]);
-				
-				newips.push_back(newIp);
-			}
-		}
-	}
-
-	ips.clear();
-	ips = newips;
-}
-
-// rotina que fragmenta uma aresta se necessario: aplica-se no caso de segmentos que nao fazem overlap
-inline void TeFragmentSegmentByNonOverlapping(const TeCoord2D& s1, const TeCoord2D& /* s2 */,
-									   TeINTERSECTOR2::TeVectorBoundaryIP& ips, 
-									   TeLine2D& currentFragment,
-									   TeLineSet& fragments)
-{
-// vamos deixar os pontos de intersecao numa sequencoa adequada para fragmentarmos este segmento
-	cleanIntersections(ips, s1);
-
-
-// eh so fragmentar o segmento ateh o ultimo ponto de interseccao dele
-	for(unsigned int k = 0; k < ips.size(); ++k)
-	{
-		if(TeEquals(ips[k].coords_[0], currentFragment[currentFragment.size() - 1]))	// Se o ponto de interseccao esta sobre o vehrtice do segmento
-		{
-			// fragmenta a linha caso haja mais de um ponto nela
-			if(currentFragment.size() > 1)								
-			{
-				fragments.add(currentFragment);
-
-				currentFragment = TeLine2D();
-				currentFragment.add(ips[k].coords_[0]);
-			}
-			else
-			{
-				continue;
-			}
-		}
-		else
-		{
-			currentFragment.add(ips[k].coords_[0]);
-
-			fragments.add(currentFragment);
-
-			currentFragment = TeLine2D();
-			currentFragment.add(ips[k].coords_[0]);
-		}
-	}
-}
-
-// fragmenta uma aresta que possui pontos de intersecao de overlap
-inline void TeFragmentSegmentByOverlapping(const TeCoord2D& s1, const TeCoord2D& /* s2 */,
-									   TeINTERSECTOR2::TeVectorBoundaryIP& ips,
-									   TeLine2D& currentFragment,
-									   TeLineSet& fragments, TeLineSet& boundaryFragments)
-{
-// vamos deixar os pontos de intersecao numa sequencoa adequada para fragmentarmos este segmento
-	cleanIntersections(ips, s1);
-
-	unsigned int i = 0;
-	
-// eh so fragmentar o segmento ateh o ultimo ponto de interseccao dele
-	for(i = 0; i < ips.size(); ++i)
-	{
-		if(TeEquals(ips[i].coords_[0], currentFragment[currentFragment.size() - 1]))	// Se o ponto de interseccao esta sobre o vehrtice do segmento
-		{
-			// fragmenta a linha caso haja mais de um ponto nela
-			if(currentFragment.size() > 1)
-			{
-				fragments.add(currentFragment);
-
-				currentFragment = TeLine2D();
-
-				if(ips[i].coords_.size() == 2)
-				{
-					TeLine2D l;
-					l.add(ips[i].coords_[0]);
-					l.add(ips[i].coords_[1]);
-					
-					boundaryFragments.add(l);
-
-					currentFragment.add(ips[i].coords_[1]);
-				}
-				else
-				{
-					currentFragment.add(ips[i].coords_[0]);
-				}
-			}
-			else
-			{
-				if(ips[i].coords_.size() == 2)
-				{
-					TeLine2D l;
-					l.add(ips[i].coords_[0]);
-					l.add(ips[i].coords_[1]);
-					
-					boundaryFragments.add(l);
-
-					currentFragment.clear();
-					currentFragment.add(ips[i].coords_[1]);
-				}
-			}
-		}
-		else
-		{
-
-			currentFragment.add(ips[i].coords_[0]);
-
-			if(ips[i].coords_.size() == 2)
-			{
-				fragments.add(currentFragment);
-
-				currentFragment = TeLine2D();
-				
-				currentFragment.add(ips[i].coords_[1]);
-
-				TeLine2D l;
-				l.add(ips[i].coords_[0]);
-				l.add(ips[i].coords_[1]);
-				
-				boundaryFragments.add(l);
-			}
-			else
-			{
-				fragments.add(currentFragment);
-
-				currentFragment = TeLine2D();
-				
-				currentFragment.add(ips[i].coords_[0]);
-			}			
-		}
-	}
-}
-
-// Adiciona o ponto de intersecao ao fragmento corrente, decidindo entre um ponto de intersecao e o ponto original
-void TeAddPoint(TeLine2D& lFrag, TeLine2D& currentLine, TeINTERSECTOR2::TeVectorBoundaryIP& ipsAux, const unsigned int& j)
-{
-	bool found = false;
-
-	for(unsigned int i = 0; i < ipsAux.size(); ++i)
-	{
-		if(TeEquals(ipsAux[i].coords_[0], currentLine[j]))
-		{
-			lFrag.add(ipsAux[i].coords_[0]);
-			found = true;
-			break;
-		}
-		else if(ipsAux[i].coords_.size() == 2)
-		{
-			if(TeEquals(ipsAux[i].coords_[1], currentLine[j]))
-			{
-				lFrag.add(ipsAux[i].coords_[1]);
-				found = true;
-				break;
-			}			
-		}
-	}
-
-	if(!found)
-		lFrag.add(currentLine[j]);
-}
-
-// rotina principal de fragmentacao de linhas
-void TeFragmentBoundary(const TeLineSet& lines, TeINTERSECTOR2::TeVectorBoundaryIP& ips, TeLineSet& boundaryFragments, TeLineSet& fragments)
-{
-// informacoes sobre os pontos de intersecao
-	unsigned int currentIP = 0;
-	unsigned int nthIP = ips.size();
-
-	// Informacoes sobre numero de linhas
-	unsigned int nthLine = lines.size();
-
-	// Ordena os pontos de intersecao
-	sort(ips.begin(), ips.end(), ipRedOrder());
-
-	for(unsigned int i = 0; i < nthLine; ++i)
-	{
-		if((currentIP < nthIP) && (ips[currentIP].redPartNum_ == i))	
-		{
-			// Se a linha corrente possui um ponto de intersecao entao ela devera ser fragmentada
-			TeLine2D& currentLine = lines[i];
-			
-			TeLine2D lFrag;
-
-			//unsigned int currentSegment = 0;
-			unsigned int nthSegment = currentLine.size() - 1;
-
-			for(unsigned int j = 0; j < nthSegment; ++j)
-			{
-				if((currentIP < nthIP) && (j == ips[currentIP].redSegNum_) && (ips[currentIP].redPartNum_ == i))	// Se ainda tenho pontos de interseccao e 
-				{															// o corrente pertence ao segmento atual
-					// Copias todos os pontos de interseccao do segmento para
-					// um vetor auxiliar e ja avanca o currentIP
-					TeINTERSECTOR2::TeVectorBoundaryIP ipsAux;
-
-					bool hasOverlap = false;
-
-					while((currentIP < nthIP) && (ips[currentIP].redSegNum_ == j) && (ips[currentIP].redPartNum_ == i))
-					{
-						if(ips[currentIP].coords_.size() == 2)
-							hasOverlap = true;
-
-						ipsAux.push_back(ips[currentIP]);
-
-						++currentIP;
-					}
-
-					// Adiciona o primeiro ponto da linha na lista do fragmento atual: mas precisamos decidir entre o vertice original ou o de intersecao => preferimos o de intersecao para amarrar com o segmento que intercepta este segmento
-					if((lFrag.size() == 0) || TeDisjoint(currentLine[j], lFrag[lFrag.size() - 1]))
-							TeAddPoint(lFrag, currentLine, ipsAux, j);
-
-					if(hasOverlap)	// Se houverem pontos de interseccao que fazem overlap
-					{						
-						TeFragmentSegmentByOverlapping(currentLine[j], currentLine[j + 1], ipsAux, lFrag, fragments, boundaryFragments);
-					}
-					else	// Se nao houver pontos de interseccao que fazem overlap
-					{
-						TeFragmentSegmentByNonOverlapping(currentLine[j], currentLine[j + 1], ipsAux, lFrag, fragments);
-					}
-				}
-				else
-				{
-					// Caso nao haja ponto de interseccao sobre o segmento,
-					// apenas insere o ponto no fragmento de linha
-					lFrag.add(currentLine[j]);
-				}
-			}
-			
-			if(lFrag.size() > 0)
-			{
-				if(TeDisjoint(currentLine[nthSegment], lFrag[lFrag.size() - 1]))
-				{
-					lFrag.add(currentLine[nthSegment]);
-
-					fragments.add(lFrag);
-				}
-				else if(lFrag.size() > 1)
-				{
-					fragments.add(lFrag);
-				}
-			}
-		}
-		else
-		{
-			// Caso contrario, se a linha nao possui ponto de intersecao
-			// eh so colocar ela na lista de linhas fragmentadas
-			fragments.add(lines[i]);
-		}
-	}
-	
-	return;
-}
-
-// rotina principal de fragmentacao de poligonos
-void TeFragmentBoundary(const TePolygonSet& polygons, TeINTERSECTOR2::TeVectorBoundaryIP& ips, TeLineSet& boundaryFragments, vector<pair<unsigned int, unsigned int> >& boundaryFragmentsIds, TeLineSet& fragments, vector<pair<unsigned int, unsigned int> >& fragmentsIds)
-{
-	// Informacoes sobre os pontos de intersecao
-	unsigned int currentIP = 0;
-	unsigned int nthIP = ips.size();	
-
-	// Ordena os pontos de intersecao
-	sort(ips.begin(), ips.end(), ipRedOrder2());
-
-	// Informacoes sobre numero de poligonos
-	unsigned int nthPol = polygons.size();
-
-	for(unsigned int polyIndex = 0; polyIndex < nthPol; ++polyIndex)
-	{
-		unsigned int nthLine = polygons[polyIndex].size();
-
-		for(unsigned int ringIndex = 0; ringIndex < nthLine; ++ringIndex)
-		{
-// temos intersecao no anel?
-            if((currentIP < nthIP) && (ips[currentIP].redPartNum_ == ringIndex) && (ips[currentIP].redPolNum_ == polyIndex))	
-			{
-				// Se a linha corrente possui um ponto de intersecao entao ela devera ser fragmentada
-				TeLine2D& currentLine = polygons[polyIndex][ringIndex];
-				
-				TeLine2D lFrag;
-
-				//unsigned int currentSegment = 0;
-				unsigned int nthSegment = currentLine.size() - 1;
-
-				TeCoord2D first(0,0);
-
-				for(unsigned int j = 0; j < nthSegment; ++j)
-				{
-// temos intersecao sobre o segmento corrente?
-					if((currentIP < nthIP) && (j == ips[currentIP].redSegNum_) && (ips[currentIP].redPartNum_ == ringIndex) && (ips[currentIP].redPolNum_ == polyIndex))	// Se ainda tenho pontos de interseccao e 
-					{
-						// Copias todos os pontos de interseccao do segmento para
-						// um vetor auxiliar e ja avanca o currentIP
-						TeINTERSECTOR2::TeVectorBoundaryIP ipsAux;
-
-						bool hasOverlap = false;
-
-						while((currentIP < nthIP) && (ips[currentIP].redSegNum_ == j) && (ips[currentIP].redPartNum_ == ringIndex) && (ips[currentIP].redPolNum_ == polyIndex))
-						{
-							if(ips[currentIP].coords_.size() == 2)
-								hasOverlap = true;
-
-							ipsAux.push_back(ips[currentIP]);
-
-							++currentIP;
-						}
-
-						// Adiciona o primeiro ponto da linha na lista do fragmento atual: mas precisamos decidir entre o vertice original ou o de intersecao => preferimos o de intersecao para amarrar com o segmento que intercepta este segmento
-						if((lFrag.size() == 0) || TeDisjoint(currentLine[j], lFrag[lFrag.size() - 1]))
-							TeAddPoint(lFrag, currentLine, ipsAux, j);
-
-						if(hasOverlap)	// Se houverem pontos de interseccao que fazem overlap
-						{						
-							TeFragmentSegmentByOverlapping(currentLine[j], currentLine[j + 1], ipsAux, lFrag, fragments, boundaryFragments);
-						}
-						else	// Se nao houver pontos de interseccao que fazem overlap
-						{
-							TeFragmentSegmentByNonOverlapping(currentLine[j], currentLine[j + 1], ipsAux, lFrag, fragments);
-						}
-					}
-					else
-					{
-						// Caso nao haja ponto de interseccao sobre o segmento,
-						// apenas insere o ponto no fragmento de linha
-						lFrag.add(currentLine[j]);
-					}
-				}
-				
-				if(lFrag.size() > 0)
-				{
-					if(TeDisjoint(currentLine[0], lFrag[lFrag.size() - 1]))
-					{
-						lFrag.add(currentLine[0]);
-
-						fragments.add(lFrag);
-					}
-					else if(lFrag.size() > 1)
-					{
-						fragments.add(lFrag);
-					}
-				}
-			}
-			else
-			{
-				// Caso contrario, se a linha nao possui ponto de intersecao
-				// e so colocar ela na lista de linhas fragmentadas
-				fragments.add(polygons[polyIndex][ringIndex]);
-			}
-
-			unsigned int numFragmentos = fragments.size();
-
-			for(unsigned int fragIdxCount = fragmentsIds.size(); fragIdxCount < numFragmentos; ++fragIdxCount)
-				fragmentsIds.push_back(pair<unsigned int, unsigned int>(polyIndex, ringIndex));
-
-
-//mario - 2006-03
-			unsigned int numFragmentosFronteira = boundaryFragments.size();
-
-			for(unsigned int fragIdxCount = boundaryFragmentsIds.size(); fragIdxCount < numFragmentosFronteira; ++fragIdxCount)
-			{
-				boundaryFragmentsIds.push_back(pair<unsigned int, unsigned int>(polyIndex, ringIndex));
-			}
-		}
-	}
-	
-	return;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeFragmentation.h"
+#include "TeGeometryAlgorithms.h"
+#include <algorithm>
+
+using namespace std;
+
+// estrutura auxiliar para implementar o funtor de ordenacao do algoritmo sort da STL:
+// os pontos de intersecao de um segmento de uma dada linha eh agrupado usando esse funtor.
+struct ipRedOrder	// XY order
+{
+	bool operator()(const TeINTERSECTOR2::TeBoundaryIP& ip1, const TeINTERSECTOR2::TeBoundaryIP& ip2) const
+	{
+		if(ip1.redPartNum_ < ip2.redPartNum_)
+			return true;
+
+		if(ip1.redPartNum_ > ip2.redPartNum_)
+			return false;
+
+		if(ip1.redSegNum_ < ip2.redSegNum_)
+			return true;
+
+		if(ip1.redSegNum_ > ip2.redSegNum_)
+			return false;
+
+		return false;
+	}
+};
+
+// estrutura auxiliar para implementar o funtor de ordenacao do algoritmo sort da STL:
+// os pontos de intersecao de um segmento de uma dada linha eh agrupado usando esse funtor.
+struct ipRedOrder2	// XY order
+{
+	bool operator()(const TeINTERSECTOR2::TeBoundaryIP& ip1, const TeINTERSECTOR2::TeBoundaryIP& ip2) const
+	{
+		if(ip1.redPolNum_ < ip2.redPolNum_)
+			return true;
+
+		if(ip1.redPolNum_ > ip2.redPolNum_)
+			return false;
+
+		if(ip1.redPartNum_ < ip2.redPartNum_)
+			return true;
+
+		if(ip1.redPartNum_ > ip2.redPartNum_)
+			return false;
+
+		if(ip1.redSegNum_ < ip2.redSegNum_)
+			return true;
+
+		if(ip1.redSegNum_ > ip2.redSegNum_)
+			return false;
+
+		if(ip1.coords_[0].x_ < ip2.coords_[0].x_)
+			return true;
+
+		if(ip1.coords_[0].x_ > ip2.coords_[0].x_)
+			return false;
+
+		if(ip1.coords_[0].y_ < ip2.coords_[0].y_)
+			return true;
+
+		if(ip1.coords_[0].y_ > ip2.coords_[0].y_)
+			return false;
+		
+		if(ip1.coords_.size() < ip2.coords_.size())
+			return true;
+
+		if(ip1.coords_.size() > ip2.coords_.size())
+			return false;
+
+		if((ip1.coords_.size() == 2) && (ip2.coords_.size() == 2))
+		{
+			if(ip1.coords_[1].x_ < ip2.coords_[1].x_)
+				return true;
+
+			if(ip1.coords_[1].x_ > ip2.coords_[1].x_)
+				return false;
+
+			if(ip1.coords_[1].y_ < ip2.coords_[1].y_)
+				return true;
+
+			if(ip1.coords_[1].y_ > ip2.coords_[1].y_)
+				return false;
+		}
+
+		return false;
+	}
+};
+
+// estrutura auxiliar para colocar os pontos de intersecao ao longo de um segment ordenados,
+// de modo a facilitar a fragmentacao do segmento.
+struct TeIPAux
+{
+	double x_;
+	double y_;
+	int type_;	//0 - Unico; 1 - Inicial de Overlap; 2 - Final de Overlap
+
+	TeIPAux(const double& x, const double& y, const int& t)
+		: x_(x), y_(y), type_(t)
+	{
+	}
+};
+
+// estrutura auxiliar para implementar o funtor de ordenacao do algoritmo sort da STL:
+// os pontos de intersecao de um segmento de uma dada linha serao ordenados por esse funtor.
+struct sortDist
+{
+	TeCoord2D c_;	// cordenada de referencia
+
+	sortDist(const TeCoord2D& c)
+		: c_(c)
+	{
+	}
+
+	bool operator()(const TeIPAux& ip1, const TeIPAux& ip2) const
+	{
+		double dist1 = ((ip1.x_ - c_.x_) * (ip1.x_ - c_.x_)) + ((ip1.y_ - c_.y_) * (ip1.y_ - c_.y_));
+		double dist2 = ((ip2.x_ - c_.x_) * (ip2.x_ - c_.x_)) + ((ip2.y_ - c_.y_) * (ip2.y_ - c_.y_));
+		if(dist1 < dist2)
+			return true;
+		return false;
+	}
+};
+
+
+// mario + gribeiro - 2006-03
+// remove pontos de intersecao com a mesma localizacao que foram reportados por segmentos diferentes,
+// deixandoo vetor "ips" na sequencia correta para uso da etapa de fragmentacao do segmento.
+// Essa rotin pode lancar uma excessao em um caso muito especial: um ponto final de overlap veio ante do ponto inicial de overlap.
+inline void cleanIntersections(TeINTERSECTOR2::TeVectorBoundaryIP& ips, const TeCoord2D& refCoord)
+{
+	vector<TeIPAux> vecips;
+	for(unsigned int i = 0; i < ips.size(); ++i)
+	{
+		if(ips[i].coords_.size() == 2)
+		{
+			double dist1 = ((ips[i].coords_[0].x_ - refCoord.x_) * (ips[i].coords_[0].x_ - refCoord.x_)) + ((ips[i].coords_[0].y_ - refCoord.y_) * (ips[i].coords_[0].y_ - refCoord.y_));
+			double dist2 = ((ips[i].coords_[1].x_ - refCoord.x_) * (ips[i].coords_[1].x_ - refCoord.x_)) + ((ips[i].coords_[1].y_ - refCoord.y_) * (ips[i].coords_[1].y_ - refCoord.y_)); 
+
+			if(dist1 < dist2)
+			{
+				TeIPAux ip1(ips[i].coords_[0].x_, ips[i].coords_[0].y_, 1);
+				TeIPAux ip2(ips[i].coords_[1].x_, ips[i].coords_[1].y_, 2);
+				vecips.push_back(ip1);
+				vecips.push_back(ip2);
+			}
+			else
+			{
+				TeIPAux ip1(ips[i].coords_[0].x_, ips[i].coords_[0].y_, 2);
+				TeIPAux ip2(ips[i].coords_[1].x_, ips[i].coords_[1].y_, 1);
+				vecips.push_back(ip1);
+				vecips.push_back(ip2);
+			}			
+		}
+		else
+		{
+			TeIPAux ip(ips[i].coords_[0].x_, ips[i].coords_[0].y_, 0);
+			vecips.push_back(ip);
+		}
+	}
+
+	sort(vecips.begin(), vecips.end(), sortDist(refCoord));
+
+    TeINTERSECTOR2::TeVectorBoundaryIP newips;
+
+	int cont = 0;
+
+	TeLine2D l;
+	TeLineSet lset;
+
+	for(unsigned int i = 0; i < vecips.size(); ++i)
+	{
+		TeCoord2D c(vecips[i].x_, vecips[i].y_);
+
+		if(vecips[i].type_ == 0)
+		{
+			if(l.size() > 0)
+			{
+				if(TeEquals(c, l[l.size() - 1]))
+				{
+					continue;
+				}
+				else if(cont == 0)
+				{
+					lset.add(l);
+					l = TeLine2D();
+					l.add(c);
+				}
+				else
+				{
+					l.add(c);
+				}
+			}
+			else
+			{				
+				l.add(c);
+			}
+		}
+		else if(vecips[i].type_ == 1)
+		{
+			if(l.size() > 0)
+			{
+				if(TeEquals(c, l[l.size() - 1]))
+				{
+					++cont;
+					continue;
+				}
+				else if(cont == 0)
+				{
+					lset.add(l);
+					l = TeLine2D();
+					l.add(c);
+				}
+				else
+				{
+					l.add(c);
+				}
+			}
+			else
+			{
+				l.add(c);
+			}
+
+			++cont;
+		}
+		else //else if(vecips[i].type == 2)
+		{
+			if(l.size() > 0)
+			{
+				if(TeEquals(c, l[l.size() - 1]))
+				{
+					--cont;
+					continue;
+				}
+				else if(cont == 0)
+				{
+					throw string("An overlap end point started before an overlap begin!");		// nao podia ter chegado ate aqui
+				}
+				else
+				{
+					l.add(c);
+				}
+			}
+			else
+			{
+				l.add(c);
+			}
+
+			--cont;
+		}
+	}
+
+	if(l.size() > 0)
+	{
+		lset.add(l);
+	}
+
+	for(unsigned int i = 0; i < lset.size(); ++i)
+	{
+		if(lset[i].size() == 1)
+		{
+			TeINTERSECTOR2::TeBoundaryIP newIp;
+			newIp.coords_.push_back(lset[i][0]);
+			newips.push_back(newIp);
+		}
+		else
+		{
+			for(unsigned int j = 1; j < lset[i].size(); ++j)
+			{
+				TeINTERSECTOR2::TeBoundaryIP newIp;
+				newIp.coords_.push_back(lset[i][j-1]);
+				newIp.coords_.push_back(lset[i][j]);
+				
+				newips.push_back(newIp);
+			}
+		}
+	}
+
+	ips.clear();
+	ips = newips;
+}
+
+// rotina que fragmenta uma aresta se necessario: aplica-se no caso de segmentos que nao fazem overlap
+inline void TeFragmentSegmentByNonOverlapping(const TeCoord2D& s1, const TeCoord2D& /* s2 */,
+									   TeINTERSECTOR2::TeVectorBoundaryIP& ips, 
+									   TeLine2D& currentFragment,
+									   TeLineSet& fragments)
+{
+// vamos deixar os pontos de intersecao numa sequencoa adequada para fragmentarmos este segmento
+	cleanIntersections(ips, s1);
+
+
+// eh so fragmentar o segmento ateh o ultimo ponto de interseccao dele
+	for(unsigned int k = 0; k < ips.size(); ++k)
+	{
+		if(TeEquals(ips[k].coords_[0], currentFragment[currentFragment.size() - 1]))	// Se o ponto de interseccao esta sobre o vehrtice do segmento
+		{
+			// fragmenta a linha caso haja mais de um ponto nela
+			if(currentFragment.size() > 1)								
+			{
+				fragments.add(currentFragment);
+
+				currentFragment = TeLine2D();
+				currentFragment.add(ips[k].coords_[0]);
+			}
+			else
+			{
+				continue;
+			}
+		}
+		else
+		{
+			currentFragment.add(ips[k].coords_[0]);
+
+			fragments.add(currentFragment);
+
+			currentFragment = TeLine2D();
+			currentFragment.add(ips[k].coords_[0]);
+		}
+	}
+}
+
+// fragmenta uma aresta que possui pontos de intersecao de overlap
+inline void TeFragmentSegmentByOverlapping(const TeCoord2D& s1, const TeCoord2D& /* s2 */,
+									   TeINTERSECTOR2::TeVectorBoundaryIP& ips,
+									   TeLine2D& currentFragment,
+									   TeLineSet& fragments, TeLineSet& boundaryFragments)
+{
+// vamos deixar os pontos de intersecao numa sequencoa adequada para fragmentarmos este segmento
+	cleanIntersections(ips, s1);
+
+	unsigned int i = 0;
+	
+// eh so fragmentar o segmento ateh o ultimo ponto de interseccao dele
+	for(i = 0; i < ips.size(); ++i)
+	{
+		if(TeEquals(ips[i].coords_[0], currentFragment[currentFragment.size() - 1]))	// Se o ponto de interseccao esta sobre o vehrtice do segmento
+		{
+			// fragmenta a linha caso haja mais de um ponto nela
+			if(currentFragment.size() > 1)
+			{
+				fragments.add(currentFragment);
+
+				currentFragment = TeLine2D();
+
+				if(ips[i].coords_.size() == 2)
+				{
+					TeLine2D l;
+					l.add(ips[i].coords_[0]);
+					l.add(ips[i].coords_[1]);
+					
+					boundaryFragments.add(l);
+
+					currentFragment.add(ips[i].coords_[1]);
+				}
+				else
+				{
+					currentFragment.add(ips[i].coords_[0]);
+				}
+			}
+			else
+			{
+				if(ips[i].coords_.size() == 2)
+				{
+					TeLine2D l;
+					l.add(ips[i].coords_[0]);
+					l.add(ips[i].coords_[1]);
+					
+					boundaryFragments.add(l);
+
+					currentFragment.clear();
+					currentFragment.add(ips[i].coords_[1]);
+				}
+			}
+		}
+		else
+		{
+
+			currentFragment.add(ips[i].coords_[0]);
+
+			if(ips[i].coords_.size() == 2)
+			{
+				fragments.add(currentFragment);
+
+				currentFragment = TeLine2D();
+				
+				currentFragment.add(ips[i].coords_[1]);
+
+				TeLine2D l;
+				l.add(ips[i].coords_[0]);
+				l.add(ips[i].coords_[1]);
+				
+				boundaryFragments.add(l);
+			}
+			else
+			{
+				fragments.add(currentFragment);
+
+				currentFragment = TeLine2D();
+				
+				currentFragment.add(ips[i].coords_[0]);
+			}			
+		}
+	}
+}
+
+// Adiciona o ponto de intersecao ao fragmento corrente, decidindo entre um ponto de intersecao e o ponto original
+void TeAddPoint(TeLine2D& lFrag, TeLine2D& currentLine, TeINTERSECTOR2::TeVectorBoundaryIP& ipsAux, const unsigned int& j)
+{
+	bool found = false;
+
+	for(unsigned int i = 0; i < ipsAux.size(); ++i)
+	{
+		if(TeEquals(ipsAux[i].coords_[0], currentLine[j]))
+		{
+			lFrag.add(ipsAux[i].coords_[0]);
+			found = true;
+			break;
+		}
+		else if(ipsAux[i].coords_.size() == 2)
+		{
+			if(TeEquals(ipsAux[i].coords_[1], currentLine[j]))
+			{
+				lFrag.add(ipsAux[i].coords_[1]);
+				found = true;
+				break;
+			}			
+		}
+	}
+
+	if(!found)
+		lFrag.add(currentLine[j]);
+}
+
+// rotina principal de fragmentacao de linhas
+void TeFragmentBoundary(const TeLineSet& lines, TeINTERSECTOR2::TeVectorBoundaryIP& ips, TeLineSet& boundaryFragments, TeLineSet& fragments)
+{
+// informacoes sobre os pontos de intersecao
+	unsigned int currentIP = 0;
+	unsigned int nthIP = ips.size();
+
+	// Informacoes sobre numero de linhas
+	unsigned int nthLine = lines.size();
+
+	// Ordena os pontos de intersecao
+	sort(ips.begin(), ips.end(), ipRedOrder());
+
+	for(unsigned int i = 0; i < nthLine; ++i)
+	{
+		if((currentIP < nthIP) && (ips[currentIP].redPartNum_ == i))	
+		{
+			// Se a linha corrente possui um ponto de intersecao entao ela devera ser fragmentada
+			TeLine2D& currentLine = lines[i];
+			
+			TeLine2D lFrag;
+
+			//unsigned int currentSegment = 0;
+			unsigned int nthSegment = currentLine.size() - 1;
+
+			for(unsigned int j = 0; j < nthSegment; ++j)
+			{
+				if((currentIP < nthIP) && (j == ips[currentIP].redSegNum_) && (ips[currentIP].redPartNum_ == i))	// Se ainda tenho pontos de interseccao e 
+				{															// o corrente pertence ao segmento atual
+					// Copias todos os pontos de interseccao do segmento para
+					// um vetor auxiliar e ja avanca o currentIP
+					TeINTERSECTOR2::TeVectorBoundaryIP ipsAux;
+
+					bool hasOverlap = false;
+
+					while((currentIP < nthIP) && (ips[currentIP].redSegNum_ == j) && (ips[currentIP].redPartNum_ == i))
+					{
+						if(ips[currentIP].coords_.size() == 2)
+							hasOverlap = true;
+
+						ipsAux.push_back(ips[currentIP]);
+
+						++currentIP;
+					}
+
+					// Adiciona o primeiro ponto da linha na lista do fragmento atual: mas precisamos decidir entre o vertice original ou o de intersecao => preferimos o de intersecao para amarrar com o segmento que intercepta este segmento
+					if((lFrag.size() == 0) || TeDisjoint(currentLine[j], lFrag[lFrag.size() - 1]))
+							TeAddPoint(lFrag, currentLine, ipsAux, j);
+
+					if(hasOverlap)	// Se houverem pontos de interseccao que fazem overlap
+					{						
+						TeFragmentSegmentByOverlapping(currentLine[j], currentLine[j + 1], ipsAux, lFrag, fragments, boundaryFragments);
+					}
+					else	// Se nao houver pontos de interseccao que fazem overlap
+					{
+						TeFragmentSegmentByNonOverlapping(currentLine[j], currentLine[j + 1], ipsAux, lFrag, fragments);
+					}
+				}
+				else
+				{
+					// Caso nao haja ponto de interseccao sobre o segmento,
+					// apenas insere o ponto no fragmento de linha
+					lFrag.add(currentLine[j]);
+				}
+			}
+			
+			if(lFrag.size() > 0)
+			{
+				if(TeDisjoint(currentLine[nthSegment], lFrag[lFrag.size() - 1]))
+				{
+					lFrag.add(currentLine[nthSegment]);
+
+					fragments.add(lFrag);
+				}
+				else if(lFrag.size() > 1)
+				{
+					fragments.add(lFrag);
+				}
+			}
+		}
+		else
+		{
+			// Caso contrario, se a linha nao possui ponto de intersecao
+			// eh so colocar ela na lista de linhas fragmentadas
+			fragments.add(lines[i]);
+		}
+	}
+	
+	return;
+}
+
+// rotina principal de fragmentacao de poligonos
+void TeFragmentBoundary(const TePolygonSet& polygons, TeINTERSECTOR2::TeVectorBoundaryIP& ips, TeLineSet& boundaryFragments, vector<pair<unsigned int, unsigned int> >& boundaryFragmentsIds, TeLineSet& fragments, vector<pair<unsigned int, unsigned int> >& fragmentsIds)
+{
+	// Informacoes sobre os pontos de intersecao
+	unsigned int currentIP = 0;
+	unsigned int nthIP = ips.size();	
+
+	// Ordena os pontos de intersecao
+	sort(ips.begin(), ips.end(), ipRedOrder2());
+
+	// Informacoes sobre numero de poligonos
+	unsigned int nthPol = polygons.size();
+
+	for(unsigned int polyIndex = 0; polyIndex < nthPol; ++polyIndex)
+	{
+		unsigned int nthLine = polygons[polyIndex].size();
+
+		for(unsigned int ringIndex = 0; ringIndex < nthLine; ++ringIndex)
+		{
+// temos intersecao no anel?
+            if((currentIP < nthIP) && (ips[currentIP].redPartNum_ == ringIndex) && (ips[currentIP].redPolNum_ == polyIndex))	
+			{
+				// Se a linha corrente possui um ponto de intersecao entao ela devera ser fragmentada
+				TeLine2D& currentLine = polygons[polyIndex][ringIndex];
+				
+				TeLine2D lFrag;
+
+				//unsigned int currentSegment = 0;
+				unsigned int nthSegment = currentLine.size() - 1;
+
+				TeCoord2D first(0,0);
+
+				for(unsigned int j = 0; j < nthSegment; ++j)
+				{
+// temos intersecao sobre o segmento corrente?
+					if((currentIP < nthIP) && (j == ips[currentIP].redSegNum_) && (ips[currentIP].redPartNum_ == ringIndex) && (ips[currentIP].redPolNum_ == polyIndex))	// Se ainda tenho pontos de interseccao e 
+					{
+						// Copias todos os pontos de interseccao do segmento para
+						// um vetor auxiliar e ja avanca o currentIP
+						TeINTERSECTOR2::TeVectorBoundaryIP ipsAux;
+
+						bool hasOverlap = false;
+
+						while((currentIP < nthIP) && (ips[currentIP].redSegNum_ == j) && (ips[currentIP].redPartNum_ == ringIndex) && (ips[currentIP].redPolNum_ == polyIndex))
+						{
+							if(ips[currentIP].coords_.size() == 2)
+								hasOverlap = true;
+
+							ipsAux.push_back(ips[currentIP]);
+
+							++currentIP;
+						}
+
+						// Adiciona o primeiro ponto da linha na lista do fragmento atual: mas precisamos decidir entre o vertice original ou o de intersecao => preferimos o de intersecao para amarrar com o segmento que intercepta este segmento
+						if((lFrag.size() == 0) || TeDisjoint(currentLine[j], lFrag[lFrag.size() - 1]))
+							TeAddPoint(lFrag, currentLine, ipsAux, j);
+
+						if(hasOverlap)	// Se houverem pontos de interseccao que fazem overlap
+						{						
+							TeFragmentSegmentByOverlapping(currentLine[j], currentLine[j + 1], ipsAux, lFrag, fragments, boundaryFragments);
+						}
+						else	// Se nao houver pontos de interseccao que fazem overlap
+						{
+							TeFragmentSegmentByNonOverlapping(currentLine[j], currentLine[j + 1], ipsAux, lFrag, fragments);
+						}
+					}
+					else
+					{
+						// Caso nao haja ponto de interseccao sobre o segmento,
+						// apenas insere o ponto no fragmento de linha
+						lFrag.add(currentLine[j]);
+					}
+				}
+				
+				if(lFrag.size() > 0)
+				{
+					if(TeDisjoint(currentLine[0], lFrag[lFrag.size() - 1]))
+					{
+						lFrag.add(currentLine[0]);
+
+						fragments.add(lFrag);
+					}
+					else if(lFrag.size() > 1)
+					{
+						fragments.add(lFrag);
+					}
+				}
+			}
+			else
+			{
+				// Caso contrario, se a linha nao possui ponto de intersecao
+				// e so colocar ela na lista de linhas fragmentadas
+				fragments.add(polygons[polyIndex][ringIndex]);
+			}
+
+			unsigned int numFragmentos = fragments.size();
+
+			for(unsigned int fragIdxCount = fragmentsIds.size(); fragIdxCount < numFragmentos; ++fragIdxCount)
+				fragmentsIds.push_back(pair<unsigned int, unsigned int>(polyIndex, ringIndex));
+
+
+//mario - 2006-03
+			unsigned int numFragmentosFronteira = boundaryFragments.size();
+
+			for(unsigned int fragIdxCount = boundaryFragmentsIds.size(); fragIdxCount < numFragmentosFronteira; ++fragIdxCount)
+			{
+				boundaryFragmentsIds.push_back(pair<unsigned int, unsigned int>(polyIndex, ringIndex));
+			}
+		}
+	}
+	
+	return;
+}
+
diff --git a/src/terralib/kernel/TeFragmentation.h b/src/terralib/kernel/TeFragmentation.h
old mode 100755
new mode 100644
index 70f50fc..8228dae
--- a/src/terralib/kernel/TeFragmentation.h
+++ b/src/terralib/kernel/TeFragmentation.h
@@ -1,61 +1,61 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeFragmentation.h
-    \brief This file contains Algorithms for Topological Operations.
-	       These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
-           THIS IS FOR INTERNAL USE ONLY.
-*/
-
-#ifndef  __TERRALIB_INTERNAL_FRAGMENTATION_H
-#define  __TERRALIB_INTERNAL_FRAGMENTATION_H
-
-#include "TeGeometry.h"
-#include "TeIntersector.h"
-
-/** @defgroup FragmentAlgorithms Algorithms that performs fragmentation of lines
-	@ingroup GeometryAlgorithms
-    THIS IS FOR INTERNAL USE ONLY: TerraLib fragmentation algorithms. 
- *  @{
- */
-/** \brief Fragments the lines according intersection points (May rise an exception: you must use try and catch).
-	\param lines			  The lines to fragment.
-	\param ips			      The intersection points where the boundary will be fragmented.
-	\param boundaryFragments  Output list of segments in the boundary of another line.
-	\param fragments		  Output list of line fragmemts.
-*/
-TL_DLL void TeFragmentBoundary(const TeLineSet& lines, TeINTERSECTOR2::TeVectorBoundaryIP& ips, TeLineSet& boundaryFragments, TeLineSet& fragments);
-
-/**  Fragments the lines according intersection points (May rise an exception: you must use try and catch).	
-	\param polygons              List of polygons (lines to be fragmented).
-	\param ips				     Intersection points where the boundary will be fragmented.
-	\param boundaryFragments     Output list of segments in the boundary of another line.
-	\param boundaryFragmentsIds  Output list with the objects identifiers for each fragment (to be used by location, to decide in/out fragments).
-	\param fragments		     Output list of line fragmemts.
-	\param fragmentsIds		     Output list with the objects identifiers for each fragment (to be used by location, to decide in/out fragments).
-*/
-TL_DLL void TeFragmentBoundary(const TePolygonSet& polygons, TeINTERSECTOR2::TeVectorBoundaryIP& ips, 
-						TeLineSet& boundaryFragments, vector<pair<unsigned int, unsigned int> >& boundaryFragmentsIds, TeLineSet& fragments, vector<pair<unsigned int, unsigned int> >& fragmentsIds);
-
-/** @} */ // end of group  FragmentAlgorithms
-
-#endif	// __TERRALIB_INTERNAL_FRAGMENTATION_H
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeFragmentation.h
+    \brief This file contains Algorithms for Topological Operations.
+	       These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
+           THIS IS FOR INTERNAL USE ONLY.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_FRAGMENTATION_H
+#define  __TERRALIB_INTERNAL_FRAGMENTATION_H
+
+#include "TeGeometry.h"
+#include "TeIntersector.h"
+
+/** @defgroup FragmentAlgorithms Algorithms that performs fragmentation of lines
+	@ingroup GeometryAlgorithms
+    THIS IS FOR INTERNAL USE ONLY: TerraLib fragmentation algorithms. 
+ *  @{
+ */
+/** \brief Fragments the lines according intersection points (May rise an exception: you must use try and catch).
+	\param lines			  The lines to fragment.
+	\param ips			      The intersection points where the boundary will be fragmented.
+	\param boundaryFragments  Output list of segments in the boundary of another line.
+	\param fragments		  Output list of line fragmemts.
+*/
+TL_DLL void TeFragmentBoundary(const TeLineSet& lines, TeINTERSECTOR2::TeVectorBoundaryIP& ips, TeLineSet& boundaryFragments, TeLineSet& fragments);
+
+/**  Fragments the lines according intersection points (May rise an exception: you must use try and catch).	
+	\param polygons              List of polygons (lines to be fragmented).
+	\param ips				     Intersection points where the boundary will be fragmented.
+	\param boundaryFragments     Output list of segments in the boundary of another line.
+	\param boundaryFragmentsIds  Output list with the objects identifiers for each fragment (to be used by location, to decide in/out fragments).
+	\param fragments		     Output list of line fragmemts.
+	\param fragmentsIds		     Output list with the objects identifiers for each fragment (to be used by location, to decide in/out fragments).
+*/
+TL_DLL void TeFragmentBoundary(const TePolygonSet& polygons, TeINTERSECTOR2::TeVectorBoundaryIP& ips, 
+						TeLineSet& boundaryFragments, vector<pair<unsigned int, unsigned int> >& boundaryFragmentsIds, TeLineSet& fragments, vector<pair<unsigned int, unsigned int> >& fragmentsIds);
+
+/** @} */ // end of group  FragmentAlgorithms
+
+#endif	// __TERRALIB_INTERNAL_FRAGMENTATION_H
diff --git a/src/terralib/kernel/TeFunctionCallThreadJob.cpp b/src/terralib/kernel/TeFunctionCallThreadJob.cpp
old mode 100755
new mode 100644
index 295f116..4700d4b
--- a/src/terralib/kernel/TeFunctionCallThreadJob.cpp
+++ b/src/terralib/kernel/TeFunctionCallThreadJob.cpp
@@ -1,25 +1,25 @@
-#include "TeFunctionCallThreadJob.h"
-
-TeFunctionCallThreadJob::TeFunctionCallThreadJob() 
-{
-  jobFunc_ = 0;
-  jobFuncParsPtr_ = 0;
-};
-
-TeFunctionCallThreadJob::~TeFunctionCallThreadJob() 
-{
-};
-
-void TeFunctionCallThreadJob::executeJobCode() 
-{
-  if( jobFunc_ ) jobFunc_( jobFuncParsPtr_);
-};
-
-TeThreadJob* TeFunctionCallThreadJob::clone() const
-{
-  TeFunctionCallThreadJob* clonedJobPtr = new TeFunctionCallThreadJob;
-  clonedJobPtr->jobFunc_ = jobFunc_;
-  clonedJobPtr->jobFuncParsPtr_ = jobFuncParsPtr_;
-  
-  return clonedJobPtr;
-}
+#include "TeFunctionCallThreadJob.h"
+
+TeFunctionCallThreadJob::TeFunctionCallThreadJob() 
+{
+  jobFunc_ = 0;
+  jobFuncParsPtr_ = 0;
+};
+
+TeFunctionCallThreadJob::~TeFunctionCallThreadJob() 
+{
+};
+
+void TeFunctionCallThreadJob::executeJobCode() 
+{
+  if( jobFunc_ ) jobFunc_( jobFuncParsPtr_);
+};
+
+TeThreadJob* TeFunctionCallThreadJob::clone() const
+{
+  TeFunctionCallThreadJob* clonedJobPtr = new TeFunctionCallThreadJob;
+  clonedJobPtr->jobFunc_ = jobFunc_;
+  clonedJobPtr->jobFuncParsPtr_ = jobFuncParsPtr_;
+  
+  return clonedJobPtr;
+}
diff --git a/src/terralib/kernel/TeFunctionCallThreadJob.h b/src/terralib/kernel/TeFunctionCallThreadJob.h
old mode 100755
new mode 100644
index 4d45f3d..9057af2
--- a/src/terralib/kernel/TeFunctionCallThreadJob.h
+++ b/src/terralib/kernel/TeFunctionCallThreadJob.h
@@ -1,67 +1,68 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-
-#ifndef __TERRALIB_INTERNAL_TEFUNCTIONCALLTHREADJOB_H
-#define __TERRALIB_INTERNAL_TEFUNCTIONCALLTHREADJOB_H
-
-#include "TeThreadJob.h"
-#include "TeDefines.h"
-
-    
-/*! \brief This job calls a C function passing a user supplied
- * parameters pointer.
- * \author Emiliano F. Castejon
- */
-class TL_DLL TeFunctionCallThreadJob : public TeThreadJob
-{
-  public :
-    /** \brief Type definition for a thread job entry function pointer.
-     *  \param parsPtr The function user parameters pointer.
-     */
-    typedef void (*FunctPtrT)( void* parsPtr );      
-    
-    /*! A pointer to the function that will be called when this job
-     * stats
-     */ 
-    FunctPtrT jobFunc_;
-
-    /*! A pointer to the function paramters that will be passed when this job
-     * stats
-     */      
-    void* jobFuncParsPtr_;
-    
-    TeFunctionCallThreadJob();
-    
-    ~TeFunctionCallThreadJob();
-    
-    //Overloaded.
-    TeThreadJob* clone() const;
-    
-    // Overloaded
-    void executeJobCode();
-};
-      
-  
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+
+#ifndef __TERRALIB_INTERNAL_TEFUNCTIONCALLTHREADJOB_H
+#define __TERRALIB_INTERNAL_TEFUNCTIONCALLTHREADJOB_H
+
+#include "TeThreadJob.h"
+#include "TeDefines.h"
+
+    
+/*! \brief This job calls a C function passing a user supplied
+ * parameters pointer.
+ * \author Emiliano F. Castejon
+ * \ingroup MultProgToolsGroup
+ */
+class TL_DLL TeFunctionCallThreadJob : public TeThreadJob
+{
+  public :
+    /** \brief Type definition for a thread job entry function pointer.
+     *  \param parsPtr The function user parameters pointer.
+     */
+    typedef void (*FunctPtrT)( void* parsPtr );      
+    
+    /*! A pointer to the function that will be called when this job
+     * stats
+     */ 
+    FunctPtrT jobFunc_;
+
+    /*! A pointer to the function paramters that will be passed when this job
+     * stats
+     */      
+    void* jobFuncParsPtr_;
+    
+    TeFunctionCallThreadJob();
+    
+    ~TeFunctionCallThreadJob();
+    
+    //Overloaded.
+    TeThreadJob* clone() const;
+    
+    // Overloaded
+    void executeJobCode();
+};
+      
+  
+#endif
+
diff --git a/src/terralib/kernel/TeGDriverFactory.cpp b/src/terralib/kernel/TeGDriverFactory.cpp
new file mode 100644
index 0000000..41448b8
--- /dev/null
+++ b/src/terralib/kernel/TeGDriverFactory.cpp
@@ -0,0 +1,30 @@
+#include "TeGDriverFactory.h"
+
+TeGDriverParams::TeGDriverParams(const string & fileType, const string & fileName) 
+{
+  // Bouml preserved body begin 0005BE02
+	fileType_ = fileType;
+	fileName_ = fileName;
+  // Bouml preserved body end 0005BE02
+}
+
+string TeGDriverParams::getProductId() const 
+{
+  // Bouml preserved body begin 0005C602
+	return fileType_;
+  // Bouml preserved body end 0005C602
+}
+
+TeGDriverFactory::TeGDriverFactory(const string & facName) :
+TeAbstractFactory<TeGeoDataDriver, TeGDriverParams, string>(facName)
+{
+  // Bouml preserved body begin 0005C002
+  // Bouml preserved body end 0005C002
+}
+
+TeGDriverFactory::~TeGDriverFactory() 
+{
+  // Bouml preserved body begin 0005C082
+  // Bouml preserved body end 0005C082
+}
+
diff --git a/src/terralib/kernel/TeGDriverFactory.h b/src/terralib/kernel/TeGDriverFactory.h
new file mode 100644
index 0000000..0385022
--- /dev/null
+++ b/src/terralib/kernel/TeGDriverFactory.h
@@ -0,0 +1,38 @@
+
+#ifndef _TEGDRIVERFACTORY_H
+#define _TEGDRIVERFACTORY_H
+
+#include <string>
+using namespace std;
+#include "TeAbstractFactory.h"
+#include "TeGeoDataDriver.h"
+
+struct TL_DLL TeGDriverParams 
+{
+    TeGDriverParams(const string & fileType, const string & fileName);
+
+    //Used by the factory.
+    string getProductId() const;
+
+    string fileType_; //!< Defines the type of file to be used. It identifies the factory of TeGeodataDriver objects.    
+
+    string fileName_; //!< Complete name of the file.    
+
+
+  private:
+    //No copy allowed.
+    TeGDriverParams(const TeGDriverParams & source);
+
+    //No copy allowed.
+    TeGDriverParams & operator=(const TeGDriverParams & source);
+
+};
+class TL_DLL TeGDriverFactory : public TeAbstractFactory<TeGeoDataDriver, TeGDriverParams, string> 
+{
+  public:
+    TeGDriverFactory(const string & facName);
+
+    virtual ~TeGDriverFactory();
+
+};
+#endif
diff --git a/src/terralib/kernel/TeGTFactory.cpp b/src/terralib/kernel/TeGTFactory.cpp
old mode 100755
new mode 100644
index 6990bb5..d5e02e1
--- a/src/terralib/kernel/TeGTFactory.cpp
+++ b/src/terralib/kernel/TeGTFactory.cpp
@@ -1,32 +1,32 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/ 
-#include "TeGTFactory.h"
-
-TeGTFactory::TeGTFactory( const std::string& factoryName )
-: TeFactory< TeGeometricTransformation, TeGTParams >( factoryName )
-{
-};      
-
-TeGTFactory::~TeGTFactory()
-{
-};
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/ 
+#include "TeGTFactory.h"
+
+TeGTFactory::TeGTFactory( const std::string& factoryName )
+: TeFactory< TeGeometricTransformation, TeGTParams >( factoryName )
+{
+};      
+
+TeGTFactory::~TeGTFactory()
+{
+};
diff --git a/src/terralib/kernel/TeGTFactory.h b/src/terralib/kernel/TeGTFactory.h
old mode 100755
new mode 100644
index 3e31f6d..ced2580
--- a/src/terralib/kernel/TeGTFactory.h
+++ b/src/terralib/kernel/TeGTFactory.h
@@ -1,78 +1,78 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeGTFactory.h
-    \brief This file supports the implementation of Geometric transformation factories.
-	\author Emiliano Ferreira Castejon <castejon at dpi.inpe.br>
-*/
-/**
- * @defgroup TeGTFactories Geometric transformation factories.
- * @ingroup Utils
- */  
-
-#include "TeDefines.h"
-
-#ifndef TEGTFACTORIES_REGISTERED
-  #define TEGTFACTORIES_REGISTERED
-
-  #include "TeAffineGTFactory.h"
-  #include "TeProjectiveGTFactory.h"
-#endif 
-
-#ifndef TEGTFACTORY_H
-  #define TEGTFACTORY_H
-
-  #include "TeGeometricTransformation.h"
-  #include "TeGTParams.h"
-  #include "TeFactory.h"
-  
-  #include <string>
-  
-  /**
-   * @brief This is the class for geometric transformations factory.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup TeGTFactories
-   */
-  class TL_DLL TeGTFactory : 
-    public TeFactory< TeGeometricTransformation, TeGTParams >
-  {
-    public :
-      
-      /**
-       * Default Destructor
-       */
-      virtual ~TeGTFactory();
-      
-    protected :
-      
-      /**
-       * Default constructor
-       *
-       * @param factoryName Factory name.
-       */
-      TeGTFactory( const std::string& factoryName );
-  };
-  
-#endif
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGTFactory.h
+    \brief This file supports the implementation of Geometric transformation factories.
+	\author Emiliano Ferreira Castejon <castejon at dpi.inpe.br>
+*/
+/**
+ * @defgroup TeGTFactories Geometric transformation factories.
+ * @ingroup Utils
+ */  
+
+#include "TeDefines.h"
+
+#ifndef TEGTFACTORIES_REGISTERED
+  #define TEGTFACTORIES_REGISTERED
+
+  #include "TeAffineGTFactory.h"
+  #include "TeProjectiveGTFactory.h"
+#endif 
+
+#ifndef TEGTFACTORY_H
+  #define TEGTFACTORY_H
+
+  #include "TeGeometricTransformation.h"
+  #include "TeGTParams.h"
+  #include "TeFactory.h"
+  
+  #include <string>
+  
+  /**
+   * @brief This is the class for geometric transformations factory.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup GeometricTransformationGroup
+   */
+  class TL_DLL TeGTFactory : 
+    public TeFactory< TeGeometricTransformation, TeGTParams >
+  {
+    public :
+      
+      /**
+       * Default Destructor
+       */
+      virtual ~TeGTFactory();
+      
+    protected :
+      
+      /**
+       * Default constructor
+       *
+       * @param factoryName Factory name.
+       */
+      TeGTFactory( const std::string& factoryName );
+  };
+  
+#endif
+
+
+
diff --git a/src/terralib/kernel/TeGTParams.cpp b/src/terralib/kernel/TeGTParams.cpp
old mode 100755
new mode 100644
index 7c8ba5b..5698573
--- a/src/terralib/kernel/TeGTParams.cpp
+++ b/src/terralib/kernel/TeGTParams.cpp
@@ -1,112 +1,143 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeGTParams.h"
-
-#include <float.h>
-
-TeGTParams::TeGTParams()
-{
-  reset();  
-}
-
-
-TeGTParams::TeGTParams( const TeGTParams& external )
-{
-  operator=( external );
-}
-
-
-TeGTParams::~TeGTParams()
-{
-  reset();
-}
-
-
-const TeGTParams& TeGTParams::operator=( 
-  const TeGTParams& external )
-{
-  /* General parameters */
-  
-  transformation_name_ = external.transformation_name_;
-  out_rem_strat_ = external.out_rem_strat_;
-  max_dmap_error_ = external.max_dmap_error_;
-  max_imap_error_ = external.max_imap_error_;
-  max_dmap_rmse_ = external.max_dmap_rmse_;
-  max_imap_rmse_ = external.max_imap_rmse_;
-  tiepoints_ = external.tiepoints_;
-  direct_parameters_ = external.direct_parameters_;
-  inverse_parameters_ = external.inverse_parameters_;
-  enable_multi_thread_ = external.enable_multi_thread_;
-  
-  /* Projective parameters */
-  
-  maxIters_          = external.maxIters_;
-  tolerance_         = external.tolerance_;
-  useAdaptiveParams_ = external.useAdaptiveParams_;  
-  WMatrix_ = external.WMatrix_;
-  deltaX_ = external.deltaX_;
-  deltaY_ = external.deltaY_;
-  deltaU_ = external.deltaU_;
-  deltaV_ = external.deltaV_;  
-  
-  return external;
-}
-
-
-std::string TeGTParams::decName() const
-{
-  return transformation_name_;
-}
-
-
-void TeGTParams::reset()
-{
-  /* general parameters */
-  
-  transformation_name_ = "affine";
-  out_rem_strat_ = NoOutRemotion;
-  max_dmap_error_ = DBL_MAX;
-  max_imap_error_ = DBL_MAX;
-  max_dmap_rmse_ = DBL_MAX;
-  max_imap_rmse_ = DBL_MAX;
-  
-  enable_multi_thread_ = true;
-  
-  direct_parameters_.Clear();
-  inverse_parameters_.Clear();
-  tiepoints_.clear();  
-  
-  /* projective parameters */
-  
-  maxIters_  = 20;
-  tolerance_ = 0.0001;
-  useAdaptiveParams_ = false; 
-  deltaX_ = 0.0;
-  deltaY_ = 0.0;
-  deltaU_ = 0.0;
-  deltaV_ = 0.0;
-  
-  WMatrix_.Clear();
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeGTParams.h"
+
+#include <float.h>
+
+TeGTParams::TeGTParams()
+{
+  reset();  
+}
+
+
+TeGTParams::TeGTParams( const TeGTParams& external )
+{
+  operator=( external );
+}
+
+
+TeGTParams::~TeGTParams()
+{
+  reset();
+}
+
+
+const TeGTParams& TeGTParams::operator=( 
+  const TeGTParams& external )
+{
+  /* General parameters */
+  
+  transformation_name_ = external.transformation_name_;
+  out_rem_strat_ = external.out_rem_strat_;
+  tiepoints_ = external.tiepoints_;
+  direct_parameters_ = external.direct_parameters_;
+  inverse_parameters_ = external.inverse_parameters_;
+  enable_multi_thread_ = external.enable_multi_thread_;
+  
+  // Outliers remotion parameters
+  
+  max_dmap_error_ = external.max_dmap_error_;
+  max_imap_error_ = external.max_imap_error_;
+  max_dmap_rmse_ = external.max_dmap_rmse_;
+  max_imap_rmse_ = external.max_imap_rmse_;
+  tiePointsWeights_ = external.tiePointsWeights_;  
+  
+  /* Projective parameters */
+  
+  maxIters_          = external.maxIters_;
+  tolerance_         = external.tolerance_;
+  useAdaptiveParams_ = external.useAdaptiveParams_;  
+  WMatrix_ = external.WMatrix_;
+  deltaX_ = external.deltaX_;
+  deltaY_ = external.deltaY_;
+  deltaU_ = external.deltaU_;
+  deltaV_ = external.deltaV_;  
+  
+  return external;
+}
+
+
+std::string TeGTParams::decName() const
+{
+  return transformation_name_;
+}
+
+
+void TeGTParams::reset()
+{
+  /* general parameters */
+  
+  transformation_name_ = "affine";
+  out_rem_strat_ = NoOutRemotion;
+  enable_multi_thread_ = true;
+  direct_parameters_.Clear();
+  inverse_parameters_.Clear();
+  tiepoints_.clear();  
+  
+  // Outliers remotion parameters
+  
+  max_dmap_error_ = DBL_MAX;
+  max_imap_error_ = DBL_MAX;
+  max_dmap_rmse_ = DBL_MAX;
+  max_imap_rmse_ = DBL_MAX;
+  tiePointsWeights_.clear();
+  
+  /* projective parameters */
+  
+  maxIters_  = 20;
+  tolerance_ = 0.0001;
+  useAdaptiveParams_ = false; 
+  deltaX_ = 0.0;
+  deltaY_ = 0.0;
+  deltaU_ = 0.0;
+  deltaV_ = 0.0;
+  
+  WMatrix_.Clear();
+}
+
+bool TeGTParams::operator==( const TeGTParams& external ) const
+{
+  return ( 
+    ( transformation_name_ == external.transformation_name_ )
+    && ( out_rem_strat_ == external.out_rem_strat_ )
+    && ( max_dmap_error_ == external.max_dmap_error_ )
+    && ( max_imap_error_ == external.max_imap_error_ )
+    && ( max_dmap_rmse_ == external.max_dmap_rmse_ )
+    && ( max_imap_rmse_ == external.max_imap_rmse_ )
+    && ( tiePointsWeights_ == external.tiePointsWeights_ )
+    && ( tiepoints_ == external.tiepoints_ )
+    && ( direct_parameters_ == external.direct_parameters_ )
+    && ( inverse_parameters_ == external.inverse_parameters_ )
+    && ( enable_multi_thread_ == external.enable_multi_thread_ )
+    && ( maxIters_ == external.maxIters_ )
+    && ( tolerance_ == external.tolerance_ )
+    && ( useAdaptiveParams_ == external.useAdaptiveParams_ )
+    && ( WMatrix_ == external.WMatrix_ )
+    && ( deltaX_ == external.deltaX_ )
+    && ( deltaY_ == external.deltaY_ )
+    && ( deltaU_ == external.deltaU_ )
+    && ( deltaV_ == external.deltaV_ )
+  );
+}
+
diff --git a/src/terralib/kernel/TeGTParams.h b/src/terralib/kernel/TeGTParams.h
old mode 100755
new mode 100644
index 39396c3..8b27f43
--- a/src/terralib/kernel/TeGTParams.h
+++ b/src/terralib/kernel/TeGTParams.h
@@ -1,249 +1,284 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeGTParams.h
-    \brief This file contains the definition of parameters necessary to build a    TeGeometricTransformation instance.
-*/
-
-#ifndef TEGTPARAMS_H
-  #define TEGTPARAMS_H
-  
-  #include "TeMatrix.h"
-  #include "TeCoord2D.h"
-  #include "TeSharedPtr.h"
-  #include "TeDefines.h"
-
-  #include <string>
-
-  /**
-   * @brief This is the class for geometric transformation parameters .
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup Utils
-   */
-  class TL_DLL TeGTParams
-  {
-    public :
-    
-      /** 
-       * @typedef TeSharedPtr< TeGTParams > pointer
-       * Type definition for a TeGTParams instance pointer. 
-       */
-      typedef TeSharedPtr< TeGTParams > pointer;    
-      
-      /**
-       * @enum OutRemStrategy
-       * Outliers remotion strategy.
-       */ 
-      enum OutRemStrategy {
-        /**
-         * @brief No outliers remotion applied.
-         */
-        NoOutRemotion,
-        /**
-         * @brief Exaustive outliers remotion (all
-         * possible tie-points combinations will be
-         * tested.
-         */
-        ExaustiveOutRemotion,
-        /**
-         * @brief LOA (leave-worse-out) will
-         * be performed.
-         */
-        LWAOutRemotion
-      };     
-      
-      /**
-       * @name General parameters.
-       * 
-       * @brief Used by all transformations..
-       */       
-    
-      /**
-       * @brief Transformation name.
-       *
-       * @note Default value = affine.
-       */
-      std::string transformation_name_;
-      
-      /** 
-       * @brief The outliers remotion strategy.  
-       *
-       * @note Default value = NoOutRemotion.    
-       */
-      OutRemStrategy out_rem_strat_;
-      
-      /**
-       * @brief The maximum allowed direct mapping error.
-       *
-       * @note Default value = Positive infinite.    
-       */         
-      double max_dmap_error_;
-      
-      /**
-       * @brief The maximum allowed inverse mapping error.
-       *
-       * @note Default value = Positive infinite.    
-       */         
-      double max_imap_error_;   
-
-      /**
-       * @brief The maximum allowed direct mapping mean square error.
-       *
-       * @note Default value = Positive infinite.    
-       */         
-      double max_dmap_rmse_;
-      
-      /**
-       * @brief The maximum allowed inverse mapping mean square error.
-       *
-       * @note Default value = Positive infinite.    
-       */         
-      double max_imap_rmse_; 
-    
-      /**
-       * @brief The current direct mapping transformation parameters.
-       * @note Default value = An empty matrix.    
-       */    
-      TeMatrix direct_parameters_;
-      
-      /**
-       * @brief The current inverse mapping transformation parameters.
-       * @note Default value = An empty matrix.    
-       */    
-      TeMatrix inverse_parameters_;      
-
-      /**
-       * @brief The current transformation tie-points.
-       * @note Default value = An empty vector.    
-       */    
-      std::vector< TeCoordPair > tiepoints_; 
-      
-      /**
-       * @brief Enable/disable multi-thread processing (when
-       * available (default=true).
-       */    
-      bool enable_multi_thread_;       
-      
-      /**
-       * @name Projective transformation parameters.
-       * @brief Projective transformation parameters.
-       */             
-      
-      /**
-       * @brief The weight matrix used by least square method.
-       *
-       * @note Default value = empty matrix.
-       */         
-      TeMatrix WMatrix_;
-      
-      /**
-       * @brief The maximun number of iterations while processing.
-       *
-       * @note Default value = 20.
-       */         
-      unsigned int maxIters_;
-      
-      /**
-       * @brief The tolerance used while executing an iterative processing.
-       *
-       * @note Default value = 0.0001.
-       */         
-      double tolerance_;
-      
-      /**
-       * @brief Indicates whether use adaptive parameters or not.
-       *
-       * @note Default value = false.
-       */         
-      bool useAdaptiveParams_;    
-      
-      /**
-       * @brief Adaptive parameter.
-       *
-       * @note Default value = 0.
-       */       
-      double deltaX_;
-      
-      /**
-       * @brief Adaptive parameter.
-       *
-       * @note Default value = 0.
-       */       
-      double deltaY_;
-      
-      /**
-       * @brief Adaptive parameter.
-       *
-       * @note Default value = 0.
-       */       
-      double deltaU_;
-      
-      /**
-       * @brief Adaptive parameter.
-       *
-       * @note Default value = 0.
-       */       
-      double deltaV_;   
-      
-      /**
-       * @name Class methods.
-       * @brief Class methods.
-       */          
-
-      /**
-       * @brief Default constructor
-       */
-      TeGTParams();
-      
-      /**
-       * @brief Alternative constructor
-       * @param external External reference.
-       */
-      TeGTParams( const TeGTParams& external );      
-      
-      /**
-       * @brief Default Destructor
-       */
-      ~TeGTParams();
-      
-      /**
-       * @brief operator= implementation.
-       *
-       * @param external External reference.
-       * @return A const reference to the external object instance.
-       */
-      const TeGTParams& operator=( 
-        const TeGTParams& external );      
-
-      /**
-       * @brief This is for TeFactory compatibility.
-       */
-      std::string decName() const;
-      
-      /**
-       * @brief Reset to the default parameters.
-       */
-      void reset();      
-            
-  };
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGTParams.h
+    \brief This file contains the definition of parameters necessary to build a TeGeometricTransformation instance.
+*/
+
+#ifndef TEGTPARAMS_H
+  #define TEGTPARAMS_H
+  
+  #include "TeMatrix.h"
+  #include "TeCoord2D.h"
+  #include "TeSharedPtr.h"
+  #include "TeDefines.h"
+
+  #include <string>
+
+  /**
+   * @brief Geometric transformation parameters.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup GeometricTransformationGroup
+   */
+  class TL_DLL TeGTParams
+  {
+    public :
+    
+      /**
+       * @name General parameters.
+       * 
+       * @brief Used by all transformations..
+       */      
+    
+      /** 
+       * @typedef TeSharedPtr< TeGTParams > pointer
+       * Type definition for a TeGTParams instance pointer. 
+       */
+      typedef TeSharedPtr< TeGTParams > pointer;    
+      
+      /**
+       * @enum OutRemStrategy
+       * Outliers remotion strategy.
+       * @note When using an outliers remotion strategy only the general
+       * parameters and the outliers remotion parameters will be considered.
+       */ 
+      enum OutRemStrategy {
+        /**
+         * @brief No outliers remotion applied.
+         */
+        NoOutRemotion,
+        
+        /**
+         * @brief Exaustive outliers remotion (all
+         * possible tie-points combinations will be
+         * tested.
+         */
+        ExaustiveOutRemotion,
+        
+        /**
+         * @brief Iteractive leave-worse-out) will remotion
+         * be performed.
+         * @note This method will use the optional parameter 
+         * tiePointsWeights_ if it is available.
+         */
+        LWOutRemotion,
+        
+        /**
+         * @brief Random Sample Consensus based outliers remotion
+         * will be applied.
+         * @note This method will use the optional parameter 
+         * tiePointsWeights_ if it is available.
+         * @note Reference: Martin A. Fischler and Robert C. Bolles,
+         * Random Sample Consensus: A Paradigm for Model Fitting with 
+         * Applications to Image Analysis and Automated Cartography,
+         * Communications of the ACM  archive, Volume 24 ,  
+         * Issue 6  (June 1981)
+         */
+        RANSACRemotion        
+      };     
+    
+      /**
+       * @brief Transformation name.
+       *
+       * @note Default value = affine.
+       */
+      std::string transformation_name_;
+      
+      /** 
+       * @brief The outliers remotion strategy.  
+       *
+       * @note Default value = NoOutRemotion.    
+       */
+      OutRemStrategy out_rem_strat_;
+    
+      /**
+       * @brief The current direct mapping transformation parameters.
+       * @note Default value = An empty matrix.    
+       */    
+      TeMatrix direct_parameters_;
+      
+      /**
+       * @brief The current inverse mapping transformation parameters.
+       * @note Default value = An empty matrix.    
+       */    
+      TeMatrix inverse_parameters_;      
+
+      /**
+       * @brief The current transformation tie-points.
+       * @note Default value = An empty vector.    
+       */    
+      std::vector< TeCoordPair > tiepoints_; 
+      
+      /**
+       * @brief Enable/disable multi-thread processing (when
+       * available (default=true).
+       */    
+      bool enable_multi_thread_;     
+        
+      /**
+       * @name Outliers remotion strategy used parameters.
+       * 
+       * @brief Used when an outlier remotion strategy (other than
+       * NoOutRemotion) is used.
+       */        
+      
+      /**
+       * @brief The maximum allowed direct mapping error.
+       *
+       * @note Default value = Positive infinite.    
+       */         
+      double max_dmap_error_;
+      
+      /**
+       * @brief The maximum allowed inverse mapping error.
+       *
+       * @note Default value = Positive infinite.    
+       */         
+      double max_imap_error_;   
+
+      /**
+       * @brief The maximum allowed direct mapping mean square error.
+       *
+       * @note Default value = Positive infinite.    
+       */         
+      double max_dmap_rmse_;
+      
+      /**
+       * @brief The maximum allowed inverse mapping mean square error.
+       *
+       * @note Default value = Positive infinite.    
+       */         
+      double max_imap_rmse_;    
+           
+      /**
+       * @brief The current transformation tie-points weights.
+       * @note Only positive values are allowed.
+       */    
+      std::vector< double > tiePointsWeights_;            
+      
+      /**
+       * @name Projective transformation parameters.
+       * @brief Projective transformation parameters.
+       */             
+      
+      /**
+       * @brief The weight matrix used by least square method.
+       *
+       * @note Default value = empty matrix.
+       */         
+      TeMatrix WMatrix_;
+      
+      /**
+       * @brief The maximun number of iterations while processing.
+       *
+       * @note Default value = 20.
+       */         
+      unsigned int maxIters_;
+      
+      /**
+       * @brief The tolerance used while executing an iterative processing.
+       *
+       * @note Default value = 0.0001.
+       */         
+      double tolerance_;
+      
+      /**
+       * @brief Indicates whether use adaptive parameters or not.
+       *
+       * @note Default value = false.
+       */         
+      bool useAdaptiveParams_;    
+      
+      /**
+       * @brief Adaptive parameter.
+       *
+       * @note Default value = 0.
+       */       
+      double deltaX_;
+      
+      /**
+       * @brief Adaptive parameter.
+       *
+       * @note Default value = 0.
+       */       
+      double deltaY_;
+      
+      /**
+       * @brief Adaptive parameter.
+       *
+       * @note Default value = 0.
+       */       
+      double deltaU_;
+      
+      /**
+       * @brief Adaptive parameter.
+       *
+       * @note Default value = 0.
+       */       
+      double deltaV_;   
+      
+      /**
+       * @name Class methods.
+       * @brief Class methods.
+       */          
+
+      /**
+       * @brief Default constructor
+       */
+      TeGTParams();
+      
+      /**
+       * @brief Alternative constructor
+       * @param external External reference.
+       */
+      TeGTParams( const TeGTParams& external );      
+      
+      /**
+       * @brief Default Destructor
+       */
+      ~TeGTParams();
+      
+      /**
+       * @brief operator= implementation.
+       *
+       * @param external External reference.
+       * @return A const reference to the external object instance.
+       */
+      const TeGTParams& operator=( 
+        const TeGTParams& external );      
+
+      /**
+       * @brief This is for TeFactory compatibility.
+       */
+      std::string decName() const;
+      
+      /**
+       * @brief Reset to the default parameters.
+       */
+      void reset();      
+      
+      // Overload
+      bool operator==( const TeGTParams& external ) const;
+            
+  };
+
+#endif
diff --git a/src/terralib/kernel/TeGeneralizedProxMatrix.h b/src/terralib/kernel/TeGeneralizedProxMatrix.h
old mode 100755
new mode 100644
index 08cfefe..72c5fd0
--- a/src/terralib/kernel/TeGeneralizedProxMatrix.h
+++ b/src/terralib/kernel/TeGeneralizedProxMatrix.h
@@ -1,630 +1,630 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeGeneralizedProxMatrix.h
-	\brief This file contains structures and definitions about generalized proximity matrices support in TerraLib
-*/
-
-#ifndef TeProxMatrix_H
-#define TeProxMatrix_H
-
-#include "TeNeighbours.h"
-#include "TeProxMatrixImplementation.h"
-#include "TeProxMatrixConstructionStrategy.h"
-#include "TeProxMatrixSlicingStrategy.h"
-#include "TeProxMatrixWeightsStrategy.h"
-#include "TeSTElementSet.h"
-
-
-//! A class to represent a generalized proximity matrix 
-template<typename Set> 
-class TeGeneralizedProxMatrix  
-{
-private:
-	TeProxMatrixImplementation*	imp_;  
-	TeProxMatrixConstructionStrategy<Set>* sc_;   
-	TeProxMatrixSlicingStrategy* ss_;   
-	TeProxMatrixWeightsStrategy* sw_;  
-	
-protected:
-	//! Get the implementation from a concrete factory defined by impl_type
-	TeProxMatrixImplementation*				getImplementation(const TeGPMImplementation& implementation_type = TeGraphBreymann);
-
-	//! Verify if a matrix was created correctly by the constructors.	
-	bool isValid() const;
-	
-public:
-	int						gpm_id_;	
-	bool					is_default_;
-	int						total_slices_;
-	string					neighbourhood_table_;
-	TeGPMImplementation		impl_strategy_;
-
-	//! Empty constructor
-	TeGeneralizedProxMatrix ():
-		imp_(0), sc_(0), ss_(0), sw_(0), gpm_id_(-1),
-		is_default_(false), total_slices_(1), neighbourhood_table_(""), 
-		impl_strategy_(TeGraphBreymann)
-	  {}
-
-  //! Constructor
-	TeGeneralizedProxMatrix (const int& id, const string& tableName, TeProxMatrixImplementation* imp, TeProxMatrixWeightsStrategy* ws):
-		imp_(imp), sc_(0), ss_(0), sw_(ws),
-		gpm_id_(id), is_default_(false), total_slices_(1), 
-		neighbourhood_table_(tableName), impl_strategy_(TeGraphBreymann)
-	  {}
-
-	//! Constructor parametrized with specific strategies. Each stragegy must be previously created and correctly parametrized.
-	TeGeneralizedProxMatrix (TeProxMatrixConstructionStrategy<Set>* sc,  TeProxMatrixWeightsStrategy* sw = 0, 
-		TeProxMatrixSlicingStrategy* ss = 0, const TeGPMImplementation& type = TeGraphBreymann, 
-		const int& gpmId=-1, const bool& isDefault=false,  const string& neigsTable ="", const int& slices=1);
-
-	//! Constructor based on default strategies: (a) Local adjacency of first order; (b) No siling;  and (c)  No weighs (all equal to 1).
-	TeGeneralizedProxMatrix(TeSTElementSet* objects, TeGeomRep geom_type, const TeGPMImplementation& type = TeGraphBreymann);
-
-	//! Copy constructor
-	TeGeneralizedProxMatrix(const TeGeneralizedProxMatrix& p);
-
-	//! Attribution Operator 
-	TeGeneralizedProxMatrix& operator=(const TeGeneralizedProxMatrix& p);
-
-	bool clearImplementation ();
-
-	//! Comparison Operator
-	bool operator==(const TeGeneralizedProxMatrix& p) const;
-	
-	
-	/** @name getNeighbours Methods for return the neighbours
-	*  All methods return the  neighbours of a given object in a given slice. The default is the first slice.
-	*  Slices are defined according to the Slicing Strategy in use (e.g., according to distance zones, corresponding to neighbourhood orders, weights intervals, etc.). 
-	*  If the parameter slice is not provided, the first slice is returned.
-	*  The operator[] method should preferably be used 
-	*  For each object, all the connection attributes are stored as properties (weight is the first).
-	*/
-	//@{ 
-	//! Return the neighbours of an object in a slice, packed in a TeNeighbours 
-	TeNeighbours getNeighbours (const string& object_id, int slice = 1);
-
-	//! Return the neighbours of an object in a slice, packed in a TeNeighboursMap
-	TeNeighboursMap	getMapNeighbours (const string& object_id, int slice = 1);
-	
-	//! Operator [], return the neighbours packed in a TeNeighbours
-	TeNeighbours operator[] (const string& object_id); 
-
-	//! Return the neighbours of an object and their attributes in a spatial temporal element set (TeSTElementSet)
-	TeSTElementSet getSTENeighbours(const string& object_id); 
-	//@}
-
-	
-	/** @name ChangeStrategies Methods for changing current strategies 
-	*  change current strategies 
-	*/
-	//@{ 
-	//! Set current construction strategy 
-	bool setCurrentConstructionStrategy (TeProxMatrixConstructionStrategy<Set>* sc);  
-	
-	//! Set current weights strategy 
-	bool setCurrentWeightsStrategy (TeProxMatrixWeightsStrategy* sw); 
-	
-	//! Set current slicing strategy 
-	bool setCurrentSlicingStrategy (TeProxMatrixSlicingStrategy* ss); 
-
-	//! Get current construction params 
-	TeProxMatrixConstructionParams* getConstructionParams() 
-	{	
-		if(sc_)
-			return &(sc_->constructionParams()); 
-		return 0;
-	} 
-	
-	//! Get current weights params 
-	TeProxMatrixWeightsParams* getWeightsParams() 
-	{ 
-		if(sw_)
-			return &(sw_->weightsParams()); 
-		return 0;
-	}  
-	
-	//! Get current slicing params 
-	TeProxMatrixSlicingParams* getSlicingParams() 
-	{ 
-		if(ss_)
-            return &(ss_->slicingParams()); 
-		return 0;
-	} 
-	//@}
-	
-
-	//! Reconstruct matrix and recompute weights and slicing, accornding to current strategies.
-	bool constructMatrix ();
-
-	//! Recomputes the weigths, given a new strategy. The matrix is not reconstructed.
-	bool recomputeWeights ();
-
-	//! Sets the slicing strategy for neighbours selection.
-	bool recomputeSlicing ();
-
-	//! Verify if two objects are connected
-	bool isConnected (const string& object_id1, const string& object_id2); 
-
-	//! Connect two objects
-	bool connectObjects (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr); 
-	
-	//! Connect two objects
-	bool connectObjects (const string& object_id1, const string& object_id2);
-
-	//! Disconnect two objects
-	bool disconnectObjects (const string& object_id1, const string& object_id2); 
-
-	//! Remove object
-	bool removeObject (const string& object_id);  
-
-	//! Get connection attributes
-	bool getConnectionAttributes (const string& object_id1, string& object_id2, TeProxMatrixAttributes& attr); 
-
-	//! Return the number of objects
-	int numberOfObjects (); 
-
-	//! Return the number of slices
-	int numerOfSlices () {return total_slices_;}
-
-	//! Save the matrix in a text file
-	bool saveTextFile (const string& name, map<string, string>* ids=0); 
-
-	//! Save the matrix in a text file
-	bool saveGALFile (const string& name, map<string, string>* ids=0); 	
-	
-	//! Save the matrix in a text file
-	bool saveGWTFile (const string& name, map<string, string>* ids=0); 
-
-	//! Save the matrix in a text file
-	bool saveTextFile (const string& name, vector<string>* ids); 
-
-	//! Save the matrix in a text file
-	bool saveGALFile (const string& name, vector<string>* ids); 	
-	
-	//! Save the matrix in a text file
-	bool saveGWTFile (const string& name, vector<string>* ids); 
-
-	//! Destructor
-	virtual ~TeGeneralizedProxMatrix()
-	{
-		if (imp_) 
-			delete imp_; //It is not counted
-	}
-};
-
-//--- template implementations ---
-template<typename Set>
-TeGeneralizedProxMatrix<Set>::TeGeneralizedProxMatrix(TeSTElementSet* objects, TeGeomRep geom_type, const TeGPMImplementation& imp_type)
-{
-	gpm_id_=-1;
-    is_default_=false; 
-	total_slices_=1; 
-	neighbourhood_table_=""; 
-    impl_strategy_=TeGraphBreymann;
-	
-	imp_ = 0;
-	imp_ = getImplementation(imp_type);
-	if ((geom_type==TePOLYGONS) || (geom_type==TeCELLS))
-	{
-		sc_ = new TeProxMatrixLocalAdjacencyStrategy (objects, geom_type);
-		ss_ = new TeProxMatrixNoSlicingStrategy;
-		sw_ = new TeProxMatrixNoWeightsStrategy;
-	}
-	else
-	{
-		imp_ = 0;
-		sc_ = 0;
-		ss_ = 0;
-		sw_ = 0;
-	}
-}
-
-template<typename Set>
-TeGeneralizedProxMatrix<Set>::TeGeneralizedProxMatrix (TeProxMatrixConstructionStrategy<Set>* sc,  TeProxMatrixWeightsStrategy* sw, 
-		TeProxMatrixSlicingStrategy* ss, const TeGPMImplementation& type, 
-		const int& gpmId, const bool& isDefault,  const string& neigsTable, const int& slices):
-	sc_(sc),
-	ss_(ss),
-	sw_(sw),
-	gpm_id_(gpmId), 
-	is_default_(isDefault),
-	total_slices_(slices),
-	neighbourhood_table_(neigsTable),
-	impl_strategy_(type)
-	
-{
-	
-	imp_ = 0;
-	imp_ = getImplementation(type);
-	
-	if(!ss)
-		ss_ = new TeProxMatrixNoSlicingStrategy();
-
-	if(!sw)
-		sw_ = new TeProxMatrixNoWeightsStrategy();
-}
-
-
-template<typename Set> bool
-TeGeneralizedProxMatrix<Set>::isValid () const
-{
-	if ((imp_) && (sc_) && (ss_) && (sw_))
-		return true;
-
-	return false;
-}
-
-
-template<typename Set> TeProxMatrixImplementation*
-TeGeneralizedProxMatrix<Set>::getImplementation (const TeGPMImplementation& type)
-{
-	 if (imp_ == 0) 
-		imp_ = TeProxMatrixAbstractFactory::MakeConcreteImplementation (type); 
-    return imp_;
-}
-
-
-
-template<typename Set>
-TeGeneralizedProxMatrix<Set>::TeGeneralizedProxMatrix(const TeGeneralizedProxMatrix<Set>& pm)
-{
-	if (pm.imp_ == 0)
-		imp_ = 0;
-	else 
-		imp_ = pm.imp_->createCopy ();
-
-	sc_ = pm.sc_;
-	ss_ = pm.ss_;
-	sw_ = pm.sw_;
-
-	gpm_id_=pm.gpm_id_;	
-	is_default_=pm.is_default_;
-	total_slices_=pm.total_slices_;
-	neighbourhood_table_=pm.neighbourhood_table_;
-	impl_strategy_=pm.impl_strategy_;
-}
-
-
-template<typename Set> TeGeneralizedProxMatrix<Set>& 
-TeGeneralizedProxMatrix<Set>::operator=(const TeGeneralizedProxMatrix<Set>& pm) 
-{
-	if (*this == pm) return *this;
-
-	if (imp_) delete imp_;
-	imp_ = 0;
-	if (pm.imp_)	imp_ = pm.imp_->createCopy ();
-
-	sc_ = pm.sc_;
-	ss_ = pm.ss_;
-	sw_ = pm.sw_;
-	gpm_id_=pm.gpm_id_;	
-	is_default_=pm.is_default_;
-	total_slices_=pm.total_slices_;
-	neighbourhood_table_=pm.neighbourhood_table_;
-	impl_strategy_=pm.impl_strategy_;
-
-	return *this;
-
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::operator==(const TeGeneralizedProxMatrix<Set>& pm) const
-{
-	if (isValid() && pm.isValid()) 
-	{	
-		if ((sc_->IsEqual (*(pm.sc_))) &&
-			(ss_->operator==(*(pm.ss_))) &&
-			(sw_->operator==(*(pm.sw_))) &&
-			(total_slices_ == pm.total_slices_) &&
-			(imp_->isEqual(*(pm.imp_)))) 
-			return true;
-	} 
-	else 	
-		if (!isValid() && !pm.isValid()) 
-			return true;
-	return false;
-}
-
-template<typename Set> TeNeighbours
-TeGeneralizedProxMatrix<Set>:: getNeighbours (const string& object_id, int slice) 
-{
-	TeNeighbours neigh2;
-	if (slice > total_slices_) 
-		return neigh2;
-
-	if (imp_) 
-	{
-		TeNeighbours neigh1;
-		imp_->getNeighbours (object_id, neigh1);
-		for (int i=0; i < neigh1.size(); i++) 
-			if (neigh1.Attributes(i).Slice() == slice) 
-				neigh2.Insert (neigh1.ObjectId(i), neigh1.Attributes(i));
-	}
-
-	return neigh2;
-}
-
-
-template<typename Set> TeNeighbours 
-TeGeneralizedProxMatrix<Set>::operator[](const string& object_id) 
-{
-	return getNeighbours(object_id);
-}
-
-
-template<typename Set> TeNeighboursMap
-TeGeneralizedProxMatrix<Set>::getMapNeighbours (const string& object_id, int slice) 
-{
-	TeNeighboursMap neighMap;
-	if (slice > total_slices_) 
-		return neighMap;
-
-	if (imp_) 
-	{
-		TeNeighbours neigh;
-		imp_->getNeighbours (object_id, neigh);
-
-		for (int i=0; i < neigh.size(); i++) 
-			if (neigh.Attributes(i).Slice() == slice) 
-				neighMap[neigh.ObjectId(i)] = neigh.Attributes(i);
-	}
-
-	return neighMap;
-}
-
-
-template<typename Set> TeSTElementSet 
-TeGeneralizedProxMatrix<Set>::getSTENeighbours(const string& object_id)
-{
-	TeSTElementSet selected_objects;
-	if (imp_ && sc_) 
-	{
-		TeNeighbours neigh;
-		imp_->getNeighbours (object_id, neigh);
-		
-		for (int i = 0; i < neigh.size(); i++) 
-		{
-			// Construct a sto instance with its attributes
-			TeSTInstance obj;
-			obj.objectId(neigh.ObjectId(i));  
-			
-			//load the attributes
-			TePropertyVector propVector;
-			sc_->objects()->getPropertyVector(object_id, propVector);
-			obj.properties(propVector);
-				
-			// insert object in the return vector
-			selected_objects.insertSTInstance(obj);
-		}
-	}
-	return selected_objects;
-}
-
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::setCurrentConstructionStrategy (TeProxMatrixConstructionStrategy<Set>* sc)  
-{	
-	if (sc == 0) 
-		return false; 
-	sc_ = sc; 
-	return true;
-}
-
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::setCurrentWeightsStrategy (TeProxMatrixWeightsStrategy* sw) 
-{	
-	if (sw == 0) 
-		return false; 
-	sw_ = sw; 
-	return true;
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::setCurrentSlicingStrategy (TeProxMatrixSlicingStrategy* ss) 
-{
-	if (ss == 0) 
-		return false; 
-	ss_ = ss; 
-	return true;
-}
-
-template<typename Set> bool
-TeGeneralizedProxMatrix<Set>::constructMatrix ()
-{
-	if(!isValid())
-		return false;
-
-	//	ClearImplementation();
-	imp_ = 0;
-	imp_ = getImplementation();
-
-	if (sc_) 
-	{
-		if (sc_->Construct (imp_)) 
-		{
-			if (ss_) 
-				ss_->Slice (imp_);
-			if (sw_) 
-				sw_->ComputeWeigths (imp_); 
-			return true;
-		} 
-	}
-	imp_ = 0;
-	sc_ = 0;
-	ss_ = 0;
-	sw_ = 0;
-	return false;
-}
-
-
-template<typename Set> bool
-TeGeneralizedProxMatrix<Set>::clearImplementation ()
-{
-	TeProxMatrixImplementation* aux;
-	if (imp_ == 0)  
-		aux = getImplementation ();
-	else	
-		aux = getImplementation (imp_->type());
-
-	if (aux == 0) 
-		return false;
-	
-	delete imp_;
-	imp_ = aux;
-
-	return true;
-}
-
-template<typename Set> bool
-TeGeneralizedProxMatrix<Set>::recomputeWeights ()
-{
-	if (isValid()){
-		sw_->ComputeWeigths (imp_); return true;
-	} 
-	return false;
-}
-
-
-template<typename Set> bool
-TeGeneralizedProxMatrix<Set>::recomputeSlicing ()
-{
-	if (isValid()){
-		ss_->Slice (imp_); return true;
-	} 
-	return false;
-}
-
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::isConnected (const string& object_id1, const string& object_id2) 
-{
-	if (imp_ == 0) 
-		return false;  
-	return imp_->isConnected (object_id1, object_id2);
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::connectObjects (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr)
-{
-	if (!imp_) 
-		getImplementation();  
-	imp_->connectObjects (object_id1, object_id2, attr);
-	return true;
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::connectObjects (const string& object_id1, const string& object_id2)
-{
-	if (!imp_) 
-		getImplementation();  
-	TeProxMatrixAttributes attr;
-	imp_->connectObjects (object_id1, object_id2, attr);
-	return true;
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::disconnectObjects (const string& object_id1, const string& object_id2)
-{
-	if (imp_ == 0) 
-		return false;  
-	return imp_->disconnectObjects (object_id1, object_id2);
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::removeObject (const string& object_id)
-{
-	if (imp_ == 0) 
-		return false;  
-	return imp_->removeObject (object_id);
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::getConnectionAttributes (const string& object_id1, string& object_id2, TeProxMatrixAttributes& attr)
-{
-	if (imp_ == 0) 
-		return false;
-	return imp_->getConnectionAttributes (object_id1, object_id2, attr); 
-}
-
-template<typename Set> int  
-TeGeneralizedProxMatrix<Set>::numberOfObjects () 
-{
-	if (imp_ == 0) 
-		return 0;  
-	return imp_->numberOfObjects ();
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::saveTextFile (const string& name, map<string, string>* ids) 
-{	
-	if (imp_ == 0) 
-		return false;
-	return imp_->saveTextFile (name, ids); 
-}
-
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::saveGALFile (const string& name, map<string, string>* ids) 
-{	
-	if (imp_ == 0) 
-		return false;
-	return imp_->saveGALFile (name, ids); 
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::saveGWTFile (const string& name, map<string, string>* ids) 
-{	
-	if (imp_ == 0) 
-		return false;
-	return imp_->saveGWTFile (name, ids); 
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::saveTextFile (const string& name, vector<string>* ids) 
-{	
-	if (imp_ == 0) 
-		return false;
-	return imp_->saveTextFile (name, ids); 
-}
-
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::saveGALFile (const string& name, vector<string>* ids) 
-{	
-	if (imp_ == 0) 
-		return false;
-	return imp_->saveGALFile (name, ids); 
-}
-
-template<typename Set> bool 
-TeGeneralizedProxMatrix<Set>::saveGWTFile (const string& name, vector<string>* ids) 
-{	
-	if (imp_ == 0) 
-		return false;
-	return imp_->saveGWTFile (name, ids); 
-}
-
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGeneralizedProxMatrix.h
+	\brief This file contains structures and definitions about generalized proximity matrices support in TerraLib
+*/
+
+#ifndef TeProxMatrix_H
+#define TeProxMatrix_H
+
+#include "TeNeighbours.h"
+#include "TeProxMatrixImplementation.h"
+#include "TeProxMatrixConstructionStrategy.h"
+#include "TeProxMatrixSlicingStrategy.h"
+#include "TeProxMatrixWeightsStrategy.h"
+#include "TeSTElementSet.h"
+
+
+//! A class to represent a generalized proximity matrix 
+template<typename Set> 
+class TeGeneralizedProxMatrix  
+{
+private:
+	TeProxMatrixImplementation*	imp_;  
+	TeProxMatrixConstructionStrategy<Set>* sc_;   
+	TeProxMatrixSlicingStrategy* ss_;   
+	TeProxMatrixWeightsStrategy* sw_;  
+	
+protected:
+	//! Get the implementation from a concrete factory defined by impl_type
+	TeProxMatrixImplementation*				getImplementation(const TeGPMImplementation& implementation_type = TeGraphBreymann);
+
+	//! Verify if a matrix was created correctly by the constructors.	
+	bool isValid() const;
+	
+public:
+	int						gpm_id_;	
+	bool					is_default_;
+	int						total_slices_;
+	string					neighbourhood_table_;
+	TeGPMImplementation		impl_strategy_;
+
+	//! Empty constructor
+	TeGeneralizedProxMatrix ():
+		imp_(0), sc_(0), ss_(0), sw_(0), gpm_id_(-1),
+		is_default_(false), total_slices_(1), neighbourhood_table_(""), 
+		impl_strategy_(TeGraphBreymann)
+	  {}
+
+  //! Constructor
+	TeGeneralizedProxMatrix (const int& id, const string& tableName, TeProxMatrixImplementation* imp, TeProxMatrixWeightsStrategy* ws):
+		imp_(imp), sc_(0), ss_(0), sw_(ws),
+		gpm_id_(id), is_default_(false), total_slices_(1), 
+		neighbourhood_table_(tableName), impl_strategy_(TeGraphBreymann)
+	  {}
+
+	//! Constructor parametrized with specific strategies. Each stragegy must be previously created and correctly parametrized.
+	TeGeneralizedProxMatrix (TeProxMatrixConstructionStrategy<Set>* sc,  TeProxMatrixWeightsStrategy* sw = 0, 
+		TeProxMatrixSlicingStrategy* ss = 0, const TeGPMImplementation& type = TeGraphBreymann, 
+		const int& gpmId=-1, const bool& isDefault=false,  const string& neigsTable ="", const int& slices=1);
+
+	//! Constructor based on default strategies: (a) Local adjacency of first order; (b) No siling;  and (c)  No weighs (all equal to 1).
+	TeGeneralizedProxMatrix(TeSTElementSet* objects, TeGeomRep geom_type, const TeGPMImplementation& type = TeGraphBreymann);
+
+	//! Copy constructor
+	TeGeneralizedProxMatrix(const TeGeneralizedProxMatrix& p);
+
+	//! Attribution Operator 
+	TeGeneralizedProxMatrix& operator=(const TeGeneralizedProxMatrix& p);
+
+	bool clearImplementation ();
+
+	//! Comparison Operator
+	bool operator==(const TeGeneralizedProxMatrix& p) const;
+	
+	
+	/** @name getNeighbours Methods for return the neighbours
+	*  All methods return the  neighbours of a given object in a given slice. The default is the first slice.
+	*  Slices are defined according to the Slicing Strategy in use (e.g., according to distance zones, corresponding to neighbourhood orders, weights intervals, etc.). 
+	*  If the parameter slice is not provided, the first slice is returned.
+	*  The operator[] method should preferably be used 
+	*  For each object, all the connection attributes are stored as properties (weight is the first).
+	*/
+	//@{ 
+	//! Return the neighbours of an object in a slice, packed in a TeNeighbours 
+	TeNeighbours getNeighbours (const string& object_id, int slice = 1);
+
+	//! Return the neighbours of an object in a slice, packed in a TeNeighboursMap
+	TeNeighboursMap	getMapNeighbours (const string& object_id, int slice = 1);
+	
+	//! Operator [], return the neighbours packed in a TeNeighbours
+	TeNeighbours operator[] (const string& object_id); 
+
+	//! Return the neighbours of an object and their attributes in a spatial temporal element set (TeSTElementSet)
+	TeSTElementSet getSTENeighbours(const string& object_id); 
+	//@}
+
+	
+	/** @name ChangeStrategies Methods for changing current strategies 
+	*  change current strategies 
+	*/
+	//@{ 
+	//! Set current construction strategy 
+	bool setCurrentConstructionStrategy (TeProxMatrixConstructionStrategy<Set>* sc);  
+	
+	//! Set current weights strategy 
+	bool setCurrentWeightsStrategy (TeProxMatrixWeightsStrategy* sw); 
+	
+	//! Set current slicing strategy 
+	bool setCurrentSlicingStrategy (TeProxMatrixSlicingStrategy* ss); 
+
+	//! Get current construction params 
+	TeProxMatrixConstructionParams* getConstructionParams() 
+	{	
+		if(sc_)
+			return &(sc_->constructionParams()); 
+		return 0;
+	} 
+	
+	//! Get current weights params 
+	TeProxMatrixWeightsParams* getWeightsParams() 
+	{ 
+		if(sw_)
+			return &(sw_->weightsParams()); 
+		return 0;
+	}  
+	
+	//! Get current slicing params 
+	TeProxMatrixSlicingParams* getSlicingParams() 
+	{ 
+		if(ss_)
+            return &(ss_->slicingParams()); 
+		return 0;
+	} 
+	//@}
+	
+
+	//! Reconstruct matrix and recompute weights and slicing, accornding to current strategies.
+	bool constructMatrix ();
+
+	//! Recomputes the weigths, given a new strategy. The matrix is not reconstructed.
+	bool recomputeWeights ();
+
+	//! Sets the slicing strategy for neighbours selection.
+	bool recomputeSlicing ();
+
+	//! Verify if two objects are connected
+	bool isConnected (const string& object_id1, const string& object_id2); 
+
+	//! Connect two objects
+	bool connectObjects (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr); 
+	
+	//! Connect two objects
+	bool connectObjects (const string& object_id1, const string& object_id2);
+
+	//! Disconnect two objects
+	bool disconnectObjects (const string& object_id1, const string& object_id2); 
+
+	//! Remove object
+	bool removeObject (const string& object_id);  
+
+	//! Get connection attributes
+	bool getConnectionAttributes (const string& object_id1, string& object_id2, TeProxMatrixAttributes& attr); 
+
+	//! Return the number of objects
+	int numberOfObjects (); 
+
+	//! Return the number of slices
+	int numerOfSlices () {return total_slices_;}
+
+	//! Save the matrix in a text file
+	bool saveTextFile (const string& name, map<string, string>* ids=0); 
+
+	//! Save the matrix in a text file
+	bool saveGALFile (const string& name, map<string, string>* ids=0); 	
+	
+	//! Save the matrix in a text file
+	bool saveGWTFile (const string& name, map<string, string>* ids=0); 
+
+	//! Save the matrix in a text file
+	bool saveTextFile (const string& name, vector<string>* ids); 
+
+	//! Save the matrix in a text file
+	bool saveGALFile (const string& name, vector<string>* ids); 	
+	
+	//! Save the matrix in a text file
+	bool saveGWTFile (const string& name, vector<string>* ids); 
+
+	//! Destructor
+	virtual ~TeGeneralizedProxMatrix()
+	{
+		if (imp_) 
+			delete imp_; //It is not counted
+	}
+};
+
+//--- template implementations ---
+template<typename Set>
+TeGeneralizedProxMatrix<Set>::TeGeneralizedProxMatrix(TeSTElementSet* objects, TeGeomRep geom_type, const TeGPMImplementation& imp_type)
+{
+	gpm_id_=-1;
+    is_default_=false; 
+	total_slices_=1; 
+	neighbourhood_table_=""; 
+    impl_strategy_=TeGraphBreymann;
+	
+	imp_ = 0;
+	imp_ = getImplementation(imp_type);
+	if ((geom_type==TePOLYGONS) || (geom_type==TeCELLS))
+	{
+		sc_ = new TeProxMatrixLocalAdjacencyStrategy (objects, geom_type);
+		ss_ = new TeProxMatrixNoSlicingStrategy;
+		sw_ = new TeProxMatrixNoWeightsStrategy;
+	}
+	else
+	{
+		imp_ = 0;
+		sc_ = 0;
+		ss_ = 0;
+		sw_ = 0;
+	}
+}
+
+template<typename Set>
+TeGeneralizedProxMatrix<Set>::TeGeneralizedProxMatrix (TeProxMatrixConstructionStrategy<Set>* sc,  TeProxMatrixWeightsStrategy* sw, 
+		TeProxMatrixSlicingStrategy* ss, const TeGPMImplementation& type, 
+		const int& gpmId, const bool& isDefault,  const string& neigsTable, const int& slices):
+	sc_(sc),
+	ss_(ss),
+	sw_(sw),
+	gpm_id_(gpmId), 
+	is_default_(isDefault),
+	total_slices_(slices),
+	neighbourhood_table_(neigsTable),
+	impl_strategy_(type)
+	
+{
+	
+	imp_ = 0;
+	imp_ = getImplementation(type);
+	
+	if(!ss)
+		ss_ = new TeProxMatrixNoSlicingStrategy();
+
+	if(!sw)
+		sw_ = new TeProxMatrixNoWeightsStrategy();
+}
+
+
+template<typename Set> bool
+TeGeneralizedProxMatrix<Set>::isValid () const
+{
+	if ((imp_) && (sc_) && (ss_) && (sw_))
+		return true;
+
+	return false;
+}
+
+
+template<typename Set> TeProxMatrixImplementation*
+TeGeneralizedProxMatrix<Set>::getImplementation (const TeGPMImplementation& type)
+{
+	 if (imp_ == 0) 
+		imp_ = TeProxMatrixAbstractFactory::MakeConcreteImplementation (type); 
+    return imp_;
+}
+
+
+
+template<typename Set>
+TeGeneralizedProxMatrix<Set>::TeGeneralizedProxMatrix(const TeGeneralizedProxMatrix<Set>& pm)
+{
+	if (pm.imp_ == 0)
+		imp_ = 0;
+	else 
+		imp_ = pm.imp_->createCopy ();
+
+	sc_ = pm.sc_;
+	ss_ = pm.ss_;
+	sw_ = pm.sw_;
+
+	gpm_id_=pm.gpm_id_;	
+	is_default_=pm.is_default_;
+	total_slices_=pm.total_slices_;
+	neighbourhood_table_=pm.neighbourhood_table_;
+	impl_strategy_=pm.impl_strategy_;
+}
+
+
+template<typename Set> TeGeneralizedProxMatrix<Set>& 
+TeGeneralizedProxMatrix<Set>::operator=(const TeGeneralizedProxMatrix<Set>& pm) 
+{
+	if (*this == pm) return *this;
+
+	if (imp_) delete imp_;
+	imp_ = 0;
+	if (pm.imp_)	imp_ = pm.imp_->createCopy ();
+
+	sc_ = pm.sc_;
+	ss_ = pm.ss_;
+	sw_ = pm.sw_;
+	gpm_id_=pm.gpm_id_;	
+	is_default_=pm.is_default_;
+	total_slices_=pm.total_slices_;
+	neighbourhood_table_=pm.neighbourhood_table_;
+	impl_strategy_=pm.impl_strategy_;
+
+	return *this;
+
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::operator==(const TeGeneralizedProxMatrix<Set>& pm) const
+{
+	if (isValid() && pm.isValid()) 
+	{	
+		if ((sc_->IsEqual (*(pm.sc_))) &&
+			(ss_->operator==(*(pm.ss_))) &&
+			(sw_->operator==(*(pm.sw_))) &&
+			(total_slices_ == pm.total_slices_) &&
+			(imp_->isEqual(*(pm.imp_)))) 
+			return true;
+	} 
+	else 	
+		if (!isValid() && !pm.isValid()) 
+			return true;
+	return false;
+}
+
+template<typename Set> TeNeighbours
+TeGeneralizedProxMatrix<Set>:: getNeighbours (const string& object_id, int slice) 
+{
+	TeNeighbours neigh2;
+	if (slice > total_slices_) 
+		return neigh2;
+
+	if (imp_) 
+	{
+		TeNeighbours neigh1;
+		imp_->getNeighbours (object_id, neigh1);
+		for (int i=0; i < neigh1.size(); i++) 
+			if (neigh1.Attributes(i).Slice() == slice) 
+				neigh2.Insert (neigh1.ObjectId(i), neigh1.Attributes(i));
+	}
+
+	return neigh2;
+}
+
+
+template<typename Set> TeNeighbours 
+TeGeneralizedProxMatrix<Set>::operator[](const string& object_id) 
+{
+	return getNeighbours(object_id);
+}
+
+
+template<typename Set> TeNeighboursMap
+TeGeneralizedProxMatrix<Set>::getMapNeighbours (const string& object_id, int slice) 
+{
+	TeNeighboursMap neighMap;
+	if (slice > total_slices_) 
+		return neighMap;
+
+	if (imp_) 
+	{
+		TeNeighbours neigh;
+		imp_->getNeighbours (object_id, neigh);
+
+		for (int i=0; i < neigh.size(); i++) 
+			if (neigh.Attributes(i).Slice() == slice) 
+				neighMap[neigh.ObjectId(i)] = neigh.Attributes(i);
+	}
+
+	return neighMap;
+}
+
+
+template<typename Set> TeSTElementSet 
+TeGeneralizedProxMatrix<Set>::getSTENeighbours(const string& object_id)
+{
+	TeSTElementSet selected_objects;
+	if (imp_ && sc_) 
+	{
+		TeNeighbours neigh;
+		imp_->getNeighbours (object_id, neigh);
+		
+		for (int i = 0; i < neigh.size(); i++) 
+		{
+			// Construct a sto instance with its attributes
+			TeSTInstance obj;
+			obj.objectId(neigh.ObjectId(i));  
+			
+			//load the attributes
+			TePropertyVector propVector;
+			sc_->objects()->getPropertyVector(object_id, propVector);
+			obj.properties(propVector);
+				
+			// insert object in the return vector
+			selected_objects.insertSTInstance(obj);
+		}
+	}
+	return selected_objects;
+}
+
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::setCurrentConstructionStrategy (TeProxMatrixConstructionStrategy<Set>* sc)  
+{	
+	if (sc == 0) 
+		return false; 
+	sc_ = sc; 
+	return true;
+}
+
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::setCurrentWeightsStrategy (TeProxMatrixWeightsStrategy* sw) 
+{	
+	if (sw == 0) 
+		return false; 
+	sw_ = sw; 
+	return true;
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::setCurrentSlicingStrategy (TeProxMatrixSlicingStrategy* ss) 
+{
+	if (ss == 0) 
+		return false; 
+	ss_ = ss; 
+	return true;
+}
+
+template<typename Set> bool
+TeGeneralizedProxMatrix<Set>::constructMatrix ()
+{
+	if(!isValid())
+		return false;
+
+	//	ClearImplementation();
+	imp_ = 0;
+	imp_ = getImplementation();
+
+	if (sc_) 
+	{
+		if (sc_->Construct (imp_)) 
+		{
+			if (ss_) 
+				ss_->Slice (imp_);
+			if (sw_) 
+				sw_->ComputeWeigths (imp_); 
+			return true;
+		} 
+	}
+	imp_ = 0;
+	sc_ = 0;
+	ss_ = 0;
+	sw_ = 0;
+	return false;
+}
+
+
+template<typename Set> bool
+TeGeneralizedProxMatrix<Set>::clearImplementation ()
+{
+	TeProxMatrixImplementation* aux;
+	if (imp_ == 0)  
+		aux = getImplementation ();
+	else	
+		aux = getImplementation (imp_->type());
+
+	if (aux == 0) 
+		return false;
+	
+	delete imp_;
+	imp_ = aux;
+
+	return true;
+}
+
+template<typename Set> bool
+TeGeneralizedProxMatrix<Set>::recomputeWeights ()
+{
+	if (isValid()){
+		sw_->ComputeWeigths (imp_); return true;
+	} 
+	return false;
+}
+
+
+template<typename Set> bool
+TeGeneralizedProxMatrix<Set>::recomputeSlicing ()
+{
+	if (isValid()){
+		ss_->Slice (imp_); return true;
+	} 
+	return false;
+}
+
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::isConnected (const string& object_id1, const string& object_id2) 
+{
+	if (imp_ == 0) 
+		return false;  
+	return imp_->isConnected (object_id1, object_id2);
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::connectObjects (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr)
+{
+	if (!imp_) 
+		getImplementation();  
+	imp_->connectObjects (object_id1, object_id2, attr);
+	return true;
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::connectObjects (const string& object_id1, const string& object_id2)
+{
+	if (!imp_) 
+		getImplementation();  
+	TeProxMatrixAttributes attr;
+	imp_->connectObjects (object_id1, object_id2, attr);
+	return true;
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::disconnectObjects (const string& object_id1, const string& object_id2)
+{
+	if (imp_ == 0) 
+		return false;  
+	return imp_->disconnectObjects (object_id1, object_id2);
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::removeObject (const string& object_id)
+{
+	if (imp_ == 0) 
+		return false;  
+	return imp_->removeObject (object_id);
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::getConnectionAttributes (const string& object_id1, string& object_id2, TeProxMatrixAttributes& attr)
+{
+	if (imp_ == 0) 
+		return false;
+	return imp_->getConnectionAttributes (object_id1, object_id2, attr); 
+}
+
+template<typename Set> int  
+TeGeneralizedProxMatrix<Set>::numberOfObjects () 
+{
+	if (imp_ == 0) 
+		return 0;  
+	return imp_->numberOfObjects ();
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::saveTextFile (const string& name, map<string, string>* ids) 
+{	
+	if (imp_ == 0) 
+		return false;
+	return imp_->saveTextFile (name, ids); 
+}
+
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::saveGALFile (const string& name, map<string, string>* ids) 
+{	
+	if (imp_ == 0) 
+		return false;
+	return imp_->saveGALFile (name, ids); 
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::saveGWTFile (const string& name, map<string, string>* ids) 
+{	
+	if (imp_ == 0) 
+		return false;
+	return imp_->saveGWTFile (name, ids); 
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::saveTextFile (const string& name, vector<string>* ids) 
+{	
+	if (imp_ == 0) 
+		return false;
+	return imp_->saveTextFile (name, ids); 
+}
+
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::saveGALFile (const string& name, vector<string>* ids) 
+{	
+	if (imp_ == 0) 
+		return false;
+	return imp_->saveGALFile (name, ids); 
+}
+
+template<typename Set> bool 
+TeGeneralizedProxMatrix<Set>::saveGWTFile (const string& name, vector<string>* ids) 
+{	
+	if (imp_ == 0) 
+		return false;
+	return imp_->saveGWTFile (name, ids); 
+}
+
+
+#endif
diff --git a/src/terralib/kernel/TeGeoDataDriver.h b/src/terralib/kernel/TeGeoDataDriver.h
index a264b71..dff4d3c 100644
--- a/src/terralib/kernel/TeGeoDataDriver.h
+++ b/src/terralib/kernel/TeGeoDataDriver.h
@@ -1,70 +1,81 @@
-/************************************************************************************
- TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/** \file TeGeoDataDriver.h
-    \brief This file contains contains the abstract definition of a driver to
-	geographical data files with vectorial representation.
-*/
-
-class TeProjection;
-class TeSTElementSet;
-
-#include <TeDataTypes.h>
-
-#include <string>
-
-//! Abstract definition of a driver to	geographical data files with vectorial representation
-class TeGeoDataDriver
-{
-public:
-
-	//! Destructor
-	virtual ~TeGeoDataDriver() {}
-
-	//! Returns the complete access path associated to this driver
-	virtual std::string getFileName() = 0;
-
-	//! Returns true or false whether the data file is accessible
-	virtual bool isDataAccessible() = 0;
-
-	//! Returns the spatial reference associated to the data as an instance of TeProjection 
-	virtual TeProjection* getDataProjection() = 0;
-
-	//! Loads the minimum metadata information about the data
-	/*
-		\param nObjects to return the number of objects accessible in the data set
-		\param ext	to return the spatial extension of the geometries in the data set
-		\param repres to return the type of geometries in the file
-		\return true if or false whether it can retrieve the information or not
-	*/
-	virtual bool getDataInfo(unsigned int& nObjects , TeBox& ext, TeGeomRep& repres) = 0;
-
-	//! Loads the list of descriptive attributes of the objetcts represented in the file
-	virtual bool getDataAttributesList(TeAttributeList& attList) = 0;
-
-	//! Loads the data into an TeSTElementSet structure in memory
-	/*
-		\param dataSet to return data set
-		\return true if or false whether it can retrieve the information or not
-	*/
-	virtual bool loadData(TeSTElementSet* dataSet) = 0;
-};
+/************************************************************************************
+ TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/** \file TeGeoDataDriver.h
+    \brief This file contains contains the abstract definition of a driver to
+	geographical data files with vectorial representation.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_GEODATADRIVER_H
+#define  __TERRALIB_INTERNAL_GEODATADRIVER_H
+
+class TeProjection;
+class TeSTElementSet;
+
+#include <TeDataTypes.h>
+#include <TeAttribute.h>
+#include <TeBox.h>
+
+#include "TeDefines.h"
+
+#include <string>
+
+//! Abstract definition of a driver to	geographical data files with vectorial representation
+class TL_DLL TeGeoDataDriver
+{
+public:
+
+	//! Destructor
+	virtual ~TeGeoDataDriver() {}
+
+	//! Returns the complete access path associated to this driver
+	virtual std::string getFileName() = 0;
+
+	//! Returns true or false whether the data file is accessible
+	virtual bool isDataAccessible() = 0;
+
+	//! Returns the spatial reference associated to the data as an instance of TeProjection 
+	virtual TeProjection* getDataProjection() = 0;
+
+	//! Loads the minimum metadata information about the data
+	/*
+		\param nObjects to return the number of objects accessible in the data set
+		\param ext	to return the spatial extension of the geometries in the data set
+		\param repres to return the type of geometries in the file
+		\return true if or false whether it can retrieve the information or not
+	*/
+	virtual bool getDataInfo(unsigned int& nObjects , TeBox& ext, TeGeomRep& repres) = 0;
+
+	//! Loads the list of descriptive attributes of the objetcts represented in the file
+	virtual bool getDataAttributesList(TeAttributeList& attList) = 0;
+
+	//! Loads the data into an TeSTElementSet structure in memory
+	/*
+		\param dataSet to return data set
+		\return true if or false whether it can retrieve the information or not
+	*/
+	virtual bool loadData(TeSTElementSet* dataSet) = 0;
+
+	static TeGeoDataDriver*	DefaultObject() { return NULL; }
+};
+
+#endif //__TERRALIB_INTERNAL_GEODATADRIVER_H
diff --git a/src/terralib/kernel/TeGeometricTransformation.cpp b/src/terralib/kernel/TeGeometricTransformation.cpp
old mode 100755
new mode 100644
index 84aaedc..5cbb86d
--- a/src/terralib/kernel/TeGeometricTransformation.cpp
+++ b/src/terralib/kernel/TeGeometricTransformation.cpp
@@ -1,1217 +1,1813 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#include "TeGeometricTransformation.h"
-#include "TeMutex.h"
-#include "TeThreadFunctor.h"
-#include "TeUtils.h"
-#include "TeAgnostic.h"
-
-#include <math.h>
-#include <float.h>
-
-#include <map>
-#include <algorithm>
-
-
-TeGeometricTransformation::TeGeometricTransformation()
-{
-}
-
-
-TeGeometricTransformation::~TeGeometricTransformation()
-{
-}
-
-
-void TeGeometricTransformation::getParameters( TeGTParams& params ) const
-{
-  params = internal_params_;
-}
-
-
-bool TeGeometricTransformation::reset( const TeGTParams& newparams )
-{
-  /* If previous calculated parameters were supplied, no need to do calcules */
-
-  if( isTransDefined( newparams ) ) 
-  {
-    internal_params_ = newparams;
-    return true;
-  } else {
-    /* No previous parameters given - Need to calculate the new transformation
-       parameters */
-       
-    TEAGN_TRUE_OR_THROW( ( newparams.max_dmap_error_ >= 0 ),
-      "Invalid maximum allowed direct mapping error" );
-    TEAGN_TRUE_OR_THROW( ( newparams.max_imap_error_ >= 0 ),
-      "Invalid maximum allowed inverse mapping error" );
-       
-    const unsigned int req_tie_pts_nmb = getMinRequiredTiePoints();
-
-    if( newparams.tiepoints_.size() < req_tie_pts_nmb ) {
-      return false;
-    } else {
-      internal_params_ = newparams;
-      
-      switch( newparams.out_rem_strat_ ) {
-        case TeGTParams::NoOutRemotion :
-        {
-          if( computeParameters( internal_params_ ) ) {
-            
-            if( ( newparams.max_dmap_error_ >= 
-              getDirectMappingError( internal_params_ ) ) &&
-              ( newparams.max_imap_error_ >= 
-              getInverseMappingError( internal_params_ ) ) ) {
-              
-              return true;
-            }
-          }   
-        
-          break;
-        }
-        case TeGTParams::ExaustiveOutRemotion :
-        {
-          if( internal_params_.enable_multi_thread_ ) {
-            if( exaustiveOutRemotion( internal_params_,
-              TeGetPhysProcNumber() - 1 ) ) {
-              
-              return true;
-            }          
-          } else {
-            if( exaustiveOutRemotion( internal_params_, 0 ) ) {
-              return true;
-            }
-          }
-        
-          break;
-        }
-        case TeGTParams::LWAOutRemotion :
-        {
-          if( LWAOutRemotion( internal_params_ ) ) {
-            return true;
-          }
-                  
-          break;
-        }        
-        default : 
-        {
-          TEAGN_LOG_AND_THROW( 
-            "Invalid outliers remotion strategy" )
-          break;
-        }
-      
-      }
-    }
-  }
-  
-  internal_params_.reset();
-  
-  return false;
-}
-
-
-double TeGeometricTransformation::getDirectMappingError(  
-  const TeGTParams& params ) const
-{
-  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
-    "Transformation not defined" )   
-    
-  unsigned int tiepoints_size = params.tiepoints_.size();
-  
-  double max_error = 0;
-  double current_error = 0;
-  
-  for( unsigned int tpindex = 0 ; tpindex < tiepoints_size ; ++tpindex ) {
-    current_error = getDirectMappingError( params.tiepoints_[ tpindex ], 
-      params );
-    
-    if( current_error > max_error ) {
-      max_error = current_error;
-    }
-  }
-  
-  return max_error;
-}
-
-
-double TeGeometricTransformation::getInverseMappingError(  
-  const TeGTParams& params ) const
-{
-  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
-    "Transformation not defined" )  
-    
-  unsigned int tiepoints_size = params.tiepoints_.size();
-  
-  double max_error = 0;
-  double current_error = 0;
-  
-  for( unsigned int tpindex = 0 ; tpindex < tiepoints_size ; ++tpindex ) {
-    current_error = getInverseMappingError( params.tiepoints_[ tpindex ], 
-      params );
-    
-    if( current_error > max_error ) {
-      max_error = current_error;
-    }
-  }
-  
-  return max_error;
-}
-
-
-double TeGeometricTransformation::getDMapRMSE(  
-  const TeGTParams& params ) const
-{
-  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
-    "Transformation not defined" )   
-    
-  unsigned int tiepoints_size = params.tiepoints_.size();
-  
-  if( tiepoints_size == 0 )
-  {
-    return 0;
-  }
-  else
-  {
-    double error2_sum = 0;
-    double current_error = 0;
-    
-    for( unsigned int tpindex = 0 ; tpindex < tiepoints_size ; ++tpindex ) {
-      current_error = getDirectMappingError( params.tiepoints_[ tpindex ], 
-        params );
-        
-      error2_sum += ( current_error * current_error );
-    }
-    
-    return sqrt( error2_sum / ( (double)tiepoints_size ) );
-  }
-}
-
-
-double TeGeometricTransformation::getIMapRMSE(  
-  const TeGTParams& params ) const
-{
-  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
-    "Transformation not defined" )   
-    
-  unsigned int tiepoints_size = params.tiepoints_.size();
-  
-  if( tiepoints_size == 0 )
-  {
-    return 0;
-  }
-  else
-  {
-    double error2_sum = 0;
-    double current_error = 0;
-    
-    for( unsigned int tpindex = 0 ; tpindex < tiepoints_size ; ++tpindex ) {
-      current_error = getInverseMappingError( params.tiepoints_[ tpindex ], 
-        params );
-        
-      error2_sum += ( current_error * current_error );
-    }
-    
-    return sqrt( error2_sum / ( (double)tiepoints_size ) );
-  }  
-}
-
-
-double TeGeometricTransformation::getDirectMappingError( 
-  const TeCoordPair& tie_point, const TeGTParams& params ) const
-{
-  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
-    "Transformation not defined" )   
-    
-  TeCoord2D direct_mapped_point;
-
-  directMap( params, tie_point.pt1, direct_mapped_point );
-    
-  double diff_x = tie_point.pt2.x() - direct_mapped_point.x();
-  double diff_y = tie_point.pt2.y() - direct_mapped_point.y();
-    
-  return hypot( diff_x, diff_y );
-}
-
-
-double TeGeometricTransformation::getInverseMappingError( 
-  const TeCoordPair& tie_point, const TeGTParams& params ) const
-{
-  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
-    "Transformation not defined" )   
-    
-  TeCoord2D inverse_mapped_point;
-
-  inverseMap( params, tie_point.pt2, inverse_mapped_point );
-    
-  double diff_x = tie_point.pt1.x() - inverse_mapped_point.x();
-  double diff_y = tie_point.pt1.y() - inverse_mapped_point.y();
-    
-  return hypot( diff_x, diff_y );
-}
-
-
-bool TeGeometricTransformation::recombineSeed( std::vector<unsigned int>& seed, 
-  const unsigned int& seedpos, const unsigned int& elements_nmb )
-{
-  unsigned int seed_size = seed.size();
-  
-  if( seedpos >= seed_size ) {
-    return false;
-  }
-
-  if( seed[ seedpos ]  >= ( elements_nmb - seed_size + seedpos + 1 ) ) {
-    if( seedpos == seed_size - 1 ) {
-      return false;
-    } else if( seedpos == 0 ) {
-      return recombineSeed( seed, seedpos + 1, elements_nmb ) ;
-    } else {
-      return recombineSeed( seed, seedpos + 1, elements_nmb ) ;
-    };
-  } else if( seed[ seedpos ]  == 0 ) {
-    if( seedpos == 0 ) {
-      seed[ seedpos ] = 1 ;
-      return recombineSeed( seed, seedpos + 1, elements_nmb );
-    } else if( seedpos == seed_size - 1 ) {
-      seed[ seedpos ] = seed[ seedpos - 1 ] + 1;
-      return true;
-    } else {
-      seed[ seedpos ] = seed[ seedpos - 1 ] + 1;
-      seed[ seedpos + 1 ] = 0;
-      return recombineSeed( seed, seedpos + 1, elements_nmb );
-    }
-  } else {
-    if( seedpos == seed_size - 1 ) {
-      seed[ seedpos ] = seed[ seedpos ] + 1;
-      return true;
-    } else if( seedpos == 0 ) {
-      if( recombineSeed( seed, seedpos + 1, elements_nmb ) ) {
-        return true;
-      } else {
-        seed[ seedpos ] = seed[ seedpos ] + 1;
-        seed[ seedpos + 1 ] = 0;
-        return recombineSeed( seed, seedpos + 1, elements_nmb );
-      }
-    } else {
-      if( recombineSeed( seed, seedpos + 1, elements_nmb ) ) {
-        return true;
-      } else {
-        seed[ seedpos ] = seed[ seedpos ] + 1;
-        seed[ seedpos + 1 ] = 0;
-        return recombineSeed( seed, seedpos + 1, elements_nmb );
-      }
-    }
-  }
-}
-
-
-TeGeometricTransformation* TeGeometricTransformation::DefaultObject( 
-  const TeGTParams& )
-{ 
-  TEAGN_LOG_AND_THROW( "Trying to create an invalid "
-    "TeGemetricTransformation instance" );
-  
-  return 0;
-}; 
-
-
-bool TeGeometricTransformation::exaustiveOutRemotion( 
-  TeGTParams& params, unsigned int threads_nmb )
-{
-  TEAGN_DEBUG_CONDITION( ( params.out_rem_strat_ == 
-    TeGTParams::ExaustiveOutRemotion ), 
-    "Inconsistent outliers remotion strategy" )
-
-  /* Initiating seed */
-  
-  std::vector<unsigned int> comb_seed_vec;       
-    
-  unsigned int req_tie_pts_nmb = getMinRequiredTiePoints();
-  
-  for( unsigned int comb_seed_vec_index = 0 ; 
-    comb_seed_vec_index < req_tie_pts_nmb ;
-    ++comb_seed_vec_index ) {
-    
-    comb_seed_vec.push_back( 0 );
-  }
-  
-  /* initializing mutexes */
-  
-  TeMutex comb_seed_vec_mutex;
-  TeMutex trans_params_mutex;
-  
-  /* Initializing threads */
-  
-  TeGTParams best_trans_params;
-  double best_trans_dmap_error = DBL_MAX;
-  double best_trans_imap_error = DBL_MAX;
-  
-  std::vector< TeThreadFunctor::pointer > threads_vector;
-  
-  TeThreadParameters thread_params;
-  
-  thread_params.store( "req_tie_pts_nmb", req_tie_pts_nmb );  
-  thread_params.store( "init_trans_params_ptr", 
-    (TeGTParams const*)(&params) );
-  thread_params.store( "best_trans_params_ptr", 
-    &best_trans_params );    
-  thread_params.store( "best_trans_dmap_error_ptr", 
-    &best_trans_dmap_error );      
-  thread_params.store( "best_trans_imap_error_ptr", 
-    &best_trans_imap_error );     
-  thread_params.store( "comb_seed_vec_ptr", &comb_seed_vec );
-  thread_params.store( "trans_params_mutex_ptr", 
-    &trans_params_mutex );
-  thread_params.store( "comb_seed_vec_mutex_ptr", 
-    &comb_seed_vec_mutex );  
-  thread_params.store( "geo_trans_ptr", 
-    (TeGeometricTransformation const*)this );        
-    
-  unsigned int thread_index = 0;
-  
-  for( thread_index = 0 ; thread_index < threads_nmb ; 
-    ++thread_index ) {
-    
-    TeThreadFunctor::pointer aux_thread_ptr( 
-      new TeThreadFunctor );
-    aux_thread_ptr->setStartFunctPtr( eORThreadEntry );
-    aux_thread_ptr->setParameters( thread_params );
-    aux_thread_ptr->start();
-  
-    threads_vector.push_back( aux_thread_ptr );
-  }
-  
-  bool my_return = eORThreadEntry( thread_params );
-  bool threads_return = true;
-  
-  for( thread_index = 0 ; thread_index < threads_nmb ; 
-    ++thread_index ) {
-    
-    threads_vector[ thread_index ]->waitToFinish();
-    
-    threads_return = threads_return & 
-      threads_vector[ thread_index ]->getReturnValue();
-  }  
-  
-  if( my_return & threads_return ) {
-    if( best_trans_params.tiepoints_.size() >= req_tie_pts_nmb ) {
-      params = best_trans_params;
-      
-      return true;
-    } else {
-      return false;
-    }
-  } else {
-    return false;
-  }
-}
-
-
-bool TeGeometricTransformation::eORThreadEntry( 
-  const TeThreadParameters& params )
-{
-  /* Extracting parameters */
-  
-  unsigned int req_tie_pts_nmb = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "req_tie_pts_nmb",
-    req_tie_pts_nmb ), "Missing parameter" );
-    
-  TeGTParams const* init_trans_params_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "init_trans_params_ptr",
-    init_trans_params_ptr ), "Missing parameter" );
-  
-  TeGTParams* best_trans_params_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "best_trans_params_ptr",
-    best_trans_params_ptr ), "Missing parameter" );   
-    
-  double* best_trans_dmap_error_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "best_trans_dmap_error_ptr",
-    best_trans_dmap_error_ptr ), "Missing parameter" );     
-    
-  double* best_trans_imap_error_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "best_trans_imap_error_ptr",
-    best_trans_imap_error_ptr ), "Missing parameter" );     
-
-  std::vector<unsigned int>* comb_seed_vec_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "comb_seed_vec_ptr",
-    comb_seed_vec_ptr ), "Missing parameter" );
-    
-  TeMutex* trans_params_mutex_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "trans_params_mutex_ptr",
-    trans_params_mutex_ptr ), "Missing parameter" ); 
-
-  TeMutex* comb_seed_vec_mutex_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "comb_seed_vec_mutex_ptr",
-    comb_seed_vec_mutex_ptr ), "Missing parameter" );  
-    
-  TeGeometricTransformation const* geo_trans_ptr = 0;
-  TEAGN_TRUE_OR_THROW( params.retrive( "geo_trans_ptr",
-    geo_trans_ptr ), "Missing parameter" ); 
-  
-  /* Optimized local variables based on the input parameters */
-  
-  std::vector<unsigned int>& comb_seed_vec =
-    (*comb_seed_vec_ptr);  
-    
-  TeMutex& comb_seed_vec_mutex = (*comb_seed_vec_mutex_ptr); 
-  
-  const TeGeometricTransformation& geo_trans = (*geo_trans_ptr); 
-  
-  /* Copying some parameters to local variables to avoid
-     mutex overhead */
-     
-  trans_params_mutex_ptr->lock();
-     
-  const TeGTParams initial_trans_params = (*init_trans_params_ptr);     
-  const unsigned int initial_tiepoints_size = 
-    initial_trans_params.tiepoints_.size();   
-  
-  trans_params_mutex_ptr->unLock();
-        
-  /* Trying to find the best tie-points by building 
-    the transformation with the highest number of
-    tie-points, but with an acceptable mapping error */
-    
-  TeGTParams local_best_params;
-  double local_best_params_dmap_error = DBL_MAX;
-  double local_best_params_imap_error = DBL_MAX;
-  
-  TeGTParams curr_params = initial_trans_params;
-  double curr_params_dmap_error = DBL_MAX;
-  double curr_params_imap_error = DBL_MAX; 
-  
-  TeGTParams cp_plus_new_point;
-  double cp_plus_new_point_dmap_error = DBL_MAX;
-  double cp_plus_new_point_imap_error = DBL_MAX;
-  
-  unsigned int tiepoints_index = 0;
-  bool point_already_present = false;
-  bool seed_recombined = true;
-  unsigned int comb_seed_vec_index_2 = 0;
-  unsigned int comb_seed_vec_index_3 = 0;
-  
-  while( seed_recombined ) {
-    /* trying to recombine seed */
-    
-    comb_seed_vec_mutex.lock();
-    seed_recombined = recombineSeed( comb_seed_vec, 0, 
-      initial_tiepoints_size );
-    comb_seed_vec_mutex.unLock();
-      
-    if( seed_recombined ) {
-      /* Extracting tie-points from the original vector */
-      
-      curr_params.tiepoints_.clear();
-      
-      for( comb_seed_vec_index_2 = 0 ; 
-        comb_seed_vec_index_2 < req_tie_pts_nmb ;
-        ++comb_seed_vec_index_2 ) {
-        
-        curr_params.tiepoints_.push_back( 
-          initial_trans_params.tiepoints_[ comb_seed_vec[ 
-          comb_seed_vec_index_2 ] - 1 ] );
-      }
-      
-      /* Trying to generate a valid transformation */
-      
-      if( geo_trans.computeParameters( curr_params ) ) {
-        curr_params_dmap_error = geo_trans.getDirectMappingError( 
-          curr_params );
-        curr_params_imap_error = geo_trans.getInverseMappingError( 
-          curr_params );
-      
-        if( ( initial_trans_params.max_dmap_error_ >= 
-          curr_params_dmap_error ) &&
-          ( initial_trans_params.max_imap_error_ >= 
-          curr_params_imap_error ) ) {
-        
-          /* Trying to insert more tie-points into current 
-              transformation */
-          
-          for( tiepoints_index = 0 ; tiepoints_index < 
-            initial_tiepoints_size ; ++tiepoints_index ) {
-            
-            /* Verifying if the current tie-point is already 
-               present */
-            
-            point_already_present = false;
-            
-            for( comb_seed_vec_index_3 = 0 ; 
-              comb_seed_vec_index_3 < req_tie_pts_nmb ;
-              ++comb_seed_vec_index_3 ) {
-            
-              if( tiepoints_index == ( 
-                comb_seed_vec[ comb_seed_vec_index_3 ] - 1 ) ) {
-              
-                point_already_present = true;
-                break;
-              }
-            }
-            
-            if( ! point_already_present ) {
-              cp_plus_new_point = curr_params;
-              
-              cp_plus_new_point.tiepoints_.push_back( 
-                initial_trans_params.tiepoints_[ tiepoints_index ] );
-              
-              /* Verifying if the new tie-point insertion does 
-                not generate an invalid transformation */
-              
-              if( geo_trans.computeParameters( cp_plus_new_point ) ) {
-                cp_plus_new_point_dmap_error =
-                  geo_trans.getDirectMappingError( cp_plus_new_point );
-                cp_plus_new_point_imap_error =
-                  geo_trans.getInverseMappingError( cp_plus_new_point );
-                  
-                if( ( cp_plus_new_point_dmap_error <=
-                  initial_trans_params.max_dmap_error_ ) &&
-                  ( cp_plus_new_point_imap_error <=
-                  initial_trans_params.max_imap_error_ ) ) {
-                  
-                  curr_params = cp_plus_new_point;
-                  curr_params_dmap_error = 
-                    cp_plus_new_point_dmap_error;
-                  curr_params_imap_error =
-                    cp_plus_new_point_imap_error;  
-                }
-              }
-            }
-          }
-          
-          /* A valid transformation was generated, now 
-            verifying 
-            if the number of tie-poits is greater then the current 
-            thread local best transformation.
-          */            
-          
-          if( curr_params.tiepoints_.size() >= 
-            local_best_params.tiepoints_.size() ) {
-            
-            if( ( curr_params_dmap_error < 
-              local_best_params_dmap_error ) &&
-              ( curr_params_imap_error <
-                local_best_params_imap_error ) ) {
-            
-              local_best_params = curr_params;
-              local_best_params_dmap_error = curr_params_dmap_error;
-              local_best_params_imap_error = curr_params_imap_error;
-            }
-          }           
-        }
-      } //if( geo_trans.computeParameters( curr_params ) )
-    } //if( seed_recombined )
-  } //while( seed_recombined )
-  
-  /* A valid local thread transformation was generated, now 
-    verifying 
-    if the error is smaller then the current 
-    global transformation.
-  */
-
-  if( local_best_params.tiepoints_.size() >= req_tie_pts_nmb ) {
-    trans_params_mutex_ptr->lock();
-    
-    if( local_best_params.tiepoints_.size() >=
-      best_trans_params_ptr->tiepoints_.size() ) {
-      
-      if( ( local_best_params_dmap_error < 
-        (*best_trans_dmap_error_ptr) ) &&
-        ( local_best_params_imap_error < 
-        (*best_trans_imap_error_ptr) ) ) {
-      
-        (*best_trans_params_ptr) = local_best_params;
-        (*best_trans_dmap_error_ptr) = local_best_params_dmap_error;
-        (*best_trans_imap_error_ptr) = local_best_params_imap_error;       
-      }      
-    }
-    
-    trans_params_mutex_ptr->unLock();
-  }
-  
-  return true;
-}
-
-
-bool TeGeometricTransformation::LWAOutRemotion( 
-  TeGTParams& external_params )
-{
-  TEAGN_DEBUG_CONDITION( ( external_params.out_rem_strat_ == 
-    TeGTParams::LWAOutRemotion ), 
-    "Inconsistent outliers remotion strategy" )
-    
-  const unsigned int req_tie_pts_nmb = getMinRequiredTiePoints();
-  
-  if( external_params.tiepoints_.size() == req_tie_pts_nmb ) {
-    return computeParameters( external_params );
-  } else if( external_params.tiepoints_.size() > req_tie_pts_nmb ) {
-    /* Global vars */
-    
-    const double max_dmap_error = 
-      external_params.max_dmap_error_;
-    const double max_imap_error = 
-      external_params.max_imap_error_;
-    const double max_dmap_rmse = 
-      external_params.max_dmap_rmse_;
-    const double max_imap_rmse = 
-      external_params.max_imap_rmse_;
-          
-    /* Computing the initial global transformation */
-    
-    if( ! computeParameters( external_params ) ) {
-      return false;
-    }    
-    
-    if( ( getDirectMappingError( external_params ) 
-      <= max_dmap_error ) && 
-      ( getInverseMappingError( external_params ) 
-      <= max_imap_error ) &&
-      ( getDMapRMSE( external_params ) 
-      <= max_dmap_rmse ) && 
-      ( getIMapRMSE( external_params ) 
-      <= max_imap_rmse ) ) {
-    
-      /* This transformation has no outliers */
-      
-      return true;
-    }    
-    
-    /* Iterating over the current transformation tie-points */
-    
-    TeGTParams best_params;
-    double best_params_dmap_rmse = DBL_MAX;
-    double best_params_imap_rmse = DBL_MAX;
-    double best_params_dmap_error = DBL_MAX;
-    double best_params_imap_error = DBL_MAX;
-    
-    bool transformation_not_updated = false;
-    unsigned int iterations_remainning = (unsigned int)
-      external_params.tiepoints_.size();
-    std::vector< TPDataNode > norm_err_vec;     
-    std::list< ExcTPDataNode > exc_tp_list;
-    TeGTParams iteration_params = external_params;
-  
-    while( ( iteration_params.tiepoints_.size() > 
-      req_tie_pts_nmb ) && iterations_remainning )
-    {
-      unsigned int iter_tps_nmb = (unsigned int)
-        iteration_params.tiepoints_.size();
-      transformation_not_updated = true;
-      
-      /* Updating the normalized error map */
-      
-      updateTPErrVec( iteration_params, norm_err_vec );
-      
-      /* Generating all possible transformations without 
-         each tie-point, starting with the worse point */
-      
-      for( int norm_err_vec_idx = ((int)norm_err_vec.size()) - 1 ;
-        ( norm_err_vec_idx > ( -1 ) ) ; --norm_err_vec_idx )
-      {
-        const unsigned int& cur_candtp_idx = 
-          norm_err_vec[ norm_err_vec_idx ].tpindex_;
-          
-        TEAGN_DEBUG_CONDITION( ( cur_candtp_idx < 
-          iteration_params.tiepoints_.size() ), "Invalid index" )
-
-        /* Generating a transformation parameters without the
-          current tie-point (bigger error)*/
-            
-        TeGTParams new_iteration_params = iteration_params;
-        new_iteration_params.tiepoints_.clear();
-        new_iteration_params.direct_parameters_.Clear();
-        new_iteration_params.inverse_parameters_.Clear();
-            
-        for( unsigned int tpindex2 = 0 ; tpindex2 < iter_tps_nmb ; 
-          ++tpindex2 ) 
-        {
-          if( cur_candtp_idx != tpindex2 ) {
-            new_iteration_params.tiepoints_.push_back( 
-              iteration_params.tiepoints_[ tpindex2 ] );
-          }
-        }            
-      
-        /* Trying to generate a transformation without the current
-            candidate tie-point for exclusion */      
-        
-        if( computeParameters( new_iteration_params ) ) 
-        {
-          double new_it_dmap_rmse = 
-            getDMapRMSE( new_iteration_params );
-          double new_it_imap_rmse = 
-            getIMapRMSE( new_iteration_params );
-          
-          if( ( best_params_dmap_rmse > new_it_dmap_rmse ) && 
-            ( best_params_imap_rmse > new_it_imap_rmse ) ) 
-          {
-            double new_it_dmap_error = 
-              getDirectMappingError( new_iteration_params );
-            double new_it_imap_error = 
-              getInverseMappingError( new_iteration_params );
-                        
-            TeCoordPair excluded_tp = 
-              iteration_params.tiepoints_[ cur_candtp_idx ];
-              
-            /* Trying to insert back other tie-points excluded
-               before */
-            
-            if( exc_tp_list.size() > 0 )
-            {
-              /* Updating the excluded tie points errors map */
-              
-              updateExcTPErrList( new_iteration_params, 
-                exc_tp_list );
-                
-              /* Iterating over the excluded tps */
-              
-              std::list< ExcTPDataNode >::iterator 
-                exc_tps_list_it = exc_tp_list.begin();
-              std::list< ExcTPDataNode >::iterator 
-                exc_tps_list_it_end = exc_tp_list.end();
-                
-              while( exc_tps_list_it != exc_tps_list_it_end )
-              {
-                const ExcTPDataNode& curr_exc_tp_data = 
-                  *exc_tps_list_it;
-
-                /* Does this tp has direct and inverse errors 
-                   smaller than the current new_iteration_params ?? */
-                        
-                if( ( curr_exc_tp_data.dmap_error_ <= 
-                  new_it_dmap_error ) && 
-                  ( curr_exc_tp_data.imap_error_ <= 
-                  new_it_imap_error ) )
-                {
-                  /* Trying to generate a trasformation with
-                     this point */
-                     
-                  TeGTParams new_iteration_params_plus1tp = 
-                    new_iteration_params;
-                  new_iteration_params.tiepoints_.push_back(
-                    curr_exc_tp_data.tp_ );
-                    
-                  if( computeParameters( 
-                    new_iteration_params_plus1tp ) ) 
-                  {
-                    double newp1tp_dmap_rmse = getDMapRMSE( 
-                      new_iteration_params_plus1tp );
-                    double newp1tp_imap_rmse = getIMapRMSE( 
-                      new_iteration_params_plus1tp );
-                    
-                    if( ( new_it_dmap_rmse >= newp1tp_dmap_rmse ) && 
-                      ( new_it_imap_rmse >= newp1tp_imap_rmse ) ) 
-                    {
-                      new_iteration_params = 
-                        new_iteration_params_plus1tp;
-                      new_it_dmap_error = getDirectMappingError( 
-                        new_iteration_params_plus1tp );
-                      new_it_imap_error = getInverseMappingError( 
-                        new_iteration_params_plus1tp ); 
-                      new_it_dmap_rmse = newp1tp_dmap_rmse;
-                      new_it_imap_rmse = newp1tp_imap_rmse;
-                        
-                      exc_tp_list.erase( exc_tps_list_it );
-                        
-                      updateExcTPErrList( new_iteration_params, 
-                        exc_tp_list );   
-                        
-                      exc_tps_list_it = exc_tp_list.begin();
-                      exc_tps_list_it_end = exc_tp_list.end();                    
-                    }
-                    else
-                    {
-                      ++exc_tps_list_it;
-                    }
-                  } 
-                  else
-                  {
-                    ++exc_tps_list_it;
-                  }                   
-                }
-                else
-                {  
-                  ++exc_tps_list_it;
-                }
-              }
-            }
-            
-            /* Updating the best transformation parameters */
-            
-            best_params_dmap_error = new_it_dmap_error;
-            best_params_imap_error = new_it_imap_error;
-            best_params_dmap_rmse = new_it_dmap_rmse;
-            best_params_imap_rmse = new_it_imap_rmse;
-            best_params = new_iteration_params;
-            
-            /* Updating the next iteration parameters */
-            
-            iteration_params = new_iteration_params;
-            
-            transformation_not_updated = false;
-            
-            /* Putting the excluded tie-point into the 
-               excluded tie-points map */
-               
-            ExcTPDataNode exctpdata;
-            exctpdata.tp_ = excluded_tp;
-            exc_tp_list.push_back( exctpdata );
-            
-            /* break the current tie-points loop */
-            
-            break;
-          } //if( ( best_params_dmap_error > new_it_dmap_error ) && 
-        } //if( computeParameters( new_iteration_params ) ) {    
-      }
-      
-      if( transformation_not_updated ) {
-        /* There is no way to improve the current transformation
-           since all tie-points were tested */
-        
-        break; /* break the iterations loop */
-      } else {
-        if( ( max_dmap_error >= best_params_dmap_error ) && 
-            ( max_imap_error >= best_params_imap_error ) &&
-            ( max_dmap_rmse >= best_params_dmap_rmse ) && 
-            ( max_imap_rmse >= best_params_imap_rmse ) ) {
-            
-          /* A valid transformation was found */
-          break;
-        }
-      }
-      
-      --iterations_remainning;
-    }//while( params.tiepoints_.size() > req_tie_pts_nmb ) {
-    
-    if( ( best_params.tiepoints_.size() >= req_tie_pts_nmb ) &&
-        ( max_dmap_error >= best_params_dmap_error ) && 
-        ( max_imap_error >= best_params_imap_error ) &&
-        ( max_dmap_rmse >= best_params_dmap_rmse ) && 
-        ( max_imap_rmse >= best_params_imap_rmse ) ) {
-        
-      external_params = best_params;
-      
-      return true;
-    } else {
-      return false;
-    }    
-  }
-  
-  return false;
-}
-
-
-void TeGeometricTransformation::updateExcTPErrList( 
-  const TeGTParams& params,
-  std::list< ExcTPDataNode >& exc_tp_list )
-  const
-{
-  if( exc_tp_list.size() > 0 )
-  {
-    /* Updating the new direct and inverse mapping errors */
-     
-    std::list< ExcTPDataNode >::iterator tp_list_it = 
-      exc_tp_list.begin();
-    std::list< ExcTPDataNode >::iterator tp_list_it_end = 
-      exc_tp_list.end();
-      
-    double dmap_err_min =  DBL_MAX;
-    double dmap_err_max =  (-1.0) * DBL_MAX;
-    double imap_err_min =  DBL_MAX;  
-    double imap_err_max =  (-1.0) * DBL_MAX;
-    
-    while( tp_list_it != tp_list_it_end )
-    {
-      ExcTPDataNode& curr_node = *tp_list_it;
-      
-      const TeCoordPair& cur_ex_tp = curr_node.tp_;
-      
-      curr_node.dmap_error_ = getDirectMappingError( cur_ex_tp, 
-        params );
-      curr_node.imap_error_ = getInverseMappingError( cur_ex_tp, 
-        params );        
-        
-      if( dmap_err_min > curr_node.dmap_error_ ) {
-        dmap_err_min = curr_node.dmap_error_;
-      }
-      if( dmap_err_max < curr_node.dmap_error_ ) {
-        dmap_err_max = curr_node.dmap_error_;
-      }        
-        
-      if( imap_err_min > curr_node.imap_error_ ) {
-        imap_err_min = curr_node.imap_error_;
-      }
-      if( imap_err_max < curr_node.imap_error_ ) {
-        imap_err_max = curr_node.imap_error_;
-      }            
-      
-      ++tp_list_it;
-    }
-    
-    double dmap_err_range = dmap_err_max - dmap_err_min;
-    double imap_err_range = imap_err_max - imap_err_min;
-    
-    /* Updating the normalized error */
-    
-    tp_list_it = exc_tp_list.begin();
-    
-    if( ( dmap_err_range == 0.0 ) &&
-      ( imap_err_range == 0.0 ) )
-    {
-      while( tp_list_it != tp_list_it_end )
-      {
-        tp_list_it->norm_error_ = 0.0;
-        
-        ++tp_list_it;
-      }
-    }
-    else if( dmap_err_range == 0.0 ) 
-    {
-      while( tp_list_it != tp_list_it_end )
-      {
-        tp_list_it->norm_error_ =
-          ( 
-            ( 
-              (  
-                tp_list_it->imap_error_ - imap_err_min              
-              ) 
-              / imap_err_range 
-            ) 
-          );
-        
-        ++tp_list_it;
-      }
-    }
-    else if( imap_err_range == 0.0 ) 
-    {
-      while( tp_list_it != tp_list_it_end )
-      {
-        tp_list_it->norm_error_ =
-          ( 
-            ( 
-              ( 
-                tp_list_it->dmap_error_ - dmap_err_min
-              ) 
-              / dmap_err_range 
-            ) 
-          );
-        
-        ++tp_list_it;
-      }
-    }
-    else
-    {
-      while( tp_list_it != tp_list_it_end )
-      {
-        tp_list_it->norm_error_ =
-          ( 
-            ( 
-              ( 
-                tp_list_it->dmap_error_ - dmap_err_min
-              ) 
-              / dmap_err_range 
-            ) 
-            + 
-            ( 
-              (  
-                tp_list_it->imap_error_ - imap_err_min              
-              ) 
-              / imap_err_range 
-            ) 
-          );
-        
-        ++tp_list_it;
-      }
-    }
-    
-    /* Sorting list */
-    
-    exc_tp_list.sort();
-    
-    /* printing */
-/*   
-    tp_list_it = exc_tp_list.begin();
-    tp_list_it_end = exc_tp_list.end();
-    std::cout << std::endl << "Excluded Tie points" << std::endl;
-    while( tp_list_it != tp_list_it_end )
-    {
-      const ExcTPDataNode& node = *tp_list_it;
-      
-      std::cout << node.norm_error_ << " " <<
-       " [" + Te2String( node.tp_.pt1.x(),2 ) + "," +
-       Te2String( node.tp_.pt1.y(),2 ) + "-" +
-       Te2String( node.tp_.pt2.x(),2 ) + "," +
-       Te2String( node.tp_.pt2.y(),2 ) + "]"
-       << std::endl;      
-      
-      ++tp_list_it;
-    }    
-    std::cout << std::endl;
-*/  
-  }
-}
-
-
-void TeGeometricTransformation::updateTPErrVec( 
-  const TeGTParams& params, 
-  std::vector< TPDataNode >& errvec ) const
-{
-  /* Calculating the two mapping errors */
-  
-  const unsigned int iter_tps_nmb = (unsigned int)
-    params.tiepoints_.size();  
-    
-  errvec.clear();
-
-  double dmap_err_vec_min = DBL_MAX;
-  double dmap_err_vec_max = ( -1.0 ) * DBL_MAX;
-  double imap_err_vec_min = DBL_MAX;
-  double imap_err_vec_max = ( -1.0 ) * DBL_MAX;      
-  TPDataNode dummy_struct;
-  dummy_struct.norm_error_ = 0.0;
-  
-  for( unsigned int par_tps_vec_idx = 0 ; par_tps_vec_idx < iter_tps_nmb ; 
-    ++par_tps_vec_idx ) 
-  {
-    const TeCoordPair& cur_tp = params.tiepoints_[ 
-      par_tps_vec_idx ];
-      
-    dummy_struct.tpindex_ = par_tps_vec_idx;
-    dummy_struct.dmap_error_ = getDirectMappingError( cur_tp, 
-      params );
-    dummy_struct.imap_error_ = getInverseMappingError( cur_tp, 
-      params );
-    
-    errvec.push_back( dummy_struct );
-    
-    if( dmap_err_vec_min > dummy_struct.dmap_error_ ) {
-      dmap_err_vec_min = dummy_struct.dmap_error_;
-    }
-    if( dmap_err_vec_max < dummy_struct.dmap_error_ ) {
-      dmap_err_vec_max = dummy_struct.dmap_error_;
-    }        
-    
-    if( imap_err_vec_min > dummy_struct.imap_error_ ) {
-      imap_err_vec_min = dummy_struct.imap_error_;
-    }
-    if( imap_err_vec_max < dummy_struct.imap_error_ ) {
-      imap_err_vec_max = dummy_struct.imap_error_;
-    }            
-  }
-  
-  double dmap_err_vec_range = 
-    dmap_err_vec_max - dmap_err_vec_min;
-  double imap_err_vec_range = 
-    imap_err_vec_max - imap_err_vec_min;
-  
-  if( ( dmap_err_vec_range != 0.0 ) ||
-    ( imap_err_vec_range != 0.0 ) )
-  {
-    /* Updating normalized mapping errors */
-    
-    if( dmap_err_vec_range == 0.0 )
-    {
-      for( unsigned int errvec_idx = 0 ; errvec_idx < iter_tps_nmb ; 
-        ++errvec_idx ) 
-      {
-        TPDataNode& curr_elem = errvec[ errvec_idx ];
-        
-        curr_elem.norm_error_ = 
-          ( 
-            (  
-              curr_elem.imap_error_ - 
-              imap_err_vec_min              
-            ) 
-            / imap_err_vec_range 
-          );
-      }
-    }
-    else if( imap_err_vec_range == 0.0 )
-    {
-      for( unsigned int errvec_idx = 0 ; errvec_idx < iter_tps_nmb ; 
-        ++errvec_idx ) 
-      {
-        TPDataNode& curr_elem = errvec[ errvec_idx ];
-        
-        curr_elem.norm_error_ = 
-          ( 
-            ( 
-              curr_elem.dmap_error_ - 
-              dmap_err_vec_min
-            ) 
-            / dmap_err_vec_range 
-          );
-      }
-    }
-    else
-    {
-      for( unsigned int errvec_idx = 0 ; errvec_idx < iter_tps_nmb ; 
-        ++errvec_idx ) 
-      {
-        TPDataNode& curr_elem = errvec[ errvec_idx ];
-        
-        curr_elem.norm_error_ = 
-          ( 
-            ( 
-              curr_elem.dmap_error_ - 
-              dmap_err_vec_min
-            ) 
-            / dmap_err_vec_range 
-          ) 
-          + 
-          ( 
-            (  
-              curr_elem.imap_error_ - 
-              imap_err_vec_min              
-            ) 
-            / imap_err_vec_range 
-          );
-      }
-    }
-    
-    /* Sorting */
-    
-    sort( errvec.begin(), errvec.end() );
-
-    /* printing */
-/*  
-    std::cout << std::endl << "Tie points" << std::endl;
-    for( unsigned int errvec_idx = 0 ; errvec_idx < iter_tps_nmb ; 
-      ++errvec_idx ) 
-    {
-      const unsigned int& tp_pars_vec_idx = errvec[ errvec_idx ].tpindex_;
-      const TeCoordPair& currtp = params.tiepoints_[ 
-      tp_pars_vec_idx ];
-      
-      std::cout << errvec[ errvec_idx ].norm_error_ << " " <<
-       " [" + Te2String( currtp.pt1.x(),2 ) + "," +
-       Te2String( currtp.pt1.y(),2 ) + "-" +
-       Te2String( currtp.pt2.x(),2 ) + "," +
-       Te2String( currtp.pt2.y(),2 ) + "]"
-       << std::endl;
-    }    
-*/    
-  }
-  
-  
-}
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#include "TeGeometricTransformation.h"
+#include "TeMutex.h"
+#include "TeThreadFunctor.h"
+#include "TeUtils.h"
+#include "TeAgnostic.h"
+
+#include <math.h>
+#include <float.h>
+
+#include <map>
+#include <algorithm>
+
+// This is a workaround since Visual C++ is so very very considerate and
+// pollutes global namespace with macros named min and max.
+#ifdef max
+  #undef max
+#endif
+#ifdef min
+  #undef min
+#endif
+#include <limits>
+
+TeGeometricTransformation::TeGeometricTransformation()
+{
+}
+
+
+TeGeometricTransformation::~TeGeometricTransformation()
+{
+}
+
+
+void TeGeometricTransformation::getParameters( TeGTParams& params ) const
+{
+  params = internal_params_;
+}
+
+const TeGTParams& TeGeometricTransformation::getParameters() const
+{
+  return internal_params_;
+}
+
+bool TeGeometricTransformation::reset( const TeGTParams& newparams )
+{
+  /* If previous calculated parameters were supplied, no need to do calcules */
+
+  if( isTransDefined( newparams ) ) 
+  {
+    internal_params_ = newparams;
+    return true;
+  } else {
+    /* No previous parameters given - Need to calculate the new transformation
+       parameters */
+       
+    const unsigned int req_tie_pts_nmb = getMinRequiredTiePoints();
+
+    if( newparams.tiepoints_.size() < req_tie_pts_nmb ) 
+    {
+      return false;
+    } 
+    else if( newparams.tiepoints_.size() == req_tie_pts_nmb ) 
+    {
+      internal_params_ = newparams;
+      return computeParameters( internal_params_ );
+    }
+    else 
+    {
+      internal_params_ = newparams;
+      
+      switch( newparams.out_rem_strat_ ) {
+        case TeGTParams::NoOutRemotion :
+        {
+          if( computeParameters( internal_params_ ) ) {
+            
+            if( ( newparams.max_dmap_error_ >= 
+              getDirectMappingError( internal_params_ ) ) &&
+              ( newparams.max_imap_error_ >= 
+              getInverseMappingError( internal_params_ ) ) ) {
+              
+              return true;
+            }
+          }   
+        
+          break;
+        }
+        case TeGTParams::ExaustiveOutRemotion :
+        {
+          if( internal_params_.enable_multi_thread_ ) {
+            if( exaustiveOutRemotion( internal_params_,
+              TeGetPhysProcNumber() - 1 ) ) {
+              
+              return true;
+            }          
+          } else {
+            if( exaustiveOutRemotion( internal_params_, 0 ) ) {
+              return true;
+            }
+          }
+        
+          break;
+        }
+        case TeGTParams::LWOutRemotion :
+        {
+          if( lWOutRemotion( internal_params_ ) ) {
+            return true;
+          }
+                  
+          break;
+        }    
+        case TeGTParams::RANSACRemotion :
+        {
+          if( ransacRemotion( newparams, internal_params_ ) ) {
+            return true;
+          }
+                  
+          break;
+        }            
+        default : 
+        {
+          TEAGN_LOG_AND_THROW( 
+            "Invalid outliers remotion strategy" )
+          break;
+        }
+      
+      }
+    }
+  }
+  
+  internal_params_.reset();
+  
+  return false;
+}
+
+
+double TeGeometricTransformation::getDirectMappingError(  
+  const TeGTParams& params ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
+    "Transformation not defined" )   
+    
+  unsigned int tiepoints_size = params.tiepoints_.size();
+  
+  double max_error = 0;
+  double current_error = 0;
+  
+  for( unsigned int tpindex = 0 ; tpindex < tiepoints_size ; ++tpindex ) {
+    current_error = getDirectMappingError( params.tiepoints_[ tpindex ], 
+      params );
+    
+    if( current_error > max_error ) {
+      max_error = current_error;
+    }
+  }
+  
+  return max_error;
+}
+
+
+double TeGeometricTransformation::getInverseMappingError(  
+  const TeGTParams& params ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
+    "Transformation not defined" )  
+    
+  unsigned int tiepoints_size = params.tiepoints_.size();
+  
+  double max_error = 0;
+  double current_error = 0;
+  
+  for( unsigned int tpindex = 0 ; tpindex < tiepoints_size ; ++tpindex ) {
+    current_error = getInverseMappingError( params.tiepoints_[ tpindex ], 
+      params );
+    
+    if( current_error > max_error ) {
+      max_error = current_error;
+    }
+  }
+  
+  return max_error;
+}
+
+
+double TeGeometricTransformation::getDMapRMSE(  
+  const TeGTParams& params ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
+    "Transformation not defined" )   
+    
+  unsigned int tiepoints_size = params.tiepoints_.size();
+  
+  if( tiepoints_size == 0 )
+  {
+    return 0;
+  }
+  else
+  {
+    double error2_sum = 0;
+    double current_error = 0;
+    
+    for( unsigned int tpindex = 0 ; tpindex < tiepoints_size ; ++tpindex ) {
+      current_error = getDirectMappingError( params.tiepoints_[ tpindex ], 
+        params );
+        
+      error2_sum += ( current_error * current_error );
+    }
+    
+    return sqrt( error2_sum / ( (double)tiepoints_size ) );
+  }
+}
+
+
+double TeGeometricTransformation::getIMapRMSE(  
+  const TeGTParams& params ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
+    "Transformation not defined" )   
+    
+  unsigned int tiepoints_size = params.tiepoints_.size();
+  
+  if( tiepoints_size == 0 )
+  {
+    return 0;
+  }
+  else
+  {
+    double error2_sum = 0;
+    double current_error = 0;
+    
+    for( unsigned int tpindex = 0 ; tpindex < tiepoints_size ; ++tpindex ) {
+      current_error = getInverseMappingError( params.tiepoints_[ tpindex ], 
+        params );
+        
+      error2_sum += ( current_error * current_error );
+    }
+    
+    return sqrt( error2_sum / ( (double)tiepoints_size ) );
+  }  
+}
+
+
+double TeGeometricTransformation::getDirectMappingError( 
+  const TeCoordPair& tie_point, const TeGTParams& params ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
+    "Transformation not defined" )   
+    
+  TeCoord2D direct_mapped_point;
+
+  directMap( params, tie_point.pt1, direct_mapped_point );
+    
+  double diff_x = tie_point.pt2.x() - direct_mapped_point.x();
+  double diff_y = tie_point.pt2.y() - direct_mapped_point.y();
+    
+  return hypot( diff_x, diff_y );
+}
+
+
+double TeGeometricTransformation::getInverseMappingError( 
+  const TeCoordPair& tie_point, const TeGTParams& params ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ),
+    "Transformation not defined" )   
+    
+  TeCoord2D inverse_mapped_point;
+
+  inverseMap( params, tie_point.pt2, inverse_mapped_point );
+    
+  double diff_x = tie_point.pt1.x() - inverse_mapped_point.x();
+  double diff_y = tie_point.pt1.y() - inverse_mapped_point.y();
+    
+  return hypot( diff_x, diff_y );
+}
+
+
+bool TeGeometricTransformation::recombineSeed( std::vector<unsigned int>& seed, 
+  const unsigned int& seedpos, const unsigned int& elements_nmb )
+{
+  unsigned int seed_size = seed.size();
+  
+  if( seedpos >= seed_size ) {
+    return false;
+  }
+
+  if( seed[ seedpos ]  >= ( elements_nmb - seed_size + seedpos + 1 ) ) {
+    if( seedpos == seed_size - 1 ) {
+      return false;
+    } else if( seedpos == 0 ) {
+      return recombineSeed( seed, seedpos + 1, elements_nmb ) ;
+    } else {
+      return recombineSeed( seed, seedpos + 1, elements_nmb ) ;
+    };
+  } else if( seed[ seedpos ]  == 0 ) {
+    if( seedpos == 0 ) {
+      seed[ seedpos ] = 1 ;
+      return recombineSeed( seed, seedpos + 1, elements_nmb );
+    } else if( seedpos == seed_size - 1 ) {
+      seed[ seedpos ] = seed[ seedpos - 1 ] + 1;
+      return true;
+    } else {
+      seed[ seedpos ] = seed[ seedpos - 1 ] + 1;
+      seed[ seedpos + 1 ] = 0;
+      return recombineSeed( seed, seedpos + 1, elements_nmb );
+    }
+  } else {
+    if( seedpos == seed_size - 1 ) {
+      seed[ seedpos ] = seed[ seedpos ] + 1;
+      return true;
+    } else if( seedpos == 0 ) {
+      if( recombineSeed( seed, seedpos + 1, elements_nmb ) ) {
+        return true;
+      } else {
+        seed[ seedpos ] = seed[ seedpos ] + 1;
+        seed[ seedpos + 1 ] = 0;
+        return recombineSeed( seed, seedpos + 1, elements_nmb );
+      }
+    } else {
+      if( recombineSeed( seed, seedpos + 1, elements_nmb ) ) {
+        return true;
+      } else {
+        seed[ seedpos ] = seed[ seedpos ] + 1;
+        seed[ seedpos + 1 ] = 0;
+        return recombineSeed( seed, seedpos + 1, elements_nmb );
+      }
+    }
+  }
+}
+
+
+TeGeometricTransformation* TeGeometricTransformation::DefaultObject( 
+  const TeGTParams& )
+{ 
+  TEAGN_LOG_AND_THROW( "Trying to create an invalid "
+    "TeGemetricTransformation instance" );
+  
+  return 0;
+}; 
+
+
+bool TeGeometricTransformation::exaustiveOutRemotion( 
+  TeGTParams& params, unsigned int threads_nmb )
+{
+  TEAGN_DEBUG_CONDITION( ( params.out_rem_strat_ == 
+    TeGTParams::ExaustiveOutRemotion ), 
+    "Inconsistent outliers remotion strategy" )
+  TEAGN_TRUE_OR_THROW( ( params.max_dmap_error_ >= 0 ),
+    "Invalid maximum allowed direct mapping error" );
+  TEAGN_TRUE_OR_THROW( ( params.max_imap_error_ >= 0 ),
+    "Invalid maximum allowed inverse mapping error" );    
+
+  /* Initiating seed */
+  
+  std::vector<unsigned int> comb_seed_vec;       
+    
+  unsigned int req_tie_pts_nmb = getMinRequiredTiePoints();
+  
+  for( unsigned int comb_seed_vec_index = 0 ; 
+    comb_seed_vec_index < req_tie_pts_nmb ;
+    ++comb_seed_vec_index ) {
+    
+    comb_seed_vec.push_back( 0 );
+  }
+  
+  /* initializing mutexes */
+  
+  TeMutex comb_seed_vec_mutex;
+  TeMutex trans_params_mutex;
+  
+  /* Initializing threads */
+  
+  TeGTParams best_trans_params;
+  double best_trans_dmap_error = DBL_MAX;
+  double best_trans_imap_error = DBL_MAX;
+  
+  std::vector< TeThreadFunctor::pointer > threads_vector;
+  
+  TeThreadParameters thread_params;
+  
+  thread_params.store( "req_tie_pts_nmb", req_tie_pts_nmb );  
+  thread_params.store( "init_trans_params_ptr", 
+    (TeGTParams const*)(&params) );
+  thread_params.store( "best_trans_params_ptr", 
+    &best_trans_params );    
+  thread_params.store( "best_trans_dmap_error_ptr", 
+    &best_trans_dmap_error );      
+  thread_params.store( "best_trans_imap_error_ptr", 
+    &best_trans_imap_error );     
+  thread_params.store( "comb_seed_vec_ptr", &comb_seed_vec );
+  thread_params.store( "trans_params_mutex_ptr", 
+    &trans_params_mutex );
+  thread_params.store( "comb_seed_vec_mutex_ptr", 
+    &comb_seed_vec_mutex );  
+  thread_params.store( "geo_trans_ptr", 
+    (TeGeometricTransformation const*)this );        
+    
+  unsigned int thread_index = 0;
+  
+  for( thread_index = 0 ; thread_index < threads_nmb ; 
+    ++thread_index ) {
+    
+    TeThreadFunctor::pointer aux_thread_ptr( 
+      new TeThreadFunctor );
+    aux_thread_ptr->setStartFunctPtr( eORThreadEntry );
+    aux_thread_ptr->setParameters( thread_params );
+    aux_thread_ptr->start();
+  
+    threads_vector.push_back( aux_thread_ptr );
+  }
+  
+  bool my_return = eORThreadEntry( thread_params );
+  bool threads_return = true;
+  
+  for( thread_index = 0 ; thread_index < threads_nmb ; 
+    ++thread_index ) {
+    
+    threads_vector[ thread_index ]->waitToFinish();
+    
+    threads_return = threads_return & 
+      threads_vector[ thread_index ]->getReturnValue();
+  }  
+  
+  if( my_return & threads_return ) {
+    if( best_trans_params.tiepoints_.size() >= req_tie_pts_nmb ) {
+      params = best_trans_params;
+      
+      return true;
+    } else {
+      return false;
+    }
+  } else {
+    return false;
+  }
+}
+
+
+bool TeGeometricTransformation::eORThreadEntry( 
+  const TeThreadParameters& params )
+{
+  /* Extracting parameters */
+  
+  unsigned int req_tie_pts_nmb = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "req_tie_pts_nmb",
+    req_tie_pts_nmb ), "Missing parameter" );
+    
+  TeGTParams const* init_trans_params_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "init_trans_params_ptr",
+    init_trans_params_ptr ), "Missing parameter" );
+  
+  TeGTParams* best_trans_params_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "best_trans_params_ptr",
+    best_trans_params_ptr ), "Missing parameter" );   
+    
+  double* best_trans_dmap_error_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "best_trans_dmap_error_ptr",
+    best_trans_dmap_error_ptr ), "Missing parameter" );     
+    
+  double* best_trans_imap_error_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "best_trans_imap_error_ptr",
+    best_trans_imap_error_ptr ), "Missing parameter" );     
+
+  std::vector<unsigned int>* comb_seed_vec_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "comb_seed_vec_ptr",
+    comb_seed_vec_ptr ), "Missing parameter" );
+    
+  TeMutex* trans_params_mutex_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "trans_params_mutex_ptr",
+    trans_params_mutex_ptr ), "Missing parameter" ); 
+
+  TeMutex* comb_seed_vec_mutex_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "comb_seed_vec_mutex_ptr",
+    comb_seed_vec_mutex_ptr ), "Missing parameter" );  
+    
+  TeGeometricTransformation const* geo_trans_ptr = 0;
+  TEAGN_TRUE_OR_THROW( params.retrive( "geo_trans_ptr",
+    geo_trans_ptr ), "Missing parameter" ); 
+  
+  /* Optimized local variables based on the input parameters */
+  
+  std::vector<unsigned int>& comb_seed_vec =
+    (*comb_seed_vec_ptr);  
+    
+  TeMutex& comb_seed_vec_mutex = (*comb_seed_vec_mutex_ptr); 
+  
+  const TeGeometricTransformation& geo_trans = (*geo_trans_ptr); 
+  
+  /* Copying some parameters to local variables to avoid
+     mutex overhead */
+     
+  trans_params_mutex_ptr->lock();
+     
+  const TeGTParams initial_trans_params = (*init_trans_params_ptr);     
+  const unsigned int initial_tiepoints_size = 
+    initial_trans_params.tiepoints_.size();   
+  
+  trans_params_mutex_ptr->unLock();
+        
+  /* Trying to find the best tie-points by building 
+    the transformation with the highest number of
+    tie-points, but with an acceptable mapping error */
+    
+  TeGTParams local_best_params;
+  double local_best_params_dmap_error = DBL_MAX;
+  double local_best_params_imap_error = DBL_MAX;
+  
+  TeGTParams curr_params = initial_trans_params;
+  double curr_params_dmap_error = DBL_MAX;
+  double curr_params_imap_error = DBL_MAX; 
+  
+  TeGTParams cp_plus_new_point;
+  double cp_plus_new_point_dmap_error = DBL_MAX;
+  double cp_plus_new_point_imap_error = DBL_MAX;
+  
+  unsigned int tiepoints_index = 0;
+  bool point_already_present = false;
+  bool seed_recombined = true;
+  unsigned int comb_seed_vec_index_2 = 0;
+  unsigned int comb_seed_vec_index_3 = 0;
+  
+  while( seed_recombined ) {
+    /* trying to recombine seed */
+    
+    comb_seed_vec_mutex.lock();
+    seed_recombined = recombineSeed( comb_seed_vec, 0, 
+      initial_tiepoints_size );
+    comb_seed_vec_mutex.unLock();
+      
+    if( seed_recombined ) {
+      /* Extracting tie-points from the original vector */
+      
+      curr_params.tiepoints_.clear();
+      
+      for( comb_seed_vec_index_2 = 0 ; 
+        comb_seed_vec_index_2 < req_tie_pts_nmb ;
+        ++comb_seed_vec_index_2 ) {
+        
+        curr_params.tiepoints_.push_back( 
+          initial_trans_params.tiepoints_[ comb_seed_vec[ 
+          comb_seed_vec_index_2 ] - 1 ] );
+      }
+      
+      /* Trying to generate a valid transformation */
+      
+      if( geo_trans.computeParameters( curr_params ) ) {
+        curr_params_dmap_error = geo_trans.getDirectMappingError( 
+          curr_params );
+        curr_params_imap_error = geo_trans.getInverseMappingError( 
+          curr_params );
+      
+        if( ( initial_trans_params.max_dmap_error_ >= 
+          curr_params_dmap_error ) &&
+          ( initial_trans_params.max_imap_error_ >= 
+          curr_params_imap_error ) ) {
+        
+          /* Trying to insert more tie-points into current 
+              transformation */
+          
+          for( tiepoints_index = 0 ; tiepoints_index < 
+            initial_tiepoints_size ; ++tiepoints_index ) {
+            
+            /* Verifying if the current tie-point is already 
+               present */
+            
+            point_already_present = false;
+            
+            for( comb_seed_vec_index_3 = 0 ; 
+              comb_seed_vec_index_3 < req_tie_pts_nmb ;
+              ++comb_seed_vec_index_3 ) {
+            
+              if( tiepoints_index == ( 
+                comb_seed_vec[ comb_seed_vec_index_3 ] - 1 ) ) {
+              
+                point_already_present = true;
+                break;
+              }
+            }
+            
+            if( ! point_already_present ) {
+              cp_plus_new_point = curr_params;
+              
+              cp_plus_new_point.tiepoints_.push_back( 
+                initial_trans_params.tiepoints_[ tiepoints_index ] );
+              
+              /* Verifying if the new tie-point insertion does 
+                not generate an invalid transformation */
+              
+              if( geo_trans.computeParameters( cp_plus_new_point ) ) {
+                cp_plus_new_point_dmap_error =
+                  geo_trans.getDirectMappingError( cp_plus_new_point );
+                cp_plus_new_point_imap_error =
+                  geo_trans.getInverseMappingError( cp_plus_new_point );
+                  
+                if( ( cp_plus_new_point_dmap_error <=
+                  initial_trans_params.max_dmap_error_ ) &&
+                  ( cp_plus_new_point_imap_error <=
+                  initial_trans_params.max_imap_error_ ) ) {
+                  
+                  curr_params = cp_plus_new_point;
+                  curr_params_dmap_error = 
+                    cp_plus_new_point_dmap_error;
+                  curr_params_imap_error =
+                    cp_plus_new_point_imap_error;  
+                }
+              }
+            }
+          }
+          
+          /* A valid transformation was generated, now 
+            verifying 
+            if the number of tie-poits is greater then the current 
+            thread local best transformation.
+          */            
+          
+          if( curr_params.tiepoints_.size() >= 
+            local_best_params.tiepoints_.size() ) {
+            
+            if( ( curr_params_dmap_error < 
+              local_best_params_dmap_error ) &&
+              ( curr_params_imap_error <
+                local_best_params_imap_error ) ) {
+            
+              local_best_params = curr_params;
+              local_best_params_dmap_error = curr_params_dmap_error;
+              local_best_params_imap_error = curr_params_imap_error;
+            }
+          }           
+        }
+      } //if( geo_trans.computeParameters( curr_params ) )
+    } //if( seed_recombined )
+  } //while( seed_recombined )
+  
+  /* A valid local thread transformation was generated, now 
+    verifying 
+    if the error is smaller then the current 
+    global transformation.
+  */
+
+  if( local_best_params.tiepoints_.size() >= req_tie_pts_nmb ) {
+    trans_params_mutex_ptr->lock();
+    
+    if( local_best_params.tiepoints_.size() >=
+      best_trans_params_ptr->tiepoints_.size() ) {
+      
+      if( ( local_best_params_dmap_error < 
+        (*best_trans_dmap_error_ptr) ) &&
+        ( local_best_params_imap_error < 
+        (*best_trans_imap_error_ptr) ) ) {
+      
+        (*best_trans_params_ptr) = local_best_params;
+        (*best_trans_dmap_error_ptr) = local_best_params_dmap_error;
+        (*best_trans_imap_error_ptr) = local_best_params_imap_error;       
+      }      
+    }
+    
+    trans_params_mutex_ptr->unLock();
+  }
+  
+  return true;
+}
+
+
+bool TeGeometricTransformation::lWOutRemotion( 
+  TeGTParams& external_params )
+{
+  TEAGN_DEBUG_CONDITION( ( external_params.out_rem_strat_ == 
+    TeGTParams::LWOutRemotion ), 
+    "Inconsistent outliers remotion strategy" )
+  TEAGN_TRUE_OR_THROW( ( external_params.tiePointsWeights_.size() ?
+    ( external_params.tiePointsWeights_.size() ==
+    external_params.tiepoints_.size() ) : true ),
+    "The tie-points vector size do not match the tie-points "
+    "weights vector size" )
+  TEAGN_TRUE_OR_THROW( ( external_params.max_dmap_error_ >= 0 ),
+    "Invalid maximum allowed direct mapping error" );
+  TEAGN_TRUE_OR_THROW( ( external_params.max_imap_error_ >= 0 ),
+    "Invalid maximum allowed inverse mapping error" );
+  TEAGN_TRUE_OR_THROW( ( external_params.max_dmap_rmse_ >= 0 ),
+    "Invalid maximum allowed direct mapping RMSE" );
+  TEAGN_TRUE_OR_THROW( ( external_params.max_imap_rmse_ >= 0 ),
+    "Invalid maximum allowed inverse mapping RMSE" );        
+    
+  const unsigned int req_tie_pts_nmb = getMinRequiredTiePoints();
+  
+  // Normalizing tie-points weights
+    
+  const bool useTPWeights = ( external_params.tiePointsWeights_.size() ) ?
+    true : false;
+  TEAGN_TRUE_OR_THROW( normalizeTPWeights( 
+     external_params.tiePointsWeights_ ),
+     "Error normalizing tie-points weights" );
+  
+  if( external_params.tiepoints_.size() == req_tie_pts_nmb ) {
+    return computeParameters( external_params );
+  } else if( external_params.tiepoints_.size() > req_tie_pts_nmb ) {
+    /* Global vars */
+    
+    const double max_dmap_error = 
+      external_params.max_dmap_error_;
+    const double max_imap_error = 
+      external_params.max_imap_error_;
+    const double max_dmap_rmse = 
+      external_params.max_dmap_rmse_;
+    const double max_imap_rmse = 
+      external_params.max_imap_rmse_;
+          
+    /* Computing the initial global transformation */
+    
+    if( ! computeParameters( external_params ) ) {
+      return false;
+    }    
+    
+    if( ( getDirectMappingError( external_params ) 
+      <= max_dmap_error ) && 
+      ( getInverseMappingError( external_params ) 
+      <= max_imap_error ) &&
+      ( getDMapRMSE( external_params ) 
+      <= max_dmap_rmse ) && 
+      ( getIMapRMSE( external_params ) 
+      <= max_imap_rmse ) ) {
+    
+      /* This transformation has no outliers */
+      
+      return true;
+    }    
+    
+    /* Iterating over the current transformation tie-points */
+    
+    TeGTParams best_params;
+    double best_params_dmap_rmse = DBL_MAX;
+    double best_params_imap_rmse = DBL_MAX;
+    double best_params_dmap_error = DBL_MAX;
+    double best_params_imap_error = DBL_MAX;
+    
+    bool transformation_not_updated = false;
+    unsigned int iterations_remainning = (unsigned int)
+      external_params.tiepoints_.size();
+    std::vector< TPDataNode > norm_err_vec;     
+    std::list< ExcTPDataNode > exc_tp_list;
+    TeGTParams iteration_params = external_params;
+    TeCoordPair excluded_tp;
+    double excluded_tp_weight = 0;
+    ExcTPDataNode dummy_exctpdata;
+  
+    while( ( iteration_params.tiepoints_.size() > 
+      req_tie_pts_nmb ) && iterations_remainning )
+    {
+      unsigned int iter_tps_nmb = (unsigned int)
+        iteration_params.tiepoints_.size();
+      transformation_not_updated = true;
+      
+      /* Updating the normalized error map */
+      
+      updateTPErrVec( iteration_params, useTPWeights, norm_err_vec );
+      
+      /* Generating all possible transformations without 
+         each tie-point, starting with the worse point */
+      
+      for( int norm_err_vec_idx = ((int)norm_err_vec.size()) - 1 ;
+        ( norm_err_vec_idx > ( -1 ) ) ; --norm_err_vec_idx )
+      {
+        const unsigned int& cur_candtp_idx = 
+          norm_err_vec[ norm_err_vec_idx ].tpindex_;
+          
+        TEAGN_DEBUG_CONDITION( ( cur_candtp_idx < 
+          iteration_params.tiepoints_.size() ), "Invalid index" )
+
+        /* Generating a transformation parameters without the
+          current tie-point (bigger error)*/
+            
+        TeGTParams new_iteration_params = iteration_params;
+        new_iteration_params.tiepoints_.clear();
+        new_iteration_params.tiePointsWeights_.clear();
+        new_iteration_params.direct_parameters_.Clear();
+        new_iteration_params.inverse_parameters_.Clear();
+            
+        for( unsigned int tpindex2 = 0 ; tpindex2 < iter_tps_nmb ; 
+          ++tpindex2 ) 
+        {
+          if( cur_candtp_idx != tpindex2 ) 
+          {
+            new_iteration_params.tiepoints_.push_back( 
+              iteration_params.tiepoints_[ tpindex2 ] );
+              
+            if( useTPWeights )
+            {
+              new_iteration_params.tiePointsWeights_.push_back( 
+                iteration_params.tiePointsWeights_[ tpindex2 ] );
+            }
+          }
+        }            
+      
+        /* Trying to generate a transformation without the current
+            candidate tie-point for exclusion */      
+        
+        if( computeParameters( new_iteration_params ) ) 
+        {
+          double new_it_dmap_rmse = 
+            getDMapRMSE( new_iteration_params );
+          double new_it_imap_rmse = 
+            getIMapRMSE( new_iteration_params );
+          
+          if( ( best_params_dmap_rmse > new_it_dmap_rmse ) && 
+            ( best_params_imap_rmse > new_it_imap_rmse ) ) 
+          {
+            double new_it_dmap_error = 
+              getDirectMappingError( new_iteration_params );
+            double new_it_imap_error = 
+              getInverseMappingError( new_iteration_params );
+                        
+            excluded_tp = iteration_params.tiepoints_[ cur_candtp_idx ];
+            if( useTPWeights )
+            {
+              excluded_tp_weight = iteration_params.tiePointsWeights_[ 
+                cur_candtp_idx ];
+            }
+              
+            /* Trying to insert back other tie-points excluded
+               before */
+            
+            if( exc_tp_list.size() > 0 )
+            {
+              /* Updating the excluded tie points errors map */
+              
+              updateExcTPErrList( new_iteration_params, useTPWeights,
+                exc_tp_list );
+                
+              /* Iterating over the excluded tps */
+              
+              std::list< ExcTPDataNode >::iterator 
+                exc_tps_list_it = exc_tp_list.begin();
+              std::list< ExcTPDataNode >::iterator 
+                exc_tps_list_it_end = exc_tp_list.end();
+                
+              while( exc_tps_list_it != exc_tps_list_it_end )
+              {
+                const ExcTPDataNode& curr_exc_tp_data = 
+                  *exc_tps_list_it;
+
+                /* Does this tp has direct and inverse errors 
+                   smaller than the current new_iteration_params ?? */
+                        
+                if( ( curr_exc_tp_data.dmap_error_ <= 
+                  new_it_dmap_error ) && 
+                  ( curr_exc_tp_data.imap_error_ <= 
+                  new_it_imap_error ) )
+                {
+                  /* Trying to generate a trasformation with
+                     this point */
+                     
+                  TeGTParams new_iteration_params_plus1tp = 
+                    new_iteration_params;
+                  new_iteration_params.tiepoints_.push_back(
+                    curr_exc_tp_data.tp_ );
+                  if( useTPWeights )
+                  {  
+                    new_iteration_params.tiePointsWeights_.push_back(
+                      curr_exc_tp_data.tp_weight_ );
+                  }
+                    
+                  if( computeParameters( 
+                    new_iteration_params_plus1tp ) ) 
+                  {
+                    double newp1tp_dmap_rmse = getDMapRMSE( 
+                      new_iteration_params_plus1tp );
+                    double newp1tp_imap_rmse = getIMapRMSE( 
+                      new_iteration_params_plus1tp );
+                    
+                    if( ( new_it_dmap_rmse >= newp1tp_dmap_rmse ) && 
+                      ( new_it_imap_rmse >= newp1tp_imap_rmse ) ) 
+                    {
+                      new_iteration_params = 
+                        new_iteration_params_plus1tp;
+                      new_it_dmap_error = getDirectMappingError( 
+                        new_iteration_params_plus1tp );
+                      new_it_imap_error = getInverseMappingError( 
+                        new_iteration_params_plus1tp ); 
+                      new_it_dmap_rmse = newp1tp_dmap_rmse;
+                      new_it_imap_rmse = newp1tp_imap_rmse;
+                        
+                      exc_tp_list.erase( exc_tps_list_it );
+                        
+                      updateExcTPErrList( new_iteration_params, 
+                        useTPWeights, exc_tp_list );   
+                        
+                      exc_tps_list_it = exc_tp_list.begin();
+                      exc_tps_list_it_end = exc_tp_list.end();                    
+                    }
+                    else
+                    {
+                      ++exc_tps_list_it;
+                    }
+                  } 
+                  else
+                  {
+                    ++exc_tps_list_it;
+                  }                   
+                }
+                else
+                {  
+                  ++exc_tps_list_it;
+                }
+              }
+            }
+            
+            /* Updating the best transformation parameters */
+            
+            best_params_dmap_error = new_it_dmap_error;
+            best_params_imap_error = new_it_imap_error;
+            best_params_dmap_rmse = new_it_dmap_rmse;
+            best_params_imap_rmse = new_it_imap_rmse;
+            best_params = new_iteration_params;
+            
+            /* Updating the next iteration parameters */
+            
+            iteration_params = new_iteration_params;
+            
+            transformation_not_updated = false;
+            
+            /* Putting the excluded tie-point into the 
+               excluded tie-points map */
+               
+            dummy_exctpdata.tp_ = excluded_tp;
+            if( useTPWeights )
+            {
+              dummy_exctpdata.tp_weight_ = excluded_tp_weight;
+            }
+            exc_tp_list.push_back( dummy_exctpdata );
+            
+            /* break the current tie-points loop */
+            
+            break;
+          } //if( ( best_params_dmap_error > new_it_dmap_error ) && 
+        } //if( computeParameters( new_iteration_params ) ) {    
+      }
+      
+      if( transformation_not_updated ) {
+        /* There is no way to improve the current transformation
+           since all tie-points were tested */
+        
+        break; /* break the iterations loop */
+      } else {
+        if( ( max_dmap_error >= best_params_dmap_error ) && 
+            ( max_imap_error >= best_params_imap_error ) &&
+            ( max_dmap_rmse >= best_params_dmap_rmse ) && 
+            ( max_imap_rmse >= best_params_imap_rmse ) ) {
+            
+          /* A valid transformation was found */
+          break;
+        }
+      }
+      
+      --iterations_remainning;
+    }//while( params.tiepoints_.size() > req_tie_pts_nmb ) {
+    
+    if( ( best_params.tiepoints_.size() >= req_tie_pts_nmb ) &&
+        ( max_dmap_error >= best_params_dmap_error ) && 
+        ( max_imap_error >= best_params_imap_error ) &&
+        ( max_dmap_rmse >= best_params_dmap_rmse ) && 
+        ( max_imap_rmse >= best_params_imap_rmse ) ) {
+        
+      external_params = best_params;
+      
+      return true;
+    } else {
+      return false;
+    }    
+  }
+  
+  return false;
+}
+
+
+
+void TeGeometricTransformation::updateExcTPErrList( 
+  const TeGTParams& params,
+  bool useTPWeights,
+  std::list< ExcTPDataNode >& exc_tp_list )
+  const
+{
+  if( exc_tp_list.size() > 0 )
+  {
+    TEAGN_DEBUG_CONDITION( ( useTPWeights ?
+      ( params.tiePointsWeights_.size() == 
+      params.tiepoints_.size() ) : true ),
+      "The tie-points vector size do not match the tie-points "
+      "weights vector size" )
+      
+    /* Updating the new direct and inverse mapping errors */
+     
+    std::list< ExcTPDataNode >::iterator tp_list_it = 
+      exc_tp_list.begin();
+    std::list< ExcTPDataNode >::iterator tp_list_it_end = 
+      exc_tp_list.end();
+      
+    double dmap_err_min =  DBL_MAX;
+    double dmap_err_max =  (-1.0) * DBL_MAX;
+    double imap_err_min =  DBL_MAX;  
+    double imap_err_max =  (-1.0) * DBL_MAX;
+    
+    while( tp_list_it != tp_list_it_end )
+    {
+      ExcTPDataNode& curr_node = *tp_list_it;
+      
+      const TeCoordPair& cur_ex_tp = curr_node.tp_;
+      
+      curr_node.dmap_error_ = getDirectMappingError( cur_ex_tp, 
+        params );
+      curr_node.imap_error_ = getInverseMappingError( cur_ex_tp, 
+        params );        
+        
+      if( dmap_err_min > curr_node.dmap_error_ ) {
+        dmap_err_min = curr_node.dmap_error_;
+      }
+      if( dmap_err_max < curr_node.dmap_error_ ) {
+        dmap_err_max = curr_node.dmap_error_;
+      }        
+        
+      if( imap_err_min > curr_node.imap_error_ ) {
+        imap_err_min = curr_node.imap_error_;
+      }
+      if( imap_err_max < curr_node.imap_error_ ) {
+        imap_err_max = curr_node.imap_error_;
+      }            
+      
+      ++tp_list_it;
+    }
+    
+    double dmap_err_range = dmap_err_max - dmap_err_min;
+    double imap_err_range = imap_err_max - imap_err_min;
+    
+    /* Updating the normalized error */
+    
+    tp_list_it = exc_tp_list.begin();
+    
+    if( ( dmap_err_range == 0.0 ) &&
+      ( imap_err_range == 0.0 ) )
+    {
+      while( tp_list_it != tp_list_it_end )
+      {
+        tp_list_it->tp_error_ = 0.0;
+        
+        ++tp_list_it;
+      }
+    }
+    else if( dmap_err_range == 0.0 ) 
+    {
+      if( useTPWeights )
+      {       
+        while( tp_list_it != tp_list_it_end )
+        {
+          TEAGN_DEBUG_CONDITION( tp_list_it->tp_weight_ > 0.0,
+            "Invalid tie-point weight" )
+          TEAGN_DEBUG_CONDITION( tp_list_it->tp_weight_ <= 1.0,
+            "Invalid tie-point weight" )            
+                    
+          tp_list_it->tp_error_ =
+            ( 
+              (  
+                tp_list_it->imap_error_ - imap_err_min              
+              ) 
+              / ( imap_err_range * tp_list_it->tp_weight_  )
+            );
+
+          ++tp_list_it;
+        }
+      }
+      else
+      {
+        while( tp_list_it != tp_list_it_end )
+        {
+          tp_list_it->tp_error_ =
+            ( 
+              (  
+                tp_list_it->imap_error_ - imap_err_min              
+              ) 
+              / imap_err_range 
+            );
+          
+          ++tp_list_it;
+        }
+      }
+    }
+    else if( imap_err_range == 0.0 ) 
+    {
+      if( useTPWeights )
+      {     
+        while( tp_list_it != tp_list_it_end )
+        {
+          TEAGN_DEBUG_CONDITION( tp_list_it->tp_weight_ > 0.0,
+            "Invalid tie-point weight" )
+          TEAGN_DEBUG_CONDITION( tp_list_it->tp_weight_ <= 1.0,
+            "Invalid tie-point weight" )            
+                    
+          tp_list_it->tp_error_ =
+            ( 
+              ( 
+                tp_list_it->dmap_error_ - dmap_err_min
+              ) 
+              / ( dmap_err_range * tp_list_it->tp_weight_ )
+            );
+
+          ++tp_list_it;
+        }
+      }
+      else
+      {
+        while( tp_list_it != tp_list_it_end )
+        {
+          tp_list_it->tp_error_ =
+            ( 
+              ( 
+                tp_list_it->dmap_error_ - dmap_err_min
+              ) 
+              / dmap_err_range 
+            );
+          
+          ++tp_list_it;
+        }
+      }
+    }
+    else
+    {
+      if( useTPWeights )
+      {    
+        while( tp_list_it != tp_list_it_end )
+        {
+          TEAGN_DEBUG_CONDITION( tp_list_it->tp_weight_ > 0.0,
+            "Invalid tie-point weight" )
+          TEAGN_DEBUG_CONDITION( tp_list_it->tp_weight_ <= 1.0,
+            "Invalid tie-point weight" )            
+                    
+          tp_list_it->tp_error_ =
+            (
+              ( 
+                ( 
+                  tp_list_it->dmap_error_ - dmap_err_min
+                ) 
+                / dmap_err_range 
+              ) 
+              + 
+              ( 
+                (  
+                  tp_list_it->imap_error_ - imap_err_min              
+                ) 
+                / imap_err_range 
+              ) 
+            ) / ( 2.0 * tp_list_it->tp_weight_ );
+
+          ++tp_list_it;
+        }
+      }
+      else
+      {
+        while( tp_list_it != tp_list_it_end )
+        {
+          tp_list_it->tp_error_ =
+            ( 
+              ( 
+                ( 
+                  tp_list_it->dmap_error_ - dmap_err_min
+                ) 
+                / dmap_err_range 
+              ) 
+              + 
+              ( 
+                (  
+                  tp_list_it->imap_error_ - imap_err_min              
+                ) 
+                / imap_err_range 
+              ) 
+            );
+          
+          ++tp_list_it;
+        }
+      }
+    }
+    
+    /* Sorting list */
+    
+    exc_tp_list.sort();
+    
+    /* printing */
+/*  
+    tp_list_it = exc_tp_list.begin();
+    tp_list_it_end = exc_tp_list.end();
+    std::cout << std::endl << "Excluded Tie points list" << std::endl;
+    while( tp_list_it != tp_list_it_end )
+    {
+      const ExcTPDataNode& node = *tp_list_it;
+      
+      std::cout << node.norm_error_ << " " <<
+       " [" + Te2String( node.tp_.pt1.x(),2 ) + "," +
+       Te2String( node.tp_.pt1.y(),2 ) + "-" +
+       Te2String( node.tp_.pt2.x(),2 ) + "," +
+       Te2String( node.tp_.pt2.y(),2 ) + "]"
+       << std::endl;      
+      
+      ++tp_list_it;
+    }    
+    std::cout << std::endl;
+*/ 
+  }
+}
+
+
+void TeGeometricTransformation::updateTPErrVec( 
+  const TeGTParams& params, bool useTPWeights,
+  std::vector< TPDataNode >& errvec ) const
+{
+  TEAGN_DEBUG_CONDITION( ( useTPWeights ?
+    ( params.tiePointsWeights_.size() == 
+    params.tiepoints_.size() ) : true ),
+    "The tie-points vector size do not match the tie-points "
+    "weights vector size" )
+    
+  /* Calculating the two mapping errors */
+  
+  const unsigned int iter_tps_nmb = (unsigned int)
+    params.tiepoints_.size();  
+    
+  errvec.clear();
+
+  double dmap_err_vec_min = DBL_MAX;
+  double dmap_err_vec_max = ( -1.0 ) * dmap_err_vec_min;
+  double imap_err_vec_min = DBL_MAX;
+  double imap_err_vec_max = ( -1.0 ) * imap_err_vec_min;      
+  const TPDataNode dummy_struct;
+  
+  for( unsigned int par_tps_vec_idx = 0 ; par_tps_vec_idx < iter_tps_nmb ; 
+    ++par_tps_vec_idx ) 
+  {
+    const TeCoordPair& cur_tp = params.tiepoints_[ 
+      par_tps_vec_idx ];
+      
+    errvec.push_back( dummy_struct );
+    TPDataNode& newNode = errvec[ errvec.size() - 1 ];
+      
+    newNode.tpindex_ = par_tps_vec_idx;
+    newNode.dmap_error_ = getDirectMappingError( cur_tp, 
+      params );
+    newNode.imap_error_ = getInverseMappingError( cur_tp, 
+      params );
+    
+    if( dmap_err_vec_min > newNode.dmap_error_ ) {
+      dmap_err_vec_min = newNode.dmap_error_;
+    }
+    if( dmap_err_vec_max < newNode.dmap_error_ ) {
+      dmap_err_vec_max = newNode.dmap_error_;
+    }        
+    
+    if( imap_err_vec_min > newNode.imap_error_ ) {
+      imap_err_vec_min = newNode.imap_error_;
+    }
+    if( imap_err_vec_max < newNode.imap_error_ ) {
+      imap_err_vec_max = newNode.imap_error_;
+    }            
+  }
+  
+  const double dmap_err_vec_range = 
+    dmap_err_vec_max - dmap_err_vec_min;
+  const double imap_err_vec_range = 
+    imap_err_vec_max - imap_err_vec_min;
+  TEAGN_DEBUG_CONDITION( dmap_err_vec_range >= 0, "Invalid range" )
+  TEAGN_DEBUG_CONDITION( imap_err_vec_range >= 0, "Invalid range" )
+
+  const std::vector< double >& tpwVec = params.tiePointsWeights_;
+    
+    /* Updating normalized mapping errors */
+    
+  if( ( dmap_err_vec_range == 0.0 ) && ( imap_err_vec_range == 0.0 ) )
+  {
+    for( unsigned int errvec_idx = 0 ; errvec_idx < iter_tps_nmb ; 
+      ++errvec_idx ) 
+    {
+      errvec[ errvec_idx ].tp_error_ = 0;
+    }
+  }
+  else if( dmap_err_vec_range == 0.0 )
+  {
+    for( unsigned int errvec_idx = 0 ; errvec_idx < iter_tps_nmb ; 
+      ++errvec_idx ) 
+    {
+      TPDataNode& curr_elem = errvec[ errvec_idx ];
+      
+      if( useTPWeights )
+      {
+        TEAGN_DEBUG_CONDITION( tpwVec[ errvec_idx ] > 0.0,
+          "Invalid tie-point weight" )
+        TEAGN_DEBUG_CONDITION( tpwVec[ errvec_idx ] <= 1.0,
+          "Invalid tie-point weight" )            
+                
+        curr_elem.tp_error_ = 
+          ( 
+            (  
+              curr_elem.imap_error_ - 
+              imap_err_vec_min              
+            ) 
+            / ( imap_err_vec_range * tpwVec[ errvec_idx ] )
+          );
+      }
+      else
+      {
+        curr_elem.tp_error_ = 
+          ( 
+            (  
+              curr_elem.imap_error_ - 
+              imap_err_vec_min              
+            ) 
+            / imap_err_vec_range 
+          );
+      }
+    }
+  }
+  else if( imap_err_vec_range == 0.0 )
+  {
+    for( unsigned int errvec_idx = 0 ; errvec_idx < iter_tps_nmb ; 
+      ++errvec_idx ) 
+    {
+      TPDataNode& curr_elem = errvec[ errvec_idx ];
+      
+      if( useTPWeights )
+      {        
+        TEAGN_DEBUG_CONDITION( tpwVec[ errvec_idx ] > 0.0,
+          "Invalid tie-point weight" )
+        TEAGN_DEBUG_CONDITION( tpwVec[ errvec_idx ] <= 1.0,
+          "Invalid tie-point weight" )            
+                  
+        curr_elem.tp_error_ = 
+          ( 
+            ( 
+              curr_elem.dmap_error_ - 
+              dmap_err_vec_min
+            ) 
+            / ( dmap_err_vec_range * tpwVec[ errvec_idx ] )
+          );
+      }
+      else
+      {
+        curr_elem.tp_error_ = 
+          ( 
+            ( 
+              curr_elem.dmap_error_ - 
+              dmap_err_vec_min
+            ) 
+            / dmap_err_vec_range 
+          );
+      }
+    }
+  }
+  else
+  {
+    for( unsigned int errvec_idx = 0 ; errvec_idx < iter_tps_nmb ; 
+      ++errvec_idx ) 
+    {
+      TPDataNode& curr_elem = errvec[ errvec_idx ];
+      
+      if( useTPWeights )
+      { 
+        TEAGN_DEBUG_CONDITION( tpwVec[ errvec_idx ] > 0.0,
+          "Invalid tie-point weight" )
+        TEAGN_DEBUG_CONDITION( tpwVec[ errvec_idx ] <= 1.0,
+          "Invalid tie-point weight" )            
+                  
+        curr_elem.tp_error_ = 
+          (
+            ( 
+              ( 
+                curr_elem.dmap_error_ - 
+                dmap_err_vec_min
+              ) 
+              / dmap_err_vec_range 
+            ) 
+            + 
+            ( 
+              (  
+                curr_elem.imap_error_ - 
+                imap_err_vec_min              
+              ) 
+              / imap_err_vec_range 
+            )
+          ) / ( 2.0 * tpwVec[ errvec_idx ] );
+      }
+      else
+      {
+        curr_elem.tp_error_ = 
+          ( 
+            ( 
+              curr_elem.dmap_error_ - 
+              dmap_err_vec_min
+            ) 
+            / dmap_err_vec_range 
+          ) 
+          + 
+          ( 
+            (  
+              curr_elem.imap_error_ - 
+              imap_err_vec_min              
+            ) 
+            / imap_err_vec_range 
+          );
+      }
+    }
+  }
+
+  sort( errvec.begin(), errvec.end() );
+
+    /* printing */
+/*
+  std::cout << std::endl << "Tie points error vector" << std::endl;
+  for( unsigned int errvec_idx = 0 ; errvec_idx < iter_tps_nmb ; 
+    ++errvec_idx ) 
+  {
+    const unsigned int& tp_pars_vec_idx = errvec[ errvec_idx ].tpindex_;
+    const TeCoordPair& currtp = params.tiepoints_[ 
+    tp_pars_vec_idx ];
+    
+    std::cout << errvec[ errvec_idx ].norm_error_ << " " <<
+      " [" + Te2String( currtp.pt1.x(),2 ) + "," +
+      Te2String( currtp.pt1.y(),2 ) + "-" +
+      Te2String( currtp.pt2.x(),2 ) + "," +
+      Te2String( currtp.pt2.y(),2 ) + "]"
+      << std::endl;
+  }    
+*/   
+}
+
+bool TeGeometricTransformation::ransacRemotion( 
+  const TeGTParams& inputParams, TeGTParams& outputParams ) const
+{
+  TEAGN_DEBUG_CONDITION( ( inputParams.out_rem_strat_ == 
+    TeGTParams::RANSACRemotion ), 
+    "Inconsistent outliers remotion strategy" )
+  TEAGN_TRUE_OR_THROW( ( inputParams.max_dmap_error_ >= 0 ),
+    "Invalid maximum allowed direct mapping error" );
+  TEAGN_TRUE_OR_THROW( ( inputParams.max_imap_error_ >= 0 ),
+    "Invalid maximum allowed inverse mapping error" );
+  TEAGN_TRUE_OR_THROW( ( inputParams.max_dmap_rmse_ >= 0 ),
+    "Invalid maximum allowed direct mapping RMSE" );
+  TEAGN_TRUE_OR_THROW( ( inputParams.max_imap_rmse_ >= 0 ),
+    "Invalid maximum allowed inverse mapping RMSE" );   
+         
+  TEAGN_TRUE_OR_THROW( ( inputParams.tiePointsWeights_.size() ?
+    ( inputParams.tiePointsWeights_.size() ==
+    inputParams.tiepoints_.size() ) : true ),
+    "The tie-points vector size do not match the tie-points "
+    "weights vector size" )
+        
+  // Checking the number of required tie-points
+    
+  const unsigned int reqTPsNmb = getMinRequiredTiePoints();
+  const unsigned int inputTPNmb = (unsigned int)inputParams.tiepoints_.size();
+  
+  if( inputTPNmb < reqTPsNmb )
+  {
+    return false;  
+  }
+  else
+  {
+    // generating the tie-points accumulated probabilities map
+	  // with positive values up to RAND_MAX + 1
+    std::map< double, TeCoordPair > tpsMap;
+    {
+      if( inputParams.tiePointsWeights_.size() > 0 )
+      {
+        // finding normalization factors
+
+        double originalWSum = 0.0;
+        unsigned int tpIdx = 0;
+
+        for( tpIdx = 0 ; tpIdx < inputTPNmb ; ++tpIdx )
+        {
+          originalWSum += inputParams.tiePointsWeights_[ tpIdx ];
+        }
+
+        TEAGN_TRUE_OR_THROW( originalWSum > 0.0, 
+          "Invalid tie-points weighs sum" );
+
+        // map fill 
+        
+        double newWSum = 0.0;
+        double newW = 0.0;
+        
+        for( tpIdx = 0 ; tpIdx < inputTPNmb ; ++tpIdx )
+        {
+          newW = inputParams.tiePointsWeights_[ tpIdx ];
+          newW /= originalWSum;
+          newW *= ((double)RAND_MAX) + 1.0;
+
+          newWSum += newW;
+
+          tpsMap[ newWSum ] = inputParams.tiepoints_[ tpIdx ];
+        }
+      }
+      else
+      {
+        double wSum = 0;
+        const double increment = ( ((double)RAND_MAX) + 1.0 ) / 
+          ((double)inputParams.tiepoints_.size());
+        
+        for( unsigned int tpIdx = 0 ; tpIdx < inputTPNmb ; ++tpIdx )
+        {
+          wSum += increment;
+          tpsMap[ wSum ] = inputParams.tiepoints_[ tpIdx ];
+        }
+      }
+
+/*
+      std::map< double, TeCoordPair >::const_iterator mapIt =
+        tpsMap.begin();
+      while( mapIt != tpsMap.end() )
+      {
+        std::cout << " [" << mapIt->first 
+          << "," << mapIt->second.pt1.x_
+          << "," << mapIt->second.pt1.y_
+          << "," << mapIt->second.pt2.x_
+          << "," << mapIt->second.pt2.y_
+          << "]";
+        ++mapIt;
+      }
+*/
+    }
+    
+    // The Maximum Number of iterations
+    
+    const RansacItCounterT maxIterations = std::numeric_limits< RansacItCounterT >::max();
+      
+    // Transformation maximum errors
+    
+    const double maxDMapErr = inputParams.max_dmap_error_;
+    const double maxIMapErr = inputParams.max_imap_error_;
+    const double maxDRMSE = inputParams.max_dmap_rmse_;
+    const double maxIRMSE = inputParams.max_imap_rmse_;
+      
+    // This is the maximum number of allowed consecutive invalid
+    // consensus sets (no transformation generated)
+    const RansacItCounterT maxConsecutiveInvalidBaseSets = ( 
+      ((RansacItCounterT)inputTPNmb) * 
+      ((RansacItCounterT)reqTPsNmb) );
+      
+    // This is the minimum number of consecutive valid
+    // consensus sets
+    const RansacItCounterT minConsecutiveValidBaseSets = 
+      maxConsecutiveInvalidBaseSets;      
+      
+    // If the difference between consecutive valid sets RMSE drops
+    // below this value the process is stoped.
+    const double consecValidBaseSetsDRMSEThr = MIN( maxDMapErr / 2.0,
+      maxDRMSE );
+    const double consecValidBaseSetsIRMSEThr = MIN( maxIMapErr / 2.0,
+      maxIRMSE );
+    
+    TeGTParams bestParams;
+    bestParams.transformation_name_ = inputParams.transformation_name_;
+    
+    double bestParamsMaxDMapErr = maxDMapErr;
+    double bestParamsMaxIMapErr = maxIMapErr;
+    double bestParamsDRMSE = maxDRMSE;
+    double bestParamsIRMSE = maxIRMSE;
+
+    TeGTParams consensusSetParams;
+    consensusSetParams.transformation_name_ = inputParams.transformation_name_;
+    
+    double consensusSetMaxDMapErr = 0;
+    double consensusSetMaxIMapErr = 0;
+    double consensusSetDRMSE = 0;
+    double consensusSetIRMSE = 0;
+    double consensusSetIRMSEDiff = 0; // diff against bestParamsIRMSE
+    double consensusSetDRMSEDiff = 0; // diff against bestParamsDRMSE
+    
+    double tiePointDMapErr = 0;
+    double tiePointIMapErr = 0;    
+    
+    std::map< double, TeCoordPair >::const_iterator tpsMapIt;
+    unsigned int inputTpIdx = 0;
+      
+    RansacItCounterT selectedTpsCounter = 0;
+    std::vector< TeCoordPair* > selectedTpsPtrsVec;
+    selectedTpsPtrsVec.resize( reqTPsNmb, 0 );
+    unsigned int selectedTpsPtrsVecIdx = 0;
+    bool selectedTpsNotSelectedBefore = false;
+      
+    // RANSAC main loop
+    
+    RansacItCounterT consecutiveInvalidBaseSetsLeft = 
+      maxConsecutiveInvalidBaseSets;  
+    RansacItCounterT iterationsLeft = maxIterations;       
+    RansacItCounterT consecutiveValidBaseSets = 0;
+      
+    while( iterationsLeft )
+    {
+      // Trying to find a valid base consensus set
+      // with the minimum number of required tie-points
+      // Random selecting n distinc tpoints from the original set
+
+      consensusSetParams.tiepoints_.clear();
+      selectedTpsCounter = 0;
+
+      while( selectedTpsCounter < reqTPsNmb )
+      {
+        tpsMapIt = tpsMap.upper_bound( (double)rand() );
+        TEAGN_DEBUG_CONDITION( tpsMapIt != tpsMap.end(),
+          "Tie-point random selection error" );
+          
+        // Checking if this TP was already selected before
+        
+        selectedTpsNotSelectedBefore = true;
+        
+        for( selectedTpsPtrsVecIdx = 0 ; selectedTpsPtrsVecIdx <
+          selectedTpsCounter ; ++selectedTpsPtrsVecIdx )
+        {
+          if( selectedTpsPtrsVec[ selectedTpsPtrsVecIdx ] ==
+            &(tpsMapIt->second) )
+          {
+            selectedTpsNotSelectedBefore = false;
+            break;
+          }
+        }
+        
+        if( selectedTpsNotSelectedBefore )
+        {
+          consensusSetParams.tiepoints_.push_back( tpsMapIt->second );
+        }
+        
+        ++selectedTpsCounter;
+      }
+
+      /* Trying to generate a valid base consensus transformation with the 
+      selected points */      
+      
+      if( computeParameters( consensusSetParams ) ) 
+      {
+//        consecutiveInvalidBaseSetsLeft = maxConsecutiveInvalidBaseSets;
+        
+        // finding those tie-points in agreement with the generated
+        // consensus basic transformation
+
+        consensusSetParams.tiepoints_.clear();
+        consensusSetDRMSE = 0;
+        consensusSetIRMSE = 0;
+        consensusSetMaxDMapErr = 0;
+        consensusSetMaxIMapErr = 0;
+
+        for( inputTpIdx = 0 ; inputTpIdx < inputTPNmb ; ++inputTpIdx )
+        {
+          const TeCoordPair& curTP = inputParams.tiepoints_[ inputTpIdx ];
+          
+          tiePointDMapErr = getDirectMappingError( curTP, consensusSetParams );
+          tiePointIMapErr = getInverseMappingError( curTP, consensusSetParams );
+
+          if( ( tiePointDMapErr < maxDMapErr ) && 
+            ( tiePointIMapErr < maxIMapErr ) )
+          {
+            consensusSetParams.tiepoints_.push_back( curTP );
+            consensusSetDRMSE += ( tiePointDMapErr * tiePointDMapErr );
+            consensusSetIRMSE += ( tiePointIMapErr * tiePointIMapErr );
+            if( tiePointDMapErr > consensusSetMaxDMapErr )
+              consensusSetMaxDMapErr = tiePointDMapErr;
+            if( tiePointIMapErr > consensusSetMaxIMapErr )
+              consensusSetMaxIMapErr = tiePointIMapErr;              
+          }
+        }
+        
+        consensusSetDRMSE = sqrt( consensusSetDRMSE );
+        consensusSetIRMSE = sqrt( consensusSetIRMSE );
+        
+        consensusSetIRMSEDiff = ABS( bestParamsIRMSE - consensusSetIRMSE );
+        consensusSetDRMSEDiff = ABS( bestParamsDRMSE - consensusSetDRMSE );
+
+        /* Is this an acceptable consensus set ?? */      
+        
+        if( ( consensusSetDRMSE < maxDRMSE ) &&
+            ( consensusSetIRMSE < maxIRMSE ) &&
+            ( consensusSetMaxDMapErr < maxDMapErr ) &&
+            ( consensusSetMaxIMapErr < maxIMapErr ) )
+        {
+          // Is this consensus set better than the current better one ??
+          // (by using the number of tie-points as parameter
+          // since we are interested in consensus sets with
+          // the higher number of tie-points
+        
+          if( consensusSetParams.tiepoints_.size() >
+              bestParams.tiepoints_.size() )
+          {
+            bestParams = consensusSetParams;
+            bestParamsDRMSE = consensusSetDRMSE;
+            bestParamsIRMSE = consensusSetIRMSE;
+            bestParamsMaxDMapErr = consensusSetMaxDMapErr;
+            bestParamsMaxIMapErr = consensusSetMaxIMapErr;
+            
+            consecutiveValidBaseSets = 0;
+            
+            consecutiveInvalidBaseSetsLeft = maxConsecutiveInvalidBaseSets;
+          }
+          else if( 
+                     ( 
+                       consensusSetParams.tiepoints_.size() == 
+                       bestParams.tiepoints_.size() 
+                     )
+                     &&
+                     ( consensusSetDRMSE < bestParamsDRMSE ) 
+                     &&
+                     ( consensusSetIRMSE < bestParamsIRMSE ) 
+                   )
+          {
+            bestParams = consensusSetParams;
+            bestParamsDRMSE = consensusSetDRMSE;
+            bestParamsIRMSE = consensusSetIRMSE;
+            bestParamsMaxDMapErr = consensusSetMaxDMapErr;
+            bestParamsMaxIMapErr = consensusSetMaxIMapErr;              
+            
+            ++consecutiveValidBaseSets;
+            
+            consecutiveInvalidBaseSetsLeft = maxConsecutiveInvalidBaseSets;            
+          }
+          else
+          {
+            // This consensus set isn't good enough
+                        
+            --consecutiveInvalidBaseSetsLeft;
+          }
+        }
+        else
+        {
+          /* This isn't an acceptable consensus */           
+
+          --consecutiveInvalidBaseSetsLeft;
+        }
+      } 
+      else
+      {
+        // decrement the number of remaining consecutive
+        // invalid base sets left
+                    
+        --consecutiveInvalidBaseSetsLeft;
+
+      }
+      
+                        
+      if( consecutiveInvalidBaseSetsLeft  == 0 ) break;
+      
+      if( ( consecutiveValidBaseSets > minConsecutiveValidBaseSets ) &&
+        ( consensusSetDRMSEDiff < consecValidBaseSetsDRMSEThr ) &&
+        ( consensusSetIRMSEDiff < consecValidBaseSetsIRMSEThr ) )
+      {
+        break;
+      }
+      
+      --iterationsLeft;
+    }
+    
+    if( bestParams.tiepoints_.size() >= reqTPsNmb )
+    {
+      outputParams = bestParams;
+      
+      return true;
+    }
+    else
+    {
+      return false;
+    }
+  }
+}
+
+bool TeGeometricTransformation::normalizeTPWeights( 
+  std::vector< double >& tpWeights ) const
+{
+  const unsigned int size = (unsigned int)tpWeights.size();
+  
+  if( size )
+  {
+    double wSum = 0;
+    unsigned int idx = 0;
+    
+    for( ; idx < size ; ++idx )
+    {
+      if( tpWeights[ idx ] < 0.0 ) return false;
+
+      wSum += tpWeights[ idx ];
+    }
+    
+    if( wSum > 0.0 )
+    {
+      for( idx = 0 ; idx < size ; ++idx )
+      {
+        tpWeights[ idx ] /= wSum;
+      }
+    }
+  }
+
+  return true;
+}
diff --git a/src/terralib/kernel/TeGeometricTransformation.h b/src/terralib/kernel/TeGeometricTransformation.h
old mode 100755
new mode 100644
index 9c1201d..a12cff0
--- a/src/terralib/kernel/TeGeometricTransformation.h
+++ b/src/terralib/kernel/TeGeometricTransformation.h
@@ -1,486 +1,529 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeGeometricTransformation.h
-   \brief Geometric trasformations base class.
-*/
-
-#ifndef TEGEOMETRICTRANSFORMATION_H
-  #define TEGEOMETRICTRANSFORMATION_H
-  
-  #include "TeDefines.h"
-  #include "TeCoord2D.h"
-  #include "TeMatrix.h"
-  #include "TeGTParams.h"
-  #include "TeSharedPtr.h"
-  #include "TeAgnostic.h"
-  #include "TeThreadParameters.h"
-  
-  #include <vector>
-  #include <list>
-  
-  /**
-   * @brief This is the base class to deal with a geometric trasformation
-   * direct and inverse mapping the tie-points TeCoordPair::pt1 space into 
-   * TeCoordPair::pt2 space.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup Utils
-   */
-  class TL_DLL TeGeometricTransformation {
-    private :
-    
-      /**
-       * @brief The current internal parameters.
-       */
-      TeGTParams internal_params_;
-          
-    protected :
-    
-      /**
-       * @brief Verifies if the supplied parameters already
-       * has a defined transformation.
-       * @param params Transformation parameters.
-       * @return true if a transformation is already defined, 
-       * false otherwise.
-       */       
-      virtual bool isTransDefined( const TeGTParams& params ) 
-        const = 0;  
-            
-    public :
-
-      /** 
-       * @typedef TeSharedPtr< TeGeometricTransformation > pointer
-       * Type definition for a TeGeometricTransformation instance pointer. 
-       */
-      typedef TeSharedPtr< TeGeometricTransformation > pointer;
-      
-      /**
-       * @brief Default Destructor
-       */
-      virtual ~TeGeometricTransformation();
-      
-      /**
-       * @brief Direct mapping ( from pt1 space into pt2 space ).
-       *
-       * @param pt1 pt1 coordinate.
-       * @param pt2 pt2 coordinate.
-       */      
-      inline void directMap( const TeCoord2D& pt1, TeCoord2D& pt2 ) const
-      {
-        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
-          "Transformation not defined" )
-        
-        directMap( internal_params_, pt1, pt2 );
-      };
-      
-      /**
-       * @brief Inverse mapping ( from pt2 space into pt1 space ).
-       *
-       * @param pt2 pt2 coordinate.
-       * @param pt1 pt1 coordinate.
-       */      
-      inline void inverseMap( const TeCoord2D& pt2, 
-        TeCoord2D& pt1 ) const
-      {
-        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
-          "Transformation not defined" )         
-      
-        inverseMap( internal_params_, pt2, pt1 );
-      };
-      
-      /**
-       * @brief Reset the current transformation following the new supplied 
-       * parameters.
-       *
-       * @param newparams The new parameters.
-       * @return true if OK, false on errors.
-       */      
-      bool reset( const TeGTParams& newparams );
-      
-      /**
-       * @brief Returns a copy of the current internal transformation parameters.
-       *
-       * @param params The internal parameters copy.
-       */        
-      void getParameters( TeGTParams& params ) const;
-      
-      /**
-       * @brief Calculates the current transformation maximum direct mapping 
-       * error ( from pt1 space into pt2 space ).
-       *
-       * @return The current maximum direct mapping error.
-       */        
-      inline double getDirectMappingError() const
-      {
-        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
-          "Transformation not defined" )
-        
-        return getDirectMappingError( internal_params_ );
-      };
-      
-      /**
-       * @brief Calculates the current transformation maximum inverse mapping 
-       * error ( from pt2 space into pt1 space ).
-       *
-       * @return The current maximum inverse mapping error.
-       */        
-      inline double getInverseMappingError() const
-      {
-        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
-          "Transformation not defined" )
-        
-        return getInverseMappingError( internal_params_ );
-      };     
-      
-      /**
-       * @brief Calculates root mean square direct mapping error 
-       * ( from pt1 space into pt2 space ).
-       *
-       * @return The root mean square error.
-       */        
-      inline double getDMapRMSE() const
-      {
-        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
-          "Transformation not defined" )
-        
-        return getDMapRMSE( internal_params_ );
-      };        
-      
-      /**
-       * @brief Calculates root mean square inverse mapping error
-       * ( from pt2 space into pt1 space ).
-       *
-       * @return The root mean square error.
-       */        
-      inline double getIMapRMSE() const
-      {
-        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
-          "Transformation not defined" )
-        
-        return getIMapRMSE( internal_params_ );
-      };
-      
-      /**
-       * @brief Calculates the direct mapping error for the supplied tie-point
-       * ( from pt1 space into pt2 space ).
-       *
-       * @param tie_point The tie-point.
-       * @return The current direct mapping error.
-       */        
-      inline double getDirectMappingError( const TeCoordPair& tie_point ) const
-      {
-        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
-          "Transformation not defined" )
-      
-        return getDirectMappingError( tie_point, internal_params_ );      
-      };
-      
-      /**
-       * @brief Calculates the inverse mapping error for the supplied tie-point
-       * ( from pt2 space into pt1 space ).
-       *
-       * @param tie_point The tie-point.
-       * @return The current inverse mapping error.
-       */        
-      inline double getInverseMappingError( const TeCoordPair& tie_point ) const
-      {
-        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
-          "Transformation not defined" )
-      
-        return getInverseMappingError( tie_point, internal_params_ );      
-      };      
-      
-      /**
-       * @brief Returns the minimum number of required tie-points for the current
-       * transformation.
-       *
-       * @return The minimum number of required tie-points for the current
-       * transformation.
-       */       
-      virtual unsigned int getMinRequiredTiePoints() const = 0;      
-      
-      /**
-       * @brief Returns a default object.
-       *
-       * @return A default object.
-       */
-      static TeGeometricTransformation* DefaultObject( 
-        const TeGTParams& );
-
-    protected :
-    
-      /**
-       * @brief Default Constructor.
-       */
-      TeGeometricTransformation();
-      
-      /**
-       * @brief Direct mapping ( from pt1 space into pt2 space ).
-       *
-       * @param params Transformation parameters.
-       * @param pt1 pt1 coordinate.
-       * @param pt2 pt2 coordinate.
-       */      
-      virtual void directMap( const TeGTParams& params,
-        const TeCoord2D& pt1, TeCoord2D& pt2 ) const = 0;
-      
-      /**
-       * @brief Inverse mapping ( from pt2 space into pt1 space ).
-       *
-       * @param params Transformation parameters.
-       * @param pt2 pt2 coordinate.
-       * @param pt1 pt1 coordinate.
-       */      
-      virtual void inverseMap( const TeGTParams& params,
-        const TeCoord2D& pt2, 
-        TeCoord2D& pt1 ) const = 0;      
-      
-      /**
-       * @brief Calculate the transformation parameters following the
-       * new supplied tie-points.
-       *
-       * @param params Transformation parameters.
-       * @return true if OK, false on errors.
-       */       
-      virtual bool computeParameters( TeGTParams& params ) 
-        const = 0;
-        
-      /**
-       * @brief Calculates maximum direct mapping error for the supplied 
-       * parameters ( from pt1 space into pt2 space ).
-       *
-       * @param params Transformation parameters.       
-       * @return The maximum direct mapping error for the supplied parameters.
-       */        
-      double getDirectMappingError( const TeGTParams& params ) const;        
-      
-      /**
-       * @brief Calculates maximum inverse mapping error for the supplied 
-       * parameters ( from pt2 space into pt1 space ).
-       *
-       * @param params Transformation parameters.       
-       * @return The maximum inverse mapping error for the supplied parameters.
-       */        
-      double getInverseMappingError( const TeGTParams& params ) const;      
-      
-      /**
-       * @brief Calculates root mean square direct mapping error for the supplied 
-       * parameters ( from pt1 space into pt2 space ).
-       *
-       * @param params Transformation parameters.       
-       * @return The root mean square error.
-       */        
-      double getDMapRMSE( const TeGTParams& params ) const;        
-      
-      /**
-       * @brief Calculates root mean square inverse mapping error for the supplied 
-       * parameters ( from pt2 space into pt1 space ).
-       *
-       * @param params Transformation parameters.       
-       * @return The root mean square error.
-       */        
-      double getIMapRMSE( const TeGTParams& params ) const;       
-        
-      /**
-       * @brief Calculates the direct mapping error for the supplied tie-point.
-       * ( from pt1 space into pt2 space ).
-       *
-       * @param tie_point The tie-point.
-       * @param params Transformation parameters.        
-       * @return The current maximum direct mapping error.
-       */        
-      double getDirectMappingError( const TeCoordPair& tie_point,
-        const TeGTParams& params ) const;
-
-      /**
-       * @brief Calculates the inverse mapping error for the supplied tie-point.
-       * ( from pt2 space into pt1 space ).
-       *
-       * @param tie_point The tie-point.
-       * @param params Transformation parameters.        
-       * @return The current maximum inverse mapping error.
-       */        
-      double getInverseMappingError( const TeCoordPair& tie_point,
-        const TeGTParams& params ) const;
-                
-    private :
-    
-      /**
-       * @brief Excluded tie-points data.
-       */    
-      class ExcTPDataNode
-      {
-        public :
-          TeCoordPair tp_;
-          double dmap_error_;
-          double imap_error_;
-          double norm_error_;   
-          
-          ExcTPDataNode()
-          {
-            dmap_error_ = imap_error_ = norm_error_ = 0.0;
-          }     
-          
-          ExcTPDataNode( const ExcTPDataNode& other )
-          {
-            tp_ = other.tp_;
-            dmap_error_ = other.dmap_error_;
-            imap_error_ = other.imap_error_;
-            norm_error_ = other.norm_error_;
-          }
-          
-          const ExcTPDataNode& operator=( const ExcTPDataNode& other )
-          {
-            tp_ = other.tp_;
-            dmap_error_ = other.dmap_error_;
-            imap_error_ = other.imap_error_;
-            norm_error_ = other.norm_error_;
-            
-            return other;
-          }
-          
-          bool operator< ( const ExcTPDataNode& other ) const
-          {
-            return ( ( norm_error_ < other.norm_error_ ) ? true : false );
-          }
-      };
-      
-      /**
-       * @brief Tie-points data.
-       */    
-      class TPDataNode
-      {
-        public :
-          unsigned int tpindex_;
-          double dmap_error_;
-          double imap_error_;
-          double norm_error_;
-          
-          TPDataNode()
-          {
-            dmap_error_ = imap_error_ = norm_error_ = 0.0;
-            tpindex_ = 0;
-          }     
-          
-          TPDataNode( const TPDataNode& other )
-          {
-            tpindex_ = other.tpindex_;
-            dmap_error_ = other.dmap_error_;
-            imap_error_ = other.imap_error_;
-            norm_error_ = other.norm_error_;
-          }
-          
-          const TPDataNode& operator=( const TPDataNode& other )
-          {
-            tpindex_ = other.tpindex_;
-            dmap_error_ = other.dmap_error_;
-            imap_error_ = other.imap_error_;
-            norm_error_ = other.norm_error_;
-            
-            return other;
-          }
-                    
-          bool operator< ( const TPDataNode& other ) const
-          {
-            return ( ( norm_error_ < other.norm_error_ ) ? true : false );
-          }
-      };      
-    
-      /**
-       * @brief Operator= overload.
-       *
-       * @param external External instance reference.
-       *
-       * @return The external instance reference.
-       */        
-      const TeGeometricTransformation& operator=( 
-        const TeGeometricTransformation& ) { return *this; };
-        
-      /**
-       * @brief Recombine a seed vector without repetition (the number of combined 
-       * elements on each iteration will follow the vectors size.
-       *
-       * @param seed Seed vector.
-       * @param elements_nmb Number of elements to be permutated
-       * @param seedpos Location inside the seed vector where to begin
-       * the permutation.
-       * @return TRUE if a permutation was made, FALSE if no more
-       * permutation are left to made.
-       *
-       * @note All initial fields must be set to value 0 for the initial seed.
-      */
-      static bool recombineSeed( std::vector<unsigned int>& seed, 
-        const unsigned int& seedpos, const unsigned int& elements_nmb );        
-        
-      /**
-       * @brief Multi-thread exaustive outliers remotion 
-       * strategy (All tie-points
-       * combinations will be tested).
-       * @param params The current transformation parameters.
-       * @param threads_nmb Threads number (not including the
-       * curent process).
-       * @return TRUE if OK, false on errors.
-      */        
-      bool exaustiveOutRemotion( TeGTParams& params,
-        unsigned int threads_nmb );      
-        
-      /**
-       * @brief Exaustive outliers remotion thread entry. 
-       * @param params Thread parameters.
-       * @return TRUE if OK, false on errors.
-      */        
-      static bool eORThreadEntry( const TeThreadParameters& 
-        params );          
-      
-      /**
-       * @brief Leave-worse-out outliers remotion strategy 
-       * (On each iteration the worse tie-point will be
-       * removed).
-       * @param params The current transformation parameters.
-       * @return TRUE if OK, false on errors.
-      */        
-      bool LWAOutRemotion( TeGTParams& params );   
-      
-      /**
-       * @brief Update the excluded tie-points errors following
-       * the supplied transformation parameters.
-       * @param params The current transformation parameters.
-       * @param exc_tp_list The excluded tie-points list (the first element
-       * has the lower normalized error.
-      */       
-      void updateExcTPErrList( const TeGTParams& params,
-        std::list< ExcTPDataNode >& exc_tp_list ) const;
-        
-      /**
-       * @brief Recalc the tie-points errors vector
-       * the supplied transformation parameters.
-       * @param params The current transformation parameters.
-       * @param errvec The tie-points vector (the first element
-       * has the lower normalized error).
-      */       
-      void updateTPErrVec( const TeGTParams& params,
-        std::vector< TPDataNode >& errvec ) const;        
-
-  };
-  
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGeometricTransformation.h
+   \brief Geometric trasformations base class.
+*/
+
+#ifndef TEGEOMETRICTRANSFORMATION_H
+  #define TEGEOMETRICTRANSFORMATION_H
+  
+  #include "TeDefines.h"
+  #include "TeCoord2D.h"
+  #include "TeMatrix.h"
+  #include "TeGTParams.h"
+  #include "TeSharedPtr.h"
+  #include "TeAgnostic.h"
+  #include "TeThreadParameters.h"
+  
+  #include <vector>
+  #include <list>
+  
+  /**
+   * @brief This is the base class to deal with a geometric trasformation
+   * direct and inverse mapping the tie-points TeCoordPair::pt1 space into 
+   * TeCoordPair::pt2 space.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup GeometricTransformationGroup
+   */
+  class TL_DLL TeGeometricTransformation {
+    private :
+    
+      /**
+       * @brief The current internal parameters.
+       */
+      TeGTParams internal_params_;
+          
+    protected :
+    
+      /**
+       * @brief Verifies if the supplied parameters already
+       * has a defined transformation.
+       * @param params Transformation parameters.
+       * @return true if a transformation is already defined, 
+       * false otherwise.
+       */       
+      virtual bool isTransDefined( const TeGTParams& params ) 
+        const = 0;  
+            
+    public :
+
+      /** 
+       * @typedef TeSharedPtr< TeGeometricTransformation > pointer
+       * Type definition for a TeGeometricTransformation instance pointer. 
+       */
+      typedef TeSharedPtr< TeGeometricTransformation > pointer;
+      
+      /**
+       * @brief Default Destructor
+       */
+      virtual ~TeGeometricTransformation();
+      
+      /**
+       * @brief Direct mapping ( from pt1 space into pt2 space ).
+       *
+       * @param pt1 pt1 coordinate.
+       * @param pt2 pt2 coordinate.
+       */      
+      inline void directMap( const TeCoord2D& pt1, TeCoord2D& pt2 ) const
+      {
+        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
+          "Transformation not defined" )
+        
+        directMap( internal_params_, pt1, pt2 );
+      };
+      
+      /**
+       * @brief Inverse mapping ( from pt2 space into pt1 space ).
+       *
+       * @param pt2 pt2 coordinate.
+       * @param pt1 pt1 coordinate.
+       */      
+      inline void inverseMap( const TeCoord2D& pt2, 
+        TeCoord2D& pt1 ) const
+      {
+        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
+          "Transformation not defined" )         
+      
+        inverseMap( internal_params_, pt2, pt1 );
+      };
+      
+      /**
+       * @brief Reset the current transformation following the new supplied 
+       * parameters.
+       *
+       * @param newparams The new parameters.
+       * @return true if OK, false on errors.
+       */      
+      bool reset( const TeGTParams& newparams );
+      
+      /**
+       * @brief Returns a copy of the current internal transformation parameters.
+       *
+       * @param params The internal parameters copy.
+       */        
+      void getParameters( TeGTParams& params ) const;
+      
+      /**
+       * @brief Returns a reference of the current internal transformation parameters.
+       *
+       * @return A reference of the current internal transformation parameters..
+       */        
+      const TeGTParams& getParameters() const;      
+      
+      /**
+       * @brief Calculates the current transformation maximum direct mapping 
+       * error ( from pt1 space into pt2 space ).
+       *
+       * @return The current maximum direct mapping error.
+       */        
+      inline double getDirectMappingError() const
+      {
+        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
+          "Transformation not defined" )
+        
+        return getDirectMappingError( internal_params_ );
+      };
+      
+      /**
+       * @brief Calculates the current transformation maximum inverse mapping 
+       * error ( from pt2 space into pt1 space ).
+       *
+       * @return The current maximum inverse mapping error.
+       */        
+      inline double getInverseMappingError() const
+      {
+        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
+          "Transformation not defined" )
+        
+        return getInverseMappingError( internal_params_ );
+      };     
+      
+      /**
+       * @brief Calculates root mean square direct mapping error 
+       * ( from pt1 space into pt2 space ).
+       *
+       * @return The root mean square error.
+       */        
+      inline double getDMapRMSE() const
+      {
+        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
+          "Transformation not defined" )
+        
+        return getDMapRMSE( internal_params_ );
+      };        
+      
+      /**
+       * @brief Calculates root mean square inverse mapping error
+       * ( from pt2 space into pt1 space ).
+       *
+       * @return The root mean square error.
+       */        
+      inline double getIMapRMSE() const
+      {
+        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
+          "Transformation not defined" )
+        
+        return getIMapRMSE( internal_params_ );
+      };
+      
+      /**
+       * @brief Calculates the direct mapping error for the supplied tie-point
+       * ( from pt1 space into pt2 space ).
+       *
+       * @param tie_point The tie-point.
+       * @return The current direct mapping error.
+       */        
+      inline double getDirectMappingError( const TeCoordPair& tie_point ) const
+      {
+        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
+          "Transformation not defined" )
+      
+        return getDirectMappingError( tie_point, internal_params_ );      
+      };
+      
+      /**
+       * @brief Calculates the inverse mapping error for the supplied tie-point
+       * ( from pt2 space into pt1 space ).
+       *
+       * @param tie_point The tie-point.
+       * @return The current inverse mapping error.
+       */        
+      inline double getInverseMappingError( const TeCoordPair& tie_point ) const
+      {
+        TEAGN_DEBUG_CONDITION( isTransDefined( internal_params_ ),
+          "Transformation not defined" )
+      
+        return getInverseMappingError( tie_point, internal_params_ );      
+      };      
+      
+      /**
+       * @brief Returns the minimum number of required tie-points for the current
+       * transformation.
+       *
+       * @return The minimum number of required tie-points for the current
+       * transformation.
+       */       
+      virtual unsigned int getMinRequiredTiePoints() const = 0;      
+      
+      /**
+       * @brief Returns a default object.
+       *
+       * @return A default object.
+       */
+      static TeGeometricTransformation* DefaultObject( 
+        const TeGTParams& );
+
+    protected :
+    
+      /**
+       * @brief Default Constructor.
+       */
+      TeGeometricTransformation();
+      
+      /**
+       * @brief Direct mapping ( from pt1 space into pt2 space ).
+       *
+       * @param params Transformation parameters.
+       * @param pt1 pt1 coordinate.
+       * @param pt2 pt2 coordinate.
+       */      
+      virtual void directMap( const TeGTParams& params,
+        const TeCoord2D& pt1, TeCoord2D& pt2 ) const = 0;
+      
+      /**
+       * @brief Inverse mapping ( from pt2 space into pt1 space ).
+       *
+       * @param params Transformation parameters.
+       * @param pt2 pt2 coordinate.
+       * @param pt1 pt1 coordinate.
+       */      
+      virtual void inverseMap( const TeGTParams& params,
+        const TeCoord2D& pt2, 
+        TeCoord2D& pt1 ) const = 0;      
+      
+      /**
+       * @brief Calculate the transformation parameters following the
+       * new supplied tie-points.
+       *
+       * @param params Transformation parameters.
+       * @return true if OK, false on errors.
+       */       
+      virtual bool computeParameters( TeGTParams& params ) 
+        const = 0;
+        
+      /**
+       * @brief Calculates maximum direct mapping error for the supplied 
+       * parameters ( from pt1 space into pt2 space ).
+       *
+       * @param params Transformation parameters.       
+       * @return The maximum direct mapping error for the supplied parameters.
+       */        
+      double getDirectMappingError( const TeGTParams& params ) const;        
+      
+      /**
+       * @brief Calculates maximum inverse mapping error for the supplied 
+       * parameters ( from pt2 space into pt1 space ).
+       *
+       * @param params Transformation parameters.       
+       * @return The maximum inverse mapping error for the supplied parameters.
+       */        
+      double getInverseMappingError( const TeGTParams& params ) const;      
+      
+      /**
+       * @brief Calculates root mean square direct mapping error for the supplied 
+       * parameters ( from pt1 space into pt2 space ).
+       *
+       * @param params Transformation parameters.       
+       * @return The root mean square error.
+       */        
+      double getDMapRMSE( const TeGTParams& params ) const;        
+      
+      /**
+       * @brief Calculates root mean square inverse mapping error for the supplied 
+       * parameters ( from pt2 space into pt1 space ).
+       *
+       * @param params Transformation parameters.       
+       * @return The root mean square error.
+       */        
+      double getIMapRMSE( const TeGTParams& params ) const;       
+        
+      /**
+       * @brief Calculates the direct mapping error for the supplied tie-point.
+       * ( from pt1 space into pt2 space ).
+       *
+       * @param tie_point The tie-point.
+       * @param params Transformation parameters.        
+       * @return The current maximum direct mapping error.
+       */        
+      double getDirectMappingError( const TeCoordPair& tie_point,
+        const TeGTParams& params ) const;
+
+      /**
+       * @brief Calculates the inverse mapping error for the supplied tie-point.
+       * ( from pt2 space into pt1 space ).
+       *
+       * @param tie_point The tie-point.
+       * @param params Transformation parameters.        
+       * @return The current maximum inverse mapping error.
+       */        
+      double getInverseMappingError( const TeCoordPair& tie_point,
+        const TeGTParams& params ) const;
+                
+    private :
+    
+      /**
+       * @brief RANSAC iterations counter type.
+       */        
+      typedef unsigned int RansacItCounterT;
+    
+      /**
+       * @brief Excluded tie-points data.
+       */    
+      class ExcTPDataNode
+      {
+        public :
+          TeCoordPair tp_;
+          /*! Tie point original weight (from user parameters) */
+          double tp_weight_;
+          
+          double dmap_error_;
+          double imap_error_;
+          
+          /*! Tie point error */
+          double tp_error_;   
+          
+          ExcTPDataNode()
+          {
+            tp_weight_ = dmap_error_ = imap_error_ = tp_error_ = 0.0;
+          }     
+          
+          ExcTPDataNode( const ExcTPDataNode& other )
+          {
+            tp_ = other.tp_;
+            tp_weight_ = other.tp_weight_;
+            dmap_error_ = other.dmap_error_;
+            imap_error_ = other.imap_error_;
+            tp_error_ = other.tp_error_;
+          }
+          
+          const ExcTPDataNode& operator=( const ExcTPDataNode& other )
+          {
+            tp_ = other.tp_;
+            tp_weight_ = other.tp_weight_;
+            dmap_error_ = other.dmap_error_;
+            imap_error_ = other.imap_error_;
+            tp_error_ = other.tp_error_;
+            
+            return other;
+          }
+          
+          bool operator< ( const ExcTPDataNode& other ) const
+          {
+            return ( ( tp_error_ < other.tp_error_ ) ? true : false );
+          }
+      };
+      
+      /**
+       * @brief Tie-points data.
+       */    
+      class TPDataNode
+      {
+        public :
+          unsigned int tpindex_;
+          double dmap_error_;
+          double imap_error_;
+          
+          /*! Tie point error */
+          double tp_error_;
+          
+          TPDataNode()
+          {
+            dmap_error_ = imap_error_ = tp_error_ = 0.0;
+            tpindex_ = 0;
+          }     
+          
+          TPDataNode( const TPDataNode& other )
+          {
+            tpindex_ = other.tpindex_;
+            dmap_error_ = other.dmap_error_;
+            imap_error_ = other.imap_error_;
+            tp_error_ = other.tp_error_;
+          }
+          
+          const TPDataNode& operator=( const TPDataNode& other )
+          {
+            tpindex_ = other.tpindex_;
+            dmap_error_ = other.dmap_error_;
+            imap_error_ = other.imap_error_;
+            tp_error_ = other.tp_error_;
+            
+            return other;
+          }
+                    
+          bool operator< ( const TPDataNode& other ) const
+          {
+            return ( ( tp_error_ < other.tp_error_ ) ? true : false );
+          }
+      };      
+    
+      /**
+       * @brief Operator= overload.
+       *
+       * @param external External instance reference.
+       *
+       * @return The external instance reference.
+       */        
+      const TeGeometricTransformation& operator=( 
+        const TeGeometricTransformation& ) { return *this; };
+        
+      /**
+       * @brief Recombine a seed vector without repetition (the number of combined 
+       * elements on each iteration will follow the vectors size.
+       *
+       * @param seed Seed vector.
+       * @param elements_nmb Number of elements to be permutated
+       * @param seedpos Location inside the seed vector where to begin
+       * the permutation.
+       * @return TRUE if a permutation was made, FALSE if no more
+       * permutation are left to made.
+       *
+       * @note All initial fields must be set to value 0 for the initial seed.
+      */
+      static bool recombineSeed( std::vector<unsigned int>& seed, 
+        const unsigned int& seedpos, const unsigned int& elements_nmb );        
+        
+      /**
+       * @brief Multi-thread exaustive outliers remotion 
+       * strategy (All tie-points
+       * combinations will be tested).
+       * @param params The current transformation parameters.
+       * @param threads_nmb Threads number (not including the
+       * curent process).
+       * @return TRUE if OK, false on errors.
+      */        
+      bool exaustiveOutRemotion( TeGTParams& params,
+        unsigned int threads_nmb );      
+        
+      /**
+       * @brief Exaustive outliers remotion thread entry. 
+       * @param params Thread parameters.
+       * @return TRUE if OK, false on errors.
+      */        
+      static bool eORThreadEntry( const TeThreadParameters& 
+        params );          
+      
+      /**
+       * @brief Leave-worse-out outliers remotion strategy 
+       * (On each iteration the worse tie-point will be
+       * removed).
+       * @param params The current transformation parameters.
+       * @return TRUE if OK, false on errors.
+      */        
+      bool lWOutRemotion( TeGTParams& params );   
+      
+      /**
+       * @brief Update the excluded tie-points errors following
+       * the supplied transformation parameters.
+       * @param params The current transformation parameters.
+       * @param useTPWeights Use the tie-points error vector.
+       * @param exc_tp_list The excluded tie-points list (the first element
+       * has the lower normalized error.
+      */       
+      void updateExcTPErrList( const TeGTParams& params,
+        bool useTPWeights,
+        std::list< ExcTPDataNode >& exc_tp_list ) const;
+        
+      /**
+       * @brief Recalc the tie-points errors vector
+       * the supplied transformation parameters.
+       * @param params The current transformation parameters.
+       * @param useTPWeights Use the tie-points error vector.
+       * @param errvec The tie-points vector (the first element
+       * has the lower normalized error).
+      */       
+      void updateTPErrVec( const TeGTParams& params,
+        bool useTPWeights,
+        std::vector< TPDataNode >& errvec ) const;   
+             
+      /**
+       * @brief Random Sample Consensus based outliers remotion.
+       * @param inputParams The current transformation parameters.
+       * @param outputParams The output transformation parameters.
+       * @return TRUE if OK, false on errors.
+      */                 
+      bool ransacRemotion( const TeGTParams& inputParams,
+        TeGTParams& outputParams ) const;
+      
+             
+      /**
+       * @brief Normalize the tie-points weights in such a way
+       * that the sum of all of then is 1.
+       * @param tpWeights The tie-points weights.
+       * @return true if OK, false on errors.
+      */                 
+      bool normalizeTPWeights( std::vector< double >& tpWeights ) const;
+
+  };
+  
+#endif
+
diff --git a/src/terralib/kernel/TeGeometry.cpp b/src/terralib/kernel/TeGeometry.cpp
old mode 100755
new mode 100644
index 5abf4c1..c5e037a
--- a/src/terralib/kernel/TeGeometry.cpp
+++ b/src/terralib/kernel/TeGeometry.cpp
@@ -1,146 +1,146 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeGeometry.h"
-#include "TeException.h"
-
-// TeLine2D
-
-bool
-TeLine2D::isRing() const
-{
-	if ( size() <= 3 )
-			return false;
-		return ( pImpl_->operator[] (0) == pImpl_->operator[] ( pImpl_->size() - 1 ) );
-
-}
-
-
-// TeLinearRing
-
-TeLinearRing::TeLinearRing ( TeLine2D& line ): TeLine2D ( line ) 
-{
-	if ( ! line.isRing() )
-	{
-		line.add (line[0]);
-//		throw TeException ( LINE_IS_NOT_RING );
-	}
-}
-
-
-ostream& operator<<(ostream& os, TeNode& N)
-{
-	os << Te2String(N.geomId());
-    return os;
-}
-
-ostream& operator<<(ostream& os, const TeArc& N)
-{
-	TeArc a = N;
-	os << a.objectId();
-    return os;
-}
-
-void 
-TeLineSet::copyElements ( const TeLineSet& other )
-{
-	geomId_ = other.geomId();
-	objectId_ = other.objectId();
-
-	for (unsigned int i=0; i<other.size(); ++i) // for each line
-	{
-		TeLine2D line; 
-		line.copyElements(other[i]);
-		this->add (line);
-	}
-}
-
-void 
-TePolygon::copyElements ( const TePolygon& other )
-{
-	geomId_ = other.geomId();
-	objectId_ = other.objectId();
-
-	for (unsigned int i = 0; i < other.size(); ++i) // for each linear ring
-	{
-		TeLine2D line; 
-		line.copyElements(other[i]);
-		this->add (line);
-	}
-}
-
-
-void 
-TePolygonSet::copyElements ( const TePolygonSet& other )
-{
-	geomId_ = other.geomId();
-	objectId_ = other.objectId();
-
-	for (unsigned int i = 0; i < other.size(); ++i) // for each polygon
-	{
-		TePolygon poly;
-		poly.copyElements (other[i]);
-		this->add (poly);
-	}
-}
-
-
-TePointSet makePointSet( const TeLinearRing& lr )
-{
-  TePointSet outps;
-  TePoint temp_point;
-  
-  const unsigned int lr_size = lr.size();
-  
-  for( unsigned int lr_index = 0 ; lr_index < lr_size ; ++lr_index ) {
-    TePoint temp_point;
-    temp_point.add( lr[ lr_index ] );
-    
-    outps.add( temp_point );
-  }
-  
-  return outps;
-}
-
-
-TePointSet makePointSet( const TePolygon& p )
-{
-  TePointSet outps;
-
-  const unsigned int p_size = p.size();
-  unsigned p_index = 0;
-  unsigned int lrps_size = 0;
-  unsigned int lrps_index = 0;
-  
-  for( p_index = 0 ; p_index < p_size ; ++p_index ) {
-    TePointSet lrps = makePointSet( p[ p_index ] );
-    lrps_size = lrps.size();
-  
-    for( lrps_index = 0 ; lrps_index < lrps_size ; ++lrps_index ) {
-      outps.add( lrps[ lrps_index ] );
-    }
-  }
-  
-  return outps;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeGeometry.h"
+#include "TeException.h"
+
+// TeLine2D
+
+bool
+TeLine2D::isRing() const
+{
+	if ( size() <= 3 )
+			return false;
+		return ( pImpl_->operator[] (0) == pImpl_->operator[] ( pImpl_->size() - 1 ) );
+
+}
+
+
+// TeLinearRing
+
+TeLinearRing::TeLinearRing ( TeLine2D& line ): TeLine2D ( line ) 
+{
+	if ( ! line.isRing() )
+	{
+		line.add (line[0]);
+//		throw TeException ( LINE_IS_NOT_RING );
+	}
+}
+
+
+ostream& operator<<(ostream& os, TeNode& N)
+{
+	os << Te2String(N.geomId());
+    return os;
+}
+
+ostream& operator<<(ostream& os, const TeArc& N)
+{
+	TeArc a = N;
+	os << a.objectId();
+    return os;
+}
+
+void 
+TeLineSet::copyElements ( const TeLineSet& other )
+{
+	geomId_ = other.geomId();
+	objectId_ = other.objectId();
+
+	for (unsigned int i=0; i<other.size(); ++i) // for each line
+	{
+		TeLine2D line; 
+		line.copyElements(other[i]);
+		this->add (line);
+	}
+}
+
+void 
+TePolygon::copyElements ( const TePolygon& other )
+{
+	geomId_ = other.geomId();
+	objectId_ = other.objectId();
+
+	for (unsigned int i = 0; i < other.size(); ++i) // for each linear ring
+	{
+		TeLine2D line; 
+		line.copyElements(other[i]);
+		this->add (line);
+	}
+}
+
+
+void 
+TePolygonSet::copyElements ( const TePolygonSet& other )
+{
+	geomId_ = other.geomId();
+	objectId_ = other.objectId();
+
+	for (unsigned int i = 0; i < other.size(); ++i) // for each polygon
+	{
+		TePolygon poly;
+		poly.copyElements (other[i]);
+		this->add (poly);
+	}
+}
+
+
+TePointSet makePointSet( const TeLinearRing& lr )
+{
+  TePointSet outps;
+  TePoint temp_point;
+  
+  const unsigned int lr_size = lr.size();
+  
+  for( unsigned int lr_index = 0 ; lr_index < lr_size ; ++lr_index ) {
+    TePoint temp_point;
+    temp_point.add( lr[ lr_index ] );
+    
+    outps.add( temp_point );
+  }
+  
+  return outps;
+}
+
+
+TePointSet makePointSet( const TePolygon& p )
+{
+  TePointSet outps;
+
+  const unsigned int p_size = p.size();
+  unsigned p_index = 0;
+  unsigned int lrps_size = 0;
+  unsigned int lrps_index = 0;
+  
+  for( p_index = 0 ; p_index < p_size ; ++p_index ) {
+    TePointSet lrps = makePointSet( p[ p_index ] );
+    lrps_size = lrps.size();
+  
+    for( lrps_index = 0 ; lrps_index < lrps_size ; ++lrps_index ) {
+      outps.add( lrps[ lrps_index ] );
+    }
+  }
+  
+  return outps;
+}
+
diff --git a/src/terralib/kernel/TeGeometry.h b/src/terralib/kernel/TeGeometry.h
old mode 100755
new mode 100644
index 15095f6..dd7ba4a
--- a/src/terralib/kernel/TeGeometry.h
+++ b/src/terralib/kernel/TeGeometry.h
@@ -1,979 +1,983 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeGeometry.h
-    \brief This file contains structures and definitions about	geometries support in TerraLib
-*/
-
-#ifndef __TERRALIB_INTERNAL_GEOMETRY_H
-#define __TERRALIB_INTERNAL_GEOMETRY_H
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeDefines.h"
-#include "TeBox.h"
-#include "TeCoord2D.h"
-#include "TeComposite.h"
-#include "TeMeasure.h"
-#include "TeUtils.h"
-#include "TeDataTypes.h"
-
-#include <string>
-#include <iostream>
-
-
-using namespace std;
-
-//!  A basic class for handling geometries in TerraLib
-/*! 
-	 All geometric classes of TerraLib are derived from
-	 TeGeometry. This class keep track of a geometryId and of a bounding box for the geometry
-	
-	 \note The Geometry classes in TerraLib use the Composite and the Visitor patterns
-	 \sa TeBox TeGeomComposite, TeGeomSingle 
-*/
-class TL_DLL TeGeometry
-{
-public:
-
-	//! Empty constructor
-	TeGeometry(): box_ ( TeMAXFLOAT, TeMAXFLOAT, -TeMAXFLOAT, -TeMAXFLOAT ),
-		geomId_  ( 0 ), objectId_ ("") {}
-
-	//! Copy Constructor
-	TeGeometry ( const TeGeometry& other ) 
-	{
-		box_    = other.box_;
-		geomId_ = other.geomId_;
-		objectId_ = other.objectId_;
-	}
-	
-	//! Destructor
-	virtual ~TeGeometry() {}
-
-	//! Sets the bounding box for the object
-	void setBox ( const TeBox & box )
-	{ box_  = box; }
-	
-	//! Returns the constant bounding box
-	const TeBox& box () const 
-	{ return box_; }
-
-	//! Returns the bounding box
-	TeBox& box ()
-	{ return box_; }
-
-	//! Returns the geometry Id
-	int geomId() const
-	{ return geomId_; }
-
-	//! Sets the geometryId.
-	void geomId( int id )
-	{ geomId_ = id; }
-
-	//! Returns the object unique identification
-	virtual string objectId() const
-	{ return objectId_; }
-
-	//! Sets the objectId 
-	virtual void objectId ( const string& id )
-	{ objectId_ = id; }
-
-	//! Return the geometry size 
-	virtual unsigned int size() const
-	{ return 0; }
-
-	//! Outputs the geometical identification to an output stream
-	ostream& operator<<(ostream& os)
-	{
-		os << Te2String(geomId_);
-		return os;
-	}
-
-	//! Returns TRUE if a geometry is a closed ring  
-	virtual bool isRing() const
-	{ return false; }
-
-	//! Returns the basic geometry type in a set of geometries structure
-	virtual TeGeomRep elemType() 
-	{ return TeGEOMETRYNONE; }
-	
-protected:
-
-	TeBox	box_;		//!<  The bounding box of the geometry
-	int	geomId_;		//!<  The unique geometry identification
-	string	objectId_;	//!<  The unique object identification associated to a geometry
-};
-
-
-//! A class that represents a non existent geometry
-/*!
-	This class is used to deal in a similar way with objects with or without geometry 
-*/
-class TL_DLL TeGeometryNone:  public TeGeometry
-{
-public: 
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeGEOMETRYNONE; }
-
-	//! Removes geometry elements
-	void clear () { return; }
-};
-
-//! A class to handle vector geometries
-class TL_DLL TeVector : public TeGeometry
-{
-};
-
-//!   TeGeomSingle: A class for handling geometries in TerraLib which consist of one location
-/*!  
-  \sa TePoint, TeSample 
-*/
-template <class T>
-class TeGeomSingle : public TeVector
-{
-public:
-
-    //! Exports the type of the element of a TeGeomSingle
-	typedef  T value_type;
-
-	//! Empty constructor
-	TeGeomSingle<T>() {}
-
-	//! Constructor from the single element of the container
-	TeGeomSingle<T> (const T& elem ): elem_ ( elem  ) 
-	{	updateBox ( box_, elem ); }
-
-	//! Copy Constructor
-	TeGeomSingle ( const TeGeomSingle& other ) : TeVector()
-	{
-		box_    = other.box_;
-		geomId_ = other.geomId_;
-		objectId_ = other.objectId_;
-		elem_ = other.elem_;
-	}
-
-	//! Equal Operator
-	TeGeomSingle& operator = ( const TeGeomSingle& other )
-	{
-		box_    = other.box_;
-		geomId_ = other.geomId_;
-		objectId_ = other.objectId_;
-		elem_ = other.elem_;
-		return *this;
-	}
-
-	//! Destructor
-	virtual ~TeGeomSingle<T>() {}
-
-	//! Changes the unique element
-	void add ( T& elem )
-	{
-		elem_ = elem;
-		box_ = TeBox(TeMAXFLOAT, TeMAXFLOAT,-TeMAXFLOAT,-TeMAXFLOAT); // invalidates its box
-		updateBox ( box_, elem );
-	}
-
-	//! Returns the unique element
-	T&	location ()
-	{	return elem_; }
-
-	//! Returns the unique element
-	const T& location () const
-	{	return elem_; }
-
-	//! Returns the unique element
-	T& elem ()
-	{	return elem_; }
-
-	//! Returns the unique element
-	const T& elem () const
-	{	return elem_; }
-
-	//! Returns the unique element
-	T& operator [] ( int /* i */) 
-	{	return elem_; }
-
-	//! Returns TRUE if a TeGeomSingle is equal to other
-	bool operator== (const TeGeomSingle& other) const
-	{	return elem_ == other.elem(); }
-
-	//! Returns the size of a TeGeomSingle: always 1
-	int size() { return 1; }
-
-protected:
-	T	elem_;
-
-};
-
-
-
-//!  TeGeomComposite: A template class for handling a hierarchy of geometries in TerraLib
-/*!
-
-	  Used for instantiating the different geometries. Provide a vector to store the 2D 
-	  coordinates of a ring. Multiple copies of a geometry are allowed to share the same 
-	  coordinates by means of a "handle/body"  idiom.
-
-	\sa  TeLine2D TePolygon TeLineSet TePolygonSet
-*/
-
-template <class T>  
-class TeGeomComposite: public TeVector
-{
-public:
-
-	//! Constructor
-	TeGeomComposite()
-	{
-		pImpl_ = new TeComposite<T>;
-		pImpl_->attach();
-	}
-
-	//! Destructor
-	virtual ~TeGeomComposite()
-	{	pImpl_->detach();	}
-
-
-	//! Copy Constructor
-	TeGeomComposite ( const TeGeomComposite& other ) : TeVector()
-	{
-		pImpl_ = other.pImpl_;
-		pImpl_->attach();
-		box_    = other.box_;
-		geomId_ = other.geomId_;
-		objectId_ = other.objectId_;
-	}
-
-	//! Operator =
-	TeGeomComposite& operator= ( const TeGeomComposite& other )
-	{
-		if ( this != &other )
-		{	
-			other.pImpl_->attach();
-			pImpl_->detach();
-			pImpl_  = other.pImpl_;
-			box_    = other.box_;
-			geomId_ = other.geomId_;
-			objectId_ = other.objectId_;
-		}
-		return *this;
-	}
-
-	//! Returns the identification of the object associated to this geometry
-	virtual string objectId() const
-	{ return objectId_; }
-
-	//! Sets the identification of the object associated to this geometry
-	virtual void objectId (const string& id )
-	{ 
-		objectId_ = id; 
-		typename TeComposite<T>::iterator it = pImpl_->begin();
-		while (it != pImpl_->end())
-		{
-			it->objectId(id);
-			++it;
-		}
-	}
-
-	//! Copy two composites, duplicating elements (breaking handle/body idiom)
-	void copyElements ( const TeGeomComposite& other )
-	{
-		geomId_ = other.geomId_;
-		objectId_ = other.objectId_;
-
-		for (unsigned int i = 0; i < other.pImpl_->size(); i++)
-			add (other.pImpl_->operator[](i));
-	}
-
-	//! Returns TRUE if two composites have exactly the same elements
-	bool operator== (const TeGeomComposite& other) const
-	{	
-		if ( this->size() != other.size() )
-			return false;
-
-		for (unsigned int i = 0; i < other.pImpl_->size(); i++)
-			if ( (pImpl_->operator[](i))==(other.pImpl_->operator[]( i )) )
-				return false;
-		return true; 
-	}
-
-	//! Adds a new component
-	void add ( const T& elem )
-	{	
-		pImpl_->add ( elem );
-		updateBox ( box_, elem );
-	}
-
-	//! Removes the i-th component
-	bool erase ( int i )
-	{ 	
-		bool status = pImpl_->erase (i);
-
-		if (status)	// recalculates the box
-		{
-			box_ = TeBox(TeMAXFLOAT, TeMAXFLOAT,-TeMAXFLOAT,-TeMAXFLOAT);
-			for (unsigned int j = 0; j < pImpl_->size(); j++)
-				updateBox(box_,pImpl_->operator[](j));
-		}
-		return status;
-	}
-
-	//! Removes an element
-	bool erase ( T& object )
-	{	
-		bool status = pImpl_->erase ( object ); 
-		if (status)	// recalculates the box
-		{
-			box_ = TeBox(TeMAXFLOAT, TeMAXFLOAT,-TeMAXFLOAT,-TeMAXFLOAT);
-			for (unsigned int j = 0; j < pImpl_->size(); j++)
-				updateBox(box_,pImpl_->operator[](j));
-		}
-		return status;
-	}
-
-	//! Removes the element pointed by an interator
-	typename TeComposite<T>::iterator erase(typename TeComposite<T>::iterator it)
-	{	
-		typename TeComposite<T>::iterator res = pImpl_->erase(it); 
-		box_ = TeBox(TeMAXFLOAT, TeMAXFLOAT,-TeMAXFLOAT,-TeMAXFLOAT);
-		for (unsigned int j = 0; j < pImpl_->size(); j++)
-			updateBox(box_,pImpl_->operator[](j));
-		return res;
-	}
-
-	//! Removes all elements
-	void clear ()
-	{	
-		pImpl_->clear ();		// remove all elements
-		box_ = TeBox(TeMAXFLOAT, TeMAXFLOAT,-TeMAXFLOAT,-TeMAXFLOAT); // invalidates its box
-	}
-	
-	//! Returns the size of the composite
-	unsigned int size() const
-	{	return ( (unsigned int) pImpl_->size() ); }
-
-	//! Reserves space for a given number of elements (reserve is available for vectors)  
-	void reserve(int nelem)
-	{ pImpl_->reserve(nelem); }
-
-	//! Returns the i-th element
-	T& operator [] ( int i ) const
-	{	return pImpl_->operator[] ( i ); }
-
-	//! Returns the first element
-	T& first() const
-	{	return pImpl_->operator[] ( 0 ); }
-	
-	//! Returns the i-th element
-	T& last() const
-	{	return pImpl_->operator[] ( pImpl_->size()-1 ); }
-	
-	//! Returns TRUE if composite is empty
-	bool empty () const
-	{	return pImpl_->empty (); }
-
-	//! An Iterator that enables forward traversal of a TeGeomComposite
-	typedef typename TeComposite<T>::iterator iterator;
-
-	//! The type of the value obtained by dereferencing a TeGeomComposite iterator
-//	typedef typename T value_type;
-	typedef  T value_type;
-
-	//! The iterator to the first position in the TeGeomComposite
-	typename TeComposite<T>::iterator begin()
-	{ return pImpl_->begin(); }
-
-	//! The iterator to the first position in the TeGeomComposite
-	typename TeComposite<T>::iterator const begin() const
-	{ return pImpl_->begin(); }
-
-	//! The iterator to the last plus one position in the TeGeomComposite
-	typename TeComposite<T>::iterator end()
-	{ return pImpl_->end(); }
-
-	//! The iterator to the last plus one position in the TeGeomComposite
-	typename TeComposite<T>::iterator const end() const
-	{ return pImpl_->end(); }
-
-	//! An Iterator that enables backward traversal of a TeGeomComposite
-	typedef typename TeComposite<T>::reverse_iterator reverse_iterator;
-
-	//! The iterator to the first position in the TeGeomComposite in reverse order
-	typename TeComposite<T>::reverse_iterator rbegin()
-	{ return pImpl_->rbegin(); }
-
-	//! The iterator to the last plus one position in the TeGeomComposite in reverse order
-	typename TeComposite<T>::reverse_iterator rend()
-	{ return pImpl_->rend(); }
-
-protected:
-
-	//! Pointer to the implementation of a composite<T>
-	TeComposite<T> * pImpl_; 
-};
-
-//!  TeLine2D: Supports a simple 2D line,  composed of 2D xy points
-/*!
-	\sa TeGeometry TeLinearRing
-*/
-class TL_DLL TeLine2D : public TeGeomComposite<TeCoord2D>
-{
-public:
-	//! Check if a line2D is a closed ring
-	bool isRing() const;	
-
-	//! Returns the identification of the object associated to this geometry
-	string objectId() const
-	{ return objectId_; }
-	
-	//! Sets the identification of the object associated to this geometry
-	void objectId (const string& id )
-	{  objectId_ = id; }
-
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeLINES; }
-};
-
-//!  TeLineSet: Supports a composite of lines
-/*!
-  \sa TeGeomComposite
-*/
-class TL_DLL TeLineSet: public TeGeomComposite<TeLine2D>
-{
-public:
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeLINES; }
-
-	//! Executes a real copy of two sets (duplicate the elements)
-	void copyElements (const TeLineSet& other ); 
-}; 
-
-//!  TeLinearRing: Provides support for a 2D linear ring
-/*!
-	 A linear ring is a 2D line (without self-intersections) whose 
-	 first point is the same as the last point.  A linear ring cannot be created 
-	 directly, but is instantiated from a 2D line.
-
-   \sa TePolygon 
-*/
-class TL_DLL TeLinearRing : public TeLine2D  {
-public:
-
-	//! Empty constructor
-	TeLinearRing() : TeLine2D() {}
-
-	//! Contructor from a line
-	TeLinearRing ( TeLine2D& line );
-};
-
-
-//!  TePolygon: A class for handling 2D polygons. 
-/*!
-	In TerraLib, a 2D polygon consists of an outer ring and a list
-	of inner rings 
-*/
-class TL_DLL TePolygon: public TeGeomComposite<TeLinearRing>  
-{
-public:
-	
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TePOLYGONS; }
-
-	//! Executes a real copy of two sets (duplicate the elements)
-	void copyElements ( const TePolygon& other );
-};
-
-//!  TePolygonSet: A class for handling sets of 2D polygons. 
-class TL_DLL TePolygonSet: public TeGeomComposite<TePolygon> 
-{
-public:
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TePOLYGONS; }
-
-	//! Executes a real copy of two sets (duplicate the elements)
-	void copyElements ( const TePolygonSet& other );
-};
-
-	
-//!  TePoint: A class for handling 2D Points. 
-class TL_DLL TePoint : public TeGeomSingle<TeCoord2D>
-{
-public:
-	//! Default constructor
-	TePoint(const double& x = 0., const double& y = 0. ):
-		TeGeomSingle<TeCoord2D> ( )
-	{
-			elem_ = TeCoord2D(x,y);
-			setBox(TeBox(x,y,x,y)); // the box of a point is the point itself
-	}
-
-	//! Copy constructor
-	TePoint(TeCoord2D& c):
-		TeGeomSingle<TeCoord2D> ( )
-	{
-			elem_ = c;
-			setBox(TeBox(c.x(),c.y(),c.x(),c.y())); // the box of a point is the point itself
-	}
-
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TePOINTS; }
-
-	//! Returns the identification of the object associated to this geometry
-	string objectId() const
-	{ return objectId_; }
-	
-	//! Sets the identification of the object associated to this geometry
-	void objectId (const string& id )
-	{  objectId_ = id; }
-
-};
-
-//!  TePointSet:  A class for handling sets of 2D polygons. 
-class TL_DLL TePointSet: public  TeGeomComposite<TePoint> 
-{
-public:
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TePOINTS; }
-};
-
-//!  TeText : A class for handling text.
-class TL_DLL TeText: public TeGeomSingle<TeCoord2D>
-{
-public:
-	//! Default contructor
-	/*!
-      \param txt the string of character that form the text (default is an empty string)
-	*/
-	TeText(const string& txt="" ):
-		TeGeomSingle<TeCoord2D> ( ),
-		angle_(0),
-		height_(0),
-		textValue_(txt),
-		alignmentVert_(0),
-		alignmentHoriz_(0)
-	{
-		elem_ = TeCoord2D(0,0);
-		setBox(TeBox(0.0,0.0,0.0,0.0));
-	}
-
-	//! Constructor
-	/*!
-		\param location basic position of the text
-		\param txt the string of character that form the text (default is an empty string)
-	*/
-
-	TeText( TeCoord2D& location, const string& txt="" ):
-		TeGeomSingle<TeCoord2D> ( location ),
-		angle_(0),
-		height_(0),
-		textValue_(txt),
-		alignmentVert_(0),
-		alignmentHoriz_(0)
-	{
-		setBox(TeBox(location,location));
-	}
-
-	//! Copy constructor
-	TeText(const TeText& other ) : TeGeomSingle<TeCoord2D>()
-	{
-		angle_ = other.angle_;
-		height_ = other.height_;
-		textValue_ = other.textValue_;
-		alignmentVert_ = other.alignmentVert_;
-		alignmentHoriz_ = other. alignmentHoriz_;
-		setBox(other.box());
-		elem_ = other.elem_;
-		geomId_ = other.geomId_;
-		objectId_ = other.objectId_;
-	}
-
-	//! Operator =
-	TeText& operator= ( const TeText& other )
-	{
-		if ( this != &other )
-		{	
-			angle_ = other.angle_;
-			height_ = other.height_;
-			textValue_ = other.textValue_;
-			alignmentVert_ = other.alignmentVert_;
-			alignmentHoriz_ = other. alignmentHoriz_;
-			setBox(other.box());
-			elem_ = other.elem_;
-			geomId_ = other.geomId_;
-			objectId_ = other.objectId_;
-		}
-		return *this;
-	}
-
-	//! Returns TRUE if a text is equal to other
-	bool operator== (const TeText& tx) const 
-	{
-		return (angle_ == tx.angle_ &&
-			height_ == tx.height_ &&
-			textValue_ == tx.textValue_ &&
-			alignmentVert_ == tx.alignmentVert_ &&
-			alignmentHoriz_ == tx.alignmentHoriz_ &&
-			elem_ == tx.elem_ &&
-			geomId_ == tx.geomId_ &&
-			objectId_ == tx.objectId_);
-	}
-
-	//! Sets anew value for the location of the text
-	void setLocation(TeCoord2D& l)
-	{	elem_ = l; setBox(TeBox(l,l));	}
-
-	//! Returns the string value of a text
-	string textValue () const
-	{ return textValue_; }
-	
-	//! Sets the string value of a text
-	void setTextValue (const string &text) 
-	{ textValue_ = text; }
-
-	//! Returns the text inclination
-	double angle () const
-	{ return angle_; }
-
-	//! Sets the text inclination
-	void setAngle (double angle) 
-	{ angle_ = angle; }
-
-	//! Returns the text height
-	double height () const
-	{ return height_ ; }
-
-	//! Sets the text height
-	void setHeight (double height) 
-	{ height_ = height; }
-
-	//! Returns the text vertical alignment
-	double alignmentVert () const
-	{ return alignmentVert_ ; }
-
-	//! Sets the text vertical alignment
-	void setAlignmentVert (double alig) 
-	{ alignmentVert_ = alig; }
-
-	//! Returns the text horizontal alignment
-	double alignmentHoriz () const
-	{ return alignmentHoriz_ ; }
-
-	//! Sets the text horizontal alignment
-	void setAlignmentHoriz (double alig) 
-	{ alignmentHoriz_ = alig; }
-
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeTEXT; }
-
-private:
-	double angle_;	
-	double height_;
-	string textValue_;
-	double alignmentVert_;
-	double alignmentHoriz_;
-};
-
-
-//!  TeTextSet : A class for handling sets of TeText.
-class TL_DLL TeTextSet : public TeGeomComposite<TeText> 
-{
-public:
-	//! Returns the basic geometry in a set of geometries structure
-	TeGeomRep elemType() { return TeTEXT; }
-
-};
-
-
-//! TeNode:  A class for handling 2D Nodes.
-class TL_DLL TeNode: public TeGeomSingle<TeCoord2D>
-{
-public:
-	//! Returns TRUE if nodes are equal
-	bool operator== (const TeNode& node) const
-	{
-		TeCoord2D p1 = elem_;
-		TeCoord2D p2 = node.elem_;
-		return p1==p2;
-	}
-
-	//! Outputs the geometrical identification of a node
-	ostream& operator<<(ostream& os)
-	{
-		os << Te2String(geomId_);
-		return os;
-	}
-
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeNODES; }
-
-};
-
-//! Outputs the geometrical identification of a node
-TL_DLL ostream& operator<<(ostream& os, TeNode& N);
-
-//!  TeNodeSet :  A class for handling sets of 2D Nodes. 
-class TL_DLL TeNodeSet : public TeGeomComposite<TeNode> 
-
-{
-public:
-	//! Returns the basic geometry in a set of geometries structure
-	TeGeomRep elemType() { return TeNODES; }
-
-};
-
-//!  TeArc : Provides support for a 2D arc.
-class TL_DLL TeArc : public TeVector 
-{
-public:
-
-	//! Empty contructors
-	TeArc(): ifrom_ (-1), ito_ (-1){}
-
-	//! Construtor
-	/*!
-		\param from the starting node of an arc
-		\param to the ending node of an arc
-	*/
-	TeArc(TeNode& from, TeNode& to)
-	{
-		from_ = from;
-		to_ = to;
-		updateBox ( box_, from );
-		updateBox ( box_, to );
-	}
-
-	//! Construtor
-	/*!
-		\param from the geometrical identification of the  starting node of an arc
-		\param to the geometrical identification of the ending node of an arc
-	*/
-	TeArc(int from, int to): ifrom_ (from), ito_ (to) {}
-
-// -- Methods
-
-	//! Returns the starting node 
-	TeNode& fromNode () 
-	{ return from_; }
-
-	//! Returns the ending node 
-	TeNode& toNode () 
-	{ return to_; }
-
-	//! Returns the geometrical identification of the starting node 
-	int fromId () const
-	{ return ifrom_; }
-
-	//! Sets the geometrical identification of the starting node 
-	void fromId (int i) 
-	{ ifrom_ = i; }
-
-	//! Returns the geometrical identification of the ending node 
-	int toId () const
-	{ return ito_; }
-
-	//! Sets the geometrical identification of the ending node 
-	void toId (int i)
-	{ ito_ = i; }
-	
-	//! Sets the starting and ending node 
-	void setNodes (TeNode& from, TeNode& to)
-	{ 
-		from_ = from;
-		to_ = to;
-		updateBox ( box_, from );
-		updateBox ( box_, to );
-	}
-
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeARCS; }
-
-	//! Returns TRUE if a TeArc is equal to other
-	bool operator== (const TeArc& other) const
-	{
-		if((from_ == other.from_) &&
-	       (to_ == other.to_) &&
-		   (ifrom_ == other.ifrom_) &&
-           (ito_ != other.ito_))
-			return true;
-
-		return false;
-	}
-
-private:
-
-	TeNode	from_, to_;
-	int		ifrom_, ito_;
-};
-
-//! Outputs the description of an arc
-TL_DLL ostream& operator<<(ostream& os, const TeArc& N);
-
-
-//!  TeArcSet: Provides support for a set of 2D arc.
-class TL_DLL TeArcSet: public TeGeomComposite <TeArc> 
-{
-public:
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeARCS; }
-};
-
-//!  TeSample: A class for handling 2D Points with an associated measure.
-class TL_DLL TeSample: public TeGeomSingle<TeCoord2D>, public TeMeasure
-{
-public:
-	//! Constructor
-	/*!
-		\param location the position of the sample
-		\param measure the value associated to the sample
-	*/
-	TeSample ( TeCoord2D& location, double measure = 0.  ):
-		TeGeomSingle<TeCoord2D> ( location ), TeMeasure ( measure ) {}
-
-	TeGeomRep elemType() { return TeSAMPLES; }
-};
-
-//!  TeSampleSet: A class for handling sets of 2D samples
-class TL_DLL TeSampleSet: public TeGeomComposite<TeSample>
-{
-public:
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeSAMPLES; }
-};
-
-//!  TeContourLine: A class for handling 2D countour lines
-class TL_DLL TeContourLine: public TeLine2D, public TeMeasure
-{
-public:
-	//! Constructor
-	/*!
-		\param line the contour line
-		\param measure the value associated to the contour line
-	*/
-	TeContourLine ( TeLine2D& line, double measure = 0. )
-		: TeLine2D ( line ), TeMeasure ( measure )
-	{}
-};
-
-
-//!  TeContourLineSet: A class for handling sets of 2D countour lines
-class TL_DLL TeContourLineSet: public  TeGeomComposite <TeContourLine> 
-{
-public:
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeSAMPLES; }
-};
-
-
-//!    A class for handling cells. 
-class TL_DLL TeCell : public TeVector 
-{
-	int column_;	//!< the column number of this cell	
-	int line_;		//!< the line number of this cell
-
-public:
-	//! Empty constructor
-	TeCell():
-	  column_(-1),
-	  line_(-1) {}
-
-	TeCell(TeBox& box, int col, int lin):
-	  column_(col),
-	  line_(lin) { setBox(box); }
-
-	//! Returns the column identification of the cell
-	int	column () const
-	{ return column_; }
-
-	//! Sets the column identification of the cell
-	void column (int column) 
-	{ column_ =  column; }
-
-	//! Returns the line identification of the cell
-	int	line () const
-	{ return line_; }
-
-	//! Sets the line identification of the cell
-	void line (int line) 
-	{ line_ =  line; }
-
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeCELLS; }
-
-	//! Returns TRUE if a TeCell is equal to other
-	bool operator== (const TeCell& other) const
-	{
-		if((column_ == other.column_) &&
-	       (line_ == other.line_))
-			return true;
-
-		return false;
-	}
-};
-
-//!  A class for handling sets of cells.
-class TL_DLL TeCellSet: public  TeGeomComposite<TeCell> 
-{
-	double	resX_;	//!< the X resolution of a set of cells
-	double	resY_;	//!< the Y resolution of a set of cells
-
-public:
-
-	//! Returns the X resolution of a cell set
-	double resX () const
-	{ return resX_; }
-
-	//! Returns the Y resolution of a cell set
-	double resY () const
-	{ return resY_; }
-
-	//! Sets the X resolution of a cell set
-	void resX (double reX) 
-	{ resX_ = reX; }
-
-	//! Sets the Y resolution of a cell set
-
-	void resY (double reY) 
-	{ resY_ = reY; }
-
-	//! Returns the basic geometry in a set of geometries structure 
-	TeGeomRep elemType() { return TeCELLS; }
-
-};
-
-
-/*! \fn TePointSet makePointSet( const TeLinearRing& lr )
-   \brief builds a TePointSet geometry from a TeLinearRing
- */
-TL_DLL TePointSet makePointSet( const TeLinearRing& lr );
-
-
-/*! \fn TePointSet makePointSet( const TePolygon& p )
-   \brief builds a TePointSet geometry from a TePolygon
- */
-TL_DLL TePointSet makePointSet( const TePolygon& p );
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGeometry.h
+    \brief This file contains structures and definitions about	geometries support in TerraLib
+*/
+
+#ifndef __TERRALIB_INTERNAL_GEOMETRY_H
+#define __TERRALIB_INTERNAL_GEOMETRY_H
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeDefines.h"
+#include "TeBox.h"
+#include "TeCoord2D.h"
+#include "TeComposite.h"
+#include "TeMeasure.h"
+#include "TeUtils.h"
+#include "TeDataTypes.h"
+
+#include <string>
+#include <iostream>
+
+
+using namespace std;
+
+//!  A basic class for handling geometries in TerraLib
+/*! 
+	 All geometric classes of TerraLib are derived from
+	 TeGeometry. This class keep track of a geometryId and of a bounding box for the geometry
+	
+	 \note The Geometry classes in TerraLib use the Composite and the Visitor patterns
+	 \sa TeBox TeGeomComposite, TeGeomSingle 
+*/
+class TL_DLL TeGeometry
+{
+public:
+
+	//! Empty constructor
+	TeGeometry(): box_ ( TeMAXFLOAT, TeMAXFLOAT, -TeMAXFLOAT, -TeMAXFLOAT ),
+		geomId_  ( 0 ), objectId_ ("") {}
+
+	//! Copy Constructor
+	TeGeometry ( const TeGeometry& other ) 
+	{
+		box_    = other.box_;
+		geomId_ = other.geomId_;
+		objectId_ = other.objectId_;
+	}
+	
+	//! Destructor
+	virtual ~TeGeometry() {}
+
+	//! Sets the bounding box for the object
+	void setBox ( const TeBox & box )
+	{ box_  = box; }
+	
+	//! Returns the constant bounding box
+	const TeBox& box () const 
+	{ return box_; }
+
+	//! Returns the bounding box
+	TeBox& box ()
+	{ return box_; }
+
+	//! Returns the geometry Id
+	int geomId() const
+	{ return geomId_; }
+
+	//! Sets the geometryId.
+	void geomId( int id )
+	{ geomId_ = id; }
+
+	//! Returns the object unique identification
+	virtual string objectId() const
+	{ return objectId_; }
+
+	//! Sets the objectId 
+	virtual void objectId ( const string& id )
+	{ objectId_ = id; }
+
+	//! Return the geometry size 
+	virtual unsigned int size() const
+	{ return 0; }
+
+	//! Outputs the geometical identification to an output stream
+	ostream& operator<<(ostream& os)
+	{
+		os << Te2String(geomId_);
+		return os;
+	}
+
+	//! Returns TRUE if a geometry is a closed ring  
+	virtual bool isRing() const
+	{ return false; }
+
+	//! Returns the basic geometry type in a set of geometries structure
+	virtual TeGeomRep elemType() const 
+	{ return TeGEOMETRYNONE; }
+	
+protected:
+
+	TeBox	box_;		//!<  The bounding box of the geometry
+	int	geomId_;		//!<  The unique geometry identification
+	string	objectId_;	//!<  The unique object identification associated to a geometry
+};
+
+
+//! A class that represents a non existent geometry
+/*!
+	This class is used to deal in a similar way with objects with or without geometry 
+*/
+class TL_DLL TeGeometryNone:  public TeGeometry
+{
+public: 
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeGEOMETRYNONE; }
+
+	//! Removes geometry elements
+	void clear () { return; }
+};
+
+//! A class to handle vector geometries
+class TL_DLL TeVector : public TeGeometry
+{
+};
+
+//!   TeGeomSingle: A class for handling geometries in TerraLib which consist of one location
+/*!  
+  \sa TePoint, TeSample 
+*/
+template <class T>
+class TeGeomSingle : public TeVector
+{
+public:
+
+    //! Exports the type of the element of a TeGeomSingle
+	typedef  T value_type;
+
+	//! Empty constructor
+	TeGeomSingle<T>() {}
+
+	//! Constructor from the single element of the container
+	TeGeomSingle<T> (const T& elem ): elem_ ( elem  ) 
+	{	updateBox ( box_, elem ); }
+
+	//! Copy Constructor
+	TeGeomSingle ( const TeGeomSingle& other ) : TeVector()
+	{
+		box_    = other.box_;
+		geomId_ = other.geomId_;
+		objectId_ = other.objectId_;
+		elem_ = other.elem_;
+	}
+
+	//! Equal Operator
+	TeGeomSingle& operator = ( const TeGeomSingle& other )
+	{
+		box_    = other.box_;
+		geomId_ = other.geomId_;
+		objectId_ = other.objectId_;
+		elem_ = other.elem_;
+		return *this;
+	}
+
+	//! Destructor
+	virtual ~TeGeomSingle<T>() {}
+
+	//! Changes the unique element
+	void add ( T& elem )
+	{
+		elem_ = elem;
+		box_ = TeBox(TeMAXFLOAT, TeMAXFLOAT,-TeMAXFLOAT,-TeMAXFLOAT); // invalidates its box
+		updateBox ( box_, elem );
+	}
+
+	//! Returns the unique element
+	T&	location ()
+	{	return elem_; }
+
+	//! Returns the unique element
+	const T& location () const
+	{	return elem_; }
+
+	//! Returns the unique element
+	T& elem ()
+	{	return elem_; }
+
+	//! Returns the unique element
+	const T& elem () const
+	{	return elem_; }
+
+	//! Returns the unique element
+	T& operator [] ( int /* i */) 
+	{	return elem_; }
+
+	//! Returns TRUE if a TeGeomSingle is equal to other
+	bool operator== (const TeGeomSingle& other) const
+	{	return elem_ == other.elem(); }
+
+	//! Returns the size of a TeGeomSingle: always 1
+	int size() { return 1; }
+
+protected:
+	T	elem_;
+
+};
+
+
+
+//!  TeGeomComposite: A template class for handling a hierarchy of geometries in TerraLib
+/*!
+
+	  Used for instantiating the different geometries. Provide a vector to store the 2D 
+	  coordinates of a ring. Multiple copies of a geometry are allowed to share the same 
+	  coordinates by means of a "handle/body"  idiom.
+
+	\sa  TeLine2D TePolygon TeLineSet TePolygonSet
+*/
+
+template <class T>  
+class TeGeomComposite: public TeVector
+{
+public:
+
+	//! Constructor
+	TeGeomComposite()
+	{
+		pImpl_ = new TeComposite<T>;
+		pImpl_->attach();
+	}
+
+	//! Destructor
+	virtual ~TeGeomComposite()
+	{	pImpl_->detach();	}
+
+
+	//! Copy Constructor
+	TeGeomComposite ( const TeGeomComposite& other ) : TeVector()
+	{
+		pImpl_ = other.pImpl_;
+		pImpl_->attach();
+		box_    = other.box_;
+		geomId_ = other.geomId_;
+		objectId_ = other.objectId_;
+	}
+
+	//! Operator =
+	TeGeomComposite& operator= ( const TeGeomComposite& other )
+	{
+		if ( this != &other )
+		{	
+			other.pImpl_->attach();
+			pImpl_->detach();
+			pImpl_  = other.pImpl_;
+			box_    = other.box_;
+			geomId_ = other.geomId_;
+			objectId_ = other.objectId_;
+		}
+		return *this;
+	}
+
+	//! Returns the identification of the object associated to this geometry
+	virtual string objectId() const
+	{ return objectId_; }
+
+	//! Sets the identification of the object associated to this geometry
+	virtual void objectId (const string& id )
+	{ 
+		objectId_ = id; 
+		typename TeComposite<T>::iterator it = pImpl_->begin();
+		while (it != pImpl_->end())
+		{
+			it->objectId(id);
+			++it;
+		}
+	}
+
+	//! Copy two composites, duplicating elements (breaking handle/body idiom)
+	void copyElements ( const TeGeomComposite& other )
+	{
+		geomId_ = other.geomId_;
+		objectId_ = other.objectId_;
+
+		for (unsigned int i = 0; i < other.pImpl_->size(); i++)
+			add (other.pImpl_->operator[](i));
+	}
+
+	//! Returns TRUE if two composites have exactly the same elements
+	bool operator== (const TeGeomComposite& other) const
+	{	
+		if ( this->size() != other.size() )
+			return false;
+
+		for (unsigned int i = 0; i < other.pImpl_->size(); i++)
+			if ( (pImpl_->operator[](i))==(other.pImpl_->operator[]( i )) )
+				return false;
+		return true; 
+	}
+
+	//! Adds a new component
+	void add ( const T& elem )
+	{	
+		pImpl_->add ( elem );
+		updateBox ( box_, elem );
+	}
+
+	//! Removes the i-th component
+	bool erase ( int i )
+	{ 	
+		bool status = pImpl_->erase (i);
+
+		if (status)	// recalculates the box
+		{
+			box_ = TeBox(TeMAXFLOAT, TeMAXFLOAT,-TeMAXFLOAT,-TeMAXFLOAT);
+			for (unsigned int j = 0; j < pImpl_->size(); j++)
+				updateBox(box_,pImpl_->operator[](j));
+		}
+		return status;
+	}
+
+	//! Removes an element
+	bool erase ( T& object )
+	{	
+		bool status = pImpl_->erase ( object ); 
+		if (status)	// recalculates the box
+		{
+			box_ = TeBox(TeMAXFLOAT, TeMAXFLOAT,-TeMAXFLOAT,-TeMAXFLOAT);
+			for (unsigned int j = 0; j < pImpl_->size(); j++)
+				updateBox(box_,pImpl_->operator[](j));
+		}
+		return status;
+	}
+
+	//! Removes the element pointed by an interator
+	typename TeComposite<T>::iterator erase(typename TeComposite<T>::iterator it)
+	{	
+		typename TeComposite<T>::iterator res = pImpl_->erase(it); 
+		box_ = TeBox(TeMAXFLOAT, TeMAXFLOAT,-TeMAXFLOAT,-TeMAXFLOAT);
+		for (unsigned int j = 0; j < pImpl_->size(); j++)
+			updateBox(box_,pImpl_->operator[](j));
+		return res;
+	}
+
+	//! Removes all elements
+	void clear ()
+	{	
+		pImpl_->clear ();		// remove all elements
+		box_ = TeBox(TeMAXFLOAT, TeMAXFLOAT,-TeMAXFLOAT,-TeMAXFLOAT); // invalidates its box
+	}
+	
+	//! Returns the size of the composite
+	unsigned int size() const
+	{	return ( (unsigned int) pImpl_->size() ); }
+
+	//! Reserves space for a given number of elements (reserve is available for vectors)  
+	void reserve(int nelem)
+	{ pImpl_->reserve(nelem); }
+
+	//! Returns the i-th element
+	T& operator [] ( int i ) const
+	{	return pImpl_->operator[] ( i ); }
+
+	//! Returns the first element
+	T& first() const
+	{	return pImpl_->operator[] ( 0 ); }
+	
+	//! Returns the i-th element
+	T& last() const
+	{	return pImpl_->operator[] ( pImpl_->size()-1 ); }
+	
+	//! Returns TRUE if composite is empty
+	bool empty () const
+	{	return pImpl_->empty (); }
+
+	//! An Iterator that enables forward traversal of a TeGeomComposite
+	typedef typename TeComposite<T>::iterator iterator;
+
+	//! The type of the value obtained by dereferencing a TeGeomComposite iterator
+//	typedef typename T value_type;
+	typedef  T value_type;
+
+	//! The iterator to the first position in the TeGeomComposite
+	typename TeComposite<T>::iterator begin()
+	{ return pImpl_->begin(); }
+
+	//! The iterator to the first position in the TeGeomComposite
+	typename TeComposite<T>::iterator const begin() const
+	{ return pImpl_->begin(); }
+
+	//! The iterator to the last plus one position in the TeGeomComposite
+	typename TeComposite<T>::iterator end()
+	{ return pImpl_->end(); }
+
+	//! The iterator to the last plus one position in the TeGeomComposite
+	typename TeComposite<T>::iterator const end() const
+	{ return pImpl_->end(); }
+
+	//! An Iterator that enables backward traversal of a TeGeomComposite
+	typedef typename TeComposite<T>::reverse_iterator reverse_iterator;
+
+	//! The iterator to the first position in the TeGeomComposite in reverse order
+	typename TeComposite<T>::reverse_iterator rbegin()
+	{ return pImpl_->rbegin(); }
+
+	//! The iterator to the last plus one position in the TeGeomComposite in reverse order
+	typename TeComposite<T>::reverse_iterator rend()
+	{ return pImpl_->rend(); }
+
+protected:
+
+	//! Pointer to the implementation of a composite<T>
+	TeComposite<T> * pImpl_; 
+};
+
+//!  TeLine2D: Supports a simple 2D line,  composed of 2D xy points
+/*!
+	\sa TeGeometry TeLinearRing
+*/
+class TL_DLL TeLine2D : public TeGeomComposite<TeCoord2D>
+{
+public:
+	//! Check if a line2D is a closed ring
+	bool isRing() const;	
+
+	//! Returns the identification of the object associated to this geometry
+	string objectId() const
+	{ return objectId_; }
+	
+	//! Sets the identification of the object associated to this geometry
+	void objectId (const string& id )
+	{  objectId_ = id; }
+
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeLINES; }
+};
+
+//!  TeLineSet: Supports a composite of lines
+/*!
+  \sa TeGeomComposite
+*/
+class TL_DLL TeLineSet: public TeGeomComposite<TeLine2D>
+{
+public:
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeLINES; }
+
+	//! Executes a real copy of two sets (duplicate the elements)
+	void copyElements (const TeLineSet& other ); 
+}; 
+
+//!  TeLinearRing: Provides support for a 2D linear ring
+/*!
+	 A linear ring is a 2D line (without self-intersections) whose 
+	 first point is the same as the last point.  A linear ring cannot be created 
+	 directly, but is instantiated from a 2D line.
+
+   \sa TePolygon 
+*/
+class TL_DLL TeLinearRing : public TeLine2D  {
+public:
+
+	//! Empty constructor
+	TeLinearRing() : TeLine2D() {}
+
+	//! Contructor from a line
+	TeLinearRing ( TeLine2D& line );
+};
+
+
+//!  TePolygon: A class for handling 2D polygons. 
+/*!
+	In TerraLib, a 2D polygon consists of an outer ring and a list
+	of inner rings 
+*/
+class TL_DLL TePolygon: public TeGeomComposite<TeLinearRing>  
+{
+public:
+	
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TePOLYGONS; }
+
+	//! Executes a real copy of two sets (duplicate the elements)
+	void copyElements ( const TePolygon& other );
+};
+
+//!  TePolygonSet: A class for handling sets of 2D polygons. 
+class TL_DLL TePolygonSet: public TeGeomComposite<TePolygon> 
+{
+public:
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TePOLYGONS; }
+
+	//! Executes a real copy of two sets (duplicate the elements)
+	void copyElements ( const TePolygonSet& other );
+};
+
+	
+//!  TePoint: A class for handling 2D Points. 
+class TL_DLL TePoint : public TeGeomSingle<TeCoord2D>
+{
+public:
+	//! Default constructor
+	TePoint(const double& x = 0., const double& y = 0. ):
+		TeGeomSingle<TeCoord2D> ( )
+	{
+			elem_ = TeCoord2D(x,y);
+			setBox(TeBox(x,y,x,y)); // the box of a point is the point itself
+	}
+
+	//! Copy constructor
+	TePoint(const TeCoord2D& c):
+		TeGeomSingle<TeCoord2D> ( )
+	{
+			elem_ = c;
+			setBox(TeBox(c.x(),c.y(),c.x(),c.y())); // the box of a point is the point itself
+	}
+
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TePOINTS; }
+
+	//! Returns the identification of the object associated to this geometry
+	string objectId() const
+	{ return objectId_; }
+	
+	//! Sets the identification of the object associated to this geometry
+	void objectId (const string& id )
+	{  objectId_ = id; }
+
+};
+
+//!  TePointSet:  A class for handling sets of 2D polygons. 
+class TL_DLL TePointSet: public  TeGeomComposite<TePoint> 
+{
+public:
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TePOINTS; }
+};
+
+//!  TeText : A class for handling text.
+class TL_DLL TeText: public TeGeomSingle<TeCoord2D>
+{
+public:
+	//! Default contructor
+	/*!
+      \param txt the string of character that form the text (default is an empty string)
+	*/
+	TeText(const string& txt="" ):
+		TeGeomSingle<TeCoord2D> ( ),
+		angle_(0),
+		height_(0),
+		textValue_(txt),
+		alignmentVert_(0),
+		alignmentHoriz_(0)
+	{
+		elem_ = TeCoord2D(0,0);
+		setBox(TeBox(0.0,0.0,0.0,0.0));
+	}
+
+	//! Constructor
+	/*!
+		\param location basic position of the text
+		\param txt the string of character that form the text (default is an empty string)
+	*/
+
+	TeText( TeCoord2D& location, const string& txt="" ):
+		TeGeomSingle<TeCoord2D> ( location ),
+		angle_(0),
+		height_(0),
+		textValue_(txt),
+		alignmentVert_(0),
+		alignmentHoriz_(0)
+	{
+		setBox(TeBox(location,location));
+	}
+
+	//! Copy constructor
+	TeText(const TeText& other ) : TeGeomSingle<TeCoord2D>()
+	{
+		angle_ = other.angle_;
+		height_ = other.height_;
+		textValue_ = other.textValue_;
+		alignmentVert_ = other.alignmentVert_;
+		alignmentHoriz_ = other. alignmentHoriz_;
+		setBox(other.box());
+		elem_ = other.elem_;
+		geomId_ = other.geomId_;
+		objectId_ = other.objectId_;
+	}
+
+	//! Operator =
+	TeText& operator= ( const TeText& other )
+	{
+		if ( this != &other )
+		{	
+			angle_ = other.angle_;
+			height_ = other.height_;
+			textValue_ = other.textValue_;
+			alignmentVert_ = other.alignmentVert_;
+			alignmentHoriz_ = other. alignmentHoriz_;
+			setBox(other.box());
+			elem_ = other.elem_;
+			geomId_ = other.geomId_;
+			objectId_ = other.objectId_;
+		}
+		return *this;
+	}
+
+	//! Returns TRUE if a text is equal to other
+	bool operator== (const TeText& tx) const 
+	{
+		return (angle_ == tx.angle_ &&
+			height_ == tx.height_ &&
+			textValue_ == tx.textValue_ &&
+			alignmentVert_ == tx.alignmentVert_ &&
+			alignmentHoriz_ == tx.alignmentHoriz_ &&
+			elem_ == tx.elem_ &&
+			geomId_ == tx.geomId_ &&
+			objectId_ == tx.objectId_);
+	}
+
+	//! Sets anew value for the location of the text
+	void setLocation(const TeCoord2D& l)
+	{	elem_ = l; setBox(TeBox(l,l));	}
+
+	//! Returns the string value of a text
+	string textValue () const
+	{ return textValue_; }
+	
+	//! Sets the string value of a text
+	void setTextValue (const string &text) 
+	{ textValue_ = text; }
+
+	//! Returns the text inclination
+	double angle () const
+	{ return angle_; }
+
+	//! Sets the text inclination
+	void setAngle (double angle) 
+	{ angle_ = angle; }
+
+	//! Returns the text height
+	double height () const
+	{ return height_ ; }
+
+	//! Sets the text height
+	void setHeight (double height) 
+	{ height_ = height; }
+
+	//! Returns the text vertical alignment
+	double alignmentVert () const
+	{ return alignmentVert_ ; }
+
+	//! Sets the text vertical alignment
+	void setAlignmentVert (double alig) 
+	{ alignmentVert_ = alig; }
+
+	//! Returns the text horizontal alignment
+	double alignmentHoriz () const
+	{ return alignmentHoriz_ ; }
+
+	//! Sets the text horizontal alignment
+	void setAlignmentHoriz (double alig) 
+	{ alignmentHoriz_ = alig; }
+
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeTEXT; }
+
+private:
+	double angle_;	
+	double height_;
+	string textValue_;
+	double alignmentVert_;
+	double alignmentHoriz_;
+};
+
+
+//!  TeTextSet : A class for handling sets of TeText.
+class TL_DLL TeTextSet : public TeGeomComposite<TeText> 
+{
+public:
+	//! Returns the basic geometry in a set of geometries structure
+	TeGeomRep elemType() const { return TeTEXT; }
+
+};
+
+
+//! TeNode:  A class for handling 2D Nodes.
+class TL_DLL TeNode: public TeGeomSingle<TeCoord2D>
+{
+public:
+	//! Returns TRUE if nodes are equal
+	bool operator== (const TeNode& node) const
+	{
+		TeCoord2D p1 = elem_;
+		TeCoord2D p2 = node.elem_;
+		return p1==p2;
+	}
+
+	//! Outputs the geometrical identification of a node
+	ostream& operator<<(ostream& os)
+	{
+		os << Te2String(geomId_);
+		return os;
+	}
+
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeNODES; }
+
+};
+
+//! Outputs the geometrical identification of a node
+TL_DLL ostream& operator<<(ostream& os, TeNode& N);
+
+//!  TeNodeSet :  A class for handling sets of 2D Nodes. 
+class TL_DLL TeNodeSet : public TeGeomComposite<TeNode> 
+
+{
+public:
+	//! Returns the basic geometry in a set of geometries structure
+	TeGeomRep elemType() const { return TeNODES; }
+
+};
+
+//!  TeArc : Provides support for a 2D arc.
+class TL_DLL TeArc : public TeVector 
+{
+public:
+
+	//! Empty contructors
+	TeArc(): ifrom_ (-1), ito_ (-1){}
+
+	//! Construtor
+	/*!
+		\param from the starting node of an arc
+		\param to the ending node of an arc
+	*/
+	TeArc(TeNode& from, TeNode& to)
+	{
+		from_ = from;
+		to_ = to;
+		updateBox ( box_, from );
+		updateBox ( box_, to );
+	}
+
+	//! Construtor
+	/*!
+		\param from the geometrical identification of the  starting node of an arc
+		\param to the geometrical identification of the ending node of an arc
+	*/
+	TeArc(int from, int to): ifrom_ (from), ito_ (to) {}
+
+// -- Methods
+
+	//! Returns the starting node 
+	TeNode& fromNode () 
+	{ return from_; }
+
+	//! Returns the ending node 
+	TeNode& toNode () 
+	{ return to_; }
+
+	//! Returns the geometrical identification of the starting node 
+	int fromId () const
+	{ return ifrom_; }
+
+	//! Sets the geometrical identification of the starting node 
+	void fromId (int i) 
+	{ ifrom_ = i; }
+
+	//! Returns the geometrical identification of the ending node 
+	int toId () const
+	{ return ito_; }
+
+	//! Sets the geometrical identification of the ending node 
+	void toId (int i)
+	{ ito_ = i; }
+	
+	//! Sets the starting and ending node 
+	void setNodes (TeNode& from, TeNode& to)
+	{ 
+		from_ = from;
+		to_ = to;
+		updateBox ( box_, from );
+		updateBox ( box_, to );
+	}
+
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeARCS; }
+
+	//! Returns TRUE if a TeArc is equal to other
+	bool operator== (const TeArc& other) const
+	{
+		if((from_ == other.from_) &&
+	       (to_ == other.to_) &&
+		   (ifrom_ == other.ifrom_) &&
+           (ito_ != other.ito_))
+			return true;
+
+		return false;
+	}
+
+private:
+
+	TeNode	from_, to_;
+	int		ifrom_, ito_;
+};
+
+//! Outputs the description of an arc
+TL_DLL ostream& operator<<(ostream& os, const TeArc& N);
+
+
+//!  TeArcSet: Provides support for a set of 2D arc.
+class TL_DLL TeArcSet: public TeGeomComposite <TeArc> 
+{
+public:
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeARCS; }
+};
+
+//!  TeSample: A class for handling 2D Points with an associated measure.
+class TL_DLL TeSample: public TeGeomSingle<TeCoord2D>, public TeMeasure
+{
+public:
+	//! Constructor
+	/*!
+		\param location the position of the sample
+		\param measure the value associated to the sample
+	*/
+	TeSample ( const TeCoord2D& location, double measure = 0.  ):
+		TeGeomSingle<TeCoord2D> ( location ), TeMeasure ( measure ) {}
+
+	TeGeomRep elemType() const { return TeSAMPLES; }
+};
+
+//!  TeSampleSet: A class for handling sets of 2D samples
+class TL_DLL TeSampleSet: public TeGeomComposite<TeSample>
+{
+public:
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeSAMPLES; }
+};
+
+//!  TeContourLine: A class for handling 2D countour lines
+class TL_DLL TeContourLine: public TeLine2D, public TeMeasure
+{
+public:
+	//! Constructor
+	/*!
+		\param line the contour line
+		\param measure the value associated to the contour line
+	*/
+	TeContourLine ( TeLine2D& line, double measure = 0. )
+		: TeLine2D ( line ), TeMeasure ( measure )
+	{}
+};
+
+
+//!  TeContourLineSet: A class for handling sets of 2D countour lines
+class TL_DLL TeContourLineSet: public  TeGeomComposite <TeContourLine> 
+{
+public:
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeSAMPLES; }
+};
+
+
+//!    A class for handling cells. 
+class TL_DLL TeCell : public TeVector 
+{
+	int column_;	//!< the column number of this cell	
+	int line_;		//!< the line number of this cell
+
+public:
+	//! Empty constructor
+	TeCell():
+	  column_(-1),
+	  line_(-1) {}
+
+	TeCell(TeBox& box, int col, int lin):
+	  column_(col),
+	  line_(lin) { setBox(box); }
+
+	//! Returns the column identification of the cell
+	int	column () const
+	{ return column_; }
+
+	//! Sets the column identification of the cell
+	void column (int column) 
+	{ column_ =  column; }
+
+	//! Returns the line identification of the cell
+	int	line () const
+	{ return line_; }
+
+	//! Sets the line identification of the cell
+	void line (int line) 
+	{ line_ =  line; }
+
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeCELLS; }
+
+	//! Returns TRUE if a TeCell is equal to other
+	bool operator== (const TeCell& other) const
+	{
+		if((column_ == other.column_) &&
+	       (line_ == other.line_))
+			return true;
+
+		return false;
+	}
+};
+
+//!  A class for handling sets of cells.
+class TL_DLL TeCellSet: public  TeGeomComposite<TeCell> 
+{
+	double	resX_;	//!< the X resolution of a set of cells
+	double	resY_;	//!< the Y resolution of a set of cells
+
+public:
+
+	//! Empty constructor
+	TeCellSet() : resX_(0.), resY_(0.) 
+	{}
+
+	//! Returns the X resolution of a cell set
+	double resX () const
+	{ return resX_; }
+
+	//! Returns the Y resolution of a cell set
+	double resY () const
+	{ return resY_; }
+
+	//! Sets the X resolution of a cell set
+	void resX (double reX) 
+	{ resX_ = reX; }
+
+	//! Sets the Y resolution of a cell set
+
+	void resY (double reY) 
+	{ resY_ = reY; }
+
+	//! Returns the basic geometry in a set of geometries structure 
+	TeGeomRep elemType() const { return TeCELLS; }
+
+};
+
+
+/*! \fn TePointSet makePointSet( const TeLinearRing& lr )
+   \brief builds a TePointSet geometry from a TeLinearRing
+ */
+TL_DLL TePointSet makePointSet( const TeLinearRing& lr );
+
+
+/*! \fn TePointSet makePointSet( const TePolygon& p )
+   \brief builds a TePointSet geometry from a TePolygon
+ */
+TL_DLL TePointSet makePointSet( const TePolygon& p );
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeGeometryAlgorithms.cpp b/src/terralib/kernel/TeGeometryAlgorithms.cpp
old mode 100755
new mode 100644
index e42a207..b005c1c
--- a/src/terralib/kernel/TeGeometryAlgorithms.cpp
+++ b/src/terralib/kernel/TeGeometryAlgorithms.cpp
@@ -1,2835 +1,2925 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeAssertions.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeDefines.h"
-
-#include "TeIntersector.h"
-#include "TeFragmentation.h"
-
-#include <algorithm>
-#include <set>
-
-
-using namespace std;
-
-//---------- Local Functions ans Structures ----------//
-
-//! Instead of using arctan, use this to compare angles, so given two points return a number to be used in place of the angle formed by the segment.
-double Theta(const TeCoord2D& c1, const TeCoord2D& c2)
-{
-	register double dx = c2.x() - c1.x();
-	register double ax = fabs(dx);
-	register double dy = c2.y() - c1.y();
-	register double ay = fabs(dy);
-	register double t = 0.0;
-
-	if((dx == 0.0) && (dy == 0.0))
-		t = 0.0;
-	else
-		t = dy / (ax + ay);
-
-	if(dx < 0.0)
-		t = 2 - t;
-	else
-		if(dy < 0.0)
-			t = 4.0 + t;
-
-	return t * 90.0;
-}
-
-//! This struct is used for compare angles between two points and an anchor.
-struct ThetaOrder
-{
-	//! A fixed coordinate to be used to compare.
-	TeCoord2D anchor;
-
-	ThetaOrder(const TeCoord2D& c)
-		: anchor(c)
-	{
-	}
-
-	// Return true if c1 and anchor has a smaller angle than c2 and anchor.
-	bool operator()(const TeCoord2D& c1, const TeCoord2D& c2) const
-	{
-		register double t1 = Theta(anchor, c1);
-		register double t2 = Theta(anchor, c2);
-
-		if(t1 < t2)
-			return true;
-		
-		if(t1 > t2)
-			return false;
-
-		if(c1.x() < c2.x())
-			return true;
-
-		if(c1.x() > c2.x())
-			return false;
-
-		return false;		
-	}
-};
-
-/*! \struct xOrder
-    \brief  Returns true if c1 < c2 otherwise, returns false.
- */
-template<class T> struct xOrder
-{
-	bool operator()(T c1, T c2)
-	{
-		if(c1.x() < c2.x())
-			return true;
-
-		if(c1.x() > c2.x())
-			return false;
-
-		if(c1.y() < c2.y())
-			return true;		
-
-		return false;
-	}
-};
-
-/*! \fn double TeArea(TeLinearRing& r);
-    \brief This function returns twice the area of a ring treated as a simple polygon (no holes).
-	\param r  The ring.
-
-	This function returns twice the area of a ring treated as a simple polygon (no holes).
-	May return a negative number => it will be used in Orientation tests.
-*/
-double Te2Area(const TeLinearRing& r)
-{
-	double S2 = 0.0;
-
-	TeLinearRing::iterator it = r.begin();
-	TeLinearRing::iterator end = r.end() - 1;
-	while(it != end)
-	{
-		S2 += (it->x() + (it + 1)->x()) * ((it + 1)->y() - it->y());
-		++it;
-	}
-
-	return S2;
-}
-
-/*! \fn short TeConverseRelation(const short& rel)
-    \brief This function returns the complements relation of one given relation.
-	\param rel  The relation.
-*/
-inline short ConverseRelation(const short& rel)
-{
-	switch(rel)
-	{
-		case TeCOVEREDBY  :  return TeCOVERS;
-		case TeWITHIN     :  return TeCONTAINS;
-		case TeCOVERS     :  return TeCOVEREDBY;
-		case TeCONTAINS   :  return TeWITHIN;
-		default			  :  return rel;
-	}	
-}
-
-/*! \fn bool MayTouches(const TeLine2D& lRed, const TeLine2D& lBlue, TeINTERSECTOR2::TeReportTree& report)
-    \brief This function verifies if the two lines may touches.
-	\param lRed   The first line.
-	\param lBlue  The second line.
-	\param report The intersection point list.
-*/
-bool MayTouches(const TeLine2D& lRed, const TeLine2D& lBlue, TeINTERSECTOR2::TeVectorBoundaryIP& report)
-{
-	if(lRed.isRing() && lBlue.isRing())
-		return false;
-
-	TeINTERSECTOR2::TeVectorBoundaryIP::iterator it = report.begin();
-	TeINTERSECTOR2::TeVectorBoundaryIP::iterator it_end = report.end();
-
-
-	// Get the boundaries' coordinate.
-	TeCoord2D line1_boundary1 = lRed[0];
-	TeCoord2D line1_boundary2 = lRed[lRed.size() - 1u];
-
-	TeCoord2D line2_boundary1 = lBlue[0];
-	TeCoord2D line2_boundary2 = lBlue[lBlue.size() - 1u];
-
-	// Verifies if intersection points are on boundary of one of the blue line
-	while(it != it_end)
-	{	// Get intersection point coordinate.
-
-		for(unsigned int i = 0; i < it->coords_.size(); ++i)
-		{
-			TeCoord2D ip_coord = it->coords_[i];
-
-			if(lRed.isRing())
-			{
-				if(!(TeEquals(ip_coord, line2_boundary1) || TeEquals(ip_coord, line2_boundary2)))
-					return false;
-			}
-			else if(lBlue.isRing())
-			{
-				if(!(TeEquals(ip_coord, line1_boundary1) || TeEquals(ip_coord, line1_boundary2)))
-					return false;
-			}
-			else
-			{
-				if(!(TeEquals(ip_coord, line1_boundary1) || TeEquals(ip_coord, line1_boundary2) || TeEquals(ip_coord, line2_boundary1) || TeEquals(ip_coord, line2_boundary2)))
-					return false;
-			}
-		}
-
-		++it;
-	}
-
-	return true;		// The lines touches.
-}
-
-/*! \fn short Relation(const TeLine2D& lRed, const TeLine2D& lBlue, TeINTERSECTOR2::TeReportTree& report, const short& relation)
-    \brief This function returns the relation between two lines.
-	\param lRed     The first line.
-	\param lBlue    The second line.
-	\param report   The intersection point list.
-	\param relation The relation that stop the search.
-
-	This function returns the relation between lines. May be: TeDISJOINT, TeTOUCHES, TeWITHIN, TeCROSSES, TeCOVEREDBY, TeEQUALS.
-	Obs: Doesn't do box elimination. You must implement the test in your own functions.
-*/
-short Relation(const TeLine2D& lRed, const TeLine2D& lBlue, TeINTERSECTOR2::TeVectorBoundaryIP& report, const short& relation)
-{
-	if(report.size() == 0u)
-		return TeDISJOINT;
-
-	// Do fragmentation
-	//bool hasContour = false;	// This will decide between CROSSES and OVERLAPS.
-
-	bool mayTouches = MayTouches(lRed, lBlue, report);
-
-	// Stop to check, because touches can't occur anymore
-	if(relation == TeTOUCHES && !mayTouches)
-		return TeUNDEFINEDREL;
-
-
-	TeLineSet redFragments;
-	TeLineSet redBoundaryFragments;
-	TeLine2D lRedAux;
-	lRedAux.copyElements(lRed);
-	TeLineSet lSet; lSet.add(lRedAux);
-
-	TeFragmentBoundary(lSet, report, redBoundaryFragments, redFragments);
-
-	unsigned int redFragmentsSize = redFragments.size();
-
-	short mask = TeUNKNOWNPOSITION;
-
-	if(redBoundaryFragments.size() > 0u)
-		mask |= TeINSIDE;
-
-	// Do a position test for each fragment and stop if all relations have been found.
-	for(unsigned int j = 0u; j < redFragmentsSize; ++j)
-	{	
-		TeCoord2D middle;			
-
-		if(redFragments[j].size() ==  2u)	// If the fragment has two points I need to check the middle point of this fragment.
-			TeGetMiddlePoint(redFragments[j][0u], redFragments[j][1u], middle);
-		else	// If the fragment has more than two points so I check one point between the end points.
-			middle = redFragments[j][(unsigned int)((double(redFragments[j].size()) / 2.0 + 0.5)) - 1];
-
-		if(TeIsOnLine(middle, lBlue))
-			mask |= TeINSIDE;
-		else
-			mask |= TeOUTSIDE;		
-
-		if((mask & TeOUTSIDE) && (mask & TeINSIDE))
-			break;		
-	}
-
-	// If the intersection is only at end points and there is no part of red line inside blue line so they touches
-	if(mayTouches && mask == TeOUTSIDE)
-	{
-		return TeTOUCHES;
-	}
-	
-	// Stop to check, because touches can't occur anymore
-	if(relation == TeTOUCHES)
-		return TeUNDEFINEDREL;
-
-
-	// if there is no fragments in line blue interiors, so line red cross line blue
-	if(mask == TeOUTSIDE)
-		return TeCROSSES;
-
-	// Stop to check, because crosses can't occur anymore
-	if(relation == TeCROSSES)
-		return TeUNDEFINEDREL;
-
-	TeCoord2D firstRedCoord = lRed[0];
-	TeCoord2D lastRedCoord  = lRed[lRed.size() - 1];
-
-	TeCoord2D firstBlueCoord = lBlue[0];
-	TeCoord2D lastBlueCoord  = lBlue[lBlue.size() - 1];		
-
-
-	// If there is no part of red line outside blue line => must decide within, covered by and equals
-	if(!(mask & TeOUTSIDE))
-	{
-		// So, if we arrived here, blue line contains red line, but needs to decide between equal, coveredby and within.
-
-		if(TeEquals(firstRedCoord, firstBlueCoord) || TeEquals(firstRedCoord, lastBlueCoord))
-		{
-			if(TeEquals(lastRedCoord, firstBlueCoord) || TeEquals(lastRedCoord, lastBlueCoord))
-			{
-				return TeEQUALS;
-			}
-			else
-			{
-				if(lBlue.isRing())
-					return TeWITHIN;
-				else
-					return TeCOVEREDBY;
-			}
-		}
-
-		if(TeEquals(lastRedCoord, firstBlueCoord) || TeEquals(lastRedCoord, lastBlueCoord))
-		{
-			if(lBlue.isRing())
-				return TeWITHIN;
-			else
-				return TeCOVEREDBY;
-		}
-
-		return TeWITHIN;
-	}
-
-	return TeUNDEFINEDREL;
-}
-
-/*! \fn short Relation(const TeLine2D& line, const TeLinearRing& ring, const short& relation)
-    \brief This function returns the relation between a line and a linear ring (treated as a simple polygon with no holes).
-	\param line     The line.
-	\param ring     The simple polygon ring.
-	
-	This function returns how the points of input line are related with interior, boundary, and
-	exterior of polygon. The mask may be a combination of the following values: TeOUTSIDE, TeINSIDE and TeBOUNDARY.
-	Obs: Do box elimination.
-*/
-short Relation(const TeLine2D& line, const TeLinearRing& ring)
-{
-	if(TeDisjoint(line.box(), ring.box()))
-		return TeOUTSIDE;
-
-	TeINTERSECTOR2::TeVectorBoundaryIP report;
-
-	if(TeINTERSECTOR2::TeSafeIntersections(line, ring, report))
-	{
-		short mask = TeBOUNDARY;	// It will be at least intersections between boundaries.
-
-		// Fragments line.
-		TeLineSet lSet;
-		TeLineSet boundaryFragments;
-		TeLine2D lineAux;
-		lineAux.copyElements(line);
-		TeLineSet auxLineSet; auxLineSet.add(lineAux);
-		
-		TeFragmentBoundary(auxLineSet, report, boundaryFragments, lSet);
-
-
-		unsigned int lSetSize = lSet.size();
-
-		// Do a position test for each fragment and stop if al relations has been found.
-		for(unsigned int j = 0; j < lSetSize; ++j)
-		{	
-			TeCoord2D middle;
-			
-			if(lSet[j].size() ==  2)	// If the fragment has two points I need to check the middle point of this fragment.
-				TeGetMiddlePoint(lSet[j][0], lSet[j][1], middle);
-			else	// If the fragment has more than two points so I check one point between the end points.
-				middle = lSet[j][(unsigned int)((double(lSet[j].size()) / 2.0 + 0.5)) - 1];
-
-			
-			mask |= TeRelation(middle, ring);
-
-			if((mask & TeOUTSIDE) && (mask & TeINSIDE))
-				break;			
-		}
-
-		return mask;
-	}
-	else
-		return TeRelation(line[0], ring);	// Needs to test only one point of the line, and its location defines the line location.
-}
-
-/*! \fn short TopologicRelation(const TeLine2D& line, const TeLinearRing& r)
-    \brief This function returns the relation between a line and a linear ring (treated as a simple polygon with no holes).
-	\param line     The line.
-	\param r        The simple polygon ring.
-
-	This function returns the topologic relation between the line and
-	the ring. The result may be: DISJOINT, WITHIN, TOUCHES, CROSSES or COVERED BY.
-	Obs: Doesn't do box elimination. Just uses from TeRelation.
-*/
-short TopologicRelation(const TeLine2D& line, const TeLinearRing& r)
-{
-	short mask = Relation(line, r);
-
-	if(mask & TeBOUNDARY)	// TOUCHES or CROSSES or COVERED BY
-	{
-		if(mask & TeOUTSIDE)	// TOUCHES or CROSSES
-		{
-			if(mask & TeINSIDE)
-				return TeCROSSES;
-			else
-				return TeTOUCHES;
-		}
-		else	// COVERED BY
-			return TeCOVEREDBY;
-
-	}
-	else	// DISJOINT or WITHIN
-	{
-		if(mask & TeINSIDE)	
-			return TeWITHIN;
-		else				
-			return TeDISJOINT;
-	}
-}
-
-/*! \fn short TopologicRelation(const TeLinearRing& rRed, const TeLinearRing& rBlue)
-    \brief This function returns the relationship between two rings (treated as simple polygons with no holes).
-	\param rRed  The ring to test relationship.
-	\param rBlue The ring to test relationship.
-
-	This function returns the relationship between two rings.
-*/
-short TopologicRelation(const TeLinearRing& rRed, const TeLinearRing& rBlue)
-{
-	// See the intersection between the points of rRed and the three components of rBlue (Boundary, Exterior, Interior)
-	short rel = Relation(rRed, rBlue);
-
-	if((rel & TeOUTSIDE) && (rel & TeINSIDE) && (rel & TeBOUNDARY))
-		return TeOVERLAPS;
-
-	if((rel & TeOUTSIDE) && !(rel & TeINSIDE) && (rel & TeBOUNDARY))
-	{
-		if(TeWithinOrCoveredByOrEquals(rBlue.box(), rRed.box()))
-		{
-			short rel_aux = Relation(rBlue, rRed);
-
-			if((rel_aux & TeINSIDE) && !(rel_aux & TeOUTSIDE) && (rel_aux & TeBOUNDARY))
-				return TeCOVERS;
-		}
-		
-		return TeTOUCHES;
-	}
-
-	if((rel & TeOUTSIDE) && !(rel & TeINSIDE) && !(rel & TeBOUNDARY))
-	{
-		if(TeWithinOrCoveredByOrEquals(rBlue.box(), rRed.box()))
-		{
-			if(TeRelation(rBlue[0], rRed) == TeINSIDE)
-				return TeCONTAINS;
-		}
-		
-		return TeDISJOINT;
-	}
-
-	if(!(rel & TeOUTSIDE) && (rel & TeINSIDE) && !(rel & TeBOUNDARY))
-		return TeWITHIN;
-
-	if(!(rel & TeOUTSIDE) && (rel & TeINSIDE) && (rel & TeBOUNDARY))
-		return TeCOVEREDBY;
-
-	if(rel == TeBOUNDARY)
-		return TeEQUALS;
-
-	return TeINTERSECTS;
-}
-
-/*! \fn short TeTopologicRelation(const TeLinearRing& rRed, const TeLinearRing& rBlue, vector<TeLinearRing>& rings, short& rel)
-    \brief This function returns the relationship between the ring and the polygon inner rings.
-	\param rRed  The ring to test relationship.
-	\param pBlue The polygon to test relationship.
-	\param rings Inner rings from blue polygon that is inside or is covered by red external polygon.
-	\param rel   The relation between external red ring and external blue ring.
-
-	This function returns the relationship between the ring and the polygon inner rings.
-*/
-short LookAtInnerRings(const TeLinearRing& rRed, const TePolygon& pBlue, vector<TeLinearRing>& rings, short& rel)
-{
-	register unsigned int i = 1;
-	register unsigned int nRings = pBlue.size();
-
-	for(; i < nRings; ++i)
-	{
-		switch(TopologicRelation(rRed, pBlue[i]))
-		{
-			case TeCOVEREDBY : return TeTOUCHES;
-
-			case TeWITHIN	 : return TeDISJOINT;
-
-			case TeOVERLAPS  : return TeOVERLAPS;
-
-			case TeEQUALS    : return TeTOUCHES;
-
-			case TeDISJOINT  : continue;	// this ring is outside the external ring, so it doesn't contribute to the relationship.
-
-			case TeTOUCHES    : rel = TeCOVEREDBY;	// change rel if rel is within.
-				                continue;
-
-			case TeCOVERS    : rings.push_back(pBlue[i]);
-							   rel = TeCOVEREDBY;	// we know they share boundary!!!!
-							   break;
-
-			case TeCONTAINS  : rings.push_back(pBlue[i]);
-							   break;				// doesn't share boundary
-		}
-	}
-
-	return TeUNDEFINEDREL;
-}
-
-/*! \fn short TestInnerRings(const TePolygon& pRed, vector<TeLinearRing>& rings)
-    \brief This function returns the relationship between the ring and the polygon inner rings.
-	\param pRed  The inner rings from pRed to test relationship.
-	\param rings Inner rings from blue polygon that is inside or is covered by red external polygon.
-
-	This function returns the relationship between the inner ring of pRed and the inner rings in rings.
-*/
-short TestInnerRings(const TePolygon& pRed, vector<TeLinearRing>& rings)
-{
-	unsigned int nRedRings = pRed.size();
-	unsigned int nBlueRings = rings.size();
-
-	//if((nRedRings - 1) != nBlueRings)
-	//	return TeOVERLAPS;
-
-	unsigned int i = 1;
-	unsigned int j = 0;
-
-	bool find = false;
-
-	set<unsigned int> blueRingsProcessed;
-
-	set<unsigned int> redRingsContainsCovers;
-
-	short rel = 0;
-
-	for(; i < nRedRings; ++i)
-	{
-		find = false;
-
-		for(j = 0; j < nBlueRings; ++j)
-		{
-			if(blueRingsProcessed.find(j) != blueRingsProcessed.end())
-				continue;
-
-			switch(TopologicRelation(pRed[i], rings[j]))
-			{
-				case TeDISJOINT  : continue;	// so it doesn't contribute to the relationship yet.
-
-				case TeEQUALS    :
-									rel |= TeEQUALS;
-					                blueRingsProcessed.insert(j);
-									find = true;
-									break;
-
-				case TeCONTAINS  :
-									if(redRingsContainsCovers.find(i) != redRingsContainsCovers.end())
-										return TeOVERLAPS;
-									
-									rel |= TeCONTAINS;
-
-									redRingsContainsCovers.insert(i);
-									blueRingsProcessed.insert(j);
-									find = true;
-									break;
-
-				case TeCOVERS	:
-									if(redRingsContainsCovers.find(i) != redRingsContainsCovers.end())
-										return TeOVERLAPS;
-									
-									rel |= TeCOVERS;
-
-									redRingsContainsCovers.insert(i);
-									blueRingsProcessed.insert(j);
-									find = true;
-									break;
-									
-
-				default          :  return TeOVERLAPS;
-			}
-
-			if(find)
-				break;
-		}
-
-		if(!find)
-			return TeOVERLAPS;
-	}
-
-	return rel;
-}
-
-//---------- Topological Function ----------//
-
-// EQUALS
-template<> bool TeEquals(const TeCoord2D& c1, const TeCoord2D& c2)
-{
-	if(TeGeometryAlgorithmsPrecision::IsDifferent(c1.x(), c2.x()))
-		return false;
-
-	if(TeGeometryAlgorithmsPrecision::IsDifferent(c1.y(), c2.y()))
-		return false;
-
-	return true;
-}
-
-template<> bool TeEquals(const TePoint& p1, const TePoint& p2)
-{
-	return TeEquals(p1.location(), p2.location());
-}
-
-template<> bool TeEquals(const TeLine2D& redLine, const TeLine2D& blueLine)
-{
-	if(TeEquals(redLine.box(), blueLine.box()))
-		return TeRelation(redLine, blueLine, TeEQUALS) == TeEQUALS;
-	else
-		return false;
-}
-
-template<> bool TeEquals(const TePolygon& redPol, const TePolygon& bluePol)
-{
-	if(TeEquals(redPol.box(), bluePol.box()))
-	{
-		if(redPol.size() != bluePol.size())
-			return false;
-
-		return TeRelation(redPol, bluePol) == TeEQUALS;
-	}
-	else
-		return false;
-}
-
-template<> bool TeEquals( const TePolygonSet& ps1, const TePolygonSet& ps2 )
-{
-  if( ps1.size() == ps2.size() ) {
-    TePolygonSet::iterator it1 = ps1.begin();
-    TePolygonSet::iterator it1_end = ps1.end();
-    TePolygonSet::iterator it2 = ps2.begin();
-    
-    while( it1 != it1_end ) {
-      if( ! TeEquals( (*it1), (*it2) ) ) {
-        return false;
-      }
-      
-      ++it1;
-      ++it2;
-    }
-  
-    return true;
-  } else {
-    return false;
-  }
-}
-
-template<> bool TeEquals(const TeBox& bx1, const TeBox& bx2)
-{
-	if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.x1(), bx2.x1()))
-		return false;
-
-	if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.y1(), bx2.y1()))
-		return false;
-
-	if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.x2(), bx2.x2()))
-		return false;
-	
-	if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.y2(), bx2.y2()))
-		return false;
-
-	return true;
-}
-
-template<> bool TeEquals(const TeCell& cell1, const TeCell& cell2)
-{
-	return TeEquals(cell1.box(), cell2.box());
-}
-
-
-// DISJOINT
-bool TeDisjoint(const TeCoord2D& c1, const TeCoord2D& c2)
-{
-	if(TeGeometryAlgorithmsPrecision::IsDifferent(c1.x(), c2.x()))
-		return true;
-
-	if(TeGeometryAlgorithmsPrecision::IsDifferent(c1.y(), c2.y()))
-		return true;
-
-	return false;
-}
-
-bool TeDisjoint(const TeCoord2D& c, const TeBox& b)
-{
-	// c to the right of b
-	if(TeGeometryAlgorithmsPrecision::IsGreater(c.x(), b.x2())) 
-		return true;
-
-	// c to the left of b
-	if(TeGeometryAlgorithmsPrecision::IsGreater(b.x1(), c.x())) 
-		return true;
-
-	// c is above b
-	if(TeGeometryAlgorithmsPrecision::IsGreater(c.y(), b.y2())) 
-		return true;
-
-	// c is below b 
-	if(TeGeometryAlgorithmsPrecision::IsGreater(b.y1(), c.y())) 
-		return true;
-
-	return false;
-}
-
-bool TeDisjoint(const TeBox& bx1, const TeBox& bx2)
-{
-	// B1 to the right of B2
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.x1(), bx2.x2())) 
-		return true;
-
-	// B1 to the left of B2
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.x1(), bx1.x2())) 
-		return true;
-
-	// B2 is above B1
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.y1(), bx1.y2())) 
-		return true;
-
-	// B2 is below B1 
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.y1(), bx2.y2())) 
-		return true;
-
-	return false;
-}
-
-bool TeDisjoint(const TeCoord2D& c, const TeLine2D& l)
-{
-	return TeRelation(c, l) == TeOUTSIDE;
-}
-
-bool TeDisjoint(const TeCoord2D& c, const TePolygon& pol)
-{
-	return TeRelation(c, pol) == TeOUTSIDE;
-}
-
-bool TeDisjoint(const TePoint& p1, const TePoint& p2)
-{
-	return TeDisjoint(p1.location(), p2.location());
-}
-
-bool TeDisjoint(const TePoint& p, const TeLine2D& l)
-{
-	return TeDisjoint(p.location(), l);
-}
-
-bool TeDisjoint(const TePoint& p, const TePolygon& pol)
-{
-	return TeDisjoint(p.location(), pol);
-}
-
-bool TeDisjoint(const TeLine2D& redLine, const TeLine2D& blueLine)
-{
-	if(TeDisjoint(redLine.box(), blueLine.box()))
-		return true;
-
-	return !TeINTERSECTOR2::TeIntersects(redLine, blueLine);
-}
-
-bool TeDisjoint(const TeLine2D& l, const TePolygon& pol)
-{
-	if(TeDisjoint(l.box(), pol.box()))
-		return true;
-
-	return TeRelation(l, pol) == TeDISJOINT;
-}
-
-bool TeDisjoint(const TePolygon& redPol, const TePolygon& bluePol)
-{
-	if(TeDisjoint(redPol.box(), bluePol.box()))
-		return true;
-	else
-		return TeRelation(redPol, bluePol) == TeDISJOINT;
-}
-
-bool TeDisjoint(const TeCell& cell1, const TeCell& cell2)
-{
-	return TeDisjoint(cell1.box(), cell2.box());
-}
-
-bool TeDisjoint(const TeCell& cell, const TeLine2D& line)
-{
-	return TeDisjoint(line, TeMakePolygon(cell.box()));
-}
-
-bool TeDisjoint(const TeCell& cell, const TePolygon& pol)
-{
-	return TeDisjoint(pol, TeMakePolygon(cell.box()));
-}
-
-bool TeDisjoint(const TeCell& cell, const TePoint& point)
-{
-	return TeDisjoint(point.location(), cell.box());
-}
-
-
-// INTERSECTS
-
-template<> bool TeIntersects(const TeCoord2D& c, const TeBox& b)
-{
-	// c to the right of b
-	if(TeGeometryAlgorithmsPrecision::IsGreater(c.x(), b.x2())) 
-		return false;
-
-	// c to the left of b
-	if(TeGeometryAlgorithmsPrecision::IsGreater(b.x1(), c.x())) 
-		return false;
-
-	// c is above b
-	if(TeGeometryAlgorithmsPrecision::IsGreater(c.y(), b.y2())) 
-		return false;
-
-	// c is below b 
-	if(TeGeometryAlgorithmsPrecision::IsGreater(b.y1(), c.y())) 
-		return false;
-
-	return true;
-}
-
-template<> bool TeIntersects(const TePoint& p, const TeBox& b)
-{
-	return TeIntersects(p.location(), b);
-}
-
-template<> bool TeIntersects(const TeBox& bx1, const TeBox& bx2)
-{
-	// B1 to the right of B2
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.x1(), bx2.x2())) 
-		return false;
-
-	// B1 to the left of B2
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.x1(), bx1.x2())) 
-		return false;
-
-	// B2 is above B1
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.y1(), bx1.y2())) 
-		return false;
-
-	// B2 is below B1 
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.y1(), bx2.y2())) 
-		return false;
-
-	return true;
-}
-
-
-// TOUCHES
-bool TeTouches(const TeCoord2D& c, const TeLine2D& l)
-{
-	return TeRelation(c, l) == TeBOUNDARY;
-}
-
-bool TeTouches(const TeCoord2D& c, const TePolygon& pol)
-{
-	return TeRelation(c, pol) == TeBOUNDARY;
-}
-
-bool TeTouches(const TePoint& p, const TeLine2D& l)
-{
-	return TeTouches(p.location(), l);
-}
-
-bool TeTouches(const TePoint& p, const TePolygon& pol)
-{
-	return TeTouches(p.location(), pol);
-}
-
-bool TeTouches(const TeLine2D& redLine, const TeLine2D& blueLine)
-{
-	if(TeDisjoint(redLine.box(), blueLine.box()))
-		return false;
-
-	return TeRelation(redLine, blueLine, TeTOUCHES) == TeTOUCHES;	
-}
-
-bool TeTouches(const TeLine2D& l, const TePolygon& pol)
-{
-	if(TeDisjoint(l.box(), pol.box()))
-		return false;
-
-	return TeRelation(l, pol) == TeTOUCHES;
-}
-
-bool TeTouches(const TePolygon& redPol, const TePolygon& bluePol)
-{
-	if(TeDisjoint(redPol.box(), bluePol.box()))
-		return false;
-
-	return TeRelation(redPol, bluePol) == TeTOUCHES;
-}
-
-bool TeTouches(const TeBox& bx1, const TeBox& bx2)
-{	
-	// bx1 may touches its right wall in bx2 left wall
-	// or bx1 may touches its left wall in bx2 right wall
-	if(TeGeometryAlgorithmsPrecision::IsEqual(bx1.x2(), bx2.x1()) || TeGeometryAlgorithmsPrecision::IsEqual(bx1.x1(), bx2.x2()))
-	{
-		// bx1 is below bx2
-		if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.y1(), bx1.y2()))
-			return false;
-
-		// bx1 is above bx2
-		if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.y1(), bx2.y2()))
-			return false;
-
-		// touches
-		return true;	
-	}
-
-	// bx1 may touches its bottom wall in bx2 top wall
-	// or bx1 may touches its top wall in bx2 bottom wall
-	if(TeGeometryAlgorithmsPrecision::IsEqual(bx1.y1(), bx2.y2()) || TeGeometryAlgorithmsPrecision::IsEqual(bx1.y2(), bx2.y1()))
-	{
-		// bx1 is left of bx2
-		if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.x1(), bx1.x2()))
-			return false;
-
-		// bx1 is right of bx2
-		if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.x1(), bx2.x2()))
-			return false;
-
-		// touches
-		return true;
-	}
-
-	// doesn't touches
-	return false;
-}
-
-bool TeTouches(const TeCell& c1, const TeCell& c2)
-{
-	return TeTouches(c1.box(), c2.box());
-}
-
-bool TeTouches(const TeLine2D& line, const TeCell& cell)
-{
-	return TeTouches(line, TeMakePolygon(cell.box()));
-}
-
-bool TeTouches(const TeCell& c1, const TePolygon& poly)
-{
-	return  TeTouches (poly, TeMakePolygon(c1.box()));
-}
-
-bool TeTouches(const TePoint& point,const TeCell& c1)
-{
-	return TeTouches(point.location(), TeMakePolygon(c1.box()));
-}
-
-
-// CROSSES
-bool TeCrosses(const TeLine2D& redLine, const TeLine2D& blueLine)
-{
-	if(TeDisjoint(redLine.box(), blueLine.box()))
-		return false;
-	else
-		return TeRelation(redLine, blueLine, TeCROSSES) == TeCROSSES;
-}
-
-bool TeCrosses(const TeLine2D& l, const TePolygon& pol)
-{
-	if(TeDisjointOrTouches(l.box(), pol.box()))
-		return false;
-	else
-		return TeRelation(l, pol) == TeCROSSES;
-}
-
-bool TeCrosses(const TeLine2D& l, const TeCell& cell)
-{
-	return TeCrosses(l, TeMakePolygon(cell.box()));
-}
-
-
-// WITHIN
-bool TeWithin(const TeCoord2D& c1, const TeCoord2D& c2)
-{
-	return TeEquals(c1, c2);
-}
-
-bool TeWithin(const TeCoord2D& c, const TeBox& b)
-{
-	// c to the right of b left wall AND c to the left of b right wall
-	// AND c below b top wall AND c above b bottom wall => then c is on b interior.
-	return (TeGeometryAlgorithmsPrecision::IsGreater(c.x(), b.x1()) && TeGeometryAlgorithmsPrecision::IsGreater(b.x2(), c.x()) && TeGeometryAlgorithmsPrecision::IsGreater(b.y2(), c.y()) && TeGeometryAlgorithmsPrecision::IsGreater(c.y(), b.y1()));
-}
-
-bool TeWithin(const TeCoord2D& c, const TeLine2D& l)
-{
-	return TeRelation(c, l) == TeINSIDE;
-}
-
-bool TeWithin(const TeCoord2D& c, const TePolygon& pol)
-{
-	return TeRelation(c, pol) == TeINSIDE;
-}
-
-bool TeWithin(const TePoint& p1, const TePoint& p2)
-{
-	return TeWithin(p1.location(), p2.location());
-}
-
-bool TeWithin(const TePoint& p, const TeLine2D& l)
-{
-	return TeWithin(p.location(), l);
-}
-
-bool TeWithin(const TePoint& p, const TePolygon& pol)
-{
-	return TeWithin(p.location(), pol);
-}
-
-bool TeWithin(const TeLine2D& redLine, const TeLine2D& blueLine)
-{
-	if(TeWithinOrCoveredByOrEquals(redLine.box(), blueLine.box()))
-		return TeRelation(redLine, blueLine, TeWITHIN) == TeWITHIN;	
-	else
-		return false;
-}
-
-bool TeWithin(const TeLine2D& l, const TePolygon& pol)
-{
-	if(TeWithinOrCoveredByOrEquals(l.box(), pol.box()))	
-		return TeRelation(l, pol) == TeWITHIN;
-
-
-	return false;
-}
-
-bool TeWithin(const TePolygon& redPol, const TePolygon& bluePol)
-{
-	if(TeWithinOrCoveredByOrEquals(redPol.box(), bluePol.box()))	
-		return TeRelation(redPol, bluePol) == TeWITHIN;
-	else
-		return false;
-}
-
-bool TeWithin(const TeBox& bx1, const TeBox& bx2)
-{
-	// bx1 left wall is left of or on bx2 left wall
-	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx2.x1(), bx1.x1()))
-		return false;
-
-	// bx1 right wall is right of or on bx2 right wall
-	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx1.x2(), bx2.x2()))
-		return false;
-
-	// bx1 is below bx2 or on.
-	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx2.y1(), bx1.y1()))
-		return false;
-
-	// bx1 is above bx2 or on
-	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx1.y2(), bx2.y2()))
-		return false;
-
-	return true;	
-}
-
-bool TeWithin(const TeCell& cell1, const TeCell& cell2)
-{
-	return TeWithin(cell1.box(), cell2.box());
-}
-
-bool TeWithin(const TeLine2D& line, const TeCell& cell)
-{
-	return TeWithin(line, TeMakePolygon(cell.box()));
-}
-
-
-bool TeWithin(const TeCell& cell, const TePolygon& poly)
-{
-	return TeWithin(TeMakePolygon(cell.box()), poly);
-}
-
-bool TeWithin(const TePoint& point, const TeCell& cell)
-{
-	return TeWithin(point.location(), cell.box());
-}
-
-
-// OVERLAPS
-bool TeOverlaps(const TeLine2D& redLine, const TeLine2D& blueLine)
-{
-	if(TeDisjoint(redLine.box(), blueLine.box()))
-		return false;
-	else
-		return TeRelation(redLine, blueLine, TeOVERLAPS) == TeOVERLAPS;
-}
-
-bool TeOverlaps(const TePolygon& redPol, const TePolygon& bluePol)
-{
-	//if(TeDisjoint(redPol.box(), bluePol.box()))
-	if(TeDisjointOrTouches(redPol.box(), bluePol.box()))
-		return false;
-	else
-		return TeRelation(redPol, bluePol) == TeOVERLAPS;
-}
-
-bool TeOverlaps(const TeCell& cell1, const TeCell& cell2)
-{
-	return TeOverlaps(TeMakePolygon(cell1.box()), TeMakePolygon(cell2.box()));
-}
-
-bool TeOverlaps(const TeCell& cell, const TePolygon& poly)
-{
-	return TeOverlaps(TeMakePolygon(cell.box()), poly);
-}
-
-
-// COVERED BY
-bool TeCoveredBy(const TeLine2D& redLine, const TeLine2D& blueLine)
-{
-	if(TeWithinOrCoveredByOrEquals(redLine.box(), blueLine.box()))
-		return TeRelation(redLine, blueLine, TeCOVEREDBY) == TeCOVEREDBY;
-	else
-		return false;
-}
-
-bool TeCoveredBy(const TeLine2D& l, const TePolygon& pol)
-{
-	if(TeWithinOrCoveredByOrEquals(l.box(), pol.box()))
-		return TeRelation(l, pol) == TeCOVEREDBY;
-	else
-		return false;
-}
-
-bool TeCoveredBy(const TePolygon& redPol, const TePolygon& bluePol)
-{
-	if(TeWithinOrCoveredByOrEquals(redPol.box(), bluePol.box()))
-		return TeRelation(redPol, bluePol) == TeCOVEREDBY;
-	else
-		return false;
-}
-
-bool TeCoveredBy(const TeCell& cell1, const TeCell& cell2)
-{
-	return TeCoveredBy(TeMakePolygon(cell1.box()), TeMakePolygon(cell2.box()));
-}
-
-bool TeCoveredBy(const TePolygon& poly, const TeCell& cell)
-{
-	return TeCoveredBy(poly, TeMakePolygon(cell.box()));
-}
-
-bool TeCoveredBy(const TeLine2D& line, const TeCell& cell)
-{
-	return TeCoveredBy(line, TeMakePolygon(cell.box()));
-}
-
-//---------- Box Tests ----------//
-
-bool TeDisjointOrTouches(const TeBox& bx1, const TeBox& bx2)
-{
-	// B1 to the right of or on B2
-	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx1.x1(), bx2.x2())) 
-		return true;
-
-	// B1 to the left of or on B2
-	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx2.x1(), bx1.x2())) 
-		return true;
-
-	// B2 is above or on B1
-	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx2.y1(), bx1.y2())) 
-		return true;
-
-	// B2 is below or on B1 
-	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx1.y1(), bx2.y2())) 
-		return true;
-
-	return false;
-}
-
-template<>
-bool TeWithinOrCoveredByOrEquals(const TeBox& bx1, const TeBox& bx2)
-{
-	// bx1 left wall is left of bx2 left wall
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.x1(), bx1.x1()))
-		return false;
-
-	// bx1 right wall is right of bx2 right wall
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.x2(), bx2.x2()))
-		return false;
-
-	// bx1 is below bx2
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.y1(), bx1.y1()))
-		return false;
-
-	// bx1 is above bx2
-	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.y2(), bx2.y2()))
-		return false;
-
-	return true;	
-}
-
-template<>
-bool TeWithinOrCoveredByOrEquals(const TeLine2D& line1, const TeLine2D& line2)
-{
-	if(TeWithinOrCoveredByOrEquals(line1.box(), line2.box()))
-	{
-		short r;
-		short rel = TeRelation(line1, line1, r);
-
-		if((rel&TeWITHIN) || (rel&TeCOVEREDBY) || (rel&TeEQUALS))
-		   return true;
-
-		return false;
-	}
-	return false;
-}
-
-template<>
-bool TeWithinOrCoveredByOrEquals(const TeLine2D& line1, const TePolygon& pol)
-{
-	if(TeWithinOrCoveredByOrEquals(line1.box(), pol.box()))
-	{
-		short rel = TeRelation(line1, pol);
-
-		if((rel&TeWITHIN) || (rel&TeCOVEREDBY))
-		   return true;
-
-		return false;
-	}
-	return false;
-}
-
-template<>
-bool TeWithinOrCoveredByOrEquals(const TePolygon& pol1, const TePolygon& pol2)
-{
-	if(TeWithinOrCoveredByOrEquals(pol1.box(), pol2.box()))
-	{
-		short rel = TeRelation(pol1, pol2);
-
-		if((rel&TeWITHIN) || (rel&TeCOVEREDBY) || (rel&TeEQUALS))
-		   return true;
-
-		return false;
-	}
-	return false;
-}
-
-
-bool TeWithinOrTouches(const TeCoord2D& c, const TeCoord2D& c1, const TeCoord2D& c2)
-{
-	// c is to the right of c1 and c2
-	if(TeGeometryAlgorithmsPrecision::IsGreater(c.x(), c1.x()) && TeGeometryAlgorithmsPrecision::IsGreater(c.x(), c2.x()))
-		return false;
-
-	// c is above c1 and c2
-	if(TeGeometryAlgorithmsPrecision::IsGreater(c.y(), c1.y()) && TeGeometryAlgorithmsPrecision::IsGreater(c.y(), c2.y()))
-		return false;
-
-	// c is to the left of c1 and c2
-	if(TeGeometryAlgorithmsPrecision::IsSmaller(c.x(), c1.x()) && TeGeometryAlgorithmsPrecision::IsSmaller(c.x(), c2.x()))
-		return false;
-
-	// c is below c1 and c2
-	if(TeGeometryAlgorithmsPrecision::IsSmaller(c.y(), c1.y()) && TeGeometryAlgorithmsPrecision::IsSmaller(c.y(), c2.y()))
-		return false;
-
-	return true;	
-}
-
-
-//---------- Intersection Functions ----------//
-
-bool TeIntersection(const TeBox& bx1, const TeBox& bx2, TeBox& bout)
-{
-	if(TeDisjoint(bx1, bx2))
-		return false;
-
-	double x1 = MAX(bx1.x1(),bx2.x1());
-	double x2 = MIN(bx1.x2(),bx2.x2());
-	double y1 = MAX(bx1.y1(),bx2.y1());
-	double y2 = MIN(bx1.y2(),bx2.y2());
-
-	bout = TeBox(x1, y1, x2, y2);
-
-	return true;
-}
-
-TeCoordPairVect	TeGetIntersections(const TePolygon &poly, const double& y)
-{
-	TeCoordPairVect		Segments;
-	vector<double>		crossList, segListInY;
-	unsigned int		nholes = poly.size();
-			
-	//for each ring of the polygon
-	for (unsigned int count=0; count<nholes; count++ ) 		
-	{
-		TeLinearRing coords = poly[count];
-		//for each segment of the ring
-		for  (unsigned int j=0;  j < (coords.size() - 1); j++ ) 		
-		{
-			// Get one segment
-			TeCoord2D coord0 = coords[j];
-			TeCoord2D coord1 = coords[j+1];
-
-			bool yflag0 = ( coord0.y() > y );  
-			bool yflag1 = ( coord1.y() > y ); 
-
-			//treating a special case: when the segment touches or is ON the y axe  
-			//if there is a special case, we must test if the middle point
-			//of each segment is inside or outside of the polygon 
-			if((coord0.y()!=y) && (coord1.y()==y)) 
-			{
-				bool pointsInY = true;
-				bool lowerY1 = coord0.y()<y;
-                unsigned int i = j+2;
-				
-				TeCoord2D lastPointInY;
-				TeCoord2D firstPointOutY = coord1;
-				
-				while(pointsInY) 
-				{
-					lastPointInY = firstPointOutY; 
-
-					// Get the next point 
-					if(i>=coords.size())
-						i=1;
-                    firstPointOutY = coords[i];
-					++i;
-
-					//Verify if it is on the y axe
-					pointsInY = firstPointOutY.y()==y;
-				}
-
-				bool lowerY2 = firstPointOutY.y()<y;
-				//the segment touches the y axe only in one point and cross the axe Y
-				if((lastPointInY==coord1) && (lowerY1!=lowerY2)) 
-					crossList.push_back(coord1.x());	
-				else 
-				{
-					segListInY.push_back (coord1.x());
-					segListInY.push_back (lastPointInY.x());
-				}
-			}
-			else if(coord0.y()==y)
-				continue;
-			// line crosses ring horizontally 
-			else if ( yflag0 != yflag1 )
-			{ 
-				double slope =  ( coord1.x() - coord0.x() ) / ( coord1.y() - coord0.y());
-				double xcross = ( y -   coord0.y() )* slope + coord0.x();
-				crossList.push_back (xcross);	
-			}
-		}
-	}
-	
-	if(crossList.empty())
-		crossList = segListInY;
-	else if(!segListInY.empty())
-	{
-		//insert segListInY in the cross list 
-		for(unsigned i=0; i<segListInY.size(); ++i) 
-			crossList.push_back (segListInY[i]);
-
-		sort (crossList.begin(), crossList.end());
-
-		vector<double> aux;
-		//Verify if the segment middle point intersects the polygon 
-		for(unsigned i=1; i<crossList.size(); ++i)
-		{
-			//calculates the middle point
-			double x0 = crossList[i-1];
-			double x1 = crossList[i];
-			double x = x0 + (x1-x0)/2;
-			
-			TeCoord2D pt (x, y);
-			if (!TeDisjoint(pt, poly)) 
-			{
-				aux.push_back (x0);
-				aux.push_back (x1);
-			}
-		}
-		crossList.clear();
-		crossList = aux;
-    }
-	
-	// Sort the x-intersections
-	sort (crossList.begin(), crossList.end());
-	
-	// Make the result segments
-	vector<double>::iterator it = crossList.begin();
-	while ( it != crossList.end())
-	{
-		TeCoordPair cp;
-
-		cp.pt1 = TeCoord2D ( (*it), y);
-		++it;
-		if ( it == crossList.end() ) 
-			break;
-
-		cp.pt2 = TeCoord2D ( (*it), y);
-		++it;
-
-		Segments.push_back ( cp );
-	}
-	return Segments;
-}
-
-//---------- Union Operators ----------//
-
-TeBox TeUnion(const TeBox& bx1, const TeBox& bx2)
-{
-	double x1 = MIN(bx1.x1(), bx2.x1());
-	double y1 = MIN(bx1.y1(), bx2.y1());
-		
-	double x2 = MAX(bx1.x2(), bx2.x2());
-	double y2 = MAX(bx1.y2(), bx2.y2());		
-
-	return TeBox(x1, y1, x2, y2);
-}
-
-
-//---------- Localization Functions ----------//
-
-bool TePointInPoly(const TeCoord2D& c, const TeLinearRing& r)
-{
-	if(r.size() < 4)
-		return false;
-
-	register double	ty, tx;
-
-	register const unsigned int nVertices = r.size();
-
-	register bool inside_flag = false;
-
-	register int j, yflag0, yflag1;
-
-	TeLinearRing::iterator vtx0, vtx1;
-
-	tx = c.x();
-    ty = c.y();
-    
-	vtx0 = r.end() - 2;
-
-    yflag0 = (vtx0->y() >= ty);
-
-    vtx1 = r.begin();
-
-    for(j = nVertices; --j; )
-	{
-		yflag1 = (vtx1->y() >= ty);
-		
-		if(yflag0 != yflag1)
-		{
-			if(((vtx1->y() - ty) * (vtx0->x() - vtx1->x()) >=
-		        (vtx1->x() - tx) * (vtx0->y() - vtx1->y())) == yflag1)
-			{
-				inside_flag = !inside_flag ;
-			}
-		}
-
-		yflag0 = yflag1 ;
-		vtx0 = vtx1 ;
-		vtx1++;
-    }
-
-	return inside_flag;
-}
-
-bool TeIsOnSegment(const TeCoord2D& c, const TeCoord2D& c1, const TeCoord2D& c2)
-{
-	if(TeWithinOrTouches(c, c1, c2))
-	{
-		bool aux = false;
-
-		return TeINTERSECTOR2::TeCCW(c1, c2, c, aux) == TeNOTURN;
-	}
-
-	return false;	
-}
-
-bool TeIsOnLine(const TeCoord2D& c, const TeLine2D& l)
-{
-	if(l.size() < 2)
-		return false;
-
-	if(TeDisjoint(c, l.box()))
-		return false;
-
-	TeLine2D::iterator it = l.begin();
-
-	unsigned int nstep = l.size() - 1;
-
-	for(unsigned int i = 0; i < nstep; ++i)
-	{
-		if(TeIsOnSegment(c, *(it), *(it + 1)))
-			return true;
-		
-		++it;
-	}
-	
-	return false;
-}
-
-bool TeLocateLineSegment (TeCoord2D& pin, TeLine2D& line, int& segment, double /*tol*/)
-{
-	if (line.size() < 2) 
-		return false;
-
-	TeCoord2D pout;
-		
-	segment = 0;
-	double min_dist = TeMinimumDistance(line[0], line[1], pin, pout);
-	
-	for (unsigned int i = 2; i < line.size(); i++)
-	{
-		double dist;
-		if ((dist = TeMinimumDistance (line[i-1],line[i], pin, pout)) < min_dist)
-		{		
-				min_dist = dist;
-				segment = i - 1;
-		}
-	}
-
-	return true;
-}
-
-
-//---------- Area Functions ----------//
-
-template<> double TeGeometryArea(const TePolygon& p)
-{
-	if(p.size() > 0)
-	{
-		TePolygon::iterator it = p.begin();
-	
-		double area = fabs(Te2Area(*it));
-
-		++it;
-		
-		// subtract inner rings area.
-		while(it != p.end())
-		{
-			area -= fabs(Te2Area(*it));
-			++it;
-		}
-
-		return (area / 2.0);
-	}
-	
-	return 0.0;
-}
-
-template<> double TeGeometryArea(const TePolygonSet& ps)
-{
-	TePolygonSet::iterator it = ps.begin();
-	
-	double area = 0.0;
-	
-	while(it != ps.end())
-	{
-		area += TeGeometryArea(*it);
-		++it;
-	}
-
-	return (area);
-}
-
-template<> double TeGeometryArea(const TeBox& b)
-{
-	return ((b.x2() - b.x1()) * (b.y2() - b.y1()));
-}
-
-template<> double TeGeometryArea(const TeMultiGeometry& mGeom)
-{
-	if(mGeom.hasPolygons())
-	{
-		TePolygonSet pSet;
-		mGeom.getGeometry(pSet);
-		return TeGeometryArea(pSet);
-	}
-	else if(mGeom.hasCells())
-	{
-		TeCellSet cSet;
-		mGeom.getGeometry(cSet);
-		return TeGeometryArea(cSet);
-	}
-	return 0.;
-}
-
-//---------- ConvexHull ----------//
-
-//! If we have the  two end point equals, so we remove it.
-void removeDuplicatedCoords(vector<TeCoord2D>& coordSet)
-{
-	if(coordSet[0] == coordSet[coordSet.size() - 1])
-		coordSet.erase(coordSet.end() - 1);
-
-	return;
-}
-
-// Return a linear ring that is the convex hull of a given list of coords
-TePolygon ConvexHull(vector<TeCoord2D>& coordSet)
-{
-	// sorting the coords
-	sort(coordSet.begin(), coordSet.end(), xOrder<TeCoord2D>());
-
-	register unsigned int i = 0;
-	register unsigned int n = coordSet.size();
-
-	TeLine2D upperHull;
-	TeLine2D lowerHull;
-
-	lowerHull.add(coordSet[0]);
-	lowerHull.add(coordSet[1]);
-
-	unsigned int count = 2;
-
-	bool aux = false;
-	
-	for(i = 2; i < n; ++i)
-	{
-		lowerHull.add(coordSet[i]);
-
-		++count;
-
-		while(count > 2 && TeINTERSECTOR2::TeCCW(lowerHull[count - 3], lowerHull[count - 2], lowerHull[count - 1], aux) <= TeNOTURN)
-		{
-			lowerHull.erase(count - 2);
-			--count;
-		}
-	}
-
-	upperHull.add(coordSet[n - 1]);
-	upperHull.add(coordSet[n - 2]);
-
-	count = 2;
-
-	for(i = n - 2;  i > 0;  --i)
-	{
-		upperHull.add(coordSet[i - 1]);
-		++count;
-
-		while(count > 2 && TeINTERSECTOR2::TeCCW(upperHull[count - 3], upperHull[count - 2], upperHull[count - 1], aux) <= TeNOTURN)
-		{
-			upperHull.erase(count - 2);
-			--count;
-		}
-	}
-
-	
-	upperHull.erase(0);
-	upperHull.erase(upperHull.size() - 1);
-	
-	lowerHull.copyElements(upperHull);
-	lowerHull.add(lowerHull[0]);
-
-	TeLinearRing aux_ring(lowerHull);
-	TePolygon p;
-	p.add(aux_ring);
-	return p;
-}
-
-template<class T> TePolygon TeConvexHull(const T& coordSet)
-{
-	// creates an auxiliary line with the points of the ring
-	vector<TeCoord2D> aux;
-
-	typename T::iterator it = coordSet.begin();
-	
-	while(it != coordSet.end())
-	{
-		aux.push_back(*it);
-		++it;
-	}
-
-	// removes duplicated coords from structs like ring
-	removeDuplicatedCoords(aux);
-
-	return ConvexHull(aux);
-}
-
-template<> TePolygon TeConvexHull(const TePolygon& p)
-{
-	vector<TeCoord2D> coords;
-	back_insert_iterator<vector<TeCoord2D> > it(coords);
-	// Copy the first ring of each polygon without the last point (that is equals to the first).
-	
-	copy(p[0].begin(), p[0].end() - 1, it);
-
-	return ConvexHull(coords);
-}
-
-template<> TePolygon TeConvexHull(const TePolygonSet& ps)
-{
-	vector<TeCoord2D> coords;
-	back_insert_iterator<vector<TeCoord2D> > it(coords);
-	// Copy the first ring of each polygon without the last point (that is equals to the first).
-	
-	TePolygonSet::iterator it_ps = ps.begin();
-	while(it_ps != ps.end())
-	{
-		TeLinearRing r = (*it_ps)[0];
-		copy(r.begin(), r.end() - 1, it);
-		++it_ps;
-	}
-
-	return ConvexHull(coords);
-}
-
-template<> TePolygon TeConvexHull(const TePointSet& ps)
-{
-	vector<TeCoord2D> coords;
-	// Copy the first ring of each polygon without the last point (that is equals to the first).
-	
-	TePointSet::iterator itr = ps.begin();
-	
-	while(itr != ps.end())
-	{
-		coords.push_back(itr->location());
-
-		++itr;
-	}
-
-	return ConvexHull(coords);
-}
-
-//---------- Utilities Functions ----------//
-
-
-
-//---------- Validation Functions ----------//
-
-bool TeIsConvex(const TeLinearRing& ring)
-{
-	bool aux = false;
-
-	short orientation = TeINTERSECTOR2::TeCCW(*(ring.end() - 2), ring[0], ring[1], aux);
-
-	const unsigned int nStep = ring.size() - 1;
-	
-	for(unsigned int i = 1; i <  nStep; ++i)
-	{
-		short this_orientation = TeINTERSECTOR2::TeCCW(ring[i-1], ring[i], ring[i+1], aux);
-		
-		if(this_orientation == TeNOTURN)
-			continue;
-
-		if((orientation != TeNOTURN) && (orientation != this_orientation))
-			return false;
-
-		orientation = this_orientation;		
-	}
-
-	return true;
-}
-
-short TeOrientation(const TeLinearRing& r)
-{
-	double area = Te2Area(r);
-
-	if(area >  0.0)
-		return TeCOUNTERCLOCKWISE; 
-
-	if(area < 0.0)
-		return TeCLOCKWISE;  
-
-	return TeNOTURN;
-}
-
-void TeGetMiddlePoint(const TeCoord2D &first, const TeCoord2D &last, TeCoord2D &middle)
-{
-	double	lenght,parts,curlenght,incx,incy,
-			deltax,deltay,dx,dy;
-	short	i,nparts;
-	
-	lenght = TeDistance(first,last);
-	if(lenght == 0.)
-	{
-		middle = first;
-		return;
-	}
-
-	nparts = 2;	
-	parts = lenght/2.;
-// verify segment orientation
-	if(first.x() < last.x())
-		incx = 1.;
-	else
-		incx = -1.;
-
-	if(first.y() < last.y())
-		incy = 1.;
-	else
-		incy = -1.;
-
-	curlenght = 0.;
-	deltax = fabs(first.x()-last.x());
-	deltay = fabs(first.y()-last.y());
-	for(i=0;i<(nparts-1);i++)
-	{
-		curlenght = curlenght + parts;
-		// vertical segment
-		if(first.x() == last.x())
-		{
-			middle = TeCoord2D(first.x(),first.y()+(curlenght*incy));
-			continue;
-		}
-				
-		// horizontal segment
-		if(first.y() == last.y())
-		{
-			middle = TeCoord2D(first.x()+(curlenght*incx),first.y());
-			continue;
-		}
-		
-		// inclined segment
-		
-		// calculating X coordinate
-		dx = curlenght*deltax/lenght;
-		
-		// calculating Y coordinate
-		dy = curlenght*deltay/lenght;
-		middle = TeCoord2D(first.x()+(dx*incx),first.y()+(dy*incy));
-	}
-}
-
-//---------- Metric Functions ----------//
-
-double TeDistance(const TeCoord2D& c1, const TeCoord2D& c2)
-{
-	return sqrt(((c2.x() - c1.x()) * (c2.x() - c1.x())) + ((c2.y()-c1.y()) * (c2.y() - c1.y())));
-}
-
-double TeLength(const TeLine2D& l)
-{
-	double len = 0.0;
-
-	unsigned int nStep = l.size() - 1;
-
-	for(unsigned int i = 0 ; i < nStep; ++i)
-		len += TeDistance(l[i], l[i+1]);
-	
-	return len;
-}
-
-double TePerpendicularDistance(const TeCoord2D& first, const TeCoord2D& last, const TeCoord2D& pin, TeCoord2D &pinter)
-{
-	double	d12,xmin,ymin;
-
-	double xi = first.x();
-	double xf = last.x();
-	double yi = first.y();
-	double yf = last.y();
-	double x = pin.x();
-	double y = pin.y();
-		
-	double dx = xf - xi;
-	double dy = yf - yi;
-	double a2 = (y - yi) * dx - (x - xi)*dy;
-	
-    if(dx==0. && dy==0.)
-	{
-		d12= sqrt(((x - xi) * (x - xi)) + ((y - yi) * (y - yi)));
-		d12 *= d12;
-	}
-	else
-		d12= a2 * a2 / (dx * dx + dy * dy);
-
-	if (dx == 0.)
-	{
-		xmin = xi;
-		ymin = y;
-	}
-	else if (dy == 0.)
-	{
-		xmin = x;
-		ymin = yi;
-	}
-	else
-	{
-		double alfa = dy / dx;
-		xmin = (x + alfa * (y - yi) + alfa * alfa * xi) / (1. + alfa * alfa);
-		ymin = (x - xmin) / alfa + y;	
-	}
-	
-	pinter = TeCoord2D(xmin, ymin);		
-	return (sqrt(d12));
-}
-
-double TeMinimumDistance (const TeCoord2D& first, const TeCoord2D& last, const TeCoord2D& pin, TeCoord2D& pout, double /*tol*/)
-{
-	TeCoord2D	pinter;
-	TeBox 		sbox(MIN(first.x(),last.x()),
-					 MIN(first.y(),last.y()),
-					 MAX(first.x(),last.x()),
-					 MAX(first.y(),last.y()));
-
-	double d = TePerpendicularDistance (first, last, pin, pinter);
-	double dmin = TeMAXFLOAT;
-
-	// Perpendicular minimum distance point was found.
-	if (TeIntersects (pinter, sbox))
-	{
-		dmin = d;
-		pout = pinter;
-	}
-	else  
-	{
-		// Perpendicular minimum distance point could not be found. 
-		// The segment vertices distances will analyzed
-		double d1 = TeDistance (first, pin);
-		double d2 = TeDistance (last, pin);
-		if (d1 <= d2) 
-		{
-			dmin = d1;
-			pout = first;
-		}
-		else if (d2 < dmin) 
-		{
-			dmin = d2;
-			pout = last;
-		}
-	}
-
-	return dmin;
-}
-
-
-//---------- Relation Functions ----------//
-
-short TeRelation(const TeCoord2D& c, const TeLine2D& l)
-{
-	if(TeEquals(c, l[0]) || TeEquals(c, l[l.size() - 1]))
-	{
-		// Ring doesn't have bundaries, only interiors.
-		if(l.isRing())
-			return TeINSIDE;
-
-		return TeBOUNDARY;
-	}
-
-	if(TeIsOnLine(c, l))
-		return TeINSIDE;
-
-	return TeOUTSIDE;
-}
-
-short TeRelation(const TeCoord2D& c, const TeLinearRing& r)
-{
-	if(TeDisjoint(c, r.box()))
-		return TeOUTSIDE;
-
-	if(TeIsOnLine(c, r))
-		return TeBOUNDARY;
-
-	if(TePointInPoly(c, r))
-		return TeINSIDE;
-	else
-		return TeOUTSIDE;
-}
-
-short TeRelation(const TeCoord2D& c, const TePolygon& pol)
-{
-	short rel = TeRelation(c, pol[0]);
-	
-	if(rel != TeINSIDE)
-		return rel;
-	else	// If point is inside exterior ring
-	{
-		unsigned int size = pol.size();
-
-		for(unsigned int i = 1; i < size; ++i)
-		{
-			rel = TeRelation(c, pol[i]);
-		
-			switch(rel)
-			{
-				// If point is inside a hole so it is on polygon's outside.
-				case TeINSIDE    :	return TeOUTSIDE;
-
-				// If point is on boundary so it is on polygon's boundary.
-				case TeBOUNDARY  :  return TeBOUNDARY;
-			}
-		}
-	}
-
-	// If the point is inside exterior ring and is not on one of the holes so it is in polygon's interior.
-	return TeINSIDE;
-}
-
-short TeRelation(const TePoint& p, const TePolygon& pol)
-{ 
-	return (TeRelation(p.location(), pol)); 
-}
-
-short TeRelation(const TeCoord2D& c, const TePolygonSet& pSet)
-{
-	if(TeDisjoint(c, pSet.box()))
-		return TeOUTSIDE;
-
-	unsigned int size = pSet.size();
-
-	for(unsigned int i = 0; i < size; ++i)
-	{
-		short rel = TeRelation(c, pSet[i]);
-		
-		if(rel & TeINSIDE)
-			return TeINSIDE;
-		
-		if(rel & TeBOUNDARY)
-			return TeBOUNDARY;
-	}
-
-	return TeOUTSIDE;
-}
-
-short TeRelation(const TeLine2D& lRed, const TeLine2D& lBlue, const short& relation)
-{
-	TeINTERSECTOR2::TeVectorBoundaryIP report;
-
-	if(TeINTERSECTOR2::TeSafeIntersections(lRed, lBlue, report))
-	{
-		short rel = Relation(lRed, lBlue, report, relation);		
-
-		// Stop to check, because touches can't occur anymore
-		if((relation == TeTOUCHES || relation == TeCROSSES) && rel != relation)
-			return TeUNDEFINEDREL;
-
-		if(rel != TeUNDEFINEDREL)
-			return rel;
-
-		TeINTERSECTOR2::TeVectorBoundaryIP::iterator it = report.begin();
-		TeINTERSECTOR2::TeVectorBoundaryIP::iterator it_end = report.end();
-		
-		for(unsigned int i = 0; i < report.size(); ++i)
-		{
-			swap(report[i].redPartNum_, report[i].bluePartNum_);
-			swap(report[i].redSegNum_, report[i].blueSegNum_);
-		}
-
-		rel = Relation(lBlue, lRed, report, relation);
-
-		if(rel != TeUNDEFINEDREL)
-			return ConverseRelation(rel);
-		else
-			return TeOVERLAPS;
-	}
-	else
-		return TeDISJOINT;
-}
-
-short TeRelation(const TeLine2D& line, const TePolygon& pol)
-{
-	short rel = TopologicRelation(line, pol[0]);
-
-	if(rel & TeTOUCHES || rel & TeCROSSES || rel & TeDISJOINT)
-		return rel;
-
-	// If relation is WITHIN or COVERED BY we need to test inner rings.
-	register unsigned int i = 1;
-	register unsigned int nRings = pol.size();
-
-	for(; i < nRings; ++i)
-	{
-		short rel_aux = TopologicRelation(line, pol[i]);
-
-		switch(rel_aux)
-		{
-			case TeCROSSES   : return TeCROSSES;
-
-			case TeCOVEREDBY : return TeTOUCHES;
-
-			case TeTOUCHES   : rel = TeCOVEREDBY;
-				               break;	// Needs to check other holes.
-
-			case TeWITHIN    : return TeDISJOINT;
-
-			case TeDISJOINT  : break;	// Keeps rel and check other inner rings
-		}
-	}
-
-	return rel;
-}
-
-short TeRelation(const TePolygon& pRed, const TePolygon& pBlue)
-{
-
-	short rel = TopologicRelation(pRed[0], pBlue[0]);
-
-	if(rel & TeTOUCHES || rel & TeOVERLAPS || rel & TeDISJOINT)
-		return rel;
-
-	
-	short rel_external_ring = TeUNDEFINEDREL;
-
-	bool converse = false;
-
-	vector<TeLinearRing> innerRingsToTest;
-
-	switch(rel)
-	{
-		case TeWITHIN		: 
-		case TeCOVEREDBY	:
-	                          // if pBlue has inner rings.
-			                  if(pBlue.size() > 1)
-							  {
-								  rel_external_ring = LookAtInnerRings(pRed[0], pBlue, innerRingsToTest, rel);	
-							  }
-							  else	// else if it hasn't
-							  {
-								  return rel;
-							  }
-							  break;
-
-		case TeCONTAINS		:
-		case TeCOVERS		: 
-							  // if pRed has inner rings.
-			                  if(pRed.size() > 1)
-							  {
-								  rel_external_ring = LookAtInnerRings(pBlue[0], pRed, innerRingsToTest, rel);							      
-							  }
-							  else	// else if it hasn't
-							  {
-								  return rel;
-							  }
-
-							  converse = true;
-							  break;
-
-		case TeEQUALS		:
-			                  if(pRed.size() != pBlue.size())
-								  return TeOVERLAPS;
-
-							  if(pRed.size() == 1 && pBlue.size() == 1)
-								  return rel;
-
-							  for(unsigned int k = 1; k < pBlue.size(); k++)
-								  innerRingsToTest.push_back(pBlue[k]);
-
-							  rel_external_ring = TeUNDEFINEDREL;
-	}
-	
-	if(rel_external_ring != TeUNDEFINEDREL)	
-		return rel_external_ring;	
-
-	// If we are here, so we need to test 
-	if(converse)	// COVERS or CONTAINS
-	{
-		if(pBlue.size() == 1 && innerRingsToTest.size() == 0)
-		{
-			TeSpatialRelation spatialRel = (TeSpatialRelation)rel;
-			if (spatialRel == TeCOVEREDBY)
-				return TeCOVERS;
-			else
-				return rel;
-			//return ((TeSpatialRelation)rel == TeCOVEREDBY) ? TeCOVERS : rel;	// entrou apenas no touches do lookat inner rings 
-
-		}
-		// The result may be: overlap or equals.
-		short rel_aux = TestInnerRings(pBlue, innerRingsToTest);
-
-		if(rel_aux & TeOVERLAPS)
-			return TeOVERLAPS;
-
-		if(rel_aux & TeCOVERS || rel_aux & TeEQUALS)
-			return TeCOVERS;
-
-		if(rel_aux & TeCONTAINS)
-			return TeCONTAINS;
-	}
-	else	// EQUALS, COVERED BY or WITHIN
-	{
-		if(pRed.size() == 1 && innerRingsToTest.size() == 0)
-			return rel;	// entrou apenas no touches do lookat inner rings pois se desse covered by ou within teria inner rings
-
-		short rel_aux = TestInnerRings(pRed, innerRingsToTest);
-
-		if(rel_aux & TeOVERLAPS)
-			return TeOVERLAPS;
-
-		if((rel_aux == TeEQUALS) && (rel == TeEQUALS))
-			return TeEQUALS;
-
-		if((rel_aux & TeCOVERS) || (rel_aux & TeEQUALS))
-			return TeCOVEREDBY;	
-
-		if(rel_aux & TeCONTAINS)
-		{
-			if((rel == TeEQUALS) || (rel == TeCOVEREDBY))
-				return TeCOVEREDBY;
-
-			return TeWITHIN;
-		}
-	}
-
-	return TeUNDEFINEDREL;
-}
-
-
-//---------- Generate Geometry Functions ----------//
-
-TePolygon TeMakePolygon(const TeBox& b)
-{
-	TeLine2D l;
-	
-	l.add(b.lowerLeft());
-	l.add(TeCoord2D(b.x2(), b.y1()));
-	l.add(b.upperRight());
-	l.add(TeCoord2D(b.x1(), b.y2()));
-	l.add(b.lowerLeft());
-	l.setBox(b);
-
-	TePolygon p;
-	p.add(TeLinearRing(l));
-	p.setBox(b);
-
-	return p;
-}
-
-TeLinearRing TeSimpleClosedPath(const TePointSet& pSet)
-{
-	TeLine2D l;
-
-	for(register unsigned int i = 0; i < pSet.size(); ++i)
-		l.add(pSet[i].location());
-
-	ThetaOrder tr(pSet[0].location());
-
-	sort(l.begin(), l.end(), tr);
-
-	l.add(l[0]);
-
-	return TeLinearRing(l);
-}
-
-
-//---------- Nearest ----------//
-
-bool TeNearest ( TeCoord2D& pt, TeNodeSet& ns , int& k, const double& tol)
-{
-	double d,dmin = TeMAXFLOAT;
-	bool flag = false;
-
-	k = -1;
-	for (unsigned int i=0; i < ns.size() ; i++)
-	{
-		d = TeDistance (pt, ns[i].location());
-		if ( d <= tol && d < dmin)
-		{
-			dmin = d;
-			k = i;
-			flag = true;
-		}
-	}
-	return flag;
-}
-
-bool TeNearest ( TeCoord2D& pt, TePointSet& ps , int& k, const double& tol)
-{
-	double d,dmin = TeMAXFLOAT;
-	bool flag = false;
-
-	k = -1;
-	for (unsigned int i=0; i < ps.size() ; i++)
-	{
-		d = TeDistance (pt, ps[i].location());
-		if ( d <= tol && d < dmin)
-		{
-			dmin = d;
-			k = i;
-			flag = true;
-		}
-	}
-	return flag;
-}
-
-bool TeNearest ( TeCoord2D& pt, TeTextSet& ts , int& k, const double& tol)
-{
-	double d,dmin = TeMAXFLOAT;
-	bool flag = false;
-
-	k = -1;
-	for (unsigned int i=0; i < ts.size() ; i++)
-	{
-		d = TeDistance (pt, ts[i].location());
-		if ( d <= tol && d < dmin)
-		{
-			dmin = d;
-			k = i;
-			flag = true;
-		}
-	}
-	return flag;
-}
-
-bool TeNearest(TeCoord2D& pt, TeLineSet& ls , int& k, TeCoord2D& pi, const double& tol)
-{
-	double d,dmin = TeMAXFLOAT;
-	bool flag = false;
-
-	k = -1;
-	for (unsigned int i=0 ; i<ls.size() ; i++)
-	{
-		TeLine2D line = ls[i];
-		TeBox lb = line.box();
-		TeBox box(lb.x1()-tol,lb.y1()-tol,lb.x2()+tol,lb.y2()+tol);
-		if (TeIntersects(pt, box))
-		{
-			for (unsigned int j=0 ; j<line.size()-1 ; j++)
-			{
-				TeCoord2D	pinter;
-				TeBox		sbox(MIN(line[j].x(),line[j+1].x()),
-								MIN(line[j].y(),line[j+1].y()),
-								MAX(line[j].x(),line[j+1].x()),
-								MAX(line[j].y(),line[j+1].y()));
-				d = TePerpendicularDistance (line[j],line[j+1],pt, pinter);
-				if((d <= tol) && (d < dmin) && TeIntersects(pinter, sbox))
-				{
-					dmin = d;
-					k = i;
-					pi = pinter;
-					flag = true;
-				}
-			}
-		}
-	}
-	return flag;
-}
-
-
-bool TeNearest (TeCoord2D& pt,TeLineSet& ls, int& lindex, TeCoord2D& pout, double& dmin, const double& tol)
-{
-	bool flag = false;
-	TeCoord2D	pinter;
-
-	dmin = TeMAXFLOAT;
-	lindex = -1;
-
-	for (unsigned int i = 0 ; i < ls.size(); i++)
-	{
-		TeLine2D line = ls[i];
-
-		for (unsigned int j = 0 ; j < line.size() - 1 ; j++)
-		{
-			double d = TeMinimumDistance (line[j], line[j + 1], pt, pinter, tol);
-			if (d < dmin)
-			{
-				lindex = i;
-				pout = pinter;
-				dmin = d;
-				flag = true;
-			}
-		}
-	}
-	return flag;
-}
-
-bool TeNearest(TeCoord2D& pt, TePolygonSet& ps , int& k, const double& /*tol*/)
-{
-	bool flag = false;
-
-	k = -1;
-	
-	TePoint ptaux(pt);
-
-	for (unsigned int i=0; i < ps.size() ; i++)
-	{
-		if (TeIntersects(ptaux,ps[i]))
-		{
-			k = i;
-			flag = true;
-		}
-	}
-	return flag;
-}
-
-bool TeNearestByPoints ( TeCoord2D& pt, TeLineSet& ls , int& k, double& dist, const double& tol)
-{
-	double d,dmin = TeMAXFLOAT;
-	bool flag = false;
-
-	k = -1;
-	for (unsigned int i=0 ; i<ls.size() ; i++)
-	{
-		TeLine2D line = ls[i];
-		TeBox lb = line.box();
-		TeBox box(lb.x1()-tol,lb.y1()-tol,lb.x2()+tol,lb.y2()+tol);
-		if (TeIntersects (pt,box))
-		{
-			for (unsigned int j=0 ; j<line.size()-1 ; j++)
-			{
-				d = TeDistance (line[j],pt);
-				if ( d <= tol && d < dmin )
-				{
-					dmin = d;
-					dist = dmin;
-					k = i;
-					flag = true;
-				}
-			}
-		}
-	}
-	return flag;
-}
-
-
-//---------- TIN ----------//
-
-bool TeFindTriangleCenter(const TeCoord2D& vert0, const TeCoord2D& vert1, const TeCoord2D& vert2, TeCoord2D& pc )
-{
-	if ( vert0 == vert1 || vert0 == vert2 )
-		return false; // pontos sao iguais-> retorna
-
-	//	calcula o coeficiente angular perpendicular a reta 1
- 	bool perpvert1 = false,	// perpendicular vertical ao segmento 1 
-		 perpvert2 = false;	// perpendicular vertical ao segmento 2 
-	double	m1 = 10., m2 =10.;	// normais aos segmentos 1 e 2
-	double prcsion = 1.0e-10;	// Precision to be used for equal comparison
-	double oldPrcsion = TePrecision::instance().precision();
-	TePrecision::instance().setPrecision(prcsion);
-
-	if ( TeCoord2D( 0., vert0.y() ) == TeCoord2D( 0., vert1.y() ) )
-		perpvert1 = true;
-	else 
-		m1 = -(vert1.x() - vert0.x()) / (vert1.y() - vert0.y());
-
-//	calcula o coeficiente angular da perpendicular a reta 2
-	if ( TeCoord2D( 0., vert1.y() ) == TeCoord2D( 0., vert2.y() ) )
-		perpvert2 = true;
-	else
-		m2 = -(vert2.x() - vert1.x()) / (vert2.y() - vert1.y());
-
-	TePrecision::instance().setPrecision(oldPrcsion);
-//	Caso as retas sejam coincidentes, uma circunferencia 
-//	 nao eh definida
-	if (fabs( m1 - m2 ) > prcsion)
-	{
-
-//	passou pelos testes: os pontos definem uma circunferencia
-//	calculo do ponto medio do segmento ponto0-ponto1 (segmento 1)
-		TeCoord2D ptm1 = vert0;
-		ptm1 += vert1;
-		ptm1.scale ( 0.5, 0.5);
-
-//	calculo do ponto medio do segmento ponto1-ponto2 (segmento 2)
-		TeCoord2D ptm2 = vert1;
-		ptm2 += vert2;
-		ptm2.scale ( 0.5, 0.5);
-
-//	calculo das coordenadas do centro: ponto de interseccao das mediatrizes
-//	 dos segmentos ponto0-ponto1 e ponto1-ponto2
-  		if (perpvert1 == true)
-		{
-   			pc.x( ptm1.x() );
-  			pc.y( ptm2.y() + m2 * ( pc.x() - ptm2.x() ) );
- 		}
-		else if (perpvert2 == true)
-		{
-   			pc.x( ptm2.x() );
-			pc.y( ptm1.y() + m1 * ( pc.x() - ptm1.x() ) );
-		}
-		else
-		{
-			pc.x( (m1*ptm1.x() - m2*ptm2.x() - ptm1.y() + ptm2.y())/(m1-m2) );
-			pc.y( ptm1.y() + m1 * ( pc.x() - ptm1.x() ) );
-		}
-		return true;
-	}
-	return false;
-}
-
-bool TeLineSimplify(TeLine2D& ptlist, double snap, double maxdist)
-{
-//	If snap is zero, don't worry
-	if (snap == 0.0)
-		return true;
-//	If line is too short do nothing
-	int npts = ptlist.size();
-	if ( npts <= 3 )
-		return true;
-	int npte = npts;
-
-	double snap2 = maxdist*maxdist;
-	TeLine2D vxy;
-	vxy.copyElements(ptlist);
-
-//	Check for islands before defining number of points to be used
-	int npt;
-	if ( ptlist.last() == vxy.first() )
-		npt = npte - 1;
-	else
-		npt = npte;
-	ptlist.clear();
-
-//	initialize variables
-	int i     = 0;
-	int numa  = 0;
-	int numpf = npt - 1;
-
-//	define anchor
-	TeCoord2D axy = vxy[numa];
-
-//	define floating point
-	TeCoord2D pfxy = vxy[numpf];
-
-	while (numa < (npt-1))
-	{
-		bool retv (false);
-		double aa1 = 0.;
-		double a = 0.;
-		double b = 0.;
-//		Compute coeficients of straight line y=ax+b
-		if (pfxy.x() == axy.x())
-			retv = true;
-		else
-		{
-			a = (pfxy.y() - axy.y())/(pfxy.x() - axy.x());
-			b = pfxy.y() - a * pfxy.x();
-			aa1	= sqrt(a * a + 1.);
-		}
-
-		double d    = 0;
-		double dmax = 0;
-		int numdmax = numpf;
-
-		int k;
-		for (k = numa + 1; k <= numpf; k++)
-		{
-//			Distance between point and line
-			if (retv)
-				d = fabs(axy.x() - vxy[k].x());
-			else
-				d = fabs(vxy[k].y() - a*vxy[k].x() - b)/aa1;
-
-			if (d > dmax)
-			{
-				dmax	= d;
-				numdmax	= k;
-			}
-		}
-
-		if (dmax <= snap)
-		{
-//			Store selected point
-			if (i > (npt-1))
-				return false;
-			vxy[i++] = axy;
-			
-			double axbx = pfxy.x()-axy.x();
-			double ayby = pfxy.y()-axy.y();
-			double dist2 = axbx*axbx + ayby*ayby;
-			if (dist2 > snap2)
-			{
-				for (k = numpf; k > numa+1; k--)
-				{
-					axbx = vxy[k].x()-axy.x();
-					ayby = vxy[k].y()-axy.y();
-					dist2 = axbx*axbx + ayby*ayby;
-					if (dist2 < snap2)
-						break;
-				}
-//				Shift anchor
-				numa = k;
-				axy = vxy[k];
-			}
-			else
-			{
-//				Shift anchor
-				numa = numpf;
-				axy = vxy[numpf];
-			}
-			numpf = npt - 1;
-		}
-		else
-		{
-//			Shift floating point
-			numpf = numdmax;
-		}
-
-		pfxy = vxy[numpf];
-	}
-
-//	Store results
-	vxy[i] = vxy[numa];
-	npts = i+1;
-
-	if ( vxy[i] == vxy[i-1] )
-		npts = i;
-
-	for (i = 0; i < npts; i++)
-		ptlist.add( vxy[i] );
-
-//	Case islands
-	if (vxy[0] == vxy[npte-1])
-		ptlist.add( vxy[0] );
-
-	return true;
-}
-
-bool TeSegmentsIntersectPoint(const TeCoord2D& fr0, const TeCoord2D& to0, const TeCoord2D& fr1, const TeCoord2D& to1, TeCoord2D& pi)
-{
-//	Adapted from TWO-DIMENSIONAL CLIPPING: A VECTOR-BASED APPROACH
-//	Hans J.W. Spoelder, Fons H. Ullings in:
-//	Graphics Gems I, pp.701, 
-
-	double	a, b, c,
-		px, py, lx, ly, lpx, lpy,
-		s;
-
-	px  = to0.x() - fr0.x();
-	py  = to0.y() - fr0.y();
-	lx  = to1.x() - fr1.x();
-	ly  = to1.y() - fr1.y();
-	lpx = fr0.x() - fr1.x();
-	lpy = fr0.y() - fr1.y();
-
-	a = py * lx - px * ly;
-	b = lpx * ly - lpy * lx;
-	c = lpx * py - lpy * px;
-
-	if (a == 0) // Linhas paralelas
-		return false;
-	else
-	{
-		if (a > 0)
-		{
-			if ((b < 0) || (b > a) || (c < 0) || (c > a))
-				return false;
-		}
-		else
-		{
-			if ((b > 0) || (b < a) || (c > 0) || (c < a))
-				return false;
-		}
-		s = b/a;
-		pi.x(fr0.x() + (px*s));
-		pi.y(fr0.y() + (py*s));
-	}
-	return true;
-}
-
-//---------- Curve ----------//
-
-/*! \fn void TeSwap(TePoint &p1, TePoint &p2)
-    \brief Swaps to points.
-	\param p1 The first point.
-	\param p2 The second point.
-*/
-void TeSwap(TePoint& p1, TePoint& p2)
-{
-	TePoint temp;
-
-	temp = p1;
-	p1 = p2;
-	p2 = temp;
-
-	return;
-}
-
-bool TeGetCenter(TePoint p1, TePoint p2, TePoint p3, TePoint& center)
-{
-	double x, y;
-	double ma=0., mb= 0.;
-	bool result = true;
-
-	//we don't want infinite slopes, or 0 slope for line 1, since we'll divide by "ma" below
-	if ((p1.location().x()==p2.location().x()) || (p1.location().y()==p2.location().y())) 
-		TeSwap(p2,p3);
-	  
-	if (p2.location().x()==p3.location().x()) 
-		TeSwap(p1,p2);
-
-	if (p1.location().x()!=p2.location().x())
-		ma=(p2.location().y()-p1.location().y())/(p2.location().x()-p1.location().x());
-	else 
-		result=false;
-	  
-	if (p2.location().x()!=p3.location().x()) 
-		mb=(p3.location().y()-p2.location().y())/(p3.location().x()-p2.location().x());
-	else 
-	  result=false;
-	  
-	if ((ma==0) && (mb==0)) 
-		result=false;
-	  
-	if (result) 
-	{
-		x=(ma*mb*(p1.location().y()-p3.location().y())+mb*(p1.location().x()+p2.location().x())-ma*(p2.location().x()+p3.location().x()))/(2*(mb-ma));
-		y=-(x-(p1.location().x()+p2.location().x())/2)/ma + (p1.location().y()+p2.location().y())/2;
-		
-		double w= x;  //TeRound(x);
-		double z= y;  //TeRound(y);	
-		TeCoord2D coord(w,z);
-		center.add(coord);
-	}
-  return result;
-}
-
-double TeGetRadius(TePoint& p1, TePoint& p2, TePoint& p3)
-{
-	double s,a,b,c, result;
-	a=sqrt(pow(p1.location().x()-p2.location().x(),2)+pow(p1.location().y()-p2.location().y(),2));  //sqr: square of the param
-	b=sqrt(pow(p2.location().x()-p3.location().x(),2)+pow(p2.location().y()-p3.location().y(),2));
-	c=sqrt(pow(p3.location().x()-p1.location().x(),2)+pow(p3.location().y()-p1.location().y(),2));
-	s=(a+b+c)/2;
-	result=(a*b*c)/(4*sqrt(s*(s-a)*(s-b)*(s-c)));
-	return result;
-}
-
-bool TeGenerateArc(TePoint& p1, TePoint& p2, TePoint& p3, TeLine2D& arcOut, const short& NPoints)
-{	
-	TePoint center;
-	double radius;
-
-	if(!TeGetCenter(p1, p2, p3, center))
-		return false;
-
-	radius = TeGetRadius(p1, p2, p3);
-
-	//calculate the distance between the points p1 and p3
-	double length = TeDistance(p1.location(),p3.location());
-
-	double val = length/(2*radius);
-	if(val>1)
-		return false;
-
-	//calculate the angle (in radians) between the segments (p1 - p3) in the circle center 
-	//asin : arco seno
-	//http://mathforum.org/dr.math/faq/faq.circle.segment.html#7
-	double thetaR = 2 * asin(val);	
-	
-	//calculate the variation of the angle in radians for each point
-	double deltaR = thetaR/(NPoints+1); 
-
-	//verify if is counterclockwise or clockwise
-	TeLine2D line;
-	line.add(p1.location());
-	line.add(p2.location());
-	line.add(p3.location());
-	line.add(p1.location());
-	TeLinearRing ring(line);
-	
-	short orient = TeOrientation(ring);
-
-	//calculate the coseno e seno of the angle (beta) between the circle center (horizontal segment) and the first point  
-	//http://mathforum.org/library/drmath/view/55327.html
-	double cosBeta = (p1.location().x()-center.location().x())/radius; 
-	double sinBeta = (p1.location().y()-center.location().y())/radius;
-
-	//rela�es trigonom�ricas
-	//sin(x+y) = sin(x)cos(y) + cos(x)sin(y),
-    //cos(x+y) = cos(x)cos(y) - sin(x)sin(y),
-	//sin(x-y) = sin(x)cos(y) - cos(x)sin(y),
-	//cos(x-y) = cos(x)cos(y) + sin(x)sin(y),
-
-	arcOut.add(p1.location());
-	double angle = deltaR;
-	for (int i=0; i<(NPoints+1); i++)
-	{
-		double x = 0.,y = 0.;
-		if(orient==TeCOUNTERCLOCKWISE)
-		{
-			//c = h + r*cos(B+A),
-			//d = k + r*sin(B+A),
-			x = center.location().x() + radius * ((cosBeta*cos(angle))-(sinBeta*sin(angle))); //cos(beta+angle) 
-			y = center.location().y() + radius * ((sinBeta*cos(angle))+(cosBeta*sin(angle))); //sin(beta+angle)
-		}
-		else if (orient==TeCLOCKWISE)
-		{
-			//c = h + r*cos(B-A),
-			//d = k + r*sin(B-A),
-			x = center.location().x() + radius * ((cosBeta*cos(angle))+(sinBeta*sin(angle))); //cos(beta-angle)
-			y = center.location().y() + radius * ((sinBeta*cos(angle))-(cosBeta*sin(angle))); //sin(beta-angle)
-		}
-
-		TeCoord2D coord(x,y);
-		arcOut.add(coord);
-		angle += deltaR;
-	}
-	arcOut.add(p3.location());
-	return true;
-}
-
-bool TeGenerateCircle(TePoint& center, const double& radius, TeLine2D& circle, const short& NPoints)
-{
-	//angle (in radians) of the circumference (2*Pi)
-	double thetaR = 2 * 3.14159; 	
-	
-	//calculate the variation of the angle in radians for each point
-	double deltaR = thetaR/(NPoints+1); 
-
-	//calculate a point P1 of the  circumference
-	TePoint p1(center.location().x()+radius, center.location().y());
-	
-	//calculate the coseno e seno of the angle (beta) between the center and the point P1  
-	//http://mathforum.org/library/drmath/view/55327.html
-	double cosBeta = 1;
-	double sinBeta = 0;
-
-	//rela�es trigonom�ricas
-	//sin(x+y) = sin(x)cos(y) + cos(x)sin(y),
-    //cos(x+y) = cos(x)cos(y) - sin(x)sin(y),
-	//sin(x-y) = sin(x)cos(y) - cos(x)sin(y),
-	//cos(x-y) = cos(x)cos(y) + sin(x)sin(y),
-
-	circle.add(p1.location());
-	double angle = deltaR;
-	for (int i=0; i<(NPoints+1); i++)
-	{
-		double x,y;
-		
-		//TeCOUNTERCLOCKWISE
-		//c = h + r*cos(B+A),
-		//d = k + r*sin(B+A),
-		
-		x = center.location().x() + radius * ((cosBeta*cos(angle))-(sinBeta*sin(angle))); //cos(beta+angle) 
-		y = center.location().y() + radius * ((sinBeta*cos(angle))+(cosBeta*sin(angle))); //sin(beta+angle)
-		
-		TeCoord2D coord(x,y);
-		circle.add(coord);
-		angle += deltaR;
-	}
-	circle.add(p1.location());
-	return true;
-}
-
-double TeGetPrecision(TeProjection* proj)
-{
-	if(!proj)
-		return 0.000000001;
-
-	if(proj->units() == "Meters")
-	{
-		return 0.001;
-	}
-	
-	return 0.000000001;	// Lat/Long e NoProjection
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeAssertions.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeDefines.h"
+
+#include "TeIntersector.h"
+#include "TeFragmentation.h"
+
+#include <algorithm>
+#include <iterator>
+#include <set>
+
+
+using namespace std;
+
+//---------- Local Functions ans Structures ----------//
+
+//! Instead of using arctan, use this to compare angles, so given two points return a number to be used in place of the angle formed by the segment.
+double Theta(const TeCoord2D& c1, const TeCoord2D& c2)
+{
+	register double dx = c2.x() - c1.x();
+	register double ax = fabs(dx);
+	register double dy = c2.y() - c1.y();
+	register double ay = fabs(dy);
+	register double t = 0.0;
+
+	if((dx == 0.0) && (dy == 0.0))
+		t = 0.0;
+	else
+		t = dy / (ax + ay);
+
+	if(dx < 0.0)
+		t = 2 - t;
+	else
+		if(dy < 0.0)
+			t = 4.0 + t;
+
+	return t * 90.0;
+}
+
+//! This struct is used for compare angles between two points and an anchor.
+struct ThetaOrder
+{
+	//! A fixed coordinate to be used to compare.
+	TeCoord2D anchor;
+
+	ThetaOrder(const TeCoord2D& c)
+		: anchor(c)
+	{
+	}
+
+	// Return true if c1 and anchor has a smaller angle than c2 and anchor.
+	bool operator()(const TeCoord2D& c1, const TeCoord2D& c2) const
+	{
+		register double t1 = Theta(anchor, c1);
+		register double t2 = Theta(anchor, c2);
+
+		if(t1 < t2)
+			return true;
+		
+		if(t1 > t2)
+			return false;
+
+		if(c1.x() < c2.x())
+			return true;
+
+		if(c1.x() > c2.x())
+			return false;
+
+		return false;		
+	}
+};
+
+/*! \struct xOrder
+    \brief  Returns true if c1 < c2 otherwise, returns false.
+ */
+template<class T> struct xOrder
+{
+	bool operator()(T c1, T c2)
+	{
+		if(c1.x() < c2.x())
+			return true;
+
+		if(c1.x() > c2.x())
+			return false;
+
+		if(c1.y() < c2.y())
+			return true;		
+
+		return false;
+	}
+};
+
+/*! \fn double TeArea(TeLinearRing& r);
+    \brief This function returns twice the area of a ring treated as a simple polygon (no holes).
+	\param r  The ring.
+
+	This function returns twice the area of a ring treated as a simple polygon (no holes).
+	May return a negative number => it will be used in Orientation tests.
+*/
+double Te2Area(const TeLinearRing& r)
+{
+	double S2 = 0.0;
+
+	TeLinearRing::iterator it = r.begin();
+	TeLinearRing::iterator end = r.end() - 1;
+	while(it != end)
+	{
+		S2 += (it->x() + (it + 1)->x()) * ((it + 1)->y() - it->y());
+		++it;
+	}
+
+	return S2;
+}
+
+/*! \fn short TeConverseRelation(const short& rel)
+    \brief This function returns the complements relation of one given relation.
+	\param rel  The relation.
+*/
+inline short ConverseRelation(const short& rel)
+{
+	switch(rel)
+	{
+		case TeCOVEREDBY  :  return TeCOVERS;
+		case TeWITHIN     :  return TeCONTAINS;
+		case TeCOVERS     :  return TeCOVEREDBY;
+		case TeCONTAINS   :  return TeWITHIN;
+		default			  :  return rel;
+	}	
+}
+
+/*! \fn bool MayTouches(const TeLine2D& lRed, const TeLine2D& lBlue, TeINTERSECTOR2::TeReportTree& report)
+    \brief This function verifies if the two lines may touches.
+	\param lRed   The first line.
+	\param lBlue  The second line.
+	\param report The intersection point list.
+*/
+bool MayTouches(const TeLine2D& lRed, const TeLine2D& lBlue, TeINTERSECTOR2::TeVectorBoundaryIP& report)
+{
+	if(lRed.isRing() && lBlue.isRing())
+		return false;
+
+	TeINTERSECTOR2::TeVectorBoundaryIP::iterator it = report.begin();
+	TeINTERSECTOR2::TeVectorBoundaryIP::iterator it_end = report.end();
+
+
+	// Get the boundaries' coordinate.
+	TeCoord2D line1_boundary1 = lRed[0];
+	TeCoord2D line1_boundary2 = lRed[lRed.size() - 1u];
+
+	TeCoord2D line2_boundary1 = lBlue[0];
+	TeCoord2D line2_boundary2 = lBlue[lBlue.size() - 1u];
+
+	// Verifies if intersection points are on boundary of one of the blue line
+	while(it != it_end)
+	{	// Get intersection point coordinate.
+
+		for(unsigned int i = 0; i < it->coords_.size(); ++i)
+		{
+			TeCoord2D ip_coord = it->coords_[i];
+
+			if(lRed.isRing())
+			{
+				if(!(TeEquals(ip_coord, line2_boundary1) || TeEquals(ip_coord, line2_boundary2)))
+					return false;
+			}
+			else if(lBlue.isRing())
+			{
+				if(!(TeEquals(ip_coord, line1_boundary1) || TeEquals(ip_coord, line1_boundary2)))
+					return false;
+			}
+			else
+			{
+				if(!(TeEquals(ip_coord, line1_boundary1) || TeEquals(ip_coord, line1_boundary2) || TeEquals(ip_coord, line2_boundary1) || TeEquals(ip_coord, line2_boundary2)))
+					return false;
+			}
+		}
+
+		++it;
+	}
+
+	return true;		// The lines touches.
+}
+
+/*! \fn short Relation(const TeLine2D& lRed, const TeLine2D& lBlue, TeINTERSECTOR2::TeReportTree& report, const short& relation)
+    \brief This function returns the relation between two lines.
+	\param lRed     The first line.
+	\param lBlue    The second line.
+	\param report   The intersection point list.
+	\param relation The relation that stop the search.
+
+	This function returns the relation between lines. May be: TeDISJOINT, TeTOUCHES, TeWITHIN, TeCROSSES, TeCOVEREDBY, TeEQUALS.
+	Obs: Doesn't do box elimination. You must implement the test in your own functions.
+*/
+short Relation(const TeLine2D& lRed, const TeLine2D& lBlue, TeINTERSECTOR2::TeVectorBoundaryIP& report, const short& relation)
+{
+	if(report.size() == 0u)
+		return TeDISJOINT;
+
+	// Do fragmentation
+	//bool hasContour = false;	// This will decide between CROSSES and OVERLAPS.
+
+	bool mayTouches = MayTouches(lRed, lBlue, report);
+
+	// Stop to check, because touches can't occur anymore
+	if(relation == TeTOUCHES && !mayTouches)
+		return TeUNDEFINEDREL;
+
+
+	TeLineSet redFragments;
+	TeLineSet redBoundaryFragments;
+	TeLine2D lRedAux;
+	lRedAux.copyElements(lRed);
+	TeLineSet lSet; lSet.add(lRedAux);
+
+	TeFragmentBoundary(lSet, report, redBoundaryFragments, redFragments);
+
+	unsigned int redFragmentsSize = redFragments.size();
+
+	short mask = TeUNKNOWNPOSITION;
+
+	if(redBoundaryFragments.size() > 0u)
+		mask |= TeINSIDE;
+
+	// Do a position test for each fragment and stop if all relations have been found.
+	for(unsigned int j = 0u; j < redFragmentsSize; ++j)
+	{	
+		TeCoord2D middle;			
+
+		if(redFragments[j].size() ==  2u)	// If the fragment has two points I need to check the middle point of this fragment.
+			TeGetMiddlePoint(redFragments[j][0u], redFragments[j][1u], middle);
+		else	// If the fragment has more than two points so I check one point between the end points.
+			middle = redFragments[j][(unsigned int)((double(redFragments[j].size()) / 2.0 + 0.5)) - 1];
+
+		if(TeIsOnLine(middle, lBlue))
+			mask |= TeINSIDE;
+		else
+			mask |= TeOUTSIDE;		
+
+		if((mask & TeOUTSIDE) && (mask & TeINSIDE))
+			break;		
+	}
+
+	// If the intersection is only at end points and there is no part of red line inside blue line so they touches
+	if(mayTouches && mask == TeOUTSIDE)
+	{
+		return TeTOUCHES;
+	}
+	
+	// Stop to check, because touches can't occur anymore
+	if(relation == TeTOUCHES)
+		return TeUNDEFINEDREL;
+
+
+	// if there is no fragments in line blue interiors, so line red cross line blue
+	if(mask == TeOUTSIDE)
+		return TeCROSSES;
+
+	// Stop to check, because crosses can't occur anymore
+	if(relation == TeCROSSES)
+		return TeUNDEFINEDREL;
+
+	TeCoord2D firstRedCoord = lRed[0];
+	TeCoord2D lastRedCoord  = lRed[lRed.size() - 1];
+
+	TeCoord2D firstBlueCoord = lBlue[0];
+	TeCoord2D lastBlueCoord  = lBlue[lBlue.size() - 1];		
+
+
+	// If there is no part of red line outside blue line => must decide within, covered by and equals
+	if(!(mask & TeOUTSIDE))
+	{
+		// So, if we arrived here, blue line contains red line, but needs to decide between equal, coveredby and within.
+
+		if(TeEquals(firstRedCoord, firstBlueCoord) || TeEquals(firstRedCoord, lastBlueCoord))
+		{
+			if(TeEquals(lastRedCoord, firstBlueCoord) || TeEquals(lastRedCoord, lastBlueCoord))
+			{
+				return TeEQUALS;
+			}
+			else
+			{
+				if(lBlue.isRing())
+					return TeWITHIN;
+				else
+					return TeCOVEREDBY;
+			}
+		}
+
+		if(TeEquals(lastRedCoord, firstBlueCoord) || TeEquals(lastRedCoord, lastBlueCoord))
+		{
+			if(lBlue.isRing())
+				return TeWITHIN;
+			else
+				return TeCOVEREDBY;
+		}
+
+		return TeWITHIN;
+	}
+
+	return TeUNDEFINEDREL;
+}
+
+/*! \fn short Relation(const TeLine2D& line, const TeLinearRing& ring, const short& relation)
+    \brief This function returns the relation between a line and a linear ring (treated as a simple polygon with no holes).
+	\param line     The line.
+	\param ring     The simple polygon ring.
+	
+	This function returns how the points of input line are related with interior, boundary, and
+	exterior of polygon. The mask may be a combination of the following values: TeOUTSIDE, TeINSIDE and TeBOUNDARY.
+	Obs: Do box elimination.
+*/
+short Relation(const TeLine2D& line, const TeLinearRing& ring)
+{
+	if(TeDisjoint(line.box(), ring.box()))
+		return TeOUTSIDE;
+
+	TeINTERSECTOR2::TeVectorBoundaryIP report;
+
+	if(TeINTERSECTOR2::TeSafeIntersections(line, ring, report))
+	{
+		short mask = TeBOUNDARY;	// It will be at least intersections between boundaries.
+
+		// Fragments line.
+		TeLineSet lSet;
+		TeLineSet boundaryFragments;
+		TeLine2D lineAux;
+		lineAux.copyElements(line);
+		TeLineSet auxLineSet; auxLineSet.add(lineAux);
+		
+		TeFragmentBoundary(auxLineSet, report, boundaryFragments, lSet);
+
+
+		unsigned int lSetSize = lSet.size();
+
+		// Do a position test for each fragment and stop if al relations has been found.
+		for(unsigned int j = 0; j < lSetSize; ++j)
+		{	
+			TeCoord2D middle;
+			
+			if(lSet[j].size() ==  2)	// If the fragment has two points I need to check the middle point of this fragment.
+				TeGetMiddlePoint(lSet[j][0], lSet[j][1], middle);
+			else	// If the fragment has more than two points so I check one point between the end points.
+				middle = lSet[j][(unsigned int)((double(lSet[j].size()) / 2.0 + 0.5)) - 1];
+
+			
+			mask |= TeRelation(middle, ring);
+
+			if((mask & TeOUTSIDE) && (mask & TeINSIDE))
+				break;			
+		}
+
+		return mask;
+	}
+	else
+		return TeRelation(line[0], ring);	// Needs to test only one point of the line, and its location defines the line location.
+}
+
+/*! \fn short TopologicRelation(const TeLine2D& line, const TeLinearRing& r)
+    \brief This function returns the relation between a line and a linear ring (treated as a simple polygon with no holes).
+	\param line     The line.
+	\param r        The simple polygon ring.
+
+	This function returns the topologic relation between the line and
+	the ring. The result may be: DISJOINT, WITHIN, TOUCHES, CROSSES or COVERED BY.
+	Obs: Doesn't do box elimination. Just uses from TeRelation.
+*/
+short TopologicRelation(const TeLine2D& line, const TeLinearRing& r)
+{
+	short mask = Relation(line, r);
+
+	if(mask & TeBOUNDARY)	// TOUCHES or CROSSES or COVERED BY
+	{
+		if(mask & TeOUTSIDE)	// TOUCHES or CROSSES
+		{
+			if(mask & TeINSIDE)
+				return TeCROSSES;
+			else
+				return TeTOUCHES;
+		}
+		else	// COVERED BY
+			return TeCOVEREDBY;
+
+	}
+	else	// DISJOINT or WITHIN
+	{
+		if(mask & TeINSIDE)	
+			return TeWITHIN;
+		else				
+			return TeDISJOINT;
+	}
+}
+
+/*! \fn short TopologicRelation(const TeLinearRing& rRed, const TeLinearRing& rBlue)
+    \brief This function returns the relationship between two rings (treated as simple polygons with no holes).
+	\param rRed  The ring to test relationship.
+	\param rBlue The ring to test relationship.
+
+	This function returns the relationship between two rings.
+*/
+short TopologicRelation(const TeLinearRing& rRed, const TeLinearRing& rBlue)
+{
+	// See the intersection between the points of rRed and the three components of rBlue (Boundary, Exterior, Interior)
+	short rel = Relation(rRed, rBlue);
+
+	if((rel & TeOUTSIDE) && (rel & TeINSIDE) && (rel & TeBOUNDARY))
+		return TeOVERLAPS;
+
+	if((rel & TeOUTSIDE) && !(rel & TeINSIDE) && (rel & TeBOUNDARY))
+	{
+		if(TeWithinOrCoveredByOrEquals(rBlue.box(), rRed.box()))
+		{
+			short rel_aux = Relation(rBlue, rRed);
+
+			if(rel_aux == TeBOUNDARY) //mario
+				return TeCOVERS;
+
+			if((rel_aux & TeINSIDE) && !(rel_aux & TeOUTSIDE) && (rel_aux & TeBOUNDARY))
+				return TeCOVERS;
+		}
+		
+		return TeTOUCHES;
+	}
+
+	if((rel & TeOUTSIDE) && !(rel & TeINSIDE) && !(rel & TeBOUNDARY))
+	{
+		if(TeWithinOrCoveredByOrEquals(rBlue.box(), rRed.box()))
+		{
+			if(TeRelation(rBlue[0], rRed) == TeINSIDE)
+				return TeCONTAINS;
+		}
+		
+		return TeDISJOINT;
+	}
+
+	if(!(rel & TeOUTSIDE) && (rel & TeINSIDE) && !(rel & TeBOUNDARY))
+		return TeWITHIN;
+
+	if(!(rel & TeOUTSIDE) && (rel & TeINSIDE) && (rel & TeBOUNDARY))
+		return TeCOVEREDBY;
+
+	if(rel == TeBOUNDARY)
+		return TeEQUALS;
+
+	return TeINTERSECTS;
+}
+
+/*! \fn short TeTopologicRelation(const TeLinearRing& rRed, const TeLinearRing& rBlue, vector<TeLinearRing>& rings, short& rel)
+    \brief This function returns the relationship between the ring and the polygon inner rings.
+	\param rRed  The ring to test relationship.
+	\param pBlue The polygon to test relationship.
+	\param rings Inner rings from blue polygon that is inside or is covered by red external polygon.
+	\param rel   The relation between external red ring and external blue ring.
+
+	This function returns the relationship between the ring and the polygon inner rings.
+*/
+short LookAtInnerRings(const TeLinearRing& rRed, const TePolygon& pBlue, vector<TeLinearRing>& rings, short& rel)
+{
+	register unsigned int i = 1;
+	register unsigned int nRings = pBlue.size();
+
+	for(; i < nRings; ++i)
+	{
+		switch(TopologicRelation(rRed, pBlue[i]))
+		{
+			case TeCOVEREDBY : return TeTOUCHES;
+
+			case TeWITHIN	 : return TeDISJOINT;
+
+			case TeOVERLAPS  : return TeOVERLAPS;
+
+			case TeEQUALS    : return TeTOUCHES;
+
+			case TeDISJOINT  : continue;	// this ring is outside the external ring, so it doesn't contribute to the relationship.
+
+			case TeTOUCHES    : rel = TeCOVEREDBY;	// change rel if rel is within.
+				                continue;
+
+			case TeCOVERS    : rings.push_back(pBlue[i]);
+							   rel = TeCOVEREDBY;	// we know they share boundary!!!!
+							   break;
+
+			case TeCONTAINS  : rings.push_back(pBlue[i]);
+							   break;				// doesn't share boundary
+		}
+	}
+
+	return TeUNDEFINEDREL;
+}
+
+/*! \fn short TestInnerRings(const TePolygon& pRed, vector<TeLinearRing>& rings)
+    \brief This function returns the relationship between the ring and the polygon inner rings.
+	\param pRed  The inner rings from pRed to test relationship.
+	\param rings Inner rings from blue polygon that is inside or is covered by red external polygon.
+
+	This function returns the relationship between the inner ring of pRed and the inner rings in rings.
+*/
+short TestInnerRings(const TePolygon& pRed, vector<TeLinearRing>& rings)
+{
+	unsigned int nRedRings = pRed.size();
+	unsigned int nBlueRings = rings.size();
+
+	//if((nRedRings - 1) != nBlueRings)
+	//	return TeOVERLAPS;
+
+	unsigned int i = 1;
+	unsigned int j = 0;
+
+	bool find = false;
+
+	set<unsigned int> blueRingsProcessed;
+
+	set<unsigned int> redRingsContainsCovers;
+
+	short rel = 0;
+
+	for(; i < nRedRings; ++i)
+	{
+		find = false;
+
+		for(j = 0; j < nBlueRings; ++j)
+		{
+			if(blueRingsProcessed.find(j) != blueRingsProcessed.end())
+				continue;
+
+			switch(TopologicRelation(pRed[i], rings[j]))
+			{
+				case TeDISJOINT  : continue;	// so it doesn't contribute to the relationship yet.
+
+				case TeEQUALS    :
+									rel |= TeEQUALS;
+					                blueRingsProcessed.insert(j);
+									find = true;
+									break;
+
+				case TeCONTAINS  :
+									if(redRingsContainsCovers.find(i) != redRingsContainsCovers.end())
+										return TeOVERLAPS;
+									
+									rel |= TeCONTAINS;
+
+									redRingsContainsCovers.insert(i);
+									blueRingsProcessed.insert(j);
+									find = true;
+									break;
+
+				case TeCOVERS	:
+									if(redRingsContainsCovers.find(i) != redRingsContainsCovers.end())
+										return TeOVERLAPS;
+									
+									rel |= TeCOVERS;
+
+									redRingsContainsCovers.insert(i);
+									blueRingsProcessed.insert(j);
+									find = true;
+									break;
+									
+
+				default          :  return TeOVERLAPS;
+			}
+
+			if(find)
+				break;
+		}
+
+		if(!find)
+			return TeOVERLAPS;
+	}
+
+	return rel;
+}
+
+//---------- Topological Function ----------//
+
+// EQUALS
+template<> bool TeEquals(const TeCoord2D& c1, const TeCoord2D& c2)
+{
+	if(TeGeometryAlgorithmsPrecision::IsDifferent(c1.x(), c2.x()))
+		return false;
+
+	if(TeGeometryAlgorithmsPrecision::IsDifferent(c1.y(), c2.y()))
+		return false;
+
+	return true;
+}
+
+template<> bool TeEquals(const TePoint& p1, const TePoint& p2)
+{
+	return TeEquals(p1.location(), p2.location());
+}
+
+template<> bool TeEquals(const TeLine2D& redLine, const TeLine2D& blueLine)
+{
+	if(TeEquals(redLine.box(), blueLine.box()))
+		return TeRelation(redLine, blueLine, TeEQUALS) == TeEQUALS;
+	else
+		return false;
+}
+
+template<> bool TeEquals(const TePolygon& redPol, const TePolygon& bluePol)
+{
+	if(TeEquals(redPol.box(), bluePol.box()))
+	{
+		if(redPol.size() != bluePol.size())
+			return false;
+
+		return TeRelation(redPol, bluePol) == TeEQUALS;
+	}
+	else
+		return false;
+}
+
+template<> bool TeEquals( const TePolygonSet& ps1, const TePolygonSet& ps2 )
+{
+  if( ps1.size() == ps2.size() ) {
+    TePolygonSet::iterator it1 = ps1.begin();
+    TePolygonSet::iterator it1_end = ps1.end();
+    TePolygonSet::iterator it2 = ps2.begin();
+    
+    while( it1 != it1_end ) {
+      if( ! TeEquals( (*it1), (*it2) ) ) {
+        return false;
+      }
+      
+      ++it1;
+      ++it2;
+    }
+  
+    return true;
+  } else {
+    return false;
+  }
+}
+
+template<> bool TeEquals(const TeBox& bx1, const TeBox& bx2)
+{
+	if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.x1(), bx2.x1()))
+		return false;
+
+	if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.y1(), bx2.y1()))
+		return false;
+
+	if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.x2(), bx2.x2()))
+		return false;
+	
+	if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.y2(), bx2.y2()))
+		return false;
+
+	return true;
+}
+
+template<> bool TeEquals(const TeCell& cell1, const TeCell& cell2)
+{
+	return TeEquals(cell1.box(), cell2.box());
+}
+
+
+// DISJOINT
+bool TeDisjoint(const TeCoord2D& c1, const TeCoord2D& c2)
+{
+	if(TeGeometryAlgorithmsPrecision::IsDifferent(c1.x(), c2.x()))
+		return true;
+
+	if(TeGeometryAlgorithmsPrecision::IsDifferent(c1.y(), c2.y()))
+		return true;
+
+	return false;
+}
+
+bool TeDisjoint(const TeCoord2D& c, const TeBox& b)
+{
+	// c to the right of b
+	if(TeGeometryAlgorithmsPrecision::IsGreater(c.x(), b.x2())) 
+		return true;
+
+	// c to the left of b
+	if(TeGeometryAlgorithmsPrecision::IsGreater(b.x1(), c.x())) 
+		return true;
+
+	// c is above b
+	if(TeGeometryAlgorithmsPrecision::IsGreater(c.y(), b.y2())) 
+		return true;
+
+	// c is below b 
+	if(TeGeometryAlgorithmsPrecision::IsGreater(b.y1(), c.y())) 
+		return true;
+
+	return false;
+}
+
+bool TeDisjoint(const TeBox& bx1, const TeBox& bx2)
+{
+	// B1 to the right of B2
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.x1(), bx2.x2())) 
+		return true;
+
+	// B1 to the left of B2
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.x1(), bx1.x2())) 
+		return true;
+
+	// B2 is above B1
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.y1(), bx1.y2())) 
+		return true;
+
+	// B2 is below B1 
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.y1(), bx2.y2())) 
+		return true;
+
+	return false;
+}
+
+bool TeDisjoint(const TeCoord2D& c, const TeLine2D& l)
+{
+	return TeRelation(c, l) == TeOUTSIDE;
+}
+
+bool TeDisjoint(const TeCoord2D& c, const TePolygon& pol)
+{
+	return TeRelation(c, pol) == TeOUTSIDE;
+}
+
+bool TeDisjoint(const TePoint& p1, const TePoint& p2)
+{
+	return TeDisjoint(p1.location(), p2.location());
+}
+
+bool TeDisjoint(const TePoint& p, const TeLine2D& l)
+{
+	return TeDisjoint(p.location(), l);
+}
+
+bool TeDisjoint(const TePoint& p, const TePolygon& pol)
+{
+	return TeDisjoint(p.location(), pol);
+}
+
+bool TeDisjoint(const TeLine2D& redLine, const TeLine2D& blueLine)
+{
+	if(TeDisjoint(redLine.box(), blueLine.box()))
+		return true;
+
+	return !TeINTERSECTOR2::TeIntersects(redLine, blueLine);
+}
+
+bool TeDisjoint(const TeLine2D& l, const TePolygon& pol)
+{
+	if(TeDisjoint(l.box(), pol.box()))
+		return true;
+
+	return TeRelation(l, pol) == TeDISJOINT;
+}
+
+bool TeDisjoint(const TePolygon& redPol, const TePolygon& bluePol)
+{
+	if(TeDisjoint(redPol.box(), bluePol.box()))
+		return true;
+	else
+		return TeRelation(redPol, bluePol) == TeDISJOINT;
+}
+
+bool TeDisjoint(const TeCell& cell1, const TeCell& cell2)
+{
+	return TeDisjoint(cell1.box(), cell2.box());
+}
+
+bool TeDisjoint(const TeCell& cell, const TeLine2D& line)
+{
+	return TeDisjoint(line, TeMakePolygon(cell.box()));
+}
+
+bool TeDisjoint(const TeCell& cell, const TePolygon& pol)
+{
+	return TeDisjoint(pol, TeMakePolygon(cell.box()));
+}
+
+bool TeDisjoint(const TeCell& cell, const TePoint& point)
+{
+	return TeDisjoint(point.location(), cell.box());
+}
+
+
+// INTERSECTS
+
+template<> bool TeIntersects(const TeCoord2D& c, const TeBox& b)
+{
+	// c to the right of b
+	if(TeGeometryAlgorithmsPrecision::IsGreater(c.x(), b.x2())) 
+		return false;
+
+	// c to the left of b
+	if(TeGeometryAlgorithmsPrecision::IsGreater(b.x1(), c.x())) 
+		return false;
+
+	// c is above b
+	if(TeGeometryAlgorithmsPrecision::IsGreater(c.y(), b.y2())) 
+		return false;
+
+	// c is below b 
+	if(TeGeometryAlgorithmsPrecision::IsGreater(b.y1(), c.y())) 
+		return false;
+
+	return true;
+}
+
+template<> bool TeIntersects(const TePoint& p, const TeBox& b)
+{
+	return TeIntersects(p.location(), b);
+}
+
+template<> bool TeIntersects(const TeBox& bx1, const TeBox& bx2)
+{
+	// B1 to the right of B2
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.x1(), bx2.x2())) 
+		return false;
+
+	// B1 to the left of B2
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.x1(), bx1.x2())) 
+		return false;
+
+	// B2 is above B1
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.y1(), bx1.y2())) 
+		return false;
+
+	// B2 is below B1 
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.y1(), bx2.y2())) 
+		return false;
+
+	return true;
+}
+
+
+// TOUCHES
+bool TeTouches(const TeCoord2D& c, const TeLine2D& l)
+{
+	return TeRelation(c, l) == TeBOUNDARY;
+}
+
+bool TeTouches(const TeCoord2D& c, const TePolygon& pol)
+{
+	return TeRelation(c, pol) == TeBOUNDARY;
+}
+
+bool TeTouches(const TePoint& p, const TeLine2D& l)
+{
+	return TeTouches(p.location(), l);
+}
+
+bool TeTouches(const TePoint& p, const TePolygon& pol)
+{
+	return TeTouches(p.location(), pol);
+}
+
+bool TeTouches(const TeLine2D& redLine, const TeLine2D& blueLine)
+{
+	if(TeDisjoint(redLine.box(), blueLine.box()))
+		return false;
+
+	return TeRelation(redLine, blueLine, TeTOUCHES) == TeTOUCHES;	
+}
+
+bool TeTouches(const TeLine2D& l, const TePolygon& pol)
+{
+	if(TeDisjoint(l.box(), pol.box()))
+		return false;
+
+	return TeRelation(l, pol) == TeTOUCHES;
+}
+
+bool TeTouches(const TePolygon& redPol, const TePolygon& bluePol)
+{
+	if(TeDisjoint(redPol.box(), bluePol.box()))
+		return false;
+
+	return TeRelation(redPol, bluePol) == TeTOUCHES;
+}
+
+bool TeTouches(const TeBox& bx1, const TeBox& bx2)
+{	
+	// bx1 may touches its right wall in bx2 left wall
+	// or bx1 may touches its left wall in bx2 right wall
+	if(TeGeometryAlgorithmsPrecision::IsEqual(bx1.x2(), bx2.x1()) || TeGeometryAlgorithmsPrecision::IsEqual(bx1.x1(), bx2.x2()))
+	{
+		// bx1 is below bx2
+		if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.y1(), bx1.y2()))
+			return false;
+
+		// bx1 is above bx2
+		if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.y1(), bx2.y2()))
+			return false;
+
+		// touches
+		return true;	
+	}
+
+	// bx1 may touches its bottom wall in bx2 top wall
+	// or bx1 may touches its top wall in bx2 bottom wall
+	if(TeGeometryAlgorithmsPrecision::IsEqual(bx1.y1(), bx2.y2()) || TeGeometryAlgorithmsPrecision::IsEqual(bx1.y2(), bx2.y1()))
+	{
+		// bx1 is left of bx2
+		if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.x1(), bx1.x2()))
+			return false;
+
+		// bx1 is right of bx2
+		if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.x1(), bx2.x2()))
+			return false;
+
+		// touches
+		return true;
+	}
+
+	// doesn't touches
+	return false;
+}
+
+bool TeTouches(const TeCell& c1, const TeCell& c2)
+{
+	return TeTouches(c1.box(), c2.box());
+}
+
+bool TeTouches(const TeLine2D& line, const TeCell& cell)
+{
+	return TeTouches(line, TeMakePolygon(cell.box()));
+}
+
+bool TeTouches(const TeCell& c1, const TePolygon& poly)
+{
+	return  TeTouches (poly, TeMakePolygon(c1.box()));
+}
+
+bool TeTouches(const TePoint& point,const TeCell& c1)
+{
+	return TeTouches(point.location(), TeMakePolygon(c1.box()));
+}
+
+
+// CROSSES
+bool TeCrosses(const TeLine2D& redLine, const TeLine2D& blueLine)
+{
+	if(TeDisjoint(redLine.box(), blueLine.box()))
+		return false;
+	else
+		return TeRelation(redLine, blueLine, TeCROSSES) == TeCROSSES;
+}
+
+bool TeCrosses(const TeLine2D& l, const TePolygon& pol)
+{
+	if(TeDisjointOrTouches(l.box(), pol.box()))
+		return false;
+	else
+		return TeRelation(l, pol) == TeCROSSES;
+}
+
+bool TeCrosses(const TeLine2D& l, const TeCell& cell)
+{
+	return TeCrosses(l, TeMakePolygon(cell.box()));
+}
+
+
+// WITHIN
+bool TeWithin(const TeCoord2D& c1, const TeCoord2D& c2)
+{
+	return TeEquals(c1, c2);
+}
+
+bool TeWithin(const TeCoord2D& c, const TeBox& b)
+{
+	// c to the right of b left wall AND c to the left of b right wall
+	// AND c below b top wall AND c above b bottom wall => then c is on b interior.
+	return (TeGeometryAlgorithmsPrecision::IsGreater(c.x(), b.x1()) && TeGeometryAlgorithmsPrecision::IsGreater(b.x2(), c.x()) && TeGeometryAlgorithmsPrecision::IsGreater(b.y2(), c.y()) && TeGeometryAlgorithmsPrecision::IsGreater(c.y(), b.y1()));
+}
+
+bool TeWithin(const TeCoord2D& c, const TeLine2D& l)
+{
+	return TeRelation(c, l) == TeINSIDE;
+}
+
+bool TeWithin(const TeCoord2D& c, const TePolygon& pol)
+{
+	return TeRelation(c, pol) == TeINSIDE;
+}
+
+bool TeWithin(const TePoint& p1, const TePoint& p2)
+{
+	return TeWithin(p1.location(), p2.location());
+}
+
+bool TeWithin(const TePoint& p, const TeLine2D& l)
+{
+	return TeWithin(p.location(), l);
+}
+
+bool TeWithin(const TePoint& p, const TePolygon& pol)
+{
+	return TeWithin(p.location(), pol);
+}
+
+bool TeWithin(const TeLine2D& redLine, const TeLine2D& blueLine)
+{
+	if(TeWithinOrCoveredByOrEquals(redLine.box(), blueLine.box()))
+		return TeRelation(redLine, blueLine, TeWITHIN) == TeWITHIN;	
+	else
+		return false;
+}
+
+bool TeWithin(const TeLine2D& l, const TePolygon& pol)
+{
+	if(TeWithinOrCoveredByOrEquals(l.box(), pol.box()))	
+		return TeRelation(l, pol) == TeWITHIN;
+
+
+	return false;
+}
+
+bool TeWithin(const TePolygon& redPol, const TePolygon& bluePol)
+{
+	if(TeWithinOrCoveredByOrEquals(redPol.box(), bluePol.box()))	
+		return TeRelation(redPol, bluePol) == TeWITHIN;
+	else
+		return false;
+}
+
+bool TeWithin(const TeBox& bx1, const TeBox& bx2)
+{
+	// bx1 left wall is left of or on bx2 left wall
+	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx2.x1(), bx1.x1()))
+		return false;
+
+	// bx1 right wall is right of or on bx2 right wall
+	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx1.x2(), bx2.x2()))
+		return false;
+
+	// bx1 is below bx2 or on.
+	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx2.y1(), bx1.y1()))
+		return false;
+
+	// bx1 is above bx2 or on
+	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx1.y2(), bx2.y2()))
+		return false;
+
+	return true;	
+}
+
+bool TeWithin(const TeCell& cell1, const TeCell& cell2)
+{
+	return TeWithin(cell1.box(), cell2.box());
+}
+
+bool TeWithin(const TeLine2D& line, const TeCell& cell)
+{
+	return TeWithin(line, TeMakePolygon(cell.box()));
+}
+
+
+bool TeWithin(const TeCell& cell, const TePolygon& poly)
+{
+	return TeWithin(TeMakePolygon(cell.box()), poly);
+}
+
+bool TeWithin(const TePoint& point, const TeCell& cell)
+{
+	return TeWithin(point.location(), cell.box());
+}
+
+
+// OVERLAPS
+bool TeOverlaps(const TeLine2D& redLine, const TeLine2D& blueLine)
+{
+	if(TeDisjoint(redLine.box(), blueLine.box()))
+		return false;
+	else
+		return TeRelation(redLine, blueLine, TeOVERLAPS) == TeOVERLAPS;
+}
+
+bool TeOverlaps(const TePolygon& redPol, const TePolygon& bluePol)
+{
+	//if(TeDisjoint(redPol.box(), bluePol.box()))
+	if(TeDisjointOrTouches(redPol.box(), bluePol.box()))
+		return false;
+	else
+		return TeRelation(redPol, bluePol) == TeOVERLAPS;
+}
+
+bool TeOverlaps(const TeCell& cell1, const TeCell& cell2)
+{
+	return TeOverlaps(TeMakePolygon(cell1.box()), TeMakePolygon(cell2.box()));
+}
+
+bool TeOverlaps(const TeCell& cell, const TePolygon& poly)
+{
+	return TeOverlaps(TeMakePolygon(cell.box()), poly);
+}
+
+
+// COVERED BY
+bool TeCoveredBy(const TeLine2D& redLine, const TeLine2D& blueLine)
+{
+	if(TeWithinOrCoveredByOrEquals(redLine.box(), blueLine.box()))
+		return TeRelation(redLine, blueLine, TeCOVEREDBY) == TeCOVEREDBY;
+	else
+		return false;
+}
+
+bool TeCoveredBy(const TeLine2D& l, const TePolygon& pol)
+{
+	if(TeWithinOrCoveredByOrEquals(l.box(), pol.box()))
+		return TeRelation(l, pol) == TeCOVEREDBY;
+	else
+		return false;
+}
+
+bool TeCoveredBy(const TePolygon& redPol, const TePolygon& bluePol)
+{
+	if(TeWithinOrCoveredByOrEquals(redPol.box(), bluePol.box()))
+		return TeRelation(redPol, bluePol) == TeCOVEREDBY;
+	else
+		return false;
+}
+
+bool TeCoveredBy(const TeCell& cell1, const TeCell& cell2)
+{
+	return TeCoveredBy(TeMakePolygon(cell1.box()), TeMakePolygon(cell2.box()));
+}
+
+bool TeCoveredBy(const TePolygon& poly, const TeCell& cell)
+{
+	return TeCoveredBy(poly, TeMakePolygon(cell.box()));
+}
+
+bool TeCoveredBy(const TeLine2D& line, const TeCell& cell)
+{
+	return TeCoveredBy(line, TeMakePolygon(cell.box()));
+}
+
+//---------- Box Tests ----------//
+
+bool TeDisjointOrTouches(const TeBox& bx1, const TeBox& bx2)
+{
+	// B1 to the right of or on B2
+	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx1.x1(), bx2.x2())) 
+		return true;
+
+	// B1 to the left of or on B2
+	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx2.x1(), bx1.x2())) 
+		return true;
+
+	// B2 is above or on B1
+	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx2.y1(), bx1.y2())) 
+		return true;
+
+	// B2 is below or on B1 
+	if(TeGeometryAlgorithmsPrecision::IsGreaterEqual(bx1.y1(), bx2.y2())) 
+		return true;
+
+	return false;
+}
+
+template<>
+bool TeWithinOrCoveredByOrEquals(const TeBox& bx1, const TeBox& bx2)
+{
+	// bx1 left wall is left of bx2 left wall
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.x1(), bx1.x1()))
+		return false;
+
+	// bx1 right wall is right of bx2 right wall
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.x2(), bx2.x2()))
+		return false;
+
+	// bx1 is below bx2
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx2.y1(), bx1.y1()))
+		return false;
+
+	// bx1 is above bx2
+	if(TeGeometryAlgorithmsPrecision::IsGreater(bx1.y2(), bx2.y2()))
+		return false;
+
+	return true;	
+}
+
+template<>
+bool TeWithinOrCoveredByOrEquals(const TeLine2D& line1, const TeLine2D& line2)
+{
+	if(TeWithinOrCoveredByOrEquals(line1.box(), line2.box()))
+	{
+		short r;
+		short rel = TeRelation(line1, line1, r);
+
+		if((rel&TeWITHIN) || (rel&TeCOVEREDBY) || (rel&TeEQUALS))
+		   return true;
+
+		return false;
+	}
+	return false;
+}
+
+template<>
+bool TeWithinOrCoveredByOrEquals(const TeLine2D& line1, const TePolygon& pol)
+{
+	if(TeWithinOrCoveredByOrEquals(line1.box(), pol.box()))
+	{
+		short rel = TeRelation(line1, pol);
+
+		if((rel&TeWITHIN) || (rel&TeCOVEREDBY))
+		   return true;
+
+		return false;
+	}
+	return false;
+}
+
+template<>
+bool TeWithinOrCoveredByOrEquals(const TePolygon& pol1, const TePolygon& pol2)
+{
+	if(TeWithinOrCoveredByOrEquals(pol1.box(), pol2.box()))
+	{
+		short rel = TeRelation(pol1, pol2);
+
+		if((rel&TeWITHIN) || (rel&TeCOVEREDBY) || (rel&TeEQUALS))
+		   return true;
+
+		return false;
+	}
+	return false;
+}
+
+
+bool TeWithinOrTouches(const TeCoord2D& c, const TeCoord2D& c1, const TeCoord2D& c2)
+{
+	// c is to the right of c1 and c2
+	if(TeGeometryAlgorithmsPrecision::IsGreater(c.x(), c1.x()) && TeGeometryAlgorithmsPrecision::IsGreater(c.x(), c2.x()))
+		return false;
+
+	// c is above c1 and c2
+	if(TeGeometryAlgorithmsPrecision::IsGreater(c.y(), c1.y()) && TeGeometryAlgorithmsPrecision::IsGreater(c.y(), c2.y()))
+		return false;
+
+	// c is to the left of c1 and c2
+	if(TeGeometryAlgorithmsPrecision::IsSmaller(c.x(), c1.x()) && TeGeometryAlgorithmsPrecision::IsSmaller(c.x(), c2.x()))
+		return false;
+
+	// c is below c1 and c2
+	if(TeGeometryAlgorithmsPrecision::IsSmaller(c.y(), c1.y()) && TeGeometryAlgorithmsPrecision::IsSmaller(c.y(), c2.y()))
+		return false;
+
+	return true;	
+}
+
+
+//---------- Intersection Functions ----------//
+
+bool TeIntersection(const TeBox& bx1, const TeBox& bx2, TeBox& bout)
+{
+	if(TeDisjoint(bx1, bx2))
+		return false;
+
+	double x1 = MAX(bx1.x1(),bx2.x1());
+	double x2 = MIN(bx1.x2(),bx2.x2());
+	double y1 = MAX(bx1.y1(),bx2.y1());
+	double y2 = MIN(bx1.y2(),bx2.y2());
+
+	bout = TeBox(x1, y1, x2, y2);
+
+	return true;
+}
+
+TeCoordPairVect	TeGetIntersections(const TePolygon &poly, const double& y)
+{
+	TeCoordPairVect		Segments;
+	vector<double>		crossList, segListInY;
+	unsigned int		nholes = poly.size();
+			
+	//for each ring of the polygon
+	for (unsigned int count=0; count<nholes; count++ ) 		
+	{
+		TeLinearRing coords = poly[count];
+		//for each segment of the ring
+		for  (unsigned int j=0;  j < (coords.size() - 1); j++ ) 		
+		{
+			// Get one segment
+			TeCoord2D coord0 = coords[j];
+			TeCoord2D coord1 = coords[j+1];
+
+			bool yflag0 = ( coord0.y() > y );  
+			bool yflag1 = ( coord1.y() > y ); 
+
+			//treating a special case: when the segment touches or is ON the y axe  
+			//if there is a special case, we must test if the middle point
+			//of each segment is inside or outside of the polygon 
+			if((coord0.y()!=y) && (coord1.y()==y)) 
+			{
+				bool pointsInY = true;
+				bool lowerY1 = coord0.y()<y;
+                unsigned int i = j+2;
+				
+				TeCoord2D lastPointInY;
+				TeCoord2D firstPointOutY = coord1;
+				
+				while(pointsInY) 
+				{
+					lastPointInY = firstPointOutY; 
+
+					// Get the next point 
+					if(i>=coords.size())
+						i=1;
+                    firstPointOutY = coords[i];
+					++i;
+
+					//Verify if it is on the y axe
+					pointsInY = firstPointOutY.y()==y;
+				}
+
+				bool lowerY2 = firstPointOutY.y()<y;
+				//the segment touches the y axe only in one point and cross the axe Y
+				if((lastPointInY==coord1) && (lowerY1!=lowerY2)) 
+					crossList.push_back(coord1.x());	
+				else 
+				{
+					segListInY.push_back (coord1.x());
+					segListInY.push_back (lastPointInY.x());
+				}
+			}
+			else if(coord0.y()==y)
+				continue;
+			// line crosses ring horizontally 
+			else if ( yflag0 != yflag1 )
+			{ 
+				double slope =  ( coord1.x() - coord0.x() ) / ( coord1.y() - coord0.y());
+				double xcross = ( y -   coord0.y() )* slope + coord0.x();
+				crossList.push_back (xcross);	
+			}
+		}
+	}
+	
+	if(crossList.empty())
+		crossList = segListInY;
+	else if(!segListInY.empty())
+	{
+		//insert segListInY in the cross list 
+		for(unsigned i=0; i<segListInY.size(); ++i) 
+			crossList.push_back (segListInY[i]);
+
+		sort (crossList.begin(), crossList.end());
+
+		vector<double> aux;
+		//Verify if the segment middle point intersects the polygon 
+		for(unsigned i=1; i<crossList.size(); ++i)
+		{
+			//calculates the middle point
+			double x0 = crossList[i-1];
+			double x1 = crossList[i];
+			double x = x0 + (x1-x0)/2;
+			
+			TeCoord2D pt (x, y);
+			if (!TeDisjoint(pt, poly)) 
+			{
+				aux.push_back (x0);
+				aux.push_back (x1);
+			}
+		}
+		crossList.clear();
+		crossList = aux;
+    }
+	
+	// Sort the x-intersections
+	sort (crossList.begin(), crossList.end());
+	
+	// Make the result segments
+	vector<double>::iterator it = crossList.begin();
+	while ( it != crossList.end())
+	{
+		TeCoordPair cp;
+
+		cp.pt1 = TeCoord2D ( (*it), y);
+		++it;
+		if ( it == crossList.end() ) 
+			break;
+
+		cp.pt2 = TeCoord2D ( (*it), y);
+		++it;
+
+		Segments.push_back ( cp );
+	}
+	return Segments;
+}
+
+//---------- Union Operators ----------//
+
+TeBox TeUnion(const TeBox& bx1, const TeBox& bx2)
+{
+	double x1 = MIN(bx1.x1(), bx2.x1());
+	double y1 = MIN(bx1.y1(), bx2.y1());
+		
+	double x2 = MAX(bx1.x2(), bx2.x2());
+	double y2 = MAX(bx1.y2(), bx2.y2());		
+
+	return TeBox(x1, y1, x2, y2);
+}
+
+
+//---------- Localization Functions ----------//
+
+bool TePointInPoly(const TeCoord2D& c, const TeLinearRing& r)
+{
+	if(r.size() < 4)
+		return false;
+
+	register double	ty, tx;
+
+	register const unsigned int nVertices = r.size();
+
+	register bool inside_flag = false;
+
+	register int j, yflag0, yflag1;
+
+	TeLinearRing::iterator vtx0, vtx1;
+
+	tx = c.x();
+    ty = c.y();
+    
+	vtx0 = r.end() - 2;
+
+    yflag0 = (vtx0->y() >= ty);
+
+    vtx1 = r.begin();
+
+    for(j = nVertices; --j; )
+	{
+		yflag1 = (vtx1->y() >= ty);
+		
+		if(yflag0 != yflag1)
+		{
+			if(((vtx1->y() - ty) * (vtx0->x() - vtx1->x()) >=
+		        (vtx1->x() - tx) * (vtx0->y() - vtx1->y())) == yflag1)
+			{
+				inside_flag = !inside_flag ;
+			}
+		}
+
+		yflag0 = yflag1 ;
+		vtx0 = vtx1 ;
+		vtx1++;
+    }
+
+	return inside_flag;
+}
+
+bool TeIsOnSegment(const TeCoord2D& c, const TeCoord2D& c1, const TeCoord2D& c2)
+{
+	if(TeWithinOrTouches(c, c1, c2))
+	{
+		bool aux = false;
+
+		return TeINTERSECTOR2::TeCCW(c1, c2, c, aux) == TeNOTURN;
+	}
+
+	return false;	
+}
+
+bool TeIsOnLine(const TeCoord2D& c, const TeLine2D& l)
+{
+	if(l.size() < 2)
+		return false;
+
+	if(TeDisjoint(c, l.box()))
+		return false;
+
+	TeLine2D::iterator it = l.begin();
+
+	unsigned int nstep = l.size() - 1;
+
+	for(unsigned int i = 0; i < nstep; ++i)
+	{
+		if(TeIsOnSegment(c, *(it), *(it + 1)))
+			return true;
+		
+		++it;
+	}
+	
+	return false;
+}
+
+bool TeLocateLineSegment (TeCoord2D& pin, TeLine2D& line, int& segment, double /*tol*/)
+{
+	if (line.size() < 2) 
+		return false;
+
+	TeCoord2D pout;
+		
+	segment = 0;
+	double min_dist = TeMinimumDistance(line[0], line[1], pin, pout);
+	
+	for (unsigned int i = 2; i < line.size(); i++)
+	{
+		double dist;
+		if ((dist = TeMinimumDistance (line[i-1],line[i], pin, pout)) < min_dist)
+		{		
+				min_dist = dist;
+				segment = i - 1;
+		}
+	}
+
+	return true;
+}
+
+
+//---------- Area Functions ----------//
+
+template<> double TeGeometryArea(const TePolygon& p)
+{
+	if(p.size() > 0)
+	{
+		TePolygon::iterator it = p.begin();
+	
+		double area = fabs(Te2Area(*it));
+
+		++it;
+		
+		// subtract inner rings area.
+		while(it != p.end())
+		{
+			area -= fabs(Te2Area(*it));
+			++it;
+		}
+
+		return (area / 2.0);
+	}
+	
+	return 0.0;
+}
+
+template<> double TeGeometryArea(const TePolygonSet& ps)
+{
+	TePolygonSet::iterator it = ps.begin();
+	
+	double area = 0.0;
+	
+	while(it != ps.end())
+	{
+		area += TeGeometryArea(*it);
+		++it;
+	}
+
+	return (area);
+}
+
+template<> double TeGeometryArea(const TeBox& b)
+{
+	return ((b.x2() - b.x1()) * (b.y2() - b.y1()));
+}
+
+template<> double TeGeometryArea(const TeMultiGeometry& mGeom)
+{
+	if(mGeom.hasPolygons())
+	{
+		TePolygonSet pSet;
+		mGeom.getGeometry(pSet);
+		return TeGeometryArea(pSet);
+	}
+	else if(mGeom.hasCells())
+	{
+		TeCellSet cSet;
+		mGeom.getGeometry(cSet);
+		return TeGeometryArea(cSet);
+	}
+	return 0.;
+}
+
+//---------- ConvexHull ----------//
+
+//! If we have the  two end point equals, so we remove it.
+void removeDuplicatedCoords(vector<TeCoord2D>& coordSet)
+{
+	if(coordSet[0] == coordSet[coordSet.size() - 1])
+		coordSet.erase(coordSet.end() - 1);
+
+	return;
+}
+
+// Return a linear ring that is the convex hull of a given list of coords
+TePolygon ConvexHull(vector<TeCoord2D>& coordSet)
+{
+	// sorting the coords
+	sort(coordSet.begin(), coordSet.end(), xOrder<TeCoord2D>());
+
+	register unsigned int i = 0;
+	register unsigned int n = coordSet.size();
+
+	TeLine2D upperHull;
+	TeLine2D lowerHull;
+
+	lowerHull.add(coordSet[0]);
+	lowerHull.add(coordSet[1]);
+
+	unsigned int count = 2;
+
+	bool aux = false;
+	
+	for(i = 2; i < n; ++i)
+	{
+		lowerHull.add(coordSet[i]);
+
+		++count;
+
+		while(count > 2 && TeINTERSECTOR2::TeCCW(lowerHull[count - 3], lowerHull[count - 2], lowerHull[count - 1], aux) <= TeNOTURN)
+		{
+			lowerHull.erase(count - 2);
+			--count;
+		}
+	}
+
+	upperHull.add(coordSet[n - 1]);
+	upperHull.add(coordSet[n - 2]);
+
+	count = 2;
+
+	for(i = n - 2;  i > 0;  --i)
+	{
+		upperHull.add(coordSet[i - 1]);
+		++count;
+
+		while(count > 2 && TeINTERSECTOR2::TeCCW(upperHull[count - 3], upperHull[count - 2], upperHull[count - 1], aux) <= TeNOTURN)
+		{
+			upperHull.erase(count - 2);
+			--count;
+		}
+	}
+
+	
+	upperHull.erase(0);
+	upperHull.erase(upperHull.size() - 1);
+	
+	lowerHull.copyElements(upperHull);
+	lowerHull.add(lowerHull[0]);
+
+	TeLinearRing aux_ring(lowerHull);
+	TePolygon p;
+	p.add(aux_ring);
+	return p;
+}
+
+template<class T> TePolygon TeConvexHull(const T& coordSet)
+{
+	// creates an auxiliary line with the points of the ring
+	vector<TeCoord2D> aux;
+
+	typename T::iterator it = coordSet.begin();
+	
+	while(it != coordSet.end())
+	{
+		aux.push_back(*it);
+		++it;
+	}
+
+	// removes duplicated coords from structs like ring
+	removeDuplicatedCoords(aux);
+
+	return ConvexHull(aux);
+}
+
+template<> TePolygon TeConvexHull(const TePolygon& p)
+{
+	vector<TeCoord2D> coords;
+	back_insert_iterator<vector<TeCoord2D> > it(coords);
+	// Copy the first ring of each polygon without the last point (that is equals to the first).
+	
+	copy(p[0].begin(), p[0].end() - 1, it);
+
+	return ConvexHull(coords);
+}
+
+template<> TePolygon TeConvexHull(const TePolygonSet& ps)
+{
+	vector<TeCoord2D> coords;
+	back_insert_iterator<vector<TeCoord2D> > it(coords);
+	// Copy the first ring of each polygon without the last point (that is equals to the first).
+	
+	TePolygonSet::iterator it_ps = ps.begin();
+	while(it_ps != ps.end())
+	{
+		TeLinearRing r = (*it_ps)[0];
+		copy(r.begin(), r.end() - 1, it);
+		++it_ps;
+	}
+
+	return ConvexHull(coords);
+}
+
+template<> TePolygon TeConvexHull(const TePointSet& ps)
+{
+	vector<TeCoord2D> coords;
+	// Copy the first ring of each polygon without the last point (that is equals to the first).
+	
+	TePointSet::iterator itr = ps.begin();
+	
+	while(itr != ps.end())
+	{
+		coords.push_back(itr->location());
+
+		++itr;
+	}
+
+	return ConvexHull(coords);
+}
+
+//---------- Utilities Functions ----------//
+
+
+
+//---------- Validation Functions ----------//
+
+bool TeIsConvex(const TeLinearRing& ring)
+{
+	bool aux = false;
+
+	short orientation = TeINTERSECTOR2::TeCCW(*(ring.end() - 2), ring[0], ring[1], aux);
+
+	const unsigned int nStep = ring.size() - 1;
+	
+	for(unsigned int i = 1; i <  nStep; ++i)
+	{
+		short this_orientation = TeINTERSECTOR2::TeCCW(ring[i-1], ring[i], ring[i+1], aux);
+		
+		if(this_orientation == TeNOTURN)
+			continue;
+
+		if((orientation != TeNOTURN) && (orientation != this_orientation))
+			return false;
+
+		orientation = this_orientation;		
+	}
+
+	return true;
+}
+
+short TeOrientation(const TeLinearRing& r)
+{
+	double area = Te2Area(r);
+
+	if(area >  0.0)
+		return TeCOUNTERCLOCKWISE; 
+
+	if(area < 0.0)
+		return TeCLOCKWISE;  
+
+	return TeNOTURN;
+}
+
+void TeGetMiddlePoint(const TeCoord2D &first, const TeCoord2D &last, TeCoord2D &middle)
+{
+	double	lenght,parts,curlenght,incx,incy,
+			deltax,deltay,dx,dy;
+	short	i,nparts;
+	
+	lenght = TeDistance(first,last);
+	if(lenght == 0.)
+	{
+		middle = first;
+		return;
+	}
+
+	nparts = 2;	
+	parts = lenght/2.;
+// verify segment orientation
+	if(first.x() < last.x())
+		incx = 1.;
+	else
+		incx = -1.;
+
+	if(first.y() < last.y())
+		incy = 1.;
+	else
+		incy = -1.;
+
+	curlenght = 0.;
+	deltax = fabs(first.x()-last.x());
+	deltay = fabs(first.y()-last.y());
+	for(i=0;i<(nparts-1);i++)
+	{
+		curlenght = curlenght + parts;
+		// vertical segment
+		if(first.x() == last.x())
+		{
+			middle = TeCoord2D(first.x(),first.y()+(curlenght*incy));
+			continue;
+		}
+				
+		// horizontal segment
+		if(first.y() == last.y())
+		{
+			middle = TeCoord2D(first.x()+(curlenght*incx),first.y());
+			continue;
+		}
+		
+		// inclined segment
+		
+		// calculating X coordinate
+		dx = curlenght*deltax/lenght;
+		
+		// calculating Y coordinate
+		dy = curlenght*deltay/lenght;
+		middle = TeCoord2D(first.x()+(dx*incx),first.y()+(dy*incy));
+	}
+}
+
+//---------- Metric Functions ----------//
+
+double TeDistance(const TeCoord2D& c1, const TeCoord2D& c2)
+{
+	return sqrt(((c2.x() - c1.x()) * (c2.x() - c1.x())) + ((c2.y()-c1.y()) * (c2.y() - c1.y())));
+}
+
+double TeLength(const TeLine2D& l)
+{
+	double len = 0.0;
+
+	unsigned int nStep = l.size() - 1;
+
+	for(unsigned int i = 0 ; i < nStep; ++i)
+		len += TeDistance(l[i], l[i+1]);
+	
+	return len;
+}
+
+double TePerpendicularDistance(const TeCoord2D& first, const TeCoord2D& last, const TeCoord2D& pin, TeCoord2D &pinter)
+{
+	double	d12,xmin,ymin;
+
+	double xi = first.x();
+	double xf = last.x();
+	double yi = first.y();
+	double yf = last.y();
+	double x = pin.x();
+	double y = pin.y();
+		
+	double dx = xf - xi;
+	double dy = yf - yi;
+	double a2 = (y - yi) * dx - (x - xi)*dy;
+	
+    if(dx==0. && dy==0.)
+	{
+		d12= sqrt(((x - xi) * (x - xi)) + ((y - yi) * (y - yi)));
+		d12 *= d12;
+	}
+	else
+		d12= a2 * a2 / (dx * dx + dy * dy);
+
+	if (dx == 0.)
+	{
+		xmin = xi;
+		ymin = y;
+	}
+	else if (dy == 0.)
+	{
+		xmin = x;
+		ymin = yi;
+	}
+	else
+	{
+		double alfa = dy / dx;
+		xmin = (x + alfa * (y - yi) + alfa * alfa * xi) / (1. + alfa * alfa);
+		ymin = (x - xmin) / alfa + y;	
+	}
+	
+	pinter = TeCoord2D(xmin, ymin);		
+	return (sqrt(d12));
+}
+
+double TeMinimumDistance (const TeCoord2D& first, const TeCoord2D& last, const TeCoord2D& pin, TeCoord2D& pout, double /*tol*/)
+{
+	TeCoord2D	pinter;
+	TeBox 		sbox(MIN(first.x(),last.x()),
+					 MIN(first.y(),last.y()),
+					 MAX(first.x(),last.x()),
+					 MAX(first.y(),last.y()));
+
+	double d = TePerpendicularDistance (first, last, pin, pinter);
+	double dmin = TeMAXFLOAT;
+
+	// Perpendicular minimum distance point was found.
+	if (TeIntersects (pinter, sbox))
+	{
+		dmin = d;
+		pout = pinter;
+	}
+	else  
+	{
+		// Perpendicular minimum distance point could not be found. 
+		// The segment vertices distances will analyzed
+		double d1 = TeDistance (first, pin);
+		double d2 = TeDistance (last, pin);
+		if (d1 <= d2) 
+		{
+			dmin = d1;
+			pout = first;
+		}
+		else if (d2 < dmin) 
+		{
+			dmin = d2;
+			pout = last;
+		}
+	}
+
+	return dmin;
+}
+
+
+//---------- Relation Functions ----------//
+
+short TeRelation(const TeCoord2D& c, const TeLine2D& l)
+{
+	if(TeEquals(c, l[0]) || TeEquals(c, l[l.size() - 1]))
+	{
+		// Ring doesn't have bundaries, only interiors.
+		if(l.isRing())
+			return TeINSIDE;
+
+		return TeBOUNDARY;
+	}
+
+	if(TeIsOnLine(c, l))
+		return TeINSIDE;
+
+	return TeOUTSIDE;
+}
+
+short TeRelation(const TeCoord2D& c, const TeLinearRing& r)
+{
+	if(TeDisjoint(c, r.box()))
+		return TeOUTSIDE;
+
+	if(TeIsOnLine(c, r))
+		return TeBOUNDARY;
+
+	if(TePointInPoly(c, r))
+		return TeINSIDE;
+	else
+		return TeOUTSIDE;
+}
+
+short TeRelation(const TeCoord2D& c, const TePolygon& pol)
+{
+	short rel = TeRelation(c, pol[0]);
+	
+	if(rel != TeINSIDE)
+		return rel;
+	else	// If point is inside exterior ring
+	{
+		unsigned int size = pol.size();
+
+		for(unsigned int i = 1; i < size; ++i)
+		{
+			rel = TeRelation(c, pol[i]);
+		
+			switch(rel)
+			{
+				// If point is inside a hole so it is on polygon's outside.
+				case TeINSIDE    :	return TeOUTSIDE;
+
+				// If point is on boundary so it is on polygon's boundary.
+				case TeBOUNDARY  :  return TeBOUNDARY;
+			}
+		}
+	}
+
+	// If the point is inside exterior ring and is not on one of the holes so it is in polygon's interior.
+	return TeINSIDE;
+}
+
+short TeRelation(const TePoint& p, const TePolygon& pol)
+{ 
+	return (TeRelation(p.location(), pol)); 
+}
+
+short TeRelation(const TeCoord2D& c, const TePolygonSet& pSet)
+{
+	if(TeDisjoint(c, pSet.box()))
+		return TeOUTSIDE;
+
+	unsigned int size = pSet.size();
+
+	for(unsigned int i = 0; i < size; ++i)
+	{
+		short rel = TeRelation(c, pSet[i]);
+		
+		if(rel & TeINSIDE)
+			return TeINSIDE;
+		
+		if(rel & TeBOUNDARY)
+			return TeBOUNDARY;
+	}
+
+	return TeOUTSIDE;
+}
+
+short TeRelation(const TeLine2D& lRed, const TeLine2D& lBlue, const short& relation)
+{
+	TeINTERSECTOR2::TeVectorBoundaryIP report;
+
+	if(TeINTERSECTOR2::TeSafeIntersections(lRed, lBlue, report))
+	{
+		short rel = Relation(lRed, lBlue, report, relation);		
+
+		// Stop to check, because touches can't occur anymore
+		if((relation == TeTOUCHES || relation == TeCROSSES) && rel != relation)
+			return TeUNDEFINEDREL;
+
+		if(rel != TeUNDEFINEDREL)
+			return rel;
+
+		TeINTERSECTOR2::TeVectorBoundaryIP::iterator it = report.begin();
+		TeINTERSECTOR2::TeVectorBoundaryIP::iterator it_end = report.end();
+		
+		for(unsigned int i = 0; i < report.size(); ++i)
+		{
+			swap(report[i].redPartNum_, report[i].bluePartNum_);
+			swap(report[i].redSegNum_, report[i].blueSegNum_);
+		}
+
+		rel = Relation(lBlue, lRed, report, relation);
+
+		if(rel != TeUNDEFINEDREL)
+			return ConverseRelation(rel);
+		else
+			return TeOVERLAPS;
+	}
+	else
+		return TeDISJOINT;
+}
+
+short TeRelation(const TeLine2D& line, const TePolygon& pol)
+{
+	short rel = TopologicRelation(line, pol[0]);
+
+	if(rel & TeTOUCHES || rel & TeCROSSES || rel & TeDISJOINT)
+		return rel;
+
+	// If relation is WITHIN or COVERED BY we need to test inner rings.
+	register unsigned int i = 1;
+	register unsigned int nRings = pol.size();
+
+	for(; i < nRings; ++i)
+	{
+		short rel_aux = TopologicRelation(line, pol[i]);
+
+		switch(rel_aux)
+		{
+			case TeCROSSES   : return TeCROSSES;
+
+			case TeCOVEREDBY : return TeTOUCHES;
+
+			case TeTOUCHES   : rel = TeCOVEREDBY;
+				               break;	// Needs to check other holes.
+
+			case TeWITHIN    : return TeDISJOINT;
+
+			case TeDISJOINT  : break;	// Keeps rel and check other inner rings
+		}
+	}
+
+	return rel;
+}
+
+short TeRelation(const TePolygon& pRed, const TePolygon& pBlue)
+{
+
+	short rel = TopologicRelation(pRed[0], pBlue[0]);
+
+	if(rel & TeTOUCHES || rel & TeOVERLAPS || rel & TeDISJOINT)
+		return rel;
+
+	
+	short rel_external_ring = TeUNDEFINEDREL;
+
+	bool converse = false;
+
+	vector<TeLinearRing> innerRingsToTest;
+
+	switch(rel)
+	{
+		case TeWITHIN		: 
+		case TeCOVEREDBY	:
+	                          // if pBlue has inner rings.
+			                  if(pBlue.size() > 1)
+							  {
+								  rel_external_ring = LookAtInnerRings(pRed[0], pBlue, innerRingsToTest, rel);	
+							  }
+							  else	// else if it hasn't
+							  {
+								  return rel;
+							  }
+							  break;
+
+		case TeCONTAINS		:
+		case TeCOVERS		: 
+							  // if pRed has inner rings.
+			                  if(pRed.size() > 1)
+							  {
+								  rel_external_ring = LookAtInnerRings(pBlue[0], pRed, innerRingsToTest, rel);							      
+							  }
+							  else	// else if it hasn't
+							  {
+								  return rel;
+							  }
+
+							  converse = true;
+							  break;
+
+		case TeEQUALS		:
+			                  if(pRed.size() != pBlue.size())
+								  return TeOVERLAPS;
+
+							  if(pRed.size() == 1 && pBlue.size() == 1)
+								  return rel;
+
+							  for(unsigned int k = 1; k < pBlue.size(); k++)
+								  innerRingsToTest.push_back(pBlue[k]);
+
+							  rel_external_ring = TeUNDEFINEDREL;
+	}
+	
+	if(rel_external_ring != TeUNDEFINEDREL)	
+		return rel_external_ring;	
+
+	// If we are here, so we need to test 
+	if(converse)	// COVERS or CONTAINS
+	{
+		if(pBlue.size() == 1 && innerRingsToTest.size() == 0)
+		{
+			TeSpatialRelation spatialRel = (TeSpatialRelation)rel;
+			if (spatialRel == TeCOVEREDBY)
+				return TeCOVERS;
+			else
+				return rel;
+			//return ((TeSpatialRelation)rel == TeCOVEREDBY) ? TeCOVERS : rel;	// entrou apenas no touches do lookat inner rings 
+
+		}
+		// The result may be: overlap or equals.
+		short rel_aux = TestInnerRings(pBlue, innerRingsToTest);
+
+		if(rel_aux & TeOVERLAPS)
+			return TeOVERLAPS;
+
+		if(rel_aux & TeCOVERS || rel_aux & TeEQUALS)
+			return TeCOVERS;
+
+		if(rel_aux & TeCONTAINS)
+			return TeCONTAINS;
+	}
+	else	// EQUALS, COVERED BY or WITHIN
+	{
+		if(pRed.size() == 1 && innerRingsToTest.size() == 0)
+			return rel;	// entrou apenas no touches do lookat inner rings pois se desse covered by ou within teria inner rings
+
+		short rel_aux = TestInnerRings(pRed, innerRingsToTest);
+
+		if(rel_aux & TeOVERLAPS)
+			return TeOVERLAPS;
+
+		if((rel_aux == TeEQUALS) && (rel == TeEQUALS))
+			return TeEQUALS;
+
+		if((rel_aux & TeCOVERS) || (rel_aux & TeEQUALS))
+			return TeCOVEREDBY;	
+
+		if(rel_aux & TeCONTAINS)
+		{
+			if((rel == TeEQUALS) || (rel == TeCOVEREDBY))
+				return TeCOVEREDBY;
+
+			return TeWITHIN;
+		}
+	}
+
+	return TeUNDEFINEDREL;
+}
+
+
+//---------- Generate Geometry Functions ----------//
+
+TePolygon TeMakePolygon(const TeBox& b)
+{
+	TeLine2D l;
+	
+	l.add(b.lowerLeft());
+	l.add(TeCoord2D(b.x2(), b.y1()));
+	l.add(b.upperRight());
+	l.add(TeCoord2D(b.x1(), b.y2()));
+	l.add(b.lowerLeft());
+	l.setBox(b);
+
+	TePolygon p;
+	p.add(TeLinearRing(l));
+	p.setBox(b);
+
+	return p;
+}
+
+TeLinearRing TeSimpleClosedPath(const TePointSet& pSet)
+{
+	TeLine2D l;
+
+	for(register unsigned int i = 0; i < pSet.size(); ++i)
+		l.add(pSet[i].location());
+
+	ThetaOrder tr(pSet[0].location());
+
+	sort(l.begin(), l.end(), tr);
+
+	l.add(l[0]);
+
+	return TeLinearRing(l);
+}
+
+
+//---------- Nearest ----------//
+
+bool TeNearest ( TeCoord2D& pt, TeNodeSet& ns , int& k, const double& tol)
+{
+	double d,dmin = TeMAXFLOAT;
+	bool flag = false;
+
+	k = -1;
+	for (unsigned int i=0; i < ns.size() ; i++)
+	{
+		d = TeDistance (pt, ns[i].location());
+		if ( d <= tol && d < dmin)
+		{
+			dmin = d;
+			k = i;
+			flag = true;
+		}
+	}
+	return flag;
+}
+
+bool TeNearest ( TeCoord2D& pt, TePointSet& ps , int& k, const double& tol)
+{
+	double d,dmin = TeMAXFLOAT;
+	bool flag = false;
+
+	k = -1;
+	for (unsigned int i=0; i < ps.size() ; i++)
+	{
+		d = TeDistance (pt, ps[i].location());
+		if ( d <= tol && d < dmin)
+		{
+			dmin = d;
+			k = i;
+			flag = true;
+		}
+	}
+	return flag;
+}
+
+bool TeNearest ( TeCoord2D& pt, TeTextSet& ts , int& k, const double& tol)
+{
+	double d,dmin = TeMAXFLOAT;
+	bool flag = false;
+
+	k = -1;
+	for (unsigned int i=0; i < ts.size() ; i++)
+	{
+		d = TeDistance (pt, ts[i].location());
+		if ( d <= tol && d < dmin)
+		{
+			dmin = d;
+			k = i;
+			flag = true;
+		}
+	}
+	return flag;
+}
+
+bool TeNearest(TeCoord2D& pt, TeLineSet& ls , int& k, TeCoord2D& pi, const double& tol)
+{
+	double d,dmin = TeMAXFLOAT;
+	bool flag = false;
+
+	k = -1;
+	for (unsigned int i=0 ; i<ls.size() ; i++)
+	{
+		TeLine2D line = ls[i];
+		TeBox lb = line.box();
+		TeBox box(lb.x1()-tol,lb.y1()-tol,lb.x2()+tol,lb.y2()+tol);
+		if (TeIntersects(pt, box))
+		{
+			for (unsigned int j=0 ; j<line.size()-1 ; j++)
+			{
+				TeCoord2D	pinter;
+				TeBox		sbox(MIN(line[j].x(),line[j+1].x()),
+								MIN(line[j].y(),line[j+1].y()),
+								MAX(line[j].x(),line[j+1].x()),
+								MAX(line[j].y(),line[j+1].y()));
+				d = TePerpendicularDistance (line[j],line[j+1],pt, pinter);
+				if((d <= tol) && (d < dmin) && TeIntersects(pinter, sbox))
+				{
+					dmin = d;
+					k = i;
+					pi = pinter;
+					flag = true;
+				}
+			}
+		}
+	}
+	return flag;
+}
+
+
+bool TeNearest (TeCoord2D& pt,TeLineSet& ls, int& lindex, TeCoord2D& pout, double& dmin, const double& tol)
+{
+	bool flag = false;
+	TeCoord2D	pinter;
+
+	dmin = TeMAXFLOAT;
+	lindex = -1;
+
+	for (unsigned int i = 0 ; i < ls.size(); i++)
+	{
+		TeLine2D line = ls[i];
+
+		for (unsigned int j = 0 ; j < line.size() - 1 ; j++)
+		{
+			double d = TeMinimumDistance (line[j], line[j + 1], pt, pinter, tol);
+			if (d < dmin)
+			{
+				lindex = i;
+				pout = pinter;
+				dmin = d;
+				flag = true;
+			}
+		}
+	}
+	return flag;
+}
+
+bool TeNearest(TeCoord2D& pt, TePolygonSet& ps , int& k, const double& /*tol*/)
+{
+	bool flag = false;
+
+	k = -1;
+	
+	TePoint ptaux(pt);
+
+	for (unsigned int i=0; i < ps.size() ; i++)
+	{
+		if (TeIntersects(ptaux,ps[i]))
+		{
+			k = i;
+			flag = true;
+		}
+	}
+	return flag;
+}
+
+bool TeNearestByPoints ( TeCoord2D& pt, TeLineSet& ls , int& k, double& dist, const double& tol)
+{
+	double d,dmin = TeMAXFLOAT;
+	bool flag = false;
+
+	k = -1;
+	for (unsigned int i=0 ; i<ls.size() ; i++)
+	{
+		TeLine2D line = ls[i];
+		TeBox lb = line.box();
+		TeBox box(lb.x1()-tol,lb.y1()-tol,lb.x2()+tol,lb.y2()+tol);
+		if (TeIntersects (pt,box))
+		{
+			for (unsigned int j=0 ; j<line.size()-1 ; j++)
+			{
+				d = TeDistance (line[j],pt);
+				if ( d <= tol && d < dmin )
+				{
+					dmin = d;
+					dist = dmin;
+					k = i;
+					flag = true;
+				}
+			}
+		}
+	}
+	return flag;
+}
+
+
+//---------- TIN ----------//
+
+bool TeFindTriangleCenter(const TeCoord2D& vert0, const TeCoord2D& vert1, const TeCoord2D& vert2, TeCoord2D& pc )
+{
+	if ( vert0 == vert1 || vert0 == vert2 )
+		return false; // pontos sao iguais-> retorna
+
+	//	calcula o coeficiente angular perpendicular a reta 1
+ 	bool perpvert1 = false,	// perpendicular vertical ao segmento 1 
+		 perpvert2 = false;	// perpendicular vertical ao segmento 2 
+	double	m1 = 10., m2 =10.;	// normais aos segmentos 1 e 2
+	double prcsion = 1.0e-10;	// Precision to be used for equal comparison
+	double oldPrcsion = TePrecision::instance().precision();
+	TePrecision::instance().setPrecision(prcsion);
+
+	if ( TeCoord2D( 0., vert0.y() ) == TeCoord2D( 0., vert1.y() ) )
+		perpvert1 = true;
+	else 
+		m1 = -(vert1.x() - vert0.x()) / (vert1.y() - vert0.y());
+
+//	calcula o coeficiente angular da perpendicular a reta 2
+	if ( TeCoord2D( 0., vert1.y() ) == TeCoord2D( 0., vert2.y() ) )
+		perpvert2 = true;
+	else
+		m2 = -(vert2.x() - vert1.x()) / (vert2.y() - vert1.y());
+
+	TePrecision::instance().setPrecision(oldPrcsion);
+//	Caso as retas sejam coincidentes, uma circunferencia 
+//	 nao eh definida
+	if (fabs( m1 - m2 ) > prcsion)
+	{
+
+//	passou pelos testes: os pontos definem uma circunferencia
+//	calculo do ponto medio do segmento ponto0-ponto1 (segmento 1)
+		TeCoord2D ptm1 = vert0;
+		ptm1 += vert1;
+		ptm1.scale ( 0.5, 0.5);
+
+//	calculo do ponto medio do segmento ponto1-ponto2 (segmento 2)
+		TeCoord2D ptm2 = vert1;
+		ptm2 += vert2;
+		ptm2.scale ( 0.5, 0.5);
+
+//	calculo das coordenadas do centro: ponto de interseccao das mediatrizes
+//	 dos segmentos ponto0-ponto1 e ponto1-ponto2
+  		if (perpvert1 == true)
+		{
+   			pc.x( ptm1.x() );
+  			pc.y( ptm2.y() + m2 * ( pc.x() - ptm2.x() ) );
+ 		}
+		else if (perpvert2 == true)
+		{
+   			pc.x( ptm2.x() );
+			pc.y( ptm1.y() + m1 * ( pc.x() - ptm1.x() ) );
+		}
+		else
+		{
+			pc.x( (m1*ptm1.x() - m2*ptm2.x() - ptm1.y() + ptm2.y())/(m1-m2) );
+			pc.y( ptm1.y() + m1 * ( pc.x() - ptm1.x() ) );
+		}
+		return true;
+	}
+	return false;
+}
+
+bool TeLineSimplify(TeLine2D& ptlist, double snap, double maxdist)
+{
+//	If snap is zero, don't worry
+	if (snap == 0.0)
+		return true;
+//	If line is too short do nothing
+	int npts = ptlist.size();
+	if ( npts <= 3 )
+		return true;
+	int npte = npts;
+
+	double snap2 = maxdist*maxdist;
+	TeLine2D vxy;
+	vxy.copyElements(ptlist);
+
+//	Check for islands before defining number of points to be used
+	int npt;
+	if ( ptlist.last() == vxy.first() )
+		npt = npte - 1;
+	else
+		npt = npte;
+	ptlist.clear();
+
+//	initialize variables
+	int i     = 0;
+	int numa  = 0;
+	int numpf = npt - 1;
+
+//	define anchor
+	TeCoord2D axy = vxy[numa];
+
+//	define floating point
+	TeCoord2D pfxy = vxy[numpf];
+
+	while (numa < (npt-1))
+	{
+		bool retv (false);
+		double aa1 = 0.;
+		double a = 0.;
+		double b = 0.;
+//		Compute coeficients of straight line y=ax+b
+		if (pfxy.x() == axy.x())
+			retv = true;
+		else
+		{
+			a = (pfxy.y() - axy.y())/(pfxy.x() - axy.x());
+			b = pfxy.y() - a * pfxy.x();
+			aa1	= sqrt(a * a + 1.);
+		}
+
+		double d    = 0;
+		double dmax = 0;
+		int numdmax = numpf;
+
+		int k;
+		for (k = numa + 1; k <= numpf; k++)
+		{
+//			Distance between point and line
+			if (retv)
+				d = fabs(axy.x() - vxy[k].x());
+			else
+				d = fabs(vxy[k].y() - a*vxy[k].x() - b)/aa1;
+
+			if (d > dmax)
+			{
+				dmax	= d;
+				numdmax	= k;
+			}
+		}
+
+		if (dmax <= snap)
+		{
+//			Store selected point
+			if (i > (npt-1))
+				return false;
+			vxy[i++] = axy;
+			
+			double axbx = pfxy.x()-axy.x();
+			double ayby = pfxy.y()-axy.y();
+			double dist2 = axbx*axbx + ayby*ayby;
+			if (dist2 > snap2)
+			{
+				for (k = numpf; k > numa+1; k--)
+				{
+					axbx = vxy[k].x()-axy.x();
+					ayby = vxy[k].y()-axy.y();
+					dist2 = axbx*axbx + ayby*ayby;
+					if (dist2 < snap2)
+						break;
+				}
+//				Shift anchor
+				numa = k;
+				axy = vxy[k];
+			}
+			else
+			{
+//				Shift anchor
+				numa = numpf;
+				axy = vxy[numpf];
+			}
+			numpf = npt - 1;
+		}
+		else
+		{
+//			Shift floating point
+			numpf = numdmax;
+		}
+
+		pfxy = vxy[numpf];
+	}
+
+//	Store results
+	vxy[i] = vxy[numa];
+	npts = i+1;
+
+	if ( vxy[i] == vxy[i-1] )
+		npts = i;
+
+	for (i = 0; i < npts; i++)
+		ptlist.add( vxy[i] );
+
+//	Case islands
+	if (vxy[0] == vxy[npte-1])
+		ptlist.add( vxy[0] );
+
+	return true;
+}
+
+bool TeSegmentsIntersectPoint(const TeCoord2D& fr0, const TeCoord2D& to0, const TeCoord2D& fr1, const TeCoord2D& to1, TeCoord2D& pi)
+{
+//	Adapted from TWO-DIMENSIONAL CLIPPING: A VECTOR-BASED APPROACH
+//	Hans J.W. Spoelder, Fons H. Ullings in:
+//	Graphics Gems I, pp.701, 
+
+	double	a, b, c,
+		px, py, lx, ly, lpx, lpy,
+		s;
+
+	px  = to0.x() - fr0.x();
+	py  = to0.y() - fr0.y();
+	lx  = to1.x() - fr1.x();
+	ly  = to1.y() - fr1.y();
+	lpx = fr0.x() - fr1.x();
+	lpy = fr0.y() - fr1.y();
+
+	a = py * lx - px * ly;
+	b = lpx * ly - lpy * lx;
+	c = lpx * py - lpy * px;
+
+	if (a == 0) // Linhas paralelas
+		return false;
+	else
+	{
+		if (a > 0)
+		{
+			if ((b < 0) || (b > a) || (c < 0) || (c > a))
+				return false;
+		}
+		else
+		{
+			if ((b > 0) || (b < a) || (c > 0) || (c < a))
+				return false;
+		}
+		s = b/a;
+		pi.x(fr0.x() + (px*s));
+		pi.y(fr0.y() + (py*s));
+	}
+	return true;
+}
+
+//---------- Curve ----------//
+
+/*! \fn void TeSwap(TePoint &p1, TePoint &p2)
+    \brief Swaps to points.
+	\param p1 The first point.
+	\param p2 The second point.
+*/
+void TeSwap(TePoint& p1, TePoint& p2)
+{
+	TePoint temp;
+
+	temp = p1;
+	p1 = p2;
+	p2 = temp;
+
+	return;
+}
+
+bool TeGetCenter(TePoint p1, TePoint p2, TePoint p3, TePoint& center)
+{
+	double x, y;
+	double ma=0., mb= 0.;
+	bool result = true;
+
+	//we don't want infinite slopes, or 0 slope for line 1, since we'll divide by "ma" below
+	if ((p1.location().x()==p2.location().x()) || (p1.location().y()==p2.location().y())) 
+		TeSwap(p2,p3);
+	  
+	if (p2.location().x()==p3.location().x()) 
+		TeSwap(p1,p2);
+
+	if (p1.location().x()!=p2.location().x())
+		ma=(p2.location().y()-p1.location().y())/(p2.location().x()-p1.location().x());
+	else 
+		result=false;
+	  
+	if (p2.location().x()!=p3.location().x()) 
+		mb=(p3.location().y()-p2.location().y())/(p3.location().x()-p2.location().x());
+	else 
+	  result=false;
+	  
+	if ((ma==0) && (mb==0)) 
+		result=false;
+	  
+	if (result) 
+	{
+		x=(ma*mb*(p1.location().y()-p3.location().y())+mb*(p1.location().x()+p2.location().x())-ma*(p2.location().x()+p3.location().x()))/(2*(mb-ma));
+		y=-(x-(p1.location().x()+p2.location().x())/2)/ma + (p1.location().y()+p2.location().y())/2;
+		
+		double w= x;  //TeRound(x);
+		double z= y;  //TeRound(y);	
+		TeCoord2D coord(w,z);
+		center.add(coord);
+	}
+  return result;
+}
+
+double TeGetRadius(TePoint& p1, TePoint& p2, TePoint& p3)
+{
+	double s,a,b,c, result;
+	a=sqrt(pow(p1.location().x()-p2.location().x(),2)+pow(p1.location().y()-p2.location().y(),2));  //sqr: square of the param
+	b=sqrt(pow(p2.location().x()-p3.location().x(),2)+pow(p2.location().y()-p3.location().y(),2));
+	c=sqrt(pow(p3.location().x()-p1.location().x(),2)+pow(p3.location().y()-p1.location().y(),2));
+	s=(a+b+c)/2;
+	result=(a*b*c)/(4*sqrt(s*(s-a)*(s-b)*(s-c)));
+	return result;
+}
+
+bool TeGenerateArc(TePoint& p1, TePoint& p2, TePoint& p3, TeLine2D& arcOut, const short& NPoints)
+{	
+	TePoint center;
+	double radius;
+
+	if(!TeGetCenter(p1, p2, p3, center))
+		return false;
+
+	radius = TeGetRadius(p1, p2, p3);
+
+	//calculate the distance between the points p1 and p3
+	double length = TeDistance(p1.location(),p3.location());
+
+	double val = length/(2*radius);
+	if(val>1)
+		return false;
+
+	//calculate the angle (in radians) between the segments (p1 - p3) in the circle center 
+	//asin : arco seno
+	//http://mathforum.org/dr.math/faq/faq.circle.segment.html#7
+	double thetaR = 2 * asin(val);	
+	
+	//calculate the variation of the angle in radians for each point
+	double deltaR = thetaR/(NPoints+1); 
+
+	//verify if is counterclockwise or clockwise
+	TeLine2D line;
+	line.add(p1.location());
+	line.add(p2.location());
+	line.add(p3.location());
+	line.add(p1.location());
+	TeLinearRing ring(line);
+	
+	short orient = TeOrientation(ring);
+
+	//calculate the coseno e seno of the angle (beta) between the circle center (horizontal segment) and the first point  
+	//http://mathforum.org/library/drmath/view/55327.html
+	double cosBeta = (p1.location().x()-center.location().x())/radius; 
+	double sinBeta = (p1.location().y()-center.location().y())/radius;
+
+	//rela�es trigonom�ricas
+	//sin(x+y) = sin(x)cos(y) + cos(x)sin(y),
+    //cos(x+y) = cos(x)cos(y) - sin(x)sin(y),
+	//sin(x-y) = sin(x)cos(y) - cos(x)sin(y),
+	//cos(x-y) = cos(x)cos(y) + sin(x)sin(y),
+
+	arcOut.add(p1.location());
+	double angle = deltaR;
+	for (int i=0; i<(NPoints+1); i++)
+	{
+		double x = 0.,y = 0.;
+		if(orient==TeCOUNTERCLOCKWISE)
+		{
+			//c = h + r*cos(B+A),
+			//d = k + r*sin(B+A),
+			x = center.location().x() + radius * ((cosBeta*cos(angle))-(sinBeta*sin(angle))); //cos(beta+angle) 
+			y = center.location().y() + radius * ((sinBeta*cos(angle))+(cosBeta*sin(angle))); //sin(beta+angle)
+		}
+		else if (orient==TeCLOCKWISE)
+		{
+			//c = h + r*cos(B-A),
+			//d = k + r*sin(B-A),
+			x = center.location().x() + radius * ((cosBeta*cos(angle))+(sinBeta*sin(angle))); //cos(beta-angle)
+			y = center.location().y() + radius * ((sinBeta*cos(angle))-(cosBeta*sin(angle))); //sin(beta-angle)
+		}
+
+		TeCoord2D coord(x,y);
+		arcOut.add(coord);
+		angle += deltaR;
+	}
+	arcOut.add(p3.location());
+	return true;
+}
+
+bool TeGenerateCircle(const TePoint& center, const double& radius, TeLine2D& circle, const short& NPoints)
+{
+	//angle (in radians) of the circumference (2*Pi)
+	double thetaR = 2 * 3.14159; 	
+	
+	//calculate the variation of the angle in radians for each point
+	double deltaR = thetaR/(NPoints+1); 
+
+	//calculate a point P1 of the  circumference
+	TePoint p1(center.location().x()+radius, center.location().y());
+	
+	//calculate the coseno e seno of the angle (beta) between the center and the point P1  
+	//http://mathforum.org/library/drmath/view/55327.html
+	double cosBeta = 1;
+	double sinBeta = 0;
+
+	//rela�es trigonom�ricas
+	//sin(x+y) = sin(x)cos(y) + cos(x)sin(y),
+    //cos(x+y) = cos(x)cos(y) - sin(x)sin(y),
+	//sin(x-y) = sin(x)cos(y) - cos(x)sin(y),
+	//cos(x-y) = cos(x)cos(y) + sin(x)sin(y),
+
+	circle.add(p1.location());
+	double angle = deltaR;
+	for (int i=0; i<(NPoints+1); i++)
+	{
+		double x,y;
+		
+		//TeCOUNTERCLOCKWISE
+		//c = h + r*cos(B+A),
+		//d = k + r*sin(B+A),
+		
+		x = center.location().x() + radius * ((cosBeta*cos(angle))-(sinBeta*sin(angle))); //cos(beta+angle) 
+		y = center.location().y() + radius * ((sinBeta*cos(angle))+(cosBeta*sin(angle))); //sin(beta+angle)
+		
+		TeCoord2D coord(x,y);
+		circle.add(coord);
+		angle += deltaR;
+	}
+	circle.add(p1.location());
+	return true;
+}
+
+double TeGetPrecision(TeProjection* proj)
+{
+	if(!proj)
+		return 0.000000001;
+
+	if(proj->units() == "Meters")
+	{
+		return 0.001;
+	}
+	
+	return 0.000000001;	// Lat/Long e NoProjection
+}
+
+//------------------------- Edition ---------------------------------------------//
+
+bool TeAdjustSegment(TeCoord2D P0, TeCoord2D P1, double d0, TeCoord2D &P0out, TeCoord2D &P1out)
+{
+	double		vL_norm1;
+	double		vL_norm2;
+
+	try
+	{
+		if( P0 == P1 )	return false;
+		
+		TeCoord2D vL1( (P1.x() - P0.x()), (P1.y() - P0.y()) );
+		TeCoord2D vL2( -1 * (P1.x() - P0.x()), -1 * (P1.y() - P0.y()) );
+		vL_norm1 = sqrt( vL1.x() * vL1.x() + vL1.y() * vL1.y() );
+		vL_norm2 = sqrt( vL2.x() * vL2.x() + vL2.y() * vL2.y() );
+
+
+		TeCoord2D uL1( ( vL1.x() / vL_norm1 ), ( vL1.y() / vL_norm1 ) );
+		TeCoord2D uL2( ( vL2.x() / vL_norm2 ), ( vL2.y() / vL_norm2 ) );
+		TeCoord2D pFim1 (P0.x() + uL1.x() * d0, P0.y() + uL1.y() * d0);
+		TeCoord2D pFim2 (P0.x() + uL2.x() * d0, P0.y() + uL2.y() * d0);
+
+		if ( TeDistance(pFim1, P1) <= TeDistance(pFim2, P1) )
+			{
+				P0out = P0;
+				P1out = pFim1; 
+			}
+		else
+			{
+				P0out = P0;
+				P1out = pFim2;
+			}
+	}
+	catch(...)
+	{ 
+		return (false); 
+	}
+	return (true);
+}
+
+bool TeFindCentroid(const TeLine2D &line, TeCoord2D &p)
+{
+
+	double		iDistance;
+	float		fMiddle=0.;
+	float		fSize=0.;
+	int			iCont=0;
+	TeLine2D	lneResult;
+
+
+	iDistance=TeLength(line);
+	if(iDistance<=0)
+		{
+			p=line[0];
+			return false;
+		}
+
+	fMiddle=(float)(((float) iDistance)/2.);
+
+	while(fSize<fMiddle)
+		{
+			lneResult.add(line[iCont]);
+			iCont++;
+			if(lneResult.size()>1)
+				fSize=(float)TeLength(lneResult);
+		}
+
+	if(fSize>fMiddle)
+		{
+			double			dDistance=0;
+			TeCoord2D		coorP1,coorP2;
+
+			dDistance=TeDistance(lneResult[lneResult.size()-2],lneResult[lneResult.size()-1]);
+
+			dDistance-=(fSize-fMiddle);
+
+			TeAdjustSegment(lneResult[lneResult.size()-2],lneResult[lneResult.size()-1],dDistance,coorP1,coorP2);
+			p=coorP2;
+			
+		}
+	else
+		p=lneResult[lneResult.size()-1];
+		
+	return true;
+}
+
+
diff --git a/src/terralib/kernel/TeGeometryAlgorithms.h b/src/terralib/kernel/TeGeometryAlgorithms.h
old mode 100755
new mode 100644
index 308d83c..847fd23
--- a/src/terralib/kernel/TeGeometryAlgorithms.h
+++ b/src/terralib/kernel/TeGeometryAlgorithms.h
@@ -1,1019 +1,1043 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeGeometryAlgorithms.h
-    \brief This file contains Algorithms for Topological Operations.
-	\author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
-*/
-#ifndef  __TERRALIB_INTERNAL_GEOMETRYALGORITHMS_H
-#define  __TERRALIB_INTERNAL_GEOMETRYALGORITHMS_H
-
-#include "TeGeometry.h"
-#include "TeMultiGeometry.h"
-
-#include "TePrecision.h"
-#include "TeProjection.h"
-
-//! Intersection coordinates of two segments.
-typedef vector<TeCoord2D> TeIntersCoordsVec;
-
-/** @defgroup GeometryAlgorithms Geometry algorithms
-	TerraLib geometry algorithms.
-	@{
-*/
-
-/** @defgroup TopologicalOperators Topological operators
-    @ingroup  GeometryAlgorithms
-	Functions that test topologival relation between two objects.
-\verbatim
-	The topological operators are based on the intersection of interior, exterior and boundary of geometries:
-  ------------------------------------------------------------------------------------------------------------------
- | TeGeometry   |  INTERIOR                        | BOUNDARY           | EXTERIOR                                |
-  ------------------------------------------------------------------------------------------------------------------
- | TePoint      | The point itself                 | Empty              | Everything except interior              |
- | TeLine2D     | All points except the end points | The two end points | Everything except interior and boundary |
- | TeLinearRing | All points                       | Empty              | Everything except interior and boundary |
- | TePolygon    | Everything between the external  | All rings          | Everything except interior and boundary |
- |              | ring and the inner rings         |                    |                                         |
-  ------------------------------------------------------------------------------------------------------------------
- 
-We use:
-	- I: for Interior
-	- E: for Exterior
-	- B: for Boundary
-	- inter: Intersects
-	- ^: AND
-	- v: OR
-	- A = refer to two-dimensional geometries (TePolygon and TePolygonSet)
-	- L = refer to one-dimensional geometries (TeLine2D and TeLineSet)
-	- P = refer to 0-dimensional geometries   (TePoint and TePointSet)
- \endverbatim
-@{
-*/
-
-/** @defgroup TeEquals Equals test
-    @ingroup TopologicalOperators
-    Check if one object is equal another object.
-\verbatim
- Applies to: P/P, L/L and A/A.
- TeEquals(x, y) => (x inter y = x) ^ (y inter x = y)
-                   (B(x) inter I(y) = false) ^ (B(x) inter E(y) = false) 
-\endverbatim
-@{
-*/
-//! If a specialized function is not used, returns false.
-template<class T1, class T2>
-inline bool TeEquals(const T1& /*o1*/, const T2& /*o2*/)
-{
-	return false;
-}
-
-//! Check if coordinate 1 and coordinate 2 are equal
-template<>
-TL_DLL bool TeEquals(const TeCoord2D& c1, const TeCoord2D& c2);
-
-//!  Check if point 1 and point 2 are equal
-template<>
-TL_DLL bool TeEquals(const TePoint& p1, const TePoint& p2);
-
-//! Check if lineRed and lineBlue are equal
-template<>
-TL_DLL bool TeEquals(const TeLine2D& redLine, const TeLine2D& blueLine);
-
-//! Check if polygon red and polygon blue are equal
-template<>
-TL_DLL bool TeEquals(const TePolygon& redPol, const TePolygon& bluePol);
-
-//! Check if polygonset1 and polygonset1 are equal
-template<>
-TL_DLL bool TeEquals( const TePolygonSet& ps1, const TePolygonSet& ps2 );
-
-//! Check if box 1 and box 2 are equal 
-template<>
-TL_DLL bool TeEquals(const TeBox& bx1, const TeBox& bx2);
-
-//! Check if cell 1 and cell 2 are equal
-template<>
-TL_DLL bool TeEquals(const TeCell& cell1, const TeCell& cell2);
-/** @} */ 
-
-/** @defgroup TeDisjoint Disjoint test
-    @ingroup TopologicalOperators
- Check if two objects are disjoint.
-\verbatim
- Applies to all geometries.
- TeDisjoint(x, y) => (x inter y = false)
-                     (I(x) inter I(y) = false) ^ (I(x) inter B(y) = false) ^ (B(x) inter I(y) = false) ^ (B(x) inter B(y) = false)
-\endverbatim
-@{
-*/
-//! Check if coordinate cl and coordinate c2 are disjoint
-TL_DLL bool TeDisjoint(const TeCoord2D& c1, const TeCoord2D& c2);
-
-//! Check if coordinate and box are disjoint
-TL_DLL bool TeDisjoint(const TeCoord2D& c, const TeBox& b);
-
-//! Check if box 1 and box 2 are disjoint
-TL_DLL bool TeDisjoint(const TeBox& bx1, const TeBox& bx2);
-
-//! Check if coordinate and line are disjoint
-TL_DLL bool TeDisjoint(const TeCoord2D& c, const TeLine2D& l);
-
-//! Check if coordinate and polygon are disjoint
-TL_DLL bool TeDisjoint(const TeCoord2D& c, const TePolygon& pol);
-
-//! Check if point l and point 2 are disjoint
-TL_DLL bool TeDisjoint(const TePoint& p1, const TePoint& p2);
-
-//! Check if point and object are disjoint
-TL_DLL bool TeDisjoint(const TePoint& p, const TeLine2D& l);
-
-//! Check if point and object are disjoint
-TL_DLL bool TeDisjoint(const TePoint& p, const TePolygon& pol);
-
-//! Check if lines are disjoint
-TL_DLL bool TeDisjoint(const TeLine2D& redLine, const TeLine2D& blueLine);
-
-//! Check if line and polygon are disjoint
-TL_DLL bool TeDisjoint(const TeLine2D& l, const TePolygon& pol);
-
-//! Check if polygons are disjoint
-TL_DLL bool TeDisjoint(const TePolygon& redPol, const TePolygon& bluePol);
-
-//! Check if cell 1 and cell 2 are disjoint
-TL_DLL bool TeDisjoint(const TeCell& cell1, const TeCell& cell2);
-
-//! Check if cell and line are disjoint
-TL_DLL bool TeDisjoint(const TeCell& cell, const TeLine2D& line);
-
-//! Check if cell and polygon are disjoint
-TL_DLL bool TeDisjoint(const TeCell& cell, const TePolygon& pol);
-
-//! Check if cell and point are disjoint
-TL_DLL bool TeDisjoint(const TeCell& cell, const TePoint& point);
-/** @} */
-
-
-/** @defgroup TeIntersects Intersects test
-    @ingroup TopologicalOperators
-	Check if one object intersects another object.
-\verbatim
-  Applies to all geometries.
-  TeIntersects(x, y) => !TeDisjoint(x, y)
-                     => (I(x) inter I(y) = true) v (I(x) inter B(y) = true) v (B(x) inter I(y) = true) v (B(x) inter B(y) = true)
-\endverbatim
-@{
-*/
-//! If a specialized function is not used, returns the disjoint negation
-
-template<class T1, class T2>
-bool TeIntersects(const T1& o1, const T2& o2)
-{
-	return !TeDisjoint(o1, o2);
-}
-
-//! Check if coordinate and box intersects
-template<>
-TL_DLL bool TeIntersects(const TeCoord2D& c, const TeBox& b);
-
-//! Check if point and box intersects
-template<>
-TL_DLL bool TeIntersects(const TePoint& p, const TeBox& b);
-
-//! Check if boxes intersects
-template<>
-TL_DLL bool TeIntersects(const TeBox& bx1, const TeBox& bx2);
-/** @} */
-
-
-/** @defgroup TeTouches Touch test
-	@ingroup TopologicalOperators
-	Check if two objects touches.
-\verbatim
- Applies to A/A, L/L, L/A, P/A, P/L.
- TeTouches(x, y) => (I(x) inter I(y) = false) ^ (x inter y = true)
-				    => (I(x) inter I(y) = false) ^ ((B(x) inter I(y) = true) v (I(x) inter B(y) = true) v (B(x) inter B(y) = true))
- \endverbatim
- @{
-*/
-
-//! Check if coordinate and line touches
-TL_DLL bool TeTouches(const TeCoord2D& c, const TeLine2D& l);
-
-//! Check if coordinate and polygon touches
-TL_DLL bool TeTouches(const TeCoord2D& c, const TePolygon& pol);
-
-//! Check if point and object touches
-TL_DLL bool TeTouches(const TePoint& p, const TeLine2D& l);
-
-//! Check if point and object touches
-TL_DLL bool TeTouches(const TePoint& p, const TePolygon& pol);
-
-//! Check if line and line touches
-TL_DLL bool TeTouches(const TeLine2D& redLine, const TeLine2D& blueLine);
-
-//! Check if line and polygon
-TL_DLL bool TeTouches(const TeLine2D& l, const TePolygon& pol);
-
-//! Check if polygons touches
-TL_DLL bool TeTouches(const TePolygon& redPol, const TePolygon& bluePol);
-
-//! Check if boxes touches
-TL_DLL bool TeTouches(const TeBox& bx1, const TeBox& bx2);
-
-//! Check if cells touches
-TL_DLL bool TeTouches(const TeCell& c1, const TeCell& c2);
-
-//! Check if cell and line touches
-TL_DLL bool TeTouches(const TeLine2D& line, const TeCell& cell);
-
-//! Check if cell and polygon touches
-TL_DLL bool TeTouches(const TeCell& c1, const TePolygon& poly);
-
-//! Check if cell and point touches
-TL_DLL bool TeTouches( const TePoint& point, const TeCell& c1);
-/** @} */
-
-/** @defgroup TeCrosses Crosses test
-    @ingroup TopologicalOperators
-	Check if one object crosses another object.
-\verbatim
-  TeCrosses(x, y) => dim(I(x) inter I(y)) = (max(dim(I(x)), dim(I(y))) - 1) ^ (x inter y != x) ^ (x inter y != y) 
-  Case 1: x = TeLine2D and y = TePolygon
-          => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = true)
-  Case 2: x = TeLine2D and y = TeLine2D
-          => dim(I(x) inter I(y)) = 0
-\endverbatim
-@{
-*/
-
-//! Check if red line crosses blue line
-TL_DLL bool TeCrosses(const TeLine2D& redLine, const TeLine2D& blueLine);
-
-//! Check if line crosses polygon
-TL_DLL bool TeCrosses(const TeLine2D& l, const TePolygon& pol);
-
-//! Check if line and cell crosses
-TL_DLL bool TeCrosses(const TeLine2D& l, const TeCell& cell);
-/** @} */
-
-
-/** @defgroup TeWithin Within test
- *  @ingroup TopologicalOperators
- *  Check if one object is within another object.
- \verbatim
-   TeWithin(x, y) => (x inter y = x) ^ (I(x) inter I(y) = true)
-   Case 1: P/P, P/L and P/A
-           => (I(x) inter I(y) = true)
-   Case 2: L/L and A/A
-           => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = false) ^ (B(x) inter E(y) = false) ^ (B(x) inter B(y) = false)
-   Case 3: L/A
-           => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = false) ^ (B(x) inter E(y) = false) ^ (B(x) inter B(y) = false) ^ (I(x) inter B(y) = false)
-\endverbatim
- @{
-*/
-
-//! Check if coordinate 1 is within coordinate 2
-TL_DLL bool TeWithin(const TeCoord2D& c1, const TeCoord2D& c2);
-
-//! Check if coordinate is within a box
-TL_DLL bool TeWithin(const TeCoord2D& c, const TeBox& b);
-
-//! Check if a cordinate is within a line
-bool TeWithin(const TeCoord2D& c, const TeLine2D& l);
-
-//! Check if a cordinate is within a polygon
-TL_DLL bool TeWithin(const TeCoord2D& c, const TePolygon& pol);
-
-//! Check if point 1 is within point 2
-TL_DLL bool TeWithin(const TePoint& p1, const TePoint& p2);
-
-//! Check if point is within object
-TL_DLL bool TeWithin(const TePoint& p, const TeLine2D& l);
-
-//! Check if point is within object
-TL_DLL bool TeWithin(const TePoint& p, const TePolygon& pol);
-
-//! Check if red line is within blue line
-TL_DLL bool TeWithin(const TeLine2D& redLine, const TeLine2D& blueLine);
-
-//! Check if line is within polygon
-TL_DLL bool TeWithin(const TeLine2D& l, const TePolygon& pol);
-
-//! Check if red polygon is within blue polygon
-TL_DLL bool TeWithin(const TePolygon& redPol, const TePolygon& bluePol);
-
-//! Check if box1 is within box2
-TL_DLL bool TeWithin(const TeBox& bx1, const TeBox& bx2);
-
-//! Check if cell1 is within cell2
-TL_DLL bool TeWithin(const TeCell& cell1, const TeCell& cell2);
-
-//! Check if line is within cell
-TL_DLL bool TeWithin(const TeLine2D& line, const TeCell& cell);
-
-//! Check if cell is within polygon
-TL_DLL bool TeWithin(const TeCell& cell, const TePolygon& poly);
-
-//! Check if point is within cell
-TL_DLL bool TeWithin(const TePoint& point, const TeCell& cell);
-/** @} */
-
-/** @defgroup TeContains Contains test
-    @ingroup TopologicalOperators
-    Check if one object contains another object.
-    TeContains(x, y) = TeWithin(y, x)
-@{
-*/
-
-//! If a specialized function is not used, returns false
-template<class T1, class T2>
-inline bool TeContains(const T1& o1, const T2& o2)
-{
-	return TeWithin(o2, o1);
-}
-/** @} */
-
-/** @defgroup TeOverlaps Overlaps test
-	@ingroup TopologicalOperators
-    Check if one object overlaps another object.
-\verbatim
-   TeOverlaps(x, y) => (dim(I(x)) = dim(I(y)) = dim(I(x) inter I(y))) ^ (x inter y != x) ^ (x inter y != y)
-   Case 1: (x = TePolygon  and y = TePolygon)
-           => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = true) ^ (E(x) inter I(y) = true)
-   Case 2: x = TeLine2D and y = TeLine2D
-           => (dim(I(x) inter I(y)) = 1) ^ (I(x) inter E(y) = true) ^ (E(x) inter I(y) = true)
- \endverbatim
-@{
-*/
-
-//! Check if red red overlaps blue line
-TL_DLL bool TeOverlaps(const TeLine2D& redLine, const TeLine2D& blueLine);
-
-//! Check if red polygon overlaps blue polygon
-TL_DLL bool TeOverlaps(const TePolygon& redPol, const TePolygon& bluePol);
-
-//! Check if cell1 overlaps cell2
-TL_DLL bool TeOverlaps(const TeCell& cell1, const TeCell& cell2);
-
-//! Check if cell overlaps polygon
-TL_DLL bool TeOverlaps(const TeCell& cell, const TePolygon& poly);
-/** @} */
-
-
-/** @defgroup TeCoveredBy Covered by test
-  @ingroup TopologicalOperators
-  Check if one object is covered by another object.
-  \verbatim
- TeCoveredBy(x, y) => (x inter y = x) ^ (I(x) inter I(y) = true)
-   - Case 1: (x = TePolygon and y = TePolygon) or (x = TeLine2D and y = TeLine2D)
-             => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = false) ^ (B(x) inter E(y) = false) ^ (B(x) inter B(y) = true)
-   - Case 2: x = TeLine2D and y = TePolygon
-             => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = false) ^ (B(x) inter E(y) = false) ^ ((B(x) inter B(y) = true) v (I(x) inter B(y) = true))
- \endverbatim
- @{
- */
-
-//! Check if red line is covered by blue line
-TL_DLL bool TeCoveredBy(const TeLine2D& redLine, const TeLine2D& blueLine);
-
-//! Check if line is covered by polygon
-TL_DLL bool TeCoveredBy(const TeLine2D& l, const TePolygon& pol);
-
-//! Check if red polygon is covered by blue polygon
-TL_DLL bool TeCoveredBy(const TePolygon& redPol, const TePolygon& bluePol);
-
-//! Check if cell1 is covered by cell2
-TL_DLL bool TeCoveredBy(const TeCell& cell1, const TeCell& cell2);
-
-//! Check if polygon is covered by cell
-TL_DLL bool TeCoveredBy(const TePolygon& poly, const TeCell& cell);
-
-//! Check if line is covered by cell
-TL_DLL bool TeCoveredBy(const TeLine2D& line, const TeCell& cell);
-/** @} */
-
-/** @defgroup TeCovers Covers test
-    @ingroup TopologicalOperators
-    Check if one object covers another object.
-    TeCovers(x, y) => TeCoveredBy(y, x)
-@{
-*/
-//! Check if one object covers another object
-template<typename T1, typename T2>
-inline bool TeCovers(T1& o1, T2& o2)
-{
-	return TeCoveredBy(o2, o1);
-}
-/** @} */
-
-/** @defgroup TeRelation Relation test
- *  @ingroup TopologicalOperators
- *  Return the relation between two objects.
- *  @{
- */
-/** \brief Returns the relation between coordinate c and line l.
-	\param c  The coordinate.
-	\param l  The line.
-	\return one of the relations: INSIDE, OUTSIDE or BOUNDARY.
-	\note It doesn't do box elimination, just uses from TeIsOnLine(coordinate, line) elimination
- */
-TL_DLL short TeRelation(const TeCoord2D& c, const TeLine2D& l);
- 
- /** \brief Point in polygon inside/outside/boundary code.
-	 \param c    The coordinate to test.
-	 \param r    The simple polygon to test.
-	 \return one of the relations: INSIDE, OUTSIDE or BOUNDARY.
-	 \note	The ring is treated as a simple polygon (no holes). Does box elimination.
-*/
-TL_DLL short TeRelation(const TeCoord2D& c, const TeLinearRing& r);
-
-/** \brief Coordinate in polygon inside/outside/boundary code.
-	\param c    The coordinate to test.
-	\param pol  The polygon to test.
-	\return one of the relations: INSIDE, OUTSIDE or BOUNDARY.
-	\note It doesn't do box elimination, just uses from TeRelation(coordinate, line) elimination
-*/
-TL_DLL short TeRelation(const TeCoord2D& c, const TePolygon& pol);
-
-/** \brief Point in polygon inside/outside/boundary code.
-	\param p    The coordinate to test.
-	\param pol  The polygon to test.
-	\return one of the relations: INSIDE, OUTSIDE or BOUNDARY.
-	\note It doesn't do box elimination, just uses from TeRelation(coordinate, line) elimination
-*/
-TL_DLL short TeRelation(const TePoint& p, const TePolygon& pol); 
-
-/** \brief Point in polygon set inside/outside/boundary code.
-	\param c     The coordinate to test.
-	\param pSet  The polygon set to test.
-	\return one of the relations: INSIDE, OUTSIDE or BOUNDARY.
-	\note Does box elimination.
-*/
-TL_DLL short TeRelation(const TeCoord2D& c, const TePolygonSet& pSet);
-
-/** \brief This function returns the relation between two lines.
-	\param lRed     The first line.
-	\param lBlue    The second line.
-	\param relation To return the relation that stop the search: TeDISJOINT, TeTOUCHES, TeWITHIN, TeCONTAINS, TeCROSSES, TeOVERLAPS, TeCOVEREDBY, TeCOVERS, TeEQUALS
-	\note Doesn't do box elimination. You must implement the test in your own functions.
-*/
-TL_DLL short TeRelation(const TeLine2D& lRed, const TeLine2D& lBlue, const short& relation);
-
-/** \brief This function returns the relation between a line and a polygon.
-	\param line   The line.
-	\param pol    The polygon.
-	\return one of the relations:  TeDISJOINT, TeTOUCHES, TeWITHIN (THE LINE IS WITHIN), TeCROSSES, TeCOVEREDBY (THE LINE IS COVERED BY).
-	\note Doesn't do box elimination. You must implement the test in your own functions.
-*/
-TL_DLL short TeRelation(const TeLine2D& line, const TePolygon& pol);
-
-/** \brief This function returns the relation between two polygons.
-	\param pRed   The first polygon.
-	\param pBlue  The second polygon.
-	\return one of the relations: TeEQUALS, TeDISJOINT, TeTOUCHES, TeWITHIN (pRed IS WITHIN pBlue), TeCONTANS (pBlue CONTAINS pRed), TeOVERLAPS, TeCOVEREDBY (pRed IS COVERED BY pBlue) or TeCOVERS (pRed COVERS pBlue).
-	\note Doesn't do box elimination. You must implement the test in your own functions.
-*/
-TL_DLL short TeRelation(const TePolygon& pRed, const TePolygon& pBlue);
-/** @}	*/
-/** @}	*/
-
-/** @defgroup BoxTests Special box tests
- *  @ingroup GeometryAlgorithms
- *  Box tests.
- *  @{
-*/
-//! Check if box1 is DISJOINT or TOUCHes box2
-TL_DLL bool TeDisjointOrTouches(const TeBox& bx1, const TeBox& bx2);
-
-//! Check if coordinate c is WITHIN or TOUCHes segments c1 and c2 
-bool TeWithinOrTouches(const TeCoord2D& c, const TeCoord2D& c1, const TeCoord2D& c2);
-/** @} */
-
-
-/** @defgroup GeometryTests Special Geometry tests
- *  @ingroup GeometryAlgorithms
- *  Geometry tests.
- *  @{
-*/
-//! Check if geom1 is WITHIN, COVERED BY or EQUAL to geom2
-
-
-template<class T1, class T2> 
-bool TeWithinOrCoveredByOrEquals(const T1& geom1, const T2& geom2)
-{
-	short rel = TeRelation(geom1, geom2);
-
-	if((rel&TeINSIDE) || (rel&TeBOUNDARY))
-	   return true;
-
-	return false;
-}
-
-//! Check if box1 is WITHIN, COVERED BY or EQUAL to box2
-template<>
-TL_DLL bool TeWithinOrCoveredByOrEquals(const TeBox& bx1, const TeBox& bx2);
-
-//! Check if line1 is WITHIN, COVERED BY or EQUAL to line2
-template<>
-TL_DLL bool TeWithinOrCoveredByOrEquals(const TeLine2D& line1, const TeLine2D& line2);
-
-//! Check if line1 is WITHIN or COVERED BY to pol
-template<>
-TL_DLL bool TeWithinOrCoveredByOrEquals(const TeLine2D& line1, const TePolygon& pol);
-
-//! Check if pol1 is WITHIN, COVERED BY or EQUAL to pol2
-template<>
-TL_DLL bool TeWithinOrCoveredByOrEquals(const TePolygon& pol1, const TePolygon& pol2);
-/** @} */
-
-
-/** @defgroup IntersectionOperators Intersection Operators
- *  @ingroup  GeometryAlgorithms
- *  Functions that calculate the intersection among objects or do intersection test.
- *  @{
- */
-
-/** \brief Performs the intersection between  box b1 and b2, returning the resulting box bout.
-	\param bx1  The first box to do the intersection.
-	\param bx2  The second box to do the intersection.
-	\param bout The box formed by the intersection of bx1 and bx2.
-*/
-TL_DLL bool TeIntersection(const TeBox& bx1, const TeBox& bx2, TeBox& bout);
-
-/** \brief Returns the segments that intersept the poly polygon in the line y.
-	\param poly    A polygon.
-	\param y    The ordinate that cuts the polygons edges.
-*/
-TL_DLL TeCoordPairVect	TeGetIntersections(const TePolygon &poly, const double& y);
-/** @} */
-
-
-/** @defgroup UnionOperators Union Operators
- *  @ingroup  GeometryAlgorithms
- *  Functions that compute the union of objects.
- *  @{
- */
-
-/** \brief Combine two box, make one that includes both.
-	\param bx1  The first box to do the union.
-	\param bx2  The second box to do the union.
-*/
-TL_DLL TeBox TeUnion(const TeBox& bx1, const TeBox& bx2);
-
-/** @} */
-
-/** @defgroup TeLocationFunctions Functions that finds the localization of objects.
- *  @ingroup  GeometryAlgorithms
- *  Functions that finds the localization of objects.
- *  @{
- */
-/** \brief Point in polygon inside/outside/boundary code.
-	\param c    The coordinate to test.
-	\param r The simple polygon to test.
-
-	\note Check if point is INSIDE of a given ring.
-	      The ring is treated as a simple polygon (no holes).
-	      Adapted from:
-		  Samosky, Joseph, "SectionView: A system for interactively specifying and
-		  visualizing sections through three-dimensional medical image data,
-		  M.S. Thesis, Department of Electrical Engineering and Computer Science,
-		  Massachusetts Institute of Technology, 1993.
-		 Obs: Doesn't do box elimination.
-*/
-TL_DLL bool TePointInPoly(const TeCoord2D& c, const TeLinearRing& r);
-
-/** \brief Check if coordinate c is on segment (segment is closed).
-	\param c   The coordinate to be tested.
-	\param c1  The first segment's coordinate.
-	\param c2  The second segment's coordinate.
-*/
-TL_DLL bool TeIsOnSegment(const TeCoord2D& c, const TeCoord2D& c1, const TeCoord2D& c2);
-
-/** \brief Check if coordinate c is on line boundary or on line interior (see explanation above for definition of boundary and interior of a line).
-	\param c   The coordinate to be tested.
-	\param l   The line used in the test.
-
-	Obs: Do box elimination.
-*/
-TL_DLL bool TeIsOnLine(const TeCoord2D& c, const TeLine2D& l);
-
-/** \brief Locate the nearest line segment of a coordinate.
-	\param pin		The coordinate.
-	\param line		The line.
-	\param segment  The position of the segment in the line  
-	\param tol		Tolerance.
-*/
-TL_DLL bool TeLocateLineSegment(TeCoord2D& pin, TeLine2D& line, int& segment, double tol = 0.0);
-/** @} */
-
-/** @defgroup TeConvexHull Functions to compute the Convex Hull
- *  @ingroup  GeometryAlgorithms
- *  Functions that returns the convex hull of a point list.
- *  @{
- */
- /** \brief Returns the convexhull of a given list of coords in counterclockwise.
-	 \param coordSet A list with coordinates without duplicated coordinates.
-
-	\note This algorithm is based on the book Computational Geometry
-	      by M. de Berg, M. van Kreveld, M. Overmars and O. Schwarzkopf - Springer Verlag - pp. 6.
-	      It is O(N log N).
-*/
-template<class T>
-TePolygon TeConvexHull(const T& coordSet);
-
-//! This is a explicit specialization that returns the convex hull of a TePolygon
-template<>
-TL_DLL TePolygon TeConvexHull(const TePolygon& p);
-
-//! This is a explicit specialization that returns the convex hull of a TePolygonSet
-template<>
-TL_DLL TePolygon TeConvexHull(const TePolygonSet& ps);
-
-//! This is a explicit specialization that returns the convex hull of a TePointSet. Must be defined!
-template<>
-TL_DLL TePolygon TeConvexHull(const TePointSet& ps);
-
-/** @} */
-
-/** @defgroup TeUtils Utilities functions.
- *  @ingroup  GeometryAlgorithms
- *  @{
- */
-//! Given a projection "proj" returns a tolerance value in the same unit of projection to be used in geometric operations
-TL_DLL double TeGetPrecision(TeProjection* proj);
-
-//! This class implements the Epsilon-tweaking used in calculus.
-class TL_DLL TeGeometryAlgorithmsPrecision
-{
-	protected:
-
-		//! Constructor
-		TeGeometryAlgorithmsPrecision();
-
-	public:		
-
-		//! Tells if d1 is greater than d2 according to tolerance factor.
-		static bool IsGreater(const double& d1, const double& d2)
-		{
-			return ((d1 - d2) > TePrecision::instance().precision());
-		}
-
-		//! Tells if d1 is greater than or equal to d2 according to tolerance factor.
-		static bool IsGreaterEqual(const double& d1, const double& d2)
-		{
-			return ((d1 - d2) >= (-TePrecision::instance().precision()));
-		}
-
-		//! Tells if d1 is smaller than d2 according to a tolerance factor.
-		static bool IsSmaller(const double& d1, const double& d2)
-		{
-			return ((d1 - d2) < -(TePrecision::instance().precision()));
-		}
-
-		//! Tells if d1 is smaller than or equals to d2 according to a tolerance factor.
-		static bool IsSmallerEqual(const double& d1, const double& d2)
-		{
-			return ((d1 - d2) <= TePrecision::instance().precision());
-		}
-
-		//! Tells if d1 is equals to d2 according to a tolerance factor.
-		static bool IsEqual(const double& d1, const double& d2)
-		{
-			return (fabs(d1 - d2) <= TePrecision::instance().precision());
-		}
-
-		//! Tells if d1 is different from d2 according to a tolerance factor.
-		static bool IsDifferent(const double& d1, const double& d2)
-		{
-			return (fabs(d1 - d2) > TePrecision::instance().precision());
-		}
-};
-
-//! Removes the duplicate coordinates of a line
-TL_DLL inline void TeRemoveDuplicatedCoordinates(TeLine2D& l)
-{
-	for(unsigned int i = 0; i < l.size() - 1; ++i)
-		if(TeEquals(l[i], l[i + 1]))
-		{
-			l.erase(i);
-			--i;
-		}
-
-	return;
-}
-
-//! Removes the duplicate coordinates of a polygon
-TL_DLL inline void TeRemoveDuplicatedCoordinates(TePolygon& p)
-{
-	for(unsigned int i = 0; i < p.size(); ++i)
-		TeRemoveDuplicatedCoordinates(p[i]);		
-
-	return;
-}
-
-/** \brief Reverses the orientation of a line.
-	\param lin  The line to be reversed.
-*/
-TL_DLL inline void TeReverseLine(TeLine2D& lin)
-{
-	for(unsigned int i=0,j=lin.size()-1 ; i<lin.size()/2 ; ++i,--j)
-	{
-		TeCoord2D p = lin[i];
-		lin[i] = lin[j];
-		lin[j] = p;
-	}
-
-	return;
-}
-
-
-/** \brief Verifies if a simple polygon defined as a linear ring is convex or not.
-	\param ring  The polygon to test convexity.
-*/
-TL_DLL bool TeIsConvex(const TeLinearRing& ring);
-
-/** \brief Returns the orientation of the ring (CLOCKWISE or COUNTERCLOCKWISE);
-	\param r The ring to be checked.
-*/
-TL_DLL short TeOrientation(const TeLinearRing& r);
-
-/** @} */
-
-/** @defgroup MetricOperators Metric operators
- *  @ingroup  GeometryAlgorithms
- *  Functions that do some usefull metric operations.
- *  @{
- */
-
-/** \brief Returns the middle point of a segment.
-	\param first   The first segment's coordinate.
-	\param last    The second segment's coordinate.
-	\param middle  The middle point.
-*/
-TL_DLL void TeGetMiddlePoint(const TeCoord2D& first, const TeCoord2D& last, TeCoord2D& middle);
-
-/** \brief Calculates the Euclidian distance between two points.
-	\param c1 First coordinate;
-	\param c2 Second coordinate;
-*/
-TL_DLL double TeDistance(const TeCoord2D& c1, const TeCoord2D& c2);
-
-/** \brief Returns the length of a Line 2D.
-	\param l  The line to calculate the length.	
-*/
-TL_DLL double TeLength(const TeLine2D& l);
-
-/** \brief Perpendicular distance from point to segment.
-	\param first  The first segment's coordinate.
-	\param last   The second segment's coordinate.
-	\param pin    The point to get the distance from the segment.
-	\param pinter The point of intersection on the segment.
-*/
-TL_DLL double TePerpendicularDistance(const TeCoord2D& first, const TeCoord2D& last, const TeCoord2D& pin, TeCoord2D &pinter);
-
-/** \brief Minimal distance from point to segment.
-	\param first	The first segment's coordinate.
-	\param last		The second segment's coordinate.
-	\param pin		The point to get the minimal distance from the segment. This point is inside the segment  
-	\param pout		The nearest segment point of the pin point.
-	\param tol		Numerical tolerance
-*/
-TL_DLL double TeMinimumDistance (const TeCoord2D& first, const TeCoord2D& last, const TeCoord2D& pin, TeCoord2D& pout, double tol = 0.0);
-
-/** \brief Template class to compute the area of a geometry
-	\param geom The geometry whose area we want to known.
-	\note This algorithm is based on the book Spatial Databases with Application to GIS
-	      by Philippe Rigaux, Michel O. Scholl and Agnes Voisard.
-
-*/
-
-template<class T>
-double TeGeometryArea(const T& /* geom */)
-{
-	return 0.0;
-}
-
-//! This is a explicit specialization that returns the area of a TePolygon
-template<>
-TL_DLL double TeGeometryArea(const TePolygon& p);
-
-//! This is a explicit specialization that returns the area of a TePolygonSet
-template<>
-TL_DLL double TeGeometryArea(const TePolygonSet& ps);
-
-//! This is a explicit specialization that returns the area of a Box
-template<>
-TL_DLL double TeGeometryArea(const TeBox& b);
-
-//! This is a explicit specialization that returns the area of a Box
-template<>
-TL_DLL double TeGeometryArea(const TeMultiGeometry& mGeom);
-/** @} */
-
-/** @defgroup GeometryFunction Functions that return geometries.
- *  @ingroup  GeometryAlgorithms
- *  Functions that return geometries.
- *  @{
- */
-/** \brief Given a box return its polygon representation.
-	\param b  The box to create a polygon.
-*/
-TL_DLL TePolygon TeMakePolygon(const TeBox& b);
-
-/** \brief Given N points, finds a path that doesn't self-intersects
-	\note Given N points, finds a path that doesn't self-intersects, visiting all points and returning 
-	      to the begginning one. It is based on the book Algorithms by Robert Sedgewick, Addisson-Wesley, 1988;
-	\param pSet The point set to form a path.
-*/
-TL_DLL TeLinearRing TeSimpleClosedPath(const TePointSet& pSet);
-/** @} */
-
-
-/** @defgroup TeFindCentroid Functions to compute the centroid
- *  @ingroup  GeometryAlgorithms
- *  Functions that return the centroid.
- *  @{
- */
-
-/** \brief Calculates the centroid of a multi geometry.
-	\param p A multi geometry whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(TeMultiGeometry& mGeom);
-
-/** \brief Calculates the centroid of a polygon.
-	\param p A TePolygon whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(const TePolygon& p);
-
-/** \brief Calculates a reference point.
-	\param l A TeLine whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(const TeLine2D& l);  
-
-/*! \fn TeCoord2D TeFindCentroid(const TeCell& c );
-    \brief Calculates the centroid of a cell.
-	\param c A TeCell whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(const TeCell& c);
-
-/** \brief Calculates the centroid of a point.
-	\param p A TePoint whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(const TePoint& p);
-
-/** \brief Calculates the centroid of a text.
-	\param t A TeText whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(const TeText& t);
-
-/** \brief Calculates the centroid of a polygon set.
-	\param s A TePolygon set whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(const TePolygonSet& s); 
-
-/** Calculates the centroid of a line set.
-	\param s A TeLine set whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(const TeLineSet& s); 
-
-/** \brief Calculates the centroid of a cell set.
-	\param s A TeCell set whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(const TeCellSet& s);
-
-/** \brief Calculates the centroid of a point set.
-	\param ps A TePointSet set whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(TePointSet& ps);
-
-/** \brief Calculates the centroid of a text set.
-	\param ts A TeTextSet set whose centroid we want to known.
-*/
-TL_DLL TeCoord2D TeFindCentroid(TeTextSet& ts);
-
-/** \brief Calculates the center of a triangle.
-	\param vert0 First triagle's vertex.
-	\param vert1 Second triagle's vertex.
-	\param vert2 Third triagle's vertex.
-	\param pc    The triangle center.
-*/
-TL_DLL bool TeFindTriangleCenter(const TeCoord2D& vert0, const TeCoord2D& vert1, const TeCoord2D& vert2, TeCoord2D& pc); 
-/** \brief Calculates intersection between two segments.
-	\param fr0 First point of first segment.
-	\param to0 Second point of first segment.
-	\param fr1 First point of second segment.
-	\param to1 Second point of second segment.
-	\param pi    The intersection point coordinates.
-	\return true is intersects, false otherwise.
-*/
-
-TL_DLL bool TeSegmentsIntersectPoint(const TeCoord2D& fr0, const TeCoord2D& to0, const TeCoord2D& fr1, const TeCoord2D& t1, TeCoord2D& pi); 
-
-/** @} */
-
-
-/** @defgroup TeNearest Functions to compute the nearest part of an object to a point.
-  *  @ingroup  GeometryAlgorithms
-  *  Auxiliary functions.
-  *  @{
-  */
-//! Nearest node in set from location pt (i = the node index in the nodeset)
-TL_DLL bool TeNearest(TeCoord2D& pt, TeNodeSet& ns , int& i, const double& tol = 0.0);
-
-//! Nearest point in set from location pt (i = the point index in the pointset)
-TL_DLL bool TeNearest(TeCoord2D& pt, TePointSet& ps , int& i, const double& tol = 0.0);
-
-//! Nearest text in set from location pt (i = the text index in the textset)
-TL_DLL bool TeNearest(TeCoord2D& pt, TeTextSet& ts , int& i, const double& tol = 0.0);
-
-//! Nearest line in set from location pt (i = the line index in the lineset and pi = the closest point)
-//! The pi point can be outside a line of the line set
-TL_DLL bool TeNearest(TeCoord2D& pt, TeLineSet& ls , int& i, TeCoord2D& pi, const double& tol = 0.0);
-
-//! Nearest line in set from location pt (i = the line index in the lineset and pout = the closest point)
-//! The pout point must be inside a line of the line set
-TL_DLL bool TeNearest (TeCoord2D& pt,TeLineSet& ls, int& lindex, TeCoord2D& pout, double& dmin, const double& tol = 0.0); 
-
-//! Nearest polygon in set from location pt (i = the polygon index in the polygonset).
-TL_DLL bool TeNearest(TeCoord2D& pt, TePolygonSet& ps , int& i, const double& tol = 0.0);
-
-//! Nearest line in set from location pt (i = the line index in lineset) calculated by the vertex of the lines
-TL_DLL bool TeNearestByPoints(TeCoord2D& pt, TeLineSet& ls , int& i, double& dist, const double& tol = 0.0);
-/** @} */
-
-/** @defgroup CurveFunctions Functions used to deal with smooth curves
-  *  @ingroup  GeometryAlgorithms
-  *  @{
-  */
-/** \brief Given three points of a circunference, returns its center point.
-	\param p1      First point.
-	\param p2      Second point.
-	\param p3      Third point.
-	\param center  Circunference center.
-	This algorithm is adapted from http://www.delphiforfun.org/Programs/Math_Topics/circle_from_3_points.htmbook.
-*/
-TL_DLL bool TeGetCenter(TePoint p1, TePoint p2, TePoint p3, TePoint &center);
-
-/** \brief Given three points of a circunference, returns the radius.
-	\param p1      First point.
-	\param p2      Second point.
-	\param p3      Third point.
-	This algorithm is adapted from http://www.delphiforfun.org/Programs/Math_Topics/circle_from_3_points.htmbook.
-*/
-TL_DLL double TeGetRadius(TePoint &p1, TePoint &p2, TePoint &p3);
-
-/** \brief Given three points returns a smooth arc as a TeLine2D that contains a given total number of points.
-
-	\param p1      First point.
-	\param p2      Second point.
-	\param p3      Third point.
-	\param arcOut  The return arc.
-	\param NPoints Number of arc points.	
-	
-	This algorithm is adapted from http://mathforum.org/dr.math/
-  
-*/
-TL_DLL bool TeGenerateArc(TePoint& p1, TePoint& p2, TePoint& p3, TeLine2D& arcOut, const short& NPoints);
-
-/** \brief Given a center point and a radius, returns the circle  as a TeLine2D interpolated by a given number of points
-	\param center  Center point of the circle.
-	\param radius  radius of the circle.
-	\param circle  The return circle
-	\param NPoints Number of circle points.	
-*/
-TL_DLL bool TeGenerateCircle(TePoint& center, const double& radius, TeLine2D& circle, const short& NPoints);
-
-/** \brief Performs a line simplication
-	\param line		The line to be simplified
-	\param snap		Simplification threshold
-	\param maxdist	The maximum distance between intermediary segments
-*/
-TL_DLL bool TeLineSimplify(TeLine2D& line, double snap, double maxdist);
-
-
-/** @} */
-
-/** @} */ // end of group  GeometryAlgorithms
-
-
-#endif	// __TERRALIB_INTERNAL_GEOMETRYALGORITHMS_H
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGeometryAlgorithms.h
+    \brief This file contains Algorithms for Topological Operations.
+	\author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+*/
+#ifndef  __TERRALIB_INTERNAL_GEOMETRYALGORITHMS_H
+#define  __TERRALIB_INTERNAL_GEOMETRYALGORITHMS_H
+
+#include "TeGeometry.h"
+#include "TeMultiGeometry.h"
+
+#include "TePrecision.h"
+#include "TeProjection.h"
+
+//! Intersection coordinates of two segments.
+typedef vector<TeCoord2D> TeIntersCoordsVec;
+
+/** @defgroup GeometryAlgorithms Geometry algorithms
+	TerraLib geometry algorithms.
+	@{
+*/
+
+/** @defgroup TopologicalOperators Topological operators
+    @ingroup  GeometryAlgorithms
+	Functions that test topologival relation between two objects.
+\verbatim
+	The topological operators are based on the intersection of interior, exterior and boundary of geometries:
+  ------------------------------------------------------------------------------------------------------------------
+ | TeGeometry   |  INTERIOR                        | BOUNDARY           | EXTERIOR                                |
+  ------------------------------------------------------------------------------------------------------------------
+ | TePoint      | The point itself                 | Empty              | Everything except interior              |
+ | TeLine2D     | All points except the end points | The two end points | Everything except interior and boundary |
+ | TeLinearRing | All points                       | Empty              | Everything except interior and boundary |
+ | TePolygon    | Everything between the external  | All rings          | Everything except interior and boundary |
+ |              | ring and the inner rings         |                    |                                         |
+  ------------------------------------------------------------------------------------------------------------------
+ 
+We use:
+	- I: for Interior
+	- E: for Exterior
+	- B: for Boundary
+	- inter: Intersects
+	- ^: AND
+	- v: OR
+	- A = refer to two-dimensional geometries (TePolygon and TePolygonSet)
+	- L = refer to one-dimensional geometries (TeLine2D and TeLineSet)
+	- P = refer to 0-dimensional geometries   (TePoint and TePointSet)
+ \endverbatim
+@{
+*/
+
+/** @defgroup TeEquals Equals test
+    @ingroup TopologicalOperators
+    Check if one object is equal another object.
+\verbatim
+ Applies to: P/P, L/L and A/A.
+ TeEquals(x, y) => (x inter y = x) ^ (y inter x = y)
+                   (B(x) inter I(y) = false) ^ (B(x) inter E(y) = false) 
+\endverbatim
+@{
+*/
+//! If a specialized function is not used, returns false.
+template<class T1, class T2>
+inline bool TeEquals(const T1& /*o1*/, const T2& /*o2*/)
+{
+	return false;
+}
+
+//! Check if coordinate 1 and coordinate 2 are equal
+template<>
+TL_DLL bool TeEquals(const TeCoord2D& c1, const TeCoord2D& c2);
+
+//!  Check if point 1 and point 2 are equal
+template<>
+TL_DLL bool TeEquals(const TePoint& p1, const TePoint& p2);
+
+//! Check if lineRed and lineBlue are equal
+template<>
+TL_DLL bool TeEquals(const TeLine2D& redLine, const TeLine2D& blueLine);
+
+//! Check if polygon red and polygon blue are equal
+template<>
+TL_DLL bool TeEquals(const TePolygon& redPol, const TePolygon& bluePol);
+
+//! Check if polygonset1 and polygonset1 are equal
+template<>
+TL_DLL bool TeEquals( const TePolygonSet& ps1, const TePolygonSet& ps2 );
+
+//! Check if box 1 and box 2 are equal 
+template<>
+TL_DLL bool TeEquals(const TeBox& bx1, const TeBox& bx2);
+
+//! Check if cell 1 and cell 2 are equal
+template<>
+TL_DLL bool TeEquals(const TeCell& cell1, const TeCell& cell2);
+/** @} */ 
+
+/** @defgroup TeDisjoint Disjoint test
+    @ingroup TopologicalOperators
+ Check if two objects are disjoint.
+\verbatim
+ Applies to all geometries.
+ TeDisjoint(x, y) => (x inter y = false)
+                     (I(x) inter I(y) = false) ^ (I(x) inter B(y) = false) ^ (B(x) inter I(y) = false) ^ (B(x) inter B(y) = false)
+\endverbatim
+@{
+*/
+
+template<class T1, class T2> 
+inline bool TeDisjoint(const T1& o1, const T2& o2)
+{
+	return TeDisjoint(o2, o1);
+}
+
+//! Check if coordinate cl and coordinate c2 are disjoint
+TL_DLL bool TeDisjoint(const TeCoord2D& c1, const TeCoord2D& c2);
+
+//! Check if coordinate and box are disjoint
+TL_DLL bool TeDisjoint(const TeCoord2D& c, const TeBox& b);
+
+//! Check if box 1 and box 2 are disjoint
+TL_DLL bool TeDisjoint(const TeBox& bx1, const TeBox& bx2);
+
+//! Check if coordinate and line are disjoint
+TL_DLL bool TeDisjoint(const TeCoord2D& c, const TeLine2D& l);
+
+//! Check if coordinate and polygon are disjoint
+TL_DLL bool TeDisjoint(const TeCoord2D& c, const TePolygon& pol);
+
+//! Check if point l and point 2 are disjoint
+TL_DLL bool TeDisjoint(const TePoint& p1, const TePoint& p2);
+
+//! Check if point and object are disjoint
+TL_DLL bool TeDisjoint(const TePoint& p, const TeLine2D& l);
+
+//! Check if point and object are disjoint
+TL_DLL bool TeDisjoint(const TePoint& p, const TePolygon& pol);
+
+//! Check if lines are disjoint
+TL_DLL bool TeDisjoint(const TeLine2D& redLine, const TeLine2D& blueLine);
+
+//! Check if line and polygon are disjoint
+TL_DLL bool TeDisjoint(const TeLine2D& l, const TePolygon& pol);
+
+//! Check if polygons are disjoint
+TL_DLL bool TeDisjoint(const TePolygon& redPol, const TePolygon& bluePol);
+
+//! Check if cell 1 and cell 2 are disjoint
+TL_DLL bool TeDisjoint(const TeCell& cell1, const TeCell& cell2);
+
+//! Check if cell and line are disjoint
+TL_DLL bool TeDisjoint(const TeCell& cell, const TeLine2D& line);
+
+//! Check if cell and polygon are disjoint
+TL_DLL bool TeDisjoint(const TeCell& cell, const TePolygon& pol);
+
+//! Check if cell and point are disjoint
+TL_DLL bool TeDisjoint(const TeCell& cell, const TePoint& point);
+/** @} */
+
+
+/** @defgroup TeIntersects Intersects test
+    @ingroup TopologicalOperators
+	Check if one object intersects another object.
+\verbatim
+  Applies to all geometries.
+  TeIntersects(x, y) => !TeDisjoint(x, y)
+                     => (I(x) inter I(y) = true) v (I(x) inter B(y) = true) v (B(x) inter I(y) = true) v (B(x) inter B(y) = true)
+\endverbatim
+@{
+*/
+//! If a specialized function is not used, returns the disjoint negation
+
+template<class T1, class T2>
+bool TeIntersects(const T1& o1, const T2& o2)
+{
+	return !TeDisjoint(o1, o2);
+}
+
+//! Check if coordinate and box intersects
+template<>
+TL_DLL bool TeIntersects(const TeCoord2D& c, const TeBox& b);
+
+//! Check if point and box intersects
+template<>
+TL_DLL bool TeIntersects(const TePoint& p, const TeBox& b);
+
+//! Check if boxes intersects
+template<>
+TL_DLL bool TeIntersects(const TeBox& bx1, const TeBox& bx2);
+/** @} */
+
+
+/** @defgroup TeTouches Touch test
+	@ingroup TopologicalOperators
+	Check if two objects touches.
+\verbatim
+ Applies to A/A, L/L, L/A, P/A, P/L.
+ TeTouches(x, y) => (I(x) inter I(y) = false) ^ (x inter y = true)
+				    => (I(x) inter I(y) = false) ^ ((B(x) inter I(y) = true) v (I(x) inter B(y) = true) v (B(x) inter B(y) = true))
+ \endverbatim
+ @{
+*/
+
+//! Check if coordinate and line touches
+TL_DLL bool TeTouches(const TeCoord2D& c, const TeLine2D& l);
+
+//! Check if coordinate and polygon touches
+TL_DLL bool TeTouches(const TeCoord2D& c, const TePolygon& pol);
+
+//! Check if point and object touches
+TL_DLL bool TeTouches(const TePoint& p, const TeLine2D& l);
+
+//! Check if point and object touches
+TL_DLL bool TeTouches(const TePoint& p, const TePolygon& pol);
+
+//! Check if line and line touches
+TL_DLL bool TeTouches(const TeLine2D& redLine, const TeLine2D& blueLine);
+
+//! Check if line and polygon
+TL_DLL bool TeTouches(const TeLine2D& l, const TePolygon& pol);
+
+//! Check if polygons touches
+TL_DLL bool TeTouches(const TePolygon& redPol, const TePolygon& bluePol);
+
+//! Check if boxes touches
+TL_DLL bool TeTouches(const TeBox& bx1, const TeBox& bx2);
+
+//! Check if cells touches
+TL_DLL bool TeTouches(const TeCell& c1, const TeCell& c2);
+
+//! Check if cell and line touches
+TL_DLL bool TeTouches(const TeLine2D& line, const TeCell& cell);
+
+//! Check if cell and polygon touches
+TL_DLL bool TeTouches(const TeCell& c1, const TePolygon& poly);
+
+//! Check if cell and point touches
+TL_DLL bool TeTouches( const TePoint& point, const TeCell& c1);
+/** @} */
+
+/** @defgroup TeCrosses Crosses test
+    @ingroup TopologicalOperators
+	Check if one object crosses another object.
+\verbatim
+  TeCrosses(x, y) => dim(I(x) inter I(y)) = (max(dim(I(x)), dim(I(y))) - 1) ^ (x inter y != x) ^ (x inter y != y) 
+  Case 1: x = TeLine2D and y = TePolygon
+          => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = true)
+  Case 2: x = TeLine2D and y = TeLine2D
+          => dim(I(x) inter I(y)) = 0
+\endverbatim
+@{
+*/
+
+//! Check if red line crosses blue line
+TL_DLL bool TeCrosses(const TeLine2D& redLine, const TeLine2D& blueLine);
+
+//! Check if line crosses polygon
+TL_DLL bool TeCrosses(const TeLine2D& l, const TePolygon& pol);
+
+//! Check if line and cell crosses
+TL_DLL bool TeCrosses(const TeLine2D& l, const TeCell& cell);
+/** @} */
+
+
+/** @defgroup TeWithin Within test
+ *  @ingroup TopologicalOperators
+ *  Check if one object is within another object.
+ \verbatim
+   TeWithin(x, y) => (x inter y = x) ^ (I(x) inter I(y) = true)
+   Case 1: P/P, P/L and P/A
+           => (I(x) inter I(y) = true)
+   Case 2: L/L and A/A
+           => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = false) ^ (B(x) inter E(y) = false) ^ (B(x) inter B(y) = false)
+   Case 3: L/A
+           => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = false) ^ (B(x) inter E(y) = false) ^ (B(x) inter B(y) = false) ^ (I(x) inter B(y) = false)
+\endverbatim
+ @{
+*/
+
+//! Check if coordinate 1 is within coordinate 2
+TL_DLL bool TeWithin(const TeCoord2D& c1, const TeCoord2D& c2);
+
+//! Check if coordinate is within a box
+TL_DLL bool TeWithin(const TeCoord2D& c, const TeBox& b);
+
+//! Check if a cordinate is within a line
+TL_DLL bool TeWithin(const TeCoord2D& c, const TeLine2D& l);
+
+//! Check if a cordinate is within a polygon
+TL_DLL bool TeWithin(const TeCoord2D& c, const TePolygon& pol);
+
+//! Check if point 1 is within point 2
+TL_DLL bool TeWithin(const TePoint& p1, const TePoint& p2);
+
+//! Check if point is within object
+TL_DLL bool TeWithin(const TePoint& p, const TeLine2D& l);
+
+//! Check if point is within object
+TL_DLL bool TeWithin(const TePoint& p, const TePolygon& pol);
+
+//! Check if red line is within blue line
+TL_DLL bool TeWithin(const TeLine2D& redLine, const TeLine2D& blueLine);
+
+//! Check if line is within polygon
+TL_DLL bool TeWithin(const TeLine2D& l, const TePolygon& pol);
+
+//! Check if red polygon is within blue polygon
+TL_DLL bool TeWithin(const TePolygon& redPol, const TePolygon& bluePol);
+
+//! Check if box1 is within box2
+TL_DLL bool TeWithin(const TeBox& bx1, const TeBox& bx2);
+
+//! Check if cell1 is within cell2
+TL_DLL bool TeWithin(const TeCell& cell1, const TeCell& cell2);
+
+//! Check if line is within cell
+TL_DLL bool TeWithin(const TeLine2D& line, const TeCell& cell);
+
+//! Check if cell is within polygon
+TL_DLL bool TeWithin(const TeCell& cell, const TePolygon& poly);
+
+//! Check if point is within cell
+TL_DLL bool TeWithin(const TePoint& point, const TeCell& cell);
+/** @} */
+
+/** @defgroup TeContains Contains test
+    @ingroup TopologicalOperators
+    Check if one object contains another object.
+    TeContains(x, y) = TeWithin(y, x)
+@{
+*/
+
+//! If a specialized function is not used, returns false
+template<class T1, class T2>
+inline bool TeContains(const T1& o1, const T2& o2)
+{
+	return TeWithin(o2, o1);
+}
+/** @} */
+
+/** @defgroup TeOverlaps Overlaps test
+	@ingroup TopologicalOperators
+    Check if one object overlaps another object.
+\verbatim
+   TeOverlaps(x, y) => (dim(I(x)) = dim(I(y)) = dim(I(x) inter I(y))) ^ (x inter y != x) ^ (x inter y != y)
+   Case 1: (x = TePolygon  and y = TePolygon)
+           => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = true) ^ (E(x) inter I(y) = true)
+   Case 2: x = TeLine2D and y = TeLine2D
+           => (dim(I(x) inter I(y)) = 1) ^ (I(x) inter E(y) = true) ^ (E(x) inter I(y) = true)
+ \endverbatim
+@{
+*/
+
+//! Check if red red overlaps blue line
+TL_DLL bool TeOverlaps(const TeLine2D& redLine, const TeLine2D& blueLine);
+
+//! Check if red polygon overlaps blue polygon
+TL_DLL bool TeOverlaps(const TePolygon& redPol, const TePolygon& bluePol);
+
+//! Check if cell1 overlaps cell2
+TL_DLL bool TeOverlaps(const TeCell& cell1, const TeCell& cell2);
+
+//! Check if cell overlaps polygon
+TL_DLL bool TeOverlaps(const TeCell& cell, const TePolygon& poly);
+/** @} */
+
+
+/** @defgroup TeCoveredBy Covered by test
+  @ingroup TopologicalOperators
+  Check if one object is covered by another object.
+  \verbatim
+ TeCoveredBy(x, y) => (x inter y = x) ^ (I(x) inter I(y) = true)
+   - Case 1: (x = TePolygon and y = TePolygon) or (x = TeLine2D and y = TeLine2D)
+             => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = false) ^ (B(x) inter E(y) = false) ^ (B(x) inter B(y) = true)
+   - Case 2: x = TeLine2D and y = TePolygon
+             => (I(x) inter I(y) = true) ^ (I(x) inter E(y) = false) ^ (B(x) inter E(y) = false) ^ ((B(x) inter B(y) = true) v (I(x) inter B(y) = true))
+ \endverbatim
+ @{
+ */
+
+//! Check if red line is covered by blue line
+TL_DLL bool TeCoveredBy(const TeLine2D& redLine, const TeLine2D& blueLine);
+
+//! Check if line is covered by polygon
+TL_DLL bool TeCoveredBy(const TeLine2D& l, const TePolygon& pol);
+
+//! Check if red polygon is covered by blue polygon
+TL_DLL bool TeCoveredBy(const TePolygon& redPol, const TePolygon& bluePol);
+
+//! Check if cell1 is covered by cell2
+TL_DLL bool TeCoveredBy(const TeCell& cell1, const TeCell& cell2);
+
+//! Check if polygon is covered by cell
+TL_DLL bool TeCoveredBy(const TePolygon& poly, const TeCell& cell);
+
+//! Check if line is covered by cell
+TL_DLL bool TeCoveredBy(const TeLine2D& line, const TeCell& cell);
+/** @} */
+
+/** @defgroup TeCovers Covers test
+    @ingroup TopologicalOperators
+    Check if one object covers another object.
+    TeCovers(x, y) => TeCoveredBy(y, x)
+@{
+*/
+//! Check if one object covers another object
+template<typename T1, typename T2>
+inline bool TeCovers(T1& o1, T2& o2)
+{
+	return TeCoveredBy(o2, o1);
+}
+/** @} */
+
+/** @defgroup TeRelation Relation test
+ *  @ingroup TopologicalOperators
+ *  Return the relation between two objects.
+ *  @{
+ */
+/** \brief Returns the relation between coordinate c and line l.
+	\param c  The coordinate.
+	\param l  The line.
+	\return one of the relations: INSIDE, OUTSIDE or BOUNDARY.
+	\note It doesn't do box elimination, just uses from TeIsOnLine(coordinate, line) elimination
+ */
+TL_DLL short TeRelation(const TeCoord2D& c, const TeLine2D& l);
+ 
+ /** \brief Point in polygon inside/outside/boundary code.
+	 \param c    The coordinate to test.
+	 \param r    The simple polygon to test.
+	 \return one of the relations: INSIDE, OUTSIDE or BOUNDARY.
+	 \note	The ring is treated as a simple polygon (no holes). Does box elimination.
+*/
+TL_DLL short TeRelation(const TeCoord2D& c, const TeLinearRing& r);
+
+/** \brief Coordinate in polygon inside/outside/boundary code.
+	\param c    The coordinate to test.
+	\param pol  The polygon to test.
+	\return one of the relations: INSIDE, OUTSIDE or BOUNDARY.
+	\note It doesn't do box elimination, just uses from TeRelation(coordinate, line) elimination
+*/
+TL_DLL short TeRelation(const TeCoord2D& c, const TePolygon& pol);
+
+/** \brief Point in polygon inside/outside/boundary code.
+	\param p    The coordinate to test.
+	\param pol  The polygon to test.
+	\return one of the relations: INSIDE, OUTSIDE or BOUNDARY.
+	\note It doesn't do box elimination, just uses from TeRelation(coordinate, line) elimination
+*/
+TL_DLL short TeRelation(const TePoint& p, const TePolygon& pol); 
+
+/** \brief Point in polygon set inside/outside/boundary code.
+	\param c     The coordinate to test.
+	\param pSet  The polygon set to test.
+	\return one of the relations: INSIDE, OUTSIDE or BOUNDARY.
+	\note Does box elimination.
+*/
+TL_DLL short TeRelation(const TeCoord2D& c, const TePolygonSet& pSet);
+
+/** \brief This function returns the relation between two lines.
+	\param lRed     The first line.
+	\param lBlue    The second line.
+	\param relation To return the relation that stop the search: TeDISJOINT, TeTOUCHES, TeWITHIN, TeCONTAINS, TeCROSSES, TeOVERLAPS, TeCOVEREDBY, TeCOVERS, TeEQUALS
+	\note Doesn't do box elimination. You must implement the test in your own functions.
+*/
+TL_DLL short TeRelation(const TeLine2D& lRed, const TeLine2D& lBlue, const short& relation);
+
+/** \brief This function returns the relation between a line and a polygon.
+	\param line   The line.
+	\param pol    The polygon.
+	\return one of the relations:  TeDISJOINT, TeTOUCHES, TeWITHIN (THE LINE IS WITHIN), TeCROSSES, TeCOVEREDBY (THE LINE IS COVERED BY).
+	\note Doesn't do box elimination. You must implement the test in your own functions.
+*/
+TL_DLL short TeRelation(const TeLine2D& line, const TePolygon& pol);
+
+/** \brief This function returns the relation between two polygons.
+	\param pRed   The first polygon.
+	\param pBlue  The second polygon.
+	\return one of the relations: TeEQUALS, TeDISJOINT, TeTOUCHES, TeWITHIN (pRed IS WITHIN pBlue), TeCONTANS (pBlue CONTAINS pRed), TeOVERLAPS, TeCOVEREDBY (pRed IS COVERED BY pBlue) or TeCOVERS (pRed COVERS pBlue).
+	\note Doesn't do box elimination. You must implement the test in your own functions.
+*/
+TL_DLL short TeRelation(const TePolygon& pRed, const TePolygon& pBlue);
+/** @}	*/
+/** @}	*/
+
+/** @defgroup BoxTests Special box tests
+ *  @ingroup GeometryAlgorithms
+ *  Box tests.
+ *  @{
+*/
+//! Check if box1 is DISJOINT or TOUCHes box2
+TL_DLL bool TeDisjointOrTouches(const TeBox& bx1, const TeBox& bx2);
+
+//! Check if coordinate c is WITHIN or TOUCHes segments c1 and c2 
+TL_DLL bool TeWithinOrTouches(const TeCoord2D& c, const TeCoord2D& c1, const TeCoord2D& c2);
+/** @} */
+
+
+/** @defgroup GeometryTests Special Geometry tests
+ *  @ingroup GeometryAlgorithms
+ *  Geometry tests.
+ *  @{
+*/
+//! Check if geom1 is WITHIN, COVERED BY or EQUAL to geom2
+
+
+template<class T1, class T2> 
+bool TeWithinOrCoveredByOrEquals(const T1& geom1, const T2& geom2)
+{
+	short rel = TeRelation(geom1, geom2);
+
+	if((rel&TeINSIDE) || (rel&TeBOUNDARY))
+	   return true;
+
+	return false;
+}
+
+//! Check if box1 is WITHIN, COVERED BY or EQUAL to box2
+template<>
+TL_DLL bool TeWithinOrCoveredByOrEquals(const TeBox& bx1, const TeBox& bx2);
+
+//! Check if line1 is WITHIN, COVERED BY or EQUAL to line2
+template<>
+TL_DLL bool TeWithinOrCoveredByOrEquals(const TeLine2D& line1, const TeLine2D& line2);
+
+//! Check if line1 is WITHIN or COVERED BY to pol
+template<>
+TL_DLL bool TeWithinOrCoveredByOrEquals(const TeLine2D& line1, const TePolygon& pol);
+
+//! Check if pol1 is WITHIN, COVERED BY or EQUAL to pol2
+template<>
+TL_DLL bool TeWithinOrCoveredByOrEquals(const TePolygon& pol1, const TePolygon& pol2);
+/** @} */
+
+
+/** @defgroup IntersectionOperators Intersection Operators
+ *  @ingroup  GeometryAlgorithms
+ *  Functions that calculate the intersection among objects or do intersection test.
+ *  @{
+ */
+
+/** \brief Performs the intersection between  box b1 and b2, returning the resulting box bout.
+	\param bx1  The first box to do the intersection.
+	\param bx2  The second box to do the intersection.
+	\param bout The box formed by the intersection of bx1 and bx2.
+*/
+TL_DLL bool TeIntersection(const TeBox& bx1, const TeBox& bx2, TeBox& bout);
+
+/** \brief Returns the segments that intersept the poly polygon in the line y.
+	\param poly    A polygon.
+	\param y    The ordinate that cuts the polygons edges.
+*/
+TL_DLL TeCoordPairVect	TeGetIntersections(const TePolygon &poly, const double& y);
+/** @} */
+
+
+/** @defgroup UnionOperators Union Operators
+ *  @ingroup  GeometryAlgorithms
+ *  Functions that compute the union of objects.
+ *  @{
+ */
+
+/** \brief Combine two box, make one that includes both.
+	\param bx1  The first box to do the union.
+	\param bx2  The second box to do the union.
+*/
+TL_DLL TeBox TeUnion(const TeBox& bx1, const TeBox& bx2);
+
+/** @} */
+
+/** @defgroup TeLocationFunctions Functions that finds the localization of objects.
+ *  @ingroup  GeometryAlgorithms
+ *  Functions that finds the localization of objects.
+ *  @{
+ */
+/** \brief Point in polygon inside/outside/boundary code.
+	\param c    The coordinate to test.
+	\param r The simple polygon to test.
+
+	\note Check if point is INSIDE of a given ring.
+	      The ring is treated as a simple polygon (no holes).
+	      Adapted from:
+		  Samosky, Joseph, "SectionView: A system for interactively specifying and
+		  visualizing sections through three-dimensional medical image data,
+		  M.S. Thesis, Department of Electrical Engineering and Computer Science,
+		  Massachusetts Institute of Technology, 1993.
+		 Obs: Doesn't do box elimination.
+*/
+TL_DLL bool TePointInPoly(const TeCoord2D& c, const TeLinearRing& r);
+
+/** \brief Check if coordinate c is on segment (segment is closed).
+	\param c   The coordinate to be tested.
+	\param c1  The first segment's coordinate.
+	\param c2  The second segment's coordinate.
+*/
+TL_DLL bool TeIsOnSegment(const TeCoord2D& c, const TeCoord2D& c1, const TeCoord2D& c2);
+
+/** \brief Check if coordinate c is on line boundary or on line interior (see explanation above for definition of boundary and interior of a line).
+	\param c   The coordinate to be tested.
+	\param l   The line used in the test.
+
+	Obs: Do box elimination.
+*/
+TL_DLL bool TeIsOnLine(const TeCoord2D& c, const TeLine2D& l);
+
+/** \brief Locate the nearest line segment of a coordinate.
+	\param pin		The coordinate.
+	\param line		The line.
+	\param segment  The position of the segment in the line  
+	\param tol		Tolerance.
+*/
+TL_DLL bool TeLocateLineSegment(TeCoord2D& pin, TeLine2D& line, int& segment, double tol = 0.0);
+/** @} */
+
+/** @defgroup TeConvexHull Functions to compute the Convex Hull
+ *  @ingroup  GeometryAlgorithms
+ *  Functions that returns the convex hull of a point list.
+ *  @{
+ */
+ /** \brief Returns the convexhull of a given list of coords in counterclockwise.
+	 \param coordSet A list with coordinates without duplicated coordinates.
+
+	\note This algorithm is based on the book Computational Geometry
+	      by M. de Berg, M. van Kreveld, M. Overmars and O. Schwarzkopf - Springer Verlag - pp. 6.
+	      It is O(N log N).
+*/
+template<class T>
+TePolygon TeConvexHull(const T& coordSet);
+
+//! This is a explicit specialization that returns the convex hull of a TePolygon
+template<>
+TL_DLL TePolygon TeConvexHull(const TePolygon& p);
+
+//! This is a explicit specialization that returns the convex hull of a TePolygonSet
+template<>
+TL_DLL TePolygon TeConvexHull(const TePolygonSet& ps);
+
+//! This is a explicit specialization that returns the convex hull of a TePointSet. Must be defined!
+template<>
+TL_DLL TePolygon TeConvexHull(const TePointSet& ps);
+
+/** @} */
+
+/** @defgroup TeUtils Utilities functions.
+ *  @ingroup  GeometryAlgorithms
+ *  @{
+ */
+//! Given a projection "proj" returns a tolerance value in the same unit of projection to be used in geometric operations
+TL_DLL double TeGetPrecision(TeProjection* proj);
+
+//! This class implements the Epsilon-tweaking used in calculus.
+class TL_DLL TeGeometryAlgorithmsPrecision
+{
+	protected:
+
+		//! Constructor
+		TeGeometryAlgorithmsPrecision();
+
+	public:		
+
+		//! Tells if d1 is greater than d2 according to tolerance factor.
+		static bool IsGreater(const double& d1, const double& d2)
+		{
+			return ((d1 - d2) > TePrecision::instance().precision());
+		}
+
+		//! Tells if d1 is greater than or equal to d2 according to tolerance factor.
+		static bool IsGreaterEqual(const double& d1, const double& d2)
+		{
+			return ((d1 - d2) >= (-TePrecision::instance().precision()));
+		}
+
+		//! Tells if d1 is smaller than d2 according to a tolerance factor.
+		static bool IsSmaller(const double& d1, const double& d2)
+		{
+			return ((d1 - d2) < -(TePrecision::instance().precision()));
+		}
+
+		//! Tells if d1 is smaller than or equals to d2 according to a tolerance factor.
+		static bool IsSmallerEqual(const double& d1, const double& d2)
+		{
+			return ((d1 - d2) <= TePrecision::instance().precision());
+		}
+
+		//! Tells if d1 is equals to d2 according to a tolerance factor.
+		static bool IsEqual(const double& d1, const double& d2)
+		{
+			return (fabs(d1 - d2) <= TePrecision::instance().precision());
+		}
+
+		//! Tells if d1 is different from d2 according to a tolerance factor.
+		static bool IsDifferent(const double& d1, const double& d2)
+		{
+			return (fabs(d1 - d2) > TePrecision::instance().precision());
+		}
+};
+
+//! Removes the duplicate coordinates of a line
+TL_DLL inline void TeRemoveDuplicatedCoordinates(TeLine2D& l)
+{
+	for(unsigned int i = 0; i < l.size() - 1; ++i)
+		if(TeEquals(l[i], l[i + 1]))
+		{
+			l.erase(i);
+			--i;
+		}
+
+	return;
+}
+
+//! Removes the duplicate coordinates of a polygon
+TL_DLL inline void TeRemoveDuplicatedCoordinates(TePolygon& p)
+{
+	for(unsigned int i = 0; i < p.size(); ++i)
+		TeRemoveDuplicatedCoordinates(p[i]);		
+
+	return;
+}
+
+/** \brief Reverses the orientation of a line.
+	\param lin  The line to be reversed.
+*/
+TL_DLL inline void TeReverseLine(TeLine2D& lin)
+{
+	for(unsigned int i=0,j=lin.size()-1 ; i<lin.size()/2 ; ++i,--j)
+	{
+		TeCoord2D p = lin[i];
+		lin[i] = lin[j];
+		lin[j] = p;
+	}
+
+	return;
+}
+
+
+/** \brief Verifies if a simple polygon defined as a linear ring is convex or not.
+	\param ring  The polygon to test convexity.
+*/
+TL_DLL bool TeIsConvex(const TeLinearRing& ring);
+
+/** \brief Returns the orientation of the ring (CLOCKWISE or COUNTERCLOCKWISE);
+	\param r The ring to be checked.
+*/
+TL_DLL short TeOrientation(const TeLinearRing& r);
+
+/** @} */
+
+/** @defgroup MetricOperators Metric operators
+ *  @ingroup  GeometryAlgorithms
+ *  Functions that do some usefull metric operations.
+ *  @{
+ */
+
+/** \brief Returns the middle point of a segment.
+	\param first   The first segment's coordinate.
+	\param last    The second segment's coordinate.
+	\param middle  The middle point.
+*/
+TL_DLL void TeGetMiddlePoint(const TeCoord2D& first, const TeCoord2D& last, TeCoord2D& middle);
+
+/** \brief Calculates the Euclidian distance between two points.
+	\param c1 First coordinate;
+	\param c2 Second coordinate;
+*/
+TL_DLL double TeDistance(const TeCoord2D& c1, const TeCoord2D& c2);
+
+/** \brief Returns the length of a Line 2D.
+	\param l  The line to calculate the length.	
+*/
+TL_DLL double TeLength(const TeLine2D& l);
+
+/** \brief Perpendicular distance from point to segment.
+	\param first  The first segment's coordinate.
+	\param last   The second segment's coordinate.
+	\param pin    The point to get the distance from the segment.
+	\param pinter The point of intersection on the segment.
+*/
+TL_DLL double TePerpendicularDistance(const TeCoord2D& first, const TeCoord2D& last, const TeCoord2D& pin, TeCoord2D &pinter);
+
+/** \brief Minimal distance from point to segment.
+	\param first	The first segment's coordinate.
+	\param last		The second segment's coordinate.
+	\param pin		The point to get the minimal distance from the segment. This point is inside the segment  
+	\param pout		The nearest segment point of the pin point.
+	\param tol		Numerical tolerance
+*/
+TL_DLL double TeMinimumDistance (const TeCoord2D& first, const TeCoord2D& last, const TeCoord2D& pin, TeCoord2D& pout, double tol = 0.0);
+
+/** \brief Template class to compute the area of a geometry
+	\param geom The geometry whose area we want to known.
+	\note This algorithm is based on the book Spatial Databases with Application to GIS
+	      by Philippe Rigaux, Michel O. Scholl and Agnes Voisard.
+
+*/
+
+template<class T>
+double TeGeometryArea(const T& /* geom */)
+{
+	return 0.0;
+}
+
+//! This is a explicit specialization that returns the area of a TePolygon
+template<>
+TL_DLL double TeGeometryArea(const TePolygon& p);
+
+//! This is a explicit specialization that returns the area of a TePolygonSet
+template<>
+TL_DLL double TeGeometryArea(const TePolygonSet& ps);
+
+//! This is a explicit specialization that returns the area of a Box
+template<>
+TL_DLL double TeGeometryArea(const TeBox& b);
+
+//! This is a explicit specialization that returns the area of a Box
+template<>
+TL_DLL double TeGeometryArea(const TeMultiGeometry& mGeom);
+/** @} */
+
+/** @defgroup GeometryFunction Functions that return geometries.
+ *  @ingroup  GeometryAlgorithms
+ *  Functions that return geometries.
+ *  @{
+ */
+/** \brief Given a box return its polygon representation.
+	\param b  The box to create a polygon.
+*/
+TL_DLL TePolygon TeMakePolygon(const TeBox& b);
+
+/** \brief Given N points, finds a path that doesn't self-intersects
+	\note Given N points, finds a path that doesn't self-intersects, visiting all points and returning 
+	      to the begginning one. It is based on the book Algorithms by Robert Sedgewick, Addisson-Wesley, 1988;
+	\param pSet The point set to form a path.
+*/
+TL_DLL TeLinearRing TeSimpleClosedPath(const TePointSet& pSet);
+/** @} */
+
+
+/** @defgroup TeFindCentroid Functions to compute the centroid
+ *  @ingroup  GeometryAlgorithms
+ *  Functions that return the centroid.
+ *  @{
+ */
+
+/** \brief Calculates the centroid of a multi geometry.
+	\param p A multi geometry whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(TeMultiGeometry& mGeom);
+
+/** \brief Calculates the centroid of a polygon.
+	\param p A TePolygon whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(const TePolygon& p);
+
+/** \brief Calculates a reference point.
+	\param l A TeLine whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(const TeLine2D& l);  
+
+/*! \fn TeCoord2D TeFindCentroid(const TeCell& c );
+    \brief Calculates the centroid of a cell.
+	\param c A TeCell whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(const TeCell& c);
+
+/** \brief Calculates the centroid of a point.
+	\param p A TePoint whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(const TePoint& p);
+
+/** \brief Calculates the centroid of a text.
+	\param t A TeText whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(const TeText& t);
+
+/** \brief Calculates the centroid of a polygon set.
+	\param s A TePolygon set whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(const TePolygonSet& s); 
+
+/** Calculates the centroid of a line set.
+	\param s A TeLine set whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(const TeLineSet& s); 
+
+/** \brief Calculates the centroid of a cell set.
+	\param s A TeCell set whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(const TeCellSet& s);
+
+/** \brief Calculates the centroid of a point set.
+	\param ps A TePointSet set whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(TePointSet& ps);
+
+/** \brief Calculates the centroid of a text set.
+	\param ts A TeTextSet set whose centroid we want to known.
+*/
+TL_DLL TeCoord2D TeFindCentroid(TeTextSet& ts);
+
+/** \brief Calculates the center of a triangle.
+	\param vert0 First triagle's vertex.
+	\param vert1 Second triagle's vertex.
+	\param vert2 Third triagle's vertex.
+	\param pc    The triangle center.
+*/
+TL_DLL bool TeFindTriangleCenter(const TeCoord2D& vert0, const TeCoord2D& vert1, const TeCoord2D& vert2, TeCoord2D& pc); 
+/** \brief Calculates intersection between two segments.
+	\param fr0 First point of first segment.
+	\param to0 Second point of first segment.
+	\param fr1 First point of second segment.
+	\param to1 Second point of second segment.
+	\param pi    The intersection point coordinates.
+	\return true is intersects, false otherwise.
+*/
+
+TL_DLL bool TeSegmentsIntersectPoint(const TeCoord2D& fr0, const TeCoord2D& to0, const TeCoord2D& fr1, const TeCoord2D& t1, TeCoord2D& pi); 
+
+/** @} */
+
+
+/** @defgroup TeNearest Functions to compute the nearest part of an object to a point.
+  *  @ingroup  GeometryAlgorithms
+  *  Auxiliary functions.
+  *  @{
+  */
+//! Nearest node in set from location pt (i = the node index in the nodeset)
+TL_DLL bool TeNearest(TeCoord2D& pt, TeNodeSet& ns , int& i, const double& tol = 0.0);
+
+//! Nearest point in set from location pt (i = the point index in the pointset)
+TL_DLL bool TeNearest(TeCoord2D& pt, TePointSet& ps , int& i, const double& tol = 0.0);
+
+//! Nearest text in set from location pt (i = the text index in the textset)
+TL_DLL bool TeNearest(TeCoord2D& pt, TeTextSet& ts , int& i, const double& tol = 0.0);
+
+//! Nearest line in set from location pt (i = the line index in the lineset and pi = the closest point)
+//! The pi point can be outside a line of the line set
+TL_DLL bool TeNearest(TeCoord2D& pt, TeLineSet& ls , int& i, TeCoord2D& pi, const double& tol = 0.0);
+
+//! Nearest line in set from location pt (i = the line index in the lineset and pout = the closest point)
+//! The pout point must be inside a line of the line set
+TL_DLL bool TeNearest (TeCoord2D& pt,TeLineSet& ls, int& lindex, TeCoord2D& pout, double& dmin, const double& tol = 0.0); 
+
+//! Nearest polygon in set from location pt (i = the polygon index in the polygonset).
+TL_DLL bool TeNearest(TeCoord2D& pt, TePolygonSet& ps , int& i, const double& tol = 0.0);
+
+//! Nearest line in set from location pt (i = the line index in lineset) calculated by the vertex of the lines
+TL_DLL bool TeNearestByPoints(TeCoord2D& pt, TeLineSet& ls , int& i, double& dist, const double& tol = 0.0);
+/** @} */
+
+/** @defgroup CurveFunctions Functions used to deal with smooth curves
+  *  @ingroup  GeometryAlgorithms
+  *  @{
+  */
+/** \brief Given three points of a circunference, returns its center point.
+	\param p1      First point.
+	\param p2      Second point.
+	\param p3      Third point.
+	\param center  Circunference center.
+	This algorithm is adapted from http://www.delphiforfun.org/Programs/Math_Topics/circle_from_3_points.htmbook.
+*/
+TL_DLL bool TeGetCenter(TePoint p1, TePoint p2, TePoint p3, TePoint &center);
+
+/** \brief Given three points of a circunference, returns the radius.
+	\param p1      First point.
+	\param p2      Second point.
+	\param p3      Third point.
+	This algorithm is adapted from http://www.delphiforfun.org/Programs/Math_Topics/circle_from_3_points.htmbook.
+*/
+TL_DLL double TeGetRadius(TePoint &p1, TePoint &p2, TePoint &p3);
+
+/** \brief Given three points returns a smooth arc as a TeLine2D that contains a given total number of points.
+
+	\param p1      First point.
+	\param p2      Second point.
+	\param p3      Third point.
+	\param arcOut  The return arc.
+	\param NPoints Number of arc points.	
+	
+	This algorithm is adapted from http://mathforum.org/dr.math/
+  
+*/
+TL_DLL bool TeGenerateArc(TePoint& p1, TePoint& p2, TePoint& p3, TeLine2D& arcOut, const short& NPoints);
+
+/** \brief Given a center point and a radius, returns the circle  as a TeLine2D interpolated by a given number of points
+	\param center  Center point of the circle.
+	\param radius  radius of the circle.
+	\param circle  The return circle
+	\param NPoints Number of circle points.	
+*/
+TL_DLL bool TeGenerateCircle(const TePoint& center, const double& radius, TeLine2D& circle, const short& NPoints);
+
+/** \brief Performs a line simplication
+	\param line		The line to be simplified
+	\param snap		Simplification threshold
+	\param maxdist	The maximum distance between intermediary segments
+*/
+TL_DLL bool TeLineSimplify(TeLine2D& line, double snap, double maxdist);
+
+/** \brief Adjust Segment to specific distance
+	\param	P0		first coordinate
+	\param	P1		second coordinate
+	\param	d0		distance value to adjust
+	\param	P0out	first coordinate adjusted
+	\param	P1out	second coordinate adjusted
+	\return	returns true whether possible adjust segment
+*/
+TL_DLL bool TeAdjustSegment(TeCoord2D P0, TeCoord2D P1, double d0, TeCoord2D &P0out, TeCoord2D &P1out);
+
+/** \brief Get middle line
+	Method like find Centroid but this method calculate the correct middle point
+	\param		line		The Line to calculate the middle point
+	\param		p			middle point
+	\return		returns true case possible calculate the middle line
+*/
+TL_DLL bool TeFindCentroid(const TeLine2D &line, TeCoord2D &p);
+
+/** @} */
+
+/** @} */ // end of group  GeometryAlgorithms
+
+
+#endif	// __TERRALIB_INTERNAL_GEOMETRYALGORITHMS_H
diff --git a/src/terralib/kernel/TeGraph.cpp b/src/terralib/kernel/TeGraph.cpp
old mode 100755
new mode 100644
index 4f478b0..8f429de
--- a/src/terralib/kernel/TeGraph.cpp
+++ b/src/terralib/kernel/TeGraph.cpp
@@ -1,1557 +1,1557 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include <TeGraph.h>
-#include <TeDefines.h>
-#include <math.h>
-#include <float.h>
-#include <malloc.h>
-#include <stdio.h>
-#include <errno.h>
-
-int set_font(int font_number);
-
-#define PEN_UP       0     /* pen status up */
-#define PEN_DOWN     1     /* pen status down */
-
-#define ERR        -1     /* return value when error occurs */
-
-#define HORIZ_FONT 0
-#define VERT_FONT  1
-#define FONT_MAX   2
-
-/*** symbol shapes ***/
-
-#define RECTANGLE    0     /* tells PlotSymbol to draw a rectangle */
-#define TRIANGLE     1     /* tells PlotSymbol to draw a triangle */
-#define DIAMOND      2     /* tells PlotSymbol to draw a diamond */
-#define SCROSS       3     /* tells PlotSymbol to draw an upright cross */
-#define XCROSS       4     /* tells PlotSymbol to draw an angled cross */
-
-/*** constants ***/
-
-#define CURVES_LIMIT   10     /* maximum number of curves */
-#define MAIN_ROW       3     /* row number for main menu */
-#define MAIN_COL       2     /* column number for main menu */
-#define MAX_ITEMS     13     /* maximum number of items in a menu window */
-#define MASK_SIZE     50     /* length of file mask string */
-#define ASCII          0     /* Ascii output format */
-#define BINARY         1     /* Binary output format */
-#define LOAD           0     /* load options */
-#define SAVE           1     /* save options */
-#define SET            2     /* set options */
-#define DIGITS         6     /* number of digits to display for regression
-                               coefficients and mean square error */
-int  Font_width[FONT_MAX]  = {9,9};
-int  Font_height[FONT_MAX] = {15,15};
-int  Font_direct[FONT_MAX] = {HORIZ_FONT,VERT_FONT};
-
-
-char Symbol[CURVES_MAX] = {        /* symbols identifying each curve */
-		RECTANGLE,  /* symbol for curve 1 is a rectangle */
-		SCROSS,     /* symbol for curve 4 is an upright cross */
-		TRIANGLE,   /* symbol for curve 2 is a triangle */
-		DIAMOND,    /* symbol for curve 3 is a diamond */
-		XCROSS,      /* symbol for curve 5 is an angled cross */
-		RECTANGLE,  /* symbol for curve 6 is a rectangle */
-		SCROSS,     /* symbol for curve 9 is an upright cross */
-		TRIANGLE,   /* symbol for curve 7 is a triangle */
-		DIAMOND,    /* symbol for curve 8 is a diamond */
-		XCROSS      /* symbol for curve 10 is an angled cross */
-};
-
-unsigned Terms[] =
-{                                  /* terms in each regression function */
-        0,                         /* terms for polynomial set by regres_func */
-        2,                         /* number of exponential terms */
-        2,                         /* number of logarithmic terms */
-        3                          /* number of sinusoidal terms */
-};
-
-
-struct Opt{                        /* Options default settings */
-	char symbols[5];
-	char x_major[3];
-	char x_minor[3];
-	char y_major[3];
-	char y_minor[3];
-	char y_scale[2];
-	char filemask[MASK_SIZE];
-	char format[7];
-	char digits[3];
-	char linesize[4];
-	char adapter[5];
-	char printer[9];
-	char printer_port[5];
-	char print_file[13];
-	char color[4];
-	char snow[4];
-	char sound[4];
-	char grid[4];
-	char legend[4];
-} Options ;       /* curve legend turned on                        */
-
-struct Txtc{
-	unsigned char background;   /* color of outermost window */
- 	unsigned char pattern;      /* color of pattern in outermost window */
-	unsigned char input;        /* color of input window */
-	unsigned char input_prompt; /* color of input window prompt */
-	unsigned char input_answer; /* color of input window answer */	
-	unsigned char edit;         /* color of edit window */
-	unsigned char edit_bar;     /* color of selection bar in edit window */
-	unsigned char edit_answer;  /* color of answer bar in edit window */
-	unsigned char edit_index;   /* color of index values in edit window */
-	unsigned char edit_heading; /* color of X/Y values heading in edit window */
-	unsigned char error;        /* color of error window */
-	unsigned char help;         /* color of help message text */
-} Text_color;
-
-struct Grc{
-    TeColor grid;                /* color of plot grid         */
-    TeColor text;                /* color of plot text         */
-    TeColor lines;               /* color of plot all lines    */
-	TeColor symbol[CURVES_LIMIT];/* color of plot all lines    */
-    TeColor curve[CURVES_LIMIT]; /* color of plot curves       */
-} Graph_color;
-
-int f_spoly(Real x, Real_Vector terms, unsigned n);
-int f_sexp(Real x, Real_Vector terms, unsigned n);
-int f_slog(Real x, Real_Vector terms, unsigned n);
-int f_ssin(Real x, Real_Vector terms, unsigned n);
-
-int (*Function[])(Real, Real_Vector, unsigned) =
-{                                  /* array of functions used for regression  */
-        f_spoly,                     /* calculate terms of polynomial equation  */
-        f_sexp,                      /* calculate terms of exponential equation */
-        f_slog,                      /* calculate terms of logarithmic equation */
-        f_ssin                       /* calculate terms of sinusoidal equation  */
-};
-
-Real vmaxval(Real_Vector v, unsigned int n, int *imx)
-{
- 	// subroutine determines the maximum  value (maxx) of the
-  	// vector v[] of length n and returns the index (imx) where
-  	// the maximum occurs; i.e. imx, where maxx = v[imx].
- 	// On exit, the maximum is returned as the value of vmaxval().
-
-	unsigned int i;
-	Real maxx;
- 
-	if (v == NULL)
-		return (Real) 0.0;
-
- 	//find max value
-
-	*imx=0;
-	maxx=v[0];
-	for(i=1; i<n ; i++)
-	{
-		if(v[i] > maxx)
-		{
-			maxx=v[i];
-			*imx=i;
-		}
-	}
-	return maxx;
-}
-
-//---------------------------------------------------------------------------------
-Real
-vminval(Real_Vector v, unsigned int n, int *imn)
-{
-// subroutine determines the minimum  value (minx) of the
-// vector v[] of length n and returns the index (imn) where
-// the minimum occurs; i.e. imn, where minx = v[imn].
-// On exit, the minimum is returned as the value of vminval().
-
-	unsigned int i;
-	Real minx;
- 
-	if (v == NULL)
-		return (Real) 0.0;
-
-	//find min value
-	*imn=0;
-	minx=v[0];
-	for(i=1; i<n ; i++)
-	{
-		if(v[i] < minx)
-		{
-			minx=v[i];
-			*imn=i;
-		}
-	}
-	return minx;
-}
-
-//---------------------------------------------------------------------------------
-
-TeGraphPlot :: TeGraphPlot ()
-{
-	GPpointwidth = 7;
-	GPpointheight = 7;
-
-	label_field = 11;
-	major_tick = 5;
-	minor_tick = 2;
-	x_major = 8;
-	y_major = 10;
-	x_minor = 8;
-	y_minor = 5;
-	Scale_curve = -1;
-	Plot_curves = 0;
-	Plot_symbols = 0;
-	Curve_choice = 0;
-	Plot_choice = 0;
-	int i;
-	for( i = 0; i < CURVES_MAX; i++ )
-	{
-		Plot_points[i] = 0;
-		Plot_x[i] = 0;
-		Plot_y[i] = 0;
-	}
-
-	Graph_color.grid.init(0,100,100);
-	Graph_color.text.init(0,0,0);
-	Graph_color.lines.init(30,30,30);// preto
-
-	for( i = 0; i < CURVES_LIMIT; i++ )
-	{
-		Graph_color.symbol[i].init(0,255,0);
-		Graph_color.curve[i].init(0,0,0);
-	}
-
-	sliceVector = 0;
-}
-
-//---------------------------------------------------------------------------------
-
-TeGraphPlot :: ~TeGraphPlot ()
-{
-}
-
-//---------------------------------------------------------------------------------
-void
-TeGraphPlot :: setColorGrid(int r, int g, int b)
-{
-	Graph_color.grid.init(r,g,b);
-}
-
-//---------------------------------------------------------------------------------
-void	
-TeGraphPlot :: setColorText(int r, int g, int b)
-{
-	Graph_color.text.init(r,g,b);
-}
-
-//---------------------------------------------------------------------------------
-void	
-TeGraphPlot :: setColorSymbol(int r, int g, int b, int curve, int w, int h)
-{
-	if (curve==-1)
-		for (int i=0; i<CURVES_LIMIT; i++)
-			Graph_color.symbol[i].init(r,g,b);
-	else
-		Graph_color.symbol[curve].init(r,g,b);
-
-	GPpointwidth = w;
-	GPpointheight = h;
-}
-
-//---------------------------------------------------------------------------------
-void
-TeGraphPlot :: setColorLine(int r, int g, int b)
-{
-	Graph_color.lines.init(r,g,b);
-}
-
-//---------------------------------------------------------------------------------
-int
-TeGraphPlot :: setColorCurve(int c,int r, int g, int b)
-{
-	if( c < 0 || c > CURVES_LIMIT-1 )
-	{
-		return false;
-	}
-
- 	Graph_color.curve[c].init(r,g,b);
-
-	return true;
-}
-
-void
-TeGraphPlot :: pieLegends ()
-{
-	if (sliceVector == 0)
-		return;
-	int	w;
-	int	xt, yt, pw, ph;
-	
-	TeColor	cor;
-
-	cor.init (0, 0, 0);
-    setTextColor(cor);
-
-	w = min(width,height);
-	pw = 2*label_height;
-	ph = label_height;
-
-	xt = xupleft + w + pw;
-	yt = yupleft;
-	int textext = 0;
-	for (unsigned int i = 0; i < sliceVector->size (); i++)
-	{
-		TeLegendEntry slice = (*sliceVector)[i];
-		TeVisual  vis;
-		//vis = slice.visual (TePOLYGONS);
-		TeColor cor = vis.color();
-		
-		setFillAreaColor (cor);
-		string leg = slice.label ();
-		int xw,xh;
-		textExtent (leg, xw, xh);
-		textext = max (textext, xw);
-		fillRectangle (xt, yt-ph, pw, ph);
-		drawText ((int)(xt+1.2*pw), yt-2, (char*)leg.c_str ());
-		yt += (int)1.5*ph;
-		if (yt > (yupleft + height))
-		{
-			xt += (int)(textext+2.2*pw);
-			textext = 0;
-			yt = yupleft;
-		}
-	}
-}
-
-
-//---------------------------------------------------------------------------------
-int
-TeGraphPlot :: setGridSize(int s)
-{
-	if( s <= 0 )
-	{
-		return false;
-	}
-	x_major = s;
-	y_major = s;
-	x_minor = s;
-	y_minor = s;
-
-	return true;
-}
-
-//---------------------------------------------------------------------------------
-int
-TeGraphPlot :: setGridSize(int xma, int yma, int xmi, int ymi )
-{
-	if( xma <= 0 || yma <= 0 || xmi <= 0 || ymi <= 0 )
-	{
-		return false;
-	}
-
-	x_major = xma;
-	y_major = yma;
-	x_minor = xmi;
-	y_minor = ymi;
-
-	return true;
-}
-
-//---------------------------------------------------------------------------------
-int
-TeGraphPlot :: loadDirect (int format, int curv, int points, Labels& labels, Real_Vector x, Real_Vector y)
-{
-	if( curv < 0 || curv > CURVES_LIMIT-1 )
-	{
-		return false;
-	}
-
-	strcpy(Plot_label.title, labels.title);
-	strcpy(Plot_label.xaxis, labels.xaxis);
-	strcpy(Plot_label.yaxis, labels.yaxis);
-	Input_format[curv] = format;
-
-        strcpy(Plot_label.curve[curv], labels.curve[curv]);
-
-	Plot_x[curv] = x;
-	Plot_y[curv] = y;
-	Plot_points[curv] = points;
-
-	if (Plot_curves < (curv+1) )
-	{
-		Plot_curves= curv+1;
-	}
-
-	return true;
-}
-
-void TeGraphPlot::loadHistogram (TeLegendEntryVector& sv, const string& label)
-{
-// Manage number of curves, only one histogram is allowed per plotting
-	Plot_curves = 1;
-	int order = 0;
-	Input_format[order] = BAR_BINARY;
-	sliceVector = &sv;
-// Allocate space for data arrays
-	unsigned int size = sv.size ();
-	if (Plot_x[order])
-		delete [] Plot_x[order];
-	if (Plot_y[order])
-		delete [] Plot_y[order];
-	Plot_x[order] = new double [size];
-	Plot_y[order] = new double [size];
-	Plot_points[order] = size;
-
-// Transfer data from TeLegendEntrys to double array
-	int vmax = 0;
-	for (unsigned int i=0;i<size;i++)
-	{
-		TeLegendEntry sl = sv[i];
-		Plot_y[order][i] = sl.count();
-		Plot_x[order][i] = (double)i+1;
-		vmax = max (vmax,sl.count() );
-	}
-
-// Fill in labels
-	strcpy(Plot_label.title, label.c_str ());
-	strcpy(Plot_label.xaxis, "Fatia");
-	strcpy(Plot_label.yaxis, "Objetos");
-	strcpy(Plot_label.curve[order],"");
-	setScale(1., Real(size+1) , 0., Real (vmax));
-	setGridSize(size, 8, 1, 1); 
-}
-
-void TeGraphPlot::loadPie (TeLegendEntryVector& sv, const string& label)
-{
-// Manage number of curves, only one pie is allowed per plotting
-	Plot_curves = 1;
-	int order = 0;
-	Input_format[order] = PIE_BINARY;
-	height = Y_pixels - yupleft;
-	sliceVector = &sv;
-// Allocate space for data arrays
-	unsigned int size = sv.size ();
-	if (Plot_x[order])
-		delete [] Plot_x[order];
-	if (Plot_y[order])
-		delete [] Plot_y[order];
-	Plot_x[order] = new double [size];
-	Plot_y[order] = new double [size];
-	Plot_points[order] = size;
-
-// Transfer data from TeLegendEntrys to double array
-	int vmax = 0;
-	for (unsigned int i=0;i<size;i++)
-	{
-		TeLegendEntry sl = sv[i];
-		Plot_y[order][i] = sl.count();
-		Plot_x[order][i] = (double)i+1;
-		vmax = max (vmax,sl.count() );
-	}
-
-// Fill in labels
-	strcpy(Plot_label.title, label.c_str ());
-//	strcpy(Label.curve[order],label.c_str ());
-}
-
-//---------------------------------------------------------------------------------
-void
-TeGraphPlot :: autoScale(void)
-{
-// scale axes for Scale_curve (for all curves if Scale_curve == -1) 
-
-	int i, index;
-	Real value;
-
-	if (Scale_curve == -1)
-		index = 0;
-	else
-		index = Scale_curve;
-
-	xminval = vminval(Plot_x[index], Plot_points[index], &i);
-	xmaxval = vmaxval(Plot_x[index], Plot_points[index], &i);
-	yminval = vminval(Plot_y[index], Plot_points[index], &i);
-	ymaxval = vmaxval(Plot_y[index], Plot_points[index], &i);
-
-	if (Scale_curve == -1)
-	{
-		for (i = 1; i < Plot_curves; i++)
-		{
-			value = vminval(Plot_x[i], Plot_points[i], &index);
-			if (value < xminval) xminval = value;
-			value = vmaxval(Plot_x[i], Plot_points[i], &index);
-			if (value > xmaxval) xmaxval = value;
-			value = vminval(Plot_y[i], Plot_points[i], &index);
-			if (value < yminval) yminval = value;
-			value = vmaxval(Plot_y[i], Plot_points[i], &index);
-			if (value > ymaxval) ymaxval = value;
-		}
-	}
-
-	for (int curva=0; curva < Plot_curves; curva++)
-	{
-		if (Input_format[curva] == ROSE_BINARY)
-		{
-			yminval = - ymaxval;
-			xmaxval = ymaxval;
-			xminval = yminval;
-		}
-	}
-}
-
-//---------------------------------------------------------------------------------
-void
-TeGraphPlot :: setScale(Real x1, Real x2 , Real y1, Real y2)
-{
-   	xminval = x1;
-    	xmaxval = x2;
-    	yminval = y1;
-    	ymaxval = y2;
-
-	for (int curva=0; curva < Plot_curves; curva++)
-	{
-		if (Input_format[curva] == ROSE_BINARY)
-		{
-			yminval = - ymaxval;
-			xmaxval = ymaxval;
-			xminval = yminval;
-		}
-	}
-}
-
-int f_spoly(Real x, Real_Vector terms, unsigned n)
-{
-    	unsigned i;
-    	terms[0] = 1.0;
-    	for (i = 1; i < n; i++) terms[i] = x * terms[i-1];
-   	return 0;
-}
-
-int f_sexp(Real x, Real_Vector terms, unsigned n)
-{
-    double value;
-   	value = exp(x);
-    if (value != HUGE_VAL)
-	{
-        terms[0] = 1.0;
-        terms[n-1] = (Real) value;
-        return 0;
-    }
-	else
-	{
-       show_err("Value of exp(x) is too large");
-       return -1;
-    }
-}
-
-int f_slog(Real x, Real_Vector terms, unsigned n)
-{
-    	if (x > 0.0) {
-        	terms[0] = 1.0;
-        	terms[n-1] = (Real) log(x);
-        	return 0;
-    	}
-    	else {
-        	show_err("Value of x is less than or equal to 0");
-        	return -1;
-    	}
-}
-
-int f_ssin(Real x, Real_Vector terms, unsigned n)
-{
-   	errno = 0;
-	terms[0] = 1.0;
-    terms[1] = (Real) sin(x);
-    terms[n-1] = (Real) cos(x);
-    if (errno == 0)
-		return 0;
-    else
-	{
-        show_err("Loss of significance for cos(x) or sin(x)");
-       	return -1;
-    }
-}
-
-void show_err (char* /* mess */)
-{
-//	printf("%s\n",mess);
-}
-
-//---------------------------------------------------------------------------------
-
-int
-TeGraphPlot :: kill(int order)
-{
-	int i, count = 0;
-	if (Plot_curves == 0)
-		return 0;
-	for (i = 0; i < Plot_curves; i++)
-	{
-		if (Plot_x[i] == Plot_x[order]) count++;
-	}
-
-	if (count == 1)
-	{
-		delete [] Plot_x[order];
-		Plot_x[order] = 0;
-		delete [] Plot_y[order];
-		Plot_y[order] = 0;
-	}
-
-	for (i = order; i < Plot_curves-1; i++)
-	{
-		Plot_x[i] = Plot_x[i+1];
-		Plot_y[i] = Plot_y[i+1];
-		Plot_points[i] = Plot_points[i+1];
-		strcpy(Plot_label.curve[i], Plot_label.curve[i+1]);
-	}
-   	Plot_curves--;
-	return 1;
-}
-
-
-//---------------------------------------------------------------------------------
-void
-TeGraphPlot :: plotCurves ( int with_simbols)
-{
-	short	drawplot = true;
-	Plot_symbols = with_simbols; // numero de pontos
-				     // que devem ser plotados
-				     // sobre a curva
-	for (int curva=0; curva < Plot_curves; curva++)
-	{
-		if (Plot_y[curva] == NULL)
-			continue;
-
-		if (Input_format[curva] == PIE_BINARY && sliceVector)
-		{
-			plot_title(Plot_label.title);
-
-			int		i, w, h, xc, yc, points;
-			
-			w = min(width,height);
-			h = min(width,height);
-			xc = xupleft ;
-			yc = yupleft ;
-			points =  Plot_points[0];
-
-			Real_Vector y = Plot_y[0];
-
-			Real	count = 0., value;
-
-			for (i = 0; i < points; i++) count += y[i];
-			if (count == 0.) break;
-
-			double	a1 = 0.,
-					a2 = 0.;
-
-			for (i = 0; i < points; i++)
-			{
-				TeLegendEntry slice = (*sliceVector)[i];
-				TeColor cor = slice.visual(TePOLYGONS)->color ();
-				value = y[i]/count;
-				a2 += value*360.;
-				setFillAreaColor(cor);
-				fillArc (xc, yc, w, h, a1, a2, cor);
-				if (value > .08)
-				{
-					char percent[16];
-					sprintf (percent,"     %.1f",value*100);
-					drawText (xc+w/2, yc+h/2, percent, (a1+a2)/2);
-				}
-				a1 = a2;
-			}
-			pieLegends ();
-		}
-		else if (Input_format[curva] == BAR_BINARY)
-		{
-		//-------------------------------------
-		//           ^
-		//	     |	    .....
-		//	     |	    :   :....
-		//	     |	    :   :   :
-		//	     |	....:   :   :    
-		//	     |  :   :   :   :
-		//           |__:_|_:_|_:_|_:____
-		//                1   2   3 
-		//------------------------------------- 
-			int		x1, y1, x2, y2;
-			int i;
-
-//			Real_Vector	x = Plot_x[0],
-//					y = Plot_y[0];
-			Real_Vector	x = Plot_x[curva],
-					y = Plot_y[curva];
- 
-//   			setLineAttributes(Graph_color.curve[0],0,0);
-//			setFillAreaColor(Graph_color.curve[0]);
-   			setLineAttributes(Graph_color.curve[curva],TeLnTypeContinuous,0);
-			setFillAreaColor(Graph_color.curve[curva]);
-
-			for (i = 0; i < Plot_points[curva]; i++)
-			{
-				// Juan begin
-				if(sliceVector)
-				{
-					TeLegendEntry slice = (*sliceVector)[i];
-					TeColor cor = slice.visual(TePOLYGONS)->color ();
-					setFillAreaColor (cor);
-				}
-				// Juan end
-//				if (i < Plot_points[0]-1)
-				if (i < Plot_points[curva]-1)
-				{
-	        			value_to_pixel(x[i], y[i], &x1, &y1);
-	        			value_to_pixel(x[i+1], y[i+1], &x2, &y2);
-					if ((height + yupleft - y1 - 1) > 0)
-	        				fillRectangle(x1-(x2-x1)/2, y1, (x2-x1-2), height + yupleft - y1);
-				}
-				else
-				{
-	        			value_to_pixel(x[i-1], y[i-1], &x1, &y1);
-	        			value_to_pixel(x[i], y[i], &x2, &y2);
-					if ((height + yupleft - y2 - 1) > 0)
-	        				fillRectangle(x2-(x2-x1)/2, y2, (x2-x1-2), height + yupleft - y2);
-				}
-			}
-			draw_plot();
-		}
-		else if (Input_format[curva] == ROSE_BINARY)
-		{
-			int i;
-  			int x1, y1, x2, y2;
-			int	a1 = 0,
-				a2 = 0;
-			Real_Vector	x = Plot_x[0],
-					y = Plot_y[0];
-
-			plot_title(Plot_label.title);
-
-			for (i = 0; i < Plot_points[0]-1; i++)
-			{
-				if (y[i]==0.)continue;
-				a1 = (int)(x[i] * 64.);
-				a2 = (int)(x[i+1] * 64.) - a1;
-        		value_to_pixel(-y[i], y[i], &x1, &y1);
-        		value_to_pixel(y[i], -y[i], &x2, &y2);
-				fillArc (x1, y1, x2-x1, y2-y1, a1, a2, Graph_color.curve[0]);
-			}
-
-			Real step = ymaxval / (Real)major_tick;
-
-			for(Real j = step ; j <= ymaxval; j += step )
-			{ 
-        			value_to_pixel(-j, j, &x1, &y1);
-        			value_to_pixel(j, -j, &x2, &y2);
-
-   				setLineAttributes(Graph_color.lines,TeLnTypeContinuous,0);
-				drawArc(x1, y1, x2-x1, y2-y1,0,360*64,Graph_color.lines);
-			}
-		}
-		else if (Input_format[curva] == POINT_BINARY)
-		{
-			draw_plot();
-		
-        		for (int j = 0; j < Plot_points[curva]; j ++)
-				plotSymbol(Plot_x[curva][j], Plot_y[curva][j], Symbol[curva], GPpointwidth, GPpointheight, curva);
-
-		}
-		else
-		{
-			if (drawplot)
-			{
-				draw_plot();
-				drawplot = false;
-			}
-
-			plot_curve(Plot_x[curva], Plot_y[curva], Plot_points[curva],Graph_color.curve[curva]);
-		
-			if (Plot_symbols)
-				draw_symbols(curva);
-		}
-	}
-}
-
-//---------------------------------------------------------------------------------
-void
-TeGraphPlot :: draw_plot(void)
-{
-
-	plot_axes();
-	plot_ticks();
-//	if (Options.grid[1] == 'n')
-	plot_grid();
-	plot_labels();
-	plot_title(Plot_label.title);
-	plot_xaxis(Plot_label.xaxis);
-	plot_yaxis(Plot_label.yaxis);
-//	if (Options.legend[1] == 'n') 
-	drawLegend();
-}
-
-//---------------------------------------------------------------------------------
-void
-TeGraphPlot :: setSymbolType(int type, int curve)
-{
-	if(curve>=0 && curve<=9)
-		Symbol[curve] = type;
-}
-
-//---------------------------------------------------------------------------------
-void
-TeGraphPlot :: draw_symbols(int curve)
-{
-	int i, step;
-
-	if (Plot_symbols > 0)
-	{
-		step = Plot_points[curve]/Plot_symbols;
-		if (Plot_points[curve] % Plot_symbols != 0) step++;
-		for (i = 0; i < Plot_points[curve]; i += step)
-			plotSymbol(Plot_x[curve][i], Plot_y[curve][i], Symbol[curve], GPpointwidth, GPpointheight, curve);
-	}
-}
-
-//---------------------------------------------------------------------------------
-void
-TeGraphPlot :: plot_axes(void)
-{
-    setLineAttributes(Graph_color.lines,TeLnTypeContinuous,0);
-    drawRectangle(xupleft, yupleft, width, height);
-}
-
-//---------------------------------------------------------------------------------
-void
-TeGraphPlot :: plot_ticks(void)
-{
-    int i, x, y, maximum, delta, length;
-    int x_ticks = x_major * x_minor;
-    int y_ticks = y_major * y_minor;
-
-    setLineAttributes(Graph_color.lines,TeLnTypeContinuous,0);
-	delta = (width-1)/x_ticks;
-	x = xupleft + delta;
-	y = yupleft + 1;
-	maximum = yupleft + height ;
-	for (i = 1; i < x_ticks; i++)
-	{
-		if (i % x_minor == 0)
-			length = major_tick;
-		else
-			length = minor_tick;
-		drawLine(x, y, x, y + length );
-		drawLine(x, maximum, x, maximum - length );
-		x += delta;
-	}
-	delta = (height-1)/y_ticks;
-	x = xupleft + 1;
-	y = yupleft + delta;
-	maximum = xupleft + width -1;
-	for (i = 1; i < y_ticks; i++)
-	{
-		if (i % y_minor == 0)
-			length = major_tick;
-		else
-			length = minor_tick;
-		drawLine(x, y, x + length , y);
-		drawLine(maximum, y, maximum - length , y);
-		y += delta;
-	}
-}
-
-void TeGraphPlot :: plot_grid(void)
-{
-    	int i, x, y, maximum, delta;
-    	setLineAttributes(Graph_color.grid,TeLnTypeDotted,0);
-    	delta = (width-1)/x_major;
-    	x = xupleft + delta;
-    	maximum = yupleft + height - major_tick - 1;
-    	for (i = 1; i < x_major; i++)
-		{
-        	y = yupleft + 1 + major_tick;
- //       	while (y < maximum) {
- //           		drawPoint (x,y);
- //           		y += 3;
- //       	}
-			drawLine(x,y,x,maximum);
-        	x += delta;
-    	}
-    	delta = (height-1)/y_major;
-    	y = yupleft + delta;
-    	maximum = xupleft + width - major_tick - 1;
-    	for (i = 1; i < y_major; i++)
-		{
-        	x = xupleft + 1 + major_tick;
- //       	while (x < maximum) {
- //           		drawPoint (x,y);
- //           		x += 4;
- //         }
-			drawLine(x,y,maximum,y);
-        	y += delta;
-    	}
-}
-
-int TeGraphPlot :: plot_labels(void)
-{
-    char text[80];
-    int i, x, y, delta, font;
-    int digits_left, digits_right, exp_flag;
-    Real value, values[3];
-	setTextColor(Graph_color.text);
-
-	if ((font = set_font(label_font)) == ERR) return ERR;
-	values[0] = yminval;
-	values[1] = ymaxval;
-	values[2] = (values[1] - values[0]) / y_major;
-	label_format(values, 3, label_field, &digits_left, &digits_right, &exp_flag);
-	delta = (height-1) / y_major;
-	y = yupleft - label_height/2;
-	value = ymaxval;
-	Yaxis_x = xupleft;
-	for (i = 0; i <= y_major; i++)
-	{
-		ftos(value, digits_left, digits_right, exp_flag, text);
-		x = xupleft - strlen(text) * label_width - label_width/2;
-		if (x < Yaxis_x)
-			Yaxis_x = x;
-		drawText (x, y+8, text);
-		y += delta;
-		value -= values[2];
-	}
-	if (yaxis_direct == HORIZ_FONT)
-	{
-		Yaxis_x -= (yaxis_width + label_width/2);
-		if (Yaxis_x < 0)
-			Yaxis_x = 0;
-	}
-	else
-	{
-		Yaxis_x -= label_width/2;
-		if (Yaxis_x < yaxis_height)
-			Yaxis_x = yaxis_height;
-	}
-	values[0] = xminval;
-	values[1] = xmaxval;
-	values[2] = (values[1] - values[0]) / x_major;
-	label_format(values, 3, label_field, &digits_left, &digits_right, &exp_flag);
-	delta = (width-1) / x_major;
-	y = yupleft + height + label_height/2;
-	value = xminval;
-	for (i = 0; i <= x_major; i++)
-	{
-		ftos(value, digits_left, digits_right, exp_flag, text);
-		x = xupleft + i*delta - strlen(text) * label_width / 2;
-		drawText (x, y+8, text);
-		value += values[2];
-		if (x_major > 5)
-		{
-			i++;
-			value += values[2];
-          	// if (x_major > 9) {
-           	//     	i++;
-            	//    	value += values[2];
-           	//}
-		}
-	}
-//    	set_font(font);
-	return 0;
-}
-
-int TeGraphPlot :: plot_title(char *text)
-{
-    	int font;
-    	if ((font = set_font(title_font)) == ERR) return ERR;
-    	plot_horiz(text, Title_y, title_width);
-    	set_font(font);
-    	return 0;
-}
-
-int TeGraphPlot :: plot_xaxis(char *text)
-{
-    	int font;
-    	if ((font = set_font(xaxis_font)) == ERR) return ERR;
-    	plot_horiz(text, Xaxis_y, xaxis_width);
-    	set_font(font);
-	return 0;
-}
-
-void
-TeGraphPlot :: plot_horiz(char *text, int y, int w)
-{
-    	int x, l, count;
-    	char *ptr = NULL,buffer[80];
-    	setTextColor(Graph_color.text);
-    	l = strlen(text);
-    	x = xupleft + (width-1)/2 - (l * w)/2;
-    	ptr = text;
-    	if (x < xupleft) {
-        	count = (xupleft - x)/w;
-        	buffer[79] = '\0';
-        	strncpy(buffer, text, sizeof(buffer)-1);
-        	buffer[l-count-1] = '\0';
-        	x = xupleft;
-        	ptr = buffer;
-    	}
-    	drawText (x, y, ptr);
-    	ptr = NULL;
-}
-
-int
-TeGraphPlot :: plot_yaxis(char *text)
-{
-    int y, length, count, font, delta;
-	char *ptr= NULL, buffer[80], c[2];
-    setTextColor(Graph_color.text);
-	c[0] = '*'; c[1] = '\0';
-	if ((font = set_font(yaxis_font)) == ERR) return ERR;
-	length = strlen(text);
-	ptr = text;
-	delta = yaxis_direct == HORIZ_FONT ?
-            yaxis_height : yaxis_width;
-	y = (Title_y + Xaxis_y + delta * length) / 2;
-	buffer[79] = '\0';
-	strncpy(buffer, text, sizeof(buffer)-1);
-	if (y < Title_y)
-	{
-		count = 2 * (Title_y - y)/delta;
-		buffer[length-count-1] = '\0';
-		y = Title_y;
-		ptr = buffer;
-	}
-	if (yaxis_direct == HORIZ_FONT)
-	{
-		while (*ptr != '\0')
-		{
-			c[0] = *ptr++;
-			drawText (Yaxis_x, y, c);
-			y += yaxis_height;
-		}
-	}
-	else
-		drawText (Yaxis_x, y, ptr, 90.);
-	ptr = NULL;
-
-	set_font(font);
-	return 0;
-}
-
-int
-TeGraphPlot :: plot_curve(Real_Vector x, Real_Vector y,int points,TeColor c)
-{
-    	int i, count;
-
-	setLineAttributes(c,TeLnTypeContinuous,0);
-
-    	count = plot_point(x[0], y[0], PEN_UP);
-    	for (i = 1; i < points; i++)
-        	count += plot_point(x[i], y[i], PEN_DOWN);
-    	return count;
-}
-
-int
-TeGraphPlot :: plot_point(Real x_value, Real y_value, int pen_status)
-{
-    static Real last_x_value, last_y_value;
-    static int last_x, last_y;
-    Real temp_x, temp_y;
-    int x, y, status=0;
-
-    if (point_visible(x_value, y_value))
-	{
-        value_to_pixel(x_value, y_value, &x, &y);
-        if (pen_status == PEN_UP)
-		{
-//				SET_PIXEL(x, y, color);
-		}
-        else
-		{
-            if (!point_visible(last_x_value, last_y_value))
-			{
-				temp_x = last_x_value;
-				temp_y = last_y_value;
-                find_intersect(x_value, y_value, &temp_x, &temp_y);
-                value_to_pixel(temp_x, temp_y, &last_x,	&last_y);
-            }
-			if (last_y_value < TeMAXFLOAT)
-            	drawLine(last_x, last_y, x, y);
-        }
-        last_x = x;
-        last_y = y;
-        status = 1;
-    }
-    else if (pen_status == PEN_DOWN && point_visible(last_x_value, last_y_value))
-	{
-		if (y_value < TeMAXFLOAT)
-		{
-			temp_x = x_value;
-			temp_y = y_value;
-			find_intersect(last_x_value, last_y_value, &temp_x, &temp_y);
-			value_to_pixel(temp_x, temp_y, &x, &y);
-			drawLine(last_x, last_y, x, y);
-		}
-        status = 0;
-    }
-    last_x_value = x_value;
-   	last_y_value = y_value;
-    return status;
-}
-
-int
-TeGraphPlot :: plotSymbol(Real x_value, Real y_value, int symbol, int w, int h, int curve)
-{
-    int x, y;
-
-	setLineAttributes(Graph_color.symbol[curve],TeLnTypeContinuous,1);
-
-	if (point_visible(x_value, y_value))
-	{
-        	value_to_pixel(x_value, y_value, &x, &y);
-        	draw_symbol(x, y, symbol, w, h);
-        	return true;
-    }
-    return false;
-}
-
-void
-TeGraphPlot :: draw_symbol(int x, int y,int symbol, int w, int h)
-{
-	if( symbol < 0 )		//V2.0-01 GAIA
-	{
-		symbol = 0;
-	}
-	symbol = symbol % 5;		//V2.0-01 GAIA
-
-    	switch (symbol)
-	{
-        case RECTANGLE:
-            	drawLine(x - w/2, y - h/2, x + w/2, y - h/2);
-		drawLine(x + w/2, y - h/2, x + w/2, y + h/2);
-		drawLine(x + w/2, y + h/2, x - w/2, y + h/2);
-            	drawLine(x - w/2, y + h/2, x - w/2, y - h/2);
-		break;
-
-        case TRIANGLE:
-		drawLine(x - w/2, y + h/2, x, y - h/2);
-		drawLine(x, y - h/2, x + w/2, y + h/2);
-            	drawLine(x + w/2, y + h/2, x - w/2, y + h/2);
-            	break;
-
-        case DIAMOND:
-            	drawLine(x - w/2, y, x, y - h/2);
-            	drawLine(x, y - h/2, x + w/2, y);
-            	drawLine(x + w/2, y, x, y + h/2);
-            	drawLine(x, y + h/2, x - w/2, y);
-            	break;
-
-        case SCROSS:
-            	drawLine(x - w/2, y, x + w/2, y);
-		drawLine(x, y - h/2, x, y + h/2);
-		break;
-
-        case XCROSS:
-		drawLine(x - w/2, y + h/2, x + w/2, y - h/2);
-		drawLine(x - w/2, y - h/2, x + w/2, y + h/2);
-		break;
-    	}
-}
-
-
-void TeGraphPlot :: draw_symbol_legend(int x, int y, int symbol, int w, int h)
-{
-	if( symbol < 0 )		//V2.0-01 GAIA
-	{
-		symbol = 0;
-	}
-	symbol = symbol % 5;		//V2.0-01 GAIA
-
-    	switch (symbol)
-	{
-        case RECTANGLE:
-		drawLine(x - w/2, y - h/2, x + w/2, y - h/2);
-		drawLine(x + w/2, y - h/2, x + w/2, y + h/2);
-		drawLine(x + w/2, y + h/2, x - w/2, y + h/2);
-		drawLine(x - w/2, y + h/2, x - w/2, y - h/2);
-		break;
-
-        case TRIANGLE:
-		drawLine(x - w/2, y + h/2, x, y - h/2);
-		drawLine(x, y - h/2, x + w/2, y + h/2);
-		drawLine(x + w/2, y + h/2, x - w/2, y + h/2);
-		break;
-
-        case DIAMOND:
-		drawLine(x - w/2, y, x, y - h/2);
-		drawLine(x, y - h/2, x + w/2, y);
-		drawLine(x + w/2, y, x, y + h/2);
-		drawLine(x, y + h/2, x - w/2, y);
-		break;
-
-        case SCROSS:
-		drawLine(x - w/2, y, x + w/2, y);
-		drawLine(x, y - h/2, x, y + h/2);
-		break;
-
-        case XCROSS:
-		drawLine(x - w/2, y + h/2, x + w/2, y - h/2);
-		drawLine(x - w/2, y - h/2, x + w/2, y + h/2);
-		break;
-    }
-}
-
-
-void
-TeGraphPlot :: label_format(Real values[], int nvalues, int field_width,
-                   int *digits_left, int *digits_right, int *exp_flag)
-{
-	char *str = NULL;
-	int i, j, digits, decimal, sign, trail0;
-
-	digits = sizeof(Real) == sizeof(float) ? FLT_DIG : DBL_DIG;
-	*digits_left = *digits_right = *exp_flag = 0;
-    	for (i = 0; i < nvalues && *exp_flag == 0; i++) {
-		str = ecvt(values[i], digits, &decimal, &sign);
-        	if (decimal > *digits_left) *digits_left = decimal;
-        	for (j = digits-1, trail0 = 0; j >= 0 && str[j] == '0'; j--) trail0++;
-        	j = digits - trail0 - decimal;
-        	if (j > *digits_right) *digits_right = j;
-        	if (*digits_right + *digits_left > field_width-2) {
-            		*exp_flag = 1;
-            		*digits_left = 1;
-            		*digits_right = field_width - 8;
-            		if (*digits_right < 0) *digits_right = 0;
-        	}
-    	}
-   	 str = NULL;
-}
-
-void TeGraphPlot :: find_intersect(Real x_in, Real y_in,
-                    Real *x_out, Real *y_out)
-{
-    	// find values for x_out and y_out that intersect the
-       	// plot boundary on a line between the points (x_in, y_in) inside
-       	// the plot region and (x_out, y_out) outside the plot region
-
-    	Real m, b, temp_x, temp_y;
-    	m = (y_in - *y_out) / (x_in - *x_out);
-    	b = y_in - m * x_in;
-    	if (*x_out >= xminval && *x_out <= xmaxval) {
-        	// only y_out is outside plot region
-        	if (*y_out < yminval) *y_out = yminval;
-        	else if (*y_out > ymaxval) *y_out = ymaxval;
-        	*x_out = (*y_out - b) / m;
-    	}
-    	else
-	{ 
-		if (*y_out >= yminval && *y_out <= ymaxval) {
-        		// only x_out is outside plot region
-        		if (*x_out < xminval) *x_out = xminval;
-        		else if (*x_out > xmaxval) *x_out = xmaxval;
-        		*y_out = *x_out * m + b;
-    		}
-		else
-		{
-        		// both x_out and y_out are outside plot region
-        		if (*y_out < yminval) temp_y = yminval;
-        		else temp_y = ymaxval;
-        		temp_x = (temp_y - b) / m;
-        		if (temp_x >= xminval && temp_x <= xmaxval) {
-            			*y_out = temp_y;
-            			*x_out = temp_x;
-        		}
-        		else {
-            			if (*x_out < xminval) *x_out = xminval;
-            			else *x_out = xmaxval;
-            			*y_out = *x_out * m + b;
-			}
-		}
-	}
-}
-
-//----------------------------------------------------------------------------------------
-void
-TeGraphPlot :: drawLegend(void)
-{
-    int x, y, h, delta;
-    int i, count = 0;
-
-	for (i = 0; i < Plot_curves; i++)
-	{
-        if (Plot_label.curve[i][0] != '\0') count++;
-	}
-
-    if (count != 0)
-	{
-       	h = Font_height[0] + 4;
-		if (count > 3) h += Font_height[0] + 3;
-        y = getHeight() - h;
-
-		setLineAttributes(Graph_color.lines,TeLnTypeContinuous,0);
-		drawRectangle(0, y, width - 1, h);
-
-        x = Font_width[0] + 1;
-		delta = Font_height[0] + 3;
-        for (count = 0, i = 0; i < Plot_curves; i++)
-	{
-            if (Plot_label.curve[i][0] != '\0' && count < 7)
-			{
-                if (count++ == 3) {
-                    x = Font_width[0] + 1;
-                    y += Font_height[0] + 6;
-                }
-
-				setLineAttributes(Graph_color.curve[i],TeLnTypeContinuous,0);
-				draw_symbol_legend(x, y + delta - Font_height[0]/2, Symbol[i], 7, 7);
-                x += Font_width[0];
-
-				setTextColor(Graph_color.text);
-                drawText (x, y + delta - Font_height[0], Plot_label.curve[i]);
-				x += 10 * Font_width[0];
-            }
-        }
-	}
-}
-
-//----------------------------------------------------------------------------------------
-void
-TeGraphPlot :: value_to_pixel(Real x_value, Real y_value, int *x_pixel, int *y_pixel)
-{
-	*x_pixel = (int) ((x_value - xminval) /
-               (xmaxval - xminval) * (width - 1) + xupleft);
-	*y_pixel = (int) ((ymaxval - y_value) /
-               (ymaxval - yminval) * (height - 1) + yupleft);
-}
-
-//----------------------------------------------------------------------------------------
-void
-TeGraphPlot :: pixelToValue(int x_pixel, int y_pixel, Real& x_value, Real& y_value)
-{
-	x_value = (Real) (x_pixel - xupleft) / (width-1) *
-               (xmaxval - xminval) + xminval;
-	y_value = (Real) (yupleft - y_pixel) / (height-1) *
-               (ymaxval - yminval) + ymaxval;
-}
-
-//----------------------------------------------------------------------------------------
-int
-TeGraphPlot :: point_visible(Real x, Real y)
-{
-    	if (x >= xminval && x <= xmaxval &&
-        y >= yminval && y <= ymaxval) return 1;
-    	else return 0;
-}
-
-//FAMI0395 int set_font(int font_number)
-int set_font(int)
-{
-/*
-    	static int font;
-    	int previous_font;
-	// set font to specified font number
-	if (_set_font(font_number) == 0) {
-        	previous_font = font;
-        	font = font_number;
-        	return previous_font;
-    	}
-    	else {
-        	video_err = FONT_ERR;
-        	return ERR;
-    	} */
-
-	return (int)true;	//FAMI0394
-}
-
-void ftos(Real f, int digits_left, int digits_right, int exp_flag, char *s)
-{
-	int i = 0, decimal, sign;
-	char *str = NULL;
-	str = ecvt(f, digits_left+digits_right, &decimal, &sign);
-	if (sign) *s++ = '-';
-	if (exp_flag)
-	{ 	/* exponential format */
-		for (i=0; i < digits_left; i++) *s++ = *str++;
-		*s++ = '.';
-		for (i=0; i < digits_right; i++) *s++ = *str++;
-		*s++ = 'e';
-		decimal -= digits_left;
-		if (decimal < 0)
-		{
-			*s++ = '-';
-			decimal = -decimal;
-		}
-		else *s++ = '+';
-		s += 3;
-		*s-- = '\0';
-		for (i = 0; i < 3; i++)
-		{
-			*s-- = (char) (decimal % 10 + (int) '0');
-			decimal /= 10;
-		}
-	}
-	else
-	{          /* fixed point format */
-		if (decimal <= 0)
-		{
-			if (digits_left > 0) *s++ = '0';
-			if (digits_right > 0) *s++ = '.';
-			for (i = decimal; i != 0 && digits_right > 0 ; i++)
-			{
-				*s++ = '0';
-				digits_right--;
-			}
-			for (i = 0; i < digits_right; i++) *s++ = *str++;
-		}
-		else
-		{
-			for (i = 0; i < decimal; i++) *s++ = *str++;
-			if (digits_right > 0)
-			{
-				*s++ = '.';
-				for (i = 0; i < digits_right; i++) *s++ = *str++;
-			}
-		}
-		*s = '\0';
-	}
-	str = NULL;
-}
-
-//----------------------------------------------------------------------------------------
-
-void
-TeGraphPlot :: plotInit(int pixels_above, int pixels_below, int pixels_left, int pixels_right)
-{
-// initialize Plot variables, reserving the number of pixels specified by
-// pixels_above, pixels_below, pixels_left, and pixels_right for use by
-// the program
-
-	int delta, x_ticks, y_ticks;
-
-// initialize variables appropriately for current plotting device
-	X_pixels = getWidth ();
-	Y_pixels = getHeight ();
-
-    get_plot_fonts();
-    get_font_size(title_font, &title_width, &title_height);
-    get_font_size(label_font, &label_width, &label_height);
-    get_font_size(xaxis_font, &xaxis_width, &xaxis_height);
-    yaxis_direct = get_font_size(yaxis_font, &yaxis_width, &yaxis_height);
-    delta = yaxis_direct == HORIZ_FONT ? yaxis_width : yaxis_height;
-	xupleft = pixels_left + delta + (label_field + 1) * label_width;
-    delta = title_height + label_height/2;
-    yupleft = pixels_above + delta + title_height;
-    Title_y = yupleft - delta;
-
-// make width of Plot region a multiple of x_ticks
-	x_ticks = x_major * x_minor;
-	width = (X_pixels - pixels_right - xupleft -
-		label_field * label_width / 2 + 1)
-		/x_ticks*x_ticks + 1;
-
-// make height of Plot region a multiple of y_ticks
-	y_ticks = y_major * y_minor;
-	delta = 2 * label_height + 1;
-	height = (Y_pixels - pixels_below - yupleft - delta -
-		xaxis_height)/y_ticks*y_ticks + 1;
-
-// define y coordinate for x axis title
-	Xaxis_y = yupleft + height - 1 + delta;
-}
-
-//----------------------------------------------------------------------------------------
-void
-TeGraphPlot :: get_plot_fonts()
-{
-    	title_font = 0;
-    	label_font = 0;
-    	xaxis_font = 0;
-    	yaxis_font = 1;
-}
-
-//----------------------------------------------------------------------------------------
-int
-TeGraphPlot :: get_font_size(int font_number, int *w, int *h)
-{
-// return width, height, and direction of specified font number
-	if (font_number < FONT_MAX)
-	{
-		*w = Font_width[font_number];
-		*h = Font_height[font_number];
-		return Font_direct[font_number];
-	}
-	else
-	{
-		return ERR;
-	}
-}
-
-//----------------------------------------------------------------------------------------
-void
-TeGraphPlot :: reset()
-{
-	for (int i=0; i<Plot_curves; i++)
-	{
-		Plot_x[i] = NULL;
-		Plot_y[i] = NULL;
-	}
-
-	Plot_curves = 0;  
-	Plot_symbols = 0;  
-	Curve_choice = 0;         
-	Plot_choice = 0;
-}
-
-void TeGraphPlot::drawMoranText (double dx1, double dy1, double dx2, double dy2)
-{
-	int	w, h, x, y;
-	int x1, y1, x2, y2, mx, my;
-
-	setTextColor(Graph_color.text);
-
-	value_to_pixel(dx1, dy1, &x1, &y1);
-	value_to_pixel(dx2, dy2, &x2, &y2);
-	value_to_pixel(0., 0., &mx, &my);
-
-	string tx = "AA";
-	textExtent(tx, w, h);
-	x = (int)(mx + (double)(x2-mx)/2. - (double)w/2.);
-	y = (int)(my - (double)(my-y2)/2. + (double)h/2.);
-	drawText(x, y, (char*)tx.c_str());
-
-	tx = "AB"; 
-	textExtent(tx, w, h);
-	x = (int)(mx - (double)(mx-x1)/2. - (double)w/2.);
-	drawText(x, y, (char*)tx.c_str());
-
-	tx = "BB"; 
-	textExtent(tx, w, h);
-	y = (int)(my + (double)(y1-my)/2. + (double)h/2.);
-	drawText(x, y, (char*)tx.c_str());
-
-	tx = "BA"; 
-	textExtent(tx, w, h);
-	x = (int)(mx + (double)(x2-mx)/2. - (double)w/2.);
-	drawText(x, y, (char*)tx.c_str());
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include <TeGraph.h>
+#include <TeDefines.h>
+#include <math.h>
+#include <float.h>
+#include <malloc.h>
+#include <stdio.h>
+#include <errno.h>
+
+int set_font(int font_number);
+
+#define PEN_UP       0     /* pen status up */
+#define PEN_DOWN     1     /* pen status down */
+
+#define ERR        -1     /* return value when error occurs */
+
+#define HORIZ_FONT 0
+#define VERT_FONT  1
+#define FONT_MAX   2
+
+/*** symbol shapes ***/
+
+#define RECTANGLE    0     /* tells PlotSymbol to draw a rectangle */
+#define TRIANGLE     1     /* tells PlotSymbol to draw a triangle */
+#define DIAMOND      2     /* tells PlotSymbol to draw a diamond */
+#define SCROSS       3     /* tells PlotSymbol to draw an upright cross */
+#define XCROSS       4     /* tells PlotSymbol to draw an angled cross */
+
+/*** constants ***/
+
+#define CURVES_LIMIT   10     /* maximum number of curves */
+#define MAIN_ROW       3     /* row number for main menu */
+#define MAIN_COL       2     /* column number for main menu */
+#define MAX_ITEMS     13     /* maximum number of items in a menu window */
+#define MASK_SIZE     50     /* length of file mask string */
+#define ASCII          0     /* Ascii output format */
+#define BINARY         1     /* Binary output format */
+#define LOAD           0     /* load options */
+#define SAVE           1     /* save options */
+#define SET            2     /* set options */
+#define DIGITS         6     /* number of digits to display for regression
+                               coefficients and mean square error */
+int  Font_width[FONT_MAX]  = {9,9};
+int  Font_height[FONT_MAX] = {15,15};
+int  Font_direct[FONT_MAX] = {HORIZ_FONT,VERT_FONT};
+
+
+char Symbol[CURVES_MAX] = {        /* symbols identifying each curve */
+		RECTANGLE,  /* symbol for curve 1 is a rectangle */
+		SCROSS,     /* symbol for curve 4 is an upright cross */
+		TRIANGLE,   /* symbol for curve 2 is a triangle */
+		DIAMOND,    /* symbol for curve 3 is a diamond */
+		XCROSS,      /* symbol for curve 5 is an angled cross */
+		RECTANGLE,  /* symbol for curve 6 is a rectangle */
+		SCROSS,     /* symbol for curve 9 is an upright cross */
+		TRIANGLE,   /* symbol for curve 7 is a triangle */
+		DIAMOND,    /* symbol for curve 8 is a diamond */
+		XCROSS      /* symbol for curve 10 is an angled cross */
+};
+
+unsigned Terms[] =
+{                                  /* terms in each regression function */
+        0,                         /* terms for polynomial set by regres_func */
+        2,                         /* number of exponential terms */
+        2,                         /* number of logarithmic terms */
+        3                          /* number of sinusoidal terms */
+};
+
+
+struct Opt{                        /* Options default settings */
+	char symbols[5];
+	char x_major[3];
+	char x_minor[3];
+	char y_major[3];
+	char y_minor[3];
+	char y_scale[2];
+	char filemask[MASK_SIZE];
+	char format[7];
+	char digits[3];
+	char linesize[4];
+	char adapter[5];
+	char printer[9];
+	char printer_port[5];
+	char print_file[13];
+	char color[4];
+	char snow[4];
+	char sound[4];
+	char grid[4];
+	char legend[4];
+} Options ;       /* curve legend turned on                        */
+
+struct Txtc{
+	unsigned char background;   /* color of outermost window */
+ 	unsigned char pattern;      /* color of pattern in outermost window */
+	unsigned char input;        /* color of input window */
+	unsigned char input_prompt; /* color of input window prompt */
+	unsigned char input_answer; /* color of input window answer */	
+	unsigned char edit;         /* color of edit window */
+	unsigned char edit_bar;     /* color of selection bar in edit window */
+	unsigned char edit_answer;  /* color of answer bar in edit window */
+	unsigned char edit_index;   /* color of index values in edit window */
+	unsigned char edit_heading; /* color of X/Y values heading in edit window */
+	unsigned char error;        /* color of error window */
+	unsigned char help;         /* color of help message text */
+} Text_color;
+
+struct Grc{
+    TeColor grid;                /* color of plot grid         */
+    TeColor text;                /* color of plot text         */
+    TeColor lines;               /* color of plot all lines    */
+	TeColor symbol[CURVES_LIMIT];/* color of plot all lines    */
+    TeColor curve[CURVES_LIMIT]; /* color of plot curves       */
+} Graph_color;
+
+int f_spoly(Real x, Real_Vector terms, unsigned n);
+int f_sexp(Real x, Real_Vector terms, unsigned n);
+int f_slog(Real x, Real_Vector terms, unsigned n);
+int f_ssin(Real x, Real_Vector terms, unsigned n);
+
+int (*Function[])(Real, Real_Vector, unsigned) =
+{                                  /* array of functions used for regression  */
+        f_spoly,                     /* calculate terms of polynomial equation  */
+        f_sexp,                      /* calculate terms of exponential equation */
+        f_slog,                      /* calculate terms of logarithmic equation */
+        f_ssin                       /* calculate terms of sinusoidal equation  */
+};
+
+Real vmaxval(Real_Vector v, unsigned int n, int *imx)
+{
+ 	// subroutine determines the maximum  value (maxx) of the
+  	// vector v[] of length n and returns the index (imx) where
+  	// the maximum occurs; i.e. imx, where maxx = v[imx].
+ 	// On exit, the maximum is returned as the value of vmaxval().
+
+	unsigned int i;
+	Real maxx;
+ 
+	if (v == NULL)
+		return (Real) 0.0;
+
+ 	//find max value
+
+	*imx=0;
+	maxx=v[0];
+	for(i=1; i<n ; i++)
+	{
+		if(v[i] > maxx)
+		{
+			maxx=v[i];
+			*imx=i;
+		}
+	}
+	return maxx;
+}
+
+//---------------------------------------------------------------------------------
+Real
+vminval(Real_Vector v, unsigned int n, int *imn)
+{
+// subroutine determines the minimum  value (minx) of the
+// vector v[] of length n and returns the index (imn) where
+// the minimum occurs; i.e. imn, where minx = v[imn].
+// On exit, the minimum is returned as the value of vminval().
+
+	unsigned int i;
+	Real minx;
+ 
+	if (v == NULL)
+		return (Real) 0.0;
+
+	//find min value
+	*imn=0;
+	minx=v[0];
+	for(i=1; i<n ; i++)
+	{
+		if(v[i] < minx)
+		{
+			minx=v[i];
+			*imn=i;
+		}
+	}
+	return minx;
+}
+
+//---------------------------------------------------------------------------------
+
+TeGraphPlot :: TeGraphPlot ()
+{
+	GPpointwidth = 7;
+	GPpointheight = 7;
+
+	label_field = 11;
+	major_tick = 5;
+	minor_tick = 2;
+	x_major = 8;
+	y_major = 10;
+	x_minor = 8;
+	y_minor = 5;
+	Scale_curve = -1;
+	Plot_curves = 0;
+	Plot_symbols = 0;
+	Curve_choice = 0;
+	Plot_choice = 0;
+	int i;
+	for( i = 0; i < CURVES_MAX; i++ )
+	{
+		Plot_points[i] = 0;
+		Plot_x[i] = 0;
+		Plot_y[i] = 0;
+	}
+
+	Graph_color.grid.init(0,100,100);
+	Graph_color.text.init(0,0,0);
+	Graph_color.lines.init(30,30,30);// preto
+
+	for( i = 0; i < CURVES_LIMIT; i++ )
+	{
+		Graph_color.symbol[i].init(0,255,0);
+		Graph_color.curve[i].init(0,0,0);
+	}
+
+	sliceVector = 0;
+}
+
+//---------------------------------------------------------------------------------
+
+TeGraphPlot :: ~TeGraphPlot ()
+{
+}
+
+//---------------------------------------------------------------------------------
+void
+TeGraphPlot :: setColorGrid(int r, int g, int b)
+{
+	Graph_color.grid.init(r,g,b);
+}
+
+//---------------------------------------------------------------------------------
+void	
+TeGraphPlot :: setColorText(int r, int g, int b)
+{
+	Graph_color.text.init(r,g,b);
+}
+
+//---------------------------------------------------------------------------------
+void	
+TeGraphPlot :: setColorSymbol(int r, int g, int b, int curve, int w, int h)
+{
+	if (curve==-1)
+		for (int i=0; i<CURVES_LIMIT; i++)
+			Graph_color.symbol[i].init(r,g,b);
+	else
+		Graph_color.symbol[curve].init(r,g,b);
+
+	GPpointwidth = w;
+	GPpointheight = h;
+}
+
+//---------------------------------------------------------------------------------
+void
+TeGraphPlot :: setColorLine(int r, int g, int b)
+{
+	Graph_color.lines.init(r,g,b);
+}
+
+//---------------------------------------------------------------------------------
+int
+TeGraphPlot :: setColorCurve(int c,int r, int g, int b)
+{
+	if( c < 0 || c > CURVES_LIMIT-1 )
+	{
+		return false;
+	}
+
+ 	Graph_color.curve[c].init(r,g,b);
+
+	return true;
+}
+
+void
+TeGraphPlot :: pieLegends ()
+{
+	if (sliceVector == 0)
+		return;
+	int	w;
+	int	xt, yt, pw, ph;
+	
+	TeColor	cor;
+
+	cor.init (0, 0, 0);
+    setTextColor(cor);
+
+	w = min(width,height);
+	pw = 2*label_height;
+	ph = label_height;
+
+	xt = xupleft + w + pw;
+	yt = yupleft;
+	int textext = 0;
+	for (unsigned int i = 0; i < sliceVector->size (); i++)
+	{
+		TeLegendEntry slice = (*sliceVector)[i];
+		TeVisual  vis;
+		//vis = slice.visual (TePOLYGONS);
+		TeColor cor = vis.color();
+		
+		setFillAreaColor (cor);
+		string leg = slice.label ();
+		int xw,xh;
+		textExtent (leg, xw, xh);
+		textext = max (textext, xw);
+		fillRectangle (xt, yt-ph, pw, ph);
+		drawText ((int)(xt+1.2*pw), yt-2, (char*)leg.c_str ());
+		yt += (int)1.5*ph;
+		if (yt > (yupleft + height))
+		{
+			xt += (int)(textext+2.2*pw);
+			textext = 0;
+			yt = yupleft;
+		}
+	}
+}
+
+
+//---------------------------------------------------------------------------------
+int
+TeGraphPlot :: setGridSize(int s)
+{
+	if( s <= 0 )
+	{
+		return false;
+	}
+	x_major = s;
+	y_major = s;
+	x_minor = s;
+	y_minor = s;
+
+	return true;
+}
+
+//---------------------------------------------------------------------------------
+int
+TeGraphPlot :: setGridSize(int xma, int yma, int xmi, int ymi )
+{
+	if( xma <= 0 || yma <= 0 || xmi <= 0 || ymi <= 0 )
+	{
+		return false;
+	}
+
+	x_major = xma;
+	y_major = yma;
+	x_minor = xmi;
+	y_minor = ymi;
+
+	return true;
+}
+
+//---------------------------------------------------------------------------------
+int
+TeGraphPlot :: loadDirect (int format, int curv, int points, Labels& labels, Real_Vector x, Real_Vector y)
+{
+	if( curv < 0 || curv > CURVES_LIMIT-1 )
+	{
+		return false;
+	}
+
+	strcpy(Plot_label.title, labels.title);
+	strcpy(Plot_label.xaxis, labels.xaxis);
+	strcpy(Plot_label.yaxis, labels.yaxis);
+	Input_format[curv] = format;
+
+        strcpy(Plot_label.curve[curv], labels.curve[curv]);
+
+	Plot_x[curv] = x;
+	Plot_y[curv] = y;
+	Plot_points[curv] = points;
+
+	if (Plot_curves < (curv+1) )
+	{
+		Plot_curves= curv+1;
+	}
+
+	return true;
+}
+
+void TeGraphPlot::loadHistogram (TeLegendEntryVector& sv, const string& label)
+{
+// Manage number of curves, only one histogram is allowed per plotting
+	Plot_curves = 1;
+	int order = 0;
+	Input_format[order] = BAR_BINARY;
+	sliceVector = &sv;
+// Allocate space for data arrays
+	unsigned int size = sv.size ();
+	if (Plot_x[order])
+		delete [] Plot_x[order];
+	if (Plot_y[order])
+		delete [] Plot_y[order];
+	Plot_x[order] = new double [size];
+	Plot_y[order] = new double [size];
+	Plot_points[order] = size;
+
+// Transfer data from TeLegendEntrys to double array
+	int vmax = 0;
+	for (unsigned int i=0;i<size;i++)
+	{
+		TeLegendEntry sl = sv[i];
+		Plot_y[order][i] = sl.count();
+		Plot_x[order][i] = (double)i+1;
+		vmax = max (vmax,sl.count() );
+	}
+
+// Fill in labels
+	strcpy(Plot_label.title, label.c_str ());
+	strcpy(Plot_label.xaxis, "Fatia");
+	strcpy(Plot_label.yaxis, "Objetos");
+	strcpy(Plot_label.curve[order],"");
+	setScale(1., Real(size+1) , 0., Real (vmax));
+	setGridSize(size, 8, 1, 1); 
+}
+
+void TeGraphPlot::loadPie (TeLegendEntryVector& sv, const string& label)
+{
+// Manage number of curves, only one pie is allowed per plotting
+	Plot_curves = 1;
+	int order = 0;
+	Input_format[order] = PIE_BINARY;
+	height = Y_pixels - yupleft;
+	sliceVector = &sv;
+// Allocate space for data arrays
+	unsigned int size = sv.size ();
+	if (Plot_x[order])
+		delete [] Plot_x[order];
+	if (Plot_y[order])
+		delete [] Plot_y[order];
+	Plot_x[order] = new double [size];
+	Plot_y[order] = new double [size];
+	Plot_points[order] = size;
+
+// Transfer data from TeLegendEntrys to double array
+	int vmax = 0;
+	for (unsigned int i=0;i<size;i++)
+	{
+		TeLegendEntry sl = sv[i];
+		Plot_y[order][i] = sl.count();
+		Plot_x[order][i] = (double)i+1;
+		vmax = max (vmax,sl.count() );
+	}
+
+// Fill in labels
+	strcpy(Plot_label.title, label.c_str ());
+//	strcpy(Label.curve[order],label.c_str ());
+}
+
+//---------------------------------------------------------------------------------
+void
+TeGraphPlot :: autoScale(void)
+{
+// scale axes for Scale_curve (for all curves if Scale_curve == -1) 
+
+	int i, index;
+	Real value;
+
+	if (Scale_curve == -1)
+		index = 0;
+	else
+		index = Scale_curve;
+
+	xminval = vminval(Plot_x[index], Plot_points[index], &i);
+	xmaxval = vmaxval(Plot_x[index], Plot_points[index], &i);
+	yminval = vminval(Plot_y[index], Plot_points[index], &i);
+	ymaxval = vmaxval(Plot_y[index], Plot_points[index], &i);
+
+	if (Scale_curve == -1)
+	{
+		for (i = 1; i < Plot_curves; i++)
+		{
+			value = vminval(Plot_x[i], Plot_points[i], &index);
+			if (value < xminval) xminval = value;
+			value = vmaxval(Plot_x[i], Plot_points[i], &index);
+			if (value > xmaxval) xmaxval = value;
+			value = vminval(Plot_y[i], Plot_points[i], &index);
+			if (value < yminval) yminval = value;
+			value = vmaxval(Plot_y[i], Plot_points[i], &index);
+			if (value > ymaxval) ymaxval = value;
+		}
+	}
+
+	for (int curva=0; curva < Plot_curves; curva++)
+	{
+		if (Input_format[curva] == ROSE_BINARY)
+		{
+			yminval = - ymaxval;
+			xmaxval = ymaxval;
+			xminval = yminval;
+		}
+	}
+}
+
+//---------------------------------------------------------------------------------
+void
+TeGraphPlot :: setScale(Real x1, Real x2 , Real y1, Real y2)
+{
+   	xminval = x1;
+    	xmaxval = x2;
+    	yminval = y1;
+    	ymaxval = y2;
+
+	for (int curva=0; curva < Plot_curves; curva++)
+	{
+		if (Input_format[curva] == ROSE_BINARY)
+		{
+			yminval = - ymaxval;
+			xmaxval = ymaxval;
+			xminval = yminval;
+		}
+	}
+}
+
+int f_spoly(Real x, Real_Vector terms, unsigned n)
+{
+    	unsigned i;
+    	terms[0] = 1.0;
+    	for (i = 1; i < n; i++) terms[i] = x * terms[i-1];
+   	return 0;
+}
+
+int f_sexp(Real x, Real_Vector terms, unsigned n)
+{
+    double value;
+   	value = exp(x);
+    if (value != HUGE_VAL)
+	{
+        terms[0] = 1.0;
+        terms[n-1] = (Real) value;
+        return 0;
+    }
+	else
+	{
+       show_err("Value of exp(x) is too large");
+       return -1;
+    }
+}
+
+int f_slog(Real x, Real_Vector terms, unsigned n)
+{
+    	if (x > 0.0) {
+        	terms[0] = 1.0;
+        	terms[n-1] = (Real) log(x);
+        	return 0;
+    	}
+    	else {
+        	show_err("Value of x is less than or equal to 0");
+        	return -1;
+    	}
+}
+
+int f_ssin(Real x, Real_Vector terms, unsigned n)
+{
+   	errno = 0;
+	terms[0] = 1.0;
+    terms[1] = (Real) sin(x);
+    terms[n-1] = (Real) cos(x);
+    if (errno == 0)
+		return 0;
+    else
+	{
+        show_err("Loss of significance for cos(x) or sin(x)");
+       	return -1;
+    }
+}
+
+void show_err (char* /* mess */)
+{
+//	printf("%s\n",mess);
+}
+
+//---------------------------------------------------------------------------------
+
+int
+TeGraphPlot :: kill(int order)
+{
+	int i, count = 0;
+	if (Plot_curves == 0)
+		return 0;
+	for (i = 0; i < Plot_curves; i++)
+	{
+		if (Plot_x[i] == Plot_x[order]) count++;
+	}
+
+	if (count == 1)
+	{
+		delete [] Plot_x[order];
+		Plot_x[order] = 0;
+		delete [] Plot_y[order];
+		Plot_y[order] = 0;
+	}
+
+	for (i = order; i < Plot_curves-1; i++)
+	{
+		Plot_x[i] = Plot_x[i+1];
+		Plot_y[i] = Plot_y[i+1];
+		Plot_points[i] = Plot_points[i+1];
+		strcpy(Plot_label.curve[i], Plot_label.curve[i+1]);
+	}
+   	Plot_curves--;
+	return 1;
+}
+
+
+//---------------------------------------------------------------------------------
+void
+TeGraphPlot :: plotCurves ( int with_simbols)
+{
+	short	drawplot = true;
+	Plot_symbols = with_simbols; // numero de pontos
+				     // que devem ser plotados
+				     // sobre a curva
+	for (int curva=0; curva < Plot_curves; curva++)
+	{
+		if (Plot_y[curva] == NULL)
+			continue;
+
+		if (Input_format[curva] == PIE_BINARY && sliceVector)
+		{
+			plot_title(Plot_label.title);
+
+			int		i, w, h, xc, yc, points;
+			
+			w = min(width,height);
+			h = min(width,height);
+			xc = xupleft ;
+			yc = yupleft ;
+			points =  Plot_points[0];
+
+			Real_Vector y = Plot_y[0];
+
+			Real	count = 0., value;
+
+			for (i = 0; i < points; i++) count += y[i];
+			if (count == 0.) break;
+
+			double	a1 = 0.,
+					a2 = 0.;
+
+			for (i = 0; i < points; i++)
+			{
+				TeLegendEntry slice = (*sliceVector)[i];
+				TeColor cor = slice.visual(TePOLYGONS)->color ();
+				value = y[i]/count;
+				a2 += value*360.;
+				setFillAreaColor(cor);
+				fillArc (xc, yc, w, h, a1, a2, cor);
+				if (value > .08)
+				{
+					char percent[16];
+					sprintf (percent,"     %.1f",value*100);
+					drawText (xc+w/2, yc+h/2, percent, (a1+a2)/2);
+				}
+				a1 = a2;
+			}
+			pieLegends ();
+		}
+		else if (Input_format[curva] == BAR_BINARY)
+		{
+		//-------------------------------------
+		//           ^
+		//	     |	    .....
+		//	     |	    :   :....
+		//	     |	    :   :   :
+		//	     |	....:   :   :    
+		//	     |  :   :   :   :
+		//           |__:_|_:_|_:_|_:____
+		//                1   2   3 
+		//------------------------------------- 
+			int		x1, y1, x2, y2;
+			int i;
+
+//			Real_Vector	x = Plot_x[0],
+//					y = Plot_y[0];
+			Real_Vector	x = Plot_x[curva],
+					y = Plot_y[curva];
+ 
+//   			setLineAttributes(Graph_color.curve[0],0,0);
+//			setFillAreaColor(Graph_color.curve[0]);
+   			setLineAttributes(Graph_color.curve[curva],TeLnTypeContinuous,0);
+			setFillAreaColor(Graph_color.curve[curva]);
+
+			for (i = 0; i < Plot_points[curva]; i++)
+			{
+				// Juan begin
+				if(sliceVector)
+				{
+					TeLegendEntry slice = (*sliceVector)[i];
+					TeColor cor = slice.visual(TePOLYGONS)->color ();
+					setFillAreaColor (cor);
+				}
+				// Juan end
+//				if (i < Plot_points[0]-1)
+				if (i < Plot_points[curva]-1)
+				{
+	        			value_to_pixel(x[i], y[i], &x1, &y1);
+	        			value_to_pixel(x[i+1], y[i+1], &x2, &y2);
+					if ((height + yupleft - y1 - 1) > 0)
+	        				fillRectangle(x1-(x2-x1)/2, y1, (x2-x1-2), height + yupleft - y1);
+				}
+				else
+				{
+	        			value_to_pixel(x[i-1], y[i-1], &x1, &y1);
+	        			value_to_pixel(x[i], y[i], &x2, &y2);
+					if ((height + yupleft - y2 - 1) > 0)
+	        				fillRectangle(x2-(x2-x1)/2, y2, (x2-x1-2), height + yupleft - y2);
+				}
+			}
+			draw_plot();
+		}
+		else if (Input_format[curva] == ROSE_BINARY)
+		{
+			int i;
+  			int x1, y1, x2, y2;
+			int	a1 = 0,
+				a2 = 0;
+			Real_Vector	x = Plot_x[0],
+					y = Plot_y[0];
+
+			plot_title(Plot_label.title);
+
+			for (i = 0; i < Plot_points[0]-1; i++)
+			{
+				if (y[i]==0.)continue;
+				a1 = (int)(x[i] * 64.);
+				a2 = (int)(x[i+1] * 64.) - a1;
+        		value_to_pixel(-y[i], y[i], &x1, &y1);
+        		value_to_pixel(y[i], -y[i], &x2, &y2);
+				fillArc (x1, y1, x2-x1, y2-y1, a1, a2, Graph_color.curve[0]);
+			}
+
+			Real step = ymaxval / (Real)major_tick;
+
+			for(Real j = step ; j <= ymaxval; j += step )
+			{ 
+        			value_to_pixel(-j, j, &x1, &y1);
+        			value_to_pixel(j, -j, &x2, &y2);
+
+   				setLineAttributes(Graph_color.lines,TeLnTypeContinuous,0);
+				drawArc(x1, y1, x2-x1, y2-y1,0,360*64,Graph_color.lines);
+			}
+		}
+		else if (Input_format[curva] == POINT_BINARY)
+		{
+			draw_plot();
+		
+        		for (int j = 0; j < Plot_points[curva]; j ++)
+				plotSymbol(Plot_x[curva][j], Plot_y[curva][j], Symbol[curva], GPpointwidth, GPpointheight, curva);
+
+		}
+		else
+		{
+			if (drawplot)
+			{
+				draw_plot();
+				drawplot = false;
+			}
+
+			plot_curve(Plot_x[curva], Plot_y[curva], Plot_points[curva],Graph_color.curve[curva]);
+		
+			if (Plot_symbols)
+				draw_symbols(curva);
+		}
+	}
+}
+
+//---------------------------------------------------------------------------------
+void
+TeGraphPlot :: draw_plot(void)
+{
+
+	plot_axes();
+	plot_ticks();
+//	if (Options.grid[1] == 'n')
+	plot_grid();
+	plot_labels();
+	plot_title(Plot_label.title);
+	plot_xaxis(Plot_label.xaxis);
+	plot_yaxis(Plot_label.yaxis);
+//	if (Options.legend[1] == 'n') 
+	drawLegend();
+}
+
+//---------------------------------------------------------------------------------
+void
+TeGraphPlot :: setSymbolType(int type, int curve)
+{
+	if(curve>=0 && curve<=9)
+		Symbol[curve] = type;
+}
+
+//---------------------------------------------------------------------------------
+void
+TeGraphPlot :: draw_symbols(int curve)
+{
+	int i, step;
+
+	if (Plot_symbols > 0)
+	{
+		step = Plot_points[curve]/Plot_symbols;
+		if (Plot_points[curve] % Plot_symbols != 0) step++;
+		for (i = 0; i < Plot_points[curve]; i += step)
+			plotSymbol(Plot_x[curve][i], Plot_y[curve][i], Symbol[curve], GPpointwidth, GPpointheight, curve);
+	}
+}
+
+//---------------------------------------------------------------------------------
+void
+TeGraphPlot :: plot_axes(void)
+{
+    setLineAttributes(Graph_color.lines,TeLnTypeContinuous,0);
+    drawRectangle(xupleft, yupleft, width, height);
+}
+
+//---------------------------------------------------------------------------------
+void
+TeGraphPlot :: plot_ticks(void)
+{
+    int i, x, y, maximum, delta, length;
+    int x_ticks = x_major * x_minor;
+    int y_ticks = y_major * y_minor;
+
+    setLineAttributes(Graph_color.lines,TeLnTypeContinuous,0);
+	delta = (width-1)/x_ticks;
+	x = xupleft + delta;
+	y = yupleft + 1;
+	maximum = yupleft + height ;
+	for (i = 1; i < x_ticks; i++)
+	{
+		if (i % x_minor == 0)
+			length = major_tick;
+		else
+			length = minor_tick;
+		drawLine(x, y, x, y + length );
+		drawLine(x, maximum, x, maximum - length );
+		x += delta;
+	}
+	delta = (height-1)/y_ticks;
+	x = xupleft + 1;
+	y = yupleft + delta;
+	maximum = xupleft + width -1;
+	for (i = 1; i < y_ticks; i++)
+	{
+		if (i % y_minor == 0)
+			length = major_tick;
+		else
+			length = minor_tick;
+		drawLine(x, y, x + length , y);
+		drawLine(maximum, y, maximum - length , y);
+		y += delta;
+	}
+}
+
+void TeGraphPlot :: plot_grid(void)
+{
+    	int i, x, y, maximum, delta;
+    	setLineAttributes(Graph_color.grid,TeLnTypeDotted,0);
+    	delta = (width-1)/x_major;
+    	x = xupleft + delta;
+    	maximum = yupleft + height - major_tick - 1;
+    	for (i = 1; i < x_major; i++)
+		{
+        	y = yupleft + 1 + major_tick;
+ //       	while (y < maximum) {
+ //           		drawPoint (x,y);
+ //           		y += 3;
+ //       	}
+			drawLine(x,y,x,maximum);
+        	x += delta;
+    	}
+    	delta = (height-1)/y_major;
+    	y = yupleft + delta;
+    	maximum = xupleft + width - major_tick - 1;
+    	for (i = 1; i < y_major; i++)
+		{
+        	x = xupleft + 1 + major_tick;
+ //       	while (x < maximum) {
+ //           		drawPoint (x,y);
+ //           		x += 4;
+ //         }
+			drawLine(x,y,maximum,y);
+        	y += delta;
+    	}
+}
+
+int TeGraphPlot :: plot_labels(void)
+{
+    char text[80];
+    int i, x, y, delta, font;
+    int digits_left, digits_right, exp_flag;
+    Real value, values[3];
+	setTextColor(Graph_color.text);
+
+	if ((font = set_font(label_font)) == ERR) return ERR;
+	values[0] = yminval;
+	values[1] = ymaxval;
+	values[2] = (values[1] - values[0]) / y_major;
+	label_format(values, 3, label_field, &digits_left, &digits_right, &exp_flag);
+	delta = (height-1) / y_major;
+	y = yupleft - label_height/2;
+	value = ymaxval;
+	Yaxis_x = xupleft;
+	for (i = 0; i <= y_major; i++)
+	{
+		ftos(value, digits_left, digits_right, exp_flag, text);
+		x = xupleft - strlen(text) * label_width - label_width/2;
+		if (x < Yaxis_x)
+			Yaxis_x = x;
+		drawText (x, y+8, text);
+		y += delta;
+		value -= values[2];
+	}
+	if (yaxis_direct == HORIZ_FONT)
+	{
+		Yaxis_x -= (yaxis_width + label_width/2);
+		if (Yaxis_x < 0)
+			Yaxis_x = 0;
+	}
+	else
+	{
+		Yaxis_x -= label_width/2;
+		if (Yaxis_x < yaxis_height)
+			Yaxis_x = yaxis_height;
+	}
+	values[0] = xminval;
+	values[1] = xmaxval;
+	values[2] = (values[1] - values[0]) / x_major;
+	label_format(values, 3, label_field, &digits_left, &digits_right, &exp_flag);
+	delta = (width-1) / x_major;
+	y = yupleft + height + label_height/2;
+	value = xminval;
+	for (i = 0; i <= x_major; i++)
+	{
+		ftos(value, digits_left, digits_right, exp_flag, text);
+		x = xupleft + i*delta - strlen(text) * label_width / 2;
+		drawText (x, y+8, text);
+		value += values[2];
+		if (x_major > 5)
+		{
+			i++;
+			value += values[2];
+          	// if (x_major > 9) {
+           	//     	i++;
+            	//    	value += values[2];
+           	//}
+		}
+	}
+//    	set_font(font);
+	return 0;
+}
+
+int TeGraphPlot :: plot_title(char *text)
+{
+    	int font;
+    	if ((font = set_font(title_font)) == ERR) return ERR;
+    	plot_horiz(text, Title_y, title_width);
+    	set_font(font);
+    	return 0;
+}
+
+int TeGraphPlot :: plot_xaxis(char *text)
+{
+    	int font;
+    	if ((font = set_font(xaxis_font)) == ERR) return ERR;
+    	plot_horiz(text, Xaxis_y, xaxis_width);
+    	set_font(font);
+	return 0;
+}
+
+void
+TeGraphPlot :: plot_horiz(char *text, int y, int w)
+{
+    	int x, l, count;
+    	char *ptr = NULL,buffer[80];
+    	setTextColor(Graph_color.text);
+    	l = strlen(text);
+    	x = xupleft + (width-1)/2 - (l * w)/2;
+    	ptr = text;
+    	if (x < xupleft) {
+        	count = (xupleft - x)/w;
+        	buffer[79] = '\0';
+        	strncpy(buffer, text, sizeof(buffer)-1);
+        	buffer[l-count-1] = '\0';
+        	x = xupleft;
+        	ptr = buffer;
+    	}
+    	drawText (x, y, ptr);
+    	ptr = NULL;
+}
+
+int
+TeGraphPlot :: plot_yaxis(char *text)
+{
+    int y, length, count, font, delta;
+	char *ptr= NULL, buffer[80], c[2];
+    setTextColor(Graph_color.text);
+	c[0] = '*'; c[1] = '\0';
+	if ((font = set_font(yaxis_font)) == ERR) return ERR;
+	length = strlen(text);
+	ptr = text;
+	delta = yaxis_direct == HORIZ_FONT ?
+            yaxis_height : yaxis_width;
+	y = (Title_y + Xaxis_y + delta * length) / 2;
+	buffer[79] = '\0';
+	strncpy(buffer, text, sizeof(buffer)-1);
+	if (y < Title_y)
+	{
+		count = 2 * (Title_y - y)/delta;
+		buffer[length-count-1] = '\0';
+		y = Title_y;
+		ptr = buffer;
+	}
+	if (yaxis_direct == HORIZ_FONT)
+	{
+		while (*ptr != '\0')
+		{
+			c[0] = *ptr++;
+			drawText (Yaxis_x, y, c);
+			y += yaxis_height;
+		}
+	}
+	else
+		drawText (Yaxis_x, y, ptr, 90.);
+	ptr = NULL;
+
+	set_font(font);
+	return 0;
+}
+
+int
+TeGraphPlot :: plot_curve(Real_Vector x, Real_Vector y,int points,TeColor c)
+{
+    	int i, count;
+
+	setLineAttributes(c,TeLnTypeContinuous,0);
+
+    	count = plot_point(x[0], y[0], PEN_UP);
+    	for (i = 1; i < points; i++)
+        	count += plot_point(x[i], y[i], PEN_DOWN);
+    	return count;
+}
+
+int
+TeGraphPlot :: plot_point(Real x_value, Real y_value, int pen_status)
+{
+    static Real last_x_value, last_y_value;
+    static int last_x, last_y;
+    Real temp_x, temp_y;
+    int x, y, status=0;
+
+    if (point_visible(x_value, y_value))
+	{
+        value_to_pixel(x_value, y_value, &x, &y);
+        if (pen_status == PEN_UP)
+		{
+//				SET_PIXEL(x, y, color);
+		}
+        else
+		{
+            if (!point_visible(last_x_value, last_y_value))
+			{
+				temp_x = last_x_value;
+				temp_y = last_y_value;
+                find_intersect(x_value, y_value, &temp_x, &temp_y);
+                value_to_pixel(temp_x, temp_y, &last_x,	&last_y);
+            }
+			if (last_y_value < TeMAXFLOAT)
+            	drawLine(last_x, last_y, x, y);
+        }
+        last_x = x;
+        last_y = y;
+        status = 1;
+    }
+    else if (pen_status == PEN_DOWN && point_visible(last_x_value, last_y_value))
+	{
+		if (y_value < TeMAXFLOAT)
+		{
+			temp_x = x_value;
+			temp_y = y_value;
+			find_intersect(last_x_value, last_y_value, &temp_x, &temp_y);
+			value_to_pixel(temp_x, temp_y, &x, &y);
+			drawLine(last_x, last_y, x, y);
+		}
+        status = 0;
+    }
+    last_x_value = x_value;
+   	last_y_value = y_value;
+    return status;
+}
+
+int
+TeGraphPlot :: plotSymbol(Real x_value, Real y_value, int symbol, int w, int h, int curve)
+{
+    int x, y;
+
+	setLineAttributes(Graph_color.symbol[curve],TeLnTypeContinuous,1);
+
+	if (point_visible(x_value, y_value))
+	{
+        	value_to_pixel(x_value, y_value, &x, &y);
+        	draw_symbol(x, y, symbol, w, h);
+        	return true;
+    }
+    return false;
+}
+
+void
+TeGraphPlot :: draw_symbol(int x, int y,int symbol, int w, int h)
+{
+	if( symbol < 0 )		//V2.0-01 GAIA
+	{
+		symbol = 0;
+	}
+	symbol = symbol % 5;		//V2.0-01 GAIA
+
+    	switch (symbol)
+	{
+        case RECTANGLE:
+            	drawLine(x - w/2, y - h/2, x + w/2, y - h/2);
+		drawLine(x + w/2, y - h/2, x + w/2, y + h/2);
+		drawLine(x + w/2, y + h/2, x - w/2, y + h/2);
+            	drawLine(x - w/2, y + h/2, x - w/2, y - h/2);
+		break;
+
+        case TRIANGLE:
+		drawLine(x - w/2, y + h/2, x, y - h/2);
+		drawLine(x, y - h/2, x + w/2, y + h/2);
+            	drawLine(x + w/2, y + h/2, x - w/2, y + h/2);
+            	break;
+
+        case DIAMOND:
+            	drawLine(x - w/2, y, x, y - h/2);
+            	drawLine(x, y - h/2, x + w/2, y);
+            	drawLine(x + w/2, y, x, y + h/2);
+            	drawLine(x, y + h/2, x - w/2, y);
+            	break;
+
+        case SCROSS:
+            	drawLine(x - w/2, y, x + w/2, y);
+		drawLine(x, y - h/2, x, y + h/2);
+		break;
+
+        case XCROSS:
+		drawLine(x - w/2, y + h/2, x + w/2, y - h/2);
+		drawLine(x - w/2, y - h/2, x + w/2, y + h/2);
+		break;
+    	}
+}
+
+
+void TeGraphPlot :: draw_symbol_legend(int x, int y, int symbol, int w, int h)
+{
+	if( symbol < 0 )		//V2.0-01 GAIA
+	{
+		symbol = 0;
+	}
+	symbol = symbol % 5;		//V2.0-01 GAIA
+
+    	switch (symbol)
+	{
+        case RECTANGLE:
+		drawLine(x - w/2, y - h/2, x + w/2, y - h/2);
+		drawLine(x + w/2, y - h/2, x + w/2, y + h/2);
+		drawLine(x + w/2, y + h/2, x - w/2, y + h/2);
+		drawLine(x - w/2, y + h/2, x - w/2, y - h/2);
+		break;
+
+        case TRIANGLE:
+		drawLine(x - w/2, y + h/2, x, y - h/2);
+		drawLine(x, y - h/2, x + w/2, y + h/2);
+		drawLine(x + w/2, y + h/2, x - w/2, y + h/2);
+		break;
+
+        case DIAMOND:
+		drawLine(x - w/2, y, x, y - h/2);
+		drawLine(x, y - h/2, x + w/2, y);
+		drawLine(x + w/2, y, x, y + h/2);
+		drawLine(x, y + h/2, x - w/2, y);
+		break;
+
+        case SCROSS:
+		drawLine(x - w/2, y, x + w/2, y);
+		drawLine(x, y - h/2, x, y + h/2);
+		break;
+
+        case XCROSS:
+		drawLine(x - w/2, y + h/2, x + w/2, y - h/2);
+		drawLine(x - w/2, y - h/2, x + w/2, y + h/2);
+		break;
+    }
+}
+
+
+void
+TeGraphPlot :: label_format(Real values[], int nvalues, int field_width,
+                   int *digits_left, int *digits_right, int *exp_flag)
+{
+	char *str = NULL;
+	int i, j, digits, decimal, sign, trail0;
+
+	digits = sizeof(Real) == sizeof(float) ? FLT_DIG : DBL_DIG;
+	*digits_left = *digits_right = *exp_flag = 0;
+    	for (i = 0; i < nvalues && *exp_flag == 0; i++) {
+		str = ecvt(values[i], digits, &decimal, &sign);
+        	if (decimal > *digits_left) *digits_left = decimal;
+        	for (j = digits-1, trail0 = 0; j >= 0 && str[j] == '0'; j--) trail0++;
+        	j = digits - trail0 - decimal;
+        	if (j > *digits_right) *digits_right = j;
+        	if (*digits_right + *digits_left > field_width-2) {
+            		*exp_flag = 1;
+            		*digits_left = 1;
+            		*digits_right = field_width - 8;
+            		if (*digits_right < 0) *digits_right = 0;
+        	}
+    	}
+   	 str = NULL;
+}
+
+void TeGraphPlot :: find_intersect(Real x_in, Real y_in,
+                    Real *x_out, Real *y_out)
+{
+    	// find values for x_out and y_out that intersect the
+       	// plot boundary on a line between the points (x_in, y_in) inside
+       	// the plot region and (x_out, y_out) outside the plot region
+
+    	Real m, b, temp_x, temp_y;
+    	m = (y_in - *y_out) / (x_in - *x_out);
+    	b = y_in - m * x_in;
+    	if (*x_out >= xminval && *x_out <= xmaxval) {
+        	// only y_out is outside plot region
+        	if (*y_out < yminval) *y_out = yminval;
+        	else if (*y_out > ymaxval) *y_out = ymaxval;
+        	*x_out = (*y_out - b) / m;
+    	}
+    	else
+	{ 
+		if (*y_out >= yminval && *y_out <= ymaxval) {
+        		// only x_out is outside plot region
+        		if (*x_out < xminval) *x_out = xminval;
+        		else if (*x_out > xmaxval) *x_out = xmaxval;
+        		*y_out = *x_out * m + b;
+    		}
+		else
+		{
+        		// both x_out and y_out are outside plot region
+        		if (*y_out < yminval) temp_y = yminval;
+        		else temp_y = ymaxval;
+        		temp_x = (temp_y - b) / m;
+        		if (temp_x >= xminval && temp_x <= xmaxval) {
+            			*y_out = temp_y;
+            			*x_out = temp_x;
+        		}
+        		else {
+            			if (*x_out < xminval) *x_out = xminval;
+            			else *x_out = xmaxval;
+            			*y_out = *x_out * m + b;
+			}
+		}
+	}
+}
+
+//----------------------------------------------------------------------------------------
+void
+TeGraphPlot :: drawLegend(void)
+{
+    int x, y, h, delta;
+    int i, count = 0;
+
+	for (i = 0; i < Plot_curves; i++)
+	{
+        if (Plot_label.curve[i][0] != '\0') count++;
+	}
+
+    if (count != 0)
+	{
+       	h = Font_height[0] + 4;
+		if (count > 3) h += Font_height[0] + 3;
+        y = getHeight() - h;
+
+		setLineAttributes(Graph_color.lines,TeLnTypeContinuous,0);
+		drawRectangle(0, y, width - 1, h);
+
+        x = Font_width[0] + 1;
+		delta = Font_height[0] + 3;
+        for (count = 0, i = 0; i < Plot_curves; i++)
+	{
+            if (Plot_label.curve[i][0] != '\0' && count < 7)
+			{
+                if (count++ == 3) {
+                    x = Font_width[0] + 1;
+                    y += Font_height[0] + 6;
+                }
+
+				setLineAttributes(Graph_color.curve[i],TeLnTypeContinuous,0);
+				draw_symbol_legend(x, y + delta - Font_height[0]/2, Symbol[i], 7, 7);
+                x += Font_width[0];
+
+				setTextColor(Graph_color.text);
+                drawText (x, y + delta - Font_height[0], Plot_label.curve[i]);
+				x += 10 * Font_width[0];
+            }
+        }
+	}
+}
+
+//----------------------------------------------------------------------------------------
+void
+TeGraphPlot :: value_to_pixel(Real x_value, Real y_value, int *x_pixel, int *y_pixel)
+{
+	*x_pixel = (int) ((x_value - xminval) /
+               (xmaxval - xminval) * (width - 1) + xupleft);
+	*y_pixel = (int) ((ymaxval - y_value) /
+               (ymaxval - yminval) * (height - 1) + yupleft);
+}
+
+//----------------------------------------------------------------------------------------
+void
+TeGraphPlot :: pixelToValue(int x_pixel, int y_pixel, Real& x_value, Real& y_value)
+{
+	x_value = (Real) (x_pixel - xupleft) / (width-1) *
+               (xmaxval - xminval) + xminval;
+	y_value = (Real) (yupleft - y_pixel) / (height-1) *
+               (ymaxval - yminval) + ymaxval;
+}
+
+//----------------------------------------------------------------------------------------
+int
+TeGraphPlot :: point_visible(Real x, Real y)
+{
+    	if (x >= xminval && x <= xmaxval &&
+        y >= yminval && y <= ymaxval) return 1;
+    	else return 0;
+}
+
+//FAMI0395 int set_font(int font_number)
+int set_font(int)
+{
+/*
+    	static int font;
+    	int previous_font;
+	// set font to specified font number
+	if (_set_font(font_number) == 0) {
+        	previous_font = font;
+        	font = font_number;
+        	return previous_font;
+    	}
+    	else {
+        	video_err = FONT_ERR;
+        	return ERR;
+    	} */
+
+	return (int)true;	//FAMI0394
+}
+
+void ftos(Real f, int digits_left, int digits_right, int exp_flag, char *s)
+{
+	int i = 0, decimal, sign;
+	char *str = NULL;
+	str = ecvt(f, digits_left+digits_right, &decimal, &sign);
+	if (sign) *s++ = '-';
+	if (exp_flag)
+	{ 	/* exponential format */
+		for (i=0; i < digits_left; i++) *s++ = *str++;
+		*s++ = '.';
+		for (i=0; i < digits_right; i++) *s++ = *str++;
+		*s++ = 'e';
+		decimal -= digits_left;
+		if (decimal < 0)
+		{
+			*s++ = '-';
+			decimal = -decimal;
+		}
+		else *s++ = '+';
+		s += 3;
+		*s-- = '\0';
+		for (i = 0; i < 3; i++)
+		{
+			*s-- = (char) (decimal % 10 + (int) '0');
+			decimal /= 10;
+		}
+	}
+	else
+	{          /* fixed point format */
+		if (decimal <= 0)
+		{
+			if (digits_left > 0) *s++ = '0';
+			if (digits_right > 0) *s++ = '.';
+			for (i = decimal; i != 0 && digits_right > 0 ; i++)
+			{
+				*s++ = '0';
+				digits_right--;
+			}
+			for (i = 0; i < digits_right; i++) *s++ = *str++;
+		}
+		else
+		{
+			for (i = 0; i < decimal; i++) *s++ = *str++;
+			if (digits_right > 0)
+			{
+				*s++ = '.';
+				for (i = 0; i < digits_right; i++) *s++ = *str++;
+			}
+		}
+		*s = '\0';
+	}
+	str = NULL;
+}
+
+//----------------------------------------------------------------------------------------
+
+void
+TeGraphPlot :: plotInit(int pixels_above, int pixels_below, int pixels_left, int pixels_right)
+{
+// initialize Plot variables, reserving the number of pixels specified by
+// pixels_above, pixels_below, pixels_left, and pixels_right for use by
+// the program
+
+	int delta, x_ticks, y_ticks;
+
+// initialize variables appropriately for current plotting device
+	X_pixels = getWidth ();
+	Y_pixels = getHeight ();
+
+    get_plot_fonts();
+    get_font_size(title_font, &title_width, &title_height);
+    get_font_size(label_font, &label_width, &label_height);
+    get_font_size(xaxis_font, &xaxis_width, &xaxis_height);
+    yaxis_direct = get_font_size(yaxis_font, &yaxis_width, &yaxis_height);
+    delta = yaxis_direct == HORIZ_FONT ? yaxis_width : yaxis_height;
+	xupleft = pixels_left + delta + (label_field + 1) * label_width;
+    delta = title_height + label_height/2;
+    yupleft = pixels_above + delta + title_height;
+    Title_y = yupleft - delta;
+
+// make width of Plot region a multiple of x_ticks
+	x_ticks = x_major * x_minor;
+	width = (X_pixels - pixels_right - xupleft -
+		label_field * label_width / 2 + 1)
+		/x_ticks*x_ticks + 1;
+
+// make height of Plot region a multiple of y_ticks
+	y_ticks = y_major * y_minor;
+	delta = 2 * label_height + 1;
+	height = (Y_pixels - pixels_below - yupleft - delta -
+		xaxis_height)/y_ticks*y_ticks + 1;
+
+// define y coordinate for x axis title
+	Xaxis_y = yupleft + height - 1 + delta;
+}
+
+//----------------------------------------------------------------------------------------
+void
+TeGraphPlot :: get_plot_fonts()
+{
+    	title_font = 0;
+    	label_font = 0;
+    	xaxis_font = 0;
+    	yaxis_font = 1;
+}
+
+//----------------------------------------------------------------------------------------
+int
+TeGraphPlot :: get_font_size(int font_number, int *w, int *h)
+{
+// return width, height, and direction of specified font number
+	if (font_number < FONT_MAX)
+	{
+		*w = Font_width[font_number];
+		*h = Font_height[font_number];
+		return Font_direct[font_number];
+	}
+	else
+	{
+		return ERR;
+	}
+}
+
+//----------------------------------------------------------------------------------------
+void
+TeGraphPlot :: reset()
+{
+	for (int i=0; i<Plot_curves; i++)
+	{
+		Plot_x[i] = NULL;
+		Plot_y[i] = NULL;
+	}
+
+	Plot_curves = 0;  
+	Plot_symbols = 0;  
+	Curve_choice = 0;         
+	Plot_choice = 0;
+}
+
+void TeGraphPlot::drawMoranText (double dx1, double dy1, double dx2, double dy2)
+{
+	int	w, h, x, y;
+	int x1, y1, x2, y2, mx, my;
+
+	setTextColor(Graph_color.text);
+
+	value_to_pixel(dx1, dy1, &x1, &y1);
+	value_to_pixel(dx2, dy2, &x2, &y2);
+	value_to_pixel(0., 0., &mx, &my);
+
+	string tx = "AA";
+	textExtent(tx, w, h);
+	x = (int)(mx + (double)(x2-mx)/2. - (double)w/2.);
+	y = (int)(my - (double)(my-y2)/2. + (double)h/2.);
+	drawText(x, y, (char*)tx.c_str());
+
+	tx = "AB"; 
+	textExtent(tx, w, h);
+	x = (int)(mx - (double)(mx-x1)/2. - (double)w/2.);
+	drawText(x, y, (char*)tx.c_str());
+
+	tx = "BB"; 
+	textExtent(tx, w, h);
+	y = (int)(my + (double)(y1-my)/2. + (double)h/2.);
+	drawText(x, y, (char*)tx.c_str());
+
+	tx = "BA"; 
+	textExtent(tx, w, h);
+	x = (int)(mx + (double)(x2-mx)/2. - (double)w/2.);
+	drawText(x, y, (char*)tx.c_str());
+}
diff --git a/src/terralib/kernel/TeGraph.h b/src/terralib/kernel/TeGraph.h
old mode 100755
new mode 100644
index c971aee..71e4622
--- a/src/terralib/kernel/TeGraph.h
+++ b/src/terralib/kernel/TeGraph.h
@@ -1,182 +1,182 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeGraph.h
-    \brief This file deals with graphs in TerraLib
-*/
-
-#ifndef __TERRALIB_INTERNAL_GRAPH_H
-#define __TERRALIB_INTERNAL_GRAPH_H
-
-#include "TeLegendEntry.h"
-#define CURVES_MAX   10
-#define AXIS_MAX     64
-#define TITLE_MAX    64
-#define LABEL_MAX    64
-
-#define XY_ASCII   0
-#define XY_BINARY  1
-#define XYY_ASCII  2
-#define XYY_BINARY 3
-#define PIE_BINARY 4
-#define BAR_BINARY 5
-#define ROSE_BINARY 6
-#define POINT_BINARY 7
-
-#define Real double
-typedef Real* Real_Vector;
-typedef struct {
-	char title[TITLE_MAX+1];
-	char xaxis[AXIS_MAX+1];
-	char yaxis[AXIS_MAX+1];
-	char curve[CURVES_MAX][LABEL_MAX+1];
-} Labels;
-
-class TL_DLL TeGraphPlot
-{
-protected:
-	int label_field;       /* maximum no. of characters in a label field */
-	int major_tick;        /* length of major tick mark (in pixels) */
-	int minor_tick;        /* length of minor tick mark (in pixels) */
-	int x_major;           /* number of x axis divisions */
-	int y_major;           /* number of y axis divisions */
-	int x_minor;           /* number of x axis subdivisions */
-	int y_minor;           /* number of y axis subdivisions */
-	Real xminval;          /* minimum value on x axis */
-	Real xmaxval;          /* maximum value on x axis */
-	Real yminval;          /* minimum value on y axis */
-	Real ymaxval;          /* maximum value on y axis */
-	int xupleft;           /* x pixel coordinate (upper left) */
-	int yupleft;           /* y pixel coordinate (upper left) */
-	int width;             /* width of axes (in pixels) */
-	int height;            /* height of axes (in pixels) */
-	int label_width;       /* width of label character */
-	int label_height;      /* height of label character */
-	int label_font;        /* font number to use for labels */
-	int title_width;       /* width of title characters */
-	int title_height;      /* height of title characters */
-	int title_font;        /* font number to use for title */
-	int xaxis_width;       /* width of x axis characters */
-	int xaxis_height;      /* height of x axis characters */
-	int xaxis_font;        /* font number to use for x axis */
-	int yaxis_width;       /* width of y axis characters */
-	int yaxis_height;      /* height of y axis characters */
-	int yaxis_font;        /* font number to use for y axis */
-	int yaxis_direct;      /* direction of y axis characters */
-	int X_pixels;          /* number of pixels in horizontal direction */
-	int Y_pixels;          /* number of pixels in vertical direction */
-	int Xaxis_y;           /* y pixel coordinate of X axis title */
-	int Yaxis_x;           /* x pixel coordinate of Y axis title */
-	int Title_y;           /* y pixel coordinate of main title */
-
-
-	int Plot_curves;       /* number of curves */
-	int Plot_symbols;      /* maximum number of symbols on curve */
-	int Curve_choice;      /* number of selected curve */
-	int Plot_choice;       /* graphics menu item choice */
-	int Plot_points[CURVES_MAX];    /* number of points in each curve */
-	Real_Vector Plot_x[CURVES_MAX]; /* X data points for each curve */
-	Real_Vector Plot_y[CURVES_MAX]; /* Y data points for each curve */
-	Labels Plot_label;              /* labels for title, axes, and curves */
-
-	int Scale_curve;           /* number of curve to scale (-1 for all) */
-	int Scale_factor;          /* used to scale Y axis for printing */
-	int Output_format;         /* output format for xywrite */
-	int Input_format[CURVES_MAX];          /* format of file loaded */
-	char Data_filename[13];    /* name of last file loaded */
-	TeLegendEntryVector* sliceVector;/* vector of TeLegendEntry */
-	TeColor GPpcor;			   /*piechart color */
-	char *GPpieleg;
-	int GPpointwidth, GPpointheight;
-
-// Private members
-
-	void	draw_plot(void);
-	void	draw_symbols(int curve);
-	void	plot_axes(void);
-	void	plot_ticks(void);
-	void	plot_grid(void);
-	int		plot_labels(void);
-	int		plot_title(char *text);
-	int		plot_xaxis(char *text);
-	int		plot_yaxis(char *text);
-	int     point_visible(Real x, Real y);
-	void    value_to_pixel(Real x_value, Real y_value, int *x_pixel, int *y_pixel);
-	int     plot_curve(Real_Vector x, Real_Vector y, int points, TeColor c);
-	void    label_format(Real values[], int nvalues, int field_width, int *digits_left, int *digits_right, int *exp_flag);
-	void	plot_horiz(char *text, int y, int width);
-	int     plot_point(Real x_value, Real y_value, int pen_status);
-	void    find_intersect(Real x_in, Real y_in, Real *x_out, Real *y_out);
-	void    draw_symbol(int x, int y, int symbol, int width, int height);
-	void    draw_symbol_legend(int x, int y, int symbol, int width, int height);
-	void    get_plot_fonts();
-	int		get_font_size(int font_number, int *width, int *height);
-
-	virtual int	getWidth () = 0;
-	virtual int	getHeight () = 0;
-   	virtual void	setLineAttributes(TeColor c, int , int ) = 0;
-	virtual void	setFillAreaColor (TeColor c) = 0;
-	virtual void	setTextColor (TeColor c) = 0;
-	virtual void	fillRectangle (int x, int y, int dx, int dy) = 0;
-	virtual void	drawRectangle (int x, int y, int dx, int dy) = 0;
-	virtual void	drawLine (int sx, int sy, int dx, int dy) = 0;
-	virtual void	drawText (int x, int y, char* str, double angle = 0.) = 0;
-	virtual void	fillArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c) = 0;
-	virtual void	drawArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c) = 0;
-	virtual void	textExtent ( string &str, int &w, int &h, double angle = 0.) = 0;
-
-// Public members
-
-public :
-	TeGraphPlot ();
-	virtual ~TeGraphPlot ();
-	int		loadDirect ( int format, int curv, int points, Labels& labels, Real_Vector x, Real_Vector y);
-	void	loadHistogram (TeLegendEntryVector& sv, const string& label);
-	void	loadPie (TeLegendEntryVector& sv, const string& label);
-	void	plotInit( int , int , int , int );
-	void	autoScale( void);
-	void	setScale( Real x1, Real x2 , Real y1, Real y2);
-	int		kill( int order);
-	int		plotSymbol( Real x_value, Real y_value,int symbol, int width, int height, int curve=0);
-	void	plotCurves (int with_simbols = 0);
-	void	pixelToValue( int x_p, int y_p, Real& x_v, Real& y_v);
-	void	reset();
-	void    setColorGrid( int , int , int );
-	void    setColorText( int , int , int );
-	void    setColorLine( int , int , int );
-	int		setColorCurve( int ,int , int , int );
-	void    setColorSymbol( int , int, int, int=-1, int=7, int=7); // r, g, b, curve, width, height
-	void    setSymbolType( int, int=0); // type , curve
-	void	drawLegend( void);
-	int		setGridSize( int );
-	int		setGridSize( int, int, int, int );
-	void 	drawMoranText (double x1, double y1, double x2, double y2);
-
-	void	pieLegends ();
-};
-
-// Utility functions
-
-TL_DLL void show_err(char *s);
-TL_DLL void ftos(Real f, int digits_left, int digits_right, int exp_flag, char *s);
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGraph.h
+    \brief This file deals with graphs in TerraLib
+*/
+
+#ifndef __TERRALIB_INTERNAL_GRAPH_H
+#define __TERRALIB_INTERNAL_GRAPH_H
+
+#include "TeLegendEntry.h"
+#define CURVES_MAX   10
+#define AXIS_MAX     64
+#define TITLE_MAX    64
+#define LABEL_MAX    64
+
+#define XY_ASCII   0
+#define XY_BINARY  1
+#define XYY_ASCII  2
+#define XYY_BINARY 3
+#define PIE_BINARY 4
+#define BAR_BINARY 5
+#define ROSE_BINARY 6
+#define POINT_BINARY 7
+
+#define Real double
+typedef Real* Real_Vector;
+typedef struct {
+	char title[TITLE_MAX+1];
+	char xaxis[AXIS_MAX+1];
+	char yaxis[AXIS_MAX+1];
+	char curve[CURVES_MAX][LABEL_MAX+1];
+} Labels;
+
+class TL_DLL TeGraphPlot
+{
+protected:
+	int label_field;       /* maximum no. of characters in a label field */
+	int major_tick;        /* length of major tick mark (in pixels) */
+	int minor_tick;        /* length of minor tick mark (in pixels) */
+	int x_major;           /* number of x axis divisions */
+	int y_major;           /* number of y axis divisions */
+	int x_minor;           /* number of x axis subdivisions */
+	int y_minor;           /* number of y axis subdivisions */
+	Real xminval;          /* minimum value on x axis */
+	Real xmaxval;          /* maximum value on x axis */
+	Real yminval;          /* minimum value on y axis */
+	Real ymaxval;          /* maximum value on y axis */
+	int xupleft;           /* x pixel coordinate (upper left) */
+	int yupleft;           /* y pixel coordinate (upper left) */
+	int width;             /* width of axes (in pixels) */
+	int height;            /* height of axes (in pixels) */
+	int label_width;       /* width of label character */
+	int label_height;      /* height of label character */
+	int label_font;        /* font number to use for labels */
+	int title_width;       /* width of title characters */
+	int title_height;      /* height of title characters */
+	int title_font;        /* font number to use for title */
+	int xaxis_width;       /* width of x axis characters */
+	int xaxis_height;      /* height of x axis characters */
+	int xaxis_font;        /* font number to use for x axis */
+	int yaxis_width;       /* width of y axis characters */
+	int yaxis_height;      /* height of y axis characters */
+	int yaxis_font;        /* font number to use for y axis */
+	int yaxis_direct;      /* direction of y axis characters */
+	int X_pixels;          /* number of pixels in horizontal direction */
+	int Y_pixels;          /* number of pixels in vertical direction */
+	int Xaxis_y;           /* y pixel coordinate of X axis title */
+	int Yaxis_x;           /* x pixel coordinate of Y axis title */
+	int Title_y;           /* y pixel coordinate of main title */
+
+
+	int Plot_curves;       /* number of curves */
+	int Plot_symbols;      /* maximum number of symbols on curve */
+	int Curve_choice;      /* number of selected curve */
+	int Plot_choice;       /* graphics menu item choice */
+	int Plot_points[CURVES_MAX];    /* number of points in each curve */
+	Real_Vector Plot_x[CURVES_MAX]; /* X data points for each curve */
+	Real_Vector Plot_y[CURVES_MAX]; /* Y data points for each curve */
+	Labels Plot_label;              /* labels for title, axes, and curves */
+
+	int Scale_curve;           /* number of curve to scale (-1 for all) */
+	int Scale_factor;          /* used to scale Y axis for printing */
+	int Output_format;         /* output format for xywrite */
+	int Input_format[CURVES_MAX];          /* format of file loaded */
+	char Data_filename[13];    /* name of last file loaded */
+	TeLegendEntryVector* sliceVector;/* vector of TeLegendEntry */
+	TeColor GPpcor;			   /*piechart color */
+	char *GPpieleg;
+	int GPpointwidth, GPpointheight;
+
+// Private members
+
+	void	draw_plot(void);
+	void	draw_symbols(int curve);
+	void	plot_axes(void);
+	void	plot_ticks(void);
+	void	plot_grid(void);
+	int		plot_labels(void);
+	int		plot_title(char *text);
+	int		plot_xaxis(char *text);
+	int		plot_yaxis(char *text);
+	int     point_visible(Real x, Real y);
+	void    value_to_pixel(Real x_value, Real y_value, int *x_pixel, int *y_pixel);
+	int     plot_curve(Real_Vector x, Real_Vector y, int points, TeColor c);
+	void    label_format(Real values[], int nvalues, int field_width, int *digits_left, int *digits_right, int *exp_flag);
+	void	plot_horiz(char *text, int y, int width);
+	int     plot_point(Real x_value, Real y_value, int pen_status);
+	void    find_intersect(Real x_in, Real y_in, Real *x_out, Real *y_out);
+	void    draw_symbol(int x, int y, int symbol, int width, int height);
+	void    draw_symbol_legend(int x, int y, int symbol, int width, int height);
+	void    get_plot_fonts();
+	int		get_font_size(int font_number, int *width, int *height);
+
+	virtual int	getWidth () = 0;
+	virtual int	getHeight () = 0;
+   	virtual void	setLineAttributes(TeColor c, int , int ) = 0;
+	virtual void	setFillAreaColor (TeColor c) = 0;
+	virtual void	setTextColor (TeColor c) = 0;
+	virtual void	fillRectangle (int x, int y, int dx, int dy) = 0;
+	virtual void	drawRectangle (int x, int y, int dx, int dy) = 0;
+	virtual void	drawLine (int sx, int sy, int dx, int dy) = 0;
+	virtual void	drawText (int x, int y, char* str, double angle = 0.) = 0;
+	virtual void	fillArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c) = 0;
+	virtual void	drawArc (int xc, int yc, int w, int h, double a1, double a2, TeColor c) = 0;
+	virtual void	textExtent ( string &str, int &w, int &h, double angle = 0.) = 0;
+
+// Public members
+
+public :
+	TeGraphPlot ();
+	virtual ~TeGraphPlot ();
+	int		loadDirect ( int format, int curv, int points, Labels& labels, Real_Vector x, Real_Vector y);
+	void	loadHistogram (TeLegendEntryVector& sv, const string& label);
+	void	loadPie (TeLegendEntryVector& sv, const string& label);
+	void	plotInit( int , int , int , int );
+	void	autoScale( void);
+	void	setScale( Real x1, Real x2 , Real y1, Real y2);
+	int		kill( int order);
+	int		plotSymbol( Real x_value, Real y_value,int symbol, int width, int height, int curve=0);
+	void	plotCurves (int with_simbols = 0);
+	void	pixelToValue( int x_p, int y_p, Real& x_v, Real& y_v);
+	void	reset();
+	void    setColorGrid( int , int , int );
+	void    setColorText( int , int , int );
+	void    setColorLine( int , int , int );
+	int		setColorCurve( int ,int , int , int );
+	void    setColorSymbol( int , int, int, int=-1, int=7, int=7); // r, g, b, curve, width, height
+	void    setSymbolType( int, int=0); // type , curve
+	void	drawLegend( void);
+	int		setGridSize( int );
+	int		setGridSize( int, int, int, int );
+	void 	drawMoranText (double x1, double y1, double x2, double y2);
+
+	void	pieLegends ();
+};
+
+// Utility functions
+
+TL_DLL void show_err(char *s);
+TL_DLL void ftos(Real f, int digits_left, int digits_right, int exp_flag, char *s);
+
+#endif
diff --git a/src/terralib/kernel/TeGridIndex.h b/src/terralib/kernel/TeGridIndex.h
old mode 100755
new mode 100644
index cfd3707..9884882
--- a/src/terralib/kernel/TeGridIndex.h
+++ b/src/terralib/kernel/TeGridIndex.h
@@ -1,413 +1,413 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeGridIndex.h
-    \brief This file contains an implementation of a fixed grid data structure.	
-*/
-
-#ifndef  __TERRALIB_INTERNAL_GRIDINDEX_H
-#define  __TERRALIB_INTERNAL_GRIDINDEX_H
-
-#include "TeGeometry.h"
-#include "TeIntersector.h"
-
-#include <map>
-
-/* 
- * WARNING:
- *
- *       1. This module IS UNDER DEVELOPMENT!
- *
- *       2. These data structures means to be used only in TerraLib kernel and should not be used by anyone because
- *          the support and interfaces can be changed in future.
- *
- */
-
-namespace TeSAM
-{
-/** @defgroup GridStructure Fixed Grid Data Structure
- *  TerraLib Fixed Grid Data Structure.
- *  @{
- */
-
-
-//! A class that represents a fixed grid
-/*!	
-	.	
-
-	WARNING:
-
-	1. XXXX
-
-	2. XXXX.
-
-	3. 
-
- */
-class TL_DLL TeGridIndex
-{
-	public:
-
-		//! grid column/line cell index
-		typedef pair<int, int> gridKey;							
-
-		//! grid structure
-		typedef multimap<gridKey, unsigned int> gridType;		// em cada linha e coluna podemos associar uma lista de outros objetos
-
-		double dx_;			//!< grid resolution in x axis.
-		double dy_;			//!< grid resolution in y axis.
-		int npartsX_;		//!< Number of columns
-		int npartsY_;		//!< Number of lines
-		double xi_;			//!< Lower left x.
-		double yi_;			//!< Lower left y.
-		double xf_;			//!< Upper right x.
-		double yf_;			//!< Upper right y.
-		gridType grid_;		//!< the grid.
-		unsigned int size_;	//!< Number of elements in the grid (if one element intersects more than one grid cell, they will count many times).
-
-	public:
-
-		//! Empty constructor
-		TeGridIndex()
-			: dx_(0.0), dy_(0.0), npartsX_(0), npartsY_(0), xi_(0.0), yi_(0.0), xf_(0.0), yf_(0.0), size_(0u)
-		{
-		}
-
-		//! Constructor of the grid
-		TeGridIndex(const TeBox& b, const double& resX, const double& resY)
-			: size_(0u)
-		{
-			setBox(b);
-
-			setResolution(resX, resY);			
-		}
-
-		//! Adjusts grid bounding box
-		void setBox(const TeBox& b)
-		{
-			xi_ = b.x1_;
-			yi_ = b.y1_;
-
-			xf_ = b.x2_;
-			yf_ = b.y2_;
-		}
-
-		//! Returns the number of associatade cells
-		unsigned int size() const
-		{
-			return size_;
-		}
-
-		//! Sets grid resolution factor
-		void setResolution(const double& resX, const double& resY)
-		{
-			dx_ = resX;
-			dy_ = resY;
-
-			if((dx_ <= 0.0) || (dy_ <= 0.0))
-			{
-				npartsX_ = 0;
-				npartsY_ = 0;
-			}
-			else
-			{
-				npartsX_ = TeRound((xf_ - xi_) / dx_) + 1;
-				npartsY_ = TeRound((yf_ - yi_) / dy_) + 1;
-			}
-		}
-
-		//! Return number of columns
-		int getNumCols() const
-		{
-			return npartsX_;
-		}
-		
-		//! Return number of lines
-		int getNumLines() const
-		{
-			return npartsY_;
-		}
-
-		//! Tells if the grid definition is correct
-		bool isValid() const
-		{
-			return (npartsX_ != 0 && npartsY_ != 0);
-		}
-
-
-		//! Inserts an item with one coordinate
-		void insert(const TeCoord2D& c, const unsigned int& itemId)
-		{
-			int col = int((c.x_ - xi_) / dx_);
-			int line = int((c.y_ - yi_) / dy_);
-
-			gridKey key(col, line);
-
-			grid_.insert(gridType::value_type(key, itemId));
-
-			++size_;
-		}
-
-		//! Returns lower and upper grid positions
-		void getIndex(const TeCoord2D& c1, const TeCoord2D& c2, int& col1, int& line1, int& col2, int& line2)
-		{
-			double lowerX = ((c1.x_ < c2.x_) ? c1.x_ : c2.x_);
-			double lowerY = ((c1.y_ < c2.y_) ? c1.y_ : c2.y_);
-			double upperX = ((c1.x_ > c2.x_) ? c1.x_ : c2.x_);
-			double upperY = ((c1.y_ > c2.y_) ? c1.y_ : c2.y_);
-
-			col1 = int((lowerX - xi_) / dx_);
-			line1 = int((lowerY - yi_) / dy_);
-			col2 = int((upperX - xi_) / dx_) + 1;
-			line2 = int((upperY - yi_) / dy_) + 1;	
-		}
-
-		//! Inserts intem into the grid
-		void insert(const TeCoord2D& c1, const TeCoord2D& c2, const unsigned int& itemId)
-		{
-			gridKey key(0, 0);
-
-			int col1;
-			int line1;
-			int col2;
-			int line2;
-
-			getIndex(c1, c2, col1, line1, col2, line2);
-
-			for(int i = col1; i <= col2; ++i)
-			{
-				key.first  = i;
-
-				for(int j = line1; j <= line2; ++j)
-				{
-					
-					key.second = j;
-
-					grid_.insert(gridType::value_type(key, itemId));
-
-					++size_;
-				}
-			}
-		}
-
-		//! Put line segments over the grid cells
-		void indexLine(const TeLine2D& l)
-		{
-			unsigned int nstep = l.size() - 1;
-
-			for(unsigned int i = 0; i < nstep; ++i)
-				insert(l[i], l[i+1], i);
-		}
-
-		//! Return a reference for internal grid representation
-		gridType& getGrid()
-		{
-			return grid_;
-		}
-
-		//! Only for debug purpose
-		void getLines(TeLineSet& lset)
-		{
-			for(int i = 0; i <= npartsX_; ++i)
-			{
-				TeCoord2D c1, c2;
-				c1.x_ = xi_ + dx_ * i;
-				c1.y_ = yi_;
-				
-				c2.x_ = xi_ + dx_ * i;
-				c2.y_ = yi_ + npartsY_ * dy_;
-
-				TeLine2D l;
-
-				l.add(c1); l.add(c2);
-
-				lset.add(l);
-			}
-
-			for(int j = 0; j <= npartsY_; ++j)
-			{
-				TeCoord2D c1, c2;
-				c1.x_ = xi_;
-				c1.y_ = yi_ + dy_ * j;
-				
-				c2.x_ = xi_ + npartsX_ * dx_;
-				c2.y_ = yi_ + dy_ * j;
-
-				TeLine2D l;
-
-				l.add(c1); l.add(c2);
-
-				lset.add(l);
-			}
-		}		
-
-	private:
-
-		//! No copy allowed
-		TeGridIndex(const TeGridIndex& rhs);
-
-		//! No copy allowed
-		TeGridIndex& operator=(const TeGridIndex& rhs);
-
-};	// end of class TeGridIndex
-
-//! Get average length os segments in each direction
-TL_DLL inline void getAverage(const TeLine2D& l, double& dx, double& dy)
-{
-	unsigned int nstep = l.size() - 1;
-
-	double sumX = 0.0;
-	double sumY = 0.0;
-
-	for(unsigned int i = 0; i < nstep; ++i)
-	{
-		sumX += fabs(l[i + 1].x_ - l[i].x_);
-		sumY += fabs(l[i + 1].y_ - l[i].y_);
-	}
-
-	dx = (sumX / double(nstep)) * 8.0;
-	dy = (sumY / double(nstep)) * 8.0;
-
-	return;
-}
-
-//! Computes intersections
-TL_DLL inline bool TeSafeIntersectionsGrid(const TeLine2D& redLine, const TeLine2D& blueLine, TeINTERSECTOR2::TeVectorBoundaryIP& report, const unsigned int& redObjId = 0, const unsigned int& blueObjId = 0)
-{
-	double dx = 0.0;
-	double dy = 0.0;
-	
-	getAverage(redLine, dx, dy);
-
-	TeGridIndex redGrid(redLine.box(), dx, dy);
-
-	redGrid.indexLine(redLine);
-
-    TeGridIndex::gridKey key(0, 0);
-
-	int colmax = redGrid.getNumCols();
-	int colmin = 0;
-	int linemax = redGrid.getNumLines();
-	int linemin = 0;	
-
-	int col1 = 0;
-	int col2 = 0;
-	int line1 = 0;
-	int line2 = 0;
-
-	bool hasIntersections = false;
-
-	TeSegmentIntersectionType t = TeImproperIntersection;
-
-// Para cada segmento azul, verificar os quadrantes interceptados
-	unsigned int nStep = blueLine.size() - 1;
-
-	for(unsigned int k = 0; k < nStep; ++k)
-	{
-		redGrid.getIndex(blueLine[k], blueLine[k+1], col1, line1, col2, line2);
-
-		if((col2 < colmin) || (line2 < linemin) || (col1 > colmax) || (line1 > linemax))
-			continue;
-
-		//if(((col1 > colmax) && (col2 > colmax)) || ((line1 > linemax) && (line2 > linemax)))
-		//	continue;
-
-		if(col1 < colmin)
-			col1 = colmin;
-		
-		if(col2 > colmax)
-			col2 = colmax;
-
-		if(line1 < linemin)
-			line1 = linemin;
-
-        if(line2 > linemax)
-			line2 = linemax;
-
-		for(int col = col1; col <= col2; ++col)
-			for(int lin = line1; lin <= line2; ++lin)
-			{
-				key.first  = col;
-				key.second = lin;
-
-				pair<TeGridIndex::gridType::iterator, TeGridIndex::gridType::iterator> its = redGrid.getGrid().equal_range(key);
-
-				while(its.first != its.second)
-				{
-					TeINTERSECTOR2::TeBoundaryIP ip;
-
-					if(TeINTERSECTOR2::TeIntersection(redLine[its.first->second], redLine[its.first->second + 1], blueLine[k], blueLine[k+1], ip, t))
-					{
-						hasIntersections = true;
-
-						ip.redPartNum_ = redObjId;
-						ip.redSegNum_ = its.first->second;
-						ip.bluePartNum_ = blueObjId;
-						ip.blueSegNum_ = k;
-
-						if(ip.coords_.size() == 2)	//overlap
-						{
-							// Verificar se os pontos est�o em ordem crescente
-							if(ip.coords_[0].x_ < ip.coords_[1].x_)
-							{
-								report.push_back(ip);
-							}
-							else if(ip.coords_[0].x_ > ip.coords_[1].x_)
-							{
-								swap(ip.coords_[0], ip.coords_[1]);
-								report.push_back(ip);
-							}
-							else if(ip.coords_[0].y_ < ip.coords_[1].y_)
-							{
-								report.push_back(ip);						
-							}
-							else
-							{
-								swap(ip.coords_[0], ip.coords_[1]);
-								
-								report.push_back(ip);						
-							}
-						}
-						else
-						{
-							report.push_back(ip);
-						}
-					}
-
-					++(its.first);
-				}
-			}
-	}
-
-	return hasIntersections;
-}
-
-/** @} */ 
-
-};	// end namespace TeSAM
-
-
-#endif	// __TERRALIB_INTERNAL_GRIDINDEX_H
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGridIndex.h
+    \brief This file contains an implementation of a fixed grid data structure.	
+*/
+
+#ifndef  __TERRALIB_INTERNAL_GRIDINDEX_H
+#define  __TERRALIB_INTERNAL_GRIDINDEX_H
+
+#include "TeGeometry.h"
+#include "TeIntersector.h"
+
+#include <map>
+
+/* 
+ * WARNING:
+ *
+ *       1. This module IS UNDER DEVELOPMENT!
+ *
+ *       2. These data structures means to be used only in TerraLib kernel and should not be used by anyone because
+ *          the support and interfaces can be changed in future.
+ *
+ */
+
+namespace TeSAM
+{
+/** @defgroup GridStructure Fixed Grid Data Structure
+ *  TerraLib Fixed Grid Data Structure.
+ *  @{
+ */
+
+
+//! A class that represents a fixed grid
+/*!	
+	.	
+
+	WARNING:
+
+	1. XXXX
+
+	2. XXXX.
+
+	3. 
+
+ */
+class TL_DLL TeGridIndex
+{
+	public:
+
+		//! grid column/line cell index
+		typedef pair<int, int> gridKey;							
+
+		//! grid structure
+		typedef multimap<gridKey, unsigned int> gridType;		// em cada linha e coluna podemos associar uma lista de outros objetos
+
+		double dx_;			//!< grid resolution in x axis.
+		double dy_;			//!< grid resolution in y axis.
+		int npartsX_;		//!< Number of columns
+		int npartsY_;		//!< Number of lines
+		double xi_;			//!< Lower left x.
+		double yi_;			//!< Lower left y.
+		double xf_;			//!< Upper right x.
+		double yf_;			//!< Upper right y.
+		gridType grid_;		//!< the grid.
+		unsigned int size_;	//!< Number of elements in the grid (if one element intersects more than one grid cell, they will count many times).
+
+	public:
+
+		//! Empty constructor
+		TeGridIndex()
+			: dx_(0.0), dy_(0.0), npartsX_(0), npartsY_(0), xi_(0.0), yi_(0.0), xf_(0.0), yf_(0.0), size_(0u)
+		{
+		}
+
+		//! Constructor of the grid
+		TeGridIndex(const TeBox& b, const double& resX, const double& resY)
+			: size_(0u)
+		{
+			setBox(b);
+
+			setResolution(resX, resY);			
+		}
+
+		//! Adjusts grid bounding box
+		void setBox(const TeBox& b)
+		{
+			xi_ = b.x1_;
+			yi_ = b.y1_;
+
+			xf_ = b.x2_;
+			yf_ = b.y2_;
+		}
+
+		//! Returns the number of associatade cells
+		unsigned int size() const
+		{
+			return size_;
+		}
+
+		//! Sets grid resolution factor
+		void setResolution(const double& resX, const double& resY)
+		{
+			dx_ = resX;
+			dy_ = resY;
+
+			if((dx_ <= 0.0) || (dy_ <= 0.0))
+			{
+				npartsX_ = 0;
+				npartsY_ = 0;
+			}
+			else
+			{
+				npartsX_ = TeRound((xf_ - xi_) / dx_) + 1;
+				npartsY_ = TeRound((yf_ - yi_) / dy_) + 1;
+			}
+		}
+
+		//! Return number of columns
+		int getNumCols() const
+		{
+			return npartsX_;
+		}
+		
+		//! Return number of lines
+		int getNumLines() const
+		{
+			return npartsY_;
+		}
+
+		//! Tells if the grid definition is correct
+		bool isValid() const
+		{
+			return (npartsX_ != 0 && npartsY_ != 0);
+		}
+
+
+		//! Inserts an item with one coordinate
+		void insert(const TeCoord2D& c, const unsigned int& itemId)
+		{
+			int col = int((c.x_ - xi_) / dx_);
+			int line = int((c.y_ - yi_) / dy_);
+
+			gridKey key(col, line);
+
+			grid_.insert(gridType::value_type(key, itemId));
+
+			++size_;
+		}
+
+		//! Returns lower and upper grid positions
+		void getIndex(const TeCoord2D& c1, const TeCoord2D& c2, int& col1, int& line1, int& col2, int& line2)
+		{
+			double lowerX = ((c1.x_ < c2.x_) ? c1.x_ : c2.x_);
+			double lowerY = ((c1.y_ < c2.y_) ? c1.y_ : c2.y_);
+			double upperX = ((c1.x_ > c2.x_) ? c1.x_ : c2.x_);
+			double upperY = ((c1.y_ > c2.y_) ? c1.y_ : c2.y_);
+
+			col1 = int((lowerX - xi_) / dx_);
+			line1 = int((lowerY - yi_) / dy_);
+			col2 = int((upperX - xi_) / dx_) + 1;
+			line2 = int((upperY - yi_) / dy_) + 1;	
+		}
+
+		//! Inserts intem into the grid
+		void insert(const TeCoord2D& c1, const TeCoord2D& c2, const unsigned int& itemId)
+		{
+			gridKey key(0, 0);
+
+			int col1;
+			int line1;
+			int col2;
+			int line2;
+
+			getIndex(c1, c2, col1, line1, col2, line2);
+
+			for(int i = col1; i <= col2; ++i)
+			{
+				key.first  = i;
+
+				for(int j = line1; j <= line2; ++j)
+				{
+					
+					key.second = j;
+
+					grid_.insert(gridType::value_type(key, itemId));
+
+					++size_;
+				}
+			}
+		}
+
+		//! Put line segments over the grid cells
+		void indexLine(const TeLine2D& l)
+		{
+			unsigned int nstep = l.size() - 1;
+
+			for(unsigned int i = 0; i < nstep; ++i)
+				insert(l[i], l[i+1], i);
+		}
+
+		//! Return a reference for internal grid representation
+		gridType& getGrid()
+		{
+			return grid_;
+		}
+
+		//! Only for debug purpose
+		void getLines(TeLineSet& lset)
+		{
+			for(int i = 0; i <= npartsX_; ++i)
+			{
+				TeCoord2D c1, c2;
+				c1.x_ = xi_ + dx_ * i;
+				c1.y_ = yi_;
+				
+				c2.x_ = xi_ + dx_ * i;
+				c2.y_ = yi_ + npartsY_ * dy_;
+
+				TeLine2D l;
+
+				l.add(c1); l.add(c2);
+
+				lset.add(l);
+			}
+
+			for(int j = 0; j <= npartsY_; ++j)
+			{
+				TeCoord2D c1, c2;
+				c1.x_ = xi_;
+				c1.y_ = yi_ + dy_ * j;
+				
+				c2.x_ = xi_ + npartsX_ * dx_;
+				c2.y_ = yi_ + dy_ * j;
+
+				TeLine2D l;
+
+				l.add(c1); l.add(c2);
+
+				lset.add(l);
+			}
+		}		
+
+	private:
+
+		//! No copy allowed
+		TeGridIndex(const TeGridIndex& rhs);
+
+		//! No copy allowed
+		TeGridIndex& operator=(const TeGridIndex& rhs);
+
+};	// end of class TeGridIndex
+
+//! Get average length os segments in each direction
+TL_DLL inline void getAverage(const TeLine2D& l, double& dx, double& dy)
+{
+	unsigned int nstep = l.size() - 1;
+
+	double sumX = 0.0;
+	double sumY = 0.0;
+
+	for(unsigned int i = 0; i < nstep; ++i)
+	{
+		sumX += fabs(l[i + 1].x_ - l[i].x_);
+		sumY += fabs(l[i + 1].y_ - l[i].y_);
+	}
+
+	dx = (sumX / double(nstep)) * 8.0;
+	dy = (sumY / double(nstep)) * 8.0;
+
+	return;
+}
+
+//! Computes intersections
+TL_DLL inline bool TeSafeIntersectionsGrid(const TeLine2D& redLine, const TeLine2D& blueLine, TeINTERSECTOR2::TeVectorBoundaryIP& report, const unsigned int& redObjId = 0, const unsigned int& blueObjId = 0)
+{
+	double dx = 0.0;
+	double dy = 0.0;
+	
+	getAverage(redLine, dx, dy);
+
+	TeGridIndex redGrid(redLine.box(), dx, dy);
+
+	redGrid.indexLine(redLine);
+
+    TeGridIndex::gridKey key(0, 0);
+
+	int colmax = redGrid.getNumCols();
+	int colmin = 0;
+	int linemax = redGrid.getNumLines();
+	int linemin = 0;	
+
+	int col1 = 0;
+	int col2 = 0;
+	int line1 = 0;
+	int line2 = 0;
+
+	bool hasIntersections = false;
+
+	TeSegmentIntersectionType t = TeImproperIntersection;
+
+// Para cada segmento azul, verificar os quadrantes interceptados
+	unsigned int nStep = blueLine.size() - 1;
+
+	for(unsigned int k = 0; k < nStep; ++k)
+	{
+		redGrid.getIndex(blueLine[k], blueLine[k+1], col1, line1, col2, line2);
+
+		if((col2 < colmin) || (line2 < linemin) || (col1 > colmax) || (line1 > linemax))
+			continue;
+
+		//if(((col1 > colmax) && (col2 > colmax)) || ((line1 > linemax) && (line2 > linemax)))
+		//	continue;
+
+		if(col1 < colmin)
+			col1 = colmin;
+		
+		if(col2 > colmax)
+			col2 = colmax;
+
+		if(line1 < linemin)
+			line1 = linemin;
+
+        if(line2 > linemax)
+			line2 = linemax;
+
+		for(int col = col1; col <= col2; ++col)
+			for(int lin = line1; lin <= line2; ++lin)
+			{
+				key.first  = col;
+				key.second = lin;
+
+				pair<TeGridIndex::gridType::iterator, TeGridIndex::gridType::iterator> its = redGrid.getGrid().equal_range(key);
+
+				while(its.first != its.second)
+				{
+					TeINTERSECTOR2::TeBoundaryIP ip;
+
+					if(TeINTERSECTOR2::TeIntersection(redLine[its.first->second], redLine[its.first->second + 1], blueLine[k], blueLine[k+1], ip, t))
+					{
+						hasIntersections = true;
+
+						ip.redPartNum_ = redObjId;
+						ip.redSegNum_ = its.first->second;
+						ip.bluePartNum_ = blueObjId;
+						ip.blueSegNum_ = k;
+
+						if(ip.coords_.size() == 2)	//overlap
+						{
+							// Verificar se os pontos est�o em ordem crescente
+							if(ip.coords_[0].x_ < ip.coords_[1].x_)
+							{
+								report.push_back(ip);
+							}
+							else if(ip.coords_[0].x_ > ip.coords_[1].x_)
+							{
+								swap(ip.coords_[0], ip.coords_[1]);
+								report.push_back(ip);
+							}
+							else if(ip.coords_[0].y_ < ip.coords_[1].y_)
+							{
+								report.push_back(ip);						
+							}
+							else
+							{
+								swap(ip.coords_[0], ip.coords_[1]);
+								
+								report.push_back(ip);						
+							}
+						}
+						else
+						{
+							report.push_back(ip);
+						}
+					}
+
+					++(its.first);
+				}
+			}
+	}
+
+	return hasIntersections;
+}
+
+/** @} */ 
+
+};	// end namespace TeSAM
+
+
+#endif	// __TERRALIB_INTERNAL_GRIDINDEX_H
+
+
+
+
diff --git a/src/terralib/kernel/TeGroupingAlgorithms.cpp b/src/terralib/kernel/TeGroupingAlgorithms.cpp
old mode 100755
new mode 100644
index 41c0124..0f4754d
--- a/src/terralib/kernel/TeGroupingAlgorithms.cpp
+++ b/src/terralib/kernel/TeGroupingAlgorithms.cpp
@@ -1,112 +1,112 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeGroupingAlgorithms.h"
-
-void
-TeGroupByUniqueValue(vector<string>& vec, TeAttrDataType tipo, vector<TeSlice>& result, int precision)
-{
-	unsigned int i, j;
-		
-	if (tipo == TeINT)
-	{
-		vector<int> v;
-		for (i = 0; i < vec.size(); ++i)
-			v.push_back(atoi(vec[i].c_str()));
-		sort(v.begin(), v.end());
-
-		for (i = 0; i < v.size(); ++i)
-			vec[i] = Te2String(v[i]);
-	}
-	else if (tipo == TeREAL)
-	{
-		vector<double> v;
-		for (i = 0; i < vec.size(); ++i)
-		{
-			double a = atof(vec[i].c_str());
-			v.push_back(a);
-		}
-		stable_sort(v.begin(), v.end());
-
-		for (i = 0; i < v.size(); ++i)
-			vec[i] = Te2String(v[i], precision);
-	}
-	else
-	{
-		sort(vec.begin(), vec.end());
-	}
-
-	// Check the elements that are equal, incrementing
-	// the variable count associated to each one
-	int count = 1;
-	TeSlice slice;
-	unsigned int sz = vec.size();
-	for (i = 0, j = 1; i < sz - 1 && j < sz; ++i, ++j)
-	{
-		if (vec[i] == vec[j])
-			++count;
-		else
-		{
-			slice.from_ = vec[i];
-			slice.count_ = count;
-			result.push_back(slice);
-			count = 1;
-		}
-	}
-
-   if ( (i>1) && (vec[i] == vec[i-1]) ) 
-   {
-       slice.from_ = vec[i];
-       slice.count_ = count;
-       result.push_back(slice);
-   }
-   else
-   {
-       slice.from_ = vec[i];
-       slice.count_ = 1;
-       result.push_back(slice);
-   } 
-}
-
-void
-TeGroupByEqualStep(double min, double max, int nstep, vector<TeSlice>& result, int precision)
-{
-	double slice = (max - min)/double(nstep);
-	int ns;
-	for (ns=0;ns<nstep;ns++)
-	{
-		TeSlice ps;
-		ps.count_ = 0;
-		ps.from_ = Te2String(min+double(ns)*slice, precision);
-		ps.to_ = Te2String(min+double(ns+1)*slice, precision);
-		result.push_back(ps);
-	}
-	min = TeAdjustToPrecision(min, precision, true);
-	result[0].from_ = Te2String(min, precision);
-	max = TeAdjustToPrecision(max, precision);
-	result[result.size()-1].to_ = Te2String(max, precision);
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeGroupingAlgorithms.h"
+
+void
+TeGroupByUniqueValue(vector<string>& vec, TeAttrDataType tipo, vector<TeSlice>& result, int precision)
+{
+	unsigned int i, j;
+		
+	if (tipo == TeINT)
+	{
+		vector<int> v;
+		for (i = 0; i < vec.size(); ++i)
+			v.push_back(atoi(vec[i].c_str()));
+		sort(v.begin(), v.end());
+
+		for (i = 0; i < v.size(); ++i)
+			vec[i] = Te2String(v[i]);
+	}
+	else if (tipo == TeREAL)
+	{
+		vector<double> v;
+		for (i = 0; i < vec.size(); ++i)
+		{
+			double a = atof(vec[i].c_str());
+			v.push_back(a);
+		}
+		stable_sort(v.begin(), v.end());
+
+		for (i = 0; i < v.size(); ++i)
+			vec[i] = Te2String(v[i], precision);
+	}
+	else
+	{
+		sort(vec.begin(), vec.end());
+	}
+
+	// Check the elements that are equal, incrementing
+	// the variable count associated to each one
+	int count = 1;
+	TeSlice slice;
+	unsigned int sz = vec.size();
+	for (i = 0, j = 1; i < sz - 1 && j < sz; ++i, ++j)
+	{
+		if (vec[i] == vec[j])
+			++count;
+		else
+		{
+			slice.from_ = vec[i];
+			slice.count_ = count;
+			result.push_back(slice);
+			count = 1;
+		}
+	}
+
+   if ( (i>1) && (vec[i] == vec[i-1]) ) 
+   {
+       slice.from_ = vec[i];
+       slice.count_ = count;
+       result.push_back(slice);
+   }
+   else
+   {
+       slice.from_ = vec[i];
+       slice.count_ = 1;
+       result.push_back(slice);
+   } 
+}
+
+void
+TeGroupByEqualStep(double min, double max, int nstep, vector<TeSlice>& result, int precision)
+{
+	double slice = (max - min)/double(nstep);
+	int ns;
+	for (ns=0;ns<nstep;ns++)
+	{
+		TeSlice ps;
+		ps.count_ = 0;
+		ps.from_ = Te2String(min+double(ns)*slice, precision);
+		ps.to_ = Te2String(min+double(ns+1)*slice, precision);
+		result.push_back(ps);
+	}
+	min = TeAdjustToPrecision(min, precision, true);
+	result[0].from_ = Te2String(min, precision);
+	max = TeAdjustToPrecision(max, precision);
+	result[result.size()-1].to_ = Te2String(max, precision);
+}
diff --git a/src/terralib/kernel/TeGroupingAlgorithms.h b/src/terralib/kernel/TeGroupingAlgorithms.h
old mode 100755
new mode 100644
index 089f1da..a8e827d
--- a/src/terralib/kernel/TeGroupingAlgorithms.h
+++ b/src/terralib/kernel/TeGroupingAlgorithms.h
@@ -1,281 +1,281 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeGroupingAlgorithms.h
-    \brief This file contains some generic grouping algorithms (based on iterators)
-*/
-
-#ifndef  __TERRALIB_INTERNAL_GROUPINGALGORITHMS_H
-#define  __TERRALIB_INTERNAL_GROUPINGALGORITHMS_H
-
-#include "TeDefines.h"
-#include "TeSlice.h"
-#include "TeUtils.h"
-#include "TeDataTypes.h"
-
-#include <math.h>
-#include <time.h>
-#include <algorithm>
-
-
-//! Finds the element with minimum value among the elements contained in a range of iterators
-template<typename It>
-void TeMinimumValue(It begin, It end, vector<double>& minValue, double dummy=-9999.99, bool usesDummy=false)
-{
-	for (int i=0; i<minValue.size(); i++)
-		minValue[i] = TeMAXFLOAT;
-
-	It it = begin;
-	double val;
-	while ( it != end) 
-	{
-		if (!(usesDummy && dummy == val))
-			for (int i=0; i<minValue.size(); i++)
-			{
-				val= (*it)[i];
-				if (val < minValue[i])
-					minValue[i] = val;
-			}
-		it++;
-	}
-}
-
-//! Finds the element with maximum value among the elements contained in a range of iterators
-template<typename It>
-void TeMaximumValue(It begin, It end, vector<double>& maxValue, double dummy=-9999.99, bool usesDummy=false)
-{
-	for (int i=0; i<maxValue.size(); i++)
-		maxValue[i] = -TeMAXFLOAT;
-
-	It it = begin;
-	double val;
-	while ( it != end) 
-	{
-		if (!(usesDummy && dummy == val))
-			for (int i=0; i<maxValue.size(); i++)
-			{
-				val= (*it)[i];
-				if (val > maxValue[i])
-					maxValue[i] = val;
-			}
-		it++;
-	}
-}
-
-//! Defines the classes (slices) of a equal step grouping
-TL_DLL void TeGroupByEqualStep(double min, double max, int nstep, vector<TeSlice>& result, int precision=0);
-
-/** @defgroup GenGroupAlg Generic Algorithms to do grouping
- *  A set of of generic functions to do grouping
- *  @{
- */
-
-//! Groups a set of elements defined by a range of iterators in nstep groups, using Equal Step algorithm
-template<class iterator>
-void TeGroupByEqualStep(iterator begin, iterator end, int nstep, vector<TeSlice>& result,
-				   int precision=0, bool countElements = true)
-{
-	double	min = TeMAXFLOAT;
-	double	max = -TeMAXFLOAT;
-
-	iterator it=begin;
-	while(it < end)
-	{
-		min = MIN(min, *it);
-		max = MAX(max, *it);
-		it++;
-	}
-	double slice = (max - min)/double(nstep);
-	int ns;
-	for (ns=0;ns<nstep;ns++)
-	{
-		TeSlice ps;
-		ps.count_ = 0;
-		ps.from_ = Te2String(min+double(ns)*slice, precision);
-		ps.to_ = Te2String(min+double(ns+1)*slice, precision);
-		result.push_back(ps);
-	}
-	min = TeAdjustToPrecision(min, precision, true);
-	result[0].from_ = Te2String(min, precision);
-	max = TeAdjustToPrecision(max, precision);
-	result[result.size()-1].to_ = Te2String(max, precision);
-
-	// Set the number of elements for each slice
-	if (countElements == true)
-		TeElemCountingBySlice(begin, end, result);
-}
-
-//! Groups a set of elements defined by a range of iterators in nstep groups, using Quantil algorithm
-template<class iterator>
-void TeGroupByQuantil(iterator begin, iterator end, int nstep, vector<TeSlice>& result,
-				 int precision = 0, bool countElements = true)
-{
-	sort(begin, end);
-
-	int size = end - begin;
-	double	step = (double)size / (double)nstep;
-
-	int	n = 0;
-	iterator it = begin;
-	while(it < end)
-	{
-		TeSlice	ps;
-		ps.from_ = Te2String((*it), precision);
-		int p = (int)(step * (double)++n + .5);
-		it = begin + p;
-		if(it < end)
-			ps.to_ = Te2String((*it), precision);
-		else
-			ps.to_ = Te2String(*(it-1), precision);
-		result.push_back(ps);
-	}
-	if(end-begin > 1)
-	{
-		double min = (*begin);
-		double max = (*(end-1));
-		min = TeAdjustToPrecision(min, precision, true);
-		result[0].from_ = Te2String(min, precision);
-		max = TeAdjustToPrecision(max, precision);
-		result[result.size()-1].to_ = Te2String(max, precision);
-	}
-
-	// Set the number of elements for each slice
-	if (countElements == true)
-		TeElemCountingBySlice(begin, end, result);
-}
-
-//! Groups a set of elements defined by a range of iterators in ndev groups, using Standanrd deviation algorithm
-template<class iterator>
-void TeGroupByStdDev(iterator begin, iterator end, double ndev, vector<TeSlice>& result, string& rmean,
-				int precision = 0, bool countElements = true)
-{
-	// Compute mim, max and mean
-	double	min = TeMAXFLOAT;
-	double	max = -TeMAXFLOAT;
-	long double	sum=0.;
-	long double	sm2=0.;
-	iterator it=begin;
-	while(it < end)
-	{
-		min = MIN(min, *it);
-		max = MAX(max, *it);
-		sum += (*it);
-		sm2 += ((*it) * (*it));
-		it++;
-	}
-	double cont = (double)(end - begin);
-	double	mean = (double)(sum/cont);
-	long double var = (sm2 / cont) - (mean * mean);
-	double	sdev = sqrt(var);
-
-	double	slice = sdev * ndev;
-
-	vector<TeSlice>	aux;
-	rmean = Te2String(mean, precision);
-	double	val = mean;
-	while(val-slice > min-slice)
-	{
-		TeSlice ps;
-		double v = val - slice;
-		ps.from_ = Te2String(v, precision);
-		ps.to_ = Te2String(val, precision);
-		aux.push_back(ps);
-		val = v;
-	}
-
-	std::vector<TeSlice>::reverse_iterator sit;
-
-	for(sit = aux.rbegin(); sit != aux.rend(); ++sit)
-	{
-		result.push_back(*sit);
-	}
-
-	string media = "mean = " + rmean;
-	TeSlice ps;
-	ps.from_ = media;
-	ps.to_.clear();
-	result.push_back(ps);
-	val = mean;
-	while(val+slice < max+slice)
-	{
-		TeSlice ps;
-		double	v = val + slice;
-		ps.from_ = Te2String(val, precision);
-		ps.to_ = Te2String(v, precision);
-		result.push_back(ps);
-		val = v;
-	}
-	if(result.size() > 2)
-	{
-		if (result[0].from_.find("mean")  == string::npos)
-		{
-			min = TeAdjustToPrecision(min, precision, true);
-			result[0].from_ = Te2String(min, precision);
-		}
-		if (result[result.size()-1].from_.find("mean")  == string::npos)
-		{
-			max = TeAdjustToPrecision(max, precision);
-			result[result.size()-1].to_ = Te2String(max, precision);
-		}
-	}
-
-	// Set the number of elements for each slice
-	if (countElements == true)
-		TeElemCountingBySlice(begin, end, result);
-}
-
-
-//! Counts the number of elements, from a general container, per slice of a vector of slices
-template<class iterator>
-void TeElemCountingBySlice(iterator begin, iterator end, vector<TeSlice>& result)
-{
-	iterator it;
-	double from, to;
-
-	for (unsigned int i = 0; i < result.size(); ++i)
-	{
-		TeSlice& sl = result[i];
-		sl.count_ = 0;
-		from = atof(sl.from_.c_str());
-		to = atof(sl.to_.c_str());
-		for (it = begin; it != end; ++it)
-		{
-			if (*it >= from && *it < to)
-				++sl.count_;
-		}
-	}
-}
-
-
-//! Groups a set of elements in a vector of string  using Unique Value algorithm
-TL_DLL void TeGroupByUniqueValue(vector<string>& vec, TeAttrDataType tipo, vector<TeSlice>& result, int precision);
-
-/** @} */ 
-#endif
-
-
-
-
-
- 
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeGroupingAlgorithms.h
+    \brief This file contains some generic grouping algorithms (based on iterators)
+*/
+
+#ifndef  __TERRALIB_INTERNAL_GROUPINGALGORITHMS_H
+#define  __TERRALIB_INTERNAL_GROUPINGALGORITHMS_H
+
+#include "TeDefines.h"
+#include "TeSlice.h"
+#include "TeUtils.h"
+#include "TeDataTypes.h"
+
+#include <math.h>
+#include <time.h>
+#include <algorithm>
+
+
+//! Finds the element with minimum value among the elements contained in a range of iterators
+template<typename It>
+void TeMinimumValue(It begin, It end, vector<double>& minValue, double dummy=-9999.99, bool usesDummy=false)
+{
+	for (int i=0; i<minValue.size(); i++)
+		minValue[i] = TeMAXFLOAT;
+
+	It it = begin;
+	double val;
+	while ( it != end) 
+	{
+		if (!(usesDummy && dummy == val))
+			for (int i=0; i<minValue.size(); i++)
+			{
+				val= (*it)[i];
+				if (val < minValue[i])
+					minValue[i] = val;
+			}
+		it++;
+	}
+}
+
+//! Finds the element with maximum value among the elements contained in a range of iterators
+template<typename It>
+void TeMaximumValue(It begin, It end, vector<double>& maxValue, double dummy=-9999.99, bool usesDummy=false)
+{
+	for (int i=0; i<maxValue.size(); i++)
+		maxValue[i] = -TeMAXFLOAT;
+
+	It it = begin;
+	double val;
+	while ( it != end) 
+	{
+		if (!(usesDummy && dummy == val))
+			for (int i=0; i<maxValue.size(); i++)
+			{
+				val= (*it)[i];
+				if (val > maxValue[i])
+					maxValue[i] = val;
+			}
+		it++;
+	}
+}
+
+//! Defines the classes (slices) of a equal step grouping
+TL_DLL void TeGroupByEqualStep(double min, double max, int nstep, vector<TeSlice>& result, int precision=0);
+
+/** @defgroup GenGroupAlg Generic Algorithms to do grouping
+ *  A set of of generic functions to do grouping
+ *  @{
+ */
+
+//! Groups a set of elements defined by a range of iterators in nstep groups, using Equal Step algorithm
+template<class iterator>
+void TeGroupByEqualStep(iterator begin, iterator end, int nstep, vector<TeSlice>& result,
+				   int precision=0, bool countElements = true)
+{
+	double	min = TeMAXFLOAT;
+	double	max = -TeMAXFLOAT;
+
+	iterator it=begin;
+	while(it < end)
+	{
+		min = MIN(min, *it);
+		max = MAX(max, *it);
+		it++;
+	}
+	double slice = (max - min)/double(nstep);
+	int ns;
+	for (ns=0;ns<nstep;ns++)
+	{
+		TeSlice ps;
+		ps.count_ = 0;
+		ps.from_ = Te2String(min+double(ns)*slice, precision);
+		ps.to_ = Te2String(min+double(ns+1)*slice, precision);
+		result.push_back(ps);
+	}
+	min = TeAdjustToPrecision(min, precision, true);
+	result[0].from_ = Te2String(min, precision);
+	max = TeAdjustToPrecision(max, precision);
+	result[result.size()-1].to_ = Te2String(max, precision);
+
+	// Set the number of elements for each slice
+	if (countElements == true)
+		TeElemCountingBySlice(begin, end, result);
+}
+
+//! Groups a set of elements defined by a range of iterators in nstep groups, using Quantil algorithm
+template<class iterator>
+void TeGroupByQuantil(iterator begin, iterator end, int nstep, vector<TeSlice>& result,
+				 int precision = 0, bool countElements = true)
+{
+	sort(begin, end);
+
+	int size = end - begin;
+	double	step = (double)size / (double)nstep;
+
+	int	n = 0;
+	iterator it = begin;
+	while(it < end)
+	{
+		TeSlice	ps;
+		ps.from_ = Te2String((*it), precision);
+		int p = (int)(step * (double)++n + .5);
+		it = begin + p;
+		if(it < end)
+			ps.to_ = Te2String((*it), precision);
+		else
+			ps.to_ = Te2String(*(it-1), precision);
+		result.push_back(ps);
+	}
+	if(end-begin > 1)
+	{
+		double min = (*begin);
+		double max = (*(end-1));
+		min = TeAdjustToPrecision(min, precision, true);
+		result[0].from_ = Te2String(min, precision);
+		max = TeAdjustToPrecision(max, precision);
+		result[result.size()-1].to_ = Te2String(max, precision);
+	}
+
+	// Set the number of elements for each slice
+	if (countElements == true)
+		TeElemCountingBySlice(begin, end, result);
+}
+
+//! Groups a set of elements defined by a range of iterators in ndev groups, using Standanrd deviation algorithm
+template<class iterator>
+void TeGroupByStdDev(iterator begin, iterator end, double ndev, vector<TeSlice>& result, string& rmean,
+				int precision = 0, bool countElements = true)
+{
+	// Compute mim, max and mean
+	double	min = TeMAXFLOAT;
+	double	max = -TeMAXFLOAT;
+	long double	sum=0.;
+	long double	sm2=0.;
+	iterator it=begin;
+	while(it < end)
+	{
+		min = MIN(min, *it);
+		max = MAX(max, *it);
+		sum += (*it);
+		sm2 += ((*it) * (*it));
+		it++;
+	}
+	double cont = (double)(end - begin);
+	double	mean = (double)(sum/cont);
+	long double var = (sm2 / cont) - (mean * mean);
+	double	sdev = sqrt(var);
+
+	double	slice = sdev * ndev;
+
+	vector<TeSlice>	aux;
+	rmean = Te2String(mean, precision);
+	double	val = mean;
+	while(val-slice > min-slice)
+	{
+		TeSlice ps;
+		double v = val - slice;
+		ps.from_ = Te2String(v, precision);
+		ps.to_ = Te2String(val, precision);
+		aux.push_back(ps);
+		val = v;
+	}
+
+	std::vector<TeSlice>::reverse_iterator sit;
+
+	for(sit = aux.rbegin(); sit != aux.rend(); ++sit)
+	{
+		result.push_back(*sit);
+	}
+
+	string media = "mean = " + rmean;
+	TeSlice ps;
+	ps.from_ = media;
+	ps.to_.clear();
+	result.push_back(ps);
+	val = mean;
+	while(val+slice < max+slice)
+	{
+		TeSlice ps;
+		double	v = val + slice;
+		ps.from_ = Te2String(val, precision);
+		ps.to_ = Te2String(v, precision);
+		result.push_back(ps);
+		val = v;
+	}
+	if(result.size() > 2)
+	{
+		if (result[0].from_.find("mean")  == string::npos)
+		{
+			min = TeAdjustToPrecision(min, precision, true);
+			result[0].from_ = Te2String(min, precision);
+		}
+		if (result[result.size()-1].from_.find("mean")  == string::npos)
+		{
+			max = TeAdjustToPrecision(max, precision);
+			result[result.size()-1].to_ = Te2String(max, precision);
+		}
+	}
+
+	// Set the number of elements for each slice
+	if (countElements == true)
+		TeElemCountingBySlice(begin, end, result);
+}
+
+
+//! Counts the number of elements, from a general container, per slice of a vector of slices
+template<class iterator>
+void TeElemCountingBySlice(iterator begin, iterator end, vector<TeSlice>& result)
+{
+	iterator it;
+	double from, to;
+
+	for (unsigned int i = 0; i < result.size(); ++i)
+	{
+		TeSlice& sl = result[i];
+		sl.count_ = 0;
+		from = atof(sl.from_.c_str());
+		to = atof(sl.to_.c_str());
+		for (it = begin; it != end; ++it)
+		{
+			if (*it >= from && *it < to)
+				++sl.count_;
+		}
+	}
+}
+
+
+//! Groups a set of elements in a vector of string  using Unique Value algorithm
+TL_DLL void TeGroupByUniqueValue(vector<string>& vec, TeAttrDataType tipo, vector<TeSlice>& result, int precision);
+
+/** @} */ 
+#endif
+
+
+
+
+
+ 
+
+
diff --git a/src/terralib/kernel/TeImportRaster.cpp b/src/terralib/kernel/TeImportRaster.cpp
old mode 100755
new mode 100644
index ec3694c..389125b
--- a/src/terralib/kernel/TeImportRaster.cpp
+++ b/src/terralib/kernel/TeImportRaster.cpp
@@ -1,935 +1,950 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeRasterRemap.h"
-#include "TeDecoderDatabase.h"
-#include "TeRaster.h"
-#include "TeDecoderMemory.h" 
-#include "TeRasterParams.h"
-#include "TeProgress.h"
-#include "TeVectorRemap.h"
-#include "TeImportRaster.h"
-//#include "TeLibJpegWrapper.h"
-
-
-TeLayer* 
-TeImportRaster (const string& layerName, TeRaster* rasterIn, TeDatabase* database)
-{
-	if (!database || layerName.empty() || !rasterIn || 
-		(rasterIn->params().status_ != TeRasterParams::TeReadyToRead && 
-		 rasterIn->params().status_ != TeRasterParams::TeReadyToWrite))
-		return 0;
-
-	// find a valid layer name
-	string newLayerName = layerName;
-	TeLayerMap& layerMap = database->layerMap();
-	TeLayerMap::iterator it;
-	bool flag = true;
-	int n = 1;
-	while (flag)
-	{
-		for (it = layerMap.begin(); it != layerMap.end(); ++it)
-		{
-			if (TeStringCompare(it->second->name(),newLayerName))
-				break;
-		}
-		if (it == layerMap.end())
-			flag = 0;
-		else
-			newLayerName = layerName + "_" +Te2String(n);
-		n++;	
-	}
-
-	TeLayer* newLayer = new TeLayer(newLayerName,database,rasterIn->projection());
-	if (newLayer->id() <= 0 )
-		return 0;				// couldn�t create new layer
-
-	// block dimension guessing
-	unsigned int bw = 512;
-	unsigned int bh = 512;		// an initial guess...
-
-	// if raster is up to 512x512 store it in one block
-	if (rasterIn->params().nlines_< 512 && rasterIn->params().ncols_< 512)
-	{
-		bw = rasterIn->params().ncols_;
-		bh = rasterIn->params().nlines_;
-	}
-	// if ncols<1024 build blocks of 1 line
-	else if (rasterIn->params().ncols_ < 1024)  
-	{
-		bw = rasterIn->params().ncols_;
-		bh = 1;
-	}
-
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	bool res = TeImportRaster(newLayer, rasterIn, bw, bh, TeRasterParams::TeNoCompression, 
-		"", rasterIn->params().dummy_[0], rasterIn->params().useDummy_, TeRasterParams::TeNoExpansible);
-	if (res)
-		return newLayer;
-
-	database->deleteLayer(newLayer->id());
-	return 0;
-}
-
-
-// This function mosaics an input raster to one previsously existing in a TerraLib layer
-bool TeMosaicRaster(TeRaster* rasterIn, TeLayer* layer,  const string& objectId)
-{
-
-	// layer must exist and input raster should be read to be read
-	if (!layer || !rasterIn  || rasterIn->params().status_ != TeRasterParams::TeReadyToRead)
-		return false;
-	
-	TeRaster* rasterOut;
-	if (!objectId.empty())	// if object id informed try to get raster associated to it
-		rasterOut = layer->raster(objectId,'w');
-	else					// else try to get first one found
-		rasterOut = layer->raster();
-
-	if (!rasterOut)			// no raster asked or no raster at all
-		return false;				// can not do mosaic
-
-	if (rasterOut->params().tiling_type_==TeRasterParams::TeNoExpansible)
-		return false;				// can mosaic if is not possible
-
-	// allows mosaic of same photometric types only
-	if (rasterOut->params().photometric_[0] != rasterIn->params().photometric_[0])
-		return false;
-
-	// increases output box to: input raster box + output raster box 
-  TeBox boxIn = rasterIn->params().boundingBox();
-
-	// if necessary remap input box to output projection 
-	if (!(*(rasterIn->projection()) == *(rasterOut->projection())))
-		boxIn = TeRemapBox(boxIn,rasterIn->projection(),rasterOut->projection());
-
-	// sum stored and input boxes
-	TeBox newBoxa = rasterOut->params().boundingBox();
-	updateBox(newBoxa,boxIn);	
-  
-  // adjust it to expansible values
-	TeBox newBox = adjustToCut(newBoxa, rasterOut->params().blockWidth_*rasterOut->params().resx_, 
-							   rasterOut->params().blockHeight_*rasterOut->params().resy_);
-
-	// update box in parameters of the raster and it's decoder
-	rasterOut->params().boundingBoxResolution(newBox.x1_,newBox.y1_,newBox.x2_,newBox.y2_,
-											  rasterOut->params().resx_, rasterOut->params().resy_);
-
-	rasterOut->decoder()->params().boundingBoxResolution(newBox.x1_,newBox.y1_,newBox.x2_,newBox.y2_,
-											  rasterOut->params().resx_, rasterOut->params().resy_);
-	rasterOut->params().nTilesInMemory_ = 0;
-	
-	// creates a remapping from input raster to output raster
-	TeRasterRemap remap(rasterIn, rasterOut);
-	if (remap.apply(true))			// o.k.
-	{
-		TeRasterParams rp = rasterOut->params();
-
-		// atualizes the representation box in memory
-		TeRepresentation* repp = layer->getRepresentation(TeRASTER);
-		TeBox boxNew = rp.box();
-		updateBox(repp->box_,rp.box());
-		repp->nCols_ = rp.ncols_;
-		repp->nLins_ = rp.nlines_;
-		repp->resX_ = rp.resx_;
-		repp->resY_ = rp.resy_;
-
-		// atualizes representation in the database
-		layer->database()->updateRasterRepresentation(layer->id(),rp,objectId);
-		layer->updateLayerBox(rp.boundingBox());
-		rasterOut->clear();
-		return true;
-	}
-	return false;
-}
-
-
-bool TeImportRaster (TeLayer* layer, TeRaster* rasterIn, 
-					 unsigned int bWidth, unsigned int bHeight,TeRasterParams::TeRasterCompressionMode compress,
-					 const string& objectId, double dummy, bool useDummy,
-					 TeRasterParams::TeRasterTilingType indext)
-{	
-
-	if (!layer || !rasterIn)
-		return false;
-
-	string objId;
-	if (objectId.empty())
-		objId = "O1";
-	else
-		objId = objectId;
-
-
-	// check if there  is a raster geometry to be modified
-	string tableGeo;
-	TeRepresentation* repp = 0;
-	repp = layer->getRepresentation(TeRASTER);
-	if (!repp || !layer->raster(objectId))	// layer doesn�t have any 
-	{										// or the desired raster geometry
-											// a new one should be created
-		TeProjection* projIn = rasterIn->projection();	
-		TeProjection* projOut = layer->projection();
-
-		TeRasterParams parOut = rasterIn->params();		// parameters of the raster being created	
-														// start with the same parameters as input raster
-		
-		parOut.setCompressionMode(compress);		// overwrites some parameters 
-		parOut.nTilesInMemory_ = 0;					// according to the specified in the interface
-		parOut.blockHeight_ = bHeight;
-		parOut.blockWidth_ = bWidth;
-		parOut.setDummy(dummy);
-		parOut.useDummy_ = useDummy;
-		parOut.tiling_type_ = indext;
-
-		TeBox newBox = rasterIn->params().boundingBox();
-
-		// if input raster has some rotation associated it has to be corrected 
-		// during the importing
-		if (parOut.dxI_ != 0. || parOut.dyJ_ != 0.)
-		{
-			parOut.boundingBoxResolution(newBox.x1_,newBox.y1_,newBox.x2_,newBox.y2_,parOut.resx_,parOut.resy_);
-			parOut.dxI_= 0.0;							  
-			parOut.dyJ_= 0.0;							 
-			parOut.dxJ_ = 0.0;
-			parOut.dyI_ = 0.0;	
-		}
-		
-		bool diffProj = false;
-		parOut.projection(projOut);
-		if (projIn && projOut && !(*projIn == *projOut))
-		{
-			diffProj = true;
-			TeBox boxIn = rasterIn->params().boundingBox();
-			newBox = TeRemapBox (boxIn,projIn,projOut);
-			parOut.resx_ = newBox.width()/parOut.ncols_;	// recalculates resolutions 
-			parOut.resy_ = newBox.height()/parOut.nlines_;  // for the new projection
-			parOut.boundingBoxResolution(newBox.x1_,newBox.y1_,newBox.x2_,newBox.y2_,parOut.resx_,parOut.resy_);
-			newBox = parOut.box();
-		}
-	
-		if (indext == TeRasterParams::TeExpansible)			// if mosaicable adjust box 
-			parOut.resizeToTiling(newBox,bWidth,bHeight);	// to be cut in blocks of bWidth X bHeight (in projection units)
-
-		parOut.decoderIdentifier_ = "DB";					// parameters of the decoder
-		parOut.fileName_ = "RasterLayer" + Te2String(layer->id()) + "_R_" + objId;
-
-		if (parOut.photometric_[0] == TeRasterParams::TePallete)
-			parOut.lutName_ = parOut.fileName_ + "_LUT";
-
-		if (!layer->addRasterGeometry(parOut,objId))		// creates the empty raster geometry
-			return false;
-
-		// create a decoder to raster in a TerraLib database 
-		parOut.mode_ = 'w';
-		TeDecoderDatabase *dbDecoder = new TeDecoderDatabase(parOut);
-		dbDecoder->setDB(layer->database());
-
-		// optimization: we don't need to go through remap routines.
-		// just cut the input raster and save the tiles
-		bool res=false;
-		TeRasterParams parF;
-		if (indext == TeRasterParams::TeNoExpansible && !diffProj)
-		{
-			int ntiles = (parOut.nlines_/parOut.blockHeight_)*(parOut.ncols_/parOut.blockWidth_);
-			if(TeProgress::instance())
-				TeProgress::instance()->setTotalSteps(ntiles);
-			int count = 0;
-			clock_t	ti, tf;
-			int x=0, y=0, b, nb=parOut.nBands(),lx, ly;
-			double val= parOut.dummy_[0];
-			TeMemoryPage page(parOut.blockHeight_*parOut.blockWidth_,val,parOut.dataType_[0]);
-			string index;
-			ti = clock();
-			while (y<parOut.nlines_)  // for each row of tiles
-			{
-				page.ulLin_ = y;
-				x=0;
-				while (x<parOut.ncols_)	// for each tile in a row
-				{
-					page.clear();
-					page.ulCol_= x;
-					for (b=0; b<nb; ++b)    // for each band;
-					{
-						for (ly=0; ly<parOut.blockHeight_; ++ly)
-						{
-							for (lx=0; lx<parOut.blockWidth_; ++lx)  // write the tile
-							{
-								if (rasterIn->getElement(x+lx,y+ly,val,b))
-								{
-									page.setVal(x+lx,y+ly,parOut.blockWidth_,val);
-									if (val<parOut.vmin_[b])
-										parOut.vmin_[b] = val;
-									if (val>parOut.vmax_[b])
-										parOut.vmax_[b] = val;
-								}
-							}
-						}
-						index = dbDecoder->codifyId(x,y,b,1,0);
-						if (!dbDecoder->putRasterBlock(index,page.data_,page.pageSize()))
-							res=false;
-						page.clear();
-					}
-					x+= parOut.blockWidth_;
-					++count;
-					if(TeProgress::instance())
-					{
-						tf = clock();
-						if (int((tf-ti)/CLOCKS_PER_SEC) > 3)
-						{
-							if (TeProgress::instance()->wasCancelled())
-								break;
-							TeProgress::instance()->setProgress(count);
-							ti = tf;
-						}
-					}
-				}
-				y+= parOut.blockHeight_;
-			}
-			if (TeProgress::instance())
-				TeProgress::instance()->reset();
-
-			// atualizes the representation box in memory
-			TeRepresentation* repp = layer->getRepresentation(TeRASTER);
-			updateBox(repp->box_,parOut.box());
-			repp->nCols_ = parOut.ncols_;
-			repp->nLins_ = parOut.nlines_;
-			repp->resX_ = parOut.resx_;
-			repp->resY_ = parOut.resy_;
-			layer->updateLayerBox(parOut.boundingBox());
-			layer->database()->updateRasterRepresentation(layer->id(),dbDecoder->params(),objectId);
-			// atualizes representation in the database
-			for (b=0; b<nb; ++b)
-			{
-				dbDecoder->params().vmax_[b]=parOut.vmax_[b];
-				dbDecoder->params().vmin_[b]=parOut.vmin_[b];
-			}
-			layer->database()->updateRasterRepresentation(layer->id(),dbDecoder->params(),objectId);
-			dbDecoder->clear();
-			res=true;
-		}
-		else
-		{
-			TeRaster* rasterOut = new TeRaster();
-			rasterOut->setDecoder(dbDecoder);
-			rasterOut->init();
-			TeRasterRemap remap(rasterIn, rasterOut);
-			if (remap.apply(true))
-			{
-				TeRepresentation* repp = layer->getRepresentation(TeRASTER);
-				updateBox(repp->box_,rasterOut->params().box());
-				repp->nCols_ = rasterOut->params().ncols_;
-				repp->nLins_ = rasterOut->params().nlines_;
-				repp->resX_ = rasterOut->params().resx_;
-				repp->resY_ = rasterOut->params().resy_;
-
-				// atualizes representation in the database
-				layer->database()->updateRasterRepresentation(layer->id(),rasterOut->params(),objectId);
-				layer->updateLayerBox(rasterOut->params().boundingBox());
-				rasterOut->clear();
-				res = true;
-			}
-		}
-		if (res)			
-		{
-			//	create spatial index in the block box
-			string tableR = layer->database()->getRasterTable(layer->id(),objectId);
-			layer->database()->insertMetadata(tableR,layer->database()->getSpatialIdxColumn(TeRASTER), 0.000005,0.000005,layer->box());		
-			layer->database()->createSpatialIndex(tableR,layer->database()->getSpatialIdxColumn(TeRASTER), (TeSpatialIndexType)TeRTREE);
-		}
-		delete dbDecoder;
-		return res;
-	}
-	else
-	{
-		// layer contains already a raster representation associated to the
-		// object id: calls mosaic operation
-		return TeMosaicRaster(rasterIn,layer,objId);
-	}
-}
-
-bool 
-TeBuildLowerResolution(TeLayer* layer, TeRaster* rasterIn, int resFac, const string& objectId)
-{
-	if (!layer || !rasterIn)	// layer and input raster pointers shouldn't be null
-		return false;
-
-	string objId;				// if empty try to get the default object identification
-	if (objectId.empty())
-		objId = "O1";
-	else
-		objId = objectId;	
-	
-	string tableName;
-	TeRepresentation* repp = layer->getRepresentation(TeRASTER);
-	if (repp)
-	{
-		tableName = layer->database()->getRasterTable(layer->id(), objId);
-		if (tableName.empty())	
-			return false;		// layer doesn�t have a raster geometry to this object id
-	}
-	else					
-		return false;			// layer doesn�t have any raster geometry
-
-	// retrieves the original raster
-	TeRaster* originalRaster = layer->raster(objId);
-	TeBox bbOriginalRes = originalRaster->params().boundingBox();
-
-	// builds some parameters relative to the new resolution
-	TeRasterParams parNewRes = originalRaster->params();
-	parNewRes.resolution_ = resFac;
-	parNewRes.mode_ = 'w';
-	parNewRes.boundingBoxResolution(bbOriginalRes.x1_, bbOriginalRes.y1_,bbOriginalRes.x2_, bbOriginalRes.y2_,
-									parNewRes.resx_*resFac, parNewRes.resy_*resFac);
-
-	// adjust box to tiling in geographical coordinates
-	if (originalRaster->params().tiling_type_ == TeRasterParams::TeExpansible)
-	{
-		TeBox b = parNewRes.boundingBox();
-		int w = parNewRes.blockWidth_;
-		int h = parNewRes.blockHeight_;
-		parNewRes.resizeToTiling(b, w, h);
-	} 
-
-
-	// create a decoder to raster in a TerraLib database 
-	TeDecoderDatabase *dbDecoder = new TeDecoderDatabase(parNewRes);
-	dbDecoder->setDB (layer->database());
-
-	TeRaster* rasterOut = new TeRaster();
-	rasterOut->setDecoder(dbDecoder);
-	rasterOut->init();
-
-	// remap;
-	TeRasterRemap remap;
-	remap.setInput(rasterIn);
-	remap.setOutput(rasterOut);
-	bool status = remap.apply(true);
-	rasterOut->clear();
-	delete dbDecoder;
-	return status;
-}
-
-
-
-void
-TeCalculateMean(TeDecoderMemory* decMem, vector<TeMemoryPage*> pages,int ulColStart,int ulLinStart)
-{
-	int i,j, c=ulColStart, l=ulLinStart;
-	unsigned int b;
-	int npixels;
-	double mean,val;
-	int nlines = decMem->params().nlines_-1;
-	int ncols = decMem->params().ncols_-1;
-	double dummy;
-
-	for (b=0; b<pages.size(); ++b)
-	{
-		dummy = decMem->params().dummy_[b];
-		l=ulLinStart;
-		for (i=0; i<nlines; i+=2)
-		{
-			c=ulColStart;
-			for (j=0; j<ncols; j+=2)
-			{
-				mean = 0.0;
-				npixels = 0;
-				if ((j>0) && (i>0) && decMem->getElement(j-1,i-1,val,b) && val != dummy)
-				{
-					mean += val;
-					npixels ++;
-				}
-				if ((i>0) && decMem->getElement(j,i-1,val,b) && val != dummy)
-				{
-					mean += val;
-					npixels ++;
-				}
-				if ((i>0) && (j<ncols-1) && decMem->getElement(j+1,i-1,val,b) && val != dummy)
-				{
-					mean += val;
-					npixels ++;
-				}	
-				
-				if ((j>0) && decMem->getElement(j-1,i,val,b) && val != dummy)
-				{
-					mean += val;
-					npixels ++;
-				}
-				if (decMem->getElement(j,i,val,b) && val != dummy)
-				{
-					mean += val;
-					npixels ++;
-				}
-				if ((j<ncols-1) && decMem->getElement(j+1,i,val,b) && val != dummy)
-				{
-					mean += val;
-					npixels ++;
-				}				
-			
-				if ((j>0) && (i<nlines-1) && decMem->getElement(j-1,i+1,val) && val != dummy)
-				{
-					mean += val;
-					npixels ++;
-				}
-				if ((i<nlines-1) && decMem->getElement(j,i+1,val,b) && val != dummy)
-				{
-					mean += val;
-					npixels ++;
-				}
-				if ((j<ncols-1) && (i<nlines-1) && decMem->getElement(j+1,i+1,val,b) && val != dummy)
-				{
-					mean += val;
-					npixels ++;
-				}
-				if (npixels)
-				{
-					mean = mean/npixels;
-					pages[b]->setVal(c,l,decMem->params().ncols_,mean);
-				}
-				c++;
-			}
-			l++;
-		}
-	}
-}
-
-
-/*
-This routine builds a multi-resolution pyramid with nLevels in a raster representation.
-The raster representation should be a raster stored in a TerraLib database.
-The raster representation should have been built in blocks with width and height power of 2.
-*/
-bool TeBuildMultiResolutionPyramid(TeRaster* rst, int nLevels, const bool& showProgress)
-{
-	if (!rst)
-		return false;
-	if (nLevels <= 1)
-		return false;
-	if (rst->params().decoderIdentifier_ != "DB")
-		return false;
-	int bw = rst->params().blockWidth_;
-	int bh = rst->params().blockHeight_;
-
-	/* check to see if bw and bh are power of 2 */
-	if (bw == 0 || bh == 0 ||
-	   (bw & (bw - 1)) != 0  || (bh & (bh - 1)) != 0)
-	{
-		return false;
-	}
-	
-	TeBox rstBB = rst->params().boundingBox();
-
-	// build a vector of pages in memory
-	vector<TeMemoryPage*> pages;
-	int b;
-	for (b=0; b<rst->params().nBands(); ++b)
-	{
-		TeMemoryPage* block = new TeMemoryPage(bh*bw, 
-											   rst->params().dummy_[b],
-											   rst->params().dataType_[b]);
-		block->ulCol_ = 0;
-		block->ulLin_ = 0;
-		pages.push_back(block);
-	}
-
-	// auxiliary variables
-	int ulCol, 
-		ulLin, 
-		band, 
-		res, 
-		subb, 
-		ulColStart, 
-		ulLinStart;
-
-	// parameters of a upper level
-	TeRasterParams parUp = rst->params();
-	parUp.mode_ = 'w';
-
-	// a decoder im memory for the lower level blocks
-	TeDecoderMemory*	decMem    = new TeDecoderMemory();
-
-	// a decoder database for the upper level of the pyramid
-	TeDecoderDatabase*	decDBUpperLevel = new TeDecoderDatabase(parUp);
-
-	// more auxiliary variables
-	int pxBUp=-1, pyBUp=-1;
-	int xBUp, yBUp;
-	int bUlx, bUly;
-
-	bool flag = true;
-	string bid;
-	char baux[60];
-
-	if(showProgress && TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(nLevels);
-	}
-
-	TeRasterParams parBlock;
-	int r = 2;
-	for (int nl=0; nl<nLevels; ++nl)
-	{
-		if (showProgress && TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-			{
-					break;
-			}
-
-			std::string msg = "Creating Level " + Te2String(nl) + " of " + Te2String(nLevels);
-			TeProgress::instance()->setMessage(msg);
-			
-			TeProgress::instance()->setProgress(nl);
-		}
-
-		// select all the blocks from lower level
-		if (!rst->selectBlocks(rstBB,r/2,parBlock) )
-		{
-			delete decMem;
-			delete decDBUpperLevel;
-			return false;
-		}
-
-		decMem->updateParams(parBlock);
-		decMem->init();
-		parUp.boundingBoxResolution(rstBB.x1_, rstBB.y1_, rstBB.x2_, rstBB.y2_,
-	    							rst->params().resx_*r,rst->params().resy_*r,
-									TeBox::TeLOWERLEFT);
-		parUp.resolution_ = r;
-		decDBUpperLevel->updateParams(parUp);
-		
-		pxBUp=-1;
-		pyBUp=-1;
-		// for each block of the lower level
-		do
-		{
-			// retrieve the lower level block
-			flag = rst->fetchRasterBlock(decMem);
-			TeRasterParams& par = decMem->params();
-
-			// get the coordinate of the  lower level block upper left corner
-			TeBox blockBox = par.boundingBox();
-			TeCoord2D auxC(blockBox.x1_+4*par.resx_,blockBox.y2_-4*par.resy_);
-			TeCoord2D ij = parUp.coord2Index(auxC);
-			ulColStart = TeRoundRasterIndex(ij.x_);
-			ulLinStart = TeRoundRasterIndex(ij.y_);
-			
-			// find the correspondent upper level block that contains the coordinate
-			bid = decDBUpperLevel->codifyId(ulColStart,ulLinStart,0,r,0);
-			sscanf(bid.c_str(),"X%dY%d",&xBUp,&yBUp);
-			decDBUpperLevel->decodifyId(bid,bUlx,bUly,band,res,subb);
-
-			// check to which quadrant in the upper level block the lower level block fits
-			if (ulColStart >= (bUlx+bw/2))
-				ulColStart = bUlx+bw/2;
-			else
-				ulColStart = bUlx;
-
-			if (ulLinStart >= (bUly+bh/2))
-				ulLinStart = bUly+bh/2;
-			else
-				ulLinStart = bUly;
-
-			// check if the upper level block is in already in memory
-			if (pxBUp != xBUp || pyBUp != yBUp)
-			{	
-				for (b=0; b<rst->params().nBands(); ++b)
-				{
-					// if it is not the first blocks do the swapping from memory to db
-					if (pxBUp >= 0 && pyBUp >= 0)
-					{
-						// save blocks from memory
-						sprintf(baux,"X%dY%dB%dR%dS0",pxBUp, pyBUp,b,r);
-						decDBUpperLevel->putRasterBlock(baux,pages[b]->data_, parUp.blockHeight_*parUp.blockWidth_);
-					}
-					// get the needed one
-					pages[b]->clear();
-					sprintf(baux,"X%dY%dB%dR%dS0",xBUp,yBUp,b,r);
-					decDBUpperLevel->getRasterBlock(baux,pages[b]->data_);
-					TeBlockIndex index;
-					index.band_ = b;
-					index.col_ = xBUp;
-					index.lin_ = yBUp;
-					decDBUpperLevel->blockIndexPos(index,ulCol,ulLin,b);
-					pages[b]->ulLin_ = ulLin;
-					pages[b]->ulCol_ = ulCol;
-				}
-				// keep track of the blocks in memory
-				pxBUp = xBUp;
-				pyBUp = yBUp;
-			}
-			// write lower level block into upper level block using a 3x3 smoothing window (mean)
-			TeCalculateMean(decMem,pages,ulColStart,ulLinStart);
-
-		}while (flag);
-
-		// save the last blocks in memory
-		for (b=0; b<rst->params().nBands(); ++b)
-		{
-			sprintf(baux,"X%dY%dB%dR%dS0",xBUp,yBUp,b,r);
-			decDBUpperLevel->putRasterBlock(baux,pages[b]->data_, parUp.blockHeight_*parUp.blockWidth_);
-		}
-		// reset level selection
-		rst->clearBlockSelection();
-		decMem->resetMemory();
-		r *= 2;
-	}
-
-	if(showProgress && TeProgress::instance())
-	{
-		TeProgress::instance()->reset();
-	}
-
-	delete decMem;
-	delete decDBUpperLevel;
-	for (b=0; b<rst->params().nBands(); ++b)
-		delete pages[b];
-	return true;
-}
-
-TeRaster* TeAvMultiRes(TeRaster* rasterIn, TeDatabase* db)
-{
-	TeRaster* rasterOut = NULL;
-
-	if(!rasterIn || !db)
-	{
-		return NULL;
-	}
-
-	TeBox bbOriginalRes = rasterIn->params().boundingBox();
-
-	// builds some parameters relative to the new resolution
-	TeRasterParams parNewRes = rasterIn->params();
-	parNewRes.resolution_ = parNewRes.resolution_ * 2;
-	parNewRes.mode_ = 'w';
-	parNewRes.boundingBoxResolution(bbOriginalRes.x1_, bbOriginalRes.y1_,bbOriginalRes.x2_, bbOriginalRes.y2_,
-									parNewRes.resx_ * 2, parNewRes.resy_ * 2);
-
-	// create a decoder to raster in a TerraLib database 
-	TeDecoderDatabase *dbDecoder = new TeDecoderDatabase(parNewRes);
-	dbDecoder->setDB (db);
-
-	rasterOut = new TeRaster();
-	rasterOut->setDecoder(dbDecoder);
-	
-	if(!rasterOut->init())
-	{
-		delete rasterOut;
-		return NULL;
-	}
-
-	int nLines = rasterOut->params().nlines_;
-	int nCols = rasterOut->params().ncols_;
-	int nBands = rasterOut->params().nBands();
-
-	int nLinesOrigen = rasterIn->params().nlines_;
-	int nColsOrigen = rasterIn->params().ncols_;
-
-	int bhSize = rasterIn->params().blockHeight_;
-	int bwSize = rasterIn->params().blockWidth_;
-
-	int halfBhSize = bhSize / 2;
-	int halfBwSize = bwSize / 2;
-
-	double dummy = rasterIn->params().dummy_[0];
-	double mean,val;
-	int npixels;
-
-	unsigned int numBlocks = (nLinesOrigen / bhSize) * (nColsOrigen / bwSize) * nBands;
-
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(numBlocks);
-	}
-
-	
-
-	int b, iBaseOri, jBaseOri, iBaseDest, jBaseDest, iOri, jOri, iDest, jDest, blockI, blockJ;
-
-	unsigned int numBlock = 0;
-
-	for (iBaseDest=0, iBaseOri=0; iBaseDest < nLines; iBaseDest+=halfBhSize, iBaseOri+=bhSize)//lines
-	{
-		for (jBaseDest=0, jBaseOri=0; jBaseDest < nCols; jBaseDest+=halfBwSize, jBaseOri+=bwSize)//columns
-		{
-			for (b=0; b<nBands; ++b)//band
-			{
-				for(blockI=0, iDest=iBaseDest, iOri=iBaseOri; blockI < halfBhSize; ++blockI, ++iDest, iOri+=2)//block lines
-				{
-					for(blockJ=0, jDest=jBaseDest, jOri=jBaseOri; blockJ < halfBwSize; ++blockJ, ++jDest, jOri+=2)//block columns
-					{
-						mean = 0.0;
-						npixels = 0;
-
-						if ((jOri>0) && (iOri>0) && rasterIn->getElement(jOri-1,iOri-1,val,b) && val != dummy)
-						{
-							mean += val;
-							npixels ++;
-						}
-						if ((iOri>0) && rasterIn->getElement(jOri,iOri-1,val,b) && val != dummy)
-						{
-							mean += val;
-							npixels ++;
-						}
-						if ((iOri>0) && (jOri<nColsOrigen-1) && rasterIn->getElement(jOri+1,iOri-1,val,b) && val != dummy)
-						{
-							mean += val;
-							npixels ++;
-						}	
-						
-						if ((jOri>0) && rasterIn->getElement(jOri-1,iOri,val,b) && val != dummy)
-						{
-							mean += val;
-							npixels ++;
-						}
-						if (rasterIn->getElement(jOri,iOri,val,b) && val != dummy)
-						{
-							mean += val;
-							npixels ++;
-						}
-						if ((jOri<nColsOrigen-1) && rasterIn->getElement(jOri+1,iOri,val,b) && val != dummy)
-						{
-							mean += val;
-							npixels ++;
-						}				
-					
-						if ((jOri>0) && (iOri<nLinesOrigen-1) && rasterIn->getElement(jOri-1,iOri+1,val) && val != dummy)
-						{
-							mean += val;
-							npixels ++;
-						}
-						if ((iOri<nLinesOrigen-1) && rasterIn->getElement(jOri,iOri+1,val,b) && val != dummy)
-						{
-							mean += val;
-							npixels ++;
-						}
-						if ((jOri<nColsOrigen-1) && (iOri<nLinesOrigen-1) && rasterIn->getElement(jOri+1,iOri+1,val,b) && val != dummy)
-						{
-							mean += val;
-							npixels ++;
-						}
-
-						if (npixels)
-						{
-							mean = mean/npixels;
-							
-							rasterOut->setElement(jDest, iDest, mean, b);
-						}
-
-					}//block columns
-				}//block lines
-
-				++numBlock;
-				if(TeProgress::instance())
-				{
-					if(TeProgress::instance()->wasCancelled())
-					{
-						return rasterOut;
-					}
-					if(numBlock % 10 == 0)
-					{
-						TeProgress::instance()->setProgress(numBlock);
-					}
-				}
-
-			}//band
-
-		}//colums
-	}//lines
-
-
-	return rasterOut;
-}
-
-bool TeBuildAverageResolution(TeLayer* layer, int maxRes, const string& objectId)
-{
-	if (!layer)	// layer and input raster pointers shouldn't be null
-		return false;
-
-	string objId;				// if empty try to get the default object identification
-	if (objectId.empty())
-		objId = "O1";
-	else
-		objId = objectId;	
-	
-	// retrieves the original raster
-	TeRaster* rasterIn = layer->raster(objId);
-
-	if(!rasterIn)
-	{
-		return false;
-	}
-
-	TeRaster* rasterOut = NULL;
-
-	int res = 1;
-
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->setTotalSteps(maxRes);
-	}
-
-	while(res <= maxRes)
-	{
-		
-		if (TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-			{
-					break;
-			}
-
-			std::string msg = "Creating Level " + Te2String(res) + " of " + Te2String(maxRes);
-
-			TeProgress::instance()->setMessage(msg);
-			
-			TeProgress::instance()->setProgress(res);
-		}
-
-		rasterOut = TeAvMultiRes(rasterIn, layer->database());
-
-		if(res != 1)
-		{
-			rasterIn->clear();
-			delete rasterIn;
-		}
-
-		rasterIn = rasterOut;
-
-		++res;
-	}
-
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->reset();
-	}
-
-	if(rasterOut)
-	{
-		rasterOut->clear();
-		delete rasterOut;
-	}
-
-	return true;
-}
\ No newline at end of file
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeRasterRemap.h"
+#include "TeDecoderDatabase.h"
+#include "TeRaster.h"
+#include "TeDecoderMemory.h" 
+#include "TeRasterParams.h"
+#include "TeProgress.h"
+#include "TeVectorRemap.h"
+#include "TeImportRaster.h"
+//#include "TeLibJpegWrapper.h"
+
+
+TeLayer* 
+TeImportRaster (const string& layerName, TeRaster* rasterIn, TeDatabase* database)
+{
+	if (!database || layerName.empty() || !rasterIn || 
+		(rasterIn->params().status_ != TeRasterParams::TeReadyToRead && 
+		 rasterIn->params().status_ != TeRasterParams::TeReadyToWrite))
+		return 0;
+
+	// find a valid layer name
+	string newLayerName = layerName;
+	TeLayerMap& layerMap = database->layerMap();
+	TeLayerMap::iterator it;
+	bool flag = true;
+	int n = 1;
+	while (flag)
+	{
+		for (it = layerMap.begin(); it != layerMap.end(); ++it)
+		{
+			if (TeStringCompare(it->second->name(),newLayerName))
+				break;
+		}
+		if (it == layerMap.end())
+			flag = 0;
+		else
+			newLayerName = layerName + "_" +Te2String(n);
+		n++;	
+	}
+
+	TeLayer* newLayer = new TeLayer(newLayerName,database,rasterIn->projection());
+	if (newLayer->id() <= 0 )
+		return 0;				// couldn�t create new layer
+
+	// block dimension guessing
+	unsigned int bw = 512;
+	unsigned int bh = 512;		// an initial guess...
+
+	// if raster is up to 512x512 store it in one block
+	if (rasterIn->params().nlines_< 512 && rasterIn->params().ncols_< 512)
+	{
+		bw = rasterIn->params().ncols_;
+		bh = rasterIn->params().nlines_;
+	}
+	// if ncols<1024 build blocks of 1 line
+	else if (rasterIn->params().ncols_ < 1024)  
+	{
+		bw = rasterIn->params().ncols_;
+		bh = 1;
+	}
+
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	bool res = TeImportRaster(newLayer, rasterIn, bw, bh, TeRasterParams::TeNoCompression, 
+		"", rasterIn->params().dummy_[0], rasterIn->params().useDummy_, TeRasterParams::TeNoExpansible);
+	if (res)
+		return newLayer;
+
+	database->deleteLayer(newLayer->id());
+	return 0;
+}
+
+
+// This function mosaics an input raster to one previsously existing in a TerraLib layer
+bool TeMosaicRaster(TeRaster* rasterIn, TeLayer* layer,  const string& objectId)
+{
+
+	// layer must exist and input raster should be read to be read
+	if (!layer || !rasterIn  || rasterIn->params().status_ != TeRasterParams::TeReadyToRead)
+		return false;
+	
+	TeRaster* rasterOut;
+	if (!objectId.empty())	// if object id informed try to get raster associated to it
+		rasterOut = layer->raster(objectId,'w');
+	else					// else try to get first one found
+		rasterOut = layer->raster();
+
+	if (!rasterOut)			// no raster asked or no raster at all
+		return false;				// can not do mosaic
+
+	if (rasterOut->params().tiling_type_==TeRasterParams::TeNoExpansible)
+		return false;				// can mosaic if is not possible
+
+	// allows mosaic of same photometric types only
+	if (rasterOut->params().photometric_[0] != rasterIn->params().photometric_[0])
+		return false;
+
+	// increases output box to: input raster box + output raster box 
+  TeBox boxIn = rasterIn->params().boundingBox();
+
+	// if necessary remap input box to output projection 
+	if (!(*(rasterIn->projection()) == *(rasterOut->projection())))
+		boxIn = TeRemapBox(boxIn,rasterIn->projection(),rasterOut->projection());
+
+	// sum stored and input boxes
+	TeBox newBoxa = rasterOut->params().boundingBox();
+	updateBox(newBoxa,boxIn);	
+  
+  // adjust it to expansible values
+	TeBox newBox = adjustToCut(newBoxa, rasterOut->params().blockWidth_*rasterOut->params().resx_, 
+							   rasterOut->params().blockHeight_*rasterOut->params().resy_);
+
+	// update box in parameters of the raster and it's decoder
+	rasterOut->params().boundingBoxResolution(newBox.x1_,newBox.y1_,newBox.x2_,newBox.y2_,
+											  rasterOut->params().resx_, rasterOut->params().resy_);
+
+	rasterOut->decoder()->params().boundingBoxResolution(newBox.x1_,newBox.y1_,newBox.x2_,newBox.y2_,
+											  rasterOut->params().resx_, rasterOut->params().resy_);
+	rasterOut->params().nTilesInMemory_ = 0;
+	
+	// creates a remapping from input raster to output raster
+	TeRasterRemap remap(rasterIn, rasterOut);
+	if (remap.apply(true))			// o.k.
+	{
+		TeRasterParams rp = rasterOut->params();
+
+		// atualizes the representation box in memory
+		TeRepresentation* repp = layer->getRepresentation(TeRASTER);
+		TeBox boxNew = rp.box();
+		updateBox(repp->box_,rp.box());
+		repp->nCols_ = rp.ncols_;
+		repp->nLins_ = rp.nlines_;
+		repp->resX_ = rp.resx_;
+		repp->resY_ = rp.resy_;
+
+		// atualizes representation in the database
+		layer->database()->updateRasterRepresentation(layer->id(),rp,objectId);
+		layer->updateLayerBox(rp.boundingBox());
+		rasterOut->clear();
+		return true;
+	}
+	return false;
+}
+
+
+bool TeImportRaster (TeLayer* layer, TeRaster* rasterIn, 
+					 unsigned int bWidth, unsigned int bHeight,TeRasterParams::TeRasterCompressionMode compress,
+					 const string& objectId, double dummy, bool useDummy,
+					 TeRasterParams::TeRasterTilingType indext)
+{	
+
+	if (!layer || !rasterIn)
+		return false;
+
+	string objId;
+	if (objectId.empty())
+		objId = "O1";
+	else
+		objId = objectId;
+
+
+	// check if there  is a raster geometry to be modified
+	string tableGeo;
+	TeRepresentation* repp = 0;
+	repp = layer->getRepresentation(TeRASTER);
+	if (!repp || !layer->raster(objectId))	// layer doesn�t have any 
+	{										// or the desired raster geometry
+											// a new one should be created
+		TeProjection* projIn = rasterIn->projection();	
+		TeProjection* projOut = layer->projection();
+
+		TeRasterParams parOut = rasterIn->params();		// parameters of the raster being created	
+														// start with the same parameters as input raster
+		
+		parOut.setCompressionMode(compress);		// overwrites some parameters 
+		parOut.nTilesInMemory_ = 0;					// according to the specified in the interface
+		parOut.blockHeight_ = bHeight;
+		parOut.blockWidth_ = bWidth;
+		parOut.setDummy(dummy);
+		parOut.useDummy_ = useDummy;
+		parOut.tiling_type_ = indext;
+
+		TeBox newBox = rasterIn->params().boundingBox();
+
+		// if input raster has some rotation associated it has to be corrected 
+		// during the importing
+		if (parOut.dxI_ != 0. || parOut.dyJ_ != 0.)
+		{
+			parOut.boundingBoxResolution(newBox.x1_,newBox.y1_,newBox.x2_,newBox.y2_,parOut.resx_,parOut.resy_);
+			parOut.dxI_= 0.0;							  
+			parOut.dyJ_= 0.0;							 
+			parOut.dxJ_ = 0.0;
+			parOut.dyI_ = 0.0;	
+		}
+		
+		bool diffProj = false;
+		parOut.projection(projOut);
+		if (projIn && projOut && !(*projIn == *projOut))
+		{
+			diffProj = true;
+			TeBox boxIn = rasterIn->params().boundingBox();
+			newBox = TeRemapBox (boxIn,projIn,projOut);
+			parOut.resx_ = newBox.width()/parOut.ncols_;	// recalculates resolutions 
+			parOut.resy_ = newBox.height()/parOut.nlines_;  // for the new projection
+			parOut.boundingBoxResolution(newBox.x1_,newBox.y1_,newBox.x2_,newBox.y2_,parOut.resx_,parOut.resy_);
+			newBox = parOut.box();
+		}
+	
+		if (indext == TeRasterParams::TeExpansible)			// if mosaicable adjust box 
+			parOut.resizeToTiling(newBox,bWidth,bHeight);	// to be cut in blocks of bWidth X bHeight (in projection units)
+
+		parOut.decoderIdentifier_ = "DB";					// parameters of the decoder
+		parOut.fileName_ = "RasterLayer" + Te2String(layer->id()) + "_R_" + objId;
+
+		if (parOut.photometric_[0] == TeRasterParams::TePallete)
+			parOut.lutName_ = parOut.fileName_ + "_LUT";
+
+		if (!layer->addRasterGeometry(parOut,objId))		// creates the empty raster geometry
+			return false;
+
+		// create a decoder to raster in a TerraLib database 
+		parOut.mode_ = 'w';
+		TeDecoderDatabase *dbDecoder = new TeDecoderDatabase(parOut);
+		dbDecoder->setDB(layer->database());
+
+		// optimization: we don't need to go through remap routines.
+		// just cut the input raster and save the tiles
+		bool res=false;
+		TeRasterParams parF;
+		if (indext == TeRasterParams::TeNoExpansible && !diffProj)
+		{
+			int ntiles = (parOut.nlines_/parOut.blockHeight_)*(parOut.ncols_/parOut.blockWidth_);
+			if(TeProgress::instance())
+				TeProgress::instance()->setTotalSteps(ntiles);
+			int count = 0;
+			clock_t	ti, tf;
+			int x=0, y=0, b, nb=parOut.nBands(),lx, ly;
+			double val= parOut.dummy_[0];
+			TeMemoryPage page(parOut.blockHeight_*parOut.blockWidth_,val,parOut.dataType_[0]);
+			string index;
+			ti = clock();
+			while (y<parOut.nlines_)  // for each row of tiles
+			{
+				page.ulLin_ = y;
+				x=0;
+				while (x<parOut.ncols_)	// for each tile in a row
+				{
+					page.clear();
+					page.ulCol_= x;
+					for (b=0; b<nb; ++b)    // for each band;
+					{
+						for (ly=0; ly<parOut.blockHeight_; ++ly)
+						{
+							for (lx=0; lx<parOut.blockWidth_; ++lx)  // write the tile
+							{
+								if (rasterIn->getElement(x+lx,y+ly,val,b))
+								{
+									page.setVal(x+lx,y+ly,parOut.blockWidth_,val);
+									if (val<parOut.vmin_[b])
+										parOut.vmin_[b] = val;
+									if (val>parOut.vmax_[b])
+										parOut.vmax_[b] = val;
+								}
+							}
+						}
+						index = dbDecoder->codifyId(x,y,b,1,0);
+						if (!dbDecoder->putRasterBlock(index,page.data_,page.pageSize()))
+							res=false;
+						page.clear();
+					}
+					x+= parOut.blockWidth_;
+					++count;
+					if(TeProgress::instance())
+					{
+						tf = clock();
+						if (int((tf-ti)/CLOCKS_PER_SEC) > 3)
+						{
+							if (TeProgress::instance()->wasCancelled())
+								break;
+							TeProgress::instance()->setProgress(count);
+							ti = tf;
+						}
+					}
+				}
+				y+= parOut.blockHeight_;
+			}
+			if (TeProgress::instance())
+				TeProgress::instance()->reset();
+
+			// atualizes the representation box in memory
+			TeRepresentation* repp = layer->getRepresentation(TeRASTER);
+			updateBox(repp->box_,parOut.box());
+			repp->nCols_ = parOut.ncols_;
+			repp->nLins_ = parOut.nlines_;
+			repp->resX_ = parOut.resx_;
+			repp->resY_ = parOut.resy_;
+			layer->updateLayerBox(parOut.boundingBox());
+			layer->database()->updateRasterRepresentation(layer->id(),dbDecoder->params(),objectId);
+			// atualizes representation in the database
+			for (b=0; b<nb; ++b)
+			{
+				dbDecoder->params().vmax_[b]=parOut.vmax_[b];
+				dbDecoder->params().vmin_[b]=parOut.vmin_[b];
+			}
+			layer->database()->updateRasterRepresentation(layer->id(),dbDecoder->params(),objectId);
+			dbDecoder->clear();
+			res=true;
+		}
+		else
+		{
+			TeRaster* rasterOut = new TeRaster();
+			rasterOut->setDecoder(dbDecoder);
+			rasterOut->init();
+			TeRasterRemap remap(rasterIn, rasterOut);
+			if (remap.apply(true))
+			{
+				TeRepresentation* repp = layer->getRepresentation(TeRASTER);
+				updateBox(repp->box_,rasterOut->params().box());
+				repp->nCols_ = rasterOut->params().ncols_;
+				repp->nLins_ = rasterOut->params().nlines_;
+				repp->resX_ = rasterOut->params().resx_;
+				repp->resY_ = rasterOut->params().resy_;
+
+				// atualizes representation in the database
+				layer->database()->updateRasterRepresentation(layer->id(),rasterOut->params(),objectId);
+				layer->updateLayerBox(rasterOut->params().boundingBox());
+				rasterOut->clear();
+				res = true;
+			}
+		}
+		if (res)			
+		{
+			//	create spatial index in the block box
+			string tableR = layer->database()->getRasterTable(layer->id(),objectId);
+			layer->database()->insertMetadata(tableR,layer->database()->getSpatialIdxColumn(TeRASTER), 0.000005,0.000005,layer->box());		
+			layer->database()->createSpatialIndex(tableR,layer->database()->getSpatialIdxColumn(TeRASTER), (TeSpatialIndexType)TeRTREE);
+		}
+		delete dbDecoder;
+		return res;
+	}
+	else
+	{
+		// layer contains already a raster representation associated to the
+		// object id: calls mosaic operation
+		return TeMosaicRaster(rasterIn,layer,objId);
+	}
+}
+
+bool 
+TeBuildLowerResolution(TeLayer* layer, TeRaster* rasterIn, int resFac, const string& objectId)
+{
+	if (!layer || !rasterIn)	// layer and input raster pointers shouldn't be null
+		return false;
+
+	string objId;				// if empty try to get the default object identification
+	if (objectId.empty())
+		objId = "O1";
+	else
+		objId = objectId;	
+	
+	string tableName;
+	TeRepresentation* repp = layer->getRepresentation(TeRASTER);
+	if (repp)
+	{
+		tableName = layer->database()->getRasterTable(layer->id(), objId);
+		if (tableName.empty())	
+			return false;		// layer doesn�t have a raster geometry to this object id
+	}
+	else					
+		return false;			// layer doesn�t have any raster geometry
+
+	// retrieves the original raster
+	TeRaster* originalRaster = layer->raster(objId);
+	TeBox bbOriginalRes = originalRaster->params().boundingBox();
+
+	// builds some parameters relative to the new resolution
+	TeRasterParams parNewRes = originalRaster->params();
+	parNewRes.resolution_ = resFac;
+	parNewRes.mode_ = 'w';
+	parNewRes.boundingBoxResolution(bbOriginalRes.x1_, bbOriginalRes.y1_,bbOriginalRes.x2_, bbOriginalRes.y2_,
+									parNewRes.resx_*resFac, parNewRes.resy_*resFac);
+
+	// adjust box to tiling in geographical coordinates
+	if (originalRaster->params().tiling_type_ == TeRasterParams::TeExpansible)
+	{
+		TeBox b = parNewRes.boundingBox();
+		int w = parNewRes.blockWidth_;
+		int h = parNewRes.blockHeight_;
+		parNewRes.resizeToTiling(b, w, h);
+	} 
+
+
+	// create a decoder to raster in a TerraLib database 
+	TeDecoderDatabase *dbDecoder = new TeDecoderDatabase(parNewRes);
+	dbDecoder->setDB (layer->database());
+
+	TeRaster* rasterOut = new TeRaster();
+	rasterOut->setDecoder(dbDecoder);
+	rasterOut->init();
+
+	// remap;
+	TeRasterRemap remap;
+	remap.setInput(rasterIn);
+	remap.setOutput(rasterOut);
+	bool status = remap.apply(true);
+	rasterOut->clear();
+	delete dbDecoder;
+	return status;
+}
+
+
+
+void
+TeCalculateMean(TeDecoderMemory* decMem, vector<TeMemoryPage*> pages,int ulColStart,int ulLinStart)
+{
+	int i,j, c=ulColStart, l=ulLinStart;
+	unsigned int b;
+	int npixels;
+	double mean,val;
+	int nlines = decMem->params().nlines_-1;
+	int ncols = decMem->params().ncols_-1;
+	double dummy;
+
+	for (b=0; b<pages.size(); ++b)
+	{
+		dummy = decMem->params().dummy_[b];
+		l=ulLinStart;
+		for (i=0; i<nlines; i+=2)
+		{
+			c=ulColStart;
+			for (j=0; j<ncols; j+=2)
+			{
+				mean = 0.0;
+				npixels = 0;
+				if ((j>0) && (i>0) && decMem->getElement(j-1,i-1,val,b) && val != dummy)
+				{
+					mean += val;
+					npixels ++;
+				}
+				if ((i>0) && decMem->getElement(j,i-1,val,b) && val != dummy)
+				{
+					mean += val;
+					npixels ++;
+				}
+				if ((i>0) && (j<ncols-1) && decMem->getElement(j+1,i-1,val,b) && val != dummy)
+				{
+					mean += val;
+					npixels ++;
+				}	
+				
+				if ((j>0) && decMem->getElement(j-1,i,val,b) && val != dummy)
+				{
+					mean += val;
+					npixels ++;
+				}
+				if (decMem->getElement(j,i,val,b) && val != dummy)
+				{
+					mean += val;
+					npixels ++;
+				}
+				if ((j<ncols-1) && decMem->getElement(j+1,i,val,b) && val != dummy)
+				{
+					mean += val;
+					npixels ++;
+				}				
+			
+				if ((j>0) && (i<nlines-1) && decMem->getElement(j-1,i+1,val) && val != dummy)
+				{
+					mean += val;
+					npixels ++;
+				}
+				if ((i<nlines-1) && decMem->getElement(j,i+1,val,b) && val != dummy)
+				{
+					mean += val;
+					npixels ++;
+				}
+				if ((j<ncols-1) && (i<nlines-1) && decMem->getElement(j+1,i+1,val,b) && val != dummy)
+				{
+					mean += val;
+					npixels ++;
+				}
+				if (npixels)
+				{
+					mean = mean/npixels;
+					pages[b]->setVal(c,l,decMem->params().ncols_,mean);
+				}
+				c++;
+			}
+			l++;
+		}
+	}
+}
+
+
+/*
+This routine builds a multi-resolution pyramid with nLevels in a raster representation.
+The raster representation should be a raster stored in a TerraLib database.
+The raster representation should have been built in blocks with width and height power of 2.
+*/
+bool TeBuildMultiResolutionPyramid(TeRaster* rst, int nLevels, const bool& showProgress)
+{
+	if (!rst)
+		return false;
+	if (nLevels <= 1)
+		return false;
+	if (rst->params().decoderIdentifier_ != "DB")
+		return false;
+	int bw = rst->params().blockWidth_;
+	int bh = rst->params().blockHeight_;
+
+	/* check to see if bw and bh are power of 2 */
+	if (bw == 0 || bh == 0 ||
+	   (bw & (bw - 1)) != 0  || (bh & (bh - 1)) != 0)
+	{
+		return false;
+	}
+	
+	TeBox rstBB = rst->params().boundingBox();
+
+	// build a vector of pages in memory
+	vector<TeMemoryPage*> pages;
+	int b;
+	for (b=0; b<rst->params().nBands(); ++b)
+	{
+		TeMemoryPage* block = new TeMemoryPage(bh*bw, 
+											   rst->params().dummy_[b],
+											   rst->params().dataType_[b]);
+		block->ulCol_ = 0;
+		block->ulLin_ = 0;
+		pages.push_back(block);
+	}
+
+	// auxiliary variables
+	int ulCol, 
+		ulLin, 
+		band, 
+		res, 
+		subb, 
+		ulColStart, 
+		ulLinStart;
+
+	// parameters of a upper level
+	TeRasterParams parUp = rst->params();
+	parUp.mode_ = 'w';
+
+	// a decoder im memory for the lower level blocks
+	TeDecoderMemory*	decMem    = new TeDecoderMemory();
+
+	// a decoder database for the upper level of the pyramid
+	TeDecoderDatabase*	decDBUpperLevel = new TeDecoderDatabase(parUp);
+
+	// more auxiliary variables
+	int pxBUp=-1, pyBUp=-1;
+	int xBUp, yBUp;
+	int bUlx, bUly;
+
+	bool flag = true;
+	string bid;
+	char baux[60];
+
+	if(showProgress && TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(nLevels);
+	}
+
+	TeRasterParams parBlock;
+	int r = 2;
+	for (int nl=0; nl<nLevels; ++nl)
+	{
+		if (showProgress && TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+					break;
+			}
+
+			std::string msg = Te2String(nl) + " / " + Te2String(nLevels);
+			TeProgress::instance()->setMessage(msg);
+			
+			TeProgress::instance()->setProgress(nl);
+		}
+
+		// select all the blocks from lower level
+		if (!rst->selectBlocks(rstBB,r/2,parBlock) )
+		{
+			delete decMem;
+			delete decDBUpperLevel;
+			return false;
+		}
+
+		decMem->updateParams(parBlock);
+		decMem->init();
+		parUp.boundingBoxResolution(rstBB.x1_, rstBB.y1_, rstBB.x2_, rstBB.y2_,
+	    							rst->params().resx_*r,rst->params().resy_*r,
+									TeBox::TeLOWERLEFT);
+		parUp.resolution_ = r;
+		decDBUpperLevel->updateParams(parUp);
+		
+		pxBUp=-1;
+		pyBUp=-1;
+		// for each block of the lower level
+		do
+		{
+			// retrieve the lower level block
+			flag = rst->fetchRasterBlock(decMem);
+			TeRasterParams& par = decMem->params();
+
+			// get the coordinate of the  lower level block upper left corner
+			TeBox blockBox = par.boundingBox();
+			TeCoord2D auxC(blockBox.x1_+4*par.resx_,blockBox.y2_-4*par.resy_);
+			TeCoord2D ij = parUp.coord2Index(auxC);
+			ulColStart = TeRoundRasterIndex(ij.x_);
+			ulLinStart = TeRoundRasterIndex(ij.y_);
+			
+			// find the correspondent upper level block that contains the coordinate
+			bid = decDBUpperLevel->codifyId(ulColStart,ulLinStart,0,r,0);
+			sscanf(bid.c_str(),"X%dY%d",&xBUp,&yBUp);
+			decDBUpperLevel->decodifyId(bid,bUlx,bUly,band,res,subb);
+
+			// check to which quadrant in the upper level block the lower level block fits
+			if (ulColStart >= (bUlx+bw/2))
+				ulColStart = bUlx+bw/2;
+			else
+				ulColStart = bUlx;
+
+			if (ulLinStart >= (bUly+bh/2))
+				ulLinStart = bUly+bh/2;
+			else
+				ulLinStart = bUly;
+
+			// check if the upper level block is in already in memory
+			if (pxBUp != xBUp || pyBUp != yBUp)
+			{	
+				for (b=0; b<rst->params().nBands(); ++b)
+				{
+					// if it is not the first blocks do the swapping from memory to db
+					if (pxBUp >= 0 && pyBUp >= 0)
+					{
+						// save blocks from memory
+						sprintf(baux,"X%dY%dB%dR%dS0",pxBUp, pyBUp,b,r);
+						decDBUpperLevel->putRasterBlock(baux,pages[b]->data_, parUp.blockHeight_*parUp.blockWidth_);
+					}
+					// get the needed one
+					pages[b]->clear();
+					sprintf(baux,"X%dY%dB%dR%dS0",xBUp,yBUp,b,r);
+					decDBUpperLevel->getRasterBlock(baux,pages[b]->data_);
+					TeBlockIndex index;
+					index.band_ = b;
+					index.col_ = xBUp;
+					index.lin_ = yBUp;
+					decDBUpperLevel->blockIndexPos(index,ulCol,ulLin,b);
+					pages[b]->ulLin_ = ulLin;
+					pages[b]->ulCol_ = ulCol;
+				}
+				// keep track of the blocks in memory
+				pxBUp = xBUp;
+				pyBUp = yBUp;
+			}
+			// write lower level block into upper level block using a 3x3 smoothing window (mean)
+			TeCalculateMean(decMem,pages,ulColStart,ulLinStart);
+
+		}while (flag);
+
+		// save the last blocks in memory
+		for (b=0; b<rst->params().nBands(); ++b)
+		{
+			sprintf(baux,"X%dY%dB%dR%dS0",xBUp,yBUp,b,r);
+			decDBUpperLevel->putRasterBlock(baux,pages[b]->data_, parUp.blockHeight_*parUp.blockWidth_);
+		}
+		// reset level selection
+		rst->clearBlockSelection();
+		decMem->resetMemory();
+		r *= 2;
+	}
+
+	if(showProgress && TeProgress::instance())
+	{
+		TeProgress::instance()->reset();
+	}
+
+	delete decMem;
+	delete decDBUpperLevel;
+	for (b=0; b<rst->params().nBands(); ++b)
+		delete pages[b];
+	return true;
+}
+
+TeRaster* TeAvMultiRes(TeRaster* rasterIn, TeDatabase* db)
+{
+	TeRaster* rasterOut = NULL;
+
+	if(!rasterIn || !db)
+	{
+		return NULL;
+	}
+
+	TeBox bbOriginalRes = rasterIn->params().boundingBox();
+
+	// builds some parameters relative to the new resolution
+	TeRasterParams parNewRes = rasterIn->params();
+	parNewRes.resolution_ = parNewRes.resolution_ * 2;
+	parNewRes.mode_ = 'w';
+	parNewRes.boundingBoxResolution(bbOriginalRes.x1_, bbOriginalRes.y1_,bbOriginalRes.x2_, bbOriginalRes.y2_,
+									parNewRes.resx_ * 2, parNewRes.resy_ * 2);
+
+	// create a decoder to raster in a TerraLib database 
+	TeDecoderDatabase *dbDecoder = new TeDecoderDatabase(parNewRes);
+	dbDecoder->setDB (db);
+
+	rasterOut = new TeRaster();
+	rasterOut->setDecoder(dbDecoder);
+
+	if(!rasterOut->init())
+	{
+		delete rasterOut;
+		return NULL;
+	}
+
+
+	int nLines = rasterOut->params().nlines_;
+	int nCols = rasterOut->params().ncols_;
+	int nBands = rasterOut->params().nBands();
+	
+	int nLinesOrigen = rasterIn->params().nlines_;
+	int nColsOrigen = rasterIn->params().ncols_;
+
+	int bhSize = rasterIn->params().blockHeight_;
+	int bwSize = rasterIn->params().blockWidth_;
+
+	int halfBhSize = bhSize / 2;
+	int halfBwSize = bwSize / 2;
+
+	if(halfBhSize == 0)
+	{
+		halfBhSize = 1;
+	}
+
+	if(halfBwSize == 0)
+	{
+		halfBwSize = 1;
+	}
+
+	double dummy = rasterIn->params().dummy_[0];
+	double mean,val;
+	int npixels;
+
+	unsigned int numBlocks = (nLinesOrigen / bhSize) * (nColsOrigen / bwSize) * nBands;
+
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(numBlocks);
+	}
+
+	int b, iBaseOri, jBaseOri, iBaseDest, jBaseDest, iOri, jOri, iDest, jDest, blockI, blockJ;
+
+	unsigned int numBlock = 0;
+
+	for (iBaseDest=0, iBaseOri=0; iBaseDest < nLines; iBaseDest+=halfBhSize, iBaseOri+=bhSize)//lines
+	{
+		for (jBaseDest=0, jBaseOri=0; jBaseDest < nCols; jBaseDest+=halfBwSize, jBaseOri+=bwSize)//columns
+		{
+			for (b=0; b<nBands; ++b)//band
+			{
+				for(blockI=0, iDest=iBaseDest, iOri=iBaseOri; blockI < halfBhSize; ++blockI, ++iDest, iOri+=2)//block lines
+				{
+					for(blockJ=0, jDest=jBaseDest, jOri=jBaseOri; blockJ < halfBwSize; ++blockJ, ++jDest, jOri+=2)//block columns
+					{
+						mean = 0.0;
+						npixels = 0;
+
+						if ((jOri>0) && (iOri>0) && rasterIn->getElement(jOri-1,iOri-1,val,b) && val != dummy)
+						{
+							mean += val;
+							npixels ++;
+						}
+						if ((iOri>0) && rasterIn->getElement(jOri,iOri-1,val,b) && val != dummy)
+						{
+							mean += val;
+							npixels ++;
+						}
+						if ((iOri>0) && (jOri<nColsOrigen-1) && rasterIn->getElement(jOri+1,iOri-1,val,b) && val != dummy)
+						{
+							mean += val;
+							npixels ++;
+						}	
+						
+						if ((jOri>0) && rasterIn->getElement(jOri-1,iOri,val,b) && val != dummy)
+						{
+							mean += val;
+							npixels ++;
+						}
+						if (rasterIn->getElement(jOri,iOri,val,b) && val != dummy)
+						{
+							mean += val;
+							npixels ++;
+						}
+						if ((jOri<nColsOrigen-1) && rasterIn->getElement(jOri+1,iOri,val,b) && val != dummy)
+						{
+							mean += val;
+							npixels ++;
+						}				
+					
+						if ((jOri>0) && (iOri<nLinesOrigen-1) && rasterIn->getElement(jOri-1,iOri+1,val) && val != dummy)
+						{
+							mean += val;
+							npixels ++;
+						}
+						if ((iOri<nLinesOrigen-1) && rasterIn->getElement(jOri,iOri+1,val,b) && val != dummy)
+						{
+							mean += val;
+							npixels ++;
+						}
+						if ((jOri<nColsOrigen-1) && (iOri<nLinesOrigen-1) && rasterIn->getElement(jOri+1,iOri+1,val,b) && val != dummy)
+						{
+							mean += val;
+							npixels ++;
+						}
+
+						if (npixels)
+						{
+							mean = mean/npixels;
+							
+							rasterOut->setElement(jDest, iDest, mean, b);
+						}
+
+					}//block columns
+				}//block lines
+
+				++numBlock;
+				if(TeProgress::instance())
+				{
+					if(TeProgress::instance()->wasCancelled())
+					{
+						return rasterOut;
+					}
+					if(numBlock % 10 == 0)
+					{
+						TeProgress::instance()->setProgress(numBlock);
+					}
+				}
+
+			}//band
+
+		}//colums
+	}//lines
+
+
+	return rasterOut;
+}
+
+bool TeBuildAverageResolution(TeLayer* layer, int maxRes, const string& objectId)
+{
+	if (!layer)	// layer and input raster pointers shouldn't be null
+		return false;
+
+	string objId;				// if empty try to get the default object identification
+	if (objectId.empty())
+		objId = "O1";
+	else
+		objId = objectId;	
+	
+	// retrieves the original raster
+
+	TeRaster* rasterIn = layer->raster(objId);
+
+	if(!rasterIn)
+	{
+		return false;
+	}
+
+	TeRaster* rasterOut = NULL;
+
+	int res = 1;
+
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->setTotalSteps(maxRes);
+	}
+
+	while(res <= maxRes)
+	{
+
+		if (TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+					break;
+			}
+
+			std::string msg = Te2String(res) + " / " + Te2String(maxRes);
+
+			TeProgress::instance()->setMessage(msg);
+			
+			TeProgress::instance()->setProgress(res);
+		}
+
+		rasterOut = TeAvMultiRes(rasterIn, layer->database());
+
+		if(rasterOut == NULL)
+		{
+			break;
+		}
+
+		if(res != 1)
+		{
+			rasterIn->clear();
+			delete rasterIn;
+		}
+
+		rasterIn = rasterOut;
+
+		++res;
+	}
+
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->reset();
+	}
+
+	if(rasterOut)
+	{
+		rasterOut->clear();
+		delete rasterOut;
+	}
+
+	return true;
+}
diff --git a/src/terralib/kernel/TeImportRaster.h b/src/terralib/kernel/TeImportRaster.h
old mode 100755
new mode 100644
index da3684f..1861e02
--- a/src/terralib/kernel/TeImportRaster.h
+++ b/src/terralib/kernel/TeImportRaster.h
@@ -1,108 +1,108 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeImportRaster.h
-    \brief This file contains functions to support importing of raster data into a TerraLib database
-*/
-#ifndef __TERRALIB_INTERNAL_IMPORTRASTER_H
-#define __TERRALIB_INTERNAL_IMPORTRASTER_H
-
-#include "TeDataTypes.h"
-#include "TeRasterParams.h"
-
-#include <string>
-using namespace std;
-
-class TeLayer;
-class TeRaster;
-/** @defgroup RasterFunctions Functions to deal with raster data
- *  @{
-*/
-//! Imports a TeRaster object to a database creationg a new TeLayer
-/*!
-	This function imports a raster to the database, generating a new layer.
-      \param layerName name of the layer to be created
-      \param rasterIn a pointer to the raster representation to be imported
-      \param database a pointer to the database where the raster will be imported
-	  \returns a pointer to the generated layer
-*/
-TL_DLL TeLayer* TeImportRaster (const string& layerName, TeRaster* rasterIn, TeDatabase* database);
-
-//! Imports a TeRaster object to a TeLayer
-/*!
-	This function imports a raster as a geometry of an object of a layer.
-      \param layer pointer to a layer already created
-      \param rasterIn a raster representation
-	  \param bWidth width of the blocks used to store the raster
-	  \param bHeight height of the blocks used to store the raster
-	  \param compress compression type
-	  \param objectId object identification associated to this raster
-	  \param dummy value to be used as a no data value when importing
-	  \param useDummy flag used to indicate that imported raster will have a dummy value
-	  \param indext type of tiling used to import raster
-	  \returns true or false whether the raster was imported successfully
-*/
-TL_DLL bool TeImportRaster (TeLayer* layer, TeRaster* rasterIn, unsigned int bWidth=512, unsigned int bHeight=512, 
-		TeRasterParams::TeRasterCompressionMode compress = TeRasterParams::TeNoCompression, 
-		const string& objectId="", double dummy=255,bool useDummy = false, 
-		TeRasterParams::TeRasterTilingType indext=TeRasterParams::TeNoExpansible);
-
-//! This function mosaics an input raster to one previsously existing in a TerraLib layer
-/*!
-     \param rasterIn a raster representation
-     \param layer pointer to an existing layer 
-	 \param objectId object identification associated to this raster
-	 \returns true or false whether the mosaic operation was successfull
-*/
-TL_DLL bool TeMosaicRaster(TeRaster* rasterIn, TeLayer* layer,  const string& objectId="");
-
-//! Builds a degraded resolution of a raster data
-/*!
-      \param layer pointer to a layer already created 
-      \param rasterIn a raster representation
-	  \param resFac  value to multiply the original resolution
-	  \param objectId object identification associated to this raster
-	  \returns true or false whether the raster was imported successfully
-*/
-TL_DLL bool TeBuildLowerResolution(TeLayer* layer, TeRaster* rasterIn, int resFac, const string& objectId="");
-
-//! Builds the multi resolution pyramid for a given raster
-TL_DLL bool TeBuildMultiResolutionPyramid(TeRaster* rst, int nLevels, const bool& showProgress = false);
-
-//! Builds the multi resolution pyramid for a given raster
-TL_DLL bool TeBuildAverageResolution(TeLayer* layer, int maxRes, const string& objectId="");
-/** @} */ 
-
-/** \example importJPEG.cpp
-	Shows how to import a JPEG file
- */
-
-/** \example importGridData.cpp
-	Shows how a raster data: a binary raw grid data
- */
-
-/** \example mosaciTIFFImages.cpp
- * This is an example of how to build a mosaic of images as a layer in a TerraLib database
- */
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeImportRaster.h
+    \brief This file contains functions to support importing of raster data into a TerraLib database
+*/
+#ifndef __TERRALIB_INTERNAL_IMPORTRASTER_H
+#define __TERRALIB_INTERNAL_IMPORTRASTER_H
+
+#include "TeDataTypes.h"
+#include "TeRasterParams.h"
+
+#include <string>
+using namespace std;
+
+class TeLayer;
+class TeRaster;
+/** @defgroup RasterFunctions Functions to deal with raster data
+ *  @{
+*/
+//! Imports a TeRaster object to a database creationg a new TeLayer
+/*!
+	This function imports a raster to the database, generating a new layer.
+      \param layerName name of the layer to be created
+      \param rasterIn a pointer to the raster representation to be imported
+      \param database a pointer to the database where the raster will be imported
+	  \returns a pointer to the generated layer
+*/
+TL_DLL TeLayer* TeImportRaster (const string& layerName, TeRaster* rasterIn, TeDatabase* database);
+
+//! Imports a TeRaster object to a TeLayer
+/*!
+	This function imports a raster as a geometry of an object of a layer.
+      \param layer pointer to a layer already created
+      \param rasterIn a raster representation
+	  \param bWidth width of the blocks used to store the raster
+	  \param bHeight height of the blocks used to store the raster
+	  \param compress compression type
+	  \param objectId object identification associated to this raster
+	  \param dummy value to be used as a no data value when importing
+	  \param useDummy flag used to indicate that imported raster will have a dummy value
+	  \param indext type of tiling used to import raster
+	  \returns true or false whether the raster was imported successfully
+*/
+TL_DLL bool TeImportRaster (TeLayer* layer, TeRaster* rasterIn, unsigned int bWidth=512, unsigned int bHeight=512, 
+		TeRasterParams::TeRasterCompressionMode compress = TeRasterParams::TeNoCompression, 
+		const string& objectId="", double dummy=255,bool useDummy = false, 
+		TeRasterParams::TeRasterTilingType indext=TeRasterParams::TeNoExpansible);
+
+//! This function mosaics an input raster to one previsously existing in a TerraLib layer
+/*!
+     \param rasterIn a raster representation
+     \param layer pointer to an existing layer 
+	 \param objectId object identification associated to this raster
+	 \returns true or false whether the mosaic operation was successfull
+*/
+TL_DLL bool TeMosaicRaster(TeRaster* rasterIn, TeLayer* layer,  const string& objectId="");
+
+//! Builds a degraded resolution of a raster data
+/*!
+      \param layer pointer to a layer already created 
+      \param rasterIn a raster representation
+	  \param resFac  value to multiply the original resolution
+	  \param objectId object identification associated to this raster
+	  \returns true or false whether the raster was imported successfully
+*/
+TL_DLL bool TeBuildLowerResolution(TeLayer* layer, TeRaster* rasterIn, int resFac, const string& objectId="");
+
+//! Builds the multi resolution pyramid for a given raster
+TL_DLL bool TeBuildMultiResolutionPyramid(TeRaster* rst, int nLevels, const bool& showProgress = false);
+
+//! Builds the multi resolution pyramid for a given raster
+TL_DLL bool TeBuildAverageResolution(TeLayer* layer, int maxRes, const string& objectId="");
+/** @} */ 
+
+/** \example importJPEG.cpp
+	Shows how to import a JPEG file
+ */
+
+/** \example importGridData.cpp
+	Shows how a raster data: a binary raw grid data
+ */
+
+/** \example mosaciTIFFImages.cpp
+ * This is an example of how to build a mosaic of images as a layer in a TerraLib database
+ */
+
+#endif
+
diff --git a/src/terralib/kernel/TeInitRasterDecoders.cpp b/src/terralib/kernel/TeInitRasterDecoders.cpp
old mode 100755
new mode 100644
index 4ebc224..7857391
--- a/src/terralib/kernel/TeInitRasterDecoders.cpp
+++ b/src/terralib/kernel/TeInitRasterDecoders.cpp
@@ -1,66 +1,66 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeInitRasterDecoders.h"
-#include "TeDecoderMemoryMap.h"
-#include "TeDecoderMemory.h"
-#include "TeDecoderSmartMem.h"
-#include "TeDecoderTIFF.h"
-#include "TeDecoderJPEG.h"
-#include "TeDecoderDatabase.h"
-#include "TeDecoderFile.h"
-#include "TeDecoderSPR.h"
-#include "TeDecoderASCIIGrid.h"
-
-#include <map>
-
-void 
-TeInitRasterDecoders()
-{
-	static bool TeRasterDecoderFactoryInitalized__ = false;
-
-	if (!TeRasterDecoderFactoryInitalized__)
-	{
-		TeRasterDecoderFactoryInitalized__ = true;
-
-		static TeDecoderDatabaseFactory theDecoderDatabaseFactory("DB");
-
-		static TeDecoderMemoryFactory theDecoderMemoryFactory("MEM");
-
-		static TeDecoderSmartMemFactory teDecoderSmartMemFactory("SMARTMEM");
-
-		static TeDecoderMemoryMapFactory theDecoderMemoryMapFactory("MEMMAP");
-
-		static TeDecoderTIFFFactory theDecoderTIFFFactory("TIF");
-
-		static TeDecoderSPRFactory theDecoderSPRFactory("SPR");
-
-		static TeDecoderASCIIGridFactory theDecoderASCIIGridFactory("ASCIIGRID");
-
-		static TeDecoderJPEGFactory theDecoderJPEGFactory("JPEG");
-
-#ifdef WIN32
-		static TeDecoderFileFactory theDecoderFileFactory("RAW");
-#endif	
-   }
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeInitRasterDecoders.h"
+#include "TeDecoderMemoryMap.h"
+#include "TeDecoderMemory.h"
+#include "TeDecoderSmartMem.h"
+#include "TeDecoderTIFF.h"
+#include "TeDecoderJPEG.h"
+#include "TeDecoderDatabase.h"
+#include "TeDecoderFile.h"
+#include "TeDecoderSPR.h"
+#include "TeDecoderASCIIGrid.h"
+
+#include <map>
+
+void 
+TeInitRasterDecoders()
+{
+	static bool TeRasterDecoderFactoryInitalized__ = false;
+
+	if (!TeRasterDecoderFactoryInitalized__)
+	{
+		TeRasterDecoderFactoryInitalized__ = true;
+
+		static TeDecoderDatabaseFactory theDecoderDatabaseFactory("DB");
+
+		static TeDecoderMemoryFactory theDecoderMemoryFactory("MEM");
+
+		static TeDecoderSmartMemFactory teDecoderSmartMemFactory("SMARTMEM");
+
+		static TeDecoderMemoryMapFactory theDecoderMemoryMapFactory("MEMMAP");
+
+		static TeDecoderTIFFFactory theDecoderTIFFFactory("TIF");
+
+		static TeDecoderSPRFactory theDecoderSPRFactory("SPR");
+
+		static TeDecoderASCIIGridFactory theDecoderASCIIGridFactory("ASCIIGRID");
+
+		static TeDecoderJPEGFactory theDecoderJPEGFactory("JPEG");
+
+#ifdef WIN32
+		static TeDecoderFileFactory theDecoderFileFactory("RAW");
+#endif	
+   }
+}
diff --git a/src/terralib/kernel/TeInitRasterDecoders.h b/src/terralib/kernel/TeInitRasterDecoders.h
old mode 100755
new mode 100644
index 2be7f17..4e4a9da
--- a/src/terralib/kernel/TeInitRasterDecoders.h
+++ b/src/terralib/kernel/TeInitRasterDecoders.h
@@ -1,37 +1,37 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeInitRasterDecoders.h
-    \brief This file contains functions to deal with the initialization of raster decoding tool
-*/
-#ifndef TeInitRasterDecoders_H
-#define TeInitRasterDecoders_H
-
-#include "TeDefines.h"
-
-//! Initializes the system of decoding raster data by using the basic decoders provided by TerraLib
-/*! 
-	\sa TeRaster TeDecoder TeRasterParams
-*/
-TL_DLL void TeInitRasterDecoders();
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeInitRasterDecoders.h
+    \brief This file contains functions to deal with the initialization of raster decoding tool
+*/
+#ifndef TeInitRasterDecoders_H
+#define TeInitRasterDecoders_H
+
+#include "TeDefines.h"
+
+//! Initializes the system of decoding raster data by using the basic decoders provided by TerraLib
+/*! 
+	\sa TeRaster TeDecoder TeRasterParams
+*/
+TL_DLL void TeInitRasterDecoders();
+#endif
+
diff --git a/src/terralib/kernel/TeIntersector.cpp b/src/terralib/kernel/TeIntersector.cpp
old mode 100755
new mode 100644
index 040af46..da42877
--- a/src/terralib/kernel/TeIntersector.cpp
+++ b/src/terralib/kernel/TeIntersector.cpp
@@ -1,1056 +1,1056 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeIntersector.h"
-#include "TeRTree.h"
-#include "TeGeometryAlgorithms.h"
-#include <map>
-
-using namespace std;
-
-short TeINTERSECTOR2::TeCCW(const TeCoord2D& c1, const TeCoord2D& c2, const TeCoord2D& c3, bool& between)
-{
-	double dx1 = c2.x() - c1.x();
-	double dx2 = c3.x() - c1.x();
-	double dy1 = c2.y() - c1.y();
-	double dy2 = c3.y() - c1.y();
-
-	double dx1y2 = dx1 * dy2;
-	double dy1x2 = dy1 * dx2;
-
-	double coef = fabs(dx1y2 - dy1x2);
-
-	if(coef == 0.0)
-	{
-		// check if c3 is between c1 and c2
-		TeBox b;
-		b.x1_ = MIN(c1.x(), c2.x());
-		b.y1_ = MIN(c1.y(), c2.y());
-		b.x2_ = MAX(c1.x(), c2.x());
-		b.y2_ = MAX(c1.y(), c2.y());
-
-		if(::TeIntersects(c3, b))
-			between = true;
-
-		return TeNOTURN;
-	}
-	else
-	{
-		TeCoord2D pinter;
-		double dist = TePerpendicularDistance(c1, c2, c3, pinter); 
-
-		if(dist <= TePrecision::instance().precision())
-		{
-			// check if c3 is between c1 and c2
-			TeBox b;
-			b.x1_ = MIN(c1.x(), c2.x());
-			b.y1_ = MIN(c1.y(), c2.y());
-			b.x2_ = MAX(c1.x(), c2.x());
-			b.y2_ = MAX(c1.y(), c2.y());
-
-			if(::TeIntersects(c3, b))
-				between = true;
-
-			return TeNOTURN;
-		}
-		else			
-		{
-			if(dx1y2 > dy1x2)
-			{
-				return TeCOUNTERCLOCKWISE;
-			}
-			else
-			{
-				return TeCLOCKWISE;
-			}
-		}
-	}
-}
-
-bool TeINTERSECTOR2::TeIntersection(const TeCoord2D& a, const TeCoord2D& b, const TeCoord2D& c, const TeCoord2D& d, TeBoundaryIP& ips, TeSegmentIntersectionType& intersectionType)
-{
-	if(TeEquals(a, b))
-		return false;
-
-	if(TeEquals(c, d))
-		return false;
-
-	double xmin1 = MIN(a.x(), b.x());
-	double ymin1 = MIN(a.y(), b.y());
-	double xmax1 = MAX(a.x(), b.x());
-	double ymax1 = MAX(a.y(), b.y());
-	TeBox b1(xmin1, ymin1, xmax1, ymax1);
-
-	double xmin2 = MIN(c.x(), d.x());
-	double ymin2 = MIN(c.y(), d.y());
-	double xmax2 = MAX(c.x(), d.x());
-	double ymax2 = MAX(c.y(), d.y());
-	TeBox b2(xmin2, ymin2, xmax2, ymax2);
-
-	if(::TeIntersects(b1, b2))
-	{
-		if((TeEquals(a, c) || TeEquals(a, d)) && (TeEquals(b, c) || TeEquals(b, d)))
-		{
-			intersectionType = TeImproperIntersection;
-
-			ips.coords_.push_back(c);
-			ips.coords_.push_back(d);
-
-			return true;
-		}
-
-		bool between1 = false;
-		short sign1 = TeINTERSECTOR2::TeCCW(a, b, c, between1);
-
-		bool between2 = false;
-		short sign2 = TeINTERSECTOR2::TeCCW(a, b, d, between2);
-
-		bool between3 = false;
-		short sign3 = TeINTERSECTOR2::TeCCW(c, d, a, between3);
-
-		bool between4 = false;
-		short sign4 = TeINTERSECTOR2::TeCCW(c, d, b, between4);
-
-		if(((sign1 * sign2) <= 0) && ((sign3 * sign4) <= 0))	// if there is an intersection
-		{
-			intersectionType = TeProperIntersection;
-
-			if(between1)
-			{			
-				intersectionType = TeImproperIntersection;
-				ips.coords_.push_back(c);
-			}
-			
-			if(between2)
-			{
-				intersectionType = TeImproperIntersection;
-				ips.coords_.push_back(d);
-			}
-
-			if(between3 && !TeEquals(a, c) && !TeEquals(a, d))
-			{
-				intersectionType = TeImproperIntersection;
-
-				if(ips.coords_.size() == 2)
-					return true;
-
-				if(ips.coords_.size() == 1)
-				{
-					if(TeEquals(ips.coords_[0], a))
-						return true;
-				}
-
-				ips.coords_.push_back(a);
-			}
-			
-			if(between4 && !TeEquals(b, c) && !TeEquals(b, d))
-			{
-				intersectionType = TeImproperIntersection;
-
-				if(ips.coords_.size() == 2)
-					return true;
-
-				if(ips.coords_.size() == 1)
-				{
-					if(TeEquals(ips.coords_[0], b))
-						return true;
-				}
-
-				ips.coords_.push_back(b);
-			}
-
-			if(intersectionType == TeImproperIntersection)
-				return true;
-
-			double denominator = (d.y() - c.y()) * (b.x() - a.x()) - (d.x() - c.x()) * (b.y() - a.y());
-			
-			if(denominator == 0.0)	// parallel can not occur here any more! I expect this is true!
-				return false;		
-
-			// parameters
-			double Ua = ((d.x() - c.x()) * (a.y() - c.y()) - (d.y() - c.y()) * (a.x() - c.x())) / denominator; 
-			//double Ub = ((b.x() - a.x()) * (a.y() - c.y()) - (b.y() - a.y()) * (a.x() - c.x())) / denominator; 
-
-			TeCoord2D caux(a.x() + Ua * (b.x() - a.x()), a.y() + Ua * (b.y() - a.y()));
-
-			if(TeEquals(caux, a))
-			{
-				ips.coords_.push_back(a);
-				return true;
-			}
-
-			if(TeEquals(caux, b))
-			{
-				ips.coords_.push_back(b);
-				return true;
-			}
-
-			if(TeEquals(caux, c))
-			{
-				ips.coords_.push_back(c);
-				return true;
-			}
-
-			if(TeEquals(caux, d))
-			{
-				ips.coords_.push_back(d);
-				return true;
-			}
-
-			ips.coords_.push_back(caux);
-			
-			return true;
-		}
-	}
-
-	intersectionType = TeImproperIntersection;
-
-	return false;
-}
-
-bool TeINTERSECTOR2::TeIntersects(const TeCoord2D& a, const TeCoord2D& b, const TeCoord2D& c, const TeCoord2D& d, TeSegmentIntersectionType& intersectionType)
-{	
-	if(TeEquals(a, b))
-		return false;
-
-	if(TeEquals(c, d))
-		return false;
-
-	double xmin1 = MIN(a.x(), b.x());
-	double ymin1 = MIN(a.y(), b.y());
-	double xmax1 = MAX(a.x(), b.x());
-	double ymax1 = MAX(a.y(), b.y());
-	TeBox b1(xmin1, ymin1, xmax1, ymax1);
-
-	double xmin2 = MIN(c.x(), d.x());
-	double ymin2 = MIN(c.y(), d.y());
-	double xmax2 = MAX(c.x(), d.x());
-	double ymax2 = MAX(c.y(), d.y());
-	TeBox b2(xmin2, ymin2, xmax2, ymax2);
-
-	if(::TeIntersects(b1, b2))
-	{
-		if((TeEquals(a, c) || TeEquals(a, d)) && (TeEquals(b, c) || TeEquals(b, d)))
-		{
-			intersectionType = TeImproperIntersection;
-
-			return true;
-		}
-
-		bool between1 = false;
-		short sign1 = TeINTERSECTOR2::TeCCW(a, b, c, between1);
-
-		bool between2 = false;
-		short sign2 = TeINTERSECTOR2::TeCCW(a, b, d, between2);
-
-		bool between3 = false;
-		short sign3 = TeINTERSECTOR2::TeCCW(c, d, a, between3);
-
-		bool between4 = false;
-		short sign4 = TeINTERSECTOR2::TeCCW(c, d, b, between4);
-
-		if((sign1 * sign2) <= 0 && (sign3 * sign4 <= 0))	// if there is an intersection
-		{
-			intersectionType = TeProperIntersection;
-
-			if(between1 || between2 || between3 || between4)
-			{			
-				intersectionType = TeImproperIntersection;
-			}			
-
-			return true;
-		}
-	}
-		
-	return false;
-}
-
-bool TeINTERSECTOR2::TeIntersects(const TeLine2D& redLine, const TeLine2D& blueLine)
-{
-	if(redLine.size() < 2 || blueLine.size() < 2) 
-		return false; 
-
-	if(TeDisjoint(redLine.box(), blueLine.box()))
-		return false;
-
-	unsigned int i = 0;
-	unsigned int j = 0;
-
-	TeBox interBox;
-	
-	// Creates a intersection box from lines boxes.
-	::TeIntersection(redLine.box(), blueLine.box(), interBox);
-
-	unsigned int nstep_redLine  = redLine.size() - 1;
-	unsigned int nstep_blueLine = blueLine.size() - 1;
-
-	TeSegmentIntersectionType t = TeImproperIntersection;
-
-	for(i = 0; i < nstep_redLine; ++i)
-	{
-		// Creates the segment box.
-		TeBox red_box = makeBox(redLine[i].x(), redLine[i].y(), redLine[i+1].x(), redLine[i+1].y());
-
-		// See if red segment box intersects with the intersection box.
-		if(TeDisjoint(interBox, red_box))
-			continue;	// If it doesn't intersect, go to another segment => skip comparasion beteween other "m" segments.
-
-		for(j = 0; j < nstep_blueLine; ++j)
-		{
-			// Check intersection.
-			if(TeINTERSECTOR2::TeIntersects(redLine[i], redLine[i+1], blueLine[j], blueLine[j+1], t))
-				return true;
-		}
-	}	
-
-	return false;
-}
-
-bool TeINTERSECTOR2::TeSafeIntersections(const TeLine2D& redLine, const TeLine2D& blueLine, TeVectorBoundaryIP& report, const unsigned int& redObjId, const unsigned int& blueObjId)
-{
-	if(redLine.size() < 2 || blueLine.size() < 2) 
-		return false; 
-
-	if(TeDisjoint(redLine.box(), blueLine.box()))
-		return false;
-
-	unsigned int i = 0;
-	unsigned int j = 0;
-
-	TeBox interBox;
-	
-	bool hasIntersections = false;
-
-	// Creates a intersection box from lines boxes.
-	::TeIntersection(redLine.box(), blueLine.box(), interBox);
-
-	unsigned int nstep_redLine  = redLine.size() - 1;
-	unsigned int nstep_blueLine = blueLine.size() - 1;
-
-	TeSegmentIntersectionType t = TeImproperIntersection;
-
-	for(i = 0; i < nstep_redLine; ++i)
-	{
-		// Creates the segment box.
-		TeBox red_box = makeBox(redLine[i].x_, redLine[i].y_, redLine[i+1].x_, redLine[i+1].y_);
-
-		// See if red segment box intersects with the intersection box.
-		if(TeDisjoint(interBox, red_box))
-			continue;	// If it doesn't intersect, go to another segment => skip comparasion beteween other "m" segments.
-
-		for(j = 0; j < nstep_blueLine; ++j)
-		{
-			// Check intersection.
-			TeBoundaryIP ip;
-
-			if(TeIntersection(redLine[i], redLine[i+1], blueLine[j], blueLine[j+1], ip, t))
-			{
-				hasIntersections = true;
-
-				ip.redPartNum_ = redObjId;
-				ip.redSegNum_ = i;
-				ip.bluePartNum_ = blueObjId;
-				ip.blueSegNum_ = j;
-
-				if(ip.coords_.size() == 2)	//overlap
-				{
-					// Verificar se os pontos est�o em ordem crescente
-					if(ip.coords_[0].x_ < ip.coords_[1].x_)
-					{
-						report.push_back(ip);
-					}
-					else if(ip.coords_[0].x_ > ip.coords_[1].x_)
-					{
-						swap(ip.coords_[0], ip.coords_[1]);
-						report.push_back(ip);
-					}
-					else if(ip.coords_[0].y_ < ip.coords_[1].y_)
-					{
-						report.push_back(ip);						
-					}
-					else
-					{
-						swap(ip.coords_[0], ip.coords_[1]);
-						
-						report.push_back(ip);						
-					}
-
-				}
-				else
-				{
-					report.push_back(ip);
-				}
-			}
-		}
-	}	
-
-	return hasIntersections;
-}
-
-bool TeINTERSECTOR2::TeSafeIntersections(const TePolygonSet& redPols, const TePolygonSet& bluePols, TeVectorBoundaryIP& report)
-{
-	unsigned int redPart = 0;
-	unsigned int redPolsSize = redPols.size();
-
-	unsigned int i, k;
-	register unsigned int j, l;
-
-	// Loops through red polygons
-	for(i = 0; i < redPolsSize; ++i)
-	{
-		TePolygon redPol = redPols[i];
-		unsigned int redPolSize = redPol.size();
-
-		// Loops through red polygons rings
-		for(j = 0; j < redPolSize; ++j)
-		{
-			TeLinearRing redRing = redPol[j];			
-
-			// Loops through blue polygons
-			unsigned int bluePart = 0;
-			unsigned int bluePolsSize =  bluePols.size();
-
-			for(k = 0; k < bluePolsSize; ++k)
-			{
-				// Loops through blue polygons rings
-				TePolygon bluePol = bluePols[k];
-
-				unsigned int bluePolSize = bluePol.size();
-
-				for(l = 0; l < bluePolSize; ++l)
-				{
-					TeLinearRing blueRing = bluePol[l];
-
-					TeSafeIntersections(redRing, blueRing, report, redPart, bluePart);
-
-					++bluePart;
-				}
-			}
-
-			++redPart;
-		}
-	}
-
-	return !report.empty();
-}
-
-// Put polygon set segments into the index
-void TeINTERSECTOR2::TeIndexPolygonSet(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree)
-{
-	unsigned int nPols = polygons.size();	
-	unsigned int i, j, k;
-
-	for(i = 0; i < nPols; ++i)
-	{
-		unsigned int nRings = polygons[i].size();
-
-		for(j = 0; j < nRings; ++j)
-		{
-			unsigned int nSegs = polygons[i][j].size() - 1;
-
-			for(k = 0; k < nSegs; ++k)
-			{
-				TeBox b;
-
-				b.x1_ = MIN(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
-				b.y1_ = MIN(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
-				b.x2_ = MAX(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
-				b.y2_ = MAX(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
-
-				TeINTERSECTOR2::TeSegIdInPolygonSet sid;
-
-				sid.polId_  = i;
-				sid.lineId_   = j;
-				sid.segId_ = k;
-
-				tree.insert(b, sid);
-			}
-		}
-	}
-
-	return;
-}
-
-// Estrutura auxiliar para indexar cada um dos pontos de intersecao em um multimap
-struct TeIntersectionIndexKey
-{
-	unsigned int segNum_;
-	unsigned int partNum_;
-	unsigned int polNum_;
-
-	TeIntersectionIndexKey()
-		: segNum_(0), partNum_(0), polNum_(0)
-	{
-	}
-
-	TeIntersectionIndexKey(const unsigned int& segNum, const unsigned int& partNum, const unsigned int& polNum)
-		: segNum_(segNum), partNum_(partNum), polNum_(polNum)
-	{
-	}
-
-	bool operator<(const TeIntersectionIndexKey& rhs) const
-	{
-		if(polNum_ < rhs.polNum_)
-			return true;
-
-		if(polNum_ > rhs.polNum_)
-			return false;
-
-		if(partNum_ < rhs.partNum_)
-			return true;
-
-		if(partNum_ > rhs.partNum_)
-			return false;
-
-		if(segNum_ < rhs.segNum_)
-			return true;
-
-		if(segNum_ > rhs.segNum_)
-			return false;
-
-		return false;
-	}
-};
-
-
-typedef multimap<TeIntersectionIndexKey, unsigned int> TeIntersectionIndex;
-
-// Dado um ponto de intersecao, faz a normalizacao do mesmo: procura um ponto correlato na lista de intersecao e tenta usar as mesmas coordenadas
-void TeNormalizeIntersection(TeINTERSECTOR2::TeBoundaryIP& ip, TeINTERSECTOR2::TeVectorBoundaryIP& report, TeIntersectionIndex& interIndex)
-{
-	TeIntersectionIndexKey key(ip.blueSegNum_, ip.bluePartNum_, ip.bluePolNum_);
-
-	pair<TeIntersectionIndex::iterator, TeIntersectionIndex::iterator> its = interIndex.equal_range(key);
-
-//	bool eraseOwn = false;
-
-	while(its.first != its.second)
-	{
-// se achamos um indice, vamos verificar se ele possui um ponto de intersecao que seja igual ao que temos em maos, segundo a tolerancia
-		unsigned int position = its.first->second;
-
-		if(TeEquals(report[position].coords_[0], ip.coords_[0]))
-		{
-			ip.coords_[0] = report[position].coords_[0];
-		}
-
-		if(ip.coords_.size() == 2 && report[position].coords_.size() == 1)
-		{
-			if(TeEquals(report[position].coords_[0], ip.coords_[1]))
-				ip.coords_[1] = report[position].coords_[0];			
-		}
-
-		if(ip.coords_.size() == 1 && report[position].coords_.size() == 2)
-		{
-			if(TeEquals(report[position].coords_[1], ip.coords_[0]))
-				ip.coords_[0] = report[position].coords_[1];			
-
-		}
-
-		if(ip.coords_.size() == 2 && report[position].coords_.size() == 2)
-
-		{
-			if(TeEquals(report[position].coords_[1], ip.coords_[1]))
-				ip.coords_[1] = report[position].coords_[1];
-
-			if(TeEquals(report[position].coords_[0], ip.coords_[1]))
-				ip.coords_[1] = report[position].coords_[0];
-
-
-			if(TeEquals(report[position].coords_[1], ip.coords_[0]))
-				ip.coords_[0] = report[position].coords_[1];
-		}
-
-		++its.first;
-	}
-}
-
-// insere a informacao da intersecao no indice
-void TeIndexIntersection(TeINTERSECTOR2::TeBoundaryIP& ip, const unsigned int& redPos, const unsigned int& bluePos, TeIntersectionIndex& interIndex)
-{
-	TeIntersectionIndexKey redkey(ip.redSegNum_, ip.redPartNum_, ip.redPolNum_);
-	TeIntersectionIndexKey bluekey(ip.blueSegNum_, ip.bluePartNum_, ip.bluePolNum_);
-
-	interIndex.insert(pair<TeIntersectionIndexKey, unsigned int>(redkey, redPos));
-	interIndex.insert(pair<TeIntersectionIndexKey, unsigned int>(bluekey, bluePos));
-}
-
-// insere o ponto de intersecao na lista
-void TeInsertIntersection(TeINTERSECTOR2::TeBoundaryIP& ip, TeINTERSECTOR2::TeVectorBoundaryIP& report)
-{
-	if(ip.coords_.size() == 2)	//overlap
-	{
-// put intersections in increase order of 'x'
-		if(ip.coords_[0].x_ < ip.coords_[1].x_)
-		{
-			report.push_back(ip);
-		}
-		else if(ip.coords_[0].x_ > ip.coords_[1].x_)
-		{
-			swap(ip.coords_[0], ip.coords_[1]);
-			report.push_back(ip);			
-		}
-		else if(ip.coords_[0].y_ < ip.coords_[1].y_)
-		{
-			report.push_back(ip);						
-		}
-		else
-		{
-			swap(ip.coords_[0], ip.coords_[1]);							
-			report.push_back(ip);
-		}
-	}
-	else
-	{
-		report.push_back(ip);
-	}
-}
-
-// Find intersection into two distinct sets: red and blue
-bool TeINTERSECTOR2::TeIntersection(const TePolygonSet& redPolygons, TeINTERSECTOR2::TeSegmentRTree& redTree, const TePolygonSet& bluePolygons, TeINTERSECTOR2::TeVectorBoundaryIP& report)
-{
-// if index is empty, so we index first
-	if(redTree.isEmpty())
-		TeINTERSECTOR2::TeIndexPolygonSet(redPolygons, redTree);
-
-	TeIntersectionIndex interIndex;
-
-	unsigned int nPols = bluePolygons.size();	
-
-	TeSegmentIntersectionType t = TeImproperIntersection;
-
-	unsigned int i, j, k, l;
-	for(i = 0; i < nPols; ++i)
-	{
-		unsigned int nRings = bluePolygons[i].size();
-
-		for(j = 0; j < nRings; ++j)
-		{
-			unsigned int nSegs = bluePolygons[i][j].size() - 1;
-
-// for each blue segment, find the one's that can intersects it into the red index tree
-			for(k = 0; k < nSegs; ++k)
-			{
-				TeBox b;
-
-				b.x1_ = MIN(bluePolygons[i][j][k].x(), bluePolygons[i][j][k + 1].x());
-				b.y1_ = MIN(bluePolygons[i][j][k].y(), bluePolygons[i][j][k + 1].y());
-				b.x2_ = MAX(bluePolygons[i][j][k].x(), bluePolygons[i][j][k + 1].x());
-				b.y2_ = MAX(bluePolygons[i][j][k].y(), bluePolygons[i][j][k + 1].y());
-
-				vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
-
-				redTree.search(b, segs);
-
-				unsigned int nSegsInter = segs.size();
-
-// depois tentamos achar os pontos de intersecao
-				for(l = 0; l < nSegsInter; ++l)
-				{
-					TeINTERSECTOR2::TeBoundaryIP ip1;
-
-					if(TeINTERSECTOR2::TeIntersection(bluePolygons[i][j][k], bluePolygons[i][j][k + 1], redPolygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_], redPolygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_ + 1], ip1, t))
-					{
-						ip1.redPolNum_ = segs[l].polId_;
-						ip1.redPartNum_ = segs[l].lineId_;
-						ip1.redSegNum_ = segs[l].segId_;
-
-						ip1.bluePolNum_ = i;
-						ip1.bluePartNum_ = j;
-						ip1.blueSegNum_ = k;
-
-						// normaliza a intersecao: se achar um outro pontos na lista de intersecao semelhante, usaremos o semelhante!
-						TeNormalizeIntersection(ip1, report, interIndex);
-
-
-						TeINTERSECTOR2::TeBoundaryIP ip2;	// objeto auxiliar
-						ip2.redPolNum_ = i;
-						ip2.redPartNum_ = j;
-						ip2.redSegNum_ = k;
-
-						ip2.bluePolNum_ = segs[l].polId_;
-						ip2.bluePartNum_ = segs[l].lineId_;
-						ip2.blueSegNum_ = segs[l].segId_;
-
-						ip2.coords_ = ip1.coords_;
-
-						TeNormalizeIntersection(ip2, report, interIndex);
-
-						ip1.coords_ = ip2.coords_;
-
-						TeInsertIntersection(ip1, report);						
-
-						TeIndexIntersection(ip1, report.size() - 1, report.size() - 1, interIndex);
-					}
-				}
-			}			
-		}
-	}
-
-	return !report.empty();
-}
-
-bool TeINTERSECTOR2::TeIsSimple(const TePolygonSet& polygons, vector<TeINTERSECTOR2::TePairSegIdInPolygonSet>& selfIntersectionList)
-{
-	bool hasSelfIntersection = false;
-
-	TeSegmentIntersectionType t = TeImproperIntersection;
-
-// create index tree
-	TeINTERSECTOR2::TeSegmentRTree tree(polygons.box());
-
-// loop through segments
-	unsigned int nPols = polygons.size();	
-
-	unsigned int i, j, k, l;
-
-	for(i = 0; i < nPols; ++i)
-	{
-		unsigned int nRings = polygons[i].size();
-
-		for(j = 0; j < nRings; ++j)
-		{
-			unsigned int nSegs = polygons[i][j].size() - 1;
-
-			for(k = 0; k < nSegs; ++k)
-			{
-				TeBox b;
-
-				b.x1_ = MIN(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
-				b.y1_ = MIN(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
-				b.x2_ = MAX(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
-				b.y2_ = MAX(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
-
-				TeINTERSECTOR2::TeSegIdInPolygonSet sid;
-
-				sid.polId_  = i;
-				sid.lineId_   = j;
-				sid.segId_ = k;
-
-// try to find filter segments that boxe intersects this segment
-				vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
-	
-				tree.search(b, segs);
-
-				unsigned int nSegsInter = segs.size();
-
-// if found, loops through segments to see if there are intersections
-				for(l = 0; l < nSegsInter; ++l)
-				{
-					TeINTERSECTOR2::TeBoundaryIP ip;
-
-					if(TeIntersection(polygons[i][j][k], polygons[i][j][k + 1], polygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_], polygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_ + 1], ip, t))
-					{
-// if there is intersection, we have to cases:
-						if(ip.coords_.size() == 2)
-						{
-// first, the segment overlaps another: so this configures a selfintersection
-							hasSelfIntersection = true;
-
-							selfIntersectionList.push_back(TePairSegIdInPolygonSet(sid, segs[l]));
-						}
-						else
-						{
-// second, the segment intersects in one point: so this may be a selft-intersection or may be a intersection between the posterior segment (already inserted) in this second, no worry it is right
-							if((sid.polId_ != segs[l].polId_) || (sid.lineId_ != segs[l].lineId_))
-							{
-								hasSelfIntersection = true;
-
-								selfIntersectionList.push_back(TePairSegIdInPolygonSet(sid, segs[l]));
-							}
-							else
-							{
-// we must look if they are consecutives (remeber last an firt will have intersections) 
-								int auxSegId = (int)sid.segId_;
-								int otherSegId = (int)(segs[l].segId_);
-
-// if it intersects the previous or the next, it's ok!
-								if((auxSegId == (otherSegId + 1)) || (auxSegId == (otherSegId -1)))
-								{
-									continue;
-								}
-								else
-								{
-// we need to see if it is not between last and first
-									if(auxSegId == (int)(polygons[sid.polId_][sid.lineId_].size() - 2))
-									{
-// ok, it is a consecutive intersection between last and first
-										if(otherSegId == 0)
-											continue;
-									}
-									else if(auxSegId == 0)
-									{
-// ok, it is a consecutive intersection between first and last
-										if(otherSegId == (int)(polygons[segs[l].polId_][segs[l].lineId_].size() - 2))
-											continue;
-									}
-
-									hasSelfIntersection = true;
-
-									selfIntersectionList.push_back(TePairSegIdInPolygonSet(sid, segs[l]));
-								}
-							}
-						}
-
-					}
-				}
-
-// inserts the segment into the tree
-				tree.insert(b, sid);
-			}
-		}
-	}
-
-	tree.clear();
-
-	return !hasSelfIntersection;
-}
-
-// Find intersection into two distinct sets: red lines and blue polygons
-bool TeINTERSECTOR2::TeIntersection(const TeLineSet& redLines, const TePolygonSet& bluePolygons, TeSegmentRTree& blueTree, TeINTERSECTOR2::TeVectorBoundaryIP& report)
-{
-// if index is empty, so we index the segments from polygonset first
-	if(blueTree.isEmpty())
-		TeINTERSECTOR2::TeIndexPolygonSet(bluePolygons, blueTree);
-
-// for each lines we must compute intersections
-	unsigned int nLines = redLines.size();	
-
-	TeSegmentIntersectionType t = TeImproperIntersection;
-
-	unsigned int i, j, l;
-
-	for(i = 0; i < nLines; ++i)
-	{
-		unsigned int nSegs = redLines[i].size() - 1;
-
-		for(j = 0; j < nSegs; ++j)
-		{
-// for each segment we compute intersections
-			TeBox b;
-
-			b.x1_ = MIN(redLines[i][j].x(), redLines[i][j + 1].x());
-			b.y1_ = MIN(redLines[i][j].y(), redLines[i][j + 1].y());
-			b.x2_ = MAX(redLines[i][j].x(), redLines[i][j + 1].x());
-			b.y2_ = MAX(redLines[i][j].y(), redLines[i][j + 1].y());
-
-			vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
-
-			blueTree.search(b, segs);
-
-			unsigned int nSegsInter = segs.size();
-
-// depois tentamos achar os pontos de intersecao
-			for(l = 0; l < nSegsInter; ++l)
-			{
-				TeINTERSECTOR2::TeBoundaryIP ip1;
-
-				if(TeINTERSECTOR2::TeIntersection(redLines[i][j], redLines[i][j + 1], bluePolygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_], bluePolygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_ + 1], ip1, t))
-				{
-					ip1.redPolNum_ = 0;
-					ip1.redPartNum_ = i;
-					ip1.redSegNum_ = j;
-
-					ip1.bluePolNum_ = segs[l].polId_;
-					ip1.bluePartNum_ = segs[l].lineId_;
-					ip1.blueSegNum_ = segs[l].segId_;
-
-					if(ip1.coords_.size() == 2)	//overlap
-					{
-						// Verificar se os pontos estao em ordem crescente
-						if(ip1.coords_[0].x_ < ip1.coords_[1].x_)
-						{
-							report.push_back(ip1);
-						}
-						else if(ip1.coords_[0].x_ > ip1.coords_[1].x_)
-						{
-							swap(ip1.coords_[0], ip1.coords_[1]);
-							report.push_back(ip1);
-						}
-						else if(ip1.coords_[0].y_ < ip1.coords_[1].y_)
-						{
-							report.push_back(ip1);						
-						}
-						else
-						{
-							swap(ip1.coords_[0], ip1.coords_[1]);							
-							report.push_back(ip1);						
-						}
-					}
-					else
-					{
-						report.push_back(ip1);
-					}
-				}
-			}
-		}
-	}
-
-	return !report.empty();
-}
-
-// Find intersection between segments into polygonset list
-bool TeINTERSECTOR2::TeIntersection(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree, TeINTERSECTOR2::TeVectorBoundaryIP& report)
-{
-// clear tree before start process
-	tree.clear();
-
-	TeIntersectionIndex interIndex;
-
-	unsigned int nPols = polygons.size();	
-
-	if(nPols == 0)
-		return false;
-
-	unsigned int nLines = polygons[0].size();	
-
-	unsigned int i, j, k, l;
-
-// the first polygon's segments are all indexed into the tree
-	for(i = 0; i < nLines; ++i)
-	{
-		unsigned int nSegs = polygons[0][i].size() - 1;
-
-		for(j = 0; j < nSegs; ++j)
-		{
-			TeBox b;
-
-			b.x1_ = MIN(polygons[0][i][j].x(), polygons[0][i][j + 1].x());
-			b.y1_ = MIN(polygons[0][i][j].y(), polygons[0][i][j + 1].y());
-			b.x2_ = MAX(polygons[0][i][j].x(), polygons[0][i][j + 1].x());
-			b.y2_ = MAX(polygons[0][i][j].y(), polygons[0][i][j + 1].y());
-
-			TeINTERSECTOR2::TeSegIdInPolygonSet sid;
-
-			sid.polId_  = 0;
-			sid.lineId_   = i;
-			sid.segId_ = j;
-
-			tree.insert(b, sid);
-		}
-	}
-	
-	TeSegmentIntersectionType t = TeImproperIntersection;
-
-// for each polygon, we first test intersection of all segments  and then put them into the index
-	for(i = 1; i < nPols; ++i)
-	{
-		unsigned int nLines = polygons[i].size();	
-
-// for each line of the polygon, verifies intersection against the segments into the index
-		for(j = 0; j < nLines; ++j)
-		{
-			unsigned int nSegs = polygons[i][j].size() - 1;
-
-			for(k = 0; k < nSegs; ++k)
-			{
-// for each segment we find the one's that intersects its bounding box
-				TeBox b;
-
-				b.x1_ = MIN(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
-				b.y1_ = MIN(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
-				b.x2_ = MAX(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
-				b.y2_ = MAX(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
-
-				vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
-
-				tree.search(b, segs);
-
-				unsigned int nSegsInter = segs.size();
-
-// if there are candidates, try to find intersections
-				for(l = 0; l < nSegsInter; ++l)
-				{
-					TeINTERSECTOR2::TeBoundaryIP ip1;
-
-					TeINTERSECTOR2::TeBoundaryIP ip2;
-
-					if(TeINTERSECTOR2::TeIntersection(polygons[i][j][k], polygons[i][j][k + 1], polygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_], polygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_ + 1], ip1, t))
-					{
-// if the segment intersects a candidate, stores theirs intersection points
-						ip1.redPolNum_  = i;
-						ip1.redPartNum_ = j;
-						ip1.redSegNum_  = k;
-						ip1.bluePolNum_ = segs[l].polId_;
-						ip1.bluePartNum_ = segs[l].lineId_;
-						ip1.blueSegNum_ = segs[l].segId_;
-
-						// normaliza a intersecao: se achar um outro pontos na lista de intersecao semelhante, usaremos o semelhante!
-						TeNormalizeIntersection(ip1, report, interIndex);						
-
-						ip2.redPolNum_ = segs[l].polId_;
-						ip2.redPartNum_ = segs[l].lineId_;
-						ip2.redSegNum_ = segs[l].segId_;
-
-						ip2.bluePolNum_ = i;
-						ip2.bluePartNum_ = j;
-						ip2.blueSegNum_ = k;
-
-						ip2.coords_ = ip1.coords_;
-
-						TeNormalizeIntersection(ip2, report, interIndex);
-
-						ip1.coords_ = ip2.coords_;
-
-// insere os pontos de intersecao na lista de intersecao e no multi-map
-						TeInsertIntersection(ip1, report);						
-						TeInsertIntersection(ip2, report);
-
-						TeIndexIntersection(ip1, report.size() - 2, report.size() - 1, interIndex);	
-					}
-				}
-			}
-		}
-	
-// after the search for intersection, put segfments into index
-		for(j = 0; j < nLines; ++j)
-		{
-			unsigned int nSegs = polygons[i][j].size() - 1;
-
-			for(k = 0; k < nSegs; ++k)
-			{
-				TeBox b;
-
-				b.x1_ = MIN(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
-				b.y1_ = MIN(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
-				b.x2_ = MAX(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
-				b.y2_ = MAX(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
-
-				TeSegIdInPolygonSet sid;
-
-				sid.polId_ = i;
-				sid.lineId_ = j;
-				sid.segId_ = k;
-
-				tree.insert(b, sid);
-			}
-		}
-	}
-
-	return !report.empty();
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeIntersector.h"
+#include "TeRTree.h"
+#include "TeGeometryAlgorithms.h"
+#include <map>
+
+using namespace std;
+
+short TeINTERSECTOR2::TeCCW(const TeCoord2D& c1, const TeCoord2D& c2, const TeCoord2D& c3, bool& between)
+{
+	double dx1 = c2.x() - c1.x();
+	double dx2 = c3.x() - c1.x();
+	double dy1 = c2.y() - c1.y();
+	double dy2 = c3.y() - c1.y();
+
+	double dx1y2 = dx1 * dy2;
+	double dy1x2 = dy1 * dx2;
+
+	double coef = fabs(dx1y2 - dy1x2);
+
+	if(coef == 0.0)
+	{
+		// check if c3 is between c1 and c2
+		TeBox b;
+		b.x1_ = MIN(c1.x(), c2.x());
+		b.y1_ = MIN(c1.y(), c2.y());
+		b.x2_ = MAX(c1.x(), c2.x());
+		b.y2_ = MAX(c1.y(), c2.y());
+
+		if(::TeIntersects(c3, b))
+			between = true;
+
+		return TeNOTURN;
+	}
+	else
+	{
+		TeCoord2D pinter;
+		double dist = TePerpendicularDistance(c1, c2, c3, pinter); 
+
+		if(dist <= TePrecision::instance().precision())
+		{
+			// check if c3 is between c1 and c2
+			TeBox b;
+			b.x1_ = MIN(c1.x(), c2.x());
+			b.y1_ = MIN(c1.y(), c2.y());
+			b.x2_ = MAX(c1.x(), c2.x());
+			b.y2_ = MAX(c1.y(), c2.y());
+
+			if(::TeIntersects(c3, b))
+				between = true;
+
+			return TeNOTURN;
+		}
+		else			
+		{
+			if(dx1y2 > dy1x2)
+			{
+				return TeCOUNTERCLOCKWISE;
+			}
+			else
+			{
+				return TeCLOCKWISE;
+			}
+		}
+	}
+}
+
+bool TeINTERSECTOR2::TeIntersection(const TeCoord2D& a, const TeCoord2D& b, const TeCoord2D& c, const TeCoord2D& d, TeBoundaryIP& ips, TeSegmentIntersectionType& intersectionType)
+{
+	if(TeEquals(a, b))
+		return false;
+
+	if(TeEquals(c, d))
+		return false;
+
+	double xmin1 = MIN(a.x(), b.x());
+	double ymin1 = MIN(a.y(), b.y());
+	double xmax1 = MAX(a.x(), b.x());
+	double ymax1 = MAX(a.y(), b.y());
+	TeBox b1(xmin1, ymin1, xmax1, ymax1);
+
+	double xmin2 = MIN(c.x(), d.x());
+	double ymin2 = MIN(c.y(), d.y());
+	double xmax2 = MAX(c.x(), d.x());
+	double ymax2 = MAX(c.y(), d.y());
+	TeBox b2(xmin2, ymin2, xmax2, ymax2);
+
+	if(::TeIntersects(b1, b2))
+	{
+		if((TeEquals(a, c) || TeEquals(a, d)) && (TeEquals(b, c) || TeEquals(b, d)))
+		{
+			intersectionType = TeImproperIntersection;
+
+			ips.coords_.push_back(c);
+			ips.coords_.push_back(d);
+
+			return true;
+		}
+
+		bool between1 = false;
+		short sign1 = TeINTERSECTOR2::TeCCW(a, b, c, between1);
+
+		bool between2 = false;
+		short sign2 = TeINTERSECTOR2::TeCCW(a, b, d, between2);
+
+		bool between3 = false;
+		short sign3 = TeINTERSECTOR2::TeCCW(c, d, a, between3);
+
+		bool between4 = false;
+		short sign4 = TeINTERSECTOR2::TeCCW(c, d, b, between4);
+
+		if(((sign1 * sign2) <= 0) && ((sign3 * sign4) <= 0))	// if there is an intersection
+		{
+			intersectionType = TeProperIntersection;
+
+			if(between1)
+			{			
+				intersectionType = TeImproperIntersection;
+				ips.coords_.push_back(c);
+			}
+			
+			if(between2)
+			{
+				intersectionType = TeImproperIntersection;
+				ips.coords_.push_back(d);
+			}
+
+			if(between3 && !TeEquals(a, c) && !TeEquals(a, d))
+			{
+				intersectionType = TeImproperIntersection;
+
+				if(ips.coords_.size() == 2)
+					return true;
+
+				if(ips.coords_.size() == 1)
+				{
+					if(TeEquals(ips.coords_[0], a))
+						return true;
+				}
+
+				ips.coords_.push_back(a);
+			}
+			
+			if(between4 && !TeEquals(b, c) && !TeEquals(b, d))
+			{
+				intersectionType = TeImproperIntersection;
+
+				if(ips.coords_.size() == 2)
+					return true;
+
+				if(ips.coords_.size() == 1)
+				{
+					if(TeEquals(ips.coords_[0], b))
+						return true;
+				}
+
+				ips.coords_.push_back(b);
+			}
+
+			if(intersectionType == TeImproperIntersection)
+				return true;
+
+			double denominator = (d.y() - c.y()) * (b.x() - a.x()) - (d.x() - c.x()) * (b.y() - a.y());
+			
+			if(denominator == 0.0)	// parallel can not occur here any more! I expect this is true!
+				return false;		
+
+			// parameters
+			double Ua = ((d.x() - c.x()) * (a.y() - c.y()) - (d.y() - c.y()) * (a.x() - c.x())) / denominator; 
+			//double Ub = ((b.x() - a.x()) * (a.y() - c.y()) - (b.y() - a.y()) * (a.x() - c.x())) / denominator; 
+
+			TeCoord2D caux(a.x() + Ua * (b.x() - a.x()), a.y() + Ua * (b.y() - a.y()));
+
+			if(TeEquals(caux, a))
+			{
+				ips.coords_.push_back(a);
+				return true;
+			}
+
+			if(TeEquals(caux, b))
+			{
+				ips.coords_.push_back(b);
+				return true;
+			}
+
+			if(TeEquals(caux, c))
+			{
+				ips.coords_.push_back(c);
+				return true;
+			}
+
+			if(TeEquals(caux, d))
+			{
+				ips.coords_.push_back(d);
+				return true;
+			}
+
+			ips.coords_.push_back(caux);
+			
+			return true;
+		}
+	}
+
+	intersectionType = TeImproperIntersection;
+
+	return false;
+}
+
+bool TeINTERSECTOR2::TeIntersects(const TeCoord2D& a, const TeCoord2D& b, const TeCoord2D& c, const TeCoord2D& d, TeSegmentIntersectionType& intersectionType)
+{	
+	if(TeEquals(a, b))
+		return false;
+
+	if(TeEquals(c, d))
+		return false;
+
+	double xmin1 = MIN(a.x(), b.x());
+	double ymin1 = MIN(a.y(), b.y());
+	double xmax1 = MAX(a.x(), b.x());
+	double ymax1 = MAX(a.y(), b.y());
+	TeBox b1(xmin1, ymin1, xmax1, ymax1);
+
+	double xmin2 = MIN(c.x(), d.x());
+	double ymin2 = MIN(c.y(), d.y());
+	double xmax2 = MAX(c.x(), d.x());
+	double ymax2 = MAX(c.y(), d.y());
+	TeBox b2(xmin2, ymin2, xmax2, ymax2);
+
+	if(::TeIntersects(b1, b2))
+	{
+		if((TeEquals(a, c) || TeEquals(a, d)) && (TeEquals(b, c) || TeEquals(b, d)))
+		{
+			intersectionType = TeImproperIntersection;
+
+			return true;
+		}
+
+		bool between1 = false;
+		short sign1 = TeINTERSECTOR2::TeCCW(a, b, c, between1);
+
+		bool between2 = false;
+		short sign2 = TeINTERSECTOR2::TeCCW(a, b, d, between2);
+
+		bool between3 = false;
+		short sign3 = TeINTERSECTOR2::TeCCW(c, d, a, between3);
+
+		bool between4 = false;
+		short sign4 = TeINTERSECTOR2::TeCCW(c, d, b, between4);
+
+		if((sign1 * sign2) <= 0 && (sign3 * sign4 <= 0))	// if there is an intersection
+		{
+			intersectionType = TeProperIntersection;
+
+			if(between1 || between2 || between3 || between4)
+			{			
+				intersectionType = TeImproperIntersection;
+			}			
+
+			return true;
+		}
+	}
+		
+	return false;
+}
+
+bool TeINTERSECTOR2::TeIntersects(const TeLine2D& redLine, const TeLine2D& blueLine)
+{
+	if(redLine.size() < 2 || blueLine.size() < 2) 
+		return false; 
+
+	if(TeDisjoint(redLine.box(), blueLine.box()))
+		return false;
+
+	unsigned int i = 0;
+	unsigned int j = 0;
+
+	TeBox interBox;
+	
+	// Creates a intersection box from lines boxes.
+	::TeIntersection(redLine.box(), blueLine.box(), interBox);
+
+	unsigned int nstep_redLine  = redLine.size() - 1;
+	unsigned int nstep_blueLine = blueLine.size() - 1;
+
+	TeSegmentIntersectionType t = TeImproperIntersection;
+
+	for(i = 0; i < nstep_redLine; ++i)
+	{
+		// Creates the segment box.
+		TeBox red_box = makeBox(redLine[i].x(), redLine[i].y(), redLine[i+1].x(), redLine[i+1].y());
+
+		// See if red segment box intersects with the intersection box.
+		if(TeDisjoint(interBox, red_box))
+			continue;	// If it doesn't intersect, go to another segment => skip comparasion beteween other "m" segments.
+
+		for(j = 0; j < nstep_blueLine; ++j)
+		{
+			// Check intersection.
+			if(TeINTERSECTOR2::TeIntersects(redLine[i], redLine[i+1], blueLine[j], blueLine[j+1], t))
+				return true;
+		}
+	}	
+
+	return false;
+}
+
+bool TeINTERSECTOR2::TeSafeIntersections(const TeLine2D& redLine, const TeLine2D& blueLine, TeVectorBoundaryIP& report, const unsigned int& redObjId, const unsigned int& blueObjId)
+{
+	if(redLine.size() < 2 || blueLine.size() < 2) 
+		return false; 
+
+	if(TeDisjoint(redLine.box(), blueLine.box()))
+		return false;
+
+	unsigned int i = 0;
+	unsigned int j = 0;
+
+	TeBox interBox;
+	
+	bool hasIntersections = false;
+
+	// Creates a intersection box from lines boxes.
+	::TeIntersection(redLine.box(), blueLine.box(), interBox);
+
+	unsigned int nstep_redLine  = redLine.size() - 1;
+	unsigned int nstep_blueLine = blueLine.size() - 1;
+
+	TeSegmentIntersectionType t = TeImproperIntersection;
+
+	for(i = 0; i < nstep_redLine; ++i)
+	{
+		// Creates the segment box.
+		TeBox red_box = makeBox(redLine[i].x_, redLine[i].y_, redLine[i+1].x_, redLine[i+1].y_);
+
+		// See if red segment box intersects with the intersection box.
+		if(TeDisjoint(interBox, red_box))
+			continue;	// If it doesn't intersect, go to another segment => skip comparasion beteween other "m" segments.
+
+		for(j = 0; j < nstep_blueLine; ++j)
+		{
+			// Check intersection.
+			TeBoundaryIP ip;
+
+			if(TeIntersection(redLine[i], redLine[i+1], blueLine[j], blueLine[j+1], ip, t))
+			{
+				hasIntersections = true;
+
+				ip.redPartNum_ = redObjId;
+				ip.redSegNum_ = i;
+				ip.bluePartNum_ = blueObjId;
+				ip.blueSegNum_ = j;
+
+				if(ip.coords_.size() == 2)	//overlap
+				{
+					// Verificar se os pontos est�o em ordem crescente
+					if(ip.coords_[0].x_ < ip.coords_[1].x_)
+					{
+						report.push_back(ip);
+					}
+					else if(ip.coords_[0].x_ > ip.coords_[1].x_)
+					{
+						swap(ip.coords_[0], ip.coords_[1]);
+						report.push_back(ip);
+					}
+					else if(ip.coords_[0].y_ < ip.coords_[1].y_)
+					{
+						report.push_back(ip);						
+					}
+					else
+					{
+						swap(ip.coords_[0], ip.coords_[1]);
+						
+						report.push_back(ip);						
+					}
+
+				}
+				else
+				{
+					report.push_back(ip);
+				}
+			}
+		}
+	}	
+
+	return hasIntersections;
+}
+
+bool TeINTERSECTOR2::TeSafeIntersections(const TePolygonSet& redPols, const TePolygonSet& bluePols, TeVectorBoundaryIP& report)
+{
+	unsigned int redPart = 0;
+	unsigned int redPolsSize = redPols.size();
+
+	unsigned int i, k;
+	register unsigned int j, l;
+
+	// Loops through red polygons
+	for(i = 0; i < redPolsSize; ++i)
+	{
+		TePolygon redPol = redPols[i];
+		unsigned int redPolSize = redPol.size();
+
+		// Loops through red polygons rings
+		for(j = 0; j < redPolSize; ++j)
+		{
+			TeLinearRing redRing = redPol[j];			
+
+			// Loops through blue polygons
+			unsigned int bluePart = 0;
+			unsigned int bluePolsSize =  bluePols.size();
+
+			for(k = 0; k < bluePolsSize; ++k)
+			{
+				// Loops through blue polygons rings
+				TePolygon bluePol = bluePols[k];
+
+				unsigned int bluePolSize = bluePol.size();
+
+				for(l = 0; l < bluePolSize; ++l)
+				{
+					TeLinearRing blueRing = bluePol[l];
+
+					TeSafeIntersections(redRing, blueRing, report, redPart, bluePart);
+
+					++bluePart;
+				}
+			}
+
+			++redPart;
+		}
+	}
+
+	return !report.empty();
+}
+
+// Put polygon set segments into the index
+void TeINTERSECTOR2::TeIndexPolygonSet(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree)
+{
+	unsigned int nPols = polygons.size();	
+	unsigned int i, j, k;
+
+	for(i = 0; i < nPols; ++i)
+	{
+		unsigned int nRings = polygons[i].size();
+
+		for(j = 0; j < nRings; ++j)
+		{
+			unsigned int nSegs = polygons[i][j].size() - 1;
+
+			for(k = 0; k < nSegs; ++k)
+			{
+				TeBox b;
+
+				b.x1_ = MIN(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
+				b.y1_ = MIN(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
+				b.x2_ = MAX(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
+				b.y2_ = MAX(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
+
+				TeINTERSECTOR2::TeSegIdInPolygonSet sid;
+
+				sid.polId_  = i;
+				sid.lineId_   = j;
+				sid.segId_ = k;
+
+				tree.insert(b, sid);
+			}
+		}
+	}
+
+	return;
+}
+
+// Estrutura auxiliar para indexar cada um dos pontos de intersecao em um multimap
+struct TeIntersectionIndexKey
+{
+	unsigned int segNum_;
+	unsigned int partNum_;
+	unsigned int polNum_;
+
+	TeIntersectionIndexKey()
+		: segNum_(0), partNum_(0), polNum_(0)
+	{
+	}
+
+	TeIntersectionIndexKey(const unsigned int& segNum, const unsigned int& partNum, const unsigned int& polNum)
+		: segNum_(segNum), partNum_(partNum), polNum_(polNum)
+	{
+	}
+
+	bool operator<(const TeIntersectionIndexKey& rhs) const
+	{
+		if(polNum_ < rhs.polNum_)
+			return true;
+
+		if(polNum_ > rhs.polNum_)
+			return false;
+
+		if(partNum_ < rhs.partNum_)
+			return true;
+
+		if(partNum_ > rhs.partNum_)
+			return false;
+
+		if(segNum_ < rhs.segNum_)
+			return true;
+
+		if(segNum_ > rhs.segNum_)
+			return false;
+
+		return false;
+	}
+};
+
+
+typedef multimap<TeIntersectionIndexKey, unsigned int> TeIntersectionIndex;
+
+// Dado um ponto de intersecao, faz a normalizacao do mesmo: procura um ponto correlato na lista de intersecao e tenta usar as mesmas coordenadas
+void TeNormalizeIntersection(TeINTERSECTOR2::TeBoundaryIP& ip, TeINTERSECTOR2::TeVectorBoundaryIP& report, TeIntersectionIndex& interIndex)
+{
+	TeIntersectionIndexKey key(ip.blueSegNum_, ip.bluePartNum_, ip.bluePolNum_);
+
+	pair<TeIntersectionIndex::iterator, TeIntersectionIndex::iterator> its = interIndex.equal_range(key);
+
+//	bool eraseOwn = false;
+
+	while(its.first != its.second)
+	{
+// se achamos um indice, vamos verificar se ele possui um ponto de intersecao que seja igual ao que temos em maos, segundo a tolerancia
+		unsigned int position = its.first->second;
+
+		if(TeEquals(report[position].coords_[0], ip.coords_[0]))
+		{
+			ip.coords_[0] = report[position].coords_[0];
+		}
+
+		if(ip.coords_.size() == 2 && report[position].coords_.size() == 1)
+		{
+			if(TeEquals(report[position].coords_[0], ip.coords_[1]))
+				ip.coords_[1] = report[position].coords_[0];			
+		}
+
+		if(ip.coords_.size() == 1 && report[position].coords_.size() == 2)
+		{
+			if(TeEquals(report[position].coords_[1], ip.coords_[0]))
+				ip.coords_[0] = report[position].coords_[1];			
+
+		}
+
+		if(ip.coords_.size() == 2 && report[position].coords_.size() == 2)
+
+		{
+			if(TeEquals(report[position].coords_[1], ip.coords_[1]))
+				ip.coords_[1] = report[position].coords_[1];
+
+			if(TeEquals(report[position].coords_[0], ip.coords_[1]))
+				ip.coords_[1] = report[position].coords_[0];
+
+
+			if(TeEquals(report[position].coords_[1], ip.coords_[0]))
+				ip.coords_[0] = report[position].coords_[1];
+		}
+
+		++its.first;
+	}
+}
+
+// insere a informacao da intersecao no indice
+void TeIndexIntersection(TeINTERSECTOR2::TeBoundaryIP& ip, const unsigned int& redPos, const unsigned int& bluePos, TeIntersectionIndex& interIndex)
+{
+	TeIntersectionIndexKey redkey(ip.redSegNum_, ip.redPartNum_, ip.redPolNum_);
+	TeIntersectionIndexKey bluekey(ip.blueSegNum_, ip.bluePartNum_, ip.bluePolNum_);
+
+	interIndex.insert(pair<TeIntersectionIndexKey, unsigned int>(redkey, redPos));
+	interIndex.insert(pair<TeIntersectionIndexKey, unsigned int>(bluekey, bluePos));
+}
+
+// insere o ponto de intersecao na lista
+void TeInsertIntersection(TeINTERSECTOR2::TeBoundaryIP& ip, TeINTERSECTOR2::TeVectorBoundaryIP& report)
+{
+	if(ip.coords_.size() == 2)	//overlap
+	{
+// put intersections in increase order of 'x'
+		if(ip.coords_[0].x_ < ip.coords_[1].x_)
+		{
+			report.push_back(ip);
+		}
+		else if(ip.coords_[0].x_ > ip.coords_[1].x_)
+		{
+			swap(ip.coords_[0], ip.coords_[1]);
+			report.push_back(ip);			
+		}
+		else if(ip.coords_[0].y_ < ip.coords_[1].y_)
+		{
+			report.push_back(ip);						
+		}
+		else
+		{
+			swap(ip.coords_[0], ip.coords_[1]);							
+			report.push_back(ip);
+		}
+	}
+	else
+	{
+		report.push_back(ip);
+	}
+}
+
+// Find intersection into two distinct sets: red and blue
+bool TeINTERSECTOR2::TeIntersection(const TePolygonSet& redPolygons, TeINTERSECTOR2::TeSegmentRTree& redTree, const TePolygonSet& bluePolygons, TeINTERSECTOR2::TeVectorBoundaryIP& report)
+{
+// if index is empty, so we index first
+	if(redTree.isEmpty())
+		TeINTERSECTOR2::TeIndexPolygonSet(redPolygons, redTree);
+
+	TeIntersectionIndex interIndex;
+
+	unsigned int nPols = bluePolygons.size();	
+
+	TeSegmentIntersectionType t = TeImproperIntersection;
+
+	unsigned int i, j, k, l;
+	for(i = 0; i < nPols; ++i)
+	{
+		unsigned int nRings = bluePolygons[i].size();
+
+		for(j = 0; j < nRings; ++j)
+		{
+			unsigned int nSegs = bluePolygons[i][j].size() - 1;
+
+// for each blue segment, find the one's that can intersects it into the red index tree
+			for(k = 0; k < nSegs; ++k)
+			{
+				TeBox b;
+
+				b.x1_ = MIN(bluePolygons[i][j][k].x(), bluePolygons[i][j][k + 1].x());
+				b.y1_ = MIN(bluePolygons[i][j][k].y(), bluePolygons[i][j][k + 1].y());
+				b.x2_ = MAX(bluePolygons[i][j][k].x(), bluePolygons[i][j][k + 1].x());
+				b.y2_ = MAX(bluePolygons[i][j][k].y(), bluePolygons[i][j][k + 1].y());
+
+				vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
+
+				redTree.search(b, segs);
+
+				unsigned int nSegsInter = segs.size();
+
+// depois tentamos achar os pontos de intersecao
+				for(l = 0; l < nSegsInter; ++l)
+				{
+					TeINTERSECTOR2::TeBoundaryIP ip1;
+
+					if(TeINTERSECTOR2::TeIntersection(bluePolygons[i][j][k], bluePolygons[i][j][k + 1], redPolygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_], redPolygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_ + 1], ip1, t))
+					{
+						ip1.redPolNum_ = segs[l].polId_;
+						ip1.redPartNum_ = segs[l].lineId_;
+						ip1.redSegNum_ = segs[l].segId_;
+
+						ip1.bluePolNum_ = i;
+						ip1.bluePartNum_ = j;
+						ip1.blueSegNum_ = k;
+
+						// normaliza a intersecao: se achar um outro pontos na lista de intersecao semelhante, usaremos o semelhante!
+						TeNormalizeIntersection(ip1, report, interIndex);
+
+
+						TeINTERSECTOR2::TeBoundaryIP ip2;	// objeto auxiliar
+						ip2.redPolNum_ = i;
+						ip2.redPartNum_ = j;
+						ip2.redSegNum_ = k;
+
+						ip2.bluePolNum_ = segs[l].polId_;
+						ip2.bluePartNum_ = segs[l].lineId_;
+						ip2.blueSegNum_ = segs[l].segId_;
+
+						ip2.coords_ = ip1.coords_;
+
+						TeNormalizeIntersection(ip2, report, interIndex);
+
+						ip1.coords_ = ip2.coords_;
+
+						TeInsertIntersection(ip1, report);						
+
+						TeIndexIntersection(ip1, report.size() - 1, report.size() - 1, interIndex);
+					}
+				}
+			}			
+		}
+	}
+
+	return !report.empty();
+}
+
+bool TeINTERSECTOR2::TeIsSimple(const TePolygonSet& polygons, vector<TeINTERSECTOR2::TePairSegIdInPolygonSet>& selfIntersectionList)
+{
+	bool hasSelfIntersection = false;
+
+	TeSegmentIntersectionType t = TeImproperIntersection;
+
+// create index tree
+	TeINTERSECTOR2::TeSegmentRTree tree(polygons.box());
+
+// loop through segments
+	unsigned int nPols = polygons.size();	
+
+	unsigned int i, j, k, l;
+
+	for(i = 0; i < nPols; ++i)
+	{
+		unsigned int nRings = polygons[i].size();
+
+		for(j = 0; j < nRings; ++j)
+		{
+			unsigned int nSegs = polygons[i][j].size() - 1;
+
+			for(k = 0; k < nSegs; ++k)
+			{
+				TeBox b;
+
+				b.x1_ = MIN(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
+				b.y1_ = MIN(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
+				b.x2_ = MAX(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
+				b.y2_ = MAX(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
+
+				TeINTERSECTOR2::TeSegIdInPolygonSet sid;
+
+				sid.polId_  = i;
+				sid.lineId_   = j;
+				sid.segId_ = k;
+
+// try to find filter segments that boxe intersects this segment
+				vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
+	
+				tree.search(b, segs);
+
+				unsigned int nSegsInter = segs.size();
+
+// if found, loops through segments to see if there are intersections
+				for(l = 0; l < nSegsInter; ++l)
+				{
+					TeINTERSECTOR2::TeBoundaryIP ip;
+
+					if(TeIntersection(polygons[i][j][k], polygons[i][j][k + 1], polygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_], polygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_ + 1], ip, t))
+					{
+// if there is intersection, we have to cases:
+						if(ip.coords_.size() == 2)
+						{
+// first, the segment overlaps another: so this configures a selfintersection
+							hasSelfIntersection = true;
+
+							selfIntersectionList.push_back(TePairSegIdInPolygonSet(sid, segs[l]));
+						}
+						else
+						{
+// second, the segment intersects in one point: so this may be a selft-intersection or may be a intersection between the posterior segment (already inserted) in this second, no worry it is right
+							if((sid.polId_ != segs[l].polId_) || (sid.lineId_ != segs[l].lineId_))
+							{
+								hasSelfIntersection = true;
+
+								selfIntersectionList.push_back(TePairSegIdInPolygonSet(sid, segs[l]));
+							}
+							else
+							{
+// we must look if they are consecutives (remeber last an firt will have intersections) 
+								int auxSegId = (int)sid.segId_;
+								int otherSegId = (int)(segs[l].segId_);
+
+// if it intersects the previous or the next, it's ok!
+								if((auxSegId == (otherSegId + 1)) || (auxSegId == (otherSegId -1)))
+								{
+									continue;
+								}
+								else
+								{
+// we need to see if it is not between last and first
+									if(auxSegId == (int)(polygons[sid.polId_][sid.lineId_].size() - 2))
+									{
+// ok, it is a consecutive intersection between last and first
+										if(otherSegId == 0)
+											continue;
+									}
+									else if(auxSegId == 0)
+									{
+// ok, it is a consecutive intersection between first and last
+										if(otherSegId == (int)(polygons[segs[l].polId_][segs[l].lineId_].size() - 2))
+											continue;
+									}
+
+									hasSelfIntersection = true;
+
+									selfIntersectionList.push_back(TePairSegIdInPolygonSet(sid, segs[l]));
+								}
+							}
+						}
+
+					}
+				}
+
+// inserts the segment into the tree
+				tree.insert(b, sid);
+			}
+		}
+	}
+
+	tree.clear();
+
+	return !hasSelfIntersection;
+}
+
+// Find intersection into two distinct sets: red lines and blue polygons
+bool TeINTERSECTOR2::TeIntersection(const TeLineSet& redLines, const TePolygonSet& bluePolygons, TeSegmentRTree& blueTree, TeINTERSECTOR2::TeVectorBoundaryIP& report)
+{
+// if index is empty, so we index the segments from polygonset first
+	if(blueTree.isEmpty())
+		TeINTERSECTOR2::TeIndexPolygonSet(bluePolygons, blueTree);
+
+// for each lines we must compute intersections
+	unsigned int nLines = redLines.size();	
+
+	TeSegmentIntersectionType t = TeImproperIntersection;
+
+	unsigned int i, j, l;
+
+	for(i = 0; i < nLines; ++i)
+	{
+		unsigned int nSegs = redLines[i].size() - 1;
+
+		for(j = 0; j < nSegs; ++j)
+		{
+// for each segment we compute intersections
+			TeBox b;
+
+			b.x1_ = MIN(redLines[i][j].x(), redLines[i][j + 1].x());
+			b.y1_ = MIN(redLines[i][j].y(), redLines[i][j + 1].y());
+			b.x2_ = MAX(redLines[i][j].x(), redLines[i][j + 1].x());
+			b.y2_ = MAX(redLines[i][j].y(), redLines[i][j + 1].y());
+
+			vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
+
+			blueTree.search(b, segs);
+
+			unsigned int nSegsInter = segs.size();
+
+// depois tentamos achar os pontos de intersecao
+			for(l = 0; l < nSegsInter; ++l)
+			{
+				TeINTERSECTOR2::TeBoundaryIP ip1;
+
+				if(TeINTERSECTOR2::TeIntersection(redLines[i][j], redLines[i][j + 1], bluePolygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_], bluePolygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_ + 1], ip1, t))
+				{
+					ip1.redPolNum_ = 0;
+					ip1.redPartNum_ = i;
+					ip1.redSegNum_ = j;
+
+					ip1.bluePolNum_ = segs[l].polId_;
+					ip1.bluePartNum_ = segs[l].lineId_;
+					ip1.blueSegNum_ = segs[l].segId_;
+
+					if(ip1.coords_.size() == 2)	//overlap
+					{
+						// Verificar se os pontos estao em ordem crescente
+						if(ip1.coords_[0].x_ < ip1.coords_[1].x_)
+						{
+							report.push_back(ip1);
+						}
+						else if(ip1.coords_[0].x_ > ip1.coords_[1].x_)
+						{
+							swap(ip1.coords_[0], ip1.coords_[1]);
+							report.push_back(ip1);
+						}
+						else if(ip1.coords_[0].y_ < ip1.coords_[1].y_)
+						{
+							report.push_back(ip1);						
+						}
+						else
+						{
+							swap(ip1.coords_[0], ip1.coords_[1]);							
+							report.push_back(ip1);						
+						}
+					}
+					else
+					{
+						report.push_back(ip1);
+					}
+				}
+			}
+		}
+	}
+
+	return !report.empty();
+}
+
+// Find intersection between segments into polygonset list
+bool TeINTERSECTOR2::TeIntersection(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree, TeINTERSECTOR2::TeVectorBoundaryIP& report)
+{
+// clear tree before start process
+	tree.clear();
+
+	TeIntersectionIndex interIndex;
+
+	unsigned int nPols = polygons.size();	
+
+	if(nPols == 0)
+		return false;
+
+	unsigned int nLines = polygons[0].size();	
+
+	unsigned int i, j, k, l;
+
+// the first polygon's segments are all indexed into the tree
+	for(i = 0; i < nLines; ++i)
+	{
+		unsigned int nSegs = polygons[0][i].size() - 1;
+
+		for(j = 0; j < nSegs; ++j)
+		{
+			TeBox b;
+
+			b.x1_ = MIN(polygons[0][i][j].x(), polygons[0][i][j + 1].x());
+			b.y1_ = MIN(polygons[0][i][j].y(), polygons[0][i][j + 1].y());
+			b.x2_ = MAX(polygons[0][i][j].x(), polygons[0][i][j + 1].x());
+			b.y2_ = MAX(polygons[0][i][j].y(), polygons[0][i][j + 1].y());
+
+			TeINTERSECTOR2::TeSegIdInPolygonSet sid;
+
+			sid.polId_  = 0;
+			sid.lineId_   = i;
+			sid.segId_ = j;
+
+			tree.insert(b, sid);
+		}
+	}
+	
+	TeSegmentIntersectionType t = TeImproperIntersection;
+
+// for each polygon, we first test intersection of all segments  and then put them into the index
+	for(i = 1; i < nPols; ++i)
+	{
+		unsigned int nLines = polygons[i].size();	
+
+// for each line of the polygon, verifies intersection against the segments into the index
+		for(j = 0; j < nLines; ++j)
+		{
+			unsigned int nSegs = polygons[i][j].size() - 1;
+
+			for(k = 0; k < nSegs; ++k)
+			{
+// for each segment we find the one's that intersects its bounding box
+				TeBox b;
+
+				b.x1_ = MIN(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
+				b.y1_ = MIN(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
+				b.x2_ = MAX(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
+				b.y2_ = MAX(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
+
+				vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
+
+				tree.search(b, segs);
+
+				unsigned int nSegsInter = segs.size();
+
+// if there are candidates, try to find intersections
+				for(l = 0; l < nSegsInter; ++l)
+				{
+					TeINTERSECTOR2::TeBoundaryIP ip1;
+
+					TeINTERSECTOR2::TeBoundaryIP ip2;
+
+					if(TeINTERSECTOR2::TeIntersection(polygons[i][j][k], polygons[i][j][k + 1], polygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_], polygons[segs[l].polId_][segs[l].lineId_][segs[l].segId_ + 1], ip1, t))
+					{
+// if the segment intersects a candidate, stores theirs intersection points
+						ip1.redPolNum_  = i;
+						ip1.redPartNum_ = j;
+						ip1.redSegNum_  = k;
+						ip1.bluePolNum_ = segs[l].polId_;
+						ip1.bluePartNum_ = segs[l].lineId_;
+						ip1.blueSegNum_ = segs[l].segId_;
+
+						// normaliza a intersecao: se achar um outro pontos na lista de intersecao semelhante, usaremos o semelhante!
+						TeNormalizeIntersection(ip1, report, interIndex);						
+
+						ip2.redPolNum_ = segs[l].polId_;
+						ip2.redPartNum_ = segs[l].lineId_;
+						ip2.redSegNum_ = segs[l].segId_;
+
+						ip2.bluePolNum_ = i;
+						ip2.bluePartNum_ = j;
+						ip2.blueSegNum_ = k;
+
+						ip2.coords_ = ip1.coords_;
+
+						TeNormalizeIntersection(ip2, report, interIndex);
+
+						ip1.coords_ = ip2.coords_;
+
+// insere os pontos de intersecao na lista de intersecao e no multi-map
+						TeInsertIntersection(ip1, report);						
+						TeInsertIntersection(ip2, report);
+
+						TeIndexIntersection(ip1, report.size() - 2, report.size() - 1, interIndex);	
+					}
+				}
+			}
+		}
+	
+// after the search for intersection, put segfments into index
+		for(j = 0; j < nLines; ++j)
+		{
+			unsigned int nSegs = polygons[i][j].size() - 1;
+
+			for(k = 0; k < nSegs; ++k)
+			{
+				TeBox b;
+
+				b.x1_ = MIN(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
+				b.y1_ = MIN(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
+				b.x2_ = MAX(polygons[i][j][k].x(), polygons[i][j][k + 1].x());
+				b.y2_ = MAX(polygons[i][j][k].y(), polygons[i][j][k + 1].y());
+
+				TeSegIdInPolygonSet sid;
+
+				sid.polId_ = i;
+				sid.lineId_ = j;
+				sid.segId_ = k;
+
+				tree.insert(b, sid);
+			}
+		}
+	}
+
+	return !report.empty();
+}
+
diff --git a/src/terralib/kernel/TeIntersector.h b/src/terralib/kernel/TeIntersector.h
old mode 100755
new mode 100644
index ba8b2e4..cd2df83
--- a/src/terralib/kernel/TeIntersector.h
+++ b/src/terralib/kernel/TeIntersector.h
@@ -1,214 +1,214 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file  TeIntersector.h
-    \brief This file contains structures and definitions for line intersection algorithms.
-	\note  These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
-           THIS IS FOR INTERNAL USE ONLY.
-    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
-*/
-
-#ifndef  __TERRALIB_INTERNAL_INTERSECTOR2_H
-#define  __TERRALIB_INTERNAL_INTERSECTOR2_H
-
-//TerraLib's include
-#include "TeCoord2D.h"
-#include "TeRTree.h"
-
-//STL's include
-#include <vector>
-
-using namespace std;
-
-/* 
- *  WARNING: These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
- *           the support and interfaces can be changed in future. THIS IS FOR INTERNAL USE ONLY.
- */
-
-/*! \brief Contains structures and definitions needed by line intersection algorithms (FOR INTERNAL USE ONLY).
-*/
-namespace TeINTERSECTOR2
-{
-//! An epsilon value used to compare two real numbers
-#define EPSILON_COMPARE 1.0e-15
-
-/** @defgroup IntersectionAlgorithms Intersection Algorithms
- *  Intersection Algorithms and data structures, used internally.
- *  @{
- */
-
-//! This struct is used to represent a point intersection between two segments on boundary of a TePolygon or TeLine2D.
-struct TL_DLL TeBoundaryIP
-{
-	vector<TeCoord2D> coords_;		//!< Points of intersection ocurried along these two segments (red and blue).
-
-	unsigned int redSegNum_;		//!< Red segment number.
-	unsigned int redPartNum_;		//!< Line number in a polygon that a red segment belongs.
-	unsigned int redPolNum_;		//!< Polygon number in a vector of polygons that a segment belongs.
-
-	unsigned int blueSegNum_;		//!< Blue segment number.
-	unsigned int bluePartNum_;		//!< Line number in a polygon that a blue segment belongs.
-	unsigned int bluePolNum_;		//!< Polygon number in a vector of polygons that a segment belongs.
-};
-
-//! This is the type of intersection point list.
-typedef vector<TeBoundaryIP> TeVectorBoundaryIP;
-
-//! This struct represents an index to the right place of a segment in a TeLineSet, TeLine2D, TePolygon or TePolygonSet.
-struct TL_DLL TeSegIdInPolygonSet
-{
-	unsigned int polId_;	//!<  The polygon id, when used in a polygonset.
-	unsigned int lineId_;	//!<  The line id, when used in a lineset or in a polygon.
-	unsigned int segId_;	//!<  The segment id into a specified line.
-};
-
-//! This pair is used to index two segments that intersects.
-typedef pair<TeSegIdInPolygonSet, TeSegIdInPolygonSet> TePairSegIdInPolygonSet;
-
-//! This is the type used to index the segments in the boundary of a TeLine2D, TeLineSet, TePolygon or TePolygonSet.
-typedef TeSAM::TeRTree<TeSegIdInPolygonSet, 8> TeSegmentRTree;
-
-/** \brief Tells if three points makes a right turn, a left turn or are collinear.
-    \param c1       The first coordinate.
-	\param c2       The second coordinate.
-	\param c3       The coordinate to test the relative position.
-	\param between  Tells if c3 is between c1 and c2.
-	\return			The orientation: TeCLOCKWISE, TeCOUNTERCLOCKWISE or TeNOTURN.
-*/
-TL_DLL short TeCCW(const TeCoord2D& c1, const TeCoord2D& c2, const TeCoord2D& c3, bool& between);
-
-/** \brief Returns the intersection point of the segments.
-    \param a                 The first coordinate of the first segment.
-	\param b                 The second coordinate of the first segment.
-	\param c                 The first coordinate of the second segment.
-	\param d                 The second coordinate of the second segment.
-	\param ips               The intersection coordinates (0, 1 or 2).
-	\param intersectionType  An intersection may be proper or improper.
-	\return					 Returns true if there is an intersection between segments defined by end coordinates.
-*/
-TL_DLL bool TeIntersection(const TeCoord2D& a, const TeCoord2D& b, const TeCoord2D& c, const TeCoord2D& d, TeBoundaryIP& ips, TeSegmentIntersectionType& intersectionType);
-
-
-/** \brief Tells if two segments intersects.
-    \param a                 The first coordinate of the first segment.
-	\param b                 The second coordinate of the first segment.
-	\param c                 The first coordinate of the second segment.
-	\param d                 The second coordinate of the second segment.
-	\param intersectionType  An intersection may be proper or improper.
-	\return					 Returns true if there is an intersection between segments defined by end coordinates.
-*/
-TL_DLL bool TeIntersects(const TeCoord2D& a, const TeCoord2D& b, const TeCoord2D& c, const TeCoord2D& d, TeSegmentIntersectionType& intersectionType);
-
-
-/** \brief Verifies if there is an intersection between two given polygonsets.
-    \param redPols  The first polygonset to test.
-	\param bluePols The second polygonset to test.
-	\param report   A list with the intersection points.
-	\return			Returns true if there is an intersection between segments of the polygons.
-	
-	\note WARNING: this is deprecated and will be replaced by another function in near future.
-
-    This is a lazy algorithm. It can be used, for example, in intersections between a box and a line.
-	It is O(n*m) - where n and m are the numbers of segments in the first and second polygonsets.
- */
-TL_DLL bool TeSafeIntersections(const TePolygonSet& redPols, const TePolygonSet& bluePols, TeVectorBoundaryIP& report);
-
-/** \brief Verifies if there is an intersection between two given lines.
-    \param redLine   The first line to test.
-	\param blueLine  The second line to test.
-	\param report    A list with the intersection points.
-	\param redObjId  Red line object id.
-	\param blueObjId Blue line object id.
-	\return			 Returns true if there is an intersection between segments of the lines.
-	
-	\note WARNING: this is deprecated and will be replaced by another function in near future.
-
-    This is a lazy algorithm. It can be used, for example, in intersections between a box and a line.
-	It is O(n*m) - where n and m are the numbers of segments in the first and second lines.
- */
-TL_DLL bool TeSafeIntersections(const TeLine2D& redLine, const TeLine2D& blueLine, TeVectorBoundaryIP& report, const unsigned int& redObjId = 0, const unsigned int& blueObjId = 0);
-
-/** \brief Returns true if the lines intersects.
-	\param redLine			The line to test.
-	\param blueLine			The line to test.
-	\return			        Returns true if there is an intersection between segments of the lines.
-
-	\note WARNING: this is deprecated and will be replaced by another function in near future.
- */
-TL_DLL bool TeIntersects(const TeLine2D& redLine, const TeLine2D& blueLine);
-
-/**	\brief Reports intersections between segments of polygons in the polygonset list.
-	\param polygons		A list of polygons to test self intersections.
-	\param tree			The tree with all index segments, it WILL BE filled inside this method.
-	\param report		A report list of intersection points.
-	\return				Returns true if there is an intersection.
-
-	\note				This function will not returns intersections between segments of the same polygon. It will only
-	                    report intersection between different polygons. The index tree MUST BE EMPTY, othewise, the
-						result is undefined. The result may have duplicated points because intersections are reported 
-						twice: this will turn fragmentation easier.
- */
-TL_DLL bool TeIntersection(const TePolygonSet& polygons, TeSegmentRTree& tree, TeVectorBoundaryIP& report);
-
-/** \brief Reports intersections between segments of two diferent polygonsets.
-	\param redPolygons	A list of polygons without self intersections.
-	\param redTree		A tree with all red segment already indexed or not, if it is empty, so, it will be filled inside this method.
-	\param bluePolygons	A list of polygons without self intersections.
-	\param report		A report list of intersection points.
-	\return				Returns true if there is an intersection between a red segment and a blue segment.
-
-	\note				This function will not returns intersections between segments of the same polygon. It will only
-	                    report intersection between different polygons. The result may have duplicated points because intersections are reported 
-						twice: this will turn fragmentation easier.
- */
-TL_DLL bool TeIntersection(const TePolygonSet& redPolygons, TeSegmentRTree& redTree, const TePolygonSet& bluePolygons, TeINTERSECTOR2::TeVectorBoundaryIP& report);
-
-/** \brief Reports intersections between segments of a lineset and a polygonset.
-	\param redLines	    A list of lines without self intersections.
-	\param bluePolygons	A list of polygons without self intersections.
-	\param blueTree		A tree with all segments from the polygonset already indexed or not, if it is empty, so, it will be filled inside this method.
-	\param report		A report list of intersection points.
-	\return				Returns true if there is an intersection between a red segment from the lineset and a blue segment from the polygonset.
-
-	\note				This function will not returns intersections between segments of the same polygon or lineset. It will only
-	                    report intersection between segments from different sets.
- */
-TL_DLL bool TeIntersection(const TeLineSet& redLines, const TePolygonSet& bluePolygons, TeSegmentRTree& blueTree, TeINTERSECTOR2::TeVectorBoundaryIP& report);
-
-/** \brief Tells if there is a self-intersection between segments.
-	\param polygons					A list of polygons to test self intersections.
-	\param selfIntersectionList		A report list with all self-intersections.
-	\return							Returns true if there is not a self-intersection.
- */
-TL_DLL bool TeIsSimple(const TePolygonSet& polygons, vector<TePairSegIdInPolygonSet>& selfIntersectionList);
-
-/** \brief Index polygon's segments.
-	\param polygons		A list of polygons to index it segment's.
-	\param tree			The tree if indexed segments.
- */
-TL_DLL void TeIndexPolygonSet(const TePolygonSet& polygons, TeSegmentRTree& tree);
-
-/** @} */ 
-
-}	// end namespace TeINTERSECTOR2
-#endif //__TERRALIB_INTERNAL_INTERSECTOR2_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file  TeIntersector.h
+    \brief This file contains structures and definitions for line intersection algorithms.
+	\note  These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
+           THIS IS FOR INTERNAL USE ONLY.
+    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+*/
+
+#ifndef  __TERRALIB_INTERNAL_INTERSECTOR2_H
+#define  __TERRALIB_INTERNAL_INTERSECTOR2_H
+
+//TerraLib's include
+#include "TeCoord2D.h"
+#include "TeRTree.h"
+
+//STL's include
+#include <vector>
+
+using namespace std;
+
+/* 
+ *  WARNING: These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
+ *           the support and interfaces can be changed in future. THIS IS FOR INTERNAL USE ONLY.
+ */
+
+/*! \brief Contains structures and definitions needed by line intersection algorithms (FOR INTERNAL USE ONLY).
+*/
+namespace TeINTERSECTOR2
+{
+//! An epsilon value used to compare two real numbers
+#define EPSILON_COMPARE 1.0e-15
+
+/** @defgroup IntersectionAlgorithms Intersection Algorithms
+ *  Intersection Algorithms and data structures, used internally.
+ *  @{
+ */
+
+//! This struct is used to represent a point intersection between two segments on boundary of a TePolygon or TeLine2D.
+struct TL_DLL TeBoundaryIP
+{
+	vector<TeCoord2D> coords_;		//!< Points of intersection ocurried along these two segments (red and blue).
+
+	unsigned int redSegNum_;		//!< Red segment number.
+	unsigned int redPartNum_;		//!< Line number in a polygon that a red segment belongs.
+	unsigned int redPolNum_;		//!< Polygon number in a vector of polygons that a segment belongs.
+
+	unsigned int blueSegNum_;		//!< Blue segment number.
+	unsigned int bluePartNum_;		//!< Line number in a polygon that a blue segment belongs.
+	unsigned int bluePolNum_;		//!< Polygon number in a vector of polygons that a segment belongs.
+};
+
+//! This is the type of intersection point list.
+typedef vector<TeBoundaryIP> TeVectorBoundaryIP;
+
+//! This struct represents an index to the right place of a segment in a TeLineSet, TeLine2D, TePolygon or TePolygonSet.
+struct TL_DLL TeSegIdInPolygonSet
+{
+	unsigned int polId_;	//!<  The polygon id, when used in a polygonset.
+	unsigned int lineId_;	//!<  The line id, when used in a lineset or in a polygon.
+	unsigned int segId_;	//!<  The segment id into a specified line.
+};
+
+//! This pair is used to index two segments that intersects.
+typedef pair<TeSegIdInPolygonSet, TeSegIdInPolygonSet> TePairSegIdInPolygonSet;
+
+//! This is the type used to index the segments in the boundary of a TeLine2D, TeLineSet, TePolygon or TePolygonSet.
+typedef TeSAM::TeRTree<TeSegIdInPolygonSet, 8> TeSegmentRTree;
+
+/** \brief Tells if three points makes a right turn, a left turn or are collinear.
+    \param c1       The first coordinate.
+	\param c2       The second coordinate.
+	\param c3       The coordinate to test the relative position.
+	\param between  Tells if c3 is between c1 and c2.
+	\return			The orientation: TeCLOCKWISE, TeCOUNTERCLOCKWISE or TeNOTURN.
+*/
+TL_DLL short TeCCW(const TeCoord2D& c1, const TeCoord2D& c2, const TeCoord2D& c3, bool& between);
+
+/** \brief Returns the intersection point of the segments.
+    \param a                 The first coordinate of the first segment.
+	\param b                 The second coordinate of the first segment.
+	\param c                 The first coordinate of the second segment.
+	\param d                 The second coordinate of the second segment.
+	\param ips               The intersection coordinates (0, 1 or 2).
+	\param intersectionType  An intersection may be proper or improper.
+	\return					 Returns true if there is an intersection between segments defined by end coordinates.
+*/
+TL_DLL bool TeIntersection(const TeCoord2D& a, const TeCoord2D& b, const TeCoord2D& c, const TeCoord2D& d, TeBoundaryIP& ips, TeSegmentIntersectionType& intersectionType);
+
+
+/** \brief Tells if two segments intersects.
+    \param a                 The first coordinate of the first segment.
+	\param b                 The second coordinate of the first segment.
+	\param c                 The first coordinate of the second segment.
+	\param d                 The second coordinate of the second segment.
+	\param intersectionType  An intersection may be proper or improper.
+	\return					 Returns true if there is an intersection between segments defined by end coordinates.
+*/
+TL_DLL bool TeIntersects(const TeCoord2D& a, const TeCoord2D& b, const TeCoord2D& c, const TeCoord2D& d, TeSegmentIntersectionType& intersectionType);
+
+
+/** \brief Verifies if there is an intersection between two given polygonsets.
+    \param redPols  The first polygonset to test.
+	\param bluePols The second polygonset to test.
+	\param report   A list with the intersection points.
+	\return			Returns true if there is an intersection between segments of the polygons.
+	
+	\note WARNING: this is deprecated and will be replaced by another function in near future.
+
+    This is a lazy algorithm. It can be used, for example, in intersections between a box and a line.
+	It is O(n*m) - where n and m are the numbers of segments in the first and second polygonsets.
+ */
+TL_DLL bool TeSafeIntersections(const TePolygonSet& redPols, const TePolygonSet& bluePols, TeVectorBoundaryIP& report);
+
+/** \brief Verifies if there is an intersection between two given lines.
+    \param redLine   The first line to test.
+	\param blueLine  The second line to test.
+	\param report    A list with the intersection points.
+	\param redObjId  Red line object id.
+	\param blueObjId Blue line object id.
+	\return			 Returns true if there is an intersection between segments of the lines.
+	
+	\note WARNING: this is deprecated and will be replaced by another function in near future.
+
+    This is a lazy algorithm. It can be used, for example, in intersections between a box and a line.
+	It is O(n*m) - where n and m are the numbers of segments in the first and second lines.
+ */
+TL_DLL bool TeSafeIntersections(const TeLine2D& redLine, const TeLine2D& blueLine, TeVectorBoundaryIP& report, const unsigned int& redObjId = 0, const unsigned int& blueObjId = 0);
+
+/** \brief Returns true if the lines intersects.
+	\param redLine			The line to test.
+	\param blueLine			The line to test.
+	\return			        Returns true if there is an intersection between segments of the lines.
+
+	\note WARNING: this is deprecated and will be replaced by another function in near future.
+ */
+TL_DLL bool TeIntersects(const TeLine2D& redLine, const TeLine2D& blueLine);
+
+/**	\brief Reports intersections between segments of polygons in the polygonset list.
+	\param polygons		A list of polygons to test self intersections.
+	\param tree			The tree with all index segments, it WILL BE filled inside this method.
+	\param report		A report list of intersection points.
+	\return				Returns true if there is an intersection.
+
+	\note				This function will not returns intersections between segments of the same polygon. It will only
+	                    report intersection between different polygons. The index tree MUST BE EMPTY, othewise, the
+						result is undefined. The result may have duplicated points because intersections are reported 
+						twice: this will turn fragmentation easier.
+ */
+TL_DLL bool TeIntersection(const TePolygonSet& polygons, TeSegmentRTree& tree, TeVectorBoundaryIP& report);
+
+/** \brief Reports intersections between segments of two diferent polygonsets.
+	\param redPolygons	A list of polygons without self intersections.
+	\param redTree		A tree with all red segment already indexed or not, if it is empty, so, it will be filled inside this method.
+	\param bluePolygons	A list of polygons without self intersections.
+	\param report		A report list of intersection points.
+	\return				Returns true if there is an intersection between a red segment and a blue segment.
+
+	\note				This function will not returns intersections between segments of the same polygon. It will only
+	                    report intersection between different polygons. The result may have duplicated points because intersections are reported 
+						twice: this will turn fragmentation easier.
+ */
+TL_DLL bool TeIntersection(const TePolygonSet& redPolygons, TeSegmentRTree& redTree, const TePolygonSet& bluePolygons, TeINTERSECTOR2::TeVectorBoundaryIP& report);
+
+/** \brief Reports intersections between segments of a lineset and a polygonset.
+	\param redLines	    A list of lines without self intersections.
+	\param bluePolygons	A list of polygons without self intersections.
+	\param blueTree		A tree with all segments from the polygonset already indexed or not, if it is empty, so, it will be filled inside this method.
+	\param report		A report list of intersection points.
+	\return				Returns true if there is an intersection between a red segment from the lineset and a blue segment from the polygonset.
+
+	\note				This function will not returns intersections between segments of the same polygon or lineset. It will only
+	                    report intersection between segments from different sets.
+ */
+TL_DLL bool TeIntersection(const TeLineSet& redLines, const TePolygonSet& bluePolygons, TeSegmentRTree& blueTree, TeINTERSECTOR2::TeVectorBoundaryIP& report);
+
+/** \brief Tells if there is a self-intersection between segments.
+	\param polygons					A list of polygons to test self intersections.
+	\param selfIntersectionList		A report list with all self-intersections.
+	\return							Returns true if there is not a self-intersection.
+ */
+TL_DLL bool TeIsSimple(const TePolygonSet& polygons, vector<TePairSegIdInPolygonSet>& selfIntersectionList);
+
+/** \brief Index polygon's segments.
+	\param polygons		A list of polygons to index it segment's.
+	\param tree			The tree if indexed segments.
+ */
+TL_DLL void TeIndexPolygonSet(const TePolygonSet& polygons, TeSegmentRTree& tree);
+
+/** @} */ 
+
+}	// end namespace TeINTERSECTOR2
+#endif //__TERRALIB_INTERNAL_INTERSECTOR2_H
+
diff --git a/src/terralib/kernel/TeKdTree.h b/src/terralib/kernel/TeKdTree.h
old mode 100755
new mode 100644
index 5a8decf..d615b63
--- a/src/terralib/kernel/TeKdTree.h
+++ b/src/terralib/kernel/TeKdTree.h
@@ -1,1190 +1,1190 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file   TeKdTree.h
-    \brief  This file contains an implementation of kdtree data structures in main memory for two dimensions.
-	\note   These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
-	        THIS IS FOR INTERNAL USE ONLY.
-    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>    
-*/
-
-#ifndef  __TERRALIB_INTERNAL_KDTREE_H
-#define  __TERRALIB_INTERNAL_KDTREE_H
-
-#include "TeGeometry.h"
-
-/** 
- * WARNING: These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
- *          the support and interfaces can be changed in future. THIS IS FOR INTERNAL USE ONLY.
- *
- */
-
-namespace TeSAM
-{
-/** @defgroup PartitionAlgorithms Partition Algorithms
- *  Partition Algorithms.
- *  @{
- */
-
-//! This function partition the conteiner in two parts: k-1 elements to the left (elements less than or equals to k-th element) and the right part with all other elements (elements greater than or equal to k-th element)
-/*
-	\param A             Conteiner of elements to partition
-	\param kthElement    Position of the k-th element, around the conteiner will be pertitionated
-	\param firstElement  Position of the first element
-	\param lastElement   Position of the las element
-	\param compFunctor   Functor to compare elements: implements the function "less than"
-
-*/
-template<class CONTAINER, class COMPFUNCTOR> 
-void TeHoareFind(CONTAINER& A, const unsigned int& kthElement, const unsigned int& firstElement, const unsigned int& lastElement,  const COMPFUNCTOR& compFunctor)
-{
-	unsigned int m = firstElement;
-	unsigned int n = lastElement;
-
-// Test if the median is in the bounds
-	if((kthElement < firstElement) || (kthElement > lastElement))
-		return;	
-
-// Do conteiner partition
-	while(m < n)
-	{		
-		unsigned int i = m;
-		unsigned int j = n;
-
-		typename CONTAINER::value_type r = A[kthElement];
-
-		while(i <= j)
-		{
-			while(compFunctor(A[i], r))
-				++i;  
-
-			while(compFunctor(r, A[j]))
-				--j;
-			
-			if(i <= j)
-			{
-				typename CONTAINER::value_type w = A[i];
-				A[i] = A[j];
-				A[j] = w;
-				
-			    ++i;
-				--j;
-			}
-		}
-
-		if(kthElement <= j)			// if the meet point was to the right, so all points above j are greater than the k-th element
-			n = j;
-		else if(i <= kthElement)	// otherwise, if the meeting point was to the left of k-th, so all elements before i are already in the correct location
-			m = i;
-		else
-			break;
-	}
-}
-
-//! Partition the conteiner like a bidimensional K-d Tree using Hoare algorithms
-/*
-	\param dataSet					Conteinet elements to be sorted like a K-dTree
-	\param first					Position of the first element in conteiner, where the sort will begin
-	\param last						Position of the last element, where the sort ends
-	\param level					Indicates the axis to begin the sort ('x' or 'y') and is used during the recursion process
-	\param lessThanCompFunctorByX	Functor to compare elements along the 'x' axis
-	\param lessThanCompFunctorByY	Functor to compare elements along the 'y' axis
-
-  	The expected complexity is O(N log N), where N is the number of elements in conteiner.
-*/
-template<class CONTAINER, class LESSTHANX, class LESSTHANY> 
-void kdsort(CONTAINER& dataSet, const unsigned int& first, const unsigned int& last, const char& level, const LESSTHANX& lessThanCompFunctorByX, const LESSTHANY& lessThanCompFunctorByY)
-{
-	const unsigned int kth = (last - first + 1u) / 2u;
-
-	if(level == 'x')
-	{
-// Move data around X axis
-		TeHoareFind(dataSet, first + kth, first, last, lessThanCompFunctorByX);
-
-// Recursive sort the left half and right half
-		if((first + kth) > first)
-			kdsort(dataSet, first, first + kth - 1u, 'y', lessThanCompFunctorByX, lessThanCompFunctorByY);
-
-		if((first + kth) < last)
-			kdsort(dataSet, first + kth + 1u, last, 'y', lessThanCompFunctorByX, lessThanCompFunctorByY);
-	}
-	else
-	{
-// Move data around Y axis
-		TeHoareFind(dataSet, first + kth, first, last, lessThanCompFunctorByY);
-
-// Recursive sort the left half and right half
-		if((first + kth) > first)
-			kdsort(dataSet, first, first + kth - 1u, 'x', lessThanCompFunctorByX, lessThanCompFunctorByY);
-
-		if((first + kth) < last)
-			kdsort(dataSet, first + kth + 1u, last, 'x', lessThanCompFunctorByX, lessThanCompFunctorByY);
-	}
-}
-/** @} */
-
-//! Kd-tree node type for nodes with single elements (used by template instantiation).
-struct TL_DLL kd_node_data_single_tag {};
-
-//! Kd-Tree node type for nodes with multuple elements (used by template instantiation).
-struct TL_DLL kd_node_data_set_tag {};
-
-
-//! Class that represents a node of a TeKdTree
-/*!
-	Each node contains a pointer to its left and right subtree (NULL if it is not set),
-	one key used for insertion of the data into the tree.
-
-	WARNING: <BR>
-
-	1. The key must have methods called x() and y(). <BR>
-	
-	2. These kind of node stores the data in each node. <BR>
-
-	3. The nodes may contains one single element (kd_node_data_single_tag) or a set of values (kd_node_data_set_tag). <BR>
-	
-	4. If the node type is kd_node_data_single_tag than NodeData and NodeDataItem are the same types. And if
-	   one entry with the same key already exist, so they will be overwrite. <BR>
-	   
-	5. If the node type is kd_node_data_set_tag than NodeData mus have a method called push_back(NodeDataItem)
-	   that permits to store elements with the same key in the node. <BR>
- */
-template<class NodeKey, class NodeData, class NodeDataItem,
-         class NodeDataTag = kd_node_data_single_tag>
-class TeKdTreeNode
-{
-	protected:
-
-		//! The key used to access this record
-		NodeKey key_;
-
-		//! The data stored in this record
-		NodeData data_;
-
-		//! Pointer to the left sub-tree.
-		TeKdTreeNode* left_;
-
-		//! Pointer to the right sub-tree.
-		TeKdTreeNode* right_;
-
-	public:
-
-		//! Export key type.
-		typedef NodeKey kdKey;
-
-		//! Export data type.
-		typedef NodeData kdData;
-
-		//! Export data item type.
-		typedef NodeDataItem kdDataItem;
-
-		//! Export data type.
-		typedef NodeDataTag  kdDataTag;
-
-		//! Constructor
-		TeKdTreeNode(const NodeKey& k)
-			: key_(k), left_(0), right_(0)
-		{
-		}
-
-		//! Sets the key to the node
-		void setKey(const NodeKey& k)
-		{
-			key_ = k;
-		}
-
-		//! Returns a reference to node key
-		const NodeKey& getKey(void) const
-		{
-			return key_;
-		}
-
-		//! Sets the data in the node
-		void setData(const NodeData& data)
-		{
-			data_ = data;
-		}
-
-		//! Returns a reference to data node
-		NodeData& getData(void)
-		{
-			return data_;
-		}
-
-		//! Sets the left child pointer
-		void setLeft(TeKdTreeNode* node)
-		{
-			left_ = node;
-		}
-
-		//! Sets the right child pointer
-		void setRight(TeKdTreeNode* node)
-		{
-			right_ = node;
-		}
-
-		//! Accessor for left child
-		TeKdTreeNode* getLeft(void) const
-		{
-			return left_;
-		}
-
-		//! Accessor for right child
-		TeKdTreeNode* getRight(void) const
-		{
-			return right_;
-		}		
-
-		//! Method to check if this has a left child
-		bool hasLeft(void) const
-		{
-			return (left_ != 0);
-		}
-		
-		//! Method to check if a this has a right child
-		bool hasRight(void) const
-		{
-			return (right_ != 0);
-		}
-
-		//! Method to check if this has no children
-		bool isLeaf(void) const
-		{
-			return !(hasLeft() || hasRight());
-		}		
-
-		//! Method to count the number of nodes below this
-		unsigned int descendants(void) const
-		{
-			unsigned int totalLeft  = 0u;
-			unsigned int totalRight = 0u;
-
-			if(hasLeft())
-				totalLeft = 1u + getLeft()->descendants();
-
-			if(hasRight())
-				totalRight = 1u + getRight()->descendants();
-
-			return (totalLeft + totalRight);
-		}
-
-	private:
-
-		//! No copy allowed
-		TeKdTreeNode(const TeKdTreeNode& other);
-
-		//! No copy allowed
-		TeKdTreeNode& operator=(const TeKdTreeNode& other);
-
-};	// end of class TeKdTreeNode
-
-//! A base class for Kd-Tree structures
-/*!
-	This class implements only common kdtree methods and properties.
- */
-template<class KdTreeNode>
-class TeBasicKdTree
-{
-	protected:				
-
-		//! Pointer to the root node
-		KdTreeNode* root_;
-
-		//! Bounding box of all nodes
-		TeBox mbr_;
-
-		//! The size of the K-d Tree (number of nodes)
-		unsigned int size_;		
-
-	public:
-
-		//! Constructor
-		TeBasicKdTree(const TeBox& mbr)
-			: root_(0), mbr_(mbr), size_(0u)
-		{
-		}
-
-		//! Destructor
-		~TeBasicKdTree()
-		{		
-			clear();
-		}
-
-		//! Clear all tree nodes
-		void clear(void)
-		{
-			if(root_)
-			{
-				erase(root_);
-				root_ = 0;
-				size_ = 0;
-			}
-		}
-
-		//! The number of tree nodes
-		const unsigned int& size(void) const
-		{
-			return size_;
-		}
-		
-		//! Return true if the tree is empty
-		bool isEmpty(void) const
-		{
-			return root_ == 0;
-		}
-
-		//! Sets the bounding box of all elements in the tree
-		void setBox(const TeBox& mbr)
-		{
-			mbr_ = mbr;
-		}
-
-		//! Sets the bounding box of all elements in the tree
-		const TeBox& getBox(void) const
-		{
-			return mbr_;
-		}
-
-	protected:
-
-		//! Erases a node from the tree and all nodes below it.
-		void erase(KdTreeNode* node)
-		{
-			if(node->hasLeft())
-				erase(node->getLeft());
-
-			if(node->hasRight())
-				erase(node->getRight());
-
-			delete node;
-
-			return;
-		}
-
-	private:
-
-		//! No copy allowed
-		TeBasicKdTree(const TeBasicKdTree& other);
-
-		//! No copy allowed
-		TeBasicKdTree& operator=(const TeBasicKdTree& other);
-};
-
-
-//! A class that represents a two dimensional K-d Tree (2-d Tree)
-/*!	
-	WARNING:
-
-	1. This type of tree stores the data into nodes (not only in the leafs node).
-	
-	2. This tree may be built by two ways: <BR>
-	   2.1. Inserting each element in the tree. In this case the tree can becomes unbalanced, but in practical
-	        cases this is not the expected, and is the best way to construct the tree (faster way). <BR>
-	   2.2. Passing a container with pairs (key/data-item) and using the method buildOptimized after
-	        calling kdsort. The tree built this way is almost balanced but will be 
-			construct in time O(N log N).<BR>
-			WARNING: In this case items with the same key will be stores in different nodes!<BR>
-	
-	3. This type of tree may be of special interest of BOX SEARCH QUERIES.	
-
-	4. If the node type is kd_node_data_single_tag than NodeData and NodeDataItem are the same types. And if
-	   one entry with the same key already exist, so they will be overwrite.
-	   
-	5. If the node type is kd_node_data_set_tag than NodeData mus have a method called push_back(NodeDataItem)
-	   that permits to store elements with the same key in the node.
- */
-template<class KdTreeNode>
-class TeKdTree : public TeBasicKdTree<KdTreeNode>
-{
-        using TeBasicKdTree<KdTreeNode>::root_;
-        using TeBasicKdTree<KdTreeNode>::size_;
-        using TeBasicKdTree<KdTreeNode>::mbr_;
-        
-	public:
-
-		//! Export key type.
-		typedef typename KdTreeNode::kdKey kdKey;
-
-		//! Export data type.
-		typedef typename KdTreeNode::kdData kdData;
-
-		//! Export data item type.
-		typedef typename KdTreeNode::kdDataItem kdDataItem;		
-
-		//! Export data type.
-		typedef typename KdTreeNode::kdDataTag kdDataTag;
-
-		//! Constructor
-		TeKdTree(const TeBox& mbr)
-			: TeBasicKdTree<KdTreeNode>(mbr)
-		{
-		}
-
-		//! Inserts the data with a given key in tree
-		inline void insert(const kdKey& key, const kdDataItem& item);
-
-		//! Inserts the data in the tree and and keeps it balanced: the kdsort algorithm must be called before
-		void buildOptimized(vector<pair<kdKey, kdDataItem> >& dataSet)
-		{
-			const unsigned int last = dataSet.size() - 1u;
-
-			root_ = buildOptimized(dataSet, 0u, last);			
-		}		
-
-		//! Range search query.
-		void search(const TeBox& rect, vector<KdTreeNode*>& report) const
-		{
-			if(root_)
-				search(rect, root_, 'x', report);
-
-			return;
-		}					
-
-	protected:
-
-		//! Inserts data for single nodes, i.e., nodes that stores only one element
-		void insertData(KdTreeNode*& node, const kdDataItem& data, const kd_node_data_single_tag&)
-		{
-			node->setData(data);
-		}
-
-		//! Inserts data for set nodes, i.e., nodes that may stores many element
-		void insertData(KdTreeNode*& node, const kdDataItem& data, const kd_node_data_set_tag&)
-		{
-			node->getData().push_back(data);
-		}
-
-		//! Recursive range query
-		inline void search(const TeBox& rect, KdTreeNode* node, const char& level, vector<KdTreeNode*>& report) const;
-
-		//! Builds the tree recursively
-		KdTreeNode* buildOptimized(vector<pair<kdKey, kdDataItem> >& dataSet, const unsigned int& first, const unsigned int& last)
-		{
-			const unsigned int kth = (last - first + 1u) / 2u;
-
-			KdTreeNode* newNode = new KdTreeNode(dataSet[first + kth].first);
-
-			newNode->setData(dataSet[first + kth].second);
-
-			++size_;
-
-			if((first + kth) > first)
-				newNode->setLeft(buildOptimized(dataSet, first, first + kth - 1u));
-
-			if((first + kth) < last)
-				newNode->setRight(buildOptimized(dataSet, first + kth + 1u, last));
-
-			return newNode;
-		}				
-
-	private:
-
-		//! No copy allowed
-		TeKdTree(const TeKdTree& other);
-
-		//! No copy allowed
-		TeKdTree& operator=(const TeKdTree& other);
-
-};	// end class TeKdTree
-
-template<class KdTreeNode>
-void TeKdTree<KdTreeNode>::insert(const kdKey& key, const kdDataItem& item)
-{
-	if(root_ == 0)
-	{
-		root_ = new KdTreeNode(key);
-
-		insertData(root_, item, kdDataTag());
-	}
-	else
-	{					
-		char level = 'x';
-
-		bool left = false;
-
-		KdTreeNode* x = root_;
-		KdTreeNode* y = 0;
-
-		while(x != 0)
-		{
-			y = x;
-
-			if(level == 'x')
-			{
-				if(key.x() > x->getKey().x())		// if the key is greater than, inserts in the right subtree
-				{
-					x = x->getRight();
-					left = false;
-				}
-				else if(key.x() < x->getKey().x())		// if the key is smaller than, inserts in the left subtree
-				{
-					x = x->getLeft();
-					left = true;
-				}
-				else if(key.y() == x->getKey().y())		// if the key already exist, in the case of single node the data will be overwrite and in the case of set node they will push_back the item
-                {
-					insertData(x, item, kdDataTag());
-
-					return;							
-				}
-				else					// found the same axis partition, so go left
-				{
-					x = x->getLeft();
-					left = true;
-				}						
-
-				level = 'y';
-			}
-			else
-			{
-				if(key.y() > x->getKey().y())
-				{
-					x = x->getRight();
-					left = false;
-				}
-				else if(key.y() < x->getKey().y())
-				{
-					x = x->getLeft();
-					left = true;
-				}
-				else if(key.x() == x->getKey().x())
-                                {
-					insertData(x, item, kdDataTag());
-
-					return;							
-				}
-				else
-				{
-					x = x->getLeft();
-					left = true;
-				}						
-
-				level = 'x';						
-			}
-		}
-
-		KdTreeNode* newNode = new KdTreeNode(key);
-
-		insertData(newNode, item, kdDataTag());
-
-		if(left)
-			y->setLeft(newNode);
-		else
-			y->setRight(newNode);
-	}
-
-	++size_;
-
-	return;
-}
-
-template<class KdTreeNode>
-void TeKdTree<KdTreeNode>::search(const TeBox& rect, KdTreeNode* node, const char& level, vector<KdTreeNode*>& report) const
-{
-	if((node->getKey().x() >= rect.x1_) && (node->getKey().x() <= rect.x2_) &&
-	   (node->getKey().y() >= rect.y1_) && (node->getKey().y() <= rect.y2_))
-		report.push_back(node);
-
-	if(level == 'x')
-	{
-		if(node->hasLeft())
-			if(node->getKey().x() >= rect.x1_)
-				search(rect, node->getLeft(), 'y', report);
-
-		if(node->hasRight())
-			if(node->getKey().x() <= rect.x2_)
-				search(rect, node->getRight(), 'y', report);
-	}
-	else
-	{
-		if(node->hasLeft())
-			if(node->getKey().y() >= rect.y1_)
-				search(rect, node->getLeft(), 'x', report);
-
-		if(node->hasRight())
-			if(node->getKey().y() <= rect.y2_)
-				search(rect, node->getRight(), 'x', report);
-	}
-
-	return;
-}
-
-//! Class that represents a node of a TeAdaptativeKdTree
-/*!
-	Each node contains a pointer to its left and right subtree (NULL if it is not set),
-	a discriminator that indicates the axis of partition, the partition key and
-	a set of data-items.
-
-	WARNING:
-
-	1. The key must have methods called x() and y().
-	
-	2. These kind of node stores the data only in the leafs.
-
-	3. The leaf nodes contains a set of values that forms a bucket (the size is controlled by the tree methods tha use this class).
- */
-template<class NodeKey, class NodeData, class NodeDataItem>
-class TeAdaptativeKdTreeNode
-{
-protected:
-		//! The key used to access this record
-		double key_;
-
-		//! The data stored in this record
-		NodeData data_;
-
-		//! The discriminator used in partition
-		char discriminator_;
-
-		//! Pointer to the left sub-tree.
-		TeAdaptativeKdTreeNode* left_;
-
-		//! Pointer to the right sub-tree.
-		TeAdaptativeKdTreeNode* right_;
-
-public:
-		//! Export key type.
-		typedef NodeKey kdKey;
-
-		//! Export data type.
-		typedef NodeData kdData;
-
-		//! Export data item type.
-		typedef NodeDataItem kdDataItem;
-
-		//! Constructor
-		TeAdaptativeKdTreeNode(const double& k)
-			: key_(k), discriminator_('x'), left_(0), right_(0)
-		{ }
-
-		//! Sets the key to the node
-		void setKey(const double& k)
-		{
-			key_ = k;
-		}
-
-		//! Returns a reference to node key
-		const double& getKey(void) const
-		{
-			return key_;
-		}
-
-		//! Sets the data in the node
-		void setData(const NodeData& data)
-		{
-			data_ = data;
-		}
-
-		//! Returns a reference to data node
-		NodeData& getData(void)
-		{
-			return data_;
-		}
-
-		//! Sets the data in the node
-		void setDiscriminator(const char& d)
-		{
-			discriminator_ = d;
-		}
-
-		//! Returns a reference to discriminator
-		const char& getDiscriminator(void) const
-		{
-			return discriminator_;
-		}
-
-		//! Sets the left child pointer
-		void setLeft(TeAdaptativeKdTreeNode* node)
-		{
-			left_ = node;
-		}
-
-		//! Sets the right child pointer
-		void setRight(TeAdaptativeKdTreeNode* node)
-		{
-			right_ = node;
-		}
-
-		//! Accessor for left child
-		TeAdaptativeKdTreeNode* getLeft(void) const
-		{
-			return left_;
-		}
-
-		//! Accessor for right child
-		TeAdaptativeKdTreeNode* getRight(void) const
-		{
-			return right_;
-		}		
-
-		//! Method to check if this has a left child
-		bool hasLeft(void) const
-		{
-			return (left_ != 0);
-		}
-		
-		//! Method to check if a this has a right child
-		bool hasRight(void) const
-		{
-			return (right_ != 0);
-		}
-
-		//! Method to check if this has no children
-		bool isLeaf(void) const
-		{
-			return !(hasLeft() || hasRight());
-		}
-
-		//! Method to count the number of nodes below this
-		unsigned int descendants(void) const
-		{
-			unsigned int totalLeft  = 0u;
-			unsigned int totalRight = 0u;
-
-			if(hasLeft())
-				totalLeft = 1u + getLeft()->descendants();
-
-			if(hasRight())
-				totalRight = 1u + getRight()->descendants();
-
-			return (totalLeft + totalRight);
-		}		
-
-	private:
-
-		//! No copy allowed
-		TeAdaptativeKdTreeNode(const TeAdaptativeKdTreeNode& other);
-
-		//! No copy allowed
-		TeAdaptativeKdTreeNode& operator=(const TeAdaptativeKdTreeNode& other);
-
-};	// end of class TeAdaptativeKdTreeNode
-
-//! A class that represents a two dimensional K-d Tree (2-d Tree) that store data-elements into the leafs
-/*!	
-	WARNING:
-
-	1. This type of tree stores the data only in the leaf nodes.
-	
-	2. The process of construction expect that the tree is almost balanced
-    	
-	3. This type of tree may be of special interest of NEAREST NEIGHBOR SEARCH QUERIES.
-
-	4. After a box search it will be necessary to do a refinement.
- */
-template<class KdTreeNode>
-class TeAdaptativeKdTree : public TeBasicKdTree<KdTreeNode>
-{
-	using TeBasicKdTree<KdTreeNode>::root_;
-	using TeBasicKdTree<KdTreeNode>::size_;
-	using TeBasicKdTree<KdTreeNode>::mbr_;
-        
-protected:				
-		//! Bucket size (maximum number of elements in each node)
-		unsigned int bucketSize_;
-		
-public:
-		//! Export key type.
-		typedef typename KdTreeNode::kdKey kdKey;		
-
-		//! Export data type.
-		typedef typename KdTreeNode::kdData kdData;		
-
-		//! Export data item type.
-		typedef typename KdTreeNode::kdDataItem kdDataItem;	
-
-		//! Export node type.
-		typedef KdTreeNode kdNode;		
-
-		//! Constructor
-		TeAdaptativeKdTree(const TeBox& box, const unsigned int& bucketSize = 12)
-			: TeBasicKdTree<KdTreeNode>(box), bucketSize_(bucketSize)
-		{
-		}
-
-		//! Sets bucket size for leaf nodes
-		void setBucketSize(const unsigned int& size)
-		{
-			bucketSize_ = size;
-		}
-
-		//! Sets bucket size for leaf nodes
-		const unsigned int& getBucketSize(void) const
-		{
-			return bucketSize_;
-		}
-
-		//! Inserts the data set into the tree
-		void build(vector<pair<kdKey, kdDataItem> >& dataSet)
-		{
-			root_ = build(dataSet, 0.0, mbr_);
-		}
-
-		//! Search the nearest data in nodes: you must pass an array of kdDataItem of size "k" with coordinates values (X() and Y()) adjusted to TeMAXFLOAT (this dummy values will be replaced at processing time), and if not all neighbors are found so sqrDists will contains TeMAXFLOAT in array index
-		void nearestNeighborSearch(const kdKey& key, vector<kdDataItem>& report, vector<double>& sqrDists, const unsigned int& k) const
-		{
-			if(root_)
-			{
-				sqrDists.clear();
-
-				for(unsigned int i = 0; i < k; ++i)
-					sqrDists.push_back(TeMAXFLOAT);
-				
-				TeBox rect(-TeMAXFLOAT, -TeMAXFLOAT, +TeMAXFLOAT, +TeMAXFLOAT);
-
-				nearestNeighborSearch(root_, key, report, sqrDists, rect);
-			}
-		}		
-
-		//! Range search query.
-		void search(const TeBox& rect, vector<KdTreeNode*>& report) const
-		{
-			if(root_)
-				search(rect, root_, report);
-
-			return;
-		}		
-
-		//! Range search query: the refinement is already done
-		inline void search(const TeBox& rect, vector<kdDataItem>& report) const;
-
-protected:			
-		//! Build the tree recursivily 
-		inline KdTreeNode* build(vector<pair<kdKey, kdDataItem> >& dataSet, double averageValue, const TeBox& mbr);
-
-		//! Recursive range query.
-		inline void search(const TeBox& rect, KdTreeNode* node, vector<KdTreeNode*>& report) const;
-
-		//! Recursive nearest neighbor search
-		inline void nearestNeighborSearch(KdTreeNode* node, const kdKey& key, vector<kdDataItem>& report, vector<double>& sqrDists, TeBox& rect) const;
-
-		//! Update neighbor list
-		inline void update(KdTreeNode* node, const kdKey& key, vector<kdDataItem>& report, vector<double>& sqrDists, TeBox& rect) const;
-
-		//! Returns the average value along the axis
-		double average(vector<pair<kdKey, kdDataItem> >& dataSet, const char& discriminator) const
-		{
-			const unsigned int size = dataSet.size();
-
-			double medianValue = 0.0;
-
-			if(discriminator == 'x')
-			{
-				for(unsigned int i = 0; i < size; ++i)
-					medianValue += dataSet[i].first.x();
-
-				return medianValue / size;
-			}
-			else
-			{
-				for(unsigned int i = 0; i < size; ++i)
-					medianValue += dataSet[i].first.y();
-
-				return medianValue / size;
-			}
-		}			
-		
-private:
-		//! No copy allowed
-		TeAdaptativeKdTree(const TeAdaptativeKdTree& other);
-
-		//! No copy allowed
-		TeAdaptativeKdTree& operator=(const TeAdaptativeKdTree& other);
-
-};	// end class TeAdaptativeKdTree
-
-template<class KdTreeNode>
-KdTreeNode* TeAdaptativeKdTree<KdTreeNode>::build(vector<pair<kdKey, kdDataItem> >& dataSet, double averageValue, const TeBox& mbr)
-{
-	++size_;
-
-	if(dataSet.size() <= bucketSize_)
-	{
-		KdTreeNode* node = new KdTreeNode(averageValue);
-
-		node->setDiscriminator('l');
-		//node->setBox(mbr);
-
-		unsigned int size = dataSet.size();
-
-		for(unsigned int i = 0; i < size; ++i)
-			node->getData().push_back(dataSet[i].second);
-
-		return node;
-	}
-
-	TeBox newMbr1(mbr);
-	TeBox newMbr2(mbr);	
-
-	char discriminator = 'x';
-
-	vector<pair<kdKey, kdDataItem> > leftDataSet;
-	vector<pair<kdKey, kdDataItem> > rightDataSet;
-
-// Finds the largest dimension
-	if((mbr.x2_ - mbr.x1_) > (mbr.y2_ - mbr.y1_))
-	{
-// Finds the median along "x" axis
-		averageValue = average(dataSet, 'x');
-
-// Adjust box for left and right branchs
-		newMbr1.x2_ = averageValue;
-		newMbr2.x1_ = averageValue;
-
-		unsigned int size = dataSet.size();
-
-		for(unsigned int i = 0; i < size; ++ i)
-		{
-			if(dataSet[i].first.x() <= averageValue)
-				leftDataSet.push_back(dataSet[i]);
-			else
-				rightDataSet.push_back(dataSet[i]);
-		}
-	}
-	else
-	{
-		discriminator = 'y';
-
-// Finds the median along "y" axis		
-		averageValue = average(dataSet, 'y');
-
-// Adjust box for left and right branchs
-		newMbr1.y2_ = averageValue;
-		newMbr2.y1_ = averageValue;
-
-		unsigned int size = dataSet.size();
-
-		for(unsigned int i = 0; i < size; ++ i)
-		{
-			if(dataSet[i].first.y() <= averageValue)
-				leftDataSet.push_back(dataSet[i]);
-			else
-				rightDataSet.push_back(dataSet[i]);
-		}
-	}
-
-	dataSet.clear();
-
-	KdTreeNode* node = new KdTreeNode(averageValue);
-	
-	//node->setBox(mbr);
-	
-	if(rightDataSet.size() == 0u)		// If all coordinates have the same coordinate values, the right vector will be empty so we need stop division to
-	{
-		node->setDiscriminator('l');
-		//node->setBox(newMbr1);
-
-		unsigned int size = leftDataSet.size();
-
-		for(unsigned int i = 0; i < size; ++i)
-			node->getData().push_back(leftDataSet[i].second);
-
-		//throw;
-	}
-	else if(leftDataSet.size() == 0u)		// If all coordinates have the same coordinate values, the left vector is empty, so we need to stop
-	{
-		node->setDiscriminator('l');
-		//node->setBox(newMbr2);
-
-		unsigned int size = rightDataSet.size();
-
-		for(unsigned int i = 0; i < size; ++i)
-			node->getData().push_back(rightDataSet[i].second);
-
-		//throw;
-	}
-	else
-	{
-		node->setDiscriminator(discriminator);
-		node->setLeft(build(leftDataSet, averageValue, newMbr1));
-		node->setRight(build(rightDataSet, averageValue, newMbr2));
-	}
-	
-	return node;
-}
-
-template<class KdTreeNode>
-void TeAdaptativeKdTree<KdTreeNode>::search(const TeBox& rect, vector<kdDataItem>& report) const
-{
-	vector<KdTreeNode*> reportNodes;
-
-	search(rect, reportNodes);
-
-    unsigned int nNodes = reportNodes.size();
-
-	for(unsigned int i = 0; i < nNodes; ++i)
-	{
-		unsigned int nElements = reportNodes[i]->getData().size();
-
-		for(unsigned int j = 0; j < nElements; ++j)
-		{
-            if(TeIntersects((reportNodes[i])->getData()[j], rect))
-			{
-				report.push_back((reportNodes[i])->getData()[j]);
-			}
-		}
-	}
-}
-
-template<class KdTreeNode>
-void TeAdaptativeKdTree<KdTreeNode>::search(const TeBox& rect, KdTreeNode* node, vector<KdTreeNode*>& report) const
-{
-	if(node->getDiscriminator() == 'x')
-	{
-		if(node->hasLeft())
-			if(rect.x1_ <= node->getKey())
-				search(rect, node->getLeft(), report);		
-
-		if(node->hasRight())
-			if(rect.x2_ >= node->getKey())
-				search(rect, node->getRight(), report);
-	}
-	else if(node->getDiscriminator() == 'y')
-	{
-		if(node->hasLeft())
-			if(rect.y1_ <= node->getKey())
-				search(rect, node->getLeft(), report);		
-
-		if(node->hasRight())
-			if(rect.y2_ >= node->getKey())
-				search(rect, node->getRight(), report);
-	}
-	else
-	{		
-		report.push_back(node);
-	}
-
-	return;
-}
-
-template<class KdTreeNode>
-void TeAdaptativeKdTree<KdTreeNode>::nearestNeighborSearch(KdTreeNode* node, const kdKey& key, vector<kdDataItem>& report, vector<double>& sqrDists, TeBox& rect) const
-{
-	if(node->getDiscriminator() == 'l')
-	{
-		update(node, key, report, sqrDists, rect);	// this is a leaf node -> update list of neighbours 
-	}
-	else if(node->getDiscriminator() == 'x')
-	{
-		if(key.x() <= node->getKey())
-		{
-			nearestNeighborSearch(node->getLeft(), key, report, sqrDists, rect);
-
-			if((rect.x1_ < node->getKey()) && (node->getKey() < rect.x2_))
-				nearestNeighborSearch(node->getRight(), key, report, sqrDists, rect);
-		}
-		else
-		{
-			nearestNeighborSearch(node->getRight(), key, report, sqrDists, rect);
-
-			if((rect.x1_ < node->getKey()) &&(node->getKey() < rect.x2_))
-				nearestNeighborSearch(node->getLeft(), key, report, sqrDists, rect);
-		}		
-	}
-	else if(node->getDiscriminator() == 'y')
-	{
-		 if(key.y() <= node->getKey())
-		{
-			nearestNeighborSearch(node->getLeft(), key, report, sqrDists, rect);
-
-			if((rect.y1_ < node->getKey()) &&(node->getKey() < rect.y2_ ))
-				nearestNeighborSearch(node->getRight(), key, report, sqrDists, rect);
-		}
-		else
-		{
-			nearestNeighborSearch(node->getRight(), key, report, sqrDists, rect);
-
-			if((rect.y1_ < node->getKey()) &&(node->getKey() < rect.y2_))
-				nearestNeighborSearch(node->getLeft(), key, report, sqrDists, rect);
-		}
-	}	
-	
-}
-
-template<class KdTreeNode>
-void TeAdaptativeKdTree<KdTreeNode>::update(KdTreeNode* node, const kdKey& key, vector<kdDataItem>& report, vector<double>& sqrDists, TeBox& rect) const
-{
-// rect is the bounding box of neighbors
-
-	const unsigned int size = node->getData().size();
-
-	const unsigned int nNeighbors = report.size();
-
-// for each element in the node, we need to search for distances less than of some one of sqrDists
-	for(unsigned int i = 0u; i < size; ++i)
-	{
-		double dx = (key.x() - node->getData()[i].location().x());
-		double dy = (key.y() - node->getData()[i].location().y());
-		
-		double dkp = (dx * dx) + (dy * dy);	// square distance from the key point to the node
-
-// if the distance of "i-th" element is less than the maximum distance in the sqrDists
-		if(dkp < sqrDists[nNeighbors - 1])
-		{
-// so the element must be reported
-
-// and the srqDists vector must be rearranged
-			for(unsigned int j = 0u; j < nNeighbors; ++j)
-			{
-				if(dkp < sqrDists[j])	// if the position is found
-				{  
-// move the elements to the right
-					for(unsigned int k = nNeighbors - 1; k > j; --k)
-					{
-						report[k]   = report[k - 1];
-						sqrDists[k] = sqrDists[k - 1];
-					} 
-
-// inserts the element in the report and update its distance
-					report[j] = node->getData()[i];
-
-					sqrDists[j] = dkp;
-
-					break;
-				}
-			}
-		}
-	}
-
-	double maxDist = sqrDists[nNeighbors - 1];
-
-	if(maxDist != TeMAXFLOAT)
-	{
-		maxDist = sqrt(maxDist);
-	}
-
-	rect.x1_ = key.x() - maxDist;
-	rect.y1_ = key.y() - maxDist;
-	rect.x2_ = key.x() + maxDist;
-	rect.y2_ = key.y() + maxDist;
-}
-/** @} */ 
-
-};	// end namespace TeSAM
-
-
-#endif	// __TERRALIB_INTERNAL_KDTREE_H
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file   TeKdTree.h
+    \brief  This file contains an implementation of kdtree data structures in main memory for two dimensions.
+	\note   These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
+	        THIS IS FOR INTERNAL USE ONLY.
+    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>    
+*/
+
+#ifndef  __TERRALIB_INTERNAL_KDTREE_H
+#define  __TERRALIB_INTERNAL_KDTREE_H
+
+#include "TeGeometry.h"
+
+/** 
+ * WARNING: These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
+ *          the support and interfaces can be changed in future. THIS IS FOR INTERNAL USE ONLY.
+ *
+ */
+
+namespace TeSAM
+{
+/** @defgroup PartitionAlgorithms Partition Algorithms
+ *  Partition Algorithms.
+ *  @{
+ */
+
+//! This function partition the conteiner in two parts: k-1 elements to the left (elements less than or equals to k-th element) and the right part with all other elements (elements greater than or equal to k-th element)
+/*
+	\param A             Conteiner of elements to partition
+	\param kthElement    Position of the k-th element, around the conteiner will be pertitionated
+	\param firstElement  Position of the first element
+	\param lastElement   Position of the las element
+	\param compFunctor   Functor to compare elements: implements the function "less than"
+
+*/
+template<class CONTAINER, class COMPFUNCTOR> 
+void TeHoareFind(CONTAINER& A, const unsigned int& kthElement, const unsigned int& firstElement, const unsigned int& lastElement,  const COMPFUNCTOR& compFunctor)
+{
+	unsigned int m = firstElement;
+	unsigned int n = lastElement;
+
+// Test if the median is in the bounds
+	if((kthElement < firstElement) || (kthElement > lastElement))
+		return;	
+
+// Do conteiner partition
+	while(m < n)
+	{		
+		unsigned int i = m;
+		unsigned int j = n;
+
+		typename CONTAINER::value_type r = A[kthElement];
+
+		while(i <= j)
+		{
+			while(compFunctor(A[i], r))
+				++i;  
+
+			while(compFunctor(r, A[j]))
+				--j;
+			
+			if(i <= j)
+			{
+				typename CONTAINER::value_type w = A[i];
+				A[i] = A[j];
+				A[j] = w;
+				
+			    ++i;
+				--j;
+			}
+		}
+
+		if(kthElement <= j)			// if the meet point was to the right, so all points above j are greater than the k-th element
+			n = j;
+		else if(i <= kthElement)	// otherwise, if the meeting point was to the left of k-th, so all elements before i are already in the correct location
+			m = i;
+		else
+			break;
+	}
+}
+
+//! Partition the conteiner like a bidimensional K-d Tree using Hoare algorithms
+/*
+	\param dataSet					Conteinet elements to be sorted like a K-dTree
+	\param first					Position of the first element in conteiner, where the sort will begin
+	\param last						Position of the last element, where the sort ends
+	\param level					Indicates the axis to begin the sort ('x' or 'y') and is used during the recursion process
+	\param lessThanCompFunctorByX	Functor to compare elements along the 'x' axis
+	\param lessThanCompFunctorByY	Functor to compare elements along the 'y' axis
+
+  	The expected complexity is O(N log N), where N is the number of elements in conteiner.
+*/
+template<class CONTAINER, class LESSTHANX, class LESSTHANY> 
+void kdsort(CONTAINER& dataSet, const unsigned int& first, const unsigned int& last, const char& level, const LESSTHANX& lessThanCompFunctorByX, const LESSTHANY& lessThanCompFunctorByY)
+{
+	const unsigned int kth = (last - first + 1u) / 2u;
+
+	if(level == 'x')
+	{
+// Move data around X axis
+		TeHoareFind(dataSet, first + kth, first, last, lessThanCompFunctorByX);
+
+// Recursive sort the left half and right half
+		if((first + kth) > first)
+			kdsort(dataSet, first, first + kth - 1u, 'y', lessThanCompFunctorByX, lessThanCompFunctorByY);
+
+		if((first + kth) < last)
+			kdsort(dataSet, first + kth + 1u, last, 'y', lessThanCompFunctorByX, lessThanCompFunctorByY);
+	}
+	else
+	{
+// Move data around Y axis
+		TeHoareFind(dataSet, first + kth, first, last, lessThanCompFunctorByY);
+
+// Recursive sort the left half and right half
+		if((first + kth) > first)
+			kdsort(dataSet, first, first + kth - 1u, 'x', lessThanCompFunctorByX, lessThanCompFunctorByY);
+
+		if((first + kth) < last)
+			kdsort(dataSet, first + kth + 1u, last, 'x', lessThanCompFunctorByX, lessThanCompFunctorByY);
+	}
+}
+/** @} */
+
+//! Kd-tree node type for nodes with single elements (used by template instantiation).
+struct TL_DLL kd_node_data_single_tag {};
+
+//! Kd-Tree node type for nodes with multuple elements (used by template instantiation).
+struct TL_DLL kd_node_data_set_tag {};
+
+
+//! Class that represents a node of a TeKdTree
+/*!
+	Each node contains a pointer to its left and right subtree (NULL if it is not set),
+	one key used for insertion of the data into the tree.
+
+	WARNING: <BR>
+
+	1. The key must have methods called x() and y(). <BR>
+	
+	2. These kind of node stores the data in each node. <BR>
+
+	3. The nodes may contains one single element (kd_node_data_single_tag) or a set of values (kd_node_data_set_tag). <BR>
+	
+	4. If the node type is kd_node_data_single_tag than NodeData and NodeDataItem are the same types. And if
+	   one entry with the same key already exist, so they will be overwrite. <BR>
+	   
+	5. If the node type is kd_node_data_set_tag than NodeData mus have a method called push_back(NodeDataItem)
+	   that permits to store elements with the same key in the node. <BR>
+ */
+template<class NodeKey, class NodeData, class NodeDataItem,
+         class NodeDataTag = kd_node_data_single_tag>
+class TeKdTreeNode
+{
+	protected:
+
+		//! The key used to access this record
+		NodeKey key_;
+
+		//! The data stored in this record
+		NodeData data_;
+
+		//! Pointer to the left sub-tree.
+		TeKdTreeNode* left_;
+
+		//! Pointer to the right sub-tree.
+		TeKdTreeNode* right_;
+
+	public:
+
+		//! Export key type.
+		typedef NodeKey kdKey;
+
+		//! Export data type.
+		typedef NodeData kdData;
+
+		//! Export data item type.
+		typedef NodeDataItem kdDataItem;
+
+		//! Export data type.
+		typedef NodeDataTag  kdDataTag;
+
+		//! Constructor
+		TeKdTreeNode(const NodeKey& k)
+			: key_(k), left_(0), right_(0)
+		{
+		}
+
+		//! Sets the key to the node
+		void setKey(const NodeKey& k)
+		{
+			key_ = k;
+		}
+
+		//! Returns a reference to node key
+		const NodeKey& getKey(void) const
+		{
+			return key_;
+		}
+
+		//! Sets the data in the node
+		void setData(const NodeData& data)
+		{
+			data_ = data;
+		}
+
+		//! Returns a reference to data node
+		NodeData& getData(void)
+		{
+			return data_;
+		}
+
+		//! Sets the left child pointer
+		void setLeft(TeKdTreeNode* node)
+		{
+			left_ = node;
+		}
+
+		//! Sets the right child pointer
+		void setRight(TeKdTreeNode* node)
+		{
+			right_ = node;
+		}
+
+		//! Accessor for left child
+		TeKdTreeNode* getLeft(void) const
+		{
+			return left_;
+		}
+
+		//! Accessor for right child
+		TeKdTreeNode* getRight(void) const
+		{
+			return right_;
+		}		
+
+		//! Method to check if this has a left child
+		bool hasLeft(void) const
+		{
+			return (left_ != 0);
+		}
+		
+		//! Method to check if a this has a right child
+		bool hasRight(void) const
+		{
+			return (right_ != 0);
+		}
+
+		//! Method to check if this has no children
+		bool isLeaf(void) const
+		{
+			return !(hasLeft() || hasRight());
+		}		
+
+		//! Method to count the number of nodes below this
+		unsigned int descendants(void) const
+		{
+			unsigned int totalLeft  = 0u;
+			unsigned int totalRight = 0u;
+
+			if(hasLeft())
+				totalLeft = 1u + getLeft()->descendants();
+
+			if(hasRight())
+				totalRight = 1u + getRight()->descendants();
+
+			return (totalLeft + totalRight);
+		}
+
+	private:
+
+		//! No copy allowed
+		TeKdTreeNode(const TeKdTreeNode& other);
+
+		//! No copy allowed
+		TeKdTreeNode& operator=(const TeKdTreeNode& other);
+
+};	// end of class TeKdTreeNode
+
+//! A base class for Kd-Tree structures
+/*!
+	This class implements only common kdtree methods and properties.
+ */
+template<class KdTreeNode>
+class TeBasicKdTree
+{
+	protected:				
+
+		//! Pointer to the root node
+		KdTreeNode* root_;
+
+		//! Bounding box of all nodes
+		TeBox mbr_;
+
+		//! The size of the K-d Tree (number of nodes)
+		unsigned int size_;		
+
+	public:
+
+		//! Constructor
+		TeBasicKdTree(const TeBox& mbr)
+			: root_(0), mbr_(mbr), size_(0u)
+		{
+		}
+
+		//! Destructor
+		~TeBasicKdTree()
+		{		
+			clear();
+		}
+
+		//! Clear all tree nodes
+		void clear(void)
+		{
+			if(root_)
+			{
+				erase(root_);
+				root_ = 0;
+				size_ = 0;
+			}
+		}
+
+		//! The number of tree nodes
+		const unsigned int& size(void) const
+		{
+			return size_;
+		}
+		
+		//! Return true if the tree is empty
+		bool isEmpty(void) const
+		{
+			return root_ == 0;
+		}
+
+		//! Sets the bounding box of all elements in the tree
+		void setBox(const TeBox& mbr)
+		{
+			mbr_ = mbr;
+		}
+
+		//! Sets the bounding box of all elements in the tree
+		const TeBox& getBox(void) const
+		{
+			return mbr_;
+		}
+
+	protected:
+
+		//! Erases a node from the tree and all nodes below it.
+		void erase(KdTreeNode* node)
+		{
+			if(node->hasLeft())
+				erase(node->getLeft());
+
+			if(node->hasRight())
+				erase(node->getRight());
+
+			delete node;
+
+			return;
+		}
+
+	private:
+
+		//! No copy allowed
+		TeBasicKdTree(const TeBasicKdTree& other);
+
+		//! No copy allowed
+		TeBasicKdTree& operator=(const TeBasicKdTree& other);
+};
+
+
+//! A class that represents a two dimensional K-d Tree (2-d Tree)
+/*!	
+	WARNING:
+
+	1. This type of tree stores the data into nodes (not only in the leafs node).
+	
+	2. This tree may be built by two ways: <BR>
+	   2.1. Inserting each element in the tree. In this case the tree can becomes unbalanced, but in practical
+	        cases this is not the expected, and is the best way to construct the tree (faster way). <BR>
+	   2.2. Passing a container with pairs (key/data-item) and using the method buildOptimized after
+	        calling kdsort. The tree built this way is almost balanced but will be 
+			construct in time O(N log N).<BR>
+			WARNING: In this case items with the same key will be stores in different nodes!<BR>
+	
+	3. This type of tree may be of special interest of BOX SEARCH QUERIES.	
+
+	4. If the node type is kd_node_data_single_tag than NodeData and NodeDataItem are the same types. And if
+	   one entry with the same key already exist, so they will be overwrite.
+	   
+	5. If the node type is kd_node_data_set_tag than NodeData mus have a method called push_back(NodeDataItem)
+	   that permits to store elements with the same key in the node.
+ */
+template<class KdTreeNode>
+class TeKdTree : public TeBasicKdTree<KdTreeNode>
+{
+        using TeBasicKdTree<KdTreeNode>::root_;
+        using TeBasicKdTree<KdTreeNode>::size_;
+        using TeBasicKdTree<KdTreeNode>::mbr_;
+        
+	public:
+
+		//! Export key type.
+		typedef typename KdTreeNode::kdKey kdKey;
+
+		//! Export data type.
+		typedef typename KdTreeNode::kdData kdData;
+
+		//! Export data item type.
+		typedef typename KdTreeNode::kdDataItem kdDataItem;		
+
+		//! Export data type.
+		typedef typename KdTreeNode::kdDataTag kdDataTag;
+
+		//! Constructor
+		TeKdTree(const TeBox& mbr)
+			: TeBasicKdTree<KdTreeNode>(mbr)
+		{
+		}
+
+		//! Inserts the data with a given key in tree
+		inline void insert(const kdKey& key, const kdDataItem& item);
+
+		//! Inserts the data in the tree and and keeps it balanced: the kdsort algorithm must be called before
+		void buildOptimized(vector<pair<kdKey, kdDataItem> >& dataSet)
+		{
+			const unsigned int last = dataSet.size() - 1u;
+
+			root_ = buildOptimized(dataSet, 0u, last);			
+		}		
+
+		//! Range search query.
+		void search(const TeBox& rect, vector<KdTreeNode*>& report) const
+		{
+			if(root_)
+				search(rect, root_, 'x', report);
+
+			return;
+		}					
+
+	protected:
+
+		//! Inserts data for single nodes, i.e., nodes that stores only one element
+		void insertData(KdTreeNode*& node, const kdDataItem& data, const kd_node_data_single_tag&)
+		{
+			node->setData(data);
+		}
+
+		//! Inserts data for set nodes, i.e., nodes that may stores many element
+		void insertData(KdTreeNode*& node, const kdDataItem& data, const kd_node_data_set_tag&)
+		{
+			node->getData().push_back(data);
+		}
+
+		//! Recursive range query
+		inline void search(const TeBox& rect, KdTreeNode* node, const char& level, vector<KdTreeNode*>& report) const;
+
+		//! Builds the tree recursively
+		KdTreeNode* buildOptimized(vector<pair<kdKey, kdDataItem> >& dataSet, const unsigned int& first, const unsigned int& last)
+		{
+			const unsigned int kth = (last - first + 1u) / 2u;
+
+			KdTreeNode* newNode = new KdTreeNode(dataSet[first + kth].first);
+
+			newNode->setData(dataSet[first + kth].second);
+
+			++size_;
+
+			if((first + kth) > first)
+				newNode->setLeft(buildOptimized(dataSet, first, first + kth - 1u));
+
+			if((first + kth) < last)
+				newNode->setRight(buildOptimized(dataSet, first + kth + 1u, last));
+
+			return newNode;
+		}				
+
+	private:
+
+		//! No copy allowed
+		TeKdTree(const TeKdTree& other);
+
+		//! No copy allowed
+		TeKdTree& operator=(const TeKdTree& other);
+
+};	// end class TeKdTree
+
+template<class KdTreeNode>
+void TeKdTree<KdTreeNode>::insert(const kdKey& key, const kdDataItem& item)
+{
+	if(root_ == 0)
+	{
+		root_ = new KdTreeNode(key);
+
+		insertData(root_, item, kdDataTag());
+	}
+	else
+	{					
+		char level = 'x';
+
+		bool left = false;
+
+		KdTreeNode* x = root_;
+		KdTreeNode* y = 0;
+
+		while(x != 0)
+		{
+			y = x;
+
+			if(level == 'x')
+			{
+				if(key.x() > x->getKey().x())		// if the key is greater than, inserts in the right subtree
+				{
+					x = x->getRight();
+					left = false;
+				}
+				else if(key.x() < x->getKey().x())		// if the key is smaller than, inserts in the left subtree
+				{
+					x = x->getLeft();
+					left = true;
+				}
+				else if(key.y() == x->getKey().y())		// if the key already exist, in the case of single node the data will be overwrite and in the case of set node they will push_back the item
+                {
+					insertData(x, item, kdDataTag());
+
+					return;							
+				}
+				else					// found the same axis partition, so go left
+				{
+					x = x->getLeft();
+					left = true;
+				}						
+
+				level = 'y';
+			}
+			else
+			{
+				if(key.y() > x->getKey().y())
+				{
+					x = x->getRight();
+					left = false;
+				}
+				else if(key.y() < x->getKey().y())
+				{
+					x = x->getLeft();
+					left = true;
+				}
+				else if(key.x() == x->getKey().x())
+                                {
+					insertData(x, item, kdDataTag());
+
+					return;							
+				}
+				else
+				{
+					x = x->getLeft();
+					left = true;
+				}						
+
+				level = 'x';						
+			}
+		}
+
+		KdTreeNode* newNode = new KdTreeNode(key);
+
+		insertData(newNode, item, kdDataTag());
+
+		if(left)
+			y->setLeft(newNode);
+		else
+			y->setRight(newNode);
+	}
+
+	++size_;
+
+	return;
+}
+
+template<class KdTreeNode>
+void TeKdTree<KdTreeNode>::search(const TeBox& rect, KdTreeNode* node, const char& level, vector<KdTreeNode*>& report) const
+{
+	if((node->getKey().x() >= rect.x1_) && (node->getKey().x() <= rect.x2_) &&
+	   (node->getKey().y() >= rect.y1_) && (node->getKey().y() <= rect.y2_))
+		report.push_back(node);
+
+	if(level == 'x')
+	{
+		if(node->hasLeft())
+			if(node->getKey().x() >= rect.x1_)
+				search(rect, node->getLeft(), 'y', report);
+
+		if(node->hasRight())
+			if(node->getKey().x() <= rect.x2_)
+				search(rect, node->getRight(), 'y', report);
+	}
+	else
+	{
+		if(node->hasLeft())
+			if(node->getKey().y() >= rect.y1_)
+				search(rect, node->getLeft(), 'x', report);
+
+		if(node->hasRight())
+			if(node->getKey().y() <= rect.y2_)
+				search(rect, node->getRight(), 'x', report);
+	}
+
+	return;
+}
+
+//! Class that represents a node of a TeAdaptativeKdTree
+/*!
+	Each node contains a pointer to its left and right subtree (NULL if it is not set),
+	a discriminator that indicates the axis of partition, the partition key and
+	a set of data-items.
+
+	WARNING:
+
+	1. The key must have methods called x() and y().
+	
+	2. These kind of node stores the data only in the leafs.
+
+	3. The leaf nodes contains a set of values that forms a bucket (the size is controlled by the tree methods tha use this class).
+ */
+template<class NodeKey, class NodeData, class NodeDataItem>
+class TeAdaptativeKdTreeNode
+{
+protected:
+		//! The key used to access this record
+		double key_;
+
+		//! The data stored in this record
+		NodeData data_;
+
+		//! The discriminator used in partition
+		char discriminator_;
+
+		//! Pointer to the left sub-tree.
+		TeAdaptativeKdTreeNode* left_;
+
+		//! Pointer to the right sub-tree.
+		TeAdaptativeKdTreeNode* right_;
+
+public:
+		//! Export key type.
+		typedef NodeKey kdKey;
+
+		//! Export data type.
+		typedef NodeData kdData;
+
+		//! Export data item type.
+		typedef NodeDataItem kdDataItem;
+
+		//! Constructor
+		TeAdaptativeKdTreeNode(const double& k)
+			: key_(k), discriminator_('x'), left_(0), right_(0)
+		{ }
+
+		//! Sets the key to the node
+		void setKey(const double& k)
+		{
+			key_ = k;
+		}
+
+		//! Returns a reference to node key
+		const double& getKey(void) const
+		{
+			return key_;
+		}
+
+		//! Sets the data in the node
+		void setData(const NodeData& data)
+		{
+			data_ = data;
+		}
+
+		//! Returns a reference to data node
+		NodeData& getData(void)
+		{
+			return data_;
+		}
+
+		//! Sets the data in the node
+		void setDiscriminator(const char& d)
+		{
+			discriminator_ = d;
+		}
+
+		//! Returns a reference to discriminator
+		const char& getDiscriminator(void) const
+		{
+			return discriminator_;
+		}
+
+		//! Sets the left child pointer
+		void setLeft(TeAdaptativeKdTreeNode* node)
+		{
+			left_ = node;
+		}
+
+		//! Sets the right child pointer
+		void setRight(TeAdaptativeKdTreeNode* node)
+		{
+			right_ = node;
+		}
+
+		//! Accessor for left child
+		TeAdaptativeKdTreeNode* getLeft(void) const
+		{
+			return left_;
+		}
+
+		//! Accessor for right child
+		TeAdaptativeKdTreeNode* getRight(void) const
+		{
+			return right_;
+		}		
+
+		//! Method to check if this has a left child
+		bool hasLeft(void) const
+		{
+			return (left_ != 0);
+		}
+		
+		//! Method to check if a this has a right child
+		bool hasRight(void) const
+		{
+			return (right_ != 0);
+		}
+
+		//! Method to check if this has no children
+		bool isLeaf(void) const
+		{
+			return !(hasLeft() || hasRight());
+		}
+
+		//! Method to count the number of nodes below this
+		unsigned int descendants(void) const
+		{
+			unsigned int totalLeft  = 0u;
+			unsigned int totalRight = 0u;
+
+			if(hasLeft())
+				totalLeft = 1u + getLeft()->descendants();
+
+			if(hasRight())
+				totalRight = 1u + getRight()->descendants();
+
+			return (totalLeft + totalRight);
+		}		
+
+	private:
+
+		//! No copy allowed
+		TeAdaptativeKdTreeNode(const TeAdaptativeKdTreeNode& other);
+
+		//! No copy allowed
+		TeAdaptativeKdTreeNode& operator=(const TeAdaptativeKdTreeNode& other);
+
+};	// end of class TeAdaptativeKdTreeNode
+
+//! A class that represents a two dimensional K-d Tree (2-d Tree) that store data-elements into the leafs
+/*!	
+	WARNING:
+
+	1. This type of tree stores the data only in the leaf nodes.
+	
+	2. The process of construction expect that the tree is almost balanced
+    	
+	3. This type of tree may be of special interest of NEAREST NEIGHBOR SEARCH QUERIES.
+
+	4. After a box search it will be necessary to do a refinement.
+ */
+template<class KdTreeNode>
+class TeAdaptativeKdTree : public TeBasicKdTree<KdTreeNode>
+{
+	using TeBasicKdTree<KdTreeNode>::root_;
+	using TeBasicKdTree<KdTreeNode>::size_;
+	using TeBasicKdTree<KdTreeNode>::mbr_;
+        
+protected:				
+		//! Bucket size (maximum number of elements in each node)
+		unsigned int bucketSize_;
+		
+public:
+		//! Export key type.
+		typedef typename KdTreeNode::kdKey kdKey;		
+
+		//! Export data type.
+		typedef typename KdTreeNode::kdData kdData;		
+
+		//! Export data item type.
+		typedef typename KdTreeNode::kdDataItem kdDataItem;	
+
+		//! Export node type.
+		typedef KdTreeNode kdNode;		
+
+		//! Constructor
+		TeAdaptativeKdTree(const TeBox& box, const unsigned int& bucketSize = 12)
+			: TeBasicKdTree<KdTreeNode>(box), bucketSize_(bucketSize)
+		{
+		}
+
+		//! Sets bucket size for leaf nodes
+		void setBucketSize(const unsigned int& size)
+		{
+			bucketSize_ = size;
+		}
+
+		//! Sets bucket size for leaf nodes
+		const unsigned int& getBucketSize(void) const
+		{
+			return bucketSize_;
+		}
+
+		//! Inserts the data set into the tree
+		void build(vector<pair<kdKey, kdDataItem> >& dataSet)
+		{
+			root_ = build(dataSet, 0.0, mbr_);
+		}
+
+		//! Search the nearest data in nodes: you must pass an array of kdDataItem of size "k" with coordinates values (X() and Y()) adjusted to TeMAXFLOAT (this dummy values will be replaced at processing time), and if not all neighbors are found so sqrDists will contains TeMAXFLOAT in array index
+		void nearestNeighborSearch(const kdKey& key, vector<kdDataItem>& report, vector<double>& sqrDists, const unsigned int& k) const
+		{
+			if(root_)
+			{
+				sqrDists.clear();
+
+				for(unsigned int i = 0; i < k; ++i)
+					sqrDists.push_back(TeMAXFLOAT);
+				
+				TeBox rect(-TeMAXFLOAT, -TeMAXFLOAT, +TeMAXFLOAT, +TeMAXFLOAT);
+
+				nearestNeighborSearch(root_, key, report, sqrDists, rect);
+			}
+		}		
+
+		//! Range search query.
+		void search(const TeBox& rect, vector<KdTreeNode*>& report) const
+		{
+			if(root_)
+				search(rect, root_, report);
+
+			return;
+		}		
+
+		//! Range search query: the refinement is already done
+		inline void search(const TeBox& rect, vector<kdDataItem>& report) const;
+
+protected:			
+		//! Build the tree recursivily 
+		inline KdTreeNode* build(vector<pair<kdKey, kdDataItem> >& dataSet, double averageValue, const TeBox& mbr);
+
+		//! Recursive range query.
+		inline void search(const TeBox& rect, KdTreeNode* node, vector<KdTreeNode*>& report) const;
+
+		//! Recursive nearest neighbor search
+		inline void nearestNeighborSearch(KdTreeNode* node, const kdKey& key, vector<kdDataItem>& report, vector<double>& sqrDists, TeBox& rect) const;
+
+		//! Update neighbor list
+		inline void update(KdTreeNode* node, const kdKey& key, vector<kdDataItem>& report, vector<double>& sqrDists, TeBox& rect) const;
+
+		//! Returns the average value along the axis
+		double average(vector<pair<kdKey, kdDataItem> >& dataSet, const char& discriminator) const
+		{
+			const unsigned int size = dataSet.size();
+
+			double medianValue = 0.0;
+
+			if(discriminator == 'x')
+			{
+				for(unsigned int i = 0; i < size; ++i)
+					medianValue += dataSet[i].first.x();
+
+				return medianValue / size;
+			}
+			else
+			{
+				for(unsigned int i = 0; i < size; ++i)
+					medianValue += dataSet[i].first.y();
+
+				return medianValue / size;
+			}
+		}			
+		
+private:
+		//! No copy allowed
+		TeAdaptativeKdTree(const TeAdaptativeKdTree& other);
+
+		//! No copy allowed
+		TeAdaptativeKdTree& operator=(const TeAdaptativeKdTree& other);
+
+};	// end class TeAdaptativeKdTree
+
+template<class KdTreeNode>
+KdTreeNode* TeAdaptativeKdTree<KdTreeNode>::build(vector<pair<kdKey, kdDataItem> >& dataSet, double averageValue, const TeBox& mbr)
+{
+	++size_;
+
+	if(dataSet.size() <= bucketSize_)
+	{
+		KdTreeNode* node = new KdTreeNode(averageValue);
+
+		node->setDiscriminator('l');
+		//node->setBox(mbr);
+
+		unsigned int size = dataSet.size();
+
+		for(unsigned int i = 0; i < size; ++i)
+			node->getData().push_back(dataSet[i].second);
+
+		return node;
+	}
+
+	TeBox newMbr1(mbr);
+	TeBox newMbr2(mbr);	
+
+	char discriminator = 'x';
+
+	vector<pair<kdKey, kdDataItem> > leftDataSet;
+	vector<pair<kdKey, kdDataItem> > rightDataSet;
+
+// Finds the largest dimension
+	if((mbr.x2_ - mbr.x1_) > (mbr.y2_ - mbr.y1_))
+	{
+// Finds the median along "x" axis
+		averageValue = average(dataSet, 'x');
+
+// Adjust box for left and right branchs
+		newMbr1.x2_ = averageValue;
+		newMbr2.x1_ = averageValue;
+
+		unsigned int size = dataSet.size();
+
+		for(unsigned int i = 0; i < size; ++ i)
+		{
+			if(dataSet[i].first.x() <= averageValue)
+				leftDataSet.push_back(dataSet[i]);
+			else
+				rightDataSet.push_back(dataSet[i]);
+		}
+	}
+	else
+	{
+		discriminator = 'y';
+
+// Finds the median along "y" axis		
+		averageValue = average(dataSet, 'y');
+
+// Adjust box for left and right branchs
+		newMbr1.y2_ = averageValue;
+		newMbr2.y1_ = averageValue;
+
+		unsigned int size = dataSet.size();
+
+		for(unsigned int i = 0; i < size; ++ i)
+		{
+			if(dataSet[i].first.y() <= averageValue)
+				leftDataSet.push_back(dataSet[i]);
+			else
+				rightDataSet.push_back(dataSet[i]);
+		}
+	}
+
+	dataSet.clear();
+
+	KdTreeNode* node = new KdTreeNode(averageValue);
+	
+	//node->setBox(mbr);
+	
+	if(rightDataSet.size() == 0u)		// If all coordinates have the same coordinate values, the right vector will be empty so we need stop division to
+	{
+		node->setDiscriminator('l');
+		//node->setBox(newMbr1);
+
+		unsigned int size = leftDataSet.size();
+
+		for(unsigned int i = 0; i < size; ++i)
+			node->getData().push_back(leftDataSet[i].second);
+
+		//throw;
+	}
+	else if(leftDataSet.size() == 0u)		// If all coordinates have the same coordinate values, the left vector is empty, so we need to stop
+	{
+		node->setDiscriminator('l');
+		//node->setBox(newMbr2);
+
+		unsigned int size = rightDataSet.size();
+
+		for(unsigned int i = 0; i < size; ++i)
+			node->getData().push_back(rightDataSet[i].second);
+
+		//throw;
+	}
+	else
+	{
+		node->setDiscriminator(discriminator);
+		node->setLeft(build(leftDataSet, averageValue, newMbr1));
+		node->setRight(build(rightDataSet, averageValue, newMbr2));
+	}
+	
+	return node;
+}
+
+template<class KdTreeNode>
+void TeAdaptativeKdTree<KdTreeNode>::search(const TeBox& rect, vector<kdDataItem>& report) const
+{
+	vector<KdTreeNode*> reportNodes;
+
+	search(rect, reportNodes);
+
+    unsigned int nNodes = reportNodes.size();
+
+	for(unsigned int i = 0; i < nNodes; ++i)
+	{
+		unsigned int nElements = reportNodes[i]->getData().size();
+
+		for(unsigned int j = 0; j < nElements; ++j)
+		{
+            if(TeIntersects((reportNodes[i])->getData()[j], rect))
+			{
+				report.push_back((reportNodes[i])->getData()[j]);
+			}
+		}
+	}
+}
+
+template<class KdTreeNode>
+void TeAdaptativeKdTree<KdTreeNode>::search(const TeBox& rect, KdTreeNode* node, vector<KdTreeNode*>& report) const
+{
+	if(node->getDiscriminator() == 'x')
+	{
+		if(node->hasLeft())
+			if(rect.x1_ <= node->getKey())
+				search(rect, node->getLeft(), report);		
+
+		if(node->hasRight())
+			if(rect.x2_ >= node->getKey())
+				search(rect, node->getRight(), report);
+	}
+	else if(node->getDiscriminator() == 'y')
+	{
+		if(node->hasLeft())
+			if(rect.y1_ <= node->getKey())
+				search(rect, node->getLeft(), report);		
+
+		if(node->hasRight())
+			if(rect.y2_ >= node->getKey())
+				search(rect, node->getRight(), report);
+	}
+	else
+	{		
+		report.push_back(node);
+	}
+
+	return;
+}
+
+template<class KdTreeNode>
+void TeAdaptativeKdTree<KdTreeNode>::nearestNeighborSearch(KdTreeNode* node, const kdKey& key, vector<kdDataItem>& report, vector<double>& sqrDists, TeBox& rect) const
+{
+	if(node->getDiscriminator() == 'l')
+	{
+		update(node, key, report, sqrDists, rect);	// this is a leaf node -> update list of neighbours 
+	}
+	else if(node->getDiscriminator() == 'x')
+	{
+		if(key.x() <= node->getKey())
+		{
+			nearestNeighborSearch(node->getLeft(), key, report, sqrDists, rect);
+
+			if((rect.x1_ < node->getKey()) && (node->getKey() < rect.x2_))
+				nearestNeighborSearch(node->getRight(), key, report, sqrDists, rect);
+		}
+		else
+		{
+			nearestNeighborSearch(node->getRight(), key, report, sqrDists, rect);
+
+			if((rect.x1_ < node->getKey()) &&(node->getKey() < rect.x2_))
+				nearestNeighborSearch(node->getLeft(), key, report, sqrDists, rect);
+		}		
+	}
+	else if(node->getDiscriminator() == 'y')
+	{
+		 if(key.y() <= node->getKey())
+		{
+			nearestNeighborSearch(node->getLeft(), key, report, sqrDists, rect);
+
+			if((rect.y1_ < node->getKey()) &&(node->getKey() < rect.y2_ ))
+				nearestNeighborSearch(node->getRight(), key, report, sqrDists, rect);
+		}
+		else
+		{
+			nearestNeighborSearch(node->getRight(), key, report, sqrDists, rect);
+
+			if((rect.y1_ < node->getKey()) &&(node->getKey() < rect.y2_))
+				nearestNeighborSearch(node->getLeft(), key, report, sqrDists, rect);
+		}
+	}	
+	
+}
+
+template<class KdTreeNode>
+void TeAdaptativeKdTree<KdTreeNode>::update(KdTreeNode* node, const kdKey& key, vector<kdDataItem>& report, vector<double>& sqrDists, TeBox& rect) const
+{
+// rect is the bounding box of neighbors
+
+	const unsigned int size = node->getData().size();
+
+	const unsigned int nNeighbors = report.size();
+
+// for each element in the node, we need to search for distances less than of some one of sqrDists
+	for(unsigned int i = 0u; i < size; ++i)
+	{
+		double dx = (key.x() - node->getData()[i].location().x());
+		double dy = (key.y() - node->getData()[i].location().y());
+		
+		double dkp = (dx * dx) + (dy * dy);	// square distance from the key point to the node
+
+// if the distance of "i-th" element is less than the maximum distance in the sqrDists
+		if(dkp < sqrDists[nNeighbors - 1])
+		{
+// so the element must be reported
+
+// and the srqDists vector must be rearranged
+			for(unsigned int j = 0u; j < nNeighbors; ++j)
+			{
+				if(dkp < sqrDists[j])	// if the position is found
+				{  
+// move the elements to the right
+					for(unsigned int k = nNeighbors - 1; k > j; --k)
+					{
+						report[k]   = report[k - 1];
+						sqrDists[k] = sqrDists[k - 1];
+					} 
+
+// inserts the element in the report and update its distance
+					report[j] = node->getData()[i];
+
+					sqrDists[j] = dkp;
+
+					break;
+				}
+			}
+		}
+	}
+
+	double maxDist = sqrDists[nNeighbors - 1];
+
+	if(maxDist != TeMAXFLOAT)
+	{
+		maxDist = sqrt(maxDist);
+	}
+
+	rect.x1_ = key.x() - maxDist;
+	rect.y1_ = key.y() - maxDist;
+	rect.x2_ = key.x() + maxDist;
+	rect.y2_ = key.y() + maxDist;
+}
+/** @} */ 
+
+};	// end namespace TeSAM
+
+
+#endif	// __TERRALIB_INTERNAL_KDTREE_H
+
+
+
+
diff --git a/src/terralib/kernel/TeLayer.cpp b/src/terralib/kernel/TeLayer.cpp
old mode 100755
new mode 100644
index 4577c11..ba65fc4
--- a/src/terralib/kernel/TeLayer.cpp
+++ b/src/terralib/kernel/TeLayer.cpp
@@ -1,1637 +1,1639 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeLayer.h"
-#include "TeUtils.h"
-#include "TeException.h"
-#include "TeDatabase.h"
-#include "TeRaster.h"
-#include "TeProjection.h"
-
-
-TeLayer::TeLayer(const string& name, TeDatabase* db, TeProjection* proj): 
-	name_(name),
-	id_(-1),
-	db_(db),
-	projection_ ( proj ),
-	raster_(0)
-{	
-	editionTime_.now();
-	
-	if (!db_ || name.empty())
-		return;
-
-	// verifies if layer already exists in the database
-	string sql = "SELECT * FROM te_layer WHERE name = '" + name + "'";
-	TeDatabasePortal* portal = db_->getPortal();
-	if (!portal)
-		return;
-	if (!portal->query(sql))
-	{
-		delete portal;
-		return;
-	}
-	if (!portal->fetchRow()) 
-	{
-		if (!proj)	// provides a default projection No Projection
-			projection_ = new TeNoProjection();
-		else
-			projection_ = TeProjectionFactory::make (proj->params());
-		db_->insertLayer(this);
-	}
-	else
-		db_->loadLayer(this);
-	int pid = projection_->id();
-	delete projection_;
-	projection_ = db_->loadProjection(pid);
-	delete portal;
-}
-
-
-TeLayer::TeLayer(const string& name, TeDatabase* db, TeBox& box, TeProjection* proj):
-	name_(name),
-	id_(-1),
-	db_(db),
-	projection_(proj),
-	box_(box),
-	raster_(0)
-{
-	editionTime_.now();
-
-	if (!db_ || name.empty())
-		return;
-
-	// verifies if layer already exists in the database
-	string sql = "SELECT * FROM te_layer WHERE name = '" + name + "'";
-	TeDatabasePortal* portal = db_->getPortal();
-	if (!portal)
-		return;
-	if (!portal->query(sql))
-	{
-		delete portal;
-		return;
-	}
-	if (!portal->fetchRow()) 
-	{
-		if (!proj)	// provides a default projection No Projection
-			projection_ = new TeNoProjection();
-		else
-			projection_ = TeProjectionFactory::make (proj->params());
-		db_->insertLayer(this);
-	}
-	else
-		db_->loadLayer(this);
-	delete portal;
-}
-
-TeLayer::~TeLayer()
-{
-	if ( projection_ != 0 )
-	{
-		delete projection_; 
-		projection_ = 0;
-	}
-	for (TeRepresPointerVectorIterator it = repVector_.begin(); it != repVector_.end(); it++)
-	{
-		if (*it)
-		{
-			delete (*it);
-			(*it) = 0;
-		}
-	}
-	repVector_.clear();
-	if (raster_!=0)
-	{
-		delete raster_;
-		raster_ = 0;
-	}
-}
-
-TeLayer::TeLayer( const TeLayer& other ) :
-projection_(NULL),
-raster_(NULL)
-{
-	if (other.projection_ != NULL)
-	{
-		projection_ = TeProjectionFactory::make ( other.projection_->params());
-	}
-
-	name_		= other.name_;
-	id_			= other.id_;
-	db_			= other.db_;
-
-    box_ = TeBox(other.box_);
-	editionTime_ = other.editionTime_;
-
-    if(other.raster_ != NULL)
-    {
-        TeRaster* oRast = other.raster_;
-        TeRasterParams oRastParams(oRast->params());
-
-        raster_ = new TeRaster(oRastParams);
-    }
-
-    attTables_ = other.attTables_;
-    TeRepresPointerVector oRepVec = other.repVector_;
-    TeRepresPointerVector::iterator it;
-
-    for(it = oRepVec.begin(); it != oRepVec.end(); ++it)
-    {
-        TeRepresentation* rep = new TeRepresentation();
-            
-        rep->id_ = (*it)->id_;
-        rep->geomRep_ = (*it)->geomRep_;
-        rep->tableName_ = (*it)->tableName_;
-        rep->description_ = (*it)->description_;
-        rep->box_ = (*it)->box_;
-        rep->resX_ = (*it)->resX_;
-        rep->resY_ = (*it)->resY_;
-        rep->nCols_ = (*it)->nCols_;
-        rep->nLins_ = (*it)->nLins_;
-
-        repVector_.push_back(rep);
-    }
-}
-
-TeLayer& 
-TeLayer::operator= ( const TeLayer& other )
-{
-	if ( this != &other )
-	{	
-		if (projection_)
-			delete projection_;
-		projection_ = 0;
-		if (other.projection_)
-			projection_ = TeProjectionFactory::make ( other.projection_->params());
-		name_		= other.name_;
-		id_			= other.id_;
-		box_		= other.box_;
-		db_ = other.db_;
-		editionTime_ = other.editionTime_;
-	}
-	return *this;
-}
-	
-
-void 
-TeLayer::setLayerBox(const TeBox& box)
-{   
-	box_ = box;
-	if ((id_ > -1) && db_)
-		db_->updateLayerBox(this);
-}
-
-void
-TeLayer::updateLayerBox(const TeBox& box)
-{
-	updateBox(box_,box);
-	if ((id_ > -1) && db_)
-		db_->updateLayerBox(this);
-}
-
-void
-TeLayer::updateLayerBox()
-{
-	if (id_ < 0 || !db_)
-		return;
-
-	string sql = "SELECT lower_x, lower_y, upper_x, upper_y FROM te_representation WHERE layer_id = " + Te2String(id_);
-	TeDatabasePortal* portal = db_->getPortal();
-	if (!portal)
-		return;
-	if (!portal->query(sql))
-	{
-		delete portal;
-		return;
-	}
-
-	TeBox box;
-	while (portal->fetchRow())
-	{
-		TeBox brep(portal->getDouble(0),portal->getDouble(1),portal->getDouble(2),portal->getDouble(3));
-		updateBox(box,brep);
-	}
-	delete portal;
-	box_ = box;
-	db_->updateLayerBox(this);
-	return;
-}
-
-int 
-TeLayer::getNewObjectId()
-{
-	if(!db_)
-		return -1;
-
-	TeDatabasePortal* portal = db_->getPortal();
-	if(!portal)
-		return -1;
-
-	try
-	{
-		int objId = 0;
-		string sql;
-		for (TeRepresPointerVectorIterator it = vectRepres().begin(); it != vectRepres().end(); it++)
-		{
-           TeRepresentation* rep = (*it);
-
-           sql = "SELECT MAX(geom_id) FROM ";
-           sql += rep->tableName_;
-           if (portal->query(sql) && portal->fetchRow())
-           {
-				string data = portal->getData(0);
-				int value = 0;
-				if(!data.empty())
-				   value = atoi(data.c_str());
-				objId += value;
-           }
-           portal->freeResult();
-       }
-       delete portal;
-       return ++objId;
-   }
-   catch(...)
-   {
-       if (portal)
-       {
-           delete portal;
-           return -1;
-       }
-   }
-    return -1;
-} 
-
-void  
-TeLayer::setProjection ( TeProjection* proj )
-{	
-	if (!proj)
-		return;
-
-	// if no database set just update pointer
-	if (!db_)
-	{
-		if ( projection_)
-			delete projection_;
-		projection_ = proj;
-		return;
-	}
-
-	if (projection_)
-	{
-		proj->id(projection_->id());
-		delete projection_;
-	}
-	projection_ = proj; 
-	bool status = true;
-	
-	if ( projection_->id() <= 0  )	// new projection not in the database
-	{
-		status = db_->insertProjection(projection_);
-		// update layer information
-		if (status && id_ > 0)
-		{
-			string sql = "UPDATE te_layer SET projection_id = " + Te2String(projection_->id());
-				sql += " WHERE layer_id=" + Te2String(id_);
-			db_->execute(sql);
-		}
-	}
-	else
-		status = db_->updateProjection(projection_);
-
-	if (raster_)
-	{
-		delete raster_;
-		raster_ = 0;
-	}
-}
-
-void 
-TeLayer::raster( TeRaster* raster)
-{	
-	if (raster_ )
-	{
-		delete raster_;
-		raster_ = 0;
-	}
-	raster_ = raster; 
-}
-
-bool
-TeLayer::hasGeometry (TeGeomRep rep)
-{ 
-	if (repVector_.empty())
-		return false;
-	TeRepresPointerVectorIterator it;
-	it = TeFindRepresentation(repVector_.begin(), repVector_.end(),rep);
-	return (it != repVector_.end());
-} 
-
-int
-TeLayer::geomRep()
-{
-	if (repVector_.empty())
-		return TeGEOMETRYNONE;
-	int r = 0;
-	TeRepresPointerVectorIterator it;
-	for (it=repVector_.begin(); it != repVector_.end(); ++it)
-		r = (int)(*it)->geomRep_ | r;
-	return r;
-}
-
-TeTime TeLayer::getEditionTime() const
-{
-	return editionTime_;
-}
-
-void TeLayer::setEditionTime(const TeTime& editionTime)
-{
-	editionTime_ = editionTime;
-}
-
-bool TeLayer::updateLayerEditionTime(const bool& setEditionToNow)
-{
-	if(setEditionToNow)
-	{
-		editionTime_.now();
-	}
-	if(!editionTime_.isValid())
-	{
-		return false;
-	}
-	if(!db_->updateLayer(this))
-	{
-		return false;
-	}
-	return true;
-}
-
-bool TeLayer::reloadLayerEditionTime()
-{
-	if(db_ == NULL)
-	{
-		return false;
-	}
-
-	std::string sql = "SELECT edition_time FROM te_layer WHERE layer_id = " + Te2String(id());
-	TeDatabasePortal* portal = db_->getPortal();
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-
-	editionTime_ = portal->getDate(0);
-
-	delete portal;
-
-	return true;
-}
-
-string
-TeLayer::tableName(TeGeomRep rep) 
-{
-	TeRepresPointerVectorIterator it;
-	it = TeFindRepresentation(repVector_.begin(), repVector_.end(),rep);
-	if (it != repVector_.end())
-		return (*it)->tableName_;
-	else
-		return string("");
-}
-
-int 
-TeLayer::nGeometries(TeGeomRep rep)
-{
-	TeRepresPointerVectorIterator it;
-	it = TeFindRepresentation(repVector_.begin(), repVector_.end(),rep);
-	int ngeo = 0;
-	if (it != repVector_.end())
-	{
-		string sql = "SELECT COUNT(geom_id) FROM " + (*it)->tableName_;
-		TeDatabasePortal* portal = db_->getPortal();
-		if (portal && portal->query(sql) && portal->fetchRow())
-			ngeo = portal->getInt(0);
-		delete portal;
-	}
-	return ngeo;
-}
-
-
-bool
-TeLayer::getRepresentation(TeGeomRep repType, TeRepresPointerVector& result)
-{
-	TeRepresPointerVectorIterator it;
-	it = repVector_.begin();
-	while (it != repVector_.end())
-	{
-		if ((*it)->geomRep_ == repType)
-			result.push_back((*it));
-		++it;
-	}
-	if (result.empty())
-		return false;
-	return true;
-}
-
-TeRepresentation*
-TeLayer::getRepresentation(TeGeomRep repType, const string& tName)
-{
-
-	TeRepresPointerVectorIterator it;
-	it = repVector_.begin();
-	while (it != repVector_.end())
-	{
-		if ((*it)->geomRep_ == repType)
-		{
-			if (tName.empty() || (*it)->tableName_== tName)
-				return (*it);
-		}
-		it++;
-	}
-	return 0;
-}
-
-bool 
-TeLayer::removeGeometry (TeGeomRep repType, const string& tName)
-{
-	if (!db_)
-		return false;
-
-	if (repType == TeTEXT && tName.empty())	// layer can have more than one TEXT table
-		return false;
-
-	TeRepresPointerVectorIterator it;
-	it = TeFindRepresentation(repVector_.begin(), repVector_.end(),repType);
-	while (it != repVector_.end())
-	{
-		if (tName.empty() || (*it)->tableName_== tName)
-		{
-			string del;
-			TeRepresentation* rep = (*it);
-			if (rep->id_ > 0)
-			{
-				del = "DELETE FROM te_representation WHERE repres_id=" + Te2String(rep->id_);
-				if (!db_->execute(del))
-					return false;
-			}
-
-			if (!rep->tableName_.empty())
-			{
-				if(rep->geomRep_ == TeRASTER || rep->geomRep_ == TeRASTERFILE)
-				{
-					TeDatabasePortal* portal = db_->getPortal();
-					string sql, tname;
-
-					sql = "SELECT lut_table, raster_table FROM " + rep->tableName_;
-					portal->query(sql);
-
-					while(portal->fetchRow())
-					{
-						// delete lut table
-						tname = portal->getData(0);
-						if(!tname.empty())
-							db_->deleteTable(tname);
-						// delete raster table
-						tname = portal->getData(1);
-						if(rep->geomRep_ != TeRASTERFILE && !tname.empty())
-							db_->deleteTable(tname);
-					}
-					portal->freeResult();
-					delete portal;
-
-					// delete metadata table
-					sql = "DROP TABLE " + rep->tableName_ + "_metadata";
-					db_->execute(sql);
-					if (raster_)
-					{
-						delete raster_;
-						raster_ = 0;
-					}
-				}
-				if (!db_->deleteTable(rep->tableName_))					
-					return false;
-			}
-			repVector_.erase(it);
-			delete rep;
-			break;
-		}
-		it++;
-		it = TeFindRepresentation(it,repVector_.end(),repType);
-	}
-	updateLayerBox();
-	return true;
-}
-
-bool TeLayer::addGeometry(TeGeomRep repType, const string& tName, const string& desc)
-{  
-	// check if representation is already in layer
-	if (repType == TeTEXT)
-	{
-		string tt;
-		if (!tName.empty())
-			tt = tName;
-		else
-			tt =  name_ + "Texts";
-		
-		if (getRepresentation(repType,tt))
-			return true;
-	}
-	else if (getRepresentation(repType))
-		return true;
-
-	if (!db_)			// layer has no database associated
-		return false;
-
-	if (id_ < 0)		// layer has not saved in the database
-	{
-		if (!db_->insertLayer (this))
-			return false;
-	}
-
-	TeRepresentation* represe = new TeRepresentation();
-	represe->geomRep_ = repType;
-	if (!tName.empty())
-		represe->tableName_ = tName;
-	if (!desc.empty())
-		represe->description_ = desc;
-
-	if (repType == TePOLYGONS)
-	{
-		if (tName.empty())
-			represe->tableName_ = "Polygons" + Te2String(id_);
-		if (!db_->createPolygonGeometry (represe->tableName_))
-			return false;
-	}
-	else if (repType == TeLINES)
-	{
-		if (tName.empty())
-			represe->tableName_ = "Lines" + Te2String(id_);
-		if (!db_->createLineGeometry (represe->tableName_))
-			return false;
-	}
-	else if (repType == TePOINTS)
-	{
-		if (tName.empty())
-			represe->tableName_ = "Points" + Te2String(id_);
-		if (!db_->createPointGeometry (represe->tableName_))
-			return false;
-	}
-	else if (repType == TeTEXT)
-	{
-		if (tName.empty())
-			represe->tableName_ = "Texts" + Te2String(id_);
-		if (!db_->createTextGeometry (represe->tableName_))
-			return false;
-	}
-	else if (repType == TeARCS)
-	{
-		if (tName.empty())
-			represe->tableName_ = "Arcs"+ Te2String(id_);
- 		if (!db_->createArcGeometry (represe->tableName_))
-			return false;
-	}
-	else if (repType == TeNODES)
-	{
-		if (tName.empty())
-			represe->tableName_ = "Nodes"+ Te2String(id_);
- 		if (!db_->createNodeGeometry (represe->tableName_))
-			return false;
-	}
-	else if (repType == TeCELLS)
-	{
-		if (tName.empty())
-			represe->tableName_ = "Cells"+ Te2String(id_);
- 		if (!db_->createCellGeometry (represe->tableName_))
-			return false;
-	}
-	else
-	{
-		return false;
-	}
-
-	bool res =  db_->insertRepresentation(id_,*represe);
-
-	if (res) 
-		repVector_.push_back(represe);
-	else
-		return false;
-	return true;
-}
-
-bool 
-TeLayer::addRasterGeometry(TeRasterParams& par, const string& objectId, 
-						   const string& tName, const string& desc)
-{
-	string tableName = tName;
-	TeRepresentation* rep = getRepresentation(TeRASTER,tableName);
-	if (!rep)
-	{
-		rep = new TeRepresentation();
-		updateBox(rep->box_,par.boundingBox());
-
-		if (!tableName.empty())
-			rep->tableName_ = tableName;
-		else
-			rep->tableName_ = "RasterLayer" + Te2String(id_);
-
-		if (!desc.empty())
-			rep->description_ = desc;
-
-		rep->geomRep_ = TeRASTER;
-		if (!db_->insertRepresentation(id_,*rep))
-			return false;
-
-		tableName = rep->tableName_;
-		if (!db_->createRasterGeometry(tableName))
-			return false;
-
-		string metadataTableName = tableName+"_metadata";
-		if (!db_->createRasterMetadataTable(metadataTableName))
-			return false;
-
-		repVector_.push_back(rep);
-	}
-	else
-		tableName = rep->tableName_;
-
-	string oid = objectId;
-	if (oid.empty())
-		oid = "O1";
-
-	if (par.fileName_.empty())
-	{
-		string aux = "RasterLayer" + Te2String(id_) + "_R_" + objectId;
-		bool flag = db_->tableExist(aux);
-		short i=1;
-		while (flag)
-		{
-			aux = "RasterLayer" + Te2String(id_) + "_R_" + objectId + "_" + Te2String(i);
-			++i;
-		}
-		par.fileName_ = aux;
-	}
-
-//updates the date in the te_representation table
-	if(par.date_.isValid())
-	{	
-		std::string sqlTime = db_->getSQLTime(par.date_);
-		if(!sqlTime.empty())
-		{
-			std::string sql = "UPDATE te_representation SET initial_time = " + sqlTime;
-			sql += ", final_time = " + sqlTime;
-			sql += " WHERE repres_id=" + Te2String(rep->id_);
-			if(!db_->execute(sql))
-			{
-				return false;
-			}
-		}
-	}
-
-	if (!db_->createRasterTable(par.fileName_))
-		return false;
-
-	if (!db_->insertRasterGeometry(tableName,par,objectId))
-		return false;
-
-	updateLayerBox(par.boundingBox());
-	par.layerId_ = id_;
-	par.objectId_ = oid;
-
-	return true;
-}
-
-bool
-TeLayer::addRasterFileGeometry(TeRaster* raster, const string& /* objectId */, const string& desc)
-{
-	if (!raster)
-		return false;
-	TeRepresentation* rep = getRepresentation(TeRASTERFILE);
-	if (!rep)
-	{
-		rep = new TeRepresentation();
-		updateBox(rep->box_,raster->params().boundingBox());
-		rep->tableName_ = "RasterLayer" + Te2String(id_);
-		rep->geomRep_ = TeRASTERFILE;
-		rep->resX_ = raster->params().resx_;
-		rep->resY_ = raster->params().resy_;
-		rep->nCols_= raster->params().ncols_;
-		rep->nLins_= raster->params().nlines_;
-		if (!desc.empty())
-			rep->description_ = desc;
-		if (!db_->insertRepresentation(id_,*rep))
-			return false;
-		if (!db_->createRasterGeometry(rep->tableName_))
-			return false;
-		if (!db_->createRasterMetadataTable(rep->tableName_+"_metadata"))
-			return false;
-		repVector_.push_back(rep);
-	}
-
-//updates the date in the te_representation table
-	if(raster->params().date_.isValid())
-	{	
-		std::string sqlTime = db_->getSQLTime(raster->params().date_);
-		if(!sqlTime.empty())
-		{
-			std::string sql = "UPDATE te_representation SET initial_time = " + sqlTime;
-			sql += ", final_time = " + sqlTime;
-			sql += " WHERE repres_id=" + Te2String(rep->id_);
-			if(!db_->execute(sql))
-			{
-				return false;
-			}
-		}
-	}
-
-	string oid = TeGetBaseName(raster->params().fileName_.c_str());
-	if (oid.empty())
-		oid = "O1";
-	string sql = "delete from " +  rep->tableName_ + " where object_id = '" + oid + "'";
-	db_->execute(sql);
-	if (!db_->insertRasterGeometry(rep->tableName_,raster->params(),oid))
-		return false;
-	updateLayerBox(raster->params().boundingBox());
-	raster->params().layerId_ = id_;
-	raster->params().objectId_ = oid;
-	return true;
-}
-
-bool 
-TeLayer::addRasterGeometry(TeRaster* raster, const string& objectId)
-{
-	if (!raster)
-		return false;
-	TeRepresentation* rep = getRepresentation(TeRASTER);
-	if (!rep)
-	{
-		rep = new TeRepresentation();
-		updateBox(rep->box_,raster->params().boundingBox());
-		rep->tableName_ = "RasterLayer" + Te2String(id_);
-		rep->geomRep_ = TeRASTER;
-		if (!db_->insertRepresentation(id_,*rep))
-			return false;
-		if (!db_->createRasterGeometry(rep->tableName_))
-			return false;
-		if (!db_->createRasterMetadataTable(rep->tableName_+"_metadata"))
-			return false;
-		repVector_.push_back(rep);
-	}
-
-	string oid = objectId;
-	if (oid.empty())
-		oid = "O1";
-	string sql = "delete from " +  rep->tableName_ + " where object_id = '" + oid + "'";
-	db_->execute(sql);
-	if (!db_->insertRasterGeometry(rep->tableName_,raster->params(),oid))
-		return false;
-	updateLayerBox(raster->params().boundingBox());
-	raster->params().layerId_ = id_;
-	raster->params().objectId_ = oid;
-	return true;
-}
-
-TeRaster*
-TeLayer::raster(const string& objectId, const char& mode)
-{	
-   if (id_ <= 0 ||
-	  !(hasGeometry(TeRASTER) || hasGeometry(TeRASTERFILE)))
-       return 0; 
-
-	if (raster_  && !objectId.empty() && 
-	   (objectId != raster_->objectId() || 
-		mode != raster_->params().mode_ ))
-	{
-		delete raster_;
-		raster_ = 0; 
-	}
-
-	if (!raster_)
-		raster_ = db_->loadLayerRaster(id_,objectId, mode);
-	return raster_;
-}
-
-bool
-TeLayer::getRasterGeometries(vector<string>& objectIds, unsigned int tilingType, const TeBox& box)
-{
-	objectIds.clear();
-	if (!hasGeometry(TeRASTER) || id_ <= 0 )
-		return false;
-
-	TeDatabasePortal* portal = db_->getPortal();
-	if (!portal)
-		return false;
-
-	string get = "SELECT geom_table FROM te_representation WHERE layer_id = " + Te2String(id_);
-	get += " AND geom_type = 512";
-	
-	// error executing query or no there is no raster representation 
-	if (!portal->query(get) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	string tableName = portal->getData(0);
-	if (tableName.empty())
-	{
-		delete portal;
-		return false;
-	}
-	portal->freeResult();
-	
-	std::string whereClause = "";
-	if (tilingType == 1 || tilingType == 2)
-	{
-		if(!whereClause.empty())
-		{
-			whereClause += " AND ";
-		}
-		whereClause += "tiling_type=" + Te2String(tilingType);
-	}
-	if(box.isValid())
-	{
-		if(!whereClause.empty())
-		{
-			whereClause += " AND ";
-		}
-		whereClause = "NOT(lower_x > " + Te2String(box.x2_, 12) + " OR ";
-		whereClause += "upper_x < " + Te2String(box.x1_, 12) + " OR ";
-		whereClause += "lower_y > " + Te2String(box.y2_, 12) + " OR ";
-		whereClause += "upper_y < " + Te2String(box.y1_, 12) + ")";
-	}
-
-	get = "SELECT object_id FROM " + tableName;
-	if(!whereClause.empty())
-	{
-		get += " WHERE " + whereClause;
-	}
-
-	if (!portal->query(get))
-	{
-		delete portal;
-		return false;
-	}
-	while (portal->fetchRow())
-		objectIds.push_back(portal->getData(0));
-	delete portal;
-	return !objectIds.empty();
-}
-
-
-int 
-TeLayer::nObjects(const string& tName)
-{
-	if (attTables_.empty())
-		return 0;
-	string linkName;
-	vector<TeTable>::iterator it = attTables_.begin();
-	while (it != attTables_.end())
-	{
-		if ((*it).name() == tName)
-		{
-			linkName = (*it).linkName();
-			break;
-		}
-		it++;
-	}
-	if (linkName.empty())
-		return 0;
-	int no = 0;
-	string sql;
-	TeDatabasePortal* portal = db_->getPortal();
-	if (!portal)
-		return 0;
-	sql = "SELECT COUNT(" + linkName + ") FROM " + (*it).name();
-	if (portal->query(sql) && portal->fetchRow())
-		no = portal->getInt(0);
-	delete portal;
-	return no;
-}
-
-
-bool 
-TeLayer::createAttributeTable(TeTable& table)
-{
-	if (!db_->tableExist(table.name()))
-	{
-		db_->validTable(table);
-  		if (!db_->createTable(table.name(),table.attributeList())) 
-			return false;
-	}
-	
-	if(!db_->insertTableInfo(id_,table))
-		return false;
-	
-	vector<TeTable>::iterator it = attTables_.begin();
-	while (it != attTables_.end())
-	{
-		if ((*it).name() == table.name())
-			return true;
-		++it;
-	}
-	attTables_.push_back(table);
-	return true;
-}
-
-bool 
-TeLayer::addAttributeTable(TeTable& table)
-{
-	vector<TeTable>::iterator it = attTables_.begin();
-	while (it != attTables_.end())
-	{
-		if ((*it).name() == table.name())
-			return false;
-		it++;
-	}
-	attTables_.push_back(table);
-	return true;
-}
-
-bool 
-TeLayer::removeAttributeTable(string tableName)
-{
-	vector<TeTable>::iterator it = attTables_.begin();
-	while (it != attTables_.end())
-	{
-		if ((*it).name() == tableName)
-		{
-			attTables_.erase(it);
-			return true;
-		}
-		it++;
-	}
-	return false;
-}
-
-void 
-TeLayer::updateAttributeTable(TeTable& table)
-{
-	vector<TeTable>::iterator it = attTables_.begin();
-	while (it != attTables_.end())
-	{
-		if ((*it).name() == table.name())
-		{
-			attTables_.erase(it);
-			break;
-		}
-		it++;
-	}
-	attTables_.push_back(table);
-}
-
-bool
-TeLayer::loadLayerTables() 
-{
-	TeDatabase *db = database();
-	if(!db)
-		return false;
-
-	attTables_.clear();
-	return(db->loadLayerTable(this));
-}
-
-bool 
-TeLayer::getAttrTables(TeAttrTableVector& atts, TeAttrTableType attType)
-{
-	TeAttrTableVector::iterator it = attTables_.begin();
-	while (it != attTables_.end())
-	{
-		if ((attType == TeAllAttrTypes) || ((*it).tableType() == attType))
-			atts.push_back((*it));
-		it++;
-	}
-	return (!atts.empty());
-}
-
-bool 
-TeLayer::getAttrTablesByName(vector<string> &tableNames, TeAttrTableVector& atts, TeAttrTableType attType)
-{
-	TeAttrTableVector::iterator it;
-	vector<string>::iterator it2;
-
-	for(it2 = tableNames.begin(); it2 != tableNames.end(); ++it2)
-	{
-		for(it = attTables_.begin(); it != attTables_.end(); ++it)
-		{
-			if ((attType == TeAllAttrTypes) || ((*it).tableType() == attType))
-			{
-				string name = (*it).name();
-				string name2 = (*it2);
-				if(name == name2)
-				{
-					atts.push_back((*it));
-					break;
-				}
-			}
-		}
-	}
-	return (!atts.empty());
-}
-
-
-bool 
-TeLayer::getAttrTablesByName(const string& attrTableName, TeTable& table, TeAttrTableType attType)
-{
-	TeAttrTableVector::iterator it;
-
-	for(it = attTables_.begin(); it != attTables_.end(); ++it)
-	{
-		if ((attType == TeAllAttrTypes) || ((*it).tableType() == attType))
-		{
-			string name = (*it).name();
-			if(name == attrTableName)
-			{
-				table = (*it);
-				return true;
-			}
-		}
-	}
-	
-	return false;
-}
-
-bool 
-TeLayer::addPolygons (TePolygonSet& polySet)
-{
-	if (!db_)
-		return false;
-
-	if (polySet.size() > 0 )
-	{
-		if (!this->hasGeometry(TePOLYGONS))
-			this->addGeometry(TePOLYGONS);
-
-		TeRepresentation* rep = getRepresentation(TePOLYGONS);
-		if (rep)
-		{
-			if (!db_->insertPolygonSet (rep->tableName_, polySet))
-				return false;
-			//updateLayerBox(polySet.box());
-
-			updateBox(box_, polySet.box());
-			editionTime_.now();
-			if(!db_->updateLayer(this))
-				return false;
-			
-			updateBox(rep->box_, polySet.box());
-			if(!db_->updateRepresentation(id_,*rep))
-				return false;
-		}
-		else
-			return false;
-	}
-	return true;
-}
-
-bool 
-TeLayer::addLines (TeLineSet& lineSet)
-{
-	if (!db_)
-		return false;
-
-	if (lineSet.size() > 0)
-	{
-		if (!this->hasGeometry(TeLINES))
-			this->addGeometry(TeLINES);
-		TeRepresentation* rep = getRepresentation(TeLINES);
-		if (rep)
-		{
-			if (!db_->insertLineSet (rep->tableName_, lineSet))
-				return false;
-			//updateLayerBox(lineSet.box());
-
-			updateBox(box_, lineSet.box());
-			editionTime_.now();
-			if(!db_->updateLayer(this))
-				return false;
-
-			updateBox(rep->box_,lineSet.box());
-			if (!db_->updateRepresentation(id_,*rep))
-				return false;
-		}
-		else
-			return false;
-	}
-	return true;
-}
-
-bool 
-TeLayer::addPoints (TePointSet& pointSet)
-{
-	if (!db_)
-		return false;
-
-	if (pointSet.size() > 0)
-	{
-		if (!this->hasGeometry(TePOINTS))
-			this->addGeometry(TePOINTS);
-		string tblName = tableName(TePOINTS);
-
-		TeRepresentation* rep = getRepresentation(TePOINTS);
-		if (rep)
-		{	
-			if (!db_->insertPointSet (rep->tableName_, pointSet))
-				return false;
-			//updateLayerBox(pointSet.box());
-
-			updateBox(box_, pointSet.box());
-			editionTime_.now();
-			if(!db_->updateLayer(this))
-				return false;
-
-			updateBox(rep->box_,pointSet.box());
-			if (!db_->updateRepresentation(id_,*rep))
-				return false;
-		}
-		else
-			return false;
-	}
-	return true;
-}
-
-bool 
-TeLayer::addText (TeTextSet& textSet, const string& tName)
-{
-	if (!db_)
-		return false;
-
-	TeRepresentation* rep =0;
-	string tabName;
-	if (tName.empty())
-	{
-		int i=0;
-		string name; 
-		do
-		{
-			name = "Text_" + Te2String(id_) + "_" + Te2String(i); 
-			rep = getRepresentation(TeTEXT,name); 
-			++i;
-		}
-		while (rep); 
-		tabName = name;
-	}
-	else
-		tabName = tName;
-
-	if (textSet.size() > 0 )
-	{
-		rep = getRepresentation(TeTEXT,tabName);
-		if (!rep)
-		{
-			this->addGeometry(TeTEXT,tabName);
-			rep = getRepresentation(TeTEXT,tabName);
-		}
-		if (rep)
-		{	
-			if (!db_->insertTextSet (tabName, textSet))
-				return false;
-			//updateLayerBox(textSet.box());
-
-			updateBox(box_, textSet.box());
-			editionTime_.now();
-			if(!db_->updateLayer(this))
-				return false;
-
-			updateBox(rep->box_,textSet.box());
-			if (!db_->updateRepresentation(id_,*rep))
-				return false;
-		}
-		else
-			return false;
-	}
-	return true;
-}
-
-bool
-TeLayer::addCells(TeCellSet& cellSet)
-{
-	if (!db_)
-		return false;
-
-	if (cellSet.size() > 0)
-	{
-		string tblName = tableName(TeCELLS);
-		if (!this->hasGeometry(TeCELLS))
-			this->addGeometry(TeCELLS);
-
-		TeRepresentation* rep = getRepresentation(TeCELLS);
-		if (rep)
-		{
-			rep->resX_ = cellSet.resX();
-			rep->resY_ = cellSet.resY();
-			if (!db_->insertCellSet(tableName(TeCELLS), cellSet))
-				return false;
-			//updateLayerBox(cellSet.box());
-			
-			updateBox(box_, cellSet.box());
-			editionTime_.now();
-			if(!db_->updateLayer(this))
-				return false;
-
-			updateBox(rep->box_,cellSet.box());
-			if (!db_->updateRepresentation(id_,*rep))
-				return false;
-		}		
-		else
-			return false;
-	}
-	return true;
-}
-
-bool 
-TeLayer::updatePolygons (TePolygonSet& polySet)
-{
-	if (!db_)
-		return false;
-
-	if (polySet.size() > 0 )
-	{
-		if (!this->hasGeometry(TePOLYGONS))
-			return false;
-
-		TeRepresentation* rep = getRepresentation(TePOLYGONS);
-		if (rep)
-		{
-			if (!db_->updatePolygonSet(rep->tableName_, polySet))
-				return false;
-			//updateLayerBox(polySet.box());
-
-			updateBox(box_, polySet.box());
-			editionTime_.now();
-			if(!db_->updateLayer(this))
-				return false;
-			
-			updateBox(rep->box_, polySet.box());
-			if(!db_->updateRepresentation(id_,*rep))
-				return false;
-		}
-		else
-			return false;
-	}
-	return true;
-}
-
-bool 
-TeLayer::updateLines (TeLineSet& lineSet)
-{
-	if (!db_)
-		return false;
-
-	if (lineSet.size() > 0)
-	{
-		if (!this->hasGeometry(TeLINES))
-			return false;
-		TeRepresentation* rep = getRepresentation(TeLINES);
-		if (rep)
-		{
-			if (!db_->updateLineSet (rep->tableName_, lineSet))
-				return false;
-			//updateLayerBox(lineSet.box());
-
-			updateBox(box_, lineSet.box());
-			editionTime_.now();
-			if(!db_->updateLayer(this))
-				return false;
-
-			updateBox(rep->box_,lineSet.box());
-			if (!db_->updateRepresentation(id_,*rep))
-				return false;
-		}
-		else
-			return false;
-	}
-	return true;
-}
-
-bool 
-TeLayer::updatePoints (TePointSet& pointSet)
-{
-	if (!db_)
-		return false;
-
-	if (pointSet.size() > 0)
-	{
-		if (!this->hasGeometry(TePOINTS))
-			return false;
-		string tblName = tableName(TePOINTS);
-
-		TeRepresentation* rep = getRepresentation(TePOINTS);
-		if (rep)
-		{	
-			if (!db_->updatePointSet (rep->tableName_, pointSet))
-				return false;
-			//updateLayerBox(pointSet.box());
-
-			updateBox(box_, pointSet.box());
-			editionTime_.now();
-			if(!db_->updateLayer(this))
-				return false;
-
-			updateBox(rep->box_,pointSet.box());
-			if (!db_->updateRepresentation(id_,*rep))
-				return false;
-		}
-		else
-			return false;
-	}
-	return true;
-}
-
-bool 
-TeLayer::updateText (TeTextSet& textSet, const string& tName)
-{
-	if (!db_)
-		return false;
-
-	TeRepresentation* rep =0;
-	string tabName;
-	if (tName.empty())
-	{
-		int i=0;
-		string name; 
-		do
-		{
-			name = "Text_" + Te2String(id_) + "_" + Te2String(i); 
-			rep = getRepresentation(TeTEXT,name); 
-			++i;
-		}
-		while (rep); 
-		tabName = name;
-	}
-	else
-		tabName = tName;
-
-	if (textSet.size() > 0 )
-	{
-		rep = getRepresentation(TeTEXT,tabName);
-		if (!rep)
-		{
-			return false;
-		}
-		if (rep)
-		{	
-			if (!db_->updateTextSet (tabName, textSet))
-				return false;
-			//updateLayerBox(textSet.box());
-
-			updateBox(box_, textSet.box());
-			editionTime_.now();
-			if(!db_->updateLayer(this))
-				return false;
-
-			updateBox(rep->box_,textSet.box());
-			if (!db_->updateRepresentation(id_,*rep))
-				return false;
-		}
-		else
-			return false;
-	}
-	return true;
-}
-
-bool
-TeLayer::updateCells(TeCellSet& cellSet)
-{
-	if (!db_)
-		return false;
-
-	if (cellSet.size() > 0)
-	{
-		string tblName = tableName(TeCELLS);
-		if (!this->hasGeometry(TeCELLS))
-			return false;
-
-		TeRepresentation* rep = getRepresentation(TeCELLS);
-		if (rep)
-		{
-			rep->resX_ = cellSet.resX();
-			rep->resY_ = cellSet.resY();
-			if (!db_->updateCellSet(tableName(TeCELLS), cellSet))
-				return false;
-			//updateLayerBox(cellSet.box());
-			
-			updateBox(box_, cellSet.box());
-			editionTime_.now();
-			if(!db_->updateLayer(this))
-				return false;
-
-			updateBox(rep->box_,cellSet.box());
-			if (!db_->updateRepresentation(id_,*rep))
-				return false;
-		}		
-		else
-			return false;
-	}
-	return true;
-}
-
-bool TeLayer::removeGeometries(const std::vector<int>& vecGeomIds, const TeGeomRep& rep)
-{
-	if(db_ == NULL)
-	{
-		return false;
-	}
-
-	if (!this->hasGeometry(rep))
-	{
-		return false;
-	}
-
-	std::string tblName = tableName(rep);
-	for(unsigned int i = 0; i < vecGeomIds.size(); ++i)
-	{
-		if(!db_->removeGeometry(tblName, rep, vecGeomIds[i]))
-		{
-			return false;
-		}
-	}
-
-	editionTime_.now();
-	if(!db_->updateLayer(this))
-		return false;
-
-	return true;
-}
-
-
-bool 
-TeLayer::saveAttributeTable(TeTable& table)
-{
-	if (!db_ || id_ <= 0)
-		return false;
-	if (!db_->tableExist(table.name()))
-	{
-		if (!db_->createTable(table.name(), table.attributeList()))
-			return false;
-	}
-	if (db_->insertTable (table))
-	{
-		editionTime_.now();
-		if(!db_->updateLayer(this))
-			return false;
-
-		if (table.id() <= 0)
-			return db_->insertTableInfo(id_,table);
-		else
-			return true;
-	}
-	return false;
-}
-
-bool
-TeLayer::getPolygons(TePolygonSet &ps, const string& whereClause)
-{
-	if (!hasGeometry(TePOLYGONS))
-		return false;
-	return db_->selectPolygonSet(tableName(TePOLYGONS), whereClause, ps);
-}
-
-bool
-TeLayer::getLines(TeLineSet &ls, const string& whereClause)
-{
-	if (!hasGeometry(TeLINES))
-		return false;
-	return db_->selectLineSet(tableName(TeLINES), whereClause, ls);
-}
-
-bool
-TeLayer::getPoints(TePointSet &ps, const string& whereClause)
-{
-	if (!hasGeometry(TePOINTS))
-		return false;
-	return db_->selectPointSet(tableName(TePOINTS), whereClause, ps);
-}
-
-bool
-TeLayer::getText(TeTextSet &ts, const string& whereClause)
-{
-	if (!hasGeometry(TeTEXT))
-		return false;
-	return db_->selectTextSet(tableName(TeTEXT), whereClause, ts);
-}
-
-bool
-TeLayer::getCells(TeCellSet &cs, const string& whereClause)
-{
-	if (!hasGeometry(TeCELLS))
-		return false;
-	return db_->selectCellSet(id_, tableName(TeCELLS), whereClause, cs);
-}
-
-bool 
-TeLayer::locatePolygon (TeCoord2D &pt, TePolygon &polygon, const double& tol)
-{
-	if (!hasGeometry(TePOLYGONS))
-		return false;
-	return db_->locatePolygon(tableName(TePOLYGONS),pt, polygon, tol);
-}
-
-bool 
-TeLayer::locateLine (TeCoord2D &pt, TeLine2D &line, const double& tol)
-{
-	if (!hasGeometry(TeLINES))
-		return false;
-	return db_->locateLine(tableName(TeLINES),pt, line, tol);
-}
-
-bool 
-TeLayer::locatePoint (TeCoord2D &pt, TePoint &point, const double& tol)
-{
-	if (!hasGeometry(TePOINTS))
-		return false;
-	return db_->locatePoint(tableName(TePOINTS), pt, point, tol);
-}
-
-bool 
-TeLayer::locateText(TeCoord2D &pt, TeText &text, const double& tol)
-{
-	if (!hasGeometry(TeTEXT))
-		return false;
-	return db_->locateText(tableName(TeTEXT), pt, text, tol);
-}
-
-bool 
-TeLayer::locateCell (TeCoord2D &pt, TeCell &cell, const double& tol)
-{
-	if (!hasGeometry(TeCELLS))
-		return false;
-	return db_->locateCell(tableName(TeCELLS), pt, cell, tol);
-}
-
-bool
-TeLayer::loadGeometrySet(const string& geoid, TePolygonSet &ps)
-{
-	if (!hasGeometry(TePOLYGONS))
-		return false;
-	return db_->loadPolygonSet(tableName(TePOLYGONS), geoid, ps);
-}
-
-bool
-TeLayer::loadGeometrySet (const string& geoid, TeLineSet &ls)
-{
-	if (!hasGeometry(TeLINES))
-		return false;
-	return db_->loadLineSet(tableName(TeLINES), geoid, ls);;
-}
-
-bool
-TeLayer::loadGeometrySet (const string& geoid, TePointSet &ps)
-{
-	if (!hasGeometry(TePOINTS))
-		return false;
-	return db_->loadPointSet(tableName(TePOINTS), geoid, ps);
-}
-
-bool
-TeLayer::loadGeometrySet (const string& geoid, TeCellSet &cs)
-{
-	if (!hasGeometry(TeCELLS))
-		return false;
-	return db_->loadCellSet(id_, tableName(TeCELLS), geoid, cs);
-}
-
-bool
-TeLayer::loadGeometrySet (const string& geoid, TeTextSet &ts)
-{
-	if (!hasGeometry(TeTEXT))
-		return false;
-	return db_->loadTextSet(tableName(TeTEXT), geoid, ts);
-}
-
-string
-TeLayer::mediaTable()
-{
-	TeAttrTableVector attrs;
-	getAttrTables(attrs, TeAttrMedia);
-
-	if(attrs.size()<1)
-		return "";
-
-	return (attrs[0].name());
-}
-
-void 
-TeLayer::mediaTable(const string& name)
-{
-	TeAttributeList attList;
-	TeTable table(name, attList,"object_id", "object_id", TeAttrMedia);
-	attTables_.push_back (table);
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeLayer.h"
+#include "TeUtils.h"
+#include "TeException.h"
+#include "TeDatabase.h"
+#include "TeRaster.h"
+#include "TeProjection.h"
+
+
+TeLayer::TeLayer(const string& name, TeDatabase* db, TeProjection* proj): 
+	name_(name),
+	id_(-1),
+	db_(db),
+	projection_ ( proj ),
+	raster_(0)
+{	
+	editionTime_.now();
+	
+	if (!db_ || name.empty())
+		return;
+
+	// verifies if layer already exists in the database
+	string sql = "SELECT * FROM te_layer WHERE name = '" + name + "'";
+	TeDatabasePortal* portal = db_->getPortal();
+	if (!portal)
+		return;
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return;
+	}
+	if (!portal->fetchRow()) 
+	{
+		if (!proj)	// provides a default projection No Projection
+			projection_ = new TeNoProjection();
+		else
+			projection_ = TeProjectionFactory::make (proj->params());
+		db_->insertLayer(this);
+	}
+	else
+		db_->loadLayer(this);
+	int pid = projection_->id();
+	delete projection_;
+	projection_ = db_->loadProjection(pid);
+	delete portal;
+}
+
+
+TeLayer::TeLayer(const string& name, TeDatabase* db, TeBox& box, TeProjection* proj):
+	name_(name),
+	id_(-1),
+	db_(db),
+	projection_(proj),
+	box_(box),
+	raster_(0)
+{
+	editionTime_.now();
+
+	if (!db_ || name.empty())
+		return;
+
+	// verifies if layer already exists in the database
+	string sql = "SELECT * FROM te_layer WHERE name = '" + name + "'";
+	TeDatabasePortal* portal = db_->getPortal();
+	if (!portal)
+		return;
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return;
+	}
+	if (!portal->fetchRow()) 
+	{
+		if (!proj)	// provides a default projection No Projection
+			projection_ = new TeNoProjection();
+		else
+			projection_ = TeProjectionFactory::make (proj->params());
+		db_->insertLayer(this);
+	}
+	else
+		db_->loadLayer(this);
+	delete portal;
+}
+
+TeLayer::~TeLayer()
+{
+	if ( projection_ != 0 )
+	{
+		delete projection_; 
+		projection_ = 0;
+	}
+	for (TeRepresPointerVectorIterator it = repVector_.begin(); it != repVector_.end(); it++)
+	{
+		if (*it)
+		{
+			delete (*it);
+			(*it) = 0;
+		}
+	}
+	repVector_.clear();
+	if (raster_!=0)
+	{
+		delete raster_;
+		raster_ = 0;
+	}
+}
+
+TeLayer::TeLayer( const TeLayer& other ) :
+projection_(NULL),
+raster_(NULL)
+{
+	if (other.projection_ != NULL)
+	{
+		projection_ = TeProjectionFactory::make ( other.projection_->params());
+	}
+
+	name_		= other.name_;
+	id_			= other.id_;
+	db_			= other.db_;
+
+    box_ = TeBox(other.box_);
+	editionTime_ = other.editionTime_;
+
+    if(other.raster_ != NULL)
+    {
+        TeRaster* oRast = other.raster_;
+        TeRasterParams oRastParams(oRast->params());
+
+        raster_ = new TeRaster(oRastParams);
+    }
+
+    attTables_ = other.attTables_;
+    TeRepresPointerVector oRepVec = other.repVector_;
+    TeRepresPointerVector::iterator it;
+
+    for(it = oRepVec.begin(); it != oRepVec.end(); ++it)
+    {
+        TeRepresentation* rep = new TeRepresentation();
+            
+        rep->id_ = (*it)->id_;
+        rep->geomRep_ = (*it)->geomRep_;
+        rep->tableName_ = (*it)->tableName_;
+        rep->description_ = (*it)->description_;
+        rep->box_ = (*it)->box_;
+        rep->resX_ = (*it)->resX_;
+        rep->resY_ = (*it)->resY_;
+        rep->nCols_ = (*it)->nCols_;
+        rep->nLins_ = (*it)->nLins_;
+
+        repVector_.push_back(rep);
+    }
+}
+
+TeLayer& 
+TeLayer::operator= ( const TeLayer& other )
+{
+	if ( this != &other )
+	{	
+		if (projection_)
+			delete projection_;
+		projection_ = 0;
+		if (other.projection_)
+			projection_ = TeProjectionFactory::make ( other.projection_->params());
+		name_		= other.name_;
+		id_			= other.id_;
+		box_		= other.box_;
+		db_ = other.db_;
+		editionTime_ = other.editionTime_;
+	}
+	return *this;
+}
+	
+
+void 
+TeLayer::setLayerBox(const TeBox& box)
+{   
+	box_ = box;
+	if ((id_ > -1) && db_)
+		db_->updateLayerBox(this);
+}
+
+void
+TeLayer::updateLayerBox(const TeBox& box)
+{
+	updateBox(box_,box);
+	if ((id_ > -1) && db_)
+		db_->updateLayerBox(this);
+}
+
+void
+TeLayer::updateLayerBox()
+{
+	if (id_ < 0 || !db_)
+		return;
+
+	string sql = "SELECT lower_x, lower_y, upper_x, upper_y FROM te_representation WHERE layer_id = " + Te2String(id_);
+	TeDatabasePortal* portal = db_->getPortal();
+	if (!portal)
+		return;
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return;
+	}
+
+	TeBox box;
+	while (portal->fetchRow())
+	{
+		TeBox brep(portal->getDouble(0),portal->getDouble(1),portal->getDouble(2),portal->getDouble(3));
+		updateBox(box,brep);
+	}
+	delete portal;
+	box_ = box;
+	db_->updateLayerBox(this);
+	return;
+}
+
+int 
+TeLayer::getNewObjectId()
+{
+	if(!db_)
+		return -1;
+
+	TeDatabasePortal* portal = db_->getPortal();
+	if(!portal)
+		return -1;
+
+	try
+	{
+		int objId = 0;
+		string sql;
+		for (TeRepresPointerVectorIterator it = vectRepres().begin(); it != vectRepres().end(); it++)
+		{
+           TeRepresentation* rep = (*it);
+
+           sql = "SELECT MAX(geom_id) FROM ";
+           sql += rep->tableName_;
+           if (portal->query(sql) && portal->fetchRow())
+           {
+				string data = portal->getData(0);
+				int value = 0;
+				if(!data.empty())
+				   value = atoi(data.c_str());
+				objId += value;
+           }
+           portal->freeResult();
+       }
+       delete portal;
+       return ++objId;
+   }
+   catch(...)
+   {
+       if (portal)
+       {
+           delete portal;
+           return -1;
+       }
+   }
+    return -1;
+} 
+
+void  
+TeLayer::setProjection ( TeProjection* proj )
+{	
+	if (!proj)
+		return;
+
+	// if no database set just update pointer
+	if (!db_)
+	{
+		if ( projection_)
+			delete projection_;
+		projection_ = proj;
+		return;
+	}
+
+	if (projection_)
+	{
+		proj->id(projection_->id());
+		delete projection_;
+	}
+	projection_ = proj; 
+	bool status = true;
+	
+	if ( projection_->id() <= 0  )	// new projection not in the database
+	{
+		status = db_->insertProjection(projection_);
+		// update layer information
+		if (status && id_ > 0)
+		{
+			string sql = "UPDATE te_layer SET projection_id = " + Te2String(projection_->id());
+				sql += " WHERE layer_id=" + Te2String(id_);
+			db_->execute(sql);
+		}
+	}
+	else
+		status = db_->updateProjection(projection_);
+
+	if (raster_)
+	{
+		delete raster_;
+		raster_ = 0;
+	}
+}
+
+void 
+TeLayer::raster( TeRaster* raster)
+{	
+	if (raster_ )
+	{
+		delete raster_;
+		raster_ = 0;
+	}
+	raster_ = raster; 
+}
+
+bool
+TeLayer::hasGeometry (TeGeomRep rep)
+{ 
+	if (repVector_.empty())
+		return false;
+	TeRepresPointerVectorIterator it;
+	it = TeFindRepresentation(repVector_.begin(), repVector_.end(),rep);
+	return (it != repVector_.end());
+} 
+
+int
+TeLayer::geomRep()
+{
+	if (repVector_.empty())
+		return TeGEOMETRYNONE;
+	int r = 0;
+	TeRepresPointerVectorIterator it;
+	for (it=repVector_.begin(); it != repVector_.end(); ++it)
+		r = (int)(*it)->geomRep_ | r;
+	return r;
+}
+
+TeTime TeLayer::getEditionTime() const
+{
+	return editionTime_;
+}
+
+void TeLayer::setEditionTime(const TeTime& editionTime)
+{
+	editionTime_ = editionTime;
+}
+
+bool TeLayer::updateLayerEditionTime(const bool& setEditionToNow)
+{
+	if(setEditionToNow)
+	{
+		editionTime_.now();
+	}
+	if(!editionTime_.isValid())
+	{
+		return false;
+	}
+	if(!db_->updateLayer(this))
+	{
+		return false;
+	}
+	return true;
+}
+
+bool TeLayer::reloadLayerEditionTime()
+{
+	if(db_ == NULL)
+	{
+		return false;
+	}
+
+	std::string sql = "SELECT edition_time FROM te_layer WHERE layer_id = " + Te2String(id());
+	TeDatabasePortal* portal = db_->getPortal();
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+
+	editionTime_ = portal->getDate(0);
+
+	delete portal;
+
+	return true;
+}
+
+string
+TeLayer::tableName(TeGeomRep rep) 
+{
+	TeRepresPointerVectorIterator it;
+	it = TeFindRepresentation(repVector_.begin(), repVector_.end(),rep);
+	if (it != repVector_.end())
+		return (*it)->tableName_;
+	else
+		return string("");
+}
+
+int 
+TeLayer::nGeometries(TeGeomRep rep)
+{
+	TeRepresPointerVectorIterator it;
+	it = TeFindRepresentation(repVector_.begin(), repVector_.end(),rep);
+	int ngeo = 0;
+	if (it != repVector_.end())
+	{
+		string sql = "SELECT COUNT(geom_id) FROM " + (*it)->tableName_;
+		TeDatabasePortal* portal = db_->getPortal();
+		if (portal && portal->query(sql) && portal->fetchRow())
+			ngeo = portal->getInt(0);
+		delete portal;
+	}
+	return ngeo;
+}
+
+
+bool
+TeLayer::getRepresentation(TeGeomRep repType, TeRepresPointerVector& result)
+{
+	TeRepresPointerVectorIterator it;
+	it = repVector_.begin();
+	while (it != repVector_.end())
+	{
+		if ((*it)->geomRep_ == repType)
+			result.push_back((*it));
+		++it;
+	}
+	if (result.empty())
+		return false;
+	return true;
+}
+
+TeRepresentation*
+TeLayer::getRepresentation(TeGeomRep repType, const string& tName)
+{
+
+	TeRepresPointerVectorIterator it;
+	it = repVector_.begin();
+	while (it != repVector_.end())
+	{
+		if ((*it)->geomRep_ == repType)
+		{
+			if (tName.empty() || (*it)->tableName_== tName)
+				return (*it);
+		}
+		it++;
+	}
+	return 0;
+}
+
+bool 
+TeLayer::removeGeometry (TeGeomRep repType, const string& tName)
+{
+	if (!db_)
+		return false;
+
+	if (repType == TeTEXT && tName.empty())	// layer can have more than one TEXT table
+		return false;
+
+	TeRepresPointerVectorIterator it;
+	it = TeFindRepresentation(repVector_.begin(), repVector_.end(),repType);
+	while (it != repVector_.end())
+	{
+		if (tName.empty() || (*it)->tableName_== tName)
+		{
+			string del;
+			TeRepresentation* rep = (*it);
+			if (rep->id_ > 0)
+			{
+				del = "DELETE FROM te_representation WHERE repres_id=" + Te2String(rep->id_);
+				if (!db_->execute(del))
+					return false;
+			}
+
+			if (!rep->tableName_.empty())
+			{
+				if(rep->geomRep_ == TeRASTER || rep->geomRep_ == TeRASTERFILE)
+				{
+					TeDatabasePortal* portal = db_->getPortal();
+					string sql, tname;
+
+					sql = "SELECT lut_table, raster_table FROM " + rep->tableName_;
+					portal->query(sql);
+
+					while(portal->fetchRow())
+					{
+						// delete lut table
+						tname = portal->getData(0);
+						if(!tname.empty())
+							db_->deleteTable(tname);
+						// delete raster table
+						tname = portal->getData(1);
+						if(rep->geomRep_ != TeRASTERFILE && !tname.empty())
+							db_->deleteTable(tname);
+					}
+					portal->freeResult();
+					delete portal;
+
+					// delete metadata table
+					sql = "DROP TABLE " + rep->tableName_ + "_metadata";
+					db_->execute(sql);
+					if (raster_)
+					{
+						delete raster_;
+						raster_ = 0;
+					}
+				}
+				if (!db_->deleteTable(rep->tableName_))					
+					return false;
+			}
+			repVector_.erase(it);
+			delete rep;
+			break;
+		}
+		it++;
+		it = TeFindRepresentation(it,repVector_.end(),repType);
+	}
+	updateLayerBox();
+	return true;
+}
+
+bool TeLayer::addGeometry(TeGeomRep repType, const string& tName, const string& desc)
+{  
+	// check if representation is already in layer
+	if (repType == TeTEXT)
+	{
+		string tt;
+		if (!tName.empty())
+			tt = tName;
+		else
+			tt =  name_ + "Texts";
+		
+		if (getRepresentation(repType,tt))
+			return true;
+	}
+	else if (getRepresentation(repType))
+		return true;
+
+	if (!db_)			// layer has no database associated
+		return false;
+
+	if (id_ < 0)		// layer has not saved in the database
+	{
+		if (!db_->insertLayer (this))
+			return false;
+	}
+
+	TeRepresentation* represe = new TeRepresentation();
+	represe->geomRep_ = repType;
+	if (!tName.empty())
+		represe->tableName_ = tName;
+	if (!desc.empty())
+		represe->description_ = desc;
+
+	if (repType == TePOLYGONS)
+	{
+		if (tName.empty())
+			represe->tableName_ = "Polygons" + Te2String(id_);
+		if (!db_->createPolygonGeometry (represe->tableName_))
+			return false;
+	}
+	else if (repType == TeLINES)
+	{
+		if (tName.empty())
+			represe->tableName_ = "Lines" + Te2String(id_);
+		if (!db_->createLineGeometry (represe->tableName_))
+			return false;
+	}
+	else if (repType == TePOINTS)
+	{
+		if (tName.empty())
+			represe->tableName_ = "Points" + Te2String(id_);
+		if (!db_->createPointGeometry (represe->tableName_))
+			return false;
+	}
+	else if (repType == TeTEXT)
+	{
+		if (tName.empty())
+			represe->tableName_ = "Texts" + Te2String(id_);
+		if (!db_->createTextGeometry (represe->tableName_))
+			return false;
+	}
+	else if (repType == TeARCS)
+	{
+		if (tName.empty())
+			represe->tableName_ = "Arcs"+ Te2String(id_);
+ 		if (!db_->createArcGeometry (represe->tableName_))
+			return false;
+	}
+	else if (repType == TeNODES)
+	{
+		if (tName.empty())
+			represe->tableName_ = "Nodes"+ Te2String(id_);
+ 		if (!db_->createNodeGeometry (represe->tableName_))
+			return false;
+	}
+	else if (repType == TeCELLS)
+	{
+		if (tName.empty())
+			represe->tableName_ = "Cells"+ Te2String(id_);
+ 		if (!db_->createCellGeometry (represe->tableName_))
+			return false;
+	}
+	else
+	{
+		return false;
+	}
+
+	bool res =  db_->insertRepresentation(id_,*represe);
+
+	if (res) 
+		repVector_.push_back(represe);
+	else
+		return false;
+	return true;
+}
+
+bool 
+TeLayer::addRasterGeometry(TeRasterParams& par, const string& objectId, 
+						   const string& tName, const string& desc)
+{
+	string tableName = tName;
+	TeRepresentation* rep = getRepresentation(TeRASTER,tableName);
+	if (!rep)
+	{
+		rep = new TeRepresentation();
+		updateBox(rep->box_,par.boundingBox());
+
+		if (!tableName.empty())
+			rep->tableName_ = tableName;
+		else
+			rep->tableName_ = "RasterLayer" + Te2String(id_);
+
+		if (!desc.empty())
+			rep->description_ = desc;
+
+		rep->geomRep_ = TeRASTER;
+		if (!db_->insertRepresentation(id_,*rep))
+			return false;
+
+		tableName = rep->tableName_;
+		if (!db_->createRasterGeometry(tableName))
+			return false;
+
+		string metadataTableName = tableName+"_metadata";
+		if (!db_->createRasterMetadataTable(metadataTableName))
+			return false;
+
+		repVector_.push_back(rep);
+	}
+	else
+		tableName = rep->tableName_;
+
+	string oid = objectId;
+	if (oid.empty())
+		oid = "O1";
+
+	if (par.fileName_.empty())
+	{
+		string aux = "RasterLayer" + Te2String(id_) + "_R_" + objectId;
+		bool flag = db_->tableExist(aux);
+		short i=1;
+		while (flag)
+		{
+			aux = "RasterLayer" + Te2String(id_) + "_R_" + objectId + "_" + Te2String(i);
+			++i;
+		}
+		par.fileName_ = aux;
+	}
+
+//updates the date in the te_representation table
+	if(par.date_.isValid())
+	{	
+		std::string sqlTime = db_->getSQLTime(par.date_);
+		if(!sqlTime.empty())
+		{
+			std::string sql = "UPDATE te_representation SET initial_time = " + sqlTime;
+			sql += ", final_time = " + sqlTime;
+			sql += " WHERE repres_id=" + Te2String(rep->id_);
+			if(!db_->execute(sql))
+			{
+				return false;
+			}
+		}
+	}
+
+	if (!db_->createRasterTable(par.fileName_))
+		return false;
+
+	if (!db_->insertRasterGeometry(tableName,par,objectId))
+		return false;
+
+	updateLayerBox(par.boundingBox());
+	par.layerId_ = id_;
+	par.objectId_ = oid;
+
+	return true;
+}
+
+bool
+TeLayer::addRasterFileGeometry(TeRaster* raster, const string& objectId, const string& desc)
+{
+	if (!raster)
+		return false;
+	TeRepresentation* rep = getRepresentation(TeRASTERFILE);
+	if (!rep)
+	{
+		rep = new TeRepresentation();
+		updateBox(rep->box_,raster->params().boundingBox());
+		rep->tableName_ = "RasterLayer" + Te2String(id_);
+		rep->geomRep_ = TeRASTERFILE;
+		rep->resX_ = raster->params().resx_;
+		rep->resY_ = raster->params().resy_;
+		rep->nCols_= raster->params().ncols_;
+		rep->nLins_= raster->params().nlines_;
+		if (!desc.empty())
+			rep->description_ = desc;
+		if (!db_->insertRepresentation(id_,*rep))
+			return false;
+		if (!db_->createRasterGeometry(rep->tableName_))
+			return false;
+		if (!db_->createRasterMetadataTable(rep->tableName_+"_metadata"))
+			return false;
+		repVector_.push_back(rep);
+	}
+
+//updates the date in the te_representation table
+	if(raster->params().date_.isValid())
+	{	
+		std::string sqlTime = db_->getSQLTime(raster->params().date_);
+		if(!sqlTime.empty())
+		{
+			std::string sql = "UPDATE te_representation SET initial_time = " + sqlTime;
+			sql += ", final_time = " + sqlTime;
+			sql += " WHERE repres_id=" + Te2String(rep->id_);
+			if(!db_->execute(sql))
+			{
+				return false;
+			}
+		}
+	}
+
+	string oid = (objectId.empty()) ? TeGetBaseName(raster->params().fileName_.c_str()) : objectId;
+	if (oid.empty())
+		oid = "O1";
+	string sql = "delete from " +  rep->tableName_ + " where object_id = '" + oid + "'";
+	db_->execute(sql);
+	if (!db_->insertRasterGeometry(rep->tableName_,raster->params(),oid))
+		return false;
+	updateLayerBox(raster->params().boundingBox());
+	raster->params().layerId_ = id_;
+	raster->params().objectId_ = oid;
+	return true;
+}
+
+bool 
+TeLayer::addRasterGeometry(TeRaster* raster, const string& objectId)
+{
+	if (!raster)
+		return false;
+	TeRepresentation* rep = getRepresentation(TeRASTER);
+	if (!rep)
+	{
+		rep = new TeRepresentation();
+		updateBox(rep->box_,raster->params().boundingBox());
+		rep->tableName_ = "RasterLayer" + Te2String(id_);
+		rep->geomRep_ = TeRASTER;
+		if (!db_->insertRepresentation(id_,*rep))
+			return false;
+		if (!db_->createRasterGeometry(rep->tableName_))
+			return false;
+		if (!db_->createRasterMetadataTable(rep->tableName_+"_metadata"))
+			return false;
+		repVector_.push_back(rep);
+	}
+
+	string oid = objectId;
+	if (oid.empty())
+		oid = "O1";
+	string sql = "delete from " +  rep->tableName_ + " where object_id = '" + oid + "'";
+	db_->execute(sql);
+	if (!db_->insertRasterGeometry(rep->tableName_,raster->params(),oid))
+		return false;
+	updateLayerBox(raster->params().boundingBox());
+	raster->params().layerId_ = id_;
+	raster->params().objectId_ = oid;
+	return true;
+}
+
+TeRaster*
+TeLayer::raster(const string& objectId, const char& mode)
+{	
+   if (id_ <= 0 ||
+	  !(hasGeometry(TeRASTER) || hasGeometry(TeRASTERFILE)))
+       return 0; 
+
+	if (raster_  && !objectId.empty() && 
+	   (objectId != raster_->objectId() || 
+		mode != raster_->params().mode_ ))
+	{
+		delete raster_;
+		raster_ = 0; 
+	}
+
+	if (!raster_)
+		raster_ = db_->loadLayerRaster(id_,objectId, mode);
+	return raster_;
+}
+
+bool
+TeLayer::getRasterGeometries(vector<string>& objectIds, unsigned int tilingType, const TeBox& box)
+{
+	objectIds.clear();
+	if ((!hasGeometry(TeRASTER) && !hasGeometry(TeRASTERFILE)) || id_ <= 0 )
+		return false;
+
+	TeDatabasePortal* portal = db_->getPortal();
+	if (!portal)
+		return false;
+
+	string get = "SELECT geom_table FROM te_representation WHERE layer_id = " + Te2String(id_);
+	get += " AND (geom_type = 512 OR geom_type = 1024)";
+	
+	// error executing query or no there is no raster representation 
+	if (!portal->query(get) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	string tableName = portal->getData(0);
+	if (tableName.empty())
+	{
+		delete portal;
+		return false;
+	}
+	portal->freeResult();
+	
+	std::string whereClause = "";
+	if (tilingType == 1 || tilingType == 2)
+	{
+		if(!whereClause.empty())
+		{
+			whereClause += " AND ";
+		}
+		whereClause += "tiling_type=" + Te2String(tilingType);
+	}
+	if(box.isValid())
+	{
+		if(!whereClause.empty())
+		{
+			whereClause += " AND ";
+		}
+		whereClause = "NOT(lower_x > " + Te2String(box.x2_, 12) + " OR ";
+		whereClause += "upper_x < " + Te2String(box.x1_, 12) + " OR ";
+		whereClause += "lower_y > " + Te2String(box.y2_, 12) + " OR ";
+		whereClause += "upper_y < " + Te2String(box.y1_, 12) + ")";
+	}
+
+	get = "SELECT object_id FROM " + tableName;
+	if(!whereClause.empty())
+	{
+		get += " WHERE " + whereClause;
+	}
+
+	if (!portal->query(get))
+	{
+		delete portal;
+		return false;
+	}
+	while (portal->fetchRow())
+		objectIds.push_back(portal->getData(0));
+	delete portal;
+	return !objectIds.empty();
+}
+
+
+int 
+TeLayer::nObjects(const string& tName)
+{
+	if (attTables_.empty())
+		return 0;
+	string linkName;
+	vector<TeTable>::iterator it = attTables_.begin();
+	while (it != attTables_.end())
+	{
+		if ((*it).name() == tName)
+		{
+			linkName = (*it).linkName();
+			break;
+		}
+		it++;
+	}
+	if (linkName.empty())
+		return 0;
+	int no = 0;
+	string sql;
+	TeDatabasePortal* portal = db_->getPortal();
+	if (!portal)
+		return 0;
+	sql = "SELECT COUNT(" + linkName + ") FROM " + (*it).name();
+	if (portal->query(sql) && portal->fetchRow())
+		no = portal->getInt(0);
+	delete portal;
+	return no;
+}
+
+
+bool 
+TeLayer::createAttributeTable(TeTable& table)
+{
+	if (!db_->tableExist(table.name()))
+	{
+		db_->validTable(table);
+  		if (!db_->createTable(table.name(),table.attributeList())) 
+			return false;
+	}
+	
+	vector<TeTable>::iterator it = attTables_.begin();
+	while (it != attTables_.end())
+	{
+		if ((*it).name() == table.name())
+			return true;
+		++it;
+	}
+
+	if(!db_->insertTableInfo(id_, table))
+		return false;
+
+	attTables_.push_back(table);
+	
+	return true;
+}
+
+bool 
+TeLayer::addAttributeTable(TeTable& table)
+{
+	vector<TeTable>::iterator it = attTables_.begin();
+	while (it != attTables_.end())
+	{
+		if ((*it).name() == table.name())
+			return false;
+		it++;
+	}
+	attTables_.push_back(table);
+	return true;
+}
+
+bool 
+TeLayer::removeAttributeTable(string tableName)
+{
+	vector<TeTable>::iterator it = attTables_.begin();
+	while (it != attTables_.end())
+	{
+		if ((*it).name() == tableName)
+		{
+			attTables_.erase(it);
+			return true;
+		}
+		it++;
+	}
+	return false;
+}
+
+void 
+TeLayer::updateAttributeTable(TeTable& table)
+{
+	vector<TeTable>::iterator it = attTables_.begin();
+	while (it != attTables_.end())
+	{
+		if ((*it).name() == table.name())
+		{
+			attTables_.erase(it);
+			break;
+		}
+		it++;
+	}
+	attTables_.push_back(table);
+}
+
+bool
+TeLayer::loadLayerTables() 
+{
+	TeDatabase *db = database();
+	if(!db)
+		return false;
+
+	attTables_.clear();
+	return(db->loadLayerTable(this));
+}
+
+bool 
+TeLayer::getAttrTables(TeAttrTableVector& atts, TeAttrTableType attType)
+{
+	TeAttrTableVector::iterator it = attTables_.begin();
+	while (it != attTables_.end())
+	{
+		if ((attType == TeAllAttrTypes) || ((*it).tableType() == attType))
+			atts.push_back((*it));
+		it++;
+	}
+	return (!atts.empty());
+}
+
+bool 
+TeLayer::getAttrTablesByName(vector<string> &tableNames, TeAttrTableVector& atts, TeAttrTableType attType)
+{
+	TeAttrTableVector::iterator it;
+	vector<string>::iterator it2;
+
+	for(it2 = tableNames.begin(); it2 != tableNames.end(); ++it2)
+	{
+		for(it = attTables_.begin(); it != attTables_.end(); ++it)
+		{
+			if ((attType == TeAllAttrTypes) || ((*it).tableType() == attType))
+			{
+				string name = (*it).name();
+				string name2 = (*it2);
+				if(name == name2)
+				{
+					atts.push_back((*it));
+					break;
+				}
+			}
+		}
+	}
+	return (!atts.empty());
+}
+
+
+bool 
+TeLayer::getAttrTablesByName(const string& attrTableName, TeTable& table, TeAttrTableType attType)
+{
+	TeAttrTableVector::iterator it;
+
+	for(it = attTables_.begin(); it != attTables_.end(); ++it)
+	{
+		if ((attType == TeAllAttrTypes) || ((*it).tableType() == attType))
+		{
+			string name = (*it).name();
+			if(name == attrTableName)
+			{
+				table = (*it);
+				return true;
+			}
+		}
+	}
+	
+	return false;
+}
+
+bool 
+TeLayer::addPolygons (TePolygonSet& polySet)
+{
+	if (!db_)
+		return false;
+
+	if (polySet.size() > 0 )
+	{
+		if (!this->hasGeometry(TePOLYGONS))
+			this->addGeometry(TePOLYGONS);
+
+		TeRepresentation* rep = getRepresentation(TePOLYGONS);
+		if (rep)
+		{
+			if (!db_->insertPolygonSet (rep->tableName_, polySet))
+				return false;
+			//updateLayerBox(polySet.box());
+
+			updateBox(box_, polySet.box());
+			editionTime_.now();
+			if(!db_->updateLayer(this))
+				return false;
+			
+			updateBox(rep->box_, polySet.box());
+			if(!db_->updateRepresentation(id_,*rep))
+				return false;
+		}
+		else
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeLayer::addLines (TeLineSet& lineSet)
+{
+	if (!db_)
+		return false;
+
+	if (lineSet.size() > 0)
+	{
+		if (!this->hasGeometry(TeLINES))
+			this->addGeometry(TeLINES);
+		TeRepresentation* rep = getRepresentation(TeLINES);
+		if (rep)
+		{
+			if (!db_->insertLineSet (rep->tableName_, lineSet))
+				return false;
+			//updateLayerBox(lineSet.box());
+
+			updateBox(box_, lineSet.box());
+			editionTime_.now();
+			if(!db_->updateLayer(this))
+				return false;
+
+			updateBox(rep->box_,lineSet.box());
+			if (!db_->updateRepresentation(id_,*rep))
+				return false;
+		}
+		else
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeLayer::addPoints (TePointSet& pointSet)
+{
+	if (!db_)
+		return false;
+
+	if (pointSet.size() > 0)
+	{
+		if (!this->hasGeometry(TePOINTS))
+			this->addGeometry(TePOINTS);
+		string tblName = tableName(TePOINTS);
+
+		TeRepresentation* rep = getRepresentation(TePOINTS);
+		if (rep)
+		{	
+			if (!db_->insertPointSet (rep->tableName_, pointSet))
+				return false;
+			//updateLayerBox(pointSet.box());
+
+			updateBox(box_, pointSet.box());
+			editionTime_.now();
+			if(!db_->updateLayer(this))
+				return false;
+
+			updateBox(rep->box_,pointSet.box());
+			if (!db_->updateRepresentation(id_,*rep))
+				return false;
+		}
+		else
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeLayer::addText (TeTextSet& textSet, const string& tName)
+{
+	if (!db_)
+		return false;
+
+	TeRepresentation* rep =0;
+	string tabName;
+	if (tName.empty())
+	{
+		int i=0;
+		string name; 
+		do
+		{
+			name = "Text_" + Te2String(id_) + "_" + Te2String(i); 
+			rep = getRepresentation(TeTEXT,name); 
+			++i;
+		}
+		while (rep); 
+		tabName = name;
+	}
+	else
+		tabName = tName;
+
+	if (textSet.size() > 0 )
+	{
+		rep = getRepresentation(TeTEXT,tabName);
+		if (!rep)
+		{
+			this->addGeometry(TeTEXT,tabName);
+			rep = getRepresentation(TeTEXT,tabName);
+		}
+		if (rep)
+		{	
+			if (!db_->insertTextSet (tabName, textSet))
+				return false;
+			//updateLayerBox(textSet.box());
+
+			updateBox(box_, textSet.box());
+			editionTime_.now();
+			if(!db_->updateLayer(this))
+				return false;
+
+			updateBox(rep->box_,textSet.box());
+			if (!db_->updateRepresentation(id_,*rep))
+				return false;
+		}
+		else
+			return false;
+	}
+	return true;
+}
+
+bool
+TeLayer::addCells(TeCellSet& cellSet)
+{
+	if (!db_)
+		return false;
+
+	if (cellSet.size() > 0)
+	{
+		string tblName = tableName(TeCELLS);
+		if (!this->hasGeometry(TeCELLS))
+			this->addGeometry(TeCELLS);
+
+		TeRepresentation* rep = getRepresentation(TeCELLS);
+		if (rep)
+		{
+			rep->resX_ = cellSet.resX();
+			rep->resY_ = cellSet.resY();
+			if (!db_->insertCellSet(tableName(TeCELLS), cellSet))
+				return false;
+			//updateLayerBox(cellSet.box());
+			
+			updateBox(box_, cellSet.box());
+			editionTime_.now();
+			if(!db_->updateLayer(this))
+				return false;
+
+			updateBox(rep->box_,cellSet.box());
+			if (!db_->updateRepresentation(id_,*rep))
+				return false;
+		}		
+		else
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeLayer::updatePolygons (TePolygonSet& polySet)
+{
+	if (!db_)
+		return false;
+
+	if (polySet.size() > 0 )
+	{
+		if (!this->hasGeometry(TePOLYGONS))
+			return false;
+
+		TeRepresentation* rep = getRepresentation(TePOLYGONS);
+		if (rep)
+		{
+			if (!db_->updatePolygonSet(rep->tableName_, polySet))
+				return false;
+			//updateLayerBox(polySet.box());
+
+			updateBox(box_, polySet.box());
+			editionTime_.now();
+			if(!db_->updateLayer(this))
+				return false;
+			
+			updateBox(rep->box_, polySet.box());
+			if(!db_->updateRepresentation(id_,*rep))
+				return false;
+		}
+		else
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeLayer::updateLines (TeLineSet& lineSet)
+{
+	if (!db_)
+		return false;
+
+	if (lineSet.size() > 0)
+	{
+		if (!this->hasGeometry(TeLINES))
+			return false;
+		TeRepresentation* rep = getRepresentation(TeLINES);
+		if (rep)
+		{
+			if (!db_->updateLineSet (rep->tableName_, lineSet))
+				return false;
+			//updateLayerBox(lineSet.box());
+
+			updateBox(box_, lineSet.box());
+			editionTime_.now();
+			if(!db_->updateLayer(this))
+				return false;
+
+			updateBox(rep->box_,lineSet.box());
+			if (!db_->updateRepresentation(id_,*rep))
+				return false;
+		}
+		else
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeLayer::updatePoints (TePointSet& pointSet)
+{
+	if (!db_)
+		return false;
+
+	if (pointSet.size() > 0)
+	{
+		if (!this->hasGeometry(TePOINTS))
+			return false;
+		string tblName = tableName(TePOINTS);
+
+		TeRepresentation* rep = getRepresentation(TePOINTS);
+		if (rep)
+		{	
+			if (!db_->updatePointSet (rep->tableName_, pointSet))
+				return false;
+			//updateLayerBox(pointSet.box());
+
+			updateBox(box_, pointSet.box());
+			editionTime_.now();
+			if(!db_->updateLayer(this))
+				return false;
+
+			updateBox(rep->box_,pointSet.box());
+			if (!db_->updateRepresentation(id_,*rep))
+				return false;
+		}
+		else
+			return false;
+	}
+	return true;
+}
+
+bool 
+TeLayer::updateText (TeTextSet& textSet, const string& tName)
+{
+	if (!db_)
+		return false;
+
+	TeRepresentation* rep =0;
+	string tabName;
+	if (tName.empty())
+	{
+		int i=0;
+		string name; 
+		do
+		{
+			name = "Text_" + Te2String(id_) + "_" + Te2String(i); 
+			rep = getRepresentation(TeTEXT,name); 
+			++i;
+		}
+		while (rep); 
+		tabName = name;
+	}
+	else
+		tabName = tName;
+
+	if (textSet.size() > 0 )
+	{
+		rep = getRepresentation(TeTEXT,tabName);
+		if (!rep)
+		{
+			return false;
+		}
+		if (rep)
+		{	
+			if (!db_->updateTextSet (tabName, textSet))
+				return false;
+			//updateLayerBox(textSet.box());
+
+			updateBox(box_, textSet.box());
+			editionTime_.now();
+			if(!db_->updateLayer(this))
+				return false;
+
+			updateBox(rep->box_,textSet.box());
+			if (!db_->updateRepresentation(id_,*rep))
+				return false;
+		}
+		else
+			return false;
+	}
+	return true;
+}
+
+bool
+TeLayer::updateCells(TeCellSet& cellSet)
+{
+	if (!db_)
+		return false;
+
+	if (cellSet.size() > 0)
+	{
+		string tblName = tableName(TeCELLS);
+		if (!this->hasGeometry(TeCELLS))
+			return false;
+
+		TeRepresentation* rep = getRepresentation(TeCELLS);
+		if (rep)
+		{
+			rep->resX_ = cellSet.resX();
+			rep->resY_ = cellSet.resY();
+			if (!db_->updateCellSet(tableName(TeCELLS), cellSet))
+				return false;
+			//updateLayerBox(cellSet.box());
+			
+			updateBox(box_, cellSet.box());
+			editionTime_.now();
+			if(!db_->updateLayer(this))
+				return false;
+
+			updateBox(rep->box_,cellSet.box());
+			if (!db_->updateRepresentation(id_,*rep))
+				return false;
+		}		
+		else
+			return false;
+	}
+	return true;
+}
+
+bool TeLayer::removeGeometries(const std::vector<int>& vecGeomIds, const TeGeomRep& rep)
+{
+	if(db_ == NULL)
+	{
+		return false;
+	}
+
+	if (!this->hasGeometry(rep))
+	{
+		return false;
+	}
+
+	std::string tblName = tableName(rep);
+	for(unsigned int i = 0; i < vecGeomIds.size(); ++i)
+	{
+		if(!db_->removeGeometry(tblName, rep, vecGeomIds[i]))
+		{
+			return false;
+		}
+	}
+
+	editionTime_.now();
+	if(!db_->updateLayer(this))
+		return false;
+
+	return true;
+}
+
+
+bool 
+TeLayer::saveAttributeTable(TeTable& table)
+{
+	if (!db_ || id_ <= 0)
+		return false;
+	if (!db_->tableExist(table.name()))
+	{
+		if (!db_->createTable(table.name(), table.attributeList()))
+			return false;
+	}
+	if (db_->insertTable (table))
+	{
+		editionTime_.now();
+		if(!db_->updateLayer(this))
+			return false;
+
+		if (table.id() <= 0)
+			return db_->insertTableInfo(id_,table);
+		else
+			return true;
+	}
+	return false;
+}
+
+bool
+TeLayer::getPolygons(TePolygonSet &ps, const string& whereClause)
+{
+	if (!hasGeometry(TePOLYGONS))
+		return false;
+	return db_->selectPolygonSet(tableName(TePOLYGONS), whereClause, ps);
+}
+
+bool
+TeLayer::getLines(TeLineSet &ls, const string& whereClause)
+{
+	if (!hasGeometry(TeLINES))
+		return false;
+	return db_->selectLineSet(tableName(TeLINES), whereClause, ls);
+}
+
+bool
+TeLayer::getPoints(TePointSet &ps, const string& whereClause)
+{
+	if (!hasGeometry(TePOINTS))
+		return false;
+	return db_->selectPointSet(tableName(TePOINTS), whereClause, ps);
+}
+
+bool
+TeLayer::getText(TeTextSet &ts, const string& whereClause)
+{
+	if (!hasGeometry(TeTEXT))
+		return false;
+	return db_->selectTextSet(tableName(TeTEXT), whereClause, ts);
+}
+
+bool
+TeLayer::getCells(TeCellSet &cs, const string& whereClause)
+{
+	if (!hasGeometry(TeCELLS))
+		return false;
+	return db_->selectCellSet(id_, tableName(TeCELLS), whereClause, cs);
+}
+
+bool 
+TeLayer::locatePolygon (TeCoord2D &pt, TePolygon &polygon, const double& tol)
+{
+	if (!hasGeometry(TePOLYGONS))
+		return false;
+	return db_->locatePolygon(tableName(TePOLYGONS),pt, polygon, tol);
+}
+
+bool 
+TeLayer::locateLine (TeCoord2D &pt, TeLine2D &line, const double& tol)
+{
+	if (!hasGeometry(TeLINES))
+		return false;
+	return db_->locateLine(tableName(TeLINES),pt, line, tol);
+}
+
+bool 
+TeLayer::locatePoint (TeCoord2D &pt, TePoint &point, const double& tol)
+{
+	if (!hasGeometry(TePOINTS))
+		return false;
+	return db_->locatePoint(tableName(TePOINTS), pt, point, tol);
+}
+
+bool 
+TeLayer::locateText(TeCoord2D &pt, TeText &text, const double& tol)
+{
+	if (!hasGeometry(TeTEXT))
+		return false;
+	return db_->locateText(tableName(TeTEXT), pt, text, tol);
+}
+
+bool 
+TeLayer::locateCell (TeCoord2D &pt, TeCell &cell, const double& tol)
+{
+	if (!hasGeometry(TeCELLS))
+		return false;
+	return db_->locateCell(tableName(TeCELLS), pt, cell, tol);
+}
+
+bool
+TeLayer::loadGeometrySet(const string& geoid, TePolygonSet &ps)
+{
+	if (!hasGeometry(TePOLYGONS))
+		return false;
+	return db_->loadPolygonSet(tableName(TePOLYGONS), geoid, ps);
+}
+
+bool
+TeLayer::loadGeometrySet (const string& geoid, TeLineSet &ls)
+{
+	if (!hasGeometry(TeLINES))
+		return false;
+	return db_->loadLineSet(tableName(TeLINES), geoid, ls);;
+}
+
+bool
+TeLayer::loadGeometrySet (const string& geoid, TePointSet &ps)
+{
+	if (!hasGeometry(TePOINTS))
+		return false;
+	return db_->loadPointSet(tableName(TePOINTS), geoid, ps);
+}
+
+bool
+TeLayer::loadGeometrySet (const string& geoid, TeCellSet &cs)
+{
+	if (!hasGeometry(TeCELLS))
+		return false;
+	return db_->loadCellSet(id_, tableName(TeCELLS), geoid, cs);
+}
+
+bool
+TeLayer::loadGeometrySet (const string& geoid, TeTextSet &ts)
+{
+	if (!hasGeometry(TeTEXT))
+		return false;
+	return db_->loadTextSet(tableName(TeTEXT), geoid, ts);
+}
+
+string
+TeLayer::mediaTable()
+{
+	TeAttrTableVector attrs;
+	getAttrTables(attrs, TeAttrMedia);
+
+	if(attrs.size()<1)
+		return "";
+
+	return (attrs[0].name());
+}
+
+void 
+TeLayer::mediaTable(const string& name)
+{
+	TeAttributeList attList;
+	TeTable table(name, attList,"object_id", "object_id", TeAttrMedia);
+	attTables_.push_back (table);
+}
diff --git a/src/terralib/kernel/TeLayer.h b/src/terralib/kernel/TeLayer.h
old mode 100755
new mode 100644
index a8a3477..243a564
--- a/src/terralib/kernel/TeLayer.h
+++ b/src/terralib/kernel/TeLayer.h
@@ -1,464 +1,471 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeLayer.h
-    \brief This file contains structures and definitions to deal with a layer
-*/
-#ifndef __TERRALIB_INTERNAL_LAYER_H
-#define __TERRALIB_INTERNAL_LAYER_H
-
-#include "TeGeometry.h"
-#include "TeDataTypes.h"
-#include "TeTable.h"
-#include "TeRepresentation.h"
-
-#include <string>
-#include <list>
-#include <map>
-
-class TeRaster;
-class TeDatabase;
-class TeRasterParams;
-class TeProjection;
-
-//!  A class for supporting a layer. 
-/*!  
-	 In TerraLib, a layer is a collection of geometries that share the same 
-     geographical projection, and are related in some way (e.g. a shapefile).
-	 A layer has a pointer to a database that effectively stores its atributes
-	 and geometries.
-	 
-	\sa
-     TeGeometry, TeProjection, TeBox, TeDatabase, TeTheme, TeTable
-*/
-class TL_DLL TeLayer {
-
-public:
-
-	//! Empty constructor
-	TeLayer():
-		id_(-1),
-		db_(0),
-		projection_ ( 0 ),
-		raster_(0)
-		{ }
-
-		
-	//! Constructor with parameters
-	/* 
-		\param name layer name (should be unique)
-		\param db a TerraLib database connection w
-		\param proj layer projection
-		\note 
-			\par If no database is informed, layer will exist only in memory.
-			\par If a layer with this name doesn�t exist a layer will be 
-			 created and stored. If no projection is informed a default TeNoProjection
-			 will be used as layer projection.
-            \par If a layer with this name already exists it will be retrieved
-	*/	 
-	TeLayer(const string& name, TeDatabase* db=0, TeProjection* proj=0);
-
-	//! Constructor with parameters
-	/* 
-		\param name layer name (should be unique)
-		\param db TerraLib database connection where layer will be stored
-		\param box layer bounding box
-		\param proj layer projection
-		\note 
-			\par If no database is informed, layer will exist only in memory.
-			\par If a layer with this name doesn�t exist a layer will be 
-			 created and stored. If no projection is informed a default TeNoProjection
-			 will be used as layer projection.
-            \par If a layer with this name already exists it will be retrieved
-	*/
-	TeLayer(const string& name, TeDatabase* db, TeBox& box, TeProjection* proj = 0);
-
-	//! Destructor
-	virtual ~TeLayer();
-
-	//! Copy Constructor
-	TeLayer ( const TeLayer& other );
-
-	//! Operator =
-	TeLayer& operator= ( const TeLayer& other );
-	
-	//! Retrieves the database associated to this layer
-	virtual TeDatabase* const database() 
-	{ return db_; }
-
-	//! Sets the layer database
-	virtual void setDatabase(TeDatabase* db)
-	{ db_ = db; }
-
-	//! Returns the layer id
-	virtual int id()
-	{ return id_; } 
-
-	//! Sets the layer id
-	virtual void id(int id)
-	{ id_ = id; } 
-
-	//! Returns the layer name
-	virtual string name()
-	{ return name_; }
-
-	//! Sets the layer name
-	virtual void name(const string &name)
-	{  name_ = name; }
-
-	//! Sets the  layer projection
-	virtual void  setProjection ( TeProjection* proj );
-
-	//! Retrieves the layer projection
-	virtual TeProjection* projection()
-	{	return projection_; }
-
-	//! Returns the layer bounding box
-	virtual TeBox&	box()
-	{	return box_; }
-
-	//! Sets the  bounding box of a layer
-	virtual void setLayerBox ( const TeBox& box );
-
-	//! Updates the bounding box of a layer
-	virtual void updateLayerBox(const TeBox& box);
-
-	//! Refreshes the bounding box of a layer according to its representation
-	virtual void updateLayerBox();
-
-	//! Returns a possible new object id based on the objects stored in database
-	virtual int getNewObjectId();
-
-	/** @name Attribute Tables
-	*  Methods to deal with the attribute tables of the layer
-	*/
-	//@{
-
-	//! Returns the number of distinct objects in the layer
-	virtual int nObjects(const string& tName);
-
-	//! Returns a vector with the definition of all attribute tables associated to layer
-	virtual TeAttrTableVector& attrTables () 
-	{ return attTables_; }
-
-	//! Creates a new attribute table for the layer
-	virtual bool createAttributeTable(TeTable& table);
-
-    //! Adds an attribute table definition to layer vector of attribute tables (in memory)
-	virtual bool addAttributeTable(TeTable& table);
-
-    //! Remove an attribute table definition to layer vector of attribute tables (in memory)
-	virtual bool removeAttributeTable(string tableName);
-
-     //! Update an attribute table definition to layer vector of attribute tables (in memory)
-	virtual void updateAttributeTable(TeTable& table);
-
-	//! Reload the tables definition from database to memory
-	virtual bool loadLayerTables();
-
-	//! Saves an attribute table into the database where layer is stored 
-	virtual bool saveAttributeTable(TeTable& table);
-
-	//! Gets all attribute tables associated to this layer that are of a certain type
-	virtual bool getAttrTables(TeAttrTableVector& atts, TeAttrTableType attType = TeAllAttrTypes);
-
-	//! Gets a set of attribute table specifications associated to this layer that are of a certain type
-	/*
-		\param tableNames a vector that contains the name of the tables that are being searched
-		\param attType type of table that is being searched
-		\param atts returns a vector of tables found
-		\return true if at least one table was found and false otherwise
-	*/
-	virtual bool getAttrTablesByName(vector<string> &tableNames, TeAttrTableVector& atts, TeAttrTableType attType = TeAllAttrTypes);
-
-	//! Gets an attribute table associated to a layer
-	/*
-		\param tableName name of the table being searched
-		\param attType type of table being searched
-		\param table returns the table found
-		\return true if table was found and false otherwise
-	*/
-	virtual bool getAttrTablesByName(const string& tableName, TeTable& table, TeAttrTableType attType = TeAllAttrTypes);
-
-	//! Gets the name of the media table associated to layer
-	virtual string mediaTable();
-
-	//! Sets the name of the media table associated to layer
-	virtual void mediaTable(const string& name);
-	//@}
-
-	/** @name Geometries
-	*  Methods to deal with the geometries of the objects of a layer
-	*/
-	//! Returns a pointer to the raster geometry associated to an object of this layer
-	/*!
-		\param objectId unique identification of the object (if empty it will look
-		for the first raster geometry found)
-		\param mode permission access ('r', 'w')
-	*/
-	virtual TeRaster* raster(const string& objectId="",const char& mode = 'r');
-
-	//! Sets the pointer to the raster representation
-	virtual void raster( TeRaster* raster);
-
-	//! Retrieves a polygon set given a selection criteria, expressed as a where clause 
-	virtual bool getPolygons(TePolygonSet &ps, const string& whereClause = "");
-
-	//! Retrieves a line set given a selection criteria, expressed as a where clause 
-	virtual bool getLines(TeLineSet &ls, const string& whereClause = "");
-
-	//! Retrieves a point set given a selection criteria, expressed as a where clause 
-	virtual bool getPoints(TePointSet &ps, const string& whereClause = "");
-
-	//! Retrieve a point set given a selection criteria, expressed as a where clause
-	virtual bool getText(TeTextSet &ts, const string& whereClause = "");
-
-	//! Retrieve a cell set given a selection criteria, expressed as a where clause
-	virtual bool getCells(TeCellSet &cs, const string& whereClause = "");
-
-	//! Locates a polygon that cointains a certain coordinate
-	virtual bool locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0);
-	
-	//! Locates a line that cointains a certain coordinate
-	virtual bool locateLine(TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
-
-	//! Retrieves a point that cointains a certain coordinate
-	virtual bool locatePoint(TeCoord2D &pt, TePoint &point, const double& tol = 0.0);
-
-	//! Retrieves a TeText that cointains a certain coordinate
-	virtual bool locateText(TeCoord2D &pt, TeText &text, const double& tol = 0.0);
-
-	//! Retrieves a point that cointains a certain coordinate
-	virtual bool locateCell(TeCoord2D &pt, TeCell &cell, const double& tol = 0.0);
-
-	//! Retrieves the set of polygons with a certain geoid
-	virtual bool loadGeometrySet	(const string& geoid, TePolygonSet &ps);
-
-	//! Retrieves the set of lines with a certain geoid
-	virtual bool loadGeometrySet (const string& geoid, TeLineSet &ls);
-
-	//! Retrieves the set of points with a certain geoid
-	virtual bool loadGeometrySet (const string& geoid, TePointSet &ps);
-
-	//! Retrieves the set of points with a certain geoid
-	virtual bool loadGeometrySet (const string& geoid, TeCellSet &cs);
-
-	//! Retrieves the set of texts with a certain geoid
-	virtual bool loadGeometrySet (const string& geoid, TeTextSet &cs);
-	
-	//! Adds a set of polygons to a layer
-	virtual bool addGeometrySet(TePolygonSet& polySet, const string& /* tName */ = "")
-	{ return addPolygons(polySet); }
-
-	//! Adds a set of lines to a layer
-	virtual bool addGeometrySet(TeLineSet& lineSet, const string& /* tName */ = "")
-	{ return addLines(lineSet); }
-
-	//! Adds a set of points to a layer
-	virtual bool addGeometrySet(TePointSet& pointSet, const string& /* tName */ = "")
-	{ return addPoints(pointSet); }
-
-	//! Adds a set of text to a layer
-	virtual bool addGeometrySet(TeTextSet& textSet, const string& tName = "")
-	{ return addText(textSet,tName); }
-	
-	//! Adds a set of cells to a layer
-	virtual bool addGeometrySet(TeCellSet& cellSet, const string& /* tName */ = "")
-	{ return addCells(cellSet); }
-
-	//! Adds a set of polygons to a layer
-	virtual bool addPolygons(TePolygonSet& polySet);
-
-	//! Adds a set of lines to a layer
-	virtual bool addLines (TeLineSet& lineSet);
-
-	//! Adds a set of points to a layer
-	virtual bool addPoints (TePointSet& pointSet);
-
-	//! Adds a set of text to a layer
-	virtual bool addText (TeTextSet& textSet,const string& tName);
-	
-	//! Adds a set of cells to a layer
-	virtual bool addCells(TeCellSet& cellSet);
-
-	//! Updates a set of polygons to a layer
-	virtual bool updatePolygons(TePolygonSet& polySet);
-
-	//! Updates a set of lines to a layer
-	virtual bool updateLines (TeLineSet& lineSet);
-
-	//! Updates a set of points to a layer
-	virtual bool updatePoints (TePointSet& pointSet);
-
-	//! Updates a set of text to a layer
-	virtual bool updateText (TeTextSet& textSet,const string& tName);
-	
-	//! Updates a set of cells to a layer
-	virtual bool updateCells(TeCellSet& cellSet);
-
-	//! Removes the geometries from the layer
-	virtual bool removeGeometries(const std::vector<int>& vecGeomIds, const TeGeomRep& rep);
-
-	//@}
-
-	/** @name Geometries
-	*  Methods to deal with geometrical representations of a layer
-	*/
-	//! Removes a geometry from layer
-	virtual bool removeGeometry (TeGeomRep repType, const string& tName="");
-
-	//! Indicates if layer has a geometry representation
-	virtual bool hasGeometry (TeGeomRep rep);
-
-    //! Retrieves the table name associated to a geometry representation
-	/*! \param rep geometrical representation
-		\note When there is more than one representation of a given type
-		 returns the table name associated to the first one encountered
-	*/
-	virtual string tableName(TeGeomRep rep); 
-
-	//! Retrieves the number of geometries of a type
-	/*! 
-		\param rep geometrical representation
-	*/	
-	virtual int nGeometries(TeGeomRep rep);
-
-	//! Gets all information about a representation
-	virtual bool getRepresentation(TeGeomRep repType, TeRepresPointerVector& result);
-
-	//! Gets an specific representation
-	/*! 
-		\param repType the geometrical representation being searched
-		\param tableName the table associated to this representation
-		\return the representation associated to a geometry with the given table name
-		\note if no table name is specified the first found is returned
-	*/
-	virtual TeRepresentation* getRepresentation(TeGeomRep repType, const string& tableName="");
-    
-	//! Creates a new geometry representation to a layer
-	/*
-		\param repType the geometrical representation being searched
-		\param tableName name of the table that will stored the geometries
-		\param desc description of the representation
-		\return true if success and false otherwise
-	*/
-	virtual bool addGeometry ( TeGeomRep repType, const string& tableName="", const string& desc = "");
-
-	//! Creates a new raster geometry to a layer
-	/*
-		\param par raster parameters
-		\param objectId identifier of the object that has the raster geometry
-		\param tableName name of the table that will stored the geometries
-		\param desc description of the representation
-		\return true if success and false otherwise
-	*/
-	virtual bool addRasterGeometry(TeRasterParams& par, const string& objectId, 
-						   const string& tableName="", const string& desc="");
-
-	//! Inserts a raster as a geometry of an object of the layer
-	/*
-		\param raster a pointer to a raster object
-		\param objectId identifier of the object that has the raster geometry
-		\param tableName the name of the table that will store the geometry (optional)
-		\return true if success and false otherwise
-		\note if there is already raster geometry associated to the object with id
-		object id, this reference is deleted.
-	*/	
-	bool addRasterGeometry(TeRaster* raster, const string& objectId="");
-
-	//! Inserts a reference to a raster file as a raster geometry of an object of the layer
-	/*
-		\param raster a pointer to a raster object
-		\param objectId identifier of the object that has the raster geometry
-		\param desc the description of the geometry (optional)
-		\return true if success and false otherwise
-		\note if there is already raster geometry associated to the object with id
-		object id, this reference is deleted.
-	*/	
-	bool addRasterFileGeometry(TeRaster* raster, const string& objectId="", const string& desc="");
-
-
-	//! Returns a vector with the identification of all objects of the layer that has a raster representation
-	/*
-		\param objectIds a vector to return the identification of the objects with a raster representation
-		\param tilingType used to express that only some types of representations are looked for: 
-			   0 any kind, 1 only the expansible and 2 only the non-expansible
-		\param box box spatial restriction
-		\return true if layer has at least one raster object and false otherwise
-	*/
-	virtual bool getRasterGeometries(vector<string>& objectIds, unsigned int tilingType=0, const TeBox& box = TeBox());
-
-	//! Returns a combination of all representations in the layer
-	virtual int geomRep();
-
-	//! Adds a representation to vector of representation of the layer
-	virtual void addVectRepres(TeRepresentation* rep)
-	{	repVector_.push_back(rep); }
-
-	//! Returns a vector with all representations in the layer
-	virtual TeRepresPointerVector& vectRepres()
-	{	return repVector_; }
-
-	//!< Returns the dateTime that the layer was last edited.
-	virtual TeTime getEditionTime() const;
-
-	//!< Sets in memory the edition time of the layer
-	virtual void setEditionTime(const TeTime& editionTime);
-
-	//!< Updates the layer last edition time in memory and in the database
-	virtual bool updateLayerEditionTime(const bool& setEditionToNow = true);
-
-	//!< Reloads the edition time from the database 
-	virtual bool reloadLayerEditionTime();
-
-	//@}
-
-private:
-
-// -- Members
-
-// -- General Description of a layer
-
-	string		name_;					//!< layer name
-	int			id_;					//!< layer unique identification
-	TeDatabase*	db_;					//!< database connection to this layer
-	TeProjection*	projection_;		//!< layer projection
-	TeBox		box_;					//!< layer bounding box
-	TeRaster*	raster_;				//!< layer raster representation
-
-	TeAttrTableVector	attTables_; 	//!< Attributes associated to a layer
-	TeRepresPointerVector repVector_;	//!< vector of representations associated to this layer
-	TeTime		editionTime_;			//!< Stores the last time that the layer was edited. 
-};
-
-//! A map from a integer unique identifier to a pointer to layer
-typedef map<int,TeLayer*> TeLayerMap;
-
-/** \example createLayer.cpp
-	Shows how to create a layer in a TerraLib database, and insert some vectorial data in this new layer
- */
-
-/** \example addGeomRepresentation.cpp
-	Shows how to create a point representation (centroid of polygons) to a layer in a TerraLib database.
- */
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeLayer.h
+    \brief This file contains structures and definitions to deal with a layer
+*/
+#ifndef __TERRALIB_INTERNAL_LAYER_H
+#define __TERRALIB_INTERNAL_LAYER_H
+
+#include "TeGeometry.h"
+#include "TeDataTypes.h"
+#include "TeTable.h"
+#include "TeRepresentation.h"
+
+#include <string>
+#include <list>
+#include <map>
+
+class TeRaster;
+class TeDatabase;
+class TeRasterParams;
+class TeProjection;
+
+//!  A class for supporting a layer. 
+/*!  
+	 In TerraLib, a layer is a collection of geometries that share the same 
+     geographical projection, and are related in some way (e.g. a shapefile).
+	 A layer has a pointer to a database that effectively stores its atributes
+	 and geometries.
+	 
+	\sa
+     TeGeometry, TeProjection, TeBox, TeDatabase, TeTheme, TeTable
+*/
+class TL_DLL TeLayer {
+
+public:
+
+	//! Empty constructor
+	TeLayer():
+		id_(-1),
+		db_(0),
+		projection_ ( 0 ),
+		raster_(0)
+		{ }
+
+		
+	//! Constructor with parameters
+	/* 
+		\param name layer name (should be unique)
+		\param db a TerraLib database connection w
+		\param proj layer projection
+		\note 
+			\par If no database is informed, layer will exist only in memory.
+			\par If a layer with this name doesn�t exist a layer will be 
+			 created and stored. If no projection is informed a default TeNoProjection
+			 will be used as layer projection.
+            \par If a layer with this name already exists it will be retrieved
+	*/	 
+	TeLayer(const string& name, TeDatabase* db=0, TeProjection* proj=0);
+
+	//! Constructor with parameters
+	/* 
+		\param name layer name (should be unique)
+		\param db TerraLib database connection where layer will be stored
+		\param box layer bounding box
+		\param proj layer projection
+		\note 
+			\par If no database is informed, layer will exist only in memory.
+			\par If a layer with this name doesn�t exist a layer will be 
+			 created and stored. If no projection is informed a default TeNoProjection
+			 will be used as layer projection.
+            \par If a layer with this name already exists it will be retrieved
+	*/
+	TeLayer(const string& name, TeDatabase* db, TeBox& box, TeProjection* proj = 0);
+
+	//! Destructor
+	virtual ~TeLayer();
+
+	//! Copy Constructor
+	TeLayer ( const TeLayer& other );
+
+	//! Operator =
+	TeLayer& operator= ( const TeLayer& other );
+	
+	//! Retrieves the database associated to this layer
+	virtual TeDatabase* const database() 
+	{ return db_; }
+
+	//! Sets the layer database
+	virtual void setDatabase(TeDatabase* db)
+	{ db_ = db; }
+
+	//! Returns the layer id
+	virtual int id()
+	{ return id_; } 
+
+	//! Sets the layer id
+	virtual void id(int id)
+	{ id_ = id; } 
+
+	//! Returns the layer name
+	virtual string name()
+	{ return name_; }
+
+	//! Sets the layer name
+	virtual void name(const string &name)
+	{  name_ = name; }
+
+	//! Sets the  layer projection
+	virtual void  setProjection ( TeProjection* proj );
+
+	//! Retrieves the layer projection
+	virtual TeProjection* projection()
+	{	return projection_; }
+
+	//! Returns the layer bounding box
+	virtual TeBox&	box()
+	{	return box_; }
+
+	//! Sets the  bounding box of a layer
+	virtual void setLayerBox ( const TeBox& box );
+
+	//! Updates the bounding box of a layer
+	virtual void updateLayerBox(const TeBox& box);
+
+	//! Refreshes the bounding box of a layer according to its representation
+	virtual void updateLayerBox();
+
+	//! Returns a possible new object id based on the objects stored in database
+	virtual int getNewObjectId();
+
+	/** @name Attribute Tables
+	*  Methods to deal with the attribute tables of the layer
+	*/
+	//@{
+
+	//! Returns the number of distinct objects in the layer
+	virtual int nObjects(const string& tName);
+
+	//! Returns a vector with the definition of all attribute tables associated to layer
+	virtual TeAttrTableVector& attrTables () 
+	{ return attTables_; }
+
+  //! Returns a vector with the definition of all attribute tables associated to layer
+	virtual const TeAttrTableVector& attrTables () const
+	{ return attTables_; }
+
+	//! Creates a new attribute table for the layer
+	virtual bool createAttributeTable(TeTable& table);
+
+    //! Adds an attribute table definition to layer vector of attribute tables (in memory)
+	virtual bool addAttributeTable(TeTable& table);
+
+    //! Remove an attribute table definition to layer vector of attribute tables (in memory)
+	virtual bool removeAttributeTable(string tableName);
+
+     //! Update an attribute table definition to layer vector of attribute tables (in memory)
+	virtual void updateAttributeTable(TeTable& table);
+
+	//! Reload the tables definition from database to memory
+	virtual bool loadLayerTables();
+
+	//! Saves an attribute table into the database where layer is stored 
+	virtual bool saveAttributeTable(TeTable& table);
+
+	//! Gets all attribute tables associated to this layer that are of a certain type
+	virtual bool getAttrTables(TeAttrTableVector& atts, TeAttrTableType attType = TeAllAttrTypes);
+
+	//! Gets a set of attribute table specifications associated to this layer that are of a certain type
+	/*
+		\param tableNames a vector that contains the name of the tables that are being searched
+		\param attType type of table that is being searched
+		\param atts returns a vector of tables found
+		\return true if at least one table was found and false otherwise
+	*/
+	virtual bool getAttrTablesByName(vector<string> &tableNames, TeAttrTableVector& atts, TeAttrTableType attType = TeAllAttrTypes);
+
+	//! Gets an attribute table associated to a layer
+	/*
+		\param tableName name of the table being searched
+		\param attType type of table being searched
+		\param table returns the table found
+		\return true if table was found and false otherwise
+	*/
+	virtual bool getAttrTablesByName(const string& tableName, TeTable& table, TeAttrTableType attType = TeAllAttrTypes);
+
+	//! Gets the name of the media table associated to layer
+	virtual string mediaTable();
+
+	//! Sets the name of the media table associated to layer
+	virtual void mediaTable(const string& name);
+	//@}
+
+	/** @name Geometries
+	*  Methods to deal with the geometries of the objects of a layer
+	*/
+	//! Returns a pointer to the raster geometry associated to an object of this layer
+	/*!
+		\param objectId unique identification of the object (if empty it will look
+		for the first raster geometry found)
+		\param mode permission access ('r', 'w')
+	*/
+	virtual TeRaster* raster(const string& objectId="",const char& mode = 'r');
+
+	//! Sets the pointer to the raster representation
+	virtual void raster( TeRaster* raster);
+
+	//! Retrieves a polygon set given a selection criteria, expressed as a where clause 
+	virtual bool getPolygons(TePolygonSet &ps, const string& whereClause = "");
+
+	//! Retrieves a line set given a selection criteria, expressed as a where clause 
+	virtual bool getLines(TeLineSet &ls, const string& whereClause = "");
+
+	//! Retrieves a point set given a selection criteria, expressed as a where clause 
+	virtual bool getPoints(TePointSet &ps, const string& whereClause = "");
+
+	//! Retrieve a point set given a selection criteria, expressed as a where clause
+	virtual bool getText(TeTextSet &ts, const string& whereClause = "");
+
+	//! Retrieve a cell set given a selection criteria, expressed as a where clause
+	virtual bool getCells(TeCellSet &cs, const string& whereClause = "");
+
+	//! Locates a polygon that cointains a certain coordinate
+	virtual bool locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0);
+	
+	//! Locates a line that cointains a certain coordinate
+	virtual bool locateLine(TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
+
+	//! Retrieves a point that cointains a certain coordinate
+	virtual bool locatePoint(TeCoord2D &pt, TePoint &point, const double& tol = 0.0);
+
+	//! Retrieves a TeText that cointains a certain coordinate
+	virtual bool locateText(TeCoord2D &pt, TeText &text, const double& tol = 0.0);
+
+	//! Retrieves a point that cointains a certain coordinate
+	virtual bool locateCell(TeCoord2D &pt, TeCell &cell, const double& tol = 0.0);
+
+	//! Retrieves the set of polygons with a certain geoid
+	virtual bool loadGeometrySet	(const string& geoid, TePolygonSet &ps);
+
+	//! Retrieves the set of lines with a certain geoid
+	virtual bool loadGeometrySet (const string& geoid, TeLineSet &ls);
+
+	//! Retrieves the set of points with a certain geoid
+	virtual bool loadGeometrySet (const string& geoid, TePointSet &ps);
+
+	//! Retrieves the set of points with a certain geoid
+	virtual bool loadGeometrySet (const string& geoid, TeCellSet &cs);
+
+	//! Retrieves the set of texts with a certain geoid
+	virtual bool loadGeometrySet (const string& geoid, TeTextSet &cs);
+	
+	//! Adds a set of polygons to a layer
+	virtual bool addGeometrySet(TePolygonSet& polySet, const string& /* tName */ = "")
+	{ return addPolygons(polySet); }
+
+	//! Adds a set of lines to a layer
+	virtual bool addGeometrySet(TeLineSet& lineSet, const string& /* tName */ = "")
+	{ return addLines(lineSet); }
+
+	//! Adds a set of points to a layer
+	virtual bool addGeometrySet(TePointSet& pointSet, const string& /* tName */ = "")
+	{ return addPoints(pointSet); }
+
+	//! Adds a set of text to a layer
+	virtual bool addGeometrySet(TeTextSet& textSet, const string& tName = "")
+	{ return addText(textSet,tName); }
+	
+	//! Adds a set of cells to a layer
+	virtual bool addGeometrySet(TeCellSet& cellSet, const string& /* tName */ = "")
+	{ return addCells(cellSet); }
+
+	//! Adds a set of polygons to a layer
+	virtual bool addPolygons(TePolygonSet& polySet);
+
+	//! Adds a set of lines to a layer
+	virtual bool addLines (TeLineSet& lineSet);
+
+	//! Adds a set of points to a layer
+	virtual bool addPoints (TePointSet& pointSet);
+
+	//! Adds a set of text to a layer
+	virtual bool addText (TeTextSet& textSet,const string& tName);
+	
+	//! Adds a set of cells to a layer
+	virtual bool addCells(TeCellSet& cellSet);
+
+	//! Updates a set of polygons to a layer
+	virtual bool updatePolygons(TePolygonSet& polySet);
+
+	//! Updates a set of lines to a layer
+	virtual bool updateLines (TeLineSet& lineSet);
+
+	//! Updates a set of points to a layer
+	virtual bool updatePoints (TePointSet& pointSet);
+
+	//! Updates a set of text to a layer
+	virtual bool updateText (TeTextSet& textSet,const string& tName);
+	
+	//! Updates a set of cells to a layer
+	virtual bool updateCells(TeCellSet& cellSet);
+
+	//! Removes the geometries from the layer
+	virtual bool removeGeometries(const std::vector<int>& vecGeomIds, const TeGeomRep& rep);
+
+	//@}
+
+	/** @name Geometries
+	*  Methods to deal with geometrical representations of a layer
+	*/
+	//! Removes a geometry from layer
+	virtual bool removeGeometry (TeGeomRep repType, const string& tName="");
+
+	//! Indicates if layer has a geometry representation
+	virtual bool hasGeometry (TeGeomRep rep);
+
+    //! Retrieves the table name associated to a geometry representation
+	/*! \param rep geometrical representation
+		\note When there is more than one representation of a given type
+		 returns the table name associated to the first one encountered
+	*/
+	virtual string tableName(TeGeomRep rep); 
+
+	//! Retrieves the number of geometries of a type
+	/*! 
+		\param rep geometrical representation
+	*/	
+	virtual int nGeometries(TeGeomRep rep);
+
+	//! Gets all information about a representation
+	virtual bool getRepresentation(TeGeomRep repType, TeRepresPointerVector& result);
+
+	//! Gets an specific representation
+	/*! 
+		\param repType the geometrical representation being searched
+		\param tableName the table associated to this representation
+		\return the representation associated to a geometry with the given table name
+		\note if no table name is specified the first found is returned
+	*/
+	virtual TeRepresentation* getRepresentation(TeGeomRep repType, const string& tableName="");
+    
+	//! Creates a new geometry representation to a layer
+	/*
+		\param repType the geometrical representation being searched
+		\param tableName name of the table that will stored the geometries
+		\param desc description of the representation
+		\return true if success and false otherwise
+	*/
+	virtual bool addGeometry ( TeGeomRep repType, const string& tableName="", const string& desc = "");
+
+	//! Creates a new raster geometry to a layer
+	/*
+		\param par raster parameters
+		\param objectId identifier of the object that has the raster geometry
+		\param tableName name of the table that will stored the geometries
+		\param desc description of the representation
+		\return true if success and false otherwise
+	*/
+	virtual bool addRasterGeometry(TeRasterParams& par, const string& objectId, 
+						   const string& tableName="", const string& desc="");
+
+	//! Inserts a raster as a geometry of an object of the layer
+	/*
+		\param raster a pointer to a raster object
+		\param objectId identifier of the object that has the raster geometry
+		\param tableName the name of the table that will store the geometry (optional)
+		\return true if success and false otherwise
+		\note if there is already raster geometry associated to the object with id
+		object id, this reference is deleted.
+	*/	
+	bool addRasterGeometry(TeRaster* raster, const string& objectId="");
+
+	//! Inserts a reference to a raster file as a raster geometry of an object of the layer
+	/*
+		\param raster a pointer to a raster object
+		\param objectId identifier of the object that has the raster geometry
+		\param desc the description of the geometry (optional)
+		\return true if success and false otherwise
+		\note if there is already raster geometry associated to the object with id
+		object id, this reference is deleted.
+	*/	
+	bool addRasterFileGeometry(TeRaster* raster, const string& objectId="", const string& desc="");
+
+
+	//! Returns a vector with the identification of all objects of the layer that has a raster representation
+	/*
+		\param objectIds a vector to return the identification of the objects with a raster representation
+		\param tilingType used to express that only some types of representations are looked for: 
+			   0 any kind, 1 only the expansible and 2 only the non-expansible
+		\param box box spatial restriction
+		\return true if layer has at least one raster object and false otherwise
+	*/
+	virtual bool getRasterGeometries(vector<string>& objectIds, unsigned int tilingType=0, const TeBox& box = TeBox());
+
+	//! Returns a combination of all representations in the layer
+	virtual int geomRep();
+
+	//! Adds a representation to vector of representation of the layer
+	virtual void addVectRepres(TeRepresentation* rep)
+	{	repVector_.push_back(rep); }
+
+	//! Returns a vector with all representations in the layer
+	virtual TeRepresPointerVector& vectRepres()
+	{	return repVector_; }
+
+  virtual const TeRepresPointerVector& vectRepres() const
+	{	return repVector_; }
+
+	//!< Returns the dateTime that the layer was last edited.
+	virtual TeTime getEditionTime() const;
+
+	//!< Sets in memory the edition time of the layer
+	virtual void setEditionTime(const TeTime& editionTime);
+
+	//!< Updates the layer last edition time in memory and in the database
+	virtual bool updateLayerEditionTime(const bool& setEditionToNow = true);
+
+	//!< Reloads the edition time from the database 
+	virtual bool reloadLayerEditionTime();
+
+	//@}
+
+private:
+
+// -- Members
+
+// -- General Description of a layer
+
+	string		name_;					//!< layer name
+	int			id_;					//!< layer unique identification
+	TeDatabase*	db_;					//!< database connection to this layer
+	TeProjection*	projection_;		//!< layer projection
+	TeBox		box_;					//!< layer bounding box
+	TeRaster*	raster_;				//!< layer raster representation
+
+	TeAttrTableVector	attTables_; 	//!< Attributes associated to a layer
+	TeRepresPointerVector repVector_;	//!< vector of representations associated to this layer
+	TeTime		editionTime_;			//!< Stores the last time that the layer was edited. 
+};
+
+//! A map from a integer unique identifier to a pointer to layer
+typedef map<int,TeLayer*> TeLayerMap;
+
+/** \example createLayer.cpp
+	Shows how to create a layer in a TerraLib database, and insert some vectorial data in this new layer
+ */
+
+/** \example addGeomRepresentation.cpp
+	Shows how to create a point representation (centroid of polygons) to a layer in a TerraLib database.
+ */
+#endif
+
diff --git a/src/terralib/kernel/TeLegendEntry.cpp b/src/terralib/kernel/TeLegendEntry.cpp
old mode 100755
new mode 100644
index 1bd257f..9a4ce1f
--- a/src/terralib/kernel/TeLegendEntry.cpp
+++ b/src/terralib/kernel/TeLegendEntry.cpp
@@ -1,174 +1,174 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include <TeLegendEntry.h>
-
-TeLegendEntry::TeLegendEntry(const TeSlice& slice) :
-	slice_(slice),
-	id_(-1),
-	theme_(0),
-	group_(0)
-{
-	if (slice_.from_ == "Missing Data")
-		label_ = "Missing Data";
-	else 
-	{
-		int i = slice_.from_.find("mean = ");
-		if (i >= 0 || slice_.to_.empty())
-			label_ = slice_.from_;
-		else
-			label_ = slice_.from_ + " ~ " + slice_.to_;
-	}
-}
-
-
-TeLegendEntry::TeLegendEntry (const TeLegendEntry& leg)
-{
-	*this = leg;
-}
-
-TeLegendEntry&
-TeLegendEntry::operator = (const TeLegendEntry& leg)
-{
-	if ( this != &leg )
-	{	//clears the current map
-		TeGeomRepVisualMap::iterator currMapIt = visualMap_.begin();
-		while( currMapIt != visualMap_.end() )
-		{
-			if (currMapIt->second)
-			{
-				delete currMapIt->second;
-				currMapIt->second = NULL;
-			}				
-			++currMapIt;
-		}
-		visualMap_.clear();
-			
-		//copy the new map
-		TeGeomRepVisualMap::const_iterator it = leg.visualMap_.begin();
-		while( it != leg.visualMap_.end() )
-		{
-			if (it->second)
-			{
-				TeVisual* visual = it->second->copy();
-				visualMap_[ it->first ] = visual;
-			}
-			++it;
-		}
-		slice_ = leg.slice_;
-		label_ = leg.label_;
-		id_ = leg.id_;
-		theme_ = leg.theme_;
-		group_ = leg.group_;
-	}
-	return *this;
-}
-
-void
-TeLegendEntry::clear()
-{
-	slice_.from_.clear();
-	slice_.to_.clear();
-	label_.clear();
-
-	//clears the current map
-	TeGeomRepVisualMap::iterator currMapIt = visualMap_.begin();
-	while( currMapIt != visualMap_.end() )
-	{
-		if (currMapIt->second)
-		{
-			delete currMapIt->second;
-			currMapIt->second = NULL;
-		}
-		++currMapIt;
-	}
-	visualMap_.clear();
-}
-
-string 
-TeLegendEntry::label()
-{
-    if (label_.empty())
-    {
-        int npos = slice_.from_.find("mean = ");
-        if (npos >= 0 || slice_.to_.empty())
-            label_ = slice_.from_;
-        else 
-            label_ = slice_.from_ + " ~ " + slice_.to_;
-    }
-    return label_;
-} 
-
-TeVisual*
-TeLegendEntry::visual(TeGeomRep rep, const string& visualType)
-{ 
-	if(visualMap_.find(rep) == visualMap_.end())
-	{
-		TeVisual* visual = TeVisualFactory::make(visualType);
-        visualMap_[rep] = visual; 
-	}
-	return visualMap_[rep];
-}
-
-void 
-TeLegendEntry::color( TeColor& color )
-{
-	if(visualMap_.find(TePOLYGONS) != visualMap_.end())
-	{
-		TeVisual* tmpVisual = visualMap_[TePOLYGONS];
-		if (tmpVisual)
-		{
-			tmpVisual->color( color );
-			if ( tmpVisual->style() != 1 ) 
-				tmpVisual->contourColor( color );
-		}		
-	}
-	if(visualMap_.find(TeLINES) != visualMap_.end())
-	{
-		TeVisual* tmpVisual = visualMap_[TeLINES];
-		if (tmpVisual)
-			tmpVisual->color( color );
-	}
-	if(visualMap_.find(TePOINTS) != visualMap_.end())	
-	{
-		TeVisual* tmpVisual = visualMap_[TePOINTS];
-		if (tmpVisual)
-			tmpVisual->color( color );
-	}
-}
-
-void 
-TeLegendEntry::setVisual(TeVisual* vis, TeGeomRep rep) 
-{ 
-	if ( visualMap_.find(rep) != visualMap_.end() )
-	{
-		if ((visualMap_[rep] != NULL) && (visualMap_[rep] != vis))
-			delete visualMap_[rep];
-	}	
-	visualMap_[rep] = vis; 
-}
-
-void 
-TeLegendEntry::setVisual(TeVisual& vis, TeGeomRep rep) 
-{
-	return (setVisual(vis.copy(), rep));
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include <TeLegendEntry.h>
+
+TeLegendEntry::TeLegendEntry(const TeSlice& slice) :
+	slice_(slice),
+	id_(-1),
+	theme_(0),
+	group_(0)
+{
+	if (slice_.from_ == "Missing Data")
+		label_ = "Missing Data";
+	else 
+	{
+		int i = slice_.from_.find("mean = ");
+		if (i >= 0 || slice_.to_.empty())
+			label_ = slice_.from_;
+		else
+			label_ = slice_.from_ + " ~ " + slice_.to_;
+	}
+}
+
+
+TeLegendEntry::TeLegendEntry (const TeLegendEntry& leg)
+{
+	*this = leg;
+}
+
+TeLegendEntry&
+TeLegendEntry::operator = (const TeLegendEntry& leg)
+{
+	if ( this != &leg )
+	{	//clears the current map
+		TeGeomRepVisualMap::iterator currMapIt = visualMap_.begin();
+		while( currMapIt != visualMap_.end() )
+		{
+			if (currMapIt->second)
+			{
+				delete currMapIt->second;
+				currMapIt->second = NULL;
+			}				
+			++currMapIt;
+		}
+		visualMap_.clear();
+			
+		//copy the new map
+		TeGeomRepVisualMap::const_iterator it = leg.visualMap_.begin();
+		while( it != leg.visualMap_.end() )
+		{
+			if (it->second)
+			{
+				TeVisual* visual = it->second->copy();
+				visualMap_[ it->first ] = visual;
+			}
+			++it;
+		}
+		slice_ = leg.slice_;
+		label_ = leg.label_;
+		id_ = leg.id_;
+		theme_ = leg.theme_;
+		group_ = leg.group_;
+	}
+	return *this;
+}
+
+void
+TeLegendEntry::clear()
+{
+	slice_.from_.clear();
+	slice_.to_.clear();
+	label_.clear();
+
+	//clears the current map
+	TeGeomRepVisualMap::iterator currMapIt = visualMap_.begin();
+	while( currMapIt != visualMap_.end() )
+	{
+		if (currMapIt->second)
+		{
+			delete currMapIt->second;
+			currMapIt->second = NULL;
+		}
+		++currMapIt;
+	}
+	visualMap_.clear();
+}
+
+string 
+TeLegendEntry::label()
+{
+    if (label_.empty())
+    {
+        int npos = slice_.from_.find("mean = ");
+        if (npos >= 0 || slice_.to_.empty())
+            label_ = slice_.from_;
+        else 
+            label_ = slice_.from_ + " ~ " + slice_.to_;
+    }
+    return label_;
+} 
+
+TeVisual*
+TeLegendEntry::visual(TeGeomRep rep, const string& visualType)
+{ 
+	if(visualMap_.find(rep) == visualMap_.end())
+	{
+		TeVisual* visual = TeVisualFactory::make(visualType);
+        visualMap_[rep] = visual; 
+	}
+	return visualMap_[rep];
+}
+
+void 
+TeLegendEntry::color( TeColor& color )
+{
+	if(visualMap_.find(TePOLYGONS) != visualMap_.end())
+	{
+		TeVisual* tmpVisual = visualMap_[TePOLYGONS];
+		if (tmpVisual)
+		{
+			tmpVisual->color( color );
+			if ( tmpVisual->style() != 1 ) 
+				tmpVisual->contourColor( color );
+		}		
+	}
+	if(visualMap_.find(TeLINES) != visualMap_.end())
+	{
+		TeVisual* tmpVisual = visualMap_[TeLINES];
+		if (tmpVisual)
+			tmpVisual->color( color );
+	}
+	if(visualMap_.find(TePOINTS) != visualMap_.end())	
+	{
+		TeVisual* tmpVisual = visualMap_[TePOINTS];
+		if (tmpVisual)
+			tmpVisual->color( color );
+	}
+}
+
+void 
+TeLegendEntry::setVisual(TeVisual* vis, TeGeomRep rep) 
+{ 
+	if ( visualMap_.find(rep) != visualMap_.end() )
+	{
+		if ((visualMap_[rep] != NULL) && (visualMap_[rep] != vis))
+			delete visualMap_[rep];
+	}	
+	visualMap_[rep] = vis; 
+}
+
+void 
+TeLegendEntry::setVisual(TeVisual& vis, TeGeomRep rep) 
+{
+	return (setVisual(vis.copy(), rep));
+}
diff --git a/src/terralib/kernel/TeLegendEntry.h b/src/terralib/kernel/TeLegendEntry.h
old mode 100755
new mode 100644
index 874c845..3bd8884
--- a/src/terralib/kernel/TeLegendEntry.h
+++ b/src/terralib/kernel/TeLegendEntry.h
@@ -1,168 +1,168 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeLegendEntry.h
-    \brief This file deals with legends in TerraLib
-*/
-#ifndef  __TERRALIB_INTERNAL_LEGENDENTRY_H
-#define  __TERRALIB_INTERNAL_LEGENDENTRY_H
-
-#include <string>
-#include <vector>
-#include <map>
-
-using namespace std;
-
-#include "TeUtils.h"
-#include "TeDataTypes.h"
-#include "TeSlice.h"
-#include "TeVisual.h"
-
-class TeTheme;
-struct TeColor;
-
-//! A map from representation types to a presentation visual characteristics
-typedef map<TeGeomRep,TeVisual*> TeGeomRepVisualMap;
-
-
-//! A Legend Entry represents a group of objects of a theme
-/*!
-	A legend entry is associated to a  group of a theme. It has a label and a TeSlice
-	that defines a property of of the objects that fall into this legend.
-	A legend entry has an associated label and the visual presentation characteristics 
-	of the objects that fall into this legend.
-*/
-class TL_DLL TeLegendEntry
-{
-public:
-
-	//! Empty constructor
-	TeLegendEntry () : 
-		label_(""),
-		id_(-1),
-		theme_(0),
-		group_(0)
-		{}
-
-	//! Constructor from a slice
-	TeLegendEntry (const TeSlice& slice);
-	
-	//! Copy constructor
-	TeLegendEntry (const TeLegendEntry& leg);
-
-	//! Operator =
-	TeLegendEntry& operator = (const TeLegendEntry& leg);
-
-	//! Destructor
-	virtual ~TeLegendEntry()
-	{	clear(); }
-
-	//! Clear the legend
-	void clear();
-
-	//! Returns the legend id
-	int	id () 
-	{ return id_; }
-	//! Sets the legend id
-	void id (int i) { id_ = i; }
-
-	//! Returns the theme identifier to which the legend belongs
-	int	theme () { return theme_; }
-	//! Sets the theme id to which this legend belongs to
-	void theme (int i) { theme_ = i; }
-
-	//! Returns the group identifier associated to the legend
-	int	group () { return group_; }
-	//! Sets the group identification to which this legend refers to
-	void group (int i) { group_ = i; }
-
-	//! Returns the visual presentation characteristics associated to a given representation
-	TeVisual* visual (TeGeomRep rep, const string& visualType="tevisual");
-
-	//! Sets the visual presentation characteristics associated to a given representation
-	void setVisual (TeVisual* vis, TeGeomRep rep); 
-
-	//! Sets the visual presentation characteristics associated to a given representation
-	void setVisual (TeVisual& vis, TeGeomRep rep); 
-	
-	//! Return the visual presentation characteristics map
-	TeGeomRepVisualMap& getVisualMap()
-	{	return visualMap_; }
-
-	//! Returns the slice associated to this legend
-	TeSlice& slice()
-	{  return slice_; }
-	// Sets the slice associated to this legend
-	void setSlice(const TeSlice& sl)
-	{	slice_ = sl; }
-	//! Returns the number of objects of the legend
-	int count() 
-	{ return slice_.count_; }
-	//! Sets the number of objects with the legend
-	void count(int n) 
-	{ slice_.count_ = n; }
-	//! Increase the number of objects with the legend
-	void incCount(int n=1)
-	{	slice_.count_ += n; }
-	
-	//! Returns the lower value associated to the legend
-	string from()
-	{	return slice_.from_; }
-	//! Sets the lower value associated to the legend
-	void from(string& s)
-	{ slice_.from_ = s; }
-
-	//! Returns the upper value associated to the legend
-	string to()
-	{	return slice_.to_; }
-	//! Sets the upper value associated to the legend
-	void to(string& s)
-	{	slice_.to_ = s; }
-
-	//! Returns the label associated to the legend 
-	string label();
-	
-	//! Sets the label associated to the legend
-	void label(string& s)
-	{	label_ = s; }
-
-	//! Sets the color associated to the legend
-	void color(TeColor& color);
-
-private:
-
-	TeGeomRepVisualMap	visualMap_;
-	TeSlice				slice_;
-	string				label_;
-	int					id_;
-	int					theme_;
-	int					group_;
-};
-
-//! A vector of legendy entries
-typedef vector<TeLegendEntry> TeLegendEntryVector;
-
-//! A map of legend identifiers to legend entrie pointers
-typedef map<int, TeLegendEntry*> TeLegendEntryMap;
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeLegendEntry.h
+    \brief This file deals with legends in TerraLib
+*/
+#ifndef  __TERRALIB_INTERNAL_LEGENDENTRY_H
+#define  __TERRALIB_INTERNAL_LEGENDENTRY_H
+
+#include <string>
+#include <vector>
+#include <map>
+
+using namespace std;
+
+#include "TeUtils.h"
+#include "TeDataTypes.h"
+#include "TeSlice.h"
+#include "TeVisual.h"
+
+class TeTheme;
+struct TeColor;
+
+//! A map from representation types to a presentation visual characteristics
+typedef map<TeGeomRep,TeVisual*> TeGeomRepVisualMap;
+
+
+//! A Legend Entry represents a group of objects of a theme
+/*!
+	A legend entry is associated to a  group of a theme. It has a label and a TeSlice
+	that defines a property of of the objects that fall into this legend.
+	A legend entry has an associated label and the visual presentation characteristics 
+	of the objects that fall into this legend.
+*/
+class TL_DLL TeLegendEntry
+{
+public:
+
+	//! Empty constructor
+	TeLegendEntry () : 
+		label_(""),
+		id_(-1),
+		theme_(0),
+		group_(0)
+		{}
+
+	//! Constructor from a slice
+	TeLegendEntry (const TeSlice& slice);
+	
+	//! Copy constructor
+	TeLegendEntry (const TeLegendEntry& leg);
+
+	//! Operator =
+	TeLegendEntry& operator = (const TeLegendEntry& leg);
+
+	//! Destructor
+	virtual ~TeLegendEntry()
+	{	clear(); }
+
+	//! Clear the legend
+	void clear();
+
+	//! Returns the legend id
+	int	id () 
+	{ return id_; }
+	//! Sets the legend id
+	void id (int i) { id_ = i; }
+
+	//! Returns the theme identifier to which the legend belongs
+	int	theme () { return theme_; }
+	//! Sets the theme id to which this legend belongs to
+	void theme (int i) { theme_ = i; }
+
+	//! Returns the group identifier associated to the legend
+	int	group () { return group_; }
+	//! Sets the group identification to which this legend refers to
+	void group (int i) { group_ = i; }
+
+	//! Returns the visual presentation characteristics associated to a given representation
+	TeVisual* visual (TeGeomRep rep, const string& visualType="tevisual");
+
+	//! Sets the visual presentation characteristics associated to a given representation
+	void setVisual (TeVisual* vis, TeGeomRep rep); 
+
+	//! Sets the visual presentation characteristics associated to a given representation
+	void setVisual (TeVisual& vis, TeGeomRep rep); 
+	
+	//! Return the visual presentation characteristics map
+	TeGeomRepVisualMap& getVisualMap()
+	{	return visualMap_; }
+
+	//! Returns the slice associated to this legend
+	TeSlice& slice()
+	{  return slice_; }
+	// Sets the slice associated to this legend
+	void setSlice(const TeSlice& sl)
+	{	slice_ = sl; }
+	//! Returns the number of objects of the legend
+	int count() 
+	{ return slice_.count_; }
+	//! Sets the number of objects with the legend
+	void count(int n) 
+	{ slice_.count_ = n; }
+	//! Increase the number of objects with the legend
+	void incCount(int n=1)
+	{	slice_.count_ += n; }
+	
+	//! Returns the lower value associated to the legend
+	string from()
+	{	return slice_.from_; }
+	//! Sets the lower value associated to the legend
+	void from(string& s)
+	{ slice_.from_ = s; }
+
+	//! Returns the upper value associated to the legend
+	string to()
+	{	return slice_.to_; }
+	//! Sets the upper value associated to the legend
+	void to(string& s)
+	{	slice_.to_ = s; }
+
+	//! Returns the label associated to the legend 
+	string label();
+	
+	//! Sets the label associated to the legend
+	void label(string& s)
+	{	label_ = s; }
+
+	//! Sets the color associated to the legend
+	void color(TeColor& color);
+
+private:
+
+	TeGeomRepVisualMap	visualMap_;
+	TeSlice				slice_;
+	string				label_;
+	int					id_;
+	int					theme_;
+	int					group_;
+};
+
+//! A vector of legendy entries
+typedef vector<TeLegendEntry> TeLegendEntryVector;
+
+//! A map of legend identifiers to legend entrie pointers
+typedef map<int, TeLegendEntry*> TeLegendEntryMap;
+
+#endif
+
diff --git a/src/terralib/kernel/TeMappedMemory.cpp b/src/terralib/kernel/TeMappedMemory.cpp
old mode 100755
new mode 100644
index 920047f..93f39ba
--- a/src/terralib/kernel/TeMappedMemory.cpp
+++ b/src/terralib/kernel/TeMappedMemory.cpp
@@ -1,421 +1,421 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeMappedMemory.h"
-#include "TeException.h"
-#include "TeErrorLog.h"
-#include "TeUtils.h"
-#include "TeAgnostic.h"
-#include "TeDefines.h"
-#include "TeTempFilesRemover.h"
-
-#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  #include <io.h>
-  #include <fcntl.h>
-  #include <sys/stat.h>  
-#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-  #include <sys/types.h>
-  #include <sys/stat.h>
-  #include <fcntl.h>
-  #include <unistd.h>
-#else
-  #error "Unsupported platform"
-#endif
-
-
-void TeMappedMemory::init()
-{
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    m_hFile_ = 0;
-    m_hMapping_ = 0;
-    m_lpszFile_ = 0;
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-    m_hFile_ = 0;
-    m_lpszFile_ = 0;
-  #else
-    #error "Unsupported platform"
-  #endif
-  
-  mapping_is_active_ = false;
-  curr_size_ = 0;
-  must_delete_file_ = false;
-};
-
-
-TeMappedMemory::TeMappedMemory()
-{
-  init();
-}
-
-
-TeMappedMemory::~TeMappedMemory()
-{
-  reset();
-}
-
-
-void TeMappedMemory::reset()
-{
-  TEAGN_TRUE_OR_THROW( toggle( false ), "Error disabling mapped memory" );
-  
-  if( must_delete_file_ ) {
-    TeTempFilesRemover::instance().removeFile(disk_file_name_);
-  }
-  
-  disk_file_name_.clear();
-  
-  init();
-}
-
-
-bool TeMappedMemory::reset( unsigned long int size, bool enabled )
-{
-  reset();
-  
-  std::string disk_file_name;
-      
-  TEAGN_TRUE_OR_RETURN( TeGetTempFileName( disk_file_name ),
-    "Unable to get temporary file name" );
-    
-  return( reset( disk_file_name, size, false, enabled ) );
-}
-
-
-bool TeMappedMemory::reset( const std::string& filename, 
-  unsigned long int size, bool keep_disk_file, bool enabled )
-{
-  reset();
-
-  if( filename.empty() || ( size == 0 ) ) {
-    TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
-      "Invalid mapped file name or invalid file size" ); 
-            
-    return false;
-  } else {
-    TEAGN_TRUE_OR_RETURN( createNewDiskFile( filename, size ),
-      "Unable to create memory mapped disk file" );
-      
-    disk_file_name_ = filename;
-    must_delete_file_ = ( ! keep_disk_file );
-    
-    if( must_delete_file_ )
-    {
-      TeTempFilesRemover::instance().addFile( filename );
-    }
-    
-    if( toggle( enabled ) ) {
-      return true;
-    } else {
-      reset();
-      return false;
-    }
-  }
-}
-
-
-bool TeMappedMemory::reset( const std::string& filename, bool enabled )
-{
-  reset();
-  
-  disk_file_name_ = filename;
-  
-  if( toggle( enabled ) ) {
-    return true;
-  } else {
-    reset();
-    return false;
-  }  
-}
-
-
-bool TeMappedMemory::toggle( bool enabled )
-{
-  if( enabled  ) {
-    if( mapping_is_active_ ) {
-      return true;    
-    } else {
-      curr_size_ = 0;
-      
-      /* Activating mapping */    
-      
-      if( ! TeCheckFileExistence( disk_file_name_.c_str() ) ) {
-        return false;
-      }
-      
-      unsigned long int filesize = TeGetFileSize( disk_file_name_ );
-  
-      if( filesize > 0 ) {
-        #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-      
-          HANDLE m_hFile = CreateFileA(
-            disk_file_name_.c_str(), GENERIC_READ | GENERIC_WRITE, 
-            FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
-            0, NULL);
-        
-          if( m_hFile == INVALID_HANDLE_VALUE ) {
-            TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
-              "Temporary file creation error" );        
-       
-            return false;
-          }
-  
-          HANDLE m_hMapping = CreateFileMapping( m_hFile, NULL, PAGE_READWRITE,
-            0, 0, NULL );
-              
-          if( m_hMapping == NULL ) {
-            CloseHandle(m_hFile);
-        
-            TEAGN_LOGERR( "Mapping creation error - " +
-              getLastErrorStr() );
-              
-            return false;        
-          }
-        
-          LPVOID m_lpszFile = (LPVOID) MapViewOfFile( m_hMapping, 
-            FILE_MAP_ALL_ACCESS, 0, 0, 0);
-      
-          if( m_lpszFile == 0 ) {
-            CloseHandle( m_hMapping );
-            CloseHandle( m_hFile );
-            
-            TEAGN_LOGERR( "Mapping view creation error - " +
-              getLastErrorStr() );
-            
-            return false;        
-          }        
-      
-          m_hFile_ = m_hFile;
-          m_hMapping_ = m_hMapping;
-          m_lpszFile_ = m_lpszFile;
-          
-        #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-        
-          int m_hFile = open( disk_file_name_.c_str(), O_RDWR );
-
-          if( m_hFile == -1 ) {
-            TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
-              "Temporary file creation error" );
-            
-            return false;         
-          }
-     
-          void* m_lpszFile  =  mmap(0, (long)filesize, (PROT_READ | PROT_WRITE), 
-            MAP_SHARED, m_hFile, 0);
-      
-          if( m_lpszFile == ((void*)-1) ) {
-            close( m_hFile );
-        
-            TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
-              "Mapping creation error" );
-            
-            return false;            
-          }
-        
-          m_hFile_ = m_hFile;
-          m_lpszFile_ = m_lpszFile;
-        #else
-          #error "Unsupported platform"
-        #endif
-    
-        mapping_is_active_ = true;
-        curr_size_ = filesize;
-        
-        return true;
-      } else {     
-        return false;
-      }
-    }
-  } else {
-    if( mapping_is_active_ ) {
-      /* Disabling mapping */
-      
-      #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-        if( ! UnmapViewOfFile( m_lpszFile_ ) ) {
-          throw TeException( UNKNOWN_ERROR_TYPE, "Unable to unmap disk file",
-            false );
-        }
-          
-        CloseHandle( m_hMapping_ );
-        CloseHandle( m_hFile_ );
-      #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-        if( munmap( m_lpszFile_ , (long)curr_size_ ) == -1) {
-          throw TeException( UNKNOWN_ERROR_TYPE, "Unable to unmap disk file",
-            false );
-        }
-            
-        close(m_hFile_);
-      #else
-        #error "Unsupported platform"
-      #endif
-      
-      mapping_is_active_ = false;
-      curr_size_ = 0;
-    }
-        
-    return true;
-  }
-}
-
-
-void* TeMappedMemory::getPointer() const
-{
-  TEAGN_TRUE_OR_THROW( mapping_is_active_,
-    "Trying to access an inactive mapping" );
-    
-  return m_lpszFile_;
-}
-
-
-std::string TeMappedMemory::getFileName() const
-{
-  TEAGN_TRUE_OR_THROW( mapping_is_active_,
-    "Trying to access an inactive mapping" );
-    
-  return disk_file_name_;
-}
-
-
-bool TeMappedMemory::createNewDiskFile( const std::string& filename,
-  unsigned long int size ) const
-{
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    int m_hFile = open( filename.c_str(),_O_RDWR|_O_CREAT,
-      _S_IREAD | _S_IWRITE);
-
-    if( m_hFile == -1 ) {
-      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
-        "Temporary file creation error" );
-              
-      return false;         
-    }
-    
-    off_t seek_off = ( off_t )( size - 1 );
-          
-    if( lseek(m_hFile, seek_off, SEEK_SET) == -1 ) {
-      close( m_hFile );
-          
-      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
-        "Temporary file seek error" );
-              
-      return false;           
-    }
-        
-    unsigned char c = '\0';
-    
-
-    if( write( m_hFile, (void*)&c, sizeof( unsigned char ) ) == -1 ) {
-      close( m_hFile );
-          
-      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
-        "Temporary file write error" );
-              
-      return false;            
-    }  
-    
-    close( m_hFile );  
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-    int m_hFile = open( filename.c_str(),O_RDWR|O_CREAT,S_IRWXU);
-
-    if( m_hFile == -1 ) {
-      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
-        "Temporary file creation error" );
-              
-      return false;         
-    }
-    
-    off_t seek_off = ( off_t )( size - 1 );
-          
-    if( lseek(m_hFile, seek_off, SEEK_SET) == -1 ) {
-      close( m_hFile );
-          
-      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
-        "Temporary file seek error" );
-              
-      return false;           
-    }
-        
-    unsigned char c = '\0';
-    
-
-    if( write( m_hFile, (void*)&c, sizeof( unsigned char ) ) == -1 ) {
-      close( m_hFile );
-          
-      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
-        "Temporary file write error" );
-              
-      return false;            
-    }  
-    
-    close( m_hFile );
-  #else
-    #error "Unsupported platform"
-  #endif
-  
-  return true;
-}
-
-
-std::string TeMappedMemory::getLastErrorStr()
-{
-  std::string error_string;
-  
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  
-    LPVOID lpMsgBuf = 0;    
-    DWORD dw = GetLastError();
-    int written_chars_nmb = 0;
-    
-    written_chars_nmb = FormatMessage(
-          FORMAT_MESSAGE_ALLOCATE_BUFFER |
-            FORMAT_MESSAGE_FROM_SYSTEM | 
-            FORMAT_MESSAGE_IGNORE_INSERTS,
-          NULL,
-          dw,
-          0,
-          (LPTSTR) &lpMsgBuf,
-          1024, 
-          NULL );
-          
-    if( written_chars_nmb > 0 ) {
-      int str_size = MIN( 1024, 2 * written_chars_nmb );
-      error_string = std::string( ( (char*)lpMsgBuf ), 1024 );
-    }
-    
-    if( lpMsgBuf ) {
-      LocalFree(lpMsgBuf);
-    }
-    
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-  
-  #else
-    #error "Unsuported platform"
-  #endif
-  
-  return error_string;
-}
-
-
-unsigned long int TeMappedMemory::size() const
-{
-  return curr_size_;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeMappedMemory.h"
+#include "TeException.h"
+#include "TeErrorLog.h"
+#include "TeUtils.h"
+#include "TeAgnostic.h"
+#include "TeDefines.h"
+#include "TeTempFilesRemover.h"
+
+#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  #include <io.h>
+  #include <fcntl.h>
+  #include <sys/stat.h>  
+#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+  #include <sys/types.h>
+  #include <sys/stat.h>
+  #include <fcntl.h>
+  #include <unistd.h>
+#else
+  #error "Unsupported platform"
+#endif
+
+
+void TeMappedMemory::init()
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    m_hFile_ = 0;
+    m_hMapping_ = 0;
+    m_lpszFile_ = 0;
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    m_hFile_ = 0;
+    m_lpszFile_ = 0;
+  #else
+    #error "Unsupported platform"
+  #endif
+  
+  mapping_is_active_ = false;
+  curr_size_ = 0;
+  must_delete_file_ = false;
+};
+
+
+TeMappedMemory::TeMappedMemory()
+{
+  init();
+}
+
+
+TeMappedMemory::~TeMappedMemory()
+{
+  reset();
+}
+
+
+void TeMappedMemory::reset()
+{
+  TEAGN_TRUE_OR_THROW( toggle( false ), "Error disabling mapped memory" );
+  
+  if( must_delete_file_ ) {
+    TeTempFilesRemover::instance().removeFile(disk_file_name_);
+  }
+  
+  disk_file_name_.clear();
+  
+  init();
+}
+
+
+bool TeMappedMemory::reset( unsigned long int size, bool enabled )
+{
+  reset();
+  
+  std::string disk_file_name;
+      
+  TEAGN_TRUE_OR_RETURN( TeGetTempFileName( disk_file_name ),
+    "Unable to get temporary file name" );
+    
+  return( reset( disk_file_name, size, false, enabled ) );
+}
+
+
+bool TeMappedMemory::reset( const std::string& filename, 
+  unsigned long int size, bool keep_disk_file, bool enabled )
+{
+  reset();
+
+  if( filename.empty() || ( size == 0 ) ) {
+    TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
+      "Invalid mapped file name or invalid file size" ); 
+            
+    return false;
+  } else {
+    TEAGN_TRUE_OR_RETURN( createNewDiskFile( filename, size ),
+      "Unable to create memory mapped disk file" );
+      
+    disk_file_name_ = filename;
+    must_delete_file_ = ( ! keep_disk_file );
+    
+    if( must_delete_file_ )
+    {
+      TeTempFilesRemover::instance().addFile( filename );
+    }
+    
+    if( toggle( enabled ) ) {
+      return true;
+    } else {
+      reset();
+      return false;
+    }
+  }
+}
+
+
+bool TeMappedMemory::reset( const std::string& filename, bool enabled )
+{
+  reset();
+  
+  disk_file_name_ = filename;
+  
+  if( toggle( enabled ) ) {
+    return true;
+  } else {
+    reset();
+    return false;
+  }  
+}
+
+
+bool TeMappedMemory::toggle( bool enabled )
+{
+  if( enabled  ) {
+    if( mapping_is_active_ ) {
+      return true;    
+    } else {
+      curr_size_ = 0;
+      
+      /* Activating mapping */    
+      
+      if( ! TeCheckFileExistence( disk_file_name_.c_str() ) ) {
+        return false;
+      }
+      
+      unsigned long int filesize = TeGetFileSize( disk_file_name_ );
+  
+      if( filesize > 0 ) {
+        #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+      
+          HANDLE m_hFile = CreateFileA(
+            disk_file_name_.c_str(), GENERIC_READ | GENERIC_WRITE, 
+            FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
+            0, NULL);
+        
+          if( m_hFile == INVALID_HANDLE_VALUE ) {
+            TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
+              "Temporary file creation error" );        
+       
+            return false;
+          }
+  
+          HANDLE m_hMapping = CreateFileMapping( m_hFile, NULL, PAGE_READWRITE,
+            0, 0, NULL );
+              
+          if( m_hMapping == NULL ) {
+            CloseHandle(m_hFile);
+        
+            TEAGN_LOGERR( "Mapping creation error - " +
+              getLastErrorStr() );
+              
+            return false;        
+          }
+        
+          LPVOID m_lpszFile = (LPVOID) MapViewOfFile( m_hMapping, 
+            FILE_MAP_ALL_ACCESS, 0, 0, 0);
+      
+          if( m_lpszFile == 0 ) {
+            CloseHandle( m_hMapping );
+            CloseHandle( m_hFile );
+            
+            TEAGN_LOGERR( "Mapping view creation error - " +
+              getLastErrorStr() );
+            
+            return false;        
+          }        
+      
+          m_hFile_ = m_hFile;
+          m_hMapping_ = m_hMapping;
+          m_lpszFile_ = m_lpszFile;
+          
+        #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+        
+          int m_hFile = open( disk_file_name_.c_str(), O_RDWR );
+
+          if( m_hFile == -1 ) {
+            TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
+              "Temporary file creation error" );
+            
+            return false;         
+          }
+     
+          void* m_lpszFile  =  mmap(0, (long)filesize, (PROT_READ | PROT_WRITE), 
+            MAP_SHARED, m_hFile, 0);
+      
+          if( m_lpszFile == ((void*)-1) ) {
+            close( m_hFile );
+        
+            TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
+              "Mapping creation error" );
+            
+            return false;            
+          }
+        
+          m_hFile_ = m_hFile;
+          m_lpszFile_ = m_lpszFile;
+        #else
+          #error "Unsupported platform"
+        #endif
+    
+        mapping_is_active_ = true;
+        curr_size_ = filesize;
+        
+        return true;
+      } else {     
+        return false;
+      }
+    }
+  } else {
+    if( mapping_is_active_ ) {
+      /* Disabling mapping */
+      
+      #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+        if( ! UnmapViewOfFile( m_lpszFile_ ) ) {
+          throw TeException( UNKNOWN_ERROR_TYPE, "Unable to unmap disk file",
+            false );
+        }
+          
+        CloseHandle( m_hMapping_ );
+        CloseHandle( m_hFile_ );
+      #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+        if( munmap( m_lpszFile_ , (long)curr_size_ ) == -1) {
+          throw TeException( UNKNOWN_ERROR_TYPE, "Unable to unmap disk file",
+            false );
+        }
+            
+        close(m_hFile_);
+      #else
+        #error "Unsupported platform"
+      #endif
+      
+      mapping_is_active_ = false;
+      curr_size_ = 0;
+    }
+        
+    return true;
+  }
+}
+
+
+void* TeMappedMemory::getPointer() const
+{
+  TEAGN_TRUE_OR_THROW( mapping_is_active_,
+    "Trying to access an inactive mapping" );
+    
+  return m_lpszFile_;
+}
+
+
+std::string TeMappedMemory::getFileName() const
+{
+  TEAGN_TRUE_OR_THROW( mapping_is_active_,
+    "Trying to access an inactive mapping" );
+    
+  return disk_file_name_;
+}
+
+
+bool TeMappedMemory::createNewDiskFile( const std::string& filename,
+  unsigned long int size ) const
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    int m_hFile = open( filename.c_str(),_O_RDWR|_O_CREAT,
+      _S_IREAD | _S_IWRITE);
+
+    if( m_hFile == -1 ) {
+      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
+        "Temporary file creation error" );
+              
+      return false;         
+    }
+    
+    off_t seek_off = ( off_t )( size - 1 );
+          
+    if( lseek(m_hFile, seek_off, SEEK_SET) == -1 ) {
+      close( m_hFile );
+          
+      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
+        "Temporary file seek error" );
+              
+      return false;           
+    }
+        
+    unsigned char c = '\0';
+    
+
+    if( write( m_hFile, (void*)&c, sizeof( unsigned char ) ) == -1 ) {
+      close( m_hFile );
+          
+      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
+        "Temporary file write error" );
+              
+      return false;            
+    }  
+    
+    close( m_hFile );  
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    int m_hFile = open( filename.c_str(),O_RDWR|O_CREAT,S_IRWXU);
+
+    if( m_hFile == -1 ) {
+      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
+        "Temporary file creation error" );
+              
+      return false;         
+    }
+    
+    off_t seek_off = ( off_t )( size - 1 );
+          
+    if( lseek(m_hFile, seek_off, SEEK_SET) == -1 ) {
+      close( m_hFile );
+          
+      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
+        "Temporary file seek error" );
+              
+      return false;           
+    }
+        
+    unsigned char c = '\0';
+    
+
+    if( write( m_hFile, (void*)&c, sizeof( unsigned char ) ) == -1 ) {
+      close( m_hFile );
+          
+      TeErrorLog::instance().insert( UNKNOWN_ERROR_TYPE,
+        "Temporary file write error" );
+              
+      return false;            
+    }  
+    
+    close( m_hFile );
+  #else
+    #error "Unsupported platform"
+  #endif
+  
+  return true;
+}
+
+
+std::string TeMappedMemory::getLastErrorStr()
+{
+  std::string error_string;
+  
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  
+    LPVOID lpMsgBuf = 0;    
+    DWORD dw = GetLastError();
+    int written_chars_nmb = 0;
+    
+    written_chars_nmb = FormatMessage(
+          FORMAT_MESSAGE_ALLOCATE_BUFFER |
+            FORMAT_MESSAGE_FROM_SYSTEM | 
+            FORMAT_MESSAGE_IGNORE_INSERTS,
+          NULL,
+          dw,
+          0,
+          (LPTSTR) &lpMsgBuf,
+          1024, 
+          NULL );
+          
+    if( written_chars_nmb > 0 ) {
+      int str_size = MIN( 1024, 2 * written_chars_nmb );
+      error_string = std::string( ( (char*)lpMsgBuf ), 1024 );
+    }
+    
+    if( lpMsgBuf ) {
+      LocalFree(lpMsgBuf);
+    }
+    
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+  
+  #else
+    #error "Unsuported platform"
+  #endif
+  
+  return error_string;
+}
+
+
+unsigned long int TeMappedMemory::size() const
+{
+  return curr_size_;
+}
diff --git a/src/terralib/kernel/TeMappedMemory.h b/src/terralib/kernel/TeMappedMemory.h
old mode 100755
new mode 100644
index 483c351..6abfe24
--- a/src/terralib/kernel/TeMappedMemory.h
+++ b/src/terralib/kernel/TeMappedMemory.h
@@ -1,232 +1,232 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMappedMemory.h
-    \brief This file deals with mapped memory resources
-*/
-
-#ifndef TEMAPPEDMEMORY_H
-  #define TEMAPPEDMEMORY_H
-  
-  #include "TeSharedPtr.h"
-  #include "TeDefines.h"
-  
-  #include <string>
-  
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    #include <windows.h>
-    #include <winbase.h>
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-    #include <sys/mman.h>
-  #else
-    #error "ERROR: Unsupported platform"
-  #endif  
-
-  /**
-    * @brief This is class deals with mapped memory resources.
-    * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-    * @ingroup Utils
-    */
-  class TL_DLL TeMappedMemory {
-    public :
-      typedef TeSharedPtr< TeMappedMemory > pointer;
-      typedef const TeSharedPtr< TeMappedMemory > const_pointer;    
-      
-      /**
-       * @brief Default Constructor.
-       */
-      TeMappedMemory();          
-      
-      /**
-       * @brief Default Destructor.
-       */
-      ~TeMappedMemory();
-      
-      /**
-       * @brief Reset the current instance (free all allocated resources).
-       */
-      void reset();
-      
-      /**
-       * @brief Reset the current instance to new size.
-       * @note The mapped memory file will be automatically created.
-       * @param size The new mapped memory size (bytes).
-       * @param enabled Mapping enabled/disabled state.
-       * @return true if OK. false on errors.
-       */
-      bool reset( unsigned long int size, bool enabled );
-      
-      /**
-       * @brief Reset the current instance using a new created disk file.
-       *
-       * @note The mapped memory size will follow the disk file size.
-       *
-       * @param filename The mapped memory disk file name.
-       * @param size The new mapped memory size (bytes).
-       * @param keep_disk_file if true, the file will not be deleted.
-       * @param enabled Mapping enabled/disabled state.
-       * @return true if OK. false on errors.
-       */
-      bool reset( const std::string& filename, unsigned long int size,
-        bool keep_disk_file, bool enabled );      
-      
-      /**
-       * @brief Reset the current instance using an exising disk file.
-       * @note The mapped memory size will follow the disk file size.
-       * @param filename The mapped memory disk file name.
-       * @param enabled Mapping enabled/disabled state.       
-       * @return true if OK. false on errors.
-       */
-      bool reset( const std::string& filename, bool enabled );      
-      
-      /**
-       * @brief Enable / disable the current mapping instance.
-       *
-       * @return true if OK. false on errors.
-       */
-      bool toggle( bool enabled );         
-      
-      /**
-       * @brief Returns a pointer reference to the mapped memory.
-       *
-       * @note Throws an exception if no mapped memory is active.
-       */
-      void* getPointer() const;
-      
-      /**
-       * @brief Returns the current mapped file name.
-       * @return The current mapped file name.
-       * @note Throws an exception if no mapped memory is active.
-       */
-      std::string getFileName() const;
-      
-      /**
-       * @brief The current allocated mapped memory size (bytes).
-       *
-       * @return The current allocated mapped memory size (bytes).
-       */
-      unsigned long int size() const;      
-      
-    protected :
-    
-      #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-      
-        /**
-         * @brief Handle to file we're currently zapping
-         */
-        HANDLE m_hFile_;
-        
-        /**
-         * @brief Handle to memory-mapping of that file
-         */
-        HANDLE m_hMapping_;
-        
-        /**
-         * @brief Pointer to mapped to memory
-         */
-        LPVOID m_lpszFile_;
-        
-      #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-  
-        /**
-         * @brief Handle to file we're currently zapping
-         */
-        int m_hFile_;
-        
-        /**
-         * @brief Pointer to mapped to memory
-         */
-        void* m_lpszFile_;
-        
-      #else
-        #error "Unsuported platform"
-      #endif
-      
-      /**
-       * @brief A flag indicating when this map is active.
-       * @note Default value : false.
-       */        
-      bool mapping_is_active_;
-      
-      /**
-       * @brief The disk file name.
-       * @note Default value : empty string.
-       *
-       */        
-      std::string disk_file_name_;
-      
-      /**
-       * @brief The current mapped memory size.
-       * @note Default value : 0.
-       */    
-      unsigned long int curr_size_;
-     
-      /**
-       * @brief True if the mapped file must be deleted.
-       * @note Default value : false.
-       */    
-      bool must_delete_file_;
-      
-      /**
-       * @brief Initiates the global initial state.
-       *
-       */      
-      void init();
-      
-      /**
-       * @brief Create a new disk file suitable for memory mapping.
-       * @param filename The file name.
-       * @param size The file size.
-       * @return true if OK. false on errors.
-       */
-      bool createNewDiskFile( const std::string& filename, 
-        unsigned long int size ) const;
-        
-      /**
-       * @brief Generate the last error string.
-       * @return The last error string.
-       */        
-      std::string getLastErrorStr();
-      
-    private :
-    
-      /**
-       * @brief Alternative Constructor.
-       *
-       */
-      TeMappedMemory( const TeMappedMemory& ) {}; 
-          
-      /**
-       * @brief Operator= overload.
-       *
-       */
-      const TeMappedMemory& operator=( const TeMappedMemory& )
-      {
-        return *this;
-      };
-  };
-  
-/** @example TeMappedMemory_test.cpp
- *    Shows how to use this class.
- */    
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMappedMemory.h
+    \brief This file deals with mapped memory resources
+*/
+
+#ifndef TEMAPPEDMEMORY_H
+  #define TEMAPPEDMEMORY_H
+  
+  #include "TeSharedPtr.h"
+  #include "TeDefines.h"
+  
+  #include <string>
+  
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    #include <windows.h>
+    #include <winbase.h>
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    #include <sys/mman.h>
+  #else
+    #error "ERROR: Unsupported platform"
+  #endif  
+
+  /**
+    * @brief This is class deals with mapped memory resources.
+    * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+    * @ingroup Utils
+    */
+  class TL_DLL TeMappedMemory {
+    public :
+      typedef TeSharedPtr< TeMappedMemory > pointer;
+      typedef const TeSharedPtr< TeMappedMemory > const_pointer;    
+      
+      /**
+       * @brief Default Constructor.
+       */
+      TeMappedMemory();          
+      
+      /**
+       * @brief Default Destructor.
+       */
+      ~TeMappedMemory();
+      
+      /**
+       * @brief Reset the current instance (free all allocated resources).
+       */
+      void reset();
+      
+      /**
+       * @brief Reset the current instance to new size.
+       * @note The mapped memory file will be automatically created.
+       * @param size The new mapped memory size (bytes).
+       * @param enabled Mapping enabled/disabled state.
+       * @return true if OK. false on errors.
+       */
+      bool reset( unsigned long int size, bool enabled );
+      
+      /**
+       * @brief Reset the current instance using a new created disk file.
+       *
+       * @note The mapped memory size will follow the disk file size.
+       *
+       * @param filename The mapped memory disk file name.
+       * @param size The new mapped memory size (bytes).
+       * @param keep_disk_file if true, the file will not be deleted.
+       * @param enabled Mapping enabled/disabled state.
+       * @return true if OK. false on errors.
+       */
+      bool reset( const std::string& filename, unsigned long int size,
+        bool keep_disk_file, bool enabled );      
+      
+      /**
+       * @brief Reset the current instance using an exising disk file.
+       * @note The mapped memory size will follow the disk file size.
+       * @param filename The mapped memory disk file name.
+       * @param enabled Mapping enabled/disabled state.       
+       * @return true if OK. false on errors.
+       */
+      bool reset( const std::string& filename, bool enabled );      
+      
+      /**
+       * @brief Enable / disable the current mapping instance.
+       *
+       * @return true if OK. false on errors.
+       */
+      bool toggle( bool enabled );         
+      
+      /**
+       * @brief Returns a pointer reference to the mapped memory.
+       *
+       * @note Throws an exception if no mapped memory is active.
+       */
+      void* getPointer() const;
+      
+      /**
+       * @brief Returns the current mapped file name.
+       * @return The current mapped file name.
+       * @note Throws an exception if no mapped memory is active.
+       */
+      std::string getFileName() const;
+      
+      /**
+       * @brief The current allocated mapped memory size (bytes).
+       *
+       * @return The current allocated mapped memory size (bytes).
+       */
+      unsigned long int size() const;      
+      
+    protected :
+    
+      #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+      
+        /**
+         * @brief Handle to file we're currently zapping
+         */
+        HANDLE m_hFile_;
+        
+        /**
+         * @brief Handle to memory-mapping of that file
+         */
+        HANDLE m_hMapping_;
+        
+        /**
+         * @brief Pointer to mapped to memory
+         */
+        LPVOID m_lpszFile_;
+        
+      #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+  
+        /**
+         * @brief Handle to file we're currently zapping
+         */
+        int m_hFile_;
+        
+        /**
+         * @brief Pointer to mapped to memory
+         */
+        void* m_lpszFile_;
+        
+      #else
+        #error "Unsuported platform"
+      #endif
+      
+      /**
+       * @brief A flag indicating when this map is active.
+       * @note Default value : false.
+       */        
+      bool mapping_is_active_;
+      
+      /**
+       * @brief The disk file name.
+       * @note Default value : empty string.
+       *
+       */        
+      std::string disk_file_name_;
+      
+      /**
+       * @brief The current mapped memory size.
+       * @note Default value : 0.
+       */    
+      unsigned long int curr_size_;
+     
+      /**
+       * @brief True if the mapped file must be deleted.
+       * @note Default value : false.
+       */    
+      bool must_delete_file_;
+      
+      /**
+       * @brief Initiates the global initial state.
+       *
+       */      
+      void init();
+      
+      /**
+       * @brief Create a new disk file suitable for memory mapping.
+       * @param filename The file name.
+       * @param size The file size.
+       * @return true if OK. false on errors.
+       */
+      bool createNewDiskFile( const std::string& filename, 
+        unsigned long int size ) const;
+        
+      /**
+       * @brief Generate the last error string.
+       * @return The last error string.
+       */        
+      std::string getLastErrorStr();
+      
+    private :
+    
+      /**
+       * @brief Alternative Constructor.
+       *
+       */
+      TeMappedMemory( const TeMappedMemory& ) {}; 
+          
+      /**
+       * @brief Operator= overload.
+       *
+       */
+      const TeMappedMemory& operator=( const TeMappedMemory& )
+      {
+        return *this;
+      };
+  };
+  
+/** @example TeMappedMemory_test.cpp
+ *    Shows how to use this class.
+ */    
+
+#endif
diff --git a/src/terralib/kernel/TeMatrix.cpp b/src/terralib/kernel/TeMatrix.cpp
old mode 100755
new mode 100644
index cc15643..f10adab
--- a/src/terralib/kernel/TeMatrix.cpp
+++ b/src/terralib/kernel/TeMatrix.cpp
@@ -1,1540 +1,1638 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
- // TeMatrix.c -- matrix of type double
-
-#include <TeMatrix.h>
-
-#include <TeAgnostic.h>
-
-#include <math.h>
-#include <stdio.h>
-
-
-TeMatrix::TeMatrix(){
-	nrow = 0;
-	ncol = 0;
-	mat  = NULL;
-	lixo = 0.;
-}
-
-void
-TeMatrix::Clear()
-{
-	if( mat != NULL ){
-		int i;
-		for( i = 0; i < nrow; i++ )
-			if( mat[i] != NULL )
-			{
-				delete []mat[i];
-				mat[i]=NULL;
-			}
-		delete []mat;
-		mat = NULL;
-	}
-	nrow = ncol = 0;
-	lixo = (double)0;
-}
-
-TeMatrix::~TeMatrix()
-{
-	Clear();
-}
-
-short
-TeMatrix::Alloc(int nl, int nc)
-{
-	Clear();
-	if( nl <= 0 || nc <= 0 ){
-		return true;
-	}
-	nrow = nl;
-	ncol = nc;
-	if (  (mat = new double*[nrow]) == NULL ){
-		Clear();
-		return false;
-	}
-	int i,j;
-	for( i = 0; i < nrow; i++ ) mat[i] = NULL;
-	for( i = 0; i < nrow; i++ ){
-		if( (mat[i] = new double[ncol]) == NULL ){
-			Clear();
-	       		return false;
-		}
-		for( j = 0; j < ncol; j++ ) mat[i][j] = (double)0.;
-	}
-	return true;
-}
-
-TeMatrix::TeMatrix(const TeMatrix& m)
-{
-     nrow = ncol = 0;
-     mat = NULL;
-     lixo = 0.;
-    *this = m;
-}
-
-int
-TeMatrix::Init( int nl, int nc , double* f )
-{
- 	if( f == NULL )
-		return Init( nl, nc,  (double) 0 );
-	if( Alloc( nl, nc ) ){
-		int c=0;
-		int i,j;
-		for ( i = 0; i < nrow; i++)
-			for (j = 0; j < ncol; j++)
-				mat[i][j] = f[c++];
-		return true;
-	}
-	return false;
-}
-
-int
-TeMatrix::Init(int nl, int nc, double f )
-{
- 	// initialize matrix
-	if( Alloc( nl, nc ) ){
- 		int i,j;
-     		for (i = 0; i < nrow; i++)
-       			 for (j = 0; j < ncol; j++)
-        		 	mat[i][j] = f;
-		return true;
-	}
-	return false;
-}
-
-int
-TeMatrix::Init(int k, double* f)
-{
- 	if( f == NULL )
-		return Init( k, k,  (double) 0 );
-	if( Alloc(k,k) == false ) 
-		return false;
-	int i,j;
-	for ( i = 0; i < nrow; i++  )
-    		for (j = 0; j < ncol; j++)
-        		mat[i][j] = (i==j)? f[i]: (double)0.;
-   	return true;
-}
-
-int
-TeMatrix::Init(int k, double f)
-{
-	if( Alloc(k,k) == false )
-		return false;
-	int i,j;
-	for (i=0; i<nrow; i++)
-		for (j=0; j<ncol; j++)
-			mat[i][j] = (i==j)? (double)f:0;
-	return true;
-}
-
-TeMatrix& 
-TeMatrix::operator=(const TeMatrix& m)
-{
-
-	if( Alloc(m.nrow,m.ncol) == false ){
-		printf("\nMatrix::operator=:no memory available \n");
-		return *this;
-    	}
-	int	i,j;
-    	for( i = 0; i < nrow; i++)
-     		for( j = 0; j < ncol; j++)
-       			mat[i][j] = m.mat[i][j];
-    	return *this;
-}
-
-int
-TeMatrix::operator==(const TeMatrix& m) const
-{
-	if( nrow != m.nrow || ncol != m.ncol )
-		return false;
-	int	i,j;
-	for ( i = 0; i < nrow; i++)
-		for ( j = 0; j < ncol; j++)
-			if ( mat[i][j]!= m.mat[i][j] )
-				return false;
-	return true;
-}
-
-void
-TeMatrix::operator*=(double f)
-{
-	int	i,j;
-	for( i = 0; i < nrow; i++)
-		for( j = 0; j < ncol; j++)
-			mat[i][j] *= f;
-	return;
-}
-
-
-//-------------------------------------------------------------friend methods
-
-TeMatrix
-operator+(const TeMatrix& m,const TeMatrix& n)
-{
-	if( m.nrow != n.nrow || m.ncol != n.ncol ){
-		printf("\nMatrix::operator+ >>> Operandos com tamanhos diferentes\n");
-	        return  m;
-	} 
-	TeMatrix rm;
-	if( rm.Init(m.Nrow(),m.Ncol()) == false ){
-		printf("\nMatrix::operator+ >>> Memoria nao disponivel\n");
-		return	m;
-	}
-	int	i,j;
-	for ( i = 0; i < m.Nrow(); i++)
-		for ( j = 0; j < m.Ncol(); j++)
-			rm.mat[i][j] = m.mat[i][j] + n.mat[i][j];
-	return rm;
-}
-
-TeMatrix
-operator-(const TeMatrix& m,const TeMatrix& n)
-{
-	if( m.nrow != n.nrow || m.ncol != n.ncol ){
-		printf("\nMatrix::operator+ >>> Operandos com tamanhos diferentes\n");
-	        return  m;
-	} 
-	TeMatrix rm;
-	if( rm.Init(m.Nrow(),m.Ncol()) == false ){
-		printf("\nMatrix::operator- >>> Memoria nao disponivel\n");
-		return	m;
-	}
-
-	int	i,j;
-	for ( i = 0; i <  m.Nrow(); i++)
-		for ( j = 0; j < m.Ncol(); j++)
-			rm.mat[i][j] = m.mat[i][j] - n.mat[i][j];
-	return rm;
-}
-
-TeMatrix
-TeMatrix::operator-()
-{
-	TeMatrix rm;  
-	if( rm.Init(Nrow(),Ncol()) == false ){
-		printf("\n operator-:no memory \n");
-		return	*this;
-	}
-	int i,j;
-	for (i=0; i<Nrow(); i++)
-		for (j=0; j<Ncol(); j++)
-			rm.mat[i][j] = -mat[i][j];
-	return rm;
-}
-
-TeMatrix 
-operator*(const TeMatrix& m,const TeMatrix& n)
-{
-	if ( m.Ncol() != n.Nrow() ) {
-		printf( "\nMatrix::operator* >>> Operandos com tamanhos diferentes\n");
-		return m;
-	}
-	int nr = m.Nrow(), nc =n.Ncol();
-	TeMatrix result;
-	if( result.Init(nr,nc) == false){
-		printf("\nMatrix::operator* >>> Memoria nao disponivel\n");
-		return	m;
-	}
-
-	double	sum = (double)0.;
-	int	l,c,i;
-
-	for ( l = 0; l < m.Nrow(); l++){
-		for ( c = 0; c < n.Ncol(); c++){
-        		sum = (double)0.;
-			for ( i = 0; i < m.Ncol(); i++)
-				sum += m.mat[l][i] * n.mat[i][c];
-    			result.mat[l][c] = sum;
-
-		}
-	}
-	return result; 
-}
-
-TeMatrix
-operator*(double f,const TeMatrix& m)
-{
-	int nr = m.Nrow(), nc =m.Ncol();
-	TeMatrix rm;
-	if( rm.Init(nr,nc) == false){
-		printf("\noperator*:no memory");
-		return m;
-	}
-	int i,j;
-	for (i = 0; i < rm.Nrow(); i++)
-		for (j = 0; j < rm.Ncol(); j++)
-			rm.mat[i][j] = f * m.mat[i][j];
-	return rm;
-}
-
-//VRMC 12/98
-int
-TeMatrix::isUpperTriangle() const
-{
-	// elements above diagonal != 0
-	int i,j;
-	for(j = 0; j < ncol; j++)
-		for(i = j+1; i < nrow; i++)
-			if ( mat[i][j]  != (double)0. )
-				return false;
-	return true;
-}
-
-//VRMC 12/98
-int
-TeMatrix::isLowerTriangle() const	
-{
-	// elements under diagonal different 0
-	int i,j;
-	// VRMC 11/98
-	for (i=0; i< nrow; i++)
-		for (j= i+1; j <ncol; j++)
-			if ( mat[i][j] != (double)0. )
-				return false;
-	return true;
-}
-
-double
-TeMatrix:: Determinant() const
-{
-	if (Nrow() != Ncol()) {
-		return lixo;
-	}
-	if (Nrow()==1) return mat[0][0];
-	if (Nrow()==2)
-		return mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0];
-	if (Nrow()==3) 
-		return (  mat[0][0] * mat[1][1] * mat[2][2]
-			 +mat[0][1] * mat[1][2] * mat[2][0]
-			 +mat[0][2] * mat[1][0] * mat[2][1]
-			 -mat[0][1] * mat[1][0] * mat[2][2]
-			 -mat[0][0] * mat[1][2] * mat[2][1]
- 			 -mat[0][2] * mat[1][1] * mat[2][0] );
-	if ( isUpperTriangle() ) {
-		double val = 1;
-		int i;
-		for (i = 0; i < Nrow(); i++) val *= mat[i][i];
-		return val;
-    	}
-	TeMatrix mt;
-	double val = 0;
-	double det;
-	int sign = 1;
-	int j;
-	for(j = 0; j < Ncol(); j++) {
-		if( CoFactor(0,j, mt) == false )
-			return (double)0;
-		det = mt.Determinant();		
-		val += sign * mat[0][j] * det;
-		sign *= -1;
-     	}
-	return val;
-}
-
-int
-TeMatrix::CoFactor(int irow, int jcol, TeMatrix& mt ) const
-{
- 	if ( nrow == 1||ncol == 1 ) {
-		printf("\nMatrix::CoFactor >>>  can't CoFactor row or column matrix\n");
-		return false;
-   	}
-	if( mt.Init(nrow-1,ncol-1) == false){
-		printf("\nMatrix::CoFactor: Memoria nao disponivel\n");
-		return false;
-	}
-	int getcol, getrow =0;
-	int i,j;
-	for(i=0; i < mt.Nrow(); i++) {
-		if ( getrow == irow ) ++getrow;
-		if ( getrow == nrow ) break;
-		getcol = 0;
-		for(j=0; j < mt.Ncol(); j++) {
-			if ( getcol==jcol ) ++getcol;
-			if ( getcol==ncol ) continue;
-			mt.mat[i][j] = mat[getrow][getcol];
-			++getcol;
-		}
-		++getrow;
-	}
-	return true;
-}
-
-int 
-TeMatrix::Transpose( TeMatrix &rm ) const
-{
-	if( &rm == this ){
-		printf("\nMatrix::Transpose >>> Operacao usa duas matrizes\n");
-		return false;
-	}
-
-	if( rm.Init( ncol, nrow ) == false){
-		printf("\nMatrix::Transpose >>> Memoria nao disponivel\n");
-		return false;
-	}
-	int i,j;
-	for(i = 0; i < ncol; i++)
-		for( j = 0; j < nrow; j++)
-			rm.mat[i][j] = mat[j][i];
-	return true;
-}
-
-// VRMC 12/98
-int
-TeMatrix::isSimetric()	const
-{
-	int i,j;
-
-	if (nrow != ncol){
-		printf("\nMatrix::isSimetric >>> Memoria nao disponivel\n");
-		return false;
-	}
-
-	for (i = 0; i < nrow; i++)
-		for (j = 0; j < ncol; j++)
-			if ( mat[i][j] != mat[j][i]) return false;
-
-	return	true;
-}
-
-// VRMC 12/98
-int		
-TeMatrix::isPositiveDefinide() const
-{
-	int i, j, dim, subdim;
-	TeMatrix	Submat;
-
-	if (nrow != ncol){
-		printf("\nMatrix::isPositiveDefinide >>> Matriz tem que ser quadrada\n");
-		return false;
-	}
-	dim = nrow;
-
-	for (subdim=1 ; subdim <= dim; subdim++)
-	{
-		if( Submat.Init( subdim,subdim ) == false ){
-			printf("\nMatrix::isPositiveDefinide>>>Memoria nao disponivel!\n");
-			return false;
-		}
-
-		for ( i=0; i < subdim; i++)
-			for (j = 0; j < subdim; j++)
-				Submat(i,j) = mat[i][j];
-		
-		if (Submat.Determinant() <= 0.) {
-			printf("\nMatrix::isPositiveDefinide>>>Matriz nao e positiva definida!\n");
-			return false;
-		}
-
-		Submat.Clear();
-	}
-	return true;
-}
-
-// VRMC 12/98
-int
-TeMatrix :: MatTransf( TeMatrix& mt )
-{
-	TeMatrix	TI;	// inverse of a inferior triangular matrix
-	int	dim;
-
-	if( &mt == this ){
-		printf("\nMatrix::MatTransf >>> Operacao usa duas matrizes\n");
-		return false;
-	}
-
-	if( nrow <= 0 || ncol <= 0 ){
-		printf("\nMatrix::MatTransf >>> Dimensoes da matriz invalidas!\n");
-		return false;
-	}
-
-	if( nrow != ncol ){
-		printf("\nMatrix::MatTransf >>> Dimensoes da matriz invalidas!\n");
-		return false;
-	}
-
-	dim = nrow;
-	if( mat[0][0] <= 0. ){
-		printf("\nMatrix::MatTranf >>> ERROR\n");
-		return false;
-	}
-
-	if( TI.Init( dim, (double)0. ) == false ){
-		printf("\nMatrix::MatTransf >>> Memoria nao disponivel!\n");
-		return false;
-	}
-
-
-	//--	Calculate inferior triangular matrix by Cholesky decomposition method
-	if ((*this).CholeskyDecomp(TI) == false) {
-		printf("\nMatrix::MatTransf>>> Nao foi possivel decompor a matriz!\n");
-		return false;
-	}
-
-	//--	Calculate the inverse of Cholesky matrix
-//	if (TI.CholeskyInv(mt) != true)
-	if (!(TI.CholeskyInv(mt)))
-	{
-		printf("\nMatrix::MatTransf>>> Matriz nao inversivel!\n");
-		return false;
-	}
-
-	return true;
-}
-
-// VRMC 12/98			
-int
-TeMatrix::CholeskyInv (TeMatrix&	mt) const
-{
-	if( mt.Init(nrow,(double)0.) == false ){
-		printf("\nMatrix::CholeskyInv >>> Memoria nao disponivel!\n");
-		return false;
-	}
-
-	if( &mt == this ){
-		printf("\nMatrix::CholeskyInv >>> Operacao usa duas matrizes\n");
-		return false;
-	}
-	if ( nrow != ncol ){
-       		printf("\nMatrix::CholeskyInv>>> Can't invert a non-square matrix");
-       		return false;
-   	}
-//	if (this->isLowerTriangle() != true) {
-	if (!(this->isLowerTriangle())) {
-		printf("\nMatrix::CholeskyInv >>> Matriz nao e triangular inferior\n");
-		return false;
-	}
-
-	int i; double rf;
-	for( i = 0; i < nrow; i++ ){
-		if( this->mat[i][i] == (double)0. ){
-			printf("\nMatrix::CholeskyInv >>> ERROR IV\n");
-			return false;
-		}
-		mt.mat[i][i] = (double)1. / this->mat[i][i];
-		int j,k;
-		for( j = i-1; j >= 0; j-- ){
-			rf = (double)0.;
-			for( k = j; k <= i-1; k++ ){
-				rf += ( this->mat[i][k] * mt.mat[k][j] );
-			}
-			mt.mat[i][j] = -rf * mt.mat[i][i];
-		}
-	}
-	return true;
-}
-	
-
-int
-TeMatrix::EigenValues( TeMatrix& mt ) const
-{
-	//---	calcula os eigenvalues  de uma
-	//	matriz representada na forma vetorial 
-	//	Os auto valores sao devolvidos em ordem decrescente    
-	//	e ocupam as posicoes:  0, 2, 5, 9, ... .       
-
-	if( &mt == this ){
-		printf("\nMatrix::EigenValues >>> Operacao usa duas matrizes\n");
-		return false;
-	}
-
-double	*cov	= NULL,		/* matriz de covariancia	*/
-	*e_val	= NULL;		/*   "    de auto_valores	*/
-
-int 	dim = (*this).Nrow();		/* ordem da matriz*/
-
-int	i,j,k,		/*   cov[], e_val[]    */
-	ia,             /*                     */
-	ind,            /*     |0      |       */
-	l,m,            /*     |1 2    |       */
-	mq,lm,          /*     |3 4 5  |       */
-	ll,mm,          /*     |6 7 8 9|       */
-	ilq,imq,        /*                     */
-	im,iq,il,lq,    /*    (para DIM=4)     */
-	jq;
-
-double	range,          /*       e_vec[]       */
-	dim1,fdim,      /*                     */  
-	anorm,          /*    |0  4  8 12|     */
-	anrmx,          /*    |1  5  9 13|     */
-	thr,            /*    |2  6 10 14|     */
-	x,y,z,          /*    |3  7 11 15|     */
-	sinx,cosx,      /*                     */
-	sinx2,cosx2,
-	sincs;
-
-int 	fat = (dim*dim+dim)/2;
-
-	if( dim <= 0 ){
-		printf("\nMatrix::EigenValues >>> dimensao da matriz nula!\n");
-		return false;
-	}
-	if( mt.Init( dim, (double)1 ) == false ){
-		printf("\nMatrix::EigenValues >>> Memoria nao disponivel\n");
-		return false;
-	}
-	range = 1.0e-6 ;
-	dim1 = dim - 1 ;
-	fdim = dim;
-
-	cov = new double[fat];
-
-	if( cov == NULL ){
-		printf("\nMatrix::EigenValues >>> Memoria nao disponivel (COV)\n");
-		return false;
-	}
-
-	e_val = new double[fat];
-	if( e_val == NULL ){
-		delete []cov; //SSL0296
-		cov = NULL;
-		printf("\nMatrix::EigenValues >>> Memoria nao disponivel (EVAL)\n");
-		return false;
-	}
-	k = 0;
-	for ( i = 0; i< dim; i++)
-		for ( j = 0; j <= i; j++)
-			cov[k++] = mat[i][j];
-
-	for (i=0; i < ((dim*dim+dim)/2); i++) e_val[i] = cov[i];
-
-	anorm = 0.0;
-
-	for ( j = 0; j < dim; j++){
-		for (i = 0; i <= j; i++){
-			if (i != j){
-				ia = i + (j*j+j)/2;
-				anorm = anorm + e_val[ia] * e_val[ia];
-			}
-		}
-	}
-
-	if (anorm <= 0) goto l5;
-
-	anorm = 1.414 * sqrt((double)anorm);
-	anrmx = anorm * range/fdim;
-	ind   = 0;
-	thr   = anorm;
-
-l1:
-	thr = thr/fdim;
-l2:
-	l = 0;
-l3:
-	m = l+1;
-l4:
-	mq = (m*m + m)/2;
-	lq = (l*l + l)/2;
-	lm = l + mq;
-
-	if ( fabs((double)(e_val[lm])) >= thr )    
-	{
-		ind = 1;
-		ll = l + lq;
-		mm = m + mq;
-
-		x = 0.5 * (e_val[ll] - e_val[mm]);
-		z = e_val[lm] * e_val[lm] + x*x;
-		y = - e_val[lm] / sqrt((double)(z));
-
-		if (x < 0)  
-		{
-			y = -y;
-		}
-
-		z = sqrt( (double)(1.0-y*y) );
-		sinx = y / sqrt( (double)( 2.0*(1.0 + z) ) );
-		sinx2 = sinx * sinx;
-		
-		cosx = sqrt( (double)(1.0 - sinx2) );
-		cosx2 = cosx * cosx;
-
-		sincs = sinx * cosx;
-	
-		ilq = dim * l;
-		imq = dim * m;
-
-		for (i = 0; i < dim; i++)
-		{
-			iq = (i*i + i)/2;
-			if ( i != l )
-			{
-				if (i != m)
-				{
-					if (i > m) 
-						im = m + iq;
-					else
-						im = i + mq;
-					if (i < l)
-						il = i + lq;
-					else
-						il = l + iq;
-
-					x = e_val[il] * cosx - e_val[im] * sinx;
-					e_val[im] = e_val[il] * sinx + e_val[im] * cosx;
-					e_val[il] = x;
-				}
-			}
-		}
-		x = 2.0 * e_val[lm] * sincs;
-		y = e_val[ll] * cosx2 + e_val[mm] * sinx2 - x;
-		x = e_val[ll] * sinx2 + e_val[mm] * cosx2 + x;
-
-		e_val[lm] = (e_val[ll]-e_val[mm])*sincs+e_val[lm]*(cosx2-sinx2);
-		e_val[ll] = y;
-		e_val[mm] = x;
-	}
-
-	if (m != (dim-1))
-	{
-		m = m + 1;	goto l4;
-	}
-	if (l != (dim-2))
-	{
-		l = l + 1;	goto l3;
-	}
-	if (ind == 1)
-	{
-		ind = 0;	goto l2;
-	}
-	if (thr > anrmx) goto l1;
-
-l5:
-	iq = -dim;
-
-	for (i = 0; i < dim; i++)
-	{
-		iq = iq + dim;
-		ll = i + (i*i + i)/2;
-		jq = dim * (i-1);
-
-		for (j = i; j < dim; j++)
-		{
-			jq = jq + dim;
-			mm = j + (j*j + j)/2;
-
-			if (e_val[ll] < e_val[mm])
-			{
-				x = e_val[ll];
-				e_val[ll] = e_val[mm];
-				e_val[mm] = x;
-			}
-		}
-	}
-
-	for ( i = 0; i< dim; i++){
-		mt(i,0) = e_val[(i*(i+1))/2+i];
-	}
-
-	delete []cov;	//SSL0296
-	delete []e_val; //SSL0296
-
-	return true;
-}
-
-//--------------------------------------------------EigenVectors
-//
-//	Metodo adaptado a partir de uma implementacao em C
-//	utilizada no software SITIM.
-
-int
-TeMatrix::EigenVectors( TeMatrix& mt ) const
-{
-	if( &mt == this ){
-		printf("\nMatrix::EigenVectors >>> Operacao usa duas matrizes\n");
-		return false;
-	}
-
-double	*cov	= NULL,		/* matriz de covariancia	*/
-	*e_val	= NULL,		/*   "    de auto_valores	*/
-	*e_vec	= NULL; 	/*   "    de auto_vetores	*/
-
-int 	dim = (*this).Nrow();		/* ordem da matriz*/
-
-int	i,j,ij,k,       /*   cov[], e_val[]    */
-	ia,             /*                     */
-	ind,            /*     |0      |       */
-	l,m,            /*     |1 2    |       */
-	mq,lm,          /*     |3 4 5  |       */
-	ll,mm,          /*     |6 7 8 9|       */
-	ilq,imq,        /*                     */
-	im,iq,il,lq,    /*    (para DIM=4)     */
-	ilr,imr,
-	jq;
-
-double	range,          /*       e_vec[]       */
-	dim1,fdim,      /*                     */  
-	anorm,          /*    |0  4  8 12|     */
-	anrmx,          /*    |1  5  9 13|     */
-	thr,            /*    |2  6 10 14|     */
-	x,y,z,          /*    |3  7 11 15|     */
-	sinx,cosx,      /*                     */
-	sinx2,cosx2,
-	sincs;
-
-	if( dim <= 0 ){
-		printf("\nMatrix::EigenValues >>> dimensao da matriz nula!\n");
-		return false;
-	}
-	if( mt.Init( dim, (double)1 ) == false ){
-		printf("\nMatriz::EigenVectors >>> Memoria nao disponivel!\n");
-		return false;
-	}
-
-	int fat =(dim*dim+dim)/2;
-	range = 1.0e-6 ;
-	dim1 = dim - 1 ;
-	fdim = dim;
-
-	cov   = new double[fat];
-	e_vec = new double[dim*dim];
-	e_val = new double[fat];
-
-	if( cov == NULL || e_vec == NULL || e_val == NULL ){
-		printf("\nMatrix::EigenVectors >>> Memoria nao disponivel\n");
-		return false;
-	}
-
-	k = 0;
-	for ( i = 0; i< dim; i++)
-		for ( j = 0; j <= i; j++)
-			cov[k++] = (*this)(i,j);
-
-	for (i=0; i < ((dim*dim+dim)/2); i++) e_val[i] = cov[i];
-
-	iq = -dim;
-	for (i = 0; i < dim; i++)
-	{
-		iq = iq + dim;
-		for ( j = 0; j < dim; j++)
-		{
-			ij = iq + j;
-			if (i == j)
-				e_vec[ij] = 1.0;
-			else
-				e_vec[ij] = 0.0;
-		}
-	}
- 
-	anorm = 0.0;
-
-	for ( j = 0; j < dim; j++)
-	{	
-		for (i = 0; i <= j; i++)
-		{
-			if (i != j)
-			{
-				ia = i + (j*j+j)/2;
-				anorm = anorm + e_val[ia] * e_val[ia];
-			}
-		}
-	}
-
-	if (anorm <= 0) goto l5;
-
-	anorm = 1.414 * sqrt((double)anorm);
-	anrmx = anorm * range/fdim;
-	ind   = 0;
-	thr   = anorm;
-
-l1:
-	thr = thr/fdim;
-l2:
-	l = 0;
-l3:
-	m = l+1;
-l4:
-	mq = (m*m + m)/2;
-	lq = (l*l + l)/2;
-	lm = l + mq;
-
-	if ( fabs((double)(e_val[lm])) >= thr )    
-	{
-		ind = 1;
-		ll = l + lq;
-		mm = m + mq;
-
-		x = 0.5 * (e_val[ll] - e_val[mm]);
-		z = e_val[lm] * e_val[lm] + x*x;
-		y = - e_val[lm] / sqrt((double)(z));
-
-		if (x < 0)  
-		{
-			y = -y;
-		}
-
-		z = sqrt( (double)(1.0-y*y) );
-		sinx = y / sqrt( (double)( 2.0*(1.0 + z) ) );
-		sinx2 = sinx * sinx;
-		
-		cosx = sqrt( (double)(1.0 - sinx2) );
-		cosx2 = cosx * cosx;
-
-		sincs = sinx * cosx;
-	
-		ilq = dim * l;
-		imq = dim * m;
-
-		for (i = 0; i < dim; i++)
-		{
-			iq = (i*i + i)/2;
-			if ( i != l )
-			{
-				if (i != m)
-				{
-					if (i > m) 
-						im = m + iq;
-					else
-						im = i + mq;
-					if (i < l)
-						il = i + lq;
-					else
-						il = l + iq;
-
-					x = e_val[il] * cosx - e_val[im] * sinx;
-					e_val[im] = e_val[il] * sinx + e_val[im] * cosx;
-					e_val[il] = x;
-				}
-			}
-
-			//---	calculate eigenvectors
-
-			ilr = ilq + i;
-			imr = imq + i;
-			x   = e_vec[ilr] * cosx - e_vec[imr] * sinx;
-			e_vec[imr] = e_vec[ilr] * sinx + e_vec[imr] * cosx;
-			e_vec[ilr] = x;
-		}
-
-		x = 2.0 * e_val[lm] * sincs;
-		y = e_val[ll] * cosx2 + e_val[mm] * sinx2 - x;
-		x = e_val[ll] * sinx2 + e_val[mm] * cosx2 + x;
-
-		e_val[lm] = (e_val[ll]-e_val[mm])*sincs+e_val[lm]*(cosx2-sinx2);
-		e_val[ll] = y;
-		e_val[mm] = x;
-	}
-
-	if (m != (dim-1))
-	{
-		m = m + 1;	goto l4;
-	}
-	if (l != (dim-2))
-	{
-		l = l + 1;	goto l3;
-	}
-	if (ind == 1)
-	{
-		ind = 0;	goto l2;
-	}
-	if (thr > anrmx) goto l1;
-
-l5:
-	iq = -dim;
-
-	for (i = 0; i < dim; i++)
-	{
-		iq = iq + dim;
-		ll = i + (i*i + i)/2;
-		jq = dim * (i-1);
-
-		for (j = i; j < dim; j++)
-		{
-			jq = jq + dim;
-			mm = j + (j*j + j)/2;
-
-			if (e_val[ll] < e_val[mm])
-			{
-				x = e_val[ll];
-				e_val[ll] = e_val[mm];
-				e_val[mm] = x;
-
-				for (k = 0; k < dim; k++)
-				{
-					ilr = iq + k;
-					imr = jq + k;
-					x   = e_vec[ilr];
-					e_vec[ilr] = e_vec[imr];
-					e_vec[imr] = x;
-				}
-			}
-		}
-	}
-	
-	k=0;
-	for ( i = 0; i< dim; i++){
-		for ( j = 0; j< dim; j++)
-			mt(j,i) = e_vec[k++];
-	}
-
-	delete []cov;	//SSL0296
-	delete []e_vec;	//SSL0296
-	delete []e_val; //SSL0296
-
-	return true;
-}
-
-//--------------------------------------------------EigenVec
-//
-//	Metodo desenvolvido para suporte de decisao (suporte_stubs.cpp)
-//	Missae Yamamoto  (junho/1999)
-
-int
-TeMatrix::EigenVec( double e_vec[] )
-{
-
-double	*e_vec_aux	= NULL, soma = 0.0; 
-	
-int 	dim = (*this).Nrow();		/* ordem da matriz*/
-
-TeMatrix  aux1, aux2, mt;
-
-int	i,j,k;       
-	
-	if( dim <= 0 )
-	{
-		printf("\nMatrix::EigenVecVal >>> dimensao da matriz nula!\n");
-		return false;
-	}
-
-	if( aux1.Init( dim, (double)1 ) == false )
-	{
-		printf("\nMatrix::EigenVecVal >>> Memoria nao disponivel!\n");
-		return false;
-	}
-
-	if( aux2.Init( dim, (double)1 ) == false )
-	{
-		printf("\nMatrix::EigenVecVal >>> Memoria nao disponivel!\n");
-		return false;
-	}
-
-	e_vec_aux = new double[dim];
-
-	if( e_vec_aux == NULL )
-	{
-		printf("\nMatrix::EigenVecVal >>> Memoria nao disponivel\n");
-		return false;
-	}
-
-	for ( k = 0; k< dim; k++)
-	{
-		e_vec_aux[k] = 0.0;
-		e_vec[k] = 0.0;
-	}
-
-	aux1 = *this;
-	aux2 = *this;
-	
-	for (;;)
-	{
-		mt = aux1 * aux2;
-
-		for (i=0; i<dim; i++)
-		{
-			for (j=0; j<dim; j++)
-				 e_vec[i] = e_vec[i] + mt(i,j);
-			soma = soma + e_vec[i];
-		}
-
-		for (j=0; j<dim; j++)
-			e_vec[j] = e_vec[j] / soma;
-
-		for (j=0; j<dim; j++)
-		{
-			if ( fabs(e_vec_aux[j] - e_vec[j]) < 0.001 ) 
-			{
-				delete []e_vec_aux;	
-				return true;
-			}
-			e_vec_aux[j] = e_vec[j];
-		}
-
-		aux1 = mt;
-		aux2 = mt;
-	}
-
-}
-
-double TeMatrix::getTrace() const
-{
-  TEAGN_TRUE_OR_THROW( ( nrow == ncol ), 
-    "Cannot get trace from a non-square matrix" );
-    
-  double trace = 0.0;
-  
-  for( int curr_row = 0 ; curr_row < nrow ; ++curr_row ) {
-    trace += mat[ curr_row ][ curr_row ];
-  }
-  
-  return trace;
-}
-
-
-bool TeMatrix::getIdentity( TeMatrix& identity, unsigned int width )
-{
-  if( identity.Init( width, width, 0.0 ) == 0 ) return false;
-  
-  for( unsigned int curr_row = 0 ; curr_row < width ; ++curr_row ) {
-    identity( curr_row, curr_row ) = 1.0;
-  }
-  
-  return true;
-}
-
-//------------------------------------------ Print
-void
-TeMatrix::Print()
-{
-	//printf("\nMATRIZ ( %d, %d ) LIXO %f **mat %p\n", nrow,ncol, lixo, mat);
-	printf("\nMATRIZ ( %d, %d )\n\n", nrow,ncol);
-	if( mat == NULL ){
-		printf("\n>>> mat e NULL \n");
-		return;
-	}
-	int i,j;	
-	for(i = 0; i < nrow; i++){
-		for( j = 0; j < ncol;j++){
-			printf("%10.4f ",(float)mat[i][j]);
-		}
-		printf("\n\n");
-	}
-}
-
-// VRMC 12/98
-int
-TeMatrix::CholeskyDecomp( TeMatrix& mt )
-{
-
-	//--	Verify if the matrix is simetric
-	if ((*this).isSimetric() == false){
-		printf("\nMatrix::CholeskyDecomp >>> Matriz nao e simetrica!\n");
-		return false;
-	}
-	//--	Verify if the matrix is positive definide
-	if ((*this).isPositiveDefinide() == false){
-		printf("\nMatrix::CholeskyDecomp >>> Matriz nao e positiva definida!\n");
-		return false;
-	}
-	if( &mt == this ){
-		printf("\nMatrix::CholeskyDecomp >>> Operacao usa duas matrizes\n");
-		return false;
-	}
-	if( mat[0][0] <= 0. ){
-		printf("\nMatrix::CholeskyDecomp >>> Posicao [0,0] e' nula\n");
-		return false;
-	}
-    if( mt.Init(nrow,ncol) == false ){
-		printf("\nMatrix::CholeskyDecomp>>>no memory \n");
-		return false;
-   	}
-	mt(0,0) = (double)sqrt((double)(*this)(0,0));
-
-	//---	Calculate the first column of the TeMatrix mt
-
-	int i,j,k;
-	for( i= 0; i < nrow; i++){
-		mt(i,0) = (*this)(i,0)/mt(0,0);
-	}
-	 
-	for( i= 1; i < nrow; i++){
-		for( j= 1; j <= i; j++){
-			//int m = (j*j - j)/2 + 1;
-			double rf = 0.;
-			//int k2 = j - 1;
-			//for( k = 0;k<=k2;k++)
-			for( k = 0;k < j;k++)
-				rf += mt(i,k) * mt(j,k);
-			if( i == j ){
-				rf = (*this)(i,j) - rf;
-				if( rf < 0. ){
-					printf("\nMatrix::CholeskyDecomp:ERRO \n");
-					return false;
-				}
-				mt(i,j) = (double)sqrt((double)rf);
-			}
-			else{
-				if( mt(j,j) == 0. ){
-					printf("\nMatrix::CholeskyDecomp:ERRO \n");
-					return false;
-				}
-				mt(i,j) = ((*this)(i,j)-rf)/mt (j,j );
-			}
-		}
-	}
-	return true;
-}
-
-
-//-------------------------------------------------Inverse(SITIM)
-//
-//---	Calcula a matriz inversa pelo metodo de Gauss-Jordan.
-//
-
-int
-TeMatrix::Inverse( TeMatrix& matinv ) const
-{
-
-	if( &matinv == this ){
-		printf("\nMatrix::Inverse >>> Operacao usa duas matrizes\n");
-		return false;
-	}
-	if ( nrow != ncol ){
-       		printf("\nMatrix::Inverse: can't invert a non-square matrix");
-       		return false;
-   	 }
-
-	if( matinv.Init( this->nrow, (double)1 ) == false ){
-		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
-		return false;
-	}
-
-//---	Calculo da inversa se a matriz tem dimensao unitaria
-
-	if(nrow == 1){
-		if(mat[0][0] == 0.0) {
-		        printf("\noperator~: can't invert singular matrix");
-			return false;
-		}
-    		matinv(0,0) = 1. / mat[0][0];
-    		return true;
-	}
-  
-//---	Formacao da matriz aumentada mataum
-
-	int	m2   = 2 * nrow ;
-	TeMatrix	mataum;
-
-	if( mataum.Init( nrow , m2 ) == false ){
-	   printf("\nInverse:no memory");
-	   return false;
-       	}
-	
-	int i1,i2,i3;
-	for(i1 = 0 ; i1 < nrow ; i1++){
-		for( i2 = 0 ; i2 < ncol ; i2++)
-        		mataum(i1,i2) = mat[i1][i2];
-
-		for( i3 = nrow ; i3 < m2 ; i3++)
-        		mataum(i1,i3) = 0.0;
-
-		mataum( i1, i1 + nrow) = 1.0;
-	}
-
-//--	Inicializa ponteiro de linhas
-
-	double	*maxlinha = NULL;
-
-	if( ( maxlinha = new double[nrow] ) == NULL ){
-		printf("\nMatrix::Inverse>>no memory");
-		return false;
-	}
-
-	double	sup,lcon1,amul,pivo;
-	int	* lp = NULL;
-
-	if( (lp = new int[nrow]) == NULL ){
-		printf("\nMatrix::Inverse>>no memory");
-		if( maxlinha != NULL){delete []maxlinha; maxlinha = NULL;} //SSL0296
-		return false;
-	}
-
-	for(i1 = 0 ; i1 < nrow ; i1++)
-		lp[i1] = i1;
-
-	int	lcon = 0;
-	int	m1 = nrow - 1;
-
-	while(lcon < nrow){
-//---		Selecao do maior valor em cada linha . seu inverso e armazenado em maxlinha.
-		for(i1 = 0 ; i1 < nrow ; i1++){
-			sup = 0.0;
-			for(i2 = 0 ; i2 < nrow ; i2++){
-				lcon1 = (double)fabs(mataum(lp[i1],i2));
-				if((lcon1 - sup ) > 0.000001 )
-				sup = lcon1;
-			}
-			if(sup == 0.0){
-				if( maxlinha != NULL){ delete []maxlinha; maxlinha = NULL; } //SSL0296
-				if( lp != NULL){ delete []lp; lp = NULL; } //SSL0296
-				return false;
-			}
-			maxlinha[lp[i1]] = 1.0 / sup;
-		 }
-
-//---		Selecao do pivo em cada linha
-
-		int lpi;
-		double	supc = fabs((double)( mataum(lp[lcon],lcon) * maxlinha[lp[lcon]] ));
-		pivo = mataum(lp[lcon],lcon);
-		lpi  = lcon;
-		for(i1 = lcon ; i1 < nrow ; i1++){
-        		amul = mataum(lp[i1],lcon) * maxlinha[lp[i1]];
-			if (fabs(amul) > supc ){
-			supc = (fabs((double)amul));
-			pivo = mataum(lp[i1],lcon);
-			lpi  = i1;
-			}
-		}
-
-		if(pivo == 0.0){
-			if( maxlinha != NULL){ delete []maxlinha; maxlinha = NULL; } //SSL0296
-			if( lp != NULL){ delete []lp; lp = NULL; } //SSL0296
-			return false;
-		}
-     
-		/* troca de linhas */
-		i1 	 = lp[lcon];
-		lp[lcon] = lp[lpi];
-		lp[lpi]  = i1;
-	
-//---		Divide a linha pelo pivo
-		for(i2 = 0 ; i2 < m2 ; i2++){
-			mataum(lp[lcon],i2) = mataum(lp[lcon],i2) / pivo ;
-		}
-
-//---		Realiza subtracoes nas linhas de forma a zerar os elementos da coluna
-//---		dada pelo indice lcon
-
-		int	il = lcon;
-
-		for(i2 = 0; i2 < m1 ; i2++){
-	        	il = il + 1;
-			if(il >= nrow ) il = 0;
-			double	aux = - mataum(lp[il],lcon);
-			for(i3 = lcon; i3 < m2 ; i3++)
-				mataum(lp[il],i3) = mataum(lp[il],i3) + aux * mataum(lp[lcon],i3);
-
-			mataum(lp[il],lcon) = 0.0;
-		}
-
-		lcon = lcon + 1;
-	}
-
-//---	Copia a parte extendida de mataum em matinv que passa a ser a matriz inversa
-	for(i1 = 0 ; i1 < nrow ; i1++){
-		for(i2 = nrow ; i2 < m2 ; i2++)
-		{
-        		i3 = i2 - nrow ;
-			matinv(i1,i3) = mataum(lp[i1],i2);
-		}
-	}
-
-	if( maxlinha != NULL){
-		delete []maxlinha; //SSL0296
-		maxlinha = NULL;
-	}
-	if( lp != NULL){
-		delete []lp; //SSL0296
-		lp = NULL;
-	}
-
-	return true;
-}
-
-//	Esse m�todo, n�o esta correto 
-//------------------------------------------Inverse
-//	NIH library
-// 1. triangulate: *this = ~P*T
-// 2. when T isUpperTriangle ~T isUpperTriangle
-// 3. split: T = T.row(0) + subT
-// 4. I = ~T*T
-// 5. ~T.at(0,0) = 1/T.at(0,0)
-// 6. sub~T = ~(subT)
-// 7. ~T.row(0) = [1/T.at(0,0)]&B
-//    where T.at(0,0)*B = [t21 ... t2n]*~subT
-// 8. ~*this = ~T*P
-
-/*int 
-TeMatrix::InverseNIH( TeMatrix& mt ) const
-{
-	TeMatrix  r;
-	TeMatrix	_subT;
-	TeMatrix	B;
-	TeMatrix	val;
-
-	if ( nrow!=ncol || nrow <= 0 || ncol <= 0 ){
-		printf("\nMatrix::Inverse >>> Matriz nao inversivel!\n");
-		return false;
-	}
-
-	if( mt.Init( this->nrow, (double)1 ) == false ){
-		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
-		return false;
-	}
-
-	if ( nrow==1 ){
-		if( mat[0][0] == (double)0 ){
-			printf("\nMatrix::Inverse >>> Matriz nao inversivel!\n");
-			return false;
-		}
-		mt.mat[0][0] = 1/mat[0][0];
-		return true;
-   	}
-	TeMatrix T(*this);
-	if( T.Initialized() == false ){
-		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
-		return false;
-	}
-		
-	// 1. triangulate: *this = ~P*T
-	TeMatrix P;
-	if( P.Init(nrow,ncol) == false){
-		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
-		return false;
-	}
-	if( T.UpperTriangle( P ) == false ){
-		printf("\nMatriz::Inverse >>> ERRO!\n");
-		return false;
-	}
-	if ( T.Determinant()==0 ) {
-		printf("\nMatrix::Inverse >>> can't invert singular matrix\n");
-		return false;
-	}      
-
-	// 2. when T isUpperTriangle ~T isUpperTriangle
-	// 3. split: T = T.row(0) + subT
-
-	if( r.Init(1,ncol-1,&(T.mat[0][1])) == false){
-		printf("\nMatrix::Inverse* >>> Memoria nao disponivel\n");
-		return false;
-	}
-
-	T.CoFactor(0,0,mt);
-	mt.Inverse(_subT);
-	if( _subT.Initialized()  == false){
-		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
-		return false;
-	}
-
-
-	B = (-(1/T.mat[0][0])*r*_subT);
-	if( B.Initialized() == false ){
-		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
-		return false;
-	}
-
-	if( val.Init(nrow,ncol) == false){
-		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
-		return false;
-	}
-
-	val.mat[0][0] = 1/T.mat[0][0];
-	int i;
-	for(i=1; i<ncol; i++) val.mat[0][i]=B.mat[0][i-1];
-	val.CoFactor(0,0,_subT);
-
- 	mt = val*P; // P is now the row-reduction transformation
-
-	return true; 
-}
-*/
-
-// os m�todos switchRows e combineRows ficarao comentados 
-// pois s� sao utilizados no calculo da matriz inversa NIH,
-// inversaNIH, que tambem foi comentado 
-/*void 
-TeMatrix::switchRows(int i,int j)
-{
-	double *tmp;
-
-	if( i < 0 || j < 0 || i >= nrow || j >= ncol ){
-		printf("\nMatrix::switchRows >>> Switching linhas invalidas\n");
-		return;
-	}
-	tmp    = mat[i];
-	mat[i] = mat[j];
-	mat[j] = tmp; 
-}
-
-void
-TeMatrix::combineRows(int i, double a, int j)
-{
-	if( i < 0 || j < 0 || i >= nrow || j >= ncol ){
-		printf("\nMatrix::combineRows >>> Combining linhas invalidas\n");
-		return;
-	}
-	int h;
-	for(h = 0; h < ncol; h++)
-	mat[i][h] += a * mat[j][h];
-}
-*/
-
-//--------Esse metodo nao esta correto e por isso ficar� comentado VRMC
-//----------------------------------------------------
-/*int 
-TeMatrix::UpperTriangle( TeMatrix& mt )
-{
-	if( &mt == this ){
-		printf("\nMatrix::UpperTriangle >>> Operacao usa duas matrizes\n");
-		return false;
-	}
-	if( mt.Init(nrow,(double)1) == false){
-		printf("\nMatrix::UpperTriangle >>> Memoria nao disponivel\n");
-		return	false;
-	}	
-
-	if ( this->isUpperTriangle() )
-		return true;
-	
-	int j;
-	for(j = 0; j < ncol; j++) {
-		int b_row = nrow-1;  // 1st non-zero entry from bottom
-		int t_row = j;       // 1st zero entry from the top
-
-		//--- switch rows until all zeros are at
-		//--- the bottom of jTH column 
-
-		while ( b_row>=t_row ) { 
-			while ( b_row > j && mat[b_row][j] == 0. )
-				--b_row;
-			if ( b_row == j )
-				break; // bottom at diagonal
-			while ( b_row >= t_row && mat[t_row][j] != 0. )
-				++t_row;
-			if ( t_row == Nrow() )
-				break; // top at last row
-			if ( t_row > b_row )
-				break;
-			switchRows(b_row,t_row); 
-			mt.switchRows(b_row,t_row);
-		}
-
-		//--- now b_row is last non-zero entry from the top
-		//--- now t_row is first zero entry from the bottom
-		//--- combine until all entries below diagonal in jTH column = 0
-
-		if ( b_row <= j )
-			continue;
-			int i;
-		for( i = j+1; i<= b_row; i++) {
-			double f = -mat[i][j] / mat[j][j];
-			combineRows(i,f,j);
-			mt.combineRows(i,f,j);
-		}
-	}
-	return true;
-}
-*/
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+ // TeMatrix.c -- matrix of type double
+
+#include <TeMatrix.h>
+
+#include <TeAgnostic.h>
+
+#include <math.h>
+#include <stdio.h>
+
+
+TeMatrix::TeMatrix(){
+	nrow = 0;
+	ncol = 0;
+	mat  = NULL;
+}
+
+void
+TeMatrix::Clear()
+{
+	if( mat != NULL ){
+		int i;
+		for( i = 0; i < nrow; i++ )
+			if( mat[i] != NULL )
+			{
+				delete []mat[i];
+				mat[i]=NULL;
+			}
+		delete []mat;
+		mat = NULL;
+	}
+	nrow = ncol = 0;
+}
+
+TeMatrix::~TeMatrix()
+{
+	Clear();
+}
+
+short
+TeMatrix::Alloc(int nl, int nc)
+{
+	Clear();
+	if( nl <= 0 || nc <= 0 ){
+		return true;
+	}
+	nrow = nl;
+	ncol = nc;
+	if (  (mat = new double*[nrow]) == NULL ){
+		Clear();
+		return false;
+	}
+	int i,j;
+	for( i = 0; i < nrow; i++ ) mat[i] = NULL;
+	for( i = 0; i < nrow; i++ ){
+		if( (mat[i] = new double[ncol]) == NULL ){
+			Clear();
+	       		return false;
+		}
+		for( j = 0; j < ncol; j++ ) mat[i][j] = (double)0.;
+	}
+	return true;
+}
+
+TeMatrix::TeMatrix(const TeMatrix& m)
+{
+     nrow = ncol = 0;
+     mat = NULL;
+    *this = m;
+}
+
+int
+TeMatrix::Init( int nl, int nc , double* f )
+{
+ 	if( f == NULL )
+		return Init( nl, nc,  (double) 0 );
+	if( Alloc( nl, nc ) ){
+		int c=0;
+		int i,j;
+		for ( i = 0; i < nrow; i++)
+			for (j = 0; j < ncol; j++)
+				mat[i][j] = f[c++];
+		return true;
+	}
+	return false;
+}
+
+int
+TeMatrix::Init(int nl, int nc, double f )
+{
+ 	// initialize matrix
+	if( Alloc( nl, nc ) ){
+ 		int i,j;
+     		for (i = 0; i < nrow; i++)
+       			 for (j = 0; j < ncol; j++)
+        		 	mat[i][j] = f;
+		return true;
+	}
+	return false;
+}
+
+int
+TeMatrix::Init(int k, double* f)
+{
+ 	if( f == NULL )
+		return Init( k, k,  (double) 0 );
+	if( Alloc(k,k) == false ) 
+		return false;
+	int i,j;
+	for ( i = 0; i < nrow; i++  )
+    		for (j = 0; j < ncol; j++)
+        		mat[i][j] = (i==j)? f[i]: (double)0.;
+   	return true;
+}
+
+int
+TeMatrix::Init(int k, double f)
+{
+	if( Alloc(k,k) == false )
+		return false;
+	int i,j;
+	for (i=0; i<nrow; i++)
+		for (j=0; j<ncol; j++)
+			mat[i][j] = (i==j)? (double)f:0;
+	return true;
+}
+
+TeMatrix& 
+TeMatrix::operator=(const TeMatrix& m)
+{
+
+	if( Alloc(m.nrow,m.ncol) == false ){
+		printf("\nMatrix::operator=:no memory available \n");
+		return *this;
+    	}
+	int	i,j;
+    	for( i = 0; i < nrow; i++)
+     		for( j = 0; j < ncol; j++)
+       			mat[i][j] = m.mat[i][j];
+    	return *this;
+}
+
+int
+TeMatrix::operator==(const TeMatrix& m) const
+{
+	if( nrow != m.nrow || ncol != m.ncol )
+		return false;
+	int	i,j;
+	for ( i = 0; i < nrow; i++)
+		for ( j = 0; j < ncol; j++)
+			if ( mat[i][j]!= m.mat[i][j] )
+				return false;
+	return true;
+}
+
+void
+TeMatrix::operator*=(double f)
+{
+	int	i,j;
+	for( i = 0; i < nrow; i++)
+		for( j = 0; j < ncol; j++)
+			mat[i][j] *= f;
+	return;
+}
+
+
+//-------------------------------------------------------------friend methods
+
+TeMatrix
+operator+(const TeMatrix& m,const TeMatrix& n)
+{
+	if( m.nrow != n.nrow || m.ncol != n.ncol ){
+		printf("\nMatrix::operator+ >>> Operandos com tamanhos diferentes\n");
+	        return  m;
+	} 
+	TeMatrix rm;
+	if( rm.Init(m.Nrow(),m.Ncol()) == false ){
+		printf("\nMatrix::operator+ >>> Memoria nao disponivel\n");
+		return	m;
+	}
+	int	i,j;
+	for ( i = 0; i < m.Nrow(); i++)
+		for ( j = 0; j < m.Ncol(); j++)
+			rm.mat[i][j] = m.mat[i][j] + n.mat[i][j];
+	return rm;
+}
+
+TeMatrix
+operator-(const TeMatrix& m,const TeMatrix& n)
+{
+	if( m.nrow != n.nrow || m.ncol != n.ncol ){
+		printf("\nMatrix::operator+ >>> Operandos com tamanhos diferentes\n");
+	        return  m;
+	} 
+	TeMatrix rm;
+	if( rm.Init(m.Nrow(),m.Ncol()) == false ){
+		printf("\nMatrix::operator- >>> Memoria nao disponivel\n");
+		return	m;
+	}
+
+	int	i,j;
+	for ( i = 0; i <  m.Nrow(); i++)
+		for ( j = 0; j < m.Ncol(); j++)
+			rm.mat[i][j] = m.mat[i][j] - n.mat[i][j];
+	return rm;
+}
+
+TeMatrix
+TeMatrix::operator-()
+{
+	TeMatrix rm;  
+	if( rm.Init(Nrow(),Ncol()) == false ){
+		printf("\n operator-:no memory \n");
+		return	*this;
+	}
+	int i,j;
+	for (i=0; i<Nrow(); i++)
+		for (j=0; j<Ncol(); j++)
+			rm.mat[i][j] = -mat[i][j];
+	return rm;
+}
+
+TeMatrix 
+operator*(const TeMatrix& m,const TeMatrix& n)
+{
+	if ( m.Ncol() != n.Nrow() ) {
+		printf( "\nMatrix::operator* >>> Operandos com tamanhos diferentes\n");
+		return m;
+	}
+	int nr = m.Nrow(), nc =n.Ncol();
+	TeMatrix result;
+	if( result.Init(nr,nc) == false){
+		printf("\nMatrix::operator* >>> Memoria nao disponivel\n");
+		return	m;
+	}
+
+	double	sum = (double)0.;
+	int	l,c,i;
+
+	for ( l = 0; l < m.Nrow(); l++){
+		for ( c = 0; c < n.Ncol(); c++){
+        		sum = (double)0.;
+			for ( i = 0; i < m.Ncol(); i++)
+				sum += m.mat[l][i] * n.mat[i][c];
+    			result.mat[l][c] = sum;
+
+		}
+	}
+	return result; 
+}
+
+TeMatrix
+operator*(double f,const TeMatrix& m)
+{
+	int nr = m.Nrow(), nc =m.Ncol();
+	TeMatrix rm;
+	if( rm.Init(nr,nc) == false){
+		printf("\noperator*:no memory");
+		return m;
+	}
+	int i,j;
+	for (i = 0; i < rm.Nrow(); i++)
+		for (j = 0; j < rm.Ncol(); j++)
+			rm.mat[i][j] = f * m.mat[i][j];
+	return rm;
+}
+
+//VRMC 12/98
+int
+TeMatrix::isUpperTriangle() const
+{
+	// elements above diagonal != 0
+	int i,j;
+	for(j = 0; j < ncol; j++)
+		for(i = j+1; i < nrow; i++)
+			if ( mat[i][j]  != (double)0. )
+				return false;
+	return true;
+}
+
+//VRMC 12/98
+int
+TeMatrix::isLowerTriangle() const	
+{
+	// elements under diagonal different 0
+	int i,j;
+	// VRMC 11/98
+	for (i=0; i< nrow; i++)
+		for (j= i+1; j <ncol; j++)
+			if ( mat[i][j] != (double)0. )
+				return false;
+	return true;
+}
+
+double
+TeMatrix:: Determinant() const
+{
+  TEAGN_DEBUG_CONDITION( Nrow() == Ncol(), 
+    "Tyring to calculate a determinant from a non-square matrix" );
+    
+	if (Nrow()==1) return mat[0][0];
+	if (Nrow()==2)
+		return mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0];
+	if (Nrow()==3) 
+		return (  mat[0][0] * mat[1][1] * mat[2][2]
+			 +mat[0][1] * mat[1][2] * mat[2][0]
+			 +mat[0][2] * mat[1][0] * mat[2][1]
+			 -mat[0][1] * mat[1][0] * mat[2][2]
+			 -mat[0][0] * mat[1][2] * mat[2][1]
+ 			 -mat[0][2] * mat[1][1] * mat[2][0] );
+	if ( isUpperTriangle() ) {
+		double val = 1;
+		int i;
+		for (i = 0; i < Nrow(); i++) val *= mat[i][i];
+		return val;
+    	}
+	TeMatrix mt;
+	double val = 0;
+	double det = 0;
+	int sign = 1;
+	int j;
+	for(j = 0; j < Ncol(); j++) {
+		if( CoFactor(0,j, mt) == false )
+			return (double)0;
+		det = mt.Determinant();		
+		val += sign * mat[0][j] * det;
+		sign *= -1;
+     	}
+	return val;
+}
+
+int
+TeMatrix::CoFactor(int irow, int jcol, TeMatrix& mt ) const
+{
+ 	if ( nrow == 1||ncol == 1 ) {
+		printf("\nMatrix::CoFactor >>>  can't CoFactor row or column matrix\n");
+		return false;
+   	}
+	if( mt.Init(nrow-1,ncol-1) == false){
+		printf("\nMatrix::CoFactor: Memoria nao disponivel\n");
+		return false;
+	}
+	int getcol, getrow =0;
+	int i,j;
+	for(i=0; i < mt.Nrow(); i++) {
+		if ( getrow == irow ) ++getrow;
+		if ( getrow == nrow ) break;
+		getcol = 0;
+		for(j=0; j < mt.Ncol(); j++) {
+			if ( getcol==jcol ) ++getcol;
+			if ( getcol==ncol ) continue;
+			mt.mat[i][j] = mat[getrow][getcol];
+			++getcol;
+		}
+		++getrow;
+	}
+	return true;
+}
+
+int 
+TeMatrix::Transpose( TeMatrix &rm ) const
+{
+	if( &rm == this ){
+		printf("\nMatrix::Transpose >>> Operacao usa duas matrizes\n");
+		return false;
+	}
+
+	if( rm.Init( ncol, nrow ) == false){
+		printf("\nMatrix::Transpose >>> Memoria nao disponivel\n");
+		return false;
+	}
+	int i,j;
+	for(i = 0; i < ncol; i++)
+		for( j = 0; j < nrow; j++)
+			rm.mat[i][j] = mat[j][i];
+	return true;
+}
+
+// VRMC 12/98
+int
+TeMatrix::isSimetric()	const
+{
+	int i,j;
+
+	if (nrow != ncol){
+		printf("\nMatrix::isSimetric >>> Memoria nao disponivel\n");
+		return false;
+	}
+
+	for (i = 0; i < nrow; i++)
+		for (j = 0; j < ncol; j++)
+			if ( mat[i][j] != mat[j][i]) return false;
+
+	return	true;
+}
+
+// VRMC 12/98
+int		
+TeMatrix::isPositiveDefinide() const
+{
+	int i, j, dim, subdim;
+	TeMatrix	Submat;
+
+	if (nrow != ncol){
+		printf("\nMatrix::isPositiveDefinide >>> Matriz tem que ser quadrada\n");
+		return false;
+	}
+	dim = nrow;
+
+	for (subdim=1 ; subdim <= dim; subdim++)
+	{
+		if( Submat.Init( subdim,subdim ) == false ){
+			printf("\nMatrix::isPositiveDefinide>>>Memoria nao disponivel!\n");
+			return false;
+		}
+
+		for ( i=0; i < subdim; i++)
+			for (j = 0; j < subdim; j++)
+				Submat(i,j) = mat[i][j];
+		
+		if (Submat.Determinant() <= 0.) {
+			printf("\nMatrix::isPositiveDefinide>>>Matriz nao e positiva definida!\n");
+			return false;
+		}
+
+		Submat.Clear();
+	}
+	return true;
+}
+
+// VRMC 12/98
+int
+TeMatrix :: MatTransf( TeMatrix& mt )
+{
+	TeMatrix	TI;	// inverse of a inferior triangular matrix
+	int	dim;
+
+	if( &mt == this ){
+		printf("\nMatrix::MatTransf >>> Operacao usa duas matrizes\n");
+		return false;
+	}
+
+	if( nrow <= 0 || ncol <= 0 ){
+		printf("\nMatrix::MatTransf >>> Dimensoes da matriz invalidas!\n");
+		return false;
+	}
+
+	if( nrow != ncol ){
+		printf("\nMatrix::MatTransf >>> Dimensoes da matriz invalidas!\n");
+		return false;
+	}
+
+	dim = nrow;
+	if( mat[0][0] <= 0. ){
+		printf("\nMatrix::MatTranf >>> ERROR\n");
+		return false;
+	}
+
+	if( TI.Init( dim, (double)0. ) == false ){
+		printf("\nMatrix::MatTransf >>> Memoria nao disponivel!\n");
+		return false;
+	}
+
+
+	//--	Calculate inferior triangular matrix by Cholesky decomposition method
+	if ((*this).CholeskyDecomp(TI) == false) {
+		printf("\nMatrix::MatTransf>>> Nao foi possivel decompor a matriz!\n");
+		return false;
+	}
+
+	//--	Calculate the inverse of Cholesky matrix
+//	if (TI.CholeskyInv(mt) != true)
+	if (!(TI.CholeskyInv(mt)))
+	{
+		printf("\nMatrix::MatTransf>>> Matriz nao inversivel!\n");
+		return false;
+	}
+
+	return true;
+}
+
+// VRMC 12/98			
+int
+TeMatrix::CholeskyInv (TeMatrix&	mt) const
+{
+	if( mt.Init(nrow,(double)0.) == false ){
+		printf("\nMatrix::CholeskyInv >>> Memoria nao disponivel!\n");
+		return false;
+	}
+
+	if( &mt == this ){
+		printf("\nMatrix::CholeskyInv >>> Operacao usa duas matrizes\n");
+		return false;
+	}
+	if ( nrow != ncol ){
+       		printf("\nMatrix::CholeskyInv>>> Can't invert a non-square matrix");
+       		return false;
+   	}
+//	if (this->isLowerTriangle() != true) {
+	if (!(this->isLowerTriangle())) {
+		printf("\nMatrix::CholeskyInv >>> Matriz nao e triangular inferior\n");
+		return false;
+	}
+
+	int i; double rf;
+	for( i = 0; i < nrow; i++ ){
+		if( this->mat[i][i] == (double)0. ){
+			printf("\nMatrix::CholeskyInv >>> ERROR IV\n");
+			return false;
+		}
+		mt.mat[i][i] = (double)1. / this->mat[i][i];
+		int j,k;
+		for( j = i-1; j >= 0; j-- ){
+			rf = (double)0.;
+			for( k = j; k <= i-1; k++ ){
+				rf += ( this->mat[i][k] * mt.mat[k][j] );
+			}
+			mt.mat[i][j] = -rf * mt.mat[i][i];
+		}
+	}
+	return true;
+}
+	
+
+int
+TeMatrix::EigenValues( TeMatrix& mt ) const
+{
+	//---	calcula os eigenvalues  de uma
+	//	matriz representada na forma vetorial 
+	//	Os auto valores sao devolvidos em ordem decrescente    
+	//	e ocupam as posicoes:  0, 2, 5, 9, ... .       
+
+	if( &mt == this ){
+		printf("\nMatrix::EigenValues >>> Operacao usa duas matrizes\n");
+		return false;
+	}
+
+double	*cov	= NULL,		/* matriz de covariancia	*/
+	*e_val	= NULL;		/*   "    de auto_valores	*/
+
+int 	dim = (*this).Nrow();		/* ordem da matriz*/
+
+int	i,j,k,		/*   cov[], e_val[]    */
+	ia,             /*                     */
+	ind,            /*     |0      |       */
+	l,m,            /*     |1 2    |       */
+	mq,lm,          /*     |3 4 5  |       */
+	ll,mm,          /*     |6 7 8 9|       */
+	ilq,imq,        /*                     */
+	im,iq,il,lq,    /*    (para DIM=4)     */
+	jq;
+
+double	range,          /*       e_vec[]       */
+	dim1,fdim,      /*                     */  
+	anorm,          /*    |0  4  8 12|     */
+	anrmx,          /*    |1  5  9 13|     */
+	thr,            /*    |2  6 10 14|     */
+	x,y,z,          /*    |3  7 11 15|     */
+	sinx,cosx,      /*                     */
+	sinx2,cosx2,
+	sincs;
+
+int 	fat = (dim*dim+dim)/2;
+
+	if( dim <= 0 ){
+		printf("\nMatrix::EigenValues >>> dimensao da matriz nula!\n");
+		return false;
+	}
+	if( mt.Init( dim, (double)1 ) == false ){
+		printf("\nMatrix::EigenValues >>> Memoria nao disponivel\n");
+		return false;
+	}
+	range = 1.0e-6 ;
+	dim1 = dim - 1 ;
+	fdim = dim;
+
+	cov = new double[fat];
+
+	if( cov == NULL ){
+		printf("\nMatrix::EigenValues >>> Memoria nao disponivel (COV)\n");
+		return false;
+	}
+
+	e_val = new double[fat];
+	if( e_val == NULL ){
+		delete []cov; //SSL0296
+		cov = NULL;
+		printf("\nMatrix::EigenValues >>> Memoria nao disponivel (EVAL)\n");
+		return false;
+	}
+	k = 0;
+	for ( i = 0; i< dim; i++)
+		for ( j = 0; j <= i; j++)
+			cov[k++] = mat[i][j];
+
+	for (i=0; i < ((dim*dim+dim)/2); i++) e_val[i] = cov[i];
+
+	anorm = 0.0;
+
+	for ( j = 0; j < dim; j++){
+		for (i = 0; i <= j; i++){
+			if (i != j){
+				ia = i + (j*j+j)/2;
+				anorm = anorm + e_val[ia] * e_val[ia];
+			}
+		}
+	}
+
+	if (anorm <= 0) goto l5;
+
+	anorm = 1.414 * sqrt((double)anorm);
+	anrmx = anorm * range/fdim;
+	ind   = 0;
+	thr   = anorm;
+
+l1:
+	thr = thr/fdim;
+l2:
+	l = 0;
+l3:
+	m = l+1;
+l4:
+	mq = (m*m + m)/2;
+	lq = (l*l + l)/2;
+	lm = l + mq;
+
+	if ( fabs((double)(e_val[lm])) >= thr )    
+	{
+		ind = 1;
+		ll = l + lq;
+		mm = m + mq;
+
+		x = 0.5 * (e_val[ll] - e_val[mm]);
+		z = e_val[lm] * e_val[lm] + x*x;
+		y = - e_val[lm] / sqrt((double)(z));
+
+		if (x < 0)  
+		{
+			y = -y;
+		}
+
+		z = sqrt( (double)(1.0-y*y) );
+		sinx = y / sqrt( (double)( 2.0*(1.0 + z) ) );
+		sinx2 = sinx * sinx;
+		
+		cosx = sqrt( (double)(1.0 - sinx2) );
+		cosx2 = cosx * cosx;
+
+		sincs = sinx * cosx;
+	
+		ilq = dim * l;
+		imq = dim * m;
+
+		for (i = 0; i < dim; i++)
+		{
+			iq = (i*i + i)/2;
+			if ( i != l )
+			{
+				if (i != m)
+				{
+					if (i > m) 
+						im = m + iq;
+					else
+						im = i + mq;
+					if (i < l)
+						il = i + lq;
+					else
+						il = l + iq;
+
+					x = e_val[il] * cosx - e_val[im] * sinx;
+					e_val[im] = e_val[il] * sinx + e_val[im] * cosx;
+					e_val[il] = x;
+				}
+			}
+		}
+		x = 2.0 * e_val[lm] * sincs;
+		y = e_val[ll] * cosx2 + e_val[mm] * sinx2 - x;
+		x = e_val[ll] * sinx2 + e_val[mm] * cosx2 + x;
+
+		e_val[lm] = (e_val[ll]-e_val[mm])*sincs+e_val[lm]*(cosx2-sinx2);
+		e_val[ll] = y;
+		e_val[mm] = x;
+	}
+
+	if (m != (dim-1))
+	{
+		m = m + 1;	goto l4;
+	}
+	if (l != (dim-2))
+	{
+		l = l + 1;	goto l3;
+	}
+	if (ind == 1)
+	{
+		ind = 0;	goto l2;
+	}
+	if (thr > anrmx) goto l1;
+
+l5:
+	iq = -dim;
+
+	for (i = 0; i < dim; i++)
+	{
+		iq = iq + dim;
+		ll = i + (i*i + i)/2;
+		jq = dim * (i-1);
+
+		for (j = i; j < dim; j++)
+		{
+			jq = jq + dim;
+			mm = j + (j*j + j)/2;
+
+			if (e_val[ll] < e_val[mm])
+			{
+				x = e_val[ll];
+				e_val[ll] = e_val[mm];
+				e_val[mm] = x;
+			}
+		}
+	}
+
+	for ( i = 0; i< dim; i++){
+		mt(i,0) = e_val[(i*(i+1))/2+i];
+	}
+
+	delete []cov;	//SSL0296
+	delete []e_val; //SSL0296
+
+	return true;
+}
+
+//--------------------------------------------------EigenVectors
+//
+//	Metodo adaptado a partir de uma implementacao em C
+//	utilizada no software SITIM.
+
+int
+TeMatrix::EigenVectors( TeMatrix& mt ) const
+{
+	if( &mt == this ){
+		printf("\nMatrix::EigenVectors >>> Operacao usa duas matrizes\n");
+		return false;
+	}
+
+double	*cov	= NULL,		/* matriz de covariancia	*/
+	*e_val	= NULL,		/*   "    de auto_valores	*/
+	*e_vec	= NULL; 	/*   "    de auto_vetores	*/
+
+int 	dim = (*this).Nrow();		/* ordem da matriz*/
+
+int	i,j,ij,k,       /*   cov[], e_val[]    */
+	ia,             /*                     */
+	ind,            /*     |0      |       */
+	l,m,            /*     |1 2    |       */
+	mq,lm,          /*     |3 4 5  |       */
+	ll,mm,          /*     |6 7 8 9|       */
+	ilq,imq,        /*                     */
+	im,iq,il,lq,    /*    (para DIM=4)     */
+	ilr,imr,
+	jq;
+
+double	range,          /*       e_vec[]       */
+	dim1,fdim,      /*                     */  
+	anorm,          /*    |0  4  8 12|     */
+	anrmx,          /*    |1  5  9 13|     */
+	thr,            /*    |2  6 10 14|     */
+	x,y,z,          /*    |3  7 11 15|     */
+	sinx,cosx,      /*                     */
+	sinx2,cosx2,
+	sincs;
+
+	if( dim <= 0 ){
+		printf("\nMatrix::EigenValues >>> dimensao da matriz nula!\n");
+		return false;
+	}
+	if( mt.Init( dim, (double)1 ) == false ){
+		printf("\nMatriz::EigenVectors >>> Memoria nao disponivel!\n");
+		return false;
+	}
+
+	int fat =(dim*dim+dim)/2;
+	range = 1.0e-6 ;
+	dim1 = dim - 1 ;
+	fdim = dim;
+
+	cov   = new double[fat];
+	e_vec = new double[dim*dim];
+	e_val = new double[fat];
+
+	if( cov == NULL || e_vec == NULL || e_val == NULL ){
+		printf("\nMatrix::EigenVectors >>> Memoria nao disponivel\n");
+		return false;
+	}
+
+	k = 0;
+	for ( i = 0; i< dim; i++)
+		for ( j = 0; j <= i; j++)
+			cov[k++] = (*this)(i,j);
+
+	for (i=0; i < ((dim*dim+dim)/2); i++) e_val[i] = cov[i];
+
+	iq = -dim;
+	for (i = 0; i < dim; i++)
+	{
+		iq = iq + dim;
+		for ( j = 0; j < dim; j++)
+		{
+			ij = iq + j;
+			if (i == j)
+				e_vec[ij] = 1.0;
+			else
+				e_vec[ij] = 0.0;
+		}
+	}
+ 
+	anorm = 0.0;
+
+	for ( j = 0; j < dim; j++)
+	{	
+		for (i = 0; i <= j; i++)
+		{
+			if (i != j)
+			{
+				ia = i + (j*j+j)/2;
+				anorm = anorm + e_val[ia] * e_val[ia];
+			}
+		}
+	}
+
+	if (anorm <= 0) goto l5;
+
+	anorm = 1.414 * sqrt((double)anorm);
+	anrmx = anorm * range/fdim;
+	ind   = 0;
+	thr   = anorm;
+
+l1:
+	thr = thr/fdim;
+l2:
+	l = 0;
+l3:
+	m = l+1;
+l4:
+	mq = (m*m + m)/2;
+	lq = (l*l + l)/2;
+	lm = l + mq;
+
+	if ( fabs((double)(e_val[lm])) >= thr )    
+	{
+		ind = 1;
+		ll = l + lq;
+		mm = m + mq;
+
+		x = 0.5 * (e_val[ll] - e_val[mm]);
+		z = e_val[lm] * e_val[lm] + x*x;
+		y = - e_val[lm] / sqrt((double)(z));
+
+		if (x < 0)  
+		{
+			y = -y;
+		}
+
+		z = sqrt( (double)(1.0-y*y) );
+		sinx = y / sqrt( (double)( 2.0*(1.0 + z) ) );
+		sinx2 = sinx * sinx;
+		
+		cosx = sqrt( (double)(1.0 - sinx2) );
+		cosx2 = cosx * cosx;
+
+		sincs = sinx * cosx;
+	
+		ilq = dim * l;
+		imq = dim * m;
+
+		for (i = 0; i < dim; i++)
+		{
+			iq = (i*i + i)/2;
+			if ( i != l )
+			{
+				if (i != m)
+				{
+					if (i > m) 
+						im = m + iq;
+					else
+						im = i + mq;
+					if (i < l)
+						il = i + lq;
+					else
+						il = l + iq;
+
+					x = e_val[il] * cosx - e_val[im] * sinx;
+					e_val[im] = e_val[il] * sinx + e_val[im] * cosx;
+					e_val[il] = x;
+				}
+			}
+
+			//---	calculate eigenvectors
+
+			ilr = ilq + i;
+			imr = imq + i;
+			x   = e_vec[ilr] * cosx - e_vec[imr] * sinx;
+			e_vec[imr] = e_vec[ilr] * sinx + e_vec[imr] * cosx;
+			e_vec[ilr] = x;
+		}
+
+		x = 2.0 * e_val[lm] * sincs;
+		y = e_val[ll] * cosx2 + e_val[mm] * sinx2 - x;
+		x = e_val[ll] * sinx2 + e_val[mm] * cosx2 + x;
+
+		e_val[lm] = (e_val[ll]-e_val[mm])*sincs+e_val[lm]*(cosx2-sinx2);
+		e_val[ll] = y;
+		e_val[mm] = x;
+	}
+
+	if (m != (dim-1))
+	{
+		m = m + 1;	goto l4;
+	}
+	if (l != (dim-2))
+	{
+		l = l + 1;	goto l3;
+	}
+	if (ind == 1)
+	{
+		ind = 0;	goto l2;
+	}
+	if (thr > anrmx) goto l1;
+
+l5:
+	iq = -dim;
+
+	for (i = 0; i < dim; i++)
+	{
+		iq = iq + dim;
+		ll = i + (i*i + i)/2;
+		jq = dim * (i-1);
+
+		for (j = i; j < dim; j++)
+		{
+			jq = jq + dim;
+			mm = j + (j*j + j)/2;
+
+			if (e_val[ll] < e_val[mm])
+			{
+				x = e_val[ll];
+				e_val[ll] = e_val[mm];
+				e_val[mm] = x;
+
+				for (k = 0; k < dim; k++)
+				{
+					ilr = iq + k;
+					imr = jq + k;
+					x   = e_vec[ilr];
+					e_vec[ilr] = e_vec[imr];
+					e_vec[imr] = x;
+				}
+			}
+		}
+	}
+	
+	k=0;
+	for ( i = 0; i< dim; i++){
+		for ( j = 0; j< dim; j++)
+			mt(j,i) = e_vec[k++];
+	}
+
+	delete []cov;	//SSL0296
+	delete []e_vec;	//SSL0296
+	delete []e_val; //SSL0296
+
+	return true;
+}
+
+//--------------------------------------------------EigenVec
+//
+//	Metodo desenvolvido para suporte de decisao (suporte_stubs.cpp)
+//	Missae Yamamoto  (junho/1999)
+
+int
+TeMatrix::EigenVec( double e_vec[] )
+{
+
+double	*e_vec_aux	= NULL, soma = 0.0; 
+	
+int 	dim = (*this).Nrow();		/* ordem da matriz*/
+
+TeMatrix  aux1, aux2, mt;
+
+int	i,j,k;       
+	
+	if( dim <= 0 )
+	{
+		printf("\nMatrix::EigenVecVal >>> dimensao da matriz nula!\n");
+		return false;
+	}
+
+	if( aux1.Init( dim, (double)1 ) == false )
+	{
+		printf("\nMatrix::EigenVecVal >>> Memoria nao disponivel!\n");
+		return false;
+	}
+
+	if( aux2.Init( dim, (double)1 ) == false )
+	{
+		printf("\nMatrix::EigenVecVal >>> Memoria nao disponivel!\n");
+		return false;
+	}
+
+	e_vec_aux = new double[dim];
+
+	if( e_vec_aux == NULL )
+	{
+		printf("\nMatrix::EigenVecVal >>> Memoria nao disponivel\n");
+		return false;
+	}
+
+	for ( k = 0; k< dim; k++)
+	{
+		e_vec_aux[k] = 0.0;
+		e_vec[k] = 0.0;
+	}
+
+	aux1 = *this;
+	aux2 = *this;
+	
+	for (;;)
+	{
+		mt = aux1 * aux2;
+
+		for (i=0; i<dim; i++)
+		{
+			for (j=0; j<dim; j++)
+				 e_vec[i] = e_vec[i] + mt(i,j);
+			soma = soma + e_vec[i];
+		}
+
+		for (j=0; j<dim; j++)
+			e_vec[j] = e_vec[j] / soma;
+
+		for (j=0; j<dim; j++)
+		{
+			if ( fabs(e_vec_aux[j] - e_vec[j]) < 0.001 ) 
+			{
+				delete []e_vec_aux;	
+				return true;
+			}
+			e_vec_aux[j] = e_vec[j];
+		}
+
+		aux1 = mt;
+		aux2 = mt;
+	}
+
+}
+
+double TeMatrix::getTrace() const
+{
+  TEAGN_TRUE_OR_THROW( ( nrow == ncol ), 
+    "Cannot get trace from a non-square matrix" );
+    
+  double trace = 0.0;
+  
+  for( int curr_row = 0 ; curr_row < nrow ; ++curr_row ) {
+    trace += mat[ curr_row ][ curr_row ];
+  }
+  
+  return trace;
+}
+
+bool TeMatrix::getPinv( TeMatrix& pinv ) const
+{
+  TeMatrix trans;
+  if( Transpose( trans ) == 0 ) return false;
+  
+  TeMatrix aux1;
+  if( getProduct( trans, *this, aux1 ) == 0 ) return false;
+  
+  TeMatrix aux1Inv;
+  if( aux1.Inverse( aux1Inv ) == 0 ) return false;
+  
+  if( getProduct( aux1Inv, trans, pinv ) == 0 ) return false;
+  
+  return true;
+}
+
+bool TeMatrix::getSVD( TeMatrix& UMtx, TeMatrix& DMtx, TeMatrix& VMtx ) const
+{
+//  Print();
+  
+  TeMatrix AT_Mtx;
+  if( ! Transpose( AT_Mtx ) ) return false;
+    
+//  AT_Mtx.Print();
+    
+  TeMatrix AAT_Mtx;
+  if( ! getProduct( *this, AT_Mtx, AAT_Mtx ) ) return false;
+    
+//  AAT_Mtx.Print(); 
+    
+  TeMatrix ATA_Mtx;
+  if( ! getProduct( AT_Mtx, *this, ATA_Mtx ) ) return false;
+  
+//  ATA_Mtx.Print();
+        
+  if( ! ATA_Mtx.EigenVectors( VMtx ) ) return false;
+  
+//  VMtx.Print();
+  
+  if( ! AAT_Mtx.EigenVectors( UMtx ) ) return false;
+  
+//  UMtx.Print();  
+  
+  if( ! AAT_Mtx.EigenValues( DMtx ) ) return false;
+
+  int dMtxCol = 0 ;
+  const int dMtxNCols = DMtx.Ncol();
+  const int dMtxNRows = DMtx.Nrow();
+  for( int dMtxRow = 0 ; dMtxRow < dMtxNRows ; ++dMtxRow )
+  {
+    for( dMtxCol = 0 ; dMtxCol < dMtxNCols ; ++dMtxCol )
+    {
+      if( dMtxRow == dMtxCol )
+      {
+        DMtx( dMtxRow, dMtxCol ) = sqrt( DMtx( dMtxRow, dMtxCol ) );
+      }
+      else
+      {
+        DMtx( dMtxRow, dMtxCol ) = 0;
+      }
+    }
+  }
+  
+//  DMtx.Print();
+  
+  return true;
+}
+
+bool TeMatrix::getIdentity( TeMatrix& identity, unsigned int width )
+{
+  if( identity.Init( width, width, 0.0 ) == 0 ) return false;
+  
+  for( unsigned int curr_row = 0 ; curr_row < width ; ++curr_row ) {
+    identity( curr_row, curr_row ) = 1.0;
+  }
+  
+  return true;
+}
+
+//------------------------------------------ Print
+void
+TeMatrix::Print() const
+{
+	//printf("\nMATRIZ ( %d, %d ) LIXO %f **mat %p\n", nrow,ncol, lixo, mat);
+	printf("\nMATRIZ ( %d, %d )\n\n", nrow,ncol);
+	if( mat == NULL ){
+		printf("\n>>> mat e NULL \n");
+		return;
+	}
+	int i,j;	
+	for(i = 0; i < nrow; i++){
+		for( j = 0; j < ncol;j++){
+			printf("%10.4f ",(float)mat[i][j]);
+		}
+		printf("\n\n");
+	}
+}
+
+// VRMC 12/98
+int
+TeMatrix::CholeskyDecomp( TeMatrix& mt )
+{
+
+	//--	Verify if the matrix is simetric
+	if ((*this).isSimetric() == false){
+		printf("\nMatrix::CholeskyDecomp >>> Matriz nao e simetrica!\n");
+		return false;
+	}
+	//--	Verify if the matrix is positive definide
+	if ((*this).isPositiveDefinide() == false){
+		printf("\nMatrix::CholeskyDecomp >>> Matriz nao e positiva definida!\n");
+		return false;
+	}
+	if( &mt == this ){
+		printf("\nMatrix::CholeskyDecomp >>> Operacao usa duas matrizes\n");
+		return false;
+	}
+	if( mat[0][0] <= 0. ){
+		printf("\nMatrix::CholeskyDecomp >>> Posicao [0,0] e' nula\n");
+		return false;
+	}
+    if( mt.Init(nrow,ncol) == false ){
+		printf("\nMatrix::CholeskyDecomp>>>no memory \n");
+		return false;
+   	}
+	mt(0,0) = (double)sqrt((double)(*this)(0,0));
+
+	//---	Calculate the first column of the TeMatrix mt
+
+	int i,j,k;
+	for( i= 0; i < nrow; i++){
+		mt(i,0) = (*this)(i,0)/mt(0,0);
+	}
+	 
+	for( i= 1; i < nrow; i++){
+		for( j= 1; j <= i; j++){
+			//int m = (j*j - j)/2 + 1;
+			double rf = 0.;
+			//int k2 = j - 1;
+			//for( k = 0;k<=k2;k++)
+			for( k = 0;k < j;k++)
+				rf += mt(i,k) * mt(j,k);
+			if( i == j ){
+				rf = (*this)(i,j) - rf;
+				if( rf < 0. ){
+					printf("\nMatrix::CholeskyDecomp:ERRO \n");
+					return false;
+				}
+				mt(i,j) = (double)sqrt((double)rf);
+			}
+			else{
+				if( mt(j,j) == 0. ){
+					printf("\nMatrix::CholeskyDecomp:ERRO \n");
+					return false;
+				}
+				mt(i,j) = ((*this)(i,j)-rf)/mt (j,j );
+			}
+		}
+	}
+	return true;
+}
+
+
+//-------------------------------------------------Inverse(SITIM)
+//
+//---	Calcula a matriz inversa pelo metodo de Gauss-Jordan.
+//
+
+int
+TeMatrix::Inverse( TeMatrix& matinv ) const
+{
+
+	if( &matinv == this ){
+		printf("\nMatrix::Inverse >>> Operacao usa duas matrizes\n");
+		return false;
+	}
+	if ( nrow != ncol ){
+       		printf("\nMatrix::Inverse: can't invert a non-square matrix");
+       		return false;
+   	 }
+
+	if( matinv.Init( this->nrow, (double)1 ) == false ){
+		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
+		return false;
+	}
+
+//---	Calculo da inversa se a matriz tem dimensao unitaria
+
+	if(nrow == 1){
+		if(mat[0][0] == 0.0) {
+		        printf("\noperator~: can't invert singular matrix");
+			return false;
+		}
+    		matinv(0,0) = 1. / mat[0][0];
+    		return true;
+	}
+  
+//---	Formacao da matriz aumentada mataum
+
+	int	m2   = 2 * nrow ;
+	TeMatrix	mataum;
+
+	if( mataum.Init( nrow , m2 ) == false ){
+	   printf("\nInverse:no memory");
+	   return false;
+       	}
+	
+	int i1,i2,i3;
+	for(i1 = 0 ; i1 < nrow ; i1++){
+		for( i2 = 0 ; i2 < ncol ; i2++)
+        		mataum(i1,i2) = mat[i1][i2];
+
+		for( i3 = nrow ; i3 < m2 ; i3++)
+        		mataum(i1,i3) = 0.0;
+
+		mataum( i1, i1 + nrow) = 1.0;
+	}
+
+//--	Inicializa ponteiro de linhas
+
+	double	*maxlinha = NULL;
+
+	if( ( maxlinha = new double[nrow] ) == NULL ){
+		printf("\nMatrix::Inverse>>no memory");
+		return false;
+	}
+
+	double	sup,lcon1,amul,pivo;
+	int	* lp = NULL;
+
+	if( (lp = new int[nrow]) == NULL ){
+		printf("\nMatrix::Inverse>>no memory");
+		if( maxlinha != NULL){delete []maxlinha; maxlinha = NULL;} //SSL0296
+		return false;
+	}
+
+	for(i1 = 0 ; i1 < nrow ; i1++)
+		lp[i1] = i1;
+
+	int	lcon = 0;
+	int	m1 = nrow - 1;
+
+	while(lcon < nrow){
+//---		Selecao do maior valor em cada linha . seu inverso e armazenado em maxlinha.
+		for(i1 = 0 ; i1 < nrow ; i1++){
+			sup = 0.0;
+			for(i2 = 0 ; i2 < nrow ; i2++){
+				lcon1 = (double)fabs(mataum(lp[i1],i2));
+				if((lcon1 - sup ) > 0.000001 )
+				sup = lcon1;
+			}
+			if(sup == 0.0){
+				if( maxlinha != NULL){ delete []maxlinha; maxlinha = NULL; } //SSL0296
+				if( lp != NULL){ delete []lp; lp = NULL; } //SSL0296
+				return false;
+			}
+			maxlinha[lp[i1]] = 1.0 / sup;
+		 }
+
+//---		Selecao do pivo em cada linha
+
+		int lpi;
+		double	supc = fabs((double)( mataum(lp[lcon],lcon) * maxlinha[lp[lcon]] ));
+		pivo = mataum(lp[lcon],lcon);
+		lpi  = lcon;
+		for(i1 = lcon ; i1 < nrow ; i1++){
+        		amul = mataum(lp[i1],lcon) * maxlinha[lp[i1]];
+			if (fabs(amul) > supc ){
+			supc = (fabs((double)amul));
+			pivo = mataum(lp[i1],lcon);
+			lpi  = i1;
+			}
+		}
+
+		if(pivo == 0.0){
+			if( maxlinha != NULL){ delete []maxlinha; maxlinha = NULL; } //SSL0296
+			if( lp != NULL){ delete []lp; lp = NULL; } //SSL0296
+			return false;
+		}
+     
+		/* troca de linhas */
+		i1 	 = lp[lcon];
+		lp[lcon] = lp[lpi];
+		lp[lpi]  = i1;
+	
+//---		Divide a linha pelo pivo
+		for(i2 = 0 ; i2 < m2 ; i2++){
+			mataum(lp[lcon],i2) = mataum(lp[lcon],i2) / pivo ;
+		}
+
+//---		Realiza subtracoes nas linhas de forma a zerar os elementos da coluna
+//---		dada pelo indice lcon
+
+		int	il = lcon;
+
+		for(i2 = 0; i2 < m1 ; i2++){
+	        	il = il + 1;
+			if(il >= nrow ) il = 0;
+			double	aux = - mataum(lp[il],lcon);
+			for(i3 = lcon; i3 < m2 ; i3++)
+				mataum(lp[il],i3) = mataum(lp[il],i3) + aux * mataum(lp[lcon],i3);
+
+			mataum(lp[il],lcon) = 0.0;
+		}
+
+		lcon = lcon + 1;
+	}
+
+//---	Copia a parte extendida de mataum em matinv que passa a ser a matriz inversa
+	for(i1 = 0 ; i1 < nrow ; i1++){
+		for(i2 = nrow ; i2 < m2 ; i2++)
+		{
+        		i3 = i2 - nrow ;
+			matinv(i1,i3) = mataum(lp[i1],i2);
+		}
+	}
+
+	if( maxlinha != NULL){
+		delete []maxlinha; //SSL0296
+		maxlinha = NULL;
+	}
+	if( lp != NULL){
+		delete []lp; //SSL0296
+		lp = NULL;
+	}
+
+	return true;
+}
+
+bool TeMatrix::getProduct( const TeMatrix& matrix1, const TeMatrix& matrix2,
+  TeMatrix& productMatrix )
+{
+  const int matrix1cols = matrix1.Ncol(); 
+  const int matrix2rows = matrix2.Nrow();
+  
+  TEAGN_TRUE_OR_RETURN( matrix1cols == matrix2rows, 
+    "Incompatible product matrixes" );
+    
+  const int matrix1rows = matrix1.Nrow();
+  const int matrix2cols = matrix2.Ncol();
+  
+  TEAGN_TRUE_OR_RETURN( productMatrix.Init(matrix1rows,matrix2cols), 
+    "Matrix allocation error" );
+  
+  double sum = 0;
+  int l = 0, c = 0, i = 0;
+
+  for ( l = 0; l < matrix1rows; l++)
+  {
+    for ( c = 0; c < matrix2cols; c++)
+    {
+      sum = 0;
+      
+      for ( i = 0; i < matrix1cols; i++)
+        sum += matrix1.mat[l][i] * matrix2.mat[i][c];
+        
+      productMatrix.mat[l][c] = sum;
+    }
+  }
+  
+  return true;
+}
+
+//	Esse m�todo, n�o esta correto 
+//------------------------------------------Inverse
+//	NIH library
+// 1. triangulate: *this = ~P*T
+// 2. when T isUpperTriangle ~T isUpperTriangle
+// 3. split: T = T.row(0) + subT
+// 4. I = ~T*T
+// 5. ~T.at(0,0) = 1/T.at(0,0)
+// 6. sub~T = ~(subT)
+// 7. ~T.row(0) = [1/T.at(0,0)]&B
+//    where T.at(0,0)*B = [t21 ... t2n]*~subT
+// 8. ~*this = ~T*P
+
+/*int 
+TeMatrix::InverseNIH( TeMatrix& mt ) const
+{
+	TeMatrix  r;
+	TeMatrix	_subT;
+	TeMatrix	B;
+	TeMatrix	val;
+
+	if ( nrow!=ncol || nrow <= 0 || ncol <= 0 ){
+		printf("\nMatrix::Inverse >>> Matriz nao inversivel!\n");
+		return false;
+	}
+
+	if( mt.Init( this->nrow, (double)1 ) == false ){
+		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
+		return false;
+	}
+
+	if ( nrow==1 ){
+		if( mat[0][0] == (double)0 ){
+			printf("\nMatrix::Inverse >>> Matriz nao inversivel!\n");
+			return false;
+		}
+		mt.mat[0][0] = 1/mat[0][0];
+		return true;
+   	}
+	TeMatrix T(*this);
+	if( T.Initialized() == false ){
+		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
+		return false;
+	}
+		
+	// 1. triangulate: *this = ~P*T
+	TeMatrix P;
+	if( P.Init(nrow,ncol) == false){
+		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
+		return false;
+	}
+	if( T.UpperTriangle( P ) == false ){
+		printf("\nMatriz::Inverse >>> ERRO!\n");
+		return false;
+	}
+	if ( T.Determinant()==0 ) {
+		printf("\nMatrix::Inverse >>> can't invert singular matrix\n");
+		return false;
+	}      
+
+	// 2. when T isUpperTriangle ~T isUpperTriangle
+	// 3. split: T = T.row(0) + subT
+
+	if( r.Init(1,ncol-1,&(T.mat[0][1])) == false){
+		printf("\nMatrix::Inverse* >>> Memoria nao disponivel\n");
+		return false;
+	}
+
+	T.CoFactor(0,0,mt);
+	mt.Inverse(_subT);
+	if( _subT.Initialized()  == false){
+		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
+		return false;
+	}
+
+
+	B = (-(1/T.mat[0][0])*r*_subT);
+	if( B.Initialized() == false ){
+		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
+		return false;
+	}
+
+	if( val.Init(nrow,ncol) == false){
+		printf("\nMatrix::Inverse >>> Memoria nao disponivel\n");
+		return false;
+	}
+
+	val.mat[0][0] = 1/T.mat[0][0];
+	int i;
+	for(i=1; i<ncol; i++) val.mat[0][i]=B.mat[0][i-1];
+	val.CoFactor(0,0,_subT);
+
+ 	mt = val*P; // P is now the row-reduction transformation
+
+	return true; 
+}
+*/
+
+// os m�todos switchRows e combineRows ficarao comentados 
+// pois s� sao utilizados no calculo da matriz inversa NIH,
+// inversaNIH, que tambem foi comentado 
+/*void 
+TeMatrix::switchRows(int i,int j)
+{
+	double *tmp;
+
+	if( i < 0 || j < 0 || i >= nrow || j >= ncol ){
+		printf("\nMatrix::switchRows >>> Switching linhas invalidas\n");
+		return;
+	}
+	tmp    = mat[i];
+	mat[i] = mat[j];
+	mat[j] = tmp; 
+}
+
+void
+TeMatrix::combineRows(int i, double a, int j)
+{
+	if( i < 0 || j < 0 || i >= nrow || j >= ncol ){
+		printf("\nMatrix::combineRows >>> Combining linhas invalidas\n");
+		return;
+	}
+	int h;
+	for(h = 0; h < ncol; h++)
+	mat[i][h] += a * mat[j][h];
+}
+*/
+
+//--------Esse metodo nao esta correto e por isso ficar� comentado VRMC
+//----------------------------------------------------
+/*int 
+TeMatrix::UpperTriangle( TeMatrix& mt )
+{
+	if( &mt == this ){
+		printf("\nMatrix::UpperTriangle >>> Operacao usa duas matrizes\n");
+		return false;
+	}
+	if( mt.Init(nrow,(double)1) == false){
+		printf("\nMatrix::UpperTriangle >>> Memoria nao disponivel\n");
+		return	false;
+	}	
+
+	if ( this->isUpperTriangle() )
+		return true;
+	
+	int j;
+	for(j = 0; j < ncol; j++) {
+		int b_row = nrow-1;  // 1st non-zero entry from bottom
+		int t_row = j;       // 1st zero entry from the top
+
+		//--- switch rows until all zeros are at
+		//--- the bottom of jTH column 
+
+		while ( b_row>=t_row ) { 
+			while ( b_row > j && mat[b_row][j] == 0. )
+				--b_row;
+			if ( b_row == j )
+				break; // bottom at diagonal
+			while ( b_row >= t_row && mat[t_row][j] != 0. )
+				++t_row;
+			if ( t_row == Nrow() )
+				break; // top at last row
+			if ( t_row > b_row )
+				break;
+			switchRows(b_row,t_row); 
+			mt.switchRows(b_row,t_row);
+		}
+
+		//--- now b_row is last non-zero entry from the top
+		//--- now t_row is first zero entry from the bottom
+		//--- combine until all entries below diagonal in jTH column = 0
+
+		if ( b_row <= j )
+			continue;
+			int i;
+		for( i = j+1; i<= b_row; i++) {
+			double f = -mat[i][j] / mat[j][j];
+			combineRows(i,f,j);
+			mt.combineRows(i,f,j);
+		}
+	}
+	return true;
+}
+*/
diff --git a/src/terralib/kernel/TeMatrix.h b/src/terralib/kernel/TeMatrix.h
old mode 100755
new mode 100644
index e2ba6a7..b85415e
--- a/src/terralib/kernel/TeMatrix.h
+++ b/src/terralib/kernel/TeMatrix.h
@@ -1,188 +1,238 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMatrix.h
-    \brief This file models the object matrix of type double
-*/
-#ifndef  __TERRALIB_INTERNAL_MATRIX_H
-#define  __TERRALIB_INTERNAL_MATRIX_H
-
-#include "TeDefines.h"
-#include "TeAgnostic.h"
-
-//! This class represents a matrix of elements of type double
-class TL_DLL TeMatrix
-{
-private:
-	int nrow;	// Number of rows
-	int ncol;	// Number of columns
-	double **mat;	// TeMatrix of double elements 
-	double lixo;	// Ancillary variable
-
-	//! Allocates memory to holds a matrix of l lines by c columns
-	short Alloc( int l, int c);
-
-public:
-	//! Normal constructor
-	TeMatrix();
-
-	//! Copy constructor
-	TeMatrix(const TeMatrix& );
-
-	//! Destructor
-	~TeMatrix();
-
-	//! Clear memory for matrix.
-	void Clear();
-
-	//! Checks if the matrix is initialized.
-	int Initialized(){ return ( nrow > 0 && ncol > 0 ) ? (true) : (false); }
-
-	//!	Initializes the matrix with a vector of values
-	int Init( int nrow = 1, int ncol = 1 , double* f=0);
-
-	//!	Initializes the matrix with the same value.
-	int Init( int nrow , int ncol , double f  );
-	
-	//! Diagonal matrix with different values.
-	int Init(int k, double* f);
-
-	//! Diagonal matrix with the same value
-	int Init(int k, double f); 
-
-  //! Acess element in position (lin,col)
-  inline const double& operator()( int lin, int col ) const {
-    TEAGN_DEBUG_CONDITION( ( ( lin >= 0 ) && ( lin < nrow ) && 
-      ( col >= 0 ) && ( col < ncol ) ),
-      "Trying to acces an invalid position" )
-      
-    return mat[lin][col];
-  }  
-      
-	//! Acess element in position (lin,col)
-	inline double& operator()( int lin, int col ){ 
-    TEAGN_DEBUG_CONDITION( ( ( lin >= 0 ) && ( lin < nrow ) && 
-      ( col >= 0 ) && ( col < ncol ) ),
-      "Trying to acces an invalid position" )
-      
-    return mat[lin][col];
-	}
-
-	//! Assign matrix values to another one using operator =
-	TeMatrix& operator=( const TeMatrix& m ); 
-
-	//! Compares two matrix using the operator ==
-	int 	operator==(const TeMatrix& m) const;
-
-	//! Operator *=
-	void 	operator*=(double);
-
-	//! Operator unary minus 
-	TeMatrix 	operator-();
-
-	//!	Returns the number of rows.
-	int	Nrow() const { return nrow; }
- 	
-	//!	Returns the number of columns.
-	int	Ncol()	const { return ncol; } 
-
-	//!	Print the matrix elements .
-	void Print();
-
-	//!	Switches two rows "a" and "b".
-    void switchRows(int a ,int b);
-		
-	//! Combines two rows in according to row(i) += b*row(j)
-   void combineRows(int i,double b,int j);
-
-	//! 		Finds the transpose of a matrix.
-	int	Transpose( TeMatrix& mt ) const;
-	
-	//! 		Finds the inverse of a matrix, if any.
-	int	Inverse ( TeMatrix& mt ) const;
-
-	//!		Finds the inverse of a triangle matrix	acquired from Cholesky decomposition
-	int	CholeskyInv (TeMatrix&	mt) const;	
-		
-	//!	Calculates the inverse of a lowertriangle matrix aquired from the Cholesky decomposition of a simetric positive definide matrix.
-	int MatTransf( TeMatrix& mt );	
-
-//!	Checks if the matrix is an uppertriangle matrix.
-   	int isUpperTriangle() const;
-	
-//!	Checks if the matrix is an lowertriangle matrix.
-    int isLowerTriangle() const;	
-
-//!	Checks if the matrix is a simetric matrix
-	int	isSimetric()	const;		
-
-//!	Checks if the matrix is positive definide
-	int	isPositiveDefinide() const;
-
-//!	Calculates the cofactor value of a matrix.
-	int	CoFactor(int irow, int jcol, TeMatrix& m) const;
-
-//!	Calculates the determinant value.
-	double	Determinant() const;
-
-//	Extracts a triangle matrix from a simetric positive	definide one
-	int	CholeskyDecomp( TeMatrix& mt );	
-
-//!	Calculates the EigenVectors.
-	int	EigenVectors( TeMatrix& mt ) const;
-
-//!	Calculates the EigenValues.
-	int	EigenValues( TeMatrix& mt ) const;
-
-//!	Calculates the EigenVectors.
-	int EigenVec( double e_vec[] );
-	
-	/**
-	 * @brief	Matrix trace calcule (the sum of diagonal elements).
-	 * @return The matrix trace.
-	 */	
-	double getTrace() const;
-	
-	/**
-	 * @brief	Generate a identity matrix .
-	 * @param identity The generated identity matrix.
-	 * @param width The identity matrix width.
-	 * @return true if OK, false on errors.
-	 */
-	static bool getIdentity( TeMatrix& identity, unsigned int width );
-
-//!	Sums two matrices.
-	friend TL_DLL TeMatrix operator+(const TeMatrix& m1,const TeMatrix& m2);
-
-//!	Subtracts two matrices.
-	friend TL_DLL TeMatrix operator-(const TeMatrix&,const TeMatrix&);
-
-//!	Calculates the product of two matrices.
-	friend TL_DLL TeMatrix operator*(const TeMatrix&,const TeMatrix&);
-
-//!	Product of the matrix by a constant.
-	friend TL_DLL TeMatrix operator*(double c,const TeMatrix&);
-};
-
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMatrix.h
+    \brief This file models the object matrix of type double
+*/
+#ifndef  __TERRALIB_INTERNAL_MATRIX_H
+#define  __TERRALIB_INTERNAL_MATRIX_H
+
+#include "TeDefines.h"
+#include "TeAgnostic.h"
+
+//! This class represents a matrix of elements of type double
+class TL_DLL TeMatrix
+{
+private:
+	int nrow;	// Number of rows
+	int ncol;	// Number of columns
+	double **mat;	// TeMatrix of double elements 
+
+	//! Allocates memory to holds a matrix of l lines by c columns
+	short Alloc( int l, int c);
+
+public:
+	//! Normal constructor
+	TeMatrix();
+
+	//! Copy constructor
+	TeMatrix(const TeMatrix& );
+
+	//! Destructor
+	~TeMatrix();
+
+	//! Clear memory for matrix.
+	void Clear();
+
+	//! Checks if the matrix is initialized.
+	int Initialized(){ return ( nrow > 0 && ncol > 0 ) ? (true) : (false); }
+
+	//!	Initializes the matrix with a vector of values
+	int Init( int nrow = 1, int ncol = 1 , double* f=0);
+
+	//!	Initializes the matrix with the same value.
+	int Init( int nrow , int ncol , double f  );
+	
+	//! Diagonal matrix with different values.
+	int Init(int k, double* f);
+
+	//! Diagonal matrix with the same value
+	int Init(int k, double f); 
+
+  //! Acess element in position (lin,col)
+  inline const double& operator()( int lin, int col ) const {
+    TEAGN_DEBUG_CONDITION( ( ( lin >= 0 ) && ( lin < nrow ) && 
+      ( col >= 0 ) && ( col < ncol ) ),
+      "Trying to acces an invalid position" )
+      
+    return mat[lin][col];
+  }  
+      
+	//! Acess element in position (lin,col)
+	inline double& operator()( int lin, int col ){ 
+    TEAGN_DEBUG_CONDITION( ( ( lin >= 0 ) && ( lin < nrow ) && 
+      ( col >= 0 ) && ( col < ncol ) ),
+      "Trying to acces an invalid position" )
+      
+    return mat[lin][col];
+	}
+
+  /** @brief Direct line pointer const access.
+    * @param lin A valid line number.
+    * @return The required line pointer.
+    */
+  inline double const* const operator[]( int lin ) const 
+  {
+    TEAGN_DEBUG_CONDITION( ( ( lin >= 0 ) && ( lin < nrow ) ),
+      "Trying to acces an invalid line" )
+      
+    return mat[lin];
+  }     
+  
+  /** @brief Direct line pointer access.
+    * @param lin A valid line number.
+    * @return The required line pointer.
+    */
+  inline double* operator[]( int lin )
+  {
+    TEAGN_DEBUG_CONDITION( ( ( lin >= 0 ) && ( lin < nrow ) ),
+      "Trying to acces an invalid line" )
+      
+    return mat[lin];
+  }   
+
+	//! Assign matrix values to another one using operator =
+	TeMatrix& operator=( const TeMatrix& m ); 
+
+	//! Compares two matrix using the operator ==
+	int 	operator==(const TeMatrix& m) const;
+
+	//! Operator *=
+	void 	operator*=(double);
+
+	//! Operator unary minus 
+	TeMatrix 	operator-();
+
+	//!	Returns the number of rows.
+	int	Nrow() const { return nrow; }
+ 	
+	//!	Returns the number of columns.
+	int	Ncol()	const { return ncol; } 
+
+	//!	Print the matrix elements .
+	void Print() const;
+
+	//!	Switches two rows "a" and "b".
+    void switchRows(int a ,int b);
+		
+	//! Combines two rows in according to row(i) += b*row(j)
+   void combineRows(int i,double b,int j);
+
+	//! 		Finds the transpose of a matrix.
+	int	Transpose( TeMatrix& mt ) const;
+	
+	//! 		Finds the inverse of a matrix, if any.
+	int	Inverse ( TeMatrix& mt ) const;
+
+	//!		Finds the inverse of a triangle matrix	acquired from Cholesky decomposition
+	int	CholeskyInv (TeMatrix&	mt) const;	
+		
+	//!	Calculates the inverse of a lowertriangle matrix aquired from the Cholesky decomposition of a simetric positive definide matrix.
+	int MatTransf( TeMatrix& mt );	
+
+//!	Checks if the matrix is an uppertriangle matrix.
+   	int isUpperTriangle() const;
+	
+//!	Checks if the matrix is an lowertriangle matrix.
+    int isLowerTriangle() const;	
+
+//!	Checks if the matrix is a simetric matrix
+	int	isSimetric()	const;		
+
+//!	Checks if the matrix is positive definide
+	int	isPositiveDefinide() const;
+
+//!	Calculates the cofactor value of a matrix.
+	int	CoFactor(int irow, int jcol, TeMatrix& m) const;
+
+//!	Calculates the determinant value.
+	double	Determinant() const;
+
+//	Extracts a triangle matrix from a simetric positive	definide one
+	int	CholeskyDecomp( TeMatrix& mt );	
+
+//!	Calculates the EigenVectors.
+	int	EigenVectors( TeMatrix& mt ) const;
+
+//!	Calculates the EigenValues.
+	int	EigenValues( TeMatrix& mt ) const;
+
+//!	Calculates the EigenVectors.
+	int EigenVec( double e_vec[] );
+	
+	/**
+	 * @brief	Matrix trace calcule (the sum of diagonal elements).
+	 * @return The matrix trace.
+	 */	
+	double getTrace() const;
+  
+  /**
+   * @brief Build the pseudo-inverse from this matrix.
+   * @note PinvX = Inv( Xt * X ) * Xt, where Inv=Inverse and Xt is the 
+   * transposed matrix of X.
+   * @return true if OK, false on errors.
+   */ 
+  bool getPinv( TeMatrix& pinv ) const;  
+  
+  /**
+   * @brief Singular value decomposition (SVD) from this matrix (A).
+   * @note A = U . D . Vt, where U is a MxM orthogonal matrix, D is a 
+   * MxN diagonal matrix and V is NxN orthogonal matrix.
+   * @return true if OK, false on errors.
+   */ 
+  bool getSVD( TeMatrix& UMtx, TeMatrix& DMtx, TeMatrix& VMtx ) const;  
+
+//!	Sums two matrices.
+	friend TL_DLL TeMatrix operator+(const TeMatrix& m1,const TeMatrix& m2);
+
+//!	Subtracts two matrices.
+	friend TL_DLL TeMatrix operator-(const TeMatrix&,const TeMatrix&);
+
+//!	Calculates the product of two matrices.
+	friend TL_DLL TeMatrix operator*(const TeMatrix&,const TeMatrix&);
+
+//!	Product of the matrix by a constant.
+	friend TL_DLL TeMatrix operator*(double c,const TeMatrix&);
+  
+  /**
+   * @brief Generate a identity matrix .
+   * @param identity The generated identity matrix.
+   * @param width The identity matrix width.
+   * @return true if OK, false on errors.
+   */
+  static bool getIdentity( TeMatrix& identity, unsigned int width );  
+  
+  /**
+   * @brief Generate the product of two matrixes.
+   * @note product = matrix1 * matrix2
+   * @param matrix1 Input matrix 1.
+   * @param matrix2 Input matrix 2.
+   * @param productMatrix Output product matrix.
+   * @return true if OK, false on errors.
+   */
+  static bool getProduct( const TeMatrix& matrix1, const TeMatrix& matrix2,
+    TeMatrix& productMatrix );  
+};
+
+
+#endif
+
diff --git a/src/terralib/kernel/TeMeasure.h b/src/terralib/kernel/TeMeasure.h
old mode 100755
new mode 100644
index 1cdd905..bdb4c08
--- a/src/terralib/kernel/TeMeasure.h
+++ b/src/terralib/kernel/TeMeasure.h
@@ -1,59 +1,59 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMeasure.h
-    \brief This file defines a class for handling a measure
-*/
-
-#ifndef  __TERRALIB_INTERNAL_MEASURE_H
-#define  __TERRALIB_INTERNAL_MEASURE_H
-
-//! A class for handling a measure
-/*!
-	Provide support and definition for a measured value for All application that 
-	require a field measure.
-	\sa TeSample, TeCountourLine
-*/
-
-#include "TeDefines.h"
-class TL_DLL TeMeasure 
-{
-public:
-
-	//! Constructor
-	TeMeasure( double value ) : value_( value ) {}
-
-	//! Destructor
-	~TeMeasure() {}
-
-	//! Return the value associated to the measure
-	double value()
-	{ return value_; }
-
-protected:
-	double value_;
-};
-
-
-//typedef TeComposite <TeMeasure> TeMeasureComposite;
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMeasure.h
+    \brief This file defines a class for handling a measure
+*/
+
+#ifndef  __TERRALIB_INTERNAL_MEASURE_H
+#define  __TERRALIB_INTERNAL_MEASURE_H
+
+//! A class for handling a measure
+/*!
+	Provide support and definition for a measured value for All application that 
+	require a field measure.
+	\sa TeSample, TeCountourLine
+*/
+
+#include "TeDefines.h"
+class TL_DLL TeMeasure 
+{
+public:
+
+	//! Constructor
+	TeMeasure( double value ) : value_( value ) {}
+
+	//! Destructor
+	~TeMeasure() {}
+
+	//! Return the value associated to the measure
+	double value()
+	{ return value_; }
+
+protected:
+	double value_;
+};
+
+
+//typedef TeComposite <TeMeasure> TeMeasureComposite;
+
+#endif
diff --git a/src/terralib/kernel/TeMetaModelCache.cpp b/src/terralib/kernel/TeMetaModelCache.cpp
index 46d11d6..04da12c 100644
--- a/src/terralib/kernel/TeMetaModelCache.cpp
+++ b/src/terralib/kernel/TeMetaModelCache.cpp
@@ -1,40 +1,40 @@
-#include "TeMetaModelCache.h"
-
-void TeMetaModelCache::clear()
-{
-	TeViewMap::iterator viewIt;
-	for (viewIt = viewMap_.begin(); viewIt != viewMap_.end(); ++viewIt)
-	{
-		if(viewIt->second)
-			delete viewIt->second;
-	}
-
-	TeLayerMap::iterator layerIt;
-	for (layerIt = layerMap_.begin(); layerIt != layerMap_.end(); ++layerIt)
-	{
-		if (layerIt->second)
-			delete layerIt->second;
-	}
-
-	TeProjectMap::iterator projectIt;
-	for (projectIt = projectMap_.begin(); projectIt != projectMap_.end(); ++projectIt)
-	{
-		if (projectIt->second)
-			delete projectIt->second;
-	}
-
-	TeThemeMap::iterator invThemeIt;
-	for (invThemeIt = invalidThemeMap_.begin(); invThemeIt != invalidThemeMap_.end(); ++invThemeIt)
-	{
-		if (invThemeIt->second)
-			delete invThemeIt->second;
-	}
-
-	legendMap_.clear();
-	themeMap_.clear();
-	invalidThemeMap_.clear();
-	viewMap_.clear();
-	layerMap_.clear();
-	projectMap_.clear();
-}
-
+#include "TeMetaModelCache.h"
+
+void TeMetaModelCache::clear()
+{
+	TeViewMap::iterator viewIt;
+	for (viewIt = viewMap_.begin(); viewIt != viewMap_.end(); ++viewIt)
+	{
+		if(viewIt->second)
+			delete viewIt->second;
+	}
+
+	TeLayerMap::iterator layerIt;
+	for (layerIt = layerMap_.begin(); layerIt != layerMap_.end(); ++layerIt)
+	{
+		if (layerIt->second)
+			delete layerIt->second;
+	}
+
+	TeProjectMap::iterator projectIt;
+	for (projectIt = projectMap_.begin(); projectIt != projectMap_.end(); ++projectIt)
+	{
+		if (projectIt->second)
+			delete projectIt->second;
+	}
+
+	TeThemeMap::iterator invThemeIt;
+	for (invThemeIt = invalidThemeMap_.begin(); invThemeIt != invalidThemeMap_.end(); ++invThemeIt)
+	{
+		if (invThemeIt->second)
+			delete invThemeIt->second;
+	}
+
+	legendMap_.clear();
+	themeMap_.clear();
+	invalidThemeMap_.clear();
+	viewMap_.clear();
+	layerMap_.clear();
+	projectMap_.clear();
+}
+
diff --git a/src/terralib/kernel/TeMetaModelCache.h b/src/terralib/kernel/TeMetaModelCache.h
index f798797..314a9e9 100644
--- a/src/terralib/kernel/TeMetaModelCache.h
+++ b/src/terralib/kernel/TeMetaModelCache.h
@@ -1,118 +1,118 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMetaModelCache.h
-    \brief This file contains structures and definitions about TerraLib database meta model.
-*/
-#ifndef  __TERRALIB_INTERNAL_METAMODELCACHE_H
-#define  __TERRALIB_INTERNAL_METAMODELCACHE_H
-
-#include "TeLayer.h"
-#include "TeAbstractTheme.h"
-#include "TeView.h"
-#include "TeProject.h"
-
-//! A class for storing TerraLib's metamodel objects (TeTheme, TeLayer, ...)
-/*!
-	An instance of this class keeps track of 
-	meta objects stored in a TerraLib Database.
-	This instance can be shared by all database connections.
-
-  \sa TeTheme, TeView, TeLayer, TeAttribute
-*/
-class TL_DLL TeMetaModelCache
-{
-	public: 
-
-
-        //! Empty constructor
-        TeMetaModelCache()
-		{}
-
-        //! Destructor
-        ~TeMetaModelCache()
-		{ clear(); }
-
-		//! Clears metadata
-		void clear();
-
-		//! Returns the  map of layers in the database
-		TeLayerMap&	layerMap () 
-		{ return layerMap_; }
-
-		//! Returns the  map of views in the database
-		TeViewMap&	viewMap () 
-		{ return viewMap_; }
-
-		//! Returns the  map of themes in the database
-		TeThemeMap&	themeMap () 
-		{ return themeMap_; }
-
-		//! Returns the  map of invalid themes in the database
-		TeThemeMap&	invalidThemeMap () 
-		{ return invalidThemeMap_; }
-
-		//! Returns the  map of projects in the database
-		TeProjectMap&  projectMap ()
-		{ return projectMap_; }
-
-		//! Returns the  map of legends in the database
-		TeLegendEntryMap& legendMap () 
-		{ return legendMap_; }
-
-		//! Returns the set of relations between tables
-		multiset<int>& relationMSet () 
-		{ return relationMSet_; }
-
-		map<int, map<string, string> >& mapThemeAlias()
-		{return mapThemeAlias_;}
-
-    private:
-
-        //! Copy constructor not allowed.
-        TeMetaModelCache(const TeMetaModelCache& rhs);
-
-		//! Assignment operator not allowed.
-        TeMetaModelCache& operator=(const TeMetaModelCache& rhs);
-
-	private:
-
-		TeLayerMap			layerMap_;			//!< layer map	  
-        TeViewMap			viewMap_;			//!< view map	  
-        TeThemeMap			themeMap_;			//!< theme map	
-		TeThemeMap			invalidThemeMap_;	//!< invalid theme map
-        TeLegendEntryMap	legendMap_;			//!< view map
-        TeProjectMap		projectMap_;		//!< project map
-        multiset<int>		relationMSet_;		//!< multiset of relations between tables
-		/*! \brief An associative container from theme identifier (int)
-		           to legend alias (map<string, string>). The theme alias
-                   is another container, where key is a string with a column name
-                   used in a group that maps to a legend alias (string value).
-		 */
-		map<int, map<string, string> > mapThemeAlias_;
-};
-
-
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMetaModelCache.h
+    \brief This file contains structures and definitions about TerraLib database meta model.
+*/
+#ifndef  __TERRALIB_INTERNAL_METAMODELCACHE_H
+#define  __TERRALIB_INTERNAL_METAMODELCACHE_H
+
+#include "TeLayer.h"
+#include "TeAbstractTheme.h"
+#include "TeView.h"
+#include "TeProject.h"
+
+//! A class for storing TerraLib's metamodel objects (TeTheme, TeLayer, ...)
+/*!
+	An instance of this class keeps track of 
+	meta objects stored in a TerraLib Database.
+	This instance can be shared by all database connections.
+
+  \sa TeTheme, TeView, TeLayer, TeAttribute
+*/
+class TL_DLL TeMetaModelCache
+{
+	public: 
+
+
+        //! Empty constructor
+        TeMetaModelCache()
+		{}
+
+        //! Destructor
+        ~TeMetaModelCache()
+		{ clear(); }
+
+		//! Clears metadata
+		void clear();
+
+		//! Returns the  map of layers in the database
+		TeLayerMap&	layerMap () 
+		{ return layerMap_; }
+
+		//! Returns the  map of views in the database
+		TeViewMap&	viewMap () 
+		{ return viewMap_; }
+
+		//! Returns the  map of themes in the database
+		TeThemeMap&	themeMap () 
+		{ return themeMap_; }
+
+		//! Returns the  map of invalid themes in the database
+		TeThemeMap&	invalidThemeMap () 
+		{ return invalidThemeMap_; }
+
+		//! Returns the  map of projects in the database
+		TeProjectMap&  projectMap ()
+		{ return projectMap_; }
+
+		//! Returns the  map of legends in the database
+		TeLegendEntryMap& legendMap () 
+		{ return legendMap_; }
+
+		//! Returns the set of relations between tables
+		multiset<int>& relationMSet () 
+		{ return relationMSet_; }
+
+		map<int, map<string, string> >& mapThemeAlias()
+		{return mapThemeAlias_;}
+
+    private:
+
+        //! Copy constructor not allowed.
+        TeMetaModelCache(const TeMetaModelCache& rhs);
+
+		//! Assignment operator not allowed.
+        TeMetaModelCache& operator=(const TeMetaModelCache& rhs);
+
+	private:
+
+		TeLayerMap			layerMap_;			//!< layer map	  
+        TeViewMap			viewMap_;			//!< view map	  
+        TeThemeMap			themeMap_;			//!< theme map	
+		TeThemeMap			invalidThemeMap_;	//!< invalid theme map
+        TeLegendEntryMap	legendMap_;			//!< view map
+        TeProjectMap		projectMap_;		//!< project map
+        multiset<int>		relationMSet_;		//!< multiset of relations between tables
+		/*! \brief An associative container from theme identifier (int)
+		           to legend alias (map<string, string>). The theme alias
+                   is another container, where key is a string with a column name
+                   used in a group that maps to a legend alias (string value).
+		 */
+		map<int, map<string, string> > mapThemeAlias_;
+};
+
+
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeMultiContainer.h b/src/terralib/kernel/TeMultiContainer.h
old mode 100755
new mode 100644
index 87753a9..b56de2a
--- a/src/terralib/kernel/TeMultiContainer.h
+++ b/src/terralib/kernel/TeMultiContainer.h
@@ -1,625 +1,658 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*! \file TeMultiContainer.h
-   \brief A container class to store multiple types os object copies.
-*/
-
-
-#ifndef TEMULTICONTAINER_H
-  #define TEMULTICONTAINER_H
-
-  #include "TeSharedPtr.h"
-  #include "TeMutex.h"
-  #include "TeAgnostic.h"
-  
-  #include <time.h>
-  
-  #include <vector>
-  #include <typeinfo>
-
-  /**
-    * @brief Multi-container node interface.
-    * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-    * @ingroup Utils
-    */    
-  template< typename TeMultiContainerKeyT >
-  class TeMCNodeInterface {
-    public :
-    
-      /**
-        * @brief Default Constructor.
-        */        
-      TeMCNodeInterface() {};
-      
-      /**
-        * @brief Default Destructor.
-        */        
-      virtual ~TeMCNodeInterface() {};
-      
-      /**
-        * @brief Copies the the current node instance by calling
-        * the operator= from the contained object instance.
-        * @return A pointer to the new node copy.
-        */            
-      virtual TeMCNodeInterface< TeMultiContainerKeyT >* clone() 
-        const = 0;
-        
-      /**
-        * @brief Get the internal object type info.
-        * @return The internal object type info.
-        */        
-      virtual const std::string& getObjTypeInfo() const = 0;
-      
-    private :
-    
-      /**
-        * @brief Alternative constructor.
-        */        
-      TeMCNodeInterface( 
-        const TeMCNodeInterface< TeMultiContainerKeyT >& ) {};    
-    
-      /**
-      * @brief operator= overload.
-      *
-      * @param ext_instance External instance reference.
-      * @return The external instance reference.
-      */
-      const TeMCNodeInterface< TeMultiContainerKeyT >& operator=( 
-        const TeMCNodeInterface< TeMultiContainerKeyT >& ) {};        
-  };
-
-
-  /**
-    * @brief Multi-container node class.
-    * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-    * @ingroup Utils
-    */       
-  template< typename ObjectT, typename TeMultiContainerKeyT >
-  class TeMCNode : public TeMCNodeInterface< TeMultiContainerKeyT > {
-    public :
-    
-      /**
-        * @brief Default Constructor.
-        */        
-      TeMCNode() 
-      {
-        obj_ptr_ = 0;
-      };
-      
-      /**
-        * @brief Default Destructor.
-        */        
-      ~TeMCNode()
-      {
-        if( obj_ptr_ ) {
-          delete obj_ptr_;
-        }
-      };
-      
-      /**
-        * @brief Copies the the current node instance by calling
-        * the operator= from the contained object instance.
-        * @return A pointer to the new node copy.
-        */              
-      TeMCNodeInterface< TeMultiContainerKeyT >* clone() const
-      {
-        TeMCNode< ObjectT, TeMultiContainerKeyT >* new_node_ptr =
-          new TeMCNode< ObjectT, TeMultiContainerKeyT >;
-          
-        if( obj_ptr_ ) {
-          new_node_ptr->obj_ptr_ = new ObjectT;
-          ( *( new_node_ptr->obj_ptr_ ) ) = ( *obj_ptr_ );
-          
-          new_node_ptr->obj_type_str_ = obj_type_str_;
-        }
-        
-        return new_node_ptr;
-      };
-      
-      /**
-        * @brief Set the internal object pointer.
-        * @param ptr Object pointer.
-        */        
-      void setObjPtr( ObjectT* ptr ) 
-      { 
-        TEAGN_DEBUG_CONDITION( ptr, "Invalid pointer" )
-        
-        if( obj_ptr_ ) {
-          delete obj_ptr_;
-        }      
-      
-        obj_ptr_ = ptr;
-        obj_type_str_ = std::string( typeid( *ptr ).name() );
-      };
-      
-      /**
-        * @brief Get the internal object pointer.
-        * @return The object pointer.
-        */        
-      ObjectT* getObjPtr() const
-      { 
-        return obj_ptr_; 
-      };
-      
-      /**
-        * @brief Get the internal object type info.
-        * @return The internal object type info.
-        */        
-      const std::string& getObjTypeInfo() const
-      { 
-        return obj_type_str_; 
-      };      
-      
-    protected :
-      
-      /**
-        * @brief The internal object pointer.
-        */
-      ObjectT* obj_ptr_;
-      
-      /**
-        * @brief The internal object type.
-        */
-      std::string obj_type_str_;      
-      
-  }; 
-
- /**
-  * @brief A container class to store multiple types os object copies.
-  * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-  * @note This is a thread-safe class.
-  * @note Do not use this class with polymorphic types !!
-  * @ingroup Utils
-  */
-  template< typename TeMultiContainerKeyT >
-  class TeMultiContainer {
-  
-    public :
-    
-      /** @typedef TeSharedPtr< TeMultiContainer< TeMultiContainerKeyT > > pointer 
-          Type definition for a instance pointer */
-      typedef TeSharedPtr< TeMultiContainer< TeMultiContainerKeyT > > pointer;
-      
-      /** @typedef const TeSharedPtr< TeMultiContainer< TeMultiContainerKeyT > > const_pointer 
-          Type definition for a const instance pointer */
-      typedef const TeSharedPtr< TeMultiContainer< TeMultiContainerKeyT > > const_pointer;
-      
-      /**
-       * @brief Default Constructor
-       */
-      TeMultiContainer();
-      
-      /**
-       * @brief Alternative Constructor
-       * @param external External reference.
-       */
-      TeMultiContainer( 
-        const TeMultiContainer< TeMultiContainerKeyT >& external );      
-
-      /**
-       * @brief  Default Destructor
-       */
-      ~TeMultiContainer();
-                           
-      /**
-       * @brief Operator == overload.
-       *
-       * @param ext_instance External instance reference.
-       * @return true if this instance have the same internal
-       * update time that the external instance.
-       */
-      bool operator==( 
-        const TeMultiContainer< TeMultiContainerKeyT >& ext_instance ) const;
-      
-      /**
-       * @brief Operator != overload.
-       *
-       * @param ext_instance External instance reference.
-       * @return true if this instance don't have the same internal
-       * update time that the external instance.
-       */
-      bool operator!=( 
-        const TeMultiContainer< TeMultiContainerKeyT >& ext_instance ) const;
-      
-      /**
-       * @brief operator= overload.
-       *
-       * @param ext_instance External instance reference.
-       * @return The external instance reference.
-       */
-      const TeMultiContainer< TeMultiContainerKeyT >& operator=( 
-        const TeMultiContainer< TeMultiContainerKeyT >& ext_instance );
-      
-      /**
-       * @brief Clear all contents.
-       *
-       */
-      void clear();
-                         
-      /**
-       * @brief Store a object copy.
-       *
-       * @param obj_key Object key.
-       * @param obj_reference Object instance.
-       */                         
-      template< typename ObjectT >
-      void store( const TeMultiContainerKeyT& obj_key,
-                         const ObjectT& obj_reference );
-      
-      /**
-       * @brief Retrive a copy of a stored object.
-       *
-       * @param obj_key Object key.
-       * @param obj_reference Object instance.
-       * @return true if OK, false if the parameter was no found or error.
-       */      
-      template< typename ObjectT >
-      bool retrive( const TeMultiContainerKeyT& obj_key,
-        ObjectT& obj_reference ) const;
-        
-      /**
-       * @brief Retrive copies of all stored objects of a defined type.
-       *
-       * @param objs_vector A vector with copies of all found objects.
-       * @note An empty vector will be returned if no object was found.
-       */      
-      template< typename ObjectT >
-      void multiRetrive( std::vector< std::pair< TeMultiContainerKeyT, 
-        ObjectT > >& objs_vector ) const;        
-     
-      /** 
-       * @brief Checks if a object is stored.
-       * 
-       * @param obj_key Object key.
-       * @note The object type must be specified.
-       * @return true if OK, false if the object is not stored.
-       */
-      template< typename ObjectT >
-      bool isStored( const TeMultiContainerKeyT& obj_key ) const;
-      
-      /** 
-       * @brief Remove a stored object.
-       * 
-       * @param obj_key Object key.
-       */
-      void remove( const TeMultiContainerKeyT& obj_key );      
-      
-    protected :
-
-      /** @brief Internal container type definition. */
-      typedef typename std::map< TeMultiContainerKeyT,
-        TeMCNodeInterface< TeMultiContainerKeyT >* > IntContainerT;
-      
-      /** @brief The nodes container instance. */
-      IntContainerT container_instance_;    
-      
-      /**
-       * @brief The last update time.
-       */
-      time_t last_up_time_;
-      
-      /**
-       * @brief This instance locking mutex.
-       */    
-      mutable TeMutex lock_instance_;      
-
-      /**
-       * @brief Updates the internal last update time.
-       *
-       * @note Needed by comparison between two multi containers.
-       */
-      void update_time();            
-
-};
-
-
-template< typename TeMultiContainerKeyT >
-TeMultiContainer< TeMultiContainerKeyT >::TeMultiContainer()
-{
-  last_up_time_ = 0;
-}
-
-
-template< typename TeMultiContainerKeyT >
-TeMultiContainer< TeMultiContainerKeyT >::TeMultiContainer( 
-  const TeMultiContainer< TeMultiContainerKeyT >& external )
-{
-  last_up_time_ = 0;
-  
-  operator=( external );
-}
-
-
-template< typename TeMultiContainerKeyT >
-TeMultiContainer< TeMultiContainerKeyT >::~TeMultiContainer()
-{
-  clear();
-}
-
-
-template< typename TeMultiContainerKeyT >
-void TeMultiContainer< TeMultiContainerKeyT >::clear()
-{
-  lock_instance_.lock();
-  
-  typename IntContainerT::iterator it = container_instance_.begin();
-  typename IntContainerT::iterator it_end = container_instance_.end();
-  
-  while( it != it_end ) {
-    delete (it->second);
-    
-    ++it;
-  }
-  
-  container_instance_.clear();
-  
-  lock_instance_.unLock();
-}
-
-
-template< typename TeMultiContainerKeyT >
-bool TeMultiContainer< TeMultiContainerKeyT >::operator==( 
-  const TeMultiContainer< TeMultiContainerKeyT >& ext_instance ) const
-{
-  if( last_up_time_ == ext_instance.last_up_time_ ) {
-    return true;
-  } else {
-    return false;
-  }
-}
-
-
-template< typename TeMultiContainerKeyT >
-bool TeMultiContainer< TeMultiContainerKeyT >::operator!=( 
-  const TeMultiContainer< TeMultiContainerKeyT >& ext_instance ) 
-  const
-{
-  if( last_up_time_ == ext_instance.last_up_time_ ) {
-    return false;
-  } else {
-    return true;
-  }
-}
-
-
-template< typename TeMultiContainerKeyT >
-const TeMultiContainer< TeMultiContainerKeyT >& 
-TeMultiContainer< TeMultiContainerKeyT >::operator=( 
-  const TeMultiContainer< TeMultiContainerKeyT >& ext_instance )
-{
-  if( ( &ext_instance ) != this ) {
-    lock_instance_.lock();
-    
-    /* Clearing the current objects */
-    
-    typename IntContainerT::iterator my_container_it = 
-      container_instance_.begin();
-    typename IntContainerT::iterator my_container_it_end = 
-      container_instance_.end();
-    
-    while( my_container_it != my_container_it_end ) {
-      delete (my_container_it->second);
-      
-      ++my_container_it;
-    }    
-    
-    container_instance_.clear();
-    
-    /* Cloning external objects */
-    
-    ext_instance.lock_instance_.lock();
-  
-    typename IntContainerT::const_iterator container_it = 
-      ext_instance.container_instance_.begin();
-    typename IntContainerT::const_iterator container_it_end = 
-      ext_instance.container_instance_.end();
-          
-    while( container_it != container_it_end ) {
-      container_instance_[ container_it->first ] = 
-        container_it->second->clone();
-          
-      ++container_it;
-    }
-  
-    last_up_time_ = ext_instance.last_up_time_;
-  
-    ext_instance.lock_instance_.unLock();
-    
-    lock_instance_.unLock();
-  }
-
-  return *this;
-}
-
-
-template< typename TeMultiContainerKeyT >
-void TeMultiContainer< TeMultiContainerKeyT >::update_time()
-{
-  last_up_time_ = time( 0 );
-}
-
-
-template< typename TeMultiContainerKeyT >
-template< typename ObjectT >
-void TeMultiContainer< TeMultiContainerKeyT >::store( 
-  const TeMultiContainerKeyT& obj_key, const ObjectT& obj_reference )
-{
-  lock_instance_.lock();
-
-  /* Creating a new node */
-  
-  ObjectT* newobjptr = new ObjectT;
-  ( *newobjptr ) = obj_reference;
-  
-  TeMCNode< ObjectT, TeMultiContainerKeyT >* newnodeptr =
-    new TeMCNode< ObjectT, TeMultiContainerKeyT >;  
-  newnodeptr->setObjPtr( newobjptr );
-  
-  typename IntContainerT::iterator container_it = 
-    container_instance_.find( obj_key );
-    
-  /* If a old node with the same key exists, it will be deleted */
-    
-  if( container_it == container_instance_.end() ) {
-    container_instance_[ obj_key ] = newnodeptr;
-  } else {
-    delete (container_it->second);
-    
-    container_it->second = newnodeptr;
-  }
-      
-  update_time();
-  
-  lock_instance_.unLock();
-}
-
-
-template< typename TeMultiContainerKeyT >
-template< typename ObjectT >
-bool TeMultiContainer< TeMultiContainerKeyT >::retrive(
-  const TeMultiContainerKeyT& obj_key, ObjectT& obj_reference ) const
-{
-  lock_instance_.lock();
-  
-  typename IntContainerT::const_iterator container_it = 
-    container_instance_.find( obj_key );
-    
-  if( container_it == container_instance_.end() ) {
-    lock_instance_.unLock();
-    
-    return false;
-  } else {
-    if( typeid( ObjectT ).name() == 
-      container_it->second->getObjTypeInfo() ) {
-      
-      obj_reference = 
-        ( *( ( (TeMCNode< ObjectT, TeMultiContainerKeyT >* )
-        container_it->second )->getObjPtr() ) );
-    
-      lock_instance_.unLock();
-    
-      return true;
-    } else {
-      lock_instance_.unLock();
-    
-      return false;
-    }
-  }
-}
-
-
-template< typename TeMultiContainerKeyT >
-template< typename ObjectT >
-void TeMultiContainer< TeMultiContainerKeyT >::multiRetrive(
-  std::vector< std::pair< TeMultiContainerKeyT, 
-  ObjectT > >& objs_vector ) const
-{
-  objs_vector.clear();
-  
-  lock_instance_.lock();
-  
-  typename IntContainerT::const_iterator container_it = 
-    container_instance_.begin();
-  typename IntContainerT::const_iterator container_it_end = 
-    container_instance_.end();
-  
-  std::pair< TeMultiContainerKeyT, ObjectT > temp_pair;
-  
-  while( container_it != container_it_end ) {
-    if( typeid( ObjectT ).name() == 
-      container_it->second->getObjTypeInfo() ) {  
-      
-      temp_pair.first = container_it->first;
-      temp_pair.second = 
-        ( *( ( ( TeMCNode< ObjectT, TeMultiContainerKeyT >* )
-        container_it->second )->getObjPtr() ) );
-    
-      objs_vector.push_back( temp_pair );      
-    }  
-  
-    ++container_it;
-  }
-  
-  lock_instance_.unLock();
-}
-
-
-template< typename TeMultiContainerKeyT >
-template< typename ObjectT >
-bool TeMultiContainer< TeMultiContainerKeyT >::isStored( 
-  const TeMultiContainerKeyT& obj_key ) const
-{
-  lock_instance_.lock();
-  
-  typename IntContainerT::const_iterator container_it = 
-    container_instance_.find( obj_key );
-    
-  if( container_it == container_instance_.end() ) {
-    lock_instance_.unLock();
-    
-    return false;
-  } else {
-    if( typeid( ObjectT ).name() == 
-      container_it->second->getObjTypeInfo() ) {
-    
-      lock_instance_.unLock();
-    
-      return true;
-    } else {
-      lock_instance_.unLock();
-    
-      return false;
-    }
-  }
-}
-
-
-template< typename TeMultiContainerKeyT >
-void TeMultiContainer< TeMultiContainerKeyT >::remove( 
-  const TeMultiContainerKeyT& obj_key )
-{
-  lock_instance_.lock();
-  
-  typename IntContainerT::iterator container_it = 
-    container_instance_.find( obj_key );
-    
-  /* If a old node with the same key exists, it will be deleted */
-    
-  if( container_it != container_instance_.end() ) {
-    delete (container_it->second);
-    
-    container_instance_.erase( container_it );
-  }
-      
-  update_time();
-  
-  lock_instance_.unLock();
-}
-
-/** @example TeMultiContainer_test.cpp
- *    Shows how to use this class.
- */  
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*! \file TeMultiContainer.h
+   \brief A container class to store multiple types os object copies.
+*/
+
+
+#ifndef TEMULTICONTAINER_H
+  #define TEMULTICONTAINER_H
+
+  #include "TeSharedPtr.h"
+  #include "TeMutex.h"
+  #include "TeAgnostic.h"
+  
+  #include <vector>
+  #include <typeinfo>
+
+  /**
+    * @brief Multi-container node interface.
+    * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+    * @ingroup Utils
+    */    
+  template< typename TeMultiContainerKeyT >
+  class TeMCNodeInterface {
+    public :
+    
+      /**
+        * @brief Default Constructor.
+        */        
+      TeMCNodeInterface() {};
+      
+      /**
+        * @brief Default Destructor.
+        */        
+      virtual ~TeMCNodeInterface() {};
+      
+      /**
+        * @brief Copies the the current node instance by calling
+        * the operator= from the contained object instance.
+        * @return A pointer to the new node copy.
+        */            
+      virtual TeMCNodeInterface< TeMultiContainerKeyT >* clone() 
+        const = 0;
+        
+      /**
+        * @brief Get the internal object type info.
+        * @return The internal object type info.
+        */        
+      virtual const std::string& getObjTypeInfo() const = 0;
+      
+      /**
+        * @brief operator== overload.
+        * @param external External node reference.
+        * @return true if both nodes are pointing to identic
+        * object copies
+        */        
+      virtual bool operator==( const TeMCNodeInterface< 
+        TeMultiContainerKeyT >& external ) const = 0;   
+    
+      /**
+        * @brief Returns the object pointer casted to void.
+        * @return The object pointer casted to void.
+        */         
+      virtual void* getObjVoidPtr() const = 0;
+      
+    private :
+    
+      /**
+        * @brief Alternative constructor.
+        */        
+      TeMCNodeInterface( 
+        const TeMCNodeInterface< TeMultiContainerKeyT >& ) {};    
+    
+      /**
+      * @brief operator= overload.
+      *
+      * @param ext_instance External instance reference.
+      * @return The external instance reference.
+      */
+      const TeMCNodeInterface< TeMultiContainerKeyT >& operator=( 
+        const TeMCNodeInterface< TeMultiContainerKeyT >& ) {};        
+  };
+
+
+  /**
+    * @brief Multi-container node class.
+    * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+    * @ingroup Utils
+    */       
+  template< typename ObjectT, typename TeMultiContainerKeyT >
+  class TeMCNode : public TeMCNodeInterface< TeMultiContainerKeyT > {
+    public :
+    
+      /**
+        * @brief Default Constructor.
+        */        
+      TeMCNode() 
+      {
+        obj_ptr_ = 0;
+      };
+      
+      /**
+        * @brief Default Destructor.
+        */        
+      ~TeMCNode()
+      {
+        if( obj_ptr_ ) {
+          delete obj_ptr_;
+        }
+      };
+      
+      /**
+        * @brief Copies the the current node instance by calling
+        * the operator= from the contained object instance.
+        * @return A pointer to the new node copy.
+        */              
+      TeMCNodeInterface< TeMultiContainerKeyT >* clone() const
+      {
+        TeMCNode< ObjectT, TeMultiContainerKeyT >* new_node_ptr =
+          new TeMCNode< ObjectT, TeMultiContainerKeyT >;
+          
+        if( obj_ptr_ ) {
+          new_node_ptr->obj_ptr_ = new ObjectT;
+          ( *( new_node_ptr->obj_ptr_ ) ) = ( *obj_ptr_ );
+          
+          new_node_ptr->obj_type_str_ = obj_type_str_;
+        }
+        
+        return new_node_ptr;
+      };
+      
+      /**
+        * @brief Set the internal object pointer.
+        * @param ptr Object pointer.
+        */        
+      void setObjPtr( ObjectT* ptr ) 
+      { 
+        TEAGN_DEBUG_CONDITION( ptr, "Invalid pointer" )
+        
+        if( obj_ptr_ ) {
+          delete obj_ptr_;
+        }      
+      
+        obj_ptr_ = ptr;
+        obj_type_str_ = std::string( typeid( *ptr ).name() );
+      };
+      
+      /**
+        * @brief Get the internal object pointer.
+        * @return The object pointer.
+        */        
+      ObjectT* getObjPtr() const
+      { 
+        return obj_ptr_; 
+      };
+      
+      /**
+        * @brief Get the internal object type info.
+        * @return The internal object type info.
+        */        
+      const std::string& getObjTypeInfo() const
+      { 
+        return obj_type_str_; 
+      };      
+      
+      bool operator==( const TeMCNodeInterface< 
+        TeMultiContainerKeyT >& external ) const
+      {
+        if( obj_type_str_ == external.getObjTypeInfo() )
+        {
+          ObjectT const* externalObjPtr = (ObjectT const*)( 
+            external.getObjVoidPtr() );
+            
+          if( (*externalObjPtr) == (*obj_ptr_) )
+          {
+            return true;
+          }
+          else
+          {
+            return false;
+          }
+        }
+        else
+        {
+          return false;
+        }
+      }; 
+      
+    protected :
+      
+      /**
+        * @brief The internal object pointer.
+        */
+      ObjectT* obj_ptr_;
+      
+      /**
+        * @brief The internal object type.
+        */
+      std::string obj_type_str_;      
+      
+      void* getObjVoidPtr() const
+      {
+        return (void*)obj_ptr_;
+      }
+  }; 
+
+ /**
+  * @brief A container class to store multiple types os object copies.
+  * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+  * @note This is a thread-safe class.
+  * @note Do not use this class with polymorphic types !!
+  * @ingroup Utils
+  */
+  template< typename TeMultiContainerKeyT >
+  class TeMultiContainer {
+  
+    public :
+    
+      /** @typedef TeSharedPtr< TeMultiContainer< TeMultiContainerKeyT > > pointer 
+          Type definition for a instance pointer */
+      typedef TeSharedPtr< TeMultiContainer< TeMultiContainerKeyT > > pointer;
+      
+      /** @typedef const TeSharedPtr< TeMultiContainer< TeMultiContainerKeyT > > const_pointer 
+          Type definition for a const instance pointer */
+      typedef const TeSharedPtr< TeMultiContainer< TeMultiContainerKeyT > > const_pointer;
+      
+      /**
+       * @brief Default Constructor
+       */
+      TeMultiContainer();
+      
+      /**
+       * @brief Alternative Constructor
+       * @param external External reference.
+       */
+      TeMultiContainer( 
+        const TeMultiContainer< TeMultiContainerKeyT >& external );      
+
+      /**
+       * @brief  Default Destructor
+       */
+      ~TeMultiContainer();
+                           
+      /**
+       * @brief Operator == overload.
+       *
+       * @param external External instance reference.
+       * @return true if this instance have the same identical object copies.
+       */
+      bool operator==( 
+        const TeMultiContainer< TeMultiContainerKeyT >& external ) const;
+      
+      /**
+       * @brief Operator != overload.
+       *
+       * @param ext_instance External instance reference.
+       * @return true if this instance don't have the same identical object 
+       * copies.
+       */
+      bool operator!=( 
+        const TeMultiContainer< TeMultiContainerKeyT >& ext_instance ) const;
+      
+      /**
+       * @brief operator= overload.
+       *
+       * @param ext_instance External instance reference.
+       * @return The external instance reference.
+       */
+      const TeMultiContainer< TeMultiContainerKeyT >& operator=( 
+        const TeMultiContainer< TeMultiContainerKeyT >& ext_instance );
+      
+      /**
+       * @brief Clear all contents.
+       *
+       */
+      void clear();
+                         
+      /**
+       * @brief Store a object copy.
+       *
+       * @param obj_key Object key.
+       * @param obj_reference Object instance.
+       */                         
+      template< typename ObjectT >
+      void store( const TeMultiContainerKeyT& obj_key,
+                         const ObjectT& obj_reference );
+      
+      /**
+       * @brief Retrive a copy of a stored object.
+       *
+       * @param obj_key Object key.
+       * @param obj_reference Object instance.
+       * @return true if OK, false if the parameter was no found or error.
+       */      
+      template< typename ObjectT >
+      bool retrive( const TeMultiContainerKeyT& obj_key,
+        ObjectT& obj_reference ) const;
+        
+      /**
+       * @brief Retrive copies of all stored objects of a defined type.
+       *
+       * @param objs_vector A vector with copies of all found objects.
+       * @note An empty vector will be returned if no object was found.
+       */      
+      template< typename ObjectT >
+      void multiRetrive( std::vector< std::pair< TeMultiContainerKeyT, 
+        ObjectT > >& objs_vector ) const;        
+     
+      /** 
+       * @brief Checks if a object is stored.
+       * 
+       * @param obj_key Object key.
+       * @note The object type must be specified.
+       * @return true if OK, false if the object is not stored.
+       */
+      template< typename ObjectT >
+      bool isStored( const TeMultiContainerKeyT& obj_key ) const;
+      
+      /** 
+       * @brief Remove a stored object.
+       * 
+       * @param obj_key Object key.
+       */
+      void remove( const TeMultiContainerKeyT& obj_key );      
+      
+    protected :
+
+      /** @brief Internal container type definition. */
+      typedef typename std::map< TeMultiContainerKeyT,
+        TeMCNodeInterface< TeMultiContainerKeyT >* > IntContainerT;
+      
+      /** @brief The nodes container instance. */
+      IntContainerT container_instance_;    
+      
+      /**
+       * @brief This instance locking mutex.
+       */    
+      mutable TeMutex lock_instance_;      
+};
+
+
+template< typename TeMultiContainerKeyT >
+TeMultiContainer< TeMultiContainerKeyT >::TeMultiContainer()
+{
+}
+
+
+template< typename TeMultiContainerKeyT >
+TeMultiContainer< TeMultiContainerKeyT >::TeMultiContainer( 
+  const TeMultiContainer< TeMultiContainerKeyT >& external )
+{
+  operator=( external );
+}
+
+
+template< typename TeMultiContainerKeyT >
+TeMultiContainer< TeMultiContainerKeyT >::~TeMultiContainer()
+{
+  clear();
+}
+
+
+template< typename TeMultiContainerKeyT >
+void TeMultiContainer< TeMultiContainerKeyT >::clear()
+{
+  lock_instance_.lock();
+  
+  typename IntContainerT::iterator it = container_instance_.begin();
+  typename IntContainerT::iterator it_end = container_instance_.end();
+  
+  while( it != it_end ) {
+    delete (it->second);
+    
+    ++it;
+  }
+  
+  container_instance_.clear();
+  
+  lock_instance_.unLock();
+}
+
+
+template< typename TeMultiContainerKeyT >
+bool TeMultiContainer< TeMultiContainerKeyT >::operator==( 
+  const TeMultiContainer< TeMultiContainerKeyT >& external ) const
+{
+  if( container_instance_.size() == external.container_instance_.size() ) 
+  {
+    typename IntContainerT::const_iterator myIt = 
+      container_instance_.begin();
+    typename IntContainerT::const_iterator myItEnd = 
+      container_instance_.end();
+    typename IntContainerT::const_iterator extIt;
+    typename IntContainerT::const_iterator extItEnd = 
+      external.container_instance_.end() ;
+    
+    while( myIt != myItEnd )
+    {
+      extIt = external.container_instance_.find( myIt->first );
+      
+      if( extIt == extItEnd )
+      {
+        return false;
+      }
+      
+      if( ! myIt->second->operator==( *(extIt->second ) ) )
+      {
+        return false;
+      }
+      
+      ++myIt;
+    }
+    
+    return true;
+  } 
+  else 
+  {
+    return false;
+  }
+}
+
+
+template< typename TeMultiContainerKeyT >
+bool TeMultiContainer< TeMultiContainerKeyT >::operator!=( 
+  const TeMultiContainer< TeMultiContainerKeyT >& ext_instance ) 
+  const
+{
+  return ( ! operator==( ext_instance ) );
+}
+
+
+template< typename TeMultiContainerKeyT >
+const TeMultiContainer< TeMultiContainerKeyT >& 
+TeMultiContainer< TeMultiContainerKeyT >::operator=( 
+  const TeMultiContainer< TeMultiContainerKeyT >& ext_instance )
+{
+  if( ( &ext_instance ) != this ) {
+    lock_instance_.lock();
+    
+    /* Clearing the current objects */
+    
+    typename IntContainerT::iterator my_container_it = 
+      container_instance_.begin();
+    typename IntContainerT::iterator my_container_it_end = 
+      container_instance_.end();
+    
+    while( my_container_it != my_container_it_end ) {
+      delete (my_container_it->second);
+      
+      ++my_container_it;
+    }    
+    
+    container_instance_.clear();
+    
+    /* Cloning external objects */
+    
+    ext_instance.lock_instance_.lock();
+  
+    typename IntContainerT::const_iterator container_it = 
+      ext_instance.container_instance_.begin();
+    typename IntContainerT::const_iterator container_it_end = 
+      ext_instance.container_instance_.end();
+          
+    while( container_it != container_it_end ) {
+      container_instance_[ container_it->first ] = 
+        container_it->second->clone();
+          
+      ++container_it;
+    }
+  
+    ext_instance.lock_instance_.unLock();
+    
+    lock_instance_.unLock();
+  }
+
+  return *this;
+}
+
+template< typename TeMultiContainerKeyT >
+template< typename ObjectT >
+void TeMultiContainer< TeMultiContainerKeyT >::store( 
+  const TeMultiContainerKeyT& obj_key, const ObjectT& obj_reference )
+{
+  lock_instance_.lock();
+
+  /* Creating a new node */
+  
+  ObjectT* newobjptr = new ObjectT;
+  ( *newobjptr ) = obj_reference;
+  
+  TeMCNode< ObjectT, TeMultiContainerKeyT >* newnodeptr =
+    new TeMCNode< ObjectT, TeMultiContainerKeyT >;  
+  newnodeptr->setObjPtr( newobjptr );
+  
+  typename IntContainerT::iterator container_it = 
+    container_instance_.find( obj_key );
+    
+  /* If a old node with the same key exists, it will be deleted */
+    
+  if( container_it == container_instance_.end() ) {
+    container_instance_[ obj_key ] = newnodeptr;
+  } else {
+    delete (container_it->second);
+    
+    container_it->second = newnodeptr;
+  }
+      
+  lock_instance_.unLock();
+}
+
+
+template< typename TeMultiContainerKeyT >
+template< typename ObjectT >
+bool TeMultiContainer< TeMultiContainerKeyT >::retrive(
+  const TeMultiContainerKeyT& obj_key, ObjectT& obj_reference ) const
+{
+  lock_instance_.lock();
+  
+  typename IntContainerT::const_iterator container_it = 
+    container_instance_.find( obj_key );
+    
+  if( container_it == container_instance_.end() ) {
+    lock_instance_.unLock();
+    
+    return false;
+  } else {
+    if( typeid( ObjectT ).name() == 
+      container_it->second->getObjTypeInfo() ) {
+      
+      obj_reference = 
+        ( *( ( (TeMCNode< ObjectT, TeMultiContainerKeyT >* )
+        container_it->second )->getObjPtr() ) );
+    
+      lock_instance_.unLock();
+    
+      return true;
+    } else {
+      lock_instance_.unLock();
+    
+      return false;
+    }
+  }
+}
+
+
+template< typename TeMultiContainerKeyT >
+template< typename ObjectT >
+void TeMultiContainer< TeMultiContainerKeyT >::multiRetrive(
+  std::vector< std::pair< TeMultiContainerKeyT, 
+  ObjectT > >& objs_vector ) const
+{
+  objs_vector.clear();
+  
+  lock_instance_.lock();
+  
+  typename IntContainerT::const_iterator container_it = 
+    container_instance_.begin();
+  typename IntContainerT::const_iterator container_it_end = 
+    container_instance_.end();
+  
+  std::pair< TeMultiContainerKeyT, ObjectT > temp_pair;
+  
+  while( container_it != container_it_end ) {
+    if( typeid( ObjectT ).name() == 
+      container_it->second->getObjTypeInfo() ) {  
+      
+      temp_pair.first = container_it->first;
+      temp_pair.second = 
+        ( *( ( ( TeMCNode< ObjectT, TeMultiContainerKeyT >* )
+        container_it->second )->getObjPtr() ) );
+    
+      objs_vector.push_back( temp_pair );      
+    }  
+  
+    ++container_it;
+  }
+  
+  lock_instance_.unLock();
+}
+
+
+template< typename TeMultiContainerKeyT >
+template< typename ObjectT >
+bool TeMultiContainer< TeMultiContainerKeyT >::isStored( 
+  const TeMultiContainerKeyT& obj_key ) const
+{
+  lock_instance_.lock();
+  
+  typename IntContainerT::const_iterator container_it = 
+    container_instance_.find( obj_key );
+    
+  if( container_it == container_instance_.end() ) {
+    lock_instance_.unLock();
+    
+    return false;
+  } else {
+    if( typeid( ObjectT ).name() == 
+      container_it->second->getObjTypeInfo() ) {
+    
+      lock_instance_.unLock();
+    
+      return true;
+    } else {
+      lock_instance_.unLock();
+    
+      return false;
+    }
+  }
+}
+
+
+template< typename TeMultiContainerKeyT >
+void TeMultiContainer< TeMultiContainerKeyT >::remove( 
+  const TeMultiContainerKeyT& obj_key )
+{
+  lock_instance_.lock();
+  
+  typename IntContainerT::iterator container_it = 
+    container_instance_.find( obj_key );
+    
+  /* If a old node with the same key exists, it will be deleted */
+    
+  if( container_it != container_instance_.end() ) {
+    delete (container_it->second);
+    
+    container_instance_.erase( container_it );
+  }
+      
+  lock_instance_.unLock();
+}
+
+/** @example TeMultiContainer_test.cpp
+ *    Shows how to use this class.
+ */  
+
+#endif
+
diff --git a/src/terralib/kernel/TeMultiGeometry.cpp b/src/terralib/kernel/TeMultiGeometry.cpp
old mode 100755
new mode 100644
index bf9ccb4..828c131
--- a/src/terralib/kernel/TeMultiGeometry.cpp
+++ b/src/terralib/kernel/TeMultiGeometry.cpp
@@ -1,267 +1,267 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeMultiGeometry.h"
-
-
-TeMultiGeometry::TeMultiGeometry(const TeMultiGeometry& other)
-{
-	polygons_.copyElements(other.polygons_);
-	lines_.copyElements(other.lines_);
-	points_.copyElements(other.points_);
-	cells_.copyElements(other.cells_);
-	texts_.copyElements(other.texts_); 
-}
-
-TeMultiGeometry& 	
-TeMultiGeometry::operator= (const TeMultiGeometry& other)
-{
-	if ( this != &other )
-	{
-		polygons_.copyElements(other.polygons_);
-		lines_.copyElements(other.lines_);
-		points_.copyElements(other.points_);
-		cells_.copyElements(other.cells_);
-		texts_.copyElements(other.texts_); 
-	}
-	return *this;
-}
-	
-	
-bool 
-TeMultiGeometry::getGeometry(TePolygonSet& result) const
-{
-	if(!hasPolygons())
-		return false;
-	result.copyElements(polygons_);
-	return true;
-}
-
-
-bool 
-TeMultiGeometry::getGeometry(TeLineSet& result) const
-{
-	if(!hasLines())
-		return false;
-	result.copyElements(lines_);
-	return true;
-}
-	
-bool 
-TeMultiGeometry::getGeometry(TePointSet& result) const
-{
-	if(!hasPoints())
-		return false;
-	result.copyElements(points_);
-	return true;
-}
-	
-bool 
-TeMultiGeometry::getGeometry(TeCellSet& result) const
-{
-	if(!hasCells())
-		return false;
-	result.copyElements(cells_);
-	return true;
-}
-
-bool 
-TeMultiGeometry::getGeometry(TeTextSet& result) const
-{
-	if(!hasTexts())
-		return false;
-	result.copyElements(texts_);
-	return true;
-}
-	
-bool 
-TeMultiGeometry::getGeometry(vector<TeGeometry*>& result)  
-{
-	bool status = false;
-	if(hasPolygons())
-	{
-		for(int i=0; i< (int)polygons_.size(); ++i)
-		{
-			TePolygon* pol = new TePolygon();
-			(*pol) = polygons_[i];
-			result.push_back (pol);
-			status = true;
-		}
-	}
-	if(hasLines())
-	{
-		for(int i=0; i< (int)lines_.size(); ++i)
-		{
-			TeLine2D* lin = new TeLine2D();
-			(*lin) = lines_[i];
-			result.push_back (lin);
-			status = true;
-		}
-	}
-	if(hasPoints())
-	{
-		for(int i=0; i< (int)points_.size(); ++i)
-		{
-			TePoint* pon = new TePoint();
-			(*pon) = points_[i];
-			result.push_back (pon);
-			status = true;
-		}
-	}
-	if(hasCells())
-	{
-		for(int i=0; i< (int)cells_.size(); ++i)
-		{
-			TeCell* cell = new TeCell();
-			(*cell) = cells_[i];
-			result.push_back (cell);
-			status = true;
-		}
-	}
-	return status;
-}
-
-void 
-TeMultiGeometry::setGeometry(const TePolygonSet& result) 
-{ 
-	polygons_ = result;
-}
-	
-void 
-TeMultiGeometry::setGeometry(const TeLineSet& result)     
-{ 
-	lines_ = result; 
-}
-	
-void 
-TeMultiGeometry::setGeometry(const TePointSet& result)	
-{ 
-	points_ = result; 
-}
-	
-void 
-TeMultiGeometry::setGeometry(const TeCellSet& result)		
-{ 
-	cells_ = result; 
-}
-	
-void 
-TeMultiGeometry::setGeometry(const TeTextSet& result)		
-{ 
-	texts_ = result; 
-}
-
-void 
-TeMultiGeometry::setGeometry(vector<TeGeometry*>& result)
-{
-	this->clear();
-	vector<TeGeometry*>::iterator it = result.begin();
-	
-	while(it!=result.end())
-	{
-		TeGeometry* geom = (*it);
-		
-		if(dynamic_cast<TePolygon*> (geom))
-			polygons_.add (*((TePolygon*)geom));
-		else if (dynamic_cast<TePolygonSet*> (geom))
-			polygons_ = *((TePolygonSet*) geom);
-		else if(dynamic_cast<TeLine2D*> (geom))
-			lines_.add (*((TeLine2D*)geom));
-		else if(dynamic_cast<TeLineSet*> (geom))
-			lines_ = *((TeLineSet*)geom);
-		else if(dynamic_cast<TePoint*> (geom))
-			points_.add (*((TePoint*)geom));
-		else if(dynamic_cast<TePointSet*> (geom))
-			points_ = *((TePointSet*)geom);
-		else if(dynamic_cast<TeCell*> (geom))
-			cells_.add (*((TeCell*)geom));
-		else if(dynamic_cast<TeCellSet*> (geom))
-			cells_ = *((TeCellSet*)geom);
-		else if(dynamic_cast<TeText*> (geom))
-			texts_.add (*((TeText*)geom));
-		++it;
-	}
-}
-	
-void 
-TeMultiGeometry::addGeometry(const TePolygon& poly)  
-{ 
-	polygons_.add(poly); 
-	polygons_.objectId(poly.objectId()); 
-}
-	
-void 
-TeMultiGeometry::addGeometry(const TeLine2D& line)     
-{ 
-	lines_.add(line); 
-	lines_.objectId(line.objectId()); 
-}
-	
-void 
-TeMultiGeometry::addGeometry(const TePoint& point)	
-{ 
-	points_.add(point); 
-	points_.objectId(point.objectId()); 
-} 
-	
-void 
-TeMultiGeometry::addGeometry(const TeCell& cell)		
-{ 
-	cells_.add(cell); 
-	cells_.objectId(cell.objectId()); 
-}
-
-void 
-TeMultiGeometry::addGeometry(const TeText& text)		
-{ 
-	texts_.add(text); 
-	texts_.objectId(text.objectId()); 
-}
-
-void 
-TeMultiGeometry::clear()
-{
-	polygons_.clear ();
-	lines_.clear ();
-	points_.clear ();
-	cells_.clear ();
-	texts_.clear();
-}
-
-TeBox 
-TeMultiGeometry::getBox()
-{
-	TeBox box;
-	if (hasPolygons())
-		updateBox(box,polygons_.box());
-	if (hasLines())
-		updateBox(box,lines_.box());
-	if (hasPoints())
-		updateBox(box,points_.box());
-	if (hasCells())
-		updateBox(box,cells_.box());
-	if (hasTexts())
-		updateBox(box,texts_.box());
-	return box;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeMultiGeometry.h"
+
+
+TeMultiGeometry::TeMultiGeometry(const TeMultiGeometry& other)
+{
+	polygons_.copyElements(other.polygons_);
+	lines_.copyElements(other.lines_);
+	points_.copyElements(other.points_);
+	cells_.copyElements(other.cells_);
+	texts_.copyElements(other.texts_); 
+}
+
+TeMultiGeometry& 	
+TeMultiGeometry::operator= (const TeMultiGeometry& other)
+{
+	if ( this != &other )
+	{
+		polygons_.copyElements(other.polygons_);
+		lines_.copyElements(other.lines_);
+		points_.copyElements(other.points_);
+		cells_.copyElements(other.cells_);
+		texts_.copyElements(other.texts_); 
+	}
+	return *this;
+}
+	
+	
+bool 
+TeMultiGeometry::getGeometry(TePolygonSet& result) const
+{
+	if(!hasPolygons())
+		return false;
+	result.copyElements(polygons_);
+	return true;
+}
+
+
+bool 
+TeMultiGeometry::getGeometry(TeLineSet& result) const
+{
+	if(!hasLines())
+		return false;
+	result.copyElements(lines_);
+	return true;
+}
+	
+bool 
+TeMultiGeometry::getGeometry(TePointSet& result) const
+{
+	if(!hasPoints())
+		return false;
+	result.copyElements(points_);
+	return true;
+}
+	
+bool 
+TeMultiGeometry::getGeometry(TeCellSet& result) const
+{
+	if(!hasCells())
+		return false;
+	result.copyElements(cells_);
+	return true;
+}
+
+bool 
+TeMultiGeometry::getGeometry(TeTextSet& result) const
+{
+	if(!hasTexts())
+		return false;
+	result.copyElements(texts_);
+	return true;
+}
+	
+bool 
+TeMultiGeometry::getGeometry(vector<TeGeometry*>& result)  
+{
+	bool status = false;
+	if(hasPolygons())
+	{
+		for(int i=0; i< (int)polygons_.size(); ++i)
+		{
+			TePolygon* pol = new TePolygon();
+			(*pol) = polygons_[i];
+			result.push_back (pol);
+			status = true;
+		}
+	}
+	if(hasLines())
+	{
+		for(int i=0; i< (int)lines_.size(); ++i)
+		{
+			TeLine2D* lin = new TeLine2D();
+			(*lin) = lines_[i];
+			result.push_back (lin);
+			status = true;
+		}
+	}
+	if(hasPoints())
+	{
+		for(int i=0; i< (int)points_.size(); ++i)
+		{
+			TePoint* pon = new TePoint();
+			(*pon) = points_[i];
+			result.push_back (pon);
+			status = true;
+		}
+	}
+	if(hasCells())
+	{
+		for(int i=0; i< (int)cells_.size(); ++i)
+		{
+			TeCell* cell = new TeCell();
+			(*cell) = cells_[i];
+			result.push_back (cell);
+			status = true;
+		}
+	}
+	return status;
+}
+
+void 
+TeMultiGeometry::setGeometry(const TePolygonSet& result) 
+{ 
+	polygons_ = result;
+}
+	
+void 
+TeMultiGeometry::setGeometry(const TeLineSet& result)     
+{ 
+	lines_ = result; 
+}
+	
+void 
+TeMultiGeometry::setGeometry(const TePointSet& result)	
+{ 
+	points_ = result; 
+}
+	
+void 
+TeMultiGeometry::setGeometry(const TeCellSet& result)		
+{ 
+	cells_ = result; 
+}
+	
+void 
+TeMultiGeometry::setGeometry(const TeTextSet& result)		
+{ 
+	texts_ = result; 
+}
+
+void 
+TeMultiGeometry::setGeometry(vector<TeGeometry*>& result)
+{
+	this->clear();
+	vector<TeGeometry*>::iterator it = result.begin();
+	
+	while(it!=result.end())
+	{
+		TeGeometry* geom = (*it);
+		
+		if(dynamic_cast<TePolygon*> (geom))
+			polygons_.add (*((TePolygon*)geom));
+		else if (dynamic_cast<TePolygonSet*> (geom))
+			polygons_ = *((TePolygonSet*) geom);
+		else if(dynamic_cast<TeLine2D*> (geom))
+			lines_.add (*((TeLine2D*)geom));
+		else if(dynamic_cast<TeLineSet*> (geom))
+			lines_ = *((TeLineSet*)geom);
+		else if(dynamic_cast<TePoint*> (geom))
+			points_.add (*((TePoint*)geom));
+		else if(dynamic_cast<TePointSet*> (geom))
+			points_ = *((TePointSet*)geom);
+		else if(dynamic_cast<TeCell*> (geom))
+			cells_.add (*((TeCell*)geom));
+		else if(dynamic_cast<TeCellSet*> (geom))
+			cells_ = *((TeCellSet*)geom);
+		else if(dynamic_cast<TeText*> (geom))
+			texts_.add (*((TeText*)geom));
+		++it;
+	}
+}
+	
+void 
+TeMultiGeometry::addGeometry(const TePolygon& poly)  
+{ 
+	polygons_.add(poly); 
+	polygons_.objectId(poly.objectId()); 
+}
+	
+void 
+TeMultiGeometry::addGeometry(const TeLine2D& line)     
+{ 
+	lines_.add(line); 
+	lines_.objectId(line.objectId()); 
+}
+	
+void 
+TeMultiGeometry::addGeometry(const TePoint& point)	
+{ 
+	points_.add(point); 
+	points_.objectId(point.objectId()); 
+} 
+	
+void 
+TeMultiGeometry::addGeometry(const TeCell& cell)		
+{ 
+	cells_.add(cell); 
+	cells_.objectId(cell.objectId()); 
+}
+
+void 
+TeMultiGeometry::addGeometry(const TeText& text)		
+{ 
+	texts_.add(text); 
+	texts_.objectId(text.objectId()); 
+}
+
+void 
+TeMultiGeometry::clear()
+{
+	polygons_.clear ();
+	lines_.clear ();
+	points_.clear ();
+	cells_.clear ();
+	texts_.clear();
+}
+
+TeBox 
+TeMultiGeometry::getBox()
+{
+	TeBox box;
+	if (hasPolygons())
+		updateBox(box,polygons_.box());
+	if (hasLines())
+		updateBox(box,lines_.box());
+	if (hasPoints())
+		updateBox(box,points_.box());
+	if (hasCells())
+		updateBox(box,cells_.box());
+	if (hasTexts())
+		updateBox(box,texts_.box());
+	return box;
+}
+
diff --git a/src/terralib/kernel/TeMultiGeometry.h b/src/terralib/kernel/TeMultiGeometry.h
old mode 100755
new mode 100644
index e57b0df..322bf86
--- a/src/terralib/kernel/TeMultiGeometry.h
+++ b/src/terralib/kernel/TeMultiGeometry.h
@@ -1,161 +1,161 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMultiGeometry.h
-    \brief This file contains structures and definitions to deal with a multigeometry. 
-*/
-
-#ifndef  __TERRALIB_MULTIGEOMETRY_H
-#define  __TERRALIB_MULTIGEOMETRY_H
-
-#include "TeGeometry.h"
-
-
-class TL_DLL TeMultiGeometry
-{
-
-public:
-	TePolygonSet		polygons_;
-	TeLineSet			lines_;
-	TePointSet			points_;
-	TeCellSet			cells_;
-	TeTextSet			texts_;
-	
-	//! Constructor
-	TeMultiGeometry() {};
-
-	//! Copy constructor
-	TeMultiGeometry(const TeMultiGeometry& other);
-	
-	//! Assignment operator
-	TeMultiGeometry& operator= (const TeMultiGeometry& other);
-	
-	//! Get a copy of polygon geometries. Return true if the geometries exit.  
-	bool getGeometry(TePolygonSet& result) const; 
-	
-	//! Get a copy of line geometries. Return true if the geometries exit.  
-	bool getGeometry(TeLineSet& result) const;
-	
-	//! Get a copy of point geometries. Return true if the geometries exit.  
-	bool getGeometry(TePointSet& result) const;
-	
-	//! Get a copy of cell geometries. Return true if the geometries exit.  
-	bool getGeometry(TeCellSet& result) const;
-
-	//! Get a copy of text geometries. Return true if the geometries exit.  
-	bool getGeometry(TeTextSet& result) const;
-	
-	//! Get a reference to the polygon geometry container  
-	TePolygonSet&  getPolygons() 
-	{	return polygons_; }
-	
-	//! Get a reference to the line geometry container  
-	TeLineSet&  getLines() 
-	{	return lines_; }
-
-	//! Get a reference to the point geometry container  
-	TePointSet&  getPoints() 
-	{	return points_; }
-
-	//! Get a reference to the cell geometry container  
-	TeCellSet&  getCells() 
-	{	return cells_; }
-
-	//! Get a reference to the text geometry container  
-	TeTextSet&  getTexts() 
-	{	return texts_; }
-
-	//! Get all geometries. Return true if the geometries exit.  
-	bool getGeometry(vector<TeGeometry*>& result);
-
-	//! Set polygon geometries
-	void setGeometry(const TePolygonSet& result);
-	
-	//! Set line geometries
-	void setGeometry(const TeLineSet& result);
-	
-	//! Set point geometries
-	void setGeometry(const TePointSet& result);
-	
-	//! Set cell geometries
-	void setGeometry(const TeCellSet& result);
-	
-	//! Set text geometries
-	void setGeometry(const TeTextSet& result); 
-	
-	//! Set all geometries
-	void setGeometry(vector<TeGeometry*>& result); 
-
-	//! Add polygon geometry 
-	void addGeometry(const TePolygon& poly); 
-	
-	//! Add line geometry
-	void addGeometry(const TeLine2D& line); 
-	
-	//! Add point geometry
-	void addGeometry(const TePoint& point); 
-	
-	//! Add cell geometry
-	void addGeometry(const TeCell& cell); 
-
-	//! Add cell geometry
-	void addGeometry(const TeText& text); 
-
-	//! Return true if this has polygons 
-	bool hasPolygons()	const
-	{ return (!polygons_.empty()); } 
-	
-	//! Return true if this has lines 
-	bool hasLines() const		
-	{ return (!lines_.empty()); } 
-	
-	//! Return true if this has points 
-	bool hasPoints() const		
-	{ return (!points_.empty()); } 
-	
-	//! Return true if this has cells 
-	bool hasCells()	const
-	{ return (!cells_.empty()); } 
-	
-	//! Return true if this has cells 
-	bool hasTexts()	const	
-	{ return (!texts_.empty()); } 
-	
-	//! Return true if there are not any geometry  
-	bool empty()  
-	{ 
-		return ( polygons_.empty() &&  lines_.empty() &&
-				 points_.empty()   &&  cells_.empty() &&  texts_.empty());
-	}
-
-	//! Clear geometries
-	void clear();
-
-	//! Get the total extension of the multi-geometry
-	TeBox getBox();
-
-	//! Get the total extension of the multi-geometry
-	TeBox box()
-	{ return this->getBox(); } 
-};
-
-#endif 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMultiGeometry.h
+    \brief This file contains structures and definitions to deal with a multigeometry. 
+*/
+
+#ifndef  __TERRALIB_MULTIGEOMETRY_H
+#define  __TERRALIB_MULTIGEOMETRY_H
+
+#include "TeGeometry.h"
+
+
+class TL_DLL TeMultiGeometry
+{
+
+public:
+	TePolygonSet		polygons_;
+	TeLineSet			lines_;
+	TePointSet			points_;
+	TeCellSet			cells_;
+	TeTextSet			texts_;
+	
+	//! Constructor
+	TeMultiGeometry() {};
+
+	//! Copy constructor
+	TeMultiGeometry(const TeMultiGeometry& other);
+	
+	//! Assignment operator
+	TeMultiGeometry& operator= (const TeMultiGeometry& other);
+	
+	//! Get a copy of polygon geometries. Return true if the geometries exit.  
+	bool getGeometry(TePolygonSet& result) const; 
+	
+	//! Get a copy of line geometries. Return true if the geometries exit.  
+	bool getGeometry(TeLineSet& result) const;
+	
+	//! Get a copy of point geometries. Return true if the geometries exit.  
+	bool getGeometry(TePointSet& result) const;
+	
+	//! Get a copy of cell geometries. Return true if the geometries exit.  
+	bool getGeometry(TeCellSet& result) const;
+
+	//! Get a copy of text geometries. Return true if the geometries exit.  
+	bool getGeometry(TeTextSet& result) const;
+	
+	//! Get a reference to the polygon geometry container  
+	TePolygonSet&  getPolygons() 
+	{	return polygons_; }
+	
+	//! Get a reference to the line geometry container  
+	TeLineSet&  getLines() 
+	{	return lines_; }
+
+	//! Get a reference to the point geometry container  
+	TePointSet&  getPoints() 
+	{	return points_; }
+
+	//! Get a reference to the cell geometry container  
+	TeCellSet&  getCells() 
+	{	return cells_; }
+
+	//! Get a reference to the text geometry container  
+	TeTextSet&  getTexts() 
+	{	return texts_; }
+
+	//! Get all geometries. Return true if the geometries exit.  
+	bool getGeometry(vector<TeGeometry*>& result);
+
+	//! Set polygon geometries
+	void setGeometry(const TePolygonSet& result);
+	
+	//! Set line geometries
+	void setGeometry(const TeLineSet& result);
+	
+	//! Set point geometries
+	void setGeometry(const TePointSet& result);
+	
+	//! Set cell geometries
+	void setGeometry(const TeCellSet& result);
+	
+	//! Set text geometries
+	void setGeometry(const TeTextSet& result); 
+	
+	//! Set all geometries
+	void setGeometry(vector<TeGeometry*>& result); 
+
+	//! Add polygon geometry 
+	void addGeometry(const TePolygon& poly); 
+	
+	//! Add line geometry
+	void addGeometry(const TeLine2D& line); 
+	
+	//! Add point geometry
+	void addGeometry(const TePoint& point); 
+	
+	//! Add cell geometry
+	void addGeometry(const TeCell& cell); 
+
+	//! Add cell geometry
+	void addGeometry(const TeText& text); 
+
+	//! Return true if this has polygons 
+	bool hasPolygons()	const
+	{ return (!polygons_.empty()); } 
+	
+	//! Return true if this has lines 
+	bool hasLines() const		
+	{ return (!lines_.empty()); } 
+	
+	//! Return true if this has points 
+	bool hasPoints() const		
+	{ return (!points_.empty()); } 
+	
+	//! Return true if this has cells 
+	bool hasCells()	const
+	{ return (!cells_.empty()); } 
+	
+	//! Return true if this has cells 
+	bool hasTexts()	const	
+	{ return (!texts_.empty()); } 
+	
+	//! Return true if there are not any geometry  
+	bool empty()  
+	{ 
+		return ( polygons_.empty() &&  lines_.empty() &&
+				 points_.empty()   &&  cells_.empty() &&  texts_.empty());
+	}
+
+	//! Clear geometries
+	void clear();
+
+	//! Get the total extension of the multi-geometry
+	TeBox getBox();
+
+	//! Get the total extension of the multi-geometry
+	TeBox box()
+	{ return this->getBox(); } 
+};
+
+#endif 
diff --git a/src/terralib/kernel/TeMutex.cpp b/src/terralib/kernel/TeMutex.cpp
old mode 100755
new mode 100644
index 06b54c9..925343b
--- a/src/terralib/kernel/TeMutex.cpp
+++ b/src/terralib/kernel/TeMutex.cpp
@@ -1,59 +1,59 @@
-#include "TeMutex.h"
-
-#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-
-  #include  <stdio.h>
-
-#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-    
-#else
-    #error "Unsuported plataform"
-#endif   
-
-TeMutex::TeMutex()
-{
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  
-    m_sa_.nLength = sizeof( m_sa_ );
-    m_sa_.lpSecurityDescriptor = NULL;
-    m_sa_.bInheritHandle = TRUE;
-
-    m_access_ = ::CreateMutex( &m_sa_, false, 0 );
-
-    TEAGN_TRUE_OR_THROW( ( m_access_ != 0 ),
-      "Unable to create mutex object instance" )
-  
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-  
-    pthread_mutexattr_t access_attr;
-    TEAGN_TRUE_OR_THROW( ( pthread_mutexattr_init( &access_attr ) == 0 ),
-      "Unable to init mutex attributes" );
-
-    pthread_mutexattr_settype( &access_attr, PTHREAD_MUTEX_DEFAULT );
-    TEAGN_TRUE_OR_THROW( 
-      ( pthread_mutex_init( &m_access_, &access_attr ) == 0 ),
-      "Unable to init mutex" )
-  
-  #else
-    #error "Unsuported plataform"
-  #endif   
-}
-
-
-TeMutex::~TeMutex()
-{
-  unLock();
-  
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  
-    ::CloseHandle( m_access_ );
-  
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-  
-    pthread_mutex_destroy( &m_access_ );
-  
-  #else
-    #error "Unsuported plataform"
-  #endif   
-}
-
+#include "TeMutex.h"
+
+#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+
+  #include  <stdio.h>
+
+#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    
+#else
+    #error "Unsuported plataform"
+#endif   
+
+TeMutex::TeMutex()
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  
+    m_sa_.nLength = sizeof( m_sa_ );
+    m_sa_.lpSecurityDescriptor = NULL;
+    m_sa_.bInheritHandle = TRUE;
+
+    m_access_ = ::CreateMutex( &m_sa_, false, 0 );
+
+    TEAGN_TRUE_OR_THROW( ( m_access_ != 0 ),
+      "Unable to create mutex object instance" )
+  
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+  
+    pthread_mutexattr_t access_attr;
+    TEAGN_TRUE_OR_THROW( ( pthread_mutexattr_init( &access_attr ) == 0 ),
+      "Unable to init mutex attributes" );
+
+    pthread_mutexattr_settype( &access_attr, PTHREAD_MUTEX_DEFAULT );
+    TEAGN_TRUE_OR_THROW( 
+      ( pthread_mutex_init( &m_access_, &access_attr ) == 0 ),
+      "Unable to init mutex" )
+  
+  #else
+    #error "Unsuported plataform"
+  #endif   
+}
+
+
+TeMutex::~TeMutex()
+{
+  unLock();
+  
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  
+    ::CloseHandle( m_access_ );
+  
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+  
+    pthread_mutex_destroy( &m_access_ );
+  
+  #else
+    #error "Unsuported plataform"
+  #endif   
+}
+
diff --git a/src/terralib/kernel/TeMutex.h b/src/terralib/kernel/TeMutex.h
old mode 100755
new mode 100644
index b367c63..ab1b78c
--- a/src/terralib/kernel/TeMutex.h
+++ b/src/terralib/kernel/TeMutex.h
@@ -1,179 +1,180 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMutex.h
-  \brief This file contains definitions about a class to deal with critical 
-  region locking.
-*/
-
-
-#ifndef TEMUTEX_H
-  #define TEMUTEX_H
-  
-  #include "TeAgnostic.h"
-  #include "TeDefines.h"
-  
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    #include <windows.h>
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-    #include <pthread.h>
-    #include <errno.h>
-  #else
-    #error "ERROR: Unsupported platform"
-  #endif  
- 
-  /**
-   * @brief A class to deal with critical region locking.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   */
-  class TL_DLL TeMutex
-  {
-    public :
-    
-      /**
-       * @brief Default constructor.
-       */    
-      TeMutex();
-
-      /**
-       * @brief Default destructor.
-       */       
-      ~TeMutex();
-      
-      /**
-       * @brief Lock the current object instance.
-       * @note If section is already busy then the current thread will be 
-       * blocked until it's ready again.
-       */       
-      inline void lock()
-      {
-        #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-        
-          DWORD return_value = 0;
-          return_value = ::WaitForSingleObject( m_access_, INFINITE );
-          TEAGN_DEBUG_CONDITION( ( ( return_value == WAIT_ABANDONED ) ||
-            ( return_value == WAIT_OBJECT_0 ) ),
-            "Unable to get mutex lock" );
-        
-        #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-        
-          pthread_mutex_lock( &m_access_ );
-        
-        #else
-          #error "Unsuported plataform"
-        #endif  
-      };      
-      
-      /**
-       * @brief Try to lock the current object instance.
-       * @return true if OK, false if unable to lock.
-       * @note If section is busy, this method will return false 
-       * without blocking the current thread.
-       */       
-      inline bool tryLock()
-      {
-        #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-        
-          DWORD return_value = ::WaitForSingleObject( m_access_, 
-            10 );
-
-          if( ( return_value == WAIT_OBJECT_0 ) ||
-            ( return_value == WAIT_ABANDONED ) ) {
-
-            return true;
-          } else {
-            return false;
-          }
-        
-        #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-        
-          if( pthread_mutex_trylock( &m_access_ ) == EBUSY ) {
-            return false;
-          } else {
-            return true;
-          }
-        
-        #else
-          #error "Unsuported plataform"
-        #endif  
-      };      
-      
-      /**
-       * @brief Unlock the current object instance.
-       */       
-      inline void unLock()
-      {
-        #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-        
-          ::ReleaseMutex( m_access_ );
-        
-        #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-        
-          pthread_mutex_unlock( &m_access_ );
-        
-        #else
-          #error "Unsuported plataform"
-        #endif 
-      };      
-            
-    protected :
-   
-      #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    
-        /**
-        * @brief The mutex instance.
-        */      
-        HANDLE m_access_;
-        
-        /**
-        * @brief The mutex instance attributes.
-        */           
-        SECURITY_ATTRIBUTES m_sa_;
-      
-      #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-      
-        /**
-        * @brief The mutex instance.
-        */        
-        pthread_mutex_t m_access_;
-      
-      #else
-        #error "Unsuported plataform"
-      #endif   
-   
-    private :
-    
-      /**
-       * Alternative constructor.
-       */    
-      TeMutex(  const TeMutex& ) {};
-    
-   
-      /**
-       * operator= overload.
-       * @return A const reference to the current instance.
-       */      
-      const TeMutex& operator=( const TeMutex& ) { return *this; };
- 
-  };
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMutex.h
+  \brief This file contains definitions about a class to deal with critical 
+  region locking.
+*/
+
+
+#ifndef TEMUTEX_H
+  #define TEMUTEX_H
+  
+  #include "TeAgnostic.h"
+  #include "TeDefines.h"
+  
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    #include <windows.h>
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    #include <pthread.h>
+    #include <errno.h>
+  #else
+    #error "ERROR: Unsupported platform"
+  #endif  
+ 
+  /**
+   * @brief A class to deal with critical region locking.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup MultProgToolsGroup
+   */
+  class TL_DLL TeMutex
+  {
+    public :
+    
+      /**
+       * @brief Default constructor.
+       */    
+      TeMutex();
+
+      /**
+       * @brief Default destructor.
+       */       
+      ~TeMutex();
+      
+      /**
+       * @brief Lock the current object instance.
+       * @note If section is already busy then the current thread will be 
+       * blocked until it's ready again.
+       */       
+      inline void lock()
+      {
+        #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+        
+          DWORD return_value = 0;
+          return_value = ::WaitForSingleObject( m_access_, INFINITE );
+          TEAGN_DEBUG_CONDITION( ( ( return_value == WAIT_ABANDONED ) ||
+            ( return_value == WAIT_OBJECT_0 ) ),
+            "Unable to get mutex lock" );
+        
+        #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+        
+          pthread_mutex_lock( &m_access_ );
+        
+        #else
+          #error "Unsuported plataform"
+        #endif  
+      };      
+      
+      /**
+       * @brief Try to lock the current object instance.
+       * @return true if OK, false if unable to lock.
+       * @note If section is busy, this method will return false 
+       * without blocking the current thread.
+       */       
+      inline bool tryLock()
+      {
+        #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+        
+          DWORD return_value = ::WaitForSingleObject( m_access_, 
+            10 );
+
+          if( ( return_value == WAIT_OBJECT_0 ) ||
+            ( return_value == WAIT_ABANDONED ) ) {
+
+            return true;
+          } else {
+            return false;
+          }
+        
+        #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+        
+          if( pthread_mutex_trylock( &m_access_ ) == EBUSY ) {
+            return false;
+          } else {
+            return true;
+          }
+        
+        #else
+          #error "Unsuported plataform"
+        #endif  
+      };      
+      
+      /**
+       * @brief Unlock the current object instance.
+       */       
+      inline void unLock()
+      {
+        #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+        
+          ::ReleaseMutex( m_access_ );
+        
+        #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+        
+          pthread_mutex_unlock( &m_access_ );
+        
+        #else
+          #error "Unsuported plataform"
+        #endif 
+      };      
+            
+    protected :
+   
+      #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    
+        /**
+        * @brief The mutex instance.
+        */      
+        HANDLE m_access_;
+        
+        /**
+        * @brief The mutex instance attributes.
+        */           
+        SECURITY_ATTRIBUTES m_sa_;
+      
+      #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+      
+        /**
+        * @brief The mutex instance.
+        */        
+        pthread_mutex_t m_access_;
+      
+      #else
+        #error "Unsuported plataform"
+      #endif   
+   
+    private :
+    
+      /**
+       * Alternative constructor.
+       */    
+      TeMutex(  const TeMutex& ) {};
+    
+   
+      /**
+       * operator= overload.
+       * @return A const reference to the current instance.
+       */      
+      const TeMutex& operator=( const TeMutex& ) { return *this; };
+ 
+  };
+
+#endif
diff --git a/src/terralib/kernel/TeNeighbours.cpp b/src/terralib/kernel/TeNeighbours.cpp
old mode 100755
new mode 100644
index 29cf63a..49b836e
--- a/src/terralib/kernel/TeNeighbours.cpp
+++ b/src/terralib/kernel/TeNeighbours.cpp
@@ -1,221 +1,221 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeNeighbours.h"
-
-TeProxMatrixAttributes::TeProxMatrixAttributes() 
-{
-	_weight = 1;					//default
-	_slice	= 1;					//default
-	_order  = 1;					//defaul
-	_centroid_distance	= -1.0;		//not computed
-	_borders_length		= -1.0;		//not computed
-	_net_objects_distance		= -1.0;   //not computed
-	_net_minimum_path= -1.0;		//not computed
-}  
-
-
-TeProxMatrixAttributes::TeProxMatrixAttributes (const TeProxMatrixAttributes& att) 
-{		
-	_weight = att._weight;
-	_slice = att._slice; 
-	_order = att._order; 
-	_centroid_distance = att._centroid_distance;
-	_borders_length = att._borders_length; 
-	_net_objects_distance = att._net_objects_distance;
-	_net_minimum_path = att._net_minimum_path;
-}
-
-
-TePropertyVector 
-TeProxMatrixAttributes::getProperties ()
-{
-	TePropertyVector vec;
-	TeProperty prop1; prop1.value_ = Te2String (_weight); vec.push_back ( prop1 );
-	TeProperty prop2; prop2.value_ = Te2String (_slice); vec.push_back ( prop2 );
-	TeProperty prop3; prop3.value_ = Te2String (_order); vec.push_back ( prop3 );
-	TeProperty prop4; prop4.value_ = Te2String (_borders_length); vec.push_back ( prop4 );
-	TeProperty prop5; prop5.value_ = Te2String (_centroid_distance); vec.push_back ( prop5 );	
-	TeProperty prop6; prop6.value_ = Te2String (_net_objects_distance); vec.push_back ( prop6 );	
-	TeProperty prop7; prop7.value_ = Te2String (_net_minimum_path); vec.push_back ( prop7 );
-	return vec; 
-}
-
-
-TeProxMatrixAttributes& 
-TeProxMatrixAttributes::operator= (const TeProxMatrixAttributes& att)
-{		
-	_weight = att._weight;
-	_slice = att._slice; 
-	_order = att._order; 
-	_centroid_distance = att._centroid_distance;
-	_borders_length = att._borders_length; 
-	_net_objects_distance = att._net_objects_distance;
-	_net_minimum_path = att._net_minimum_path;
-	return *this;
-}
-
-
-
-bool 
-TeProxMatrixAttributes::operator==(const TeProxMatrixAttributes& att) const
-{
-	return ((_weight == att._weight) && 
-		(_slice == att._slice) && 
-		(_order == att._order) && 
-		(_centroid_distance == att._centroid_distance) && 
-		(_borders_length == att._borders_length) &&  
-		(_net_objects_distance == att._net_objects_distance) && 
-		(_net_minimum_path == att._net_minimum_path));
-}
-
-
-TeNeighbours::TeNeighbours(const TeNeighboursMap& neigh)  
-{
-
-	TeNeighboursMap::const_iterator pos = neigh.begin(); 
-
-	for (pos = neigh.begin(); pos != neigh.end(); ++pos)
-		_neigh.push_back(make_pair (pos->first, pos->second));
-}
-
-
-
-TeNeighbours::TeNeighbours (const TeNeighbours& neigh)
-{
-	const_iterator it;
-	for (it = neigh._neigh.begin(); it != neigh._neigh.end(); ++it) 
-		_neigh.push_back(*it);
-}
-
-		
-string
-TeNeighbours::ObjectId (int n) 
-{
-	if (n < (int)_neigh.size()) 
-		return _neigh[n].first;
-
-	else {
-		string empty;
-		return empty;
-	}
-}
-
-
-string 
-TeNeighbours:: operator[](int n)
-{
-	if (n < (int)_neigh.size()) 
-		return _neigh[n].first;
-
-	else {
-		string empty;
-		return empty;
-	}
-}
-
-double 
-TeNeighbours:: Weight (int n)
-{
-	if (n < (int)_neigh.size()) 
-		return _neigh[n].second.Weight();
-
-	else
-		return 0.0;
-}		
-
-	
-double 
-TeNeighbours:: Weight (const string& object_id)
-{
-	for (unsigned int i = 0; i< _neigh.size(); ++i) {
-		if (object_id == _neigh[i].first) 
-			return _neigh[i].second.Weight();
-	}
-	return 0.0;
-}		
-
-	
-TeProxMatrixAttributes 
-TeNeighbours:: Attributes (int n)
-{
-	TeProxMatrixAttributes attr;
-
-	if (n < (int)_neigh.size()) 
-		return _neigh[n].second;
-	else
-		return attr;
-}
-	
-bool
-TeNeighbours:: operator== (const TeNeighbours& neigh)
-{
-	if (_neigh == neigh._neigh) return true;
-	else return false;
-}
-
-
-TeNeighbours& 
-TeNeighbours::operator= (const TeNeighbours& neigh)
-{
-	if (*this == neigh)
-	    return *this;
-
-	_neigh.clear();
-
-	const_iterator it;
-	for (it = neigh._neigh.begin(); it != neigh._neigh.end(); ++it) 
-		_neigh.push_back(*it);
- 
-    return *this; 
-}
-
-
-bool
-TeNeighbours:: Insert (const string& object_id, const TeProxMatrixAttributes& attr)
-{
-	for (unsigned int i = 0; i< _neigh.size(); i++) {
-		if (object_id == _neigh[i].first) 
-			return false;
-	}
-	_neigh.push_back (make_pair (object_id, attr));
-	return true;
-}
-
-
-bool 
-TeNeighbours:: Remove (const string& object_id)
-{
-	iterator it = _neigh.begin();
-	while (it!= _neigh.end()) 
-		if (object_id == (*it).first)
-		{
-			_neigh.erase (it);
-			return true;
-		}
-	return false;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeNeighbours.h"
+
+TeProxMatrixAttributes::TeProxMatrixAttributes() 
+{
+	_weight = 1;					//default
+	_slice	= 1;					//default
+	_order  = 1;					//defaul
+	_centroid_distance	= -1.0;		//not computed
+	_borders_length		= -1.0;		//not computed
+	_net_objects_distance		= -1.0;   //not computed
+	_net_minimum_path= -1.0;		//not computed
+}  
+
+
+TeProxMatrixAttributes::TeProxMatrixAttributes (const TeProxMatrixAttributes& att) 
+{		
+	_weight = att._weight;
+	_slice = att._slice; 
+	_order = att._order; 
+	_centroid_distance = att._centroid_distance;
+	_borders_length = att._borders_length; 
+	_net_objects_distance = att._net_objects_distance;
+	_net_minimum_path = att._net_minimum_path;
+}
+
+
+TePropertyVector 
+TeProxMatrixAttributes::getProperties ()
+{
+	TePropertyVector vec;
+	TeProperty prop1; prop1.value_ = Te2String (_weight); vec.push_back ( prop1 );
+	TeProperty prop2; prop2.value_ = Te2String (_slice); vec.push_back ( prop2 );
+	TeProperty prop3; prop3.value_ = Te2String (_order); vec.push_back ( prop3 );
+	TeProperty prop4; prop4.value_ = Te2String (_borders_length); vec.push_back ( prop4 );
+	TeProperty prop5; prop5.value_ = Te2String (_centroid_distance); vec.push_back ( prop5 );	
+	TeProperty prop6; prop6.value_ = Te2String (_net_objects_distance); vec.push_back ( prop6 );	
+	TeProperty prop7; prop7.value_ = Te2String (_net_minimum_path); vec.push_back ( prop7 );
+	return vec; 
+}
+
+
+TeProxMatrixAttributes& 
+TeProxMatrixAttributes::operator= (const TeProxMatrixAttributes& att)
+{		
+	_weight = att._weight;
+	_slice = att._slice; 
+	_order = att._order; 
+	_centroid_distance = att._centroid_distance;
+	_borders_length = att._borders_length; 
+	_net_objects_distance = att._net_objects_distance;
+	_net_minimum_path = att._net_minimum_path;
+	return *this;
+}
+
+
+
+bool 
+TeProxMatrixAttributes::operator==(const TeProxMatrixAttributes& att) const
+{
+	return ((_weight == att._weight) && 
+		(_slice == att._slice) && 
+		(_order == att._order) && 
+		(_centroid_distance == att._centroid_distance) && 
+		(_borders_length == att._borders_length) &&  
+		(_net_objects_distance == att._net_objects_distance) && 
+		(_net_minimum_path == att._net_minimum_path));
+}
+
+
+TeNeighbours::TeNeighbours(const TeNeighboursMap& neigh)  
+{
+
+	TeNeighboursMap::const_iterator pos = neigh.begin(); 
+
+	for (pos = neigh.begin(); pos != neigh.end(); ++pos)
+		_neigh.push_back(make_pair (pos->first, pos->second));
+}
+
+
+
+TeNeighbours::TeNeighbours (const TeNeighbours& neigh)
+{
+	const_iterator it;
+	for (it = neigh._neigh.begin(); it != neigh._neigh.end(); ++it) 
+		_neigh.push_back(*it);
+}
+
+		
+string
+TeNeighbours::ObjectId (int n) 
+{
+	if (n < (int)_neigh.size()) 
+		return _neigh[n].first;
+
+	else {
+		string empty;
+		return empty;
+	}
+}
+
+
+string 
+TeNeighbours:: operator[](int n)
+{
+	if (n < (int)_neigh.size()) 
+		return _neigh[n].first;
+
+	else {
+		string empty;
+		return empty;
+	}
+}
+
+double 
+TeNeighbours:: Weight (int n)
+{
+	if (n < (int)_neigh.size()) 
+		return _neigh[n].second.Weight();
+
+	else
+		return 0.0;
+}		
+
+	
+double 
+TeNeighbours:: Weight (const string& object_id)
+{
+	for (unsigned int i = 0; i< _neigh.size(); ++i) {
+		if (object_id == _neigh[i].first) 
+			return _neigh[i].second.Weight();
+	}
+	return 0.0;
+}		
+
+	
+TeProxMatrixAttributes 
+TeNeighbours:: Attributes (int n)
+{
+	TeProxMatrixAttributes attr;
+
+	if (n < (int)_neigh.size()) 
+		return _neigh[n].second;
+	else
+		return attr;
+}
+	
+bool
+TeNeighbours:: operator== (const TeNeighbours& neigh)
+{
+	if (_neigh == neigh._neigh) return true;
+	else return false;
+}
+
+
+TeNeighbours& 
+TeNeighbours::operator= (const TeNeighbours& neigh)
+{
+	if (*this == neigh)
+	    return *this;
+
+	_neigh.clear();
+
+	const_iterator it;
+	for (it = neigh._neigh.begin(); it != neigh._neigh.end(); ++it) 
+		_neigh.push_back(*it);
+ 
+    return *this; 
+}
+
+
+bool
+TeNeighbours:: Insert (const string& object_id, const TeProxMatrixAttributes& attr)
+{
+	for (unsigned int i = 0; i< _neigh.size(); i++) {
+		if (object_id == _neigh[i].first) 
+			return false;
+	}
+	_neigh.push_back (make_pair (object_id, attr));
+	return true;
+}
+
+
+bool 
+TeNeighbours:: Remove (const string& object_id)
+{
+	iterator it = _neigh.begin();
+	while (it!= _neigh.end()) 
+		if (object_id == (*it).first)
+		{
+			_neigh.erase (it);
+			return true;
+		}
+	return false;
+}
diff --git a/src/terralib/kernel/TeNeighbours.h b/src/terralib/kernel/TeNeighbours.h
old mode 100755
new mode 100644
index 0f52c25..9d22dbc
--- a/src/terralib/kernel/TeNeighbours.h
+++ b/src/terralib/kernel/TeNeighbours.h
@@ -1,207 +1,207 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeNeighbours.h
-    \brief This file contains structures and definitions about neighborhood 
-*/
-
-#ifndef  __TERRALIB_INTERNAL_NEGHBOURS_H
-#define  __TERRALIB_INTERNAL_NEGHBOURS_H
-
-#include "TeUtils.h"
-#include "TeAttribute.h"
-
-#include <vector> 
-#include <string>
-#include <map> 
-using namespace std;
-
-
-//! Attributes associated with each neighborhood of a proximity matrix  
-class TL_DLL TeProxMatrixAttributes  
-{
-	private:
-		double	_weight;
-		int		_slice;
-		int		_order;
-		double	_centroid_distance;
-		double	_borders_length;
-		double	_net_objects_distance;
-		double	_net_minimum_path;
-
-
-	public:
-		
-		//! Empty constructor 
-		TeProxMatrixAttributes(); 
-
-		//! Constructor 
-		TeProxMatrixAttributes(const double& w, const int& slice, const int& order, 
-			const double& cent_dist, const double& border_length, 
-			const double& net_distance, const double& net_minimun_path): 
-				_weight(w), _slice(slice), 
-				_order(order), _centroid_distance(cent_dist), 
-                _borders_length(border_length), 
-                _net_objects_distance(net_distance), 
-                _net_minimum_path(net_minimun_path)
-		{}
-		
-		//! Copy constuctor 
-		TeProxMatrixAttributes (const TeProxMatrixAttributes& att); 
-		
-		//! Return weight
-		double	Weight() {return _weight;}
-
-		//! Return slice
-		int		Slice () {return _slice;}
-
-		//! Return order
-		int		Order() {return _order;}
-
-		//! Return border length
-		double	BorderLength() {return _borders_length;}
-
-		//! Return centroid distance
-		double	CentroidDistance() {return _centroid_distance;}
-
-		//! Return network objects distance
-		double	NetworkObjectsDistance() {return _net_objects_distance;}
-
-		//! Return network minimum path
-		double	NetworkMinimumPath () {return _net_minimum_path;}
-
-		//! Set weight
-		void Weight(double w) {_weight = w;}
-
-		//! Set slice
-		void Slice (int s) {_slice = s;}
-		
-		//! Set order
-		void Order(int o) {_order = o;}
-
-		//! Set border length
-		void BorderLength(double l) {_borders_length = l;}
-
-		//! Set centroid distance
-		void CentroidDistance(double d) {_centroid_distance = d;}
-
-		//! Set network objects distance
-		void NetworkObjectsDistance(double d) {_net_objects_distance = d;}
-
-		//! Set network minimum path
-		void NetworkMinimumPath (double d) {_net_minimum_path = d;}
-
-		//! Return the attributes as a TePropertyVector
-		TePropertyVector getProperties ();
-
-		//! Return if the border length was computed 
-		bool WasBordersLengthComputed () {if (_borders_length == -1.0) return false; else return true;}
-		
-		//! Return if the centroid distance was computed
-		bool WasCentroidDistanceComputed () {if (_centroid_distance == -1.0) return false; else return true;}
-		
-		//! Return if the network objects distance was computed
-		bool WasNetworkObjectsDistanceComputed () {if (_net_objects_distance == -1.0) return false; else return true;}
-		
-		//! Return if the network minimal path was computed
-		bool WasNetworkMinimumPathComputed () {if (_net_minimum_path == -1.0) return false; else return true;}
-
-		//! Copy operator
-		TeProxMatrixAttributes& operator= (const TeProxMatrixAttributes& att); 
-		
-		//! Comparison Operator
-		bool operator==(const TeProxMatrixAttributes& att) const;
-			
-		//! Destructor
-		virtual ~TeProxMatrixAttributes() {}
-};
-
-//! A map from a object to its attributes
-typedef map<string, TeProxMatrixAttributes> TeNeighboursMap;
-
-
-//! A class to representate the neighbours of a object 
-class TL_DLL TeNeighbours  
-{
-private:
-	typedef pair<string, TeProxMatrixAttributes>	neigh_values;
-	typedef vector<neigh_values>					neigh_vector;
-
-	neigh_vector _neigh; 
-	
-
-public:
-
-	typedef neigh_vector::iterator iterator;
-	typedef neigh_vector::const_iterator const_iterator;
-
-	//! Empty constructor
-	TeNeighbours () {};
-
-	//! Copy constructor
-	TeNeighbours(const TeNeighboursMap& neigh);
-
-	//! Copy constructor
-	TeNeighbours(const TeNeighbours& neigh);
-	
-	//! Return the number of the neighbours
-	int size() const  { return _neigh.size();}
-
-	//! Return a iterator to the begin of the neighbours
-    iterator begin()     { return _neigh.begin();}
-
-	//! Return a iterator to the one past end of the neighbours
-    iterator end()       { return _neigh.end();}
-
-	//! Return the n-th neighbour object_id, if n < map size.
-	string ObjectId (int n);  
-
-	//! Return the n-th neighbour object_id, if n < map size.
-	string operator[](int n);  
-
-	//! Return the n-th connection weight (corresponding to the n-th neighbour), if n < map size.
-	double Weight (int n);		
-
-	//! Return the connection weight, given the neighbour object_id 
-	double Weight (const string& object_id);	
-	
-	//! Return the complete set of connection attributes (corresponding to the ith neighbour), packed in a TeProxMatrixAttributes object.
-	TeProxMatrixAttributes Attributes (int n);
-	
-	//! Insert a new neighbour
-	bool Insert (const string& object_id, const TeProxMatrixAttributes& attr);
-
-	//! Remove a neighbour
-	bool Remove (const string& object_id);
-
-	//! Copy operator
-	TeNeighbours& operator= (const TeNeighbours& neigh);
-
-	//! Comparison Operator
-	bool operator==(const TeNeighbours& p);
-
-	//! Destructor
-	virtual ~TeNeighbours() {}
-
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeNeighbours.h
+    \brief This file contains structures and definitions about neighborhood 
+*/
+
+#ifndef  __TERRALIB_INTERNAL_NEGHBOURS_H
+#define  __TERRALIB_INTERNAL_NEGHBOURS_H
+
+#include "TeUtils.h"
+#include "TeAttribute.h"
+
+#include <vector> 
+#include <string>
+#include <map> 
+using namespace std;
+
+
+//! Attributes associated with each neighborhood of a proximity matrix  
+class TL_DLL TeProxMatrixAttributes  
+{
+	private:
+		double	_weight;
+		int		_slice;
+		int		_order;
+		double	_centroid_distance;
+		double	_borders_length;
+		double	_net_objects_distance;
+		double	_net_minimum_path;
+
+
+	public:
+		
+		//! Empty constructor 
+		TeProxMatrixAttributes(); 
+
+		//! Constructor 
+		TeProxMatrixAttributes(const double& w, const int& slice, const int& order, 
+			const double& cent_dist, const double& border_length, 
+			const double& net_distance, const double& net_minimun_path): 
+				_weight(w), _slice(slice), 
+				_order(order), _centroid_distance(cent_dist), 
+                _borders_length(border_length), 
+                _net_objects_distance(net_distance), 
+                _net_minimum_path(net_minimun_path)
+		{}
+		
+		//! Copy constuctor 
+		TeProxMatrixAttributes (const TeProxMatrixAttributes& att); 
+		
+		//! Return weight
+		double	Weight() {return _weight;}
+
+		//! Return slice
+		int		Slice () {return _slice;}
+
+		//! Return order
+		int		Order() {return _order;}
+
+		//! Return border length
+		double	BorderLength() {return _borders_length;}
+
+		//! Return centroid distance
+		double	CentroidDistance() {return _centroid_distance;}
+
+		//! Return network objects distance
+		double	NetworkObjectsDistance() {return _net_objects_distance;}
+
+		//! Return network minimum path
+		double	NetworkMinimumPath () {return _net_minimum_path;}
+
+		//! Set weight
+		void Weight(double w) {_weight = w;}
+
+		//! Set slice
+		void Slice (int s) {_slice = s;}
+		
+		//! Set order
+		void Order(int o) {_order = o;}
+
+		//! Set border length
+		void BorderLength(double l) {_borders_length = l;}
+
+		//! Set centroid distance
+		void CentroidDistance(double d) {_centroid_distance = d;}
+
+		//! Set network objects distance
+		void NetworkObjectsDistance(double d) {_net_objects_distance = d;}
+
+		//! Set network minimum path
+		void NetworkMinimumPath (double d) {_net_minimum_path = d;}
+
+		//! Return the attributes as a TePropertyVector
+		TePropertyVector getProperties ();
+
+		//! Return if the border length was computed 
+		bool WasBordersLengthComputed () {if (_borders_length == -1.0) return false; else return true;}
+		
+		//! Return if the centroid distance was computed
+		bool WasCentroidDistanceComputed () {if (_centroid_distance == -1.0) return false; else return true;}
+		
+		//! Return if the network objects distance was computed
+		bool WasNetworkObjectsDistanceComputed () {if (_net_objects_distance == -1.0) return false; else return true;}
+		
+		//! Return if the network minimal path was computed
+		bool WasNetworkMinimumPathComputed () {if (_net_minimum_path == -1.0) return false; else return true;}
+
+		//! Copy operator
+		TeProxMatrixAttributes& operator= (const TeProxMatrixAttributes& att); 
+		
+		//! Comparison Operator
+		bool operator==(const TeProxMatrixAttributes& att) const;
+			
+		//! Destructor
+		virtual ~TeProxMatrixAttributes() {}
+};
+
+//! A map from a object to its attributes
+typedef map<string, TeProxMatrixAttributes> TeNeighboursMap;
+
+
+//! A class to representate the neighbours of a object 
+class TL_DLL TeNeighbours  
+{
+private:
+	typedef pair<string, TeProxMatrixAttributes>	neigh_values;
+	typedef vector<neigh_values>					neigh_vector;
+
+	neigh_vector _neigh; 
+	
+
+public:
+
+	typedef neigh_vector::iterator iterator;
+	typedef neigh_vector::const_iterator const_iterator;
+
+	//! Empty constructor
+	TeNeighbours () {};
+
+	//! Copy constructor
+	TeNeighbours(const TeNeighboursMap& neigh);
+
+	//! Copy constructor
+	TeNeighbours(const TeNeighbours& neigh);
+	
+	//! Return the number of the neighbours
+	int size() const  { return _neigh.size();}
+
+	//! Return a iterator to the begin of the neighbours
+    iterator begin()     { return _neigh.begin();}
+
+	//! Return a iterator to the one past end of the neighbours
+    iterator end()       { return _neigh.end();}
+
+	//! Return the n-th neighbour object_id, if n < map size.
+	string ObjectId (int n);  
+
+	//! Return the n-th neighbour object_id, if n < map size.
+	string operator[](int n);  
+
+	//! Return the n-th connection weight (corresponding to the n-th neighbour), if n < map size.
+	double Weight (int n);		
+
+	//! Return the connection weight, given the neighbour object_id 
+	double Weight (const string& object_id);	
+	
+	//! Return the complete set of connection attributes (corresponding to the ith neighbour), packed in a TeProxMatrixAttributes object.
+	TeProxMatrixAttributes Attributes (int n);
+	
+	//! Insert a new neighbour
+	bool Insert (const string& object_id, const TeProxMatrixAttributes& attr);
+
+	//! Remove a neighbour
+	bool Remove (const string& object_id);
+
+	//! Copy operator
+	TeNeighbours& operator= (const TeNeighbours& neigh);
+
+	//! Comparison Operator
+	bool operator==(const TeNeighbours& p);
+
+	//! Destructor
+	virtual ~TeNeighbours() {}
+
+};
+
+#endif
diff --git a/src/terralib/kernel/TeNetwork.cpp b/src/terralib/kernel/TeNetwork.cpp
old mode 100755
new mode 100644
index 272174e..37862e0
--- a/src/terralib/kernel/TeNetwork.cpp
+++ b/src/terralib/kernel/TeNetwork.cpp
@@ -1,578 +1,578 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeNetwork.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeSTElementSet.h"
-#include "Gra_algo.h"
-
-
-
-TeGraphNetwork:: TeGraphNetwork (TeLineSet& ls)  : graph_ (false)
-{
-	TeLineSet ls2;
-  	ls2.copyElements(ls);
-
-// The initial and final points of each line will be the nodes
-	TeLineSet::iterator it = ls2.begin();
-	while (it != ls2.end())
-	{
-			insertLine  ((*it), TeLength(*it));
-			it++;
-	}
-}
-
-
-TeGraphNetwork:: TeGraphNetwork (TeLineSet& ls, map<string, double>& line_costs)  : graph_ (false)
-{
-	if (ls.size() == line_costs.size())
-	{
-		TeLineSet::iterator it_line = ls.begin();
-		
-		while (it_line != ls.end())
-		{
-			string id = (*it_line).objectId ();
-			map<string, double>:: iterator it_val = line_costs.find(id);
-			if (it_val != line_costs.end())
-				insertLine  ((*it_line), (*it_val).second); 
-			it_line++;
-		}
-	}
-
-}
-
-
-bool
-TeGraphNetwork:: Add (TeLineSet& ls, map<string, double>& line_costs) 
-{
-	if (ls.size() == line_costs.size())
-	{
-		TeLineSet::iterator it_line = ls.begin();
-		
-		while (it_line != ls.end())
-		{
-			string id = (*it_line).objectId ();
-			map<string, double>:: iterator it_val = line_costs.find(id);
-			if (it_val != line_costs.end())
-				insertLine  ((*it_line), (*it_val).second); 
-			it_line++;
-		}
-		return true;
-	}
-	else
-		return false;
-
-}
-
-
-TeGraphNetwork:: TeGraphNetwork (TeSTElementSet& stos, string& attrName)  : graph_ (false)
-{
-	TeSTElementSet::iterator it = stos.begin();
-	while (it != stos.end())
-	{
-		string value;
-		if ((*it).getPropertyValue (attrName, value))
-		{
-			double val = atof(value.c_str());	
-			TeLineSet objGeom;  
-			if ((*it).getGeometry(objGeom))
-			{
-				double total_length = 0.0;
-				TeLineSet::iterator it_geom = objGeom.begin();
-				while (it_geom != objGeom.end())
-				{
-					total_length += TeLength (*it_geom);
-					it_geom++;
-				}
-
-				it_geom = objGeom.begin();
-				while (it_geom != objGeom.end())
-				{
-					double w = TeLength(*it_geom)/total_length;
-					insertLine  (*it_geom, val*w);
-					it_geom++;
-				}	
-			}
-		}
-		++it;
-	}
-}	
-
-
-void
-TeGraphNetwork:: insertLine (TeLine2D& line, const double& attr) 
-{
-
-	// Change line identifiers, to allow lines from different layers
-	int j = line_set_.size(); 
-	string line_objId = "l" + Te2String (j);
-	line.objectId (line_objId); 
-
-
-	// The initial and final nodes will be the first and last points of the line
-	TeNode n1; 
-	n1.add(line.first());
-	string id1 = line.objectId() + "_p1"; 
-	n1.objectId (id1);
-	n1.geomId (0);
-
-	TeNode n2; 
-	n2.add(line.last());	
-	string id2 = line.objectId() + "_p2";
-
-	n2.objectId (id2);
-	n2.geomId (0);
-
-	for (unsigned int i = 0; i < graph_.size(); i++)
-	{
-		if (TeDistance (line.first(), graph_[i].first.location()) < 0.001)
-			n1 = graph_[i].first;
-			
-		if (TeDistance (line.last(), graph_[i].first.location()) < 0.001)
-			n2 = graph_[i].first;
-	}
-
-	if (n1 == n2)
-	{
-		cout << "linha circular" << endl;
-	}
-	else
-	{
-		graph_.insert (n1, n2, attr); // if graph is non-directed, edge from n2 to n1 will also be added
-		line_cost_ [line.objectId()] = attr;
-		line_set_.add (line);
-	}
-
-}
-
-
-
-bool 
-TeGraphNetwork:: minimumPath (TeNode& n1, TeNodeSet& nodeSet,vector<double>& result)
-{
-	vector<double> dist;
-	vector<int> pred;
-
-	// Compute minimum path to all vertex
-	unsigned int j = 0;
-	br_stl::Graph<TeNode, double>::iterator it = graph_.begin();
-	while (it != graph_.end())
-	{
-	   if ((*it).first == n1)  
-		    it = graph_.end();
-	   else
-	   {
-		   it++;
-		   j++;
-	   }
-	}
-	if (j == graph_.size()) return false;
-
-	br_stl::Dijkstra<br_stl::Graph<TeNode, double>, double> (graph_, dist, pred, j);
-
-	for (unsigned int i = 0; i< nodeSet.size(); i++)
-	{
-		br_stl::Graph<TeNode, double>::iterator it = graph_.begin();
-		unsigned int vertex = 0;
-		while (it != graph_.end())
-		{
-			if ((*it).first == nodeSet[i])  
-				it = graph_.end();
-			else
-			{  
-				it++;
-				vertex++;
-			}
-		}
-
-		if (vertex == graph_.size()) return false;
-		result.push_back (dist[vertex]);
-	}
-
-
-	return true;
-
-}
-
-bool 
-TeGraphNetwork::getNode (int i, TeNode& node)
-{ 
-	if ((i >0) && (i < (int) graph_.size())) 
-	{
-		node = graph_[i].first;
-		return true;
-	}
-	else 
-		return false;
-}
-
-bool
-TeGraphNetwork:: nearestNodePoint (TeCoord2D& p1, int& index, TeCoord2D& p2, double& distance, double tol)
-{
-		TeNodeSet node_set;
-		for (unsigned int i = 0; i < graph_.size(); i++) 
-			node_set.add (graph_[i].first);
-
-		if (node_set.size() == 0) return false;
-
-		TeNearest (p1, node_set, index, tol);
-		p2 = node_set[index].elem();
-		distance = TeDistance (p1, p2);
-		return true;
-}
-
-
-
-
-
-bool
-TeGraphNetwork:: breakLineSet (TeNode& node, int line)
-{
-
-	if ((line >= 0) && (line < (int) line_set_.size()))
-	{
-		// Break line
-		int segment;
-		if (TeLocateLineSegment (node.location(), line_set_[line], segment, 0.001))
-		{
-			if (segment <= (int) (line_set_[line].size()) - 2)
-			{
-				TeLine2D l1, l2;
-				int j = 0;
-				TeLine2D::iterator it = line_set_[line].begin();
-
-				while (j <= segment)
-				{
-					l1.add (*it);
-					it++;
-					j++;
-				}
-
-				l1.add (node.location());
-				l2.add (node.location ());
-
-				while (it != line_set_[line].end())
-				{
-					l2.add (*it);
-					it++;
-				}
-		
-				string old_line_id = line_set_[line].objectId();
-				string line1_id = old_line_id + "l1";
-				string line2_id = old_line_id + "l2";
-
-				l1.objectId(line1_id);
-				l2.objectId(line2_id);
-		
-			    // Compute proportional costs for broken lines
-
-				double d1   = TeLength (l1);
-				double d2   = TeLength (l2);
-				double d_tot = TeLength (line_set_[line]);
-
-				double w1 = d1/d_tot;
-				double w2 = d2/d_tot;
-
-				double val1 = w1*line_cost_[old_line_id];
-				double val2 = w2*line_cost_[old_line_id];
-
-				// update line cost
-
-				line_cost_[line1_id] = val1;
-				line_cost_[line2_id] = val2;
-				line_cost_.erase (old_line_id);
-
-     			// update line set
-
-				line_set_.add (l1);
-				line_set_.add (l2);
-				line_set_.erase (line);
-			
-				return true;
-				}
-			else return false;
-			}
-		else return false;
-		}
-	else return false;
-}
-
-
-
-
-bool
-TeGraphNetwork:: nearestNetworkPoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol)
-{
-		if (line_set_.size() == 0) return false;
-		return TeNearest (p1, line_set_, lindex, pinter, distance, tol);
-
-		bool TeNearest(TeCoord2D& pt, TeLineSet& ls , int& i, TeCoord2D& pi, const double& tol = 0.0);
-
-}
-
-
-///////////////////////////////////// Old version - not modified
-
-TeNetwork:: TeNetwork (TeLineSet& ls)  : graph_ (false)
-{
-	line_set_ = ls;
-
-
-	// The initial and final points of each line will be the nodes
-	TeLineSet::iterator it = ls.begin();
-	int j = 0;
-	while (it != line_set_.end())
-	{
-		string line_objId = "l" + Te2String (j);
-		(*it).objectId (line_objId); //ANAP: modified to be able to use more than on layer.
-		TeLine2D line = (*it);
-
-		TeNode n1; 
-		n1.add(line.first());
-		string id1 = line.objectId() + "_p1"; 
-		n1.objectId (id1);
-		n1.geomId (0);
-
-		TeNode n2; 
-		n2.add(line.last());	
-		string id2 = line.objectId() + "_p2";
-		n2.objectId (id2);
-		n2.geomId (0);
-
-		for (unsigned int i = 0; i < graph_.size(); i++)
-		{
-			if (TeDistance (line.first(), graph_[i].first.location()) < 0.01)
-				n1 = graph_[i].first;
-			
-			if (TeDistance (line.last(), graph_[i].first.location()) < 0.01)
-				n2 = graph_[i].first;
-		}
-
-		graph_.insert (n1, n2, TeLength(line));
-
-		TeArc arc (n1, n2);
-		// This is kept for updating purposes
-		arcs_map_[line.objectId()] = arc;
-		it++;
-		j++;
-	}
-}
-
-void
-TeNetwork:: insertLine (TeLine2D& line, const double& attr) 
-{
-
-	int j = line_set_.size();
-
-	// The initial and final points of each line will be the nodes
-	string line_objId = "l" + Te2String (j);
-	line.objectId (line_objId); //ANAP: modified to be able to use more than one layer.
-
-	TeNode n1; 
-	n1.add(line.first());
-	string id1 = line.objectId() + "_p1"; 
-	n1.objectId (id1);
-	n1.geomId (0);
-
-	TeNode n2; 
-	n2.add(line.last());	
-	string id2 = line.objectId() + "_p2";
-
-	n2.objectId (id2);
-	n2.geomId (0);
-
-	for (unsigned int i = 0; i < graph_.size(); i++)
-	{
-		if (TeDistance (line.first(), graph_[i].first.location()) < 0.01)
-			n1 = graph_[i].first;
-			
-		if (TeDistance (line.last(), graph_[i].first.location()) < 0.01)
-			n2 = graph_[i].first;
-	}
-
-	graph_.insert (n1, n2, attr);
-
-	TeArc arc (n1, n2);
-	// This is kept for updating purposes
-	arcs_map_[line.objectId()] = arc;
-	line_set_.add (line);
-
-}
-
-
-bool 
-TeNetwork:: insertNode (TeNode& node, int line)
-{
-	if ((line >= 0) && (line < (int) line_set_.size()))
-	{
-		// Break line
-		int segment;
-		if (TeLocateLineSegment (node.location(), line_set_[line], segment, 0.001))
-		{
-			if (segment <= (int) (line_set_[line].size()) - 2)
-			{
-				TeLine2D l1, l2;
-				int j = 0;
-				TeLine2D::iterator it = line_set_[line].begin();
-
-				while (j <= segment)
-				{
-					l1.add (*it);
-					it++;
-					j++;
-				}
-
-				l1.add (node.location());
-				l2.add (node.location ());
-
-				while (it != line_set_[line].end())
-				{
-					l2.add (*it);
-					it++;
-				}
-
-				// get new and old lines ids
-
-				string old_line_id = line_set_[line].objectId();
-				string line1_id = old_line_id + "l1";
-				string line2_id = old_line_id + "l2";
-
-				l1.objectId(line1_id);
-				l2.objectId(line2_id);
-		
-     			// update line set
-				line_set_.add (l1);
-				line_set_.add (l2);
-				line_set_.erase (line);
-	
-				// update map_nodes 
-				TeArc arc1 (arcs_map_[old_line_id].toNode(),  node);
-				arcs_map_[line1_id] = arc1;
-
-				TeArc arc2 (arcs_map_[old_line_id].fromNode(),node);
-				arcs_map_[line2_id] = arc2;
-				arcs_map_.erase(old_line_id);
-
-
-/*			// insert new arc connection in the network
-			graph_.insert (arcs_map_ [old_line_id].fromNode(),node, l1.length()); 
-			graph_.insert (arcs_map_ [old_line_id].toNode(),  node, l2.length()); 
-		//	graph_.remove (arcs_map_[old_line_id].fromNode(), _map_nodes[old_line_id].toNode()); 
-
-			
-*/
-				return true;
-				}
-			else return false;
-			}
-		else return false;
-		}
-	else return false;
-}
-
-
-bool 
-TeNetwork::getNode (int i, TeNode& node)
-{ 
-	if ((i >0) && (i < (int) graph_.size())) 
-	{
-		node = graph_[i].first;
-		return true;
-	}
-	else 
-		return false;
-}
-
-
-bool 
-TeNetwork:: minimumPath (TeNode& n1, TeNodeSet& nodeSet,vector<double>& result)
-{
-	vector<double> dist;
-	vector<int> pred;
-
-	// Compute minimum path to all vertex
-	unsigned int j = 0;
-	br_stl::Graph<TeNode, double>::iterator it = graph_.begin();
-	while (it != graph_.end())
-	{
-	   if ((*it).first == n1)  
-		    it = graph_.end();
-	   else
-	   {
-		   it++;
-		   j++;
-	   }
-	}
-	if (j == graph_.size()) return false;
-
-	br_stl::Dijkstra<br_stl::Graph<TeNode, double>, double> (graph_, dist, pred, j);
-
-	for (unsigned int i = 0; i< nodeSet.size(); i++)
-	{
-		br_stl::Graph<TeNode, double>::iterator it = graph_.begin();
-		unsigned int vertex = 0;
-		while (it != graph_.end())
-		{
-			if ((*it).first == nodeSet[i])  
-				it = graph_.end();
-			else
-			{  
-				it++;
-				vertex++;
-			}
-		}
-
-		if (vertex == graph_.size()) return false;
-		result.push_back (dist[vertex]);
-	}
-
-
-	return true;
-
-}
-
-
-bool
-TeNetwork:: nearestNodePoint (TeCoord2D& p1, int& index, TeCoord2D& p2, double& distance, double tol)
-{
-		TeNodeSet node_set;
-		for (unsigned int i = 0; i < graph_.size(); i++) 
-			node_set.add (graph_[i].first);
-
-		if (node_set.size() == 0) return false;
-
-		TeNearest (p1, node_set, index, tol);
-		p2 = node_set[index].elem();
-		distance = TeDistance (p1, p2);
-		return true;
-}
-
-bool
-TeNetwork:: nearestNetworkPoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol)
-{
-		if (line_set_.size() == 0) return false;
-		return TeNearest (p1, line_set_, lindex, pinter, distance, tol);
-
-		bool TeNearest(TeCoord2D& pt, TeLineSet& ls , int& i, TeCoord2D& pi, const double& tol = 0.0);
-
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeNetwork.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeSTElementSet.h"
+#include "Gra_algo.h"
+
+
+
+TeGraphNetwork:: TeGraphNetwork (TeLineSet& ls)  : graph_ (false)
+{
+	TeLineSet ls2;
+  	ls2.copyElements(ls);
+
+// The initial and final points of each line will be the nodes
+	TeLineSet::iterator it = ls2.begin();
+	while (it != ls2.end())
+	{
+			insertLine  ((*it), TeLength(*it));
+			it++;
+	}
+}
+
+
+TeGraphNetwork:: TeGraphNetwork (TeLineSet& ls, map<string, double>& line_costs)  : graph_ (false)
+{
+	if (ls.size() == line_costs.size())
+	{
+		TeLineSet::iterator it_line = ls.begin();
+		
+		while (it_line != ls.end())
+		{
+			string id = (*it_line).objectId ();
+			map<string, double>:: iterator it_val = line_costs.find(id);
+			if (it_val != line_costs.end())
+				insertLine  ((*it_line), (*it_val).second); 
+			it_line++;
+		}
+	}
+
+}
+
+
+bool
+TeGraphNetwork:: Add (TeLineSet& ls, map<string, double>& line_costs) 
+{
+	if (ls.size() == line_costs.size())
+	{
+		TeLineSet::iterator it_line = ls.begin();
+		
+		while (it_line != ls.end())
+		{
+			string id = (*it_line).objectId ();
+			map<string, double>:: iterator it_val = line_costs.find(id);
+			if (it_val != line_costs.end())
+				insertLine  ((*it_line), (*it_val).second); 
+			it_line++;
+		}
+		return true;
+	}
+	else
+		return false;
+
+}
+
+
+TeGraphNetwork:: TeGraphNetwork (TeSTElementSet& stos, string& attrName)  : graph_ (false)
+{
+	TeSTElementSet::iterator it = stos.begin();
+	while (it != stos.end())
+	{
+		string value;
+		if ((*it).getPropertyValue (attrName, value))
+		{
+			double val = atof(value.c_str());	
+			TeLineSet objGeom;  
+			if ((*it).getGeometry(objGeom))
+			{
+				double total_length = 0.0;
+				TeLineSet::iterator it_geom = objGeom.begin();
+				while (it_geom != objGeom.end())
+				{
+					total_length += TeLength (*it_geom);
+					it_geom++;
+				}
+
+				it_geom = objGeom.begin();
+				while (it_geom != objGeom.end())
+				{
+					double w = TeLength(*it_geom)/total_length;
+					insertLine  (*it_geom, val*w);
+					it_geom++;
+				}	
+			}
+		}
+		++it;
+	}
+}	
+
+
+void
+TeGraphNetwork:: insertLine (TeLine2D& line, const double& attr) 
+{
+
+	// Change line identifiers, to allow lines from different layers
+	int j = line_set_.size(); 
+	string line_objId = "l" + Te2String (j);
+	line.objectId (line_objId); 
+
+
+	// The initial and final nodes will be the first and last points of the line
+	TeNode n1; 
+	n1.add(line.first());
+	string id1 = line.objectId() + "_p1"; 
+	n1.objectId (id1);
+	n1.geomId (0);
+
+	TeNode n2; 
+	n2.add(line.last());	
+	string id2 = line.objectId() + "_p2";
+
+	n2.objectId (id2);
+	n2.geomId (0);
+
+	for (unsigned int i = 0; i < graph_.size(); i++)
+	{
+		if (TeDistance (line.first(), graph_[i].first.location()) < 0.001)
+			n1 = graph_[i].first;
+			
+		if (TeDistance (line.last(), graph_[i].first.location()) < 0.001)
+			n2 = graph_[i].first;
+	}
+
+	if (n1 == n2)
+	{
+		cout << "linha circular" << endl;
+	}
+	else
+	{
+		graph_.insert (n1, n2, attr); // if graph is non-directed, edge from n2 to n1 will also be added
+		line_cost_ [line.objectId()] = attr;
+		line_set_.add (line);
+	}
+
+}
+
+
+
+bool 
+TeGraphNetwork:: minimumPath (TeNode& n1, TeNodeSet& nodeSet,vector<double>& result)
+{
+	vector<double> dist;
+	vector<int> pred;
+
+	// Compute minimum path to all vertex
+	unsigned int j = 0;
+	br_stl::Graph<TeNode, double>::iterator it = graph_.begin();
+	while (it != graph_.end())
+	{
+	   if ((*it).first == n1)  
+		    it = graph_.end();
+	   else
+	   {
+		   it++;
+		   j++;
+	   }
+	}
+	if (j == graph_.size()) return false;
+
+	br_stl::Dijkstra<br_stl::Graph<TeNode, double>, double> (graph_, dist, pred, j);
+
+	for (unsigned int i = 0; i< nodeSet.size(); i++)
+	{
+		br_stl::Graph<TeNode, double>::iterator it = graph_.begin();
+		unsigned int vertex = 0;
+		while (it != graph_.end())
+		{
+			if ((*it).first == nodeSet[i])  
+				it = graph_.end();
+			else
+			{  
+				it++;
+				vertex++;
+			}
+		}
+
+		if (vertex == graph_.size()) return false;
+		result.push_back (dist[vertex]);
+	}
+
+
+	return true;
+
+}
+
+bool 
+TeGraphNetwork::getNode (int i, TeNode& node)
+{ 
+	if ((i >0) && (i < (int) graph_.size())) 
+	{
+		node = graph_[i].first;
+		return true;
+	}
+	else 
+		return false;
+}
+
+bool
+TeGraphNetwork:: nearestNodePoint (TeCoord2D& p1, int& index, TeCoord2D& p2, double& distance, double tol)
+{
+		TeNodeSet node_set;
+		for (unsigned int i = 0; i < graph_.size(); i++) 
+			node_set.add (graph_[i].first);
+
+		if (node_set.size() == 0) return false;
+
+		TeNearest (p1, node_set, index, tol);
+		p2 = node_set[index].elem();
+		distance = TeDistance (p1, p2);
+		return true;
+}
+
+
+
+
+
+bool
+TeGraphNetwork:: breakLineSet (TeNode& node, int line)
+{
+
+	if ((line >= 0) && (line < (int) line_set_.size()))
+	{
+		// Break line
+		int segment;
+		if (TeLocateLineSegment (node.location(), line_set_[line], segment, 0.001))
+		{
+			if (segment <= (int) (line_set_[line].size()) - 2)
+			{
+				TeLine2D l1, l2;
+				int j = 0;
+				TeLine2D::iterator it = line_set_[line].begin();
+
+				while (j <= segment)
+				{
+					l1.add (*it);
+					it++;
+					j++;
+				}
+
+				l1.add (node.location());
+				l2.add (node.location ());
+
+				while (it != line_set_[line].end())
+				{
+					l2.add (*it);
+					it++;
+				}
+		
+				string old_line_id = line_set_[line].objectId();
+				string line1_id = old_line_id + "l1";
+				string line2_id = old_line_id + "l2";
+
+				l1.objectId(line1_id);
+				l2.objectId(line2_id);
+		
+			    // Compute proportional costs for broken lines
+
+				double d1   = TeLength (l1);
+				double d2   = TeLength (l2);
+				double d_tot = TeLength (line_set_[line]);
+
+				double w1 = d1/d_tot;
+				double w2 = d2/d_tot;
+
+				double val1 = w1*line_cost_[old_line_id];
+				double val2 = w2*line_cost_[old_line_id];
+
+				// update line cost
+
+				line_cost_[line1_id] = val1;
+				line_cost_[line2_id] = val2;
+				line_cost_.erase (old_line_id);
+
+     			// update line set
+
+				line_set_.add (l1);
+				line_set_.add (l2);
+				line_set_.erase (line);
+			
+				return true;
+				}
+			else return false;
+			}
+		else return false;
+		}
+	else return false;
+}
+
+
+
+
+bool
+TeGraphNetwork:: nearestNetworkPoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol)
+{
+		if (line_set_.size() == 0) return false;
+		return TeNearest (p1, line_set_, lindex, pinter, distance, tol);
+
+		bool TeNearest(TeCoord2D& pt, TeLineSet& ls , int& i, TeCoord2D& pi, const double& tol = 0.0);
+
+}
+
+
+///////////////////////////////////// Old version - not modified
+
+TeNetwork:: TeNetwork (TeLineSet& ls)  : graph_ (false)
+{
+	line_set_ = ls;
+
+
+	// The initial and final points of each line will be the nodes
+	TeLineSet::iterator it = ls.begin();
+	int j = 0;
+	while (it != line_set_.end())
+	{
+		string line_objId = "l" + Te2String (j);
+		(*it).objectId (line_objId); //ANAP: modified to be able to use more than on layer.
+		TeLine2D line = (*it);
+
+		TeNode n1; 
+		n1.add(line.first());
+		string id1 = line.objectId() + "_p1"; 
+		n1.objectId (id1);
+		n1.geomId (0);
+
+		TeNode n2; 
+		n2.add(line.last());	
+		string id2 = line.objectId() + "_p2";
+		n2.objectId (id2);
+		n2.geomId (0);
+
+		for (unsigned int i = 0; i < graph_.size(); i++)
+		{
+			if (TeDistance (line.first(), graph_[i].first.location()) < 0.01)
+				n1 = graph_[i].first;
+			
+			if (TeDistance (line.last(), graph_[i].first.location()) < 0.01)
+				n2 = graph_[i].first;
+		}
+
+		graph_.insert (n1, n2, TeLength(line));
+
+		TeArc arc (n1, n2);
+		// This is kept for updating purposes
+		arcs_map_[line.objectId()] = arc;
+		it++;
+		j++;
+	}
+}
+
+void
+TeNetwork:: insertLine (TeLine2D& line, const double& attr) 
+{
+
+	int j = line_set_.size();
+
+	// The initial and final points of each line will be the nodes
+	string line_objId = "l" + Te2String (j);
+	line.objectId (line_objId); //ANAP: modified to be able to use more than one layer.
+
+	TeNode n1; 
+	n1.add(line.first());
+	string id1 = line.objectId() + "_p1"; 
+	n1.objectId (id1);
+	n1.geomId (0);
+
+	TeNode n2; 
+	n2.add(line.last());	
+	string id2 = line.objectId() + "_p2";
+
+	n2.objectId (id2);
+	n2.geomId (0);
+
+	for (unsigned int i = 0; i < graph_.size(); i++)
+	{
+		if (TeDistance (line.first(), graph_[i].first.location()) < 0.01)
+			n1 = graph_[i].first;
+			
+		if (TeDistance (line.last(), graph_[i].first.location()) < 0.01)
+			n2 = graph_[i].first;
+	}
+
+	graph_.insert (n1, n2, attr);
+
+	TeArc arc (n1, n2);
+	// This is kept for updating purposes
+	arcs_map_[line.objectId()] = arc;
+	line_set_.add (line);
+
+}
+
+
+bool 
+TeNetwork:: insertNode (TeNode& node, int line)
+{
+	if ((line >= 0) && (line < (int) line_set_.size()))
+	{
+		// Break line
+		int segment;
+		if (TeLocateLineSegment (node.location(), line_set_[line], segment, 0.001))
+		{
+			if (segment <= (int) (line_set_[line].size()) - 2)
+			{
+				TeLine2D l1, l2;
+				int j = 0;
+				TeLine2D::iterator it = line_set_[line].begin();
+
+				while (j <= segment)
+				{
+					l1.add (*it);
+					it++;
+					j++;
+				}
+
+				l1.add (node.location());
+				l2.add (node.location ());
+
+				while (it != line_set_[line].end())
+				{
+					l2.add (*it);
+					it++;
+				}
+
+				// get new and old lines ids
+
+				string old_line_id = line_set_[line].objectId();
+				string line1_id = old_line_id + "l1";
+				string line2_id = old_line_id + "l2";
+
+				l1.objectId(line1_id);
+				l2.objectId(line2_id);
+		
+     			// update line set
+				line_set_.add (l1);
+				line_set_.add (l2);
+				line_set_.erase (line);
+	
+				// update map_nodes 
+				TeArc arc1 (arcs_map_[old_line_id].toNode(),  node);
+				arcs_map_[line1_id] = arc1;
+
+				TeArc arc2 (arcs_map_[old_line_id].fromNode(),node);
+				arcs_map_[line2_id] = arc2;
+				arcs_map_.erase(old_line_id);
+
+
+/*			// insert new arc connection in the network
+			graph_.insert (arcs_map_ [old_line_id].fromNode(),node, l1.length()); 
+			graph_.insert (arcs_map_ [old_line_id].toNode(),  node, l2.length()); 
+		//	graph_.remove (arcs_map_[old_line_id].fromNode(), _map_nodes[old_line_id].toNode()); 
+
+			
+*/
+				return true;
+				}
+			else return false;
+			}
+		else return false;
+		}
+	else return false;
+}
+
+
+bool 
+TeNetwork::getNode (int i, TeNode& node)
+{ 
+	if ((i >0) && (i < (int) graph_.size())) 
+	{
+		node = graph_[i].first;
+		return true;
+	}
+	else 
+		return false;
+}
+
+
+bool 
+TeNetwork:: minimumPath (TeNode& n1, TeNodeSet& nodeSet,vector<double>& result)
+{
+	vector<double> dist;
+	vector<int> pred;
+
+	// Compute minimum path to all vertex
+	unsigned int j = 0;
+	br_stl::Graph<TeNode, double>::iterator it = graph_.begin();
+	while (it != graph_.end())
+	{
+	   if ((*it).first == n1)  
+		    it = graph_.end();
+	   else
+	   {
+		   it++;
+		   j++;
+	   }
+	}
+	if (j == graph_.size()) return false;
+
+	br_stl::Dijkstra<br_stl::Graph<TeNode, double>, double> (graph_, dist, pred, j);
+
+	for (unsigned int i = 0; i< nodeSet.size(); i++)
+	{
+		br_stl::Graph<TeNode, double>::iterator it = graph_.begin();
+		unsigned int vertex = 0;
+		while (it != graph_.end())
+		{
+			if ((*it).first == nodeSet[i])  
+				it = graph_.end();
+			else
+			{  
+				it++;
+				vertex++;
+			}
+		}
+
+		if (vertex == graph_.size()) return false;
+		result.push_back (dist[vertex]);
+	}
+
+
+	return true;
+
+}
+
+
+bool
+TeNetwork:: nearestNodePoint (TeCoord2D& p1, int& index, TeCoord2D& p2, double& distance, double tol)
+{
+		TeNodeSet node_set;
+		for (unsigned int i = 0; i < graph_.size(); i++) 
+			node_set.add (graph_[i].first);
+
+		if (node_set.size() == 0) return false;
+
+		TeNearest (p1, node_set, index, tol);
+		p2 = node_set[index].elem();
+		distance = TeDistance (p1, p2);
+		return true;
+}
+
+bool
+TeNetwork:: nearestNetworkPoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol)
+{
+		if (line_set_.size() == 0) return false;
+		return TeNearest (p1, line_set_, lindex, pinter, distance, tol);
+
+		bool TeNearest(TeCoord2D& pt, TeLineSet& ls , int& i, TeCoord2D& pi, const double& tol = 0.0);
+
+}
diff --git a/src/terralib/kernel/TeNetwork.h b/src/terralib/kernel/TeNetwork.h
old mode 100755
new mode 100644
index a435673..6713124
--- a/src/terralib/kernel/TeNetwork.h
+++ b/src/terralib/kernel/TeNetwork.h
@@ -1,160 +1,160 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeNetwork.h
-    \brief This file defines class for handling networks in Terralib
-*/
-#ifndef TeNetwork_H
-#define TeNetwork_H
-
-#include "TeGeometry.h"
-#include "graph.h"
-
-class TeSTElementSet;
-
-
-//! class for handling networks
-class TL_DLL TeGraphNetwork
-{
-protected:
-	//! Set of nodes and the cost of each edge
-	br_stl::Graph<TeNode, double>	graph_;
-
-	//! Set of geometric representation of edges
-	TeLineSet						line_set_;	
-	
-	//! A map to associate each edge (line object_id) to its cost 
-	map<string, double>				line_cost_;	
-
-	
-public:
-
-	//! Empty constructor
-	TeGraphNetwork() : graph_ (true) {}; // directed graph
-	
-		
-	//! Create a graph from TeLineSet; the line size is considered the cost. In this case, graph non-directed.  
-	TeGraphNetwork (TeLineSet& ls);
-	
-
-	//! Create a graph from TeLineSet; the cost is given by the map.    
-	TeGraphNetwork (TeLineSet& ls, map<string, double>& line_costs);
-	
-
-	//! Create a network from a set of line objects; the cost is given by the attrName sto property. The graph is non-directed.    
-	TeGraphNetwork (TeSTElementSet& stos, string& attrName);
-
-	
-	//! Assignment operator
-	TeGraphNetwork& operator=(TeGraphNetwork& other)
-	{
-		if(this != &other)
-		{
-			graph_ = other.graph_;
-			line_set_ = other.getLineSet();
-			line_cost_ = other.getLineCosts();
-		}
-		return (*this);
-	}
-
-	//! Add lineset to graph. Useful specially for directed graphs (lines must be entered in both directions. It has to be tested for existing graphs.
-	bool Add (TeLineSet& ls, map<string, double>& line_costs); 
-
-	//! Calculate the minimun path
-	bool minimumPath (TeNode& n1, TeNodeSet& set, vector<double>& dist);
-
-	//! Get the i-th node 
-	bool getNode (int i, TeNode& node); 
-	
-	//! Get the nearest network node of a specific point (p1)  
-	bool nearestNodePoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol = 0.0);
-
-	//! Get the nearest network lines point from a specific point (p1) 
-	bool nearestNetworkPoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol = 0.0);
-
-	//! Get line Set
-	TeLineSet getLineSet () { return line_set_;}
-
-	//! Get line costs
-	map<string, double>	getLineCosts () {return line_cost_;}
-
-	//! Insert a new line
-	void insertLine (TeLine2D& line, const double& attr);	
-
-	//! Insert a new node
-	bool breakLineSet (TeNode& node, int i); //maybe should be done externally.
-
-	//! Destructor
-	virtual ~TeGraphNetwork () {}
-
-};
-
-
-//! class for handling networks
-class TL_DLL TeNetwork
-{
-private:
-	//! Set of nodes and the cost of each edge
-	br_stl::Graph<TeNode, double>	graph_;
-	
-	//! Set of edges
-	TeLineSet						line_set_;	
-	
-	//! A map to associate each edge (line object_id) to its arc 
-	map<string, TeArc>				arcs_map_;	
-
-public:
-	//! Empty constructor
-	TeNetwork() : graph_ (false) { };
-
-	//! Create a graph from TeLineSet, the line size is considered the cost    
-	TeNetwork (TeLineSet& ls);  
-
-	//! Calculate the minimun path
-	bool minimumPath (TeNode& n1, TeNodeSet& set, vector<double>& dist);
-
-
-	//! Insert a new line
-	void insertLine (TeLine2D& line, const double& attr);
-
-
-	//! Insert a new node
-	bool insertNode (TeNode& node, int i);
-
-	//! Get the i-th node 
-	bool getNode (int i, TeNode& node); 
-
-	//! Get the nearest network point of a specific point (p1) 
-	bool nearestNetworkPoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol = 0.0);
-	
-	//! Get the nearest network node of a specific point (p1)  
-	bool nearestNodePoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol = 0.0);
-
-	//! Destructor
-	virtual ~TeNetwork () {}
-
-	//! Get line Set
-	TeLineSet getLineSet () { return line_set_;}
-
-};
-
-#endif 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeNetwork.h
+    \brief This file defines class for handling networks in Terralib
+*/
+#ifndef TeNetwork_H
+#define TeNetwork_H
+
+#include "TeGeometry.h"
+#include "graph.h"
+
+class TeSTElementSet;
+
+
+//! class for handling networks
+class TL_DLL TeGraphNetwork
+{
+protected:
+	//! Set of nodes and the cost of each edge
+	br_stl::Graph<TeNode, double>	graph_;
+
+	//! Set of geometric representation of edges
+	TeLineSet						line_set_;	
+	
+	//! A map to associate each edge (line object_id) to its cost 
+	map<string, double>				line_cost_;	
+
+	
+public:
+
+	//! Empty constructor
+	TeGraphNetwork() : graph_ (true) {}; // directed graph
+	
+		
+	//! Create a graph from TeLineSet; the line size is considered the cost. In this case, graph non-directed.  
+	TeGraphNetwork (TeLineSet& ls);
+	
+
+	//! Create a graph from TeLineSet; the cost is given by the map.    
+	TeGraphNetwork (TeLineSet& ls, map<string, double>& line_costs);
+	
+
+	//! Create a network from a set of line objects; the cost is given by the attrName sto property. The graph is non-directed.    
+	TeGraphNetwork (TeSTElementSet& stos, string& attrName);
+
+	
+	//! Assignment operator
+	TeGraphNetwork& operator=(TeGraphNetwork& other)
+	{
+		if(this != &other)
+		{
+			graph_ = other.graph_;
+			line_set_ = other.getLineSet();
+			line_cost_ = other.getLineCosts();
+		}
+		return (*this);
+	}
+
+	//! Add lineset to graph. Useful specially for directed graphs (lines must be entered in both directions. It has to be tested for existing graphs.
+	bool Add (TeLineSet& ls, map<string, double>& line_costs); 
+
+	//! Calculate the minimun path
+	bool minimumPath (TeNode& n1, TeNodeSet& set, vector<double>& dist);
+
+	//! Get the i-th node 
+	bool getNode (int i, TeNode& node); 
+	
+	//! Get the nearest network node of a specific point (p1)  
+	bool nearestNodePoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol = 0.0);
+
+	//! Get the nearest network lines point from a specific point (p1) 
+	bool nearestNetworkPoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol = 0.0);
+
+	//! Get line Set
+	TeLineSet getLineSet () { return line_set_;}
+
+	//! Get line costs
+	map<string, double>	getLineCosts () {return line_cost_;}
+
+	//! Insert a new line
+	void insertLine (TeLine2D& line, const double& attr);	
+
+	//! Insert a new node
+	bool breakLineSet (TeNode& node, int i); //maybe should be done externally.
+
+	//! Destructor
+	virtual ~TeGraphNetwork () {}
+
+};
+
+
+//! class for handling networks
+class TL_DLL TeNetwork
+{
+public:
+	//! Set of nodes and the cost of each edge
+	br_stl::Graph<TeNode, double>	graph_;
+	
+	//! Set of edges
+	TeLineSet						line_set_;	
+	
+	//! A map to associate each edge (line object_id) to its arc 
+	map<string, TeArc>				arcs_map_;	
+
+public:
+	//! Empty constructor
+	TeNetwork() : graph_ (false) { };
+
+	//! Create a graph from TeLineSet, the line size is considered the cost    
+	TeNetwork (TeLineSet& ls);  
+
+	//! Calculate the minimun path
+	bool minimumPath (TeNode& n1, TeNodeSet& set, vector<double>& dist);
+
+
+	//! Insert a new line
+	void insertLine (TeLine2D& line, const double& attr);
+
+
+	//! Insert a new node
+	bool insertNode (TeNode& node, int i);
+
+	//! Get the i-th node 
+	bool getNode (int i, TeNode& node); 
+
+	//! Get the nearest network point of a specific point (p1) 
+	bool nearestNetworkPoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol = 0.0);
+	
+	//! Get the nearest network node of a specific point (p1)  
+	bool nearestNodePoint (TeCoord2D& p1, int& lindex, TeCoord2D& pinter, double& distance, double tol = 0.0);
+
+	//! Destructor
+	virtual ~TeNetwork () {}
+
+	//! Get line Set
+	TeLineSet getLineSet () { return line_set_;}
+
+};
+
+#endif 
diff --git a/src/terralib/kernel/TeOverlay.cpp b/src/terralib/kernel/TeOverlay.cpp
old mode 100755
new mode 100644
index 762a673..b801422
--- a/src/terralib/kernel/TeOverlay.cpp
+++ b/src/terralib/kernel/TeOverlay.cpp
@@ -1,763 +1,763 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-// TerraLib's include
-#include "TeOverlay.h"
-#include "TeOverlayUtils.h"
-#include "TeIntersector.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeFragmentation.h"
-#include "TeRTree.h"
-
-//---------------- Overlay operations ----------------//
-
-// Operacao de uniao otimizada: consome memoria!
-bool TeOVERLAY::TeUnion(TePolygonSet& polsIn, TePolygonSet& polsOut, const bool& makeCopy, const bool fixOrientation)
-{
-// limpa a lista de saida
-	polsOut.clear();
-
-// verifica se e necessario realizar uma copia dos pol�gonos
-	TePolygonSet polygonSetIn;
-
-	if(makeCopy)
-	{
-		if(!TeOVERLAY::TeClonePolygonSet(polsIn, polygonSetIn))
-			return false;
-        //polygonSetIn.copyElements(polsIn);
-	}
-	else
-	{
-		polygonSetIn = polsIn;
-	}
-
-	if(polygonSetIn.empty())
-		return false;
-
-	if(polygonSetIn.size() == 1)
-	{
-		polsOut.copyElements(polygonSetIn);
-
-		return true;
-	}
-
-// verifica a orientacao de cada linha se necessario: aneis externos devem estar no sentido horario e os internos devem estar no sentido anti-horario
-	if(fixOrientation)
-		TeFixOrientation(polygonSetIn, TeCOUNTERCLOCKWISE, TeCLOCKWISE);
-
-// cria uma arvore que indexara os segmentos de cada linha e
-// chama uma rotina que calcula os pontos de intersecao e ja indexa os segmentos
-	TeINTERSECTOR2::TeSegmentRTree segmentTree(polygonSetIn.box());
-
-	TeINTERSECTOR2::TeVectorBoundaryIP report;
-
-	TeINTERSECTOR2::TeIntersection(polygonSetIn, segmentTree, report);
-
-// fragmenta as linhas
-	TeLineSet fragments;
-	TeLineSet boundaryFragments;
-	vector<pair<unsigned int, unsigned int> > fragmentsIds;
-	vector<pair<unsigned int, unsigned int> > boundaryFragmentsIds;
-
-	TeFragmentBoundary(polygonSetIn, report, boundaryFragments, boundaryFragmentsIds, fragments, fragmentsIds);
-
-	report.clear();
-
-	short mask  = TeUNKNOWNPOSITION;
-
-// os fragmentos de fronteira ja sao separados
-	TeLineIndex boundaryFragmentsIndex;
-	unsigned int i;
-	if(boundaryFragments.size())
-	{
-		mask = TeBOUNDARY;
-
-		unsigned int boundaryFragmentsSize = boundaryFragments.size();
-
-		for(i = 0; i < boundaryFragmentsSize; ++i)
-			boundaryFragmentsIndex.insert(TeLineIndex::value_type(boundaryFragments[i][0], pair<unsigned int, TeLine2D>(i, boundaryFragments[i])));
-	}
-
-// escolhe os fragmentos que estiverem localizados dentro de cada pol�gono
-	short locationFragments  = TeOUTSIDE;	
-
-	TeLineIndex fragmentsIndex;
-
-	vector<TeLinearRing> rings;
-
-	TeRtreeGetFragments(polygonSetIn, segmentTree, fragments, fragmentsIds, locationFragments, mask, fragmentsIndex, rings);
-
-	// Tenta eliminar fragmentos de fronteira no mesmo sentido, deixando apenas um nesta direcao
-	TeRemoveSameBoundaryFragments(boundaryFragmentsIndex);
-
-	// Tenta eliminar fragmentos sobre fronteira opostos
-	TeRemoveOpositeBoundaryFragments(boundaryFragmentsIndex);
-
-	//--remover do boundaryfragments os fragmentos removidos do boundaryFragmentsIndex
-	TeRtreeRemoveFragments(polygonSetIn, segmentTree, boundaryFragmentsIndex, boundaryFragmentsIds, TeINSIDE, mask, rings);
-	segmentTree.clear();
-
-// Faz um merge dos fragmentos de fronteira para o �ndice de fragmentos normal
-	TeJoinFragments(fragmentsIndex, boundaryFragmentsIndex);
-
-// monta os poligonos a partir dos fragmentos
-	bool returnValue = TeMergeFragments(fragmentsIndex, rings, true);
-
-	vector<TeLinearRing> ringsOut;
-
-	bool resultSplit = true;
-
-	if(TeOVERLAY::TeSplitRings(rings, ringsOut) == false)
-	{
-		ringsOut.clear();
-
-		ringsOut = rings;
-
-		resultSplit = false;
-	}
-
-// separate holes from islands
-	vector<TeLinearRing> holes;
-
-	bool result = TeClassifyRings(ringsOut, polsOut, holes);
-
-// mount topology		
-	if((polsOut.size() == 0) && (holes.size() == 0))
-	{
-		return false;	// Na uniao deve haver a formacao de poligonos	
-	}
-	
-	bool mountResult = TeMountTopology(polsOut, holes);
-
-	return (returnValue && result &&  mountResult && resultSplit);
-}
-
-
-// Operacao geral de conjunto: uniao, intersecao e diferenca
-bool TeOverlay(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const short& operation, const bool& makeCopy, const bool fixOrientation)
-{
-// limpa a saida
-	vecPolsOut.clear();
-	resultVec.clear();
-
-// verifica se a lista dos poligonos vermelhos esta vazia
-	unsigned int numBluePols = bluePols.size();
-	unsigned int i;
-
-	if(redPols.empty())
-	{
-// se os poligonos vermelhos nao foram informados, no caso da uniao tenta copiar os azuis para o vetor de saida
-		if(operation == TeUNION)
-		{
-			for(i = 0; i < numBluePols; ++i)
-			{
-				TePolygonSet bluePolsInAux;
-
-				if(!TeOVERLAY::TeClonePolygonSet(bluePols[i], bluePolsInAux))
-					return false;
-
-				//bluePolsInAux.copyElements(bluePols[i]);
-
-// se nao existir tambem o poligono azul, entao retirn falso
-                vecPolsOut.push_back(bluePolsInAux);
-				resultVec.push_back	(true);
-			}
-
-			if(vecPolsOut.empty())
-				return false;
-
-			return true;
-		}
-		
-// TeDIFFERENCE ou TeINTERSECTION: resultado eh vazio, logo ja retorna true
-		return true;
-	}
-
-
-// Defines location to choose fragments
-	short locationRedFragments  = TeINSIDE;	
-	short locationBlueFragments  = TeINSIDE;
-
-	TeOVERLAY::TeChooseBoundaryLocation(operation, locationRedFragments, locationBlueFragments);
-
-// verifica se e necessario realizar uma copia dos poligonos
-	TePolygonSet redPolsIn;
-	vector<TePolygonSet> bluePolsIn;
-
-	if(makeCopy)
-	{
-		if(!TeOVERLAY::TeClonePolygonSet(redPols, redPolsIn))
-			return false;
-
-		//redPolsIn.copyElements(redPols);
-		
-		for(i = 0; i < numBluePols; ++i)
-		{
-			TePolygonSet bluePolsInAux;
-
-			if(!TeOVERLAY::TeClonePolygonSet(bluePols[i], bluePolsInAux))
-				return false;
-
-			//bluePolsInAux.copyElements(bluePols[i]);
-
-			bluePolsIn.push_back(bluePolsInAux);
-		}
-	}
-	else
-	{
-		redPolsIn = redPols;
-		
-		bluePolsIn = bluePols;
-	}
-
-
-// verifica a orientacao de cada linha se necessario: aneis externos devem estar no sentido horario e os internos devem estar no sentido anti-horario
-	if(fixOrientation)
-	{	
-		if(operation == TeINTERSECTION || operation == TeUNION)
-		{
-			TeOVERLAY::TeFixOrientation(redPolsIn, TeCOUNTERCLOCKWISE, TeCLOCKWISE);
-
-			for(i = 0; i < numBluePols; ++i)
-				TeOVERLAY::TeFixOrientation(bluePolsIn[i], TeCOUNTERCLOCKWISE, TeCLOCKWISE);
-		}
-		else
-		{
-			TeOVERLAY::TeFixOrientation(redPolsIn, TeCOUNTERCLOCKWISE, TeCLOCKWISE);
-
-			for(i = 0; i < numBluePols; ++i)
-				TeOVERLAY::TeFixOrientation(bluePolsIn[i], TeCLOCKWISE, TeCOUNTERCLOCKWISE);
-		}
-	}
-
-
-// cria uma arvore que indexara os segmentos dos poligonos vermelhos
-	TeINTERSECTOR2::TeSegmentRTree redSegmentTree(redPolsIn.box());
-	TeINTERSECTOR2::TeIndexPolygonSet(redPolsIn, redSegmentTree);
-
-	bool resultValue = true;
-
-// para cada conjunto de poligonos azuis, faz a operacao dele com os vermelhos
-	for(i = 0; i < numBluePols; ++i)
-	{
-// verifica se tem poligonos no polygonset azul
-		if(bluePolsIn[i].empty())
-		{
-			if((operation == TeUNION) || (operation == TeDIFFERENCE))
-			{
-				vecPolsOut.push_back(redPolsIn);
-				resultVec.push_back(true);	// mario - 2006-03
-			}
-			else
-			{
-                TePolygonSet emptySet;
-
-                vecPolsOut.push_back(emptySet);
-				resultVec.push_back(true);	// mario - 2006-03
-			}
-
-			continue;
-		}
-
-// Indexa os segmentos azuis
-		TeINTERSECTOR2::TeSegmentRTree blueSegmentTree(bluePolsIn[i].box());
-		TeINTERSECTOR2::TeIndexPolygonSet(bluePolsIn[i], blueSegmentTree);		
-
-// calcula os potos de intersecao dos vermelhos com os azuis
-		TeINTERSECTOR2::TeVectorBoundaryIP report;
-		TeINTERSECTOR2::TeIntersection(redPolsIn, redSegmentTree, bluePolsIn[i], report);
-
-// fragmenta as linhas vermelhas
-		TeLineSet redFragments;
-		TeLineSet redBoundaryFragments;
-		vector<pair<unsigned int, unsigned int> > redFragmentsIds;
-		vector<pair<unsigned int, unsigned int> > boundaryFragmentsIds;
-
-		TeFragmentBoundary(redPolsIn, report, redBoundaryFragments, boundaryFragmentsIds, redFragments, redFragmentsIds);
-
-		short mask  = TeUNKNOWNPOSITION;
-
-// os fragmentos de fronteira ja sao separados
-		TeOVERLAY::TeLineIndex boundaryFragmentsIndex;
-
-		unsigned int boundaryId_ = 0;
-
-		if(redBoundaryFragments.size())
-		{
-			mask = TeBOUNDARY;
-
-			unsigned int boundaryFragmentsSize = redBoundaryFragments.size();
-
-			for(unsigned int ti = 0; ti < boundaryFragmentsSize; ++ti)
-			{
-				boundaryFragmentsIndex.insert(TeOVERLAY::TeLineIndex::value_type(redBoundaryFragments[ti][0], pair<unsigned int, TeLine2D>(boundaryId_, redBoundaryFragments[ti])));
-				++boundaryId_;
-			}
-		}
-
-// escolhe os fragmentos vermelhos que estiverem localizados dentro/fora (dependendo da oparacao) dos poligonos azuis
-		vector<TeLinearRing> rings;
-
-		TeOVERLAY::TeLineIndex fragmentsIndex;
-
-		TeOVERLAY::TeRtreeGetFragments(bluePolsIn[i], blueSegmentTree, redFragments, locationRedFragments, mask, fragmentsIndex, rings);
-
-// inverte a ordem dos pontos de intersecao para fragmentar as linhas azuis
-		TeINTERSECTOR2::TeVectorBoundaryIP::iterator it     = report.begin();
-		TeINTERSECTOR2::TeVectorBoundaryIP::iterator it_end = report.end();
-		
-		while(it != it_end)
-		{
-			swap(it->bluePolNum_, it->redPolNum_);
-			swap(it->bluePartNum_, it->redPartNum_);
-			swap(it->blueSegNum_, it->redSegNum_);
-
-			if(it->coords_.size() == 2)	//overlap
-			{
-				// Verificar se os pontos estao em ordem crescente
-				if(it->coords_[0].x_ < it->coords_[1].x_)
-				{
-				}
-				else if(it->coords_[0].x_ > it->coords_[1].x_)
-				{
-					swap(it->coords_[0], it->coords_[1]);
-				}
-				else if(it->coords_[0].y_ < it->coords_[1].y_)
-				{
-
-				}
-				else
-				{
-					swap(it->coords_[0], it->coords_[1]);							
-				}
-			}
-
-			++it;
-		}
-
-// fragmenta as linhas azuis
-		TeLineSet blueFragments;
-		TeLineSet blueBoundaryFragments;
-		vector<pair<unsigned int, unsigned int> > blueFragmentsIds;
-		boundaryFragmentsIds.clear();
-
-		TeFragmentBoundary(bluePolsIn[i], report, blueBoundaryFragments, boundaryFragmentsIds, blueFragments, blueFragmentsIds);
-
-		report.clear();
-
-		mask  = TeUNKNOWNPOSITION;
-
-// os fragmentos de fronteira ja sao separados
-		if(blueBoundaryFragments.size())
-		{
-			mask = TeBOUNDARY;
-
-			unsigned int boundaryFragmentsSize = blueBoundaryFragments.size();
-
-			for(unsigned int ti = 0; ti < boundaryFragmentsSize; ++ti)
-			{
-				boundaryFragmentsIndex.insert(TeOVERLAY::TeLineIndex::value_type(blueBoundaryFragments[ti][0], pair<unsigned int, TeLine2D>(boundaryId_, blueBoundaryFragments[ti])));
-				++boundaryId_;
-			}
-		}
-
-// escolhe os fragmentos vermelhos que estiverem localizados fora dos poligonos azuis - fragmenta as linhas vermelhas
-		TeRtreeGetFragments(redPolsIn, redSegmentTree, blueFragments, locationBlueFragments, mask, fragmentsIndex, rings);
-
-// libera a memoria usada pelos indice azul
-		blueSegmentTree.clear();
-
-// tenta eliminar fragmentos de fronteira no mesmo sentido, deixando apenas um nesta direcao
-		TeRemoveSameBoundaryFragments(boundaryFragmentsIndex);
-
-// tenta eliminar fragmentos sobre fronteira opostos
-        TeRemoveOpositeBoundaryFragments(boundaryFragmentsIndex);
-
-// faz um merge dos fragmentos de fronteira para o indice de fragmentos normal
-		TeJoinFragments(fragmentsIndex, boundaryFragmentsIndex);
-
-// monta os poligonos a partir dos fragmentos
-		bool returnValue = TeMergeFragments(fragmentsIndex, rings, true);
-
-		// faz o split
-		vector<TeLinearRing> ringsOut;
-
-		bool resultSplit = true;
-
-		if(TeOVERLAY::TeSplitRings(rings, ringsOut) == false)
-		{
-			ringsOut.clear();
-
-			ringsOut = rings;
-
-			resultSplit = false;
-		}
-
-// separate holes from islands
-		vector<TeLinearRing> holes;
-		TePolygonSet polsOut;
-
-		bool result = TeOVERLAY::TeClassifyRings(ringsOut, polsOut, holes);
-
-		returnValue = returnValue && result && resultSplit;
-
-// mount topology		
-		if((polsOut.size() == 0) && (holes.size() == 0))
-		{
-			if(operation == TeUNION)			
-			{
-				resultVec.push_back(false);	// mario - 2006-03
-				resultValue = false;						// uniao nao pode dar vazio
-			}
-			else
-			{
-				resultVec.push_back(returnValue);	// mario - 2006-03
-				resultValue = (resultValue && returnValue);	// Diferenca e intersecao podem retornar vazio
-			}
-
-			vecPolsOut.push_back(polsOut);	// only to mark result			
-		}
-		else
-		{
-			bool mountResult = TeOVERLAY::TeMountTopology(polsOut, holes);
-
-			resultVec.push_back(returnValue && mountResult);	// mario - 2006-03
-
-			resultValue = resultValue && returnValue && mountResult;	
-
-			vecPolsOut.push_back(polsOut);
-		}		
-		
-	}
-
-	redSegmentTree.clear();
-
-	return resultValue;
-}
-
-bool TeOVERLAY::TeIntersection(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy, const bool fixOrientation)
-{
-	return TeOverlay(redPols, bluePols, vecPolsOut, resultVec, TeINTERSECTION, makeCopy, fixOrientation);
-}
-
-bool TeOVERLAY::TeUnion(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy, const bool fixOrientation)
-{
-	return TeOverlay(redPols, bluePols, vecPolsOut, resultVec, TeUNION, makeCopy, fixOrientation);
-}
-
-bool TeOVERLAY::TeDifference(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy, const bool fixOrientation)
-{
-	return TeOverlay(redPols, bluePols, vecPolsOut, resultVec, TeDIFFERENCE, makeCopy, fixOrientation);
-}
-
-// deprecated functions
-bool TeOVERLAY::TeOverlay(const TePolygonSet& redPols, const TePolygonSet& bluePols, TePolygonSet& polsOut, const short& operation)
-{
-	vector<TePolygonSet> bluePolsVec;
-	bluePolsVec.push_back(bluePols);
-	vector<TePolygonSet> resultPols;
-	TePolygonSet redPolsAux = redPols;
-	vector<bool> resultVec;
-
-	bool result = TeOverlay(redPolsAux, bluePolsVec, resultPols, resultVec, operation, true, true);
-
-	if(resultPols.size() > 0)
-		polsOut = resultPols[0];
-
-	return result;	
-}
-
-bool TeOVERLAY::TeUnion(TePolygonSet& redPols, TePolygonSet& bluePols, TePolygonSet& polsOut)
-{
-	return TeOVERLAY::TeOverlay(redPols, bluePols, polsOut, TeUNION);
-}
-
-bool TeOVERLAY::TeIntersection(const TePolygonSet& redPols, const TePolygonSet& bluePols, TePolygonSet& polsOut)
-{
-	return TeOVERLAY::TeOverlay(redPols, bluePols, polsOut, TeINTERSECTION);
-}
-
-bool TeOVERLAY::TeDifference(TePolygonSet& redPols, TePolygonSet& bluePols, TePolygonSet& polsOut)
-{
-	return TeOVERLAY::TeOverlay(redPols, bluePols, polsOut, TeDIFFERENCE);
-}
-
-TeMultiGeometry TeOverlay(const TeLineSet& redLinesIn, const TePolygonSet& bluePolsIn, TeINTERSECTOR2::TeSegmentRTree& blueTree, const short& operation)
-{
-//	short location = TeUNKNOWNPOSITION;
-	short locationRedFragments = TeUNKNOWNPOSITION;
-	short locationBlueFragments = TeUNKNOWNPOSITION;
-
-	TeMultiGeometry mGeom;
-
-	TeLineSet redLines;
-	TePolygonSet bluePols;
-
-// copia o conteudo das linhas de entrada
-	redLines.copyElements(redLinesIn);
-
-// copia o conteudo dos poligonos de entrada
-	bluePols.copyElements(bluePolsIn);
-
-// determina a localizacao dos fragmentos que serao utilizados
-	TeOVERLAY::TeChooseBoundaryLocation(operation, locationRedFragments, locationBlueFragments);
-
-// gets intersection list
-	TeINTERSECTOR2::TeVectorBoundaryIP report;
-
-	TeINTERSECTOR2::TeIntersection(redLines, bluePols, blueTree, report);
-
-// fragment lines
-	TeLineSet redFragments;
-	TeLineSet redBoundaryFragments;
-	
-    TeFragmentBoundary(redLines, report, redBoundaryFragments, redFragments);
-
-// choose red fragments
-	vector<TeLinearRing> rings;
-
-	TeOVERLAY::TeLineIndex fragmentsIndex;
-
-	short mask = 0;
-
-	TeRtreeGetFragments(bluePols, blueTree, redFragments, locationRedFragments, mask, fragmentsIndex, rings);
-
-// report fragments from red lines
-	TeOVERLAY::TeLineIndex::iterator it = fragmentsIndex.begin();
-
-	while(it != fragmentsIndex.end())
-	{
-		mGeom.addGeometry(it->second.second);
-		++it;
-	}
-
-	unsigned int nrings = rings.size();
-	unsigned int i;
-	for(i = 0; i < nrings; ++i)
-	{
-		mGeom.addGeometry(rings[i]);
-	}
-
-// if the operaton is union, so push bluepols
-
-	if(operation == TeUNION)
-	{							
-		mGeom.setGeometry(bluePols);		
-	}
-
-	return mGeom;
-}
-
-void TeOverlay(vector<TeLineSet>& redLinesIn, const TePolygonSet& bluePolsIn, vector<TeMultiGeometry>& outPutGeoms, const short& operation)
-{
-	TeINTERSECTOR2::TeSegmentRTree blueTree(bluePolsIn.box());
-
-	unsigned int nLines = redLinesIn.size();
-	unsigned int i;
-	for(i = 0; i < nLines; ++i)
-	{
-		TeMultiGeometry mg;
-
-		mg = TeOverlay(redLinesIn[i], bluePolsIn, blueTree, operation);
-
-		outPutGeoms.push_back(mg);        		
-	}
-
-	blueTree.clear();
-
-	return;
-}
-
-// overlay for lines/polygons
-TeMultiGeometry TeOVERLAY::TeOverlay(const TeLineSet& redLinesIn, const TePolygonSet& bluePolsIn, const short& operation)
-{
-	vector<TeMultiGeometry> mgeoms;
-	vector<TeLineSet> redLines;
-	redLines.push_back(redLinesIn);
-	TeMultiGeometry outputGeom;
-
-	::TeOverlay(redLines, bluePolsIn, mgeoms, operation);
-
-	if(mgeoms.empty())
-		return outputGeom;
-
-	outputGeom = mgeoms[0];
-
-	return outputGeom;
-}
-
-TeMultiGeometry TeOVERLAY::TeUnion(TeLineSet& redLines, TePolygonSet& bluePols)
-{
-	return TeOVERLAY::TeOverlay(redLines, bluePols, TeUNION);
-}
-
-TeMultiGeometry TeOVERLAY::TeIntersection(TeLineSet& redLines, TePolygonSet& bluePols)
-{
-	return TeOVERLAY::TeOverlay(redLines, bluePols, TeINTERSECTION);
-}
-
-TeMultiGeometry TeOVERLAY::TeDifference(TeLineSet& redLines, TePolygonSet& bluePols)
-{
-	return TeOVERLAY::TeOverlay(redLines, bluePols, TeDIFFERENCE);
-}
-
-bool TeOVERLAY::TePairUnion(TePolygonSet& psetIn, TePolygonSet& psetOut)
-{
-	psetOut.clear();
-
-	vector<TePolygonSet> outPutSet;
-	unsigned int i;
-	for(i = 0; i < psetIn.size(); ++i)
-	{
-		TePolygonSet pset;
-		pset.add(psetIn[i]);
-		outPutSet.push_back(pset);
-	}
-
-	unsigned int outsize = outPutSet.size();
-
-	bool resultUnion = true;
-
-	while(outsize > 1)
-	{
-// une dois a dois
-		unsigned int auxsize = 0;
-		unsigned int i;
-		for(i = 0; i < outsize; i += 2)
-		{
-			TePolygonSet psRed = outPutSet[i];
-			if((i + 1) < outsize)
-			{
-				TePolygonSet psBlue = outPutSet[i+1];
-				TePolygonSet psUnidoAgregado;
-				resultUnion = resultUnion && TeOVERLAY::TeUnion(psRed, psBlue, psUnidoAgregado);
-				if(psUnidoAgregado.size() > 0)
-				{
-					outPutSet[auxsize] = psUnidoAgregado;
-					++auxsize;
-				}
-			}
-			else
-			{
-				outPutSet[auxsize] = psRed;
-				++auxsize;
-			}			
-		}
-
-		outsize = auxsize;
-	}
-
-	for(unsigned int i = 0; i < outsize; ++i)
-		for(unsigned int j = 0; j < outPutSet[i].size(); ++j)		
-			psetOut.add(outPutSet[i][j]);
-
-	return resultUnion;
-}
-
-bool TeOVERLAY::TeValidPolygonHoles(TePolygon& polygon, TePolygonSet& psValid)
-{
-	string objectId = polygon.objectId();
-	int geomId = polygon.geomId();
-
-	psValid.clear();
-
-	if(polygon.size() == 0)
-		return false;
-
-	if(polygon.size() == 1)
-	{	
-		TePolygon paux;
-		paux.copyElements(polygon);
-		paux.geomId(geomId);
-		paux.objectId(objectId);
-		psValid.add(paux);
-		return true;
-	}
-
-	TePolygon fixedPolygon;
-	fixedPolygon.add(polygon[0]);
-				
-//adiciona todos os buracos em um TePolygonSet
-	TePolygonSet psHoles;
-	unsigned int i;
-	for(i = 1; i < polygon.size(); i++)
-	{
-		TePolygon hole;
-		hole.add(polygon[i]);
-
-		psHoles.add(hole);
-	}
-
-//faz a uniao dos buracos
-	TePolygonSet psOut;	
-	if(!TeOVERLAY::TeUnion(psHoles, psOut))
-		return false;
-
-	psHoles = TePolygonSet();
-	psHoles.copyElements(psOut);
-	psOut = TePolygonSet();
-
-//faz a diferenca entre o poligono original e a uniao dos seus buracos 
-	TePolygonSet psTemp;
-	psTemp.add(fixedPolygon);
-
-	if(!TeOVERLAY::TeDifference(psTemp, psHoles, psOut))
-		return false;
-		
-	for(i = 0; i < psOut.size(); i++)
-	{
-		psOut[i].geomId(geomId);
-		psOut[i].objectId(objectId);
-		psValid.add(psOut[i]);
-	}
-
-	return true;
-}
-
-bool TeOVERLAY::TeValidPolygonHoles(TePolygonSet& polygons, TePolygonSet& psValid)
-{
-	psValid.clear();
-	unsigned int i, j;
-    for(i = 0; i < polygons.size(); ++i)
-	{
-// do valid for each polygon
-        TePolygon pol = polygons[i];
-
-        TePolygonSet psAux;
-
-        if(TeValidPolygonHoles(pol, psAux))
-		{
-			for(j = 0; j < psAux.size(); ++j)
-			{
-				psValid.add(psAux[j]);
-			}
-		}
-		else
-		{
-			return false;
-		}
-	}
-
-	return true;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+// TerraLib's include
+#include "TeOverlay.h"
+#include "TeOverlayUtils.h"
+#include "TeIntersector.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeFragmentation.h"
+#include "TeRTree.h"
+
+//---------------- Overlay operations ----------------//
+
+// Operacao de uniao otimizada: consome memoria!
+bool TeOVERLAY::TeUnion(TePolygonSet& polsIn, TePolygonSet& polsOut, const bool& makeCopy, const bool fixOrientation)
+{
+// limpa a lista de saida
+	polsOut.clear();
+
+// verifica se e necessario realizar uma copia dos pol�gonos
+	TePolygonSet polygonSetIn;
+
+	if(makeCopy)
+	{
+		if(!TeOVERLAY::TeClonePolygonSet(polsIn, polygonSetIn))
+			return false;
+        //polygonSetIn.copyElements(polsIn);
+	}
+	else
+	{
+		polygonSetIn = polsIn;
+	}
+
+	if(polygonSetIn.empty())
+		return false;
+
+	if(polygonSetIn.size() == 1)
+	{
+		polsOut.copyElements(polygonSetIn);
+
+		return true;
+	}
+
+// verifica a orientacao de cada linha se necessario: aneis externos devem estar no sentido horario e os internos devem estar no sentido anti-horario
+	if(fixOrientation)
+		TeFixOrientation(polygonSetIn, TeCOUNTERCLOCKWISE, TeCLOCKWISE);
+
+// cria uma arvore que indexara os segmentos de cada linha e
+// chama uma rotina que calcula os pontos de intersecao e ja indexa os segmentos
+	TeINTERSECTOR2::TeSegmentRTree segmentTree(polygonSetIn.box());
+
+	TeINTERSECTOR2::TeVectorBoundaryIP report;
+
+	TeINTERSECTOR2::TeIntersection(polygonSetIn, segmentTree, report);
+
+// fragmenta as linhas
+	TeLineSet fragments;
+	TeLineSet boundaryFragments;
+	vector<pair<unsigned int, unsigned int> > fragmentsIds;
+	vector<pair<unsigned int, unsigned int> > boundaryFragmentsIds;
+
+	TeFragmentBoundary(polygonSetIn, report, boundaryFragments, boundaryFragmentsIds, fragments, fragmentsIds);
+
+	report.clear();
+
+	short mask  = TeUNKNOWNPOSITION;
+
+// os fragmentos de fronteira ja sao separados
+	TeLineIndex boundaryFragmentsIndex;
+	unsigned int i;
+	if(boundaryFragments.size())
+	{
+		mask = TeBOUNDARY;
+
+		unsigned int boundaryFragmentsSize = boundaryFragments.size();
+
+		for(i = 0; i < boundaryFragmentsSize; ++i)
+			boundaryFragmentsIndex.insert(TeLineIndex::value_type(boundaryFragments[i][0], pair<unsigned int, TeLine2D>(i, boundaryFragments[i])));
+	}
+
+// escolhe os fragmentos que estiverem localizados dentro de cada pol�gono
+	short locationFragments  = TeOUTSIDE;	
+
+	TeLineIndex fragmentsIndex;
+
+	vector<TeLinearRing> rings;
+
+	TeRtreeGetFragments(polygonSetIn, segmentTree, fragments, fragmentsIds, locationFragments, mask, fragmentsIndex, rings);
+
+	// Tenta eliminar fragmentos de fronteira no mesmo sentido, deixando apenas um nesta direcao
+	TeRemoveSameBoundaryFragments(boundaryFragmentsIndex);
+
+	// Tenta eliminar fragmentos sobre fronteira opostos
+	TeRemoveOpositeBoundaryFragments(boundaryFragmentsIndex);
+
+	//--remover do boundaryfragments os fragmentos removidos do boundaryFragmentsIndex
+	TeRtreeRemoveFragments(polygonSetIn, segmentTree, boundaryFragmentsIndex, boundaryFragmentsIds, TeINSIDE, mask, rings);
+	segmentTree.clear();
+
+// Faz um merge dos fragmentos de fronteira para o �ndice de fragmentos normal
+	TeJoinFragments(fragmentsIndex, boundaryFragmentsIndex);
+
+// monta os poligonos a partir dos fragmentos
+	bool returnValue = TeMergeFragments(fragmentsIndex, rings, true);
+
+	vector<TeLinearRing> ringsOut;
+
+	bool resultSplit = true;
+
+	if(TeOVERLAY::TeSplitRings(rings, ringsOut) == false)
+	{
+		ringsOut.clear();
+
+		ringsOut = rings;
+
+		resultSplit = false;
+	}
+
+// separate holes from islands
+	vector<TeLinearRing> holes;
+
+	bool result = TeClassifyRings(ringsOut, polsOut, holes);
+
+// mount topology		
+	if((polsOut.size() == 0) && (holes.size() == 0))
+	{
+		return false;	// Na uniao deve haver a formacao de poligonos	
+	}
+	
+	bool mountResult = TeMountTopology(polsOut, holes);
+
+	return (returnValue && result &&  mountResult && resultSplit);
+}
+
+
+// Operacao geral de conjunto: uniao, intersecao e diferenca
+bool TeOverlay(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const short& operation, const bool& makeCopy, const bool fixOrientation)
+{
+// limpa a saida
+	vecPolsOut.clear();
+	resultVec.clear();
+
+// verifica se a lista dos poligonos vermelhos esta vazia
+	unsigned int numBluePols = bluePols.size();
+	unsigned int i;
+
+	if(redPols.empty())
+	{
+// se os poligonos vermelhos nao foram informados, no caso da uniao tenta copiar os azuis para o vetor de saida
+		if(operation == TeUNION)
+		{
+			for(i = 0; i < numBluePols; ++i)
+			{
+				TePolygonSet bluePolsInAux;
+
+				if(!TeOVERLAY::TeClonePolygonSet(bluePols[i], bluePolsInAux))
+					return false;
+
+				//bluePolsInAux.copyElements(bluePols[i]);
+
+// se nao existir tambem o poligono azul, entao retirn falso
+                vecPolsOut.push_back(bluePolsInAux);
+				resultVec.push_back	(true);
+			}
+
+			if(vecPolsOut.empty())
+				return false;
+
+			return true;
+		}
+		
+// TeDIFFERENCE ou TeINTERSECTION: resultado eh vazio, logo ja retorna true
+		return true;
+	}
+
+
+// Defines location to choose fragments
+	short locationRedFragments  = TeINSIDE;	
+	short locationBlueFragments  = TeINSIDE;
+
+	TeOVERLAY::TeChooseBoundaryLocation(operation, locationRedFragments, locationBlueFragments);
+
+// verifica se e necessario realizar uma copia dos poligonos
+	TePolygonSet redPolsIn;
+	vector<TePolygonSet> bluePolsIn;
+
+	if(makeCopy)
+	{
+		if(!TeOVERLAY::TeClonePolygonSet(redPols, redPolsIn))
+			return false;
+
+		//redPolsIn.copyElements(redPols);
+		
+		for(i = 0; i < numBluePols; ++i)
+		{
+			TePolygonSet bluePolsInAux;
+
+			if(!TeOVERLAY::TeClonePolygonSet(bluePols[i], bluePolsInAux))
+				return false;
+
+			//bluePolsInAux.copyElements(bluePols[i]);
+
+			bluePolsIn.push_back(bluePolsInAux);
+		}
+	}
+	else
+	{
+		redPolsIn = redPols;
+		
+		bluePolsIn = bluePols;
+	}
+
+
+// verifica a orientacao de cada linha se necessario: aneis externos devem estar no sentido horario e os internos devem estar no sentido anti-horario
+	if(fixOrientation)
+	{	
+		if(operation == TeINTERSECTION || operation == TeUNION)
+		{
+			TeOVERLAY::TeFixOrientation(redPolsIn, TeCOUNTERCLOCKWISE, TeCLOCKWISE);
+
+			for(i = 0; i < numBluePols; ++i)
+				TeOVERLAY::TeFixOrientation(bluePolsIn[i], TeCOUNTERCLOCKWISE, TeCLOCKWISE);
+		}
+		else
+		{
+			TeOVERLAY::TeFixOrientation(redPolsIn, TeCOUNTERCLOCKWISE, TeCLOCKWISE);
+
+			for(i = 0; i < numBluePols; ++i)
+				TeOVERLAY::TeFixOrientation(bluePolsIn[i], TeCLOCKWISE, TeCOUNTERCLOCKWISE);
+		}
+	}
+
+
+// cria uma arvore que indexara os segmentos dos poligonos vermelhos
+	TeINTERSECTOR2::TeSegmentRTree redSegmentTree(redPolsIn.box());
+	TeINTERSECTOR2::TeIndexPolygonSet(redPolsIn, redSegmentTree);
+
+	bool resultValue = true;
+
+// para cada conjunto de poligonos azuis, faz a operacao dele com os vermelhos
+	for(i = 0; i < numBluePols; ++i)
+	{
+// verifica se tem poligonos no polygonset azul
+		if(bluePolsIn[i].empty())
+		{
+			if((operation == TeUNION) || (operation == TeDIFFERENCE))
+			{
+				vecPolsOut.push_back(redPolsIn);
+				resultVec.push_back(true);	// mario - 2006-03
+			}
+			else
+			{
+                TePolygonSet emptySet;
+
+                vecPolsOut.push_back(emptySet);
+				resultVec.push_back(true);	// mario - 2006-03
+			}
+
+			continue;
+		}
+
+// Indexa os segmentos azuis
+		TeINTERSECTOR2::TeSegmentRTree blueSegmentTree(bluePolsIn[i].box());
+		TeINTERSECTOR2::TeIndexPolygonSet(bluePolsIn[i], blueSegmentTree);		
+
+// calcula os potos de intersecao dos vermelhos com os azuis
+		TeINTERSECTOR2::TeVectorBoundaryIP report;
+		TeINTERSECTOR2::TeIntersection(redPolsIn, redSegmentTree, bluePolsIn[i], report);
+
+// fragmenta as linhas vermelhas
+		TeLineSet redFragments;
+		TeLineSet redBoundaryFragments;
+		vector<pair<unsigned int, unsigned int> > redFragmentsIds;
+		vector<pair<unsigned int, unsigned int> > boundaryFragmentsIds;
+
+		TeFragmentBoundary(redPolsIn, report, redBoundaryFragments, boundaryFragmentsIds, redFragments, redFragmentsIds);
+
+		short mask  = TeUNKNOWNPOSITION;
+
+// os fragmentos de fronteira ja sao separados
+		TeOVERLAY::TeLineIndex boundaryFragmentsIndex;
+
+		unsigned int boundaryId_ = 0;
+
+		if(redBoundaryFragments.size())
+		{
+			mask = TeBOUNDARY;
+
+			unsigned int boundaryFragmentsSize = redBoundaryFragments.size();
+
+			for(unsigned int ti = 0; ti < boundaryFragmentsSize; ++ti)
+			{
+				boundaryFragmentsIndex.insert(TeOVERLAY::TeLineIndex::value_type(redBoundaryFragments[ti][0], pair<unsigned int, TeLine2D>(boundaryId_, redBoundaryFragments[ti])));
+				++boundaryId_;
+			}
+		}
+
+// escolhe os fragmentos vermelhos que estiverem localizados dentro/fora (dependendo da oparacao) dos poligonos azuis
+		vector<TeLinearRing> rings;
+
+		TeOVERLAY::TeLineIndex fragmentsIndex;
+
+		TeOVERLAY::TeRtreeGetFragments(bluePolsIn[i], blueSegmentTree, redFragments, locationRedFragments, mask, fragmentsIndex, rings);
+
+// inverte a ordem dos pontos de intersecao para fragmentar as linhas azuis
+		TeINTERSECTOR2::TeVectorBoundaryIP::iterator it     = report.begin();
+		TeINTERSECTOR2::TeVectorBoundaryIP::iterator it_end = report.end();
+		
+		while(it != it_end)
+		{
+			swap(it->bluePolNum_, it->redPolNum_);
+			swap(it->bluePartNum_, it->redPartNum_);
+			swap(it->blueSegNum_, it->redSegNum_);
+
+			if(it->coords_.size() == 2)	//overlap
+			{
+				// Verificar se os pontos estao em ordem crescente
+				if(it->coords_[0].x_ < it->coords_[1].x_)
+				{
+				}
+				else if(it->coords_[0].x_ > it->coords_[1].x_)
+				{
+					swap(it->coords_[0], it->coords_[1]);
+				}
+				else if(it->coords_[0].y_ < it->coords_[1].y_)
+				{
+
+				}
+				else
+				{
+					swap(it->coords_[0], it->coords_[1]);							
+				}
+			}
+
+			++it;
+		}
+
+// fragmenta as linhas azuis
+		TeLineSet blueFragments;
+		TeLineSet blueBoundaryFragments;
+		vector<pair<unsigned int, unsigned int> > blueFragmentsIds;
+		boundaryFragmentsIds.clear();
+
+		TeFragmentBoundary(bluePolsIn[i], report, blueBoundaryFragments, boundaryFragmentsIds, blueFragments, blueFragmentsIds);
+
+		report.clear();
+
+		mask  = TeUNKNOWNPOSITION;
+
+// os fragmentos de fronteira ja sao separados
+		if(blueBoundaryFragments.size())
+		{
+			mask = TeBOUNDARY;
+
+			unsigned int boundaryFragmentsSize = blueBoundaryFragments.size();
+
+			for(unsigned int ti = 0; ti < boundaryFragmentsSize; ++ti)
+			{
+				boundaryFragmentsIndex.insert(TeOVERLAY::TeLineIndex::value_type(blueBoundaryFragments[ti][0], pair<unsigned int, TeLine2D>(boundaryId_, blueBoundaryFragments[ti])));
+				++boundaryId_;
+			}
+		}
+
+// escolhe os fragmentos vermelhos que estiverem localizados fora dos poligonos azuis - fragmenta as linhas vermelhas
+		TeRtreeGetFragments(redPolsIn, redSegmentTree, blueFragments, locationBlueFragments, mask, fragmentsIndex, rings);
+
+// libera a memoria usada pelos indice azul
+		blueSegmentTree.clear();
+
+// tenta eliminar fragmentos de fronteira no mesmo sentido, deixando apenas um nesta direcao
+		TeRemoveSameBoundaryFragments(boundaryFragmentsIndex);
+
+// tenta eliminar fragmentos sobre fronteira opostos
+        TeRemoveOpositeBoundaryFragments(boundaryFragmentsIndex);
+
+// faz um merge dos fragmentos de fronteira para o indice de fragmentos normal
+		TeJoinFragments(fragmentsIndex, boundaryFragmentsIndex);
+
+// monta os poligonos a partir dos fragmentos
+		bool returnValue = TeMergeFragments(fragmentsIndex, rings, true);
+
+		// faz o split
+		vector<TeLinearRing> ringsOut;
+
+		bool resultSplit = true;
+
+		if(TeOVERLAY::TeSplitRings(rings, ringsOut) == false)
+		{
+			ringsOut.clear();
+
+			ringsOut = rings;
+
+			resultSplit = false;
+		}
+
+// separate holes from islands
+		vector<TeLinearRing> holes;
+		TePolygonSet polsOut;
+
+		bool result = TeOVERLAY::TeClassifyRings(ringsOut, polsOut, holes);
+
+		returnValue = returnValue && result && resultSplit;
+
+// mount topology		
+		if((polsOut.size() == 0) && (holes.size() == 0))
+		{
+			if(operation == TeUNION)			
+			{
+				resultVec.push_back(false);	// mario - 2006-03
+				resultValue = false;						// uniao nao pode dar vazio
+			}
+			else
+			{
+				resultVec.push_back(returnValue);	// mario - 2006-03
+				resultValue = (resultValue && returnValue);	// Diferenca e intersecao podem retornar vazio
+			}
+
+			vecPolsOut.push_back(polsOut);	// only to mark result			
+		}
+		else
+		{
+			bool mountResult = TeOVERLAY::TeMountTopology(polsOut, holes);
+
+			resultVec.push_back(returnValue && mountResult);	// mario - 2006-03
+
+			resultValue = resultValue && returnValue && mountResult;	
+
+			vecPolsOut.push_back(polsOut);
+		}		
+		
+	}
+
+	redSegmentTree.clear();
+
+	return resultValue;
+}
+
+bool TeOVERLAY::TeIntersection(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy, const bool fixOrientation)
+{
+	return TeOverlay(redPols, bluePols, vecPolsOut, resultVec, TeINTERSECTION, makeCopy, fixOrientation);
+}
+
+bool TeOVERLAY::TeUnion(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy, const bool fixOrientation)
+{
+	return TeOverlay(redPols, bluePols, vecPolsOut, resultVec, TeUNION, makeCopy, fixOrientation);
+}
+
+bool TeOVERLAY::TeDifference(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy, const bool fixOrientation)
+{
+	return TeOverlay(redPols, bluePols, vecPolsOut, resultVec, TeDIFFERENCE, makeCopy, fixOrientation);
+}
+
+// deprecated functions
+bool TeOVERLAY::TeOverlay(const TePolygonSet& redPols, const TePolygonSet& bluePols, TePolygonSet& polsOut, const short& operation)
+{
+	vector<TePolygonSet> bluePolsVec;
+	bluePolsVec.push_back(bluePols);
+	vector<TePolygonSet> resultPols;
+	TePolygonSet redPolsAux = redPols;
+	vector<bool> resultVec;
+
+	bool result = TeOverlay(redPolsAux, bluePolsVec, resultPols, resultVec, operation, true, true);
+
+	if(resultPols.size() > 0)
+		polsOut = resultPols[0];
+
+	return result;	
+}
+
+bool TeOVERLAY::TeUnion(TePolygonSet& redPols, TePolygonSet& bluePols, TePolygonSet& polsOut)
+{
+	return TeOVERLAY::TeOverlay(redPols, bluePols, polsOut, TeUNION);
+}
+
+bool TeOVERLAY::TeIntersection(const TePolygonSet& redPols, const TePolygonSet& bluePols, TePolygonSet& polsOut)
+{
+	return TeOVERLAY::TeOverlay(redPols, bluePols, polsOut, TeINTERSECTION);
+}
+
+bool TeOVERLAY::TeDifference(TePolygonSet& redPols, TePolygonSet& bluePols, TePolygonSet& polsOut)
+{
+	return TeOVERLAY::TeOverlay(redPols, bluePols, polsOut, TeDIFFERENCE);
+}
+
+TeMultiGeometry TeOverlay(const TeLineSet& redLinesIn, const TePolygonSet& bluePolsIn, TeINTERSECTOR2::TeSegmentRTree& blueTree, const short& operation)
+{
+//	short location = TeUNKNOWNPOSITION;
+	short locationRedFragments = TeUNKNOWNPOSITION;
+	short locationBlueFragments = TeUNKNOWNPOSITION;
+
+	TeMultiGeometry mGeom;
+
+	TeLineSet redLines;
+	TePolygonSet bluePols;
+
+// copia o conteudo das linhas de entrada
+	redLines.copyElements(redLinesIn);
+
+// copia o conteudo dos poligonos de entrada
+	bluePols.copyElements(bluePolsIn);
+
+// determina a localizacao dos fragmentos que serao utilizados
+	TeOVERLAY::TeChooseBoundaryLocation(operation, locationRedFragments, locationBlueFragments);
+
+// gets intersection list
+	TeINTERSECTOR2::TeVectorBoundaryIP report;
+
+	TeINTERSECTOR2::TeIntersection(redLines, bluePols, blueTree, report);
+
+// fragment lines
+	TeLineSet redFragments;
+	TeLineSet redBoundaryFragments;
+	
+    TeFragmentBoundary(redLines, report, redBoundaryFragments, redFragments);
+
+// choose red fragments
+	vector<TeLinearRing> rings;
+
+	TeOVERLAY::TeLineIndex fragmentsIndex;
+
+	short mask = 0;
+
+	TeRtreeGetFragments(bluePols, blueTree, redFragments, locationRedFragments, mask, fragmentsIndex, rings);
+
+// report fragments from red lines
+	TeOVERLAY::TeLineIndex::iterator it = fragmentsIndex.begin();
+
+	while(it != fragmentsIndex.end())
+	{
+		mGeom.addGeometry(it->second.second);
+		++it;
+	}
+
+	unsigned int nrings = rings.size();
+	unsigned int i;
+	for(i = 0; i < nrings; ++i)
+	{
+		mGeom.addGeometry(rings[i]);
+	}
+
+// if the operaton is union, so push bluepols
+
+	if(operation == TeUNION)
+	{							
+		mGeom.setGeometry(bluePols);		
+	}
+
+	return mGeom;
+}
+
+void TeOverlay(vector<TeLineSet>& redLinesIn, const TePolygonSet& bluePolsIn, vector<TeMultiGeometry>& outPutGeoms, const short& operation)
+{
+	TeINTERSECTOR2::TeSegmentRTree blueTree(bluePolsIn.box());
+
+	unsigned int nLines = redLinesIn.size();
+	unsigned int i;
+	for(i = 0; i < nLines; ++i)
+	{
+		TeMultiGeometry mg;
+
+		mg = TeOverlay(redLinesIn[i], bluePolsIn, blueTree, operation);
+
+		outPutGeoms.push_back(mg);        		
+	}
+
+	blueTree.clear();
+
+	return;
+}
+
+// overlay for lines/polygons
+TeMultiGeometry TeOVERLAY::TeOverlay(const TeLineSet& redLinesIn, const TePolygonSet& bluePolsIn, const short& operation)
+{
+	vector<TeMultiGeometry> mgeoms;
+	vector<TeLineSet> redLines;
+	redLines.push_back(redLinesIn);
+	TeMultiGeometry outputGeom;
+
+	::TeOverlay(redLines, bluePolsIn, mgeoms, operation);
+
+	if(mgeoms.empty())
+		return outputGeom;
+
+	outputGeom = mgeoms[0];
+
+	return outputGeom;
+}
+
+TeMultiGeometry TeOVERLAY::TeUnion(TeLineSet& redLines, TePolygonSet& bluePols)
+{
+	return TeOVERLAY::TeOverlay(redLines, bluePols, TeUNION);
+}
+
+TeMultiGeometry TeOVERLAY::TeIntersection(TeLineSet& redLines, TePolygonSet& bluePols)
+{
+	return TeOVERLAY::TeOverlay(redLines, bluePols, TeINTERSECTION);
+}
+
+TeMultiGeometry TeOVERLAY::TeDifference(TeLineSet& redLines, TePolygonSet& bluePols)
+{
+	return TeOVERLAY::TeOverlay(redLines, bluePols, TeDIFFERENCE);
+}
+
+bool TeOVERLAY::TePairUnion(TePolygonSet& psetIn, TePolygonSet& psetOut)
+{
+	psetOut.clear();
+
+	vector<TePolygonSet> outPutSet;
+	unsigned int i;
+	for(i = 0; i < psetIn.size(); ++i)
+	{
+		TePolygonSet pset;
+		pset.add(psetIn[i]);
+		outPutSet.push_back(pset);
+	}
+
+	unsigned int outsize = outPutSet.size();
+
+	bool resultUnion = true;
+
+	while(outsize > 1)
+	{
+// une dois a dois
+		unsigned int auxsize = 0;
+		unsigned int i;
+		for(i = 0; i < outsize; i += 2)
+		{
+			TePolygonSet psRed = outPutSet[i];
+			if((i + 1) < outsize)
+			{
+				TePolygonSet psBlue = outPutSet[i+1];
+				TePolygonSet psUnidoAgregado;
+				resultUnion = resultUnion && TeOVERLAY::TeUnion(psRed, psBlue, psUnidoAgregado);
+				if(psUnidoAgregado.size() > 0)
+				{
+					outPutSet[auxsize] = psUnidoAgregado;
+					++auxsize;
+				}
+			}
+			else
+			{
+				outPutSet[auxsize] = psRed;
+				++auxsize;
+			}			
+		}
+
+		outsize = auxsize;
+	}
+
+	for(unsigned int i = 0; i < outsize; ++i)
+		for(unsigned int j = 0; j < outPutSet[i].size(); ++j)		
+			psetOut.add(outPutSet[i][j]);
+
+	return resultUnion;
+}
+
+bool TeOVERLAY::TeValidPolygonHoles(TePolygon& polygon, TePolygonSet& psValid)
+{
+	string objectId = polygon.objectId();
+	int geomId = polygon.geomId();
+
+	psValid.clear();
+
+	if(polygon.size() == 0)
+		return false;
+
+	if(polygon.size() == 1)
+	{	
+		TePolygon paux;
+		paux.copyElements(polygon);
+		paux.geomId(geomId);
+		paux.objectId(objectId);
+		psValid.add(paux);
+		return true;
+	}
+
+	TePolygon fixedPolygon;
+	fixedPolygon.add(polygon[0]);
+				
+//adiciona todos os buracos em um TePolygonSet
+	TePolygonSet psHoles;
+	unsigned int i;
+	for(i = 1; i < polygon.size(); i++)
+	{
+		TePolygon hole;
+		hole.add(polygon[i]);
+
+		psHoles.add(hole);
+	}
+
+//faz a uniao dos buracos
+	TePolygonSet psOut;	
+	if(!TeOVERLAY::TeUnion(psHoles, psOut))
+		return false;
+
+	psHoles = TePolygonSet();
+	psHoles.copyElements(psOut);
+	psOut = TePolygonSet();
+
+//faz a diferenca entre o poligono original e a uniao dos seus buracos 
+	TePolygonSet psTemp;
+	psTemp.add(fixedPolygon);
+
+	if(!TeOVERLAY::TeDifference(psTemp, psHoles, psOut))
+		return false;
+		
+	for(i = 0; i < psOut.size(); i++)
+	{
+		psOut[i].geomId(geomId);
+		psOut[i].objectId(objectId);
+		psValid.add(psOut[i]);
+	}
+
+	return true;
+}
+
+bool TeOVERLAY::TeValidPolygonHoles(TePolygonSet& polygons, TePolygonSet& psValid)
+{
+	psValid.clear();
+	unsigned int i, j;
+    for(i = 0; i < polygons.size(); ++i)
+	{
+// do valid for each polygon
+        TePolygon pol = polygons[i];
+
+        TePolygonSet psAux;
+
+        if(TeValidPolygonHoles(pol, psAux))
+		{
+			for(j = 0; j < psAux.size(); ++j)
+			{
+				psValid.add(psAux[j]);
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	return true;
+}
+
diff --git a/src/terralib/kernel/TeOverlay.h b/src/terralib/kernel/TeOverlay.h
old mode 100755
new mode 100644
index 2664f85..ed4024e
--- a/src/terralib/kernel/TeOverlay.h
+++ b/src/terralib/kernel/TeOverlay.h
@@ -1,214 +1,214 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeOverlay.h
-    \brief This file contains structures and definitions for set operation on polygons.
-	\author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
- */
-
-#ifndef  __TERRALIB_INTERNAL_OVERLAY_H
-#define  __TERRALIB_INTERNAL_OVERLAY_H
-
-#include "TeMultiGeometry.h"
-
-/**
- * @brief Contains structures and definitions needed to execute Set Operations for polygons and lines (union, intersection e difference).
- */
-
-namespace TeOVERLAY
-{	
-/** @defgroup SetOperations Set Operations
- *  Set operations for polygons and lines: intersection, union or difference.
- *  @{
- */
-
-/** \brief Executes one of the possible Set Operations on polygons. 
-    \param redPols		The first list of disjoint polygons (and without self-intersections).
-	\param bluePols		The second list of disjoint polygons (and without self-intersections).
-	\param polsOut		The polygon list from the operation result.
-	\param operation	Type of operation: TeUNION, TeINTERSECTION or TeDIFFERENCE.
-	\return				True if the operation success and false if an error has ocurried.
-	
-	\note Each polygon list must have disjoint polygons, otherwise, the result is undefined. This function must not be called directly,
-	      instead of call it, choose a specific function below, because, this signature is deprecated and will change in near future.
-*/
-TL_DLL bool TeOverlay(const TePolygonSet& redPols, const TePolygonSet& bluePols, TePolygonSet& polsOut, const short& operation);
-
-/** \brief Calculates the union Set Operation for polygons.
-    \param redPols		The first list of disjoint polygons (and without self-intersections).
-	\param bluePols		The second list of disjoint polygons (and without self-intersections).
-	\param polsOut		The polygon list from the operation result.
-	\return				True if the operation success and false if an error has ocurried.
-
-*/
-TL_DLL bool TeUnion(TePolygonSet& redPols, TePolygonSet& bluePols, TePolygonSet& polsOut);
-
-
-/** \brief Calculates the  intersection Set Operation for polygons.
-    \param redPols      The first list of disjoint polygons (and without self-intersections).
-	\param bluePols		The second list of disjoint polygons (and without self-intersections).
-	\param polsOut      The polygon list from the operation result.
-	\return				True if the operation success and false if an error has ocurried.
-
-*/
-TL_DLL bool TeIntersection(const TePolygonSet& redPols, const TePolygonSet& bluePols, TePolygonSet& polsOut);
-
-
-/** \brief Calculates the difference set operation for polygons (redPols minus bluePols).
-    \param redPols      The first list of disjoint polygons (and without self-intersections).
-	\param bluePols		The second list of disjoint polygons (and without self-intersections).
-	\param polsOut      The polygon list from the operation result.
-	\return				True if the operation success and false if an error has ocurried.
-
-*/
-TL_DLL bool TeDifference(TePolygonSet& redPols, TePolygonSet& bluePols, TePolygonSet& polsOut);
-
-
-/** \brief Executes one of the possible Set Operations for lines and polygons. 
-    \param redLines		A disjoint line list (and without self-intersections).
-	\param bluePols		A list of disjoint polygons (and without self-intersections).
-	\param operation    Type of operation: TeUNION, TeINTERSECTION or TeDIFFERENCE.
-	\return				A geometry that can contains only lines on intersection and difference cases, and lines + polygons on union case.
-
-	\note This function must not be called directly, instead of call it, choose a specific function below,
-	      because, this signature is deprecated and will change in near future.
-
-*/
-TL_DLL TeMultiGeometry TeOverlay(const TeLineSet& redLines, const TePolygonSet& bluePols, const short& operation);
-
-
-/** \brief Calculates the union set operation for lines and polygons.
-    \param redLines     A disjoint line list (and without self-intersections).
-	\param bluePols		A list of disjoint polygons (and without self-intersections).
-	\return				A geometry formed by lines and polygons or only by polygons.
-
-*/
-TL_DLL TeMultiGeometry TeUnion(TeLineSet& redLines, TePolygonSet& bluePols);
-
-
-/** \brief Calculates the intersection set operation for lines and polygons.
-    \param redLines     A disjoint line list (and without self-intersections).
-	\param bluePols		A list of disjoint polygons (and without self-intersections).
-	\return				A geometry formed only by lines or empty.
-
-*/
-TL_DLL TeMultiGeometry TeIntersection(TeLineSet& redLines, TePolygonSet& bluePols);
-
-
-/** \brief Calculates the defference set operation for lines and polygons.
-    \param redLines     A disjoint line list (and without self-intersections).
-	\param bluePols		A list of disjoint polygons (and without self-intersections).
-	\return				A geometry formed only by lines or empty.
-
-*/
-TL_DLL TeMultiGeometry TeDifference(TeLineSet& redLines, TePolygonSet& bluePols);
-
-
-/** \brief Calculates the union of all polygons passed in polsIn parameter, and returns a polygon set (polsOut).
-    \param polsIn            A list of polygons, may have overlap (disjoint or not).
-	\param polsOut           Where the union will be stored.
-	\param makeCopy          If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
-	\param fixOrientation    If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).
-*/
-TL_DLL bool TeUnion(TePolygonSet& polsIn, TePolygonSet& polsOut, const bool& makeCopy = true, const bool fixOrientation = true);
-
-
-/** \brief Calculates the intersection set operation for polygons. This version of intersection will reuse some pre-processing of redPols, and will do intersection between redPols and each polygonset in bluePols vector. The result of each individual operation (redPols x a polygonset from the blue vector) will be store in the output vector in the same order of polygonsets in bluePols. If an intersection is empty, an empty polygonset will be stored to indicate this.
-    \param redPols			A list of disjoint polygons (and without self-intersections) used as a mask to cut each polygonset in bluePols vector.
-	\param bluePols			A vector that contains polygonsets that will be individually cutted by redPols, and each blue polygonset must be disjoint (and without self-intersections).
-	\param vecPolsOut       A vector with the result of intersection between redPols and each polygonset in the blue polygonset vector.
-	\param resultVec        A vector of bool that tells if individual intersection succeed or not.
-	\param makeCopy         If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
-	\param fixOrientation   If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).
-	\return				True if the operation success and false if an error has ocurried.
-
-	\note The output vector may contains polygonsets thar are empty, only to indicate that intersection was empty, so be carefull.
-
-*/
-TL_DLL bool TeIntersection(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy = true, const bool fixOrientation = true);
-
-
-/** \brief Calculates the union set operation for polygons.
-           This version of union will reuse some pre-processing of redPols,
-		   and will do union between redPols and each polygonset in bluePols.
-		   The result of each individual operation (redPols x a polygonset from the blue vector)
-		   will be store in the output vector in the same order of polygonsets in bluePols.
-    \param redPols			A list of disjoint polygons (and without self-intersections) used as a mask to cut each polygonset in bluePols vector.
-	\param bluePols			A vector that contains polygonsets that will be individually cutted by redPols, and each blue polygonset must be disjoint (and without self-intersections).
-	\param vecPolsOut       A vector with the result of union between redPols and each polygonset in the blue polygonset vector.
-	\param resultVec        A vector of bool that tells if individual intersection succeed or not.
-	\param makeCopy         If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
-	\param fixOrientation   If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).
-	\return				True if the operation success and false if an error has ocurried.
-*/
-TL_DLL bool TeUnion(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy = true, const bool fixOrientation = true);
-
-
-/** \brief Calculates the difference set operation for polygons.
-           This version of difference will reuse some pre-processing of redPols,
-		   and will do difference between redPols and each polygonset in bluePols vector.
-		   The result of each individual operation (redPols x a polygonset from the blue vector)
-		   will be store in the output vector in the same order of polygonsets in bluePols.
-		   If an intersection is empty, an empty polygonset will be stored to indicate this.
-    \param redPols			A list of disjoint polygons (and without self-intersections) used as a mask to cut each polygonset in bluePols vector.
-	\param bluePols			A vector that contains polygonsets that will be individually cutted by redPols, and each blue polygonset must be disjoint (and without self-intersections).
-	\param vecPolsOut       A vector with the result of differnce between redPols and each polygonset in the blue polygonset vector.
-	\param resultVec        A vector of bool that tells if individual intersection succeed or not.
-	\param makeCopy         If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
-	\param fixOrientation   If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).
-	\return				True if the operation success and false if an error has ocurried.
-
-	\note The output vector may contains polygonsets thar are empty, only to indicate that intersection was empty, so be carefull.
-*/
-TL_DLL bool TeDifference(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy = true, const bool fixOrientation = true);
-
-/** \brief Calculates the union of all polygons passed in polsIn parameter,
-           and returns a polygon set (polsOut).
-	       This type of union use a different strategy from the
-		   previous one: do union for each pair and
-		   then repeat until we have only two pairs.
-    \param psetIn            A list of polygons, may have overlap (disjoint or not).
-	\param psetOut           Where the union will be stored.
- */
-TL_DLL bool TePairUnion(TePolygonSet& psetIn, TePolygonSet& psetOut);
-
-/** \brief Valid polygon holes: if they have a commom edge,
-           they will be joined (THIS IS FOR INTERNAL USE ONLY).
-	\param  polygon		The polygon to check holes.
-	\param  psValid		The result polygon.
-	\return				Returns true if the operation successed otherwise returns false.
- */
-TL_DLL bool TeValidPolygonHoles(TePolygon& polygon, TePolygonSet& psValid);
-
-/** \brief Valid polygon holes: if they have a commom edge, they will be joined (THIS IS FOR INTERNAL USE ONLY).
-	\param  polygons	The polygons to check holes.
-	\param  psValid		The result polygon.
-	\return				Returns true if the operation successed otherwise returns false.
- */
-TL_DLL bool TeValidPolygonHoles(TePolygonSet& polygons, TePolygonSet& psValid);
-
-/** @} */ 
-
-}	// end namespace TeOVERLAY
-
-#endif //__TERRALIB_INTERNAL_OVERLAY_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeOverlay.h
+    \brief This file contains structures and definitions for set operation on polygons.
+	\author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+ */
+
+#ifndef  __TERRALIB_INTERNAL_OVERLAY_H
+#define  __TERRALIB_INTERNAL_OVERLAY_H
+
+#include "TeMultiGeometry.h"
+
+/**
+ * @brief Contains structures and definitions needed to execute Set Operations for polygons and lines (union, intersection e difference).
+ */
+
+namespace TeOVERLAY
+{	
+/** @defgroup SetOperations Set Operations
+ *  Set operations for polygons and lines: intersection, union or difference.
+ *  @{
+ */
+
+/** \brief Executes one of the possible Set Operations on polygons. 
+    \param redPols		The first list of disjoint polygons (and without self-intersections).
+	\param bluePols		The second list of disjoint polygons (and without self-intersections).
+	\param polsOut		The polygon list from the operation result.
+	\param operation	Type of operation: TeUNION, TeINTERSECTION or TeDIFFERENCE.
+	\return				True if the operation success and false if an error has ocurried.
+	
+	\note Each polygon list must have disjoint polygons, otherwise, the result is undefined. This function must not be called directly,
+	      instead of call it, choose a specific function below, because, this signature is deprecated and will change in near future.
+*/
+TL_DLL bool TeOverlay(const TePolygonSet& redPols, const TePolygonSet& bluePols, TePolygonSet& polsOut, const short& operation);
+
+/** \brief Calculates the union Set Operation for polygons.
+    \param redPols		The first list of disjoint polygons (and without self-intersections).
+	\param bluePols		The second list of disjoint polygons (and without self-intersections).
+	\param polsOut		The polygon list from the operation result.
+	\return				True if the operation success and false if an error has ocurried.
+
+*/
+TL_DLL bool TeUnion(TePolygonSet& redPols, TePolygonSet& bluePols, TePolygonSet& polsOut);
+
+
+/** \brief Calculates the  intersection Set Operation for polygons.
+    \param redPols      The first list of disjoint polygons (and without self-intersections).
+	\param bluePols		The second list of disjoint polygons (and without self-intersections).
+	\param polsOut      The polygon list from the operation result.
+	\return				True if the operation success and false if an error has ocurried.
+
+*/
+TL_DLL bool TeIntersection(const TePolygonSet& redPols, const TePolygonSet& bluePols, TePolygonSet& polsOut);
+
+
+/** \brief Calculates the difference set operation for polygons (redPols minus bluePols).
+    \param redPols      The first list of disjoint polygons (and without self-intersections).
+	\param bluePols		The second list of disjoint polygons (and without self-intersections).
+	\param polsOut      The polygon list from the operation result.
+	\return				True if the operation success and false if an error has ocurried.
+
+*/
+TL_DLL bool TeDifference(TePolygonSet& redPols, TePolygonSet& bluePols, TePolygonSet& polsOut);
+
+
+/** \brief Executes one of the possible Set Operations for lines and polygons. 
+    \param redLines		A disjoint line list (and without self-intersections).
+	\param bluePols		A list of disjoint polygons (and without self-intersections).
+	\param operation    Type of operation: TeUNION, TeINTERSECTION or TeDIFFERENCE.
+	\return				A geometry that can contains only lines on intersection and difference cases, and lines + polygons on union case.
+
+	\note This function must not be called directly, instead of call it, choose a specific function below,
+	      because, this signature is deprecated and will change in near future.
+
+*/
+TL_DLL TeMultiGeometry TeOverlay(const TeLineSet& redLines, const TePolygonSet& bluePols, const short& operation);
+
+
+/** \brief Calculates the union set operation for lines and polygons.
+    \param redLines     A disjoint line list (and without self-intersections).
+	\param bluePols		A list of disjoint polygons (and without self-intersections).
+	\return				A geometry formed by lines and polygons or only by polygons.
+
+*/
+TL_DLL TeMultiGeometry TeUnion(TeLineSet& redLines, TePolygonSet& bluePols);
+
+
+/** \brief Calculates the intersection set operation for lines and polygons.
+    \param redLines     A disjoint line list (and without self-intersections).
+	\param bluePols		A list of disjoint polygons (and without self-intersections).
+	\return				A geometry formed only by lines or empty.
+
+*/
+TL_DLL TeMultiGeometry TeIntersection(TeLineSet& redLines, TePolygonSet& bluePols);
+
+
+/** \brief Calculates the defference set operation for lines and polygons.
+    \param redLines     A disjoint line list (and without self-intersections).
+	\param bluePols		A list of disjoint polygons (and without self-intersections).
+	\return				A geometry formed only by lines or empty.
+
+*/
+TL_DLL TeMultiGeometry TeDifference(TeLineSet& redLines, TePolygonSet& bluePols);
+
+
+/** \brief Calculates the union of all polygons passed in polsIn parameter, and returns a polygon set (polsOut).
+    \param polsIn            A list of polygons, may have overlap (disjoint or not).
+	\param polsOut           Where the union will be stored.
+	\param makeCopy          If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
+	\param fixOrientation    If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).
+*/
+TL_DLL bool TeUnion(TePolygonSet& polsIn, TePolygonSet& polsOut, const bool& makeCopy = true, const bool fixOrientation = true);
+
+
+/** \brief Calculates the intersection set operation for polygons. This version of intersection will reuse some pre-processing of redPols, and will do intersection between redPols and each polygonset in bluePols vector. The result of each individual operation (redPols x a polygonset from the blue vector) will be store in the output vector in the same order of polygonsets in bluePols. If an intersection is empty, an empty polygonset will be stored to indicate this.
+    \param redPols			A list of disjoint polygons (and without self-intersections) used as a mask to cut each polygonset in bluePols vector.
+	\param bluePols			A vector that contains polygonsets that will be individually cutted by redPols, and each blue polygonset must be disjoint (and without self-intersections).
+	\param vecPolsOut       A vector with the result of intersection between redPols and each polygonset in the blue polygonset vector.
+	\param resultVec        A vector of bool that tells if individual intersection succeed or not.
+	\param makeCopy         If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
+	\param fixOrientation   If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).
+	\return				True if the operation success and false if an error has ocurried.
+
+	\note The output vector may contains polygonsets thar are empty, only to indicate that intersection was empty, so be carefull.
+
+*/
+TL_DLL bool TeIntersection(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy = true, const bool fixOrientation = true);
+
+
+/** \brief Calculates the union set operation for polygons.
+           This version of union will reuse some pre-processing of redPols,
+		   and will do union between redPols and each polygonset in bluePols.
+		   The result of each individual operation (redPols x a polygonset from the blue vector)
+		   will be store in the output vector in the same order of polygonsets in bluePols.
+    \param redPols			A list of disjoint polygons (and without self-intersections) used as a mask to cut each polygonset in bluePols vector.
+	\param bluePols			A vector that contains polygonsets that will be individually cutted by redPols, and each blue polygonset must be disjoint (and without self-intersections).
+	\param vecPolsOut       A vector with the result of union between redPols and each polygonset in the blue polygonset vector.
+	\param resultVec        A vector of bool that tells if individual intersection succeed or not.
+	\param makeCopy         If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
+	\param fixOrientation   If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).
+	\return				True if the operation success and false if an error has ocurried.
+*/
+TL_DLL bool TeUnion(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy = true, const bool fixOrientation = true);
+
+
+/** \brief Calculates the difference set operation for polygons.
+           This version of difference will reuse some pre-processing of redPols,
+		   and will do difference between redPols and each polygonset in bluePols vector.
+		   The result of each individual operation (redPols x a polygonset from the blue vector)
+		   will be store in the output vector in the same order of polygonsets in bluePols.
+		   If an intersection is empty, an empty polygonset will be stored to indicate this.
+    \param redPols			A list of disjoint polygons (and without self-intersections) used as a mask to cut each polygonset in bluePols vector.
+	\param bluePols			A vector that contains polygonsets that will be individually cutted by redPols, and each blue polygonset must be disjoint (and without self-intersections).
+	\param vecPolsOut       A vector with the result of differnce between redPols and each polygonset in the blue polygonset vector.
+	\param resultVec        A vector of bool that tells if individual intersection succeed or not.
+	\param makeCopy         If true, before to start the union process a copy will be done for all coordinates, otherwise, the rings and coordinates of the input polygon will be used and so, the input can be invalidate (because of handle/body share of implementaton) bu this will save some memory.
+	\param fixOrientation   If true, the ring orientation is checked, otherwise, it is assumed that they are in correct order of processing (you may set to false only if you know implementation details otherwise an error may occur).
+	\return				True if the operation success and false if an error has ocurried.
+
+	\note The output vector may contains polygonsets thar are empty, only to indicate that intersection was empty, so be carefull.
+*/
+TL_DLL bool TeDifference(TePolygonSet& redPols, vector<TePolygonSet>& bluePols, vector<TePolygonSet>& vecPolsOut, vector<bool>& resultVec, const bool& makeCopy = true, const bool fixOrientation = true);
+
+/** \brief Calculates the union of all polygons passed in polsIn parameter,
+           and returns a polygon set (polsOut).
+	       This type of union use a different strategy from the
+		   previous one: do union for each pair and
+		   then repeat until we have only two pairs.
+    \param psetIn            A list of polygons, may have overlap (disjoint or not).
+	\param psetOut           Where the union will be stored.
+ */
+TL_DLL bool TePairUnion(TePolygonSet& psetIn, TePolygonSet& psetOut);
+
+/** \brief Valid polygon holes: if they have a commom edge,
+           they will be joined (THIS IS FOR INTERNAL USE ONLY).
+	\param  polygon		The polygon to check holes.
+	\param  psValid		The result polygon.
+	\return				Returns true if the operation successed otherwise returns false.
+ */
+TL_DLL bool TeValidPolygonHoles(TePolygon& polygon, TePolygonSet& psValid);
+
+/** \brief Valid polygon holes: if they have a commom edge, they will be joined (THIS IS FOR INTERNAL USE ONLY).
+	\param  polygons	The polygons to check holes.
+	\param  psValid		The result polygon.
+	\return				Returns true if the operation successed otherwise returns false.
+ */
+TL_DLL bool TeValidPolygonHoles(TePolygonSet& polygons, TePolygonSet& psValid);
+
+/** @} */ 
+
+}	// end namespace TeOVERLAY
+
+#endif //__TERRALIB_INTERNAL_OVERLAY_H
+
diff --git a/src/terralib/kernel/TeOverlayUtils.cpp b/src/terralib/kernel/TeOverlayUtils.cpp
old mode 100755
new mode 100644
index d6f0467..cdb2a08
--- a/src/terralib/kernel/TeOverlayUtils.cpp
+++ b/src/terralib/kernel/TeOverlayUtils.cpp
@@ -1,1222 +1,1222 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeOverlayUtils.h"
-#include "TeGeometryAlgorithms.h"
-
-//---------------- Auxiliary operations for overlay ----------------//
-
-inline void TeOverlayMiddle(const TeCoord2D& c1, const TeCoord2D& c2, TeCoord2D& m)
-{
-	m.x_ = ((c1.x_ + c2.x_) / 2.0);
-	m.y_ = ((c1.y_ + c2.y_) / 2.0);
-}
-
-// Verifies orientation for each line of polygon set, and reverse the orientation if need
-void TeOVERLAY::TeFixOrientation(TePolygonSet& polSet, const short& outerOrientationToReverse, const short& innerOrientationToReverse)
-{
-	unsigned int polSetSize = polSet.size();
-
-	for(unsigned int i = 0; i < polSetSize; ++i)
-	{
-		if(TeOrientation(polSet[i][0]) == outerOrientationToReverse)
-			reverse(polSet[i][0].begin(), polSet[i][0].end());
-
-		unsigned int polSize = polSet[i].size();
-
-		for(unsigned int j = 1; j < polSize; ++j)
-		{
-			if(TeOrientation(polSet[i][j]) == innerOrientationToReverse)
-				reverse(polSet[i][j].begin(), polSet[i][j].end());
-		}
-	}
-}
-
-// For each operation (union, intersection and difference) defines location for retrieval of fragments
-void TeOVERLAY::TeChooseBoundaryLocation(const short& operation, short& locationRedFragments, short& locationBlueFragments)
-{
-	switch(operation)
-	{							
-// intersection: gets all fragments from red polygon wich are
-// inside the blue polygon and the blue fragments that are inside
-// the red polygon.
-		case TeINTERSECTION:  locationRedFragments  = TeINSIDE;
-			                  locationBlueFragments = TeINSIDE;
-							  break;
-
-// union: gets all fragments from red polygon wich are
-// outside the blue polygon and the blue fragments that are outside
-// the red polygon.
-		case TeUNION:         locationRedFragments  = TeOUTSIDE;
-			                  locationBlueFragments = TeOUTSIDE;
-							  break;
-
-// difference: gets all fragments from red polygon wich are
-// outside the blue polygon and the blue fragments that are inside
-// the red polygon.
-		case TeDIFFERENCE:	  locationRedFragments  = TeOUTSIDE;
-			                  locationBlueFragments = TeINSIDE;
-		                      break;
-	}
-}
-
-// Erases from fragmentsIndex boundary fragments that are in oposite direction: each fragment must have a unique identifier in the pair first field (pair<unsigned int, TeLine2D>)
-void TeOVERLAY::TeRemoveOpositeBoundaryFragments(TeLineIndex& fragmentsIndex)
-{
-	TeLineIndex::iterator indexIterator = fragmentsIndex.begin();
-	
-	while(indexIterator != fragmentsIndex.end())
-	{
-		pair<TeLineIndex::iterator, TeLineIndex::iterator> its = fragmentsIndex.equal_range(indexIterator->second.second[(indexIterator->second.second.size() - 1u)]);
-
-		bool eraseOwn = false;
-
-        while(its.first != its.second)
-		{
-// Se nao achei o proprio fragmento, entao posso ver se e possivel apagar
-			if(its.first->second.first != indexIterator->second.first)
-			{
-				if(TeEquals(its.first->second.second[its.first->second.second.size() - 1u], indexIterator->second.second[0u]))
-				{
-					TeLineIndex::iterator idxAux2 = its.first;
-					++(its.first);
-					fragmentsIndex.erase(idxAux2);
-
-					eraseOwn = true;
-				}
-				else
-				{
-					++(its.first);
-				}
-			}
-			else
-			{
-				++(its.first);
-			}
-		}
-
-		if(eraseOwn)
-		{
-			fragmentsIndex.erase(indexIterator);
-			indexIterator = fragmentsIndex.begin();
-		}
-		else
-		{
-			++indexIterator;
-		}
-	}
-}
-
-// Erases from fragmentsIndex boundary fragments that are equals to another boundary fragment
-void TeOVERLAY::TeRemoveSameBoundaryFragments(TeLineIndex& fragmentsIndex)
-{
-	TeLineIndex::iterator indexIterator = fragmentsIndex.begin();
-	
-	while(indexIterator != fragmentsIndex.end())
-	{
-		pair<TeLineIndex::iterator, TeLineIndex::iterator> its = fragmentsIndex.equal_range(indexIterator->second.second[0u]);
-
-        while(its.first != its.second)
-		{
-// Se nao achei o proprio fragmento, entao posso ver se e possivel apagar
-			if(its.first->second.first != indexIterator->second.first)
-			{
-				if(TeEquals(its.first->second.second[its.first->second.second.size() - 1u], indexIterator->second.second[indexIterator->second.second.size() - 1u]))
-				{
-					TeLineIndex::iterator idxAux2 = its.first;
-					++(its.first);
-					fragmentsIndex.erase(idxAux2);
-				}
-				else
-				{
-					++(its.first);
-				}
-			}
-			else
-			{
-				++(its.first);
-			}
-		}
-
-		++indexIterator;
-	}
-}
-
-// Merge fragments ito first index (fragmentsIndex)
-void TeOVERLAY::TeJoinFragments(TeLineIndex& fragmentsIndex, TeLineIndex& boundaryFragmentsIndex)
-{
-	TeLineIndex::iterator indexIterator = boundaryFragmentsIndex.begin();
-
-	while(indexIterator != boundaryFragmentsIndex.end())
-	{
-		fragmentsIndex.insert(*indexIterator);
-		++indexIterator;
-	}
-
-	boundaryFragmentsIndex.clear();	
-}
-
-// Moves closed rings from fragmentsIndex to rins vector
-void TeOVERLAY::TeFindAndMoveClosedRings(TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings)
-{
-	TeLineIndex::iterator indexIterator = fragmentsIndex.begin();
-
-	while(indexIterator != fragmentsIndex.end())
-	{
-		if(indexIterator->second.second.isRing())
-		{
-			rings.push_back(indexIterator->second.second);
-
-			TeLineIndex::iterator idxAux;
-			idxAux = indexIterator;
-			++indexIterator;
-			fragmentsIndex.erase(idxAux);
-		}
-		else
-			++indexIterator;
-	}
-}
-
-// Gets a polygonset with outer rings and a vector with holes and try to find to what polygon the hole belongs to
-bool TeOVERLAY::TeMountTopology(TePolygonSet& polysOut, vector<TeLinearRing>& holes)
-{
-	bool returnValue = true;
-
-	if((polysOut.size() == 0) && (holes.size() > 0))
-	{
-// Formou buracos e nao formou os aneis externos
-		return false;	
-	}
-
-	if(polysOut.size() == 1)
-	{
-		for(unsigned int i = 0; i < holes.size(); ++i)
-			polysOut[0].add(holes[i]);		
-	}
-	else
-	{
-		for(unsigned int i = 0; i < holes.size(); ++i)
-		{
-			TeLinearRing ring = holes[i];
-
-			vector<TePolygon> candidates;
-			vector<unsigned int> candidatesPos;
-
-			unsigned int j = 0;
-
-			for(j = 0; j < polysOut.size(); ++j)
-			{
-				if(TeWithinOrCoveredByOrEquals(ring.box(), polysOut[j].box()))
-				{
-					candidates.push_back(polysOut[j]);
-					candidatesPos.push_back(j);
-				}
-			}
-
-			if(candidates.size() == 1)
-			{
-				candidates[0].add(ring);
-				continue;
-			}
-
-			vector<TePolygon> newCandidates;
-
-			for(j = 0; j < candidates.size(); ++j)
-			{
-				short rel = TeBOUNDARY;
-
-				unsigned int nthVert = ring.size();
-				unsigned int iVert = 0u;
-
-				while(iVert < nthVert)
-				{
-					rel = TeRelation(ring[iVert], candidates[j][0]);
-
-					if(rel & TeINSIDE)
-					{				
-						newCandidates.push_back(candidates[j]);
-						break;
-					}
-					else if(rel & TeOUTSIDE)
-					{
-						break;
-					}
-				
-					++iVert;
-				}
-
-				if(iVert == nthVert)	
-				{
-// Topologycal error: every point is on ring boundary...
-					returnValue = false;
-
-					TePolygon topTest;
-					topTest.add(ring);
-
-					short whatRel = TeRelation(topTest, candidates[j]);
-
-// Se um buraco for igual ao exterior, existe um erro topologico
-// No momento, eliminamos o anel externo
-// e o interno... 
-// Se o buraco for coberto pelo poligono externo, entao ele ira ficar dentro deste
-// Caso contrario e erro sem possibilidades...
-					if(whatRel & TeEQUALS)
-					{						
-						polysOut.erase(candidatesPos[j]);
-						continue;
-					}
-				}				
-			}
-
-			if(newCandidates.size() <= 0)
-			{
-// Didn't find outer ring to this hole.
-				returnValue = false;
-				continue;
-			}
-
-			int idxMinArea = 0;
-			
-			double minArea = TeMAXFLOAT;
-
-			for(j = 0; j < newCandidates.size(); ++j)
-			{
-				if(TeGeometryArea(newCandidates[j].box()) < minArea)
-				{
-					idxMinArea = j;
-					minArea = TeGeometryArea(newCandidates[j].box());
-				}
-			}
-
-			newCandidates[idxMinArea].add(ring);
-		}
-	}
-
-	return returnValue;
-}
-
-// faz a tentativa ingenua!
-bool TeMergeFragmentsFB(TeOVERLAY::TeLineIndex& fragmentsIndex, TeLine2D& line)
-{
-	TeCoord2D endLineCoordinate = line[line.size() - 1];
-
-	TeOVERLAY::TeLineIndex::iterator indexIterator  = fragmentsIndex.begin();
-
-	while(indexIterator != fragmentsIndex.end())
-	{
-		if(TeEquals(endLineCoordinate, indexIterator->second.second[0]))
-		{
-			for(unsigned int i = 1; i < indexIterator->second.second.size(); ++i)
-				line.add(indexIterator->second.second[i]);
-
-			line.setBox(::TeUnion(line.box(), indexIterator->second.second.box()));
-			fragmentsIndex.erase(indexIterator);
-
-			return true;
-		}
-
-		++indexIterator;
-	}
-
-	return false;
-}
-
-// Make polygons from fragments.
-bool TeOVERLAY::TeMergeFragments(TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings, const bool& doExaustive)
-{
-	bool returnValue = true;
-
-	TeLine2D  lAux;	
-	TeCoord2D endLineCoordinate;
-
-	while(!(fragmentsIndex.empty()))
-	{
-		if(lAux.size() == 0)
-		{
-			TeLineIndex::iterator indexIterator  = fragmentsIndex.begin();
-			
-			if(indexIterator != fragmentsIndex.end())
-			{
-				if(indexIterator->second.second.isRing())
-				{
-					rings.push_back(indexIterator->second.second);
-					fragmentsIndex.erase(indexIterator);
-					continue;
-				}
-				
-				for(unsigned int i = 0; i < indexIterator->second.second.size(); ++i)
-					lAux.add(indexIterator->second.second[i]);
-
-				lAux.setBox(::TeUnion(lAux.box(), indexIterator->second.second.box()));
-
-				fragmentsIndex.erase(indexIterator);
-			}
-			else
-			{
-                returnValue = false;	//Nao poderia vir aqui, deveria ter saido no teste do laco!!
-			}
-		}	
-		else
-		{
-			endLineCoordinate = lAux[lAux.size() - 1];
-
-			// Try to find the beginning of the next fragment that is part of the polygon in the same list
-			TeLineIndex::iterator indexIterator = fragmentsIndex.find(endLineCoordinate);
-
-			if(indexIterator != fragmentsIndex.end())
-			{
-				for(unsigned int i = 1; i < indexIterator->second.second.size(); ++i)
-					lAux.add(indexIterator->second.second[i]);
-
-				lAux.setBox(::TeUnion(lAux.box(), indexIterator->second.second.box()));
-				fragmentsIndex.erase(indexIterator);
-			}			
-			else
-			{
-				if(doExaustive)
-				{
-					if(!TeMergeFragmentsFB(fragmentsIndex, lAux))
-					{
-	// Nao foi achada continuacao para a linha: nao fechou!
-						returnValue = false;	// Erro na topologia dos poligonos
-
-						// Clear auxiliary.
-						TeLine2D emptyLine;
-						lAux = emptyLine;
-					}
-				}
-				else
-				{
-					// Nao foi achada continuacao para a linha: nao fechou!
-					returnValue = false;	// Erro na topologia dos poligonos
-
-					// Clear auxiliary.
-					TeLine2D emptyLine;
-					lAux = emptyLine;
-				}
-			}
-			
-		}
-
-		if(lAux.isRing())
-		{  
-			// Add polygon
-			rings.push_back(TeLinearRing(lAux));
-			
-			// Clear auxiliary.
-			TeLine2D emptyLine;					
-			lAux = emptyLine;
-		}
-	}
-
-	if(lAux.size() > 0)
-		returnValue = false;	// Erro, alguma linha nao fechou!!!
-
-	return returnValue;
-}
-
-// For each linear ring, see it's orientation and classify in outer or inner ring
-bool TeOVERLAY::TeClassifyRings(vector<TeLinearRing>& rings, TePolygonSet& polsOut, vector<TeLinearRing>& holes)
-{
-	bool returnValue = true;
-
-	for(unsigned int z = 0; z < rings.size(); ++z)
-	{
-		short ori = TeOrientation(rings[z]);
-
-		if(ori == TeCOUNTERCLOCKWISE)	// It is a hole
-		{
-			holes.push_back(rings[z]);			// add to holes list
-		}
-		else if(ori == TeCLOCKWISE)		// else if island
-		{										// create a polygon
-			TePolygon p;
-			p.add(rings[z]);
-			polsOut.add(p);
-		}
-		else	
-		{
-			returnValue = false;	// Objeto sem area? Isso e um erro!
-		}
-	}
-
-	return returnValue;
-}
-
-// Seleciona os fragmentos quando existem dois conjuntos distintos: vermelho e azul
-void TeOVERLAY::TeRtreeGetFragments(const TePolygonSet& bluePolygons, TeINTERSECTOR2::TeSegmentRTree& blueTree, TeLineSet& redFragments, const short& locationFragments, short& mask, TeLineIndex& redFragmentsIndex, vector<TeLinearRing>& rings)
-{
-	//unsigned int lastId = redFragmentsIndex.size();
-
-	unsigned int redFragmentsSize = redFragments.size();	
-
-	TeBox b = blueTree.getBox();
-
-	for(unsigned int i = 0; i < redFragmentsSize; ++i)
-	{
-// Para cada fragmento vermelho escolhe um ponto para determinar a localizacao do fragmento
-		TeCoord2D middle;
-
-		unsigned int fragSize = redFragments[i].size();
-
-		TeCoord2D& cfrom = redFragments[i][0];
-		TeCoord2D& cto = redFragments[i][1];
-
-		if(fragSize ==  2)	// If the fragment has two points I need to check the middle point of this fragment.
-			TeOverlayMiddle(redFragments[i][0], redFragments[i][1], middle);
-		else	// If the fragment has more than two points so I check one point between the end points.
-			middle = redFragments[i][(unsigned int)((double(redFragments[i].size()) / 2.0 + 0.6)) - 1];
-
-// Monta um raio horizontal que vai ate o extremo de todos os poligonos, partindo do ponto medio (middle)
-		TeCoord2D c2 = middle;
-		c2.x_ = b.x2();
-
-		TeBox searchBox(middle, c2);
-
-		vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
-
-        blueTree.search(searchBox, segs);
-
-        unsigned int nSegsInter = segs.size();
-
-// se nao achou nenhum segmento cruzando o raio, significa que o fragmento esta todo fora
-		if(nSegsInter > 0)
-		{
-// ordena os segmentos azuis para permitir realizar o teste de ponto em poligono
-			sort(segs.begin(), segs.end(), segOrder());
-
-			bool inside_flag = false;
-
-			unsigned int currentPolId = segs[0].polId_;
-
-			double tx = middle.x();
-		    double ty = middle.y();
-
-			int yflag0, yflag1;
-
-			for(unsigned int j = 0; j < nSegsInter; ++j)
-			{
-// Se passamos aos segmentos de outro poligono, temos que zerar o numero de cruzamentos
-				if(currentPolId != segs[j].polId_)
-				{
-					if(inside_flag)
-						break;
-
-					currentPolId = segs[j].polId_;
-				}
-
-				const TeCoord2D& vtx0 = bluePolygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_];
-				const TeCoord2D& vtx1 = bluePolygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_ + 1];
-
-				if((fragSize == 2) && (TeIsOnSegment(middle, vtx0, vtx1)))
-				{
-					
-					if((TeEquals(vtx0, cfrom) || TeEquals(vtx0, cto)) && (TeEquals(vtx1, cfrom) || TeEquals(vtx1, cto)))
-					{
-						if(locationFragments & TeINSIDE)
-							inside_flag = false;
-						else
-							inside_flag = true;						
-
-						break;
-					}
-				}
-
-				yflag0 = (vtx0.y() >= ty);
-				yflag1 = (vtx1.y() >= ty);
-
-				if(yflag0 != yflag1)
-				{
-					if(((vtx1.y() - ty) * (vtx0.x() - vtx1.x()) >=
-						(vtx1.x() - tx) * (vtx0.y() - vtx1.y())) == yflag1)
-					{
-						inside_flag = !inside_flag ;
-					}
-				}
-			}
-
-// ao sair do laco acima, se inside_flag for verdadeiro, entao o fragmento esta dentro, caso contrario, ele esta fora
-			if(inside_flag && (locationFragments & TeINSIDE))
-			{
-				if(redFragments[i].isRing())
-					rings.push_back(redFragments[i]);
-				else
-					redFragmentsIndex.insert(TeLineIndex::value_type(redFragments[i][0], pair<unsigned int, TeLine2D>(i, redFragments[i])));
-
-				mask |= TeINSIDE;
-			}
-			else if(!inside_flag && (locationFragments & TeOUTSIDE))
-			{
-				if(redFragments[i].isRing())
-					rings.push_back(redFragments[i]);
-				else
-					redFragmentsIndex.insert(TeLineIndex::value_type(redFragments[i][0], pair<unsigned int, TeLine2D>(i, redFragments[i])));
-
-				mask |= TeOUTSIDE;
-			}
-		}
-		else	// fragmento esta fora
-		{
-// Se a localizacao do fragmento for compativel, pegamos ele.
-			if(locationFragments & TeOUTSIDE)
-			{
-				if(redFragments[i].isRing())
-					rings.push_back(redFragments[i]);
-				else
-					redFragmentsIndex.insert(TeLineIndex::value_type(redFragments[i][0], pair<unsigned int, TeLine2D>(i, redFragments[i])));
-			}
-
-			mask |= TeOUTSIDE;
-		}
-	}
-}
-
-// Operacao especial que descobre a localizacao do fragmento dentro do proprio conjunto: usado na operacao de uniao otimizada
-void TeOVERLAY::TeRtreeGetFragments(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree, TeLineSet& fragments, vector<pair<unsigned int, unsigned int> >& fragmentsIds, const short& locationFragments, short& mask, TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings)
-{
-	unsigned int fragmentsSize = fragments.size();	
-
-	TeBox b = tree.getBox();
-
-	for(unsigned int i = 0; i < fragmentsSize; ++i)
-	{
-// Para cada fragmento escolhe um ponto para determinar a localizacao do fragmento
-		TeCoord2D middle;
-
-		unsigned int fragSize = fragments[i].size();
-
-		TeCoord2D& cfrom = fragments[i][0];
-		TeCoord2D& cto = fragments[i][1];
-
-		if(fragSize ==  2)	// If the fragment has two points I need to check the middle point of this fragment.
-			TeOverlayMiddle(fragments[i][0], fragments[i][1], middle);
-		else	// If the fragment has more than two points so I check one point between the end points.
-			middle = fragments[i][(unsigned int)((double(fragments[i].size()) / 2.0 + 0.6)) - 1];
-
-// Monta um raio horizontal que vai ate o extremo de todos os poligonos, partindo do ponto medio (middle)
-		TeCoord2D c2 = middle;
-		c2.x_ = b.x2();
-
-		TeBox searchBox(middle, c2);
-
-		vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
-
-        tree.search(searchBox, segs);
-
-        unsigned int nSegsInter = segs.size();
-
-// se nao achou nenhum segmento cruzando o raio, significa que o fragmento esta todo fora
-		if(nSegsInter > 0)
-		{
-// ordena os segmentos para permitir realizar o teste de ponto em poligono
-			sort(segs.begin(), segs.end(), segOrder());
-
-			bool inside_flag = false;
-
-			unsigned int currentPolId = segs[0].polId_;
-
-			double tx = middle.x();
-		    double ty = middle.y();
-
-			int yflag0, yflag1;
-
-			for(unsigned int j = 0; j < nSegsInter; ++j)
-			{
-// Se passamos aos segmentos de outro poligono, temos que zerar o numero de cruzamentos
-				if(currentPolId != segs[j].polId_)
-				{
-					if(inside_flag)
-						break;
-
-					currentPolId = segs[j].polId_;
-				}
-
-// Se os segmentos que estamos tratando sao do fratgmento, entao pulamos
-				if(segs[j].polId_ == fragmentsIds[i].first)
-					continue;
-
-				const TeCoord2D& vtx0 = polygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_];
-				const TeCoord2D& vtx1 = polygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_ + 1];
-
-				if((fragSize == 2) && (TeIsOnSegment(middle, vtx0, vtx1)))
-				{
-					
-					if((TeEquals(vtx0, cfrom) || TeEquals(vtx0, cto)) && (TeEquals(vtx1, cfrom) || TeEquals(vtx1, cto)))
-					{
-						if(locationFragments & TeINSIDE)
-							inside_flag = false;
-						else
-							inside_flag = true;
-
-						break;
-					}
-				}
-
-				yflag0 = (vtx0.y() >= ty);
-				yflag1 = (vtx1.y() >= ty);
-
-				if(yflag0 != yflag1)
-				{
-					if(((vtx1.y() - ty) * (vtx0.x() - vtx1.x()) >=
-						(vtx1.x() - tx) * (vtx0.y() - vtx1.y())) == yflag1)
-					{
-						inside_flag = !inside_flag ;
-					}
-				}
-			}
-
-// ao sair do laco acima, se inside_flag for verdadeiro, entao o fragmento esta dentro, caso contrario, ele esta fora
-			if(inside_flag && (locationFragments & TeINSIDE))
-			{
-				if(fragments[i].isRing())
-					rings.push_back(fragments[i]);
-				else
-					fragmentsIndex.insert(TeLineIndex::value_type(fragments[i][0], pair<unsigned int, TeLine2D>(i, fragments[i])));
-			}
-			else if(!inside_flag && (locationFragments & TeOUTSIDE))
-			{
-				if(fragments[i].isRing())
-					rings.push_back(fragments[i]);
-				else
-					fragmentsIndex.insert(TeLineIndex::value_type(fragments[i][0], pair<unsigned int, TeLine2D>(i, fragments[i])));
-			}
-
-		}
-		else	// fragmento esta fora
-		{
-// Se a localizacao do fragmento for compativel, pegamos ele.
-			if(locationFragments & TeOUTSIDE)
-			{
-				if(fragments[i].isRing())
-					rings.push_back(fragments[i]);
-				else
-					fragmentsIndex.insert(TeLineIndex::value_type(fragments[i][0], pair<unsigned int, TeLine2D>(i, fragments[i])));
-			}
-
-			mask |= TeOUTSIDE;
-		}
-	}
-}
-
-// Operacao especial que descobre a localizacao do fragmento dentro do proprio conjunto: usado na operacao de uniao otimizada
-void TeOVERLAY::TeRtreeRemoveFragments(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree,
-		TeLineIndex &lineIndex, vector<pair<unsigned int, unsigned int> >& fragmentsIds,
-		const short& locationFragments, short& mask, vector<TeLinearRing>& /* rings */)
-{
-	TeBox b = tree.getBox();
-
-	TeLineIndex::iterator indexIterator = lineIndex.begin();
-	
-	while(indexIterator != lineIndex.end())
-	{
-		TeCoord2D middle;
-		TeOverlayMiddle(indexIterator->second.second[0], indexIterator->second.second[1], middle);
-
-		// Monta um raio horizontal que vai ate o extremo de todos os poligonos, partindo do ponto medio (middle)
-		TeCoord2D c2 = middle;
-		c2.x_ = b.x2();
-
-		TeBox searchBox(middle, c2);
-
-		vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
-
-        tree.search(searchBox, segs);
-
-        unsigned int nSegsInter = segs.size();
-
-		// se nao achou nenhum segmento cruzando o raio, significa que o fragmento esta todo fora
-		if(nSegsInter > 0)
-		{
-// ordena os segmentos para permitir realizar o teste de ponto em poligono
-			sort(segs.begin(), segs.end(), segOrder());
-
-			bool inside_flag = false;
-
-			unsigned int currentPolId = segs[0].polId_;
-
-			double tx = middle.x();
-		    double ty = middle.y();
-
-			int yflag0, yflag1;
-
-			for(unsigned int j = 0; j < nSegsInter; ++j)
-			{
-// Se passamos aos segmentos de outro poligono, temos que zerar o numero de cruzamentos
-				if(currentPolId != segs[j].polId_)
-				{
-					if(inside_flag)
-						break;
-
-					currentPolId = segs[j].polId_;
-				}
-
-// Se os segmentos que estamos tratando sao do fragmento, entao pulamos
-				if(segs[j].polId_ == fragmentsIds[indexIterator->second.first].first)
-					continue;
-
-				const TeCoord2D& vtx0 = polygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_];
-				const TeCoord2D& vtx1 = polygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_ + 1];
-
-				// o ponto esta no segmeto de vertices vtx0 e vtx1?
-				// se sim setar inside_flag como false e avancar o j ate mudar de poligino e pula pro inicio dessa secao (continue)
-				if(TeIsOnSegment(middle, vtx0, vtx1))
-				{
-					inside_flag = false;
-
-					while((j < nSegsInter) && currentPolId == segs[j].polId_)
-						++j;
-
-					if(j >= nSegsInter)
-						break;
-
-					--j;
-
-					continue;
-				}
-
-				yflag0 = (vtx0.y() >= ty);
-				yflag1 = (vtx1.y() >= ty);
-
-				if(yflag0 != yflag1)
-				{
-					if(((vtx1.y() - ty) * (vtx0.x() - vtx1.x()) >=
-						(vtx1.x() - tx) * (vtx0.y() - vtx1.y())) == yflag1)
-					{
-						inside_flag = !inside_flag ;
-					}
-				}
-			}
-
-// ao sair do laco acima, se inside_flag for verdadeiro, entao o fragmento esta dentro, caso contrario, ele esta fora
-			if(inside_flag && (locationFragments & TeINSIDE))
-			{
-				TeLineIndex::iterator it_aux =	indexIterator;
-				++(indexIterator);
-				lineIndex.erase(it_aux);				
-			}
-			else if(!inside_flag && (locationFragments & TeOUTSIDE))
-			{
-				TeLineIndex::iterator it_aux =	indexIterator;
-				++(indexIterator);
-				lineIndex.erase(it_aux);
-			}
-			else
-			{
-				++(indexIterator);
-			}
-
-		}
-		else	// fragmento esta fora
-		{
-// Se a localizacao do fragmento for compat�vel, pegamos ele.
-			if(locationFragments & TeOUTSIDE)
-			{
-				TeLineIndex::iterator it_aux =	indexIterator;
-				++(indexIterator);
-				lineIndex.erase(it_aux);				
-			}
-			else
-			{
-				++(indexIterator);
-			}
-
-			mask |= TeOUTSIDE;
-		}
-	}
-}
-
-// estrutura auxiliar utilizada no codigo do split
-struct TeSplitCoordSort
-{
-	bool operator()(pair<unsigned int, TeCoord2D> p1, pair<unsigned int, TeCoord2D> p2) const
-	{
-		if(p1.second.x() < p2.second.x())
-			return true;	
-		if(p1.second.x() > p2.second.x())
-			return false;
-		if(p1.second.y() < p2.second.y())
-			return true;	
-		if(p1.second.y() > p2.second.y())
-			return false;
-		if(p1.first < p2.first)
-			return true;
-
-		return false;
-	}
-};
-
-// estrutura auxiliar utilizada no codigo do split
-struct TeSIP
-{
-	vector<unsigned int>	indexes_;		
-	TeCoord2D				coord_;
-	bool					used_;
-
-	TeSIP() 
-	{
-	}
-
-	TeSIP(const TeCoord2D& coord)
-	{
-		indexes_.clear();
-		coord_ = coord;		
-		used_ = false;
-	}
-
-	bool exists(const unsigned int index)
-	{
-		for(unsigned int i = 0; i < indexes_.size(); i++)
-		{
-			if(index == indexes_[i])
-			{
-				return true;
-			}
-		}
-		return false;
-	}
-
-	unsigned int getFirstIndex()
-	{
-		unsigned int first = indexes_[0];
-		for(unsigned int i = 1; i < indexes_.size(); i++)
-		{
-			if(indexes_[i] < first)
-			{
-				first = indexes_[i];
-			}
-		}
-		return first;
-	}
-	unsigned int getLastIndex()
-	{
-		unsigned int last = indexes_[0];
-		for(unsigned int i = 1; i < indexes_.size(); i++)
-		{
-			if(indexes_[i] > last)
-			{
-				last = indexes_[i];
-			}
-		}
-		return last;
-	}
-};
-
-// funcao auxiliar
-inline bool TeSEquals(const TeCoord2D& c1, const TeCoord2D& c2)
-{
-	return (c1.x() == c2.x()) && (c1.y() == c2.y());
-}
-
-// estrutura auxiliar do split
-struct TeSFragment
-{
-	unsigned int	initialIndex_; //indice da coordenada inicial do fragmento
-	TeLine2D		line_;
-
-	TeSFragment()
-	{
-	}
-
-	TeSFragment(const unsigned int &initialIndex, const TeCoord2D &coord)
-	{
-		initialIndex_ = initialIndex;
-		line_.add(coord);
-	}
-};
-
-// Make rings from split fragments
-inline bool TeSMergeFragments(vector<TeSFragment> &fragments, vector<TeLinearRing>& rings)
-{
-	unsigned int fragmentsSize = fragments.size();
-
-	TeOVERLAY::TeLineIndex fragmentsIndex;
-
-	for(unsigned int i = 0; i < fragmentsSize; ++i)
-
-		fragmentsIndex.insert(TeOVERLAY::TeLineIndex::value_type(fragments[i].line_[0], pair<unsigned int, TeLine2D>(0, fragments[i].line_)));
-	return TeOVERLAY::TeMergeFragments(fragmentsIndex, rings);}
-
-
-bool TeOVERLAY::TeSplitRing(TeLinearRing& ring, TeLineSet& ringsOut)
-{
-	ringsOut.clear();
-
-	unsigned int ringSize = ring.size();
-
-	if(ringSize == 0)
-		return false;
-	
-//vector para armazenar os pontos da linha e sua respectiva posicao
-	vector< pair<unsigned int, TeCoord2D> > vecCoords;
-
-//adiciona os segmentos num vector de pontos, contendo o indice e a coordenada
-	for(unsigned int i = 0; i < ringSize; i++)
-	{
-		vecCoords.push_back( pair<unsigned int, TeCoord2D>(i, ring[i]));
-	}
-	unsigned int vecCoordsSize = vecCoords.size();
-
-	sort(vecCoords.begin(), vecCoords.end(), TeSplitCoordSort());
-
-	vector<TeSIP> ips;
-
-	bool usou = false;
-	//varre todas as coordenadas procurando por pontos de interseccao
-	for(unsigned int i = 1; i < vecCoordsSize; i++)
-	{	
-		//se o ponto corrente for igual ao anterior, entao existe interseccao
-		if(TeSEquals(vecCoords[i-1].second, vecCoords[i].second))
-		{
-			//armazenamos o ponto de interseccao e todos os indices em que este ponto apareceu
-			if(!usou)
-			{
-				//na primeira vez, criamos o ponto de interseccao
-				TeSIP ip(vecCoords[i].second);
-				ip.indexes_.push_back(vecCoords[i-1].first);
-				ip.indexes_.push_back(vecCoords[i].first);
-
-				ips.push_back(ip);
-
-				usou = true;
-			}
-			else
-			{
-				//da segunda em diante, apenas anotamos o indice em que este ponto apareceu
-				ips[ips.size() - 1].indexes_.push_back(vecCoords[i].first);				
-			}
-		}
-		else
-		{
-			usou = false;
-		}		
-	}
-
-	//so existe interseccao entre o inicio e o fim do pol
-	if(ips.size() == 1)
-	{
-		ringsOut.add(ring);	
-		return true;
-	}
-
-	//Gera os fragmentos
-	vector< TeSFragment > fragments;
-	TeSFragment currentFragment(0, ring[0]);
-
-	//vamos remontar a linha
-	for(unsigned int i = 1; i < ringSize; i++)
-	{		
-		unsigned int currentIPindex = 0;
-		bool isIP = false;
-		//verifica se o ponto corrente e um ponto de interseccao
-		for(unsigned j = 0; j < ips.size(); j++)
-		{
-			if(ips[j].exists(i))
-			{				
-				currentIPindex = j;
-				isIP = true;
-				break;
-			}
-		}		
-
-		///adiciono a coordenada corrente ao fragmento corrente
-		currentFragment.line_.add(ring[i]);
-
-		if(isIP)
-		{
-			//se fechou um anel, adiciona na lista de aneis
-			// e remove o ponto de interseccao corrente
-			if(currentFragment.line_.isRing())
-			{
-				ringsOut.add(currentFragment.line_);
-			}
-			else
-			{
-				//verifica se o IP ja passamos por este IP alguma vez
-				//se ja passamos, vamos formar um poligono com os fragmentos entre eles
-				if(ips[currentIPindex].used_)
-				{					
-					//se nao foi formado um anel, pegamos todos os fragmentos entre estes pontos de interseccao e
-					//tentamos formar um anel
-					unsigned int firstIndex = ips[currentIPindex].getFirstIndex();
-					unsigned int lastIndex = ips[currentIPindex].getLastIndex();
-
-					vector<unsigned int> remover;
-					vector< TeSFragment > auxFragments;
-					auxFragments.push_back(currentFragment);
-					for(unsigned int j = 0; j<fragments.size(); j++)
-					{			
-						if(fragments[j].initialIndex_ >= firstIndex &&  fragments[j].initialIndex_ < lastIndex )
-						{
-							remover.push_back(j);
-							auxFragments.push_back(fragments[j]);
-						}
-					}
-					vector<TeLinearRing> r;
-					if(auxFragments.size() >=2 && TeSMergeFragments(auxFragments, r))
-					{
-						for(unsigned int t = 0; t < r.size(); t++)
-						{
-							ringsOut.add(r[t]);
-						}
-
-						for(int j = remover.size()-1; j >= 0; j--)
-						{
-							fragments.erase(fragments.begin() + remover[j]);
-						}
-						ips[currentIPindex].used_ = false;
-					}
-					else
-					{
-						fragments.push_back(currentFragment);
-					}
-				}
-				else
-				{
-					fragments.push_back(currentFragment);
-					ips[currentIPindex].used_ = true;
-				}				
-			}
-
-			currentFragment = TeSFragment (i, ring[i]);			
-		}
-	}
-	
-	if(fragments.size() > 1)
-	{
-		vector<TeLinearRing> r;
-		if(TeSMergeFragments(fragments, r))
-		{
-			for(unsigned int t = 0; t < r.size(); t++)
-			{
-				ringsOut.add(r[t]);
-			}
-		}
-		else
-		{
-			return false;
-		}
-	}
-	else if(fragments.size() == 1)
-	{
-		return false;	
-	}
-
-	for(unsigned int i = 0; i < ringsOut.size(); i++)
-	{
-		ringsOut[i].objectId(ring.objectId());
-		ringsOut[i].geomId(ring.geomId());
-	}
-
-	return true;
-} 
-
-bool TeOVERLAY::TeSplitRings(vector<TeLinearRing>& rings, vector<TeLinearRing>& ringsOut)
-{
-	ringsOut.clear();
-
-	for(unsigned int i = 0; i < rings.size(); ++i)
-	{
-		TeLineSet ringsAux;
-		
-		if(TeOVERLAY::TeSplitRing(rings[i], ringsAux) == false)
-			return false;
-
-		for(unsigned int j = 0; j < ringsAux.size(); ++j)
-			ringsOut.push_back(ringsAux[j]);
-	}
-
-	return true;
-}
-
-bool TeOVERLAY::TeCloneLine(const TeLine2D& lineIn, TeLine2D& lineOut, const unsigned int& minPts)
-{
-	lineOut.clear();
-
-	unsigned int lineSize = lineIn.size();
-
-	if(lineSize < 2)
-		return false;
-
-	lineOut.add(lineIn[0]);
-
-	for(unsigned int i = 1; i < lineSize; ++i)
-	{
-		if(!TeEquals(lineIn[i - 1], lineIn[i]))
-		{
-			lineOut.add(lineIn[i]);
-		}
-	}
-
-	if(lineOut.size() < minPts)
-		return false;
-
-	return true;
-}
-
-
-bool TeOVERLAY::TeClonePolygon(const TePolygon& polIn, TePolygon& polOut)
-{
-	polOut.clear();
-
-	unsigned int polSize = polIn.size();
-
-	if(polSize == 0)
-		return false;
-
-	for(unsigned int i = 0; i < polSize; ++i)
-	{
-		TeLine2D lineOut;
-
-		if(!TeCloneLine(polIn[i], lineOut, 4))
-			return false;
-
-		TeLinearRing ringOut(lineOut);
-
-		polOut.add(ringOut);
-	}
-
-	return true;
-}
-
-bool TeOVERLAY::TeClonePolygonSet(const TePolygonSet& polsIn, TePolygonSet& polsOut)
-{
-	polsOut.clear();
-
-	unsigned int polsSize = polsIn.size();
-
-	if(polsSize == 0)
-		return false;
-
-	for(unsigned int i = 0; i < polsSize; ++i)
-	{
-		TePolygon pol;
-
-		if(!TeClonePolygon(polsIn[i], pol))
-			return false;
-
-		polsOut.add(pol);
-	}
-
-	return true;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeOverlayUtils.h"
+#include "TeGeometryAlgorithms.h"
+
+//---------------- Auxiliary operations for overlay ----------------//
+
+inline void TeOverlayMiddle(const TeCoord2D& c1, const TeCoord2D& c2, TeCoord2D& m)
+{
+	m.x_ = ((c1.x_ + c2.x_) / 2.0);
+	m.y_ = ((c1.y_ + c2.y_) / 2.0);
+}
+
+// Verifies orientation for each line of polygon set, and reverse the orientation if need
+void TeOVERLAY::TeFixOrientation(TePolygonSet& polSet, const short& outerOrientationToReverse, const short& innerOrientationToReverse)
+{
+	unsigned int polSetSize = polSet.size();
+
+	for(unsigned int i = 0; i < polSetSize; ++i)
+	{
+		if(TeOrientation(polSet[i][0]) == outerOrientationToReverse)
+			reverse(polSet[i][0].begin(), polSet[i][0].end());
+
+		unsigned int polSize = polSet[i].size();
+
+		for(unsigned int j = 1; j < polSize; ++j)
+		{
+			if(TeOrientation(polSet[i][j]) == innerOrientationToReverse)
+				reverse(polSet[i][j].begin(), polSet[i][j].end());
+		}
+	}
+}
+
+// For each operation (union, intersection and difference) defines location for retrieval of fragments
+void TeOVERLAY::TeChooseBoundaryLocation(const short& operation, short& locationRedFragments, short& locationBlueFragments)
+{
+	switch(operation)
+	{							
+// intersection: gets all fragments from red polygon wich are
+// inside the blue polygon and the blue fragments that are inside
+// the red polygon.
+		case TeINTERSECTION:  locationRedFragments  = TeINSIDE;
+			                  locationBlueFragments = TeINSIDE;
+							  break;
+
+// union: gets all fragments from red polygon wich are
+// outside the blue polygon and the blue fragments that are outside
+// the red polygon.
+		case TeUNION:         locationRedFragments  = TeOUTSIDE;
+			                  locationBlueFragments = TeOUTSIDE;
+							  break;
+
+// difference: gets all fragments from red polygon wich are
+// outside the blue polygon and the blue fragments that are inside
+// the red polygon.
+		case TeDIFFERENCE:	  locationRedFragments  = TeOUTSIDE;
+			                  locationBlueFragments = TeINSIDE;
+		                      break;
+	}
+}
+
+// Erases from fragmentsIndex boundary fragments that are in oposite direction: each fragment must have a unique identifier in the pair first field (pair<unsigned int, TeLine2D>)
+void TeOVERLAY::TeRemoveOpositeBoundaryFragments(TeLineIndex& fragmentsIndex)
+{
+	TeLineIndex::iterator indexIterator = fragmentsIndex.begin();
+	
+	while(indexIterator != fragmentsIndex.end())
+	{
+		pair<TeLineIndex::iterator, TeLineIndex::iterator> its = fragmentsIndex.equal_range(indexIterator->second.second[(indexIterator->second.second.size() - 1u)]);
+
+		bool eraseOwn = false;
+
+        while(its.first != its.second)
+		{
+// Se nao achei o proprio fragmento, entao posso ver se e possivel apagar
+			if(its.first->second.first != indexIterator->second.first)
+			{
+				if(TeEquals(its.first->second.second[its.first->second.second.size() - 1u], indexIterator->second.second[0u]))
+				{
+					TeLineIndex::iterator idxAux2 = its.first;
+					++(its.first);
+					fragmentsIndex.erase(idxAux2);
+
+					eraseOwn = true;
+				}
+				else
+				{
+					++(its.first);
+				}
+			}
+			else
+			{
+				++(its.first);
+			}
+		}
+
+		if(eraseOwn)
+		{
+			fragmentsIndex.erase(indexIterator);
+			indexIterator = fragmentsIndex.begin();
+		}
+		else
+		{
+			++indexIterator;
+		}
+	}
+}
+
+// Erases from fragmentsIndex boundary fragments that are equals to another boundary fragment
+void TeOVERLAY::TeRemoveSameBoundaryFragments(TeLineIndex& fragmentsIndex)
+{
+	TeLineIndex::iterator indexIterator = fragmentsIndex.begin();
+	
+	while(indexIterator != fragmentsIndex.end())
+	{
+		pair<TeLineIndex::iterator, TeLineIndex::iterator> its = fragmentsIndex.equal_range(indexIterator->second.second[0u]);
+
+        while(its.first != its.second)
+		{
+// Se nao achei o proprio fragmento, entao posso ver se e possivel apagar
+			if(its.first->second.first != indexIterator->second.first)
+			{
+				if(TeEquals(its.first->second.second[its.first->second.second.size() - 1u], indexIterator->second.second[indexIterator->second.second.size() - 1u]))
+				{
+					TeLineIndex::iterator idxAux2 = its.first;
+					++(its.first);
+					fragmentsIndex.erase(idxAux2);
+				}
+				else
+				{
+					++(its.first);
+				}
+			}
+			else
+			{
+				++(its.first);
+			}
+		}
+
+		++indexIterator;
+	}
+}
+
+// Merge fragments ito first index (fragmentsIndex)
+void TeOVERLAY::TeJoinFragments(TeLineIndex& fragmentsIndex, TeLineIndex& boundaryFragmentsIndex)
+{
+	TeLineIndex::iterator indexIterator = boundaryFragmentsIndex.begin();
+
+	while(indexIterator != boundaryFragmentsIndex.end())
+	{
+		fragmentsIndex.insert(*indexIterator);
+		++indexIterator;
+	}
+
+	boundaryFragmentsIndex.clear();	
+}
+
+// Moves closed rings from fragmentsIndex to rins vector
+void TeOVERLAY::TeFindAndMoveClosedRings(TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings)
+{
+	TeLineIndex::iterator indexIterator = fragmentsIndex.begin();
+
+	while(indexIterator != fragmentsIndex.end())
+	{
+		if(indexIterator->second.second.isRing())
+		{
+			rings.push_back(indexIterator->second.second);
+
+			TeLineIndex::iterator idxAux;
+			idxAux = indexIterator;
+			++indexIterator;
+			fragmentsIndex.erase(idxAux);
+		}
+		else
+			++indexIterator;
+	}
+}
+
+// Gets a polygonset with outer rings and a vector with holes and try to find to what polygon the hole belongs to
+bool TeOVERLAY::TeMountTopology(TePolygonSet& polysOut, vector<TeLinearRing>& holes)
+{
+	bool returnValue = true;
+
+	if((polysOut.size() == 0) && (holes.size() > 0))
+	{
+// Formou buracos e nao formou os aneis externos
+		return false;	
+	}
+
+	if(polysOut.size() == 1)
+	{
+		for(unsigned int i = 0; i < holes.size(); ++i)
+			polysOut[0].add(holes[i]);		
+	}
+	else
+	{
+		for(unsigned int i = 0; i < holes.size(); ++i)
+		{
+			TeLinearRing ring = holes[i];
+
+			vector<TePolygon> candidates;
+			vector<unsigned int> candidatesPos;
+
+			unsigned int j = 0;
+
+			for(j = 0; j < polysOut.size(); ++j)
+			{
+				if(TeWithinOrCoveredByOrEquals(ring.box(), polysOut[j].box()))
+				{
+					candidates.push_back(polysOut[j]);
+					candidatesPos.push_back(j);
+				}
+			}
+
+			if(candidates.size() == 1)
+			{
+				candidates[0].add(ring);
+				continue;
+			}
+
+			vector<TePolygon> newCandidates;
+
+			for(j = 0; j < candidates.size(); ++j)
+			{
+				short rel = TeBOUNDARY;
+
+				unsigned int nthVert = ring.size();
+				unsigned int iVert = 0u;
+
+				while(iVert < nthVert)
+				{
+					rel = TeRelation(ring[iVert], candidates[j][0]);
+
+					if(rel & TeINSIDE)
+					{				
+						newCandidates.push_back(candidates[j]);
+						break;
+					}
+					else if(rel & TeOUTSIDE)
+					{
+						break;
+					}
+				
+					++iVert;
+				}
+
+				if(iVert == nthVert)	
+				{
+// Topologycal error: every point is on ring boundary...
+					returnValue = false;
+
+					TePolygon topTest;
+					topTest.add(ring);
+
+					short whatRel = TeRelation(topTest, candidates[j]);
+
+// Se um buraco for igual ao exterior, existe um erro topologico
+// No momento, eliminamos o anel externo
+// e o interno... 
+// Se o buraco for coberto pelo poligono externo, entao ele ira ficar dentro deste
+// Caso contrario e erro sem possibilidades...
+					if(whatRel & TeEQUALS)
+					{						
+						polysOut.erase(polysOut.begin() + candidatesPos[j]);
+						continue;
+					}
+				}				
+			}
+
+			if(newCandidates.size() <= 0)
+			{
+// Didn't find outer ring to this hole.
+				returnValue = false;
+				continue;
+			}
+
+			int idxMinArea = 0;
+			
+			double minArea = TeMAXFLOAT;
+
+			for(j = 0; j < newCandidates.size(); ++j)
+			{
+				if(TeGeometryArea(newCandidates[j].box()) < minArea)
+				{
+					idxMinArea = j;
+					minArea = TeGeometryArea(newCandidates[j].box());
+				}
+			}
+
+			newCandidates[idxMinArea].add(ring);
+		}
+	}
+
+	return returnValue;
+}
+
+// faz a tentativa ingenua!
+bool TeMergeFragmentsFB(TeOVERLAY::TeLineIndex& fragmentsIndex, TeLine2D& line)
+{
+	TeCoord2D endLineCoordinate = line[line.size() - 1];
+
+	TeOVERLAY::TeLineIndex::iterator indexIterator  = fragmentsIndex.begin();
+
+	while(indexIterator != fragmentsIndex.end())
+	{
+		if(TeEquals(endLineCoordinate, indexIterator->second.second[0]))
+		{
+			for(unsigned int i = 1; i < indexIterator->second.second.size(); ++i)
+				line.add(indexIterator->second.second[i]);
+
+			line.setBox(::TeUnion(line.box(), indexIterator->second.second.box()));
+			fragmentsIndex.erase(indexIterator);
+
+			return true;
+		}
+
+		++indexIterator;
+	}
+
+	return false;
+}
+
+// Make polygons from fragments.
+bool TeOVERLAY::TeMergeFragments(TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings, const bool& doExaustive)
+{
+	bool returnValue = true;
+
+	TeLine2D  lAux;	
+	TeCoord2D endLineCoordinate;
+
+	while(!(fragmentsIndex.empty()))
+	{
+		if(lAux.size() == 0)
+		{
+			TeLineIndex::iterator indexIterator  = fragmentsIndex.begin();
+			
+			if(indexIterator != fragmentsIndex.end())
+			{
+				if(indexIterator->second.second.isRing())
+				{
+					rings.push_back(indexIterator->second.second);
+					fragmentsIndex.erase(indexIterator);
+					continue;
+				}
+				
+				for(unsigned int i = 0; i < indexIterator->second.second.size(); ++i)
+					lAux.add(indexIterator->second.second[i]);
+
+				lAux.setBox(::TeUnion(lAux.box(), indexIterator->second.second.box()));
+
+				fragmentsIndex.erase(indexIterator);
+			}
+			else
+			{
+                returnValue = false;	//Nao poderia vir aqui, deveria ter saido no teste do laco!!
+			}
+		}	
+		else
+		{
+			endLineCoordinate = lAux[lAux.size() - 1];
+
+			// Try to find the beginning of the next fragment that is part of the polygon in the same list
+			TeLineIndex::iterator indexIterator = fragmentsIndex.find(endLineCoordinate);
+
+			if(indexIterator != fragmentsIndex.end())
+			{
+				for(unsigned int i = 1; i < indexIterator->second.second.size(); ++i)
+					lAux.add(indexIterator->second.second[i]);
+
+				lAux.setBox(::TeUnion(lAux.box(), indexIterator->second.second.box()));
+				fragmentsIndex.erase(indexIterator);
+			}			
+			else
+			{
+				if(doExaustive)
+				{
+					if(!TeMergeFragmentsFB(fragmentsIndex, lAux))
+					{
+	// Nao foi achada continuacao para a linha: nao fechou!
+						returnValue = false;	// Erro na topologia dos poligonos
+
+						// Clear auxiliary.
+						TeLine2D emptyLine;
+						lAux = emptyLine;
+					}
+				}
+				else
+				{
+					// Nao foi achada continuacao para a linha: nao fechou!
+					returnValue = false;	// Erro na topologia dos poligonos
+
+					// Clear auxiliary.
+					TeLine2D emptyLine;
+					lAux = emptyLine;
+				}
+			}
+			
+		}
+
+		if(lAux.isRing())
+		{  
+			// Add polygon
+			rings.push_back(TeLinearRing(lAux));
+			
+			// Clear auxiliary.
+			TeLine2D emptyLine;					
+			lAux = emptyLine;
+		}
+	}
+
+	if(lAux.size() > 0)
+		returnValue = false;	// Erro, alguma linha nao fechou!!!
+
+	return returnValue;
+}
+
+// For each linear ring, see it's orientation and classify in outer or inner ring
+bool TeOVERLAY::TeClassifyRings(vector<TeLinearRing>& rings, TePolygonSet& polsOut, vector<TeLinearRing>& holes)
+{
+	bool returnValue = true;
+
+	for(unsigned int z = 0; z < rings.size(); ++z)
+	{
+		short ori = TeOrientation(rings[z]);
+
+		if(ori == TeCOUNTERCLOCKWISE)	// It is a hole
+		{
+			holes.push_back(rings[z]);			// add to holes list
+		}
+		else if(ori == TeCLOCKWISE)		// else if island
+		{										// create a polygon
+			TePolygon p;
+			p.add(rings[z]);
+			polsOut.add(p);
+		}
+		else	
+		{
+			returnValue = false;	// Objeto sem area? Isso e um erro!
+		}
+	}
+
+	return returnValue;
+}
+
+// Seleciona os fragmentos quando existem dois conjuntos distintos: vermelho e azul
+void TeOVERLAY::TeRtreeGetFragments(const TePolygonSet& bluePolygons, TeINTERSECTOR2::TeSegmentRTree& blueTree, TeLineSet& redFragments, const short& locationFragments, short& mask, TeLineIndex& redFragmentsIndex, vector<TeLinearRing>& rings)
+{
+	//unsigned int lastId = redFragmentsIndex.size();
+
+	unsigned int redFragmentsSize = redFragments.size();	
+
+	TeBox b = blueTree.getBox();
+
+	for(unsigned int i = 0; i < redFragmentsSize; ++i)
+	{
+// Para cada fragmento vermelho escolhe um ponto para determinar a localizacao do fragmento
+		TeCoord2D middle;
+
+		unsigned int fragSize = redFragments[i].size();
+
+		TeCoord2D& cfrom = redFragments[i][0];
+		TeCoord2D& cto = redFragments[i][1];
+
+		if(fragSize ==  2)	// If the fragment has two points I need to check the middle point of this fragment.
+			TeOverlayMiddle(redFragments[i][0], redFragments[i][1], middle);
+		else	// If the fragment has more than two points so I check one point between the end points.
+			middle = redFragments[i][(unsigned int)((double(redFragments[i].size()) / 2.0 + 0.6)) - 1];
+
+// Monta um raio horizontal que vai ate o extremo de todos os poligonos, partindo do ponto medio (middle)
+		TeCoord2D c2 = middle;
+		c2.x_ = b.x2();
+
+		TeBox searchBox(middle, c2);
+
+		vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
+
+        blueTree.search(searchBox, segs);
+
+        unsigned int nSegsInter = segs.size();
+
+// se nao achou nenhum segmento cruzando o raio, significa que o fragmento esta todo fora
+		if(nSegsInter > 0)
+		{
+// ordena os segmentos azuis para permitir realizar o teste de ponto em poligono
+			sort(segs.begin(), segs.end(), segOrder());
+
+			bool inside_flag = false;
+
+			unsigned int currentPolId = segs[0].polId_;
+
+			double tx = middle.x();
+		    double ty = middle.y();
+
+			int yflag0, yflag1;
+
+			for(unsigned int j = 0; j < nSegsInter; ++j)
+			{
+// Se passamos aos segmentos de outro poligono, temos que zerar o numero de cruzamentos
+				if(currentPolId != segs[j].polId_)
+				{
+					if(inside_flag)
+						break;
+
+					currentPolId = segs[j].polId_;
+				}
+
+				const TeCoord2D& vtx0 = bluePolygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_];
+				const TeCoord2D& vtx1 = bluePolygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_ + 1];
+
+				if((fragSize == 2) && (TeIsOnSegment(middle, vtx0, vtx1)))
+				{
+					
+					if((TeEquals(vtx0, cfrom) || TeEquals(vtx0, cto)) && (TeEquals(vtx1, cfrom) || TeEquals(vtx1, cto)))
+					{
+						if(locationFragments & TeINSIDE)
+							inside_flag = false;
+						else
+							inside_flag = true;						
+
+						break;
+					}
+				}
+
+				yflag0 = (vtx0.y() >= ty);
+				yflag1 = (vtx1.y() >= ty);
+
+				if(yflag0 != yflag1)
+				{
+					if(((vtx1.y() - ty) * (vtx0.x() - vtx1.x()) >=
+						(vtx1.x() - tx) * (vtx0.y() - vtx1.y())) == yflag1)
+					{
+						inside_flag = !inside_flag ;
+					}
+				}
+			}
+
+// ao sair do laco acima, se inside_flag for verdadeiro, entao o fragmento esta dentro, caso contrario, ele esta fora
+			if(inside_flag && (locationFragments & TeINSIDE))
+			{
+				if(redFragments[i].isRing())
+					rings.push_back(redFragments[i]);
+				else
+					redFragmentsIndex.insert(TeLineIndex::value_type(redFragments[i][0], pair<unsigned int, TeLine2D>(i, redFragments[i])));
+
+				mask |= TeINSIDE;
+			}
+			else if(!inside_flag && (locationFragments & TeOUTSIDE))
+			{
+				if(redFragments[i].isRing())
+					rings.push_back(redFragments[i]);
+				else
+					redFragmentsIndex.insert(TeLineIndex::value_type(redFragments[i][0], pair<unsigned int, TeLine2D>(i, redFragments[i])));
+
+				mask |= TeOUTSIDE;
+			}
+		}
+		else	// fragmento esta fora
+		{
+// Se a localizacao do fragmento for compativel, pegamos ele.
+			if(locationFragments & TeOUTSIDE)
+			{
+				if(redFragments[i].isRing())
+					rings.push_back(redFragments[i]);
+				else
+					redFragmentsIndex.insert(TeLineIndex::value_type(redFragments[i][0], pair<unsigned int, TeLine2D>(i, redFragments[i])));
+			}
+
+			mask |= TeOUTSIDE;
+		}
+	}
+}
+
+// Operacao especial que descobre a localizacao do fragmento dentro do proprio conjunto: usado na operacao de uniao otimizada
+void TeOVERLAY::TeRtreeGetFragments(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree, TeLineSet& fragments, vector<pair<unsigned int, unsigned int> >& fragmentsIds, const short& locationFragments, short& mask, TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings)
+{
+	unsigned int fragmentsSize = fragments.size();	
+
+	TeBox b = tree.getBox();
+
+	for(unsigned int i = 0; i < fragmentsSize; ++i)
+	{
+// Para cada fragmento escolhe um ponto para determinar a localizacao do fragmento
+		TeCoord2D middle;
+
+		unsigned int fragSize = fragments[i].size();
+
+		TeCoord2D& cfrom = fragments[i][0];
+		TeCoord2D& cto = fragments[i][1];
+
+		if(fragSize ==  2)	// If the fragment has two points I need to check the middle point of this fragment.
+			TeOverlayMiddle(fragments[i][0], fragments[i][1], middle);
+		else	// If the fragment has more than two points so I check one point between the end points.
+			middle = fragments[i][(unsigned int)((double(fragments[i].size()) / 2.0 + 0.6)) - 1];
+
+// Monta um raio horizontal que vai ate o extremo de todos os poligonos, partindo do ponto medio (middle)
+		TeCoord2D c2 = middle;
+		c2.x_ = b.x2();
+
+		TeBox searchBox(middle, c2);
+
+		vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
+
+        tree.search(searchBox, segs);
+
+        unsigned int nSegsInter = segs.size();
+
+// se nao achou nenhum segmento cruzando o raio, significa que o fragmento esta todo fora
+		if(nSegsInter > 0)
+		{
+// ordena os segmentos para permitir realizar o teste de ponto em poligono
+			sort(segs.begin(), segs.end(), segOrder());
+
+			bool inside_flag = false;
+
+			unsigned int currentPolId = segs[0].polId_;
+
+			double tx = middle.x();
+		    double ty = middle.y();
+
+			int yflag0, yflag1;
+
+			for(unsigned int j = 0; j < nSegsInter; ++j)
+			{
+// Se passamos aos segmentos de outro poligono, temos que zerar o numero de cruzamentos
+				if(currentPolId != segs[j].polId_)
+				{
+					if(inside_flag)
+						break;
+
+					currentPolId = segs[j].polId_;
+				}
+
+// Se os segmentos que estamos tratando sao do fratgmento, entao pulamos
+				if(segs[j].polId_ == fragmentsIds[i].first)
+					continue;
+
+				const TeCoord2D& vtx0 = polygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_];
+				const TeCoord2D& vtx1 = polygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_ + 1];
+
+				if((fragSize == 2) && (TeIsOnSegment(middle, vtx0, vtx1)))
+				{
+					
+					if((TeEquals(vtx0, cfrom) || TeEquals(vtx0, cto)) && (TeEquals(vtx1, cfrom) || TeEquals(vtx1, cto)))
+					{
+						if(locationFragments & TeINSIDE)
+							inside_flag = false;
+						else
+							inside_flag = true;
+
+						break;
+					}
+				}
+
+				yflag0 = (vtx0.y() >= ty);
+				yflag1 = (vtx1.y() >= ty);
+
+				if(yflag0 != yflag1)
+				{
+					if(((vtx1.y() - ty) * (vtx0.x() - vtx1.x()) >=
+						(vtx1.x() - tx) * (vtx0.y() - vtx1.y())) == yflag1)
+					{
+						inside_flag = !inside_flag ;
+					}
+				}
+			}
+
+// ao sair do laco acima, se inside_flag for verdadeiro, entao o fragmento esta dentro, caso contrario, ele esta fora
+			if(inside_flag && (locationFragments & TeINSIDE))
+			{
+				if(fragments[i].isRing())
+					rings.push_back(fragments[i]);
+				else
+					fragmentsIndex.insert(TeLineIndex::value_type(fragments[i][0], pair<unsigned int, TeLine2D>(i, fragments[i])));
+			}
+			else if(!inside_flag && (locationFragments & TeOUTSIDE))
+			{
+				if(fragments[i].isRing())
+					rings.push_back(fragments[i]);
+				else
+					fragmentsIndex.insert(TeLineIndex::value_type(fragments[i][0], pair<unsigned int, TeLine2D>(i, fragments[i])));
+			}
+
+		}
+		else	// fragmento esta fora
+		{
+// Se a localizacao do fragmento for compativel, pegamos ele.
+			if(locationFragments & TeOUTSIDE)
+			{
+				if(fragments[i].isRing())
+					rings.push_back(fragments[i]);
+				else
+					fragmentsIndex.insert(TeLineIndex::value_type(fragments[i][0], pair<unsigned int, TeLine2D>(i, fragments[i])));
+			}
+
+			mask |= TeOUTSIDE;
+		}
+	}
+}
+
+// Operacao especial que descobre a localizacao do fragmento dentro do proprio conjunto: usado na operacao de uniao otimizada
+void TeOVERLAY::TeRtreeRemoveFragments(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree,
+		TeLineIndex &lineIndex, vector<pair<unsigned int, unsigned int> >& fragmentsIds,
+		const short& locationFragments, short& mask, vector<TeLinearRing>& /* rings */)
+{
+	TeBox b = tree.getBox();
+
+	TeLineIndex::iterator indexIterator = lineIndex.begin();
+	
+	while(indexIterator != lineIndex.end())
+	{
+		TeCoord2D middle;
+		TeOverlayMiddle(indexIterator->second.second[0], indexIterator->second.second[1], middle);
+
+		// Monta um raio horizontal que vai ate o extremo de todos os poligonos, partindo do ponto medio (middle)
+		TeCoord2D c2 = middle;
+		c2.x_ = b.x2();
+
+		TeBox searchBox(middle, c2);
+
+		vector<TeINTERSECTOR2::TeSegIdInPolygonSet> segs;
+
+        tree.search(searchBox, segs);
+
+        unsigned int nSegsInter = segs.size();
+
+		// se nao achou nenhum segmento cruzando o raio, significa que o fragmento esta todo fora
+		if(nSegsInter > 0)
+		{
+// ordena os segmentos para permitir realizar o teste de ponto em poligono
+			sort(segs.begin(), segs.end(), segOrder());
+
+			bool inside_flag = false;
+
+			unsigned int currentPolId = segs[0].polId_;
+
+			double tx = middle.x();
+		    double ty = middle.y();
+
+			int yflag0, yflag1;
+
+			for(unsigned int j = 0; j < nSegsInter; ++j)
+			{
+// Se passamos aos segmentos de outro poligono, temos que zerar o numero de cruzamentos
+				if(currentPolId != segs[j].polId_)
+				{
+					if(inside_flag)
+						break;
+
+					currentPolId = segs[j].polId_;
+				}
+
+// Se os segmentos que estamos tratando sao do fragmento, entao pulamos
+				if(segs[j].polId_ == fragmentsIds[indexIterator->second.first].first)
+					continue;
+
+				const TeCoord2D& vtx0 = polygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_];
+				const TeCoord2D& vtx1 = polygons[segs[j].polId_][segs[j].lineId_][segs[j].segId_ + 1];
+
+				// o ponto esta no segmeto de vertices vtx0 e vtx1?
+				// se sim setar inside_flag como false e avancar o j ate mudar de poligino e pula pro inicio dessa secao (continue)
+				if(TeIsOnSegment(middle, vtx0, vtx1))
+				{
+					inside_flag = false;
+
+					while((j < nSegsInter) && currentPolId == segs[j].polId_)
+						++j;
+
+					if(j >= nSegsInter)
+						break;
+
+					--j;
+
+					continue;
+				}
+
+				yflag0 = (vtx0.y() >= ty);
+				yflag1 = (vtx1.y() >= ty);
+
+				if(yflag0 != yflag1)
+				{
+					if(((vtx1.y() - ty) * (vtx0.x() - vtx1.x()) >=
+						(vtx1.x() - tx) * (vtx0.y() - vtx1.y())) == yflag1)
+					{
+						inside_flag = !inside_flag ;
+					}
+				}
+			}
+
+// ao sair do laco acima, se inside_flag for verdadeiro, entao o fragmento esta dentro, caso contrario, ele esta fora
+			if(inside_flag && (locationFragments & TeINSIDE))
+			{
+				TeLineIndex::iterator it_aux =	indexIterator;
+				++(indexIterator);
+				lineIndex.erase(it_aux);				
+			}
+			else if(!inside_flag && (locationFragments & TeOUTSIDE))
+			{
+				TeLineIndex::iterator it_aux =	indexIterator;
+				++(indexIterator);
+				lineIndex.erase(it_aux);
+			}
+			else
+			{
+				++(indexIterator);
+			}
+
+		}
+		else	// fragmento esta fora
+		{
+// Se a localizacao do fragmento for compat�vel, pegamos ele.
+			if(locationFragments & TeOUTSIDE)
+			{
+				TeLineIndex::iterator it_aux =	indexIterator;
+				++(indexIterator);
+				lineIndex.erase(it_aux);				
+			}
+			else
+			{
+				++(indexIterator);
+			}
+
+			mask |= TeOUTSIDE;
+		}
+	}
+}
+
+// estrutura auxiliar utilizada no codigo do split
+struct TeSplitCoordSort
+{
+	bool operator()(pair<unsigned int, TeCoord2D> p1, pair<unsigned int, TeCoord2D> p2) const
+	{
+		if(p1.second.x() < p2.second.x())
+			return true;	
+		if(p1.second.x() > p2.second.x())
+			return false;
+		if(p1.second.y() < p2.second.y())
+			return true;	
+		if(p1.second.y() > p2.second.y())
+			return false;
+		if(p1.first < p2.first)
+			return true;
+
+		return false;
+	}
+};
+
+// estrutura auxiliar utilizada no codigo do split
+struct TeSIP
+{
+	vector<unsigned int>	indexes_;		
+	TeCoord2D				coord_;
+	bool					used_;
+
+	TeSIP() 
+	{
+	}
+
+	TeSIP(const TeCoord2D& coord)
+	{
+		indexes_.clear();
+		coord_ = coord;		
+		used_ = false;
+	}
+
+	bool exists(const unsigned int index)
+	{
+		for(unsigned int i = 0; i < indexes_.size(); i++)
+		{
+			if(index == indexes_[i])
+			{
+				return true;
+			}
+		}
+		return false;
+	}
+
+	unsigned int getFirstIndex()
+	{
+		unsigned int first = indexes_[0];
+		for(unsigned int i = 1; i < indexes_.size(); i++)
+		{
+			if(indexes_[i] < first)
+			{
+				first = indexes_[i];
+			}
+		}
+		return first;
+	}
+	unsigned int getLastIndex()
+	{
+		unsigned int last = indexes_[0];
+		for(unsigned int i = 1; i < indexes_.size(); i++)
+		{
+			if(indexes_[i] > last)
+			{
+				last = indexes_[i];
+			}
+		}
+		return last;
+	}
+};
+
+// funcao auxiliar
+inline bool TeSEquals(const TeCoord2D& c1, const TeCoord2D& c2)
+{
+	return (c1.x() == c2.x()) && (c1.y() == c2.y());
+}
+
+// estrutura auxiliar do split
+struct TeSFragment
+{
+	unsigned int	initialIndex_; //indice da coordenada inicial do fragmento
+	TeLine2D		line_;
+
+	TeSFragment()
+	{
+	}
+
+	TeSFragment(const unsigned int &initialIndex, const TeCoord2D &coord)
+	{
+		initialIndex_ = initialIndex;
+		line_.add(coord);
+	}
+};
+
+// Make rings from split fragments
+inline bool TeSMergeFragments(vector<TeSFragment> &fragments, vector<TeLinearRing>& rings)
+{
+	unsigned int fragmentsSize = fragments.size();
+
+	TeOVERLAY::TeLineIndex fragmentsIndex;
+
+	for(unsigned int i = 0; i < fragmentsSize; ++i)
+
+		fragmentsIndex.insert(TeOVERLAY::TeLineIndex::value_type(fragments[i].line_[0], pair<unsigned int, TeLine2D>(0, fragments[i].line_)));
+	return TeOVERLAY::TeMergeFragments(fragmentsIndex, rings);}
+
+
+bool TeOVERLAY::TeSplitRing(TeLinearRing& ring, TeLineSet& ringsOut)
+{
+	ringsOut.clear();
+
+	unsigned int ringSize = ring.size();
+
+	if(ringSize == 0)
+		return false;
+	
+//vector para armazenar os pontos da linha e sua respectiva posicao
+	vector< pair<unsigned int, TeCoord2D> > vecCoords;
+
+//adiciona os segmentos num vector de pontos, contendo o indice e a coordenada
+	for(unsigned int i = 0; i < ringSize; i++)
+	{
+		vecCoords.push_back( pair<unsigned int, TeCoord2D>(i, ring[i]));
+	}
+	unsigned int vecCoordsSize = vecCoords.size();
+
+	sort(vecCoords.begin(), vecCoords.end(), TeSplitCoordSort());
+
+	vector<TeSIP> ips;
+
+	bool usou = false;
+	//varre todas as coordenadas procurando por pontos de interseccao
+	for(unsigned int i = 1; i < vecCoordsSize; i++)
+	{	
+		//se o ponto corrente for igual ao anterior, entao existe interseccao
+		if(TeSEquals(vecCoords[i-1].second, vecCoords[i].second))
+		{
+			//armazenamos o ponto de interseccao e todos os indices em que este ponto apareceu
+			if(!usou)
+			{
+				//na primeira vez, criamos o ponto de interseccao
+				TeSIP ip(vecCoords[i].second);
+				ip.indexes_.push_back(vecCoords[i-1].first);
+				ip.indexes_.push_back(vecCoords[i].first);
+
+				ips.push_back(ip);
+
+				usou = true;
+			}
+			else
+			{
+				//da segunda em diante, apenas anotamos o indice em que este ponto apareceu
+				ips[ips.size() - 1].indexes_.push_back(vecCoords[i].first);				
+			}
+		}
+		else
+		{
+			usou = false;
+		}		
+	}
+
+	//so existe interseccao entre o inicio e o fim do pol
+	if(ips.size() == 1)
+	{
+		ringsOut.add(ring);	
+		return true;
+	}
+
+	//Gera os fragmentos
+	vector< TeSFragment > fragments;
+	TeSFragment currentFragment(0, ring[0]);
+
+	//vamos remontar a linha
+	for(unsigned int i = 1; i < ringSize; i++)
+	{		
+		unsigned int currentIPindex = 0;
+		bool isIP = false;
+		//verifica se o ponto corrente e um ponto de interseccao
+		for(unsigned j = 0; j < ips.size(); j++)
+		{
+			if(ips[j].exists(i))
+			{				
+				currentIPindex = j;
+				isIP = true;
+				break;
+			}
+		}		
+
+		///adiciono a coordenada corrente ao fragmento corrente
+		currentFragment.line_.add(ring[i]);
+
+		if(isIP)
+		{
+			//se fechou um anel, adiciona na lista de aneis
+			// e remove o ponto de interseccao corrente
+			if(currentFragment.line_.isRing())
+			{
+				ringsOut.add(currentFragment.line_);
+			}
+			else
+			{
+				//verifica se o IP ja passamos por este IP alguma vez
+				//se ja passamos, vamos formar um poligono com os fragmentos entre eles
+				if(ips[currentIPindex].used_)
+				{					
+					//se nao foi formado um anel, pegamos todos os fragmentos entre estes pontos de interseccao e
+					//tentamos formar um anel
+					unsigned int firstIndex = ips[currentIPindex].getFirstIndex();
+					unsigned int lastIndex = ips[currentIPindex].getLastIndex();
+
+					vector<unsigned int> remover;
+					vector< TeSFragment > auxFragments;
+					auxFragments.push_back(currentFragment);
+					for(unsigned int j = 0; j<fragments.size(); j++)
+					{			
+						if(fragments[j].initialIndex_ >= firstIndex &&  fragments[j].initialIndex_ < lastIndex )
+						{
+							remover.push_back(j);
+							auxFragments.push_back(fragments[j]);
+						}
+					}
+					vector<TeLinearRing> r;
+					if(auxFragments.size() >=2 && TeSMergeFragments(auxFragments, r))
+					{
+						for(unsigned int t = 0; t < r.size(); t++)
+						{
+							ringsOut.add(r[t]);
+						}
+
+						for(int j = remover.size()-1; j >= 0; j--)
+						{
+							fragments.erase(fragments.begin() + remover[j]);
+						}
+						ips[currentIPindex].used_ = false;
+					}
+					else
+					{
+						fragments.push_back(currentFragment);
+					}
+				}
+				else
+				{
+					fragments.push_back(currentFragment);
+					ips[currentIPindex].used_ = true;
+				}				
+			}
+
+			currentFragment = TeSFragment (i, ring[i]);			
+		}
+	}
+	
+	if(fragments.size() > 1)
+	{
+		vector<TeLinearRing> r;
+		if(TeSMergeFragments(fragments, r))
+		{
+			for(unsigned int t = 0; t < r.size(); t++)
+			{
+				ringsOut.add(r[t]);
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+	else if(fragments.size() == 1)
+	{
+		return false;	
+	}
+
+	for(unsigned int i = 0; i < ringsOut.size(); i++)
+	{
+		ringsOut[i].objectId(ring.objectId());
+		ringsOut[i].geomId(ring.geomId());
+	}
+
+	return true;
+} 
+
+bool TeOVERLAY::TeSplitRings(vector<TeLinearRing>& rings, vector<TeLinearRing>& ringsOut)
+{
+	ringsOut.clear();
+
+	for(unsigned int i = 0; i < rings.size(); ++i)
+	{
+		TeLineSet ringsAux;
+		
+		if(TeOVERLAY::TeSplitRing(rings[i], ringsAux) == false)
+			return false;
+
+		for(unsigned int j = 0; j < ringsAux.size(); ++j)
+			ringsOut.push_back(ringsAux[j]);
+	}
+
+	return true;
+}
+
+bool TeOVERLAY::TeCloneLine(const TeLine2D& lineIn, TeLine2D& lineOut, const unsigned int& minPts)
+{
+	lineOut.clear();
+
+	unsigned int lineSize = lineIn.size();
+
+	if(lineSize < 2)
+		return false;
+
+	lineOut.add(lineIn[0]);
+
+	for(unsigned int i = 1; i < lineSize; ++i)
+	{
+		if(!TeEquals(lineIn[i - 1], lineIn[i]))
+		{
+			lineOut.add(lineIn[i]);
+		}
+	}
+
+	if(lineOut.size() < minPts)
+		return false;
+
+	return true;
+}
+
+
+bool TeOVERLAY::TeClonePolygon(const TePolygon& polIn, TePolygon& polOut)
+{
+	polOut.clear();
+
+	unsigned int polSize = polIn.size();
+
+	if(polSize == 0)
+		return false;
+
+	for(unsigned int i = 0; i < polSize; ++i)
+	{
+		TeLine2D lineOut;
+
+		if(!TeCloneLine(polIn[i], lineOut, 4))
+			return false;
+
+		TeLinearRing ringOut(lineOut);
+
+		polOut.add(ringOut);
+	}
+
+	return true;
+}
+
+bool TeOVERLAY::TeClonePolygonSet(const TePolygonSet& polsIn, TePolygonSet& polsOut)
+{
+	polsOut.clear();
+
+	unsigned int polsSize = polsIn.size();
+
+	if(polsSize == 0)
+		return false;
+
+	for(unsigned int i = 0; i < polsSize; ++i)
+	{
+		TePolygon pol;
+
+		if(!TeClonePolygon(polsIn[i], pol))
+			return false;
+
+		polsOut.add(pol);
+	}
+
+	return true;
+}
+
diff --git a/src/terralib/kernel/TeOverlayUtils.h b/src/terralib/kernel/TeOverlayUtils.h
old mode 100755
new mode 100644
index 928847e..e37ba2e
--- a/src/terralib/kernel/TeOverlayUtils.h
+++ b/src/terralib/kernel/TeOverlayUtils.h
@@ -1,172 +1,172 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/**
- * @file TeOverlayUtils.h
- * @brief This file contains support algorithms for set operations.
- * These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone.
- * THIS IS FOR INTERNAL USE ONLY.
- */
-
-/** @ingroup SetOperations
-    THIS IS FOR INTERNAL USE ONLY: TerraLib set operation auxiliary functions. 
- *  @{
- */
-
-#ifndef  __TERRALIB_INTERNAL_OVERLAYUTILS_H
-#define  __TERRALIB_INTERNAL_OVERLAYUTILS_H
-
-// STL's include
-#include <map>
-#include <vector>
-#include <algorithm>
-using namespace std;
-
-#include "TeGeometry.h"
-#include "TeIntersector.h"
-
-
-namespace TeOVERLAY
-{
-
-//---------------- Auxiliary structures ----------------//
-//! Defines a functor for coordinate order during map insert and retrival: lexicograpgical order (xy)
-struct TL_DLL xyOrder
-{
-	//! Default operation for 'less than' tests.
-	bool operator()(const TeCoord2D& c1, const TeCoord2D& c2) const
-	{
-		if(c1.x_ < c2.x_)
-			return true;
-
-		if(c1.x_ > c2.x_)
-			return false;
-
-		if(c1.y_ < c2.y_)
-			return true;		
-
-		return false;
-	}
-};
-
-//! Type to index fragments end points: used during merge fase.
-typedef multimap<TeCoord2D, pair<unsigned int, TeLine2D>, xyOrder> TeLineIndex;
-
-//! Defines a functor for ordering segments during point in poly tests.
-struct TL_DLL segOrder
-{
-	//! Default operation for 'less than' tests.
-	bool operator()(const TeINTERSECTOR2::TeSegIdInPolygonSet& ip1, const TeINTERSECTOR2::TeSegIdInPolygonSet& ip2) const
-	{
-		if(ip1.polId_ < ip2.polId_)
-			return true;		
-
-		return false;
-	}
-};
-//---------------- Auxiliary operations for overlay ----------------//
-
-//! Verifies orientation for each line of polygon set, and reverse the orientation if need
-TL_DLL void TeFixOrientation(TePolygonSet& polSet, const short& outerOrientationToReverse, const short& innerOrientationToReverse);
-
-
-//! For each operation (union, intersection and difference) defines location for retrieval of fragments
-TL_DLL void TeChooseBoundaryLocation(const short& operation, short& locationRedFragments, short& locationBlueFragments);
-
-
-//! Erases from fragmentsIndex boundary fragments that are in oposite direction: each fragment must have a unique identifier in the pair first field (pair<unsigned int, TeLine2D>)
-TL_DLL void TeRemoveOpositeBoundaryFragments(TeLineIndex& fragmentsIndex);
-
-
-//! Erases from fragmentsIndex boundary fragments that are equals to another boundary fragment
-TL_DLL void TeRemoveSameBoundaryFragments(TeLineIndex& fragmentsIndex);
-
-//! Merge fragments ito first index (fragmentsIndex)
-TL_DLL void TeJoinFragments(TeLineIndex& fragmentsIndex, TeLineIndex& boundaryFragmentsIndex);
-
-//! Moves closed rings from fragmentsIndex to rins vector
-TL_DLL void TeFindAndMoveClosedRings(TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings);
-
-//! Gets a polygonset with outer rings and a vector with holes and try to find to what polygon the hole belongs to
-TL_DLL bool TeMountTopology(TePolygonSet& polysOut, vector<TeLinearRing>& holes);
-
-//! Make polygons from fragments.
-TL_DLL bool TeMergeFragments(TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings, const bool& doExaustive = false);
-
-//! For each linear ring, see it's orientation and classify in outer or inner ring
-TL_DLL bool TeClassifyRings(vector<TeLinearRing>& rings, TePolygonSet& polsOut, vector<TeLinearRing>& holes);
-
-//! Find fragments in the red set that satisfies locationFragments using blue set as reference
-TL_DLL void TeRtreeGetFragments(const TePolygonSet& bluePolygons, TeINTERSECTOR2::TeSegmentRTree& blueTree, TeLineSet& redFragments, const short& locationFragments, short& mask, TeLineIndex& redFragmentsIndex, vector<TeLinearRing>& rings);
-
-//! Find fragments in the same set that satisfies locationFragments
-TL_DLL void TeRtreeGetFragments(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree, TeLineSet& fragments, vector<pair<unsigned int, unsigned int> >& fragmentsIds, const short& locationFragments, short& mask, TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings);
-
-//! Removes fragments that may overlap with others: used in special cases during union process
-TL_DLL void TeRtreeRemoveFragments(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree, TeLineIndex &lineIndex, vector<pair<unsigned int, unsigned int> >& fragmentsIds, const short& locationFragments, short& mask, vector<TeLinearRing>& rings);
-
-//! Split rings if they have commom end points.
-/*
-	\param  ring		Ring to be broken.
-	\param  ringsOut	Resulting rings.
-	\return				Returns true if the operation successed otherwise returns false.
- */
-TL_DLL bool TeSplitRing(TeLinearRing& ring, TeLineSet& ringsOut);
-
-//! Split rings if they have commom end points.
-/*
-	\param  rings		A vector of linear rings to be broken.
-	\param  ringsOut	Resulting rings.
-	\return				Returns true if the operation successed otherwise returns false.
- */
-TL_DLL bool TeSplitRings(vector<TeLinearRing>& rings, vector<TeLinearRing>& ringsOut);
-
-//! Clone line point removing duplicated coordinates.
-/*
-	\param lineIn   Line to ble cloned.
-	\param lineOut  Cloned line without repeated points.  
-	\param minPts	This is a constant to check if the cloned line has the minimum number of points.
-	\return         Returns true if the operation successed otherwise returns false.
- */
-TL_DLL bool TeCloneLine(const TeLine2D& lineIn, TeLine2D& lineOut, const unsigned int& minPts);
-
-//! Clone polygon lines and try to remove duplicated coordinates from lines.
-/*
-	\param polIn       Polygon to be cloned.
-	\param polOut      Cloned polygon without repeated points.
-	\return            Returns true if the operation successed otherwise returns false.
- */
-TL_DLL bool TeClonePolygon(const TePolygon& polIn, TePolygon& polOut);
-
-//! Clone polygons lines and try to remove duplicated coordinates from lines.
-/*
-	\param polsIn       Polygons to be cloned.
-	\param polsOut      Cloned polygons without repeated points.
-	\return             Returns true if the operation successed otherwise returns false.
- */
-TL_DLL bool TeClonePolygonSet(const TePolygonSet& polsIn, TePolygonSet& polsOut);
-
-}	// end namespace TeOVERLAY
-
-#endif	// __TERRALIB_INTERNAL_OVERLAYUTILS_H
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/**
+ * @file TeOverlayUtils.h
+ * @brief This file contains support algorithms for set operations.
+ * These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone.
+ * THIS IS FOR INTERNAL USE ONLY.
+ */
+
+/** @ingroup SetOperations
+    THIS IS FOR INTERNAL USE ONLY: TerraLib set operation auxiliary functions. 
+ *  @{
+ */
+
+#ifndef  __TERRALIB_INTERNAL_OVERLAYUTILS_H
+#define  __TERRALIB_INTERNAL_OVERLAYUTILS_H
+
+// STL's include
+#include <map>
+#include <vector>
+#include <algorithm>
+using namespace std;
+
+#include "TeGeometry.h"
+#include "TeIntersector.h"
+
+
+namespace TeOVERLAY
+{
+
+//---------------- Auxiliary structures ----------------//
+//! Defines a functor for coordinate order during map insert and retrival: lexicograpgical order (xy)
+struct TL_DLL xyOrder
+{
+	//! Default operation for 'less than' tests.
+	bool operator()(const TeCoord2D& c1, const TeCoord2D& c2) const
+	{
+		if(c1.x_ < c2.x_)
+			return true;
+
+		if(c1.x_ > c2.x_)
+			return false;
+
+		if(c1.y_ < c2.y_)
+			return true;		
+
+		return false;
+	}
+};
+
+//! Type to index fragments end points: used during merge fase.
+typedef multimap<TeCoord2D, pair<unsigned int, TeLine2D>, xyOrder> TeLineIndex;
+
+//! Defines a functor for ordering segments during point in poly tests.
+struct TL_DLL segOrder
+{
+	//! Default operation for 'less than' tests.
+	bool operator()(const TeINTERSECTOR2::TeSegIdInPolygonSet& ip1, const TeINTERSECTOR2::TeSegIdInPolygonSet& ip2) const
+	{
+		if(ip1.polId_ < ip2.polId_)
+			return true;		
+
+		return false;
+	}
+};
+//---------------- Auxiliary operations for overlay ----------------//
+
+//! Verifies orientation for each line of polygon set, and reverse the orientation if need
+TL_DLL void TeFixOrientation(TePolygonSet& polSet, const short& outerOrientationToReverse, const short& innerOrientationToReverse);
+
+
+//! For each operation (union, intersection and difference) defines location for retrieval of fragments
+TL_DLL void TeChooseBoundaryLocation(const short& operation, short& locationRedFragments, short& locationBlueFragments);
+
+
+//! Erases from fragmentsIndex boundary fragments that are in oposite direction: each fragment must have a unique identifier in the pair first field (pair<unsigned int, TeLine2D>)
+TL_DLL void TeRemoveOpositeBoundaryFragments(TeLineIndex& fragmentsIndex);
+
+
+//! Erases from fragmentsIndex boundary fragments that are equals to another boundary fragment
+TL_DLL void TeRemoveSameBoundaryFragments(TeLineIndex& fragmentsIndex);
+
+//! Merge fragments ito first index (fragmentsIndex)
+TL_DLL void TeJoinFragments(TeLineIndex& fragmentsIndex, TeLineIndex& boundaryFragmentsIndex);
+
+//! Moves closed rings from fragmentsIndex to rins vector
+TL_DLL void TeFindAndMoveClosedRings(TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings);
+
+//! Gets a polygonset with outer rings and a vector with holes and try to find to what polygon the hole belongs to
+TL_DLL bool TeMountTopology(TePolygonSet& polysOut, vector<TeLinearRing>& holes);
+
+//! Make polygons from fragments.
+TL_DLL bool TeMergeFragments(TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings, const bool& doExaustive = false);
+
+//! For each linear ring, see it's orientation and classify in outer or inner ring
+TL_DLL bool TeClassifyRings(vector<TeLinearRing>& rings, TePolygonSet& polsOut, vector<TeLinearRing>& holes);
+
+//! Find fragments in the red set that satisfies locationFragments using blue set as reference
+TL_DLL void TeRtreeGetFragments(const TePolygonSet& bluePolygons, TeINTERSECTOR2::TeSegmentRTree& blueTree, TeLineSet& redFragments, const short& locationFragments, short& mask, TeLineIndex& redFragmentsIndex, vector<TeLinearRing>& rings);
+
+//! Find fragments in the same set that satisfies locationFragments
+TL_DLL void TeRtreeGetFragments(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree, TeLineSet& fragments, vector<pair<unsigned int, unsigned int> >& fragmentsIds, const short& locationFragments, short& mask, TeLineIndex& fragmentsIndex, vector<TeLinearRing>& rings);
+
+//! Removes fragments that may overlap with others: used in special cases during union process
+TL_DLL void TeRtreeRemoveFragments(const TePolygonSet& polygons, TeINTERSECTOR2::TeSegmentRTree& tree, TeLineIndex &lineIndex, vector<pair<unsigned int, unsigned int> >& fragmentsIds, const short& locationFragments, short& mask, vector<TeLinearRing>& rings);
+
+//! Split rings if they have commom end points.
+/*
+	\param  ring		Ring to be broken.
+	\param  ringsOut	Resulting rings.
+	\return				Returns true if the operation successed otherwise returns false.
+ */
+TL_DLL bool TeSplitRing(TeLinearRing& ring, TeLineSet& ringsOut);
+
+//! Split rings if they have commom end points.
+/*
+	\param  rings		A vector of linear rings to be broken.
+	\param  ringsOut	Resulting rings.
+	\return				Returns true if the operation successed otherwise returns false.
+ */
+TL_DLL bool TeSplitRings(vector<TeLinearRing>& rings, vector<TeLinearRing>& ringsOut);
+
+//! Clone line point removing duplicated coordinates.
+/*
+	\param lineIn   Line to ble cloned.
+	\param lineOut  Cloned line without repeated points.  
+	\param minPts	This is a constant to check if the cloned line has the minimum number of points.
+	\return         Returns true if the operation successed otherwise returns false.
+ */
+TL_DLL bool TeCloneLine(const TeLine2D& lineIn, TeLine2D& lineOut, const unsigned int& minPts);
+
+//! Clone polygon lines and try to remove duplicated coordinates from lines.
+/*
+	\param polIn       Polygon to be cloned.
+	\param polOut      Cloned polygon without repeated points.
+	\return            Returns true if the operation successed otherwise returns false.
+ */
+TL_DLL bool TeClonePolygon(const TePolygon& polIn, TePolygon& polOut);
+
+//! Clone polygons lines and try to remove duplicated coordinates from lines.
+/*
+	\param polsIn       Polygons to be cloned.
+	\param polsOut      Cloned polygons without repeated points.
+	\return             Returns true if the operation successed otherwise returns false.
+ */
+TL_DLL bool TeClonePolygonSet(const TePolygonSet& polsIn, TePolygonSet& polsOut);
+
+}	// end namespace TeOVERLAY
+
+#endif	// __TERRALIB_INTERNAL_OVERLAYUTILS_H
+
+
diff --git a/src/terralib/kernel/TePieBar.h b/src/terralib/kernel/TePieBar.h
old mode 100755
new mode 100644
index 32f9b11..3a2198f
--- a/src/terralib/kernel/TePieBar.h
+++ b/src/terralib/kernel/TePieBar.h
@@ -1,317 +1,317 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TePieBar.h
-    \brief This file contains a class that represents a char (pie or bar)  
-*/
-#ifndef TEPIEBAR_H
-#define TEPIEBAR_H
-
-#include "TeDefines.h"
-
-//! A class that represents a chart (pie or bar)
-class TL_DLL TePieBar
-{
-public:
-	enum			TePieBarInput {ALL, TABSEL, QUERYSEL, LEGEND, NOTTABSEL, NOTQUERYSEL, NOTLEGEND};
-	string			type_; // PIECHART or BARCHART
-	int				themeId_;
-	double			maxDiameter_;	
-	double			minDiameter_;	
-	double			diameter_;
-	string			dimensionAttr_;
-	vector<string>	attrVector_;
-	vector<TeColor> colorVector_;
-	double			maxHeight_;
-	double			minHeight_;
-	double			width_;
-	double			maxValue_;
-	double			minValue_;
-	bool			keepDimension_;
-	int				inputType_;
-	TeDatabase		*db_;
-	string			keyMove_;
-
-	TePieBar() {}
-
-	TePieBar(int themeId, TeDatabase* db)
-	{
-		themeId_ = themeId;
-		db_ = db;
-	}
-
-	TePieBar (const TePieBar& pb )
-	{
-		type_ = pb.type_;
-		themeId_ = pb.themeId_;
-		maxDiameter_ = pb.maxDiameter_;	
-		minDiameter_ = pb.minDiameter_;	
-		diameter_ = pb.diameter_;
-		dimensionAttr_ = pb.dimensionAttr_;
-		maxHeight_ = pb.maxHeight_;
-		minHeight_ = pb.minHeight_;
-		width_ = pb.width_;
-		maxValue_ = pb.maxValue_;
-		minValue_ = pb.minValue_;
-		keepDimension_ = pb.keepDimension_;
-		inputType_ = pb.inputType_;
-		db_ = pb.db_;
-		keyMove_ = pb.keyMove_;
-
-		attrVector_.clear();
-		colorVector_.clear();
-		int size = pb.attrVector_.size();
-		int i = 0;
-		while(i < size)
-		{	attrVector_.push_back(pb.attrVector_[i]);
-			colorVector_.push_back(pb.colorVector_[i]);
-			i++;
-		}
-	}
-
-	TePieBar& operator=(const TePieBar& pb)
-	{
-		type_ = pb.type_;
-		themeId_ = pb.themeId_;
-		maxDiameter_ = pb.maxDiameter_;	
-		minDiameter_ = pb.minDiameter_;	
-		diameter_ = pb.diameter_;
-		dimensionAttr_ = pb.dimensionAttr_;
-		maxHeight_ = pb.maxHeight_;
-		minHeight_ = pb.minHeight_;
-		width_ = pb.width_;
-		maxValue_ = pb.maxValue_;
-		minValue_ = pb.minValue_;
-		keepDimension_ = pb.keepDimension_;
-		inputType_ = pb.inputType_;
-		db_ = pb.db_;
-		keyMove_ = pb.keyMove_;
-
-		attrVector_.clear();
-		colorVector_.clear();
-		int size = pb.attrVector_.size();
-		int i = 0;
-		while(i < size)
-		{	attrVector_.push_back(pb.attrVector_[i]);
-			colorVector_.push_back(pb.colorVector_[i]);
-			i++;
-		}
-		return *this;
-	}
-
-	~TePieBar() {}
-
-	void init(int themeId, TeDatabase* db)
-	{
-		themeId_ = themeId;
-		db_ = db;
-	}
-
-	bool locate(TeCoord2D pt, double delta)
-	{
-		keyMove_.clear();
-		string	TS = "AuxTheme" + Te2String(themeId_);
-		string xmin = Te2String(pt.x()-delta);
-		string xmax = Te2String(pt.x()+delta);
-		string ymin = Te2String(pt.y()-delta);
-		string ymax = Te2String(pt.y()+delta);
-
-		TeDatabasePortal* portal = db_->getPortal();
-		string sel = "SELECT SELKEY FROM " + TS + " WHERE ";
-		sel += "PIEBARX > " + xmin + " AND ";
-		sel += "PIEBARX < " + xmax + " AND ";
-		sel += "PIEBARY > " + ymin + " AND ";
-		sel += "PIEBARY < " + ymax;
-		if(portal->query(sel) == false)
-		{
-			delete portal;
-			return false;
-		}
-
-		bool b = portal->fetchRow(0);
-		if(b == true)
-			keyMove_ = portal->getData(0);
-		delete portal;
-
-		if(keyMove_.empty() == false)
-			return true;
-		return false;
-	}
-
-	void move(TeCoord2D pt)
-	{
-		if(keyMove_.empty() == true)
-			return;
-
-		string	x = Te2String(pt.x());
-		string	y = Te2String(pt.y());
-		string	TS = "AuxTheme" + Te2String(themeId_);
-		string mover = "UPDATE " + TS + " SET PIEBARX = " + x + ", PIEBARY = " + y;
-		mover += " WHERE SELKEY = '" + keyMove_ + "'";
-		db_->execute(mover);
-	}
-
-	bool load()
-	{
-		TeDatabasePortal* portal = db_->getPortal();
-		string sel = "SELECT * FROM piebars WHERE themeId = " + Te2String(themeId_);
-		if(portal->query(sel))
-		{
-			bool b = portal->fetchRow(0);
-			if(b == false)
-			{
-				delete portal;
-				return false;
-			}
-			type_ = portal->getData("type");
-			maxDiameter_ = portal->getDouble("maxDiameter");
-			minDiameter_ = portal->getDouble("minDiameter");
-			diameter_ = portal->getDouble("diameter"));
-			string	attr = portal->getData("dimensionAttr");
-			dimensionAttr_ = attr;
-			maxHeight_ = portal->getDouble("maxHeight");
-			minHeight_ = portal->getDouble("minHeight");
-			width_ = portal->getDouble("width"));
-			maxValue_ = portal->getDouble("maxValue");
-			minValue_ = atof(portal->getData("minValue");
-			keepDimension_ = portal->getDouble("keepDimension");
-			inputType_ = portal->getDouble("inputType");
-			int i;
-			for(i=0; i<10; i++)
-			{
-				string attr = "attr" + Te2String(i+1);
-				string vattr = portal->getData(attr);
-				if(vattr.empty() == true)
-					break;
-				attrVector_.push_back(vattr);
-
-				string red = "red" + Te2String(i+1);
-				string green = "green" + Te2String(i+1);
-				string blue = "blue" + Te2String(i+1);
-				TeColor cor;
-				cor.red_ = atoi(portal->getData(red));
-				cor.green_ = atoi(portal->getData(green));
-				cor.blue_ = atoi(portal->getData(blue));
-				colorVector_.push_back(cor);
-			}
-			delete portal;
-			return true;
-		}
-		delete portal;
-		return false;
-	}
-	
-	void save()
-	{
-		int	i;
-		TeDatabasePortal* portal = db_->getPortal();
-		bool b = portal->query("SELECT * FROM piebars");
-		delete portal;
-		if(b == false)
-		{
-			string criar = "CREATE TABLE piebars (themeId INTEGER,";
-			criar += "type VARCHAR(16) DEFAULT NULL,";
-			criar += "maxDiameter DOUBLE DEFAULT NULL,";
-			criar += "minDiameter DOUBLE DEFAULT NULL,";
-			criar += "diameter DOUBLE DEFAULT NULL,";
-			criar += "dimensionAttr  VARCHAR(64) DEFAULT NULL,";
-			criar += "maxHeight DOUBLE DEFAULT NULL,";
-			criar += "minHeight DOUBLE DEFAULT NULL,";
-			criar += "width DOUBLE DEFAULT NULL,";
-			criar += "maxValue DOUBLE DEFAULT NULL,";
-			criar += "minValue DOUBLE DEFAULT NULL,";
-			criar += "keepDimension INTEGER DEFAULT 0,";
-			criar += "inputType INTEGER DEFAULT 0,";
-			for (i=0; i<10; i++)
-			{
-				criar += "attr" + Te2String(i+1) + " VARCHAR(64) DEFAULT NULL,";
-				criar += "red" + Te2String(i+1) + " INTEGER DEFAULT NULL,";
-				criar += "green" + Te2String(i+1) + " INTEGER DEFAULT NULL,";
-				criar += "blue" + Te2String(i+1) + " INTEGER DEFAULT NULL,";
-			}
-			criar.erase(criar.size()-1, 1);
-			criar += ")";
-			db_->execute(criar);
-		}
-
-		string del = "DELETE FROM piebars WHERE themeId = " + Te2String(themeId_);
-		db_->execute(del);
-
-		if(attrVector_.size() == 0)
-			return;
-		string up = "INSERT INTO piebars (themeId, type, maxDiameter, ";
-		up += "minDiameter, diameter, dimensionAttr, maxHeight, minHeight, ";
-		up += "width, maxValue, minValue, keepDimension, inputType, ";
-		for (i=0; i<attrVector_.size() && i<10; i++)
-		{
-			up += "attr" + Te2String(i+1) + ", ";
-			up += "red" + Te2String(i+1) + ", ";
-			up += "green" + Te2String(i+1) + ", ";
-			up += "blue" + Te2String(i+1) + ", ";
-		}
-		up.erase(up.size()-2, 2);
-		up += ")";
-
-		up += " VALUES (" + Te2String(themeId_) + ", ";
-		up += "'" + type_ + "', ";
-		up += Te2String(maxDiameter_) + ", ";
-		up += Te2String(minDiameter_) + ", ";
-		up += Te2String(diameter_) + ", ";
-		up += "'" + dimensionAttr_ + "', ";
-		up += Te2String(maxHeight_) + ", ";
-		up += Te2String(minHeight_) + ", ";
-		up += Te2String(width_) + ", ";
-		up += Te2String(maxValue_) + ", ";
-		up += Te2String(minValue_) + ", ";
-		up += Te2String(keepDimension_) + ", ";
-		up += Te2String(inputType_) + ", ";
-		for (i=0; i<attrVector_.size() && i<10; i++)
-		{
-			up += "'" + attrVector_[i] + "', ";
-			up += Te2String(colorVector_[i].red_) + ", ";
-			up += Te2String(colorVector_[i].green_) + ", ";
-			up += Te2String(colorVector_[i].blue_) + ", ";
-		}
-		up.erase(up.size()-2, 2);
-		up += ")";
-		db_->execute(up);
-	}
-	
-	void remove()
-	{
-		TeDatabasePortal* portal = db_->getPortal();
-		bool b = portal->query("SELECT * FROM piebars");
-		delete portal;
-		if(b == false)
-			return;
-
-		string del = "DELETE FROM piebars WHERE themeId = " + Te2String(themeId_);
-		db_->execute(del);
-	}
-};
-
-#endif
-
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TePieBar.h
+    \brief This file contains a class that represents a char (pie or bar)  
+*/
+#ifndef TEPIEBAR_H
+#define TEPIEBAR_H
+
+#include "TeDefines.h"
+
+//! A class that represents a chart (pie or bar)
+class TL_DLL TePieBar
+{
+public:
+	enum			TePieBarInput {ALL, TABSEL, QUERYSEL, LEGEND, NOTTABSEL, NOTQUERYSEL, NOTLEGEND};
+	string			type_; // PIECHART or BARCHART
+	int				themeId_;
+	double			maxDiameter_;	
+	double			minDiameter_;	
+	double			diameter_;
+	string			dimensionAttr_;
+	vector<string>	attrVector_;
+	vector<TeColor> colorVector_;
+	double			maxHeight_;
+	double			minHeight_;
+	double			width_;
+	double			maxValue_;
+	double			minValue_;
+	bool			keepDimension_;
+	int				inputType_;
+	TeDatabase		*db_;
+	string			keyMove_;
+
+	TePieBar() {}
+
+	TePieBar(int themeId, TeDatabase* db)
+	{
+		themeId_ = themeId;
+		db_ = db;
+	}
+
+	TePieBar (const TePieBar& pb )
+	{
+		type_ = pb.type_;
+		themeId_ = pb.themeId_;
+		maxDiameter_ = pb.maxDiameter_;	
+		minDiameter_ = pb.minDiameter_;	
+		diameter_ = pb.diameter_;
+		dimensionAttr_ = pb.dimensionAttr_;
+		maxHeight_ = pb.maxHeight_;
+		minHeight_ = pb.minHeight_;
+		width_ = pb.width_;
+		maxValue_ = pb.maxValue_;
+		minValue_ = pb.minValue_;
+		keepDimension_ = pb.keepDimension_;
+		inputType_ = pb.inputType_;
+		db_ = pb.db_;
+		keyMove_ = pb.keyMove_;
+
+		attrVector_.clear();
+		colorVector_.clear();
+		int size = pb.attrVector_.size();
+		int i = 0;
+		while(i < size)
+		{	attrVector_.push_back(pb.attrVector_[i]);
+			colorVector_.push_back(pb.colorVector_[i]);
+			i++;
+		}
+	}
+
+	TePieBar& operator=(const TePieBar& pb)
+	{
+		type_ = pb.type_;
+		themeId_ = pb.themeId_;
+		maxDiameter_ = pb.maxDiameter_;	
+		minDiameter_ = pb.minDiameter_;	
+		diameter_ = pb.diameter_;
+		dimensionAttr_ = pb.dimensionAttr_;
+		maxHeight_ = pb.maxHeight_;
+		minHeight_ = pb.minHeight_;
+		width_ = pb.width_;
+		maxValue_ = pb.maxValue_;
+		minValue_ = pb.minValue_;
+		keepDimension_ = pb.keepDimension_;
+		inputType_ = pb.inputType_;
+		db_ = pb.db_;
+		keyMove_ = pb.keyMove_;
+
+		attrVector_.clear();
+		colorVector_.clear();
+		int size = pb.attrVector_.size();
+		int i = 0;
+		while(i < size)
+		{	attrVector_.push_back(pb.attrVector_[i]);
+			colorVector_.push_back(pb.colorVector_[i]);
+			i++;
+		}
+		return *this;
+	}
+
+	~TePieBar() {}
+
+	void init(int themeId, TeDatabase* db)
+	{
+		themeId_ = themeId;
+		db_ = db;
+	}
+
+	bool locate(TeCoord2D pt, double delta)
+	{
+		keyMove_.clear();
+		string	TS = "AuxTheme" + Te2String(themeId_);
+		string xmin = Te2String(pt.x()-delta);
+		string xmax = Te2String(pt.x()+delta);
+		string ymin = Te2String(pt.y()-delta);
+		string ymax = Te2String(pt.y()+delta);
+
+		TeDatabasePortal* portal = db_->getPortal();
+		string sel = "SELECT SELKEY FROM " + TS + " WHERE ";
+		sel += "PIEBARX > " + xmin + " AND ";
+		sel += "PIEBARX < " + xmax + " AND ";
+		sel += "PIEBARY > " + ymin + " AND ";
+		sel += "PIEBARY < " + ymax;
+		if(portal->query(sel) == false)
+		{
+			delete portal;
+			return false;
+		}
+
+		bool b = portal->fetchRow(0);
+		if(b == true)
+			keyMove_ = portal->getData(0);
+		delete portal;
+
+		if(keyMove_.empty() == false)
+			return true;
+		return false;
+	}
+
+	void move(TeCoord2D pt)
+	{
+		if(keyMove_.empty() == true)
+			return;
+
+		string	x = Te2String(pt.x());
+		string	y = Te2String(pt.y());
+		string	TS = "AuxTheme" + Te2String(themeId_);
+		string mover = "UPDATE " + TS + " SET PIEBARX = " + x + ", PIEBARY = " + y;
+		mover += " WHERE SELKEY = '" + keyMove_ + "'";
+		db_->execute(mover);
+	}
+
+	bool load()
+	{
+		TeDatabasePortal* portal = db_->getPortal();
+		string sel = "SELECT * FROM piebars WHERE themeId = " + Te2String(themeId_);
+		if(portal->query(sel))
+		{
+			bool b = portal->fetchRow(0);
+			if(b == false)
+			{
+				delete portal;
+				return false;
+			}
+			type_ = portal->getData("type");
+			maxDiameter_ = portal->getDouble("maxDiameter");
+			minDiameter_ = portal->getDouble("minDiameter");
+			diameter_ = portal->getDouble("diameter"));
+			string	attr = portal->getData("dimensionAttr");
+			dimensionAttr_ = attr;
+			maxHeight_ = portal->getDouble("maxHeight");
+			minHeight_ = portal->getDouble("minHeight");
+			width_ = portal->getDouble("width"));
+			maxValue_ = portal->getDouble("maxValue");
+			minValue_ = atof(portal->getData("minValue");
+			keepDimension_ = portal->getDouble("keepDimension");
+			inputType_ = portal->getDouble("inputType");
+			int i;
+			for(i=0; i<10; i++)
+			{
+				string attr = "attr" + Te2String(i+1);
+				string vattr = portal->getData(attr);
+				if(vattr.empty() == true)
+					break;
+				attrVector_.push_back(vattr);
+
+				string red = "red" + Te2String(i+1);
+				string green = "green" + Te2String(i+1);
+				string blue = "blue" + Te2String(i+1);
+				TeColor cor;
+				cor.red_ = atoi(portal->getData(red));
+				cor.green_ = atoi(portal->getData(green));
+				cor.blue_ = atoi(portal->getData(blue));
+				colorVector_.push_back(cor);
+			}
+			delete portal;
+			return true;
+		}
+		delete portal;
+		return false;
+	}
+	
+	void save()
+	{
+		int	i;
+		TeDatabasePortal* portal = db_->getPortal();
+		bool b = portal->query("SELECT * FROM piebars");
+		delete portal;
+		if(b == false)
+		{
+			string criar = "CREATE TABLE piebars (themeId INTEGER,";
+			criar += "type VARCHAR(16) DEFAULT NULL,";
+			criar += "maxDiameter DOUBLE DEFAULT NULL,";
+			criar += "minDiameter DOUBLE DEFAULT NULL,";
+			criar += "diameter DOUBLE DEFAULT NULL,";
+			criar += "dimensionAttr  VARCHAR(64) DEFAULT NULL,";
+			criar += "maxHeight DOUBLE DEFAULT NULL,";
+			criar += "minHeight DOUBLE DEFAULT NULL,";
+			criar += "width DOUBLE DEFAULT NULL,";
+			criar += "maxValue DOUBLE DEFAULT NULL,";
+			criar += "minValue DOUBLE DEFAULT NULL,";
+			criar += "keepDimension INTEGER DEFAULT 0,";
+			criar += "inputType INTEGER DEFAULT 0,";
+			for (i=0; i<10; i++)
+			{
+				criar += "attr" + Te2String(i+1) + " VARCHAR(64) DEFAULT NULL,";
+				criar += "red" + Te2String(i+1) + " INTEGER DEFAULT NULL,";
+				criar += "green" + Te2String(i+1) + " INTEGER DEFAULT NULL,";
+				criar += "blue" + Te2String(i+1) + " INTEGER DEFAULT NULL,";
+			}
+			criar.erase(criar.size()-1, 1);
+			criar += ")";
+			db_->execute(criar);
+		}
+
+		string del = "DELETE FROM piebars WHERE themeId = " + Te2String(themeId_);
+		db_->execute(del);
+
+		if(attrVector_.size() == 0)
+			return;
+		string up = "INSERT INTO piebars (themeId, type, maxDiameter, ";
+		up += "minDiameter, diameter, dimensionAttr, maxHeight, minHeight, ";
+		up += "width, maxValue, minValue, keepDimension, inputType, ";
+		for (i=0; i<attrVector_.size() && i<10; i++)
+		{
+			up += "attr" + Te2String(i+1) + ", ";
+			up += "red" + Te2String(i+1) + ", ";
+			up += "green" + Te2String(i+1) + ", ";
+			up += "blue" + Te2String(i+1) + ", ";
+		}
+		up.erase(up.size()-2, 2);
+		up += ")";
+
+		up += " VALUES (" + Te2String(themeId_) + ", ";
+		up += "'" + type_ + "', ";
+		up += Te2String(maxDiameter_) + ", ";
+		up += Te2String(minDiameter_) + ", ";
+		up += Te2String(diameter_) + ", ";
+		up += "'" + dimensionAttr_ + "', ";
+		up += Te2String(maxHeight_) + ", ";
+		up += Te2String(minHeight_) + ", ";
+		up += Te2String(width_) + ", ";
+		up += Te2String(maxValue_) + ", ";
+		up += Te2String(minValue_) + ", ";
+		up += Te2String(keepDimension_) + ", ";
+		up += Te2String(inputType_) + ", ";
+		for (i=0; i<attrVector_.size() && i<10; i++)
+		{
+			up += "'" + attrVector_[i] + "', ";
+			up += Te2String(colorVector_[i].red_) + ", ";
+			up += Te2String(colorVector_[i].green_) + ", ";
+			up += Te2String(colorVector_[i].blue_) + ", ";
+		}
+		up.erase(up.size()-2, 2);
+		up += ")";
+		db_->execute(up);
+	}
+	
+	void remove()
+	{
+		TeDatabasePortal* portal = db_->getPortal();
+		bool b = portal->query("SELECT * FROM piebars");
+		delete portal;
+		if(b == false)
+			return;
+
+		string del = "DELETE FROM piebars WHERE themeId = " + Te2String(themeId_);
+		db_->execute(del);
+	}
+};
+
+#endif
+
+
+
+
+
diff --git a/src/terralib/kernel/TePolygonSetProperties.cpp b/src/terralib/kernel/TePolygonSetProperties.cpp
new file mode 100644
index 0000000..6e8bc16
--- /dev/null
+++ b/src/terralib/kernel/TePolygonSetProperties.cpp
@@ -0,0 +1,710 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include "TePolygonSetProperties.h"
+
+#include "TeGeometryAlgorithms.h"
+#include "TeGeometry.h"
+#include "TeAgnostic.h"
+#include "TeRaster.h"
+#include "TeSharedPtr.h"
+#include "TeMatrix.h"
+
+TePolygonSetProperties::TePolygonSetProperties( const TePolygonSet& polSet )
+: polSet_( polSet )
+{
+}
+
+TePolygonSetProperties::~TePolygonSetProperties()
+{
+}
+
+double TePolygonSetProperties::getPolygonArea( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  
+  return TeGeometryArea( polSet_[ polIndex ] );
+}
+
+double TePolygonSetProperties::getPolygonBoxArea( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  
+  return TeGeometryArea( TeMakePolygon( polSet_[ polIndex ].box() ) );
+}
+
+double TePolygonSetProperties::getPolygonPerimeter( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+
+  double perimeter = 0.0;
+  TeLinearRing::iterator ring_it = polSet_[ polIndex ][ 0 ].begin();
+  while( ring_it != ( polSet_[ polIndex ][ 0 ].end() - 1 ) )
+  {
+    perimeter += TeDistance( *ring_it, *(ring_it + 1) );
+    ++ring_it;
+  }
+  
+  return perimeter;
+}
+
+double TePolygonSetProperties::getPolygonFractalDimension( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+
+  double area = getPolygonArea( polIndex );
+  if ( area == 1.0 )
+    area = 1.00000001;
+
+  return 2 * log( 0.25 * getPolygonPerimeter( polIndex ) ) 
+         / log ( area );
+}
+
+double TePolygonSetProperties::getPolygonPerimeterAreaRatio( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  
+  return getPolygonPerimeter( polIndex ) 
+         / getPolygonArea( polIndex );
+}
+
+double TePolygonSetProperties::getPolygonCompacity( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  
+  return getPolygonPerimeterAreaRatio( polIndex ) 
+         / sqrt( getPolygonArea( polIndex ) );
+}
+
+double TePolygonSetProperties::getPolygonShapeIndex( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  
+  return getPolygonPerimeter( polIndex ) 
+         / ( 4 * sqrt( getPolygonArea( polIndex ) ) );
+}
+
+double TePolygonSetProperties::getPolygonDensity( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  
+  return getPolygonArea( polIndex ) 
+         / getPolygonRadius( polIndex );
+}
+
+double TePolygonSetProperties::getPolygonLength( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  
+  TePolygon rotatedPolygon = rotatePolygon( polIndex, -getPolygonAngle( polIndex ) );
+  return rotatedPolygon.box().height();
+}
+
+double TePolygonSetProperties::getPolygonWidth( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  
+  TePolygon rotatedPolygon = rotatePolygon( polIndex, -getPolygonAngle( polIndex ) );
+  return rotatedPolygon.box().width();
+}
+
+double TePolygonSetProperties::getPolygonCircle( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  
+  double r = getPolygonRadius( polIndex );
+  return getPolygonArea( polIndex ) 
+         / ( TePI * r * r );
+}
+
+double TePolygonSetProperties::getPolygonContiguity( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+
+  TeSharedPtr< TeRaster > raster( getRasterInPolygon( polIndex ) );
+  if ( raster->params().nlines_ <= 0 || raster->params().nlines_ <= 0 )
+    return 0.0;
+
+  TeRaster::iteratorPoly it = raster->begin( polSet_[ polIndex ], TeBoxPixelIn, 0 );
+  TeMatrix matrix_contig;
+  matrix_contig.Init( 4 + raster->params().nlines_, 4 + raster->params().ncols_, 0.0 );
+  while( it != raster->end( polSet_[ polIndex ], TeBoxPixelIn, 0 ) )
+  {
+    int x = it.currentColumn(),
+        y = it.currentLine();
+    matrix_contig( y + 2, x + 2 ) = 1.0;
+    ++it;
+  }
+
+  TeMatrix kernel;
+  kernel.Init(3, 3, 1.0);
+  kernel(0, 1) = 2.0;  
+  kernel(1, 0) = 2.0;  
+  kernel(1, 2) = 2.0;  
+  kernel(2, 1) = 2.0;
+  double local_contiguity;
+  double contiguity = 0.0;
+  unsigned N = 0;
+
+  for (int i = 1; i < matrix_contig.Nrow() - 1; i++)
+    for (int j = 1; j < matrix_contig.Ncol() - 1; j++)
+    {
+      if ( matrix_contig(i, j) == 1.0 )
+        N++;
+      local_contiguity = 0.0;
+      for (int ii = -1; ii < 2; ii++)
+        for (int jj = -1; jj < 2; jj++)
+          local_contiguity += matrix_contig(i + ii, j + jj) * kernel(ii + 1, jj + 1);
+      contiguity += local_contiguity;
+    }
+
+  contiguity /= (double) N;
+  contiguity -= 1.0;
+  contiguity /= 12.0;
+
+  return contiguity;
+}
+
+double TePolygonSetProperties::getPolygonGyrationRadius( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+
+  TeSharedPtr< TeRaster > raster( getRasterInPolygon( polIndex ) );
+  TeRaster::iteratorPoly it = raster->begin( polSet_[ polIndex ], TeBoxPixelIn, 0 );
+  vector<TeCoord2D> xyPositionsVector;
+  while( it != raster->end( polSet_[ polIndex ], TeBoxPixelIn, 0 ) )
+  {
+    int x = it.currentColumn(),
+        y = it.currentLine();
+    TeCoord2D xy(x, y);
+	  xy = raster->index2Coord( xy );
+    xyPositionsVector.push_back(xy);
+    ++it;
+  }
+  TEAGN_DEBUG_CONDITION( xyPositionsVector.size() > 0, "No data" )
+
+  double sum = 0.0;
+  TeCoord2D centroid = TeFindCentroid( polSet_[ polIndex ] );
+  for ( unsigned i = 0; i < xyPositionsVector.size(); i++ )
+    sum += TeDistance( centroid, xyPositionsVector[ i ] );
+
+  return sum / xyPositionsVector.size();
+}
+
+double TePolygonSetProperties::getPolygonEllipticFit( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+
+  vector<TeCoord2D> borderCoordinates = getBorderCoordinates( polIndex );
+  double a = getPolygonArea( polIndex );
+  double b = TeGeometryArea( createEllipse( fitEllipse( borderCoordinates ) ) );
+  // is b nan?
+  if ( b != b ) 
+  {
+    a = 1.0;
+    b = 0.0;
+  }
+
+  return (a > b ? b / a : a / b);
+}
+
+double TePolygonSetProperties::getPolygonAngle( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  vector<TeCoord2D> borderCoordinates = getBorderCoordinates( polIndex );
+  TePolygon ellipse = createEllipse( fitEllipse( borderCoordinates ) );
+  double max_distance = 0.0;
+  TeCoord2D p1;
+  TeCoord2D p2;
+  TeLinearRing::iterator ring_it = ellipse[ 0 ].begin();
+  while( ring_it != ( ellipse[ 0 ].end() - 1 ) )
+  {
+    if ( TeDistance( *ring_it, *(ring_it + 1) ) > max_distance )
+    {
+      max_distance = TeDistance( *ring_it, *(ring_it + 1) );
+      p1 = *ring_it;
+      p2 = *(ring_it + 1);
+    }
+    ++ring_it;
+  }
+  double angle = atan( ( p2.y() - p1.y() ) / ( p2.x() - p1.x() ) );
+  if ( angle < 0.0 )
+    angle *= -1.0;
+  // is angle nan?
+  if ( angle != angle ) 
+    angle = 0.0;
+
+  return angle;
+}
+
+double TePolygonSetProperties::getPolygonRectangularFit( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+
+  double rectangularFit = getPolygonArea( polIndex ) / 
+                          getPolygonBoxArea( polIndex );
+  TePolygon rotatedPolygon = rotatePolygon( polIndex, -getPolygonAngle( polIndex ) );
+  double rotatedFit = getPolygonArea( polIndex ) /
+                      TeGeometryArea( TeMakePolygon( rotatedPolygon.box() ) );
+  if (rotatedFit > rectangularFit)
+    rectangularFit = rotatedFit;
+
+  return rectangularFit;
+}
+
+void TePolygonSetProperties::printProperties( int polIndex )
+{
+  unsigned start = 0;
+  unsigned finish = polSet_.size();
+  if ( polIndex != -1 )
+  {
+    start = polIndex;
+    finish = polIndex + 1;
+  }
+  
+  for (unsigned i = start; i < finish; i++)
+  {
+    cout << "Polygon " << i << endl;
+    cout << "  getPolygonArea: " << getPolygonArea(i) << endl;
+    cout << "  getPolygonAngle: " << getPolygonAngle(i) * 180 / TePI << endl;
+    cout << "  getPolygonBoxArea: " << getPolygonBoxArea(i) << endl;
+    cout << "  getPolygonCircle: " << getPolygonCircle(i) << endl;
+    cout << "  getPolygonCompacity: " << getPolygonCompacity(i) << endl;
+    cout << "  getPolygonContiguity: " << getPolygonContiguity(i) << endl;
+    cout << "  getPolygonDensity: " << getPolygonDensity(i) << endl;
+    cout << "  getPolygonEllipticFit: " << getPolygonEllipticFit(i) << endl;
+    cout << "  getPolygonFractalDimension: " << getPolygonFractalDimension(i) << endl;
+    cout << "  getPolygonGyrationRadius: " << getPolygonGyrationRadius(i) << endl;
+    cout << "  getPolygonLength: " << getPolygonLength(i) << endl;
+    cout << "  getPolygonPerimeter: " << getPolygonPerimeter(i) << endl;
+    cout << "  getPolygonPerimeterAreaRatio: " << getPolygonPerimeterAreaRatio(i) << endl;
+    cout << "  getPolygonRadius: " << getPolygonRadius(i) << endl;
+    cout << "  getPolygonRectangularFit: " << getPolygonRectangularFit(i) << endl;
+    cout << "  getPolygonShapeIndex: " << getPolygonShapeIndex(i) << endl;
+    cout << "  getPolygonWidth: " << getPolygonWidth(i) << endl;
+  }
+}
+
+// private functions
+double TePolygonSetProperties::getPolygonRadius( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+  
+  double max_radius = -1;
+  double radius;
+  TeCoord2D centroid = TeFindCentroid( polSet_[ polIndex ] );
+
+  TePolygon::iterator polygon_it = polSet_[ polIndex ].begin();
+  while( polygon_it != polSet_[ polIndex ].end() )
+  {
+    TeLinearRing::iterator ring_it = (*polygon_it).begin();
+    while( ring_it != (*polygon_it).end() )
+    {
+      radius = TeDistance( *ring_it, centroid );
+      if ( radius > max_radius )
+        max_radius = radius;
+      ++ring_it;
+    }
+    ++polygon_it;
+  }
+
+  return max_radius;
+}
+
+vector<TeCoord2D> TePolygonSetProperties::getBorderCoordinates( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+
+  vector<TeCoord2D> borderCoordinates;
+  TeLinearRing::iterator ring_it = polSet_[ polIndex ][ 0 ].begin();
+
+  TeCoord2D a;
+  TeCoord2D b;
+  while( ring_it != polSet_[ polIndex ][ 0 ].end() - 1 )
+  {
+    borderCoordinates.push_back( *ring_it );
+
+    // add intermediate coordinate
+    a = *ring_it;
+    b = *(ring_it + 1);
+    TeCoord2D semiCoordinate( ( a.x() + b.x() ) / 2, ( a.y() + b.y() ) / 2 );
+    borderCoordinates.push_back( semiCoordinate );
+
+    ++ring_it;
+  }
+
+  return borderCoordinates;
+}
+
+double getMean( vector<TeCoord2D> xyPositions, char coord )
+{
+  if ( xyPositions.size() == 0 )
+    return 0.0;
+
+  double sum = 0.0;
+  if ( coord == 'X' )
+  {
+    for ( unsigned i = 0; i < xyPositions.size(); i++)
+      sum += xyPositions[i].x();
+  }
+  else if ( coord == 'Y' )
+  {
+    for ( unsigned i = 0; i < xyPositions.size(); i++)
+      sum += xyPositions[i].y();
+  }
+
+  return sum / xyPositions.size();
+}
+
+double getMax( vector<TeCoord2D> xyPositions, char coord )
+{
+  double max = 0.0;
+  if ( coord == 'X' )
+  {
+    for ( unsigned i = 0; i < xyPositions.size(); i++)
+      if ( xyPositions[i].x() > max )
+        max = xyPositions[i].x();
+  } 
+  else if ( coord == 'Y' )
+  {
+    for ( unsigned i = 0; i < xyPositions.size(); i++)
+      if ( xyPositions[i].y() > max )
+        max = xyPositions[i].y();
+  } 
+
+  return max;
+}
+
+double getMin( vector<TeCoord2D> xyPositions, char coord )
+{
+  double min = 99999999.9;
+  if ( coord == 'X' )
+  {
+    for ( unsigned i = 0; i < xyPositions.size(); i++)
+      if ( xyPositions[i].x() < min )
+        min = xyPositions[i].x();
+  } 
+  else if ( coord == 'Y' )
+  {
+    for ( unsigned i = 0; i < xyPositions.size(); i++)
+      if ( xyPositions[i].y() < min )
+        min = xyPositions[i].y();
+  } 
+
+  return min;
+}
+
+vector<double> TePolygonSetProperties::fitEllipse( vector<TeCoord2D> xyPositions )
+{
+  double meanX = getMean( xyPositions, 'X' );
+  double meanY = getMean( xyPositions, 'Y' );
+  double maxX = getMax( xyPositions, 'X' );
+  double maxY = getMax( xyPositions, 'Y' );
+  double minX = getMin( xyPositions, 'X' );
+  double minY = getMin( xyPositions, 'Y' );
+  double sx = (maxX - minX) / 2;
+  double sy = (maxY - minY) / 2;
+
+  vector<double> x;
+  vector<double> y;
+
+  // normalizing data
+  for ( unsigned i = 0; i < xyPositions.size(); i++ )
+  {
+    x.push_back( ( xyPositions[ i ].x() - meanX ) / sx );
+    y.push_back( ( xyPositions[ i ].y() - meanY ) / sy );
+  }
+   
+  // creating design matrix
+  TeMatrix D;
+  TeMatrix Dt;
+  D.Init( x.size(), 6, 0.0 );
+  for ( unsigned i = 0; i < xyPositions.size(); i++ )
+  {
+    D( i, 0 ) = x[ i ] * x[ i ];
+    D( i, 1 ) = x[ i ] * y[ i ];
+    D( i, 2 ) = y[ i ] * y[ i ];
+    D( i, 3 ) = x[ i ];
+    D( i, 4 ) = y[ i ];
+    D( i, 5 ) = 1.0;
+  }
+  D.Transpose( Dt );
+
+  // creating scatter matrix
+  TeMatrix S;
+  S = Dt * D;
+
+  // creating constant matrix
+  TeMatrix C;
+  C.Init( 6, 6, 0.0 );
+  C( 2, 0 ) = -2.0;
+  C( 1, 1 ) = 1.0;
+  C( 0, 2 ) = -2.0;
+
+  TeMatrix iS;
+  S.Inverse( iS );
+
+  TeMatrix productiSC;
+  productiSC = iS * C;
+
+  // extract eigenvalues and eigenvectors
+  double evec[100];
+  for ( int i = 0; i < productiSC.Ncol(); i++ )
+    evec[ i ] = 0.0;
+  findEigenVectors( productiSC, evec );
+
+  vector<double> tempA;
+  for ( int i = 0; i < productiSC.Ncol(); i++ )
+    tempA.push_back( evec[i] );
+
+  // normalizing resultant values
+  vector<double> A(6);
+  A[ 0 ] = tempA[ 0 ] * sy * sy;
+  A[ 1 ] = tempA[ 1 ] * sx * sy;
+  A[ 2 ] = tempA[ 2 ] * sx * sx;
+  A[ 3 ] = - 2 * tempA[ 0 ] * sy * sy * meanX 
+           - tempA[ 1 ] * sx * sy * meanY 
+           + tempA[ 3 ] * sx * sy * sy;
+  A[ 4 ] = - tempA[ 1 ] * sx * sy * meanX
+           - 2 * tempA[ 2 ] * sx * sx * meanY
+           + tempA[ 4 ] * sx * sx * sy;
+  A[ 5 ] = tempA[ 0 ] * sy * sy * meanX * meanX
+           + tempA[ 1 ] * sx * sy * meanX * meanY
+           + tempA[ 2 ] * sx * sx * meanY * meanY
+           - tempA[ 3 ] * sx * sy * sy * meanX
+           - tempA[ 4 ] * sx * sx * sy * meanY
+           + tempA[ 5 ] * sx * sx * sy * sy;
+
+  return A;
+}
+
+vector<double> solveEllipse( vector<double> A )
+{
+  double theta = atan2( A[ 1 ], A[ 0 ] - A[ 2 ] ) / 2;
+  double ct = cos( theta );
+  double st = sin( theta );
+  double ap = A[ 0 ] * ct * ct 
+              + A[ 1 ] * ct * st 
+              + A[ 2 ] * st * st;
+  double cp = A[ 0 ] * st * st
+              - A[ 1 ] * ct * st
+              + A[ 2 ] * ct * ct;
+
+  TeMatrix T;
+  T.Init( 2, 2, 0.0 );
+  T( 0, 0 ) = A[ 0 ];
+  T( 1, 0 ) = A[ 1 ] / 2;
+  T( 0, 1 ) = A[ 1 ] / 2;
+  T( 1, 1 ) = A[ 2 ];
+  TeMatrix Tt2;
+  Tt2 = 2 * T;
+  TeMatrix Tt2i;
+  Tt2.Inverse( Tt2i );
+  TeMatrix productA;
+  productA.Init( 2, 1, 0.0 );
+  productA( 0, 0 ) = A[ 3 ];
+  productA( 1, 0 ) = A[ 4 ];
+  TeMatrix t;
+  t = -Tt2i * productA;
+  double cx = t( 0, 0 );
+  double cy = t( 1, 0 );
+  TeMatrix tt;
+  t.Transpose(tt);
+  
+  TeMatrix product;
+  product = tt * T * t;
+  double val = product( 0, 0 );
+  double scale = 1 / ( val - A[ 5 ] );
+
+  double r1 = 1 / sqrt( scale * ap );
+  double r2 = 1 / sqrt( scale * cp );
+
+  vector<double> v;
+  v.push_back( r1 );
+  v.push_back( r2 );
+  v.push_back( cx );
+  v.push_back( cy );
+  v.push_back( theta );
+
+  return v;
+}
+
+TePolygon TePolygonSetProperties::createEllipse( vector<double> A )
+{
+  vector<double> v = solveEllipse( A );
+  unsigned N = 30;
+  double dx = 2 * TePI / N;
+  double theta = v[ 4 ];
+
+  TeMatrix R;
+  R.Init( 2, 2, 0.0 );    
+  R( 0, 0 ) = cos( theta );
+  R( 1, 0 ) = sin( theta );
+  R( 0, 1 ) = -sin( theta );
+  R( 1, 1 ) = cos( theta );
+
+  vector<TeCoord2D> XY;
+  TeLine2D polygonLines;
+  for ( unsigned i = 0; i < N; i++ )
+  {
+    double angle = i * dx;
+    TeMatrix matrixXY;
+    matrixXY.Init( 2, 1, 0.0 );
+    matrixXY( 0, 0 ) = v[ 0 ] * cos( angle );
+    matrixXY( 1, 0 ) = v[ 1 ] * sin( angle );
+    TeMatrix d1;
+    d1 = R * matrixXY;
+    TeCoord2D tempXY( d1( 0, 0 ) + v[ 2 ], d1( 1, 0 ) + v[ 3 ] );
+    polygonLines.add( tempXY );
+  }
+
+  polygonLines.add( polygonLines[ 0 ] );
+  TeLinearRing polygonRing( polygonLines );
+  TePolygon polygon;
+  polygon.add( polygonRing );
+  
+  return polygon;
+}
+
+TePolygon TePolygonSetProperties::rotatePolygon( unsigned int polIndex, double angle )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+
+  TePolygon rotatedPolygon;
+  TeLinearRing rotatedRing;
+  TeCoord2D centroid = TeFindCentroid( polSet_[ polIndex ] );
+  unsigned actualCoordinate = 0;
+  TeCoord2D firstCoordinate;
+
+  TePolygon::iterator it = polSet_[ polIndex ].begin();
+  while( it != polSet_[ polIndex ].end() )
+  {
+    TeLinearRing::iterator it_ring = (*it).begin();
+
+    while( it_ring != (*it).end() )
+    {
+      TeCoord2D coord_r( -centroid.x(), -centroid.y() );
+      coord_r += *it_ring;
+      double r = sqrt( coord_r.x() * coord_r.x() + coord_r.y() * coord_r.y() );
+      double theta = atan( coord_r.y() / coord_r.x() );
+      if (coord_r.x() < 0)
+        theta += TePI;
+      TeCoord2D newCoordinate( centroid.x() + r * cos( theta + angle ), 
+                               centroid.y() + r * sin( theta + angle ) );
+
+      rotatedRing.add(newCoordinate);
+      if (actualCoordinate == 0)
+        firstCoordinate = newCoordinate;
+      ++actualCoordinate;
+      ++it_ring;
+    }
+    ++it;
+  }
+  rotatedRing.add( firstCoordinate );
+  rotatedPolygon.add( rotatedRing );
+
+  return rotatedPolygon;
+}
+
+TeRaster* TePolygonSetProperties::getRasterInPolygon( unsigned int polIndex )
+{
+  TEAGN_DEBUG_CONDITION( polIndex < polSet_.size(), "Invalid index" )
+
+  double width = polSet_[ polIndex ].box().x2() - polSet_[ polIndex ].box().x1();
+  double height = polSet_[ polIndex ].box().y2() - polSet_[ polIndex ].box().y1();
+  double resolution_x = width / 9.5;
+  double resolution_y = height / 9.5;
+
+  TeRasterParams r_params;
+  r_params.nBands( 1 );
+  r_params.mode_ = 'c';
+  r_params.decoderIdentifier_ = "SMARTMEM";
+  r_params.setDataType( TeUNSIGNEDCHAR );
+  r_params.boundingBoxResolution( polSet_[ polIndex ].box().x1(), polSet_[ polIndex ].box().y1(), 
+        polSet_[ polIndex ].box().x2(), polSet_[ polIndex ].box().y2(), resolution_x, resolution_y );
+
+  TeRaster* raster = new TeRaster( r_params );
+  TEAGN_TRUE_OR_THROW ( raster->init( ), "Raster init failed" )
+
+  return raster;
+}
+
+bool TePolygonSetProperties::findEigenVectors( TeMatrix input_matrix, double e_vec[] )
+{
+  double *e_vec_aux	= NULL, 
+	     sum = 0.0; 
+  int dim = input_matrix.Nrow();
+  TeMatrix aux1, aux2, mt;
+  int i,j,k;       
+	
+  if( dim <= 0 )
+    return false;
+  if( aux1.Init( dim, (double) 1 ) == false )
+    return false;
+  if( aux2.Init( dim, (double) 1 ) == false )
+    return false;
+  e_vec_aux = new double[dim];
+  if( e_vec_aux == NULL )
+    return false;
+  for ( k = 0; k < dim; k++ )
+  {
+    e_vec_aux[ k ] = 0.0;
+    e_vec[ k ] = 0.0;
+  }
+  aux1 = input_matrix;
+  aux2 = input_matrix;
+  unsigned max_iterations = 0;
+
+  for (;;)
+  {
+    mt = aux1 * aux2;
+
+    for ( i = 0; i < dim; i++ )
+	  {
+      for ( j = 0; j < dim; j++ )
+        e_vec[ i ] = e_vec[ i ] + mt( i, j );
+	    sum = sum + e_vec[i];
+	  }
+
+	  for ( j = 0 ; j < dim; j++ )
+	    e_vec[ j ] = e_vec[ j ] / sum;
+
+    for ( j = 0; j < dim; j++ )
+	  {
+	    if ( fabs( e_vec_aux[ j ] - e_vec[ j ] ) < 0.001 ) 
+	    {
+        delete []e_vec_aux;	
+		    return true;
+	    }
+	    e_vec_aux[ j ] = e_vec[ j ];
+	  }
+
+	  aux1 = mt;
+	  aux2 = mt;
+
+	  // avoid infinite loop
+	  if ( ++max_iterations > 10000 )
+	    break;
+  }
+  delete []e_vec_aux;	
+  return true;
+}
diff --git a/src/terralib/kernel/TePolygonSetProperties.h b/src/terralib/kernel/TePolygonSetProperties.h
new file mode 100644
index 0000000..4293188
--- /dev/null
+++ b/src/terralib/kernel/TePolygonSetProperties.h
@@ -0,0 +1,246 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef TEPOLYGONSETPROPERTIES_H
+  #define TEPOLYGONSETPROPERTIES_H
+  
+  #include "TeDefines.h"
+  #include "TeDataTypes.h"  
+  
+  class TePolygonSet;
+  class TePolygon;
+  class TeMatrix;
+  class TeCoord2D;
+  class TeRaster;
+
+  /**
+   * @class TePolygonSetProperties Polygon set properties generation.
+   * @author Thales T. Korting <tkorting at dpi.inpe.br>
+   */
+  class TL_DLL TePolygonSetProperties {
+  
+    public :
+    
+      /**
+       * @brief Default Constructor.
+       * @param polSet Input polygon set from where the properties 
+       * will be generated.
+       */
+      TePolygonSetProperties( const TePolygonSet& polSet );    
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TePolygonSetProperties();
+
+      /**
+       * @brief Returns the area of the given polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonArea( unsigned int polIndex );
+      
+      /**
+       * @brief Returns the bounding box area of the given polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonBoxArea( unsigned int polIndex );
+      
+      /**
+       * @brief Returns the perimeter of the given polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonPerimeter( unsigned int polIndex );
+      
+      /**
+       * @brief Returns the fractal dimension of the given polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonFractalDimension( unsigned int polIndex );
+      
+      /**
+       * @brief Returns the perimeter/area ratio of the given polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonPerimeterAreaRatio( unsigned int polIndex );
+      
+      /**
+       * @brief Returns the compacity of the given polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonCompacity( unsigned int polIndex );
+      
+      /**
+       * @brief Returns the shape index of the given polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonShapeIndex( unsigned int polIndex );
+      
+      /**
+       * @brief Returns the density of the given polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonDensity( unsigned int polIndex );
+      
+      /**
+       * @brief Returns the bounding box length from the given polygon.
+       * @brief [0, INF)
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonLength( unsigned int polIndex );
+      
+      /**
+       * @brief Returns the bounding box width from the given polygon.
+       * @brief [0, INF)
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonWidth( unsigned int polIndex );
+      
+      /**
+       * @brief Returns the related circunscribing circle from the given polygon.
+       * @brief [0, 1]
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonCircle( unsigned int polIndex );
+
+      /**
+       * @brief Returns the contiguity index from the given polygon.
+       * @brief [0, 1]
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonContiguity( unsigned int polIndex );
+
+      /**
+       * @brief Returns the radius of gyration from the given polygon.
+       * @brief [0, INF)
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonGyrationRadius( unsigned int polIndex );
+
+      /**
+       * @brief Returns the elliptic fit of the given polygon.
+       * @brief [0, 1]
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonEllipticFit( unsigned int polIndex );
+
+      /**
+       * @brief Returns the main angle of the given polygon.
+       * @brief [0, TePI]
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonAngle( unsigned int polIndex );
+
+      /**
+       * @brief Returns the rectangular fit of the given polygon.
+       * @brief [0, TePI]
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonRectangularFit( unsigned int polIndex );
+
+      /**
+       * @brief Print all attributes for a specific (or every) polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      void printProperties( int polIndex = -1 );
+      
+    protected :
+    
+      /**
+       * Internal polygon set reference.
+       */     
+      const TePolygonSet& polSet_;
+
+    private :
+       
+      // Copy not allowed
+      const TePolygonSetProperties& operator=( const TePolygonSetProperties& )
+        { return *this; };
+      
+      /**
+       * @brief Returns the highest radius inside the given polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      double getPolygonRadius( unsigned int polIndex );
+
+      /**
+       * @brief Returns a vector of coordinates from the polygon border.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      vector<TeCoord2D> getBorderCoordinates( unsigned int polIndex );
+
+      /**
+       * @brief Returns the six(6) terms for a ellipse wich best fits the polygon.
+       * @param xyPositions The vector of coordinates from the polygon edges.
+       */
+      vector<double> fitEllipse( vector<TeCoord2D> xyPositions );
+
+      /**
+       * @brief Returns an elliptic polygon .
+       * @param A The six(6) ellipse parameters.
+       */
+      TePolygon createEllipse( vector<double> A );
+
+      /**
+       * @brief Returns a rotated polygon.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       * @param angle The rotation angle.
+       */
+      TePolygon rotatePolygon( unsigned int polIndex, double angle );
+      
+      /**
+       * @brief Returns a raster with the polygon's bounding box.
+       * @param polIndex The polygon index inside the input polygon set 
+       * vector.
+       */
+      TeRaster* getRasterInPolygon( unsigned int polIndex );
+
+      /**
+       * @brief Find the eigenvectors of a matrix.
+       * @param input_matrix The input matrix.
+       * @param e_vec The double vector where the eigenvectors will be.
+       */
+      bool findEigenVectors( TeMatrix input_matrix, double e_vec[] );
+  };
+  
+#endif
+
diff --git a/src/terralib/kernel/TePrecision.h b/src/terralib/kernel/TePrecision.h
old mode 100755
new mode 100644
index a463571..e6b712e
--- a/src/terralib/kernel/TePrecision.h
+++ b/src/terralib/kernel/TePrecision.h
@@ -1,61 +1,61 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file  TePrecision.h
-    \brief This file contains a singleton to manage precision in TerraLib.
-*/
-#ifndef  __TERRALIB_INTERNAL_PRECISION_H
-#define  __TERRALIB_INTERNAL_PRECISION_H
-
-#include "TeSingleton.h"
-#include "TeDefines.h"
-
-//! Describes a class for supportin scale and representation dependency 
-/*! The entire set of geometric algorithms make use of this class,
-    an so it must be properly set. It will be used when dealling with approximate calculus
-	\sa TeSingleton 
-*/
-class TL_DLL TePrecision: public TeSingleton<TePrecision>
-{
-public:
-	//! Destructor
-	~TePrecision() {}
-
-	friend class TeSingleton<TePrecision>;
-
-	//! Sets the precision value to be considered
-	void setPrecision ( double precision )
-	{ precision_ = precision; }
-
-	//! Returns the precision value in use
-	double	precision ()
-	{ return precision_; }
-
-protected:
-	//! Constructor
-	TePrecision(): precision_ ( TeMINFLOAT )
-	{}
-
-	double precision_;	//!< Stores the precision.
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file  TePrecision.h
+    \brief This file contains a singleton to manage precision in TerraLib.
+*/
+#ifndef  __TERRALIB_INTERNAL_PRECISION_H
+#define  __TERRALIB_INTERNAL_PRECISION_H
+
+#include "TeSingleton.h"
+#include "TeDefines.h"
+
+//! Describes a class for supportin scale and representation dependency 
+/*! The entire set of geometric algorithms make use of this class,
+    an so it must be properly set. It will be used when dealling with approximate calculus
+	\sa TeSingleton 
+*/
+class TL_DLL TePrecision: public TeSingleton<TePrecision>
+{
+public:
+	//! Destructor
+	~TePrecision() {}
+
+	friend class TeSingleton<TePrecision>;
+
+	//! Sets the precision value to be considered
+	void setPrecision ( double precision )
+	{ precision_ = precision; }
+
+	//! Returns the precision value in use
+	double	precision ()
+	{ return precision_; }
+
+protected:
+	//! Constructor
+	TePrecision(): precision_ ( TeMINFLOAT )
+	{}
+
+	double precision_;	//!< Stores the precision.
+};
+
+#endif
diff --git a/src/terralib/kernel/TeProgress.cpp b/src/terralib/kernel/TeProgress.cpp
old mode 100755
new mode 100644
index 35b0d0a..87a0487
--- a/src/terralib/kernel/TeProgress.cpp
+++ b/src/terralib/kernel/TeProgress.cpp
@@ -1,37 +1,37 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeProgress.h"
-
-TeProgressBase* TeProgress::instance_ = 0;
-
-
-TeProgressBase* TeProgress::instance()
-{
-	return instance_;
-}
-
-void TeProgress::setProgressInterf( TeProgressBase* interf )
-{
-	instance_ = interf;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeProgress.h"
+
+TeProgressBase* TeProgress::instance_ = 0;
+
+
+TeProgressBase* TeProgress::instance()
+{
+	return instance_;
+}
+
+void TeProgress::setProgressInterf( TeProgressBase* interf )
+{
+	instance_ = interf;
+}
diff --git a/src/terralib/kernel/TeProgress.h b/src/terralib/kernel/TeProgress.h
old mode 100755
new mode 100644
index a7efbfb..6706419
--- a/src/terralib/kernel/TeProgress.h
+++ b/src/terralib/kernel/TeProgress.h
@@ -1,67 +1,67 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file  TeProgress.h
-    \brief This file contains a singleton for progress information.
-*/
-
-#ifndef  __TERRALIB_INTERNAL_PROGRESS_H
-#define  __TERRALIB_INTERNAL_PROGRESS_H
-
-#include "TeProgressBase.h"
-
-//! Provides the suport to implement an instance of a progress bar interface
-/*
-	This class is based on a Singleton Design Pattern (See "Design Patterns" book, page 127).
-	Applications should set the Progress Interface that will be used by the TerraLib routines
-	able to indicate progress in executing a task.
-*/
-class TL_DLL TeProgress
-{
-public:
-
-	//! Returns the unique instance of a progress interface
-	static TeProgressBase* instance();
-
-	//! Sets the unique instance of a progress interface
-	static void setProgressInterf( TeProgressBase* interf );
-
-	//! Virtual destructor
-	virtual ~TeProgress() {}  
-
-protected:
-
-	//! Empty constructor
-	TeProgress() {}
-
-private:
-	
-	static TeProgressBase* instance_;	//!< The unique instance of a progress interface
-
-	//! No copy allowed
-	TeProgress(const TeProgress&);
-
-	//! No copy allowed
-	TeProgress& operator=(const TeProgress&){return *this;}
-};
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file  TeProgress.h
+    \brief This file contains a singleton for progress information.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_PROGRESS_H
+#define  __TERRALIB_INTERNAL_PROGRESS_H
+
+#include "TeProgressBase.h"
+
+//! Provides the suport to implement an instance of a progress bar interface
+/*
+	This class is based on a Singleton Design Pattern (See "Design Patterns" book, page 127).
+	Applications should set the Progress Interface that will be used by the TerraLib routines
+	able to indicate progress in executing a task.
+*/
+class TL_DLL TeProgress
+{
+public:
+
+	//! Returns the unique instance of a progress interface
+	static TeProgressBase* instance();
+
+	//! Sets the unique instance of a progress interface
+	static void setProgressInterf( TeProgressBase* interf );
+
+	//! Virtual destructor
+	virtual ~TeProgress() {}  
+
+protected:
+
+	//! Empty constructor
+	TeProgress() {}
+
+private:
+	
+	static TeProgressBase* instance_;	//!< The unique instance of a progress interface
+
+	//! No copy allowed
+	TeProgress(const TeProgress&);
+
+	//! No copy allowed
+	TeProgress& operator=(const TeProgress&){return *this;}
+};
+#endif
+
diff --git a/src/terralib/kernel/TeProgressBase.h b/src/terralib/kernel/TeProgressBase.h
old mode 100755
new mode 100644
index 49ae3ce..0e7db25
--- a/src/terralib/kernel/TeProgressBase.h
+++ b/src/terralib/kernel/TeProgressBase.h
@@ -1,76 +1,76 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file  TePrecision.h
-    \brief This file contains a singleton to manage precision in TerraLib.
-*/
-#ifndef  __TERRALIB_INTERNAL_PROGRESSBASE_H
-#define  __TERRALIB_INTERNAL_PROGRESSBASE_H
-
-#include "TeDefines.h"
-#include <string>
-using std::string;
-
-//! A generic Progress Interface.
-/*
-	It defines the methods that should be implemented by concrete classes.
-	Assumes that a progress interface has a Caption to indicate the task
-	being monitored and a Message to be displayed along with the progress 
-	indication. A progress interface also know the total number of steps 
-	required to finish the task being monitored.
-*/
-class TL_DLL TeProgressBase
-{
-public:
-
-	//! Constructor
-	TeProgressBase(){}
-
-	//! Destructor
-	virtual ~TeProgressBase() {}
-
-	//! Sets the total number of steps to n 
-	virtual void setTotalSteps(int n) =0;
-
-	//! Sets the current amount of progress made to n
-	virtual void setProgress(int n) = 0;
-
-	//! Resets the progress interface
-	virtual void reset() = 0;
-
-	//! Resets the progress dialog
-	virtual void cancel() = 0;
-
-	//! Sets the label's text
-	virtual void setMessage(const string& text) = 0;
-
-	//!Returns the label's text
-	virtual string getMessage() { return ""; }
-
-	//! Returns true whether the process was cancelled
-	virtual bool wasCancelled() = 0;
-	
-	//! Sets the caption associated to the progress interface
-	virtual void setCaption(const string& cap) = 0;
-
-};
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file  TePrecision.h
+    \brief This file contains a singleton to manage precision in TerraLib.
+*/
+#ifndef  __TERRALIB_INTERNAL_PROGRESSBASE_H
+#define  __TERRALIB_INTERNAL_PROGRESSBASE_H
+
+#include "TeDefines.h"
+#include <string>
+using std::string;
+
+//! A generic Progress Interface.
+/*
+	It defines the methods that should be implemented by concrete classes.
+	Assumes that a progress interface has a Caption to indicate the task
+	being monitored and a Message to be displayed along with the progress 
+	indication. A progress interface also know the total number of steps 
+	required to finish the task being monitored.
+*/
+class TL_DLL TeProgressBase
+{
+public:
+
+	//! Constructor
+	TeProgressBase(){}
+
+	//! Destructor
+	virtual ~TeProgressBase() {}
+
+	//! Sets the total number of steps to n 
+	virtual void setTotalSteps(int n) =0;
+
+	//! Sets the current amount of progress made to n
+	virtual void setProgress(int n) = 0;
+
+	//! Resets the progress interface
+	virtual void reset() = 0;
+
+	//! Resets the progress dialog
+	virtual void cancel() = 0;
+
+	//! Sets the label's text
+	virtual void setMessage(const string& text) = 0;
+
+	//!Returns the label's text
+	virtual string getMessage() { return ""; }
+
+	//! Returns true whether the process was cancelled
+	virtual bool wasCancelled() = 0;
+	
+	//! Sets the caption associated to the progress interface
+	virtual void setCaption(const string& cap) = 0;
+
+};
+#endif
diff --git a/src/terralib/kernel/TeProject.cpp b/src/terralib/kernel/TeProject.cpp
old mode 100755
new mode 100644
index 53f5e8d..5014243
--- a/src/terralib/kernel/TeProject.cpp
+++ b/src/terralib/kernel/TeProject.cpp
@@ -1,291 +1,293 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2006 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include "TeProject.h"
-#include "TeDatabase.h"
-
-TeProject::TeProject():
-	id_(-1),
-	name_(""),
-	description_(""), 
-	currentViewIndex_(-1),
-	db_(0)
-{}
-
-//! Constructor from a identifier
-TeProject::TeProject(int id, TeDatabase* db):
-	id_(id),
-	name_(""),
-	description_(""), 
-	currentViewIndex_(-1),
-	db_(db)
-{
-	if (!db)
-		return;
-	string sql  = "SELECT name, description, current_view, view_id ";
-	       sql += "FROM te_project INNER JOIN te_project_view ON te_project.project_id = te_project_view.project_id";
-		   sql += " WHERE te_project.project_id = " + Te2String(id);
-	sql += Te2String(id);
-	TeDatabasePortal* portal = db->getPortal();
-	if (!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return;
-	}
-	// use the first fetch to get basic information
-	name_ = portal->getData(0);
-	description_ = portal->getData(1);
-	int currentview = portal->getInt(2);
-	int viewid = portal->getInt(3);
-	views_.push_back(portal->getInt(3));
-	if (viewid == currentview)
-		currentViewIndex_ = 0;
-
-	// get the other views
-	while (portal->fetchRow())
-	{
-		viewid = portal->getInt(3);
-		views_.push_back(viewid);
-		if (viewid == currentview)
-			currentViewIndex_ = views_.size()-1;
-	}
-	delete portal;
-}
-
-	//! Constructor from a name
-TeProject::TeProject(const string& name, TeDatabase* db):
-	id_(-1),
-	name_(name),
-	description_(""), 
-	currentViewIndex_(-1),
-	db_(db)
-{
-	if (!db)
-		return;
-	string sql  = "SELECT te_project.project_id, description, current_view, view_id ";
-	       sql += "FROM te_project INNER JOIN te_project_view ON te_project.project_id = te_project_view.project_id";
-		   sql += " WHERE name = '" + name + "'";
-
-	TeDatabasePortal* portal = db->getPortal();
-	if (!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return;
-	}
-	// use the first fetch to get basic information
-	id_ = portal->getInt(0);
-	description_ = portal->getData(1);
-	int currentview = portal->getInt(2);
-	int viewid = portal->getInt(3);
-	views_.push_back(portal->getInt(3));
-	if (viewid == currentview)
-		currentViewIndex_ = 0;
-
-	// get the other views
-	while (portal->fetchRow())
-	{
-		viewid = portal->getInt(3);
-		views_.push_back(viewid);
-		if (viewid == currentview)
-			currentViewIndex_ = views_.size()-1;
-	}
-	delete portal;
-}
-
-TeProject::TeProject(const TeProject& other)
-{
-	id_ = other.id_;
-	name_= other.name_;
-	description_= other.description_; 
-	views_= other.views_;
-	currentViewIndex_= other.currentViewIndex_;
-	db_= other.db_;
-}
-
-TeProject& 
-TeProject::operator= (const TeProject& other)
-{
-	if ( this != &other )
-	{
-		id_ = other.id_;
-		name_= other.name_;
-		description_= other.description_; 
-		views_= other.views_;
-		currentViewIndex_= other.currentViewIndex_;
-		db_= other.db_;
-	}
-	return *this;
-}
-
-//! Destructor
-TeProject::~TeProject()
-{
-	views_.clear();
-	db_=0;
-}
-
-	//! Returns TRUE if a view is part of a project and FALSE otherwise
-bool 
-TeProject::isProjectView(int viewId)
-{
-	TeViewVector::iterator it = find(views_.begin(), views_.end(), viewId);
-	return (it != views_.end());
-}
-
-	//! Returns TRUE if a project has a current view and FALSE otherwise
-bool
-TeProject::hasCurrentView()
-{	return (currentViewIndex_>=0 && currentViewIndex_< static_cast<int>(views_.size())); }
-
-
-//! Returns the id of the current view in the project 
-int
-TeProject::getCurrentViewId()
-{
-	if (currentViewIndex_>=0 && currentViewIndex_< static_cast<int>(views_.size()))
-		return views_[currentViewIndex_];
-	else
-		return -1;
-}
-
-//! Sets the id of the current view in the project 
-void 
-TeProject::setCurrentViewId(int viewId)
-{
-	currentViewIndex_ = -1;
-	for (unsigned int i=0; i<views_.size(); ++i)
-	{
-		if (views_[i] == viewId)
-		{
-			currentViewIndex_ = i;
-			break;
-		}
-	}
-}
-
-	//! Returns the id of the index-th view of the project
-int 
-TeProject::getViewId(int index)
-{
-	if (index >= 0 && index < static_cast<int>(views_.size()))
-		return views_[index];
-	else
-		return -1;
-}
-
-//!	Returns the names of the views in the project.
-TeViewNameVector
-TeProject::getViewNameVector()
-{
-	TeViewNameVector viewNames;
-	if (!db_ || views_.empty())
-		return viewNames;
-
-	string viewids = Te2String(views_[0]);
-	for (unsigned int i=1; i<views_.size(); ++i)
-	{
-		viewids += ",";
-		viewids += Te2String(views_[i]);
-	}
-	string sql  = "SELECT te_view.name ";
-	       sql += "FROM te_view INNER JOIN te_project_view ON te_view.view_id = te_project_view.view_id ";
-	       sql += "WHERE te_project_view.project_id = " + Te2String(id_);
-
-	TeDatabasePortal* portal = db_->getPortal();
-	if (!portal)
-		return viewNames;
-	if (!portal->query(sql))
-	{
-		delete portal;
-		return viewNames;
-	}
-	while (portal->fetchRow())
-		viewNames.push_back(portal->getData(0));
-	delete portal;
-	return viewNames;
-}
-
-int 
-TeProject::insertView(string name, TeProjection* projection)
-{
-	TeProjection* proj;
-	if (!db_)
-		return -1;
-	if (projection)
-		proj = projection;
-	else
-	{
-		TeDatum sad69 = TeDatumFactory::make("SAD69");
-		proj = new TeLatLong(sad69);
-	}
-	TeView* view = new TeView(name);
-	view->projection(proj);
-	view->user(db_->user());
-	if (db_->insertView(view))
-	{
-		return insertViewRel(view->id());
-	}
-	return -1;
-}
-
-int 
-TeProject::insertViewRel(int viewId)
-{
-	if (!db_)
-		return -1;
-
-	if(db_->insertProjectViewRel(id_,viewId))
-		return addView(viewId);
-
-	return -1;
-}
-
-int 
-TeProject::addView(int viewId)
-{
-	if (viewId <=0)
-		return -1;
-	views_.push_back(viewId);
-	currentViewIndex_ = views_.size()-1;
-	return viewId;
-}
-
-void 
-TeProject::deleteView(int viewId)
-{
-	if (!db_)
-		return;
-	TeViewVector::iterator pos = find(views_.begin(),views_.end(),viewId);
-	if (pos != views_.end())
-		views_.erase(pos);
-	db_->deleteView(viewId);
-}
-
-//! Clear the project
-void 
-TeProject::clearViews()
-{
-	views_.clear();
-	currentViewIndex_ = -1;
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2006 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include "TeProject.h"
+#include "TeDatabase.h"
+
+TeProject::TeProject():
+	id_(-1),
+	name_(""),
+	description_(""), 
+	currentViewIndex_(-1),
+	db_(0)
+{}
+
+//! Constructor from a identifier
+TeProject::TeProject(int id, TeDatabase* db):
+	id_(id),
+	name_(""),
+	description_(""), 
+	currentViewIndex_(-1),
+	db_(db)
+{
+	if (!db)
+		return;
+	string sql  = "SELECT name, description, current_view, view_id ";
+	       sql += "FROM te_project INNER JOIN te_project_view ON te_project.project_id = te_project_view.project_id";
+		   sql += " WHERE te_project.project_id = " + Te2String(id);
+	sql += Te2String(id);
+	TeDatabasePortal* portal = db->getPortal();
+	if (!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return;
+	}
+	// use the first fetch to get basic information
+	name_ = portal->getData(0);
+	description_ = portal->getData(1);
+	int currentview = portal->getInt(2);
+	int viewid = portal->getInt(3);
+	views_.push_back(portal->getInt(3));
+	if (viewid == currentview)
+		currentViewIndex_ = 0;
+
+	// get the other views
+	while (portal->fetchRow())
+	{
+		viewid = portal->getInt(3);
+		views_.push_back(viewid);
+		if (viewid == currentview)
+			currentViewIndex_ = views_.size()-1;
+	}
+	delete portal;
+}
+
+	//! Constructor from a name
+TeProject::TeProject(const string& name, TeDatabase* db):
+	id_(-1),
+	name_(name),
+	description_(""), 
+	currentViewIndex_(-1),
+	db_(db)
+{
+	if (!db)
+		return;
+	string sql  = "SELECT te_project.project_id, description, current_view, view_id ";
+	       sql += "FROM te_project INNER JOIN te_project_view ON te_project.project_id = te_project_view.project_id";
+		   sql += " WHERE name = '" + name + "'";
+
+	TeDatabasePortal* portal = db->getPortal();
+	if (!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return;
+	}
+	// use the first fetch to get basic information
+	id_ = portal->getInt(0);
+	description_ = portal->getData(1);
+	int currentview = portal->getInt(2);
+	int viewid = portal->getInt(3);
+	views_.push_back(portal->getInt(3));
+	if (viewid == currentview)
+		currentViewIndex_ = 0;
+
+	// get the other views
+	while (portal->fetchRow())
+	{
+		viewid = portal->getInt(3);
+		views_.push_back(viewid);
+		if (viewid == currentview)
+			currentViewIndex_ = views_.size()-1;
+	}
+	delete portal;
+}
+
+TeProject::TeProject(const TeProject& other)
+{
+	id_ = other.id_;
+	name_= other.name_;
+	description_= other.description_; 
+	views_= other.views_;
+	currentViewIndex_= other.currentViewIndex_;
+	db_= other.db_;
+}
+
+TeProject& 
+TeProject::operator= (const TeProject& other)
+{
+	if ( this != &other )
+	{
+		id_ = other.id_;
+		name_= other.name_;
+		description_= other.description_; 
+		views_= other.views_;
+		currentViewIndex_= other.currentViewIndex_;
+		db_= other.db_;
+	}
+	return *this;
+}
+
+//! Destructor
+TeProject::~TeProject()
+{
+	views_.clear();
+	db_=0;
+}
+
+	//! Returns TRUE if a view is part of a project and FALSE otherwise
+bool 
+TeProject::isProjectView(int viewId)
+{
+	TeViewVector::iterator it = find(views_.begin(), views_.end(), viewId);
+	return (it != views_.end());
+}
+
+	//! Returns TRUE if a project has a current view and FALSE otherwise
+bool
+TeProject::hasCurrentView()
+{	return (currentViewIndex_>=0 && currentViewIndex_< static_cast<int>(views_.size())); }
+
+
+//! Returns the id of the current view in the project 
+int
+TeProject::getCurrentViewId()
+{
+	if (currentViewIndex_>=0 && currentViewIndex_< static_cast<int>(views_.size()))
+		return views_[currentViewIndex_];
+	else
+		return -1;
+}
+
+//! Sets the id of the current view in the project 
+void 
+TeProject::setCurrentViewId(int viewId)
+{
+	currentViewIndex_ = -1;
+	for (unsigned int i=0; i<views_.size(); ++i)
+	{
+		if (views_[i] == viewId)
+		{
+			currentViewIndex_ = i;
+			break;
+		}
+	}
+}
+
+	//! Returns the id of the index-th view of the project
+int 
+TeProject::getViewId(int index)
+{
+	if (index >= 0 && index < static_cast<int>(views_.size()))
+		return views_[index];
+	else
+		return -1;
+}
+
+//!	Returns the names of the views in the project.
+TeViewNameVector
+TeProject::getViewNameVector()
+{
+	TeViewNameVector viewNames;
+	if (!db_ || views_.empty())
+		return viewNames;
+
+	string viewids = Te2String(views_[0]);
+	for (unsigned int i=1; i<views_.size(); ++i)
+	{
+		viewids += ",";
+		viewids += Te2String(views_[i]);
+	}
+	string sql  = "SELECT te_view.name ";
+	       sql += "FROM te_view INNER JOIN te_project_view ON te_view.view_id = te_project_view.view_id ";
+	       sql += "WHERE te_project_view.project_id = " + Te2String(id_);
+
+	TeDatabasePortal* portal = db_->getPortal();
+	if (!portal)
+		return viewNames;
+	if (!portal->query(sql))
+	{
+		delete portal;
+		return viewNames;
+	}
+	while (portal->fetchRow())
+		viewNames.push_back(portal->getData(0));
+	delete portal;
+	return viewNames;
+}
+
+int 
+TeProject::insertView(string name, TeProjection* projection)
+{
+	TeProjection* proj;
+	if (!db_)
+		return -1;
+	if (projection)
+		proj = projection;
+	else
+	{
+		TeDatum sad69 = TeDatumFactory::make("SAD69");
+		proj = new TeLatLong(sad69);
+	}
+	TeView* view = new TeView(name);
+	view->projection(proj);
+	view->user(db_->user());
+	if (db_->insertView(view))
+	{
+		return insertViewRel(view->id());
+	}
+	return -1;
+}
+
+int 
+TeProject::insertViewRel(int viewId)
+{
+	if (!db_)
+		return -1;
+
+	if(db_->insertProjectViewRel(id_,viewId))
+		return addView(viewId);
+
+	return -1;
+}
+
+int 
+TeProject::addView(int viewId)
+{
+	if (viewId <=0)
+		return -1;
+	views_.push_back(viewId);
+	currentViewIndex_ = views_.size()-1;
+	return viewId;
+}
+
+void 
+TeProject::deleteView(int viewId, const bool& removeFromDatabase)
+{
+	if (!db_)
+		return;
+	TeViewVector::iterator pos = find(views_.begin(),views_.end(),viewId);
+	if (pos != views_.end())
+		views_.erase(pos);
+
+	if(removeFromDatabase)
+		db_->deleteView(viewId);
+}
+
+//! Clear the project
+void 
+TeProject::clearViews()
+{
+	views_.clear();
+	currentViewIndex_ = -1;
+}
+
+
diff --git a/src/terralib/kernel/TeProject.h b/src/terralib/kernel/TeProject.h
old mode 100755
new mode 100644
index cc49738..1a540b6
--- a/src/terralib/kernel/TeProject.h
+++ b/src/terralib/kernel/TeProject.h
@@ -1,176 +1,176 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeProject.h
-    \brief This file contains structures and definitions to support the concept of a project in TerraLib
-*/
-#ifndef  __TERRALIB_INTERNAL_PROJECT_H
-#define  __TERRALIB_INTERNAL_PROJECT_H
-
-#include "TeDefines.h"
-#include <string>
-#include <vector>
-#include <map>
-
-class TeDatabase;
-class TeProjection;
-class TeView;
-
-using std::vector;
-using std::string;
-using std::map;
-
-//! A vector of the identifiers of the maps in the project.
-typedef vector<int> TeViewVector;
-
-//! A vector of the names of the views in the project.
-typedef vector<string> TeViewNameVector;
-
-//! A vector of the identifiers of the projects.
-typedef vector<int> TeProjectIdVector;
-
-/*!
-   This class represents a project concept.
-   A project is a collection of views kept in a ordered list.
-   A project might have the information about the current view.
-*/
-class TL_DLL TeProject
-{
-public:
-
-	//! Empty constructor
-	TeProject();
-
-    //! Constructor from a identifier
-	TeProject(int id, TeDatabase* db);
-
-	//! Constructor from a name
-	TeProject(const string& name, TeDatabase* db);
-
-	//! Copy Constructor
-	TeProject(const TeProject& other);
-
-	//! Operator =
-	TeProject& operator= (const TeProject& other);
-
-	//! Destructor
-	virtual ~TeProject();
-
-	//! Sets the project name.
-	virtual void setId(int id) 
-	{id_ = id;}	
-	
-	//! Returns the project name.
-	virtual int id() 
-	{ return id_; }
-
-	//! Sets the project name.
-	virtual void setName(const string& name) 
-	{name_ = name;}	
-	
-	//! Returns the project name.
-	virtual string name() 
-	{ return name_; }
-
-	//! Returns the project description.
-	virtual string description() 
-	{ return description_; }
-
-	//! Sets the project description
-	virtual void setDescription(const string& desc) 
-	{ description_ = desc ; }
-
-	//! Sets the project database
-	virtual void setDatabase(TeDatabase* db)
-	{ db_ = db; }
-
-	//! Gets the project database
-	virtual TeDatabase* getDatabase()
-	{ return db_; }
-
-	//! Returns TRUE if a view is part of a project and FALSE otherwise
-	virtual bool isProjectView(int viewId);
-
-	//! Returns TRUE if a project has a current view and FALSE otherwise
-	virtual bool hasCurrentView();
-
-	//! Sets the id of the current view in the project 
-	virtual void setCurrentViewId(int viewId);
-
-	//! Returns the id of the current view in the project 
-	virtual int getCurrentViewId();
-
-	//! Sets the index in the list of the current view in the project 
-	virtual void setCurrentViewIndex(int index)
-	{ currentViewIndex_ = index; }
-
-	//! Returns position of the current view in the project
-	virtual int getCurrentViewIndex()
-	{ return currentViewIndex_; }
-
-	//! Returns a reference to the project list of views
-	const TeViewVector& getViewVector() const
-	{	return views_; }
-
-	//!	Returns the names of the views in the project.
-	virtual TeViewNameVector getViewNameVector();
-
-	//! Returns the id of the index-th view of the project
-	virtual int getViewId(int index);
-
-	//!	Creates a new view in the project and persists it in the database
-	/* 
-		\param name view name
-		\param projection view projection. If null uses as default LatLong/SAD69
-		\return the id of the new view
-	*/
-	virtual int insertView(string name, TeProjection* projection = NULL);
-
-	//!	Adds a new view relation with the project and persists it in the database
-	/* 
-	\param view The view object
-	\return the id of the new view
-	*/
-	virtual int insertViewRel(int viewId);
-
-	//! Adds an view id to the views project vector
-	virtual int addView(int viewId);
-
-	//! Removes a view from the project (and also from the database)
-	virtual void deleteView(int viewId);
-
-	//! Clear the project
-	virtual void clearViews();
-
-private: 
-	int id_;
-	string name_;
-	string description_; 
-	TeViewVector views_;
-	int currentViewIndex_;
-	TeDatabase* db_;
-};
-
-//! A map from a integer unique identifier to a pointer to project
-typedef map<int, TeProject*>  TeProjectMap;
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeProject.h
+    \brief This file contains structures and definitions to support the concept of a project in TerraLib
+*/
+#ifndef  __TERRALIB_INTERNAL_PROJECT_H
+#define  __TERRALIB_INTERNAL_PROJECT_H
+
+#include "TeDefines.h"
+#include <string>
+#include <vector>
+#include <map>
+
+class TeDatabase;
+class TeProjection;
+class TeView;
+
+using std::vector;
+using std::string;
+using std::map;
+
+//! A vector of the identifiers of the maps in the project.
+typedef vector<int> TeViewVector;
+
+//! A vector of the names of the views in the project.
+typedef vector<string> TeViewNameVector;
+
+//! A vector of the identifiers of the projects.
+typedef vector<int> TeProjectIdVector;
+
+/*!
+   This class represents a project concept.
+   A project is a collection of views kept in a ordered list.
+   A project might have the information about the current view.
+*/
+class TL_DLL TeProject
+{
+public:
+
+	//! Empty constructor
+	TeProject();
+
+    //! Constructor from a identifier
+	TeProject(int id, TeDatabase* db);
+
+	//! Constructor from a name
+	TeProject(const string& name, TeDatabase* db);
+
+	//! Copy Constructor
+	TeProject(const TeProject& other);
+
+	//! Operator =
+	TeProject& operator= (const TeProject& other);
+
+	//! Destructor
+	virtual ~TeProject();
+
+	//! Sets the project name.
+	virtual void setId(int id) 
+	{id_ = id;}	
+	
+	//! Returns the project name.
+	virtual int id() 
+	{ return id_; }
+
+	//! Sets the project name.
+	virtual void setName(const string& name) 
+	{name_ = name;}	
+	
+	//! Returns the project name.
+	virtual string name() 
+	{ return name_; }
+
+	//! Returns the project description.
+	virtual string description() 
+	{ return description_; }
+
+	//! Sets the project description
+	virtual void setDescription(const string& desc) 
+	{ description_ = desc ; }
+
+	//! Sets the project database
+	virtual void setDatabase(TeDatabase* db)
+	{ db_ = db; }
+
+	//! Gets the project database
+	virtual TeDatabase* getDatabase()
+	{ return db_; }
+
+	//! Returns TRUE if a view is part of a project and FALSE otherwise
+	virtual bool isProjectView(int viewId);
+
+	//! Returns TRUE if a project has a current view and FALSE otherwise
+	virtual bool hasCurrentView();
+
+	//! Sets the id of the current view in the project 
+	virtual void setCurrentViewId(int viewId);
+
+	//! Returns the id of the current view in the project 
+	virtual int getCurrentViewId();
+
+	//! Sets the index in the list of the current view in the project 
+	virtual void setCurrentViewIndex(int index)
+	{ currentViewIndex_ = index; }
+
+	//! Returns position of the current view in the project
+	virtual int getCurrentViewIndex()
+	{ return currentViewIndex_; }
+
+	//! Returns a reference to the project list of views
+	const TeViewVector& getViewVector() const
+	{	return views_; }
+
+	//!	Returns the names of the views in the project.
+	virtual TeViewNameVector getViewNameVector();
+
+	//! Returns the id of the index-th view of the project
+	virtual int getViewId(int index);
+
+	//!	Creates a new view in the project and persists it in the database
+	/* 
+		\param name view name
+		\param projection view projection. If null uses as default LatLong/SAD69
+		\return the id of the new view
+	*/
+	virtual int insertView(string name, TeProjection* projection = NULL);
+
+	//!	Adds a new view relation with the project and persists it in the database
+	/* 
+	\param view The view object
+	\return the id of the new view
+	*/
+	virtual int insertViewRel(int viewId);
+
+	//! Adds an view id to the views project vector
+	virtual int addView(int viewId);
+
+	//! Removes a view from the project (and also from the database)
+	virtual void deleteView(int viewId, const bool& removeFromDatabase = true);
+
+	//! Clear the project
+	virtual void clearViews();
+
+private: 
+	int id_;
+	string name_;
+	string description_; 
+	TeViewVector views_;
+	int currentViewIndex_;
+	TeDatabase* db_;
+};
+
+//! A map from a integer unique identifier to a pointer to project
+typedef map<int, TeProject*>  TeProjectMap;
+
+#endif
diff --git a/src/terralib/kernel/TeProjection.cpp b/src/terralib/kernel/TeProjection.cpp
old mode 100755
new mode 100644
index 0cd482a..d8400d0
--- a/src/terralib/kernel/TeProjection.cpp
+++ b/src/terralib/kernel/TeProjection.cpp
@@ -1,2300 +1,2577 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeProjection.h"
-#include "TeException.h"
-#include "TeUtils.h"
-#include <cstdlib>
-#include <stdio.h>
-#include <iostream>
-#include <cstring>
-
-bool tokenizeWKT(char** wkt, vector<string>& tokens);
-
-TeDatum  TeGetDatumFromWKT(const string& wkt);
-
-TeDatum  TeGetDatumFromProj4(const string& proj4);
-
-//=========================================================
-//
-//  PROJECTION INFORMATION 
-//
-//  Auxiliary functions which indicate the information
-//  associated to a projection
-//
-//  Used for reading and writing information
-//
-//==========================================================
-
-
-
-// Name						Units  Long  Lat  Par1  Par2  Sca  Eas  Nor 
-const char* teProjInfo[]= {
-"Albers",					"1",  "1",  "1", "1",  "1",  "0", "1", "1", 
-"LatLong",					"1",  "0",  "0", "0",  "0",  "0", "0", "0",   
-"LambertConformal",			        "1",  "1",  "1", "1",  "1",  "0", "1", "1", 
-"Mercator",					"1",  "1",  "1", "1",  "0",  "0", "1", "1", 
-"Miller",					"1",  "1",  "0", "0",  "0",  "0", "1", "1", 
-"UTM",						"1",  "1",  "0", "0",  "0",  "1", "1", "1", 
-"Polyconic",				        "1",  "1",  "1", "0",  "0",  "0", "1", "1",
-"Sinusoidal",				        "1",  "1",  "0", "0",  "0",  "0", "1", "1",
-"CylindricalEquidistant",	                "1",  "1",  "0", "1",  "0",  "0", "1", "1",
-"PolarStereographic",		                "1",  "1",  "0", "0",  "0",  "0", "1", "1",
-"Satellite",		                        "1",  "1",  "1", "0",  "0",  "0", "1", "1",
-"NoProjection",				        "1",  "0",  "0", "0",  "0",  "0", "0", "0"		
-};
-
-
-const char** TeGetProjInfo()
-{
-	return teProjInfo;
-}
-
-TeProjInfo
-TeProjectionInfo ( const string& projName  )
-{
-
-	TeProjInfoMap pjMap;
-	TeProjInfo pjInfo;
-
-	int k = 0;
-
-	for ( int i = 0; i < NUM_PROJ; i++ )
-	{
-		string name = teProjInfo [k++];
-			
-	    pjInfo.hasUnits  = atoi ( teProjInfo [k++] );
-	    pjInfo.hasLon0   = atoi ( teProjInfo [k++] );
-	    pjInfo.hasLat0   = atoi ( teProjInfo [k++] );
-	    pjInfo.hasStlat1 = atoi ( teProjInfo [k++] );
-		pjInfo.hasStlat2 = atoi ( teProjInfo [k++] );
-		pjInfo.hasScale  = atoi ( teProjInfo [k++] );
-		pjInfo.hasOffx   = atoi ( teProjInfo [k++] );
-	    pjInfo.hasOffy   = atoi ( teProjInfo [k++] );
-
-		pjMap [ name ] = pjInfo;
-	}
-
-
-	TeProjInfoMap::iterator it = pjMap.find ( projName );
-
-	if ( it == pjMap.end() )
-		throw TeException ( PROJECTION_NOT_AVAILABLE );
-
-return (*it).second;
-}
-
-//========================================================
-//
-// PROJECTION FACTORY
-//
-// =======================================================
-
-TeProjection*
-TeProjectionFactory::make ( const TeProjectionParams& par )
-{
-	string punits;
-	if (par.units.empty())
-		punits = "Meters";
-	else
-		punits = par.units;
-
-	if ( par.name == "UTM" )
-		return new TeUtm ( par.datum, par.lon0, par.lat0,
-		par.offx, par.offy, punits, par.scale, par.hemisphere );
-
-	if ( par.name == "LambertConformal")
-		return new TeLambertConformal ( par.datum, par.lon0, par.lat0,
-		par.offx, par.offy, par.stlat1, par.stlat2, punits );
-	
-	if ( par.name == "Albers" )
-		return new TeAlbers ( par.datum, par.lon0, par.lat0,
-		par.offx, par.offy, par.stlat1, par.stlat2, punits );
-
-	if ( par.name == "Miller")
-		return new TeMiller ( par.datum, par.lon0, par.offx, par.offy, punits );
-
-	if ( par.name == "LatLong" )
-	{
-		if (par.units.empty())
-			punits = "DecimalDegrees";
-		else
-			punits = par.units;
-		return new TeLatLong ( par.datum, punits );
-	}
-
-	if ( par.name == "Polyconic" )
-		return new TePolyconic ( par.datum, par.lon0, par.lat0, par.offx, par.offy, punits); 
-
-	if ( par.name == "Mercator" )
-		return new TeMercator ( par.datum, par.lon0, par.lat0, 
-		par.offx, par.offy, par.stlat1, punits );
-
-	if ( par.name == "Sinusoidal")
-		return new TeSinusoidal ( par.datum, par.lon0, par.offx, par.offy, punits );
-
-	if ( par.name == "CylindricalEquidistant")
-		return new TeCylindricalEquidistant ( par.datum, par.lon0, par.offx, par.offy, par.stlat1, punits);
-
-	if ( par.name == "PolarStereographic")
-		return new TePolarStereographic ( par.datum, par.lon0, par.offx, par.offy,punits, par.hemisphere );
-
-	if ( par.name == "Satellite")
-		return new TeSatelliteProjection ( par.datum, par.offx, par.offy, par.pri, par.prj, par.pis, par.pjs, par.lat0, par.lon0, par.prs, par.pscn, par.pyaw);
-
-	if ( par.name == "NoProjection")
-		return new TeNoProjection(par.datum,punits);	
-	return 0;
-}
-
-TeProjectionParams 
-TeProjection::params () const
-{
-	TeProjectionParams par;
-	
-	par.name  = GPname;
-	par.datum = GPdatum;
-	par.lon0  = GPlon0;
-	par.lat0  = GPlat0;
-	par.offx  = GPoffx;
-	par.offy  = GPoffy;
-	par.stlat1 = GPstlat1;
-	par.stlat2 = GPstlat2;
-	par.units  = GPunits;
-	par.scale  = GPscale;
-	par.hemisphere =  GPhemisphere;
-
-return par;
-}
-
-
-TeProjection::TeProjection(const TeProjection& rhs)
-{
-	GPname  = rhs.GPname;
-	GPdatum = rhs.GPdatum;
-	GPlon0  = rhs.GPlon0;
-	GPlat0  = rhs.GPlat0;
-	GPoffx  = rhs.GPoffx;
-	GPoffy  = rhs.GPoffy;
-	GPstlat1 = rhs.GPstlat1;
-	GPstlat2 = rhs.GPstlat2;
-	GPunits  = rhs.GPunits;
-	GPscale  = rhs.GPscale;
-	GPhemisphere = rhs.GPhemisphere;
-}
-
-TeProjection& 
-TeProjection::operator=(const TeProjection& rhs)
-{
-	if ( this != &rhs )
-	{
-		GPname  = rhs.GPname;
-		GPdatum = rhs.GPdatum;
-		GPlon0  = rhs.GPlon0;
-		GPlat0  = rhs.GPlat0;
-		GPoffx  = rhs.GPoffx;
-		GPoffy  = rhs.GPoffy;
-		GPstlat1 = rhs.GPstlat1;
-		GPstlat2 = rhs.GPstlat2;
-		GPunits  = rhs.GPunits;
-		GPscale  = rhs.GPscale;
-		GPhemisphere = rhs.GPhemisphere;
-	}
-	return *this;
-}
-
-
-
-/*******************************************************************
-	CHECKS IF A PROJECTION INSTANCE IS EQUAL TO ANOTHER
-********************************************************************/
-
-bool
-TeProjection::operator== (const TeProjection& proj)
-{
-	if (GPname == "NoProjection" && proj.GPname == "NoProjection")
-		return true;
-	if (GPname  != proj.GPname)
-		return false;
-	if (!(GPdatum==proj.GPdatum))
-		return false;
-	if (!TeFPEquals(GPlon0, proj.GPlon0, 0.0000000001))
-		return false;
-	if (!TeFPEquals(GPlat0, proj.GPlat0, 0.0000000001))
-		return false;
-	if (!TeFPEquals(GPoffx,proj.GPoffx,0.001))
-		return false;
-	if (!TeFPEquals(GPoffy,proj.GPoffy,0.001))
-		return false;
-	if (!TeFPEquals(GPstlat1,proj.GPstlat1,0.0000000001))
-		return false;
-	if (!TeFPEquals(GPstlat2,proj.GPstlat2,0.0000000001))
-		return false;
-	if (GPhemisphere!=proj.GPhemisphere)
-		return false;
-	if (GPunits != proj.GPunits)
-		return false;
-	if (!TeFPEquals(GPscale,proj.GPscale, 0.0000000001))
-		return false;
-
-	return true;
-}
-
-/*******************************************************************
-	PRINTS INFORMATION ABOUT A PROJECTION
-********************************************************************/
-
-
-void
-TeProjection::print ( FILE* file_ )
-{
-	TeProjInfo pjInfo = TeProjectionInfo ( GPname );
-
-	fprintf(file_,"%s\n", "// Projection Information" );
-	fprintf ( file_, "%s %s \n", "PROJECTION", GPname.c_str() );
-	fprintf ( file_, "%s %s \n", "DATUM", GPdatum.name().c_str() );
-	fprintf ( file_, "%s %s \n", "UNITS", GPunits.c_str() );
-	
-	if ( pjInfo.hasLon0 )
-		fprintf ( file_, "%s %17.6f \n", "ORIGIN LONG", GPlon0 );
-
-	if ( pjInfo.hasLat0 )
-		fprintf ( file_, "%s %17.6f \n", "ORIGIN LAT", GPlat0 );
-
-	if ( pjInfo.hasOffx )
-		fprintf ( file_, "%s %17.6f \n", "FALSE EASTING", GPoffx );
-
-	if ( pjInfo.hasOffy )
-		fprintf ( file_, "%s %17.6f \n", "FALSE NORTHING", GPoffy );
-	
-	if ( pjInfo.hasStlat1 )
-		fprintf ( file_, "%s %17.6f \n", "FIRST STANDARD PARALEL", GPstlat1 );
-	
-	if ( pjInfo.hasStlat2 )
-		fprintf ( file_, "%s %17.6f \n", "SECOND STANDARD PARALEL", GPstlat2 );
-
-	if ( pjInfo.hasScale )
-		fprintf ( file_, "%s %17.6f \n", "SCALE", GPscale );
-
-	fprintf(file_,"%s\n", "// End of Projection Information" );
-}
-
-
-string
-TeProjection::describe ()
-{
-	string desc;
-	if (GPname == "NoProjection")
-	{
-		desc = "NoProjection";
-		return desc;
-	}
-	desc = GPname;
-	TeProjInfo pjInfo = TeProjectionInfo ( GPname );
-
-	desc =  GPunits;
-	if ( pjInfo.hasLon0 )
-		desc += "," + Te2String(GPlon0*TeCRD,6);
-
-	if ( pjInfo.hasLat0 )
-		desc += "," + Te2String(GPlat0*TeCRD,6);
-
-	if ( pjInfo.hasStlat1 )
-		desc += ", " + Te2String(GPstlat1*TeCRD,6);
-	
-	if ( pjInfo.hasStlat2 )
-		desc += "," + Te2String(GPstlat2*TeCRD,6);
-
-	if ( pjInfo.hasOffx )
-		desc += "," + Te2String(GPoffx,6);
-
-	if ( pjInfo.hasOffy )
-		desc += "," + Te2String(GPoffy,6);
-	
-	if ( pjInfo.hasScale )
-		desc += "," + Te2String(GPscale,6);
-
-	return desc;
-}
-
-
-bool decodifyDescription(const string& projDescription, TeProjectionParams& pars)
-{
-	vector<string> projDesc;
-	if (TeSplitString(projDescription, ",", projDesc) <= 0)
-		return false;
-	unsigned int npar = projDesc.size();
-	TeProjInfo pjInfo = TeProjectionInfo (projDesc[0]);
-	pars.name = projDesc[0];
-	if (npar > 1)
-		pars.units = projDesc[1];
-	else 
-		return true;
-
-	unsigned int nextp = 2;
-	if (pjInfo.hasLon0)
-	{
-		 if (nextp < npar)
-		 {
-			pars.lon0 = atof(projDesc[nextp].c_str()) * TeCDR;
-			nextp++;
-		 }
-		 else
-			 return false;
-	}
-
-	if (pjInfo.hasLat0)
-	{
-		 if (nextp < npar)
-		 {
-			pars.lat0 = atof(projDesc[nextp].c_str()) * TeCDR;
-			nextp++;
-		 }
-		 else
-			 return false;
-	}
-
-	if (pjInfo.hasStlat1)
-	{
-		 if (nextp < npar)
-		 {
-			pars.stlat1 = atof(projDesc[nextp].c_str()) * TeCDR;
-			nextp++;
-		 }
-		 else
-			 return false;
-	}
-
-	if (pjInfo.hasStlat2)
-	{
-		 if (nextp < npar)
-		 {
-			pars.stlat2 = atof(projDesc[nextp].c_str()) * TeCDR;
-			nextp++;
-		 }
-		 else
-			 return false;
-	}
-
-	if (pjInfo.hasOffx)
-	{
-		 if (nextp < npar)
-		 {
-			pars.offx = atof(projDesc[nextp].c_str());
-			nextp++;
-		 }
-		 else
-			 return false;
-	}
-
-	if (pjInfo.hasOffy)
-	{
-		 if (nextp < npar)
-		 {
-			pars.offy = atof(projDesc[nextp].c_str());
-			nextp++;
-		 }
-		 else
-			 return false;
-	}
-	
-	if (pjInfo.hasScale)
-	{
-		 if (nextp < npar)
-		 {
-			pars.scale = atof(projDesc[nextp].c_str());
-			nextp++;
-		 }
-		 else
-			 return false;
-	}
-	return true;
-}
-
-/********************************************************************
-		Planimetric datum transformation 
-********************************************************************/
-void
-TeProjection :: ChangeLL (double &lon1, double &lat1)		
-{
-	double 	equad1,	// Squared eccentricity - datum 1
-			equad2,	// Squared eccentricity - datum 2
-			n1,		// Great normal of ellipsoid - datum 1
-			n2,		// Great normal od ellipsoid - datum 2
-			x1,		// Geocentric cartesian coordinates - datum 1 
-			y1,
-			z1,
-			x2,		// Geocentric cartesian coordinates - datum 2
-			y2,
-			z2,
-			d,lat2,		// Ancillary variable
-			lon2;
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-
- 	if( GPdestination->GPdatum.radius() == 0.) return;
-
-	int	flt1 = (int)(Pflt*1000000000.);
-	int	flt2 = (int)(GPdestination->GPdatum.flattening()*1000000000.);
-	if (Prd == GPdestination->GPdatum.radius() && flt1==flt2)
-		return;
-
-// Geocentric cartesian coordinates calculation - datum 1
-	equad1 = 2.*Pflt;
-	equad1 -= Pflt*Pflt;
-	double a1,a2,a3;
-	a1 = sin(lat1);
-	a1 *= a1;
-	a1 *= equad1;
-	a2 = 1-a1;
-	n1 = Prd/sqrt(a2);
-	x1 = n1*cos(lat1)*cos(lon1);
-	y1 = n1*cos(lat1)*sin(lon1);
-	z1 = (n1*(1-equad1))*sin(lat1);
-
-// Geocentric cartesian coordinates calculation - datum 2
-	if (GPdatum.xShift() == TeMAXFLOAT || GPdestination->GPdatum.xShift() == TeMAXFLOAT)
-	{
-		x2 = x1; 
-		y2 = y1;
-		z2 = z1;
-	}
-	else
-	{	
-		x2 = x1 + (GPdatum.xShift() - GPdestination->GPdatum.xShift());
-		y2 = y1 + (GPdatum.yShift() - GPdestination->GPdatum.yShift());
-		z2 = z1 + (GPdatum.zShift() - GPdestination->GPdatum.zShift());
-	}
-
-// Geodetic coordinates calculation - datum 2
-	equad2 = 2.*GPdestination->GPdatum.flattening();
-	equad2 -= (GPdestination->GPdatum.flattening())*(GPdestination->GPdatum.flattening());
-	lat2 = lat1;
-	do
-	{
-		a1 = sin(lat2);
-		a1 *= a1;
-		a1 *= equad2;
-		a2 = 1-a1;
-		n2 = GPdestination->GPdatum.radius()/sqrt(a2);
-		a1 = equad2*sin(lat2);
-		a1 *= n2;
-		a1 += z2;
-		a2 = x2*x2;
-		a2 += (y2*y2);
-		a3 = sqrt(a2);
-		lat2 = atan2(a1,a3);
-		a1 = sin(lat2);
-		a1 *= a1;
-		a1 *= equad2;
-		a2 = 1-a1;
-		a3 = sqrt(a2);
-		d = (GPdestination->GPdatum.radius()/a3)-n2;
-	}
-	while (fabs(d) > 0.0000001);
-	lon2 = atan2(y2,x2);
-	lat1 = lat2;
-	lon1 = lon2;
-}
-
-/********************************************************************
-		GEODETIC TO UTM COORDINATES
-********************************************************************/
-
-
-TeCoord2D
-TeUtm :: LL2PC (TeCoord2D& ptll)
-{
-
-	double	k0,		// Scale factor
-		equad,		// Squared eccentricity
-		n,		// Great normal of ellipsoid
-		elinquad,	// ancillary variables 
-		aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9,
-		aux10,aux11,aux12,aux13,t,c,ag,m,ptllx,ptlly;
-
-	double Pflt = GPdatum.flattening();
-	ptllx = ptll.x();
-	ptlly = ptll.y();
-	k0 = 1. - (1./2500.);
-	equad = 2.*Pflt;	
-	equad -= Pflt*Pflt;
-	elinquad = equad/(1. - equad);
-	aux1 = equad*equad;
-	aux2 = aux1*equad;
-	aux3 = sin((double)2*ptlly);
-	aux4 = sin((double)4*ptlly);
-	aux5 = sin((double)6*ptlly);
-
-	double a1, a2, a3;
-	a1 = equad/4.;
-	a2 = 3.*aux1/64.;
-	a3 = 5.*aux2/256.;
-	aux6 = (1-a1-a2-a3)*ptlly;
-
-	a1 = 3.*equad/8.;
-	a2 = 3.*aux1/32.;
-	a3 = 45.*aux2/1024.;
-	aux7 = (a1+a2+a3)*aux3;
-
-	a1 = 15.*aux1/256.;
-	a2 = 45.*aux2/1024.;
-	aux8 = (a1+a2)*aux4;
-
-	aux9 = 35.*aux2;
-	aux9 /= 3072.;
-	aux9 *= aux5;
-
-	a1 = sin(ptlly);	
-	a1 *= a1;		
-	a1 *= equad;		
-	n = GPdatum.radius()/sqrt((double)1-a1);
-
-
-	t = tan(ptlly);		
-	t *= t;			
-
-	c = cos(ptlly);		
-	c *= c;			
-	c *= elinquad;		
-	ag = (ptllx-GPlon0)*cos(ptlly);
-	m = GPdatum.radius()*(aux6 - aux7 + aux8 - aux9);
-
-
-	a1 = ag*ag*ag;
-	aux10 = (1.-t+c)*a1/6.;
-
-	a1 = 5.-(18.*t);
-	a2 = a1+t*t;
-	a1 = a2+72.*c;
-	a2 = a1-(58.*elinquad);
-	a1 = ag*ag*ag;		
-	a1 *= ag;		
-	a1 *= ag;		
-	aux11 = a2*a1/120.;	
-
-	a1 = 5.-t+9.*c;
-	a2 = 4.*c*c;
-	a3 = ag*ag;
-	a3 *= ag;
-	a3 *= ag;
-	aux12 = (a1+a2)*a3/24.;
-
-	a1 = 61.-(58.*t) ;
-	a2 = a1+(t*t);
-	a1 = a2+(600.*c);
-	a2 = a1-(330.*elinquad);
-	a1 = ag*ag*ag;		
-	a1 *= ag;		
-	a1 *= ag;		
-	a1 *= ag;		
-	aux13 = a2*a1/720.;	
-
-	ptllx = k0*n*(ag + aux10 + aux11);
-
-	a1 = ag*ag/2;
-	a2 = a1+aux12+aux13;
-	a3 = n*tan(ptlly);
-	a1 = a2*a3;
-	ptlly = k0*(m+a1);
-
-	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));
-}
-
-
-/********************************************************************
-		UTM TO GEODETIC COORDINATES
-********************************************************************/
-
-TeCoord2D
-TeUtm :: PC2LL (TeCoord2D& ptpc)
-{
-	double  k0,             	// Scale factor
-		equad,			// Squared eccentricity
-		n1,			// Great normal of ellipsoid
-		elinquad,		// Ancillary variables
-		e1,aux1,aux2,aux3,aux4,aux5,m,mi,aux6,aux7,aux8,lat1,
-		c1,t1, quoc,r1,d,aux9,aux10,aux11,aux12,ptpcx,ptpcy;
-
-	double Prd  = GPdatum.radius();
-	double Pflt = GPdatum.flattening();
-	
-	ptpcx = ptpc.x()-GPoffx;
-	ptpcy = ptpc.y()-GPoffy;		
-
-	k0 = 1. - (1./2500.);
-	equad = 2.*Pflt;		
-	equad -= Pflt*Pflt;		
-	elinquad = equad/(1. - equad);
-
-	double a1,a2,a3;
-	a1 = sqrt((double)1-equad);
-	e1 = (1.-a1)/(1.+a1);
-
-	aux1 = equad*equad;
-	aux2 = aux1*equad;
-	aux3 = e1*e1;
-	aux4 = e1*aux3;
-	aux5 = aux4*e1;
-
-	m = ptpcy/k0;
-
-
-	a1 = 1.-(equad/4.);
-	a2 = 3.*(aux1/64.);
-	a3 = 5.*(aux2/256.);
-	mi = m/(Prd*(a1-a2-a3));
-
-
-	a1 = 3.*(e1/2.);
-	a2 = 27.*(aux4/32.);
-	a3 = sin((double)2*mi);
-	aux6 = (a1-a2)*a3;
-
-	a1 = 21.*(aux3/16.);
-	a2 = 55.*(aux5/32.);
-	a3 = sin((double)4*mi);
-	aux7 = (a1-a2)*a3;
-
-	a1 = 151.*(aux4/96.);
-	a2 = sin((double)6*mi);
-	aux8 = a1*a2;
-
-	lat1 = mi + aux6 + aux7 + aux8;
-
-	c1 = cos(lat1);			
-	c1 *= c1;			
-	c1 *= elinquad;			
-
-	t1 = tan(lat1);			
-	t1 *= t1;			
-
-	a1 = sin(lat1);			
-	a1 *= a1;			
-	a1 *= equad;			
-	a2 = 1.-a1;
-	n1 = Prd/sqrt(a2);
-
-	a1 = sin(lat1);
-	a1 *= a1;
-	a1 *= equad;
-	a2 = 1.-a1;
-	quoc = a2*a2*a2;
-
-	r1 = Prd*(1.-equad);
-	r1 /= sqrt(quoc);
-
-	d = ptpcx;
-	d /= (n1*k0);
-
-
-	a1 = 5.+(3.*t1);
-	a1 += (10.*c1);
-	a1 += (-4.*(c1*c1));
-	a1 += (-9.*elinquad);
-	a1 *= d;
-	a1 *= d;
-	a1 *= d;
-	a1 *= d;
-	aux9 = a1/24.;
-
-	a1 = 61.+(90.*t1);
-	a1 += (298.*c1);
-	a1 += (45.*(t1*t1));
-	a1 += (-252.*elinquad);
-	a1 += (-3.*c1*c1);
-	aux10 = d*d*d;			
-	aux10 *= d;			
-	aux10 *= d;			
-	aux10 *= d;			
-	aux10 *= a1;
-	aux10 /= 720.;
-
-	a1 = d*d*d;
-	a1 /= 6.;
-	a2 = 2.*t1;
-	a2 += (1.+c1);
-	aux11 = d-a2*a1;
-
-	a1 = 5.-(2.*c1);
-	a1 += (28.*t1);
-	a1 += (-3.*c1*c1);
-	a1 += (8.*elinquad);
-	a1 += (24.*t1*t1);
-	aux12 = d*d*d;			
-	aux12 *= d;			
-	aux12 *= d;			
-	aux12 *= a1;			
-	aux12 /= 120.;			
-
-	a1 = d*d/2.;
-	a1 += (- aux9 + aux10);
-	a2 = tan(lat1)/r1;
-	a2 *= n1;
-	ptpcy = lat1-a2*a1;
-
-	ptpcx= GPlon0 + (aux11 + aux12)/cos(lat1);
-
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return(TeCoord2D(ptpcx,ptpcy));
-}
-
-/********************************************************************
-		GEODETIC TO MERCATOR COORDINATES
-********************************************************************/
-TeCoord2D
-TeMercator :: LL2PC (TeCoord2D& ptll)
-{
-	double	equad,			//Squared eccentricity
-		aux1,			// Ancillary variables
-		aux2,aux3,aux4,aux5,aux6,ptllx,ptlly;
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-
-	ptllx = ptll.x();		
-	ptlly = ptll.y();		
-
-	equad = 2.*Pflt;		
-	equad -= Pflt*Pflt;		
-	double	a1,a2,a3;		
- 
-	a1 = tan(ptlly/(double)2);	
-	a2 = 1.+a1;			
-	a3 = 1.-a1;			
-	aux1 = a2/a3;			
- 
-	a1 = equad*equad/4.;		
-	a1 += equad;			
-	a2 = equad*equad*equad/8.;	
-	a3 = sin(ptlly);		
-	aux2 = (a1+a2)*a3;		
- 
-	a1 = equad*equad/12.;		
-	a2 = equad*equad*equad/16.;	
-	a3 = sin((double)3*ptlly);	
-	aux3 = (a1+a2)*a3;		
- 
-	a1 = equad*equad*equad/80.;	
-	a2 = sin((double)5*ptlly);	
-	aux4 = a1*a2;			
-	aux5 = cos(GPstlat1);
- 
-	a1 = sin(GPstlat1);		
-	a1 *= a1;			
-	a1 *= equad;			
-	a2 = sqrt((double)1-a1);	
-	aux6 = 1./a2;			
-
-	ptllx = Prd*(ptllx - GPlon0)*aux5*aux6;
-	ptlly = Prd*(log(aux1) - aux2 + aux3 - aux4)*aux5*aux6;
-
-	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
-}
-
-/********************************************************************
-		MERCATOR TO GEODETIC COORDINATES
-********************************************************************/
-TeCoord2D
-TeMercator :: PC2LL (TeCoord2D& ptpc)
-{
-	double	equad,			//Squared eccentricity 
-	        pi,			// PII value
-		t,			// Ancillary variables
-		xx,aux1,aux2,aux3,aux4,aux5,ptpcx,ptpcy;
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-
-	ptpcx = ptpc.x()-GPoffx;
-	ptpcy = ptpc.y()-GPoffy;
-
-	equad = 2.*Pflt;		
-	equad -= Pflt*Pflt;		
-	pi = 4.*atan((double)1);
-	double	a1,a2;		
-	aux1 = cos(GPstlat1);
-
-	a1 = sin(GPstlat1);		
-	a1 *= a1;			
-	a1 *= equad;			
-	a2 = sqrt((double)1-a1);	
-	aux2 = 1./a2;			
-	ptpcx = ptpcx/(aux1*aux2);
-	ptpcy = ptpcy/(aux1*aux2);
-	t = exp(-ptpcy/Prd);
-	xx = pi/2. - 2.*atan(t);
- 
-	a1 = equad/2.;			
-	a1 += 5.*equad*equad/24.;	
-	a1 += equad*equad*equad/12.;	
-	a2 = sin((double)4*atan(t));	
-	aux3 = a1*a2;			
- 
-	a1 = 7.*equad*equad/48.;	
-	a1 += 29.*equad*equad*equad/240.;	
-	a2 = sin((double)8*atan(t));	
-	aux4 = -a1*a2;			
- 
-	a1 = 7.*equad*equad*equad/120.;	
-	a2 = sin((double)12*atan(t));	
-	aux5 = a1*a2;		 
-
-	ptpcy = xx + aux3 + aux4 + aux5;
-	ptpcx = ptpcx/Prd + GPlon0;
-	
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return(TeCoord2D(ptpcx,ptpcy));
-}
-
-
-
-
-/********************************************************************
-		GEODETIC TO LAMBERT CONIC COORDINATES
-********************************************************************/
-TeCoord2D
-TeLambertConformal :: LL2PC (TeCoord2D& ptll)
-{
-
-	double	equad,			// Squared eccentricity
-		e,			// Ancillary variables
-		m1,m2,aux1,aux2,aux0,t1,t2,t0,n,efe,ro0,aux,
-		t,ro,teta,ptllx,ptlly;
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-
-	ptllx = (double)ptll.x();
-	ptlly = (double)ptll.y();
-
-	equad = 2.*Pflt - pow(Pflt,(double)2);
-	e = sqrt(equad);
-
-	m1 = cos(GPstlat1)/sqrt((double)1-equad*pow(sin(GPstlat1),(double)2));
-	m2 = cos(GPstlat2)/sqrt((double)1-equad*pow(sin(GPstlat2),(double)2));
-	aux1 = sqrt(((double)1-e*sin(GPstlat1))/((double)1+e*sin(GPstlat1)));
-	aux2 = sqrt(((double)1-e*sin(GPstlat2))/((double)1+e*sin(GPstlat2)));
-	aux0 = sqrt(((double)1-e*sin(GPlat0))/((double)1+e*sin(GPlat0)));
-	t1 = ((1.-tan(GPstlat1/(double)2))/(1.+tan(GPstlat1/(double)2)))/pow(aux1,e);
-	t2 = ((1.-tan(GPstlat2/(double)2))/(1.+tan(GPstlat2/(double)2)))/pow(aux2,e);
-	t0 = ((1.-tan(GPlat0/(double)2))/(1.+tan(GPlat0/(double)2)))/pow(aux0,e);
-
-	if (GPstlat1 == GPstlat2)
-		n = sin(GPstlat1);
-	else
-		n = (log(m1)-log(m2))/(log(t1)-log(t2));
-
-	efe = m1/(n*pow(t1,n));
-	ro0 = Prd*efe*pow(t0,n);
-
-	aux = sqrt(((double)1-e*sin(ptlly))/((double)1+e*sin(ptlly)));
-	t = ((1.-tan(ptlly/(double)2))/(1.+tan(ptlly/(double)2)))/pow(aux,e);
-	ro = Prd*efe*pow(t,n);
-	teta = n*(ptllx - GPlon0);
-	ptllx = ro*sin(teta);
-	ptlly = ro0 - ro*cos(teta);
-	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
-}
-
-
-
-/********************************************************************
-		LAMBERT CONIC TO GEODETIC COORDINATES
- ********************************************************************/
-TeCoord2D
-TeLambertConformal :: PC2LL (TeCoord2D& ptpc)
-{
-	double	equad,			// Squared eccentricity 
-		pi,			// PI value
-		e,m1,m2,aux1,aux2,aux0,t1,t2,t0,n,efe,ro0,ro,teta,
-		t,xx,aux3,aux4,aux5,ptpcx,ptpcy;
-
-	int	sinal;
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-	
-
-	ptpcx = ptpc.x()-GPoffx;
-	ptpcy = ptpc.y()-GPoffy;
-
-	equad = 2.*Pflt - pow(Pflt,(double)2);
-	e = sqrt(equad);
-	pi = 4.*atan((double)1);
-
-	m1 = cos(GPstlat1)/sqrt((double)1-equad*pow(sin(GPstlat1),(double)2));
-	m2 = cos(GPstlat2)/sqrt((double)1-equad*pow(sin(GPstlat2),(double)2));
-	aux1 = sqrt(((double)1-e*sin(GPstlat1))/((double)1+e*sin(GPstlat1)));
-	aux2 = sqrt(((double)1-e*sin(GPstlat2))/((double)1+e*sin(GPstlat2)));
-	aux0 = sqrt(((double)1-e*sin(GPlat0))/((double)1+e*sin(GPlat0)));
-	t1 = ((1.-tan(GPstlat1/(double)2))/(1.+tan(GPstlat1/(double)2)))/pow(aux1,e);
-	t2 = ((1.-tan(GPstlat2/(double)2))/(1.+tan(GPstlat2/(double)2)))/pow(aux2,e);
-	t0 = ((1.-tan(GPlat0/(double)2))/(1.+tan(GPlat0/(double)2)))/pow(aux0,e);
-
-	if (GPstlat1 == GPstlat2)
-		n = sin(GPstlat1);
-	else
-		n = (log(m1)-log(m2))/(log(t1)-log(t2));
-
-	efe = m1/(n*pow(t1,n));
-	ro0 = Prd*efe*pow(t0,n);
-
-	sinal = (int)(n/fabs(n));
-	ro = sqrt(ptpcx*ptpcx + (ro0-ptpcy)*(ro0-ptpcy));
-	ro *= sinal;
-	teta = atan(ptpcx/(ro0-ptpcy));
-	t = pow((ro/(Prd*efe)),(double)1/n);
-	xx = pi/2. - 2.*atan(t);
-	aux3 = equad/2. + 5.*equad*equad/24. + equad*equad*equad/12.;
-	aux4 = 7.*equad*equad/48. + 29.*equad*equad*equad/240.;
-	aux5 = (7.*equad*equad*equad/120.)*sin(12.*atan(t));
-
-	ptpcy = xx + aux3*sin(4.*atan(t)) - aux4*sin(8.*atan(t)) + aux5;
-	ptpcx = teta/n + GPlon0;
-	
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return (TeCoord2D(ptpcx,ptpcy));
-}
-
-/********************************************************************
-		GEODETIC TO POLYCONIC COORDINATES
-********************************************************************/
-TeCoord2D
-TePolyconic :: LL2PC (TeCoord2D& ptll)
-{
-	double	equad,			// Squared eccentricity 
-		n,			// Great normal of ellipsoid
-		aux01,			// Ancillary variables
-		aux02,aux03,aux04,m0,aux1,aux2,aux3,
-		aux4,m,e,ptllx,ptlly;
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-
-	ptllx = (double)ptll.x();
-	ptlly = (double)ptll.y();
-
-	equad = 2.*Pflt - pow(Pflt,(double)2);
-
-	aux01 = (1.-equad/4.-3.*equad*equad/64.-5.*equad*equad*equad/256.)*GPlat0;
-	aux02 = (3.*equad/8+3.*equad*equad/32.+45.*equad*equad*equad/1024.)*sin((double)2*GPlat0);
-	aux03 = (15.*equad*equad/256.+45.*equad*equad*equad/1024.)*sin((double)4*GPlat0);
-	aux04 = (35.*equad*equad*equad/3072.)*sin((double)6*GPlat0);
-	m0 = Prd*(aux01 - aux02 + aux03 - aux04);
-
-	if (ptlly == 0.)
-	{
-		ptllx = Prd*(ptllx - GPlon0);
-		ptlly = -m0;
-	}
-	else
-	{
-		aux1 = (1.-equad/4.-3.*equad*equad/64.-5.*equad*equad*equad/256.)*ptlly;
-		aux2 = (3.*equad/8+3.*equad*equad/32.+45.*equad*equad*equad/1024.)*sin((double)2*ptlly);
-		aux3 = (15.*equad*equad/256.+45.*equad*equad*equad/1024.)*sin((double)4*ptlly);
-		aux4 = (35.*equad*equad*equad/3072.)*sin((double)6*ptlly);
-		m = Prd*(aux1 - aux2 + aux3 - aux4);
-		n = Prd/sqrt((double)1-equad*pow(sin(ptlly),(double)2));
-		e = (ptllx - GPlon0)*sin(ptlly);
-		ptllx = n*sin(e)/tan(ptlly);
-		ptlly = m - m0 + (n*(1. - cos(e))/tan(ptlly));
-	}
-	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
-}
-
-/*******************************************************************
-		POLYCONIC TO GEODETIC COORDINATES
-********************************************************************/
-TeCoord2D
-TePolyconic :: PC2LL (TeCoord2D& ptpc)
-{	
-	double	A,	
-		B,
-		C,
-		equad,			// Squared eccentricity
-		aux01,			// Ancillary variables
-		aux02,aux03,aux04,m0,mn,mnl,ma,cp,lat1,lat2,aux05,
-		aux06,aux07,aux08,aux09,aux10,aux11,aux12,aux21,
-		aux22,aux23,aux24,ptpcx,ptpcy;
-
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-
-	ptpcx = ptpc.x()-GPoffx;
-	ptpcy = ptpc.y()-GPoffy;
-
-	equad = 2.*Pflt - pow(Pflt,(double)2);
-
-	// Initialize latitude with latitude of origin
-	aux01 = (1.-equad/4.-3.*equad*equad/64.-5.*equad*equad*equad/256.)*GPlat0;
-	aux02 = (3.*equad/8+3.*equad*equad/32.+45.*equad*equad*equad/1024.)*sin((double)2*GPlat0);
-	aux03 = (15.*equad*equad/256.+45.*equad*equad*equad/1024.)*sin((double)4*GPlat0);
-	aux04 = (35.*equad*equad*equad/3072.)*sin((double)6*GPlat0);
-	m0 = Prd*(aux01 - aux02 + aux03 - aux04);
-
-	if (ptpcy == (-m0))
-	{
-		ptpcy= 0.;
-		ptpcx = ptpcx/Prd + GPlon0;
-	}
-	else
-	{
-		A = (m0 + ptpcy)/Prd;
-		B = ((ptpcx*ptpcx)/(Prd*Prd)) +(A*A);
-
-		lat2 = A;
-
-		do
-		{
-			C = (sqrt(1.- equad*sin(lat2)*sin(lat2)))*tan(lat2);
-
-			// mn calculation	
-			aux21 = (1.-equad/4.-3.*equad*equad/64.-5.*equad*equad*equad/256.)*lat2;
-			aux22 = (3.*equad/8.+3.*equad*equad/32.+45.*equad*equad*equad/1024.)*sin((double)2*lat2);
-			aux23 = (15.*equad*equad/256.+45.*equad*equad*equad/1024.)*sin((double)4*lat2);
-			aux24 = (35.*equad*equad*equad/3072.)*sin((double)6*lat2);
-			mn = Prd*(aux21 - aux22 + aux23 - aux24);
-		
-			// mnl calculation
-			aux05 = 1.- equad/4.-3.*equad*equad/64.-5.*equad*equad*equad/256.;
-			aux06 = 2.*(3.*equad/8.+3.*equad*equad/32.+45.*equad*equad*equad/1024.)*cos((double)2*lat2);
-			aux07 = 4.*(15.*equad*equad/256.+45.*equad*equad*equad/1024.)*cos((double)4*lat2);
-			aux08 = 6.*(35.*equad*equad*equad/3072.)*cos((double)6*lat2);
-			mnl = aux05 - aux06 + aux07- aux08;
-
-			// ma calculation
-			ma = mn/Prd;
-
-			aux09 = (A*(C*ma+1)-ma)-(0.5*(ma*ma+B)*C);
-			aux10 = equad*sin((double)2*lat2)*(ma*ma+B-2.*A*ma);
-			aux11 = 4.*C+(A-ma);
-			aux12 = C*mnl-(2./sin((double)2*lat2));
-
-			// New latitude calculation 
-			lat1 = lat2 - (aux09/((aux10/(aux11*aux12)) - mnl));
-			cp = fabs(lat1-lat2) ;
-			lat2 = lat1;
-
-
-		}while(cp > 0.0000000001);
-
-		ptpcy = lat1;
-		ptpcx = ((asin((ptpcx*C)/Prd))/(sin(lat1))) + GPlon0;
-	}
-
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return (TeCoord2D(ptpcx,ptpcy));	
-
-}
-
-/********************************************************************
-	GEODETIC TO LAT LONG
-********************************************************************/
-TeCoord2D
-TeLatLong :: LL2PC (TeCoord2D& ptll)
-{
-	return TeCoord2D( ptll.x()*TeCRD, ptll.y()*TeCRD ); 
-}
-
-//FAMI
-void
-TeLatLong :: LL2PC (double xi, double yi, double& xo, double& yo) const
-{
-	xo = xi*TeCRD;
-	yo = yi*TeCRD;
-	return;
-}
-
-/********************************************************************
-	LAT LONG TO GEODETIC COORDINATES
-********************************************************************/
-TeCoord2D
-TeLatLong :: PC2LL (TeCoord2D& ptpc)
-{
-	double ptpcx, ptpcy;
-
-	ptpcx = ptpc.x()*TeCDR;
-	ptpcy = ptpc.y()*TeCDR;
-	
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return TeCoord2D(ptpcx,ptpcy); 
-}
-
-//FAMI
-void
-TeLatLong :: PC2LL (double xi, double yi, double& ptpcx, double& ptpcy)
-{
-	ptpcx = xi*TeCDR;
-	ptpcy = yi*TeCDR;
-	
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return; 
-}
-
-/********************************************************************
-	GEODETIC TO ALBERS EQUAL-AREA COORDINATES
-********************************************************************/
-TeCoord2D
-TeAlbers :: LL2PC (TeCoord2D& ptll)
-{
-
-	double	equad,			// Squared eccentricity
-		e,			// Ancillary variables
-		m1,m2,aux1,aux10,aux11,aux12,aux2,aux20,aux21,
-		aux22,q0,q1,q2,q,n,c,ro0,teta,ro,ptllx,ptlly;
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-
-	ptllx = (double)ptll.x();
-	ptlly = (double)ptll.y();
-
-	equad = 2.*Pflt - pow(Pflt,(double)2);
-	e = sqrt(equad);
-
-	m1 = cos(GPstlat1)/sqrt((double)1-equad*pow(sin(GPstlat1),(double)2));
-	m2 = cos(GPstlat2)/sqrt((double)1-equad*pow(sin(GPstlat2),(double)2));
-	aux1 = sin(ptlly)/((double)1-equad*pow(sin(ptlly),(double)2));
-	aux10 = sin(GPlat0)/((double)1-equad*pow(sin(GPlat0),(double)2));
-	aux11 = sin(GPstlat1)/((double)1-equad*pow(sin(GPstlat1),(double)2));
-	aux12 = sin(GPstlat2)/((double)1-equad*pow(sin(GPstlat2),(double)2));
-	aux2 = log((1. - e*sin(ptlly))/(1. + e*sin(ptlly)));
-	aux20 = log((1. - e*sin(GPlat0))/(1. + e*sin(GPlat0)));
-	aux21 = log((1. - e*sin(GPstlat1))/(1. + e*sin(GPstlat1)));
-	aux22 = log((1. - e*sin(GPstlat2))/(1. + e*sin(GPstlat2)));
-	q0 = (1. - equad)*(aux10 - (1./(2.*e))*aux20);
-	q1 = (1. - equad)*(aux11 - (1./(2.*e))*aux21);
-	q2 = (1. - equad)*(aux12 - (1./(2.*e))*aux22);
-	q = (1. - equad)*(aux1 - (1./(2.*e))*aux2);
-	n = (m1*m1 - m2*m2)/(q2 - q1);
-	c = m1*m1 + n*q1;
-	ro0 = Prd*sqrt(c - n*q0)/n;
-	teta = n*(ptllx - GPlon0);
-	ro = Prd*sqrt(c - n*q)/n;
-
-	ptllx = ro*sin(teta);
-	ptlly = ro0 - ro*cos(teta);
-
-	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
-}
-
-
-/********************************************************************
-		ALBERS EQUAL-AREA TO GEODETIC COORDINATES
-********************************************************************/
-TeCoord2D
-TeAlbers :: PC2LL(TeCoord2D& ptpc)
-{
-
-	double	equad,			// Squared eccentricity
-		e,			// Eccentricity
-		m1,			// Ancillary variable
-		m2,aux10,aux11,aux12,aux20,aux21,aux22,q0,q1,q2,
-		n,c,ro0,ro,q,aux,beta,aux1,aux2,aux3,teta,ptpcx,ptpcy;
-
-	int	sinal;			// Ancillary variable	
-
-	
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-
-	ptpcx = ptpc.x()-GPoffx;
-	ptpcy = ptpc.y()-GPoffy;
-
-	sinal = (int)(GPstlat2/fabs(GPstlat2));
-	equad = 2.*Pflt - pow(Pflt,(double)2);
-	e = sqrt(equad);
-
-	m1 = cos(GPstlat1)/sqrt((double)1-equad*pow(sin(GPstlat1),(double)2));
-	m2 = cos(GPstlat2)/sqrt((double)1-equad*pow(sin(GPstlat2),(double)2));
-	aux10 = sin(GPlat0)/((double)1-equad*pow(sin(GPlat0),(double)2));
-	aux11 = sin(GPstlat1)/((double)1-equad*pow(sin(GPstlat1),(double)2));
-	aux12 = sin(GPstlat2)/((double)1-equad*pow(sin(GPstlat2),(double)2));
-	aux20 = log((1. - e*sin(GPlat0))/(1. + e*sin(GPlat0)));
-	aux21 = log((1. - e*sin(GPstlat1))/(1. + e*sin(GPstlat1)));
-	aux22 = log((1. - e*sin(GPstlat2))/(1. + e*sin(GPstlat2)));
-	q0 = (1. - equad)*(aux10 - (1./(2.*e))*aux20);
-	q1 = (1. - equad)*(aux11 - (1./(2.*e))*aux21);
-	q2 = (1. - equad)*(aux12 - (1./(2.*e))*aux22);
-	n = (m1*m1 - m2*m2)/(q2 - q1);
-	c = m1*m1 + n*q1;
-	ro0 = Prd*sqrt(c - n*q0)/n;
-	ro = sqrt(ptpcx*ptpcx + (ro0 - ptpcy)*(ro0 - ptpcy));
-	q = (c - (ro*ro*n*n/(Prd*Prd)))/n;
-	aux = ((1. - equad)/(2.*e))*log((1. - e)/(1. + e));
-	beta = asin(q/(1. - aux));
-	aux1 = (equad/3. + 31.*equad*equad/180.+517.*equad*equad*equad/5040.)*sin(2.*beta);
-	aux2 = (23.*equad*equad/360.+251.*equad*equad*equad/3780.)*sin(4.*beta);
-	aux3 = (761.*equad*equad*equad/45360.)*sin(6.*beta);
-	teta = fabs(atan(ptpcx/(ro0 - ptpcy)));
-
-	if (sinal == 1)
-	{
-		if (ptpcx < 0.)
-			teta = -teta;
-	}
-
-	if (sinal == -1)
-	{
-		if (ptpcx > 0.)
-			teta *= sinal;
-	}
-
-	ptpcy = beta + aux1 + aux2 + aux3;
-	ptpcx = GPlon0 + (teta/n);
-
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return (TeCoord2D(ptpcx,ptpcy));
-}
-
-/*******************************************************************
-		GEODETIC TO MILLER COORDINATES
-********************************************************************/
-TeCoord2D
-TeMiller :: LL2PC (TeCoord2D& ptll)
-{
-
-	double	pi,		// PI value
-		ptllx,ptlly;	// Ancillary variables 
-
-	int	sinal;		// Ancillary variables
-
-	double Prd  = GPdatum.radius();
-	
-	ptllx = (double)ptll.x();
-	ptlly = (double)ptll.y();
-
-	pi = 4.*atan((double)1);
-	sinal = (int)(fabs(ptlly)/ptlly);
-	
-	ptllx = Prd*(ptllx - GPlon0);
-
-	if (sinal == 1)
-		ptlly = (Prd/0.8)*(log(tan(pi/4. + 0.4*ptlly)));
-	else
-	{
-		ptlly *= sinal;
-		ptlly = (Prd/0.8)*(log(tan(pi/4. + 0.4*ptlly)));
-		ptlly *= sinal;
-	}
-
-	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
-}
-
-
-/********************************************************************
-		MILLER TO GEODETIC COORDINATES
-********************************************************************/
-TeCoord2D
-TeMiller :: PC2LL (TeCoord2D& ptpc)
-{
-
-	double	e,		// Neperian logarithm base 
-		pi,		// PI value
-		ptpcx,ptpcy;	// Ancillary variables
-
-	int	sinal;		// Ancillary variable
-
-	double Prd  = GPdatum.radius();
-
-	ptpcx = ptpc.x()-GPoffx;
-	ptpcy = ptpc.y()-GPoffy;
-
-	e = 2.718281828;
-	pi = 4.*atan((double)1);
-	sinal = (int)(fabs(ptpcy)/ptpcy);
-
-	ptpcx = GPlon0 + (ptpcx/Prd);
-
-	if (sinal == 1)
-		ptpcy = 2.5*atan(pow(e,(0.8*ptpcy/Prd)))-5.*pi/8.;
-	else
-	{
-		ptpcy *= sinal;
-		ptpcy = 2.5*atan(pow(e,(0.8*ptpcy/Prd))) - 5.*pi/8.;
-		ptpcy *= sinal;
-	}
-
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return(TeCoord2D(ptpcx,ptpcy));
-}
-
-
-/*******************************************************************
-		GEODETIC TO SINUSOIDAL COORDINATES
-********************************************************************/
-TeCoord2D
-TeSinusoidal :: LL2PC (TeCoord2D& ptll)
-{
-
-	double	ptllx,ptlly;	// Ancillary variables 
-
-	double Prd  = GPdatum.radius();
-	
-	ptllx = (double)ptll.x();
-	ptlly = (double)ptll.y();
-	
-	ptllx = Prd*(ptllx - GPlon0);
-	ptllx *= cos(ptlly);
-
-	ptlly = Prd*ptlly;
-	
-	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
-}
-
-
-/********************************************************************
-		SINUSOIDAL TO GEODETIC COORDINATES
-********************************************************************/
-TeCoord2D
-TeSinusoidal :: PC2LL (TeCoord2D& ptpc)
-{
-
-	double	ptpcx,ptpcy;	// Ancillary variables
-
-	double Prd  = GPdatum.radius();
-
-	ptpcx = ptpc.x()-GPoffx;
-	ptpcy = ptpc.y()-GPoffy;
-
-	ptpcy = ptpcy/Prd;
-
-	ptpcx = GPlon0 + (ptpcx/(Prd*cos(ptpcy)));
-	
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return(TeCoord2D(ptpcx,ptpcy));
-}
-
-/*******************************************************************
-		GEODETIC TO CYLINDRICAL EQUIDISTANT COORDINATES
-********************************************************************/
-TeCoord2D
-TeCylindricalEquidistant :: LL2PC (TeCoord2D& ptll)
-{
-	double	ptllx,ptlly;
-
-	double Prd  = GPdatum.radius();
-
-	ptllx = ptll.x();
-	ptlly = ptll.y();
-
-	ptllx = Prd*(ptllx - GPlon0)*cos(GPstlat1);
-	ptlly = Prd*ptlly;
-
-	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));
-}
-
-
-/*******************************************************************
-	CYLINDRICAL EQUIDISTANT TO	GEODETIC COORDINATES
-********************************************************************/
-TeCoord2D
-TeCylindricalEquidistant :: PC2LL (TeCoord2D& ptpc)
-{
-	double	ptpcx,ptpcy;
-
-	double Prd  = GPdatum.radius();
-
-	ptpcx = ptpc.x()-GPoffx;
-	ptpcy = ptpc.y()-GPoffy;
-
-	ptpcy = ptpcy/Prd;
-	ptpcx = GPlon0 + ptpcx/(Prd*cos(GPstlat1));
-
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return (TeCoord2D(ptpcx,ptpcy));
-}
-
-/*******************************************************************
-		GEODETIC TO POLAR STEREOGRAPHIC COORDINATES
-********************************************************************/
-TeCoord2D
-TePolarStereographic :: LL2PC (TeCoord2D& ptll)
-{
-	double	k0,				// Scale factor
-		e,					// Eccentricity
-		pi,					// Auxillary variables
-		lon0,				// auxilliary origin longitude
-		t,ro,aux1,aux2,aux3,ptllx,ptlly;
-	
-	int GPhemis;
-	if (GPhemisphere == TeNORTH_HEM)
-		GPhemis = 1;
-	else
-		GPhemis = -1;
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-	
-	ptllx = ptll.x();
-	ptlly = ptll.y();
-
-	k0 = 0.933;	// Standard parallel 60 degrees 
-	e = sqrt((double)2*Pflt - pow(Pflt,(double)2));
-	pi = 4.*atan((double)1);
-
-	ptlly *= GPhemis;
-	ptllx *= GPhemis;
-	lon0 = (GPhemis == 1) ? GPlon0 : -GPlon0;
-
-	aux1 = (1. - e*sin(ptlly))/(1. + e*sin(ptlly));
-	t = tan((pi/4.) - (ptlly/2.))/pow(aux1,(e/(double)2));
-	aux2 = pow(((double)1 + e),((double)1 + e));
-	aux3 = pow(((double)1 - e),((double)1 - e));
-	ro = 2.*Prd*k0*t/sqrt(aux2*aux3);
-
-	aux1   = ro*sin(ptllx - lon0);
-	ptlly = -ro*cos(ptllx - lon0);
-	aux1 *= GPhemis;
-	ptlly *= GPhemis;
-	
-	if (GPhemis == -1)
-	{
-		aux1 *= GPhemis;
-		ptlly *= GPhemis;
-	}
-//	return(Point((float)aux1,(float)ptlly));
-	return (TeCoord2D(aux1+GPoffx,ptlly+GPoffy));
-
-}
-
-//FAMI
-void
-TePolarStereographic :: LL2PC (double xi, double yi, double& xo, double& yo) const
-{
-	double	k0,				// Scale factor
-		e,					// Eccentricity
-		pi,					// Auxillary variables
-		lon0,				// auxilliary origin longitude
-		t,ro,aux1,aux2,aux3,ptllx,ptlly;
-	
-	int GPhemis;
-	if (GPhemisphere == TeNORTH_HEM)
-		GPhemis = 1;
-	else
-		GPhemis = -1;
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-	
-	ptllx = xi;
-	ptlly = yi;
-
-	k0 = 0.933;	// Standard parallel 60 degrees 
-	e = sqrt((double)2*Pflt - pow(Pflt,(double)2));
-	pi = 4.*atan((double)1);
-
-	ptlly *= GPhemis;
-	ptllx *= GPhemis;
-	lon0 = (GPhemis == 1) ? GPlon0 : -GPlon0;
-
-	aux1 = (1. - e*sin(ptlly))/(1. + e*sin(ptlly));
-	t = tan((pi/4.) - (ptlly/2.))/pow(aux1,(e/(double)2));
-	aux2 = pow(((double)1 + e),((double)1 + e));
-	aux3 = pow(((double)1 - e),((double)1 - e));
-	ro = 2.*Prd*k0*t/sqrt(aux2*aux3);
-
-	aux1   = ro*sin(ptllx - lon0);
-	ptlly = -ro*cos(ptllx - lon0);
-	aux1 *= GPhemis;
-	ptlly *= GPhemis;
-	
-	if (GPhemis == -1)
-	{
-		aux1 *= GPhemis;
-		ptlly *= GPhemis;
-	}
-
-	xo = aux1+GPoffx;
-	yo = ptlly+GPoffy;
-	return;
-}
-
-//FAMI
-void TePolarStereographic :: LL2PC (ostream& java) const 
-{
-	double	k0,			// Scale factor
-		equad,			// Squared eccentricity
-		e,		        // Eccentricity
-		pi,			// Ancillary variables
-		lon0,			// auxilliary origin longitude
-		aux1,aux2,aux3,aux4,aux5;
-	
-		
-	java << "\tpx = xpc - " << GPoffx << ";\n";
-	java << "\tpy = ypc - " << GPoffy << ";\n";
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-	k0   = 0.933;
-	
-	pi = 4.*atan((double)1); 
-	equad =  2.*Pflt - pow(Pflt,(double)2);
-	e = sqrt(equad);
-	
-	
-	if (GPhemisphere != TeNORTH_HEM) {
-		java << "\tpx *= -1;\n";
-		java << "\tpy *= -1;\n";
-	}
-	lon0 = (GPhemisphere == TeNORTH_HEM) ? GPlon0 : -GPlon0;
-
-	java << "\tro = Math.sqrt(px*px + py*py);\n";	
-	aux1 = pow(((double)1 + e),((double)1 + e));
-	aux2 = pow(((double)1 - e),((double)1 - e));
-	
-	java << "\tt = (ro* " << sqrt(aux1*aux2) << ")/(" << 2.*Prd*k0 << ") " << ";\n";
-	java << "\txx = " << pi/2. << " - 2.*Math.atan(t);\n";
-	
-	aux3 =  equad/2. + 5.*equad*equad/24. + equad*equad*equad/12.;
-	aux4 = 7.*equad*equad/48. + 29.*equad*equad*equad/240.;
-	aux5 = 7.*equad*equad*equad/120.;
-
-	java << "\tyll = xx + " << aux3 << "*Math.sin(2*xx) + " << aux4 << "*Math.sin(4*xx) + "<< aux5 << "*Math.sin(6*xx);\n";
-
-	java << "\tif (py != 0.) \n";
-	java << "\t\txll = " << lon0 << "+ Math.atan(px/(-py));\n";
-
-	if (GPhemisphere == TeNORTH_HEM)
-	{
-		java << "\tif (and(greater(px, 0.), greater(py,0.)))\n";
-		java << "\t\txll = xll + " << pi << ";\n";
-		java << "\telse if (and(smaller(px,0.), greater(py,0.)))\n";
-		java << "\t\txll = xll - " << pi << ";\n";
-		java << "\telse if (and(greater(px, 0.), equal(py,0.)))\n";
-		java << "\t\txll = " << lon0  << "+ " << pi << "/ 2.;\n";
-		java << "\telse if (and(smaller(px, 0.),  equal(py,0.)))\n";
-		java << "\t\txll = " << lon0 << " - " << pi << "/ 2.;\n";
-		java << "\telse if (and(equal(px,0.), equal(py, 0.)))\n";
-		java << "\t\txll = " << lon0 << ";\n";
-	}
-	else
-	{
-		java << "\tyll = -yll;\n";
-		java << "\txll = -xll;\n";
-
-		java << "\tif (and(greater(px,0.), smaller(py,0))\n";
-		java << "\t\txll = xll + " << pi << ";\n";
-		java << "\telse if (and (smaller(px, 0.),  samller(py,0) )\n";
-		java << "\t\txll = xll - " << pi << ";\n";
-		java << "\telse if (and(greater(px,0.), equal(py,0.) )\n";
-		java << "\t\txll = " << lon0 << " + " << pi << "/ 2.;\n";
-		java << "\telse if (and(smaller(px,0.), equal(py, 0.))\n";
-		java << "\t\txll = " << lon0 << " - " << pi << " / 2.;\n";
-		java << "\telse if (and(equal(px,0.), equal(py, 0.))\n";
-		java << "\t\txll = " << lon0 << ";\n";
-	}
-
-	java << "\tif (smaller(xll, (-" << pi << ") )) xll += 2.* "<< pi << ";\n";
-	java << "\telse if (greater(xll, " << pi << ")  )    xll -= 2.*" << pi << ";\n";
-	
-	java << "\txll = xll * " << 180/3.14159 << ";\n";
-	java << "\tyll = yll * " << 180/3.14159 << ";\n\n";
-
-	java << "\treturn { lon :  xll, lat : yll } ;\n";
-	java << "}\n";
-	
-}
-/*******************************************************************
-	POLAR STEREOGRAPHIC TO	GEODETIC COORDINATES
-********************************************************************/
-TeCoord2D
-TePolarStereographic :: PC2LL (TeCoord2D& ptpc)
-{
-	double	k0,			// Scale factor
-
-		equad,			// Squared eccentricity
-		e,		        // Eccentricity
-		pi,			// Ancillary variables
-		lon0,			// auxilliary origin longitude
-		ro,t,xx,aux1,aux2,aux3,aux4,aux5,ptpcx=0.,ptpcy,px,py;
-
-	px = (double)ptpc.x()-GPoffx;
-	py = (double)ptpc.y()-GPoffy;
-
-	int GPhemis;
-	if (GPhemisphere == TeNORTH_HEM)
-		GPhemis = 1;
-	else
-		GPhemis = -1;
-
-	double Pflt = GPdatum.flattening();
-	double Prd  = GPdatum.radius();
-
-//	k0 = 0.994;	// Standard parallel 80.1 degrees 
-	k0 = 0.933;	// Standard parallel 60 degrees
-	pi = 4.*atan((double)1);
-	equad = 2.*Pflt - pow(Pflt,(double)2);
-	e = sqrt(equad);
-
-	if (GPhemis == -1)
-	{
-		px *= GPhemis;
-		py *= GPhemis;
-	}
-
-	lon0 = (GPhemis == 1) ? GPlon0 : -GPlon0;
-
-	ro = sqrt(px*px + py*py);
-	aux1 = pow(((double)1 + e),((double)1 + e));
-	aux2 = pow(((double)1 - e),((double)1 - e));
-	t = (ro*sqrt(aux1*aux2))/(2.*Prd*k0);
-	xx = pi/2. - 2.*atan(t);
-	aux3 = equad/2. + 5.*equad*equad/24. + equad*equad*equad/12.;
-	aux4 = 7.*equad*equad/48. + 29.*equad*equad*equad/240.;
-	aux5 = 7.*equad*equad*equad/120.;
-
-	ptpcy = xx + aux3*sin((double)2*xx) + aux4*sin((double)4*xx) + aux5*sin((double)6*xx);
-
-	if (py != 0.)
-		ptpcx = lon0 + atan(px/(-py));
-
-
-	if (GPhemis == 1)
-	{
-		if (px > 0. && py > 0.)
-			ptpcx = ptpcx + pi;
-		else if (px < 0. && py > 0.)
-			ptpcx = ptpcx - pi;
-		else if (px > 0. && py == 0.)
-			ptpcx = lon0 + pi / 2.;
-		else if (px < 0. && py == 0.)
-			ptpcx = lon0 - pi / 2.;
-		else if (px == 0. && py == 0.)
-			ptpcx = lon0;
-	}
-	else
-	{
-		ptpcy *= GPhemis;
-		ptpcx *= GPhemis;
-
-		if (px > 0. && py < 0.)
-			ptpcx = ptpcx + pi;
-		else if (px < 0. && py < 0.)
-			ptpcx = ptpcx - pi;
-		else if (px > 0. && py == 0.)
-			ptpcx = lon0 + pi / 2.;
-		else if (px < 0. && py == 0.)
-			ptpcx = lon0 - pi / 2.;
-		else if (px == 0. && py == 0.)
-			ptpcx = lon0;
-	}
-
-	if (ptpcx < (-pi)) ptpcx += 2.*pi;
-	else if (ptpcx > pi)    ptpcx -= 2.*pi;
-
-	if( GPdestination && !(datum() == GPdestination->datum()))
-		ChangeLL(ptpcx,ptpcy);
-
-	return (TeCoord2D(ptpcx,ptpcy));
-}
-
-//FAMI
-/************************************************************************
-		GEODETIC COORDINATES TO SATELLITE PROJECTION
-*************************************************************************/
-TeCoord2D 
-TeSatelliteProjection::LL2PC(TeCoord2D& ptll)
-{
-	double equad, n, x, y, z, sn, dp, dl,xlo,yla,lin,col,resx,resy;
-	double x1, x2, a, b, c,  Rd2, Rm, Rm2, Rs2, v;
-
-//	xlo = ptpc.x()-GPoffx;
-//	yla = ptpc.y()-GPoffy;
-	xlo = ptll.x();
-	yla = ptll.y();
-
-	// Cartesian geocentric coordinates
-	xlo = xlo - GPlon0;
-	yla = yla - GPlat0;
-	equad = 2.*GPdatum.flattening() - pow(GPdatum.flattening(),(double)2);
-	n = GPdatum.radius()/sqrt((double)1-equad*pow(sin(yla),(double)2));
-	x = n*cos(yla)*cos(xlo);
-	y = n*cos(yla)*sin(xlo);
-	z = (n*(1-equad))*sin(yla);
- 
-	// Field of view angles
-	dp = atan(y / (SPrs - x));
-	dl = atan(z * cos(dp) /(SPrs - x));
-
-	// Visibility test
-	if ( x < 0.0 )
-	{
-		col = TeMAXFLOAT;
-		lin = TeMAXFLOAT;
-		return (TeCoord2D(col,lin));
-	}
-	else
-	{
-		Rd2 = GPdatum.radius() * GPdatum.radius() ;
-		Rm  = GPdatum.radius() * (1 - GPdatum.flattening());
-		Rm2 = Rm * Rm ;
-		Rs2 = SPrs * SPrs;
-
-		v = (tan(dp)*tan(dp)*cos(dp)*cos(dp)*Rm2)+(tan(dl)*tan(dl)*Rd2);
-		a = cos(dp)*cos(dp)*Rm2 + v;      
-		b = -2.*SPrs*v;
-		c = Rs2*v-Rd2*Rm2*cos(dp)*cos(dp);
-
-		// Equation Resolution a*x**2+b*x+c=0 
-		v = (b*b) - (4.*a*c);
-		if (v < 0.0) v=0.0;
-   		x1 = (-b + sqrt(v)) / (2.*a);
-		x2 = (-b - sqrt(v)) / (2.*a);
-		if (x1 < x2)  x1 = x2;
-
-		if ( fabs(x-x1) > 1.0 )
-		{
-			col = TeMAXFLOAT;
-			lin = TeMAXFLOAT;
-			return (TeCoord2D(col,lin));
-		}
-	}
-	// Line and column of image
-	if (SPscn == 0.) sn = 1.0;  else sn = -1.0;
-	col = (sn * dp / SPrj + SPjs );
-	lin = (-sn * dl / SPri + SPis);
-
-	// Axis rotation correction due to yaw angle
-	col = col*cos(SPyaw) - lin*sin(SPyaw);
-	lin = lin*cos(SPyaw) + col*sin(SPyaw);
-	resx = tan(SPrj) * (SPrs - GPdatum.radius());
-	resy = tan(SPri) * (SPrs - GPdatum.radius());
-
-	return (TeCoord2D(col*resx,-(lin*resy)));
-}
-
-/************************************************************************
-		SATELLITE PROJECTION TO GEODETIC COORDINATES
-************************************************************************/
-TeCoord2D
-TeSatelliteProjection::PC2LL(TeCoord2D& ptpc)
-{
-	double	dl, dp, x, y, z, x1, x2, equad, n, d, sn,
-		a, b, c,  Rd2, Rm,Rm2, Rs2,v,ptpcx,ptpcy,
-		yla,xlo,resx,resy;
-
-	resx = tan(SPrj) * (SPrs - GPdatum.radius());
-	resy = tan(SPri) * (SPrs - GPdatum.radius());
-	ptpcx = ptpc.x()/resx;
-	ptpcy = -ptpc.y()/resy;
-
-	// Axis rotation correction due yaw angle
-	ptpcx = ptpcx*cos(SPyaw) + ptpcy*sin(SPyaw);
-	ptpcy = ptpcy*cos(SPyaw) - ptpcx*sin(SPyaw);
-
-	// Field of view angles
-	if (SPscn == 0.) sn =  1.0;
-	else 		 sn = -1.0;
-	dl = - sn * ((ptpcy - SPis) * SPri);
-	dp =   sn * ((ptpcx - SPjs) * SPrj);
-
-	// Cartesian coordinates
-	Rd2 = GPdatum.radius() * GPdatum.radius() ;
-	Rm  = GPdatum.radius() * (1 - GPdatum.flattening());
-	Rm2 = Rm * Rm ;
-	Rs2 = SPrs * SPrs;
-
-	v = (tan(dp)*tan(dp)*cos(dp)*cos(dp)*Rm2)+(tan(dl)*tan(dl)*Rd2);
-	a = cos(dp)*cos(dp)*Rm2 + v;      
-	b = -2.*SPrs*v;
-	c = Rs2*v-Rd2*Rm2*cos(dp)*cos(dp);
-
-	// Equation Resolution a*x**2+b*x+c=0 
-	v = (b*b) - (4.*a*c);
-	if (v < 0)
-	{
-		xlo = TeMAXFLOAT;
-		yla = TeMAXFLOAT;
-		return (TeCoord2D(xlo,yla));
-	}
-
-   	x1 = (-b + sqrt(v)) / (2.*a);
-	x2 = (-b - sqrt(v)) / (2.*a);
-
-	if ( x1 >= x2)  x = x1;
-	else		  x = x2;
-
-	z = (SPrs - x) * tan(dl) / cos(dp);
-	y = (SPrs - x) * tan(dp);
-
-	// Geodetic coordinates
-	equad 	= 2. * GPdatum.flattening() - GPdatum.flattening() * GPdatum.flattening();
-
-	double aux = SPrs * dl / GPdatum.radius();
-	if (aux > 1.0) aux = 1.0;
-	if (aux < -1.0) aux = -1.0;
-
-	yla = asin(aux);
-	
-	do
-	{
-		n= GPdatum.radius()/sqrt((double)1-equad*pow(sin(yla),(double)2));
-		yla = atan((z + n*equad*sin(yla))/sqrt(x*x + y*y));
-		d = GPdatum.radius()/sqrt((double)1-equad*pow(sin(yla),(double)2)) - n;
-	}
-	while (fabs(d) > 0.001);
-
-	xlo = atan(y/x) + GPlon0;
-	yla = yla + GPlat0;
-
-	return (TeCoord2D(xlo,yla));
-}
-
-TeProjectionParams 
-TeSatelliteProjection::params () const
-{
-	TeProjectionParams par;
-	par = TeProjection::params();
-
-	par.pri  = SPri;
-	par.prj  = SPrj;
-	par.pis  = SPis;
-	par.pjs  = SPjs;
-	par.prs  = SPrs;
-	par.pscn = SPscn;
-	par.pyaw = SPyaw;
-
-return par;
-}
-
-TeDatum 
-TeGetDatumFromProj4(const string& proj4)
-{
-	unsigned int pos;
-    string attribute;
-    string value;
-	double dx, dy, dz;
-	dx = dy = dz = 0.0;
-
-	TeDatum dat;
-	dat.name("UserDefined");
-	for(unsigned int i = 0; i < proj4.size(); i++)
-    {
-        for( pos = i; i != proj4.size() && proj4[i] != '=';i++);
-
-        attribute = proj4.substr(pos+1, i-pos-1);
-
-        for(pos = i; i != proj4.size() && proj4[i] != ' ';i++);
-
-        if(proj4[i] == ' ') value = proj4.substr(pos+1, i-pos-1);
-        else                value = proj4.substr(pos+1, i-pos);
-		
-		double b;
-		// Datum parameters
-        if(attribute == "R")	// radius for a spherical ellipsoid
-		{
-			dat = TeDatum("Spherical",atof(value.c_str()));
-			return dat;
-		}
-		else if(attribute == "a")   // Earth equatorial radius
-			dat.radius(atof(value.c_str()));
-		else if (attribute == "b")
-			b = atof(value.c_str());
-	    else if(attribute == "f")	// Earth flattening
-			dat.flattening(atof(value.c_str()));
-	    else if(attribute == "rf")	// Earth  reverse flattening (f = 1/rf)
-			dat.flattening(1/atof(value.c_str()));
-		else if (attribute == "es") // eccentricity squared (f=1-(1-es)^0.5) 
-			dat.flattening(1-sqrt(1-atof(value.c_str())));
-		else if (attribute == "e")	// eccentricity (f=1-(1-es^2)^0.5)
-			dat.flattening(1-sqrt(1-pow(atof(value.c_str()),2)));
-		else if (attribute == "ellps")
-			dat.name(value);
-		else if (attribute == "towgs84")
-		{
-			vector<string> deltas;
-			TeSplitString(value, ",", deltas);
-			
-			if (deltas.size()>=3)
-			{
-				dx = atof(deltas[0].c_str());
-				dy = atof(deltas[1].c_str());
-				dz = atof(deltas[2].c_str());
-			}
-		}
-	}
-	if ( dx==0.0 && dy== 0 && dz == 0.0)
-	{
-		dat = TeDatum("WGS84",6378137,0.003352811,66.87,-4.37,38.52);
-	}
-	// this is a SAD69
-	else if (dx == -66.87 && dy == 4.37 &&  dz == -38.52)
-	{
-		dat = TeDatum("SAD69",6378160,0.003352892,0.0,0.0,0.0);
-	}
-	else
-	{
-		dat.dx_ = dx;
-		dat.dy_ = dy;
-		dat.dz_ = dz;
-	}
-	return dat;
-}
-
-TeProjection* TeGetTeProjectionFromSProj(const string& proj4)
-{
-	// a map from sproj4 projections to TerraLib projections
-	map<string,string> sprojToTeProj;
-	sprojToTeProj["aea"] = "Albers";
-	sprojToTeProj["latlong"] = "LatLong";
-	sprojToTeProj["lcc"] = "LambertConformal";
-	sprojToTeProj["merc"] = "Mercator";
-	sprojToTeProj["mill"] = "Miller";
-	sprojToTeProj["utm"] = "UTM";
-	sprojToTeProj["sinu"] = "Sinusoidal";
-	sprojToTeProj["poly"] = "Polyconic";
-	sprojToTeProj["eqc"] = "CylindricalEquidistant";
-	sprojToTeProj["ups"] = "PolarStereographic";
-	sprojToTeProj["sat"] = "Satellite"; //FAMI
-
-    unsigned int pos;
-    string attribute;
-    string value;
-
-  	TeProjectionParams par;
-	par.hemisphere = TeNORTH_HEM;
-	par.offx = 500000;
-	par.offy = 0;
-	par.units = "";
-    for(unsigned int i = 0; i < proj4.size(); i++)
-    {
-        for( pos = i; i != proj4.size() && proj4[i] != '=';i++);
-
-        attribute = proj4.substr(pos+1, i-pos-1);
-
-        for(pos = i; i != proj4.size() && proj4[i] != ' ';i++);
-
-        if(proj4[i] == ' ') value = proj4.substr(pos+1, i-pos-1);
-        else                value = proj4.substr(pos+1, i-pos);
-
-        if(attribute == "proj")
-		{
-			map<string,string>::iterator it = sprojToTeProj.find(value);
-			if (it != sprojToTeProj.end())
-				par.name = sprojToTeProj[value];
-			else
-				par.name = "NoProjection"; 
-		}
-	// Currently this routine understands the following parameters from
-	// a sproj description: lon_0, lat_0, lat_1, lat_2, k, zone, x_0, y_0
-
-        else if(attribute == "lon_0") 
-			par.lon0 = atof(value.c_str())*TeCDR;
-        else if(attribute == "lat_0") 
-			par.lat0 = atof(value.c_str())*TeCDR;
-        else if(attribute == "lat_1") 
-			par.stlat1 = atof(value.c_str())*TeCDR;
-        else if(attribute == "lat_2") 
-			par.stlat2 = atof(value.c_str())*TeCDR;
-        else if(attribute == "k") 
-			par.scale = atof(value.c_str());
-        else if(attribute == "zone") 
-			par.lon0 = (-183 + 6*(atoi(value.c_str()))*TeCDR);
-		else if (attribute == "south") 
-		{
-			par.hemisphere = TeSOUTH_HEM;
-			par.offy = 10000000;
-		}
-		else if(attribute == "x_0") 
-			par.offx = atof(value.c_str());
- 		else if(attribute == "y_0") 
-			par.offy = atof(value.c_str());
-		else if (attribute == "units")
-			par.units = value;
-// TODO: sproj4 also allowd the selection of standard, predefined
-// ellipsoid figures using the option +ellps=acronym. But we are not decoding 
-// them yet because of our problem with the shiftings from SAD69
-    }
-	par.datum = TeGetDatumFromProj4(proj4);
-	return TeProjectionFactory::make(par);
-}
-
-string TeGetSProjFromTeProjection(TeProjection* teproj)
-{
-	map<string,string> teProjToSProj;
-	teProjToSProj["Albers"] = "aea";
-	teProjToSProj["LatLong"] = "latlong";
-	teProjToSProj["LambertConformal"] = "lcc";
-	teProjToSProj["Mercator"] = "merc";
-	teProjToSProj["Miller"] = "mill";
-	teProjToSProj["UTM"] = "utm";
-	teProjToSProj["Sinusoidal"] = "sinu";
-	teProjToSProj["Polyconic"] = "poly";
-	teProjToSProj["CylindricalEquidistant"] = "eqc";
-	teProjToSProj["PolarStereographic"] = "ups";
-	teProjToSProj["Satellite"] = "sat"; //FAMI
-
-    string sresp = "+proj=";
-	map<string,string>::iterator it = teProjToSProj.find(teproj->name());
-	if (it == teProjToSProj.end())
-	{
-		sresp += "noprojection";
-		return sresp;
-	}
-	else
-		sresp += it->second;
-
-	TeProjInfo pjInfo = TeProjectionInfo(teproj->name());
-	if ( pjInfo.hasLon0 )
-		sresp += " +lon_0=" + Te2String(teproj->lon0()*TeCRD,6);
-
-	if ( pjInfo.hasLat0 )
-		sresp += " +lat_0=" + Te2String(teproj->lat0()*TeCRD,6);
-
-	if ( pjInfo.hasStlat1 )
-		sresp += " +lat_1=" + Te2String(teproj->stLat1()*TeCRD,6);
-	
-	if ( pjInfo.hasStlat2 )
-		sresp += " +lat_2=" +Te2String(teproj->stLat2()*TeCRD,6);
-
-	if ( pjInfo.hasOffx )
-		sresp += " +x_0=" + Te2String(teproj->offX(),6);
-
-	if ( pjInfo.hasOffy )
-		sresp += " +y_0=" + Te2String(teproj->offY(),6);
-	
-	if ( pjInfo.hasScale )
-		sresp += " +k="  + Te2String(teproj->scale(),6);
-
-	string datumD = teproj->datum().getProj4Description();
-	if (!datumD.empty())
-		sresp += datumD;
-	return sresp;
-}
-
-string 
-TeGetWKTFromTeProjection(TeProjection* teproj)
-{
-	string wkt = "";
-	if (!teproj)
-		return wkt;
-
-	string wktDatum = teproj->datum().getWKTDescription();
-	if (teproj->name() == "LatLong")
-		return wktDatum;
-
-	map<string,string> teProjToWKT;
-	teProjToWKT["Albers"] = "Albers_Conic_Equal_Area";
-	teProjToWKT["LambertConformal"] = "Lambert_Conformal_Conic_1SP";
-	teProjToWKT["Mercator"] = "Mercator_1SP";
-	teProjToWKT["Miller"] = "Miller_Cylindrical";
-	teProjToWKT["UTM"] = "Transverse_Mercator";
-	teProjToWKT["Sinusoidal"] = "Sinusoidal";
-	teProjToWKT["Polyconic"] = "Polyconic";
-	teProjToWKT["CylindricalEquidistant"] = "Equirectangular";
-	teProjToWKT["PolarStereographic"] = "Polar_Stereographic";
-	teProjToWKT["Satellite"] = "Satellite"; //FAMI
-	teProjToWKT["NoProjection"] = "Unknown";
-
-	wkt = "PROJCS[\"" + teproj->name() + "\",";
-	wkt += wktDatum;
-	wkt += ",PROJECTION[\"" + teProjToWKT[teproj->name()] + "\"]";
-
-	TeProjInfo pjInfo = TeProjectionInfo(teproj->name());
-	if (pjInfo.hasLon0)
-		wkt +=",PARAMETER[\"central_meridian\","+ Te2String(teproj->lon0()*TeCRD,6)+"]";
-
-	if (pjInfo.hasLat0)
-		wkt +=",PARAMETER[\"latitude_of_origin\","+ Te2String(teproj->lat0()*TeCRD,6)+"]";
-
-	if (pjInfo.hasStlat1)
-		wkt +=",PARAMETER[\"standard_parallel_1\","+ Te2String(teproj->stLat1()*TeCRD,6)+"]";
-	
-	if (pjInfo.hasStlat2)
-		wkt +=",PARAMETER[\"standard_parallel_2\","+ Te2String(teproj->stLat2()*TeCRD,6)+"]";
-
-	if (pjInfo.hasOffx)
-		wkt +=",PARAMETER[\"false_easting\","+ Te2String(teproj->offX(),6)+"]";
-
-	if (pjInfo.hasOffy)
-		wkt +=",PARAMETER[\"false_northing\","+ Te2String(teproj->offY(),6)+"]";
-
-	if (pjInfo.hasScale)
-		wkt +=",PARAMETER[\"scale_factor\","+ Te2String(teproj->scale(),6)+"]";
-	
-	wkt += ",UNIT[\"meter\",1]]";
-	return wkt;
-}
-
-bool tokenizeWKT(char** wkt, vector<string>& tokens)
-{
-	const char *pszInput =  *wkt;
-	int isInQuote = false;
-	
-	string token = "";
-	int  sizeToken = 0;
-	while (*pszInput != '\0')
-	{
-		if (*pszInput == '"')
-		{
-			isInQuote = !isInQuote;
-		}
-		else if (!isInQuote && 
-				(*pszInput == '[' || *pszInput == ']' || *pszInput == ',' || 
-					*pszInput == '(' || *pszInput == ')' ))
-		{
-			break;
-		}
-		else if (!isInQuote && 
-				(*pszInput == ' ' || *pszInput == '\t' || 
-				*pszInput == 10 || *pszInput == 13))
-		{
-		/* just skip over whitespace */
-		} 
-		else
-		{
-			token += *pszInput;
-			++sizeToken;
-		}
-		pszInput++;
-	}
-	if (*pszInput == '\0')
-		return true;
-		
-	tokens.push_back(token);
-	
-	bool result;  // read sublist
-	if( *pszInput == '[' || *pszInput == '(' )
-	{
-		do
-		{
-			pszInput++; // Skip bracket or comma.
-			result = tokenizeWKT((char **) &pszInput, tokens);
-			if (!result )
-				return result;          
-		}while (*pszInput == ',');
-	
-		if (*pszInput != ')' && *pszInput != ']')
-			return result;
-		pszInput++;
-	}
-	*wkt = (char *) pszInput;
-	return true;
-}
-
-
-
-TeProjection* 
-TeGetTeProjectionFromWKT(const string& wkt)
-{
-	map<string,string> wktToTeProj;
-	wktToTeProj["Albers_Conic_Equal_Area"] = "Albers";
-	wktToTeProj["Lambert_Conformal_Conic_1SP"] = "LambertConformal";
-	wktToTeProj["Mercator_1SP"] = "Mercator";
-	wktToTeProj["Miller_Cylindrical"] = "Miller";
-	wktToTeProj["Transverse_Mercator"] = "UTM";
-	wktToTeProj["Sinusoidal"] = "Sinusoidal";
-	wktToTeProj["Polyconic"] = "Polyconic";
-	wktToTeProj["Equirectangular"] = "CylindricalEquidistant";
-	wktToTeProj["Polar_Stereographic"] = "PolarStereographic";
-	wktToTeProj["Satellite"] = "Satellite"; //FAMI
-
-	TeDatum dat = TeDatumFactory::makeFromWKT(wkt);
-	vector<string> tokens;
-	char* wktchar = new char[wkt.size()];
-	strcpy(wktchar,wkt.c_str());
-	bool res = tokenizeWKT((char **) &wktchar, tokens);
-	if (!res)
-		return 0;
-
-	// geographic coordinates 
-
-	TeProjectionParams par;
-	unsigned int i = 1;
-	bool isProjected = false;
-	if (tokens[0] == "GEOGCS")
-	{
-		isProjected = false;
-		par.name = "LatLong";
-	}
-	else if (tokens[0] == "PROJCS")
-	{
-		isProjected = true;
-	}
-	else
-		return 0;
-	par.datum = dat;
-	if (!isProjected)
-		return TeProjectionFactory::make(par);
-
-	while (i<tokens.size() && tokens[i] != "PROJECTION")
-		++i;
-	if (i== tokens.size())
-		return 0;
-	map<string,string>::iterator it = wktToTeProj.find(tokens[++i]);
-	if (it != wktToTeProj.end())
-		par.name = it->second;
-	else
-		return 0;
-	while (tokens[++i] == "PARAMETER")
-	{
-		++i;
-		if (TeStringCompare(tokens[i],"latitude_of_origin",false))
-			par.lat0 = atof(tokens[++i].c_str())*TeCDR;
-		else if (TeStringCompare(tokens[i],"central_meridian",false))
-			par.lon0 = atof(tokens[++i].c_str())*TeCDR;
- 		else if (TeStringCompare(tokens[i],"standard_parallel_1",false))
-			par.stlat1 = atof(tokens[++i].c_str())*TeCDR;
- 		else if (TeStringCompare(tokens[i],"standard_parallel_2",false))
-			par.stlat2 = atof(tokens[++i].c_str())*TeCDR;
- 		else if (TeStringCompare(tokens[i],"false_easting",false))
-			par.offx = atof(tokens[++i].c_str());
- 		else if (TeStringCompare(tokens[i],"false_northing",false))
-		{
-			par.offy = atof(tokens[++i].c_str());
-			if(par.offy == 0.0)	par.hemisphere=TeNORTH_HEM;
-			else				par.hemisphere=TeSOUTH_HEM;
-		}
- 		else if (TeStringCompare(tokens[i],"scale_factor",false))
-			par.scale = atof(tokens[++i].c_str());
-	}
-	return TeProjectionFactory::make(par);
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeProjection.h"
+#include "TeException.h"
+#include "TeUtils.h"
+#include <cstdlib>
+#include <stdio.h>
+#include <iostream>
+#include <cstring>
+
+bool tokenizeWKT(char** wkt, vector<string>& tokens);
+
+TeDatum  TeGetDatumFromWKT(const string& wkt);
+
+TeDatum  TeGetDatumFromProj4(const string& proj4);
+
+//=========================================================
+//
+//  PROJECTION INFORMATION 
+//
+//  Auxiliary functions which indicate the information
+//  associated to a projection
+//
+//  Used for reading and writing information
+//
+//==========================================================
+
+
+
+// Name						Units  Long  Lat  Par1  Par2  Sca  Eas  Nor 
+const char* teProjInfo[]= {
+"Albers",					"1",  "1",  "1", "1",  "1",  "0", "1", "1", 
+"LatLong",					"1",  "0",  "0", "0",  "0",  "0", "0", "0",   
+"LambertConformal",			"1",  "1",  "1", "1",  "1",  "0", "1", "1", 
+"Mercator",					"1",  "1",  "1", "1",  "0",  "0", "1", "1", 
+"Miller",					"1",  "1",  "0", "0",  "0",  "0", "1", "1", 
+"UTM",						"1",  "1",  "0", "0",  "0",  "1", "1", "1", 
+"Polyconic",				"1",  "1",  "1", "0",  "0",  "0", "1", "1",
+"Sinusoidal",				"1",  "1",  "0", "0",  "0",  "0", "1", "1",
+"CylindricalEquidistant",	"1",  "1",  "0", "1",  "0",  "0", "1", "1",
+"PolarStereographic",		"1",  "1",  "0", "0",  "0",  "0", "1", "1",
+"Satellite",		        "1",  "1",  "1", "0",  "0",  "0", "1", "1",
+"NoProjection",				"1",  "0",  "0", "0",  "0",  "0", "0", "0"		
+};
+
+
+const char** TeGetProjInfo()
+{
+	return teProjInfo;
+}
+
+TeProjInfo
+TeProjectionInfo ( const string& projName  )
+{
+
+	TeProjInfoMap pjMap;
+	TeProjInfo pjInfo;
+
+	int k = 0;
+
+	for ( int i = 0; i < NUM_PROJ; i++ )
+	{
+		string name = teProjInfo [k++];
+			
+	    pjInfo.hasUnits  = atoi ( teProjInfo [k++] );
+	    pjInfo.hasLon0   = atoi ( teProjInfo [k++] );
+	    pjInfo.hasLat0   = atoi ( teProjInfo [k++] );
+	    pjInfo.hasStlat1 = atoi ( teProjInfo [k++] );
+		pjInfo.hasStlat2 = atoi ( teProjInfo [k++] );
+		pjInfo.hasScale  = atoi ( teProjInfo [k++] );
+		pjInfo.hasOffx   = atoi ( teProjInfo [k++] );
+	    pjInfo.hasOffy   = atoi ( teProjInfo [k++] );
+
+		pjMap [ name ] = pjInfo;
+	}
+
+
+	TeProjInfoMap::iterator it = pjMap.find ( projName );
+
+	if ( it == pjMap.end() )
+		throw TeException ( PROJECTION_NOT_AVAILABLE );
+
+return (*it).second;
+}
+
+//========================================================
+//
+// PROJECTION FACTORY
+//
+// =======================================================
+
+TeProjection*
+TeProjectionFactory::make ( const TeProjectionParams& par )
+{
+	string punits;
+	if (par.units.empty())
+		punits = "Meters";
+	else
+		punits = par.units;
+
+	if ( par.name == "UTM" )
+		return new TeUtm ( par.datum, par.lon0, par.lat0,
+		par.offx, par.offy, punits, par.scale, par.hemisphere );
+
+	if ( par.name == "LambertConformal")
+		return new TeLambertConformal ( par.datum, par.lon0, par.lat0,
+		par.offx, par.offy, par.stlat1, par.stlat2, punits );
+	
+	if ( par.name == "Albers" )
+		return new TeAlbers ( par.datum, par.lon0, par.lat0,
+		par.offx, par.offy, par.stlat1, par.stlat2, punits );
+
+	if ( par.name == "Miller")
+		return new TeMiller ( par.datum, par.lon0, par.offx, par.offy, punits );
+
+	if ( par.name == "LatLong" )
+	{
+		if (par.units.empty())
+			punits = "DecimalDegrees";
+		else
+			punits = par.units;
+		return new TeLatLong ( par.datum, punits );
+	}
+
+	if ( par.name == "Polyconic" )
+		return new TePolyconic ( par.datum, par.lon0, par.lat0, par.offx, par.offy, punits); 
+
+	if ( par.name == "Mercator" )
+		return new TeMercator ( par.datum, par.lon0, par.lat0, 
+		par.offx, par.offy, par.stlat1, punits );
+
+	if ( par.name == "Sinusoidal")
+		return new TeSinusoidal ( par.datum, par.lon0, par.offx, par.offy, punits );
+
+	if ( par.name == "CylindricalEquidistant")
+		return new TeCylindricalEquidistant ( par.datum, par.lon0, par.offx, par.offy, par.stlat1, punits);
+
+	if ( par.name == "PolarStereographic")
+		return new TePolarStereographic ( par.datum, par.lon0, par.offx, par.offy,punits, par.hemisphere );
+
+	if ( par.name == "Satellite")
+		return new TeSatelliteProjection ( par.datum, par.offx, par.offy, par.pri, par.prj, par.pis, par.pjs, par.lat0, par.lon0, par.prs, par.pscn, par.pyaw);
+
+	if ( par.name == "NoProjection")
+		return new TeNoProjection(par.datum,punits);	
+	return 0;
+}
+  
+TeProjection*
+TeProjectionFactory::make (int epsgcode)
+{
+	// geographic
+	int datumcode;
+	if (epsgcode >= 4208 && epsgcode <=4979)
+	{ 
+		if (epsgcode == 4618)
+			datumcode = 6618;
+		else if (epsgcode == 4979)
+		   datumcode = 6326;
+		 else if (epsgcode == 4225)
+		   datumcode = 6225;
+		 else if (epsgcode == 4267)
+		   datumcode = 6609;
+		 else if (epsgcode == 4269)
+		   datumcode = 6152;
+		else if (epsgcode == 4208)	   
+		   datumcode = 6208;
+		/*else if (epsgcode == indian)			   
+		   datumcode = 6240;*/
+		else if (epsgcode == 4240)
+		   datumcode = 6240;
+		else if (epsgcode == 4224)
+		   datumcode = 6224;		   
+		/*else if (datum.name() == "Indian")
+		{
+			epsgcode = 4240;
+		} 
+		else if (datum.name() == "Astro-Chua")
+		{
+			epsgcode = 4224;
+		}*/
+		TeDatum dat = TeDatumFactory::makeFromEPSGCode(Te2String(epsgcode+2000));
+		return new TeLatLong (dat,"DecimalDegrees");
+	}
+
+	TeProjectionParams par;	
+	
+	// ---- UTM
+	if (epsgcode >=29168 && epsgcode <= 29172)
+	{
+		par.name = "UTM";
+		par.hemisphere = TeNORTH_HEM;
+		par.datum = TeDatumFactory::make("SAD69");
+        par.lat0 = 0;
+		par.offx = 500000.0;
+		par.offy = 0;
+		par.scale = 0.999600;
+		par.lon0 = (-183. + 6.*(epsgcode-29150+1))*TeCDR; 
+	}
+	else if (epsgcode >=29187 && epsgcode <= 29195)
+	{
+		par.name = "UTM";
+		par.hemisphere = TeSOUTH_HEM;
+		par.datum = TeDatumFactory::make("SAD69");
+        par.lat0 = 0;
+		par.offx = 500000.0;
+		par.offy = 10000000.0;
+		par.scale = 0.999600;		
+		par.lon0 = (-183. + 6.*(epsgcode-29160+1))*TeCDR; 
+	}
+	else if (epsgcode >32600 && epsgcode <= 32660)
+	{
+		par.name = "UTM";
+		par.hemisphere = TeNORTH_HEM;
+		par.datum = TeDatumFactory::make("WGS84");
+        par.lat0 = 0;
+		par.offx = 500000.0;
+		par.offy = 0;
+		par.scale = 0.999600;
+		par.lon0 = (-183. + 6.*(epsgcode-32600+1))*TeCDR; 
+	}
+	else if (epsgcode >32700 && epsgcode <= 32760)
+	{
+		par.name = "UTM";
+		par.hemisphere = TeSOUTH_HEM;
+		par.datum = TeDatumFactory::make("WGS84");
+        par.lat0 = 0;
+		par.offx = 500000.0;
+		par.offy = 10000000.0;
+		par.scale = 0.999600;
+		par.lon0 = (-183. + 6.*(epsgcode-32700+1))*TeCDR; 
+	}	
+	else if (epsgcode >22520 && epsgcode <= 22525)
+	{
+		par.name = "UTM";
+		par.hemisphere = TeSOUTH_HEM;
+		par.datum = TeDatumFactory::make("CorregoAlegre");
+        par.lat0 = 0;
+		par.offx = 500000.0;
+		par.offy = 10000000.0;
+		par.scale = 0.999600;
+		par.lon0 = (-183. + 6.*(epsgcode-22520+1))*TeCDR; 
+	}
+	else if (epsgcode >26700 && epsgcode <= 26722)
+	{
+		par.name = "UTM";
+		par.hemisphere = TeNORTH_HEM;
+		par.datum = TeDatumFactory::make("NAD27");
+        par.lat0 = 0;
+		par.offx = 500000.0;
+		par.offy = 0.0;
+		par.scale = 0.999600;
+		par.lon0 = (-183. + 6.*(epsgcode-26700+1))*TeCDR; 
+	}
+	else if (epsgcode >26900 && epsgcode <= 26923)
+	{
+		par.name = "UTM";
+		par.hemisphere = TeNORTH_HEM;
+		par.datum = TeDatumFactory::make("NAD83");
+        par.lat0 = 0;
+		par.offx = 500000.0;
+		par.offy = 0.0;
+		par.scale = 0.999600;
+		par.lon0 = (-183. + 6.*(epsgcode-26900+1))*TeCDR; 
+	}
+	else if (epsgcode >=20822 && epsgcode <= 20825)
+	{
+		par.name = "UTM";
+		par.hemisphere = TeSOUTH_HEM;
+		par.datum = TeDatumFactory::make("Aratu");
+        par.lat0 = 0;
+		par.offx = 500000.0;
+		par.offy = 10000000.0;
+		par.scale = 0.999600;
+		par.lon0 = (-183. + 6.*(epsgcode-20800+1))*TeCDR; 
+	}
+	// ---- UTM
+	else if (epsgcode == 29101)
+	{
+		par.name = "Polyconic";
+		par.hemisphere = TeSOUTH_HEM;
+		par.datum = TeDatumFactory::make("SAD69");
+        par.lat0 = 0;
+		par.offx = 0.0;
+		par.offy = 0.0;
+		par.scale = 1;
+		par.lon0 = -54.0*TeCDR; 
+	}	
+	else if (epsgcode == 9823)
+	{	
+		par.name = "CylindricalEquidistant";
+		par.hemisphere = TeSOUTH_HEM;
+		par.datum = TeDatumFactory::make("Spherical");
+        par.lat0 = 0;
+		par.offx = 0.0;
+		par.offy = 0.0;
+		par.scale = 1;
+		par.lon0 = 0*TeCDR; 	
+	
+	}
+	else
+	{
+		par.name == "NoProjection";
+	}
+	return TeProjectionFactory::make(par);	
+
+}
+
+TeProjectionParams 
+TeProjection::params () const
+{
+	TeProjectionParams par;
+	
+	par.name  = GPname;
+	par.datum = GPdatum;
+	par.lon0  = GPlon0;
+	par.lat0  = GPlat0;
+	par.offx  = GPoffx;
+	par.offy  = GPoffy;
+	par.stlat1 = GPstlat1;
+	par.stlat2 = GPstlat2;
+	par.units  = GPunits;
+	par.scale  = GPscale;
+	par.hemisphere =  GPhemisphere;
+
+return par;
+}
+
+
+TeProjection::TeProjection(const TeProjection& rhs)
+{
+	GPname  = rhs.GPname;
+	GPdatum = rhs.GPdatum;
+	GPlon0  = rhs.GPlon0;
+	GPlat0  = rhs.GPlat0;
+	GPoffx  = rhs.GPoffx;
+	GPoffy  = rhs.GPoffy;
+	GPstlat1 = rhs.GPstlat1;
+	GPstlat2 = rhs.GPstlat2;
+	GPunits  = rhs.GPunits;
+	GPscale  = rhs.GPscale;
+	GPhemisphere = rhs.GPhemisphere;
+	GPepsgCode = rhs.GPepsgCode;
+}
+
+TeProjection& 
+TeProjection::operator=(const TeProjection& rhs)
+{
+	if ( this != &rhs )
+	{
+		GPname  = rhs.GPname;
+		GPdatum = rhs.GPdatum;
+		GPlon0  = rhs.GPlon0;
+		GPlat0  = rhs.GPlat0;
+		GPoffx  = rhs.GPoffx;
+		GPoffy  = rhs.GPoffy;
+		GPstlat1 = rhs.GPstlat1;
+		GPstlat2 = rhs.GPstlat2;
+		GPunits  = rhs.GPunits;
+		GPscale  = rhs.GPscale;
+		GPhemisphere = rhs.GPhemisphere;
+		GPepsgCode = rhs.GPepsgCode;
+	}
+	return *this;
+}
+
+
+
+/*******************************************************************
+	CHECKS IF A PROJECTION INSTANCE IS EQUAL TO ANOTHER
+********************************************************************/
+
+bool
+TeProjection::operator== (const TeProjection& proj)
+{
+	if (GPname == "NoProjection" && proj.GPname == "NoProjection")
+		return true;
+	if (GPname  != proj.GPname)
+		return false;
+	if (!(GPdatum==proj.GPdatum))
+		return false;
+	if (!TeFPEquals(GPlon0, proj.GPlon0, 0.0000000001))
+		return false;
+	if (!TeFPEquals(GPlat0, proj.GPlat0, 0.0000000001))
+		return false;
+	if (!TeFPEquals(GPoffx,proj.GPoffx,0.001))
+		return false;
+	if (!TeFPEquals(GPoffy,proj.GPoffy,0.001))
+		return false;
+	if (!TeFPEquals(GPstlat1,proj.GPstlat1,0.0000000001))
+		return false;
+	if (!TeFPEquals(GPstlat2,proj.GPstlat2,0.0000000001))
+		return false;
+	if (GPhemisphere!=proj.GPhemisphere)
+		return false;
+	if (GPunits != proj.GPunits)
+		return false;
+	if (!TeFPEquals(GPscale,proj.GPscale, 0.0000000001))
+		return false;
+
+	return true;
+}
+
+/*******************************************************************
+	PRINTS INFORMATION ABOUT A PROJECTION
+********************************************************************/
+
+
+void
+TeProjection::print ( FILE* file_ )
+{
+	TeProjInfo pjInfo = TeProjectionInfo ( GPname );
+
+	fprintf(file_,"%s\n", "// Projection Information" );
+	fprintf ( file_, "%s %s \n", "PROJECTION", GPname.c_str() );
+	fprintf ( file_, "%s %s \n", "DATUM", GPdatum.name().c_str() );
+	fprintf ( file_, "%s %s \n", "UNITS", GPunits.c_str() );
+	
+	if ( pjInfo.hasLon0 )
+		fprintf ( file_, "%s %17.6f \n", "ORIGIN LONG", GPlon0 );
+
+	if ( pjInfo.hasLat0 )
+		fprintf ( file_, "%s %17.6f \n", "ORIGIN LAT", GPlat0 );
+
+	if ( pjInfo.hasOffx )
+		fprintf ( file_, "%s %17.6f \n", "FALSE EASTING", GPoffx );
+
+	if ( pjInfo.hasOffy )
+		fprintf ( file_, "%s %17.6f \n", "FALSE NORTHING", GPoffy );
+	
+	if ( pjInfo.hasStlat1 )
+		fprintf ( file_, "%s %17.6f \n", "FIRST STANDARD PARALEL", GPstlat1 );
+	
+	if ( pjInfo.hasStlat2 )
+		fprintf ( file_, "%s %17.6f \n", "SECOND STANDARD PARALEL", GPstlat2 );
+
+	if ( pjInfo.hasScale )
+		fprintf ( file_, "%s %17.6f \n", "SCALE", GPscale );
+
+	fprintf(file_,"%s\n", "// End of Projection Information" );
+}
+
+
+string
+TeProjection::describe ()
+{
+	string desc;
+	if (GPname == "NoProjection")
+	{
+		desc = "NoProjection";
+		return desc;
+	}
+	desc = GPname;
+	TeProjInfo pjInfo = TeProjectionInfo ( GPname );
+
+	desc =  GPunits;
+	if ( pjInfo.hasLon0 )
+		desc += "," + Te2String(GPlon0*TeCRD,6);
+
+	if ( pjInfo.hasLat0 )
+		desc += "," + Te2String(GPlat0*TeCRD,6);
+
+	if ( pjInfo.hasStlat1 )
+		desc += ", " + Te2String(GPstlat1*TeCRD,6);
+	
+	if ( pjInfo.hasStlat2 )
+		desc += "," + Te2String(GPstlat2*TeCRD,6);
+
+	if ( pjInfo.hasOffx )
+		desc += "," + Te2String(GPoffx,6);
+
+	if ( pjInfo.hasOffy )
+		desc += "," + Te2String(GPoffy,6);
+	
+	if ( pjInfo.hasScale )
+		desc += "," + Te2String(GPscale,6);
+
+	return desc;
+}
+
+
+bool decodifyDescription(const string& projDescription, TeProjectionParams& pars)
+{
+	vector<string> projDesc;
+	if (TeSplitString(projDescription, ",", projDesc) <= 0)
+		return false;
+	unsigned int npar = projDesc.size();
+	TeProjInfo pjInfo = TeProjectionInfo (projDesc[0]);
+	pars.name = projDesc[0];
+	if (npar > 1)
+		pars.units = projDesc[1];
+	else 
+		return true;
+
+	unsigned int nextp = 2;
+	if (pjInfo.hasLon0)
+	{
+		 if (nextp < npar)
+		 {
+			pars.lon0 = atof(projDesc[nextp].c_str()) * TeCDR;
+			nextp++;
+		 }
+		 else
+			 return false;
+	}
+
+	if (pjInfo.hasLat0)
+	{
+		 if (nextp < npar)
+		 {
+			pars.lat0 = atof(projDesc[nextp].c_str()) * TeCDR;
+			nextp++;
+		 }
+		 else
+			 return false;
+	}
+
+	if (pjInfo.hasStlat1)
+	{
+		 if (nextp < npar)
+		 {
+			pars.stlat1 = atof(projDesc[nextp].c_str()) * TeCDR;
+			nextp++;
+		 }
+		 else
+			 return false;
+	}
+
+	if (pjInfo.hasStlat2)
+	{
+		 if (nextp < npar)
+		 {
+			pars.stlat2 = atof(projDesc[nextp].c_str()) * TeCDR;
+			nextp++;
+		 }
+		 else
+			 return false;
+	}
+
+	if (pjInfo.hasOffx)
+	{
+		 if (nextp < npar)
+		 {
+			pars.offx = atof(projDesc[nextp].c_str());
+			nextp++;
+		 }
+		 else
+			 return false;
+	}
+
+	if (pjInfo.hasOffy)
+	{
+		 if (nextp < npar)
+		 {
+			pars.offy = atof(projDesc[nextp].c_str());
+			nextp++;
+		 }
+		 else
+			 return false;
+	}
+	
+	if (pjInfo.hasScale)
+	{
+		 if (nextp < npar)
+		 {
+			pars.scale = atof(projDesc[nextp].c_str());
+			nextp++;
+		 }
+		 else
+			 return false;
+	}
+	return true;
+}
+
+/********************************************************************
+		Planimetric datum transformation 
+********************************************************************/
+void
+TeProjection :: ChangeLL (double &lon1, double &lat1)		
+{
+	double 	equad1,	// Squared eccentricity - datum 1
+			equad2,	// Squared eccentricity - datum 2
+			n1,		// Great normal of ellipsoid - datum 1
+			n2,		// Great normal od ellipsoid - datum 2
+			x1,		// Geocentric cartesian coordinates - datum 1 
+			y1,
+			z1,
+			x2,		// Geocentric cartesian coordinates - datum 2
+			y2,
+			z2,
+			d,lat2,		// Ancillary variable
+			lon2;
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+
+ 	if( GPdestination->GPdatum.radius() == 0.) return;
+
+	int	flt1 = (int)(Pflt*1000000000.);
+	int	flt2 = (int)(GPdestination->GPdatum.flattening()*1000000000.);
+	if (Prd == GPdestination->GPdatum.radius() && flt1==flt2)
+		return;
+
+// Geocentric cartesian coordinates calculation - datum 1
+	equad1 = 2.*Pflt;
+	equad1 -= Pflt*Pflt;
+	double a1,a2,a3;
+	a1 = sin(lat1);
+	a1 *= a1;
+	a1 *= equad1;
+	a2 = 1-a1;
+	n1 = Prd/sqrt(a2);
+	x1 = n1*cos(lat1)*cos(lon1);
+	y1 = n1*cos(lat1)*sin(lon1);
+	z1 = (n1*(1-equad1))*sin(lat1);
+
+// Geocentric cartesian coordinates calculation - datum 2
+	if (GPdatum.xShift() == TeMAXFLOAT || GPdestination->GPdatum.xShift() == TeMAXFLOAT)
+	{
+		x2 = x1; 
+		y2 = y1;
+		z2 = z1;
+	}
+	else
+	{	
+		x2 = x1 + (GPdatum.xShift() - GPdestination->GPdatum.xShift());
+		y2 = y1 + (GPdatum.yShift() - GPdestination->GPdatum.yShift());
+		z2 = z1 + (GPdatum.zShift() - GPdestination->GPdatum.zShift());
+	}
+
+// Geodetic coordinates calculation - datum 2
+	equad2 = 2.*GPdestination->GPdatum.flattening();
+	equad2 -= (GPdestination->GPdatum.flattening())*(GPdestination->GPdatum.flattening());
+	lat2 = lat1;
+	do
+	{
+		a1 = sin(lat2);
+		a1 *= a1;
+		a1 *= equad2;
+		a2 = 1-a1;
+		n2 = GPdestination->GPdatum.radius()/sqrt(a2);
+		a1 = equad2*sin(lat2);
+		a1 *= n2;
+		a1 += z2;
+		a2 = x2*x2;
+		a2 += (y2*y2);
+		a3 = sqrt(a2);
+		lat2 = atan2(a1,a3);
+		a1 = sin(lat2);
+		a1 *= a1;
+		a1 *= equad2;
+		a2 = 1-a1;
+		a3 = sqrt(a2);
+		d = (GPdestination->GPdatum.radius()/a3)-n2;
+	}
+	while (fabs(d) > 0.0000001);
+	lon2 = atan2(y2,x2);
+	lat1 = lat2;
+	lon1 = lon2;
+}
+
+
+TeUtm::TeUtm(const TeDatum& datum, double long0, double lat0, 
+		          double offx, double offy, 
+			        const string& units,
+			        double scale, TeHemisphere hemisphere):
+	  TeProjection( "UTM", datum, long0, lat0, offx, offy, 0., 0., units, scale, hemisphere)
+
+{
+  if (hemisphere == TeNORTH_HEM)
+		GPoffy = 0.;
+		
+  int zone = ((int)((long0*TeCRD+183.0)/6.0)-1);
+  if (datum.name() == "SAD69")
+  {
+    if (hemisphere == TeNORTH_HEM)
+      GPepsgCode = 29150+zone;
+    else
+      GPepsgCode = 29170+zone;
+  }
+  else if (datum.name() == "WGS84")
+  {
+    if (hemisphere == TeNORTH_HEM)
+      GPepsgCode = 32600+zone;
+    else
+      GPepsgCode = 32700+zone;
+  }
+  else if (datum.name() == "CorregoAlegre")
+  {
+    if (hemisphere == TeSOUTH_HEM)
+      GPepsgCode = 22500+zone;
+  }
+  else if (datum.name() == "NAD27")
+  {
+     if (hemisphere == TeNORTH_HEM)
+      GPepsgCode = 26700+zone;
+  }
+  else if (datum.name() == "NAD83")
+  {
+     if (hemisphere == TeNORTH_HEM)
+      GPepsgCode = 26900+zone;
+  }
+ else if (datum.name() == "Aratu")
+ {
+     if (hemisphere == TeSOUTH_HEM)
+      GPepsgCode = 20800+zone;
+  }  
+}
+
+/********************************************************************
+		GEODETIC TO UTM COORDINATES
+********************************************************************/
+TeCoord2D
+TeUtm :: LL2PC (const TeCoord2D& ptll)
+{
+
+	double	k0,		// Scale factor
+		equad,		// Squared eccentricity
+		n,		// Great normal of ellipsoid
+		elinquad,	// ancillary variables 
+		aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9,
+		aux10,aux11,aux12,aux13,t,c,ag,m,ptllx,ptlly;
+
+	double Pflt = GPdatum.flattening();
+	ptllx = ptll.x();
+	ptlly = ptll.y();
+	k0 = 1. - (1./2500.);
+	equad = 2.*Pflt;	
+	equad -= Pflt*Pflt;
+	elinquad = equad/(1. - equad);
+	aux1 = equad*equad;
+	aux2 = aux1*equad;
+	aux3 = sin((double)2*ptlly);
+	aux4 = sin((double)4*ptlly);
+	aux5 = sin((double)6*ptlly);
+
+	double a1, a2, a3;
+	a1 = equad/4.;
+	a2 = 3.*aux1/64.;
+	a3 = 5.*aux2/256.;
+	aux6 = (1-a1-a2-a3)*ptlly;
+
+	a1 = 3.*equad/8.;
+	a2 = 3.*aux1/32.;
+	a3 = 45.*aux2/1024.;
+	aux7 = (a1+a2+a3)*aux3;
+
+	a1 = 15.*aux1/256.;
+	a2 = 45.*aux2/1024.;
+	aux8 = (a1+a2)*aux4;
+
+	aux9 = 35.*aux2;
+	aux9 /= 3072.;
+	aux9 *= aux5;
+
+	a1 = sin(ptlly);	
+	a1 *= a1;		
+	a1 *= equad;		
+	n = GPdatum.radius()/sqrt((double)1-a1);
+
+
+	t = tan(ptlly);		
+	t *= t;			
+
+	c = cos(ptlly);		
+	c *= c;			
+	c *= elinquad;		
+	ag = (ptllx-GPlon0)*cos(ptlly);
+	m = GPdatum.radius()*(aux6 - aux7 + aux8 - aux9);
+
+
+	a1 = ag*ag*ag;
+	aux10 = (1.-t+c)*a1/6.;
+
+	a1 = 5.-(18.*t);
+	a2 = a1+t*t;
+	a1 = a2+72.*c;
+	a2 = a1-(58.*elinquad);
+	a1 = ag*ag*ag;		
+	a1 *= ag;		
+	a1 *= ag;		
+	aux11 = a2*a1/120.;	
+
+	a1 = 5.-t+9.*c;
+	a2 = 4.*c*c;
+	a3 = ag*ag;
+	a3 *= ag;
+	a3 *= ag;
+	aux12 = (a1+a2)*a3/24.;
+
+	a1 = 61.-(58.*t) ;
+	a2 = a1+(t*t);
+	a1 = a2+(600.*c);
+	a2 = a1-(330.*elinquad);
+	a1 = ag*ag*ag;		
+	a1 *= ag;		
+	a1 *= ag;		
+	a1 *= ag;		
+	aux13 = a2*a1/720.;	
+
+	ptllx = k0*n*(ag + aux10 + aux11);
+
+	a1 = ag*ag/2;
+	a2 = a1+aux12+aux13;
+	a3 = n*tan(ptlly);
+	a1 = a2*a3;
+	ptlly = k0*(m+a1);
+
+	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));
+}
+
+/********************************************************************
+		UTM TO GEODETIC COORDINATES
+********************************************************************/
+
+TeCoord2D
+TeUtm :: PC2LL (const TeCoord2D& ptpc)
+{
+	double  k0,             	// Scale factor
+		equad,			// Squared eccentricity
+		n1,			// Great normal of ellipsoid
+		elinquad,		// Ancillary variables
+		e1,aux1,aux2,aux3,aux4,aux5,m,mi,aux6,aux7,aux8,lat1,
+		c1,t1, quoc,r1,d,aux9,aux10,aux11,aux12,ptpcx,ptpcy;
+
+	double Prd  = GPdatum.radius();
+	double Pflt = GPdatum.flattening();
+	
+	ptpcx = ptpc.x()-GPoffx;
+	ptpcy = ptpc.y()-GPoffy;		
+
+	k0 = 1. - (1./2500.);
+	equad = 2.*Pflt;		
+	equad -= Pflt*Pflt;		
+	elinquad = equad/(1. - equad);
+
+	double a1,a2,a3;
+	a1 = sqrt((double)1-equad);
+	e1 = (1.-a1)/(1.+a1);
+
+	aux1 = equad*equad;
+	aux2 = aux1*equad;
+	aux3 = e1*e1;
+	aux4 = e1*aux3;
+	aux5 = aux4*e1;
+
+	m = ptpcy/k0;
+
+
+	a1 = 1.-(equad/4.);
+	a2 = 3.*(aux1/64.);
+	a3 = 5.*(aux2/256.);
+	mi = m/(Prd*(a1-a2-a3));
+
+
+	a1 = 3.*(e1/2.);
+	a2 = 27.*(aux4/32.);
+	a3 = sin((double)2*mi);
+	aux6 = (a1-a2)*a3;
+
+	a1 = 21.*(aux3/16.);
+	a2 = 55.*(aux5/32.);
+	a3 = sin((double)4*mi);
+	aux7 = (a1-a2)*a3;
+
+	a1 = 151.*(aux4/96.);
+	a2 = sin((double)6*mi);
+	aux8 = a1*a2;
+
+	lat1 = mi + aux6 + aux7 + aux8;
+
+	c1 = cos(lat1);			
+	c1 *= c1;			
+	c1 *= elinquad;			
+
+	t1 = tan(lat1);			
+	t1 *= t1;			
+
+	a1 = sin(lat1);			
+	a1 *= a1;			
+	a1 *= equad;			
+	a2 = 1.-a1;
+	n1 = Prd/sqrt(a2);
+
+	a1 = sin(lat1);
+	a1 *= a1;
+	a1 *= equad;
+	a2 = 1.-a1;
+	quoc = a2*a2*a2;
+
+	r1 = Prd*(1.-equad);
+	r1 /= sqrt(quoc);
+
+	d = ptpcx;
+	d /= (n1*k0);
+
+
+	a1 = 5.+(3.*t1);
+	a1 += (10.*c1);
+	a1 += (-4.*(c1*c1));
+	a1 += (-9.*elinquad);
+	a1 *= d;
+	a1 *= d;
+	a1 *= d;
+	a1 *= d;
+	aux9 = a1/24.;
+
+	a1 = 61.+(90.*t1);
+	a1 += (298.*c1);
+	a1 += (45.*(t1*t1));
+	a1 += (-252.*elinquad);
+	a1 += (-3.*c1*c1);
+	aux10 = d*d*d;			
+	aux10 *= d;			
+	aux10 *= d;			
+	aux10 *= d;			
+	aux10 *= a1;
+	aux10 /= 720.;
+
+	a1 = d*d*d;
+	a1 /= 6.;
+	a2 = 2.*t1;
+	a2 += (1.+c1);
+	aux11 = d-a2*a1;
+
+	a1 = 5.-(2.*c1);
+	a1 += (28.*t1);
+	a1 += (-3.*c1*c1);
+	a1 += (8.*elinquad);
+	a1 += (24.*t1*t1);
+	aux12 = d*d*d;			
+	aux12 *= d;			
+	aux12 *= d;			
+	aux12 *= a1;			
+	aux12 /= 120.;			
+
+	a1 = d*d/2.;
+	a1 += (- aux9 + aux10);
+	a2 = tan(lat1)/r1;
+	a2 *= n1;
+	ptpcy = lat1-a2*a1;
+
+	ptpcx= GPlon0 + (aux11 + aux12)/cos(lat1);
+
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return(TeCoord2D(ptpcx,ptpcy));
+}
+
+/********************************************************************
+		GEODETIC TO MERCATOR COORDINATES
+********************************************************************/
+TeCoord2D
+TeMercator :: LL2PC (const TeCoord2D& ptll)
+{
+	double	equad,			//Squared eccentricity
+		aux1,			// Ancillary variables
+		aux2,aux3,aux4,aux5,aux6,ptllx,ptlly;
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+
+	ptllx = ptll.x();		
+	ptlly = ptll.y();		
+
+	equad = 2.*Pflt;		
+	equad -= Pflt*Pflt;		
+	double	a1,a2,a3;		
+ 
+	a1 = tan(ptlly/(double)2);	
+	a2 = 1.+a1;			
+	a3 = 1.-a1;			
+	aux1 = a2/a3;			
+ 
+	a1 = equad*equad/4.;		
+	a1 += equad;			
+	a2 = equad*equad*equad/8.;	
+	a3 = sin(ptlly);		
+	aux2 = (a1+a2)*a3;		
+ 
+	a1 = equad*equad/12.;		
+	a2 = equad*equad*equad/16.;	
+	a3 = sin((double)3*ptlly);	
+	aux3 = (a1+a2)*a3;		
+ 
+	a1 = equad*equad*equad/80.;	
+	a2 = sin((double)5*ptlly);	
+	aux4 = a1*a2;			
+	aux5 = cos(GPstlat1);
+ 
+	a1 = sin(GPstlat1);		
+	a1 *= a1;			
+	a1 *= equad;			
+	a2 = sqrt((double)1-a1);	
+	aux6 = 1./a2;			
+
+	ptllx = Prd*(ptllx - GPlon0)*aux5*aux6;
+	ptlly = Prd*(log(aux1) - aux2 + aux3 - aux4)*aux5*aux6;
+
+	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
+}
+
+/********************************************************************
+		MERCATOR TO GEODETIC COORDINATES
+********************************************************************/
+TeCoord2D
+TeMercator :: PC2LL (const TeCoord2D& ptpc)
+{
+	double	equad,			//Squared eccentricity 
+	        pi,			// PII value
+		t,			// Ancillary variables
+		xx,aux1,aux2,aux3,aux4,aux5,ptpcx,ptpcy;
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+
+	ptpcx = ptpc.x()-GPoffx;
+	ptpcy = ptpc.y()-GPoffy;
+
+	equad = 2.*Pflt;		
+	equad -= Pflt*Pflt;		
+	pi = 4.*atan((double)1);
+	double	a1,a2;		
+	aux1 = cos(GPstlat1);
+
+	a1 = sin(GPstlat1);		
+	a1 *= a1;			
+	a1 *= equad;			
+	a2 = sqrt((double)1-a1);	
+	aux2 = 1./a2;			
+	ptpcx = ptpcx/(aux1*aux2);
+	ptpcy = ptpcy/(aux1*aux2);
+	t = exp(-ptpcy/Prd);
+	xx = pi/2. - 2.*atan(t);
+ 
+	a1 = equad/2.;			
+	a1 += 5.*equad*equad/24.;	
+	a1 += equad*equad*equad/12.;	
+	a2 = sin((double)4*atan(t));	
+	aux3 = a1*a2;			
+ 
+	a1 = 7.*equad*equad/48.;	
+	a1 += 29.*equad*equad*equad/240.;	
+	a2 = sin((double)8*atan(t));	
+	aux4 = -a1*a2;			
+ 
+	a1 = 7.*equad*equad*equad/120.;	
+	a2 = sin((double)12*atan(t));	
+	aux5 = a1*a2;		 
+
+	ptpcy = xx + aux3 + aux4 + aux5;
+	ptpcx = ptpcx/Prd + GPlon0;
+	
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return(TeCoord2D(ptpcx,ptpcy));
+}
+
+
+
+
+/********************************************************************
+		GEODETIC TO LAMBERT CONIC COORDINATES
+********************************************************************/
+TeCoord2D
+TeLambertConformal :: LL2PC (const TeCoord2D& ptll)
+{
+
+	double	equad,			// Squared eccentricity
+		e,			// Ancillary variables
+		m1,m2,aux1,aux2,aux0,t1,t2,t0,n,efe,ro0,aux,
+		t,ro,teta,ptllx,ptlly;
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+
+	ptllx = (double)ptll.x();
+	ptlly = (double)ptll.y();
+
+	equad = 2.*Pflt - pow(Pflt,(double)2);
+	e = sqrt(equad);
+
+	m1 = cos(GPstlat1)/sqrt((double)1-equad*pow(sin(GPstlat1),(double)2));
+	m2 = cos(GPstlat2)/sqrt((double)1-equad*pow(sin(GPstlat2),(double)2));
+	aux1 = sqrt(((double)1-e*sin(GPstlat1))/((double)1+e*sin(GPstlat1)));
+	aux2 = sqrt(((double)1-e*sin(GPstlat2))/((double)1+e*sin(GPstlat2)));
+	aux0 = sqrt(((double)1-e*sin(GPlat0))/((double)1+e*sin(GPlat0)));
+	t1 = ((1.-tan(GPstlat1/(double)2))/(1.+tan(GPstlat1/(double)2)))/pow(aux1,e);
+	t2 = ((1.-tan(GPstlat2/(double)2))/(1.+tan(GPstlat2/(double)2)))/pow(aux2,e);
+	t0 = ((1.-tan(GPlat0/(double)2))/(1.+tan(GPlat0/(double)2)))/pow(aux0,e);
+
+	if (GPstlat1 == GPstlat2)
+		n = sin(GPstlat1);
+	else
+		n = (log(m1)-log(m2))/(log(t1)-log(t2));
+
+	efe = m1/(n*pow(t1,n));
+	ro0 = Prd*efe*pow(t0,n);
+
+	aux = sqrt(((double)1-e*sin(ptlly))/((double)1+e*sin(ptlly)));
+	t = ((1.-tan(ptlly/(double)2))/(1.+tan(ptlly/(double)2)))/pow(aux,e);
+	ro = Prd*efe*pow(t,n);
+	teta = n*(ptllx - GPlon0);
+	ptllx = ro*sin(teta);
+	ptlly = ro0 - ro*cos(teta);
+	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
+}
+
+
+
+/********************************************************************
+		LAMBERT CONIC TO GEODETIC COORDINATES
+ ********************************************************************/
+TeCoord2D
+TeLambertConformal :: PC2LL (const TeCoord2D& ptpc)
+{
+	double	equad,			// Squared eccentricity 
+		pi,			// PI value
+		e,m1,m2,aux1,aux2,aux0,t1,t2,t0,n,efe,ro0,ro,teta,
+		t,xx,aux3,aux4,aux5,ptpcx,ptpcy;
+
+	int	sinal;
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+	
+
+	ptpcx = ptpc.x()-GPoffx;
+	ptpcy = ptpc.y()-GPoffy;
+
+	equad = 2.*Pflt - pow(Pflt,(double)2);
+	e = sqrt(equad);
+	pi = 4.*atan((double)1);
+
+	m1 = cos(GPstlat1)/sqrt((double)1-equad*pow(sin(GPstlat1),(double)2));
+	m2 = cos(GPstlat2)/sqrt((double)1-equad*pow(sin(GPstlat2),(double)2));
+	aux1 = sqrt(((double)1-e*sin(GPstlat1))/((double)1+e*sin(GPstlat1)));
+	aux2 = sqrt(((double)1-e*sin(GPstlat2))/((double)1+e*sin(GPstlat2)));
+	aux0 = sqrt(((double)1-e*sin(GPlat0))/((double)1+e*sin(GPlat0)));
+	t1 = ((1.-tan(GPstlat1/(double)2))/(1.+tan(GPstlat1/(double)2)))/pow(aux1,e);
+	t2 = ((1.-tan(GPstlat2/(double)2))/(1.+tan(GPstlat2/(double)2)))/pow(aux2,e);
+	t0 = ((1.-tan(GPlat0/(double)2))/(1.+tan(GPlat0/(double)2)))/pow(aux0,e);
+
+	if (GPstlat1 == GPstlat2)
+		n = sin(GPstlat1);
+	else
+		n = (log(m1)-log(m2))/(log(t1)-log(t2));
+
+	efe = m1/(n*pow(t1,n));
+	ro0 = Prd*efe*pow(t0,n);
+
+	sinal = (int)(n/fabs(n));
+	ro = sqrt(ptpcx*ptpcx + (ro0-ptpcy)*(ro0-ptpcy));
+	ro *= sinal;
+	teta = atan(ptpcx/(ro0-ptpcy));
+	t = pow((ro/(Prd*efe)),(double)1/n);
+	xx = pi/2. - 2.*atan(t);
+	aux3 = equad/2. + 5.*equad*equad/24. + equad*equad*equad/12.;
+	aux4 = 7.*equad*equad/48. + 29.*equad*equad*equad/240.;
+	aux5 = (7.*equad*equad*equad/120.)*sin(12.*atan(t));
+
+	ptpcy = xx + aux3*sin(4.*atan(t)) - aux4*sin(8.*atan(t)) + aux5;
+	ptpcx = teta/n + GPlon0;
+	
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return (TeCoord2D(ptpcx,ptpcy));
+}
+
+/********************************************************************
+		GEODETIC TO POLYCONIC COORDINATES
+********************************************************************/
+TeCoord2D
+TePolyconic :: LL2PC (const TeCoord2D& ptll)
+{
+	double	equad,			// Squared eccentricity 
+		n,			// Great normal of ellipsoid
+		aux01,			// Ancillary variables
+		aux02,aux03,aux04,m0,aux1,aux2,aux3,
+		aux4,m,e,ptllx,ptlly;
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+
+	ptllx = (double)ptll.x();
+	ptlly = (double)ptll.y();
+
+	equad = 2.*Pflt - pow(Pflt,(double)2);
+
+	aux01 = (1.-equad/4.-3.*equad*equad/64.-5.*equad*equad*equad/256.)*GPlat0;
+	aux02 = (3.*equad/8+3.*equad*equad/32.+45.*equad*equad*equad/1024.)*sin((double)2*GPlat0);
+	aux03 = (15.*equad*equad/256.+45.*equad*equad*equad/1024.)*sin((double)4*GPlat0);
+	aux04 = (35.*equad*equad*equad/3072.)*sin((double)6*GPlat0);
+	m0 = Prd*(aux01 - aux02 + aux03 - aux04);
+
+	if (ptlly == 0.)
+	{
+		ptllx = Prd*(ptllx - GPlon0);
+		ptlly = -m0;
+	}
+	else
+	{
+		aux1 = (1.-equad/4.-3.*equad*equad/64.-5.*equad*equad*equad/256.)*ptlly;
+		aux2 = (3.*equad/8+3.*equad*equad/32.+45.*equad*equad*equad/1024.)*sin((double)2*ptlly);
+		aux3 = (15.*equad*equad/256.+45.*equad*equad*equad/1024.)*sin((double)4*ptlly);
+		aux4 = (35.*equad*equad*equad/3072.)*sin((double)6*ptlly);
+		m = Prd*(aux1 - aux2 + aux3 - aux4);
+		n = Prd/sqrt((double)1-equad*pow(sin(ptlly),(double)2));
+		e = (ptllx - GPlon0)*sin(ptlly);
+		ptllx = n*sin(e)/tan(ptlly);
+		ptlly = m - m0 + (n*(1. - cos(e))/tan(ptlly));
+	}
+	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
+}
+
+TePolyconic::TePolyconic (const TeDatum& datum, double long0, double lat0, double offx, double offy,
+				 const string& units): 
+	TeProjection ( "Polyconic", datum, long0, lat0, offx, offy, 0., 0., units )
+{
+	GPepsgCode = 29101;
+}
+
+	
+/*******************************************************************
+		POLYCONIC TO GEODETIC COORDINATES
+********************************************************************/
+TeCoord2D
+TePolyconic :: PC2LL (const TeCoord2D& ptpc)
+{	
+	double	A,	
+		B,
+		C,
+		equad,			// Squared eccentricity
+		aux01,			// Ancillary variables
+		aux02,aux03,aux04,m0,mn,mnl,ma,cp,lat1,lat2,aux05,
+		aux06,aux07,aux08,aux09,aux10,aux11,aux12,aux21,
+		aux22,aux23,aux24,ptpcx,ptpcy;
+
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+
+	ptpcx = ptpc.x()-GPoffx;
+	ptpcy = ptpc.y()-GPoffy;
+
+	equad = 2.*Pflt - pow(Pflt,(double)2);
+
+	// Initialize latitude with latitude of origin
+	aux01 = (1.-equad/4.-3.*equad*equad/64.-5.*equad*equad*equad/256.)*GPlat0;
+	aux02 = (3.*equad/8+3.*equad*equad/32.+45.*equad*equad*equad/1024.)*sin((double)2*GPlat0);
+	aux03 = (15.*equad*equad/256.+45.*equad*equad*equad/1024.)*sin((double)4*GPlat0);
+	aux04 = (35.*equad*equad*equad/3072.)*sin((double)6*GPlat0);
+	m0 = Prd*(aux01 - aux02 + aux03 - aux04);
+
+	if (ptpcy == (-m0))
+	{
+		ptpcy= 0.;
+		ptpcx = ptpcx/Prd + GPlon0;
+	}
+	else
+	{
+		A = (m0 + ptpcy)/Prd;
+		B = ((ptpcx*ptpcx)/(Prd*Prd)) +(A*A);
+
+		lat2 = A;
+
+		do
+		{
+			C = (sqrt(1.- equad*sin(lat2)*sin(lat2)))*tan(lat2);
+
+			// mn calculation	
+			aux21 = (1.-equad/4.-3.*equad*equad/64.-5.*equad*equad*equad/256.)*lat2;
+			aux22 = (3.*equad/8.+3.*equad*equad/32.+45.*equad*equad*equad/1024.)*sin((double)2*lat2);
+			aux23 = (15.*equad*equad/256.+45.*equad*equad*equad/1024.)*sin((double)4*lat2);
+			aux24 = (35.*equad*equad*equad/3072.)*sin((double)6*lat2);
+			mn = Prd*(aux21 - aux22 + aux23 - aux24);
+		
+			// mnl calculation
+			aux05 = 1.- equad/4.-3.*equad*equad/64.-5.*equad*equad*equad/256.;
+			aux06 = 2.*(3.*equad/8.+3.*equad*equad/32.+45.*equad*equad*equad/1024.)*cos((double)2*lat2);
+			aux07 = 4.*(15.*equad*equad/256.+45.*equad*equad*equad/1024.)*cos((double)4*lat2);
+			aux08 = 6.*(35.*equad*equad*equad/3072.)*cos((double)6*lat2);
+			mnl = aux05 - aux06 + aux07- aux08;
+
+			// ma calculation
+			ma = mn/Prd;
+
+			aux09 = (A*(C*ma+1)-ma)-(0.5*(ma*ma+B)*C);
+			aux10 = equad*sin((double)2*lat2)*(ma*ma+B-2.*A*ma);
+			aux11 = 4.*C+(A-ma);
+			aux12 = C*mnl-(2./sin((double)2*lat2));
+
+			// New latitude calculation 
+			lat1 = lat2 - (aux09/((aux10/(aux11*aux12)) - mnl));
+			cp = fabs(lat1-lat2) ;
+			lat2 = lat1;
+
+
+		}while(cp > 0.0000000001);
+
+		ptpcy = lat1;
+		ptpcx = ((asin((ptpcx*C)/Prd))/(sin(lat1))) + GPlon0;
+	}
+
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return (TeCoord2D(ptpcx,ptpcy));	
+
+}
+
+/********************************************************************
+	GEODETIC TO LAT LONG
+********************************************************************/
+TeLatLong::TeLatLong( const TeDatum& datum, const string& units ):
+	   TeProjection ( "LatLong", datum, 0., 0., 0., 0., 0., 0., units )
+{
+  if (datum.name() == "SAD69")
+  {
+	GPepsgCode = 4618;
+  }
+  else if (datum.name() == "WGS84")
+  {
+	GPepsgCode = 4979;
+  }
+  else if (datum.name() == "Indian")
+  {
+	GPepsgCode = 4240;
+  } 
+  else if (datum.name() == "Astro-Chua")
+  {
+	GPepsgCode = 4224;
+  }
+  else if (datum.name() == "CorregoAlegre")
+  {
+	GPepsgCode = 4225;
+  }
+  else if (datum.name() == "NAD27")
+  {
+	GPepsgCode = 4267;
+  }
+  else if (datum.name() == "NAD83")
+  {
+	GPepsgCode = 4269;
+  }
+ else if (datum.name() == "Aratu")
+ {
+	GPepsgCode = 4208;
+  }  
+
+  
+}
+
+TeCoord2D
+TeLatLong :: LL2PC (const TeCoord2D& ptll)
+{
+	return TeCoord2D( ptll.x()*TeCRD, ptll.y()*TeCRD ); 
+}
+
+//FAMI
+void
+TeLatLong :: LL2PC (double xi, double yi, double& xo, double& yo) const
+{
+	xo = xi*TeCRD;
+	yo = yi*TeCRD;
+	return;
+}
+
+/********************************************************************
+	LAT LONG TO GEODETIC COORDINATES
+********************************************************************/
+TeCoord2D
+TeLatLong :: PC2LL (const TeCoord2D& ptpc)
+{
+	double ptpcx, ptpcy;
+
+	ptpcx = ptpc.x()*TeCDR;
+	ptpcy = ptpc.y()*TeCDR;
+	
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return TeCoord2D(ptpcx,ptpcy); 
+}
+
+//FAMI
+void
+TeLatLong :: PC2LL (double xi, double yi, double& ptpcx, double& ptpcy)
+{
+	ptpcx = xi*TeCDR;
+	ptpcy = yi*TeCDR;
+	
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return; 
+}
+	
+/********************************************************************
+	GEODETIC TO ALBERS EQUAL-AREA COORDINATES
+********************************************************************/
+TeCoord2D
+TeAlbers :: LL2PC (const TeCoord2D& ptll)
+{
+
+	double	equad,			// Squared eccentricity
+		e,			// Ancillary variables
+		m1,m2,aux1,aux10,aux11,aux12,aux2,aux20,aux21,
+		aux22,q0,q1,q2,q,n,c,ro0,teta,ro,ptllx,ptlly;
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+
+	ptllx = (double)ptll.x();
+	ptlly = (double)ptll.y();
+
+	equad = 2.*Pflt - pow(Pflt,(double)2);
+	e = sqrt(equad);
+
+	m1 = cos(GPstlat1)/sqrt((double)1-equad*pow(sin(GPstlat1),(double)2));
+	m2 = cos(GPstlat2)/sqrt((double)1-equad*pow(sin(GPstlat2),(double)2));
+	aux1 = sin(ptlly)/((double)1-equad*pow(sin(ptlly),(double)2));
+	aux10 = sin(GPlat0)/((double)1-equad*pow(sin(GPlat0),(double)2));
+	aux11 = sin(GPstlat1)/((double)1-equad*pow(sin(GPstlat1),(double)2));
+	aux12 = sin(GPstlat2)/((double)1-equad*pow(sin(GPstlat2),(double)2));
+	aux2 = log((1. - e*sin(ptlly))/(1. + e*sin(ptlly)));
+	aux20 = log((1. - e*sin(GPlat0))/(1. + e*sin(GPlat0)));
+	aux21 = log((1. - e*sin(GPstlat1))/(1. + e*sin(GPstlat1)));
+	aux22 = log((1. - e*sin(GPstlat2))/(1. + e*sin(GPstlat2)));
+	q0 = (1. - equad)*(aux10 - (1./(2.*e))*aux20);
+	q1 = (1. - equad)*(aux11 - (1./(2.*e))*aux21);
+	q2 = (1. - equad)*(aux12 - (1./(2.*e))*aux22);
+	q = (1. - equad)*(aux1 - (1./(2.*e))*aux2);
+	n = (m1*m1 - m2*m2)/(q2 - q1);
+	c = m1*m1 + n*q1;
+	ro0 = Prd*sqrt(c - n*q0)/n;
+	teta = n*(ptllx - GPlon0);
+	ro = Prd*sqrt(c - n*q)/n;
+
+	ptllx = ro*sin(teta);
+	ptlly = ro0 - ro*cos(teta);
+
+	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
+}
+
+
+/********************************************************************
+		ALBERS EQUAL-AREA TO GEODETIC COORDINATES
+********************************************************************/
+TeCoord2D
+TeAlbers :: PC2LL(const TeCoord2D& ptpc)
+{
+
+	double	equad,			// Squared eccentricity
+		e,			// Eccentricity
+		m1,			// Ancillary variable
+		m2,aux10,aux11,aux12,aux20,aux21,aux22,q0,q1,q2,
+		n,c,ro0,ro,q,aux,beta,aux1,aux2,aux3,teta,ptpcx,ptpcy;
+
+	int	sinal;			// Ancillary variable	
+
+	
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+
+	ptpcx = ptpc.x()-GPoffx;
+	ptpcy = ptpc.y()-GPoffy;
+
+	sinal = (int)(GPstlat2/fabs(GPstlat2));
+	equad = 2.*Pflt - pow(Pflt,(double)2);
+	e = sqrt(equad);
+
+	m1 = cos(GPstlat1)/sqrt((double)1-equad*pow(sin(GPstlat1),(double)2));
+	m2 = cos(GPstlat2)/sqrt((double)1-equad*pow(sin(GPstlat2),(double)2));
+	aux10 = sin(GPlat0)/((double)1-equad*pow(sin(GPlat0),(double)2));
+	aux11 = sin(GPstlat1)/((double)1-equad*pow(sin(GPstlat1),(double)2));
+	aux12 = sin(GPstlat2)/((double)1-equad*pow(sin(GPstlat2),(double)2));
+	aux20 = log((1. - e*sin(GPlat0))/(1. + e*sin(GPlat0)));
+	aux21 = log((1. - e*sin(GPstlat1))/(1. + e*sin(GPstlat1)));
+	aux22 = log((1. - e*sin(GPstlat2))/(1. + e*sin(GPstlat2)));
+	q0 = (1. - equad)*(aux10 - (1./(2.*e))*aux20);
+	q1 = (1. - equad)*(aux11 - (1./(2.*e))*aux21);
+	q2 = (1. - equad)*(aux12 - (1./(2.*e))*aux22);
+	n = (m1*m1 - m2*m2)/(q2 - q1);
+	c = m1*m1 + n*q1;
+	ro0 = Prd*sqrt(c - n*q0)/n;
+	ro = sqrt(ptpcx*ptpcx + (ro0 - ptpcy)*(ro0 - ptpcy));
+	q = (c - (ro*ro*n*n/(Prd*Prd)))/n;
+	aux = ((1. - equad)/(2.*e))*log((1. - e)/(1. + e));
+	beta = asin(q/(1. - aux));
+	aux1 = (equad/3. + 31.*equad*equad/180.+517.*equad*equad*equad/5040.)*sin(2.*beta);
+	aux2 = (23.*equad*equad/360.+251.*equad*equad*equad/3780.)*sin(4.*beta);
+	aux3 = (761.*equad*equad*equad/45360.)*sin(6.*beta);
+	teta = fabs(atan(ptpcx/(ro0 - ptpcy)));
+
+	if (sinal == 1)
+	{
+		if (ptpcx < 0.)
+			teta = -teta;
+	}
+
+	if (sinal == -1)
+	{
+		if (ptpcx > 0.)
+			teta *= sinal;
+	}
+
+	ptpcy = beta + aux1 + aux2 + aux3;
+	ptpcx = GPlon0 + (teta/n);
+
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return (TeCoord2D(ptpcx,ptpcy));
+}
+
+/*******************************************************************
+		GEODETIC TO MILLER COORDINATES
+********************************************************************/
+TeCoord2D
+TeMiller :: LL2PC (const TeCoord2D& ptll)
+{
+
+	double	pi,		// PI value
+		ptllx,ptlly;	// Ancillary variables 
+
+	int	sinal;		// Ancillary variables
+
+	double Prd  = GPdatum.radius();
+	
+	ptllx = (double)ptll.x();
+	ptlly = (double)ptll.y();
+
+	pi = 4.*atan((double)1);
+	sinal = (int)(fabs(ptlly)/ptlly);
+	
+	ptllx = Prd*(ptllx - GPlon0);
+
+	if (sinal == 1)
+		ptlly = (Prd/0.8)*(log(tan(pi/4. + 0.4*ptlly)));
+	else
+	{
+		ptlly *= sinal;
+		ptlly = (Prd/0.8)*(log(tan(pi/4. + 0.4*ptlly)));
+		ptlly *= sinal;
+	}
+
+	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
+}
+
+
+/********************************************************************
+		MILLER TO GEODETIC COORDINATES
+********************************************************************/
+TeCoord2D
+TeMiller :: PC2LL (const TeCoord2D& ptpc)
+{
+
+	double	e,		// Neperian logarithm base 
+		pi,		// PI value
+		ptpcx,ptpcy;	// Ancillary variables
+
+	int	sinal;		// Ancillary variable
+
+	double Prd  = GPdatum.radius();
+
+	ptpcx = ptpc.x()-GPoffx;
+	ptpcy = ptpc.y()-GPoffy;
+
+	e = 2.718281828;
+	pi = 4.*atan((double)1);
+	sinal = (int)(fabs(ptpcy)/ptpcy);
+
+	ptpcx = GPlon0 + (ptpcx/Prd);
+
+	if (sinal == 1)
+		ptpcy = 2.5*atan(pow(e,(0.8*ptpcy/Prd)))-5.*pi/8.;
+	else
+	{
+		ptpcy *= sinal;
+		ptpcy = 2.5*atan(pow(e,(0.8*ptpcy/Prd))) - 5.*pi/8.;
+		ptpcy *= sinal;
+	}
+
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return(TeCoord2D(ptpcx,ptpcy));
+}
+
+
+/*******************************************************************
+		GEODETIC TO SINUSOIDAL COORDINATES
+********************************************************************/
+TeCoord2D
+TeSinusoidal :: LL2PC (const TeCoord2D& ptll)
+{
+
+	double	ptllx,ptlly;	// Ancillary variables 
+
+	double Prd  = GPdatum.radius();
+	
+	ptllx = (double)ptll.x();
+	ptlly = (double)ptll.y();
+	
+	ptllx = Prd*(ptllx - GPlon0);
+	ptllx *= cos(ptlly);
+
+	ptlly = Prd*ptlly;
+	
+	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));	
+}
+
+
+/********************************************************************
+		SINUSOIDAL TO GEODETIC COORDINATES
+********************************************************************/
+TeCoord2D
+TeSinusoidal :: PC2LL (const TeCoord2D& ptpc)
+{
+
+	double	ptpcx,ptpcy;	// Ancillary variables
+
+	double Prd  = GPdatum.radius();
+
+	ptpcx = ptpc.x()-GPoffx;
+	ptpcy = ptpc.y()-GPoffy;
+
+	ptpcy = ptpcy/Prd;
+
+	ptpcx = GPlon0 + (ptpcx/(Prd*cos(ptpcy)));
+	
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return(TeCoord2D(ptpcx,ptpcy));
+}
+
+TeCylindricalEquidistant::TeCylindricalEquidistant (const TeDatum& datum, double lon0, double offx, 
+                                                    double offy, double stlat1, const string& units):
+			TeProjection ( "CylindricalEquidistant", datum, lon0, 0., offx, offy, stlat1, 0,units)
+{
+  if (datum.name() == "Spherical")
+  {
+	GPepsgCode = 9823;
+  }
+  else 
+  {
+	GPepsgCode = 9842;
+  }
+}
+/*******************************************************************
+		GEODETIC TO CYLINDRICAL EQUIDISTANT COORDINATES
+********************************************************************/
+TeCoord2D
+TeCylindricalEquidistant :: LL2PC (const TeCoord2D& ptll)
+{
+	double	ptllx,ptlly;
+
+	double Prd  = GPdatum.radius();
+
+	ptllx = ptll.x();
+	ptlly = ptll.y();
+
+	ptllx = Prd*(ptllx - GPlon0)*cos(GPstlat1);
+	ptlly = Prd*ptlly;
+
+	return(TeCoord2D(ptllx+GPoffx,ptlly+GPoffy));
+}
+
+
+/*******************************************************************
+	CYLINDRICAL EQUIDISTANT TO	GEODETIC COORDINATES
+********************************************************************/
+TeCoord2D
+TeCylindricalEquidistant :: PC2LL (const TeCoord2D& ptpc)
+{
+	double	ptpcx,ptpcy;
+
+	double Prd  = GPdatum.radius();
+
+	ptpcx = ptpc.x()-GPoffx;
+	ptpcy = ptpc.y()-GPoffy;
+
+	ptpcy = ptpcy/Prd;
+	ptpcx = GPlon0 + ptpcx/(Prd*cos(GPstlat1));
+
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return (TeCoord2D(ptpcx,ptpcy));
+}
+
+TePolarStereographic::TePolarStereographic ( const TeDatum& datum, double lon0,  double offx, 
+				 double offy, const string& units, const TeHemisphere hem ):
+	TeProjection ( "PolarStereographic", datum, lon0, 0., offx, offy, 0, 0, units, 1, hem )
+{
+	if (GPhemisphere == TeNORTH_HEM)
+		GPepsgCode = 3995;
+	else
+		GPepsgCode = 3031;
+}
+
+/*******************************************************************
+		GEODETIC TO POLAR STEREOGRAPHIC COORDINATES
+********************************************************************/
+TeCoord2D
+TePolarStereographic :: LL2PC (const TeCoord2D& ptll)
+{
+	double	k0,				// Scale factor
+		e,					// Eccentricity
+		pi,					// Auxillary variables
+		lon0,				// auxilliary origin longitude
+		t,ro,aux1,aux2,aux3,ptllx,ptlly;
+	
+	int GPhemis;
+	if (GPhemisphere == TeNORTH_HEM)
+		GPhemis = 1;
+	else
+		GPhemis = -1;
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+	
+	ptllx = ptll.x();
+	ptlly = ptll.y();
+
+	k0 = 0.933;	// Standard parallel 60 degrees 
+	e = sqrt((double)2*Pflt - pow(Pflt,(double)2));
+	pi = 4.*atan((double)1);
+
+	ptlly *= GPhemis;
+	ptllx *= GPhemis;
+	lon0 = (GPhemis == 1) ? GPlon0 : -GPlon0;
+
+	aux1 = (1. - e*sin(ptlly))/(1. + e*sin(ptlly));
+	t = tan((pi/4.) - (ptlly/2.))/pow(aux1,(e/(double)2));
+	aux2 = pow(((double)1 + e),((double)1 + e));
+	aux3 = pow(((double)1 - e),((double)1 - e));
+	ro = 2.*Prd*k0*t/sqrt(aux2*aux3);
+
+	aux1   = ro*sin(ptllx - lon0);
+	ptlly = -ro*cos(ptllx - lon0);
+	aux1 *= GPhemis;
+	ptlly *= GPhemis;
+	
+	if (GPhemis == -1)
+	{
+		aux1 *= GPhemis;
+		ptlly *= GPhemis;
+	}
+//	return(Point((float)aux1,(float)ptlly));
+	return (TeCoord2D(aux1+GPoffx,ptlly+GPoffy));
+
+}
+
+//FAMI
+void
+TePolarStereographic :: LL2PC (double xi, double yi, double& xo, double& yo) const
+{
+	double	k0,				// Scale factor
+		e,					// Eccentricity
+		pi,					// Auxillary variables
+		lon0,				// auxilliary origin longitude
+		t,ro,aux1,aux2,aux3,ptllx,ptlly;
+	
+	int GPhemis;
+	if (GPhemisphere == TeNORTH_HEM)
+		GPhemis = 1;
+	else
+		GPhemis = -1;
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+	
+	ptllx = xi;
+	ptlly = yi;
+
+	k0 = 0.933;	// Standard parallel 60 degrees 
+	e = sqrt((double)2*Pflt - pow(Pflt,(double)2));
+	pi = 4.*atan((double)1);
+
+	ptlly *= GPhemis;
+	ptllx *= GPhemis;
+	lon0 = (GPhemis == 1) ? GPlon0 : -GPlon0;
+
+	aux1 = (1. - e*sin(ptlly))/(1. + e*sin(ptlly));
+	t = tan((pi/4.) - (ptlly/2.))/pow(aux1,(e/(double)2));
+	aux2 = pow(((double)1 + e),((double)1 + e));
+	aux3 = pow(((double)1 - e),((double)1 - e));
+	ro = 2.*Prd*k0*t/sqrt(aux2*aux3);
+
+	aux1   = ro*sin(ptllx - lon0);
+	ptlly = -ro*cos(ptllx - lon0);
+	aux1 *= GPhemis;
+	ptlly *= GPhemis;
+	
+	if (GPhemis == -1)
+	{
+		aux1 *= GPhemis;
+		ptlly *= GPhemis;
+	}
+
+	xo = aux1+GPoffx;
+	yo = ptlly+GPoffy;
+	return;
+}
+
+//FAMI
+void TePolarStereographic :: LL2PC (ostream& java) const 
+{
+	double	k0,			// Scale factor
+		equad,			// Squared eccentricity
+		e,		        // Eccentricity
+		pi,			// Ancillary variables
+		lon0,			// auxilliary origin longitude
+		aux1,aux2,aux3,aux4,aux5;
+	
+		
+	java << "\tpx = xpc - " << GPoffx << ";\n";
+	java << "\tpy = ypc - " << GPoffy << ";\n";
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+	k0   = 0.933;
+	
+	pi = 4.*atan((double)1); 
+	equad =  2.*Pflt - pow(Pflt,(double)2);
+	e = sqrt(equad);
+	
+	
+	if (GPhemisphere != TeNORTH_HEM) {
+		java << "\tpx *= -1;\n";
+		java << "\tpy *= -1;\n";
+	}
+	lon0 = (GPhemisphere == TeNORTH_HEM) ? GPlon0 : -GPlon0;
+
+	java << "\tro = Math.sqrt(px*px + py*py);\n";	
+	aux1 = pow(((double)1 + e),((double)1 + e));
+	aux2 = pow(((double)1 - e),((double)1 - e));
+	
+	java << "\tt = (ro* " << sqrt(aux1*aux2) << ")/(" << 2.*Prd*k0 << ") " << ";\n";
+	java << "\txx = " << pi/2. << " - 2.*Math.atan(t);\n";
+	
+	aux3 =  equad/2. + 5.*equad*equad/24. + equad*equad*equad/12.;
+	aux4 = 7.*equad*equad/48. + 29.*equad*equad*equad/240.;
+	aux5 = 7.*equad*equad*equad/120.;
+
+	java << "\tyll = xx + " << aux3 << "*Math.sin(2*xx) + " << aux4 << "*Math.sin(4*xx) + "<< aux5 << "*Math.sin(6*xx);\n";
+
+	java << "\tif (py != 0.) \n";
+	java << "\t\txll = " << lon0 << "+ Math.atan(px/(-py));\n";
+
+	if (GPhemisphere == TeNORTH_HEM)
+	{
+		java << "\tif (and(greater(px, 0.), greater(py,0.)))\n";
+		java << "\t\txll = xll + " << pi << ";\n";
+		java << "\telse if (and(smaller(px,0.), greater(py,0.)))\n";
+		java << "\t\txll = xll - " << pi << ";\n";
+		java << "\telse if (and(greater(px, 0.), equal(py,0.)))\n";
+		java << "\t\txll = " << lon0  << "+ " << pi << "/ 2.;\n";
+		java << "\telse if (and(smaller(px, 0.),  equal(py,0.)))\n";
+		java << "\t\txll = " << lon0 << " - " << pi << "/ 2.;\n";
+		java << "\telse if (and(equal(px,0.), equal(py, 0.)))\n";
+		java << "\t\txll = " << lon0 << ";\n";
+	}
+	else
+	{
+		java << "\tyll = -yll;\n";
+		java << "\txll = -xll;\n";
+
+		java << "\tif (and(greater(px,0.), smaller(py,0))\n";
+		java << "\t\txll = xll + " << pi << ";\n";
+		java << "\telse if (and (smaller(px, 0.),  samller(py,0) )\n";
+		java << "\t\txll = xll - " << pi << ";\n";
+		java << "\telse if (and(greater(px,0.), equal(py,0.) )\n";
+		java << "\t\txll = " << lon0 << " + " << pi << "/ 2.;\n";
+		java << "\telse if (and(smaller(px,0.), equal(py, 0.))\n";
+		java << "\t\txll = " << lon0 << " - " << pi << " / 2.;\n";
+		java << "\telse if (and(equal(px,0.), equal(py, 0.))\n";
+		java << "\t\txll = " << lon0 << ";\n";
+	}
+
+	java << "\tif (smaller(xll, (-" << pi << ") )) xll += 2.* "<< pi << ";\n";
+	java << "\telse if (greater(xll, " << pi << ")  )    xll -= 2.*" << pi << ";\n";
+	
+	java << "\txll = xll * " << 180/3.14159 << ";\n";
+	java << "\tyll = yll * " << 180/3.14159 << ";\n\n";
+
+	java << "\treturn { lon :  xll, lat : yll } ;\n";
+	java << "}\n";
+	
+}
+/*******************************************************************
+	POLAR STEREOGRAPHIC TO	GEODETIC COORDINATES
+********************************************************************/
+TeCoord2D
+TePolarStereographic :: PC2LL (const TeCoord2D& ptpc)
+{
+	double	k0,			// Scale factor
+
+		equad,			// Squared eccentricity
+		e,		        // Eccentricity
+		pi,			// Ancillary variables
+		lon0,			// auxilliary origin longitude
+		ro,t,xx,aux1,aux2,aux3,aux4,aux5,ptpcx=0.,ptpcy,px,py;
+
+	px = (double)ptpc.x()-GPoffx;
+	py = (double)ptpc.y()-GPoffy;
+
+	int GPhemis;
+	if (GPhemisphere == TeNORTH_HEM)
+		GPhemis = 1;
+	else
+		GPhemis = -1;
+
+	double Pflt = GPdatum.flattening();
+	double Prd  = GPdatum.radius();
+
+//	k0 = 0.994;	// Standard parallel 80.1 degrees 
+	k0 = 0.933;	// Standard parallel 60 degrees
+	pi = 4.*atan((double)1);
+	equad = 2.*Pflt - pow(Pflt,(double)2);
+	e = sqrt(equad);
+
+	if (GPhemis == -1)
+	{
+		px *= GPhemis;
+		py *= GPhemis;
+	}
+
+	lon0 = (GPhemis == 1) ? GPlon0 : -GPlon0;
+
+	ro = sqrt(px*px + py*py);
+	aux1 = pow(((double)1 + e),((double)1 + e));
+	aux2 = pow(((double)1 - e),((double)1 - e));
+	t = (ro*sqrt(aux1*aux2))/(2.*Prd*k0);
+	xx = pi/2. - 2.*atan(t);
+	aux3 = equad/2. + 5.*equad*equad/24. + equad*equad*equad/12.;
+	aux4 = 7.*equad*equad/48. + 29.*equad*equad*equad/240.;
+	aux5 = 7.*equad*equad*equad/120.;
+
+	ptpcy = xx + aux3*sin((double)2*xx) + aux4*sin((double)4*xx) + aux5*sin((double)6*xx);
+
+	if (py != 0.)
+		ptpcx = lon0 + atan(px/(-py));
+
+
+	if (GPhemis == 1)
+	{
+		if (px > 0. && py > 0.)
+			ptpcx = ptpcx + pi;
+		else if (px < 0. && py > 0.)
+			ptpcx = ptpcx - pi;
+		else if (px > 0. && py == 0.)
+			ptpcx = lon0 + pi / 2.;
+		else if (px < 0. && py == 0.)
+			ptpcx = lon0 - pi / 2.;
+		else if (px == 0. && py == 0.)
+			ptpcx = lon0;
+	}
+	else
+	{
+		ptpcy *= GPhemis;
+		ptpcx *= GPhemis;
+
+		if (px > 0. && py < 0.)
+			ptpcx = ptpcx + pi;
+		else if (px < 0. && py < 0.)
+			ptpcx = ptpcx - pi;
+		else if (px > 0. && py == 0.)
+			ptpcx = lon0 + pi / 2.;
+		else if (px < 0. && py == 0.)
+			ptpcx = lon0 - pi / 2.;
+		else if (px == 0. && py == 0.)
+			ptpcx = lon0;
+	}
+
+	if (ptpcx < (-pi)) ptpcx += 2.*pi;
+	else if (ptpcx > pi)    ptpcx -= 2.*pi;
+
+	if( GPdestination && !(datum() == GPdestination->datum()))
+		ChangeLL(ptpcx,ptpcy);
+
+	return (TeCoord2D(ptpcx,ptpcy));
+}
+
+//FAMI
+/************************************************************************
+		GEODETIC COORDINATES TO SATELLITE PROJECTION
+*************************************************************************/
+TeCoord2D 
+TeSatelliteProjection::LL2PC(const TeCoord2D& ptll)
+{
+	double equad, n, x, y, z, sn, dp, dl,xlo,yla,lin,col,resx,resy;
+	double x1, x2, a, b, c,  Rd2, Rm, Rm2, Rs2, v;
+
+//	xlo = ptpc.x()-GPoffx;
+//	yla = ptpc.y()-GPoffy;
+	xlo = ptll.x();
+	yla = ptll.y();
+
+	// Cartesian geocentric coordinates
+	xlo = xlo - GPlon0;
+	yla = yla - GPlat0;
+	equad = 2.*GPdatum.flattening() - pow(GPdatum.flattening(),(double)2);
+	n = GPdatum.radius()/sqrt((double)1-equad*pow(sin(yla),(double)2));
+	x = n*cos(yla)*cos(xlo);
+	y = n*cos(yla)*sin(xlo);
+	z = (n*(1-equad))*sin(yla);
+ 
+	// Field of view angles
+	dp = atan(y / (SPrs - x));
+	dl = atan(z * cos(dp) /(SPrs - x));
+
+	// Visibility test
+	if ( x < 0.0 )
+	{
+		col = TeMAXFLOAT;
+		lin = TeMAXFLOAT;
+		return (TeCoord2D(col,lin));
+	}
+	else
+	{
+		Rd2 = GPdatum.radius() * GPdatum.radius() ;
+		Rm  = GPdatum.radius() * (1 - GPdatum.flattening());
+		Rm2 = Rm * Rm ;
+		Rs2 = SPrs * SPrs;
+
+		v = (tan(dp)*tan(dp)*cos(dp)*cos(dp)*Rm2)+(tan(dl)*tan(dl)*Rd2);
+		a = cos(dp)*cos(dp)*Rm2 + v;      
+		b = -2.*SPrs*v;
+		c = Rs2*v-Rd2*Rm2*cos(dp)*cos(dp);
+
+		// Equation Resolution a*x**2+b*x+c=0 
+		v = (b*b) - (4.*a*c);
+		if (v < 0.0) v=0.0;
+   		x1 = (-b + sqrt(v)) / (2.*a);
+		x2 = (-b - sqrt(v)) / (2.*a);
+		if (x1 < x2)  x1 = x2;
+
+		if ( fabs(x-x1) > 1.0 )
+		{
+			col = TeMAXFLOAT;
+			lin = TeMAXFLOAT;
+			return (TeCoord2D(col,lin));
+		}
+	}
+	// Line and column of image
+	if (SPscn == 0.) sn = 1.0;  else sn = -1.0;
+	col = (sn * dp / SPrj + SPjs );
+	lin = (-sn * dl / SPri + SPis);
+
+	// Axis rotation correction due to yaw angle
+	col = col*cos(SPyaw) - lin*sin(SPyaw);
+	lin = lin*cos(SPyaw) + col*sin(SPyaw);
+	resx = tan(SPrj) * (SPrs - GPdatum.radius());
+	resy = tan(SPri) * (SPrs - GPdatum.radius());
+
+	return (TeCoord2D(col*resx,-(lin*resy)));
+}
+
+/************************************************************************
+		SATELLITE PROJECTION TO GEODETIC COORDINATES
+************************************************************************/
+TeCoord2D
+TeSatelliteProjection::PC2LL(const TeCoord2D& ptpc)
+{
+	double	dl, dp, x, y, z, x1, x2, equad, n, d, sn,
+		a, b, c,  Rd2, Rm,Rm2, Rs2,v,ptpcx,ptpcy,
+		yla,xlo,resx,resy;
+
+	resx = tan(SPrj) * (SPrs - GPdatum.radius());
+	resy = tan(SPri) * (SPrs - GPdatum.radius());
+	ptpcx = ptpc.x()/resx;
+	ptpcy = -ptpc.y()/resy;
+
+	// Axis rotation correction due yaw angle
+	ptpcx = ptpcx*cos(SPyaw) + ptpcy*sin(SPyaw);
+	ptpcy = ptpcy*cos(SPyaw) - ptpcx*sin(SPyaw);
+
+	// Field of view angles
+	if (SPscn == 0.) sn =  1.0;
+	else 		 sn = -1.0;
+	dl = - sn * ((ptpcy - SPis) * SPri);
+	dp =   sn * ((ptpcx - SPjs) * SPrj);
+
+	// Cartesian coordinates
+	Rd2 = GPdatum.radius() * GPdatum.radius() ;
+	Rm  = GPdatum.radius() * (1 - GPdatum.flattening());
+	Rm2 = Rm * Rm ;
+	Rs2 = SPrs * SPrs;
+
+	v = (tan(dp)*tan(dp)*cos(dp)*cos(dp)*Rm2)+(tan(dl)*tan(dl)*Rd2);
+	a = cos(dp)*cos(dp)*Rm2 + v;      
+	b = -2.*SPrs*v;
+	c = Rs2*v-Rd2*Rm2*cos(dp)*cos(dp);
+
+	// Equation Resolution a*x**2+b*x+c=0 
+	v = (b*b) - (4.*a*c);
+	if (v < 0)
+	{
+		xlo = TeMAXFLOAT;
+		yla = TeMAXFLOAT;
+		return (TeCoord2D(xlo,yla));
+	}
+
+   	x1 = (-b + sqrt(v)) / (2.*a);
+	x2 = (-b - sqrt(v)) / (2.*a);
+
+	if ( x1 >= x2)  x = x1;
+	else		  x = x2;
+
+	z = (SPrs - x) * tan(dl) / cos(dp);
+	y = (SPrs - x) * tan(dp);
+
+	// Geodetic coordinates
+	equad 	= 2. * GPdatum.flattening() - GPdatum.flattening() * GPdatum.flattening();
+
+	double aux = SPrs * dl / GPdatum.radius();
+	if (aux > 1.0) aux = 1.0;
+	if (aux < -1.0) aux = -1.0;
+
+	yla = asin(aux);
+	
+	do
+	{
+		n= GPdatum.radius()/sqrt((double)1-equad*pow(sin(yla),(double)2));
+		yla = atan((z + n*equad*sin(yla))/sqrt(x*x + y*y));
+		d = GPdatum.radius()/sqrt((double)1-equad*pow(sin(yla),(double)2)) - n;
+	}
+	while (fabs(d) > 0.001);
+
+	xlo = atan(y/x) + GPlon0;
+	yla = yla + GPlat0;
+
+	return (TeCoord2D(xlo,yla));
+}
+
+TeProjectionParams 
+TeSatelliteProjection::params () const
+{
+	TeProjectionParams par;
+	par = TeProjection::params();
+
+	par.pri  = SPri;
+	par.prj  = SPrj;
+	par.pis  = SPis;
+	par.pjs  = SPjs;
+	par.prs  = SPrs;
+	par.pscn = SPscn;
+	par.pyaw = SPyaw;
+
+return par;
+}
+
+TeDatum 
+TeGetDatumFromProj4(const string& proj4)
+{
+	unsigned int pos;
+    string attribute;
+    string value;
+	double dx, dy, dz;
+	dx = dy = dz = 0.0;
+
+	TeDatum dat;
+	dat.name("UserDefined");
+	for(unsigned int i = 0; i < proj4.size(); i++)
+    {
+        for( pos = i; i != proj4.size() && proj4[i] != '=';i++);
+
+        attribute = proj4.substr(pos+1, i-pos-1);
+
+        for(pos = i; i != proj4.size() && proj4[i] != ' ';i++);
+
+        if(proj4[i] == ' ') value = proj4.substr(pos+1, i-pos-1);
+        else                value = proj4.substr(pos+1, i-pos);
+		
+		double b;
+		// Datum parameters
+        if(attribute == "R")	// radius for a spherical ellipsoid
+		{
+			dat = TeDatum("Spherical",atof(value.c_str()));
+			return dat;
+		}
+		else if(attribute == "a")   // Earth equatorial radius
+			dat.radius(atof(value.c_str()));
+		else if (attribute == "b")
+			b = atof(value.c_str());
+	    else if(attribute == "f")	// Earth flattening
+			dat.flattening(atof(value.c_str()));
+	    else if(attribute == "rf")	// Earth  reverse flattening (f = 1/rf)
+			dat.flattening(1/atof(value.c_str()));
+		else if (attribute == "es") // eccentricity squared (f=1-(1-es)^0.5) 
+			dat.flattening(1-sqrt(1-atof(value.c_str())));
+		else if (attribute == "e")	// eccentricity (f=1-(1-es^2)^0.5)
+			dat.flattening(1-sqrt(1-pow(atof(value.c_str()),2)));
+		else if (attribute == "ellps")
+			dat.name(value);
+		else if (attribute == "towgs84")
+		{
+			vector<string> deltas;
+			TeSplitString(value, ",", deltas);
+			
+			if (deltas.size()>=3)
+			{
+				dx = atof(deltas[0].c_str());
+				dy = atof(deltas[1].c_str());
+				dz = atof(deltas[2].c_str());
+			}
+		}
+	}
+	if ( dx==0.0 && dy== 0 && dz == 0.0)
+	{
+		dat = TeDatum("WGS84",6378137,0.003352811,66.87,-4.37,38.52);
+	}
+	// this is a SAD69
+	else if (dx == -66.87 && dy == 4.37 &&  dz == -38.52)
+	{
+		dat = TeDatum("SAD69",6378160,0.003352892,0.0,0.0,0.0);
+	}
+	else
+	{
+		dat.dx_ = dx;
+		dat.dy_ = dy;
+		dat.dz_ = dz;
+	}
+	return dat;
+}
+
+TeProjection* TeGetTeProjectionFromSProj(const string& proj4)
+{
+	// a map from sproj4 projections to TerraLib projections
+	map<string,string> sprojToTeProj;
+	sprojToTeProj["aea"] = "Albers";
+	sprojToTeProj["latlong"] = "LatLong";
+	sprojToTeProj["lcc"] = "LambertConformal";
+	sprojToTeProj["merc"] = "Mercator";
+	sprojToTeProj["mill"] = "Miller";
+	sprojToTeProj["utm"] = "UTM";
+	sprojToTeProj["sinu"] = "Sinusoidal";
+	sprojToTeProj["poly"] = "Polyconic";
+	sprojToTeProj["eqc"] = "CylindricalEquidistant";
+	sprojToTeProj["ups"] = "PolarStereographic";
+	sprojToTeProj["sat"] = "Satellite"; //FAMI
+
+    unsigned int pos;
+    string attribute;
+    string value;
+
+  	TeProjectionParams par;
+	par.hemisphere = TeNORTH_HEM;
+	par.offx = 500000;
+	par.offy = 0;
+	par.units = "";
+    for(unsigned int i = 0; i < proj4.size(); i++)
+    {
+        for( pos = i; i != proj4.size() && proj4[i] != '=';i++);
+
+        attribute = proj4.substr(pos+1, i-pos-1);
+
+        for(pos = i; i != proj4.size() && proj4[i] != ' ';i++);
+
+        if(proj4[i] == ' ') value = proj4.substr(pos+1, i-pos-1);
+        else                value = proj4.substr(pos+1, i-pos);
+
+        if(attribute == "proj")
+		{
+			map<string,string>::iterator it = sprojToTeProj.find(value);
+			if (it != sprojToTeProj.end())
+				par.name = sprojToTeProj[value];
+			else
+				par.name = "NoProjection"; 
+		}
+	// Currently this routine understands the following parameters from
+	// a sproj description: lon_0, lat_0, lat_1, lat_2, k, zone, x_0, y_0
+
+        else if(attribute == "lon_0") 
+			par.lon0 = atof(value.c_str())*TeCDR;
+        else if(attribute == "lat_0") 
+			par.lat0 = atof(value.c_str())*TeCDR;
+        else if(attribute == "lat_1") 
+			par.stlat1 = atof(value.c_str())*TeCDR;
+        else if(attribute == "lat_2") 
+			par.stlat2 = atof(value.c_str())*TeCDR;
+        else if(attribute == "k") 
+			par.scale = atof(value.c_str());
+        else if(attribute == "zone") 
+			par.lon0 = (-183 + 6*(atoi(value.c_str()))*TeCDR);
+		else if (attribute == "south") 
+		{
+			par.hemisphere = TeSOUTH_HEM;
+			par.offy = 10000000;
+		}
+		else if(attribute == "x_0") 
+			par.offx = atof(value.c_str());
+ 		else if(attribute == "y_0") 
+			par.offy = atof(value.c_str());
+		else if (attribute == "units")
+			par.units = value;
+// TODO: sproj4 also allowd the selection of standard, predefined
+// ellipsoid figures using the option +ellps=acronym. But we are not decoding 
+// them yet because of our problem with the shiftings from SAD69
+    }
+	par.datum = TeGetDatumFromProj4(proj4);
+	return TeProjectionFactory::make(par);
+}
+
+string TeGetSProjFromTeProjection(TeProjection* teproj)
+{
+	map<string,string> teProjToSProj;
+	teProjToSProj["Albers"] = "aea";
+	teProjToSProj["LatLong"] = "latlong";
+	teProjToSProj["LambertConformal"] = "lcc";
+	teProjToSProj["Mercator"] = "merc";
+	teProjToSProj["Miller"] = "mill";
+	teProjToSProj["UTM"] = "utm";
+	teProjToSProj["Sinusoidal"] = "sinu";
+	teProjToSProj["Polyconic"] = "poly";
+	teProjToSProj["CylindricalEquidistant"] = "eqc";
+	teProjToSProj["PolarStereographic"] = "ups";
+	teProjToSProj["Satellite"] = "sat"; //FAMI
+
+    string sresp = "+proj=";
+	map<string,string>::iterator it = teProjToSProj.find(teproj->name());
+	if (it == teProjToSProj.end())
+	{
+		sresp += "noprojection";
+		return sresp;
+	}
+	else
+		sresp += it->second;
+
+	TeProjInfo pjInfo = TeProjectionInfo(teproj->name());
+	if ( pjInfo.hasLon0 )
+		sresp += " +lon_0=" + Te2String(teproj->lon0()*TeCRD,6);
+
+	if ( pjInfo.hasLat0 )
+		sresp += " +lat_0=" + Te2String(teproj->lat0()*TeCRD,6);
+
+	if ( pjInfo.hasStlat1 )
+		sresp += " +lat_1=" + Te2String(teproj->stLat1()*TeCRD,6);
+	
+	if ( pjInfo.hasStlat2 )
+		sresp += " +lat_2=" +Te2String(teproj->stLat2()*TeCRD,6);
+
+	if ( pjInfo.hasOffx )
+		sresp += " +x_0=" + Te2String(teproj->offX(),6);
+
+	if ( pjInfo.hasOffy )
+		sresp += " +y_0=" + Te2String(teproj->offY(),6);
+	
+	if ( pjInfo.hasScale )
+		sresp += " +k="  + Te2String(teproj->scale(),6);
+
+	string datumD = teproj->datum().getProj4Description();
+	if (!datumD.empty())
+		sresp += datumD;
+	return sresp;
+}
+
+string 
+TeGetWKTFromTeProjection(TeProjection* teproj)
+{
+	string wkt = "";
+	if (!teproj)
+		return wkt;
+
+	string wktDatum = teproj->datum().getWKTDescription();
+	if (teproj->name() == "LatLong")
+		return wktDatum;
+
+	map<string,string> teProjToWKT;
+	teProjToWKT["Albers"] = "Albers_Conic_Equal_Area";
+	teProjToWKT["LambertConformal"] = "Lambert_Conformal_Conic_1SP";
+	teProjToWKT["Mercator"] = "Mercator_1SP";
+	teProjToWKT["Miller"] = "Miller_Cylindrical";
+	teProjToWKT["UTM"] = "Transverse_Mercator";
+	teProjToWKT["Sinusoidal"] = "Sinusoidal";
+	teProjToWKT["Polyconic"] = "Polyconic";
+	teProjToWKT["CylindricalEquidistant"] = "Equirectangular";
+	teProjToWKT["PolarStereographic"] = "Polar_Stereographic";
+	teProjToWKT["Satellite"] = "Satellite"; //FAMI
+	teProjToWKT["NoProjection"] = "Unknown";
+
+	wkt = "PROJCS[\"" + teproj->name() + "\",";
+	wkt += wktDatum;
+	wkt += ",PROJECTION[\"" + teProjToWKT[teproj->name()] + "\"]";
+
+	TeProjInfo pjInfo = TeProjectionInfo(teproj->name());
+	if (pjInfo.hasLon0)
+		wkt +=",PARAMETER[\"central_meridian\","+ Te2String(teproj->lon0()*TeCRD,6)+"]";
+
+	if (pjInfo.hasLat0)
+		wkt +=",PARAMETER[\"latitude_of_origin\","+ Te2String(teproj->lat0()*TeCRD,6)+"]";
+
+	if (pjInfo.hasStlat1)
+		wkt +=",PARAMETER[\"standard_parallel_1\","+ Te2String(teproj->stLat1()*TeCRD,6)+"]";
+	
+	if (pjInfo.hasStlat2)
+		wkt +=",PARAMETER[\"standard_parallel_2\","+ Te2String(teproj->stLat2()*TeCRD,6)+"]";
+
+	if (pjInfo.hasOffx)
+		wkt +=",PARAMETER[\"false_easting\","+ Te2String(teproj->offX(),6)+"]";
+
+	if (pjInfo.hasOffy)
+		wkt +=",PARAMETER[\"false_northing\","+ Te2String(teproj->offY(),6)+"]";
+
+	if (pjInfo.hasScale)
+		wkt +=",PARAMETER[\"scale_factor\","+ Te2String(teproj->scale(),6)+"]";
+	
+	wkt += ",UNIT[\"meter\",1]]";
+	return wkt;
+}
+
+bool tokenizeWKT(char** wkt, vector<string>& tokens)
+{
+	const char *pszInput =  *wkt;
+	int isInQuote = false;
+	
+	string token = "";
+	int  sizeToken = 0;
+	while (*pszInput != '\0')
+	{
+		if (*pszInput == '"')
+		{
+			isInQuote = !isInQuote;
+		}
+		else if (!isInQuote && 
+				(*pszInput == '[' || *pszInput == ']' || *pszInput == ',' || 
+					*pszInput == '(' || *pszInput == ')' ))
+		{
+			break;
+		}
+		else if (!isInQuote && 
+				(*pszInput == ' ' || *pszInput == '\t' || 
+				*pszInput == 10 || *pszInput == 13))
+		{
+		/* just skip over whitespace */
+		} 
+		else
+		{
+			token += *pszInput;
+			++sizeToken;
+		}
+		pszInput++;
+	}
+	if (*pszInput == '\0')
+		return true;
+		
+	tokens.push_back(token);
+	
+	bool result;  // read sublist
+	if( *pszInput == '[' || *pszInput == '(' )
+	{
+		do
+		{
+			pszInput++; // Skip bracket or comma.
+			result = tokenizeWKT((char **) &pszInput, tokens);
+			if (!result )
+				return result;          
+		}while (*pszInput == ',');
+	
+		if (*pszInput != ')' && *pszInput != ']')
+			return result;
+		pszInput++;
+	}
+	*wkt = (char *) pszInput;
+	return true;
+}
+
+
+
+TeProjection* 
+TeGetTeProjectionFromWKT(const string& wkt)
+{
+	map<string,string> wktToTeProj;
+	wktToTeProj["Albers_Conic_Equal_Area"] = "Albers";
+	wktToTeProj["Lambert_Conformal_Conic_1SP"] = "LambertConformal";
+	wktToTeProj["Mercator_1SP"] = "Mercator";
+	wktToTeProj["Miller_Cylindrical"] = "Miller";
+	wktToTeProj["Transverse_Mercator"] = "UTM";
+	wktToTeProj["Sinusoidal"] = "Sinusoidal";
+	wktToTeProj["Polyconic"] = "Polyconic";
+	wktToTeProj["Equirectangular"] = "CylindricalEquidistant";
+	wktToTeProj["Polar_Stereographic"] = "PolarStereographic";
+	wktToTeProj["Satellite"] = "Satellite"; //FAMI
+
+	TeDatum dat = TeDatumFactory::makeFromWKT(wkt);
+	vector<string> tokens;
+	char* wktchar = new char[wkt.size()];
+	strcpy(wktchar,wkt.c_str());
+	bool res = tokenizeWKT((char **) &wktchar, tokens);
+	if (!res)
+		return 0;
+
+	// geographic coordinates 
+
+	TeProjectionParams par;
+	unsigned int i = 1;
+	bool isProjected = false;
+	if (tokens[0] == "GEOGCS")
+	{
+		isProjected = false;
+		par.name = "LatLong";
+	}
+	else if (tokens[0] == "PROJCS")
+	{
+		isProjected = true;
+	}
+	else
+		return 0;
+	par.datum = dat;
+	if (!isProjected)
+		return TeProjectionFactory::make(par);
+
+	while (i<tokens.size() && tokens[i] != "PROJECTION")
+		++i;
+	if (i== tokens.size())
+		return 0;
+	map<string,string>::iterator it = wktToTeProj.find(tokens[++i]);
+	if (it != wktToTeProj.end())
+		par.name = it->second;
+	else
+		return 0;
+	while (tokens[++i] == "PARAMETER")
+	{
+		++i;
+		if (TeStringCompare(tokens[i],"latitude_of_origin",false))
+			par.lat0 = atof(tokens[++i].c_str())*TeCDR;
+		else if (TeStringCompare(tokens[i],"central_meridian",false))
+			par.lon0 = atof(tokens[++i].c_str())*TeCDR;
+ 		else if (TeStringCompare(tokens[i],"standard_parallel_1",false))
+			par.stlat1 = atof(tokens[++i].c_str())*TeCDR;
+ 		else if (TeStringCompare(tokens[i],"standard_parallel_2",false))
+			par.stlat2 = atof(tokens[++i].c_str())*TeCDR;
+ 		else if (TeStringCompare(tokens[i],"false_easting",false))
+			par.offx = atof(tokens[++i].c_str());
+ 		else if (TeStringCompare(tokens[i],"false_northing",false))
+		{
+			par.offy = atof(tokens[++i].c_str());
+			if(par.offy == 0.0)	par.hemisphere=TeNORTH_HEM;
+			else				par.hemisphere=TeSOUTH_HEM;
+		}
+ 		else if (TeStringCompare(tokens[i],"scale_factor",false))
+			par.scale = atof(tokens[++i].c_str());
+	}
+	return TeProjectionFactory::make(par);
+}
+
diff --git a/src/terralib/kernel/TeProjection.h b/src/terralib/kernel/TeProjection.h
old mode 100755
new mode 100644
index e528c03..9f74141
--- a/src/terralib/kernel/TeProjection.h
+++ b/src/terralib/kernel/TeProjection.h
@@ -1,794 +1,784 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeProjection.h
-    \brief This file contains support do deal with geographical projections
-*/
-
-#ifndef  __TERRALIB_INTERNAL_PROJECTION_H
-#define  __TERRALIB_INTERNAL_PROJECTION_H
-
-#include "TeCoord2D.h"
-#include "TeDefines.h"
-#include "TeDatum.h"
-
-#include <stdio.h>
-#include <map>
-#include <string>
-
-using namespace std;
-
-//! Earth hemispheres 
-enum TeHemisphere
-{ TeNORTH_HEM, TeSOUTH_HEM };
-
-//! Number of supported projections in TerraLib
-const int NUM_PROJ = 12; 
-
-//! Set of informations required by projections
-struct TL_DLL TeProjInfo 
-{
-	int hasUnits;
-	int hasLon0;
-	int hasLat0;
-	int hasStlat1;
-	int hasStlat2;
-	int hasScale;
-	int hasOffx;
-	int hasOffy;
-};
-
-//! A map from name of projections to a set of informations that it requires
-typedef map<string,TeProjInfo> TeProjInfoMap;
-
-//! Returns the set of informations required by a given projection
-TL_DLL TeProjInfo TeProjectionInfo ( const string& projName  );
-
-TL_DLL const char** TeGetProjInfo();
-
-// ============ PROJECTION PARAMETERS ===============
-
-class TeProjection;
-
-//FAMI Added Satellite parameters
-//! Set of parameters that define a geographical projection
-struct TL_DLL TeProjectionParams
-{
-	string	name;	     //!< projection name
-	TeDatum datum;       //!< spheroid
-        double	lon0;	     //!< Longitude of origin (rad)
-	double  lat0;	     //!< Latitude of origin (rad)  
-	double	offx;	     //!< X (projection coordinate) offset (m)
-	double	offy;	     //!< Y (projection coordinate) offset (m)
-	double	stlat1;	     //!< First standard parallel (rad)
-	double  stlat2;      //!< Second standard paralel (rad)
-	string  units;       //!< units
-	double  scale;       //!< projection scale (used in UTM)
-	TeHemisphere hemisphere; //!< Hemisphere
-	double  pri;         //!< Sensor angle resolution along y axis (rad) (used in Satellite)
-	double  prj;         //!< Sensor angle resolution along x axis (rad) (used in Satellite)
-	double  pis;         //!< Y-coordinate of sub-satellite point (used in Satellite)
-	double  pjs;         //!< X-coordinate of sub-satellite point (used in Satellite)
-	double  prs;         //!< Radius of satellite orbit (m) (used in Satellite)
-	double  pscn;        //!< Scanning mode: 0-WE/NS, 1-SN/EW (used in Satellite)
-	double  pyaw;        //!< Grid orientation, i.e., angle in radians between the increasing y axis and the meridian of the sub-satellite point along the direction of increasing latitude (used in Satellite)
-
-};
-
-//========== PROJECTION FACTORY
-//! A factory of projections
-class TL_DLL TeProjectionFactory 
-{
-public:
-	static TeProjection* make( const TeProjectionParams& );
-};
-
-//!  Provides methods that are required to handle all map projection definitions and georeferencing of satellite images.
-/*!
-  Specifies earth and projection parameters that represent a common
-  ground in terms of defining conventional map projections, navigating
-  on low-resolution images of geostationary satellites.
-*/
-class TL_DLL TeProjection 
-{
-protected:
-	string	GPname;	             // projection name
-	TeDatum GPdatum;             // spheroid
-	double	GPlon0;	             // Longitude of origin (rad)
-	double  GPlat0;	             // Latitude of origin (rad)  
-	double	GPoffx;	             // X (projection coordinate) offset (m)
-	double	GPoffy;	             // Y (projection coordinate) offset (m)
-	double	GPstlat1;            // First standard parallel (rad)
-	double  GPstlat2;            // Second standard parallel (rad)
-	string  GPunits;             // units
-	double  GPscale;             // scale (used for UTM)
-	TeHemisphere  GPhemisphere;  // Hemisphere
-	TeProjection* GPdestination; // destination projection
-	int	      GPid;          // id
-
-	//! Changes planimetic datum
-	/*!	Computes changes in geodetic coordinates due to
-		planimetric datum changes. First, the method finds
-		geocentric cartesian coordinates on the initial datum,
-		then applies datum shifts, and finally computes the
-		new geodetic coordinates on the final datum. The new
-		geodetic latitude is computed iteractively, the old
-		geodetic latitude being used as initial guess.
-		
-		\param	x	Initial longitude (rad);
-		\param	y	Initial latitude (rad).
-		\return x	Final longitude (rad);
-		\return y	Final latitude (rad).
-		
-		\note
-			x must be a valid longitude ([0,pi] or [0,-pi]) and
-			y must be a valid latitude ([0,pi/2] or [0,-pi/2]).
-	*/
-	void 	ChangeLL (double &x, double &y); 
-
-public:
-
-	//! Normal constructor
-	/*!	
-		Initializes projection parameters 
-		\param name			projection name
-		\param datum		spheroid
-		\param lon0			longitude of origin (in radians)
-		\param lat0			latitude of origin (in radians)  
-		\param offx			X (projection coordinate) offset (m)
-		\param offy 		Y (projection coordinate) offset (m)
-		\param stlat1		first standard parallel (in radians)
-		\param stlat2		second standard parallel (in radians)
-		\param units		projection unit
-		\param scale		scale (used for UTM)
-		\param hem			hemisphere
-	*/
-	TeProjection ( const string& name, const TeDatum& datum,
-		double lon0 = 0., double lat0=0., double offx = 0., double offy = 0.,
-		double stlat1 = 0., double stlat2 = 0., 
-		const string units = "Meters",
-		double scale = 1., TeHemisphere hem = TeSOUTH_HEM):
-		GPname   ( name ),
-		GPdatum  ( datum ),
-	    GPlon0   ( lon0 ),
-	    GPlat0   ( lat0  ),
-	    GPoffx   ( offx  ),
-	    GPoffy   ( offy ),
-	    GPstlat1 ( stlat1 ),
-	    GPstlat2 ( stlat2 ),
-	    GPunits  ( units ),
-	    GPscale  ( scale ),
-	    GPhemisphere ( hem ),
-		GPdestination (0),
-		GPid(0)
-		{}
-
-		TeProjection ():
-		GPname   ( "NoProjection" ),
-	    GPlon0   ( 0. ),
-	    GPlat0   ( 0. ),
-	    GPoffx   ( 0. ),
-	    GPoffy   ( 0. ),
-	    GPstlat1 ( 0. ),
-	    GPstlat2 ( 0. ),
-	    GPunits  ( "Units" ),
-	    GPscale  ( 1 ),
-	    GPhemisphere ( TeSOUTH_HEM ),
-		GPdestination (0),
-		GPid(0)
-	{}
-
-	//! Copy Constructor
-	TeProjection(const TeProjection&);
-
-	//! Operator =
-	TeProjection& operator=(const TeProjection&);
-
-	//!	Destructor.
-	virtual ~TeProjection (){}
-
-	//! Returns the projection name;
-	string& name() 
-	{ return GPname; }
-
-	//! Returns the projection datum
-	TeDatum datum()
-	{ return GPdatum; }
-
-	//! Sets the datum associated to the projection 
-	void setDatum(const TeDatum& datum)
-	{	GPdatum = datum; }
-
-	//! Return the projection units 
-	string& units()
-	{ return GPunits; }
-
-	//! Return the longitude of origin ( in rad)
-	double	lon0() { return GPlon0;	}
-	
-	//! Return the Latitude of origin (rad)
-	double  lat0() { return GPlat0;	}	  
-
-	//! Return  X (projection coordinate) offset (m)
-	double	offX() { return GPoffx; }	 
-    
-	//! Return  Y (projection coordinate) offset (m)
-	double	offY() { return GPoffy;	 }
-    
-	//!  Return First standard parallel (rad)
-	double	stLat1() { return GPstlat1; }
-	
-	//! Return the second standard parallel (rad)
-	double  stLat2() { return GPstlat2; }
-	
-	//! Return the scale (used for UTM)
-	double  scale()  { return GPscale;   }
-
-	//! Return the  Hemisphere
-	TeHemisphere hemisphere() {	return GPhemisphere; }
-		
-	// Returns a the parameters of this projection
-	virtual TeProjectionParams params () const; //FAMI
-
-	bool operator== (const TeProjection& proj);
-
-	//!	Pure virtual method that transforms geodetic into projection coordinates
-	/*!		
-		This method is implemented for each available
-		projection class and represents the so-called
-		direct formulas, which compute projection 
-		coordinates from geodetic coordinates.
-		 
-		\param	p 	Geodetic coordinates (radian).
-		\return p  	Projection coordinates (m).
-		\note
-			Geodetic coordinates must be a valid latitude
-			([0,pi/2] or [0,-pi/2]) and a valid longitude
-			([0,pi] or [0,-pi]).
-	*/
-	virtual	TeCoord2D LL2PC (TeCoord2D& p) = 0;
-	virtual	void	  LL2PC (ostream&) const {} //FAMI
-
-	//! Pure virtual method that transforms projection into geodetic coordinates.
-	/*!
-		This method is implemented for each available
-		projection class and represents the so-called
-		inverse formulas, which compute geodetic
-		coordinates from projection coordinates.
-		\param p 	Projection coordinates (m).
-		\return p	Geodetic coordinates (rad).
-		\note X and Y projection coordinates must be both valid,
-		 within the typical range of each projection class.
-	*/
-	virtual	TeCoord2D	PC2LL (TeCoord2D& p) = 0;
-
-	virtual	void LL2PC (double, double, double&, double&) const {printf("\nWRONG"); return;} //FAMI
-	virtual	void PC2LL (double, double, double&, double&) {printf("\nWRONG"); return;} //FAMI
-
-	//!	Sets the projection to which a Latitude/Longitude value will be generated by the current projection by calling changeLL in PC2LL method
-	void setDestinationProjection (TeProjection* proj)
-	{ GPdestination = proj; }
-	
-	//! Concrete method that prints information about a projection
-	void print ( FILE* file_ );
-
-	//! Concrete method that prints information about a projection in a string
-	string describe ();
-
-	//! Get projection unique id in the database
-	int	id() { return GPid;}
-
-	//! Set projection unique id in the database
-	void id(int i) { GPid = i;}
-};
-
-
-//!  Provides methods that are required to handle the UTM map projection.
-/*!
-	  Specifies methods that are necessary to establish the relation between
-	  geodetic and UTM coordinates. UTM is a conformal projection system that
-	  uses the planimetric datum Sad69 or Corrego Alegre  (Hayford ellipsoid).
-
-	 \sa TeCoord2D TeDatum TeProjection.
-*/
-class TL_DLL TeUtm : public TeProjection
-{
-public:
-
-	//! Constructor
-	/*!	
-		Initializes projection parameters 
-		\param datum		spheroid
-		\param long0		longitude of origin (in radians)
-		\param lat0		latitude of origin (in radians)  
-		\param offx		X (projection coordinate) offset (m)
-		\param offy 		Y (projection coordinate) offset (m)
-		\param units		projection unit
-		\param scale		scale (used for UTM)
-		\param hemisphere	hemisphere
-	*/
-	TeUtm ( const TeDatum& datum, double long0, double lat0 = 0., 
-		     double offx = 500000., double offy = 10000000., 
-			 const string& units = "Meters",
-			 double scale = 0.9996, TeHemisphere hemisphere = TeSOUTH_HEM ):
-	TeProjection ( "UTM", datum, long0, lat0, offx, offy, 0., 0., units, scale,
-		hemisphere)
-
-	{
-		if ( hemisphere == TeNORTH_HEM )
-			GPoffy = 0.;
-	}
-
-	//! Destructor
-	~TeUtm () {}
-
-	//! This implementation of a pure virtual method defined in Projection transforms geodetic into UTM coordinates.
-	/*!		 
-		\param	p	Geodetic coordinates (rad).
-		\return	p:	UTM coordinates (m).
-		\note
-			Geodetic coordinates must be a valid latitude
-			([0,pi/2] or [0,-pi/2]) and a valid longitude
-			([0,pi] or [0,-pi]). Conventional UTM offsets
-			(500,000 m and 10,000,000 m) are always added
-			to the resulting projection coordinates.
-	*/
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-
-	//!	This implementation of a pure virtual method defined in
-	/*	Projection transforms UTM into geodetic coordinates.
-		\param p:	UTM coordinates (m).
-		\return p:	Geodetic coordinates (rad).
-		\note
-		X and Y UTM coordinates must be both valid, within
-		their typical range. Conventional UTM offsets are
-		handled in this method, and therefore must not be 
-		previously subtracted.
-	*/
-	virtual TeCoord2D PC2LL(TeCoord2D& p);
-};
-
-//!  Provides methods that are required to handle Lambert conformal conic map projection..
-/*!
-  Specifies methods that are necessary to establish the relation between
-  geodetic and Lambert conformal conic coordinates. 
-  \sa TeCoord2D TeDatum TeProjection.
-*/
-class TL_DLL TeLambertConformal : public TeProjection
-{
-public :
-	//! Constructor
-	/*!	
-		Initializes projection parameters 
-		\param datum		spheroid
-		\param long0		longitude of origin (in radians)
-		\param lat0		latitude of origin (in radians)  
-		\param offx		X (projection coordinate) offset (m)
-		\param offy 		Y (projection coordinate) offset (m)
-		\param stlat1		first standard parallel (in radians)
-		\param stlat2		second standard parallel (in radians)
-		\param units		projection unit
-	*/
-	TeLambertConformal ( const TeDatum& datum, 
-		                 double long0,
-			             double lat0, 
-						 double offx, 
-						 double offy,
-						 double stlat1, 
-						 double stlat2, 
-						 const string& units = "Meters" ):
-	TeProjection ( "LambertConformal", datum, long0, lat0, offx, offy, stlat1, stlat2, units)
-	{}
-
-	//! Destructor
-	~TeLambertConformal () {}
-
-
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-
-	virtual	TeCoord2D PC2LL(TeCoord2D& p);
-};
-
-//!  Provides methods that are required to handle the Mercator map projection.
-/*! 
-  Specifies methods that are necessary to establish the relation between
-  geodetic and Mercator coordinates.  
-*/
-class TL_DLL TeMercator : public TeProjection
-{
-
-public:
-	//! Constructor
-	/*!	
-		Initializes projection parameters 
-		\param datum		spheroid
-		\param long0			longitude of origin (in radians)
-		\param lat0			latitude of origin (in radians)  
-		\param offx			X (projection coordinate) offset (m)
-		\param offy 		Y (projection coordinate) offset (m)
-		\param stlat1		first standard parallel (in radians)
-		\param units		projection unit
-	*/
-	TeMercator ( const TeDatum& datum,  
-		         double long0, 
-				 double lat0 = 0.,
-				 double offx = 0., 
-				 double offy = 0.,
-				 double stlat1 = 0.,
-				 const string& units = "Meters"): 
-	TeProjection ( "Mercator", datum, long0, lat0, offx, offy, stlat1, 0., units )
-	{}
-
-	//! Destructor
-	~TeMercator () {}
-
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-
-	virtual TeCoord2D PC2LL(TeCoord2D& p);
-
-};
-
-
-
-//! Provides methods that are required to handle the Polyconic map projection.
-/*!  
-	Specifies methods that are necessary to establish the relation between
-    geodetic and Polyconic coordinates. Polyconic is a projection system that
-    is neither conformal nor equal-area. 
-*/  
-class TL_DLL TePolyconic : public TeProjection
-{
-public:
-	//! Constructor
-	/*!	
-		Initializes projection parameters 
-		\param datum		spheroid
-		\param long0			longitude of origin (in radians)
-		\param lat0			latitude of origin (in radians)  
-		\param offx			X (projection coordinate) offset (m)
-		\param offy 		Y (projection coordinate) offset (m)
-		\param units		projection unit
-	*/
-	TePolyconic (const TeDatum& datum,  
-		         double long0, 
-				 double lat0 = 0.,
-				 double offx = 0., 
-				 double offy = 0.,
-				 const string& units = "Meters"): 
-	TeProjection ( "Polyconic", datum, long0, lat0, offx, offy, 0., 0., units )
-	{}  
-
-	//! Destructor
-	~TePolyconic () {}
-
-
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-
-	virtual TeCoord2D PC2LL(TeCoord2D& p);
-};
-
-//!  Provides methods that are required to handle the Equidistant Cylindrical  map projection.
-class TL_DLL TeLatLong : public TeProjection
-{
-
-public :
-	//! Constructor
-	/*!	
-		Initializes projection parameters 
-		\param datum		spheroid
-		\param units		projection unit
-	*/
-	TeLatLong( const TeDatum& datum, const string& units = "DecimalDegrees" ):
-	   TeProjection ( "LatLong", datum, 0., 0., 0., 0., 0., 0., units )
-	{}
-
-	//! Destructor
-	~TeLatLong () {}
-
-	//! Returns the same coordinate
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-
-	//! Returns the same coordinate
-	virtual TeCoord2D PC2LL(TeCoord2D& p);
-
-	virtual void LL2PC(double xi, double yi, double& xo, double& yo) const; //FAMI
-	virtual void PC2LL(double xi, double yi, double& xo, double& yo); //FAMI
-
-};
-
-//!  Provides methods that are required to handle the Albers Conic map  projection.
-/*
-  Specifies methods that are necessary to establish the relation between
-  geodetic and Albers Conic coordinates. Albers Conic is an equal-area
-  projection system. 
-*/
-class TL_DLL TeAlbers : public TeProjection
-{
-public:
-	//! Constructor
-	/*!	
-		Initializes projection parameters 
-		\param datum		spheroid
-		\param lon0			longitude of origin (in radians)
-		\param lat0			latitude of origin (in radians)  
-		\param offx			X (projection coordinate) offset (m)
-		\param offy 		Y (projection coordinate) offset (m)
-		\param stlat1		first standard parallel (in radians)
-		\param stlat2		second standard parallel (in radians)
-		\param units		projection unit
-	*/
-	TeAlbers( const TeDatum& datum, 
-		      double lon0,
-			  double lat0, 
-			  double offx, 
-			  double offy,
-			  double stlat1, 
-			  double stlat2, 
-			  const string& units = "Meters" ):
-		TeProjection ( "Albers", datum, lon0, lat0, offx, offy, stlat1, stlat2, units )
-	{} 
-
-	//! Destructor
-	~TeAlbers () { }
-
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-
-	virtual TeCoord2D PC2LL(TeCoord2D& p);
-};
-
-//!  Provides methods that are required to handle the Miller map projection.
-/*!
-  Specifies methods that are necessary to establish the relation between
-  geodetic and Miller coordinates. Miller is a projection system that
-  is neither conformal nor equal-area."
-*/
-class TL_DLL TeMiller : public TeProjection	
-{
-public:
-	//! Constructor
-	/*!	
-		Initializes projection parameters 
-		\param datum		spheroid
-		\param long0		longitude of origin (in radians)
-		\param offx			X (projection coordinate) offset (m)
-		\param offy 		Y (projection coordinate) offset (m)
-		\param units		projection unit
-	*/
-	TeMiller ( const TeDatum& datum,  
-		         double long0, 
-				 double offx = 0., 
-				 double offy = 0.,
-				 const string& units = "Meters"): 
-	TeProjection ( "Miller", datum, long0, 0., offx, offy, 0., 0., units )
-	{}
-
-	//! Destructor
-	~TeMiller () {}
-
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-
-	virtual TeCoord2D PC2LL(TeCoord2D& p);
-
-};
-
-//! Provides methods that are required to handle the Sinusoidal map projection.
-/*!
-  Specifies methods that are necessary to establish the relation between
-  geodetic and Sinusoidal coordinates. Sinusoidal is a projection system that
-  is equal-area. Being not an interrupted form, 
-  this implementation assumes a single central meridian. Spheroid options 
-  can be redefined by editing the file "TeDatum.cpp"
-*/
-class TL_DLL TeSinusoidal : public TeProjection	
-{
-public:
-
-//!	Constructor.
-	/*!	
-		Initializes projection parameters 
-		\param datum		spheroid
-		\param long0		longitude of origin (in radians)
-		\param offx			X (projection coordinate) offset (m)
-		\param offy 		Y (projection coordinate) offset (m)
-		\param units		projection unit
-	*/
-	TeSinusoidal (const TeDatum& datum,  
-		         double long0, 
-				 double offx = 0., 
-				 double offy = 0.,
-				 const string& units = "Meters"): 
-	TeProjection ( "Sinusoidal", datum, long0, 0., offx, offy, 0., 0., units )
-	{}
-
-//! Empty destructor.
-	~TeSinusoidal () {}
-
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-
-	virtual TeCoord2D PC2LL(TeCoord2D& p);
-};
-
-//! Provides methods that are required to handle the Cylindrical Equidistant map projection
-class TL_DLL TeCylindricalEquidistant : public TeProjection
-{
-public:
-
-//!	Constructor.
-	/*!	
-		Initializes projection parameters 
-		\param datum		spheroid
-		\param lon0			longitude of origin (in radians)
-		\param offx			X (projection coordinate) offset (m)
-		\param offy 		Y (projection coordinate) offset (m)
-		\param stlat1		first standard parallel (in radians)
-		\param units		projection unit
-	*/
-	TeCylindricalEquidistant (const TeDatum& datum,  
-		         double lon0, 
-				 double offx = 0., 
-				 double offy = 0.,
-				 double stlat1 = 0.,
-				 const string& units = "Meters"):
-			TeProjection ( "CylindricalEquidistant", datum, lon0, 0., offx, offy, stlat1, 0,units)
-		{}
-//! Empty destructor.
-	~TeCylindricalEquidistant () {}
-
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-
-	virtual TeCoord2D PC2LL(TeCoord2D& p);
-};
-
-//! Provides methods that are required to handle the Polar Stereographic map projection
-class TL_DLL TePolarStereographic : public TeProjection
-{
-public:
-	//! Constructor
-	/*!	
-		Initializes projection parameters 
-		\param datum		spheroid
-		\param lon0			longitude of origin (in radians)
-		\param offx			X (projection coordinate) offset (m)
-		\param offy 		Y (projection coordinate) offset (m)
-		\param units		projection unit
-		\param hem	hemisphere
-	*/
-	TePolarStereographic ( const TeDatum& datum,  
-		         double lon0,  
-				 double offx = 0., 
-				 double offy = 0.,
-				 const string& units = "Meters",
-				 const TeHemisphere hem = TeSOUTH_HEM ):
-	TeProjection ( "PolarStereographic", datum, lon0, 0., offx, offy, 0, 0, units, 1, hem )
-	{}
-
-	//! Destructor
-	~TePolarStereographic () {}
-
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-	virtual	void	LL2PC (ostream&) const; //FAMI
-	virtual TeCoord2D PC2LL(TeCoord2D& p);
-
-	virtual void LL2PC(double xi, double yi, double& xo, double& yo) const; //FAMI
-};
-
-//FAMI
-class TL_DLL TeSatelliteProjection : public TeProjection
-{
-
-private:
-	
-	double	SPri,	// Sensor angle resolution along y axis in radians
-		SPrj,	// Sensor angle resolution along x axis in radians
-		SPis,	// Y-coordinate of sub-satellite point 
-		SPjs,	// X-coordinate of sub-satellite point
-	        SPrs,   // Radius of satellite orbit in meters
-		SPscn,	// Scanning mode: 0-WE/NS, 1-SN/EW
-		SPyaw;  // Grid orientation, i.e., angle in radians between
-			// the increasing y axis and the meridian of the
-			// sub-satellite point along the direction of
-			// increasing latitude.
-public:
-
-	//! Constructor
-	/*
-		\param datum: 	planimetric datum
-		\param offx: 	x offset
-		\param offy: 	y offset
-		\param Pri:     Sensor angle resolution along y axis in radians
-		\param Prj: 	Sensor angle resolution along x axis in radians
-		\param Pis:     Y-coordinate of sub-satellite point 
-		\param Pjs: 	X-coordinate of sub-satellite point
-		\param Pla0: 	Latitude of sub-satellite point in radians
-		\param Plo0: 	Longitude of sub-satellite point in radians
-		\param Prs: 	Radius of satellite orbit in meters
-		\param Pscn: 	Scanning mode: 0-WE/NS, 1-SN/EW
-		\param Pyaw: 	Grid orientation, i.e., angle in radians between
-				the increasing y axis and the meridian of the
-				sub-satellite point along the direction of
-				increasing latitude.
-		*/
-	TeSatelliteProjection(const TeDatum& datum, double offx, double offy,  
-			      double Pri, double Prj, double Pis, double Pjs, double Pla0, double Plon0, 
-			      double Prs,double Pscn, double Pyaw):
-			TeProjection("Satellite", datum, Plon0, Pla0, offx, offy, 0., 0.,"Meters",1.,TeSOUTH_HEM),
-			SPri(Pri),
-			SPrj(Prj),
-			SPis(Pis),
-			SPjs(Pjs),		
-			SPrs(Prs),
-			SPscn(Pscn),
-			SPyaw(Pyaw)	{}
-
-	~TeSatelliteProjection() {}
-
-	virtual TeCoord2D LL2PC(TeCoord2D& p);
-
-	virtual	TeCoord2D PC2LL(TeCoord2D& p);
-
-	// Returns a the parameters of this projection
-	virtual TeProjectionParams params () const;
-};
-
-class TL_DLL TeNoProjection : public TeProjection
-{
-public:
-	TeNoProjection(const TeDatum& datum = TeDatum(), const string& units = "Units"):
-		TeProjection ( "NoProjection", datum, 0., 0., 0., 0., 0, 0, units, 1, TeSOUTH_HEM )
-
-	{	GPname = "NoProjection", GPunits = units; }
-
-		~TeNoProjection () {}
-
-		virtual TeCoord2D LL2PC(TeCoord2D& p) { return p; }
-
-		virtual TeCoord2D PC2LL(TeCoord2D& p) {return p;};
-};
-
-bool TL_DLL decodifyDescription(const string& projDescription, TeProjectionParams& pars);
-
-//! Creates a TeProjection instance from a PROJ4 description
-/*
-	\note This function works only for sproj descriptionsgenerated by TerraLib
-*/
-TL_DLL TeProjection* TeGetTeProjectionFromSProj(const string& sproj4desc);
-
-//! Generates a PROJ4 description from a TerraLib instance
-TL_DLL string TeGetSProjFromTeProjection(TeProjection* teproj);
-
-//! Generates OGC WKT Spatial Reference description from a TerraLib instance
-TL_DLL string TeGetWKTFromTeProjection(TeProjection* proj);
-
-//! Creates a TeProjection instance from a OGC WKT Spatial Reference description
-/*
-	\note This function works only for sproj descriptions generated by TerraLib
-*/
-TL_DLL TeProjection* TeGetTeProjectionFromWKT(const string& wkt);
-
-/** \example convertCoordinates.cpp
- * This is an example of how to convert a coordinate from a projection to another
- */
-
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeProjection.h
+    \brief This file contains support do deal with geographical projections
+*/
+
+#ifndef  __TERRALIB_INTERNAL_PROJECTION_H
+#define  __TERRALIB_INTERNAL_PROJECTION_H
+
+#include "TeCoord2D.h"
+#include "TeDefines.h"
+#include "TeDatum.h"
+
+#include <stdio.h>
+#include <map>
+#include <string>
+
+using namespace std;
+
+//! Earth hemispheres 
+enum TeHemisphere
+{ TeNORTH_HEM, TeSOUTH_HEM };
+
+//! Number of supported projections in TerraLib
+const int NUM_PROJ = 12; 
+
+//! Set of informations required by projections
+struct TL_DLL TeProjInfo 
+{
+	int hasUnits;
+	int hasLon0;
+	int hasLat0;
+	int hasStlat1;
+	int hasStlat2;
+	int hasScale;
+	int hasOffx;
+	int hasOffy;
+};
+
+//! A map from name of projections to a set of informations that it requires
+typedef map<string,TeProjInfo> TeProjInfoMap;
+
+//! Returns the set of informations required by a given projection
+TL_DLL TeProjInfo TeProjectionInfo ( const string& projName  );
+
+TL_DLL const char** TeGetProjInfo();
+
+// ============ PROJECTION PARAMETERS ===============
+
+class TeProjection;
+
+//FAMI Added Satellite parameters
+//! Set of parameters that define a geographical projection
+struct TL_DLL TeProjectionParams
+{
+	string	name;	     //!< projection name
+	TeDatum datum;       //!< spheroid
+        double	lon0;	     //!< Longitude of origin (rad)
+	double  lat0;	     //!< Latitude of origin (rad)  
+	double	offx;	     //!< X (projection coordinate) offset (m)
+	double	offy;	     //!< Y (projection coordinate) offset (m)
+	double	stlat1;	     //!< First standard parallel (rad)
+	double  stlat2;      //!< Second standard paralel (rad)
+	string  units;       //!< units
+	double  scale;       //!< projection scale (used in UTM)
+	TeHemisphere hemisphere; //!< Hemisphere
+	double  pri;         //!< Sensor angle resolution along y axis (rad) (used in Satellite)
+	double  prj;         //!< Sensor angle resolution along x axis (rad) (used in Satellite)
+	double  pis;         //!< Y-coordinate of sub-satellite point (used in Satellite)
+	double  pjs;         //!< X-coordinate of sub-satellite point (used in Satellite)
+	double  prs;         //!< Radius of satellite orbit (m) (used in Satellite)
+	double  pscn;        //!< Scanning mode: 0-WE/NS, 1-SN/EW (used in Satellite)
+	double  pyaw;        //!< Grid orientation, i.e., angle in radians between the increasing y axis and the meridian of the sub-satellite point along the direction of increasing latitude (used in Satellite)
+
+};
+
+//========== PROJECTION FACTORY
+//! A factory of projections
+class TL_DLL TeProjectionFactory 
+{
+public:
+  static TeProjection* make( const TeProjectionParams& );
+  static TeProjection* make(int epsgCode);
+};
+
+//!  Provides methods that are required to handle all map projection definitions and georeferencing of satellite images.
+/*!
+  Specifies earth and projection parameters that represent a common
+  ground in terms of defining conventional map projections, navigating
+  on low-resolution images of geostationary satellites.
+*/
+class TL_DLL TeProjection 
+{
+protected:
+	string	GPname;	             // projection name
+	TeDatum GPdatum;             // spheroid
+	double	GPlon0;	             // Longitude of origin (rad)
+	double  GPlat0;	             // Latitude of origin (rad)  
+	double	GPoffx;	             // X (projection coordinate) offset (m)
+	double	GPoffy;	             // Y (projection coordinate) offset (m)
+	double	GPstlat1;            // First standard parallel (rad)
+	double  GPstlat2;            // Second standard parallel (rad)
+	string  GPunits;             // units
+	double  GPscale;             // scale (used for UTM)
+	TeHemisphere  GPhemisphere;  // Hemisphere
+	TeProjection* GPdestination; // destination projection
+	int	      GPid;          // id
+    int		GPepsgCode;
+
+	//! Changes planimetic datum
+	/*!	Computes changes in geodetic coordinates due to
+		planimetric datum changes. First, the method finds
+		geocentric cartesian coordinates on the initial datum,
+		then applies datum shifts, and finally computes the
+		new geodetic coordinates on the final datum. The new
+		geodetic latitude is computed iteractively, the old
+		geodetic latitude being used as initial guess.
+		
+		\param	x	Initial longitude (rad);
+		\param	y	Initial latitude (rad).
+		\return x	Final longitude (rad);
+		\return y	Final latitude (rad).
+		
+		\note
+			x must be a valid longitude ([0,pi] or [0,-pi]) and
+			y must be a valid latitude ([0,pi/2] or [0,-pi/2]).
+	*/
+	void 	ChangeLL (double &x, double &y); 
+
+public:
+
+	//! Normal constructor
+	/*!	
+		Initializes projection parameters 
+		\param name			projection name
+		\param datum		spheroid
+		\param lon0			longitude of origin (in radians)
+		\param lat0			latitude of origin (in radians)  
+		\param offx			X (projection coordinate) offset (m)
+		\param offy 		Y (projection coordinate) offset (m)
+		\param stlat1		first standard parallel (in radians)
+		\param stlat2		second standard parallel (in radians)
+		\param units		projection unit
+		\param scale		scale (used for UTM)
+		\param hem			hemisphere
+	*/
+	TeProjection ( const string& name, const TeDatum& datum,
+		double lon0 = 0., double lat0=0., double offx = 0., double offy = 0.,
+		double stlat1 = 0., double stlat2 = 0., 
+		const string units = "Meters",
+		double scale = 1., TeHemisphere hem = TeSOUTH_HEM, int epsgcode = 99999):
+		GPname   ( name ),
+		GPdatum  ( datum ),
+	    GPlon0   ( lon0 ),
+	    GPlat0   ( lat0  ),
+	    GPoffx   ( offx  ),
+	    GPoffy   ( offy ),
+	    GPstlat1 ( stlat1 ),
+	    GPstlat2 ( stlat2 ),
+	    GPunits  ( units ),
+	    GPscale  ( scale ),
+	    GPhemisphere ( hem ),
+		GPdestination (0),
+		GPid(0),
+        GPepsgCode(epsgcode)
+		{}
+
+		TeProjection ():
+		GPname   ( "NoProjection" ),
+	    GPlon0   ( 0. ),
+	    GPlat0   ( 0. ),
+	    GPoffx   ( 0. ),
+	    GPoffy   ( 0. ),
+	    GPstlat1 ( 0. ),
+	    GPstlat2 ( 0. ),
+	    GPunits  ( "Units" ),
+	    GPscale  ( 1 ),
+	    GPhemisphere ( TeSOUTH_HEM ),
+		GPdestination (0),
+		GPid(0),
+		GPepsgCode(99999)
+	{}
+
+	//! Copy Constructor
+	TeProjection(const TeProjection&);
+
+	//! Operator =
+	TeProjection& operator=(const TeProjection&);
+
+	//!	Destructor.
+	virtual ~TeProjection (){}
+
+	//! Returns the projection name;
+	string& name() 
+	{ return GPname; }
+
+	//! Returns the projection datum
+	TeDatum datum()
+	{ return GPdatum; }
+
+	//! Sets the datum associated to the projection 
+	void setDatum(const TeDatum& datum)
+	{	GPdatum = datum; }
+
+	//! Return the projection units 
+	string& units()
+	{ return GPunits; }
+
+	//! Return the longitude of origin ( in rad)
+	double	lon0() { return GPlon0;	}
+	
+	//! Return the Latitude of origin (rad)
+	double  lat0() { return GPlat0;	}	  
+
+	//! Return  X (projection coordinate) offset (m)
+	double	offX() { return GPoffx; }	 
+    
+	//! Return  Y (projection coordinate) offset (m)
+	double	offY() { return GPoffy;	 }
+    
+	//!  Return First standard parallel (rad)
+	double	stLat1() { return GPstlat1; }
+	
+	//! Return the second standard parallel (rad)
+	double  stLat2() { return GPstlat2; }
+	
+	//! Return the scale (used for UTM)
+	double  scale()  { return GPscale;   }
+	
+	int epsgCode();
+
+	//! Return the  Hemisphere
+	TeHemisphere hemisphere() {	return GPhemisphere; }
+		
+	// Returns a the parameters of this projection
+	virtual TeProjectionParams params () const; //FAMI
+
+	bool operator== (const TeProjection& proj);
+
+	//!	Pure virtual method that transforms geodetic into projection coordinates
+	/*!		
+		This method is implemented for each available
+		projection class and represents the so-called
+		direct formulas, which compute projection 
+		coordinates from geodetic coordinates.
+		 
+		\param	p 	Geodetic coordinates (radian).
+		\return p  	Projection coordinates (m).
+		\note
+			Geodetic coordinates must be a valid latitude
+			([0,pi/2] or [0,-pi/2]) and a valid longitude
+			([0,pi] or [0,-pi]).
+	*/
+	virtual	TeCoord2D LL2PC (const TeCoord2D& p) = 0;
+	virtual	void	  LL2PC (ostream&) const {} //FAMI
+
+	//! Pure virtual method that transforms projection into geodetic coordinates.
+	/*!
+		This method is implemented for each available
+		projection class and represents the so-called
+		inverse formulas, which compute geodetic
+		coordinates from projection coordinates.
+		\param p 	Projection coordinates (m).
+		\return p	Geodetic coordinates (rad).
+		\note X and Y projection coordinates must be both valid,
+		 within the typical range of each projection class.
+	*/
+	virtual	TeCoord2D	PC2LL (const TeCoord2D& p) = 0;
+
+	virtual	void LL2PC (double, double, double&, double&) const {printf("\nWRONG"); return;} //FAMI
+	virtual	void PC2LL (double, double, double&, double&) {printf("\nWRONG"); return;} //FAMI
+
+	//!	Sets the projection to which a Latitude/Longitude value will be generated by the current projection by calling changeLL in PC2LL method
+	void setDestinationProjection (TeProjection* proj)
+	{ GPdestination = proj; }
+	
+	//! Concrete method that prints information about a projection
+	void print ( FILE* file_ );
+
+	//! Concrete method that prints information about a projection in a string
+	string describe ();
+
+	//! Get projection unique id in the database
+	int	id() { return GPid;}
+
+	//! Set projection unique id in the database
+	void id(int i) { GPid = i;}
+};
+
+
+//!  Provides methods that are required to handle the UTM map projection.
+/*!
+	  Specifies methods that are necessary to establish the relation between
+	  geodetic and UTM coordinates. UTM is a conformal projection system that
+	  uses the planimetric datum Sad69 or Corrego Alegre  (Hayford ellipsoid).
+
+	 \sa TeCoord2D TeDatum TeProjection.
+*/
+class TL_DLL TeUtm : public TeProjection
+{
+public:
+
+	//! Constructor
+	/*!	
+		Initializes projection parameters 
+		\param datum		spheroid
+		\param long0		longitude of origin (in radians)
+		\param lat0		latitude of origin (in radians)  
+		\param offx		X (projection coordinate) offset (m)
+		\param offy 		Y (projection coordinate) offset (m)
+		\param units		projection unit
+		\param scale		scale (used for UTM)
+		\param hemisphere	hemisphere
+	*/
+	TeUtm ( const TeDatum& datum, double long0, double lat0 = 0., 
+		     double offx = 500000., double offy = 10000000., 
+			 const string& units = "Meters",
+			 double scale = 0.9996, TeHemisphere hemisphere = TeSOUTH_HEM );
+	//! Destructor
+	~TeUtm () {}
+
+	//! This implementation of a pure virtual method defined in Projection transforms geodetic into UTM coordinates.
+	/*!		 
+		\param	p	Geodetic coordinates (rad).
+		\return	p:	UTM coordinates (m).
+		\note
+			Geodetic coordinates must be a valid latitude
+			([0,pi/2] or [0,-pi/2]) and a valid longitude
+			([0,pi] or [0,-pi]). Conventional UTM offsets
+			(500,000 m and 10,000,000 m) are always added
+			to the resulting projection coordinates.
+	*/
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+
+	//!	This implementation of a pure virtual method defined in
+	/*	Projection transforms UTM into geodetic coordinates.
+		\param p:	UTM coordinates (m).
+		\return p:	Geodetic coordinates (rad).
+		\note
+		X and Y UTM coordinates must be both valid, within
+		their typical range. Conventional UTM offsets are
+		handled in this method, and therefore must not be 
+		previously subtracted.
+	*/
+	virtual TeCoord2D PC2LL(const TeCoord2D& p);
+};
+
+//!  Provides methods that are required to handle Lambert conformal conic map projection..
+/*!
+  Specifies methods that are necessary to establish the relation between
+  geodetic and Lambert conformal conic coordinates. 
+  \sa TeCoord2D TeDatum TeProjection.
+*/
+class TL_DLL TeLambertConformal : public TeProjection
+{
+public :
+	//! Constructor
+	/*!	
+		Initializes projection parameters 
+		\param datum		spheroid
+		\param long0		longitude of origin (in radians)
+		\param lat0		latitude of origin (in radians)  
+		\param offx		X (projection coordinate) offset (m)
+		\param offy 		Y (projection coordinate) offset (m)
+		\param stlat1		first standard parallel (in radians)
+		\param stlat2		second standard parallel (in radians)
+		\param units		projection unit
+	*/
+	TeLambertConformal ( const TeDatum& datum, 
+		                 double long0,
+			             double lat0, 
+						 double offx, 
+						 double offy,
+						 double stlat1, 
+						 double stlat2, 
+						 const string& units = "Meters" ):
+	TeProjection ( "LambertConformal", datum, long0, lat0, offx, offy, stlat1, stlat2, units, 1., TeSOUTH_HEM, 9802)
+	{}
+
+	//! Destructor
+	~TeLambertConformal () {}
+
+
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+
+	virtual	TeCoord2D PC2LL(const TeCoord2D& p);
+};
+
+//!  Provides methods that are required to handle the Mercator map projection.
+/*! 
+  Specifies methods that are necessary to establish the relation between
+  geodetic and Mercator coordinates.  
+*/
+class TL_DLL TeMercator : public TeProjection
+{
+
+public:
+	//! Constructor
+	/*!	
+		Initializes projection parameters 
+		\param datum		spheroid
+		\param long0			longitude of origin (in radians)
+		\param lat0			latitude of origin (in radians)  
+		\param offx			X (projection coordinate) offset (m)
+		\param offy 		Y (projection coordinate) offset (m)
+		\param stlat1		first standard parallel (in radians)
+		\param units		projection unit
+	*/
+	TeMercator ( const TeDatum& datum,  
+		         double long0, 
+				 double lat0 = 0.,
+				 double offx = 0., 
+				 double offy = 0.,
+				 double stlat1 = 0.,
+				 const string& units = "Meters"): 
+	TeProjection ( "Mercator", datum, long0, lat0, offx, offy, stlat1, 0., units,1., TeSOUTH_HEM, 9805)
+	{}
+
+	//! Destructor
+	~TeMercator () {}
+
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+
+	virtual TeCoord2D PC2LL(const TeCoord2D& p);
+
+};
+
+
+
+//! Provides methods that are required to handle the Polyconic map projection.
+/*!  
+	Specifies methods that are necessary to establish the relation between
+    geodetic and Polyconic coordinates. Polyconic is a projection system that
+    is neither conformal nor equal-area. 
+*/  
+class TL_DLL TePolyconic : public TeProjection
+{
+public:
+	//! Constructor
+	/*!	
+		Initializes projection parameters 
+		\param datum		spheroid
+		\param long0			longitude of origin (in radians)
+		\param lat0			latitude of origin (in radians)  
+		\param offx			X (projection coordinate) offset (m)
+		\param offy 		Y (projection coordinate) offset (m)
+		\param units		projection unit
+	*/
+	TePolyconic (const TeDatum& datum,  
+		         double long0, 
+				 double lat0 = 0.,
+				 double offx = 0., 
+				 double offy = 0.,
+				 const string& units = "Meters");
+	
+	//! Destructor
+	~TePolyconic () {}
+
+
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+
+	virtual TeCoord2D PC2LL(const TeCoord2D& p);
+};
+
+//!  Provides methods that are required to handle the Equidistant Cylindrical  map projection.
+class TL_DLL TeLatLong : public TeProjection
+{
+
+public :
+	//! Constructor
+	/*!	
+		Initializes projection parameters 
+		\param datum		spheroid
+		\param units		projection unit
+	*/
+	TeLatLong( const TeDatum& datum, const string& units = "DecimalDegrees" );
+
+	//! Destructor
+	~TeLatLong () {}
+
+	//! Returns the same coordinate
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+
+	//! Returns the same coordinate
+	virtual TeCoord2D PC2LL(const TeCoord2D& p);
+
+	virtual void LL2PC(double xi, double yi, double& xo, double& yo) const; //FAMI
+	virtual void PC2LL(double xi, double yi, double& xo, double& yo); //FAMI
+
+};
+
+//!  Provides methods that are required to handle the Albers Conic map  projection.
+/*
+  Specifies methods that are necessary to establish the relation between
+  geodetic and Albers Conic coordinates. Albers Conic is an equal-area
+  projection system. 
+*/
+class TL_DLL TeAlbers : public TeProjection
+{
+public:
+	//! Constructor
+	/*!	
+		Initializes projection parameters 
+		\param datum		spheroid
+		\param lon0			longitude of origin (in radians)
+		\param lat0			latitude of origin (in radians)  
+		\param offx			X (projection coordinate) offset (m)
+		\param offy 		Y (projection coordinate) offset (m)
+		\param stlat1		first standard parallel (in radians)
+		\param stlat2		second standard parallel (in radians)
+		\param units		projection unit
+	*/
+	TeAlbers( const TeDatum& datum, 
+		      double lon0,
+			  double lat0, 
+			  double offx, 
+			  double offy,
+			  double stlat1, 
+			  double stlat2, 
+			  const string& units = "Meters" ):
+		TeProjection ( "Albers", datum, lon0, lat0, offx, offy, stlat1, stlat2, units, 1, TeSOUTH_HEM, 9822 )
+	{} 
+
+	//! Destructor
+	~TeAlbers () { }
+
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+
+	virtual TeCoord2D PC2LL(const TeCoord2D& p);
+};
+
+//!  Provides methods that are required to handle the Miller map projection.
+/*!
+  Specifies methods that are necessary to establish the relation between
+  geodetic and Miller coordinates. Miller is a projection system that
+  is neither conformal nor equal-area."
+*/
+class TL_DLL TeMiller : public TeProjection	
+{
+public:
+	//! Constructor
+	/*!	
+		Initializes projection parameters 
+		\param datum		spheroid
+		\param long0		longitude of origin (in radians)
+		\param offx			X (projection coordinate) offset (m)
+		\param offy 		Y (projection coordinate) offset (m)
+		\param units		projection unit
+	*/
+	TeMiller ( const TeDatum& datum,  
+		         double long0, 
+				 double offx = 0., 
+				 double offy = 0.,
+				 const string& units = "Meters"): 
+	TeProjection ( "Miller", datum, long0, 0., offx, offy, 0., 0., units )
+	{}
+
+	//! Destructor
+	~TeMiller () {}
+
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+
+	virtual TeCoord2D PC2LL(const TeCoord2D& p);
+
+};
+
+//! Provides methods that are required to handle the Sinusoidal map projection.
+/*!
+  Specifies methods that are necessary to establish the relation between
+  geodetic and Sinusoidal coordinates. Sinusoidal is a projection system that
+  is equal-area. Being not an interrupted form, 
+  this implementation assumes a single central meridian. Spheroid options 
+  can be redefined by editing the file "TeDatum.cpp"
+*/
+class TL_DLL TeSinusoidal : public TeProjection	
+{
+public:
+
+//!	Constructor.
+	/*!	
+		Initializes projection parameters 
+		\param datum		spheroid
+		\param long0		longitude of origin (in radians)
+		\param offx			X (projection coordinate) offset (m)
+		\param offy 		Y (projection coordinate) offset (m)
+		\param units		projection unit
+	*/
+	TeSinusoidal (const TeDatum& datum,  
+		         double long0, 
+				 double offx = 0., 
+				 double offy = 0.,
+				 const string& units = "Meters"): 
+	TeProjection ( "Sinusoidal", datum, long0, 0., offx, offy, 0., 0., units )
+	{}
+
+//! Empty destructor.
+	~TeSinusoidal () {}
+
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+
+	virtual TeCoord2D PC2LL(const TeCoord2D& p);
+};
+
+//! Provides methods that are required to handle the Cylindrical Equidistant map projection
+class TL_DLL TeCylindricalEquidistant : public TeProjection
+{
+public:
+
+//!	Constructor.
+	/*!	
+		Initializes projection parameters 
+		\param datum		spheroid
+		\param lon0			longitude of origin (in radians)
+		\param offx			X (projection coordinate) offset (m)
+		\param offy 		Y (projection coordinate) offset (m)
+		\param stlat1		first standard parallel (in radians)
+		\param units		projection unit
+	*/
+	TeCylindricalEquidistant (const TeDatum& datum,  
+		         double lon0, 
+				 double offx = 0., 
+				 double offy = 0.,
+				 double stlat1 = 0.,
+				 const string& units = "Meters");
+//! Empty destructor.
+	~TeCylindricalEquidistant () {}
+
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+
+	virtual TeCoord2D PC2LL(const TeCoord2D& p);
+};
+
+//! Provides methods that are required to handle the Polar Stereographic map projection
+class TL_DLL TePolarStereographic : public TeProjection
+{
+public:
+	//! Constructor
+	/*!	
+		Initializes projection parameters 
+		\param datum		spheroid
+		\param lon0			longitude of origin (in radians)
+		\param offx			X (projection coordinate) offset (m)
+		\param offy 		Y (projection coordinate) offset (m)
+		\param units		projection unit
+		\param hem	hemisphere
+	*/
+	TePolarStereographic ( const TeDatum& datum,  
+		         double lon0,  
+				 double offx = 0., 
+				 double offy = 0.,
+				 const string& units = "Meters",
+				 const TeHemisphere hem = TeSOUTH_HEM );
+
+	//! Destructor
+	~TePolarStereographic () {}
+
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+	virtual	void	LL2PC (ostream&) const; //FAMI
+	virtual TeCoord2D PC2LL(const TeCoord2D& p);
+
+	virtual void LL2PC(double xi, double yi, double& xo, double& yo) const; //FAMI
+};
+
+//FAMI
+class TL_DLL TeSatelliteProjection : public TeProjection
+{
+
+private:
+	
+	double	SPri,	// Sensor angle resolution along y axis in radians
+		SPrj,	// Sensor angle resolution along x axis in radians
+		SPis,	// Y-coordinate of sub-satellite point 
+		SPjs,	// X-coordinate of sub-satellite point
+	        SPrs,   // Radius of satellite orbit in meters
+		SPscn,	// Scanning mode: 0-WE/NS, 1-SN/EW
+		SPyaw;  // Grid orientation, i.e., angle in radians between
+			// the increasing y axis and the meridian of the
+			// sub-satellite point along the direction of
+			// increasing latitude.
+public:
+
+	//! Constructor
+	/*
+		\param datum: 	planimetric datum
+		\param offx: 	x offset
+		\param offy: 	y offset
+		\param Pri:     Sensor angle resolution along y axis in radians
+		\param Prj: 	Sensor angle resolution along x axis in radians
+		\param Pis:     Y-coordinate of sub-satellite point 
+		\param Pjs: 	X-coordinate of sub-satellite point
+		\param Pla0: 	Latitude of sub-satellite point in radians
+		\param Plo0: 	Longitude of sub-satellite point in radians
+		\param Prs: 	Radius of satellite orbit in meters
+		\param Pscn: 	Scanning mode: 0-WE/NS, 1-SN/EW
+		\param Pyaw: 	Grid orientation, i.e., angle in radians between
+				the increasing y axis and the meridian of the
+				sub-satellite point along the direction of
+				increasing latitude.
+		*/
+	TeSatelliteProjection(const TeDatum& datum, double offx, double offy,  
+			      double Pri, double Prj, double Pis, double Pjs, double Pla0, double Plon0, 
+			      double Prs,double Pscn, double Pyaw):
+			TeProjection("Satellite", datum, Plon0, Pla0, offx, offy, 0., 0.,"Meters",1.,TeSOUTH_HEM),
+			SPri(Pri),
+			SPrj(Prj),
+			SPis(Pis),
+			SPjs(Pjs),		
+			SPrs(Prs),
+			SPscn(Pscn),
+			SPyaw(Pyaw)	{}
+
+	~TeSatelliteProjection() {}
+
+	virtual TeCoord2D LL2PC(const TeCoord2D& p);
+
+	virtual	TeCoord2D PC2LL(const TeCoord2D& p);
+
+	// Returns a the parameters of this projection
+	virtual TeProjectionParams params () const;
+};
+
+class TL_DLL TeNoProjection : public TeProjection
+{
+public:
+	TeNoProjection(const TeDatum& datum = TeDatum(), const string& units = "Units"):
+		TeProjection ( "NoProjection", datum, 0., 0., 0., 0., 0, 0, units, 1, TeSOUTH_HEM )
+
+	{	GPname = "NoProjection", GPunits = units; }
+
+		~TeNoProjection () {}
+
+		virtual TeCoord2D LL2PC(const TeCoord2D& p) { return p; }
+
+		virtual TeCoord2D PC2LL(const TeCoord2D& p) {return p;};
+};
+
+bool TL_DLL decodifyDescription(const string& projDescription, TeProjectionParams& pars);
+
+//! Creates a TeProjection instance from a PROJ4 description
+/*
+	\note This function works only for sproj descriptionsgenerated by TerraLib
+*/
+TL_DLL TeProjection* TeGetTeProjectionFromSProj(const string& sproj4desc);
+
+//! Generates a PROJ4 description from a TerraLib instance
+TL_DLL string TeGetSProjFromTeProjection(TeProjection* teproj);
+
+//! Generates OGC WKT Spatial Reference description from a TerraLib instance
+TL_DLL string TeGetWKTFromTeProjection(TeProjection* proj);
+
+//! Creates a TeProjection instance from a OGC WKT Spatial Reference description
+/*
+	\note This function works only for sproj descriptions generated by TerraLib
+*/
+TL_DLL TeProjection* TeGetTeProjectionFromWKT(const string& wkt);
+
+/** \example convertCoordinates.cpp
+ * This is an example of how to convert a coordinate from a projection to another
+ */
+
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeProjectiveGT.cpp b/src/terralib/kernel/TeProjectiveGT.cpp
index 745c361..0889ab3 100644
--- a/src/terralib/kernel/TeProjectiveGT.cpp
+++ b/src/terralib/kernel/TeProjectiveGT.cpp
@@ -1,589 +1,592 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#include "TeProjectiveGT.h"
-#include "TeGeometry.h"
-
-#include <assert.h>
-#include <math.h>
-
-
-TeProjectiveGT::TeProjectiveGT()
-{
-}
-
-
-TeProjectiveGT::~TeProjectiveGT()
-{
-}
-
-
-void TeProjectiveGT::directMap( const TeGTParams& params, const TeCoord2D& pt1, 
-    TeCoord2D& pt2 ) const
-{
-  assert( params.direct_parameters_.Ncol() == 3 );
-  assert( params.direct_parameters_.Nrow() == 3 );
-
-  double x = pt1.x();
-  double y = pt1.y();
-
-  if( ! params.useAdaptiveParams_ ) 
-  {
-    // denominador da fc projetiva    
-    double den = params.direct_parameters_( 2, 0 ) * x + params.direct_parameters_( 2, 1 ) * y + 1;
-  
-    pt2.x( ( params.direct_parameters_( 0, 0 ) * x + 
-      params.direct_parameters_( 0, 1 ) * y + 
-      params.direct_parameters_( 0, 2 ) ) / den );
-    pt2.y( ( params.direct_parameters_( 1, 0 ) * x + 
-      params.direct_parameters_( 1, 1 ) * y + 
-      params.direct_parameters_( 1, 2 ) ) / den ); 
-  }
-  else // use Adaptive parameters
-  {
-    x -= params.deltaX_;
-    y -= params.deltaY_;
-    
-    double den = params.direct_parameters_( 2, 0 ) * x + params.direct_parameters_( 2, 1 ) * y + 1;
-    
-    pt2.x( ( params.direct_parameters_( 0, 0 ) * x + 
-      params.direct_parameters_( 0, 1 ) * y + 
-      params.direct_parameters_( 0, 2 ) ) / den 
-      + params.deltaU_ );
-    pt2.y( ( params.direct_parameters_( 1, 0 ) * x + 
-      params.direct_parameters_( 1, 1 ) * y + 
-      params.direct_parameters_( 1, 2 ) ) / den 
-      + params.deltaV_ ); 
-  }
-}
-
-
-void TeProjectiveGT::inverseMap( const TeGTParams& params, const TeCoord2D& pt2, 
-  TeCoord2D& pt1 ) const
-{
-  assert( params.inverse_parameters_.Ncol() == 3 );
-  assert( params.inverse_parameters_.Nrow() == 3 );
-
-  double u = pt2.x();
-  double v = pt2.y();
-
-  if( ! params.useAdaptiveParams_  ) 
-  {
-    // denominador da fc projetiva
-    double den = params.inverse_parameters_( 2, 0 ) * u + params.inverse_parameters_( 2, 1 ) * v + 1;
-
-    pt1.x( ( params.inverse_parameters_( 0, 0 ) * u + 
-      params.inverse_parameters_( 0, 1 ) * v + 
-      params.inverse_parameters_( 0, 2 ) ) / den );
-    pt1.y( ( params.inverse_parameters_( 1, 0 ) * u + 
-      params.inverse_parameters_( 1, 1 ) * v + 
-      params.inverse_parameters_( 1, 2 ) ) / den );
-  }
-  else // use Adaptive parameters
-  {
-    u -= params.deltaU_;
-    v -= params.deltaV_;
-    
-    double den = params.inverse_parameters_( 2, 0 ) * u + params.inverse_parameters_( 2, 1 ) * v + 1;
-
-    pt1.x( ( params.inverse_parameters_( 0, 0 ) * u + 
-      params.inverse_parameters_( 0, 1 ) * v + 
-      params.inverse_parameters_( 0, 2 ) ) / den 
-      + params.deltaX_ );
-    pt1.y( ( params.inverse_parameters_( 1, 0 ) * u + 
-      params.inverse_parameters_( 1, 1 ) * v + 
-      params.inverse_parameters_( 1, 2 ) ) / den 
-      + params.deltaY_ );
-  }
-}
-
-
-unsigned int TeProjectiveGT::getMinRequiredTiePoints() const
-{
-  // At least four points
-  return 4;
-}
-
-
-bool TeProjectiveGT::computeParameters( TeGTParams& params ) const
-{
-  TEAGN_DEBUG_CONDITION( ( params.tiepoints_.size() > 3 ),
-    "Invalid tie-points size" )
-    
-  // calcula os parametros adaptativos
-  // caso contrario, reinicia o estado
-  if( params.useAdaptiveParams_ )
-    setAdaptativeParameters( params.tiepoints_, params );
-  else
-    params.deltaX_ = params.deltaY_ = params.deltaU_ = params.deltaV_ = 0;
-
-  // a forma do calculo depende da qtd pontos
-  const unsigned int tiepoints_size = params.tiepoints_.size();
-
-  if( tiepoints_size > 4 ) 
-  {
-    // Solucao com sobredeterminacao -> ajustamento
-    // mapeamento direto
-    if( ! useAdjustment( params, true ) )
-      return false;
-
-    // mapeamento inverso
-    return useAdjustment( params, false );
-  } 
-  else 
-  {
-    // Solucao deterministica
-    // mapeamento direto
-    if( ! useDeterministic( params, true ) )
-      return false;
-
-    // mapeamento inverso
-    return useDeterministic( params, false );
-    
-  } // fim if tiepoints
-
-}
-
-bool TeProjectiveGT::isTransDefined( const TeGTParams& params )  const
-{
-  if( ( params.direct_parameters_.Nrow() == 3 ) &&
-    ( params.direct_parameters_.Ncol() == 3 ) &&
-    ( params.inverse_parameters_.Nrow() == 3 ) &&
-    ( params.inverse_parameters_.Ncol() == 3 ) )
-  {
-    return true;
-  }
-  else
-  {
-    return false;
-  }
-}
-
-bool TeProjectiveGT::useAdjustment( TeGTParams& params, 
-  bool isDirectMapping ) const
-{
-    /* 
-        u = b11.x + b12.y + b13
-            -------------------
-               b31.x + b32.y
-            
-        v = b21.x + b22.y + b23
-            -------------------
-               b31.x + b32.y
-               
-        Method adapted from Albertz and Kreiling (1989).
-        Reference: Albertz, J.; Kreiling, W. Photogrametriches taschenbuch. 
-        Karlsruhe: Wichmann, 1989.
-        
-        Adaptive parameters by Xavier et al. (2007).
-        Reference: Xavier, E.; Fonseca, L.; d'Alge, J.; Castejon, E. Implementacao 
-        da transformacao projetiva na TerraLib: uma analise comparativa com a 
-        transformacao afim. Anais do XIII Simposio Brasileiro de Sensoriamento 
-        Remoto. <http://www.dsr.inpe.br/sbsr2007/>, 2007.
-    */
-
-  // inicializacao das variaveis
-  
-  // tamanho de Lb
-  // Lb : vetor das observacoes brutas (originais)
-  const unsigned int tiepoints_size = params.tiepoints_.size();
-
-  // A: matriz do sistema de equacoes
-  // inicializa com zeros
-  TeMatrix A;
-  if( ! A.Init( 2*tiepoints_size, 8, 0.0 ) ) 
-  {
-    return false;
-  }
-
-  // L: vetor das correcoes das observacoes
-  TeMatrix L;
-  if( ! L.Init( 2*tiepoints_size, 1 ) ) 
-  {
-    return false;
-  }
-
-  // At: transposta de A
-  TeMatrix At;
-
-  // N = At*P*A
-  TeMatrix N;
-
-  // N_inv : inversa de N
-  TeMatrix N_inv;
-
-  // U = At*P*Lb
-  TeMatrix U;
-
-  // Xa : vetor dos parametros ajustados
-  TeMatrix Xa;
-
-  // X0 : vetor dos parametros iniciais 
-  TeMatrix X0;
-
-  // X = Xa-X0 : vetor das correcoes 
-  TeMatrix X;
-
-  // W: matriz peso das observacoes
-  bool hasWMatrix = ( ( params.WMatrix_.Nrow() == 
-    (int)( tiepoints_size * 2 ) ) && ( params.WMatrix_.Ncol() == 
-    (int)( tiepoints_size * 2 ) ) ) ? true : false;
-
-  // V: residuos das observacoes
-
-  // iterador p/ correr as observacoes
-  std::vector< TeCoordPair >::const_iterator iterator;  
-
-  // Inicializacao de X0
-  // [1 0 0 0 1 0 0 0]t
-  X0.Init( 8, 1, 0.0 );
-  X0(0, 0) = 1;
-  X0(4, 0) = 1;
-
-
-  /**************************************************************\
-  Solucao com sobredeterminacao -> ajustamento
-  \**************************************************************/
-
-  // 0) Montando o laco while ate q o valor convirja (isTolReached) 
-  // ou alcance o Nr max de iteracoes (maxIters_)
-
-  // contagem das iteracoes
-  unsigned int iter = 0;
-
-  // alcancou a tolerancia?
-  bool isTolReached = false;
-
-  while( iter++ < params.maxIters_ && ! isTolReached ) 
-  {
-    // inicializando o iterador dos pontos observados (u/v)
-    iterator = params.tiepoints_.begin();
-
-    for ( unsigned int i = 0; i < tiepoints_size; ++i ) 
-    {
-      // pontos usados em todo o laco
-      // xi,yi : from
-      // ui,ui : to
-      double xi, yi; 
-      double ui, vi;
-      
-      if( isDirectMapping ) 
-      {
-        xi = iterator->pt1.x() - params.deltaX_;
-        yi = iterator->pt1.y() - params.deltaY_;
-        ui = iterator->pt2.x() - params.deltaU_;
-        vi = iterator->pt2.y() - params.deltaV_;
-      } 
-      else 
-      {
-        xi = iterator->pt2.x() - params.deltaU_;
-        yi = iterator->pt2.y() - params.deltaV_;
-        ui = iterator->pt1.x() - params.deltaX_;
-        vi = iterator->pt1.y() - params.deltaY_;
-      }
-
-      // denominador da fc projetiva
-      // den = b31 * xi + b32 * yi + 1
-      double den = X0( 6, 0 ) * xi + X0( 7, 0 ) * yi + 1;
-
-      // funcao projetiva p/ U e V
-      // U = ( b11 * xi + b12 * yi + b13 ) / den
-      double funcU = ( X0( 0, 0 ) * xi + X0( 1, 0 ) * yi + X0( 2, 0 ) - xi * ui * X0( 6, 0 ) -yi * ui * X0( 7, 0 ) );
-
-      // V = ( b21 * xi + b22 * yi + b23 ) / den
-      double funcV = ( X0( 3, 0 ) * xi + X0( 4, 0 ) * yi + X0( 5, 0 ) - xi * vi * X0( 6, 0 ) -yi * vi * X0( 7, 0 ) );
-
-      // 1) Calculo de L
-      // L = L0 - Lb 
-      L( 2*i  , 0 ) = (funcU - ui) / den;
-      L( 2*i+1, 0 ) = (funcV - vi) / den;
-
-      // 2) Montagem de A
-      // lembrando q jah tem zero em tudo
-      A( 2*i   , 0 ) = xi / den;
-      A( 2*i   , 1 ) = yi / den;
-      A( 2*i   , 2 ) = 1  / den;
-      A( 2*i   , 6 ) = -xi*ui/den;
-      A( 2*i   , 7 ) = -yi*ui/den;
-
-      A( 2*i+1 , 3 ) = A( 2*i, 0 );
-      A( 2*i+1 , 4 ) = A( 2*i, 1 );
-      A( 2*i+1 , 5 ) = A( 2*i, 2 );
-      A( 2*i+1 , 6 ) = -xi*vi/den;
-      A( 2*i+1 , 7 ) = -yi*vi/den;
-
-      ++iterator;
-    } // fim for_tiepoints
-
-    // 3) Calculo de N
-    A.Transpose( At );
-
-    // Se W_ esta definida
-    if( hasWMatrix ) 
-    {
-      N = At * params.WMatrix_;
-      N = N * A;
-    } 
-    else 
-      N = At * A;
-
-    // 4) Calculo de U
-    // Se W_ esta definida
-    if( hasWMatrix ) 
-    {
-      U = At * params.WMatrix_;
-      U = U * L;
-    } 
-    else 
-      U = At * L;
-
-    // 5) Calculo de X
-    if( ! N.Inverse( N_inv ) )
-      return false;
-
-    X = - N_inv * U;
-
-    // 6) Calculo de Xa
-    Xa = X0 + X;
-
-    // 7) Atualiza o X0 p/ proxima iteracao
-    X0 = Xa;
-
-    // 8) Checando se a tolerancia foi atingida
-
-    isTolReached = true;
-    for( unsigned int j = 0; j < 8; ++j ) 
-    {
-      if( fabs( X( j, 0 ) ) > params.tolerance_ ) 
-      {
-        isTolReached = false;
-        break;
-      }
-    }
-
-  } // fim while
-
-  // final - montagem da resposta
-  
-
-  if( isDirectMapping ) 
-  {
-    if( ! params.direct_parameters_.Init( 3, 3 ) )
-      return false;
-    
-    params.direct_parameters_(0,0) = Xa(0,0);
-    params.direct_parameters_(0,1) = Xa(1,0);
-    params.direct_parameters_(0,2) = Xa(2,0);
-  
-    params.direct_parameters_(1,0) = Xa(3,0);
-    params.direct_parameters_(1,1) = Xa(4,0);
-    params.direct_parameters_(1,2) = Xa(5,0);
-  
-    params.direct_parameters_(2,0) = Xa(6,0);
-    params.direct_parameters_(2,1) = Xa(7,0);
-    params.direct_parameters_(2,2) = 1;
-  }
-  else
-  {
-    if( ! params.inverse_parameters_.Init( 3, 3 ) )
-      return false;
-    
-    params.inverse_parameters_(0,0) = Xa(0,0);
-    params.inverse_parameters_(0,1) = Xa(1,0);
-    params.inverse_parameters_(0,2) = Xa(2,0);
-  
-    params.inverse_parameters_(1,0) = Xa(3,0);
-    params.inverse_parameters_(1,1) = Xa(4,0);
-    params.inverse_parameters_(1,2) = Xa(5,0);
-  
-    params.inverse_parameters_(2,0) = Xa(6,0);
-    params.inverse_parameters_(2,1) = Xa(7,0);
-    params.inverse_parameters_(2,2) = 1;
-  }
-
-  return true;
-}
-
-
-bool TeProjectiveGT::useDeterministic( TeGTParams& params, 
-  bool isDirectMapping ) const
-{
-
-  // Solucao deterministica, da forma:
-  // X = A^-1 . L
-
-  // o vetor de ptos sempre tera tamanho 4
-  const unsigned int tiepoints_size = 4;
-
-  // A: matriz do sistema de equacoes
-  // inicializa com zeros
-  TeMatrix A;
-  if( ! A.Init( 2*tiepoints_size, 8, 0.0 ) ) 
-  {
-    return false;
-  }
-
-  // L: vetor das observacoes
-  TeMatrix L;
-  if( ! L.Init( 2*tiepoints_size, 1 ) ) 
-  {
-    return false;
-  }
-
-  // inversa de A
-  TeMatrix A_inv;
-
-  // resultado
-  TeMatrix X;
-
-  // iterador p/ correr as observacoes
-  std::vector< TeCoordPair >::const_iterator iterator = params.tiepoints_.begin();;  
-
-  // montagem de A e L
-  for ( unsigned int i = 0; i < tiepoints_size; ++i ) {
-
-    // pontos usados em todo o laco
-    // xi,yi : from
-    // ui,ui : to
-    double xi, yi; 
-    double ui, vi;
-
-    if( isDirectMapping ) 
-    {
-      xi = iterator->pt1.x();
-      yi = iterator->pt1.y();
-      ui = iterator->pt2.x();
-      vi = iterator->pt2.y();
-    } 
-    else 
-    {
-      xi = iterator->pt2.x();
-      yi = iterator->pt2.y();
-      ui = iterator->pt1.x();
-      vi = iterator->pt1.y();
-    }
-
-    // 1) Calculo de L
-    L( 2*i  , 0 ) = ui;
-    L( 2*i+1, 0 ) = vi;
-
-    // 2) Montagem de A
-    // lembrando q jah tem zero em tudo
-    A( 2*i   , 0 ) = xi;
-    A( 2*i   , 1 ) = yi;
-    A( 2*i   , 2 ) = 1;
-    A( 2*i   , 6 ) = - xi * ui;
-    A( 2*i   , 7 ) = - yi * ui;
-
-    A( 2*i+1 , 3 ) = xi;
-    A( 2*i+1 , 4 ) = yi;
-    A( 2*i+1 , 5 ) = 1;
-    A( 2*i+1 , 6 ) = - xi * vi;
-    A( 2*i+1 , 7 ) = - yi * vi;
-
-    ++iterator;
-
-  } // fim for_tiepoints
-
-  // 3) Calculo de A_inv
-  A.Inverse( A_inv );
-
-  // 4) Calculo de X
-  X = A_inv * L;
-
-  // final - montagem da resposta
-  
-    if( isDirectMapping ) 
-  {
-    if( ! params.direct_parameters_.Init( 3, 3 ) )
-      return false;
-    
-    params.direct_parameters_(0,0) = X(0,0);
-    params.direct_parameters_(0,1) = X(1,0);
-    params.direct_parameters_(0,2) = X(2,0);
-  
-    params.direct_parameters_(1,0) = X(3,0);
-    params.direct_parameters_(1,1) = X(4,0);
-    params.direct_parameters_(1,2) = X(5,0);
-  
-    params.direct_parameters_(2,0) = X(6,0);
-    params.direct_parameters_(2,1) = X(7,0);
-    params.direct_parameters_(2,2) = 1;
-  }
-  else
-  {
-    if( ! params.inverse_parameters_.Init( 3, 3 ) )
-      return false;
-    
-    params.inverse_parameters_(0,0) = X(0,0);
-    params.inverse_parameters_(0,1) = X(1,0);
-    params.inverse_parameters_(0,2) = X(2,0);
-  
-    params.inverse_parameters_(1,0) = X(3,0);
-    params.inverse_parameters_(1,1) = X(4,0);
-    params.inverse_parameters_(1,2) = X(5,0);
-  
-    params.inverse_parameters_(2,0) = X(6,0);
-    params.inverse_parameters_(2,1) = X(7,0);
-    params.inverse_parameters_(2,2) = 1;
-  }
-
-  return true;
-}
-
-void TeProjectiveGT::setAdaptativeParameters( 
-  const std::vector< TeCoordPair >& tiepoints,
-  TeGTParams& params ) const
-{
-  params.deltaX_ = TeMAXFLOAT;
-  params.deltaY_ = TeMAXFLOAT;
-  params.deltaU_ = TeMAXFLOAT;
-  params.deltaV_ = TeMAXFLOAT;
-  
-  const unsigned int tiepoints_size = tiepoints.size();
-  
-  // iterador p/ correr as observacoes
-  std::vector< TeCoordPair >::const_iterator iterator = tiepoints.begin();
-  
-  for ( unsigned int i = 0; i < tiepoints_size; ++i ) 
-  {
-    double xi, yi; 
-    double ui, vi;
-      
-    // obtem os valores
-    xi = iterator->pt1.x();
-    yi = iterator->pt1.y();
-    ui = iterator->pt2.x();
-    vi = iterator->pt2.y();
-    
-    // checa se eh o menor - cada um
-    if( xi < params.deltaX_ ) params.deltaX_ = xi;
-    if( yi < params.deltaY_ ) params.deltaY_ = yi;
-    if( ui < params.deltaU_ ) params.deltaU_ = ui;
-    if( vi < params.deltaV_ ) params.deltaV_ = vi;
-    
-  }
-
-}
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#include "TeProjectiveGT.h"
+#include "TeGeometry.h"
+
+#include <assert.h>
+#include <math.h>
+
+
+TeProjectiveGT::TeProjectiveGT()
+{
+}
+
+
+TeProjectiveGT::~TeProjectiveGT()
+{
+}
+
+
+void TeProjectiveGT::directMap( const TeGTParams& params, const TeCoord2D& pt1, 
+    TeCoord2D& pt2 ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ), 
+    "Transformation not defined" );
+
+  double x = pt1.x();
+  double y = pt1.y();
+
+  if( ! params.useAdaptiveParams_ ) 
+  {
+    // denominador da fc projetiva    
+    double den = params.direct_parameters_( 2, 0 ) * x + params.direct_parameters_( 2, 1 ) * y + 1;
+  
+    pt2.x( ( params.direct_parameters_( 0, 0 ) * x + 
+      params.direct_parameters_( 0, 1 ) * y + 
+      params.direct_parameters_( 0, 2 ) ) / den );
+    pt2.y( ( params.direct_parameters_( 1, 0 ) * x + 
+      params.direct_parameters_( 1, 1 ) * y + 
+      params.direct_parameters_( 1, 2 ) ) / den ); 
+  }
+  else // use Adaptive parameters
+  {
+    x -= params.deltaX_;
+    y -= params.deltaY_;
+    
+    double den = params.direct_parameters_( 2, 0 ) * x + params.direct_parameters_( 2, 1 ) * y + 1;
+    
+    pt2.x( ( params.direct_parameters_( 0, 0 ) * x + 
+      params.direct_parameters_( 0, 1 ) * y + 
+      params.direct_parameters_( 0, 2 ) ) / den 
+      + params.deltaU_ );
+    pt2.y( ( params.direct_parameters_( 1, 0 ) * x + 
+      params.direct_parameters_( 1, 1 ) * y + 
+      params.direct_parameters_( 1, 2 ) ) / den 
+      + params.deltaV_ ); 
+  }
+}
+
+
+void TeProjectiveGT::inverseMap( const TeGTParams& params, const TeCoord2D& pt2, 
+  TeCoord2D& pt1 ) const
+{
+  TEAGN_DEBUG_CONDITION( isTransDefined( params ), 
+    "Transformation not defined" );
+
+  double u = pt2.x();
+  double v = pt2.y();
+
+  if( ! params.useAdaptiveParams_  ) 
+  {
+    // denominador da fc projetiva
+    double den = params.inverse_parameters_( 2, 0 ) * u + params.inverse_parameters_( 2, 1 ) * v + 1;
+
+    pt1.x( ( params.inverse_parameters_( 0, 0 ) * u + 
+      params.inverse_parameters_( 0, 1 ) * v + 
+      params.inverse_parameters_( 0, 2 ) ) / den );
+    pt1.y( ( params.inverse_parameters_( 1, 0 ) * u + 
+      params.inverse_parameters_( 1, 1 ) * v + 
+      params.inverse_parameters_( 1, 2 ) ) / den );
+  }
+  else // use Adaptive parameters
+  {
+    u -= params.deltaU_;
+    v -= params.deltaV_;
+    
+    double den = params.inverse_parameters_( 2, 0 ) * u + params.inverse_parameters_( 2, 1 ) * v + 1;
+
+    pt1.x( ( params.inverse_parameters_( 0, 0 ) * u + 
+      params.inverse_parameters_( 0, 1 ) * v + 
+      params.inverse_parameters_( 0, 2 ) ) / den 
+      + params.deltaX_ );
+    pt1.y( ( params.inverse_parameters_( 1, 0 ) * u + 
+      params.inverse_parameters_( 1, 1 ) * v + 
+      params.inverse_parameters_( 1, 2 ) ) / den 
+      + params.deltaY_ );
+  }
+}
+
+
+unsigned int TeProjectiveGT::getMinRequiredTiePoints() const
+{
+  // At least four points
+  return 4;
+}
+
+
+bool TeProjectiveGT::computeParameters( TeGTParams& params ) const
+{
+  TEAGN_DEBUG_CONDITION( ( params.tiepoints_.size() > 3 ),
+    "Invalid tie-points size" )
+  TEAGN_DEBUG_CONDITION( params.transformation_name_ == "projective",
+    "Invalid transformation name" )    
+    
+  // calcula os parametros adaptativos
+  // caso contrario, reinicia o estado
+  if( params.useAdaptiveParams_ )
+    setAdaptativeParameters( params.tiepoints_, params );
+  else
+    params.deltaX_ = params.deltaY_ = params.deltaU_ = params.deltaV_ = 0;
+
+  // a forma do calculo depende da qtd pontos
+  const unsigned int tiepoints_size = params.tiepoints_.size();
+
+  if( tiepoints_size > 4 ) 
+  {
+    // Solucao com sobredeterminacao -> ajustamento
+    // mapeamento direto
+    if( ! useAdjustment( params, true ) )
+      return false;
+
+    // mapeamento inverso
+    return useAdjustment( params, false );
+  } 
+  else 
+  {
+    // Solucao deterministica
+    // mapeamento direto
+    if( ! useDeterministic( params, true ) )
+      return false;
+
+    // mapeamento inverso
+    return useDeterministic( params, false );
+    
+  } // fim if tiepoints
+
+}
+
+bool TeProjectiveGT::isTransDefined( const TeGTParams& params )  const
+{
+  if( ( params.transformation_name_ == "projective" ) &&
+    ( params.direct_parameters_.Nrow() == 3 ) &&
+    ( params.direct_parameters_.Ncol() == 3 ) &&
+    ( params.inverse_parameters_.Nrow() == 3 ) &&
+    ( params.inverse_parameters_.Ncol() == 3 ) )
+  {
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+bool TeProjectiveGT::useAdjustment( TeGTParams& params, 
+  bool isDirectMapping ) const
+{
+    /* 
+        u = b11.x + b12.y + b13
+            -------------------
+               b31.x + b32.y
+            
+        v = b21.x + b22.y + b23
+            -------------------
+               b31.x + b32.y
+               
+        Method adapted from Albertz and Kreiling (1989).
+        Reference: Albertz, J.; Kreiling, W. Photogrametriches taschenbuch. 
+        Karlsruhe: Wichmann, 1989.
+        
+        Adaptive parameters by Xavier et al. (2007).
+        Reference: Xavier, E.; Fonseca, L.; d'Alge, J.; Castejon, E. Implementacao 
+        da transformacao projetiva na TerraLib: uma analise comparativa com a 
+        transformacao afim. Anais do XIII Simposio Brasileiro de Sensoriamento 
+        Remoto. <http://www.dsr.inpe.br/sbsr2007/>, 2007.
+    */
+
+  // inicializacao das variaveis
+  
+  // tamanho de Lb
+  // Lb : vetor das observacoes brutas (originais)
+  const unsigned int tiepoints_size = params.tiepoints_.size();
+
+  // A: matriz do sistema de equacoes
+  // inicializa com zeros
+  TeMatrix A;
+  if( ! A.Init( 2*tiepoints_size, 8, 0.0 ) ) 
+  {
+    return false;
+  }
+
+  // L: vetor das correcoes das observacoes
+  TeMatrix L;
+  if( ! L.Init( 2*tiepoints_size, 1 ) ) 
+  {
+    return false;
+  }
+
+  // At: transposta de A
+  TeMatrix At;
+
+  // N = At*P*A
+  TeMatrix N;
+
+  // N_inv : inversa de N
+  TeMatrix N_inv;
+
+  // U = At*P*Lb
+  TeMatrix U;
+
+  // Xa : vetor dos parametros ajustados
+  TeMatrix Xa;
+
+  // X0 : vetor dos parametros iniciais 
+  TeMatrix X0;
+
+  // X = Xa-X0 : vetor das correcoes 
+  TeMatrix X;
+
+  // W: matriz peso das observacoes
+  bool hasWMatrix = ( ( params.WMatrix_.Nrow() == 
+    (int)( tiepoints_size * 2 ) ) && ( params.WMatrix_.Ncol() == 
+    (int)( tiepoints_size * 2 ) ) ) ? true : false;
+
+  // V: residuos das observacoes
+
+  // iterador p/ correr as observacoes
+  std::vector< TeCoordPair >::const_iterator iterator;  
+
+  // Inicializacao de X0
+  // [1 0 0 0 1 0 0 0]t
+  X0.Init( 8, 1, 0.0 );
+  X0(0, 0) = 1;
+  X0(4, 0) = 1;
+
+
+  /**************************************************************\
+  Solucao com sobredeterminacao -> ajustamento
+  \**************************************************************/
+
+  // 0) Montando o laco while ate q o valor convirja (isTolReached) 
+  // ou alcance o Nr max de iteracoes (maxIters_)
+
+  // contagem das iteracoes
+  unsigned int iter = 0;
+
+  // alcancou a tolerancia?
+  bool isTolReached = false;
+
+  while( iter++ < params.maxIters_ && ! isTolReached ) 
+  {
+    // inicializando o iterador dos pontos observados (u/v)
+    iterator = params.tiepoints_.begin();
+
+    for ( unsigned int i = 0; i < tiepoints_size; ++i ) 
+    {
+      // pontos usados em todo o laco
+      // xi,yi : from
+      // ui,ui : to
+      double xi, yi; 
+      double ui, vi;
+      
+      if( isDirectMapping ) 
+      {
+        xi = iterator->pt1.x() - params.deltaX_;
+        yi = iterator->pt1.y() - params.deltaY_;
+        ui = iterator->pt2.x() - params.deltaU_;
+        vi = iterator->pt2.y() - params.deltaV_;
+      } 
+      else 
+      {
+        xi = iterator->pt2.x() - params.deltaU_;
+        yi = iterator->pt2.y() - params.deltaV_;
+        ui = iterator->pt1.x() - params.deltaX_;
+        vi = iterator->pt1.y() - params.deltaY_;
+      }
+
+      // denominador da fc projetiva
+      // den = b31 * xi + b32 * yi + 1
+      double den = X0( 6, 0 ) * xi + X0( 7, 0 ) * yi + 1;
+
+      // funcao projetiva p/ U e V
+      // U = ( b11 * xi + b12 * yi + b13 ) / den
+      double funcU = ( X0( 0, 0 ) * xi + X0( 1, 0 ) * yi + X0( 2, 0 ) - xi * ui * X0( 6, 0 ) -yi * ui * X0( 7, 0 ) );
+
+      // V = ( b21 * xi + b22 * yi + b23 ) / den
+      double funcV = ( X0( 3, 0 ) * xi + X0( 4, 0 ) * yi + X0( 5, 0 ) - xi * vi * X0( 6, 0 ) -yi * vi * X0( 7, 0 ) );
+
+      // 1) Calculo de L
+      // L = L0 - Lb 
+      L( 2*i  , 0 ) = (funcU - ui) / den;
+      L( 2*i+1, 0 ) = (funcV - vi) / den;
+
+      // 2) Montagem de A
+      // lembrando q jah tem zero em tudo
+      A( 2*i   , 0 ) = xi / den;
+      A( 2*i   , 1 ) = yi / den;
+      A( 2*i   , 2 ) = 1  / den;
+      A( 2*i   , 6 ) = -xi*ui/den;
+      A( 2*i   , 7 ) = -yi*ui/den;
+
+      A( 2*i+1 , 3 ) = A( 2*i, 0 );
+      A( 2*i+1 , 4 ) = A( 2*i, 1 );
+      A( 2*i+1 , 5 ) = A( 2*i, 2 );
+      A( 2*i+1 , 6 ) = -xi*vi/den;
+      A( 2*i+1 , 7 ) = -yi*vi/den;
+
+      ++iterator;
+    } // fim for_tiepoints
+
+    // 3) Calculo de N
+    A.Transpose( At );
+
+    // Se W_ esta definida
+    if( hasWMatrix ) 
+    {
+      N = At * params.WMatrix_;
+      N = N * A;
+    } 
+    else 
+      N = At * A;
+
+    // 4) Calculo de U
+    // Se W_ esta definida
+    if( hasWMatrix ) 
+    {
+      U = At * params.WMatrix_;
+      U = U * L;
+    } 
+    else 
+      U = At * L;
+
+    // 5) Calculo de X
+    if( ! N.Inverse( N_inv ) )
+      return false;
+
+    X = - N_inv * U;
+
+    // 6) Calculo de Xa
+    Xa = X0 + X;
+
+    // 7) Atualiza o X0 p/ proxima iteracao
+    X0 = Xa;
+
+    // 8) Checando se a tolerancia foi atingida
+
+    isTolReached = true;
+    for( unsigned int j = 0; j < 8; ++j ) 
+    {
+      if( fabs( X( j, 0 ) ) > params.tolerance_ ) 
+      {
+        isTolReached = false;
+        break;
+      }
+    }
+
+  } // fim while
+
+  // final - montagem da resposta
+  
+
+  if( isDirectMapping ) 
+  {
+    if( ! params.direct_parameters_.Init( 3, 3 ) )
+      return false;
+    
+    params.direct_parameters_(0,0) = Xa(0,0);
+    params.direct_parameters_(0,1) = Xa(1,0);
+    params.direct_parameters_(0,2) = Xa(2,0);
+  
+    params.direct_parameters_(1,0) = Xa(3,0);
+    params.direct_parameters_(1,1) = Xa(4,0);
+    params.direct_parameters_(1,2) = Xa(5,0);
+  
+    params.direct_parameters_(2,0) = Xa(6,0);
+    params.direct_parameters_(2,1) = Xa(7,0);
+    params.direct_parameters_(2,2) = 1;
+  }
+  else
+  {
+    if( ! params.inverse_parameters_.Init( 3, 3 ) )
+      return false;
+    
+    params.inverse_parameters_(0,0) = Xa(0,0);
+    params.inverse_parameters_(0,1) = Xa(1,0);
+    params.inverse_parameters_(0,2) = Xa(2,0);
+  
+    params.inverse_parameters_(1,0) = Xa(3,0);
+    params.inverse_parameters_(1,1) = Xa(4,0);
+    params.inverse_parameters_(1,2) = Xa(5,0);
+  
+    params.inverse_parameters_(2,0) = Xa(6,0);
+    params.inverse_parameters_(2,1) = Xa(7,0);
+    params.inverse_parameters_(2,2) = 1;
+  }
+
+  return true;
+}
+
+
+bool TeProjectiveGT::useDeterministic( TeGTParams& params, 
+  bool isDirectMapping ) const
+{
+
+  // Solucao deterministica, da forma:
+  // X = A^-1 . L
+
+  // o vetor de ptos sempre tera tamanho 4
+  const unsigned int tiepoints_size = 4;
+
+  // A: matriz do sistema de equacoes
+  // inicializa com zeros
+  TeMatrix A;
+  if( ! A.Init( 2*tiepoints_size, 8, 0.0 ) ) 
+  {
+    return false;
+  }
+
+  // L: vetor das observacoes
+  TeMatrix L;
+  if( ! L.Init( 2*tiepoints_size, 1 ) ) 
+  {
+    return false;
+  }
+
+  // inversa de A
+  TeMatrix A_inv;
+
+  // resultado
+  TeMatrix X;
+
+  // iterador p/ correr as observacoes
+  std::vector< TeCoordPair >::const_iterator iterator = params.tiepoints_.begin();;  
+
+  // montagem de A e L
+  for ( unsigned int i = 0; i < tiepoints_size; ++i ) {
+
+    // pontos usados em todo o laco
+    // xi,yi : from
+    // ui,ui : to
+    double xi, yi; 
+    double ui, vi;
+
+    if( isDirectMapping ) 
+    {
+      xi = iterator->pt1.x();
+      yi = iterator->pt1.y();
+      ui = iterator->pt2.x();
+      vi = iterator->pt2.y();
+    } 
+    else 
+    {
+      xi = iterator->pt2.x();
+      yi = iterator->pt2.y();
+      ui = iterator->pt1.x();
+      vi = iterator->pt1.y();
+    }
+
+    // 1) Calculo de L
+    L( 2*i  , 0 ) = ui;
+    L( 2*i+1, 0 ) = vi;
+
+    // 2) Montagem de A
+    // lembrando q jah tem zero em tudo
+    A( 2*i   , 0 ) = xi;
+    A( 2*i   , 1 ) = yi;
+    A( 2*i   , 2 ) = 1;
+    A( 2*i   , 6 ) = - xi * ui;
+    A( 2*i   , 7 ) = - yi * ui;
+
+    A( 2*i+1 , 3 ) = xi;
+    A( 2*i+1 , 4 ) = yi;
+    A( 2*i+1 , 5 ) = 1;
+    A( 2*i+1 , 6 ) = - xi * vi;
+    A( 2*i+1 , 7 ) = - yi * vi;
+
+    ++iterator;
+
+  } // fim for_tiepoints
+
+  // 3) Calculo de A_inv
+  A.Inverse( A_inv );
+
+  // 4) Calculo de X
+  X = A_inv * L;
+
+  // final - montagem da resposta
+  
+    if( isDirectMapping ) 
+  {
+    if( ! params.direct_parameters_.Init( 3, 3 ) )
+      return false;
+    
+    params.direct_parameters_(0,0) = X(0,0);
+    params.direct_parameters_(0,1) = X(1,0);
+    params.direct_parameters_(0,2) = X(2,0);
+  
+    params.direct_parameters_(1,0) = X(3,0);
+    params.direct_parameters_(1,1) = X(4,0);
+    params.direct_parameters_(1,2) = X(5,0);
+  
+    params.direct_parameters_(2,0) = X(6,0);
+    params.direct_parameters_(2,1) = X(7,0);
+    params.direct_parameters_(2,2) = 1;
+  }
+  else
+  {
+    if( ! params.inverse_parameters_.Init( 3, 3 ) )
+      return false;
+    
+    params.inverse_parameters_(0,0) = X(0,0);
+    params.inverse_parameters_(0,1) = X(1,0);
+    params.inverse_parameters_(0,2) = X(2,0);
+  
+    params.inverse_parameters_(1,0) = X(3,0);
+    params.inverse_parameters_(1,1) = X(4,0);
+    params.inverse_parameters_(1,2) = X(5,0);
+  
+    params.inverse_parameters_(2,0) = X(6,0);
+    params.inverse_parameters_(2,1) = X(7,0);
+    params.inverse_parameters_(2,2) = 1;
+  }
+
+  return true;
+}
+
+void TeProjectiveGT::setAdaptativeParameters( 
+  const std::vector< TeCoordPair >& tiepoints,
+  TeGTParams& params ) const
+{
+  params.deltaX_ = TeMAXFLOAT;
+  params.deltaY_ = TeMAXFLOAT;
+  params.deltaU_ = TeMAXFLOAT;
+  params.deltaV_ = TeMAXFLOAT;
+  
+  const unsigned int tiepoints_size = tiepoints.size();
+  
+  // iterador p/ correr as observacoes
+  std::vector< TeCoordPair >::const_iterator iterator = tiepoints.begin();
+  
+  for ( unsigned int i = 0; i < tiepoints_size; ++i ) 
+  {
+    double xi, yi; 
+    double ui, vi;
+      
+    // obtem os valores
+    xi = iterator->pt1.x();
+    yi = iterator->pt1.y();
+    ui = iterator->pt2.x();
+    vi = iterator->pt2.y();
+    
+    // checa se eh o menor - cada um
+    if( xi < params.deltaX_ ) params.deltaX_ = xi;
+    if( yi < params.deltaY_ ) params.deltaY_ = yi;
+    if( ui < params.deltaU_ ) params.deltaU_ = ui;
+    if( vi < params.deltaV_ ) params.deltaV_ = vi;
+    
+  }
+
+}
+
diff --git a/src/terralib/kernel/TeProjectiveGT.h b/src/terralib/kernel/TeProjectiveGT.h
index 62e9723..7114408 100644
--- a/src/terralib/kernel/TeProjectiveGT.h
+++ b/src/terralib/kernel/TeProjectiveGT.h
@@ -1,123 +1,123 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPROJECTIVEGT_H
-#define TEPROJECTIVEGT_H
-
-#include <TeGeometricTransformation.h>
-
-/**
-* @brief This is the class to deal projective geometric trasformation.
-* @author Emerson M.A. Xavier <emerson at dpi.inpe.br>
-* @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-* @ingroup Utils
-*/
-class TL_DLL TeProjectiveGT : public TeGeometricTransformation {
-public :
-
-  /**
-  * Default Constructor.
-  */
-  TeProjectiveGT();
-
-  /**
-  * Default Destructor
-  */
-  ~TeProjectiveGT();
-
-  /**
-  * Returns the minimum number of required tie-points for the current
-  * transformation.
-  *
-  * @return The minimum number of required tie-points for the current
-  * transformation.
-  */       
-  unsigned int getMinRequiredTiePoints() const;      
-
-protected :
-
-  /**
-     * @brief Direct mapping ( from pt1 space into pt2 space ).
-     *
-     * @param params Transformation parameters.
-     * @param pt1 pt1 coordinate.
-     * @param pt2 pt2 coordinate.
-     */      
-    void directMap( const TeGTParams& params, const TeCoord2D& pt1, 
-      TeCoord2D& pt2 ) const;
-      
-    /**
-     * @brief Inverse mapping ( from pt2 space into pt1 space ).
-     *
-     * @param params Transformation parameters.
-     * @param pt2 pt2 coordinate.
-     * @param pt1 pt1 coordinate.
-     */      
-    void inverseMap( const TeGTParams& params, const TeCoord2D& pt2, 
-      TeCoord2D& pt1 ) const;      
-      
-    /**
-     * @brief Calculate the transformation parameters following the
-     * new supplied tie-points.
-     *
-     * @param params Transformation parameters.
-     * @return true if OK, false on errors.
-     */       
-    bool computeParameters( TeGTParams& params ) const;
-  
-    /**
-      * @brief Verifies if the supplied parameters already
-      * has a defined transformation.
-      * @param params Transformation parameters.
-      * @return true if a transformation is already defined, 
-      * false otherwise.
-      */       
-    bool isTransDefined( const TeGTParams& params ) const;   
-      
-private:  
-
-  /** 
-   * @brief When using more than four tiepoints, use adjustment.
-   */
-  bool useAdjustment( TeGTParams& params, 
-    bool isDirectMapping ) const;
-
-  /** 
-   * @brief When using exactly four tiepoints, use deterministic solution.
-   */
-  bool useDeterministic( TeGTParams& params, 
-    bool isDirectMapping ) const;
-
-  /** 
-   * @brief Set adaptative parameters
-   * @param params Transformation parameters.
-   * @note This method is called whether the flag "useAdaptiveParameters" is on. 
-   */
-  void setAdaptativeParameters( 
-    const std::vector< TeCoordPair >& tiepoints,
-    TeGTParams& params ) const;
-};
-
-#endif // TEPROJECTIVEGT_H
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPROJECTIVEGT_H
+#define TEPROJECTIVEGT_H
+
+#include <TeGeometricTransformation.h>
+
+/**
+* @brief This is the class to deal projective geometric trasformation.
+* @author Emerson M.A. Xavier <emerson at dpi.inpe.br>
+* @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+* @ingroup GeometricTransformationGroup
+*/
+class TL_DLL TeProjectiveGT : public TeGeometricTransformation {
+public :
+
+  /**
+  * Default Constructor.
+  */
+  TeProjectiveGT();
+
+  /**
+  * Default Destructor
+  */
+  ~TeProjectiveGT();
+
+  /**
+  * Returns the minimum number of required tie-points for the current
+  * transformation.
+  *
+  * @return The minimum number of required tie-points for the current
+  * transformation.
+  */       
+  unsigned int getMinRequiredTiePoints() const;      
+
+protected :
+
+  /**
+     * @brief Direct mapping ( from pt1 space into pt2 space ).
+     *
+     * @param params Transformation parameters.
+     * @param pt1 pt1 coordinate.
+     * @param pt2 pt2 coordinate.
+     */      
+    void directMap( const TeGTParams& params, const TeCoord2D& pt1, 
+      TeCoord2D& pt2 ) const;
+      
+    /**
+     * @brief Inverse mapping ( from pt2 space into pt1 space ).
+     *
+     * @param params Transformation parameters.
+     * @param pt2 pt2 coordinate.
+     * @param pt1 pt1 coordinate.
+     */      
+    void inverseMap( const TeGTParams& params, const TeCoord2D& pt2, 
+      TeCoord2D& pt1 ) const;      
+      
+    /**
+     * @brief Calculate the transformation parameters following the
+     * new supplied tie-points.
+     *
+     * @param params Transformation parameters.
+     * @return true if OK, false on errors.
+     */       
+    bool computeParameters( TeGTParams& params ) const;
+  
+    /**
+      * @brief Verifies if the supplied parameters already
+      * has a defined transformation.
+      * @param params Transformation parameters.
+      * @return true if a transformation is already defined, 
+      * false otherwise.
+      */       
+    bool isTransDefined( const TeGTParams& params ) const;   
+      
+private:  
+
+  /** 
+   * @brief When using more than four tiepoints, use adjustment.
+   */
+  bool useAdjustment( TeGTParams& params, 
+    bool isDirectMapping ) const;
+
+  /** 
+   * @brief When using exactly four tiepoints, use deterministic solution.
+   */
+  bool useDeterministic( TeGTParams& params, 
+    bool isDirectMapping ) const;
+
+  /** 
+   * @brief Set adaptative parameters
+   * @param params Transformation parameters.
+   * @note This method is called whether the flag "useAdaptiveParameters" is on. 
+   */
+  void setAdaptativeParameters( 
+    const std::vector< TeCoordPair >& tiepoints,
+    TeGTParams& params ) const;
+};
+
+#endif // TEPROJECTIVEGT_H
+
diff --git a/src/terralib/kernel/TeProjectiveGTFactory.cpp b/src/terralib/kernel/TeProjectiveGTFactory.cpp
index afae921..df223cb 100644
--- a/src/terralib/kernel/TeProjectiveGTFactory.cpp
+++ b/src/terralib/kernel/TeProjectiveGTFactory.cpp
@@ -1,49 +1,49 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#include "TeProjectiveGTFactory.h"
-#include <TeProjectiveGT.h>
-#include <TeException.h>
-
-TeProjectiveGTFactory::TeProjectiveGTFactory()
-: TeGTFactory( std::string( "projective" ) )
-{
-};      
-
-TeProjectiveGTFactory::~TeProjectiveGTFactory()
-{
-};
-
-
-TeGeometricTransformation* TeProjectiveGTFactory::build ( 
-  const TeGTParams& )
-{
-  TeGeometricTransformation* instance_ptr = new TeProjectiveGT();
-  
-  if( ! instance_ptr ) {
-    throw TeException( FACTORY_PRODUCT_INSTATIATION_ERROR );
-  }
-  
-  return instance_ptr;
-}
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#include "TeProjectiveGTFactory.h"
+#include <TeProjectiveGT.h>
+#include <TeException.h>
+
+TeProjectiveGTFactory::TeProjectiveGTFactory()
+: TeGTFactory( std::string( "projective" ) )
+{
+};      
+
+TeProjectiveGTFactory::~TeProjectiveGTFactory()
+{
+};
+
+
+TeGeometricTransformation* TeProjectiveGTFactory::build ( 
+  const TeGTParams& )
+{
+  TeGeometricTransformation* instance_ptr = new TeProjectiveGT();
+  
+  if( ! instance_ptr ) {
+    throw TeException( FACTORY_PRODUCT_INSTATIATION_ERROR );
+  }
+  
+  return instance_ptr;
+}
diff --git a/src/terralib/kernel/TeProjectiveGTFactory.h b/src/terralib/kernel/TeProjectiveGTFactory.h
index 30fa60e..42e9688 100644
--- a/src/terralib/kernel/TeProjectiveGTFactory.h
+++ b/src/terralib/kernel/TeProjectiveGTFactory.h
@@ -1,67 +1,67 @@
-/*
-TerraLib - a library for developing GIS applications.
-Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular
-purpose. The library provided hereunder is on an "as is" basis, and the
-authors have no obligation to provide maintenance, support, updates,
-enhancements, or modifications.
-In no event shall INPE be held liable to any party
-for direct, indirect, special, incidental, or consequential damages arising
-out of the use of this library and its documentation.
-*/
-
-#ifndef TEPROJECTIVEGTFACTORY_H
-  #define TEPROJECTIVEGTFACTORY_H
-  
-  #include <TeGTFactory.h>
-
-  /**
-   * @brief This is the projective geometric trasformation factory.
-   * @author Emerson M.A. Xavier <emerson at dpi.inpe.br>
-   * @ingroup Utils
-   */
-  class TL_DLL TeProjectiveGTFactory : public TeGTFactory
-  {
-    public :
-      
-      /**
-       * Default constructor
-       */
-      TeProjectiveGTFactory();      
-      
-      /**
-       * Default Destructor
-       */
-      ~TeProjectiveGTFactory();
-      
-    protected :  
-    
-      /**
-       * Implementation for the abstract TeFactory::build.
-       *
-       * @param arg A const reference to the used parameters.
-       * @return A pointer to the new generated instance.
-       */
-      TeGeometricTransformation* build( const TeGTParams& arg );
-      
-  };
-
-  namespace
-  {  
-    static TeProjectiveGTFactory TeProjectiveGTFactory_instance;
-  };
-  
-#endif
-
+/*
+TerraLib - a library for developing GIS applications.
+Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular
+purpose. The library provided hereunder is on an "as is" basis, and the
+authors have no obligation to provide maintenance, support, updates,
+enhancements, or modifications.
+In no event shall INPE be held liable to any party
+for direct, indirect, special, incidental, or consequential damages arising
+out of the use of this library and its documentation.
+*/
+
+#ifndef TEPROJECTIVEGTFACTORY_H
+  #define TEPROJECTIVEGTFACTORY_H
+  
+  #include <TeGTFactory.h>
+
+  /**
+   * @brief This is the projective geometric trasformation factory.
+   * @author Emerson M.A. Xavier <emerson at dpi.inpe.br>
+   * @ingroup GeometricTransformationGroup
+   */
+  class TL_DLL TeProjectiveGTFactory : public TeGTFactory
+  {
+    public :
+      
+      /**
+       * Default constructor
+       */
+      TeProjectiveGTFactory();      
+      
+      /**
+       * Default Destructor
+       */
+      ~TeProjectiveGTFactory();
+      
+    protected :  
+    
+      /**
+       * Implementation for the abstract TeFactory::build.
+       *
+       * @param arg A const reference to the used parameters.
+       * @return A pointer to the new generated instance.
+       */
+      TeGeometricTransformation* build( const TeGTParams& arg );
+      
+  };
+
+  namespace
+  {  
+    static TeProjectiveGTFactory TeProjectiveGTFactory_instance;
+  };
+  
+#endif
+
diff --git a/src/terralib/kernel/TePrototype.h b/src/terralib/kernel/TePrototype.h
old mode 100755
new mode 100644
index 3accde1..56cfcb6
--- a/src/terralib/kernel/TePrototype.h
+++ b/src/terralib/kernel/TePrototype.h
@@ -1,83 +1,83 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TePrototype.h
-    \brief This file contains a template for the "TePrototype" pattern.
-*/
-#ifndef TePrototype_H
-#define TePrototype_H
-//!  Implements a template for the "Prototype" pattern.
-/*
-	See the book "Design Patterns - Elements of Reusable Object-Oriented Software", by Gamma et. al.
-	for further documentation.
-*/
-
-#include "TeDefines.h"
-
-template <class T>
-class TePrototype
-{
-public:
-
-	//! Export pointer to the structure
-	typedef  TePrototype<T>* TePrototypePtr;
-
-// -- Normal Constructor
-
-	//! Constructor
-	TePrototype ();
-	
-	//! Destructor
-	virtual ~TePrototype() {}
-
-	//! Virtual Constructor 
-	static T* clone ();
-
-	//! Builds a new type (should be implemented by descendants)
-    virtual T* build () = 0;
-
-private:
-	static TePrototypePtr instance_;
-};
-
-// Initialisation of static variable
-template <class T>
-typename TePrototype<T>::TePrototypePtr TePrototype<T>::instance_;
-
-// Constructor
-template <class T>
-TePrototype<T>::TePrototype()
-{
-	// Put the object in the factory dictionary
-	instance_ = this;
-}
-
-// Virtual Constructor
-template <class T> 
-T*
-TePrototype<T>::clone ()
-{
-	return instance_->build();
-}
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TePrototype.h
+    \brief This file contains a template for the "TePrototype" pattern.
+*/
+#ifndef TePrototype_H
+#define TePrototype_H
+//!  Implements a template for the "Prototype" pattern.
+/*
+	See the book "Design Patterns - Elements of Reusable Object-Oriented Software", by Gamma et. al.
+	for further documentation.
+*/
+
+#include "TeDefines.h"
+
+template <class T>
+class TePrototype
+{
+public:
+
+	//! Export pointer to the structure
+	typedef  TePrototype<T>* TePrototypePtr;
+
+// -- Normal Constructor
+
+	//! Constructor
+	TePrototype ();
+	
+	//! Destructor
+	virtual ~TePrototype() {}
+
+	//! Virtual Constructor 
+	static T* clone ();
+
+	//! Builds a new type (should be implemented by descendants)
+    virtual T* build () = 0;
+
+private:
+	static TePrototypePtr instance_;
+};
+
+// Initialisation of static variable
+template <class T>
+typename TePrototype<T>::TePrototypePtr TePrototype<T>::instance_;
+
+// Constructor
+template <class T>
+TePrototype<T>::TePrototype()
+{
+	// Put the object in the factory dictionary
+	instance_ = this;
+}
+
+// Virtual Constructor
+template <class T> 
+T*
+TePrototype<T>::clone ()
+{
+	return instance_->build();
+}
+
+#endif
+
diff --git a/src/terralib/kernel/TeProxMatrixConstructionStrategy.cpp b/src/terralib/kernel/TeProxMatrixConstructionStrategy.cpp
old mode 100755
new mode 100644
index e5d4bac..cf9e983
--- a/src/terralib/kernel/TeProxMatrixConstructionStrategy.cpp
+++ b/src/terralib/kernel/TeProxMatrixConstructionStrategy.cpp
@@ -1,922 +1,1492 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-
-#include "TeProxMatrixConstructionStrategy.h"
-#include "TeProgress.h"
-#include "TeSTEvent.h"
-#include "TeSTInstance.h"
-
-//////////////////////////////////////////////////////////////////////
-// Auxiliary Functions for construction strategies
-//////////////////////////////////////////////////////////////////////
-
-bool
-TeFindObjectCentroid (TeMultiGeometry& mGeom, TeGeomRep rep, TeCoord2D& p)
-{		
-		if(rep == TePOLYGONS)
-		{
-			TePolygonSet pols;
-			if(mGeom.getGeometry(pols))
-				p = TeFindCentroid (pols);
-			else
-				return false;
-		}
-		else if (rep == TeLINES)
-		{
-			TeLineSet lines;
-			if(mGeom.getGeometry (lines))
-				p = TeFindCentroid (lines);
-			else
-				return false;
-		}
-		else if (rep == TePOINTS)
-		{
-			TePointSet points;
-			if(mGeom.getGeometry (points))
-				p = TeFindCentroid (points);
-			else
-				return false;
-		}
-		else if (rep == TeCELLS)
-		{
-			TeCellSet cells;
-			if(mGeom.getGeometry (cells))
-				p = TeFindCentroid (cells);
-			else
-				return false;
-		}
-		else if (rep == TeTEXT)
-		{
-			TeTextSet texts;
-			if(mGeom.getGeometry (texts))
-				p = TeFindCentroid (texts);
-			else
-				return false;
-		}		
-		return true;
-}
-
-bool
-TeFindObjectsCentroid (TeSTElementSet* objects, const string& object_id, TeGeomRep rep, TeCoord2D& p)
-{
-	if(rep==TePOLYGONS)
-	{
-		TePolygonSet polygons;
-		if(objects->getGeometry (object_id, polygons))
-			p = TeFindCentroid (polygons);
-	}
-	else if (rep==TeLINES)
-	{
-		TeLineSet lines;
-		if(objects->getGeometry (object_id, lines))
-			p = TeFindCentroid (lines);		
-	}
-	else if (rep==TePOINTS)
-	{
-		TePointSet points;
-		if(objects->getGeometry (object_id, points))
-			p = TeFindCentroid (points);					
-	}
-	else if (rep==TeCELLS)
-	{
-		TeCellSet cells;
-		if(objects->getGeometry(object_id, cells))
-			p = TeFindCentroid (cells);
-	}
-	return true;
-}
-
-
-bool  TeSelectEntryPoints (TeNodeSet  entry_set, map<string, string> entry_geom_map, TeGraphNetwork* net,
-						double max_dist, TeSTElementSet* objects, TeGeomRep rep, TeProxMatrixImplementation* imp)
-{
-
-	// Compute minimum path for all the new nodes/geometries near the network
-	// and connect the ones close enough
-	TeNodeSet::iterator it_node1 = entry_set.begin();
-	while ( it_node1 != entry_set.end())
-	{
-		vector<double> minimum_path;
-		if (net->minimumPath ((*it_node1), entry_set, minimum_path))
-		{
-		int j  = 0;
-		// Check maximum connection distance and connect selected objects
-		TeNodeSet::iterator it_node2 = entry_set.begin();
-		while ( it_node2 != entry_set.end())
-		{
-			// Get ids to simplify the code
-			string node1_id   = (*it_node1).objectId(); // Created Node id, nearest point to Geom1
-			string node2_id   = (*it_node2).objectId();	// Created Node id, nearest point to Geom1		
-			string object1_id = entry_geom_map[node1_id]; // Input Geom1 id
-			string object2_id = entry_geom_map[node2_id]; // Input Geom2 id
-
-			// Check identity and maximum allowed distance through the network
-	  		if ((object1_id != object2_id) && (minimum_path[j] <= max_dist))
-				{	
-					// Compute attributes and connect objects
-					TeProxMatrixAttributes attr;
-					
-					TeCoord2D p1, p2;
-					if (!TeFindObjectsCentroid (objects, object1_id, rep, p1))
-						return false;
-
-					if (!TeFindObjectsCentroid (objects, object2_id, rep, p2))
-						return false;
-				
-					// Local istance between input geometries
-					attr.CentroidDistance (TeDistance (p1, p2));
-
-					// Total distance from input geometries centroids to network
-					attr.NetworkObjectsDistance (TeDistance (p1, (*it_node1).location()) + 
-												 TeDistance (p2, (*it_node2).location()));	
-				
-					// Minimum path from the nodes relatives to the two geometries
-					attr.NetworkMinimumPath (minimum_path[j]);  
-			
-					imp->connectObjects (object1_id, object2_id, attr); // for networks, only one direction is connected
-				}
-			it_node2++;
-			j++;
-		}
-		}
-		it_node1++;
-	}
-	return true;
-}
-
-
-bool  TeSelectEntryPoints2 (TeNodeSet    entry_set1,
-						  TeNodeSet    entry_set2,
-						map<string, string> entry_geom_map,
-						TeGraphNetwork* net,
-						double max_dist, 
-						TeSTElementSet* objects1,
-						TeGeomRep rep1,
-						TeSTElementSet* objects2,
-						TeGeomRep rep2,
-						TeProxMatrixImplementation* imp)
-{
-
-	// Compute minimum path for all the new nodes/geometries near the network
-	// and connect the ones close enough
-	TeNodeSet::iterator it_node1 = entry_set1.begin();
-	while ( it_node1 != entry_set1.end())
-	{
-		vector<double> minimum_path;
-		net->minimumPath ((*it_node1), entry_set2, minimum_path); 
-		if (minimum_path.size() > 0)
-		{
-			int j  = 0;
-		// Check maximum connection distance and connect selected objects
-			TeNodeSet::iterator it_node2 = entry_set2.begin();
-			while ( it_node2 != entry_set2.end())
-			{
-			    // Get ids to simplify the code
-				string node1_id   = (*it_node1).objectId(); // Created Node id, nearest point to Geom1
-				string node2_id   = (*it_node2).objectId();	// Created Node id, nearest point to Geom1		
-				string object1_id = entry_geom_map[node1_id]; // Input Geom1 id
-				string object2_id = entry_geom_map[node2_id]; // Input Geom2 id
-	
-		
-				// Check identity and maximum allowed distance through the network
-	  			if ((object1_id != object2_id) && (minimum_path[j] <= max_dist))
-				{
-					
-					// Compute attributes and connect objects
-					TeProxMatrixAttributes attr;
-
-					TeCoord2D p1, p2;
-					if (!TeFindObjectsCentroid (objects1, object1_id, rep1, p1))
-						return false;
-
-					if (!TeFindObjectsCentroid (objects2, object2_id, rep2,  p2))
-						return false;
-		
-					// Local distance
-					attr.CentroidDistance (TeDistance (p1, p2));
-
-					// Total distance from input geometries centroids to network
-					attr.NetworkObjectsDistance (TeDistance (p1, (*it_node1).location()) + 
-												 TeDistance (p2, (*it_node2).location()));	
-				
-					// Minimum path from the nodes relatives to the two geometries
-					attr.NetworkMinimumPath (minimum_path[j]);  
-			
-					imp->connectObjects (object1_id, object2_id, attr); // for networks, only one direction is connected
-				}
-				it_node2++;
-				j++;
-			}
-		}
-		it_node1++;
-	}
-	return true;
-}
-
-
-//////////////////////////////////////////////////////////////////////
-// TeProxMatrixLocalAdjacencyStrategy 
-//////////////////////////////////////////////////////////////////////
-
-TeProxMatrixLocalAdjacencyStrategy::TeProxMatrixLocalAdjacencyStrategy () : 
-		TeProxMatrixConstructionStrategy<TeSTElementSet> (0, TeGEOMETRYNONE, TeAdjacencyStrategy)
-		{ }
-
-
-TeProxMatrixLocalAdjacencyStrategy::TeProxMatrixLocalAdjacencyStrategy (TeSTElementSet*  objects, TeGeomRep	geomRep, bool calcDistance):
-		TeProxMatrixConstructionStrategy<TeSTElementSet> (objects, geomRep, TeAdjacencyStrategy)
-		{
-			params_.calculate_distance_=calcDistance;
-		}
-
-
-TeProxMatrixLocalAdjacencyStrategy::TeProxMatrixLocalAdjacencyStrategy (TeProxMatrixLocalAdjacencyStrategy& st):
-		TeProxMatrixConstructionStrategy<TeSTElementSet> (st)
-		{ }
-
-bool 
-TeProxMatrixLocalAdjacencyStrategy::Construct (TeProxMatrixImplementation* imp)
-{
-	if (imp == 0) 
-		return false;
-	
-	// Iterate over all selected objects, selecting their neighbours
-	TeSTElementSet::iterator itobj1 = objects_->begin();
-	
-	// ----- progress bar
-	int step = 0;
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(objects_->numSTInstance());
-	// -----
-
-	TeProjection* proj = 0;
-	if(objects_->theme())
-		proj = objects_->theme()->layer()->projection();
-	else if(objects_->getLayer())
-		proj = objects_->getLayer()->projection();
-	TePrecision::instance().setPrecision(TeGetPrecision(proj));
-		
-	while ( itobj1 != objects_->end())
-	{
-		// Gets the possible adjacent objects from RTree in the element set
-		vector<TeSTInstance*> result;
-		objects_->search((*itobj1).getGeometries().getBox(), result);
-		string object_id1 = (*itobj1).getObjectId(); 
-
-		TePolygonSet	polSet1;
-		TeCellSet		cellSet1;
-		itobj1->getGeometry(polSet1);
-		itobj1->getGeometry(cellSet1);
-        
-		for(unsigned int i=0; i<result.size(); ++i)
-		{
-			string object_id2 = result[i]->getObjectId(); 
-
-			if(object_id1==object_id2)
-				continue;
-			
-			bool touch = false; 
-			if(params_.geom_rep1_==TePOLYGONS)
-			{				
-				TePolygonSet polSet2;
-				result[i]->getGeometry(polSet2);
-				for(unsigned int index=0; index<polSet1.size(); ++index)
-				{					
-					for(unsigned int index2=0; index2<polSet2.size(); ++index2)
-					{
-                        bool curTouches = TeTouches(polSet1[index], polSet2[index2]);
-						if(touch && !curTouches)
-						{
-							//verifies if the current polygons are disjunt
-							if(!TeDisjoint(polSet1[index], polSet2[index2]))
-							{
-								touch = false;
-								index = polSet1.size();
-								break;
-							}
-						}
-						touch = curTouches;
-					}
-				}
-			}
-			else if(params_.geom_rep1_==TeCELLS)
-			{
-				TeCellSet cellSet2;
-				result[i]->getGeometry(cellSet2);
-				for(unsigned int index=0; index<cellSet1.size(); ++index)
-				{					
-					for(unsigned int index2=0; index2<cellSet2.size(); ++index2)
-					{
-                        bool curTouches = TeTouches(cellSet1[index], cellSet2[index2]);
-						if(touch && !curTouches)
-						{
-							//verifies if the current polygons are disjoint
-							if(!TeDisjoint(cellSet1[index], cellSet2[index2]))
-							{
-								touch = false;
-								index = cellSet1.size();
-								break;
-							}
-						}
-						touch = curTouches;
-					}
-				}
-			}
-
-			if(touch)
-			{
-				if (!imp->isConnected (object_id1,object_id2))
-				{
-					TeProxMatrixAttributes attr;
-
-					if(params_.calculate_distance_)
-					{
-						TeCoord2D p1 = (*itobj1).getCentroid();
-						TeCoord2D p2 = result[i]->getCentroid();
-						attr.CentroidDistance (TeDistance (p1, p2)); 
-					}
-					imp->connectObjects (object_id2, object_id1, attr);
-					imp->connectObjects (object_id1, object_id2, attr);
-				}
-			}
-		}
-
-		if(TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			else
-				TeProgress::instance()->setProgress(step);
-		}	
-		++step;
-		++itobj1;
-	}
-		
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true; 
-}
-
-
-TeProxMatrixLocalAdjacencyStrategy& 
-TeProxMatrixLocalAdjacencyStrategy::operator= (const TeProxMatrixLocalAdjacencyStrategy& rhs)
-{
-	if ( this != &rhs )
-	{
-		objects_ = rhs.objects_;
-		params_ = rhs.params_;
-	}
-	return *this;
-}
-
-bool 
-TeProxMatrixLocalAdjacencyStrategy::operator== (const TeProxMatrixLocalAdjacencyStrategy& rhs) const   
-{ 
-	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(rhs)); 
-}
-	
-
-
-
-//////////////////////////////////////////////////////////////////////
-// TeProxMatrixNearestNeighbourStrategy 
-//////////////////////////////////////////////////////////////////////
-TeProxMatrixNearestNeighbourStrategy::TeProxMatrixNearestNeighbourStrategy ():
-	TeProxMatrixConstructionStrategy<TeSTEventSet> () 
-	{ }
-
-TeProxMatrixNearestNeighbourStrategy::TeProxMatrixNearestNeighbourStrategy (TeSTEventSet* objects, int num_neighbours):
-	TeProxMatrixConstructionStrategy<TeSTEventSet> (objects, TePOINTS, TeNearestNeighboursStrategy) 
-	{
-		params_.num_neighbours_=num_neighbours;
-	}
-	
-TeProxMatrixNearestNeighbourStrategy::TeProxMatrixNearestNeighbourStrategy (const TeProxMatrixNearestNeighbourStrategy& st):
-	TeProxMatrixConstructionStrategy<TeSTEventSet>(st)
-	{} 
-	
-bool 
-TeProxMatrixNearestNeighbourStrategy::Construct (TeProxMatrixImplementation* imp)
-{
-	if (imp == 0) 
-		return false;
-
-	// ----- progress bar
-	int step = 0;
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(objects_->numSTInstance());
-	// -----
-
-	TePrecision::instance().setPrecision(TeGetPrecision(objects_->getTheme()->layer()->projection()));
-	TeSTEventSet::iterator it = objects_->begin();
-	while(it!=objects_->end())
-	{
-		TePoint p = (*it).getGeometries();
-		string object_id1=(*it).getObjectId();
-
-		vector<TeSTEvent*>  result;
-		vector<double>  dists;
-		
-		if(!objects_->nearestNeighbourSearch(p.location(), result, dists, (params_.num_neighbours_+1)))
-		{
-			++it;
-			continue;
-		}
-
-		for(unsigned int j=0; j<result.size(); ++j)
-		{
-			if(dists[j]==TeMAXFLOAT)
-				continue;
-
-			string object_id2 = result[j]->getObjectId();
-		
-			if ((object_id1 != object_id2) && (!imp->isConnected (object_id1,object_id2)))
-			{
-				TeProxMatrixAttributes attr;
-				attr.CentroidDistance (dists[j]); 
-				
-				imp->connectObjects (object_id1, object_id2, attr);
-			}
-		}
-
-
-		//------ progress bar
-		if(TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			else
-				TeProgress::instance()->setProgress(step);
-		}	
-		++step;
-		
-		++it;
-	}
-
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true; 
-}
-
-bool 
-TeProxMatrixNearestNeighbourStrategy::operator== (const TeProxMatrixNearestNeighbourStrategy& s) const
-{
-	return (TeProxMatrixConstructionStrategy<TeSTEventSet>::IsEqual(s)); 
-}
-		
-TeProxMatrixNearestNeighbourStrategy& 
-TeProxMatrixNearestNeighbourStrategy::operator= (const TeProxMatrixNearestNeighbourStrategy& rhs)
-{
-	if ( this != &rhs )
-	{
-		objects_ = rhs.objects_;
-		params_ = rhs.params_;
-	}
-	return *this;
-}
-
-//////////////////////////////////////////////////////////////////////
-// TeProxMatrixClosedNetworkStrategy 
-//////////////////////////////////////////////////////////////////////
-
-TeProxMatrixClosedNetworkStrategy::TeProxMatrixClosedNetworkStrategy (TeSTElementSet*  objects,
-										TeGeomRep rep, double max_local_distance,
-										double max_net_distance, double  max_connection_distance, 
-										TeGraphNetwork* input_net) : 	
-	TeProxMatrixConstructionStrategy<TeSTElementSet>(objects, rep, TeClosedNetworkStrategy),
-	net_ (input_net) 
-	{
-		params_.max_distance_= max_local_distance; 
-		params_.max_net_distance_ = max_net_distance; 
-		params_.max_connection_distance_= max_connection_distance; 
-	}
-
-
-
-TeProxMatrixClosedNetworkStrategy::TeProxMatrixClosedNetworkStrategy (const TeProxMatrixClosedNetworkStrategy& rhs) :
-	TeProxMatrixConstructionStrategy<TeSTElementSet>(rhs)
-{
-		TeGraphNetwork* n = new TeGraphNetwork();
-		*n = *rhs.net_; 
-		net_ = n;
-}
-
-	  
-bool 
-TeProxMatrixClosedNetworkStrategy::Construct (TeProxMatrixImplementation* imp)
-{
-	if (imp == 0) return false;
-
-	// Connect local neighbours, based on the Local Distance Strategy
-
-	TeProxMatrixLocalDistanceStrategy<TeSTElementSet> local(objects_, params_.geom_rep1_, params_.max_distance_);
-	local.Construct (imp);
-
-	// Connect neighbours through the network. The process is the following:
-	// 1. The nearest node (entry points) in the network for all the input geometries
-	//    are computed;
-	// 2. If the distance from the geometry centroid to the entry point is smaller than the maximum allowed, 
-	//    create a new node in the network corresponding to this entry point.
-	// 3. Compute the minimum path among all these new nodes (entry points).
-	// 4. For each pair of entry points, if the minimum path distance is smaller than the
-	//    maximum allowed, the corresponding geometries will be connected.
-
-	if (net_ == 0) return false;
-
-	map<string, string> entry_geom_map; // maps input geometries to network entry points
-	TeNodeSet entry_set; // entry points
-
-	// ----- progress bar
-	int step = 0;
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(objects_->numSTInstance());
-	// -----
-
-	// Iterate over all objects and select the ones that are close enough to the network
-	TeSTElementSet::iterator itobj1 = objects_->begin();
-	while ( itobj1 != objects_->end())
-	{
-		// Get object1 id and representation
-		string object_id1 = (*itobj1).getObjectId(); 
-		TeCoord2D p1, p2; 
-			
-
-		int i = 0;
-		double min_distance = 0.;
-	
-		net_->nearestNodePoint (p1, i, p2, min_distance);
-				
-		TeNode node;
-		if ((min_distance <= params_.max_net_distance_) && net_->getNode(i, node))
-		{
-			entry_geom_map[node.objectId()] = object_id1; // Associates geometry with closest net nodes
-			entry_set.add (node);  // This set will be used as initial points in the shortest path algorithm
-		}
-
-		if(TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			else
-				TeProgress::instance()->setProgress(step);
-		}
-		++step;
-		++itobj1;
-	}
-
-	TeSelectEntryPoints (entry_set, entry_geom_map, net_, params_.max_connection_distance_, objects_, params_.geom_rep1_, imp);
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-		
-	return true;
-}
-
-
-bool 
-TeProxMatrixClosedNetworkStrategy::IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const
-{
-	return (*this == (TeProxMatrixClosedNetworkStrategy&) other); 
-}
-	
-TeProxMatrixClosedNetworkStrategy& 
-TeProxMatrixClosedNetworkStrategy::operator= (const TeProxMatrixClosedNetworkStrategy& rhs)
-{
-	if (!(this==&rhs))
-	{
-		objects_ = rhs.objects_;
-		params_ = rhs.params_;
-			
-		TeGraphNetwork* n = new TeGraphNetwork(); 
-		*n = *rhs.net_; 
-		net_ = n;       
-	}
-	return (*this);
-}
-
-	
-bool 
-TeProxMatrixClosedNetworkStrategy::operator== (const TeProxMatrixClosedNetworkStrategy& other) const 
-{
-	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(other));
-}
-	   
-//////////////////////////////////////////////////////////////////////
-// TeProxMatrixOpenNetworkStrategy 
-//////////////////////////////////////////////////////////////////////
-
-TeProxMatrixOpenNetworkStrategy::TeProxMatrixOpenNetworkStrategy (TeSTElementSet*  objects, TeGeomRep rep, 
-										double max_local_distance, 
-										double	max_net_distance, double  max_connetion_distance, 
-										TeGraphNetwork* input_net) : 	
-	TeProxMatrixConstructionStrategy<TeSTElementSet>(objects, rep, TeOpenNetworkStrategy),
-	net_ (input_net)
-	{
-		params_.max_distance_= max_local_distance; 
-		params_.max_net_distance_ = max_net_distance; 
-		params_.max_connection_distance_= max_connetion_distance; 
-	}
-
-
-TeProxMatrixOpenNetworkStrategy::TeProxMatrixOpenNetworkStrategy (const TeProxMatrixOpenNetworkStrategy& rhs): 
-	TeProxMatrixConstructionStrategy<TeSTElementSet>(rhs)
-{
-	TeGraphNetwork* n = new TeGraphNetwork();
-	*n = *rhs.net_; 
-	net_ = n;
-}
-
-bool 
-TeProxMatrixOpenNetworkStrategy::Construct (TeProxMatrixImplementation* imp)
-{
-	if (imp == 0) 
-		return false;
-
-	// Connect local neighbours, based on the Local Distance Strategy
-	if (params_.max_distance_ > 0)
-	{
-		TeProxMatrixLocalDistanceStrategy<TeSTElementSet> local(objects_, params_.geom_rep1_, params_.max_distance_);
-		local.Construct (imp);
-	}
-
-	// Connect neighbours through the network. The process is the following:
-	// 1. The nearest point (entry points) in the network for all the input geometries
-	//    are computed;
-	// 2. If the distance from the geometry centroid to the entry point is smaller than the maximum allowed, 
-	//    create a new node in the network corresponding to this entry point.
-	// 3. Compute the minimum path among all these new nodes (entry points).
-	// 4. For each pair of entry points, if the minimum path distance is smaller than the
-	//    maximum allowed, the corresponding geometries will be connected.
-	if (net_ == 0) 
-		return false;
-
-	map<string, string> entry_geom_map; // maps input geometries to network entry points
-	TeNodeSet entry_set; // entry points
-
-	// Iterate over all objects and select the ones that are close enough to the network
-	TeSTElementSet::iterator itobj1 = objects_->begin();
-	int id = 0;  // Nodes to be created will have sequential object_ids. 
-				 // The existing network nodes have object_id equal to their position
-	while ( itobj1 != objects_->end())
-
-	{
-		// Get object1 id and representation
-		string object_id1 = (*itobj1).getObjectId();
-		cout << object_id1 << "id " << id << endl;
-
-		TeCoord2D p1; 
-		if (!TeFindObjectCentroid (itobj1->getGeometries(), params_.geom_rep1_, p1))
-			return false;
-
-
-		int line_index;
-		TeCoord2D pinter;
-		double min_dist;
-
-		if (net_->nearestNetworkPoint (p1, line_index, pinter, min_dist))
-		{
-			if (min_dist < params_.max_net_distance_)
-			{
-				TeNode new_node;
-				new_node.add (pinter);
-				new_node.objectId (Te2String (id));
-				id++;
-
-				net_->breakLineSet (new_node, line_index);
-				entry_geom_map[new_node.objectId()] = object_id1; // Associates geometry with closest net nodes
-				entry_set.add (new_node);  // This set will be used as initial points in the shortest path algorithm
-			}
-		}
-		++itobj1;
-	}
-
-    TeLineSet lineSet = net_->getLineSet();
-    map<string, double> lineCosts =  net_->getLineCosts();
-	TeGraphNetwork net(lineSet, lineCosts);
-	TeSelectEntryPoints (entry_set, entry_geom_map, &net, params_.max_connection_distance_, objects_, params_.geom_rep1_, imp);
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-
-bool 
-TeProxMatrixOpenNetworkStrategy::IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const
-{
-	return ((*this)==(TeProxMatrixOpenNetworkStrategy&)other); 
-}
-
-bool 
-TeProxMatrixOpenNetworkStrategy::operator== (const TeProxMatrixOpenNetworkStrategy& other) const 
-{
-	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(other));
-}
-
-
-TeProxMatrixOpenNetworkStrategy& 
-TeProxMatrixOpenNetworkStrategy::operator= (const TeProxMatrixOpenNetworkStrategy& rhs)
-{
-	if (!(this==&rhs))
-	{
-		params_ = rhs.params_;
-		objects_ = rhs.objects_;
-		
-		TeGraphNetwork* n = new TeGraphNetwork(); 
-		*n = *rhs.net_;                           
-		net_ = n;								
-	}
-	return (*this);
-}
-
-
-/////////////////////////////////////////////////////////////////////
-// TeProxMatrixOpenNetworkStrategy2 
-//////////////////////////////////////////////////////////////////////
-
-TeProxMatrixOpenNetworkStrategy2::TeProxMatrixOpenNetworkStrategy2 (TeSTElementSet*  objects1, 
-										TeGeomRep rep1,
-										TeSTElementSet*  objects2, TeGeomRep rep2,
-										double max_local_distance, 
-										double	max_net_distance, double  max_connetion_distance, 
-										TeGraphNetwork* input_net) : 	
-	TeProxMatrixConstructionStrategy<TeSTElementSet>(objects1, rep1, TeOpenNetworkStrategy2),
-	objects2_ (objects2),
-	net_ (input_net)
-	{
-		if(objects2_->theme())
-			params_.theme_id2_=objects2_->theme()->id();
-		params_.geom_rep2_=rep2;
-		params_.max_distance_= max_local_distance; 
-		params_.max_net_distance_ = max_net_distance; 
-		params_.max_connection_distance_= max_connetion_distance; 
-	}  
-
-TeProxMatrixOpenNetworkStrategy2::TeProxMatrixOpenNetworkStrategy2 (const TeProxMatrixOpenNetworkStrategy2& rhs)
-                    : TeProxMatrixConstructionStrategy<TeSTElementSet>(rhs)
-{
-	objects2_ = rhs.objects2_;
-	params_ = rhs.params_;
-	
-	TeGraphNetwork* n = new TeGraphNetwork();
-	*n = *rhs.net_; 
-	net_ = n;
-}
-
-
-bool 
-TeProxMatrixOpenNetworkStrategy2:: Construct (TeProxMatrixImplementation* imp)
-	{
-		if (imp == 0) 
-			return false;
-
-
-		// Connect neighbours through the network. The process is the following:
-		// 1. The nearest point (entry points) in the network for all the input geometries
-		//    are computed;
-		// 2. If the distance from the geometry centroid to the entry point is smaller than the maximum allowed, 
-		//    create a new node in the network corresponding to this entry point.
-		// 3. Compute the minimum path among all these new nodes (entry points).
-		// 4. For each pair of entry points, if the minimum path distance is smaller than the
-		//    maximum allowed, the corresponding geometries will be connected.
-		if (net_ == 0) 
-			return false;
-
-		map<string, string> entry_geom_map; // maps input geometries to network entry points
-
-	
-		int id = 0;  // Nodes to be created will have sequential object_ids. 
-					 // The existing network nodes have object_id equal to their position
-		// Iterate over all objects and select the ones that are close enough to the network
-
-		TeNodeSet entry_set1; // entry points
-		TeSTElementSet::iterator itobj1 = objects_->begin();	
-		while ( itobj1 != objects_->end())
-		{
-			// Get object1 id and representation
-			string object_id1 = (*itobj1).getObjectId();
-					cout << "object1 " << object_id1 << "id" << id << endl;
-
-			TeCoord2D p1; 
-			if (!TeFindObjectCentroid (itobj1->getGeometries(), params_.geom_rep1_, p1))
-				return false;
-		
-
-			int line_index;
-			TeCoord2D pinter;
-			double min_dist;
-
-			if (net_->nearestNetworkPoint (p1, line_index, pinter, min_dist))
-			{
-				if (min_dist < params_.max_net_distance_)
-				{
-					TeNode new_node;
-					new_node.add (pinter);
-					new_node.objectId (Te2String (id));
-					id++;
-
-					net_->breakLineSet (new_node, line_index);
-					entry_geom_map[new_node.objectId()] = object_id1; // Associates geometry with closest net nodes
-					entry_set1.add (new_node);  // This set will be used as initial points in the shortest path algorithm
-				}
-			}
-			++itobj1;
-		}
-
-
-	// Iterate over all objects of interst (objects2) 
-		TeNodeSet entry_set2; // entry points
-		TeSTElementSet::iterator itobj2 = objects2_->begin();		
-		while ( itobj2 != objects2_->end())
-		{
-			// Get object1 id and representation
-			string object_id2 = (*itobj2).getObjectId();
-					cout << "object2 " << object_id2 << "id" << id << endl;
-
-			TeCoord2D p2; 
-			if (!TeFindObjectCentroid (itobj1->getGeometries(), params_.geom_rep2_, p2))
-				return false;
-		
-			int line_index;
-			TeCoord2D pinter;
-			double min_dist;
-
-			if (net_->nearestNetworkPoint (p2, line_index, pinter, min_dist))
-			{ 
-				TeNode new_node;
-				new_node.add (pinter);
-				new_node.objectId (Te2String (id));
-				id++;
-
-				net_->breakLineSet (new_node, line_index);
-				entry_geom_map[new_node.objectId()] = object_id2; // Associates geometry with closest net nodes
-				entry_set2.add (new_node);  // This set will be used as initial points in the shortest path algorithm
-			}
-			++itobj2;
-		}
-
-        TeLineSet lineSet = net_->getLineSet();
-        map<string, double> lineCosts = net_->getLineCosts();
-		TeGraphNetwork net(lineSet, lineCosts);
-		TeSelectEntryPoints2 (entry_set1, entry_set2, entry_geom_map, &net, params_.max_connection_distance_, 
-			objects_, params_.geom_rep1_, objects2_, params_.geom_rep2_, imp);
-			return true;
-	}
-
-bool 
-TeProxMatrixOpenNetworkStrategy2::IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const
-{
-	return ((*this)==(TeProxMatrixOpenNetworkStrategy2&)other); 
-}
-
-bool 
-TeProxMatrixOpenNetworkStrategy2:: operator== (const TeProxMatrixOpenNetworkStrategy2& other) const 
-{
-	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(other));
-}
-
-TeProxMatrixOpenNetworkStrategy2& 
-TeProxMatrixOpenNetworkStrategy2:: operator= (const TeProxMatrixOpenNetworkStrategy2& rhs)
-{
-		if (!(this==&rhs))
-		{
-			params_ = rhs.params_;
-			objects_ = rhs.objects_;
-			objects2_ = rhs.objects2_;
-		
-			TeGraphNetwork* n = new TeGraphNetwork(); 
-			*n = *rhs.net_;  
-			net_ = n;       
-		}
-		return (*this);
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+
+#include "TeProxMatrixConstructionStrategy.h"
+#include "TeProgress.h"
+#include "TeSTEvent.h"
+#include "TeSTInstance.h"
+
+#include "TeOverlay.h"
+
+//////////////////////////////////////////////////////////////////////
+// Auxiliary Functions for construction strategies
+//////////////////////////////////////////////////////////////////////
+
+bool
+TeFindObjectCentroid (TeMultiGeometry& mGeom, TeGeomRep rep, TeCoord2D& p)
+{		
+		if(rep == TePOLYGONS)
+		{
+			TePolygonSet pols;
+			if(mGeom.getGeometry(pols))
+				p = TeFindCentroid (pols);
+			else
+				return false;
+		}
+		else if (rep == TeLINES)
+		{
+			TeLineSet lines;
+			if(mGeom.getGeometry (lines))
+				p = TeFindCentroid (lines);
+			else
+				return false;
+		}
+		else if (rep == TePOINTS)
+		{
+			TePointSet points;
+			if(mGeom.getGeometry (points))
+				p = TeFindCentroid (points);
+			else
+				return false;
+		}
+		else if (rep == TeCELLS)
+		{
+			TeCellSet cells;
+			if(mGeom.getGeometry (cells))
+				p = TeFindCentroid (cells);
+			else
+				return false;
+		}
+		else if (rep == TeTEXT)
+		{
+			TeTextSet texts;
+			if(mGeom.getGeometry (texts))
+				p = TeFindCentroid (texts);
+			else
+				return false;
+		}		
+		return true;
+}
+
+bool
+TeFindObjectsCentroid (TeSTElementSet* objects, const string& object_id, TeGeomRep rep, TeCoord2D& p)
+{
+	if(rep==TePOLYGONS)
+	{
+		TePolygonSet polygons;
+		if(objects->getGeometry (object_id, polygons))
+			p = TeFindCentroid (polygons);
+	}
+	else if (rep==TeLINES)
+	{
+		TeLineSet lines;
+		if(objects->getGeometry (object_id, lines))
+			p = TeFindCentroid (lines);		
+	}
+	else if (rep==TePOINTS)
+	{
+		TePointSet points;
+		if(objects->getGeometry (object_id, points))
+			p = TeFindCentroid (points);					
+	}
+	else if (rep==TeCELLS)
+	{
+		TeCellSet cells;
+		if(objects->getGeometry(object_id, cells))
+			p = TeFindCentroid (cells);
+	}
+	return true;
+}
+
+
+bool  TeSelectEntryPoints (TeNodeSet  entry_set, map<string, string> entry_geom_map, TeGraphNetwork* net,
+						double max_dist, TeSTElementSet* objects, TeGeomRep rep, TeProxMatrixImplementation* imp)
+{
+
+	// Compute minimum path for all the new nodes/geometries near the network
+	// and connect the ones close enough
+	TeNodeSet::iterator it_node1 = entry_set.begin();
+	while ( it_node1 != entry_set.end())
+	{
+		vector<double> minimum_path;
+		if (net->minimumPath ((*it_node1), entry_set, minimum_path))
+		{
+		int j  = 0;
+		// Check maximum connection distance and connect selected objects
+		TeNodeSet::iterator it_node2 = entry_set.begin();
+		while ( it_node2 != entry_set.end())
+		{
+			// Get ids to simplify the code
+			string node1_id   = (*it_node1).objectId(); // Created Node id, nearest point to Geom1
+			string node2_id   = (*it_node2).objectId();	// Created Node id, nearest point to Geom1		
+			string object1_id = entry_geom_map[node1_id]; // Input Geom1 id
+			string object2_id = entry_geom_map[node2_id]; // Input Geom2 id
+
+			// Check identity and maximum allowed distance through the network
+	  		if ((object1_id != object2_id) && (minimum_path[j] <= max_dist))
+				{	
+					// Compute attributes and connect objects
+					TeProxMatrixAttributes attr;
+					
+					TeCoord2D p1, p2;
+					if (!TeFindObjectsCentroid (objects, object1_id, rep, p1))
+						return false;
+
+					if (!TeFindObjectsCentroid (objects, object2_id, rep, p2))
+						return false;
+				
+					// Local istance between input geometries
+					attr.CentroidDistance (TeDistance (p1, p2));
+
+					// Total distance from input geometries centroids to network
+					attr.NetworkObjectsDistance (TeDistance (p1, (*it_node1).location()) + 
+												 TeDistance (p2, (*it_node2).location()));	
+				
+					// Minimum path from the nodes relatives to the two geometries
+					attr.NetworkMinimumPath (minimum_path[j]);  
+			
+					imp->connectObjects (object1_id, object2_id, attr); // for networks, only one direction is connected
+				}
+			it_node2++;
+			j++;
+		}
+		}
+		it_node1++;
+	}
+	return true;
+}
+
+
+bool  TeSelectEntryPoints2 (TeNodeSet    entry_set1,
+						  TeNodeSet    entry_set2,
+						map<string, string> entry_geom_map,
+						TeGraphNetwork* net,
+						double max_dist, 
+						TeSTElementSet* objects1,
+						TeGeomRep rep1,
+						TeSTElementSet* objects2,
+						TeGeomRep rep2,
+						TeProxMatrixImplementation* imp)
+{
+
+	// Compute minimum path for all the new nodes/geometries near the network
+	// and connect the ones close enough
+	TeNodeSet::iterator it_node1 = entry_set1.begin();
+	while ( it_node1 != entry_set1.end())
+	{
+		vector<double> minimum_path;
+		net->minimumPath ((*it_node1), entry_set2, minimum_path); 
+		if (minimum_path.size() > 0)
+		{
+			int j  = 0;
+		// Check maximum connection distance and connect selected objects
+			TeNodeSet::iterator it_node2 = entry_set2.begin();
+			while ( it_node2 != entry_set2.end())
+			{
+			    // Get ids to simplify the code
+				string node1_id   = (*it_node1).objectId(); // Created Node id, nearest point to Geom1
+				string node2_id   = (*it_node2).objectId();	// Created Node id, nearest point to Geom1		
+				string object1_id = entry_geom_map[node1_id]; // Input Geom1 id
+				string object2_id = entry_geom_map[node2_id]; // Input Geom2 id
+	
+		
+				// Check identity and maximum allowed distance through the network
+	  			if ((object1_id != object2_id) && (minimum_path[j] <= max_dist))
+				{
+					
+					// Compute attributes and connect objects
+					TeProxMatrixAttributes attr;
+
+					TeCoord2D p1, p2;
+					if (!TeFindObjectsCentroid (objects1, object1_id, rep1, p1))
+						return false;
+
+					if (!TeFindObjectsCentroid (objects2, object2_id, rep2,  p2))
+						return false;
+		
+					// Local distance
+					attr.CentroidDistance (TeDistance (p1, p2));
+
+					// Total distance from input geometries centroids to network
+					attr.NetworkObjectsDistance (TeDistance (p1, (*it_node1).location()) + 
+												 TeDistance (p2, (*it_node2).location()));	
+				
+					// Minimum path from the nodes relatives to the two geometries
+					attr.NetworkMinimumPath (minimum_path[j]);  
+			
+					imp->connectObjects (object1_id, object2_id, attr); // for networks, only one direction is connected
+				}
+				it_node2++;
+				j++;
+			}
+		}
+		it_node1++;
+	}
+	return true;
+}
+
+
+//////////////////////////////////////////////////////////////////////
+// TeProxMatrixLocalAdjacencyStrategy 
+//////////////////////////////////////////////////////////////////////
+
+TeProxMatrixLocalAdjacencyStrategy::TeProxMatrixLocalAdjacencyStrategy () : 
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (0, TeGEOMETRYNONE, TeAdjacencyStrategy)
+		{ }
+
+
+TeProxMatrixLocalAdjacencyStrategy::TeProxMatrixLocalAdjacencyStrategy (TeSTElementSet*  objects, TeGeomRep	geomRep, bool calcDistance):
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (objects, geomRep, TeAdjacencyStrategy)
+		{
+			params_.calculate_distance_=calcDistance;
+		}
+
+
+TeProxMatrixLocalAdjacencyStrategy::TeProxMatrixLocalAdjacencyStrategy (TeProxMatrixLocalAdjacencyStrategy& st):
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (st)
+		{ }
+
+bool 
+TeProxMatrixLocalAdjacencyStrategy::Construct (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) 
+		return false;
+	
+	// Iterate over all selected objects, selecting their neighbours
+	TeSTElementSet::iterator itobj1 = objects_->begin();
+	
+	// ----- progress bar
+	int step = 0;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(objects_->numSTInstance());
+	// -----
+
+	TeProjection* proj = 0;
+	if(objects_->theme())
+		proj = objects_->theme()->layer()->projection();
+	else if(objects_->getLayer())
+		proj = objects_->getLayer()->projection();
+	TePrecision::instance().setPrecision(TeGetPrecision(proj));
+		
+	while ( itobj1 != objects_->end())
+	{
+		// Gets the possible adjacent objects from RTree in the element set
+		vector<TeSTInstance*> result;
+		objects_->search((*itobj1).getGeometries().getBox(), result);
+		string object_id1 = (*itobj1).getObjectId(); 
+
+		TePolygonSet	polSet1;
+		TeCellSet		cellSet1;
+		itobj1->getGeometry(polSet1);
+		itobj1->getGeometry(cellSet1);
+        
+		for(unsigned int i=0; i<result.size(); ++i)
+		{
+			string object_id2 = result[i]->getObjectId(); 
+
+			if(object_id1==object_id2)
+				continue;
+			
+			bool touch = false; 
+			if(params_.geom_rep1_==TePOLYGONS)
+			{				
+				TePolygonSet polSet2;
+				result[i]->getGeometry(polSet2);
+				for(unsigned int index=0; index<polSet1.size(); ++index)
+				{					
+					for(unsigned int index2=0; index2<polSet2.size(); ++index2)
+					{
+                        bool curTouches = TeTouches(polSet1[index], polSet2[index2]);
+						if(touch && !curTouches)
+						{
+							//verifies if the current polygons are disjunt
+							if(!TeDisjoint(polSet1[index], polSet2[index2]))
+							{
+								touch = false;
+								index = polSet1.size();
+								break;
+							}
+						}
+						touch = curTouches;
+					}
+				}
+			}
+			else if(params_.geom_rep1_==TeCELLS)
+			{
+				TeCellSet cellSet2;
+				result[i]->getGeometry(cellSet2);
+				for(unsigned int index=0; index<cellSet1.size(); ++index)
+				{					
+					for(unsigned int index2=0; index2<cellSet2.size(); ++index2)
+					{
+                        bool curTouches = TeTouches(cellSet1[index], cellSet2[index2]);
+						if(touch && !curTouches)
+						{
+							//verifies if the current polygons are disjoint
+							if(!TeDisjoint(cellSet1[index], cellSet2[index2]))
+							{
+								touch = false;
+								index = cellSet1.size();
+								break;
+							}
+						}
+						touch = curTouches;
+					}
+				}
+			}
+
+			if(touch)
+			{
+				if (!imp->isConnected (object_id1,object_id2))
+				{
+					TeProxMatrixAttributes attr;
+
+					if(params_.calculate_distance_)
+					{
+						TeCoord2D p1 = (*itobj1).getCentroid();
+						TeCoord2D p2 = result[i]->getCentroid();
+						attr.CentroidDistance (TeDistance (p1, p2)); 
+					}
+					imp->connectObjects (object_id2, object_id1, attr);
+					imp->connectObjects (object_id1, object_id2, attr);
+				}
+			}
+		}
+
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}	
+		++step;
+		++itobj1;
+	}
+		
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true; 
+}
+
+
+TeProxMatrixLocalAdjacencyStrategy& 
+TeProxMatrixLocalAdjacencyStrategy::operator= (const TeProxMatrixLocalAdjacencyStrategy& rhs)
+{
+	if ( this != &rhs )
+	{
+		objects_ = rhs.objects_;
+		params_ = rhs.params_;
+	}
+	return *this;
+}
+
+bool 
+TeProxMatrixLocalAdjacencyStrategy::operator== (const TeProxMatrixLocalAdjacencyStrategy& rhs) const   
+{ 
+	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(rhs)); 
+}
+	
+
+
+
+//////////////////////////////////////////////////////////////////////
+// TeProxMatrixNearestNeighbourStrategy 
+//////////////////////////////////////////////////////////////////////
+TeProxMatrixNearestNeighbourStrategy::TeProxMatrixNearestNeighbourStrategy ():
+	TeProxMatrixConstructionStrategy<TeSTEventSet> () 
+	{ }
+
+TeProxMatrixNearestNeighbourStrategy::TeProxMatrixNearestNeighbourStrategy (TeSTEventSet* objects, int num_neighbours):
+	TeProxMatrixConstructionStrategy<TeSTEventSet> (objects, TePOINTS, TeNearestNeighboursStrategy) 
+	{
+		params_.num_neighbours_=num_neighbours;
+	}
+	
+TeProxMatrixNearestNeighbourStrategy::TeProxMatrixNearestNeighbourStrategy (const TeProxMatrixNearestNeighbourStrategy& st):
+	TeProxMatrixConstructionStrategy<TeSTEventSet>(st)
+	{} 
+	
+bool 
+TeProxMatrixNearestNeighbourStrategy::Construct (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) 
+		return false;
+
+	// ----- progress bar
+	int step = 0;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(objects_->numSTInstance());
+	// -----
+
+	TePrecision::instance().setPrecision(TeGetPrecision(objects_->getTheme()->layer()->projection()));
+	TeSTEventSet::iterator it = objects_->begin();
+	while(it!=objects_->end())
+	{
+		TePoint p = (*it).getGeometries();
+		string object_id1=(*it).getObjectId();
+
+		vector<TeSTEvent*>  result;
+		vector<double>  dists;
+		
+		if(!objects_->nearestNeighbourSearch(p.location(), result, dists, (params_.num_neighbours_+1)))
+		{
+			++it;
+			continue;
+		}
+
+		for(unsigned int j=0; j<result.size(); ++j)
+		{
+			if(dists[j]==TeMAXFLOAT)
+				continue;
+
+			string object_id2 = result[j]->getObjectId();
+		
+			if ((object_id1 != object_id2) && (!imp->isConnected (object_id1,object_id2)))
+			{
+				TeProxMatrixAttributes attr;
+				attr.CentroidDistance (dists[j]); 
+				
+				imp->connectObjects (object_id1, object_id2, attr);
+			}
+		}
+
+
+		//------ progress bar
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}	
+		++step;
+		
+		++it;
+	}
+
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true; 
+}
+
+bool 
+TeProxMatrixNearestNeighbourStrategy::operator== (const TeProxMatrixNearestNeighbourStrategy& s) const
+{
+	return (TeProxMatrixConstructionStrategy<TeSTEventSet>::IsEqual(s)); 
+}
+		
+TeProxMatrixNearestNeighbourStrategy& 
+TeProxMatrixNearestNeighbourStrategy::operator= (const TeProxMatrixNearestNeighbourStrategy& rhs)
+{
+	if ( this != &rhs )
+	{
+		objects_ = rhs.objects_;
+		params_ = rhs.params_;
+	}
+	return *this;
+}
+
+//////////////////////////////////////////////////////////////////////
+// TeProxMatrixClosedNetworkStrategy 
+//////////////////////////////////////////////////////////////////////
+
+TeProxMatrixClosedNetworkStrategy::TeProxMatrixClosedNetworkStrategy (TeSTElementSet*  objects,
+										TeGeomRep rep, double max_local_distance,
+										double max_net_distance, double  max_connection_distance, 
+										TeGraphNetwork* input_net) : 	
+	TeProxMatrixConstructionStrategy<TeSTElementSet>(objects, rep, TeClosedNetworkStrategy),
+	net_ (input_net) 
+	{
+		params_.max_distance_= max_local_distance; 
+		params_.max_net_distance_ = max_net_distance; 
+		params_.max_connection_distance_= max_connection_distance; 
+	}
+
+
+
+TeProxMatrixClosedNetworkStrategy::TeProxMatrixClosedNetworkStrategy (const TeProxMatrixClosedNetworkStrategy& rhs) :
+	TeProxMatrixConstructionStrategy<TeSTElementSet>(rhs)
+{
+		TeGraphNetwork* n = new TeGraphNetwork();
+		*n = *rhs.net_; 
+		net_ = n;
+}
+
+	  
+bool 
+TeProxMatrixClosedNetworkStrategy::Construct (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) return false;
+
+	// Connect local neighbours, based on the Local Distance Strategy
+
+	TeProxMatrixLocalDistanceStrategy<TeSTElementSet> local(objects_, params_.geom_rep1_, params_.max_distance_);
+	local.Construct (imp);
+
+	// Connect neighbours through the network. The process is the following:
+	// 1. The nearest node (entry points) in the network for all the input geometries
+	//    are computed;
+	// 2. If the distance from the geometry centroid to the entry point is smaller than the maximum allowed, 
+	//    create a new node in the network corresponding to this entry point.
+	// 3. Compute the minimum path among all these new nodes (entry points).
+	// 4. For each pair of entry points, if the minimum path distance is smaller than the
+	//    maximum allowed, the corresponding geometries will be connected.
+
+	if (net_ == 0) return false;
+
+	map<string, string> entry_geom_map; // maps input geometries to network entry points
+	TeNodeSet entry_set; // entry points
+
+	// ----- progress bar
+	int step = 0;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(objects_->numSTInstance());
+	// -----
+
+	// Iterate over all objects and select the ones that are close enough to the network
+	TeSTElementSet::iterator itobj1 = objects_->begin();
+	while ( itobj1 != objects_->end())
+	{
+		// Get object1 id and representation
+		string object_id1 = (*itobj1).getObjectId(); 
+		TeCoord2D p1, p2; 
+			
+
+		int i = 0;
+		double min_distance = 0.;
+	
+		net_->nearestNodePoint (p1, i, p2, min_distance);
+				
+		TeNode node;
+		if ((min_distance <= params_.max_net_distance_) && net_->getNode(i, node))
+		{
+			entry_geom_map[node.objectId()] = object_id1; // Associates geometry with closest net nodes
+			entry_set.add (node);  // This set will be used as initial points in the shortest path algorithm
+		}
+
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}
+		++step;
+		++itobj1;
+	}
+
+	TeSelectEntryPoints (entry_set, entry_geom_map, net_, params_.max_connection_distance_, objects_, params_.geom_rep1_, imp);
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+		
+	return true;
+}
+
+
+bool 
+TeProxMatrixClosedNetworkStrategy::IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const
+{
+	return (*this == (TeProxMatrixClosedNetworkStrategy&) other); 
+}
+	
+TeProxMatrixClosedNetworkStrategy& 
+TeProxMatrixClosedNetworkStrategy::operator= (const TeProxMatrixClosedNetworkStrategy& rhs)
+{
+	if (!(this==&rhs))
+	{
+		objects_ = rhs.objects_;
+		params_ = rhs.params_;
+			
+		TeGraphNetwork* n = new TeGraphNetwork(); 
+		*n = *rhs.net_; 
+		net_ = n;       
+	}
+	return (*this);
+}
+
+	
+bool 
+TeProxMatrixClosedNetworkStrategy::operator== (const TeProxMatrixClosedNetworkStrategy& other) const 
+{
+	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(other));
+}
+	   
+//////////////////////////////////////////////////////////////////////
+// TeProxMatrixOpenNetworkStrategy 
+//////////////////////////////////////////////////////////////////////
+
+TeProxMatrixOpenNetworkStrategy::TeProxMatrixOpenNetworkStrategy (TeSTElementSet*  objects, TeGeomRep rep, 
+										double max_local_distance, 
+										double	max_net_distance, double  max_connetion_distance, 
+										TeGraphNetwork* input_net) : 	
+	TeProxMatrixConstructionStrategy<TeSTElementSet>(objects, rep, TeOpenNetworkStrategy),
+	net_ (input_net)
+	{
+		params_.max_distance_= max_local_distance; 
+		params_.max_net_distance_ = max_net_distance; 
+		params_.max_connection_distance_= max_connetion_distance; 
+	}
+
+
+TeProxMatrixOpenNetworkStrategy::TeProxMatrixOpenNetworkStrategy (const TeProxMatrixOpenNetworkStrategy& rhs): 
+	TeProxMatrixConstructionStrategy<TeSTElementSet>(rhs)
+{
+	TeGraphNetwork* n = new TeGraphNetwork();
+	*n = *rhs.net_; 
+	net_ = n;
+}
+
+bool 
+TeProxMatrixOpenNetworkStrategy::Construct (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) 
+		return false;
+
+	// Connect local neighbours, based on the Local Distance Strategy
+	if (params_.max_distance_ > 0)
+	{
+		TeProxMatrixLocalDistanceStrategy<TeSTElementSet> local(objects_, params_.geom_rep1_, params_.max_distance_);
+		local.Construct (imp);
+	}
+
+	// Connect neighbours through the network. The process is the following:
+	// 1. The nearest point (entry points) in the network for all the input geometries
+	//    are computed;
+	// 2. If the distance from the geometry centroid to the entry point is smaller than the maximum allowed, 
+	//    create a new node in the network corresponding to this entry point.
+	// 3. Compute the minimum path among all these new nodes (entry points).
+	// 4. For each pair of entry points, if the minimum path distance is smaller than the
+	//    maximum allowed, the corresponding geometries will be connected.
+	if (net_ == 0) 
+		return false;
+
+	map<string, string> entry_geom_map; // maps input geometries to network entry points
+	TeNodeSet entry_set; // entry points
+
+	// Iterate over all objects and select the ones that are close enough to the network
+	TeSTElementSet::iterator itobj1 = objects_->begin();
+	int id = 0;  // Nodes to be created will have sequential object_ids. 
+				 // The existing network nodes have object_id equal to their position
+	while ( itobj1 != objects_->end())
+
+	{
+		// Get object1 id and representation
+		string object_id1 = (*itobj1).getObjectId();
+		cout << object_id1 << "id " << id << endl;
+
+		TeCoord2D p1; 
+		if (!TeFindObjectCentroid (itobj1->getGeometries(), params_.geom_rep1_, p1))
+			return false;
+
+
+		int line_index;
+		TeCoord2D pinter;
+		double min_dist;
+
+		if (net_->nearestNetworkPoint (p1, line_index, pinter, min_dist))
+		{
+			if (min_dist < params_.max_net_distance_)
+			{
+				TeNode new_node;
+				new_node.add (pinter);
+				new_node.objectId (Te2String (id));
+				id++;
+
+				net_->breakLineSet (new_node, line_index);
+				entry_geom_map[new_node.objectId()] = object_id1; // Associates geometry with closest net nodes
+				entry_set.add (new_node);  // This set will be used as initial points in the shortest path algorithm
+			}
+		}
+		++itobj1;
+	}
+
+    TeLineSet lineSet = net_->getLineSet();
+    map<string, double> lineCosts =  net_->getLineCosts();
+	TeGraphNetwork net(lineSet, lineCosts);
+	TeSelectEntryPoints (entry_set, entry_geom_map, &net, params_.max_connection_distance_, objects_, params_.geom_rep1_, imp);
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+
+bool 
+TeProxMatrixOpenNetworkStrategy::IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const
+{
+	return ((*this)==(TeProxMatrixOpenNetworkStrategy&)other); 
+}
+
+bool 
+TeProxMatrixOpenNetworkStrategy::operator== (const TeProxMatrixOpenNetworkStrategy& other) const 
+{
+	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(other));
+}
+
+
+TeProxMatrixOpenNetworkStrategy& 
+TeProxMatrixOpenNetworkStrategy::operator= (const TeProxMatrixOpenNetworkStrategy& rhs)
+{
+	if (!(this==&rhs))
+	{
+		params_ = rhs.params_;
+		objects_ = rhs.objects_;
+		
+		TeGraphNetwork* n = new TeGraphNetwork(); 
+		*n = *rhs.net_;                           
+		net_ = n;								
+	}
+	return (*this);
+}
+
+
+/////////////////////////////////////////////////////////////////////
+// TeProxMatrixOpenNetworkStrategy2 
+//////////////////////////////////////////////////////////////////////
+
+TeProxMatrixOpenNetworkStrategy2::TeProxMatrixOpenNetworkStrategy2 (TeSTElementSet*  objects1, 
+										TeGeomRep rep1,
+										TeSTElementSet*  objects2, TeGeomRep rep2,
+										double max_local_distance, 
+										double	max_net_distance, double  max_connetion_distance, 
+										TeGraphNetwork* input_net) : 	
+	TeProxMatrixConstructionStrategy<TeSTElementSet>(objects1, rep1, TeOpenNetworkStrategy2),
+	objects2_ (objects2),
+	net_ (input_net)
+	{
+		if(objects2_->theme())
+			params_.theme_id2_=objects2_->theme()->id();
+		params_.geom_rep2_=rep2;
+		params_.max_distance_= max_local_distance; 
+		params_.max_net_distance_ = max_net_distance; 
+		params_.max_connection_distance_= max_connetion_distance; 
+	}  
+
+TeProxMatrixOpenNetworkStrategy2::TeProxMatrixOpenNetworkStrategy2 (const TeProxMatrixOpenNetworkStrategy2& rhs)
+                    : TeProxMatrixConstructionStrategy<TeSTElementSet>(rhs)
+{
+	objects2_ = rhs.objects2_;
+	params_ = rhs.params_;
+	
+	TeGraphNetwork* n = new TeGraphNetwork();
+	*n = *rhs.net_; 
+	net_ = n;
+}
+
+
+bool 
+TeProxMatrixOpenNetworkStrategy2:: Construct (TeProxMatrixImplementation* imp)
+	{
+		if (imp == 0) 
+			return false;
+
+
+		// Connect neighbours through the network. The process is the following:
+		// 1. The nearest point (entry points) in the network for all the input geometries
+		//    are computed;
+		// 2. If the distance from the geometry centroid to the entry point is smaller than the maximum allowed, 
+		//    create a new node in the network corresponding to this entry point.
+		// 3. Compute the minimum path among all these new nodes (entry points).
+		// 4. For each pair of entry points, if the minimum path distance is smaller than the
+		//    maximum allowed, the corresponding geometries will be connected.
+		if (net_ == 0) 
+			return false;
+
+		map<string, string> entry_geom_map; // maps input geometries to network entry points
+
+	
+		int id = 0;  // Nodes to be created will have sequential object_ids. 
+					 // The existing network nodes have object_id equal to their position
+		// Iterate over all objects and select the ones that are close enough to the network
+
+		TeNodeSet entry_set1; // entry points
+		TeSTElementSet::iterator itobj1 = objects_->begin();	
+		while ( itobj1 != objects_->end())
+		{
+			// Get object1 id and representation
+			string object_id1 = (*itobj1).getObjectId();
+					cout << "object1 " << object_id1 << "id" << id << endl;
+
+			TeCoord2D p1; 
+			if (!TeFindObjectCentroid (itobj1->getGeometries(), params_.geom_rep1_, p1))
+				return false;
+		
+
+			int line_index;
+			TeCoord2D pinter;
+			double min_dist;
+
+			if (net_->nearestNetworkPoint (p1, line_index, pinter, min_dist))
+			{
+				if (min_dist < params_.max_net_distance_)
+				{
+					TeNode new_node;
+					new_node.add (pinter);
+					new_node.objectId (Te2String (id));
+					id++;
+
+					net_->breakLineSet (new_node, line_index);
+					entry_geom_map[new_node.objectId()] = object_id1; // Associates geometry with closest net nodes
+					entry_set1.add (new_node);  // This set will be used as initial points in the shortest path algorithm
+				}
+			}
+			++itobj1;
+		}
+
+
+	// Iterate over all objects of interst (objects2) 
+		TeNodeSet entry_set2; // entry points
+		TeSTElementSet::iterator itobj2 = objects2_->begin();		
+		while ( itobj2 != objects2_->end())
+		{
+			// Get object1 id and representation
+			string object_id2 = (*itobj2).getObjectId();
+					cout << "object2 " << object_id2 << "id" << id << endl;
+
+			TeCoord2D p2; 
+			if (!TeFindObjectCentroid (itobj1->getGeometries(), params_.geom_rep2_, p2))
+				return false;
+		
+			int line_index;
+			TeCoord2D pinter;
+			double min_dist;
+
+			if (net_->nearestNetworkPoint (p2, line_index, pinter, min_dist))
+			{ 
+				TeNode new_node;
+				new_node.add (pinter);
+				new_node.objectId (Te2String (id));
+				id++;
+
+				net_->breakLineSet (new_node, line_index);
+				entry_geom_map[new_node.objectId()] = object_id2; // Associates geometry with closest net nodes
+				entry_set2.add (new_node);  // This set will be used as initial points in the shortest path algorithm
+			}
+			++itobj2;
+		}
+
+        TeLineSet lineSet = net_->getLineSet();
+        map<string, double> lineCosts = net_->getLineCosts();
+		TeGraphNetwork net(lineSet, lineCosts);
+		TeSelectEntryPoints2 (entry_set1, entry_set2, entry_geom_map, &net, params_.max_connection_distance_, 
+			objects_, params_.geom_rep1_, objects2_, params_.geom_rep2_, imp);
+			return true;
+	}
+
+bool 
+TeProxMatrixOpenNetworkStrategy2::IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const
+{
+	return ((*this)==(TeProxMatrixOpenNetworkStrategy2&)other); 
+}
+
+bool 
+TeProxMatrixOpenNetworkStrategy2:: operator== (const TeProxMatrixOpenNetworkStrategy2& other) const 
+{
+	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(other));
+}
+
+TeProxMatrixOpenNetworkStrategy2& 
+TeProxMatrixOpenNetworkStrategy2:: operator= (const TeProxMatrixOpenNetworkStrategy2& rhs)
+{
+		if (!(this==&rhs))
+		{
+			params_ = rhs.params_;
+			objects_ = rhs.objects_;
+			objects2_ = rhs.objects2_;
+		
+			TeGraphNetwork* n = new TeGraphNetwork(); 
+			*n = *rhs.net_;  
+			net_ = n;       
+		}
+		return (*this);
+}
+
+	
+
+//////////////////////////////////////////////////////////////////////
+// TeProxMatrixLocalTopologyStrategy  - S�rgio Costa, Evaldinolia
+//////////////////////////////////////////////////////////////////////
+
+//When cell resolutions are perfectly matched, and a simple "within" spatial operator is capable 
+//of defining the parenthood relationship between cells in both layers
+
+
+TeProxMatrixLocalTopologyStrategy::TeProxMatrixLocalTopologyStrategy () : 
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (0, TeGEOMETRYNONE, TeAdjacencyStrategy)
+		{ }
+
+
+TeProxMatrixLocalTopologyStrategy::TeProxMatrixLocalTopologyStrategy (TeSTElementSet*  objects, TeGeomRep	geomRep,TeSTElementSet*  objects2, TeGeomRep	geomRep2, int toprel, bool calcDistance):
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (objects, geomRep, TeAdjacencyStrategy)
+		{
+			objects2_= objects2;
+			geomRep2_=	geomRep2;
+			toprel_ = toprel;
+			params_.calculate_distance_=calcDistance;
+		}
+
+
+TeProxMatrixLocalTopologyStrategy::TeProxMatrixLocalTopologyStrategy (TeProxMatrixLocalTopologyStrategy& st):
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (st)
+		{ }
+
+bool 
+TeProxMatrixLocalTopologyStrategy::Construct (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) 
+		return false;
+	
+	// Iterate over all selected objects, selecting their neighbours
+	TeSTElementSet::iterator itobj1 = objects_->begin();
+	
+	// ----- progress bar
+	int num_total_steps = objects_->numSTInstance() ; //* objects2_->numSTInstance();
+	int step = 0;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(num_total_steps);
+	// -----
+
+	TeProjection* proj = 0;
+	if(objects_->theme())
+		proj = objects_->theme()->layer()->projection();
+	else if(objects_->getLayer())
+		proj = objects_->getLayer()->projection();
+	TePrecision::instance().setPrecision(TeGetPrecision(proj));
+		
+	while ( itobj1 != objects_->end())
+	{
+		// Gets the possible adjacent objects from RTree in the element set
+		//vector<TeSTInstance*> result;
+		
+		TeSTElementSet::iterator itobj2 = objects2_->begin();
+		///
+
+		string object_id1 = (*itobj1).getObjectId(); 
+
+		TePolygonSet	polSet1;
+		TeCellSet		cellSet1;
+		itobj1->getGeometry(cellSet1);
+
+        
+		//for(unsigned int i=0; i<result.size(); ++i)
+		while ( itobj2 != objects2_->end())
+		{
+			string object_id2 = (*itobj2).getObjectId(); 
+			
+				bool resultTopology = false; 
+				TeCellSet cellSet2;
+				TePolygonSet	polSet2;
+				itobj2->getGeometry(cellSet2);
+				TeBox b1;
+				TeBox b2;
+
+				if (params_.geom_rep1_==TePOLYGONS){
+					b1 = polSet1.box();
+				}
+				else if (params_.geom_rep1_==TeCELLS){
+					b1 = cellSet1.box();
+				}
+				if (geomRep2_==TePOLYGONS){
+					b2 = polSet2.box(); }
+				else if (geomRep2_==TeCELLS) {
+					b2 = cellSet2.box(); }
+
+				resultTopology = TeWithinOrCoveredByOrEquals(b2, b1);
+				//resultTopology = TeIntersects(b2, b1);
+
+			if(resultTopology)
+			{
+				if (!imp->isConnected (object_id1,object_id2))
+				{
+					TeProxMatrixAttributes attr;
+
+					if(params_.calculate_distance_)
+					{
+						TeCoord2D p1 = (*itobj1).getCentroid();
+						TeCoord2D p2 = (*itobj2).getCentroid();
+						attr.CentroidDistance (TeDistance (p1, p2)); 
+					}
+					//imp->connectObjects (object_id2, object_id1, attr); //  children-father
+					cout << "connecting " << object_id1 << " in "<< object_id2 << endl ;
+					imp->connectObjects (object_id1, object_id2, attr); // father-children
+				}
+			}
+
+			++itobj2;  /// new code
+
+
+		}
+// fim 1
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}	
+
+		++step;
+	
+		++itobj1;
+	}
+	// fim 2	
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true; 
+}
+
+
+TeProxMatrixLocalTopologyStrategy& 
+TeProxMatrixLocalTopologyStrategy::operator= (const TeProxMatrixLocalTopologyStrategy& rhs)
+{
+	if ( this != &rhs )
+	{
+		objects_ = rhs.objects_;
+		params_ = rhs.params_;
+	}
+	return *this;
+}
+
+bool 
+TeProxMatrixLocalTopologyStrategy::operator== (const TeProxMatrixLocalTopologyStrategy& rhs) const   
+{ 
+	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(rhs)); 
+}
+
+
+	
+
+//////////////////////////////////////////////////////////////////////
+// TeProxMatrixChooseOneTopologyStrategy - S�rgio Costa, Evaldinolia
+//////////////////////////////////////////////////////////////////////
+
+//When cell resolutions do not match, this strategy chooses the upper scale cell
+//with larger percentage of intersection as father
+
+
+TeProxMatrixChooseOneTopologyStrategy::TeProxMatrixChooseOneTopologyStrategy () : 
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (0, TeGEOMETRYNONE, TeAdjacencyStrategy)
+		{ }
+
+
+TeProxMatrixChooseOneTopologyStrategy::TeProxMatrixChooseOneTopologyStrategy (TeSTElementSet*  objects, TeGeomRep	geomRep,TeSTElementSet*  objects2, TeGeomRep	geomRep2, int toprel, bool calcDistance):
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (objects, geomRep, TeAdjacencyStrategy)
+		{
+			objects2_= objects2;
+			geomRep2_=	geomRep2;
+			toprel_ = toprel;
+			params_.calculate_distance_=calcDistance;
+		}
+
+
+TeProxMatrixChooseOneTopologyStrategy::TeProxMatrixChooseOneTopologyStrategy (TeProxMatrixChooseOneTopologyStrategy& st):
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (st)
+		{ }
+
+bool 
+TeProxMatrixChooseOneTopologyStrategy::Construct (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) 
+		return false;
+	
+	// Iterate over all selected objects, selecting their neighbours
+	TeSTElementSet::iterator itobj2 = objects2_->begin();
+	
+	// ----- progress bar
+	int num_total_steps = objects_->numSTInstance() * objects2_->numSTInstance();
+	int step = 0;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(num_total_steps);
+
+	TeProjection* proj = 0;
+	if(objects_->theme())
+		proj = objects_->theme()->layer()->projection();
+	else if(objects_->getLayer())
+		proj = objects_->getLayer()->projection();
+	TePrecision::instance().setPrecision(TeGetPrecision(proj));
+		
+	while ( itobj2 != objects2_->end())
+	{
+		// Gets the possible adjacent objects from RTree in the element set
+		map<string, TeBox>  result;
+	   	TeBox b2;
+		
+		TeSTElementSet::iterator itobj1 = objects_->begin();
+		///
+
+		string object_id2 = (*itobj2).getObjectId(); 
+
+		TePolygonSet	polSet2;
+		TeCellSet		cellSet2;
+		itobj2->getGeometry(cellSet2);
+
+        
+		//for(unsigned int i=0; i<result.size(); ++i)
+		while ( itobj1 != objects_->end())
+		{
+			string object_id1 = (*itobj1).getObjectId(); 
+			
+				bool resultTopology = false; 
+				TeCellSet cellSet1;
+				TePolygonSet	polSet1;
+				itobj1->getGeometry(cellSet1);
+				TeBox b1;
+			
+
+				if (params_.geom_rep1_==TePOLYGONS){
+					b1 = polSet1.box();
+				}
+				else if (params_.geom_rep1_==TeCELLS){
+					b1 = cellSet1.box();
+				}
+				if (geomRep2_==TePOLYGONS){
+					b2 = polSet2.box();}
+
+				else if (geomRep2_==TeCELLS) {
+					b2 = cellSet2.box(); }
+
+				resultTopology = TeIntersects(b2, b1); // object set within same object id - Fault
+						
+
+			if(resultTopology)
+			{
+				result[object_id1] = b1;
+				
+			}
+
+			++itobj1;  /// new code
+
+
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}
+		
+		++step;
+		}
+// fim 1
+
+		
+		double areaMax = 0.0;
+		string areaMaxId;
+		map<string, TeBox>::iterator itresult = result.begin();
+
+		TePolygonSet box_ps2;
+		TePolygon pol2 = polygonFromBox(b2);
+		box_ps2.add(pol2);
+
+            while (itresult != result.end())
+            {
+                 // convert input box to a polygonset
+				TePolygonSet box_ps1;
+				
+				TePolygonSet intersect;
+
+				TePolygon pol1 = polygonFromBox((*itresult).second);
+				box_ps1.add(pol1);
+
+				TeOVERLAY::TeOverlay(box_ps1, box_ps2, intersect, TeINTERSECTION);
+                double intersectArea = TeGeometryArea (intersect);
+
+				if (intersectArea > areaMax)
+				{
+					areaMaxId = (*itresult).first;
+					areaMax = intersectArea;
+				}
+
+                ++itresult;
+            }
+			if (areaMax > 0)
+			{
+
+				if (!imp->isConnected (areaMaxId,object_id2))
+					{
+						TeProxMatrixAttributes attr;
+
+						if(params_.calculate_distance_)
+						{
+							TeCoord2D p1 = (*itobj1).getCentroid();
+							TeCoord2D p2 = (*itobj2).getCentroid();
+							attr.CentroidDistance (TeDistance (p1, p2)); 
+							}
+					//imp->connectObjects (object_id2, object_id1, attr); //  children-father
+					//cout << "connecting " << areaMaxId << " in "<< object_id2 << endl ;
+					imp->connectObjects (areaMaxId, object_id2, attr); // father-children
+				}
+			}
+	
+
+	
+		++itobj2;
+	}
+
+	// fim 2	
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true; 
+}
+
+
+TeProxMatrixChooseOneTopologyStrategy& 
+TeProxMatrixChooseOneTopologyStrategy::operator= (const TeProxMatrixChooseOneTopologyStrategy& rhs)
+{
+	if ( this != &rhs )
+	{
+		objects_ = rhs.objects_;
+		params_ = rhs.params_;
+	}
+	return *this;
+}
+
+bool 
+TeProxMatrixChooseOneTopologyStrategy::operator== (const TeProxMatrixChooseOneTopologyStrategy& rhs) const   
+{ 
+	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(rhs)); 
+}
+
+
+
+	
+
+//////////////////////////////////////////////////////////////////////
+// TeProxMatrixKeepInBothTopologyStrategy - S�rgio Costa, Evaldinolia
+//////////////////////////////////////////////////////////////////////
+
+//When cell resolutions do not match, this strategy keeps all intersected upper cells as father.
+//The percentage of each intersection is stored as a weight of the relationship.
+
+TeProxMatrixKeepInBothTopologyStrategy::TeProxMatrixKeepInBothTopologyStrategy () : 
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (0, TeGEOMETRYNONE, TeAdjacencyStrategy)
+		{ }
+
+
+TeProxMatrixKeepInBothTopologyStrategy::TeProxMatrixKeepInBothTopologyStrategy (TeSTElementSet*  objects, TeGeomRep	geomRep,TeSTElementSet*  objects2, TeGeomRep	geomRep2, int toprel, bool calcDistance):
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (objects, geomRep, TeAdjacencyStrategy)
+		{
+			objects2_= objects2;
+			geomRep2_=	geomRep2;
+			toprel_ = toprel;
+			params_.calculate_distance_=calcDistance;
+		}
+
+
+TeProxMatrixKeepInBothTopologyStrategy::TeProxMatrixKeepInBothTopologyStrategy (TeProxMatrixKeepInBothTopologyStrategy& st):
+		TeProxMatrixConstructionStrategy<TeSTElementSet> (st)
+		{ }
+
+bool 
+TeProxMatrixKeepInBothTopologyStrategy::Construct (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) 
+		return false;
+	
+	// Iterate over all selected objects, selecting their neighbours
+	TeSTElementSet::iterator itobj1 = objects_->begin();
+	
+	// ----- progress bar
+	int step = 0;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(objects_->numSTInstance());
+	// -----
+
+	TeProjection* proj = 0;
+	if(objects_->theme())
+		proj = objects_->theme()->layer()->projection();
+	else if(objects_->getLayer())
+		proj = objects_->getLayer()->projection();
+	TePrecision::instance().setPrecision(TeGetPrecision(proj));
+		
+	while ( itobj1 != objects_->end())
+	{
+		// Gets the possible adjacent objects from RTree in the element set
+		vector<TeSTInstance*> result;
+		
+		TeSTElementSet::iterator itobj2 = objects2_->begin();
+		///
+
+		string object_id1 = (*itobj1).getObjectId(); 
+
+		TePolygonSet	polSet1;
+		TeCellSet		cellSet1;
+		itobj1->getGeometry(cellSet1);
+
+        
+		//for(unsigned int i=0; i<result.size(); ++i)
+		while ( itobj2 != objects2_->end())
+		{
+			string object_id2 = (*itobj2).getObjectId(); 
+			
+				TeCellSet cellSet2;
+				TePolygonSet	polSet2;
+				itobj2->getGeometry(cellSet2);
+				TeBox b1;
+				TeBox b2;
+
+				if (params_.geom_rep1_==TePOLYGONS){
+					b1 = polSet1.box();
+				}
+				else if (params_.geom_rep1_==TeCELLS){
+					b1 = cellSet1.box();
+				}
+				if (geomRep2_==TePOLYGONS){
+					b2 = polSet2.box(); }
+				else if (geomRep2_==TeCELLS) {
+					b2 = cellSet2.box(); }
+
+				
+			if (  (TeIntersects(b2, b1)) && (!TeTouches(b2, b1))  && ( !TeWithinOrCoveredByOrEquals(b2, b1) ) )
+			{
+
+				// convert input box to a polygonset
+				TePolygonSet box_ps1;
+				TePolygon pol1 = polygonFromBox(b1);
+				box_ps1.add(pol1);
+				
+				TePolygonSet box_ps2;
+				TePolygon pol2 = polygonFromBox(b2);
+				box_ps2.add(pol2);
+
+				TePolygonSet intersect;
+
+				TeOVERLAY::TeOverlay(box_ps1, box_ps2, intersect, TeINTERSECTION);
+
+					
+				double areatotal = TeGeometryArea (b1); // posso calcular diretamente sobre o box
+
+				double intersectArea = TeGeometryArea (intersect);
+
+				double percent = ((intersectArea*100) / areatotal);
+
+				if (!imp->isConnected (object_id1,object_id2))
+				{
+					TeProxMatrixAttributes attr;
+				
+					attr.Weight(percent);
+
+					if(params_.calculate_distance_)
+					{
+						TeCoord2D p1 = (*itobj1).getCentroid();
+						TeCoord2D p2 = (*itobj2).getCentroid();
+						attr.CentroidDistance (TeDistance (p1, p2));
+						
+					}
+					//imp->connectObjects (object_id2, object_id1, attr); //  children-father
+					imp->connectObjects (object_id1, object_id2, attr); // father-children
+					cout << "connecting " << object_id1 << " in "<< object_id2 << endl ;
+				}
+			}
+			
+			else if ( TeWithinOrCoveredByOrEquals(b2, b1) )
+			{
+
+				// convert input box to a polygonset
+				/*
+				TePolygonSet box_ps1;
+				TePolygon pol1 = polygonFromBox(b1);
+				box_ps1.add(pol1);
+				
+				TePolygonSet box_ps2;
+				TePolygon pol2 = polygonFromBox(b2);
+				box_ps2.add(pol2);
+
+				TePolygonSet intersect;
+
+				TeOVERLAY::TeOverlay(box_ps1, box_ps2, intersect, TeINTERSECTION);
+				*/
+
+				double areatotal = TeGeometryArea (b1); // posso calcular diretamente sobre o box
+
+				double intersectArea = TeGeometryArea (b2);
+
+				double percent = ((intersectArea*100) / areatotal);
+
+				if (!imp->isConnected (object_id1,object_id2))
+				{
+					TeProxMatrixAttributes attr;
+				
+					attr.Weight(percent);
+
+					if(params_.calculate_distance_)
+					{
+						TeCoord2D p1 = (*itobj1).getCentroid();
+						TeCoord2D p2 = (*itobj2).getCentroid();
+						attr.CentroidDistance (TeDistance (p1, p2));
+						
+					}
+					//imp->connectObjects (object_id2, object_id1, attr); //  children-father
+					imp->connectObjects (object_id1, object_id2, attr); // father-children
+					cout << "connecting " << object_id1 << " in "<< object_id2 << endl ;
+				}
+			}
+
+
+			++itobj2;  /// new code
+		}
+// fim 1
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}	
+		++step;
+		++itobj1;
+	}
+	// fim 2	
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true; 
+}
+
+
+TeProxMatrixKeepInBothTopologyStrategy& 
+TeProxMatrixKeepInBothTopologyStrategy::operator= (const TeProxMatrixKeepInBothTopologyStrategy& rhs)
+{
+	if ( this != &rhs )
+	{
+		objects_ = rhs.objects_;
+		params_ = rhs.params_;
+	}
+	return *this;
+}
+
+bool 
+TeProxMatrixKeepInBothTopologyStrategy::operator== (const TeProxMatrixKeepInBothTopologyStrategy& rhs) const   
+{ 
+	return (TeProxMatrixConstructionStrategy<TeSTElementSet>::IsEqual(rhs)); 
+}
+
+
diff --git a/src/terralib/kernel/TeProxMatrixConstructionStrategy.h b/src/terralib/kernel/TeProxMatrixConstructionStrategy.h
old mode 100755
new mode 100644
index d3a1f87..7d59719
--- a/src/terralib/kernel/TeProxMatrixConstructionStrategy.h
+++ b/src/terralib/kernel/TeProxMatrixConstructionStrategy.h
@@ -1,491 +1,589 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeProxMatrixConstructionStrategy.h
-    \brief This file contains structures and definitions about construction strategies of proximity matrix 
-*/
-
-#ifndef TeProxMatrixConstructionStrategy_H
-#define TeProxMatrixConstructionStrategy_H
-
-#include "TeProxMatrixImplementation.h"
-#include "TeSTElementSet.h"
-#include "TeNetwork.h"
-#include "TeDatabase.h"
-#include "TeMultiGeometry.h"
-
-
-class TeSTEventSet;
-
-TL_DLL bool TeFindObjectCentroid (TeMultiGeometry& mGeom, TeGeomRep rep, TeCoord2D& p);
-
-struct TL_DLL TeProxMatrixConstructionParams
-{
-public:
-
-	//construction parameters
-	int						theme_id1_;
-	TeGeomRep				geom_rep1_;
-	int						theme_id2_;
-	TeGeomRep				geom_rep2_;
-	TeGPMConstructionStrategy		strategy_;
-	double						max_distance_;
-	int							num_neighbours_;
-	double						max_net_distance_;
-	double						max_connection_distance_;
-	bool						calculate_distance_;
-
-	//! Empty contructor 
-	TeProxMatrixConstructionParams():
-		theme_id1_(-1),  
-		geom_rep1_(TeGEOMETRYNONE), 
-		theme_id2_(-1), 
-		geom_rep2_(TeGEOMETRYNONE), 
-		strategy_(TeAdjacencyStrategy), 
-		max_distance_(0.), 
-		num_neighbours_(0), 
-		max_net_distance_(0.),
-		max_connection_distance_(0.), 
-		calculate_distance_(false)
-	{ }
-	
-	//! Constructor
-	TeProxMatrixConstructionParams(const int& theme1, const TeGeomRep& geomRep1, const TeGPMConstructionStrategy& strType):
-		theme_id1_(theme1), 
-		geom_rep1_(geomRep1), 
-		theme_id2_(-1), 
-		geom_rep2_(TeGEOMETRYNONE), 
-		strategy_(strType),
-		max_distance_(0.), 
-		num_neighbours_(0),
-		max_net_distance_(0.),
-		max_connection_distance_(0.), 
-		calculate_distance_(false)
-	{ }
-			
-	//! Operator ==
-	bool operator==(const TeProxMatrixConstructionParams& other) const
-	{
-		return(	(theme_id1_==other.theme_id1_) && (geom_rep1_==other.geom_rep1_) &&
-				(theme_id2_==other.theme_id2_) && (geom_rep2_==other.geom_rep2_) &&
-				(strategy_==other.strategy_) && (max_distance_==other.max_distance_) &&
-				(num_neighbours_==other.num_neighbours_) && (max_net_distance_==other.max_net_distance_) && 
-				(max_connection_distance_==other.max_connection_distance_) &&
-				(calculate_distance_==other.calculate_distance_));
-	}
-};
-
-//! A templated class to representate construction strategies of proximity matrix
-template<typename T>
-class TeProxMatrixConstructionStrategy 
-{
-protected:
-	//! Set of objetcs used to construct the matrix
-	T*   objects_;
-
-	//! Construction paramas
-	TeProxMatrixConstructionParams  params_;
-
-	//! Construct
-	TeProxMatrixConstructionStrategy(); 
-
-	//! Construct
-	TeProxMatrixConstructionStrategy(T* objects, TeGeomRep geomRep, const TeGPMConstructionStrategy& type=TeAdjacencyStrategy);
-
-	//! Copy construct
-	TeProxMatrixConstructionStrategy(const TeProxMatrixConstructionStrategy& st);
-
-public:
-	//! Construct the proximity matrix 
-	virtual bool Construct(TeProxMatrixImplementation*)=0;
-
-	//! Destructor
-	virtual ~TeProxMatrixConstructionStrategy() 
-	{}
-
-	//! Set the set of objects and its geometry representation
-	void setSTObjects (T*  objects, TeGeomRep  geomRep); 
-	
-	//! Get the objects used to construct the matrix
-	T* objects()  { return objects_; } 
-
-	//! Returns the construction params
-	TeProxMatrixConstructionParams& constructionParams() { return params_; }
-	
-	//! Verify if the type of the strategy, the object set and its geometry representation are equal
-	virtual bool IsEqual (const TeProxMatrixConstructionStrategy<T>& other) const;  
-};
-
-template<typename T> 
-TeProxMatrixConstructionStrategy<T>::TeProxMatrixConstructionStrategy() : 
-	objects_(0), 
-	params_(-1, TeGEOMETRYNONE, TeAdjacencyStrategy)
-	{ } 
-
-template<typename T> 
-TeProxMatrixConstructionStrategy<T>::TeProxMatrixConstructionStrategy(T*  objects, TeGeomRep geomRep, const TeGPMConstructionStrategy& type) :
-	objects_(objects)
-	{
-		if(objects->theme())
-			params_.theme_id1_ = objects->theme()->id();
-		params_.geom_rep1_ = geomRep;
-		params_.strategy_ = type;
-	} 
-
-template<typename T> 
-TeProxMatrixConstructionStrategy<T>::TeProxMatrixConstructionStrategy (const TeProxMatrixConstructionStrategy& st)
-{
-	objects_ = st.objects_; 
-	params_ = st.params_;
-}
-
-template<typename T> void 
-TeProxMatrixConstructionStrategy<T>::setSTObjects (T*  objects, TeGeomRep  geomRep)
-{	
-	objects_ = objects; 
-	if(objects->theme())
-		params_.theme_id1_ = objects->theme()->id();
-	params_.geom_rep1_ = geomRep; 
-}
-
-template<typename T> bool 
-TeProxMatrixConstructionStrategy<T>::IsEqual (const TeProxMatrixConstructionStrategy<T>& other) const
-{
-	return ((params_==other.params_) && 
-		((&objects_)==(&other.objects_))); 
-}
-
-
-//! A class to implement the local adjacency strategy of proximity matrix
-class TL_DLL TeProxMatrixLocalAdjacencyStrategy : public  TeProxMatrixConstructionStrategy<TeSTElementSet>
-{
-public:
-
-	//! Constructor
-	TeProxMatrixLocalAdjacencyStrategy (); 
-
-	//! Constructor
-	TeProxMatrixLocalAdjacencyStrategy (TeSTElementSet*  objects, TeGeomRep	geomRep, bool calcDistance=false);
-	
-	//! Copy constructor
-	TeProxMatrixLocalAdjacencyStrategy (TeProxMatrixLocalAdjacencyStrategy& st);  
-	 
-	 //! Destructor
-	virtual ~TeProxMatrixLocalAdjacencyStrategy() {}
-	
-	//! Construct the proximity matrix through local adjacency strategy 
-	virtual bool Construct (TeProxMatrixImplementation* imp);
-		
-	//! Equal operator 
-	bool operator== (const TeProxMatrixLocalAdjacencyStrategy& rhs) const;  
-	
-	//! Assignment operator 
-	TeProxMatrixLocalAdjacencyStrategy& operator= (const TeProxMatrixLocalAdjacencyStrategy& rhs); 
-
-};
-
-
-//! A class to implement the local distance strategy of proximity matrix
-template<typename Set>
-class TeProxMatrixLocalDistanceStrategy : public TeProxMatrixConstructionStrategy<Set>
-{
-public:
-
-	//! Constructor
-	TeProxMatrixLocalDistanceStrategy ();
-	
-	//! Constructor
-	TeProxMatrixLocalDistanceStrategy (Set*  objects, TeGeomRep geomRep, double max_distance); 
-	
-	//! Copy constructor
-	TeProxMatrixLocalDistanceStrategy (const TeProxMatrixLocalDistanceStrategy<Set>& st); 
-	
-	//! Destructor
-	virtual ~TeProxMatrixLocalDistanceStrategy(){}
-	
-	//! Construct the proximity matrix through local distance strategy 
-	virtual bool Construct (TeProxMatrixImplementation* imp); 
-
-	//! Equal operator 
-	bool operator== (const TeProxMatrixLocalDistanceStrategy<Set>& s) const; 
-		
-	//! Assignment operator
-	TeProxMatrixLocalDistanceStrategy<Set>& operator= (const TeProxMatrixLocalDistanceStrategy<Set>& rhs);
-
-};
-
-
-//! A class to implement the nearest neighbour strategy of proximity matrix
-class TL_DLL TeProxMatrixNearestNeighbourStrategy : public  TeProxMatrixConstructionStrategy<TeSTEventSet>
-{
-public:
-	//! Empty constructor
-	TeProxMatrixNearestNeighbourStrategy ();
-
-	//! Constructor
-	// The STEventSet must be created with geometries, using kdTree and ordered by object_id
-	TeProxMatrixNearestNeighbourStrategy (TeSTEventSet* objects, int num_neighbours);
-	
-	//! Copy constructor
-	TeProxMatrixNearestNeighbourStrategy (const TeProxMatrixNearestNeighbourStrategy& st); 
-	
-	//! Destructor
-	virtual ~TeProxMatrixNearestNeighbourStrategy(){}
-	
-	//! Construct the proximity matrix through local distance strategy 
-	virtual bool Construct (TeProxMatrixImplementation* imp); 
-
-	//! Equal operator 
-	bool operator== (const TeProxMatrixNearestNeighbourStrategy& s) const; 
-		
-	//! Assignment operator
-	TeProxMatrixNearestNeighbourStrategy& operator= (const TeProxMatrixNearestNeighbourStrategy& rhs);
-
-};
-
-
-//! A class to implement the closed network strategy of proximity matrix
-class TL_DLL TeProxMatrixClosedNetworkStrategy : public TeProxMatrixConstructionStrategy<TeSTElementSet>
-{
-private:
-	TeGraphNetwork*		net_;
- 
-public:
-	//! Constructor
-	TeProxMatrixClosedNetworkStrategy (	TeSTElementSet*  objects, TeGeomRep rep, double max_local_distance,
-										double max_net_distance, double  max_connection_distance, 
-										TeGraphNetwork* input_net); 
-
-	//! Copy constructor
-	TeProxMatrixClosedNetworkStrategy (const TeProxMatrixClosedNetworkStrategy& rhs);
-		  
-	//! Destructor
-	virtual ~TeProxMatrixClosedNetworkStrategy()
-	{	
-		if(net_)
-			delete (net_); 
-	}
-
-	//! Construct the proximity matrix through closed network strategy 
-	virtual bool Construct (TeProxMatrixImplementation* imp); 
-	
-	//! Verify if is equal
-	virtual bool IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const; 
-	
-	//! Assignment operator
-	TeProxMatrixClosedNetworkStrategy& operator= (const TeProxMatrixClosedNetworkStrategy& rhs);
-
-	//! Equal operator
-	bool operator== (const TeProxMatrixClosedNetworkStrategy& other) const;  
-
-	//! Get the objects used to construct the matrix
-	TeSTElementSet* objects() { return objects_; }
-};
-
-//! A class to implement the open network strategy of proximity matrix (among a set of objetcs)
-class TL_DLL TeProxMatrixOpenNetworkStrategy : public TeProxMatrixConstructionStrategy<TeSTElementSet>
-{
-private:
-	TeGraphNetwork*		net_;
-
-public:
-
-	//! Constructor
-	TeProxMatrixOpenNetworkStrategy (	TeSTElementSet*  objects, TeGeomRep rep, double max_local_distance, 
-										double	max_net_distance, double  max_connetion_distance, 
-										TeGraphNetwork* input_net); 
-	//! Copy constructor
-	TeProxMatrixOpenNetworkStrategy (const TeProxMatrixOpenNetworkStrategy& rhs); 
-	
-	//! Destructor
-	virtual ~TeProxMatrixOpenNetworkStrategy()
-	{
-		if(net_)
-			delete (net_); 
-	}
-
-	//! Construct the proximity matrix through open network strategy
-	virtual bool Construct (TeProxMatrixImplementation* imp); 
-
-	//! Verify if is equal
-	virtual bool IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const; 
-
-	//! Equal operator
-	bool operator== (const TeProxMatrixOpenNetworkStrategy& other) const; 
-	
-	//! Assignment operator
-	TeProxMatrixOpenNetworkStrategy& operator= (const TeProxMatrixOpenNetworkStrategy& rhs);
-};
-
-
-//! A class to implement the open network strategy of proximity matrix (relationships among objetc of two differnt sets)
-class TL_DLL TeProxMatrixOpenNetworkStrategy2 : public TeProxMatrixConstructionStrategy<TeSTElementSet>
-{
-private:
-	TeSTElementSet*		objects2_;
-	TeGraphNetwork*		net_;
-public:
-
-	//! Constructor
-	TeProxMatrixOpenNetworkStrategy2 (	TeSTElementSet*  objects1, TeGeomRep rep1,
-										TeSTElementSet*  objects2, TeGeomRep rep2,
-										double max_local_distance, 
-										double	max_net_distance, double  max_connetion_distance, 
-										TeGraphNetwork* input_net); 
-	//! Copy constructor
-	TeProxMatrixOpenNetworkStrategy2 (const TeProxMatrixOpenNetworkStrategy2& rhs); 
-	
-	//! Destructor
-	virtual ~TeProxMatrixOpenNetworkStrategy2 ()
-	{
-		if(net_)
-			delete (net_); 
-	}
-
-	//! Construct the proximity matrix through open network strategy
-	virtual bool Construct (TeProxMatrixImplementation* imp); 
-
-	//! Verify if is equal
-	virtual bool IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const; 
-
-	//! Equal operator
-	bool operator== (const TeProxMatrixOpenNetworkStrategy2& other) const; 
-	
-	//! Assignment operator
-	TeProxMatrixOpenNetworkStrategy2& operator= (const TeProxMatrixOpenNetworkStrategy2& rhs);
-
-};
-
-//////////////////////////////////////////////////////////////////////
-// TeProxMatrixLocalDistanceStrategy 
-//////////////////////////////////////////////////////////////////////
-template<typename Set> 
-TeProxMatrixLocalDistanceStrategy<Set>::TeProxMatrixLocalDistanceStrategy ():
-		TeProxMatrixConstructionStrategy<Set> (0, TeGEOMETRYNONE, TeDistanceStrategy) 
-		{}
-
-
-template<typename Set> 
-TeProxMatrixLocalDistanceStrategy<Set>::TeProxMatrixLocalDistanceStrategy (Set*  objects, TeGeomRep geomRep, double max_distance): 
-		TeProxMatrixConstructionStrategy<Set>(objects, geomRep, TeDistanceStrategy)
-		{
-			TeProxMatrixConstructionStrategy<Set>::params_.max_distance_ = max_distance; 
-		}
-
-	
-template<typename Set> 
-TeProxMatrixLocalDistanceStrategy<Set>::TeProxMatrixLocalDistanceStrategy (const TeProxMatrixLocalDistanceStrategy<Set>& st): 
-		TeProxMatrixConstructionStrategy<Set>(st)
-		{} 
-
-template<typename Set> bool 
-TeProxMatrixLocalDistanceStrategy<Set>::Construct(TeProxMatrixImplementation* imp)
-{
-	if (imp == 0) 
-		return false;
-	
-	// Iterate over all selected objects, selecting their neighbours
-	TeSTElementSet::iterator itobj1 = TeProxMatrixConstructionStrategy<Set>::objects_->begin();
-	
-	// ----- progress bar
-	int step = 0;
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(TeProxMatrixConstructionStrategy<Set>::objects_->numSTInstance());
-	// -----
-
-	TeProjection* proj = 0;
-	if(TeProxMatrixConstructionStrategy<Set>::objects_->theme())
-		proj = TeProxMatrixConstructionStrategy<Set>::objects_->theme()->layer()->projection();
-	else if(TeProxMatrixConstructionStrategy<Set>::objects_->getLayer())
-		proj = TeProxMatrixConstructionStrategy<Set>::objects_->getLayer()->projection();
-
-	TePrecision::instance().setPrecision(TeGetPrecision(proj));
-	double max_d = TeProxMatrixConstructionStrategy<Set>::params_.max_distance_;
-		
-	while ( itobj1 != TeProxMatrixConstructionStrategy<Set>::objects_->end())
-	{
-		// Gets the possible objects from RTree in the element set
-		vector<TeSTInstance*> result;
-		TeBox b = (*itobj1).getGeometries().getBox();
-		TeBox bAux(b.x1()-max_d, b.y1()-max_d, b.x2()+max_d, b.y2()+max_d);
-		
-		TeProxMatrixConstructionStrategy<Set>::objects_->search(bAux, result);
-
-		string object_id1 = (*itobj1).getObjectId();
-		TeCoord2D coord1 = itobj1->getCentroid();
-		for(unsigned int index =0; index<result.size(); ++index)
-		{
-			string object_id2 = result[index]->getObjectId();
-			if(object_id1==object_id2)
-				continue;
-			
-			TeCoord2D coord2 = result[index]->getCentroid();
-			double dist = TeDistance(coord1, coord2);
-			if(dist <= max_d)
-			{
-				if(!imp->isConnected (object_id1,object_id2))
-				{
-					TeProxMatrixAttributes attr;
-					attr.CentroidDistance (dist);
-					imp->connectObjects (object_id1, object_id2, attr);
-					imp->connectObjects (object_id2, object_id1, attr);
-				}
-			}
-		}
-
-		if(TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			else
-				TeProgress::instance()->setProgress(step);
-		}	
-		++step;
-		++itobj1;
-	}
-	
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-template<typename Set> bool 
-TeProxMatrixLocalDistanceStrategy<Set>::operator== (const TeProxMatrixLocalDistanceStrategy<Set>& s) const 
-{
-	return ( TeProxMatrixConstructionStrategy<Set>::IsEqual(s)); 
-}
-	
-template<typename Set> TeProxMatrixLocalDistanceStrategy<Set>& 
-TeProxMatrixLocalDistanceStrategy<Set>::operator= (const TeProxMatrixLocalDistanceStrategy<Set>& rhs)
-{
-	if ( this != &rhs )
-	{
-		TeProxMatrixConstructionStrategy<Set>::objects_ = rhs.objects_;
-		TeProxMatrixConstructionStrategy<Set>::params_ = rhs.params_;
-	}
-	return *this;
-}
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeProxMatrixConstructionStrategy.h
+    \brief This file contains structures and definitions about construction strategies of proximity matrix 
+*/
+
+#ifndef TeProxMatrixConstructionStrategy_H
+#define TeProxMatrixConstructionStrategy_H
+
+#include "TeProxMatrixImplementation.h"
+#include "TeSTElementSet.h"
+#include "TeNetwork.h"
+#include "TeDatabase.h"
+#include "TeMultiGeometry.h"
+
+
+class TeSTEventSet;
+
+TL_DLL bool TeFindObjectCentroid (TeMultiGeometry& mGeom, TeGeomRep rep, TeCoord2D& p);
+
+struct TL_DLL TeProxMatrixConstructionParams
+{
+public:
+
+	//construction parameters
+	int						theme_id1_;
+	TeGeomRep				geom_rep1_;
+	int						theme_id2_;
+	TeGeomRep				geom_rep2_;
+	TeGPMConstructionStrategy		strategy_;
+	double						max_distance_;
+	int							num_neighbours_;
+	double						max_net_distance_;
+	double						max_connection_distance_;
+	bool						calculate_distance_;
+
+	//! Empty contructor 
+	TeProxMatrixConstructionParams():
+		theme_id1_(-1),  
+		geom_rep1_(TeGEOMETRYNONE), 
+		theme_id2_(-1), 
+		geom_rep2_(TeGEOMETRYNONE), 
+		strategy_(TeAdjacencyStrategy), 
+		max_distance_(0.), 
+		num_neighbours_(0), 
+		max_net_distance_(0.),
+		max_connection_distance_(0.), 
+		calculate_distance_(false)
+	{ }
+	
+	//! Constructor
+	TeProxMatrixConstructionParams(const int& theme1, const TeGeomRep& geomRep1, const TeGPMConstructionStrategy& strType):
+		theme_id1_(theme1), 
+		geom_rep1_(geomRep1), 
+		theme_id2_(-1), 
+		geom_rep2_(TeGEOMETRYNONE), 
+		strategy_(strType),
+		max_distance_(0.), 
+		num_neighbours_(0),
+		max_net_distance_(0.),
+		max_connection_distance_(0.), 
+		calculate_distance_(false)
+	{ }
+			
+	//! Operator ==
+	bool operator==(const TeProxMatrixConstructionParams& other) const
+	{
+		return(	(theme_id1_==other.theme_id1_) && (geom_rep1_==other.geom_rep1_) &&
+				(theme_id2_==other.theme_id2_) && (geom_rep2_==other.geom_rep2_) &&
+				(strategy_==other.strategy_) && (max_distance_==other.max_distance_) &&
+				(num_neighbours_==other.num_neighbours_) && (max_net_distance_==other.max_net_distance_) && 
+				(max_connection_distance_==other.max_connection_distance_) &&
+				(calculate_distance_==other.calculate_distance_));
+	}
+};
+
+//! A templated class to representate construction strategies of proximity matrix
+template<typename T>
+class TeProxMatrixConstructionStrategy 
+{
+protected:
+	//! Set of objetcs used to construct the matrix
+	T*   objects_;
+
+	//! Construction paramas
+	TeProxMatrixConstructionParams  params_;
+
+	//! Construct
+	TeProxMatrixConstructionStrategy(); 
+
+	//! Construct
+	TeProxMatrixConstructionStrategy(T* objects, TeGeomRep geomRep, const TeGPMConstructionStrategy& type=TeAdjacencyStrategy);
+
+	//! Copy construct
+	TeProxMatrixConstructionStrategy(const TeProxMatrixConstructionStrategy& st);
+
+public:
+	//! Construct the proximity matrix 
+	virtual bool Construct(TeProxMatrixImplementation*)=0;
+
+	//! Destructor
+	virtual ~TeProxMatrixConstructionStrategy() 
+	{}
+
+	//! Set the set of objects and its geometry representation
+	void setSTObjects (T*  objects, TeGeomRep  geomRep); 
+	
+	//! Get the objects used to construct the matrix
+	T* objects()  { return objects_; } 
+
+	//! Returns the construction params
+	TeProxMatrixConstructionParams& constructionParams() { return params_; }
+	
+	//! Verify if the type of the strategy, the object set and its geometry representation are equal
+	virtual bool IsEqual (const TeProxMatrixConstructionStrategy<T>& other) const;  
+};
+
+template<typename T> 
+TeProxMatrixConstructionStrategy<T>::TeProxMatrixConstructionStrategy() : 
+	objects_(0), 
+	params_(-1, TeGEOMETRYNONE, TeAdjacencyStrategy)
+	{ } 
+
+template<typename T> 
+TeProxMatrixConstructionStrategy<T>::TeProxMatrixConstructionStrategy(T*  objects, TeGeomRep geomRep, const TeGPMConstructionStrategy& type) :
+	objects_(objects)
+	{
+		if(objects->theme())
+			params_.theme_id1_ = objects->theme()->id();
+		params_.geom_rep1_ = geomRep;
+		params_.strategy_ = type;
+	} 
+
+template<typename T> 
+TeProxMatrixConstructionStrategy<T>::TeProxMatrixConstructionStrategy (const TeProxMatrixConstructionStrategy& st)
+{
+	objects_ = st.objects_; 
+	params_ = st.params_;
+}
+
+template<typename T> void 
+TeProxMatrixConstructionStrategy<T>::setSTObjects (T*  objects, TeGeomRep  geomRep)
+{	
+	objects_ = objects; 
+	if(objects->theme())
+		params_.theme_id1_ = objects->theme()->id();
+	params_.geom_rep1_ = geomRep; 
+}
+
+template<typename T> bool 
+TeProxMatrixConstructionStrategy<T>::IsEqual (const TeProxMatrixConstructionStrategy<T>& other) const
+{
+	return ((params_==other.params_) && 
+		((&objects_)==(&other.objects_))); 
+}
+
+
+//! A class to implement the local adjacency strategy of proximity matrix
+class TL_DLL TeProxMatrixLocalAdjacencyStrategy : public  TeProxMatrixConstructionStrategy<TeSTElementSet>
+{
+public:
+
+	//! Constructor
+	TeProxMatrixLocalAdjacencyStrategy (); 
+
+	//! Constructor
+	TeProxMatrixLocalAdjacencyStrategy (TeSTElementSet*  objects, TeGeomRep	geomRep, bool calcDistance=false);
+	
+	//! Copy constructor
+	TeProxMatrixLocalAdjacencyStrategy (TeProxMatrixLocalAdjacencyStrategy& st);  
+	 
+	 //! Destructor
+	virtual ~TeProxMatrixLocalAdjacencyStrategy() {}
+	
+	//! Construct the proximity matrix through local adjacency strategy 
+	virtual bool Construct (TeProxMatrixImplementation* imp);
+		
+	//! Equal operator 
+	bool operator== (const TeProxMatrixLocalAdjacencyStrategy& rhs) const;  
+	
+	//! Assignment operator 
+	TeProxMatrixLocalAdjacencyStrategy& operator= (const TeProxMatrixLocalAdjacencyStrategy& rhs); 
+
+};
+
+
+//! A class to implement the local distance strategy of proximity matrix
+template<typename Set>
+class TeProxMatrixLocalDistanceStrategy : public TeProxMatrixConstructionStrategy<Set>
+{
+public:
+
+	//! Constructor
+	TeProxMatrixLocalDistanceStrategy ();
+	
+	//! Constructor
+	TeProxMatrixLocalDistanceStrategy (Set*  objects, TeGeomRep geomRep, double max_distance); 
+	
+	//! Copy constructor
+	TeProxMatrixLocalDistanceStrategy (const TeProxMatrixLocalDistanceStrategy<Set>& st); 
+	
+	//! Destructor
+	virtual ~TeProxMatrixLocalDistanceStrategy(){}
+	
+	//! Construct the proximity matrix through local distance strategy 
+	virtual bool Construct (TeProxMatrixImplementation* imp); 
+
+	//! Equal operator 
+	bool operator== (const TeProxMatrixLocalDistanceStrategy<Set>& s) const; 
+		
+	//! Assignment operator
+	TeProxMatrixLocalDistanceStrategy<Set>& operator= (const TeProxMatrixLocalDistanceStrategy<Set>& rhs);
+
+};
+
+
+//! A class to implement the nearest neighbour strategy of proximity matrix
+class TL_DLL TeProxMatrixNearestNeighbourStrategy : public  TeProxMatrixConstructionStrategy<TeSTEventSet>
+{
+public:
+	//! Empty constructor
+	TeProxMatrixNearestNeighbourStrategy ();
+
+	//! Constructor
+	// The STEventSet must be created with geometries, using kdTree and ordered by object_id
+	TeProxMatrixNearestNeighbourStrategy (TeSTEventSet* objects, int num_neighbours);
+	
+	//! Copy constructor
+	TeProxMatrixNearestNeighbourStrategy (const TeProxMatrixNearestNeighbourStrategy& st); 
+	
+	//! Destructor
+	virtual ~TeProxMatrixNearestNeighbourStrategy(){}
+	
+	//! Construct the proximity matrix through local distance strategy 
+	virtual bool Construct (TeProxMatrixImplementation* imp); 
+
+	//! Equal operator 
+	bool operator== (const TeProxMatrixNearestNeighbourStrategy& s) const; 
+		
+	//! Assignment operator
+	TeProxMatrixNearestNeighbourStrategy& operator= (const TeProxMatrixNearestNeighbourStrategy& rhs);
+
+};
+
+
+//! A class to implement the closed network strategy of proximity matrix
+class TL_DLL TeProxMatrixClosedNetworkStrategy : public TeProxMatrixConstructionStrategy<TeSTElementSet>
+{
+private:
+	TeGraphNetwork*		net_;
+ 
+public:
+	//! Constructor
+	TeProxMatrixClosedNetworkStrategy (	TeSTElementSet*  objects, TeGeomRep rep, double max_local_distance,
+										double max_net_distance, double  max_connection_distance, 
+										TeGraphNetwork* input_net); 
+
+	//! Copy constructor
+	TeProxMatrixClosedNetworkStrategy (const TeProxMatrixClosedNetworkStrategy& rhs);
+		  
+	//! Destructor
+	virtual ~TeProxMatrixClosedNetworkStrategy()
+	{	
+		if(net_)
+			delete (net_); 
+	}
+
+	//! Construct the proximity matrix through closed network strategy 
+	virtual bool Construct (TeProxMatrixImplementation* imp); 
+	
+	//! Verify if is equal
+	virtual bool IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const; 
+	
+	//! Assignment operator
+	TeProxMatrixClosedNetworkStrategy& operator= (const TeProxMatrixClosedNetworkStrategy& rhs);
+
+	//! Equal operator
+	bool operator== (const TeProxMatrixClosedNetworkStrategy& other) const;  
+
+	//! Get the objects used to construct the matrix
+	TeSTElementSet* objects() { return objects_; }
+};
+
+//! A class to implement the open network strategy of proximity matrix (among a set of objetcs)
+class TL_DLL TeProxMatrixOpenNetworkStrategy : public TeProxMatrixConstructionStrategy<TeSTElementSet>
+{
+private:
+	TeGraphNetwork*		net_;
+
+public:
+
+	//! Constructor
+	TeProxMatrixOpenNetworkStrategy (	TeSTElementSet*  objects, TeGeomRep rep, double max_local_distance, 
+										double	max_net_distance, double  max_connetion_distance, 
+										TeGraphNetwork* input_net); 
+	//! Copy constructor
+	TeProxMatrixOpenNetworkStrategy (const TeProxMatrixOpenNetworkStrategy& rhs); 
+	
+	//! Destructor
+	virtual ~TeProxMatrixOpenNetworkStrategy()
+	{
+		if(net_)
+			delete (net_); 
+	}
+
+	//! Construct the proximity matrix through open network strategy
+	virtual bool Construct (TeProxMatrixImplementation* imp); 
+
+	//! Verify if is equal
+	virtual bool IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const; 
+
+	//! Equal operator
+	bool operator== (const TeProxMatrixOpenNetworkStrategy& other) const; 
+	
+	//! Assignment operator
+	TeProxMatrixOpenNetworkStrategy& operator= (const TeProxMatrixOpenNetworkStrategy& rhs);
+};
+
+
+//! A class to implement the open network strategy of proximity matrix (relationships among objetc of two differnt sets)
+class TL_DLL TeProxMatrixOpenNetworkStrategy2 : public TeProxMatrixConstructionStrategy<TeSTElementSet>
+{
+private:
+	TeSTElementSet*		objects2_;
+	TeGraphNetwork*		net_;
+public:
+
+	//! Constructor
+	TeProxMatrixOpenNetworkStrategy2 (	TeSTElementSet*  objects1, TeGeomRep rep1,
+										TeSTElementSet*  objects2, TeGeomRep rep2,
+										double max_local_distance, 
+										double	max_net_distance, double  max_connetion_distance, 
+										TeGraphNetwork* input_net); 
+	//! Copy constructor
+	TeProxMatrixOpenNetworkStrategy2 (const TeProxMatrixOpenNetworkStrategy2& rhs); 
+	
+	//! Destructor
+	virtual ~TeProxMatrixOpenNetworkStrategy2 ()
+	{
+		if(net_)
+			delete (net_); 
+	}
+
+	//! Construct the proximity matrix through open network strategy
+	virtual bool Construct (TeProxMatrixImplementation* imp); 
+
+	//! Verify if is equal
+	virtual bool IsEqual (const TeProxMatrixConstructionStrategy<TeSTElementSet>& other) const; 
+
+	//! Equal operator
+	bool operator== (const TeProxMatrixOpenNetworkStrategy2& other) const; 
+	
+	//! Assignment operator
+	TeProxMatrixOpenNetworkStrategy2& operator= (const TeProxMatrixOpenNetworkStrategy2& rhs);
+
+};
+
+//////////////////////////////////////////////////////////////////////
+// TeProxMatrixLocalDistanceStrategy 
+//////////////////////////////////////////////////////////////////////
+template<typename Set> 
+TeProxMatrixLocalDistanceStrategy<Set>::TeProxMatrixLocalDistanceStrategy ():
+		TeProxMatrixConstructionStrategy<Set> (0, TeGEOMETRYNONE, TeDistanceStrategy) 
+		{}
+
+
+template<typename Set> 
+TeProxMatrixLocalDistanceStrategy<Set>::TeProxMatrixLocalDistanceStrategy (Set*  objects, TeGeomRep geomRep, double max_distance): 
+		TeProxMatrixConstructionStrategy<Set>(objects, geomRep, TeDistanceStrategy)
+		{
+			TeProxMatrixConstructionStrategy<Set>::params_.max_distance_ = max_distance; 
+		}
+
+	
+template<typename Set> 
+TeProxMatrixLocalDistanceStrategy<Set>::TeProxMatrixLocalDistanceStrategy (const TeProxMatrixLocalDistanceStrategy<Set>& st): 
+		TeProxMatrixConstructionStrategy<Set>(st)
+		{} 
+
+template<typename Set> bool 
+TeProxMatrixLocalDistanceStrategy<Set>::Construct(TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) 
+		return false;
+	
+	// Iterate over all selected objects, selecting their neighbours
+	TeSTElementSet::iterator itobj1 = TeProxMatrixConstructionStrategy<Set>::objects_->begin();
+	
+	// ----- progress bar
+	int step = 0;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(TeProxMatrixConstructionStrategy<Set>::objects_->numSTInstance());
+	// -----
+
+	TeProjection* proj = 0;
+	if(TeProxMatrixConstructionStrategy<Set>::objects_->theme())
+		proj = TeProxMatrixConstructionStrategy<Set>::objects_->theme()->layer()->projection();
+	else if(TeProxMatrixConstructionStrategy<Set>::objects_->getLayer())
+		proj = TeProxMatrixConstructionStrategy<Set>::objects_->getLayer()->projection();
+
+	TePrecision::instance().setPrecision(TeGetPrecision(proj));
+	double max_d = TeProxMatrixConstructionStrategy<Set>::params_.max_distance_;
+		
+	while ( itobj1 != TeProxMatrixConstructionStrategy<Set>::objects_->end())
+	{
+		// Gets the possible objects from RTree in the element set
+		vector<TeSTInstance*> result;
+		TeBox b = (*itobj1).getGeometries().getBox();
+		TeBox bAux(b.x1()-max_d, b.y1()-max_d, b.x2()+max_d, b.y2()+max_d);
+		
+		TeProxMatrixConstructionStrategy<Set>::objects_->search(bAux, result);
+
+		string object_id1 = (*itobj1).getObjectId();
+		TeCoord2D coord1 = itobj1->getCentroid();
+		for(unsigned int index =0; index<result.size(); ++index)
+		{
+			string object_id2 = result[index]->getObjectId();
+			if(object_id1==object_id2)
+				continue;
+			
+			TeCoord2D coord2 = result[index]->getCentroid();
+			double dist = TeDistance(coord1, coord2);
+			if(dist <= max_d)
+			{
+				if(!imp->isConnected (object_id1,object_id2))
+				{
+					TeProxMatrixAttributes attr;
+					attr.CentroidDistance (dist);
+					imp->connectObjects (object_id1, object_id2, attr);
+					imp->connectObjects (object_id2, object_id1, attr);
+				}
+			}
+		}
+
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}	
+		++step;
+		++itobj1;
+	}
+	
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+template<typename Set> bool 
+TeProxMatrixLocalDistanceStrategy<Set>::operator== (const TeProxMatrixLocalDistanceStrategy<Set>& s) const 
+{
+	return ( TeProxMatrixConstructionStrategy<Set>::IsEqual(s)); 
+}
+	
+template<typename Set> TeProxMatrixLocalDistanceStrategy<Set>& 
+TeProxMatrixLocalDistanceStrategy<Set>::operator= (const TeProxMatrixLocalDistanceStrategy<Set>& rhs)
+{
+	if ( this != &rhs )
+	{
+		TeProxMatrixConstructionStrategy<Set>::objects_ = rhs.objects_;
+		TeProxMatrixConstructionStrategy<Set>::params_ = rhs.params_;
+	}
+	return *this;
+}
+
+/// S�rgio Costa e Evaldinolia Moreira
+
+//! A class to implement the local Topology strategy of proximity matrix
+class TL_DLL TeProxMatrixLocalTopologyStrategy : public  TeProxMatrixConstructionStrategy<TeSTElementSet>
+{
+private:
+	TeSTElementSet*		objects2_;
+	TeGeomRep	geomRep2_;
+	int toprel_;
+public:
+
+	//! Constructor
+	TeProxMatrixLocalTopologyStrategy (); 
+
+	//! Constructor
+	TeProxMatrixLocalTopologyStrategy (TeSTElementSet*  objects, TeGeomRep	geomRep, TeSTElementSet*  objects2, TeGeomRep	geomRep2, int toprel= TeINTERSECTS, bool calcDistance=false);
+	
+	//! Copy constructor
+	TeProxMatrixLocalTopologyStrategy (TeProxMatrixLocalTopologyStrategy& st);  
+	 
+	 //! Destructor
+	virtual ~TeProxMatrixLocalTopologyStrategy() {}
+	
+	//! Construct the proximity matrix through local adjacency strategy 
+	virtual bool Construct (TeProxMatrixImplementation* imp);
+		
+	//! Equal operator 
+	bool operator== (const TeProxMatrixLocalTopologyStrategy& rhs) const;  
+	
+	//! Assignment operator 
+	TeProxMatrixLocalTopologyStrategy& operator= (const TeProxMatrixLocalTopologyStrategy& rhs); 
+
+};
+
+//! A class to implement the ChooseOne strategy of proximity matrix
+class TL_DLL TeProxMatrixChooseOneTopologyStrategy : public  TeProxMatrixConstructionStrategy<TeSTElementSet>
+{
+private:
+	TeSTElementSet*		objects2_;
+	TeGeomRep	geomRep2_;
+	int toprel_;
+public:
+
+	//! Constructor
+	TeProxMatrixChooseOneTopologyStrategy (); 
+
+	//! Constructor
+	TeProxMatrixChooseOneTopologyStrategy (TeSTElementSet*  objects, TeGeomRep	geomRep, TeSTElementSet*  objects2, TeGeomRep	geomRep2, int toprel= TeINTERSECTS, bool calcDistance=false);
+	
+	//! Copy constructor
+	TeProxMatrixChooseOneTopologyStrategy (TeProxMatrixChooseOneTopologyStrategy& st);  
+	 
+	 //! Destructor
+	virtual ~TeProxMatrixChooseOneTopologyStrategy() {}
+	
+	//! Construct the proximity matrix through local adjacency strategy 
+	virtual bool Construct (TeProxMatrixImplementation* imp);
+		
+	//! Equal operator 
+	bool operator== (const TeProxMatrixChooseOneTopologyStrategy& rhs) const;  
+	
+	//! Assignment operator 
+	TeProxMatrixChooseOneTopologyStrategy& operator= (const TeProxMatrixChooseOneTopologyStrategy& rhs); 
+
+};
+
+//! A class to implement the KeepInBoth  strategy of proximity matrix
+class TL_DLL TeProxMatrixKeepInBothTopologyStrategy : public  TeProxMatrixConstructionStrategy<TeSTElementSet>
+{
+private:
+	TeSTElementSet*		objects2_;
+	TeGeomRep	geomRep2_;
+	int toprel_;
+public:
+
+	//! Constructor
+	TeProxMatrixKeepInBothTopologyStrategy (); 
+
+	//! Constructor
+	TeProxMatrixKeepInBothTopologyStrategy (TeSTElementSet*  objects, TeGeomRep	geomRep, TeSTElementSet*  objects2, TeGeomRep	geomRep2, int toprel= TeINTERSECTS, bool calcDistance=false);
+	
+	//! Copy constructor
+	TeProxMatrixKeepInBothTopologyStrategy (TeProxMatrixKeepInBothTopologyStrategy& st);  
+	 
+	 //! Destructor
+	virtual ~TeProxMatrixKeepInBothTopologyStrategy() {}
+	
+	//! Construct the proximity matrix through local adjacency strategy 
+	virtual bool Construct (TeProxMatrixImplementation* imp);
+		
+	//! Equal operator 
+	bool operator== (const TeProxMatrixKeepInBothTopologyStrategy& rhs) const;  
+	
+	//! Assignment operator 
+	TeProxMatrixKeepInBothTopologyStrategy& operator= (const TeProxMatrixKeepInBothTopologyStrategy& rhs); 
+
+};
+
+#endif
diff --git a/src/terralib/kernel/TeProxMatrixImplementation.cpp b/src/terralib/kernel/TeProxMatrixImplementation.cpp
old mode 100755
new mode 100644
index 7fdc36e..b5a7a17
--- a/src/terralib/kernel/TeProxMatrixImplementation.cpp
+++ b/src/terralib/kernel/TeProxMatrixImplementation.cpp
@@ -1,498 +1,498 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeProxMatrixImplementation.h"
-
-#include <stdio.h>
-
-TeProxMatrixGraphBreymann:: TeProxMatrixGraphBreymann () : 
-      TeProxMatrixImplementation(TeGraphBreymann), graph_(true)
-{ }
-
-TeProxMatrixGraphBreymann:: TeProxMatrixGraphBreymann (TeProxMatrixGraphBreymann&  other) : 
-      TeProxMatrixImplementation(TeGraphBreymann), graph_(true)
-{	
-//	graph_ = other.graph_;
-	map_ = other.map_;
-}
-
-	
-TeProxMatrixGraphBreymann&
-TeProxMatrixGraphBreymann:: operator= (TeProxMatrixGraphBreymann& other)
-{
-	type_ = other.type_;
-//	graph_ = other.graph_;  
-	map_ = other.map_;
-	return (*this);
-}
- 
-
-void 
-TeProxMatrixGraphBreymann::connectObjects (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr)
-{
-	int pos1 = graph_.insert (object_id1);
-	int pos2 = graph_.insert (object_id2);
-
-	graph_.connectVertices (pos1, pos2, attr);
-
-	map_[object_id1] = pos1;
-	map_[object_id2] = pos2;
-}
-
-
-bool 
-TeProxMatrixGraphBreymann::setConnectionAttributes (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr)
-{
-	return(graph_.setEdgeValue (object_id1, object_id2, attr));
-}
-
-bool 
-TeProxMatrixGraphBreymann::getConnectionAttributes (const string& object_id1, const string&object_id2, TeProxMatrixAttributes& attr)
-{
-	map_iterator pos1, pos2;
-
-	if ((pos1 = map_.find(object_id1)) == map_.end()) 
-		return false; // object_id1 not in the graph
-
-	if ((pos2 = map_.find(object_id2)) == map_.end()) 
-		return false; // object_id2 not in the graph
-
-	// Object_id1 neighbours iterator
-	br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
-			start	= graph_[(*pos1).second].second.begin(),
-			end		= graph_[(*pos1).second].second.end();
-
-	while (start != end) 
-	{	
-		if ((*start).first == (*pos2).second) {
-				attr = (*start).second;
-				return true;
-		}
-		++start;
-	}
-	return false;		
-}
-
-bool 
-TeProxMatrixGraphBreymann::getNeighboursNeighbours (const string& object_id, TeNeighbours& neigh, int max_order )
-{
-	bool ret_value = getNeighboursNeighbours (object_id, neigh, max_order, 1);
-	neigh.Remove (object_id);
-	return ret_value;
-}
-
-bool 
-TeProxMatrixGraphBreymann::getNeighboursNeighbours (const string& object_id, TeNeighbours& neigh, int max_order, int current_order)
-{
-
-	map_iterator pos;
-
-	if ((pos = map_.find(object_id)) == map_.end()) 
-		return false; // object_id not in the graph
-
-	// Object_id1 neighbours iterator
-	br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
-			start	= graph_[(*pos).second].second.begin(),
-			end		= graph_[(*pos).second].second.end();
-
-	// Insert all neighbours
-	while (start != end) 
-	{	
-		TeProxMatrixAttributes attr = (*start).second;
-		attr.Order (current_order); //Update attr attribute for that specific object
-		if (neigh.Insert (graph_[(*start).first].first, attr)) 
-		{
-				// Get neighbours of neighbours that were not inserted before
-			for (int recursive_loop = max_order - 1; recursive_loop > 0; --recursive_loop)
-				getNeighboursNeighbours (graph_[(*start).first].first, neigh, recursive_loop, ++current_order);
-	
-		}
-		++start;
-	}
-	return true;
-
-}
-
-
-bool
-TeProxMatrixGraphBreymann::getNeighbours (const string& object_id, TeNeighbours& neigh)
-{
-	map_iterator pos;
-
-	if ((pos = map_.find(object_id)) == map_.end()) 
-		return false; // object_id not in the graph
-
-	br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
-			start	= graph_[(*pos).second].second.begin(),
-			end		= graph_[(*pos).second].second.end();
-
-	while (start != end) 
-	{
-		neigh.Insert (graph_[(*start).first].first, (*start).second);
-		++start;
-	}
-
-	return true;
-	
-}
-
-bool
-TeProxMatrixGraphBreymann::getNeighbours (int i, string& object_id, TeNeighbours& neigh)
-{
-
-	if (i > (int) graph_.size())
-		return false;
-
-	// find object_id
-	map_iterator pos = map_.begin();
-	while (pos != map_.end())
-	{
-		if ((*pos).second == i)
-		{
-			object_id = (*pos).first;
-			pos = map_.end();
-		}
-		else pos++;
-	}
-
-	br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
-			start	= graph_[i].second.begin(),
-			end		= graph_[i].second.end();
-
-
-	while (start != end) 
-	{
-		neigh.Insert (graph_[(*start).first].first, (*start).second);
-		start++;
-	}
-
-	return true;
-	
-}
-
-
-
-TeProxMatrixImplementation* 
-TeProxMatrixGraphBreymann::createCopy ()
-{
-	TeProxMatrixGraphBreymann* imp = new TeProxMatrixGraphBreymann (*this);
-	return imp;
-
-}
-
-
-bool
-TeProxMatrixGraphBreymann::saveTextFile (const string& name, map<string, string>* ids)
-{
-	string complete_name = name + ".txt";
-
-	FILE*	fp = fopen(complete_name.c_str(),"w");
-	if (fp)
-	{
-		fprintf (fp, "%d\n", ids->size()); //number of objects
-	
-		map<string, string>::iterator it;
-		for (unsigned int i = 0; i < graph_.size(); i++)
-		{
-
-			string objId1, objId2;
-			objId1 = graph_[i].first;
-			if(ids)
-			{
-				it=ids->find(graph_[i].first);
-				if(it!=ids->end())
-					objId1 = it->second;
-			}
-						
-			fprintf (fp, " %s ", objId1.c_str());
-			
-			br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
-				start	= graph_[i].second.begin(),
-				end		= graph_[i].second.end();
-			//double sum = 0.0;
-			while (start != end) 
-			{
-				objId2 = graph_[(*start).first].first;
-				if(ids)
-				{
-					it=ids->find(objId2);
-					if(it!=ids->end())
-						objId2 = it->second;
-				}
-				
-				fprintf (fp, " %s ", objId2.c_str());  
-				//sum += (*start).second.Weight();
-				start++;
-			}
-
-			//fprintf (fp, "Weights sum: %3.7f\n", sum);
-			fprintf (fp, "\n");
-		}
-		fclose (fp);
-		return true;
-	}
-	else 
-		return false;
-}
-
-
-bool
-TeProxMatrixGraphBreymann::saveGALFile (const string& name, map<string, string>* ids)
-{
-
-	string complete_name = name + ".GAL";
-	FILE*	fp = fopen(complete_name.c_str(),"w");
-	if (fp)
-	{
-		fprintf (fp, "%d\n", ids->size() ); // first line: number of elements in matrix
-		map<string, string>::iterator it;
-		for (unsigned int i = 0; i < graph_.size(); i++)
-		{
-			string objId1, objId2;
-			objId1 = graph_[i].first;
-			if(ids)
-			{
-				it = ids->find(objId1);
-				if(it!=ids->end())
-					objId1 = it->second;
-			}
-			
-			fprintf (fp, "%s %d\n", objId1.c_str(), graph_[i].second.size());
-			br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
-				start	= graph_[i].second.begin(),
-				end		= graph_[i].second.end();
-			while (start != end) 
-			{
-				//fprintf (fp, "%s   %3.7f\n", graph_[(*start).first].first.c_str(), (*start).second.Weight() );
-				objId2 = graph_[(*start).first].first;
-				if(ids)
-				{
-					it=ids->find(objId2);
-					if(it!=ids->end())
-                        objId2 = it->second;
-				}				
-
-                fprintf (fp, "%s  ", objId2.c_str());
-				start++;
-			}
-			fprintf (fp, "\n");
-		}
-		fclose (fp);
-		return true;
-	}
-	else return false;
-	
-}
-
-
-bool
-TeProxMatrixGraphBreymann::saveGWTFile (const string& name, map<string, string>* ids)
-{
-
-	string complete_name = name + ".GWT";
-	FILE*	fp = fopen(complete_name.c_str(),"w");
-	if (fp)
-	{
-		fprintf (fp, "%d\n", ids->size() ); // first line: number of elements in matrix
-		map<string, string>::iterator it;
-		for (unsigned int i = 0; i < graph_.size(); i++)
-		{
-			br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
-				start	= graph_[i].second.begin(),
-				end		= graph_[i].second.end();
-			while (start != end) 
-			{
-				string objId1, objId2;
-				objId1 = graph_[i].first;
-				objId2 = graph_[(*start).first].first;
-				if(ids)
-				{
-					it=ids->find(graph_[i].first);
-					if(it!=ids->end())
-						objId1 = it->second;
-					it=ids->find(graph_[(*start).first].first);
-					if(it!=ids->end())
-						objId2 = it->second;
-				}
-				fprintf (fp, "%s %s		%3.7f\n", objId1.c_str(), objId2.c_str(), (*start).second.CentroidDistance());
-				start++;
-			}
-		}
-		fclose (fp);
-		return true;
-	}
-	else 
-		return false;
-	
-}
-
-// -------- save from vector
-
-bool
-TeProxMatrixGraphBreymann::saveTextFile (const string& name, vector<string>* ids)
-{
-	string complete_name = name + ".txt";
-
-	FILE*	fp = fopen(complete_name.c_str(),"w");
-	if (fp)
-	{
-		fprintf (fp, "%d\n", ids->size()); //number of objects
-	
-		vector<string>::iterator it = ids->begin();
-		int Id=1;
-		while(it!=ids->end())
-		{
-			string objId1, objId2;
-			objId1 = Te2String(Id);
-			
-			fprintf (fp, " %s ", objId1.c_str());
-
-			TeNeighbours neigs;
-			this->getNeighbours((*it), neigs);
-
-			for(int j=0; j<neigs.size(); ++j)
-			{
-				string objId2aux = neigs[j];
-				objId2 ="";
-				for(unsigned int n=0; n<ids->size(); ++n)
-				{
-					if(objId2aux==ids->operator [](n))
-					{
-						objId2 = Te2String(n+1);
-						break;
-					}
-				}
-				fprintf (fp, " %s ", objId2.c_str());  
-			}
-
-			fprintf (fp, "\n");
-
-			++it;
-			++Id;
-		}
-
-		fclose (fp);
-		return true;
-	}
-	else 
-		return false;
-}
-
-
-bool
-TeProxMatrixGraphBreymann::saveGALFile (const string& name, vector<string>* ids)
-{
-
-	string complete_name = name + ".GAL";
-	FILE*	fp = fopen(complete_name.c_str(),"w");
-	if (fp)
-	{
-		fprintf (fp, "%d\n", ids->size() ); // first line: number of elements in matrix
-		
-		vector<string>::iterator it = ids->begin();
-		int Id=1;
-		while(it!=ids->end())
-		{
-			string objId1, objId2;
-			objId1 = Te2String(Id);
-			
-			TeNeighbours neigs;
-			this->getNeighbours((*it), neigs);
-
-			fprintf (fp, "%s %d\n", objId1.c_str(), neigs.size());
-
-			for(int j=0; j<neigs.size(); ++j)
-			{
-				string objId2aux = neigs[j];
-				objId2 ="";
-				for(unsigned int n=0; n<ids->size(); ++n)
-				{
-					if(objId2aux==ids->operator[](n))
-					{
-						objId2 = Te2String(n+1);
-						break;
-					}
-				}
-				fprintf (fp, "%s  ", objId2.c_str());  
-			}
-
-			fprintf (fp, "\n");
-
-			++it;
-			++Id;
-		}
-		
-		fclose (fp);
-		return true;
-	}
-	else 
-		return false;
-	
-}
-
-
-bool
-TeProxMatrixGraphBreymann::saveGWTFile (const string& name, vector<string>* ids)
-{
-
-	string complete_name = name + ".GWT";
-	FILE*	fp = fopen(complete_name.c_str(),"w");
-	if (fp)
-	{
-		fprintf (fp, "%d\n", ids->size() ); // first line: number of elements in matrix
-		vector<string>::iterator it = ids->begin();
-		int Id=1;
-		while(it!=ids->end())
-		{
-			string objId1, objId2;
-			objId1 = Te2String(Id);
-			
-			TeNeighbours neigs;
-			this->getNeighbours((*it), neigs);
-
-			for(int j=0; j<neigs.size(); ++j)
-			{
-				string objId2aux = neigs[j];
-				double dist = (neigs.Attributes(j)).CentroidDistance();
-				objId2 ="";
-				for(unsigned int n=0; n<ids->size(); ++n)
-				{
-					if(objId2aux==ids->operator[](n))
-					{
-						objId2 = Te2String(n+1);
-						break;
-					}
-				}
-				fprintf (fp, "%s %s		%3.7f\n", objId1.c_str(), objId2.c_str(), dist);
-			}
-			++it;
-			++Id;
-		}
-				
-		fclose (fp);
-		return true;
-	}
-	else 
-		return false;
-	
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeProxMatrixImplementation.h"
+
+#include <stdio.h>
+
+TeProxMatrixGraphBreymann:: TeProxMatrixGraphBreymann () : 
+      TeProxMatrixImplementation(TeGraphBreymann), graph_(true)
+{ }
+
+TeProxMatrixGraphBreymann:: TeProxMatrixGraphBreymann (TeProxMatrixGraphBreymann&  other) : 
+      TeProxMatrixImplementation(TeGraphBreymann), graph_(true)
+{	
+//	graph_ = other.graph_;
+	map_ = other.map_;
+}
+
+	
+TeProxMatrixGraphBreymann&
+TeProxMatrixGraphBreymann:: operator= (TeProxMatrixGraphBreymann& other)
+{
+	type_ = other.type_;
+//	graph_ = other.graph_;  
+	map_ = other.map_;
+	return (*this);
+}
+ 
+
+void 
+TeProxMatrixGraphBreymann::connectObjects (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr)
+{
+	int pos1 = graph_.insert (object_id1);
+	int pos2 = graph_.insert (object_id2);
+
+	graph_.connectVertices (pos1, pos2, attr);
+
+	map_[object_id1] = pos1;
+	map_[object_id2] = pos2;
+}
+
+
+bool 
+TeProxMatrixGraphBreymann::setConnectionAttributes (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr)
+{
+	return(graph_.setEdgeValue (object_id1, object_id2, attr));
+}
+
+bool 
+TeProxMatrixGraphBreymann::getConnectionAttributes (const string& object_id1, const string&object_id2, TeProxMatrixAttributes& attr)
+{
+	map_iterator pos1, pos2;
+
+	if ((pos1 = map_.find(object_id1)) == map_.end()) 
+		return false; // object_id1 not in the graph
+
+	if ((pos2 = map_.find(object_id2)) == map_.end()) 
+		return false; // object_id2 not in the graph
+
+	// Object_id1 neighbours iterator
+	br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
+			start	= graph_[(*pos1).second].second.begin(),
+			end		= graph_[(*pos1).second].second.end();
+
+	while (start != end) 
+	{	
+		if ((*start).first == (*pos2).second) {
+				attr = (*start).second;
+				return true;
+		}
+		++start;
+	}
+	return false;		
+}
+
+bool 
+TeProxMatrixGraphBreymann::getNeighboursNeighbours (const string& object_id, TeNeighbours& neigh, int max_order )
+{
+	bool ret_value = getNeighboursNeighbours (object_id, neigh, max_order, 1);
+	neigh.Remove (object_id);
+	return ret_value;
+}
+
+bool 
+TeProxMatrixGraphBreymann::getNeighboursNeighbours (const string& object_id, TeNeighbours& neigh, int max_order, int current_order)
+{
+
+	map_iterator pos;
+
+	if ((pos = map_.find(object_id)) == map_.end()) 
+		return false; // object_id not in the graph
+
+	// Object_id1 neighbours iterator
+	br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
+			start	= graph_[(*pos).second].second.begin(),
+			end		= graph_[(*pos).second].second.end();
+
+	// Insert all neighbours
+	while (start != end) 
+	{	
+		TeProxMatrixAttributes attr = (*start).second;
+		attr.Order (current_order); //Update attr attribute for that specific object
+		if (neigh.Insert (graph_[(*start).first].first, attr)) 
+		{
+				// Get neighbours of neighbours that were not inserted before
+			for (int recursive_loop = max_order - 1; recursive_loop > 0; --recursive_loop)
+				getNeighboursNeighbours (graph_[(*start).first].first, neigh, recursive_loop, ++current_order);
+	
+		}
+		++start;
+	}
+	return true;
+
+}
+
+
+bool
+TeProxMatrixGraphBreymann::getNeighbours (const string& object_id, TeNeighbours& neigh)
+{
+	map_iterator pos;
+
+	if ((pos = map_.find(object_id)) == map_.end()) 
+		return false; // object_id not in the graph
+
+	br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
+			start	= graph_[(*pos).second].second.begin(),
+			end		= graph_[(*pos).second].second.end();
+
+	while (start != end) 
+	{
+		neigh.Insert (graph_[(*start).first].first, (*start).second);
+		++start;
+	}
+
+	return true;
+	
+}
+
+bool
+TeProxMatrixGraphBreymann::getNeighbours (int i, string& object_id, TeNeighbours& neigh)
+{
+
+	if (i > (int) graph_.size())
+		return false;
+
+	// find object_id
+	map_iterator pos = map_.begin();
+	while (pos != map_.end())
+	{
+		if ((*pos).second == i)
+		{
+			object_id = (*pos).first;
+			pos = map_.end();
+		}
+		else pos++;
+	}
+
+	br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
+			start	= graph_[i].second.begin(),
+			end		= graph_[i].second.end();
+
+
+	while (start != end) 
+	{
+		neigh.Insert (graph_[(*start).first].first, (*start).second);
+		start++;
+	}
+
+	return true;
+	
+}
+
+
+
+TeProxMatrixImplementation* 
+TeProxMatrixGraphBreymann::createCopy ()
+{
+	TeProxMatrixGraphBreymann* imp = new TeProxMatrixGraphBreymann (*this);
+	return imp;
+
+}
+
+
+bool
+TeProxMatrixGraphBreymann::saveTextFile (const string& name, map<string, string>* ids)
+{
+	string complete_name = name + ".txt";
+
+	FILE*	fp = fopen(complete_name.c_str(),"w");
+	if (fp)
+	{
+		fprintf (fp, "%d\n", ids->size()); //number of objects
+	
+		map<string, string>::iterator it;
+		for (unsigned int i = 0; i < graph_.size(); i++)
+		{
+
+			string objId1, objId2;
+			objId1 = graph_[i].first;
+			if(ids)
+			{
+				it=ids->find(graph_[i].first);
+				if(it!=ids->end())
+					objId1 = it->second;
+			}
+						
+			fprintf (fp, " %s ", objId1.c_str());
+			
+			br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
+				start	= graph_[i].second.begin(),
+				end		= graph_[i].second.end();
+			//double sum = 0.0;
+			while (start != end) 
+			{
+				objId2 = graph_[(*start).first].first;
+				if(ids)
+				{
+					it=ids->find(objId2);
+					if(it!=ids->end())
+						objId2 = it->second;
+				}
+				
+				fprintf (fp, " %s ", objId2.c_str());  
+				//sum += (*start).second.Weight();
+				start++;
+			}
+
+			//fprintf (fp, "Weights sum: %3.7f\n", sum);
+			fprintf (fp, "\n");
+		}
+		fclose (fp);
+		return true;
+	}
+	else 
+		return false;
+}
+
+
+bool
+TeProxMatrixGraphBreymann::saveGALFile (const string& name, map<string, string>* ids)
+{
+
+	string complete_name = name + ".GAL";
+	FILE*	fp = fopen(complete_name.c_str(),"w");
+	if (fp)
+	{
+		fprintf (fp, "%d\n", ids->size() ); // first line: number of elements in matrix
+		map<string, string>::iterator it;
+		for (unsigned int i = 0; i < graph_.size(); i++)
+		{
+			string objId1, objId2;
+			objId1 = graph_[i].first;
+			if(ids)
+			{
+				it = ids->find(objId1);
+				if(it!=ids->end())
+					objId1 = it->second;
+			}
+			
+			fprintf (fp, "%s %d\n", objId1.c_str(), graph_[i].second.size());
+			br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
+				start	= graph_[i].second.begin(),
+				end		= graph_[i].second.end();
+			while (start != end) 
+			{
+				//fprintf (fp, "%s   %3.7f\n", graph_[(*start).first].first.c_str(), (*start).second.Weight() );
+				objId2 = graph_[(*start).first].first;
+				if(ids)
+				{
+					it=ids->find(objId2);
+					if(it!=ids->end())
+                        objId2 = it->second;
+				}				
+
+                fprintf (fp, "%s  ", objId2.c_str());
+				start++;
+			}
+			fprintf (fp, "\n");
+		}
+		fclose (fp);
+		return true;
+	}
+	else return false;
+	
+}
+
+
+bool
+TeProxMatrixGraphBreymann::saveGWTFile (const string& name, map<string, string>* ids)
+{
+
+	string complete_name = name + ".GWT";
+	FILE*	fp = fopen(complete_name.c_str(),"w");
+	if (fp)
+	{
+		fprintf (fp, "%d\n", ids->size() ); // first line: number of elements in matrix
+		map<string, string>::iterator it;
+		for (unsigned int i = 0; i < graph_.size(); i++)
+		{
+			br_stl::Graph<string, TeProxMatrixAttributes>::Successor::iterator 
+				start	= graph_[i].second.begin(),
+				end		= graph_[i].second.end();
+			while (start != end) 
+			{
+				string objId1, objId2;
+				objId1 = graph_[i].first;
+				objId2 = graph_[(*start).first].first;
+				if(ids)
+				{
+					it=ids->find(graph_[i].first);
+					if(it!=ids->end())
+						objId1 = it->second;
+					it=ids->find(graph_[(*start).first].first);
+					if(it!=ids->end())
+						objId2 = it->second;
+				}
+				fprintf (fp, "%s %s		%3.7f\n", objId1.c_str(), objId2.c_str(), (*start).second.CentroidDistance());
+				start++;
+			}
+		}
+		fclose (fp);
+		return true;
+	}
+	else 
+		return false;
+	
+}
+
+// -------- save from vector
+
+bool
+TeProxMatrixGraphBreymann::saveTextFile (const string& name, vector<string>* ids)
+{
+	string complete_name = name + ".txt";
+
+	FILE*	fp = fopen(complete_name.c_str(),"w");
+	if (fp)
+	{
+		fprintf (fp, "%d\n", ids->size()); //number of objects
+	
+		vector<string>::iterator it = ids->begin();
+		int Id=1;
+		while(it!=ids->end())
+		{
+			string objId1, objId2;
+			objId1 = Te2String(Id);
+			
+			fprintf (fp, " %s ", objId1.c_str());
+
+			TeNeighbours neigs;
+			this->getNeighbours((*it), neigs);
+
+			for(int j=0; j<neigs.size(); ++j)
+			{
+				string objId2aux = neigs[j];
+				objId2 ="";
+				for(unsigned int n=0; n<ids->size(); ++n)
+				{
+					if(objId2aux==ids->operator [](n))
+					{
+						objId2 = Te2String(n+1);
+						break;
+					}
+				}
+				fprintf (fp, " %s ", objId2.c_str());  
+			}
+
+			fprintf (fp, "\n");
+
+			++it;
+			++Id;
+		}
+
+		fclose (fp);
+		return true;
+	}
+	else 
+		return false;
+}
+
+
+bool
+TeProxMatrixGraphBreymann::saveGALFile (const string& name, vector<string>* ids)
+{
+
+	string complete_name = name + ".GAL";
+	FILE*	fp = fopen(complete_name.c_str(),"w");
+	if (fp)
+	{
+		fprintf (fp, "%d\n", ids->size() ); // first line: number of elements in matrix
+		
+		vector<string>::iterator it = ids->begin();
+		int Id=1;
+		while(it!=ids->end())
+		{
+			string objId1, objId2;
+			objId1 = Te2String(Id);
+			
+			TeNeighbours neigs;
+			this->getNeighbours((*it), neigs);
+
+			fprintf (fp, "%s %d\n", objId1.c_str(), neigs.size());
+
+			for(int j=0; j<neigs.size(); ++j)
+			{
+				string objId2aux = neigs[j];
+				objId2 ="";
+				for(unsigned int n=0; n<ids->size(); ++n)
+				{
+					if(objId2aux==ids->operator[](n))
+					{
+						objId2 = Te2String(n+1);
+						break;
+					}
+				}
+				fprintf (fp, "%s  ", objId2.c_str());  
+			}
+
+			fprintf (fp, "\n");
+
+			++it;
+			++Id;
+		}
+		
+		fclose (fp);
+		return true;
+	}
+	else 
+		return false;
+	
+}
+
+
+bool
+TeProxMatrixGraphBreymann::saveGWTFile (const string& name, vector<string>* ids)
+{
+
+	string complete_name = name + ".GWT";
+	FILE*	fp = fopen(complete_name.c_str(),"w");
+	if (fp)
+	{
+		fprintf (fp, "%d\n", ids->size() ); // first line: number of elements in matrix
+		vector<string>::iterator it = ids->begin();
+		int Id=1;
+		while(it!=ids->end())
+		{
+			string objId1, objId2;
+			objId1 = Te2String(Id);
+			
+			TeNeighbours neigs;
+			this->getNeighbours((*it), neigs);
+
+			for(int j=0; j<neigs.size(); ++j)
+			{
+				string objId2aux = neigs[j];
+				double dist = (neigs.Attributes(j)).CentroidDistance();
+				objId2 ="";
+				for(unsigned int n=0; n<ids->size(); ++n)
+				{
+					if(objId2aux==ids->operator[](n))
+					{
+						objId2 = Te2String(n+1);
+						break;
+					}
+				}
+				fprintf (fp, "%s %s		%3.7f\n", objId1.c_str(), objId2.c_str(), dist);
+			}
+			++it;
+			++Id;
+		}
+				
+		fclose (fp);
+		return true;
+	}
+	else 
+		return false;
+	
+}
diff --git a/src/terralib/kernel/TeProxMatrixImplementation.h b/src/terralib/kernel/TeProxMatrixImplementation.h
old mode 100755
new mode 100644
index a3693ca..25088d1
--- a/src/terralib/kernel/TeProxMatrixImplementation.h
+++ b/src/terralib/kernel/TeProxMatrixImplementation.h
@@ -1,215 +1,215 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeProxMatrixImplementation.h
-    \brief This file contains structures and definitions about different representations of proximity matrix 
-*/
-
-#ifndef TeProxMatrixImplementation_H
-#define TeProxMatrixImplementation_H
-
-#include "TeNeighbours.h"
-#include <graph.h>
-
-//! An abstract class to represent proximity matrix   
-class TL_DLL TeProxMatrixImplementation  
-{
-protected:
-	//! Type of the representation
-	TeGPMImplementation type_;
-	
-	//! Empty constructor 
-	TeProxMatrixImplementation(const TeGPMImplementation& type): type_(type)
-		{}
-
-public:
-	//! Verify if two objects are neighbour or connected
-	bool isConnected (const string& object_id1, const string& object_id2) 
-	{
-		TeProxMatrixAttributes attr; 
-		return getConnectionAttributes (object_id1, object_id2, attr);
-	}
-
-	//! Connect two objects
-	virtual void connectObjects (const string& , const string& , const TeProxMatrixAttributes& ) = 0;
-
-	//! Disconnect two objects
-	virtual bool disconnectObjects (const string& , const string& ) { return false; }
-
-	//! Remove an object
-	virtual bool removeObject (const string& ) { return false; }
-
-	//! Get connection attributes
-	virtual bool getConnectionAttributes (const string&, const string&, TeProxMatrixAttributes& )= 0;
-
-	//! Set connection attributes
-	virtual bool setConnectionAttributes (const string&, const string&, const TeProxMatrixAttributes&) =0;
-
-	//! Get the neighbours of an object
-	virtual bool getNeighbours (const string& , TeNeighbours& )=0;
-
-	//! Get the obj-th neighbour of an object 
-	virtual bool getNeighbours (int, string& , TeNeighbours& )=0;	
-
-	//! Get the neighbours of an object
-	virtual bool getNeighboursNeighbours (const string&, TeNeighbours&, int /* max_order */ = 2)=0;
-
-	//! Return the number of objects
-	virtual int  numberOfObjects()=0;
-
-	//! Return the type of the representation 
-	TeGPMImplementation type() {return type_;}
-
-	//! Create a copy
-	virtual TeProxMatrixImplementation* createCopy ()=0;
-	
-	//! Verify if is equal
-	virtual bool isEqual (TeProxMatrixImplementation& other)
-	{
-		if (type_ == other.type_) 
-			return true; 
-		return false;
-	}
-
-	//! Equal operator
-	virtual bool operator== (const TeProxMatrixImplementation& ) const { return false; } 
-		
-	//! Save the proximity matrix in a text file
-	virtual bool saveTextFile (const string&, map<string, string>*)=0;
-
-	//! Save the proximity matrix in a GAL format text file 
-	virtual bool saveGALFile (const string&, map<string, string>*)=0;
-
-	//! Save the proximity matrix in a GWT format text file 
-	virtual bool saveGWTFile (const string&, map<string, string>*)=0;
-
-	//! Save the proximity matrix in a text file
-	virtual bool saveTextFile (const string&, vector<string>*)=0;
-
-	//! Save the proximity matrix in a GAL format text file 
-	virtual bool saveGALFile (const string&, vector<string>*)=0;
-
-	//! Save the proximity matrix in a GWT format text file 
-	virtual bool saveGWTFile (const string&, vector<string>*)=0;
-
-	//! Destructor
-	virtual ~TeProxMatrixImplementation(){}
-};
-
-
-//! A class to represent proximity matrix utilising the Breymann graph
-class TL_DLL TeProxMatrixGraphBreymann : public  TeProxMatrixImplementation
-{
-private:
-	br_stl::Graph<string, TeProxMatrixAttributes> graph_;
-
-	typedef map<string, int> Object_id_map_type;
-	Object_id_map_type  map_;
-
-	typedef Object_id_map_type::iterator map_iterator;
-	typedef Object_id_map_type::const_iterator map_const_iterator;
-
-	bool getNeighboursNeighbours (const string& object_id, TeNeighbours& neigh, int max_order = 2, int current_order = 1);
-
-public:
-	//! Empty constructor - graph must be directed then the graph constructor receive true 
-	TeProxMatrixGraphBreymann (); 
-																	 
-	//! Copy constructor
-	TeProxMatrixGraphBreymann(TeProxMatrixGraphBreymann& imp);
-
-	//! Connect two objects
-	virtual void connectObjects (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr);
-	
-	//! Get connection attributes 
-	virtual bool getConnectionAttributes (const string& object_id1, const string& object_id2, TeProxMatrixAttributes& attr);
-	
-	//! Set connection attributes 
-	virtual bool setConnectionAttributes (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr);
-
-	//! Get the neighbours of an object
-	virtual bool getNeighbours (const string& object_id, TeNeighbours& neigh);
-
-	//! Get the obj-th neighbour of an object 
-	virtual bool getNeighbours (int obj, string& object_id, TeNeighbours& neigh); 
-	
-	//! Get the neighbours of an object
-	virtual bool getNeighboursNeighbours (const string& object_id, TeNeighbours& neigh, int max_order = 2);
-
-	//! Return the number of the objects
-	virtual int  numberOfObjects () {return graph_.size();}
-
-	//! Create a copy
-	virtual TeProxMatrixImplementation* createCopy ();
-
-	//! Verify if is equal
-	virtual bool isEqual (TeProxMatrixImplementation& other) 
-	{
-		if (type_ == other.type()) 
-			return (*this == (TeProxMatrixGraphBreymann&)other); 
-		return false;
-	}
-
-	//! Assignment operator 
-	TeProxMatrixGraphBreymann& operator= (TeProxMatrixGraphBreymann& imp); 
-	
-	//! Destructor
-	virtual ~TeProxMatrixGraphBreymann() {}
-
-	//! Save the proximity matrix in a text file 
-	virtual bool saveTextFile (const string& name, map<string, string>* ids=0);
-
-	//! Save the proximity matrix in a GAL text file 
-	virtual bool saveGALFile (const string& name, map<string, string>* ids=0);
-
-	//! Save the proximity matrix in a GWT text file 
-	virtual bool saveGWTFile (const string& name, map<string, string>* ids=0);
-
-	//! Save the proximity matrix in a text file
-	virtual bool saveTextFile (const string& name, vector<string>* ids);
-
-	//! Save the proximity matrix in a GAL format text file 
-	virtual bool saveGALFile (const string& name, vector<string>* ids);
-
-	//! Save the proximity matrix in a GWT format text file 
-	virtual bool saveGWTFile (const string& name, vector<string>* ids);
-};
-
-
-//! An abstract factory of proximity matrix representations  
-class TL_DLL TeProxMatrixAbstractFactory  
-{
-public:
-	static TeProxMatrixImplementation* MakeConcreteImplementation (const TeGPMImplementation& impl_type = TeGraphBreymann)
-	{
-		if (impl_type == TeGraphBreymann) 
-				return new TeProxMatrixGraphBreymann();
-
-		return new TeProxMatrixGraphBreymann();
-	}
-	
-};
-
-/*! \example createProximityMatrix.cpp
-	This is an example of how to  how to create a proximity matrix from a  Spatial Temporal Element Set (STElementSet)
- */
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeProxMatrixImplementation.h
+    \brief This file contains structures and definitions about different representations of proximity matrix 
+*/
+
+#ifndef TeProxMatrixImplementation_H
+#define TeProxMatrixImplementation_H
+
+#include "TeNeighbours.h"
+#include <graph.h>
+
+//! An abstract class to represent proximity matrix   
+class TL_DLL TeProxMatrixImplementation  
+{
+protected:
+	//! Type of the representation
+	TeGPMImplementation type_;
+	
+	//! Empty constructor 
+	TeProxMatrixImplementation(const TeGPMImplementation& type): type_(type)
+		{}
+
+public:
+	//! Verify if two objects are neighbour or connected
+	bool isConnected (const string& object_id1, const string& object_id2) 
+	{
+		TeProxMatrixAttributes attr; 
+		return getConnectionAttributes (object_id1, object_id2, attr);
+	}
+
+	//! Connect two objects
+	virtual void connectObjects (const string& , const string& , const TeProxMatrixAttributes& ) = 0;
+
+	//! Disconnect two objects
+	virtual bool disconnectObjects (const string& , const string& ) { return false; }
+
+	//! Remove an object
+	virtual bool removeObject (const string& ) { return false; }
+
+	//! Get connection attributes
+	virtual bool getConnectionAttributes (const string&, const string&, TeProxMatrixAttributes& )= 0;
+
+	//! Set connection attributes
+	virtual bool setConnectionAttributes (const string&, const string&, const TeProxMatrixAttributes&) =0;
+
+	//! Get the neighbours of an object
+	virtual bool getNeighbours (const string& , TeNeighbours& )=0;
+
+	//! Get the obj-th neighbour of an object 
+	virtual bool getNeighbours (int, string& , TeNeighbours& )=0;	
+
+	//! Get the neighbours of an object
+	virtual bool getNeighboursNeighbours (const string&, TeNeighbours&, int /* max_order */ = 2)=0;
+
+	//! Return the number of objects
+	virtual int  numberOfObjects()=0;
+
+	//! Return the type of the representation 
+	TeGPMImplementation type() {return type_;}
+
+	//! Create a copy
+	virtual TeProxMatrixImplementation* createCopy ()=0;
+	
+	//! Verify if is equal
+	virtual bool isEqual (TeProxMatrixImplementation& other)
+	{
+		if (type_ == other.type_) 
+			return true; 
+		return false;
+	}
+
+	//! Equal operator
+	virtual bool operator== (const TeProxMatrixImplementation& ) const { return false; } 
+		
+	//! Save the proximity matrix in a text file
+	virtual bool saveTextFile (const string&, map<string, string>*)=0;
+
+	//! Save the proximity matrix in a GAL format text file 
+	virtual bool saveGALFile (const string&, map<string, string>*)=0;
+
+	//! Save the proximity matrix in a GWT format text file 
+	virtual bool saveGWTFile (const string&, map<string, string>*)=0;
+
+	//! Save the proximity matrix in a text file
+	virtual bool saveTextFile (const string&, vector<string>*)=0;
+
+	//! Save the proximity matrix in a GAL format text file 
+	virtual bool saveGALFile (const string&, vector<string>*)=0;
+
+	//! Save the proximity matrix in a GWT format text file 
+	virtual bool saveGWTFile (const string&, vector<string>*)=0;
+
+	//! Destructor
+	virtual ~TeProxMatrixImplementation(){}
+};
+
+
+//! A class to represent proximity matrix utilising the Breymann graph
+class TL_DLL TeProxMatrixGraphBreymann : public  TeProxMatrixImplementation
+{
+private:
+	br_stl::Graph<string, TeProxMatrixAttributes> graph_;
+
+	typedef map<string, int> Object_id_map_type;
+	Object_id_map_type  map_;
+
+	typedef Object_id_map_type::iterator map_iterator;
+	typedef Object_id_map_type::const_iterator map_const_iterator;
+
+	bool getNeighboursNeighbours (const string& object_id, TeNeighbours& neigh, int max_order = 2, int current_order = 1);
+
+public:
+	//! Empty constructor - graph must be directed then the graph constructor receive true 
+	TeProxMatrixGraphBreymann (); 
+																	 
+	//! Copy constructor
+	TeProxMatrixGraphBreymann(TeProxMatrixGraphBreymann& imp);
+
+	//! Connect two objects
+	virtual void connectObjects (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr);
+	
+	//! Get connection attributes 
+	virtual bool getConnectionAttributes (const string& object_id1, const string& object_id2, TeProxMatrixAttributes& attr);
+	
+	//! Set connection attributes 
+	virtual bool setConnectionAttributes (const string& object_id1, const string& object_id2, const TeProxMatrixAttributes& attr);
+
+	//! Get the neighbours of an object
+	virtual bool getNeighbours (const string& object_id, TeNeighbours& neigh);
+
+	//! Get the obj-th neighbour of an object 
+	virtual bool getNeighbours (int obj, string& object_id, TeNeighbours& neigh); 
+	
+	//! Get the neighbours of an object
+	virtual bool getNeighboursNeighbours (const string& object_id, TeNeighbours& neigh, int max_order = 2);
+
+	//! Return the number of the objects
+	virtual int  numberOfObjects () {return graph_.size();}
+
+	//! Create a copy
+	virtual TeProxMatrixImplementation* createCopy ();
+
+	//! Verify if is equal
+	virtual bool isEqual (TeProxMatrixImplementation& other) 
+	{
+		if (type_ == other.type()) 
+			return (*this == (TeProxMatrixGraphBreymann&)other); 
+		return false;
+	}
+
+	//! Assignment operator 
+	TeProxMatrixGraphBreymann& operator= (TeProxMatrixGraphBreymann& imp); 
+	
+	//! Destructor
+	virtual ~TeProxMatrixGraphBreymann() {}
+
+	//! Save the proximity matrix in a text file 
+	virtual bool saveTextFile (const string& name, map<string, string>* ids=0);
+
+	//! Save the proximity matrix in a GAL text file 
+	virtual bool saveGALFile (const string& name, map<string, string>* ids=0);
+
+	//! Save the proximity matrix in a GWT text file 
+	virtual bool saveGWTFile (const string& name, map<string, string>* ids=0);
+
+	//! Save the proximity matrix in a text file
+	virtual bool saveTextFile (const string& name, vector<string>* ids);
+
+	//! Save the proximity matrix in a GAL format text file 
+	virtual bool saveGALFile (const string& name, vector<string>* ids);
+
+	//! Save the proximity matrix in a GWT format text file 
+	virtual bool saveGWTFile (const string& name, vector<string>* ids);
+};
+
+
+//! An abstract factory of proximity matrix representations  
+class TL_DLL TeProxMatrixAbstractFactory  
+{
+public:
+	static TeProxMatrixImplementation* MakeConcreteImplementation (const TeGPMImplementation& impl_type = TeGraphBreymann)
+	{
+		if (impl_type == TeGraphBreymann) 
+				return new TeProxMatrixGraphBreymann();
+
+		return new TeProxMatrixGraphBreymann();
+	}
+	
+};
+
+/*! \example createProximityMatrix.cpp
+	This is an example of how to  how to create a proximity matrix from a  Spatial Temporal Element Set (STElementSet)
+ */
+#endif
diff --git a/src/terralib/kernel/TeProxMatrixSlicingStrategy.h b/src/terralib/kernel/TeProxMatrixSlicingStrategy.h
old mode 100755
new mode 100644
index daab46e..ad975d2
--- a/src/terralib/kernel/TeProxMatrixSlicingStrategy.h
+++ b/src/terralib/kernel/TeProxMatrixSlicingStrategy.h
@@ -1,113 +1,113 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeProxMatrixSlicingStrategy.h
-    \brief This file contains structures and definitions about slicing strategies of proximity matrix 
-*/
-
-
-#ifndef TeProxMatrixSlicingStrategy_H
-#define TeProxMatrixSlicingStrategy_H
-
-#include "TeProxMatrixImplementation.h"
-
-struct TL_DLL TeProxMatrixSlicingParams
-{
-public:
-	TeGPMSlicingStrategy		strategy_;
-	double						zone_dist_;
-	bool						zone_local_;
-
-	TeProxMatrixSlicingParams(const TeGPMSlicingStrategy& type=TeNoSlicingStrategy):
-		strategy_(type), zone_dist_(0.), zone_local_(false)
-		{}
-
-	bool operator==(const TeProxMatrixSlicingParams& other) const
-	{
-		return ((strategy_==other.strategy_) && (zone_dist_==other.zone_dist_) &&
-			(zone_local_==other.zone_local_));
-	}
-};
-
-
-//! An abstract class to representate slicing strategies of proximity matrix    
-class TL_DLL TeProxMatrixSlicingStrategy  
-{
-protected:
-	//! Slicing type
-	TeProxMatrixSlicingParams params_; 
-
-	//! Empty constructor
-	TeProxMatrixSlicingStrategy(const TeGPMSlicingStrategy& type): params_(type) {}
-
-public:
-	//! Destructor
-	virtual ~TeProxMatrixSlicingStrategy() {}
-
-	//! Slice the proximity matrix 
-	virtual bool Slice(TeProxMatrixImplementation* )=0;
-
-	//! Equal operator
-	virtual bool operator== (const TeProxMatrixSlicingStrategy& s) const {return (params_==s.params_);}
-
-	//! Returns the slicing params
-	TeProxMatrixSlicingParams& slicingParams() { return params_; }
-
-};
-
-
-//! A class to implement the no slicing strategy of proximity matrix (i.e., all neighbour are considered to be in the first slice).
-class TL_DLL TeProxMatrixNoSlicingStrategy : public TeProxMatrixSlicingStrategy
-{
-public:
-	//! Empty constructor
-	TeProxMatrixNoSlicingStrategy (): TeProxMatrixSlicingStrategy(TeNoSlicingStrategy)
-	{}
-
-	//! No slice the proximity matrix 
-	virtual bool Slice(TeProxMatrixImplementation* ) {return true;}
-
-	//! Destructor
-	~TeProxMatrixNoSlicingStrategy() {}
-};
-
-
-//! A class to implement the zone slicing strategy of proximity matrix (by local or newtork connection distance);
-class TL_DLL TeProxMatrixZonesSlicingStrategy : public TeProxMatrixSlicingStrategy
-{
-public:
-	//! Constructor
-	TeProxMatrixZonesSlicingStrategy (double dist, bool local = true):
-	  TeProxMatrixSlicingStrategy(TeZonesSlicingStrategy)
-	  {
-		  params_.zone_dist_=dist;
-		  params_.zone_local_=local;
-	  }
-
-	//! Slice the proximity matrix through zone strategy 
-	virtual bool Slice(TeProxMatrixImplementation* imp);
-
-	//! Destructor
-	~TeProxMatrixZonesSlicingStrategy() {}
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeProxMatrixSlicingStrategy.h
+    \brief This file contains structures and definitions about slicing strategies of proximity matrix 
+*/
+
+
+#ifndef TeProxMatrixSlicingStrategy_H
+#define TeProxMatrixSlicingStrategy_H
+
+#include "TeProxMatrixImplementation.h"
+
+struct TL_DLL TeProxMatrixSlicingParams
+{
+public:
+	TeGPMSlicingStrategy		strategy_;
+	double						zone_dist_;
+	bool						zone_local_;
+
+	TeProxMatrixSlicingParams(const TeGPMSlicingStrategy& type=TeNoSlicingStrategy):
+		strategy_(type), zone_dist_(0.), zone_local_(false)
+		{}
+
+	bool operator==(const TeProxMatrixSlicingParams& other) const
+	{
+		return ((strategy_==other.strategy_) && (zone_dist_==other.zone_dist_) &&
+			(zone_local_==other.zone_local_));
+	}
+};
+
+
+//! An abstract class to representate slicing strategies of proximity matrix    
+class TL_DLL TeProxMatrixSlicingStrategy  
+{
+protected:
+	//! Slicing type
+	TeProxMatrixSlicingParams params_; 
+
+	//! Empty constructor
+	TeProxMatrixSlicingStrategy(const TeGPMSlicingStrategy& type): params_(type) {}
+
+public:
+	//! Destructor
+	virtual ~TeProxMatrixSlicingStrategy() {}
+
+	//! Slice the proximity matrix 
+	virtual bool Slice(TeProxMatrixImplementation* )=0;
+
+	//! Equal operator
+	virtual bool operator== (const TeProxMatrixSlicingStrategy& s) const {return (params_==s.params_);}
+
+	//! Returns the slicing params
+	TeProxMatrixSlicingParams& slicingParams() { return params_; }
+
+};
+
+
+//! A class to implement the no slicing strategy of proximity matrix (i.e., all neighbour are considered to be in the first slice).
+class TL_DLL TeProxMatrixNoSlicingStrategy : public TeProxMatrixSlicingStrategy
+{
+public:
+	//! Empty constructor
+	TeProxMatrixNoSlicingStrategy (): TeProxMatrixSlicingStrategy(TeNoSlicingStrategy)
+	{}
+
+	//! No slice the proximity matrix 
+	virtual bool Slice(TeProxMatrixImplementation* ) {return true;}
+
+	//! Destructor
+	~TeProxMatrixNoSlicingStrategy() {}
+};
+
+
+//! A class to implement the zone slicing strategy of proximity matrix (by local or newtork connection distance);
+class TL_DLL TeProxMatrixZonesSlicingStrategy : public TeProxMatrixSlicingStrategy
+{
+public:
+	//! Constructor
+	TeProxMatrixZonesSlicingStrategy (double dist, bool local = true):
+	  TeProxMatrixSlicingStrategy(TeZonesSlicingStrategy)
+	  {
+		  params_.zone_dist_=dist;
+		  params_.zone_local_=local;
+	  }
+
+	//! Slice the proximity matrix through zone strategy 
+	virtual bool Slice(TeProxMatrixImplementation* imp);
+
+	//! Destructor
+	~TeProxMatrixZonesSlicingStrategy() {}
+};
+
+#endif
diff --git a/src/terralib/kernel/TeProxMatrixStrategies.cpp b/src/terralib/kernel/TeProxMatrixStrategies.cpp
old mode 100755
new mode 100644
index 8871a28..7198417
--- a/src/terralib/kernel/TeProxMatrixStrategies.cpp
+++ b/src/terralib/kernel/TeProxMatrixStrategies.cpp
@@ -1,296 +1,296 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeProxMatrixSlicingStrategy.h"
-#include "TeProxMatrixWeightsStrategy.h"
-
-
-// zone slicing strategy
-bool TeProxMatrixZonesSlicingStrategy::Slice (TeProxMatrixImplementation* imp)
-{
-	if (imp == 0) return false;
-
-	for (int obj = 0; obj < imp->numberOfObjects(); obj++)
-	{
-		TeNeighbours neigh;
-		string object_id;
-		TeProxMatrixAttributes attr;
-		if (imp->getNeighbours (obj, object_id, neigh))
-		{
-			for (int i = 0; i < neigh.size(); i++)
-			{
-				attr = neigh.Attributes(i);
-		
-				double distance, d_centr, d_net, d_conn;
-
-				if (attr.WasCentroidDistanceComputed())
-					d_centr = attr.CentroidDistance();
-				else
-					d_centr = 0;
-				
-
-				if (attr.WasNetworkObjectsDistanceComputed())
-					d_net = attr.NetworkObjectsDistance();
-				else
-					d_net = 0;
-				
-
-				if (attr.WasNetworkMinimumPathComputed())
-					d_conn = attr.NetworkMinimumPath();
-				else
-					d_conn = 0;
-				
-			
-			   if (params_.zone_local_) 
-				   distance = d_centr;
-			   else
-				   distance = d_net + d_conn;
-
-			   int zone = (int) (distance/params_.zone_dist_);
-			   attr.Slice (zone);
-			   imp->setConnectionAttributes (object_id, neigh[i], attr);
-
-			}
-
-		}
-	}
-	return true;
-}
-
-
-// inverse distance weight strategy
-bool TeProxMatrixInverseDistanceStrategy:: 
-ComputeWeigths (TeProxMatrixImplementation* imp)
-{
-	if (imp == 0) return false;
-
-	for (int obj = 0; obj < imp->numberOfObjects(); obj++)
-	{
-		TeNeighbours neigh;
-		string object_id;
-		TeProxMatrixAttributes attr;
-		if (imp->getNeighbours (obj, object_id, neigh))
-		{
-			double tot = 0.0;
-			vector<double> w_vec;
-	
-			for (int i = 0; i < neigh.size(); i++)
-			{
-				TeProxMatrixAttributes attr = neigh.Attributes(i);
-				double w = 1;
-				double d_centr, d_net, d_conn;
-				if (attr.WasCentroidDistanceComputed())
-					if ((d_centr = attr.CentroidDistance()) != 0.0) 
-							w += (params_.a_)*1/d_centr;
-
-				if (attr.WasNetworkObjectsDistanceComputed())
-					if ((d_net = attr.NetworkObjectsDistance()) != 0.0) 
-							w += (params_.b_)*1/d_net;
-
-				if (attr.WasNetworkMinimumPathComputed())
-					if ((d_conn = attr.NetworkMinimumPath()) != 0.0) 
-							w += (params_.c_)*1/d_conn;
-
-				if (w != 1) w -= 1;
-
-				w_vec.push_back (w*params_.factor_);
-				tot += w;
-			}
-	
-		
-			for (int j = 0; j < neigh.size(); j++)
-			{
-					TeProxMatrixAttributes attr = neigh.Attributes(j);
-					double w = w_vec[j];
-					if (params_.norm_)
-						if (tot != 0) w = w/tot;
-					attr.Weight (w);
-					imp->setConnectionAttributes (object_id, neigh[j], attr);
-			}
-		}
-	}
-	return true;
-}
-
-
-
-// inverse distance weight strategy
-bool TeProxMatrixSquaredInverseDistanceStrategy:: 
-ComputeWeigths (TeProxMatrixImplementation* imp)
-{
-	if (imp == 0) return false;
-
-	for (int obj = 0; obj < imp->numberOfObjects(); obj++)
-	{
-		TeNeighbours neigh;
-		string object_id;
-		TeProxMatrixAttributes attr;
-		if (imp->getNeighbours (obj, object_id, neigh))
-		{
-			double tot = 0.0;
-			vector<double> w_vec;
-	
-			for (int i = 0; i < neigh.size(); i++)
-			{
-				TeProxMatrixAttributes attr = neigh.Attributes(i);
-				double w = 1;
-				double d_centr, d_net, d_conn;
-				if (attr.WasCentroidDistanceComputed())
-					if ((d_centr = attr.CentroidDistance()) != 0.0) 
-							w += (params_.a_)*1/(d_centr*d_centr);
-
-				if (attr.WasNetworkObjectsDistanceComputed())
-					if ((d_net = attr.NetworkObjectsDistance()) != 0.0) 
-							w += (params_.b_)*1/(d_net*d_net);
-
-				if (attr.WasNetworkMinimumPathComputed())
-					if ((d_conn = attr.NetworkMinimumPath()) != 0.0) 
-							w += (params_.c_)*1/(d_conn*d_conn);
-
-				if (w != 1) w -= 1;
-
-				w_vec.push_back (w*params_.factor_);
-				tot += w;
-			}
-	
-		
-			for (int j = 0; j < neigh.size(); j++)
-			{
-					TeProxMatrixAttributes attr = neigh.Attributes(j);
-					double w = w_vec[j];
-					if (params_.norm_)
-						if (tot != 0) w = w/tot;
-					attr.Weight (w);
-					imp->setConnectionAttributes (object_id, neigh[j], attr);
-			}
-		}
-	}
-	return true;
-}
-
-// inverse distance weight strategy
-bool TeProxMatrixConnectionStrenghtStrategy:: 
-ComputeWeigths (TeProxMatrixImplementation* imp)
-{
-	if (imp == 0) return false;
-
-	for (int obj = 0; obj < imp->numberOfObjects(); obj++)
-	{
-		TeNeighbours neigh;
-		string object_id;
-		TeProxMatrixAttributes attr;
-		if (imp->getNeighbours (obj, object_id, neigh))
-		{
-			double tot = 0.0;
-			vector<double> w_vec;
-			
-			for (int i = 0; i < neigh.size(); i++)
-			{
-				TeProxMatrixAttributes attr = neigh.Attributes(i);
-				double w = 1;
-				double d_centr = TeMAXFLOAT;
-				double d_net =   TeMAXFLOAT;
-				double d_conn =  TeMAXFLOAT;
-
-				if (attr.WasCentroidDistanceComputed())
-					d_centr = attr.CentroidDistance();
-
-				
-				if (d_centr == 0.0)
-				{
-					w = 1;
-				}
-				else
-				{
-					if (d_centr <= params_.max_local_dist_)
-					{
-						w = 1/d_centr;
-					}
-					else
-					{
-					
-						if (attr.WasNetworkObjectsDistanceComputed())
-							d_net = attr.NetworkObjectsDistance();
-
-						if (attr.WasNetworkMinimumPathComputed())
-							d_conn = attr.NetworkMinimumPath();
-
-						//double distance = (dist_ratio_*d_net + d_conn)/1000; Anap - Jul04
-						double distance = (params_.dist_ratio_*d_net + d_conn);
-						if (distance != 0.0)
-							w = 1/distance;
-					}
-				}
-				//if (w > 1.0) w = 1.0; n�o precisa: o objeto pode ser mais pr�ximo que 1 metro? jul04
-				w_vec.push_back (w*params_.factor_);
-				tot += w;
-			}
-		
-			for (int j = 0; j < neigh.size(); j++)
-			{
-					
-				TeProxMatrixAttributes attr = neigh.Attributes(j);
-				double w = w_vec[j];
-				if (params_.norm_)
-					if (tot != 0) w = w/tot;
-				attr.Weight (w);
-				imp->setConnectionAttributes (object_id, neigh[j], attr);
-				
-			}
-		}
-	}
-	return true;
-}
-
-
-
-bool TeProxMatrixNoWeightsStrategy:: 
-ComputeWeigths (TeProxMatrixImplementation* imp)
-{
-	if (imp == 0) return false;
-	// Normalize
-	if (params_.norm_)
-	{
-		for (int obj = 0; obj < imp->numberOfObjects(); obj++)
-		{
-			TeNeighbours neigh;
-			string object_id;
-			TeProxMatrixAttributes attr;
-			if (imp->getNeighbours (obj, object_id, neigh))
-			{
-	
-				for (int j = 0; j < neigh.size(); j++)
-				{
-					double size = (double) neigh.size();
-					double w = 1.0/size;
-					TeProxMatrixAttributes attr = neigh.Attributes(j);
-				
-					attr.Weight (w);
-					imp->setConnectionAttributes(object_id, neigh[j], attr);
-				}
-			}
-		}
-	}
-	return true;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeProxMatrixSlicingStrategy.h"
+#include "TeProxMatrixWeightsStrategy.h"
+
+
+// zone slicing strategy
+bool TeProxMatrixZonesSlicingStrategy::Slice (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) return false;
+
+	for (int obj = 0; obj < imp->numberOfObjects(); obj++)
+	{
+		TeNeighbours neigh;
+		string object_id;
+		TeProxMatrixAttributes attr;
+		if (imp->getNeighbours (obj, object_id, neigh))
+		{
+			for (int i = 0; i < neigh.size(); i++)
+			{
+				attr = neigh.Attributes(i);
+		
+				double distance, d_centr, d_net, d_conn;
+
+				if (attr.WasCentroidDistanceComputed())
+					d_centr = attr.CentroidDistance();
+				else
+					d_centr = 0;
+				
+
+				if (attr.WasNetworkObjectsDistanceComputed())
+					d_net = attr.NetworkObjectsDistance();
+				else
+					d_net = 0;
+				
+
+				if (attr.WasNetworkMinimumPathComputed())
+					d_conn = attr.NetworkMinimumPath();
+				else
+					d_conn = 0;
+				
+			
+			   if (params_.zone_local_) 
+				   distance = d_centr;
+			   else
+				   distance = d_net + d_conn;
+
+			   int zone = (int) (distance/params_.zone_dist_);
+			   attr.Slice (zone);
+			   imp->setConnectionAttributes (object_id, neigh[i], attr);
+
+			}
+
+		}
+	}
+	return true;
+}
+
+
+// inverse distance weight strategy
+bool TeProxMatrixInverseDistanceStrategy:: 
+ComputeWeigths (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) return false;
+
+	for (int obj = 0; obj < imp->numberOfObjects(); obj++)
+	{
+		TeNeighbours neigh;
+		string object_id;
+		TeProxMatrixAttributes attr;
+		if (imp->getNeighbours (obj, object_id, neigh))
+		{
+			double tot = 0.0;
+			vector<double> w_vec;
+	
+			for (int i = 0; i < neigh.size(); i++)
+			{
+				TeProxMatrixAttributes attr = neigh.Attributes(i);
+				double w = 1;
+				double d_centr, d_net, d_conn;
+				if (attr.WasCentroidDistanceComputed())
+					if ((d_centr = attr.CentroidDistance()) != 0.0) 
+							w += (params_.a_)*1/d_centr;
+
+				if (attr.WasNetworkObjectsDistanceComputed())
+					if ((d_net = attr.NetworkObjectsDistance()) != 0.0) 
+							w += (params_.b_)*1/d_net;
+
+				if (attr.WasNetworkMinimumPathComputed())
+					if ((d_conn = attr.NetworkMinimumPath()) != 0.0) 
+							w += (params_.c_)*1/d_conn;
+
+				if (w != 1) w -= 1;
+
+				w_vec.push_back (w*params_.factor_);
+				tot += w;
+			}
+	
+		
+			for (int j = 0; j < neigh.size(); j++)
+			{
+					TeProxMatrixAttributes attr = neigh.Attributes(j);
+					double w = w_vec[j];
+					if (params_.norm_)
+						if (tot != 0) w = w/tot;
+					attr.Weight (w);
+					imp->setConnectionAttributes (object_id, neigh[j], attr);
+			}
+		}
+	}
+	return true;
+}
+
+
+
+// inverse distance weight strategy
+bool TeProxMatrixSquaredInverseDistanceStrategy:: 
+ComputeWeigths (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) return false;
+
+	for (int obj = 0; obj < imp->numberOfObjects(); obj++)
+	{
+		TeNeighbours neigh;
+		string object_id;
+		TeProxMatrixAttributes attr;
+		if (imp->getNeighbours (obj, object_id, neigh))
+		{
+			double tot = 0.0;
+			vector<double> w_vec;
+	
+			for (int i = 0; i < neigh.size(); i++)
+			{
+				TeProxMatrixAttributes attr = neigh.Attributes(i);
+				double w = 1;
+				double d_centr, d_net, d_conn;
+				if (attr.WasCentroidDistanceComputed())
+					if ((d_centr = attr.CentroidDistance()) != 0.0) 
+							w += (params_.a_)*1/(d_centr*d_centr);
+
+				if (attr.WasNetworkObjectsDistanceComputed())
+					if ((d_net = attr.NetworkObjectsDistance()) != 0.0) 
+							w += (params_.b_)*1/(d_net*d_net);
+
+				if (attr.WasNetworkMinimumPathComputed())
+					if ((d_conn = attr.NetworkMinimumPath()) != 0.0) 
+							w += (params_.c_)*1/(d_conn*d_conn);
+
+				if (w != 1) w -= 1;
+
+				w_vec.push_back (w*params_.factor_);
+				tot += w;
+			}
+	
+		
+			for (int j = 0; j < neigh.size(); j++)
+			{
+					TeProxMatrixAttributes attr = neigh.Attributes(j);
+					double w = w_vec[j];
+					if (params_.norm_)
+						if (tot != 0) w = w/tot;
+					attr.Weight (w);
+					imp->setConnectionAttributes (object_id, neigh[j], attr);
+			}
+		}
+	}
+	return true;
+}
+
+// inverse distance weight strategy
+bool TeProxMatrixConnectionStrenghtStrategy:: 
+ComputeWeigths (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) return false;
+
+	for (int obj = 0; obj < imp->numberOfObjects(); obj++)
+	{
+		TeNeighbours neigh;
+		string object_id;
+		TeProxMatrixAttributes attr;
+		if (imp->getNeighbours (obj, object_id, neigh))
+		{
+			double tot = 0.0;
+			vector<double> w_vec;
+			
+			for (int i = 0; i < neigh.size(); i++)
+			{
+				TeProxMatrixAttributes attr = neigh.Attributes(i);
+				double w = 1;
+				double d_centr = TeMAXFLOAT;
+				double d_net =   TeMAXFLOAT;
+				double d_conn =  TeMAXFLOAT;
+
+				if (attr.WasCentroidDistanceComputed())
+					d_centr = attr.CentroidDistance();
+
+				
+				if (d_centr == 0.0)
+				{
+					w = 1;
+				}
+				else
+				{
+					if (d_centr <= params_.max_local_dist_)
+					{
+						w = 1/d_centr;
+					}
+					else
+					{
+					
+						if (attr.WasNetworkObjectsDistanceComputed())
+							d_net = attr.NetworkObjectsDistance();
+
+						if (attr.WasNetworkMinimumPathComputed())
+							d_conn = attr.NetworkMinimumPath();
+
+						//double distance = (dist_ratio_*d_net + d_conn)/1000; Anap - Jul04
+						double distance = (params_.dist_ratio_*d_net + d_conn);
+						if (distance != 0.0)
+							w = 1/distance;
+					}
+				}
+				//if (w > 1.0) w = 1.0; n�o precisa: o objeto pode ser mais pr�ximo que 1 metro? jul04
+				w_vec.push_back (w*params_.factor_);
+				tot += w;
+			}
+		
+			for (int j = 0; j < neigh.size(); j++)
+			{
+					
+				TeProxMatrixAttributes attr = neigh.Attributes(j);
+				double w = w_vec[j];
+				if (params_.norm_)
+					if (tot != 0) w = w/tot;
+				attr.Weight (w);
+				imp->setConnectionAttributes (object_id, neigh[j], attr);
+				
+			}
+		}
+	}
+	return true;
+}
+
+
+
+bool TeProxMatrixNoWeightsStrategy:: 
+ComputeWeigths (TeProxMatrixImplementation* imp)
+{
+	if (imp == 0) return false;
+	// Normalize
+	if (params_.norm_)
+	{
+		for (int obj = 0; obj < imp->numberOfObjects(); obj++)
+		{
+			TeNeighbours neigh;
+			string object_id;
+			TeProxMatrixAttributes attr;
+			if (imp->getNeighbours (obj, object_id, neigh))
+			{
+	
+				for (int j = 0; j < neigh.size(); j++)
+				{
+					double size = (double) neigh.size();
+					double w = 1.0/size;
+					TeProxMatrixAttributes attr = neigh.Attributes(j);
+				
+					attr.Weight (w);
+					imp->setConnectionAttributes(object_id, neigh[j], attr);
+				}
+			}
+		}
+	}
+	return true;
+}
+
diff --git a/src/terralib/kernel/TeProxMatrixWeightsStrategy.h b/src/terralib/kernel/TeProxMatrixWeightsStrategy.h
old mode 100755
new mode 100644
index b04d413..7fce569
--- a/src/terralib/kernel/TeProxMatrixWeightsStrategy.h
+++ b/src/terralib/kernel/TeProxMatrixWeightsStrategy.h
@@ -1,168 +1,168 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeProxMatrixWeightsStrategy.h
-    \brief This file contains structures and definitions about weight strategies of proximity matrix 
-*/
-
-
-#ifndef TeProxMatrixWeightsStrategy_H
-#define TeProxMatrixWeightsStrategy_H
-
-#include "TeProxMatrixImplementation.h"
-#include <vector>
-
-
-struct TL_DLL TeProxMatrixWeightsParams
-{
-public:
-	TeGPMWeightsStrategy		strategy_;
-	bool						norm_;
-	double						a_;
-	double						b_;
-	double						c_;
-	double						factor_;
-	double						dist_ratio_;
-	double						max_local_dist_;
-
-	TeProxMatrixWeightsParams(): 
-		strategy_(TeNoWeightsStrategy), norm_(false), a_(1.), 
-		b_(1.), c_(1.), factor_(1.), dist_ratio_(0.), max_local_dist_(0.)
-		{}
-
-	TeProxMatrixWeightsParams(bool norm, const TeGPMWeightsStrategy& type): 
-		strategy_(type), norm_(norm), a_(1.), b_(1.), c_(1.), 
-		factor_(1.), dist_ratio_(0.), max_local_dist_(0.)
-		{}
-
-	bool operator== (const TeProxMatrixWeightsParams& other) const
-	{
-		return ((strategy_==other.strategy_) && (norm_==other.norm_) &&
-			(a_==other.a_) && (b_==other.b_) && (c_==other.c_) &&
-			(factor_==other.factor_) && (dist_ratio_==other.dist_ratio_) &&
-			(max_local_dist_==other.max_local_dist_));
-	}
-};
-
-
-//! An abstract class to representate weight strategies of proximity matrix    
-class TL_DLL TeProxMatrixWeightsStrategy  
-{
-protected:
-	TeProxMatrixWeightsParams params_; 
-
-	//! Constructor
-	TeProxMatrixWeightsStrategy(bool norm = false, const TeGPMWeightsStrategy& type=TeNoWeightsStrategy ):
-		params_(norm, type)
-	 { }
-
-public:
-	//! Compute weigths
-	virtual bool ComputeWeigths (TeProxMatrixImplementation* ) =0;
-
-	//! Destructor
-	virtual ~TeProxMatrixWeightsStrategy() {}
-
-	//! Equal operator
-	virtual bool operator== (const TeProxMatrixWeightsStrategy& w) const {return (params_==w.params_);}
-
-	//! Returns the strategy to weigt the matrix
-	TeProxMatrixWeightsParams& weightsParams() { return params_; }
-};
-
-//! A class to implement the no weight strategy of proximity matrix (i.e., all weights are 1, only indicating that a connection exists).
-class TL_DLL TeProxMatrixNoWeightsStrategy : public TeProxMatrixWeightsStrategy
-{
-public:
-	//! Constructor
-	TeProxMatrixNoWeightsStrategy (bool norm = true) : TeProxMatrixWeightsStrategy(norm, TeNoWeightsStrategy)
-	{ }
-
-	//! Compute weigths
-	virtual bool ComputeWeigths (TeProxMatrixImplementation* imp);
-
-	//! Destructor
-	~TeProxMatrixNoWeightsStrategy() {}
-};
-
-
-//! A class to implement the inverse distance weight strategy of proximity matrix; if network distances were computed, they can be also considered.
-//! Formula: w = (a*1/dist_centroids + b*1/dist_to_net + c*1/dist_net_connection)*factor
-//! These values can be normalized or not.
-class TL_DLL TeProxMatrixInverseDistanceStrategy : public TeProxMatrixWeightsStrategy
-{
-public:
-	//! Constructor
-	TeProxMatrixInverseDistanceStrategy  (double a = 1.0, double b = 1.0, double c = 1.0, double factor = 1.0, bool norm = true) : 
-	  TeProxMatrixWeightsStrategy (norm, TeInverseDistanceStrategy)
-	{ params_.a_ = a; params_.b_ = b; params_.c_ = c; params_.factor_ = factor;}
-
-	//! Compute weights
-	virtual bool ComputeWeigths (TeProxMatrixImplementation* imp); 
-
-	//! Destructor	
-	~TeProxMatrixInverseDistanceStrategy() {}
-};
-
-
-//! A class to implement the inverse distance weight strategy of proximity matrix; if network distances were computed, they can be also considered.
-//! Formula: w = (a*1/(dist_centroids)2 + b*1/(dist_to_net)2 + c*1/(dist_net_connection)2)*factor
-//! These values can be normalized or not.
-class TL_DLL TeProxMatrixSquaredInverseDistanceStrategy : public TeProxMatrixWeightsStrategy
-{
-public:
-	//! Constructor
-	TeProxMatrixSquaredInverseDistanceStrategy  (double a = 1.0, double b = 1.0, double c = 1.0, double factor = 1.0, bool norm = true) : 
-	  TeProxMatrixWeightsStrategy (norm, TeSquaredInverseDistStrategy)
-	{ params_.a_ = a; params_.b_ = b; params_.c_ = c; params_.factor_ = factor;}
-
-	//! Compute weights
-	virtual bool ComputeWeigths (TeProxMatrixImplementation* imp); 
-
-	//! Destructor	
-	~TeProxMatrixSquaredInverseDistanceStrategy() {}
-};
-
-
-//! A class to implement the connection strenght weight strategy of proximity matrix
-//! If centroids distance is smaller them max_local_distance, w will be only the local distance inverse (multiplied by factor).
-//! otherwise, it will be w = 1/(dist_ratio*dist_to_net + dist_net_connection)*factor.
-class TL_DLL TeProxMatrixConnectionStrenghtStrategy : public TeProxMatrixWeightsStrategy
-{
-public:
-	//! Constructor
-	TeProxMatrixConnectionStrenghtStrategy  (double dist_ratio = 1.0, double max_local_distance = 0.0, double factor = 1.0, bool norm = true) 
-		: TeProxMatrixWeightsStrategy (norm, TeConnectionStrenghtStrategy )
-	{ 
-		params_.dist_ratio_ = dist_ratio;
-		params_.max_local_dist_ = max_local_distance;
-		params_.factor_ = factor;
-	}
-
-	//! Compute weights
-	virtual bool ComputeWeigths (TeProxMatrixImplementation* imp); 
-
-	//! Destructor	
-	~TeProxMatrixConnectionStrenghtStrategy() {}
-};
-
-#endif 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeProxMatrixWeightsStrategy.h
+    \brief This file contains structures and definitions about weight strategies of proximity matrix 
+*/
+
+
+#ifndef TeProxMatrixWeightsStrategy_H
+#define TeProxMatrixWeightsStrategy_H
+
+#include "TeProxMatrixImplementation.h"
+#include <vector>
+
+
+struct TL_DLL TeProxMatrixWeightsParams
+{
+public:
+	TeGPMWeightsStrategy		strategy_;
+	bool						norm_;
+	double						a_;
+	double						b_;
+	double						c_;
+	double						factor_;
+	double						dist_ratio_;
+	double						max_local_dist_;
+
+	TeProxMatrixWeightsParams(): 
+		strategy_(TeNoWeightsStrategy), norm_(false), a_(1.), 
+		b_(1.), c_(1.), factor_(1.), dist_ratio_(0.), max_local_dist_(0.)
+		{}
+
+	TeProxMatrixWeightsParams(bool norm, const TeGPMWeightsStrategy& type): 
+		strategy_(type), norm_(norm), a_(1.), b_(1.), c_(1.), 
+		factor_(1.), dist_ratio_(0.), max_local_dist_(0.)
+		{}
+
+	bool operator== (const TeProxMatrixWeightsParams& other) const
+	{
+		return ((strategy_==other.strategy_) && (norm_==other.norm_) &&
+			(a_==other.a_) && (b_==other.b_) && (c_==other.c_) &&
+			(factor_==other.factor_) && (dist_ratio_==other.dist_ratio_) &&
+			(max_local_dist_==other.max_local_dist_));
+	}
+};
+
+
+//! An abstract class to representate weight strategies of proximity matrix    
+class TL_DLL TeProxMatrixWeightsStrategy  
+{
+protected:
+	TeProxMatrixWeightsParams params_; 
+
+	//! Constructor
+	TeProxMatrixWeightsStrategy(bool norm = false, const TeGPMWeightsStrategy& type=TeNoWeightsStrategy ):
+		params_(norm, type)
+	 { }
+
+public:
+	//! Compute weigths
+	virtual bool ComputeWeigths (TeProxMatrixImplementation* ) =0;
+
+	//! Destructor
+	virtual ~TeProxMatrixWeightsStrategy() {}
+
+	//! Equal operator
+	virtual bool operator== (const TeProxMatrixWeightsStrategy& w) const {return (params_==w.params_);}
+
+	//! Returns the strategy to weigt the matrix
+	TeProxMatrixWeightsParams& weightsParams() { return params_; }
+};
+
+//! A class to implement the no weight strategy of proximity matrix (i.e., all weights are 1, only indicating that a connection exists).
+class TL_DLL TeProxMatrixNoWeightsStrategy : public TeProxMatrixWeightsStrategy
+{
+public:
+	//! Constructor
+	TeProxMatrixNoWeightsStrategy (bool norm = true) : TeProxMatrixWeightsStrategy(norm, TeNoWeightsStrategy)
+	{ }
+
+	//! Compute weigths
+	virtual bool ComputeWeigths (TeProxMatrixImplementation* imp);
+
+	//! Destructor
+	~TeProxMatrixNoWeightsStrategy() {}
+};
+
+
+//! A class to implement the inverse distance weight strategy of proximity matrix; if network distances were computed, they can be also considered.
+//! Formula: w = (a*1/dist_centroids + b*1/dist_to_net + c*1/dist_net_connection)*factor
+//! These values can be normalized or not.
+class TL_DLL TeProxMatrixInverseDistanceStrategy : public TeProxMatrixWeightsStrategy
+{
+public:
+	//! Constructor
+	TeProxMatrixInverseDistanceStrategy  (double a = 1.0, double b = 1.0, double c = 1.0, double factor = 1.0, bool norm = true) : 
+	  TeProxMatrixWeightsStrategy (norm, TeInverseDistanceStrategy)
+	{ params_.a_ = a; params_.b_ = b; params_.c_ = c; params_.factor_ = factor;}
+
+	//! Compute weights
+	virtual bool ComputeWeigths (TeProxMatrixImplementation* imp); 
+
+	//! Destructor	
+	~TeProxMatrixInverseDistanceStrategy() {}
+};
+
+
+//! A class to implement the inverse distance weight strategy of proximity matrix; if network distances were computed, they can be also considered.
+//! Formula: w = (a*1/(dist_centroids)2 + b*1/(dist_to_net)2 + c*1/(dist_net_connection)2)*factor
+//! These values can be normalized or not.
+class TL_DLL TeProxMatrixSquaredInverseDistanceStrategy : public TeProxMatrixWeightsStrategy
+{
+public:
+	//! Constructor
+	TeProxMatrixSquaredInverseDistanceStrategy  (double a = 1.0, double b = 1.0, double c = 1.0, double factor = 1.0, bool norm = true) : 
+	  TeProxMatrixWeightsStrategy (norm, TeSquaredInverseDistStrategy)
+	{ params_.a_ = a; params_.b_ = b; params_.c_ = c; params_.factor_ = factor;}
+
+	//! Compute weights
+	virtual bool ComputeWeigths (TeProxMatrixImplementation* imp); 
+
+	//! Destructor	
+	~TeProxMatrixSquaredInverseDistanceStrategy() {}
+};
+
+
+//! A class to implement the connection strenght weight strategy of proximity matrix
+//! If centroids distance is smaller them max_local_distance, w will be only the local distance inverse (multiplied by factor).
+//! otherwise, it will be w = 1/(dist_ratio*dist_to_net + dist_net_connection)*factor.
+class TL_DLL TeProxMatrixConnectionStrenghtStrategy : public TeProxMatrixWeightsStrategy
+{
+public:
+	//! Constructor
+	TeProxMatrixConnectionStrenghtStrategy  (double dist_ratio = 1.0, double max_local_distance = 0.0, double factor = 1.0, bool norm = true) 
+		: TeProxMatrixWeightsStrategy (norm, TeConnectionStrenghtStrategy )
+	{ 
+		params_.dist_ratio_ = dist_ratio;
+		params_.max_local_dist_ = max_local_distance;
+		params_.factor_ = factor;
+	}
+
+	//! Compute weights
+	virtual bool ComputeWeigths (TeProxMatrixImplementation* imp); 
+
+	//! Destructor	
+	~TeProxMatrixConnectionStrenghtStrategy() {}
+};
+
+#endif 
diff --git a/src/terralib/kernel/TeQuerier.cpp b/src/terralib/kernel/TeQuerier.cpp
old mode 100755
new mode 100644
index 7464f74..5c4fcd6
--- a/src/terralib/kernel/TeQuerier.cpp
+++ b/src/terralib/kernel/TeQuerier.cpp
@@ -1,204 +1,204 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeQuerier.h"
-#include "TeQuerierImpl.h"
-
-
-TeQuerier::TeQuerier(TeQuerierParams& params)
-{
-	Impl_ = TeQuerierImplFactory::make(params);
-}
-
-TeQuerier::TeQuerier(const TeQuerier& other)
-{
-	if(Impl_)
-		delete Impl_;
-
-	Impl_ = 0;
-	if(other.Impl_ && other.Impl_->params())
-	{
-		Impl_ = TeQuerierImplFactory::make(*(other.Impl_->params()));
-	}
-}
-
-TeQuerier&
-TeQuerier::operator=(const TeQuerier& other)
-{
-	if ( this != &other )
-	{
-		if(Impl_)
-			delete Impl_;
-
-		Impl_ = 0;
-		if(other.Impl_ && other.Impl_->params())
-		{
-			Impl_ = TeQuerierImplFactory::make(*(other.Impl_->params()));
-		}
-	}
-	return *this;
-}
-
-TeQuerier::~TeQuerier()
-{
-	if(Impl_)
-		delete (Impl_);
-}
-
-bool 
-TeQuerier::loadInstances(int frame)
-{
-	if(!Impl_)
-		return false;
-
-	return(Impl_->loadTimeFrameInstances(frame));
-}
-
-
-bool 
-TeQuerier::fetchInstance(TeSTInstance&  sto)
-{
-	if(!Impl_)
-		return false;
-
-	return(Impl_->fetchInstance(sto));
-}
-
-
-int 
-TeQuerier::getNumTimeFrames()
-{
-	if(!Impl_) 
-		return false;
-
-	return (Impl_->getNumTimeFrames());
-}
-
-bool 
-TeQuerier::getTSEntry(TeTSEntry& tsEntry, int frame)
-{
-	if(!Impl_) 
-		return false;
-
-	return(Impl_->getTSEntry(tsEntry, frame)); 
-}
-
-
-bool 
-TeQuerier::getTS(TeTemporalSeries& ts)
-{
-	if(!Impl_) 
-		return false;
-
-	return (Impl_->getTS(ts));
-}
-
-TeTheme* 
-TeQuerier::theme()
-{
-	if(!Impl_)
-		return 0;
-
-	return(Impl_->theme());
-}
-
-
-int 
-TeQuerier::numElemInstances()
-{
-	if(!Impl_)
-		return 0;
-
-	return (Impl_->numElemInstances());
-}
-
-TeQuerierParams&
-TeQuerier::params() 
-{ 
-	return (*(Impl_->params())); 
-}
-
-TeTSParams& 
-TeQuerier::getTSParams() 
-{ 
-	return (Impl_->getTSParams()); 
-}
-
-void 
-TeQuerier::clear()
-{
-	if(!Impl_)
-		return;
-
-	Impl_->clear();
-}
-
-TeAttributeList
-TeQuerier::getAttrList()
-{
-	TeAttributeList temp;
-	if(!Impl_)
-		return temp;
-
-	return (Impl_->getAttrList());
-}
-
-TeBox	
-TeQuerier::getBox()
-{
-	TeBox b;
-	if(!Impl_)
-		return b;
-
-	return (Impl_->params()->box());
-}
-
-void 
-TeQuerier::refresh(TeQuerierParams& params)
-{
-	if(Impl_)
-		delete (Impl_);
-	
-	Impl_ = TeQuerierImplFactory::make(params);
-}
-
-bool 
-TeQuerier::loadGeometries(TeMultiGeometry& geometries, unsigned int& index)
-{
-	if(!Impl_)
-		return false;
-
-	return (Impl_->loadGeometries(geometries, index));
-}
-
-
-bool 
-TeQuerier::loadGeometries(TeMultiGeometry& geometries)
-{
-	if(!Impl_)
-		return false;
-
-	return (Impl_->loadGeometries(geometries));
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeQuerier.h"
+#include "TeQuerierImpl.h"
+
+
+TeQuerier::TeQuerier(TeQuerierParams& params)
+{
+	Impl_ = TeQuerierImplFactory::make(params);
+}
+
+TeQuerier::TeQuerier(const TeQuerier& other)
+{
+	if(Impl_)
+		delete Impl_;
+
+	Impl_ = 0;
+	if(other.Impl_ && other.Impl_->params())
+	{
+		Impl_ = TeQuerierImplFactory::make(*(other.Impl_->params()));
+	}
+}
+
+TeQuerier&
+TeQuerier::operator=(const TeQuerier& other)
+{
+	if ( this != &other )
+	{
+		if(Impl_)
+			delete Impl_;
+
+		Impl_ = 0;
+		if(other.Impl_ && other.Impl_->params())
+		{
+			Impl_ = TeQuerierImplFactory::make(*(other.Impl_->params()));
+		}
+	}
+	return *this;
+}
+
+TeQuerier::~TeQuerier()
+{
+	if(Impl_)
+		delete (Impl_);
+}
+
+bool 
+TeQuerier::loadInstances(int frame)
+{
+	if(!Impl_)
+		return false;
+
+	return(Impl_->loadTimeFrameInstances(frame));
+}
+
+
+bool 
+TeQuerier::fetchInstance(TeSTInstance&  sto)
+{
+	if(!Impl_)
+		return false;
+
+	return(Impl_->fetchInstance(sto));
+}
+
+
+int 
+TeQuerier::getNumTimeFrames()
+{
+	if(!Impl_) 
+		return false;
+
+	return (Impl_->getNumTimeFrames());
+}
+
+bool 
+TeQuerier::getTSEntry(TeTSEntry& tsEntry, int frame)
+{
+	if(!Impl_) 
+		return false;
+
+	return(Impl_->getTSEntry(tsEntry, frame)); 
+}
+
+
+bool 
+TeQuerier::getTS(TeTemporalSeries& ts)
+{
+	if(!Impl_) 
+		return false;
+
+	return (Impl_->getTS(ts));
+}
+
+TeTheme* 
+TeQuerier::theme()
+{
+	if(!Impl_)
+		return 0;
+
+	return(Impl_->theme());
+}
+
+
+int 
+TeQuerier::numElemInstances()
+{
+	if(!Impl_)
+		return 0;
+
+	return (Impl_->numElemInstances());
+}
+
+TeQuerierParams&
+TeQuerier::params() 
+{ 
+	return (*(Impl_->params())); 
+}
+
+TeTSParams& 
+TeQuerier::getTSParams() 
+{ 
+	return (Impl_->getTSParams()); 
+}
+
+void 
+TeQuerier::clear()
+{
+	if(!Impl_)
+		return;
+
+	Impl_->clear();
+}
+
+TeAttributeList
+TeQuerier::getAttrList()
+{
+	TeAttributeList temp;
+	if(!Impl_)
+		return temp;
+
+	return (Impl_->getAttrList());
+}
+
+TeBox	
+TeQuerier::getBox()
+{
+	TeBox b;
+	if(!Impl_)
+		return b;
+
+	return (Impl_->params()->box());
+}
+
+void 
+TeQuerier::refresh(TeQuerierParams& params)
+{
+	if(Impl_)
+		delete (Impl_);
+	
+	Impl_ = TeQuerierImplFactory::make(params);
+}
+
+bool 
+TeQuerier::loadGeometries(TeMultiGeometry& geometries, unsigned int& index)
+{
+	if(!Impl_)
+		return false;
+
+	return (Impl_->loadGeometries(geometries, index));
+}
+
+
+bool 
+TeQuerier::loadGeometries(TeMultiGeometry& geometries)
+{
+	if(!Impl_)
+		return false;
+
+	return (Impl_->loadGeometries(geometries));
+}
+
+
diff --git a/src/terralib/kernel/TeQuerier.h b/src/terralib/kernel/TeQuerier.h
old mode 100755
new mode 100644
index c621dbb..7a5e65d
--- a/src/terralib/kernel/TeQuerier.h
+++ b/src/terralib/kernel/TeQuerier.h
@@ -1,154 +1,154 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeQuerier.h
-	\brief This file contains a mechanism named "Querier" that is responsible for loading spatio-temporal instances from different sources. 
-*/
-
-#ifndef  __TERRALIB_INTERNAL_QUERIER_H
-#define  __TERRALIB_INTERNAL_QUERIER_H
-
-#include "TeSTInstance.h"
-#include "TeTemporalSeries.h"
-
-#include "TeQuerierDBStr1.h"
-#include "TeQuerierDBStr2.h"
-#include "TeQuerierDBStr3.h"
-
-class TeQuerierParams;
-class TeQuerierImpl; 
-
-/*! \class TeQuerier
-	\brief A class responsible for loading spatial temporal instances from different sources.
-
-	This class implements a mechanism that is responsible for loading
-	spatio-temporal instances (ST instances) from different sources. This mechanism can 
-	load ST instances from a layer or theme stored in a 
-	TerraLib database or in a shape file. The Querier is initialized for a set of
-	parameters that defines its behavior. 
-
-	\sa
-	TeSTInstance TeQuerierParams
-*/
-class TL_DLL TeQuerier
-{
-protected:
-		TeQuerierImpl*		Impl_;		//!<  querier implementation (handle/bory pattern)
-		
-public:	
-		//! Empty constructor
-		TeQuerier():
-			Impl_(0)
-			{} 
-			
-		//! Constructor from a set of parameters
-		TeQuerier(TeQuerierParams& params);
-
-		//! Copy constructor
-		TeQuerier(const TeQuerier& other);
-
-		//! Operator =
-		TeQuerier& operator= (const TeQuerier& other);
-				
-		//! Destructor
-		~TeQuerier(); 
-		
-		//! Returns the base theme
-		TeTheme* theme();
-		
-	 	//! Loads the ST instances. If frame > -1, loads only the instances of the frame-th time frame 
-		bool loadInstances(int frame=-1);  
-		
-		//! Gets the current ST instance and moves to the next one. Returns if there is a next instance. 
-		bool fetchInstance(TeSTInstance&  sto);
-
-		//! Returns the number of time frames generated by a specific chronon	
-		int getNumTimeFrames(); 
-
-		//! Gets a temporal serie entry associated to a time frame
-		bool getTSEntry(TeTSEntry& tsEntry, int frame);
-		
-		//! Gets the temporal series
-		bool getTS(TeTemporalSeries& ts); 
-		
-		//! Returns the temporal series parameters
-		TeTSParams& getTSParams();
-		
-		//! Gets the attribute list of the instances
-		TeAttributeList getAttrList();
-
-		//! Gets the minimal bounding box
-		TeBox	getBox();
-
-		//! Returns the number of instances loaded by the method "loadInstances"
-		int numElemInstances(); 
-
-		//! Returns the querier parameters
-		TeQuerierParams& params(); 
-
-		//! Clear querier structures
-		void clear(); 
-
-		//! Refreshes the querier based on a new querier parameters
-		void refresh(TeQuerierParams& params); 
-		
-		//! Loads all geometries of the index-th geometry representation  
-		bool loadGeometries(TeMultiGeometry& geometries, unsigned int& index); 
-
-		//! Loads all geometries 
-		bool loadGeometries(TeMultiGeometry& geometries);
-};
-
- /** \example querierFromLayer.cpp
-	Shows how to use a querier from layer
- */
-
- /** \example querierFromTheme.cpp
-	Shows how to use a querier from theme
- */
-
- /** \example querierGroupChronon.cpp
-	Shows how to querier from theme, grouping spatiotemporal instances by a chronon
- */
-
- /** \example querierGroupElement.cpp
-	Shows how to use a querier from theme, grouping spatiotemporal instances by a element
- */
-
- /** \example querierGroupSpatialRest.cpp
-	Shows how to use a querier from theme, grouping all  
-   spatiotemporal instances that satisfy a spatial restriction
- */
-
- /** \example querierWithSpatialRestBox.cpp
-	Shows how to use a querier from theme, using a spatial restriction 
-	defined by a rectangle (TeBOX)
- */
-
- /** \example querierWithSpatialRestGeometry.cpp
-	Shows how to use a querier from theme, using a spatial restriction 
-	defined by a geometry (polygons, lines, cells and points) from another theme
- */
-#endif 
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeQuerier.h
+	\brief This file contains a mechanism named "Querier" that is responsible for loading spatio-temporal instances from different sources. 
+*/
+
+#ifndef  __TERRALIB_INTERNAL_QUERIER_H
+#define  __TERRALIB_INTERNAL_QUERIER_H
+
+#include "TeSTInstance.h"
+#include "TeTemporalSeries.h"
+
+#include "TeQuerierDBStr1.h"
+#include "TeQuerierDBStr2.h"
+#include "TeQuerierDBStr3.h"
+
+class TeQuerierParams;
+class TeQuerierImpl; 
+
+/*! \class TeQuerier
+	\brief A class responsible for loading spatial temporal instances from different sources.
+
+	This class implements a mechanism that is responsible for loading
+	spatio-temporal instances (ST instances) from different sources. This mechanism can 
+	load ST instances from a layer or theme stored in a 
+	TerraLib database or in a shape file. The Querier is initialized for a set of
+	parameters that defines its behavior. 
+
+	\sa
+	TeSTInstance TeQuerierParams
+*/
+class TL_DLL TeQuerier
+{
+protected:
+		TeQuerierImpl*		Impl_;		//!<  querier implementation (handle/bory pattern)
+		
+public:	
+		//! Empty constructor
+		TeQuerier():
+			Impl_(0)
+			{} 
+			
+		//! Constructor from a set of parameters
+		TeQuerier(TeQuerierParams& params);
+
+		//! Copy constructor
+		TeQuerier(const TeQuerier& other);
+
+		//! Operator =
+		TeQuerier& operator= (const TeQuerier& other);
+				
+		//! Destructor
+		~TeQuerier(); 
+		
+		//! Returns the base theme
+		TeTheme* theme();
+		
+	 	//! Loads the ST instances. If frame > -1, loads only the instances of the frame-th time frame 
+		bool loadInstances(int frame=-1);  
+		
+		//! Gets the current ST instance and moves to the next one. Returns if there is a next instance. 
+		bool fetchInstance(TeSTInstance&  sto);
+
+		//! Returns the number of time frames generated by a specific chronon	
+		int getNumTimeFrames(); 
+
+		//! Gets a temporal serie entry associated to a time frame
+		bool getTSEntry(TeTSEntry& tsEntry, int frame);
+		
+		//! Gets the temporal series
+		bool getTS(TeTemporalSeries& ts); 
+		
+		//! Returns the temporal series parameters
+		TeTSParams& getTSParams();
+		
+		//! Gets the attribute list of the instances
+		TeAttributeList getAttrList();
+
+		//! Gets the minimal bounding box
+		TeBox	getBox();
+
+		//! Returns the number of instances loaded by the method "loadInstances"
+		int numElemInstances(); 
+
+		//! Returns the querier parameters
+		TeQuerierParams& params(); 
+
+		//! Clear querier structures
+		void clear(); 
+
+		//! Refreshes the querier based on a new querier parameters
+		void refresh(TeQuerierParams& params); 
+		
+		//! Loads all geometries of the index-th geometry representation  
+		bool loadGeometries(TeMultiGeometry& geometries, unsigned int& index); 
+
+		//! Loads all geometries 
+		bool loadGeometries(TeMultiGeometry& geometries);
+};
+
+ /** \example querierFromLayer.cpp
+	Shows how to use a querier from layer
+ */
+
+ /** \example querierFromTheme.cpp
+	Shows how to use a querier from theme
+ */
+
+ /** \example querierGroupChronon.cpp
+	Shows how to querier from theme, grouping spatiotemporal instances by a chronon
+ */
+
+ /** \example querierGroupElement.cpp
+	Shows how to use a querier from theme, grouping spatiotemporal instances by a element
+ */
+
+ /** \example querierGroupSpatialRest.cpp
+	Shows how to use a querier from theme, grouping all  
+   spatiotemporal instances that satisfy a spatial restriction
+ */
+
+ /** \example querierWithSpatialRestBox.cpp
+	Shows how to use a querier from theme, using a spatial restriction 
+	defined by a rectangle (TeBOX)
+ */
+
+ /** \example querierWithSpatialRestGeometry.cpp
+	Shows how to use a querier from theme, using a spatial restriction 
+	defined by a geometry (polygons, lines, cells and points) from another theme
+ */
+#endif 
+
+
+
diff --git a/src/terralib/kernel/TeQuerierDB.cpp b/src/terralib/kernel/TeQuerierDB.cpp
old mode 100755
new mode 100644
index 4397807..2f5ea6e
--- a/src/terralib/kernel/TeQuerierDB.cpp
+++ b/src/terralib/kernel/TeQuerierDB.cpp
@@ -1,536 +1,537 @@
-
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeQuerierDB.h"
-#include "TeDatabase.h"
-#include "TeSTInstance.h"
-#include "TeTemporalSeries.h"
-
-// Add geometries from portal to STO 
-bool 
-addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeSTInstance& sto, const int& linkIndex, const int& geomIdIndex) 
-{
-	bool flag=true;
-	map<int, int> geomIds;
-		
-	//verify if the portal has geometry (multi geometries)
-	string geomId = string(portal->getData(geomIdIndex));
-	string objId =  string(portal->getData(linkIndex)); 
-	int	gId = atoi(geomId.c_str());
-	
-	//There are no geometries in the portal. This happens when
-	//the objects have multi geometries (ex.: obj 1 is line and obj 2 is ponit).
-	//The portal must point to the next object.
-	if(geomId.empty())
-	{
-		do
-		{
-			flag = portal->fetchRow();
-		} while(flag && (string(portal->getData(linkIndex)) == sto.objectId()));
-		
-		return flag; 
-	}
-
-	//The portal points to other object. This happens when
-	//the objects have more than one geometrical representation and, at the same time, 
-	//the theme has an external table.
-	if(objId!=sto.objectId())
-	{
-		do
-		{
-			flag = portal->fetchRow();
-			objId = string(portal->getData(linkIndex));
-		} while(flag && ( objId != sto.objectId()));
-		
-		gId = atoi(portal->getData(geomIdIndex));
-	}
-
-	//There are geometries
-	while(	flag && (objId == sto.objectId()) &&
-			(geomIds.find(gId) == geomIds.end()))
-	{
-		geomIds[gId] = gId;
-		if(geomRep == TePOLYGONS)
-		{
-			TePolygon pol;
-			flag = portal->fetchGeometry(pol, geomIdIndex);
-			sto.addGeometry(pol);
-		}
-		else if (geomRep==TeLINES)
-		{
-			TeLine2D lin;
-			flag = portal->fetchGeometry(lin, geomIdIndex);
-			sto.addGeometry(lin);
-		}
-		else if (geomRep == TePOINTS)
-		{
-			TePoint point;
-			flag = portal->fetchGeometry(point, geomIdIndex);
-			sto.addGeometry(point);
-		}
-		else if (geomRep == TeCELLS)
-		{
-			TeCell cell;
-			flag = portal->fetchGeometry(cell, geomIdIndex);
-			sto.addGeometry(cell);
-		}
-		else if (geomRep == TeTEXT)
-		{
-			TeText text;
-			flag = portal->fetchGeometry(text, geomIdIndex);
-			sto.addGeometry(text); 
-		}
-		else
-			flag = portal->fetchRow();
-
-		if(flag)
-		{
-			gId = atoi(portal->getData(geomIdIndex));
-			objId =  string(portal->getData(linkIndex)); 
-		}
-	}
-
-	return flag;
-}
-
-// Add geometries from portal to STO considering the time value
-bool
-addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeSTInstance& sto, const int& linkIndex, 
-			const int& geomIdIndex, TeTimeInterval time, const int& initTimeIndex, const int& finalTimeIndex) 
-{
-	bool flag=true;
-	map<int, int> geomIds;
-	TeTime t1 = time.getT1();
-	TeTime t2 = time.getT2();
-			
-	//verify if the portal has geometry (multi geometries)
-	
-	string geomId = string(portal->getData(geomIdIndex));
-	string objId =  string(portal->getData(linkIndex)); 
-	int	gId = atoi(geomId.c_str());
-	
-	//There are no geometries in the portal. This happens when
-	//the objects have multi geometries (ex.: obj 1 is line and obj 2 is ponit).
-	//The portal must point to the next object.
-	if(geomId.empty())
-	{
-		do
-		{
-			flag = portal->fetchRow();
-			objId = string(portal->getData(linkIndex));
-		} while ( flag && 
-			 (objId == sto.objectId()) &&
-			 (portal->getDate(initTimeIndex) == t1) && 
-			 (portal->getDate(finalTimeIndex) == t2) );
-		
-		return flag; 
-	}
-
-	//The portal points to other object. This happens when
-	//the objects have more than one geometrical representation and, at the same time, 
-	//the theme has an external table.
-	if(objId!=sto.objectId())
-	{
-		do
-		{
-			flag = portal->fetchRow();
-			objId = string(portal->getData(linkIndex));
-		} while(flag && (objId != sto.objectId()));
-		
-		gId = atoi(portal->getData(geomIdIndex));
-	}
-
-
-	//There are geometries
-	while(	flag && (objId == sto.objectId()) &&
-			(geomIds.find(gId) == geomIds.end()) && 
-			(portal->getDate(initTimeIndex) == t1) && 
-			(portal->getDate(finalTimeIndex) == t2) )
-	{
-		geomIds[gId] = gId;
-		if(geomRep == TePOLYGONS)
-		{
-			TePolygon pol;
-			flag = portal->fetchGeometry(pol, geomIdIndex);
-			sto.addGeometry(pol);
-		}
-		else if (geomRep==TeLINES)
-		{
-			TeLine2D lin;
-			flag = portal->fetchGeometry(lin, geomIdIndex);
-			sto.addGeometry(lin);
-		}
-		else if (geomRep == TePOINTS)
-		{
-			TePoint point;
-			flag = portal->fetchGeometry(point, geomIdIndex);
-			sto.addGeometry(point);
-		}
-		else if (geomRep == TeCELLS)
-		{
-			TeCell cell;
-			flag = portal->fetchGeometry(cell, geomIdIndex);
-			sto.addGeometry(cell);
-		}
-		else if (geomRep == TeTEXT)
-		{
-			TeText text;
-			flag = portal->fetchGeometry(text, geomIdIndex);
-			sto.addGeometry(text); 
-		}
-		else
-			flag = portal->fetchRow();
-
-		if(flag)
-		{
-			gId = atoi(portal->getData(geomIdIndex));
-			objId =  string(portal->getData(linkIndex)); 
-		}
-	}
-
-	return flag;
-}
-
-bool 
-addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeMultiGeometry& geometries) 
-{
-	bool flag = true;
-	//There are geometries
-	do
-	{
-		if(geomRep == TePOLYGONS)
-		{
-			TePolygon pol;
-			flag = portal->fetchGeometry(pol);
-			geometries.getPolygons().add(pol);
-		}
-		else if (geomRep==TeLINES)
-		{
-			TeLine2D lin;
-			flag = portal->fetchGeometry(lin);
-			geometries.getLines().add(lin);
-		}
-		else if (geomRep == TePOINTS)
-		{
-			TePoint point;
-			flag = portal->fetchGeometry(point);
-			geometries.getPoints().add(point);
-		}
-		else if (geomRep == TeCELLS)
-		{
-			TeCell cell;
-			flag = portal->fetchGeometry(cell);
-			geometries.getCells().add(cell);
-		}
-		else if (geomRep == TeTEXT)
-		{
-			TeText text;
-			flag = portal->fetchGeometry(text);
-			geometries.getTexts().add(text);
-		}
-		else
-			flag = portal->fetchRow();
-	}while(flag);
-	return flag;
-}
-
-TeQuerierDB::~TeQuerierDB() 
-{
-	for(unsigned int i=0; i<portals_.size(); ++i)
-		delete (portals_[i]);
-
-	portals_.clear();
-	geomRepr_.clear();
-}
-
-
-void
-TeQuerierDB::clearVectors()
-{
-	vector<TeDatabasePortal*>::iterator itPortal = portals_.begin();
-	while(itPortal!=portals_.end())
-	{		
-		TeDatabasePortal* portal = *itPortal;
-		delete portal; 
-		++itPortal;
-	}
-	
-	portals_.clear();
-	geomRepr_.clear();
-	flagPortal_ = false;
-}
-
-void 
-TeQuerierDB::clear()
-{
-	clearVectors();
-}
-
-TeGeomRep 
-TeQuerierDB::geometryRep() 
-{  return TeGeomRep(params_->theme()->layer()->geomRep()); }
-
-string 
-TeQuerierDB::sqlWhereRestrictions(TeRepresentation* rep)
-{
-	TeKeys objs;
-	string whereClause= " 1 = 1 ";
-	TeDatabase* db = params_->theme()->layer()->database();
-	if(!db)
-		return "";
-	
-	// load the first representation 
-	if(!rep)
-		rep = (params_->theme()->layer()->vectRepres())[0];
-
-	// spatial restriction with other geometry representation
-	if (params_->hasSpatialRes() && rep)
-	{
-		if(params_->boxRest().isValid())
-		{
-            TeBox b =  params_->boxRest();
-            TeGeomRep gRep = rep->geomRep_;
-			whereClause += " AND "+ db->getSQLBoxWhere(b, gRep);
-		}
-		else if(params_->geomRest())
-		{
-			string geomTableRest = params_->theme()->layer()->tableName(params_->geomRepRest());
-			TePrecision::instance().setPrecision(TeGetPrecision(params_->theme()->layer()->projection()));
-
-			if((db->spatialRelation(geomTableRest, params_->geomRepRest(), params_->geomRest(),  
-							   objs, params_->spatialRelation())) && (!objs.empty()))
-			{
-				string obs;
-				for(unsigned int i=0; i<objs.size(); i++)
-				{
-					if(i!=0)
-						obs += ",";
-					obs += "'"+ objs[i] +"'";
-				}
-				
-				whereClause += " AND "+ rep->tableName_ +".object_id IN ("+ obs +")";
-			}
-			else
-				whereClause += " AND 1 <> 1 "; // no geometry was found 
-
-		}
-	}
-
-	//selected objects
-	switch (params_->selectedObjs())
-	{
-		case TeAll:
-			break;
-		
-		case TeSelectedByPointing:
-			whereClause += " AND (grid_status = 1 OR grid_status = 3";
-			whereClause += " OR (grid_status IS NULL AND (c_object_status = 1 OR c_object_status = 3)))";
-			break;
-		
-		case TeNotSelectedByPointing:
-			whereClause += " AND (grid_status = 0 OR grid_status = 2";
-			whereClause += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
-			break;
-		
-		case TeSelectedByQuery:
-			whereClause += " AND (grid_status = 2 OR grid_status = 3";
-			whereClause += " OR (grid_status is null AND (c_object_status = 2 OR c_object_status = 3)))";
-			break;
-		
-		case TeNotSelectedByQuery:
-			whereClause += " AND (grid_status = 0 OR grid_status = 1";
-			whereClause += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 1)))";
-			break;
-	
-		case TeGrouped:
-			whereClause += " AND c_legend_id <> 0";
-			break;
-
-		case TeNotGrouped:
-			whereClause += " AND c_legend_id = 0";
-			break;
-
-		case TeSelectedByPointingAndQuery:
-			whereClause += " AND grid_status = 3";
-			whereClause += " OR (grid_status is null AND c_object_status = 3)";
-			break;
-
-		case TeSelectedByPointingOrQuery:
-			whereClause += " AND (grid_status = 1 OR grid_status = 2 OR grid_status = 3)";
-			whereClause += " OR  (grid_status is null AND (c_object_status = 3 OR c_object_status = 1 OR c_object_status = 2))";
-			break;	
-	}
-
-	return whereClause;
-}
-
-
-string 
-TeQuerierDB::sqlFrom(string geomTable)
-{
-	string fromPar = "";
-	string fromClause = "";
-	
-	//get collection tables 
-	string collAuxTable = params_->theme()->collectionAuxTable();
-	string collTable = params_->theme()->collectionTable();
-	
-	if(collAuxTable.empty() || collTable.empty())
-		return attrTable_.name();
-
-	if(attrTable_.name().empty())
-		return "";
-	
-	string uniqueIdName = attrTable_.name() +"."+ attrTable_.uniqueName(); 
-	string objectIdName = attrTable_.name() +"."+ attrTable_.linkName(); 
-	string linkName; 
-	if(attrTable_.tableType() != TeAttrExternal)
-		linkName = attrTable_.name() +"."+ attrTable_.linkName(); 
-	else
-		linkName = collTable +".c_object_id "; 
-
-	//load geometry table if there is spatial restriction
-	if(geomTable.empty() && params_->hasSpatialRes())
-	{
-		TeRepresentation* rep = (theme()->layer()->vectRepres())[0];
-		geomTable = theme()->layer()->tableName(rep->geomRep_);
-	}
-
-	//get the extern table position 
-	int posExtern = -1;
-	TeAttrTableVector attr = params_->theme()->attrTables();
-	for(unsigned int i=0; i<attr.size(); ++i)
-	{
-		if(attr[i].tableType() == TeAttrExternal)
-			++posExtern;
-	}
-	
-	//if the table is temporal   
-	if((attrTable_.tableType()==TeAttrEvent) || (attrTable_.tableType()==TeFixedGeomDynAttr))
-	{
-		fromPar += "((";
-		fromClause = attrTable_.name()+" RIGHT JOIN "+ collAuxTable; 
-				
-		if(attrTable_.tableType()==TeFixedGeomDynAttr)
-		{
-			fromClause += " ON "+ uniqueIdName +" = ";
-			fromClause += collAuxTable +".aux0";
-			fromClause += ")";
-		}
-		else
-		{
-			fromClause += " ON "+ objectIdName +" = ";
-			fromClause += collAuxTable +".object_id"+ ")";
-		}
-
-		fromClause += " LEFT JOIN "+ collTable; 
-		fromClause += " ON "+ collAuxTable +".object_id = "+ collTable +".c_object_id )";
-		
-		if(!geomTable.empty())
-		{
-			fromPar += "(";
-			fromClause += " LEFT JOIN "+ geomTable +" ON ";
-			fromClause += collAuxTable +".object_id = "+ geomTable +".object_id )";
-		}
-
-		if(params_->selectedObjs() != TeAll) //! join with collection table
-		{
-			fromPar += "(";
-			fromClause += " LEFT JOIN "+ collTable +" ON ";
-			fromClause += collAuxTable +".object_id = "+ collTable +".c_object_id )";
-		}
-	} 
-
-	else if (attrTable_.tableType()==TeAttrStatic)
-	{
-		fromPar += "(";
-		fromClause =  attrTable_.name()+" RIGHT JOIN "+ collTable; 
-		fromClause += " ON "+ linkName +" = "+ collTable +".c_object_id)";
-
-		if(!geomTable.empty()) //! join with geometry table
-		{
-			fromPar += "(";
-			fromClause += " LEFT JOIN "+ geomTable +" ON ";
-			fromClause += collTable +".c_object_id = "+ geomTable +".object_id )";
-		}
-
-		if(params_->selectedObjs() != TeAll) //! join with collection table
-		{
-			fromPar += "(";
-			fromClause += " LEFT JOIN "+ collAuxTable +" ON ";
-			fromClause += collTable +".c_object_id = "+ collAuxTable +".object_id )";
-		}
-	}
-	else if (attrTable_.tableType()==TeAttrExternal)
-	{
-		fromPar += "((";
-		fromClause = collAuxTable +" RIGHT JOIN "+ collTable; 
-		fromClause += " ON "+ collAuxTable +".object_id = "+ collTable +".c_object_id )";
-		fromClause += " LEFT JOIN "+ attrTable_.name() +" ON ";
-		fromClause +=  collAuxTable +".aux"+ Te2String(posExtern) +" = ";
-		fromClause +=  uniqueIdName +" )";
-
-		if(!geomTable.empty()) //! join with geometry table
-		{
-			fromPar += "(";
-			fromClause += " LEFT JOIN "+ geomTable +" ON ";
-			fromClause += collTable +".c_object_id = "+ geomTable +".object_id )";
-		} 
-	}
-		
-	return (fromPar+fromClause);
-}
-
-bool 
-TeQuerierDB::loadGeometries(TeMultiGeometry& geometries, unsigned int& index)
-{
-	if((portals_.size()<(index+1)) || (geomRepr_.size()<(index+1)))
-		return false;
-
-	TeDatabasePortal* portal = portals_[index]; 
-	TeRepresentation rep = geomRepr_[index];
-	if(!portal)
-		return false; 
-	
-	bool flag = addGeometry(portal, rep.geomRep_, geometries);
-
-	return flag;
-}
-
-bool 
-TeQuerierDB::loadGeometries(TeMultiGeometry& geometries) 
-{
-	bool flag = false;
-	
-	if(!params_->loadGeom())
-		return flag;
-	
-	for(unsigned int i=0; i<portals_.size(); ++i)
-		flag = loadGeometries(geometries, i);
-	
-	return flag;
-}
-
-
-
+
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeQuerierDB.h"
+#include "TeDatabase.h"
+#include "TeSTInstance.h"
+#include "TeTemporalSeries.h"
+
+// Add geometries from portal to STO 
+bool 
+addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeSTInstance& sto, const int& linkIndex, const int& geomIdIndex) 
+{
+	bool flag=true;
+	map<int, int> geomIds;
+		
+	//verify if the portal has geometry (multi geometries)
+	string geomId = string(portal->getData(geomIdIndex));
+	string objId =  string(portal->getData(linkIndex)); 
+	int	gId = atoi(geomId.c_str());
+	
+	//There are no geometries in the portal. This happens when
+	//the objects have multi geometries (ex.: obj 1 is line and obj 2 is ponit).
+	//The portal must point to the next object.
+	if(geomId.empty())
+	{
+		do
+		{
+			flag = portal->fetchRow();
+		} while(flag && (string(portal->getData(linkIndex)) == sto.objectId()));
+		
+		return flag; 
+	}
+
+	//The portal points to other object. This happens when
+	//the objects have more than one geometrical representation and, at the same time, 
+	//the theme has an external table.
+	if(objId!=sto.objectId())
+	{
+		do
+		{
+			flag = portal->fetchRow();
+			objId = string(portal->getData(linkIndex));
+		} while(flag && ( objId != sto.objectId()));
+		
+		gId = atoi(portal->getData(geomIdIndex));
+	}
+
+	//There are geometries
+	while(	flag && (objId == sto.objectId()) &&
+			(geomIds.find(gId) == geomIds.end()))
+	{
+		geomIds[gId] = gId;
+		if(geomRep == TePOLYGONS)
+		{
+			TePolygon pol;
+			flag = portal->fetchGeometry(pol, geomIdIndex);
+			sto.addGeometry(pol);
+		}
+		else if (geomRep==TeLINES)
+		{
+			TeLine2D lin;
+			flag = portal->fetchGeometry(lin, geomIdIndex);
+			sto.addGeometry(lin);
+		}
+		else if (geomRep == TePOINTS)
+		{
+			TePoint point;
+			flag = portal->fetchGeometry(point, geomIdIndex);
+			sto.addGeometry(point);
+		}
+		else if (geomRep == TeCELLS)
+		{
+			TeCell cell;
+			flag = portal->fetchGeometry(cell, geomIdIndex);
+			sto.addGeometry(cell);
+		}
+		else if (geomRep == TeTEXT)
+		{
+			TeText text;
+			flag = portal->fetchGeometry(text, geomIdIndex);
+			sto.addGeometry(text); 
+		}
+		else
+			flag = portal->fetchRow();
+
+		if(flag)
+		{
+			gId = atoi(portal->getData(geomIdIndex));
+			objId =  string(portal->getData(linkIndex)); 
+		}
+	}
+
+	return flag;
+}
+
+// Add geometries from portal to STO considering the time value
+bool
+addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeSTInstance& sto, const int& linkIndex, 
+			const int& geomIdIndex, TeTimeInterval time, const int& initTimeIndex, const int& finalTimeIndex) 
+{
+	bool flag=true;
+	map<int, int> geomIds;
+	TeTime t1 = time.getT1();
+	TeTime t2 = time.getT2();
+			
+	//verify if the portal has geometry (multi geometries)
+	
+	string geomId = string(portal->getData(geomIdIndex));
+	string objId =  string(portal->getData(linkIndex)); 
+	int	gId = atoi(geomId.c_str());
+	
+	//There are no geometries in the portal. This happens when
+	//the objects have multi geometries (ex.: obj 1 is line and obj 2 is ponit).
+	//The portal must point to the next object.
+	if(geomId.empty())
+	{
+		do
+		{
+			flag = portal->fetchRow();
+			objId = string(portal->getData(linkIndex));
+		} while ( flag && 
+			 (objId == sto.objectId()) &&
+			 (portal->getDate(initTimeIndex) == t1) && 
+			 (portal->getDate(finalTimeIndex) == t2) );
+		
+		return flag; 
+	}
+
+	//The portal points to other object. This happens when
+	//the objects have more than one geometrical representation and, at the same time, 
+	//the theme has an external table.
+	if(objId!=sto.objectId())
+	{
+		do
+		{
+			flag = portal->fetchRow();
+			objId = string(portal->getData(linkIndex));
+		} while(flag && (objId != sto.objectId()));
+		
+		gId = atoi(portal->getData(geomIdIndex));
+	}
+
+
+	//There are geometries
+	while(	flag && (objId == sto.objectId()) &&
+			(geomIds.find(gId) == geomIds.end()) && 
+			(portal->getDate(initTimeIndex) == t1) && 
+			(portal->getDate(finalTimeIndex) == t2) )
+	{
+		geomIds[gId] = gId;
+		if(geomRep == TePOLYGONS)
+		{
+			TePolygon pol;
+			flag = portal->fetchGeometry(pol, geomIdIndex);
+			sto.addGeometry(pol);
+		}
+		else if (geomRep==TeLINES)
+		{
+			TeLine2D lin;
+			flag = portal->fetchGeometry(lin, geomIdIndex);
+			sto.addGeometry(lin);
+		}
+		else if (geomRep == TePOINTS)
+		{
+			TePoint point;
+			flag = portal->fetchGeometry(point, geomIdIndex);
+			sto.addGeometry(point);
+		}
+		else if (geomRep == TeCELLS)
+		{
+			TeCell cell;
+			flag = portal->fetchGeometry(cell, geomIdIndex);
+			sto.addGeometry(cell);
+		}
+		else if (geomRep == TeTEXT)
+		{
+			TeText text;
+			flag = portal->fetchGeometry(text, geomIdIndex);
+			sto.addGeometry(text); 
+		}
+		else
+			flag = portal->fetchRow();
+
+		if(flag)
+		{
+			gId = atoi(portal->getData(geomIdIndex));
+			objId =  string(portal->getData(linkIndex)); 
+		}
+	}
+
+	return flag;
+}
+
+bool 
+addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeMultiGeometry& geometries) 
+{
+	bool flag = true;
+	//There are geometries
+	do
+	{
+		if(geomRep == TePOLYGONS)
+		{
+			TePolygon pol;
+			flag = portal->fetchGeometry(pol);
+			geometries.getPolygons().add(pol);
+		}
+		else if (geomRep==TeLINES)
+		{
+			TeLine2D lin;
+			flag = portal->fetchGeometry(lin);
+			geometries.getLines().add(lin);
+		}
+		else if (geomRep == TePOINTS)
+		{
+			TePoint point;
+			flag = portal->fetchGeometry(point);
+			geometries.getPoints().add(point);
+		}
+		else if (geomRep == TeCELLS)
+		{
+			TeCell cell;
+			flag = portal->fetchGeometry(cell);
+			geometries.getCells().add(cell);
+		}
+		else if (geomRep == TeTEXT)
+		{
+			TeText text;
+			flag = portal->fetchGeometry(text);
+			geometries.getTexts().add(text);
+		}
+		else
+			flag = portal->fetchRow();
+	}while(flag);
+	return flag;
+}
+
+TeQuerierDB::~TeQuerierDB() 
+{
+	for(unsigned int i=0; i<portals_.size(); ++i)
+		delete (portals_[i]);
+
+	portals_.clear();
+	geomRepr_.clear();
+}
+
+
+void
+TeQuerierDB::clearVectors()
+{
+	vector<TeDatabasePortal*>::iterator itPortal = portals_.begin();
+	while(itPortal!=portals_.end())
+	{		
+		TeDatabasePortal* portal = *itPortal;
+		delete portal; 
+		++itPortal;
+	}
+	
+	portals_.clear();
+	geomRepr_.clear();
+	flagPortal_ = false;
+}
+
+void 
+TeQuerierDB::clear()
+{
+	clearVectors();
+}
+
+TeGeomRep 
+TeQuerierDB::geometryRep() 
+{  return TeGeomRep(params_->theme()->layer()->geomRep()); }
+
+string 
+TeQuerierDB::sqlWhereRestrictions(TeRepresentation* rep)
+{
+	TeKeys objs;
+	string whereClause= " 1 = 1 ";
+	TeDatabase* db = params_->theme()->layer()->database();
+	if(!db)
+		return "";
+	
+	// load the first representation 
+	if(!rep)
+		rep = (params_->theme()->layer()->vectRepres())[0];
+
+	// spatial restriction with other geometry representation
+	if (params_->hasSpatialRes() && rep)
+	{
+		if(params_->boxRest().isValid())
+		{
+            TeBox b =  params_->boxRest();
+            TeGeomRep gRep = rep->geomRep_;
+			string geomTableRest = params_->theme()->layer()->tableName(params_->geomRepRest());
+			whereClause += " AND "+ db->getSQLBoxWhere(b, gRep, geomTableRest);
+		}
+		else if(params_->geomRest())
+		{
+			string geomTableRest = params_->theme()->layer()->tableName(params_->geomRepRest());
+			TePrecision::instance().setPrecision(TeGetPrecision(params_->theme()->layer()->projection()));
+
+			if((db->spatialRelation(geomTableRest, params_->geomRepRest(), params_->geomRest(),  
+							   objs, params_->spatialRelation())) && (!objs.empty()))
+			{
+				string obs;
+				for(unsigned int i=0; i<objs.size(); i++)
+				{
+					if(i!=0)
+						obs += ",";
+					obs += "'"+ objs[i] +"'";
+				}
+				
+				whereClause += " AND "+ rep->tableName_ +".object_id IN ("+ obs +")";
+			}
+			else
+				whereClause += " AND 1 <> 1 "; // no geometry was found 
+
+		}
+	}
+
+	//selected objects
+	switch (params_->selectedObjs())
+	{
+		case TeAll:
+			break;
+		
+		case TeSelectedByPointing:
+			whereClause += " AND (grid_status = 1 OR grid_status = 3";
+			whereClause += " OR (grid_status IS NULL AND (c_object_status = 1 OR c_object_status = 3)))";
+			break;
+		
+		case TeNotSelectedByPointing:
+			whereClause += " AND (grid_status = 0 OR grid_status = 2";
+			whereClause += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
+			break;
+		
+		case TeSelectedByQuery:
+			whereClause += " AND (grid_status = 2 OR grid_status = 3";
+			whereClause += " OR (grid_status is null AND (c_object_status = 2 OR c_object_status = 3)))";
+			break;
+		
+		case TeNotSelectedByQuery:
+			whereClause += " AND (grid_status = 0 OR grid_status = 1";
+			whereClause += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 1)))";
+			break;
+	
+		case TeGrouped:
+			whereClause += " AND c_legend_id <> 0";
+			break;
+
+		case TeNotGrouped:
+			whereClause += " AND c_legend_id = 0";
+			break;
+
+		case TeSelectedByPointingAndQuery:
+			whereClause += " AND grid_status = 3";
+			whereClause += " OR (grid_status is null AND c_object_status = 3)";
+			break;
+
+		case TeSelectedByPointingOrQuery:
+			whereClause += " AND (grid_status = 1 OR grid_status = 2 OR grid_status = 3)";
+			whereClause += " OR  (grid_status is null AND (c_object_status = 3 OR c_object_status = 1 OR c_object_status = 2))";
+			break;	
+	}
+
+	return whereClause;
+}
+
+
+string 
+TeQuerierDB::sqlFrom(string geomTable)
+{
+	string fromPar = "";
+	string fromClause = "";
+	
+	//get collection tables 
+	string collAuxTable = params_->theme()->collectionAuxTable();
+	string collTable = params_->theme()->collectionTable();
+	
+	if(collAuxTable.empty() || collTable.empty())
+		return attrTable_.name();
+
+	if(attrTable_.name().empty())
+		return "";
+	
+	string uniqueIdName = attrTable_.name() +"."+ attrTable_.uniqueName(); 
+	string objectIdName = attrTable_.name() +"."+ attrTable_.linkName(); 
+	string linkName; 
+	if(attrTable_.tableType() != TeAttrExternal)
+		linkName = attrTable_.name() +"."+ attrTable_.linkName(); 
+	else
+		linkName = collTable +".c_object_id "; 
+
+	//load geometry table if there is spatial restriction
+	if(geomTable.empty() && params_->hasSpatialRes())
+	{
+		TeRepresentation* rep = (theme()->layer()->vectRepres())[0];
+		geomTable = theme()->layer()->tableName(rep->geomRep_);
+	}
+
+	//get the extern table position 
+	int posExtern = -1;
+	TeAttrTableVector attr = params_->theme()->attrTables();
+	for(unsigned int i=0; i<attr.size(); ++i)
+	{
+		if(attr[i].tableType() == TeAttrExternal)
+			++posExtern;
+	}
+	
+	//if the table is temporal   
+	if((attrTable_.tableType()==TeAttrEvent) || (attrTable_.tableType()==TeFixedGeomDynAttr))
+	{
+		fromPar += "((";
+		fromClause = attrTable_.name()+" RIGHT JOIN "+ collAuxTable; 
+				
+		if(attrTable_.tableType()==TeFixedGeomDynAttr)
+		{
+			fromClause += " ON "+ uniqueIdName +" = ";
+			fromClause += collAuxTable +".aux0";
+			fromClause += ")";
+		}
+		else
+		{
+			fromClause += " ON "+ objectIdName +" = ";
+			fromClause += collAuxTable +".object_id"+ ")";
+		}
+
+		fromClause += " LEFT JOIN "+ collTable; 
+		fromClause += " ON "+ collAuxTable +".object_id = "+ collTable +".c_object_id )";
+		
+		if(!geomTable.empty())
+		{
+			fromPar += "(";
+			fromClause += " LEFT JOIN "+ geomTable +" ON ";
+			fromClause += collAuxTable +".object_id = "+ geomTable +".object_id )";
+		}
+
+		if(params_->selectedObjs() != TeAll) //! join with collection table
+		{
+			fromPar += "(";
+			fromClause += " LEFT JOIN "+ collTable +" ON ";
+			fromClause += collAuxTable +".object_id = "+ collTable +".c_object_id )";
+		}
+	} 
+
+	else if (attrTable_.tableType()==TeAttrStatic)
+	{
+		fromPar += "(";
+		fromClause =  attrTable_.name()+" RIGHT JOIN "+ collTable; 
+		fromClause += " ON "+ linkName +" = "+ collTable +".c_object_id)";
+
+		if(!geomTable.empty()) //! join with geometry table
+		{
+			fromPar += "(";
+			fromClause += " LEFT JOIN "+ geomTable +" ON ";
+			fromClause += collTable +".c_object_id = "+ geomTable +".object_id )";
+		}
+
+		if(params_->selectedObjs() != TeAll) //! join with collection table
+		{
+			fromPar += "(";
+			fromClause += " LEFT JOIN "+ collAuxTable +" ON ";
+			fromClause += collTable +".c_object_id = "+ collAuxTable +".object_id )";
+		}
+	}
+	else if (attrTable_.tableType()==TeAttrExternal)
+	{
+		fromPar += "((";
+		fromClause = collAuxTable +" RIGHT JOIN "+ collTable; 
+		fromClause += " ON "+ collAuxTable +".object_id = "+ collTable +".c_object_id )";
+		fromClause += " LEFT JOIN "+ attrTable_.name() +" ON ";
+		fromClause +=  collAuxTable +".aux"+ Te2String(posExtern) +" = ";
+		fromClause +=  uniqueIdName +" )";
+
+		if(!geomTable.empty()) //! join with geometry table
+		{
+			fromPar += "(";
+			fromClause += " LEFT JOIN "+ geomTable +" ON ";
+			fromClause += collTable +".c_object_id = "+ geomTable +".object_id )";
+		} 
+	}
+		
+	return (fromPar+fromClause);
+}
+
+bool 
+TeQuerierDB::loadGeometries(TeMultiGeometry& geometries, unsigned int& index)
+{
+	if((portals_.size()<(index+1)) || (geomRepr_.size()<(index+1)))
+		return false;
+
+	TeDatabasePortal* portal = portals_[index]; 
+	TeRepresentation rep = geomRepr_[index];
+	if(!portal)
+		return false; 
+	
+	bool flag = addGeometry(portal, rep.geomRep_, geometries);
+
+	return flag;
+}
+
+bool 
+TeQuerierDB::loadGeometries(TeMultiGeometry& geometries) 
+{
+	bool flag = false;
+	
+	if(!params_->loadGeom())
+		return flag;
+	
+	for(unsigned int i=0; i<portals_.size(); ++i)
+		flag = loadGeometries(geometries, i);
+	
+	return flag;
+}
+
+
+
diff --git a/src/terralib/kernel/TeQuerierDB.h b/src/terralib/kernel/TeQuerierDB.h
old mode 100755
new mode 100644
index d00d016..3770f5e
--- a/src/terralib/kernel/TeQuerierDB.h
+++ b/src/terralib/kernel/TeQuerierDB.h
@@ -1,122 +1,122 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeQuerierDB.h
-	\brief This file deals with strategies to retrieve spatio-temporal elements from a TerraLib database
-*/
-#ifndef  __TERRALIB_INTERNAL_QUERIER_DB_H
-#define  __TERRALIB_INTERNAL_QUERIER_DB_H
-
-#include "TeQuerierImpl.h"
-#include "TeRepresentation.h"
-
-class TeDatabasePortal;
-class TeTimeInterval;
-class TeTSEntry;
-
-//! auxiliary functions to add geometries in the TeSTInstance or TeMultiGeometry
-TL_DLL bool addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeSTInstance& sto, const int& linkIndex, const int& gIdIndex);
-TL_DLL bool addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeSTInstance& sto, const int& linkIndex, 
-			const int& geomIdIndex, TeTimeInterval time, const int& initTimeIndex, const int& finalTimeIndex); 
-TL_DLL bool addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeMultiGeometry& geometries); 
-
-
-//! An abstract class to build STOs (Spatial Temporal Objects) from a TerraLib database 
-class TL_DLL TeQuerierDB : public TeQuerierImpl
-{
-protected:
-	//! a portal to each geometry representation
-	vector<TeDatabasePortal*>	portals_;		
-	//! keep the geometry representation of each portal 
-	vector<TeRepresentation>	geomRepr_;	
-	//! internal information used to fill the stos
-	TeTable						attrTable_;	
-	//! flag to control the portal
-	bool						flagPortal_;	 
-	
-	//! map FROM each portal in the vector "portals_" TO the indexes of the unique attributes
-	map<int, vector<int> >		uniqueIndex_; 
-	
-	//! index of the link attributes in each portal in the vector "portals_"
-	vector<int>		linkIndex_;
-
-	//! index in the first portal of the first attribute
-	int				attrIndex1_;
-	//! index in the first portal of the last attribute
-	int				attrIndex2_;
-	//! index in the first portal of the group, if there is collection table
-	int				groupIndex_;
-	//! index where the geometry information begin in each portal in the vector "portals_"
-	vector<int>				geomIndex1_;
-	//! index where the geometry information finish in each portal in the vector "portals_"
-	vector<int>				geomIndex2_;
-	//! index of the initial time in each portal in the vector "portals_"  
-	vector<int>				timeIndex1_;
-	//! index of the final time in each portal in the vector "portals_"  
-	vector<int>				timeIndex2_;
-
-	//! map from legend identifier to group number  
-	map<int, int>			legendIdGroup_;
-			
-	//! clear internal vectors
-	void clearVectors(); 
-
-	//! Return a where clause in SQL that represent the querier restrictions
-	virtual string sqlWhereRestrictions(TeRepresentation* rep=0);
-
-	//! Build the sql from clause
-	string sqlFrom(string geomTable="");
-
-public:	
-	//! Constructor
-	TeQuerierDB(TeQuerierParams* params): TeQuerierImpl(params), flagPortal_(false) 
-	{}
-	
-	//! Destructor 
-	virtual ~TeQuerierDB();  
-	
-	//! Returns the pointer to the theme 
-	TeTheme* theme() {	return params_->theme();	}
-
-	//! Returns the pointer to the layer 
-	TeLayer* layer() {	return  params_->theme()->layer(); }
-
-	//! Returns the geometry representation of the theme
-	TeGeomRep geometryRep();
-
-	//! Loads the STOs from database
-	virtual bool loadInstances(TeTSEntry* ent=0) = 0;  
-	
-	//! Returns each loaded STO
-	virtual bool fetchInstance(TeSTInstance& stoi) = 0; 
-
-	//! Loads all geometries of the index-th geometry representation  
-	virtual bool loadGeometries(TeMultiGeometry& geometries, unsigned int& index); 
-
-	//! Loads all geometries 
-	virtual bool loadGeometries(TeMultiGeometry& geometries);
-	
-	//! Empties querier instances
-	void clear(); 
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeQuerierDB.h
+	\brief This file deals with strategies to retrieve spatio-temporal elements from a TerraLib database
+*/
+#ifndef  __TERRALIB_INTERNAL_QUERIER_DB_H
+#define  __TERRALIB_INTERNAL_QUERIER_DB_H
+
+#include "TeQuerierImpl.h"
+#include "TeRepresentation.h"
+
+class TeDatabasePortal;
+class TeTimeInterval;
+class TeTSEntry;
+
+//! auxiliary functions to add geometries in the TeSTInstance or TeMultiGeometry
+TL_DLL bool addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeSTInstance& sto, const int& linkIndex, const int& gIdIndex);
+TL_DLL bool addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeSTInstance& sto, const int& linkIndex, 
+			const int& geomIdIndex, TeTimeInterval time, const int& initTimeIndex, const int& finalTimeIndex); 
+TL_DLL bool addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeMultiGeometry& geometries); 
+
+
+//! An abstract class to build STOs (Spatial Temporal Objects) from a TerraLib database 
+class TL_DLL TeQuerierDB : public TeQuerierImpl
+{
+protected:
+	//! a portal to each geometry representation
+	vector<TeDatabasePortal*>	portals_;		
+	//! keep the geometry representation of each portal 
+	vector<TeRepresentation>	geomRepr_;	
+	//! internal information used to fill the stos
+	TeTable						attrTable_;	
+	//! flag to control the portal
+	bool						flagPortal_;	 
+	
+	//! map FROM each portal in the vector "portals_" TO the indexes of the unique attributes
+	map<int, vector<int> >		uniqueIndex_; 
+	
+	//! index of the link attributes in each portal in the vector "portals_"
+	vector<int>		linkIndex_;
+
+	//! index in the first portal of the first attribute
+	int				attrIndex1_;
+	//! index in the first portal of the last attribute
+	int				attrIndex2_;
+	//! index in the first portal of the group, if there is collection table
+	int				groupIndex_;
+	//! index where the geometry information begin in each portal in the vector "portals_"
+	vector<int>				geomIndex1_;
+	//! index where the geometry information finish in each portal in the vector "portals_"
+	vector<int>				geomIndex2_;
+	//! index of the initial time in each portal in the vector "portals_"  
+	vector<int>				timeIndex1_;
+	//! index of the final time in each portal in the vector "portals_"  
+	vector<int>				timeIndex2_;
+
+	//! map from legend identifier to group number  
+	map<int, int>			legendIdGroup_;
+			
+	//! clear internal vectors
+	void clearVectors(); 
+
+	//! Return a where clause in SQL that represent the querier restrictions
+	virtual string sqlWhereRestrictions(TeRepresentation* rep=0);
+
+	//! Build the sql from clause
+	string sqlFrom(string geomTable="");
+
+public:	
+	//! Constructor
+	TeQuerierDB(TeQuerierParams* params): TeQuerierImpl(params), flagPortal_(false) 
+	{}
+	
+	//! Destructor 
+	virtual ~TeQuerierDB();  
+	
+	//! Returns the pointer to the theme 
+	TeTheme* theme() {	return params_->theme();	}
+
+	//! Returns the pointer to the layer 
+	TeLayer* layer() {	return  params_->theme()->layer(); }
+
+	//! Returns the geometry representation of the theme
+	TeGeomRep geometryRep();
+
+	//! Loads the STOs from database
+	virtual bool loadInstances(TeTSEntry* ent=0) = 0;  
+	
+	//! Returns each loaded STO
+	virtual bool fetchInstance(TeSTInstance& stoi) = 0; 
+
+	//! Loads all geometries of the index-th geometry representation  
+	virtual bool loadGeometries(TeMultiGeometry& geometries, unsigned int& index); 
+
+	//! Loads all geometries 
+	virtual bool loadGeometries(TeMultiGeometry& geometries);
+	
+	//! Empties querier instances
+	void clear(); 
+};
+
+#endif
diff --git a/src/terralib/kernel/TeQuerierDBStr1.cpp b/src/terralib/kernel/TeQuerierDBStr1.cpp
old mode 100755
new mode 100644
index 56cfbfb..a45ae28
--- a/src/terralib/kernel/TeQuerierDBStr1.cpp
+++ b/src/terralib/kernel/TeQuerierDBStr1.cpp
@@ -1,1176 +1,1181 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeQuerierDBStr1.h"
-#include "TeDatabase.h"
-#include "TeTemporalSeries.h"
-#include "TeSTInstance.h"
-
-bool 
-TeQuerierDBStr1::initPortal(TeRepresentation& rep, TeTSEntry* ent)
-{
-	string selectClause, fromClause, whereClause, orderByClause, groupByClause, parClause;
-	
-	//Init portal indexes
-	isGroup_ = false;
-	uniqueIndex_.clear();
-	vector<int> indexesAux;
-	linkIndex_.clear();
-	linkIndex_.push_back(-1); 
-	attrIndex1_=-1;
-	attrIndex2_=-1;
-	groupIndex_=-1;
-	
-	geomIndex1_.clear();
-	geomIndex1_.push_back(-1);
-	geomIndex2_.clear();
-	geomIndex2_.push_back(-1);
-	timeIndex1_.clear();
-	timeIndex1_.push_back(-1);
-	timeIndex2_.clear();
-	timeIndex2_.push_back(-1);
-
-	//all vectors contains attributes with the table name and in upper case
-	vector<string>	attrs_select;	//contains the attributes that will be used to fill the TeSTInstance
-	vector<string>	geoms_select;	//contains the geometry attributes 
-	vector<string>	times_select;	//contains the date time attributes, when they are not in the attrs_select
-	vector<string>	unique_select;	//contains the unique attributes, when they are not in the attrs_select
-	
-	//------------------------------------------- begin get information
-	//get database
-	TeDatabase* db = params_->theme()->layer()->database();
-
-	//get attribute tables
-	TeAttrTableVector atts; 
-	params_->theme()->getAttTables(atts); 
-	
-	//verify if will be group the objects	
-	TeGroupingAttr groups = params_->groupAttr();  
-	bool groupAttr = !(groups.empty());
-		
-	//verify if the theme has collection table
-	bool hasCollTable = false;
-	legendIdGroup_.clear();
-	legendIdGroup_[0]=0;
-	if(db->tableExist(params_->theme()->collectionAuxTable()))
-	{
-		TeLegendEntryVector& legVec = params_->theme()->legend();
-		for(unsigned int l=0; l<legVec.size(); ++l)
-			legendIdGroup_[legVec[l].id()]=legVec[l].group();
-		hasCollTable = true;
-	}
-		
-	clearVectors();
-	params_->setLoadAttrs(params_->loadSetedAttrs()); //the original data
-	
-	//get the link name - the first attribute table or geometry table
-	linkName_ = rep.tableName_ +".object_id"; 
-	if(atts.size() > 0)
-		linkName_ = atts[0].name() +"."+ atts[0].linkName(); 
-			
-	if(params_->loadGeom())
-		geomRepr_.push_back(rep);
-	
-	//------------------------------------------- end get information
-	
-	//------------------------------------------- begin information to mount SQL
-	// -------- from
-	bool fromNeedGeomTable = false;
-	bool fromNeedCollTable = false;
-	
-	if(params_->loadGeom() || params_->hasSpatialRes() || atts.empty())
-		fromNeedGeomTable = true;
-	if(hasCollTable)
-		fromNeedCollTable = true;
-
-	// -------- group and order by 
-	bool useGroupByClause = false;	//group by object_id
-	bool useOrderByClause = false;  //order by object_id, geom_id
-	//Use group by clause when 
-	//1)it must group the attributes and 
-	//2)it must not load geometry and 
-	//3)all statistic functions exist in the SGBD 
-	string sGroup="";
-	if(groupAttr)
-	{
-		if(params_->loadGeom())
-			useGroupByClause = false; 
-		else
-		{
-			sGroup = db->getSQLStatistics(groups);
-			isGroup_ = true;
-			TeGroupingAttr::iterator it = groups.begin();
-			while(it!= groups.end())
-			{
-				if(it->second != TeNOSTATISTIC)
-					isGroup_ = false;
-				++it;
-			}
-			if(isGroup_)
-				useGroupByClause = true; 
-		}
-		groupInMemory_ = !useGroupByClause;
-	}
-	else
-		useOrderByClause = true;
-
-	// -------- select
-	bool selectNeedGeom = false;
-	if(params_->loadGeom())
-		selectNeedGeom = true;
-	
-	//------------------------------------------- end information to mount SQL
-	
-	//------------------------------------------- begin mount SQL
-	// order and group by clause
-	orderByClause = " ORDER BY "+ linkName_; 
-	if(selectNeedGeom)
-		orderByClause += ", "+ rep.tableName_ +".geom_id";
-	groupByClause = " GROUP BY "+ linkName_;
-
-	// ------------- select clause
-	if(groupAttr)
-	{
-		if(!groupInMemory_) //use statistic function database
-		{
-			bool flag = true;
-			string auxS = sGroup;
-			while(flag)
-			{
-				size_t pos = auxS.find(",", 0, 1);
-				if (pos == string::npos)
-				{
-					attrs_select.push_back(auxS);
-					flag = false;
-				}
-				else
-				{
-					attrs_select.push_back(auxS.substr(0, pos));
-					auxS = auxS.substr(pos+1);
-				}
-			}
-		}
-		else //load the attributes from TeGroupingAttr
-		{
-			//fill select clause from set of attributes
-			string lastAttr = "";
-			TeGroupingAttr::iterator it = groups.begin(); 
-			while(it!= groups.end())
-			{
-				if(lastAttr != it->first.name_) 
-					attrs_select.push_back(it->first.name_);
-				lastAttr = it->first.name_;
-				++it;
-			}
-
-			// select datatime information
-			if(!attrTable_.name().empty())
-			{
-				times_select.push_back(attrTable_.name()+"."+attrTable_.attInitialTime());
-
-				if(attrTable_.attInitialTime()!=attrTable_.attFinalTime())
-					times_select.push_back(attrTable_.name()+"."+attrTable_.attFinalTime());
-			}
-		}
-	}
-	else // load all attributes or the attributes that are in the vector
-	{
-		// get some information about the attribute tables required
-		for(unsigned int i=0; i<atts.size(); i++)
-		{
-			//date time information
-			if((atts[i].tableType()==TeAttrEvent) || (atts[i].tableType()==TeFixedGeomDynAttr))
-			{
-				attrTable_ = atts[i]; 
-				times_select.push_back(atts[i].name()+"."+attrTable_.attInitialTime());
-				times_select.push_back(atts[i].name()+"."+attrTable_.attFinalTime());
-			}
-		
-			//unique information
-			unique_select.push_back(atts[i].name()+"."+atts[i].uniqueName());
-			indexesAux.push_back(-1);
-						
-			//fill vector of attributes and sql string with all attributes
-			if(params_->loadAllAttr())
-			{
-				TeAttributeList::iterator itAttr = atts[i].attributeList().begin();
-				while(itAttr!= atts[i].attributeList().end())
-				{
-					string attribute = atts[i].name() +"."+ (*itAttr).rep_.name_;
-					attrs_select.push_back(attribute);
-                    ++itAttr;
-				}
-			}
-		}
-
-		if(!params_->loadAllAttr())
-		{
-			vector<string>::iterator itVec = params_->loadAttrs().begin();
-			while(itVec!=params_->loadAttrs().end())
-			{
-				//insert in select clause itVec: deve estar no formato tableName.attrName
-				attrs_select.push_back (*itVec);
-				++itVec;
-			}
-		}
-	}
-	
-	if(selectNeedGeom)
-	{
-		TeAttributeList attrs;
-		if (!db->getAttributeList(rep.tableName_, attrs))
-			return false; 
-
-		for(unsigned int i=0; i<attrs.size(); ++i)
-			geoms_select.push_back(rep.tableName_+"."+ attrs[i].rep_.name_);
-		
-		// order by clause
-		if((rep.geomRep_ == TePOLYGONS) && (db->dbmsName() != "OracleSpatial") && (db->dbmsName() != "PostGIS") )
-			orderByClause += ", parent_id ASC, num_holes DESC";
-	}
-	
-	// ------------- from and where clause
-	if(!fromNeedCollTable)
-	{
-		if(fromNeedGeomTable)
-			fromClause = " FROM " + tableJoin(atts, rep.tableName_, "object_id");
-		else
-			fromClause = " FROM " + tableJoin(atts);
-		
-		//if the theme does not have collection, it must apply its restrictions (attribute, temporal and spatial)
-		whereClause = params_->theme()->sqlWhereRestrictions(&rep); 
-	}
-	else
-	{
-		if(fromNeedGeomTable)
-			fromClause = params_->theme()->sqlGridFrom(rep.tableName_);
-		else
-			fromClause = params_->theme()->sqlGridFrom();
-	}
-
-	if(ent)
-	{
-		if(attrTable_.name().empty())
-			params_->theme()->getTemporalTable(attrTable_);
-
-		string iniTime = attrTable_.name()+"."+attrTable_.attInitialTime(); 
-		string finTime = attrTable_.name()+"."+attrTable_.attFinalTime(); 
-		if(!whereClause.empty())
-			whereClause += " AND ";
-
-		if ((params_->chronon()==TeMONTHOFYEAR) || (params_->chronon()==TeDAYOFWEEK))
-			whereClause += db->getSQLTemporalWhere(ent->timeInt_, ent->timeInt_, params_->chronon(), TeTIMEDURING, iniTime, finTime);    
-		else
-		{
-			TeTimeInterval interval = ent->time_;
-			interval.intervalChronon(params_->chronon());
-
-			whereClause += db->getSQLTemporalWhere(interval, TeTIMEDURING, iniTime, finTime);
-		}
-	}
-
-	if(!objectId().empty())
-	{
-		if(!whereClause.empty())
-			whereClause += " AND ";
-		
-		whereClause += linkName_ +" = '"+ objectId() +"'";  
-	}
-
-	//---------- mount select clause and get the indexes
-	unsigned int index=0;
-	unsigned int count=0;
-	selectClause = "";
-	uniqueIndex_[0] = indexesAux;
-	
-	//this attribute list can contain datetime, link and unique information
-	attrIndex1_ = count;
-	for(index=0; index<attrs_select.size(); ++index)
-	{
-		if(!selectClause.empty())
-			selectClause += ", ";
-		selectClause += attrs_select[index];
-		//link index
-		if(TeConvertToUpperCase(linkName_)==TeConvertToUpperCase(attrs_select[index]))
-			linkIndex_[0] = count;
-		//unique index
-		for(unsigned int i=0; i<unique_select.size(); ++i)
-		{
-			if(TeConvertToUpperCase(unique_select[i])==TeConvertToUpperCase(attrs_select[index]))
-				uniqueIndex_[0][i] = count;
-		}
-		
-		//time index
-		for(unsigned int i=0; i<times_select.size(); ++i)
-		{
-			if(TeConvertToUpperCase(times_select[i])==TeConvertToUpperCase(attrs_select[index]))
-			{
-				if(i==0)
-					timeIndex1_[0] = count;
-				else
-					timeIndex2_[0] = count;
-			}
-		}
-		if(timeIndex1_[0]>=0 && timeIndex2_[0]<0)
-			timeIndex2_[0] = timeIndex1_[0];
-		
-		attrIndex2_ = count;
-		++count;
-	}
-
-	//link attribute
-	if(linkIndex_[0]<0)
-	{
-		if(!selectClause.empty())
-			selectClause += ", ";
-		selectClause += linkName_;
-		linkIndex_[0] = count;
-		++count;
-	}
-	
-	//unique attributes
-	for(index=0; index<unique_select.size(); ++index)
-	{
-		if(uniqueIndex_[0][index]<0)
-		{
-			//verify if the unique name is equal to link name
-			if(TeConvertToUpperCase(unique_select[index]) == TeConvertToUpperCase(linkName_))
-				uniqueIndex_[0][index] = linkIndex_[0];
-			else
-			{
-				//adds the unique attributes that were not added
-				if(!selectClause.empty())
-					selectClause += ", ";
-				selectClause += unique_select[index];
-				uniqueIndex_[0][index] = count; 
-				++count;
-			}
-		}
-	}
-
-	//group index
-	if(hasCollTable)
-	{
-		if(!selectClause.empty())
-			selectClause += ", ";
-		if(useGroupByClause)
-			selectClause += " MIN("+ params_->theme()->collectionTable()+".c_legend_id )";
-		else
-			selectClause += params_->theme()->collectionTable()+".c_legend_id";
-			
-		groupIndex_ = count;
-		++count;
-	}
-
-	//time attributes
-	if(timeIndex1_[0]<0 && (!times_select.empty()))
-	{
-		timeIndex1_[0] = count;
-		for(index=0; index<times_select.size(); ++index)
-		{
-			if(!selectClause.empty())
-				selectClause += ", ";
-			selectClause += times_select[index];
-			timeIndex2_[0] = count;
-			++count;
-		}
-	}
-
-	//geometries
-	if(!geoms_select.empty())
-		geomIndex1_[0] = count;
-	for(index=0; index<geoms_select.size(); ++index)
-	{
-		if(!selectClause.empty())
-			selectClause += ", ";
-		selectClause += geoms_select[index];
-		geomIndex2_[0] = count;
-		++count;
-	}
-	
-	//---------- querier restriction
-	string sqlQuerierRest = sqlWhereRestrictions(&rep);
-	if(!whereClause.empty())
-		whereClause += " AND ";
-
-	whereClause += sqlQuerierRest;
-
-	fromClause_ = fromClause;
-	whereClause_ = whereClause;
-    string sql = "SELECT "+ selectClause + fromClause;
-	if(!whereClause.empty())
-		sql += " WHERE "+ whereClause;
-	
-	if(useGroupByClause)
-		sql += " "+ groupByClause;
-	else
-		sql += " "+ orderByClause;
-	
-	//------------------------------------------- end mount SQL
-
-	// --------- Submit the query
-	portals_.clear();
-	TeDatabasePortal* portal = db->getPortal();
-	
-	if(!portal)
-		return false;
-	
-	if(!portal->query(sql))
-	{
-		delete (portal);
-		flagPortal_ = false;
-		return false;
-	}
-
-	if(!portal->fetchRow())
-	{
-		delete (portal);
-		flagPortal_ = false;
-		return false;
-	}
-
-	string id = portal->getData(linkIndex_[0]);
-	bool flag = true;
-	while(id.empty() && flag) 
-	{
-		flag = portal->fetchRow();
-		if(flag)
-			id = portal->getData(0); //object_Id
-	}
-	
-	if(id.empty() || (!flag))
-	{
-		delete (portal);
-		flagPortal_ = false;
-		return false;
-	}
-
-	portals_.push_back (portal);
-	flagPortal_ = true;
-	lastObjId_ ="";
-	return true;
-}
-
-bool 
-TeQuerierDBStr1::initGeomPortal(TeRepresentation& rep, TeTSEntry* ent)
-{
-	string selectClause, fromClause, whereClause, orderByClause, parClause;
-	string initialTime, finalTime;
-	string uniqueName;
-	vector<int> indexesAux;
-	linkIndex_.push_back(-1); 
-	geomIndex1_.push_back(-1);
-	geomIndex2_.push_back(-1);
-	timeIndex1_.push_back(-1);
-	timeIndex2_.push_back(-1);
-	
-	TeDatabase* db = params_->theme()->layer()->database();
-
-	//------- Get geometry table
-	geomRepr_.push_back(rep);
-	if(rep.tableName_.empty())
-		return false;
-
-	int ind = linkIndex_.size()-1; //the last position in the vectors
-	
-	selectClause = linkName_; 
-	orderByClause = " ORDER BY "+ linkName_;  
-	linkIndex_[ind] = 0;
-	
-	if((rep.geomRep_ == TePOLYGONS) && (db->dbmsName() != "OracleSpatial") && (db->dbmsName() != "PostGIS") )
-		orderByClause += " , parent_id ASC, num_holes DESC";
-	
-	//------- Get temporal attribute 
-	if(!attrTable_.name().empty())
-	{
-		initialTime = attrTable_.name() +"."+ attrTable_.attInitialTime ();
-		finalTime = attrTable_.name() +"."+ attrTable_.attFinalTime ();
-			
-		// fill vector of unique name 
-		uniqueName = attrTable_.name()+"."+attrTable_.uniqueName();
-								
-		selectClause += ", "+ uniqueName;
-		indexesAux.push_back(1);
-		selectClause += ", "+ initialTime;
-		timeIndex1_[ind] = 2;
-		timeIndex2_[ind] = 2;
-
-		if (initialTime != finalTime)
-		{
-			selectClause += ", "+ finalTime;
-			timeIndex2_[ind] = 3;
-		}
-	}
-
-	//adds geometry attributes
-	selectClause += ","+ rep.tableName_ +".* ";
-	uniqueIndex_[ind] = indexesAux;
-	if(indexesAux.empty())
-		geomIndex1_[ind] = 1;
-	else if(timeIndex1_[ind]==timeIndex2_[ind])
-		geomIndex1_[ind] = 3;
-	else
-		geomIndex1_[ind] = 4;
-	
-	if(!db->tableExist(params_->theme()->collectionAuxTable()))
-	{
-		TeAttrTableVector atts; 
-		params_->theme()->getAttTables(atts); 
-
-		if(atts.empty())
-			return false;
-
-		fromClause = " FROM " + tableJoin(atts, rep.tableName_, "object_id");
-		whereClause = params_->theme()->sqlWhereRestrictions(&rep);
-	}
-	else
-		fromClause = params_->theme()->sqlGridFrom(rep.tableName_);
-	
-	if(ent)
-	{
-		string iniTime = attrTable_.name()+"."+initialTime;
-		string finTime = attrTable_.name()+"."+finalTime;
-		if(!whereClause.empty())
-			whereClause += " AND ";
-
-		if ((params_->chronon()==TeMONTHOFYEAR) || (params_->chronon()==TeDAYOFWEEK))
-			whereClause += db->getSQLTemporalWhere(ent->timeInt_, ent->timeInt_, params_->chronon(), TeTIMEDURING, iniTime, finTime);    
-		else
-		{
-			TeTimeInterval interval = ent->time_;
-			interval.intervalChronon(params_->chronon());
-
-			whereClause += db->getSQLTemporalWhere(interval, TeTIMEDURING, iniTime, finTime);
-		}
-	}
-
-	//where clause
-	if(!objectId().empty())
-	{
-		if(!whereClause.empty())
-			whereClause += " AND ";
-		
-		whereClause += rep.tableName_+".object_id = '"+ objectId() +"'";  
-	}
-
-	//---------- querier restriction
-	string sqlQuerierRest = sqlWhereRestrictions(&rep);
-	if(!whereClause.empty())
-		whereClause += " AND ";
-
-	whereClause += sqlQuerierRest;
-
-	//----------
-
-	string sql = "SELECT "+ selectClause + fromClause;
-	if(!whereClause.empty())
-		sql += " WHERE "+ whereClause;
-	sql += orderByClause;
-
-	//------ Submit the query
-	TeDatabasePortal* portal = db->getPortal();
-	if(!portal)
-		return false;
-	
-	if(!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-
-	if(portal->fetchRow())
-		portals_.push_back (portal); 
-	else
-		delete portal;
-
-	return true;
-}
-
-
-// ---------- final - initPortal
-// It is used in two cases:
-// 1) when it must return all instances of an object 
-// 2) when the attributes was grouped by sql functions - without geometry 
-
-bool
-TeQuerierDBStr1::fillSTOGrouped(TeSTInstance& sto, bool fetchInstance)
-{
-	if(portals_.empty()) 
-		return false;
-
-	TeDatabasePortal* portal = portals_[0]; 
-	if(!portal) 
-		return false; 
-
-	TeRepresentation* rep = 0;
-	if(!geomRepr_.empty())
-		rep = &(geomRepr_[0]);
-
-	TeTime  minT1, maxT2;
-	
-	// builds a ST object instance
-	TeTime t1, t2;
-	vector<string> attrValues;
-
-	// verify if exist several geometries for an object
-	bool flagGeom = true;
-	while(flagGeom && fetchInstance)
-	{
-		sto.objectId (portal->getData(linkIndex_[0]));
-						
-		if(rep && (!params_->loadGeom()))
-		{
-			int geomId = portal->getInt(rep->tableName_ +".geom_id");
-			
-			if(sto.objectId()==lastObjId_) 
-			{
-				if (geomId_!=geomId)
-				{
-					flagGeom = portal->fetchRow();
-					continue;
-				}
-			}
-			else
-				geomId_ = geomId;
-		}
-		flagGeom = false;
-	}	
-	
-	// ------------- begin fill attribute
-	// process the records filling the parameters of each instance
-	TeAttributeList& attrsPortal = portal->getAttributeList();
-	
-	//get the attributes
-	for(int s=attrIndex1_; s<=attrIndex2_; ++s)
-	{
-		if(s<0)
-			break;
-		attrValues.push_back(portal->getData(s));
-		if(!fetchInstance) //fill the attribute list
-			attrList_->push_back(attrsPortal[s]);
-	}
-
-	//get the group index
-	if(groupIndex_!=-1)
-	{
-		int gIndex = portal->getInt(groupIndex_);
-		sto.setSlice(legendIdGroup_[gIndex]);
-	}
-	
-	if(isGroup_)  // it was grouped by sql functions and without geometry 
-		sto.addUniqueId(string(portal->getData(linkIndex_[0])));
-	else
-	{
-		//unique id
-		for(unsigned int s=0; s<uniqueIndex_[0].size(); ++s)
-		{
-			string uniqueValue = portal->getData(uniqueIndex_[0][s]);
-			sto.addUniqueId(uniqueValue);
-		}
-
-		//date time information
-		if(timeIndex1_[0]>=0 && timeIndex2_[0]>=0)
-		{
-			t1 = portal->getDate(timeIndex1_[0]);
-			t2 = portal->getDate(timeIndex2_[0]);
-			sto.timeInterval(TeTimeInterval(t1,t2));
-		}
-	}
-
-	//! Set the property in the stoInstance
-	sto.setProperties(attrValues); 
-	sto.setAttrList(attrList_);
-
-	if(!fetchInstance) //only to get the attributes
-		return true;
-
-	// ------------- end fill attribute
-	//total time
-	if(t1.isValid() && t1<minT1)
-		minT1 = t1;
-	if(t2.isValid() && maxT2<t2)
-		maxT2 = t2;
-		
-	// ------------- begin fill geometries  
-	if(params_->loadGeom())
-	{
-		if(t1.isValid() && t2.isValid())
-			flagPortal_ = addGeometry(portal, rep->geomRep_, sto, linkIndex_[0], geomIndex1_[0], TeTimeInterval(t1,t2), timeIndex1_[0], timeIndex2_[0]);
-		else
-			flagPortal_ = addGeometry(portal, rep->geomRep_, sto, linkIndex_[0], geomIndex1_[0]);
-	}
-	else
-		flagPortal_ = portal->fetchRow();
-
-	// ------------- end fill geometries
-	
-	lastObjId_ = sto.objectId(); 
-	return true;
-}
-
-bool 
-TeQuerierDBStr1::fillGeomSTO(TeSTInstance& sto, unsigned int index)
-{
-	if((portals_.size()<(index+1)) || (geomRepr_.size()<(index+1)))
-		return false;
-
-	TeDatabasePortal* portal = portals_[index]; 
-	TeRepresentation rep = geomRepr_[index];
-	if(!portal)
-		return false; 
-
-	TeTimeInterval time = sto.timeInterval();
-	bool flag = false;
-	if(time.isValid())
-		flag = addGeometry(portal, rep.geomRep_, sto, linkIndex_[index], geomIndex1_[index], time, timeIndex1_[index], timeIndex2_[index]);
-	else
-		flag = addGeometry(portal, rep.geomRep_, sto, linkIndex_[index], geomIndex1_[index] );
-
-	if(flag==false)
-		flagPortal_ = false; 
-	
-	return true;
-}
-
-// It is used in a case:
-// 1) when the attributes of the object instances must be grouping in memory - with or without geometry 
-bool
-TeQuerierDBStr1::fillSTONoGrouped(TeSTInstance& sto)
-{
-	int s;
-	if(portals_.empty())
-		return false;
-
-	TeDatabasePortal* portal = portals_[0]; 
-	if(!portal) 
-		return false; 
-
-	TeRepresentation* rep = 0; 
-	if(!geomRepr_.empty())
-		rep = &(geomRepr_[0]);
-	
-	map<int, vector<double> >	valuesDouble;
-	map<int, vector<string> >	valuesString;
-	string lastObj = "";
-
-	TeAttributeList& attrsPortal = portal->getAttributeList();
-	
-	//get the group index
-	if(groupIndex_!=-1)
-	{
-		int gIndex = portal->getInt(groupIndex_);
-		sto.setSlice(legendIdGroup_[gIndex]);
-	}
-
-	//when there is spatial restriction, the querier can not group the attributes and
-	//get the geometry at the same time. In this case, it do not get the geometry.
-	if(!params_->loadGeom() || params_->hasSpatialRes())
-	{
-		int cont = 0;
-		do
-		{
-			string objId = portal->getData(linkIndex_[0]);
-			//if there is a spatial restriction, it groups all instances of all objects of the portal 
-			if(!params_->hasSpatialRes() && (!lastObj.empty() && objId != lastObj))
-				break;  
-					
-			string val = ""; 
-			//portal has the attributes that will be grouped 
-			for(s=attrIndex1_; s<=attrIndex2_; ++s)
-			{
-				if(s<0)
-					break;
-				val = portal->getData(s);
-				if((attrsPortal[s].rep_.type_==TeREAL) || (attrsPortal[s].rep_.type_==TeINT))
-				{
-					if(val.empty())
-						valuesDouble[s].push_back (TeMAXFLOAT);  //invalid value
-					else
-						valuesDouble[s].push_back (atof(val.c_str()));
-				}
-				else
-					valuesString[s].push_back(val);
-			}
-
-			flagPortal_ = portal->fetchRow();
-			lastObj = objId;
-			++cont;
-
-		} while(flagPortal_);
-	}
-	else // -- when it must fill the geometry
-	{		
-		//------- first: load the geometry, attributes and time of the first object 
-		//object id
-		lastObj = portal->getData(linkIndex_[0]);
-		
-		//attribute val
-		string val = ""; 
-		
-		for(s=attrIndex1_; s<=attrIndex2_; ++s)
-		{
-			val = portal->getData(s);
-			if((attrsPortal[s].rep_.type_==TeREAL) || (attrsPortal[s].rep_.type_==TeINT))
-			{
-				if(val.empty())
-					valuesDouble[s].push_back (TeMAXFLOAT);  //invalid value
-				else
-					valuesDouble[s].push_back (atof(val.c_str()));
-			}
-			else
-				valuesString[s].push_back (val);
-		}
-
-		//time
-		TeTime t1, t2;
-		if(!attrTable_.name().empty())
-		{
-			t1 = portal->getDate(timeIndex1_[0]);
-			t2 = portal->getDate(timeIndex2_[0]);
-		}
-		
-		sto.objectId(lastObj);
-		if(t1.isValid() && t2.isValid())
-			flagPortal_ = addGeometry(portal, rep->geomRep_, sto, linkIndex_[0], geomIndex1_[0], TeTimeInterval(t1,t2), timeIndex1_[0], timeIndex2_[0]);
-		else
-			flagPortal_ = addGeometry(portal, rep->geomRep_, sto, linkIndex_[0], geomIndex1_[0]);
-				
-		//------- second: load the attributes of the other objects
-		int cont = 0;   
-		while (flagPortal_)
-		{
-			string objId = portal->getData(linkIndex_[0]);
-			//if there is a spatial restriction, it groups all instances of all objects of the portal 
-			if(objId != lastObj)
-				break;  
-			
-			//same object id
-			string gId = portal->getData (geomIndex1_[0]);
-			int geomId = atoi(gId.c_str());
-			if(gId.empty())
-				geomId = cont;   
-			
-			if(!cont)
-				geomId_ = geomId;  //first geom_id 
-			
-			//verify the geomId
-			if(geomId==geomId_)   
-			{
-				flagPortal_ = portal->fetchRow();
-				lastObj = objId;
-				continue;
-			}
-							
-			val = ""; 
-			for(s=attrIndex1_; s<=attrIndex2_; ++s)
-			{
-				val = portal->getData(s);
-				if((attrsPortal[s].rep_.type_==TeREAL) || (attrsPortal[s].rep_.type_==TeINT))
-				{
-					if(val.empty())
-						valuesDouble[s].push_back (TeMAXFLOAT);  //invalid value
-					else
-						valuesDouble[s].push_back (atof(val.c_str()));
-				}
-				else
-					valuesString[s].push_back (val);
-			}
-
-			flagPortal_ = portal->fetchRow();
-			lastObj = objId; 
-			++cont;
-		}
-	}
-
-	//fill the property from portal 
-	//calculate the statistics
-	string lastAttr = "";
-	unsigned int j=0;
-	string colName = "";
-	TeGroupingAttr::iterator it = params()->groupAttr().begin(); 
-
-	TeStatisticValMap		statDouble;
-	TeStatisticStringValMap statString;
-	
-	TeAttrDataType attrType = TeSTRING;
-	while(it!=params()->groupAttr().end())
-	{
-		if(lastAttr != it->first.name_)
-		{
-			statDouble.clear();
-			statString.clear();
-			//if((it->first.type_==TeREAL) || (it->first.type_==TeINT))
-			if((attrsPortal[j].rep_.type_==TeREAL) || (attrsPortal[j].rep_.type_==TeINT))
-			{
-				TeCalculateStatistics(valuesDouble[j].begin(), valuesDouble[j].end(), statDouble);
-				attrType = TeREAL;
-			}
-			else
-			{
-				TeCalculateStatistics(valuesString[j].begin(), valuesString[j].end(), statString);
-				attrType = TeSTRING;
-			}
-			
-			colName = attrsPortal[j].rep_.name_;
-			++j;
-		}
-
-		double resultD=0;
-		string resultS="";
-		string prefix;
-		switch(it->second)
-		{
-			case TeCOUNT:
-				resultD = statDouble[TeCOUNT]; 
-				resultS = statString[TeCOUNT];
-				prefix = "count";
-				break;
-			case TeVALIDCOUNT:
-				resultD = statDouble[TeVALIDCOUNT]; 
-				resultS = statString[TeVALIDCOUNT];
-				prefix = "valCount";
-				break;
-			case TeMINVALUE:
-				resultD = statDouble[TeMINVALUE];
-				resultS = statString[TeMINVALUE];
-				prefix = "min";
-				break;
-			case TeMAXVALUE:
-				resultD = statDouble[TeMAXVALUE];
-				resultS = statString[TeMAXVALUE];
-				prefix = "max";
-				break;
-			case TeSUM:
-				resultD = statDouble[TeSUM]; 
-				prefix = "sum";
-				break;
-			case TeMEAN:
-				resultD = statDouble[TeMEAN]; 
-				prefix = "mean";
-				break;
-			case TeSTANDARDDEVIATION:
-				resultD = statDouble[TeSTANDARDDEVIATION];
-				prefix = "stDeviation";
-				break;
-			case TeVARIANCE:
-				resultD = statDouble[TeVARIANCE];
-				prefix = "variance";
-				break;
-			case TeSKEWNESS:
-				resultD = statDouble[TeSKEWNESS];
-				prefix = "skwness";
-				break;
-			case TeKURTOSIS:
-				resultD = statDouble[TeKURTOSIS]; 
-				prefix = "kurtosis";
-				break;
-			case TeAMPLITUDE:
-				resultD = statDouble[TeAMPLITUDE]; 
-				prefix = "amplitude";
-				break;
-			case TeMEDIAN:
-				resultD = statDouble[TeMEDIAN]; 
-				prefix = "median";
-				break;
-			case TeVARCOEFF:
-				resultD = statDouble[TeVARCOEFF]; 
-				prefix = "varcoeff";
-				break;
-			case TeMODE: 
-				resultD = statDouble[TeMODE]; 
-				prefix = "mode";
-				break;
-			default:
-				break;
-		}
-		
-		lastAttr = it->first.name_; 
-		++it;
-
-		//fill the property 
-		if(attrType == TeREAL)
-			sto.addPropertyValue(Te2String(resultD));
-		else
-			sto.addPropertyValue(resultS);
-	}
-	
-	//adds the property in the stoInstance
-	if(!params_->hasSpatialRes())
-	{
-		sto.addUniqueId(lastObj);
-		sto.objectId(lastObj);
-	}
-	sto.setAttrList(attrList_);
-
-	lastObjId_ = sto.objectId(); 
-	return true;
-}
-
-
-bool
-TeQuerierDBStr1::loadInstances(TeTSEntry* ent)
-{
-	if(!params_->theme())
-		return false;
-
-	TeRepresPointerVector repres = params_->theme()->layer()->vectRepres();
-	TeRepresentation rep;
-	
-	//fill instances - first fill the geometry representation of the spatial restriction 
-	if(params_->theme()->hasSpatialRest())
-		rep = **(TeFindRepresentation(repres.begin(), repres.end(), params_->theme()->geomRepRestriction()));
-	else
-	{
-		for(int i=0; i<(int)repres.size(); ++i)
-		{
-			rep = *repres[i];
-			break;
-		}
-	}
-	
-	if(!initPortal(rep, ent))
-		return false;
-
-	//get the attribute list
-	attrList_->clear();
-	if(!groupInMemory_)
-	{
-		TeSTInstance i;
-		fillSTOGrouped(i, false);
-	}
-	else
-	{
-		TeGroupingAttr::iterator it = params()->groupAttr().begin();
-		while(it!=params()->groupAttr().end())
-		{
-			TeAttribute at;
-			at.rep_ = it->first;
-			attrList_->push_back (at);
-			++it;
-		}
-	}
-			
-	if(!params_->loadGeom())
-		return true;
-
-	//set a invalid box
-	TeBox box;
-	params_->box(box);
-	
-	for(unsigned int i=0; i<repres.size(); ++i)
-	{
-		if(repres[i]->geomRep_ == rep.geomRep_)
-			continue;
-
-		if(!initGeomPortal(*(repres[i]), ent))
-		{
-			clearVectors();
-			return false;
-		}
-	}
-	return true;
-}
-
-bool 
-TeQuerierDBStr1::fetchInstance(TeSTInstance&  sto)  
-{
-	sto.clear();
-	bool flag = false;
-
-	if(!flagPortal_)
-	{
-		clearVectors();
-		return false;
-	}
-
-	if(groupInMemory_)
-		flag = fillSTONoGrouped(sto); 
-	else
-		flag = fillSTOGrouped(sto); 
-	
-	if((flag==false) || (!params_->loadGeom()))
-		return flag;
-    	
-	for(unsigned int i=1; i<portals_.size(); ++i)
-		flag = fillGeomSTO(sto, i);
-
-	updateBox(params_->box(), sto.getGeometries().getBox());
-	return flag;
-}
-
-int 
-TeQuerierDBStr1::numElemInstances()
-{
-	//from clause has the geom table
-	if(params_->loadGeom() || params_->hasSpatialRes())
-	{
-		//load the attribute tables
-		TeAttrTableVector atts; 
-		params_->theme()->getAttTables(atts); 
-		if(atts.empty())
-			return 0;
-
-		string selectClause = " DISTINCT ";
-		for(unsigned int i=0; i<atts.size(); ++i)
-		{
-			if(i>0)
-				selectClause+= ",";
-			selectClause+= atts[i].name() +"."+ atts[i].linkName();
-
-			if(atts[i].linkName()!=atts[i].uniqueName())
-				selectClause+= ","+ atts[i].name() +"."+ atts[i].uniqueName();
-		}
-		
-        string sql = "SELECT "+ selectClause + fromClause_;
-		if(!whereClause_.empty())
-			sql += " WHERE "+ whereClause_;
-
-		TeDatabasePortal* portal = params_->theme()->layer()->database()->getPortal();
-		if(!portal)
-			return 0;
-		
-		sql = "SELECT COUNT(*) FROM(" + sql + ")";
-
-		if(!portal->query(sql) || !portal->fetchRow())
-		{
-			delete (portal);
-			return 0;
-		}
-		int result = portal->getInt(0);
-		delete portal;
-		return result;
-	}
-		
-	if((portals_.empty()))
-		return 0;
-
-	//get the first portal
-	if(!portals_[0])
-		return 0;
-
-	return (portals_[0]->numRows());
-}
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeQuerierDBStr1.h"
+#include "TeDatabase.h"
+#include "TeTemporalSeries.h"
+#include "TeSTInstance.h"
+
+bool 
+TeQuerierDBStr1::initPortal(TeRepresentation& rep, TeTSEntry* ent)
+{
+	string selectClause, fromClause, whereClause, orderByClause, groupByClause, parClause;
+	
+	//Init portal indexes
+	isGroup_ = false;
+	uniqueIndex_.clear();
+	vector<int> indexesAux;
+	linkIndex_.clear();
+	linkIndex_.push_back(-1); 
+	attrIndex1_=-1;
+	attrIndex2_=-1;
+	groupIndex_=-1;
+	
+	geomIndex1_.clear();
+	geomIndex1_.push_back(-1);
+	geomIndex2_.clear();
+	geomIndex2_.push_back(-1);
+	timeIndex1_.clear();
+	timeIndex1_.push_back(-1);
+	timeIndex2_.clear();
+	timeIndex2_.push_back(-1);
+
+	//all vectors contains attributes with the table name and in upper case
+	vector<string>	attrs_select;	//contains the attributes that will be used to fill the TeSTInstance
+	vector<string>	geoms_select;	//contains the geometry attributes 
+	vector<string>	times_select;	//contains the date time attributes, when they are not in the attrs_select
+	vector<string>	unique_select;	//contains the unique attributes, when they are not in the attrs_select
+	
+	//------------------------------------------- begin get information
+	//get database
+	TeDatabase* db = params_->theme()->layer()->database();
+
+	//get attribute tables
+	TeAttrTableVector atts; 
+	params_->theme()->getAttTables(atts); 
+	
+	//verify if will be group the objects	
+	TeGroupingAttr groups = params_->groupAttr();  
+	bool groupAttr = !(groups.empty());
+		
+	//verify if the theme has collection table
+	bool hasCollTable = false;
+	legendIdGroup_.clear();
+	legendIdGroup_[0]=0;
+	if(db->tableExist(params_->theme()->collectionAuxTable()))
+	{
+		TeLegendEntryVector& legVec = params_->theme()->legend();
+		for(unsigned int l=0; l<legVec.size(); ++l)
+			legendIdGroup_[legVec[l].id()]=legVec[l].group();
+		hasCollTable = true;
+	}
+		
+	clearVectors();
+	params_->setLoadAttrs(params_->loadSetedAttrs()); //the original data
+	
+	//get the link name - the first attribute table or geometry table
+	linkName_ = rep.tableName_ +".object_id"; 
+	if(atts.size() > 0)
+		linkName_ = atts[0].name() +"."+ atts[0].linkName(); 
+			
+	if(params_->loadGeom())
+		geomRepr_.push_back(rep);
+	
+	//------------------------------------------- end get information
+	
+	//------------------------------------------- begin information to mount SQL
+	// -------- from
+	bool fromNeedGeomTable = false;
+	bool fromNeedCollTable = false;
+	
+	if(params_->loadGeom() || params_->hasSpatialRes() || atts.empty())
+		fromNeedGeomTable = true;
+	if(hasCollTable)
+		fromNeedCollTable = true;
+
+	// -------- group and order by 
+	bool useGroupByClause = false;	//group by object_id
+	bool useOrderByClause = false;  //order by object_id, geom_id
+	//Use group by clause when 
+	//1)it must group the attributes and 
+	//2)it must not load geometry and 
+	//3)all statistic functions exist in the SGBD 
+	string sGroup="";
+	if(groupAttr)
+	{
+		if(params_->loadGeom())
+			useGroupByClause = false; 
+		else
+		{
+			sGroup = db->getSQLStatistics(groups);
+			isGroup_ = true;
+			TeGroupingAttr::iterator it = groups.begin();
+			while(it!= groups.end())
+			{
+				if(it->second != TeNOSTATISTIC)
+					isGroup_ = false;
+				++it;
+			}
+			if(isGroup_)
+				useGroupByClause = true; 
+		}
+		groupInMemory_ = !useGroupByClause;
+	}
+	else
+		useOrderByClause = true;
+
+	// -------- select
+	bool selectNeedGeom = false;
+	if(params_->loadGeom())
+		selectNeedGeom = true;
+	
+	//------------------------------------------- end information to mount SQL
+	
+	//------------------------------------------- begin mount SQL
+	// order and group by clause
+	orderByClause = " ORDER BY "+ linkName_; 
+	if(selectNeedGeom)
+		orderByClause += ", "+ rep.tableName_ +".geom_id";
+	groupByClause = " GROUP BY "+ linkName_;
+
+	// ------------- select clause
+	if(groupAttr)
+	{
+		if(!groupInMemory_) //use statistic function database
+		{
+			bool flag = true;
+			string auxS = sGroup;
+			while(flag)
+			{
+				size_t pos = auxS.find(",", 0, 1);
+				if (pos == string::npos)
+				{
+					attrs_select.push_back(auxS);
+					flag = false;
+				}
+				else
+				{
+					attrs_select.push_back(auxS.substr(0, pos));
+					auxS = auxS.substr(pos+1);
+				}
+			}
+		}
+		else //load the attributes from TeGroupingAttr
+		{
+			//fill select clause from set of attributes
+			string lastAttr = "";
+			TeGroupingAttr::iterator it = groups.begin(); 
+			while(it!= groups.end())
+			{
+				if(lastAttr != it->first.name_) 
+					attrs_select.push_back(it->first.name_);
+				lastAttr = it->first.name_;
+				++it;
+			}
+
+			// select datatime information
+			if(!attrTable_.name().empty())
+			{
+				times_select.push_back(attrTable_.name()+"."+attrTable_.attInitialTime());
+
+				if(attrTable_.attInitialTime()!=attrTable_.attFinalTime())
+					times_select.push_back(attrTable_.name()+"."+attrTable_.attFinalTime());
+			}
+		}
+	}
+	else // load all attributes or the attributes that are in the vector
+	{
+		// get some information about the attribute tables required
+		for(unsigned int i=0; i<atts.size(); i++)
+		{
+			//date time information
+			if((atts[i].tableType()==TeAttrEvent) || (atts[i].tableType()==TeFixedGeomDynAttr))
+			{
+				attrTable_ = atts[i]; 
+				times_select.push_back(atts[i].name()+"."+attrTable_.attInitialTime());
+				times_select.push_back(atts[i].name()+"."+attrTable_.attFinalTime());
+			}
+		
+			//unique information
+			unique_select.push_back(atts[i].name()+"."+atts[i].uniqueName());
+			indexesAux.push_back(-1);
+						
+			//fill vector of attributes and sql string with all attributes
+			if(params_->loadAllAttr())
+			{
+				TeAttributeList::iterator itAttr = atts[i].attributeList().begin();
+				while(itAttr!= atts[i].attributeList().end())
+				{
+					string attribute = atts[i].name() +"."+ (*itAttr).rep_.name_;
+					attrs_select.push_back(attribute);
+                    ++itAttr;
+				}
+			}
+		}
+
+		if(!params_->loadAllAttr())
+		{
+			vector<string>::iterator itVec = params_->loadAttrs().begin();
+			while(itVec!=params_->loadAttrs().end())
+			{
+				//insert in select clause itVec: deve estar no formato tableName.attrName
+				attrs_select.push_back (*itVec);
+				++itVec;
+			}
+		}
+	}
+	
+	if(selectNeedGeom)
+	{
+		TeAttributeList attrs;
+		if (!db->getAttributeList(rep.tableName_, attrs))
+			return false; 
+
+		for(unsigned int i=0; i<attrs.size(); ++i)
+		{
+			if( (db->dbmsName() == "SqlServerAdoSpatial") && (attrs[i].rep_.name_ == "spatial_data") )
+				geoms_select.push_back(rep.tableName_ + ".spatial_data.STAsBinary() as spatial_data");
+			else
+					geoms_select.push_back(rep.tableName_+"."+ attrs[i].rep_.name_);
+		}
+		
+		// order by clause
+		if((rep.geomRep_ == TePOLYGONS) && (db->dbmsName() != "OracleSpatial") && (db->dbmsName() != "PostGIS") )
+			orderByClause += ", parent_id ASC, num_holes DESC";
+	}
+	
+	// ------------- from and where clause
+	if(!fromNeedCollTable)
+	{
+		if(fromNeedGeomTable)
+			fromClause = " FROM " + tableJoin(atts, rep.tableName_, "object_id");
+		else
+			fromClause = " FROM " + tableJoin(atts);
+		
+		//if the theme does not have collection, it must apply its restrictions (attribute, temporal and spatial)
+		whereClause = params_->theme()->sqlWhereRestrictions(&rep); 
+	}
+	else
+	{
+		if(fromNeedGeomTable)
+			fromClause = params_->theme()->sqlGridFrom(rep.tableName_);
+		else
+			fromClause = params_->theme()->sqlGridFrom();
+	}
+
+	if(ent)
+	{
+		if(attrTable_.name().empty())
+			params_->theme()->getTemporalTable(attrTable_);
+
+		string iniTime = attrTable_.name()+"."+attrTable_.attInitialTime(); 
+		string finTime = attrTable_.name()+"."+attrTable_.attFinalTime(); 
+		if(!whereClause.empty())
+			whereClause += " AND ";
+
+		if ((params_->chronon()==TeMONTHOFYEAR) || (params_->chronon()==TeDAYOFWEEK))
+			whereClause += db->getSQLTemporalWhere(ent->timeInt_, ent->timeInt_, params_->chronon(), TeTIMEDURING, iniTime, finTime);    
+		else
+		{
+			TeTimeInterval interval = ent->time_;
+			interval.intervalChronon(params_->chronon());
+
+			whereClause += db->getSQLTemporalWhere(interval, TeTIMEDURING, iniTime, finTime);
+		}
+	}
+
+	if(!objectId().empty())
+	{
+		if(!whereClause.empty())
+			whereClause += " AND ";
+		
+		whereClause += linkName_ +" = '"+ objectId() +"'";  
+	}
+
+	//---------- mount select clause and get the indexes
+	unsigned int index=0;
+	unsigned int count=0;
+	selectClause = "";
+	uniqueIndex_[0] = indexesAux;
+	
+	//this attribute list can contain datetime, link and unique information
+	attrIndex1_ = count;
+	for(index=0; index<attrs_select.size(); ++index)
+	{
+		if(!selectClause.empty())
+			selectClause += ", ";
+		selectClause += attrs_select[index];
+		//link index
+		if(TeConvertToUpperCase(linkName_)==TeConvertToUpperCase(attrs_select[index]))
+			linkIndex_[0] = count;
+		//unique index
+		for(unsigned int i=0; i<unique_select.size(); ++i)
+		{
+			if(TeConvertToUpperCase(unique_select[i])==TeConvertToUpperCase(attrs_select[index]))
+				uniqueIndex_[0][i] = count;
+		}
+		
+		//time index
+		for(unsigned int i=0; i<times_select.size(); ++i)
+		{
+			if(TeConvertToUpperCase(times_select[i])==TeConvertToUpperCase(attrs_select[index]))
+			{
+				if(i==0)
+					timeIndex1_[0] = count;
+				else
+					timeIndex2_[0] = count;
+			}
+		}
+		if(timeIndex1_[0]>=0 && timeIndex2_[0]<0)
+			timeIndex2_[0] = timeIndex1_[0];
+		
+		attrIndex2_ = count;
+		++count;
+	}
+
+	//link attribute
+	if(linkIndex_[0]<0)
+	{
+		if(!selectClause.empty())
+			selectClause += ", ";
+		selectClause += linkName_;
+		linkIndex_[0] = count;
+		++count;
+	}
+	
+	//unique attributes
+	for(index=0; index<unique_select.size(); ++index)
+	{
+		if(uniqueIndex_[0][index]<0)
+		{
+			//verify if the unique name is equal to link name
+			if(TeConvertToUpperCase(unique_select[index]) == TeConvertToUpperCase(linkName_))
+				uniqueIndex_[0][index] = linkIndex_[0];
+			else
+			{
+				//adds the unique attributes that were not added
+				if(!selectClause.empty())
+					selectClause += ", ";
+				selectClause += unique_select[index];
+				uniqueIndex_[0][index] = count; 
+				++count;
+			}
+		}
+	}
+
+	//group index
+	if(hasCollTable)
+	{
+		if(!selectClause.empty())
+			selectClause += ", ";
+		if(useGroupByClause)
+			selectClause += " MIN("+ params_->theme()->collectionTable()+".c_legend_id )";
+		else
+			selectClause += params_->theme()->collectionTable()+".c_legend_id";
+			
+		groupIndex_ = count;
+		++count;
+	}
+
+	//time attributes
+	if(timeIndex1_[0]<0 && (!times_select.empty()))
+	{
+		timeIndex1_[0] = count;
+		for(index=0; index<times_select.size(); ++index)
+		{
+			if(!selectClause.empty())
+				selectClause += ", ";
+			selectClause += times_select[index];
+			timeIndex2_[0] = count;
+			++count;
+		}
+	}
+
+	//geometries
+	if(!geoms_select.empty())
+		geomIndex1_[0] = count;
+	for(index=0; index<geoms_select.size(); ++index)
+	{
+		if(!selectClause.empty())
+			selectClause += ", ";
+		selectClause += geoms_select[index];
+		geomIndex2_[0] = count;
+		++count;
+	}
+	
+	//---------- querier restriction
+	string sqlQuerierRest = sqlWhereRestrictions(&rep);
+	if(!whereClause.empty())
+		whereClause += " AND ";
+
+	whereClause += sqlQuerierRest;
+
+	fromClause_ = fromClause;
+	whereClause_ = whereClause;
+    string sql = "SELECT "+ selectClause + fromClause;
+	if(!whereClause.empty())
+		sql += " WHERE "+ whereClause;
+	
+	if(useGroupByClause)
+		sql += " "+ groupByClause;
+	else
+		sql += " "+ orderByClause;
+	
+	//------------------------------------------- end mount SQL
+
+	// --------- Submit the query
+	portals_.clear();
+	TeDatabasePortal* portal = db->getPortal();
+	
+	if(!portal)
+		return false;
+	
+	if(!portal->query(sql))
+	{
+		delete (portal);
+		flagPortal_ = false;
+		return false;
+	}
+
+	if(!portal->fetchRow())
+	{
+		delete (portal);
+		flagPortal_ = false;
+		return false;
+	}
+
+	string id = portal->getData(linkIndex_[0]);
+	bool flag = true;
+	while(id.empty() && flag) 
+	{
+		flag = portal->fetchRow();
+		if(flag)
+			id = portal->getData(0); //object_Id
+	}
+	
+	if(id.empty() || (!flag))
+	{
+		delete (portal);
+		flagPortal_ = false;
+		return false;
+	}
+
+	portals_.push_back (portal);
+	flagPortal_ = true;
+	lastObjId_ ="";
+	return true;
+}
+
+bool 
+TeQuerierDBStr1::initGeomPortal(TeRepresentation& rep, TeTSEntry* ent)
+{
+	string selectClause, fromClause, whereClause, orderByClause, parClause;
+	string initialTime, finalTime;
+	string uniqueName;
+	vector<int> indexesAux;
+	linkIndex_.push_back(-1); 
+	geomIndex1_.push_back(-1);
+	geomIndex2_.push_back(-1);
+	timeIndex1_.push_back(-1);
+	timeIndex2_.push_back(-1);
+	
+	TeDatabase* db = params_->theme()->layer()->database();
+
+	//------- Get geometry table
+	geomRepr_.push_back(rep);
+	if(rep.tableName_.empty())
+		return false;
+
+	int ind = linkIndex_.size()-1; //the last position in the vectors
+	
+	selectClause = linkName_; 
+	orderByClause = " ORDER BY "+ linkName_;  
+	linkIndex_[ind] = 0;
+	
+	if((rep.geomRep_ == TePOLYGONS) && (db->dbmsName() != "OracleSpatial") && (db->dbmsName() != "PostGIS") )
+		orderByClause += " , parent_id ASC, num_holes DESC";
+	
+	//------- Get temporal attribute 
+	if(!attrTable_.name().empty())
+	{
+		initialTime = attrTable_.name() +"."+ attrTable_.attInitialTime ();
+		finalTime = attrTable_.name() +"."+ attrTable_.attFinalTime ();
+			
+		// fill vector of unique name 
+		uniqueName = attrTable_.name()+"."+attrTable_.uniqueName();
+								
+		selectClause += ", "+ uniqueName;
+		indexesAux.push_back(1);
+		selectClause += ", "+ initialTime;
+		timeIndex1_[ind] = 2;
+		timeIndex2_[ind] = 2;
+
+		if (initialTime != finalTime)
+		{
+			selectClause += ", "+ finalTime;
+			timeIndex2_[ind] = 3;
+		}
+	}
+
+	//adds geometry attributes
+	selectClause += ","+ rep.tableName_ +".* ";
+	uniqueIndex_[ind] = indexesAux;
+	if(indexesAux.empty())
+		geomIndex1_[ind] = 1;
+	else if(timeIndex1_[ind]==timeIndex2_[ind])
+		geomIndex1_[ind] = 3;
+	else
+		geomIndex1_[ind] = 4;
+	
+	if(!db->tableExist(params_->theme()->collectionAuxTable()))
+	{
+		TeAttrTableVector atts; 
+		params_->theme()->getAttTables(atts); 
+
+		if(atts.empty())
+			return false;
+
+		fromClause = " FROM " + tableJoin(atts, rep.tableName_, "object_id");
+		whereClause = params_->theme()->sqlWhereRestrictions(&rep);
+	}
+	else
+		fromClause = params_->theme()->sqlGridFrom(rep.tableName_);
+	
+	if(ent)
+	{
+		string iniTime = attrTable_.name()+"."+initialTime;
+		string finTime = attrTable_.name()+"."+finalTime;
+		if(!whereClause.empty())
+			whereClause += " AND ";
+
+		if ((params_->chronon()==TeMONTHOFYEAR) || (params_->chronon()==TeDAYOFWEEK))
+			whereClause += db->getSQLTemporalWhere(ent->timeInt_, ent->timeInt_, params_->chronon(), TeTIMEDURING, iniTime, finTime);    
+		else
+		{
+			TeTimeInterval interval = ent->time_;
+			interval.intervalChronon(params_->chronon());
+
+			whereClause += db->getSQLTemporalWhere(interval, TeTIMEDURING, iniTime, finTime);
+		}
+	}
+
+	//where clause
+	if(!objectId().empty())
+	{
+		if(!whereClause.empty())
+			whereClause += " AND ";
+		
+		whereClause += rep.tableName_+".object_id = '"+ objectId() +"'";  
+	}
+
+	//---------- querier restriction
+	string sqlQuerierRest = sqlWhereRestrictions(&rep);
+	if(!whereClause.empty())
+		whereClause += " AND ";
+
+	whereClause += sqlQuerierRest;
+
+	//----------
+
+	string sql = "SELECT "+ selectClause + fromClause;
+	if(!whereClause.empty())
+		sql += " WHERE "+ whereClause;
+	sql += orderByClause;
+
+	//------ Submit the query
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+	
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	if(portal->fetchRow())
+		portals_.push_back (portal); 
+	else
+		delete portal;
+
+	return true;
+}
+
+
+// ---------- final - initPortal
+// It is used in two cases:
+// 1) when it must return all instances of an object 
+// 2) when the attributes was grouped by sql functions - without geometry 
+
+bool
+TeQuerierDBStr1::fillSTOGrouped(TeSTInstance& sto, bool fetchInstance)
+{
+	if(portals_.empty()) 
+		return false;
+
+	TeDatabasePortal* portal = portals_[0]; 
+	if(!portal) 
+		return false; 
+
+	TeRepresentation* rep = 0;
+	if(!geomRepr_.empty())
+		rep = &(geomRepr_[0]);
+
+	TeTime  minT1, maxT2;
+	
+	// builds a ST object instance
+	TeTime t1, t2;
+	vector<string> attrValues;
+
+	// verify if exist several geometries for an object
+	bool flagGeom = true;
+	while(flagGeom && fetchInstance)
+	{
+		sto.objectId (portal->getData(linkIndex_[0]));
+						
+		if(rep && (!params_->loadGeom()))
+		{
+			int geomId = portal->getInt(rep->tableName_ +".geom_id");
+			
+			if(sto.objectId()==lastObjId_) 
+			{
+				if (geomId_!=geomId)
+				{
+					flagGeom = portal->fetchRow();
+					continue;
+				}
+			}
+			else
+				geomId_ = geomId;
+		}
+		flagGeom = false;
+	}	
+	
+	// ------------- begin fill attribute
+	// process the records filling the parameters of each instance
+	TeAttributeList& attrsPortal = portal->getAttributeList();
+	
+	//get the attributes
+	for(int s=attrIndex1_; s<=attrIndex2_; ++s)
+	{
+		if(s<0)
+			break;
+		attrValues.push_back(portal->getData(s));
+		if(!fetchInstance) //fill the attribute list
+			attrList_->push_back(attrsPortal[s]);
+	}
+
+	//get the group index
+	if(groupIndex_!=-1)
+	{
+		int gIndex = portal->getInt(groupIndex_);
+		sto.setSlice(legendIdGroup_[gIndex]);
+	}
+	
+	if(isGroup_)  // it was grouped by sql functions and without geometry 
+		sto.addUniqueId(string(portal->getData(linkIndex_[0])));
+	else
+	{
+		//unique id
+		for(unsigned int s=0; s<uniqueIndex_[0].size(); ++s)
+		{
+			string uniqueValue = portal->getData(uniqueIndex_[0][s]);
+			sto.addUniqueId(uniqueValue);
+		}
+
+		//date time information
+		if(timeIndex1_[0]>=0 && timeIndex2_[0]>=0)
+		{
+			t1 = portal->getDate(timeIndex1_[0]);
+			t2 = portal->getDate(timeIndex2_[0]);
+			sto.timeInterval(TeTimeInterval(t1,t2));
+		}
+	}
+
+	//! Set the property in the stoInstance
+	sto.setProperties(attrValues); 
+	sto.setAttrList(attrList_);
+
+	if(!fetchInstance) //only to get the attributes
+		return true;
+
+	// ------------- end fill attribute
+	//total time
+	if(t1.isValid() && t1<minT1)
+		minT1 = t1;
+	if(t2.isValid() && maxT2<t2)
+		maxT2 = t2;
+		
+	// ------------- begin fill geometries  
+	if(params_->loadGeom())
+	{
+		if(t1.isValid() && t2.isValid())
+			flagPortal_ = addGeometry(portal, rep->geomRep_, sto, linkIndex_[0], geomIndex1_[0], TeTimeInterval(t1,t2), timeIndex1_[0], timeIndex2_[0]);
+		else
+			flagPortal_ = addGeometry(portal, rep->geomRep_, sto, linkIndex_[0], geomIndex1_[0]);
+	}
+	else
+		flagPortal_ = portal->fetchRow();
+
+	// ------------- end fill geometries
+	
+	lastObjId_ = sto.objectId(); 
+	return true;
+}
+
+bool 
+TeQuerierDBStr1::fillGeomSTO(TeSTInstance& sto, unsigned int index)
+{
+	if((portals_.size()<(index+1)) || (geomRepr_.size()<(index+1)))
+		return false;
+
+	TeDatabasePortal* portal = portals_[index]; 
+	TeRepresentation rep = geomRepr_[index];
+	if(!portal)
+		return false; 
+
+	TeTimeInterval time = sto.timeInterval();
+	bool flag = false;
+	if(time.isValid())
+		flag = addGeometry(portal, rep.geomRep_, sto, linkIndex_[index], geomIndex1_[index], time, timeIndex1_[index], timeIndex2_[index]);
+	else
+		flag = addGeometry(portal, rep.geomRep_, sto, linkIndex_[index], geomIndex1_[index] );
+
+	if(flag==false)
+		flagPortal_ = false; 
+	
+	return true;
+}
+
+// It is used in a case:
+// 1) when the attributes of the object instances must be grouping in memory - with or without geometry 
+bool
+TeQuerierDBStr1::fillSTONoGrouped(TeSTInstance& sto)
+{
+	int s;
+	if(portals_.empty())
+		return false;
+
+	TeDatabasePortal* portal = portals_[0]; 
+	if(!portal) 
+		return false; 
+
+	TeRepresentation* rep = 0; 
+	if(!geomRepr_.empty())
+		rep = &(geomRepr_[0]);
+	
+	map<int, vector<double> >	valuesDouble;
+	map<int, vector<string> >	valuesString;
+	string lastObj = "";
+
+	TeAttributeList& attrsPortal = portal->getAttributeList();
+	
+	//get the group index
+	if(groupIndex_!=-1)
+	{
+		int gIndex = portal->getInt(groupIndex_);
+		sto.setSlice(legendIdGroup_[gIndex]);
+	}
+
+	//when there is spatial restriction, the querier can not group the attributes and
+	//get the geometry at the same time. In this case, it do not get the geometry.
+	if(!params_->loadGeom() || params_->hasSpatialRes())
+	{
+		int cont = 0;
+		do
+		{
+			string objId = portal->getData(linkIndex_[0]);
+			//if there is a spatial restriction, it groups all instances of all objects of the portal 
+			if(!params_->hasSpatialRes() && (!lastObj.empty() && objId != lastObj))
+				break;  
+					
+			string val = ""; 
+			//portal has the attributes that will be grouped 
+			for(s=attrIndex1_; s<=attrIndex2_; ++s)
+			{
+				if(s<0)
+					break;
+				val = portal->getData(s);
+				if((attrsPortal[s].rep_.type_==TeREAL) || (attrsPortal[s].rep_.type_==TeINT))
+				{
+					if(val.empty())
+						valuesDouble[s].push_back (TeMAXFLOAT);  //invalid value
+					else
+						valuesDouble[s].push_back (atof(val.c_str()));
+				}
+				else
+					valuesString[s].push_back(val);
+			}
+
+			flagPortal_ = portal->fetchRow();
+			lastObj = objId;
+			++cont;
+
+		} while(flagPortal_);
+	}
+	else // -- when it must fill the geometry
+	{		
+		//------- first: load the geometry, attributes and time of the first object 
+		//object id
+		lastObj = portal->getData(linkIndex_[0]);
+		
+		//attribute val
+		string val = ""; 
+		
+		for(s=attrIndex1_; s<=attrIndex2_; ++s)
+		{
+			val = portal->getData(s);
+			if((attrsPortal[s].rep_.type_==TeREAL) || (attrsPortal[s].rep_.type_==TeINT))
+			{
+				if(val.empty())
+					valuesDouble[s].push_back (TeMAXFLOAT);  //invalid value
+				else
+					valuesDouble[s].push_back (atof(val.c_str()));
+			}
+			else
+				valuesString[s].push_back (val);
+		}
+
+		//time
+		TeTime t1, t2;
+		if(!attrTable_.name().empty())
+		{
+			t1 = portal->getDate(timeIndex1_[0]);
+			t2 = portal->getDate(timeIndex2_[0]);
+		}
+		
+		sto.objectId(lastObj);
+		if(t1.isValid() && t2.isValid())
+			flagPortal_ = addGeometry(portal, rep->geomRep_, sto, linkIndex_[0], geomIndex1_[0], TeTimeInterval(t1,t2), timeIndex1_[0], timeIndex2_[0]);
+		else
+			flagPortal_ = addGeometry(portal, rep->geomRep_, sto, linkIndex_[0], geomIndex1_[0]);
+				
+		//------- second: load the attributes of the other objects
+		int cont = 0;   
+		while (flagPortal_)
+		{
+			string objId = portal->getData(linkIndex_[0]);
+			//if there is a spatial restriction, it groups all instances of all objects of the portal 
+			if(objId != lastObj)
+				break;  
+			
+			//same object id
+			string gId = portal->getData (geomIndex1_[0]);
+			int geomId = atoi(gId.c_str());
+			if(gId.empty())
+				geomId = cont;   
+			
+			if(!cont)
+				geomId_ = geomId;  //first geom_id 
+			
+			//verify the geomId
+			if(geomId==geomId_)   
+			{
+				flagPortal_ = portal->fetchRow();
+				lastObj = objId;
+				continue;
+			}
+							
+			val = ""; 
+			for(s=attrIndex1_; s<=attrIndex2_; ++s)
+			{
+				val = portal->getData(s);
+				if((attrsPortal[s].rep_.type_==TeREAL) || (attrsPortal[s].rep_.type_==TeINT))
+				{
+					if(val.empty())
+						valuesDouble[s].push_back (TeMAXFLOAT);  //invalid value
+					else
+						valuesDouble[s].push_back (atof(val.c_str()));
+				}
+				else
+					valuesString[s].push_back (val);
+			}
+
+			flagPortal_ = portal->fetchRow();
+			lastObj = objId; 
+			++cont;
+		}
+	}
+
+	//fill the property from portal 
+	//calculate the statistics
+	string lastAttr = "";
+	unsigned int j=0;
+	string colName = "";
+	TeGroupingAttr::iterator it = params()->groupAttr().begin(); 
+
+	TeStatisticValMap		statDouble;
+	TeStatisticStringValMap statString;
+	
+	TeAttrDataType attrType = TeSTRING;
+	while(it!=params()->groupAttr().end())
+	{
+		if(lastAttr != it->first.name_)
+		{
+			statDouble.clear();
+			statString.clear();
+			//if((it->first.type_==TeREAL) || (it->first.type_==TeINT))
+			if((attrsPortal[j].rep_.type_==TeREAL) || (attrsPortal[j].rep_.type_==TeINT))
+			{
+				TeCalculateStatistics(valuesDouble[j].begin(), valuesDouble[j].end(), statDouble);
+				attrType = TeREAL;
+			}
+			else
+			{
+				TeCalculateStatistics(valuesString[j].begin(), valuesString[j].end(), statString);
+				attrType = TeSTRING;
+			}
+			
+			colName = attrsPortal[j].rep_.name_;
+			++j;
+		}
+
+		double resultD=0;
+		string resultS="";
+		string prefix;
+		switch(it->second)
+		{
+			case TeCOUNT:
+				resultD = statDouble[TeCOUNT]; 
+				resultS = statString[TeCOUNT];
+				prefix = "count";
+				break;
+			case TeVALIDCOUNT:
+				resultD = statDouble[TeVALIDCOUNT]; 
+				resultS = statString[TeVALIDCOUNT];
+				prefix = "valCount";
+				break;
+			case TeMINVALUE:
+				resultD = statDouble[TeMINVALUE];
+				resultS = statString[TeMINVALUE];
+				prefix = "min";
+				break;
+			case TeMAXVALUE:
+				resultD = statDouble[TeMAXVALUE];
+				resultS = statString[TeMAXVALUE];
+				prefix = "max";
+				break;
+			case TeSUM:
+				resultD = statDouble[TeSUM]; 
+				prefix = "sum";
+				break;
+			case TeMEAN:
+				resultD = statDouble[TeMEAN]; 
+				prefix = "mean";
+				break;
+			case TeSTANDARDDEVIATION:
+				resultD = statDouble[TeSTANDARDDEVIATION];
+				prefix = "stDeviation";
+				break;
+			case TeVARIANCE:
+				resultD = statDouble[TeVARIANCE];
+				prefix = "variance";
+				break;
+			case TeSKEWNESS:
+				resultD = statDouble[TeSKEWNESS];
+				prefix = "skwness";
+				break;
+			case TeKURTOSIS:
+				resultD = statDouble[TeKURTOSIS]; 
+				prefix = "kurtosis";
+				break;
+			case TeAMPLITUDE:
+				resultD = statDouble[TeAMPLITUDE]; 
+				prefix = "amplitude";
+				break;
+			case TeMEDIAN:
+				resultD = statDouble[TeMEDIAN]; 
+				prefix = "median";
+				break;
+			case TeVARCOEFF:
+				resultD = statDouble[TeVARCOEFF]; 
+				prefix = "varcoeff";
+				break;
+			case TeMODE: 
+				resultD = statDouble[TeMODE]; 
+				prefix = "mode";
+				break;
+			default:
+				break;
+		}
+		
+		lastAttr = it->first.name_; 
+		++it;
+
+		//fill the property 
+		if(attrType == TeREAL)
+			sto.addPropertyValue(Te2String(resultD));
+		else
+			sto.addPropertyValue(resultS);
+	}
+	
+	//adds the property in the stoInstance
+	if(!params_->hasSpatialRes())
+	{
+		sto.addUniqueId(lastObj);
+		sto.objectId(lastObj);
+	}
+	sto.setAttrList(attrList_);
+
+	lastObjId_ = sto.objectId(); 
+	return true;
+}
+
+
+bool
+TeQuerierDBStr1::loadInstances(TeTSEntry* ent)
+{
+	if(!params_->theme())
+		return false;
+
+	TeRepresPointerVector repres = params_->theme()->layer()->vectRepres();
+	TeRepresentation rep;
+	
+	//fill instances - first fill the geometry representation of the spatial restriction 
+	if(params_->theme()->hasSpatialRest())
+		rep = **(TeFindRepresentation(repres.begin(), repres.end(), params_->theme()->geomRepRestriction()));
+	else
+	{
+		for(int i=0; i<(int)repres.size(); ++i)
+		{
+			rep = *repres[i];
+			break;
+		}
+	}
+	
+	if(!initPortal(rep, ent))
+		return false;
+
+	//get the attribute list
+	attrList_->clear();
+	if(!groupInMemory_)
+	{
+		TeSTInstance i;
+		fillSTOGrouped(i, false);
+	}
+	else
+	{
+		TeGroupingAttr::iterator it = params()->groupAttr().begin();
+		while(it!=params()->groupAttr().end())
+		{
+			TeAttribute at;
+			at.rep_ = it->first;
+			attrList_->push_back (at);
+			++it;
+		}
+	}
+			
+	if(!params_->loadGeom())
+		return true;
+
+	//set a invalid box
+	TeBox box;
+	params_->box(box);
+	
+	for(unsigned int i=0; i<repres.size(); ++i)
+	{
+		if(repres[i]->geomRep_ == rep.geomRep_)
+			continue;
+
+		if(!initGeomPortal(*(repres[i]), ent))
+		{
+			clearVectors();
+			return false;
+		}
+	}
+	return true;
+}
+
+bool 
+TeQuerierDBStr1::fetchInstance(TeSTInstance&  sto)  
+{
+	sto.clear();
+	bool flag = false;
+
+	if(!flagPortal_)
+	{
+		clearVectors();
+		return false;
+	}
+
+	if(groupInMemory_)
+		flag = fillSTONoGrouped(sto); 
+	else
+		flag = fillSTOGrouped(sto); 
+	
+	if((flag==false) || (!params_->loadGeom()))
+		return flag;
+    	
+	for(unsigned int i=1; i<portals_.size(); ++i)
+		flag = fillGeomSTO(sto, i);
+
+	updateBox(params_->box(), sto.getGeometries().getBox());
+	return flag;
+}
+
+int 
+TeQuerierDBStr1::numElemInstances()
+{
+	//from clause has the geom table
+	if(params_->loadGeom() || params_->hasSpatialRes())
+	{
+		//load the attribute tables
+		TeAttrTableVector atts; 
+		params_->theme()->getAttTables(atts); 
+		if(atts.empty())
+			return 0;
+
+		string selectClause = " DISTINCT ";
+		for(unsigned int i=0; i<atts.size(); ++i)
+		{
+			if(i>0)
+				selectClause+= ",";
+			selectClause+= atts[i].name() +"."+ atts[i].linkName();
+
+			if(atts[i].linkName()!=atts[i].uniqueName())
+				selectClause+= ","+ atts[i].name() +"."+ atts[i].uniqueName();
+		}
+		
+        string sql = "SELECT "+ selectClause + fromClause_;
+		if(!whereClause_.empty())
+			sql += " WHERE "+ whereClause_;
+
+		TeDatabasePortal* portal = params_->theme()->layer()->database()->getPortal();
+		if(!portal)
+			return 0;
+		
+		sql = "SELECT COUNT(*) FROM(" + sql + ") AS cont";
+
+		if(!portal->query(sql) || !portal->fetchRow())
+		{
+			delete (portal);
+			return 0;
+		}
+		int result = portal->getInt(0);
+		delete portal;
+		return result;
+	}
+		
+	if((portals_.empty()))
+		return 0;
+
+	//get the first portal
+	if(!portals_[0])
+		return 0;
+
+	return (portals_[0]->numRows());
+}
+
+
+
+
diff --git a/src/terralib/kernel/TeQuerierDBStr1.h b/src/terralib/kernel/TeQuerierDBStr1.h
old mode 100755
new mode 100644
index 4ec02a8..7f71719
--- a/src/terralib/kernel/TeQuerierDBStr1.h
+++ b/src/terralib/kernel/TeQuerierDBStr1.h
@@ -1,123 +1,123 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*! \file TeQuerierDBStr1.h
-	\brief This file contains a mechanism named "TeQuerierDBStr1" that is 
-	responsible for loading spatio-temporal elements from a TerraLib database. 
-*/
-
-#ifndef  __TERRALIB_INTERNAL_QUERIER_DBSTR1_H
-#define  __TERRALIB_INTERNAL_QUERIER_DBSTR1_H
-
-#include "TeQuerierDB.h"
-
-/*! \class TeQuerierDBStr1
-	\brief A class responsible for loading spatio-temporal elements from a TerraLib database.
-
-	This class implements a mechanism that is responsible for loading 
-	spatio-temporal elements from a TerraLib database, following a specific strategy. 
-	Each spatio-temporal elements is represented through a TeSTInstance class. 
-	This class is internally used by the factory of queriers. It should NOT be used 
-	by anyone. 
-
-	\sa
-	TeQuerierDB TeQuerierParams TeSTInstance 
-*/
-class TL_DLL TeQuerierDBStr1 : public TeQuerierDB
-{
-private:		
-	vector<string>				uniqueNames_;
-	string						lastObjId_;
-	int							geomId_;
-	bool						isGroup_;			//! if the portal was built with statistics sql funcionts
-	bool						groupInMemory_;		//! if it must group the object instances in the memory 
-	string						linkName_;
-	
-	string						fromClause_;   //store the sql clause(from and where) to return the number of instances
-	string						whereClause_;
-	
-	/* @name Internal functions to initialize portals */
-	//@{
-	bool initPortal(TeRepresentation& rep, TeTSEntry* ent=0);     
-	bool initGeomPortal(TeRepresentation& rep, TeTSEntry* ent=0); 
-	//@}
-
-	/* @name Internal functions to fill the STOs from portals */
-	//@{
-	bool fillSTOGrouped(TeSTInstance& sto, bool fetchInstance = true);
-	bool fillSTONoGrouped(TeSTInstance& sto);
-	bool fillGeomSTO(TeSTInstance& sto, unsigned int index);
-	//@}
-
-public:
-	//! Constructor
-	TeQuerierDBStr1(TeQuerierParams* params) : 
-		TeQuerierDB(params), 
-		lastObjId_(""),
-		isGroup_(false),
-		groupInMemory_(false),
-		linkName_(""),
-		fromClause_(""),
-		whereClause_("")
-	{}
-	
-	//! Loads instances
-	bool loadInstances(TeTSEntry* ent=0); 
-	
-	//! Returns each loaded instance
-	bool fetchInstance(TeSTInstance&  sto); 
-
-	//! Returns the number of instances 
-	int numElemInstances(); 
-};
-
-/*! \class TeQuerierDBStr1Factory
-	\brief A class that define a factory to build a querier strategy (strategy 1) from TerraLib database.
-
-	\sa
-	TeQuerierImplFactory TeQuerierDBStr1
-*/
-class TL_DLL TeQuerierDBStr1Factory : public TeQuerierImplFactory
-{
-public:
-	//! Constructor
-	TeQuerierDBStr1Factory(const string& name) : TeQuerierImplFactory(name) {}
-
-	//! Builds a database querier
-	virtual TeQuerierImpl* build (const TeQuerierParams& arg)
-	{  
-		TeQuerierParams* tempArg = new TeQuerierParams();
-		*tempArg = arg;
-		return new TeQuerierDBStr1(tempArg); 
-	}
-};
-
-//! Creates a static factory to build TeQuerierDBStr1 
-namespace 
-{
-  static TeQuerierDBStr1Factory querierDBStr1("querierDBStr1");
-};
-
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*! \file TeQuerierDBStr1.h
+	\brief This file contains a mechanism named "TeQuerierDBStr1" that is 
+	responsible for loading spatio-temporal elements from a TerraLib database. 
+*/
+
+#ifndef  __TERRALIB_INTERNAL_QUERIER_DBSTR1_H
+#define  __TERRALIB_INTERNAL_QUERIER_DBSTR1_H
+
+#include "TeQuerierDB.h"
+
+/*! \class TeQuerierDBStr1
+	\brief A class responsible for loading spatio-temporal elements from a TerraLib database.
+
+	This class implements a mechanism that is responsible for loading 
+	spatio-temporal elements from a TerraLib database, following a specific strategy. 
+	Each spatio-temporal elements is represented through a TeSTInstance class. 
+	This class is internally used by the factory of queriers. It should NOT be used 
+	by anyone. 
+
+	\sa
+	TeQuerierDB TeQuerierParams TeSTInstance 
+*/
+class TL_DLL TeQuerierDBStr1 : public TeQuerierDB
+{
+private:		
+	vector<string>				uniqueNames_;
+	string						lastObjId_;
+	int							geomId_;
+	bool						isGroup_;			//! if the portal was built with statistics sql funcionts
+	bool						groupInMemory_;		//! if it must group the object instances in the memory 
+	string						linkName_;
+	
+	string						fromClause_;   //store the sql clause(from and where) to return the number of instances
+	string						whereClause_;
+	
+	/* @name Internal functions to initialize portals */
+	//@{
+	bool initPortal(TeRepresentation& rep, TeTSEntry* ent=0);     
+	bool initGeomPortal(TeRepresentation& rep, TeTSEntry* ent=0); 
+	//@}
+
+	/* @name Internal functions to fill the STOs from portals */
+	//@{
+	bool fillSTOGrouped(TeSTInstance& sto, bool fetchInstance = true);
+	bool fillSTONoGrouped(TeSTInstance& sto);
+	bool fillGeomSTO(TeSTInstance& sto, unsigned int index);
+	//@}
+
+public:
+	//! Constructor
+	TeQuerierDBStr1(TeQuerierParams* params) : 
+		TeQuerierDB(params), 
+		lastObjId_(""),
+		isGroup_(false),
+		groupInMemory_(false),
+		linkName_(""),
+		fromClause_(""),
+		whereClause_("")
+	{}
+	
+	//! Loads instances
+	bool loadInstances(TeTSEntry* ent=0); 
+	
+	//! Returns each loaded instance
+	bool fetchInstance(TeSTInstance&  sto); 
+
+	//! Returns the number of instances 
+	int numElemInstances(); 
+};
+
+/*! \class TeQuerierDBStr1Factory
+	\brief A class that define a factory to build a querier strategy (strategy 1) from TerraLib database.
+
+	\sa
+	TeQuerierImplFactory TeQuerierDBStr1
+*/
+class TL_DLL TeQuerierDBStr1Factory : public TeQuerierImplFactory
+{
+public:
+	//! Constructor
+	TeQuerierDBStr1Factory(const string& name) : TeQuerierImplFactory(name) {}
+
+	//! Builds a database querier
+	virtual TeQuerierImpl* build (const TeQuerierParams& arg)
+	{  
+		TeQuerierParams* tempArg = new TeQuerierParams();
+		*tempArg = arg;
+		return new TeQuerierDBStr1(tempArg); 
+	}
+};
+
+//! Creates a static factory to build TeQuerierDBStr1 
+namespace 
+{
+  static TeQuerierDBStr1Factory querierDBStr1("querierDBStr1");
+};
+
+
+#endif
+
diff --git a/src/terralib/kernel/TeQuerierDBStr2.cpp b/src/terralib/kernel/TeQuerierDBStr2.cpp
old mode 100755
new mode 100644
index 1130c94..13b41bb
--- a/src/terralib/kernel/TeQuerierDBStr2.cpp
+++ b/src/terralib/kernel/TeQuerierDBStr2.cpp
@@ -1,350 +1,350 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeQuerierDBStr2.h"
-#include "TeDatabase.h"
-#include "TeSTInstance.h"
-
-//It must group the attributes of ONE attribute table using DBMS functions
-// and do not load geometries. It must be used with theme (with collection table).
-bool
-TeQuerierDBStr2::initPortal(TeTSEntry* ent)  
-{
-	string selectClause, fromClause, whereClause, groupByClause;
-	string initialTime, finalTime;
-	linkIndex_.clear();
-	linkIndex_.push_back(-1); 
-	attrIndex1_=-1;
-	attrIndex2_=-1;
-	timeIndex1_.clear();
-	timeIndex1_.push_back(-1);
-	timeIndex2_.clear();
-	timeIndex2_.push_back(-1);
-	groupIndex_=-1;
-
-	TeDatabase* db = params_->theme()->layer()->database();
-
-	if(params_->groupAttr().empty())
-		return false;
-
-	//get the table name (there is only one attribute table)
-	string tableName;
-	TeGroupingAttr groupAttr = params_->groupAttr();
-	TeGroupingAttr::iterator it = groupAttr.begin();
-	size_t pos = (it->first.name_).find(".", 0, 1);
-	if (pos != string::npos)
-		tableName = (it->first.name_).substr(0,pos);
-
-	//group information
-	legendIdGroup_.clear();
-	legendIdGroup_[0]=0;
-	TeLegendEntryVector& legVec = params_->theme()->legend();
-	for(unsigned int l=0; l<legVec.size(); ++l)
-		legendIdGroup_[legVec[l].id()]=legVec[l].group();
-		
-	clearVectors();
-
-	// ---------------------------------------------  Mount SQL
-	
-	//------- Select and Group By clause
-	//load the attribute table 
-	int index = -1;
-	TeAttrTableVector attr = params_->theme()->attrTables();
-	for(unsigned int i=0; i<attr.size(); ++i)
-	{
-		if(TeConvertToUpperCase(attr[i].name()) == TeConvertToUpperCase(tableName))
-		{
-			index = i;
-			attrTable_ = attr[i];
-			break;
-		}
-	}
-	
-	//not find the table
-	if(index<0)
-		return false;
-
-	//verify the attribute table
-	if((ent) && (attrTable_.tableType()!=TeAttrEvent) && (attrTable_.tableType()!=TeFixedGeomDynAttr))
-		return false;
- 	
-	//object_id
-	string linkName; 
-	if(attrTable_.tableType() != TeAttrExternal)
-		linkName = attrTable_.name() +"."+ attrTable_.linkName(); 
-	else
-		linkName = params_->theme()->collectionTable() +".c_object_id "; 
-
-	if(params_->hasSpatialRes())
-		selectClause = " MIN("+ linkName +")";		
-	else
-		selectClause = linkName;	
-	linkIndex_[0]=0;
-
-	if(ent)
-	{
-		//date
-		initialTime = attrTable_.name() +"."+ attrTable_.attInitialTime();
-		
-		groupByClause = db->getSQLTemporalFunction(params_->chronon(), initialTime);
-		if(!params_->hasSpatialRes())
-			groupByClause += ","+ linkName;
-				
-		selectClause += ", MAX("+ initialTime +")";
-		timeIndex1_[0]=1;
-		timeIndex2_[0]=1;
-	}
-	else 
-		groupByClause = linkName;
-
-	
-	//statistic
-	selectClause += ","+ db->getSQLStatistics(groupAttr);  
-	if(timeIndex1_[0]<0)
-		attrIndex1_=1;
-	else
-		attrIndex1_=2;
-	attrIndex2_ = attrIndex1_+(params_->groupAttr().size()-1);
-
-	//group index
-	selectClause += ", MIN("+ params_->theme()->collectionTable()+".c_legend_id )";
-	groupIndex_ = attrIndex2_+1;		
-
-	//---- from clause 
-	if(params_->hasSpatialRes())
-	{
-		groupByClause = ""; //It groups all attributes from all objects 
-		string gTable = params_->theme()->layer()->tableName(params_->geomRepRest());
-		fromClause = this->sqlFrom(gTable);
-	}
-	else
-		fromClause = this->sqlFrom();
-	
-	if(fromClause.empty())
-		return false;
-	
-	//where clause
-	if(!params_->objId().empty())
-		whereClause = linkName +" = '"+ params_->objId() +"'";  
-
-	//---------- querier restriction
-	string sqlQuerierRest = sqlWhereRestrictions();
-	if(!whereClause.empty())
-		whereClause += " AND ";
-
-	whereClause += sqlQuerierRest;
-
-	//----------
-	
-	string sql = " SELECT "+ selectClause; 
-	sql += " FROM "+ fromClause;
-	if(!whereClause.empty())
-		sql += " WHERE "+ whereClause; 
-	if(!groupByClause.empty())
-		sql += " GROUP BY "+ groupByClause;
-	
-	// ---------------------------------------------  Submit the query
-	
-	portals_.clear();
-	TeDatabasePortal* portal = db->getPortal();
-	
-	if(!portal)
-		return false;
-	
-	if(!portal->query(sql))
-	{
-		delete (portal);
-		flagPortal_ = false;
-		return false;
-	}
-
-	if(!portal->fetchRow())
-	{
-		delete (portal);
-		flagPortal_ = false;
-		return false;
-	}
-
-	string id = portal->getData(linkIndex_[0]); //object_Id
-	bool flag = true;
-	while(id.empty() && flag) 
-	{
-		flag = portal->fetchRow();
-		if(flag)
-			id = portal->getData(linkIndex_[0]); //object_Id
-	}
-	
-	if(id.empty() || (!flag)) //se o id �vazio ou chegou ao final do portal 
-	{
-		delete (portal);
-		flagPortal_ = false;
-		return false;
-	}
-
-	portals_.push_back (portal);
-	flagPortal_ = true;
-	return true;
-}
-
-
-bool
-TeQuerierDBStr2::fillSTO(TeSTInstance& sto)  
-{
-	if(portals_.empty())
-		return false;
-
-	TeDatabasePortal* portal = portals_[0]; 
-	if(!portal) 
-		return false; 
-
-	if(!flagPortal_) // end of portal
-	{
-		clearVectors();
-		return false; 
-	}
-
-	if(TSEntry_.timeFrame_ > -1)
-	{
-		// first : verify the time
-		TeTime t1 = portal->getDate(timeIndex1_[0]);		
-		t1.chronon ((TSEntry_.time_).intervalChronon());
-			
-		//if the time is before the requested interval 
-		while ( (TSEntry_.time_).before(t1) && flagPortal_)
-		{
-			flagPortal_ = portal->fetchRow();
-			t1 = portal->getDate(timeIndex1_[0]);
-			t1.chronon ((TSEntry_.time_).intervalChronon());
-		}
-	
-		if(!(TSEntry_.time_).during(t1))
-			return false;
-		
-		TeTimeInterval interval(t1, t1);
-		sto.timeInterval(interval);
-
-		timeFramePortal_ = (TSEntry_.timeFrame_)+1; //next time frame 
-	}
-
-	//if there is spatial restriction, it groups all instances of all objects
-	if(!params_->hasSpatialRes())
-	{
-		// get object_id
-		string objId = string(portal->getData(linkIndex_[0]));  // 0: object_id
-		sto.objectId (objId);
-		sto.addUniqueId (objId);
-
-		//get the group index
-		if(groupIndex_!=-1)
-		{
-			int gIndex = portal->getInt(groupIndex_);
-			sto.setSlice(legendIdGroup_[gIndex]);
-		}
-	}
-
-	//get property
-	for(int s=attrIndex1_; s<=attrIndex2_; ++s)  
-		sto.addPropertyValue(string(portal->getData(s)));
-
-	sto.setAttrList(attrList_);
-	flagPortal_ = portal->fetchRow();
-	return true;
-}
-
-
-bool
-TeQuerierDBStr2::loadInstances(TeTSEntry* ent) 
-{
-	if(!params_->theme())
-		return false;
-
-	//set a invalid box
-	TeBox box;
-	params_->box(box);
-
-	if(ent)
-	{
-		//if the portal was not initialised (timeFramePortal_==-1) or
-		//if the time frame requested is lesser than the time frame appointed by the portal
-		if((timeFramePortal_<0) || (ent->timeFrame_<timeFramePortal_))
-		{
-			if(!initPortal(ent))
-				return false;
-
-			timeFramePortal_ = 0;
-		}
-		TSEntry_ = (*ent);
-	}
-	else // no chronon
-	{
-		if(!initPortal())
-			return false;
- 
-		timeFramePortal_ = -1;
-	}
-
-	attrList_->clear();
-	TeAttribute at;
-	TeGroupingAttr::iterator it = params()->groupAttr().begin();
-	while(it!=params()->groupAttr().end())
-	{
-		TeAttribute at;
-		at.rep_ = it->first;
-		attrList_->push_back (at);
-		++it;
-	}
-
-	return true;
-}
-
-bool
-TeQuerierDBStr2::fetchInstance(TeSTInstance&  sto) 
-{
-	sto.clear();
-
-	if(!fillSTO(sto))
-		return false; 
-	
-	//build a temporal serie to one object
-	string val;
-	sto.getPropertyValue(val, 0);
-	if((ts_) && (ts_->setTSEntryValue(TSEntry_.timeFrame_, atof(val.c_str()), TeDATA)))
-		filledSerie_ = true;
-	
-	return true;
-}
-
-int 
-TeQuerierDBStr2::numElemInstances()
-{
-	if((portals_.empty()))
-		return 0;
-
-	//get the first portal
-	if(!portals_[0])
-		return 0;
-
-	return (portals_[0]->numRows());
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeQuerierDBStr2.h"
+#include "TeDatabase.h"
+#include "TeSTInstance.h"
+
+//It must group the attributes of ONE attribute table using DBMS functions
+// and do not load geometries. It must be used with theme (with collection table).
+bool
+TeQuerierDBStr2::initPortal(TeTSEntry* ent)  
+{
+	string selectClause, fromClause, whereClause, groupByClause;
+	string initialTime, finalTime;
+	linkIndex_.clear();
+	linkIndex_.push_back(-1); 
+	attrIndex1_=-1;
+	attrIndex2_=-1;
+	timeIndex1_.clear();
+	timeIndex1_.push_back(-1);
+	timeIndex2_.clear();
+	timeIndex2_.push_back(-1);
+	groupIndex_=-1;
+
+	TeDatabase* db = params_->theme()->layer()->database();
+
+	if(params_->groupAttr().empty())
+		return false;
+
+	//get the table name (there is only one attribute table)
+	string tableName;
+	TeGroupingAttr groupAttr = params_->groupAttr();
+	TeGroupingAttr::iterator it = groupAttr.begin();
+	size_t pos = (it->first.name_).find(".", 0, 1);
+	if (pos != string::npos)
+		tableName = (it->first.name_).substr(0,pos);
+
+	//group information
+	legendIdGroup_.clear();
+	legendIdGroup_[0]=0;
+	TeLegendEntryVector& legVec = params_->theme()->legend();
+	for(unsigned int l=0; l<legVec.size(); ++l)
+		legendIdGroup_[legVec[l].id()]=legVec[l].group();
+		
+	clearVectors();
+
+	// ---------------------------------------------  Mount SQL
+	
+	//------- Select and Group By clause
+	//load the attribute table 
+	int index = -1;
+	TeAttrTableVector attr = params_->theme()->attrTables();
+	for(unsigned int i=0; i<attr.size(); ++i)
+	{
+		if(TeConvertToUpperCase(attr[i].name()) == TeConvertToUpperCase(tableName))
+		{
+			index = i;
+			attrTable_ = attr[i];
+			break;
+		}
+	}
+	
+	//not find the table
+	if(index<0)
+		return false;
+
+	//verify the attribute table
+	if((ent) && (attrTable_.tableType()!=TeAttrEvent) && (attrTable_.tableType()!=TeFixedGeomDynAttr))
+		return false;
+ 	
+	//object_id
+	string linkName; 
+	if(attrTable_.tableType() != TeAttrExternal)
+		linkName = attrTable_.name() +"."+ attrTable_.linkName(); 
+	else
+		linkName = params_->theme()->collectionTable() +".c_object_id "; 
+
+	if(params_->hasSpatialRes())
+		selectClause = " MIN("+ linkName +")";		
+	else
+		selectClause = linkName;	
+	linkIndex_[0]=0;
+
+	if(ent)
+	{
+		//date
+		initialTime = attrTable_.name() +"."+ attrTable_.attInitialTime();
+		
+		groupByClause = db->getSQLTemporalFunction(params_->chronon(), initialTime);
+		if(!params_->hasSpatialRes())
+			groupByClause += ","+ linkName;
+				
+		selectClause += ", MAX("+ initialTime +")";
+		timeIndex1_[0]=1;
+		timeIndex2_[0]=1;
+	}
+	else 
+		groupByClause = linkName;
+
+	
+	//statistic
+	selectClause += ","+ db->getSQLStatistics(groupAttr);  
+	if(timeIndex1_[0]<0)
+		attrIndex1_=1;
+	else
+		attrIndex1_=2;
+	attrIndex2_ = attrIndex1_+(params_->groupAttr().size()-1);
+
+	//group index
+	selectClause += ", MIN("+ params_->theme()->collectionTable()+".c_legend_id )";
+	groupIndex_ = attrIndex2_+1;		
+
+	//---- from clause 
+	if(params_->hasSpatialRes())
+	{
+		groupByClause = ""; //It groups all attributes from all objects 
+		string gTable = params_->theme()->layer()->tableName(params_->geomRepRest());
+		fromClause = this->sqlFrom(gTable);
+	}
+	else
+		fromClause = this->sqlFrom();
+	
+	if(fromClause.empty())
+		return false;
+	
+	//where clause
+	if(!params_->objId().empty())
+		whereClause = linkName +" = '"+ params_->objId() +"'";  
+
+	//---------- querier restriction
+	string sqlQuerierRest = sqlWhereRestrictions();
+	if(!whereClause.empty())
+		whereClause += " AND ";
+
+	whereClause += sqlQuerierRest;
+
+	//----------
+	
+	string sql = " SELECT "+ selectClause; 
+	sql += " FROM "+ fromClause;
+	if(!whereClause.empty())
+		sql += " WHERE "+ whereClause; 
+	if(!groupByClause.empty())
+		sql += " GROUP BY "+ groupByClause;
+	
+	// ---------------------------------------------  Submit the query
+	
+	portals_.clear();
+	TeDatabasePortal* portal = db->getPortal();
+	
+	if(!portal)
+		return false;
+	
+	if(!portal->query(sql))
+	{
+		delete (portal);
+		flagPortal_ = false;
+		return false;
+	}
+
+	if(!portal->fetchRow())
+	{
+		delete (portal);
+		flagPortal_ = false;
+		return false;
+	}
+
+	string id = portal->getData(linkIndex_[0]); //object_Id
+	bool flag = true;
+	while(id.empty() && flag) 
+	{
+		flag = portal->fetchRow();
+		if(flag)
+			id = portal->getData(linkIndex_[0]); //object_Id
+	}
+	
+	if(id.empty() || (!flag)) //se o id �vazio ou chegou ao final do portal 
+	{
+		delete (portal);
+		flagPortal_ = false;
+		return false;
+	}
+
+	portals_.push_back (portal);
+	flagPortal_ = true;
+	return true;
+}
+
+
+bool
+TeQuerierDBStr2::fillSTO(TeSTInstance& sto)  
+{
+	if(portals_.empty())
+		return false;
+
+	TeDatabasePortal* portal = portals_[0]; 
+	if(!portal) 
+		return false; 
+
+	if(!flagPortal_) // end of portal
+	{
+		clearVectors();
+		return false; 
+	}
+
+	if(TSEntry_.timeFrame_ > -1)
+	{
+		// first : verify the time
+		TeTime t1 = portal->getDate(timeIndex1_[0]);		
+		t1.chronon ((TSEntry_.time_).intervalChronon());
+			
+		//if the time is before the requested interval 
+		while ( (TSEntry_.time_).before(t1) && flagPortal_)
+		{
+			flagPortal_ = portal->fetchRow();
+			t1 = portal->getDate(timeIndex1_[0]);
+			t1.chronon ((TSEntry_.time_).intervalChronon());
+		}
+	
+		if(!(TSEntry_.time_).during(t1))
+			return false;
+		
+		TeTimeInterval interval(t1, t1);
+		sto.timeInterval(interval);
+
+		timeFramePortal_ = (TSEntry_.timeFrame_)+1; //next time frame 
+	}
+
+	//if there is spatial restriction, it groups all instances of all objects
+	if(!params_->hasSpatialRes())
+	{
+		// get object_id
+		string objId = string(portal->getData(linkIndex_[0]));  // 0: object_id
+		sto.objectId (objId);
+		sto.addUniqueId (objId);
+
+		//get the group index
+		if(groupIndex_!=-1)
+		{
+			int gIndex = portal->getInt(groupIndex_);
+			sto.setSlice(legendIdGroup_[gIndex]);
+		}
+	}
+
+	//get property
+	for(int s=attrIndex1_; s<=attrIndex2_; ++s)  
+		sto.addPropertyValue(string(portal->getData(s)));
+
+	sto.setAttrList(attrList_);
+	flagPortal_ = portal->fetchRow();
+	return true;
+}
+
+
+bool
+TeQuerierDBStr2::loadInstances(TeTSEntry* ent) 
+{
+	if(!params_->theme())
+		return false;
+
+	//set a invalid box
+	TeBox box;
+	params_->box(box);
+
+	if(ent)
+	{
+		//if the portal was not initialised (timeFramePortal_==-1) or
+		//if the time frame requested is lesser than the time frame appointed by the portal
+		if((timeFramePortal_<0) || (ent->timeFrame_<timeFramePortal_))
+		{
+			if(!initPortal(ent))
+				return false;
+
+			timeFramePortal_ = 0;
+		}
+		TSEntry_ = (*ent);
+	}
+	else // no chronon
+	{
+		if(!initPortal())
+			return false;
+ 
+		timeFramePortal_ = -1;
+	}
+
+	attrList_->clear();
+	TeAttribute at;
+	TeGroupingAttr::iterator it = params()->groupAttr().begin();
+	while(it!=params()->groupAttr().end())
+	{
+		TeAttribute at;
+		at.rep_ = it->first;
+		attrList_->push_back (at);
+		++it;
+	}
+
+	return true;
+}
+
+bool
+TeQuerierDBStr2::fetchInstance(TeSTInstance&  sto) 
+{
+	sto.clear();
+
+	if(!fillSTO(sto))
+		return false; 
+	
+	//build a temporal serie to one object
+	string val;
+	sto.getPropertyValue(val, 0);
+	if((ts_) && (ts_->setTSEntryValue(TSEntry_.timeFrame_, atof(val.c_str()), TeDATA)))
+		filledSerie_ = true;
+	
+	return true;
+}
+
+int 
+TeQuerierDBStr2::numElemInstances()
+{
+	if((portals_.empty()))
+		return 0;
+
+	//get the first portal
+	if(!portals_[0])
+		return 0;
+
+	return (portals_[0]->numRows());
+}
+
+
diff --git a/src/terralib/kernel/TeQuerierDBStr2.h b/src/terralib/kernel/TeQuerierDBStr2.h
old mode 100755
new mode 100644
index d64b7fd..3127c71
--- a/src/terralib/kernel/TeQuerierDBStr2.h
+++ b/src/terralib/kernel/TeQuerierDBStr2.h
@@ -1,106 +1,106 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeQuerierDBStr2.h
-	\brief This file contains a mechanism named "TeQuerierDBStr2" that is 
-	responsible for loading spatio-temporal elements from a TerraLib database. 
-*/
-
-#ifndef  __TERRALIB_INTERNAL_QUERIER_DBSTR2_H
-#define  __TERRALIB_INTERNAL_QUERIER_DBSTR2_H
-
-#include "TeQuerierDB.h"
-#include "TeTemporalSeries.h"
-
-/*! \class TeQuerierDBStr2
-	\brief A class responsible for loading spatio-temporal elements from a TerraLib database.
-
-	This class implements a mechanism that is responsible for loading 
-	spatio-temporal elements from a TerraLib database, following a specific strategy (Strategy 2). 
-	Each spatio-temporal elements is represented through a TeSTInstance class. 
-	This class is internally used by the factory of queriers. It should NOT be used 
-	by anyone. This Strategy 2 works with simple chronon, without geometry, 
-	theme with collection table and existence operator in the DBMS.  
-
-	\sa
-	TeQuerierDB TeQuerierParams TeSTInstance 
-*/
-
-class TL_DLL TeQuerierDBStr2: public TeQuerierDB
-{
-private:
-	int				timeFramePortal_;  // the time frame appointed by the portal 
-	TeTSEntry		TSEntry_;
-	
-	/* @name Internal functions to initialize portals */
-	//@{
-	bool initPortal(TeTSEntry* ent=0); 
-	//@}
-
-	//! Internal function to fill STO
-	bool fillSTO(TeSTInstance& sto); 
-	
-public:
-	//! Constructor
-	TeQuerierDBStr2(TeQuerierParams* params): 
-		TeQuerierDB(params), 
-		timeFramePortal_(-1)
-	{} 
-
-	//! Loads the instances
-	bool loadInstances(TeTSEntry* ent=0); 
-
-	//! Returns each loaded STO
-	bool fetchInstance(TeSTInstance&  sto); 
-
-	//! Returns the number of instances 
-	int  numElemInstances();
-};
-
-/*! \class TeQuerierDBStr2Factory
-	\brief A class that define a factory to build a querier strategy (strategy 2) from TerraLib database.
-
-	\sa
-	TeQuerierImplFactory TeQuerierDBStr2
-*/
-class TL_DLL TeQuerierDBStr2Factory : public TeQuerierImplFactory
-{
-public:
-	//! Constructor
-	TeQuerierDBStr2Factory(const string& name) : TeQuerierImplFactory(name) {}
-
-	//! Builds a database querier
-	virtual TeQuerierImpl* build (const TeQuerierParams& arg)
-	{  
-		TeQuerierParams* tempArg = new TeQuerierParams();
-		*tempArg = arg;
-		return new TeQuerierDBStr2(tempArg); 
-	}
-};
-
-//! Creates a static factory to build TeQuerierDBStr2 
-namespace 
-{
-  static TeQuerierDBStr2Factory querierDBStr2("querierDBStr2");
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeQuerierDBStr2.h
+	\brief This file contains a mechanism named "TeQuerierDBStr2" that is 
+	responsible for loading spatio-temporal elements from a TerraLib database. 
+*/
+
+#ifndef  __TERRALIB_INTERNAL_QUERIER_DBSTR2_H
+#define  __TERRALIB_INTERNAL_QUERIER_DBSTR2_H
+
+#include "TeQuerierDB.h"
+#include "TeTemporalSeries.h"
+
+/*! \class TeQuerierDBStr2
+	\brief A class responsible for loading spatio-temporal elements from a TerraLib database.
+
+	This class implements a mechanism that is responsible for loading 
+	spatio-temporal elements from a TerraLib database, following a specific strategy (Strategy 2). 
+	Each spatio-temporal elements is represented through a TeSTInstance class. 
+	This class is internally used by the factory of queriers. It should NOT be used 
+	by anyone. This Strategy 2 works with simple chronon, without geometry, 
+	theme with collection table and existence operator in the DBMS.  
+
+	\sa
+	TeQuerierDB TeQuerierParams TeSTInstance 
+*/
+
+class TL_DLL TeQuerierDBStr2: public TeQuerierDB
+{
+private:
+	int				timeFramePortal_;  // the time frame appointed by the portal 
+	TeTSEntry		TSEntry_;
+	
+	/* @name Internal functions to initialize portals */
+	//@{
+	bool initPortal(TeTSEntry* ent=0); 
+	//@}
+
+	//! Internal function to fill STO
+	bool fillSTO(TeSTInstance& sto); 
+	
+public:
+	//! Constructor
+	TeQuerierDBStr2(TeQuerierParams* params): 
+		TeQuerierDB(params), 
+		timeFramePortal_(-1)
+	{} 
+
+	//! Loads the instances
+	bool loadInstances(TeTSEntry* ent=0); 
+
+	//! Returns each loaded STO
+	bool fetchInstance(TeSTInstance&  sto); 
+
+	//! Returns the number of instances 
+	int  numElemInstances();
+};
+
+/*! \class TeQuerierDBStr2Factory
+	\brief A class that define a factory to build a querier strategy (strategy 2) from TerraLib database.
+
+	\sa
+	TeQuerierImplFactory TeQuerierDBStr2
+*/
+class TL_DLL TeQuerierDBStr2Factory : public TeQuerierImplFactory
+{
+public:
+	//! Constructor
+	TeQuerierDBStr2Factory(const string& name) : TeQuerierImplFactory(name) {}
+
+	//! Builds a database querier
+	virtual TeQuerierImpl* build (const TeQuerierParams& arg)
+	{  
+		TeQuerierParams* tempArg = new TeQuerierParams();
+		*tempArg = arg;
+		return new TeQuerierDBStr2(tempArg); 
+	}
+};
+
+//! Creates a static factory to build TeQuerierDBStr2 
+namespace 
+{
+  static TeQuerierDBStr2Factory querierDBStr2("querierDBStr2");
+};
+
+#endif
diff --git a/src/terralib/kernel/TeQuerierDBStr3.cpp b/src/terralib/kernel/TeQuerierDBStr3.cpp
old mode 100755
new mode 100644
index 887d21a..55d7dcc
--- a/src/terralib/kernel/TeQuerierDBStr3.cpp
+++ b/src/terralib/kernel/TeQuerierDBStr3.cpp
@@ -1,421 +1,421 @@
- /************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <TeQuerierDBStr3.h>
-#include <TeDatabase.h>
-#include <TeSTInstance.h>
-#include <TeLayer.h>
-
-//It must group the attributes of ONE attribute table and 
-//load geometries of ONE representation (cells or points) 
-//It must be used with theme (with collection table)
-bool
-TeQuerierDBStr3::initPortal(TeTSEntry* ent)  
-{
-	string selectClause, fromClause, whereClause, groupByClause;
-	string initialTime, finalTime;
-	linkIndex_.clear();
-	linkIndex_.push_back(-1); 
-	attrIndex1_=-1;
-	attrIndex2_=-1;
-	timeIndex1_.clear();
-	timeIndex1_.push_back(-1);
-	timeIndex2_.clear();
-	timeIndex2_.push_back(-1);
-	geomIndex1_.clear();
-	geomIndex1_.push_back(-1);
-	groupIndex_=-1;
-
-	TeDatabase* db = params_->theme()->layer()->database();
-
-	if(params_->groupAttr().empty())
-		return false;
-
-	//get the table name
-	string tableName;
-	TeGroupingAttr groupAttr = params_->groupAttr();
-	TeGroupingAttr::iterator it = groupAttr.begin();
-	size_t pos = (it->first.name_).find(".", 0, 1);
-	if (pos != string::npos)
-		tableName = (it->first.name_).substr(0,pos);
-
-	//group information
-	legendIdGroup_.clear();
-	legendIdGroup_[0]=0;
-	TeLegendEntryVector& legVec = params_->theme()->legend();
-	for(unsigned int l=0; l<legVec.size(); ++l)
-		legendIdGroup_[legVec[l].id()]=legVec[l].group();
-			
-	clearVectors();
-
-	// ---------------------------------------------  Monut SQL
-	
-	//------- Select and Group By clause
-
-	//load the attribute table 
-	int index = -1;
-	unsigned int i=0;
-	TeAttrTableVector attr = params_->theme()->attrTables();
-	for(i=0; i<attr.size(); ++i)
-	{
-		if(TeConvertToUpperCase(attr[i].name()) == TeConvertToUpperCase(tableName))
-		{
-			index = i;
-			attrTable_ = attr[i];
-			break;
-		}
-	}
- 
-	//not find the table
-	if(index<0)
-		return false;
-
-	//verify the attribute table
-	if((ent) && (attrTable_.tableType()!=TeAttrEvent) && (attrTable_.tableType()!=TeFixedGeomDynAttr))
-		return false;
-
-	//geometric Table
-	TeAttributeList geomTableAttrs;
-	string geomTable;
-	if(params_->theme()->layer()->hasGeometry(TePOINTS))
-	{
-		geomTable = params_->theme()->layer()->tableName(TePOINTS);
-		if(!db->getAttributeList(geomTable, geomTableAttrs))
-			return false; 
-		rep_ = TePOINTS;
-	} 
-	else if (params_->theme()->layer()->hasGeometry(TeCELLS))
-	{
-		geomTable = params_->theme()->layer()->tableName(TeCELLS);
-		if(!db->getAttributeList(geomTable, geomTableAttrs))
-			return false; 
-		rep_ = TeCELLS;
-	}
-	else
-		return false; //this strategy is valid only for cells and point geometry
-
-	//object_id
-	string linkName = attrTable_.name() +"."+ attrTable_.linkName(); //geomTable.name()+ ".object_id ";
-	string uniqueIdName = attrTable_.name() +"."+ attrTable_.uniqueName(); 
-	
-	if(params_->hasSpatialRes())
-		selectClause = " MIN("+ linkName +")";		
-	else
-		selectClause = linkName;	
-	linkIndex_[0]=0;
-
-	if(ent)
-	{
-		//date
-		initialTime = attrTable_.name() +"."+ attrTable_.attInitialTime();
-
-		groupByClause = db->getSQLTemporalFunction(params_->chronon(), initialTime);
-		if(!params_->hasSpatialRes())
-			groupByClause += ","+ linkName;
-		
-		selectClause += ", MAX("+ initialTime +")";
-		timeIndex1_[0]=1;
-		timeIndex2_[0]=1;
-	}
-	else if(!params_->hasSpatialRes())
-		groupByClause = linkName;
-
-	//statistic
-	selectClause += ","+ db->getSQLStatistics(groupAttr);   
-	if(timeIndex1_[0]<0)
-		attrIndex1_=1;
-	else
-		attrIndex1_=2;
-	attrIndex2_ = attrIndex1_+(params_->groupAttr().size()-1);
-
-	//group index
-	selectClause += ", MIN("+ params_->theme()->collectionTable()+".c_legend_id )";
-	groupIndex_ = attrIndex2_+1;	
-	
-	//----- insert geometrical information in the select clause
-	for(i=0; i<geomTableAttrs.size(); ++i)
-		selectClause += ", MIN( "+ geomTable +"."+ geomTableAttrs[i].rep_.name_ +" ) AS "+ geomTableAttrs[i].rep_.name_;
-	geomIndex1_[0] = attrIndex2_+2;
-	//-----	
-
-	//------- From clause 
-	fromClause = this->sqlFrom(geomTable);
-	if(fromClause.empty())
-		return false;
-
-	//where clause
-	if(!params_->objId().empty())
-		whereClause = linkName +" = '"+ params_->objId() +"'";  
-
-	//---------- querier restriction
-	TeRepresentation rep;
-	rep.tableName_ = geomTable;
-	rep.geomRep_ = rep_;
-
-	string sqlQuerierRest = sqlWhereRestrictions(&rep);
-	if(!whereClause.empty())
-		whereClause += " AND ";
-
-	whereClause += sqlQuerierRest;
-
-	//----------
-	fromClause_ = fromClause;
-	whereClause_ = whereClause;
-
-	string sql = " SELECT "+ selectClause; 
-	sql += " FROM "+ fromClause; 
-	if(!whereClause.empty())
-		sql += " WHERE "+ whereClause; 
-	if(!groupByClause.empty())
-		sql += " GROUP BY "+ groupByClause;
-	
-	// ---------------------------------------------  Submit the query
-	
-	portals_.clear();
-	TeDatabasePortal* portal = db->getPortal();
-	
-	if(!portal)
-		return false;
-	
-	if(!portal->query(sql))
-	{
-		delete (portal);
-		flagPortal_ = false;
-		return false;
-	}
-
-	if(!portal->fetchRow())
-	{
-		delete (portal);
-		flagPortal_ = false;
-		return false;
-	}
-
-	string id = portal->getData(linkIndex_[0]); //object_Id
-	bool flag = true;
-	while(id.empty() && flag) 
-	{
-		flag = portal->fetchRow();
-		if(flag)
-			id = portal->getData(linkIndex_[0]); //object_Id
-	}
-	
-	if(id.empty() || (!flag))
-	{
-		delete (portal);
-		flagPortal_ = false;
-		return false;
-	}
-
-	portals_.push_back (portal);
-	flagPortal_ = true;
-	return true;
-}
-
-
-bool
-TeQuerierDBStr3::fillSTO(TeSTInstance& sto)  
-{
-	if(portals_.empty())
-		return false;
-
-	TeDatabasePortal* portal = portals_[0]; 
-	if(!portal) 
-		return false; 
-
-	if(!flagPortal_)  //end of portal
-	{
-		clearVectors();
-		return false; 
-	}
-
-	
-	// first : verify the time
-	if(TSEntry_.timeFrame_ > -1)
-	{
-		TeTime t1 = portal->getDate(timeIndex1_[0]);		
-		t1.chronon ((TSEntry_.time_).intervalChronon());
-		
-		//if the time is before the requested interval 
-		while ( (TSEntry_.time_).before(t1) && flagPortal_)
-		{
-			flagPortal_ = portal->fetchRow();
-			t1 = portal->getDate(timeIndex1_[0]);
-			t1.chronon ((TSEntry_.time_).intervalChronon());
-		}
-		
-		if(!(TSEntry_.time_).during(t1))
-			return false;
-		
-		TeTimeInterval interval(t1, t1);
-		sto.timeInterval(interval);
-
-		timeFramePortal_ = (TSEntry_.timeFrame_)+1; //next time frame 
-	}
-	
-	//if there is spatial restriction, it groups all instances of all objects
-	if(!params_->hasSpatialRes())
-	{
-		// get object_id
-		string objId = string(portal->getData(linkIndex_[0]));  // 0: object_id
-		sto.objectId (objId);
-		sto.addUniqueId (objId);
-
-		//get the group index
-		if(groupIndex_!=-1)
-		{
-			int gIndex = portal->getInt(groupIndex_);
-			sto.setSlice(legendIdGroup_[gIndex]);
-		}
-	}
-
-	sto.setAttrList(attrList_);
-
-	//get property
-	for(int s=attrIndex1_; s<=attrIndex2_; ++s)  
-		sto.addPropertyValue(portal->getData(s));
-
-	// get geometry 
-	if(rep_ == TePOINTS)
-	{
-		TePoint point;
-		flagPortal_ = portal->fetchGeometry(point,geomIndex1_[0]);
-		sto.addGeometry (point);
-	}
-	else
-	{
-		TeCell cell;
-		flagPortal_ = portal->fetchGeometry(cell, geomIndex1_[0]);
-		sto.addGeometry (cell);
-	}
-
-	return true;
-}
-
-
-bool
-TeQuerierDBStr3::loadInstances(TeTSEntry* ent) 
-{
-	if(!params_->theme())
-		return false;
-
-	//set a invalid box
-	TeBox box;
-	params_->box(box);
-
-	if(ent)
-	{
-		//if the portal was not initialised (timeFramePortal_==-1) or
-		//if the time frame requested is lesser than the time frame appointed by the portal
-		if((timeFramePortal_<0) || (ent->timeFrame_<timeFramePortal_))
-		{
-			if(!initPortal(ent))
-				return false;
-
-			timeFramePortal_ = 0;
-		}
-		TSEntry_ = (*ent);
-	}
-	else // no chronon
-	{
-		if(!initPortal())
-			return false;
- 
-		timeFramePortal_ = -1;
-	}
-
-	attrList_->clear();
-	TeAttribute at;
-	TeGroupingAttr::iterator it = params()->groupAttr().begin();
-	while(it!=params()->groupAttr().end())
-	{
-		TeAttribute at;
-		at.rep_ = it->first;
-		attrList_->push_back (at);
-		++it;
-	}
-
-	return true;
-}
-
-
-bool
-TeQuerierDBStr3::fetchInstance(TeSTInstance&  sto)
-{
-	sto.clear();
-
-	if(!fillSTO(sto))
-		return false; 
-	
-	//build a temporal serie to one object
-	string val;
-	sto.getPropertyValue(val, 0);
-	if((ts_) && (ts_->setTSEntryValue(TSEntry_.timeFrame_, atof(val.c_str()), TeDATA)))
-		filledSerie_ = true;
-	
-	updateBox(params_->box(), sto.getGeometries().getBox());
-	return true;
-}
-
-int 
-TeQuerierDBStr3::numElemInstances()
-{
-	//load the attribute tables
-	TeAttrTableVector atts; 
-	params_->theme()->getAttTables(atts); 
-	if(atts.empty())
-		return 0;
-
-	string selectClause = " DISTINCT ";
-	for(unsigned int i=0; i<atts.size(); ++i)
-	{
-		if(i>0)
-			selectClause+= ",";
-		selectClause+= atts[i].name() +"."+ atts[i].linkName();
-
-		if(atts[i].linkName()!=atts[i].uniqueName())
-			selectClause+= ","+ atts[i].name() +"."+ atts[i].uniqueName();
-	}
-	
-    string sql = "SELECT "+ selectClause + fromClause_;
-	if(!whereClause_.empty())
-		sql += " WHERE "+ whereClause_;
-
-	TeDatabasePortal* portal = params_->theme()->layer()->database()->getPortal();
-	if(!portal)
-		return 0;
-	
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete (portal);
-		return 0;
-	}
-	int result = portal->numRows();
-	delete portal;
-	return result;
-}
-
-
-
-
-
+ /************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <TeQuerierDBStr3.h>
+#include <TeDatabase.h>
+#include <TeSTInstance.h>
+#include <TeLayer.h>
+
+//It must group the attributes of ONE attribute table and 
+//load geometries of ONE representation (cells or points) 
+//It must be used with theme (with collection table)
+bool
+TeQuerierDBStr3::initPortal(TeTSEntry* ent)  
+{
+	string selectClause, fromClause, whereClause, groupByClause;
+	string initialTime, finalTime;
+	linkIndex_.clear();
+	linkIndex_.push_back(-1); 
+	attrIndex1_=-1;
+	attrIndex2_=-1;
+	timeIndex1_.clear();
+	timeIndex1_.push_back(-1);
+	timeIndex2_.clear();
+	timeIndex2_.push_back(-1);
+	geomIndex1_.clear();
+	geomIndex1_.push_back(-1);
+	groupIndex_=-1;
+
+	TeDatabase* db = params_->theme()->layer()->database();
+
+	if(params_->groupAttr().empty())
+		return false;
+
+	//get the table name
+	string tableName;
+	TeGroupingAttr groupAttr = params_->groupAttr();
+	TeGroupingAttr::iterator it = groupAttr.begin();
+	size_t pos = (it->first.name_).find(".", 0, 1);
+	if (pos != string::npos)
+		tableName = (it->first.name_).substr(0,pos);
+
+	//group information
+	legendIdGroup_.clear();
+	legendIdGroup_[0]=0;
+	TeLegendEntryVector& legVec = params_->theme()->legend();
+	for(unsigned int l=0; l<legVec.size(); ++l)
+		legendIdGroup_[legVec[l].id()]=legVec[l].group();
+			
+	clearVectors();
+
+	// ---------------------------------------------  Monut SQL
+	
+	//------- Select and Group By clause
+
+	//load the attribute table 
+	int index = -1;
+	unsigned int i=0;
+	TeAttrTableVector attr = params_->theme()->attrTables();
+	for(i=0; i<attr.size(); ++i)
+	{
+		if(TeConvertToUpperCase(attr[i].name()) == TeConvertToUpperCase(tableName))
+		{
+			index = i;
+			attrTable_ = attr[i];
+			break;
+		}
+	}
+ 
+	//not find the table
+	if(index<0)
+		return false;
+
+	//verify the attribute table
+	if((ent) && (attrTable_.tableType()!=TeAttrEvent) && (attrTable_.tableType()!=TeFixedGeomDynAttr))
+		return false;
+
+	//geometric Table
+	TeAttributeList geomTableAttrs;
+	string geomTable;
+	if(params_->theme()->layer()->hasGeometry(TePOINTS))
+	{
+		geomTable = params_->theme()->layer()->tableName(TePOINTS);
+		if(!db->getAttributeList(geomTable, geomTableAttrs))
+			return false; 
+		rep_ = TePOINTS;
+	} 
+	else if (params_->theme()->layer()->hasGeometry(TeCELLS))
+	{
+		geomTable = params_->theme()->layer()->tableName(TeCELLS);
+		if(!db->getAttributeList(geomTable, geomTableAttrs))
+			return false; 
+		rep_ = TeCELLS;
+	}
+	else
+		return false; //this strategy is valid only for cells and point geometry
+
+	//object_id
+	string linkName = attrTable_.name() +"."+ attrTable_.linkName(); //geomTable.name()+ ".object_id ";
+	string uniqueIdName = attrTable_.name() +"."+ attrTable_.uniqueName(); 
+	
+	if(params_->hasSpatialRes())
+		selectClause = " MIN("+ linkName +")";		
+	else
+		selectClause = linkName;	
+	linkIndex_[0]=0;
+
+	if(ent)
+	{
+		//date
+		initialTime = attrTable_.name() +"."+ attrTable_.attInitialTime();
+
+		groupByClause = db->getSQLTemporalFunction(params_->chronon(), initialTime);
+		if(!params_->hasSpatialRes())
+			groupByClause += ","+ linkName;
+		
+		selectClause += ", MAX("+ initialTime +")";
+		timeIndex1_[0]=1;
+		timeIndex2_[0]=1;
+	}
+	else if(!params_->hasSpatialRes())
+		groupByClause = linkName;
+
+	//statistic
+	selectClause += ","+ db->getSQLStatistics(groupAttr);   
+	if(timeIndex1_[0]<0)
+		attrIndex1_=1;
+	else
+		attrIndex1_=2;
+	attrIndex2_ = attrIndex1_+(params_->groupAttr().size()-1);
+
+	//group index
+	selectClause += ", MIN("+ params_->theme()->collectionTable()+".c_legend_id )";
+	groupIndex_ = attrIndex2_+1;	
+	
+	//----- insert geometrical information in the select clause
+	for(i=0; i<geomTableAttrs.size(); ++i)
+		selectClause += ", MIN( "+ geomTable +"."+ geomTableAttrs[i].rep_.name_ +" ) AS "+ geomTableAttrs[i].rep_.name_;
+	geomIndex1_[0] = attrIndex2_+2;
+	//-----	
+
+	//------- From clause 
+	fromClause = this->sqlFrom(geomTable);
+	if(fromClause.empty())
+		return false;
+
+	//where clause
+	if(!params_->objId().empty())
+		whereClause = linkName +" = '"+ params_->objId() +"'";  
+
+	//---------- querier restriction
+	TeRepresentation rep;
+	rep.tableName_ = geomTable;
+	rep.geomRep_ = rep_;
+
+	string sqlQuerierRest = sqlWhereRestrictions(&rep);
+	if(!whereClause.empty())
+		whereClause += " AND ";
+
+	whereClause += sqlQuerierRest;
+
+	//----------
+	fromClause_ = fromClause;
+	whereClause_ = whereClause;
+
+	string sql = " SELECT "+ selectClause; 
+	sql += " FROM "+ fromClause; 
+	if(!whereClause.empty())
+		sql += " WHERE "+ whereClause; 
+	if(!groupByClause.empty())
+		sql += " GROUP BY "+ groupByClause;
+	
+	// ---------------------------------------------  Submit the query
+	
+	portals_.clear();
+	TeDatabasePortal* portal = db->getPortal();
+	
+	if(!portal)
+		return false;
+	
+	if(!portal->query(sql))
+	{
+		delete (portal);
+		flagPortal_ = false;
+		return false;
+	}
+
+	if(!portal->fetchRow())
+	{
+		delete (portal);
+		flagPortal_ = false;
+		return false;
+	}
+
+	string id = portal->getData(linkIndex_[0]); //object_Id
+	bool flag = true;
+	while(id.empty() && flag) 
+	{
+		flag = portal->fetchRow();
+		if(flag)
+			id = portal->getData(linkIndex_[0]); //object_Id
+	}
+	
+	if(id.empty() || (!flag))
+	{
+		delete (portal);
+		flagPortal_ = false;
+		return false;
+	}
+
+	portals_.push_back (portal);
+	flagPortal_ = true;
+	return true;
+}
+
+
+bool
+TeQuerierDBStr3::fillSTO(TeSTInstance& sto)  
+{
+	if(portals_.empty())
+		return false;
+
+	TeDatabasePortal* portal = portals_[0]; 
+	if(!portal) 
+		return false; 
+
+	if(!flagPortal_)  //end of portal
+	{
+		clearVectors();
+		return false; 
+	}
+
+	
+	// first : verify the time
+	if(TSEntry_.timeFrame_ > -1)
+	{
+		TeTime t1 = portal->getDate(timeIndex1_[0]);		
+		t1.chronon ((TSEntry_.time_).intervalChronon());
+		
+		//if the time is before the requested interval 
+		while ( (TSEntry_.time_).before(t1) && flagPortal_)
+		{
+			flagPortal_ = portal->fetchRow();
+			t1 = portal->getDate(timeIndex1_[0]);
+			t1.chronon ((TSEntry_.time_).intervalChronon());
+		}
+		
+		if(!(TSEntry_.time_).during(t1))
+			return false;
+		
+		TeTimeInterval interval(t1, t1);
+		sto.timeInterval(interval);
+
+		timeFramePortal_ = (TSEntry_.timeFrame_)+1; //next time frame 
+	}
+	
+	//if there is spatial restriction, it groups all instances of all objects
+	if(!params_->hasSpatialRes())
+	{
+		// get object_id
+		string objId = string(portal->getData(linkIndex_[0]));  // 0: object_id
+		sto.objectId (objId);
+		sto.addUniqueId (objId);
+
+		//get the group index
+		if(groupIndex_!=-1)
+		{
+			int gIndex = portal->getInt(groupIndex_);
+			sto.setSlice(legendIdGroup_[gIndex]);
+		}
+	}
+
+	sto.setAttrList(attrList_);
+
+	//get property
+	for(int s=attrIndex1_; s<=attrIndex2_; ++s)  
+		sto.addPropertyValue(portal->getData(s));
+
+	// get geometry 
+	if(rep_ == TePOINTS)
+	{
+		TePoint point;
+		flagPortal_ = portal->fetchGeometry(point,geomIndex1_[0]);
+		sto.addGeometry (point);
+	}
+	else
+	{
+		TeCell cell;
+		flagPortal_ = portal->fetchGeometry(cell, geomIndex1_[0]);
+		sto.addGeometry (cell);
+	}
+
+	return true;
+}
+
+
+bool
+TeQuerierDBStr3::loadInstances(TeTSEntry* ent) 
+{
+	if(!params_->theme())
+		return false;
+
+	//set a invalid box
+	TeBox box;
+	params_->box(box);
+
+	if(ent)
+	{
+		//if the portal was not initialised (timeFramePortal_==-1) or
+		//if the time frame requested is lesser than the time frame appointed by the portal
+		if((timeFramePortal_<0) || (ent->timeFrame_<timeFramePortal_))
+		{
+			if(!initPortal(ent))
+				return false;
+
+			timeFramePortal_ = 0;
+		}
+		TSEntry_ = (*ent);
+	}
+	else // no chronon
+	{
+		if(!initPortal())
+			return false;
+ 
+		timeFramePortal_ = -1;
+	}
+
+	attrList_->clear();
+	TeAttribute at;
+	TeGroupingAttr::iterator it = params()->groupAttr().begin();
+	while(it!=params()->groupAttr().end())
+	{
+		TeAttribute at;
+		at.rep_ = it->first;
+		attrList_->push_back (at);
+		++it;
+	}
+
+	return true;
+}
+
+
+bool
+TeQuerierDBStr3::fetchInstance(TeSTInstance&  sto)
+{
+	sto.clear();
+
+	if(!fillSTO(sto))
+		return false; 
+	
+	//build a temporal serie to one object
+	string val;
+	sto.getPropertyValue(val, 0);
+	if((ts_) && (ts_->setTSEntryValue(TSEntry_.timeFrame_, atof(val.c_str()), TeDATA)))
+		filledSerie_ = true;
+	
+	updateBox(params_->box(), sto.getGeometries().getBox());
+	return true;
+}
+
+int 
+TeQuerierDBStr3::numElemInstances()
+{
+	//load the attribute tables
+	TeAttrTableVector atts; 
+	params_->theme()->getAttTables(atts); 
+	if(atts.empty())
+		return 0;
+
+	string selectClause = " DISTINCT ";
+	for(unsigned int i=0; i<atts.size(); ++i)
+	{
+		if(i>0)
+			selectClause+= ",";
+		selectClause+= atts[i].name() +"."+ atts[i].linkName();
+
+		if(atts[i].linkName()!=atts[i].uniqueName())
+			selectClause+= ","+ atts[i].name() +"."+ atts[i].uniqueName();
+	}
+	
+    string sql = "SELECT "+ selectClause + fromClause_;
+	if(!whereClause_.empty())
+		sql += " WHERE "+ whereClause_;
+
+	TeDatabasePortal* portal = params_->theme()->layer()->database()->getPortal();
+	if(!portal)
+		return 0;
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete (portal);
+		return 0;
+	}
+	int result = portal->numRows();
+	delete portal;
+	return result;
+}
+
+
+
+
+
diff --git a/src/terralib/kernel/TeQuerierDBStr3.h b/src/terralib/kernel/TeQuerierDBStr3.h
old mode 100755
new mode 100644
index 23dcbba..7836ed9
--- a/src/terralib/kernel/TeQuerierDBStr3.h
+++ b/src/terralib/kernel/TeQuerierDBStr3.h
@@ -1,112 +1,112 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeQuerierDBStr3.h
-	\brief This file contains a mechanism named "TeQuerierDBStr3" that is 
-	responsible for loading spatio-temporal elements from a TerraLib database.
-*/
-#ifndef  __TERRALIB_INTERNAL_QUERIER_DBSTR3_H
-#define  __TERRALIB_INTERNAL_QUERIER_DBSTR3_H
-
-#include "TeQuerierDB.h"
-#include "TeTemporalSeries.h"
-
-/*! \class TeQuerierDBStr3
-	\brief A class responsible for loading spatio-temporal elements from a TerraLib database.
-
-	This class implements a mechanism that is responsible for loading 
-	spatio-temporal elements from a TerraLib database, following a specific strategy (Strategy 3). 
-	Each spatio-temporal elements is represented through a TeSTInstance class. 
-	This class is internally used by the factory of queriers. It should NOT be used 
-	by anyone. This Strategy 2 works with simple chronon, with geometry (points or cells), 
-	theme with collection table and existence operator in the DBMS.  
-
-	\sa
-	TeQuerierDB TeQuerierParams TeSTInstance 
-*/
-
-class TL_DLL TeQuerierDBStr3: public TeQuerierDB
-{
-private:
-	int				timeFramePortal_;	// the time frame appointed by the portal 
-	TeTSEntry		TSEntry_;
-	TeGeomRep		rep_;
-
-	string						fromClause_;   //store the sql clause(from and where) to return the number of instances
-	string						whereClause_;
-		
-	/* @name Internal functions to initialize portals */
-	//@{
-	bool initPortal(TeTSEntry* ent=0); 
-	//@}
-
-	//! Internal function to fill STO
-	bool fillSTO(TeSTInstance& sto); 
-	
-public:	
-	//! Constructor
-	TeQuerierDBStr3(TeQuerierParams* params): 
-		TeQuerierDB(params), 
-		timeFramePortal_(-1),
-		fromClause_(""),
-		whereClause_("")
-	{} 
-
-	//! Loads the instances
-	bool loadInstances(TeTSEntry* ent=0); 
-
-	//! Returns each loaded STO
-	bool fetchInstance(TeSTInstance&  sto); 
-
-	//! Returns the number of instances 
-	int  numElemInstances();
-};
-
-/*! \class TeQuerierDBStr3Factory
-	\brief A class that define a factory to build a querier strategy (strategy 3) from TerraLib database.
-
-	\sa
-	TeQuerierImplFactory TeQuerierDBStr3
-*/
-class TL_DLL TeQuerierDBStr3Factory : public TeQuerierImplFactory
-{
-public:
-
-	//! Constructor
-	TeQuerierDBStr3Factory(const string& name) : TeQuerierImplFactory(name) {}
-
-	//! Builds a database querier
-	virtual TeQuerierImpl* build (const TeQuerierParams& arg)
-	{  
-		TeQuerierParams* tempArg = new TeQuerierParams();
-		*tempArg = arg;
-		return new TeQuerierDBStr3(tempArg); 
-	}
-};
-
-//! Creates a static factory to build TeQuerierDBStr3 
-namespace 
-{
-  static TeQuerierDBStr3Factory querierDBStr3("querierDBStr3");
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeQuerierDBStr3.h
+	\brief This file contains a mechanism named "TeQuerierDBStr3" that is 
+	responsible for loading spatio-temporal elements from a TerraLib database.
+*/
+#ifndef  __TERRALIB_INTERNAL_QUERIER_DBSTR3_H
+#define  __TERRALIB_INTERNAL_QUERIER_DBSTR3_H
+
+#include "TeQuerierDB.h"
+#include "TeTemporalSeries.h"
+
+/*! \class TeQuerierDBStr3
+	\brief A class responsible for loading spatio-temporal elements from a TerraLib database.
+
+	This class implements a mechanism that is responsible for loading 
+	spatio-temporal elements from a TerraLib database, following a specific strategy (Strategy 3). 
+	Each spatio-temporal elements is represented through a TeSTInstance class. 
+	This class is internally used by the factory of queriers. It should NOT be used 
+	by anyone. This Strategy 2 works with simple chronon, with geometry (points or cells), 
+	theme with collection table and existence operator in the DBMS.  
+
+	\sa
+	TeQuerierDB TeQuerierParams TeSTInstance 
+*/
+
+class TL_DLL TeQuerierDBStr3: public TeQuerierDB
+{
+private:
+	int				timeFramePortal_;	// the time frame appointed by the portal 
+	TeTSEntry		TSEntry_;
+	TeGeomRep		rep_;
+
+	string						fromClause_;   //store the sql clause(from and where) to return the number of instances
+	string						whereClause_;
+		
+	/* @name Internal functions to initialize portals */
+	//@{
+	bool initPortal(TeTSEntry* ent=0); 
+	//@}
+
+	//! Internal function to fill STO
+	bool fillSTO(TeSTInstance& sto); 
+	
+public:	
+	//! Constructor
+	TeQuerierDBStr3(TeQuerierParams* params): 
+		TeQuerierDB(params), 
+		timeFramePortal_(-1),
+		fromClause_(""),
+		whereClause_("")
+	{} 
+
+	//! Loads the instances
+	bool loadInstances(TeTSEntry* ent=0); 
+
+	//! Returns each loaded STO
+	bool fetchInstance(TeSTInstance&  sto); 
+
+	//! Returns the number of instances 
+	int  numElemInstances();
+};
+
+/*! \class TeQuerierDBStr3Factory
+	\brief A class that define a factory to build a querier strategy (strategy 3) from TerraLib database.
+
+	\sa
+	TeQuerierImplFactory TeQuerierDBStr3
+*/
+class TL_DLL TeQuerierDBStr3Factory : public TeQuerierImplFactory
+{
+public:
+
+	//! Constructor
+	TeQuerierDBStr3Factory(const string& name) : TeQuerierImplFactory(name) {}
+
+	//! Builds a database querier
+	virtual TeQuerierImpl* build (const TeQuerierParams& arg)
+	{  
+		TeQuerierParams* tempArg = new TeQuerierParams();
+		*tempArg = arg;
+		return new TeQuerierDBStr3(tempArg); 
+	}
+};
+
+//! Creates a static factory to build TeQuerierDBStr3 
+namespace 
+{
+  static TeQuerierDBStr3Factory querierDBStr3("querierDBStr3");
+};
+
+#endif
diff --git a/src/terralib/kernel/TeQuerierImpl.cpp b/src/terralib/kernel/TeQuerierImpl.cpp
old mode 100755
new mode 100644
index 1894bda..46b993b
--- a/src/terralib/kernel/TeQuerierImpl.cpp
+++ b/src/terralib/kernel/TeQuerierImpl.cpp
@@ -1,144 +1,144 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeQuerierImpl.h"
-#include "TeTemporalSeries.h"
-
-	
-TeQuerierImpl::TeQuerierImpl(TeQuerierParams* par): params_(par), filledSerie_(false)
-{
-	TeAttributeList* att = new TeAttributeList();
-	attrList_ = TeSharedPtr<TeAttributeList>(att);
-	ts_ = 0;
-	if(par->chronon()!=TeNOCHRONON) //if there is a chronon, build ts
-	{
-		TeGroupingAttr::iterator it = par->groupAttr().begin();
-		if(it!=par->groupAttr().end())
-			ts_ = new TeTemporalSeries(par->theme(), par->objId(), par->chronon(), it->first.name_, it->first.name_, it->second, it->second);
-		else
-			ts_ = new TeTemporalSeries(par->chronon(), par->theme());
-		ts_->buildFrameIntervals();
-	}
-}
-
-TeQuerierImpl::TeQuerierImpl( const TeQuerierImpl& other)
-{
-	if(ts_)
-		delete ts_;
-
-	if(params_)
-		delete params_;
-
-	ts_ = 0;
-	params_ = 0;
-	if(other.params_) 
-	{
-		params_ = new TeQuerierParams();
-		*params_ = *(other.params_);
-	}
-	filledSerie_ = other.filledSerie_;
-	attrList_ = other.attrList_;
-}
-
-TeQuerierImpl& 
-TeQuerierImpl::operator= (const TeQuerierImpl& other)
-{
-	if ( this != &other )
-	{
-		if(ts_)
-			delete ts_;
-
-		if(params_)
-			delete params_;
-
-		ts_ = 0;
-		params_ = 0;
-		if(other.params_) 
-		{
-			params_ = new TeQuerierParams();
-			*params_ = *(other.params_);
-		}
-		filledSerie_ = other.filledSerie_;
-		attrList_ = other.attrList_;
-	}
-	return *this;
-}
-
-TeQuerierImpl::~TeQuerierImpl() 
-{	
-	if(ts_)
-		delete (ts_);
-
-	if(params_)
-		delete params_;
-}
-
-bool 
-TeQuerierImpl::loadTimeFrameInstances(int frame)
-{
-	if(frame>-1) 
-	{
-		TeTSEntry ent;
-		if(!getTSEntry(ent, frame))
-			return false;
-		
-		return(loadInstances(&ent));
-	}
-	else
-		return(loadInstances());
-}
-
-bool 
-TeQuerierImpl::getTSEntry(TeTSEntry& tsEntry, int frame)
-{
-	if(!ts_)
-		return false;
-
-	return(ts_->getTSEntry(tsEntry, frame)); 
-}
-
-int 
-TeQuerierImpl::getNumTimeFrames()
-{
-	if(!ts_)
-		return 0;
-
-	return (ts_->numTimeFrames());
-}
-
-bool 
-TeQuerierImpl::getTS(TeTemporalSeries& ts)
-{
-	if(!ts_)
-		return false;
-	
-	ts = (*ts_);
-	return true;
-}
-
-TeTSParams& 
-TeQuerierImpl::getTSParams() 
-{ 
-	return (ts_->TSparams_); 
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeQuerierImpl.h"
+#include "TeTemporalSeries.h"
+
+	
+TeQuerierImpl::TeQuerierImpl(TeQuerierParams* par): params_(par), filledSerie_(false)
+{
+	TeAttributeList* att = new TeAttributeList();
+	attrList_ = TeSharedPtr<TeAttributeList>(att);
+	ts_ = 0;
+	if(par->chronon()!=TeNOCHRONON) //if there is a chronon, build ts
+	{
+		TeGroupingAttr::iterator it = par->groupAttr().begin();
+		if(it!=par->groupAttr().end())
+			ts_ = new TeTemporalSeries(par->theme(), par->objId(), par->chronon(), it->first.name_, it->first.name_, it->second, it->second);
+		else
+			ts_ = new TeTemporalSeries(par->chronon(), par->theme());
+		ts_->buildFrameIntervals();
+	}
+}
+
+TeQuerierImpl::TeQuerierImpl( const TeQuerierImpl& other)
+{
+	if(ts_)
+		delete ts_;
+
+	if(params_)
+		delete params_;
+
+	ts_ = 0;
+	params_ = 0;
+	if(other.params_) 
+	{
+		params_ = new TeQuerierParams();
+		*params_ = *(other.params_);
+	}
+	filledSerie_ = other.filledSerie_;
+	attrList_ = other.attrList_;
+}
+
+TeQuerierImpl& 
+TeQuerierImpl::operator= (const TeQuerierImpl& other)
+{
+	if ( this != &other )
+	{
+		if(ts_)
+			delete ts_;
+
+		if(params_)
+			delete params_;
+
+		ts_ = 0;
+		params_ = 0;
+		if(other.params_) 
+		{
+			params_ = new TeQuerierParams();
+			*params_ = *(other.params_);
+		}
+		filledSerie_ = other.filledSerie_;
+		attrList_ = other.attrList_;
+	}
+	return *this;
+}
+
+TeQuerierImpl::~TeQuerierImpl() 
+{	
+	if(ts_)
+		delete (ts_);
+
+	if(params_)
+		delete params_;
+}
+
+bool 
+TeQuerierImpl::loadTimeFrameInstances(int frame)
+{
+	if(frame>-1) 
+	{
+		TeTSEntry ent;
+		if(!getTSEntry(ent, frame))
+			return false;
+		
+		return(loadInstances(&ent));
+	}
+	else
+		return(loadInstances());
+}
+
+bool 
+TeQuerierImpl::getTSEntry(TeTSEntry& tsEntry, int frame)
+{
+	if(!ts_)
+		return false;
+
+	return(ts_->getTSEntry(tsEntry, frame)); 
+}
+
+int 
+TeQuerierImpl::getNumTimeFrames()
+{
+	if(!ts_)
+		return 0;
+
+	return (ts_->numTimeFrames());
+}
+
+bool 
+TeQuerierImpl::getTS(TeTemporalSeries& ts)
+{
+	if(!ts_)
+		return false;
+	
+	ts = (*ts_);
+	return true;
+}
+
+TeTSParams& 
+TeQuerierImpl::getTSParams() 
+{ 
+	return (ts_->TSparams_); 
+}
+
diff --git a/src/terralib/kernel/TeQuerierImpl.h b/src/terralib/kernel/TeQuerierImpl.h
old mode 100755
new mode 100644
index adfb440..d675147
--- a/src/terralib/kernel/TeQuerierImpl.h
+++ b/src/terralib/kernel/TeQuerierImpl.h
@@ -1,122 +1,122 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeQuerierDB.h
-	\brief This file deals an abstract querier class to build STOs (Spatial Temporal Objects)
-*/
-#ifndef  __TERRALIB_INTERNAL_QUERIER_IMPL_H
-#define  __TERRALIB_INTERNAL_QUERIER_IMPL_H
-
-#include "TeQuerierParams.h"
-#include "TeFactory.h" 
-#include "TeSharedPtr.h" 
-
-class TeTSEntry;
-class TeTSParams;
-class TeSTInstance;
-class TeTemporalSeries;
-class TeMultiGeometry;
-
-//! An abstract querier class to build STOs (Spatial Temporal Objects)
-class TL_DLL TeQuerierImpl
-{
-protected:
-	//! querier parameters that define the used querier strategy  
-	TeQuerierParams*				params_;
-	TeTemporalSeries*				ts_;			//! temporal series
-	bool							filledSerie_;	//! this flag indicates if the temporal serie was filled 
-	TeSharedPtr<TeAttributeList>	attrList_;		//! list of the attributes of the querier 
-		
-public:
-	//! Constructor
-	TeQuerierImpl(TeQuerierParams* par); 
-
-	//! Copy constructor
-	TeQuerierImpl( const TeQuerierImpl& other);
-
-	//! Operator =
-	TeQuerierImpl& operator= (const TeQuerierImpl& other);
-
-	//! Destructor
-	virtual ~TeQuerierImpl(); 
-
-	//! Returns the object identifier
-	string objectId() { return params_->objId();}
-
-	//! Returns the theme pointer
-	TeTheme* theme() { return params_->theme();} 
-
-	//! Loads the STOs
-	bool loadTimeFrameInstances(int frame=-1); 
-
-	//! Gets each temporal serie entry, for each time frame
-	bool getTSEntry(TeTSEntry& tsEntry, int frame);
-	
-	//! Gets the number of generated time frames 
-	int getNumTimeFrames(); 
-
-	//! Gets the full temporal serie
-	bool getTS(TeTemporalSeries& ts);
-
-	//! Returns the temporal serie params
-	TeTSParams& getTSParams();
-
-	//! Gets the attribute list from querier
-	TeAttributeList getAttrList() { return (*attrList_); }
-
-	//! Returns a default object
-	static TeQuerierImpl* DefaultObject(const TeQuerierParams& /*params*/)  { return 0; }
-
-	//! Returns the querier parameters
-	TeQuerierParams* params() { return params_; }
-	
-	//! Loads the STOs
-	virtual bool loadInstances(TeTSEntry* ent=0) = 0; 
-	
-	//! Returns each loaded STO
-	virtual bool fetchInstance(TeSTInstance& stoi)= 0;  
-
-	//! Loads all geometries of the index-th geometry representation  
-	virtual bool loadGeometries(TeMultiGeometry& geometries, unsigned int& index) = 0; 
-
-	//! Loads all geometries 
-	virtual bool loadGeometries(TeMultiGeometry& geometries) = 0;
-
-	//! Returns the number of instances to each time frame
-	virtual int numElemInstances() { return 0;}
-
-	//! Empties querier instances
-	virtual void clear() { return; }
-};
-
-//! A class that define a factory to build querier strategies 
-class TL_DLL TeQuerierImplFactory : public TeFactory<TeQuerierImpl, TeQuerierParams>
-{
-public:
-	//! Builds an appropriate decoder from a identifier
-	TeQuerierImplFactory(const string& name) : TeFactory<TeQuerierImpl, TeQuerierParams>(name) { }
-
-	//! Destructor
-	virtual ~TeQuerierImplFactory() {}
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeQuerierDB.h
+	\brief This file deals an abstract querier class to build STOs (Spatial Temporal Objects)
+*/
+#ifndef  __TERRALIB_INTERNAL_QUERIER_IMPL_H
+#define  __TERRALIB_INTERNAL_QUERIER_IMPL_H
+
+#include "TeQuerierParams.h"
+#include "TeFactory.h" 
+#include "TeSharedPtr.h" 
+
+class TeTSEntry;
+class TeTSParams;
+class TeSTInstance;
+class TeTemporalSeries;
+class TeMultiGeometry;
+
+//! An abstract querier class to build STOs (Spatial Temporal Objects)
+class TL_DLL TeQuerierImpl
+{
+protected:
+	//! querier parameters that define the used querier strategy  
+	TeQuerierParams*				params_;
+	TeTemporalSeries*				ts_;			//! temporal series
+	bool							filledSerie_;	//! this flag indicates if the temporal serie was filled 
+	TeSharedPtr<TeAttributeList>	attrList_;		//! list of the attributes of the querier 
+		
+public:
+	//! Constructor
+	TeQuerierImpl(TeQuerierParams* par); 
+
+	//! Copy constructor
+	TeQuerierImpl( const TeQuerierImpl& other);
+
+	//! Operator =
+	TeQuerierImpl& operator= (const TeQuerierImpl& other);
+
+	//! Destructor
+	virtual ~TeQuerierImpl(); 
+
+	//! Returns the object identifier
+	string objectId() { return params_->objId();}
+
+	//! Returns the theme pointer
+	TeTheme* theme() { return params_->theme();} 
+
+	//! Loads the STOs
+	bool loadTimeFrameInstances(int frame=-1); 
+
+	//! Gets each temporal serie entry, for each time frame
+	bool getTSEntry(TeTSEntry& tsEntry, int frame);
+	
+	//! Gets the number of generated time frames 
+	int getNumTimeFrames(); 
+
+	//! Gets the full temporal serie
+	bool getTS(TeTemporalSeries& ts);
+
+	//! Returns the temporal serie params
+	TeTSParams& getTSParams();
+
+	//! Gets the attribute list from querier
+	TeAttributeList getAttrList() { return (*attrList_); }
+
+	//! Returns a default object
+	static TeQuerierImpl* DefaultObject(const TeQuerierParams& /*params*/)  { return 0; }
+
+	//! Returns the querier parameters
+	TeQuerierParams* params() { return params_; }
+	
+	//! Loads the STOs
+	virtual bool loadInstances(TeTSEntry* ent=0) = 0; 
+	
+	//! Returns each loaded STO
+	virtual bool fetchInstance(TeSTInstance& stoi)= 0;  
+
+	//! Loads all geometries of the index-th geometry representation  
+	virtual bool loadGeometries(TeMultiGeometry& geometries, unsigned int& index) = 0; 
+
+	//! Loads all geometries 
+	virtual bool loadGeometries(TeMultiGeometry& geometries) = 0;
+
+	//! Returns the number of instances to each time frame
+	virtual int numElemInstances() { return 0;}
+
+	//! Empties querier instances
+	virtual void clear() { return; }
+};
+
+//! A class that define a factory to build querier strategies 
+class TL_DLL TeQuerierImplFactory : public TeFactory<TeQuerierImpl, TeQuerierParams>
+{
+public:
+	//! Builds an appropriate decoder from a identifier
+	TeQuerierImplFactory(const string& name) : TeFactory<TeQuerierImpl, TeQuerierParams>(name) { }
+
+	//! Destructor
+	virtual ~TeQuerierImplFactory() {}
+};
+
+#endif
diff --git a/src/terralib/kernel/TeQuerierParams.cpp b/src/terralib/kernel/TeQuerierParams.cpp
old mode 100755
new mode 100644
index 2cd2587..8e07106
--- a/src/terralib/kernel/TeQuerierParams.cpp
+++ b/src/terralib/kernel/TeQuerierParams.cpp
@@ -1,286 +1,286 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation. 
-*************************************************************************************/
-
-#include "TeQuerierParams.h" 
-#include "TeDatabase.h"
-
-TeQuerierParams::~TeQuerierParams()
-{
-	if(themeFlag_)
-		delete theme_;
-}
-
-TeQuerierParams::TeQuerierParams(const TeQuerierParams& rhs)
-{
-	loadGeometries_ = rhs.loadGeometries_;  
-	loadAllAttributes_ = rhs.loadAllAttributes_;
-	loadAttrNames_ = rhs.loadAttrNames_;
-	loadAttrNamesSeted_ = rhs.loadAttrNamesSeted_;
-	themeFlag_ = false;
-	layer_ = rhs.layer_;
-
-	if ((rhs.themeFlag_) && layer_)
-	{
-		theme_ = new TeTheme("theme_", layer_); 
-		TeAttrTableVector attrTables;
-		layer_->getAttrTables(attrTables);
-		theme_->setAttTables(attrTables);
-		themeFlag_ = true;
-	}
-	else
-		theme_ = rhs.theme_;
-
-	fileName_ = rhs.fileName_;
-	chr_ = rhs.chr_;
-	objId_ = rhs.objId_;
-	groupingAttr_ = rhs.groupingAttr_;
-	strategy_ = rhs.strategy_;
-
-	//restrictions
-	selectedObjs_ = rhs.selectedObjs_;  
-	spatialRelation_ = rhs.spatialRelation_; 
-	hasSpatialRes_ = rhs.hasSpatialRes_; 
-	boxRest_ = rhs.boxRest_;	
-	geomRest_ = rhs.geomRest_;
-	geomRepRest_ = rhs.geomRepRest_;
-}
-
-
-TeQuerierParams&
-TeQuerierParams::operator=(const TeQuerierParams& rhs)
-{
-	if (&rhs != this)
-	{
-		loadGeometries_ = rhs.loadGeometries_;  
-		loadAllAttributes_ = rhs.loadAllAttributes_;
-		loadAttrNames_ = rhs.loadAttrNames_;
-		loadAttrNamesSeted_ = rhs.loadAttrNamesSeted_;
-		themeFlag_ = false;
-		layer_ = rhs.layer_;
-
-		if ((rhs.themeFlag_) && layer_)
-		{
-			theme_ = new TeTheme("theme_", layer_); 
-			TeAttrTableVector attrTables;
-			layer_->getAttrTables(attrTables);
-			theme_->setAttTables(attrTables);
-			themeFlag_ = true;
-		}
-		else
-			theme_ = rhs.theme_;
-
-		fileName_ = rhs.fileName_;
-		chr_ = rhs.chr_;
-		objId_ = rhs.objId_;
-		groupingAttr_ = rhs.groupingAttr_;
-		strategy_ = rhs.strategy_;
-
-		//restrictions
-		selectedObjs_ = rhs.selectedObjs_;  
-		spatialRelation_ = rhs.spatialRelation_; 
-		hasSpatialRes_ = rhs.hasSpatialRes_; 
-		boxRest_ = rhs.boxRest_;	
-		geomRest_ = rhs.geomRest_;
-		geomRepRest_ = rhs.geomRepRest_;
-	}
-	return *this;
-}
-
-void 
-TeQuerierParams::setParams(TeLayer* layer)
-{
-	layer_ = layer;
-	if(theme_ == 0)
-	{
-		theme_ = new TeTheme("theme_", layer_); 
-		TeAttrTableVector attrTables;
-		theme_->layer(layer_);
-		layer_->getAttrTables(attrTables);
-		theme_->setAttTables(attrTables);
-		themeFlag_ = true;
-	}
-	strategy_ = "querierDBStr1";
-}	
-
-void 
-TeQuerierParams::setParams(TeTheme* theme, TeChronon chr)
-{
-	theme_ = theme;
-	chr_ = chr;
-	strategy_ = "querierDBStr1"; 
-
-	bool geomRep = (theme_->layer()->hasGeometry (TeCELLS) || theme_->layer()->hasGeometry (TePOINTS));
-	int numRepres = theme_->layer()->vectRepres().size();
-	
-	bool groupAttr = !(groupingAttr_.empty());
-	bool hasOneTable = true;
-
-	if(groupAttr)
-	{
-		string lastTable = "";
-		TeGroupingAttr::iterator it = groupingAttr_.begin();
-		while(it!=groupingAttr_.end())
-		{
-			string tableName;
-			size_t pos = (it->first.name_).find(".", 0, 1);
-			if (pos != string::npos)
-				tableName = (it->first.name_).substr(0,pos);
-
-			if((!lastTable.empty()) && (lastTable!=tableName))
-			{
-				hasOneTable = false;
-				break;
-			}
-			lastTable = tableName;
-			++it;
-		}
-		
-		//verify if the statistis can be calculated by SGBD
-		TeGroupingAttr groups = groupingAttr_; 
-		string sGroup = theme->layer()->database()->getSQLStatistics(groups);
-		TeGroupingAttr::iterator itgroup = groups.begin();
-		while(itgroup!= groups.end())
-		{
-			if(itgroup->second != TeNOSTATISTIC)
-			{
-				strategy_ = "querierDBStr1";
-				return;
-			}
-			++itgroup;
-		}
-	}
-
-	if( groupAttr && hasOneTable && (!loadGeom()))
-		strategy_ = "querierDBStr2";
-	else if( groupAttr && hasOneTable && loadGeom() && geomRep && (numRepres==1))
-		strategy_ = "querierDBStr3";
-
-	return;
-}
-
-void 
-TeQuerierParams::setParams(TeTheme* theme, const string& objId, TeChronon chr)
-{
-	objId_ = objId;
-	setParams(theme, chr);
-}
-
-void 
-TeQuerierParams::setParams(const string& fileName, TeChronon chr)
-{
-	fileName_ = fileName;
-	chr_ = chr;
-	strategy_ = "querierSHP";
-}
-
-
-void 
-TeQuerierParams::setFillParams(bool loadGeom, bool loadAllAttr, vector<string> loadAttr)
-{
-	loadGeometries_ = loadGeom;
-	loadAllAttributes_ = loadAllAttr;
-	
-	if(!loadAttr.empty()) 
-		loadAllAttributes_ = false;
-	
-	loadAttrNames_ = loadAttr;
-	loadAttrNamesSeted_ = loadAttr;
-	groupingAttr_.clear(); 
-
-	if(theme_)
-		setParams(theme_, objId_, chr_);
-}
-
-void 
-TeQuerierParams::setFillParams(bool loadGeom, TeGroupingAttr attrG)
-{
-	loadGeometries_ = loadGeom;
-	loadAttrNames_.clear(); 
-	loadAttrNamesSeted_.clear(); 
-	groupingAttr_ = attrG;
-
-	if(theme_)
-		setParams(theme_, objId_, chr_);
-}
-
-void 
-TeQuerierParams::setSpatialRest(TeBox& box, int relation, TeGeomRep rep)
-{
-	hasSpatialRes_ = true;
-	boxRest_ = box;
-	spatialRelation_ = relation;
-	
-	if(rep==TeGEOMETRYNONE)
-		geomRepRest_ = theme_->layer()->vectRepres()[0]->geomRep_;
-	else
-		geomRepRest_ = rep;
-	
-	geomRest_ = 0;
-}
-
-void 
-TeQuerierParams::setSpatialRest(TeGeometry* geom, int relation, TeGeomRep rep)
-{
-	hasSpatialRes_ = true;
-	geomRest_ = geom;
-	spatialRelation_ = relation;
-	
-	if(rep==TeGEOMETRYNONE)
-		geomRepRest_ = theme_->layer()->vectRepres()[0]->geomRep_;
-	else
-		geomRepRest_ = rep;
-	
-	boxRest_ = TeBox();
-}
-
-TeBox& 
-TeQuerierParams::box()
-{
-	return box_; 
-}
-
-void
-TeQuerierParams::clear()
-{
-	loadAttrNames_.clear();			
-	loadAttrNamesSeted_.clear();	
-	groupingAttr_.clear();
-	if(themeFlag_)
-		delete theme_;
-	themeFlag_=false;
-	theme_ = 0;
-	layer_ = 0;				
-	fileName_ = "";
-	box_ = TeBox();
-	chr_ = TeNOCHRONON; 
-	objId_ = "";
-	strategy_="";
-	selectedObjs_=TeAll;  
-	spatialRelation_=TeUNDEFINEDREL;	
-	hasSpatialRes_ = false;		
-	boxRest_=TeBox();
-	geomRest_=0;	
-	geomRepRest_=TeGEOMETRYNONE;	
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation. 
+*************************************************************************************/
+
+#include "TeQuerierParams.h" 
+#include "TeDatabase.h"
+
+TeQuerierParams::~TeQuerierParams()
+{
+	if(themeFlag_)
+		delete theme_;
+}
+
+TeQuerierParams::TeQuerierParams(const TeQuerierParams& rhs)
+{
+	loadGeometries_ = rhs.loadGeometries_;  
+	loadAllAttributes_ = rhs.loadAllAttributes_;
+	loadAttrNames_ = rhs.loadAttrNames_;
+	loadAttrNamesSeted_ = rhs.loadAttrNamesSeted_;
+	themeFlag_ = false;
+	layer_ = rhs.layer_;
+
+	if ((rhs.themeFlag_) && layer_)
+	{
+		theme_ = new TeTheme("theme_", layer_); 
+		TeAttrTableVector attrTables;
+		layer_->getAttrTables(attrTables);
+		theme_->setAttTables(attrTables);
+		themeFlag_ = true;
+	}
+	else
+		theme_ = rhs.theme_;
+
+	fileName_ = rhs.fileName_;
+	chr_ = rhs.chr_;
+	objId_ = rhs.objId_;
+	groupingAttr_ = rhs.groupingAttr_;
+	strategy_ = rhs.strategy_;
+
+	//restrictions
+	selectedObjs_ = rhs.selectedObjs_;  
+	spatialRelation_ = rhs.spatialRelation_; 
+	hasSpatialRes_ = rhs.hasSpatialRes_; 
+	boxRest_ = rhs.boxRest_;	
+	geomRest_ = rhs.geomRest_;
+	geomRepRest_ = rhs.geomRepRest_;
+}
+
+
+TeQuerierParams&
+TeQuerierParams::operator=(const TeQuerierParams& rhs)
+{
+	if (&rhs != this)
+	{
+		loadGeometries_ = rhs.loadGeometries_;  
+		loadAllAttributes_ = rhs.loadAllAttributes_;
+		loadAttrNames_ = rhs.loadAttrNames_;
+		loadAttrNamesSeted_ = rhs.loadAttrNamesSeted_;
+		themeFlag_ = false;
+		layer_ = rhs.layer_;
+
+		if ((rhs.themeFlag_) && layer_)
+		{
+			theme_ = new TeTheme("theme_", layer_); 
+			TeAttrTableVector attrTables;
+			layer_->getAttrTables(attrTables);
+			theme_->setAttTables(attrTables);
+			themeFlag_ = true;
+		}
+		else
+			theme_ = rhs.theme_;
+
+		fileName_ = rhs.fileName_;
+		chr_ = rhs.chr_;
+		objId_ = rhs.objId_;
+		groupingAttr_ = rhs.groupingAttr_;
+		strategy_ = rhs.strategy_;
+
+		//restrictions
+		selectedObjs_ = rhs.selectedObjs_;  
+		spatialRelation_ = rhs.spatialRelation_; 
+		hasSpatialRes_ = rhs.hasSpatialRes_; 
+		boxRest_ = rhs.boxRest_;	
+		geomRest_ = rhs.geomRest_;
+		geomRepRest_ = rhs.geomRepRest_;
+	}
+	return *this;
+}
+
+void 
+TeQuerierParams::setParams(TeLayer* layer)
+{
+	layer_ = layer;
+	if(theme_ == 0)
+	{
+		theme_ = new TeTheme("theme_", layer_); 
+		TeAttrTableVector attrTables;
+		theme_->layer(layer_);
+		layer_->getAttrTables(attrTables);
+		theme_->setAttTables(attrTables);
+		themeFlag_ = true;
+	}
+	strategy_ = "querierDBStr1";
+}	
+
+void 
+TeQuerierParams::setParams(TeTheme* theme, TeChronon chr)
+{
+	theme_ = theme;
+	chr_ = chr;
+	strategy_ = "querierDBStr1"; 
+
+	bool geomRep = (theme_->layer()->hasGeometry (TeCELLS) || theme_->layer()->hasGeometry (TePOINTS));
+	int numRepres = theme_->layer()->vectRepres().size();
+	
+	bool groupAttr = !(groupingAttr_.empty());
+	bool hasOneTable = true;
+
+	if(groupAttr)
+	{
+		string lastTable = "";
+		TeGroupingAttr::iterator it = groupingAttr_.begin();
+		while(it!=groupingAttr_.end())
+		{
+			string tableName;
+			size_t pos = (it->first.name_).find(".", 0, 1);
+			if (pos != string::npos)
+				tableName = (it->first.name_).substr(0,pos);
+
+			if((!lastTable.empty()) && (lastTable!=tableName))
+			{
+				hasOneTable = false;
+				break;
+			}
+			lastTable = tableName;
+			++it;
+		}
+		
+		//verify if the statistis can be calculated by SGBD
+		TeGroupingAttr groups = groupingAttr_; 
+		string sGroup = theme->layer()->database()->getSQLStatistics(groups);
+		TeGroupingAttr::iterator itgroup = groups.begin();
+		while(itgroup!= groups.end())
+		{
+			if(itgroup->second != TeNOSTATISTIC)
+			{
+				strategy_ = "querierDBStr1";
+				return;
+			}
+			++itgroup;
+		}
+	}
+
+	if( groupAttr && hasOneTable && (!loadGeom()))
+		strategy_ = "querierDBStr2";
+	else if( groupAttr && hasOneTable && loadGeom() && geomRep && (numRepres==1))
+		strategy_ = "querierDBStr3";
+
+	return;
+}
+
+void 
+TeQuerierParams::setParams(TeTheme* theme, const string& objId, TeChronon chr)
+{
+	objId_ = objId;
+	setParams(theme, chr);
+}
+
+void 
+TeQuerierParams::setParams(const string& fileName, TeChronon chr)
+{
+	fileName_ = fileName;
+	chr_ = chr;
+	strategy_ = "querierSHP";
+}
+
+
+void 
+TeQuerierParams::setFillParams(bool loadGeom, bool loadAllAttr, vector<string> loadAttr)
+{
+	loadGeometries_ = loadGeom;
+	loadAllAttributes_ = loadAllAttr;
+	
+	if(!loadAttr.empty()) 
+		loadAllAttributes_ = false;
+	
+	loadAttrNames_ = loadAttr;
+	loadAttrNamesSeted_ = loadAttr;
+	groupingAttr_.clear(); 
+
+	if(theme_)
+		setParams(theme_, objId_, chr_);
+}
+
+void 
+TeQuerierParams::setFillParams(bool loadGeom, TeGroupingAttr attrG)
+{
+	loadGeometries_ = loadGeom;
+	loadAttrNames_.clear(); 
+	loadAttrNamesSeted_.clear(); 
+	groupingAttr_ = attrG;
+
+	if(theme_)
+		setParams(theme_, objId_, chr_);
+}
+
+void 
+TeQuerierParams::setSpatialRest(TeBox& box, int relation, TeGeomRep rep)
+{
+	hasSpatialRes_ = true;
+	boxRest_ = box;
+	spatialRelation_ = relation;
+	
+	if(rep==TeGEOMETRYNONE)
+		geomRepRest_ = theme_->layer()->vectRepres()[0]->geomRep_;
+	else
+		geomRepRest_ = rep;
+	
+	geomRest_ = 0;
+}
+
+void 
+TeQuerierParams::setSpatialRest(TeGeometry* geom, int relation, TeGeomRep rep)
+{
+	hasSpatialRes_ = true;
+	geomRest_ = geom;
+	spatialRelation_ = relation;
+	
+	if(rep==TeGEOMETRYNONE)
+		geomRepRest_ = theme_->layer()->vectRepres()[0]->geomRep_;
+	else
+		geomRepRest_ = rep;
+	
+	boxRest_ = TeBox();
+}
+
+TeBox& 
+TeQuerierParams::box()
+{
+	return box_; 
+}
+
+void
+TeQuerierParams::clear()
+{
+	loadAttrNames_.clear();			
+	loadAttrNamesSeted_.clear();	
+	groupingAttr_.clear();
+	if(themeFlag_)
+		delete theme_;
+	themeFlag_=false;
+	theme_ = 0;
+	layer_ = 0;				
+	fileName_ = "";
+	box_ = TeBox();
+	chr_ = TeNOCHRONON; 
+	objId_ = "";
+	strategy_="";
+	selectedObjs_=TeAll;  
+	spatialRelation_=TeUNDEFINEDREL;	
+	hasSpatialRes_ = false;		
+	boxRest_=TeBox();
+	geomRest_=0;	
+	geomRepRest_=TeGEOMETRYNONE;	
+}
+
+
diff --git a/src/terralib/kernel/TeQuerierParams.h b/src/terralib/kernel/TeQuerierParams.h
old mode 100755
new mode 100644
index 22dfe1f..1b3ac0f
--- a/src/terralib/kernel/TeQuerierParams.h
+++ b/src/terralib/kernel/TeQuerierParams.h
@@ -1,233 +1,233 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeQuerierParams.h
-	\brief This file contains a class responsible for defining the querier mechanism behavior. 
-*/
-
-#ifndef  __TERRALIB_INTERNAL_QUERIER_PARAMS_H
-#define  __TERRALIB_INTERNAL_QUERIER_PARAMS_H
-
-#include "TeTheme.h"
-
-/*! \class TeQuerierParams
-	\brief A class responsible for defining the querier mechanism behavior.
-
-	This class contains a set of attributes that define the querier behavior, 
-	for example, which instances the querier will load or if the querier will load
-	the geometries and which attributes.
-	It is used in the querier constructor. 
-
-	\sa
-	TeQuerier
-*/
-class TL_DLL TeQuerierParams
-{
-protected:	
-	bool					loadGeometries_;		//!< if the querier must load the geometries of each instance
-	bool					loadAllAttributes_;		//!< if the querier must load all attributes of each instance
-	vector<string>			loadAttrNames_;			//!< which attributes the querier must load
-	vector<string>			loadAttrNamesSeted_;	//!< internal structure
-	TeGroupingAttr			groupingAttr_;			//!< which attributes will be load and which aggregate function will be used in each attribute 
-	
-	bool					themeFlag_;		//!< if the theme is temporary
-	TeTheme*				theme_;			//!< pointer to a source theme 
-	TeLayer*				layer_;			//!< pointer to a source layer 
-	
-	string					fileName_;		//!< source file name (.shp, etc)
-	TeBox					box_;			//!< minimal bounding box that contains all geometries returned by this querier 
-
-	TeChronon				chr_;		//!< chronon used to generate time frames 
-	string					objId_;		//!< object identification
-	
-	//TeStatisticType		tsOper_;		//operator used in the construction of temporal series
-	
-	string					strategy_;		//! querier strategy name
-
-	TeSelectedObjects		selectedObjs_;  //!< if the querier must load only the instances pointed or queried
-	
-	int						spatialRelation_;	//!< spatial relation used by spatial restriction
-	bool					hasSpatialRes_;		//!< Verifies if there is a spatial restriction defined 
-	TeBox					boxRest_;			//!< A bounding box used by spatial restriction 
-	TeGeometry*				geomRest_;			//!< A geometry pointer used by spatial restriction 
-	TeGeomRep				geomRepRest_;		//!< geometric representation of the theme that will be considered by spatial restriction  
-
-public:
-	//! Constructor
-	TeQuerierParams(bool loadGeom = false, bool loadAllAttr = true): 
-			loadGeometries_(loadGeom),
-			loadAllAttributes_(loadAllAttr),
-			themeFlag_(false),
-			theme_ (0),
-			layer_ (0),
-			fileName_(""),
-			box_(TeBox()),
-			chr_ (TeNOCHRONON),
-			objId_(""),
-			selectedObjs_(TeAll),
-			spatialRelation_(0),
-			hasSpatialRes_(false),
-			geomRest_(0)
-			{ }
-
-	//! Constructor
-	TeQuerierParams(bool loadGeom, const vector<string>& loadAttr): 
-			loadGeometries_(loadGeom),
-			loadAllAttributes_(false),
-			themeFlag_(false),
-			theme_ (0),
-			layer_ (0),
-			fileName_(""),
-			box_(TeBox()),
-			chr_ (TeNOCHRONON),
-			objId_(""),
-			selectedObjs_(TeAll),
-			spatialRelation_(0),
-			hasSpatialRes_(false),
-			geomRest_(0)
-			{
-				loadAttrNamesSeted_.clear();
-				loadAttrNamesSeted_ = loadAttr;
-			}
-
-
-	//! Constructor
-	TeQuerierParams(bool loadGeom, TeGroupingAttr& groupAttr): 
-			loadGeometries_(loadGeom),
-			loadAllAttributes_(false),
-			themeFlag_(false),
-			theme_ (0),
-			layer_ (0),
-			fileName_(""),
-			box_(TeBox()),
-			chr_ (TeNOCHRONON),
-			objId_(""),
-			selectedObjs_(TeAll),
-			spatialRelation_(0),
-			hasSpatialRes_(false),
-			geomRest_(0)
-			{
-				groupingAttr_.clear();
-				groupingAttr_ = groupAttr;
-			}
-	
-	//! Destructor
-	virtual ~TeQuerierParams();
-
-	//! Copy Constructor
-	TeQuerierParams(const TeQuerierParams& qp);
-
-	//! Assignment operator
-	virtual TeQuerierParams& operator=(const TeQuerierParams& rhs);
-
-	//! Sets the layer that will be used as source of instances 
-	virtual void setParams(TeLayer* layer);
-
-	//! Sets the theme that will be used as source of instances and a chronon that defines the time frames
-	virtual void setParams(TeTheme* theme, TeChronon chr=TeNOCHRONON); 
-
-	//! Sets the theme that will be used as source of instances of a specific object and a chronon that defines the time frames
-	virtual void setParams(TeTheme* theme, const string& objId, TeChronon chr=TeNOCHRONON);
-
-	//! Sets the file name that will be used as source of instances and a chronon that defines the time frames
-	virtual void setParams(const string& fileName, TeChronon chr=TeNOCHRONON);
-	
-	//! Sets the parameters used to fill the instances 
-	virtual void setFillParams(bool loadGeom, bool loadAllAttr, vector<string> loadAttr = vector<string>());
-
-	//! Sets the parameters used to fill the instances
-	virtual void setFillParams(bool loadGeom, TeGroupingAttr attrG);
-	
-	//! Sets a spatial restriction (a spatial relation and a bounding box) 
-	virtual void setSpatialRest(TeBox& box, int relation = TeWITHIN, TeGeomRep rep = TeGEOMETRYNONE); 
-
-	//! Sets a spatial restriction (a spatial relation and a geometry) 
-	virtual void setSpatialRest(TeGeometry* geom, int relation = TeWITHIN, TeGeomRep rep = TeGEOMETRYNONE); 
-
-	//! Sets the selected objects
-	virtual void setSelecetObjs(TeSelectedObjects so) { selectedObjs_ = so; }
-
-	//! Sets which attributes must be loaded
-	virtual void setLoadAttrs(const vector<string>& vec) { loadAttrNames_ = vec; }
-
-	//! Returns the identification of the strategy associated to the querier
-	virtual string decName() const { return strategy_; }
-
-	//! Returns the source theme
-	virtual TeTheme* theme() { return theme_; }
-
-	//! Returns the source layer
-	virtual TeLayer* layer() { return layer_; }
-
-	//! Returns the source file name
-	virtual string fileName() { return fileName_; }
-
-	//! Returns the minimal bounding box
-	virtual TeBox& box();
-
-	//! Sets the minimal bounding box 
-	virtual void box(TeBox& b) { box_ = b; }
-
-	//! Returns the chronon used to create the time frames
-	virtual TeChronon chronon()	{ return chr_; }
-	
-	//! Returns the object identification
-	virtual string objId() { return objId_; }
-	
-	//! Returns which attributes will be loaded and how they will be grouped
-	virtual TeGroupingAttr& groupAttr() { return groupingAttr_;}
-
-	//! Returns if the querier must load the geometries
-	virtual bool loadGeom ()  { return	loadGeometries_; }
-	
-	//! Returns if the querier must load all attributes
-	virtual bool loadAllAttr() { return loadAllAttributes_;}
-
-	//! Returns the subset of attributes that will be loaded
-	virtual vector<string>& loadAttrs() { return loadAttrNames_;}
-
-	//! Internal function. Returns the subset of attributes that will be loaded
-	virtual vector<string>& loadSetedAttrs() { return loadAttrNamesSeted_;}
-
-	//! Returns which objects must be loaded
-	virtual TeSelectedObjects selectedObjs() { return selectedObjs_; }
-	
-	//! Returns the spatial relation 
-	virtual int spatialRelation() { return spatialRelation_; }
-
-	//! Verifies if there is a spatial restriction defined
-	virtual bool hasSpatialRes() { return hasSpatialRes_;}
-	
-	//! Returns the bounding box associated to the spatial restriction
-	virtual TeBox boxRest() { return boxRest_; } 
-
-	//! Returns the geometry associated to the spatial restriction
-	virtual TeGeometry* geomRest() { return geomRest_; }
-
-	//! Returns which theme geometric representation must be considered by the spatial restriction  
-	virtual TeGeomRep  geomRepRest() { return geomRepRest_; }
-
-	//! Clear querier params
-	virtual void clear();
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeQuerierParams.h
+	\brief This file contains a class responsible for defining the querier mechanism behavior. 
+*/
+
+#ifndef  __TERRALIB_INTERNAL_QUERIER_PARAMS_H
+#define  __TERRALIB_INTERNAL_QUERIER_PARAMS_H
+
+#include "TeTheme.h"
+
+/*! \class TeQuerierParams
+	\brief A class responsible for defining the querier mechanism behavior.
+
+	This class contains a set of attributes that define the querier behavior, 
+	for example, which instances the querier will load or if the querier will load
+	the geometries and which attributes.
+	It is used in the querier constructor. 
+
+	\sa
+	TeQuerier
+*/
+class TL_DLL TeQuerierParams
+{
+protected:	
+	bool					loadGeometries_;		//!< if the querier must load the geometries of each instance
+	bool					loadAllAttributes_;		//!< if the querier must load all attributes of each instance
+	vector<string>			loadAttrNames_;			//!< which attributes the querier must load
+	vector<string>			loadAttrNamesSeted_;	//!< internal structure
+	TeGroupingAttr			groupingAttr_;			//!< which attributes will be load and which aggregate function will be used in each attribute 
+	
+	bool					themeFlag_;		//!< if the theme is temporary
+	TeTheme*				theme_;			//!< pointer to a source theme 
+	TeLayer*				layer_;			//!< pointer to a source layer 
+	
+	string					fileName_;		//!< source file name (.shp, etc)
+	TeBox					box_;			//!< minimal bounding box that contains all geometries returned by this querier 
+
+	TeChronon				chr_;		//!< chronon used to generate time frames 
+	string					objId_;		//!< object identification
+	
+	//TeStatisticType		tsOper_;		//operator used in the construction of temporal series
+	
+	string					strategy_;		//! querier strategy name
+
+	TeSelectedObjects		selectedObjs_;  //!< if the querier must load only the instances pointed or queried
+	
+	int						spatialRelation_;	//!< spatial relation used by spatial restriction
+	bool					hasSpatialRes_;		//!< Verifies if there is a spatial restriction defined 
+	TeBox					boxRest_;			//!< A bounding box used by spatial restriction 
+	TeGeometry*				geomRest_;			//!< A geometry pointer used by spatial restriction 
+	TeGeomRep				geomRepRest_;		//!< geometric representation of the theme that will be considered by spatial restriction  
+
+public:
+	//! Constructor
+	TeQuerierParams(bool loadGeom = false, bool loadAllAttr = true): 
+			loadGeometries_(loadGeom),
+			loadAllAttributes_(loadAllAttr),
+			themeFlag_(false),
+			theme_ (0),
+			layer_ (0),
+			fileName_(""),
+			box_(TeBox()),
+			chr_ (TeNOCHRONON),
+			objId_(""),
+			selectedObjs_(TeAll),
+			spatialRelation_(0),
+			hasSpatialRes_(false),
+			geomRest_(0)
+			{ }
+
+	//! Constructor
+	TeQuerierParams(bool loadGeom, const vector<string>& loadAttr): 
+			loadGeometries_(loadGeom),
+			loadAllAttributes_(false),
+			themeFlag_(false),
+			theme_ (0),
+			layer_ (0),
+			fileName_(""),
+			box_(TeBox()),
+			chr_ (TeNOCHRONON),
+			objId_(""),
+			selectedObjs_(TeAll),
+			spatialRelation_(0),
+			hasSpatialRes_(false),
+			geomRest_(0)
+			{
+				loadAttrNamesSeted_.clear();
+				loadAttrNamesSeted_ = loadAttr;
+			}
+
+
+	//! Constructor
+	TeQuerierParams(bool loadGeom, TeGroupingAttr& groupAttr): 
+			loadGeometries_(loadGeom),
+			loadAllAttributes_(false),
+			themeFlag_(false),
+			theme_ (0),
+			layer_ (0),
+			fileName_(""),
+			box_(TeBox()),
+			chr_ (TeNOCHRONON),
+			objId_(""),
+			selectedObjs_(TeAll),
+			spatialRelation_(0),
+			hasSpatialRes_(false),
+			geomRest_(0)
+			{
+				groupingAttr_.clear();
+				groupingAttr_ = groupAttr;
+			}
+	
+	//! Destructor
+	virtual ~TeQuerierParams();
+
+	//! Copy Constructor
+	TeQuerierParams(const TeQuerierParams& qp);
+
+	//! Assignment operator
+	virtual TeQuerierParams& operator=(const TeQuerierParams& rhs);
+
+	//! Sets the layer that will be used as source of instances 
+	virtual void setParams(TeLayer* layer);
+
+	//! Sets the theme that will be used as source of instances and a chronon that defines the time frames
+	virtual void setParams(TeTheme* theme, TeChronon chr=TeNOCHRONON); 
+
+	//! Sets the theme that will be used as source of instances of a specific object and a chronon that defines the time frames
+	virtual void setParams(TeTheme* theme, const string& objId, TeChronon chr=TeNOCHRONON);
+
+	//! Sets the file name that will be used as source of instances and a chronon that defines the time frames
+	virtual void setParams(const string& fileName, TeChronon chr=TeNOCHRONON);
+	
+	//! Sets the parameters used to fill the instances 
+	virtual void setFillParams(bool loadGeom, bool loadAllAttr, vector<string> loadAttr = vector<string>());
+
+	//! Sets the parameters used to fill the instances
+	virtual void setFillParams(bool loadGeom, TeGroupingAttr attrG);
+	
+	//! Sets a spatial restriction (a spatial relation and a bounding box) 
+	virtual void setSpatialRest(TeBox& box, int relation = TeWITHIN, TeGeomRep rep = TeGEOMETRYNONE); 
+
+	//! Sets a spatial restriction (a spatial relation and a geometry) 
+	virtual void setSpatialRest(TeGeometry* geom, int relation = TeWITHIN, TeGeomRep rep = TeGEOMETRYNONE); 
+
+	//! Sets the selected objects
+	virtual void setSelecetObjs(TeSelectedObjects so) { selectedObjs_ = so; }
+
+	//! Sets which attributes must be loaded
+	virtual void setLoadAttrs(const vector<string>& vec) { loadAttrNames_ = vec; }
+
+	//! Returns the identification of the strategy associated to the querier
+	virtual string decName() const { return strategy_; }
+
+	//! Returns the source theme
+	virtual TeTheme* theme() { return theme_; }
+
+	//! Returns the source layer
+	virtual TeLayer* layer() { return layer_; }
+
+	//! Returns the source file name
+	virtual string fileName() { return fileName_; }
+
+	//! Returns the minimal bounding box
+	virtual TeBox& box();
+
+	//! Sets the minimal bounding box 
+	virtual void box(TeBox& b) { box_ = b; }
+
+	//! Returns the chronon used to create the time frames
+	virtual TeChronon chronon()	{ return chr_; }
+	
+	//! Returns the object identification
+	virtual string objId() { return objId_; }
+	
+	//! Returns which attributes will be loaded and how they will be grouped
+	virtual TeGroupingAttr& groupAttr() { return groupingAttr_;}
+
+	//! Returns if the querier must load the geometries
+	virtual bool loadGeom ()  { return	loadGeometries_; }
+	
+	//! Returns if the querier must load all attributes
+	virtual bool loadAllAttr() { return loadAllAttributes_;}
+
+	//! Returns the subset of attributes that will be loaded
+	virtual vector<string>& loadAttrs() { return loadAttrNames_;}
+
+	//! Internal function. Returns the subset of attributes that will be loaded
+	virtual vector<string>& loadSetedAttrs() { return loadAttrNamesSeted_;}
+
+	//! Returns which objects must be loaded
+	virtual TeSelectedObjects selectedObjs() { return selectedObjs_; }
+	
+	//! Returns the spatial relation 
+	virtual int spatialRelation() { return spatialRelation_; }
+
+	//! Verifies if there is a spatial restriction defined
+	virtual bool hasSpatialRes() { return hasSpatialRes_;}
+	
+	//! Returns the bounding box associated to the spatial restriction
+	virtual TeBox boxRest() { return boxRest_; } 
+
+	//! Returns the geometry associated to the spatial restriction
+	virtual TeGeometry* geomRest() { return geomRest_; }
+
+	//! Returns which theme geometric representation must be considered by the spatial restriction  
+	virtual TeGeomRep  geomRepRest() { return geomRepRest_; }
+
+	//! Clear querier params
+	virtual void clear();
+};
+
+#endif
diff --git a/src/terralib/kernel/TeRTree.h b/src/terralib/kernel/TeRTree.h
old mode 100755
new mode 100644
index 9868fae..fc23221
--- a/src/terralib/kernel/TeRTree.h
+++ b/src/terralib/kernel/TeRTree.h
@@ -1,980 +1,980 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file   TeRTree.h
-    \brief  This file contains an implementation of rtree data structures in main memory for two dimensions.
-	\note   These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
-	        THIS IS FOR INTERNAL USE ONLY.
-    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
-*/
-
-#ifndef  __TERRALIB_INTERNAL_RTREE_H
-#define  __TERRALIB_INTERNAL_RTREE_H
-
-#include "TeGeometry.h"
-#include "TeGeometryAlgorithms.h"
-
-/*! \brief This namespace contain the definitions of various Spatial Data Structures,
-           like K-d-Tree and R-Tree, ONLY FOR INTERNAL USE (must NOT be used by anyone).
-*/
-namespace TeSAM
-{
-//! Class that represents a node of a TeRTree
-/*!
-	If level is 0 so this is a leaf node otherwise this is a internal node.
-
-	WARNING:
-
-	1. A branch is a union, so be carefull with the types used here!
-	
- */
-template<class DATATYPE, int MAXNODES = 8, int MINNODES = MAXNODES / 2>
-class TeRTreeNode
-{
-	public:
-
-		//! Struct that represents a node-branch of a TeRTree
-		/*!
-			May be data or may be another subtree, if parents level is 0 so this is a data in a leaf node.
-
-		*/
-		struct TeRTreeBranch
-		{
-			TeBox rect_;	//!<	Bounding box for branch or object (if this is a leaf).
-
-			union
-			{
-				TeRTreeNode* child_;		//!< Child node pointer.
-				DATATYPE data_;				//!< Data Id or Ptr.
-			};
-		};
-
-	public:
-
-		int count_;			//!< Count.
-
-		int level_;			//!< Leaf is zero, others positive.
-
-		TeRTreeBranch branch_[MAXNODES];	//!< Branch.
-
-		//! Constructor.
-
-
-		TeRTreeNode()
-			: count_(0), level_(-1)
-		{
-		}
-
-		//! Returns true if this is a internal node.
-        bool isInternalNode() const
-		{
-			return (level_ > 0);
-		}
-
-		//! Returns true if this is a leaf node.
-        bool isLeaf() const
-		{
-			return (level_ == 0);
-		}
-
-		//! This method is used by split, when a node is re-filled.
-		void init()
-		{
-			count_ = 0;
-
-			level_ = -1;
-		}
-
-	private:
-
-		//! No copy allowed
-		TeRTreeNode(const TeRTreeNode& other);
-
-		//! No copy allowed
-		TeRTreeNode& operator=(const TeRTreeNode& other);
-
-};	// end of class TeRTreeNode
-
-//! A class that represents a two dimensional R-Tree
-/*!	
-	This implementation is based on:
-	Antonin Guttman. R-Trees: A Dynamic Index Structure for Spatial Searching. ACM SIGMOD: International Conference on Management of Data, 1984, pp. 47-57.	
-
-	and in his original source code. <BR>
-
-	WARNING: <BR>
-
-	1. Don't use this class! It is for TerraLib internal use. <BR>
-
-	2. Only the basic methods for inserting and searching were implemented. <BR>
-
-	3. In future we will implement: <BR>
-		- the delete method. <BR>
-		- the near query <BR>
-		- point query <BR>
- */
-template<class DATATYPE, int MAXNODES = 8, int MINNODES = MAXNODES / 2>
-class TeRTree
-{
-	public:
-
-		//! Export this typename.
-		typedef TeRTreeNode<DATATYPE, MAXNODES, MINNODES> TeRTreeNodeType;
-
-		//! Export this typename.
-		typedef typename TeRTreeNodeType::TeRTreeBranch TeRTreeBranch;
-
-	protected:
-
-		//! Structure of auxiliary variables for finding a split partition.
-		struct TePartitionVars
-		{
-			int partition_[MAXNODES + 1];	//!< Auxiliary partition vector.
-			int taken_[MAXNODES + 1];		//!< Flag to indicate that entry is ok.
-			int count_[2];					//!< Number of entries in each new page.
-			TeBox cover_[2];				//!< Auxiliary box of each new page.
-			double area_[2];				//!< Auxiliary area of each new page.
-
-			TeRTreeBranch branchBuf_[MAXNODES + 1];	//!< Auxiliary branch buffer.
-			TeBox coverSplit_;						//!< Auxiliary box covering branchBuf.
-
-			//! Initializes partition vars.
-			void init()
-			{
-				count_[0] = 0;
-				count_[1] = 0;
-
-                for(int i = 0; i <= MAXNODES; ++i)
-                {
-                    taken_[i] = 0;
-                    partition_[i] = -1;
-                }
-			}
-		};		
-		
-		TeRTreeNodeType* root_;		//!< Pointer to root node
-
-		TeBox mbr_;					//!< Bounding box of the tree
-        		
-		mutable unsigned int size_;			//!< The size of R-Tree (number of nodes)		
-
-	public:
-
-		//! Construtor
-		TeRTree(const TeBox& mbr)
-			: root_(0), mbr_(mbr), size_(0)
-		{
-			++size_;
-			root_ = new TeRTreeNodeType();
-            root_->level_ = 0;
-		}
-
-		//! Destructor
-		~TeRTree()
-		{
-			clear();
-
-			if(root_)
-				delete root_;
-		}
-
-		//! The number of elements of the tree
-		const unsigned int& size(void) const
-		{
-			return size_;
-		}
-		
-		//! Return true if the tree is empty
-		bool isEmpty(void) const
-		{
-			return (root_->count_ == 0);
-		}
-
-		//! Clear all tree nodes
-		void clear(void)
-		{
-			if(root_)
-			{
-				erase(root_);
-				root_ = 0;
-				
-				size_ = 1;
-				root_ = new TeRTreeNodeType();
-				root_->level_ = 0;
-			}
-		}
-
-		//! Inserts item into the tree
-		void insert(const TeBox& rect, const DATATYPE& data)
-		{
-			insert(rect, data, &root_, 0);
-		}
-
-		//! Removes item from tree
-		bool remove(const TeBox& rect, const DATATYPE& data)
-		{
-			return remove(rect, data, &root_);
-		}
-
-		//! Range search query
-		int search(const TeBox& rect, vector<DATATYPE>& report) const
-		{
-			int foundObjs = 0;
-
-			if(root_)
-				search(rect, root_, report, foundObjs);
-
-			return foundObjs;
-		}
-
-		//! Sets the bounding box of all elements in the tree
-		void setBox(const TeBox& mbr)
-		{
-			mbr_ = mbr;
-		}
-
-		//! Gets the bounding box of all elements in the tree
-		const TeBox& getBox(void) const
-		{
-			return mbr_;
-		}
-
-	protected:
-
-		//! Insert a data rectangle into an index structure.
-		/*!
-			Insert provides for splitting the root. <BR>
-			Returns true if root was split, false if it was not. <BR>
-			The level argument specifies the number of steps up from the leaf
-			level to insert; e.g. a data rectangle goes in at level = 0. <BR>
-			chooseLeaf does the recursion.
-		*/
-		inline bool insert(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType** root, int level);
-
-		//! Delete a data rectangle from an index structure.		   
-		/*!
-			Pass in a pointer to a Rect, the tid of the record, ptr to ptr to root node. <BR>
-			Returns 1 if record not found, 0 if success. <BR>
-			DeleteRect provides for eliminating the root.
-		*/
-		inline bool remove(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType** root);
-
-		//! Delete a rectangle from non-root part of an index structure.		   
-		/*!
-			Called by DeleteRect. <BR>
-			Descends tree recursively,
-			merges branches on the way back up.
-		*/
-		inline bool remove2(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType* n, vector<TeRTreeNodeType*>& ee);
-
-		//! Disconnect a dependent node.
-		inline void disconBranch(TeRTreeNodeType* n, int i);
-
-		//! Inserts a new data rectangle into the index structure.		   
-		/*!
-			Recursively descends tree, propagates splits back up.
-			Returns false if node was not split.  Old node updated.
-			If node was split, returns true and sets the pointer pointed to by
-			new to point to the new node.  Old node updated to become one of two.
-			The level argument specifies the number of steps up from the leaf
-			level to insert; e.g. a data rectangle goes in at level = 0.
-		*/
-		inline bool chooseLeaf(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType* node, TeRTreeNodeType** newNode, int level);
-
-		//! Recursive range query
-		inline void search(const TeBox& rect, TeRTreeNodeType* node, vector<DATATYPE>& report, int& foundObjs) const;
-
-		//! Find the smallest rectangle that includes all rectangles in branches of a node
-		inline TeBox nodeCover(TeRTreeNodeType* n) const;
-
-		//! Combine two rectangles into larger one containing both
-		inline TeBox combineRect(const TeBox& rectA, const TeBox& rectB) const;
-
-		//! Add a branch to a node.
-		/*!
-			Split the node if necessary. <BR>
-			Returns false if node not split. <BR>
-			Old node updated. <BR>
-			Returns true if node split, sets *new to address of new node. <BR>
-			Old node updated, becomes one of two.
-		*/
-		inline bool addBranch(TeRTreeBranch* branch, TeRTreeNodeType* node, TeRTreeNodeType** newNode) const;
-
-		//! Pick a branch.
-		/*!
-			Pick the one that will need the smallest increase
-			in area to accomodate the new rectangle.  This will result in the
-			least total area for the covering rectangles in the current node.
-			In case of a tie, pick the one which was smaller before, to get
-			the best resolution when searching.
-		*/
-		inline int pickBranch(const TeBox& rect, TeRTreeNodeType* node) const;
-
-		//! Split a node.
-		/*!
-			Divides the nodes branches and the extra one between two nodes. <BR>
-			Old node is one of the new ones, and one really new one is created.
-		*/
-		inline void splitNode(TeRTreeNodeType* node, TeRTreeBranch* branch, TeRTreeNodeType** newNode) const;
-
-		//! Load branch buffer with branches from full node plus the extra branch.
-		inline void getBranches(TeRTreeNodeType* n, TeRTreeBranch* b, TePartitionVars& p) const;
-
-		//! Method 0 for finding a partition.
-		/*!
-		   First find two seeds, one for each group, well separated.
-           Then put other rects in whichever group will be smallest after addition.
-	    */
-		inline void methodZero(TePartitionVars& p) const;
-
-		//! Pick two rects from set to be the first elements of the two groups.
-		/*!	
-		   Pick the two that are separated most along any dimension, or overlap least.
-           Distance for separation or overlap is measured modulo the width of the
-           space covered by the entire set along that dimension.
-	     */
-		inline void pickSeeds(TePartitionVars& p) const;
-
-		//! Put a branch in one of the groups
-		inline void classify(int i, int group, TePartitionVars& p) const;
-
-		//! Put each rect that is not already in a group into a group.
-		/*!	
-           Process one rect at a time, using the following hierarchy of criteria.
-           In case of a tie, go to the next test.<BR>
-           1) If one group already has the max number of elements that will allow
-              the minimum fill for the other group, put r in the other.<BR>
-           2) Put r in the group whose cover will expand less.  This automatically
-		      takes care of the case where one group cover contains r.<BR>
-		   3) Put r in the group whose cover will be smaller.  This takes care of the
-              case where r is contained in both covers.<BR>
-           4) Put r in the group with fewer elements.<BR>
-           5) Put in group 1 (arbitrary).<BR>
-
-           Also update the covers for both groups.
-	     */
-		inline void pigeonhole(TePartitionVars& p) const;
-
-		//! Copy branches from the buffer into two nodes according to the partition.
-		inline void loadNodes(TeRTreeNodeType* n, TeRTreeNodeType* q, TePartitionVars& p) const;
-
-		//! Calculate rect area
-		double rectArea(const TeBox& b) const
-		{
-			return b.width() * b.height();
-		}
-
-		//! Erases a node from the tree and all nodes below it.
-		void erase(TeRTreeNodeType* node)
-		{
-			if(node->isLeaf())
-			{
-				delete node;
-
-				return;
-			}
-
-			for(int i = 0u; i < node->count_; ++i)
-				erase(node->branch_[i].child_);
-	
-			delete node;
-
-			return;
-		}
-
-		//! Only to determine if the two box intersects withou using an epsilon
-		bool rtreeBoxIntersects(const TeBox& bx1, const TeBox& bx2) const
-		{
-			return ::TeIntersects(bx1, bx2);
-		}		
-
-	private:
-
-		//! No copy allowed
-		TeRTree(const TeRTree& other);
-
-		//! No copy allowed
-		TeRTree& operator=(const TeRTree& other);
-
-};	// end of class TeRTree
-
-
-//------------------- Implementation of the templates classes
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-bool TeRTree<DATATYPE, MAXNODES, MINNODES>::insert(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType** root, int level)
-{
-// this is the algorithm insert
-    TeRTreeNodeType* newRoot;
-	TeRTreeNodeType* newNode;
-    TeRTreeBranch    branch;
-
-    if(chooseLeaf(rect, data, *root, &newNode, level))  // I1
-    {
-// I4
-// if root was split
-// grow a new root, make tree taller
-		++size_;
-        newRoot = new TeRTreeNodeType();  
-
-        newRoot->level_ = (*root)->level_ + 1;
-
-// first half node
-        branch.rect_  = nodeCover(*root);
-        branch.child_ = *root;
-        addBranch(&branch, newRoot, 0);
-
-// second half node
-        branch.rect_ = nodeCover(newNode);
-        branch.child_ = newNode;        
-		addBranch(&branch, newRoot, 0);
-
-        *root = newRoot;
-
-        return true;
-    }
-
-    return false;
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-bool TeRTree<DATATYPE, MAXNODES, MINNODES>::remove(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType** root)
-{
-	int i;
-	TeRTreeNodeType *t;
-	vector<TeRTreeNodeType*> reInsertList;
-	
-	if(remove2(rect, data, *root, reInsertList))
-	{
-// if we are here, so we have found and deleted a data item
-
-// reinsert any branches from eliminated nodes
-		while(!reInsertList.empty())
-		{
-			t = reInsertList[0];
-			for(i = 0; i < t->count_; ++i)
-				insert(t->branch_[i].rect_, t->branch_[i].data_, root, t->level_);
-	
-// erase node from list
-			reInsertList.erase(reInsertList.begin());
-
-// remove node card from memory
-			delete t;
-			--size_;
-		}
-		
-		/* check for redundant root (not leaf, 1 child) and eliminate */
-		if(((*root)->count_ == 1) && ((*root)->isInternalNode()))
-		{
-			t = (*root)->branch_[0].child_;
-
-			delete (*root);
-			--size_;
-
-			*root = t;
-		}
-		
-		return true;
-	}
-	
-	return false;
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-bool TeRTree<DATATYPE, MAXNODES, MINNODES>::remove2(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType* n, vector<TeRTreeNodeType*>& ee)
-{
-	int i;	
-
-	if(n->isInternalNode()) /* not a leaf node */
-	{
-		for(i = 0; i < n->count_; ++i)
-		{
-			if(rtreeBoxIntersects(rect, n->branch_[i].rect_))
-			{
-				if(remove2(rect, data, n->branch_[i].child_, ee))
-				{
-					if(n->branch_[i].child_->count_ >= MINNODES)
-						n->branch_[i].rect_ = nodeCover(n->branch_[i].child_);
-					else
-					{
-						/* not enough entries in child, eliminate child node */
-						ee.push_back(n->branch_[i].child_);	//reInsert(n->branch_[i].child_, ee);
-						disconBranch(n, i);
-					}
-
-					return true;	// found item
-				}
-			}
-		}
-
-		return false;	// din't find item
-	}
-	else  /* a leaf node */
-	{
-		for(i = 0; i < n->count_; ++i)
-		{
-			if(n->branch_[i].data_ == data)
-			{
-				disconBranch(n, i);
-				return true;	// found item
-			}
-		}
-
-		return false;	// didn't find item
-	}
-}
-
-/*template<class DATATYPE, int MAXNODES, int MINNODES> void TeRTree<DATATYPE, MAXNODES, MINNODES>::reInsert(TeRTreeNodeType* n, vector<TeRTreeNodeType*>& ee)
-{
-	ee.push_back(n);
-}*/
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-void TeRTree<DATATYPE, MAXNODES, MINNODES>::disconBranch(TeRTreeNodeType* n, int i)
-{
-// remove element copying the last element in array
-	n->branch_[i] = n->branch_[n->count_ - 1];
-
-	--(n->count_);
-}
-
-// CHOOSELEAF
-template<class DATATYPE, int MAXNODES, int MINNODES>
-bool TeRTree<DATATYPE, MAXNODES, MINNODES>::chooseLeaf(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType* node, TeRTreeNodeType** newNode, int level)
-{
-	TeRTreeBranch    b;
-	TeRTreeNodeType* n2;	
-	
-	if(node->level_ > level)
-	{
-// Still above level for insertion, go down tree recursively
-		int i = pickBranch(rect, node);		// CL3
-
-		if(!chooseLeaf(rect, data, node->branch_[i].child_, &n2, level))
-		{
-// child was not split
-			node->branch_[i].rect_ = combineRect(rect, node->branch_[i].rect_);
-
-			return false;
-		}
-		else		
-		{
-// child was split
-			node->branch_[i].rect_ = nodeCover(node->branch_[i].child_);
-
-			b.child_ = n2;
-			b.rect_ = nodeCover(n2);
-
-			return addBranch(&b, node, newNode);
-		}
-	}
-	else if (node->level_ == level)
-	{
-// have reached level for insertion. Add rect, split if necessary
-
-		b.rect_ = rect;
-		//b.child_ = (TeRTreeNodeType*) data;
-		b.data_ = data;
-
-// child field of leaves contains tid of data record
-		return addBranch(&b, node, newNode);
-	}
-	else
-	{
-// Not supposed to happen
-		throw;
-		return false;
-	}
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-void TeRTree<DATATYPE, MAXNODES, MINNODES>::search(const TeBox& rect, TeRTreeNodeType* node, vector<DATATYPE>& report, int& foundObjs) const
-{
-	int i;
-// S1
-    if(node->isInternalNode()) // This is an internal node in the tree
-	{
-        for(i = 0; i < node->count_; ++i)
-		{
-            if(rtreeBoxIntersects(rect, node->branch_[i].rect_))
-                search(rect, node->branch_[i].child_, report, foundObjs);
-		}
-	}
-// S2
-	else	// This is a leaf node
-	{
-        for(i = 0; i < node->count_; ++i)
-		{
-            if(rtreeBoxIntersects(rect, node->branch_[i].rect_))
-			{
-                DATATYPE& id = node->branch_[i].data_;
-
-				report.push_back(id);
-
-                ++foundObjs;
-			}
-		}
-	}
-
-	return;
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-TeBox TeRTree<DATATYPE, MAXNODES, MINNODES>::nodeCover(TeRTreeNodeType* n) const
-{
-	bool flag = true;
-
-	TeBox r;
-	
-	for(int i = 0; i < n->count_; ++i)
-	{
-        if(flag)
-		{
-			r = n->branch_[i].rect_;
-			flag = false;
-		}
-		else
-			r = combineRect(r, n->branch_[i].rect_);
-	}
-
-	return r;
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-TeBox TeRTree<DATATYPE, MAXNODES, MINNODES>::combineRect(const TeBox& rectA, const TeBox& rectB) const
-{
-    TeBox newRect;
-
-	newRect.x1_ = MIN(rectA.x1_, rectB.x1_);
-	newRect.y1_ = MIN(rectA.y1_, rectB.y1_);
-	newRect.x2_ = MAX(rectA.x2_, rectB.x2_);
-	newRect.y2_ = MAX(rectA.y2_, rectB.y2_);
-
-	return newRect;
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-bool TeRTree<DATATYPE, MAXNODES, MINNODES>::addBranch(TeRTreeBranch* branch, TeRTreeNodeType* node, TeRTreeNodeType** newNode) const
-{
-    if(node->count_ < MAXNODES)		/* split won't be necessary */
-	{
-		node->branch_[node->count_] = *branch;
-
-		++(node->count_);
-
-		return false;
-	}
-	else
-	{
-        splitNode(node, branch, newNode);
-
-		return true;
-	}
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-int TeRTree<DATATYPE, MAXNODES, MINNODES>::pickBranch(const TeBox& rect, TeRTreeNodeType* node) const
-{
-// CL3
-	bool flag = true;
-
-	double bestIncr = -1.0;
-
-	double bestArea = 0.;
-
-    int best = 0;
-	
-	for(int i = 0; i < node->count_; ++i)
-	{
-		TeBox rr = node->branch_[i].rect_;
-		double area = rectArea(rr);
-
-		rr = combineRect(rect, rr);
-        
-		double increase = rectArea(rr) - area;
-
-        if((increase <  bestIncr) || flag)
-		{
-			best = i;
-
-            bestArea = area;
-            bestIncr = increase;
-
-            flag = false;
-		}
-		else if((increase == bestIncr) && (area < bestArea))
-		{
-			best = i;
-			bestArea = area;
-			bestIncr = increase;
-		}
-	}
-
-	return best;
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-void TeRTree<DATATYPE, MAXNODES, MINNODES>::splitNode(TeRTreeNodeType* node, TeRTreeBranch* branch, TeRTreeNodeType** newNode) const
-{
-    TePartitionVars partitions;
-
-// load all the branches into a buffer, initialize old node
-	int level = node->level_;
-
-	getBranches(node, branch, partitions);
-
-// find partition
-	methodZero(partitions);
-
-// put branches from buffer into 2 nodes according to chosen partition
-	++size_;
-
-	*newNode = new TeRTreeNodeType();
-	(*newNode)->level_ = node->level_ = level;
-
-	loadNodes(node, *newNode, partitions);
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-void TeRTree<DATATYPE, MAXNODES, MINNODES>::getBranches(TeRTreeNodeType* n, TeRTreeBranch* b, TePartitionVars& p) const
-{
-	int i;
-// load the branch buffer
-	for(i = 0; i < MAXNODES; ++i)
-	{
-		p.branchBuf_[i] = n->branch_[i];
-	}
-
-	p.branchBuf_[MAXNODES] = *b;
-
-// calculate rect containing all in the set
-	p.coverSplit_ = p.branchBuf_[0].rect_;
-
-	for(i = 1; i <= MAXNODES; ++i)
-		p.coverSplit_ = combineRect(p.coverSplit_, p.branchBuf_[i].rect_);
-
-	n->init();
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-void TeRTree<DATATYPE, MAXNODES, MINNODES>::methodZero(TePartitionVars& p) const
-{
-	p.init();
-	pickSeeds(p);
-	pigeonhole(p);
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-void TeRTree<DATATYPE, MAXNODES, MINNODES>::pickSeeds(TePartitionVars& p) const
-{
-	double w;
-	double separation;
-	double bestSep;
-	double width[2];
-	int leastUpper[2];
-	int greatestLower[2];
-	int seed0;
-	int seed1;
-	int i;
-// LPS1
-// find the rectangles farthest out in each direction along dimens "x"
-	greatestLower[0] = leastUpper[0] = 0;
-
-	for(i = 1; i <= MAXNODES; ++i)
-	{
-		TeBox& r = p.branchBuf_[i].rect_;
-
-		if(r.x1_ > p.branchBuf_[greatestLower[0]].rect_.x1_)
-			greatestLower[0] = i;
-
-		if(r.x2_ < p.branchBuf_[leastUpper[0]].rect_.x2_)
-			leastUpper[0] = i;
-	}
-
-// LPS2
-// LPS3
-// find the width of the whole collection along this dimension
-	width[0] = p.coverSplit_.x2_ - p.coverSplit_.x1_;
-
-// find the rectangles farthest out in each direction along dimens "y"
-	greatestLower[1] = leastUpper[1] = 0;
-
-	for(i = 1; i <= MAXNODES; ++i)
-	{
-		TeBox& r = p.branchBuf_[i].rect_;
-
-		if(r.y1_ > p.branchBuf_[greatestLower[1]].rect_.y1_)
-			greatestLower[1] = i;
-
-		if(r.y2_ < p.branchBuf_[leastUpper[1]].rect_.y2_)
-			leastUpper[1] = i;
-	}
-
-// LPS2
-// LPS3
-// find the width of the whole collection along this dimension
-	width[1] = p.coverSplit_.y2_ - p.coverSplit_.y1_;
-
-
-// pick the best separation dimension and the two seed rects
-
-// divisor for normalizing by width
-
-// x
-	if(width[0] == 0.0)
-		w = 1.0;
-	else
-		w = width[0];
-
-	TeBox rlow  = p.branchBuf_[leastUpper[0]].rect_;
-    TeBox rhigh = p.branchBuf_[greatestLower[0]].rect_;
-
-    seed0 = leastUpper[0];
-	seed1 = greatestLower[0];
-    
-	bestSep = (rhigh.x1_ - rlow.x2_) / w;
-
-// y
-	if(width[1] == 0.0)
-		w = 1.0;
-	else
-		w = width[1];
-
-	rlow  = p.branchBuf_[leastUpper[1]].rect_;
-    rhigh = p.branchBuf_[greatestLower[1]].rect_;
-
-    separation = (rhigh.y1_ - rlow.y2_) / w;
-
-// LPS3
-	if(separation > bestSep)
-	{
-		seed0 = leastUpper[1];
-		seed1 = greatestLower[1];
-
-		bestSep = separation;
-	}
-
-	if(seed0 != seed1)
-	{
-		classify(seed0, 0, p);
-		classify(seed1, 1, p);
-	}
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-void TeRTree<DATATYPE, MAXNODES, MINNODES>::classify(int i, int group, TePartitionVars& p) const
-{
-    p.partition_[i] = group;
-	p.taken_[i] = 1;
-
-	if(p.count_[group] == 0)
-		p.cover_[group] = p.branchBuf_[i].rect_;
-	else
-		p.cover_[group] = combineRect(p.branchBuf_[i].rect_, p.cover_[group]);
-
-	p.area_[group] = rectArea(p.cover_[group]);
-
-	++(p.count_[group]);
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-void TeRTree<DATATYPE, MAXNODES, MINNODES>::pigeonhole(TePartitionVars& p) const
-{
-	TeBox newCover[2];
-	
-	double newArea[2];
-	double increase[2];
-
-	for(int i = 0; i <= MAXNODES; ++i)
-	{
-		if(p.taken_[i] == 0)
-		{
-// if one group too full, put rect in the other regardless
-			if(p.count_[0] >= (MAXNODES + 1 - MINNODES))
-			{
-				classify(i, 1, p);
-
-				continue;
-			}
-			else if(p.count_[1] >= (MAXNODES + 1 - MINNODES))
-			{
-				classify(i, 0, p);
-
-				continue;
-			}
-
-// find the areas of the two groups' old and new covers
-			for(int group = 0; group < 2; ++group)
-			{
-				if(p.count_[group] > 0)
-				{
-					newCover[group] = combineRect(p.branchBuf_[i].rect_, p.cover_[group]);
-				}
-				else
-				{
-					newCover[group] = p.branchBuf_[i].rect_;
-				}
-
-				newArea[group] = rectArea(newCover[group]);
-				increase[group] = newArea[group] - p.area_[group];
-			}
-
-// put rect in group whose cover will need to expand less
-			if(increase[0] < increase[1])
-				classify(i, 0, p);
-			else if(increase[1] < increase[0])
-				classify(i, 1, p);
-// put rect in group that will have a smaller area cover
-			else if(p.area_[0] < p.area_[1])
-				classify(i, 0, p);
-			else if(p.area_[1] < p.area_[0])
-				classify(i, 1, p);
-// put rect in group with fewer elements
-			else if(p.count_[0] < p.count_[1])
-				classify(i, 0, p);
-			else
-				classify(i, 1, p);
-		}
-	}
-}
-
-template<class DATATYPE, int MAXNODES, int MINNODES>
-void TeRTree<DATATYPE, MAXNODES, MINNODES>::loadNodes(TeRTreeNodeType* n, TeRTreeNodeType* q, TePartitionVars& p) const
-{
-	for(int i = 0; i <= MAXNODES; ++i)
-	{
-		if(p.partition_[i] == 0)
-			addBranch(&(p.branchBuf_[i]), n, 0);
-		else if(p.partition_[i] == 1)
-			addBranch(&(p.branchBuf_[i]), q, 0);
-		//else
-		//	throw;	// ERROR
-	}
-}
-};	// end namespace TeSAM
-
-
-#endif	// __TERRALIB_INTERNAL_RTREE_H
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file   TeRTree.h
+    \brief  This file contains an implementation of rtree data structures in main memory for two dimensions.
+	\note   These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
+	        THIS IS FOR INTERNAL USE ONLY.
+    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+*/
+
+#ifndef  __TERRALIB_INTERNAL_RTREE_H
+#define  __TERRALIB_INTERNAL_RTREE_H
+
+#include "TeGeometry.h"
+#include "TeGeometryAlgorithms.h"
+
+/*! \brief This namespace contain the definitions of various Spatial Data Structures,
+           like K-d-Tree and R-Tree, ONLY FOR INTERNAL USE (must NOT be used by anyone).
+*/
+namespace TeSAM
+{
+//! Class that represents a node of a TeRTree
+/*!
+	If level is 0 so this is a leaf node otherwise this is a internal node.
+
+	WARNING:
+
+	1. A branch is a union, so be carefull with the types used here!
+	
+ */
+template<class DATATYPE, int MAXNODES = 8, int MINNODES = MAXNODES / 2>
+class TeRTreeNode
+{
+	public:
+
+		//! Struct that represents a node-branch of a TeRTree
+		/*!
+			May be data or may be another subtree, if parents level is 0 so this is a data in a leaf node.
+
+		*/
+		struct TeRTreeBranch
+		{
+			TeBox rect_;	//!<	Bounding box for branch or object (if this is a leaf).
+
+			union
+			{
+				TeRTreeNode* child_;		//!< Child node pointer.
+				DATATYPE data_;				//!< Data Id or Ptr.
+			};
+		};
+
+	public:
+
+		int count_;			//!< Count.
+
+		int level_;			//!< Leaf is zero, others positive.
+
+		TeRTreeBranch branch_[MAXNODES];	//!< Branch.
+
+		//! Constructor.
+
+
+		TeRTreeNode()
+			: count_(0), level_(-1)
+		{
+		}
+
+		//! Returns true if this is a internal node.
+        bool isInternalNode() const
+		{
+			return (level_ > 0);
+		}
+
+		//! Returns true if this is a leaf node.
+        bool isLeaf() const
+		{
+			return (level_ == 0);
+		}
+
+		//! This method is used by split, when a node is re-filled.
+		void init()
+		{
+			count_ = 0;
+
+			level_ = -1;
+		}
+
+	private:
+
+		//! No copy allowed
+		TeRTreeNode(const TeRTreeNode& other);
+
+		//! No copy allowed
+		TeRTreeNode& operator=(const TeRTreeNode& other);
+
+};	// end of class TeRTreeNode
+
+//! A class that represents a two dimensional R-Tree
+/*!	
+	This implementation is based on:
+	Antonin Guttman. R-Trees: A Dynamic Index Structure for Spatial Searching. ACM SIGMOD: International Conference on Management of Data, 1984, pp. 47-57.	
+
+	and in his original source code. <BR>
+
+	WARNING: <BR>
+
+	1. Don't use this class! It is for TerraLib internal use. <BR>
+
+	2. Only the basic methods for inserting and searching were implemented. <BR>
+
+	3. In future we will implement: <BR>
+		- the delete method. <BR>
+		- the near query <BR>
+		- point query <BR>
+ */
+template<class DATATYPE, int MAXNODES = 8, int MINNODES = MAXNODES / 2>
+class TeRTree
+{
+	public:
+
+		//! Export this typename.
+		typedef TeRTreeNode<DATATYPE, MAXNODES, MINNODES> TeRTreeNodeType;
+
+		//! Export this typename.
+		typedef typename TeRTreeNodeType::TeRTreeBranch TeRTreeBranch;
+
+	protected:
+
+		//! Structure of auxiliary variables for finding a split partition.
+		struct TePartitionVars
+		{
+			int partition_[MAXNODES + 1];	//!< Auxiliary partition vector.
+			int taken_[MAXNODES + 1];		//!< Flag to indicate that entry is ok.
+			int count_[2];					//!< Number of entries in each new page.
+			TeBox cover_[2];				//!< Auxiliary box of each new page.
+			double area_[2];				//!< Auxiliary area of each new page.
+
+			TeRTreeBranch branchBuf_[MAXNODES + 1];	//!< Auxiliary branch buffer.
+			TeBox coverSplit_;						//!< Auxiliary box covering branchBuf.
+
+			//! Initializes partition vars.
+			void init()
+			{
+				count_[0] = 0;
+				count_[1] = 0;
+
+                for(int i = 0; i <= MAXNODES; ++i)
+                {
+                    taken_[i] = 0;
+                    partition_[i] = -1;
+                }
+			}
+		};		
+		
+		TeRTreeNodeType* root_;		//!< Pointer to root node
+
+		TeBox mbr_;					//!< Bounding box of the tree
+        		
+		mutable unsigned int size_;			//!< The size of R-Tree (number of nodes)		
+
+	public:
+
+		//! Construtor
+		TeRTree(const TeBox& mbr)
+			: root_(0), mbr_(mbr), size_(0)
+		{
+			++size_;
+			root_ = new TeRTreeNodeType();
+            root_->level_ = 0;
+		}
+
+		//! Destructor
+		~TeRTree()
+		{
+			clear();
+
+			if(root_)
+				delete root_;
+		}
+
+		//! The number of elements of the tree
+		const unsigned int& size(void) const
+		{
+			return size_;
+		}
+		
+		//! Return true if the tree is empty
+		bool isEmpty(void) const
+		{
+			return (root_->count_ == 0);
+		}
+
+		//! Clear all tree nodes
+		void clear(void)
+		{
+			if(root_)
+			{
+				erase(root_);
+				root_ = 0;
+				
+				size_ = 1;
+				root_ = new TeRTreeNodeType();
+				root_->level_ = 0;
+			}
+		}
+
+		//! Inserts item into the tree
+		void insert(const TeBox& rect, const DATATYPE& data)
+		{
+			insert(rect, data, &root_, 0);
+		}
+
+		//! Removes item from tree
+		bool remove(const TeBox& rect, const DATATYPE& data)
+		{
+			return remove(rect, data, &root_);
+		}
+
+		//! Range search query
+		int search(const TeBox& rect, vector<DATATYPE>& report) const
+		{
+			int foundObjs = 0;
+
+			if(root_)
+				search(rect, root_, report, foundObjs);
+
+			return foundObjs;
+		}
+
+		//! Sets the bounding box of all elements in the tree
+		void setBox(const TeBox& mbr)
+		{
+			mbr_ = mbr;
+		}
+
+		//! Gets the bounding box of all elements in the tree
+		const TeBox& getBox(void) const
+		{
+			return mbr_;
+		}
+
+	protected:
+
+		//! Insert a data rectangle into an index structure.
+		/*!
+			Insert provides for splitting the root. <BR>
+			Returns true if root was split, false if it was not. <BR>
+			The level argument specifies the number of steps up from the leaf
+			level to insert; e.g. a data rectangle goes in at level = 0. <BR>
+			chooseLeaf does the recursion.
+		*/
+		inline bool insert(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType** root, int level);
+
+		//! Delete a data rectangle from an index structure.		   
+		/*!
+			Pass in a pointer to a Rect, the tid of the record, ptr to ptr to root node. <BR>
+			Returns 1 if record not found, 0 if success. <BR>
+			DeleteRect provides for eliminating the root.
+		*/
+		inline bool remove(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType** root);
+
+		//! Delete a rectangle from non-root part of an index structure.		   
+		/*!
+			Called by DeleteRect. <BR>
+			Descends tree recursively,
+			merges branches on the way back up.
+		*/
+		inline bool remove2(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType* n, vector<TeRTreeNodeType*>& ee);
+
+		//! Disconnect a dependent node.
+		inline void disconBranch(TeRTreeNodeType* n, int i);
+
+		//! Inserts a new data rectangle into the index structure.		   
+		/*!
+			Recursively descends tree, propagates splits back up.
+			Returns false if node was not split.  Old node updated.
+			If node was split, returns true and sets the pointer pointed to by
+			new to point to the new node.  Old node updated to become one of two.
+			The level argument specifies the number of steps up from the leaf
+			level to insert; e.g. a data rectangle goes in at level = 0.
+		*/
+		inline bool chooseLeaf(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType* node, TeRTreeNodeType** newNode, int level);
+
+		//! Recursive range query
+		inline void search(const TeBox& rect, TeRTreeNodeType* node, vector<DATATYPE>& report, int& foundObjs) const;
+
+		//! Find the smallest rectangle that includes all rectangles in branches of a node
+		inline TeBox nodeCover(TeRTreeNodeType* n) const;
+
+		//! Combine two rectangles into larger one containing both
+		inline TeBox combineRect(const TeBox& rectA, const TeBox& rectB) const;
+
+		//! Add a branch to a node.
+		/*!
+			Split the node if necessary. <BR>
+			Returns false if node not split. <BR>
+			Old node updated. <BR>
+			Returns true if node split, sets *new to address of new node. <BR>
+			Old node updated, becomes one of two.
+		*/
+		inline bool addBranch(TeRTreeBranch* branch, TeRTreeNodeType* node, TeRTreeNodeType** newNode) const;
+
+		//! Pick a branch.
+		/*!
+			Pick the one that will need the smallest increase
+			in area to accomodate the new rectangle.  This will result in the
+			least total area for the covering rectangles in the current node.
+			In case of a tie, pick the one which was smaller before, to get
+			the best resolution when searching.
+		*/
+		inline int pickBranch(const TeBox& rect, TeRTreeNodeType* node) const;
+
+		//! Split a node.
+		/*!
+			Divides the nodes branches and the extra one between two nodes. <BR>
+			Old node is one of the new ones, and one really new one is created.
+		*/
+		inline void splitNode(TeRTreeNodeType* node, TeRTreeBranch* branch, TeRTreeNodeType** newNode) const;
+
+		//! Load branch buffer with branches from full node plus the extra branch.
+		inline void getBranches(TeRTreeNodeType* n, TeRTreeBranch* b, TePartitionVars& p) const;
+
+		//! Method 0 for finding a partition.
+		/*!
+		   First find two seeds, one for each group, well separated.
+           Then put other rects in whichever group will be smallest after addition.
+	    */
+		inline void methodZero(TePartitionVars& p) const;
+
+		//! Pick two rects from set to be the first elements of the two groups.
+		/*!	
+		   Pick the two that are separated most along any dimension, or overlap least.
+           Distance for separation or overlap is measured modulo the width of the
+           space covered by the entire set along that dimension.
+	     */
+		inline void pickSeeds(TePartitionVars& p) const;
+
+		//! Put a branch in one of the groups
+		inline void classify(int i, int group, TePartitionVars& p) const;
+
+		//! Put each rect that is not already in a group into a group.
+		/*!	
+           Process one rect at a time, using the following hierarchy of criteria.
+           In case of a tie, go to the next test.<BR>
+           1) If one group already has the max number of elements that will allow
+              the minimum fill for the other group, put r in the other.<BR>
+           2) Put r in the group whose cover will expand less.  This automatically
+		      takes care of the case where one group cover contains r.<BR>
+		   3) Put r in the group whose cover will be smaller.  This takes care of the
+              case where r is contained in both covers.<BR>
+           4) Put r in the group with fewer elements.<BR>
+           5) Put in group 1 (arbitrary).<BR>
+
+           Also update the covers for both groups.
+	     */
+		inline void pigeonhole(TePartitionVars& p) const;
+
+		//! Copy branches from the buffer into two nodes according to the partition.
+		inline void loadNodes(TeRTreeNodeType* n, TeRTreeNodeType* q, TePartitionVars& p) const;
+
+		//! Calculate rect area
+		double rectArea(const TeBox& b) const
+		{
+			return b.width() * b.height();
+		}
+
+		//! Erases a node from the tree and all nodes below it.
+		void erase(TeRTreeNodeType* node)
+		{
+			if(node->isLeaf())
+			{
+				delete node;
+
+				return;
+			}
+
+			for(int i = 0u; i < node->count_; ++i)
+				erase(node->branch_[i].child_);
+	
+			delete node;
+
+			return;
+		}
+
+		//! Only to determine if the two box intersects withou using an epsilon
+		bool rtreeBoxIntersects(const TeBox& bx1, const TeBox& bx2) const
+		{
+			return ::TeIntersects(bx1, bx2);
+		}		
+
+	private:
+
+		//! No copy allowed
+		TeRTree(const TeRTree& other);
+
+		//! No copy allowed
+		TeRTree& operator=(const TeRTree& other);
+
+};	// end of class TeRTree
+
+
+//------------------- Implementation of the templates classes
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+bool TeRTree<DATATYPE, MAXNODES, MINNODES>::insert(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType** root, int level)
+{
+// this is the algorithm insert
+    TeRTreeNodeType* newRoot;
+	TeRTreeNodeType* newNode;
+    TeRTreeBranch    branch;
+
+    if(chooseLeaf(rect, data, *root, &newNode, level))  // I1
+    {
+// I4
+// if root was split
+// grow a new root, make tree taller
+		++size_;
+        newRoot = new TeRTreeNodeType();  
+
+        newRoot->level_ = (*root)->level_ + 1;
+
+// first half node
+        branch.rect_  = nodeCover(*root);
+        branch.child_ = *root;
+        addBranch(&branch, newRoot, 0);
+
+// second half node
+        branch.rect_ = nodeCover(newNode);
+        branch.child_ = newNode;        
+		addBranch(&branch, newRoot, 0);
+
+        *root = newRoot;
+
+        return true;
+    }
+
+    return false;
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+bool TeRTree<DATATYPE, MAXNODES, MINNODES>::remove(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType** root)
+{
+	int i;
+	TeRTreeNodeType *t;
+	vector<TeRTreeNodeType*> reInsertList;
+	
+	if(remove2(rect, data, *root, reInsertList))
+	{
+// if we are here, so we have found and deleted a data item
+
+// reinsert any branches from eliminated nodes
+		while(!reInsertList.empty())
+		{
+			t = reInsertList[0];
+			for(i = 0; i < t->count_; ++i)
+				insert(t->branch_[i].rect_, t->branch_[i].data_, root, t->level_);
+	
+// erase node from list
+			reInsertList.erase(reInsertList.begin());
+
+// remove node card from memory
+			delete t;
+			--size_;
+		}
+		
+		/* check for redundant root (not leaf, 1 child) and eliminate */
+		if(((*root)->count_ == 1) && ((*root)->isInternalNode()))
+		{
+			t = (*root)->branch_[0].child_;
+
+			delete (*root);
+			--size_;
+
+			*root = t;
+		}
+		
+		return true;
+	}
+	
+	return false;
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+bool TeRTree<DATATYPE, MAXNODES, MINNODES>::remove2(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType* n, vector<TeRTreeNodeType*>& ee)
+{
+	int i;	
+
+	if(n->isInternalNode()) /* not a leaf node */
+	{
+		for(i = 0; i < n->count_; ++i)
+		{
+			if(rtreeBoxIntersects(rect, n->branch_[i].rect_))
+			{
+				if(remove2(rect, data, n->branch_[i].child_, ee))
+				{
+					if(n->branch_[i].child_->count_ >= MINNODES)
+						n->branch_[i].rect_ = nodeCover(n->branch_[i].child_);
+					else
+					{
+						/* not enough entries in child, eliminate child node */
+						ee.push_back(n->branch_[i].child_);	//reInsert(n->branch_[i].child_, ee);
+						disconBranch(n, i);
+					}
+
+					return true;	// found item
+				}
+			}
+		}
+
+		return false;	// din't find item
+	}
+	else  /* a leaf node */
+	{
+		for(i = 0; i < n->count_; ++i)
+		{
+			if(n->branch_[i].data_ == data)
+			{
+				disconBranch(n, i);
+				return true;	// found item
+			}
+		}
+
+		return false;	// didn't find item
+	}
+}
+
+/*template<class DATATYPE, int MAXNODES, int MINNODES> void TeRTree<DATATYPE, MAXNODES, MINNODES>::reInsert(TeRTreeNodeType* n, vector<TeRTreeNodeType*>& ee)
+{
+	ee.push_back(n);
+}*/
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+void TeRTree<DATATYPE, MAXNODES, MINNODES>::disconBranch(TeRTreeNodeType* n, int i)
+{
+// remove element copying the last element in array
+	n->branch_[i] = n->branch_[n->count_ - 1];
+
+	--(n->count_);
+}
+
+// CHOOSELEAF
+template<class DATATYPE, int MAXNODES, int MINNODES>
+bool TeRTree<DATATYPE, MAXNODES, MINNODES>::chooseLeaf(const TeBox& rect, const DATATYPE& data, TeRTreeNodeType* node, TeRTreeNodeType** newNode, int level)
+{
+	TeRTreeBranch    b;
+	TeRTreeNodeType* n2;	
+	
+	if(node->level_ > level)
+	{
+// Still above level for insertion, go down tree recursively
+		int i = pickBranch(rect, node);		// CL3
+
+		if(!chooseLeaf(rect, data, node->branch_[i].child_, &n2, level))
+		{
+// child was not split
+			node->branch_[i].rect_ = combineRect(rect, node->branch_[i].rect_);
+
+			return false;
+		}
+		else		
+		{
+// child was split
+			node->branch_[i].rect_ = nodeCover(node->branch_[i].child_);
+
+			b.child_ = n2;
+			b.rect_ = nodeCover(n2);
+
+			return addBranch(&b, node, newNode);
+		}
+	}
+	else if (node->level_ == level)
+	{
+// have reached level for insertion. Add rect, split if necessary
+
+		b.rect_ = rect;
+		//b.child_ = (TeRTreeNodeType*) data;
+		b.data_ = data;
+
+// child field of leaves contains tid of data record
+		return addBranch(&b, node, newNode);
+	}
+	else
+	{
+// Not supposed to happen
+		throw;
+		return false;
+	}
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+void TeRTree<DATATYPE, MAXNODES, MINNODES>::search(const TeBox& rect, TeRTreeNodeType* node, vector<DATATYPE>& report, int& foundObjs) const
+{
+	int i;
+// S1
+    if(node->isInternalNode()) // This is an internal node in the tree
+	{
+        for(i = 0; i < node->count_; ++i)
+		{
+            if(rtreeBoxIntersects(rect, node->branch_[i].rect_))
+                search(rect, node->branch_[i].child_, report, foundObjs);
+		}
+	}
+// S2
+	else	// This is a leaf node
+	{
+        for(i = 0; i < node->count_; ++i)
+		{
+            if(rtreeBoxIntersects(rect, node->branch_[i].rect_))
+			{
+                DATATYPE& id = node->branch_[i].data_;
+
+				report.push_back(id);
+
+                ++foundObjs;
+			}
+		}
+	}
+
+	return;
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+TeBox TeRTree<DATATYPE, MAXNODES, MINNODES>::nodeCover(TeRTreeNodeType* n) const
+{
+	bool flag = true;
+
+	TeBox r;
+	
+	for(int i = 0; i < n->count_; ++i)
+	{
+        if(flag)
+		{
+			r = n->branch_[i].rect_;
+			flag = false;
+		}
+		else
+			r = combineRect(r, n->branch_[i].rect_);
+	}
+
+	return r;
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+TeBox TeRTree<DATATYPE, MAXNODES, MINNODES>::combineRect(const TeBox& rectA, const TeBox& rectB) const
+{
+    TeBox newRect;
+
+	newRect.x1_ = MIN(rectA.x1_, rectB.x1_);
+	newRect.y1_ = MIN(rectA.y1_, rectB.y1_);
+	newRect.x2_ = MAX(rectA.x2_, rectB.x2_);
+	newRect.y2_ = MAX(rectA.y2_, rectB.y2_);
+
+	return newRect;
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+bool TeRTree<DATATYPE, MAXNODES, MINNODES>::addBranch(TeRTreeBranch* branch, TeRTreeNodeType* node, TeRTreeNodeType** newNode) const
+{
+    if(node->count_ < MAXNODES)		/* split won't be necessary */
+	{
+		node->branch_[node->count_] = *branch;
+
+		++(node->count_);
+
+		return false;
+	}
+	else
+	{
+        splitNode(node, branch, newNode);
+
+		return true;
+	}
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+int TeRTree<DATATYPE, MAXNODES, MINNODES>::pickBranch(const TeBox& rect, TeRTreeNodeType* node) const
+{
+// CL3
+	bool flag = true;
+
+	double bestIncr = -1.0;
+
+	double bestArea = 0.;
+
+    int best = 0;
+	
+	for(int i = 0; i < node->count_; ++i)
+	{
+		TeBox rr = node->branch_[i].rect_;
+		double area = rectArea(rr);
+
+		rr = combineRect(rect, rr);
+        
+		double increase = rectArea(rr) - area;
+
+        if((increase <  bestIncr) || flag)
+		{
+			best = i;
+
+            bestArea = area;
+            bestIncr = increase;
+
+            flag = false;
+		}
+		else if((increase == bestIncr) && (area < bestArea))
+		{
+			best = i;
+			bestArea = area;
+			bestIncr = increase;
+		}
+	}
+
+	return best;
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+void TeRTree<DATATYPE, MAXNODES, MINNODES>::splitNode(TeRTreeNodeType* node, TeRTreeBranch* branch, TeRTreeNodeType** newNode) const
+{
+    TePartitionVars partitions;
+
+// load all the branches into a buffer, initialize old node
+	int level = node->level_;
+
+	getBranches(node, branch, partitions);
+
+// find partition
+	methodZero(partitions);
+
+// put branches from buffer into 2 nodes according to chosen partition
+	++size_;
+
+	*newNode = new TeRTreeNodeType();
+	(*newNode)->level_ = node->level_ = level;
+
+	loadNodes(node, *newNode, partitions);
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+void TeRTree<DATATYPE, MAXNODES, MINNODES>::getBranches(TeRTreeNodeType* n, TeRTreeBranch* b, TePartitionVars& p) const
+{
+	int i;
+// load the branch buffer
+	for(i = 0; i < MAXNODES; ++i)
+	{
+		p.branchBuf_[i] = n->branch_[i];
+	}
+
+	p.branchBuf_[MAXNODES] = *b;
+
+// calculate rect containing all in the set
+	p.coverSplit_ = p.branchBuf_[0].rect_;
+
+	for(i = 1; i <= MAXNODES; ++i)
+		p.coverSplit_ = combineRect(p.coverSplit_, p.branchBuf_[i].rect_);
+
+	n->init();
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+void TeRTree<DATATYPE, MAXNODES, MINNODES>::methodZero(TePartitionVars& p) const
+{
+	p.init();
+	pickSeeds(p);
+	pigeonhole(p);
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+void TeRTree<DATATYPE, MAXNODES, MINNODES>::pickSeeds(TePartitionVars& p) const
+{
+	double w;
+	double separation;
+	double bestSep;
+	double width[2];
+	int leastUpper[2];
+	int greatestLower[2];
+	int seed0;
+	int seed1;
+	int i;
+// LPS1
+// find the rectangles farthest out in each direction along dimens "x"
+	greatestLower[0] = leastUpper[0] = 0;
+
+	for(i = 1; i <= MAXNODES; ++i)
+	{
+		TeBox& r = p.branchBuf_[i].rect_;
+
+		if(r.x1_ > p.branchBuf_[greatestLower[0]].rect_.x1_)
+			greatestLower[0] = i;
+
+		if(r.x2_ < p.branchBuf_[leastUpper[0]].rect_.x2_)
+			leastUpper[0] = i;
+	}
+
+// LPS2
+// LPS3
+// find the width of the whole collection along this dimension
+	width[0] = p.coverSplit_.x2_ - p.coverSplit_.x1_;
+
+// find the rectangles farthest out in each direction along dimens "y"
+	greatestLower[1] = leastUpper[1] = 0;
+
+	for(i = 1; i <= MAXNODES; ++i)
+	{
+		TeBox& r = p.branchBuf_[i].rect_;
+
+		if(r.y1_ > p.branchBuf_[greatestLower[1]].rect_.y1_)
+			greatestLower[1] = i;
+
+		if(r.y2_ < p.branchBuf_[leastUpper[1]].rect_.y2_)
+			leastUpper[1] = i;
+	}
+
+// LPS2
+// LPS3
+// find the width of the whole collection along this dimension
+	width[1] = p.coverSplit_.y2_ - p.coverSplit_.y1_;
+
+
+// pick the best separation dimension and the two seed rects
+
+// divisor for normalizing by width
+
+// x
+	if(width[0] == 0.0)
+		w = 1.0;
+	else
+		w = width[0];
+
+	TeBox rlow  = p.branchBuf_[leastUpper[0]].rect_;
+    TeBox rhigh = p.branchBuf_[greatestLower[0]].rect_;
+
+    seed0 = leastUpper[0];
+	seed1 = greatestLower[0];
+    
+	bestSep = (rhigh.x1_ - rlow.x2_) / w;
+
+// y
+	if(width[1] == 0.0)
+		w = 1.0;
+	else
+		w = width[1];
+
+	rlow  = p.branchBuf_[leastUpper[1]].rect_;
+    rhigh = p.branchBuf_[greatestLower[1]].rect_;
+
+    separation = (rhigh.y1_ - rlow.y2_) / w;
+
+// LPS3
+	if(separation > bestSep)
+	{
+		seed0 = leastUpper[1];
+		seed1 = greatestLower[1];
+
+		bestSep = separation;
+	}
+
+	if(seed0 != seed1)
+	{
+		classify(seed0, 0, p);
+		classify(seed1, 1, p);
+	}
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+void TeRTree<DATATYPE, MAXNODES, MINNODES>::classify(int i, int group, TePartitionVars& p) const
+{
+    p.partition_[i] = group;
+	p.taken_[i] = 1;
+
+	if(p.count_[group] == 0)
+		p.cover_[group] = p.branchBuf_[i].rect_;
+	else
+		p.cover_[group] = combineRect(p.branchBuf_[i].rect_, p.cover_[group]);
+
+	p.area_[group] = rectArea(p.cover_[group]);
+
+	++(p.count_[group]);
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+void TeRTree<DATATYPE, MAXNODES, MINNODES>::pigeonhole(TePartitionVars& p) const
+{
+	TeBox newCover[2];
+	
+	double newArea[2];
+	double increase[2];
+
+	for(int i = 0; i <= MAXNODES; ++i)
+	{
+		if(p.taken_[i] == 0)
+		{
+// if one group too full, put rect in the other regardless
+			if(p.count_[0] >= (MAXNODES + 1 - MINNODES))
+			{
+				classify(i, 1, p);
+
+				continue;
+			}
+			else if(p.count_[1] >= (MAXNODES + 1 - MINNODES))
+			{
+				classify(i, 0, p);
+
+				continue;
+			}
+
+// find the areas of the two groups' old and new covers
+			for(int group = 0; group < 2; ++group)
+			{
+				if(p.count_[group] > 0)
+				{
+					newCover[group] = combineRect(p.branchBuf_[i].rect_, p.cover_[group]);
+				}
+				else
+				{
+					newCover[group] = p.branchBuf_[i].rect_;
+				}
+
+				newArea[group] = rectArea(newCover[group]);
+				increase[group] = newArea[group] - p.area_[group];
+			}
+
+// put rect in group whose cover will need to expand less
+			if(increase[0] < increase[1])
+				classify(i, 0, p);
+			else if(increase[1] < increase[0])
+				classify(i, 1, p);
+// put rect in group that will have a smaller area cover
+			else if(p.area_[0] < p.area_[1])
+				classify(i, 0, p);
+			else if(p.area_[1] < p.area_[0])
+				classify(i, 1, p);
+// put rect in group with fewer elements
+			else if(p.count_[0] < p.count_[1])
+				classify(i, 0, p);
+			else
+				classify(i, 1, p);
+		}
+	}
+}
+
+template<class DATATYPE, int MAXNODES, int MINNODES>
+void TeRTree<DATATYPE, MAXNODES, MINNODES>::loadNodes(TeRTreeNodeType* n, TeRTreeNodeType* q, TePartitionVars& p) const
+{
+	for(int i = 0; i <= MAXNODES; ++i)
+	{
+		if(p.partition_[i] == 0)
+			addBranch(&(p.branchBuf_[i]), n, 0);
+		else if(p.partition_[i] == 1)
+			addBranch(&(p.branchBuf_[i]), q, 0);
+		//else
+		//	throw;	// ERROR
+	}
+}
+};	// end namespace TeSAM
+
+
+#endif	// __TERRALIB_INTERNAL_RTREE_H
+
+
+
+
diff --git a/src/terralib/kernel/TeRaster.cpp b/src/terralib/kernel/TeRaster.cpp
old mode 100755
new mode 100644
index 93f02ff..112f3c0
--- a/src/terralib/kernel/TeRaster.cpp
+++ b/src/terralib/kernel/TeRaster.cpp
@@ -1,1046 +1,1053 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <TeRaster.h>
-#include <TeDecoder.h>
-#include <TeUtils.h>
-#include <TeStdFile.h>
-#include <TeException.h>
-#include "TeRasterRemap.h"
-#include "TeDecoderMemory.h"
-#include <TeInitRasterDecoders.h>
-#include <TeVectorRemap.h>
-#include <algorithm>
-
-
-//!	virtual class that define the strategics of the iteratorPoly, each strategic is a functor
-class TeStrategic
-{
-protected:
-	TeRaster*		raster_;
-	double			y_;
-	TeCoordPairVect	SegOut_;   //line and column index 
-
-public:
-	TeStrategic(TeRaster* r=0, double y=0): raster_(r), y_(y) {}
-
-    virtual ~TeStrategic() {}
-
-	void Init(TeRaster* r, double y)
-	{
-		raster_ = r;
-		y_ = y;
-	}
-	
-	virtual void strateg(double xMin, double xMax, double y) = 0;  
-
-	void operator() (TeCoordPair& pair)
-	{
-		//xmin and xmax of the segment (line and column index)
-		TeCoord2D minSegLC = raster_->coord2Index(TeCoord2D(pair.pt1.x_, y_));
-		TeCoord2D maxSegLC = raster_->coord2Index(TeCoord2D(pair.pt2.x_, y_));
-
-		double xMinLCd = minSegLC.x_;
-		double xMaxLCd = maxSegLC.x_;
-		double yLC = maxSegLC.y_;
-		
-		//verify if is outside raster area 
-		if(xMinLCd<-0.5)
-		{
-			if(xMaxLCd<-0.5)
-				return;
-			else
-				xMinLCd=-0.5;
-		}
-		strateg(xMinLCd, xMaxLCd, yLC);
-	}
-	TeCoordPairVect result() const {return SegOut_;}
-};
-
-
-//!	functor TePixelBoxInPoly
-/*
-	return the elements of the raster which box is 
-	contained in the polygon
-*/
-class TePixelBoxInPoly: public TeStrategic
-{
-
-public:
-	TePixelBoxInPoly(TeRaster* r=0, double y=0): TeStrategic(r,y) {}
-
-    virtual ~TePixelBoxInPoly() {}
-
-    void strateg(double xMin, double xMax, double y)
-	{
-		//verify if contain the element center 
-		int xMinLCi = TeRoundRasterIndex(xMin);
-		int xMaxLCi = TeRoundRasterIndex(xMax);
-		
-		if (xMinLCi < xMin)
-			xMinLCi++;
-
-		if (xMaxLCi > xMax)
-			xMaxLCi--;
-
-		if (xMinLCi <= xMaxLCi)
-		{
-			//new segment 
-			TeCoord2D minLC (xMinLCi, y);
-			TeCoord2D maxLC (xMaxLCi, y);
-
-			TeCoordPair res(minLC,maxLC);
-			SegOut_.push_back (res);
-		}
-	}
-	
-};
-
-
-//!	functor TePixelBBInterPoly
-/*
-	return the elements of the raster "cujo" boundingbox 
-	intersects the polygon
-*/
-class TePixelBBInterPoly: public TeStrategic
-{
-	
-public:
-	TePixelBBInterPoly(TeRaster* r=0, double y=0): TeStrategic(r,y) {}
-
-    virtual ~TePixelBBInterPoly() {}
-
-	void strateg(double xMin, double xMax, double y)
-	{		
-		//element center 
-		int xMinLCi = TeRoundRasterIndex(xMin);
-		int xMaxLCi = TeRoundRasterIndex(xMax);
-
-		if (SegOut_.size()>0)
-		{
-			TeCoordPair prev = SegOut_[SegOut_.size()-1];
-			if (xMinLCi == prev.pt2.x())
-				xMinLCi++;
-			if (xMinLCi > xMaxLCi)
-				return;
-		}
-		
-		TeCoord2D minLC (xMinLCi, y);
-		TeCoord2D maxLC (xMaxLCi, y);
-			
-		TeCoordPair res(minLC,maxLC);
-
-		SegOut_.push_back (res);
-	}
-};
-
-
-TeCoordPairVect 
-applyStrategic(double& y, double ymin, double xmin, TeStrategicIterator st, TeRaster* raster, TePolygon& poly)
-{
-	TeCoordPairVect Segments = TeGetIntersections(poly, y);
-	double resy = raster->params().resy_;
-
-	//In polygon
-	if((st==TeBoxPixelIn) || (st==TeBBoxPixelInters))
-	{
-		bool empty=false;
-		if(Segments.empty())
-		{
-			empty = true;
-			y -= resy; 
-
-			while((y>=ymin) && (empty)) 
-			{
-				Segments = TeGetIntersections(poly, y);
-				if(!Segments.empty())
-					empty = false;
-				else
-					y -=resy;
-			}
-		}
-		if(!empty)
-		{
-			if (st==TeBoxPixelIn)
-			{
-				TePixelBoxInPoly strat(raster,y);
-				strat = for_each(Segments.begin (), Segments.end(), strat);
-				return strat.result();
-			}
-			else
-			{
-				TePixelBBInterPoly strat(raster,y);
-				strat = for_each(Segments.begin (), Segments.end(), strat);
-				return strat.result();
-			}
-		}
-	}
-	//Out polygon
-	else if((st==TeBoxPixelOut) || (st==TeBBoxPixelNotInters))
-	{
-		int nCols = raster->params().ncols_;
-	
-		//se o segmento for vazio, n�o h� interse��o entre essa linha e o pol�gono
-		//fazer um segmento de todas as colunas
-		if(Segments.empty())
-		{
-			//passar para indice: linha e coluna
-			TeCoord2D coordCM (xmin, y);
-			double linLC = (raster->coord2Index(coordCM)).y();
-			
-			int lin = TeRoundRasterIndex(linLC);
-			
-			TeCoord2D index1(0, lin);
-			TeCoord2D index2(nCols-1,lin);
-			
-			TeCoordPair pair(index1,index2);
-
-			Segments.push_back(pair);
-			return Segments;
-		}
-		else
-		{
-			TeCoordPairVect segsIn, segResult;
-			
-			if(st==TeBoxPixelOut)
-			{
-				TePixelBoxInPoly strat(raster,y);
-				//return the segments in the polygon
-				strat = for_each(Segments.begin (), Segments.end(), strat);
-				segsIn = strat.result();
-			}
-			else
-			{
-				TePixelBBInterPoly strat(raster,y);
-				//return the segments in the polygon
-				strat = for_each(Segments.begin (), Segments.end(), strat);
-				segsIn = strat.result();
-			}
-			
-			TeCoordPairVect::iterator it = segsIn.begin();
-
-			double colMin = 0;
-			double colMax = 0;
-			double lin = 0;
-
-			while(it!=segsIn.end())
-			{
-				TeCoord2D coord1 = (*it).pt1;
-				TeCoord2D coord2 = (*it).pt2;
-				lin = coord1.y();
-				
-				colMax = coord1.x()-1;
-
-				if (colMax >= colMin)
-				{
-					TeCoord2D index1(colMin, lin);
-					TeCoord2D index2(colMax, lin);
-				
-					TeCoordPair pair(index1,index2);
-
-					segResult.push_back(pair);
-				}
-				colMin = coord2.x()+1;
-				++it;
-			}
-
-			//Montar o �ltimo segmento
-			TeCoord2D index1(colMin, lin);
-			TeCoord2D index2(nCols-1,lin);
-			
-			TeCoordPair pair(index1,index2);
-			segResult.push_back(pair);
-			return segResult;
-		}
-	}
-	
-	return Segments;
-}
-
-
-
-TeRaster::TeRaster( TeRasterParams& pars ) 
-{
-	TeInitRasterDecoders();
-	decoder_ = 0;
-	string decName;
-	params_.status_ = TeRasterParams::TeNotReady;
-	pars.errorMessage_ = "";
-	if (pars.decoderIdentifier_.empty())   // the decoder is not specified in raster parameters
-	{	
-		if (!pars.fileName_.empty())     // try to guess from the file name
-		{	
-			string ext = TeConvertToUpperCase(TeGetExtension(pars.fileName_.c_str()));
-			decName = TeDecoderFactory::instanceName2Dec()[ext];
-			if ( decName.empty())
-			{
-				pars.errorMessage_ = "Can not instantiate a decoder from the raster file (or table) name.";
-				return;
-			}
-			pars.decoderIdentifier_ = decName;
-		}
-		else // no decoder type, and no filename
-		{
-			pars.errorMessage_ = "Can not instantiate a decoder for the raster data.";
-			return;
-		}
-	}
-	decoder_ = TeDecoderFactory::make(pars);
-	if (decoder_)
-	{
-		params_ = decoder_->params();
-		box_ = decoder_->params().box();
-	}
-}
-
-TeRaster::TeRaster( const string& filename, const char& mode ) 
-{
-	TeInitRasterDecoders();
-	params_.fileName_ = filename;
-	params_.mode_ = mode;
-	decoder_ = 0;
-	params_.status_ = TeRasterParams::TeNotReady;
-	string decName;
-	if (!filename.empty())
-	{
-		string ext = TeConvertToUpperCase(TeGetExtension(filename.c_str()));
-		decName = TeDecoderFactory::instanceName2Dec()[ext];
-		if (decName.empty())
-		{
-			params_.errorMessage_ = "Can not instantiate a decoder from the raster file (or table) name.";
-			return;
-		}
-	}
-	else
-	{
-		params_.errorMessage_ = "Can not instantiate a decoder for the raster data.";
-		return;
-	}
-	params_.decoderIdentifier_= decName;
-	decoder_ = TeDecoderFactory::make(params_);
-	if (decoder_)
-	{
-		params_ = decoder_->params();
-		box_ = decoder_->params().box();
-	}
-}
-
-
-TeRaster::TeRaster(int ncols, int nlines, int nbands, TeDataType elemType)
-{
-	params_.decoderIdentifier_= "MEM";
-	params_.ncols_ = ncols;
-	params_.nlines_ = nlines;
-	params_.nBands(nbands);
-	params_.setDataType(elemType);
-	params_.mode_ = 'c';
-	params_.lowerLeftResolutionSize(0.5,0.5,1.0,1.0,params_.ncols_,params_.nlines_,true);
-	TeProjection* proj = new TeNoProjection();
-	params_.projection(proj);
-	decoder_ = new TeDecoderMemory(params_);
-	delete proj;
-	if (decoder_)
-	{
-		params_ = decoder_->params();
-		box_ = decoder_->params().box();
-	}
-}
-
-
-TeRaster::~TeRaster( ) 
-{
-	if (decoder_)
-		delete decoder_;
-}
-
-void TeRaster::updateParams( TeRasterParams& par)
-{
-	params_ = par;	// update raster parameters
-	if (decoder_)
-		decoder_->updateParams(par);		// update its decoder parameters
-	box_ = params_.box();
-}
-
-void TeRaster::setDecoder( TeDecoder* dec )
-{ 
-	if (dec)
-	{
-		decoder_ = dec;					// set the decoder
-		params_ = decoder_->params();	// copy decoder parameters to raster
-		box_ = params_.box();
-	}
-}
-
-void TeRaster::clear()
-{
-	if (decoder_)
-		decoder_->clear();
-}
-
-TeRaster::iterator TeRaster::begin() 
-{
-	return iterator(0,0, params_.ncols_,params_.nlines_, params_.nBands(), this);
-}
-
-TeRaster::iterator TeRaster::end() 
-{
-	return iterator(params_.ncols_,params_.nlines_-1,params_.ncols_,params_.nlines_, params_.nBands(), this);
-}
-
-TeRaster::iteratorPoly TeRaster::end(TePolygon& poly, TeStrategicIterator st, int band) 
-{
-	return iteratorPoly(params_.ncols_,params_.nlines_-1,params_.ncols_,params_.nlines_, params_.nBands(), this, poly, st, band);
-}
-
-bool TeRaster::selectBlocks(TeBox& bb, int resFac, TeRasterParams& parBlock) 
-{
-	if (!decoder_)
-		return false;
-	return decoder_->selectBlocks(bb,resFac,parBlock);
-}
-
-int TeRaster::numberOfSelectedBlocks()
-{
-	if (!decoder_)
-		return 0;
-	return decoder_->numberOfSelectedBlocks();
-}
-
-bool TeRaster::fetchRasterBlock(TeDecoderMemory* memDec)
-{
-	if (!decoder_)
-		return false;
-	return decoder_->getSelectedRasterBlock(memDec);
-}
-
-void TeRaster::clearBlockSelection()
-{
-	if (!decoder_)
-		return ;
-	decoder_->clearBlockSelection();
-}
-
-void TeRaster::iterator::moveForward()
-{
-	this->operator++();
-}
-
-bool TeRaster::iterator::operator==(const iterator& rhs) const
-{
-	return (this->colCurrent_ == rhs.colCurrent_ && this->linCurrent_== rhs.linCurrent_);
-}
-
-bool TeRaster::iterator::operator!=(const iterator& rhs) const
-{
-	return (this->colCurrent_ != rhs.colCurrent_ || this->linCurrent_!= rhs.linCurrent_);
-}
-
-void TeRaster::iteratorPoly::moveForward()
-{
-	this->operator++();
-}
-
-bool TeRaster::init( TeRasterParams& pars )
-{ 
-	if (!decoder_ )	
-	{
-		params_.status_ = TeRasterParams::TeNotReady;
-		string decName;
-		if (params_.decoderIdentifier_.empty())   // the decoder is not especified in raster parameters
-		{	
-			if (!params_.fileName_.empty())     // try to guess from the file name
-			{	
-				string ext = TeConvertToUpperCase(TeGetExtension(params_.fileName_.c_str()));
-				decName = TeDecoderFactory::instanceName2Dec()[ext];
-				if ( decName.empty())
-				{
-					pars.errorMessage_ = "Can not instantiate a decoder from the raster file (or table) name.";
-					return false;
-				}
-				params_.decoderIdentifier_ = decName;
-			}
-			else // no decoder type, and no filename
-			{
-				pars.errorMessage_ = "Can not instantiate a decoder for the raster data.";
-				return false;
-			}
-		}
-		decoder_ = TeDecoderFactory::make(params_);
-		if (!decoder_)
-		{
-			pars.errorMessage_ = "Can not instantiate a decoder for the raster data.";
-			return false;
-		}
-	}
-	decoder_->init(pars);
-	params_ = decoder_->params();
-	box_ = decoder_->params().box();
-	return (params_.status_ != TeRasterParams::TeNotReady);
-}
-
-bool TeRaster::init()
-{ 
-	if (decoder_)
-	{
-		decoder_->init(params_);
-		params_ = decoder_->params();	
-		return (params_.status_ != TeRasterParams::TeNotReady);
-	}
-	params_.errorMessage_ = "There is no decoder associated to the raster data.";
-	return false;
-}
-
-bool TeRaster::setElement (int col, int lin, double val,int band)
-{
-	if (params_.status_!= TeRasterParams::TeReadyToWrite)
-	{
-		params_.errorMessage_ = "Raster is not properly initalizated to be written.";
-		return false;
-	}
-	if ( col < 0 || col >= params_.ncols_ ||
-		 lin < 0 || lin >= params_.nlines_ ||
-		 band < 0 || band >= params_.nBands())
-	{
-		params_.errorMessage_ = "Fail to access element out of the range of the raster dimensions.";
-		return false;
-	}
-
-	bool res = decoder_->setElement(col,lin,val,band);
-	if ( res && (!params_.useDummy_ || val != params_.dummy_[band]))
-	{
-		// check if should update min and max values
-		if (val < params_.vmin_[band])
-		{
-			params_.vmin_[band] = val;
-			decoder_->params().vmin_[band] = val;
-		}
-
-		if (val > params_.vmax_[band])
-		{
-			params_.vmax_[band] = val;
-			decoder_->params().vmax_[band] = val;
-		}
-	}
-	return res;
-}
-
-bool TeRaster::getElement (int col, int lin, double& val,int band) 
-{
-	if (!params_.status_ || col < 0 || col >= params_.ncols_  || 
-		 lin < 0 || lin >= params_.nlines_  ||
-		 band < 0 || band >= params_.nBands())
-	{
-		params_.errorMessage_ = "Fail to access element out of the range of the raster dimensions.";
-		return false;
-	}
-
-	if (decoder_->getElement (col,lin,val,band) && 
-	   (!params_.useDummy_ || val != params_.dummy_[band]))	
-		return true;
-	else
-		return false;
-}
-
-bool TeRaster::setElement(int col, int lin, double Rval, double Gval, double Bval, unsigned int transp) 
-{
-	if (params_.status_!= TeRasterParams::TeReadyToWrite)
-	{
-		params_.errorMessage_ = "Raster is not properly initalizated to be written.";
-		return false;
-	}
-	if ( params_.nBands() != 3 ||
-		 col < 0 || col >= params_.ncols_ ||
-		 lin < 0 || lin >= params_.nlines_ )
-	{
-		params_.errorMessage_ = "Fail to access element out of the range of the raster dimensions.";
-		return false;
-	}
-	return decoder_->setElementRGB(col, lin, Rval, Gval, Bval, transp);
-}
-
-TeRaster::iteratorPoly 
-TeRaster::begin(TePolygon& poly, TeStrategicIterator st, int band)
-{
-	double	minLinLC, maxLinLC, minColLC, maxColLC; //index
-	double	minLinCM, maxLinCM, minColCM, maxColCM; //world coordinates 
-	int		nlines = 0; 
-	int		ncols = 0;
-	double	resy = params_.resy_;
-	bool	end = false;
-
-	//box (world coordinates) of the polygon
-	TeBox boxPol = poly.box();
-	if((st==TeBoxPixelOut) || (st==TeBBoxPixelNotInters))  //out polygon
-	{
-		minLinLC = (params_.nlines_-1);
-		maxLinLC = 0.0;
-		minColLC = 0.0;
-		maxColLC = (params_.ncols_-1);
-	}
-	else  //in polygon
-	{
-		//change to line and column index
-		TeCoord2D minColLinLC = coord2Index(boxPol.lowerLeft());
-		TeCoord2D maxColLinLC = coord2Index(boxPol.upperRight());
-
-		//segment that pass by center of the element  
-		minLinLC = TeRound(minColLinLC.y());
-		maxLinLC = TeRound(maxColLinLC.y());
-		minColLC = TeRound(minColLinLC.x());
-		maxColLC = TeRound(maxColLinLC.x());
-		
-		//number of lines and columns of the polygon box 
-		nlines = (int)((minLinLC - maxLinLC)+1);
-		ncols = (int)((maxColLC - minColLC)+1);
-
-
-		//if is negative 
-		if(minLinLC<-0.5)
-		{
-			if(maxLinLC<-0.5)
-				end=true;
-			else
-				minLinLC = -0.5;
-		}
-
-		if(minColLC<-0.5)
-		{
-			if(maxColLC<-0.5)
-				end=true;
-			else
-				minColLC = -0.5;
-		}
-	}
-	
-	TeCoord2D MinColLinLC(minColLC, minLinLC); 
-	TeCoord2D MaxColLinLC(maxColLC, maxLinLC);
-
-	//calculate the minimal and maximal line and minimal column (in world coordinates) 
-	TeCoord2D MinColLinCM = index2Coord(MinColLinLC);
-	minLinCM = MinColLinCM.y();
-	minColCM = MinColLinCM.x();
-	maxLinCM = index2Coord(MaxColLinLC).y();
-	maxColCM = index2Coord(MaxColLinLC).x();
-
-	TeCoordPairVect segRes;
-	bool empty = true;
-	bool first = true;
-	
-	while(empty && (maxLinCM >= minLinCM))  
-	{
-		if(!first)
-		{
-			maxLinCM -= resy;
-			TeCoord2D maxColLinLC = coord2Index(TeCoord2D(maxColCM,maxLinCM));
-			maxLinLC = TeRound(maxColLinLC.y());
-		}
-			
-		segRes = applyStrategic(maxLinCM, minLinCM, minColCM, st, this, poly);
-		empty = segRes.empty();
-		first = false;
-	}
-
-	if(!segRes.empty())
-	{
-		minColLC = segRes[0].pt1.x();
-		double lMin = segRes[0].pt1.y();
-		maxColLC = segRes[0].pt2.x();
-	
-		int cCurr = TeRound(minColLC);  //column current
-		int lCurr = TeRound(lMin);		//line current
-
-		iteratorPoly itPoly(cCurr, lCurr, params_.ncols_, params_.nlines_, params_.nBands(), this, poly, 
-						st, maxLinLC, minLinLC, minColLC, maxColLC, segRes, 
-						0, nlines, ncols, end, minLinCM);
-		return itPoly;
-	
-	}
-	else
-	{
-		iteratorPoly itPoly = this->end(poly, st, band);
-		return itPoly;
-	}
-}
-
-
-bool
-TeRaster::fillRaster(TeRaster* dstRaster, TeRasterTransform* transf, bool bestRes)
-{	
-	if (!dstRaster ||
-		 dstRaster->params().status_ != TeRasterParams::TeReadyToWrite)
-	{
-		params_.errorMessage_ == "Destination raster non-existing or not ready to write";
-		return false;
-	}
-
-	if (params_.status_ != TeRasterParams::TeReadyToRead &&
-		params_.status_ != TeRasterParams::TeReadyToWrite)
-	{
-		params_.errorMessage_ == "Raster not ready to be extracted";
-		return false;
-	}
-
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-
-	TeRasterRemap fillRemap;
-	fillRemap.setOutput(dstRaster);
-	fillRemap.setInput(this);
-	if (transf)
-		fillRemap.setTransformer(transf);
-	int res = 1;
-	TeBox b = dstRaster->params().boundingBox();
-	if (bestRes)
-	   res = decoder_->bestResolution(b, dstRaster->params().nlines_, dstRaster->params().ncols_,
-									  dstRaster->params().projection());
-	this->clearBlockSelection();
-	bool result = true;
-	TeRasterParams parBlock;
-	if (selectBlocks(b, res, parBlock))
-	{
-		if (TeProgress::instance())
-			TeProgress::instance()->setTotalSteps(this->numberOfSelectedBlocks());
-		TeRaster* block = new TeRaster;
-		TeDecoderMemory* decMem = new TeDecoderMemory(parBlock);
-		decMem->init();
-		int n = 0;
-		t2 = clock();
-		t0 = t1 = t2;
-		bool flag = true;
-		do
-		{
-			flag = fetchRasterBlock(decMem);
-			block->setDecoder(decMem);
-			fillRemap.setInput(block);
-			if (!fillRemap.apply())
-				break;
-			n++;
-			if (TeProgress::instance())
-			{
-				t2 = clock();
-				if (int(t2-t1) > dt)
-				{
-					t1 = t2;
-					if (TeProgress::instance()->wasCancelled())
-						break;
-					if((int)(t2-t0) > dt2)	// show progress 
-						TeProgress::instance()->setProgress(n);
-				}
-			}
-		}while (flag);
-		decMem->clear();
-		delete block;
-	}
-	else
-		result =  fillRemap.apply();
-	this->clearBlockSelection();
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return result;
-}
-
-//! Prefix move forward operator
-TeRaster::iterator& 
-TeRaster::iterator::operator++()
-{
-	if (++colCurrent_ == nCols_)
-	{
-		if (linCurrent_ < nLines_-1)
-		{
-			linCurrent_++;
-			colCurrent_ = 0;
-		}
-	}
-	return *this;
-}
-
-TeRaster::iterator
-TeRaster::iterator::operator++(int)	
-{
-	iterator temp = *this;
-	++(*this);
-	return temp;
-}
-
-vector<double> 
-TeRaster::iterator::operator*()
-{
-	vector<double> vt(nBands_);
-	if ((linCurrent_ < nLines_) && (colCurrent_ < nCols_))
-	{
-		for (int n=0; n<nBands_; n++)
-			raster_->getElement(colCurrent_,linCurrent_,vt[n],n);
-	}
-	return vt;
-}
-
-double 
-TeRaster::iterator::operator*(int band)
-{
-	double val = this->raster_->params().dummy_[band];
-	if ((linCurrent_ < nLines_) && (colCurrent_ < nCols_))
-	{
-		if (raster_->getElement(colCurrent_,linCurrent_,val,band))
-			return val;
-	}
-	return val;
-}
-
-void 
-TeRaster::iteratorPoly::getNewSegment(int linCurr)
-{
-	//change to world coordinates
-	TeCoord2D coord(colMin_,linCurr);
-	TeCoord2D colLinCM = raster_->index2Coord(coord);
-	
-	double linCM = colLinCM.y();
-	double colMinCM = colLinCM.x();
-	
-	//applyStrategic: return the segments 
-	segments_ = applyStrategic(linCM, linMinCM_, colMinCM, strategy_, raster_, poly_);
-
-	if(segments_.empty())
-	{
-		colCurrent_=(int)colMax_;
-		return;
-	}
-	
-	colMin_ = segments_[0].pt1.x();
-	colMax_ = segments_[0].pt2.x();
-	
-	colCurrent_=(int)colMin_;
-	posSegments_ = 0;
-	end_ = false;
-}
-
-//! Prefix move forward operator
-TeRaster::iteratorPoly& 
-TeRaster::iteratorPoly::operator++() //prefix
-{
-	if (++colCurrent_>colMax_)
-	{
-		if((++posSegments_ > (int)(segments_.size()-1)) || (segments_.size()<1))
-		{
-			if(++linCurrent_>linMax_)
-			{
-				end_ = true;
-				*this = raster_->end(poly_,strategy_);
-			}
-			else
-			{	
-				segments_.clear();
-				do
-				{
-					getNewSegment(linCurrent_);
-					if (segments_.empty())
-						linCurrent_++;
-					else
-						break;
-				} while (linCurrent_<=linMax_);
-				if (linCurrent_ > linMax_)
-				{
-					end_ = true;
-					*this = raster_->end(poly_,strategy_);
-				}
-			}
-		}
-		else
-		{
-			colMin_ = segments_[posSegments_].pt1.x();
-			colMax_ = segments_[posSegments_].pt2.x();
-			colCurrent_=(int)colMin_;
-		}
-	}
-	return *this;
-}
-
-TeRaster::iteratorPoly 
-TeRaster::iteratorPoly::operator++(int)
-{
-	iteratorPoly temp = *this;
-	++(*this);
-	return temp;
-}
-
-double 
-TeRaster::iteratorPoly::operator*() 
-{
-	double val = 0.0;
-	if ((linCurrent_ < nLines_) && (colCurrent_ < nCols_))
-	{
-		if (raster_->getElement(colCurrent_,linCurrent_,val,band_))
-			return val;
-	}
-	return 0.0;
-}
-
-//! Returns the value of a given band of the element pointed by the iterator 
-double 
-TeRaster::iteratorPoly::operator*(int band)
-{
-	double val = 0.0;
-	if ((linCurrent_ < nLines_) && (colCurrent_ < nCols_))
-	{
-		raster_->getElement(colCurrent_,linCurrent_,val,band);
-		return val;
-	}
-	return 0.0;
-}
-
-bool 
-TeRaster::iteratorPoly::getProperty(TeProperty& prop) 
-{
-	double val = 0.0;
-	prop.attr_.rep_.type_ = TeREAL;
-	if (!raster_) prop.attr_.rep_.name_ = raster_->params().fileName_ + Te2String(band_);
-	prop.value_ = Te2String (val);
-	
-	if ((linCurrent_ < nLines_) && (colCurrent_ < nCols_))
-	{
-		if (raster_->getElement(colCurrent_,linCurrent_,val,band_))
-		{
-			prop.value_ = Te2String(val);
-			return true;
-		}
-	}
-	return false;
-}
-
-TeRaster*
-TeRasterClipping(TeRaster* whole, TePolygonSet& mask, TeProjection* geomProj, const string& clipName, double background, const string& decId)
-{
-  if( decId.empty() ) {
-    throw TeException( UNKNOWN_DECODER_TECHNOLOGY_TYPE, "Invalid decoder", 
-      false );
-  }
-  
-  if( whole == 0 ) {
-    throw TeException( UNKNOWN_ERROR_TYPE, "Invalid raster pointer", 
-      false );
-  }  
-
-  if( mask.empty() ) {
-    throw TeException( UNKNOWN_ERROR_TYPE, "Invalid polygon set mask", 
-      false );
-  }  
-  
-  if( ( decId != "MEM" ) && clipName.empty() ) {
-    throw TeException( UNKNOWN_ERROR_TYPE, "Invalid clipname", 
-      false );
-  }    
-    
-  if( geomProj == 0 ) {
-    throw TeException( UNKNOWN_ERROR_TYPE, "Invalid projection pointer", 
-      false );
-  }    
-
-	if (whole->params().status_ != TeRasterParams::TeReadyToRead && 
-		whole->params().status_ != TeRasterParams::TeReadyToWrite )
-		return 0;
-	
-	bool isEqualProj = (*whole->projection() == *geomProj);
-	if (!isEqualProj &&
-		(geomProj->name() == "NoProjection" || whole->projection()->name() == "NoProjection"))
-		return 0;
-
-	TePolygonSet mask2;
-	if (!isEqualProj)
-		TeVectorRemap(mask,geomProj,mask2,whole->projection());
-	else
-		mask2 = mask;
-
-	if (!TeIntersects(mask2.box(),whole->params().boundingBox()))
-		return 0;
-
-	TeRasterParams par = whole->params();
-	if (!decId.empty())
-	{
-		par.decoderIdentifier_ = decId;
-		if (decId == "DB")
-		{
-			if (!par.database_)
-				return 0;
-		}
-	}
-	par.fileName_ = clipName;
-	par.mode_ = 'c';
-	TeCoord2D bll = whole->coord2Index(mask2.box().lowerLeft());
-	TeCoord2D bur = whole->coord2Index(mask2.box().upperRight());
-	
-	bll = whole->index2Coord(TeCoord2D(TeRoundRasterIndex(bll.x_),TeRoundRasterIndex(bll.y_)));
-	bur = whole->index2Coord(TeCoord2D(TeRoundRasterIndex(bur.x_),TeRoundRasterIndex(bur.y_)));
-
-	par.boxResolution(bll.x_, bll.y_, bur.x_, bur.y_,par.resx_, par.resy_);
-	par.setDummy(background);
-	TeRaster*  clip = new TeRaster(par);
-	clip->init();
-	if (clip->params().status_ != TeRasterParams::TeReadyToWrite)
-		return 0;
-	
-	TeCoord2D cd = TeCoord2D(0,0);
-	TeCoord2D ul = clip->params().index2Coord(cd);
-	TeCoord2D dxdy = whole->params().coord2Index(ul);
-	int j = TeRoundRasterIndex(dxdy.x_); // column delta
-	int i = TeRoundRasterIndex(dxdy.y_); // line delta
-	unsigned int np = mask2.size();
-	unsigned int nb = whole->params().nBands();
-	unsigned int band;
-	double val;
-
-	//progress bar
-	if(TeProgress::instance())
-	{
-		string caption = "Raster Clipping operation";
-		TeProgress::instance()->setCaption(caption.c_str());
-		string msg = "Executing clipping operation. Please, wait!";
-		TeProgress::instance()->setMessage(msg);
-		TeProgress::instance()->setTotalSteps(np);
-	}
-	for (unsigned int p=0; p<np; ++p)
-	{
-		TeRaster::iteratorPoly it = whole->begin(mask2[p],TeBoxPixelIn);
-		while (!it.end())
-		{
-			for(band = 0; band < nb; ++band)
-			{
-				if (whole->getElement(it.currentColumn(),it.currentLine(),val,band))
-					clip->setElement(it.currentColumn()-j,it.currentLine()-i,val,band);
-			}
-			++it;
-		}
-		//progress bar
-		if(TeProgress::instance())
-		{
-			if(TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				break;
-			}
-			TeProgress::instance()->setProgress(p);
-		}
-	}
-	if(TeProgress::instance())
-		TeProgress::instance()->reset();
-	return clip;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <TeRaster.h>
+#include <TeDecoder.h>
+#include <TeUtils.h>
+#include <TeStdFile.h>
+#include <TeException.h>
+#include "TeRasterRemap.h"
+#include "TeDecoderMemory.h"
+#include <TeInitRasterDecoders.h>
+#include <TeVectorRemap.h>
+#include <algorithm>
+
+
+//!	virtual class that define the strategics of the iteratorPoly, each strategic is a functor
+class TeStrategic
+{
+protected:
+	TeRaster*		raster_;
+	double			y_;
+	TeCoordPairVect	SegOut_;   //line and column index 
+
+public:
+	TeStrategic(TeRaster* r=0, double y=0): raster_(r), y_(y) {}
+
+    virtual ~TeStrategic() {}
+
+	void Init(TeRaster* r, double y)
+	{
+		raster_ = r;
+		y_ = y;
+	}
+	
+	virtual void strateg(double xMin, double xMax, double y) = 0;  
+
+	void operator() (TeCoordPair& pair)
+	{
+		//xmin and xmax of the segment (line and column index)
+		TeCoord2D minSegLC = raster_->coord2Index(TeCoord2D(pair.pt1.x_, y_));
+		TeCoord2D maxSegLC = raster_->coord2Index(TeCoord2D(pair.pt2.x_, y_));
+
+		double xMinLCd = minSegLC.x_;
+		double xMaxLCd = maxSegLC.x_;
+		double yLC = maxSegLC.y_;
+		
+		//verify if is outside raster area 
+		if(xMinLCd < -0.5)
+		{
+			if(xMaxLCd < -0.5)
+				return;
+			else
+				xMinLCd = -0.5;
+		}
+		if(xMaxLCd > (raster_->params().ncols_ - 0.5))
+		{
+			if(xMinLCd > (raster_->params().ncols_ - 0.5))
+				return;
+			else
+				xMaxLCd = (raster_->params().ncols_ - 0.5);
+		}
+		strateg(xMinLCd, xMaxLCd, yLC);
+	}
+	TeCoordPairVect result() const {return SegOut_;}
+};
+
+
+//!	functor TePixelBoxInPoly
+/*
+	return the elements of the raster which box is 
+	contained in the polygon
+*/
+class TePixelBoxInPoly: public TeStrategic
+{
+
+public:
+	TePixelBoxInPoly(TeRaster* r=0, double y=0): TeStrategic(r,y) {}
+
+    virtual ~TePixelBoxInPoly() {}
+
+    void strateg(double xMin, double xMax, double y)
+	{
+		//verify if contain the element center 
+		int xMinLCi = TeRoundRasterIndex(xMin);
+		int xMaxLCi = TeRoundRasterIndex(xMax);
+		
+		if (xMinLCi < xMin)
+			xMinLCi++;
+
+		if (xMaxLCi > xMax)
+			xMaxLCi--;
+
+		if (xMinLCi <= xMaxLCi)
+		{
+			//new segment 
+			TeCoord2D minLC (xMinLCi, y);
+			TeCoord2D maxLC (xMaxLCi, y);
+
+			TeCoordPair res(minLC,maxLC);
+			SegOut_.push_back (res);
+		}
+	}
+	
+};
+
+
+//!	functor TePixelBBInterPoly
+/*
+	return the elements of the raster "cujo" boundingbox 
+	intersects the polygon
+*/
+class TePixelBBInterPoly: public TeStrategic
+{
+	
+public:
+	TePixelBBInterPoly(TeRaster* r=0, double y=0): TeStrategic(r,y) {}
+
+    virtual ~TePixelBBInterPoly() {}
+
+	void strateg(double xMin, double xMax, double y)
+	{		
+		//element center 
+		int xMinLCi = TeRoundRasterIndex(xMin);
+		int xMaxLCi = TeRoundRasterIndex(xMax);
+
+		if (SegOut_.size()>0)
+		{
+			TeCoordPair prev = SegOut_[SegOut_.size()-1];
+			if (xMinLCi == prev.pt2.x())
+				xMinLCi++;
+			if (xMinLCi > xMaxLCi)
+				return;
+		}
+		
+		TeCoord2D minLC (xMinLCi, y);
+		TeCoord2D maxLC (xMaxLCi, y);
+			
+		TeCoordPair res(minLC,maxLC);
+
+		SegOut_.push_back (res);
+	}
+};
+
+
+TeCoordPairVect 
+applyStrategic(double& y, double ymin, double xmin, TeStrategicIterator st, TeRaster* raster, const TePolygon& poly)
+{
+	TeCoordPairVect Segments = TeGetIntersections(poly, y);
+	double resy = raster->params().resy_;
+
+	//In polygon
+	if((st==TeBoxPixelIn) || (st==TeBBoxPixelInters))
+	{
+		bool empty=false;
+		if(Segments.empty())
+		{
+			empty = true;
+			y -= resy; 
+
+			while((y>=ymin) && (empty)) 
+			{
+				Segments = TeGetIntersections(poly, y);
+				if(!Segments.empty())
+					empty = false;
+				else
+					y -=resy;
+			}
+		}
+		if(!empty)
+		{
+			if (st==TeBoxPixelIn)
+			{
+				TePixelBoxInPoly strat(raster,y);
+				strat = for_each(Segments.begin (), Segments.end(), strat);
+				return strat.result();
+			}
+			else
+			{
+				TePixelBBInterPoly strat(raster,y);
+				strat = for_each(Segments.begin (), Segments.end(), strat);
+				return strat.result();
+			}
+		}
+	}
+	//Out polygon
+	else if((st==TeBoxPixelOut) || (st==TeBBoxPixelNotInters))
+	{
+		int nCols = raster->params().ncols_;
+	
+		//se o segmento for vazio, n�o h� interse��o entre essa linha e o pol�gono
+		//fazer um segmento de todas as colunas
+		if(Segments.empty())
+		{
+			//passar para indice: linha e coluna
+			TeCoord2D coordCM (xmin, y);
+			double linLC = (raster->coord2Index(coordCM)).y();
+			
+			int lin = TeRoundRasterIndex(linLC);
+			
+			TeCoord2D index1(0, lin);
+			TeCoord2D index2(nCols-1,lin);
+			
+			TeCoordPair pair(index1,index2);
+
+			Segments.push_back(pair);
+			return Segments;
+		}
+		else
+		{
+			TeCoordPairVect segsIn, segResult;
+			
+			if(st==TeBoxPixelOut)
+			{
+				TePixelBoxInPoly strat(raster,y);
+				//return the segments in the polygon
+				strat = for_each(Segments.begin (), Segments.end(), strat);
+				segsIn = strat.result();
+			}
+			else
+			{
+				TePixelBBInterPoly strat(raster,y);
+				//return the segments in the polygon
+				strat = for_each(Segments.begin (), Segments.end(), strat);
+				segsIn = strat.result();
+			}
+			
+			TeCoordPairVect::iterator it = segsIn.begin();
+
+			double colMin = 0;
+			double colMax = 0;
+			double lin = 0;
+
+			while(it!=segsIn.end())
+			{
+				TeCoord2D coord1 = (*it).pt1;
+				TeCoord2D coord2 = (*it).pt2;
+				lin = coord1.y();
+				
+				colMax = coord1.x()-1;
+
+				if (colMax >= colMin)
+				{
+					TeCoord2D index1(colMin, lin);
+					TeCoord2D index2(colMax, lin);
+				
+					TeCoordPair pair(index1,index2);
+
+					segResult.push_back(pair);
+				}
+				colMin = coord2.x()+1;
+				++it;
+			}
+
+			//Montar o �ltimo segmento
+			TeCoord2D index1(colMin, lin);
+			TeCoord2D index2(nCols-1,lin);
+			
+			TeCoordPair pair(index1,index2);
+			segResult.push_back(pair);
+			return segResult;
+		}
+	}
+	
+	return Segments;
+}
+
+
+
+TeRaster::TeRaster( TeRasterParams& pars ) 
+{
+	TeInitRasterDecoders();
+	decoder_ = 0;
+	string decName;
+	params_.status_ = TeRasterParams::TeNotReady;
+	pars.errorMessage_ = "";
+	if (pars.decoderIdentifier_.empty())   // the decoder is not specified in raster parameters
+	{	
+		if (!pars.fileName_.empty())     // try to guess from the file name
+		{	
+			string ext = TeConvertToUpperCase(TeGetExtension(pars.fileName_.c_str()));
+			decName = TeDecoderFactory::instanceName2Dec()[ext];
+			if ( decName.empty())
+			{
+				pars.errorMessage_ = "Can not instantiate a decoder from the raster file (or table) name.";
+				return;
+			}
+			pars.decoderIdentifier_ = decName;
+		}
+		else // no decoder type, and no filename
+		{
+			pars.errorMessage_ = "Can not instantiate a decoder for the raster data.";
+			return;
+		}
+	}
+	decoder_ = TeDecoderFactory::make(pars);
+	if (decoder_)
+	{
+		params_ = decoder_->params();
+		box_ = decoder_->params().box();
+	}
+}
+
+TeRaster::TeRaster( const string& filename, const char& mode ) 
+{
+	TeInitRasterDecoders();
+	params_.fileName_ = filename;
+	params_.mode_ = mode;
+	decoder_ = 0;
+	params_.status_ = TeRasterParams::TeNotReady;
+	string decName;
+	if (!filename.empty())
+	{
+		string ext = TeConvertToUpperCase(TeGetExtension(filename.c_str()));
+		decName = TeDecoderFactory::instanceName2Dec()[ext];
+		if (decName.empty())
+		{
+			params_.errorMessage_ = "Can not instantiate a decoder from the raster file (or table) name.";
+			return;
+		}
+	}
+	else
+	{
+		params_.errorMessage_ = "Can not instantiate a decoder for the raster data.";
+		return;
+	}
+	params_.decoderIdentifier_= decName;
+	decoder_ = TeDecoderFactory::make(params_);
+	if (decoder_)
+	{
+		params_ = decoder_->params();
+		box_ = decoder_->params().box();
+	}
+}
+
+
+TeRaster::TeRaster(int ncols, int nlines, int nbands, TeDataType elemType)
+{
+	params_.decoderIdentifier_= "MEM";
+	params_.ncols_ = ncols;
+	params_.nlines_ = nlines;
+	params_.nBands(nbands);
+	params_.setDataType(elemType);
+	params_.mode_ = 'c';
+	params_.lowerLeftResolutionSize(0.5,0.5,1.0,1.0,params_.ncols_,params_.nlines_,true);
+	TeProjection* proj = new TeNoProjection();
+	params_.projection(proj);
+	decoder_ = new TeDecoderMemory(params_);
+	delete proj;
+	if (decoder_)
+	{
+		params_ = decoder_->params();
+		box_ = decoder_->params().box();
+	}
+}
+
+
+TeRaster::~TeRaster( ) 
+{
+	if (decoder_)
+		delete decoder_;
+}
+
+void TeRaster::updateParams( TeRasterParams& par)
+{
+	params_ = par;	// update raster parameters
+	if (decoder_)
+		decoder_->updateParams(par);		// update its decoder parameters
+	box_ = params_.box();
+}
+
+void TeRaster::setDecoder( TeDecoder* dec )
+{ 
+	if (dec)
+	{
+		decoder_ = dec;					// set the decoder
+		params_ = decoder_->params();	// copy decoder parameters to raster
+		box_ = params_.box();
+	}
+}
+
+void TeRaster::clear()
+{
+	if (decoder_)
+		decoder_->clear();
+}
+
+TeRaster::iterator TeRaster::begin() 
+{
+	return iterator(0,0, params_.ncols_,params_.nlines_, params_.nBands(), this);
+}
+
+TeRaster::iterator TeRaster::end() 
+{
+	return iterator(params_.ncols_,params_.nlines_-1,params_.ncols_,params_.nlines_, params_.nBands(), this);
+}
+
+TeRaster::iteratorPoly TeRaster::end(const TePolygon& poly, TeStrategicIterator st, int band) 
+{
+	return iteratorPoly(params_.ncols_,params_.nlines_-1,params_.ncols_,params_.nlines_, params_.nBands(), this, poly, st, band);
+}
+
+bool TeRaster::selectBlocks(TeBox& bb, int resFac, TeRasterParams& parBlock) 
+{
+	if (!decoder_)
+		return false;
+	return decoder_->selectBlocks(bb,resFac,parBlock);
+}
+
+int TeRaster::numberOfSelectedBlocks()
+{
+	if (!decoder_)
+		return 0;
+	return decoder_->numberOfSelectedBlocks();
+}
+
+bool TeRaster::fetchRasterBlock(TeDecoderMemory* memDec)
+{
+	if (!decoder_)
+		return false;
+	return decoder_->getSelectedRasterBlock(memDec);
+}
+
+void TeRaster::clearBlockSelection()
+{
+	if (!decoder_)
+		return ;
+	decoder_->clearBlockSelection();
+}
+
+void TeRaster::iterator::moveForward()
+{
+	this->operator++();
+}
+
+bool TeRaster::iterator::operator==(const iterator& rhs) const
+{
+	return (this->colCurrent_ == rhs.colCurrent_ && this->linCurrent_== rhs.linCurrent_);
+}
+
+bool TeRaster::iterator::operator!=(const iterator& rhs) const
+{
+	return (this->colCurrent_ != rhs.colCurrent_ || this->linCurrent_!= rhs.linCurrent_);
+}
+
+void TeRaster::iteratorPoly::moveForward()
+{
+	this->operator++();
+}
+
+bool TeRaster::init( TeRasterParams& pars )
+{ 
+	if (!decoder_ )	
+	{
+		params_.status_ = TeRasterParams::TeNotReady;
+		string decName;
+		if (params_.decoderIdentifier_.empty())   // the decoder is not especified in raster parameters
+		{	
+			if (!params_.fileName_.empty())     // try to guess from the file name
+			{	
+				string ext = TeConvertToUpperCase(TeGetExtension(params_.fileName_.c_str()));
+				decName = TeDecoderFactory::instanceName2Dec()[ext];
+				if ( decName.empty())
+				{
+					pars.errorMessage_ = "Can not instantiate a decoder from the raster file (or table) name.";
+					return false;
+				}
+				params_.decoderIdentifier_ = decName;
+			}
+			else // no decoder type, and no filename
+			{
+				pars.errorMessage_ = "Can not instantiate a decoder for the raster data.";
+				return false;
+			}
+		}
+		decoder_ = TeDecoderFactory::make(params_);
+		if (!decoder_)
+		{
+			pars.errorMessage_ = "Can not instantiate a decoder for the raster data.";
+			return false;
+		}
+	}
+	decoder_->init(pars);
+	params_ = decoder_->params();
+	box_ = decoder_->params().box();
+	return (params_.status_ != TeRasterParams::TeNotReady);
+}
+
+bool TeRaster::init()
+{ 
+	if (decoder_)
+	{
+		decoder_->init(params_);
+		params_ = decoder_->params();	
+		return (params_.status_ != TeRasterParams::TeNotReady);
+	}
+	params_.errorMessage_ = "There is no decoder associated to the raster data.";
+	return false;
+}
+
+bool TeRaster::setElement (int col, int lin, double val,int band)
+{
+	if (params_.status_!= TeRasterParams::TeReadyToWrite)
+	{
+		params_.errorMessage_ = "Raster is not properly initalizated to be written.";
+		return false;
+	}
+	if ( col < 0 || col >= params_.ncols_ ||
+		 lin < 0 || lin >= params_.nlines_ ||
+		 band < 0 || band >= params_.nBands())
+	{
+		params_.errorMessage_ = "Fail to access element out of the range of the raster dimensions.";
+		return false;
+	}
+
+	bool res = decoder_->setElement(col,lin,val,band);
+	if ( res && (!params_.useDummy_ || val != params_.dummy_[band]))
+	{
+		// check if should update min and max values
+		if (val < params_.vmin_[band])
+		{
+			params_.vmin_[band] = val;
+			decoder_->params().vmin_[band] = val;
+		}
+
+		if (val > params_.vmax_[band])
+		{
+			params_.vmax_[band] = val;
+			decoder_->params().vmax_[band] = val;
+		}
+	}
+	return res;
+}
+
+bool TeRaster::getElement (int col, int lin, double& val,int band) 
+{
+	if (!params_.status_ || col < 0 || col >= params_.ncols_  || 
+		 lin < 0 || lin >= params_.nlines_  ||
+		 band < 0 || band >= params_.nBands())
+	{
+		params_.errorMessage_ = "Fail to access element out of the range of the raster dimensions.";
+		return false;
+	}
+
+	if (decoder_->getElement (col,lin,val,band) && 
+	   (!params_.useDummy_ || val != params_.dummy_[band]))	
+		return true;
+	else
+		return false;
+}
+
+bool TeRaster::setElement(int col, int lin, double Rval, double Gval, double Bval, unsigned int transp) 
+{
+	if (params_.status_!= TeRasterParams::TeReadyToWrite)
+	{
+		params_.errorMessage_ = "Raster is not properly initalizated to be written.";
+		return false;
+	}
+	if ( params_.nBands() != 3 ||
+		 col < 0 || col >= params_.ncols_ ||
+		 lin < 0 || lin >= params_.nlines_ )
+	{
+		params_.errorMessage_ = "Fail to access element out of the range of the raster dimensions.";
+		return false;
+	}
+	return decoder_->setElementRGB(col, lin, Rval, Gval, Bval, transp);
+}
+
+TeRaster::iteratorPoly 
+TeRaster::begin(const TePolygon& poly, TeStrategicIterator st, int band)
+{
+	double	minLinLC, maxLinLC, minColLC, maxColLC; //index
+	double	minLinCM, maxLinCM, minColCM, maxColCM; //world coordinates 
+	int		nlines = 0; 
+	int		ncols = 0;
+	double	resy = params_.resy_;
+	bool	end = false;
+
+	//box (world coordinates) of the polygon
+	TeBox boxPol = poly.box();
+	if((st==TeBoxPixelOut) || (st==TeBBoxPixelNotInters))  //out polygon
+	{
+		minLinLC = (params_.nlines_-1);
+		maxLinLC = 0.0;
+		minColLC = 0.0;
+		maxColLC = (params_.ncols_-1);
+	}
+	else  //in polygon
+	{
+		//change to line and column index
+		TeCoord2D minColLinLC = coord2Index(boxPol.lowerLeft());
+		TeCoord2D maxColLinLC = coord2Index(boxPol.upperRight());
+
+		//segment that pass by center of the element  
+		minLinLC = TeRound(minColLinLC.y());
+		maxLinLC = TeRound(maxColLinLC.y());
+		minColLC = TeRound(minColLinLC.x());
+		maxColLC = TeRound(maxColLinLC.x());
+		
+		//number of lines and columns of the polygon box 
+		nlines = (int)((minLinLC - maxLinLC)+1);
+		ncols = (int)((maxColLC - minColLC)+1);
+
+
+		//if is negative 
+		if(minLinLC<-0.5)
+		{
+			if(maxLinLC<-0.5)
+				end=true;
+			else
+				minLinLC = -0.5;
+		}
+
+		if(minColLC<-0.5)
+		{
+			if(maxColLC<-0.5)
+				end=true;
+			else
+				minColLC = -0.5;
+		}
+	}
+	
+	TeCoord2D MinColLinLC(minColLC, minLinLC); 
+	TeCoord2D MaxColLinLC(maxColLC, maxLinLC);
+
+	//calculate the minimal and maximal line and minimal column (in world coordinates) 
+	TeCoord2D MinColLinCM = index2Coord(MinColLinLC);
+	minLinCM = MinColLinCM.y();
+	minColCM = MinColLinCM.x();
+	maxLinCM = index2Coord(MaxColLinLC).y();
+	maxColCM = index2Coord(MaxColLinLC).x();
+
+	TeCoordPairVect segRes;
+	bool empty = true;
+	bool first = true;
+	
+	while(empty && (maxLinCM >= minLinCM))  
+	{
+		if(!first)
+		{
+			maxLinCM -= resy;
+			TeCoord2D maxColLinLC = coord2Index(TeCoord2D(maxColCM,maxLinCM));
+			maxLinLC = TeRound(maxColLinLC.y());
+		}
+			
+		segRes = applyStrategic(maxLinCM, minLinCM, minColCM, st, this, poly);
+		empty = segRes.empty();
+		first = false;
+	}
+
+	if(!segRes.empty())
+	{
+		minColLC = segRes[0].pt1.x();
+		double lMin = segRes[0].pt1.y();
+		maxColLC = segRes[0].pt2.x();
+	
+		int cCurr = TeRound(minColLC);  //column current
+		int lCurr = TeRound(lMin);		//line current
+
+		iteratorPoly itPoly(cCurr, lCurr, params_.ncols_, params_.nlines_, params_.nBands(), this, poly, 
+						st, maxLinLC, minLinLC, minColLC, maxColLC, segRes, 
+						0, nlines, ncols, end, minLinCM);
+		return itPoly;
+	
+	}
+	else
+	{
+		iteratorPoly itPoly = this->end(poly, st, band);
+		return itPoly;
+	}
+}
+
+
+bool
+TeRaster::fillRaster(TeRaster* dstRaster, TeRasterTransform* transf, bool bestRes)
+{	
+	if (!dstRaster ||
+		 dstRaster->params().status_ != TeRasterParams::TeReadyToWrite)
+	{
+		params_.errorMessage_ == "Destination raster non-existing or not ready to write";
+		return false;
+	}
+
+	if (params_.status_ != TeRasterParams::TeReadyToRead &&
+		params_.status_ != TeRasterParams::TeReadyToWrite)
+	{
+		params_.errorMessage_ == "Raster not ready to be extracted";
+		return false;
+	}
+
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+
+	TeRasterRemap fillRemap;
+	fillRemap.setOutput(dstRaster);
+	fillRemap.setInput(this);
+	if (transf)
+		fillRemap.setTransformer(transf);
+	int res = 1;
+	TeBox b = dstRaster->params().boundingBox();
+	if (bestRes)
+	   res = decoder_->bestResolution(b, dstRaster->params().nlines_, dstRaster->params().ncols_,
+									  dstRaster->params().projection());
+	this->clearBlockSelection();
+	bool result = true;
+	TeRasterParams parBlock;
+	if (selectBlocks(b, res, parBlock))
+	{
+		if (TeProgress::instance())
+			TeProgress::instance()->setTotalSteps(this->numberOfSelectedBlocks());
+		TeRaster* block = new TeRaster;
+		TeDecoderMemory* decMem = new TeDecoderMemory(parBlock);
+		decMem->init();
+		int n = 0;
+		t2 = clock();
+		t0 = t1 = t2;
+		bool flag = true;
+		do
+		{
+			flag = fetchRasterBlock(decMem);
+			block->setDecoder(decMem);
+			fillRemap.setInput(block);
+			if (!fillRemap.apply())
+				break;
+			n++;
+			if (TeProgress::instance())
+			{
+				t2 = clock();
+				if (int(t2-t1) > dt)
+				{
+					t1 = t2;
+					if (TeProgress::instance()->wasCancelled())
+						break;
+					if((int)(t2-t0) > dt2)	// show progress 
+						TeProgress::instance()->setProgress(n);
+				}
+			}
+		}while (flag);
+		decMem->clear();
+		delete block;
+	}
+	else
+		result =  fillRemap.apply();
+	this->clearBlockSelection();
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return result;
+}
+
+//! Prefix move forward operator
+TeRaster::iterator& 
+TeRaster::iterator::operator++()
+{
+	if (++colCurrent_ == nCols_)
+	{
+		if (linCurrent_ < nLines_-1)
+		{
+			linCurrent_++;
+			colCurrent_ = 0;
+		}
+	}
+	return *this;
+}
+
+TeRaster::iterator
+TeRaster::iterator::operator++(int)	
+{
+	iterator temp = *this;
+	++(*this);
+	return temp;
+}
+
+vector<double> 
+TeRaster::iterator::operator*()
+{
+	vector<double> vt(nBands_);
+	if ((linCurrent_ < nLines_) && (colCurrent_ < nCols_))
+	{
+		for (int n=0; n<nBands_; n++)
+			raster_->getElement(colCurrent_,linCurrent_,vt[n],n);
+	}
+	return vt;
+}
+
+double 
+TeRaster::iterator::operator*(int band)
+{
+	double val = this->raster_->params().dummy_[band];
+	if ((linCurrent_ < nLines_) && (colCurrent_ < nCols_))
+	{
+		if (raster_->getElement(colCurrent_,linCurrent_,val,band))
+			return val;
+	}
+	return val;
+}
+
+void 
+TeRaster::iteratorPoly::getNewSegment(int linCurr)
+{
+	//change to world coordinates
+	TeCoord2D coord(colMin_,linCurr);
+	TeCoord2D colLinCM = raster_->index2Coord(coord);
+	
+	double linCM = colLinCM.y();
+	double colMinCM = colLinCM.x();
+	
+	//applyStrategic: return the segments 
+	segments_ = applyStrategic(linCM, linMinCM_, colMinCM, strategy_, raster_, poly_);
+
+	if(segments_.empty())
+	{
+		colCurrent_=(int)colMax_;
+		return;
+	}
+	
+	colMin_ = segments_[0].pt1.x();
+	colMax_ = segments_[0].pt2.x();
+	
+	colCurrent_=(int)colMin_;
+	posSegments_ = 0;
+	end_ = false;
+}
+
+//! Prefix move forward operator
+TeRaster::iteratorPoly& 
+TeRaster::iteratorPoly::operator++() //prefix
+{
+	if (++colCurrent_>colMax_)
+	{
+		if((++posSegments_ > (int)(segments_.size()-1)) || (segments_.size()<1))
+		{
+			if(++linCurrent_>linMax_)
+			{
+				end_ = true;
+				*this = raster_->end(poly_,strategy_);
+			}
+			else
+			{	
+				segments_.clear();
+				do
+				{
+					getNewSegment(linCurrent_);
+					if (segments_.empty())
+						linCurrent_++;
+					else
+						break;
+				} while (linCurrent_<=linMax_);
+				if (linCurrent_ > linMax_)
+				{
+					end_ = true;
+					*this = raster_->end(poly_,strategy_);
+				}
+			}
+		}
+		else
+		{
+			colMin_ = segments_[posSegments_].pt1.x();
+			colMax_ = segments_[posSegments_].pt2.x();
+			colCurrent_=(int)colMin_;
+		}
+	}
+	return *this;
+}
+
+TeRaster::iteratorPoly 
+TeRaster::iteratorPoly::operator++(int)
+{
+	iteratorPoly temp = *this;
+	++(*this);
+	return temp;
+}
+
+double 
+TeRaster::iteratorPoly::operator*() 
+{
+	double val = 0.0;
+	if ((linCurrent_ < nLines_) && (colCurrent_ < nCols_))
+	{
+		if (raster_->getElement(colCurrent_,linCurrent_,val,band_))
+			return val;
+	}
+	return 0.0;
+}
+
+//! Returns the value of a given band of the element pointed by the iterator 
+double 
+TeRaster::iteratorPoly::operator*(int band)
+{
+	double val = 0.0;
+	if ((linCurrent_ < nLines_) && (colCurrent_ < nCols_))
+	{
+		raster_->getElement(colCurrent_,linCurrent_,val,band);
+		return val;
+	}
+	return 0.0;
+}
+
+bool 
+TeRaster::iteratorPoly::getProperty(TeProperty& prop) 
+{
+	double val = 0.0;
+	prop.attr_.rep_.type_ = TeREAL;
+	if (!raster_) prop.attr_.rep_.name_ = raster_->params().fileName_ + Te2String(band_);
+	prop.value_ = Te2String (val);
+	
+	if ((linCurrent_ < nLines_) && (colCurrent_ < nCols_))
+	{
+		if (raster_->getElement(colCurrent_,linCurrent_,val,band_))
+		{
+			prop.value_ = Te2String(val);
+			return true;
+		}
+	}
+	return false;
+}
+
+TeRaster*
+TeRasterClipping(TeRaster* whole, TePolygonSet& mask, TeProjection* geomProj, const string& clipName, double background, const string& decId)
+{
+  if( decId.empty() ) {
+    throw TeException( UNKNOWN_DECODER_TECHNOLOGY_TYPE, "Invalid decoder", 
+      false );
+  }
+  
+  if( whole == 0 ) {
+    throw TeException( UNKNOWN_ERROR_TYPE, "Invalid raster pointer", 
+      false );
+  }  
+
+  if( mask.empty() ) {
+    throw TeException( UNKNOWN_ERROR_TYPE, "Invalid polygon set mask", 
+      false );
+  }  
+  
+  if( ( decId != "MEM" ) && clipName.empty() ) {
+    throw TeException( UNKNOWN_ERROR_TYPE, "Invalid clipname", 
+      false );
+  }    
+    
+  if( geomProj == 0 ) {
+    throw TeException( UNKNOWN_ERROR_TYPE, "Invalid projection pointer", 
+      false );
+  }    
+
+	if (whole->params().status_ != TeRasterParams::TeReadyToRead && 
+		whole->params().status_ != TeRasterParams::TeReadyToWrite )
+		return 0;
+	
+	bool isEqualProj = (*whole->projection() == *geomProj);
+	if (!isEqualProj &&
+		(geomProj->name() == "NoProjection" || whole->projection()->name() == "NoProjection"))
+		return 0;
+
+	TePolygonSet mask2;
+	if (!isEqualProj)
+		TeVectorRemap(mask,geomProj,mask2,whole->projection());
+	else
+		mask2 = mask;
+
+	if (!TeIntersects(mask2.box(),whole->params().boundingBox()))
+		return 0;
+
+	TeRasterParams par = whole->params();
+	if (!decId.empty())
+	{
+		par.decoderIdentifier_ = decId;
+		if (decId == "DB")
+		{
+			if (!par.database_)
+				return 0;
+		}
+	}
+	par.fileName_ = clipName;
+	par.mode_ = 'c';
+	TeCoord2D bll = whole->coord2Index(mask2.box().lowerLeft());
+	TeCoord2D bur = whole->coord2Index(mask2.box().upperRight());
+	
+	bll = whole->index2Coord(TeCoord2D(TeRoundRasterIndex(bll.x_),TeRoundRasterIndex(bll.y_)));
+	bur = whole->index2Coord(TeCoord2D(TeRoundRasterIndex(bur.x_),TeRoundRasterIndex(bur.y_)));
+
+	par.boxResolution(bll.x_, bll.y_, bur.x_, bur.y_,par.resx_, par.resy_);
+	par.setDummy(background);
+	TeRaster*  clip = new TeRaster(par);
+	clip->init();
+	if (clip->params().status_ != TeRasterParams::TeReadyToWrite)
+		return 0;
+	
+	TeCoord2D cd = TeCoord2D(0,0);
+	TeCoord2D ul = clip->params().index2Coord(cd);
+	TeCoord2D dxdy = whole->params().coord2Index(ul);
+	int j = TeRoundRasterIndex(dxdy.x_); // column delta
+	int i = TeRoundRasterIndex(dxdy.y_); // line delta
+	unsigned int np = mask2.size();
+	unsigned int nb = whole->params().nBands();
+	unsigned int band;
+	double val;
+
+	//progress bar
+	if(TeProgress::instance())
+	{
+		string caption = "Raster Clipping operation";
+		TeProgress::instance()->setCaption(caption.c_str());
+		string msg = "Executing clipping operation. Please, wait!";
+		TeProgress::instance()->setMessage(msg);
+		TeProgress::instance()->setTotalSteps(np);
+	}
+	for (unsigned int p=0; p<np; ++p)
+	{
+		TeRaster::iteratorPoly it = whole->begin(mask2[p],TeBoxPixelIn);
+		while (!it.end())
+		{
+			for(band = 0; band < nb; ++band)
+			{
+				if (whole->getElement(it.currentColumn(),it.currentLine(),val,band))
+					clip->setElement(it.currentColumn()-j,it.currentLine()-i,val,band);
+			}
+			++it;
+		}
+		//progress bar
+		if(TeProgress::instance())
+		{
+			if(TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				break;
+			}
+			TeProgress::instance()->setProgress(p);
+		}
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->reset();
+	return clip;
+}
diff --git a/src/terralib/kernel/TeRaster.h b/src/terralib/kernel/TeRaster.h
old mode 100755
new mode 100644
index e8e6451..e6f06df
--- a/src/terralib/kernel/TeRaster.h
+++ b/src/terralib/kernel/TeRaster.h
@@ -1,531 +1,531 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeRaster.h
-    \brief This file contains structures and definitions to deal with raster structures
-*/
-#ifndef  __TERRALIB_INTERNAL_RASTER_H
-#define  __TERRALIB_INTERNAL_RASTER_H
-
-#include "TeDecoder.h"
-#include "TeDataTypes.h"
-#include "TeCoord2D.h"
-#include "TeAttribute.h"
-#include "TeGeometry.h"
-#include "TeGeometryAlgorithms.h"
-
-class TeRasterTransform;
-
-#include <map>
-
-//! Strategy used to decide if a pixel is inside/outside a polygon
-enum TeStrategicIterator
-{	TeBoxPixelIn,			//!< center of pixel is inside the geometry
-	TeBBoxPixelInters,		//!< bounding box of pixel intercepts the geometry
-	TeBoxPixelOut,			//!< center of pixel is outside the geometry
-	TeBBoxPixelNotInters	//!< bounding box of pixel do not intercept the geometry
-};
-
-/*! \fn bool TeCoordPairVect applyStrategic(double& y, double ymin, double xmin, TeStrategicIterator st, TeRaster* raster, TePolygon& poly);
-    \brief Returns  
-	\param y         
-	\param ymin         
-	\param xmin         
-	\param st pixel in polygon strategy       
-    \param raster pointer to raster
-	\param poly polygon        
-	*/
-TL_DLL TeCoordPairVect applyStrategic(double& y, double ymin, double xmin, 
-			   TeStrategicIterator st, TeRaster* raster, TePolygon& poly);
-
-//! Support for a raster geometry 
-/*
-	\par A Raster Geometry is made of a matrix of ncolumns x nlines elements
-	with nBands dimension. Each element, or pixel, of the raster its is
-	indexed by a column, line and band and has a double value associated.
-	\par Each Raster geometry has a decoder associated to it. Its decoder 
-	knows how to get return the value (as a double) of each pixel.
-	\par All information about the data is stored in a TeRasterParams structure
-	that is duplicated in its decoder.
-	\sa TeDecoder TeRasterParams
-*/
-class TL_DLL TeRaster : public TeGeometry
-{
-	TeRasterParams  params_;	//!< structure that describes all information about a raster 
-	TeDecoder		*decoder_;	//!< pointer to a decoder of values
-
-public:
-	//! Constructor from file
-	/*!
-	  This method tries to instatiate a decoder for this data from the 
-	  file extension of the filename. 
-      \param filename the name of a file that contains the raster data
-      \param mode file opening mode ('r', 'w' or 'c')
-	  \par Obs: the method init should be called before any attempt to read or write this raster data 
-	*/
-	TeRaster(const string& filename, const char& mode = 'r');
-
-	//! Constructor from parameters
-	/*!
-	  This method tries to instatiate a decoder for this data. It uses the identification
-	  explicitly described or the extension of a file name specified in the parameters.
-      \param pars a raster parameters structure that contains information about the raster
-	  \par Obs: the method init should be called before any attempt to read or write data 
-	  to the raster.
-	*/
-	TeRaster(TeRasterParams& pars);
-
-	//! Contructor from commom parameters
-	/*
-		This method creates a raste data in memory, using only the most basic
-		parameters:
-		\par ncols number of columns
-		\par nlines number of lines
-		\par nbands number of bands
-		\par elemType size of each element
-	*/
-	TeRaster(int ncols, int nlines, int nbands, TeDataType elemType);
-
-	//! Empty constructor
-	TeRaster() : decoder_(0) {}
-
-	//! Destructor
-	~TeRaster ();
-
-  //! Returns the const parameters of the raster
-  const TeRasterParams& params() const;
-
-	//! Returns the parameters of the raster
-	TeRasterParams& params();
-	
-	//! Returns the number of lines of the raster
-	int nBands();
-
-	//! Update the parametes of a raster file
-	/*!
-      \param par a new raster parameters structure
-	*/
-	void updateParams(TeRasterParams& par);
-
-	//! Returns the type of the geometry
-	TeGeomRep elemType();
-
-	//! Associate a decoder to a raster
-	/*!
-      \param dec pointer to a raster decoder
-	*/
-	void setDecoder(TeDecoder* dec);
-
-	//! Returns status of the raster as a Boolean value
-	/*
-		\return true if raster is ready to be read or written and false otherwise
-	*/
-	bool status();
-
-	//! Returns a pointer to the decoder associated to this raster
-	TeDecoder* decoder();
-
-	//! Returns a pointer to the raster projection
-	TeProjection* projection(); 
-
-	//! Sets the value of a element of the raster 
-	/*!
-      \param col column number
-	  \param lin line number
-	  \param val element value
-	  \param band band number
-	*/
-	bool setElement (int col, int lin, double val, int band=0);
-
-	//! Gets the value of a element of the raster 
-	/*!
-      \param col column number
-	  \param lin line number
-	  \param val element value
-	  \param band band number
-	*/
-	bool getElement (int col, int lin, double& val, int band=0);
-
-	//! Fills a destination raster with the raster elements
-	/*
-		\param dstRaster destination raster
-		\param transf pixel evaluator to be used
-		\param bestRes flag to indicate that it should use the best resolution available
-	*/
-	bool fillRaster (TeRaster* dstRaster, TeRasterTransform* transf=0, bool bestRes = true);
-
-	//! Initalize the raster decoding tool from its parameters
-	/*! The result of this method depends on the mode_ specified in the parameters. 
-		\par 'r' : initializes a raster with reading only permission. If the source
-		of the data does not exist it will fail.
-		\par 'w' : initializes a raster with reading and writting permission. If the source
-		of the data does not exist it will fail.
-		\par 'c' : creates a new raster data with default values. Initializes it with 
-		reading and writting permision. Fails if creation fails.
-	*/
-	bool init();
-
-	//! Initalize the raster decoding tool from a raster parameters structure
-	/*!
-		\return true if raster is read to be read/written and false otherwise.
-	*/
-	bool init(TeRasterParams& pars);
-  
-	//! Clear internal structures and disable the raster decoding tool
-	void clear();
-
-	//! Transform a coordinate from line/column domain to projection domain
-	TeCoord2D index2Coord(TeCoord2D pt);
-
-	//! Transform a coordinate from projection domain domain to line/column
-	TeCoord2D coord2Index(TeCoord2D pt);
-
-	//----------------
-	//! A raster iterator
-	/*! 
-		An strucuture that allows the traversal over the raster elements 
-		(pixels) in a similar way as the STL iterators. 
-	*/
-	class TL_DLL iterator
-	{
-		public:
-		//! Constructor
-		/*!
-			\param c0 initial column
-			\param l0 initial line
-			\param nc number of columns
-			\param nl number of lines
-			\param nb number of bands
-			\param pt pointer to the raster to iterate
-		*/
-			iterator(int c0=0, int l0=0, int nc=0, int nl=0, int nb=0, TeRaster* pt=0) : 
-			linCurrent_(l0),
-			colCurrent_(c0),
-			nLines_(nl),
-			nCols_(nc),
-			nBands_(nb),
-			raster_(pt)
-			{}
-			
-			//! Destructor
-			virtual ~iterator()
-			{}
-
-			//! Move iterator forward
-			virtual void moveForward();
-
-			//! Prefix move forward operator
-			iterator& operator++();
-		
-			//! Posfix move forward operator
-			iterator operator++(int);
-
-			//! Returns iterator current line 
-			int currentLine();
-
-			//! Returns iterator current column
-			int currentColumn();
-
-			//! Returns the number of bands
-			int nBands(void);
-
-			//! Iterator de-referencing operator
-			/*!
-				\return a vector (with nbands_ size) with the values in
-				each band, of the element pointed by the iterator
-			*/
-			vector<double> operator*();
-			
-			//! Returns the value in a given band of a element pointed by the iterator 
-			double operator*(int band);
-
-			//! Returns whether two iterators point to the same element
-			bool operator==(const iterator& rhs) const;
-
-			//! Returns whether two iterators point to the different elements
-			bool operator!=(const iterator& rhs) const;
-
-		protected:
-			int linCurrent_, colCurrent_;
-			int nLines_, nCols_;
-			int nBands_;
-			TeRaster* raster_;
-		};   
-
-	// ---------------------  End of class raster Iterator
-
-	//----------------
-	//! A raster iterator with a restriction of area 
-	/*! 
-		A structure that allows to cover the raster elements 
-		(pixels) that are IN or OUT a specific region (polygon)  
-	*/
-	class TL_DLL iteratorPoly : public iterator
-	{
-		public:
-			//! Constructor
-			/*!
-			\param colCurr	initial column
-			\param linCurr	initial line
-			\param nc		number of columns
-			\param nl		number of lines
-			\param nb		number of bands
-			\param pt		pointer to the raster that will be covered
-			\param poly		polygon that defines a specific region 
-			\param str		strategic of the iterator, IN or OUT the polygon 
-			\param linMin	minimal line of the raster that will be covered
-			\param linMax	maximal line of the raster that will be covered
-			\param colMin	minimal column of the raster that will be covered
-			\param colMax	maximal column of the raster that will be covered
-			\param seg		the segments of intersection of the current line 
-			\param posSeg	the current segment 
-			\param nlInPoly		number of lines IN the polygon
-			\param nColsInPoly	number of columns IN the polygon 
-			\param e			iterator end
-			\param minLinCM		minimal line (in world coordinates)
-			\param band			band to iterate
-			*/
-			iteratorPoly(int colCurr, int linCurr, int nc, int nl, int nb, TeRaster* pt, TePolygon& poly,
-						 TeStrategicIterator str, double linMin=0.0, double linMax=0.0, double colMin=0.0, 
-						 double colMax=0.0, TeCoordPairVect seg=TeCoordPairVect(),  
-						 int posSeg=0, int nlInPoly=0, int nColsInPoly=0, bool e=true, double minLinCM=0.0, int band = 0):
-				iterator(colCurr,linCurr,nc,nl,nb,pt),
-				linMin_(linMin),
-				linMax_(linMax),
-				colMin_(colMin),
-				colMax_(colMax),
-				segments_(seg),
-				posSegments_(posSeg),
-				poly_(poly),
-				end_(e),
-				strategy_(str),
-				nLinesInPoly_(nlInPoly),
-				nColsInPoly_(nColsInPoly),
-				linMinCM_(minLinCM),
-				band_(band)
-				{}
-			
-			//! empty contructor
-			iteratorPoly(TeRaster* raster = 0): 
-				iterator(0,0,0,0,0,raster),
-				linMin_(0.0),
-				linMax_(0.0),
-				colMin_(0.0), 
-				colMax_(0.0),
-				posSegments_(0),
-				end_(true),
-				nLinesInPoly_(0),
-				nColsInPoly_(0),
-				band_(0)
-				{}
-
-			//! destructor
-			virtual ~iteratorPoly() {}
-
-			void moveForward();
-			
-			//! Prefix move forward operator
-			iteratorPoly& operator++();
-
-			//! Prefix move orward operator
-			iteratorPoly operator++(int);
-
-			//! Dereferencing operator
-			/*!
-				This operator was designed for compatibility reasons with standard
-				containers of STL. 
-				If there is a band restriction defined it will return the value associated to that band.
-				Otherwise will return the value associated to band 0.
-			*/
-			double operator*(); 
-
-			//! Returns the value of a given band of the element pointed by the iterator 
-			double operator*(int band);
-		
-		    //! Returns the value of of the element pointed by the iterator as TeProperty structure
-			/*!
-				If there is a band restriction defined it will return the value associated to that band.
-				Otherwise will return the value associated to band 0.
-			*/
-			bool getProperty(TeProperty& prop);
-
-			//! Returns the last past one element in the polygon
-			bool end();
-
-			//! Returns the number of lines covered by the iterator
-			int nLinesInPoly();
-
-			//! Returns the number of columns covered by the iterator
-			int nColsInPoly();
-
-		private:
-
-			//! calculate the segment of the current line that intersect the polygon  					
-			void getNewSegment(int linCurr);
-
-			double				linMin_, linMax_;  
-			double				colMin_, colMax_;
-			TeCoordPairVect		segments_;
-			int					posSegments_;
-			TePolygon			poly_;
-			bool				end_;
-			TeStrategicIterator strategy_;
-			int					nLinesInPoly_, nColsInPoly_;
-			double				linMinCM_;	//minimal line in world coordinates 
-			int					band_;		// band restriction
-	};
-
-	//! Returns  an iterator to the first element of the raster
-	iterator begin();
-
-	//! Returns an iterator to the first element of the raster IN or OUT the polygon 
-	/*!
-		\param poly polygon that delimitates the iterator traversal
-		\param st stragetegy used to decide if a pixel is in or out a polygon
-		\param band optional band restriction
-	*/
-	iteratorPoly begin(TePolygon& poly, TeStrategicIterator st, int band=0);
-
-	//! Returns the end past one position of the elements of the raster
-    iterator end() ;
-	//! Returns an iterator to the end element of the raster 
-	/*!
-		\param poly polygon that delimitates the iterator traversal
-		\param st stragetegy used to decide if a pixel is in or out a polygon
-		\param band optional band restriction
-	*/
-	iteratorPoly end(TePolygon& poly, TeStrategicIterator st, int band=0); 
-
-	//! Select all blocks of raster, in a certain resolution factor that intercepts a given bounding box
-	bool selectBlocks(TeBox& bb, int resFac, TeRasterParams& parBlock);
-
-	//! Returns the number of blocks selected by the last block selection
-	int numberOfSelectedBlocks();
-
-	//! Returns the current block of a set selected by the last block selection
-	bool fetchRasterBlock(TeDecoderMemory* memDec);
-
-	//! Clears the current selection of a set selected by the last block selection
-	void clearBlockSelection();
-
-	//! An optimizated method to set values raster images
-	/*
-		This method should be used only to set the values of images with 3 bands associated
-		respectively to the three colour channes Red, Green and Blue
-		\param col column of the image
-		\param lin line of the image
-		\param Rval the value associated to the band 0 (associated to the R colour Channel)
-		\param Gval the value associated to the band 1 (associated to the G colour Channel)
-		\param Bval the value associated to the band 2 (associated to the B colour Channel)
-		\param transp an optional transparency degree, with a range of 0 (totally transparent) to 255 (totally opaque)
-		\return true if if succeed and false otherwise
-	*/
-	bool setElement(int col, int lin, double Rval, double Gval, double Bval, unsigned int /*transp*/ = 255);
-
-	//! Give access to the last message detected by the raster manipulation
-	const string& errorMessage() const;
-	
-  private :
-  
-	  //! Building a raster instance from another one is forbiden !
-	  TeRaster( const TeRaster& ) : TeGeometry()
-	  {}
-
-	  //! Copying a raster instance from another one is forbiden !
-	  const TeRaster& operator=( const TeRaster& ) { return *this; };	
-
-};
-
-inline const TeRasterParams& TeRaster::params() const
-{ return params_; }
-	
-inline TeRasterParams& TeRaster::params()
-{ return params_; }
-
-inline int TeRaster::nBands()
-{ return params_.nBands(); }
-
-inline TeGeomRep TeRaster::elemType() 
-{ return TeRASTER; }
-
-inline bool TeRaster::status()
-{	return params_.status_ != TeRasterParams::TeNotReady; }
-
-inline TeDecoder* TeRaster::decoder()
-{ return decoder_; }
-
-inline TeProjection* TeRaster::projection() 
-{ return params_.projection(); }
-
-inline TeCoord2D TeRaster::index2Coord(TeCoord2D pt)
-{ return decoder_->index2Coord(pt); }
-
-inline TeCoord2D TeRaster::coord2Index(TeCoord2D pt)
-{ return decoder_->coord2Index(pt); }
-
-	
-inline const string& TeRaster::errorMessage() const
-{	return params_.errorMessage_; }
-
-inline int TeRaster::iterator::currentLine()
-{ return linCurrent_;}
-
-inline int TeRaster::iterator::currentColumn()
-{return colCurrent_; }
-
-inline int TeRaster::iterator::nBands(void)
-{	return nBands_; }
-
-inline bool TeRaster::iteratorPoly::end()
-{	return end_; }
-
-inline int TeRaster::iteratorPoly::nLinesInPoly()
-{ return nLinesInPoly_;}
-
-inline int TeRaster::iteratorPoly::nColsInPoly()
-{ return nColsInPoly_;}
-
-/** @defgroup RasterFunc Raster functions
-	A set of functions that manipulates raster representations
- *  @{
- */
-/**	Clips a raster representation using a polygon set as a mask
-	\param	whole		pointer to the raster to be clipped
-	\param  mask		the polygon set used as the mask to clip the raaster
-	\param  geomProj	pointer the projection of the polygons used as mask
-	\param  clipName	name of the file (or database table) that will contains the clipped raster
-	\param  background	value to be used as the background of the clipped raster
-	\param	decId		optional parameter that explicitly indicates the decoder (or format) used to generate the clipped raster
-	\return a pointer to the generated clipped raster if it succeed or a null pointer otherwise.
-	
-	If the decId is equal to "DB" it is assumed that the clipped raster will be generated
-	in the same database as the input raster. If the input raster is not in a database, the 
-	routine returns a error.
-*/
-TL_DLL TeRaster*
-TeRasterClipping(TeRaster* whole, TePolygonSet& mask, TeProjection* geomProj, const string& clipName, double background, const string& decId="");
-
-//@}
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeRaster.h
+    \brief This file contains structures and definitions to deal with raster structures
+*/
+#ifndef  __TERRALIB_INTERNAL_RASTER_H
+#define  __TERRALIB_INTERNAL_RASTER_H
+
+#include "TeDecoder.h"
+#include "TeDataTypes.h"
+#include "TeCoord2D.h"
+#include "TeAttribute.h"
+#include "TeGeometry.h"
+#include "TeGeometryAlgorithms.h"
+
+class TeRasterTransform;
+
+#include <map>
+
+//! Strategy used to decide if a pixel is inside/outside a polygon
+enum TeStrategicIterator
+{	TeBoxPixelIn,			//!< center of pixel is inside the geometry
+	TeBBoxPixelInters,		//!< bounding box of pixel intercepts the geometry
+	TeBoxPixelOut,			//!< center of pixel is outside the geometry
+	TeBBoxPixelNotInters	//!< bounding box of pixel do not intercept the geometry
+};
+
+/*! \fn bool TeCoordPairVect applyStrategic(double& y, double ymin, double xmin, TeStrategicIterator st, TeRaster* raster, TePolygon& poly);
+    \brief Returns  
+	\param y         
+	\param ymin         
+	\param xmin         
+	\param st pixel in polygon strategy       
+    \param raster pointer to raster
+	\param poly polygon        
+	*/
+TL_DLL TeCoordPairVect applyStrategic(double& y, double ymin, double xmin, 
+			   TeStrategicIterator st, TeRaster* raster, const TePolygon& poly);
+
+//! Support for a raster geometry 
+/*
+	\par A Raster Geometry is made of a matrix of ncolumns x nlines elements
+	with nBands dimension. Each element, or pixel, of the raster its is
+	indexed by a column, line and band and has a double value associated.
+	\par Each Raster geometry has a decoder associated to it. Its decoder 
+	knows how to get return the value (as a double) of each pixel.
+	\par All information about the data is stored in a TeRasterParams structure
+	that is duplicated in its decoder.
+	\sa TeDecoder TeRasterParams
+*/
+class TL_DLL TeRaster : public TeGeometry
+{
+	TeRasterParams  params_;	//!< structure that describes all information about a raster 
+	TeDecoder		*decoder_;	//!< pointer to a decoder of values
+
+public:
+	//! Constructor from file
+	/*!
+	  This method tries to instatiate a decoder for this data from the 
+	  file extension of the filename. 
+      \param filename the name of a file that contains the raster data
+      \param mode file opening mode ('r', 'w' or 'c')
+	  \par Obs: the method init should be called before any attempt to read or write this raster data 
+	*/
+	TeRaster(const string& filename, const char& mode = 'r');
+
+	//! Constructor from parameters
+	/*!
+	  This method tries to instatiate a decoder for this data. It uses the identification
+	  explicitly described or the extension of a file name specified in the parameters.
+      \param pars a raster parameters structure that contains information about the raster
+	  \par Obs: the method init should be called before any attempt to read or write data 
+	  to the raster.
+	*/
+	TeRaster(TeRasterParams& pars);
+
+	//! Contructor from commom parameters
+	/*
+		This method creates a raste data in memory, using only the most basic
+		parameters:
+		\par ncols number of columns
+		\par nlines number of lines
+		\par nbands number of bands
+		\par elemType size of each element
+	*/
+	TeRaster(int ncols, int nlines, int nbands, TeDataType elemType);
+
+	//! Empty constructor
+	TeRaster() : decoder_(0) {}
+
+	//! Destructor
+	~TeRaster ();
+
+  //! Returns the const parameters of the raster
+  const TeRasterParams& params() const;
+
+	//! Returns the parameters of the raster
+	TeRasterParams& params();
+	
+	//! Returns the number of lines of the raster
+	int nBands();
+
+	//! Update the parametes of a raster file
+	/*!
+      \param par a new raster parameters structure
+	*/
+	void updateParams(TeRasterParams& par);
+
+	//! Returns the type of the geometry
+	TeGeomRep elemType();
+
+	//! Associate a decoder to a raster
+	/*!
+      \param dec pointer to a raster decoder
+	*/
+	void setDecoder(TeDecoder* dec);
+
+	//! Returns status of the raster as a Boolean value
+	/*
+		\return true if raster is ready to be read or written and false otherwise
+	*/
+	bool status();
+
+	//! Returns a pointer to the decoder associated to this raster
+	TeDecoder* decoder();
+
+	//! Returns a pointer to the raster projection
+	TeProjection* projection(); 
+
+	//! Sets the value of a element of the raster 
+	/*!
+      \param col column number
+	  \param lin line number
+	  \param val element value
+	  \param band band number
+	*/
+	bool setElement (int col, int lin, double val, int band=0);
+
+	//! Gets the value of a element of the raster 
+	/*!
+      \param col column number
+	  \param lin line number
+	  \param val element value
+	  \param band band number
+	*/
+	bool getElement (int col, int lin, double& val, int band=0);
+
+	//! Fills a destination raster with the raster elements
+	/*
+		\param dstRaster destination raster
+		\param transf pixel evaluator to be used
+		\param bestRes flag to indicate that it should use the best resolution available
+	*/
+	bool fillRaster (TeRaster* dstRaster, TeRasterTransform* transf=0, bool bestRes = true);
+
+	//! Initalize the raster decoding tool from its parameters
+	/*! The result of this method depends on the mode_ specified in the parameters. 
+		\par 'r' : initializes a raster with reading only permission. If the source
+		of the data does not exist it will fail.
+		\par 'w' : initializes a raster with reading and writting permission. If the source
+		of the data does not exist it will fail.
+		\par 'c' : creates a new raster data with default values. Initializes it with 
+		reading and writting permision. Fails if creation fails.
+	*/
+	bool init();
+
+	//! Initalize the raster decoding tool from a raster parameters structure
+	/*!
+		\return true if raster is read to be read/written and false otherwise.
+	*/
+	bool init(TeRasterParams& pars);
+  
+	//! Clear internal structures and disable the raster decoding tool
+	void clear();
+
+	//! Transform a coordinate from line/column domain to projection domain
+	TeCoord2D index2Coord(TeCoord2D pt);
+
+	//! Transform a coordinate from projection domain domain to line/column
+	TeCoord2D coord2Index(TeCoord2D pt);
+
+	//----------------
+	//! A raster iterator
+	/*! 
+		An strucuture that allows the traversal over the raster elements 
+		(pixels) in a similar way as the STL iterators. 
+	*/
+	class TL_DLL iterator
+	{
+		public:
+		//! Constructor
+		/*!
+			\param c0 initial column
+			\param l0 initial line
+			\param nc number of columns
+			\param nl number of lines
+			\param nb number of bands
+			\param pt pointer to the raster to iterate
+		*/
+			iterator(int c0=0, int l0=0, int nc=0, int nl=0, int nb=0, TeRaster* pt=0) : 
+			linCurrent_(l0),
+			colCurrent_(c0),
+			nLines_(nl),
+			nCols_(nc),
+			nBands_(nb),
+			raster_(pt)
+			{}
+			
+			//! Destructor
+			virtual ~iterator()
+			{}
+
+			//! Move iterator forward
+			virtual void moveForward();
+
+			//! Prefix move forward operator
+			iterator& operator++();
+		
+			//! Posfix move forward operator
+			iterator operator++(int);
+
+			//! Returns iterator current line 
+			int currentLine();
+
+			//! Returns iterator current column
+			int currentColumn();
+
+			//! Returns the number of bands
+			int nBands(void);
+
+			//! Iterator de-referencing operator
+			/*!
+				\return a vector (with nbands_ size) with the values in
+				each band, of the element pointed by the iterator
+			*/
+			vector<double> operator*();
+			
+			//! Returns the value in a given band of a element pointed by the iterator 
+			double operator*(int band);
+
+			//! Returns whether two iterators point to the same element
+			bool operator==(const iterator& rhs) const;
+
+			//! Returns whether two iterators point to the different elements
+			bool operator!=(const iterator& rhs) const;
+
+		protected:
+			int linCurrent_, colCurrent_;
+			int nLines_, nCols_;
+			int nBands_;
+			TeRaster* raster_;
+		};   
+
+	// ---------------------  End of class raster Iterator
+
+	//----------------
+	//! A raster iterator with a restriction of area 
+	/*! 
+		A structure that allows to cover the raster elements 
+		(pixels) that are IN or OUT a specific region (polygon)  
+	*/
+	class TL_DLL iteratorPoly : public iterator
+	{
+		public:
+			//! Constructor
+			/*!
+			\param colCurr	initial column
+			\param linCurr	initial line
+			\param nc		number of columns
+			\param nl		number of lines
+			\param nb		number of bands
+			\param pt		pointer to the raster that will be covered
+			\param poly		polygon that defines a specific region 
+			\param str		strategic of the iterator, IN or OUT the polygon 
+			\param linMin	minimal line of the raster that will be covered
+			\param linMax	maximal line of the raster that will be covered
+			\param colMin	minimal column of the raster that will be covered
+			\param colMax	maximal column of the raster that will be covered
+			\param seg		the segments of intersection of the current line 
+			\param posSeg	the current segment 
+			\param nlInPoly		number of lines IN the polygon
+			\param nColsInPoly	number of columns IN the polygon 
+			\param e			iterator end
+			\param minLinCM		minimal line (in world coordinates)
+			\param band			band to iterate
+			*/
+			iteratorPoly(int colCurr, int linCurr, int nc, int nl, int nb, TeRaster* pt, const TePolygon& poly,
+						 TeStrategicIterator str, double linMin=0.0, double linMax=0.0, double colMin=0.0, 
+						 double colMax=0.0, TeCoordPairVect seg=TeCoordPairVect(),  
+						 int posSeg=0, int nlInPoly=0, int nColsInPoly=0, bool e=true, double minLinCM=0.0, int band = 0):
+				iterator(colCurr,linCurr,nc,nl,nb,pt),
+				linMin_(linMin),
+				linMax_(linMax),
+				colMin_(colMin),
+				colMax_(colMax),
+				segments_(seg),
+				posSegments_(posSeg),
+				poly_(poly),
+				end_(e),
+				strategy_(str),
+				nLinesInPoly_(nlInPoly),
+				nColsInPoly_(nColsInPoly),
+				linMinCM_(minLinCM),
+				band_(band)
+				{}
+			
+			//! empty contructor
+			iteratorPoly(TeRaster* raster = 0): 
+				iterator(0,0,0,0,0,raster),
+				linMin_(0.0),
+				linMax_(0.0),
+				colMin_(0.0), 
+				colMax_(0.0),
+				posSegments_(0),
+				end_(true),
+				nLinesInPoly_(0),
+				nColsInPoly_(0),
+				band_(0)
+				{}
+
+			//! destructor
+			virtual ~iteratorPoly() {}
+
+			void moveForward();
+			
+			//! Prefix move forward operator
+			iteratorPoly& operator++();
+
+			//! Prefix move orward operator
+			iteratorPoly operator++(int);
+
+			//! Dereferencing operator
+			/*!
+				This operator was designed for compatibility reasons with standard
+				containers of STL. 
+				If there is a band restriction defined it will return the value associated to that band.
+				Otherwise will return the value associated to band 0.
+			*/
+			double operator*(); 
+
+			//! Returns the value of a given band of the element pointed by the iterator 
+			double operator*(int band);
+		
+		    //! Returns the value of of the element pointed by the iterator as TeProperty structure
+			/*!
+				If there is a band restriction defined it will return the value associated to that band.
+				Otherwise will return the value associated to band 0.
+			*/
+			bool getProperty(TeProperty& prop);
+
+			//! Returns the last past one element in the polygon
+			bool end();
+
+			//! Returns the number of lines covered by the iterator
+			int nLinesInPoly();
+
+			//! Returns the number of columns covered by the iterator
+			int nColsInPoly();
+
+		private:
+
+			//! calculate the segment of the current line that intersect the polygon  					
+			void getNewSegment(int linCurr);
+
+			double				linMin_, linMax_;  
+			double				colMin_, colMax_;
+			TeCoordPairVect		segments_;
+			int					posSegments_;
+			TePolygon			poly_;
+			bool				end_;
+			TeStrategicIterator strategy_;
+			int					nLinesInPoly_, nColsInPoly_;
+			double				linMinCM_;	//minimal line in world coordinates 
+			int					band_;		// band restriction
+	};
+
+	//! Returns  an iterator to the first element of the raster
+	iterator begin();
+
+	//! Returns an iterator to the first element of the raster IN or OUT the polygon 
+	/*!
+		\param poly polygon that delimitates the iterator traversal
+		\param st stragetegy used to decide if a pixel is in or out a polygon
+		\param band optional band restriction
+	*/
+	iteratorPoly begin(const TePolygon& poly, TeStrategicIterator st, int band=0);
+
+	//! Returns the end past one position of the elements of the raster
+    iterator end() ;
+	//! Returns an iterator to the end element of the raster 
+	/*!
+		\param poly polygon that delimitates the iterator traversal
+		\param st stragetegy used to decide if a pixel is in or out a polygon
+		\param band optional band restriction
+	*/
+	iteratorPoly end(const TePolygon& poly, TeStrategicIterator st, int band=0); 
+
+	//! Select all blocks of raster, in a certain resolution factor that intercepts a given bounding box
+	bool selectBlocks(TeBox& bb, int resFac, TeRasterParams& parBlock);
+
+	//! Returns the number of blocks selected by the last block selection
+	int numberOfSelectedBlocks();
+
+	//! Returns the current block of a set selected by the last block selection
+	bool fetchRasterBlock(TeDecoderMemory* memDec);
+
+	//! Clears the current selection of a set selected by the last block selection
+	void clearBlockSelection();
+
+	//! An optimizated method to set values raster images
+	/*
+		This method should be used only to set the values of images with 3 bands associated
+		respectively to the three colour channes Red, Green and Blue
+		\param col column of the image
+		\param lin line of the image
+		\param Rval the value associated to the band 0 (associated to the R colour Channel)
+		\param Gval the value associated to the band 1 (associated to the G colour Channel)
+		\param Bval the value associated to the band 2 (associated to the B colour Channel)
+		\param transp an optional transparency degree, with a range of 0 (totally transparent) to 255 (totally opaque)
+		\return true if if succeed and false otherwise
+	*/
+	bool setElement(int col, int lin, double Rval, double Gval, double Bval, unsigned int /*transp*/ = 255);
+
+	//! Give access to the last message detected by the raster manipulation
+	const string& errorMessage() const;
+	
+  private :
+  
+	  //! Building a raster instance from another one is forbiden !
+	  TeRaster( const TeRaster& ) : TeGeometry()
+	  {}
+
+	  //! Copying a raster instance from another one is forbiden !
+	  const TeRaster& operator=( const TeRaster& ) { return *this; };	
+
+};
+
+inline const TeRasterParams& TeRaster::params() const
+{ return params_; }
+	
+inline TeRasterParams& TeRaster::params()
+{ return params_; }
+
+inline int TeRaster::nBands()
+{ return params_.nBands(); }
+
+inline TeGeomRep TeRaster::elemType() 
+{ return TeRASTER; }
+
+inline bool TeRaster::status()
+{	return params_.status_ != TeRasterParams::TeNotReady; }
+
+inline TeDecoder* TeRaster::decoder()
+{ return decoder_; }
+
+inline TeProjection* TeRaster::projection() 
+{ return params_.projection(); }
+
+inline TeCoord2D TeRaster::index2Coord(TeCoord2D pt)
+{ return decoder_->index2Coord(pt); }
+
+inline TeCoord2D TeRaster::coord2Index(TeCoord2D pt)
+{ return decoder_->coord2Index(pt); }
+
+	
+inline const string& TeRaster::errorMessage() const
+{	return params_.errorMessage_; }
+
+inline int TeRaster::iterator::currentLine()
+{ return linCurrent_;}
+
+inline int TeRaster::iterator::currentColumn()
+{return colCurrent_; }
+
+inline int TeRaster::iterator::nBands(void)
+{	return nBands_; }
+
+inline bool TeRaster::iteratorPoly::end()
+{	return end_; }
+
+inline int TeRaster::iteratorPoly::nLinesInPoly()
+{ return nLinesInPoly_;}
+
+inline int TeRaster::iteratorPoly::nColsInPoly()
+{ return nColsInPoly_;}
+
+/** @defgroup RasterFunc Raster functions
+	A set of functions that manipulates raster representations
+ *  @{
+ */
+/**	Clips a raster representation using a polygon set as a mask
+	\param	whole		pointer to the raster to be clipped
+	\param  mask		the polygon set used as the mask to clip the raaster
+	\param  geomProj	pointer the projection of the polygons used as mask
+	\param  clipName	name of the file (or database table) that will contains the clipped raster
+	\param  background	value to be used as the background of the clipped raster
+	\param	decId		optional parameter that explicitly indicates the decoder (or format) used to generate the clipped raster
+	\return a pointer to the generated clipped raster if it succeed or a null pointer otherwise.
+	
+	If the decId is equal to "DB" it is assumed that the clipped raster will be generated
+	in the same database as the input raster. If the input raster is not in a database, the 
+	routine returns a error.
+*/
+TL_DLL TeRaster*
+TeRasterClipping(TeRaster* whole, TePolygonSet& mask, TeProjection* geomProj, const string& clipName, double background, const string& decId="");
+
+//@}
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeRasterMemManager.cpp b/src/terralib/kernel/TeRasterMemManager.cpp
old mode 100755
new mode 100644
index 408dfd7..367d388
--- a/src/terralib/kernel/TeRasterMemManager.cpp
+++ b/src/terralib/kernel/TeRasterMemManager.cpp
@@ -1,503 +1,468 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include "TeRasterMemManager.h"
-
-#include "TeUtils.h"
-#include "TeErrorLog.h"
-#include "TeTempFilesRemover.h"
-#include "TeAgnostic.h"
-
-
-TeRasterMemManager::TeRasterMemManager()
-{
-  init();
-}
-
-
-TeRasterMemManager::~TeRasterMemManager()
-{
-  clear();
-}
-
-
-void TeRasterMemManager::clear()
-{
-  if( bands_nmb_ )
-  {
-    /* Cleaning the ram tiles ( the disk tile included !! ) */
-    
-    const unsigned int tottiles = (unsigned int)all_tiles_ptrs_vec_.size();
-    
-    for( unsigned int idx = 0 ; idx < tottiles ; ++idx )
-    {
-      if( all_tiles_ptrs_vec_[ idx ] != cur_disk_tile_ptr_ )
-      {
-        delete[] ( (TilePtrT)(all_tiles_ptrs_vec_[ idx ]) );
-      }
-    }
-    
-    if( cur_disk_tile_ptr_ ) delete[] cur_disk_tile_ptr_;
-    
-    /* closing and removing disk files */
-    
-    for( unsigned int odfidx = 0 ; odfidx < open_disk_files_vec_.size() ; 
-      ++odfidx )
-    {
-      TeTempFilesRemover::instance().removeFile( open_disk_files_vec_[ 
-        odfidx ].second );      
-    }
-    
-    /* cleaning containers */
-    
-    bands_tiles_sizes_.clear();
-    all_tiles_ptrs_vec_.clear();
-    tile2file_vec_.clear();
-    open_disk_files_vec_.clear();
-
-    /* Reseting the the default values */
-    
-    init();
-  }
-}
-
-bool TeRasterMemManager::reset( unsigned int bands, 
-  unsigned int tiles_per_band, const std::vector< unsigned int >& tiles_sizes,
-  MemoryPolicy mem_pol )
-{
-  clear();
-  
-  TEAGN_TRUE_OR_RETURN( ( ( bands != 0 ) && ( tiles_per_band != 0 ) &&
-    ( tiles_sizes.size() == bands ) ), "Invalid parameters" );
-
-  tiles_per_band_ = tiles_per_band;
-  bands_nmb_ = bands;
-  bands_tiles_sizes_ = tiles_sizes;
-  
-  const unsigned int total_tiles_number = tiles_per_band_ * bands_nmb_;
-  
-  /* Allocating support vectors */
-  
-  try
-  {
-    all_tiles_ptrs_vec_.resize( tiles_per_band_ * bands_nmb_ );
-    tile2file_vec_.resize( tiles_per_band_ * bands_nmb_ );
-    
-    Tiles2FileData dummydata;
-    
-    for( unsigned int tiles_vects_index = 0 ; 
-      tiles_vects_index < total_tiles_number ;
-      ++tiles_vects_index ) {
-        
-      all_tiles_ptrs_vec_[ tiles_vects_index ] = 0;
-      tile2file_vec_[ tiles_vects_index ] = dummydata;
-    }      
-  }
-  catch(...)
-  {
-    clear();
-    
-    TEAGN_LOG_AND_RETURN( 
-      "Unable to allocate support vectors" )
-  }
-  
-  /* Allocating the disk tiles mem buffer */
-  
-  try
-  {
-    unsigned int maxtilesize = 0;
-    for( unsigned int curr_band = 0 ; 
-      curr_band < bands_nmb_ ;  ++curr_band ) {    
-      
-      if( bands_tiles_sizes_[ curr_band ] > maxtilesize )
-      {
-        maxtilesize = bands_tiles_sizes_[ curr_band ];
-      }
-    }
-    
-    cur_disk_tile_ptr_ = (TilePtrT) new TileDataT[ maxtilesize ];
-  }
-  catch(...)
-  {
-    clear();
-    
-    TEAGN_LOG_AND_RETURN( 
-      "Unable to allocate disk tiles RAM buffer" )
-  }  
-  
-  /* Allocating tiles */
-  
-  if( mem_pol == DiskMemPol ) {
-    if( ! allocateDiskTilesFiles( 0, 0 ) )
-    {
-      clear();
-      
-      return false;
-    }
-    else
-    {
-      TEAGN_TRUE_OR_THROW( getTilePointer( 0, 0 ),
-        "Invalid tile pointer" )
-    }
-  } else {
-    unsigned int curr_band = 0;
-    unsigned int curr_tile = 0;
-    TilePtrT newtile_ptr = 0;
-    const unsigned long int max_ram_tiles = getMaxRAMTiles( bands_nmb_,
-      tiles_per_band_, bands_tiles_sizes_ );
-    unsigned int curr_ram_tiles_nmb = 0; 
-    
-    for( curr_band = 0 ; curr_band < bands ; ++curr_band ) {
-      unsigned int tile_bytes = bands_tiles_sizes_[ curr_band ];
-      TEAGN_TRUE_OR_THROW( ( tile_bytes > 0 ), "Invalid tile bytes" );      
-      
-      unsigned long int curr_tile_index = 0;
-      
-      for( curr_tile = 0 ; curr_tile < tiles_per_band_ ; ++curr_tile ) {
-        curr_tile_index = ( curr_band * tiles_per_band_ ) + curr_tile;
-        
-        switch( mem_pol ) {
-          case RAMMemPol :
-          {
-            try
-            {
-              newtile_ptr = (TilePtrT) new TileDataT[ tile_bytes ];
-                
-              if( newtile_ptr == 0 ) {
-                clear();
-                
-                return false;
-              } else {
-                all_tiles_ptrs_vec_[ curr_tile_index ] = 
-                  newtile_ptr;
-              }
-            }
-            catch(...)
-            {
-              clear();
-              
-              return false;
-            }
-              
-            break;
-          }
-          case AutoMemPol :
-          {
-            if( curr_ram_tiles_nmb <= max_ram_tiles ) {
-              try
-              {
-                newtile_ptr = (TilePtrT) new TileDataT[ tile_bytes ];
-                  
-                if( newtile_ptr == 0 ) {
-                  if( ! allocateDiskTilesFiles( curr_band, curr_tile ) )
-                  {
-                    clear();
-                    
-                    return false;
-                  }
-                  else
-                  {
-                    TEAGN_TRUE_OR_THROW( getTilePointer( curr_band, 
-                      curr_tile ), "Invalid tile pointer" )
-                      
-                    /* break the tiles loop */
-                    
-                    curr_band = bands;
-                    curr_tile = tiles_per_band_;
-                  }
-                } else {
-                  all_tiles_ptrs_vec_[ curr_tile_index ] = 
-                    newtile_ptr;
-                  
-                  ++curr_ram_tiles_nmb;
-                }
-              }
-              catch(...)
-              {
-                if( ! allocateDiskTilesFiles( curr_band, curr_tile ) )
-                {
-                  clear();
-                  
-                  return false;
-                }
-                else
-                {
-                  TEAGN_TRUE_OR_THROW( getTilePointer( curr_band, 
-                    curr_tile ), "Invalid tile pointer" )
-                    
-                  /* break the tiles loop */
-                  
-                  curr_band = bands;
-                  curr_tile = tiles_per_band_;                    
-                }
-              }
-            } else {
-              if( ! allocateDiskTilesFiles( curr_band, curr_tile ) )
-              {
-                clear();
-                
-                return false;
-              }
-              else
-              {
-                TEAGN_TRUE_OR_THROW( getTilePointer( curr_band, 
-                  curr_tile ), "Invalid tile pointer" )
-                  
-                /* break the tiles loop */
-                
-                curr_band = bands;
-                curr_tile = tiles_per_band_;                  
-              }              
-            }
-                            
-            break;
-          }
-          default :
-          {
-            clear();
-            
-            TEAGN_LOG_AND_THROW( "Invalid memory policy" );
-      
-            break;
-          }
-        }
-      }
-    }
-  }
-  
-  return true;
-}
-
-
-void TeRasterMemManager::init()
-{
-  tiles_per_band_ = 0;
-  bands_nmb_ = 0;
-  max_disk_file_size_ = 1024 * 1024 * 100;
-  cur_disk_tile_ptr_ = 0;
-  cur_disk_tile_idx_ = -1;
-}
-
-
-bool TeRasterMemManager::allocateDiskTilesFiles( 
-  unsigned int starting_band_index, unsigned int starting_tile_index )
-{
-  TEAGN_TRUE_OR_THROW( ( bands_tiles_sizes_.size() == bands_nmb_ ),
-    "Invalid tile sizes vector" );    
-  TEAGN_TRUE_OR_THROW( ( starting_band_index < bands_nmb_ ),
-    "Invalid starting_band_index" );    
-  TEAGN_TRUE_OR_THROW( ( starting_tile_index < tiles_per_band_ ),
-    "Invalid starting_tile_index" );    
- 
-  /* Allocating disk files */    
-  
-  for( unsigned int curr_band = starting_band_index ; curr_band < bands_nmb_ ; 
-    ++curr_band ) {
-  
-    const unsigned int tile_size = bands_tiles_sizes_[ curr_band ];
-    TEAGN_TRUE_OR_THROW( ( tile_size <= max_disk_file_size_ ), 
-      "Invalid tile size" );
-    
-    const unsigned long int tiles_per_file = ( unsigned long int )
-      floor( ( (double)max_disk_file_size_ ) / ( (double) tile_size ) );
-      
-    const unsigned long int file_size = (unsigned long int)
-      ( tiles_per_file * tile_size );
-    
-    unsigned int curr_tiles_in_file = tiles_per_file + 1;
-      
-    unsigned int curr_tile = 0;
-    if( curr_band == starting_band_index ) {
-      curr_tile = starting_tile_index;
-    }
-    
-    unsigned long int curr_tile_index = 0;
-    
-    FILE* currfileptr = 0;
-    std::string currfilename;
-      
-    while( curr_tile < tiles_per_band_ ) {
-      curr_tile_index = ( curr_band * tiles_per_band_ ) + curr_tile;
-    
-      if( curr_tiles_in_file >= tiles_per_file ) {
-        /* create a new disk file */
-
-        if( ! createNewDiskFile( file_size, currfilename, &currfileptr ) )
-        {
-          TEAGN_LOGERR( "Unable to create temporary disk file" );
-          
-          clear();
-          
-          return false;           
-        }
-        
-        std::pair< FILE*, std::string > temppair;
-        temppair.first = currfileptr;
-        temppair.second = currfilename;
-        
-        open_disk_files_vec_.push_back( temppair );
-        
-        TeTempFilesRemover::instance().addFile( currfilename,
-          currfileptr );
-        
-        curr_tiles_in_file = 0;
-      }
-      
-      tile2file_vec_[ curr_tile_index ].fileptr_ = currfileptr;
-      tile2file_vec_[ curr_tile_index ].fileoff_ = curr_tiles_in_file *
-        tile_size;
-      tile2file_vec_[ curr_tile_index ].tilesize_ = tile_size;
-      
-      ++curr_tiles_in_file;
-      
-      ++curr_tile;
-    }
-    
-  }
-  
-  return true;
-}
-
-
-unsigned long int TeRasterMemManager::getMaxRAMTiles( unsigned int bands, 
-  unsigned int tiles_per_band,
-  const std::vector< unsigned int >& tiles_sizes)
-{
-  const unsigned long int free_vm = TeGetFreeVirtualMemory();
-  
-  if( free_vm < max_disk_file_size_ )
-  {
-    return 0;
-  }
-  else
-  {
-    const unsigned int max_ram  = (unsigned int)
-      ( 0.90 * ( (double)( free_vm ) ) );    
-    unsigned long int max_ram_tiles = 0;
-    unsigned long int curr_used_ram = 0;
-    
-    for( unsigned int curr_band = 0 ; curr_band < bands ; 
-      ++curr_band ) {
-    
-      const unsigned int tile_size = tiles_sizes[ curr_band ];
-      
-      for( unsigned int curr_tile = 0 ; curr_tile < tiles_per_band ;
-        ++curr_tile ) {
-        
-        if( ( curr_used_ram + tile_size ) > max_ram ) {
-          curr_tile = tiles_per_band;
-          curr_band = bands;
-        } else {
-          ++max_ram_tiles;
-          curr_used_ram += tile_size;
-        }
-      }
-    }
-
-    return max_ram_tiles;
-  }
-}
-
-
-void* TeRasterMemManager::getTilePointer( const unsigned int& band, 
-  const unsigned int& tile)
-{
-  const unsigned int reqtileindex = ( band * tiles_per_band_ ) + tile;
-  
-  TEAGN_DEBUG_CONDITION( ( reqtileindex < ( tiles_per_band_ * bands_nmb_ ) ),
-    "The required band/tile out of range" );
-    
-  TilePtrT tileptr = all_tiles_ptrs_vec_[ reqtileindex ];
-  
-  if( tileptr == 0 ) {
-    /* Flushing the current disk tile back to disk */
-  
-    if( cur_disk_tile_idx_ > (-1) ) {
-      Tiles2FileData& curtiledata = tile2file_vec_[
-        cur_disk_tile_idx_ ];
-      
-      TEAGN_TRUE_OR_THROW( 0 == fseek( curtiledata.fileptr_, 
-        (long)( curtiledata.fileoff_ ), SEEK_SET ),
-        "File seek error" );
-        
-      TEAGN_TRUE_OR_THROW( 1 == fwrite( (void*)cur_disk_tile_ptr_, 
-        (size_t)( curtiledata.tilesize_ ), 1, curtiledata.fileptr_ ),
-        "File write error" )        
-        
-      all_tiles_ptrs_vec_[ cur_disk_tile_idx_ ] = 0;
-    }
-    
-    /* Reading the required tile into RAM */
-    
-    Tiles2FileData& reqtiledata = tile2file_vec_[
-      reqtileindex ];    
-    
-    TEAGN_TRUE_OR_THROW( 0 == fseek( reqtiledata.fileptr_, 
-      (long)( reqtiledata.fileoff_ ), SEEK_SET ),
-      "File seek error" )
-      
-    TEAGN_TRUE_OR_THROW( 1 == fread( (void*)cur_disk_tile_ptr_, 
-      (size_t)( reqtiledata.tilesize_ ), 1, reqtiledata.fileptr_ ),
-      "File read error" )
-      
-    all_tiles_ptrs_vec_[ reqtileindex ] = cur_disk_tile_ptr_;
-      
-    cur_disk_tile_idx_ = reqtileindex;
-      
-    return cur_disk_tile_ptr_;
-  }
-  else
-  {
-    return tileptr;
-  }
-}
-
-
-bool TeRasterMemManager::createNewDiskFile( unsigned long int size,
-  std::string& filename, FILE** fileptr )
-{
-  TEAGN_TRUE_OR_RETURN( TeGetTempFileName( filename ),
-    "Unable to get temporary file name" );
-    
-  (*fileptr) = fopen( filename.c_str(), "wb+" );
-  TEAGN_TRUE_OR_RETURN( (*fileptr) != 0, "Invalid file pointer" )
-  
-  long seekoff = (long)( size - 1 );
-  
-  if( 0 != fseek( (*fileptr), seekoff, SEEK_SET ) )
-  {
-    fclose( (*fileptr) );
-    TEAGN_LOGERR( "File seek error" );
-    return false;
-  }
-
-  unsigned char c = '\0';
-  if( 1 != fwrite( &c, 1, 1, (*fileptr) ) )
-  {
-    fclose( (*fileptr) );
-    TEAGN_LOGERR( "File write error" );
-    return false;
-  }
-    
-  return true;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include "TeRasterMemManager.h"
+
+#include "TeUtils.h"
+#include "TeErrorLog.h"
+#include "TeTempFilesRemover.h"
+#include "TeAgnostic.h"
+
+
+TeRasterMemManager::TeRasterMemManager()
+{
+  maxMemPercentUsage_ = 50;
+  maxTempFileSize_ = 2ul * 1024ul * 1024ul * 1024ul;
+  getTilePointer_tilePtr_ = 0;
+  getTilePointer_reqTileIdx_ = 0;
+  getTilePointer_swapTileIdx_ = 0;
+  tilesPerBand_ = 0;
+  bandsNmb_ = 0;
+  nextSwapTileRamTilesIndexesVecIdx_ = 0;
+  swapTilePtr_ = 0;
+}
+
+
+TeRasterMemManager::~TeRasterMemManager()
+{
+  clear();
+}
+
+
+void TeRasterMemManager::clear()
+{
+  getTilePointer_tilePtr_ = 0;
+  
+  getTilePointer_reqTileIdx_ = 0;
+  
+  getTilePointer_swapTileIdx_ = 0;
+
+  tilesPerBand_ = 0;
+  
+  bandsNmb_ = 0;
+  
+  bandsTileSizes_.clear();
+  
+  for( unsigned int allTilesPtrsVecIdx = 0 ; allTilesPtrsVecIdx < 
+    allTilesPtrsVec_.size() ; ++allTilesPtrsVecIdx )
+  {
+    if( allTilesPtrsVec_[ allTilesPtrsVecIdx ] )
+      delete[] ( allTilesPtrsVec_[ allTilesPtrsVecIdx ] );
+  }  
+  allTilesPtrsVec_.clear();
+  
+  for( unsigned int openDiskFilesVecIdx = 0 ; openDiskFilesVecIdx < 
+    openDiskFilesVec_.size() ; ++openDiskFilesVecIdx )
+  {
+    TeTempFilesRemover::instance().removeFile( openDiskFilesVec_[ 
+      openDiskFilesVecIdx ].second );      
+  } 
+  openDiskFilesVec_.clear();
+  
+  diskTilesDataVec_.clear();
+  
+  ramTilesIndexesVec_.clear();
+  
+  nextSwapTileRamTilesIndexesVecIdx_ = 0;
+  
+  if( swapTilePtr_ ) delete[]( swapTilePtr_ );
+  swapTilePtr_ = 0;
+}
+
+bool TeRasterMemManager::reset( unsigned int bands, unsigned int tilesPerBand,
+  const std::vector< unsigned int >& tilesSizesVec,
+  MemoryPolicy memoryPolicy )
+{
+  clear();
+  
+  if( ( bands > 0 ) && ( tilesPerBand > 0 ) )
+  {
+    tilesPerBand_ = tilesPerBand;
+    bandsNmb_ = bands;
+    bandsTileSizes_ = tilesSizesVec;
+    
+    const unsigned int totalTilesNumber = tilesPerBand * bandsNmb_;
+    
+    // Guessing the max tile size
+    
+    unsigned int maxTileSize = 0;
+    for( unsigned int currBand = 0 ; currBand < bandsNmb_ ; ++currBand ) 
+    {    
+      maxTileSize = MAX( bandsTileSizes_[ currBand ], maxTileSize );
+    }    
+    
+    /* Allocating */
+    
+    try
+    {
+      /* Allocating global objects */ 
+         
+      allTilesPtrsVec_.resize( totalTilesNumber, 0 );
+      
+      // Allocating ram tiles
+    
+      if( ( memoryPolicy == AutoMemPol ) || ( memoryPolicy == DiskMemPol) )
+      {
+        // Allocating the swap tile
+        
+        swapTilePtr_ = (TilePtrT) new TileDataT[ maxTileSize ];
+        if( swapTilePtr_ == 0 ) 
+        {
+          clear();
+          
+          return false;        
+        }
+      
+        // Defining the number of RAM tiles
+        
+        unsigned int maxRAMTiles = 1;
+        
+        if( memoryPolicy == AutoMemPol )
+        {
+          // Defining the max number of RAM tiles
+          
+          const double totalPhysMem = (double)TeGetTotalPhysicalMemory();
+          
+          const double totalVMem = (double)TeGetTotalVirtualMemory();
+          
+          const double totalMem = ( ((double)maxMemPercentUsage_) / 100.0 ) *
+            MIN( totalVMem, totalPhysMem );
+            
+          const double freeMem = MIN( totalMem, (double)TeGetFreeVirtualMemory() );
+            
+          maxRAMTiles = (unsigned int)MAX( 1, freeMem / ((double)maxTileSize) );
+        }
+        
+        // Allocating RAM tiles and updating ramTilesIndexesVec_
+        
+        const unsigned int ramTilesNmb = MIN( maxRAMTiles, totalTilesNumber );
+        
+        ramTilesIndexesVec_.resize( ramTilesNmb, 0 );
+        nextSwapTileRamTilesIndexesVecIdx_ = 0;
+        
+        TilePtrT newTilePtr = 0;
+        
+        for( unsigned int tileIdx = 0 ; tileIdx < ramTilesNmb ; ++tileIdx )
+        {
+          newTilePtr = (TilePtrT) new TileDataT[ maxTileSize ];
+          
+          if( newTilePtr )
+          {
+            allTilesPtrsVec_[ tileIdx ] = newTilePtr;
+          }
+          else
+          {
+            clear();
+            
+            return false;
+          }
+          
+          ramTilesIndexesVec_[ tileIdx ] = tileIdx;
+        }
+          
+        // Allocating the disk files
+        
+        DiskTileDataVecT freeDiskTilesData;
+        const unsigned int diskTilesNumber = totalTilesNumber - 
+          ramTilesNmb;
+      
+        if( ! allocateDiskFiles( maxTileSize, diskTilesNumber, 
+          openDiskFilesVec_, freeDiskTilesData ) )
+        {
+          clear();
+          
+          return false;
+        }
+                    
+        // Updating the disk tiles data vector
+        
+        diskTilesDataVec_.resize( totalTilesNumber );
+        
+        TEAGN_DEBUG_CONDITION( freeDiskTilesData.size() == diskTilesNumber, 
+          "Internal error" );
+          
+        unsigned int tilesSizesVecIdx = 0;
+        unsigned int freeDiskTilesDataIdx = 0;
+          
+        for( unsigned int diskTilesDataVecIdx = 0 ; 
+          diskTilesDataVecIdx < totalTilesNumber ; ++diskTilesDataVecIdx )
+        {
+          if( diskTilesDataVecIdx >= ramTilesNmb )
+          {
+            freeDiskTilesDataIdx = diskTilesDataVecIdx - ramTilesNmb;
+ 
+            diskTilesDataVec_[ diskTilesDataVecIdx ] = freeDiskTilesData[ 
+              freeDiskTilesDataIdx ];
+          }
+          
+          tilesSizesVecIdx = diskTilesDataVecIdx / tilesPerBand;
+          TEAGN_DEBUG_CONDITION( tilesSizesVecIdx < tilesSizesVec.size(),
+            "Internal error" );
+          
+          diskTilesDataVec_[ diskTilesDataVecIdx ].size_ = tilesSizesVec[
+            tilesSizesVecIdx ];        
+        }
+      }
+      else if( memoryPolicy == RAMMemPol )
+      {
+        TilePtrT newTilePtr = 0;
+        unsigned int allTilesPtrsVecIdx = 0;
+      
+        for( unsigned int currBand = 0 ; currBand < bandsNmb_ ; ++currBand )
+        {
+          unsigned int tileBytes = bandsTileSizes_[ currBand ];        
+          
+          for( unsigned int tileIdx = 0 ; tileIdx < tilesPerBand_ ;
+            ++tileIdx ) 
+          {
+            newTilePtr = (TilePtrT) new TileDataT[ tileBytes ];
+              
+            if( newTilePtr == 0 ) 
+            {
+              clear();
+              
+              return false;
+            } 
+            else 
+            {
+              allTilesPtrsVec_[ allTilesPtrsVecIdx ] = newTilePtr;
+              ++allTilesPtrsVecIdx;
+            }              
+          }          
+        }
+      }
+      else
+      {
+        TEAGN_LOG_AND_THROW( "Invalid memory policy" );
+      }     
+    }
+    catch(...)
+    {
+      clear();
+      
+      TEAGN_LOG_AND_RETURN( "Tiles allocation error" )
+    } 
+    
+  }
+
+  return true;
+}
+
+bool TeRasterMemManager::allocateDiskFiles( 
+  unsigned int tileSize,
+  unsigned int tilesNmb, OpenDiskFilesVecT& openDiskFilesVec, 
+  DiskTileDataVecT& diskTilesData )
+{
+  openDiskFilesVec.clear();
+  diskTilesData.clear();
+  
+  if( ( tileSize > 0 ) && ( tilesNmb > 0 ) )
+  {
+    const unsigned long int maxTilesPerFile = ( unsigned long int )
+      floor( ( (double)maxTempFileSize_ ) / ( (double) tileSize ) );
+        
+    const unsigned long int maxFileSize = (unsigned long int)
+      ( maxTilesPerFile * tileSize );
+      
+    const unsigned int filesNumber = (unsigned int)ceil( ((double)tilesNmb) /
+      ((double)maxTilesPerFile) );
+      
+    for( unsigned int fileIdx = 0 ; fileIdx < filesNumber ; ++fileIdx )
+    {
+      // Defining the current file size
+      
+      unsigned int remainingTilesNmb = tilesNmb - 
+        (unsigned int)diskTilesData.size();
+      
+      unsigned int fileSize = maxFileSize;
+      unsigned int fileTilesNumber = maxTilesPerFile;
+      
+      if( remainingTilesNmb < maxTilesPerFile )
+      {
+        fileSize = (unsigned long int)( tileSize * remainingTilesNmb );
+        fileTilesNumber = remainingTilesNmb;
+      }
+      
+      // allocating the file 
+      
+      std::pair< FILE*, std::string > newFileData;
+      
+      if( ! createNewDiskFile( fileSize, newFileData.second, 
+        &( newFileData.first) ) )
+      {
+        TEAGN_LOGERR( "Unable to create temporary disk file" );
+        
+        return false;           
+      }
+      else
+      {
+        openDiskFilesVec.push_back( newFileData );
+        
+        TeTempFilesRemover::instance().addFile( newFileData.second,
+          newFileData.first );    
+              
+        DiskTileData auxTileData;
+        auxTileData.filePtr_ = newFileData.first;
+        
+        for( unsigned int tileIdx = 0; tileIdx < fileTilesNumber ; ++tileIdx )
+        {
+          auxTileData.fileOff_ = tileIdx * tileSize;
+          
+          diskTilesData.push_back( auxTileData );
+        }
+      }
+    }
+  }
+  
+  return true;
+}
+
+void* TeRasterMemManager::getTilePointer( const unsigned int& band, 
+  const unsigned int& tile)
+{
+  getTilePointer_reqTileIdx_ = ( band * tilesPerBand_ ) + tile;
+  
+  TEAGN_DEBUG_CONDITION( ( getTilePointer_reqTileIdx_ < 
+    allTilesPtrsVec_.size() ), "Internal error" );
+  getTilePointer_tilePtr_ = allTilesPtrsVec_[ getTilePointer_reqTileIdx_ ];
+  
+  if( getTilePointer_tilePtr_ == 0 ) 
+  {
+    TEAGN_DEBUG_CONDITION( nextSwapTileRamTilesIndexesVecIdx_ <
+      ramTilesIndexesVec_.size(), "Internal error" );
+    getTilePointer_swapTileIdx_ = ramTilesIndexesVec_[ 
+      nextSwapTileRamTilesIndexesVecIdx_ ];
+    
+    TEAGN_DEBUG_CONDITION( getTilePointer_reqTileIdx_ < 
+      diskTilesDataVec_.size(), "Internal error" )
+    DiskTileData& inTileData = diskTilesDataVec_[ getTilePointer_reqTileIdx_ ];
+    
+    TEAGN_DEBUG_CONDITION( getTilePointer_swapTileIdx_ < 
+      diskTilesDataVec_.size(), "Internal error" )
+    DiskTileData& outTileData = diskTilesDataVec_[ 
+      getTilePointer_swapTileIdx_ ];
+      
+    /* Reading the required tile into RAM (swapTilePtr_) */
+    
+    TEAGN_DEBUG_CONDITION( inTileData.filePtr_, "Internal error" );
+    TEAGN_TRUE_OR_THROW( 0 == fseek( inTileData.filePtr_, 
+      (long)( inTileData.fileOff_ ), SEEK_SET ),
+      "File seek error" )
+      
+    TEAGN_DEBUG_CONDITION( swapTilePtr_, "Internal error" );
+    TEAGN_TRUE_OR_THROW( 1 == fread( (void*)swapTilePtr_, 
+      (size_t)( inTileData.size_ ), 1, inTileData.filePtr_ ),
+      "File read error" )
+  
+    /* Flushing the swap tile to disk */
+      
+    TEAGN_TRUE_OR_THROW( 0 == fseek( inTileData.filePtr_, 
+      (long)( inTileData.fileOff_ ), SEEK_SET ),
+      "File seek error" );
+      
+    TEAGN_DEBUG_CONDITION( getTilePointer_swapTileIdx_ < 
+      allTilesPtrsVec_.size(), "Internal error" );          
+    TEAGN_TRUE_OR_THROW( 1 == fwrite( (void*)allTilesPtrsVec_[ 
+      getTilePointer_swapTileIdx_ ], 
+      (size_t)( outTileData.size_ ), 1, inTileData.filePtr_ ),
+      "File write error" )        
+    
+    // Updating the tile pointers
+    
+    getTilePointer_tilePtr_ = allTilesPtrsVec_[ getTilePointer_swapTileIdx_ ];
+    
+    allTilesPtrsVec_[ getTilePointer_swapTileIdx_ ] = 0;
+    
+    allTilesPtrsVec_[ getTilePointer_reqTileIdx_ ] = swapTilePtr_;
+    
+    swapTilePtr_ = getTilePointer_tilePtr_;
+    
+    /* Updating the info vectors */
+        
+    outTileData.filePtr_ = inTileData.filePtr_;
+    outTileData.fileOff_ = inTileData.fileOff_;
+    
+    inTileData.filePtr_ = 0;
+    inTileData.fileOff_ = 0;    
+    
+    ramTilesIndexesVec_[ nextSwapTileRamTilesIndexesVecIdx_ ] =
+      getTilePointer_reqTileIdx_;
+    nextSwapTileRamTilesIndexesVecIdx_ = 
+      ( ( nextSwapTileRamTilesIndexesVecIdx_ + 1 ) % 
+      ((unsigned int)ramTilesIndexesVec_.size()) );
+    TEAGN_DEBUG_CONDITION( nextSwapTileRamTilesIndexesVecIdx_ <
+      ramTilesIndexesVec_.size(), "Internal error" );          
+        
+    return allTilesPtrsVec_[ getTilePointer_reqTileIdx_ ];
+  }
+  else
+  {
+    return getTilePointer_tilePtr_;
+  }
+}
+
+
+void TeRasterMemManager::setMaxMemPercentUsage( 
+  unsigned char maxMemPercentUsage )
+{
+  TEAGN_TRUE_OR_THROW( maxMemPercentUsage < 101, "Invalid value" );
+  
+  maxMemPercentUsage_ = maxMemPercentUsage;
+}
+
+void TeRasterMemManager::setMaxTempFileSize( 
+  unsigned long int maxTempFileSize )
+{
+  TEAGN_TRUE_OR_THROW( maxTempFileSize > 0, "Invalid value" );
+  
+  maxTempFileSize_ = maxTempFileSize;
+}
+
+bool TeRasterMemManager::createNewDiskFile( unsigned long int size,
+  std::string& filename, FILE** fileptr )
+{
+  TEAGN_TRUE_OR_RETURN( TeGetTempFileName( filename ),
+    "Unable to get temporary file name" );
+    
+  (*fileptr) = fopen( filename.c_str(), "wb+" );
+  TEAGN_TRUE_OR_RETURN( (*fileptr) != 0, "Invalid file pointer" )
+  
+  long seekoff = (long)( size - 1 );
+  
+  if( 0 != fseek( (*fileptr), seekoff, SEEK_SET ) )
+  {
+    fclose( (*fileptr) );
+    TEAGN_LOGERR( "File seek error" );
+    return false;
+  }
+
+  unsigned char c = '\0';
+  if( 1 != fwrite( &c, 1, 1, (*fileptr) ) )
+  {
+    fclose( (*fileptr) );
+    TEAGN_LOGERR( "File write error" );
+    return false;
+  }
+    
+  return true;
+}
+
diff --git a/src/terralib/kernel/TeRasterMemManager.h b/src/terralib/kernel/TeRasterMemManager.h
old mode 100755
new mode 100644
index 5384575..314ec37
--- a/src/terralib/kernel/TeRasterMemManager.h
+++ b/src/terralib/kernel/TeRasterMemManager.h
@@ -1,257 +1,268 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeRasterMemManager.h
-    \brief This file contains a class that deals with a raster memory management
-*/
-
-#ifndef TERASTERMEMMANAGER_H
-  #define TERASTERMEMMANAGER_H
-
-  #include "TeSharedPtr.h"
-  
-  #include <vector>
-  
-  /**
-   * @brief This class deals with a raster memory management.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   */
-  class TL_DLL TeRasterMemManager {
-  
-    public :
-    
-      /**
-       * @enum Memory policy.
-       */ 
-      enum MemoryPolicy {
-        /**
-         * @brief Automatic memory policy ( Try to use RAM or DISK, 
-         * if there is no avaliable RAM ).
-         */
-        AutoMemPol = 1,
-        /**
-         * @brief RAM memory policy.
-         */
-        RAMMemPol = 2,
-        /**
-         * @brief Disk memory policy.
-         */
-        DiskMemPol = 3
-      };    
-    
-      /**
-       * @brief Default Constructor.
-       */
-      TeRasterMemManager();    
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TeRasterMemManager();
-      
-      /**
-       * @brief Clear all data structures.
-       */
-      void clear();
-      
-      /**
-       * @brief Reset the instance following new raster parameters.
-       * @param bands The number of bands (channels).
-       * @param tiles_per_band The tiles inside each band.
-       * @param tiles_sizes The tile size (bytes) for each band.
-       * @param mem_pol Memory policy.
-       * @return true if OK, false on errors.
-       */
-      bool reset( unsigned int bands, unsigned int tiles_per_band,
-        const std::vector< unsigned int >& tiles_sizes,
-         MemoryPolicy mem_pol );
-
-      /**
-       * @brief Returnas a pointer to a internal allocated tile.
-       * @param band Band index.
-       * @param tile Tile index.
-       * @return a pointer to a internal allocated tile. 
-       * @note This pointer is only valid until the next call to this function.
-       */
-      void* getTilePointer( const unsigned int& band, 
-        const unsigned int& tile );      
-      
-    protected :
-    
-      /**
-       * @brief Tiles-to-file data class.
-       */         
-      class Tiles2FileData
-      {
-        public :
-          FILE* fileptr_;
-          unsigned int fileoff_;
-          unsigned int tilesize_;
-          
-          Tiles2FileData()
-          {
-            fileptr_ = 0;
-            fileoff_ = 0;
-            tilesize_ = 0;
-          }
-      };
-            
-      /**
-       * @typedef unsigned char TileDataT 
-       * Tile data type.
-       */    
-      typedef unsigned char TileDataT;    
-    
-      /**
-       * @typedef TileDataT* TilePtrT
-       * Tile pointer type.
-       */    
-      typedef TileDataT* TilePtrT;
-      
-      /**
-       * @typedef std::vector< TilePtrT > TilesPtrsVecT 
-       * Tiles pointers vector type.
-       */    
-      typedef std::vector< TilePtrT > TilesPtrsVecT;   
-      
-      /**
-       * @typedef std::vector< Tiles2FileData >
-       * Tiles to their respective disk file and offset.
-       */         
-      typedef std::vector< Tiles2FileData > 
-        Tiles2FileVecT;
-        
-      /**
-       * @typedef std::vector< std::pair< FILE*, unsigned int > >
-       * Tiles to their respective disk file and offset.
-       */         
-      typedef std::vector< std::pair< FILE*, std::string > > 
-        OpenDiskFilesVecT;        
-      
-      /**
-       * @brief Tiles per band.
-       */    
-      unsigned int tiles_per_band_;
-      
-      /**
-       * @brief The number of bands.
-       */    
-      unsigned int bands_nmb_;
-      
-      /**
-       * @brief The maximum disk file size.
-       */     
-      unsigned long int max_disk_file_size_;      
-      
-      /**
-       * @brief The current active disk tile copy in mem.
-       */     
-      TilePtrT cur_disk_tile_ptr_;
-      
-      /**
-       * @brief The index of the current active disk tile copy in mem
-       * ( default -1 , no disk tile active ).
-       */     
-      long int cur_disk_tile_idx_;      
-      
-      /**
-       * @brief A vector of tiles sizes for each band.
-       */        
-      std::vector< unsigned int > bands_tiles_sizes_;
-    
-      /**
-       * @brief A vector of pointers to all allocated tiles.
-       * @note Declared as a simple vector to optimize the
-       * tile access.
-       */     
-      TilesPtrsVecT all_tiles_ptrs_vec_;
-      
-      /**
-       * @brief A vector mapping tiles indexes to their respective 
-       * disk file pointer and offset inside that file.
-       */        
-      Tiles2FileVecT tile2file_vec_;
-      
-      /**
-       * @brief A vector all opened disk files names.
-       */        
-      OpenDiskFilesVecT open_disk_files_vec_;   
-         
-
-      /**
-       * @brief Initiates the internal variables to their default values.
-       */    
-      void init();
-      
-      /**
-       * @brief Allocate disk files starting at a specific
-       * band and tile number.
-       * @param starting_band_index Starting Band index.
-       * @param starting_tile_index Starting tile index.
-       * @return true if OK, false on errors.
-       * @note bands_ptr_ must be previously allocated.
-       */    
-      bool allocateDiskTilesFiles( 
-        unsigned int starting_band_index,
-        unsigned int starting_tile_index );
-        
-      /**
-       * @brief Return the maximum RAM tiles that can fit in the
-       * current RAM for all bands.
-       * @param bands The number of bands (channels).
-       * @param tiles_per_band The tiles inside each band.
-       * @param tiles_sizes The tile size (bytes) for each band.       
-       * @return Return the maximum RAM tiles.
-       */    
-      unsigned long int getMaxRAMTiles( unsigned int bands, 
-        unsigned int tiles_per_band,
-        const std::vector< unsigned int >& tiles_sizes );        
-        
-      /**
-       * @brief Create a new disk file.
-       * @param filename The file name.
-       * @param size The file size.
-       * @param fileptr The file pointer.
-       * @return true if OK. false on errors.
-       */
-      bool createNewDiskFile( unsigned long int size,
-        std::string& filename, FILE** fileptr );
-      
-    private :
-    
-      /**
-       * @brief Alternative Constructor.
-       * @param ext External reference.
-       */    
-      TeRasterMemManager( const TeRasterMemManager& ) {};
-       
-      /**
-       * @brief =operator implementation.
-       * @param ext External reference.
-       */    
-      const TeRasterMemManager& operator=( const TeRasterMemManager& )
-        { return *this; };
-      
-  };
-  
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeRasterMemManager.h
+    \brief This file contains a class that deals with a raster memory management
+*/
+
+#ifndef TERASTERMEMMANAGER_H
+  #define TERASTERMEMMANAGER_H
+
+  #include "TeSharedPtr.h"
+  
+  #include <vector>
+  
+  /**
+   * @brief This class deals with a raster memory management.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   */
+  class TL_DLL TeRasterMemManager {
+  
+    public :
+    
+      /**
+       * @enum Memory policy.
+       */ 
+      enum MemoryPolicy {
+        /**
+         * @brief Automatic memory policy ( Try to use RAM or DISK, 
+         * if there is no avaliable RAM ).
+         */
+        AutoMemPol = 1,
+        /**
+         * @brief RAM memory policy.
+         */
+        RAMMemPol = 2,
+        /**
+         * @brief Disk memory policy.
+         */
+        DiskMemPol = 3
+      };    
+    
+      /**
+       * @brief Default Constructor.
+       */
+      TeRasterMemManager();    
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TeRasterMemManager();
+      
+      /**
+       * @brief Clear all data structures.
+       */
+      void clear();
+      
+      /**
+       * @brief Reset the instance following new raster parameters.
+       * @param bands The number of bands (channels).
+       * @param tilesPerBand The tiles inside each band.
+       * @param tilesSizesVec The tile size (bytes) for each band.
+       * @param memoryPolicy Memory policy.
+       * @return true if OK, false on errors.
+       */
+      bool reset( unsigned int bands, unsigned int tilesPerBand,
+        const std::vector< unsigned int >& tilesSizesVec,
+        MemoryPolicy memoryPolicy );
+
+      /**
+       * @brief Returnas a pointer to a internal allocated tile.
+       * @param band Band index.
+       * @param tile Tile index.
+       * @return a pointer to a internal allocated tile. 
+       * @note This pointer is only valid until the next call to this function.
+       */
+      void* getTilePointer( const unsigned int& band, 
+        const unsigned int& tile );    
+          
+      /**
+       * @brief Set the max amount of RAM memory to use when necessary.
+       * @param maxMemPercentUsage The max amount of RAM memory percentage 
+       * to use when necessary - valid range: [0,100] default:50.
+       */          
+      void setMaxMemPercentUsage( unsigned char maxMemPercentUsage );
+      
+      /**
+       * @brief Set the maximum temp file size (bytes).
+       * @param maxMemPercentUsage The the maximum temp file size (bytes) 
+       * (default:2GB).
+       */          
+      void setMaxTempFileSize( unsigned long int maxTempFileSize );      
+      
+    protected :
+    
+      /**
+       * @brief Disk tile data.
+       */         
+      class DiskTileData
+      {
+        public :
+          FILE* filePtr_;
+          unsigned long int fileOff_;
+          unsigned int size_;
+          
+          DiskTileData() : filePtr_( 0 ), fileOff_( 0 ), size_( 0 ) {};
+          
+          ~DiskTileData() {};
+      };      
+
+      /**
+       * @typedef unsigned char TileDataT 
+       * Tile data type.
+       */    
+      typedef unsigned char TileDataT;    
+    
+      /**
+       * @typedef TileDataT* TilePtrT
+       * Tile pointer type.
+       */    
+      typedef TileDataT* TilePtrT;
+      
+      /**
+       * @typedef std::vector< TilePtrT > TilesPtrsVecT 
+       * Tiles pointers vector type.
+       */    
+      typedef std::vector< TilePtrT > TilesPtrsVecT;   
+      
+      /**
+       * @typedef std::list< DiskTileData >
+       * Disk tile data vector type.
+       */         
+      typedef std::vector< DiskTileData > 
+        DiskTileDataVecT;   
+        
+      /**
+       * @typedef std::vector< std::pair< FILE*, unsigned int > >
+       * Openend disk files data vector type.
+       */         
+      typedef std::vector< std::pair< FILE*, std::string > > 
+        OpenDiskFilesVecT;   
+             
+      /**
+       * @brief the max amount of free memory to use when necessary
+       * (default:50).
+       */      
+      unsigned char maxMemPercentUsage_;
+      
+      /**
+       * @brief The the maximum temp file size in bytes (default:2GB).
+       */      
+      unsigned long int maxTempFileSize_;      
+      
+      // Temp variables used by the getTilePointer method.
+      TilePtrT getTilePointer_tilePtr_;
+      unsigned int getTilePointer_reqTileIdx_;
+      unsigned int getTilePointer_swapTileIdx_;
+      
+      /**
+       * @brief Tiles per band (default:0).
+       */    
+      unsigned int tilesPerBand_;
+      
+      /**
+       * @brief The number of bands (default:0).
+       */    
+      unsigned int bandsNmb_;
+      
+      /**
+       * @brief A vector of tiles sizes for each band.
+       */        
+      std::vector< unsigned int > bandsTileSizes_;
+    
+      /**
+       * @brief A vector of pointers to all allocated tiles.
+       * @note Declared as a simple vector to optimize the
+       * tile access.
+       */     
+      TilesPtrsVecT allTilesPtrsVec_;
+      
+      /**
+       * @brief Openend disk files data vector.
+       */        
+      OpenDiskFilesVecT openDiskFilesVec_;   
+      
+      /**
+       * @brief Disk tiles data vector.
+       */   
+      DiskTileDataVecT diskTilesDataVec_;
+      
+      /**
+       * @brief The indexes inside allTilesPtrsVec_ of all RAM tiles.
+       */        
+      std::vector< unsigned int > ramTilesIndexesVec_;
+      
+      /**
+       * @brief The index inside ramTilesIndexesVec_ of the next RAM
+       * tile index that will be swapped to disk when a disk tile
+       * is required.
+       */        
+      unsigned int nextSwapTileRamTilesIndexesVecIdx_;
+      
+      /**
+       * @brief A pointer to the auxiliar tile used when swapping
+       * data to/from disk.
+       */              
+      TilePtrT swapTilePtr_;
+      
+      /**
+       * @brief Allocate disk files .
+       * @param tileSize The tile size.
+       * @param tilesNmb The tiles number.
+       * @param openDiskFilesVec The output vector with all the
+       * created files info.
+       * @param diskTilesData The output tiles info.
+       * @return true if OK, false on errors.
+       */    
+      bool allocateDiskFiles( unsigned int tileSize,
+        unsigned int tilesNmb, OpenDiskFilesVecT& openDiskFilesVec, 
+        DiskTileDataVecT& diskTilesData );
+        
+      /**
+       * @brief Create a new disk temp file.
+       * @param filename The file name.
+       * @param size The file size.
+       * @param fileptr The file pointer.
+       * @return true if OK. false on errors.
+       */
+      bool createNewDiskFile( unsigned long int size,
+        std::string& filename, FILE** fileptr );
+      
+    private :
+    
+      /**
+       * @brief Alternative Constructor.
+       * @param ext External reference.
+       */    
+      TeRasterMemManager( const TeRasterMemManager& ) {};
+       
+      /**
+       * @brief =operator implementation.
+       * @param ext External reference.
+       */    
+      const TeRasterMemManager& operator=( const TeRasterMemManager& )
+        { return *this; };
+      
+  };
+  
+#endif
+
diff --git a/src/terralib/kernel/TeRasterParams.cpp b/src/terralib/kernel/TeRasterParams.cpp
old mode 100755
new mode 100644
index cfb704c..0c8328c
--- a/src/terralib/kernel/TeRasterParams.cpp
+++ b/src/terralib/kernel/TeRasterParams.cpp
@@ -1,875 +1,918 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32 
-#pragma warning ( disable: 4786 ) 
-#endif
-
-#include "TeRasterParams.h"
-#include "TeUtils.h"
-#include "TeAsciiFile.h"
-#include "TeAgnostic.h"
-
-#include <cstring>
-#include <cstdlib>
-
-// copy constructor
-TeRasterParams::TeRasterParams(const TeRasterParams& other)
-{
-	resolution_ = other.resolution_;
-	subBand_  = other.subBand_;
-	nlines_		= other.nlines_;
-	ncols_		= other.ncols_;
-	nbands_		= other.nbands_;
-	lutName_	= other.lutName_;
-	swap_		= other.swap_;
-	useDummy_	= other.useDummy_;
-
-	nbitsperPixel_.clear();
-	vmin_.clear();
-	vmax_.clear();
-	bands_.clear();
-	photometric_.clear();
-	dataType_.clear();
-	dummy_.clear();
-	compression_.clear();
-
-	nbitsperPixel_= other.nbitsperPixel_;
-	vmin_= other.vmin_;
-	vmax_= other.vmax_;
-	bands_= other.bands_;
-	photometric_= other.photometric_;
-	dataType_= other.dataType_;
-	dummy_= other.dummy_;
-	compression_= other.compression_;
-
-	resx_ = other.resx_;
-	resy_ = other.resy_;
-	fileName_ = other.fileName_;
-	mode_ = other.mode_;
-	status_ = other.status_;
-	offset_ = other.offset_;
-	tiling_type_ = other.tiling_type_;
-	blockHeight_ = other.blockHeight_;
-	blockWidth_ = other.blockWidth_;
-	decoderIdentifier_ = other.decoderIdentifier_;
-	nTilesInMemory_ = other.nTilesInMemory_;
-	if (other.projection_)
-		projection_ = TeProjectionFactory::make(other.projection_->params());
-	else
-		projection_=0;
-	box_ = other.box_;
-	database_ = other.database_;
-	layerId_ = other.layerId_;
-	objectId_ = other.objectId_;
-
-	interleaving_ = other.interleaving_;
-
-	lutr_.clear();
-	lutg_.clear();
-	lutb_.clear();
-	lutr_ = other.lutr_;
-	lutg_ = other.lutg_;
-	lutb_ = other.lutb_;
-
-	dyJ_ = other.dyJ_;
-	dxI_ = other.dxI_;
-	dyI_ = other.dyI_;
-	dxJ_ = other.dxJ_;
-	x0_ = other.x0_;
-	y0_ = other.y0_;
-	errorMessage_ = other.errorMessage_;
-	hasSetDummy_ = other.hasSetDummy_;
-	date_ = other.date_;
-}
-
-// operator =
-TeRasterParams& 
-TeRasterParams::operator=(const TeRasterParams& rhs)
-{
-	if ( this != &rhs )
-	{
-		resolution_ = rhs.resolution_;
-		subBand_  = rhs.subBand_;
-		nlines_		= rhs.nlines_;
-		ncols_		= rhs.ncols_;
-		nbands_		= rhs.nbands_;
-		swap_		= rhs.swap_;
-		useDummy_	= rhs.useDummy_;
-		lutName_	= rhs.lutName_;
-
-		nbitsperPixel_.clear();
-		vmin_.clear();
-		vmax_.clear();
-		bands_.clear();
-		photometric_.clear();
-		dataType_.clear();
-		dummy_.clear();
-		compression_.clear();
-
-		nbitsperPixel_= rhs.nbitsperPixel_;
-		vmin_= rhs.vmin_;
-		vmax_= rhs.vmax_;
-		bands_= rhs.bands_;
-		photometric_= rhs.photometric_;
-		dataType_= rhs.dataType_;
-		dummy_= rhs.dummy_;
-		compression_= rhs.compression_;
-
-		resx_ = rhs.resx_;
-		resy_ = rhs.resy_;
-		fileName_ = rhs.fileName_;
-		mode_ = rhs.mode_;
-		status_ = rhs.status_;
-		offset_ = rhs.offset_;
-		tiling_type_ = rhs.tiling_type_;
-		blockHeight_ = rhs.blockHeight_;
-		blockWidth_ = rhs.blockWidth_;
-		decoderIdentifier_ = rhs.decoderIdentifier_;
-		nTilesInMemory_ = rhs.nTilesInMemory_;
-		if (projection_)
-		{
-			delete projection_;
-			projection_ = 0;
-		}
-		if (rhs.projection_)
-			projection_ = TeProjectionFactory::make(rhs.projection_->params());
-		box_ = rhs.box_;
-		database_ = rhs.database_;			
-		layerId_ = rhs.layerId_;
-		objectId_ = rhs.objectId_;
-		interleaving_ = rhs.interleaving_;
-
-		lutr_.clear();
-		lutg_.clear();
-		lutb_.clear();
-		lutr_ = rhs.lutr_;
-		lutg_ = rhs.lutg_;
-		lutb_ = rhs.lutb_;
-
-		dyJ_ = rhs.dyJ_;
-		dxI_ = rhs.dxI_;
-		x0_ = rhs.x0_;
-		y0_ = rhs.y0_;
-		dyI_ =  rhs.dyI_;
-		dxJ_ =  rhs.dxJ_;
-		errorMessage_ = rhs.errorMessage_;
-		hasSetDummy_ = rhs.hasSetDummy_;
-		date_ = rhs.date_;
-	}
-	return *this;
-}
-
-void
-TeRasterParams::resizeToTiling(TeBox& bb, int bWidth, int bHeight)
-{
-	blockHeight_ = bHeight;
-	blockWidth_ = bWidth;
-
-	double bXSize = bWidth*resx_;
-	double bYSize = bHeight*resy_;
-	
-	TeBox baux = adjustToCut(bb, bXSize, bYSize);
-	this->boundingBoxResolution(baux.x1_,baux.y1_,baux.x2_,baux.y2_,resx_,resy_);
-}
-
-//! Calculates the *bounding box* when box coordinates are relative to the center of the pixel
-TeBox	
-TeRasterParams::boundingBox () const
-{ return TeBox (box_.x1()-resx_/2.,
-				box_.y1()-resy_/2.,
-				box_.x2()+resx_/2.,
-				box_.y2()+resy_/2.);
-}
-
-void	
-TeRasterParams::boundingBoxResolution (double x1, double y1, double x2, double y2, 
-									   double resx, double resy, TeBox::TeBoxCorner lock)
-{
-	resx_ = resx;
-	resy_ = resy;
-	ncols_  = (int)((x2-x1)/resx_+0.5);
-	nlines_ = (int)((y2-y1)/resy_+0.5);
-	
-	if (lock == TeBox::TeUPPERLEFT)
-		box_ = TeBox(x1+0.5*resx_, y2-nlines_*resy_+0.5*resy_,
-		             x1+ncols_*resx_-0.5*resx_, y2-0.5*resy_);
-
-	else if (lock == TeBox::TeLOWERLEFT)
-		box_ = TeBox(x1+0.5*resx_, y1+0.5*resy_,
-		             x1+ncols_*resx_-0.5*resx_, y1+nlines_*resy_-0.5*resy_);
-
-	else if (lock == TeBox::TeUPPERRIGHT)
-		box_ = TeBox(x2-ncols_*resx_+0.5*resx_, y2-nlines_*resy_+0.5*resy_,
-			         x2-0.5*resx_,y2-0.5*resy_);
-
-	else		// TeLOWERRIGHT
-		box_ = TeBox(x2-ncols_*resx_+0.5*resx_,y1+0.5*resy_,
-		             x2-0.5*resx_,y1+nlines_*resy_-0.5*resy_);
-}
-
-void	
-TeRasterParams::boundingBoxLinesColumns (double x1, double y1, double x2, double y2, 
-										 int nlines, int ncols, TeBox::TeBoxCorner lock)
-{
-	nlines_ = nlines;
-	ncols_ = ncols;
-	
-	resx_ = (x2-x1)/ncols_;
-	resy_ = (y2-y1)/nlines_;
-
-	if (lock == TeBox::TeUPPERLEFT)
-		box_ = TeBox(x1+0.5*resx_, y2-nlines_*resy_+0.5*resy_,
-		             x1+ncols_*resx_-0.5*resx_, y2-0.5*resy_);
-
-	else if (lock == TeBox::TeLOWERLEFT)
-		box_ = TeBox(x1+0.5*resx_, y1+0.5*resy_,
-		             x1+ncols_*resx_-0.5*resx_, y1+nlines_*resy_-0.5*resy_);
-
-	else if (lock == TeBox::TeUPPERRIGHT)
-		box_ = TeBox(x2-ncols_*resx_+0.5*resx_, y2-nlines_*resy_+0.5*resy_,
-			         x2-0.5*resx_,y2-0.5*resy_);
-
-	else		// TeLOWERRIGHT
-		box_ = TeBox(x2-ncols_*resx_+0.5*resx_,y1+0.5*resy_,
-		             x2-0.5*resx_,y1+nlines_*resy_-0.5*resy_);
-}
-
-void	
-TeRasterParams::boxResolution (double x1, double y1, double x2, double y2, 
-							   double resx, double resy, TeBox::TeBoxCorner lock)
-{
-	resx_ = resx;
-	resy_ = resy;
-
-	ncols_  = (int)((x2-x1)/resx_+0.45)+1;
-	nlines_ = (int)((y2-y1)/resy_+0.45)+1;
-
-	if (lock == TeBox::TeUPPERLEFT)
-		box_ = TeBox(x1, y2-(nlines_-1)*resy_,x1+(ncols_-1)*resx_,y2);
-
-	else if (lock == TeBox::TeLOWERLEFT)
-		box_ = TeBox(x1, y1,x1+(ncols_-1)*resx_,y1+(nlines_-1)*resy_);
-
-	else if (lock == TeBox::TeUPPERRIGHT)
-		box_ = TeBox(x2-(ncols_-1)*resx_, y2-(nlines_-1)*resy_,x2,y2);
-
-	else		// TeLOWERRIGHT
-		box_ = TeBox(x2-(ncols_-1)*resx_,y1,x2,y1+(nlines_-1)*resy_);
-}
-
-void	
-TeRasterParams::boxLinesColumns (double x1, double y1, double x2, double y2, 
-								 int nlines, int ncols, TeBox::TeBoxCorner lock)
-{
-	nlines_ = nlines;
-	ncols_ = ncols;
-
-	resx_ = (x2-x1)/(ncols_-1);
-	resy_ = (y2-y1)/(nlines_-1);
-
-	if (lock == TeBox::TeUPPERLEFT)
-		box_ = TeBox(x1, y2-(nlines_-1)*resy_,x1+(ncols_-1)*resx_,y2);
-
-	else if (lock == TeBox::TeLOWERLEFT)
-		box_ = TeBox(x1, y1,x1+(ncols_-1)*resx_,y1+(nlines_-1)*resy_);
-
-	else if (lock == TeBox::TeUPPERRIGHT)
-		box_ = TeBox(x2-(ncols_-1)*resx_, y2-(nlines_-1)*resy_,x2,y2);
-
-	else		// TeLOWERRIGHT
-		box_ = TeBox(x2-(ncols_-1)*resx_,y1,x2,y1+(nlines_-1)*resy_);
-}
-
-void	
-TeRasterParams::topLeftResolutionSize (double left, double top, 
-									   double resx, double resy, 
-									   int ncol, int nlin, 
-									   bool coordIsCentrePixel)
-{
-	resx_ = resx;
-	resy_ = resy;
-	ncols_  = ncol;
-	nlines_ = nlin;
-	
-	if (coordIsCentrePixel)
-		box_ = TeBox(left,top-(nlin-1)*resy_,left+(ncol-1)*resx_,top);
-	else
-	{
-		TeBox bb(left,top-nlines_*resy_,left+ncols_*resx_,top);
-		box_ = TeBox(bb.x1()+resx_/2.,
-					 bb.y1()+resy_/2.,
-					 bb.x2()-resx_/2.,
-					 bb.y2()-resy_/2.);
-	}
-}
-
-void	
-TeRasterParams::lowerLeftResolutionSize (double left, double lower, 
-										 double resx, double resy, 
-										 int ncol, int nlin, 
-										 bool coordIsCentrePixel)
-{
-	resx_ = resx;
-	resy_ = resy;
-	ncols_  = ncol;
-	nlines_ = nlin;
-	
-	if (coordIsCentrePixel)
-		box_ = TeBox(left,lower,left+(ncol-1)*resx_,lower+(nlin-1)*resy_);
-	else
-	{
-		TeBox bb(left,lower,left+ncols_*resx_,lower+nlines_*resy_);
-		box_ = TeBox(bb.x1()+resx_/2.,
-					 bb.y1()+resy_/2.,
-					 bb.x2()-resx_/2.,
-					 bb.y2()-resy_/2.);
-	}
-}
-
-void 
-TeRasterParams::nBands(int n)
-{
-  TEAGN_TRUE_OR_THROW( ( n > 0 ), "Invalid number of bands" )
-  
-	if (nbands_ != n)
-	{
-		if ( nbands_ == 0 ) 
-    {
-		  nbitsperPixel_.clear();
-		  vmin_.clear();
-		  vmax_.clear();
-		  bands_.clear();
-		  photometric_.clear();
-		  dataType_.clear();
-		  dummy_.clear();
-		  compression_.clear();
-
-		  for (int i = 0; i<n; i++)
-		  {
-        nbitsperPixel_.push_back( 8 );
-			  vmin_.push_back( TeMAXFLOAT );
-			  vmax_.push_back( -TeMAXFLOAT );
-        bands_.push_back( i );
-        photometric_.push_back( TeRasterParams::TeUnknown );
-			  dataType_.push_back( TeUNSIGNEDCHAR );
-			  dummy_.push_back( 0 );
-        compression_.push_back( TeNoCompression );
-		  }
-		} 
-    else if ( nbands_ > n ) 
-    {
-		  for( unsigned int count = ( nbands_ - n ) ; count > 0 ; --count ) {
-		    nbitsperPixel_.pop_back();
-		    vmin_.pop_back();
-		    vmax_.pop_back();
-		    bands_.pop_back();
-		    photometric_.pop_back();
-		    dataType_.pop_back();
-		    dummy_.pop_back();
-		    compression_.pop_back();		  
-		  }
-		} 
-    else /* nbands_ < n */
-    {
-		  for( unsigned int count = ( n - nbands_ ) ; count > 0 ; --count ) {
-		    nbitsperPixel_.push_back( nbitsperPixel_[ nbands_ - 1 ] );
-		    vmin_.push_back( vmin_[ nbands_ - 1 ] );
-		    vmax_.push_back( vmax_[ nbands_ - 1 ] );
-		    bands_.push_back( bands_[ nbands_ - 1 ] );
-		    photometric_.push_back( photometric_[ nbands_ - 1 ] );
-		    dataType_.push_back( dataType_[ nbands_ - 1 ] );
-		    dummy_.push_back( dummy_[ nbands_ - 1 ] );
-		    compression_.push_back( compression_[ nbands_ - 1 ] );  
-		  }		
-		}
-		
-		nbands_ = n;
-	}
-}
-
-void 
-TeRasterParams::projection(TeProjection* proj)
-{
-	if (projection_)
-	{
-		delete projection_;
-		projection_ = 0;
-	}
-	if (proj)
-		projection_ = TeProjectionFactory::make(proj->params());
-}
-
-void 
-TeRasterParams::setDataType(TeDataType type, int band)
-{
-	int nb = 8;
-	double defValue = 0.0;
-	switch (type) {
-	case TeUNSIGNEDCHAR:
-		nb = sizeof(unsigned char)*8;
-		defValue = 255;
-		break;
-	case TeCHAR :
-		defValue = 255;
-		nb = sizeof(char)*8;
-		break;
-	case TeUNSIGNEDSHORT:
-		nb = sizeof(unsigned short)*8;
-		defValue = pow(2.,nb)-1;
-		break;
-	case (TeSHORT):
-		nb = sizeof(short)*8;
-		defValue = pow(2.,nb)-1;
-		break;
-	case (TeUNSIGNEDLONG):
-		nb = sizeof(unsigned long)*8;
-		defValue = pow(2.,nb)-1;
-		break;
-	case (TeLONG):
-		nb = sizeof(long)*8;
-		break;
-	case (TeFLOAT):
-		nb = sizeof(float)*8;
-		defValue = pow(2.,nb)-1;
-		break;
-	case (TeDOUBLE):
-		nb = sizeof(double)*8;
-		defValue = TeMAXFLOAT;
-        break;
-    default:
-        break;
-	}
-	if (band<0 || band>= (int)dataType_.size())
-		for (unsigned int i=0; i<dataType_.size();++i)
-		{
-			dataType_[i]=type;
-			nbitsperPixel_[i]=nb;
-			if (!hasSetDummy_)
-				dummy_[i]=defValue;
-		}
-	else
-	{
-		dataType_[band]=type;
-		nbitsperPixel_[band]=nb;
-		dummy_[band]=defValue;
-	}
-}
-
-int TeRasterParams::elementSize(int band)
-{
-	switch (dataType_[band]) {
-	case TeUNSIGNEDCHAR:
-		return sizeof(unsigned char);
-	case TeCHAR :
-		return sizeof(char);
-	case TeUNSIGNEDSHORT:
-		return sizeof(unsigned short);
-	case (TeSHORT):
-		return sizeof(short);
-	case TeINTEGER:
-		return sizeof(int);
-	case (TeUNSIGNEDLONG):
-		return (sizeof(unsigned long));
-	case (TeLONG):
-		return (sizeof(long));
-	case (TeFLOAT):
-		return (sizeof(float));
-	default:
-		return (sizeof(double));
-	}
-}
-
-
-void 
-TeRasterParams::setPhotometric(TeRasterParams::TeRasterPhotometricInterpretation photom, int band)
-{
-	if (band<0 || band>= (int)photometric_.size())
-		for (unsigned int i=0; i<photometric_.size(); photometric_[i]=photom,i++);
-	else
-		photometric_[band]=photom;
-}
-
-void 
-TeRasterParams::setCompressionMode(TeRasterParams::TeRasterCompressionMode cmode, int band)
-{
-	if (band<0 || band>= (int)compression_.size())
-		for (unsigned int i=0; i<compression_.size(); compression_[i]=cmode,i++);
-	else
-		compression_[band] = cmode;
-}
-
-void 
-TeRasterParams::setDummy(double dummy, int band)
-{
-	if (band<0 || band>= (int)dummy_.size())
-		for (unsigned int i=0; i<dummy_.size(); dummy_[i]=dummy,i++);
-	else
-		dummy_[band] = dummy;
-	this->useDummy_ = true;
-	hasSetDummy_ = true;
-}
-
-TeCoord2D 
-TeRasterParams::coord2Index (const TeCoord2D& pt) const
-{
-	double i, j;
-	if (dxI_ != 0 || dyJ_ != 0)
-	{
-		double x = pt.x();
-		double y = pt.y();
-		
-		i = (dyJ_*(x-x0_)-dxJ_*(y-y0_))/(dxI_*dyJ_-dxJ_*dyI_);
-		j = (x-x0_-i*dxI_)/dxJ_;
-		return TeCoord2D (j,i);
-	}
-	else
-	{
-		i = (pt.x() - box_.x1()) / resx_;
-		j = (box_.y2() - pt.y()) / resy_;
-		return TeCoord2D (i,j);
-	}
-}
-
-TeCoord2D 
-TeRasterParams::index2Coord (const TeCoord2D& pt) const
-{
-	double x,y;
-	double i = pt.y();
-	double j = pt.x();
-		
-	if (dxI_ != 0 || dyJ_ != 0)
-	{
-		x = x0_ + i*dxI_ + j*dxJ_;
-		y = y0_ + i*dyI_ + j*dyJ_;
-	}
-	else
-	{
-		x = box_.x1() + pt.x() * resx_;
-		y = box_.y2() - pt.y() * resy_;
-	}
-	return TeCoord2D (x,y);
-}
-
-void
-TeRasterParams::writeParametersFile()
-{
-	string metFileName = TeGetName (fileName_.c_str())+".met";
-	try {
-		TeAsciiFile metFile(metFileName,"w");
-		string line = "%Raw raster file metadata\n";
-		metFile.writeString(line);
-		line = "NROWS " + Te2String(nlines_);
-		metFile.writeString(line);
-		metFile.writeNewLine();
-		line = "NCOLS " + Te2String(ncols_);
-		metFile.writeString(line);
-		metFile.writeNewLine();
-		line = "NBANDS " + Te2String(this->nBands());
-		metFile.writeString(line);
-		metFile.writeNewLine();
-
-		if (this->nBands() > 1)
-		{
-			line = "INTERLEAVING ";
-			if (interleaving_ == TeRasterParams::TePerPixel)
-				line += "BIP";
-			else if (interleaving_ == TeRasterParams::TePerLine)
-				line += "BIL";
-			else
-				line += "BSQ";
-			metFile.writeString(line);
-			metFile.writeNewLine();
-		}
-
-		int ndecimals = 0;
-		line = "DATATYPE ";
-		if (dataType_[0] == TeBIT)
-			line += "bit";
-		else if (dataType_[0] == TeUNSIGNEDCHAR)
-			line += "unsignedchar";
-		else if (dataType_[0] == TeCHAR)
-			line += "char";
-		else if (dataType_[0] == TeUNSIGNEDSHORT)
-			line += "unsignedshort";
-		else if (dataType_[0] == TeSHORT)
-			line += "short";
-		else if (dataType_[0] == TeINTEGER)
-			line += "integer";
-		else if (dataType_[0] == TeUNSIGNEDLONG)
-			line += "unsignedlong";
-		else if (dataType_[0] == TeLONG)
-			line += "long";
-		else if (dataType_[0] == TeFLOAT)
-		{
-			line += "float";
-			ndecimals = 6;
-		}
-		else if (dataType_[0] == TeDOUBLE)
-		{
-			line += "double";	
-			ndecimals = 10;
-		}
-		metFile.writeString(line);
-		metFile.writeNewLine();
-		
-		if (swap_)
-		{
-			line = "SWAPPED yes";
-			metFile.writeString(line);
-			metFile.writeNewLine();
-		}
-		else
-			line.clear();
-		if (useDummy_)
-		{
-			line += "NO_DATA " + Te2String(dummy_[0], ndecimals);
-			metFile.writeString(line);
-			metFile.writeNewLine();
-		}
-    
-    if( projection_ ) {
-      if (projection_->name() == "NoProjection" ||
-        projection_->name() == "LatLong") {
-        
-        ndecimals = 8;
-      } else {
-        ndecimals = 3;
-      }
-    } else {
-      ndecimals = 8;
-    }
-
-		line = "RESOLUTION_X " + Te2String(resx_,ndecimals);
-		metFile.writeString(line);
-		metFile.writeNewLine();
-		line = "RESOLUTION_Y " + Te2String(resy_,ndecimals);
-		metFile.writeString(line);
-		metFile.writeNewLine();
-		line = "LOWERLEFT_X " + Te2String(this->box().x1_,ndecimals);
-		metFile.writeString(line);
-		metFile.writeNewLine();
-		line = "LOWERLEFT_Y " + Te2String(this->box().y1_,ndecimals);
-		metFile.writeString(line);
-		metFile.writeNewLine();
-		if (this->projection())
-		{
-			line = "PROJECTION ";
-			line += this->projection()->describe();
-			metFile.writeString(line);
-			metFile.writeNewLine();
-			line = "DATUM " +  this->projection()->datum().name();
-			metFile.writeString(line);
-		}
-	}
-	catch(...)
-	{
-	}
-}
-
-
-
-void 
-TeRasterParams::readParametersFile()
-{
-	// read all keys in the metadata file (there is no order expected) 
-	string metFileName = TeGetName (fileName_.c_str())+".met";
-	map<string,string> metadata;
-	try {
-		TeAsciiFile metFile(metFileName,"r");
-		string key, value;
-		while (metFile.isNotAtEOF())
-		{
-			key = metFile.readString();
-			if (key[0] == '%')
-			{
-				metFile.findNewLine();
-				continue;
-			}
-			value = metFile.readString();
-			metadata.insert(make_pair(key,value));
-			metFile.findNewLine();
-		}
-	}
-	catch(...)
-	{
-	}
-	if (!metadata.empty())
-	{
-		double xll=0, yll=0;
-		map<string,string>::iterator it;
-		it = metadata.find("NROWS");
-		if (it != metadata.end())
-			nlines_ = atoi(it->second.c_str());
-		it = metadata.find("NCOLS");
-		if (it != metadata.end())
-			ncols_ = atoi(it->second.c_str());
-		it = metadata.find("NBANDS");
-		if (it != metadata.end())
-			this->nBands(atoi(it->second.c_str()));
-		else
-			this->nBands(1);
-		it = metadata.find("RESOLUTION_X");
-		if (it != metadata.end())
-			resx_ = atof(it->second.c_str());
-		it = metadata.find("RESOLUTION_Y");
-		if (it != metadata.end())
-			resy_ = atof(it->second.c_str());
-		it = metadata.find("LOWERLEFT_X");
-		if (it != metadata.end())
-		{
-			xll = atof(it->second.c_str());
-			it = metadata.find("LOWERLEFT_Y");
-			if (it != metadata.end())
-			{
-				yll = atof(it->second.c_str());
-				lowerLeftResolutionSize(xll,yll, resx_, resy_,ncols_, nlines_);
-			}
-		}
-		it = metadata.find("INTERLEAVING");
-		if (it != metadata.end())
-		{
-			if (it->second == "BIL")
-				interleaving_ = TeRasterParams::TePerLine;
-			else if (it->second == "BSQ")
-				interleaving_ = TeRasterParams::TePerBand;
-			else  interleaving_ = TeRasterParams::TePerPixel;
-		}
-
-		it = metadata.find("DATATYPE");
-		if (it != metadata.end())
-		{
-			if (it->second == "bit")
-				this->setDataType(TeBIT);
-			else if (it->second == "unsignedchar")
-				this->setDataType(TeUNSIGNEDCHAR);
-			else if (it->second == "char")
-				this->setDataType(TeCHAR);
-			else if (it->second == "unsignedshort")
-				this->setDataType(TeUNSIGNEDSHORT);
-			else if (it->second == "short")
-				this->setDataType(TeSHORT);
-			else if (it->second == "integer")
-				this->setDataType(TeINTEGER);
-			else if (it->second == "unsignedlong")
-				this->setDataType(TeUNSIGNEDLONG);
-			else if (it->second == "long")
-				this->setDataType(TeLONG);
-			else if (it->second == "float")
-				this->setDataType(TeFLOAT);
-			else if (it->second == "double")
-				this->setDataType(TeDOUBLE);
-		}
-		it = metadata.find("SWAPPED");
-		if (it != metadata.end() && it->second == "yes")
-			swap_ = true;
-
-		it = metadata.find("NO_DATA");
-		if (it != metadata.end())
-		{
-			useDummy_ = true;
-			this->setDummy(atof(it->second.c_str()));
-		}
-			
-		it = metadata.find("PROJECTION");
-		if (it != metadata.end())
-		{
-			string projdesc = it->second;
-			TeProjectionParams pars;
-			it = metadata.find("DATUM");
-			if (it != metadata.end())
-			{
-				TeDatum dat = TeDatumFactory::make(it->second);
-				pars.datum = dat;
-			}
-			if (decodifyDescription(projdesc,pars))
-			{
-				TeProjection* proj = TeProjectionFactory::make(pars);
-				this->projection(proj);
-			}
-		}
-	}
-}
-
-void 
-TeRasterParams::setNavigationParameters(const vector<double>& nwf)
-{
-	if (nwf.size() < 6)
-		return;
-
-	dxJ_ = nwf[0];
-	dxI_ = nwf[1];
-	dyJ_ = nwf[2];
-	dyI_ = nwf[3];
-	x0_ = nwf[4];
-	y0_ = nwf[5];
-	resx_ = dxJ_;
-	resy_ = ABS(dyI_);
-
-	if (nwf[1] == 0. && nwf[2] == 0)
-	{
-		this->topLeftResolutionSize(nwf[4],nwf[5],nwf[0],-1*nwf[3],ncols_,nlines_);
-		return;
-	}
-
-	// set the bounding box considering the navigation parameters 
-	// assumes that: x0 and y0 are relative to the center of the raster element
-
-	double xmin = min(x0_-0.5*dxJ_-0.5*dxI_,x0_-0.5*dxJ_+(nlines_-0.5)*dxI_);
-	double xmax = max(x0_+(ncols_-0.5)*dxJ_-0.5*dxI_,x0_+(ncols_-0.5)*dxJ_+(nlines_-0.5)*dxI_);
-	double ymin = min(y0_+(nlines_-0.5)*dyI_-0.5*dyJ_,y0_+(nlines_-0.5)*dyI_+(ncols_-0.5)*dyJ_);
-	double ymax = max(y0_-0.5*dyI_-0.5*dyJ_,y0_-0.5*dyI_+(ncols_-0.5)*dyJ_);
-
-	boundingBoxLinesColumns(xmin,ymin,xmax,ymax,nlines_,ncols_);
-}
-
-void 
-TeRasterParams::getNavigationParameters(vector<double>& nwf)
-{
-	nwf.clear();
-	if (dxI_ != 0. || dyJ_ != 0.)
-	{
-		nwf.push_back(dxJ_);
-		nwf.push_back(dxI_);
-		nwf.push_back(dyJ_);
-		nwf.push_back(dyI_);
-		nwf.push_back(x0_);
-		nwf.push_back(y0_);
-	}
-	else
-	{
-		nwf.push_back(resx_);
-		nwf.push_back(0.);
-		nwf.push_back(0.);
-		nwf.push_back(-1*resy_);
-		nwf.push_back(box_.x1_);
-		nwf.push_back(box_.y2_);
-	}
-}
-
-void 
-TeRasterParams::setNLinesNColumns(int nlines, int ncolumns)
-{
-	this->lowerLeftResolutionSize(0.5,0.5,1,1,ncolumns, nlines);
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32 
+#pragma warning ( disable: 4786 ) 
+#endif
+
+#include "TeRasterParams.h"
+#include "TeUtils.h"
+#include "TeAsciiFile.h"
+#include "TeAgnostic.h"
+
+#include <limits.h>
+
+#include <cstring>
+#include <cstdlib>
+
+// copy constructor
+TeRasterParams::TeRasterParams(const TeRasterParams& other)
+{
+	resolution_ = other.resolution_;
+	subBand_  = other.subBand_;
+	nlines_		= other.nlines_;
+	ncols_		= other.ncols_;
+	nbands_		= other.nbands_;
+	lutName_	= other.lutName_;
+	swap_		= other.swap_;
+	useDummy_	= other.useDummy_;
+
+	nbitsperPixel_.clear();
+	vmin_.clear();
+	vmax_.clear();
+	bands_.clear();
+	photometric_.clear();
+	dataType_.clear();
+	dummy_.clear();
+	compression_.clear();
+	bandName_.clear();
+
+	nbitsperPixel_= other.nbitsperPixel_;
+	vmin_= other.vmin_;
+	vmax_= other.vmax_;
+	bands_= other.bands_;
+	photometric_= other.photometric_;
+	dataType_= other.dataType_;
+	dummy_= other.dummy_;
+	compression_= other.compression_;
+	bandName_ = other.bandName_;
+
+	resx_ = other.resx_;
+	resy_ = other.resy_;
+	fileName_ = other.fileName_;
+	mode_ = other.mode_;
+	status_ = other.status_;
+	offset_ = other.offset_;
+	tiling_type_ = other.tiling_type_;
+	blockHeight_ = other.blockHeight_;
+	blockWidth_ = other.blockWidth_;
+	decoderIdentifier_ = other.decoderIdentifier_;
+	nTilesInMemory_ = other.nTilesInMemory_;
+	if (other.projection_)
+		projection_ = TeProjectionFactory::make(other.projection_->params());
+	else
+		projection_=0;
+	box_ = other.box_;
+	database_ = other.database_;
+	layerId_ = other.layerId_;
+	objectId_ = other.objectId_;
+
+	interleaving_ = other.interleaving_;
+
+	lutr_.clear();
+	lutg_.clear();
+	lutb_.clear();
+	lutr_ = other.lutr_;
+	lutg_ = other.lutg_;
+	lutb_ = other.lutb_;
+	lutClassName_ = other.lutClassName_;
+
+	dyJ_ = other.dyJ_;
+	dxI_ = other.dxI_;
+	dyI_ = other.dyI_;
+	dxJ_ = other.dxJ_;
+	x0_ = other.x0_;
+	y0_ = other.y0_;
+	errorMessage_ = other.errorMessage_;
+	hasSetDummy_ = other.hasSetDummy_;
+	date_ = other.date_;
+  decoderParams_ = other.decoderParams_;
+}
+
+// operator =
+TeRasterParams& 
+TeRasterParams::operator=(const TeRasterParams& rhs)
+{
+	if ( this != &rhs )
+	{
+		resolution_ = rhs.resolution_;
+		subBand_  = rhs.subBand_;
+		nlines_		= rhs.nlines_;
+		ncols_		= rhs.ncols_;
+		nbands_		= rhs.nbands_;
+		swap_		= rhs.swap_;
+		useDummy_	= rhs.useDummy_;
+		lutName_	= rhs.lutName_;
+
+		nbitsperPixel_.clear();
+		vmin_.clear();
+		vmax_.clear();
+		bands_.clear();
+		photometric_.clear();
+		dataType_.clear();
+		dummy_.clear();
+		compression_.clear();
+		bandName_.clear();
+
+		nbitsperPixel_= rhs.nbitsperPixel_;
+		vmin_= rhs.vmin_;
+		vmax_= rhs.vmax_;
+		bands_= rhs.bands_;
+		photometric_= rhs.photometric_;
+		dataType_= rhs.dataType_;
+		dummy_= rhs.dummy_;
+		compression_= rhs.compression_;
+		bandName_ = rhs.bandName_;
+
+		resx_ = rhs.resx_;
+		resy_ = rhs.resy_;
+		fileName_ = rhs.fileName_;
+		mode_ = rhs.mode_;
+		status_ = rhs.status_;
+		offset_ = rhs.offset_;
+		tiling_type_ = rhs.tiling_type_;
+		blockHeight_ = rhs.blockHeight_;
+		blockWidth_ = rhs.blockWidth_;
+		decoderIdentifier_ = rhs.decoderIdentifier_;
+		nTilesInMemory_ = rhs.nTilesInMemory_;
+		if (projection_)
+		{
+			delete projection_;
+			projection_ = 0;
+		}
+		if (rhs.projection_)
+			projection_ = TeProjectionFactory::make(rhs.projection_->params());
+		box_ = rhs.box_;
+		database_ = rhs.database_;			
+		layerId_ = rhs.layerId_;
+		objectId_ = rhs.objectId_;
+		interleaving_ = rhs.interleaving_;
+
+		lutr_.clear();
+		lutg_.clear();
+		lutb_.clear();
+		lutClassName_.clear();
+		lutr_ = rhs.lutr_;
+		lutg_ = rhs.lutg_;
+		lutb_ = rhs.lutb_;
+		lutClassName_ = rhs.lutClassName_;
+
+		dyJ_ = rhs.dyJ_;
+		dxI_ = rhs.dxI_;
+		x0_ = rhs.x0_;
+		y0_ = rhs.y0_;
+		dyI_ =  rhs.dyI_;
+		dxJ_ =  rhs.dxJ_;
+		errorMessage_ = rhs.errorMessage_;
+		hasSetDummy_ = rhs.hasSetDummy_;
+		date_ = rhs.date_;
+    decoderParams_ = rhs.decoderParams_;
+	}
+	return *this;
+}
+
+void
+TeRasterParams::resizeToTiling(TeBox& bb, int bWidth, int bHeight)
+{
+	blockHeight_ = bHeight;
+	blockWidth_ = bWidth;
+
+	double bXSize = bWidth*resx_;
+	double bYSize = bHeight*resy_;
+	
+	TeBox baux = adjustToCut(bb, bXSize, bYSize);
+	this->boundingBoxResolution(baux.x1_,baux.y1_,baux.x2_,baux.y2_,resx_,resy_);
+}
+
+//! Calculates the *bounding box* when box coordinates are relative to the center of the pixel
+TeBox	
+TeRasterParams::boundingBox () const
+{ return TeBox (box_.x1()-resx_/2.,
+				box_.y1()-resy_/2.,
+				box_.x2()+resx_/2.,
+				box_.y2()+resy_/2.);
+}
+
+void	
+TeRasterParams::boundingBoxResolution (double x1, double y1, double x2, double y2, 
+									   double resx, double resy, TeBox::TeBoxCorner lock)
+{
+	resx_ = resx;
+	resy_ = resy;
+	ncols_  = (int)((x2-x1)/resx_+0.5);
+	nlines_ = (int)((y2-y1)/resy_+0.5);
+	
+	if (lock == TeBox::TeUPPERLEFT)
+		box_ = TeBox(x1+0.5*resx_, y2-nlines_*resy_+0.5*resy_,
+		             x1+ncols_*resx_-0.5*resx_, y2-0.5*resy_);
+
+	else if (lock == TeBox::TeLOWERLEFT)
+		box_ = TeBox(x1+0.5*resx_, y1+0.5*resy_,
+		             x1+ncols_*resx_-0.5*resx_, y1+nlines_*resy_-0.5*resy_);
+
+	else if (lock == TeBox::TeUPPERRIGHT)
+		box_ = TeBox(x2-ncols_*resx_+0.5*resx_, y2-nlines_*resy_+0.5*resy_,
+			         x2-0.5*resx_,y2-0.5*resy_);
+
+	else		// TeLOWERRIGHT
+		box_ = TeBox(x2-ncols_*resx_+0.5*resx_,y1+0.5*resy_,
+		             x2-0.5*resx_,y1+nlines_*resy_-0.5*resy_);
+}
+
+void	
+TeRasterParams::boundingBoxLinesColumns (double x1, double y1, double x2, double y2, 
+										 int nlines, int ncols, TeBox::TeBoxCorner lock)
+{
+	nlines_ = nlines;
+	ncols_ = ncols;
+	
+	resx_ = (x2-x1)/ncols_;
+	resy_ = (y2-y1)/nlines_;
+
+	if (lock == TeBox::TeUPPERLEFT)
+		box_ = TeBox(x1+0.5*resx_, y2-nlines_*resy_+0.5*resy_,
+		             x1+ncols_*resx_-0.5*resx_, y2-0.5*resy_);
+
+	else if (lock == TeBox::TeLOWERLEFT)
+		box_ = TeBox(x1+0.5*resx_, y1+0.5*resy_,
+		             x1+ncols_*resx_-0.5*resx_, y1+nlines_*resy_-0.5*resy_);
+
+	else if (lock == TeBox::TeUPPERRIGHT)
+		box_ = TeBox(x2-ncols_*resx_+0.5*resx_, y2-nlines_*resy_+0.5*resy_,
+			         x2-0.5*resx_,y2-0.5*resy_);
+
+	else		// TeLOWERRIGHT
+		box_ = TeBox(x2-ncols_*resx_+0.5*resx_,y1+0.5*resy_,
+		             x2-0.5*resx_,y1+nlines_*resy_-0.5*resy_);
+}
+
+void	
+TeRasterParams::boxResolution (double x1, double y1, double x2, double y2, 
+							   double resx, double resy, TeBox::TeBoxCorner lock)
+{
+	resx_ = resx;
+	resy_ = resy;
+
+	ncols_  = (int)((x2-x1)/resx_+0.45)+1;
+	nlines_ = (int)((y2-y1)/resy_+0.45)+1;
+
+	if (lock == TeBox::TeUPPERLEFT)
+		box_ = TeBox(x1, y2-(nlines_-1)*resy_,x1+(ncols_-1)*resx_,y2);
+
+	else if (lock == TeBox::TeLOWERLEFT)
+		box_ = TeBox(x1, y1,x1+(ncols_-1)*resx_,y1+(nlines_-1)*resy_);
+
+	else if (lock == TeBox::TeUPPERRIGHT)
+		box_ = TeBox(x2-(ncols_-1)*resx_, y2-(nlines_-1)*resy_,x2,y2);
+
+	else		// TeLOWERRIGHT
+		box_ = TeBox(x2-(ncols_-1)*resx_,y1,x2,y1+(nlines_-1)*resy_);
+}
+
+void	
+TeRasterParams::boxLinesColumns (double x1, double y1, double x2, double y2, 
+								 int nlines, int ncols, TeBox::TeBoxCorner lock)
+{
+	nlines_ = nlines;
+	ncols_ = ncols;
+
+	resx_ = (x2-x1)/(ncols_-1);
+	resy_ = (y2-y1)/(nlines_-1);
+
+	if (lock == TeBox::TeUPPERLEFT)
+		box_ = TeBox(x1, y2-(nlines_-1)*resy_,x1+(ncols_-1)*resx_,y2);
+
+	else if (lock == TeBox::TeLOWERLEFT)
+		box_ = TeBox(x1, y1,x1+(ncols_-1)*resx_,y1+(nlines_-1)*resy_);
+
+	else if (lock == TeBox::TeUPPERRIGHT)
+		box_ = TeBox(x2-(ncols_-1)*resx_, y2-(nlines_-1)*resy_,x2,y2);
+
+	else		// TeLOWERRIGHT
+		box_ = TeBox(x2-(ncols_-1)*resx_,y1,x2,y1+(nlines_-1)*resy_);
+}
+
+void	
+TeRasterParams::topLeftResolutionSize (double left, double top, 
+									   double resx, double resy, 
+									   int ncol, int nlin, 
+									   bool coordIsCentrePixel)
+{
+	resx_ = resx;
+	resy_ = resy;
+	ncols_  = ncol;
+	nlines_ = nlin;
+	
+	if (coordIsCentrePixel)
+		box_ = TeBox(left,top-(nlin-1)*resy_,left+(ncol-1)*resx_,top);
+	else
+	{
+		TeBox bb(left,top-nlines_*resy_,left+ncols_*resx_,top);
+		box_ = TeBox(bb.x1()+resx_/2.,
+					 bb.y1()+resy_/2.,
+					 bb.x2()-resx_/2.,
+					 bb.y2()-resy_/2.);
+	}
+}
+
+void	
+TeRasterParams::lowerLeftResolutionSize (double left, double lower, 
+										 double resx, double resy, 
+										 int ncol, int nlin, 
+										 bool coordIsCentrePixel)
+{
+	resx_ = resx;
+	resy_ = resy;
+	ncols_  = ncol;
+	nlines_ = nlin;
+	
+	if (coordIsCentrePixel)
+		box_ = TeBox(left,lower,left+(ncol-1)*resx_,lower+(nlin-1)*resy_);
+	else
+	{
+		TeBox bb(left,lower,left+ncols_*resx_,lower+nlines_*resy_);
+		box_ = TeBox(bb.x1()+resx_/2.,
+					 bb.y1()+resy_/2.,
+					 bb.x2()-resx_/2.,
+					 bb.y2()-resy_/2.);
+	}
+}
+
+void 
+TeRasterParams::nBands(int n)
+{
+  TEAGN_TRUE_OR_THROW( ( n > 0 ), "Invalid number of bands" )
+  
+	if (nbands_ != n)
+	{
+		if ( nbands_ == 0 ) 
+    {
+		  nbitsperPixel_.clear();
+		  vmin_.clear();
+		  vmax_.clear();
+		  bands_.clear();
+		  photometric_.clear();
+		  dataType_.clear();
+		  dummy_.clear();
+		  compression_.clear();
+		  bandName_.clear();
+
+		  for (int i = 0; i<n; i++)
+		  {
+				nbitsperPixel_.push_back( 8 );
+				vmin_.push_back( TeMAXFLOAT );
+				vmax_.push_back( -TeMAXFLOAT );
+				bands_.push_back( i );
+				photometric_.push_back( TeRasterParams::TeUnknown );
+				dataType_.push_back( TeUNSIGNEDCHAR );
+				dummy_.push_back( 0 );
+				compression_.push_back( TeNoCompression );
+				bandName_.push_back(Te2String(i));
+		  }
+		} 
+    else if ( nbands_ > n ) 
+    {
+		  for( unsigned int count = ( nbands_ - n ) ; count > 0 ; --count ) {
+		    nbitsperPixel_.pop_back();
+		    vmin_.pop_back();
+		    vmax_.pop_back();
+		    bands_.pop_back();
+		    photometric_.pop_back();
+		    dataType_.pop_back();
+		    dummy_.pop_back();
+		    compression_.pop_back();	
+			bandName_.pop_back();
+		  }
+		} 
+    else /* nbands_ < n */
+    {
+		  for( unsigned int count = ( n - nbands_ ) ; count > 0 ; --count ) {
+		    nbitsperPixel_.push_back( nbitsperPixel_[ nbands_ - 1 ] );
+		    vmin_.push_back( vmin_[ nbands_ - 1 ] );
+		    vmax_.push_back( vmax_[ nbands_ - 1 ] );
+		    bands_.push_back( bands_[ nbands_ - 1 ] );
+		    photometric_.push_back( photometric_[ nbands_ - 1 ] );
+		    dataType_.push_back( dataType_[ nbands_ - 1 ] );
+		    dummy_.push_back( dummy_[ nbands_ - 1 ] );
+		    compression_.push_back( compression_[ nbands_ - 1 ] );
+			bandName_.push_back( bandName_[ nbands_ -1 ] );
+		  }		
+		}
+		
+		nbands_ = n;
+	}
+}
+
+void 
+TeRasterParams::projection(TeProjection* proj)
+{
+	if (projection_)
+	{
+		delete projection_;
+		projection_ = 0;
+	}
+	if (proj)
+		projection_ = TeProjectionFactory::make(proj->params());
+}
+
+void 
+TeRasterParams::setDataType(TeDataType type, int band)
+{
+	int nb = 8;
+	double defValue = 0.0;
+	switch (type) 
+  {
+    case TeBIT:
+      nb = 1;
+      defValue = 1;
+      break;  
+    case TeUNSIGNEDCHAR:
+      nb = sizeof(unsigned char)*8;
+      defValue = 255;
+      break;
+    case TeCHAR :
+      defValue = 255;
+      nb = sizeof(char)*8;
+      break;
+    case TeUNSIGNEDSHORT:
+      nb = sizeof(unsigned short)*8;
+      defValue = pow(2.,nb)-1;
+      break;
+    case (TeSHORT):
+      nb = sizeof(short)*8;
+      defValue = pow(2.,nb)-1;
+      break;
+    case (TeINTEGER):
+      nb = sizeof(int)*8;
+      defValue = INT_MAX;
+      break;    
+    case (TeUNSIGNEDLONG):
+      nb = sizeof(unsigned long)*8;
+      defValue = pow(2.,nb)-1;
+      break;
+    case (TeLONG):
+      nb = sizeof(long)*8;
+      break;
+    case (TeFLOAT):
+      nb = sizeof(float)*8;
+      defValue = pow(2.,nb)-1;
+      break;
+    case (TeDOUBLE):
+      nb = sizeof(double)*8;
+      defValue = TeMAXFLOAT;
+      break;
+    default:
+    {
+      throw( TeException( UNKNOWN_ERROR_TYPE, "Invalid data type" ) );
+      break;
+    }
+	}
+	if (band<0 || band>= (int)dataType_.size())
+		for (unsigned int i=0; i<dataType_.size();++i)
+		{
+			dataType_[i]=type;
+			nbitsperPixel_[i]=nb;
+			if (!hasSetDummy_)
+				dummy_[i]=defValue;
+		}
+	else
+	{
+		dataType_[band]=type;
+		nbitsperPixel_[band]=nb;
+		dummy_[band]=defValue;
+	}
+}
+
+int TeRasterParams::elementSize(int band)
+{
+	switch (dataType_[band]) 
+  {
+    case TeBIT:
+      return sizeof(unsigned char);  
+    case TeUNSIGNEDCHAR:
+      return sizeof(unsigned char);
+    case TeCHAR :
+      return sizeof(char);
+    case TeUNSIGNEDSHORT:
+      return sizeof(unsigned short);
+    case (TeSHORT):
+      return sizeof(short);
+    case TeINTEGER:
+      return sizeof(int);
+    case (TeUNSIGNEDLONG):
+      return (sizeof(unsigned long));
+    case (TeLONG):
+      return (sizeof(long));
+    case (TeFLOAT):
+      return (sizeof(float));
+    case (TeDOUBLE):
+      return (sizeof(double));      
+    default:
+    { 
+      throw( TeException( UNKNOWN_ERROR_TYPE, "Invalid data type" ) ); 
+    }
+	}
+  
+  return 0;
+}
+
+
+void 
+TeRasterParams::setPhotometric(TeRasterParams::TeRasterPhotometricInterpretation photom, int band)
+{
+	if (band<0 || band>= (int)photometric_.size())
+		for (unsigned int i=0; i<photometric_.size(); photometric_[i]=photom,i++);
+	else
+		photometric_[band]=photom;
+}
+
+void 
+TeRasterParams::setCompressionMode(TeRasterParams::TeRasterCompressionMode cmode, int band)
+{
+	if (band<0 || band>= (int)compression_.size())
+		for (unsigned int i=0; i<compression_.size(); compression_[i]=cmode,i++);
+	else
+		compression_[band] = cmode;
+}
+
+void 
+TeRasterParams::setDummy(double dummy, int band)
+{
+	if (band<0 || band>= (int)dummy_.size())
+		for (unsigned int i=0; i<dummy_.size(); dummy_[i]=dummy,i++);
+	else
+		dummy_[band] = dummy;
+	this->useDummy_ = true;
+	hasSetDummy_ = true;
+}
+
+void
+TeRasterParams::setBandName(string name, int band)
+{
+	if(band >=0 && band < (int)bandName_.size())
+		bandName_[band] = name;
+}
+
+TeCoord2D 
+TeRasterParams::coord2Index (const TeCoord2D& pt) const
+{
+	double i, j;
+	if (dxI_ != 0 || dyJ_ != 0)
+	{
+		double x = pt.x();
+		double y = pt.y();
+		
+		i = (dyJ_*(x-x0_)-dxJ_*(y-y0_))/(dxI_*dyJ_-dxJ_*dyI_);
+		j = (x-x0_-i*dxI_)/dxJ_;
+		return TeCoord2D (j,i);
+	}
+	else
+	{
+		i = (pt.x() - box_.x1()) / resx_;
+		j = (box_.y2() - pt.y()) / resy_;
+		return TeCoord2D (i,j);
+	}
+}
+
+TeCoord2D 
+TeRasterParams::index2Coord (const TeCoord2D& pt) const
+{
+	double x,y;
+	double i = pt.y();
+	double j = pt.x();
+		
+	if (dxI_ != 0 || dyJ_ != 0)
+	{
+		x = x0_ + i*dxI_ + j*dxJ_;
+		y = y0_ + i*dyI_ + j*dyJ_;
+	}
+	else
+	{
+		x = box_.x1() + pt.x() * resx_;
+		y = box_.y2() - pt.y() * resy_;
+	}
+	return TeCoord2D (x,y);
+}
+
+void
+TeRasterParams::writeParametersFile()
+{
+	string metFileName = TeGetName (fileName_.c_str())+".met";
+	try {
+		TeAsciiFile metFile(metFileName,"w");
+		string line = "%Raw raster file metadata\n";
+		metFile.writeString(line);
+		line = "NROWS " + Te2String(nlines_);
+		metFile.writeString(line);
+		metFile.writeNewLine();
+		line = "NCOLS " + Te2String(ncols_);
+		metFile.writeString(line);
+		metFile.writeNewLine();
+		line = "NBANDS " + Te2String(this->nBands());
+		metFile.writeString(line);
+		metFile.writeNewLine();
+
+		if (this->nBands() > 1)
+		{
+			line = "INTERLEAVING ";
+			if (interleaving_ == TeRasterParams::TePerPixel)
+				line += "BIP";
+			else if (interleaving_ == TeRasterParams::TePerLine)
+				line += "BIL";
+			else
+				line += "BSQ";
+			metFile.writeString(line);
+			metFile.writeNewLine();
+		}
+
+		int ndecimals = 0;
+		line = "DATATYPE ";
+		if (dataType_[0] == TeBIT)
+			line += "bit";
+		else if (dataType_[0] == TeUNSIGNEDCHAR)
+			line += "unsignedchar";
+		else if (dataType_[0] == TeCHAR)
+			line += "char";
+		else if (dataType_[0] == TeUNSIGNEDSHORT)
+			line += "unsignedshort";
+		else if (dataType_[0] == TeSHORT)
+			line += "short";
+		else if (dataType_[0] == TeINTEGER)
+			line += "integer";
+		else if (dataType_[0] == TeUNSIGNEDLONG)
+			line += "unsignedlong";
+		else if (dataType_[0] == TeLONG)
+			line += "long";
+		else if (dataType_[0] == TeFLOAT)
+		{
+			line += "float";
+			ndecimals = 6;
+		}
+		else if (dataType_[0] == TeDOUBLE)
+		{
+			line += "double";	
+			ndecimals = 10;
+		}
+		metFile.writeString(line);
+		metFile.writeNewLine();
+		
+		if (swap_)
+		{
+			line = "SWAPPED yes";
+			metFile.writeString(line);
+			metFile.writeNewLine();
+		}
+		else
+			line.clear();
+		if (useDummy_)
+		{
+			line += "NO_DATA " + Te2String(dummy_[0], ndecimals);
+			metFile.writeString(line);
+			metFile.writeNewLine();
+		}
+    
+    if( projection_ ) {
+      if (projection_->name() == "NoProjection" ||
+        projection_->name() == "LatLong") {
+        
+        ndecimals = 8;
+      } else {
+        ndecimals = 3;
+      }
+    } else {
+      ndecimals = 8;
+    }
+
+		line = "RESOLUTION_X " + Te2String(resx_,ndecimals);
+		metFile.writeString(line);
+		metFile.writeNewLine();
+		line = "RESOLUTION_Y " + Te2String(resy_,ndecimals);
+		metFile.writeString(line);
+		metFile.writeNewLine();
+		line = "LOWERLEFT_X " + Te2String(this->box().x1_,ndecimals);
+		metFile.writeString(line);
+		metFile.writeNewLine();
+		line = "LOWERLEFT_Y " + Te2String(this->box().y1_,ndecimals);
+		metFile.writeString(line);
+		metFile.writeNewLine();
+		if (this->projection())
+		{
+			line = "PROJECTION ";
+			line += this->projection()->describe();
+			metFile.writeString(line);
+			metFile.writeNewLine();
+			line = "DATUM " +  this->projection()->datum().name();
+			metFile.writeString(line);
+		}
+	}
+	catch(...)
+	{
+	}
+}
+
+
+
+void 
+TeRasterParams::readParametersFile()
+{
+	// read all keys in the metadata file (there is no order expected) 
+	string metFileName = TeGetName (fileName_.c_str())+".met";
+	map<string,string> metadata;
+	try {
+		TeAsciiFile metFile(metFileName,"r");
+		string key, value;
+		while (metFile.isNotAtEOF())
+		{
+			key = metFile.readString();
+			if (key[0] == '%')
+			{
+				metFile.findNewLine();
+				continue;
+			}
+			value = metFile.readString();
+			metadata.insert(make_pair(key,value));
+			metFile.findNewLine();
+		}
+	}
+	catch(...)
+	{
+	}
+	if (!metadata.empty())
+	{
+		double xll=0, yll=0;
+		map<string,string>::iterator it;
+		it = metadata.find("NROWS");
+		if (it != metadata.end())
+			nlines_ = atoi(it->second.c_str());
+		it = metadata.find("NCOLS");
+		if (it != metadata.end())
+			ncols_ = atoi(it->second.c_str());
+		it = metadata.find("NBANDS");
+		if (it != metadata.end())
+			this->nBands(atoi(it->second.c_str()));
+		else
+			this->nBands(1);
+		it = metadata.find("RESOLUTION_X");
+		if (it != metadata.end())
+			resx_ = atof(it->second.c_str());
+		it = metadata.find("RESOLUTION_Y");
+		if (it != metadata.end())
+			resy_ = atof(it->second.c_str());
+		it = metadata.find("LOWERLEFT_X");
+		if (it != metadata.end())
+		{
+			xll = atof(it->second.c_str());
+			it = metadata.find("LOWERLEFT_Y");
+			if (it != metadata.end())
+			{
+				yll = atof(it->second.c_str());
+				lowerLeftResolutionSize(xll,yll, resx_, resy_,ncols_, nlines_);
+			}
+		}
+		it = metadata.find("INTERLEAVING");
+		if (it != metadata.end())
+		{
+			if (it->second == "BIL")
+				interleaving_ = TeRasterParams::TePerLine;
+			else if (it->second == "BSQ")
+				interleaving_ = TeRasterParams::TePerBand;
+			else  interleaving_ = TeRasterParams::TePerPixel;
+		}
+
+		it = metadata.find("DATATYPE");
+		if (it != metadata.end())
+		{
+			if (it->second == "bit")
+				this->setDataType(TeBIT);
+			else if (it->second == "unsignedchar")
+				this->setDataType(TeUNSIGNEDCHAR);
+			else if (it->second == "char")
+				this->setDataType(TeCHAR);
+			else if (it->second == "unsignedshort")
+				this->setDataType(TeUNSIGNEDSHORT);
+			else if (it->second == "short")
+				this->setDataType(TeSHORT);
+			else if (it->second == "integer")
+				this->setDataType(TeINTEGER);
+			else if (it->second == "unsignedlong")
+				this->setDataType(TeUNSIGNEDLONG);
+			else if (it->second == "long")
+				this->setDataType(TeLONG);
+			else if (it->second == "float")
+				this->setDataType(TeFLOAT);
+			else if (it->second == "double")
+				this->setDataType(TeDOUBLE);
+		}
+		it = metadata.find("SWAPPED");
+		if (it != metadata.end() && it->second == "yes")
+			swap_ = true;
+
+		it = metadata.find("NO_DATA");
+		if (it != metadata.end())
+		{
+			useDummy_ = true;
+			this->setDummy(atof(it->second.c_str()));
+		}
+			
+		it = metadata.find("PROJECTION");
+		if (it != metadata.end())
+		{
+			string projdesc = it->second;
+			TeProjectionParams pars;
+			it = metadata.find("DATUM");
+			if (it != metadata.end())
+			{
+				TeDatum dat = TeDatumFactory::make(it->second);
+				pars.datum = dat;
+			}
+			if (decodifyDescription(projdesc,pars))
+			{
+				TeProjection* proj = TeProjectionFactory::make(pars);
+				this->projection(proj);
+			}
+		}
+	}
+}
+
+void 
+TeRasterParams::setNavigationParameters(const vector<double>& nwf)
+{
+	if (nwf.size() < 6)
+		return;
+
+	dxJ_ = nwf[0];
+	dxI_ = nwf[1];
+	dyJ_ = nwf[2];
+	dyI_ = nwf[3];
+	x0_ = nwf[4];
+	y0_ = nwf[5];
+	resx_ = dxJ_;
+	resy_ = ABS(dyI_);
+
+	if (nwf[1] == 0. && nwf[2] == 0)
+	{
+		this->topLeftResolutionSize(nwf[4],nwf[5],nwf[0],-1*nwf[3],ncols_,nlines_);
+		return;
+	}
+
+	// set the bounding box considering the navigation parameters 
+	// assumes that: x0 and y0 are relative to the center of the raster element
+
+	double xmin = min(x0_-0.5*dxJ_-0.5*dxI_,x0_-0.5*dxJ_+(nlines_-0.5)*dxI_);
+	double xmax = max(x0_+(ncols_-0.5)*dxJ_-0.5*dxI_,x0_+(ncols_-0.5)*dxJ_+(nlines_-0.5)*dxI_);
+	double ymin = min(y0_+(nlines_-0.5)*dyI_-0.5*dyJ_,y0_+(nlines_-0.5)*dyI_+(ncols_-0.5)*dyJ_);
+	double ymax = max(y0_-0.5*dyI_-0.5*dyJ_,y0_-0.5*dyI_+(ncols_-0.5)*dyJ_);
+
+	boundingBoxLinesColumns(xmin,ymin,xmax,ymax,nlines_,ncols_);
+}
+
+void 
+TeRasterParams::getNavigationParameters(vector<double>& nwf)
+{
+	nwf.clear();
+	if (dxI_ != 0. || dyJ_ != 0.)
+	{
+		nwf.push_back(dxJ_);
+		nwf.push_back(dxI_);
+		nwf.push_back(dyJ_);
+		nwf.push_back(dyI_);
+		nwf.push_back(x0_);
+		nwf.push_back(y0_);
+	}
+	else
+	{
+		nwf.push_back(resx_);
+		nwf.push_back(0.);
+		nwf.push_back(0.);
+		nwf.push_back(-1*resy_);
+		nwf.push_back(box_.x1_);
+		nwf.push_back(box_.y2_);
+	}
+}
+
+void 
+TeRasterParams::setNLinesNColumns(int nlines, int ncolumns)
+{
+	this->lowerLeftResolutionSize(0.5,0.5,1,1,ncolumns, nlines);
+}
+
diff --git a/src/terralib/kernel/TeRasterParams.h b/src/terralib/kernel/TeRasterParams.h
old mode 100755
new mode 100644
index 6a77582..63a0bc6
--- a/src/terralib/kernel/TeRasterParams.h
+++ b/src/terralib/kernel/TeRasterParams.h
@@ -1,499 +1,517 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeRasterParams.h
-    \brief This file contains definitions about parameters of a raster structure
-*/
-#ifndef  __TERRALIB_INTERNAL_RASTERPARAMS_H
-#define  __TERRALIB_INTERNAL_RASTERPARAMS_H
-
-#include "TeProjection.h"
-#include "TeBox.h"
-#include "TeDataTypes.h"
-#include "TeTime.h"
-
-#include <string>
-#include <list>
-#include <vector>
-
-using namespace std;
-
-class TeDatabase;
-
-//!  A class to handle the parameters set associated with a raster data
-/*! 
-This class is a data structure to store and manipulate a set of parameters and definitions that characterizes 
-a raster data. It contains parameters relative to storaging, geographical or interpretation aspects.
-Not all parameters are valid, or make sense, for all raster data.
-Most parameters are public and can be accessed directly. The private ones should be acessed
-through the methods provided.
-\sa TeRaster
-*/
-class TL_DLL TeRasterParams
-{
-public:
-
-	//! Pixels interleaving mode: used by rasters in memory and files in raw formats
-	enum TeRasterInterLeavingMode
-	{	
-		TePerPixel, // BIP - Band Interleaved by Pixel
-		TePerLine,	// BIL - Band Interleaved by Line
-		TePerBand	// BSQ - Band Sequential
-	};
-	
-	//! Photometric interpretation of a raster data
-	enum TeRasterPhotometricInterpretation
-	{ TeUnknown, TePallete, TeMultiBand, TeRGB };
-	
-	//! Status of a raster data, in terms of reading and writting possibilities
-	enum TeRasterStatus
-	{ TeNotReady, TeReadyToRead, TeReadyToWrite };
-
-	//! Compression modes of a raster data 
-	enum TeRasterCompressionMode
-	{ TeNoCompression, TeZLib, TeJpeg, TeTiffCompression };
-	
-	//! Tiling type modes to store raster data in a TerraLib database 
-	enum TeRasterTilingType
-	{  TeExpansible=1, TeNoExpansible=2 };
-	
-
-	//! Default contructor
-	TeRasterParams () :
-		nlines_(0),
-		ncols_(0),
-		resx_(1),
-		resy_(1),
-		swap_(false),
-		useDummy_(false),
-		mode_('r'),
-		status_(TeRasterParams::TeNotReady),
-		resolution_(1),
-		subBand_(0),
-		offset_(0),
-		tiling_type_(TeRasterParams::TeExpansible),
-		blockHeight_(0),
-		blockWidth_(0),
-		nTilesInMemory_(0),
-		blockId_(""),	
-		decoderIdentifier_(""),	
-		database_ (0),
-		layerId_(-1),
-		objectId_(""),
-		interleaving_(TeRasterParams::TePerPixel),
-		lutName_(""),
-		dxJ_(0.0),
-		dxI_(0.0),
-		dyJ_(0.0),
-		dyI_(0.0),
-		x0_(0.0),
-		y0_(0.0),
-		box_(TeBox()),
-		projection_(0)
-	{
-		nbands_= 1;
-		nbitsperPixel_.resize(nbands_);
-		vmin_.resize(nbands_);
-		vmax_.resize(nbands_);
-		bands_.resize(nbands_);
-		photometric_.resize(nbands_);
-		dataType_.resize(nbands_);
-		dummy_.resize(nbands_);
-		compression_.resize(nbands_);
-		for (int i=0; i<nbands_; i++)
-		{
-			bands_[i] = i;
-			vmin_[i] = TeMAXFLOAT;
-			vmax_[i] = -TeMAXFLOAT;
-			dataType_[i] = TeUNSIGNEDCHAR;
-			photometric_[i] = TeRasterParams::TeMultiBand;
-			dummy_[i] = 255;
-		}
-		hasSetDummy_ = false;
-	}
-
-	//! Copy constructor
-	TeRasterParams(const TeRasterParams& other);
-
-	//! Operator=
-	TeRasterParams& operator=(const TeRasterParams& rhs);
-
-	//! Destructor
-	virtual ~TeRasterParams()
-	{
-		bands_.clear();
-		vmin_.clear();
-		vmax_.clear();
-		if (!lutr_.empty())
-		{
-			lutr_.clear();
-			lutg_.clear();
-			lutb_.clear();
-		}
-		photometric_.clear();
-		dataType_.clear();
-		dummy_.clear();
-		compression_.clear();
-		if (projection_)
-			delete projection_;
-		hasSetDummy_ = false;
-	}
-	
-	/** @name Extension
-	*  Methods to deal with the spatial extensions of a raster data
-	*/
-	//@{	
-	//! Returns the box based on the coordinates of center of the corner elements
-	const TeBox& box() const
-	{ return box_; }
-
-	//! Returns the outline box 
-	TeBox boundingBox() const;
-
-	//! Sets extension parameters
-	/*
-		This methods recalculates the number of lines and columns and box accordingly to 
-		an input bounding box and X and Y resolutions
-		\param x1 bounding box lower left point X coordinate 
-		\param y1 bounding box lower left point Y coordinate 
-		\param x2 bounding box upper right point X coordinate
-		\param y2 bounding box upper right point Y coordinate
-		\param resx X resolution
-		\param resy Y resolution
-		\param lock corner of the bounding box that should be preserved
-	*/
-	void boundingBoxResolution (double x1, double y1, double x2, double y2, 
-				double resx, double resy, TeBox::TeBoxCorner lock = TeBox::TeUPPERLEFT);
-
-	//! Sets extension parameters
-	/*
-		This methods recalculates the resolutions and box accordingly to 
-		a given bounding box and number of lines and columns
-		\param x1 bounding box lower left point X coordinate 
-		\param y1 bounding box lower left point Y coordinate 
-		\param x2 bounding box upper right point X coordinate
-		\param y2 bounding box upper right point Y coordinate
-		\param nlines  number of lines
-		\param ncols number of columns
-		\param lock corner of the bounding box that should be preserved
-	*/
-	void boundingBoxLinesColumns (double x1, double y1, double x2, double y2, 
-		                          int nlines, int ncols, TeBox::TeBoxCorner lock = TeBox::TeUPPERLEFT);
-
-	//! Sets extension parameters
-	/*
-		This methods recalculates the number of lines and columns and box accordingly to 
-		a given box and X and Y resolutions
-		\param x1 box lower left point X coordinate 
-		\param y1 box lower left point Y coordinate 
-		\param x2 box upper right point X coordinate
-		\param y2 box upper right point Y coordinate
-		\param resx X resolution
-		\param resy Y resolution
-		\param lock corner of the bounding box that should be preserved
-	*/
-	void boxResolution (double x1, double y1, double x2, double y2, 
-		                double resx, double resy, TeBox::TeBoxCorner lock = TeBox::TeUPPERLEFT);
-
-	//! Sets extension parameters
-	/*
-		This methods recalculates the resolutions and box accordingly to 
-		a given box and number of lines and columns
-		\param x1 box lower left point X coordinate 
-		\param y1 box lower left point Y coordinate 
-		\param x2 box upper right point X coordinate
-		\param y2 box upper right point Y coordinate
-		\param nlines  number of lines
-		\param ncols number of columns
-		\par Calculates X resolution and Y resolution 
-		\param lock corner of the bounding box that should be preserved
-	*/
-	void boxLinesColumns (double x1, double y1, double x2, double y2, 
-		                  int nlines, int ncols, TeBox::TeBoxCorner lock = TeBox::TeUPPERLEFT);
-
-	//! Sets extension parameters
-	/*
-		\param left lower left point X coordinate 
-		\param top  upper right point Y coordinate
-		\param resx X resolution
-		\param resy Y resolution
-		\param nlines  number of lines
-		\param ncols number of columns
-		\param coordIsCentrePixel flag to indicate that top left coordinate is centre of pixel
-	*/
-	void topLeftResolutionSize (double left, double top, double resx, double resy, int ncol, int nlin, bool coordIsCentrePixel=true);
-		
-	//! Sets extension parameters
-	/*
-		\param left lower left point X coordinate 
-		\param lower lower left point Y coordinate
-		\param resx X resolution
-		\param resy Y resolution
-		\param nlines  number of lines
-		\param ncols number of columns
-		\param coordIsCentrePixel flag to indicate that top left coordinate is centre of pixel
-	*/
-	void lowerLeftResolutionSize (double left, double lower, double resx, double resy, int ncol, int nlin, bool coordIsCentrePixel=true);
-
-	//! Sets default extension parameters
-	/* 
-		Sets a valid bouding box, considering a resolution of 1x1 and
-		that the coordinate of the center of lower-left element is (0.5,0.5)
-		\param nlines  number of lines
-		\param ncols number of columns
-	*/
-	void setNLinesNColumns(int nlines, int ncolumns);
-
-	//! Resizes the raster bounding box to cut it exactly in tiles of a give size
-	/*! 
-		\param bb an initial bounding box
-		\param bWidth block width (in number of elements/pixels)
-		\param bHeight block height (in number of elements/pixels)
-		\note keeps the defined X an Y resolutions
-	*/ 
-	void resizeToTiling(TeBox& bb, int bWidth, int bHeight);
-	//@}
-
-	//! Sets the number of bands, or dimentions in a raster data
-	/*
-		\param n number of bands
-		\note If the required number of bands is greater than the 
-		current number of bands, the last band characteristics 
-		will be copied to the new defined bands.
-	*/
-	void nBands(int n);
-
-	//! Sets the projection
-	/*
-		\param proj a pointer to a terralib projection instance
-		A new instance of projection is created according to the parameters described by proj.
-	*/
-	void projection(TeProjection* proj);
-
-	//! Returns the projection
-	TeProjection* projection()
-	{	return projection_; }
-	
-
-	//! Transform a coordinate from world domain to line/column domain
-	TeCoord2D coord2Index (const TeCoord2D& pt) const;
-
-	//! Transform a coordinate from line/column domain to world domain
-	TeCoord2D index2Coord (const TeCoord2D& pt) const;
-
-
-	int nlines_;			//!< number of lines
-	int ncols_;			//!< number of columns
-
-	double	resx_,			//!< horizontal resolution
-		resy_;			//!< vertical resolution	
-
-	bool swap_;			//!< a flag to indicate that the values of the elements of the raster are swapped
-	bool useDummy_;			//!< a flag to indicate that raster has dummy values
-	char	mode_;			//!< a character indicating the access mode to the raster data: 'r', 'w' or 'c'
-	TeRasterStatus 	status_;	//! Status for reading and writing to raster	
-	TeTime			date_; //!< The date of the raster
-	
-	/** @name Parameters variable per band
-	*/
-	//@{	
-	vector<int>	nbitsperPixel_;		//!< number of bits per pixel 
-	vector<double>	vmin_;			//!< minimum value 
-	vector<double>	vmax_;			//!< maximum value 
-	vector<int>	bands_;			//!< bands information 
-	vector<double>	dummy_;			//!< no data value
-	vector<TeRasterPhotometricInterpretation>   photometric_;	//!< photometric interpretation
-	vector<TeRasterCompressionMode>	compression_;	//!< compression type 
-	vector<TeDataType> 		dataType_;	//!< computational size of elements
-
-	//! Sets the size of the elements in a particular or in every band
-	/*
-		\param type the computational data type
-		\param band number of the band. Default: all bands 
-	*/
-	void setDataType(TeDataType type, int band=-1);
-
-	//! Returns the size in bytes of each raster element
-	int elementSize(int band=0);
-
-	//! Sets the photometric type in a particular or in every band
-	/*
-		\param photom the photometric interpretation
-		\param band number of the band. Default: all bands 
-	*/
-	void setPhotometric(TeRasterPhotometricInterpretation photom, int band=-1);
-
-	//! Sets the compression mode of each band
-	/*
-		\param cmode the compression mode
-		\param band number of the band. Default: all bands 
-	*/
-	void setCompressionMode(TeRasterCompressionMode cmode, int band=-1);
-
-	//! Sets the dummy value in each band
-	/*
-		\param dummy dummy value
-		\param band number of the band. Default: all bands 
-	*/
-	void setDummy(double dummy, int band=-1);
-	//@}
-
-	/** @name Resolution level parameters
-	* Used when raster has different levels of resolution
-	*/
-	//@{
-	int resolution_;		//! resolution level 
-	int subBand_;			//! sub band identification 
-	//@}
-
-	/** @name File parameters
-	* Used when raster is stored in files
-	*/
-	//@{	
-	string	fileName_;		//!< name of a raster file
-	int offset_;			//!< offset 
-	//@}
-		
-	/** @name Tilling parameters
-	*/
-	//@{
-	TeRasterTilingType	tiling_type_; //!< raster tiling mode 
-	int blockHeight_;		//!< tiles height 
-	int blockWidth_;		//!< tiles width 
-	int nTilesInMemory_;		//!< number of tiles to be kept in memory
-	string blockId_;		//!< tiles identification  
-	//@}
-
-	string	decoderIdentifier_;	//!< decoder associated to his raster
-	
-	//! Returns the identifier of the decoder associated to the raster
-	const string& decName() const 
-	{ return decoderIdentifier_; }
-		
-	/** @name Tilling parameters
-	*/
-	//@{
-	TeDatabase*	database_;	//!< pointer to a TerraLib database where the raster is stored
-	int 		layerId_;	//!< identification of the layer that contains the raster
-	string 		objectId_;	//!< identification of an object associated to this raster geometry
-	//@}
-
-	TeRasterInterLeavingMode interleaving_;	//!< interleaving mode
-
-	/** @name Raster pallete
-	*  Look up table associated to a raster 
-	*/
-	//@{ 
-	string	lutName_;		//!< name of a lut table associated to this raster
-	vector<unsigned short> lutr_;  	//!< red pallete
-	vector<unsigned short> lutg_;  	//!< green pallete
-	vector<unsigned short> lutb_;  	//!< blue pallete
-
-	//! Returns the name of the lut 
-	const string& lutName() 
-	{ return lutName_; }
-	//@}
-
-	/** @name Navigation parameters
-	*  Parameters associated to translation/rotation of the positioning of the raster data
-	*/
-	//@{ 
-	double dxJ_;	//!< X offset due to increase of one column position		       
-	double dxI_;	//!< X offset due to increase of one line position		       
-	double dyJ_;	//!< Y offset due to increase of one column position		       
-	double dyI_;	//!< Y offset due to increase of one line position		       
-	double x0_;		//!< X coordinate of the upper left raster element
-	double y0_;		//!< Y coordinate of the upper left raster element
-
-	/** Sets the navigation parameters
-		\param nwf the navigation parameters set
-		\note this method should be called after the number of lines and columns has been set
-
-		\verbatim
-		The Navigation parameters describe a transformation from column/line domain (i,j)
-        to geographical world (x,y), so that:
-		| x = x0 + i*dxJ + j*dxI
-		| y = y0 + i*dyJ + j*dyI
-
-		and:
-
-		|i = (dyI*(x-x0) - dxI*(y-y0)) / (dxJ*dyI-dyJ*dxI)
-		|j = (dyJ*(x-x0) - dxJ*(y-y0)) / (dyJ*dxI-dxJ*dyI)
-
-		where:
-		nwf[0] = dxJ : the offset in the X direction along each column
-		nwf[1] = dxI : the offset in the X direction along each line
-		nwf[2] = dyJ : the offset in the Y direction along each column
-		nwf[3] = dyI : the offset in the Y direction along each line
-		nwf[4] = x0  : X coordinate of the center of the upper left raster element
-		nwf[5] = y0  : Y coordinate of the center of the upper left raster element
-		\endverbatim
-	*/
-	void setNavigationParameters(const vector<double>& nwf);
-
-	/** Returns the georeferecing parameters 
-		\param nwf vector of double to return the navigation parameters set
-		\verbatim
-		The Navigation parameters describe a transformation from column/line domain (i,j)
-        to geographical world (x,y), so that:
-		| x = x0 + i*dxJ + j*dxI
-		| y = y0 + i*dyJ + j*dyI
-
-		and:
-
-		|i = (dyI*(x-x0) - dxI*(y-y0)) / (dxJ*dyI-dyJ*dxI)
-		|j = (dyJ*(x-x0) - dxJ*(y-y0)) / (dyJ*dxI-dxJ*dyI)
-
-		where:
-		nwf[0] = dxJ : the offset in the X direction along each column
-		nwf[1] = dxI : the offset in the X direction along each line
-		nwf[2] = dyJ : the offset in the Y direction along each column
-		nwf[3] = dyI : the offset in the Y direction along each line
-		nwf[4] = x0  : X coordinate of the center of the upper left raster element
-		nwf[5] = y0  : Y coordinate of the center of the upper left raster element
-		\endverbatim
-	*/
-	void getNavigationParameters(vector<double>& nwf);
-	//@}
-
-	//! Returns the number of bands of the raster
-	int nBands() const
-	{ return nbands_; }
-	
-	//! Saves the parameters in a ASCII File, in TerraLib format
-	void writeParametersFile();
-	
-	//! Reads the parameters described in a ASCII File, in TerraLib format
-	void readParametersFile();
-
-	//! String that contains any error or warning message that raster manipulation might have detected
-	string errorMessage_;
-	
-private:
-	int	nbands_;		//!< number of bands
-	TeBox	box_;			//!< raster box in center of pixel coordinates
-	TeProjection* projection_;	//!< raster projection
-	bool hasSetDummy_;
-};
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeRasterParams.h
+    \brief This file contains definitions about parameters of a raster structure
+*/
+#ifndef  __TERRALIB_INTERNAL_RASTERPARAMS_H
+#define  __TERRALIB_INTERNAL_RASTERPARAMS_H
+
+#include "TeProjection.h"
+#include "TeBox.h"
+#include "TeDataTypes.h"
+#include "TeTime.h"
+
+#include <string>
+#include <list>
+#include <vector>
+
+using namespace std;
+
+class TeDatabase;
+
+//!  A class to handle the parameters set associated with a raster data
+/*! 
+This class is a data structure to store and manipulate a set of parameters and definitions that characterizes 
+a raster data. It contains parameters relative to storaging, geographical or interpretation aspects.
+Not all parameters are valid, or make sense, for all raster data.
+Most parameters are public and can be accessed directly. The private ones should be acessed
+through the methods provided.
+\sa TeRaster
+*/
+class TL_DLL TeRasterParams
+{
+public:
+
+  //! Decoder parameter in a form <param_name,param_value> (This parameter is specific for each decoder, please consult each TeDecoder inherited class for reference). 
+  typedef std::pair< std::string, std::string > DecoderParamT;
+
+	//! Pixels interleaving mode: used by rasters in memory and files in raw formats
+	enum TeRasterInterLeavingMode
+	{	
+		TePerPixel, // BIP - Band Interleaved by Pixel
+		TePerLine,	// BIL - Band Interleaved by Line
+		TePerBand	// BSQ - Band Sequential
+	};
+	
+	//! Photometric interpretation of a raster data
+	enum TeRasterPhotometricInterpretation
+	{ TeUnknown, TePallete, TeMultiBand, TeRGB };
+	
+	//! Status of a raster data, in terms of reading and writting possibilities
+	enum TeRasterStatus
+	{ TeNotReady, TeReadyToRead, TeReadyToWrite };
+
+	//! Compression modes of a raster data 
+	enum TeRasterCompressionMode
+	{ TeNoCompression, TeZLib, TeJpeg, TeTiffCompression };
+	
+	//! Tiling type modes to store raster data in a TerraLib database 
+	enum TeRasterTilingType
+	{  TeExpansible=1, TeNoExpansible=2 };
+	
+
+	//! Default contructor
+	TeRasterParams () :
+		nlines_(0),
+		ncols_(0),
+		resx_(1),
+		resy_(1),
+		swap_(false),
+		useDummy_(false),
+		mode_('r'),
+		status_(TeRasterParams::TeNotReady),
+		resolution_(1),
+		subBand_(0),
+		offset_(0),
+		tiling_type_(TeRasterParams::TeExpansible),
+		blockHeight_(0),
+		blockWidth_(0),
+		nTilesInMemory_(0),
+		blockId_(""),	
+		decoderIdentifier_(""),	
+		database_ (0),
+		layerId_(-1),
+		objectId_(""),
+		interleaving_(TeRasterParams::TePerPixel),
+		lutName_(""),
+		dxJ_(0.0),
+		dxI_(0.0),
+		dyJ_(0.0),
+		dyI_(0.0),
+		x0_(0.0),
+		y0_(0.0),
+		box_(TeBox()),
+		projection_(0)
+	{
+		nbands_= 1;
+		nbitsperPixel_.resize(nbands_);
+		vmin_.resize(nbands_);
+		vmax_.resize(nbands_);
+		bands_.resize(nbands_);
+		bandName_.resize(nbands_);
+		photometric_.resize(nbands_);
+		dataType_.resize(nbands_);
+		dummy_.resize(nbands_);
+		compression_.resize(nbands_);
+		for (int i=0; i<nbands_; i++)
+		{
+			bands_[i] = i;
+			vmin_[i] = TeMAXFLOAT;
+			vmax_[i] = -TeMAXFLOAT;
+			dataType_[i] = TeUNSIGNEDCHAR;
+			photometric_[i] = TeRasterParams::TeMultiBand;
+			dummy_[i] = 255;
+		}
+		hasSetDummy_ = false;
+	}
+
+	//! Copy constructor
+	TeRasterParams(const TeRasterParams& other);
+
+	//! Operator=
+	TeRasterParams& operator=(const TeRasterParams& rhs);
+
+	//! Destructor
+	virtual ~TeRasterParams()
+	{
+		bands_.clear();
+		bandName_.clear();
+		vmin_.clear();
+		vmax_.clear();
+		if (!lutr_.empty())
+		{
+			lutr_.clear();
+			lutg_.clear();
+			lutb_.clear();
+			lutClassName_.clear();
+		}
+		photometric_.clear();
+		dataType_.clear();
+		dummy_.clear();
+		compression_.clear();
+		if (projection_)
+			delete projection_;
+		hasSetDummy_ = false;
+	}
+	
+	/** @name Extension
+	*  Methods to deal with the spatial extensions of a raster data
+	*/
+	//@{	
+	//! Returns the box based on the coordinates of center of the corner elements
+	const TeBox& box() const
+	{ return box_; }
+
+	//! Returns the outline box 
+	TeBox boundingBox() const;
+
+	//! Sets extension parameters
+	/*
+		This methods recalculates the number of lines and columns and box accordingly to 
+		an input bounding box and X and Y resolutions
+		\param x1 bounding box lower left point X coordinate 
+		\param y1 bounding box lower left point Y coordinate 
+		\param x2 bounding box upper right point X coordinate
+		\param y2 bounding box upper right point Y coordinate
+		\param resx X resolution
+		\param resy Y resolution
+		\param lock corner of the bounding box that should be preserved
+	*/
+	void boundingBoxResolution (double x1, double y1, double x2, double y2, 
+				double resx, double resy, TeBox::TeBoxCorner lock = TeBox::TeUPPERLEFT);
+
+	//! Sets extension parameters
+	/*
+		This methods recalculates the resolutions and box accordingly to 
+		a given bounding box and number of lines and columns
+		\param x1 bounding box lower left point X coordinate 
+		\param y1 bounding box lower left point Y coordinate 
+		\param x2 bounding box upper right point X coordinate
+		\param y2 bounding box upper right point Y coordinate
+		\param nlines  number of lines
+		\param ncols number of columns
+		\param lock corner of the bounding box that should be preserved
+	*/
+	void boundingBoxLinesColumns (double x1, double y1, double x2, double y2, 
+		                          int nlines, int ncols, TeBox::TeBoxCorner lock = TeBox::TeUPPERLEFT);
+
+	//! Sets extension parameters
+	/*
+		This methods recalculates the number of lines and columns and box accordingly to 
+		a given box and X and Y resolutions
+		\param x1 box lower left point X coordinate 
+		\param y1 box lower left point Y coordinate 
+		\param x2 box upper right point X coordinate
+		\param y2 box upper right point Y coordinate
+		\param resx X resolution
+		\param resy Y resolution
+		\param lock corner of the bounding box that should be preserved
+	*/
+	void boxResolution (double x1, double y1, double x2, double y2, 
+		                double resx, double resy, TeBox::TeBoxCorner lock = TeBox::TeUPPERLEFT);
+
+	//! Sets extension parameters
+	/*
+		This methods recalculates the resolutions and box accordingly to 
+		a given box and number of lines and columns
+		\param x1 box lower left point X coordinate 
+		\param y1 box lower left point Y coordinate 
+		\param x2 box upper right point X coordinate
+		\param y2 box upper right point Y coordinate
+		\param nlines  number of lines
+		\param ncols number of columns
+		\par Calculates X resolution and Y resolution 
+		\param lock corner of the bounding box that should be preserved
+	*/
+	void boxLinesColumns (double x1, double y1, double x2, double y2, 
+		                  int nlines, int ncols, TeBox::TeBoxCorner lock = TeBox::TeUPPERLEFT);
+
+	//! Sets extension parameters
+	/*
+		\param left lower left point X coordinate 
+		\param top  upper right point Y coordinate
+		\param resx X resolution
+		\param resy Y resolution
+		\param nlines  number of lines
+		\param ncols number of columns
+		\param coordIsCentrePixel flag to indicate that top left coordinate is centre of pixel
+	*/
+	void topLeftResolutionSize (double left, double top, double resx, double resy, int ncol, int nlin, bool coordIsCentrePixel=true);
+		
+	//! Sets extension parameters
+	/*
+		\param left lower left point X coordinate 
+		\param lower lower left point Y coordinate
+		\param resx X resolution
+		\param resy Y resolution
+		\param nlines  number of lines
+		\param ncols number of columns
+		\param coordIsCentrePixel flag to indicate that top left coordinate is centre of pixel
+	*/
+	void lowerLeftResolutionSize (double left, double lower, double resx, double resy, int ncol, int nlin, bool coordIsCentrePixel=true);
+
+	//! Sets default extension parameters
+	/* 
+		Sets a valid bouding box, considering a resolution of 1x1 and
+		that the coordinate of the center of lower-left element is (0.5,0.5)
+		\param nlines  number of lines
+		\param ncols number of columns
+	*/
+	void setNLinesNColumns(int nlines, int ncolumns);
+
+	//! Resizes the raster bounding box to cut it exactly in tiles of a give size
+	/*! 
+		\param bb an initial bounding box
+		\param bWidth block width (in number of elements/pixels)
+		\param bHeight block height (in number of elements/pixels)
+		\note keeps the defined X an Y resolutions
+	*/ 
+	void resizeToTiling(TeBox& bb, int bWidth, int bHeight);
+	//@}
+
+	//! Sets the number of bands, or dimentions in a raster data
+	/*
+		\param n number of bands
+		\note If the required number of bands is greater than the 
+		current number of bands, the last band characteristics 
+		will be copied to the new defined bands.
+	*/
+	void nBands(int n);
+
+	//! Sets the projection
+	/*
+		\param proj a pointer to a terralib projection instance
+		A new instance of projection is created according to the parameters described by proj.
+	*/
+	void projection(TeProjection* proj);
+
+	//! Returns the projection
+	TeProjection* projection()
+	{	return projection_; }
+	
+
+	//! Transform a coordinate from world domain to line/column domain
+	TeCoord2D coord2Index (const TeCoord2D& pt) const;
+
+	//! Transform a coordinate from line/column domain to world domain
+	TeCoord2D index2Coord (const TeCoord2D& pt) const;
+
+
+	int nlines_;			//!< number of lines
+	int ncols_;			//!< number of columns
+
+	double	resx_,			//!< horizontal resolution
+		resy_;			//!< vertical resolution	
+
+	bool swap_;			//!< a flag to indicate that the values of the elements of the raster are swapped
+	bool useDummy_;			//!< a flag to indicate that raster has dummy values
+	char	mode_;			//!< a character indicating the access mode to the raster data: 'r', 'w' or 'c'
+	TeRasterStatus 	status_;	//! Status for reading and writing to raster	
+	TeTime			date_; //!< The date of the raster
+	
+	/** @name Parameters variable per band
+	*/
+	//@{	
+	vector<int>	nbitsperPixel_;		//!< number of bits per pixel 
+	vector<double>	vmin_;			//!< minimum value 
+	vector<double>	vmax_;			//!< maximum value 
+	vector<int>	bands_;			//!< bands information 
+	vector<double>	dummy_;			//!< no data value
+	vector<string> bandName_;		//!< band name
+	vector<TeRasterPhotometricInterpretation>   photometric_;	//!< photometric interpretation
+	vector<TeRasterCompressionMode>	compression_;	//!< compression type 
+	vector<TeDataType> 		dataType_;	//!< computational size of elements
+	std::vector< DecoderParamT > decoderParams_; //!< Decoder parameters (This parameter is specific for each decoder, please consult each TeDecoder inherited class for reference).
+
+	//! Sets the size of the elements in a particular or in every band
+	/*
+		\param type the computational data type
+		\param band number of the band. Default: all bands 
+	*/
+	void setDataType(TeDataType type, int band=-1);
+
+	//! Returns the size in bytes of each raster element
+	int elementSize(int band=0);
+
+	//! Sets the photometric type in a particular or in every band
+	/*
+		\param photom the photometric interpretation
+		\param band number of the band. Default: all bands 
+	*/
+	void setPhotometric(TeRasterPhotometricInterpretation photom, int band=-1);
+
+	//! Sets the compression mode of each band
+	/*
+		\param cmode the compression mode
+		\param band number of the band. Default: all bands 
+	*/
+	void setCompressionMode(TeRasterCompressionMode cmode, int band=-1);
+
+	//! Sets the dummy value in each band
+	/*
+		\param dummy dummy value
+		\param band number of the band. Default: all bands 
+	*/
+	void setDummy(double dummy, int band=-1);
+
+	//! Sets the band name in each band
+	/*
+		\param name band name
+		\param band number of the band. No default value
+	*/
+	void setBandName(string name, int band);
+	//@}
+
+	/** @name Resolution level parameters
+	* Used when raster has different levels of resolution
+	*/
+	//@{
+	int resolution_;		//! resolution level 
+	int subBand_;			//! sub band identification 
+	//@}
+
+	/** @name File parameters
+	* Used when raster is stored in files
+	*/
+	//@{	
+	string	fileName_;		//!< name of a raster file
+	int offset_;			//!< offset 
+	//@}
+		
+	/** @name Tilling parameters
+	*/
+	//@{
+	TeRasterTilingType	tiling_type_; //!< raster tiling mode 
+	int blockHeight_;		//!< tiles height 
+	int blockWidth_;		//!< tiles width 
+	int nTilesInMemory_;		//!< number of tiles to be kept in memory
+	string blockId_;		//!< tiles identification  
+	//@}
+
+	string	decoderIdentifier_;	//!< decoder associated to his raster
+	
+	//! Returns the identifier of the decoder associated to the raster
+	const string& decName() const 
+	{ return decoderIdentifier_; }
+		
+	/** @name Tilling parameters
+	*/
+	//@{
+	TeDatabase*	database_;	//!< pointer to a TerraLib database where the raster is stored
+	int 		layerId_;	//!< identification of the layer that contains the raster
+	string 		objectId_;	//!< identification of an object associated to this raster geometry
+	//@}
+
+	TeRasterInterLeavingMode interleaving_;	//!< interleaving mode
+
+	/** @name Raster pallete
+	*  Look up table associated to a raster 
+	*/
+	//@{ 
+	string	lutName_;		//!< name of a lut table associated to this raster
+	vector<unsigned short> lutr_;  	//!< red pallete
+	vector<unsigned short> lutg_;  	//!< green pallete
+	vector<unsigned short> lutb_;  	//!< blue pallete
+	vector<string> lutClassName_;  	//!< class name
+
+	//! Returns the name of the lut 
+	const string& lutName() 
+	{ return lutName_; }
+	//@}
+
+	/** @name Navigation parameters
+	*  Parameters associated to translation/rotation of the positioning of the raster data
+	*/
+	//@{ 
+	double dxJ_;	//!< X offset due to increase of one column position		       
+	double dxI_;	//!< X offset due to increase of one line position		       
+	double dyJ_;	//!< Y offset due to increase of one column position		       
+	double dyI_;	//!< Y offset due to increase of one line position		       
+	double x0_;		//!< X coordinate of the upper left raster element
+	double y0_;		//!< Y coordinate of the upper left raster element
+
+	/** Sets the navigation parameters
+		\param nwf the navigation parameters set
+		\note this method should be called after the number of lines and columns has been set
+
+		\verbatim
+		The Navigation parameters describe a transformation from column/line domain (i,j)
+        to geographical world (x,y), so that:
+		| x = x0 + i*dxJ + j*dxI
+		| y = y0 + i*dyJ + j*dyI
+
+		and:
+
+		|i = (dyI*(x-x0) - dxI*(y-y0)) / (dxJ*dyI-dyJ*dxI)
+		|j = (dyJ*(x-x0) - dxJ*(y-y0)) / (dyJ*dxI-dxJ*dyI)
+
+		where:
+		nwf[0] = dxJ : the offset in the X direction along each column
+		nwf[1] = dxI : the offset in the X direction along each line
+		nwf[2] = dyJ : the offset in the Y direction along each column
+		nwf[3] = dyI : the offset in the Y direction along each line
+		nwf[4] = x0  : X coordinate of the center of the upper left raster element
+		nwf[5] = y0  : Y coordinate of the center of the upper left raster element
+		\endverbatim
+	*/
+	void setNavigationParameters(const vector<double>& nwf);
+
+	/** Returns the georeferecing parameters 
+		\param nwf vector of double to return the navigation parameters set
+		\verbatim
+		The Navigation parameters describe a transformation from column/line domain (i,j)
+        to geographical world (x,y), so that:
+		| x = x0 + i*dxJ + j*dxI
+		| y = y0 + i*dyJ + j*dyI
+
+		and:
+
+		|i = (dyI*(x-x0) - dxI*(y-y0)) / (dxJ*dyI-dyJ*dxI)
+		|j = (dyJ*(x-x0) - dxJ*(y-y0)) / (dyJ*dxI-dxJ*dyI)
+
+		where:
+		nwf[0] = dxJ : the offset in the X direction along each column
+		nwf[1] = dxI : the offset in the X direction along each line
+		nwf[2] = dyJ : the offset in the Y direction along each column
+		nwf[3] = dyI : the offset in the Y direction along each line
+		nwf[4] = x0  : X coordinate of the center of the upper left raster element
+		nwf[5] = y0  : Y coordinate of the center of the upper left raster element
+		\endverbatim
+	*/
+	void getNavigationParameters(vector<double>& nwf);
+	//@}
+
+	//! Returns the number of bands of the raster
+	int nBands() const
+	{ return nbands_; }
+	
+	//! Saves the parameters in a ASCII File, in TerraLib format
+	void writeParametersFile();
+	
+	//! Reads the parameters described in a ASCII File, in TerraLib format
+	void readParametersFile();
+
+	//! String that contains any error or warning message that raster manipulation might have detected
+	string errorMessage_;
+	
+private:
+	int	nbands_;		//!< number of bands
+	TeBox	box_;			//!< raster box in center of pixel coordinates
+	TeProjection* projection_;	//!< raster projection
+	bool hasSetDummy_;
+};
+
+#endif
+
+
+
diff --git a/src/terralib/kernel/TeRasterRemap.cpp b/src/terralib/kernel/TeRasterRemap.cpp
old mode 100755
new mode 100644
index af7f3f7..e18eb32
--- a/src/terralib/kernel/TeRasterRemap.cpp
+++ b/src/terralib/kernel/TeRasterRemap.cpp
@@ -1,533 +1,640 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeDefines.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeRasterRemap.h"
-#include "TeVectorRemap.h"
-#include "TeProgress.h"
-#include <time.h>
-
-
-#include <algorithm>	// for max and min
-#include <cstdlib>		// for abs
-
-bool TePointOnLine (TeCoord2D& p, TeCoord2D& q, TeCoord2D& t, double tol)
-{
-	int	tx, ty, px, py, qx, qy, dx, dy;
-
-	px = (int)(p.x () / tol);
-	py = (int)(p.y () / tol);
-
-	qx = (int)(q.x () / tol);
-	qy = (int)(q.y () / tol);
-
-	tx = (int)(t.x () / tol);
-	ty = (int)(t.y () / tol);
-
-	dx = abs(px-qx);
-	dy = abs(py-qy);
-
-	if (dx <=2 && dy <= 2)
-		return true;
-
-	int q1 = (qy-py)*(tx-px);
-	int q2 = (ty-py)*(qx-px);
-	int q3 = qx-px;
-	int q4 = qy-py;
-
-	if (q1 == 0 && q2 == 0 && q3 == 0 && q4 == 0)
-		return true;
-	if (abs(q1 - q2) > (std::max(abs(q3), abs(q4))))
-		return false;
-	return true;
-}
-
-bool TeRasterRemap::setROI(TeBox& roi)
-{	
-	if (roi.isValid())
-	{
-		TeBox bb;
-		if (rasterIn_ && !TeIntersection(roi,rasterIn_->params().boundingBox(),bb))
-			return false;
-		ROI_ = roi;	
-		return true;
-	}
-	return false;
-}
-
-void TeRasterRemap::TeInterpolateIn ( TeBox &box )
-{
-	TeRasterParams paramIn = rasterIn_->params();
-	TeRasterParams paramOut = rasterOut_->params();
-
-	TeProjection *projIn = paramIn.projection();
-	TeProjection *projOut = paramOut.projection();
-
-	if (!projIn || !projOut)
-		return;
-
-	projIn->setDestinationProjection(projOut);
-	projOut->setDestinationProjection(projIn);
-
-// Take coordinates of box corners in output raster projection
-
-	TeCoord2D poll = box.lowerLeft ();
-	TeCoord2D pour = box.upperRight ();
-
-// Bring output coordinates to output line/column domain
-
-	TeCoord2D pxoll = rasterOut_->coord2Index (poll);
-	TeCoord2D pxour = rasterOut_->coord2Index (pour);
-
-// Round output coordinates to nearest exact pixel
-
-	int x1,y1;
-	x1 = (int) (pxoll.x() - 0.5);
-	y1 = (int) (pxoll.y() + 0.5);
-	pxoll = TeCoord2D (x1,y1);
-
-	int x2,y2;
-	x2 = (int)(pxour.x() + 0.5);
-	y2 = (int)(pxour.y() - 0.5);
-	pxour = TeCoord2D (x2,y2);
-//	fprintf (loga,"Coordenadas de saida - x1=%d  x2=%d y1=%d y2=%d\n",x1,x2,y1,y2);
-
-	poll = rasterOut_->index2Coord (pxoll);
-	pour = rasterOut_->index2Coord (pxour);
-//	fprintf (loga,"Box de saida        - x1=%f  x2=%f y1=%f y2=%f\n\n",poll.x(),pour.x(),poll.y(),pour.y());
-
-	TeCoord2D poul = TeCoord2D(poll.x(),pour.y());
-	TeCoord2D polr = TeCoord2D(pour.x(),poll.y());
-
-// Bring coordinates of box four corners to input raster projection
-
-	TeCoord2D pill = projOut->PC2LL (poll);
-	TeCoord2D piur = projOut->PC2LL (pour);
-	TeCoord2D piul = projOut->PC2LL (poul);
-	TeCoord2D pilr = projOut->PC2LL (polr);
-
-	pill = projIn->LL2PC (pill);
-	piur = projIn->LL2PC (piur);
-	piul = projIn->LL2PC (piul);
-	pilr = projIn->LL2PC (pilr);
-
-// Check if linear interpolation may be performed on input raster
-// Evaluate point at middle of the edges in output domain and check if their 
-// corresponding points belong to the edges in input domain. If they belong, 
-// a linear interpolation may be performed, else divide output image 
-// in four quadrants and try interpolating again
-
-
-	TeCoord2D	pou((pour.x()-poul.x())/2.+poul.x(), poul.y()), // upper edge
-				pob((polr.x()-poll.x())/2.+poll.x(), poll.y()), // bottom edge
-				pol(poll.x(), (poul.y()-poll.y())/2.+poll.y()), // left edge
-				por(polr.x(), (pour.y()-polr.y())/2.+polr.y()); // right edge
-
-// Evaluate corresponding points in input raster domain
-	TeCoord2D	piu, pib, pil, pir;
-
-	piu = projOut->PC2LL (pou);
-	pib = projOut->PC2LL (pob);
-	pil = projOut->PC2LL (pol);
-	pir = projOut->PC2LL (por);
-
-	piu = projIn->LL2PC (piu);
-	pib = projIn->LL2PC (pib);
-	pil = projIn->LL2PC (pil);
-	pir = projIn->LL2PC (pir);
-
-// Check if middle points belong to the edges
-
-	double tol = MAX(paramIn.resx_ ,paramIn.resy_ );
-
-//	if (!TeIsOnSegment (piu,piul,piur/*,tol*/) ||
-//		!TeIsOnSegment (pir,pilr,piur/*,tol*/) ||
-//		!TeIsOnSegment (pib,pill,pilr/*,tol*/) ||
-//		!TeIsOnSegment (pil,pill,piul/*,tol*/))
-
-	if (!TePointOnLine (piul,piur,piu,tol) ||
-		!TePointOnLine (pilr,piur,pir,tol) ||
-		!TePointOnLine (pill,pilr,pib,tol) ||
-		!TePointOnLine (pill,piul,pil,tol))
-	{
-// If one of them does not belong to correspondig edge, divide output in four quadrants
-		TeCoord2D	pom ((por.x()-pol.x())/2.+pol.x(), (pou.y()-pob.y())/2.+pob.y()); // center point
-		TeBox quadrantul (pol, pou);
-		TeInterpolateIn ( quadrantul );
-		TeBox quadrantur (pom, pour);
-		TeInterpolateIn ( quadrantur );
-		TeBox quadrantll (poll, pom);
-		TeInterpolateIn ( quadrantll );
-		TeBox quadrantlr (pob, por);
-		TeInterpolateIn ( quadrantlr );
-		return;
-	}
-
-// Start linear interpolation on input image.
-
-	double	xl,	// x at the beginning of the line
-		yl,	// y at the beginning of the line
-		xr,	// x at the end of the line
-		yr,	// y at the end of the line
-		dx,	// inner loop x increment
-		dy,	// inner loop y increment
-		dxl,	// x increment at the beginning of line
-		dyl,	// y increment at the beginning of line
-		dxr,	// x increment at the end of line
-		dyr;	// y increment at the end of line
-
-	TeCoord2D pxill = rasterIn_->coord2Index (pill);
-	TeCoord2D pxiul = rasterIn_->coord2Index (piul);
-	TeCoord2D pxilr = rasterIn_->coord2Index (pilr);
-	TeCoord2D pxiur = rasterIn_->coord2Index (piur);
-
-// Evaluate the increments in x and y on both sides of input image
-
-	int	i, j;
-	double	x,y;
-
-	x1 = (int)pxoll.x()-1;
-	y1 = (int)pxour.y()-1;
-
-	x2 = (int)pxour.x()+1;
-	y2 = (int)pxoll.y()+1;
-
-	dxl = ( (pxill.x()-pxiul.x())/(y2-y1) );
-	dyl = ( (pxill.y()-pxiul.y())/(y2-y1) );
-
-	dxr = ( (pxilr.x()-pxiur.x())/(y2-y1) );
-	dyr = ( (pxilr.y()-pxiur.y())/(y2-y1) );
-
-// Set initial values for x and y at beginning point on input image
-
-	xl = pxiul.x() - 1;
-	yl = pxiul.y() - 1;
-
-// Set initial values for x and y at end point on input image
-
-	xr = pxiur.x() + 1;
-	yr = pxiur.y() + 1;
-
-// Evaluate increments for the first line
-
-	dx = (xr-xl)/(x2-x1);
-	dy = (yr-yl)/(x2-x1);
-
-	x = xl;		// round to left pixel
-	y = yl;		// round to left pixel
-
-	for (j=y1;j<=y2;j++)
-	{
-		for (i=x1;i<=x2;i++)
-		{
-			if (interpolation_ == 0)
-				transformer_->apply((int)(x+0.5),(int)(y+0.5),i,j);
- 			x += dx;
-			y += dy;
-		}
-
-		xl += dxl;
-		x = xl;
-		xr += dxr;
-		yl += dyl;
-		y = yl;
-		yr += dyr;
-		dx = (xr-xl)/(x2-x1);
-		dy = (yr-yl)/(x2-x1);
-	}
-}
-
-bool TeRasterRemap::apply( bool showProgress )
-{
-	// check if input and output raster are set
-	if (!rasterIn_ || !rasterOut_)
-		return false;
-
-	TeRasterParams paramIn = rasterIn_->params();
-	TeRasterParams paramOut = rasterOut_->params();
-
-	TeProjection* projIn = paramIn.projection();
-	TeProjection* projOut = paramOut.projection();
-
-	// if only one of the rasters don�t have projection can�t do remapping
-	if ((projIn && !projOut) || (projOut && !projIn))
-		return false;
-
-	showProgress_ = showProgress;
-
-	// if no transformer defined create a new on based on typical cases of 
-	// visualization and import operations
-	bool delTransf = false;
-	if (!transformer_)
-	{
-		delTransf = true;		// remember to delete it 
-		transformer_ = new TeRasterTransform();
-		transformer_->setRasterIn(rasterIn_);
-		transformer_->setRasterOut(rasterOut_);
-
-		// pallete raster to a RGB device -> apply input raster pallete
-		if ((paramIn.photometric_[0] == TeRasterParams::TePallete) &&
-			 paramOut.nBands() == 3)
-			transformer_->setTransfFunction(&TeRasterTransform::Pallete2ThreeBand);
-		// mono band raster to a RGB device -> repeat band to 3 channels
-		else if (paramIn.nBands() == 1 && paramOut.nBands() == 3)
-			transformer_->setTransfFunction(&TeRasterTransform::Mono2ThreeBand);
-		// copy first n input bands to first n output bands
-		else		
-			transformer_->setTransfFunction(&TeRasterTransform::Band2Band);
-	}
-	else if(transformer_->getTransfFunction() == NULL)
-	{
-		transformer_->setTransfFunction(&TeRasterTransform::Band2Band);
-	}
-
-	bool result;
-	// check if datum's are different
-	if (projIn->datum().name() != projOut->datum().name())
-	{
-		projIn->setDestinationProjection(projOut);
-		projOut->setDestinationProjection(projIn);
-	}
-
-	if (projIn && projOut && (*projIn == *projOut))	// same projection
-	{
-		TeBox	boxIn = paramIn.box();
-		TeBox	boxOut = paramOut.box();
-
-		
-		if (!(boxIn == boxOut) ||					// different resolutions or boxes
-			paramIn.resx_   != paramOut.resx_ || 
-			paramIn.resy_   != paramOut.resy_ ||
-			paramIn.ncols_  != paramOut.ncols_ ||
-			paramIn.nlines_ != paramOut.nlines_ )
-			result = resample();
-		else										// same dimensions
-			result = copy();
-	}
-	else											// different projection
-		result = remap();
-
-	if (delTransf)
-	{
-		delete transformer_;
-		transformer_ = 0;
-	}
-	return result;
-}
-
-bool TeRasterRemap::copy ()
-{
-	const TeRasterParams& paramOut = rasterOut_->params();
-	if(showProgress_ && TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(paramOut.nlines_);
-
-	int li, lf, ci, cf;
-	if (ROI_.isValid())
-	{
-		TeCoord2D aux = rasterIn_->coord2Index(ROI_.lowerLeft());
-		lf = TeRoundRasterIndex(aux.y_);
-		ci = TeRoundRasterIndex(aux.x_);
-		aux = rasterIn_->coord2Index(ROI_.upperRight());
-		li = TeRoundRasterIndex(aux.y_);
-		cf = TeRoundRasterIndex(aux.x_);
-	}
-	else
-	{
-		li = ci = 0;
-		lf = paramOut.nlines_;
-		cf = paramOut.ncols_;
-	}
-
-	int c, l;
-	clock_t	ti, tf;
-	ti = clock();
-	for (l=li; l<lf; ++l)
-	{
-		for (c=ci; c<cf; ++c)
-			transformer_->apply(c,l,c,l);
-
-		if (showProgress_ && TeProgress::instance())
-		{
-			tf = clock();
-			if (int((tf-ti)/CLOCKS_PER_SEC) > 3)
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				TeProgress::instance()->setProgress(l);
-				ti = tf;
-			}
-		}
-	}
-	if(showProgress_ && TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-bool TeRasterRemap::resample ()
-{
-	TeRasterParams paramIn = rasterIn_->params();
-	TeRasterParams paramOut = rasterOut_->params();
-
-	TeBox	boxIn = paramIn.boundingBox();  
-	TeBox	boxOut = paramOut.boundingBox(); 
-
-// Evaluate intersection of input and output rasters in output raster projection domain
-
-	TeBox boxInter;
-
-	if (!TeIntersection (boxIn,boxOut,boxInter))
-		return false;
-
-	if (ROI_.isValid())
-	{
-		if (!TeIntersection (ROI_,boxInter,boxInter))
-			return false;
-	}
-
-// Take coordinates of intersection box
-
-	TeCoord2D poll = boxInter.lowerLeft ();
-	TeCoord2D pour = boxInter.upperRight ();
-
-// Bring it to output line/column domain
-
-	TeCoord2D pxoll = rasterOut_->coord2Index (poll);
-	TeCoord2D pxour = rasterOut_->coord2Index (pour);
-
-// Round it to nearest pixel
-	int x1,y1,x2,y2;
-	x1 = TeRoundRasterIndex(pxoll.x_) - 1;
-	y2 = TeRoundRasterIndex(pxoll.y_) + 1;
-	pxoll = TeCoord2D (x1,y2);
-
-	x2 = TeRoundRasterIndex(pxour.x_) + 1;
-	y1 = TeRoundRasterIndex(pxour.y_) - 1;
-	pxour = TeCoord2D (x2,y1);
-		
-// Bring it to output projection domain
-	poll = rasterOut_->index2Coord (pxoll);
-	pour = rasterOut_->index2Coord (pxour);
-
-// Bring upper left point to input line/column domain
-	TeCoord2D ulPoint = rasterIn_->coord2Index(TeCoord2D(poll.x(),pour.y()));
-
-//  - -
-// |A|B|
-//  - - 
-// |C| |
-//  - -
-// Get output projection domain of corner ABC
-	TeCoord2D A = rasterOut_->index2Coord(TeCoord2D(0,0));
-	TeCoord2D B = rasterOut_->index2Coord(TeCoord2D(1,0));
-	TeCoord2D C = rasterOut_->index2Coord(TeCoord2D(0,1));
-
-// Calculate equivalent input line/column coordinates 
-	TeCoord2D Ae = rasterIn_->coord2Index(A);
-	TeCoord2D Be = rasterIn_->coord2Index(B);
-	TeCoord2D Ce = rasterIn_->coord2Index(C);
-
-// Calculate input increments in both directions, in number of pixels
-// for each output 1 pixel increment in 
-	double eDxJ = Be.x()-Ae.x();		// increment in X direction when moving from A->B	
-	double eDyJ = Be.y()-Ae.y();		// increment in Y direction when moving from A->B
-	double eDyI = Ce.y()-Ae.y();		// increment in Y direction when moving from C->A
-	double eDxI = Ce.x()-Ae.x();		// increment in X direction when moving from C->A
-
-	int lin_sai,col_sai;
-	double lin_entra,col_entra; 
-
-	double lin_entra_i = ulPoint.y();	// starting at the upper-left corner	
-	double col_entra_i = ulPoint.x();
-
-	if( showProgress_ && TeProgress::instance())
-		TeProgress::instance()->setTotalSteps((int)(y2-y1));
-
-	int count = 1;
-	clock_t	ti, tf;
-	ti = clock();
-	for (lin_sai=y1;lin_sai<=y2;lin_sai++)
-	{
-		lin_entra = lin_entra_i;
-		col_entra = col_entra_i;
-		for (col_sai=x1;col_sai<=x2;col_sai++)
-		{
-			transformer_->apply(TeRoundRasterIndex(col_entra),TeRoundRasterIndex(lin_entra),col_sai,lin_sai);
-  			col_entra += eDxJ;
-			lin_entra += eDyJ;
-		}
-		count++;
-		lin_entra_i += eDyI;
-		col_entra_i += eDxI;
-		if(showProgress_ && TeProgress::instance())
-		{
-			tf = clock();
-			if (int((tf-ti)/CLOCKS_PER_SEC) > 3)
-			{
-				if (TeProgress::instance()->wasCancelled())
-					break;
-				TeProgress::instance()->setProgress(count);
-				ti = tf;
-			}
-		}
-	}
-	if (showProgress_ && TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-bool TeRasterRemap::remap()
-{
-
-	TeRasterParams paramIn = rasterIn_->params();
-	TeRasterParams paramOut = rasterOut_->params();
-
-	TeProjection *projIn = paramIn.projection();
-	TeProjection *projOut = paramOut.projection();
-
-
-	if ( projIn == 0 || projOut == 0)
-		return false;
-
-	projIn->setDestinationProjection(projOut);
-
-	TeBox	boxIn =  paramIn.box();
-	TeBox	boxOut = paramOut.box();
-
-// Evaluate intersection of input and output rasters in output raster projection domain
-	TeBox boxInter;
-	boxIn = TeRemapBox (boxIn, projIn, projOut);
-	if (!TeIntersection (boxIn,boxOut,boxInter))
-		return false;
-
-	if (ROI_.isValid())
-	{
-		boxIn = TeRemapBox (ROI_, projIn, projOut);
-		if (!TeIntersection (boxIn,boxInter,boxInter))
-			return false;
-	}
-
-// Start trying to remap the input quadrilateral
-	TeInterpolateIn ( boxInter );
-	return true;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeDefines.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeRasterRemap.h"
+#include "TeVectorRemap.h"
+#include "TeProgress.h"
+#include "TeAgnostic.h"
+
+#include <time.h>
+
+
+#include <algorithm>	// for max and min
+#include <cstdlib>		// for abs
+
+bool TePointOnLine (TeCoord2D& p, TeCoord2D& q, TeCoord2D& t, double tol)
+{
+	int	tx, ty, px, py, qx, qy, dx, dy;
+
+	px = (int)(p.x () / tol);
+	py = (int)(p.y () / tol);
+
+	qx = (int)(q.x () / tol);
+	qy = (int)(q.y () / tol);
+
+	tx = (int)(t.x () / tol);
+	ty = (int)(t.y () / tol);
+
+	dx = abs(px-qx);
+	dy = abs(py-qy);
+
+	if (dx <=2 && dy <= 2)
+		return true;
+
+	int q1 = (qy-py)*(tx-px);
+	int q2 = (ty-py)*(qx-px);
+	int q3 = qx-px;
+	int q4 = qy-py;
+
+	if (q1 == 0 && q2 == 0 && q3 == 0 && q4 == 0)
+		return true;
+	if (abs(q1 - q2) > (std::max(abs(q3), abs(q4))))
+		return false;
+	return true;
+}
+
+TeRasterRemap::TeRasterRemap(TeRaster* rasterIn, TeRaster* rasterOut, 
+  bool showProgress )
+  :
+  rasterIn_(rasterIn),
+  rasterOut_(rasterOut),
+  transformer_(0),
+  interpolation_(0),
+  showProgress_(showProgress),
+  useOptimizedReprojection_( true ),
+  ROI_(TeBox())
+{
+}
+
+bool TeRasterRemap::setROI(TeBox& roi)
+{	
+	if (roi.isValid())
+	{
+		TeBox bb;
+		if (rasterIn_ && !TeIntersection(roi,rasterIn_->params().boundingBox(),bb))
+			return false;
+		ROI_ = roi;	
+		return true;
+	}
+	return false;
+}
+
+bool TeRasterRemap::TeOptimizedInterpolateIn( const TeBox &box )
+{
+	TeRasterParams paramIn = rasterIn_->params();
+	TeRasterParams paramOut = rasterOut_->params();
+
+	TeProjection *projIn = paramIn.projection();
+	TeProjection *projOut = paramOut.projection();
+
+	if (!projIn || !projOut)
+		return false;
+
+	if(!TeCheckBoxConsistency(box, projOut))
+	{
+		return false;
+	}
+
+	projIn->setDestinationProjection(projOut);
+	projOut->setDestinationProjection(projIn);
+
+// Take coordinates of box corners in output raster projection
+
+	TeCoord2D poll = box.lowerLeft ();
+	TeCoord2D pour = box.upperRight ();
+
+// Bring output coordinates to output line/column domain
+
+	TeCoord2D pxoll = rasterOut_->coord2Index (poll);
+	TeCoord2D pxour = rasterOut_->coord2Index (pour);
+
+// Round output coordinates to nearest exact pixel
+
+	int x1,y1;
+	x1 = (int) (pxoll.x() - 0.5);
+	y1 = (int) (pxoll.y() + 0.5);
+	pxoll = TeCoord2D (x1,y1);
+
+	int x2,y2;
+	x2 = (int)(pxour.x() + 0.5);
+	y2 = (int)(pxour.y() - 0.5);
+	pxour = TeCoord2D (x2,y2);
+//	fprintf (loga,"Coordenadas de saida - x1=%d  x2=%d y1=%d y2=%d\n",x1,x2,y1,y2);
+
+	poll = rasterOut_->index2Coord (pxoll);
+	pour = rasterOut_->index2Coord (pxour);
+//	fprintf (loga,"Box de saida        - x1=%f  x2=%f y1=%f y2=%f\n\n",poll.x(),pour.x(),poll.y(),pour.y());
+
+	TeCoord2D poul = TeCoord2D(poll.x(),pour.y());
+	TeCoord2D polr = TeCoord2D(pour.x(),poll.y());
+
+// Bring coordinates of box four corners to input raster projection
+
+	TeCoord2D pill = projOut->PC2LL (poll);
+	TeCoord2D piur = projOut->PC2LL (pour);
+	TeCoord2D piul = projOut->PC2LL (poul);
+	TeCoord2D pilr = projOut->PC2LL (polr);
+
+	pill = projIn->LL2PC (pill);
+	piur = projIn->LL2PC (piur);
+	piul = projIn->LL2PC (piul);
+	pilr = projIn->LL2PC (pilr);
+
+// Check if linear interpolation may be performed on input raster
+// Evaluate point at middle of the edges in output domain and check if their 
+// corresponding points belong to the edges in input domain. If they belong, 
+// a linear interpolation may be performed, else divide output image 
+// in four quadrants and try interpolating again
+
+
+	TeCoord2D	pou((pour.x()-poul.x())/2.+poul.x(), poul.y()), // upper edge
+				pob((polr.x()-poll.x())/2.+poll.x(), poll.y()), // bottom edge
+				pol(poll.x(), (poul.y()-poll.y())/2.+poll.y()), // left edge
+				por(polr.x(), (pour.y()-polr.y())/2.+polr.y()); // right edge
+
+// Evaluate corresponding points in input raster domain
+	TeCoord2D	piu, pib, pil, pir;
+
+	piu = projOut->PC2LL (pou);
+	pib = projOut->PC2LL (pob);
+	pil = projOut->PC2LL (pol);
+	pir = projOut->PC2LL (por);
+
+	piu = projIn->LL2PC (piu);
+	pib = projIn->LL2PC (pib);
+	pil = projIn->LL2PC (pil);
+	pir = projIn->LL2PC (pir);
+
+// Check if middle points belong to the edges
+
+	double tol = MAX(paramIn.resx_ ,paramIn.resy_ );
+
+//	if (!TeIsOnSegment (piu,piul,piur/*,tol*/) ||
+//		!TeIsOnSegment (pir,pilr,piur/*,tol*/) ||
+//		!TeIsOnSegment (pib,pill,pilr/*,tol*/) ||
+//		!TeIsOnSegment (pil,pill,piul/*,tol*/))
+
+	if (!TePointOnLine (piul,piur,piu,tol) ||
+		!TePointOnLine (pilr,piur,pir,tol) ||
+		!TePointOnLine (pill,pilr,pib,tol) ||
+		!TePointOnLine (pill,piul,pil,tol))
+	{
+// If one of them does not belong to correspondig edge, divide output in four quadrants
+		TeCoord2D	pom ((por.x()-pol.x())/2.+pol.x(), (pou.y()-pob.y())/2.+pob.y()); // center point
+		TeBox quadrantul (pol, pou);
+		if( ! TeOptimizedInterpolateIn ( quadrantul ) ) return false;
+		TeBox quadrantur (pom, pour);
+		if( ! TeOptimizedInterpolateIn ( quadrantur ) ) return false;
+		TeBox quadrantll (poll, pom);
+		if( ! TeOptimizedInterpolateIn ( quadrantll ) ) return false;
+		TeBox quadrantlr (pob, por);
+		if( ! TeOptimizedInterpolateIn ( quadrantlr ) ) return false;
+    
+		return true;
+	}
+
+// Start linear interpolation on input image.
+
+	double	xl,	// x at the beginning of the line
+		yl,	// y at the beginning of the line
+		xr,	// x at the end of the line
+		yr,	// y at the end of the line
+		dx,	// inner loop x increment
+		dy,	// inner loop y increment
+		dxl,	// x increment at the beginning of line
+		dyl,	// y increment at the beginning of line
+		dxr,	// x increment at the end of line
+		dyr;	// y increment at the end of line
+
+	TeCoord2D pxill = rasterIn_->coord2Index (pill);
+	TeCoord2D pxiul = rasterIn_->coord2Index (piul);
+	TeCoord2D pxilr = rasterIn_->coord2Index (pilr);
+	TeCoord2D pxiur = rasterIn_->coord2Index (piur);
+
+// Evaluate the increments in x and y on both sides of input image
+
+	int	i, j;
+	double	x,y;
+
+	x1 = (int)pxoll.x()-1;
+	y1 = (int)pxour.y()-1;
+
+	x2 = (int)pxour.x()+1;
+	y2 = (int)pxoll.y()+1;
+
+	dxl = ( (pxill.x()-pxiul.x())/(y2-y1) );
+	dyl = ( (pxill.y()-pxiul.y())/(y2-y1) );
+
+	dxr = ( (pxilr.x()-pxiur.x())/(y2-y1) );
+	dyr = ( (pxilr.y()-pxiur.y())/(y2-y1) );
+
+// Set initial values for x and y at beginning point on input image
+
+	xl = pxiul.x() - 1;
+	yl = pxiul.y() - 1;
+
+// Set initial values for x and y at end point on input image
+
+	xr = pxiur.x() + 1;
+	yr = pxiur.y() + 1;
+
+// Evaluate increments for the first line
+
+	dx = (xr-xl)/(x2-x1);
+	dy = (yr-yl)/(x2-x1);
+
+	x = xl;		// round to left pixel
+	y = yl;		// round to left pixel
+
+	for (j=y1;j<=y2;j++)
+	{
+		for (i=x1;i<=x2;i++)
+		{
+			if (interpolation_ == 0)
+				transformer_->apply((int)(x+0.5),(int)(y+0.5),i,j);
+ 			x += dx;
+			y += dy;
+		}
+
+		xl += dxl;
+		x = xl;
+		xr += dxr;
+		yl += dyl;
+		y = yl;
+		yr += dyr;
+		dx = (xr-xl)/(x2-x1);
+		dy = (yr-yl)/(x2-x1);
+	}
+  
+  return true;
+}
+
+bool TeRasterRemap::TeInterpolateIn( const TeBox& box )
+{
+  TEAGN_DEBUG_CONDITION( rasterIn_, "Invalid raster pointer" )
+  TEAGN_DEBUG_CONDITION( rasterOut_, "Invalid raster pointer" )
+  TEAGN_DEBUG_CONDITION( rasterIn_->params().projection(), "Invalid proj" )
+  TEAGN_DEBUG_CONDITION( rasterOut_->params().projection(), "Invalid proj" )
+  TEAGN_DEBUG_CONDITION( transformer_, "Invalid transformer" )
+  
+  TeProjection& projIn = *( rasterIn_->params().projection() );
+  TeProjection& projOut = *( rasterOut_->params().projection() );
+  
+  projIn.setDestinationProjection( &projOut );
+  projOut.setDestinationProjection( &projIn );
+
+  if(!TeCheckBoxConsistency(box, &projOut))
+  {
+	return false;
+  }
+  
+  // Guessing the output raster data limits
+  
+  const TeCoord2D ll = box.lowerLeft();
+  const TeCoord2D ur = box.upperRight();  
+  
+  const TeCoord2D idxll = rasterOut_->coord2Index( ll );
+  const TeCoord2D idxur = rasterOut_->coord2Index( ur );  
+  
+  const double minX = MIN( idxll.x(), idxur.x() );
+  const double maxX = MAX( idxll.x(), idxur.x() );
+  const double minY = MIN( idxll.y(), idxur.y() );
+  const double maxY = MAX( idxll.y(), idxur.y() );
+  
+  const double outLineStart = MAX( ( (double)TeRound( minY - 0.5 ) ), 0.0 );
+  const double outColStart = MAX( ( (double)TeRound( minX - 0.5 ) ), 0.0 );
+  const double outLineBound = MIN( ( (double)TeRound( maxY + 0.5 ) ),
+    (double)rasterOut_->params().nlines_ );
+  const double outColBound = MIN( ( (double)TeRound( maxX + 0.5 ) ),
+    (double)rasterOut_->params().ncols_ );
+  
+  TEAGN_DEBUG_CONDITION( outLineStart <= outLineBound, "Invalid range" );
+  TEAGN_DEBUG_CONDITION( outColStart <= outColBound, "Invalid range" );
+  
+  // Inverse mapping each point inside the given intersection box
+  // over the output raster  
+  
+  double outLine = 0;
+  double outCol = 0;
+  TeCoord2D outIdxCoord;
+  TeCoord2D outCoord;
+  TeCoord2D inCoord;
+  TeCoord2D inIdxCoord;
+  TeCoord2D auxLLCoord;
+  TeRaster& inRaster = *rasterIn_;
+  TeRaster& outRaster = *rasterOut_;
+  TeRasterTransform& transf = *transformer_;
+    
+  for( outLine = outLineStart ; outLine < outLineBound ; ++outLine )
+  {
+    outIdxCoord.y( outLine );
+    
+    for( outCol = outColStart ; outCol < outColBound ; ++outCol )
+    {
+      outIdxCoord.x( outCol );
+      
+      outCoord = outRaster.index2Coord( outIdxCoord );
+      
+      auxLLCoord = projOut.PC2LL( outCoord );
+      
+      inCoord = projIn.LL2PC( auxLLCoord );
+      
+      inIdxCoord = inRaster.coord2Index( inCoord );
+      
+      transf.apply( inIdxCoord.x(),inIdxCoord.y(), outCol, outLine );
+    }
+  }
+  
+  return true;
+}
+
+bool TeRasterRemap::apply( bool showProgress )
+{
+	// check if input and output raster are set
+	if (!rasterIn_ || !rasterOut_)
+		return false;
+
+	TeRasterParams paramIn = rasterIn_->params();
+	TeRasterParams paramOut = rasterOut_->params();
+
+	TeProjection* projIn = paramIn.projection();
+	TeProjection* projOut = paramOut.projection();
+
+	// if only one of the rasters don�t have projection can�t do remapping
+	if ((projIn && !projOut) || (projOut && !projIn))
+		return false;
+
+	showProgress_ = showProgress;
+
+	// if no transformer defined create a new on based on typical cases of 
+	// visualization and import operations
+	bool delTransf = false;
+	if (!transformer_)
+	{
+		delTransf = true;		// remember to delete it 
+		transformer_ = new TeRasterTransform();
+		transformer_->setRasterIn(rasterIn_);
+		transformer_->setRasterOut(rasterOut_);
+
+		// pallete raster to a RGB device -> apply input raster pallete
+		if ((paramIn.photometric_[0] == TeRasterParams::TePallete) &&
+			 paramOut.nBands() == 3)
+			transformer_->setTransfFunction(&TeRasterTransform::Pallete2ThreeBand);
+		// mono band raster to a RGB device -> repeat band to 3 channels
+		else if (paramIn.nBands() == 1 && paramOut.nBands() == 3)
+			transformer_->setTransfFunction(&TeRasterTransform::Mono2ThreeBand);
+		// copy first n input bands to first n output bands
+		else		
+			transformer_->setTransfFunction(&TeRasterTransform::Band2Band);
+	}
+	else if(transformer_->getTransfFunction() == TeRasterTransform::TeNoTransf)
+	{
+		transformer_->setTransfFunction(&TeRasterTransform::Band2Band);
+	}
+
+	bool result;
+	// check if datum's are different
+	if (projIn->datum().name() != projOut->datum().name())
+	{
+		projIn->setDestinationProjection(projOut);
+		projOut->setDestinationProjection(projIn);
+	}
+
+	if (projIn && projOut && (*projIn == *projOut))	// same projection
+	{
+		TeBox	boxIn = paramIn.box();
+		TeBox	boxOut = paramOut.box();
+
+		
+		if (!(boxIn == boxOut) ||					// different resolutions or boxes
+			paramIn.resx_   != paramOut.resx_ || 
+			paramIn.resy_   != paramOut.resy_ ||
+			paramIn.ncols_  != paramOut.ncols_ ||
+			paramIn.nlines_ != paramOut.nlines_ )
+			result = resample();
+		else										// same dimensions
+			result = copy();
+	}
+	else											// different projection
+		result = remap();
+
+	if (delTransf)
+	{
+		delete transformer_;
+		transformer_ = 0;
+	}
+	return result;
+}
+
+bool TeRasterRemap::copy ()
+{
+	const TeRasterParams& paramOut = rasterOut_->params();
+	if(showProgress_ && TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(paramOut.nlines_);
+
+	int li, lf, ci, cf;
+	if (ROI_.isValid())
+	{
+		TeCoord2D aux = rasterIn_->coord2Index(ROI_.lowerLeft());
+		lf = TeRoundRasterIndex(aux.y_);
+		ci = TeRoundRasterIndex(aux.x_);
+		aux = rasterIn_->coord2Index(ROI_.upperRight());
+		li = TeRoundRasterIndex(aux.y_);
+		cf = TeRoundRasterIndex(aux.x_);
+	}
+	else
+	{
+		li = ci = 0;
+		lf = paramOut.nlines_;
+		cf = paramOut.ncols_;
+	}
+
+	int c, l;
+	clock_t	ti, tf;
+	ti = clock();
+	for (l=li; l<lf; ++l)
+	{
+		for (c=ci; c<cf; ++c)
+			transformer_->apply(c,l,c,l);
+
+		if (showProgress_ && TeProgress::instance())
+		{
+			tf = clock();
+			if (int((tf-ti)/CLOCKS_PER_SEC) > 3)
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				TeProgress::instance()->setProgress(l);
+				ti = tf;
+			}
+		}
+	}
+	if(showProgress_ && TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+bool TeRasterRemap::resample ()
+{
+	TeRasterParams paramIn = rasterIn_->params();
+	TeRasterParams paramOut = rasterOut_->params();
+
+	TeBox	boxIn = paramIn.boundingBox();  
+	TeBox	boxOut = paramOut.boundingBox(); 
+
+// Evaluate intersection of input and output rasters in output raster projection domain
+
+	TeBox boxInter;
+
+	if (!TeIntersection (boxIn,boxOut,boxInter))
+		return false;
+
+	if (ROI_.isValid())
+	{
+		if (!TeIntersection (ROI_,boxInter,boxInter))
+			return false;
+	}
+
+// Take coordinates of intersection box
+
+	TeCoord2D poll = boxInter.lowerLeft ();
+	TeCoord2D pour = boxInter.upperRight ();
+
+// Bring it to output line/column domain
+
+	TeCoord2D pxoll = rasterOut_->coord2Index (poll);
+	TeCoord2D pxour = rasterOut_->coord2Index (pour);
+
+// Round it to nearest pixel
+	int x1,y1,x2,y2;
+	x1 = TeRoundRasterIndex(pxoll.x_) - 1;
+	y2 = TeRoundRasterIndex(pxoll.y_) + 1;
+	pxoll = TeCoord2D (x1,y2);
+
+	x2 = TeRoundRasterIndex(pxour.x_) + 1;
+	y1 = TeRoundRasterIndex(pxour.y_) - 1;
+	pxour = TeCoord2D (x2,y1);
+		
+// Bring it to output projection domain
+	poll = rasterOut_->index2Coord (pxoll);
+	pour = rasterOut_->index2Coord (pxour);
+
+// Bring upper left point to input line/column domain
+	TeCoord2D ulPoint = rasterIn_->coord2Index(TeCoord2D(poll.x(),pour.y()));
+
+//  - -
+// |A|B|
+//  - - 
+// |C| |
+//  - -
+// Get output projection domain of corner ABC
+	TeCoord2D A = rasterOut_->index2Coord(TeCoord2D(0,0));
+	TeCoord2D B = rasterOut_->index2Coord(TeCoord2D(1,0));
+	TeCoord2D C = rasterOut_->index2Coord(TeCoord2D(0,1));
+
+// Calculate equivalent input line/column coordinates 
+	TeCoord2D Ae = rasterIn_->coord2Index(A);
+	TeCoord2D Be = rasterIn_->coord2Index(B);
+	TeCoord2D Ce = rasterIn_->coord2Index(C);
+
+// Calculate input increments in both directions, in number of pixels
+// for each output 1 pixel increment in 
+	double eDxJ = Be.x()-Ae.x();		// increment in X direction when moving from A->B	
+	double eDyJ = Be.y()-Ae.y();		// increment in Y direction when moving from A->B
+	double eDyI = Ce.y()-Ae.y();		// increment in Y direction when moving from C->A
+	double eDxI = Ce.x()-Ae.x();		// increment in X direction when moving from C->A
+
+	int lin_sai,col_sai;
+	double lin_entra,col_entra; 
+
+	double lin_entra_i = ulPoint.y();	// starting at the upper-left corner	
+	double col_entra_i = ulPoint.x();
+
+	if( showProgress_ && TeProgress::instance())
+		TeProgress::instance()->setTotalSteps((int)(y2-y1));
+
+	int count = 1;
+	clock_t	ti, tf;
+	ti = clock();
+	for (lin_sai=y1;lin_sai<=y2;lin_sai++)
+	{
+		lin_entra = lin_entra_i;
+		col_entra = col_entra_i;
+		for (col_sai=x1;col_sai<=x2;col_sai++)
+		{
+			transformer_->apply(TeRoundRasterIndex(col_entra),TeRoundRasterIndex(lin_entra),col_sai,lin_sai);
+  			col_entra += eDxJ;
+			lin_entra += eDyJ;
+		}
+		count++;
+		lin_entra_i += eDyI;
+		col_entra_i += eDxI;
+		if(showProgress_ && TeProgress::instance())
+		{
+			tf = clock();
+			if (int((tf-ti)/CLOCKS_PER_SEC) > 3)
+			{
+				if (TeProgress::instance()->wasCancelled())
+					break;
+				TeProgress::instance()->setProgress(count);
+				ti = tf;
+			}
+		}
+	}
+	if (showProgress_ && TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+bool TeRasterRemap::remap()
+{
+  TeRasterParams paramIn = rasterIn_->params();
+  TeRasterParams paramOut = rasterOut_->params();
+
+  TeProjection *projIn = paramIn.projection();
+  TeProjection *projOut = paramOut.projection();
+
+
+  if ( projIn == 0 || projOut == 0)
+    return false;
+
+  projIn->setDestinationProjection(projOut);
+
+  TeBox	boxIn =  paramIn.box();
+  TeBox	boxOut = paramOut.box();
+
+// Evaluate intersection of input and output rasters in output raster projection domain
+  TeBox boxInter;
+  boxIn = TeRemapBox (boxIn, projIn, projOut);
+  if (!TeIntersection (boxIn,boxOut,boxInter))
+    return false;
+
+  if (ROI_.isValid())
+  {
+    boxIn = TeRemapBox (ROI_, projIn, projOut);
+    if (!TeIntersection (boxIn,boxInter,boxInter))
+      return false;
+  }
+
+    // Start trying to remap the input quadrilateral
+  if( useOptimizedReprojection_ )
+  {    
+	  return TeOptimizedInterpolateIn ( boxInter );
+  }
+  else
+  {
+    return TeInterpolateIn( boxInter );
+  }
+}
diff --git a/src/terralib/kernel/TeRasterRemap.h b/src/terralib/kernel/TeRasterRemap.h
old mode 100755
new mode 100644
index c78c64f..45e606b
--- a/src/terralib/kernel/TeRasterRemap.h
+++ b/src/terralib/kernel/TeRasterRemap.h
@@ -1,131 +1,136 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeRasterRemap.h
-    \brief This file contains definitions the class and functions need to transform a raster geometry into another geometry
-*/
-#ifndef  __TERRALIB_INTERNAL_RASTERREMAP_H
-#define  __TERRALIB_INTERNAL_RASTERREMAP_H
-
-#include "TeRaster.h"
-#include "TeGeometry.h"
-#include "TeRasterTransform.h"
-
-//!  A functional class to transform a raster geometry into another geometry 
-/*!  
-	RasterRemap class provides functions to remap a raster strtucture into another.
-	The two raster can have a different projections, different bounding boxes and/or 
-	different resolutions. 
- 
-	\sa
-     TeRaster, TeRasterParams, TeRasterTransform, TeProjection, TeBox
-
-	\note Raster representation in TerraLib is under development, all files that deal
-	with raster representation should be considered as a beta version.
-*/
-class TL_DLL TeRasterRemap
-{
-protected:
-	TeRaster*	rasterIn_;		//!< input raster
-	TeRaster*	rasterOut_;		//!< output raster
-
-	TeRasterTransform* transformer_;	
-
-	int	 interpolation_;
-	bool showProgress_;
-
-
-	TeBox ROI_;					// region of interest (from input) where the remmaping should be done
-
-	void TeInterpolateIn (TeBox &box);
-
-	bool remap ();
-	bool copy ();
-	bool resample ();
-
-public:
-
-	//! Constructor
-	/*
-		\param rasterIn pointer to the input raster
-		\param rasterOut pointer to the output raster
-		\para showProgress flag to indicate that a progress status hould be reported
-	*/
-	TeRasterRemap (TeRaster* rasterIn=0, TeRaster* rasterOut=0, bool showProgress = false):
-		rasterIn_(rasterIn),
-		rasterOut_(rasterOut),
-		transformer_(0),
-		interpolation_(0),
-		showProgress_(showProgress),
-		ROI_(TeBox())
-		{}
-
-	//! Sets the input raster
-	void setInput(TeRaster* rasterIn)
-	{	
-		rasterIn_ = rasterIn; 
-		if (transformer_)
-			transformer_->setRasterIn(rasterIn_);
-	}
-	
-	//! Sets the output raster
-	void setOutput(TeRaster* rasterOut)
-	{	
-		rasterOut_ = rasterOut; 
-		if (transformer_)
-			transformer_->setRasterOut(rasterOut_);
-	}
-	
-	//! Sets the interpolation flag
-	void setInterpolation(int interpolation)
-	{	interpolation_ = interpolation; }
-
-	//! Sets the transformation to be used when doing remap
-	void setTransformer(TeRasterTransform* transf)
-	{	
-		if (transf)
-		{
-			transformer_ = transf; 
-			transformer_->setRasterOut(rasterOut_);
-			transformer_->setRasterIn(rasterIn_);
-		}
-	}
-	
-	//! Returns the transformation to be used when doing remap
-	TeRasterTransform* transformer()
-	{	return transformer_;	}
-
-	//! Applies the remaping
-	bool apply(bool showProgress = false);
-
-	//! Defines a region of interest where the remmaping should be done
-	/*
-		\par roi a box that represents the region of interest. It should
-		be inside the raster in bounding box;
-		\return false if the roi in invalid or it is not within the input
-		raster. True otherwise
-	*/
-	bool setROI(TeBox& roi);
-};
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeRasterRemap.h
+    \brief This file contains definitions the class and functions need to transform a raster geometry into another geometry
+*/
+#ifndef  __TERRALIB_INTERNAL_RASTERREMAP_H
+#define  __TERRALIB_INTERNAL_RASTERREMAP_H
+
+#include "TeRaster.h"
+#include "TeGeometry.h"
+#include "TeRasterTransform.h"
+
+//!  A functional class to transform a raster geometry into another geometry 
+/*!  
+	RasterRemap class provides functions to remap a raster strtucture into another.
+	The two raster can have a different projections, different bounding boxes and/or 
+	different resolutions. 
+ 
+	\sa
+     TeRaster, TeRasterParams, TeRasterTransform, TeProjection, TeBox
+
+	\note Raster representation in TerraLib is under development, all files that deal
+	with raster representation should be considered as a beta version.
+*/
+class TL_DLL TeRasterRemap
+{
+protected:
+	TeRaster*	rasterIn_;		//!< input raster
+	TeRaster*	rasterOut_;		//!< output raster
+
+	TeRasterTransform* transformer_;	
+
+	int	 interpolation_;
+	bool showProgress_;
+  bool useOptimizedReprojection_; 
+
+
+	TeBox ROI_;					// region of interest (from input) where the remmaping should be done
+
+	bool TeOptimizedInterpolateIn ( const TeBox &box );
+  bool TeInterpolateIn ( const TeBox &box ); 
+
+	bool remap ();
+	bool copy ();
+	bool resample ();
+
+public:
+
+	//! Constructor
+	/*
+		\param rasterIn pointer to the input raster
+		\param rasterOut pointer to the output raster
+		\para showProgress flag to indicate that a progress status hould be reported
+	*/
+	TeRasterRemap (TeRaster* rasterIn=0, TeRaster* rasterOut=0, 
+    bool showProgress = false);
+
+	//! Sets the input raster
+	void setInput(TeRaster* rasterIn)
+	{	
+		rasterIn_ = rasterIn; 
+		if (transformer_)
+			transformer_->setRasterIn(rasterIn_);
+	}
+	
+	//! Sets the output raster
+	void setOutput(TeRaster* rasterOut)
+	{	
+		rasterOut_ = rasterOut; 
+		if (transformer_)
+			transformer_->setRasterOut(rasterOut_);
+	}
+	
+	//! Sets the interpolation flag
+	void setInterpolation(int interpolation)
+	{	interpolation_ = interpolation; }
+
+	//! Sets the transformation to be used when doing remap
+	void setTransformer(TeRasterTransform* transf)
+	{	
+		if (transf)
+		{
+			transformer_ = transf; 
+			transformer_->setRasterOut(rasterOut_);
+			transformer_->setRasterIn(rasterIn_);
+		}
+	}
+	
+	//! Returns the transformation to be used when doing remap
+	TeRasterTransform* transformer()
+	{	return transformer_;	}
+
+	//! Applies the remaping
+	bool apply(bool showProgress = false);
+
+	//! Defines a region of interest where the remmaping should be done
+	/*
+		\par roi a box that represents the region of interest. It should
+		be inside the raster in bounding box;
+		\return false if the roi in invalid or it is not within the input
+		raster. True otherwise
+	*/
+	bool setROI(TeBox& roi);
+  
+  //! Enable/disable the use of a opmized reprojection algorithm.
+  /*
+    \param enabled Enabled/disabled flag (default:enabled).
+  */  
+  void setOptmizedReprojection( bool enabled )
+  {
+    useOptimizedReprojection_ = enabled;
+  };
+};
+
+#endif
+
diff --git a/src/terralib/kernel/TeRasterTransform.cpp b/src/terralib/kernel/TeRasterTransform.cpp
old mode 100755
new mode 100644
index 1ba3381..e2b7ef7
--- a/src/terralib/kernel/TeRasterTransform.cpp
+++ b/src/terralib/kernel/TeRasterTransform.cpp
@@ -1,148 +1,148 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeRasterTransform.h"
-#include "TeVisual.h"
-
-void 
-TeRasterTransform::generateLUT(TeLegendEntryVector& legs, unsigned int nentries, TeColor& backColor)
-{
-	// find the range covered by the legends
-	unsigned int n;
-	double vmin = TeMAXFLOAT;
-	double vmax = TeMINFLOAT;
-	for (n=0; n <legs.size(); n++)	
-	{
-		if (atof(legs[n].slice().from_.c_str()) < vmin)
-			vmin = atof(legs[n].slice().from_.c_str());
-		if (atof(legs[n].slice().to_.c_str()) > vmax)
-			vmax = atof(legs[n].slice().to_.c_str());
-	}
-	// do a linear transformation from the range defined by the legend to the number of entries
-	this->setLinearTransfParameters(vmin,vmax, 0, nentries-1);
-
-	// initialize lut with the background color
-	lutr_.clear();
-	lutg_.clear();
-	lutb_.clear();
-
-	lutr_.insert(lutr_.begin(),nentries,backColor.red_);
-	lutg_.insert(lutg_.begin(),nentries,backColor.green_);
-	lutb_.insert(lutb_.begin(),nentries,backColor.blue_);
-
-	// to each entry define its equivalent range of indexes on the LUT
-	int nunIndx = 0;
-	int indexFrom, indexTo;
-	for (n=0; n <legs.size(); n++)
-	{
-		// find the range of entries that
-		indexFrom = (int)(atof(legs[n].slice().from_.c_str()) * gain_ + offset_);
-		if (indexFrom < 0)
-			indexFrom = 0;
-		indexTo = (int)(atof(legs[n].slice().to_.c_str()) * gain_ + offset_);
-		if (indexTo > (int)nentries)
-			indexTo = nentries;
-		nunIndx = indexTo - indexFrom + 1;
-		if (nunIndx >= 1)
-		{
-			fill_n(&lutr_[indexFrom],nunIndx,legs[n].getVisualMap()[TePOLYGONS]->color().red_);
-			fill_n(&lutg_[indexFrom],nunIndx,legs[n].getVisualMap()[TePOLYGONS]->color().green_);
-			fill_n(&lutb_[indexFrom],nunIndx,legs[n].getVisualMap()[TePOLYGONS]->color().blue_);
-		}
-	}
-	lutSize_ = lutr_.size();
-}
-
-TeRasterTransform::TeRasterTransfFunctions TeRasterTransform::getTransfFunction()
-{
-	if (transfFuncPtr_ == 0)
-		return TeNoTransf;
-
-	if (transfFuncPtr_ == &TeRasterTransform::Mono2ThreeBand)
-		return TeMono2Three;
-
-	if (transfFuncPtr_ == &TeRasterTransform::Band2Band)
-		return TeBand2Band;
-
-	if (transfFuncPtr_ == &TeRasterTransform::Pallete2ThreeBand)
-		return TePall2Three;
-
-	if (transfFuncPtr_ == &TeRasterTransform::LUT2ThreeBand)
-		return TeLUT2Three;
-
-	if (transfFuncPtr_ == &TeRasterTransform::ExtractRGB)
-		return TeExtractRGB;
-
-	if (transfFuncPtr_ == &TeRasterTransform::ExtractBand)
-		return TeExtractBand;
-
-	if (transfFuncPtr_ == &TeRasterTransform::ExtractBands)
-		return TeExtractBands;
-
-	if (transfFuncPtr_ == &TeRasterTransform::ThreeBand2LUTThreeBand)
-		return TeThree2LUTThreeBand;
-
-	if (transfFuncPtr_ == &TeRasterTransform::MonoBand2LUTMonoBand)
-		return TeMono2LUTMonoBand;
-
-	if (transfFuncPtr_ == &TeRasterTransform::ThreeBand2RGB)
-		return TeThreeBand2RGB;
-	else
-		return TeNoTransf;
-}
-
-void TeRasterTransform::setTransfFunction(TeRasterTransfFunctions func)
-{
-	if (func == TeMono2Three)
-		transfFuncPtr_ = &TeRasterTransform::Mono2ThreeBand;
-
-	else if (func == TeBand2Band)
-		transfFuncPtr_ = &TeRasterTransform::Band2Band;
-
-	else if (func == TePall2Three)
-		transfFuncPtr_ = &TeRasterTransform::Pallete2ThreeBand; 
-
-	else if (func == TeLUT2Three)
-		transfFuncPtr_ = &TeRasterTransform::LUT2ThreeBand;
-		
-	else if (func == TeExtractRGB)
-		transfFuncPtr_ = &TeRasterTransform::ExtractRGB;
-
-	else if (func == TeExtractBand)
-		transfFuncPtr_ = &TeRasterTransform::ExtractBand;
-
-	else if (func == TeExtractBands)
-		transfFuncPtr_ = &TeRasterTransform::ExtractBands;
-
-	else if (func == TeThreeBand2RGB)
-		transfFuncPtr_ = &TeRasterTransform::ThreeBand2RGB;
-
-	else if (func == TeThree2LUTThreeBand)
-		transfFuncPtr_ = &TeRasterTransform::ThreeBand2LUTThreeBand;
-
-	else if (func == TeMono2LUTMonoBand)
-		transfFuncPtr_ = &TeRasterTransform::MonoBand2LUTMonoBand;
-
-	else
-		transfFuncPtr_ = 0;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeRasterTransform.h"
+#include "TeVisual.h"
+
+void 
+TeRasterTransform::generateLUT(TeLegendEntryVector& legs, unsigned int nentries, TeColor& backColor)
+{
+	// find the range covered by the legends
+	unsigned int n;
+	double vmin = TeMAXFLOAT;
+	double vmax = TeMINFLOAT;
+	for (n=0; n <legs.size(); n++)	
+	{
+		if (atof(legs[n].slice().from_.c_str()) < vmin)
+			vmin = atof(legs[n].slice().from_.c_str());
+		if (atof(legs[n].slice().to_.c_str()) > vmax)
+			vmax = atof(legs[n].slice().to_.c_str());
+	}
+	// do a linear transformation from the range defined by the legend to the number of entries
+	this->setLinearTransfParameters(vmin,vmax, 0, nentries-1);
+
+	// initialize lut with the background color
+	lutr_.clear();
+	lutg_.clear();
+	lutb_.clear();
+
+	lutr_.insert(lutr_.begin(),nentries,backColor.red_);
+	lutg_.insert(lutg_.begin(),nentries,backColor.green_);
+	lutb_.insert(lutb_.begin(),nentries,backColor.blue_);
+
+	// to each entry define its equivalent range of indexes on the LUT
+	int nunIndx = 0;
+	int indexFrom, indexTo;
+	for (n=0; n <legs.size(); n++)
+	{
+		// find the range of entries that
+		indexFrom = (int)(atof(legs[n].slice().from_.c_str()) * gain_ + offset_);
+		if (indexFrom < 0)
+			indexFrom = 0;
+		indexTo = (int)(atof(legs[n].slice().to_.c_str()) * gain_ + offset_);
+		if (indexTo > (int)nentries)
+			indexTo = nentries;
+		nunIndx = indexTo - indexFrom + 1;
+		if (nunIndx >= 1)
+		{
+			fill_n(&lutr_[indexFrom],nunIndx,legs[n].getVisualMap()[TePOLYGONS]->color().red_);
+			fill_n(&lutg_[indexFrom],nunIndx,legs[n].getVisualMap()[TePOLYGONS]->color().green_);
+			fill_n(&lutb_[indexFrom],nunIndx,legs[n].getVisualMap()[TePOLYGONS]->color().blue_);
+		}
+	}
+	lutSize_ = lutr_.size();
+}
+
+TeRasterTransform::TeRasterTransfFunctions TeRasterTransform::getTransfFunction()
+{
+	if (transfFuncPtr_ == 0)
+		return TeNoTransf;
+
+	if (transfFuncPtr_ == &TeRasterTransform::Mono2ThreeBand)
+		return TeMono2Three;
+
+	if (transfFuncPtr_ == &TeRasterTransform::Band2Band)
+		return TeBand2Band;
+
+	if (transfFuncPtr_ == &TeRasterTransform::Pallete2ThreeBand)
+		return TePall2Three;
+
+	if (transfFuncPtr_ == &TeRasterTransform::LUT2ThreeBand)
+		return TeLUT2Three;
+
+	if (transfFuncPtr_ == &TeRasterTransform::ExtractRGB)
+		return TeExtractRGB;
+
+	if (transfFuncPtr_ == &TeRasterTransform::ExtractBand)
+		return TeExtractBand;
+
+	if (transfFuncPtr_ == &TeRasterTransform::ExtractBands)
+		return TeExtractBands;
+
+	if (transfFuncPtr_ == &TeRasterTransform::ThreeBand2LUTThreeBand)
+		return TeThree2LUTThreeBand;
+
+	if (transfFuncPtr_ == &TeRasterTransform::MonoBand2LUTMonoBand)
+		return TeMono2LUTMonoBand;
+
+	if (transfFuncPtr_ == &TeRasterTransform::ThreeBand2RGB)
+		return TeThreeBand2RGB;
+	else
+		return TeNoTransf;
+}
+
+void TeRasterTransform::setTransfFunction(TeRasterTransfFunctions func)
+{
+	if (func == TeMono2Three)
+		transfFuncPtr_ = &TeRasterTransform::Mono2ThreeBand;
+
+	else if (func == TeBand2Band)
+		transfFuncPtr_ = &TeRasterTransform::Band2Band;
+
+	else if (func == TePall2Three)
+		transfFuncPtr_ = &TeRasterTransform::Pallete2ThreeBand; 
+
+	else if (func == TeLUT2Three)
+		transfFuncPtr_ = &TeRasterTransform::LUT2ThreeBand;
+		
+	else if (func == TeExtractRGB)
+		transfFuncPtr_ = &TeRasterTransform::ExtractRGB;
+
+	else if (func == TeExtractBand)
+		transfFuncPtr_ = &TeRasterTransform::ExtractBand;
+
+	else if (func == TeExtractBands)
+		transfFuncPtr_ = &TeRasterTransform::ExtractBands;
+
+	else if (func == TeThreeBand2RGB)
+		transfFuncPtr_ = &TeRasterTransform::ThreeBand2RGB;
+
+	else if (func == TeThree2LUTThreeBand)
+		transfFuncPtr_ = &TeRasterTransform::ThreeBand2LUTThreeBand;
+
+	else if (func == TeMono2LUTMonoBand)
+		transfFuncPtr_ = &TeRasterTransform::MonoBand2LUTMonoBand;
+
+	else
+		transfFuncPtr_ = 0;
+}
diff --git a/src/terralib/kernel/TeRasterTransform.h b/src/terralib/kernel/TeRasterTransform.h
old mode 100755
new mode 100644
index 1614f8d..043119e
--- a/src/terralib/kernel/TeRasterTransform.h
+++ b/src/terralib/kernel/TeRasterTransform.h
@@ -1,435 +1,466 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeRasterTransform.h
-    \brief This file deals with the transformation functions over raster pixels
-*/
-#ifndef  __TERRALIB_INTERNAL_RASTERTRANSFORM_H
-#define  __TERRALIB_INTERNAL_RASTERTRANSFORM_H
-
-#include "TeRaster.h"
-#include "TeLegendEntry.h"
-
-#include <map>
-#include <vector>
-using namespace std;
-
-//! This class defines a way of evaluating the final value of a raster element
-class TL_DLL TeRasterTransform
-{
-public:
-
-	//! The three channels of a display
-	enum TeRGBChannels { TeREDCHANNEL=0, TeGREENCHANNEL=1, TeBLUECHANNEL=2 };
-
-	enum TeRasterTransfFunctions
-	{	TeNoTransf=0, TeMono2Three=1, TeBand2Band=2, TePall2Three=3, TeLUT2Three=4, 
-		TeExtractRGB=5, TeExtractBand=6, TeExtractBands=7, TeThreeBand2RGB=8, 
-		TeThree2LUTThreeBand=9, TeMono2LUTMonoBand=10
-	};
-
-	//! One of the available transformation methods 
-	typedef void (TeRasterTransform::*TransformFunction)(double, double, double, double);
-
-private:
-
-	TeRaster* rasterIn_;			
-	TeRaster* rasterOut_;
-
-	double gain_, offset_;
-
-	map<TeRGBChannels,short> rgbmap_;
-
-	short mband_, mbout_;
-
-	TransformFunction transfFuncPtr_;
-
-	double rmin_, rmax_;
-
-	int lutSize_;
-
-	double contrastR_, contrastG_, contrastB_;
-	double contrastM_;
-
-	unsigned int transp_;
-
-	std::string lutTable_;
-
-public:
-
-	vector<unsigned char> lutr_;
-	vector<unsigned char> lutg_;
-	vector<unsigned char> lutb_;
-
-	//! Constructor 
-	TeRasterTransform(TeRaster* rIn=0, TeRaster* rOut=0):  
-	  rasterIn_(rIn),
-	  rasterOut_(rOut),
-	  gain_(1),
-	  offset_(0),
-	  mband_(0), 
-	  mbout_(0),
-	  transfFuncPtr_(&TeRasterTransform::Band2Band),
-	  rmax_(TeMAXFLOAT),
-	  lutSize_(0),
-	  contrastR_(1.0),
-	  contrastG_(1.0),
-	  contrastB_(1.0),
-	  contrastM_(1.0),
-	  transp_(255),
-	  lutTable_("")
-	  { 
-		  rmin_ = -1 * TeMAXFLOAT;
-	 }
-
-	//! Destructor
-	~TeRasterTransform()
-	{
-		lutr_.clear();
-		lutb_.clear();
-		lutg_.clear();
-		rgbmap_.clear();
-		transfFuncPtr_ = 0;
-	}
-
-	//! Sets the size of the LUT being used
-	void setLutSize(int n)
-	{	lutSize_ = n; }
-
-	//! Gets the size of the LUT being used
-	int getLutSize()
-	{	return lutSize_; }
-
-	//! Sets the input raster
-	void setRasterIn(TeRaster* rIn)
-	{	rasterIn_ = rIn; }
-
-	//! Sets the input raster
-	void setRasterOut(TeRaster* rOut)
-	{	rasterOut_ = rOut; }
-	
-	//! Sets the gain
-	void setGain(double g) 
-	{	gain_= g;	}
-
-	//! Sets the offset
-	void setOffset(double o) 
-	{	offset_= o;	}
-
-	//! Sets the transformation method to be used 
-	void setTransfFunction(TeRasterTransform::TransformFunction transfFuncPtr)
-	{	transfFuncPtr_ = transfFuncPtr; }
-
-	//! Sets the mapping from bands to R,G and B channels 
-	void setRGBmap (map<TeRGBChannels,short>& rgbmap)
-	{
-		if (rgbmap.size() < 3)
-			return;
-		rgbmap_.clear();
-		rgbmap_ = rgbmap;
-	}
-
-	//! Sets the mapping from a particular input band to a particular output channel
-	void setBChannelMapping(short bIn, TeRGBChannels bOut)
-	{
-		rgbmap_[bOut] = bIn;
-	}
-
-	//! Clears current mapping from bands to channel
-	void clearRGBMap()
-	{
-		rgbmap_.clear();
-	}
-
-	//! Returns the mapping from a particular input band to a particular output channel
-	map<TeRGBChannels,short>& getRGBMap()
-	{
-		return rgbmap_;
-	}
-
-	//! Sets the mono band to be transformed
-	void setSrcBand(short n)
-	{ mband_ = n; }
-
-	//! Gets the mono band to be transformed
-	short getSrcBand()
-	{	return mband_; }
-
-	//! Sets the destination of the mono band
-	void setDestBand(short n)
-	{ mbout_ = n; }
-
-	//! Gets the destination of the mono band
-	short getDestBand()
-	{	return mbout_;	}
-	
-	//! Generates a LUT with nentries to display the vector of legends
-	void generateLUT(TeLegendEntryVector& legs, unsigned int nentries, TeColor& backColor);
-
-	//! Set parameters of linear transformation
-	/*!
-		\param vmin smallest input value
-		\param vmax largest input value
-		\param rmin smallest value of the output range
-		\param rmax largest value of the output range
-	*/
-	void setLinearTransfParameters(double vmin, double vmax, double rmin, double rmax)
-	{
-		rmin_ = rmin;
-		rmax_ = rmax;
-		gain_ = (double)(rmax-rmin)/(vmax-vmin);
-		offset_ = -1*gain_*vmin+rmin;
-	}
-
-//--- Simple contrast linear factors
-	void setContrastR(double cR)
-	{	contrastR_ = cR;	}
-	void setContrastG(double cG)
-	{	contrastG_ = cG;	}
-	void setContrastB(double cB)
-	{	contrastB_ = cB;	}
-	void setContrastM(double cM)
-	{	contrastM_ = cM;	}
-
-	double getContrastR()
-	{	return contrastR_;	}
-	double getContrastG()
-	{	return contrastG_;	}
-	double getContrastB()
-	{	return contrastB_;	}
-	double getContrastM()
-	{	return contrastM_;	}
-
-
-	void setTransparency(unsigned int transp)
-	{	transp_ = transp; }
-	unsigned int getTransparency()
-	{	return transp_;	}
-
-
-//-- Lut Table
-	void setLutTableName(const std::string& tableName)
-	{	lutTable_ = tableName; }
-	std::string getLutTableName()
-	{	return lutTable_; }
-
-//---
-
-	//! Applies the selected transformation method
-	void apply(double icol, double ilin, double ocol, double olin)
-	{	(this->*transfFuncPtr_)(icol,ilin,ocol,olin); }
-
-	//! Returns the identifier of the transformation function currently set
-	TeRasterTransfFunctions getTransfFunction();
-
-	//! Sets the associated transformation function from an identifier
-	void setTransfFunction(TeRasterTransfFunctions func);
-
-// --- The transformation functions  available ----
-	//! This transformation repeats the value of the first band in input three bands of the output
-	void Mono2ThreeBand(double icol, double ilin, double ocol, double olin)
-	{
-		double val;
-		if (rasterIn_->getElement((int)icol,(int)ilin,val,mband_))
-		{
-			val = (val*gain_ + offset_)*contrastM_;
-			if (val < rmin_)
-				val = rmin_;
-			else if (val > rmax_)
-				val = rmax_;
-			rasterOut_->setElement((int)ocol,(int)olin, val, val, val, transp_);
-		}
-	}
-
-	//! This transformation repeats the value of each band in input to the same band in output
-	void Band2Band(double icol, double ilin, double ocol, double olin)
-	{
-		double val;
-		int n = rasterOut_->params().nBands();
-		for (int i=0; i<n; i++)
-			if (rasterIn_->getElement((int)icol,(int)ilin,val,i))
-			{
-				val = val*gain_ + offset_;
-				if (val < rmin_)
-					val = rmin_;
-				else if (val > rmax_)
-					val = rmax_;
-				rasterOut_->setElement((int)ocol,(int)olin,val,i);
-			}
-	}
-
-	//! This transformation repeats the value of the raster LUT in input to the first 3 bands of output
-	void Pallete2ThreeBand(double icol, double ilin, double ocol, double olin)
-	{
-		double val;
-		if (rasterIn_->getElement((int)icol,(int)ilin,val))
-		{
-			if (val>= 0 && (unsigned int)val < rasterIn_->params().lutr_.size())
-			{
-				rasterOut_->setElement((int)ocol,(int)olin,rasterIn_->params().lutr_[(int)val],
-														   rasterIn_->params().lutg_[(int)val],
-														   rasterIn_->params().lutb_[(int)val], transp_);
-			}
-		}
-	}
-
-	//! This transformation repeats the value of the first band in input three bands of the output
-	void ThreeBand2RGB(double icol, double ilin, double ocol, double olin)
-	{
-		double valR, valG, valB;
-		bool flag = rasterIn_->getElement((int)icol,(int)ilin,valR,0);
-		flag = rasterIn_->getElement((int)icol,(int)ilin,valG,1) || flag;
-		flag = rasterIn_->getElement((int)icol,(int)ilin,valB,2) || flag;
-
-		if (flag)
-			rasterOut_->setElement((int)ocol,(int)olin, (valR*gain_ + offset_)*contrastR_, 
-														(valG*gain_ + offset_)*contrastG_, 
-														(valB*gain_ + offset_)*contrastB_, transp_);
-	}
-
-	//! This transformation repeats the value of an external LUT to the first 3 bands of output
-	void LUT2ThreeBand(double icol, double ilin, double ocol, double olin)
-	{
-		double idx, val; 
-		if (rasterIn_->getElement((int)icol,(int)ilin,val,mband_))
-		{
-			idx = (val*gain_) + offset_;
-			if (idx >= 0 && idx < lutSize_)
-			{
-				rasterOut_->setElement((int)ocol,(int)olin,lutr_[(int)idx]*contrastR_,
-														   lutg_[(int)idx]*contrastG_,
-														   lutb_[(int)idx]*contrastB_, transp_);
-			}
-		}
-	}
-
-	
-	void ThreeBand2LUTThreeBand(double icol, double ilin, double ocol, double olin)
-	{
-		double idxR, valR;
-		double idxG, valG;
-		double idxB, valB;
-		double outR = 0.;
-		double outG = 0.;
-		double outB = 0.;
-
-		if(rgbmap_.empty())
-		{
-			return;
-		}
-
-		bool flag = rasterIn_->getElement((int)icol,(int)ilin,valR,rgbmap_[TeREDCHANNEL]);
-
-		idxR = (valR*gain_) + offset_;
-		if (idxR >= 0 && idxR < lutSize_)
-		{
-			outR = lutr_[(int)idxR]*contrastR_;
-		}
-
-		flag = rasterIn_->getElement((int)icol,(int)ilin,valG,rgbmap_[TeGREENCHANNEL]) || flag;
-
-		idxG = (valG*gain_) + offset_;
-		if (idxG >= 0 && idxG < lutSize_)
-		{
-			outG = lutg_[(int)idxG]*contrastG_;
-		}
-
-		flag = rasterIn_->getElement((int)icol,(int)ilin,valB,rgbmap_[TeBLUECHANNEL]) || flag;
-
-		idxB = (valB*gain_) + offset_;
-		if (idxB >= 0 && idxB < lutSize_)
-		{
-			outB = lutb_[(int)idxB]*contrastB_;
-		}
-
-		if (flag)
-			rasterOut_->setElement((int)ocol,(int)olin, outR, outG, outB, transp_);
-
-	}
-
-	void MonoBand2LUTMonoBand(double icol, double ilin, double ocol, double olin)
-	{
-		double idxMono, valMono;
-		double outMono = 0.;
-
-		bool flag = rasterIn_->getElement((int)icol,(int)ilin,valMono,mband_);
-
-		if(flag)
-		{
-			idxMono = (valMono*gain_) + offset_;
-			if (idxMono >= 0 && idxMono < lutSize_)
-			{
-				outMono = lutr_[(int)idxMono]*contrastR_;
-			}
-
-			rasterOut_->setElement((int)ocol,(int)olin, outMono, outMono, outMono, transp_);
-		}
-	}
-
-	// This transformation is used to define a particular mapping from input bands to RGB channels
-	void ExtractRGB(double icol, double ilin, double ocol, double olin)
-	{
-		double valR, valG, valB;
-		bool flag = rasterIn_->getElement((int)icol,(int)ilin,valR,rgbmap_[TeREDCHANNEL]);
-		     flag = rasterIn_->getElement((int)icol,(int)ilin,valG,rgbmap_[TeGREENCHANNEL]) || flag;
-		     flag = rasterIn_->getElement((int)icol,(int)ilin,valB,rgbmap_[TeBLUECHANNEL]) || flag;
-
-		if (flag)
-			rasterOut_->setElement((int)ocol,(int)olin, (valR*gain_ + offset_)*contrastR_, 
-														(valG*gain_ + offset_)*contrastG_, 
-														(valB*gain_ + offset_)*contrastB_, transp_);
-	}
-
-	//! This transformation repeats the value of a particular band in input to a particular band of the output
-	void ExtractBand(double icol, double ilin, double ocol, double olin)
-	{
-		double val;
-		if (rasterIn_->getElement((int)icol,(int)ilin,val,mband_))
-		{
-			val = val*gain_ + offset_;
-			if (val < rmin_)
-				val = rmin_;
-			else if (val > rmax_)
-				val = rmax_;
-			rasterOut_->setElement((int)ocol,(int)olin,val*contrastM_,mbout_);
-		}
-	}
-
-	// This transformation extracts selected bands of the input raster and 
-	// writes each to a particular band of the output
-	void ExtractBands(double icol, double ilin, double ocol, double olin)
-	{
-		double val;
-		map<TeRGBChannels,short>::iterator it = rgbmap_.begin();
-		while (it != rgbmap_.end())
-		{
-			if (rasterIn_->getElement((int)icol,(int)ilin,val,it->second))
-				rasterOut_->setElement((int)ocol,(int)olin,val,it->first);
-
-			++it;
-		}
-	}
-
-};
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeRasterTransform.h
+    \brief This file deals with the transformation functions over raster pixels
+*/
+#ifndef  __TERRALIB_INTERNAL_RASTERTRANSFORM_H
+#define  __TERRALIB_INTERNAL_RASTERTRANSFORM_H
+
+#include "TeRaster.h"
+#include "TeLegendEntry.h"
+
+#include <map>
+#include <vector>
+using namespace std;
+
+//! This class defines a way of evaluating the final value of a raster element
+class TL_DLL TeRasterTransform
+{
+public:
+
+	//! The three channels of a display
+	enum TeRGBChannels { TeREDCHANNEL=0, TeGREENCHANNEL=1, TeBLUECHANNEL=2 };
+
+	enum TeRasterTransfFunctions
+	{	TeNoTransf=0, TeMono2Three=1, TeBand2Band=2, TePall2Three=3, TeLUT2Three=4, 
+		TeExtractRGB=5, TeExtractBand=6, TeExtractBands=7, TeThreeBand2RGB=8, 
+		TeThree2LUTThreeBand=9, TeMono2LUTMonoBand=10
+	};
+
+	//! One of the available transformation methods 
+	typedef void (TeRasterTransform::*TransformFunction)(double, double, double, double);
+
+private:
+
+	TeRaster* rasterIn_;			
+	TeRaster* rasterOut_;
+
+	double gain_, offset_;
+
+	map<TeRGBChannels,short> rgbmap_;
+
+	short mband_, mbout_;
+
+	TransformFunction transfFuncPtr_;
+
+	double rmin_, rmax_;
+
+	int lutSize_;
+
+	double contrastR_, contrastG_, contrastB_;
+	double contrastM_;
+
+	unsigned int transp_;
+
+	std::string lutTable_;
+
+public:
+
+	vector<unsigned char> lutr_;
+	vector<unsigned char> lutg_;
+	vector<unsigned char> lutb_;
+
+	//! Constructor 
+	TeRasterTransform(TeRaster* rIn=0, TeRaster* rOut=0):  
+	  rasterIn_(rIn),
+	  rasterOut_(rOut),
+	  gain_(1),
+	  offset_(0),
+	  mband_(0), 
+	  mbout_(0),
+	  transfFuncPtr_(&TeRasterTransform::Band2Band),
+	  rmax_(TeMAXFLOAT),
+	  lutSize_(0),
+	  contrastR_(1.0),
+	  contrastG_(1.0),
+	  contrastB_(1.0),
+	  contrastM_(1.0),
+	  transp_(255),
+	  lutTable_("")
+	  { 
+		  rmin_ = -1 * TeMAXFLOAT;
+	 }
+
+	//! Destructor
+	~TeRasterTransform()
+	{
+		lutr_.clear();
+		lutb_.clear();
+		lutg_.clear();
+		rgbmap_.clear();
+		transfFuncPtr_ = 0;
+	}
+
+	//! Sets the size of the LUT being used
+	void setLutSize(int n)
+	{	lutSize_ = n; }
+
+	//! Gets the size of the LUT being used
+	int getLutSize()
+	{	return lutSize_; }
+
+	//! Sets the input raster
+	void setRasterIn(TeRaster* rIn)
+	{	rasterIn_ = rIn; }
+
+	//! Sets the input raster
+	void setRasterOut(TeRaster* rOut)
+	{	rasterOut_ = rOut; }
+	
+	//! Sets the gain
+	void setGain(double g) 
+	{	gain_= g;	}
+
+	//! Gets the gain
+	double getGain() const
+	{	return gain_;	}
+
+	//! Sets the offset
+	void setOffset(double o) 
+	{	offset_= o;	}
+
+	//! Gets the offset
+	double getOffset() const
+	{	return offset_;	}
+
+	//! Sets the transformation method to be used 
+	void setTransfFunction(TeRasterTransform::TransformFunction transfFuncPtr)
+	{	transfFuncPtr_ = transfFuncPtr; }
+
+	//! Sets the mapping from bands to R,G and B channels 
+	void setRGBmap (map<TeRGBChannels,short>& rgbmap)
+	{
+		rgbmap_.clear();
+		rgbmap_[TeREDCHANNEL] = -1;
+		rgbmap_[TeGREENCHANNEL] = -1;
+		rgbmap_[TeBLUECHANNEL] = -1;
+
+		map<TeRGBChannels,short>::iterator it = rgbmap.begin();
+		while (it != rgbmap.end())
+		{
+			if (it->first == TeREDCHANNEL)
+				rgbmap_[TeREDCHANNEL] = it->second;
+
+			else if (it->first == TeGREENCHANNEL)
+				rgbmap_[TeGREENCHANNEL] = it->second;
+
+			else if (it->first == TeBLUECHANNEL)
+				rgbmap_[TeBLUECHANNEL] = it->second;
+			++it;
+		}
+	}
+
+	//! Sets the mapping from a particular input band to a particular output channel
+	void setBChannelMapping(short bIn, TeRGBChannels bOut)
+	{
+		rgbmap_[bOut] = bIn;
+	}
+
+	//! Clears current mapping from bands to channel
+	void clearRGBMap()
+	{
+		rgbmap_.clear();
+	}
+
+	//! Returns the mapping from a particular input band to a particular output channel
+	map<TeRGBChannels,short>& getRGBMap()
+	{
+		return rgbmap_;
+	}
+
+	//! Sets the mono band to be transformed
+	void setSrcBand(short n)
+	{ mband_ = n; }
+
+	//! Gets the mono band to be transformed
+	short getSrcBand()
+	{	return mband_; }
+
+	//! Sets the destination of the mono band
+	void setDestBand(short n)
+	{ mbout_ = n; }
+
+	//! Gets the destination of the mono band
+	short getDestBand()
+	{	return mbout_;	}
+	
+	//! Generates a LUT with nentries to display the vector of legends
+	void generateLUT(TeLegendEntryVector& legs, unsigned int nentries, TeColor& backColor);
+
+	//! Set parameters of linear transformation
+	/*!
+		\param vmin smallest input value
+		\param vmax largest input value
+		\param rmin smallest value of the output range
+		\param rmax largest value of the output range
+	*/
+	void setLinearTransfParameters(double vmin, double vmax, double rmin, double rmax)
+	{
+		rmin_ = rmin;
+		rmax_ = rmax;
+		gain_ = (double)(rmax-rmin)/(vmax-vmin);
+		offset_ = -1*gain_*vmin+rmin;
+	}
+
+//--- Simple contrast linear factors
+	void setContrastR(double cR)
+	{	contrastR_ = cR;	}
+	void setContrastG(double cG)
+	{	contrastG_ = cG;	}
+	void setContrastB(double cB)
+	{	contrastB_ = cB;	}
+	void setContrastM(double cM)
+	{	contrastM_ = cM;	}
+
+	double getContrastR()
+	{	return contrastR_;	}
+	double getContrastG()
+	{	return contrastG_;	}
+	double getContrastB()
+	{	return contrastB_;	}
+	double getContrastM()
+	{	return contrastM_;	}
+
+
+	void setTransparency(unsigned int transp)
+	{	transp_ = transp; }
+	unsigned int getTransparency()
+	{	return transp_;	}
+
+
+//-- Lut Table
+	void setLutTableName(const std::string& tableName)
+	{	lutTable_ = tableName; }
+	std::string getLutTableName()
+	{	return lutTable_; }
+
+//---
+
+	//! Applies the selected transformation method
+	void apply(double icol, double ilin, double ocol, double olin)
+	{	(this->*transfFuncPtr_)(icol,ilin,ocol,olin); }
+
+	//! Returns the identifier of the transformation function currently set
+	TeRasterTransfFunctions getTransfFunction();
+
+	//! Sets the associated transformation function from an identifier
+	void setTransfFunction(TeRasterTransfFunctions func);
+
+// --- The transformation functions  available ----
+	//! This transformation repeats the value of the first band in input three bands of the output
+	void Mono2ThreeBand(double icol, double ilin, double ocol, double olin)
+	{
+		double val;
+		if (rasterIn_->getElement((int)icol,(int)ilin,val,mband_))
+		{
+			val = (val*gain_ + offset_)*contrastM_;
+			if (val < rmin_)
+				val = rmin_;
+			else if (val > rmax_)
+				val = rmax_;
+			rasterOut_->setElement((int)ocol,(int)olin, val, val, val, transp_);
+		}
+	}
+
+	//! This transformation repeats the value of each band in input to the same band in output
+	void Band2Band(double icol, double ilin, double ocol, double olin)
+	{
+		double val;
+		int n = rasterOut_->params().nBands();
+		for (int i=0; i<n; i++)
+			if (rasterIn_->getElement((int)icol,(int)ilin,val,i))
+			{
+				val = val*gain_ + offset_;
+				if (val < rmin_)
+					val = rmin_;
+				else if (val > rmax_)
+					val = rmax_;
+				rasterOut_->setElement((int)ocol,(int)olin,val,i);
+			}
+	}
+
+	//! This transformation repeats the value of the raster LUT in input to the first 3 bands of output
+	void Pallete2ThreeBand(double icol, double ilin, double ocol, double olin)
+	{
+		double val;
+		if (rasterIn_->getElement((int)icol,(int)ilin,val))
+		{
+			if (val>= 0 && (unsigned int)val < rasterIn_->params().lutr_.size())
+			{
+				rasterOut_->setElement((int)ocol,(int)olin,rasterIn_->params().lutr_[(int)val],
+														   rasterIn_->params().lutg_[(int)val],
+														   rasterIn_->params().lutb_[(int)val], transp_);
+			}
+		}
+	}
+
+	//! This transformation repeats the value of the first band in input three bands of the output
+	void ThreeBand2RGB(double icol, double ilin, double ocol, double olin)
+	{
+		double valR, valG, valB;
+		bool flag = rasterIn_->getElement((int)icol,(int)ilin,valR,0);
+		flag = rasterIn_->getElement((int)icol,(int)ilin,valG,1) || flag;
+		flag = rasterIn_->getElement((int)icol,(int)ilin,valB,2) || flag;
+
+		if (flag)
+			rasterOut_->setElement((int)ocol,(int)olin, (valR*gain_ + offset_)*contrastR_, 
+														(valG*gain_ + offset_)*contrastG_, 
+														(valB*gain_ + offset_)*contrastB_, transp_);
+	}
+
+	//! This transformation repeats the value of an external LUT to the first 3 bands of output
+	void LUT2ThreeBand(double icol, double ilin, double ocol, double olin)
+	{
+		double idx, val; 
+		if (rasterIn_->getElement((int)icol,(int)ilin,val,mband_))
+		{
+			idx = (val*gain_) + offset_;
+			if (idx >= 0 && idx < lutSize_)
+			{
+				rasterOut_->setElement((int)ocol,(int)olin,lutr_[(int)idx]*contrastR_,
+														   lutg_[(int)idx]*contrastG_,
+														   lutb_[(int)idx]*contrastB_, transp_);
+			}
+		}
+	}
+
+	
+	void ThreeBand2LUTThreeBand(double icol, double ilin, double ocol, double olin)
+	{
+		double idxR, valR;
+		double idxG, valG;
+		double idxB, valB;
+		double outR = 0.;
+		double outG = 0.;
+		double outB = 0.;
+
+		if(rgbmap_.empty())
+		{
+			return;
+		}
+
+		bool flag = rasterIn_->getElement((int)icol,(int)ilin,valR,rgbmap_[TeREDCHANNEL]);
+
+		idxR = (valR*gain_) + offset_;
+		if (idxR >= 0 && idxR < lutSize_)
+		{
+			outR = lutr_[(int)idxR]*contrastR_;
+		}
+
+		flag = rasterIn_->getElement((int)icol,(int)ilin,valG,rgbmap_[TeGREENCHANNEL]) || flag;
+
+		idxG = (valG*gain_) + offset_;
+		if (idxG >= 0 && idxG < lutSize_)
+		{
+			outG = lutg_[(int)idxG]*contrastG_;
+		}
+
+		flag = rasterIn_->getElement((int)icol,(int)ilin,valB,rgbmap_[TeBLUECHANNEL]) || flag;
+
+		idxB = (valB*gain_) + offset_;
+		if (idxB >= 0 && idxB < lutSize_)
+		{
+			outB = lutb_[(int)idxB]*contrastB_;
+		}
+
+		if (flag)
+			rasterOut_->setElement((int)ocol,(int)olin, outR, outG, outB, transp_);
+
+	}
+
+	void MonoBand2LUTMonoBand(double icol, double ilin, double ocol, double olin)
+	{
+		double idxMono, valMono;
+		double outMono = 0.;
+
+		bool flag = rasterIn_->getElement((int)icol,(int)ilin,valMono,mband_);
+
+		if(flag)
+		{
+			idxMono = (valMono*gain_) + offset_;
+			if (idxMono >= 0 && idxMono < lutSize_)
+				outMono = lutr_[(int)idxMono]*contrastM_;
+
+			rasterOut_->setElement((int)ocol,(int)olin, outMono, outMono, outMono, transp_);
+		}
+	}
+
+	// This transformation is used to define a particular mapping from input bands to RGB channels
+	void ExtractRGB(double icol, double ilin, double ocol, double olin)
+	{
+		double valR, valG, valB;
+		bool flag = rasterIn_->getElement((int)icol,(int)ilin,valR,rgbmap_[TeREDCHANNEL]);
+		     flag = rasterIn_->getElement((int)icol,(int)ilin,valG,rgbmap_[TeGREENCHANNEL]) || flag;
+		     flag = rasterIn_->getElement((int)icol,(int)ilin,valB,rgbmap_[TeBLUECHANNEL]) || flag;
+
+		if (flag)
+			rasterOut_->setElement((int)ocol,(int)olin, (valR*gain_ + offset_)*contrastR_, 
+														(valG*gain_ + offset_)*contrastG_, 
+														(valB*gain_ + offset_)*contrastB_, transp_);
+	}
+
+	//! This transformation repeats the value of a particular band in input to a particular band of the output
+	void ExtractBand(double icol, double ilin, double ocol, double olin)
+	{
+		double val;
+		if (rasterIn_->getElement((int)icol,(int)ilin,val,mband_))
+		{
+			val = val*gain_ + offset_;
+			if (val < rmin_)
+				val = rmin_;
+			else if (val > rmax_)
+				val = rmax_;
+			rasterOut_->setElement((int)ocol,(int)olin,val*contrastM_,mbout_);
+		}
+	}
+
+	// This transformation extracts selected bands of the input raster and 
+	// writes each to a particular band of the output
+	void ExtractBands(double icol, double ilin, double ocol, double olin)
+	{
+		double val;
+		int bOut;
+		if (rgbmap_[TeREDCHANNEL] != -1)
+		{
+			bOut = 0;
+			if (rasterIn_->getElement((int)icol,(int)ilin,val,rgbmap_[TeREDCHANNEL]))
+				rasterOut_->setElement((int)ocol,(int)olin,val*contrastR_,bOut);
+		}
+		if (rgbmap_[TeGREENCHANNEL] != -1)
+		{
+			bOut = 1;
+			if (rasterIn_->getElement((int)icol,(int)ilin,val,rgbmap_[TeGREENCHANNEL]))
+				rasterOut_->setElement((int)ocol,(int)olin,val*contrastG_,bOut);
+		}
+		if (rgbmap_[TeBLUECHANNEL] != -1)
+		{
+			bOut = 2;
+			if (rasterIn_->getElement((int)icol,(int)ilin,val,rgbmap_[TeBLUECHANNEL]))
+				rasterOut_->setElement((int)ocol,(int)olin,val*contrastB_,bOut);
+		}
+	}
+
+};
+#endif
+
+
diff --git a/src/terralib/kernel/TeRedBlackTree.h b/src/terralib/kernel/TeRedBlackTree.h
old mode 100755
new mode 100644
index adbe1ea..4784284
--- a/src/terralib/kernel/TeRedBlackTree.h
+++ b/src/terralib/kernel/TeRedBlackTree.h
@@ -1,763 +1,763 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file  TeRedBlackTree.h
-    \brief This file contains structures and definitions for a balanced binary search tree.
-    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
-*/
-
-#ifndef  __TERRALIB_INTERNAL_RED_BLACK_TREE_H
-#define  __TERRALIB_INTERNAL_RED_BLACK_TREE_H
-
-//STL's include
-#include <string>
-
-//TerraLib's include
-#include "TeUtils.h"
-
-using namespace std;
-
-#define PRINT
-
-/** @brief Contains structures and definitions necessary to deal with a balanced Binary Search Tree
-*/
-namespace TeREDBLACK
-{
-
-	//! Possible values for a node color in a red-black tree
-	enum TeRBNodeColor { TeREDNODE, TeBLACKNODE };
-
-	//! Template class for nodes in a Red-Black tree.
-	/*!
-		This class contains the common attributes to a node
-		used by a binary tree. Only used for commom binary trees,
-		if you want a more sophisticated tree, you can continue
-		using the Red-Black Tree framework defined below, it is possible
-		taking care of some default attributes that a node must
-		have to implement (left_, right_, parent_, data_).
-	*/
-	template<class T>
-	class TeRedBlackNode
-	{
-		public:
-
-			//! Export node's data type.
-			typedef T TeRedBlackNodeData;
-
-			//! Node's data.
-			T data_;
-
-			//! Pointer to the left sub-tree.
-			TeRedBlackNode* left_;
-
-			//! Pointer to the right sub-tree.
-			TeRedBlackNode* right_;
-
-			//! Pointeir to the father's node.
-			TeRedBlackNode* parent_;
-
-			//! Node's color (RED or BLACK).
-			TeRBNodeColor color_;
-
-			//! Constructor.
-			TeRedBlackNode(const TeRBNodeColor& color = TeREDNODE)
-				: left_(0), right_(0), parent_(0), color_(color)
-			{
-			}
-
-			//! Constructor.
-			TeRedBlackNode(T& d, const TeRBNodeColor& color = TeREDNODE)
-				: data_(d), left_(0), right_(0), parent_(0), color_(color)
-			{
-			}
-
-
-		private:
-
-			//! No copy allowed
-			TeRedBlackNode(const TeRedBlackNode& other);
-
-			// No copy allowed
-			TeRedBlackNode& operator=(const TeRedBlackNode& other);
-	};
-
-	//! Template class for Red-Black trees.
-	/*!
-		This class contains the common operations in a Red-Black Tree.
-		It can be used like a framework. Extend the methods like
-		"Insert" and "Search" to walk and to do some usefull things.
-		You will use the methods for Rotation, Insert Propagation,
-		Delete Propagation, Sucessor, Predecessor, IsEmpty, Clear.
-		This tree is based on the algorithm of Cormen's book. The only difference is
-		when a node being deleted has two children its successor node is relinked into its place,
-		rather than copied, so that the only iterators invalidated are those referring to the deleted node.
-		Every data used in nodes must implements a ToString() method.
-	*/
-	template<class NODE>
-	class TeRBTree
-	{
-		private:
-
-			//! No copy allowed.
-			TeRBTree(const TeRBTree& other);
-
-			//! No copy allowed.
-			TeRBTree& operator=(const TeRBTree& other);
-
-		protected:
-
-			NODE* nil_;		//!< Reference node.			
-			NODE* root_;	//!< Tree's root.			
-			unsigned int nodeCount_;	//!< Count the number of nodes in the tree (excluding nil_ node).
-
-		public:
-
-			//! Export node type.
-			typedef NODE* REDBLACKNODEPOINTER;
-
-			//! Export node data type.
-			typedef typename NODE::TeRedBlackNodeData TeRedBlackNodeData;
-
-			//! Constructor.
-			TeRBTree()
-				: nodeCount_(0)
-			{
-				nil_ = new NODE();
-				nil_->color_ = TeBLACKNODE;
-
-				root_ = nil_;
-
-			}
-
-			//! Destructor.
-			virtual ~TeRBTree()
-			{
-				Clear();
-
-				if(nil_)
-					delete nil_;
-			}
-
-			//! Returns true if the tree is empty otherwise returns false.
-			bool IsEmpty(void) const
-			{
-				return root_ == nil_;
-			}
-
-			//! Returns the number of nodes in the tree, excluding the nil_ one.
-			unsigned int Size(void) const
-			{
-				return nodeCount_;
-			}
-
-			//! Removes the node from the tree and do rebalancing.
-			virtual void Delete(NODE* z)
-			{
-				if(z)
-				{
-					// z has at most one non-null child. y == z.
-					// x might be null.
-					// z has exactly one non-null child.  y == z.
-					// x is not null.
-					// z has two non-null children.  Set y to
-					//   z's successor.  x might be null.
-					NODE* y = ((z->left_ == nil_) || (z->right_ == nil_)) ? z : Successor(z);
-					NODE* x = (y->left_  != nil_) ?  y->left_ : y->right_;
-					NODE* x_parent = 0;
-
-					if(y != z)	// relink y in place of z.  y is z's successor
-					{
-						z->left_->parent_ = y;
-						y->left_ = z->left_;
-						if(y != z->right_)
-						{
-							x_parent = y->parent_;
-
-							if(x != nil_)
-								x->parent_ = y->parent_;
-
-							y->parent_->left_ = x;      // y must be a left child
-							y->right_ = z->right_;
-							z->right_->parent_ = y;
-						}
-						else
-							x_parent = y;
-
-						if(root_ == z)
-							root_ = y;
-						else
-							if(z->parent_->left_ == z)
-								z->parent_->left_ = y;
-							else
-								z->parent_->right_ = y;
-
-						y->parent_ = z->parent_;
-
-						TeRBNodeColor aux_color = y->color_;
-						y->color_ = z->color_;
-						z->color_ = aux_color;
-
-						y = z;
-
-						// y now points to node to be actually deleted
-					}
-					else
-					{                        // y == z
-						x_parent = y->parent_;
-						if(x != nil_)
-							x->parent_ = y->parent_;
-
-						if(root_ == z)
-							root_ = x;
-						else
-							if(z->parent_->left_ == z)
-								z->parent_->left_ = x;
-							else
-								z->parent_->right_ = x;
-					}
-
-					if(y->color_ == TeBLACKNODE)
-						DeleteFixUp(x, x_parent, root_);
-
-					delete y;
-
-					nodeCount_--;
-				}
-
-				return;
-			}
-
-			//! Returns the sucessor of a given node or zero if not.
-			virtual NODE* Successor(NODE* x) const
-			{
-				if(x)
-				{
-					if(x->right_ != nil_)
-					{
-						x = x->right_;
-
-						while(x->left_ != nil_)
-							x = x->left_;
-
-						return x;
-					}
-
-					NODE* y = x->parent_;
-
-					while((y != nil_) && (x == y->right_))
-					{
-						x = y;
-						y = y->parent_;
-					}
-
-					if(y == nil_)
-						return 0;
-
-					return y;
-				}
-
-				return 0;
-			}
-
-			//! Returns the predecessor of a given node or zero if not.
-			virtual NODE* Predecessor(NODE* x) const
-			{
-				if(x)
-				{
-					if(x->left_ != nil_)
-					{
-						x = x->left_;
-
-						while(x->right_ != nil_)
-							x = x->right_;
-
-						return x;
-					}
-
-					NODE* y = x->parent_;
-
-					while((y != nil_) && (x == y->left_))
-					{
-						x = y;
-						y = y->parent_;
-					}
-
-					if(y == nil_)
-						return 0;
-
-					return y;
-				}
-
-				return 0;
-			}
-
-			//! Returns the leftmost node in the tree, or zero if not.
-			NODE* First(void) const
-			{
-				if(IsEmpty())
-					return 0;
-
-				NODE *x = root_;
-
-				while(x->left_ != nil_)
-					x = x->left_;
-
-				return x;
-			}
-
-			//! Returns the rightmost node in the tree, or zero if not.
-			NODE* Last(void) const
-			{
-				if(IsEmpty())
-					return 0;
-
-				NODE *x = root_;
-
-				while(x->right_ != nil_)
-					x = x->right_;
-
-				return x;
-			}
-
-			//! Return the first element in the tree and removes it.
-			virtual bool GetFirst(TeRedBlackNodeData& d)
-			{
-				NODE *x = First();
-
-				if(x)
-				{
-						d = x->data_;
-
-						Delete(x);
-
-						return true;
-				}
-
-				return false;
-			}
-
-			//! Removes all nodes from the tree (excepty the nil node). Clear memory.
-			void Clear(void)
-			{
-				if(!IsEmpty())
-				{
-					Erase(root_);
-
-					root_ = nil_;
-				}
-
-				return;
-			}
-
-			//! Write the node's data to a file. The data must implement a methos called: void ToString(void).
-			virtual void WriteToFile(const string& fileName) const
-			{
-				string strRepres = "";
-		
-				WriteToFile(root_, strRepres);
-
-				TeWriteToFile(fileName, strRepres, "w");
-				
-				return;
-			}
-
-		protected:
-
-			//! Left rotation.
-			virtual void LeftRotate(NODE* x, NODE*& root)
-			{
-				NODE* y = x->right_;
-
-				x->right_ = y->left_;
-	
-				if(y->left_ != nil_)
-					y->left_->parent_ = x;
-
-				y->parent_ = x->parent_;
-
-
-				if(x == root)
-					root = y;
-				else
-				{
-					if(x == x->parent_->left_)
-						x->parent_->left_ = y;
-					else
-						x->parent_->right_ = y;
-				}
-
-				y->left_ = x;
-				x->parent_ = y;
-
-				return;
-			}
-
-			//! Right rotation.
-			virtual void RightRotate(NODE* y, NODE*& root)
-			{
-				NODE* x = y->left_;
-
-				y->left_ = x->right_;
-
-				if(x->right_ != nil_)
-					x->right_->parent_ = y;
-
-				x->parent_ = y->parent_;
-
-				if(y == root)
-					root = x;
-				else
-				{
-					if(y == y->parent_->right_)
-						y->parent_->right_ = x;
-					else
-						y->parent_->left_ = x;
-				}
-
-				x->right_ = y;
-				y->parent_ = x;
-			
-				return;
-			}
-
-			//! Must be called after an insert, to fix-up the tree.
-			void InsertFixUp(NODE*& n, NODE*& root)
-			{
-				n->color_ = TeREDNODE;
-
-				NODE* y;
-       
-				while ((n != root) && (n->parent_->color_ == TeREDNODE))
-				{
-					if(n->parent_ == n->parent_->parent_->left_)	
-					{											
-						y = n->parent_->parent_->right_;			
-						if(y->color_ == TeREDNODE)			
-						{							
-							n->parent_->color_ = TeBLACKNODE;
-							y->color_ = TeBLACKNODE;
-							n = n->parent_->parent_;
-							n->color_ = TeREDNODE;
-						}
-						else
-						{
-							if(n == n->parent_->right_)
-							{						
-								n = n->parent_;		
-								LeftRotate(n, root);
-							}
-
-							n->parent_->color_ = TeBLACKNODE;
-							n->parent_->parent_->color_ = TeREDNODE;
-							RightRotate(n->parent_->parent_, root);
-						}
-					}
-					else
-					{
-						y = n->parent_->parent_->left_;
-						if(y->color_ == TeREDNODE)
-						{
-							n->parent_->color_ = TeBLACKNODE;
-							y->color_ = TeBLACKNODE;
-							n = n->parent_->parent_;
-							n->color_ = TeREDNODE;
-						}
-						else
-						{
-							if(n == n->parent_->left_)
-							{
-								n = n->parent_;
-								RightRotate(n, root);
-			                }
-
-							n->parent_->color_ = TeBLACKNODE;
-							n->parent_->parent_->color_ = TeREDNODE;
-							LeftRotate(n->parent_->parent_, root);
-						}
-					}
-				}
-
-				root->color_ = TeBLACKNODE;
-
-				return;
-			}
-
-			//! Must be called after a deletion, to fix-up the tree.
-			void DeleteFixUp(NODE* x, NODE* x_parent, NODE*& root)
-			{
-				while((x != root) && (x == nil_ || x->color_ == TeBLACKNODE))
-				{
-					if(x == x_parent->left_)
-					{
-						NODE *w = x_parent->right_;
-
-						if(w->color_ == TeREDNODE)
-				        {
-							w->color_ = TeBLACKNODE;
-							x_parent->color_ = TeREDNODE;
-							LeftRotate(x_parent, root);
-							w = x_parent->right_;
-				        }
-		            
-						if((w->left_ == nil_ || w->left_->color_ == TeBLACKNODE) && (w->right_ == nil_ || w->right_->color_ == TeBLACKNODE))
-						{
-							w->color_ = TeREDNODE;
-							x = x_parent;
-							x_parent = x_parent->parent_;
-						}
-						else
-				        {
-							if(w->right_ == nil_ || w->right_->color_ == TeBLACKNODE)
-					        {
-								if(w->left_ != nil_)
-									w->left_->color_ = TeBLACKNODE;
-
-								w->color_ = TeREDNODE;
-								RightRotate(w, root);
-								w = x_parent->right_;
-						    }
-						   
-							w->color_ = x_parent->color_;
-							x_parent->color_ = TeBLACKNODE;
-							
-							if(w->right_ != nil_)
-								w->right_->color_ = TeBLACKNODE;
-
-							LeftRotate(x_parent, root);
-
-							break;
-						}
-					}
-					else
-				    {
-						NODE* w = x_parent->left_;
-
-						if(w->color_ == TeREDNODE)
-				        {
-							w->color_ = TeBLACKNODE;
-							x_parent->color_ = TeREDNODE;
-							RightRotate(x_parent, root);
-							w = x_parent->left_;
-						}
-                
-						if((w->left_ == nil_ || w->left_->color_ == TeBLACKNODE) && (w->right_ == nil_ || w->right_->color_ == TeBLACKNODE))
-						{
-							w->color_ = TeREDNODE;
-							x = x_parent;
-							x_parent = x_parent->parent_;
-						}
-						else
-						{
-							if(w->left_ == nil_ || w->left_->color_ == TeBLACKNODE)
-				            {
-								if(w->right_ != nil_)
-									w->right_->color_ = TeBLACKNODE;
-
-								w->color_ = TeREDNODE;
-								LeftRotate(w, root);
-								w = x_parent->left_;
-							}
-						
-							w->color_ = x_parent->color_;
-							x_parent->color_ = TeBLACKNODE;
-							
-							if(w->left_ != nil_)
-								w->left_->color_ = TeBLACKNODE;
-
-							RightRotate(x_parent, root);
-							
-							break;
-						}
-					}
-				}
-
-				if(x != nil_)
-					x->color_ = TeBLACKNODE;
-			}
-
-			//! Only to be used by the public method, walking on the tree.
-			virtual void WriteToFile(NODE* n, string& strRepres) const
-			{
-				if(n != nil_)
-				{
-					WriteToFile(n->left_, strRepres);
-
-					strRepres += n->data_.ToString();
-					strRepres += '\n';
-
-					WriteToFile(n->right_, strRepres);
-				}
-
-				return;
-			}	
-
-			//! Removes the node and all node below it and doesn't do rebalancing. Used to free the memory.
-			void Erase(NODE* n)
-			{
-				if(n != nil_)
-				{
-					Erase(n->left_);
-					Erase(n->right_);
-
-					delete n;
-
-					nodeCount_--;
-				}
-
-				return;
-			}
-
-		public:
-
-			//! Iterators class for the tree. It is used to abstract walking on the tree.
-			template<class Node_i> class internal_iterator
-			{
-				protected:
-
-					//! Pointer to the tree.
-					TeRBTree<Node_i>* tree_;
-
-					//! Pointer to the node.
-					Node_i* node_;
-
-				public:
-
-					//! Makes iterator invalid
-					void invalid(void)
-					{
-						node_ = 0;
-						return;
-					}
-
-					//! Returns node pointer
-					Node_i* getNode(void) const
-					{
-						return node_;
-					}
-
-				public:
-
-					//! Constructor.
-					internal_iterator()
-						: node_(0), tree_(0)
-					{						
-					}
-					
-					//! Constructor
-					internal_iterator(TeRBTree<Node_i>* tree, Node_i* n)
-						: tree_(tree), node_(n)
-					{
-					}
-
-					//! Destructor.
-					virtual ~internal_iterator()
-					{
-					}
-
-					//! Dereference operator.
-					typename Node_i::TeRedBlackNodeData* operator->() const
-					{
-						return &node_->data_;
-					}
-
-					//! Dereference operator.
-					typename Node_i::TeRedBlackNodeData& operator*() const
-					{
-						return node_->data_;
-					}
-
-					//! Operator ++ pre-fixed.
-					internal_iterator& operator++()
-					{
-						node_ = tree_->Successor(node_);
-
-
-						return *this;
-					}
-
-					//! Operator ++ pos-fixed
-					internal_iterator operator++(int)	
-					{
-						internal_iterator temp = *this;
-						++(*this);
-						
-						return temp;
-					}
-
-					//! Operator -- pre-fixed.
-					internal_iterator& operator--()
-					{
-						node_ = tree_->Predecessor(node_);
-
-
-						return *this;
-					}
-
-					//! Operator -- pos-fixed
-					internal_iterator operator--(int)	
-					{
-						internal_iterator temp = *this;
-						--(*this);
-						return temp;
-					}
-
-					//! Operator ==.
-					bool operator==(const internal_iterator& other) const
-					{
-						return (this->node_ == other.node_);
-					}
-
-					//! Operator !=.
-					bool operator!=(const internal_iterator& other) const
-					{
-						return(this->node_ != other.node_);
-					}
-			};
-
-			//! Exports iterator type.
-			typedef internal_iterator<NODE> iterator;
-
-			//! Returns an iterator to the leftmost node of the tree.
-			iterator begin(void)
-			{
-				return iterator(this, First());
-			}			
-
-			//! Returns a reference iterator indicating the end of a tree.
-			iterator end(void)
-			{
-				return iterator(this, 0);
-			}
-
-			//! Erases a node pointed by an interator.
-			void erase(iterator& it)
-			{
-				Delete(it.getNode());
-
-				it.invalid();
-
-				return;
-			}
-	};
-
-}		// end namespace TeREDBLACK
-#endif	// __TERRALIB_INTERNAL_RED_BLACK_TREE_H
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file  TeRedBlackTree.h
+    \brief This file contains structures and definitions for a balanced binary search tree.
+    \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+*/
+
+#ifndef  __TERRALIB_INTERNAL_RED_BLACK_TREE_H
+#define  __TERRALIB_INTERNAL_RED_BLACK_TREE_H
+
+//STL's include
+#include <string>
+
+//TerraLib's include
+#include "TeUtils.h"
+
+using namespace std;
+
+#define PRINT
+
+/** @brief Contains structures and definitions necessary to deal with a balanced Binary Search Tree
+*/
+namespace TeREDBLACK
+{
+
+	//! Possible values for a node color in a red-black tree
+	enum TeRBNodeColor { TeREDNODE, TeBLACKNODE };
+
+	//! Template class for nodes in a Red-Black tree.
+	/*!
+		This class contains the common attributes to a node
+		used by a binary tree. Only used for commom binary trees,
+		if you want a more sophisticated tree, you can continue
+		using the Red-Black Tree framework defined below, it is possible
+		taking care of some default attributes that a node must
+		have to implement (left_, right_, parent_, data_).
+	*/
+	template<class T>
+	class TeRedBlackNode
+	{
+		public:
+
+			//! Export node's data type.
+			typedef T TeRedBlackNodeData;
+
+			//! Node's data.
+			T data_;
+
+			//! Pointer to the left sub-tree.
+			TeRedBlackNode* left_;
+
+			//! Pointer to the right sub-tree.
+			TeRedBlackNode* right_;
+
+			//! Pointeir to the father's node.
+			TeRedBlackNode* parent_;
+
+			//! Node's color (RED or BLACK).
+			TeRBNodeColor color_;
+
+			//! Constructor.
+			TeRedBlackNode(const TeRBNodeColor& color = TeREDNODE)
+				: left_(0), right_(0), parent_(0), color_(color)
+			{
+			}
+
+			//! Constructor.
+			TeRedBlackNode(T& d, const TeRBNodeColor& color = TeREDNODE)
+				: data_(d), left_(0), right_(0), parent_(0), color_(color)
+			{
+			}
+
+
+		private:
+
+			//! No copy allowed
+			TeRedBlackNode(const TeRedBlackNode& other);
+
+			// No copy allowed
+			TeRedBlackNode& operator=(const TeRedBlackNode& other);
+	};
+
+	//! Template class for Red-Black trees.
+	/*!
+		This class contains the common operations in a Red-Black Tree.
+		It can be used like a framework. Extend the methods like
+		"Insert" and "Search" to walk and to do some usefull things.
+		You will use the methods for Rotation, Insert Propagation,
+		Delete Propagation, Sucessor, Predecessor, IsEmpty, Clear.
+		This tree is based on the algorithm of Cormen's book. The only difference is
+		when a node being deleted has two children its successor node is relinked into its place,
+		rather than copied, so that the only iterators invalidated are those referring to the deleted node.
+		Every data used in nodes must implements a ToString() method.
+	*/
+	template<class NODE>
+	class TeRBTree
+	{
+		private:
+
+			//! No copy allowed.
+			TeRBTree(const TeRBTree& other);
+
+			//! No copy allowed.
+			TeRBTree& operator=(const TeRBTree& other);
+
+		protected:
+
+			NODE* nil_;		//!< Reference node.			
+			NODE* root_;	//!< Tree's root.			
+			unsigned int nodeCount_;	//!< Count the number of nodes in the tree (excluding nil_ node).
+
+		public:
+
+			//! Export node type.
+			typedef NODE* REDBLACKNODEPOINTER;
+
+			//! Export node data type.
+			typedef typename NODE::TeRedBlackNodeData TeRedBlackNodeData;
+
+			//! Constructor.
+			TeRBTree()
+				: nodeCount_(0)
+			{
+				nil_ = new NODE();
+				nil_->color_ = TeBLACKNODE;
+
+				root_ = nil_;
+
+			}
+
+			//! Destructor.
+			virtual ~TeRBTree()
+			{
+				Clear();
+
+				if(nil_)
+					delete nil_;
+			}
+
+			//! Returns true if the tree is empty otherwise returns false.
+			bool IsEmpty(void) const
+			{
+				return root_ == nil_;
+			}
+
+			//! Returns the number of nodes in the tree, excluding the nil_ one.
+			unsigned int Size(void) const
+			{
+				return nodeCount_;
+			}
+
+			//! Removes the node from the tree and do rebalancing.
+			virtual void Delete(NODE* z)
+			{
+				if(z)
+				{
+					// z has at most one non-null child. y == z.
+					// x might be null.
+					// z has exactly one non-null child.  y == z.
+					// x is not null.
+					// z has two non-null children.  Set y to
+					//   z's successor.  x might be null.
+					NODE* y = ((z->left_ == nil_) || (z->right_ == nil_)) ? z : Successor(z);
+					NODE* x = (y->left_  != nil_) ?  y->left_ : y->right_;
+					NODE* x_parent = 0;
+
+					if(y != z)	// relink y in place of z.  y is z's successor
+					{
+						z->left_->parent_ = y;
+						y->left_ = z->left_;
+						if(y != z->right_)
+						{
+							x_parent = y->parent_;
+
+							if(x != nil_)
+								x->parent_ = y->parent_;
+
+							y->parent_->left_ = x;      // y must be a left child
+							y->right_ = z->right_;
+							z->right_->parent_ = y;
+						}
+						else
+							x_parent = y;
+
+						if(root_ == z)
+							root_ = y;
+						else
+							if(z->parent_->left_ == z)
+								z->parent_->left_ = y;
+							else
+								z->parent_->right_ = y;
+
+						y->parent_ = z->parent_;
+
+						TeRBNodeColor aux_color = y->color_;
+						y->color_ = z->color_;
+						z->color_ = aux_color;
+
+						y = z;
+
+						// y now points to node to be actually deleted
+					}
+					else
+					{                        // y == z
+						x_parent = y->parent_;
+						if(x != nil_)
+							x->parent_ = y->parent_;
+
+						if(root_ == z)
+							root_ = x;
+						else
+							if(z->parent_->left_ == z)
+								z->parent_->left_ = x;
+							else
+								z->parent_->right_ = x;
+					}
+
+					if(y->color_ == TeBLACKNODE)
+						DeleteFixUp(x, x_parent, root_);
+
+					delete y;
+
+					nodeCount_--;
+				}
+
+				return;
+			}
+
+			//! Returns the sucessor of a given node or zero if not.
+			virtual NODE* Successor(NODE* x) const
+			{
+				if(x)
+				{
+					if(x->right_ != nil_)
+					{
+						x = x->right_;
+
+						while(x->left_ != nil_)
+							x = x->left_;
+
+						return x;
+					}
+
+					NODE* y = x->parent_;
+
+					while((y != nil_) && (x == y->right_))
+					{
+						x = y;
+						y = y->parent_;
+					}
+
+					if(y == nil_)
+						return 0;
+
+					return y;
+				}
+
+				return 0;
+			}
+
+			//! Returns the predecessor of a given node or zero if not.
+			virtual NODE* Predecessor(NODE* x) const
+			{
+				if(x)
+				{
+					if(x->left_ != nil_)
+					{
+						x = x->left_;
+
+						while(x->right_ != nil_)
+							x = x->right_;
+
+						return x;
+					}
+
+					NODE* y = x->parent_;
+
+					while((y != nil_) && (x == y->left_))
+					{
+						x = y;
+						y = y->parent_;
+					}
+
+					if(y == nil_)
+						return 0;
+
+					return y;
+				}
+
+				return 0;
+			}
+
+			//! Returns the leftmost node in the tree, or zero if not.
+			NODE* First(void) const
+			{
+				if(IsEmpty())
+					return 0;
+
+				NODE *x = root_;
+
+				while(x->left_ != nil_)
+					x = x->left_;
+
+				return x;
+			}
+
+			//! Returns the rightmost node in the tree, or zero if not.
+			NODE* Last(void) const
+			{
+				if(IsEmpty())
+					return 0;
+
+				NODE *x = root_;
+
+				while(x->right_ != nil_)
+					x = x->right_;
+
+				return x;
+			}
+
+			//! Return the first element in the tree and removes it.
+			virtual bool GetFirst(TeRedBlackNodeData& d)
+			{
+				NODE *x = First();
+
+				if(x)
+				{
+						d = x->data_;
+
+						Delete(x);
+
+						return true;
+				}
+
+				return false;
+			}
+
+			//! Removes all nodes from the tree (excepty the nil node). Clear memory.
+			void Clear(void)
+			{
+				if(!IsEmpty())
+				{
+					Erase(root_);
+
+					root_ = nil_;
+				}
+
+				return;
+			}
+
+			//! Write the node's data to a file. The data must implement a methos called: void ToString(void).
+			virtual void WriteToFile(const string& fileName) const
+			{
+				string strRepres = "";
+		
+				WriteToFile(root_, strRepres);
+
+				TeWriteToFile(fileName, strRepres, "w");
+				
+				return;
+			}
+
+		protected:
+
+			//! Left rotation.
+			virtual void LeftRotate(NODE* x, NODE*& root)
+			{
+				NODE* y = x->right_;
+
+				x->right_ = y->left_;
+	
+				if(y->left_ != nil_)
+					y->left_->parent_ = x;
+
+				y->parent_ = x->parent_;
+
+
+				if(x == root)
+					root = y;
+				else
+				{
+					if(x == x->parent_->left_)
+						x->parent_->left_ = y;
+					else
+						x->parent_->right_ = y;
+				}
+
+				y->left_ = x;
+				x->parent_ = y;
+
+				return;
+			}
+
+			//! Right rotation.
+			virtual void RightRotate(NODE* y, NODE*& root)
+			{
+				NODE* x = y->left_;
+
+				y->left_ = x->right_;
+
+				if(x->right_ != nil_)
+					x->right_->parent_ = y;
+
+				x->parent_ = y->parent_;
+
+				if(y == root)
+					root = x;
+				else
+				{
+					if(y == y->parent_->right_)
+						y->parent_->right_ = x;
+					else
+						y->parent_->left_ = x;
+				}
+
+				x->right_ = y;
+				y->parent_ = x;
+			
+				return;
+			}
+
+			//! Must be called after an insert, to fix-up the tree.
+			void InsertFixUp(NODE*& n, NODE*& root)
+			{
+				n->color_ = TeREDNODE;
+
+				NODE* y;
+       
+				while ((n != root) && (n->parent_->color_ == TeREDNODE))
+				{
+					if(n->parent_ == n->parent_->parent_->left_)	
+					{											
+						y = n->parent_->parent_->right_;			
+						if(y->color_ == TeREDNODE)			
+						{							
+							n->parent_->color_ = TeBLACKNODE;
+							y->color_ = TeBLACKNODE;
+							n = n->parent_->parent_;
+							n->color_ = TeREDNODE;
+						}
+						else
+						{
+							if(n == n->parent_->right_)
+							{						
+								n = n->parent_;		
+								LeftRotate(n, root);
+							}
+
+							n->parent_->color_ = TeBLACKNODE;
+							n->parent_->parent_->color_ = TeREDNODE;
+							RightRotate(n->parent_->parent_, root);
+						}
+					}
+					else
+					{
+						y = n->parent_->parent_->left_;
+						if(y->color_ == TeREDNODE)
+						{
+							n->parent_->color_ = TeBLACKNODE;
+							y->color_ = TeBLACKNODE;
+							n = n->parent_->parent_;
+							n->color_ = TeREDNODE;
+						}
+						else
+						{
+							if(n == n->parent_->left_)
+							{
+								n = n->parent_;
+								RightRotate(n, root);
+			                }
+
+							n->parent_->color_ = TeBLACKNODE;
+							n->parent_->parent_->color_ = TeREDNODE;
+							LeftRotate(n->parent_->parent_, root);
+						}
+					}
+				}
+
+				root->color_ = TeBLACKNODE;
+
+				return;
+			}
+
+			//! Must be called after a deletion, to fix-up the tree.
+			void DeleteFixUp(NODE* x, NODE* x_parent, NODE*& root)
+			{
+				while((x != root) && (x == nil_ || x->color_ == TeBLACKNODE))
+				{
+					if(x == x_parent->left_)
+					{
+						NODE *w = x_parent->right_;
+
+						if(w->color_ == TeREDNODE)
+				        {
+							w->color_ = TeBLACKNODE;
+							x_parent->color_ = TeREDNODE;
+							LeftRotate(x_parent, root);
+							w = x_parent->right_;
+				        }
+		            
+						if((w->left_ == nil_ || w->left_->color_ == TeBLACKNODE) && (w->right_ == nil_ || w->right_->color_ == TeBLACKNODE))
+						{
+							w->color_ = TeREDNODE;
+							x = x_parent;
+							x_parent = x_parent->parent_;
+						}
+						else
+				        {
+							if(w->right_ == nil_ || w->right_->color_ == TeBLACKNODE)
+					        {
+								if(w->left_ != nil_)
+									w->left_->color_ = TeBLACKNODE;
+
+								w->color_ = TeREDNODE;
+								RightRotate(w, root);
+								w = x_parent->right_;
+						    }
+						   
+							w->color_ = x_parent->color_;
+							x_parent->color_ = TeBLACKNODE;
+							
+							if(w->right_ != nil_)
+								w->right_->color_ = TeBLACKNODE;
+
+							LeftRotate(x_parent, root);
+
+							break;
+						}
+					}
+					else
+				    {
+						NODE* w = x_parent->left_;
+
+						if(w->color_ == TeREDNODE)
+				        {
+							w->color_ = TeBLACKNODE;
+							x_parent->color_ = TeREDNODE;
+							RightRotate(x_parent, root);
+							w = x_parent->left_;
+						}
+                
+						if((w->left_ == nil_ || w->left_->color_ == TeBLACKNODE) && (w->right_ == nil_ || w->right_->color_ == TeBLACKNODE))
+						{
+							w->color_ = TeREDNODE;
+							x = x_parent;
+							x_parent = x_parent->parent_;
+						}
+						else
+						{
+							if(w->left_ == nil_ || w->left_->color_ == TeBLACKNODE)
+				            {
+								if(w->right_ != nil_)
+									w->right_->color_ = TeBLACKNODE;
+
+								w->color_ = TeREDNODE;
+								LeftRotate(w, root);
+								w = x_parent->left_;
+							}
+						
+							w->color_ = x_parent->color_;
+							x_parent->color_ = TeBLACKNODE;
+							
+							if(w->left_ != nil_)
+								w->left_->color_ = TeBLACKNODE;
+
+							RightRotate(x_parent, root);
+							
+							break;
+						}
+					}
+				}
+
+				if(x != nil_)
+					x->color_ = TeBLACKNODE;
+			}
+
+			//! Only to be used by the public method, walking on the tree.
+			virtual void WriteToFile(NODE* n, string& strRepres) const
+			{
+				if(n != nil_)
+				{
+					WriteToFile(n->left_, strRepres);
+
+					strRepres += n->data_.ToString();
+					strRepres += '\n';
+
+					WriteToFile(n->right_, strRepres);
+				}
+
+				return;
+			}	
+
+			//! Removes the node and all node below it and doesn't do rebalancing. Used to free the memory.
+			void Erase(NODE* n)
+			{
+				if(n != nil_)
+				{
+					Erase(n->left_);
+					Erase(n->right_);
+
+					delete n;
+
+					nodeCount_--;
+				}
+
+				return;
+			}
+
+		public:
+
+			//! Iterators class for the tree. It is used to abstract walking on the tree.
+			template<class Node_i> class internal_iterator
+			{
+				protected:
+
+					//! Pointer to the tree.
+					TeRBTree<Node_i>* tree_;
+
+					//! Pointer to the node.
+					Node_i* node_;
+
+				public:
+
+					//! Makes iterator invalid
+					void invalid(void)
+					{
+						node_ = 0;
+						return;
+					}
+
+					//! Returns node pointer
+					Node_i* getNode(void) const
+					{
+						return node_;
+					}
+
+				public:
+
+					//! Constructor.
+					internal_iterator()
+						: node_(0), tree_(0)
+					{						
+					}
+					
+					//! Constructor
+					internal_iterator(TeRBTree<Node_i>* tree, Node_i* n)
+						: tree_(tree), node_(n)
+					{
+					}
+
+					//! Destructor.
+					virtual ~internal_iterator()
+					{
+					}
+
+					//! Dereference operator.
+					typename Node_i::TeRedBlackNodeData* operator->() const
+					{
+						return &node_->data_;
+					}
+
+					//! Dereference operator.
+					typename Node_i::TeRedBlackNodeData& operator*() const
+					{
+						return node_->data_;
+					}
+
+					//! Operator ++ pre-fixed.
+					internal_iterator& operator++()
+					{
+						node_ = tree_->Successor(node_);
+
+
+						return *this;
+					}
+
+					//! Operator ++ pos-fixed
+					internal_iterator operator++(int)	
+					{
+						internal_iterator temp = *this;
+						++(*this);
+						
+						return temp;
+					}
+
+					//! Operator -- pre-fixed.
+					internal_iterator& operator--()
+					{
+						node_ = tree_->Predecessor(node_);
+
+
+						return *this;
+					}
+
+					//! Operator -- pos-fixed
+					internal_iterator operator--(int)	
+					{
+						internal_iterator temp = *this;
+						--(*this);
+						return temp;
+					}
+
+					//! Operator ==.
+					bool operator==(const internal_iterator& other) const
+					{
+						return (this->node_ == other.node_);
+					}
+
+					//! Operator !=.
+					bool operator!=(const internal_iterator& other) const
+					{
+						return(this->node_ != other.node_);
+					}
+			};
+
+			//! Exports iterator type.
+			typedef internal_iterator<NODE> iterator;
+
+			//! Returns an iterator to the leftmost node of the tree.
+			iterator begin(void)
+			{
+				return iterator(this, First());
+			}			
+
+			//! Returns a reference iterator indicating the end of a tree.
+			iterator end(void)
+			{
+				return iterator(this, 0);
+			}
+
+			//! Erases a node pointed by an interator.
+			void erase(iterator& it)
+			{
+				Delete(it.getNode());
+
+				it.invalid();
+
+				return;
+			}
+	};
+
+}		// end namespace TeREDBLACK
+#endif	// __TERRALIB_INTERNAL_RED_BLACK_TREE_H
diff --git a/src/terralib/kernel/TeRepresentation.cpp b/src/terralib/kernel/TeRepresentation.cpp
old mode 100755
new mode 100644
index 272c41f..b22ac06
--- a/src/terralib/kernel/TeRepresentation.cpp
+++ b/src/terralib/kernel/TeRepresentation.cpp
@@ -1,34 +1,34 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32 
-#pragma warning ( disable: 4786 ) 
-#endif
-
-#include "TeRepresentation.h"
-
-TeRepresPointerVectorIterator 
-TeFindRepresentation(TeRepresPointerVectorIterator begin, TeRepresPointerVectorIterator end, TeGeomRep rep)
-{
-	return find_if(begin,end,TeRepres_eq(rep));
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32 
+#pragma warning ( disable: 4786 ) 
+#endif
+
+#include "TeRepresentation.h"
+
+TeRepresPointerVectorIterator 
+TeFindRepresentation(TeRepresPointerVectorIterator begin, TeRepresPointerVectorIterator end, TeGeomRep rep)
+{
+	return find_if(begin,end,TeRepres_eq(rep));
+}
diff --git a/src/terralib/kernel/TeRepresentation.h b/src/terralib/kernel/TeRepresentation.h
old mode 100755
new mode 100644
index 4d35e78..cb7cb36
--- a/src/terralib/kernel/TeRepresentation.h
+++ b/src/terralib/kernel/TeRepresentation.h
@@ -1,78 +1,78 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeRepresentation.h
-    \brief This file contains structures and definitions to deal with a geometrical representation
-*/
-#ifndef  __TERRALIB_INTERNAL_REPRESENTATION_H
-#define  __TERRALIB_INTERNAL_REPRESENTATION_H
-
-#include "TeDataTypes.h"
-#include "TeBox.h"
-
-#include <algorithm>
-#include <string>
-
-//!  A class to supporting a geometrical representation 
-struct TL_DLL TeRepresentation
-{
-	int id_;				//!< representation unique dabatase identifier
-	TeGeomRep geomRep_;		//!< representation type (
-	std::string	tableName_;		//!< name of the table that stores the geometries associated to this representation
-	TeBox	box_;			//!< representation bounding box
-	std::string	description_;	//!< representation description
-	double	resX_;			//!< the x resolution of the layer cell set geometry
-	double	resY_;			//!< the y resolution of the layer cell set geometry
-	int		nCols_;			//!< number of columns in raster geometry
-	int		nLins_;			//!< number of columns in raster geometry
-
-	//! Constructor
-	TeRepresentation() :
-		resX_(0.0),
-		resY_(0.0),
-		nCols_(0),
-		nLins_(0)
-		{}
-};
-
-//! A functor class to compare representations by its type
-class TL_DLL TeRepres_eq : public unary_function<TeRepresentation*,bool>
-{
-	TeGeomRep r;
-public:
-	explicit TeRepres_eq(TeGeomRep rr): r(rr) {}
-	bool operator()(const TeRepresentation* rep) const { return rep->geomRep_ == r; }
-};
-
-//! An iterator to a std::vector of TeRepresentation 
-typedef std::vector<TeRepresentation* >::iterator TeRepresPointerVectorIterator;
-
-//! A std::vector of pointers to TeRepresentation
-typedef std::vector<TeRepresentation* > TeRepresPointerVector;
-
-//! Finds the first representation of a given type in a std::vector of representations
-TL_DLL TeRepresPointerVectorIterator 
-TeFindRepresentation(TeRepresPointerVectorIterator begin, TeRepresPointerVectorIterator end, TeGeomRep rep);
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeRepresentation.h
+    \brief This file contains structures and definitions to deal with a geometrical representation
+*/
+#ifndef  __TERRALIB_INTERNAL_REPRESENTATION_H
+#define  __TERRALIB_INTERNAL_REPRESENTATION_H
+
+#include "TeDataTypes.h"
+#include "TeBox.h"
+
+#include <algorithm>
+#include <string>
+
+//!  A class to supporting a geometrical representation 
+struct TL_DLL TeRepresentation
+{
+	int id_;				//!< representation unique dabatase identifier
+	TeGeomRep geomRep_;		//!< representation type (
+	std::string	tableName_;		//!< name of the table that stores the geometries associated to this representation
+	TeBox	box_;			//!< representation bounding box
+	std::string	description_;	//!< representation description
+	double	resX_;			//!< the x resolution of the layer cell set geometry
+	double	resY_;			//!< the y resolution of the layer cell set geometry
+	int		nCols_;			//!< number of columns in raster geometry
+	int		nLins_;			//!< number of columns in raster geometry
+
+	//! Constructor
+	TeRepresentation() :
+		resX_(0.0),
+		resY_(0.0),
+		nCols_(0),
+		nLins_(0)
+		{}
+};
+
+//! A functor class to compare representations by its type
+class TL_DLL TeRepres_eq : public unary_function<TeRepresentation*,bool>
+{
+	TeGeomRep r;
+public:
+	explicit TeRepres_eq(TeGeomRep rr): r(rr) {}
+	bool operator()(const TeRepresentation* rep) const { return rep->geomRep_ == r; }
+};
+
+//! An iterator to a std::vector of TeRepresentation 
+typedef std::vector<TeRepresentation* >::iterator TeRepresPointerVectorIterator;
+
+//! A std::vector of pointers to TeRepresentation
+typedef std::vector<TeRepresentation* > TeRepresPointerVector;
+
+//! Finds the first representation of a given type in a std::vector of representations
+TL_DLL TeRepresPointerVectorIterator 
+TeFindRepresentation(TeRepresPointerVectorIterator begin, TeRepresPointerVectorIterator end, TeGeomRep rep);
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeSTEFunctionsDB.h b/src/terralib/kernel/TeSTEFunctionsDB.h
old mode 100755
new mode 100644
index cd3af0b..953fc8b
--- a/src/terralib/kernel/TeSTEFunctionsDB.h
+++ b/src/terralib/kernel/TeSTEFunctionsDB.h
@@ -1,432 +1,432 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library p rovided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSTEFunctionsDB.h
-    \brief This file contains a set of functions to build spatio-temporal sets from a TerraLib databse  
-*/
-#ifndef  __TERRALIB_INTERNAL_STOFUNCTIONS_H
-#define  __TERRALIB_INTERNAL_STOFUNCTIONS_H
-
-#include "TeDatabase.h"
-#include "TeProgress.h"
-#include <vector>
-#include <string>
-
-//! Builds the spatial object set from database according to the restrictions previously defined
-/*! 
-	\param stoset				the STOSet that will be filled 
-	\param loadGeometries		if the STOSet will be filled with the geometries 
-	\param loadAllAttributes	if the STOSet will be filled with all attributes of the tables of the STOSet 
-	\param attrNames			a subset of the attribute names that will be loaded, if the param loadAllAttributes is false 
-*/
-template<typename elementSet>
-bool TeSTOSetBuildDB(elementSet* stoset, bool loadGeometries = false, bool loadAllAttributes = false, vector<string> attrNames = vector<string>());
-
-//! Builds the spatial object set from database according to the restrictions previously defined
-/*! 
-	\param stoset				the STOSet that will be filled 
-	\param groupAttr			a map from attribute name to statistic type  
-	\param loadGeometries		if the STOSet will be filled with the geometries 
-*/
-template<typename elementSet>
-bool TeSTOSetBuildDB(elementSet* stoset, TeGroupingAttr& groupAttr, bool loadGeometries = false);
-
-
-//! Updates or inserts a database table from a spatial object set
-/*! 
-	\param elemSet		the set of spatial objects that will be inserted or updated into database
-	\param tableName	database table name that will be updated  
-	\param indexes		the attribute indexes of the spatial objects that must be updated
-*/
-template<typename elementSet> 
-bool TeUpdateDBFromSet (elementSet* elemSet, const string& tableName, vector<int>* indexes = 0);
-
-
-//! Auxiliary function to insert a row
-template<typename Element> 
-bool insertRow (Element* elem, TeTable& table, const string& uniqueValue, TeDatabase* db, vector<int>* indexes=0);
-
-//! Auxiliary function to update a row
-template<typename Element>
-bool updateRow (Element* elem, TeTable table, const string& uniqueId, TeDatabase* db, vector<int>* indexes=0);
-
-
-//--------------- Implementation
-
-template<typename elementSet> 
-bool TeSTOSetBuildDB(elementSet* stoset, bool loadGeometries, bool loadAllAttributes, vector<string> attrNames)
-{
-	if(!stoset->build(loadGeometries, loadAllAttributes, attrNames))
-		return false;
-	return true;
-}
-
-template<typename elementSet>
-bool TeSTOSetBuildDB(elementSet* stoset, TeGroupingAttr& groupAttr, bool loadGeometries)
-{
-	if(!stoset->build(groupAttr, loadGeometries))
-		return false;
-	return true;
-}
-
-template<typename elementSet>  
-bool TeUpdateDBFromSet (elementSet* elemSet, const string& tableName, vector<int>* indexes)
-{
-	TeDatabase* db = 0;
-	if((elemSet->getTheme()) && (elemSet->theme()->layer()))
-		db = elemSet->getTheme()->layer()->database();
-	else if(elemSet->getLayer())
-		db = elemSet->getLayer()->database();
-	
-	if(!db)
-		return false;
-	 
-	//progress bar
-	int step = 0;
-	int numSteps = elemSet->numSTInstance();
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(numSteps);
-	
-	try
-	{
-		TeAttrTableVector attrTables;
-		if(elemSet->getTheme())
-			elemSet->getTheme()->getAttTables(attrTables); 
-		else if(elemSet->getLayer())
-			elemSet->getLayer()->getAttrTables(attrTables); 
-
-		if(attrTables.empty())
-			return false;	
-
-		TeTable table;
-		int	uniqueIndex = -1;
-	
-		//! verify if the table is in the stoset
-		for(unsigned int i=0; i<attrTables.size(); i++)
-		{
-			if(attrTables[i].name()==tableName)
-			{
-				uniqueIndex = i;
-				table = attrTables[i];
-				break;
-			}
-		}
-		
-		if((uniqueIndex==-1) || ((table.tableType()!=TeAttrEvent) && 
-								 (table.tableType()!=TeAttrStatic) && 
-								 (table.tableType()!=TeFixedGeomDynAttr) &&
-								 (table.tableType()!=TeAttrExternal)))
-			return false;
-
-		// get some information about the attribute table required
-		string uniqueIdName = table.uniqueName();
-	
-		TeDatabasePortal* portal = db->getPortal();
-		if(!portal)
-			return false;
-
-		map<string, string> uniqueIds;
-		string sql = "SELECT "+ uniqueIdName +" FROM "+ table.name();
-		
-		if(!portal->query (sql))
-		{
-			delete portal;
-			return false;
-		}
-
-		while(portal->fetchRow())
-			uniqueIds[string(portal->getData(0))] = string(portal->getData(0));
-		
-		delete portal;
-
-		//verifies if the attribute column exists in the table
-		TeAttributeList attList = elemSet->getAttributeList();
-		for(unsigned int i=0; i<attList.size(); ++i)
-		{
-			if(indexes && (find(indexes->begin(), indexes->end(),(int)i) == indexes->end()))
-				continue;
-
-			//verify if the table has this column 
-			string attrName = attList[i].rep_.name_;
-			size_t pos = attrName.find(".", 0, 1);
-			if (pos != string::npos)
-				attList[i].rep_.name_ = attrName.substr(pos+1);
-
-			if (!db->columnExist(tableName, attList[i].rep_.name_, attList[i]))
-			{
-				if(!db->addColumn (tableName, attList[i].rep_))
-					return false; 
-
-				TeAttributeList attrListTable = table.attributeList();
-				attrListTable.push_back (attList[i]);
-				table.setAttributeList(attrListTable);
-			}
-		}
-		
-		// Update all the objects 
-		typename elementSet::iterator itObj = elemSet->begin();
-		while (itObj != elemSet->end())
-		{
-			string uniqueId =  (*itObj).getUniqueId(uniqueIndex); 
-
-			if(uniqueIds.find(uniqueId) ==  uniqueIds.end())
-			{	
-				if (!insertRow (&(*itObj), table, uniqueId, db, indexes))
-					return false;
-
-				uniqueIds[uniqueId] = uniqueId;
-			}
-			else
-			{	
-				if (!updateRow (&(*itObj), table, uniqueId, db, indexes))
-					return false;
-			}
-					
-			++itObj;
-
-			if(TeProgress::instance())
-			{
-				if (TeProgress::instance()->wasCancelled())
-				{
-					TeProgress::instance()->reset();
-					return false;
-				}
-				else
-					TeProgress::instance()->setProgress(step);
-			}	
-			++step;
-		}
-	}
-	catch(...)
-	{
-		if (TeProgress::instance())
-			TeProgress::instance()->reset();
-		return false;
-	}
-	
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	
-	return true;
-}
-
-template<typename Element> 
-bool insertRow (Element* elem, TeTable& table, const string& uniqueValue, TeDatabase* db, vector<int>* indexes)
-{
-	vector<string> attrs;
-	table.attributeNames(attrs);
-	
-	string ins = " INSERT INTO "+ table.name() +" (";
-	string values = " VALUES ( ";
-	
-	TePropertyVector prop = elem->getPropertyVector();
-	int count=0;
-
-	for(unsigned int i=0; i<prop.size(); ++i)
-	{
-		if(indexes && (find(indexes->begin(), indexes->end(),(int)i) == indexes->end()))
-			continue;
-		
-		string attrName = prop[i].attr_.rep_.name_;
-		size_t pos = attrName.find(".", 0, 1);
-		if (pos != string::npos)
-			attrName = attrName.substr(pos+1);
-				
-		if( (find(attrs.begin(), attrs.end(), attrName)!=attrs.end()) &&
-			(TeStringCompare(attrName, table.uniqueName()) == false) && 
-			(TeStringCompare(attrName,table.linkName()) == false)&&
-			(TeStringCompare(attrName,table.attInitialTime()) == false)&&
-			(TeStringCompare(attrName,table.attFinalTime()) == false)  )
-			
-		{
-			if((prop[i].attr_.rep_.type_!=TeSTRING) && prop[i].value_.empty())
-				continue; 
-
-			if(count>0)
-			{
-				ins += ",";
-				values += ",";
-			}
-			++count;
-			ins += attrName;
-			if(prop[i].attr_.rep_.type_==TeSTRING)
-				values += "'"+ prop[i].value_ +"'";
-			else if(prop[i].attr_.rep_.type_==TeREAL)
-			{
-				std::string strValue = prop[i].value_;
-				replace (strValue.begin(), strValue.end(), ',', '.');
-				values += strValue;
-			}
-			else if(prop[i].attr_.rep_.type_==TeDATETIME)
-			{
-				TeTime time(prop[i].value_, prop[i].attr_.dateChronon_, prop[i].attr_.dateTimeFormat_, prop[i].attr_.dateSeparator_, prop[i].attr_.timeSeparator_);  
-				values += db->getSQLTime(time);
-			}
-			else
-				values += prop[i].value_;
-		}
-	}
-
-	// -------- object_id, unique_id and timeInterval
-		
-	if(count>0)
-	{
-		ins +=		" ,";
-		values +=	" ,";
-	}
-
-	ins +=		table.linkName();
-	values +=	"'"+ elem->objectId() +"'";
-
-	if(table.linkName() != table.uniqueName())
-	{
-		ins +=		", "+ table.uniqueName();
-		values +=	", '"+ uniqueValue +"'";
-	}
-
-	if(!table.attInitialTime().empty())
-	{
-		TeTime time (elem->timeInterval().getT1());
-		ins +=		", "+ table.attInitialTime();
-		values +=	", "+ db->getSQLTime(time); 
-	}
-
-	if((!table.attFinalTime().empty()) && (table.attInitialTime()!=table.attFinalTime()))
-	{
-		TeTime time (elem->timeInterval().getT2());
-		ins +=		", "+ table.attFinalTime();
-		values +=	", "+ db->getSQLTime(time); 
-	}
-	// ----------
-
-	ins += ") "+ values +" )";
-	
-	if(!db->execute (ins))
-		return false;
-
-	return true;
-}
-
-template<typename Element>
-bool updateRow (Element* elem, TeTable table, const string& uniqueId, TeDatabase* db, vector<int>* indexes)
-{
-	
-	vector<string> attrs;
-	table.attributeNames(attrs);
-
-	string ins = " UPDATE "+ table.name() +" SET ";
-	
-	TePropertyVector prop = elem->getPropertyVector();
-	int count = 0;
-	for(unsigned int i=0; i<prop.size(); ++i)
-	{
-		if(indexes && (find(indexes->begin(), indexes->end(),(int)i) == indexes->end()))
-			continue;
-
-		string attrName = prop[i].attr_.rep_.name_;
-		size_t pos = attrName.find(".", 0, 1);
-
-		std::string tableName; 
-		if (pos != string::npos)
-		{
-			attrName = attrName.substr(pos+1);
-			tableName = attrName.substr(0, pos-1);
-			if (tableName != table.name())
-               continue;
-		} 
-
-		if( (find(attrs.begin(), attrs.end(), attrName)!=attrs.end()) &&
-			(TeStringCompare(attrName,table.uniqueName()) == false) && 
-			(TeStringCompare(attrName,table.linkName()) == false) && 
-			(TeStringCompare(attrName,table.attInitialTime()) == false) && 
-			(TeStringCompare(attrName,table.attFinalTime()) == false) )
-		{
-		
-			if((prop[i].attr_.rep_.type_!=TeSTRING) && (prop[i].value_.empty()))
-				continue; 
-
-			if(count>0)
-				ins += ",";
-			
-			++count;
-			ins += attrName +" = ";
-		
-			if(prop[i].attr_.rep_.type_==TeSTRING)
-				ins += "'"+ prop[i].value_ +"'";
-			else if(prop[i].attr_.rep_.type_==TeREAL)
-			{
-				std::string strValue = prop[i].value_;
-				replace (strValue.begin(), strValue.end(), ',', '.');
-				ins += strValue;
-			}
-			else if(prop[i].attr_.rep_.type_==TeDATETIME)
-			{
-				TeTime time(prop[i].value_, prop[i].attr_.dateChronon_, prop[i].attr_.dateTimeFormat_, prop[i].attr_.dateSeparator_, prop[i].attr_.timeSeparator_);  
-				ins += db->getSQLTime(time);
-			}
-			else
-				ins += prop[i].value_;
-		}
-	}
-
-	// -------- timeInterval
-	if(!table.attInitialTime().empty())
-	{
-		TeTime time (elem->timeInterval().getT1());
-		if(count>0)
-			ins +=	", "; 
-		ins += table.attInitialTime() +" = ";
-		ins +=	db->getSQLTime(time); 
-		++count;
-	}
-
-	if((!table.attFinalTime().empty()) && (table.attInitialTime()!=table.attFinalTime()))
-	{
-		TeTime time (elem->timeInterval().getT2());
-		if(count>0)
-			ins +=	", "; 
-		ins += table.attFinalTime() +" = ";
-		ins +=	db->getSQLTime(time);
-		++count;
-	}
-	// ----------
-
-	if ( count == 0 ) 
-		return true; 
-
-	ins += " WHERE "+ table.uniqueName() +" = '"+ uniqueId +"'";
-	
-	if(!db->execute (ins))
-		return false;
-
-	return true;
-}
- 
-/** \example createSTElementSetFromLayer.cpp
- 	Shows how to create a new Spatial Temporal Element Set (STElementSet) from a layer
- */
-
-/** \example createSTElementSetFromTheme.cpp
- 	Shows how to create a new Spatial Temporal Element Set (STElementSet) from a theme
- */
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library p rovided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSTEFunctionsDB.h
+    \brief This file contains a set of functions to build spatio-temporal sets from a TerraLib databse  
+*/
+#ifndef  __TERRALIB_INTERNAL_STOFUNCTIONS_H
+#define  __TERRALIB_INTERNAL_STOFUNCTIONS_H
+
+#include "TeDatabase.h"
+#include "TeProgress.h"
+#include <vector>
+#include <string>
+
+//! Builds the spatial object set from database according to the restrictions previously defined
+/*! 
+	\param stoset				the STOSet that will be filled 
+	\param loadGeometries		if the STOSet will be filled with the geometries 
+	\param loadAllAttributes	if the STOSet will be filled with all attributes of the tables of the STOSet 
+	\param attrNames			a subset of the attribute names that will be loaded, if the param loadAllAttributes is false 
+*/
+template<typename elementSet>
+bool TeSTOSetBuildDB(elementSet* stoset, bool loadGeometries = false, bool loadAllAttributes = false, vector<string> attrNames = vector<string>());
+
+//! Builds the spatial object set from database according to the restrictions previously defined
+/*! 
+	\param stoset				the STOSet that will be filled 
+	\param groupAttr			a map from attribute name to statistic type  
+	\param loadGeometries		if the STOSet will be filled with the geometries 
+*/
+template<typename elementSet>
+bool TeSTOSetBuildDB(elementSet* stoset, TeGroupingAttr& groupAttr, bool loadGeometries = false);
+
+
+//! Updates or inserts a database table from a spatial object set
+/*! 
+	\param elemSet		the set of spatial objects that will be inserted or updated into database
+	\param tableName	database table name that will be updated  
+	\param indexes		the attribute indexes of the spatial objects that must be updated
+*/
+template<typename elementSet> 
+bool TeUpdateDBFromSet (elementSet* elemSet, const string& tableName, vector<int>* indexes = 0);
+
+
+//! Auxiliary function to insert a row
+template<typename Element> 
+bool insertRow (Element* elem, TeTable& table, const string& uniqueValue, TeDatabase* db, vector<int>* indexes=0);
+
+//! Auxiliary function to update a row
+template<typename Element>
+bool updateRow (Element* elem, TeTable table, const string& uniqueId, TeDatabase* db, vector<int>* indexes=0);
+
+
+//--------------- Implementation
+
+template<typename elementSet> 
+bool TeSTOSetBuildDB(elementSet* stoset, bool loadGeometries, bool loadAllAttributes, vector<string> attrNames)
+{
+	if(!stoset->build(loadGeometries, loadAllAttributes, attrNames))
+		return false;
+	return true;
+}
+
+template<typename elementSet>
+bool TeSTOSetBuildDB(elementSet* stoset, TeGroupingAttr& groupAttr, bool loadGeometries)
+{
+	if(!stoset->build(groupAttr, loadGeometries))
+		return false;
+	return true;
+}
+
+template<typename elementSet>  
+bool TeUpdateDBFromSet (elementSet* elemSet, const string& tableName, vector<int>* indexes)
+{
+	TeDatabase* db = 0;
+	if((elemSet->getTheme()) && (elemSet->theme()->layer()))
+		db = elemSet->getTheme()->layer()->database();
+	else if(elemSet->getLayer())
+		db = elemSet->getLayer()->database();
+	
+	if(!db)
+		return false;
+	 
+	//progress bar
+	int step = 0;
+	int numSteps = elemSet->numSTInstance();
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(numSteps);
+	
+	try
+	{
+		TeAttrTableVector attrTables;
+		if(elemSet->getTheme())
+			elemSet->getTheme()->getAttTables(attrTables); 
+		else if(elemSet->getLayer())
+			elemSet->getLayer()->getAttrTables(attrTables); 
+
+		if(attrTables.empty())
+			return false;	
+
+		TeTable table;
+		int	uniqueIndex = -1;
+	
+		//! verify if the table is in the stoset
+		for(unsigned int i=0; i<attrTables.size(); i++)
+		{
+			if(attrTables[i].name()==tableName)
+			{
+				uniqueIndex = i;
+				table = attrTables[i];
+				break;
+			}
+		}
+		
+		if((uniqueIndex==-1) || ((table.tableType()!=TeAttrEvent) && 
+								 (table.tableType()!=TeAttrStatic) && 
+								 (table.tableType()!=TeFixedGeomDynAttr) &&
+								 (table.tableType()!=TeAttrExternal)))
+			return false;
+
+		// get some information about the attribute table required
+		string uniqueIdName = table.uniqueName();
+	
+		TeDatabasePortal* portal = db->getPortal();
+		if(!portal)
+			return false;
+
+		map<string, string> uniqueIds;
+		string sql = "SELECT "+ uniqueIdName +" FROM "+ table.name();
+		
+		if(!portal->query (sql))
+		{
+			delete portal;
+			return false;
+		}
+
+		while(portal->fetchRow())
+			uniqueIds[string(portal->getData(0))] = string(portal->getData(0));
+		
+		delete portal;
+
+		//verifies if the attribute column exists in the table
+		TeAttributeList attList = elemSet->getAttributeList();
+		for(unsigned int i=0; i<attList.size(); ++i)
+		{
+			if(indexes && (find(indexes->begin(), indexes->end(),(int)i) == indexes->end()))
+				continue;
+
+			//verify if the table has this column 
+			string attrName = attList[i].rep_.name_;
+			size_t pos = attrName.find(".", 0, 1);
+			if (pos != string::npos)
+				attList[i].rep_.name_ = attrName.substr(pos+1);
+
+			if (!db->columnExist(tableName, attList[i].rep_.name_, attList[i]))
+			{
+				if(!db->addColumn (tableName, attList[i].rep_))
+					return false; 
+
+				TeAttributeList attrListTable = table.attributeList();
+				attrListTable.push_back (attList[i]);
+				table.setAttributeList(attrListTable);
+			}
+		}
+		
+		// Update all the objects 
+		typename elementSet::iterator itObj = elemSet->begin();
+		while (itObj != elemSet->end())
+		{
+			string uniqueId =  (*itObj).getUniqueId(uniqueIndex); 
+
+			if(uniqueIds.find(uniqueId) ==  uniqueIds.end())
+			{	
+				if (!insertRow (&(*itObj), table, uniqueId, db, indexes))
+					return false;
+
+				uniqueIds[uniqueId] = uniqueId;
+			}
+			else
+			{	
+				if (!updateRow (&(*itObj), table, uniqueId, db, indexes))
+					return false;
+			}
+					
+			++itObj;
+
+			if(TeProgress::instance())
+			{
+				if (TeProgress::instance()->wasCancelled())
+				{
+					TeProgress::instance()->reset();
+					return false;
+				}
+				else
+					TeProgress::instance()->setProgress(step);
+			}	
+			++step;
+		}
+	}
+	catch(...)
+	{
+		if (TeProgress::instance())
+			TeProgress::instance()->reset();
+		return false;
+	}
+	
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	
+	return true;
+}
+
+template<typename Element> 
+bool insertRow (Element* elem, TeTable& table, const string& uniqueValue, TeDatabase* db, vector<int>* indexes)
+{
+	vector<string> attrs;
+	table.attributeNames(attrs);
+	
+	string ins = " INSERT INTO "+ table.name() +" (";
+	string values = " VALUES ( ";
+	
+	TePropertyVector prop = elem->getPropertyVector();
+	int count=0;
+
+	for(unsigned int i=0; i<prop.size(); ++i)
+	{
+		if(indexes && (find(indexes->begin(), indexes->end(),(int)i) == indexes->end()))
+			continue;
+		
+		string attrName = prop[i].attr_.rep_.name_;
+		size_t pos = attrName.find(".", 0, 1);
+		if (pos != string::npos)
+			attrName = attrName.substr(pos+1);
+				
+		if( (find(attrs.begin(), attrs.end(), attrName)!=attrs.end()) &&
+			(TeStringCompare(attrName, table.uniqueName()) == false) && 
+			(TeStringCompare(attrName,table.linkName()) == false)&&
+			(TeStringCompare(attrName,table.attInitialTime()) == false)&&
+			(TeStringCompare(attrName,table.attFinalTime()) == false)  )
+			
+		{
+			if((prop[i].attr_.rep_.type_!=TeSTRING) && prop[i].value_.empty())
+				continue; 
+
+			if(count>0)
+			{
+				ins += ",";
+				values += ",";
+			}
+			++count;
+			ins += attrName;
+			if(prop[i].attr_.rep_.type_==TeSTRING)
+				values += "'"+ prop[i].value_ +"'";
+			else if(prop[i].attr_.rep_.type_==TeREAL)
+			{
+				std::string strValue = prop[i].value_;
+				replace (strValue.begin(), strValue.end(), ',', '.');
+				values += strValue;
+			}
+			else if(prop[i].attr_.rep_.type_==TeDATETIME)
+			{
+				TeTime time(prop[i].value_, prop[i].attr_.dateChronon_, prop[i].attr_.dateTimeFormat_, prop[i].attr_.dateSeparator_, prop[i].attr_.timeSeparator_);  
+				values += db->getSQLTime(time);
+			}
+			else
+				values += prop[i].value_;
+		}
+	}
+
+	// -------- object_id, unique_id and timeInterval
+		
+	if(count>0)
+	{
+		ins +=		" ,";
+		values +=	" ,";
+	}
+
+	ins +=		table.linkName();
+	values +=	"'"+ elem->objectId() +"'";
+
+	if(table.linkName() != table.uniqueName())
+	{
+		ins +=		", "+ table.uniqueName();
+		values +=	", '"+ uniqueValue +"'";
+	}
+
+	if(!table.attInitialTime().empty())
+	{
+		TeTime time (elem->timeInterval().getT1());
+		ins +=		", "+ table.attInitialTime();
+		values +=	", "+ db->getSQLTime(time); 
+	}
+
+	if((!table.attFinalTime().empty()) && (table.attInitialTime()!=table.attFinalTime()))
+	{
+		TeTime time (elem->timeInterval().getT2());
+		ins +=		", "+ table.attFinalTime();
+		values +=	", "+ db->getSQLTime(time); 
+	}
+	// ----------
+
+	ins += ") "+ values +" )";
+	
+	if(!db->execute (ins))
+		return false;
+
+	return true;
+}
+
+template<typename Element>
+bool updateRow (Element* elem, TeTable table, const string& uniqueId, TeDatabase* db, vector<int>* indexes)
+{
+	
+	vector<string> attrs;
+	table.attributeNames(attrs);
+
+	string ins = " UPDATE "+ table.name() +" SET ";
+	
+	TePropertyVector prop = elem->getPropertyVector();
+	int count = 0;
+	for(unsigned int i=0; i<prop.size(); ++i)
+	{
+		if(indexes && (find(indexes->begin(), indexes->end(),(int)i) == indexes->end()))
+			continue;
+
+		string attrName = prop[i].attr_.rep_.name_;
+		size_t pos = attrName.find(".", 0, 1);
+
+		std::string tableName; 
+		if (pos != string::npos)
+		{
+			attrName = attrName.substr(pos+1);
+			tableName = attrName.substr(0, pos-1);
+			if (tableName != table.name())
+               continue;
+		} 
+
+		if( (find(attrs.begin(), attrs.end(), attrName)!=attrs.end()) &&
+			(TeStringCompare(attrName,table.uniqueName()) == false) && 
+			(TeStringCompare(attrName,table.linkName()) == false) && 
+			(TeStringCompare(attrName,table.attInitialTime()) == false) && 
+			(TeStringCompare(attrName,table.attFinalTime()) == false) )
+		{
+		
+			if((prop[i].attr_.rep_.type_!=TeSTRING) && (prop[i].value_.empty()))
+				continue; 
+
+			if(count>0)
+				ins += ",";
+			
+			++count;
+			ins += attrName +" = ";
+		
+			if(prop[i].attr_.rep_.type_==TeSTRING)
+				ins += "'"+ db->escapeSequence(prop[i].value_) +"'";
+			else if(prop[i].attr_.rep_.type_==TeREAL)
+			{
+				std::string strValue = prop[i].value_;
+				replace (strValue.begin(), strValue.end(), ',', '.');
+				ins += strValue;
+			}
+			else if(prop[i].attr_.rep_.type_==TeDATETIME)
+			{
+				TeTime time(prop[i].value_, prop[i].attr_.dateChronon_, prop[i].attr_.dateTimeFormat_, prop[i].attr_.dateSeparator_, prop[i].attr_.timeSeparator_);  
+				ins += db->getSQLTime(time);
+			}
+			else
+				ins += prop[i].value_;
+		}
+	}
+
+	// -------- timeInterval
+	if(!table.attInitialTime().empty())
+	{
+		TeTime time (elem->timeInterval().getT1());
+		if(count>0)
+			ins +=	", "; 
+		ins += table.attInitialTime() +" = ";
+		ins +=	db->getSQLTime(time); 
+		++count;
+	}
+
+	if((!table.attFinalTime().empty()) && (table.attInitialTime()!=table.attFinalTime()))
+	{
+		TeTime time (elem->timeInterval().getT2());
+		if(count>0)
+			ins +=	", "; 
+		ins += table.attFinalTime() +" = ";
+		ins +=	db->getSQLTime(time);
+		++count;
+	}
+	// ----------
+
+	if ( count == 0 ) 
+		return true; 
+
+	ins += " WHERE "+ table.uniqueName() +" = '"+ uniqueId +"'";
+	
+	if(!db->execute (ins))
+		return false;
+
+	return true;
+}
+ 
+/** \example createSTElementSetFromLayer.cpp
+ 	Shows how to create a new Spatial Temporal Element Set (STElementSet) from a layer
+ */
+
+/** \example createSTElementSetFromTheme.cpp
+ 	Shows how to create a new Spatial Temporal Element Set (STElementSet) from a theme
+ */
+#endif
+
diff --git a/src/terralib/kernel/TeSTElementSet.cpp b/src/terralib/kernel/TeSTElementSet.cpp
old mode 100755
new mode 100644
index 89ad79c..559e571
--- a/src/terralib/kernel/TeSTElementSet.cpp
+++ b/src/terralib/kernel/TeSTElementSet.cpp
@@ -1,256 +1,256 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <TeSTElementSet.h>
-#include <TeQuerier.h> 
-#include <TeQuerierParams.h>
-
-TeTimeInterval 
-TeSTElementSet::totalTime() 
-{	
-	return TeTimeInterval(this->getMinTime().getT1(),this->getMaxTime().getT2());
-} 
-
-void 
-TeSTElementSet::totalTime(TeTimeInterval t) 
-{	
-	minTime_ = TeTimeInterval(t.getT1(), t.getT1());
-	maxTime_ = TeTimeInterval(t.getT2(), t.getT2());
-}
-
-	
-bool 
-TeSTElementSet::hasElement(const string& objId) 
-{	
-	return (numSTInstance(objId)>0);  
-}
-
-bool 
-TeSTElementSet::setGeometry(const string& object_id, const TePolygonSet& geomSet, TeTimeInterval time)
-{
-	vector<TeSTInstance*> result;
-	this->getSTInstances(result, object_id, time);
-	vector<TeSTInstance*>::iterator it = result.begin();
-
-	while(it!=result.end())
-	{
-		(*it)->setGeometry(geomSet);
-		++it;
-	}
-	return true;
-}
-
-bool 
-TeSTElementSet::setGeometry(const string& object_id, const TeLineSet& geomSet, TeTimeInterval time)
-{
-	vector<TeSTInstance*> result;
-	this->getSTInstances(result, object_id, time);
-	vector<TeSTInstance*>::iterator it = result.begin();
-
-	while(it!=result.end())
-	{
-		(*it)->setGeometry(geomSet);
-		++it;
-	}
-	return true;
-}
-
-bool 
-TeSTElementSet::setGeometry(const string& object_id, const TePointSet& geomSet, TeTimeInterval time)
-{
-	vector<TeSTInstance*> result;
-	this->getSTInstances(result, object_id, time);
-	vector<TeSTInstance*>::iterator it = result.begin();
-
-	while(it!=result.end())
-	{
-		(*it)->setGeometry(geomSet);
-		++it;
-	}
-	return true;
-}
-
-bool 
-TeSTElementSet::setGeometry(const string& object_id, const TeCellSet& geomSet, TeTimeInterval time)
-{
-	vector<TeSTInstance*> result;
-	this->getSTInstances(result, object_id, time);
-	vector<TeSTInstance*>::iterator it = result.begin();
-
-	while(it!=result.end())
-	{
-		(*it)->setGeometry(geomSet);
-		++it;
-	}
-	return true;
-}
-
-bool 
-TeSTElementSet::setGeometry(const string& object_id, const TeTextSet& geomSet, TeTimeInterval time)
-{
-	vector<TeSTInstance*> result;
-	this->getSTInstances(result, object_id, time);
-	vector<TeSTInstance*>::iterator it = result.begin();
-
-	while(it!=result.end())
-	{
-		(*it)->setGeometry(geomSet);
-		++it;
-	}
-	return true;
-}
-
-
-bool 
-TeSTElementSet::getGeometry(const string& object_id, TePolygonSet& geomSet, TeTimeInterval time)
-{
-	TeSTInstance* result = this->getSTInstance(object_id, time);
-	if(!result)
-		return false; 
-	geomSet = result->getPolygons();
-	return true;
-}
-
-
-bool 
-TeSTElementSet::getGeometry(const string& object_id, TeLineSet& geomSet, TeTimeInterval time)
-{
-	TeSTInstance* result = this->getSTInstance(object_id, time);
-	if(!result)
-		return false; 
-	geomSet = result->getLines();
-	return true;
-}
-
-	
-bool 
-TeSTElementSet::getGeometry(const string& object_id, TePointSet& geomSet, TeTimeInterval time)
-{
-	TeSTInstance* result = this->getSTInstance(object_id, time);
-	if(!result)
-		return false; 
-	geomSet = result->getPoints();
-	return true;
-}
-
-	
-bool 
-TeSTElementSet::getGeometry(const string& object_id, TeCellSet& geomSet, TeTimeInterval time)
-{
-	TeSTInstance* result = this->getSTInstance(object_id, time);
-	if(!result)
-		return false; 
-	geomSet = result->getCells();
-	return true; 
-}
-
-bool 
-TeSTElementSet::getGeometry(const string& object_id, TeTextSet& geomSet, TeTimeInterval time)
-{
-	TeSTInstance* result = this->getSTInstance(object_id, time);
-	if(!result)
-		return false; 
-	geomSet = result->getTexts();
-	return true;
-}
-
-bool 
-TeSTElementSet::buildImpl(TeQuerier* querier, const int& slide)
-{
-	int dt = CLOCKS_PER_SEC/4, steps = 0;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	
-	t0=t1=t2=clock();
-
-	if(!querier)
-		return false;
-
-	if(!querier->loadInstances(slide))
-		return false;
-	
-	//clear all structures
-	attrList_->clear();
-	instances_.clear();
-	objectIdToInstances_.clear();
-	timeToInstances_.clear();
-	sliceToInstances_.clear();
-	if(rTree_)
-		delete rTree_;
-	rTree_ = 0;
-	
-	//Builts another rTree
-	TeBox b;
-	if(theme_)
-		b = theme_->box();
-	else if(layer_)
-		b = layer_->box();
-	else
-		b = this->box_; 
-	rTree_ = new TeSAM::TeRTree<int>(b); 
-
-	TeAttributeList l = querier->getAttrList();
-	setAttributeList(l);
-
-	int tot = querier->numElemInstances();
-	
-	if(TeProgress::instance())
-	{
-		TeProgress::instance()->reset();
-		string caption = "Building data";
-		TeProgress::instance()->setCaption(caption.c_str());
-		string msg = "Building in progress. Please, wait!";
-		TeProgress::instance()->setMessage(msg);
-		TeProgress::instance()->setTotalSteps(tot);
-		t2 = clock();
-		t0 = t1 = t2;
-	}
-	
-	TeSTInstance obj;
-	while(querier->fetchInstance(obj)) 
-	{
-		this->insertSTInstance(obj);
-		
-		obj.clear();
-		if(TeProgress::instance())
-		{
-			steps++;
-			t2 = clock();
-			if (int(t2-t1) > dt)
-			{
-				t1 = t2;
-				if(TeProgress::instance()->wasCancelled())
-					return false;
-				
-				if((int)(t2-t0) > dt2)
-					TeProgress::instance()->setProgress(steps);
-			}
-		}
-	}
-	if(TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	return true;
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <TeSTElementSet.h>
+#include <TeQuerier.h> 
+#include <TeQuerierParams.h>
+
+TeTimeInterval 
+TeSTElementSet::totalTime() 
+{	
+	return TeTimeInterval(this->getMinTime().getT1(),this->getMaxTime().getT2());
+} 
+
+void 
+TeSTElementSet::totalTime(TeTimeInterval t) 
+{	
+	minTime_ = TeTimeInterval(t.getT1(), t.getT1());
+	maxTime_ = TeTimeInterval(t.getT2(), t.getT2());
+}
+
+	
+bool 
+TeSTElementSet::hasElement(const string& objId) 
+{	
+	return (numSTInstance(objId)>0);  
+}
+
+bool 
+TeSTElementSet::setGeometry(const string& object_id, const TePolygonSet& geomSet, TeTimeInterval time)
+{
+	vector<TeSTInstance*> result;
+	this->getSTInstances(result, object_id, time);
+	vector<TeSTInstance*>::iterator it = result.begin();
+
+	while(it!=result.end())
+	{
+		(*it)->setGeometry(geomSet);
+		++it;
+	}
+	return true;
+}
+
+bool 
+TeSTElementSet::setGeometry(const string& object_id, const TeLineSet& geomSet, TeTimeInterval time)
+{
+	vector<TeSTInstance*> result;
+	this->getSTInstances(result, object_id, time);
+	vector<TeSTInstance*>::iterator it = result.begin();
+
+	while(it!=result.end())
+	{
+		(*it)->setGeometry(geomSet);
+		++it;
+	}
+	return true;
+}
+
+bool 
+TeSTElementSet::setGeometry(const string& object_id, const TePointSet& geomSet, TeTimeInterval time)
+{
+	vector<TeSTInstance*> result;
+	this->getSTInstances(result, object_id, time);
+	vector<TeSTInstance*>::iterator it = result.begin();
+
+	while(it!=result.end())
+	{
+		(*it)->setGeometry(geomSet);
+		++it;
+	}
+	return true;
+}
+
+bool 
+TeSTElementSet::setGeometry(const string& object_id, const TeCellSet& geomSet, TeTimeInterval time)
+{
+	vector<TeSTInstance*> result;
+	this->getSTInstances(result, object_id, time);
+	vector<TeSTInstance*>::iterator it = result.begin();
+
+	while(it!=result.end())
+	{
+		(*it)->setGeometry(geomSet);
+		++it;
+	}
+	return true;
+}
+
+bool 
+TeSTElementSet::setGeometry(const string& object_id, const TeTextSet& geomSet, TeTimeInterval time)
+{
+	vector<TeSTInstance*> result;
+	this->getSTInstances(result, object_id, time);
+	vector<TeSTInstance*>::iterator it = result.begin();
+
+	while(it!=result.end())
+	{
+		(*it)->setGeometry(geomSet);
+		++it;
+	}
+	return true;
+}
+
+
+bool 
+TeSTElementSet::getGeometry(const string& object_id, TePolygonSet& geomSet, TeTimeInterval time)
+{
+	TeSTInstance* result = this->getSTInstance(object_id, time);
+	if(!result)
+		return false; 
+	geomSet = result->getPolygons();
+	return true;
+}
+
+
+bool 
+TeSTElementSet::getGeometry(const string& object_id, TeLineSet& geomSet, TeTimeInterval time)
+{
+	TeSTInstance* result = this->getSTInstance(object_id, time);
+	if(!result)
+		return false; 
+	geomSet = result->getLines();
+	return true;
+}
+
+	
+bool 
+TeSTElementSet::getGeometry(const string& object_id, TePointSet& geomSet, TeTimeInterval time)
+{
+	TeSTInstance* result = this->getSTInstance(object_id, time);
+	if(!result)
+		return false; 
+	geomSet = result->getPoints();
+	return true;
+}
+
+	
+bool 
+TeSTElementSet::getGeometry(const string& object_id, TeCellSet& geomSet, TeTimeInterval time)
+{
+	TeSTInstance* result = this->getSTInstance(object_id, time);
+	if(!result)
+		return false; 
+	geomSet = result->getCells();
+	return true; 
+}
+
+bool 
+TeSTElementSet::getGeometry(const string& object_id, TeTextSet& geomSet, TeTimeInterval time)
+{
+	TeSTInstance* result = this->getSTInstance(object_id, time);
+	if(!result)
+		return false; 
+	geomSet = result->getTexts();
+	return true;
+}
+
+bool 
+TeSTElementSet::buildImpl(TeQuerier* querier, const int& slide)
+{
+	int dt = CLOCKS_PER_SEC/4, steps = 0;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	
+	t0=t1=t2=clock();
+
+	if(!querier)
+		return false;
+
+	if(!querier->loadInstances(slide))
+		return false;
+	
+	//clear all structures
+	attrList_->clear();
+	instances_.clear();
+	objectIdToInstances_.clear();
+	timeToInstances_.clear();
+	sliceToInstances_.clear();
+	if(rTree_)
+		delete rTree_;
+	rTree_ = 0;
+	
+	//Builts another rTree
+	TeBox b;
+	if(theme_)
+		b = theme_->box();
+	else if(layer_)
+		b = layer_->box();
+	else
+		b = this->box_; 
+	rTree_ = new TeSAM::TeRTree<int>(b); 
+
+	TeAttributeList l = querier->getAttrList();
+	setAttributeList(l);
+
+	int tot = querier->numElemInstances();
+	
+	if(TeProgress::instance())
+	{
+		TeProgress::instance()->reset();
+		string caption = "Building data";
+		TeProgress::instance()->setCaption(caption.c_str());
+		string msg = "Building in progress. Please, wait!";
+		TeProgress::instance()->setMessage(msg);
+		TeProgress::instance()->setTotalSteps(tot);
+		t2 = clock();
+		t0 = t1 = t2;
+	}
+	
+	TeSTInstance obj;
+	while(querier->fetchInstance(obj)) 
+	{
+		this->insertSTInstance(obj);
+		
+		obj.clear();
+		if(TeProgress::instance())
+		{
+			steps++;
+			t2 = clock();
+			if (int(t2-t1) > dt)
+			{
+				t1 = t2;
+				if(TeProgress::instance()->wasCancelled())
+					return false;
+				
+				if((int)(t2-t0) > dt2)
+					TeProgress::instance()->setProgress(steps);
+			}
+		}
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	return true;
+}
+
+
diff --git a/src/terralib/kernel/TeSTElementSet.h b/src/terralib/kernel/TeSTElementSet.h
old mode 100755
new mode 100644
index c2a6416..ecb9ec9
--- a/src/terralib/kernel/TeSTElementSet.h
+++ b/src/terralib/kernel/TeSTElementSet.h
@@ -1,125 +1,125 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSTElementSet.h
-	\brief This file contains structures to deal with a set of spatio-temporal 
-	instances. These instances can belong to a specific layer or theme.
-*/
-
-#ifndef  __TERRALIB_INTERNAL_STELEMENTSET_H
-#define  __TERRALIB_INTERNAL_STELEMENTSET_H
-
-#include "TeBaseSTInstanceSet.h"
-#include "TeSTInstance.h"
-#include "TeTimeInterval.h"
-#include "TeMultiGeometry.h"
-
-class TeQuerier;
-class TeTheme;
-class TeLayer;
-
-
-/*! \class TeSTElementSet
-	\brief A class that represents a set of spatial temporal instances.
-
-	This class specializes the abstract class TeBaseSTInstanceSet representing
-	each spatial temporal instance of the set as a TeSTInstance type. That is, the 
-	geometries of each instance in this set is represented as multi geometries 
-	(TeMultiGeometry class)and its valid time as a time interval (TeTimeInterval class). 
-
-	\sa TeBaseSTInstanceSet TeSTInstance TeMultiGeometry TeTimeInterval TeTheme TeLayer
-*/
-class TL_DLL TeSTElementSet  : public TeBaseSTInstanceSet<TeMultiGeometry, TeTimeInterval, TeSTInstance>
-{
-protected:
-
-	//! Builds the set using a given querier and a specific slice
-	bool buildImpl(TeQuerier* querier, const int& slide = -1);
-
-public:
-	//! Constructor
-	TeSTElementSet() : TeBaseSTInstanceSet<TeMultiGeometry, TeTimeInterval, TeSTInstance>()
-	{ }
-
-	//! Constructor 
-	TeSTElementSet(TeTheme* theme, TeAttributeList attList = TeAttributeList()) : 
-		TeBaseSTInstanceSet<TeMultiGeometry, TeTimeInterval, TeSTInstance>(theme, attList)
-	{ }
-	
-	//! Constructor 
-	TeSTElementSet(TeLayer* layer, TeAttributeList attList = TeAttributeList()) : 
-		TeBaseSTInstanceSet<TeMultiGeometry, TeTimeInterval, TeSTInstance>(layer, attList)
-	{ }
-
-
-	//! Constructor 
-	TeSTElementSet(const TeBox& box, const TeAttributeList& attrList) :
-		TeBaseSTInstanceSet<TeMultiGeometry, TeTimeInterval, TeSTInstance>(box, attrList)
-	{ }
-
-
-	//! Returns the valid time interval for all ST instances
-	TeTimeInterval totalTime(); 
-
-	//! Sets the valid time interval for all ST instances
-	void totalTime(TeTimeInterval t); 
-
-	//! Deprecated: Verifies if there is a specific element or object in the set 
-	bool hasElement(const string& objId);
-
-	//! Sets a polygon set and its valid time interval to a specific object or element
-	bool setGeometry(const string& object_id, const TePolygonSet& geomSet, TeTimeInterval time = TeTimeInterval());
-	//! Sets a line set and its valid time interval to a specific object or element
-	bool setGeometry(const string& object_id, const TeLineSet& geomSet, TeTimeInterval time = TeTimeInterval());
-	//! Sets a point set and its valid time interval to a specific object or element
-	bool setGeometry(const string& object_id, const TePointSet& geomSet, TeTimeInterval time = TeTimeInterval());
-	//! Sets a cell set and its valid time interval to a specific object or element
-	bool setGeometry(const string& object_id, const TeCellSet& geomSet, TeTimeInterval time = TeTimeInterval());
-	//! Sets a text set and its valid time interval to a specific object or element
-	bool setGeometry(const string& object_id, const TeTextSet& geomSet, TeTimeInterval time = TeTimeInterval()); 
-
-	//! Gets a polygon set of an element or object and its valid time interval
-	bool getGeometry(const string& object_id, TePolygonSet& geomSet, TeTimeInterval time = TeTimeInterval());
-	//! Gets a line set of an element or object and its valid time interval
-	bool getGeometry(const string& object_id, TeLineSet& geomSet, TeTimeInterval time = TeTimeInterval());
-	//! Gets a point set of an element or object and its valid time interval
-	bool getGeometry(const string& object_id, TePointSet& geomSet, TeTimeInterval time = TeTimeInterval());
-	//! Gets a cell set of an element or object and its valid time interval
-	bool getGeometry(const string& object_id, TeCellSet& geomSet, TeTimeInterval time = TeTimeInterval());
-	//! Gets a text set of an element or object and its valid time interval
-	bool getGeometry(const string& object_id, TeTextSet& geomSet, TeTimeInterval time = TeTimeInterval());
-};
-
-
-/*! \example createSTElementSetFromLayer.cpp
-	Shows how to create a spatio-temporal element set from a layer.
- */
-
-/*! \example createSTElementSetFromShapeFile.cpp
-	Shows how to create aspatio-temporal element set from a shapefile.
- */
-
-/*! \example createSTElementSetFromTheme.cpp
-	Shows how to create aspatio-temporal element set from a theme.
- */
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSTElementSet.h
+	\brief This file contains structures to deal with a set of spatio-temporal 
+	instances. These instances can belong to a specific layer or theme.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_STELEMENTSET_H
+#define  __TERRALIB_INTERNAL_STELEMENTSET_H
+
+#include "TeBaseSTInstanceSet.h"
+#include "TeSTInstance.h"
+#include "TeTimeInterval.h"
+#include "TeMultiGeometry.h"
+
+class TeQuerier;
+class TeTheme;
+class TeLayer;
+
+
+/*! \class TeSTElementSet
+	\brief A class that represents a set of spatial temporal instances.
+
+	This class specializes the abstract class TeBaseSTInstanceSet representing
+	each spatial temporal instance of the set as a TeSTInstance type. That is, the 
+	geometries of each instance in this set is represented as multi geometries 
+	(TeMultiGeometry class)and its valid time as a time interval (TeTimeInterval class). 
+
+	\sa TeBaseSTInstanceSet TeSTInstance TeMultiGeometry TeTimeInterval TeTheme TeLayer
+*/
+class TL_DLL TeSTElementSet  : public TeBaseSTInstanceSet<TeMultiGeometry, TeTimeInterval, TeSTInstance>
+{
+protected:
+
+	//! Builds the set using a given querier and a specific slice
+	bool buildImpl(TeQuerier* querier, const int& slide = -1);
+
+public:
+	//! Constructor
+	TeSTElementSet() : TeBaseSTInstanceSet<TeMultiGeometry, TeTimeInterval, TeSTInstance>()
+	{ }
+
+	//! Constructor 
+	TeSTElementSet(TeTheme* theme, TeAttributeList attList = TeAttributeList()) : 
+		TeBaseSTInstanceSet<TeMultiGeometry, TeTimeInterval, TeSTInstance>(theme, attList)
+	{ }
+	
+	//! Constructor 
+	TeSTElementSet(TeLayer* layer, TeAttributeList attList = TeAttributeList()) : 
+		TeBaseSTInstanceSet<TeMultiGeometry, TeTimeInterval, TeSTInstance>(layer, attList)
+	{ }
+
+
+	//! Constructor 
+	TeSTElementSet(const TeBox& box, const TeAttributeList& attrList) :
+		TeBaseSTInstanceSet<TeMultiGeometry, TeTimeInterval, TeSTInstance>(box, attrList)
+	{ }
+
+
+	//! Returns the valid time interval for all ST instances
+	TeTimeInterval totalTime(); 
+
+	//! Sets the valid time interval for all ST instances
+	void totalTime(TeTimeInterval t); 
+
+	//! Deprecated: Verifies if there is a specific element or object in the set 
+	bool hasElement(const string& objId);
+
+	//! Sets a polygon set and its valid time interval to a specific object or element
+	bool setGeometry(const string& object_id, const TePolygonSet& geomSet, TeTimeInterval time = TeTimeInterval());
+	//! Sets a line set and its valid time interval to a specific object or element
+	bool setGeometry(const string& object_id, const TeLineSet& geomSet, TeTimeInterval time = TeTimeInterval());
+	//! Sets a point set and its valid time interval to a specific object or element
+	bool setGeometry(const string& object_id, const TePointSet& geomSet, TeTimeInterval time = TeTimeInterval());
+	//! Sets a cell set and its valid time interval to a specific object or element
+	bool setGeometry(const string& object_id, const TeCellSet& geomSet, TeTimeInterval time = TeTimeInterval());
+	//! Sets a text set and its valid time interval to a specific object or element
+	bool setGeometry(const string& object_id, const TeTextSet& geomSet, TeTimeInterval time = TeTimeInterval()); 
+
+	//! Gets a polygon set of an element or object and its valid time interval
+	bool getGeometry(const string& object_id, TePolygonSet& geomSet, TeTimeInterval time = TeTimeInterval());
+	//! Gets a line set of an element or object and its valid time interval
+	bool getGeometry(const string& object_id, TeLineSet& geomSet, TeTimeInterval time = TeTimeInterval());
+	//! Gets a point set of an element or object and its valid time interval
+	bool getGeometry(const string& object_id, TePointSet& geomSet, TeTimeInterval time = TeTimeInterval());
+	//! Gets a cell set of an element or object and its valid time interval
+	bool getGeometry(const string& object_id, TeCellSet& geomSet, TeTimeInterval time = TeTimeInterval());
+	//! Gets a text set of an element or object and its valid time interval
+	bool getGeometry(const string& object_id, TeTextSet& geomSet, TeTimeInterval time = TeTimeInterval());
+};
+
+
+/*! \example createSTElementSetFromLayer.cpp
+	Shows how to create a spatio-temporal element set from a layer.
+ */
+
+/*! \example createSTElementSetFromShapeFile.cpp
+	Shows how to create aspatio-temporal element set from a shapefile.
+ */
+
+/*! \example createSTElementSetFromTheme.cpp
+	Shows how to create aspatio-temporal element set from a theme.
+ */
+#endif
+
diff --git a/src/terralib/kernel/TeSTEvent.cpp b/src/terralib/kernel/TeSTEvent.cpp
old mode 100755
new mode 100644
index 34e9572..c544c51
--- a/src/terralib/kernel/TeSTEvent.cpp
+++ b/src/terralib/kernel/TeSTEvent.cpp
@@ -1,207 +1,207 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeSTEvent.h"
-
-///------------ TeSTEvent
-void 
-TeSTEvent::clear()
-{
-	TeBaseSTInstance<TePoint, long>::clear();
-	geometries_ = TePoint(); 
-	time_ = -1;
-}
-
-bool 
-TeSTEvent::isTimeValid() 
-{
-	return (time_>=0);
-}
-
-///------------ TeSTEventSet
-
-TeSTEventSet::TeSTEventSet(TeTheme* theme, const TeAttributeList& attrList) : 
-	TeBaseSTInstanceSet<TePoint, long, TeSTEvent>(theme, attrList)
-{
-	kdTree_ = 0;
-}
-
-TeSTEventSet::~TeSTEventSet()
-{
-	if(kdTree_)
-		delete kdTree_;
-	kdTree_ = 0;
-}
-
-bool TeSTEventSet::buildKdTree(const int& n)
-{
-	if(!theme_)
-		return false;
-    if(kdTree_)
-		delete kdTree_;
-
-	vector<pair<TeCoord2D, TePoint> >	dataSetAux; //auxiliary structure for kdTree
-	TeSTEventSet::iterator it = this->begin();
-	int index=0;
-	while(it!=this->end())
-	{
-		TePoint point = it->getGeometries();
-		point.geomId(index);
-		dataSetAux.push_back(pair<TeCoord2D, TePoint>(point.location(), point));
-		++it;
-		++index;
-	}
-
-	int bucketSize; 
-	if(n<0)
-		bucketSize= 30;
-	else
-		bucketSize= 2*n;
-	kdTree_ = new kdTree(theme_->box(), bucketSize);
-	kdTree_->build(dataSetAux);
-	return true;
-}
-
-bool TeSTEventSet::search(const TeBox& b, vector<TeSTEvent* >& result)
-{
-	if(!kdTree_)
-		return false;
-	
-	vector<kdNode*> nodes;
-	kdTree_->search(b, nodes);
-	for(unsigned int i=0; i<nodes.size(); ++i)
-	{
-		for(unsigned int j=0; j<nodes[i]->getData().size(); ++j) //vector<TePoint>
-		{
-			int index = ((nodes[i]->getData())[j]).geomId(); 
-			TeSTEvent* ev = dynamic_cast<TeSTEvent*> (this->getSTInstance(index));
-			result.push_back(ev); 
-		}
-	}
-	return true;
-}
-
-bool TeSTEventSet::nearestNeighbourSearch(const TeCoord2D& coord, vector<TeSTEvent* >& result, 
-										  vector<double>& distances, const unsigned int& k)
-{
-	vector<TePoint> res;
-	for(unsigned int n=0; n<k; ++n)
-		res.push_back (TePoint(TeMAXFLOAT,TeMAXFLOAT));
-	kdTree_->nearestNeighborSearch(coord, res, distances, k); 
-	for(unsigned int j=0; j<res.size(); ++j)
-		result.push_back(dynamic_cast<TeSTEvent*>(getSTInstance(res[j].geomId()))); 
-	return true;
-}
-
-void TeSTEventSet::clear()
-{
-	TeBaseSTInstanceSet<TePoint, long, TeSTEvent>::clear();
-	if(kdTree_)
-		delete kdTree_;
-	kdTree_ = 0;
-}
-
-bool 
-TeSTEventSet::buildImpl(TeQuerier* querier, const int& slide)
-{
-	int dt = CLOCKS_PER_SEC/4, steps = 0;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	
-	t0=t1=t2=clock();
-
-	if(!querier)
-		return false;
-
-	if(!querier->loadInstances(slide))
-		return false;
-
-	//clear all structures
-	attrList_->clear();
-	instances_.clear();
-	objectIdToInstances_.clear();
-	timeToInstances_.clear();
-	sliceToInstances_.clear();
-	if(rTree_)
-		delete rTree_;
-	rTree_ = 0; 
-	kdTree_->clear();
-	
-	//Builts another rTree
-	TeBox b;
-	if(theme_)
-		b = theme_->box();
-	else if(layer_)
-		b = layer_->box();
-	else
-		b = this->box_; 
-	rTree_ = new TeSAM::TeRTree<int>(b); 
-	
-	TeAttributeList l = querier->getAttrList();
-	setAttributeList(l);
-
-	int tot = querier->numElemInstances();
-	if(TeProgress::instance())
-	{
-		string caption = "Building data";
-		TeProgress::instance()->setCaption(caption.c_str());
-		string msg = "Building in progress. Please, wait!";
-		TeProgress::instance()->setMessage(msg);
-		TeProgress::instance()->setTotalSteps(tot);
-		t2 = clock();
-		t0 = t1 = t2;
-	}
-	
-	TeSTInstance obj;
-	while(querier->fetchInstance(obj)) 
-	{
-		TeCoord2D p;
-		obj.centroid(p);
-
-		TeSTEvent event(obj.getObjectId(), TePoint(p), obj.getProperties(), 0, -1);
-		this->insertSTInstance(event);
-
-		if(TeProgress::instance())
-		{
-			steps++;
-			t2 = clock();
-			if (int(t2-t1) > dt)
-			{
-				t1 = t2;
-				if(TeProgress::instance()->wasCancelled())
-					return false;
-				
-				if((int)(t2-t0) > dt2)
-					TeProgress::instance()->setProgress(steps);
-			}
-		}
-	}
-	if(TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	return true;
-}
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeSTEvent.h"
+
+///------------ TeSTEvent
+void 
+TeSTEvent::clear()
+{
+	TeBaseSTInstance<TePoint, long>::clear();
+	geometries_ = TePoint(); 
+	time_ = -1;
+}
+
+bool 
+TeSTEvent::isTimeValid() 
+{
+	return (time_>=0);
+}
+
+///------------ TeSTEventSet
+
+TeSTEventSet::TeSTEventSet(TeTheme* theme, const TeAttributeList& attrList) : 
+	TeBaseSTInstanceSet<TePoint, long, TeSTEvent>(theme, attrList)
+{
+	kdTree_ = 0;
+}
+
+TeSTEventSet::~TeSTEventSet()
+{
+	if(kdTree_)
+		delete kdTree_;
+	kdTree_ = 0;
+}
+
+bool TeSTEventSet::buildKdTree(const int& n)
+{
+	if(!theme_)
+		return false;
+    if(kdTree_)
+		delete kdTree_;
+
+	vector<pair<TeCoord2D, TePoint> >	dataSetAux; //auxiliary structure for kdTree
+	TeSTEventSet::iterator it = this->begin();
+	int index=0;
+	while(it!=this->end())
+	{
+		TePoint point = it->getGeometries();
+		point.geomId(index);
+		dataSetAux.push_back(pair<TeCoord2D, TePoint>(point.location(), point));
+		++it;
+		++index;
+	}
+
+	int bucketSize; 
+	if(n<0)
+		bucketSize= 30;
+	else
+		bucketSize= 2*n;
+	kdTree_ = new kdTree(theme_->box(), bucketSize);
+	kdTree_->build(dataSetAux);
+	return true;
+}
+
+bool TeSTEventSet::search(const TeBox& b, vector<TeSTEvent* >& result)
+{
+	if(!kdTree_)
+		return false;
+	
+	vector<kdNode*> nodes;
+	kdTree_->search(b, nodes);
+	for(unsigned int i=0; i<nodes.size(); ++i)
+	{
+		for(unsigned int j=0; j<nodes[i]->getData().size(); ++j) //vector<TePoint>
+		{
+			int index = ((nodes[i]->getData())[j]).geomId(); 
+			TeSTEvent* ev = dynamic_cast<TeSTEvent*> (this->getSTInstance(index));
+			result.push_back(ev); 
+		}
+	}
+	return true;
+}
+
+bool TeSTEventSet::nearestNeighbourSearch(const TeCoord2D& coord, vector<TeSTEvent* >& result, 
+										  vector<double>& distances, const unsigned int& k)
+{
+	vector<TePoint> res;
+	for(unsigned int n=0; n<k; ++n)
+		res.push_back (TePoint(TeMAXFLOAT,TeMAXFLOAT));
+	kdTree_->nearestNeighborSearch(coord, res, distances, k); 
+	for(unsigned int j=0; j<res.size(); ++j)
+		result.push_back(dynamic_cast<TeSTEvent*>(getSTInstance(res[j].geomId()))); 
+	return true;
+}
+
+void TeSTEventSet::clear()
+{
+	TeBaseSTInstanceSet<TePoint, long, TeSTEvent>::clear();
+	if(kdTree_)
+		delete kdTree_;
+	kdTree_ = 0;
+}
+
+bool 
+TeSTEventSet::buildImpl(TeQuerier* querier, const int& slide)
+{
+	int dt = CLOCKS_PER_SEC/4, steps = 0;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	
+	t0=t1=t2=clock();
+
+	if(!querier)
+		return false;
+
+	if(!querier->loadInstances(slide))
+		return false;
+
+	//clear all structures
+	attrList_->clear();
+	instances_.clear();
+	objectIdToInstances_.clear();
+	timeToInstances_.clear();
+	sliceToInstances_.clear();
+	if(rTree_)
+		delete rTree_;
+	rTree_ = 0; 
+	kdTree_->clear();
+	
+	//Builts another rTree
+	TeBox b;
+	if(theme_)
+		b = theme_->box();
+	else if(layer_)
+		b = layer_->box();
+	else
+		b = this->box_; 
+	rTree_ = new TeSAM::TeRTree<int>(b); 
+	
+	TeAttributeList l = querier->getAttrList();
+	setAttributeList(l);
+
+	int tot = querier->numElemInstances();
+	if(TeProgress::instance())
+	{
+		string caption = "Building data";
+		TeProgress::instance()->setCaption(caption.c_str());
+		string msg = "Building in progress. Please, wait!";
+		TeProgress::instance()->setMessage(msg);
+		TeProgress::instance()->setTotalSteps(tot);
+		t2 = clock();
+		t0 = t1 = t2;
+	}
+	
+	TeSTInstance obj;
+	while(querier->fetchInstance(obj)) 
+	{
+		TeCoord2D p;
+		obj.centroid(p);
+
+		TeSTEvent event(obj.getObjectId(), TePoint(p), obj.getProperties(), 0, -1);
+		this->insertSTInstance(event);
+
+		if(TeProgress::instance())
+		{
+			steps++;
+			t2 = clock();
+			if (int(t2-t1) > dt)
+			{
+				t1 = t2;
+				if(TeProgress::instance()->wasCancelled())
+					return false;
+				
+				if((int)(t2-t0) > dt2)
+					TeProgress::instance()->setProgress(steps);
+			}
+		}
+	}
+	if(TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	return true;
+}
+
+
+
+
diff --git a/src/terralib/kernel/TeSTEvent.h b/src/terralib/kernel/TeSTEvent.h
old mode 100755
new mode 100644
index c2f51f2..52b1dbe
--- a/src/terralib/kernel/TeSTEvent.h
+++ b/src/terralib/kernel/TeSTEvent.h
@@ -1,132 +1,132 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSTEvent.h
-	\brief This file contains structures and definitions to deal with spatial 
-	temporal events. 
-*/
-
-#ifndef  __TERRALIB_INTERNAL_STEVENT_H
-#define  __TERRALIB_INTERNAL_STEVENT_H
-
-#include "TeBaseSTInstance.h"
-#include "TeBaseSTInstanceSet.h"
-#include "TeGeometry.h"
-#include "TeKdTree.h"
-
-
-/*! \class TeSTEvent
-	\brief A class that represents spatial temporal events (STEvent).
-
-	A spatial temporal event is represented by a location (point), 
-	a time when it happened and a set of attributes. This class 
-	specializes the base class TeBaseSTInstance representing the geometries 
-	as points (TePoint) and the valid time as a integer (long).
-
-	\sa TeBaseSTInstance TePoint 
-*/
-class TL_DLL TeSTEvent : public TeBaseSTInstance<TePoint, long>
-{	
-public:
-	
-	//! Empty constructor
-	TeSTEvent() : TeBaseSTInstance<TePoint, long>()
-	{ }
-
-	//! Constructor
-	TeSTEvent(const string& objId, const TePoint& point, const long& time) :
-		TeBaseSTInstance<TePoint, long>(objId, point, time)
-	{ }
-
-	//! Constructor
-	TeSTEvent(const string& objId, const TePoint& point, const vector<string>& attrValues, 
-		TeAttributeList* attList, const long& time) :
-		TeBaseSTInstance<TePoint, long>(objId, attrValues, attList, point, -1, time)
-	{ }
-
-	//! Clear
-	virtual void clear(); 
-	
-	//! Verifies if the time associated to this event is valid
-	virtual bool isTimeValid(); 
-
-	//! Deprecated: Gets the event location (point)
-	void getGeometry(TePoint& result)
-	{	result = this->geometries(); }
-
-	//! Deprecated: Returns the valid time 
-	virtual TeTimeInterval timeInterval () 
-	{	TeTimeInterval t; return t;	}
-};
-
-
-/*! \class TeSTEventSet
-	\brief A class that represents a set of spatial temporal events.
-
-	This class specializes the abstract class TeBaseSTInstanceSet representing
-	each spatial temporal instance of the set as a TeSTEvent type. That is, the 
-	geometries of each instance or event in this set is represented as a point 
-	(TePoint class)and its valid time as a simple number (long type). 
-
-	\sa TeBaseSTInstanceSet TeSTEvent TePoint TeTheme TeLayer
-*/
-class TL_DLL TeSTEventSet : public TeBaseSTInstanceSet<TePoint, long, TeSTEvent>
-{
-protected:
-
-	typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, vector<TePoint>, TePoint> kdNode;
-	typedef TeSAM::TeAdaptativeKdTree<kdNode> kdTree;
-
-	//! Index structure (KD Tree) to index the point locations
-	kdTree*		kdTree_;
-
-	//! Build the set using querier
-	bool buildImpl(TeQuerier* querier, const int& slide = -1);
-
-public:			
-	//! Constructor	
-	TeSTEventSet(TeTheme* theme=0, const TeAttributeList& attrList = TeAttributeList()); 
-
-	//! Destructor	
-	~TeSTEventSet();
-
-	//! Build a index structure (kdTree) over all event points in this set
-	virtual bool buildKdTree(const int& n); 
-	
-	//! Searchs the event points inside a specific bounding box 
-	virtual bool search(const TeBox& b, vector<TeSTEvent* >& result);
-
-	//! Searchs the k-nearest neighbours of a specific coordinate
-	virtual bool nearestNeighbourSearch(const TeCoord2D& coord, vector<TeSTEvent* >& result, vector<double>& distances, const unsigned int& k);
-	
-	//! Clears the event set 
-	virtual void clear(); 
-};
-
-#endif
-
-
-
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSTEvent.h
+	\brief This file contains structures and definitions to deal with spatial 
+	temporal events. 
+*/
+
+#ifndef  __TERRALIB_INTERNAL_STEVENT_H
+#define  __TERRALIB_INTERNAL_STEVENT_H
+
+#include "TeBaseSTInstance.h"
+#include "TeBaseSTInstanceSet.h"
+#include "TeGeometry.h"
+#include "TeKdTree.h"
+
+
+/*! \class TeSTEvent
+	\brief A class that represents spatial temporal events (STEvent).
+
+	A spatial temporal event is represented by a location (point), 
+	a time when it happened and a set of attributes. This class 
+	specializes the base class TeBaseSTInstance representing the geometries 
+	as points (TePoint) and the valid time as a integer (long).
+
+	\sa TeBaseSTInstance TePoint 
+*/
+class TL_DLL TeSTEvent : public TeBaseSTInstance<TePoint, long>
+{	
+public:
+	
+	//! Empty constructor
+	TeSTEvent() : TeBaseSTInstance<TePoint, long>()
+	{ }
+
+	//! Constructor
+	TeSTEvent(const string& objId, const TePoint& point, const long& time) :
+		TeBaseSTInstance<TePoint, long>(objId, point, time)
+	{ }
+
+	//! Constructor
+	TeSTEvent(const string& objId, const TePoint& point, const vector<string>& attrValues, 
+		TeAttributeList* attList, const long& time) :
+		TeBaseSTInstance<TePoint, long>(objId, attrValues, attList, point, -1, time)
+	{ }
+
+	//! Clear
+	virtual void clear(); 
+	
+	//! Verifies if the time associated to this event is valid
+	virtual bool isTimeValid(); 
+
+	//! Deprecated: Gets the event location (point)
+	void getGeometry(TePoint& result)
+	{	result = this->geometries(); }
+
+	//! Deprecated: Returns the valid time 
+	virtual TeTimeInterval timeInterval () 
+	{	TeTimeInterval t; return t;	}
+};
+
+
+/*! \class TeSTEventSet
+	\brief A class that represents a set of spatial temporal events.
+
+	This class specializes the abstract class TeBaseSTInstanceSet representing
+	each spatial temporal instance of the set as a TeSTEvent type. That is, the 
+	geometries of each instance or event in this set is represented as a point 
+	(TePoint class)and its valid time as a simple number (long type). 
+
+	\sa TeBaseSTInstanceSet TeSTEvent TePoint TeTheme TeLayer
+*/
+class TL_DLL TeSTEventSet : public TeBaseSTInstanceSet<TePoint, long, TeSTEvent>
+{
+protected:
+
+	typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, vector<TePoint>, TePoint> kdNode;
+	typedef TeSAM::TeAdaptativeKdTree<kdNode> kdTree;
+
+	//! Index structure (KD Tree) to index the point locations
+	kdTree*		kdTree_;
+
+	//! Build the set using querier
+	bool buildImpl(TeQuerier* querier, const int& slide = -1);
+
+public:			
+	//! Constructor	
+	TeSTEventSet(TeTheme* theme=0, const TeAttributeList& attrList = TeAttributeList()); 
+
+	//! Destructor	
+	~TeSTEventSet();
+
+	//! Build a index structure (kdTree) over all event points in this set
+	virtual bool buildKdTree(const int& n); 
+	
+	//! Searchs the event points inside a specific bounding box 
+	virtual bool search(const TeBox& b, vector<TeSTEvent* >& result);
+
+	//! Searchs the k-nearest neighbours of a specific coordinate
+	virtual bool nearestNeighbourSearch(const TeCoord2D& coord, vector<TeSTEvent* >& result, vector<double>& distances, const unsigned int& k);
+	
+	//! Clears the event set 
+	virtual void clear(); 
+};
+
+#endif
+
+
+
+
+
+
+
diff --git a/src/terralib/kernel/TeSTInstance.cpp b/src/terralib/kernel/TeSTInstance.cpp
old mode 100755
new mode 100644
index 1bd9ce3..172ebeb
--- a/src/terralib/kernel/TeSTInstance.cpp
+++ b/src/terralib/kernel/TeSTInstance.cpp
@@ -1,353 +1,353 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-
-#include <TeSTInstance.h>
-
-
-TeSTInstance::TeSTInstance (const string& object_id, TeProperty& prop) :
-	TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>()
-{
-	object_id_ = object_id;
-	properties_.push_back(prop.value_);
-}
-
-void 
-TeSTInstance::clear() 
-{
-	TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>::clear();
-	geometries_.clear(); 
-	time_ = TeTimeInterval();
-}
-
-
-bool 
-TeSTInstance::isTimeValid()
-{
-	return (this->time_.isValid());
-}
-	
-bool 
-TeSTInstance::hasPolygons()	
-{ 
-	return (geometries_.hasPolygons()); 
-} 
-	
-bool 
-TeSTInstance::hasLines()		
-{ 
-	return (geometries_.hasLines()); 
-} 
-	
-bool 
-TeSTInstance::hasPoints()		
-{ 
-	return (geometries_.hasPoints()); 
-} 
-	
-bool 
-TeSTInstance::hasCells()		
-{ 
-	return (geometries_.hasCells()); 
-} 
-
-bool 
-TeSTInstance::hasTexts()		
-{ 
-	return (geometries_.hasTexts()); 
-} 
-	
-bool 
-TeSTInstance::getGeometry(TePolygonSet& result)
-{
-	if(geometries_.getGeometry(result))
-		return true;
-	return false;
-}
-	
-bool 
-TeSTInstance::getGeometry(TeLineSet& result)
-{
-	if(geometries_.getGeometry(result))
-		return true;
-	return false;
-}
-
-bool 
-TeSTInstance::getGeometry(TePointSet& result)
-{
-	if(geometries_.getGeometry(result))
-		return true;
-	return false;
-}
-
-bool 
-TeSTInstance::getGeometry(TeCellSet& result)
-{
-	if(geometries_.getGeometry(result))
-		return true;
-	return false;
-}
-
-bool 
-TeSTInstance::getGeometry(TeTextSet& result)
-{
-	if(geometries_.getGeometry(result))
-		return true;
-	return false;
-}
-
-bool 
-TeSTInstance::getGeometry(vector<TeGeometry*>& result)
-{
-	if(geometries_.getGeometry(result))
-		return true;
-	return false;
-}
-
-bool 
-TeSTInstance::getGeometry(TeMultiGeometry& result)
-{
-	if(!geometries_.empty())
-	{
-		result = geometries_;
-		return true; 
-	}
-
-	geometries_.getGeometry (result.polygons_);
-	geometries_.getGeometry (result.lines_);
-	geometries_.getGeometry (result.points_);
-	geometries_.getGeometry (result.cells_);
-	
-	return (!result.empty());
-}
-
-TePolygonSet&  
-TeSTInstance::getPolygons()
-{	
-	return geometries_.getPolygons(); 
-}
-	
-TeLineSet&  
-TeSTInstance::getLines()
-{	
-	return geometries_.getLines(); 
-}
-
-TePointSet&  
-TeSTInstance::getPoints()
-{	
-	return geometries_.getPoints(); 
-}
-
-TeCellSet&  
-TeSTInstance::getCells()
-{	
-	return geometries_.getCells(); 
-}
-
-TeTextSet&  
-TeSTInstance::getTexts()
-{	
-	return geometries_.getTexts(); 
-}
-
-void 
-TeSTInstance::setGeometry(const TePolygonSet& result)
-{ 
-	geometries_.setGeometry(result); 
-}
-	
-void 
-TeSTInstance::setGeometry(const TeLineSet& result)
-{ 
-	geometries_.setGeometry(result); 
-}
-	
-void 
-TeSTInstance::setGeometry(const TePointSet& result)
-{ 
-	geometries_.setGeometry(result); 
-}
-	
-void 
-TeSTInstance::setGeometry(const TeCellSet& result)
-{ 
-	geometries_.setGeometry(result); 
-}
-	
-void 
-TeSTInstance::setGeometry(const TeTextSet& result)
-{ 
-	geometries_.setGeometry(result); 
-}
-
-void 
-TeSTInstance::setGeometry(const TeMultiGeometry& result)
-{ 
-	geometries_ = result; 
-}
- 
-bool 
-TeSTInstance::addGeometry(const TePolygon& poly)  
-{ 
-	if(poly.objectId() == objectId())
-	{
-		geometries_.addGeometry (poly);
-		return true;
-	}
-	return false;
-}
-	
-bool 
-TeSTInstance::addGeometry(const TeLine2D& line)     
-{ 
-	if(line.objectId() == objectId())
-	{
-		geometries_.addGeometry (line);
-		return true;
-	}
-	return false; 
-}
-	
-bool 
-TeSTInstance::addGeometry(const TePoint& point)	
-{ 
-	if(point.objectId() == objectId())
-	{
-		geometries_.addGeometry (point);
-		return true;
-	}
-	return false;  
-} 
-	
-bool
-TeSTInstance::addGeometry(const TeCell& cell)		
-{ 
-	if(cell.objectId() == objectId())
-	{
-		geometries_.addGeometry (cell);
-		return true;
-	}
-	return false;  
-}
-
-bool
-TeSTInstance::addGeometry(const TeText& text)		
-{ 
-	if(text.objectId() == objectId())
-	{
-		geometries_.addGeometry (text);
-		return true;
-	}
-	return false;  
-}
-
-void 
-TeSTInstance::centroid(TeCoord2D& centroid, TeGeomRep geomRep)
-{
-	if(geomRep==TePOLYGONS)
-	{ 
-		TePolygonSet pols;
-		if(getGeometry(pols))
-		{
-			centroid = TeFindCentroid(pols);
-			return;
-		}
-	}
-	if(geomRep==TeLINES)
-	{
-		TeLineSet lins; 
-		if(getGeometry(lins))
-		{
-			centroid = TeFindCentroid(lins);
-			return;
-		}
-	}
-	if(geomRep==TePOINTS)
-	{
-		TePointSet points; 
-		if(getGeometry(points))
-		{
-			centroid = TeFindCentroid(points);
-			return;
-		}
-	}
-	if(geomRep==TeCELLS)
-	{
-		TeCellSet cells; 
-		if(getGeometry(cells))
-		{
-			centroid = TeFindCentroid(cells);
-			return;
-		}
-	}
-	if(geomRep==TeGEOMETRYNONE)
-	{
-		if(hasPolygons())
-			this->centroid(centroid, TePOLYGONS);
-		else if(hasLines())
-			this->centroid(centroid, TeLINES);
-		else if (hasPoints())
-			this->centroid(centroid, TePOINTS);
-		else if (hasCells())
-			this->centroid(centroid, TeCELLS);
-	}
-
-	return;
-}
-
-void 
-TeSTInstance::area(double& a, TeGeomRep geomRep)
-{
-	a = 0.;
-	if(geomRep==TePOLYGONS)
-	{ 
-		TePolygonSet pols;
-		if(getGeometry(pols))
-		{
-			a = TeGeometryArea(pols);
-			return;
-		}
-	}
-	if(geomRep==TeCELLS)
-	{
-		TeCellSet cells; 
-		if(getGeometry(cells))
-		{
-			a = TeGeometryArea(cells);
-			return;
-		}
-	}
-	if(geomRep==TeGEOMETRYNONE)
-	{
-		if(hasPolygons())
-			this->area(a, TePOLYGONS);
-		else if (hasCells())
-			this->area(a, TeCELLS);
-	}
-
-	return;
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+
+#include <TeSTInstance.h>
+
+
+TeSTInstance::TeSTInstance (const string& object_id, TeProperty& prop) :
+	TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>()
+{
+	object_id_ = object_id;
+	properties_.push_back(prop.value_);
+}
+
+void 
+TeSTInstance::clear() 
+{
+	TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>::clear();
+	geometries_.clear(); 
+	time_ = TeTimeInterval();
+}
+
+
+bool 
+TeSTInstance::isTimeValid()
+{
+	return (this->time_.isValid());
+}
+	
+bool 
+TeSTInstance::hasPolygons()	
+{ 
+	return (geometries_.hasPolygons()); 
+} 
+	
+bool 
+TeSTInstance::hasLines()		
+{ 
+	return (geometries_.hasLines()); 
+} 
+	
+bool 
+TeSTInstance::hasPoints()		
+{ 
+	return (geometries_.hasPoints()); 
+} 
+	
+bool 
+TeSTInstance::hasCells()		
+{ 
+	return (geometries_.hasCells()); 
+} 
+
+bool 
+TeSTInstance::hasTexts()		
+{ 
+	return (geometries_.hasTexts()); 
+} 
+	
+bool 
+TeSTInstance::getGeometry(TePolygonSet& result)
+{
+	if(geometries_.getGeometry(result))
+		return true;
+	return false;
+}
+	
+bool 
+TeSTInstance::getGeometry(TeLineSet& result)
+{
+	if(geometries_.getGeometry(result))
+		return true;
+	return false;
+}
+
+bool 
+TeSTInstance::getGeometry(TePointSet& result)
+{
+	if(geometries_.getGeometry(result))
+		return true;
+	return false;
+}
+
+bool 
+TeSTInstance::getGeometry(TeCellSet& result)
+{
+	if(geometries_.getGeometry(result))
+		return true;
+	return false;
+}
+
+bool 
+TeSTInstance::getGeometry(TeTextSet& result)
+{
+	if(geometries_.getGeometry(result))
+		return true;
+	return false;
+}
+
+bool 
+TeSTInstance::getGeometry(vector<TeGeometry*>& result)
+{
+	if(geometries_.getGeometry(result))
+		return true;
+	return false;
+}
+
+bool 
+TeSTInstance::getGeometry(TeMultiGeometry& result)
+{
+	if(!geometries_.empty())
+	{
+		result = geometries_;
+		return true; 
+	}
+
+	geometries_.getGeometry (result.polygons_);
+	geometries_.getGeometry (result.lines_);
+	geometries_.getGeometry (result.points_);
+	geometries_.getGeometry (result.cells_);
+	
+	return (!result.empty());
+}
+
+TePolygonSet&  
+TeSTInstance::getPolygons()
+{	
+	return geometries_.getPolygons(); 
+}
+	
+TeLineSet&  
+TeSTInstance::getLines()
+{	
+	return geometries_.getLines(); 
+}
+
+TePointSet&  
+TeSTInstance::getPoints()
+{	
+	return geometries_.getPoints(); 
+}
+
+TeCellSet&  
+TeSTInstance::getCells()
+{	
+	return geometries_.getCells(); 
+}
+
+TeTextSet&  
+TeSTInstance::getTexts()
+{	
+	return geometries_.getTexts(); 
+}
+
+void 
+TeSTInstance::setGeometry(const TePolygonSet& result)
+{ 
+	geometries_.setGeometry(result); 
+}
+	
+void 
+TeSTInstance::setGeometry(const TeLineSet& result)
+{ 
+	geometries_.setGeometry(result); 
+}
+	
+void 
+TeSTInstance::setGeometry(const TePointSet& result)
+{ 
+	geometries_.setGeometry(result); 
+}
+	
+void 
+TeSTInstance::setGeometry(const TeCellSet& result)
+{ 
+	geometries_.setGeometry(result); 
+}
+	
+void 
+TeSTInstance::setGeometry(const TeTextSet& result)
+{ 
+	geometries_.setGeometry(result); 
+}
+
+void 
+TeSTInstance::setGeometry(const TeMultiGeometry& result)
+{ 
+	geometries_ = result; 
+}
+ 
+bool 
+TeSTInstance::addGeometry(const TePolygon& poly)  
+{ 
+	if(poly.objectId() == objectId())
+	{
+		geometries_.addGeometry (poly);
+		return true;
+	}
+	return false;
+}
+	
+bool 
+TeSTInstance::addGeometry(const TeLine2D& line)     
+{ 
+	if(line.objectId() == objectId())
+	{
+		geometries_.addGeometry (line);
+		return true;
+	}
+	return false; 
+}
+	
+bool 
+TeSTInstance::addGeometry(const TePoint& point)	
+{ 
+	if(point.objectId() == objectId())
+	{
+		geometries_.addGeometry (point);
+		return true;
+	}
+	return false;  
+} 
+	
+bool
+TeSTInstance::addGeometry(const TeCell& cell)		
+{ 
+	if(cell.objectId() == objectId())
+	{
+		geometries_.addGeometry (cell);
+		return true;
+	}
+	return false;  
+}
+
+bool
+TeSTInstance::addGeometry(const TeText& text)		
+{ 
+	if(text.objectId() == objectId())
+	{
+		geometries_.addGeometry (text);
+		return true;
+	}
+	return false;  
+}
+
+void 
+TeSTInstance::centroid(TeCoord2D& centroid, TeGeomRep geomRep)
+{
+	if(geomRep==TePOLYGONS)
+	{ 
+		TePolygonSet pols;
+		if(getGeometry(pols))
+		{
+			centroid = TeFindCentroid(pols);
+			return;
+		}
+	}
+	if(geomRep==TeLINES)
+	{
+		TeLineSet lins; 
+		if(getGeometry(lins))
+		{
+			centroid = TeFindCentroid(lins);
+			return;
+		}
+	}
+	if(geomRep==TePOINTS)
+	{
+		TePointSet points; 
+		if(getGeometry(points))
+		{
+			centroid = TeFindCentroid(points);
+			return;
+		}
+	}
+	if(geomRep==TeCELLS)
+	{
+		TeCellSet cells; 
+		if(getGeometry(cells))
+		{
+			centroid = TeFindCentroid(cells);
+			return;
+		}
+	}
+	if(geomRep==TeGEOMETRYNONE)
+	{
+		if(hasPolygons())
+			this->centroid(centroid, TePOLYGONS);
+		else if(hasLines())
+			this->centroid(centroid, TeLINES);
+		else if (hasPoints())
+			this->centroid(centroid, TePOINTS);
+		else if (hasCells())
+			this->centroid(centroid, TeCELLS);
+	}
+
+	return;
+}
+
+void 
+TeSTInstance::area(double& a, TeGeomRep geomRep)
+{
+	a = 0.;
+	if(geomRep==TePOLYGONS)
+	{ 
+		TePolygonSet pols;
+		if(getGeometry(pols))
+		{
+			a = TeGeometryArea(pols);
+			return;
+		}
+	}
+	if(geomRep==TeCELLS)
+	{
+		TeCellSet cells; 
+		if(getGeometry(cells))
+		{
+			a = TeGeometryArea(cells);
+			return;
+		}
+	}
+	if(geomRep==TeGEOMETRYNONE)
+	{
+		if(hasPolygons())
+			this->area(a, TePOLYGONS);
+		else if (hasCells())
+			this->area(a, TeCELLS);
+	}
+
+	return;
+}
+
+
diff --git a/src/terralib/kernel/TeSTInstance.h b/src/terralib/kernel/TeSTInstance.h
old mode 100755
new mode 100644
index 9b981bf..bd6490a
--- a/src/terralib/kernel/TeSTInstance.h
+++ b/src/terralib/kernel/TeSTInstance.h
@@ -1,174 +1,174 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSTInstance.h
-	\brief This file contains a class called TeSTInstance that represents 
-	an instance in time of a geographical object or element.  
-*/
-
-#ifndef  __TERRALIB_INTERNAL_STINSTANCE_H
-#define  __TERRALIB_INTERNAL_STINSTANCE_H
-
-#include "TeTimeInterval.h"
-#include "TeMultiGeometry.h"
-#include "TeBaseSTInstance.h"
-
-#include <string>
-#include <map> 
-#include <vector>
-using namespace std;
-
-/*! \class TeSTInstance
-	\brief A class that represents an instance in a time of a spatial object.
-
-	A spatio-temporal instance (STInstance) is composite of an attribute set and geometries 
-	of a spatial element or object that are valid in a specific time. This class 
-	specializes the base class TeBaseSTInstance representing the geometries 
-	as multigeometries (TeMultiGeometry) and the valid time as a time interval (TeTimeInterval).
-
-	\sa TeBaseSTInstance TeMultiGeometry TeTimeInterval
-	
-*/
-class TL_DLL TeSTInstance : public TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>
-{
-public:		
-
-	//! Constructor
-	TeSTInstance() : 
-		TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>() 
-	{ }
-
-	//! Deprecated: Constructor
-	TeSTInstance (const string& object_id, TeProperty& prop); 
-
-	//! Constructor 
-	TeSTInstance (const string& object_id, vector<string>& prop, TeAttributeList* attList = 0, const int& s = -1) : 
-		TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>(object_id, prop, attList, s)
-	{ }
-
-	//! Constructor
-	TeSTInstance (const string& object_id, const TeMultiGeometry& geometries, 
-		const TeTimeInterval& time, const int& s = -1) : 
-		TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>(object_id, geometries, time, s)
-	{ }
-
-	//! Constructor 
-	TeSTInstance (const string& object_id, vector<string>& prop, TeAttributeList* attList, 
-		TeMultiGeometry& geometries, int& slice, TeTimeInterval& time ) :
-		TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>(object_id, prop, attList, geometries, slice, time)
-	{ }
-
-	//! Clear 
-	virtual void clear(); 
-	
-	//! Verifies if the its time is valid
-	virtual bool isTimeValid();
-	
-	//! Deprecated: Verifies if the instance has polygons
-	bool hasPolygons();	
-	//! Deprecated: Verifies if the instance has lines
-	bool hasLines();		
-	//! Deprecated: Verifies if the instance has points
-	bool hasPoints();		
-	//! Deprecated: Verifies if the instance has cells
-	bool hasCells();		
-	//! Deprecated: Return true if this has texts
-	bool hasTexts();		
-	
-	//! Deprecated: Gets a copy of the ST instance polygon set
-	bool getGeometry(TePolygonSet& result); 
-	//! Deprecated: Gets a copy of the ST instance line set
-	bool getGeometry(TeLineSet& result);
-	//! Deprecated: Gets a copy of the ST instance point set
-	bool getGeometry(TePointSet& result);
-	//! Deprecated: Gets a copy of the ST instance cell set
-	bool getGeometry(TeCellSet& result);
-	//! Deprecated: Gets a copy of the ST instance text set
-	bool getGeometry(TeTextSet& result);
-	//! Deprecated: Gets a copy of the ST instance geometry vector
-	bool getGeometry(vector<TeGeometry*>& result);
-	//! Deprecated: Gets a copy of the ST instance multi geometry
-	bool getGeometry(TeMultiGeometry& result);
-
-	//! Deprecated: Get a reference to the ST instance polygon geometry
-	TePolygonSet&  getPolygons();
-	//! Deprecated: Get a reference to the ST instance line geometry
-	TeLineSet&  getLines();
-	//! Deprecated: Get a reference to the ST instance point geometry 
-	TePointSet&  getPoints();
-	//! Deprecated: Get a reference to the ST instance cell geometry  
-	TeCellSet&  getCells();
-	//! Deprecated: Get a reference to the ST instance text geometry 
-	TeTextSet&  getTexts();
-
-	//! Deprecated: Sets a polygon set to the instance 
-	void setGeometry(const TePolygonSet& result); 
-	//! Deprecated: Sets a line set to the instance 
-	void setGeometry(const TeLineSet& result);
-	//! Deprecated: Sets a point set to the instance 
-	void setGeometry(const TePointSet& result);
-	//! Deprecated: Sets a cell set to the instance 
-	void setGeometry(const TeCellSet& result);
-	//! Deprecated: Sets a text set to the instance 
-	void setGeometry(const TeTextSet& result);
-	//! Deprecated: Sets a text set to the instance 
-	void setGeometry(const TeMultiGeometry& result);
-			
-	//! Deprecated: Adds a polygon to the instance
-	bool addGeometry(const TePolygon& poly);  
-	//! Deprecated: Adds a line to the instance
-	bool addGeometry(const TeLine2D& line);
-	//! Deprecated: Adds a point to the instance
-	bool addGeometry(const TePoint& point);	
-	//! Deprecated: Adds a cell to the instance
-	bool addGeometry(const TeCell& cell);		
-	//! Deprecated: Adds a text to the instance
-	bool addGeometry(const TeText& cell);		
-
-	//! Returns a centroid of a geometry representation 
-	virtual void centroid(TeCoord2D& centroid, TeGeomRep geomRep=TeGEOMETRYNONE); 
-	
-	//! Returns an area of a geometry representation
-	virtual void area(double& a, TeGeomRep geomRep=TeGEOMETRYNONE);
-
-	//! Deprecated: Returns the valid time 
-	virtual TeTimeInterval timeInterval () 
-	{	return getTime();	}
-	
-	//! Deprecated: Sets the valid time interval
-	virtual void timeInterval (const TeTimeInterval& t) 
-	{	setTime(t);	}
-
-	//! Returns the initial time (as a string) of the valid time interval
-	virtual string getInitialDateTime(const string& mask="YYYYsMMsDDsHHsmmsSS") 
-	{	return time_.getInitialDateTime(mask);	}
-	
-	//! Returns the final time (as a string) of the valid time interval
-	virtual string getFinalDateTime(const string& mask="YYYYsMMsDDsHHsmmsSS") 
-	{	return time_.getFinalDateTime(mask);	}
-	
-};
-
-//! A spatial temporal element or object (TeSTElement) is composite of a set of spatial temporal instances related to it.  
-typedef vector<TeSTInstance>  TeSTElement;
-
-#endif 
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSTInstance.h
+	\brief This file contains a class called TeSTInstance that represents 
+	an instance in time of a geographical object or element.  
+*/
+
+#ifndef  __TERRALIB_INTERNAL_STINSTANCE_H
+#define  __TERRALIB_INTERNAL_STINSTANCE_H
+
+#include "TeTimeInterval.h"
+#include "TeMultiGeometry.h"
+#include "TeBaseSTInstance.h"
+
+#include <string>
+#include <map> 
+#include <vector>
+using namespace std;
+
+/*! \class TeSTInstance
+	\brief A class that represents an instance in a time of a spatial object.
+
+	A spatio-temporal instance (STInstance) is composite of an attribute set and geometries 
+	of a spatial element or object that are valid in a specific time. This class 
+	specializes the base class TeBaseSTInstance representing the geometries 
+	as multigeometries (TeMultiGeometry) and the valid time as a time interval (TeTimeInterval).
+
+	\sa TeBaseSTInstance TeMultiGeometry TeTimeInterval
+	
+*/
+class TL_DLL TeSTInstance : public TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>
+{
+public:		
+
+	//! Constructor
+	TeSTInstance() : 
+		TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>() 
+	{ }
+
+	//! Deprecated: Constructor
+	TeSTInstance (const string& object_id, TeProperty& prop); 
+
+	//! Constructor 
+	TeSTInstance (const string& object_id, vector<string>& prop, TeAttributeList* attList = 0, const int& s = -1) : 
+		TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>(object_id, prop, attList, s)
+	{ }
+
+	//! Constructor
+	TeSTInstance (const string& object_id, const TeMultiGeometry& geometries, 
+		const TeTimeInterval& time, const int& s = -1) : 
+		TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>(object_id, geometries, time, s)
+	{ }
+
+	//! Constructor 
+	TeSTInstance (const string& object_id, vector<string>& prop, TeAttributeList* attList, 
+		TeMultiGeometry& geometries, int& slice, TeTimeInterval& time ) :
+		TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>(object_id, prop, attList, geometries, slice, time)
+	{ }
+
+	//! Clear 
+	virtual void clear(); 
+	
+	//! Verifies if the its time is valid
+	virtual bool isTimeValid();
+	
+	//! Deprecated: Verifies if the instance has polygons
+	bool hasPolygons();	
+	//! Deprecated: Verifies if the instance has lines
+	bool hasLines();		
+	//! Deprecated: Verifies if the instance has points
+	bool hasPoints();		
+	//! Deprecated: Verifies if the instance has cells
+	bool hasCells();		
+	//! Deprecated: Return true if this has texts
+	bool hasTexts();		
+	
+	//! Deprecated: Gets a copy of the ST instance polygon set
+	bool getGeometry(TePolygonSet& result); 
+	//! Deprecated: Gets a copy of the ST instance line set
+	bool getGeometry(TeLineSet& result);
+	//! Deprecated: Gets a copy of the ST instance point set
+	bool getGeometry(TePointSet& result);
+	//! Deprecated: Gets a copy of the ST instance cell set
+	bool getGeometry(TeCellSet& result);
+	//! Deprecated: Gets a copy of the ST instance text set
+	bool getGeometry(TeTextSet& result);
+	//! Deprecated: Gets a copy of the ST instance geometry vector
+	bool getGeometry(vector<TeGeometry*>& result);
+	//! Deprecated: Gets a copy of the ST instance multi geometry
+	bool getGeometry(TeMultiGeometry& result);
+
+	//! Deprecated: Get a reference to the ST instance polygon geometry
+	TePolygonSet&  getPolygons();
+	//! Deprecated: Get a reference to the ST instance line geometry
+	TeLineSet&  getLines();
+	//! Deprecated: Get a reference to the ST instance point geometry 
+	TePointSet&  getPoints();
+	//! Deprecated: Get a reference to the ST instance cell geometry  
+	TeCellSet&  getCells();
+	//! Deprecated: Get a reference to the ST instance text geometry 
+	TeTextSet&  getTexts();
+
+	//! Deprecated: Sets a polygon set to the instance 
+	void setGeometry(const TePolygonSet& result); 
+	//! Deprecated: Sets a line set to the instance 
+	void setGeometry(const TeLineSet& result);
+	//! Deprecated: Sets a point set to the instance 
+	void setGeometry(const TePointSet& result);
+	//! Deprecated: Sets a cell set to the instance 
+	void setGeometry(const TeCellSet& result);
+	//! Deprecated: Sets a text set to the instance 
+	void setGeometry(const TeTextSet& result);
+	//! Deprecated: Sets a text set to the instance 
+	void setGeometry(const TeMultiGeometry& result);
+			
+	//! Deprecated: Adds a polygon to the instance
+	bool addGeometry(const TePolygon& poly);  
+	//! Deprecated: Adds a line to the instance
+	bool addGeometry(const TeLine2D& line);
+	//! Deprecated: Adds a point to the instance
+	bool addGeometry(const TePoint& point);	
+	//! Deprecated: Adds a cell to the instance
+	bool addGeometry(const TeCell& cell);		
+	//! Deprecated: Adds a text to the instance
+	bool addGeometry(const TeText& cell);		
+
+	//! Returns a centroid of a geometry representation 
+	virtual void centroid(TeCoord2D& centroid, TeGeomRep geomRep=TeGEOMETRYNONE); 
+	
+	//! Returns an area of a geometry representation
+	virtual void area(double& a, TeGeomRep geomRep=TeGEOMETRYNONE);
+
+	//! Deprecated: Returns the valid time 
+	virtual TeTimeInterval timeInterval () 
+	{	return getTime();	}
+	
+	//! Deprecated: Sets the valid time interval
+	virtual void timeInterval (const TeTimeInterval& t) 
+	{	setTime(t);	}
+
+	//! Returns the initial time (as a string) of the valid time interval
+	virtual string getInitialDateTime(const string& mask="YYYYsMMsDDsHHsmmsSS") 
+	{	return time_.getInitialDateTime(mask);	}
+	
+	//! Returns the final time (as a string) of the valid time interval
+	virtual string getFinalDateTime(const string& mask="YYYYsMMsDDsHHsmmsSS") 
+	{	return time_.getFinalDateTime(mask);	}
+	
+};
+
+//! A spatial temporal element or object (TeSTElement) is composite of a set of spatial temporal instances related to it.  
+typedef vector<TeSTInstance>  TeSTElement;
+
+#endif 
diff --git a/src/terralib/kernel/TeSemaphore.cpp b/src/terralib/kernel/TeSemaphore.cpp
new file mode 100644
index 0000000..d5d5e46
--- /dev/null
+++ b/src/terralib/kernel/TeSemaphore.cpp
@@ -0,0 +1,131 @@
+#include "TeSemaphore.h"
+
+#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  #include <limits.h>
+#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+  #include <fcntl.h>
+  #include <sys/stat.h>
+  #include <sys/time.h>
+#else
+    #error "Unsuported plataform"
+#endif   
+
+TeSemaphore::TeSemaphore( unsigned int count )
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    SECURITY_ATTRIBUTES secAtts;
+    secAtts.lpSecurityDescriptor = NULL;
+    secAtts.bInheritHandle = TRUE;    
+    secAtts.nLength = sizeof( secAtts );
+      
+    semHandlerPtr_ = CreateSemaphore( &secAtts, (LONG)count, (long)LONG_MAX, 0);
+    TEAGN_TRUE_OR_THROW( ( semHandlerPtr_ != 0 ),
+      "Unable to acquire semaphore handler" )
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    semHandlerPtr_ = new sem_t;
+    
+    TEAGN_TRUE_OR_THROW( sem_init( semHandlerPtr_, 0, count ) == 0,
+      "Error initializing semaphore" )
+  #else
+    #error "Unsuported plataform"
+  #endif   
+}
+
+TeSemaphore::TeSemaphore( unsigned int count, const std::string& semName )
+{
+  TEAGN_TRUE_OR_THROW( !semName.empty(), "Invalid semaphore name" );
+  
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    TEAGN_TRUE_OR_THROW( semName.size() < MAX_PATH, "Invalid semaphore name" );
+  
+    SECURITY_ATTRIBUTES secAtts;
+    secAtts.lpSecurityDescriptor = NULL;
+    secAtts.bInheritHandle = TRUE;    
+    secAtts.nLength = sizeof( secAtts );
+      
+    semHandlerPtr_ = CreateSemaphore( &secAtts, (LONG)count, (long)LONG_MAX, 
+      semName.c_str() );
+    TEAGN_TRUE_OR_THROW( ( semHandlerPtr_ != 0 ),
+      "Unable to acquire semaphore handler" )
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    semHandlerPtr_ = sem_open( semName.c_str(), O_CREAT,
+      S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, 
+      (unsigned)count );     
+    TEAGN_TRUE_OR_THROW( ( semHandlerPtr_ != SEM_FAILED ),
+      "Unable to acquire semaphore handler" ) 
+  #else
+    #error "Unsuported plataform"
+  #endif  
+               
+  semName_ = semName;            
+}
+
+
+TeSemaphore::~TeSemaphore()
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    CloseHandle( semHandlerPtr_ );
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    if( semName_.size() )
+    {
+      sem_unlink( semName_.c_str() );
+      sem_close( semHandlerPtr_ );
+    }
+    else
+    {
+      sem_destroy( semHandlerPtr_ );
+      delete semHandlerPtr_;
+    }
+  #else
+    #error "Unsuported plataform"
+  #endif   
+}
+
+bool TeSemaphore::wait( unsigned int waitingTime )
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    DWORD return_value = 0;
+    return_value = WaitForSingleObject( semHandlerPtr_, (DWORD)waitingTime );
+    
+    if( ( return_value == WAIT_ABANDONED ) || ( return_value == 
+      WAIT_OBJECT_0 ) )
+    {
+      return true;
+    }
+    else
+    {
+      return false;
+    }
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    struct timeval timevalstr;
+
+    if( gettimeofday( &timevalstr, 0 ) == 0 ) 
+    {
+      struct timespec timespecstr;
+
+      /* seconds */
+      timespecstr.tv_sec = timevalstr.tv_sec + ( waitingTime / 1000 );
+      /* nano-seconds */
+      timespecstr.tv_nsec = ( timevalstr.tv_usec * 1000 ) +
+        ( ( waitingTime % 1000 ) * 1000000 );
+      
+      if( 0 == sem_timedwait( semHandlerPtr_, &timespecstr ) )
+      {
+        return true;
+      }
+      else
+      {
+        return false;
+      }
+    } 
+    else 
+    {
+      TEAGN_LOGWARN( "Unable to get the current time" );
+      return false;
+    }
+  #else
+    #error "Unsuported plataform"
+  #endif   
+}; 
+
+
diff --git a/src/terralib/kernel/TeSemaphore.h b/src/terralib/kernel/TeSemaphore.h
new file mode 100644
index 0000000..4cba3a5
--- /dev/null
+++ b/src/terralib/kernel/TeSemaphore.h
@@ -0,0 +1,143 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef TESEMAPHORE_H
+  #define TESEMAPHORE_H
+
+  #include "TeDefines.h"
+  #include "TeAgnostic.h"
+  #include "TeDefines.h"
+  
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    #include <windows.h>
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    #include <semaphore.h>
+  #else
+    #error "ERROR: Unsupported platform"
+  #endif  
+ 
+  /**
+   * @brief Inter process communication semaphore.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup MultProgToolsGroup
+   */
+  class TL_DLL TeSemaphore
+  {
+    public :
+    
+      /**
+       * @brief Creates an unnamed semaphore.
+       * @param count Semaphore initial counter value.
+       */    
+      TeSemaphore( unsigned int count );
+      
+      /**
+       * @brief Creates an named semaphore.
+       * @param count Semaphore initial counter value.
+       * @param semName Semaphore name.
+       * @note  Creates a new semaphore or opens an existing semaphore
+       * that can be shared among processes.
+       */    
+      TeSemaphore( unsigned int count, const std::string& semName );
+
+      /**
+       * @brief Default destructor.
+       */       
+      ~TeSemaphore();
+      
+      /**
+       * @brief Increments the semaphore's counter.  
+       */          
+      inline void post()
+      {
+        #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+          TEAGN_TRUE_OR_THROW( ReleaseSemaphore( semHandlerPtr_, 1, 0 ),
+            "Error in semaphore post" );
+        #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+          TEAGN_TRUE_OR_THROW( 0 == sem_post( semHandlerPtr_ ),
+            "Error in semaphore post" );
+        #else
+          #error "Unsuported plataform"
+        #endif           
+      };
+      
+      /**
+       * @brief Wait the semaphore's counter to become zero.  
+       * @note If the semaphore's value is greater than zero, then the 
+       * decrement proceeds, and  the  function  returns,  immediately.
+       * If the semaphore currently has the value zero, then the call blocks 
+       * until either it becomes possible to perform the decrement.
+       */          
+      inline void wait()
+      {
+        #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+          TEAGN_TRUE_OR_THROW( WAIT_OBJECT_0 == WaitForSingleObject( 
+            semHandlerPtr_, INFINITE ), "Error waiting semaphore" );
+        #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+          TEAGN_TRUE_OR_THROW( 0 == sem_wait( semHandlerPtr_ ),
+            "Error in semaphore wait" );
+        #else
+          #error "Unsuported plataform"
+        #endif            
+      };
+      
+      /**
+       * @brief Wait the semaphore's counter to become zero.
+       * @param waitingTime The maximum waiting time in milliseconds
+       * ( 0 == INFINITE ).
+       * @return true if the semaphore's counter is zero or false 
+       * if the waiting time has finished or an error occurred.
+       */       
+      bool wait( unsigned int waitingTime );  
+           
+    protected :
+   
+      #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+        /** A pointer to the handler instance. */      
+        HANDLE semHandlerPtr_;    
+      #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+        /** A pointer to the handler instance. */      
+        sem_t* semHandlerPtr_;
+      #else
+        #error "Unsuported plataform"
+      #endif   
+      
+      /** This instance name */
+      std::string semName_;
+   
+    private :
+    
+      /**
+       * Alternative constructor.
+       */    
+      TeSemaphore(  const TeSemaphore& ) {};
+   
+      /**
+       * operator= overload.
+       * @return A const reference to the current instance.
+       */      
+      const TeSemaphore& operator=( const TeSemaphore& ) { return *this; };
+ 
+  };
+
+#endif
diff --git a/src/terralib/kernel/TeSharedPtr.h b/src/terralib/kernel/TeSharedPtr.h
old mode 100755
new mode 100644
index 966edce..054e885
--- a/src/terralib/kernel/TeSharedPtr.h
+++ b/src/terralib/kernel/TeSharedPtr.h
@@ -1,435 +1,410 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSharedPtr.h
-    \brief This file contains a class to deal with automatic dynamic memory allocation / desallocationn
-*/
-#ifndef TESHAREDPTR_H
-  #define TESHAREDPTR_H
-
-  #include "TeMutex.h"
-  #include "TeAgnostic.h"
-
-  /**
-   * @brief This is the class to deal with automatic dynamic memory
-   * allocation / desallocation.
-   * @note This is a thread-safe class.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup Utils
-   */
-  template< class T >
-  class TeSharedPtr {
-    public :
-      /**
-       * @brief Default Constructor( Shared ).
-       *
-       * @param pointer A pointer the the active object.
-       */
-      explicit TeSharedPtr( T* pointer = 0 );
-        
-      /**
-       * @brief Alternative Constructor.
-       *
-       * @param external External object reference.
-       * @param not_shared_flag A flag indication for a static
-       * assignment ( the pointed object will not be deleted at the
-       * this object destruction ).       
-       */
-      TeSharedPtr( const TeSharedPtr< T >& external );        
-        
-      /**
-       * @brief Alternative Constructor.
-       *
-       * @param pointer A pointer the the active object.
-       * @param not_shared_flag A flag indication for a static
-       * assignment ( the pointed object will not be deleted at the
-       * this object destruction ).
-       */
-      explicit TeSharedPtr( T* pointer,  bool not_shared_flag );        
-
-      /**
-       * @brief Default Destructor
-       */
-      ~TeSharedPtr();
-
-      /**
-       * @brief Verifies if the current pointer points to an active object.
-       *
-       * @return true if active, false if not.
-       */
-      inline bool isActive() const;
-      
-      /**
-       * @brief Verifies if the current pointer is shared.
-       *
-       * @return true if shared, false if not.
-       */
-      inline bool isShared() const;      
-
-      /**
-       * @brief Reset the active instance the the new pointer.
-       *
-       * @param pointer A pointer the the active object.
-       * @param not_shared_flag A flag indication for a static
-       * assignment ( the pointed object will not be deleted at the
-       * this object destruction ).
-       */
-      void reset( T* pointer = 0, bool not_shared_flag = false );
-
-      /**
-       * @brief Operator = overload.
-       *
-       * @param external External instance reference.
-       * @return A reference to the current pointer.
-       */
-      const TeSharedPtr< T >& operator=( const TeSharedPtr< T >& external );
-
-      /**
-       * @brief Operator * overload.
-       *
-       * @return The internal instance reference.
-       */
-      inline T& operator*() const;
-
-      /**
-       * @brief Operator -> overload.
-       *
-       * @return The internal instance pointer.
-       */
-      inline T* operator->() const;
-
-      /**
-       * @brief Operator == overload.
-       *
-       * @param external The external instance reference.
-       * @return true if the current pointer and the external pointer
-       * are pointing to the same object.
-       */
-      inline bool operator==( const TeSharedPtr< T >& external ) const;
-      
-      /**
-       * @brief Operator< overload.
-       *
-       * @param external The external instance reference.
-       * @return true if the current pointer pointed address has a lower value 
-       * then the external shared pointer pointed address.
-       */
-      inline bool operator<( const TeSharedPtr< T >& external ) const;      
-
-      
-      /**
-       * @brief Operator> overload.
-       *
-       * @param external The external instance reference.
-       * @return true if the current pointer pointed address has a lower value 
-       * then the external shared pointer pointed address.
-       */
-      inline bool operator>( const TeSharedPtr< T >& external ) const;      
-
-            
-      /**
-       * @brief Operator != overload.
-       *
-       * @param external The external instance reference.
-       * @return true if the current pointer and the external pointer
-       * are not pointing to the same object.
-       */
-      inline bool operator!=( const TeSharedPtr< T >& external ) const;
-
-      /**
-       * @brief A Naked Pointer to the encapsulated object.
-       *
-       * @return The internal instance pointer.
-       */
-      inline T* nakedPointer() const;
-      
-      /**
-       * @brief Builds a non-shared pointer copy from the current instance.
-       *
-       * @return The non-shared pointer copy.
-       */
-      TeSharedPtr< T > getNonSharedCopy() const;      
-      
-      /**
-       * @brief The number of current references to the pointed object.
-       *
-       * @return The number of current references to the pointed object.
-       */
-      unsigned long int getRefCount() const;            
-
-    protected :
-    
-      /**
-       * @brief This instance locking mutex.
-       */    
-      mutable TeMutex this_lock_instance_;
-      
-      /**
-       * @brief A pointer to the shared counter locking mutex.
-       */    
-      mutable TeMutex* counter_lock_instance_ptr_;      
-
-      /**
-       * @brief A pointer to the current number of active users of this pointer.
-       */
-      mutable unsigned long int* counter_;
-
-      /**
-       * @brief A pointer to the current object encapsulated by this
-       * shared pointer.
-       */
-      mutable T* reference_;
-
-      /**
-       * @brief A flag indicating if this shared pointer was created by a
-       * dynamic assignment ( false value ) or by a static
-       * assignment( true value - the encapsulated object will not
-       * be destroyed at the end.
-       */
-      mutable bool not_shared_flag_;
-      
-      /**
-       * @brief Set all internal variables to default values.
-       *
-       */
-      void init();
-  };
-
-  
-  template< class T >
-  TeSharedPtr< T >::TeSharedPtr( T* pointer )
-  {
-    init();
-    reset( pointer, not_shared_flag_ );
-  }
- 
-   
-  template< class T >
-  TeSharedPtr< T >::TeSharedPtr( const TeSharedPtr< T >& external )
-  {
-    init();
-    operator=( external );
-  } 
-
-    
-  template< class T >
-  TeSharedPtr< T >::TeSharedPtr( T* pointer, bool not_shared_flag )
-  {
-    init();
-    reset( pointer, not_shared_flag );
-  }  
-
-
-  template< class T >
-    TeSharedPtr< T >::~TeSharedPtr()
-  {
-    reset( 0, 0 );
-  }
-
-
-  template< class T >
-  inline bool TeSharedPtr< T >::isActive() const
-  {
-    return ( ( reference_ == 0 ) ? false : true );
-  }
-  
-  
-  template< class T >
-  inline bool TeSharedPtr< T >::isShared() const
-  {
-    return ( ! not_shared_flag_ );
-  }  
-
-
-  template< class T >
-  void TeSharedPtr< T >::reset( T* pointer, bool not_shared_flag )
-  {
-    this_lock_instance_.lock();
-    
-    /* updating the shared objects */
-    
-    if( ( reference_ != 0 ) && ( ! not_shared_flag_ ) ) {
-      counter_lock_instance_ptr_->lock();
-    
-      --(*counter_);
-      
-      /* Cleanning the shared pointed objects if necessary */
-
-      if( (*counter_) == 0 ) {
-        delete counter_;
-        delete reference_;
-        delete counter_lock_instance_ptr_;
-      } else {
-        counter_lock_instance_ptr_->unLock();
-      }
-    }
-     
-    init();
-    
-    /* Acquiring the pointed object */
-
-    if( pointer != 0 ) {
-      if( ! not_shared_flag ) {
-        counter_ = new unsigned long int;
-        (*counter_) = 1;
-        counter_lock_instance_ptr_ = new TeMutex;
-      }
-
-      reference_ = pointer;
-      not_shared_flag_ = not_shared_flag;
-    }
-    
-    this_lock_instance_.unLock();
-  }
-
-
-  template< class T >
-  const TeSharedPtr< T >& TeSharedPtr< T >::operator=(
-    const TeSharedPtr< T >& external )
-  {
-    if( ( &external ) != this ) {
-      reset();
-  
-      this_lock_instance_.lock();
-      
-      if( (&external) != 0 ) {
-        external.this_lock_instance_.lock();
-      
-        if( external.isActive() ) {
-          reference_ = external.reference_;
-        
-          if( ( ! not_shared_flag_ ) && ( ! external.not_shared_flag_ ) ) {
-            
-            counter_ = external.counter_;
-            (*counter_) = (*counter_) + 1;
-            
-            counter_lock_instance_ptr_ = external.counter_lock_instance_ptr_;
-          } else {
-            not_shared_flag_ = true;
-          }
-        }
-        
-        external.this_lock_instance_.unLock();
-      }
-      
-      this_lock_instance_.unLock();
-    }
-
-    return *this;
-  }
-
-
-  template< class T >
-  inline T& TeSharedPtr< T >::operator*() const
-  {
-    TEAGN_DEBUG_CONDITION( isActive(), 
-      "Trying to use an inactive shared pointer instance" );
-
-    return *reference_;
-  }
-
-
-  template< class T >
-  inline T* TeSharedPtr< T >::operator->() const
-  {
-    TEAGN_DEBUG_CONDITION( isActive(), 
-      "Trying to use an inactive shared pointer instance" );
-    
-    return reference_;
-  }
-
-
-  template< class T >
-  inline bool TeSharedPtr< T >::operator==(
-    const TeSharedPtr< T >& external ) const
-  {
-    return ( ( reference_ == external.reference_ ) ? true : false );
-  }
-  
-  
-  template< class T >
-  inline bool TeSharedPtr< T >::operator<(
-    const TeSharedPtr< T >& external ) const
-  {
-    return ( ( reference_ < external.reference_ ) ? true : false );
-  }  
-
-
-  template< class T >
-  inline bool TeSharedPtr< T >::operator>(
-    const TeSharedPtr< T >& external ) const
-  {
-    return ( ( reference_ > external.reference_ ) ? true : false );
-  }  
-    
-
-  template< class T >
-  inline bool TeSharedPtr< T >::operator!=(
-    const TeSharedPtr< T >& external ) const
-  {
-    return ( ( reference_ == external.reference_ ) ? false : true );
-  }
-
-
-  template< class T >
-  inline T* TeSharedPtr< T >::nakedPointer() const
-  {
-    return reference_;
-  }
-  
-  template< class T >
-  TeSharedPtr< T > TeSharedPtr< T >::getNonSharedCopy() const
-  {
-    TeSharedPtr< T > outptr;
-    outptr.reset( reference_, true );
-    return outptr;
-  }
-  
-  template< class T >
-  unsigned long int TeSharedPtr< T >::getRefCount() const
-  {
-    if( reference_ ) {
-      if( counter_) {
-        return (*counter_);
-      } else {
-        return 1;
-      }
-    } else {
-      return 0;
-    }
-  }  
-  
-  template< class T >
-  void TeSharedPtr< T >::init()
-  {
-    counter_ = 0;
-    reference_ = 0;
-    counter_lock_instance_ptr_ = 0;
-    not_shared_flag_ = false;  
-  }  
-
-/** @example TeSharedPtr_test.cpp
- *    Shows how to use this class.
- */  
-  
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef TESHAREDPTR_H
+  #define TESHAREDPTR_H
+
+  #include "TeMutex.h"
+  #include "TeAgnostic.h"
+
+  /**
+   * @class This class deals with automatic object deletion when no 
+   * reference to that object no longer exists.
+   * @note This is a thread-safe class.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup Utils
+   * @example TeSharedPtr_test.cpp Shows how to use this class.
+   * @note Shared-mode - The object will be automaticaly deleted 
+   * when apropriate.
+   * @note Not-Shared-mode - The object will NOT be deleted.
+   */
+  template< class T >
+  class TeSharedPtr {
+    public :
+      /**
+       * @brief Default Constructor( Shared mode ).
+       */
+      explicit TeSharedPtr();
+      
+      /**
+       * @brief Alternative Constructor( Shared mode ).
+       *
+       * @param pointer A pointer the the active object.
+       */
+      explicit TeSharedPtr( T* pointer );      
+        
+      /**
+       * @brief Alternative Constructor.
+       *
+       * @param external External shared pointer reference.
+       */
+      TeSharedPtr( const TeSharedPtr< T >& external );        
+      
+      /**
+       * @brief Alternative Constructor( Not-shared mode ).
+       * @param objectReference A reference to an existing
+       * object.
+       * @note By using this constructor this pointer instance
+       * will be constructed in not-shared mode and will not delete 
+       * the object instance.
+       */
+      explicit TeSharedPtr( T& objectReference );           
+        
+      /**
+       * @deprecated DEPRECATED - Will be removed in the future (Use the 
+       * method TeSharedPtr( T& objectReference ) to construct pointers
+       * in not-shared mode ).
+       * @brief Alternative Constructor.
+       * @param pointer A pointer the the active object.
+       * @param not_shared_flag A flag indication for a static
+       * assignment ( the pointed object will not be deleted at the
+       * this object destruction ).
+       */
+      explicit TeSharedPtr( T* pointer,  bool not_shared_flag );        
+
+      /**
+       * @brief Default Destructor
+       */
+      ~TeSharedPtr();
+
+      /**
+       * @brief Verifies if the current pointer points to an active object.
+       *
+       * @return true if active, false if not.
+       */
+      inline bool isActive() const
+      {
+        return ( reference_ != 0 );
+      };
+      
+      /**
+       * @brief Verifies if the current pointer is shared.
+       *
+       * @return true if shared, false if not.
+       */
+      inline bool isShared() const
+      {
+        return ( ! not_shared_flag_ );
+      };      
+      
+      /**
+       * @brief Reset the active instance deleting any pointed object
+       * if the current instance is in shared mode and no more references 
+       * to the pointed object exists.
+       */
+      inline void reset()
+      {
+        reset( 0, 0 );
+      };
+      
+      /**
+       * @brief Reset the active instance the the new pointer (shared mode).
+       *
+       * @param pointer A pointer the the active object.
+       */
+      inline void reset( T* pointer )
+      {
+        reset( pointer, false );
+      };
+
+      /**
+       * @brief Reset the active instance the the new pointer.
+       *
+       * @param pointer A pointer the the active object.
+       * @param not_shared_flag A flag indication for a static
+       * assignment ( the pointed object will not be deleted at the
+       * this object destruction ).
+       */
+      void reset( T* pointer, bool not_shared_flag );
+
+      // Operator = overload.
+      const TeSharedPtr< T >& operator=( const TeSharedPtr< T >& external );
+
+      /**
+       * @brief Operator * overload.
+       *
+       * @return The pointed object reference.
+       */
+      inline T& operator*() const
+      {
+        TEAGN_DEBUG_CONDITION( isActive(), 
+          "Trying to use an inactive shared pointer instance" );
+    
+        return *reference_;
+      };
+
+      /**
+       * @brief Operator -> overload.
+       *
+       * @return The pointed object pointer.
+       */
+      inline T* operator->() const
+      {
+        TEAGN_DEBUG_CONDITION( isActive(), 
+          "Trying to use an inactive shared pointer instance" );
+        
+        return reference_;
+      };
+
+      // Operator == overload.
+      inline bool operator==( const TeSharedPtr< T >& external ) const
+      {
+        return ( ( reference_ == external.reference_ ) && 
+          ( counter_ == external.counter_ ) &&
+          ( not_shared_flag_ == external.not_shared_flag_ ) );
+      };
+      
+      /**
+       * @brief Operator< overload.
+       *
+       * @param external The external instance reference.
+       * @return true if the current pointer pointed address has a lower value 
+       * then the external shared pointer pointed address.
+       */
+      inline bool operator<( const TeSharedPtr< T >& external ) const
+      {
+        return ( reference_ < external.reference_ );
+      };      
+      
+      /**
+       * @brief Operator> overload.
+       *
+       * @param external The external instance reference.
+       * @return true if the current pointer pointed address has a lower value 
+       * then the external shared pointer pointed address.
+       */
+      inline bool operator>( const TeSharedPtr< T >& external ) const
+      {
+        return ( reference_ > external.reference_ );
+      };      
+            
+      // Operator != overload.
+      inline bool operator!=( const TeSharedPtr< T >& external ) const
+      {
+        return ( ! operator==( external ) );
+      };
+
+      /**
+       * @brief A Naked Pointer to the encapsulated object.
+       *
+       * @return The internal instance pointer.
+       */
+      inline T* nakedPointer() const
+      {
+        return reference_;
+      };
+      
+      /**
+       * @brief The number of current references to the pointed object.
+       *
+       * @return The number of current references to the pointed object.
+       */
+      unsigned long int getRefCount() const;            
+
+    protected :
+    
+      /**
+       * @brief This instance locking mutex.
+       */    
+      mutable TeMutex this_lock_instance_;
+      
+      /**
+       * @brief A pointer to the shared counter locking mutex (default:0).
+       */    
+      mutable TeMutex* counter_lock_instance_ptr_;      
+
+      /**
+       * @brief A pointer to the current number of active users of this 
+       * pointer (default:0).
+       */
+      mutable unsigned long int* counter_;
+
+      /**
+       * @brief A pointer to the current object encapsulated by this
+       * shared pointer (default:0).
+       */
+      mutable T* reference_;
+
+      /**
+       * @brief A flag indicating if this shared pointer was created by a
+       * dynamic assignment ( false value ) or by a static
+       * assignment(if true, the encapsulated object will not
+       * be deleted when apropriate) (default:false).
+       */
+      mutable bool not_shared_flag_;
+      
+      /**
+       * @brief Set all internal variables to default values.
+       *
+       */
+      void init();
+  };
+
+  
+  template< class T >
+  TeSharedPtr< T >::TeSharedPtr()
+  {
+    init();
+  }
+  
+  
+  template< class T >
+  TeSharedPtr< T >::TeSharedPtr( T* pointer )
+  {
+    init();
+    reset( pointer, false );
+  } 
+ 
+   
+  template< class T >
+  TeSharedPtr< T >::TeSharedPtr( const TeSharedPtr< T >& external )
+  {
+    init();
+    operator=( external );
+  } 
+  
+  template< class T >
+  TeSharedPtr< T >::TeSharedPtr( T& objectReference )
+  {
+    init();
+    reset( &objectReference, true );
+  } 
+    
+  template< class T >
+  TeSharedPtr< T >::TeSharedPtr( T* pointer, bool not_shared_flag )
+  {
+    init();
+    reset( pointer, not_shared_flag );
+  }  
+
+
+  template< class T >
+    TeSharedPtr< T >::~TeSharedPtr()
+  {
+    reset( 0, 0 );
+  }
+
+  template< class T >
+  void TeSharedPtr< T >::reset( T* pointer, bool not_shared_flag )
+  {
+    this_lock_instance_.lock();
+    
+    /* updating the shared objects */
+    
+    if( ( reference_ != 0 ) && ( ! not_shared_flag_ ) ) {
+      counter_lock_instance_ptr_->lock();
+    
+      --(*counter_);
+      
+      /* Cleanning the shared pointed objects if necessary */
+
+      if( (*counter_) == 0 ) {
+        delete counter_;
+        delete reference_;
+        delete counter_lock_instance_ptr_;
+      } else {
+        counter_lock_instance_ptr_->unLock();
+      }
+    }
+     
+    init();
+    
+    /* Acquiring the pointed object */
+
+    if( pointer != 0 ) {
+      if( ! not_shared_flag ) {
+        counter_ = new unsigned long int;
+        (*counter_) = 1;
+        counter_lock_instance_ptr_ = new TeMutex;
+      }
+
+      reference_ = pointer;
+      not_shared_flag_ = not_shared_flag;
+    }
+    
+    this_lock_instance_.unLock();
+  }
+
+
+  template< class T >
+  const TeSharedPtr< T >& TeSharedPtr< T >::operator=(
+    const TeSharedPtr< T >& external )
+  {
+    if( ( &external ) != this ) 
+    {
+      reset( 0, 0 );
+  
+      this_lock_instance_.lock();
+      
+      if( (&external) != 0 ) 
+      {
+        external.this_lock_instance_.lock();
+      
+        if( external.reference_ ) 
+        {
+          reference_ = external.reference_;
+          counter_lock_instance_ptr_ = external.counter_lock_instance_ptr_;
+          counter_ = external.counter_;
+          reference_ = external.reference_;
+          not_shared_flag_ = external.not_shared_flag_;
+        
+          if( ! not_shared_flag_ ) 
+          {
+            (*counter_) = (*counter_) + 1;
+          }
+        }
+        
+        external.this_lock_instance_.unLock();
+      }
+      
+      this_lock_instance_.unLock();
+    }
+
+    return *this;
+  }
+  
+  template< class T >
+  unsigned long int TeSharedPtr< T >::getRefCount() const
+  {
+    if( reference_ ) {
+      if( counter_) {
+        return (*counter_);
+      } else {
+        return 1;
+      }
+    } else {
+      return 0;
+    }
+  }  
+  
+  template< class T >
+  void TeSharedPtr< T >::init()
+  {
+    counter_ = 0;
+    reference_ = 0;
+    counter_lock_instance_ptr_ = 0;
+    not_shared_flag_ = false;  
+  }  
+  
+#endif
+
diff --git a/src/terralib/kernel/TeSingleton.h b/src/terralib/kernel/TeSingleton.h
old mode 100755
new mode 100644
index 5f5a645..f7190dd
--- a/src/terralib/kernel/TeSingleton.h
+++ b/src/terralib/kernel/TeSingleton.h
@@ -1,67 +1,67 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSingleton.h
-    \brief This file contains a template for the "Singleton" pattern.
-*/
-#ifndef  __TERRALIB_INTERNAL_SINGLETON_H
-#define  __TERRALIB_INTERNAL_SINGLETON_H
-
-//!  Provides a template support for the "Singleton" pattern
-/*!
-	\note See "Design Patterns" book, page 127
-*/
-
-#include "TeDefines.h"
-
-template <class T>
-class TeSingleton {
-public:
-
-	static T& instance ()
-	{ 
-		static 	T	instance_;
-		return		instance_;
-	}
-	
-// -- Destructor
-
-	virtual ~TeSingleton() {}  // base class
-
-protected:
-
-// -- Contructors
-
-	TeSingleton() {}
-
-
-private:
-
-// No copy allowed
-
-	TeSingleton(const TeSingleton&);
-	TeSingleton& operator=(const TeSingleton&){return *this;}
-
-};
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSingleton.h
+    \brief This file contains a template for the "Singleton" pattern.
+*/
+#ifndef  __TERRALIB_INTERNAL_SINGLETON_H
+#define  __TERRALIB_INTERNAL_SINGLETON_H
+
+//!  Provides a template support for the "Singleton" pattern
+/*!
+	\note See "Design Patterns" book, page 127
+*/
+
+#include "TeDefines.h"
+
+template <class T>
+class TeSingleton {
+public:
+
+	static T& instance ()
+	{ 
+		static 	T	instance_;
+		return		instance_;
+	}
+	
+// -- Destructor
+
+	virtual ~TeSingleton() {}  // base class
+
+protected:
+
+// -- Contructors
+
+	TeSingleton() {}
+
+
+private:
+
+// No copy allowed
+
+	TeSingleton(const TeSingleton&);
+	TeSingleton& operator=(const TeSingleton&){return *this;}
+
+};
+
+#endif
+
diff --git a/src/terralib/kernel/TeSlice.h b/src/terralib/kernel/TeSlice.h
old mode 100755
new mode 100644
index ca2ef13..6065fb4
--- a/src/terralib/kernel/TeSlice.h
+++ b/src/terralib/kernel/TeSlice.h
@@ -1,77 +1,77 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSlice.h
-    \brief This file provides support for a slice structure
-*/
-#ifndef  __TERRALIB_INTERNAL_SLICE_H
-#define  __TERRALIB_INTERNAL_SLICE_H
-
-#include "TeUtils.h"
-
-#include <string>
-#include <vector>
-#include <map>
-#include <iostream>
-using namespace std;
-
-/*! 
-A Slice is a structure that defines an interval of values and associates a
-number of objects that have a certain property, or attribute, whithin this
-interval.
-*/ 
-class TL_DLL TeSlice
-{
-public:
-	int			count_;			//! number of objects container in the interval
-	string		from_;			//! interval lower value 
-	string		to_;			//! interval upper value
-	
-	//! Constructor
-	TeSlice () : count_(0),from_(""),to_("") {}
-
-	//! Constructor
-	TeSlice(const string& from, const string& to, int count=0) :
-     count_(count),
-		from_(from),
-		to_(to) {}
-
-	TeSlice(const TeSlice& slice)
-	{
-		from_ = slice.from_;
-		to_ = slice.to_;
-		count_ = slice.count_;
-	}
-
-	TeSlice& operator=(const TeSlice& slice)
-	{
-		from_ = slice.from_;
-		to_ = slice.to_;
-		count_ = slice.count_;
-		return *this;
-	}
-};
-
-//! A vector of slices
-typedef vector<TeSlice> TeSliceVector;
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSlice.h
+    \brief This file provides support for a slice structure
+*/
+#ifndef  __TERRALIB_INTERNAL_SLICE_H
+#define  __TERRALIB_INTERNAL_SLICE_H
+
+#include "TeUtils.h"
+
+#include <string>
+#include <vector>
+#include <map>
+#include <iostream>
+using namespace std;
+
+/*! 
+A Slice is a structure that defines an interval of values and associates a
+number of objects that have a certain property, or attribute, whithin this
+interval.
+*/ 
+class TL_DLL TeSlice
+{
+public:
+	int			count_;			//! number of objects container in the interval
+	string		from_;			//! interval lower value 
+	string		to_;			//! interval upper value
+	
+	//! Constructor
+	TeSlice () : count_(0),from_(""),to_("") {}
+
+	//! Constructor
+	TeSlice(const string& from, const string& to, int count=0) :
+     count_(count),
+		from_(from),
+		to_(to) {}
+
+	TeSlice(const TeSlice& slice)
+	{
+		from_ = slice.from_;
+		to_ = slice.to_;
+		count_ = slice.count_;
+	}
+
+	TeSlice& operator=(const TeSlice& slice)
+	{
+		from_ = slice.from_;
+		to_ = slice.to_;
+		count_ = slice.count_;
+		return *this;
+	}
+};
+
+//! A vector of slices
+typedef vector<TeSlice> TeSliceVector;
+#endif
+
diff --git a/src/terralib/kernel/TeSparseMatrix.h b/src/terralib/kernel/TeSparseMatrix.h
old mode 100755
new mode 100644
index 71acdde..81b04d9
--- a/src/terralib/kernel/TeSparseMatrix.h
+++ b/src/terralib/kernel/TeSparseMatrix.h
@@ -1,274 +1,274 @@
-// k9/a4/sparmat.h, templates for sparse matrices
-#ifndef SPARSEMATRIX_H
-#define SPARSEMATRIX_H SPARSEMATRIX_H
-
-// selection of implementation
-#ifdef STL_map            // defined in main()
-#include<map>
-#include<cassert>
-#else
-#include<hmap.h>
-
-#include "TeDefines.h"
-
-/* If at this point the HMap container is chosen, a function for
-   calculating the hash table addresses is needed. As opposed to the
-   hash functions described up to now, not only one value, but two are
-   used for the calculation. Therefore, the function operator of the
-   PairHashFun class takes a pair as argument. The address calculation
-   itself is simple, but sufficient for our purposes. */
-
-using namespace std;
-
-template<class IndexType>  // int, long or unsigned
-class PairHashFun
-{
-  public:
-    PairHashFun(long prime=65537) // another prime number is possible
-        // e.g. 2111 for smaller Matrizes
-    : tabSize(prime)
-    {}
-
-    // Address calculation with two values
-    long operator()(const pair<IndexType, IndexType>& p) const
-    {
-       return (p.first + p.second) % tabSize;
-    }
-
-    long tableSize() const
-    { 
-       return tabSize;
-    }
-
-  private:
-    long tabSize;
-};
-#endif          //  STL_map
-
-#ifdef _MSC_VER
-#include <utility>
-using namespace std;
-#endif
-
-template<class ValueType, class IndexType, class ContainerType>
-class MatrixElement
-{
-  private:
-    ContainerType& C;
-    typename ContainerType::iterator I;
-    IndexType row, column;
-
-  public:
-    typedef pair<IndexType, IndexType> IndexPair;
-    typedef MatrixElement<ValueType, IndexType,
-                          ContainerType>&  Reference;
-
-    MatrixElement(ContainerType& Cont, IndexType r, IndexType c)
-    : C(Cont), I(C.find(IndexPair(r,c))),
-      row(r), column(c)
-    {}
-
-    /* The constructor initializes the private variables with all
-       information that is needed. The container itself is located in
-       the sparseMatrix class; here, the reference to it is entered.
-       If the passed indices for row and column belong to an element
-       not yet stored in the container, the iterator has the value
-       C.end(). */
-
-    ValueType asValue() const
-    {
-       if(I == C.end())
-           return ValueType(0);
-       else
-           return (*I).second;
-    }
-
-    operator ValueType () const  // type conversion operator
-    {
-       return asValue();
-    }
-
-    /* According to the definition of the sparse matrix, 0 is returned
-       if the element is not present in the container. Otherwise, the
-       result is the second part of the object of type value_type
-       stored in the container. */
-
-    Reference operator=(const ValueType& x)
-    {
-       if(x != ValueType(0))        // not equal 0?
-       {
-         /* If the element does not yet exist, it is put, together
-            with the indices, into an object of type value_type and
-            inserted with insert(): */
-
-          if(I == C.end())
-          {
-             assert(C.size() < C.max_size());
-             I = (C.insert(
-#ifndef _MSC_VER
-			 typename
-#endif
-			 ContainerType::value_type(
-                        IndexPair(row,column), x))
-                 ).first;
-          }
-          else (*I).second = x;
-       }
-
-       /* insert() returns a pair whose first part is an iterator
-          pointing to the inserted object. The second part is of type
-          bool and indicates whether the insertion took place because
-          no element with this key existed. This is, however, not
-          evaluated here because, due to the precondition (I ==
-          C.end()), the second part must always have the value true.
-          If, instead, the element already exists, the value is
-          entered into the second part of the value_type object. If
-          the value is equal 0, in order to save space the element is
-          deleted if it existed. */
-
-       else                    // x = 0
-          if(I != C.end())
-          {
-              C.erase(I);
-              I = C.end();
-          }
-       return *this;
-    }
-
-    /* An assignment operator is required which in turn requires a
-       reference to an object of type MatrixElement. When both the
-       left- and right-hand side are identical, nothing has to happen.
-       Otherwise, as above, it has to be checked whether the value of
-       the right-hand element is 0 or not. The resulting behavior is
-       described together with the above assignment operator, so that
-       here it is simply called: */
-
-    Reference operator=(const Reference rhs)
-    {
-       if(this != &rhs)      // not identical?
-       {
-           return operator=(rhs.asValue());  // see above
-       }
-       return *this;
-    }
-
-};  // class MatrixElement
-
-template<class ValueType, class IndexType>
-class TeSparseMatrix
-{
-   public:
-     typedef pair<IndexType, IndexType> IndexPair;
-
-     // The switch STL_map controls the compilation:
-
-#ifdef STL_map
-     typedef map<IndexPair, ValueType,
-                  less<IndexPair> >       ContainerType;
-#else
-     typedef HMap<IndexPair, ValueType,
-                  PairHashFun<IndexType> > ContainerType;
-#endif
-
-     typedef MatrixElement<ValueType, IndexType,
-                           ContainerType> MatrixElement;
-
-  public:
-    typedef IndexType size_type;
-
-    /* The constructor only initializes the row and column
-       information. The container is created by its standard
-       constructor, where in the case of hash implementation, the size
-       of the container is given by the hash function object of type
-       PairHashFun (see typedef above). */
-
-  private:
-    size_type rows, columns;
-    ContainerType C;
-
-  public:
-    sparseMatrix(size_type r, size_type c)
-    : rows(r), columns(c)
-    {}
-
-   size_type Rows()  const { return rows;}
-   size_type Columns() const { return columns;}
-
-   // usual container type definitions
-   typedef typename ContainerType::iterator iterator;
-   typedef typename ContainerType::const_iterator const_iterator;
-
-   // usual container functions
-   size_type size()       const { return C.size();}
-   size_type max_size()   const { return C.max_size();}
-
-   iterator begin()             { return C.begin();}
-   iterator end()               { return C.end();}
-
-   const_iterator begin() const { return C.begin();}
-   const_iterator end()   const { return C.end();}
-
-   void clear()
-   {
-       C.clear();
-
-   }
-
-   class Aux  // for index operator below
-   {
-     public:
-       Aux(size_type r, size_type maxs, ContainerType& Cont)
-       : Row(r), maxColumns(maxs), C(Cont)
-       {}
-
-       /* After checking the number of columns, the index operator of
-          Aux returns a matrix element which is equipped with all
-          necessary information to carry out a successful assignment.
-        */
-
-       MatrixElement operator[](size_type c)
-       {
-           assert(c >= 0 && c < maxColumns);
-           return MatrixElement(C, Row, c);
-       }
-
-     private:
-       size_type Row, maxColumns;
-       ContainerType& C;
-   };
-
-   /* The index operator of the sparseMatrix class returns the
-       auxiliary object, whose class is defined as nested inside
-       sparseMatrix. */
-   Aux operator[](size_type r)
-   {
-      assert(r >= 0 && r < rows);
-      return Aux(r, columns, C);
-   }
-
-    /* Up to this point, from a functionality point of view, the
-       sparseMatrix class is sufficiently equipped. In order, however,
-       to avoid writing such horrible things as `(*I).first.first' for
-       accessing the elements, some auxiliary functions follow which
-       determine the indices and associated values of an iterator in a
-       more readable way. */
-
-   size_type Index1(iterator& I) const
-   {
-      return (*I).first.first;
-   }
-
-   size_type Index2(iterator& I) const
-   {
-      return (*I).first.second;
-   }
-
-   ValueType Value(iterator& I) const
-   {
-      return (*I).second;
-   }
-};       // class sparseMatrix
-
-#endif   // file sparmat.h
-
-
+// k9/a4/sparmat.h, templates for sparse matrices
+#ifndef SPARSEMATRIX_H
+#define SPARSEMATRIX_H SPARSEMATRIX_H
+
+// selection of implementation
+#ifdef STL_map            // defined in main()
+#include<map>
+#include<cassert>
+#else
+#include<hmap.h>
+
+#include "TeDefines.h"
+
+/* If at this point the HMap container is chosen, a function for
+   calculating the hash table addresses is needed. As opposed to the
+   hash functions described up to now, not only one value, but two are
+   used for the calculation. Therefore, the function operator of the
+   PairHashFun class takes a pair as argument. The address calculation
+   itself is simple, but sufficient for our purposes. */
+
+using namespace std;
+
+template<class IndexType>  // int, long or unsigned
+class PairHashFun
+{
+  public:
+    PairHashFun(long prime=65537) // another prime number is possible
+        // e.g. 2111 for smaller Matrizes
+    : tabSize(prime)
+    {}
+
+    // Address calculation with two values
+    long operator()(const pair<IndexType, IndexType>& p) const
+    {
+       return (p.first + p.second) % tabSize;
+    }
+
+    long tableSize() const
+    { 
+       return tabSize;
+    }
+
+  private:
+    long tabSize;
+};
+#endif          //  STL_map
+
+#ifdef _MSC_VER
+#include <utility>
+using namespace std;
+#endif
+
+template<class ValueType, class IndexType, class ContainerType>
+class MatrixElement
+{
+  private:
+    ContainerType& C;
+    typename ContainerType::iterator I;
+    IndexType row, column;
+
+  public:
+    typedef pair<IndexType, IndexType> IndexPair;
+    typedef MatrixElement<ValueType, IndexType,
+                          ContainerType>&  Reference;
+
+    MatrixElement(ContainerType& Cont, IndexType r, IndexType c)
+    : C(Cont), I(C.find(IndexPair(r,c))),
+      row(r), column(c)
+    {}
+
+    /* The constructor initializes the private variables with all
+       information that is needed. The container itself is located in
+       the sparseMatrix class; here, the reference to it is entered.
+       If the passed indices for row and column belong to an element
+       not yet stored in the container, the iterator has the value
+       C.end(). */
+
+    ValueType asValue() const
+    {
+       if(I == C.end())
+           return ValueType(0);
+       else
+           return (*I).second;
+    }
+
+    operator ValueType () const  // type conversion operator
+    {
+       return asValue();
+    }
+
+    /* According to the definition of the sparse matrix, 0 is returned
+       if the element is not present in the container. Otherwise, the
+       result is the second part of the object of type value_type
+       stored in the container. */
+
+    Reference operator=(const ValueType& x)
+    {
+       if(x != ValueType(0))        // not equal 0?
+       {
+         /* If the element does not yet exist, it is put, together
+            with the indices, into an object of type value_type and
+            inserted with insert(): */
+
+          if(I == C.end())
+          {
+             assert(C.size() < C.max_size());
+             I = (C.insert(
+#ifndef _MSC_VER
+			 typename
+#endif
+			 ContainerType::value_type(
+                        IndexPair(row,column), x))
+                 ).first;
+          }
+          else (*I).second = x;
+       }
+
+       /* insert() returns a pair whose first part is an iterator
+          pointing to the inserted object. The second part is of type
+          bool and indicates whether the insertion took place because
+          no element with this key existed. This is, however, not
+          evaluated here because, due to the precondition (I ==
+          C.end()), the second part must always have the value true.
+          If, instead, the element already exists, the value is
+          entered into the second part of the value_type object. If
+          the value is equal 0, in order to save space the element is
+          deleted if it existed. */
+
+       else                    // x = 0
+          if(I != C.end())
+          {
+              C.erase(I);
+              I = C.end();
+          }
+       return *this;
+    }
+
+    /* An assignment operator is required which in turn requires a
+       reference to an object of type MatrixElement. When both the
+       left- and right-hand side are identical, nothing has to happen.
+       Otherwise, as above, it has to be checked whether the value of
+       the right-hand element is 0 or not. The resulting behavior is
+       described together with the above assignment operator, so that
+       here it is simply called: */
+
+    Reference operator=(const Reference rhs)
+    {
+       if(this != &rhs)      // not identical?
+       {
+           return operator=(rhs.asValue());  // see above
+       }
+       return *this;
+    }
+
+};  // class MatrixElement
+
+template<class ValueType, class IndexType>
+class TeSparseMatrix
+{
+   public:
+     typedef pair<IndexType, IndexType> IndexPair;
+
+     // The switch STL_map controls the compilation:
+
+#ifdef STL_map
+     typedef map<IndexPair, ValueType,
+                  less<IndexPair> >       ContainerType;
+#else
+     typedef HMap<IndexPair, ValueType,
+                  PairHashFun<IndexType> > ContainerType;
+#endif
+
+     typedef MatrixElement<ValueType, IndexType,
+                           ContainerType> MatrixElement;
+
+  public:
+    typedef IndexType size_type;
+
+    /* The constructor only initializes the row and column
+       information. The container is created by its standard
+       constructor, where in the case of hash implementation, the size
+       of the container is given by the hash function object of type
+       PairHashFun (see typedef above). */
+
+  private:
+    size_type rows, columns;
+    ContainerType C;
+
+  public:
+    sparseMatrix(size_type r, size_type c)
+    : rows(r), columns(c)
+    {}
+
+   size_type Rows()  const { return rows;}
+   size_type Columns() const { return columns;}
+
+   // usual container type definitions
+   typedef typename ContainerType::iterator iterator;
+   typedef typename ContainerType::const_iterator const_iterator;
+
+   // usual container functions
+   size_type size()       const { return C.size();}
+   size_type max_size()   const { return C.max_size();}
+
+   iterator begin()             { return C.begin();}
+   iterator end()               { return C.end();}
+
+   const_iterator begin() const { return C.begin();}
+   const_iterator end()   const { return C.end();}
+
+   void clear()
+   {
+       C.clear();
+
+   }
+
+   class Aux  // for index operator below
+   {
+     public:
+       Aux(size_type r, size_type maxs, ContainerType& Cont)
+       : Row(r), maxColumns(maxs), C(Cont)
+       {}
+
+       /* After checking the number of columns, the index operator of
+          Aux returns a matrix element which is equipped with all
+          necessary information to carry out a successful assignment.
+        */
+
+       MatrixElement operator[](size_type c)
+       {
+           assert(c >= 0 && c < maxColumns);
+           return MatrixElement(C, Row, c);
+       }
+
+     private:
+       size_type Row, maxColumns;
+       ContainerType& C;
+   };
+
+   /* The index operator of the sparseMatrix class returns the
+       auxiliary object, whose class is defined as nested inside
+       sparseMatrix. */
+   Aux operator[](size_type r)
+   {
+      assert(r >= 0 && r < rows);
+      return Aux(r, columns, C);
+   }
+
+    /* Up to this point, from a functionality point of view, the
+       sparseMatrix class is sufficiently equipped. In order, however,
+       to avoid writing such horrible things as `(*I).first.first' for
+       accessing the elements, some auxiliary functions follow which
+       determine the indices and associated values of an iterator in a
+       more readable way. */
+
+   size_type Index1(iterator& I) const
+   {
+      return (*I).first.first;
+   }
+
+   size_type Index2(iterator& I) const
+   {
+      return (*I).first.second;
+   }
+
+   ValueType Value(iterator& I) const
+   {
+      return (*I).second;
+   }
+};       // class sparseMatrix
+
+#endif   // file sparmat.h
+
+
diff --git a/src/terralib/kernel/TeSpatialOperations.cpp b/src/terralib/kernel/TeSpatialOperations.cpp
old mode 100755
new mode 100644
index 7894ad3..c01cdfa
--- a/src/terralib/kernel/TeSpatialOperations.cpp
+++ b/src/terralib/kernel/TeSpatialOperations.cpp
@@ -1,1663 +1,1663 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeSpatialOperations.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeRasterRemap.h"
-#include "TeStatistics.h"
-#include "TeOverlay.h"
-#include "TeBufferRegion.h"
-#include "TeProgress.h"
-#include "TeVectorRemap.h"
-
-#include <algorithm>
-
-
-TeProjection*
-getProjectionFromGeomTable(const string& geomTable, TeDatabase* db)
-{
-	TeLayerMap layerMap = db->layerMap();
-	TeLayerMap::iterator it = layerMap.begin();
-	while(it!=layerMap.end())
-	{
-		TeLayer* layer = it->second;
-		TeRepresPointerVector::iterator itRep = layer->vectRepres().begin();
-		while(itRep!=layer->vectRepres().end())
-		{
-			if(TeConvertToUpperCase((*itRep)->tableName_)==TeConvertToUpperCase(geomTable))
-				return layer->projection();
-			++itRep;
-		}
-		++it;
-	}
-	return 0; 
-}
-
-
-// Return if exist or not a totpological relation between two geometries
-// Use the TerraLib topological functions
-bool TeTopologicalRelation(const TePolygon* geom1, const TePolygon* geom2, int relation)
-{
-	bool result = false;
-	switch (relation)  
-	{		
-		case TeDISJOINT:
-			result = TeDisjoint(*geom1, *geom2);
-		break;
-
-		case TeINTERSECTS:
-			result = TeIntersects(*geom1, *geom2);
-		break;
-		
-		case TeTOUCHES:
-			result = TeTouches(*geom1, *geom2);
-		break;
-
-		case TeOVERLAPS:
-			result = TeOverlaps(*geom1, *geom2);
-		break;
-
-		case TeCOVERS:
-			result = TeCovers(*geom1, *geom2);
-		break;
-
-		case TeCOVEREDBY:
-			result = TeCoveredBy(*geom1, *geom2);
-		break;
-		
-		case TeCONTAINS:
-			result = TeContains(*geom1, *geom2);
-		break;
-		
-		case TeWITHIN:
-			result = TeWithin(*geom1, *geom2);
-		break;
-		
-		case TeEQUALS:
-			result = TeEquals(*geom1, *geom2);
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY) :
-			result = TeWithinOrCoveredByOrEquals(*geom1, *geom2);
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
-			result = ( (TeOverlaps(*geom1, *geom2)) || (TeWithinOrCoveredByOrEquals(*geom1, *geom2)));
-		break;
-	}
-	return result;
-}
-
-
-bool TeTopologicalRelation(const TePolygon* geom1, const TeLine2D* geom2, int relation)
-{
-	bool result = false;
-	switch (relation)
-	{		
-		case TeDISJOINT:
-			result = TeDisjoint(*geom2, *geom1); 
-		break;
-
-		case TeINTERSECTS:
-			result = TeIntersects(*geom2, *geom1); 
-		break;
-		
-		case TeTOUCHES:
-			result = TeTouches(*geom2, *geom1);  
-		break;
-
-		case TeCOVERS:
-			result = TeCovers(*geom1, *geom2);  
-		break;
-
-		case TeCOVEREDBY:
-			result = TeCoveredBy(*geom2, *geom1);  
-		break;
-		
-		case TeCONTAINS:
-			result = TeContains(*geom1, *geom2); 
-		break;
-		
-		case TeWITHIN:
-			result = TeWithin(*geom2, *geom1); 
-		break;
-		
-		case TeCROSSES:
-			result = TeCrosses(*geom2, *geom1); 
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY):
-			result = TeWithinOrCoveredByOrEquals(*geom2, *geom1);
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
-			result = ( (TeCrosses(*geom2, *geom1)) || (TeWithinOrCoveredByOrEquals(*geom2, *geom1)));
-		break;
-	}
-	return result;
-}
-
-
-bool TeTopologicalRelation(const TePolygon* geom1, const TePoint* geom2, int relation)
-{
-	bool result = false;
-	switch (relation)
-	{		
-		case TeDISJOINT:
-			result = TeDisjoint(*geom2, *geom1); 
-		break;
-
-		case TeINTERSECTS:
-			result = TeIntersects(*geom2, *geom1); 
-		break;
-		
-		case TeTOUCHES:
-			result = TeTouches(*geom2, *geom1);  
-		break;
-
-		case TeCONTAINS:
-			result = TeContains(*geom1, *geom2); 
-		break;
-		
-		case TeWITHIN:
-			result = TeWithin(*geom2, *geom1); 
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY):
-		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
-			result = TeWithinOrCoveredByOrEquals((*geom2).location(), *geom1);
-		break;
-	}
-	return result;
-}
-
-bool TeTopologicalRelation(const TeLine2D* geom1, const TeLine2D* geom2, int relation)
-{
-	bool result = false;
-	switch (relation)  
-	{		
-		case TeDISJOINT:
-			result = TeDisjoint(*geom1, *geom2); 
-		break;
-
-		case TeINTERSECTS:
-			result = TeIntersects(*geom1, *geom2); 
-		break;
-		
-		case TeTOUCHES:
-			result = TeTouches(*geom1, *geom2); 
-		break;
-
-		case TeOVERLAPS:
-			result = TeOverlaps(*geom1, *geom2); 
-		break;
-
-		case TeCOVERS:
-			result = TeCovers(*geom1, *geom2); 
-		break;
-
-		case TeCOVEREDBY:
-			result = TeCoveredBy(*geom1, *geom2); 
-		break;
-		
-		case TeCONTAINS:
-			result = TeContains(*geom1, *geom2); 
-		break;
-		
-		case TeWITHIN:
-			result = TeWithin(*geom1, *geom2); 
-		break;
-		
-		case TeEQUALS:
-			result = TeEquals(*geom1, *geom2); 
-		break;
-
-		case TeCROSSES:
-			result = TeCrosses(*geom1, *geom2); 
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
-			result = ( (TeCrosses(*geom1, *geom2)) || (TeWithinOrCoveredByOrEquals(*geom1, *geom2)));
-		break;
-	}
-	return result;
-}
-
-bool TeTopologicalRelation(const TeLine2D* geom1, const TePoint* geom2, int relation)
-{
-	bool result = false;
-	switch (relation)  
-	{		
-		case TeDISJOINT:
-			result = TeDisjoint(*geom2, *geom1); 
-		break;
-
-		case TeINTERSECTS:
-			result = TeIntersects(*geom2, *geom1); 
-		break;
-		
-		case TeTOUCHES:
-			result = TeTouches(*geom2, *geom1); 
-		break;
-
-		case TeCONTAINS:
-			result = TeContains(*geom1, *geom2); 
-		break;
-		
-		case TeWITHIN:
-			result = TeWithin(*geom2, *geom1); 
-		break;
-		
-		case (TeWITHIN | TeCOVEREDBY):
-		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
-			result = TeWithinOrCoveredByOrEquals((*geom2).location(), *geom1);
-		break;
-	}
-	return result;
-}
-
-bool TeTopologicalRelation(const TePoint* geom1, const TePoint* geom2, int relation)
-{
-	bool result = false;
-	switch (relation)  
-	{		
-		case TeDISJOINT:
-			result = TeDisjoint(*geom1, *geom2); 
-		break;
-
-		case TeINTERSECTS:
-			result = TeIntersects(*geom1, *geom2); 
-		break;
-		
-		case TeCONTAINS:
-			result = TeContains(*geom1, *geom2); 
-		break;
-		
-		case TeWITHIN:
-			result = TeWithin(*geom1, *geom2); 
-		break;
-		
-		case TeEQUALS:
-		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
-			result = TeEquals(*geom1, *geom2); 
-		break;
-	}
-	return result;
-}
-
-bool TeTopologicalRelation(const TeCell* geom1, const TeCell* geom2, int relation)
-{
-	bool result = false;
-	switch (relation)  
-	{		
-		case TeDISJOINT:
-			result = TeDisjoint(*geom1, *geom2);
-		break;
-
-		case TeINTERSECTS:
-			result = TeIntersects(*geom1, *geom2);
-		break;
-		
-		case TeTOUCHES:
-			result = TeTouches(*geom1, *geom2);
-		break;
-
-		case TeOVERLAPS:
-			result = TeOverlaps(*geom1, *geom2);
-		break;
-
-		case TeCOVERS:
-			result = TeCovers(*geom1, *geom2);
-		break;
-
-		case TeCOVEREDBY:
-			result = TeCoveredBy(*geom1, *geom2);
-		break;
-		
-		case TeCONTAINS:
-			result = TeContains(*geom1, *geom2);
-		break;
-		
-		case TeWITHIN:
-			result = TeWithin(*geom1, *geom2);
-		break;
-		
-		case TeEQUALS:
-			result = TeEquals(*geom1, *geom2);
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY):
-			result = TeWithinOrCoveredByOrEquals((*geom1).box(), (*geom2).box());
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
-			result = ( (TeOverlaps(*geom1, *geom2)) || (TeWithinOrCoveredByOrEquals((*geom1).box(), (*geom2).box())));
-		break;
-	}
-	return result;
-}
-
-bool TeTopologicalRelation(const TeCell* geom1, const TePolygon* geom2, int relation)
-{
-	bool result = false;
-	switch (relation)  
-	{		
-		case TeDISJOINT:
-			result = TeDisjoint(*geom1, *geom2);
-		break;
-
-		case TeINTERSECTS:
-			result = TeIntersects(*geom1, *geom2);
-		break;
-		
-		case TeTOUCHES:
-			result = TeTouches(*geom1, *geom2);
-		break;
-
-		case TeOVERLAPS:
-			result = TeOverlaps(*geom1, *geom2);
-		break;
-
-		case TeCOVERS:
-			result = TeCovers(*geom1, *geom2);
-		break;
-
-		case TeCOVEREDBY:
-			result = TeCoveredBy(TeMakePolygon((*geom1).box()), *geom2);
-		break;
-		
-		case TeCONTAINS:
-			result = TeWithin(*geom2, TeMakePolygon((*geom1).box()));
-		break;
-		
-		case TeWITHIN:
-			result = TeWithin(*geom1, *geom2);
-		break;
-		
-		case TeEQUALS:
-			result = TeEquals(*geom1, *geom2);
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY):
-			result = TeWithinOrCoveredByOrEquals(TeMakePolygon((*geom1).box()), *geom2);
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
-			result = ( (TeOverlaps(*geom1, *geom2)) || (TeWithinOrCoveredByOrEquals(TeMakePolygon((*geom1).box()) , *geom2)));
-		break;
-	}
-	return result;
-}
-
-bool TeTopologicalRelation(const TeCell* geom1, const TeLine2D* geom2, int relation)
-{
-	bool result = false;
-	switch (relation)
-	{		
-		case TeDISJOINT:
-			result = TeDisjoint(*geom1, *geom2); 
-		break;
-
-		case TeINTERSECTS:
-			result = TeIntersects(*geom1, *geom2); 
-		break;
-		
-		case TeTOUCHES:
-			result = TeTouches(*geom2, *geom1);  
-		break;
-
-		case TeCOVERS:
-			result = TeCovers(*geom1, *geom2);  
-		break;
-
-		case TeCOVEREDBY:
-			result = TeCoveredBy(*geom2, *geom1);  
-		break;
-		
-		case TeCONTAINS:
-			result = TeContains(*geom1, *geom2); 
-		break;
-		
-		case TeWITHIN:
-			result = TeWithin(*geom2, *geom1); 
-		break;
-		
-		case TeCROSSES:
-			result = TeCrosses(*geom2, *geom1); 
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY):
-			result = TeWithinOrCoveredByOrEquals(*geom2, TeMakePolygon((*geom1).box()));
-		break;
-
-		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
-			result = ( (TeCrosses(*geom2, *geom1)) || (TeWithinOrCoveredByOrEquals(*geom2, TeMakePolygon((*geom1).box()))));
-		break;
-	}
-	return result;
-
-}
-
-bool TeTopologicalRelation(const TeCell* geom1, const TePoint* geom2, int relation)
-{
-	bool result = false;
-	switch (relation)
-	{		
-		case TeDISJOINT:
-			result = TeDisjoint(*geom1, *geom2); 
-		break;
-
-		case TeINTERSECTS:
-			result = TeIntersects(*geom1, *geom2); 
-		break;
-		
-		case TeTOUCHES:
-			result = TeTouches(*geom2, *geom1);  
-		break;
-
-		case TeCONTAINS:
-			result = TeContains(*geom1, *geom2); 
-		break;
-		
-		case TeWITHIN:
-			result = TeWithin(*geom2, *geom1); 
-		break;
-
-		case (TeWITHIN & TeCOVEREDBY):
-		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
-			result = TeWithinOrCoveredByOrEquals((*geom2).location(), TeMakePolygon((*geom1).box()));
-		break;
-	}
-	return result;
-
-}
-
-
-// Return a string with the identifications of the selected geometries 
-string 
-getStringIds(TeKeys& IdsIn)
-{
-	string Ids = "";
-	int cont = 0;
-	
-	TeKeys::iterator itIdIn = IdsIn.begin();
-	while (itIdIn != IdsIn.end())
-	{
-		if(cont)
-			Ids += ","; 
-		Ids += "'" + (*itIdIn) + "'";
-		itIdIn++;
-		cont++;
-	}
-
-	return Ids;
-}
-
-// fill the geometries vector from a portal
-string
-mountSelect(string geomTable, string colTable, TeGeomRep rep, TeBox& box, int relate, TeDatabasePortal *portal)
-{
-	
-	string sql = "SELECT * FROM "+ geomTable;
-	
-	if(!colTable.empty())
-		sql +=", "+ colTable +" WHERE c_object_id = object_id ";
-		
-	//If not disjoint
-	if(box.isValid() && (relate!=TeDISJOINT))
-	{
-		if(!colTable.empty())
-			sql += " AND ";
-		else
-			sql += " WHERE ";
-
-		sql += portal->getDatabase()->getSQLBoxWhere (box, rep);
-	}
-	return sql;
-}
-
-//fill the result vector of the geometries identificators  
-bool
-fillSelectedGeomVector(TeGeomRep actRep, TeSelectedGeom& vetGeom, TeDatabasePortal *portal, TeProjection* projAct=0, TeProjection* projVis=0)
-{
-	bool flag = true;
-	bool remap = false;
-
-	if((projAct!=0) && (projVis!=0) && (projAct!=projVis))
-		remap = true;
-	
-	try
-	{
-		do
-		{
-			if(actRep == TePOLYGONS)
-			{
-				TePolygon   poly, *pol;
-				flag = portal->fetchGeometry(poly); 
-				pol = new TePolygon;
-				if(remap)
-				{
-					TePolygon pout;
-					TeVectorRemap (poly, projAct, pout, projVis);
-					*pol = pout;
-				}
-				else
-					*pol = poly;
-				vetGeom.push_back(pol);
-			}
-			else if(actRep == TeLINES)
-			{
-				TeLine2D	line, *lin;
-				flag = portal->fetchGeometry(line); 
-				lin = new TeLine2D();
-				if(remap)
-				{
-					TeLine2D gout;
-					TeVectorRemap (line, projAct, gout, projVis);
-					*lin = gout;
-				}
-				else
-					*lin = line;
-				vetGeom.push_back(lin);
-			}
-			else if(actRep == TePOINTS)
-			{
-				TePoint		point, *pnt;
-				flag = portal->fetchGeometry(point); 
-				pnt = new TePoint();
-				if(remap)
-				{
-					TePoint gout;
-					TeVectorRemap (point, projAct, gout, projVis);
-					*pnt = gout;
-				}
-				else
-					*pnt = point;
-				vetGeom.push_back(pnt);
-			}
-			else if(actRep == TeCELLS)
-			{
-				TeCell		cell, *cll;
-				flag = portal->fetchGeometry(cell); 
-				cll = new TeCell();
-				if(remap)
-				{
-					TeCell gout;
-					TeVectorRemap (cell, projAct, gout, projVis);
-					*cll = gout;
-				}
-				else
-					*cll = cell;
-				vetGeom.push_back(cll);
-			}
-		} while (flag);
-	}
-	catch(...)
-	{
-		TeSelectedGeom::iterator it;
-		for(it = vetGeom.begin(); it != vetGeom.end(); it++)
-			delete (*it);
-		return false;
-	}
-
-	return true;
-}
-
-//geom: selected geometries
-//obj: portal geometries
-//basic idea: obj "relate" geom
-bool
-fillResultIdsVector(TeGeometry *geom, TeDatabasePortal *portal, TeGeomRep portalRep, int relate, TeKeys& resultIds)
-{
-	bool flag = false;
-	bool result = false;
-	TeGeomRep geomRep = geom->elemType();
-	bool isSet = false;
-	int setSize = 1;
-
-	if ( (dynamic_cast<TePolygonSet*> (geom)) ||
-		 (dynamic_cast<TeLineSet*> (geom)) ||
-		 (dynamic_cast<TePointSet*> (geom)) ||
-		 (dynamic_cast<TeCellSet*> (geom)) )
-	{
-		isSet = true;
-		setSize = geom->size();
-	}
-
-	try
-	{
-		do
-		{
-			TeGeometry* obj = 0;
-			if(portalRep == TePOLYGONS)
-			{
-				TePolygon   poly, *pol;
-				flag = portal->fetchGeometry (poly);
-				pol = new TePolygon();
-				*pol = poly;
-				obj = pol;
-			}
-			else if(portalRep == TeLINES)
-			{
-				TeLine2D	line, *lin;
-				flag = portal->fetchGeometry (line);
-				lin = new TeLine2D();
-				*lin = line;
-				obj = lin;
-			}
-			else if(portalRep == TePOINTS)
-			{
-				TePoint		point, *pnt;
-				flag = portal->fetchGeometry (point);
-				pnt = new TePoint();
-				*pnt = point;
-				obj = pnt;
-			}
-			else if(portalRep == TeCELLS)
-			{
-				TeCell		cell, *cll;
-				flag = portal->fetchGeometry (cell);
-				cll = new TeCell();
-				*cll = cell;
-				obj = cll;
-			}
-
-			result = false;
-
-			//for each geometry 	
-			for(int i=0; i<setSize; ++i)
-			{
-				TeGeometry* geomTemp = 0;
-				if(isSet)
-				{
-					if(geomRep==TePOLYGONS)
-						geomTemp = &(((TePolygonSet*)geom)->operator[](i));
-					else if (geomRep==TeLINES)
-						geomTemp = &(((TeLineSet*)geom)->operator[](i));
-					else if (geomRep==TePOINTS)
-						geomTemp = &(((TePointSet*)geom)->operator[](i));
-					else if (geomRep==TeCELLS)
-						geomTemp = &(((TeCellSet*)geom)->operator[](i));
-				}
-				else
-					geomTemp = geom;
-				
-				switch (geomRep | portalRep)   //geom: selected and obj: portal
-				{
-						
-					case 1: //polygon with polygon
-						result = TeTopologicalRelation((TePolygon*)obj, (TePolygon*)geomTemp, relate);
-					break;
-
-					case 2://line with line 
-						result = TeTopologicalRelation((TeLine2D*)obj, (TeLine2D*)geomTemp, relate);
-					break;
-			
-					case 3://polygon with line
-						if(geomRep == TePOLYGONS)
-							result = TeTopologicalRelation((TePolygon*)geomTemp, (TeLine2D*)obj, relate);
-						else
-							result = TeTopologicalRelation((TePolygon*)obj, (TeLine2D*)geomTemp, relate);
-					break;
-				
-					case 4://point with point
-						result = TeTopologicalRelation((TePoint*)obj, (TePoint*)geomTemp, relate);
-					break;
-				
-					case 5://polygon with point
-						if(geomRep == TePOLYGONS)
-							result = TeTopologicalRelation((TePolygon*)geomTemp, (TePoint*)obj, relate);
-						else
-							result = TeTopologicalRelation((TePolygon*)obj, (TePoint*)geomTemp, relate);
-					break;
-
-					case 6://line with point 
-						if(geomRep == TeLINES)
-							result = TeTopologicalRelation((TeLine2D*)geomTemp, (TePoint*)obj, relate);
-						else
-							result = TeTopologicalRelation((TeLine2D*)obj, (TePoint*)geomTemp, relate);
-					break;
-					
-					case 256://cell with cell 
-						result = TeTopologicalRelation((TeCell*)obj, (TeCell*)geomTemp, relate);
-					break;
-
-					case 257://cell with polygon 
-						if(geomRep == TePOLYGONS)
-							result = TeTopologicalRelation((TeCell*)obj, (TePolygon*)geomTemp, relate);
-						else
-							result = TeTopologicalRelation((TeCell*)geomTemp, (TePolygon*)obj, relate);
-					break;
-					
-					case 258://cell with line 
-						if(geomRep == TeLINES)
-							result = TeTopologicalRelation((TeCell*)obj,  (TeLine2D*)geomTemp, relate);
-						else
-							result = TeTopologicalRelation((TeCell*)geomTemp, (TeLine2D*)obj, relate);
-					break;
-
-					case 260://cell with point
-						if(geomRep == TeCELLS)
-							result = TeTopologicalRelation((TeCell*)geomTemp, (TePoint*)obj, relate);
-						else
-							result = TeTopologicalRelation((TeCell*)obj,  (TePoint*)geomTemp, relate);
-					break;
-				}
-						
-				if(result)
-				{
-					string objId = obj->objectId();
-					resultIds.push_back(objId);
-				}
-			}//for
-
-			delete obj;
-		} while (flag); //fetchrow
-	}
-	catch(...)
-	{
-		return false;
-	}
-	return true;
-}
-
-
-bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-						   TeDatabasePortal *portal, int relation, const string& actColTable)
-{
-	TeKeys  resultIds;
-
-	if(!TeTopologicalRelation(actGeomTable, actRep, actIdsIn, resultIds, portal->getDatabase(), relation, actColTable))
-		return false;
-
-	string Ids = getStringIds(resultIds);
-	
-	string sql = "SELECT * FROM " + actGeomTable;
-	sql += " WHERE object_id IN (" + Ids + ")";
-	sql += " ORDER BY object_id ASC ";
-	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
-		sql += ", parent_id ASC, num_holes DESC ";
-	
-	portal->freeResult();
-
-	if(!portal->query(sql) || !portal->fetchRow())
-		return false;
-	
-	return true;
-}
-
-bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-						   const string& visGeomTable,  TeGeomRep visRep, TeDatabasePortal *portal, 
-						   int relation, const string& visColTable)
-{
-	TeKeys  resultIds;
-
-	if(!TeTopologicalRelation(actGeomTable, actRep, actIdsIn, visGeomTable, visRep, resultIds, portal->getDatabase(), relation, visColTable))
-		return false;
-	
-	string Ids = getStringIds(resultIds);
-
-	portal->freeResult ();
-
-	string sql = "SELECT * FROM " + visGeomTable;
-	sql += " WHERE object_id IN (" + Ids + ")";
-	sql += " ORDER BY object_id ASC ";
-	if(visRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
-		sql += ", parent_id ASC, num_holes DESC ";
-
-	if(!portal->query(sql) || !portal->fetchRow())
-		return false;
-		
-	return true;
-}
-
-bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
-						   TeDatabasePortal *portal, int relation, const string& actCollTable)
-{
-	
-	TeKeys	resultIds;
-	
-	if(!TeTopologicalRelation(actGeomTable, actRep, geom, resultIds, portal->getDatabase(), relation, actCollTable))
-		return false;
-	
-	string Ids = getStringIds(resultIds);
-
-	portal->freeResult();
-
-	string sql = "SELECT * FROM " + actGeomTable;
-	sql += " WHERE object_id IN (" + Ids + ")";
-	sql += " ORDER BY object_id ASC ";
-	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
-		sql += ", parent_id ASC, num_holes DESC ";
-
-	if(!portal->query(sql) || !portal->fetchRow())
-		return false;
-	
-	return true;
-}
-	
-bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-						   TeKeys& actIdsOut, TeDatabase* db, int relation, const string& actCollTable)
-{
-	TeSelectedGeom	vetGeom;
-			
-	string Ids = getStringIds(actIdsIn);
-
-	TeDatabasePortal* portal = db->getPortal();
-
-	string sql = "SELECT * FROM " + actGeomTable;
-	sql += " WHERE object_id IN (" + Ids + ")";
-	
-	//order by clause
-	string sqlOrderBy = " ORDER BY object_id ASC ";
-	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
-		sqlOrderBy += ", parent_id ASC, num_holes DESC ";
-
-	sql += sqlOrderBy;
-	actIdsOut.clear();
-	
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	if(!fillSelectedGeomVector(actRep,vetGeom,portal))
-	{
-		delete portal;
-		return false; 
-	}
-
-	//iterators
-	TeSelectedGeom::iterator it;
-	double prec = TePrecision::instance().precision();
-	
-	for (it = vetGeom.begin(); it != vetGeom.end(); it++)
-	{
-		portal->freeResult();
-		TeBox box = (**it).box();
-
-		TeBox temp (box.x1()-prec, box.y1()-prec, box.x2()+prec, box.y2()+prec); 
-		
-		sql = mountSelect(actGeomTable, actCollTable, actRep, temp, relation, portal);
-		if(relation != TeEQUALS)
-			sql += " AND object_id NOT IN (" + Ids + ")";
-		sql += sqlOrderBy;
-
-		if(!portal->query(sql)) 
-		{
-			delete portal;
-			return false;
-		}
-
-		if(!portal->fetchRow())
-			continue;
-
-		fillResultIdsVector((*it), portal, actRep, relation, actIdsOut);
-	
-	} 
-		
-	sort(actIdsOut.begin(), actIdsOut.end());
-	TeKeys::iterator itUnique = std::unique( actIdsOut.begin(), actIdsOut.end() );
-	if(itUnique!=actIdsOut.end())	actIdsOut.erase(itUnique,actIdsOut.end());
-
-	delete portal;
-	
-	for (it = vetGeom.begin(); it != vetGeom.end(); it++)
-		delete (*it);
-
-	return !actIdsOut.empty();
-}
-
-bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-						   const string& visGeomTable, TeGeomRep visRep, TeKeys& visIdsOut, 
-						   TeDatabase* db, int relation, const string& visCollTable, TeDatabase* dbVis)
-{
-	TeSelectedGeom	vetGeom;
-			
-	string Ids = getStringIds(actIdsIn);
-	if(dbVis == 0)
-		dbVis = db;
-
-	//verify projection
-	TeProjection* projAct = getProjectionFromGeomTable(actGeomTable, db);
-	TeProjection* projVis = getProjectionFromGeomTable(visGeomTable, dbVis);
-	visIdsOut.clear();
-	TeDatabasePortal* portal = db->getPortal();
-
-	string sql = "SELECT * FROM " + actGeomTable;
-	sql += " WHERE object_id IN (" + Ids + ")";
-	sql += " ORDER BY object_id ASC ";
-	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
-		sql += ", parent_id ASC, num_holes DESC ";
-	
-	if(!portal->query(sql)|| !portal->fetchRow ())
-	{
-		delete portal;
-		return false;
-	}
-	
-	if(!fillSelectedGeomVector(actRep,vetGeom,portal,projAct, projVis))
-	{
-		delete portal;
-		return false; 
-	}
-
-	if(db != dbVis)
-	{
-		delete portal;
-		portal = dbVis->getPortal();
-	}
-
-	//iterators
-	TeSelectedGeom::iterator it;
-	
-	double prec = TePrecision::instance().precision();
-
-	for (it = vetGeom.begin(); it != vetGeom.end(); it++)
-	{
-		portal->freeResult();
-		TeBox box = (**it).box();
-		
-		TeBox temp (box.x1()-prec, box.y1()-prec, box.x2()+prec, box.y2()+prec); 
-		
-		sql = mountSelect(visGeomTable, visCollTable, visRep, temp, relation, portal);
-		sql += " ORDER BY object_id ASC ";
-		if(visRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
-			sql += ", parent_id ASC, num_holes DESC ";
-
-		if(!portal->query(sql)) 
-		{
-			delete portal;
-			return false;
-		}
-
-		if(!portal->fetchRow())
-			continue;
-	
-		fillResultIdsVector((*it), portal, visRep, relation, visIdsOut);
-
-	}
-						
-	delete portal;
-	
-	sort(visIdsOut.begin(), visIdsOut.end());
-	TeKeys::iterator itUnique = std::unique( visIdsOut.begin(), visIdsOut.end() );
-	if(itUnique!=visIdsOut.end())	visIdsOut.erase(itUnique,visIdsOut.end());
-
-	for (it = vetGeom.begin(); it != vetGeom.end(); it++)
-		delete (*it);
-
-	return !visIdsOut.empty();
-}
-
-bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
-						   TeKeys& actIdsOut, TeDatabase* db, int relation, const string& actCollTable)
-{
-	TeDatabasePortal* portal = db->getPortal();
-	TeBox box = geom->box();
-
-	actIdsOut.clear();
-	double prec = TePrecision::instance().precision();
-	TeBox temp (box.x1()-prec, box.y1()-prec, box.x2()+prec, box.y2()+prec); 
-
-	string sql = mountSelect(actGeomTable, actCollTable, actRep, temp, relation, portal);
-	sql += " ORDER BY object_id ASC ";
-	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
-		sql += ", parent_id ASC, num_holes DESC ";
-
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	
-	
-	fillResultIdsVector(geom, portal, actRep, relation, actIdsOut);
-
-	delete portal;
-	
-	sort(actIdsOut.begin(), actIdsOut.end());
-	TeKeys::iterator it = std::unique( actIdsOut.begin(), actIdsOut.end() );
-	if(it!=actIdsOut.end())	actIdsOut.erase(it,actIdsOut.end());
-	return !actIdsOut.empty();
-}
-
-bool TeGetWithinDistance(const string& actGeomTable, TeGeomRep actRep, const TeCoord2D& point, TeKeysToDist& IdsDistOut,
-						 TeDatabase* db, const double& max_dist, const string& actCollTable)
-{
-	if(!db)
-		return false;
-	
-	TeDatabasePortal* portal = db->getPortal();
-	if(!portal)
-		return false;
-
-	TeBox box (point.x()-max_dist, point.y()-max_dist,point.x()+max_dist, point.y()+max_dist); 
-
-	string sql = mountSelect(actGeomTable, actCollTable, actRep, box, TeWITHIN, portal);
-	sql += " ORDER BY object_id ASC ";
-	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
-		sql += ", parent_id ASC, num_holes DESC ";
-
-	if(!portal->query(sql)) 
-	{
-		delete portal;
-		return false;
-	}
-
-	if(!portal->fetchRow())
-	{
-		delete portal;
-		return true;
-	}
-
-	bool flag = true;
-	do
-	{
-		TeCoord2D centroid2;
-		string objId;
-		if(actRep == TePOLYGONS)
-		{
-			TePolygon   poly;
-			flag = portal->fetchGeometry (poly);
-			objId = poly.objectId ();
-			centroid2 = TeFindCentroid(poly);
-		}
-		else if(actRep == TeLINES)
-		{
-			TeLine2D	line;
-			flag = portal->fetchGeometry (line);
-			objId = line.objectId ();
-			centroid2 = TeFindCentroid(line);
-		}
-		else if(actRep == TePOINTS)
-		{
-			TePoint		point;
-			flag = portal->fetchGeometry (point);
-			objId = point.objectId ();
-			centroid2 = TeFindCentroid(point);
-		}
-		else if(actRep == TeCELLS)
-		{
-			TeCell		cell;
-			flag = portal->fetchGeometry (cell);
-			objId = cell.objectId ();
-			centroid2 = TeFindCentroid(cell);
-		}
-		
-		double dist = TeDistance(point, centroid2);
-		if(dist<=max_dist)
-			IdsDistOut[objId] = dist;
-
-	} while (flag); //fetchrow
-	
-	//sort(IdsDistOut.begin(), IdsDistOut.end());
-
-	delete portal;
-	return true;
-}
-
-bool TeGetArea(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabase* db, double& area)
-{
-	if(actRep != TePOLYGONS && actRep != TeCELLS )
-		return false;
-
-	string Ids = getStringIds(actIdsIn);
-	
-	TeDatabasePortal* portal = db->getPortal();
-
-	string sql = "SELECT * FROM " + actGeomTable;
-	sql += " WHERE object_id IN (" + Ids + ")";
-	sql += " ORDER BY object_id ASC ";
-
-	if((actRep == TePOLYGONS) && (portal->getDatabase()->dbmsName() != "PostGIS"))
-		sql += ", parent_id ASC, num_holes DESC ";
-	
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	bool flag = false;
-	double sumArea = 0.;
-	do
-	{
-		if(actRep == TePOLYGONS)
-		{
-			TePolygon poly;
-			flag = portal->fetchGeometry(poly);
-			sumArea+= TeGeometryArea(poly);
-		}
-		else if(actRep == TeCELLS)
-		{
-			TeCell cell;
-			flag = portal->fetchGeometry(cell);
-			sumArea+= TeGeometryArea(cell.box());
-		}
-	}while (flag);
-	
-	area = sumArea;
-	delete portal;
-	return true;
-}
-
-
-bool TeGetLength(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabase* db, double& length)
-{
-	if((actRep != TePOLYGONS) && (actRep != TeLINES) && (actRep != TeCELLS) )
-		return false;
-
-	string Ids = getStringIds(actIdsIn);
-	
-	TeDatabasePortal* portal = db->getPortal();
-
-	string sql = "SELECT * FROM " + actGeomTable;
-	sql += " WHERE object_id IN (" + Ids + ")";
-	sql += " ORDER BY object_id ASC ";
-
-	if((actRep == TePOLYGONS) && (portal->getDatabase()->dbmsName() != "PostGIS"))
-		sql += ", parent_id ASC, num_holes DESC ";
-	
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	bool flag = false;
-	double sumLen = 0.;
-	do
-	{
-		if(actRep == TePOLYGONS)
-		{
-			TePolygon p;
-			flag = portal->fetchGeometry(p);
-			
-			for(unsigned int i=0; i<p.size(); i++)
-				sumLen += TeLength(p[i]);
-		}
-		else if (actRep == TeLINES)
-		{
-			TeLine2D l;
-			flag = portal->fetchGeometry(l);
-			sumLen += TeLength(l);
-		}
-		else if (actRep == TeCELLS)
-		{
-			TeCell c;
-			flag = portal->fetchGeometry(c);
-
-			TePolygon p = TeMakePolygon(c.box());
-			sumLen += TeLength(p[0]);
-		}
-		
-	}while (flag);
-	
-	length = sumLen;
-	delete portal;
-	return true;
-}
-
-
-bool TeGetDistance(const string& actGeomTable, TeGeomRep actRep, TeKeys& IdsIn, TeDatabase* db, double& distance)
-{
-	string Ids = getStringIds(IdsIn);
-	
-	TeDatabasePortal* portal = db->getPortal();
-
-	string sql = "SELECT * FROM " + actGeomTable;
-	sql += " WHERE object_id IN (" + Ids + ")";
-	sql += " ORDER BY object_id ASC ";
-
-	if((actRep == TePOLYGONS) && (portal->getDatabase()->dbmsName() != "PostGIS"))
-		sql += ", parent_id ASC, num_holes DESC ";
-	
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;  
-	}
-	
-	bool flag = false;
-	string lastObjId ="";
-	TeCoord2D coord1, coord2; 
-	int step = 0;
-	do
-	{
-		TeCoord2D coord;
-		string objId;
-		
-		if(actRep == TePOLYGONS)
-		{
-			TePolygon p;
-			flag = portal->fetchGeometry(p);
-			objId = p.objectId();
-			if(lastObjId==objId)
-				continue;
-			coord = TeFindCentroid(p);
-		}
-		else if (actRep == TeLINES)
-		{
-			TeLine2D l;
-			flag = portal->fetchGeometry(l);
-			objId = l.objectId ();
-			if(lastObjId==objId)
-				continue;
-			coord = TeFindCentroid(l);
-		}
-		else if (actRep == TePOINTS)
-		{
-			TePoint p;
-			flag = portal->fetchGeometry(p);
-			coord = p.location();
-		}
-		else if (actRep == TeCELLS)
-		{
-			TeCell c;
-			flag = portal->fetchGeometry(c);
-			objId = c.objectId ();
-			if(lastObjId==objId)
-				continue;
-			coord = TeFindCentroid(c);
-		}
-		
-		if(step==0)
-			coord1 = coord;
-		else
-			coord2 = coord;
-
-		lastObjId = objId;
-		++step;
-
-	}while (flag);
-	
-	distance = TeDistance(coord1, coord2);
-	delete portal;
-	return true;
-}
-
-bool TeGetConvexHull(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, TePolygonSet& convexHullSet)
-{
-	if(actRep != TePOLYGONS)
-		return false;
-
-	TeDatabasePortal* portal = db->getPortal();
-	string Ids = getStringIds(actIds);
-
-	string sql = "SELECT * FROM " + actGeomTable;
-	sql += " WHERE object_id IN ("+ Ids +")";
-	sql += " ORDER BY object_id ASC ";
-
-	if(portal->getDatabase()->dbmsName() != "PostGIS")
-		sql += ", parent_id ASC, num_holes DESC ";
-		
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-	do
-	{
-		TePolygon   poly, result;
-		flag = portal->fetchGeometry(poly);
-		TePolygon pol = TeConvexHull(poly);
-		result.add(pol[0]);
-		convexHullSet.add(result);
-	} while (flag);
-	
-	delete portal;
-	return true;
-}
-
-bool TeGetCentroid(const string& actGeomTable, TeGeomRep actRep, TeDatabase* db, TePointSet& centroidSet, TeKeys& actIds, const string& actCollTable)
-{
-	TeDatabasePortal* portal = db->getPortal();
-	string Ids = getStringIds(actIds);
-
-	string select = " SELECT * "; 
-	string from  =  " FROM " + actGeomTable;
-	string where =  " WHERE 1=1 ";
-
-	if(!actCollTable.empty())
-	{
-		select += ", "+ actCollTable;
-		where += " AND object_id = c_object_id ";
-	}
-
-	//if empty it calculates the centroids to all geometries 
-	if(!Ids.empty())
-		where += " AND object_id IN ("+ Ids +")";
-			
-	string orderBy = " ORDER BY object_id ASC ";
-	
-	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")
-		orderBy += ", parent_id ASC, num_holes DESC ";
-	
-	// ---- progress bar 
-	int numSteps = 0;
-	string sqlProg = " SELECT COUNT(*) "+ from + where; 
-	if(portal->query(sqlProg) && portal->fetchRow())
-		numSteps = portal->getInt(0);
-	
-	portal->freeResult();
-
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(numSteps);
-	//------
-	
-	string sql = select + from + where + orderBy;
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-	string lastObjId ="";
-	int step = 0;
-	do
-	{
-		TeCoord2D coord;
-		string objId;
-		
-		if(actRep == TePOLYGONS)
-		{
-			TePolygon p;
-			flag = portal->fetchGeometry(p);
-			objId = p.objectId();
-			if(lastObjId==objId)
-				continue;
-			coord = TeFindCentroid(p);
-		}
-		else if (actRep == TeLINES)
-		{
-			TeLine2D l;
-			flag = portal->fetchGeometry(l);
-			objId = l.objectId ();
-			if(lastObjId==objId)
-				continue;
-			coord = TeFindCentroid(l);
-		}
-		else if (actRep == TeCELLS)
-		{
-			TeCell c;
-			flag = portal->fetchGeometry(c);
-			objId = c.objectId ();
-			if(lastObjId==objId)
-				continue;
-			coord = TeFindCentroid(c);
-		}
-		
-		lastObjId = objId;
-		TePoint point(coord);
-		point.objectId (objId);
-		centroidSet.add(point);
-
-		if(TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			else
-				TeProgress::instance()->setProgress(step);
-		}	
-		++step;
-
-	} while (flag);
-	
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	delete portal;
-	return true;
-}
-
-
-bool TeGetBuffer(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, TePolygonSet& bufferSet, double dist)
-{
-	
-	if(actIds.empty())
-		return false;
-	
-	string Ids = getStringIds(actIds);
-
-	TeDatabasePortal* portal = db->getPortal();
-	if(!portal)
-		return false;
-	
-	string sql = " SELECT * FROM " + actGeomTable;
-	sql += " WHERE object_id IN ("+ Ids +")";
-	sql += " ORDER BY object_id ASC ";
-	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
-		sql += ", parent_id ASC, num_holes DESC ";
-	
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-	
-	bool flag = true;
-	bool res = true;
-	do
-	{
-		TePolygonSet polSet;
-
-		if(actRep == TePOINTS)
-		{
-			TePoint p;
-			TePolygon pol;
-			flag = portal->fetchGeometry(p);
-			res = TeBUFFERREGION::TeBufferRegion(p.location(), dist, 16, pol);
-			polSet.add (pol);
-		}
-
-		else if(actRep == TeLINES)
-		{
-			TeLine2D l;
-			flag = portal->fetchGeometry(l);
-			res = TeBUFFERREGION::TeBufferRegion(l, dist, 8, polSet);
-		}
-
-		else if(actRep == TePOLYGONS)
-		{
-			TePolygon p;
-			flag = portal->fetchGeometry(p);
-			res = TeBUFFERREGION::TeBufferRegion(p, dist, 8, polSet);
-		}	
-
-		else if(actRep == TeCELLS)
-		{
-			TeCell c;
-			flag = portal->fetchGeometry(c);
-			res = TeBUFFERREGION::TeBufferRegion(TeMakePolygon(c.box()), dist, 8, polSet);
-		}	
-		
-		if(res)
-		{
-			for(unsigned int i=0; i<polSet.size(); i++)
-				bufferSet.add(polSet[i]);
-		}
-	
-	} while (flag && res);
-
-	delete portal;
-	return true;
-}
-
-
-bool TeGetOverlay(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, TeGeometryVect& geomVect, const short& operation)
-{
-	if((actIds.empty()) || (actRep!=TePOLYGONS && actRep!=TeCELLS))
-		return false;
-	
-	string Ids = getStringIds(actIds);
-
-	TeDatabasePortal* portal = db->getPortal();
-	if(!portal)
-		return false;
-
-	string sql = " SELECT * FROM " + actGeomTable;
-	sql += " WHERE object_id IN ("+ Ids +")";
-	sql += " ORDER BY object_id ASC ";
-	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
-		sql += ", parent_id ASC, num_holes DESC ";
-	
-	if(!portal->query(sql) || !portal->fetchRow())
-	{
-		delete portal;
-		return false;
-	}
-		
-	bool flag = true;
-	TePolygonSet polSet1;
-	
-	if(actRep == TePOLYGONS)
-	{
-		TePolygon p;
-		flag = portal->fetchGeometry(p);
-		polSet1.add (p);
-	}
-	else if(actRep == TeCELLS)
-	{
-		TeCell c; 
-		flag = portal->fetchGeometry(c);
-		polSet1.add(TeMakePolygon(c.box()));
-	}
-
-	while (flag)
-	{
-		TePolygonSet polSet2, polInter;
-
-		if(actRep == TePOLYGONS)
-		{
-			TePolygon p;
-			flag = portal->fetchGeometry(p);
-			polSet2.add (p);
-		}	
-
-		else if(actRep == TeCELLS)
-		{
-			TeCell c;
-			flag = portal->fetchGeometry(c);
-			polSet2.add(TeMakePolygon(c.box()));
-		}
-		
-		if(operation==TeUNION)
-		{
-			if(!TeOVERLAY::TeUnion(polSet1, polSet2, polInter))
-				return false;
-		}
-		else if (operation==TeINTERSECTION)
-		{
-			if(!TeOVERLAY::TeIntersection(polSet1, polSet2, polInter))
-				return false;
-		}
-		else if (operation==TeDIFFERENCE)
-		{
-			if(!TeOVERLAY::TeDifference(polSet1, polSet2, polInter))
-				return false;
-		}
-
-		polSet1 = polInter;
-	}
-
-	TeGeometry* geom;
-	TePolygonSet* pol = new TePolygonSet();
-	*pol = polSet1;
-	geom = pol;
-	
-	geomVect.push_back (geom);
-	delete portal;
-	return true;
-}
-
-
-TeRaster*
-TeMask(TeRaster* whole, TePolygon& poly, TeStrategicIterator st)
-{
-	if (!whole || (whole->params().status_ != TeRasterParams::TeReadyToRead && 
-		whole->params().status_ != TeRasterParams::TeReadyToWrite))
-		return 0;
-
-	if (!TeIntersects(poly.box(),whole->params().boundingBox()))
-		return 0;
-	
-	TeRasterParams par = whole->params();
-	par.decoderIdentifier_ = "MEM";
-	par.mode_ = 'c';
-	par.setDummy(0);
-
-	TeCoord2D bll = whole->coord2Index(poly.box().lowerLeft());
-	TeCoord2D bur = whole->coord2Index(poly.box().upperRight());
-
-	bll = whole->index2Coord(TeCoord2D(TeRoundRasterIndex(bll.x_),TeRoundRasterIndex(bll.y_)));
-	bur = whole->index2Coord(TeCoord2D(TeRoundRasterIndex(bur.x_),TeRoundRasterIndex(bur.y_)));
-
-	par.boxResolution(bll.x_, bll.y_, bur.x_, bur.y_,par.resx_, par.resy_);
-	par.setDummy(0.0);
-	par.useDummy_ = true;
-
-	TeRaster*  clip = new TeRaster(par);
-	clip->init();
-	if (clip->params().status_ != TeRasterParams::TeReadyToWrite)
-		return 0;
-
-	TeCoord2D cd = TeCoord2D(0,0);
-	TeCoord2D ul = clip->params().index2Coord(cd);
-	TeCoord2D dxdy = whole->params().coord2Index(ul);
-	int j = TeRoundRasterIndex(dxdy.x_); // column delta
-	int i = TeRoundRasterIndex(dxdy.y_); // line delta
-
-	TeRaster::iteratorPoly it = whole->begin(poly, st);
-//	int nlines = it.nLinesInPoly();
-//	int ncols = it.nColsInPoly();
-	while(!it.end())
-    {
-		int lin = it.currentLine();
-		int col = it.currentColumn();
-		int nbands = it.nBands();
-		vector<double> vals;
-		vals = (*(TeRaster::iterator)it);
-		for (int b=0; b<nbands; b++)
-			clip->setElement(col-j,lin-i,vals[b],b);
-		++it;
-	}
-	return clip;
-}
-
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeSpatialOperations.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeRasterRemap.h"
+#include "TeStatistics.h"
+#include "TeOverlay.h"
+#include "TeBufferRegion.h"
+#include "TeProgress.h"
+#include "TeVectorRemap.h"
+
+#include <algorithm>
+
+
+TeProjection*
+getProjectionFromGeomTable(const string& geomTable, TeDatabase* db)
+{
+	TeLayerMap layerMap = db->layerMap();
+	TeLayerMap::iterator it = layerMap.begin();
+	while(it!=layerMap.end())
+	{
+		TeLayer* layer = it->second;
+		TeRepresPointerVector::iterator itRep = layer->vectRepres().begin();
+		while(itRep!=layer->vectRepres().end())
+		{
+			if(TeConvertToUpperCase((*itRep)->tableName_)==TeConvertToUpperCase(geomTable))
+				return layer->projection();
+			++itRep;
+		}
+		++it;
+	}
+	return 0; 
+}
+
+
+// Return if exist or not a totpological relation between two geometries
+// Use the TerraLib topological functions
+bool TeTopologicalRelation(const TePolygon* geom1, const TePolygon* geom2, int relation)
+{
+	bool result = false;
+	switch (relation)  
+	{		
+		case TeDISJOINT:
+			result = TeDisjoint(*geom1, *geom2);
+		break;
+
+		case TeINTERSECTS:
+			result = TeIntersects(*geom1, *geom2);
+		break;
+		
+		case TeTOUCHES:
+			result = TeTouches(*geom1, *geom2);
+		break;
+
+		case TeOVERLAPS:
+			result = TeOverlaps(*geom1, *geom2);
+		break;
+
+		case TeCOVERS:
+			result = TeCovers(*geom1, *geom2);
+		break;
+
+		case TeCOVEREDBY:
+			result = TeCoveredBy(*geom1, *geom2);
+		break;
+		
+		case TeCONTAINS:
+			result = TeContains(*geom1, *geom2);
+		break;
+		
+		case TeWITHIN:
+			result = TeWithin(*geom1, *geom2);
+		break;
+		
+		case TeEQUALS:
+			result = TeEquals(*geom1, *geom2);
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY) :
+			result = TeWithinOrCoveredByOrEquals(*geom1, *geom2);
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
+			result = ( (TeOverlaps(*geom1, *geom2)) || (TeWithinOrCoveredByOrEquals(*geom1, *geom2)));
+		break;
+	}
+	return result;
+}
+
+
+bool TeTopologicalRelation(const TePolygon* geom1, const TeLine2D* geom2, int relation)
+{
+	bool result = false;
+	switch (relation)
+	{		
+		case TeDISJOINT:
+			result = TeDisjoint(*geom2, *geom1); 
+		break;
+
+		case TeINTERSECTS:
+			result = TeIntersects(*geom2, *geom1); 
+		break;
+		
+		case TeTOUCHES:
+			result = TeTouches(*geom2, *geom1);  
+		break;
+
+		case TeCOVERS:
+			result = TeCovers(*geom1, *geom2);  
+		break;
+
+		case TeCOVEREDBY:
+			result = TeCoveredBy(*geom2, *geom1);  
+		break;
+		
+		case TeCONTAINS:
+			result = TeContains(*geom1, *geom2); 
+		break;
+		
+		case TeWITHIN:
+			result = TeWithin(*geom2, *geom1); 
+		break;
+		
+		case TeCROSSES:
+			result = TeCrosses(*geom2, *geom1); 
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY):
+			result = TeWithinOrCoveredByOrEquals(*geom2, *geom1);
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
+			result = ( (TeCrosses(*geom2, *geom1)) || (TeWithinOrCoveredByOrEquals(*geom2, *geom1)));
+		break;
+	}
+	return result;
+}
+
+
+bool TeTopologicalRelation(const TePolygon* geom1, const TePoint* geom2, int relation)
+{
+	bool result = false;
+	switch (relation)
+	{		
+		case TeDISJOINT:
+			result = TeDisjoint(*geom2, *geom1); 
+		break;
+
+		case TeINTERSECTS:
+			result = TeIntersects(*geom2, *geom1); 
+		break;
+		
+		case TeTOUCHES:
+			result = TeTouches(*geom2, *geom1);  
+		break;
+
+		case TeCONTAINS:
+			result = TeContains(*geom1, *geom2); 
+		break;
+		
+		case TeWITHIN:
+			result = TeWithin(*geom2, *geom1); 
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY):
+		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
+			result = TeWithinOrCoveredByOrEquals((*geom2).location(), *geom1);
+		break;
+	}
+	return result;
+}
+
+bool TeTopologicalRelation(const TeLine2D* geom1, const TeLine2D* geom2, int relation)
+{
+	bool result = false;
+	switch (relation)  
+	{		
+		case TeDISJOINT:
+			result = TeDisjoint(*geom1, *geom2); 
+		break;
+
+		case TeINTERSECTS:
+			result = TeIntersects(*geom1, *geom2); 
+		break;
+		
+		case TeTOUCHES:
+			result = TeTouches(*geom1, *geom2); 
+		break;
+
+		case TeOVERLAPS:
+			result = TeOverlaps(*geom1, *geom2); 
+		break;
+
+		case TeCOVERS:
+			result = TeCovers(*geom1, *geom2); 
+		break;
+
+		case TeCOVEREDBY:
+			result = TeCoveredBy(*geom1, *geom2); 
+		break;
+		
+		case TeCONTAINS:
+			result = TeContains(*geom1, *geom2); 
+		break;
+		
+		case TeWITHIN:
+			result = TeWithin(*geom1, *geom2); 
+		break;
+		
+		case TeEQUALS:
+			result = TeEquals(*geom1, *geom2); 
+		break;
+
+		case TeCROSSES:
+			result = TeCrosses(*geom1, *geom2); 
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
+			result = ( (TeCrosses(*geom1, *geom2)) || (TeWithinOrCoveredByOrEquals(*geom1, *geom2)));
+		break;
+	}
+	return result;
+}
+
+bool TeTopologicalRelation(const TeLine2D* geom1, const TePoint* geom2, int relation)
+{
+	bool result = false;
+	switch (relation)  
+	{		
+		case TeDISJOINT:
+			result = TeDisjoint(*geom2, *geom1); 
+		break;
+
+		case TeINTERSECTS:
+			result = TeIntersects(*geom2, *geom1); 
+		break;
+		
+		case TeTOUCHES:
+			result = TeTouches(*geom2, *geom1); 
+		break;
+
+		case TeCONTAINS:
+			result = TeContains(*geom1, *geom2); 
+		break;
+		
+		case TeWITHIN:
+			result = TeWithin(*geom2, *geom1); 
+		break;
+		
+		case (TeWITHIN | TeCOVEREDBY):
+		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
+			result = TeWithinOrCoveredByOrEquals((*geom2).location(), *geom1);
+		break;
+	}
+	return result;
+}
+
+bool TeTopologicalRelation(const TePoint* geom1, const TePoint* geom2, int relation)
+{
+	bool result = false;
+	switch (relation)  
+	{		
+		case TeDISJOINT:
+			result = TeDisjoint(*geom1, *geom2); 
+		break;
+
+		case TeINTERSECTS:
+			result = TeIntersects(*geom1, *geom2); 
+		break;
+		
+		case TeCONTAINS:
+			result = TeContains(*geom1, *geom2); 
+		break;
+		
+		case TeWITHIN:
+			result = TeWithin(*geom1, *geom2); 
+		break;
+		
+		case TeEQUALS:
+		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
+			result = TeEquals(*geom1, *geom2); 
+		break;
+	}
+	return result;
+}
+
+bool TeTopologicalRelation(const TeCell* geom1, const TeCell* geom2, int relation)
+{
+	bool result = false;
+	switch (relation)  
+	{		
+		case TeDISJOINT:
+			result = TeDisjoint(*geom1, *geom2);
+		break;
+
+		case TeINTERSECTS:
+			result = TeIntersects(*geom1, *geom2);
+		break;
+		
+		case TeTOUCHES:
+			result = TeTouches(*geom1, *geom2);
+		break;
+
+		case TeOVERLAPS:
+			result = TeOverlaps(*geom1, *geom2);
+		break;
+
+		case TeCOVERS:
+			result = TeCovers(*geom1, *geom2);
+		break;
+
+		case TeCOVEREDBY:
+			result = TeCoveredBy(*geom1, *geom2);
+		break;
+		
+		case TeCONTAINS:
+			result = TeContains(*geom1, *geom2);
+		break;
+		
+		case TeWITHIN:
+			result = TeWithin(*geom1, *geom2);
+		break;
+		
+		case TeEQUALS:
+			result = TeEquals(*geom1, *geom2);
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY):
+			result = TeWithinOrCoveredByOrEquals((*geom1).box(), (*geom2).box());
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
+			result = ( (TeOverlaps(*geom1, *geom2)) || (TeWithinOrCoveredByOrEquals((*geom1).box(), (*geom2).box())));
+		break;
+	}
+	return result;
+}
+
+bool TeTopologicalRelation(const TeCell* geom1, const TePolygon* geom2, int relation)
+{
+	bool result = false;
+	switch (relation)  
+	{		
+		case TeDISJOINT:
+			result = TeDisjoint(*geom1, *geom2);
+		break;
+
+		case TeINTERSECTS:
+			result = TeIntersects(*geom1, *geom2);
+		break;
+		
+		case TeTOUCHES:
+			result = TeTouches(*geom1, *geom2);
+		break;
+
+		case TeOVERLAPS:
+			result = TeOverlaps(*geom1, *geom2);
+		break;
+
+		case TeCOVERS:
+			result = TeCovers(*geom1, *geom2);
+		break;
+
+		case TeCOVEREDBY:
+			result = TeCoveredBy(TeMakePolygon((*geom1).box()), *geom2);
+		break;
+		
+		case TeCONTAINS:
+			result = TeWithin(*geom2, TeMakePolygon((*geom1).box()));
+		break;
+		
+		case TeWITHIN:
+			result = TeWithin(*geom1, *geom2);
+		break;
+		
+		case TeEQUALS:
+			result = TeEquals(*geom1, *geom2);
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY):
+			result = TeWithinOrCoveredByOrEquals(TeMakePolygon((*geom1).box()), *geom2);
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
+			result = ( (TeOverlaps(*geom1, *geom2)) || (TeWithinOrCoveredByOrEquals(TeMakePolygon((*geom1).box()) , *geom2)));
+		break;
+	}
+	return result;
+}
+
+bool TeTopologicalRelation(const TeCell* geom1, const TeLine2D* geom2, int relation)
+{
+	bool result = false;
+	switch (relation)
+	{		
+		case TeDISJOINT:
+			result = TeDisjoint(*geom1, *geom2); 
+		break;
+
+		case TeINTERSECTS:
+			result = TeIntersects(*geom1, *geom2); 
+		break;
+		
+		case TeTOUCHES:
+			result = TeTouches(*geom2, *geom1);  
+		break;
+
+		case TeCOVERS:
+			result = TeCovers(*geom1, *geom2);  
+		break;
+
+		case TeCOVEREDBY:
+			result = TeCoveredBy(*geom2, *geom1);  
+		break;
+		
+		case TeCONTAINS:
+			result = TeContains(*geom1, *geom2); 
+		break;
+		
+		case TeWITHIN:
+			result = TeWithin(*geom2, *geom1); 
+		break;
+		
+		case TeCROSSES:
+			result = TeCrosses(*geom2, *geom1); 
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY):
+			result = TeWithinOrCoveredByOrEquals(*geom2, TeMakePolygon((*geom1).box()));
+		break;
+
+		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
+			result = ( (TeCrosses(*geom2, *geom1)) || (TeWithinOrCoveredByOrEquals(*geom2, TeMakePolygon((*geom1).box()))));
+		break;
+	}
+	return result;
+
+}
+
+bool TeTopologicalRelation(const TeCell* geom1, const TePoint* geom2, int relation)
+{
+	bool result = false;
+	switch (relation)
+	{		
+		case TeDISJOINT:
+			result = TeDisjoint(*geom1, *geom2); 
+		break;
+
+		case TeINTERSECTS:
+			result = TeIntersects(*geom1, *geom2); 
+		break;
+		
+		case TeTOUCHES:
+			result = TeTouches(*geom2, *geom1);  
+		break;
+
+		case TeCONTAINS:
+			result = TeContains(*geom1, *geom2); 
+		break;
+		
+		case TeWITHIN:
+			result = TeWithin(*geom2, *geom1); 
+		break;
+
+		case (TeWITHIN & TeCOVEREDBY):
+		case (TeWITHIN | TeCOVEREDBY | TeOVERLAPS | TeCROSSES):
+			result = TeWithinOrCoveredByOrEquals((*geom2).location(), TeMakePolygon((*geom1).box()));
+		break;
+	}
+	return result;
+
+}
+
+
+// Return a string with the identifications of the selected geometries 
+string 
+getStringIds(TeKeys& IdsIn)
+{
+	string Ids = "";
+	int cont = 0;
+	
+	TeKeys::iterator itIdIn = IdsIn.begin();
+	while (itIdIn != IdsIn.end())
+	{
+		if(cont)
+			Ids += ","; 
+		Ids += "'" + (*itIdIn) + "'";
+		itIdIn++;
+		cont++;
+	}
+
+	return Ids;
+}
+
+// fill the geometries vector from a portal
+string
+mountSelect(string geomTable, string colTable, TeGeomRep rep, TeBox& box, int relate, TeDatabasePortal *portal)
+{
+	
+	string sql = "SELECT * FROM "+ geomTable;
+	
+	if(!colTable.empty())
+		sql +=", "+ colTable +" WHERE c_object_id = object_id ";
+		
+	//If not disjoint
+	if(box.isValid() && (relate!=TeDISJOINT))
+	{
+		if(!colTable.empty())
+			sql += " AND ";
+		else
+			sql += " WHERE ";
+
+		sql += portal->getDatabase()->getSQLBoxWhere (box, rep, geomTable);
+	}
+	return sql;
+}
+
+//fill the result vector of the geometries identificators  
+bool
+fillSelectedGeomVector(TeGeomRep actRep, TeSelectedGeom& vetGeom, TeDatabasePortal *portal, TeProjection* projAct=0, TeProjection* projVis=0)
+{
+	bool flag = true;
+	bool remap = false;
+
+	if((projAct!=0) && (projVis!=0) && (projAct!=projVis))
+		remap = true;
+	
+	try
+	{
+		do
+		{
+			if(actRep == TePOLYGONS)
+			{
+				TePolygon   poly, *pol;
+				flag = portal->fetchGeometry(poly); 
+				pol = new TePolygon;
+				if(remap)
+				{
+					TePolygon pout;
+					TeVectorRemap (poly, projAct, pout, projVis);
+					*pol = pout;
+				}
+				else
+					*pol = poly;
+				vetGeom.push_back(pol);
+			}
+			else if(actRep == TeLINES)
+			{
+				TeLine2D	line, *lin;
+				flag = portal->fetchGeometry(line); 
+				lin = new TeLine2D();
+				if(remap)
+				{
+					TeLine2D gout;
+					TeVectorRemap (line, projAct, gout, projVis);
+					*lin = gout;
+				}
+				else
+					*lin = line;
+				vetGeom.push_back(lin);
+			}
+			else if(actRep == TePOINTS)
+			{
+				TePoint		point, *pnt;
+				flag = portal->fetchGeometry(point); 
+				pnt = new TePoint();
+				if(remap)
+				{
+					TePoint gout;
+					TeVectorRemap (point, projAct, gout, projVis);
+					*pnt = gout;
+				}
+				else
+					*pnt = point;
+				vetGeom.push_back(pnt);
+			}
+			else if(actRep == TeCELLS)
+			{
+				TeCell		cell, *cll;
+				flag = portal->fetchGeometry(cell); 
+				cll = new TeCell();
+				if(remap)
+				{
+					TeCell gout;
+					TeVectorRemap (cell, projAct, gout, projVis);
+					*cll = gout;
+				}
+				else
+					*cll = cell;
+				vetGeom.push_back(cll);
+			}
+		} while (flag);
+	}
+	catch(...)
+	{
+		TeSelectedGeom::iterator it;
+		for(it = vetGeom.begin(); it != vetGeom.end(); it++)
+			delete (*it);
+		return false;
+	}
+
+	return true;
+}
+
+//geom: selected geometries
+//obj: portal geometries
+//basic idea: obj "relate" geom
+bool
+fillResultIdsVector(TeGeometry *geom, TeDatabasePortal *portal, TeGeomRep portalRep, int relate, TeKeys& resultIds)
+{
+	bool flag = false;
+	bool result = false;
+	TeGeomRep geomRep = geom->elemType();
+	bool isSet = false;
+	int setSize = 1;
+
+	if ( (dynamic_cast<TePolygonSet*> (geom)) ||
+		 (dynamic_cast<TeLineSet*> (geom)) ||
+		 (dynamic_cast<TePointSet*> (geom)) ||
+		 (dynamic_cast<TeCellSet*> (geom)) )
+	{
+		isSet = true;
+		setSize = geom->size();
+	}
+
+	try
+	{
+		do
+		{
+			TeGeometry* obj = 0;
+			if(portalRep == TePOLYGONS)
+			{
+				TePolygon   poly, *pol;
+				flag = portal->fetchGeometry (poly);
+				pol = new TePolygon();
+				*pol = poly;
+				obj = pol;
+			}
+			else if(portalRep == TeLINES)
+			{
+				TeLine2D	line, *lin;
+				flag = portal->fetchGeometry (line);
+				lin = new TeLine2D();
+				*lin = line;
+				obj = lin;
+			}
+			else if(portalRep == TePOINTS)
+			{
+				TePoint		point, *pnt;
+				flag = portal->fetchGeometry (point);
+				pnt = new TePoint();
+				*pnt = point;
+				obj = pnt;
+			}
+			else if(portalRep == TeCELLS)
+			{
+				TeCell		cell, *cll;
+				flag = portal->fetchGeometry (cell);
+				cll = new TeCell();
+				*cll = cell;
+				obj = cll;
+			}
+
+			result = false;
+
+			//for each geometry 	
+			for(int i=0; i<setSize; ++i)
+			{
+				TeGeometry* geomTemp = 0;
+				if(isSet)
+				{
+					if(geomRep==TePOLYGONS)
+						geomTemp = &(((TePolygonSet*)geom)->operator[](i));
+					else if (geomRep==TeLINES)
+						geomTemp = &(((TeLineSet*)geom)->operator[](i));
+					else if (geomRep==TePOINTS)
+						geomTemp = &(((TePointSet*)geom)->operator[](i));
+					else if (geomRep==TeCELLS)
+						geomTemp = &(((TeCellSet*)geom)->operator[](i));
+				}
+				else
+					geomTemp = geom;
+				
+				switch (geomRep | portalRep)   //geom: selected and obj: portal
+				{
+						
+					case 1: //polygon with polygon
+						result = TeTopologicalRelation((TePolygon*)obj, (TePolygon*)geomTemp, relate);
+					break;
+
+					case 2://line with line 
+						result = TeTopologicalRelation((TeLine2D*)obj, (TeLine2D*)geomTemp, relate);
+					break;
+			
+					case 3://polygon with line
+						if(geomRep == TePOLYGONS)
+							result = TeTopologicalRelation((TePolygon*)geomTemp, (TeLine2D*)obj, relate);
+						else
+							result = TeTopologicalRelation((TePolygon*)obj, (TeLine2D*)geomTemp, relate);
+					break;
+				
+					case 4://point with point
+						result = TeTopologicalRelation((TePoint*)obj, (TePoint*)geomTemp, relate);
+					break;
+				
+					case 5://polygon with point
+						if(geomRep == TePOLYGONS)
+							result = TeTopologicalRelation((TePolygon*)geomTemp, (TePoint*)obj, relate);
+						else
+							result = TeTopologicalRelation((TePolygon*)obj, (TePoint*)geomTemp, relate);
+					break;
+
+					case 6://line with point 
+						if(geomRep == TeLINES)
+							result = TeTopologicalRelation((TeLine2D*)geomTemp, (TePoint*)obj, relate);
+						else
+							result = TeTopologicalRelation((TeLine2D*)obj, (TePoint*)geomTemp, relate);
+					break;
+					
+					case 256://cell with cell 
+						result = TeTopologicalRelation((TeCell*)obj, (TeCell*)geomTemp, relate);
+					break;
+
+					case 257://cell with polygon 
+						if(geomRep == TePOLYGONS)
+							result = TeTopologicalRelation((TeCell*)obj, (TePolygon*)geomTemp, relate);
+						else
+							result = TeTopologicalRelation((TeCell*)geomTemp, (TePolygon*)obj, relate);
+					break;
+					
+					case 258://cell with line 
+						if(geomRep == TeLINES)
+							result = TeTopologicalRelation((TeCell*)obj,  (TeLine2D*)geomTemp, relate);
+						else
+							result = TeTopologicalRelation((TeCell*)geomTemp, (TeLine2D*)obj, relate);
+					break;
+
+					case 260://cell with point
+						if(geomRep == TeCELLS)
+							result = TeTopologicalRelation((TeCell*)geomTemp, (TePoint*)obj, relate);
+						else
+							result = TeTopologicalRelation((TeCell*)obj,  (TePoint*)geomTemp, relate);
+					break;
+				}
+						
+				if(result)
+				{
+					string objId = obj->objectId();
+					resultIds.push_back(objId);
+				}
+			}//for
+
+			delete obj;
+		} while (flag); //fetchrow
+	}
+	catch(...)
+	{
+		return false;
+	}
+	return true;
+}
+
+
+bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+						   TeDatabasePortal *portal, int relation, const string& actColTable)
+{
+	TeKeys  resultIds;
+
+	if(!TeTopologicalRelation(actGeomTable, actRep, actIdsIn, resultIds, portal->getDatabase(), relation, actColTable))
+		return false;
+
+	string Ids = getStringIds(resultIds);
+	
+	string sql = "SELECT * FROM " + actGeomTable;
+	sql += " WHERE object_id IN (" + Ids + ")";
+	sql += " ORDER BY object_id ASC ";
+	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
+		sql += ", parent_id ASC, num_holes DESC ";
+	
+	portal->freeResult();
+
+	if(!portal->query(sql) || !portal->fetchRow())
+		return false;
+	
+	return true;
+}
+
+bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+						   const string& visGeomTable,  TeGeomRep visRep, TeDatabasePortal *portal, 
+						   int relation, const string& visColTable)
+{
+	TeKeys  resultIds;
+
+	if(!TeTopologicalRelation(actGeomTable, actRep, actIdsIn, visGeomTable, visRep, resultIds, portal->getDatabase(), relation, visColTable))
+		return false;
+	
+	string Ids = getStringIds(resultIds);
+
+	portal->freeResult ();
+
+	string sql = "SELECT * FROM " + visGeomTable;
+	sql += " WHERE object_id IN (" + Ids + ")";
+	sql += " ORDER BY object_id ASC ";
+	if(visRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
+		sql += ", parent_id ASC, num_holes DESC ";
+
+	if(!portal->query(sql) || !portal->fetchRow())
+		return false;
+		
+	return true;
+}
+
+bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
+						   TeDatabasePortal *portal, int relation, const string& actCollTable)
+{
+	
+	TeKeys	resultIds;
+	
+	if(!TeTopologicalRelation(actGeomTable, actRep, geom, resultIds, portal->getDatabase(), relation, actCollTable))
+		return false;
+	
+	string Ids = getStringIds(resultIds);
+
+	portal->freeResult();
+
+	string sql = "SELECT * FROM " + actGeomTable;
+	sql += " WHERE object_id IN (" + Ids + ")";
+	sql += " ORDER BY object_id ASC ";
+	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
+		sql += ", parent_id ASC, num_holes DESC ";
+
+	if(!portal->query(sql) || !portal->fetchRow())
+		return false;
+	
+	return true;
+}
+	
+bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+						   TeKeys& actIdsOut, TeDatabase* db, int relation, const string& actCollTable)
+{
+	TeSelectedGeom	vetGeom;
+			
+	string Ids = getStringIds(actIdsIn);
+
+	TeDatabasePortal* portal = db->getPortal();
+
+	string sql = "SELECT * FROM " + actGeomTable;
+	sql += " WHERE object_id IN (" + Ids + ")";
+	
+	//order by clause
+	string sqlOrderBy = " ORDER BY object_id ASC ";
+	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
+		sqlOrderBy += ", parent_id ASC, num_holes DESC ";
+
+	sql += sqlOrderBy;
+	actIdsOut.clear();
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	if(!fillSelectedGeomVector(actRep,vetGeom,portal))
+	{
+		delete portal;
+		return false; 
+	}
+
+	//iterators
+	TeSelectedGeom::iterator it;
+	double prec = TePrecision::instance().precision();
+	
+	for (it = vetGeom.begin(); it != vetGeom.end(); it++)
+	{
+		portal->freeResult();
+		TeBox box = (**it).box();
+
+		TeBox temp (box.x1()-prec, box.y1()-prec, box.x2()+prec, box.y2()+prec); 
+		
+		sql = mountSelect(actGeomTable, actCollTable, actRep, temp, relation, portal);
+		if(relation != TeEQUALS)
+			sql += " AND object_id NOT IN (" + Ids + ")";
+		sql += sqlOrderBy;
+
+		if(!portal->query(sql)) 
+		{
+			delete portal;
+			return false;
+		}
+
+		if(!portal->fetchRow())
+			continue;
+
+		fillResultIdsVector((*it), portal, actRep, relation, actIdsOut);
+	
+	} 
+		
+	sort(actIdsOut.begin(), actIdsOut.end());
+	TeKeys::iterator itUnique = std::unique( actIdsOut.begin(), actIdsOut.end() );
+	if(itUnique!=actIdsOut.end())	actIdsOut.erase(itUnique,actIdsOut.end());
+
+	delete portal;
+	
+	for (it = vetGeom.begin(); it != vetGeom.end(); it++)
+		delete (*it);
+
+	return !actIdsOut.empty();
+}
+
+bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+						   const string& visGeomTable, TeGeomRep visRep, TeKeys& visIdsOut, 
+						   TeDatabase* db, int relation, const string& visCollTable, TeDatabase* dbVis)
+{
+	TeSelectedGeom	vetGeom;
+			
+	string Ids = getStringIds(actIdsIn);
+	if(dbVis == 0)
+		dbVis = db;
+
+	//verify projection
+	TeProjection* projAct = getProjectionFromGeomTable(actGeomTable, db);
+	TeProjection* projVis = getProjectionFromGeomTable(visGeomTable, dbVis);
+	visIdsOut.clear();
+	TeDatabasePortal* portal = db->getPortal();
+
+	string sql = "SELECT * FROM " + actGeomTable;
+	sql += " WHERE object_id IN (" + Ids + ")";
+	sql += " ORDER BY object_id ASC ";
+	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
+		sql += ", parent_id ASC, num_holes DESC ";
+	
+	if(!portal->query(sql)|| !portal->fetchRow ())
+	{
+		delete portal;
+		return false;
+	}
+	
+	if(!fillSelectedGeomVector(actRep,vetGeom,portal,projAct, projVis))
+	{
+		delete portal;
+		return false; 
+	}
+
+	if(db != dbVis)
+	{
+		delete portal;
+		portal = dbVis->getPortal();
+	}
+
+	//iterators
+	TeSelectedGeom::iterator it;
+	
+	double prec = TePrecision::instance().precision();
+
+	for (it = vetGeom.begin(); it != vetGeom.end(); it++)
+	{
+		portal->freeResult();
+		TeBox box = (**it).box();
+		
+		TeBox temp (box.x1()-prec, box.y1()-prec, box.x2()+prec, box.y2()+prec); 
+		
+		sql = mountSelect(visGeomTable, visCollTable, visRep, temp, relation, portal);
+		sql += " ORDER BY object_id ASC ";
+		if(visRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
+			sql += ", parent_id ASC, num_holes DESC ";
+
+		if(!portal->query(sql)) 
+		{
+			delete portal;
+			return false;
+		}
+
+		if(!portal->fetchRow())
+			continue;
+	
+		fillResultIdsVector((*it), portal, visRep, relation, visIdsOut);
+
+	}
+						
+	delete portal;
+	
+	sort(visIdsOut.begin(), visIdsOut.end());
+	TeKeys::iterator itUnique = std::unique( visIdsOut.begin(), visIdsOut.end() );
+	if(itUnique!=visIdsOut.end())	visIdsOut.erase(itUnique,visIdsOut.end());
+
+	for (it = vetGeom.begin(); it != vetGeom.end(); it++)
+		delete (*it);
+
+	return !visIdsOut.empty();
+}
+
+bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
+						   TeKeys& actIdsOut, TeDatabase* db, int relation, const string& actCollTable)
+{
+	TeDatabasePortal* portal = db->getPortal();
+	TeBox box = geom->box();
+
+	actIdsOut.clear();
+	double prec = TePrecision::instance().precision();
+	TeBox temp (box.x1()-prec, box.y1()-prec, box.x2()+prec, box.y2()+prec); 
+
+	string sql = mountSelect(actGeomTable, actCollTable, actRep, temp, relation, portal);
+	sql += " ORDER BY object_id ASC ";
+	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
+		sql += ", parent_id ASC, num_holes DESC ";
+
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	
+	
+	fillResultIdsVector(geom, portal, actRep, relation, actIdsOut);
+
+	delete portal;
+	
+	sort(actIdsOut.begin(), actIdsOut.end());
+	TeKeys::iterator it = std::unique( actIdsOut.begin(), actIdsOut.end() );
+	if(it!=actIdsOut.end())	actIdsOut.erase(it,actIdsOut.end());
+	return !actIdsOut.empty();
+}
+
+bool TeGetWithinDistance(const string& actGeomTable, TeGeomRep actRep, const TeCoord2D& point, TeKeysToDist& IdsDistOut,
+						 TeDatabase* db, const double& max_dist, const string& actCollTable)
+{
+	if(!db)
+		return false;
+	
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+
+	TeBox box (point.x()-max_dist, point.y()-max_dist,point.x()+max_dist, point.y()+max_dist); 
+
+	string sql = mountSelect(actGeomTable, actCollTable, actRep, box, TeWITHIN, portal);
+	sql += " ORDER BY object_id ASC ";
+	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
+		sql += ", parent_id ASC, num_holes DESC ";
+
+	if(!portal->query(sql)) 
+	{
+		delete portal;
+		return false;
+	}
+
+	if(!portal->fetchRow())
+	{
+		delete portal;
+		return true;
+	}
+
+	bool flag = true;
+	do
+	{
+		TeCoord2D centroid2;
+		string objId;
+		if(actRep == TePOLYGONS)
+		{
+			TePolygon   poly;
+			flag = portal->fetchGeometry (poly);
+			objId = poly.objectId ();
+			centroid2 = TeFindCentroid(poly);
+		}
+		else if(actRep == TeLINES)
+		{
+			TeLine2D	line;
+			flag = portal->fetchGeometry (line);
+			objId = line.objectId ();
+			centroid2 = TeFindCentroid(line);
+		}
+		else if(actRep == TePOINTS)
+		{
+			TePoint		point;
+			flag = portal->fetchGeometry (point);
+			objId = point.objectId ();
+			centroid2 = TeFindCentroid(point);
+		}
+		else if(actRep == TeCELLS)
+		{
+			TeCell		cell;
+			flag = portal->fetchGeometry (cell);
+			objId = cell.objectId ();
+			centroid2 = TeFindCentroid(cell);
+		}
+		
+		double dist = TeDistance(point, centroid2);
+		if(dist<=max_dist)
+			IdsDistOut[objId] = dist;
+
+	} while (flag); //fetchrow
+	
+	//sort(IdsDistOut.begin(), IdsDistOut.end());
+
+	delete portal;
+	return true;
+}
+
+bool TeGetArea(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabase* db, double& area)
+{
+	if(actRep != TePOLYGONS && actRep != TeCELLS )
+		return false;
+
+	string Ids = getStringIds(actIdsIn);
+	
+	TeDatabasePortal* portal = db->getPortal();
+
+	string sql = "SELECT * FROM " + actGeomTable;
+	sql += " WHERE object_id IN (" + Ids + ")";
+	sql += " ORDER BY object_id ASC ";
+
+	if((actRep == TePOLYGONS) && (portal->getDatabase()->dbmsName() != "PostGIS"))
+		sql += ", parent_id ASC, num_holes DESC ";
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = false;
+	double sumArea = 0.;
+	do
+	{
+		if(actRep == TePOLYGONS)
+		{
+			TePolygon poly;
+			flag = portal->fetchGeometry(poly);
+			sumArea+= TeGeometryArea(poly);
+		}
+		else if(actRep == TeCELLS)
+		{
+			TeCell cell;
+			flag = portal->fetchGeometry(cell);
+			sumArea+= TeGeometryArea(cell.box());
+		}
+	}while (flag);
+	
+	area = sumArea;
+	delete portal;
+	return true;
+}
+
+
+bool TeGetLength(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabase* db, double& length)
+{
+	if((actRep != TePOLYGONS) && (actRep != TeLINES) && (actRep != TeCELLS) )
+		return false;
+
+	string Ids = getStringIds(actIdsIn);
+	
+	TeDatabasePortal* portal = db->getPortal();
+
+	string sql = "SELECT * FROM " + actGeomTable;
+	sql += " WHERE object_id IN (" + Ids + ")";
+	sql += " ORDER BY object_id ASC ";
+
+	if((actRep == TePOLYGONS) && (portal->getDatabase()->dbmsName() != "PostGIS"))
+		sql += ", parent_id ASC, num_holes DESC ";
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = false;
+	double sumLen = 0.;
+	do
+	{
+		if(actRep == TePOLYGONS)
+		{
+			TePolygon p;
+			flag = portal->fetchGeometry(p);
+			
+			for(unsigned int i=0; i<p.size(); i++)
+				sumLen += TeLength(p[i]);
+		}
+		else if (actRep == TeLINES)
+		{
+			TeLine2D l;
+			flag = portal->fetchGeometry(l);
+			sumLen += TeLength(l);
+		}
+		else if (actRep == TeCELLS)
+		{
+			TeCell c;
+			flag = portal->fetchGeometry(c);
+
+			TePolygon p = TeMakePolygon(c.box());
+			sumLen += TeLength(p[0]);
+		}
+		
+	}while (flag);
+	
+	length = sumLen;
+	delete portal;
+	return true;
+}
+
+
+bool TeGetDistance(const string& actGeomTable, TeGeomRep actRep, TeKeys& IdsIn, TeDatabase* db, double& distance)
+{
+	string Ids = getStringIds(IdsIn);
+	
+	TeDatabasePortal* portal = db->getPortal();
+
+	string sql = "SELECT * FROM " + actGeomTable;
+	sql += " WHERE object_id IN (" + Ids + ")";
+	sql += " ORDER BY object_id ASC ";
+
+	if((actRep == TePOLYGONS) && (portal->getDatabase()->dbmsName() != "PostGIS"))
+		sql += ", parent_id ASC, num_holes DESC ";
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;  
+	}
+	
+	bool flag = false;
+	string lastObjId ="";
+	TeCoord2D coord1, coord2; 
+	int step = 0;
+	do
+	{
+		TeCoord2D coord;
+		string objId;
+		
+		if(actRep == TePOLYGONS)
+		{
+			TePolygon p;
+			flag = portal->fetchGeometry(p);
+			objId = p.objectId();
+			if(lastObjId==objId)
+				continue;
+			coord = TeFindCentroid(p);
+		}
+		else if (actRep == TeLINES)
+		{
+			TeLine2D l;
+			flag = portal->fetchGeometry(l);
+			objId = l.objectId ();
+			if(lastObjId==objId)
+				continue;
+			coord = TeFindCentroid(l);
+		}
+		else if (actRep == TePOINTS)
+		{
+			TePoint p;
+			flag = portal->fetchGeometry(p);
+			coord = p.location();
+		}
+		else if (actRep == TeCELLS)
+		{
+			TeCell c;
+			flag = portal->fetchGeometry(c);
+			objId = c.objectId ();
+			if(lastObjId==objId)
+				continue;
+			coord = TeFindCentroid(c);
+		}
+		
+		if(step==0)
+			coord1 = coord;
+		else
+			coord2 = coord;
+
+		lastObjId = objId;
+		++step;
+
+	}while (flag);
+	
+	distance = TeDistance(coord1, coord2);
+	delete portal;
+	return true;
+}
+
+bool TeGetConvexHull(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, TePolygonSet& convexHullSet)
+{
+	if(actRep != TePOLYGONS)
+		return false;
+
+	TeDatabasePortal* portal = db->getPortal();
+	string Ids = getStringIds(actIds);
+
+	string sql = "SELECT * FROM " + actGeomTable;
+	sql += " WHERE object_id IN ("+ Ids +")";
+	sql += " ORDER BY object_id ASC ";
+
+	if(portal->getDatabase()->dbmsName() != "PostGIS")
+		sql += ", parent_id ASC, num_holes DESC ";
+		
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+	do
+	{
+		TePolygon   poly, result;
+		flag = portal->fetchGeometry(poly);
+		TePolygon pol = TeConvexHull(poly);
+		result.add(pol[0]);
+		convexHullSet.add(result);
+	} while (flag);
+	
+	delete portal;
+	return true;
+}
+
+bool TeGetCentroid(const string& actGeomTable, TeGeomRep actRep, TeDatabase* db, TePointSet& centroidSet, TeKeys& actIds, const string& actCollTable)
+{
+	TeDatabasePortal* portal = db->getPortal();
+	string Ids = getStringIds(actIds);
+
+	string select = " SELECT * "; 
+	string from  =  " FROM " + actGeomTable;
+	string where =  " WHERE 1=1 ";
+
+	if(!actCollTable.empty())
+	{
+		select += ", "+ actCollTable;
+		where += " AND object_id = c_object_id ";
+	}
+
+	//if empty it calculates the centroids to all geometries 
+	if(!Ids.empty())
+		where += " AND object_id IN ("+ Ids +")";
+			
+	string orderBy = " ORDER BY object_id ASC ";
+	
+	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")
+		orderBy += ", parent_id ASC, num_holes DESC ";
+	
+	// ---- progress bar 
+	int numSteps = 0;
+	string sqlProg = " SELECT COUNT(*) "+ from + where; 
+	if(portal->query(sqlProg) && portal->fetchRow())
+		numSteps = portal->getInt(0);
+	
+	portal->freeResult();
+
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(numSteps);
+	//------
+	
+	string sql = select + from + where + orderBy;
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+	string lastObjId ="";
+	int step = 0;
+	do
+	{
+		TeCoord2D coord;
+		string objId;
+		
+		if(actRep == TePOLYGONS)
+		{
+			TePolygon p;
+			flag = portal->fetchGeometry(p);
+			objId = p.objectId();
+			if(lastObjId==objId)
+				continue;
+			coord = TeFindCentroid(p);
+		}
+		else if (actRep == TeLINES)
+		{
+			TeLine2D l;
+			flag = portal->fetchGeometry(l);
+			objId = l.objectId ();
+			if(lastObjId==objId)
+				continue;
+			coord = TeFindCentroid(l);
+		}
+		else if (actRep == TeCELLS)
+		{
+			TeCell c;
+			flag = portal->fetchGeometry(c);
+			objId = c.objectId ();
+			if(lastObjId==objId)
+				continue;
+			coord = TeFindCentroid(c);
+		}
+		
+		lastObjId = objId;
+		TePoint point(coord);
+		point.objectId (objId);
+		centroidSet.add(point);
+
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}	
+		++step;
+
+	} while (flag);
+	
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	delete portal;
+	return true;
+}
+
+
+bool TeGetBuffer(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, TePolygonSet& bufferSet, double dist)
+{
+	
+	if(actIds.empty())
+		return false;
+	
+	string Ids = getStringIds(actIds);
+
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+	
+	string sql = " SELECT * FROM " + actGeomTable;
+	sql += " WHERE object_id IN ("+ Ids +")";
+	sql += " ORDER BY object_id ASC ";
+	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
+		sql += ", parent_id ASC, num_holes DESC ";
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+	
+	bool flag = true;
+	bool res = true;
+	do
+	{
+		TePolygonSet polSet;
+
+		if(actRep == TePOINTS)
+		{
+			TePoint p;
+			TePolygon pol;
+			flag = portal->fetchGeometry(p);
+			res = TeBUFFERREGION::TeBufferRegion(p.location(), dist, 16, pol);
+			polSet.add (pol);
+		}
+
+		else if(actRep == TeLINES)
+		{
+			TeLine2D l;
+			flag = portal->fetchGeometry(l);
+			res = TeBUFFERREGION::TeBufferRegion(l, dist, 8, polSet);
+		}
+
+		else if(actRep == TePOLYGONS)
+		{
+			TePolygon p;
+			flag = portal->fetchGeometry(p);
+			res = TeBUFFERREGION::TeBufferRegion(p, dist, 8, polSet);
+		}	
+
+		else if(actRep == TeCELLS)
+		{
+			TeCell c;
+			flag = portal->fetchGeometry(c);
+			res = TeBUFFERREGION::TeBufferRegion(TeMakePolygon(c.box()), dist, 8, polSet);
+		}	
+		
+		if(res)
+		{
+			for(unsigned int i=0; i<polSet.size(); i++)
+				bufferSet.add(polSet[i]);
+		}
+	
+	} while (flag && res);
+
+	delete portal;
+	return true;
+}
+
+
+bool TeGetOverlay(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, TeGeometryVect& geomVect, const short& operation)
+{
+	if((actIds.empty()) || (actRep!=TePOLYGONS && actRep!=TeCELLS))
+		return false;
+	
+	string Ids = getStringIds(actIds);
+
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+
+	string sql = " SELECT * FROM " + actGeomTable;
+	sql += " WHERE object_id IN ("+ Ids +")";
+	sql += " ORDER BY object_id ASC ";
+	if(actRep == TePOLYGONS && portal->getDatabase()->dbmsName() != "PostGIS")	
+		sql += ", parent_id ASC, num_holes DESC ";
+	
+	if(!portal->query(sql) || !portal->fetchRow())
+	{
+		delete portal;
+		return false;
+	}
+		
+	bool flag = true;
+	TePolygonSet polSet1;
+	
+	if(actRep == TePOLYGONS)
+	{
+		TePolygon p;
+		flag = portal->fetchGeometry(p);
+		polSet1.add (p);
+	}
+	else if(actRep == TeCELLS)
+	{
+		TeCell c; 
+		flag = portal->fetchGeometry(c);
+		polSet1.add(TeMakePolygon(c.box()));
+	}
+
+	while (flag)
+	{
+		TePolygonSet polSet2, polInter;
+
+		if(actRep == TePOLYGONS)
+		{
+			TePolygon p;
+			flag = portal->fetchGeometry(p);
+			polSet2.add (p);
+		}	
+
+		else if(actRep == TeCELLS)
+		{
+			TeCell c;
+			flag = portal->fetchGeometry(c);
+			polSet2.add(TeMakePolygon(c.box()));
+		}
+		
+		if(operation==TeUNION)
+		{
+			if(!TeOVERLAY::TeUnion(polSet1, polSet2, polInter))
+				return false;
+		}
+		else if (operation==TeINTERSECTION)
+		{
+			if(!TeOVERLAY::TeIntersection(polSet1, polSet2, polInter))
+				return false;
+		}
+		else if (operation==TeDIFFERENCE)
+		{
+			if(!TeOVERLAY::TeDifference(polSet1, polSet2, polInter))
+				return false;
+		}
+
+		polSet1 = polInter;
+	}
+
+	TeGeometry* geom;
+	TePolygonSet* pol = new TePolygonSet();
+	*pol = polSet1;
+	geom = pol;
+	
+	geomVect.push_back (geom);
+	delete portal;
+	return true;
+}
+
+
+TeRaster*
+TeMask(TeRaster* whole, TePolygon& poly, TeStrategicIterator st)
+{
+	if (!whole || (whole->params().status_ != TeRasterParams::TeReadyToRead && 
+		whole->params().status_ != TeRasterParams::TeReadyToWrite))
+		return 0;
+
+	if (!TeIntersects(poly.box(),whole->params().boundingBox()))
+		return 0;
+	
+	TeRasterParams par = whole->params();
+	par.decoderIdentifier_ = "MEM";
+	par.mode_ = 'c';
+	par.setDummy(0);
+
+	TeCoord2D bll = whole->coord2Index(poly.box().lowerLeft());
+	TeCoord2D bur = whole->coord2Index(poly.box().upperRight());
+
+	bll = whole->index2Coord(TeCoord2D(TeRoundRasterIndex(bll.x_),TeRoundRasterIndex(bll.y_)));
+	bur = whole->index2Coord(TeCoord2D(TeRoundRasterIndex(bur.x_),TeRoundRasterIndex(bur.y_)));
+
+	par.boxResolution(bll.x_, bll.y_, bur.x_, bur.y_,par.resx_, par.resy_);
+	par.setDummy(0.0);
+	par.useDummy_ = true;
+
+	TeRaster*  clip = new TeRaster(par);
+	clip->init();
+	if (clip->params().status_ != TeRasterParams::TeReadyToWrite)
+		return 0;
+
+	TeCoord2D cd = TeCoord2D(0,0);
+	TeCoord2D ul = clip->params().index2Coord(cd);
+	TeCoord2D dxdy = whole->params().coord2Index(ul);
+	int j = TeRoundRasterIndex(dxdy.x_); // column delta
+	int i = TeRoundRasterIndex(dxdy.y_); // line delta
+
+	TeRaster::iteratorPoly it = whole->begin(poly, st);
+//	int nlines = it.nLinesInPoly();
+//	int ncols = it.nColsInPoly();
+	while(!it.end())
+    {
+		int lin = it.currentLine();
+		int col = it.currentColumn();
+		int nbands = it.nBands();
+		vector<double> vals;
+		vals = (*(TeRaster::iterator)it);
+		for (int b=0; b<nbands; b++)
+			clip->setElement(col-j,lin-i,vals[b],b);
+		++it;
+	}
+	return clip;
+}
+
+
+
+
+
diff --git a/src/terralib/kernel/TeSpatialOperations.h b/src/terralib/kernel/TeSpatialOperations.h
old mode 100755
new mode 100644
index 55b192d..20dedc0
--- a/src/terralib/kernel/TeSpatialOperations.h
+++ b/src/terralib/kernel/TeSpatialOperations.h
@@ -1,283 +1,283 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSpatialOperations.h
-    \brief This file contains functions to spatial operations with geographical objects that are in a SGBD 
-*/
-
-#ifndef  __TERRALIB_INTERNAL_SPATIALOPERATIONS_H
-#define  __TERRALIB_INTERNAL_SPATIALOPERATIONS_H
-
-#include "TeDatabase.h"
-#include "TeRaster.h"
-
-//! Keep the selected geometries in the canvas
-typedef vector<TeGeometry*> TeSelectedGeom;
-
-//! Return a string with the identifications of the selected geometries 
-TL_DLL string  getStringIds(TeKeys& IdsIn);
-
-
-//! Return a portal with the geometries of a spatial table that have a topological relation with specifics geometries of this spatial table
-/*!
-	Calculate the topological relation between all geometries of a spatial table and
-	specifics geometries of this spatial table
-	\param actGeomTable	spatial table name that contains all the geometries
-	\param actRep		geometrical representation of the spatial table 
-	\param actIdsIn		identifications of the specifics geometries (object_id)
-	\param portal		returned with the resultants geometries 
-	\param relation		topological relation that will be computed
-	\param actColTable	collection table name that contains a set of geometries of the spatial table 
-*/
-TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-						   TeDatabasePortal *portal, int relation, const string& actColTable="");
-
-
-//! Return a portal with the geometries of a spatial table that have a topological relation with specifics geometries of other spatial table 
-/*!
-	Calculate the topological relation between all geometries of a spatial table and
-	specifics geometries of other spatial table
-	\param actGeomTable	first spatial table name that contains the specifics geometries
-	\param actRep		geometrical representation of the first spatial table 
-	\param actIdsIn		identifications of specifics geometries of the first spatial table (object_id)
-	\param visGeomTable	second spatial table name that contains the others geometries
-	\param visRep		geometrical representation of the second spatial table 
-	\param portal		returned with the resultants geometries 
-	\param relation		topological relation that will be computed 
-	\param visColTable	collection table name that contains a set of geometries of the second spatial table 
-*/
-TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-						   const string& visGeomTable, TeGeomRep visRep, TeDatabasePortal *portal, 
-						   int relation, const string& visColTable="");
-
-
-//! Return a portal with the geometries of a spatial table that have a topological relation with a specific geometry  
-/*!
-	Calculate the topological relation between all geometries of a spatial table and a specific geometry 
-	\param actGeomTable	spatial table name that contains the geometries
-	\param actRep		geometrical representation of the spatial table 
-	\param geom			a specific geometry 
-	\param portal		returned with the resultants geometries 
-	\param relation		topological relation that will be computed 
-	\param actCollTable	collection table name that contains a set of geometries of the spatial table 
-*/
-TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
-						   TeDatabasePortal *portal, int relation, const string& actCollTable="");
-
-
-//! Return the identications of the geometries of a spatial table that have a topological relation with specifics geometries of this spatial table
-/*!
-	Calculate the topological relation between all geometries of a spatial table and
-	specifics geometries of this spatial table
-	\param actGeomTable	spatial table name that contains all the geometries
-	\param actRep		geometrical representation of the spatial table 
-	\param actIdsIn		identifications of the specifics geometries (object_id)
-	\param actIdsOut	returned with the identications of the resultants geometries (object_id)
-	\param db			a TeDatabase pointer 
-	\param relation		topological relation that will be computed 
-	\param actCollTable	collection table name that contains a set of geometries of the spatial table 
-*/
-TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-						   TeKeys& actIdsOut, TeDatabase* db, int relation, const string& actCollTable="");
-
-
-//! Return the identications of the geometries of a spatial table that have a topological relation with specifics geometries of other spatial table 
-/*!
-	Calculate the topological relation between all geometries of a spatial table and
-	specifics geometries of other spatial table
-	\param actGeomTable	first spatial table name that contains the specifics geometries
-	\param actRep		geometrical representation of the first spatial table 
-	\param actIdsIn		identifications of specifics geometries of the first spatial table (object_id)
-	\param visGeomTable	second spatial table name that contains the others geometries
-	\param visRep		geometrical representation of the second spatial table 
-	\param visIdsOut	returned with the identications of the resultants geometries (object_id)
-	\param db			a TeDatabase pointer 
-	\param relation		topological relation that will be computed 
-	\param visCollTable	collection table name that contains a set of geometries of the second spatial table 
-*/
-TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
-						   const string& visGeomTable, TeGeomRep visRep, TeKeys& visIdsOut, 
-						   TeDatabase* db, int relation, const string& visCollTable="", TeDatabase* = 0);
-
-//! Return the identications of the geometries of a spatial table that have a topological relation with a specific geometry  
-/*!
-	Calculate the topological relation between all geometries of a spatial table and a specific geometry 
-	\param actGeomTable	spatial table name that contains the geometries
-	\param actRep		geometrical representation of the spatial table 
-	\param geom			a specific geometry 
-	\param actIdsOut	returned with the identications of the resultants geometries (object_id)
-	\param db			a TeDatabase pointer 
-	\param relation		topological relation that will be computed 
-	\param actCollTable	collection table name that contains a set of geometries of the spatial table 
-*/
-TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
-						   TeKeys& actIdsOut, TeDatabase* db, int relation, const string& actCollTable="");
-
-//! Return whether the specified topological relation holds between two polygon
-/*!
-	\param geom1	a polygon
-	\param geom2	another polygon
-	\param relation		topological relation to be verified
-*/
-TL_DLL bool TeTopologicalRelation(const TePolygon* geom1, const TePolygon* geom2, int relation);
-
-//! Return whether the specified topological relation holds between a polygon and a line
-/*!
-	\param geom1	a polygon
-	\param geom2	a line
-	\param relation		topological relation to be verified
-*/
-TL_DLL bool TeTopologicalRelation(const TePolygon* geom1, const TeLine2D* geom2, int relation);
-
-//! Return whether the specified topological relation holds between a polygon and a point
-/*!
-	\param geom1	a polygon
-	\param geom2	a point
-	\param relation		topological relation to be verified
-*/
-TL_DLL bool TeTopologicalRelation(const TePolygon* geom1, const TePoint* geom2, int relation);
-
-//! Return whether the specified topological relation holds between two lines
-/*!
-	\param geom1	a line
-	\param geom2	another line
-	\param relation		topological relation to be verified
-*/
-TL_DLL bool TeTopologicalRelation(const TeLine2D* geom1, const TeLine2D* geom2, int relation);
-
-//! Return whether the specified topological relation holds between a line and a point
-/*!
-	\param geom1	a line
-	\param geom2	a point
-	\param relation		topological relation to be verified
-*/
-TL_DLL bool TeTopologicalRelation(const TeLine2D* geom1, const TePoint* geom2, int relation);
-
-//! Return whether the specified topological relation holds between two points
-/*!
-	\param geom1	a point
-	\param geom2	another point
-	\param relation		topological relation to be verified
-*/
-TL_DLL bool TeTopologicalRelation(const TePoint* geom1, const TePoint* geom2, int relation);
-
-//! Return whether the specified topological relation holds between two cells
-/*!
-	\param geom1	a cell
-	\param geom2	another cell
-	\param relation		topological relation to be verified
-*/
-TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TeCell* geom2, int relation);
-
-//! Return whether the specified topological relation holds between a cell and a polygon
-/*!
-	\param geom1	a cell
-	\param geom2	a polygon
-	\param relation		topological relation to be verified
-*/
-TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TePolygon* geom2, int relation);
-
-//! Return whether the specified topological relation holds between a cell and a line
-/*!
-	\param geom1	a cell
-	\param geom2	a line
-	\param relation		topological relation to be verified
-*/
-TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TeLine2D* geom2, int relation);
-
-//! Return whether the specified topological relation holds between a cell and a point
-/*!
-	\param geom1	a cell
-	\param geom2	a point
-	\param relation		topological relation to be verified
-*/
-TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TePoint* geom2, int relation);
-
-//! Returns the geometries of a geometric table (actGeomTable) that are within a specific distance from a point in memory 
-/*!
-	  \param actGeomTable	geometric table name
-	  \param actRep			geometric representation of the actGeomTable table
-	  \param point			a point in memory
-	  \param IdsDistOut		structure that will contain the identifiers of the resulted geometries and their distances
-	  \param db				a TeDatabase pointer 
-	  \param max_dist		maximum distance 
-	  \param actCollTable	collection table name associated with the actGeomTable table
-*/
-TL_DLL bool TeGetWithinDistance(const string& actGeomTable, TeGeomRep actRep, const TeCoord2D& point, TeKeysToDist& IdsDistOut,
-						 TeDatabase* db, const double& max_dist, const string& actCollTable="");
-
-
-//! Return the area of some specifics geometries of a spatial table 
-/*!
-	\param actGeomTable	spatial table name that contains the geometries
-	\param actRep		geometrical representation of the spatial table 
-	\param actIdsIn		identifications of the specifics geometries (object_id)
-	\param db			a TeDatabase pointer 
-	\param area			area returned
-*/
-TL_DLL bool TeGetArea(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabase* db, double& area);
-
-
-//! Return the length of some specifics geometries of a spatial table 
-TL_DLL bool TeGetLength(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabase* db, double& length);
-
-
-//! Return the distance between two geometries
-TL_DLL bool TeGetDistance(const string& actGeomTable, TeGeomRep actRep, TeKeys& IdsIn, TeDatabase* db, double& distance);
-
-//! Return the convexhull geometries of specifics geometries of a spatial table 
-/*!
-	\param actGeomTable		spatial table name that contains the geometries
-	\param actRep			geometrical representation of the spatial table 
-	\param actIds			identifications of the specifics geometries (object_id)
-	\param db				a TeDatabase pointer 
-	\param convexHullSet	the convexhull geometries returned
-*/
-TL_DLL bool TeGetConvexHull(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, 
-					 TePolygonSet& convexHullSet);
-
-
-//! Return the centroids of specifics geometries of a spatial table 
-TL_DLL bool TeGetCentroid(const string& actGeomTable, TeGeomRep actRep, TeDatabase* db, TePointSet& centroidSet,
-				   TeKeys& actIds, const string& actCollTable="");
-
-
-//! Return the buffer 
-TL_DLL bool TeGetBuffer(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, 
-				 TePolygonSet& bufferSet, double dist);
-
-
-//! Return intersection
-TL_DLL bool TeGetOverlay(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, 
-				  TeGeometryVect& geomVect, const short& operation);
-
-/*!	
-	\brief Clip a raster from a polygon. Return the clipped raster 
-	\param rasterIn	TeRaster pointer that will be clipped
-	\param poly		polygon that defines the clipping
-	\param st		strategic to the iterator of the raster  
-*/
-TL_DLL TeRaster*
-TeMask (TeRaster* rasterIn, TePolygon& poly, TeStrategicIterator st);
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSpatialOperations.h
+    \brief This file contains functions to spatial operations with geographical objects that are in a SGBD 
+*/
+
+#ifndef  __TERRALIB_INTERNAL_SPATIALOPERATIONS_H
+#define  __TERRALIB_INTERNAL_SPATIALOPERATIONS_H
+
+#include "TeDatabase.h"
+#include "TeRaster.h"
+
+//! Keep the selected geometries in the canvas
+typedef vector<TeGeometry*> TeSelectedGeom;
+
+//! Return a string with the identifications of the selected geometries 
+TL_DLL string  getStringIds(TeKeys& IdsIn);
+
+
+//! Return a portal with the geometries of a spatial table that have a topological relation with specifics geometries of this spatial table
+/*!
+	Calculate the topological relation between all geometries of a spatial table and
+	specifics geometries of this spatial table
+	\param actGeomTable	spatial table name that contains all the geometries
+	\param actRep		geometrical representation of the spatial table 
+	\param actIdsIn		identifications of the specifics geometries (object_id)
+	\param portal		returned with the resultants geometries 
+	\param relation		topological relation that will be computed
+	\param actColTable	collection table name that contains a set of geometries of the spatial table 
+*/
+TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+						   TeDatabasePortal *portal, int relation, const string& actColTable="");
+
+
+//! Return a portal with the geometries of a spatial table that have a topological relation with specifics geometries of other spatial table 
+/*!
+	Calculate the topological relation between all geometries of a spatial table and
+	specifics geometries of other spatial table
+	\param actGeomTable	first spatial table name that contains the specifics geometries
+	\param actRep		geometrical representation of the first spatial table 
+	\param actIdsIn		identifications of specifics geometries of the first spatial table (object_id)
+	\param visGeomTable	second spatial table name that contains the others geometries
+	\param visRep		geometrical representation of the second spatial table 
+	\param portal		returned with the resultants geometries 
+	\param relation		topological relation that will be computed 
+	\param visColTable	collection table name that contains a set of geometries of the second spatial table 
+*/
+TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+						   const string& visGeomTable, TeGeomRep visRep, TeDatabasePortal *portal, 
+						   int relation, const string& visColTable="");
+
+
+//! Return a portal with the geometries of a spatial table that have a topological relation with a specific geometry  
+/*!
+	Calculate the topological relation between all geometries of a spatial table and a specific geometry 
+	\param actGeomTable	spatial table name that contains the geometries
+	\param actRep		geometrical representation of the spatial table 
+	\param geom			a specific geometry 
+	\param portal		returned with the resultants geometries 
+	\param relation		topological relation that will be computed 
+	\param actCollTable	collection table name that contains a set of geometries of the spatial table 
+*/
+TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
+						   TeDatabasePortal *portal, int relation, const string& actCollTable="");
+
+
+//! Return the identications of the geometries of a spatial table that have a topological relation with specifics geometries of this spatial table
+/*!
+	Calculate the topological relation between all geometries of a spatial table and
+	specifics geometries of this spatial table
+	\param actGeomTable	spatial table name that contains all the geometries
+	\param actRep		geometrical representation of the spatial table 
+	\param actIdsIn		identifications of the specifics geometries (object_id)
+	\param actIdsOut	returned with the identications of the resultants geometries (object_id)
+	\param db			a TeDatabase pointer 
+	\param relation		topological relation that will be computed 
+	\param actCollTable	collection table name that contains a set of geometries of the spatial table 
+*/
+TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+						   TeKeys& actIdsOut, TeDatabase* db, int relation, const string& actCollTable="");
+
+
+//! Return the identications of the geometries of a spatial table that have a topological relation with specifics geometries of other spatial table 
+/*!
+	Calculate the topological relation between all geometries of a spatial table and
+	specifics geometries of other spatial table
+	\param actGeomTable	first spatial table name that contains the specifics geometries
+	\param actRep		geometrical representation of the first spatial table 
+	\param actIdsIn		identifications of specifics geometries of the first spatial table (object_id)
+	\param visGeomTable	second spatial table name that contains the others geometries
+	\param visRep		geometrical representation of the second spatial table 
+	\param visIdsOut	returned with the identications of the resultants geometries (object_id)
+	\param db			a TeDatabase pointer 
+	\param relation		topological relation that will be computed 
+	\param visCollTable	collection table name that contains a set of geometries of the second spatial table 
+*/
+TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, 
+						   const string& visGeomTable, TeGeomRep visRep, TeKeys& visIdsOut, 
+						   TeDatabase* db, int relation, const string& visCollTable="", TeDatabase* = 0);
+
+//! Return the identications of the geometries of a spatial table that have a topological relation with a specific geometry  
+/*!
+	Calculate the topological relation between all geometries of a spatial table and a specific geometry 
+	\param actGeomTable	spatial table name that contains the geometries
+	\param actRep		geometrical representation of the spatial table 
+	\param geom			a specific geometry 
+	\param actIdsOut	returned with the identications of the resultants geometries (object_id)
+	\param db			a TeDatabase pointer 
+	\param relation		topological relation that will be computed 
+	\param actCollTable	collection table name that contains a set of geometries of the spatial table 
+*/
+TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom, 
+						   TeKeys& actIdsOut, TeDatabase* db, int relation, const string& actCollTable="");
+
+//! Return whether the specified topological relation holds between two polygon
+/*!
+	\param geom1	a polygon
+	\param geom2	another polygon
+	\param relation		topological relation to be verified
+*/
+TL_DLL bool TeTopologicalRelation(const TePolygon* geom1, const TePolygon* geom2, int relation);
+
+//! Return whether the specified topological relation holds between a polygon and a line
+/*!
+	\param geom1	a polygon
+	\param geom2	a line
+	\param relation		topological relation to be verified
+*/
+TL_DLL bool TeTopologicalRelation(const TePolygon* geom1, const TeLine2D* geom2, int relation);
+
+//! Return whether the specified topological relation holds between a polygon and a point
+/*!
+	\param geom1	a polygon
+	\param geom2	a point
+	\param relation		topological relation to be verified
+*/
+TL_DLL bool TeTopologicalRelation(const TePolygon* geom1, const TePoint* geom2, int relation);
+
+//! Return whether the specified topological relation holds between two lines
+/*!
+	\param geom1	a line
+	\param geom2	another line
+	\param relation		topological relation to be verified
+*/
+TL_DLL bool TeTopologicalRelation(const TeLine2D* geom1, const TeLine2D* geom2, int relation);
+
+//! Return whether the specified topological relation holds between a line and a point
+/*!
+	\param geom1	a line
+	\param geom2	a point
+	\param relation		topological relation to be verified
+*/
+TL_DLL bool TeTopologicalRelation(const TeLine2D* geom1, const TePoint* geom2, int relation);
+
+//! Return whether the specified topological relation holds between two points
+/*!
+	\param geom1	a point
+	\param geom2	another point
+	\param relation		topological relation to be verified
+*/
+TL_DLL bool TeTopologicalRelation(const TePoint* geom1, const TePoint* geom2, int relation);
+
+//! Return whether the specified topological relation holds between two cells
+/*!
+	\param geom1	a cell
+	\param geom2	another cell
+	\param relation		topological relation to be verified
+*/
+TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TeCell* geom2, int relation);
+
+//! Return whether the specified topological relation holds between a cell and a polygon
+/*!
+	\param geom1	a cell
+	\param geom2	a polygon
+	\param relation		topological relation to be verified
+*/
+TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TePolygon* geom2, int relation);
+
+//! Return whether the specified topological relation holds between a cell and a line
+/*!
+	\param geom1	a cell
+	\param geom2	a line
+	\param relation		topological relation to be verified
+*/
+TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TeLine2D* geom2, int relation);
+
+//! Return whether the specified topological relation holds between a cell and a point
+/*!
+	\param geom1	a cell
+	\param geom2	a point
+	\param relation		topological relation to be verified
+*/
+TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TePoint* geom2, int relation);
+
+//! Returns the geometries of a geometric table (actGeomTable) that are within a specific distance from a point in memory 
+/*!
+	  \param actGeomTable	geometric table name
+	  \param actRep			geometric representation of the actGeomTable table
+	  \param point			a point in memory
+	  \param IdsDistOut		structure that will contain the identifiers of the resulted geometries and their distances
+	  \param db				a TeDatabase pointer 
+	  \param max_dist		maximum distance 
+	  \param actCollTable	collection table name associated with the actGeomTable table
+*/
+TL_DLL bool TeGetWithinDistance(const string& actGeomTable, TeGeomRep actRep, const TeCoord2D& point, TeKeysToDist& IdsDistOut,
+						 TeDatabase* db, const double& max_dist, const string& actCollTable="");
+
+
+//! Return the area of some specifics geometries of a spatial table 
+/*!
+	\param actGeomTable	spatial table name that contains the geometries
+	\param actRep		geometrical representation of the spatial table 
+	\param actIdsIn		identifications of the specifics geometries (object_id)
+	\param db			a TeDatabase pointer 
+	\param area			area returned
+*/
+TL_DLL bool TeGetArea(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabase* db, double& area);
+
+
+//! Return the length of some specifics geometries of a spatial table 
+TL_DLL bool TeGetLength(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabase* db, double& length);
+
+
+//! Return the distance between two geometries
+TL_DLL bool TeGetDistance(const string& actGeomTable, TeGeomRep actRep, TeKeys& IdsIn, TeDatabase* db, double& distance);
+
+//! Return the convexhull geometries of specifics geometries of a spatial table 
+/*!
+	\param actGeomTable		spatial table name that contains the geometries
+	\param actRep			geometrical representation of the spatial table 
+	\param actIds			identifications of the specifics geometries (object_id)
+	\param db				a TeDatabase pointer 
+	\param convexHullSet	the convexhull geometries returned
+*/
+TL_DLL bool TeGetConvexHull(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, 
+					 TePolygonSet& convexHullSet);
+
+
+//! Return the centroids of specifics geometries of a spatial table 
+TL_DLL bool TeGetCentroid(const string& actGeomTable, TeGeomRep actRep, TeDatabase* db, TePointSet& centroidSet,
+				   TeKeys& actIds, const string& actCollTable="");
+
+
+//! Return the buffer 
+TL_DLL bool TeGetBuffer(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, 
+				 TePolygonSet& bufferSet, double dist);
+
+
+//! Return intersection
+TL_DLL bool TeGetOverlay(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db, 
+				  TeGeometryVect& geomVect, const short& operation);
+
+/*!	
+	\brief Clip a raster from a polygon. Return the clipped raster 
+	\param rasterIn	TeRaster pointer that will be clipped
+	\param poly		polygon that defines the clipping
+	\param st		strategic to the iterator of the raster  
+*/
+TL_DLL TeRaster*
+TeMask (TeRaster* rasterIn, TePolygon& poly, TeStrategicIterator st);
+
+#endif
+
diff --git a/src/terralib/kernel/TeStatistics.h b/src/terralib/kernel/TeStatistics.h
old mode 100755
new mode 100644
index e771737..2b420eb
--- a/src/terralib/kernel/TeStatistics.h
+++ b/src/terralib/kernel/TeStatistics.h
@@ -1,700 +1,700 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeStatistics.h
-    \brief This file contains functions for calculate statistics  
-*/
-
-#ifndef TeStatistics_H
-#define TeStatistics_H
-
-#include "TeDataTypes.h"
-
-#include <string>
-#include <map>
-
-using namespace std;
-
-/** @defgroup Stat Statistical functions
-  @{
- */
-//! vector of statistics
-typedef vector<double>	stats;
-
-//! Associate a statistics set for each dimension 
-struct TL_DLL TeStatisticsDimension
-{
-	int					dimension_;
-	TeStatisticValMap	stat_;
-
-	TeStatisticsDimension(int d, TeStatisticValMap& st): 
-	dimension_(d), 
-	stat_(st)
-	{}
-};
-
-//! vector of the statistics associated with the dimensions 
-typedef vector<TeStatisticsDimension>	TeStatisticsDimensionVect;
-
-//! map each value to its count: histogram
-typedef map<double, int> TeHistogram;
-
-
-/** Calculates the histrogram of a set of values kept in a data structure 
-	\param itBegin	the iterator to the begin of the data structure 
-	\param itEnd	the iterator to the end of the data structure
-	\param histOut	to return the histogram  
-*/
-template<typename T>
-bool TeCalculateHistogram(const T& itBegin, const T& itEnd, TeHistogram& histOut)  
-{
-	T it = itBegin;
-
-	//initialization 
-	while(it!=itEnd)
-	{
-		double val = (*it); 
-		histOut[val] = 0;
-		it++;
-	}
-	
-	it= itBegin;
-	
-	//calcule histogram
-	while(it!=itEnd)
-	{
-		double val = (*it); 
-		histOut[val]++;
-		it++;
-	}
-	
-	return true;
-}
-
-/** Calculates the statistics of a specific dimension of a data structure 
-	\param itBegin	the iterator to the begin of the data structure
-	\param itEnd	the iterator to the end of the data structure
-	\param stat		to return the statistics  
-	\param dim		the dimension of the data structure  
-*/
-template<typename It>  
-bool TeCalculateStatistics(const It& itBegin, const It& itEnd, TeStatisticValMap& stat, int dim)
-{
-	double	sum, mean, minValue, maxValue, variance, assim, 
-			curtose, stDev, coefVar, amplitude, moda, median;  
-	sum=mean=variance=assim=curtose=stDev=coefVar=amplitude=0.0;
-	
-	minValue = TeMAXFLOAT;
-	maxValue = -minValue ;
-
-	vector<double> values;
-	int count=0;
-	int countTotal = 0;
-	It itt = itBegin;	
-	while(itt != itEnd)
-    {
-		double val;
-		val = (*itt)[dim];
-		
-		if(val!=TeMAXFLOAT)  // MAXFLOAT is considered invalid value
-		{
-			values.push_back (val);
-			sum += val;
-		
-			if(minValue>val)
-				minValue = val;
-			if(maxValue<val)
-				maxValue = val;
-			
-			++count;
-			mean = sum/count;
-		}
-		
-		++itt;
-		++countTotal;
-	}
-
-	for(int i=0; i<count; i++)
-	{
-		double v= values[i];
-		variance += pow((v-mean),2); 
-		assim += pow((v-mean),3);   
-		curtose += pow((v-mean),4); 
-	}
-	
-	if(!count)
-		return false;
-
-	variance /= count; 
-	stDev = pow(variance,0.5); 
-	assim /= count;
-	assim /= pow(stDev,3); 
-	curtose /= count;
-	curtose /= pow(stDev,4); 
-
-	coefVar = (100*stDev)/mean;
-	amplitude = maxValue-minValue;  
-
-	sort(values.begin(), values.end());
-		
-	//calculate median 
-	if((count%2)==0)
-		median = (values[(count/2)]+values[(count/2-1)])/2;
-	else
-		median = values[(count-1)/2];
-
-	//calculate the mode
-	TeHistogram histog;
-	TeCalculateHistogram(values.begin(),values.end(), histog);
-		
-	TeHistogram::iterator itHist = histog.begin();
-	int nCount=0;
-	while(itHist!=histog.end())
-	{
-		int hCount = itHist->second; 
-		if (hCount > nCount)
-		{
-			nCount = hCount;
-			moda = itHist->first;
-		}
-		itHist++;	
-	}
-	
-	//fill results
-	stat[TeCOUNT] = countTotal; 
-	stat[TeVALIDCOUNT] = count;
-	stat[TeMINVALUE] = minValue;
-	stat[TeMAXVALUE] = maxValue;
-	stat[TeSUM] = sum;
-	stat[TeMEAN] = mean;
-	stat[TeSTANDARDDEVIATION] = stDev;
-	stat[TeVARIANCE] = variance;
-	stat[TeSKEWNESS] = assim;
-	stat[TeKURTOSIS] = curtose;
-	stat[TeAMPLITUDE] = amplitude;
-	stat[TeMEDIAN] = median;		
-	stat[TeVARCOEFF] = coefVar;		
-	stat[TeMODE] = moda;
- 
-	return true;
-}
-
-
-/**  Calculates the statistics of a string data structure 
-	\param itBegin	the iterator to the begin of the data structure
-	\param itEnd	the iterator to the end of the data structure
-	\param stat		to return the statistics  
-*/
-template<typename It>  
-bool TeCalculateStatistics(const It& itBegin, const It& itEnd, TeStatisticStringValMap& stat, const double &dummy=255, const bool &useDummy=true)
-{
-	string min, max, val;
-	int	count = 0;
-
-	It it = itBegin;
-	int totalCount = 0;
-
-	if(it != itEnd)
-		min = max = (*it);
-	while(it != itEnd)
-	{
-		val = (*it);
-		++it;
-		if((useDummy == false) && (!val.empty()))
-		{
-			if(val.compare(Te2String(dummy))==0)
-				continue;
-		}
-		if(val.empty() == false)
-		{
-			count++;
-			min = MIN(min, val);
-			max = MAX(max, val);
-		}
-		++totalCount;
-	}
-
-	stat[TeMINVALUE] = min;
-	stat[TeMAXVALUE] = max;
-	stat[TeCOUNT] = Te2String(totalCount); 
-	stat[TeVALIDCOUNT] = Te2String(count); 
-	return true;
-}
-
-
-/** Calculates the statistics of a data structure 
-	\param itBegin	the iterator to the begin of the data structure
-	\param itEnd	the iterator to the end of the data structure
-	\param stat		to return the statistics  
-*/
-template<typename It>  
-bool TeCalculateStatistics(const It& itBegin, const It& itEnd, TeStatisticValMap& stat, const double &dummy=255, const bool &useDummy=true)
-{
-	double	sum, mean, minValue, maxValue, variance, assim, 
-			curtose, stDev, coefVar, amplitude, moda, median;  
-	sum=mean=variance=assim=curtose=stDev=coefVar=amplitude=moda=0.0;
-	
-	minValue = TeMAXFLOAT;
-	maxValue = -minValue;
-
-	vector<double>	values;
-
-	int	totalCount = 0;
-	int count=0;
-	It itt = itBegin;	
-	while(itt != itEnd)
-    {
-		double val = (*itt);
-		++itt;
-		if((useDummy == false) && (val == dummy))
-		{
-			continue;
-		}
-		if(val != TeMAXFLOAT) // MAXFLOAT is considered invalid value
-		{
-			values.push_back (val);
-			sum += val;
-			minValue = MIN(minValue, val);
-			maxValue = MAX(maxValue, val);
-		}
-		++totalCount;
-	}
-
-	count = values.size();
-	mean = sum/count;
-
-	for(int i=0; i<count; i++)
-	{
-		double v= values[i];
-		variance += pow((v-mean),2); 
-		assim += pow((v-mean),3);   
-		curtose += pow((v-mean),4); 
-	}
-	
-	if(!count)
-		return false;
-
-	variance /= count; 
-	stDev = pow(variance,0.5); 
-	assim /= count;
-	assim /= pow(stDev,3); 
-	curtose /= count;
-	curtose /= pow(stDev,4); 
-
-	coefVar = (100*stDev)/mean;
-	amplitude = maxValue-minValue;  
-
-	sort(values.begin(), values.end());
-		
-	//calculate median 
-	if((count%2)==0)
-		median = (values[(count/2)]+values[(count/2-1)])/2;
-	else
-		median = values[(count-1)/2];
-
-	//calculate the mode
-	TeHistogram histog;
-	TeCalculateHistogram(values.begin(),values.end(), histog);
-		
-	TeHistogram::iterator itHist = histog.begin();
-	int nCount=0;
-	while(itHist!=histog.end())
-	{
-		int hCount = itHist->second; 
-		if (hCount > nCount)
-		{
-			nCount = hCount;
-			moda = itHist->first;
-		}
-		itHist++;	
-	}
-	
-	//fill results
-	stat[TeVALIDCOUNT] = count; 
-	stat[TeCOUNT] = totalCount; 
-	stat[TeMINVALUE] = minValue;
-	stat[TeMAXVALUE] = maxValue;
-	stat[TeSUM] = sum;
-	stat[TeMEAN] = mean;
-	stat[TeSTANDARDDEVIATION] = stDev;
-	stat[TeVARIANCE] = variance;
-	stat[TeSKEWNESS] = assim;
-	stat[TeKURTOSIS] = curtose;
-	stat[TeAMPLITUDE] = amplitude;
-	stat[TeMEDIAN] = median;		
-	stat[TeVARCOEFF] = coefVar;		
-	stat[TeMODE] = moda;
- 
-	return true;
-}
-
-template<typename It>  
-bool TeCalculateStatistics(It& itBegin, It& itEnd, TeStatisticsDimensionVect& stat)
-{
-	std::vector<double> dummy;
-	return TeCalculateStatistics(itBegin, itEnd,  stat, dummy);
-}
-
-
-/** Calculates the statistics of all dimensions of a data structure 
-	\param itBegin	the iterator to the begin of the data structure
-	\param itEnd	the iterator to the end of the data structure
-	\param stat		to return the statistics  
-*/
-template<typename It>  
-bool TeCalculateStatistics(It& itBegin, It& itEnd, TeStatisticsDimensionVect& stat, std::vector<double> dummy,const bool &useDummy=true)
-{
-	
-	vector<double>	sum, mean, minValue, maxValue, variance, assim, curtose, 
-					stDev, coefVar, amplitude, moda, median;  
-
-	vector<double>	values;
-	bool			noDummy;
-	
-	int nb = itBegin.nBands();
-	
-	//initialization of the vetors
-	for (int i=0; i<nb; i++)
-	{
-		sum.push_back(0.0); 
-		mean.push_back(0.0); 
-		variance.push_back(0.0);
-		assim.push_back(0.0); 
-		curtose.push_back(0.0); 
-		stDev.push_back(0.0);
-		coefVar.push_back(0.0);	
-		amplitude.push_back(0.0);
-		median.push_back (0.0);
-		moda.push_back (0.0);
-		minValue.push_back(TeMAXFLOAT);
-		maxValue.push_back(TeMINFLOAT);
-	}
-			
-	map<int,stats> bandValues;
-	
-	int count=0;
-	int validCount=0;
-	It itt = itBegin;	
-	
-	while(itt != itEnd)
-    {
-		noDummy=false;
-		values.clear();
-		for(int j=0; j<nb; j++)
-		{
-			double val = itt.operator* (j);
-			values.push_back(val);
-			if(val!=dummy[j]) noDummy=true;
-		}
-		++itt;
-		if((useDummy==false) && (noDummy==false))
-		{
-			continue;
-		}
-
-		for (int j=0; j<nb; j++)
-		{
-			double val = values[j];
-			if(val!=TeMAXFLOAT)  // MAXFLOAT is considered invalid value
-			{
-				bandValues[j].push_back(val);
-				sum[j] += val;
-			
-				if(minValue[j]>val)
-					minValue[j] = val;
-				if(maxValue[j]<val)
-					maxValue[j] = val;
-
-				int size = bandValues[j].size();
-				mean[j] = sum[j]/size;
-				validCount++;
-			}
-		}
-		++count;
-	}
-
-	if(!count)
-		return false;
-
-	for (int jj=0; jj<nb; jj++)
-	{
-		for(int i=0; i<count; i++)
-		{	
-			double v = bandValues[jj][i];
-			variance[jj] += pow((v-mean[jj]),2);
-			assim[jj] += pow((v-mean[jj]),3);
-			curtose[jj] += pow((v-mean[jj]),4);
-		}
-
-		variance[jj] /= count;
-		stDev[jj] = pow(variance[jj],0.5);
-		assim[jj] /= count;
-		assim[jj] /= pow(stDev[jj],3);
-		curtose[jj] /= count;
-		curtose[jj] /= pow(stDev[jj],4);
-
-		coefVar[jj] = (100*stDev[jj])/mean[jj];
-		amplitude[jj] = maxValue[jj]-minValue[jj];
-
-		sort(bandValues[jj].begin(), bandValues[jj].end());
-		
-		//calculate median
-		if((count%2)==0)
-			median[jj] = ((bandValues[jj][(count/2)])+(bandValues[jj][(count/2-1)]))/2;
-		else
-			median[jj] = bandValues[jj][(count-1)/2];
-
-		//calculate the mode
-		TeHistogram histog;
-		TeCalculateHistogram(bandValues[jj].begin(),bandValues[jj].end(), histog);
-			
-		TeHistogram::iterator itHist = histog.begin();
-		int nCount=0;
-		while(itHist!=histog.end())
-		{
-			int hCount = itHist->second; 
-			if (hCount > nCount)
-			{
-				nCount = hCount;
-				moda[jj] = itHist->first;
-			}
-			itHist++;	
-		}
-			
-		//fill results
-		TeStatisticValMap statVal;
-
-		statVal[TeCOUNT] = count; 
-		statVal[TeVALIDCOUNT]=validCount;
-		statVal[TeMINVALUE] = minValue[jj];
-		statVal[TeMAXVALUE] = maxValue[jj];
-		statVal[TeSUM] = sum[jj];
-		statVal[TeMEAN] = mean[jj];
-		statVal[TeSTANDARDDEVIATION] = stDev[jj];
-		statVal[TeVARIANCE] = variance[jj];
-		statVal[TeSKEWNESS] = assim[jj];
-		statVal[TeKURTOSIS] = curtose[jj];
-		statVal[TeAMPLITUDE] = amplitude[jj];
-		statVal[TeMEDIAN] = median[jj];
-		statVal[TeVARCOEFF] = coefVar[jj];
-		statVal[TeMODE] = moda[jj];
-
-		TeStatisticsDimension statBand(jj, statVal);
-		stat.push_back(statBand);
-	}
-	
-	return true;
-}
-
-
-//!	Returns the sum of the elements of a specific dimension 
-template <typename It> 
-double TeSum (It begin, It end, int dim)
-{
-	double sum = 0.;
-	while ( begin != end)
-	{
-		if(((*begin)[dim])!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
-			sum += (*begin)[dim];
-		
-		++begin;
-	}
-	return sum;
-}
-
-
-//!	Return the sum of the elements
-template <typename It> 
-double TeSum (It begin, It end)
-{
-	double sum = 0.;
-	while ( begin != end)
-	{
-		if((*begin)!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
-			sum += (*begin);
-		
-		++begin;
-	}
-	return sum;
-}
-
-
-//! Calculates the mean (first moment) of the elements of a specific dimension
-template <typename It> 
-double TeFirstMoment (It begin, It end, int dim)
-{
-	int number = 0;
-	double mean = 0.;
-	while (begin != end)
-	{
-		if(((*begin)[dim])!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
-		{
-			mean += (*begin)[dim];
-			number++; 
-		}
-		++begin;
-	}
-	return mean /= number;
-}
-
-
-//! Calculates the mean (first moment) of the elements
-template <typename It> 
-double TeFirstMoment (It begin, It end)
-{
-	int number = 0;
-	double mean = 0.;
-	while (begin != end)
-	{
-		if((*begin)!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
-		{
-			mean += (*begin);
-			number++; 
-		}
-		begin++;
-	}
-	return mean /= number;
-}
-
-
-//! Calculates the second moment
-template <typename It> 
-double TeSecondMoment (It begin, It end, double mean)
-{
-	int number = 0;
-	double SSD = 0;  //sum of squares of desviation
-
-	while (begin != end)
-	{
-		if((*begin)!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
-		{
-			SSD += pow(( (*begin) - mean), 2);
-			number++; 
-		}
-		begin++;
-	}
-	return SSD /= number;
-}
-
-
-//! Calculates the second moment
-template <typename It> 
-double TeSecondMoment (It begin, It end, double mean, int dim)
-{
-	int number = 0;
-	double SSD = 0;  //sum of squares of desviation
-
-	while (begin != end)
-	{
-		if(((*begin)[dim])!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
-		{
-			SSD += pow(((*begin)[dim] - mean), 2);
-			number++; 
-		}
-		++begin;
-	}
-	return SSD /= number;
-}
-
-
-
-//!	calculates the vector with the means of the attributs
-template <typename It, typename T> 
-bool TeMeanVector ( It begin, It end, T& result)
-{
-	int i = 0;
-	int dim = result.size();
-	T soma;
-
-	for (int m = 0; m < dim ; m++)
-		soma.push_back(0.);
-
-	while (begin != end)
-	{
-		for( int j = 0; j < dim; j++)
-		{
-			if(((*begin)[j]) != TeMAXFLOAT) // MAXFLOAT is considered invalid value 
-			{
-				soma[j]+= (*begin)[j];
-				i++;
-			}
-			else
-				soma[j]= TeMAXFLOAT;
-		}
-		begin++;
-	}
-	
-	for (int k = 0; k < dim; k++)
-	{
-		if(soma[k] != TeMAXFLOAT) 
-			result[k] = soma[k]/i;
-		else
-			result[k] = TeMAXFLOAT;
-	}
-
-	return true;
-}
-
-//! Calculates the deviations in relation to mean
-template <typename It> 
-bool TeDeviation ( It begin, It end, It result, double mean)
-{
-	while (begin != end)
-	{
-		if((*begin) != TeMAXFLOAT) // MAXFLOAT is considered invalid value 
-			*result = double(*begin) - mean;
-		else
-			*result = TeMAXFLOAT;
-
-		begin++; result++;
-	}
-	return true;
-}
-
-
-//! calculates the deviations in relation to mean
-template <typename iteratorSet> 
-bool TeDeviation ( iteratorSet begin, iteratorSet end, double mean, int index=0)
-{
-	//Adds a new attribute in the attribute list of the set
-	TeAttribute attrRep;
-	attrRep.rep_.name_ = "Z";
-	attrRep.rep_.type_ = TeREAL;
-	begin->addProperty(attrRep);
-	
-	while (begin != end)
-	{
-		double result;
-		
-		if(((*begin)[index]) != TeMAXFLOAT) // MAXFLOAT is considered invalid value 
-			result = ((*begin)[index]) - mean;
-		else
-			result = TeMAXFLOAT;
-		
-		(*begin).addPropertyValue(Te2String(result, 9)); 
-		++begin; 
-	}
-	return true;
-}
-/** @} */
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeStatistics.h
+    \brief This file contains functions for calculate statistics  
+*/
+
+#ifndef TeStatistics_H
+#define TeStatistics_H
+
+#include "TeDataTypes.h"
+
+#include <string>
+#include <map>
+
+using namespace std;
+
+/** @defgroup Stat Statistical functions
+  @{
+ */
+//! vector of statistics
+typedef vector<double>	stats;
+
+//! Associate a statistics set for each dimension 
+struct TL_DLL TeStatisticsDimension
+{
+	int					dimension_;
+	TeStatisticValMap	stat_;
+
+	TeStatisticsDimension(int d, TeStatisticValMap& st): 
+	dimension_(d), 
+	stat_(st)
+	{}
+};
+
+//! vector of the statistics associated with the dimensions 
+typedef vector<TeStatisticsDimension>	TeStatisticsDimensionVect;
+
+//! map each value to its count: histogram
+typedef map<double, int> TeHistogram;
+
+
+/** Calculates the histrogram of a set of values kept in a data structure 
+	\param itBegin	the iterator to the begin of the data structure 
+	\param itEnd	the iterator to the end of the data structure
+	\param histOut	to return the histogram  
+*/
+template<typename T>
+bool TeCalculateHistogram(const T& itBegin, const T& itEnd, TeHistogram& histOut)  
+{
+	T it = itBegin;
+
+	//initialization 
+	while(it!=itEnd)
+	{
+		double val = (*it); 
+		histOut[val] = 0;
+		it++;
+	}
+	
+	it= itBegin;
+	
+	//calcule histogram
+	while(it!=itEnd)
+	{
+		double val = (*it); 
+		histOut[val]++;
+		it++;
+	}
+	
+	return true;
+}
+
+/** Calculates the statistics of a specific dimension of a data structure 
+	\param itBegin	the iterator to the begin of the data structure
+	\param itEnd	the iterator to the end of the data structure
+	\param stat		to return the statistics  
+	\param dim		the dimension of the data structure  
+*/
+template<typename It>  
+bool TeCalculateStatistics(const It& itBegin, const It& itEnd, TeStatisticValMap& stat, int dim)
+{
+	double	sum, mean, minValue, maxValue, variance, assim, 
+			curtose, stDev, coefVar, amplitude, moda, median;  
+	sum=mean=variance=assim=curtose=stDev=coefVar=amplitude=0.0;
+	
+	minValue = TeMAXFLOAT;
+	maxValue = -minValue ;
+
+	vector<double> values;
+	int count=0;
+	int countTotal = 0;
+	It itt = itBegin;	
+	while(itt != itEnd)
+    {
+		double val;
+		val = (*itt)[dim];
+		
+		if(val!=TeMAXFLOAT)  // MAXFLOAT is considered invalid value
+		{
+			values.push_back (val);
+			sum += val;
+		
+			if(minValue>val)
+				minValue = val;
+			if(maxValue<val)
+				maxValue = val;
+			
+			++count;
+			mean = sum/count;
+		}
+		
+		++itt;
+		++countTotal;
+	}
+
+	for(int i=0; i<count; i++)
+	{
+		double v= values[i];
+		variance += pow((v-mean),2); 
+		assim += pow((v-mean),3);   
+		curtose += pow((v-mean),4); 
+	}
+	
+	if(!count)
+		return false;
+
+	variance /= count; 
+	stDev = pow(variance,0.5); 
+	assim /= count;
+	assim /= pow(stDev,3); 
+	curtose /= count;
+	curtose /= pow(stDev,4); 
+
+	coefVar = (100*stDev)/mean;
+	amplitude = maxValue-minValue;  
+
+	sort(values.begin(), values.end());
+		
+	//calculate median 
+	if((count%2)==0)
+		median = (values[(count/2)]+values[(count/2-1)])/2;
+	else
+		median = values[(count-1)/2];
+
+	//calculate the mode
+	TeHistogram histog;
+	TeCalculateHistogram(values.begin(),values.end(), histog);
+		
+	TeHistogram::iterator itHist = histog.begin();
+	int nCount=0;
+	while(itHist!=histog.end())
+	{
+		int hCount = itHist->second; 
+		if (hCount > nCount)
+		{
+			nCount = hCount;
+			moda = itHist->first;
+		}
+		itHist++;	
+	}
+	
+	//fill results
+	stat[TeCOUNT] = countTotal; 
+	stat[TeVALIDCOUNT] = count;
+	stat[TeMINVALUE] = minValue;
+	stat[TeMAXVALUE] = maxValue;
+	stat[TeSUM] = sum;
+	stat[TeMEAN] = mean;
+	stat[TeSTANDARDDEVIATION] = stDev;
+	stat[TeVARIANCE] = variance;
+	stat[TeSKEWNESS] = assim;
+	stat[TeKURTOSIS] = curtose;
+	stat[TeAMPLITUDE] = amplitude;
+	stat[TeMEDIAN] = median;		
+	stat[TeVARCOEFF] = coefVar;		
+	stat[TeMODE] = moda;
+ 
+	return true;
+}
+
+
+/**  Calculates the statistics of a string data structure 
+	\param itBegin	the iterator to the begin of the data structure
+	\param itEnd	the iterator to the end of the data structure
+	\param stat		to return the statistics  
+*/
+template<typename It>  
+bool TeCalculateStatistics(const It& itBegin, const It& itEnd, TeStatisticStringValMap& stat, const double &dummy=255, const bool &useDummy=true)
+{
+	string min, max, val;
+	int	count = 0;
+
+	It it = itBegin;
+	int totalCount = 0;
+
+	if(it != itEnd)
+		min = max = (*it);
+	while(it != itEnd)
+	{
+		val = (*it);
+		++it;
+		if((useDummy == false) && (!val.empty()))
+		{
+			if(val.compare(Te2String(dummy))==0)
+				continue;
+		}
+		if(val.empty() == false)
+		{
+			count++;
+			min = MIN(min, val);
+			max = MAX(max, val);
+		}
+		++totalCount;
+	}
+
+	stat[TeMINVALUE] = min;
+	stat[TeMAXVALUE] = max;
+	stat[TeCOUNT] = Te2String(totalCount); 
+	stat[TeVALIDCOUNT] = Te2String(count); 
+	return true;
+}
+
+
+/** Calculates the statistics of a data structure 
+	\param itBegin	the iterator to the begin of the data structure
+	\param itEnd	the iterator to the end of the data structure
+	\param stat		to return the statistics  
+*/
+template<typename It>  
+bool TeCalculateStatistics(const It& itBegin, const It& itEnd, TeStatisticValMap& stat, const double &dummy=255, const bool &useDummy=true)
+{
+	double	sum, mean, minValue, maxValue, variance, assim, 
+			curtose, stDev, coefVar, amplitude, moda, median;  
+	sum=mean=variance=assim=curtose=stDev=coefVar=amplitude=moda=0.0;
+	
+	minValue = TeMAXFLOAT;
+	maxValue = -minValue;
+
+	vector<double>	values;
+
+	int	totalCount = 0;
+	int count=0;
+	It itt = itBegin;	
+	while(itt != itEnd)
+    {
+		double val = (*itt);
+		++itt;
+		if((useDummy == false) && (val == dummy))
+		{
+			continue;
+		}
+		if(val != TeMAXFLOAT) // MAXFLOAT is considered invalid value
+		{
+			values.push_back (val);
+			sum += val;
+			minValue = MIN(minValue, val);
+			maxValue = MAX(maxValue, val);
+		}
+		++totalCount;
+	}
+
+	count = values.size();
+	mean = sum/count;
+
+	for(int i=0; i<count; i++)
+	{
+		double v= values[i];
+		variance += pow((v-mean),2); 
+		assim += pow((v-mean),3);   
+		curtose += pow((v-mean),4); 
+	}
+	
+	if(!count)
+		return false;
+
+	variance /= count; 
+	stDev = pow(variance,0.5); 
+	assim /= count;
+	assim /= pow(stDev,3); 
+	curtose /= count;
+	curtose /= pow(stDev,4); 
+
+	coefVar = (100*stDev)/mean;
+	amplitude = maxValue-minValue;  
+
+	sort(values.begin(), values.end());
+		
+	//calculate median 
+	if((count%2)==0)
+		median = (values[(count/2)]+values[(count/2-1)])/2;
+	else
+		median = values[(count-1)/2];
+
+	//calculate the mode
+	TeHistogram histog;
+	TeCalculateHistogram(values.begin(),values.end(), histog);
+		
+	TeHistogram::iterator itHist = histog.begin();
+	int nCount=0;
+	while(itHist!=histog.end())
+	{
+		int hCount = itHist->second; 
+		if (hCount > nCount)
+		{
+			nCount = hCount;
+			moda = itHist->first;
+		}
+		itHist++;	
+	}
+	
+	//fill results
+	stat[TeVALIDCOUNT] = count; 
+	stat[TeCOUNT] = totalCount; 
+	stat[TeMINVALUE] = minValue;
+	stat[TeMAXVALUE] = maxValue;
+	stat[TeSUM] = sum;
+	stat[TeMEAN] = mean;
+	stat[TeSTANDARDDEVIATION] = stDev;
+	stat[TeVARIANCE] = variance;
+	stat[TeSKEWNESS] = assim;
+	stat[TeKURTOSIS] = curtose;
+	stat[TeAMPLITUDE] = amplitude;
+	stat[TeMEDIAN] = median;		
+	stat[TeVARCOEFF] = coefVar;		
+	stat[TeMODE] = moda;
+ 
+	return true;
+}
+
+template<typename It>  
+bool TeCalculateStatistics(It& itBegin, It& itEnd, TeStatisticsDimensionVect& stat)
+{
+	std::vector<double> dummy;
+	return TeCalculateStatistics(itBegin, itEnd,  stat, dummy);
+}
+
+
+/** Calculates the statistics of all dimensions of a data structure 
+	\param itBegin	the iterator to the begin of the data structure
+	\param itEnd	the iterator to the end of the data structure
+	\param stat		to return the statistics  
+*/
+template<typename It>  
+bool TeCalculateStatistics(It& itBegin, It& itEnd, TeStatisticsDimensionVect& stat, std::vector<double> dummy,const bool &useDummy=true)
+{
+	
+	vector<double>	sum, mean, minValue, maxValue, variance, assim, curtose, 
+					stDev, coefVar, amplitude, moda, median;  
+
+	vector<double>	values;
+	bool			noDummy;
+	
+	int nb = itBegin.nBands();
+	
+	//initialization of the vetors
+	for (int i=0; i<nb; i++)
+	{
+		sum.push_back(0.0); 
+		mean.push_back(0.0); 
+		variance.push_back(0.0);
+		assim.push_back(0.0); 
+		curtose.push_back(0.0); 
+		stDev.push_back(0.0);
+		coefVar.push_back(0.0);	
+		amplitude.push_back(0.0);
+		median.push_back (0.0);
+		moda.push_back (0.0);
+		minValue.push_back(TeMAXFLOAT);
+		maxValue.push_back(TeMINFLOAT);
+	}
+			
+	map<int,stats> bandValues;
+	
+	int count=0;
+	int validCount=0;
+	It itt = itBegin;	
+	
+	while(itt != itEnd)
+    {
+		noDummy=false;
+		values.clear();
+		for(int j=0; j<nb; j++)
+		{
+			double val = itt.operator* (j);
+			values.push_back(val);
+			if(val!=dummy[j]) noDummy=true;
+		}
+		++itt;
+		if((useDummy==false) && (noDummy==false))
+		{
+			continue;
+		}
+
+		for (int j=0; j<nb; j++)
+		{
+			double val = values[j];
+			if(val!=TeMAXFLOAT)  // MAXFLOAT is considered invalid value
+			{
+				bandValues[j].push_back(val);
+				sum[j] += val;
+			
+				if(minValue[j]>val)
+					minValue[j] = val;
+				if(maxValue[j]<val)
+					maxValue[j] = val;
+
+				int size = bandValues[j].size();
+				mean[j] = sum[j]/size;
+				validCount++;
+			}
+		}
+		++count;
+	}
+
+	if(!count)
+		return false;
+
+	for (int jj=0; jj<nb; jj++)
+	{
+		for(int i=0; i<count; i++)
+		{	
+			double v = bandValues[jj][i];
+			variance[jj] += pow((v-mean[jj]),2);
+			assim[jj] += pow((v-mean[jj]),3);
+			curtose[jj] += pow((v-mean[jj]),4);
+		}
+
+		variance[jj] /= count;
+		stDev[jj] = pow(variance[jj],0.5);
+		assim[jj] /= count;
+		assim[jj] /= pow(stDev[jj],3);
+		curtose[jj] /= count;
+		curtose[jj] /= pow(stDev[jj],4);
+
+		coefVar[jj] = (100*stDev[jj])/mean[jj];
+		amplitude[jj] = maxValue[jj]-minValue[jj];
+
+		sort(bandValues[jj].begin(), bandValues[jj].end());
+		
+		//calculate median
+		if((count%2)==0)
+			median[jj] = ((bandValues[jj][(count/2)])+(bandValues[jj][(count/2-1)]))/2;
+		else
+			median[jj] = bandValues[jj][(count-1)/2];
+
+		//calculate the mode
+		TeHistogram histog;
+		TeCalculateHistogram(bandValues[jj].begin(),bandValues[jj].end(), histog);
+			
+		TeHistogram::iterator itHist = histog.begin();
+		int nCount=0;
+		while(itHist!=histog.end())
+		{
+			int hCount = itHist->second; 
+			if (hCount > nCount)
+			{
+				nCount = hCount;
+				moda[jj] = itHist->first;
+			}
+			itHist++;	
+		}
+			
+		//fill results
+		TeStatisticValMap statVal;
+
+		statVal[TeCOUNT] = count; 
+		statVal[TeVALIDCOUNT]=validCount;
+		statVal[TeMINVALUE] = minValue[jj];
+		statVal[TeMAXVALUE] = maxValue[jj];
+		statVal[TeSUM] = sum[jj];
+		statVal[TeMEAN] = mean[jj];
+		statVal[TeSTANDARDDEVIATION] = stDev[jj];
+		statVal[TeVARIANCE] = variance[jj];
+		statVal[TeSKEWNESS] = assim[jj];
+		statVal[TeKURTOSIS] = curtose[jj];
+		statVal[TeAMPLITUDE] = amplitude[jj];
+		statVal[TeMEDIAN] = median[jj];
+		statVal[TeVARCOEFF] = coefVar[jj];
+		statVal[TeMODE] = moda[jj];
+
+		TeStatisticsDimension statBand(jj, statVal);
+		stat.push_back(statBand);
+	}
+	
+	return true;
+}
+
+
+//!	Returns the sum of the elements of a specific dimension 
+template <typename It> 
+double TeSum (It begin, It end, int dim)
+{
+	double sum = 0.;
+	while ( begin != end)
+	{
+		if(((*begin)[dim])!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
+			sum += (*begin)[dim];
+		
+		++begin;
+	}
+	return sum;
+}
+
+
+//!	Return the sum of the elements
+template <typename It> 
+double TeSum (It begin, It end)
+{
+	double sum = 0.;
+	while ( begin != end)
+	{
+		if((*begin)!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
+			sum += (*begin);
+		
+		++begin;
+	}
+	return sum;
+}
+
+
+//! Calculates the mean (first moment) of the elements of a specific dimension
+template <typename It> 
+double TeFirstMoment (It begin, It end, int dim)
+{
+	int number = 0;
+	double mean = 0.;
+	while (begin != end)
+	{
+		if(((*begin)[dim])!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
+		{
+			mean += (*begin)[dim];
+			number++; 
+		}
+		++begin;
+	}
+	return mean /= number;
+}
+
+
+//! Calculates the mean (first moment) of the elements
+template <typename It> 
+double TeFirstMoment (It begin, It end)
+{
+	int number = 0;
+	double mean = 0.;
+	while (begin != end)
+	{
+		if((*begin)!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
+		{
+			mean += (*begin);
+			number++; 
+		}
+		begin++;
+	}
+	return mean /= number;
+}
+
+
+//! Calculates the second moment
+template <typename It> 
+double TeSecondMoment (It begin, It end, double mean)
+{
+	int number = 0;
+	double SSD = 0;  //sum of squares of desviation
+
+	while (begin != end)
+	{
+		if((*begin)!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
+		{
+			SSD += pow(( (*begin) - mean), 2);
+			number++; 
+		}
+		begin++;
+	}
+	return SSD /= number;
+}
+
+
+//! Calculates the second moment
+template <typename It> 
+double TeSecondMoment (It begin, It end, double mean, int dim)
+{
+	int number = 0;
+	double SSD = 0;  //sum of squares of desviation
+
+	while (begin != end)
+	{
+		if(((*begin)[dim])!= TeMAXFLOAT) // MAXFLOAT is considered invalid value
+		{
+			SSD += pow(((*begin)[dim] - mean), 2);
+			number++; 
+		}
+		++begin;
+	}
+	return SSD /= number;
+}
+
+
+
+//!	calculates the vector with the means of the attributs
+template <typename It, typename T> 
+bool TeMeanVector ( It begin, It end, T& result)
+{
+	int i = 0;
+	int dim = result.size();
+	T soma;
+
+	for (int m = 0; m < dim ; m++)
+		soma.push_back(0.);
+
+	while (begin != end)
+	{
+		for( int j = 0; j < dim; j++)
+		{
+			if(((*begin)[j]) != TeMAXFLOAT) // MAXFLOAT is considered invalid value 
+			{
+				soma[j]+= (*begin)[j];
+				i++;
+			}
+			else
+				soma[j]= TeMAXFLOAT;
+		}
+		begin++;
+	}
+	
+	for (int k = 0; k < dim; k++)
+	{
+		if(soma[k] != TeMAXFLOAT) 
+			result[k] = soma[k]/i;
+		else
+			result[k] = TeMAXFLOAT;
+	}
+
+	return true;
+}
+
+//! Calculates the deviations in relation to mean
+template <typename It> 
+bool TeDeviation ( It begin, It end, It result, double mean)
+{
+	while (begin != end)
+	{
+		if((*begin) != TeMAXFLOAT) // MAXFLOAT is considered invalid value 
+			*result = double(*begin) - mean;
+		else
+			*result = TeMAXFLOAT;
+
+		begin++; result++;
+	}
+	return true;
+}
+
+
+//! calculates the deviations in relation to mean
+template <typename iteratorSet> 
+bool TeDeviation ( iteratorSet begin, iteratorSet end, double mean, int index=0)
+{
+	//Adds a new attribute in the attribute list of the set
+	TeAttribute attrRep;
+	attrRep.rep_.name_ = "Z";
+	attrRep.rep_.type_ = TeREAL;
+	begin->addProperty(attrRep);
+	
+	while (begin != end)
+	{
+		double result;
+		
+		if(((*begin)[index]) != TeMAXFLOAT) // MAXFLOAT is considered invalid value 
+			result = ((*begin)[index]) - mean;
+		else
+			result = TeMAXFLOAT;
+		
+		(*begin).addPropertyValue(Te2String(result, 9)); 
+		++begin; 
+	}
+	return true;
+}
+/** @} */
+#endif
+
diff --git a/src/terralib/kernel/TeStdFile.cpp b/src/terralib/kernel/TeStdFile.cpp
old mode 100755
new mode 100644
index 357389d..83d0008
--- a/src/terralib/kernel/TeStdFile.cpp
+++ b/src/terralib/kernel/TeStdFile.cpp
@@ -1,60 +1,60 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include "TeStdFile.h"
-#include "TeException.h"
-
-
-
-// -- Constructor
-
-TeStdFile::TeStdFile ( const string& name, const char* mode ):
-	file_ ( 0 ), fileName_ ( name ), mode_ ( mode )
-{
-	const char* inputFile = fileName_.c_str();
-	if ( name.size() <= 1 )
-		throw TeException ( EMPTY_FILE_NAME, name, false );
-	
-	if ( ( file_ = fopen( inputFile, mode ) ) == 0 )
-	{
-		bool hasErrno = true;
-		throw TeException ( CANNOT_OPEN_FILE, name, hasErrno );
-	}
-}
-
-TeStdFile::~TeStdFile() 
-{ 
-	if(file_ ) 
-		fclose(file_);
-}
-
-void
-TeStdFile::rewind()
-{
-	if (file_)
-		fseek(file_,0,0);
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include "TeStdFile.h"
+#include "TeException.h"
+
+
+
+// -- Constructor
+
+TeStdFile::TeStdFile ( const string& name, const char* mode ):
+	file_ ( 0 ), fileName_ ( name ), mode_ ( mode )
+{
+	const char* inputFile = fileName_.c_str();
+	if ( name.size() <= 1 )
+		throw TeException ( EMPTY_FILE_NAME, name, false );
+	
+	if ( ( file_ = fopen( inputFile, mode ) ) == 0 )
+	{
+		bool hasErrno = true;
+		throw TeException ( CANNOT_OPEN_FILE, name, hasErrno );
+	}
+}
+
+TeStdFile::~TeStdFile() 
+{ 
+	if(file_ ) 
+		fclose(file_);
+}
+
+void
+TeStdFile::rewind()
+{
+	if (file_)
+		fseek(file_,0,0);
+}
diff --git a/src/terralib/kernel/TeStdFile.h b/src/terralib/kernel/TeStdFile.h
old mode 100755
new mode 100644
index be0080e..cfe5230
--- a/src/terralib/kernel/TeStdFile.h
+++ b/src/terralib/kernel/TeStdFile.h
@@ -1,84 +1,84 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeStdFile.h
-    \brief This file contains a class for handling "stdio" files
-*/
-#ifndef  __TERRALIB_INTERNAL_STDFILE_H
-#define  __TERRALIB_INTERNAL_STSFILE_H
-
-#include "TeDefines.h"
-#include <stdio.h>
-#include <string>
-using namespace std;
-
-//! A class for handling "stdio" files
-/*  Provide support for using a file as a class, and 
-    throws exceptions if things go wrong
-	\sa TeException TeAsciiFile
-*/
-class TL_DLL TeStdFile {
-public:
-
-//! Simple constructor taking the file name and the mode of oppening
-		TeStdFile(const string& name, const char* mode = "r");
-	
-	virtual ~TeStdFile(); 
-
-//! Return true if the file pointer is not at the end of file
-	bool isNotAtEOF()
-	{ 
-		if ( feof ( file_ ) != 0  )
-			return false;
-		return true;
-	}
-
-// name
-	string name ()
-	{ return fileName_; }
-
-// -- operator ()	
-	operator FILE*() { return file_; }
-
-// -- returns the file pointer
-	FILE* FilePtr() { return file_; }
-
-	void rewind();
-
-protected:
-	
-// -- File pointer
-
-	FILE *file_;
-	string fileName_;
-	string mode_;
-
-private:
-	
-// No copy allowed
-	TeStdFile(const TeStdFile&);
-	TeStdFile& operator=(const TeStdFile&);
-
-};
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeStdFile.h
+    \brief This file contains a class for handling "stdio" files
+*/
+#ifndef  __TERRALIB_INTERNAL_STDFILE_H
+#define  __TERRALIB_INTERNAL_STSFILE_H
+
+#include "TeDefines.h"
+#include <stdio.h>
+#include <string>
+using namespace std;
+
+//! A class for handling "stdio" files
+/*  Provide support for using a file as a class, and 
+    throws exceptions if things go wrong
+	\sa TeException TeAsciiFile
+*/
+class TL_DLL TeStdFile {
+public:
+
+//! Simple constructor taking the file name and the mode of oppening
+		TeStdFile(const string& name, const char* mode = "r");
+	
+	virtual ~TeStdFile(); 
+
+//! Return true if the file pointer is not at the end of file
+	bool isNotAtEOF()
+	{ 
+		if ( feof ( file_ ) != 0  )
+			return false;
+		return true;
+	}
+
+// name
+	string name ()
+	{ return fileName_; }
+
+// -- operator ()	
+	operator FILE*() { return file_; }
+
+// -- returns the file pointer
+	FILE* FilePtr() { return file_; }
+
+	void rewind();
+
+protected:
+	
+// -- File pointer
+
+	FILE *file_;
+	string fileName_;
+	string mode_;
+
+private:
+	
+// No copy allowed
+	TeStdFile(const TeStdFile&);
+	TeStdFile& operator=(const TeStdFile&);
+
+};
+
+#endif
+
diff --git a/src/terralib/kernel/TeStdIOProgress.cpp b/src/terralib/kernel/TeStdIOProgress.cpp
old mode 100755
new mode 100644
index c062548..94f1b1c
--- a/src/terralib/kernel/TeStdIOProgress.cpp
+++ b/src/terralib/kernel/TeStdIOProgress.cpp
@@ -1,78 +1,78 @@
-#include "TeStdIOProgress.h"
-
-#include <iostream>
-
-using std::string;
-using std::cout;
-
-TeStdIOProgress::TeStdIOProgress() :
-	totalSteps_(0),
-	curProg_(0)
-{
-}
-
-
-TeStdIOProgress::~TeStdIOProgress()
-{
-}
-
-
-void TeStdIOProgress::setTotalSteps(int n)
-{ 
-  totalSteps_ = n; 
-  curProg_=0;
-}
-
-
-void TeStdIOProgress::reset()
-{ 
-	totalSteps_ = 0; 
-	messageStr_ = "";
-	captionStr_ = "";
-	curProg_ = 0;
-}
-
-
-void TeStdIOProgress::cancel()
-{ 
-	totalSteps_ = 0; 
-	messageStr_ = "";
-	captionStr_ = "";
-	curProg_ = 0;
-}
-
-
-void TeStdIOProgress::setMessage(const string& text)
-{ 
-  messageStr_ = text;
-}
-
-
-string TeStdIOProgress::getMessage() 
-{ 
-  return messageStr_; 
-}
-
-
-bool TeStdIOProgress::wasCancelled()
-{ 
-  return false; 
-}
-	
-
-void TeStdIOProgress::setCaption(const string& cap)
-{ 
-  captionStr_ = cap;
-}
-
-
-void TeStdIOProgress::setProgress(int steps)
-{
-	int prog = (int)(100*steps/(totalSteps_+1));
-	if (prog != curProg_)
-	{
-		cout << messageStr_ << " : " << prog << "%...\n";
-		curProg_ = prog;
-	}
-}
-
+#include "TeStdIOProgress.h"
+
+#include <iostream>
+
+using std::string;
+using std::cout;
+
+TeStdIOProgress::TeStdIOProgress() :
+	totalSteps_(0),
+	curProg_(0)
+{
+}
+
+
+TeStdIOProgress::~TeStdIOProgress()
+{
+}
+
+
+void TeStdIOProgress::setTotalSteps(int n)
+{ 
+  totalSteps_ = n; 
+  curProg_=0;
+}
+
+
+void TeStdIOProgress::reset()
+{ 
+	totalSteps_ = 0; 
+	messageStr_ = "";
+	captionStr_ = "";
+	curProg_ = 0;
+}
+
+
+void TeStdIOProgress::cancel()
+{ 
+	totalSteps_ = 0; 
+	messageStr_ = "";
+	captionStr_ = "";
+	curProg_ = 0;
+}
+
+
+void TeStdIOProgress::setMessage(const string& text)
+{ 
+  messageStr_ = text;
+}
+
+
+string TeStdIOProgress::getMessage() 
+{ 
+  return messageStr_; 
+}
+
+
+bool TeStdIOProgress::wasCancelled()
+{ 
+  return false; 
+}
+	
+
+void TeStdIOProgress::setCaption(const string& cap)
+{ 
+  captionStr_ = cap;
+}
+
+
+void TeStdIOProgress::setProgress(int steps)
+{
+	int prog = (int)(100*steps/(totalSteps_+1));
+	if (prog != curProg_)
+	{
+		cout << messageStr_ << " : " << prog << "%...\n";
+		curProg_ = prog;
+	}
+}
+
diff --git a/src/terralib/kernel/TeStdIOProgress.h b/src/terralib/kernel/TeStdIOProgress.h
old mode 100755
new mode 100644
index f1dadb9..024199f
--- a/src/terralib/kernel/TeStdIOProgress.h
+++ b/src/terralib/kernel/TeStdIOProgress.h
@@ -1,71 +1,71 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeStdIOProgress.h
-    \brief This file an implementation of progress information using stl io stream.
-*/
-#ifndef __TERRALIB_INTERNAL_STDIOPROGRESS_H
-#define __TERRALIB_INTERNAL_STDIOPROGRESS_H
-
-#include <TeProgressBase.h>
-//#include <iostream>
-
-//using std::string;
-//using std::cout;
-
-class TL_DLL TeStdIOProgress : public TeProgressBase
-{
-	int totalSteps_;
-	int curProg_;
-	string messageStr_;
-	string captionStr_;
-
-public:
-	TeStdIOProgress();
-
-	~TeStdIOProgress();
-
-	//! Sets the total number of steps to n 
-	void setTotalSteps(int n);
-
-	//! Resets the progress interface
-	void reset();
-
-	//! Cancel activity being excuted
-	void cancel();
-
-	//! Sets the label's text
-	void setMessage(const string& text);
-
-	//! Returns the label's text
-	string getMessage() ;
-
-	//! Returns true whether the process was cancelled
-	bool wasCancelled();
-	
-	//! Sets the caption associated to the progress interface
-	void setCaption(const string& cap);
-
-	//! Display progress message
-	void setProgress(int steps);
-};
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeStdIOProgress.h
+    \brief This file an implementation of progress information using stl io stream.
+*/
+#ifndef __TERRALIB_INTERNAL_STDIOPROGRESS_H
+#define __TERRALIB_INTERNAL_STDIOPROGRESS_H
+
+#include <TeProgressBase.h>
+//#include <iostream>
+
+//using std::string;
+//using std::cout;
+
+class TL_DLL TeStdIOProgress : public TeProgressBase
+{
+	int totalSteps_;
+	int curProg_;
+	string messageStr_;
+	string captionStr_;
+
+public:
+	TeStdIOProgress();
+
+	~TeStdIOProgress();
+
+	//! Sets the total number of steps to n 
+	void setTotalSteps(int n);
+
+	//! Resets the progress interface
+	void reset();
+
+	//! Cancel activity being excuted
+	void cancel();
+
+	//! Sets the label's text
+	void setMessage(const string& text);
+
+	//! Returns the label's text
+	string getMessage() ;
+
+	//! Returns true whether the process was cancelled
+	bool wasCancelled();
+	
+	//! Sets the caption associated to the progress interface
+	void setCaption(const string& cap);
+
+	//! Display progress message
+	void setProgress(int steps);
+};
+#endif
diff --git a/src/terralib/kernel/TeTable.cpp b/src/terralib/kernel/TeTable.cpp
old mode 100755
new mode 100644
index 2bbe395..b94c0df
--- a/src/terralib/kernel/TeTable.cpp
+++ b/src/terralib/kernel/TeTable.cpp
@@ -1,376 +1,376 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeTable.h"
-#include "TeUtils.h"
-#include <iostream>
-
-using namespace std;
-
-
-string tableJoin(TeAttrTableVector& vecTable, string geomTable, string attrLink)
-{
-	string parClause = "";
-	string fromResult = "";
-	string firstTable = "";
-	string cJoin = "";
-
-	TeAttrTableVector::iterator it; 
-	
-	if(geomTable.empty())
-	{
-		//find the first static table
-		it = vecTable.begin();
-		while(it!=vecTable.end())
-		{
-			if((*it).tableType() != TeAttrExternal)
-			{
-				firstTable = (*it).name();
-				attrLink = (*it).linkName();
-				break;
-			}
-			++it;
-		}
-		cJoin = " LEFT "; //the first table is a attribute table
-	}
-	else
-	{
-		firstTable = geomTable;
-		cJoin = " LEFT "; //the first table is a geometry table
-	}
-		
-	
-	fromResult += firstTable; 
-	
-	
-	//if don�t exist a table static or temporal 
-	if(firstTable.empty() || attrLink.empty())	
-		return "";
-			
-	it = vecTable.begin();
-
-	while(it!=vecTable.end())
-	{
-		if( ((*it).name()!=firstTable) && ((*it).tableType()!=TeAttrExternal))
-		{
-			fromResult += " "+ cJoin +" JOIN "+ (*it).name() +" ON "+ firstTable;
-			fromResult += "."+ attrLink +" = "+ (*it).name() +"."+ (*it).linkName() +")";
-			parClause += "(";
-		}
-
-		else if ((*it).name()!=firstTable)
-		{
-			int idTableStatic = (*it).relatedTableId();
-			string colTableStatic = (*it).relatedAttribute();
-			string nameTableStatic;   
-
-			//verify if static table is in the vector of the attribute tables
-			for(unsigned int j=0; j<vecTable.size(); j++)
-			{
-				if(vecTable[j].id()==idTableStatic)
-				{
-					nameTableStatic = vecTable[j].name();
-					break;
-				}
-			}
-
-			if(nameTableStatic.empty())
-				return "";
-
-			fromResult += " "+ cJoin +" JOIN "+ (*it).name() +" ON "+ nameTableStatic +"."+ colTableStatic;
-			fromResult += " = " + (*it).name() +"."+ (*it).linkName() +")";
-			parClause += "(";
-		}
-
-		++it;
-		cJoin = " LEFT ";
-	}
-
-	return (parClause + fromResult);
-}
-
-
-// ---- Handle class - TeTable
-
-TeTable::TeTable():
-	id_(-1),
-	name_(""),
-	type_(TeAttrStatic),
-	order_(-1),
-	attLink_(""),
-	attUnique_(""),
-	separator_(','),
-	attInitialTime_(""),
-	attFinalTime_(""),
-	attTimeUnit_(TeSECOND),
-	relatedTableId_(-1),
-	relatedAttribute_("")
-{
-	pImpl_ = new TeTableImpl;
-	pImpl_->refCount_ = 1;	
-}
-
-TeTable::TeTable(const string& name):
-	id_(-1),
-	name_(name),
-	type_(TeAttrStatic),
-	order_(-1),
-	attLink_(""),
-	attUnique_(""),
-	separator_(','),
-	attInitialTime_(""),
-	attFinalTime_(""),
-	attTimeUnit_(TeSECOND),
-	relatedTableId_(-1),
-	relatedAttribute_("")
-{
-	pImpl_ = new TeTableImpl;
-	pImpl_->refCount_ = 1;	
-}
-
-TeTable::TeTable(const string& name, const TeAttributeList& attList, const string& uniqueName,
-				 const string& linkName, TeAttrTableType tableType):
-	id_(-1),
-	name_(name),
-	type_(tableType),
-	order_(-1),
-	attList_(attList),
-	attLink_(linkName),
-	attUnique_(uniqueName),
-	separator_(','),
-	attInitialTime_(""),
-	attFinalTime_(""),
-	attTimeUnit_(TeSECOND),
-	relatedTableId_(-1),
-	relatedAttribute_("")
-{
-	pImpl_ = new TeTableImpl;
-	pImpl_->refCount_ = 1;	
-}
-
-TeTable::~TeTable()
-{
-	if ( --(pImpl_->refCount_) <= 0 )
-		delete pImpl_;	
-	attList_.clear();
-}
-
-// Copy constructor
-// copies the representation pointer
-// increments the reference counter
-
-TeTable::TeTable(const TeTable& other)
-{
-	id_= other.id_;
-	name_ = other.name_;
-	type_ = other.type_;
-	attLink_ = other.attLink_;
-	attUnique_ = other.attUnique_;
-	separator_ = other.separator_;
-	order_ = other.order_;
-	attInitialTime_ = other.attInitialTime_;
-	attFinalTime_ = other.attFinalTime_;
-	attTimeUnit_ = other.attTimeUnit_;
-	attList_.clear();
-	attList_.resize(other.attList_.size());
-	attList_=other.attList_;
-	relatedTableId_ = other.relatedTableId_;
-	relatedTableName_ = other.relatedTableName_;
-	relatedAttribute_ = other.relatedAttribute_;
-	pImpl_ = other.pImpl_;
-	pImpl_->refCount_++;
-}
-
-// Operator =
-// Copies the representation pointer
-// Decrements the reference counter of the current object
-// Increments the reference counter for the new object
-TeTable& 
-TeTable::operator=(const TeTable& rhs)
-{
-	if ( this != &rhs )
-	{
-		rhs.pImpl_->refCount_++;
-	
-		if ( --(pImpl_->refCount_) <= 0 )
-			delete pImpl_;
-		pImpl_ = rhs.pImpl_;
-
-		separator_ = rhs.separator_;
-		attLink_ = rhs.attLink_;
-		attUnique_ = rhs.attUnique_;
-		order_ = rhs.order_;
-		attInitialTime_ = rhs.attInitialTime_;
-		attFinalTime_ = rhs.attFinalTime_;
-		attTimeUnit_ = rhs.attTimeUnit_;
-		type_ = rhs.type_;
-		name_ = rhs.name_;	
-		attList_.clear();
-		attList_ = rhs.attList_;
-		relatedTableId_ = rhs.relatedTableId_;
-		relatedTableName_ = rhs.relatedTableName_;
-		relatedAttribute_ = rhs.relatedAttribute_;
-		id_ = rhs.id_;
-	}
-	return *this;
-}
-
-bool 
-TeTable::setTableType( TeAttrTableType attType, int relatedTableId, const string& relatedAttribute)
-{ 
-	type_ = attType; 
-	if ( attType == TeAttrExternal && relatedTableId > 0 && !relatedAttribute.empty())
-	{
-		relatedTableId_ = relatedTableId;
-		relatedAttribute_ = relatedAttribute;
-
-		return true;
-	}
-	return false;
-}
-
-void
-TeTable::add ( const TeTableRow& row )
-{
-	pImpl_->add ( row );
-}
-
-void
-TeTable::setValue (int row, int col, string& val)
-{
-	pImpl_->setValue (row,col,val);
-}
-
-unsigned int
-TeTable::size ()
-{
-	return pImpl_->size();
-}
-
-void TeTable::clear ()
-{
-	pImpl_->clear();
-}
-
-TeTableRow
-TeTable::operator [] (int i) 
-{
-	return pImpl_->operator [] ( i );
-}
-
-string 
-TeTable::operator () ( int row, int col )
-{
-	return pImpl_->operator () (row, col );
-}
-
-
-bool
-TeTable::attrLink(TeAttribute& att)
-{	
-	TeAttributeList::iterator it = attList_.begin();
-	while (it != attList_.end())
-	{
-		if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(attLink_))
-		{
-			att = (*it);
-			return true;
-		}
-		++it;
-	}
-	return false;
-}
-
-bool 
-TeTable::attrUnique(TeAttribute& attr)
-{
-	TeAttributeList::iterator it = attList_.begin();
-	while(it!=attList_.end())
-	{
-		if(TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(attUnique_))
-		{
-			attr = (*it);
-			return true;
-		}
-		++it;
-	}
-	return false;
-}
-
-int
-TeTable::attrLinkPosition()
-{
-	int i = 0;
-	TeAttributeList::iterator it = attList_.begin();
-	while (it != attList_.end())
-	{
-		if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(attLink_))
-			return i;
-		++it;
-		++i;
-	}
-	return -1;
-}
-
-int
-TeTable::attrUniquePosition()
-{
-	int i = 0;
-	TeAttributeList::iterator it = attList_.begin();
-	while (it != attList_.end())
-	{
-		if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(attUnique_))
-			return i;
-		++it;
-		++i;
-	}
-	return -1;
-}
-
-bool 
-TeTable::attributeNames(vector<string>& attrs)
-{
-	attrs.clear();
-	TeAttributeList::iterator it = attList_.begin();
-	while(it!=attList_.end())
-	{
-		attrs.push_back((*it).rep_.name_);
-		++it;
-	}
-	return true;
-}
-
-
-void 
-TeTable::primaryKeys(vector<string>& keys)
-{
-	keys.empty();
-	TeAttributeList::iterator it = attList_.begin();
-	while(it!=attList_.end())
-	{
-		if((*it).rep_.isPrimaryKey_)
-			keys.push_back((*it).rep_.name_);
-		++it;
-	}
-	return;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeTable.h"
+#include "TeUtils.h"
+#include <iostream>
+
+using namespace std;
+
+
+string tableJoin(TeAttrTableVector& vecTable, string geomTable, string attrLink)
+{
+	string parClause = "";
+	string fromResult = "";
+	string firstTable = "";
+	string cJoin = "";
+
+	TeAttrTableVector::iterator it; 
+	
+	if(geomTable.empty())
+	{
+		//find the first static table
+		it = vecTable.begin();
+		while(it!=vecTable.end())
+		{
+			if((*it).tableType() != TeAttrExternal)
+			{
+				firstTable = (*it).name();
+				attrLink = (*it).linkName();
+				break;
+			}
+			++it;
+		}
+		cJoin = " LEFT "; //the first table is a attribute table
+	}
+	else
+	{
+		firstTable = geomTable;
+		cJoin = " LEFT "; //the first table is a geometry table
+	}
+		
+	
+	fromResult += firstTable; 
+	
+	
+	//if don�t exist a table static or temporal 
+	if(firstTable.empty() || attrLink.empty())	
+		return "";
+			
+	it = vecTable.begin();
+
+	while(it!=vecTable.end())
+	{
+		if( ((*it).name()!=firstTable) && ((*it).tableType()!=TeAttrExternal))
+		{
+			fromResult += " "+ cJoin +" JOIN "+ (*it).name() +" ON "+ firstTable;
+			fromResult += "."+ attrLink +" = "+ (*it).name() +"."+ (*it).linkName() +")";
+			parClause += "(";
+		}
+
+		else if ((*it).name()!=firstTable)
+		{
+			int idTableStatic = (*it).relatedTableId();
+			string colTableStatic = (*it).relatedAttribute();
+			string nameTableStatic;   
+
+			//verify if static table is in the vector of the attribute tables
+			for(unsigned int j=0; j<vecTable.size(); j++)
+			{
+				if(vecTable[j].id()==idTableStatic)
+				{
+					nameTableStatic = vecTable[j].name();
+					break;
+				}
+			}
+
+			if(nameTableStatic.empty())
+				return "";
+
+			fromResult += " "+ cJoin +" JOIN "+ (*it).name() +" ON "+ nameTableStatic +"."+ colTableStatic;
+			fromResult += " = " + (*it).name() +"."+ (*it).linkName() +")";
+			parClause += "(";
+		}
+
+		++it;
+		cJoin = " LEFT ";
+	}
+
+	return (parClause + fromResult);
+}
+
+
+// ---- Handle class - TeTable
+
+TeTable::TeTable():
+	id_(-1),
+	name_(""),
+	type_(TeAttrStatic),
+	order_(-1),
+	attLink_(""),
+	attUnique_(""),
+	separator_(','),
+	attInitialTime_(""),
+	attFinalTime_(""),
+	attTimeUnit_(TeSECOND),
+	relatedTableId_(-1),
+	relatedAttribute_("")
+{
+	pImpl_ = new TeTableImpl;
+	pImpl_->refCount_ = 1;	
+}
+
+TeTable::TeTable(const string& name):
+	id_(-1),
+	name_(name),
+	type_(TeAttrStatic),
+	order_(-1),
+	attLink_(""),
+	attUnique_(""),
+	separator_(','),
+	attInitialTime_(""),
+	attFinalTime_(""),
+	attTimeUnit_(TeSECOND),
+	relatedTableId_(-1),
+	relatedAttribute_("")
+{
+	pImpl_ = new TeTableImpl;
+	pImpl_->refCount_ = 1;	
+}
+
+TeTable::TeTable(const string& name, const TeAttributeList& attList, const string& uniqueName,
+				 const string& linkName, TeAttrTableType tableType):
+	id_(-1),
+	name_(name),
+	type_(tableType),
+	order_(-1),
+	attList_(attList),
+	attLink_(linkName),
+	attUnique_(uniqueName),
+	separator_(','),
+	attInitialTime_(""),
+	attFinalTime_(""),
+	attTimeUnit_(TeSECOND),
+	relatedTableId_(-1),
+	relatedAttribute_("")
+{
+	pImpl_ = new TeTableImpl;
+	pImpl_->refCount_ = 1;	
+}
+
+TeTable::~TeTable()
+{
+	if ( --(pImpl_->refCount_) <= 0 )
+		delete pImpl_;	
+	attList_.clear();
+}
+
+// Copy constructor
+// copies the representation pointer
+// increments the reference counter
+
+TeTable::TeTable(const TeTable& other)
+{
+	id_= other.id_;
+	name_ = other.name_;
+	type_ = other.type_;
+	attLink_ = other.attLink_;
+	attUnique_ = other.attUnique_;
+	separator_ = other.separator_;
+	order_ = other.order_;
+	attInitialTime_ = other.attInitialTime_;
+	attFinalTime_ = other.attFinalTime_;
+	attTimeUnit_ = other.attTimeUnit_;
+	attList_.clear();
+	attList_.resize(other.attList_.size());
+	attList_=other.attList_;
+	relatedTableId_ = other.relatedTableId_;
+	relatedTableName_ = other.relatedTableName_;
+	relatedAttribute_ = other.relatedAttribute_;
+	pImpl_ = other.pImpl_;
+	pImpl_->refCount_++;
+}
+
+// Operator =
+// Copies the representation pointer
+// Decrements the reference counter of the current object
+// Increments the reference counter for the new object
+TeTable& 
+TeTable::operator=(const TeTable& rhs)
+{
+	if ( this != &rhs )
+	{
+		rhs.pImpl_->refCount_++;
+	
+		if ( --(pImpl_->refCount_) <= 0 )
+			delete pImpl_;
+		pImpl_ = rhs.pImpl_;
+
+		separator_ = rhs.separator_;
+		attLink_ = rhs.attLink_;
+		attUnique_ = rhs.attUnique_;
+		order_ = rhs.order_;
+		attInitialTime_ = rhs.attInitialTime_;
+		attFinalTime_ = rhs.attFinalTime_;
+		attTimeUnit_ = rhs.attTimeUnit_;
+		type_ = rhs.type_;
+		name_ = rhs.name_;	
+		attList_.clear();
+		attList_ = rhs.attList_;
+		relatedTableId_ = rhs.relatedTableId_;
+		relatedTableName_ = rhs.relatedTableName_;
+		relatedAttribute_ = rhs.relatedAttribute_;
+		id_ = rhs.id_;
+	}
+	return *this;
+}
+
+bool 
+TeTable::setTableType( TeAttrTableType attType, int relatedTableId, const string& relatedAttribute)
+{ 
+	type_ = attType; 
+	if ( attType == TeAttrExternal && relatedTableId > 0 && !relatedAttribute.empty())
+	{
+		relatedTableId_ = relatedTableId;
+		relatedAttribute_ = relatedAttribute;
+
+		return true;
+	}
+	return false;
+}
+
+void
+TeTable::add ( const TeTableRow& row )
+{
+	pImpl_->add ( row );
+}
+
+void
+TeTable::setValue (int row, int col, string& val)
+{
+	pImpl_->setValue (row,col,val);
+}
+
+unsigned int
+TeTable::size () const
+{
+	return pImpl_->size();
+}
+
+void TeTable::clear ()
+{
+	pImpl_->clear();
+}
+
+TeTableRow
+TeTable::operator [] (int i) const 
+{
+	return pImpl_->operator [] ( i );
+}
+
+string 
+TeTable::operator () ( int row, int col )
+{
+	return pImpl_->operator () (row, col );
+}
+
+
+bool
+TeTable::attrLink(TeAttribute& att)
+{	
+	TeAttributeList::iterator it = attList_.begin();
+	while (it != attList_.end())
+	{
+		if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(attLink_))
+		{
+			att = (*it);
+			return true;
+		}
+		++it;
+	}
+	return false;
+}
+
+bool 
+TeTable::attrUnique(TeAttribute& attr)
+{
+	TeAttributeList::iterator it = attList_.begin();
+	while(it!=attList_.end())
+	{
+		if(TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(attUnique_))
+		{
+			attr = (*it);
+			return true;
+		}
+		++it;
+	}
+	return false;
+}
+
+int
+TeTable::attrLinkPosition()
+{
+	int i = 0;
+	TeAttributeList::iterator it = attList_.begin();
+	while (it != attList_.end())
+	{
+		if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(attLink_))
+			return i;
+		++it;
+		++i;
+	}
+	return -1;
+}
+
+int
+TeTable::attrUniquePosition()
+{
+	int i = 0;
+	TeAttributeList::iterator it = attList_.begin();
+	while (it != attList_.end())
+	{
+		if (TeConvertToUpperCase((*it).rep_.name_) == TeConvertToUpperCase(attUnique_))
+			return i;
+		++it;
+		++i;
+	}
+	return -1;
+}
+
+bool 
+TeTable::attributeNames(vector<string>& attrs)
+{
+	attrs.clear();
+	TeAttributeList::iterator it = attList_.begin();
+	while(it!=attList_.end())
+	{
+		attrs.push_back((*it).rep_.name_);
+		++it;
+	}
+	return true;
+}
+
+
+void 
+TeTable::primaryKeys(vector<string>& keys)
+{
+	keys.empty();
+	TeAttributeList::iterator it = attList_.begin();
+	while(it!=attList_.end())
+	{
+		if((*it).rep_.isPrimaryKey_)
+			keys.push_back((*it).rep_.name_);
+		++it;
+	}
+	return;
+}
diff --git a/src/terralib/kernel/TeTable.h b/src/terralib/kernel/TeTable.h
old mode 100755
new mode 100644
index aa12604..278d996
--- a/src/terralib/kernel/TeTable.h
+++ b/src/terralib/kernel/TeTable.h
@@ -1,393 +1,401 @@
- /************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeTable.h
-    \brief This file contains class TeTable definitions.
-*/
-
-#ifndef  __TERRALIB_INTERNAL_TABLE_H
-#define  __TERRALIB_INTERNAL_TABLE_H
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include <string>
-#include <vector>
-#include "TeComposite.h"
-using namespace std;
-
-#include "TeAttribute.h"
-
-class TeTableImpl;
-
-//! A table row is a vector of strings
-typedef vector<string> TeTableRow;
-
-//! The table implementation, this is the body class, of the handle/body idiom
-/*!
-	All members are private. This class is used only through the TeTable class
-*/
-class TL_DLL TeTableImpl: public TeComposite<TeTableRow>
-{
-
-friend class TeTable;
-
-	int refCount_;
-
-	//! Empty constructor
-	TeTableImpl(): refCount_(0){}
-
-	//! Returns the value of a cell in table
-	string operator () ( int row, int col )
-	{
-		return components_[row].operator[] ( col );
-	}
-
-	void setValue (int row, int col, string& val)
-	{
-		TeTableRow tRow = components_[row];
-		if (col >= (int)(tRow.size()))
-			tRow.resize(col+1);
-		tRow[col] = val;
-		components_[row] = tRow;
-	}
-
-};
-
-//! An attribute table in memory
-/*!
-	Instances of this classes represent non-spatial tables, or tables
-	that don�t have a spatial data as one of its columns.
-	The class stores the table schema and it also can store rows of data.
-
-	Rows of data are stored according to handle/hody idiom, to make
-	copies optimized.
-
-  \sa
-  TeAttribute TeTableImpl
-*/
-class TL_DLL TeTable
-{
-public:
-	//! Empty constructor
-	/*!
-		\note
-		Instance of TeTable will be created with the following default values:
-		\arg name: "" (empty)
-		\arg id_:  -1 (no database identifier)
-        \arg type_: static attribute table
-		\arg attList: empty list of attributes
-        \arg attLink_:	"" (no index to geometries)
-        \arg attUnique_: "" (no unique values)
-		\arg separator_: ','  comma separator (used to read ASCII tables from files)
-		\arg attInitialTime_: ""  no initial time information
-		\arg attFinalTime_: ""  no final time information
-		\arg attTimeUnit_: TeYear 
-		\arg relatedTableId: -1 (no relation to other table)
-		\arg relatedTableName: "" (name of the related table)
-		\arg relatedAttribute: "" (attribute of the related table)
-	*/
-	TeTable();
-
-	//! Constructor by name
-	/*!
-		\param name table name
-		\note
-		Instance of TeTable will be created with the following default values:
-		\arg id_:  -1 (no database identifier)
-        \arg tableType_: static attribute table
-		\arg attList: empty list of attributes
-        \arg attLink_:	"" (no index to geometries)
-        \arg attUnique_: "" (no unique values)
-		\arg separator_: ','  comma separator (used to read ASCII tables from files)
-		\arg attInitialTime_: ""  no initial time information
-		\arg attFinalTime_: ""  no final time information
-		\arg attTimeUnit_: TeYear 
-		\arg relatedTableId: -1 (no relation to other table)
-		\arg relatedTableName: "" (name of the related table)
-		\arg relatedAttribute: "" (attribute of the related table)
-	*/
-	TeTable(const string& name);
-
-	//! Constructor by name and attribute list
-	/*!
-      \param name table name
-      \param attList list of attributes
-	  \param uniqueName column that unique attributes to be used as a primary key
-	  \param linkName column that links attributes to geometries
-	  \param tableType type of attribute table
-	  \note
-		Instance of TeTable will be created with the following default values:
-	   \arg id_:  -1 (no database identifier)
-	   \arg separator_: ','  comma separator (used to read ASCII tables from files)
-	   \arg attInitialTime_: ""  no initial time information
-	   \arg attFinalTime_: ""  no final time information
-	   \arg attTimeUnit_: TeYear 
-	   \arg relatedTableId: -1 (no relation to other table)
-	   \arg relatedTableName: "" (name of the related table)
-	   \arg relatedAttribute: "" (attribute of the related table)
-	*/
-	TeTable(const string& name, const TeAttributeList& attList, const string& uniqueName,
-			const string& linkName="", TeAttrTableType tableType=TeAttrStatic);
-
-	 //! Destructor
-	~TeTable();
-
-	//! Copy Constructor
-	/*! Copies the representation pointer increments the reference counter	*/
-	TeTable(const TeTable&);
-
-	//! Operator =
-	/*!
-		Copies the representation pointer
-		Decrements the reference counter of the current object
-		Increments the reference counter for the new object
-	*/
-	TeTable& operator=(const TeTable&);
-
-// -- Methods
-
-	//! Returns the table name
-	string name()
-	{ return name_; }
-
-	//! Sets the table name
-	void name(const string& n)
-	{ name_ = n; }
-
-	//! Returns the unique id of the table in a database
-	int id() { return id_; }
-
-	//! Sets the id of the table
-	void setId(int n) { id_ = n; }
-
-	//! Set the position of the table in a join
-	void setOrder(int n) { order_ = n; }
-
-	//! Get the position of the table in a join
-	int getOrder() { return order_;}
-	
-	//! Defines the list of attributes of this table
-	void setAttributeList ( const TeAttributeList& attList)
-	{ attList_ = attList; }
-
-	//! Retrieves the list of attributes of this table
-	TeAttributeList& attributeList()
-	{ return attList_; }
-
-	//! Retrieves the list of attribute names of this table
-	bool attributeNames(vector<string>& attrs);
-	
-	//! Returns the type of this attribute table
-	TeAttrTableType tableType()
-	{ return type_; }
-
-	//! Sets the table separator
-	void setSeparator ( const char& c )
-	{ separator_ = c ; }
-
-	//! Returns the table separator
-	char separator ()
-	{ return separator_; }
-
-	//! Sets the table type
-	/*!
-      \param attType table type
-	  \note In case of external tables
-      \param relatedTableId is the id of the related table 
-	  \param relatedAttribute is column name of the related table
-	*/
-	bool setTableType( TeAttrTableType attType, int relatedTableId=-1, const string& relatedAttribute="");
-
-	//! Sets an attribute as the table index.
-	/*!
-		Index in this context, means an attribute that is a link between
-		the attribute table and a spatial table (a table of geometrical
-		representation of objects).
-	*/
-	void setLinkName ( const string& linkName ) { attLink_ = linkName;}
-
-	//! Returns the name of the column used as link between the attribute table and a spatial table
-	string linkName()
-	{	return attLink_; }
-
-	//! Sets the name of the column that has unique values
-	void setUniqueName ( const string& uniqueName ) { attUnique_ = uniqueName; }	
-
-	//! Returns the name of the column used as primary key
-	string uniqueName()
-	{	return attUnique_;	}
-
-	//! If there is one, returns the attribute used as an index
-	/*!
-		\param att to return the attribute used as an index
-		\return TRUE if there is an index, FALSE otherwise
-	*/
-	bool attrLink(TeAttribute& att);
-
-	//! If there is one, returns the attribute used as primary key
-	/*!
-		\param attr to return the attribute used as primary key
-		\return TRUE if there is an index, FALSE otherwise
-	*/
-	bool attrUnique(TeAttribute& attr);
-	
-	//! Returns the position of the link attribute in the attribute list
-	int attrLinkPosition();
-
-	//! Returns the position of the unique attribute in the attribute list
-	int attrUniquePosition();
-
-	/** @name External tables
-	    The following members are used to manipulate information about tables that
-		are external: don�t have a direct link to geometries, but can be linked by
-		a column to another attribute table
-	*/
-	//@{
-	//! Sets the  id of a table to which this is related (only for TeAttrExternal tables)
-	void relatedTableId(int id)
-	{   relatedTableId_ = id; }
-
-	//! Returns the id of a related table (only for TeAttrExternal tables)
-	int relatedTableId()
-	{   return relatedTableId_; }
-
-	//! Sets the name of a table to which this is related (only for TeAttrExternal tables)
-	void relatedTableName(string tableName)
-	{   relatedTableName_ = tableName; }
-
-	//! Returns the name of a related table (only for TeAttrExternal tables)
-	string relatedTableName()
-	{   return relatedTableName_; }
-
-	//! Set the name of a column to link to a related table (only for TeAttrExternal tables)
-	void relatedAttribute(const string& columnName)
-	{	relatedAttribute_ = columnName; }
-
-	//! Return the column that links to a related table (only for TeAttrExternal tables)
-	string relatedAttribute()
-	{ return relatedAttribute_; }
-
-	//@}
-
-	/** @name Temporal Attributes
-	    The following members are used to manipulate the attribute tables with temporal
-		information.
-		\par Temporal tables contains columns to store a time interval in which the 
-		 attributes (or a row) of an object is valid.
-	*/
-	//@{		
-
-	//! Sets the name of the column that has the initial time of the validity interval
-	void attInitialTime(const string& t)
-	{	attInitialTime_ = t; }
-
-	//! Returns the name of the column that has the initial time of the validity interval
-	string attInitialTime()
-	{	return attInitialTime_; }
-
-	//! Sets the name of the column that has the final time of the validity interval
-	void attFinalTime(const string& t)
-	{	attFinalTime_ = t; }
-
-	//! Returns the name of the column that has the final time of the validity interval
-	string attFinalTime()
-	{	return attFinalTime_; }
-
-	//! Sets the time unit relative to the validity interval
-	void attTimeUnit(TeChronon t)
-	{	attTimeUnit_ = t; }
-
-	//! Returns the time unit relative to the validity interval
-	TeChronon attTimeUnit()
-	{	return attTimeUnit_; }
-	//@}
-
-	/** @name Data in Memory
-	    The following members are used to manipulate rows of the table in memory
-	*/
-	//@{
-	//! Add a row to a table
-	void add ( const TeTableRow& row );
-
-	//! Returns the i-th row
-	TeTableRow operator [] ( int row ) ;
-
-	//! Returns the element indexed by (row,col)
-	string operator () ( int row, int col );
-
-	//! Sets the value of a cell indexed by row x col to value val
-	void setValue (int row, int col, string& val);
-
-	//! Returns the number of rows in a table
-	unsigned int size ();
-
-	//! Clears the table storage in memory
-	void clear ();
-	//@}
-
-	//! Returns the primary key names of the table 
-	void primaryKeys(vector<string>& keys);
-
-private:
-	
-	int					id_;	// unique id from a database where this table may be stored
-	string				name_;	// name
-	TeAttrTableType		type_;	// type of table
-	int					order_; // the table position relative to others in a join 
-
-	TeAttributeList		attList_;		// list of attributes
-	string				attLink_;		// attribute that links objects to their spatial representation
-										// in case of external table it is used to link to the related table
-	string				attUnique_;		// primary key 
-	char                separator_;		// in case of CSV table 
-
-// --- The following attributes are relative to tables with temporal information
- 
-	string		attInitialTime_;	// initial time attribute
-	string		attFinalTime_;		// final time attribute
-	TeChronon	attTimeUnit_;		// time granularity
-
-// --- The following attributes are relative to external tables
- 	int		relatedTableId_;	// id of a table to which this is related	
- 	string	relatedTableName_;	// name of a table to which this is related	
-	string  relatedAttribute_;	// column name of table which this is related
-
-// -- Table Implementation
-	TeTableImpl* pImpl_;		// the rows of a table
-
-};
-
-//! A vector of tables
-typedef vector<TeTable> TeAttrTableVector;
-
-//! Return the sql join related with the table vector  
-TL_DLL string tableJoin(TeAttrTableVector& vecTable, string firstTable="", string attrLink=""); 
-
-/*! \example createTable.cpp
-	Shows how to execute some operations relative to attribute tables.
- */
-
-#endif
-
-
+ /************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeTable.h
+    \brief This file contains class TeTable definitions.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_TABLE_H
+#define  __TERRALIB_INTERNAL_TABLE_H
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include <string>
+#include <vector>
+#include "TeComposite.h"
+using namespace std;
+
+#include "TeAttribute.h"
+
+class TeTableImpl;
+
+//! A table row is a vector of strings
+typedef vector<string> TeTableRow;
+
+//! The table implementation, this is the body class, of the handle/body idiom
+/*!
+	All members are private. This class is used only through the TeTable class
+*/
+class TL_DLL TeTableImpl: public TeComposite<TeTableRow>
+{
+
+friend class TeTable;
+
+	int refCount_;
+
+	//! Empty constructor
+	TeTableImpl(): refCount_(0){}
+
+	//! Returns the value of a cell in table
+	string operator () ( int row, int col )
+	{
+		return components_[row].operator[] ( col );
+	}
+
+	void setValue (int row, int col, string& val)
+	{
+		TeTableRow tRow = components_[row];
+		if (col >= (int)(tRow.size()))
+			tRow.resize(col+1);
+		tRow[col] = val;
+		components_[row] = tRow;
+	}
+
+};
+
+//! An attribute table in memory
+/*!
+	Instances of this classes represent non-spatial tables, or tables
+	that don�t have a spatial data as one of its columns.
+	The class stores the table schema and it also can store rows of data.
+
+	Rows of data are stored according to handle/hody idiom, to make
+	copies optimized.
+
+  \sa
+  TeAttribute TeTableImpl
+*/
+class TL_DLL TeTable
+{
+public:
+	//! Empty constructor
+	/*!
+		\note
+		Instance of TeTable will be created with the following default values:
+		\arg name: "" (empty)
+		\arg id_:  -1 (no database identifier)
+        \arg type_: static attribute table
+		\arg attList: empty list of attributes
+        \arg attLink_:	"" (no index to geometries)
+        \arg attUnique_: "" (no unique values)
+		\arg separator_: ','  comma separator (used to read ASCII tables from files)
+		\arg attInitialTime_: ""  no initial time information
+		\arg attFinalTime_: ""  no final time information
+		\arg attTimeUnit_: TeYear 
+		\arg relatedTableId: -1 (no relation to other table)
+		\arg relatedTableName: "" (name of the related table)
+		\arg relatedAttribute: "" (attribute of the related table)
+	*/
+	TeTable();
+
+	//! Constructor by name
+	/*!
+		\param name table name
+		\note
+		Instance of TeTable will be created with the following default values:
+		\arg id_:  -1 (no database identifier)
+        \arg tableType_: static attribute table
+		\arg attList: empty list of attributes
+        \arg attLink_:	"" (no index to geometries)
+        \arg attUnique_: "" (no unique values)
+		\arg separator_: ','  comma separator (used to read ASCII tables from files)
+		\arg attInitialTime_: ""  no initial time information
+		\arg attFinalTime_: ""  no final time information
+		\arg attTimeUnit_: TeYear 
+		\arg relatedTableId: -1 (no relation to other table)
+		\arg relatedTableName: "" (name of the related table)
+		\arg relatedAttribute: "" (attribute of the related table)
+	*/
+	TeTable(const string& name);
+
+	//! Constructor by name and attribute list
+	/*!
+      \param name table name
+      \param attList list of attributes
+	  \param uniqueName column that unique attributes to be used as a primary key
+	  \param linkName column that links attributes to geometries
+	  \param tableType type of attribute table
+	  \note
+		Instance of TeTable will be created with the following default values:
+	   \arg id_:  -1 (no database identifier)
+	   \arg separator_: ','  comma separator (used to read ASCII tables from files)
+	   \arg attInitialTime_: ""  no initial time information
+	   \arg attFinalTime_: ""  no final time information
+	   \arg attTimeUnit_: TeYear 
+	   \arg relatedTableId: -1 (no relation to other table)
+	   \arg relatedTableName: "" (name of the related table)
+	   \arg relatedAttribute: "" (attribute of the related table)
+	*/
+	TeTable(const string& name, const TeAttributeList& attList, const string& uniqueName,
+			const string& linkName="", TeAttrTableType tableType=TeAttrStatic);
+
+	 //! Destructor
+	~TeTable();
+
+	//! Copy Constructor
+	/*! Copies the representation pointer increments the reference counter	*/
+	TeTable(const TeTable&);
+
+	//! Operator =
+	/*!
+		Copies the representation pointer
+		Decrements the reference counter of the current object
+		Increments the reference counter for the new object
+	*/
+	TeTable& operator=(const TeTable&);
+
+// -- Methods
+
+	//! Returns the table name
+	const string& name() const
+	{ return name_; }
+
+  //! Returns the table name
+	string name()
+	{ return name_; }
+
+	//! Sets the table name
+	void name(const string& n)
+	{ name_ = n; }
+
+	//! Returns the unique id of the table in a database
+	int id() { return id_; }
+
+	//! Sets the id of the table
+	void setId(int n) { id_ = n; }
+
+	//! Set the position of the table in a join
+	void setOrder(int n) { order_ = n; }
+
+	//! Get the position of the table in a join
+	int getOrder() { return order_;}
+	
+	//! Defines the list of attributes of this table
+	void setAttributeList ( const TeAttributeList& attList)
+	{ attList_ = attList; }
+
+	//! Retrieves the list of attributes of this table
+	TeAttributeList& attributeList()
+	{ return attList_; }
+
+  //! Retrieves the list of attributes of this table
+  const TeAttributeList& attributeList() const
+	{ return attList_; }
+
+	//! Retrieves the list of attribute names of this table
+	bool attributeNames(vector<string>& attrs);
+	
+	//! Returns the type of this attribute table
+	TeAttrTableType tableType()
+	{ return type_; }
+
+	//! Sets the table separator
+	void setSeparator ( const char& c )
+	{ separator_ = c ; }
+
+	//! Returns the table separator
+	char separator ()
+	{ return separator_; }
+
+	//! Sets the table type
+	/*!
+      \param attType table type
+	  \note In case of external tables
+      \param relatedTableId is the id of the related table 
+	  \param relatedAttribute is column name of the related table
+	*/
+	bool setTableType( TeAttrTableType attType, int relatedTableId=-1, const string& relatedAttribute="");
+
+	//! Sets an attribute as the table index.
+	/*!
+		Index in this context, means an attribute that is a link between
+		the attribute table and a spatial table (a table of geometrical
+		representation of objects).
+	*/
+	void setLinkName ( const string& linkName ) { attLink_ = linkName;}
+
+	//! Returns the name of the column used as link between the attribute table and a spatial table
+	string linkName()
+	{	return attLink_; }
+
+	//! Sets the name of the column that has unique values
+	void setUniqueName ( const string& uniqueName ) { attUnique_ = uniqueName; }	
+
+	//! Returns the name of the column used as primary key
+	string uniqueName()
+	{	return attUnique_;	}
+
+	//! If there is one, returns the attribute used as an index
+	/*!
+		\param att to return the attribute used as an index
+		\return TRUE if there is an index, FALSE otherwise
+	*/
+	bool attrLink(TeAttribute& att);
+
+	//! If there is one, returns the attribute used as primary key
+	/*!
+		\param attr to return the attribute used as primary key
+		\return TRUE if there is an index, FALSE otherwise
+	*/
+	bool attrUnique(TeAttribute& attr);
+	
+	//! Returns the position of the link attribute in the attribute list
+	int attrLinkPosition();
+
+	//! Returns the position of the unique attribute in the attribute list
+	int attrUniquePosition();
+
+	/** @name External tables
+	    The following members are used to manipulate information about tables that
+		are external: don�t have a direct link to geometries, but can be linked by
+		a column to another attribute table
+	*/
+	//@{
+	//! Sets the  id of a table to which this is related (only for TeAttrExternal tables)
+	void relatedTableId(int id)
+	{   relatedTableId_ = id; }
+
+	//! Returns the id of a related table (only for TeAttrExternal tables)
+	int relatedTableId()
+	{   return relatedTableId_; }
+
+	//! Sets the name of a table to which this is related (only for TeAttrExternal tables)
+	void relatedTableName(string tableName)
+	{   relatedTableName_ = tableName; }
+
+	//! Returns the name of a related table (only for TeAttrExternal tables)
+	string relatedTableName()
+	{   return relatedTableName_; }
+
+	//! Set the name of a column to link to a related table (only for TeAttrExternal tables)
+	void relatedAttribute(const string& columnName)
+	{	relatedAttribute_ = columnName; }
+
+	//! Return the column that links to a related table (only for TeAttrExternal tables)
+	string relatedAttribute()
+	{ return relatedAttribute_; }
+
+	//@}
+
+	/** @name Temporal Attributes
+	    The following members are used to manipulate the attribute tables with temporal
+		information.
+		\par Temporal tables contains columns to store a time interval in which the 
+		 attributes (or a row) of an object is valid.
+	*/
+	//@{		
+
+	//! Sets the name of the column that has the initial time of the validity interval
+	void attInitialTime(const string& t)
+	{	attInitialTime_ = t; }
+
+	//! Returns the name of the column that has the initial time of the validity interval
+	string attInitialTime()
+	{	return attInitialTime_; }
+
+	//! Sets the name of the column that has the final time of the validity interval
+	void attFinalTime(const string& t)
+	{	attFinalTime_ = t; }
+
+	//! Returns the name of the column that has the final time of the validity interval
+	string attFinalTime()
+	{	return attFinalTime_; }
+
+	//! Sets the time unit relative to the validity interval
+	void attTimeUnit(TeChronon t)
+	{	attTimeUnit_ = t; }
+
+	//! Returns the time unit relative to the validity interval
+	TeChronon attTimeUnit()
+	{	return attTimeUnit_; }
+	//@}
+
+	/** @name Data in Memory
+	    The following members are used to manipulate rows of the table in memory
+	*/
+	//@{
+	//! Add a row to a table
+	void add ( const TeTableRow& row );
+
+	//! Returns the i-th row
+	TeTableRow operator [] ( int row ) const;
+
+	//! Returns the element indexed by (row,col)
+	string operator () ( int row, int col );
+
+	//! Sets the value of a cell indexed by row x col to value val
+	void setValue (int row, int col, string& val);
+
+	//! Returns the number of rows in a table
+	unsigned int size () const;
+
+	//! Clears the table storage in memory
+	void clear ();
+	//@}
+
+	//! Returns the primary key names of the table 
+	void primaryKeys(vector<string>& keys);
+
+private:
+	
+	int					id_;	// unique id from a database where this table may be stored
+	string				name_;	// name
+	TeAttrTableType		type_;	// type of table
+	int					order_; // the table position relative to others in a join 
+
+	TeAttributeList		attList_;		// list of attributes
+	string				attLink_;		// attribute that links objects to their spatial representation
+										// in case of external table it is used to link to the related table
+	string				attUnique_;		// primary key 
+	char                separator_;		// in case of CSV table 
+
+// --- The following attributes are relative to tables with temporal information
+ 
+	string		attInitialTime_;	// initial time attribute
+	string		attFinalTime_;		// final time attribute
+	TeChronon	attTimeUnit_;		// time granularity
+
+// --- The following attributes are relative to external tables
+ 	int		relatedTableId_;	// id of a table to which this is related	
+ 	string	relatedTableName_;	// name of a table to which this is related	
+	string  relatedAttribute_;	// column name of table which this is related
+
+// -- Table Implementation
+	TeTableImpl* pImpl_;		// the rows of a table
+
+};
+
+//! A vector of tables
+typedef vector<TeTable> TeAttrTableVector;
+
+//! Return the sql join related with the table vector  
+TL_DLL string tableJoin(TeAttrTableVector& vecTable, string firstTable="", string attrLink=""); 
+
+/*! \example createTable.cpp
+	Shows how to execute some operations relative to attribute tables.
+ */
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeTempFilesRemover.cpp b/src/terralib/kernel/TeTempFilesRemover.cpp
old mode 100755
new mode 100644
index 8b7a552..f523682
--- a/src/terralib/kernel/TeTempFilesRemover.cpp
+++ b/src/terralib/kernel/TeTempFilesRemover.cpp
@@ -1,137 +1,129 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeTempFilesRemover.h"
-#include "TeAgnostic.h"
-
-
-TeTempFilesRemover::TeTempFilesRemover()
-{
-}
-
-
-TeTempFilesRemover::~TeTempFilesRemover()
-{
-  removeAllFiles();
-}
-
-void TeTempFilesRemover::addFile( const std::string& fullFileName )
-{
-  if( ! fullFileName.empty() )
-  {
-    ListNode newNode;
-    newNode.filePtr_ = 0;
-    newNode.fullFileName_ = fullFileName;
-    
-    filesNamesList_.push_back( newNode );
-  }
-}
-      
-void TeTempFilesRemover::addFile( const std::string& fullFileName, 
-  FILE* filePtr )
-{
-  if( ! fullFileName.empty() )
-  {
-    ListNode newNode;
-    newNode.filePtr_ = filePtr;
-    newNode.fullFileName_ = fullFileName;
-    
-    filesNamesList_.push_back( newNode );
-  }
-}
-      
-void TeTempFilesRemover::removeFileName( const std::string& fullFileName )
-{
-  if( ! fullFileName.empty() )
-  {
-    std::list< ListNode >::iterator it = filesNamesList_.begin();
-    std::list< ListNode >::iterator itEnd = filesNamesList_.end();
-    std::list< ListNode >::iterator itAux;
-  
-    while( it != itEnd )
-    {
-      if( it->fullFileName_ == fullFileName )
-      {
-        itAux = it;
-        --itAux;
-        
-        filesNamesList_.erase( it );
-        
-        it = itAux;
-      }
-          
-      ++it;
-    }
-  }
-}
-      
-void TeTempFilesRemover::removeFile( const std::string& fullFileName )
-{
-  if( ! fullFileName.empty() )
-  {
-    std::list< ListNode >::iterator it = filesNamesList_.begin();
-    std::list< ListNode >::iterator itEnd = filesNamesList_.end();
-    std::list< ListNode >::iterator itAux;
-  
-    while( it != itEnd )
-    {
-      if( it->fullFileName_ == fullFileName )
-      {
-        if( it->filePtr_ )
-          fclose( it->filePtr_ );
-        
-        remove( it->fullFileName_.c_str() );
-            
-        itAux = it;
-        --itAux;
-        
-        filesNamesList_.erase( it );
-        
-        it = itAux;
-      }
-          
-      ++it;
-    }
-  }
-}
-
-void TeTempFilesRemover::removeAllFiles()
-{
-  std::list< ListNode >::iterator it = filesNamesList_.begin();
-  std::list< ListNode >::iterator itEnd = filesNamesList_.end();
-
-  while( it != itEnd )
-  {
-    if( it->filePtr_ )
-      fclose( it->filePtr_ );
-    
-    remove( it->fullFileName_.c_str() );
-        
-    ++it;
-  }
-  
-  filesNamesList_.clear();
-}
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeTempFilesRemover.h"
+#include "TeAgnostic.h"
+
+
+TeTempFilesRemover::TeTempFilesRemover()
+{
+}
+
+
+TeTempFilesRemover::~TeTempFilesRemover()
+{
+  removeAllFiles();
+}
+
+void TeTempFilesRemover::addFile( const std::string& fullFileName )
+{
+  if( ! fullFileName.empty() )
+  {
+    ListNode newNode;
+    newNode.filePtr_ = 0;
+    newNode.fullFileName_ = fullFileName;
+    
+    filesNamesList_.push_back( newNode );
+  }
+}
+      
+void TeTempFilesRemover::addFile( const std::string& fullFileName, 
+  FILE* filePtr )
+{
+  if( ! fullFileName.empty() )
+  {
+    ListNode newNode;
+    newNode.filePtr_ = filePtr;
+    newNode.fullFileName_ = fullFileName;
+    
+    filesNamesList_.push_back( newNode );
+  }
+}
+      
+void TeTempFilesRemover::removeFileName( const std::string& fullFileName )
+{
+  if( ! fullFileName.empty() )
+  {
+    std::list< ListNode >::iterator it = filesNamesList_.begin();
+    std::list< ListNode >::iterator itEnd = filesNamesList_.end();
+      
+    while( it != itEnd )
+    {
+      if( it->fullFileName_ == fullFileName )
+      {
+        filesNamesList_.erase( it );
+        
+		return;
+      }
+          
+      ++it;
+    }
+  }
+}
+      
+void TeTempFilesRemover::removeFile( const std::string& fullFileName )
+{
+  if( ! fullFileName.empty() )
+  {
+    std::list< ListNode >::iterator it = filesNamesList_.begin();
+    std::list< ListNode >::iterator itEnd = filesNamesList_.end();
+      
+    while( it != itEnd )
+    {
+      if( it->fullFileName_ == fullFileName )
+      {
+        if( it->filePtr_ )
+          fclose( it->filePtr_ );
+        
+        remove( it->fullFileName_.c_str() );
+        
+        filesNamesList_.erase( it );
+        
+		return;
+      }
+          
+      ++it;
+    }
+  }
+}
+
+void TeTempFilesRemover::removeAllFiles()
+{
+  std::list< ListNode >::iterator it = filesNamesList_.begin();
+  std::list< ListNode >::iterator itEnd = filesNamesList_.end();
+
+  while( it != itEnd )
+  {
+    if( it->filePtr_ )
+      fclose( it->filePtr_ );
+    
+    remove( it->fullFileName_.c_str() );
+        
+    ++it;
+  }
+  
+  filesNamesList_.clear();
+}
+
+
+
diff --git a/src/terralib/kernel/TeTempFilesRemover.h b/src/terralib/kernel/TeTempFilesRemover.h
old mode 100755
new mode 100644
index 67b8a37..18691b0
--- a/src/terralib/kernel/TeTempFilesRemover.h
+++ b/src/terralib/kernel/TeTempFilesRemover.h
@@ -1,93 +1,93 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeTempFilesRemover.h
-    \brief Temporary files remover.
-*/
-
-#ifndef TETEMPFILEREMOVER_H
-  #define TETEMPFILEREMOVER_H
-  
-  #include "TeSingleton.h"
-  #include "TeDefines.h"
-
-  #include <stdio.h>
-  #include <string>
-  #include <list>
-
-  /*!
-   * \class TeTempFilesRemover
-   * \brief Hold Temporary files references for file system remotion when 
-   * appropriate or when the singleton is destroyed.
-   * \author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * \ingroup Utils
-   */
-  class TL_DLL TeTempFilesRemover : public TeSingleton< TeTempFilesRemover >
-  {
-    public :
-      
-      TeTempFilesRemover();
-      
-      /*! Add a file to be removed.
-       * \param fullFileName Full file name.
-       */
-      void addFile( const std::string& fullFileName );
-      
-      /*! Add a file to be removed.
-       * \param fullFileName Full file name.
-       * \param filePtr File pointer.
-       * \note The file will be closed just before its deletion.
-       */      
-      void addFile( const std::string& fullFileName, FILE* filePtr );
-      
-      /*! Remove the file reference - The file will not be deleted from
-       * the file system.
-       * \param fullFileName Full file name.
-       */      
-      void removeFileName( const std::string& fullFileName );
-      
-      /*! Remove the file reference and delete it from
-       * the file system.
-       * \param fullFileName Full file name.
-       */       
-      void removeFile( const std::string& fullFileName );
-      
-      /*! Remove all files reference and also from the from
-       * the file system.
-       * \param fullFileName Full file name.
-       */        
-      void removeAllFiles();
-      
-      ~TeTempFilesRemover();
-      
-    protected :
-      
-      struct ListNode
-      {
-        FILE* filePtr_;
-        std::string fullFileName_;
-      };
-      
-      std::list< ListNode > filesNamesList_;
-  };
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeTempFilesRemover.h
+    \brief Temporary files remover.
+*/
+
+#ifndef TETEMPFILEREMOVER_H
+  #define TETEMPFILEREMOVER_H
+  
+  #include "TeSingleton.h"
+  #include "TeDefines.h"
+
+  #include <stdio.h>
+  #include <string>
+  #include <list>
+
+  /*!
+   * \class TeTempFilesRemover
+   * \brief Hold Temporary files references for file system remotion when 
+   * appropriate or when the singleton is destroyed.
+   * \author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * \ingroup Utils
+   */
+  class TL_DLL TeTempFilesRemover : public TeSingleton< TeTempFilesRemover >
+  {
+    public :
+      
+      TeTempFilesRemover();
+      
+      /*! Add a file to be removed.
+       * \param fullFileName Full file name.
+       */
+      void addFile( const std::string& fullFileName );
+      
+      /*! Add a file to be removed.
+       * \param fullFileName Full file name.
+       * \param filePtr File pointer.
+       * \note The file will be closed just before its deletion.
+       */      
+      void addFile( const std::string& fullFileName, FILE* filePtr );
+      
+      /*! Remove the file reference - The file will not be deleted from
+       * the file system.
+       * \param fullFileName Full file name.
+       */      
+      void removeFileName( const std::string& fullFileName );
+      
+      /*! Remove the file reference and delete it from
+       * the file system.
+       * \param fullFileName Full file name.
+       */       
+      void removeFile( const std::string& fullFileName );
+      
+      /*! Remove all files reference and also from the from
+       * the file system.
+       * \param fullFileName Full file name.
+       */        
+      void removeAllFiles();
+      
+      ~TeTempFilesRemover();
+      
+    protected :
+      
+      struct ListNode
+      {
+        FILE* filePtr_;
+        std::string fullFileName_;
+      };
+      
+      std::list< ListNode > filesNamesList_;
+  };
+
+#endif
diff --git a/src/terralib/kernel/TeTemporalSeries.cpp b/src/terralib/kernel/TeTemporalSeries.cpp
old mode 100755
new mode 100644
index a34d713..638a6fb
--- a/src/terralib/kernel/TeTemporalSeries.cpp
+++ b/src/terralib/kernel/TeTemporalSeries.cpp
@@ -1,290 +1,290 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeTemporalSeries.h"
-#include "TeDatabase.h"
-
-
-TeTSEntry::TeTSEntry(const double& val, TeTimeInterval& time, int timeFrame, int nItens, TeTSDataType dType)
-{
-	timeFrame_= timeFrame;
-	value_ = val;
-	type_ = dType;
-	nItens_ = nItens;
-	time_ = time;
-	timeInt_ = -1;
-
-	if (time.intervalChronon()==TeMONTHOFYEAR) 
-		timeInt_ = time.getT1().month();
-	else if(time.intervalChronon()==TeDAYOFMONTH)
-		timeInt_ = time.getT1().day();
-	else if(time.intervalChronon()==TeDAYOFWEEK)
-		timeInt_ = time.getT1().weekDay();
-	else if(time.intervalChronon()==TeDAYOFYEAR)
-		timeInt_ = time.getT1().yearDay();
-	else if(time.intervalChronon()==TeHOUROFDAY)
-		timeInt_ = time.getT1().hour();
-	else if(time.intervalChronon()==TeMINUTEOFHOUR)
-		timeInt_ = time.getT1().minute();
-	else if(time.intervalChronon()==TeSECONDOFMINUTE)
-		timeInt_ = time.getT1().hour();
-}
-
-
-
-TeTSEntry& 
-TeTSEntry::operator=(const TeTSEntry& other)
-{
-	if ( this != &other )
-	{
-		timeFrame_ = other.timeFrame_;
-		value_ = other.value_;
-		time_ = other.time_;
-		nItens_ = other.nItens_;
-		type_ = other.type_;
-		timeInt_ = other.timeInt_;
-	}
-	return (*this);
-}
-
-TeTSParams& 
-TeTSParams::operator=(const TeTSParams& other)
-{
-	if ( this != &other )
-	{
-		type_ = other.type_;
-  		chronon_ = other.chronon_;
-  		time_ = other.time_; 
-  		timeOper_ = other.timeOper_;
-  		spatOper_ = other.spatOper_;
-  	  	orTheme_ = other.orTheme_;
-		objectId_ = other.objectId_;
-  		attrTable_ = other.attrTable_;	
-		attrColumn_ = other.attrColumn_;
-	}
-	return (*this);
-}
-
-
-TeTemporalSeries& 
-TeTemporalSeries::operator=(const TeTemporalSeries& other)
-{
-	if ( this != &other )
-	{
-		TSparams_ = other.TSparams_;
-		series_ = other.series_;
-	}
-	return (*this);
-}
-
-
-bool 
-TeTemporalSeries::getTSEntry(TeTSEntry& ts, unsigned int frame)
-{
-	if(frame >= (series_.size()))
-		return false;
-
-	ts = series_[frame];
-	return true;
-}
-
-bool 
-TeTemporalSeries::buildFrameIntervals()
-{
-	// ----- information about temporal table 
-	TeTable tempTable;
-	TeDatabase* db = TSparams_.orTheme_->layer()->database();
-
-	if(!TSparams_.orTheme_->getTemporalTable(tempTable))
-		return false;
-
-	TSparams_.attrTable_ = tempTable.name();
-	string initialtime = tempTable.name() +"."+ tempTable.attInitialTime(); 
-	string finaltime = tempTable.name() +"."+ tempTable.attFinalTime(); 
-
-	TeTime iTime, fTime;
-	
-	// ----- fill time interval
-	// ---------------------------- you don�t know how many time frames will be generated
-
-	if(	(TSparams_.chronon_==TeYEAR)   || (TSparams_.chronon_==TeMONTH) ||
-		(TSparams_.chronon_==TeDAY)    || (TSparams_.chronon_==TeHOUR)  ||
-		(TSparams_.chronon_==TeMINUTE) || (TSparams_.chronon_==TeSECOND) )
-	{
-		
-		string fromClause, whereClause;
-		if(!db->tableExist(TSparams_.orTheme_->collectionAuxTable()))
-		{
-			TeAttrTableVector atts; 
-			TSparams_.orTheme_->getAttTables(atts); 
-			if(atts.empty())
-				return false;
-
-			fromClause = " FROM " + tableJoin(atts);
-			whereClause = TSparams_.orTheme_->sqlWhereRestrictions();
-		}
-		else
-		{
-			//fromClause = TSparams_.orTheme_->sqlGridFrom();
-			string collAuxTable = TSparams_.orTheme_->collectionAuxTable();
-			string uniqueIdName = tempTable.name() +"."+ tempTable.uniqueName(); 
-			string objectIdName = tempTable.name() +"."+ tempTable.linkName(); 
-
-			fromClause = " FROM "+ tempTable.name()+" RIGHT JOIN "+ collAuxTable; 
-			
-			if(tempTable.tableType()==TeFixedGeomDynAttr)
-			{
-				fromClause += " ON "+ uniqueIdName +" = ";
-				fromClause += collAuxTable +".aux0";
-			}
-			else
-			{
-				fromClause += " ON "+ objectIdName +" = ";
-				fromClause += collAuxTable +".object_id";
-			}
-		}
-
-		string sql = " SELECT min("+ initialtime +"), max("+ finaltime +") ";
-		sql += fromClause;	
-		
-		if(!whereClause.empty())
-			sql += " WHERE "+ whereClause;
-
-		TeDatabasePortal* portal = db->getPortal();
-		if(!portal)
-			return false;
-
-		if((!portal->query(sql)) || (!portal->fetchRow()))
-		{
-			delete portal;
-			return false;
-		}
-
-		//fill the temporal series
-        TeTime date1 =  portal->getDate(0);
-        TeTime date2 =  portal->getDate(1);
-		TeTimeInterval interval(date1, date2);
-		interval.intervalChronon(TSparams_.chronon_); //min/max
-
-		iTime = interval.getT1();
- 		fTime = interval.getT2();
-
-		delete (portal);
-	}
-
-	// ---------------------------- you know how many time frames will be generated
-
-	else if (TSparams_.chronon_==TeMONTHOFYEAR) 
-	{
-		TeTime t1("01/01/2001", TeMONTHOFYEAR, "DDsMMsYYYY");
-		TeTime t2("01/12/2001", TeMONTHOFYEAR, "DDsMMsYYYY");
-		iTime = t1;
-		fTime = t2;
-	}
-	else if(TSparams_.chronon_==TeDAYOFMONTH)
-	{
-		TeTime t1("01/01/2001", TeDAYOFMONTH, "DDsMMsYYYY");
-		TeTime t2("31/01/2001", TeDAYOFMONTH, "DDsMMsYYYY");
-		iTime = t1;
-		fTime = t2;
-	}
-	else if(TSparams_.chronon_==TeDAYOFWEEK)
-	{
-		TeTime t1("07/01/2001", TeDAYOFWEEK, "DDsMMsYYYY");
-		TeTime t2("13/01/2001", TeDAYOFWEEK, "DDsMMsYYYY");
-		iTime = t1;
-		fTime = t2;
-	}
-	else if(TSparams_.chronon_==TeDAYOFYEAR)
-	{
-		TeTime t1("01/01/2001", TeDAYOFYEAR, "DDsMMsYYYY");
-		TeTime t2("31/12/2001", TeDAYOFYEAR, "DDsMMsYYYY");
-		iTime = t1;
-		fTime = t2;
-	}
-	else if(TSparams_.chronon_==TeHOUROFDAY)
-	{
-		TeTime t1("01/01/2001 00", TeHOUROFDAY, "DDsMMsYYYYsHH");
-		TeTime t2("01/01/2001 23", TeHOUROFDAY, "DDsMMsYYYYsHH");
-		iTime = t1;
-		fTime = t2;
-	}
-	else if(TSparams_.chronon_==TeMINUTEOFHOUR)
-	{
-		TeTime t1("01/01/2001 00:00", TeMINUTEOFHOUR, "DDsMMsYYYYsHHsmm");
-		TeTime t2("01/01/2001 00:59", TeMINUTEOFHOUR, "DDsMMsYYYYsHHsmm");
-		iTime = t1;
-		fTime = t2;
-	}
-	else if(TSparams_.chronon_==TeSECONDOFMINUTE)
-	{
-		TeTime t1("01/01/2001 00:00:00", TeSECONDOFMINUTE, "DDsMMsYYYYsHHsmmsSS");
-		TeTime t2("01/01/2001 00:00:59", TeSECONDOFMINUTE, "DDsMMsYYYYsHHsmmsSS");
-		iTime = t1;
-		fTime = t2;
-	}
-
-	int timeFrame = 0;
-	while (iTime <= fTime)
-	{
-		TeTimeInterval inter(iTime,iTime);
-		inter.intervalChronon(TSparams_.chronon_); //min/max
-		TeTSEntry tsEntry(0., inter, timeFrame);
-		this->series_.push_back(tsEntry);
-		++iTime;
-		++timeFrame;
-	}
-
-	return true;
-}
-
-bool 
-TeTemporalSeries::setTSEntryValue(unsigned int frame, double val, TeTSDataType type)
-{
-
-	TeTSEntry entry;
-	if(!getTSEntry(entry, frame))
-		return false;
-
-	double val1 = entry.value_;
-	double result = val1;
-
-	if(TSparams_.timeOper_==TeCOUNT)
-		result += 1;
-	else if (TSparams_.timeOper_==TeSUM)
-		result += val;
-	else if ((TSparams_.timeOper_==TeMAXVALUE) && (val>val1))
-		result = val;
-	else if((TSparams_.timeOper_==TeMINVALUE) && (val<val1))
-		result = val;
-	else if(TSparams_.timeOper_==TeMEAN)
-		result = (val1+val)/2;
-
-	series_[frame].value_ = result;
-	series_[frame].type_ = type;
-	return true;
-}
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeTemporalSeries.h"
+#include "TeDatabase.h"
+
+
+TeTSEntry::TeTSEntry(const double& val, TeTimeInterval& time, int timeFrame, int nItens, TeTSDataType dType)
+{
+	timeFrame_= timeFrame;
+	value_ = val;
+	type_ = dType;
+	nItens_ = nItens;
+	time_ = time;
+	timeInt_ = -1;
+
+	if (time.intervalChronon()==TeMONTHOFYEAR) 
+		timeInt_ = time.getT1().month();
+	else if(time.intervalChronon()==TeDAYOFMONTH)
+		timeInt_ = time.getT1().day();
+	else if(time.intervalChronon()==TeDAYOFWEEK)
+		timeInt_ = time.getT1().weekDay();
+	else if(time.intervalChronon()==TeDAYOFYEAR)
+		timeInt_ = time.getT1().yearDay();
+	else if(time.intervalChronon()==TeHOUROFDAY)
+		timeInt_ = time.getT1().hour();
+	else if(time.intervalChronon()==TeMINUTEOFHOUR)
+		timeInt_ = time.getT1().minute();
+	else if(time.intervalChronon()==TeSECONDOFMINUTE)
+		timeInt_ = time.getT1().hour();
+}
+
+
+
+TeTSEntry& 
+TeTSEntry::operator=(const TeTSEntry& other)
+{
+	if ( this != &other )
+	{
+		timeFrame_ = other.timeFrame_;
+		value_ = other.value_;
+		time_ = other.time_;
+		nItens_ = other.nItens_;
+		type_ = other.type_;
+		timeInt_ = other.timeInt_;
+	}
+	return (*this);
+}
+
+TeTSParams& 
+TeTSParams::operator=(const TeTSParams& other)
+{
+	if ( this != &other )
+	{
+		type_ = other.type_;
+  		chronon_ = other.chronon_;
+  		time_ = other.time_; 
+  		timeOper_ = other.timeOper_;
+  		spatOper_ = other.spatOper_;
+  	  	orTheme_ = other.orTheme_;
+		objectId_ = other.objectId_;
+  		attrTable_ = other.attrTable_;	
+		attrColumn_ = other.attrColumn_;
+	}
+	return (*this);
+}
+
+
+TeTemporalSeries& 
+TeTemporalSeries::operator=(const TeTemporalSeries& other)
+{
+	if ( this != &other )
+	{
+		TSparams_ = other.TSparams_;
+		series_ = other.series_;
+	}
+	return (*this);
+}
+
+
+bool 
+TeTemporalSeries::getTSEntry(TeTSEntry& ts, unsigned int frame)
+{
+	if(frame >= (series_.size()))
+		return false;
+
+	ts = series_[frame];
+	return true;
+}
+
+bool 
+TeTemporalSeries::buildFrameIntervals()
+{
+	// ----- information about temporal table 
+	TeTable tempTable;
+	TeDatabase* db = TSparams_.orTheme_->layer()->database();
+
+	if(!TSparams_.orTheme_->getTemporalTable(tempTable))
+		return false;
+
+	TSparams_.attrTable_ = tempTable.name();
+	string initialtime = tempTable.name() +"."+ tempTable.attInitialTime(); 
+	string finaltime = tempTable.name() +"."+ tempTable.attFinalTime(); 
+
+	TeTime iTime, fTime;
+	
+	// ----- fill time interval
+	// ---------------------------- you don�t know how many time frames will be generated
+
+	if(	(TSparams_.chronon_==TeYEAR)   || (TSparams_.chronon_==TeMONTH) ||
+		(TSparams_.chronon_==TeDAY)    || (TSparams_.chronon_==TeHOUR)  ||
+		(TSparams_.chronon_==TeMINUTE) || (TSparams_.chronon_==TeSECOND) )
+	{
+		
+		string fromClause, whereClause;
+		if(!db->tableExist(TSparams_.orTheme_->collectionAuxTable()))
+		{
+			TeAttrTableVector atts; 
+			TSparams_.orTheme_->getAttTables(atts); 
+			if(atts.empty())
+				return false;
+
+			fromClause = " FROM " + tableJoin(atts);
+			whereClause = TSparams_.orTheme_->sqlWhereRestrictions();
+		}
+		else
+		{
+			//fromClause = TSparams_.orTheme_->sqlGridFrom();
+			string collAuxTable = TSparams_.orTheme_->collectionAuxTable();
+			string uniqueIdName = tempTable.name() +"."+ tempTable.uniqueName(); 
+			string objectIdName = tempTable.name() +"."+ tempTable.linkName(); 
+
+			fromClause = " FROM "+ tempTable.name()+" RIGHT JOIN "+ collAuxTable; 
+			
+			if(tempTable.tableType()==TeFixedGeomDynAttr)
+			{
+				fromClause += " ON "+ uniqueIdName +" = ";
+				fromClause += collAuxTable +".aux0";
+			}
+			else
+			{
+				fromClause += " ON "+ objectIdName +" = ";
+				fromClause += collAuxTable +".object_id";
+			}
+		}
+
+		string sql = " SELECT min("+ initialtime +"), max("+ finaltime +") ";
+		sql += fromClause;	
+		
+		if(!whereClause.empty())
+			sql += " WHERE "+ whereClause;
+
+		TeDatabasePortal* portal = db->getPortal();
+		if(!portal)
+			return false;
+
+		if((!portal->query(sql)) || (!portal->fetchRow()))
+		{
+			delete portal;
+			return false;
+		}
+
+		//fill the temporal series
+        TeTime date1 =  portal->getDate(0);
+        TeTime date2 =  portal->getDate(1);
+		TeTimeInterval interval(date1, date2);
+		interval.intervalChronon(TSparams_.chronon_); //min/max
+
+		iTime = interval.getT1();
+ 		fTime = interval.getT2();
+
+		delete (portal);
+	}
+
+	// ---------------------------- you know how many time frames will be generated
+
+	else if (TSparams_.chronon_==TeMONTHOFYEAR) 
+	{
+		TeTime t1("01/01/2001", TeMONTHOFYEAR, "DDsMMsYYYY");
+		TeTime t2("01/12/2001", TeMONTHOFYEAR, "DDsMMsYYYY");
+		iTime = t1;
+		fTime = t2;
+	}
+	else if(TSparams_.chronon_==TeDAYOFMONTH)
+	{
+		TeTime t1("01/01/2001", TeDAYOFMONTH, "DDsMMsYYYY");
+		TeTime t2("31/01/2001", TeDAYOFMONTH, "DDsMMsYYYY");
+		iTime = t1;
+		fTime = t2;
+	}
+	else if(TSparams_.chronon_==TeDAYOFWEEK)
+	{
+		TeTime t1("07/01/2001", TeDAYOFWEEK, "DDsMMsYYYY");
+		TeTime t2("13/01/2001", TeDAYOFWEEK, "DDsMMsYYYY");
+		iTime = t1;
+		fTime = t2;
+	}
+	else if(TSparams_.chronon_==TeDAYOFYEAR)
+	{
+		TeTime t1("01/01/2001", TeDAYOFYEAR, "DDsMMsYYYY");
+		TeTime t2("31/12/2001", TeDAYOFYEAR, "DDsMMsYYYY");
+		iTime = t1;
+		fTime = t2;
+	}
+	else if(TSparams_.chronon_==TeHOUROFDAY)
+	{
+		TeTime t1("01/01/2001 00", TeHOUROFDAY, "DDsMMsYYYYsHH");
+		TeTime t2("01/01/2001 23", TeHOUROFDAY, "DDsMMsYYYYsHH");
+		iTime = t1;
+		fTime = t2;
+	}
+	else if(TSparams_.chronon_==TeMINUTEOFHOUR)
+	{
+		TeTime t1("01/01/2001 00:00", TeMINUTEOFHOUR, "DDsMMsYYYYsHHsmm");
+		TeTime t2("01/01/2001 00:59", TeMINUTEOFHOUR, "DDsMMsYYYYsHHsmm");
+		iTime = t1;
+		fTime = t2;
+	}
+	else if(TSparams_.chronon_==TeSECONDOFMINUTE)
+	{
+		TeTime t1("01/01/2001 00:00:00", TeSECONDOFMINUTE, "DDsMMsYYYYsHHsmmsSS");
+		TeTime t2("01/01/2001 00:00:59", TeSECONDOFMINUTE, "DDsMMsYYYYsHHsmmsSS");
+		iTime = t1;
+		fTime = t2;
+	}
+
+	int timeFrame = 0;
+	while (iTime <= fTime)
+	{
+		TeTimeInterval inter(iTime,iTime);
+		inter.intervalChronon(TSparams_.chronon_); //min/max
+		TeTSEntry tsEntry(0., inter, timeFrame);
+		this->series_.push_back(tsEntry);
+		++iTime;
+		++timeFrame;
+	}
+
+	return true;
+}
+
+bool 
+TeTemporalSeries::setTSEntryValue(unsigned int frame, double val, TeTSDataType type)
+{
+
+	TeTSEntry entry;
+	if(!getTSEntry(entry, frame))
+		return false;
+
+	double val1 = entry.value_;
+	double result = val1;
+
+	if(TSparams_.timeOper_==TeCOUNT)
+		result += 1;
+	else if (TSparams_.timeOper_==TeSUM)
+		result += val;
+	else if ((TSparams_.timeOper_==TeMAXVALUE) && (val>val1))
+		result = val;
+	else if((TSparams_.timeOper_==TeMINVALUE) && (val<val1))
+		result = val;
+	else if(TSparams_.timeOper_==TeMEAN)
+		result = (val1+val)/2;
+
+	series_[frame].value_ = result;
+	series_[frame].type_ = type;
+	return true;
+}
+
+
+
+
diff --git a/src/terralib/kernel/TeTemporalSeries.h b/src/terralib/kernel/TeTemporalSeries.h
old mode 100755
new mode 100644
index 8234f2d..c4630b3
--- a/src/terralib/kernel/TeTemporalSeries.h
+++ b/src/terralib/kernel/TeTemporalSeries.h
@@ -1,192 +1,192 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeTemporalSeries.h
-    \brief This file contains structures and definitions to deal with temporal series.
-*/
-
-#ifndef  __TERRALIB_INTERNAL_TS_H
-#define  __TERRALIB_INTERNAL_TS_H
-
-
-#include "TeTheme.h"
-#include "TeTimeInterval.h"
-
-
-/* 
-	ATTR_DYN: a spatial object with a dynamic attribute 
-	ATTR_DYN_GROUP: some spatial objects with a dynamic attribute table 
-	EVENT: count of events
-	ATTR_EVENT: grouping the attributes of the events
-*/
-//!	type of temporal series
-enum TeTSType  { TeATTRDYN, TeATTRDYNGROUP, TeEVENT, TeATTREVENT};
-
- 
-//! type of the data collected in the serie temporal 
-enum TeTSDataType  { TeDATA, TeMISSING, TeDMISSING, TeOUTLIER, TeDOUTLIER, TePREDICTION };
-
-
-//! A class that represent each time frame of a temporal series
-class TL_DLL TeTSEntry
-{
-public:
-	int					timeFrame_;  //the time frame of the temporal series 
-	double 				value_;
-	TeTSDataType 		type_; 
-	int 				nItens_; //number of instances
-	TeTimeInterval		time_;
-	int					timeInt_;
-
-	//! Constructor
-	TeTSEntry(): 
-		timeFrame_(-1),
-		value_(0), 
-		type_(TeMISSING), 
-		nItens_(0),
-		timeInt_(-1)
-		{}
-
-	//! Constructor
-	TeTSEntry(const double& val, TeTimeInterval& time, int timeFrame=-1, int nItens=0, TeTSDataType dType=TeMISSING); 
-		
-	
-	//! Copy constructor
-	TeTSEntry(const TeTSEntry& other)
-	{
-		timeFrame_ = other.timeFrame_;
-		value_ = other.value_;
-		time_ = other.time_;
-		nItens_ = other.nItens_;
-		type_ = other.type_;
-		timeInt_ = other.timeInt_;
-	}
-
-	//! Operator = 
-	TeTSEntry& operator=(const TeTSEntry& other); 
-
-};
-
-//! Parameters of a temporal series
-class TL_DLL TeTSParams 
-{
-public:
-	TeTSType			type_;			//! type of the series
-  	TeChronon			chronon_;		//! Chronon used to generated the series
-  	TeTimeInterval		time_;			//! Date/Time validy 
-  	TeStatisticType		timeOper_; 		//! operator to temporal grouping - to group objects in each time frame
-  	TeStatisticType		spatOper_; 		//! operator to spatial grouping - to group instances to each object 
-  
-	// Measures
-  	TeTheme*		orTheme_;		//Pointer to the origin theme 
-	string			objectId_;
-  	string			attrTable_;	    //temporal table 
-	string			attrColumn_;	//date column 
-
-
-	//! Empty constructor
-	TeTSParams():
-		chronon_(TeNOCHRONON),
-		timeOper_(TeNOSTATISTIC),
-		spatOper_(TeNOSTATISTIC),
-		orTheme_(0),
-		objectId_(""),
-		attrTable_(""),
-		attrColumn_("")
-		{ }
-
-	//! Constructor - - serie type is ATTR_DYN_GROUP, EVENT, ATTR_EVENT
-	TeTSParams(TeTheme* theme, TeChronon chr, const string& table, const string& col, TeStatisticType tOper, TeStatisticType sOper):
-		chronon_(chr),
-		timeOper_(tOper), 
-		spatOper_(sOper),
-		orTheme_(theme),
-		objectId_(""),
-		attrTable_(table),
-		attrColumn_(col)
-		{}
-
-	//! Constructor - serie type is ATTR_DYN
-	TeTSParams(TeTheme* theme, const string& objId, TeChronon chr, const string& table, const string& col, TeStatisticType tOper, TeStatisticType sOper):
-		chronon_(chr),
-		timeOper_(tOper),
-		spatOper_(sOper),
-		orTheme_(theme),
-		objectId_(objId),
-		attrTable_(table),
-		attrColumn_(col)
-		{}
-
-	//! Operator = 
-	TeTSParams& operator=(const TeTSParams& other); 
-}; 
-
-//! A class to represent temporal series
-class TL_DLL TeTemporalSeries
-{
-public:
-	TeTSParams			TSparams_; 
-	vector<TeTSEntry> 	series_; //! serie
-
-	//! Constructor
-	TeTemporalSeries(): 
-		TSparams_(TeTSParams())
-	{}
-
-	//! Constructor
-	TeTemporalSeries(TeChronon chr, TeTheme* theme=0, const string& table="", const string& col="", TeStatisticType tOper=TeNOSTATISTIC, TeStatisticType sOper=TeNOSTATISTIC): 
-		TSparams_(TeTSParams(theme, chr, table, col, tOper, sOper))
-	{}
-
-	//! Constructor
-	TeTemporalSeries(TeTheme* theme, const string& objId, TeChronon chr, const string& table, const string& col, TeStatisticType tOper, TeStatisticType sOper): 
-		TSparams_(TeTSParams(theme, objId, chr, table, col, tOper, sOper))
-	{}
-
-	//! Gets the time frame  (0 until n-1)
-	bool getTSEntry(TeTSEntry& ts, unsigned int frame); 
-
-	//! Operator = 
-	TeTemporalSeries& operator=(const TeTemporalSeries& other); 
-
-	//! Fills the time interval for each frame
-	bool buildFrameIntervals();
-
-	//! Returns the number of time frames
-	int numTimeFrames() { return series_.size(); }
-
-	//! Returns the time of each frame
-	int timeInt(int frame) { return ((series_[frame-1]).timeInt_); }
-
-	//! Sets the temporal series entry value
-	bool setTSEntryValue(unsigned int frame, double val, TeTSDataType type); 
-
-	//! Returns the time of each frame
-	TeTimeInterval time(int frame) { return ((series_[frame-1]).time_); }
-
-};
-
-#endif
-
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeTemporalSeries.h
+    \brief This file contains structures and definitions to deal with temporal series.
+*/
+
+#ifndef  __TERRALIB_INTERNAL_TS_H
+#define  __TERRALIB_INTERNAL_TS_H
+
+
+#include "TeTheme.h"
+#include "TeTimeInterval.h"
+
+
+/* 
+	ATTR_DYN: a spatial object with a dynamic attribute 
+	ATTR_DYN_GROUP: some spatial objects with a dynamic attribute table 
+	EVENT: count of events
+	ATTR_EVENT: grouping the attributes of the events
+*/
+//!	type of temporal series
+enum TeTSType  { TeATTRDYN, TeATTRDYNGROUP, TeEVENT, TeATTREVENT};
+
+ 
+//! type of the data collected in the serie temporal 
+enum TeTSDataType  { TeDATA, TeMISSING, TeDMISSING, TeOUTLIER, TeDOUTLIER, TePREDICTION };
+
+
+//! A class that represent each time frame of a temporal series
+class TL_DLL TeTSEntry
+{
+public:
+	int					timeFrame_;  //the time frame of the temporal series 
+	double 				value_;
+	TeTSDataType 		type_; 
+	int 				nItens_; //number of instances
+	TeTimeInterval		time_;
+	int					timeInt_;
+
+	//! Constructor
+	TeTSEntry(): 
+		timeFrame_(-1),
+		value_(0), 
+		type_(TeMISSING), 
+		nItens_(0),
+		timeInt_(-1)
+		{}
+
+	//! Constructor
+	TeTSEntry(const double& val, TeTimeInterval& time, int timeFrame=-1, int nItens=0, TeTSDataType dType=TeMISSING); 
+		
+	
+	//! Copy constructor
+	TeTSEntry(const TeTSEntry& other)
+	{
+		timeFrame_ = other.timeFrame_;
+		value_ = other.value_;
+		time_ = other.time_;
+		nItens_ = other.nItens_;
+		type_ = other.type_;
+		timeInt_ = other.timeInt_;
+	}
+
+	//! Operator = 
+	TeTSEntry& operator=(const TeTSEntry& other); 
+
+};
+
+//! Parameters of a temporal series
+class TL_DLL TeTSParams 
+{
+public:
+	TeTSType			type_;			//! type of the series
+  	TeChronon			chronon_;		//! Chronon used to generated the series
+  	TeTimeInterval		time_;			//! Date/Time validy 
+  	TeStatisticType		timeOper_; 		//! operator to temporal grouping - to group objects in each time frame
+  	TeStatisticType		spatOper_; 		//! operator to spatial grouping - to group instances to each object 
+  
+	// Measures
+  	TeTheme*		orTheme_;		//Pointer to the origin theme 
+	string			objectId_;
+  	string			attrTable_;	    //temporal table 
+	string			attrColumn_;	//date column 
+
+
+	//! Empty constructor
+	TeTSParams():
+		chronon_(TeNOCHRONON),
+		timeOper_(TeNOSTATISTIC),
+		spatOper_(TeNOSTATISTIC),
+		orTheme_(0),
+		objectId_(""),
+		attrTable_(""),
+		attrColumn_("")
+		{ }
+
+	//! Constructor - - serie type is ATTR_DYN_GROUP, EVENT, ATTR_EVENT
+	TeTSParams(TeTheme* theme, TeChronon chr, const string& table, const string& col, TeStatisticType tOper, TeStatisticType sOper):
+		chronon_(chr),
+		timeOper_(tOper), 
+		spatOper_(sOper),
+		orTheme_(theme),
+		objectId_(""),
+		attrTable_(table),
+		attrColumn_(col)
+		{}
+
+	//! Constructor - serie type is ATTR_DYN
+	TeTSParams(TeTheme* theme, const string& objId, TeChronon chr, const string& table, const string& col, TeStatisticType tOper, TeStatisticType sOper):
+		chronon_(chr),
+		timeOper_(tOper),
+		spatOper_(sOper),
+		orTheme_(theme),
+		objectId_(objId),
+		attrTable_(table),
+		attrColumn_(col)
+		{}
+
+	//! Operator = 
+	TeTSParams& operator=(const TeTSParams& other); 
+}; 
+
+//! A class to represent temporal series
+class TL_DLL TeTemporalSeries
+{
+public:
+	TeTSParams			TSparams_; 
+	vector<TeTSEntry> 	series_; //! serie
+
+	//! Constructor
+	TeTemporalSeries(): 
+		TSparams_(TeTSParams())
+	{}
+
+	//! Constructor
+	TeTemporalSeries(TeChronon chr, TeTheme* theme=0, const string& table="", const string& col="", TeStatisticType tOper=TeNOSTATISTIC, TeStatisticType sOper=TeNOSTATISTIC): 
+		TSparams_(TeTSParams(theme, chr, table, col, tOper, sOper))
+	{}
+
+	//! Constructor
+	TeTemporalSeries(TeTheme* theme, const string& objId, TeChronon chr, const string& table, const string& col, TeStatisticType tOper, TeStatisticType sOper): 
+		TSparams_(TeTSParams(theme, objId, chr, table, col, tOper, sOper))
+	{}
+
+	//! Gets the time frame  (0 until n-1)
+	bool getTSEntry(TeTSEntry& ts, unsigned int frame); 
+
+	//! Operator = 
+	TeTemporalSeries& operator=(const TeTemporalSeries& other); 
+
+	//! Fills the time interval for each frame
+	bool buildFrameIntervals();
+
+	//! Returns the number of time frames
+	int numTimeFrames() { return series_.size(); }
+
+	//! Returns the time of each frame
+	int timeInt(int frame) { return ((series_[frame-1]).timeInt_); }
+
+	//! Sets the temporal series entry value
+	bool setTSEntryValue(unsigned int frame, double val, TeTSDataType type); 
+
+	//! Returns the time of each frame
+	TeTimeInterval time(int frame) { return ((series_[frame-1]).time_); }
+
+};
+
+#endif
+
+
+
+
diff --git a/src/terralib/kernel/TeTheme.cpp b/src/terralib/kernel/TeTheme.cpp
old mode 100755
new mode 100644
index 1fa3fd6..13aaca8
--- a/src/terralib/kernel/TeTheme.cpp
+++ b/src/terralib/kernel/TeTheme.cpp
@@ -1,2522 +1,2576 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeTheme.h"
-#include "TeDatabase.h"
-#include "TeGroupingAlgorithms.h"
-#include "TeRasterTransform.h"
-#include "TeQuerier.h"
-#include "TeQuerierParams.h"
-
-extern int  yyparse(string& sqlOut);
-extern int  initParse(const string& strIn, TeDatabase* db);
-
-static TeThemeFactory themeFactory;
-
-TeTheme::TeTheme( const string& name, TeLayer* layer, TeViewNode* parent, const int& view, const int& id)
-		: TeAbstractTheme(name, parent, view, id, TeTHEME),
-		layer_(layer),
-        useCollection_(true)
-{
-	//layer id
-	if(layer)
-	{
-		layerId_ = layer->id();
-		if (layer_->database())
-			themeBox_ = layer_->box();
-	}
-	else
-		layerId_ = -1;
-}
-
-TeTheme::TeTheme(const TeViewNodeParams& params) : TeAbstractTheme(params),	layer_(0), layerId_(-1),
-useCollection_(true)
-{
-}
-
-
-// Copy constructor
-TeTheme::TeTheme (const TeTheme& other) :
-	TeAbstractTheme(other)
-{
-	layerId_ = other.layerId_;
-	layer_ = other.layer_;      //the same layer pointer
-	collectionTable_ = other.collectionTable_;
-	collectionAuxTable_ = other.collectionAuxTable_;
-
-	attTableVector_ = other.attTableVector_;
-	sqlFrom_ =  other.sqlFrom_;
-	sqlJoin_ = other.sqlGridJoin_;
-	sqlGridFrom_ = other.sqlGridFrom_;
-	sqlGridJoin_ = other.sqlGridJoin_;
-	aliasVector_ = other.aliasVector_;
-	sqlAttList_ = other.sqlAttList_;
-	sqlNumAttList_ = other.sqlNumAttList_;
-
-    useCollection_ = other.useCollection_;
-}
-
-
-// Destructor
-TeTheme::~TeTheme ()
-{
-	clearAttTableVector();
-	clearAttList();
-	collectionTable_.clear();
-	collectionAuxTable_.clear();
-	sqlFrom_.clear();
-	sqlJoin_.clear();
-	sqlGridFrom_.clear();
-	sqlGridJoin_.clear();
-	aliasVector_.clear();
-	sqlAttList_.clear();
-	sqlNumAttList_.clear();
-}
-
-TeTheme&
-TeTheme::operator= (const TeTheme& other)
-{
-	if ( this != &other )
-	{
-		TeAbstractTheme* absTheme = (TeAbstractTheme*)this;
-		absTheme->operator=(other);
-		layerId_ = other.layerId_;
-		layer_ = other.layer_;      //the same layer pointer
-
-		collectionTable_ = other.collectionTable_;
-		collectionAuxTable_ = other.collectionAuxTable_;
-
-		attTableVector_ = other.attTableVector_;
-		sqlFrom_ =  other.sqlFrom_;
-		sqlJoin_ = other.sqlGridJoin_;
-		sqlGridFrom_ = other.sqlGridFrom_;
-		sqlGridJoin_ = other.sqlGridJoin_;
-		aliasVector_ = other.aliasVector_;
-		sqlAttList_ = other.sqlAttList_;
-		sqlNumAttList_ = other.sqlNumAttList_;
-
-        useCollection_ = other.useCollection_;
-	}
-	return *this;
-}
-
-
-void TeTheme::layer(TeLayer* layer)
-{
-	layer_ = layer;
-	if (layer)
-	{
-		layerId_ = layer->id();
-//		themeBox_ = layer_->box();
-	}
-}
-
-void
-TeTheme::setSpatialRest(TeBox& box, TeGeomRep rep, TeSpatialRelation relation)
-{
-	hasSpatialRes_ = true;
-	boxRest_ = box;
-	spatialRelation_ = relation;
-
-	if(rep==TeGEOMETRYNONE)
-		geomRepRest_ = layer()->vectRepres()[0]->geomRep_;
-	else
-		geomRepRest_ = rep;
-
-	geomRest_ = 0;
-}
-
-void
-TeTheme::setSpatialRest(TeGeometry* geom, TeGeomRep rep, TeSpatialRelation relation)
-{
-	hasSpatialRes_ = true;
-	geomRest_ = geom;
-	spatialRelation_ = relation;
-
-	if(rep==TeGEOMETRYNONE)
-		geomRepRest_ = layer()->vectRepres()[0]->geomRep_;
-	else
-		geomRepRest_ = rep;
-
-	boxRest_ = TeBox();
-}
-
-string
-TeTheme::sqlWhereRestrictions(TeRepresentation* rep)
-{
-	TeKeys objs;
-	string whereClause= " 1 = 1 ";
-	TeDatabase* db = layer()->database();
-
-	// load the first representation
-	if(!rep)
-		rep = (layer()->vectRepres())[0];
-
-	// temporal restrictions are applied only to temporal tables
-	if(hasTemporalRest())
-	{
-		string result = "";
-
-		initParse(temporalRest(), db);
-
-		if(!yyparse(result))  //0: accept  1: reject
-			whereClause += " AND "+ result;
-		else
-			return "";
-	}
-
-	// we should test if the attribute restriction is valid
-	if (hasAttrRest())
-		whereClause += " AND "+ attributeRest();
-
-	// spatial restriction with other geometry representation
-	if (hasSpatialRest() && rep)
-	{
-		if(boxRestriction().isValid())
-		{
-            TeBox b =  boxRestriction();
-            TeGeomRep gRep = rep->geomRep_;
-//			whereClause += " AND "+ db->getSQLBoxWhere(boxRestriction(), rep->geomRep_);
-			whereClause += " AND "+ db->getSQLBoxWhere(b, gRep);
-		}
-		else if(geomRestriction())
-		{
-			string geomTableRest = layer()->tableName(geomRepRestriction());
-			TePrecision::instance().setPrecision(TeGetPrecision(layer()->projection()));
-
-			if(db->spatialRelation(geomTableRest, geomRepRestriction(), geomRestriction(),
-							   objs, spatialRelation()))
-			{
-				string obs;
-				for(unsigned int i=0; i<objs.size(); i++)
-				{
-					if(i!=0)
-						obs += ",";
-					obs += "'"+ objs[i] +"'";
-				}
-
-				whereClause += " AND "+ rep->tableName_ +".object_id IN ("+ obs +")";
-			}
-		}
-	}
-	return whereClause;
-}
-
-void TeTheme::createRasterVisual(TeRaster* rst)
-{
-	if (rasterVisual_)
-		delete rasterVisual_;
-
-	if (!rst)
-		rst = layer_->raster();
-
-	if (!rst)
-		return;
-
-	rasterVisual_ = new TeRasterTransform();
-
-	if (rst->params().photometric_[0] == TeRasterParams::TePallete)  // raster palette -> uses its palette
-	{
-		rasterVisual_->setTransfFunction(&TeRasterTransform::Pallete2ThreeBand);
-		rasterVisual_->setLutSize(rst->params().lutr_.size());
-		return;
-	}
-
-	if (visibleRep_ & 0x40000000  &&		// sliced raster -> generate the
-		grouping_.groupMode_ == TeRasterSlicing)	// appropriate palette
-	{
-		int band = atoi(grouping_.groupAttribute_.name_.c_str());
-		rasterVisual_->setSrcBand(band);
-		if (rst->params().dataType_[band] != TeUNSIGNEDCHAR)
-			rasterVisual_->generateLUT(legend_, 1024, defaultLegend_.visual(TePOLYGONS)->color());
-		else
-			rasterVisual_->generateLUT(legend_, 256, defaultLegend_.visual(TePOLYGONS)->color());
-		rasterVisual_->setTransfFunction(&TeRasterTransform::LUT2ThreeBand);
-		return;
-	}
-
-	if (rst->params().dataType_[0] != TeUNSIGNEDCHAR)	// non unsigned char -> generate linear transformation
-		rasterVisual_->setLinearTransfParameters(rst->params().vmin_[0],rst->params().vmax_[0], 0, 255);
-
-	if (rst->params().nBands() == 1)
-		rasterVisual_->setTransfFunction(&TeRasterTransform::Mono2ThreeBand);
-	else if (rst->params().nBands() == 3)
-		rasterVisual_->setTransfFunction(&TeRasterTransform::ThreeBand2RGB);
-	else
-		rasterVisual_->setTransfFunction(&TeRasterTransform::Band2Band);
-}
-
-
-
-bool
-TeTheme::buildCollection(std::string objectId)
-{
-	if(id()==0)
-		return false;
-
-	if(!populateCollection(objectId))
-		return false;
-
-	if(!populateCollectionAux(objectId))
-		return false;
-
-	return true;
-}
-
-bool
-TeTheme::buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects,
-						 vector<double>* dValuesVec)
-{
-	return buildGrouping(layer_->database(), g, selectedObjects, dValuesVec);
-}
-
-bool
-TeTheme::buildGrouping(TeDatabase* db, const TeGrouping& g, TeSelectedObjects selectedObjects, vector<double>* dValuesVec)
-{
-	if(!db)
-		return false;
-	grouping_ = g;
-	unsigned int i;
-	vector<TeSlice> slices;
-	int	nullValues = 0;
-	if (grouping_.groupMode_ == TeRasterSlicing)
-	{
-		int b = atoi(grouping_.groupAttribute_.name_.c_str());
-		if (!layer_->raster() ||
-			b < 0 ||
-			b > layer_->raster()->params().nBands() ||
-			grouping_.groupNumSlices_ <= 0)
-			return false;
-
-		if (grouping_.groupMaxVal_ == TeMINFLOAT)
-			grouping_.groupMaxVal_ = layer_->raster()->params().vmax_[b];
-
-		if (grouping_.groupMinVal_ == TeMAXFLOAT)
-			grouping_.groupMinVal_ = layer_->raster()->params().vmin_[b];
-
-		TeGroupByEqualStep(grouping_.groupMinVal_, grouping_.groupMaxVal_,
-			grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-	}
-	else
-	{
-        if(grouping_.groupAttribute_.name_.empty())
-			return false;
-
-		//verify what the objects will be considered
-		string	input;
-		if(selectedObjects == TeSelectedByPointing)
-		{
-			input = " WHERE (grid_status = 1 OR grid_status = 3";
-			input += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3)))";
-		}
-		else if(selectedObjects == TeNotSelectedByPointing)
-		{
-			input = " WHERE (grid_status = 0 OR grid_status = 2";
-			input += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
-		}
-		else if(selectedObjects == TeSelectedByQuery)
-		{
-			input = " WHERE (grid_status = 2 OR grid_status = 3";
-			input += " OR (grid_status is null AND (c_object_status = 2 OR c_object_status = 3)))";
-		}
-		else if(selectedObjects == TeNotSelectedByQuery)
-		{
-			input = " WHERE (grid_status = 0 OR grid_status = 1";
-			input += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 1)))";
-		}
-		else if(selectedObjects == TeGrouped)
-		{
-			input = " WHERE c_legend_id <> 0";
-		}
-		else if(selectedObjects == TeNotGrouped)
-		{
-			input = " WHERE c_legend_id = 0";
-		}
-
-		TeDatabasePortal* portal = db->getPortal();
-		string query;
-		bool normal = false;
-		string aggrFunc = "";
-		if(grouping_.groupFunction_.empty())
-			aggrFunc = " MIN";
-		else
-			aggrFunc = grouping_.groupFunction_;
-
-		if(grouping_.groupNormAttribute_.empty())
-		{
-			query = " SELECT "+ aggrFunc +"("+ grouping_.groupAttribute_.name_ +")";
-		}
-		else
-		{
-			query = " SELECT "+ aggrFunc +"("+ grouping_.groupAttribute_.name_ +") / "+ aggrFunc +"("+ grouping_.groupNormAttribute_ + ")";
-			normal = true;
-		}
-		query += sqlGridFrom();
-
-		if(selectedObjects != TeAll)
-			query += input;
-		query += " GROUP BY " + collectionTable() + ".c_object_id";
-		if(!portal->query(query) || !portal->fetchRow())
-		{
-			delete portal;
-			return false;
-		}
-		vector<double> dValues;  //inputvect
-		vector<string> sValues;	//svec
-		double mean, sum;
-		mean = sum = 0.;
-		do
-		{
-			string val = portal->getData(0);
-			string valNorm = Te2String(atof(val.c_str()), grouping_.groupPrecision_);
-
-			if (!val.empty())
-			{
-				if(grouping_.groupMode_== TeUniqueValue)
-				{
-					if(normal)
-						sValues.push_back(valNorm);
-					else
-						sValues.push_back(val);
-				}
-				else
-				{
-					dValues.push_back(atof(valNorm.c_str()));
-					sum += atof(valNorm.c_str());
-				}
-
-			}
-			else
-				nullValues++;
-		}while(portal->fetchRow());
-
-		delete portal;
-
-		if(dValues.empty() && sValues.empty())
-			return false;
-
-		if(grouping_.groupMode_== TeEqualSteps)
-			TeGroupByEqualStep(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-		else if(grouping_.groupMode_== TeQuantil)
-			TeGroupByQuantil(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-		else if(grouping_.groupMode_== TeStdDeviation)
-		{
-			string m = Te2String(mean);
-			TeGroupByStdDev(dValues.begin(), dValues.end(), grouping_.groupStdDev_, slices, m, grouping_.groupPrecision_);
-		}
-		else if(grouping_.groupMode_== TeUniqueValue)
-		{
-			if(grouping_.groupFunction_ == "COUNT")
-				TeGroupByUniqueValue(sValues, TeINT, slices, grouping_.groupPrecision_);
-			else
-				TeGroupByUniqueValue(sValues, grouping_.groupAttribute_.type_, slices, grouping_.groupPrecision_);
-		}
-
-		if (dValuesVec)
-		{
-			for (i = 0; i < dValues.size(); ++i)
-				dValuesVec->push_back(dValues[i]);
-		}
-	}
-	if(grouping_.groupNullAttr_ && nullValues > 0)
-	{
-		TeSlice ps;
-		ps.count_ = nullValues;
-		ps.from_ = "Missing Data";
-		slices.push_back(ps);
-		grouping_.groupNumSlices_ = slices.size() - 1;
-	}
-	else
-		grouping_.groupNumSlices_ = slices.size();
-
-	legend_.clear();
-	for(i=0; i<slices.size(); ++i)
-	{
-		TeLegendEntry legend(slices[i]);
-		legend.group(i);
-		legend.theme(id());
-		legend_.push_back(legend);
-	}
-	return true;
-}
-
-bool
-TeTheme::buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec)
-{
-	return buildGrouping(layer_->database(), g, chr, mapObjValVec);
-}
-
-bool
-TeTheme::buildGrouping(TeDatabase* db, const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec)
-{
-	if(!db || chr == TeNOCHRONON)
-		return false;
-
-	grouping_ = g;
-
-	unsigned int i;
-	vector<TeSlice> slices;
-	vector<double> dValues;  //inputvect
-	vector<string> sValues;	//svec
-	double mean, sum;
-	mean = sum = 0.;
-	int	nullValues = 0;
-	string val;
-
-	if (grouping_.groupMode_ == TeRasterSlicing)
-	{
-		int b = atoi(grouping_.groupAttribute_.name_.c_str());
-		if (!layer_->raster() ||
-			b < 0 ||
-			b > layer_->raster()->params().nBands() ||
-			grouping_.groupNumSlices_ <= 0)
-			return false;
-
-		if (grouping_.groupMaxVal_ == TeMINFLOAT)
-			grouping_.groupMaxVal_ = layer_->raster()->params().vmax_[b];
-
-		if (grouping_.groupMinVal_ == TeMAXFLOAT)
-			grouping_.groupMinVal_ = layer_->raster()->params().vmin_[b];
-
-		TeGroupByEqualStep(grouping_.groupMinVal_, grouping_.groupMaxVal_,
-			grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-	}
-	else
-	{
-		string func;
-		TeStatisticType statType = TeNOSTATISTIC;
-		if (grouping_.groupMode_ == TeUniqueValue && grouping_.groupAttribute_.type_ == TeSTRING)
-			func = "MIN";
-		else
-			func = grouping_.groupFunction_;
-
-		if (func == "MIN")
-			statType = TeMINVALUE;
-		else if (func == "MAX")
-			statType = TeMAXVALUE;
-		else if (func == "MEAN")
-			statType = TeMEAN;
-		else if (func == "SUM")
-			statType = TeSUM;
-		else if (func == "COUNT")
-			statType = TeCOUNT;
-
-		// Set the flag that indicates the geometries must not be loaded
-		bool loadGeometries = false;
-
-		// Insert the attributes in a multimap that relates the attribute
-		// representation and its statistic type
-		TeGroupingAttr attrMMap;
-		pair<TeAttributeRep, TeStatisticType> attr1 (
-			TeAttributeRep(grouping_.groupAttribute_), statType);
-		attrMMap.push_back(attr1);
-
-		// Set querier parameters
-		TeQuerierParams querierParams(loadGeometries, attrMMap);
-		querierParams.setParams(this, chr);
-
-		TeQuerier querier(querierParams);
-
-		// Load instances based on the querier parameters given
-		int numFrames = querier.getNumTimeFrames();
-		TeSTInstance sti;
-		string objId;
-		TePropertyVector vec;
-		mapObjValVec.resize(numFrames);
-
-		for (int frame = 0; frame < numFrames; ++frame)
-		{
-			if (querier.loadInstances(frame) == false)
-				continue;
-
-			// Traverse all the instances
-			while(querier.fetchInstance(sti))
-			{
-				objId = sti.objectId();
-				sti.getPropertyValue(val, 0);
-
-				dValues.push_back(atof(val.c_str()));
-				sValues.push_back(val);
-				map<string, string>& objValMap = mapObjValVec[frame];
-				objValMap.insert(make_pair(objId, val));
-			}
-		}
-
-		if(grouping_.groupMode_== TeEqualSteps)
-			TeGroupByEqualStep(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-		else if(grouping_.groupMode_== TeQuantil)
-			TeGroupByQuantil(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
-		else if(grouping_.groupMode_== TeStdDeviation)
-		{
-			string m = Te2String(mean);
-			TeGroupByStdDev(dValues.begin(), dValues.end(), grouping_.groupStdDev_, slices, m, grouping_.groupPrecision_);
-		}
-		else if(grouping_.groupMode_== TeUniqueValue)
-		{
-			if(grouping_.groupFunction_ == "COUNT")
-				TeGroupByUniqueValue(sValues, TeINT, slices, grouping_.groupPrecision_);
-			else
-				TeGroupByUniqueValue(sValues, grouping_.groupAttribute_.type_, slices, grouping_.groupPrecision_);
-		}
-	}
-
-	if(grouping_.groupNullAttr_ && nullValues > 0)
-	{
-		TeSlice ps;
-		ps.count_ = nullValues;
-		ps.from_ = "Missing Data";
-		slices.push_back(ps);
-		grouping_.groupNumSlices_ = slices.size() - 1;
-	}
-	else
-		grouping_.groupNumSlices_ = slices.size();
-
-	legend_.clear();
-	for(i=0; i<slices.size(); ++i)
-	{
-		TeLegendEntry legend(slices[i]);
-		legend.group(i);
-		legend.theme(id());
-		legend_.push_back(legend);
-	}
-
-	return true;
-}
-
-bool
-TeTheme::getAttTables(TeAttrTableVector& attrs, TeAttrTableType attType)
-{
-	TeAttrTableVector::iterator it = attTableVector_.begin();
-	while (it != attTableVector_.end())
-	{
-		if ((attType == TeAllAttrTypes) || ((*it).tableType() == attType))
-			attrs.push_back((*it));
-		++it;
-	}
-	return (!attrs.empty());
-}
-
-bool
-TeTheme::getTable(TeTable& table, const string tableName)
-{
-	unsigned int i;
-	for (i = 0; i < attTableVector_.size(); ++i)
-	{
-		if (attTableVector_[i].name() == tableName)
-		{
-			table = attTableVector_[i];
-			return true;
-		}
-	}
-	return false;
-}
-
-bool
-TeTheme::getTemporalTable(TeTable& table)
-{
-	TeAttrTableVector::iterator it = attTableVector_.begin();
-	while (it != attTableVector_.end())
-	{
-		if (((*it).tableType() == TeAttrEvent) || ((*it).tableType() == TeFixedGeomDynAttr))
-		{
-			table = (*it);
-			return true;
-		}
-		++it;
-	}
-	return false;
-}
-
-bool
-TeTheme::saveGrouping(TeSelectedObjects selectedObjects)
-{
-	return saveGrouping(layer_->database(), selectedObjects);
-}
-
-bool
-TeTheme::saveGrouping(TeDatabase* db, TeSelectedObjects)
-{
-	if(!db)
-		return false;
-
-	vector<TeLegendEntry> legVec = legend_;
-
-	// Delete the theme grouping(if any) from the database
-	if(db->deleteLegend(id()) == false)
-		return false;
-
-	if(grouping_.groupMode_ == TeNoGrouping)
-		return true;
-
-	// Insert the new grouping
-	if(db->insertGrouping(id(), grouping_) == false)
-		return false;
-
-	legend_ = legVec;
-	// Update (insert) the new legends
-	if (db->updateLegend(legend_) == false)
-		return false;
-
-	setLegendsForObjects();
-
-	if(legend_.size())
-		visibleRep_ = visibleRep_ | 0x40000000;
-	else
-		visibleRep_ = visibleRep_ | 0xbfffffff;
-	string upVis = "UPDATE te_theme SET visible_rep=" + Te2String(visibleRep_) + " WHERE theme_id=" + Te2String(id());
-	return (db->execute(upVis));
-
-	return true;
-}
-
-bool
-TeTheme::loadThemeTables()
-{
-	clearAttTableVector();
-	TeDatabase* db = this->layer()->database();
-	if(!db)
-		return false;
-	return (db->loadThemeTable(this));
-}
-
-bool
-TeTheme::addThemeTable(TeTable& inputTable)
-{
-	bool result = true;
-	TeAttrTableType type = inputTable.tableType();
-
-	if(inputTable.name() == collectionAuxTable_)
-	{
-		loadTablesJoin();
-		return false;
-	}
-
-	if (type == TeAttrMedia)
-		return false;
-
-	if(type != TeAttrStatic)
-	{
-		bool hasTemporal = false;
-		bool hasExtern = false;
-
-		TeAttrTableVector::iterator it = attTableVector_.begin();
-		while(it!=attTableVector_.end())
-		{
-			//temporal
-			if( (it->tableType()==TeAttrEvent) ||
-				(it->tableType()==TeFixedGeomDynAttr) ||
-				(it->tableType()==TeDynGeomDynAttr))
-				hasTemporal = true;
-
-			//extern
-			if((it->tableType())==TeAttrExternal)
-				hasExtern = true;
-
-			++it;
-		}
-
-		if( ((type==TeAttrEvent) ||
-			(type==TeFixedGeomDynAttr) ||
-			(type==TeDynGeomDynAttr)) && (hasTemporal || hasExtern))
-			result = false;
-		else if ((type==TeAttrExternal) && hasTemporal)
-			result = false;
-	}
-
-	if(!result)
-		return false;
-
-	attTableVector_.push_back(inputTable);
-	loadAliasVector();
-	loadAttrLists();
-	loadTablesJoin();
-	return true;
-}
-
-void
-TeTheme::addThemeTable(string tableName)
-{
-	TeTable table(tableName);
-	addThemeTable(table);
-}
-
-bool
-TeTheme::setAttTables(TeAttrTableVector& attrs)
-{
-	attTableVector_.clear();
-	int countTemporal = 0;
-	int countExtern = 0;
-	bool result = true;
-
-	TeAttrTableVector::iterator it = attrs.begin();
-	while(it!=attrs.end())
-	{
-		//temporal
-		if( (it->tableType()==TeAttrEvent) ||
-			(it->tableType()==TeFixedGeomDynAttr) ||
-			(it->tableType()==TeDynGeomDynAttr))
-			++countTemporal;
-
-		//extern
-		if(it->tableType()==TeAttrExternal)
-			++countExtern;
-
-		if( (it->tableType()==TeAttrMedia)     ||
-			(countTemporal>0 && countExtern>0) ||
-			(countTemporal>1) ||
-			(it->name() == collectionAuxTable_) )
-		{
-			result = false;
-		}
-		else
-		{
-			attTableVector_.push_back(*it);
-			loadAliasVector();
-			loadAttrLists();
-			loadTablesJoin();
-		}
-		++it;
-	}
-	return result;
-}
-
-bool
-TeTheme::removeThemeTable(unsigned int index)
-{
-	if (index > (attTableVector_.size() - 1))
-		return false;
-
-	TeAttrTableVector::iterator it;
-	it = attTableVector_.begin() + index;
-
-	attTableVector_.erase(it);
-	loadAliasVector();
-	loadAttrLists();
-	loadTablesJoin();
-	return true;
-}
-
-string
-TeTheme::getAttribute(unsigned int pos)
-{
-	unsigned int i;
-	unsigned int sumCols = 0, tableCol;
-	bool found = false;
-	for (i = 0; i < attTableVector_.size(); ++i)
-	{
-		TeAttributeList& attrList = attTableVector_[i].attributeList();
-		if (pos < (sumCols + attrList.size()))
-		{
-			if (i == 0)
-				tableCol = pos;
-			else
-				tableCol = pos - sumCols;
-			found = true;
-			break;
-		}
-		sumCols += attrList.size();
-	}
-
-	if (found == false)
-		return "";
-
-	TeAttributeList& attrList = attTableVector_[i].attributeList();
-	string attrName = attTableVector_[i].name() + "." + attrList[tableCol].rep_.name_;
-	return attrName;
-}
-
-bool
-TeTheme::isIndex(unsigned int pos)
-{
-	string fullAttrName = getAttribute(pos);
-	if (fullAttrName.empty() == true)
-		return false;
-
-	size_t idx = fullAttrName.find(".");
-	string tableName = fullAttrName.substr(0, idx);
-	string attrName = fullAttrName.substr(idx+1);
-
-	// Get the representation of a table given an attribute name
-	TeTable table;
-	if (getTable(table, tableName) == false)
-		return false;
-
-	// Check if the attribute is index or not
-	if(table.uniqueName() == attrName)
-		return true;
-
-	return false;
-}
-
-bool
-TeTheme::isThemeTable(int tableId)
-{
-	bool isThemeTable = false;
-	unsigned int i;
-	for (i = 0; i < attTableVector_.size(); ++i)
-	{
-		if (attTableVector_[i].id() == tableId)
-		{
-			isThemeTable = true;
-			break;
-		}
-	}
-	return isThemeTable;
-}
-
-bool
-TeTheme::isThemeTable(string tableName)
-{
-	bool isThemeTable = false;
-	for (unsigned int i = 0; i < attTableVector_.size(); ++i)
-	{
-		if (attTableVector_[i].name() == tableName)
-		{
-			isThemeTable = true;
-			break;
-		}
-	}
-	return isThemeTable;
-}
-
-string
-TeTheme::getTableName(const string& attrName)
-{
-	string tableName;
-	size_t pos = attrName.find(".");
-
-	if (pos != string::npos)
-		return tableName = attrName.substr(0, pos);
-
-	for (unsigned int i = 0; i < attTableVector_.size(); ++i)
-	{
-		TeAttributeList& attrList = attTableVector_[i].attributeList();
-		for (unsigned j = 0; j < attrList.size(); ++j)
-		{
-			if (attrList[j].rep_.name_ == attrName)
-			{
-				tableName = attTableVector_[i].name();
-				return tableName;
-			}
-		}
-	}
-
-	return tableName;
-}
-
-
-bool
-TeTheme::deleteGrouping()
-{
-	TeDatabase* db = layer_->database();
-	if(!db)
-		return false;
-
-	resetGrouping();
-
-	//delete te_legend table
-	if(!db->deleteLegend (this->id()))
-		return false;
-
-	//delete te_grouping table
-	string sql = "DELETE FROM te_grouping WHERE theme_id= "+ Te2String(this->id());
-	db->execute (sql);
-
-	return true;
-}
-
-bool
-TeTheme::createCollectionAuxTable()
-{
-	return createCollectionAuxTable(layer_->database());
-}
-
-bool
-TeTheme::createCollectionAuxTable(TeDatabase* db)
-{
-	unsigned int i, j;
-	bool status;
-	vector<string> indexes;
-
-	if(!db)
-		return false;
-
-	if(!db->tableExist(collectionTable_))
-		return false;
-
-	if(db->tableExist(collectionAuxTable_))
-	{
-		status = db->execute("DROP TABLE " + collectionAuxTable_);
-		if(db->tableExist(collectionAuxTable_))
-		{
-			if(!status)
-				return false;
-		}
-	}
-
-	TeAttributeList attList;
-
-	TeAttribute at;
-	at.rep_.type_ = TeSTRING;
-	at.rep_.numChar_ = 50;
-	at.rep_.name_ = "object_id";
-	attList.push_back(at);
-
-	j = 0;
-	for (i = 0; i < attTableVector_.size(); ++i)
-	{
-		if (attTableVector_[i].tableType() == TeAttrExternal ||
-			attTableVector_[i].tableType() == TeFixedGeomDynAttr)
-		{
-			at.rep_.name_ = "aux" + Te2String(j++);
-			attList.push_back(at);
-			indexes.push_back(at.rep_.name_);
-		}
-	}
-
-	at.rep_.isPrimaryKey_ = true;
-	at.rep_.numChar_ = 0;
-	at.rep_.name_ = "unique_id";
-	at.rep_.isAutoNumber_ = true;
-	at.rep_.type_ = TeINT;
-	attList.push_back(at);
-
-	at.rep_.name_ = "grid_status";
-	at.rep_.isPrimaryKey_ = false;
-	at.rep_.isAutoNumber_ = false;
-	at.rep_.numChar_ = 0;
-	attList.push_back(at);
-
-	status = db->createTable(collectionAuxTable_, attList);
-	if(!status)
-		return false;
-
-	string idxName = "te_idx_caux"+ Te2String(this->id());
-
-	//create index to object_id
-	db->createIndex(collectionAuxTable_, idxName+"_objId", "object_id");
-
-	for(unsigned int i=0; i<indexes.size(); ++i)
-		db->createIndex(collectionAuxTable_, idxName+"_"+indexes[i], indexes[i]);
-
-	return true;
-}
-
-bool TeTheme::isUpdated()
-{
-	if(layer() == NULL)
-	{
-		return false;
-	}
-	layer()->reloadLayerEditionTime();
-
-	if(this->getCreationTime() < layer()->getEditionTime())
-	{
-		return false;
-	}
-	return true;
-}
-
-bool
-TeTheme::populateCollectionAux(std::string objectId)
-{
-	TeDatabase* db = layer_->database();
-	if((!db) || (collectionTable_.empty()) || (collectionAuxTable_.empty()))
-		return false;
-
-	string whereClause;
-
-	whereClause = " WHERE 1=1 ";
-
-	// Populate the collection auxiliary table
-	string ins = "INSERT INTO " + collectionAuxTable_ + " (object_id";
-    unsigned int i, j;
-	j = 0;
-	for (i = 0; i < attTableVector_.size(); ++i)
-	{
-		if (attTableVector_[i].tableType() == TeAttrExternal ||
-			attTableVector_[i].tableType() == TeFixedGeomDynAttr)
-			ins += ", aux" + Te2String(j++);
-	}
-
-	ins += ", grid_status) SELECT c_object_id";
-	for (i = 0; i < attTableVector_.size(); ++i)
-	{
-		if (attTableVector_[i].tableType() == TeAttrExternal ||
-			attTableVector_[i].tableType() == TeFixedGeomDynAttr)
-			ins += "," + aliasVector()[i] + "." + attTableVector_[i].uniqueName();
-	}
-
-	ins += ",c_object_status";
-
-	//attribute restriction
-	if(!generateAttributeRest_.empty())
-		whereClause += " AND "+ generateAttributeRest_;
-
-	//temporal restriction
-	if(!generateTemporalRest_.empty())
-	{
-		string sqlTemp;
-		initParse(generateTemporalRest_, db);
-
-		if(!yyparse(sqlTemp))  //0: accept  1: reject
-			whereClause += " AND "+ sqlTemp;
-		else
-			return false;
-	}
-
-	//spatial restriction is already stored in the collection table
-
-	bool usaTemporal = false;
-	for (i = 0; i < attTableVector_.size(); ++i)
-	{
-		if (attTableVector_[i].tableType() == TeFixedGeomDynAttr ||
-			attTableVector_[i].tableType() == TeDynGeomDynAttr)
-			usaTemporal = true;
-	}
-	loadThemeTablesJoin();
-	string result = ins + sqlFrom() + whereClause + " ";
-	if (!objectId.empty() && !whereClause.empty())
-		result += " AND c_object_id = '"+objectId+"'";
-	if (!db->execute(result))
-		return false;
-
-	if(usaTemporal) // filter collection table
-	{
-		string s = "DELETE FROM " + collectionTable_ + " WHERE c_object_id NOT IN";
-		s += " (SELECT DISTINCT object_id FROM " + collectionAuxTable_ + ")";
-		return(db->execute(s));
-	}
-	return true;
-}
-
-
-bool
-TeTheme::locatePolygon (TeCoord2D &pt, TePolygon &polygon, const double& tol)
-{
-	if (!layer()->database() || collectionTable().empty())
-		return false;
-
-	string geomTable = layer()->tableName(TePOLYGONS);
-	string sqlFrom = " "+ geomTable +" INNER JOIN " + collectionTable();
-	sqlFrom += " ON "+ collectionTable() +".c_object_id = "+ geomTable +".object_id ";
-
-	if(!layer()->database()->locatePolygon(sqlFrom, pt, polygon, tol))
-		return false;
-
-	return true;
-}
-
-
-bool
-TeTheme::locatePolygonSet (TeCoord2D &pt, double tol, TePolygonSet &polygons)
-{
-	if (!layer()->database() || collectionTable().empty())
-		return false;
-
-	string geomTable = layer()->tableName(TePOLYGONS);
-	string sqlFrom = " "+ geomTable +" INNER JOIN " + collectionTable();
-	sqlFrom += " ON "+ collectionTable() +".c_object_id = "+ geomTable +".object_id ";
-
-	if(!layer()->database()->locatePolygonSet(sqlFrom, pt, tol, polygons))
-		return false;
-
-	return true;
-}
-
-bool
-TeTheme::locateLine (TeCoord2D &pt, TeLine2D &line, const double& tol)
-{
-	if (!layer()->database() || collectionTable().empty())
-		return false;
-
-	string geomTable = layer()->tableName(TeLINES);
-	string sqlFrom = " "+ geomTable +" INNER JOIN " + collectionTable();
-	sqlFrom += " ON "+ collectionTable() +".c_object_id = "+ geomTable +".object_id ";
-
-	if(!layer()->database()->locateLine(sqlFrom, pt, line, tol))
-		return false;
-
-	return true;
-}
-
-bool
-TeTheme::locatePoint (TeCoord2D &pt, TePoint &point, const double& tol)
-{
-	if (!layer()->database() || collectionTable().empty())
-		return false;
-
-	string geomTable = layer()->tableName(TePOINTS);
-	string sqlFrom = " "+ geomTable +" INNER JOIN " + collectionTable();
-	sqlFrom += " ON "+ collectionTable() +".c_object_id = "+ geomTable +".object_id ";
-
-	if(!layer()->database()->locatePoint(sqlFrom, pt, point, tol))
-		return false;
-
-	return true;
-}
-
-bool
-TeTheme::locateCell (TeCoord2D &pt, TeCell &cell, const double&  tol)
-{
-	if (!layer()->database() || collectionTable().empty())
-		return false;
-
-	string geomTable = layer()->tableName(TeCELLS);
-	string sqlFrom = " "+ geomTable +" INNER JOIN " + collectionTable();
-	sqlFrom += " ON "+ collectionTable() +".c_object_id = "+ geomTable +".object_id ";
-
-	if(!layer()->database()->locateCell(sqlFrom, pt, cell, tol))
-		return false;
-
-	return true;
-}
-
-//------------------------------ protected methods
-void
-TeTheme::loadAliasVector()
-{
-	unsigned int i, count;
-	TeTable table;
-	multimap<string, int> tableMMap;
-
-	aliasVector_.clear();
-
-	for (i = 0; i < attTableVector_.size(); ++i)
-	{
-		table = attTableVector_[i];
-
-		if (table.tableType() != TeAttrExternal)
-			aliasVector_.push_back(table.name());
-		else
-		{
-			count = tableMMap.count(table.name());
-			if (count == 0)
-				aliasVector_.push_back(table.name());
-			else
-				aliasVector_.push_back(table.name() + "_" + Te2String(count));
-
-			tableMMap.insert(multimap<string,int>::value_type(table.name(), ++count));
-		}
-	}
-}
-
-string
-TeTheme::sqlGridFrom(const string& geomTable)
-{
-	if(geomTable.empty())
-		return sqlGridFrom_;
-
-	string result;
-	loadTablesJoin(geomTable);
-	result = sqlGridFrom_;
-	loadTablesJoin();
-	return result;
-}
-
-bool
-TeTheme::generateLabelPositions(const std::string& objectId)
-{
-	TeDatabase* db = layer()->database();
-	if(!db)
-		return false;
-
-	return (db->generateLabelPositions(this, objectId));
-}
-
-void
-TeTheme::loadTablesJoin(const string& geomTable)  //sqlGridFrom and sqlGridJoin
-{
-	unsigned int i, count;
-	multimap<string, int> tableMMap;
-    TeTable table;
-    bool hasExternalTable = false;
-
-    // Set the new sqlGridFrom_ clause and the new sqlGridJoin_ string
-    sqlGridFrom_.clear();
-    sqlGridJoin_.clear();
-
-    TeAttrTableVector tableVec;
-    vector<string>    aliasVec;
-
-    if(!geomTable.empty())
-    {
-        TeTable table;
-        table.name(geomTable);
-        table.setLinkName("object_id");
-        table.setUniqueName("object_id");
-        table.setTableType(TeAttrStatic);
-        tableVec.push_back(table);
-
-        for(i=0; i<attTableVector_.size(); ++i)
-            tableVec.push_back(attTableVector_[i]);
-
-        aliasVec.push_back(geomTable);
-        for(i=0; i<aliasVector_.size(); ++i)
-            aliasVec.push_back(aliasVector_[i]);
-    }
-    else
-    {
-        tableVec = attTableVector_;
-        aliasVec = aliasVector_;
-    }
-
-    //verify if there is external table
-    for (i = 0; i < tableVec.size(); ++i)
-    {
-        if (tableVec[i].tableType() == TeAttrExternal)
-        {
-            hasExternalTable = true;
-            break;
-        }
-    }
-
-    if(!collectionAuxTable_.empty())
-    {
-        sqlGridFrom_ = " FROM ";
-
-        for (i = 0; i <= tableVec.size(); ++i)
-            sqlGridFrom_ += "(";
-
-        sqlGridFrom_ += collectionAuxTable_;
-        sqlGridJoin_ = "SELECT ";
-
-        if(hasExternalTable)
-            sqlGridFrom_ += " RIGHT JOIN "+ collectionTable_;
-        else
-            sqlGridFrom_ += " LEFT JOIN "+ collectionTable_;
-
-        sqlGridFrom_ += " ON "+ collectionAuxTable_ +".object_id = "+ collectionTable_ +".c_object_id )";
-
-        int numAux = 0;
-        for (i = 0; i < tableVec.size(); ++i)
-        {
-            table = tableVec[i];
-            if ((table.tableType()==TeAttrStatic) || (table.tableType()==TeAttrMedia) || (table.tableType()==TeAttrEvent))
-            {
-                sqlGridFrom_ += " LEFT JOIN " + aliasVec[i];
-                sqlGridFrom_ += " ON " + collectionTable_ +".c_object_id = " + aliasVec[i] + "." + table.linkName() +")";
-            }
-            else if (table.tableType() == TeAttrExternal)
-            {
-				count = tableMMap.count(table.name());
-				if (count == 0)
-					sqlGridFrom_ += " LEFT JOIN " + aliasVec[i];
-				else
-					sqlGridFrom_ += " LEFT JOIN " + table.name() + " AS " + aliasVec[i];
-
-				tableMMap.insert(multimap<string,int>::value_type(table.name(), ++count));
-                sqlGridFrom_ += " ON " + collectionAuxTable_ + ".aux" + Te2String(numAux++) +" = "+ aliasVec[i] +"."+ table.uniqueName() +")";
-            }
-            else
-            {
-                sqlGridFrom_ += " LEFT JOIN " + aliasVec[i];
-                sqlGridFrom_ += " ON " + collectionAuxTable_ + ".aux" + Te2String(numAux++) +" = "+ aliasVec[i] +"."+ table.uniqueName() +")";
-            }
-
-            sqlGridJoin_ += aliasVec[i] + ".*,";
-        }
-
-        sqlGridJoin_ += collectionTable_ + ".*, " +  collectionAuxTable_ + ".* " + sqlGridFrom_;
-    }
-
-	loadThemeTablesJoin();
- }
-
-void TeTheme::loadThemeTablesJoin()  ////sqlJoin and sqlFrom
-{
-	unsigned int i, count;
-	multimap<string, int> tableMMap;
-	TeTable table;
-
-	// Set the new from clause and the new join string
-	sqlFrom_.clear();
-	sqlJoin_.clear();
-
-	sqlFrom_ = " FROM ";
-	sqlJoin_ = "SELECT ";
-
-	if (collectionTable_.empty() == false)
-	{
-		for (i = 0; i < attTableVector_.size(); ++i)
-			sqlFrom_ += "(";
-		sqlFrom_ += collectionTable_;
-
-		for (i = 0; i < attTableVector_.size(); ++i)
-		{
-			table = attTableVector_[i];
-			if (table.tableType() != TeAttrExternal)
-			{
-				sqlFrom_ += " LEFT JOIN " + aliasVector_[i];
-				sqlFrom_ += " ON " + collectionTable_ + ".c_object_id = " + aliasVector_[i] + "." + table.linkName() + ")";
-			}
-			else
-			{
-				count = tableMMap.count(table.name());
-				if (count == 0)
-					sqlFrom_ += " LEFT JOIN " + aliasVector_[i];
-				else
-					sqlFrom_ += " LEFT JOIN " + table.name() + " AS " + aliasVector_[i];
-
-				tableMMap.insert(multimap<string,int>::value_type(table.name(), ++count));
-
-				sqlFrom_ += " ON " + table.relatedTableName() + "." + table.relatedAttribute() + " = ";
-				sqlFrom_ +=  aliasVector_[i] + "." + table.linkName() + ")";
-			}
-
-			sqlJoin_ += aliasVector_[i] + ".*,";
-		}
-
-		sqlJoin_ += collectionTable_ + ".*" + sqlFrom_;
-	}
-	else
-	{
-		if (attTableVector_.size() == 1)
-		{
-			table = attTableVector_[0];
-			sqlFrom_ += table.name();
-			sqlJoin_ = "SELECT " + table.name() + ".*" + sqlFrom_;
-		}
-		else
-		{
-			for (i = 0; i < attTableVector_.size() - 1; ++i)
-				sqlFrom_ += "(";
-
-			TeTable firstTable = attTableVector_[0];
-			sqlFrom_ += firstTable.name();
-			sqlJoin_ += firstTable.name() + ".*,";
-			for (i = 1; i < attTableVector_.size(); ++i)
-			{
-				table = attTableVector_[i];
-				sqlFrom_ += " LEFT JOIN " + aliasVector_[i];
-				sqlFrom_ += " ON " + firstTable.name() + "." + firstTable.linkName() + " = " + aliasVector_[i] + "." + table.linkName() + ")";
-
-				if (i == attTableVector_.size() - 1)
-					sqlJoin_ += aliasVector_[i] + ".*";
-				else
-					sqlJoin_ += aliasVector_[i] + ".*,";
-			}
-
-			sqlJoin_ += sqlFrom_;
-		}
-	}
-	return;
-}
-
-void
-TeTheme::loadAttrLists()
-{
-	// Set the new list of attributes of all the theme tables and its new numerical list,
-	unsigned int i, j, count;
-	TeTable table;
-	multimap<string, int> attrMMap;
-	string attrName;
-
-	sqlAttList_.clear();
-	sqlNumAttList_.clear();
-
-	if (layer() == 0)
-		return;
-	TeDatabase *db = layer()->database();
-
-	for (i = 0; i < attTableVector_.size(); ++i)
-	{
-		table = attTableVector_[i];
-		// Set the map of attribute names
-		if(table.attributeList().empty())
-			db->getAttributeList(table.name(), table.attributeList());
-
-		for (j = 0; j < table.attributeList().size(); ++j)
-		{
-			attrName = table.attributeList()[j].rep_.name_;
-			count = attrMMap.count(attrName);
-			attrMMap.insert(multimap<string,int>::value_type(attrName, ++count));
-		}
-	}
-
-	// Set the list of attribute names that contains all the attribute names
-	// of the theme tables
-	for (i = 0; i < attTableVector_.size(); ++i)
-	{
-		table = attTableVector_[i];
-		TeAttributeList attrList=table.attributeList();
-		if(attrList.empty())
-			db->getAttributeList(table.name(), attrList);
-		for (j = 0; j < attrList.size(); ++j)
-		{
-			attrName = attrList[j].rep_.name_;
-			count = attrMMap.count(attrName);
-			if (count == 1)
-				attrList[j].rep_.name_ = attrName;
-			else
-				attrList[j].rep_.name_ = aliasVector_[i] + "." + attrName;
-
-			sqlAttList_.push_back(attrList[j]);
-		}
-	}
-
-	// Set the list of attribute names that contains all the numeric attribute names
-	// of the theme tables
-	for(i = 0; i < sqlAttList_.size(); ++i)
-	{
-		if(sqlAttList_[i].rep_.type_ == TeREAL || sqlAttList_[i].rep_.type_ == TeINT)
-			sqlNumAttList_.push_back(sqlAttList_[i]);
-	}
-}
-
-void
-TeTheme::setLegendsForObjects()
-{
-	if(grouping_.groupMode_ == TeNoGrouping || attTableVector_.empty())
-		return;
-
-	unsigned int i, j;
-	string func, query, oid, val;
-
-	TeDatabase *db = layer_->database();
-	TeDatabasePortal* portal = db->getPortal();
-
-	TeAttrDataType type = grouping_.groupAttribute_.type_;
-	string	groupingAttr = grouping_.groupAttribute_.name_;
-
-	vector<string> oidVec;
-	vector<string> oidWithNullValVec;
-	vector<string> valVec;
-	map<int, set<string> > legObjSetMap;
-
-	objLegendMap_.clear();
-
-	if(grouping_.groupFunction_.empty())
-		func = "MIN";
-	else
-		func = grouping_.groupFunction_;
-
-	if(grouping_.groupFunction_ == "COUNT")
-		type = TeINT;
-
-	query = "SELECT MIN(" + attTableVector_[0].uniqueName() + ")";
-	query += ", " + func + "(" + groupingAttr + ")" + sqlFrom_;
-	query += " GROUP BY " + attTableVector_[0].uniqueName();
-
-	if(portal->query(query) == false)
-	{
-		delete portal;
-		return;
-	}
-
-	while(portal->fetchRow())
-	{
-		oid = portal->getData(0);
-		val = portal->getData(1);
-		if (val.empty() == false)
-		{
-			oidVec.push_back(oid);
-			valVec.push_back(val);
-		}
-		else
-			oidWithNullValVec.push_back(oid);
-	}
-
-	unsigned int legSize = legend_.size();
-	if(grouping_.groupNullAttr_ && oidWithNullValVec.size() > 0)
-		--legSize;
-
-	if (grouping_.groupMode_ == TeUniqueValue)
-	{
-		for (i = 0; i < oidVec.size(); ++i)
-		{
-			oid = oidVec[i];
-			val = valVec[i];
-
-			if(type == TeREAL)
-				val = Te2String(atof(val.c_str()), grouping_.groupPrecision_);
-			else if(type == TeINT)
-				val = Te2String(atoi(val.c_str()));
-
-			for(j = 0; j < legSize; ++j)
-			{
-				TeLegendEntry& leg = legend_[j];
-				if(val == leg.from())
-				{
-					objLegendMap_[oid] = leg.id();
-					set<string>& oidSet = legObjSetMap[leg.id()];
-					oidSet.insert(oid);
-					break;
-				}
-			}
-		}
-	}
-	else
-	{
-		for (i = 0; i < oidVec.size(); ++i)
-		{
-			double dVal, dFrom, dTo;
-			oid = oidVec[i];
-			val = valVec[i];
-
-			if (type == TeREAL)
-				val = Te2String(atof(val.c_str()), grouping_.groupPrecision_);
-
-			for (j = 0; j < legSize; ++j)
-			{
-				TeLegendEntry& leg = legend_[j];
-				if (leg.from().find("mean") != string::npos)
-					continue;
-
-				dVal  = atof(val.c_str());
-				dFrom = atof(leg.from().c_str());
-				dTo = atof(leg.to().c_str());
-
-				if (j < (legSize - 1))
-				{
-					if(dVal >= dFrom && dVal < dTo)
-					{
-						objLegendMap_[oid] = leg.id();
-						set<string>& oidSet = legObjSetMap[leg.id()];
-						oidSet.insert(oid);
-						break;
-					}
-				}
-				else
-				{
-					if(dVal >= dFrom && dVal <= dTo)
-					{
-						objLegendMap_[oid] = leg.id();
-						set<string>& oidSet = legObjSetMap[leg.id()];
-						oidSet.insert(oid);
-						break;
-					}
-				}
-			}
-		}
-	}
-	delete portal;
-
-	// Set the leg id for the objects with null values
-	int legId = defaultLegend_.id();
-	if (grouping_.groupNullAttr_)
-		legId = legend_[legend_.size() - 1].id();
-
-	for (i = 0; i < oidWithNullValVec.size(); ++i)
-	{
-		oid = oidWithNullValVec[i];
-		objLegendMap_[oid] = legId;
-		set<string>& oidSet = legObjSetMap[legId];
-		oidSet.insert(oid);
-	}
-
-/*
-	// Insert the legends in the te_legend table
-	map<int, set<string> >::iterator mapIt;
-	set<string>::iterator setIt;
-	unsigned char *data;
-	string where = " theme_id = " + Te2String(id());
-	for (mapIt = legObjSetMap.begin(); mapIt != legObjSetMap.end(); ++mapIt)
-	{
-		legId = mapIt->first;
-		set<string>& oidSet = mapIt->second;
-		string whereClause = where;
-		whereClause +=  " AND legend_id = " + Te2String(legId);
-		string objStr;
-		for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
-			objStr += *setIt + ';';
-		data = (unsigned char*)objStr.c_str();
-		db->insertBlob("te_legend", "object_list", whereClause, data, objStr.size());
-	}
-*/
-}
-
-void
-TeTheme::setOwnLegendsForObjects()
-{
-
-}
-
-bool
-TeTheme::saveLegendInCollection(TeSelectedObjects selectedObjects, std::string objectId)
-{
-	return saveLegendInCollection(layer()->database(), selectedObjects, objectId);
-}
-
-bool
-TeTheme::saveLegendInCollection(TeDatabase* db, TeSelectedObjects selectedObjects, std::string objectId)
-{
-	unsigned int i;
-	if(!db || grouping_.groupMode_ == TeNoGrouping)
-		return false;
-
-	TeAttrDataType		type = grouping_.groupAttribute_.type_;
-	TeLegendEntryVector legVec = legend_;
-	string			groupingAttr = grouping_.groupAttribute_.name_;
-
-	string input;
-	if(selectedObjects == TeSelectedByPointing)
-	{
-		input = " WHERE (grid_status = 1 OR grid_status = 3";
-		input += " OR (grid_status IS NULL AND (c_object_status = 1 OR c_object_status = 3)))";
-	}
-	else if(selectedObjects == TeNotSelectedByPointing)
-	{
-		input = " WHERE (grid_status = 0 OR grid_status = 2";
-		input += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
-	}
-	else if(selectedObjects == TeSelectedByQuery)
-	{
-		input = " WHERE (grid_status = 2 OR grid_status = 3";
-		input += " OR (grid_status is null AND (c_object_status = 2 OR c_object_status = 3)))";
-	}
-	else if(selectedObjects == TeNotSelectedByQuery)
-	{
-		input = " WHERE (grid_status = 0 OR grid_status = 1";
-		input += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 1)))";
-	}
-	else if(selectedObjects == TeGrouped)
-		input = " WHERE c_legend_id <> 0";
-	else if(selectedObjects == TeNotGrouped)
-		input = " WHERE c_legend_id = 0";
-
-
-	string func;
-	if(grouping_.groupFunction_.empty())
-		func = " MIN";
-	else
-		func = grouping_.groupFunction_;
-
-	if(grouping_.groupFunction_ == "COUNT")
-		type = TeINT;
-
-	string query = "SELECT MIN(" + collectionTable_ + ".c_object_id)";
-	if(grouping_.groupNormAttribute_.empty())
-		query += ", "+ func +"(" + groupingAttr + ")" + sqlGridFrom();
-	else
-		query += ", "+ func +"(" + groupingAttr + ") / "+ func +"(" + grouping_.groupNormAttribute_ + ")" + sqlGridFrom();
-
-	if(selectedObjects != TeAll)
-		query += input;
-
-	query += " GROUP BY " + collectionTable_ + ".c_object_id";
-
-	map<int, vector<string> > legMap;
-
-	TeDatabasePortal* portal = db->getPortal();
-	if(portal->query(query) == false)
-	{
-		delete portal;
-		return false;
-	}
-
-	vector<string> idVec;
-	vector<string> nullIdVec;
-	vector<string> valVec;
-	while(portal->fetchRow())
-	{
-		string val = portal->getData(1);
-		string oid = portal->getData(0);
-		if (val.empty() == false)
-		{
-			idVec.push_back(oid);
-			valVec.push_back(val);
-		}
-		else
-			nullIdVec.push_back(oid);
-	}
-	if (grouping_.groupMode_ == TeUniqueValue)
-	{
-		unsigned int j = 0;
-		while( j < idVec.size())
-		{
-			string val = valVec[j];
-			string oid = idVec[j];
-			if(type == TeREAL)
-			{
-				double a = atof(val.c_str());
-				val = Te2String(a, grouping_.groupPrecision_);
-			}
-			else if(type == TeINT)
-			{
-				int a = atoi(val.c_str());
-				val = Te2String(a);
-			}
-
-			unsigned int siz = legend_.size();
-			if(grouping_.groupNullAttr_ && nullIdVec.size() > 0)
-				--siz;
-			for(i=0; i < siz; i++)
-			{
-				TeLegendEntry& leg = legend_[i];
-				if(val == leg.from())
-				{
-					legMap[leg.id()].push_back(oid);
-					break;
-				}
-			}
-			j++;
-		}
-	}
-	else
-	{
-		unsigned int j = 0;
-		while(j < idVec.size())
-		{
-			string val = valVec[j];
-			string oid = idVec[j];
-			if(type == TeREAL)
-			{
-				double a = atof(val.c_str());
-				val = Te2String(a, grouping_.groupPrecision_);
-			}
-
-			unsigned int siz = legend_.size();
-			if(grouping_.groupNullAttr_ && !nullIdVec.empty())
-               --siz;
-			for(i=0; i < siz; i++)
-			{
-				TeLegendEntry& leg = legend_[i];
-				int f = leg.from().find("mean");
-				if(f >= 0)
-					continue;
-				double dval = atof(val.c_str());
-				double dfrom = atof(leg.from().c_str());
-				double dto = atof(leg.to().c_str());
-				if(i < legend_.size()-1)
-				{
-					if(dval >= dfrom && dval < dto)
-					{
-						legMap[leg.id()].push_back(oid);
-						break;
-					}
-				}
-				else
-				{
-					if(dval >= dfrom && dval <= dto)
-					{
-						legMap[leg.id()].push_back(oid);
-						break;
-					}
-				}
-			}
-			j++;
-		}
-	}
-	delete portal;
-
-	int legId = defaultLegend_.id();
-	if (grouping_.groupNullAttr_)
-		legId = legend_[legend_.size()-1].id();
-	for(i = 0; i < nullIdVec.size(); ++i)
-	{
-		string oid = nullIdVec[i];
-		legMap[legId].push_back(oid);
-	}
-
-	vector<string> svec;
-	map<int, vector<string> > :: iterator it = legMap.begin();
-	while(it != legMap.end())
-	{
-    	// --- Generate In Clauses ----
-		unsigned int i, j, k, size, chunkSize = 200, nChunks;
-		string inClause;
-		size = it->second.size();
-		if (size % chunkSize)
-			nChunks = size / chunkSize + 1;
-		else
-			nChunks = size / chunkSize;
-
-		j = 0;
-		for (k = 0; k < nChunks; ++k)
-		{
-			i = 0;
-			inClause = "(";
-			while (j < size && i < chunkSize)
-			{
-				inClause += "'" + db->escapeSequence(it->second[j]) + "',";
-				i++;
-				j++;
-			}
-			inClause[inClause.size() - 1] = ')';
-			svec.push_back(inClause);
-		}
-
-		//--- generateInClause
-
-		for(i=0; i<svec.size(); ++i)
-		{
-			string up = "UPDATE " + collectionTable_ + " SET c_legend_id = " + Te2String(it->first);
-			up += " WHERE c_object_id IN " + svec[i];
-			if (!objectId.empty())
-				up += " AND c_object_id='"+objectId+"'";
-			if(db->execute(up) == false)
-				continue;
-		}
-		it++;
-		svec.clear();
-	}
-	if(legend_.size())
-		visibleRep_ = visibleRep_ | 0x40000000;
-	else
-		visibleRep_ = visibleRep_ | 0xbfffffff;
-	string upVis = "UPDATE te_theme SET visible_rep=" + Te2String(visibleRep_) + " WHERE theme_id=" + Te2String(id());
-	return (db->execute(upVis));
-}
-
-bool
-TeTheme::populateCollection(std::string objectId)
-{
-	TeDatabase* db = layer_->database();
-	if(!db || collectionTable_.empty())
-		return false;
-
-	if(attTableVector_.empty())
-		attTableVector_ = layer_->attrTables();
-
-	TeRepresPointerVector& represVec = layer_->vectRepres();
-	for (unsigned int i = 0; i < represVec.size(); ++i)
-	{
-		TeRepresentation* rep = represVec[i];
-		if(rep->geomRep_ == TeTEXT)
-			continue;
-
-		string geomTable = layer_->tableName(rep->geomRep_);
-
-		string sqlSelect, sqlFrom, sqlWhere;
-
-		sqlSelect = " SELECT DISTINCT "+ geomTable +".object_id ";
-		sqlFrom = tableJoin(attTableVector_, geomTable, "object_id");
-
-		sqlWhere  = " WHERE NOT EXISTS (SELECT * FROM " + collectionTable_;
-		sqlWhere += " WHERE "+ collectionTable_ +".c_object_id = "+ geomTable +".object_id )";
-		sqlWhere += " AND " + geomTable + ".object_id IS NOT NULL ";
-
-		//attribute restriction
-		if(!generateAttributeRest_.empty())
-			sqlWhere += " AND ("+ generateAttributeRest_ +" )";
-
-		//temporal restriction
-		if(!generateTemporalRest_.empty())
-		{
-			string sqlTemp;
-			initParse(generateTemporalRest_, db);
-
-			if(!yyparse(sqlTemp))  //0: accept  1: reject
-				sqlWhere += " AND "+ sqlTemp;
-			else
-				return false;
-		}
-
-		TeKeys objs;
-
-		//spatial restriction
-		if(hasSpatialRes_)
-		{
-			if(boxRest_.isValid())
-			{
-				TeBox box = boxRest_;
-				sqlWhere += " AND "+ db->getSQLBoxWhere(box, geomRepRest_);
-			}
-			else if (geomRest_)
-			{
-				TePrecision::instance().setPrecision(TeGetPrecision(layer()->projection()));
-
-				if(db->spatialRelation(geomTable, geomRepRest_, geomRest_, objs, spatialRelation_))
-				{
-					string obs;
-					for(unsigned int i=0; i<objs.size(); i++)
-					{
-						if(i!=0)
-							obs += ",";
-						obs += "'"+ objs[i] +"'";
-					}
-
-					sqlWhere += " AND "+ geomTable +".object_id IN ("+ obs +")";
-				}
-			}
-		}
-
-		//populate the collection table
-		string popule;
-		popule = " INSERT INTO "+ collectionTable_ +" (c_object_id) ";
-		popule += sqlSelect +" FROM "+ sqlFrom + sqlWhere;
-		if (!objectId.empty())
-		{
-			if (sqlWhere.length())
-				popule += " AND ";
-			popule += geomTable +".object_id='" +objectId+ "'";
-		}
-
-		if (!db->execute(popule))
-		{
-			//Treats an error in the MySQL database system
-			//Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
-			//Message: Duplicate entry '%s' for key %d
-			if(db->dbmsName() != "MySQL" || db->errorNum()!=1062)
-                return false;
-		}
-	}
-
-//	int defaultLegend = defaultLegend_.id();
-	string popule = "UPDATE " + collectionTable_;
-	popule += " SET c_legend_id=0, c_legend_own=0, c_object_status=0 ";
-
-	if (!objectId.empty())
-		popule += " WHERE c_object_id='"+objectId+"'";
-
-	if (!db->execute(popule))
-		return false;
-
-	themeBox_= getThemeBox();
-	return true;
-}
-
-bool TeTheme::hasObjectsWithoutGeometries(TeGeomRep geomRep)
-{
-	if(!layer() || !layer()->database())
-		return true;
-
-	//get the geometry table
-	string geomTable = layer()->tableName(geomRep);
-	if(geomTable.empty())
-		return true;
-
-	TeDatabasePortal* portal = layer()->database()->getPortal();
-	if(!portal)
-		return true;
-
-	//Verify the collection table or attribute tables
-	if(layer()->database()->tableExist(collectionTable()))
-	{
-		string s = " SELECT COUNT(*) ";
-		s+= " FROM "+  collectionTable();
-		s+= " WHERE NOT EXISTS ";
-		s+= " (SELECT * FROM "+ geomTable;
-		s+= " WHERE "+ collectionTable() +".c_object_id ";
-		s+= " = "+ geomTable +".object_id ) ";
-
-		if(!portal->query(s) || !portal->fetchRow())
-		{
-			delete portal;
-			return true;
-		}
-
-		int numObjs = atoi(portal->getData(0));
-		if(numObjs>0)
-		{
-			delete portal;
-			return true;
-		}
-	}
-	else
-	{
-		//for each static table
-		for(unsigned int i=0; i<this->attrTables().size(); ++i)
-		{
-			if(	this->attrTables()[i].tableType() == TeAttrExternal ||
-				this->attrTables()[i].tableType() == TeAttrMedia ||
-				this->attrTables()[i].tableType() == TeGeocodingData)
-				continue;
-
-			string s = " SELECT COUNT(*) ";
-			s+= " FROM "+  attrTables()[i].name();
-			s+= " WHERE NOT EXISTS ";
-			s+= " (SELECT * FROM "+ geomTable;
-			s+= " WHERE "+ attrTables()[i].name() +"."+ attrTables()[i].linkName();
-			s+= " = "+ geomTable +".object_id ) ";
-
-			if(!portal->query(s) || !portal->fetchRow())
-			{
-				delete portal;
-				return true;
-			}
-
-			int numObjs = atoi(portal->getData(0));
-			if(numObjs>0)
-			{
-				delete portal;
-				return true;
-			}
-		}
-	}
-
-	delete portal;
-	return false;
-}
-
-bool TeTheme::removeObjectsWithoutGeometries(TeGeomRep geomRep)
-{
-	if(!layer() || !layer()->database() || !layer()->database()->tableExist(collectionTable()))
-		return true;
-
-	//get the geometry table
-	string geomTable = layer()->tableName(geomRep);
-	if(geomTable.empty())
-		return true;
-
-	string del = " DELETE FROM "+ collectionTable();
-	del += " WHERE NOT EXISTS ";
-	del += " (SELECT * FROM "+ geomTable;
-	del += " WHERE "+ collectionTable() +".c_object_id = ";
-	del += geomTable +".object_id) ";
-
-	if(!layer()->database()->execute(del))
-		return false;
-
-	del = " DELETE FROM "+ collectionAuxTable();
-	del += " WHERE NOT EXISTS ";
-	del += " (SELECT * FROM "+ geomTable;
-	del += " WHERE "+ collectionAuxTable() +".object_id = ";
-	del += geomTable +".object_id) ";
-
-	if(!layer()->database()->execute(del))
-		return false;
-
-	return true;
-}
-
-bool
-TeTheme::save()
-{
-	TeDatabase* db = layer()->database();
-	if(!db)
-		return false;
-
-	//insert theme in database
-	if(id()==0)
-	{
-		if(!db->insertTheme(this)) //updateThemeTable
-		{
-			db->deleteTheme(this->id());
-			return false;
-		}
-	}
-
-    if(useCollection_)
-    {
-	    //collection table
-	    if(collectionTable().empty())
-		    collectionTable("te_collection_"+ Te2String(id()));
-
-	    if(!db->createCollectionTable(collectionTable_))
-	    {
-		    db->deleteTheme(this->id());
-		    return false;
-	    }
-
-	    //collection aux table
-	    collectionAuxTable(collectionTable() + "_aux");
-	    addThemeTable(collectionAuxTable());
-
-	    if(!createCollectionAuxTable())
-	    {
-		    db->deleteTheme(this->id());
-		    return false;
-	    }
-    }
-
-	return true;
-}
-
-set<string> TeTheme::getObjects(TeSelectedObjects selectedObjects)
-{
-	if (selectedObjects == TeAll)
-	{
-		if (objectSet_.empty() == false)
-			return objectSet_;
-		else
-		{
-			if (attTableVector_.empty())
-				return set<string>();
-
-			// Set the new set of objects
-			if (layer_->hasGeometry(TeRASTER) == false)
-			{
-				TeDatabase *db = layer_->database();
-				TeDatabasePortal* portal = db->getPortal();
-
-				string q = "SELECT " + attTableVector_[0].name() + "." + attTableVector_[0].uniqueName() + sqlFrom();
-				if (portal->query(q) == false)
-				{
-					delete portal;
-					return set<string>();
-				}
-
-				while (portal->fetchRow())
-					objectSet_.insert(portal->getData(0));
-
-				delete portal;
-				return objectSet_;
-			}
-		}
-	}
-
-	set<string> oidSet;
-	map<string, int>::iterator it;
-	string oid;
-
-	if (selectedObjects == TeSelectedByPointing)
-	{
-		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
-		{
-			oid = it->first;
-			if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TePOINTED_QUERIED)
-				oidSet.insert(oid);
-		}
-	}
-	else if (selectedObjects == TeNotSelectedByPointing)
-	{
-		oidSet = getObjects();
-		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
-		{
-			oid = it->first;
-			if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TePOINTED_QUERIED)
-				oidSet.erase(oid);
-		}
-	}
-	else if (selectedObjects == TeSelectedByQuery)
-	{
-		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
-		{
-			oid = it->first;
-			if (objStatusMap_[oid] == TeQUERIED || objStatusMap_[oid] == TePOINTED_QUERIED)
-				oidSet.insert(oid);
-		}
-	}
-	else if (selectedObjects == TeNotSelectedByQuery)
-	{
-		oidSet = getObjects();
-		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
-		{
-			oid = it->first;
-			if (objStatusMap_[oid] == TeQUERIED || objStatusMap_[oid] == TePOINTED_QUERIED)
-				oidSet.erase(oid);
-		}
-	}
-	else if(selectedObjects == TeGrouped)
-	{
-		map<string, int>& objLegendMap = getObjLegendMap();
-		for (it = objLegendMap.begin(); it != objLegendMap.end(); ++it)
-		{
-			string oid = it->first;
-			if (objLegendMap[oid] != 0)
-				oidSet.insert(oid);
-		}
-	}
-	else if(selectedObjects == TeNotGrouped)
-	{
-		oidSet = getObjects();
-		map<string, int>& objLegendMap = getObjLegendMap();
-		for (it = objLegendMap.begin(); it != objLegendMap.end(); ++it)
-			oidSet.erase(it->first);
-	}
-	else if(selectedObjects == TeSelectedByPointingOrQuery)
-	{
-		oidSet = getObjects();
-		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
-		{
-			oid = it->first;
-			if (objStatusMap_[oid] == TeQUERIED || objStatusMap_[oid] == TePOINTED)
-				oidSet.insert(oid);
-		}
-	}
-	else if(selectedObjects == TeSelectedByPointingAndQuery )
-	{
-		oidSet = getObjects();
-		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
-		{
-			oid = it->first;
-			if (objStatusMap_[oid] == TePOINTED_QUERIED )
-				oidSet.insert(oid);
-		}
-	}
-
-	return oidSet;
-}
-
-vector<string> TeTheme::getItemVector(TeSelectedObjects selectedObjects)
-{
-	vector<string> itemVec;
-
-	//======================================================================================
-	//Get all the items
-	vector<string> allItemVec;
-	string item;
-	unsigned int i;
-
-	if (selectedObjects == TeAll || selectedObjects == TeNotSelectedByPointing ||
-		selectedObjects == TeNotSelectedByQuery)
-	{
-		vector<TeTable> tableVec;
-		getAttTables(tableVec);
-
-		string q = "SELECT ";
-		for (i = 0; i < tableVec.size(); ++i)
-		{
-			if (i != 0)
-				q += ",";
-			q += tableVec[i].uniqueName();
-		}
-		q += sqlFrom();
-
-		TeDatabase* db = layer()->database();
-		TeDatabasePortal* portal = db->getPortal();
-
-		if (portal->query(q) == false)
-		{
-			delete portal;
-			return itemVec;
-		}
-
-		while(portal->fetchRow())
-		{
-			item = portal->getData(tableVec[0].uniqueName());
-			for (i = 1; i < tableVec.size(); ++i)
-				item += portal->getData(tableVec[i].uniqueName());
-			allItemVec.push_back(item);
-		}
-
-		delete portal;
-	}
-
-	//======================================================================================
-	// Get the items according to the selectedObjects variable
-	map<string, int>& itemStatusMap = getItemStatusMap();
-	map<string, int>::iterator it;
-
-	if (selectedObjects == TeAll)
-		return allItemVec;
-	else if(selectedObjects == TeSelectedByPointing)
-	{
-		for (it = itemStatusMap.begin(); it != itemStatusMap.end(); ++it)
-		{
-			item = it->first;
-			if (itemStatusMap[item] == TePOINTED || itemStatusMap[item] == TePOINTED_QUERIED)
-				itemVec.push_back(item);
-		}
-	}
-	else if(selectedObjects == TeNotSelectedByPointing)
-	{
-		for (i = 0; i < allItemVec.size(); ++i)
-		{
-			item = allItemVec[i];
-			if (itemStatusMap[item] == TeDEFAULT || itemStatusMap[item] == TeQUERIED)
-				itemVec.push_back(item);
-
-			if (itemStatusMap[item] == TeDEFAULT)
-				itemStatusMap.erase(item);
-		}
-	}
-	else if(selectedObjects == TeSelectedByQuery)
-	{
-		for (it = itemStatusMap.begin(); it != itemStatusMap.end(); ++it)
-		{
-			item = it->first;
-			if (itemStatusMap[item] == TeQUERIED || itemStatusMap[item] == TePOINTED_QUERIED)
-				itemVec.push_back(item);
-		}
-	}
-	else if(selectedObjects == TeNotSelectedByQuery)
-	{
-		for (i = 0; i < allItemVec.size(); ++i)
-		{
-			item = allItemVec[i];
-			if (itemStatusMap[item] == TeDEFAULT || itemStatusMap[item] == TePOINTED)
-				itemVec.push_back(item);
-
-			if (itemStatusMap[item] == TeDEFAULT)
-				itemStatusMap.erase(item);
-		}
-	}
-	else if(selectedObjects == TeGrouped)
-	{
-		set<string> oidSet;
-		map<string, int>& objLegendMap = getObjLegendMap();
-		for (it = objLegendMap.begin(); it != objLegendMap.end(); ++it)
-		{
-			string oid = it->first;
-			if (objLegendMap[oid] != 0)
-				oidSet.insert(oid);
-		}
-
-		itemVec = getItemVector(oidSet);
-	}
-	else if(selectedObjects == TeNotGrouped)
-	{
-		set<string> oidSet = getObjects();
-		map<string, int>& objLegendMap = getObjLegendMap();
-		for (it = objLegendMap.begin(); it != objLegendMap.end(); ++it)
-			oidSet.erase(it->first);
-
-		itemVec = getItemVector(oidSet);
-	}
-	else if(selectedObjects == TeSelectedByPointingOrQuery )
-	{
-		for (it = itemStatusMap.begin(); it != itemStatusMap.end(); ++it)
-		{
-			item = it->first;
-			if( (itemStatusMap[item] == TePOINTED ) ||
-			  (itemStatusMap[item] == TeQUERIED ) ) {
-
-				itemVec.push_back(item);
-			}
-		}
-	}
-
-	return itemVec;
-}
-
-vector<string> TeTheme::getItemVector(const set<string>& oidSet)
-{
-	vector<string> itemVec;
-	vector<TeTable> tableVec = attrTables();
-	set<string>::const_iterator it;
-	unsigned int i;
-
-	if (tableVec.size() == 1)
-	{
-		for (it = oidSet.begin(); it != oidSet.end(); ++it)
-			itemVec.push_back(*it);
-		return itemVec;
-	}
-
-	// Set the expression that represents the concatenation
-	// of the unique names of each theme table
-	string concatIndexStr;
-	vector<string> indexVec;
-	TeDatabase* db = layer()->database();
-	for (i = 0; i < tableVec.size(); ++i)
-		indexVec.push_back(tableVec[i].name() + "." + tableVec[i].uniqueName());
-
-	concatIndexStr = db->getConcatFieldsExpression(indexVec);
-
-	vector<string> queryVec;
-	string query;
-
-
-	set<string>::const_iterator itB = oidSet.begin();
-	set<string>::const_iterator itE = oidSet.end();
-	vector<string> inClauseVec = generateInClauses(itB, itE, db);
-	for (i = 0; i < inClauseVec.size(); ++i)
-	{
-		query = "SELECT " + tableVec[i].name() + "." + tableVec[i].uniqueName();
-		query += ", " + concatIndexStr + sqlFrom() + " WHERE ";
-		query += tableVec[i].name() + "." + tableVec[i].uniqueName() + " IN " + inClauseVec[i];
-		queryVec.push_back(query);
-	}
-
-	TeDatabasePortal* portal = db->getPortal();
-	for (i = 0; i < queryVec.size(); ++i)
-	{
-		if (i != 0)
-			portal->freeResult();
-
-		if(portal->query(queryVec[i]) == false)
-		{
-			delete portal;
-			return itemVec;
-		}
-
-		while(portal->fetchRow())
-			itemVec.push_back(portal->getData(1));
-	}
-
-	delete portal;
-	return itemVec;
-}
-
-
-set<string> TeTheme::getObjects(const vector<string>& itemVec)
-{
-	set<string> oidSet;
-
-	unsigned int i;
-	TeDatabase* db = layer()->database();
-
-	// Get the vector of tables of the theme
-	vector<TeTable> tableVec;
-	getAttTables(tableVec);
-
-	vector<string> indexVec;
-	for (i = 0; i < tableVec.size(); ++i)
-		indexVec.push_back(tableVec[i].name() + "." + tableVec[i].uniqueName());
-
-	string concatIndexStr = db->getConcatFieldsExpression(indexVec);
-
-	std::vector<string>::const_iterator itemVec_it_begin( itemVec.begin() );
-	std::vector<string>::const_iterator itemVec_it_end( itemVec.end() );
-
-	vector<string> inClauseVec = generateInClauses( itemVec_it_begin,
-    itemVec_it_end, db);
-
-	vector<string> queryVec;
-	string selectClause = "SELECT " + concatIndexStr + ", ";
-	selectClause += tableVec[0].name() + "." + tableVec[0].uniqueName() + " " + sqlFrom();
-
-	for (i = 0; i < inClauseVec.size(); ++i)
-	{
-		string query = selectClause + " WHERE " + concatIndexStr + " IN " + inClauseVec[i];
-		queryVec.push_back(query);
-	}
-
-	TeDatabasePortal *portal = db->getPortal();
-	for (i = 0; i < queryVec.size(); ++i)
-	{
-		if (i != 0)
-			portal->freeResult();
-
-		if (portal->query(queryVec[i]))
-		{
-			while (portal->fetchRow())
-				oidSet.insert(portal->getData(1));
-		}
-	}
-	delete portal;
-
-	return oidSet;
-}
-
-unsigned int
-TeTheme::getNumberOfObjects()
-{
-	int numRows = 0;
-	string s = "SELECT COUNT(*) " + this->sqlFrom();
-	TeDatabasePortal* portal = this->layer()->database()->getPortal();
-	if(portal->query(s) && portal->fetchRow() )
-	{
-		numRows = atoi(portal->getData(0));
-	}
-	delete portal;
-	return numRows;
-}
-
-
-void TeTheme::setUsingCollection(const bool& usingCollection)
-{
-    useCollection_ = usingCollection;
-}
-
-TeProjection*
-TeTheme::getThemeProjection()
-{
-	if (layer_)
-		return layer_->projection();
-	else
-		return 0;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeTheme.h"
+#include "TeDatabase.h"
+#include "TeGroupingAlgorithms.h"
+#include "TeRasterTransform.h"
+#include "TeQuerier.h"
+#include "TeQuerierParams.h"
+
+extern int  yyparse(string& sqlOut);
+extern int  initParse(const string& strIn, TeDatabase* db);
+
+static TeThemeFactory themeFactory;
+
+TeTheme::TeTheme( const string& name, TeLayer* layer, TeViewNode* parent, const int& view, const int& id)
+		: TeAbstractTheme(name, parent, view, id, TeTHEME),
+		layer_(layer),
+        useCollection_(true)
+{
+	//layer id
+	if(layer)
+	{
+		layerId_ = layer->id();
+		if (layer_->database())
+			themeBox_ = layer_->box();
+	}
+	else
+		layerId_ = -1;
+
+	isEditable_ = true;
+}
+
+TeTheme::TeTheme(const TeViewNodeParams& params) : TeAbstractTheme(params),	layer_(0), layerId_(-1),
+useCollection_(true)
+{
+	isEditable_ = true;
+}
+
+
+// Copy constructor
+TeTheme::TeTheme (const TeTheme& other) :
+	TeAbstractTheme(other)
+{
+	layerId_ = other.layerId_;
+	layer_ = other.layer_;      //the same layer pointer
+	collectionTable_ = other.collectionTable_;
+	collectionAuxTable_ = other.collectionAuxTable_;
+
+	attTableVector_ = other.attTableVector_;
+	sqlFrom_ =  other.sqlFrom_;
+	sqlJoin_ = other.sqlGridJoin_;
+	sqlGridFrom_ = other.sqlGridFrom_;
+	sqlGridJoin_ = other.sqlGridJoin_;
+	aliasVector_ = other.aliasVector_;
+	sqlAttList_ = other.sqlAttList_;
+	sqlNumAttList_ = other.sqlNumAttList_;
+
+    useCollection_ = other.useCollection_;
+
+    isEditable_ = true;
+}
+
+
+// Destructor
+TeTheme::~TeTheme ()
+{
+	clearAttTableVector();
+	clearAttList();
+	collectionTable_.clear();
+	collectionAuxTable_.clear();
+	sqlFrom_.clear();
+	sqlJoin_.clear();
+	sqlGridFrom_.clear();
+	sqlGridJoin_.clear();
+	aliasVector_.clear();
+	sqlAttList_.clear();
+	sqlNumAttList_.clear();
+}
+
+TeTheme&
+TeTheme::operator= (const TeTheme& other)
+{
+	if ( this != &other )
+	{
+		TeAbstractTheme* absTheme = (TeAbstractTheme*)this;
+		absTheme->operator=(other);
+		layerId_ = other.layerId_;
+		layer_ = other.layer_;      //the same layer pointer
+
+		collectionTable_ = other.collectionTable_;
+		collectionAuxTable_ = other.collectionAuxTable_;
+
+		attTableVector_ = other.attTableVector_;
+		sqlFrom_ =  other.sqlFrom_;
+		sqlJoin_ = other.sqlGridJoin_;
+		sqlGridFrom_ = other.sqlGridFrom_;
+		sqlGridJoin_ = other.sqlGridJoin_;
+		aliasVector_ = other.aliasVector_;
+		sqlAttList_ = other.sqlAttList_;
+		sqlNumAttList_ = other.sqlNumAttList_;
+
+        useCollection_ = other.useCollection_;
+	}
+	return *this;
+}
+
+TeViewNode* TeTheme::clone()
+{
+	TeTheme* theme = new TeTheme();
+	*theme = *this;
+	return theme;
+}
+
+
+void TeTheme::layer(TeLayer* layer)
+{
+	layer_ = layer;
+	if (layer)
+	{
+		layerId_ = layer->id();
+//		themeBox_ = layer_->box();
+	}
+}
+
+void
+TeTheme::setSpatialRest(TeBox& box, TeGeomRep rep, TeSpatialRelation relation)
+{
+	hasSpatialRes_ = true;
+	boxRest_ = box;
+	spatialRelation_ = relation;
+
+	if(rep==TeGEOMETRYNONE)
+		geomRepRest_ = layer()->vectRepres()[0]->geomRep_;
+	else
+		geomRepRest_ = rep;
+
+	geomRest_ = 0;
+}
+
+void
+TeTheme::setSpatialRest(TeGeometry* geom, TeGeomRep rep, TeSpatialRelation relation)
+{
+	hasSpatialRes_ = true;
+	geomRest_ = geom;
+	spatialRelation_ = relation;
+
+	if(rep==TeGEOMETRYNONE)
+		geomRepRest_ = layer()->vectRepres()[0]->geomRep_;
+	else
+		geomRepRest_ = rep;
+
+	boxRest_ = TeBox();
+}
+
+string
+TeTheme::sqlWhereRestrictions(TeRepresentation* rep)
+{
+	TeKeys objs;
+	string whereClause= " 1 = 1 ";
+	TeDatabase* db = layer()->database();
+
+	// load the first representation
+	if(!rep)
+		rep = (layer()->vectRepres())[0];
+
+	// temporal restrictions are applied only to temporal tables
+	if(hasTemporalRest())
+	{
+		string result = "";
+
+		initParse(temporalRest(), db);
+
+		if(!yyparse(result))  //0: accept  1: reject
+			whereClause += " AND "+ result;
+		else
+			return "";
+	}
+
+	// we should test if the attribute restriction is valid
+	if (hasAttrRest())
+		whereClause += " AND "+ attributeRest();
+
+	// spatial restriction with other geometry representation
+	if (hasSpatialRest() && rep)
+	{
+		if(boxRestriction().isValid())
+		{
+            TeBox b =  boxRestriction();
+            TeGeomRep gRep = rep->geomRep_;
+//			whereClause += " AND "+ db->getSQLBoxWhere(boxRestriction(), rep->geomRep_);
+			string geomTableRest = layer()->tableName(geomRepRestriction());
+			whereClause += " AND "+ db->getSQLBoxWhere(b, gRep, geomTableRest);
+		}
+		else if(geomRestriction())
+		{
+			string geomTableRest = layer()->tableName(geomRepRestriction());
+			TePrecision::instance().setPrecision(TeGetPrecision(layer()->projection()));
+
+			if(db->spatialRelation(geomTableRest, geomRepRestriction(), geomRestriction(),
+							   objs, spatialRelation()))
+			{
+				string obs;
+				for(unsigned int i=0; i<objs.size(); i++)
+				{
+					if(i!=0)
+						obs += ",";
+					obs += "'"+ objs[i] +"'";
+				}
+
+				whereClause += " AND "+ rep->tableName_ +".object_id IN ("+ obs +")";
+			}
+		}
+	}
+	return whereClause;
+}
+
+void TeTheme::createRasterVisual(TeRaster* rst)
+{
+	if (rasterVisual_)
+		delete rasterVisual_;
+
+	if (!rst)
+		rst = layer_->raster();
+
+	if (!rst)
+		return;
+
+	rasterVisual_ = new TeRasterTransform();
+
+	if (rst->params().photometric_[0] == TeRasterParams::TePallete)  // raster palette -> uses its palette
+	{
+		rasterVisual_->setTransfFunction(&TeRasterTransform::Pallete2ThreeBand);
+		rasterVisual_->setLutSize(rst->params().lutr_.size());
+		return;
+	}
+
+	if (visibleRep_ & 0x40000000  &&		// sliced raster -> generate the
+		grouping_.groupMode_ == TeRasterSlicing)	// appropriate palette
+	{
+		int band = atoi(grouping_.groupAttribute_.name_.c_str());
+		rasterVisual_->setSrcBand(band);
+		if (rst->params().dataType_[band] != TeUNSIGNEDCHAR)
+			rasterVisual_->generateLUT(legend_, 1024, defaultLegend_.visual(TePOLYGONS)->color());
+		else
+			rasterVisual_->generateLUT(legend_, 256, defaultLegend_.visual(TePOLYGONS)->color());
+		rasterVisual_->setTransfFunction(&TeRasterTransform::LUT2ThreeBand);
+		return;
+	}
+
+	if (rst->params().dataType_[0] != TeUNSIGNEDCHAR)// non unsigned char -> generate linear transformation
+	{
+		std::vector<double>::const_iterator minIt = min_element(rst->params().vmin_.begin(), rst->params().vmin_.end());
+		std::vector<double>::const_iterator maxIt = max_element(rst->params().vmax_.begin(), rst->params().vmax_.end());
+
+		rasterVisual_->setLinearTransfParameters(*minIt, *maxIt , 0, 255);
+	}
+
+	if (rst->params().nBands() == 1)
+		rasterVisual_->setTransfFunction(&TeRasterTransform::Mono2ThreeBand);
+	else if (rst->params().nBands() == 3)
+		rasterVisual_->setTransfFunction(&TeRasterTransform::ThreeBand2RGB);
+	else
+		rasterVisual_->setTransfFunction(&TeRasterTransform::Band2Band);
+}
+
+
+
+bool
+TeTheme::buildCollection(std::string objectId, const bool& sincronize)
+{
+	if(id()==0)
+		return false;
+
+	if(!populateCollection(objectId, sincronize))
+		return false;
+
+	if(!populateCollectionAux(objectId))
+		return false;
+
+	return true;
+}
+
+bool
+TeTheme::buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects,
+						 vector<double>* dValuesVec)
+{
+	return buildGrouping(layer_->database(), g, selectedObjects, dValuesVec);
+}
+
+bool
+TeTheme::buildGrouping(TeDatabase* db, const TeGrouping& g, TeSelectedObjects selectedObjects, vector<double>* dValuesVec)
+{
+	if(!db)
+		return false;
+	grouping_ = g;
+	unsigned int i;
+	vector<TeSlice> slices;
+	int	nullValues = 0;
+	if (grouping_.groupMode_ == TeRasterSlicing)
+	{
+		int b = atoi(grouping_.groupAttribute_.name_.c_str());
+		if (!layer_->raster() ||
+			b < 0 ||
+			b > layer_->raster()->params().nBands() ||
+			grouping_.groupNumSlices_ <= 0)
+			return false;
+
+		if (grouping_.groupMaxVal_ == TeMINFLOAT)
+			grouping_.groupMaxVal_ = layer_->raster()->params().vmax_[b];
+
+		if (grouping_.groupMinVal_ == TeMAXFLOAT)
+			grouping_.groupMinVal_ = layer_->raster()->params().vmin_[b];
+
+		TeGroupByEqualStep(grouping_.groupMinVal_, grouping_.groupMaxVal_,
+			grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+	}
+	else
+	{
+        if(grouping_.groupAttribute_.name_.empty())
+			return false;
+
+		//verify what the objects will be considered
+		string	input;
+		if(selectedObjects == TeSelectedByPointing)
+		{
+			input = " WHERE (grid_status = 1 OR grid_status = 3";
+			input += " OR (grid_status is null AND (c_object_status = 1 OR c_object_status = 3)))";
+		}
+		else if(selectedObjects == TeNotSelectedByPointing)
+		{
+			input = " WHERE (grid_status = 0 OR grid_status = 2";
+			input += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
+		}
+		else if(selectedObjects == TeSelectedByQuery)
+		{
+			input = " WHERE (grid_status = 2 OR grid_status = 3";
+			input += " OR (grid_status is null AND (c_object_status = 2 OR c_object_status = 3)))";
+		}
+		else if(selectedObjects == TeNotSelectedByQuery)
+		{
+			input = " WHERE (grid_status = 0 OR grid_status = 1";
+			input += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 1)))";
+		}
+		else if(selectedObjects == TeGrouped)
+		{
+			input = " WHERE c_legend_id <> 0";
+		}
+		else if(selectedObjects == TeNotGrouped)
+		{
+			input = " WHERE c_legend_id = 0";
+		}
+
+		TeDatabasePortal* portal = db->getPortal();
+		string query;
+		bool normal = false;
+		string aggrFunc = "";
+		if(grouping_.groupFunction_.empty())
+			aggrFunc = " MIN";
+		else
+			aggrFunc = grouping_.groupFunction_;
+
+		if(grouping_.groupNormAttribute_.empty())
+		{
+			query = " SELECT "+ aggrFunc +"("+ grouping_.groupAttribute_.name_ +")";
+		}
+		else
+		{
+			query = " SELECT "+ aggrFunc +"("+ grouping_.groupAttribute_.name_ +") / "+ aggrFunc +"("+ grouping_.groupNormAttribute_ + ")";
+			normal = true;
+		}
+		query += sqlGridFrom();
+
+		if(selectedObjects != TeAll)
+			query += input;
+		query += " GROUP BY " + collectionTable() + ".c_object_id";
+		if(!portal->query(query) || !portal->fetchRow())
+		{
+			delete portal;
+			return false;
+		}
+		vector<double> dValues;  //inputvect
+		vector<string> sValues;	//svec
+		double mean, sum;
+		mean = sum = 0.;
+		do
+		{
+			string val = portal->getData(0);
+			string valNorm = Te2String(atof(val.c_str()), grouping_.groupPrecision_);
+
+			if (!val.empty())
+			{
+				if(grouping_.groupMode_== TeUniqueValue)
+				{
+					if(normal)
+						sValues.push_back(valNorm);
+					else
+						sValues.push_back(val);
+				}
+				else
+				{
+					dValues.push_back(atof(valNorm.c_str()));
+					sum += atof(valNorm.c_str());
+				}
+
+			}
+			else
+				nullValues++;
+		}while(portal->fetchRow());
+
+		delete portal;
+
+		if(dValues.empty() && sValues.empty())
+			return false;
+
+		if(grouping_.groupMode_== TeEqualSteps)
+			TeGroupByEqualStep(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+		else if(grouping_.groupMode_== TeQuantil)
+			TeGroupByQuantil(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+		else if(grouping_.groupMode_== TeStdDeviation)
+		{
+			string m = Te2String(mean);
+			TeGroupByStdDev(dValues.begin(), dValues.end(), grouping_.groupStdDev_, slices, m, grouping_.groupPrecision_);
+		}
+		else if(grouping_.groupMode_== TeUniqueValue)
+		{
+			if(grouping_.groupFunction_ == "COUNT")
+				TeGroupByUniqueValue(sValues, TeINT, slices, grouping_.groupPrecision_);
+			else
+				TeGroupByUniqueValue(sValues, grouping_.groupAttribute_.type_, slices, grouping_.groupPrecision_);
+		}
+
+		if (dValuesVec)
+		{
+			for (i = 0; i < dValues.size(); ++i)
+				dValuesVec->push_back(dValues[i]);
+		}
+	}
+	if(grouping_.groupNullAttr_ && nullValues > 0)
+	{
+		TeSlice ps;
+		ps.count_ = nullValues;
+		ps.from_ = "Missing Data";
+		slices.push_back(ps);
+		grouping_.groupNumSlices_ = slices.size() - 1;
+	}
+	else
+		grouping_.groupNumSlices_ = slices.size();
+
+	legend_.clear();
+	for(i=0; i<slices.size(); ++i)
+	{
+		TeLegendEntry legend(slices[i]);
+		legend.group(i);
+		legend.theme(id());
+		legend_.push_back(legend);
+	}
+	return true;
+}
+
+bool
+TeTheme::buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec)
+{
+	return buildGrouping(layer_->database(), g, chr, mapObjValVec);
+}
+
+bool
+TeTheme::buildGrouping(TeDatabase* db, const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec)
+{
+	if(!db || chr == TeNOCHRONON)
+		return false;
+
+	grouping_ = g;
+
+	unsigned int i;
+	vector<TeSlice> slices;
+	vector<double> dValues;  //inputvect
+	vector<string> sValues;	//svec
+	double mean, sum;
+	mean = sum = 0.;
+	int	nullValues = 0;
+	string val;
+
+	if (grouping_.groupMode_ == TeRasterSlicing)
+	{
+		int b = atoi(grouping_.groupAttribute_.name_.c_str());
+		if (!layer_->raster() ||
+			b < 0 ||
+			b > layer_->raster()->params().nBands() ||
+			grouping_.groupNumSlices_ <= 0)
+			return false;
+
+		if (grouping_.groupMaxVal_ == TeMINFLOAT)
+			grouping_.groupMaxVal_ = layer_->raster()->params().vmax_[b];
+
+		if (grouping_.groupMinVal_ == TeMAXFLOAT)
+			grouping_.groupMinVal_ = layer_->raster()->params().vmin_[b];
+
+		TeGroupByEqualStep(grouping_.groupMinVal_, grouping_.groupMaxVal_,
+			grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+	}
+	else
+	{
+		string func;
+		TeStatisticType statType = TeNOSTATISTIC;
+		if (grouping_.groupMode_ == TeUniqueValue && grouping_.groupAttribute_.type_ == TeSTRING)
+			func = "MIN";
+		else
+			func = grouping_.groupFunction_;
+
+		if (func == "MIN")
+			statType = TeMINVALUE;
+		else if (func == "MAX")
+			statType = TeMAXVALUE;
+		else if (func == "MEAN")
+			statType = TeMEAN;
+		else if (func == "SUM")
+			statType = TeSUM;
+		else if (func == "COUNT")
+			statType = TeCOUNT;
+
+		// Set the flag that indicates the geometries must not be loaded
+		bool loadGeometries = false;
+
+		// Insert the attributes in a multimap that relates the attribute
+		// representation and its statistic type
+		TeGroupingAttr attrMMap;
+		pair<TeAttributeRep, TeStatisticType> attr1 (
+			TeAttributeRep(grouping_.groupAttribute_), statType);
+		attrMMap.push_back(attr1);
+
+		// Set querier parameters
+		TeQuerierParams querierParams(loadGeometries, attrMMap);
+		querierParams.setParams(this, chr);
+
+		TeQuerier querier(querierParams);
+
+		// Load instances based on the querier parameters given
+		int numFrames = querier.getNumTimeFrames();
+		TeSTInstance sti;
+		string objId;
+		TePropertyVector vec;
+		mapObjValVec.resize(numFrames);
+
+		for (int frame = 0; frame < numFrames; ++frame)
+		{
+			if (querier.loadInstances(frame) == false)
+				continue;
+
+			// Traverse all the instances
+			while(querier.fetchInstance(sti))
+			{
+				objId = sti.objectId();
+				sti.getPropertyValue(val, 0);
+
+				dValues.push_back(atof(val.c_str()));
+				sValues.push_back(val);
+				map<string, string>& objValMap = mapObjValVec[frame];
+				objValMap.insert(make_pair(objId, val));
+			}
+		}
+
+		if(grouping_.groupMode_== TeEqualSteps)
+			TeGroupByEqualStep(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+		else if(grouping_.groupMode_== TeQuantil)
+			TeGroupByQuantil(dValues.begin(), dValues.end(), grouping_.groupNumSlices_, slices, grouping_.groupPrecision_);
+		else if(grouping_.groupMode_== TeStdDeviation)
+		{
+			string m = Te2String(mean);
+			TeGroupByStdDev(dValues.begin(), dValues.end(), grouping_.groupStdDev_, slices, m, grouping_.groupPrecision_);
+		}
+		else if(grouping_.groupMode_== TeUniqueValue)
+		{
+			if(grouping_.groupFunction_ == "COUNT")
+				TeGroupByUniqueValue(sValues, TeINT, slices, grouping_.groupPrecision_);
+			else
+				TeGroupByUniqueValue(sValues, grouping_.groupAttribute_.type_, slices, grouping_.groupPrecision_);
+		}
+	}
+
+	if(grouping_.groupNullAttr_ && nullValues > 0)
+	{
+		TeSlice ps;
+		ps.count_ = nullValues;
+		ps.from_ = "Missing Data";
+		slices.push_back(ps);
+		grouping_.groupNumSlices_ = slices.size() - 1;
+	}
+	else
+		grouping_.groupNumSlices_ = slices.size();
+
+	legend_.clear();
+	for(i=0; i<slices.size(); ++i)
+	{
+		TeLegendEntry legend(slices[i]);
+		legend.group(i);
+		legend.theme(id());
+		legend_.push_back(legend);
+	}
+
+	return true;
+}
+
+bool
+TeTheme::getAttTables(TeAttrTableVector& attrs, TeAttrTableType attType)
+{
+	TeAttrTableVector::iterator it = attTableVector_.begin();
+	while (it != attTableVector_.end())
+	{
+		if ((attType == TeAllAttrTypes) || ((*it).tableType() == attType))
+			attrs.push_back((*it));
+		++it;
+	}
+	return (!attrs.empty());
+}
+
+bool
+TeTheme::getTable(TeTable& table, const string tableName)
+{
+	unsigned int i;
+	for (i = 0; i < attTableVector_.size(); ++i)
+	{
+		if (attTableVector_[i].name() == tableName)
+		{
+			table = attTableVector_[i];
+			return true;
+		}
+	}
+	return false;
+}
+
+bool
+TeTheme::getTemporalTable(TeTable& table)
+{
+	TeAttrTableVector::iterator it = attTableVector_.begin();
+	while (it != attTableVector_.end())
+	{
+		if (((*it).tableType() == TeAttrEvent) || ((*it).tableType() == TeFixedGeomDynAttr))
+		{
+			table = (*it);
+			return true;
+		}
+		++it;
+	}
+	return false;
+}
+
+bool
+TeTheme::saveGrouping(TeSelectedObjects selectedObjects)
+{
+	return saveGrouping(layer_->database(), selectedObjects);
+}
+
+bool
+TeTheme::saveGrouping(TeDatabase* db, TeSelectedObjects)
+{
+	if(!db)
+		return false;
+
+	vector<TeLegendEntry> legVec = legend_;
+
+	// Delete the theme grouping(if any) from the database
+	if(db->deleteLegend(id()) == false)
+		return false;
+
+	if(grouping_.groupMode_ == TeNoGrouping)
+		return true;
+
+	// Insert the new grouping
+	if(db->insertGrouping(id(), grouping_) == false)
+		return false;
+
+	legend_ = legVec;
+	// Update (insert) the new legends
+	if (db->updateLegend(legend_) == false)
+		return false;
+
+	setLegendsForObjects();
+
+	if(legend_.size())
+		visibleRep_ = visibleRep_ | 0x40000000;
+	else
+		visibleRep_ = visibleRep_ | 0xbfffffff;
+	string upVis = "UPDATE te_theme SET visible_rep=" + Te2String(visibleRep_) + " WHERE theme_id=" + Te2String(id());
+	return (db->execute(upVis));
+
+	return true;
+}
+
+bool
+TeTheme::loadThemeTables()
+{
+	clearAttTableVector();
+	TeDatabase* db = this->layer()->database();
+	if(!db)
+		return false;
+	return (db->loadThemeTable(this));
+}
+
+bool
+TeTheme::addThemeTable(TeTable& inputTable)
+{
+	bool result = true;
+	TeAttrTableType type = inputTable.tableType();
+
+	if(inputTable.name() == collectionAuxTable_)
+	{
+		loadTablesJoin();
+		return false;
+	}
+
+	if (type == TeAttrMedia)
+		return false;
+
+	if(type != TeAttrStatic)
+	{
+		bool hasTemporal = false;
+		bool hasExtern = false;
+
+		TeAttrTableVector::iterator it = attTableVector_.begin();
+		while(it!=attTableVector_.end())
+		{
+			//temporal
+			if( (it->tableType()==TeAttrEvent) ||
+				(it->tableType()==TeFixedGeomDynAttr) ||
+				(it->tableType()==TeDynGeomDynAttr))
+				hasTemporal = true;
+
+			//extern
+			if((it->tableType())==TeAttrExternal)
+				hasExtern = true;
+
+			++it;
+		}
+
+		if( ((type==TeAttrEvent) ||
+			(type==TeFixedGeomDynAttr) ||
+			(type==TeDynGeomDynAttr)) && (hasTemporal || hasExtern))
+			result = false;
+		else if ((type==TeAttrExternal) && hasTemporal)
+			result = false;
+	}
+
+	if(!result)
+		return false;
+
+	attTableVector_.push_back(inputTable);
+	loadAliasVector();
+	loadAttrLists();
+	loadTablesJoin();
+	return true;
+}
+
+void
+TeTheme::addThemeTable(string tableName)
+{
+	TeTable table(tableName);
+	addThemeTable(table);
+}
+
+bool
+TeTheme::setAttTables(TeAttrTableVector& attrs)
+{
+	attTableVector_.clear();
+	int countTemporal = 0;
+	int countExtern = 0;
+	bool result = true;
+
+	TeAttrTableVector::iterator it = attrs.begin();
+	while(it!=attrs.end())
+	{
+		//temporal
+		if( (it->tableType()==TeAttrEvent) ||
+			(it->tableType()==TeFixedGeomDynAttr) ||
+			(it->tableType()==TeDynGeomDynAttr))
+			++countTemporal;
+
+		//extern
+		if(it->tableType()==TeAttrExternal)
+			++countExtern;
+
+		if( (it->tableType()==TeAttrMedia)     ||
+			(countTemporal>0 && countExtern>0) ||
+			(countTemporal>1) ||
+			(it->name() == collectionAuxTable_) )
+		{
+			result = false;
+		}
+		else
+		{
+			attTableVector_.push_back(*it);
+			loadAliasVector();
+			loadAttrLists();
+			loadTablesJoin();
+		}
+		++it;
+	}
+	return result;
+}
+
+bool
+TeTheme::removeThemeTable(unsigned int index)
+{
+	if (index > (attTableVector_.size() - 1))
+		return false;
+
+	TeAttrTableVector::iterator it;
+	it = attTableVector_.begin() + index;
+
+	attTableVector_.erase(it);
+	loadAliasVector();
+	loadAttrLists();
+	loadTablesJoin();
+	return true;
+}
+
+string
+TeTheme::getAttribute(unsigned int pos)
+{
+	unsigned int i;
+	unsigned int sumCols = 0, tableCol;
+	bool found = false;
+	for (i = 0; i < attTableVector_.size(); ++i)
+	{
+		TeAttributeList& attrList = attTableVector_[i].attributeList();
+		if (pos < (sumCols + attrList.size()))
+		{
+			if (i == 0)
+				tableCol = pos;
+			else
+				tableCol = pos - sumCols;
+			found = true;
+			break;
+		}
+		sumCols += attrList.size();
+	}
+
+	if (found == false)
+		return "";
+
+	TeAttributeList& attrList = attTableVector_[i].attributeList();
+	string attrName = attTableVector_[i].name() + "." + attrList[tableCol].rep_.name_;
+	return attrName;
+}
+
+bool
+TeTheme::isIndex(unsigned int pos)
+{
+	string fullAttrName = getAttribute(pos);
+	if (fullAttrName.empty() == true)
+		return false;
+
+	size_t idx = fullAttrName.find(".");
+	string tableName = fullAttrName.substr(0, idx);
+	string attrName = fullAttrName.substr(idx+1);
+
+	// Get the representation of a table given an attribute name
+	TeTable table;
+	if (getTable(table, tableName) == false)
+		return false;
+
+	// Check if the attribute is index or not
+	if(table.uniqueName() == attrName)
+		return true;
+
+	return false;
+}
+
+bool
+TeTheme::isThemeTable(int tableId)
+{
+	bool isThemeTable = false;
+	unsigned int i;
+	for (i = 0; i < attTableVector_.size(); ++i)
+	{
+		if (attTableVector_[i].id() == tableId)
+		{
+			isThemeTable = true;
+			break;
+		}
+	}
+	return isThemeTable;
+}
+
+bool
+TeTheme::isThemeTable(string tableName)
+{
+	bool isThemeTable = false;
+	for (unsigned int i = 0; i < attTableVector_.size(); ++i)
+	{
+		if (attTableVector_[i].name() == tableName)
+		{
+			isThemeTable = true;
+			break;
+		}
+	}
+	return isThemeTable;
+}
+
+string
+TeTheme::getTableName(const string& attrName)
+{
+	string tableName;
+	size_t pos = attrName.find(".");
+
+	if (pos != string::npos)
+		return tableName = attrName.substr(0, pos);
+
+	for (unsigned int i = 0; i < attTableVector_.size(); ++i)
+	{
+		TeAttributeList& attrList = attTableVector_[i].attributeList();
+		for (unsigned j = 0; j < attrList.size(); ++j)
+		{
+			if (attrList[j].rep_.name_ == attrName)
+			{
+				tableName = attTableVector_[i].name();
+				return tableName;
+			}
+		}
+	}
+
+	return tableName;
+}
+
+
+bool
+TeTheme::deleteGrouping()
+{
+	TeDatabase* db = layer_->database();
+	if(!db)
+		return false;
+
+	resetGrouping();
+
+	//delete te_legend table
+	if(!db->deleteLegend (this->id()))
+		return false;
+
+	//delete te_grouping table
+	string sql = "DELETE FROM te_grouping WHERE theme_id= "+ Te2String(this->id());
+	db->execute (sql);
+
+	return true;
+}
+
+bool
+TeTheme::createCollectionAuxTable()
+{
+	return createCollectionAuxTable(layer_->database());
+}
+
+bool
+TeTheme::createCollectionAuxTable(TeDatabase* db)
+{
+	unsigned int i, j;
+	bool status;
+	vector<string> indexes;
+
+	if(!db)
+		return false;
+
+	if(!db->tableExist(collectionTable_))
+		return false;
+
+	if(db->tableExist(collectionAuxTable_))
+	{
+		status = db->execute("DROP TABLE " + collectionAuxTable_);
+		if(db->tableExist(collectionAuxTable_))
+		{
+			if(!status)
+				return false;
+		}
+	}
+
+	TeAttributeList attList;
+
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.numChar_ = 50;
+	at.rep_.name_ = "object_id";
+	attList.push_back(at);
+
+	j = 0;
+	for (i = 0; i < attTableVector_.size(); ++i)
+	{
+		if (attTableVector_[i].tableType() == TeAttrExternal ||
+			attTableVector_[i].tableType() == TeFixedGeomDynAttr)
+		{
+//descobre o tipo do dado que sera linkado
+			for(unsigned int k = 0; k < attTableVector_[i].attributeList().size(); ++k)
+			{
+				if(attTableVector_[i].attributeList()[k].rep_.name_ == attTableVector_[i].uniqueName())
+				{
+					at.rep_.type_ = attTableVector_[i].attributeList()[k].rep_.type_;
+					at.rep_.numChar_ = attTableVector_[i].attributeList()[k].rep_.numChar_;
+					break;
+				}
+			}
+
+			at.rep_.name_ = "aux" + Te2String(j++);
+			attList.push_back(at);
+			indexes.push_back(at.rep_.name_);
+		}
+	}
+
+	at.rep_.isPrimaryKey_ = true;
+	at.rep_.numChar_ = 0;
+	at.rep_.name_ = "unique_id";
+	at.rep_.isAutoNumber_ = true;
+	at.rep_.type_ = TeINT;
+	attList.push_back(at);
+
+	at.rep_.name_ = "grid_status";
+	at.rep_.isPrimaryKey_ = false;
+	at.rep_.isAutoNumber_ = false;
+	at.rep_.numChar_ = 0;
+	attList.push_back(at);
+
+	status = db->createTable(collectionAuxTable_, attList);
+	if(!status)
+		return false;
+
+	string idxName = "te_idx_caux"+ Te2String(this->id());
+
+	//create index to object_id
+	db->createIndex(collectionAuxTable_, idxName+"_objId", "object_id");
+
+	for(unsigned int i=0; i<indexes.size(); ++i)
+		db->createIndex(collectionAuxTable_, idxName+"_"+indexes[i], indexes[i]);
+
+	return true;
+}
+
+bool TeTheme::isUpdated()
+{
+	if(layer() == NULL)
+	{
+		return false;
+	}
+	layer()->reloadLayerEditionTime();
+
+	if(this->getCreationTime() < layer()->getEditionTime())
+	{
+		return false;
+	}
+	return true;
+}
+
+bool
+TeTheme::populateCollectionAux(std::string objectId)
+{
+	TeDatabase* db = layer_->database();
+	if((!db) || (collectionTable_.empty()) || (collectionAuxTable_.empty()))
+		return false;
+
+	string whereClause;
+
+	whereClause = " WHERE 1=1 ";
+
+	// Populate the collection auxiliary table
+	string ins = "INSERT INTO " + collectionAuxTable_ + " (object_id";
+    unsigned int i, j;
+	j = 0;
+	for (i = 0; i < attTableVector_.size(); ++i)
+	{
+		if (attTableVector_[i].tableType() == TeAttrExternal ||
+			attTableVector_[i].tableType() == TeFixedGeomDynAttr)
+			ins += ", aux" + Te2String(j++);
+	}
+
+	ins += ", grid_status) SELECT c_object_id";
+	for (i = 0; i < attTableVector_.size(); ++i)
+	{
+		if (attTableVector_[i].tableType() == TeAttrExternal ||
+			attTableVector_[i].tableType() == TeFixedGeomDynAttr)
+			ins += "," + aliasVector()[i] + "." + attTableVector_[i].uniqueName();
+	}
+
+	ins += ",c_object_status";
+
+	//attribute restriction
+	if(!generateAttributeRest_.empty())
+		whereClause += " AND "+ generateAttributeRest_;
+
+	//temporal restriction
+	if(!generateTemporalRest_.empty())
+	{
+		string sqlTemp;
+		initParse(generateTemporalRest_, db);
+
+		if(!yyparse(sqlTemp))  //0: accept  1: reject
+			whereClause += " AND "+ sqlTemp;
+		else
+			return false;
+	}
+
+	//spatial restriction is already stored in the collection table
+
+	bool usaTemporal = false;
+	for (i = 0; i < attTableVector_.size(); ++i)
+	{
+		if (attTableVector_[i].tableType() == TeFixedGeomDynAttr ||
+			attTableVector_[i].tableType() == TeDynGeomDynAttr)
+			usaTemporal = true;
+	}
+	loadThemeTablesJoin();
+	string result = "";
+	if(!generateAttributeRest_.empty() || !generateTemporalRest_.empty() || attTableVector_.size() > 1)
+	{
+		result = ins + sqlFrom() + whereClause + " ";
+	}
+	else
+	{
+		result = ins + " FROM " + collectionTable() + " " + whereClause + " ";
+	}
+	if (!objectId.empty() && !whereClause.empty())
+		result += " AND c_object_id = '"+objectId+"'";
+	if (!db->execute(result))
+		return false;
+
+	if(usaTemporal) // filter collection table
+	{
+		string s = "DELETE FROM " + collectionTable_ + " WHERE c_object_id NOT IN";
+		s += " (SELECT DISTINCT object_id FROM " + collectionAuxTable_ + ")";
+		return(db->execute(s));
+	}
+	return true;
+}
+
+
+bool
+TeTheme::locatePolygon (TeCoord2D &pt, TePolygon &polygon, const double& tol)
+{
+	if (!layer()->database() || collectionTable().empty())
+		return false;
+
+	string geomTable = layer()->tableName(TePOLYGONS);
+	string sqlFrom = " "+ geomTable +" INNER JOIN " + collectionTable();
+	sqlFrom += " ON "+ collectionTable() +".c_object_id = "+ geomTable +".object_id ";
+
+	if(!layer()->database()->locatePolygon(sqlFrom, pt, polygon, tol))
+		return false;
+
+	return true;
+}
+
+
+bool
+TeTheme::locatePolygonSet (TeCoord2D &pt, double tol, TePolygonSet &polygons)
+{
+	if (!layer()->database() || collectionTable().empty())
+		return false;
+
+	string geomTable = layer()->tableName(TePOLYGONS);
+	string sqlFrom = " "+ geomTable +" INNER JOIN " + collectionTable();
+	sqlFrom += " ON "+ collectionTable() +".c_object_id = "+ geomTable +".object_id ";
+
+	if(!layer()->database()->locatePolygonSet(sqlFrom, pt, tol, polygons))
+		return false;
+
+	return true;
+}
+
+bool
+TeTheme::locateLine (TeCoord2D &pt, TeLine2D &line, const double& tol)
+{
+	if (!layer()->database() || collectionTable().empty())
+		return false;
+
+	string geomTable = layer()->tableName(TeLINES);
+	string sqlFrom = " "+ geomTable +" INNER JOIN " + collectionTable();
+	sqlFrom += " ON "+ collectionTable() +".c_object_id = "+ geomTable +".object_id ";
+
+	if(!layer()->database()->locateLine(sqlFrom, pt, line, tol))
+		return false;
+
+	return true;
+}
+
+bool
+TeTheme::locatePoint (TeCoord2D &pt, TePoint &point, const double& tol)
+{
+	if (!layer()->database() || collectionTable().empty())
+		return false;
+
+	string geomTable = layer()->tableName(TePOINTS);
+	string sqlFrom = " "+ geomTable +" INNER JOIN " + collectionTable();
+	sqlFrom += " ON "+ collectionTable() +".c_object_id = "+ geomTable +".object_id ";
+
+	if(!layer()->database()->locatePoint(sqlFrom, pt, point, tol))
+		return false;
+
+	return true;
+}
+
+bool
+TeTheme::locateCell (TeCoord2D &pt, TeCell &cell, const double&  tol)
+{
+	if (!layer()->database() || collectionTable().empty())
+		return false;
+
+	string geomTable = layer()->tableName(TeCELLS);
+	string sqlFrom = " "+ geomTable +" INNER JOIN " + collectionTable();
+	sqlFrom += " ON "+ collectionTable() +".c_object_id = "+ geomTable +".object_id ";
+
+	if(!layer()->database()->locateCell(sqlFrom, pt, cell, tol))
+		return false;
+
+	return true;
+}
+
+//------------------------------ protected methods
+void
+TeTheme::loadAliasVector()
+{
+	unsigned int i, count;
+	TeTable table;
+	multimap<string, int> tableMMap;
+
+	aliasVector_.clear();
+
+	for (i = 0; i < attTableVector_.size(); ++i)
+	{
+		table = attTableVector_[i];
+
+		if (table.tableType() != TeAttrExternal)
+			aliasVector_.push_back(table.name());
+		else
+		{
+			count = tableMMap.count(table.name());
+			if (count == 0)
+				aliasVector_.push_back(table.name());
+			else
+				aliasVector_.push_back(table.name() + "_" + Te2String(count));
+
+			tableMMap.insert(multimap<string,int>::value_type(table.name(), ++count));
+		}
+	}
+}
+
+string
+TeTheme::sqlGridFrom(const string& geomTable)
+{
+	if(geomTable.empty())
+		return sqlGridFrom_;
+
+	string result;
+	loadTablesJoin(geomTable);
+	result = sqlGridFrom_;
+	loadTablesJoin();
+	return result;
+}
+
+bool
+TeTheme::generateLabelPositions(const std::string& objectId)
+{
+	TeDatabase* db = layer()->database();
+	if(!db)
+		return false;
+
+	return (db->generateLabelPositions(this, objectId));
+}
+
+void
+TeTheme::loadTablesJoin(const string& geomTable)  //sqlGridFrom and sqlGridJoin
+{
+	unsigned int i, count;
+	multimap<string, int> tableMMap;
+    TeTable table;
+    bool hasExternalTable = false;
+
+    // Set the new sqlGridFrom_ clause and the new sqlGridJoin_ string
+    sqlGridFrom_.clear();
+    sqlGridJoin_.clear();
+
+    TeAttrTableVector tableVec;
+    vector<string>    aliasVec;
+
+    if(!geomTable.empty())
+    {
+        TeTable table;
+        table.name(geomTable);
+        table.setLinkName("object_id");
+        table.setUniqueName("object_id");
+        table.setTableType(TeAttrStatic);
+        tableVec.push_back(table);
+
+        for(i=0; i<attTableVector_.size(); ++i)
+            tableVec.push_back(attTableVector_[i]);
+
+        aliasVec.push_back(geomTable);
+        for(i=0; i<aliasVector_.size(); ++i)
+            aliasVec.push_back(aliasVector_[i]);
+    }
+    else
+    {
+        tableVec = attTableVector_;
+        aliasVec = aliasVector_;
+    }
+
+    //verify if there is external table
+    for (i = 0; i < tableVec.size(); ++i)
+    {
+        if (tableVec[i].tableType() == TeAttrExternal)
+        {
+            hasExternalTable = true;
+            break;
+        }
+    }
+
+    if(!collectionAuxTable_.empty())
+    {
+        sqlGridFrom_ = " FROM ";
+
+        for (i = 0; i <= tableVec.size(); ++i)
+            sqlGridFrom_ += "(";
+
+        sqlGridFrom_ += collectionAuxTable_;
+        sqlGridJoin_ = "SELECT ";
+
+        if(hasExternalTable)
+            sqlGridFrom_ += " RIGHT JOIN "+ collectionTable_;
+        else
+            sqlGridFrom_ += " LEFT JOIN "+ collectionTable_;
+
+        sqlGridFrom_ += " ON "+ collectionAuxTable_ +".object_id = "+ collectionTable_ +".c_object_id )";
+
+        int numAux = 0;
+        for (i = 0; i < tableVec.size(); ++i)
+        {
+            table = tableVec[i];
+            if ((table.tableType()==TeAttrStatic) || (table.tableType()==TeAttrMedia) || (table.tableType()==TeAttrEvent))
+            {
+                sqlGridFrom_ += " LEFT JOIN " + aliasVec[i];
+                sqlGridFrom_ += " ON " + collectionTable_ +".c_object_id = " + aliasVec[i] + "." + table.linkName() +")";
+            }
+            else if (table.tableType() == TeAttrExternal)
+            {
+				count = tableMMap.count(table.name());
+				if (count == 0)
+					sqlGridFrom_ += " LEFT JOIN " + aliasVec[i];
+				else
+					sqlGridFrom_ += " LEFT JOIN " + table.name() + " AS " + aliasVec[i];
+
+				tableMMap.insert(multimap<string,int>::value_type(table.name(), ++count));
+                sqlGridFrom_ += " ON " + collectionAuxTable_ + ".aux" + Te2String(numAux++) +" = "+ aliasVec[i] +"."+ table.uniqueName() +")";
+            }
+            else
+            {
+                sqlGridFrom_ += " LEFT JOIN " + aliasVec[i];
+                sqlGridFrom_ += " ON " + collectionAuxTable_ + ".aux" + Te2String(numAux++) +" = "+ aliasVec[i] +"."+ table.uniqueName() +")";
+            }
+
+            sqlGridJoin_ += aliasVec[i] + ".*,";
+        }
+
+        sqlGridJoin_ += collectionTable_ + ".*, " +  collectionAuxTable_ + ".* " + sqlGridFrom_;
+    }
+
+	loadThemeTablesJoin();
+ }
+
+void TeTheme::loadThemeTablesJoin()  ////sqlJoin and sqlFrom
+{
+	unsigned int i, count;
+	multimap<string, int> tableMMap;
+	TeTable table;
+
+	// Set the new from clause and the new join string
+	sqlFrom_.clear();
+	sqlJoin_.clear();
+
+	sqlFrom_ = " FROM ";
+	sqlJoin_ = "SELECT ";
+
+	if (collectionTable_.empty() == false)
+	{
+		for (i = 0; i < attTableVector_.size(); ++i)
+			sqlFrom_ += "(";
+		sqlFrom_ += collectionTable_;
+
+		for (i = 0; i < attTableVector_.size(); ++i)
+		{
+			table = attTableVector_[i];
+			if (table.tableType() != TeAttrExternal)
+			{
+				sqlFrom_ += " LEFT JOIN " + aliasVector_[i];
+				sqlFrom_ += " ON " + collectionTable_ + ".c_object_id = " + aliasVector_[i] + "." + table.linkName() + ")";
+			}
+			else
+			{
+				count = tableMMap.count(table.name());
+				if (count == 0)
+					sqlFrom_ += " LEFT JOIN " + aliasVector_[i];
+				else
+					sqlFrom_ += " LEFT JOIN " + table.name() + " AS " + aliasVector_[i];
+
+				tableMMap.insert(multimap<string,int>::value_type(table.name(), ++count));
+
+				sqlFrom_ += " ON " + table.relatedTableName() + "." + table.relatedAttribute() + " = ";
+				sqlFrom_ +=  aliasVector_[i] + "." + table.linkName() + ")";
+			}
+
+			sqlJoin_ += aliasVector_[i] + ".*,";
+		}
+
+		sqlJoin_ += collectionTable_ + ".*" + sqlFrom_;
+	}
+	else
+	{
+		if (attTableVector_.size() == 1)
+		{
+			table = attTableVector_[0];
+			sqlFrom_ += table.name();
+			sqlJoin_ = "SELECT " + table.name() + ".*" + sqlFrom_;
+		}
+		else
+		{
+			for (i = 0; i < attTableVector_.size() - 1; ++i)
+				sqlFrom_ += "(";
+
+			TeTable firstTable = attTableVector_[0];
+			sqlFrom_ += firstTable.name();
+			sqlJoin_ += firstTable.name() + ".*,";
+			for (i = 1; i < attTableVector_.size(); ++i)
+			{
+				table = attTableVector_[i];
+				sqlFrom_ += " LEFT JOIN " + aliasVector_[i];
+				sqlFrom_ += " ON " + firstTable.name() + "." + firstTable.linkName() + " = " + aliasVector_[i] + "." + table.linkName() + ")";
+
+				if (i == attTableVector_.size() - 1)
+					sqlJoin_ += aliasVector_[i] + ".*";
+				else
+					sqlJoin_ += aliasVector_[i] + ".*,";
+			}
+
+			sqlJoin_ += sqlFrom_;
+		}
+	}
+	return;
+}
+
+void
+TeTheme::loadAttrLists()
+{
+	// Set the new list of attributes of all the theme tables and its new numerical list,
+	unsigned int i, j, count;
+	TeTable table;
+	multimap<string, int> attrMMap;
+	string attrName;
+
+	sqlAttList_.clear();
+	sqlNumAttList_.clear();
+
+	if (layer() == 0)
+		return;
+	TeDatabase *db = layer()->database();
+
+	for (i = 0; i < attTableVector_.size(); ++i)
+	{
+		table = attTableVector_[i];
+		// Set the map of attribute names
+		if(table.attributeList().empty())
+			db->getAttributeList(table.name(), table.attributeList());
+
+		for (j = 0; j < table.attributeList().size(); ++j)
+		{
+			attrName = table.attributeList()[j].rep_.name_;
+			count = attrMMap.count(attrName);
+			attrMMap.insert(multimap<string,int>::value_type(attrName, ++count));
+		}
+	}
+
+	// Set the list of attribute names that contains all the attribute names
+	// of the theme tables
+	for (i = 0; i < attTableVector_.size(); ++i)
+	{
+		table = attTableVector_[i];
+		TeAttributeList attrList=table.attributeList();
+		if(attrList.empty())
+			db->getAttributeList(table.name(), attrList);
+		for (j = 0; j < attrList.size(); ++j)
+		{
+			attrName = attrList[j].rep_.name_;
+			count = attrMMap.count(attrName);
+			if (count == 1)
+				attrList[j].rep_.name_ = attrName;
+			else
+				attrList[j].rep_.name_ = aliasVector_[i] + "." + attrName;
+
+			sqlAttList_.push_back(attrList[j]);
+		}
+	}
+
+	// Set the list of attribute names that contains all the numeric attribute names
+	// of the theme tables
+	for(i = 0; i < sqlAttList_.size(); ++i)
+	{
+		if(sqlAttList_[i].rep_.type_ == TeREAL || sqlAttList_[i].rep_.type_ == TeINT)
+			sqlNumAttList_.push_back(sqlAttList_[i]);
+	}
+}
+
+void
+TeTheme::setLegendsForObjects()
+{
+	if(grouping_.groupMode_ == TeNoGrouping || attTableVector_.empty())
+		return;
+
+	unsigned int i, j;
+	string func, query, oid, val;
+
+	TeDatabase *db = layer_->database();
+	TeDatabasePortal* portal = db->getPortal();
+
+	TeAttrDataType type = grouping_.groupAttribute_.type_;
+	string	groupingAttr = grouping_.groupAttribute_.name_;
+
+	vector<string> oidVec;
+	vector<string> oidWithNullValVec;
+	vector<string> valVec;
+	map<int, set<string> > legObjSetMap;
+
+	objLegendMap_.clear();
+
+	if(grouping_.groupFunction_.empty())
+		func = "MIN";
+	else
+		func = grouping_.groupFunction_;
+
+	if(grouping_.groupFunction_ == "COUNT")
+		type = TeINT;
+
+	query = "SELECT MIN(" + attTableVector_[0].uniqueName() + ")";
+	query += ", " + func + "(" + groupingAttr + ")" + sqlFrom_;
+	query += " GROUP BY " + attTableVector_[0].uniqueName();
+
+	if(portal->query(query) == false)
+	{
+		delete portal;
+		return;
+	}
+
+	while(portal->fetchRow())
+	{
+		oid = portal->getData(0);
+		val = portal->getData(1);
+		if (val.empty() == false)
+		{
+			oidVec.push_back(oid);
+			valVec.push_back(val);
+		}
+		else
+			oidWithNullValVec.push_back(oid);
+	}
+
+	unsigned int legSize = legend_.size();
+	if(grouping_.groupNullAttr_ && oidWithNullValVec.size() > 0)
+		--legSize;
+
+	if (grouping_.groupMode_ == TeUniqueValue)
+	{
+		for (i = 0; i < oidVec.size(); ++i)
+		{
+			oid = oidVec[i];
+			val = valVec[i];
+
+			if(type == TeREAL)
+				val = Te2String(atof(val.c_str()), grouping_.groupPrecision_);
+			else if(type == TeINT)
+				val = Te2String(atoi(val.c_str()));
+
+			for(j = 0; j < legSize; ++j)
+			{
+				TeLegendEntry& leg = legend_[j];
+				if(val == leg.from())
+				{
+					objLegendMap_[oid] = leg.id();
+					set<string>& oidSet = legObjSetMap[leg.id()];
+					oidSet.insert(oid);
+					break;
+				}
+			}
+		}
+	}
+	else
+	{
+		for (i = 0; i < oidVec.size(); ++i)
+		{
+			double dVal, dFrom, dTo;
+			oid = oidVec[i];
+			val = valVec[i];
+
+			if (type == TeREAL)
+				val = Te2String(atof(val.c_str()), grouping_.groupPrecision_);
+
+			for (j = 0; j < legSize; ++j)
+			{
+				TeLegendEntry& leg = legend_[j];
+				if (leg.from().find("mean") != string::npos)
+					continue;
+
+				dVal  = atof(val.c_str());
+				dFrom = atof(leg.from().c_str());
+				dTo = atof(leg.to().c_str());
+
+				if (j < (legSize - 1))
+				{
+					if(dVal >= dFrom && dVal < dTo)
+					{
+						objLegendMap_[oid] = leg.id();
+						set<string>& oidSet = legObjSetMap[leg.id()];
+						oidSet.insert(oid);
+						break;
+					}
+				}
+				else
+				{
+					if(dVal >= dFrom && dVal <= dTo)
+					{
+						objLegendMap_[oid] = leg.id();
+						set<string>& oidSet = legObjSetMap[leg.id()];
+						oidSet.insert(oid);
+						break;
+					}
+				}
+			}
+		}
+	}
+	delete portal;
+
+	// Set the leg id for the objects with null values
+	int legId = defaultLegend_.id();
+	if (grouping_.groupNullAttr_)
+		legId = legend_[legend_.size() - 1].id();
+
+	for (i = 0; i < oidWithNullValVec.size(); ++i)
+	{
+		oid = oidWithNullValVec[i];
+		objLegendMap_[oid] = legId;
+		set<string>& oidSet = legObjSetMap[legId];
+		oidSet.insert(oid);
+	}
+
+/*
+	// Insert the legends in the te_legend table
+	map<int, set<string> >::iterator mapIt;
+	set<string>::iterator setIt;
+	unsigned char *data;
+	string where = " theme_id = " + Te2String(id());
+	for (mapIt = legObjSetMap.begin(); mapIt != legObjSetMap.end(); ++mapIt)
+	{
+		legId = mapIt->first;
+		set<string>& oidSet = mapIt->second;
+		string whereClause = where;
+		whereClause +=  " AND legend_id = " + Te2String(legId);
+		string objStr;
+		for (setIt = oidSet.begin(); setIt != oidSet.end(); ++setIt)
+			objStr += *setIt + ';';
+		data = (unsigned char*)objStr.c_str();
+		db->insertBlob("te_legend", "object_list", whereClause, data, objStr.size());
+	}
+*/
+}
+
+void
+TeTheme::setOwnLegendsForObjects()
+{
+
+}
+
+bool
+TeTheme::saveLegendInCollection(TeSelectedObjects selectedObjects, std::string objectId)
+{
+	return saveLegendInCollection(layer()->database(), selectedObjects, objectId);
+}
+
+bool
+TeTheme::saveLegendInCollection(TeDatabase* db, TeSelectedObjects selectedObjects, std::string objectId)
+{
+	unsigned int i;
+	if(!db || grouping_.groupMode_ == TeNoGrouping)
+		return false;
+
+	TeAttrDataType		type = grouping_.groupAttribute_.type_;
+	TeLegendEntryVector legVec = legend_;
+	string			groupingAttr = grouping_.groupAttribute_.name_;
+
+	string input;
+	if(selectedObjects == TeSelectedByPointing)
+	{
+		input = " WHERE (grid_status = 1 OR grid_status = 3";
+		input += " OR (grid_status IS NULL AND (c_object_status = 1 OR c_object_status = 3)))";
+	}
+	else if(selectedObjects == TeNotSelectedByPointing)
+	{
+		input = " WHERE (grid_status = 0 OR grid_status = 2";
+		input += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 2)))";
+	}
+	else if(selectedObjects == TeSelectedByQuery)
+	{
+		input = " WHERE (grid_status = 2 OR grid_status = 3";
+		input += " OR (grid_status is null AND (c_object_status = 2 OR c_object_status = 3)))";
+	}
+	else if(selectedObjects == TeNotSelectedByQuery)
+	{
+		input = " WHERE (grid_status = 0 OR grid_status = 1";
+		input += " OR (grid_status is null AND (c_object_status = 0 OR c_object_status = 1)))";
+	}
+	else if(selectedObjects == TeGrouped)
+		input = " WHERE c_legend_id <> 0";
+	else if(selectedObjects == TeNotGrouped)
+		input = " WHERE c_legend_id = 0";
+
+
+	string func;
+	if(grouping_.groupFunction_.empty())
+		func = " MIN";
+	else
+		func = grouping_.groupFunction_;
+
+	if(grouping_.groupFunction_ == "COUNT")
+		type = TeINT;
+
+	string query = "SELECT MIN(" + collectionTable_ + ".c_object_id)";
+	if(grouping_.groupNormAttribute_.empty())
+		query += ", "+ func +"(" + groupingAttr + ")" + sqlGridFrom();
+	else
+		query += ", "+ func +"(" + groupingAttr + ") / "+ func +"(" + grouping_.groupNormAttribute_ + ")" + sqlGridFrom();
+
+	if(selectedObjects != TeAll)
+		query += input;
+
+	query += " GROUP BY " + collectionTable_ + ".c_object_id";
+
+	map<int, vector<string> > legMap;
+
+	TeDatabasePortal* portal = db->getPortal();
+	if(portal->query(query) == false)
+	{
+		delete portal;
+		return false;
+	}
+
+	vector<string> idVec;
+	vector<string> nullIdVec;
+	vector<string> valVec;
+	while(portal->fetchRow())
+	{
+		string val = portal->getData(1);
+		string oid = portal->getData(0);
+		if (val.empty() == false)
+		{
+			idVec.push_back(oid);
+			valVec.push_back(val);
+		}
+		else
+			nullIdVec.push_back(oid);
+	}
+	if (grouping_.groupMode_ == TeUniqueValue)
+	{
+		unsigned int j = 0;
+		while( j < idVec.size())
+		{
+			string val = valVec[j];
+			string oid = idVec[j];
+			if(type == TeREAL)
+			{
+				double a = atof(val.c_str());
+				val = Te2String(a, grouping_.groupPrecision_);
+			}
+			else if(type == TeINT)
+			{
+				int a = atoi(val.c_str());
+				val = Te2String(a);
+			}
+
+			unsigned int siz = legend_.size();
+			if(grouping_.groupNullAttr_ && nullIdVec.size() > 0)
+				--siz;
+			for(i=0; i < siz; i++)
+			{
+				TeLegendEntry& leg = legend_[i];
+				if(val == leg.from())
+				{
+					legMap[leg.id()].push_back(oid);
+					break;
+				}
+			}
+			j++;
+		}
+	}
+	else
+	{
+		unsigned int j = 0;
+		while(j < idVec.size())
+		{
+			string val = valVec[j];
+			string oid = idVec[j];
+			if(type == TeREAL)
+			{
+				double a = atof(val.c_str());
+				val = Te2String(a, grouping_.groupPrecision_);
+			}
+
+			unsigned int siz = legend_.size();
+			if(grouping_.groupNullAttr_ && !nullIdVec.empty())
+               --siz;
+			for(i=0; i < siz; i++)
+			{
+				TeLegendEntry& leg = legend_[i];
+				int f = leg.from().find("mean");
+				if(f >= 0)
+					continue;
+				double dval = atof(val.c_str());
+				double dfrom = atof(leg.from().c_str());
+				double dto = atof(leg.to().c_str());
+				if(i < legend_.size()-1)
+				{
+					if(dval >= dfrom && dval < dto)
+					{
+						legMap[leg.id()].push_back(oid);
+						break;
+					}
+				}
+				else
+				{
+					if(dval >= dfrom && dval <= dto)
+					{
+						legMap[leg.id()].push_back(oid);
+						break;
+					}
+				}
+			}
+			j++;
+		}
+	}
+	delete portal;
+
+	int legId = defaultLegend_.id();
+	if (grouping_.groupNullAttr_)
+		legId = legend_[legend_.size()-1].id();
+	for(i = 0; i < nullIdVec.size(); ++i)
+	{
+		string oid = nullIdVec[i];
+		legMap[legId].push_back(oid);
+	}
+
+	vector<string> svec;
+	map<int, vector<string> > :: iterator it = legMap.begin();
+	while(it != legMap.end())
+	{
+    	// --- Generate In Clauses ----
+		unsigned int i, j, k, size, chunkSize = 200, nChunks;
+		string inClause;
+		size = it->second.size();
+		if (size % chunkSize)
+			nChunks = size / chunkSize + 1;
+		else
+			nChunks = size / chunkSize;
+
+		j = 0;
+		for (k = 0; k < nChunks; ++k)
+		{
+			i = 0;
+			inClause = "(";
+			while (j < size && i < chunkSize)
+			{
+				inClause += "'" + db->escapeSequence(it->second[j]) + "',";
+				i++;
+				j++;
+			}
+			inClause[inClause.size() - 1] = ')';
+			svec.push_back(inClause);
+		}
+
+		//--- generateInClause
+
+		for(i=0; i<svec.size(); ++i)
+		{
+			string up = "UPDATE " + collectionTable_ + " SET c_legend_id = " + Te2String(it->first);
+			up += " WHERE c_object_id IN " + svec[i];
+			if (!objectId.empty())
+				up += " AND c_object_id='"+objectId+"'";
+			if(db->execute(up) == false)
+				continue;
+		}
+		it++;
+		svec.clear();
+	}
+	if(legend_.size())
+		visibleRep_ = visibleRep_ | 0x40000000;
+	else
+		visibleRep_ = visibleRep_ | 0xbfffffff;
+	string upVis = "UPDATE te_theme SET visible_rep=" + Te2String(visibleRep_) + " WHERE theme_id=" + Te2String(id());
+	return (db->execute(upVis));
+}
+
+bool
+TeTheme::populateCollection(std::string objectId, const bool& sincronize)
+{
+	TeDatabase* db = layer_->database();
+	if(!db || collectionTable_.empty())
+		return false;
+
+	if(attTableVector_.empty())
+		attTableVector_ = layer_->attrTables();
+
+	bool useSincronize = sincronize;
+
+	TeRepresPointerVector& represVec = layer_->vectRepres();
+	for (unsigned int i = 0; i < represVec.size(); ++i)
+	{
+		TeRepresentation* rep = represVec[i];
+		if(rep->geomRep_ == TeTEXT)
+			continue;
+
+		string geomTable = layer_->tableName(rep->geomRep_);
+
+		string sqlSelect, sqlFrom, sqlWhere;
+
+		sqlSelect = " SELECT DISTINCT "+ geomTable +".object_id ";
+		if(!generateAttributeRest_.empty() || !generateTemporalRest_.empty())
+		{
+			sqlFrom = tableJoin(attTableVector_, geomTable, "object_id");
+		}
+		else
+		{
+			sqlFrom = " " + geomTable;
+		}
+
+		if(useSincronize == true)
+		{
+			sqlWhere  = " WHERE NOT EXISTS (SELECT * FROM " + collectionTable_;
+			sqlWhere += " WHERE "+ collectionTable_ +".c_object_id = "+ geomTable +".object_id )";
+			sqlWhere += " AND " + geomTable + ".object_id IS NOT NULL ";
+		}
+		else
+		{
+			sqlWhere += " WHERE " + geomTable + ".object_id IS NOT NULL ";
+			useSincronize = true; //se tiver mais de uma representacao, o segundo join nao pode repetir valores ja inseridos
+		}
+
+		//attribute restriction
+		if(!generateAttributeRest_.empty())
+			sqlWhere += " AND ("+ generateAttributeRest_ +" )";
+
+		//temporal restriction
+		if(!generateTemporalRest_.empty())
+		{
+			string sqlTemp;
+			initParse(generateTemporalRest_, db);
+
+			if(!yyparse(sqlTemp))  //0: accept  1: reject
+				sqlWhere += " AND "+ sqlTemp;
+			else
+				return false;
+		}
+
+		TeKeys objs;
+
+		//spatial restriction
+		if(hasSpatialRes_)
+		{
+			if(boxRest_.isValid())
+			{
+				TeBox box = boxRest_;
+				sqlWhere += " AND "+ db->getSQLBoxWhere(box, geomRepRest_, geomTable);
+			}
+			else if (geomRest_)
+			{
+				TePrecision::instance().setPrecision(TeGetPrecision(layer()->projection()));
+
+				if(db->spatialRelation(geomTable, geomRepRest_, geomRest_, objs, spatialRelation_))
+				{
+					string obs;
+					for(unsigned int i=0; i<objs.size(); i++)
+					{
+						if(i!=0)
+							obs += ",";
+						obs += "'"+ objs[i] +"'";
+					}
+
+					sqlWhere += " AND "+ geomTable +".object_id IN ("+ obs +")";
+				}
+			}
+		}
+
+		//populate the collection table
+		string popule;
+		popule = " INSERT INTO "+ collectionTable_ +" (c_object_id) ";
+		popule += sqlSelect +" FROM "+ sqlFrom + sqlWhere;
+		if (!objectId.empty())
+		{
+			if (sqlWhere.length())
+				popule += " AND ";
+			popule += geomTable +".object_id='" +objectId+ "'";
+		}
+
+		if (!db->execute(popule))
+		{
+			//Treats an error in the MySQL database system
+			//Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
+			//Message: Duplicate entry '%s' for key %d
+			if(db->dbmsName() != "MySQL" || db->errorNum()!=1062)
+                return false;
+		}
+	}
+
+//	int defaultLegend = defaultLegend_.id();
+	string popule = "UPDATE " + collectionTable_;
+	popule += " SET c_legend_id=0, c_legend_own=0, c_object_status=0 ";
+
+	if (!objectId.empty())
+		popule += " WHERE c_object_id='"+objectId+"'";
+
+	if (!db->execute(popule))
+		return false;
+
+	themeBox_= getThemeBox();
+	return true;
+}
+
+bool TeTheme::hasObjectsWithoutGeometries(TeGeomRep geomRep)
+{
+	if(!layer() || !layer()->database())
+		return true;
+
+	//get the geometry table
+	string geomTable = layer()->tableName(geomRep);
+	if(geomTable.empty())
+		return true;
+
+	TeDatabasePortal* portal = layer()->database()->getPortal();
+	if(!portal)
+		return true;
+
+	//Verify the collection table or attribute tables
+	if(layer()->database()->tableExist(collectionTable()))
+	{
+		string s = " SELECT COUNT(*) ";
+		s+= " FROM "+  collectionTable();
+		s+= " WHERE NOT EXISTS ";
+		s+= " (SELECT * FROM "+ geomTable;
+		s+= " WHERE "+ collectionTable() +".c_object_id ";
+		s+= " = "+ geomTable +".object_id ) ";
+
+		if(!portal->query(s) || !portal->fetchRow())
+		{
+			delete portal;
+			return true;
+		}
+
+		int numObjs = atoi(portal->getData(0));
+		if(numObjs>0)
+		{
+			delete portal;
+			return true;
+		}
+	}
+	else
+	{
+		//for each static table
+		for(unsigned int i=0; i<this->attrTables().size(); ++i)
+		{
+			if(	this->attrTables()[i].tableType() == TeAttrExternal ||
+				this->attrTables()[i].tableType() == TeAttrMedia ||
+				this->attrTables()[i].tableType() == TeGeocodingData)
+				continue;
+
+			string s = " SELECT COUNT(*) ";
+			s+= " FROM "+  attrTables()[i].name();
+			s+= " WHERE NOT EXISTS ";
+			s+= " (SELECT * FROM "+ geomTable;
+			s+= " WHERE "+ attrTables()[i].name() +"."+ attrTables()[i].linkName();
+			s+= " = "+ geomTable +".object_id ) ";
+
+			if(!portal->query(s) || !portal->fetchRow())
+			{
+				delete portal;
+				return true;
+			}
+
+			int numObjs = atoi(portal->getData(0));
+			if(numObjs>0)
+			{
+				delete portal;
+				return true;
+			}
+		}
+	}
+
+	delete portal;
+	return false;
+}
+
+bool TeTheme::removeObjectsWithoutGeometries(TeGeomRep geomRep)
+{
+	if(!layer() || !layer()->database() || !layer()->database()->tableExist(collectionTable()))
+		return true;
+
+	//get the geometry table
+	string geomTable = layer()->tableName(geomRep);
+	if(geomTable.empty())
+		return true;
+
+	string del = " DELETE FROM "+ collectionTable();
+	del += " WHERE NOT EXISTS ";
+	del += " (SELECT * FROM "+ geomTable;
+	del += " WHERE "+ collectionTable() +".c_object_id = ";
+	del += geomTable +".object_id) ";
+
+	if(!layer()->database()->execute(del))
+		return false;
+
+	del = " DELETE FROM "+ collectionAuxTable();
+	del += " WHERE NOT EXISTS ";
+	del += " (SELECT * FROM "+ geomTable;
+	del += " WHERE "+ collectionAuxTable() +".object_id = ";
+	del += geomTable +".object_id) ";
+
+	if(!layer()->database()->execute(del))
+		return false;
+
+	return true;
+}
+
+bool
+TeTheme::save()
+{
+	TeDatabase* db = layer()->database();
+	if(!db)
+		return false;
+
+	//insert theme in database
+	if(id()==0)
+	{
+		if(!db->insertTheme(this)) //updateThemeTable
+		{
+			db->deleteTheme(this->id());
+			return false;
+		}
+	}
+
+    if(useCollection_)
+    {
+	    //collection table
+	    if(collectionTable().empty())
+		    collectionTable("te_collection_"+ Te2String(id()));
+
+	    if(!db->createCollectionTable(collectionTable_))
+	    {
+		    db->deleteTheme(this->id());
+		    return false;
+	    }
+
+	    //collection aux table
+	    collectionAuxTable(collectionTable() + "_aux");
+	    addThemeTable(collectionAuxTable());
+
+	    if(!createCollectionAuxTable())
+	    {
+		    db->deleteTheme(this->id());
+		    return false;
+	    }
+    }
+
+	return true;
+}
+
+set<string> TeTheme::getObjects(TeSelectedObjects selectedObjects)
+{
+	if (selectedObjects == TeAll)
+	{
+		if (objectSet_.empty() == false)
+			return objectSet_;
+		else
+		{
+			if (attTableVector_.empty())
+				return set<string>();
+
+			// Set the new set of objects
+			if (layer_->hasGeometry(TeRASTER) == false)
+			{
+				TeDatabase *db = layer_->database();
+				TeDatabasePortal* portal = db->getPortal();
+
+				string q = "SELECT " + attTableVector_[0].name() + "." + attTableVector_[0].uniqueName() + sqlFrom();
+				if (portal->query(q) == false)
+				{
+					delete portal;
+					return set<string>();
+				}
+
+				while (portal->fetchRow())
+					objectSet_.insert(portal->getData(0));
+
+				delete portal;
+				return objectSet_;
+			}
+		}
+	}
+
+	set<string> oidSet;
+	map<string, int>::iterator it;
+	string oid;
+
+	if (selectedObjects == TeSelectedByPointing)
+	{
+		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
+		{
+			oid = it->first;
+			if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TePOINTED_QUERIED)
+				oidSet.insert(oid);
+		}
+	}
+	else if (selectedObjects == TeNotSelectedByPointing)
+	{
+		oidSet = getObjects();
+		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
+		{
+			oid = it->first;
+			if (objStatusMap_[oid] == TePOINTED || objStatusMap_[oid] == TePOINTED_QUERIED)
+				oidSet.erase(oid);
+		}
+	}
+	else if (selectedObjects == TeSelectedByQuery)
+	{
+		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
+		{
+			oid = it->first;
+			if (objStatusMap_[oid] == TeQUERIED || objStatusMap_[oid] == TePOINTED_QUERIED)
+				oidSet.insert(oid);
+		}
+	}
+	else if (selectedObjects == TeNotSelectedByQuery)
+	{
+		oidSet = getObjects();
+		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
+		{
+			oid = it->first;
+			if (objStatusMap_[oid] == TeQUERIED || objStatusMap_[oid] == TePOINTED_QUERIED)
+				oidSet.erase(oid);
+		}
+	}
+	else if(selectedObjects == TeGrouped)
+	{
+		map<string, int>& objLegendMap = getObjLegendMap();
+		for (it = objLegendMap.begin(); it != objLegendMap.end(); ++it)
+		{
+			string oid = it->first;
+			if (objLegendMap[oid] != 0)
+				oidSet.insert(oid);
+		}
+	}
+	else if(selectedObjects == TeNotGrouped)
+	{
+		oidSet = getObjects();
+		map<string, int>& objLegendMap = getObjLegendMap();
+		for (it = objLegendMap.begin(); it != objLegendMap.end(); ++it)
+			oidSet.erase(it->first);
+	}
+	else if(selectedObjects == TeSelectedByPointingOrQuery)
+	{
+		oidSet = getObjects();
+		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
+		{
+			oid = it->first;
+			if (objStatusMap_[oid] == TeQUERIED || objStatusMap_[oid] == TePOINTED)
+				oidSet.insert(oid);
+		}
+	}
+	else if(selectedObjects == TeSelectedByPointingAndQuery )
+	{
+		oidSet = getObjects();
+		for (it = objStatusMap_.begin(); it != objStatusMap_.end(); ++it)
+		{
+			oid = it->first;
+			if (objStatusMap_[oid] == TePOINTED_QUERIED )
+				oidSet.insert(oid);
+		}
+	}
+
+	return oidSet;
+}
+
+vector<string> TeTheme::getItemVector(TeSelectedObjects selectedObjects)
+{
+	vector<string> itemVec;
+
+	//======================================================================================
+	//Get all the items
+	vector<string> allItemVec;
+	string item;
+	unsigned int i;
+
+	if (selectedObjects == TeAll || selectedObjects == TeNotSelectedByPointing ||
+		selectedObjects == TeNotSelectedByQuery)
+	{
+		vector<TeTable> tableVec;
+		getAttTables(tableVec);
+
+		string q = "SELECT ";
+		for (i = 0; i < tableVec.size(); ++i)
+		{
+			if (i != 0)
+				q += ",";
+			q += tableVec[i].uniqueName();
+		}
+		q += sqlFrom();
+
+		TeDatabase* db = layer()->database();
+		TeDatabasePortal* portal = db->getPortal();
+
+		if (portal->query(q) == false)
+		{
+			delete portal;
+			return itemVec;
+		}
+
+		while(portal->fetchRow())
+		{
+			item = portal->getData(tableVec[0].uniqueName());
+			for (i = 1; i < tableVec.size(); ++i)
+				item += portal->getData(tableVec[i].uniqueName());
+			allItemVec.push_back(item);
+		}
+
+		delete portal;
+	}
+
+	//======================================================================================
+	// Get the items according to the selectedObjects variable
+	map<string, int>& itemStatusMap = getItemStatusMap();
+	map<string, int>::iterator it;
+
+	if (selectedObjects == TeAll)
+		return allItemVec;
+	else if(selectedObjects == TeSelectedByPointing)
+	{
+		for (it = itemStatusMap.begin(); it != itemStatusMap.end(); ++it)
+		{
+			item = it->first;
+			if (itemStatusMap[item] == TePOINTED || itemStatusMap[item] == TePOINTED_QUERIED)
+				itemVec.push_back(item);
+		}
+	}
+	else if(selectedObjects == TeNotSelectedByPointing)
+	{
+		for (i = 0; i < allItemVec.size(); ++i)
+		{
+			item = allItemVec[i];
+			if (itemStatusMap[item] == TeDEFAULT || itemStatusMap[item] == TeQUERIED)
+				itemVec.push_back(item);
+
+			if (itemStatusMap[item] == TeDEFAULT)
+				itemStatusMap.erase(item);
+		}
+	}
+	else if(selectedObjects == TeSelectedByQuery)
+	{
+		for (it = itemStatusMap.begin(); it != itemStatusMap.end(); ++it)
+		{
+			item = it->first;
+			if (itemStatusMap[item] == TeQUERIED || itemStatusMap[item] == TePOINTED_QUERIED)
+				itemVec.push_back(item);
+		}
+	}
+	else if(selectedObjects == TeNotSelectedByQuery)
+	{
+		for (i = 0; i < allItemVec.size(); ++i)
+		{
+			item = allItemVec[i];
+			if (itemStatusMap[item] == TeDEFAULT || itemStatusMap[item] == TePOINTED)
+				itemVec.push_back(item);
+
+			if (itemStatusMap[item] == TeDEFAULT)
+				itemStatusMap.erase(item);
+		}
+	}
+	else if(selectedObjects == TeGrouped)
+	{
+		set<string> oidSet;
+		map<string, int>& objLegendMap = getObjLegendMap();
+		for (it = objLegendMap.begin(); it != objLegendMap.end(); ++it)
+		{
+			string oid = it->first;
+			if (objLegendMap[oid] != 0)
+				oidSet.insert(oid);
+		}
+
+		itemVec = getItemVector(oidSet);
+	}
+	else if(selectedObjects == TeNotGrouped)
+	{
+		set<string> oidSet = getObjects();
+		map<string, int>& objLegendMap = getObjLegendMap();
+		for (it = objLegendMap.begin(); it != objLegendMap.end(); ++it)
+			oidSet.erase(it->first);
+
+		itemVec = getItemVector(oidSet);
+	}
+	else if(selectedObjects == TeSelectedByPointingOrQuery )
+	{
+		for (it = itemStatusMap.begin(); it != itemStatusMap.end(); ++it)
+		{
+			item = it->first;
+			if( (itemStatusMap[item] == TePOINTED ) ||
+			  (itemStatusMap[item] == TeQUERIED ) ) {
+
+				itemVec.push_back(item);
+			}
+		}
+	}
+
+	return itemVec;
+}
+
+vector<string> TeTheme::getItemVector(const set<string>& oidSet)
+{
+	vector<string> itemVec;
+	vector<TeTable> tableVec = attrTables();
+	set<string>::const_iterator it;
+	unsigned int i;
+
+	if (tableVec.size() == 1)
+	{
+		for (it = oidSet.begin(); it != oidSet.end(); ++it)
+			itemVec.push_back(*it);
+		return itemVec;
+	}
+
+	// Set the expression that represents the concatenation
+	// of the unique names of each theme table
+	string concatIndexStr;
+	vector<string> indexVec;
+	TeDatabase* db = layer()->database();
+	for (i = 0; i < tableVec.size(); ++i)
+		indexVec.push_back(tableVec[i].name() + "." + tableVec[i].uniqueName());
+
+	concatIndexStr = db->getConcatFieldsExpression(indexVec);
+
+	vector<string> queryVec;
+	string query;
+
+
+	set<string>::const_iterator itB = oidSet.begin();
+	set<string>::const_iterator itE = oidSet.end();
+	vector<string> inClauseVec = generateInClauses(itB, itE, db);
+	for (i = 0; i < inClauseVec.size(); ++i)
+	{
+		query = "SELECT " + tableVec[i].name() + "." + tableVec[i].uniqueName();
+		query += ", " + concatIndexStr + sqlFrom() + " WHERE ";
+		query += tableVec[i].name() + "." + tableVec[i].uniqueName() + " IN " + inClauseVec[i];
+		queryVec.push_back(query);
+	}
+
+	TeDatabasePortal* portal = db->getPortal();
+	for (i = 0; i < queryVec.size(); ++i)
+	{
+		if (i != 0)
+			portal->freeResult();
+
+		if(portal->query(queryVec[i]) == false)
+		{
+			delete portal;
+			return itemVec;
+		}
+
+		while(portal->fetchRow())
+			itemVec.push_back(portal->getData(1));
+	}
+
+	delete portal;
+	return itemVec;
+}
+
+
+set<string> TeTheme::getObjects(const vector<string>& itemVec)
+{
+	set<string> oidSet;
+
+	unsigned int i;
+	TeDatabase* db = layer()->database();
+
+	// Get the vector of tables of the theme
+	vector<TeTable> tableVec;
+	getAttTables(tableVec);
+
+	vector<string> indexVec;
+	for (i = 0; i < tableVec.size(); ++i)
+		indexVec.push_back(tableVec[i].name() + "." + tableVec[i].uniqueName());
+
+	string concatIndexStr = db->getConcatFieldsExpression(indexVec);
+
+	std::vector<string>::const_iterator itemVec_it_begin( itemVec.begin() );
+	std::vector<string>::const_iterator itemVec_it_end( itemVec.end() );
+
+	vector<string> inClauseVec = generateInClauses( itemVec_it_begin,
+    itemVec_it_end, db);
+
+	vector<string> queryVec;
+	string selectClause = "SELECT " + concatIndexStr + ", ";
+	selectClause += tableVec[0].name() + "." + tableVec[0].uniqueName() + " " + sqlFrom();
+
+	for (i = 0; i < inClauseVec.size(); ++i)
+	{
+		string query = selectClause + " WHERE " + concatIndexStr + " IN " + inClauseVec[i];
+		queryVec.push_back(query);
+	}
+
+	TeDatabasePortal *portal = db->getPortal();
+	for (i = 0; i < queryVec.size(); ++i)
+	{
+		if (i != 0)
+			portal->freeResult();
+
+		if (portal->query(queryVec[i]))
+		{
+			while (portal->fetchRow())
+				oidSet.insert(portal->getData(1));
+		}
+	}
+	delete portal;
+
+	return oidSet;
+}
+
+unsigned int
+TeTheme::getNumberOfObjects()
+{
+	int numRows = 0;
+	string s = "SELECT COUNT(*) " + this->sqlFrom();
+	TeDatabasePortal* portal = this->layer()->database()->getPortal();
+	if(portal->query(s) && portal->fetchRow() )
+	{
+		numRows = atoi(portal->getData(0));
+	}
+	delete portal;
+	return numRows;
+}
+
+
+void TeTheme::setUsingCollection(const bool& usingCollection)
+{
+    useCollection_ = usingCollection;
+}
+
+TeProjection*
+TeTheme::getThemeProjection()
+{
+	if (layer_)
+		return layer_->projection();
+	else
+		return 0;
+}
+
diff --git a/src/terralib/kernel/TeTheme.h b/src/terralib/kernel/TeTheme.h
old mode 100755
new mode 100644
index 95c755f..9bcfa18
--- a/src/terralib/kernel/TeTheme.h
+++ b/src/terralib/kernel/TeTheme.h
@@ -1,451 +1,454 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeTheme.h
-	\brief This file contains definitions about a theme in TerraLib database
-*/
-#ifndef  __TERRALIB_INTERNAL_THEME_H
-#define  __TERRALIB_INTERNAL_THEME_H
-
-#include "TeAbstractTheme.h"
-#include "TeLayer.h"
-
-using namespace std;
-
-//! TerraLib definition of a Theme
-/*!
-\par 
-A TeTheme represents a collection of objects selected from a TeLayer. This selection is based
-on restrictions that can be non-spatial (e.g. POP > 10000), spatial (e.g. "inside box(0,0,100,100)
-or temporal. The most simple selection is "all" objects of a layer.
-\par 
-A TeTheme contains the list of attribute tables of the layer used by a theme.
-\par 
-A TeTheme contains the visual presentation parameters for the objects that contains, for
-all of its geometrical representations.
-\par 
-A TeTheme can store the parameters associated to how to separate its objects in groups. 
-\par 
-A TeTheme can store parameters associated to the creation of individual graphs on its objects
-(e.g. pie bars that relate two or more of its attributes).
-\par 
-A TeTheme store the range of scales within it should be visible. 
-\sa TeView TeTable
-*/
-class TL_DLL TeTheme: public TeAbstractTheme
-{
-public:
-	//! Constructor
-    TeTheme( const string& name="", TeLayer* layer=0, TeViewNode* parent=0, const int& view=0, const int& id=0);
-
-	//! Constructor
-	TeTheme(const TeViewNodeParams& params); 
-
-	//! Copy constructor
-	TeTheme (const TeTheme& other);
-
-	//! Destructor
-	~TeTheme ();
-
-	//! Assignment operator
-	TeTheme& operator= (const TeTheme& other); 
-
-	/** @name Layer
-		Methods related to the layer that gives origin to this theme.
-	*/
-	//@{	
-	//! Returns the id of the source layer
-	virtual int layerId() 
-	{	return layerId_; }
-
-	//! Sets the id of the source layer
-	virtual void layerId(int i)
-	{	layerId_ = i; }
-
-	//! Sets the layer that is the source of objects of the theme
-	/*! 
-		\param layer a pointer to a TeLayer
-	*/
-	virtual void layer(TeLayer* layer);
-
-	//! Returns a pointer to the layer from which the theme get its objects
-	virtual TeLayer* layer() { return layer_; }
-
-	//! Returns a pointer to a projection that is the spatial reference for the objects of this theme: same as of its layer
-	virtual TeProjection* getThemeProjection();
-	//@}
-
-	//! Sets the spatial restriction to be a spatial relation with a box
-	virtual void setSpatialRest(TeBox& box, TeGeomRep rep = TeGEOMETRYNONE, TeSpatialRelation relation = TeWITHIN); 
-
-	//! Sets the spatial restriction to be a spatial relation with a geometry
-	virtual void setSpatialRest(TeGeometry* geom, TeGeomRep rep = TeGEOMETRYNONE, TeSpatialRelation relation = TeWITHIN); 
-
-	//! Returns the clause WHERE derived from the combination of all restricitions (spatial, attribute and temporal)
-	virtual string sqlWhereRestrictions(TeRepresentation* rep=0);
-
-	//! Creates an appropriate visual presentation to the raster of the theme
-    virtual void createRasterVisual(TeRaster* rst=0);
-
-	/** @name Collection
-		Methods related to the materialization in the database of the theme as a collection of objects 
-	*/
-	//@{
-	//! Returns the name of a table used to store the ids of the objects belonging to the theme
-	virtual string	collectionTable() { return collectionTable_; }
-
-	//! Sets the name of a table used to store the ids of the objects belonging to the theme
-	virtual void collectionTable(const string& s) { collectionTable_ = s; }
-
-	//! Returns the name of the collection auxiliary table
-	virtual string collectionAuxTable() { return collectionAuxTable_; }
-
-	//! Sets the name of the collection auxiliary table
-	virtual void collectionAuxTable(string name) { collectionAuxTable_ = name; }
-
-	//! Generates a optimized position (x,y) in the spatial extention of each object to position label ou graphs
-	virtual bool generateLabelPositions(const std::string& objectId = ""); 
-
-	//! Fills the sqlGridJoin_ and sqlGridFrom_ statements according to the status of the database
-	virtual void loadTablesJoin(const string& geomTable="");
-
-	/**
-		Returns a SQL JOIN statement to get all the attributes of the theme objects, 
-	    the attributes of the collection table, and the attributes of the extended 
-		collection table 
-	**/
-	virtual string sqlGridJoin() { return sqlGridJoin_; }
-
-	/** Returns a FROM clause of a SQL statement to get attributes of the theme objects, the attributes of the 
-	collection table, and the attributes of the extended collection table 
-	**/
-	virtual string sqlGridFrom(const string& geomTable=""); 
-
-	//! Build the theme collection: materializes the selection described in the theme in a collection table
-	virtual bool buildCollection(std::string objectId = "");
-
-	//! Create the auxiliar collection table used to represent objects with multiple versions in time  
-	virtual bool createCollectionAuxTable();
-
-	//! Populate the auxiliar collection table used to represent objects with multiple versions in time
-	virtual bool populateCollectionAux(std::string objectId = "");
-	//@}
-
-	//! Checks if the theme is update. If FALSE, the theme may be not be updated.
-	virtual bool isUpdated();
-		
-	/** @name Grouping
-		Methods related to grouping of objects of the theme. 
-	*/
-	//@{
-	//! Save the grouping parameters in memory when there is no chronon
-	virtual bool buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll,
-		               vector<double>* dValuesVec = 0);
-
-	//! Save the grouping parameters in memory when there is chronon
-	virtual bool buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec);
-	
-	//! Build the grouping and associate each object to its group in the collection table 
-	virtual bool saveGrouping(TeSelectedObjects selectedObjects = TeAll);
-
-	//! Save the theme grouping legends in the collection table  
-	virtual bool saveLegendInCollection(TeSelectedObjects selectedObjects = TeAll, std::string objectId = "");
-
-	//! Set the legend id for each object of the theme 
-	virtual void setLegendsForObjects();
-
-	//! Set the own legend id for each object of the theme 
-	virtual void setOwnLegendsForObjects();
-
-	//! Delete grouping
-	virtual bool deleteGrouping(); 
-	//@}
-
-	/** @name Attribute Tables
-		A theme can use one or more attribute tables of the layer that gives its data.
-		These methods are related to the manipulation of these tables.
-	*/
-	//@{
-
-	//! Loads the theme tables in the database
-	virtual bool loadThemeTables(); 
-
-	//! Add a new attribute table to a theme 
-	virtual bool addThemeTable (TeTable& table);
-
-	//! Add a new attribute table to a theme
-	virtual void addThemeTable (string tableName);
-
-	//! Verify if an attribute table is part of a theme
-	virtual bool isThemeTable(int tableId);
-
-	//! Verify if an attribute table is part of a theme
-	virtual bool isThemeTable(string tableName);
-
-	//! Returns the list of attribute tables used by this theme 
-	virtual TeAttrTableVector& attrTables()
-	{	return attTableVector_; }
-
-	//! Sets the entire list of attribute tables used by this theme 
-	virtual bool setAttTables(TeAttrTableVector& attrs);  
-
-	//! Returns a vector of attribute tables, of a specific type, used by this theme
-	virtual bool getAttTables(TeAttrTableVector& attrs, TeAttrTableType attType = TeAllAttrTypes); 
-
-	//! Returns a representation of an attribute table  given name 
-	virtual bool getTable(TeTable& table, const string tableName);
-
-	//! Clears the list of attribute tables used by this theme
-	virtual void clearAttTableVector() 
-	{	attTableVector_.clear();	}
-
-	//! Returns the temporal attribute table of the theme (TeEvent or TeFixedGeomDynAttr)
-	/*
-		\note A theme supports only one temporal attribute table
-	*/
-	virtual bool getTemporalTable(TeTable& table);
-
-	//! Removes an attribute table from the list of tables of a theme
-	virtual bool removeThemeTable(unsigned int index);
-
-	//! Returns the the name of an attribute table that contains a given attribute
-	virtual string getTableName(const string& attrName);
-
-	/**
-		Returns the full name of the i-th attribute resulting of the join of all attribute
-		tables associated to the theme tables 
-	*/
-	virtual string getAttribute(unsigned int i);
-
-	/**
-		Check if the name of the i-th attribute resulting of the join of all attribute
-		tables is an index or not
-	*/
-	virtual bool isIndex(unsigned int i);
-
-	//! Returns the list of attributes of theme tables 
-	virtual TeAttributeList sqlAttList() { return sqlAttList_;}
-
-	//! Clears the list of attributes associated to the theme tables 
-	virtual void clearAttList() {sqlAttList_.clear();}
-
-	//! Returns the list of numerical attributes of the theme tables 
-	virtual TeAttributeList sqlNumAttList() { return sqlNumAttList_;}
-
-	//! Clears the list of numerical attributes associated to the theme tables 
-	virtual void clearNumAttList() {sqlNumAttList_.clear();}
-
-	//! Returns a SQL JOIN statement to reach to all attribute tables used by this theme
-	virtual string	sqlJoin() { return sqlJoin_;}
-
-	//! Returns a SQL FROM CLAUSE that gives access to all attribute tables used by this theme
-	virtual string	sqlFrom() { return sqlFrom_;}
-
-	//! Returns the string containing the SQL WHERE clause 
-	virtual string&	sqlWhere() { return sqlWhere_;}
-
-	//! Returns the alias vector of the names of the theme tables
-	virtual vector<string>&	aliasVector() { return aliasVector_; }
-
-	//! fill aliasVector_
-	virtual void loadAliasVector();
-
-	//! Refresh list of attributes of all the theme tables.
-	/*
-		\note All attributes are stored into sqlAttList_ and numeric attributes are stored into sqlNumAttList_.
-	*/
-	virtual void loadAttrLists();
-	//@}
-
-	//! Refreshes the bounding box of a theme according to its representation
-	/*
-		\note This functions is being kept for compatibility reasons with derived
-		classes. IT SHOULD NOT BE USED BY APPLICATION USING ONLY THE BASIC CLASS.
-	*/
-	virtual void updateThemeBox() {}
-
-	//! Updates the bounding box of a theme (in the database)
-	/*
-		\note This functions is being kept for compatibility reasons with derived
-		classes. IT SHOULD NOT BE USED BY APPLICATION USING ONLY THE BASIC CLASS.
-	*/
-	virtual void updateThemeBox(const TeBox& /*box*/) {}
-	//@}
-
-	/** @name Locate geometries
-	    Returns the geometry(ies) of the theme given coordinate
-	*/
-	//@{ 	
-	virtual bool locatePolygon		(TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0);
-	virtual bool locatePolygonSet   (TeCoord2D &pt, double tol, TePolygonSet &polygons);
-	virtual bool locateLine		(TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
-	virtual bool locatePoint	(TeCoord2D &pt, TePoint &point, const double& tol = 0.0);
-	virtual bool locateCell		(TeCoord2D &pt, TeCell &c, const double& tol = 0.0);
-	//@}
-	
-	//! Get the set of objects corresponding to the object selection criteria
-	virtual set<string> getObjects(TeSelectedObjects selectedObjects = TeAll);
-
-	//! Get the set of objects corresponding to the list of items
-	virtual set<string> getObjects(const vector<string>& itemVec);
-
-	//! Get the set of items corresponding to the object selection criteria
-	virtual vector<string> getItemVector(TeSelectedObjects selectedObjects);
-
-	//! Get the set of items corresponding to the set of objects
-	virtual vector<string> getItemVector(const set<string>& oidSet);
-
-	//! Verifies if there are objects without geometries of a specific geometry representation
-	virtual bool hasObjectsWithoutGeometries(TeGeomRep geomRep);
-
-	//! Removes the objects without geometries of a specific geometry representation
-	virtual bool removeObjectsWithoutGeometries(TeGeomRep geomRep);
-
-	//! Save the the theme parameters in the database
-	virtual bool save(); 
-
-	//! Get the number of objects acessible by this theme
-	virtual unsigned int getNumberOfObjects();
-
-	//! Save the theme metadata in database. In this case, this metadata is saved by TeDatabase
-	virtual bool saveMetadata(TeDatabase*) { return true; } 
-
-    //! Tells if it necessary to build a collection
-	void setUsingCollection(const bool& usingCollection); 
-
-protected:
-	
-	//! Create the auxiliar collection table used to represent objects with multiple versions in time  
-	virtual bool createCollectionAuxTable(TeDatabase* db);
-
-	//! Save the grouping parameters in memory when there is no chronon
-	virtual bool buildGrouping(TeDatabase* db, const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll,
-		                       vector<double>* dValuesVec = 0);
-
-	//! Save the grouping parameters in memory when there is chronon
-	virtual bool buildGrouping(TeDatabase* db, const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec);
-
-	//! Build the grouping and associate each object to its group in the collection table 
-	virtual bool saveGrouping(TeDatabase* db, TeSelectedObjects selectedObjects = TeAll);
-
-	//! Save the theme grouping legends in the collection table  
-	virtual bool saveLegendInCollection(TeDatabase* db, TeSelectedObjects selectedObjects = TeAll, std::string objectId = "");
-	
-	//! Fill the sqlJoin_ and sqlFrom_ 
-	virtual void loadThemeTablesJoin();
-	
-	//! Populate the collection table based in the theme restrictions
-	virtual bool populateCollection(std::string objectId = ""); 
-
-	//! list of attribute tables of the theme
-	TeAttrTableVector	attTableVector_;
-
-	//! List containing all the attributes of the theme tables
-	TeAttributeList	sqlAttList_;
-	
-	//! List containing only the numeric attributes of the theme tables
-	TeAttributeList	sqlNumAttList_;		
-
-	//! Pointer to the layer that gives origin to this theme
-	TeLayer*	layer_;
-
-	//! Layer id
-	int			layerId_;	
-	
-	// collection table name
-	string		collectionTable_;
-	string		collectionAuxTable_;
-
-    bool useCollection_;
-
-	// ----------------- theme tables information -----------------
-
-	//! clause FROM: join with the theme tables and collection table
-	string	sqlFrom_;		
-	
-	//! clause SELECT and FROM: join with the theme tables and collection table
-	string	sqlJoin_;
-	
-	//! string containing the WHERE clause
-	string sqlWhere_;
-
-	//! clause FROM: join with the theme tables and auxiliar collection table
-	string	sqlGridFrom_;
-	
-	//! clause SELECT and FROM: join with the theme tables and auxiliar collection table
-	string	sqlGridJoin_;
-
-	//! vector of alias to the attribute tables that are used more than once  
-	vector<string>	aliasVector_;
-
-	//! Load the theme metadata from database. In this case, this metadata is loaded by TeDatabase
-	virtual bool loadMetadata(TeDatabase* ) { return true; } 
-
-	//! Erase the theme metadata in database. In this case, this metadata is erased by TeDatabase
-	virtual bool eraseMetadata(TeDatabase* ) { return true; } 
-};
-
-
-//!  This class implements a factory to create theme objects. 
-/*!  
-	 This class is a factory that create view nodes 
-	 of the type TeTHEME, that is, theme objects.
-
-	\sa
-     TeViewNodeFactory TeViewNodeParams TeTheme  
-*/
-class TL_DLL TeThemeFactory : public TeViewNodeFactory
-{
-public:
-	//! Constructor 
-	TeThemeFactory() : TeViewNodeFactory((int)TeTHEME)
-	{}
-
-	//! Created theme objects 
-	TeViewNode* build(TeViewNodeParams* params)
-	{	
-		TeViewNodeParams auxParams = *params;
-		return new TeTheme(auxParams);	
-	}
-
-	TeViewNode* build()
-	{
-		return new TeTheme();
-	}
-};
-
-
-/*! \example createTheme.cpp
-	Shows how to create themes in TerraLib.
- */
-
-/*! \example themeGrouping.cpp
-	Shows how to do a grouping on the objects of a TerraLib theme.
- */
-
-/*! \example rasterSlicing.cpp
-	Shows how to  create a legend over a raster data, stored in a layer TerraLib.
- */
-
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeTheme.h
+	\brief This file contains definitions about a theme in TerraLib database
+*/
+#ifndef  __TERRALIB_INTERNAL_THEME_H
+#define  __TERRALIB_INTERNAL_THEME_H
+
+#include "TeAbstractTheme.h"
+#include "TeLayer.h"
+
+using namespace std;
+
+//! TerraLib definition of a Theme
+/*!
+\par 
+A TeTheme represents a collection of objects selected from a TeLayer. This selection is based
+on restrictions that can be non-spatial (e.g. POP > 10000), spatial (e.g. "inside box(0,0,100,100)
+or temporal. The most simple selection is "all" objects of a layer.
+\par 
+A TeTheme contains the list of attribute tables of the layer used by a theme.
+\par 
+A TeTheme contains the visual presentation parameters for the objects that contains, for
+all of its geometrical representations.
+\par 
+A TeTheme can store the parameters associated to how to separate its objects in groups. 
+\par 
+A TeTheme can store parameters associated to the creation of individual graphs on its objects
+(e.g. pie bars that relate two or more of its attributes).
+\par 
+A TeTheme store the range of scales within it should be visible. 
+\sa TeView TeTable
+*/
+class TL_DLL TeTheme: public TeAbstractTheme
+{
+public:
+	//! Constructor
+    TeTheme( const string& name="", TeLayer* layer=0, TeViewNode* parent=0, const int& view=0, const int& id=0);
+
+	//! Constructor
+	TeTheme(const TeViewNodeParams& params); 
+
+	//! Copy constructor
+	TeTheme (const TeTheme& other);
+
+	//! Destructor
+	~TeTheme ();
+
+	//! Assignment operator
+	TeTheme& operator= (const TeTheme& other); 
+
+	//! Clones the object
+	virtual TeViewNode* clone();
+
+	/** @name Layer
+		Methods related to the layer that gives origin to this theme.
+	*/
+	//@{	
+	//! Returns the id of the source layer
+	virtual int layerId() 
+	{	return layerId_; }
+
+	//! Sets the id of the source layer
+	virtual void layerId(int i)
+	{	layerId_ = i; }
+
+	//! Sets the layer that is the source of objects of the theme
+	/*! 
+		\param layer a pointer to a TeLayer
+	*/
+	virtual void layer(TeLayer* layer);
+
+	//! Returns a pointer to the layer from which the theme get its objects
+	virtual TeLayer* layer() { return layer_; }
+
+	//! Returns a pointer to a projection that is the spatial reference for the objects of this theme: same as of its layer
+	virtual TeProjection* getThemeProjection();
+	//@}
+
+	//! Sets the spatial restriction to be a spatial relation with a box
+	virtual void setSpatialRest(TeBox& box, TeGeomRep rep = TeGEOMETRYNONE, TeSpatialRelation relation = TeWITHIN); 
+
+	//! Sets the spatial restriction to be a spatial relation with a geometry
+	virtual void setSpatialRest(TeGeometry* geom, TeGeomRep rep = TeGEOMETRYNONE, TeSpatialRelation relation = TeWITHIN); 
+
+	//! Returns the clause WHERE derived from the combination of all restricitions (spatial, attribute and temporal)
+	virtual string sqlWhereRestrictions(TeRepresentation* rep=0);
+
+	//! Creates an appropriate visual presentation to the raster of the theme
+    virtual void createRasterVisual(TeRaster* rst=0);
+
+	/** @name Collection
+		Methods related to the materialization in the database of the theme as a collection of objects 
+	*/
+	//@{
+	//! Returns the name of a table used to store the ids of the objects belonging to the theme
+	virtual string	collectionTable() { return collectionTable_; }
+
+	//! Sets the name of a table used to store the ids of the objects belonging to the theme
+	virtual void collectionTable(const string& s) { collectionTable_ = s; }
+
+	//! Returns the name of the collection auxiliary table
+	virtual string collectionAuxTable() { return collectionAuxTable_; }
+
+	//! Sets the name of the collection auxiliary table
+	virtual void collectionAuxTable(string name) { collectionAuxTable_ = name; }
+
+	//! Generates a optimized position (x,y) in the spatial extention of each object to position label ou graphs
+	virtual bool generateLabelPositions(const std::string& objectId = ""); 
+
+	//! Fills the sqlGridJoin_ and sqlGridFrom_ statements according to the status of the database
+	virtual void loadTablesJoin(const string& geomTable="");
+
+	/**
+		Returns a SQL JOIN statement to get all the attributes of the theme objects, 
+	    the attributes of the collection table, and the attributes of the extended 
+		collection table 
+	**/
+	virtual string sqlGridJoin() { return sqlGridJoin_; }
+
+	/** Returns a FROM clause of a SQL statement to get attributes of the theme objects, the attributes of the 
+	collection table, and the attributes of the extended collection table 
+	**/
+	virtual string sqlGridFrom(const string& geomTable=""); 
+
+	//! Build the theme collection: materializes the selection described in the theme in a collection table
+	virtual bool buildCollection(std::string objectId = "", const bool& sincronize = true);
+
+	//! Create the auxiliar collection table used to represent objects with multiple versions in time  
+	virtual bool createCollectionAuxTable();
+
+	//! Populate the auxiliar collection table used to represent objects with multiple versions in time
+	virtual bool populateCollectionAux(std::string objectId = "");
+	//@}
+
+	//! Checks if the theme is update. If FALSE, the theme may be not be updated.
+	virtual bool isUpdated();
+		
+	/** @name Grouping
+		Methods related to grouping of objects of the theme. 
+	*/
+	//@{
+	//! Save the grouping parameters in memory when there is no chronon
+	virtual bool buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll,
+		               vector<double>* dValuesVec = 0);
+
+	//! Save the grouping parameters in memory when there is chronon
+	virtual bool buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec);
+	
+	//! Build the grouping and associate each object to its group in the collection table 
+	virtual bool saveGrouping(TeSelectedObjects selectedObjects = TeAll);
+
+	//! Save the theme grouping legends in the collection table  
+	virtual bool saveLegendInCollection(TeSelectedObjects selectedObjects = TeAll, std::string objectId = "");
+
+	//! Set the legend id for each object of the theme 
+	virtual void setLegendsForObjects();
+
+	//! Set the own legend id for each object of the theme 
+	virtual void setOwnLegendsForObjects();
+
+	//! Delete grouping
+	virtual bool deleteGrouping(); 
+	//@}
+
+	/** @name Attribute Tables
+		A theme can use one or more attribute tables of the layer that gives its data.
+		These methods are related to the manipulation of these tables.
+	*/
+	//@{
+
+	//! Loads the theme tables in the database
+	virtual bool loadThemeTables(); 
+
+	//! Add a new attribute table to a theme 
+	virtual bool addThemeTable (TeTable& table);
+
+	//! Add a new attribute table to a theme
+	virtual void addThemeTable (string tableName);
+
+	//! Verify if an attribute table is part of a theme
+	virtual bool isThemeTable(int tableId);
+
+	//! Verify if an attribute table is part of a theme
+	virtual bool isThemeTable(string tableName);
+
+	//! Returns the list of attribute tables used by this theme 
+	virtual TeAttrTableVector& attrTables()
+	{	return attTableVector_; }
+
+	//! Sets the entire list of attribute tables used by this theme 
+	virtual bool setAttTables(TeAttrTableVector& attrs);  
+
+	//! Returns a vector of attribute tables, of a specific type, used by this theme
+	virtual bool getAttTables(TeAttrTableVector& attrs, TeAttrTableType attType = TeAllAttrTypes); 
+
+	//! Returns a representation of an attribute table  given name 
+	virtual bool getTable(TeTable& table, const string tableName);
+
+	//! Clears the list of attribute tables used by this theme
+	virtual void clearAttTableVector() 
+	{	attTableVector_.clear();	}
+
+	//! Returns the temporal attribute table of the theme (TeEvent or TeFixedGeomDynAttr)
+	/*
+		\note A theme supports only one temporal attribute table
+	*/
+	virtual bool getTemporalTable(TeTable& table);
+
+	//! Removes an attribute table from the list of tables of a theme
+	virtual bool removeThemeTable(unsigned int index);
+
+	//! Returns the the name of an attribute table that contains a given attribute
+	virtual string getTableName(const string& attrName);
+
+	/**
+		Returns the full name of the i-th attribute resulting of the join of all attribute
+		tables associated to the theme tables 
+	*/
+	virtual string getAttribute(unsigned int i);
+
+	/**
+		Check if the name of the i-th attribute resulting of the join of all attribute
+		tables is an index or not
+	*/
+	virtual bool isIndex(unsigned int i);
+
+	//! Returns the list of attributes of theme tables 
+	virtual TeAttributeList sqlAttList() { return sqlAttList_;}
+
+	//! Clears the list of attributes associated to the theme tables 
+	virtual void clearAttList() {sqlAttList_.clear();}
+
+	//! Returns the list of numerical attributes of the theme tables 
+	virtual TeAttributeList sqlNumAttList() { return sqlNumAttList_;}
+
+	//! Clears the list of numerical attributes associated to the theme tables 
+	virtual void clearNumAttList() {sqlNumAttList_.clear();}
+
+	//! Returns a SQL JOIN statement to reach to all attribute tables used by this theme
+	virtual string	sqlJoin() { return sqlJoin_;}
+
+	//! Returns a SQL FROM CLAUSE that gives access to all attribute tables used by this theme
+	virtual string	sqlFrom() { return sqlFrom_;}
+
+	//! Returns the string containing the SQL WHERE clause 
+	virtual string&	sqlWhere() { return sqlWhere_;}
+
+	//! Returns the alias vector of the names of the theme tables
+	virtual vector<string>&	aliasVector() { return aliasVector_; }
+
+	//! fill aliasVector_
+	virtual void loadAliasVector();
+
+	//! Refresh list of attributes of all the theme tables.
+	/*
+		\note All attributes are stored into sqlAttList_ and numeric attributes are stored into sqlNumAttList_.
+	*/
+	virtual void loadAttrLists();
+	//@}
+
+	//! Refreshes the bounding box of a theme according to its representation
+	/*
+		\note This functions is being kept for compatibility reasons with derived
+		classes. IT SHOULD NOT BE USED BY APPLICATION USING ONLY THE BASIC CLASS.
+	*/
+	virtual void updateThemeBox() {}
+
+	//! Updates the bounding box of a theme (in the database)
+	/*
+		\note This functions is being kept for compatibility reasons with derived
+		classes. IT SHOULD NOT BE USED BY APPLICATION USING ONLY THE BASIC CLASS.
+	*/
+	virtual void updateThemeBox(const TeBox& /*box*/) {}
+	//@}
+
+	/** @name Locate geometries
+	    Returns the geometry(ies) of the theme given coordinate
+	*/
+	//@{ 	
+	virtual bool locatePolygon		(TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0);
+	virtual bool locatePolygonSet   (TeCoord2D &pt, double tol, TePolygonSet &polygons);
+	virtual bool locateLine		(TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
+	virtual bool locatePoint	(TeCoord2D &pt, TePoint &point, const double& tol = 0.0);
+	virtual bool locateCell		(TeCoord2D &pt, TeCell &c, const double& tol = 0.0);
+	//@}
+	
+	//! Get the set of objects corresponding to the object selection criteria
+	virtual set<string> getObjects(TeSelectedObjects selectedObjects = TeAll);
+
+	//! Get the set of objects corresponding to the list of items
+	virtual set<string> getObjects(const vector<string>& itemVec);
+
+	//! Get the set of items corresponding to the object selection criteria
+	virtual vector<string> getItemVector(TeSelectedObjects selectedObjects);
+
+	//! Get the set of items corresponding to the set of objects
+	virtual vector<string> getItemVector(const set<string>& oidSet);
+
+	//! Verifies if there are objects without geometries of a specific geometry representation
+	virtual bool hasObjectsWithoutGeometries(TeGeomRep geomRep);
+
+	//! Removes the objects without geometries of a specific geometry representation
+	virtual bool removeObjectsWithoutGeometries(TeGeomRep geomRep);
+
+	//! Save the the theme parameters in the database
+	virtual bool save(); 
+
+	//! Get the number of objects acessible by this theme
+	virtual unsigned int getNumberOfObjects();
+
+	//! Save the theme metadata in database. In this case, this metadata is saved by TeDatabase
+	virtual bool saveMetadata(TeDatabase*) { return true; } 
+
+    //! Tells if it necessary to build a collection
+	void setUsingCollection(const bool& usingCollection); 
+
+protected:
+	
+	//! Create the auxiliar collection table used to represent objects with multiple versions in time  
+	virtual bool createCollectionAuxTable(TeDatabase* db);
+
+	//! Save the grouping parameters in memory when there is no chronon
+	virtual bool buildGrouping(TeDatabase* db, const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll,
+		                       vector<double>* dValuesVec = 0);
+
+	//! Save the grouping parameters in memory when there is chronon
+	virtual bool buildGrouping(TeDatabase* db, const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec);
+
+	//! Build the grouping and associate each object to its group in the collection table 
+	virtual bool saveGrouping(TeDatabase* db, TeSelectedObjects selectedObjects = TeAll);
+
+	//! Save the theme grouping legends in the collection table  
+	virtual bool saveLegendInCollection(TeDatabase* db, TeSelectedObjects selectedObjects = TeAll, std::string objectId = "");
+	
+	//! Fill the sqlJoin_ and sqlFrom_ 
+	virtual void loadThemeTablesJoin();
+	
+	//! Populate the collection table based in the theme restrictions
+	virtual bool populateCollection(std::string objectId = "", const bool& sincronize = true); 
+
+	//! list of attribute tables of the theme
+	TeAttrTableVector	attTableVector_;
+
+	//! List containing all the attributes of the theme tables
+	TeAttributeList	sqlAttList_;
+	
+	//! List containing only the numeric attributes of the theme tables
+	TeAttributeList	sqlNumAttList_;		
+
+	//! Pointer to the layer that gives origin to this theme
+	TeLayer*	layer_;
+
+	//! Layer id
+	int			layerId_;	
+	
+	// collection table name
+	string		collectionTable_;
+	string		collectionAuxTable_;
+
+    bool useCollection_;
+
+	// ----------------- theme tables information -----------------
+
+	//! clause FROM: join with the theme tables and collection table
+	string	sqlFrom_;		
+	
+	//! clause SELECT and FROM: join with the theme tables and collection table
+	string	sqlJoin_;
+	
+	//! string containing the WHERE clause
+	string sqlWhere_;
+
+	//! clause FROM: join with the theme tables and auxiliar collection table
+	string	sqlGridFrom_;
+	
+	//! clause SELECT and FROM: join with the theme tables and auxiliar collection table
+	string	sqlGridJoin_;
+
+	//! vector of alias to the attribute tables that are used more than once  
+	vector<string>	aliasVector_;
+
+	//! Load the theme metadata from database. In this case, this metadata is loaded by TeDatabase
+	virtual bool loadMetadata(TeDatabase* ) { return true; } 
+
+	//! Erase the theme metadata in database. In this case, this metadata is erased by TeDatabase
+	virtual bool eraseMetadata(TeDatabase* ) { return true; } 
+};
+
+
+//!  This class implements a factory to create theme objects. 
+/*!  
+	 This class is a factory that create view nodes 
+	 of the type TeTHEME, that is, theme objects.
+
+	\sa
+     TeViewNodeFactory TeViewNodeParams TeTheme  
+*/
+class TL_DLL TeThemeFactory : public TeViewNodeFactory
+{
+public:
+	//! Constructor 
+	TeThemeFactory() : TeViewNodeFactory((int)TeTHEME)
+	{}
+
+	//! Created theme objects 
+	TeViewNode* build(TeViewNodeParams* params)
+	{	
+		TeViewNodeParams auxParams = *params;
+		return new TeTheme(auxParams);	
+	}
+
+	TeViewNode* build()
+	{
+		return new TeTheme();
+	}
+};
+
+
+/*! \example createTheme.cpp
+	Shows how to create themes in TerraLib.
+ */
+
+/*! \example themeGrouping.cpp
+	Shows how to do a grouping on the objects of a TerraLib theme.
+ */
+
+/*! \example rasterSlicing.cpp
+	Shows how to  create a legend over a raster data, stored in a layer TerraLib.
+ */
+
+
+#endif
+
diff --git a/src/terralib/kernel/TeThread.cpp b/src/terralib/kernel/TeThread.cpp
old mode 100755
new mode 100644
index 5f84827..7948452
--- a/src/terralib/kernel/TeThread.cpp
+++ b/src/terralib/kernel/TeThread.cpp
@@ -1,285 +1,277 @@
-#include "TeThread.h"
-#include "TeAgnostic.h"
-
-TeThread::TeThread()
-{
-	init();
-}
-
-TeThread::~TeThread()
-{
-	TEAGN_TRUE_OR_THROW( ( threadStatus_ == TeThreadStopped ),
-		"Trying to delete a running thread handler instance" )
-  freeResources();
-}
-
-bool TeThread::start()
-{
-  if( threadStatus_ != TeThreadStopped )
-	{
-    return false;
-  }
-	else
-	{
-    freeResources();
-    
-    threadStatus_ = TeThreadRunning;
-    
-#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-
-		threadId_ = 0;
-    threadHandler_ = 0;
-    
-		threadHandler_ = CreateThread(NULL, 0, 
-      (LPTHREAD_START_ROUTINE)TeThread::startThread,
-      (LPVOID)(this), 0, (LPDWORD) &threadId_);
-
-    if( threadHandler_ == 0 )
-    {
-      TEAGN_LOGERR( "Thread creation failed" );
-      threadStatus_ = TeThreadStopped;
-      return false;
-    }
-    
-#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-
-		if( pthread_attr_init(&threadAttr_) != 0 )
-		{
-      TEAGN_LOGERR( "Unable to init thread attributes" );
-      threadStatus_ = TeThreadStopped;
-      return false;
-    }      
-      
-		if( pthread_attr_setdetachstate( &threadAttr_, 
-      PTHREAD_CREATE_JOINABLE ) != 0 )
-    {
-      TEAGN_LOGERR( "Unable to set thread detach attribute" );
-      threadStatus_ = TeThreadStopped;
-      return false;
-    }       
-
-    if( pthread_create( &threadId_, &threadAttr_, 
-      TeThread::startThread, (void *) this ) != 0 )
-    {
-      TEAGN_LOGERR( "Thread creation failed" );
-      threadStatus_ = TeThreadStopped;
-      return false;
-    }       
-      
-#else
-#error "ERROR: Unsupported platform"
-#endif
-
-    if( threadCurrPriority_ != TeThreadNormalPriority )
-		{
-      TEAGN_TRUE_OR_LOG( setPriority(threadCurrPriority_ ), 
-        "Unable to set thread priority" );
-    }
-
-    return true;
-  }
-}
-
-
-const TeThreadStatus& TeThread::getStatus() const
-{
-  return threadStatus_;
-}
-
-const TeThreadPriority& TeThread::getPriority() const
-{
-  return threadCurrPriority_;
-}
-
-
-bool TeThread::setPriority( const TeThreadPriority& newPriority )
-{
-  if( threadStatus_ == TeThreadRunning ) {
-    #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-      int new_prio_value = THREAD_PRIORITY_NORMAL;
-      
-      switch( newPriority ) {
-        case TeThreadIdlePriority :
-        {
-          new_prio_value = THREAD_PRIORITY_IDLE;
-          break;
-        }
-        case TeThreadBelowNormalPriority :
-        {
-          new_prio_value = THREAD_PRIORITY_BELOW_NORMAL;
-          break;
-        }
-        case TeThreadNormalPriority :
-        {
-          new_prio_value = THREAD_PRIORITY_NORMAL;
-          break;
-        }
-        case TeThreadAboveNormalPriority :
-        {
-          new_prio_value = THREAD_PRIORITY_ABOVE_NORMAL;
-          break;
-        }
-        case TeThreadTimeCriticalPriority :
-        {
-          new_prio_value = THREAD_PRIORITY_TIME_CRITICAL;
-          break;
-        }
-        default :
-        {
-          TEAGN_LOG_AND_THROW( "Invalid thread priority" )
-          break;
-        }                                      
-      }
-      
-      if( SetThreadPriority( threadHandler_, new_prio_value ) ) {
-        threadCurrPriority_ = newPriority;
-        return true;
-      } else {
-        return false;
-      }      
-    #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-      int curr_policy = 0;
-      struct sched_param curr_sched_param; 
-      
-      TEAGN_TRUE_OR_THROW( ( pthread_getschedparam( threadId_, &curr_policy,
-        &curr_sched_param ) == 0 ),
-        "Unable to get thread scheduler parameters" );
-
-	    int min_prio = sched_get_priority_min( curr_policy );
-      int max_prio = sched_get_priority_max( curr_policy );
-      
-      switch( newPriority ) {
-        case TeThreadIdlePriority :
-        {
-          curr_sched_param.sched_priority = min_prio;
-          break;
-        }
-        case TeThreadBelowNormalPriority :
-        {
-          curr_sched_param.sched_priority = (int)
-            ( ( max_prio - min_prio ) / 4 );
-          break;
-        }
-        case TeThreadNormalPriority :
-        {
-          curr_sched_param.sched_priority = (int)
-            ( 2 * ( max_prio - min_prio ) / 4 );
-          break;
-        }
-        case TeThreadAboveNormalPriority :
-        {
-          curr_sched_param.sched_priority = (int)
-            ( 3 * ( max_prio - min_prio ) / 4 );
-          break;
-        }
-        case TeThreadTimeCriticalPriority :
-        {
-          curr_sched_param.sched_priority = max_prio;
-          break;
-        }
-        default :
-        {
-          TEAGN_LOG_AND_THROW( "Invalid thread priority" )
-          break;
-        }                                      
-      }
-      
-      if( pthread_setschedparam( threadId_, curr_policy,
-        &curr_sched_param ) == 0 ) {
-        
-        threadCurrPriority_ = newPriority;
-        return true;        
-      } else {
-        return false;
-      }  
-    #else
-      #error "ERROR: Unsupported platform"
-    #endif    
-  } else {
-    /* Thread not running */
-    
-    threadCurrPriority_ = newPriority;
-    
-    return true;
-  }
-}
-
-bool TeThread::waitToFinish()
-{
-  if( threadStatus_ != TeThreadStopped ) {
-    #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-      TEAGN_TRUE_OR_RETURN( ( WaitForSingleObjectEx( 
-							threadHandler_, INFINITE, false ) == WAIT_OBJECT_0 ),
-							"Thread joinning failed" )
-    #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-      TEAGN_TRUE_OR_RETURN( ( pthread_join( threadId_, 0 ) == 0 ),
-							"Thread joinning failed" )
-    #else
-      #error "ERROR: Unsupported platform"
-    #endif  
-
-    freeResources();
-  }
-  
-  return true;
-}
-
-void TeThread::init()
-{
-	threadStatus_ = TeThreadStopped;
-
-	threadCurrPriority_ = TeThreadNormalPriority;
-
-#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-	threadHandler_ = 0;
-	threadId_ = 0;
-#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-  threadId_ = 0;
-#else
-#error "ERROR: Unsupported platform"
-#endif 
-} 
-
-void TeThread::freeResources()
-{
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    if( threadHandler_ != 0 ) {
-      WaitForSingleObjectEx( threadHandler_, INFINITE, false );
-            
-      TEAGN_TRUE_OR_THROW( CloseHandle( threadHandler_ ),
-        "Error closing thread handle" );
-        
-      threadHandler_ = 0;
-      threadId_ = 0;
-
-    }
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-    if( threadId_ != 0 ) {
-      pthread_join( threadId_, 0 );
-      
-      threadId_ = 0;
-      
-      TEAGN_TRUE_OR_THROW( ( pthread_attr_destroy( &threadAttr_ ) == 0 ),
-        "Unable to destroy thread attributes" )        
-    } 
-  #else
-    #error "ERROR: Unsupported platform"
-  #endif  
-}
-
-void* TeThread::startThread( void* threadPtr )
-{
-  TEAGN_DEBUG_CONDITION( ( threadPtr != 0 ),
-    "Invalid thread parameter pointer" )
-
-	TeThread* thread = (TeThread*)threadPtr;
-
-	thread->run();
-	thread->threadStatus_ = TeThreadStopped;
-
-	return 0;
-}
-
-
-
-
+#include "TeThread.h"
+#include "TeAgnostic.h"
+
+TeThread::TeThread()
+{
+  threadStatus_ = TeThreadStopped;
+
+  threadCurrPriority_ = TeThreadNormalPriority;
+
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    threadHandler_ = 0;
+    threadId_ = 0;
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    threadId_ = 0;
+  #else
+    #error "ERROR: Unsupported platform"
+  #endif 
+}
+
+TeThread::~TeThread()
+{
+	TEAGN_TRUE_OR_LOG( ( threadStatus_ == TeThreadStopped ),
+		"Trying to delete a running thread handler instance" )
+    
+  TEAGN_TRUE_OR_THROW( waitToFinish(), "Error waiting thread to finish" );
+}
+
+bool TeThread::start()
+{
+  if( threadStatus_ != TeThreadStopped )
+	{
+    return false;
+  }
+	else
+	{
+    TEAGN_TRUE_OR_THROW( waitToFinish(), "Error waiting thread to finish" );
+    
+    threadStatus_ = TeThreadRunning;
+    
+    #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+      threadHandler_ = CreateThread(NULL, 0, 
+        (LPTHREAD_START_ROUTINE)TeThread::startThread,
+        (LPVOID)(this), 0, (LPDWORD) &threadId_);
+  
+      if( threadHandler_ == 0 )
+      {
+        TEAGN_LOGERR( "Thread creation failed" );
+        threadStatus_ = TeThreadStopped;
+        return false;
+      }
+    #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+      if( pthread_attr_init(&threadAttr_) != 0 )
+      {
+        TEAGN_LOGERR( "Unable to init thread attributes" );
+        threadStatus_ = TeThreadStopped;
+        return false;
+      }      
+        
+      if( pthread_attr_setdetachstate( &threadAttr_, 
+        PTHREAD_CREATE_JOINABLE ) != 0 )
+      {
+        TEAGN_LOGERR( "Unable to set thread detach attribute" );
+        
+        TEAGN_TRUE_OR_THROW( ( pthread_attr_destroy( &threadAttr_ ) == 0 ),
+          "Unable to destroy thread attributes" )         
+          
+        threadStatus_ = TeThreadStopped;
+        
+        return false;
+      }       
+  
+      if( pthread_create( &threadId_, &threadAttr_, 
+        TeThread::startThread, (void *) this ) != 0 )
+      {
+        TEAGN_LOGERR( "Thread creation failed" );
+        
+        TEAGN_TRUE_OR_THROW( ( pthread_attr_destroy( &threadAttr_ ) == 0 ),
+          "Unable to destroy thread attributes" )         
+          
+        threadStatus_ = TeThreadStopped;
+        
+        return false;
+      }       
+    #else
+      #error "ERROR: Unsupported platform"
+    #endif
+
+    if( threadCurrPriority_ != TeThreadNormalPriority )
+		{
+      TEAGN_TRUE_OR_LOG( setPriority(threadCurrPriority_ ), 
+        "Unable to set thread priority" );
+    }
+
+    return true;
+  }
+}
+
+
+const TeThreadStatus& TeThread::getStatus() const
+{
+  return threadStatus_;
+}
+
+const TeThreadPriority& TeThread::getPriority() const
+{
+  return threadCurrPriority_;
+}
+
+
+bool TeThread::setPriority( const TeThreadPriority& newPriority )
+{
+  if( threadStatus_ == TeThreadRunning ) {
+    #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+      int new_prio_value = THREAD_PRIORITY_NORMAL;
+      
+      switch( newPriority ) {
+        case TeThreadIdlePriority :
+        {
+          new_prio_value = THREAD_PRIORITY_IDLE;
+          break;
+        }
+        case TeThreadBelowNormalPriority :
+        {
+          new_prio_value = THREAD_PRIORITY_BELOW_NORMAL;
+          break;
+        }
+        case TeThreadNormalPriority :
+        {
+          new_prio_value = THREAD_PRIORITY_NORMAL;
+          break;
+        }
+        case TeThreadAboveNormalPriority :
+        {
+          new_prio_value = THREAD_PRIORITY_ABOVE_NORMAL;
+          break;
+        }
+        case TeThreadTimeCriticalPriority :
+        {
+          new_prio_value = THREAD_PRIORITY_TIME_CRITICAL;
+          break;
+        }
+        default :
+        {
+          TEAGN_LOG_AND_THROW( "Invalid thread priority" )
+          break;
+        }                                      
+      }
+      
+      if( SetThreadPriority( threadHandler_, new_prio_value ) ) {
+        threadCurrPriority_ = newPriority;
+        return true;
+      } else {
+        return false;
+      }      
+    #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+      int curr_policy = 0;
+      struct sched_param curr_sched_param; 
+      
+      TEAGN_TRUE_OR_THROW( ( pthread_getschedparam( threadId_, &curr_policy,
+        &curr_sched_param ) == 0 ),
+        "Unable to get thread scheduler parameters" );
+
+	    int min_prio = sched_get_priority_min( curr_policy );
+      int max_prio = sched_get_priority_max( curr_policy );
+      
+      switch( newPriority ) {
+        case TeThreadIdlePriority :
+        {
+          curr_sched_param.sched_priority = min_prio;
+          break;
+        }
+        case TeThreadBelowNormalPriority :
+        {
+          curr_sched_param.sched_priority = (int)
+            ( ( max_prio - min_prio ) / 4 );
+          break;
+        }
+        case TeThreadNormalPriority :
+        {
+          curr_sched_param.sched_priority = (int)
+            ( 2 * ( max_prio - min_prio ) / 4 );
+          break;
+        }
+        case TeThreadAboveNormalPriority :
+        {
+          curr_sched_param.sched_priority = (int)
+            ( 3 * ( max_prio - min_prio ) / 4 );
+          break;
+        }
+        case TeThreadTimeCriticalPriority :
+        {
+          curr_sched_param.sched_priority = max_prio;
+          break;
+        }
+        default :
+        {
+          TEAGN_LOG_AND_THROW( "Invalid thread priority" )
+          break;
+        }                                      
+      }
+      
+      if( pthread_setschedparam( threadId_, curr_policy,
+        &curr_sched_param ) == 0 ) {
+        
+        threadCurrPriority_ = newPriority;
+        return true;        
+      } else {
+        return false;
+      }  
+    #else
+      #error "ERROR: Unsupported platform"
+    #endif    
+  } else {
+    /* Thread not running */
+    
+    threadCurrPriority_ = newPriority;
+    
+    return true;
+  }
+}
+
+bool TeThread::waitToFinish()
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    if( threadHandler_ != 0 ) 
+    {
+      TEAGN_TRUE_OR_RETURN( ( WaitForSingleObjectEx( 
+        threadHandler_, INFINITE, false ) == WAIT_OBJECT_0 ),
+        "Thread joinning failed" );
+              
+      TEAGN_TRUE_OR_THROW( CloseHandle( threadHandler_ ),
+        "Error closing thread handle" );
+        
+      threadHandler_ = 0;
+      threadId_ = 0;
+    }
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    if( threadId_ != 0 ) 
+    {
+      // The return value should not be checked since it may
+      // represent a join call to a thread that already finished execution
+      pthread_join( threadId_, 0 );
+        
+      threadId_ = 0;
+      
+      pthread_attr_destroy( &threadAttr_ );           
+    }
+  #else
+    #error "ERROR: Unsupported platform"
+  #endif
+  
+  return true;
+}
+
+void* TeThread::startThread( void* threadPtr )
+{
+  TEAGN_DEBUG_CONDITION( ( threadPtr != 0 ),
+    "Invalid thread parameter pointer" )
+
+	TeThread* thread = (TeThread*)threadPtr;
+
+	thread->run();
+	thread->threadStatus_ = TeThreadStopped;
+  
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    pthread_exit(0);
+  #else
+    #error "ERROR: Unsupported platform"
+  #endif  
+
+	return 0;
+}
+
+
+
+
diff --git a/src/terralib/kernel/TeThread.h b/src/terralib/kernel/TeThread.h
old mode 100755
new mode 100644
index d1b64b0..8cc3f50
--- a/src/terralib/kernel/TeThread.h
+++ b/src/terralib/kernel/TeThread.h
@@ -1,157 +1,148 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/** \file TeThread.h
- *  \brief This file contains the base thread class.
- *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
- *  \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
- */
-
-#ifndef __TERRALIB_INTERNAL_TETRHEAD_H
-#define __TERRALIB_INTERNAL_TETRHEAD_H
-  
-#include "TeThreadDatatypes.h"
-#include "TeDefines.h"
-  
-#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-#include <windows.h>
-#define TeDelayThread( seconds ) Sleep( seconds * 1000)
-#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-#include <pthread.h>
-#include <unistd.h>
-#define TeDelayThread( seconds ) sleep( seconds )
-#else
-#error "ERROR: Unsupported platform"
-#endif
-
-
-/** \class TeThead
- *  \brief xxxxx
- *
- *
- *  If you are interested in using TerraLib thread
- *  support in a object-oriented way, you should create
- *  a subclass of TeThread in order to creata a threadable
- *  class. Subclasses must implement the method "run".
- *  Than in the main thread, you can call the start method,
- *  it is non-blocking.<br>
- *  If you have a function and want to make it a thread,
- *  you should look TeThreadFunctor class.
- *  
- *
- *  \sa TeThreadFunctor
- *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
- *  \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
- *  \ingroup Utils
- *
- */  
-class TL_DLL TeThread
-{
-    public :
-      
-      
-      /** \brief Default constructor.
-       */
-      TeThread();             
-      
-      /** \brief Virtual destructor
-       */
-      virtual ~TeThread();
-
-      /** \brief Starts the current thread.
-       *  \return true if OK, false on errors.
-       */      
-      bool start();
-      
-      /** \brief Gets the current thread status.
-	     *  \return The current thread status.
-       */
-      const TeThreadStatus& getStatus() const;
-
-      /** \brief Returns the current thread priority.
-	     *  \return The current thread priority.
-       */
-      const TeThreadPriority& getPriority() const;
-
-      /** \brief Changes the current thread priority.
-       *  \param newPriority The new thread priority.
-       *  \return true if OK, false on errors.
-       */      
-      bool setPriority(const TeThreadPriority& newPriority);
-            
-      /** \brief Block the current thread until the thread
-	     *  handled by this instance terminates.
-       *  \return true if OK, false if wait failed.
-       */
-      bool waitToFinish();
-
-	protected:
-
-		/** \brief Thread execution method: this method will be called when the thread starts.
-		 *         Subclasses must reimplement it.
-     */
-		virtual void run() = 0;
-
-		/** \brief Initialize the internal default state.
-		 */
-		void init();
-
-		/** \brief Free all thread allocated resources.
-		 */      
-   void freeResources();
-
-	private:
-
-    /** \brief The thread start function.
-     *  \param threadPtr The thread class pointer.
-     */
-		static void* startThread(void* threadPtr );        
-
-		/** \brief Copy constructor not allowed.
-		 *  \param rhs External reference.
-		 */
-		TeThread(const TeThread& rhs);      
-    
-		/** \brief Assignment operator not aloowed.
-		 *  \param rhs External reference.
-		 *  \return A const reference.
-		 */
-		const TeThread& operator=(const TeThread& rhs);
-
-	protected:
-
-#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    HANDLE threadHandler_;			//!< Win32 thread handler.
-		LPDWORD threadId_;				//!< Win32 thread ID
-#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-		pthread_t threadId_;			//!< Pthread thread ID.
-		pthread_attr_t threadAttr_;		//!< Pthread thread attributes.
-#else
-#error "ERROR: Unsupported platform"
-#endif
-
-    TeThreadStatus threadStatus_;			//!< The current thread status variable.
-    TeThreadPriority threadCurrPriority_;   //!< The current thread priority.
-};
-  
-#endif	// __TERRALIB_INTERNAL_TETRHEAD_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/** \file TeThread.h
+ *  \brief This file contains the base thread class.
+ *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ *  \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+ */
+
+#ifndef __TERRALIB_INTERNAL_TETRHEAD_H
+#define __TERRALIB_INTERNAL_TETRHEAD_H
+  
+#include "TeThreadDatatypes.h"
+#include "TeDefines.h"
+  
+#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+#include <windows.h>
+#define TeDelayThread( seconds ) Sleep( seconds * 1000)
+#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+#include <pthread.h>
+#include <unistd.h>
+#define TeDelayThread( seconds ) sleep( seconds )
+#else
+#error "ERROR: Unsupported platform"
+#endif
+
+
+/** \class TeThead
+ *  \brief Thread base class.
+ *
+ *
+ *  If you are interested in using TerraLib thread
+ *  support in a object-oriented way, you should create
+ *  a subclass of TeThread in order to creata a threadable
+ *  class. Subclasses must implement the method "run".
+ *  Than in the main thread, you can call the start method,
+ *  it is non-blocking.<br>
+ *  If you have a function and want to make it a thread,
+ *  you should look TeThreadFunctor class.
+ *  
+ *
+ *  \sa TeThreadFunctor
+ *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ *  \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+ *  \ingroup MultProgToolsGroup
+ *
+ */  
+class TL_DLL TeThread
+{
+  public :
+
+    /** \brief Default constructor.
+     */
+    TeThread();             
+    
+    /** \brief Virtual destructor
+     */
+    virtual ~TeThread();
+
+    /** \brief Starts the current thread.
+     *  \return true if OK, false on errors.
+     */      
+    bool start();
+    
+    /** \brief Gets the current thread status.
+     *  \return The current thread status.
+     */
+    const TeThreadStatus& getStatus() const;
+
+    /** \brief Returns the current thread priority.
+     *  \return The current thread priority.
+     */
+    const TeThreadPriority& getPriority() const;
+
+    /** \brief Changes the current thread priority.
+     *  \param newPriority The new thread priority.
+     *  \return true if OK, false on errors.
+     */      
+    bool setPriority(const TeThreadPriority& newPriority);
+          
+    /** \brief Block the current thread until the thread
+     *  handled by this instance terminates.
+     *  \return true if OK, false if wait failed.
+     */
+    bool waitToFinish();
+
+	protected:
+
+		/** \brief Thread execution method: this method will be called when the thread starts.
+		 *         Subclasses must reimplement it.
+     */
+		virtual void run() = 0;
+
+	private:
+
+    /** \brief The thread start function.
+     *  \param threadPtr The thread class pointer.
+     */
+		static void* startThread(void* threadPtr );        
+
+		/** \brief Copy constructor not allowed.
+		 *  \param rhs External reference.
+		 */
+		TeThread(const TeThread& rhs);      
+    
+		/** \brief Assignment operator not aloowed.
+		 *  \param rhs External reference.
+		 *  \return A const reference.
+		 */
+		const TeThread& operator=(const TeThread& rhs);
+
+	protected:
+
+#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    HANDLE threadHandler_;			//!< Win32 thread handler.
+		LPDWORD threadId_;				//!< Win32 thread ID
+#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+		pthread_t threadId_;			//!< Pthread thread ID.
+		pthread_attr_t threadAttr_;		//!< Pthread thread attributes.
+#else
+#error "ERROR: Unsupported platform"
+#endif
+
+    TeThreadStatus threadStatus_;			//!< The current thread status variable.
+    TeThreadPriority threadCurrPriority_;   //!< The current thread priority.
+};
+  
+#endif	// __TERRALIB_INTERNAL_TETRHEAD_H
+
diff --git a/src/terralib/kernel/TeThreadDatatypes.h b/src/terralib/kernel/TeThreadDatatypes.h
old mode 100755
new mode 100644
index 8314ea2..67c5397
--- a/src/terralib/kernel/TeThreadDatatypes.h
+++ b/src/terralib/kernel/TeThreadDatatypes.h
@@ -1,59 +1,67 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/** \file TeThreadDatatypes.h
- *  \brief xxxxxxx.
- *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
- *  \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
- */
-
-#ifndef __TERRALIB_INTERNAL_TETRHEADDATATYPES_H
-#define __TERRALIB_INTERNAL_TETRHEADDATATYPES_H
-
-  
-/**
- *  \enum TeThreadStatus
- *  \brief Possible thread status.
- */
-enum TeThreadStatus
-{
-	TeThreadStopped,	//!< The thread is stopped: it has already finished the job or it doesn't have start it.
-	TeThreadRunning		//!< The thread is running.
-};
-
-
-/**
- *  \enum TeThreadPriority
- *  \brief Possible thread priorities.
- */
-enum TeThreadPriority
-{
-	TeThreadIdlePriority,			/*!< Idle priority. */
-	TeThreadBelowNormalPriority,	/*!< Below normal priority. */
-	TeThreadNormalPriority,			/*!< Normal priority. */
-	TeThreadAboveNormalPriority,	/*!< Above normal priority. */     
-	TeThreadTimeCriticalPriority	/*!< Time critical priority. */
-};
-
-  
-#endif	// __TERRALIB_INTERNAL_TETRHEADDATATYPES_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef __TERRALIB_INTERNAL_TETRHEADDATATYPES_H
+#define __TERRALIB_INTERNAL_TETRHEADDATATYPES_H
+
+#include "TeDefines.h"
+  
+/** \name TeThreadDatatypes.h
+ *  \brief Thread data types.
+ *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ *  \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+ *  \ingroup MultProgToolsGroup
+ *  \{
+ */
+  
+  
+/**
+ *  \enum TeThreadStatus
+ *  \brief Possible thread status.
+ */
+enum TeThreadStatus
+{
+	TeThreadStopped,	//!< The thread is stopped: it has already finished the job or it doesn't have start it.
+	TeThreadRunning		//!< The thread is running.
+};
+
+
+/**
+ *  \enum TeThreadPriority
+ *  \brief Possible thread priorities.
+ */
+enum TeThreadPriority
+{
+	TeThreadIdlePriority,			/*!< Idle priority. */
+	TeThreadBelowNormalPriority,	/*!< Below normal priority. */
+	TeThreadNormalPriority,			/*!< Normal priority. */
+	TeThreadAboveNormalPriority,	/*!< Above normal priority. */     
+	TeThreadTimeCriticalPriority	/*!< Time critical priority. */
+};
+
+/**
+ *  \}
+ */
+  
+#endif	// __TERRALIB_INTERNAL_TETRHEADDATATYPES_H
+
diff --git a/src/terralib/kernel/TeThreadFunctor.cpp b/src/terralib/kernel/TeThreadFunctor.cpp
old mode 100755
new mode 100644
index e6f18dd..d3ac6ef
--- a/src/terralib/kernel/TeThreadFunctor.cpp
+++ b/src/terralib/kernel/TeThreadFunctor.cpp
@@ -1,76 +1,76 @@
-#include "TeThreadFunctor.h"
-#include "TeAgnostic.h"
-
-  
-TeThreadFunctor::TeThreadFunctor()
-	: threadReturnValue_(false), threadStartFuncPtr1_(0), 
-	threadStartFuncPtr2_(0), userParamsPtr_( 0 )
-{
-}
-
-TeThreadFunctor::~TeThreadFunctor()
-{
-}
-
-const bool& TeThreadFunctor::getReturnValue() const
-{
-  return threadReturnValue_;
-}
-
-void TeThreadFunctor::setStartFunctPtr( TeThreadStartFunctT1 startFuncPtr )
-{
-  TEAGN_TRUE_OR_THROW( ( threadStatus_ == TeThreadStopped ),
-    "Cannot change start function pointer of a running thread" )
-
-	TEAGN_TRUE_OR_THROW( ( startFuncPtr != 0 ),
-	  "Invalid thread start function pointer" )
-
-  threadStartFuncPtr1_ = startFuncPtr;
-  threadStartFuncPtr2_ = 0;
-}
-
-void TeThreadFunctor::setStartFunctPtr( TeThreadStartFunctT2 startFuncPtr )
-{
-  TEAGN_TRUE_OR_THROW( ( threadStatus_ == TeThreadStopped ),
-    "Cannot change start function pointer of a running thread" )
-
-  TEAGN_TRUE_OR_THROW( ( startFuncPtr != 0 ),
-             "Invalid thread start function pointer" )
-
-  threadStartFuncPtr1_ = 0;
-  threadStartFuncPtr2_ = startFuncPtr;
-}
-
-void TeThreadFunctor::setParameters(const TeThreadParameters& params)
-{
-	TEAGN_TRUE_OR_THROW( ( threadStatus_ == TeThreadStopped ),
-    "Cannot change thread parameters of a running thread" )
-
-	threadUserParams_ = params;
-}
-
-
-void TeThreadFunctor::setParametersPtr( void* userParamsPtr )
-{
-  TEAGN_TRUE_OR_THROW( ( threadStatus_ == TeThreadStopped ),
-    "Cannot change thread parameters of a running thread" )
-  
-  userParamsPtr_ = userParamsPtr;
-}
-
-
-void TeThreadFunctor::run()
-{
-  threadReturnValue_ = false;
-
-	if( threadStartFuncPtr1_ )
-	{
-	  threadReturnValue_ = threadStartFuncPtr1_(threadUserParams_);
-	  threadUserParams_.clear();
-	}
-	else if( threadStartFuncPtr2_ )
-	{
-	  threadReturnValue_ = threadStartFuncPtr2_(userParamsPtr_);
-	}
-}
-
+#include "TeThreadFunctor.h"
+#include "TeAgnostic.h"
+
+  
+TeThreadFunctor::TeThreadFunctor()
+	: threadReturnValue_(false), threadStartFuncPtr1_(0), 
+	threadStartFuncPtr2_(0), userParamsPtr_( 0 )
+{
+}
+
+TeThreadFunctor::~TeThreadFunctor()
+{
+}
+
+const bool& TeThreadFunctor::getReturnValue() const
+{
+  return threadReturnValue_;
+}
+
+void TeThreadFunctor::setStartFunctPtr( TeThreadStartFunctT1 startFuncPtr )
+{
+  TEAGN_TRUE_OR_THROW( ( threadStatus_ == TeThreadStopped ),
+    "Cannot change start function pointer of a running thread" )
+
+	TEAGN_TRUE_OR_THROW( ( startFuncPtr != 0 ),
+	  "Invalid thread start function pointer" )
+
+  threadStartFuncPtr1_ = startFuncPtr;
+  threadStartFuncPtr2_ = 0;
+}
+
+void TeThreadFunctor::setStartFunctPtr( TeThreadStartFunctT2 startFuncPtr )
+{
+  TEAGN_TRUE_OR_THROW( ( threadStatus_ == TeThreadStopped ),
+    "Cannot change start function pointer of a running thread" )
+
+  TEAGN_TRUE_OR_THROW( ( startFuncPtr != 0 ),
+             "Invalid thread start function pointer" )
+
+  threadStartFuncPtr1_ = 0;
+  threadStartFuncPtr2_ = startFuncPtr;
+}
+
+void TeThreadFunctor::setParameters(const TeThreadParameters& params)
+{
+	TEAGN_TRUE_OR_THROW( ( threadStatus_ == TeThreadStopped ),
+    "Cannot change thread parameters of a running thread" )
+
+	threadUserParams_ = params;
+}
+
+
+void TeThreadFunctor::setParametersPtr( void* userParamsPtr )
+{
+  TEAGN_TRUE_OR_THROW( ( threadStatus_ == TeThreadStopped ),
+    "Cannot change thread parameters of a running thread" )
+  
+  userParamsPtr_ = userParamsPtr;
+}
+
+
+void TeThreadFunctor::run()
+{
+  threadReturnValue_ = false;
+
+	if( threadStartFuncPtr1_ )
+	{
+	  threadReturnValue_ = threadStartFuncPtr1_(threadUserParams_);
+	  threadUserParams_.clear();
+	}
+	else if( threadStartFuncPtr2_ )
+	{
+	  threadReturnValue_ = threadStartFuncPtr2_(userParamsPtr_);
+	}
+}
+
diff --git a/src/terralib/kernel/TeThreadFunctor.h b/src/terralib/kernel/TeThreadFunctor.h
old mode 100755
new mode 100644
index 9c40ce0..17e78b4
--- a/src/terralib/kernel/TeThreadFunctor.h
+++ b/src/terralib/kernel/TeThreadFunctor.h
@@ -1,133 +1,134 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/** \file TeThreadFunctor.h
- *  \brief This file contains a base class for thread in function style manner.
- *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
- *  \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
- */
-
-#ifndef __TERRALIB_INTERNAL_TETRHEADFUNCTOR_H
-#define __TERRALIB_INTERNAL_TETRHEADFUNCTOR_H
-  
-#include "TeThread.h"
-#include "TeThreadParameters.h"
-#include "TeSharedPtr.h"
-
-/** \class TeThreadFunctor
- *  \brief A base class for thread in function style manner.
- *
- *
- *  If you are interested in using TerraLib thread
- *  support in a function style model, you should create
- *  objects of this class by specifying a function to be called by
- *  the thread when it starts.<br>
- *  To start the thread, call start method,
- *  it is non-blocking.<br>
- *  If you want to use the thread support
- *  in a object oriented way, see TeThread class.
- *  
- *
- *  \sa TeThread
- *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
- *  \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
- *  \ingroup Utils
- *
- */  
-class TL_DLL TeThreadFunctor : public TeThread
-{
-	public:
-
-    /** \brief Type definition for a thread start function pointer.
-     *  \param params The thread parameters.
-     *  \return true if OK, false on erros.
-     */
-    typedef bool (*TeThreadStartFunctT1)( const TeThreadParameters& params );
-    
-    /** \brief Type definition for a thread start function pointer.
-     *  \param userParamsPtr A pointer to anything required by the user.
-     *  \return true if OK, false on erros.
-     */
-    typedef bool (*TeThreadStartFunctT2)( void* userParamsPtr );        
-
-    /** \deprecated Use TeThreadStartFunctT1. */
-    typedef TeThreadStartFunctT1 TeThreadStartFunctT;
-    
-    /** @typedef TeSharedPtr< TeThread > pointer
-    * Type definition for an thread instance pointer. 
-    */
-    typedef TeSharedPtr< TeThreadFunctor > pointer;         
-
-    /** \brief Default Constructor.
-     */
-    TeThreadFunctor();             
-
-    /** \brief Default Destructor
-     */
-    ~TeThreadFunctor();
-
-    /** \brief Returns the current thread execution return value.
-     */      
-    const bool& getReturnValue() const;
-
-		/** \brief Change the internal thread start function pointer.
-		 *  \param startFuncPtr The new thread start function pointer.
-		 *  \note The thread mus be stopped for calling this method.
-     */      
-    void setStartFunctPtr( TeThreadStartFunctT1 startFuncPtr );
-    
-    /** \brief Change the internal thread start function pointer.
-     *  \param startFuncPtr The new thread start function pointer.
-     *  \note The thread mus be stopped for calling this method.
-     */      
-    void setStartFunctPtr( TeThreadStartFunctT2 startFuncPtr );    
-
-		/** \brief Sets the parameter that will be passed to the function after
-		 *         the thread startup.
-		 *  \param params The parameters to the thread function.
-		 *  \note The thread must be stopped before calling this method.
-		 */
-    void setParameters(const TeThreadParameters& params);
-    
-    /** \brief Sets a pointer that will be passed to the function after
-     *         the thread startup.
-     *  \param userParamsPtr The user parameters pointer.
-     *  \note The thread must be stopped before calling this method.
-     */
-    void setParametersPtr( void* userParamsPtr );    
-
-	protected:
-
-		// Overloaded method from TeThread.
-		void run();
-
-	protected:
-
-		bool threadReturnValue_;					//!< User function return value.
-    TeThreadParameters threadUserParams_;		//!< The current user parameters instance.
-    TeThreadStartFunctT1 threadStartFuncPtr1_;	//!< A pointer to the current user thread start function.
-    TeThreadStartFunctT2 threadStartFuncPtr2_; //!< A pointer to the current user thread start function.
-    void* userParamsPtr_;//!< A pointer to the current user thread start function parameters pointer.
-};
-  
-#endif	// __TERRALIB_INTERNAL_TETRHEADFUNCTOR_H
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/** \file TeThreadFunctor.h
+ *  \brief This file contains a base class for thread in function style manner.
+ *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ *  \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+ */
+
+#ifndef __TERRALIB_INTERNAL_TETRHEADFUNCTOR_H
+#define __TERRALIB_INTERNAL_TETRHEADFUNCTOR_H
+  
+#include "TeThread.h"
+#include "TeThreadParameters.h"
+#include "TeSharedPtr.h"
+#include "TeDefines.h"
+
+/** \class TeThreadFunctor
+ *  \brief A base class for thread in function style manner.
+ *
+ *
+ *  If you are interested in using TerraLib thread
+ *  support in a function style model, you should create
+ *  objects of this class by specifying a function to be called by
+ *  the thread when it starts.<br>
+ *  To start the thread, call start method,
+ *  it is non-blocking.<br>
+ *  If you want to use the thread support
+ *  in a object oriented way, see TeThread class.
+ *  
+ *
+ *  \sa TeThread
+ *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ *  \author Gilberto Ribeiro de Queiroz <gribeiro at dpi.inpe.br>
+ *  \ingroup MultProgToolsGroup
+ *
+ */  
+class TL_DLL TeThreadFunctor : public TeThread
+{
+	public:
+
+    /** \brief Type definition for a thread start function pointer.
+     *  \param params The thread parameters.
+     *  \return true if OK, false on erros.
+     */
+    typedef bool (*TeThreadStartFunctT1)( const TeThreadParameters& params );
+    
+    /** \brief Type definition for a thread start function pointer.
+     *  \param userParamsPtr A pointer to anything required by the user.
+     *  \return true if OK, false on erros.
+     */
+    typedef bool (*TeThreadStartFunctT2)( void* userParamsPtr );        
+
+    /** \deprecated Use TeThreadStartFunctT1. */
+    typedef TeThreadStartFunctT1 TeThreadStartFunctT;
+    
+    /** @typedef TeSharedPtr< TeThread > pointer
+    * Type definition for an thread instance pointer. 
+    */
+    typedef TeSharedPtr< TeThreadFunctor > pointer;         
+
+    /** \brief Default Constructor.
+     */
+    TeThreadFunctor();             
+
+    /** \brief Default Destructor
+     */
+    ~TeThreadFunctor();
+
+    /** \brief Returns the current thread execution return value.
+     */      
+    const bool& getReturnValue() const;
+
+		/** \brief Change the internal thread start function pointer.
+		 *  \param startFuncPtr The new thread start function pointer.
+		 *  \note The thread mus be stopped for calling this method.
+     */      
+    void setStartFunctPtr( TeThreadStartFunctT1 startFuncPtr );
+    
+    /** \brief Change the internal thread start function pointer.
+     *  \param startFuncPtr The new thread start function pointer.
+     *  \note The thread mus be stopped for calling this method.
+     */      
+    void setStartFunctPtr( TeThreadStartFunctT2 startFuncPtr );    
+
+		/** \brief Sets the parameter that will be passed to the function after
+		 *         the thread startup.
+		 *  \param params The parameters to the thread function.
+		 *  \note The thread must be stopped before calling this method.
+		 */
+    void setParameters(const TeThreadParameters& params);
+    
+    /** \brief Sets a pointer that will be passed to the function after
+     *         the thread startup.
+     *  \param userParamsPtr The user parameters pointer.
+     *  \note The thread must be stopped before calling this method.
+     */
+    void setParametersPtr( void* userParamsPtr );    
+
+	protected:
+
+		// Overloaded method from TeThread.
+		void run();
+
+	protected:
+
+		bool threadReturnValue_;					//!< User function return value.
+    TeThreadParameters threadUserParams_;		//!< The current user parameters instance.
+    TeThreadStartFunctT1 threadStartFuncPtr1_;	//!< A pointer to the current user thread start function.
+    TeThreadStartFunctT2 threadStartFuncPtr2_; //!< A pointer to the current user thread start function.
+    void* userParamsPtr_;//!< A pointer to the current user thread start function parameters pointer.
+};
+  
+#endif	// __TERRALIB_INTERNAL_TETRHEADFUNCTOR_H
+
diff --git a/src/terralib/kernel/TeThreadJob.cpp b/src/terralib/kernel/TeThreadJob.cpp
old mode 100755
new mode 100644
index 53d3607..284ee8d
--- a/src/terralib/kernel/TeThreadJob.cpp
+++ b/src/terralib/kernel/TeThreadJob.cpp
@@ -1,9 +1,9 @@
-#include "TeThreadJob.h"
-
-TeThreadJob::TeThreadJob() 
-{
-};
-
-TeThreadJob::~TeThreadJob() 
-{
-};
+#include "TeThreadJob.h"
+
+TeThreadJob::TeThreadJob() 
+{
+};
+
+TeThreadJob::~TeThreadJob() 
+{
+};
diff --git a/src/terralib/kernel/TeThreadJob.h b/src/terralib/kernel/TeThreadJob.h
old mode 100755
new mode 100644
index 1935a68..2d4c871
--- a/src/terralib/kernel/TeThreadJob.h
+++ b/src/terralib/kernel/TeThreadJob.h
@@ -1,56 +1,58 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifndef __TERRALIB_INTERNAL_TETRHEADJOB_H
-#define __TERRALIB_INTERNAL_TETRHEADJOB_H
-
-#include "TeDefines.h"
-
-/*! Base thread job class 
- * \author Emiliano F. Castejon <castejon at dpi.inpe.br>
- */
-class TL_DLL TeThreadJob
-{
-  public :
-    
-    virtual ~TeThreadJob();
-    
-    /*! Returns a pointer to a cloned job from this instance.
-     * \return A pointer to a cloned job from this instance (the 
-     * caller of this method must take ownership of the returned
-     * pointer).
-     */
-    virtual TeThreadJob* clone() const = 0;
-    
-    /*! The job code to be executed.
-     */
-    virtual void executeJobCode() = 0;        
-  
-  protected :
-    
-    TeThreadJob();
-};    
- 
-  
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef __TERRALIB_INTERNAL_TETRHEADJOB_H
+#define __TERRALIB_INTERNAL_TETRHEADJOB_H
+
+#include "TeDefines.h"
+
+/*! 
+ * \class TeThreadJob Base thread job class 
+ * \author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ * \ingroup MultProgToolsGroup
+ */
+class TL_DLL TeThreadJob
+{
+  public :
+    
+    virtual ~TeThreadJob();
+    
+    /*! Returns a pointer to a cloned job from this instance.
+     * \return A pointer to a cloned job from this instance (the 
+     * caller of this method must take ownership of the returned
+     * pointer).
+     */
+    virtual TeThreadJob* clone() const = 0;
+    
+    /*! The job code to be executed.
+     */
+    virtual void executeJobCode() = 0;        
+  
+  protected :
+    
+    TeThreadJob();
+};    
+ 
+  
+#endif
+
diff --git a/src/terralib/kernel/TeThreadJobsManager.cpp b/src/terralib/kernel/TeThreadJobsManager.cpp
old mode 100755
new mode 100644
index 189d147..f987b9b
--- a/src/terralib/kernel/TeThreadJobsManager.cpp
+++ b/src/terralib/kernel/TeThreadJobsManager.cpp
@@ -1,343 +1,343 @@
-#include "TeThreadJobsManager.h"
-#include "TeUtils.h"
-#include "TeThreadFunctor.h"
-
-#include <algorithm>
-
-TeThreadJobsManager::TeThreadJobsManager()
-{
-  managerData_.maxSimulJobs_ = TeGetPhysProcNumber();
-}
-
-TeThreadJobsManager::~TeThreadJobsManager()
-{
-  clearAwaitingJobs();
-  
-  managerData_.mutex_.lock();
-  
-  TEAGN_TRUE_OR_THROW( managerData_.runningJobsList_.size() == 0,
-    "Trying to delete an TeThreadJobsManager with active jobs running" );
-  
-  managerData_.mutex_.unLock();  
-}
-
-TeThreadJob const* const TeThreadJobsManager::executeJob( 
-  const TeThreadJob& job )
-{
-  managerData_.mutex_.lock();
-  
-  TeThreadJob* newJobPtr = 0;
-  
-  if( managerData_.maxSimulJobs_ == 0 )
-  {
-    newJobPtr = job.clone();
-    newJobPtr->executeJobCode();
-    delete newJobPtr;
-  }
-  else
-  {
-    // Inserting job into awaiting jobs list
-    
-    newJobPtr = job.clone();
-    managerData_.awaitingJobsList_.push_back( newJobPtr );
-    
-    // Starting a thread to do the job
-    
-    if( managerData_.threadsList_.size() == 0 )
-    {
-      TeThreadFunctor* newThreadPtr = new TeThreadFunctor();
-      newThreadPtr->setParametersPtr( (void*)(&managerData_) );
-      newThreadPtr->setStartFunctPtr( threadFunction );
-      
-      managerData_.threadsList_.push_back( newThreadPtr );
-      
-      TEAGN_TRUE_OR_THROW(newThreadPtr->start(), "Thread start error" );
-    }
-    else if( managerData_.threadsList_.size() < 
-      managerData_.maxSimulJobs_ )
-    {
-      // locating a stopped thread
-      
-      std::list< TeThreadFunctor* >::iterator it = 
-        managerData_.threadsList_.begin();
-      std::list< TeThreadFunctor* >::iterator it_end = 
-        managerData_.threadsList_.end();
-      
-      bool noStoppedThreadWasFound = true;
-      
-      while( it != it_end )
-      {
-        if( (*it)->getStatus() == TeThreadStopped )
-        {
-          noStoppedThreadWasFound = false;
-          TEAGN_TRUE_OR_THROW( (*it)->start(), "Thread start error" );
-          break;
-        }
-        
-        ++it;
-      }
-      
-      // no stopped threads found
-      
-      if( noStoppedThreadWasFound )
-      {
-        TeThreadFunctor* newThreadPtr = new TeThreadFunctor();
-        newThreadPtr->setParametersPtr( (void*)(&managerData_) );
-        newThreadPtr->setStartFunctPtr( threadFunction );
-        
-        managerData_.threadsList_.push_back( newThreadPtr );
-        
-        TEAGN_TRUE_OR_THROW(newThreadPtr->start(), "Thread start error" );      
-      }
-    }
-    else
-    {
-      // counting the number of working threads
-      
-      std::list< TeThreadFunctor* >::iterator it = 
-        managerData_.threadsList_.begin();
-      std::list< TeThreadFunctor* >::iterator it_end = 
-        managerData_.threadsList_.end();
-      
-      unsigned long int runningThreads = 0;
-      
-      while( it != it_end )
-      {
-        if( (*it)->getStatus() == TeThreadRunning )
-        {
-          ++runningThreads;
-        }
-        
-        ++it;
-      }
-      
-      // try to activate a new thread       
-      
-      if( runningThreads < managerData_.maxSimulJobs_ )
-      {
-        it = managerData_.threadsList_.begin();
-        
-        while( it != it_end )
-        {
-          if( (*it)->getStatus() == TeThreadStopped )
-          {
-            TEAGN_TRUE_OR_THROW( (*it)->start(), "Thread start error" );
-            break;
-          }
-          
-          ++it;
-        }      
-      }
-    }
-  }
-  
-  // Delete other stopped threads following maxSimulJobs_
-  
-  if( managerData_.threadsList_.size() > 
-    managerData_.maxSimulJobs_ )
-  {
-    std::list< TeThreadFunctor* >::iterator it = 
-      managerData_.threadsList_.begin();
-    std::list< TeThreadFunctor* >::iterator it_end = 
-      managerData_.threadsList_.end();    
-    
-    while( it != it_end )
-    {
-      if( (*it)->getStatus() == TeThreadStopped )
-      {
-        std::list< TeThreadFunctor* >::iterator it_aux = it;
-        --it_aux;
-        
-        delete (*it);
-        
-        managerData_.threadsList_.erase( it );
-        
-        it = it_aux;
-      }
-      
-      if( managerData_.threadsList_.size() == 
-        managerData_.maxSimulJobs_)
-      {
-        break;
-      }
-      
-      ++it;
-    }    
-  }  
-  
-  managerData_.mutex_.unLock();
-  
-  return newJobPtr;
-}
-
-void TeThreadJobsManager::setMaxSimulJobs( unsigned long int maxSimulJobs )
-{
-  managerData_.maxSimulJobs_ = maxSimulJobs;
-}
-
-void TeThreadJobsManager::setAutoMaxSimulJobs()
-{
-  managerData_.maxSimulJobs_ = TeGetPhysProcNumber();
-}
-
-unsigned long int TeThreadJobsManager::getMaxSimulJobs() const
-{
-  return managerData_.maxSimulJobs_;
-}
-
-TeThreadSignal& TeThreadJobsManager::getJobFinishedSignal()
-{
-  return managerData_.jobFinishedSig_;
-}
-
-TeThreadJobsManager::JobStatus TeThreadJobsManager::getJobStatus( 
-  TeThreadJob const* const jobId )
-{
-  managerData_.mutex_.lock();
-  
-  // trying to locate inside awaiting jobs list
-  
-  JobsListT::iterator it = managerData_.awaitingJobsList_.begin(); 
-  JobsListT::iterator it_end = managerData_.awaitingJobsList_.end();
-  
-  while( it != it_end )
-  {
-    if( *it == jobId )
-    {
-      managerData_.mutex_.unLock();
-      return JobAwaiting;
-    }
-    
-    ++it;
-  }
-  
-  // trying to locate inside running jobs list
-  
-  it = managerData_.runningJobsList_.begin(); 
-  it_end = managerData_.runningJobsList_.end();
-  
-  while( it != it_end )
-  {
-    if( *it == jobId )
-    {
-      managerData_.mutex_.unLock();
-      return JobRunning;
-    }
-    ++it;
-  }
-  
-  // job not found
-
-  managerData_.mutex_.unLock();
-  return JobNotRunning;
-}
-
-unsigned long int TeThreadJobsManager::getRunningJobsNumber()
-{
-  managerData_.mutex_.lock();
-  
-  unsigned long int number = managerData_.runningJobsList_.size();
-  
-  managerData_.mutex_.unLock();
-  
-  return number;
-}
-
-unsigned long int TeThreadJobsManager::getAwaitingJobsNumber()
-{
-  managerData_.mutex_.lock();
-  
-  unsigned long int number = managerData_.awaitingJobsList_.size();
-  
-  managerData_.mutex_.unLock();
-  
-  return number;
-}
-
-void TeThreadJobsManager::waitAllToFinish()
-{
-  std::list< TeThreadFunctor* >::iterator it = 
-    managerData_.threadsList_.begin();
-  std::list< TeThreadFunctor* >::iterator it_end = 
-    managerData_.threadsList_.end();
-  
-  while( it != it_end )
-  {
-    (*it)->waitToFinish();
-    
-    ++it;
-  }  
-}
-
-void TeThreadJobsManager::clearAwaitingJobs()
-{
-  managerData_.mutex_.lock();
-  
-  JobsListT::iterator it = managerData_.awaitingJobsList_.begin(); 
-  JobsListT::iterator it_end = managerData_.awaitingJobsList_.end();
-  
-  while( it != it_end )
-  {
-    delete (*it);
-    
-    ++it;
-  } 
-  
-  managerData_.mutex_.unLock();
-}
-
-bool TeThreadJobsManager::threadFunction( void* parsPtr )
-{
-  InternalManagerDataStruct* managerData = (InternalManagerDataStruct*)
-    parsPtr;
-  
-  managerData->mutex_.lock();
-  
-  if( managerData->awaitingJobsList_.size() == 0 )
-  {
-    managerData->mutex_.unLock();
-    
-    return true;
-  }
-  else
-  {
-    do
-    {
-      // Pick up a job
-      
-      TeThreadJob* jobPtr = managerData->awaitingJobsList_.front();
-      managerData->awaitingJobsList_.pop_front();
-      
-      // move it to running jobs list
-      
-      managerData->runningJobsList_.push_back( jobPtr );
-      
-      managerData->mutex_.unLock();
-      
-      // Execute job
-      
-      jobPtr->executeJobCode();
-      
-      // delete job object and remove job from running jobs list
-      
-      managerData->mutex_.lock();
-      
-      managerData->runningJobsList_.erase( std::find(
-        managerData->runningJobsList_.begin(),
-        managerData->runningJobsList_.end(),
-        jobPtr ) );
-      
-      delete jobPtr;
-      
-      // Emitting a job complete signal
-      
-      managerData->jobFinishedSig_.emit();
-      
-    } while( managerData->awaitingJobsList_.size() > 0 );
-      
-    managerData->mutex_.unLock();
-    
-    return true;
-  }
-}
-
+#include "TeThreadJobsManager.h"
+#include "TeUtils.h"
+#include "TeThreadFunctor.h"
+
+#include <algorithm>
+
+TeThreadJobsManager::TeThreadJobsManager()
+{
+  managerData_.maxSimulJobs_ = TeGetPhysProcNumber();
+}
+
+TeThreadJobsManager::~TeThreadJobsManager()
+{
+  clearAwaitingJobs();
+  
+  managerData_.mutex_.lock();
+  
+  TEAGN_TRUE_OR_THROW( managerData_.runningJobsList_.size() == 0,
+    "Trying to delete an TeThreadJobsManager with active jobs running" );
+  
+  managerData_.mutex_.unLock();  
+}
+
+TeThreadJob const* TeThreadJobsManager::executeJob( 
+  const TeThreadJob& job )
+{
+  managerData_.mutex_.lock();
+  
+  TeThreadJob* newJobPtr = 0;
+  
+  if( managerData_.maxSimulJobs_ == 0 )
+  {
+    newJobPtr = job.clone();
+    newJobPtr->executeJobCode();
+    delete newJobPtr;
+  }
+  else
+  {
+    // Inserting job into awaiting jobs list
+    
+    newJobPtr = job.clone();
+    managerData_.awaitingJobsList_.push_back( newJobPtr );
+    
+    // Starting a thread to do the job
+    
+    if( managerData_.threadsList_.size() == 0 )
+    {
+      TeThreadFunctor* newThreadPtr = new TeThreadFunctor();
+      newThreadPtr->setParametersPtr( (void*)(&managerData_) );
+      newThreadPtr->setStartFunctPtr( threadFunction );
+      
+      managerData_.threadsList_.push_back( newThreadPtr );
+      
+      TEAGN_TRUE_OR_THROW(newThreadPtr->start(), "Thread start error" );
+    }
+    else if( managerData_.threadsList_.size() < 
+      managerData_.maxSimulJobs_ )
+    {
+      // locating a stopped thread
+      
+      std::list< TeThreadFunctor* >::iterator it = 
+        managerData_.threadsList_.begin();
+      std::list< TeThreadFunctor* >::iterator it_end = 
+        managerData_.threadsList_.end();
+      
+      bool noStoppedThreadWasFound = true;
+      
+      while( it != it_end )
+      {
+        if( (*it)->getStatus() == TeThreadStopped )
+        {
+          noStoppedThreadWasFound = false;
+          TEAGN_TRUE_OR_THROW( (*it)->start(), "Thread start error" );
+          break;
+        }
+        
+        ++it;
+      }
+      
+      // no stopped threads found
+      
+      if( noStoppedThreadWasFound )
+      {
+        TeThreadFunctor* newThreadPtr = new TeThreadFunctor();
+        newThreadPtr->setParametersPtr( (void*)(&managerData_) );
+        newThreadPtr->setStartFunctPtr( threadFunction );
+        
+        managerData_.threadsList_.push_back( newThreadPtr );
+        
+        TEAGN_TRUE_OR_THROW(newThreadPtr->start(), "Thread start error" );      
+      }
+    }
+    else
+    {
+      // counting the number of working threads
+      
+      std::list< TeThreadFunctor* >::iterator it = 
+        managerData_.threadsList_.begin();
+      std::list< TeThreadFunctor* >::iterator it_end = 
+        managerData_.threadsList_.end();
+      
+      unsigned long int runningThreads = 0;
+      
+      while( it != it_end )
+      {
+        if( (*it)->getStatus() == TeThreadRunning )
+        {
+          ++runningThreads;
+        }
+        
+        ++it;
+      }
+      
+      // try to activate a new thread       
+      
+      if( runningThreads < managerData_.maxSimulJobs_ )
+      {
+        it = managerData_.threadsList_.begin();
+        
+        while( it != it_end )
+        {
+          if( (*it)->getStatus() == TeThreadStopped )
+          {
+            TEAGN_TRUE_OR_THROW( (*it)->start(), "Thread start error" );
+            break;
+          }
+          
+          ++it;
+        }      
+      }
+    }
+  }
+  
+  // Delete other stopped threads following maxSimulJobs_
+  
+  if( managerData_.threadsList_.size() > 
+    managerData_.maxSimulJobs_ )
+  {
+    std::list< TeThreadFunctor* >::iterator it = 
+      managerData_.threadsList_.begin();
+    std::list< TeThreadFunctor* >::iterator it_end = 
+      managerData_.threadsList_.end();    
+    
+    while( it != it_end )
+    {
+      if( (*it)->getStatus() == TeThreadStopped )
+      {
+        std::list< TeThreadFunctor* >::iterator it_aux = it;
+        --it_aux;
+        
+        delete (*it);
+        
+        managerData_.threadsList_.erase( it );
+        
+        it = it_aux;
+      }
+      
+      if( managerData_.threadsList_.size() == 
+        managerData_.maxSimulJobs_)
+      {
+        break;
+      }
+      
+      ++it;
+    }    
+  }  
+  
+  managerData_.mutex_.unLock();
+  
+  return newJobPtr;
+}
+
+void TeThreadJobsManager::setMaxSimulJobs( unsigned long int maxSimulJobs )
+{
+  managerData_.maxSimulJobs_ = maxSimulJobs;
+}
+
+void TeThreadJobsManager::setAutoMaxSimulJobs()
+{
+  managerData_.maxSimulJobs_ = TeGetPhysProcNumber();
+}
+
+unsigned long int TeThreadJobsManager::getMaxSimulJobs() const
+{
+  return managerData_.maxSimulJobs_;
+}
+
+TeThreadSignal& TeThreadJobsManager::getJobFinishedSignal()
+{
+  return managerData_.jobFinishedSig_;
+}
+
+TeThreadJobsManager::JobStatus TeThreadJobsManager::getJobStatus( 
+  TeThreadJob const* const jobId )
+{
+  managerData_.mutex_.lock();
+  
+  // trying to locate inside awaiting jobs list
+  
+  JobsListT::iterator it = managerData_.awaitingJobsList_.begin(); 
+  JobsListT::iterator it_end = managerData_.awaitingJobsList_.end();
+  
+  while( it != it_end )
+  {
+    if( *it == jobId )
+    {
+      managerData_.mutex_.unLock();
+      return JobAwaiting;
+    }
+    
+    ++it;
+  }
+  
+  // trying to locate inside running jobs list
+  
+  it = managerData_.runningJobsList_.begin(); 
+  it_end = managerData_.runningJobsList_.end();
+  
+  while( it != it_end )
+  {
+    if( *it == jobId )
+    {
+      managerData_.mutex_.unLock();
+      return JobRunning;
+    }
+    ++it;
+  }
+  
+  // job not found
+
+  managerData_.mutex_.unLock();
+  return JobNotRunning;
+}
+
+unsigned long int TeThreadJobsManager::getRunningJobsNumber()
+{
+  managerData_.mutex_.lock();
+  
+  unsigned long int number = managerData_.runningJobsList_.size();
+  
+  managerData_.mutex_.unLock();
+  
+  return number;
+}
+
+unsigned long int TeThreadJobsManager::getAwaitingJobsNumber()
+{
+  managerData_.mutex_.lock();
+  
+  unsigned long int number = managerData_.awaitingJobsList_.size();
+  
+  managerData_.mutex_.unLock();
+  
+  return number;
+}
+
+void TeThreadJobsManager::waitAllToFinish()
+{
+  std::list< TeThreadFunctor* >::iterator it = 
+    managerData_.threadsList_.begin();
+  std::list< TeThreadFunctor* >::iterator it_end = 
+    managerData_.threadsList_.end();
+  
+  while( it != it_end )
+  {
+    (*it)->waitToFinish();
+    
+    ++it;
+  }  
+}
+
+void TeThreadJobsManager::clearAwaitingJobs()
+{
+  managerData_.mutex_.lock();
+  
+  JobsListT::iterator it = managerData_.awaitingJobsList_.begin(); 
+  JobsListT::iterator it_end = managerData_.awaitingJobsList_.end();
+  
+  while( it != it_end )
+  {
+    delete (*it);
+    
+    ++it;
+  } 
+  
+  managerData_.mutex_.unLock();
+}
+
+bool TeThreadJobsManager::threadFunction( void* parsPtr )
+{
+  InternalManagerDataStruct* managerData = (InternalManagerDataStruct*)
+    parsPtr;
+  
+  managerData->mutex_.lock();
+  
+  if( managerData->awaitingJobsList_.size() == 0 )
+  {
+    managerData->mutex_.unLock();
+    
+    return true;
+  }
+  else
+  {
+    do
+    {
+      // Pick up a job
+      
+      TeThreadJob* jobPtr = managerData->awaitingJobsList_.front();
+      managerData->awaitingJobsList_.pop_front();
+      
+      // move it to running jobs list
+      
+      managerData->runningJobsList_.push_back( jobPtr );
+      
+      managerData->mutex_.unLock();
+      
+      // Execute job
+      
+      jobPtr->executeJobCode();
+      
+      // delete job object and remove job from running jobs list
+      
+      managerData->mutex_.lock();
+      
+      managerData->runningJobsList_.erase( std::find(
+        managerData->runningJobsList_.begin(),
+        managerData->runningJobsList_.end(),
+        jobPtr ) );
+      
+      delete jobPtr;
+      
+      // Emitting a job complete signal
+      
+      managerData->jobFinishedSig_.emitSignal();
+      
+    } while( managerData->awaitingJobsList_.size() > 0 );
+      
+    managerData->mutex_.unLock();
+    
+    return true;
+  }
+}
+
diff --git a/src/terralib/kernel/TeThreadJobsManager.h b/src/terralib/kernel/TeThreadJobsManager.h
old mode 100755
new mode 100644
index d400079..9561713
--- a/src/terralib/kernel/TeThreadJobsManager.h
+++ b/src/terralib/kernel/TeThreadJobsManager.h
@@ -1,144 +1,146 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-
-#ifndef __TERRALIB_INTERNAL_TETRHEADJOBSMANAGER_H
-#define __TERRALIB_INTERNAL_TETRHEADJOBSMANAGER_H
-
-#include "TeThreadJob.h"
-#include "TeThreadSignal.h"
-#include "TeMutex.h"
-
-#include <list>
-
-class TeThreadFunctor;
-
-/** \brief A class to control the execution of concurrent jobs using
- *  spawned threads.
- *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
- */  
-class TL_DLL TeThreadJobsManager
-{
-  public :
-    /*! Job status */
-    enum JobStatus { JobRunning, JobAwaiting, JobNotRunning };
-        
-    TeThreadJobsManager();             
-
-    ~TeThreadJobsManager();
-    
-    /*! \brief Add a job to the waiting jobs list to be executed 
-     * when a thread becomes available or execute the job if the
-     * maximum number of simultâneous jobs is set to zero.
-     * \param job Job to be processed.
-     * \return A unique job ID as an intenal address for the added 
-     * job.
-     */    
-    TeThreadJob const* const executeJob( const TeThreadJob& job );
-    
-    /*! Set the number of threaded jobs that can be executed simultaneously.
-     * \param maxSimulJobs The number of jobs that can be executed simultaneously
-     * (if set to zero, no thread will be spawned and the job execution
-     * will block the current process until it finishes).
-     */
-    void setMaxSimulJobs( unsigned long int maxSimulJobs );
-    
-    /*! Set the number of jobs that can be executed simultaneously using
-     * the number of physical processing units (this is the class default).
-     */
-    void setAutoMaxSimulJobs();    
-    
-    /*! Get the number of jobs that can be executed simultaneously.
-     * \return The number of jobs that can be executed simultaneously.
-     */
-    unsigned long int getMaxSimulJobs() const;    
-    
-    /*! \brief A reference to a signal that will be emitted on
-     * each job completion.
-     * \return A reference to a signal that will be emitted on
-     * each job completion.
-     */     
-    TeThreadSignal& getJobFinishedSignal();
-    
-    /*! \brief Return a job status.
-     * \param jobId Job ID.
-     * \return The job status.
-     */
-    JobStatus getJobStatus( TeThreadJob const* const jobId );
-    
-    /*! \brief Return number of running jobs.
-     * \return The number of running jobs.
-     */    
-    unsigned long int getRunningJobsNumber();
-
-    /*! \brief Return number of awaiting jobs.
-     * \return The number of awaiting jobs.
-     */    
-    unsigned long int getAwaitingJobsNumber();
-    
-    /*! \brief Wait all jobs to finish.
-     */      
-    void waitAllToFinish();
-
-    /*! \brief Clear all waiting jobs (not executed yet).
-     */      
-    void clearAwaitingJobs();
-      
-  protected :
-    
-    /*! Jobs list type definition */
-    typedef std::list< TeThreadJob* > JobsListT;
-    
-    struct InternalManagerDataStruct
-    {
-      /*! Maximum number of simultaneous running jobs */
-      unsigned long int maxSimulJobs_;
-      
-      /*! A signal emitted on each job completion. */
-      TeThreadSignal jobFinishedSig_;
-      
-      /*! The awaiting jobs list. */
-      JobsListT awaitingJobsList_;
-      
-      /*! The running jobs list. */
-      JobsListT runningJobsList_;
-      
-      /*! The thread instances list. */
-      std::list< TeThreadFunctor* > threadsList_;
-      
-      /*! A mutex instance to control access to internal resources. */
-      TeMutex mutex_;
-    };
-    
-    InternalManagerDataStruct managerData_;
-
-    /*! \brief Entry point for all threads.
-     * \param parsPtr Parameters pointer.
-     * \return true if OK.
-     */
-    static bool threadFunction( void* parsPtr );
-
-};
-  
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+
+#ifndef __TERRALIB_INTERNAL_TETRHEADJOBSMANAGER_H
+#define __TERRALIB_INTERNAL_TETRHEADJOBSMANAGER_H
+
+#include "TeThreadJob.h"
+#include "TeThreadSignal.h"
+#include "TeMutex.h"
+#include "TeDefines.h"
+
+#include <list>
+
+class TeThreadFunctor;
+
+/** \brief A class to control the execution of concurrent jobs using
+ *  spawned threads.
+ *  \author Emiliano F. Castejon <castejon at dpi.inpe.br>
+ *  \ingroup MultProgToolsGroup
+ */  
+class TL_DLL TeThreadJobsManager
+{
+  public :
+    /*! Job status */
+    enum JobStatus { JobRunning, JobAwaiting, JobNotRunning };
+        
+    TeThreadJobsManager();             
+
+    ~TeThreadJobsManager();
+    
+    /*! \brief Add a job to the waiting jobs list to be executed 
+     * when a thread becomes available or execute the job if the
+     * maximum number of simultâneous jobs is set to zero.
+     * \param job Job to be processed.
+     * \return A unique job ID as an intenal address for the added 
+     * job.
+     */    
+    TeThreadJob const* executeJob( const TeThreadJob& job );
+    
+    /*! Set the number of threaded jobs that can be executed simultaneously.
+     * \param maxSimulJobs The number of jobs that can be executed simultaneously
+     * (if set to zero, no thread will be spawned and the job execution
+     * will block the current process until it finishes).
+     */
+    void setMaxSimulJobs( unsigned long int maxSimulJobs );
+    
+    /*! Set the number of jobs that can be executed simultaneously using
+     * the number of physical processing units (this is the class default).
+     */
+    void setAutoMaxSimulJobs();    
+    
+    /*! Get the number of jobs that can be executed simultaneously.
+     * \return The number of jobs that can be executed simultaneously.
+     */
+    unsigned long int getMaxSimulJobs() const;    
+    
+    /*! \brief A reference to a signal that will be emitted on
+     * each job completion.
+     * \return A reference to a signal that will be emitted on
+     * each job completion.
+     */     
+    TeThreadSignal& getJobFinishedSignal();
+    
+    /*! \brief Return a job status.
+     * \param jobId Job ID.
+     * \return The job status.
+     */
+    JobStatus getJobStatus( TeThreadJob const* const jobId );
+    
+    /*! \brief Return number of running jobs.
+     * \return The number of running jobs.
+     */    
+    unsigned long int getRunningJobsNumber();
+
+    /*! \brief Return number of awaiting jobs.
+     * \return The number of awaiting jobs.
+     */    
+    unsigned long int getAwaitingJobsNumber();
+    
+    /*! \brief Wait all jobs to finish.
+     */      
+    void waitAllToFinish();
+
+    /*! \brief Clear all waiting jobs (not executed yet).
+     */      
+    void clearAwaitingJobs();
+      
+  protected :
+    
+    /*! Jobs list type definition */
+    typedef std::list< TeThreadJob* > JobsListT;
+    
+    struct InternalManagerDataStruct
+    {
+      /*! Maximum number of simultaneous running jobs */
+      unsigned long int maxSimulJobs_;
+      
+      /*! A signal emitted on each job completion. */
+      TeThreadSignal jobFinishedSig_;
+      
+      /*! The awaiting jobs list. */
+      JobsListT awaitingJobsList_;
+      
+      /*! The running jobs list. */
+      JobsListT runningJobsList_;
+      
+      /*! The thread instances list. */
+      std::list< TeThreadFunctor* > threadsList_;
+      
+      /*! A mutex instance to control access to internal resources. */
+      TeMutex mutex_;
+    };
+    
+    InternalManagerDataStruct managerData_;
+
+    /*! \brief Entry point for all threads.
+     * \param parsPtr Parameters pointer.
+     * \return true if OK.
+     */
+    static bool threadFunction( void* parsPtr );
+
+};
+  
+#endif
+
diff --git a/src/terralib/kernel/TeThreadParameters.h b/src/terralib/kernel/TeThreadParameters.h
old mode 100755
new mode 100644
index 8fe0b8a..a1f6fb3
--- a/src/terralib/kernel/TeThreadParameters.h
+++ b/src/terralib/kernel/TeThreadParameters.h
@@ -1,40 +1,41 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeThreadParameters.h
-   \brief Thread parameters class.
-*/
-
-#ifndef TETRHEADPARAMETERS_H
-  #define TETRHEADPARAMETERS_H
-  
-  #include "TeMultiContainer.h"
-  
-  /**
-   * @brief Thread parameters class.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   * @ingroup Utils
-   */
-  class TL_DLL TeThreadParameters : public TeMultiContainer< std::string > {};
-  
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeThreadParameters.h
+   \brief Thread parameters class.
+*/
+
+#ifndef TETRHEADPARAMETERS_H
+  #define TETRHEADPARAMETERS_H
+  
+  #include "TeMultiContainer.h"
+  #include "TeDefines.h"
+  
+  /**
+   * @brief Thread parameters class.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup MultProgToolsGroup
+   */
+  class TL_DLL TeThreadParameters : public TeMultiContainer< std::string > {};
+  
+#endif
+
diff --git a/src/terralib/kernel/TeThreadSignal.cpp b/src/terralib/kernel/TeThreadSignal.cpp
old mode 100755
new mode 100644
index 6688b5d..9d492c8
--- a/src/terralib/kernel/TeThreadSignal.cpp
+++ b/src/terralib/kernel/TeThreadSignal.cpp
@@ -1,192 +1,192 @@
-#include "TeThreadSignal.h"
-
-#include "TeAgnostic.h"
-
-#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  #include  <stdio.h>
-#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-  #include <sys/time.h>
-  #include <time.h>
-#else
-  #error "Unsuported plataform"
-#endif   
-
-TeThreadSignal::TeThreadSignal()
-{
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  
-   waiters_count_ = 0;
-   wait_generation_count_ = 0;
-   release_count_ = 0;
-
-    // Create a manual-reset event.
-    event_ = CreateEvent (NULL,  // no security
-                          TRUE,  // manual-reset
-                          FALSE, // non-signaled initially
-                          NULL); // unnamed
-    
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-
-    /* Creating mutex */
-
-    pthread_mutexattr_t access_attr;
-    TEAGN_TRUE_OR_THROW( ( pthread_mutexattr_init( &access_attr ) == 0 ),
-      "Unable to init mutex attributes" );
-
-    pthread_mutexattr_settype( &access_attr, PTHREAD_MUTEX_DEFAULT );
-    TEAGN_TRUE_OR_THROW( 
-      ( pthread_mutex_init( &m_access_, &access_attr ) == 0 ),
-      "Unable to init mutex" )
-
-    /* Creating condition variable */
-  
-    TEAGN_TRUE_OR_THROW( ( pthread_cond_init( &condition_var_, 0 ) == 0 ),
-      "Unable to create a condition variable" );
-  
-  #else
-    #error "Unsuported plataform"
-  #endif   
-}
-
-
-TeThreadSignal::~TeThreadSignal()
-{
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  
-    CloseHandle( event_ );
-    
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-
-    pthread_cond_destroy( &condition_var_ );
-  
-    pthread_mutex_destroy( &m_access_ );
-  
-  #else
-    #error "Unsuported plataform"
-  #endif   
-}
-
-
-void TeThreadSignal::emit()
-{
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  
-    waiters_count_lock_.lock();
-    
-    if ( waiters_count_ > 0) {  
-      SetEvent ( event_);
-      // Release all the threads in this generation.
-      release_count_ =  waiters_count_;
-
-      // Start a new generation.
-      wait_generation_count_++;
-    }
-    
-    waiters_count_lock_.unLock();
-
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-
-    TEAGN_TRUE_OR_THROW( ( pthread_cond_broadcast( &condition_var_ ) == 0 ),
-      "Error emiting signal" );
-
-  #else
-    #error "Unsupported platform"
-  #endif   
-}
-
-
-bool TeThreadSignal::wait( unsigned int waiting_time )
-{
-  bool return_value = true;
-  
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  
-    // Avoid race conditions.
-    waiters_count_lock_.lock();
-
-    // Increment count of waiters.
-    waiters_count_++;
-
-    // Store current generation in our activation record.
-    int my_generation =  wait_generation_count_;
-
-    waiters_count_lock_.unLock();
-
-    for (;;) {
-      // Wait until the event is signaled.
-      if( waiting_time == 0 ) {
-        if( WaitForSingleObject ( event_, INFINITE ) != WAIT_OBJECT_0 ) {
-          return_value = false;
-          break;
-        }
-      } else {
-        if( WaitForSingleObject ( event_, waiting_time ) != WAIT_OBJECT_0 ) {
-          return_value = false;
-          break;
-        }      
-      }
-
-      waiters_count_lock_.lock();
-      // Exit the loop when the < event_> is signaled and
-      // there are still waiting threads from this <wait_generation>
-      // that haven't been released from this wait yet.
-      int wait_done =  release_count_ > 0
-                      &&  wait_generation_count_ != my_generation;
-      waiters_count_lock_.unLock();
-
-      if (wait_done)
-        break;
-    }
-
-    waiters_count_lock_.lock();
-    waiters_count_--;
-    release_count_--;
-    int last_waiter =  release_count_ == 0;
-    waiters_count_lock_.unLock();
-
-    if (last_waiter)
-      // We're the last waiter to be notified, so reset the manual event.
-      ResetEvent ( event_);
-
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-
-    TEAGN_TRUE_OR_THROW( ( pthread_mutex_lock( &m_access_ ) == 0 ),
-      "Unable to lock mutex" );
-    
-    if( waiting_time == 0 ) {
-      if( pthread_cond_wait( &condition_var_, &m_access_ ) != 0 ) {
-        return_value = false;
-      }
-    } else {
-      struct timeval timevalstr;
-
-      if( gettimeofday( &timevalstr, 0 ) == 0 ) {
-        struct timespec timespecstr;
-
-        /* seconds */
-        timespecstr.tv_sec = timevalstr.tv_sec + ( waiting_time / 1000 );
-        /* nano-seconds */
-        timespecstr.tv_nsec = ( timevalstr.tv_usec * 1000 ) +
-          ( ( waiting_time % 1000 ) * 1000000 );
-
-        if( pthread_cond_timedwait( &condition_var_, &m_access_, 
-          &timespecstr ) != 0 ) {
-  
-          return_value = false;
-        }
-      } else {
-        TEAGN_LOGWARN( "Unable to get the current time" );
-        return_value = false;
-      }
-    }
-
-    TEAGN_TRUE_OR_THROW( ( pthread_mutex_unlock( &m_access_ ) == 0 ),
-      "Unable to unlock mutex" );
-  
-  #else
-    #error "Unsuported plataform"
-  #endif   
-  
-  return return_value;
-}
-
+#include "TeThreadSignal.h"
+
+#include "TeAgnostic.h"
+
+#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  #include  <stdio.h>
+#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+  #include <sys/time.h>
+  #include <time.h>
+#else
+  #error "Unsuported plataform"
+#endif   
+
+TeThreadSignal::TeThreadSignal()
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  
+   waiters_count_ = 0;
+   wait_generation_count_ = 0;
+   release_count_ = 0;
+
+    // Create a manual-reset event.
+    event_ = CreateEvent (NULL,  // no security
+                          TRUE,  // manual-reset
+                          FALSE, // non-signaled initially
+                          NULL); // unnamed
+    
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+
+    /* Creating mutex */
+
+    pthread_mutexattr_t access_attr;
+    TEAGN_TRUE_OR_THROW( ( pthread_mutexattr_init( &access_attr ) == 0 ),
+      "Unable to init mutex attributes" );
+
+    pthread_mutexattr_settype( &access_attr, PTHREAD_MUTEX_DEFAULT );
+    TEAGN_TRUE_OR_THROW( 
+      ( pthread_mutex_init( &m_access_, &access_attr ) == 0 ),
+      "Unable to init mutex" )
+
+    /* Creating condition variable */
+  
+    TEAGN_TRUE_OR_THROW( ( pthread_cond_init( &condition_var_, 0 ) == 0 ),
+      "Unable to create a condition variable" );
+  
+  #else
+    #error "Unsuported plataform"
+  #endif   
+}
+
+
+TeThreadSignal::~TeThreadSignal()
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  
+    CloseHandle( event_ );
+    
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+
+    pthread_cond_destroy( &condition_var_ );
+  
+    pthread_mutex_destroy( &m_access_ );
+  
+  #else
+    #error "Unsuported plataform"
+  #endif   
+}
+
+
+void TeThreadSignal::emitSignal()
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  
+    waiters_count_lock_.lock();
+    
+    if ( waiters_count_ > 0) {  
+      SetEvent ( event_);
+      // Release all the threads in this generation.
+      release_count_ =  waiters_count_;
+
+      // Start a new generation.
+      wait_generation_count_++;
+    }
+    
+    waiters_count_lock_.unLock();
+
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+
+    TEAGN_TRUE_OR_THROW( ( pthread_cond_broadcast( &condition_var_ ) == 0 ),
+      "Error emiting signal" );
+
+  #else
+    #error "Unsupported platform"
+  #endif   
+}
+
+
+bool TeThreadSignal::waitSignal( unsigned int waiting_time )
+{
+  bool return_value = true;
+  
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  
+    // Avoid race conditions.
+    waiters_count_lock_.lock();
+
+    // Increment count of waiters.
+    waiters_count_++;
+
+    // Store current generation in our activation record.
+    int my_generation =  wait_generation_count_;
+
+    waiters_count_lock_.unLock();
+
+    for (;;) {
+      // Wait until the event is signaled.
+      if( waiting_time == 0 ) {
+        if( WaitForSingleObject ( event_, INFINITE ) != WAIT_OBJECT_0 ) {
+          return_value = false;
+          break;
+        }
+      } else {
+        if( WaitForSingleObject ( event_, waiting_time ) != WAIT_OBJECT_0 ) {
+          return_value = false;
+          break;
+        }      
+      }
+
+      waiters_count_lock_.lock();
+      // Exit the loop when the < event_> is signaled and
+      // there are still waiting threads from this <wait_generation>
+      // that haven't been released from this wait yet.
+      int wait_done =  release_count_ > 0
+                      &&  wait_generation_count_ != my_generation;
+      waiters_count_lock_.unLock();
+
+      if (wait_done)
+        break;
+    }
+
+    waiters_count_lock_.lock();
+    waiters_count_--;
+    release_count_--;
+    int last_waiter =  release_count_ == 0;
+    waiters_count_lock_.unLock();
+
+    if (last_waiter)
+      // We're the last waiter to be notified, so reset the manual event.
+      ResetEvent ( event_);
+
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+
+    TEAGN_TRUE_OR_THROW( ( pthread_mutex_lock( &m_access_ ) == 0 ),
+      "Unable to lock mutex" );
+    
+    if( waiting_time == 0 ) {
+      if( pthread_cond_wait( &condition_var_, &m_access_ ) != 0 ) {
+        return_value = false;
+      }
+    } else {
+      struct timeval timevalstr;
+
+      if( gettimeofday( &timevalstr, 0 ) == 0 ) {
+        struct timespec timespecstr;
+
+        /* seconds */
+        timespecstr.tv_sec = timevalstr.tv_sec + ( waiting_time / 1000 );
+        /* nano-seconds */
+        timespecstr.tv_nsec = ( timevalstr.tv_usec * 1000 ) +
+          ( ( waiting_time % 1000 ) * 1000000 );
+
+        if( pthread_cond_timedwait( &condition_var_, &m_access_, 
+          &timespecstr ) != 0 ) {
+  
+          return_value = false;
+        }
+      } else {
+        TEAGN_LOGWARN( "Unable to get the current time" );
+        return_value = false;
+      }
+    }
+
+    TEAGN_TRUE_OR_THROW( ( pthread_mutex_unlock( &m_access_ ) == 0 ),
+      "Unable to unlock mutex" );
+  
+  #else
+    #error "Unsuported plataform"
+  #endif   
+  
+  return return_value;
+}
+
diff --git a/src/terralib/kernel/TeThreadSignal.h b/src/terralib/kernel/TeThreadSignal.h
old mode 100755
new mode 100644
index c906588..1110e07
--- a/src/terralib/kernel/TeThreadSignal.h
+++ b/src/terralib/kernel/TeThreadSignal.h
@@ -1,141 +1,142 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeThreadSignal.h
-  \brief This file contains definitions about a class to deal thread 
-  signals.
-*/
-
-
-#ifndef TETHREADSIGNAL_H
-  #define TETHREADSIGNAL_H
-  
-  #include "TeDefines.h"
-  
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    #include <windows.h>
-    #include "TeMutex.h"
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-    #include <pthread.h>
-    #include  <errno.h>
-  #else
-    #error "ERROR: Unsupported platform"
-  #endif  
- 
-  /**
-   * @brief A class to deal with thread signals.
-   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
-   */
-  class TL_DLL TeThreadSignal
-  {
-    public :
-    
-      /**
-       * @brief Default constructor.
-       */    
-      TeThreadSignal();
-
-      /**
-       * @brief Default destructor.
-       */       
-      ~TeThreadSignal();
-      
-      /**
-       * @brief Emit a broadcast signal unblocking all waiting threads.
-       */       
-      void emit();      
-      
-      /**
-       * @brief Block the current thread waiting for a signal.
-       * @param waiting_time The maximim waiting time in milliseconds
-       * ( 0 == INFINITE ).
-       * @return true if a signal was received, false if the waiting
-       * time has finished or an error occurred.
-       */       
-      bool wait( unsigned int waiting_time = 0 );      
-      
-    protected :
-   
-      #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    
-        /**
-        * @brief Count of the number of waiters.
-        */      
-        int waiters_count_;
-
-        /**
-        * @brief Serialize access to waiters_count_.
-        */  
-        TeMutex waiters_count_lock_;
-        
-        /**
-        * @brief Number of threads to release via a 
-        * signal broadcast.
-        */ 
-        int release_count_;
-
-        /**
-        * @brief Keeps track of the current "generation" so that we 
-        * don't allow one thread to steal all the "releases" from the 
-        * broadcast.
-        */ 
-        int wait_generation_count_;
-
-        /**
-        * @brief A manual-reset event that's used to block and release 
-        * waiting threads.
-        */ 
-        HANDLE event_;
-      
-      #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-
-        /**
-        * @brief The mutex instance.
-        */        
-        pthread_mutex_t m_access_;
-        
-        /**
-        * @brief The condition var instance.
-        */        
-        pthread_cond_t condition_var_;
-
-      
-      #else
-        #error "Unsuported plataform"
-      #endif   
-   
-    private :
-    
-      /**
-       * @brief Alternative constructor.
-       */    
-      TeThreadSignal(  const TeThreadSignal& ) {};
-   
-      /**
-       * @brief operator= overload.
-       * @return A const reference to the current instance.
-       */      
-      const TeThreadSignal& operator=( const TeThreadSignal& ) { return *this; };
- 
-  };
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeThreadSignal.h
+  \brief This file contains definitions about a class to deal thread 
+  signals.
+*/
+
+
+#ifndef TETHREADSIGNAL_H
+  #define TETHREADSIGNAL_H
+  
+  #include "TeDefines.h"
+  
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    #include <windows.h>
+    #include "TeMutex.h"
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    #include <pthread.h>
+    #include  <errno.h>
+  #else
+    #error "ERROR: Unsupported platform"
+  #endif  
+ 
+  /**
+   * @brief A class to deal with thread signals.
+   * @author Emiliano F. Castejon <castejon at dpi.inpe.br>
+   * @ingroup MultProgToolsGroup
+   */
+  class TL_DLL TeThreadSignal
+  {
+    public :
+    
+      /**
+       * @brief Default constructor.
+       */    
+      TeThreadSignal();
+
+      /**
+       * @brief Default destructor.
+       */       
+      ~TeThreadSignal();
+      
+      /**
+       * @brief Emit a broadcast signal unblocking all waiting threads.
+       */       
+      void emitSignal();      
+      
+      /**
+       * @brief Block the current thread waiting for a signal.
+       * @param waiting_time The maximim waiting time in milliseconds
+       * ( 0 == INFINITE ).
+       * @return true if a signal was received, false if the waiting
+       * time has finished or an error occurred.
+       */       
+      bool waitSignal( unsigned int waiting_time = 0 );      
+      
+    protected :
+   
+      #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    
+        /**
+        * @brief Count of the number of waiters.
+        */      
+        int waiters_count_;
+
+        /**
+        * @brief Serialize access to waiters_count_.
+        */  
+        TeMutex waiters_count_lock_;
+        
+        /**
+        * @brief Number of threads to release via a 
+        * signal broadcast.
+        */ 
+        int release_count_;
+
+        /**
+        * @brief Keeps track of the current "generation" so that we 
+        * don't allow one thread to steal all the "releases" from the 
+        * broadcast.
+        */ 
+        int wait_generation_count_;
+
+        /**
+        * @brief A manual-reset event that's used to block and release 
+        * waiting threads.
+        */ 
+        HANDLE event_;
+      
+      #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+
+        /**
+        * @brief The mutex instance.
+        */        
+        pthread_mutex_t m_access_;
+        
+        /**
+        * @brief The condition var instance.
+        */        
+        pthread_cond_t condition_var_;
+
+      
+      #else
+        #error "Unsuported plataform"
+      #endif   
+   
+    private :
+    
+      /**
+       * @brief Alternative constructor.
+       */    
+      TeThreadSignal(  const TeThreadSignal& ) {};
+   
+      /**
+       * @brief operator= overload.
+       * @return A const reference to the current instance.
+       */      
+      const TeThreadSignal& operator=( const TeThreadSignal& ) { return *this; };
+ 
+  };
+
+#endif
diff --git a/src/terralib/kernel/TeTime.cpp b/src/terralib/kernel/TeTime.cpp
old mode 100755
new mode 100644
index 9b3f1fa..1f5f2f1
--- a/src/terralib/kernel/TeTime.cpp
+++ b/src/terralib/kernel/TeTime.cpp
@@ -1,632 +1,674 @@
- /************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library. 
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <TeTime.h>
-#include <memory.h>
-#include <TeUtils.h>
-#include <iostream>
-#include <cstring>
-#include <cstdlib>
-
-//return the number of the month
-int getMonth(const std::string& month)
-{
-	std::string tempM = TeConvertToUpperCase(month);
-	if(tempM=="JAN")
-		return 0;
-	else if(tempM=="FEB")
-		return 1;
-	else if(tempM=="MAR")
-		return 2;
-	else if(tempM=="APR")
-		return 3;
-	else if(tempM=="MAY")
-		return 4; 
-	else if(tempM=="JUN")
-		return 5;
-	else if(tempM=="JUL")
-		return 6;
-	else if(tempM=="AUG")
-		return 7;
-	else if(tempM=="SEP")
-		return 8;
-	else if(tempM=="OCT")
-		return 9;
-	else if(tempM=="NOV")
-		return 10;
-	else if(tempM=="DEC")
-		return 11;
-
-	return -1;
-}
-
-//return the month 
-std::string getMonth(int i)
-{
-	if(i==0)
-		return "Jan";
-	else if(i==1)
-		return "Feb";
-	else if(i==2)
-		return "Mar";
-	else if(i==3)
-		return "Apr";
-	else if(i==4)
-		return "May";
-	else if(i==5)
-		return "Jun";
-	else if(i==6)
-		return "Jul";
-	else if(i==7)
-		return "Aug";
-	else if(i==8)
-		return "Sep";
-	else if(i==9)
-		return "Oct";
-	else if(i==10)
-		return "Nov";
-	else if(i==11)
-		return "Dec";
-
-	return "";
-}
-
-
-TeTime::TeTime()
-{
-    /*
-	set the tm_isdst field to 0 to indicate that standard time is in effect, 
-	or to a value greater than 0 to indicate that daylight savings time is in effect, 
-	or to a value less than zero to have the C run-time library code compute whether 
-	standard time or daylight savings time is in effect. 
-	(The C run-time library assumes the United States�s rules for implementing 
-	the calculation of Daylight Saving Time).
-	*/
-
-	chronon_ = TeSECOND;
-	ts_.tm_sec = 0;
-	ts_.tm_min = 0;
-	ts_.tm_hour = 0;
-	ts_.tm_isdst = -1;
-	ts_.tm_mday = 1;
-	ts_.tm_mon = 0;
-	ts_.tm_year = 0;
-}
-
-TeTime::TeTime(const TeTime& other)
-{
-	memcpy(&ts_, &other.ts_, sizeof(struct tm));
-	last_ = other.last_;
-	chronon_ = other.chronon_;
-}
-
-TeTime::TeTime(int h, int m, int s, TeChronon chronon)
-{
-	now();
-	ts_ = *localtime(&last_);
-	ts_.tm_sec = s;
-	ts_.tm_min = m;
-	ts_.tm_hour = h;
-	ts_.tm_isdst = -1;
-	ts_.tm_mday = 1;
-	ts_.tm_mon = 0;
-	ts_.tm_year = 0;
-	last_ = mktime(&ts_);
-	chronon_ = chronon;
-}
-
-TeTime::TeTime(const std::string& ds, TeChronon chronon, const std::string& mask, const std::string& dateS, const std::string& timeS, const std::string& indPM)
-{
-	chronon_ = chronon;
-	ts_.tm_sec = 0;
-	ts_.tm_min = 0;
-	ts_.tm_hour = 0;
-	ts_.tm_isdst = -1; 
-	ts_.tm_mday = 1;
-	ts_.tm_mon = 0;
-	ts_.tm_year = 0;
-	
-	bool flag = true;
-	std::string tempDT, tempM;
-	std::string maskTemp = mask;
-	
-	int posBeginMask = 0;
-	int posBeginDate = 0;
-	int posEndMask;
-	int posEndTotalMask = 0;
-	
-	if (mask == "YYYYMMDD" || mask == "yyyymmdd" || mask == "aaaammdd" || mask == "AAAAMMDD")
-	{
-		sscanf(ds.c_str(),"%4d%2d%2d",&ts_.tm_year,&ts_.tm_mon,&ts_.tm_mday);
-	}
-	else if (mask == "DDMMAAAA" || mask == "ddmmaaaa" || mask == "DDMMYYYY" || mask == "ddmmyyyy")
-	{
-		sscanf(ds.c_str(),"%2d%2d%4d",&ts_.tm_mday,&ts_.tm_mon,&ts_.tm_year);
-	}
-	else if (mask == "DDAAAAMM" || mask == "ddaaaamm" || mask == "DDYYYYMM" || mask == "ddyyyymm")
-	{
-		sscanf(ds.c_str(),"%2d%4d%2d",&ts_.tm_mday,&ts_.tm_year,&ts_.tm_mon);
-	}
-	else if (mask == "MMDDAAAA" || mask == "mmddaaaa" || mask == "MMDDYYYY" || mask == "mmddyyyy")
-	{
-		sscanf(ds.c_str(),"%2d%4d%2d",&ts_.tm_mon,&ts_.tm_mday,&ts_.tm_year);
-	}
-	else if (mask == "AAAADDMM" || mask == "aaaaddmm" || mask == "YYYYDDMM" || mask == "yyyyddmm")
-	{
-		sscanf(ds.c_str(),"%4d%2d%2d",&ts_.tm_year,&ts_.tm_mday,&ts_.tm_mon);
-	}
-	else
-	{
-		while(flag)
-		{
-			posEndMask = maskTemp.find("s");
-			posEndTotalMask += posEndMask;
-			
-			if(posEndMask==-1)
-			{
-				flag = false;
-				posEndTotalMask = mask.size();
-			}
-			else
-			{
-				if(posBeginMask>0)
-					++posEndTotalMask;
-				
-				maskTemp = maskTemp.substr(posEndMask+1);
-			}
-
-			tempDT.clear();
-			tempM = mask.substr(posBeginMask,(posEndTotalMask-posBeginMask));
-
-			//fill the datetime
-			std::string dt = ds.substr(posBeginDate,1);
-			while((dt!=dateS) && (dt!=timeS) && (dt!=" ") && (posBeginDate < (int)ds.size()))
-			{
-				tempDT += dt;
-				++posBeginDate;
-				dt = ds.substr(posBeginDate,1);
-			}
-			++posBeginDate;
-			
-			//day
-			if(tempM.find(68)==0)
-				ts_.tm_mday = atoi(tempDT.c_str());
-			
-			//month
-			else if (tempM.find(77)==0)
-			{
-				if(tempDT.size()>2)
-					ts_.tm_mon = getMonth(tempDT)+1;
-				else
-					ts_.tm_mon = atoi(tempDT.c_str());
-			}
-
-			//year
-			else if (tempM.find(89)==0)
-			{
-				ts_.tm_year = atoi(tempDT.c_str());
-				if(ts_.tm_year < 100) 
-					ts_.tm_year += 1900; 
-			}
-
-			//hour
-			else if (tempM.find(72)==0)
-				ts_.tm_hour = atoi(tempDT.c_str());
-			
-			//minute
-			else if (tempM.find(109)==0)
-				ts_.tm_min = atoi(tempDT.c_str());
-			
-			//second
-			else if (tempM.find(83)==0)
-				ts_.tm_sec = atoi(tempDT.c_str());
-			
-			//PM or AM indicator
-			else if ((tempM.find(84)==0) && (tempDT==indPM))
-				ts_.tm_hour += 12;
-				
-			posBeginMask = posEndTotalMask+1;
-
-			if((posBeginDate)>(int)(ds.size()-1) || (posBeginMask)>(int)(mask.size()-1))
-				flag = false;
-		}
-	}
-			
-	switch (chronon_) 
-	{
-	case TeYEAR :
-		ts_.tm_mon = 1;
-        break;
-	case TeMONTH :
-		ts_.tm_mday = 1;
-        break;
-	case TeDAY :
-		ts_.tm_hour = 0;
-        break;
-	case TeHOUR :
-		ts_.tm_min = 0;
-        break;
-	case TeMINUTE :
-		ts_.tm_sec = 0;
-        break;
-	default:
-        break;
-	}
-    
-	ts_.tm_year -= 1900;
-    --ts_.tm_mon;
-
-	last_ = mktime(&ts_);
-	if (last_ != time_t(-1))
-		ts_ = *localtime(&last_);
-}
-
-time_t TeTime::now(void)
-{
-	time(&last_);
-	ts_ = *localtime(&last_);
-	return last_;
-}
-
-std::string
-TeTime::getTime() 
-{
-	char tbuf[9];
-    sprintf(tbuf, "%02d:%02d:%02d",
-                                ts_.tm_hour,ts_.tm_min,ts_.tm_sec);
-    return tbuf;
-}
-
-
-std::string
-TeTime::getDate()  
-{
-	char dbuf[12];
-	sprintf(dbuf,"%4d-%02d-%02d",ts_.tm_year+1900,ts_.tm_mon+1,ts_.tm_mday);
-	return dbuf;
-}
-
-std::string
-TeTime::getDateTime (const std::string& mask, const std::string& dateS, const std::string& timeS, const std::string& indPM, const std::string& indAM)
-{
-	std::string result = "";
-
-	bool flag = true;
-	std::string tempM;
-	std::string maskTemp = mask;
-	
-	int posBeginMask = 0;
-	int posEndMask;
-	int posEndTotalMask = 0;
-
-	bool firstTime = true;
-	bool pm = false;
-	bool am = false;
- 
-	//verify if the mask is AM and PM
-	std::string tempAPM = mask.substr(mask.size()-1, 1);
-	if(tempAPM=="T")
-	{
-		if((ts_.tm_hour>12) || ((ts_.tm_hour==12) && (ts_.tm_min>0)) ||
-			((ts_.tm_hour==12) && (ts_.tm_min==0) && (ts_.tm_sec>0)))
-			pm=true;
-		else
-			am=true;
-	}
-
-	while(flag)
-	{
-		posEndMask = maskTemp.find("s");
-		posEndTotalMask += posEndMask;
-
-		if(posEndMask==-1)
-		{
-			flag = false;
-			posEndTotalMask = mask.size();
-		}
-		else
-		{
-			if(posBeginMask>0)
-				++posEndTotalMask;
-
-			maskTemp = maskTemp.substr(posEndMask+1);
-		}
-
-		tempM = mask.substr(posBeginMask,(posEndTotalMask-posBeginMask));
-
-		//day
-		if(tempM.find(68)==0)
-			result +=  Te2String(ts_.tm_mday) + dateS;
-		
-		//month
-		else if (tempM.find(77)==0)
-		{
-			if(tempM=="MMM")
-				result += getMonth(ts_.tm_mon) + dateS;
-			else
-				result += Te2String(ts_.tm_mon+1) + dateS;
-		}
-
-		//year
-		else if (tempM.find(89)==0)
-		{
-			if(tempM=="YYYY")
-				result +=  Te2String(ts_.tm_year+1900) + dateS;
-			else
-			{
-				std::string tempY = Te2String(ts_.tm_year);
-				tempY = tempY.substr(tempY.size()-2, 2);
-				result += tempY + dateS;
-			}
-		}
-
-		//hour
-		else if (tempM.find(72)==0)
-		{
-			if(firstTime)
-				result.replace(result.size()-1, 1, " ");
-
-			if(pm)
-				result += Te2String(ts_.tm_hour-12) + timeS;
-			else
-				result += Te2String(ts_.tm_hour) + timeS;
-			
-			firstTime = false;
-		}
-
-		//minute
-		else if (tempM.find(109)==0)
-		{
-			if(firstTime)
-				result.replace(result.size()-1, 1, " ");
-
-			result += Te2String(ts_.tm_min) + timeS;
-			firstTime = false;
-		}
-
-		//second
-		else if (tempM.find(83)==0)
-		{
-			if(firstTime)
-				result.replace(result.size()-1, 1, " ");
-
-			result += Te2String(ts_.tm_sec) + timeS;
-			firstTime = false;
-		}
-		
-		//PM or AM indicator
-		else if (tempM.find(84)==0)
-		{
-			result.replace(result.size()-1, 1, " ");
-
-			if(pm)
-				result += indPM;
-			else if(am)
-				result += indAM; 
-			
-		}
-		
-		posBeginMask = posEndTotalMask+1;
-	}
-
-	if((!am) && (!pm))
-		result.replace(result.size()-1, 1, " ");
-
-	return result;
-}
-
-time_t 
-TeTime::Set(int y, int m, int d, int h, int mt, int s)
-{
-    if (y > -1) ts_.tm_year = y-1900;
-    if (m > -1) ts_.tm_mon = m-1;
-
-
-    if (d > -1) ts_.tm_mday = d;
-    if (h > -1) ts_.tm_hour = h;
-    if (mt > -1) ts_.tm_min = mt;
-    if (s > -1) ts_.tm_sec = s;
-	ts_.tm_isdst =-1;
-    last_ = mktime(&ts_);
-    if (last_ == -1) last_ = 0;
-    return last_;
-}
-
-TeTime& 
-TeTime::operator=(const TeTime& other)
-{
-	memcpy(&ts_, &other.ts_, sizeof(struct tm));
-	last_ = other.last_;
-	chronon_ = other.chronon_;
-	return *this;			
-}
-
-
-TeTime&
-TeTime::operator+=(int delta) 
-{
-	if (delta == 0)
-		return *this;
-
-	int deltaux=delta;
-	switch (chronon_)
-	{
-	case TeYEAR :
-		ts_.tm_isdst = -1;
-		ts_.tm_year += delta;	
-		last_ = mktime(&ts_);
-		break;
-	case TeMONTH :
-	case TeMONTHOFYEAR:
-		ts_.tm_isdst = -1;
-		ts_.tm_year += (ts_.tm_mon+delta)/12;
-		ts_.tm_mon = (ts_.tm_mon+delta)%12;
-		last_ = mktime(&ts_);
-		break;
-	case TeDAY :
-	case TeDAYOFMONTH:
-	case TeDAYOFWEEK:
-	case TeDAYOFYEAR:
-		deltaux *= 3600*24;
-		last_ += deltaux;
-		ts_ = *localtime(&last_);
-		break;
-	case TeHOUR :
-	case TeHOUROFDAY :
-		deltaux *= 3600;
-		last_ += deltaux;
-		ts_ = *localtime(&last_);
-		break;
-	case TeMINUTE :
-	case TeMINUTEOFHOUR:
-		deltaux *= 60;;
-		last_ += deltaux;
-		ts_ = *localtime(&last_);
-		break;
-	case TeSECOND :
-	case TeSECONDOFMINUTE :
-		last_ += deltaux;
-		ts_ = *localtime(&last_);
-		break;
-	default :
-		break;
-	}
-
-    return *this;
-}
-
-TeTime&
-TeTime::operator++() 
-{
-	this->operator +=(1);
-	return *this;
-}
-
-TeTime
-TeTime::operator+(int delta)
-{
-	TeTime temp(*this);
-    temp += delta;
-    return temp;
-}
-
-TeTime&
-TeTime::operator-=(int delta) 
-{
-    last_ -= delta;
-    ts_ = *localtime(&last_);
-    return *this;
-}
-
-bool 
-TeTime::operator==(const TeTime& time) const
-{
-	return ((chronon_==time.chronon_) && (ts_.tm_sec==time.ts_.tm_sec) && (ts_.tm_min==time.ts_.tm_min) && 
-		(ts_.tm_hour==time.ts_.tm_hour) && (ts_.tm_isdst==time.ts_.tm_isdst) && (ts_.tm_mday==time.ts_.tm_mday) &&
-		(ts_.tm_mon==time.ts_.tm_mon) && (ts_.tm_year==time.ts_.tm_year));
-}
-
-bool 
-TeTime::operator<(const TeTime& time) const  
-{
-	if(chronon_!=time.chronon_)
-		return false;
-	
-	if(ts_.tm_year>time.ts_.tm_year)
-		return false; 
-	else if(ts_.tm_year<time.ts_.tm_year)
-		return true;
-
-	if(ts_.tm_mon>time.ts_.tm_mon)
-		return false;
-	else if (ts_.tm_mon<time.ts_.tm_mon)
-		return true;
-
-	if(ts_.tm_mday>time.ts_.tm_mday) 
-		return false;
-	else if (ts_.tm_mday<time.ts_.tm_mday) 
-		return true;
-
-	if(ts_.tm_hour>time.ts_.tm_hour) 
-		return false;
-	else if (ts_.tm_hour<time.ts_.tm_hour)
-		return true;
-
-	if(ts_.tm_min>time.ts_.tm_min) 
-		return false;
-	else if (ts_.tm_min<time.ts_.tm_min)
-		return true;
-
-	if(ts_.tm_sec>time.ts_.tm_sec) 
-		return false;
-	else if (ts_.tm_sec<time.ts_.tm_sec)
-		return true;
-
-	return false;
-}
-
-bool 
-TeTime::operator<=(const TeTime& time) const 
-{
-	return (this->operator<(time) || this->operator==(time));
-}
-
-int 
-TeTime::operator-(const TeTime& other)
-{
-	if(this->chronon_!=other.chronon_)
-		return 0;
-	int t = (int)this->last_- other.last_;
-	return (t);
-}
-
-bool 
-TeTime::isValid()  
-{
-	if(	(chronon_==TeSECOND) && (ts_.tm_sec==0) && (ts_.tm_min==0) && 
-		(ts_.tm_hour==0) && (ts_.tm_mday==1) &&
-		((ts_.tm_mon==0) || (ts_.tm_mon==-1)) && (ts_.tm_year==0))
-		return false;
-	else
-		return true;
-}
-
-void 
-TeTime::chronon (TeChronon c)
-{
-	if(chronon_==c)
-		return;
-
-	chronon_=c;
-}
-
-
-std::ostream& operator<<(std::ostream& os, TeTime& N)
-{
-	os << N.getDateTime();
-	return os;
-}
-
-
-
-
+ /************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library. 
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <TeTime.h>
+#include <memory.h>
+#include <TeUtils.h>
+#include <iostream>
+#include <cstring>
+#include <cstdlib>
+
+//return the number of the month
+int getMonth(const std::string& month)
+{
+	std::string tempM = TeConvertToUpperCase(month);
+	if(tempM=="JAN")
+		return 0;
+	else if(tempM=="FEB")
+		return 1;
+	else if(tempM=="MAR")
+		return 2;
+	else if(tempM=="APR")
+		return 3;
+	else if(tempM=="MAY")
+		return 4; 
+	else if(tempM=="JUN")
+		return 5;
+	else if(tempM=="JUL")
+		return 6;
+	else if(tempM=="AUG")
+		return 7;
+	else if(tempM=="SEP")
+		return 8;
+	else if(tempM=="OCT")
+		return 9;
+	else if(tempM=="NOV")
+		return 10;
+	else if(tempM=="DEC")
+		return 11;
+
+	return -1;
+}
+
+//return the month 
+std::string getMonth(int i)
+{
+	if(i==0)
+		return "Jan";
+	else if(i==1)
+		return "Feb";
+	else if(i==2)
+		return "Mar";
+	else if(i==3)
+		return "Apr";
+	else if(i==4)
+		return "May";
+	else if(i==5)
+		return "Jun";
+	else if(i==6)
+		return "Jul";
+	else if(i==7)
+		return "Aug";
+	else if(i==8)
+		return "Sep";
+	else if(i==9)
+		return "Oct";
+	else if(i==10)
+		return "Nov";
+	else if(i==11)
+		return "Dec";
+
+	return "";
+}
+
+
+TeTime::TeTime()
+{
+    /*
+	set the tm_isdst field to 0 to indicate that standard time is in effect, 
+	or to a value greater than 0 to indicate that daylight savings time is in effect, 
+	or to a value less than zero to have the C run-time library code compute whether 
+	standard time or daylight savings time is in effect. 
+	(The C run-time library assumes the United States�s rules for implementing 
+	the calculation of Daylight Saving Time).
+	*/
+
+	chronon_ = TeSECOND;
+	ts_.tm_sec = 0;
+	ts_.tm_min = 0;
+	ts_.tm_hour = 0;
+	ts_.tm_isdst = -1;
+	ts_.tm_mday = 1;
+	ts_.tm_mon = 0;
+	ts_.tm_year = 0;
+}
+
+TeTime::TeTime(const TeTime& other)
+{
+	memcpy(&ts_, &other.ts_, sizeof(struct tm));
+	last_ = other.last_;
+	chronon_ = other.chronon_;
+}
+
+TeTime::TeTime(int h, int m, int s, TeChronon chronon)
+{
+	now();
+	ts_ = *localtime(&last_);
+	ts_.tm_sec = s;
+	ts_.tm_min = m;
+	ts_.tm_hour = h;
+	ts_.tm_isdst = -1;
+	ts_.tm_mday = 1;
+	ts_.tm_mon = 0;
+	ts_.tm_year = 0;
+	last_ = mktime(&ts_);
+	chronon_ = chronon;
+}
+
+TeTime::TeTime(const std::string& ds, TeChronon chronon, const std::string& mask, const std::string& dateS, const std::string& timeS, const std::string& indPM)
+{
+	chronon_ = chronon;
+	ts_.tm_sec = 0;
+	ts_.tm_min = 0;
+	ts_.tm_hour = 0;
+	ts_.tm_isdst = -1; 
+	ts_.tm_mday = 1;
+	ts_.tm_mon = 0;
+	ts_.tm_year = 0;
+	
+	bool flag = true;
+	std::string tempDT, tempM;
+	std::string maskTemp = mask;
+	
+	int posBeginMask = 0;
+	int posBeginDate = 0;
+	int posEndMask;
+	int posEndTotalMask = 0;
+	
+	if (mask == "YYYYMMDD" || mask == "yyyymmdd" || mask == "aaaammdd" || mask == "AAAAMMDD")
+	{
+		sscanf(ds.c_str(),"%4d%2d%2d",&ts_.tm_year,&ts_.tm_mon,&ts_.tm_mday);
+	}
+	else if (mask == "DDMMAAAA" || mask == "ddmmaaaa" || mask == "DDMMYYYY" || mask == "ddmmyyyy")
+	{
+		sscanf(ds.c_str(),"%2d%2d%4d",&ts_.tm_mday,&ts_.tm_mon,&ts_.tm_year);
+	}
+	else if (mask == "DDAAAAMM" || mask == "ddaaaamm" || mask == "DDYYYYMM" || mask == "ddyyyymm")
+	{
+		sscanf(ds.c_str(),"%2d%4d%2d",&ts_.tm_mday,&ts_.tm_year,&ts_.tm_mon);
+	}
+	else if (mask == "MMDDAAAA" || mask == "mmddaaaa" || mask == "MMDDYYYY" || mask == "mmddyyyy")
+	{
+		sscanf(ds.c_str(),"%2d%4d%2d",&ts_.tm_mon,&ts_.tm_mday,&ts_.tm_year);
+	}
+	else if (mask == "AAAADDMM" || mask == "aaaaddmm" || mask == "YYYYDDMM" || mask == "yyyyddmm")
+	{
+		sscanf(ds.c_str(),"%4d%2d%2d",&ts_.tm_year,&ts_.tm_mday,&ts_.tm_mon);
+	}
+	else
+	{
+		while(flag)
+		{
+			posEndMask = maskTemp.find("s");
+			posEndTotalMask += posEndMask;
+			
+			if(posEndMask==-1)
+			{
+				flag = false;
+				posEndTotalMask = mask.size();
+			}
+			else
+			{
+				if(posBeginMask>0)
+					++posEndTotalMask;
+				
+				maskTemp = maskTemp.substr(posEndMask+1);
+			}
+
+			tempDT.clear();
+			tempM = mask.substr(posBeginMask,(posEndTotalMask-posBeginMask));
+
+			//fill the datetime
+			std::string dt = ds.substr(posBeginDate,1);
+			while((dt!=dateS) && (dt!=timeS) && (dt!=" ") && (posBeginDate < (int)ds.size()))
+			{
+				tempDT += dt;
+				++posBeginDate;
+				dt = ds.substr(posBeginDate,1);
+			}
+			++posBeginDate;
+			
+			//day
+			if(tempM.find(68)==0)
+				ts_.tm_mday = atoi(tempDT.c_str());
+			
+			//month
+			else if (tempM.find(77)==0)
+			{
+				if(tempDT.size()>2)
+					ts_.tm_mon = getMonth(tempDT)+1;
+				else
+					ts_.tm_mon = atoi(tempDT.c_str());
+			}
+
+			//year
+			else if (tempM.find(89)==0)
+			{
+				ts_.tm_year = atoi(tempDT.c_str());
+				if(ts_.tm_year < 100) 
+					ts_.tm_year += 1900; 
+			}
+
+			//hour
+			else if (tempM.find(72)==0)
+				ts_.tm_hour = atoi(tempDT.c_str());
+			
+			//minute
+			else if (tempM.find(109)==0)
+				ts_.tm_min = atoi(tempDT.c_str());
+			
+			//second
+			else if (tempM.find(83)==0)
+				ts_.tm_sec = atoi(tempDT.c_str());
+			
+			//PM or AM indicator
+			else if ((tempM.find(84)==0) && (tempDT==indPM))
+				ts_.tm_hour += 12;
+				
+			posBeginMask = posEndTotalMask+1;
+
+			if((posBeginDate)>(int)(ds.size()-1) || (posBeginMask)>(int)(mask.size()-1))
+				flag = false;
+		}
+	}
+			
+	switch (chronon_) 
+	{
+	case TeYEAR :
+		ts_.tm_mon = 1;
+        break;
+	case TeMONTH :
+		ts_.tm_mday = 1;
+        break;
+	case TeDAY :
+		ts_.tm_hour = 0;
+        break;
+	case TeHOUR :
+		ts_.tm_min = 0;
+        break;
+	case TeMINUTE :
+		ts_.tm_sec = 0;
+        break;
+	default:
+        break;
+	}
+    
+	ts_.tm_year -= 1900;
+    --ts_.tm_mon;
+
+	last_ = mktime(&ts_);
+	if (last_ != time_t(-1))
+		ts_ = *localtime(&last_);
+}
+
+time_t TeTime::now(void)
+{
+	time(&last_);
+	ts_ = *localtime(&last_);
+	return last_;
+}
+
+std::string
+TeTime::getTime() const
+{
+	char tbuf[9];
+    sprintf(tbuf, "%02d:%02d:%02d",
+                                ts_.tm_hour,ts_.tm_min,ts_.tm_sec);
+    return tbuf;
+}
+
+
+std::string
+TeTime::getDate() const
+{
+	char dbuf[12];
+	sprintf(dbuf,"%4d-%02d-%02d",ts_.tm_year+1900,ts_.tm_mon+1,ts_.tm_mday);
+	return dbuf;
+}
+
+std::string
+TeTime::getDateTime (const std::string& mask, const std::string& dateS, const std::string& timeS, const std::string& indPM, const std::string& indAM) const
+{
+	std::string result = "";
+
+	bool flag = true;
+	std::string tempM;
+	std::string maskTemp = mask;
+	
+	int posBeginMask = 0;
+	int posEndMask;
+	int posEndTotalMask = 0;
+
+	bool firstTime = true;
+	bool pm = false;
+	bool am = false;
+ 
+	//verify if the mask is AM and PM
+	std::string tempAPM = mask.substr(mask.size()-1, 1);
+	if(tempAPM=="T")
+	{
+		if((ts_.tm_hour>12) || ((ts_.tm_hour==12) && (ts_.tm_min>0)) ||
+			((ts_.tm_hour==12) && (ts_.tm_min==0) && (ts_.tm_sec>0)))
+			pm=true;
+		else
+			am=true;
+	}
+
+	while(flag)
+	{
+		posEndMask = maskTemp.find("s");
+		posEndTotalMask += posEndMask;
+
+		if(posEndMask==-1)
+		{
+			flag = false;
+			posEndTotalMask = mask.size();
+		}
+		else
+		{
+			if(posBeginMask>0)
+				++posEndTotalMask;
+
+			maskTemp = maskTemp.substr(posEndMask+1);
+		}
+
+		tempM = mask.substr(posBeginMask,(posEndTotalMask-posBeginMask));
+
+		//day
+		if(tempM.find(68)==0)
+		{
+			std::string dayStr = Te2String(ts_.tm_mday);
+			if(tempM == "DD" && dayStr.size() == 1)
+			{
+				dayStr = "0" + dayStr;
+			}
+			result +=  dayStr + dateS;
+
+		}
+		
+		//month
+		else if (tempM.find(77)==0)
+		{
+			if(tempM=="MMM")
+				result += getMonth(ts_.tm_mon) + dateS;
+			else
+			{
+				std::string monStr = Te2String(ts_.tm_mon+1);
+				if(tempM == "MM" && monStr.size() == 1)
+				{
+					monStr = "0" + monStr;
+				}
+				result += monStr + dateS;
+			}
+		}
+
+		//year
+		else if (tempM.find(89)==0)
+		{
+			if(tempM=="YYYY")
+				result +=  Te2String(ts_.tm_year+1900) + dateS;
+			else
+			{
+				std::string tempY = Te2String(ts_.tm_year);
+				tempY = tempY.substr(tempY.size()-2, 2);
+				result += tempY + dateS;
+			}
+		}
+
+		//hour
+		else if (tempM.find(72)==0)
+		{
+			if(firstTime && !result.empty())
+				result.replace(result.size()-1, 1, " ");
+
+			if(pm)
+				result += Te2String(ts_.tm_hour-12) + timeS;
+			else
+				result += Te2String(ts_.tm_hour) + timeS;
+			
+			firstTime = false;
+		}
+
+		//minute
+		else if (tempM.find(109)==0)
+		{
+			if(firstTime && !result.empty())
+				result.replace(result.size()-1, 1, " ");
+
+			result += Te2String(ts_.tm_min) + timeS;
+			firstTime = false;
+		}
+
+		//second
+		else if (tempM.find(83)==0)
+		{
+			if(firstTime && !result.empty())
+				result.replace(result.size()-1, 1, " ");
+
+			result += Te2String(ts_.tm_sec) + timeS;
+			firstTime = false;
+		}
+		
+		//PM or AM indicator
+		else if (tempM.find(84)==0)
+		{
+			result.replace(result.size()-1, 1, " ");
+
+			if(pm)
+				result += indPM;
+			else if(am)
+				result += indAM; 
+			
+		}
+		
+		posBeginMask = posEndTotalMask+1;
+	}
+
+	if((!am) && (!pm))
+		result.replace(result.size()-1, 1, " ");
+
+	return result;
+}
+
+time_t 
+TeTime::Set(int y, int m, int d, int h, int mt, int s)
+{
+    if (y > -1) ts_.tm_year = y-1900;
+    if (m > -1) ts_.tm_mon = m-1;
+
+
+    if (d > -1) ts_.tm_mday = d;
+    if (h > -1) ts_.tm_hour = h;
+    if (mt > -1) ts_.tm_min = mt;
+    if (s > -1) ts_.tm_sec = s;
+	ts_.tm_isdst =-1;
+    last_ = mktime(&ts_);
+    if (last_ == -1) last_ = 0;
+    return last_;
+}
+
+TeTime& 
+TeTime::operator=(const TeTime& other)
+{
+	memcpy(&ts_, &other.ts_, sizeof(struct tm));
+	last_ = other.last_;
+	chronon_ = other.chronon_;
+	return *this;			
+}
+
+
+TeTime&
+TeTime::operator+=(int delta) 
+{
+	if (delta == 0)
+		return *this;
+
+	int deltaux=delta;
+	switch (chronon_)
+	{
+	case TeYEAR :
+		ts_.tm_isdst = -1;
+		ts_.tm_year += delta;	
+		last_ = mktime(&ts_);
+		break;
+	case TeMONTH :
+	case TeMONTHOFYEAR:
+		ts_.tm_isdst = -1;
+		ts_.tm_year += (ts_.tm_mon+delta)/12;
+		ts_.tm_mon = (ts_.tm_mon+delta)%12;
+		last_ = mktime(&ts_);
+		break;
+	case TeDAY :
+	case TeDAYOFMONTH:
+	case TeDAYOFWEEK:
+	case TeDAYOFYEAR:
+		deltaux *= 3600*24;
+		last_ += deltaux;
+		ts_ = *localtime(&last_);
+		break;
+	case TeHOUR :
+	case TeHOUROFDAY :
+		deltaux *= 3600;
+		last_ += deltaux;
+		ts_ = *localtime(&last_);
+		break;
+	case TeMINUTE :
+	case TeMINUTEOFHOUR:
+		deltaux *= 60;;
+		last_ += deltaux;
+		ts_ = *localtime(&last_);
+		break;
+	case TeSECOND :
+	case TeSECONDOFMINUTE :
+		last_ += deltaux;
+		ts_ = *localtime(&last_);
+		break;
+	default :
+		break;
+	}
+
+    return *this;
+}
+
+TeTime&
+TeTime::operator++() 
+{
+	this->operator +=(1);
+	return *this;
+}
+
+TeTime
+TeTime::operator+(int delta)
+{
+	TeTime temp(*this);
+    temp += delta;
+    return temp;
+}
+
+TeTime&
+TeTime::operator-=(int delta) 
+{
+    last_ -= delta;
+    ts_ = *localtime(&last_);
+    return *this;
+}
+
+bool 
+TeTime::operator==(const TeTime& time) const
+{
+	return ((chronon_==time.chronon_) && (ts_.tm_sec==time.ts_.tm_sec) && (ts_.tm_min==time.ts_.tm_min) && 
+		(ts_.tm_hour==time.ts_.tm_hour) && (ts_.tm_isdst==time.ts_.tm_isdst) && (ts_.tm_mday==time.ts_.tm_mday) &&
+		(ts_.tm_mon==time.ts_.tm_mon) && (ts_.tm_year==time.ts_.tm_year));
+}
+
+bool 
+TeTime::operator<(const TeTime& time) const  
+{
+	if(chronon_!=time.chronon_)
+		return false;
+	
+	if(ts_.tm_year>time.ts_.tm_year)
+		return false; 
+	else if(ts_.tm_year<time.ts_.tm_year)
+		return true;
+
+	if(ts_.tm_mon>time.ts_.tm_mon)
+		return false;
+	else if (ts_.tm_mon<time.ts_.tm_mon)
+		return true;
+
+	if(ts_.tm_mday>time.ts_.tm_mday) 
+		return false;
+	else if (ts_.tm_mday<time.ts_.tm_mday) 
+		return true;
+
+	if(ts_.tm_hour>time.ts_.tm_hour) 
+		return false;
+	else if (ts_.tm_hour<time.ts_.tm_hour)
+		return true;
+
+	if(ts_.tm_min>time.ts_.tm_min) 
+		return false;
+	else if (ts_.tm_min<time.ts_.tm_min)
+		return true;
+
+	if(ts_.tm_sec>time.ts_.tm_sec) 
+		return false;
+	else if (ts_.tm_sec<time.ts_.tm_sec)
+		return true;
+
+	return false;
+}
+
+bool 
+TeTime::operator<=(const TeTime& time) const 
+{
+	return (this->operator<(time) || this->operator==(time));
+}
+
+int 
+TeTime::operator-(const TeTime& other)
+{
+	if(this->chronon_!=other.chronon_)
+		return 0;
+	int t = (int)this->last_- other.last_;
+	return (t);
+}
+
+bool 
+TeTime::isValid() const 
+{
+	if(	(chronon_==TeSECOND) && (ts_.tm_sec==0) && (ts_.tm_min==0) && 
+		(ts_.tm_hour==0) && (ts_.tm_mday==1) &&
+		((ts_.tm_mon==0) || (ts_.tm_mon==-1)) && (ts_.tm_year==0))
+		return false;
+
+	if(second() < 0 || second() > 59)
+	{
+		return false;
+	}
+	if(minute() < 0 || minute() > 59)
+	{
+		return false;
+	}
+	if(hour() < 0 || hour() > 23)
+	{
+		return false;
+	}
+	if(day() < 1 || day() > 31)
+	{
+		return false;
+	}
+	if(month() < 1 ||  month() > 12)
+	{
+		return false;
+	}
+
+	return true;
+	/*if(	(chronon_==TeSECOND) && (ts_.tm_sec==0) && (ts_.tm_min==0) && 
+		(ts_.tm_hour==0) && (ts_.tm_mday==1) &&
+		((ts_.tm_mon==0) || (ts_.tm_mon==-1)) && (ts_.tm_year==0))
+		return false;
+	else
+		return true;*/
+}
+
+void 
+TeTime::chronon (TeChronon c)
+{
+	if(chronon_==c)
+		return;
+
+	chronon_=c;
+}
+
+
+std::ostream& operator<<(std::ostream& os, TeTime& N)
+{
+	os << N.getDateTime();
+	return os;
+}
+
+
+
+
diff --git a/src/terralib/kernel/TeTime.h b/src/terralib/kernel/TeTime.h
old mode 100755
new mode 100644
index 322d252..ab15615
--- a/src/terralib/kernel/TeTime.h
+++ b/src/terralib/kernel/TeTime.h
@@ -1,153 +1,153 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeTime.h
-    \brief This file contains structures and definitions to deal with date and time
-*/
-#ifndef  __TERRALIB_INTERNAL_TIME_H
-#define  __TERRALIB_INTERNAL_TIME_H
-
-#include "TeDefines.h"
-#include "TeDataTypes.h"
-
-#include <time.h> 
-#include <stdio.h>
-#include <string>
-#include <iostream>
-
-//!  A class for supporting date and time. 
-class TL_DLL TeTime
-{
-    struct tm	ts_; 		// Unix time structure
-    time_t		last_;		// time in seconds
-	TeChronon	chronon_;
-
-public:
-	
-	//!	Set the date and time from the system clock.
-	time_t now(void);
-
-	//!	Set all time information with NULL value 
-	TeTime(void);
-	
-	//!	Copy constructor.
-	TeTime(const TeTime& t);
-
-	//!	Set the date from the system clock and the time from its parameter list. Chronon defaulted to second.
-	TeTime(int h, int m, int s, TeChronon chronon);
-
-	//!	Set date and time from arguments, though the time fields.  
-	TeTime(	const std::string& dt, TeChronon chronon, const std::string& mask, 
-			const std::string& dateS = "/", const std::string& timeS = ":", const std::string& indPM = "PM");
-
-	//!	Return a time of day std::string in format "hh:mm:ss"
-	std::string getTime();
-
-	//!	Return a std::string to the date in the form "yyyy-mm-dd"
-	std::string getDate(void);
-
-	//!	Return a pointer to the date and time in the form passed in mask.  
-	std::string getDateTime (const std::string& mask= "DDsMMsYYYYsHHsmmsSS", const std::string& dateS="/", const std::string& timeS=":", const std::string& indPM="PM", const std::string& indAM="AM");
-
-	//! Reset time to the specified arguments. Return time_t: number of seconds since 0:00:00 Jan 1 1987
-	/*!
-      \param y  year
-	  \param m  month
-	  \param d  day
-	  \param h  hour
-	  \param min  minutes
-      \param s  seconds
-	 */
-	time_t Set(int y, int m, int d, int h = 0, int min = 0, int s = 0);
-
-	//! Get year value as an four digit integer
-	int year()	{return ts_.tm_year+1900;}  
-	
-	//! Get month value
-	int month() {return ts_.tm_mon+1;}
-	
-	//! Get day of the month value
-	int day()	{return ts_.tm_mday;} 
-	
-	//! Get hour value as an integer
-	int hour()	{return ts_.tm_hour;}
-	
-	//! Get minute value as an integer
-	int minute() {return ts_.tm_min;}
-	
-	//! Get second value as an integer
-	int second() {return ts_.tm_sec;} 
-
-	//! Get week day as in integer
-	int weekDay() { return ts_.tm_wday;} //(0-6) 0=Sunday 
-
-	//! Get year day as in integer
-	int yearDay() { return ts_.tm_yday;} //(0-365) 01/01=0 
-	
-	//! Get chronon definition
-	TeChronon chronon () {return chronon_;}
-
-	//! Set chronon definition
-	void chronon (TeChronon c);  
-	
-	//!	Assignment operator for TeTime objects.
-	TeTime& operator=(const TeTime&);
-
-	//!	Add 'delta' chronon units to the current date. Return current date.
-	TeTime& operator+=(int delta);
-
-	//! Increase a chronon unit in the time (Prefix operator)
-	TeTime& operator++();
-
-	//!	Add 'delta' chronon units to the current date and return a new date. Return new date.
-	TeTime operator+(int delta);
-
-	//!	Subtract 'delta' chronon units from the current date. Return current date.
-	TeTime& operator-=(int delta);
-			
-	//! Operator ==
-	bool operator==(const TeTime& time) const;  
-
-	//! Operator <
-	bool operator<(const TeTime& time) const;
-
-	//! Operator <=
-	bool operator<=(const TeTime& time) const;
-
-	//!	Returns the difference betwwen the times in seconds
-	int operator-(const TeTime& other);
-	
-	//! Verify if the time has null values  
-	bool isValid();  
-
-    //!	Normal destructor.
-    ~TeTime(void) { }
-
-};
-
-//! Operator to display an instance of TeTime
-TL_DLL std::ostream& operator<<(std::ostream& os, TeTime& N);
-
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeTime.h
+    \brief This file contains structures and definitions to deal with date and time
+*/
+#ifndef  __TERRALIB_INTERNAL_TIME_H
+#define  __TERRALIB_INTERNAL_TIME_H
+
+#include "TeDefines.h"
+#include "TeDataTypes.h"
+
+#include <time.h> 
+#include <stdio.h>
+#include <string>
+#include <iostream>
+
+//!  A class for supporting date and time. 
+class TL_DLL TeTime
+{
+    struct tm	ts_; 		// Unix time structure
+    time_t		last_;		// time in seconds
+	TeChronon	chronon_;
+
+public:
+	
+	//!	Set the date and time from the system clock.
+	time_t now(void);
+
+	//!	Set all time information with NULL value 
+	TeTime(void);
+	
+	//!	Copy constructor.
+	TeTime(const TeTime& t);
+
+	//!	Set the date from the system clock and the time from its parameter list. Chronon defaulted to second.
+	TeTime(int h, int m, int s, TeChronon chronon);
+
+	//!	Set date and time from arguments, though the time fields.  
+	TeTime(	const std::string& dt, TeChronon chronon, const std::string& mask, 
+			const std::string& dateS = "/", const std::string& timeS = ":", const std::string& indPM = "PM");
+
+	//!	Return a time of day std::string in format "hh:mm:ss"
+	std::string getTime() const;
+
+	//!	Return a std::string to the date in the form "yyyy-mm-dd"
+	std::string getDate(void) const;
+
+	//!	Return a pointer to the date and time in the form passed in mask.  
+	std::string getDateTime (const std::string& mask= "DDsMMsYYYYsHHsmmsSS", const std::string& dateS="/", const std::string& timeS=":", const std::string& indPM="PM", const std::string& indAM="AM") const;
+
+	//! Reset time to the specified arguments. Return time_t: number of seconds since 0:00:00 Jan 1 1987
+	/*!
+      \param y  year
+	  \param m  month
+	  \param d  day
+	  \param h  hour
+	  \param min  minutes
+      \param s  seconds
+	 */
+	time_t Set(int y, int m, int d, int h = 0, int min = 0, int s = 0);
+
+	//! Get year value as an four digit integer
+	int year() const {return ts_.tm_year+1900;}  
+	
+	//! Get month value
+	int month() const {return ts_.tm_mon+1;}
+	
+	//! Get day of the month value
+	int day() const {return ts_.tm_mday;} 
+	
+	//! Get hour value as an integer
+	int hour() const {return ts_.tm_hour;}
+	
+	//! Get minute value as an integer
+	int minute() const {return ts_.tm_min;}
+	
+	//! Get second value as an integer
+	int second() const {return ts_.tm_sec;} 
+
+	//! Get week day as in integer
+	int weekDay() const { return ts_.tm_wday;} //(0-6) 0=Sunday 
+
+	//! Get year day as in integer
+	int yearDay() const { return ts_.tm_yday;} //(0-365) 01/01=0 
+	
+	//! Get chronon definition
+	TeChronon chronon() const {return chronon_;}
+
+	//! Set chronon definition
+	void chronon (TeChronon c);  
+	
+	//!	Assignment operator for TeTime objects.
+	TeTime& operator=(const TeTime&);
+
+	//!	Add 'delta' chronon units to the current date. Return current date.
+	TeTime& operator+=(int delta);
+
+	//! Increase a chronon unit in the time (Prefix operator)
+	TeTime& operator++();
+
+	//!	Add 'delta' chronon units to the current date and return a new date. Return new date.
+	TeTime operator+(int delta);
+
+	//!	Subtract 'delta' chronon units from the current date. Return current date.
+	TeTime& operator-=(int delta);
+			
+	//! Operator ==
+	bool operator==(const TeTime& time) const;  
+
+	//! Operator <
+	bool operator<(const TeTime& time) const;
+
+	//! Operator <=
+	bool operator<=(const TeTime& time) const;
+
+	//!	Returns the difference betwwen the times in seconds
+	int operator-(const TeTime& other);
+	
+	//! Verify if the time has null values  
+	bool isValid() const;
+
+    //!	Normal destructor.
+    ~TeTime(void) { }
+
+};
+
+//! Operator to display an instance of TeTime
+TL_DLL std::ostream& operator<<(std::ostream& os, TeTime& N);
+
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeTimeInterval.cpp b/src/terralib/kernel/TeTimeInterval.cpp
old mode 100755
new mode 100644
index 5685930..efd6d26
--- a/src/terralib/kernel/TeTimeInterval.cpp
+++ b/src/terralib/kernel/TeTimeInterval.cpp
@@ -1,181 +1,181 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeTimeInterval.h"
-
-TeTimeInterval :: TeTimeInterval(const std::string& s1, const std::string& s2, TeChronon chronon, 
-								 const std::string& mask, const std::string& dateS, const std::string& timeS, 
-								 const std::string& indPM)
-{
-	intChronon_ = chronon;
-	//build t1 and t2 with the chronon parameter 
-	TeTime t1 (s1, chronon, mask, dateS, timeS, indPM);
-	TeTime t2 (s2, chronon, mask, dateS, timeS, indPM);
-	t1_ = t1;
-	t2_ = t2;
-	adjustIntervaltoChronon();
-
-}
-
-void 
-TeTimeInterval::intervalChronon(TeChronon c)
-{ 
-	intChronon_ = c; 
-	t1_.chronon(c); 
-	t2_.chronon(c); 
-	adjustIntervaltoChronon();
-}
-
-void  
-TeTimeInterval::adjustIntervaltoChronon ()
-{
-	int m2 = t2_.month();
-	int d2 = 31;
-	int d1 = 1;
-
-	if ((m2 == 4) || (m2 == 6) || (m2 == 9) || (m2 == 11))  //april, june, september, november
-		d2 = 30;
-	if (m2 == 2) //february
-		d2 = 28;
-
-	switch (intChronon_)
-	{
-	case TeYEAR :		
-	    t1_.Set(t1_.year(), 1 , 1, 0, 0, 0);
-		t2_.Set(t2_.year(), 12, 31, 23, 59, 59);
-	   break;
-	case TeMONTH :
-		t1_.Set(t1_.year(), t1_.month(), d1, 0, 0, 0);
-	    t2_.Set(t2_.year(), t2_.month(), d2, 23, 59, 59);
-	   break;
-	case TeDAY :
-		t1_.Set(t1_.year(), t1_.month(), t1_.day(), 0, 0, 0);
-	    t2_.Set(t2_.year(), t2_.month(), t2_.day(), 23, 59, 59);
-	   break;
-	case TeHOUR :
-		t1_.Set(t1_.year(), t1_.month(), t1_.day(), t1_.hour(), 0, 0);
-	    t2_.Set(t2_.year(), t2_.month(), t2_.day(), t2_.hour(), 59, 59);
-	   break;
-	case TeMINUTE :
-		t1_.Set(t1_.year(), t1_.month(), t1_.day(), t1_.hour(), t1_.minute(), 0);
-	    t2_.Set(t2_.year(), t2_.month(), t2_.day(), t2_.hour(), t2_.minute(), 59);
-        break;
-    default:
-        break;
-	}	
-}
-
-
-int 
-TeTimeInterval :: length ()
-{
-	return 1;
-}
-
-void  
-TeTimeInterval :: shift (const std::string& t)
-{
-	TeTime new_t1; 
-	if (t == "")  
-		TeTime new_t1 (t2_);  
-	else		  
-		TeTime new_t1 (t, t2_.chronon(), "YYYYsMMsDDsHHsmmsSS");
-
-	TeTime new_t2 = new_t1 + length();
-
-	t1_ = new_t1;
-	t2_ = new_t2;
-	adjustIntervaltoChronon();
-}
-
-
-void  
-TeTimeInterval :: shiftPlus (int delta)
-{
-	t1_ += delta;
-	t2_ = t1_ + (delta - 1);
-	adjustIntervaltoChronon();
-}
-
-
-void  
-TeTimeInterval :: shiftMinus (int delta)
-{
-	t1_ -= delta;  
-	t2_ = t1_ + (-delta); 
-	adjustIntervaltoChronon();
-}
-
-bool   
-TeTimeInterval :: during (TeTime& time)
-{
-	if(intChronon_==TeMONTHOFYEAR)
-		return ((this->getT1().month()<=time.month()) && (this->getT2().month()>=time.month()));
-	
-	if (intChronon_==TeDAYOFMONTH)
-		return ((this->getT1().day()<=time.day()) && (this->getT2().day()>=time.day()));
-
-	if (intChronon_== TeDAYOFWEEK)
-		return ((this->getT1().weekDay()<=time.weekDay()) && (this->getT2().weekDay()>=time.weekDay())); 
-
-	if (intChronon_== TeDAYOFYEAR)
-		return ((this->getT1().yearDay()<=time.yearDay()) && (this->getT2().yearDay()>=time.yearDay())); 
-		
-	if (intChronon_== TeHOUROFDAY)
-		return ((this->getT1().hour()<=time.hour()) && (this->getT2().hour()>=time.hour())); 
-		
-	if (intChronon_==TeMINUTEOFHOUR)
-		return ((this->getT1().minute()<=time.minute()) && (this->getT2().minute()>=time.minute())); 
-	
-	if (intChronon_==TeSECONDOFMINUTE)
-		return ((this->getT1().second()<=time.second()) && (this->getT2().second()>=time.second())); 
-
-	return ((this->getT1()<=time) && (time<=this->getT2())); 
-}
-
-bool   
-TeTimeInterval :: before (TeTime& time)
-{
-	if(intChronon_==TeMONTHOFYEAR)
-		return (time.month() < this->getT1().month());
-	
-	if (intChronon_==TeDAYOFMONTH)
-		return (time.day() < this->getT1().day());
-
-	if (intChronon_== TeDAYOFWEEK)
-		return (time.weekDay() < this->getT1().weekDay());
-
-	if (intChronon_== TeDAYOFYEAR)
-		return (time.yearDay() < this->getT1().yearDay());
-		
-	if (intChronon_== TeHOUROFDAY)
-		return (time.hour() < this->getT1().hour());
-		
-	if (intChronon_==TeMINUTEOFHOUR)
-		return (time.minute() < this->getT1().minute());
-	
-	if (intChronon_==TeSECONDOFMINUTE)
-		return (time.second() < this->getT1().second());
-
-	return (time < this->getT1());
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeTimeInterval.h"
+
+TeTimeInterval :: TeTimeInterval(const std::string& s1, const std::string& s2, TeChronon chronon, 
+								 const std::string& mask, const std::string& dateS, const std::string& timeS, 
+								 const std::string& indPM)
+{
+	intChronon_ = chronon;
+	//build t1 and t2 with the chronon parameter 
+	TeTime t1 (s1, chronon, mask, dateS, timeS, indPM);
+	TeTime t2 (s2, chronon, mask, dateS, timeS, indPM);
+	t1_ = t1;
+	t2_ = t2;
+	adjustIntervaltoChronon();
+
+}
+
+void 
+TeTimeInterval::intervalChronon(TeChronon c)
+{ 
+	intChronon_ = c; 
+	t1_.chronon(c); 
+	t2_.chronon(c); 
+	adjustIntervaltoChronon();
+}
+
+void  
+TeTimeInterval::adjustIntervaltoChronon ()
+{
+	int m2 = t2_.month();
+	int d2 = 31;
+	int d1 = 1;
+
+	if ((m2 == 4) || (m2 == 6) || (m2 == 9) || (m2 == 11))  //april, june, september, november
+		d2 = 30;
+	if (m2 == 2) //february
+		d2 = 28;
+
+	switch (intChronon_)
+	{
+	case TeYEAR :		
+	    t1_.Set(t1_.year(), 1 , 1, 0, 0, 0);
+		t2_.Set(t2_.year(), 12, 31, 23, 59, 59);
+	   break;
+	case TeMONTH :
+		t1_.Set(t1_.year(), t1_.month(), d1, 0, 0, 0);
+	    t2_.Set(t2_.year(), t2_.month(), d2, 23, 59, 59);
+	   break;
+	case TeDAY :
+		t1_.Set(t1_.year(), t1_.month(), t1_.day(), 0, 0, 0);
+	    t2_.Set(t2_.year(), t2_.month(), t2_.day(), 23, 59, 59);
+	   break;
+	case TeHOUR :
+		t1_.Set(t1_.year(), t1_.month(), t1_.day(), t1_.hour(), 0, 0);
+	    t2_.Set(t2_.year(), t2_.month(), t2_.day(), t2_.hour(), 59, 59);
+	   break;
+	case TeMINUTE :
+		t1_.Set(t1_.year(), t1_.month(), t1_.day(), t1_.hour(), t1_.minute(), 0);
+	    t2_.Set(t2_.year(), t2_.month(), t2_.day(), t2_.hour(), t2_.minute(), 59);
+        break;
+    default:
+        break;
+	}	
+}
+
+
+int 
+TeTimeInterval :: length ()
+{
+	return 1;
+}
+
+void  
+TeTimeInterval :: shift (const std::string& t)
+{
+	TeTime new_t1; 
+	if (t == "")  
+		TeTime new_t1 (t2_);  
+	else		  
+		TeTime new_t1 (t, t2_.chronon(), "YYYYsMMsDDsHHsmmsSS");
+
+	TeTime new_t2 = new_t1 + length();
+
+	t1_ = new_t1;
+	t2_ = new_t2;
+	adjustIntervaltoChronon();
+}
+
+
+void  
+TeTimeInterval :: shiftPlus (int delta)
+{
+	t1_ += delta;
+	t2_ = t1_ + (delta - 1);
+	adjustIntervaltoChronon();
+}
+
+
+void  
+TeTimeInterval :: shiftMinus (int delta)
+{
+	t1_ -= delta;  
+	t2_ = t1_ + (-delta); 
+	adjustIntervaltoChronon();
+}
+
+bool   
+TeTimeInterval :: during (TeTime& time)
+{
+	if(intChronon_==TeMONTHOFYEAR)
+		return ((this->getT1().month()<=time.month()) && (this->getT2().month()>=time.month()));
+	
+	if (intChronon_==TeDAYOFMONTH)
+		return ((this->getT1().day()<=time.day()) && (this->getT2().day()>=time.day()));
+
+	if (intChronon_== TeDAYOFWEEK)
+		return ((this->getT1().weekDay()<=time.weekDay()) && (this->getT2().weekDay()>=time.weekDay())); 
+
+	if (intChronon_== TeDAYOFYEAR)
+		return ((this->getT1().yearDay()<=time.yearDay()) && (this->getT2().yearDay()>=time.yearDay())); 
+		
+	if (intChronon_== TeHOUROFDAY)
+		return ((this->getT1().hour()<=time.hour()) && (this->getT2().hour()>=time.hour())); 
+		
+	if (intChronon_==TeMINUTEOFHOUR)
+		return ((this->getT1().minute()<=time.minute()) && (this->getT2().minute()>=time.minute())); 
+	
+	if (intChronon_==TeSECONDOFMINUTE)
+		return ((this->getT1().second()<=time.second()) && (this->getT2().second()>=time.second())); 
+
+	return ((this->getT1()<=time) && (time<=this->getT2())); 
+}
+
+bool   
+TeTimeInterval :: before (TeTime& time)
+{
+	if(intChronon_==TeMONTHOFYEAR)
+		return (time.month() < this->getT1().month());
+	
+	if (intChronon_==TeDAYOFMONTH)
+		return (time.day() < this->getT1().day());
+
+	if (intChronon_== TeDAYOFWEEK)
+		return (time.weekDay() < this->getT1().weekDay());
+
+	if (intChronon_== TeDAYOFYEAR)
+		return (time.yearDay() < this->getT1().yearDay());
+		
+	if (intChronon_== TeHOUROFDAY)
+		return (time.hour() < this->getT1().hour());
+		
+	if (intChronon_==TeMINUTEOFHOUR)
+		return (time.minute() < this->getT1().minute());
+	
+	if (intChronon_==TeSECONDOFMINUTE)
+		return (time.second() < this->getT1().second());
+
+	return (time < this->getT1());
+}
diff --git a/src/terralib/kernel/TeTimeInterval.h b/src/terralib/kernel/TeTimeInterval.h
old mode 100755
new mode 100644
index 146abd2..3d653c1
--- a/src/terralib/kernel/TeTimeInterval.h
+++ b/src/terralib/kernel/TeTimeInterval.h
@@ -1,169 +1,169 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeTimeInterval.h
-    \brief This file contains structures and definitions to deal with date and time intervals
-*/
-
-#ifndef  __TERRALIB_INTERNAL_TIMEINTERVAL_H
-#define  __TERRALIB_INTERNAL_TIMEINTERVAL_H
-
-#include "TeTime.h" 
-
-//! This class provides a set of functions for manipulating date and time intervals
-class TL_DLL TeTimeInterval
-{
-private:
-
-	TeTime  t1_;
-	TeTime  t2_;
-	TeChronon  intChronon_;
-
-	void adjustIntervaltoChronon ();
-
-public:
-	
-	//!	Set the date and time from the system clock
-	void now(void) {t1_.now(); t2_.now();}
-
-	//! Empty constructor
-	TeTimeInterval (void): 	t1_(), t2_() {}
-
-	//!	Set all time information from the system clock
-	TeTimeInterval (TeTime& t1, TeTime& t2): 	t1_(t1), t2_(t2) {}
-
-	//!	Copy constructor.
-	TeTimeInterval(const TeTimeInterval& t): t1_(t.t1_), t2_(t.t2_) {}
-
-	//!	Set date and time from arguments, though the time fields defaults to zero.
-	TeTimeInterval(const std::string& t1, const std::string& t2, TeChronon chronon=TeSECOND, const std::string& mask="YYYYsMMsDDsHHsmmsSS", const std::string& dateS = "/", const std::string& timeS = ":", const std::string& indPM = "PM");
-
-	//!	Set date and time from arguments, though the time fields defaults to zero.
-	TeTimeInterval(const std::string& t1, TeChronon chronon=TeSECOND, const std::string& mask="YYYYsMMsDDsHHsmmsSS", int delta = 0, int numsteps = 1): 
-		t1_ (t1,  chronon, mask)
-	{
-		t2_ = t1_ + (delta-1)*numsteps; 
-		adjustIntervaltoChronon();
-	}
- 
-	//! Returns the chronon of the interval
-	TeChronon intervalChronon() { return  intChronon_; }
-
-	//! Sets the chronon of the interval
-	void intervalChronon(TeChronon c);  
-
-	//!	Return a time of day std::string in format "hh:mm:ss"
-	std::string getInitialTime()			{return t1_.getTime();}
-
-	//!	Return a time of day std::string in format "hh:mm:ss"
-	std::string getFinalTime()			{return t2_.getTime();}
-
-	//!	Return a std::string to the date in the form "yyyy-mm-dd"
-	std::string getInitialDate(void)		{return t1_.getDate();}
-
-	//!	Return a std::string to the date in the form "yyyy-mm-dd"
-	std::string getFinalDate(void)		{return t2_.getDate();}
-
-	//! Return the time t1_
-	TeTime& getT1 (void) {return t1_;}
-
-	//! Return the time t2_
-	TeTime& getT2 (void) {return t2_;}
-
-	//!	Return a pointer to the date and time in the form passed in mask.  
-	std::string getInitialDateTime (const std::string& mask="YYYYsMMsDDsHHsmmsSS", const std::string& dateS="/", const std::string& timeS=":", const std::string& indPM="PM", const std::string& indAM="AM") {return t1_.getDateTime(mask, dateS, timeS, indPM, indAM);}
-
-	//!	Return a pointer to the date and time in the form passed in mask.  
-	std::string getFinalDateTime (const std::string& mask="YYYYsMMsDDsHHsmmsSS", const std::string& dateS="/", const std::string& timeS=":", const std::string& indPM="PM", const std::string& indAM="AM") {return t2_.getDateTime(mask, dateS, timeS, indPM, indAM);}
-
-	
-	//! Reset time to the specified arguments. Return time_t: number of seconds since 0:00:00 Jan 1 1987
-	/*!
-      \param y  year
-	  \param m  month
-	  \param d  day
-	  \param h  hour
-	  \param min  minutes
-      \param s  seconds
-	*/
-	time_t setInitialTime (int y, int m, int d, int h = 0, int min = 0, int s = 0)
-	{return t1_.Set(y, m, d, h, min, s);}
-
-
-	//! Reset time to the specified arguments. Return time_t: number of seconds since 0:00:00 Jan 1 1987
-	/*!
-      \param y  year
-	  \param m  month
-	  \param d  day
-	  \param h  hour
-	  \param min  minutes
-      \param s  seconds
-	*/
-	time_t setFinalTime (int y, int m, int d, int h = 0, int min = 0, int s = 0) 
-	{return t2_.Set(y, m, d, h, min, s);}
-
-	//!	Assignment operator for TeTime objects.
-	TeTimeInterval& operator=(const TeTimeInterval& t) {t1_ = t.t1_;  t2_ = t.t2_; intChronon_ = t.intChronon_; return (*this);}
-
-	//! Operator ==
-	bool operator==(const TeTimeInterval& other) const { return (this->t1_ == other.t1_ && this->t2_ == other.t2_); } 
-
-	bool operator<(const TeTimeInterval& other) const { return (this->t1_ < other.t1_ && this->t2_ < other.t2_); } 
-
-	//! Compute legnth of time interval in units of chonon
-	int length ();
-
-	//! Shift the interval, begining at time t (in the form "yyyy-mm-dd hh:mm:ss").
-	/*!
-		If t is not provided, the current final time becomes the initial time. 
-		The interval length is maintained.
-	*/
-	void shift (const std::string& t = "");
-
-	
-	//! Shift the interval, begining delta units after the initial time. The interval length is maintained.
-	void shiftPlus (int delta);
-
-	//! Shift the interval, begining delta units before the initial time. The interval length is maintained.
-	void shiftMinus (int delta);
-
-	//! verify if the times have null values
-	bool isValid() 
-	{ return (t1_.isValid() || t2_.isValid()); } 
-	
-    //!	Normal destructor.
-	~TeTimeInterval(void) { }
-
-	//! Verify if a specific time is during the interval time
-	bool  during (TeTime& time);
-
-	//! Verify if a specific time is before the interval time
-	bool  before (TeTime& time);
-
-};
-
-//! Standard output operator definition
-TL_DLL std::ostream& operator<<(std::ostream& os, TeTime& N);
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeTimeInterval.h
+    \brief This file contains structures and definitions to deal with date and time intervals
+*/
+
+#ifndef  __TERRALIB_INTERNAL_TIMEINTERVAL_H
+#define  __TERRALIB_INTERNAL_TIMEINTERVAL_H
+
+#include "TeTime.h" 
+
+//! This class provides a set of functions for manipulating date and time intervals
+class TL_DLL TeTimeInterval
+{
+private:
+
+	TeTime  t1_;
+	TeTime  t2_;
+	TeChronon  intChronon_;
+
+	void adjustIntervaltoChronon ();
+
+public:
+	
+	//!	Set the date and time from the system clock
+	void now(void) {t1_.now(); t2_.now();}
+
+	//! Empty constructor
+	TeTimeInterval (void): 	t1_(), t2_() {}
+
+	//!	Set all time information from the system clock
+	TeTimeInterval (TeTime& t1, TeTime& t2): 	t1_(t1), t2_(t2) {}
+
+	//!	Copy constructor.
+	TeTimeInterval(const TeTimeInterval& t): t1_(t.t1_), t2_(t.t2_) {}
+
+	//!	Set date and time from arguments, though the time fields defaults to zero.
+	TeTimeInterval(const std::string& t1, const std::string& t2, TeChronon chronon=TeSECOND, const std::string& mask="YYYYsMMsDDsHHsmmsSS", const std::string& dateS = "/", const std::string& timeS = ":", const std::string& indPM = "PM");
+
+	//!	Set date and time from arguments, though the time fields defaults to zero.
+	TeTimeInterval(const std::string& t1, TeChronon chronon=TeSECOND, const std::string& mask="YYYYsMMsDDsHHsmmsSS", int delta = 0, int numsteps = 1): 
+		t1_ (t1,  chronon, mask)
+	{
+		t2_ = t1_ + (delta-1)*numsteps; 
+		adjustIntervaltoChronon();
+	}
+ 
+	//! Returns the chronon of the interval
+	TeChronon intervalChronon() { return  intChronon_; }
+
+	//! Sets the chronon of the interval
+	void intervalChronon(TeChronon c);  
+
+	//!	Return a time of day std::string in format "hh:mm:ss"
+	std::string getInitialTime()			{return t1_.getTime();}
+
+	//!	Return a time of day std::string in format "hh:mm:ss"
+	std::string getFinalTime()			{return t2_.getTime();}
+
+	//!	Return a std::string to the date in the form "yyyy-mm-dd"
+	std::string getInitialDate(void)		{return t1_.getDate();}
+
+	//!	Return a std::string to the date in the form "yyyy-mm-dd"
+	std::string getFinalDate(void)		{return t2_.getDate();}
+
+	//! Return the time t1_
+	TeTime& getT1 (void) {return t1_;}
+
+	//! Return the time t2_
+	TeTime& getT2 (void) {return t2_;}
+
+	//!	Return a pointer to the date and time in the form passed in mask.  
+	std::string getInitialDateTime (const std::string& mask="YYYYsMMsDDsHHsmmsSS", const std::string& dateS="/", const std::string& timeS=":", const std::string& indPM="PM", const std::string& indAM="AM") {return t1_.getDateTime(mask, dateS, timeS, indPM, indAM);}
+
+	//!	Return a pointer to the date and time in the form passed in mask.  
+	std::string getFinalDateTime (const std::string& mask="YYYYsMMsDDsHHsmmsSS", const std::string& dateS="/", const std::string& timeS=":", const std::string& indPM="PM", const std::string& indAM="AM") {return t2_.getDateTime(mask, dateS, timeS, indPM, indAM);}
+
+	
+	//! Reset time to the specified arguments. Return time_t: number of seconds since 0:00:00 Jan 1 1987
+	/*!
+      \param y  year
+	  \param m  month
+	  \param d  day
+	  \param h  hour
+	  \param min  minutes
+      \param s  seconds
+	*/
+	time_t setInitialTime (int y, int m, int d, int h = 0, int min = 0, int s = 0)
+	{return t1_.Set(y, m, d, h, min, s);}
+
+
+	//! Reset time to the specified arguments. Return time_t: number of seconds since 0:00:00 Jan 1 1987
+	/*!
+      \param y  year
+	  \param m  month
+	  \param d  day
+	  \param h  hour
+	  \param min  minutes
+      \param s  seconds
+	*/
+	time_t setFinalTime (int y, int m, int d, int h = 0, int min = 0, int s = 0) 
+	{return t2_.Set(y, m, d, h, min, s);}
+
+	//!	Assignment operator for TeTime objects.
+	TeTimeInterval& operator=(const TeTimeInterval& t) {t1_ = t.t1_;  t2_ = t.t2_; intChronon_ = t.intChronon_; return (*this);}
+
+	//! Operator ==
+	bool operator==(const TeTimeInterval& other) const { return (this->t1_ == other.t1_ && this->t2_ == other.t2_); } 
+
+	bool operator<(const TeTimeInterval& other) const { return (this->t1_ < other.t1_ && this->t2_ < other.t2_); } 
+
+	//! Compute legnth of time interval in units of chonon
+	int length ();
+
+	//! Shift the interval, begining at time t (in the form "yyyy-mm-dd hh:mm:ss").
+	/*!
+		If t is not provided, the current final time becomes the initial time. 
+		The interval length is maintained.
+	*/
+	void shift (const std::string& t = "");
+
+	
+	//! Shift the interval, begining delta units after the initial time. The interval length is maintained.
+	void shiftPlus (int delta);
+
+	//! Shift the interval, begining delta units before the initial time. The interval length is maintained.
+	void shiftMinus (int delta);
+
+	//! verify if the times have null values
+	bool isValid() 
+	{ return (t1_.isValid() || t2_.isValid()); } 
+	
+    //!	Normal destructor.
+	~TeTimeInterval(void) { }
+
+	//! Verify if a specific time is during the interval time
+	bool  during (TeTime& time);
+
+	//! Verify if a specific time is before the interval time
+	bool  before (TeTime& time);
+
+};
+
+//! Standard output operator definition
+TL_DLL std::ostream& operator<<(std::ostream& os, TeTime& N);
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeTin.cpp b/src/terralib/kernel/TeTin.cpp
old mode 100755
new mode 100644
index f5c272a..a79cea3
--- a/src/terralib/kernel/TeTin.cpp
+++ b/src/terralib/kernel/TeTin.cpp
@@ -1,1796 +1,3077 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeTin.h"
-#include "TeStdFile.h"
-#include "TeException.h"
-#include "TeGeometryAlgorithms.h"
-
-#include <iostream>
-#include <fstream>
-#include <algorithm>
-
-// TeTinTriangleSet
-
-bool
-TeTinTriangleSet::loadFromFile(std::string &fileName)
-{
-//	Open tin triangles file
-	std::string trianglesFile = fileName;
-	trianglesFile += ".tpl";
-
-	std::ifstream inStream;
-	inStream.open( trianglesFile.data(), std::ios::in | std::ios::binary );
-
-	if (! inStream.good() )
-		return false;
-
-	long laux;
-//#if defined(SPRWIN) || defined(LITTLEENDIAN) - File is saved in LITTLEENDIAN
-	inStream.read((char*)&laux, sizeof(long));
-	long numTriangles = laux;
-
-//	Create and std::set tin triangles std::vector
-	if ( this->size () )
-		this->clear ();
-	this->reserve (numTriangles);
-
-//	Read file for triangles data load
-	long lineid [3];
-	for (long i = 0; i < numTriangles; i++)
-	{
-		for (long j = 0; j < 3; j++)
-		{
-			if (! inStream.good() )
-				return false;
-			inStream.read((char*)&laux, sizeof(long));
-			lineid[j] = laux;
-		}
-		this->add ( TeTinTriangle (lineid[0],lineid[1],lineid[2]) );
-//		triangles_[i].setEdges(lineid[0],lineid[1],lineid[2]);
-	}
-	return true;
-}
-
-bool
-TeTinVertexSet::loadFromFile(std::string &fileName)
-{
-//	Open tin vertices file
-	std::string verticesFile = fileName;
-	verticesFile += ".tnd";
-
-	std::ifstream inStream;
-	inStream.open( verticesFile.data(), std::ios::in | std::ios::binary );
-
-	if (! inStream.good() )
-		return false;
-
-	long laux;
-//#if defined(SPRWIN) || defined(LITTLEENDIAN) - File is saved in LITTLEENDIAN
-	inStream.read((char*)&laux, sizeof(long));
-	long numVertices = laux;
-
-//	Create and std::set tin vertices std::vector
-	if ( this->size () )
-		this->clear ();
-	this->reserve (numVertices);
-
-//	Read file for vertices data load
-	double x, y;
-	double value;
-	short vertexType;
-	for (long i = 0; i < numVertices; i++)
-	{
-		if (! inStream.good() )
-			return false;
-		inStream.read((char*)&x, sizeof(double));
-		if (! inStream.good() )
-			return false;
-		inStream.read((char*)&y, sizeof(double));
-		if (! inStream.good() )
-			return false;
-		inStream.read((char*)&value, sizeof(double));
-		if (! inStream.good() )
-			return false;
-		inStream.read((char*)&vertexType, sizeof(short));
-		this->add( TeTinVertex (TeCoord2D (x,y), value,
-			(TeTinVertexType) vertexType, -1 ) );
-	}
-	return true;
-}
-
-bool
-TeTinEdgeSet::loadFromFile(std::string &fileName)
-{
-//	Open tin edges file
-	std::string edgesFile = fileName;
-	edgesFile += ".tln";
-
-	std::ifstream inStream;
-	inStream.open( edgesFile.data(), std::ios::in | std::ios::binary );
-
-	if (! inStream.good() )
-		return false;
-
-	long laux;
-//#if defined(SPRWIN) || defined(LITTLEENDIAN) - File is saved in LITTLEENDIAN
-	inStream.read((char*)&laux, sizeof(long));
-	long numEdges = laux;
-
-//	Create and std::set tin edges std::vector
-	if ( this->size () )
-		this->clear ();
-	this->reserve (numEdges);
-
-//	Read file for edges data load
-	long from, to, left, right;
-	for (long i = 0; i < numEdges; i++)
-	{
-		if (! inStream.good() )
-			return false;
-		inStream.read((char*)&from, sizeof(long));
-		if (! inStream.good() )
-			return false;
-		inStream.read((char*)&to, sizeof(long));
-
-		if (! inStream.good() )
-			return false;
-		inStream.read((char*)&left, sizeof(long));
-		if (! inStream.good() )
-			return false;
-		inStream.read((char*)&right, sizeof(long));
-
-		this->add( TeTinEdge (from, to, left, right, NORMALEDGE) );
-	}
-	return true;
-}
-
-
-// TeTin
-
-bool
-TeTin::loadFromFile(std::string &fileName)
-{
-	if ( triangleSet_.loadFromFile ( fileName ) )
-	{
-		if ( vertexSet_.loadFromFile ( fileName ) )
-		{
-			if ( edgeSet_.loadFromFile ( fileName ) )
-				return true;
-		}
-	}
-	return false;
-}
-
-bool
-TeTin::getLines(TeLineSet &lineSet)
-{
-	std::vector<TeTinEdge>::iterator i = edgeSet_.begin();
-	while ( i != edgeSet_.end() )
-	{
-		long from = (*i).from();
-		long to = (*i).to();
-		TeCoord2D ptf = vertexSet_[from].location();
-		TeCoord2D ptt = vertexSet_[to].location();
-		i++;
-
-		TeLine2D line;
-		line.add (ptf);
-		line.add (ptt);
-		lineSet.add(line);
-	}
-	return true;
-}
-
-long
-TeTin::oneEdgeWithVertex(long v)
-{
-	long vsize = vertexSet_.size();
-	long edge;
-	if (v < vsize)
-	{
-		TeTinVertex vv = vertexSet_[v];
-		edge = vv.oneEdge();
-	}
-	else
-		return -1;
-
-	// Test to make sure there is no wrong index
-	if ( edge != -1 )
-		if ( ( edgeSet_[edge].to() == v ) ||
-			 ( edgeSet_[edge].from() == v ) )
-		return edge;
-
-	//Fail safe code, must return from previous code
-	static long	oldedge = 0;	// Set one edge only once
-
-	long j = 0;
-	while (j < 2)
-	{
-		unsigned long i;
-		for (i = oldedge; i < edgeSet_.size(); i++)
-		{
-			long from = edgeSet_[i].from();
-			long to   = edgeSet_[i].to();
-			if ( from == -1 || to == -1 )
-				continue;
-			if (from == v || to == v)
-			{
-				oldedge = i;
-				return i;
-			}
-		}
-		oldedge = 0;
-		j++;
-	}
-	return -1;
-}
-
-long
-TeTin::edgeOppVertex(TeTinTriangle& t, long v)
-{
-	long edges[3];
-	t.edges(edges[0],edges[1],edges[2]);
-
-	for (long i = 0; i < 3; i++)
-	{
-		if ( edgeSet_[edges[i]].from() != v &&
-		     edgeSet_[edges[i]].to()   != v )
-			return edges[i];
-	}
-	return -1;
-}
-
-long
-TeTin::vertexOppEdge(long t, long e)
-{
-	long edges[3];
-	triangleSet_[t].edges(edges[0],edges[1],edges[2]);
-
-	long vef(-1), vet(-1);
-	unsigned long i;
-	for (i = 0; i < 3; i++)
-	{
-		if ( edges[i] == e )
-		{
-			vef = edgeSet_[edges[i]].from();
-			vet = edgeSet_[edges[i]].to();
-			break;
-		}
-	}
-	if ( vef == -1 )
-		return -1;
-
-	for (i = 0; i < 3; i++)
-	{
-		if ( edges[i] != e )
-		{
-			if ( vef == edgeSet_[edges[i]].from() ||
-			     vet == edgeSet_[edges[i]].from() )
-				return edgeSet_[edges[i]].to();
-			if ( vef == edgeSet_[edges[i]].to() ||
-			     vet == edgeSet_[edges[i]].to() )
-				return edgeSet_[edges[i]].from();
-			return -1;
-		}
-	}
-	return -1;
-}
-
-long
-TeTin::edgeWithVertexDiffFromEdge(long t, long v, long e)
-{
-	long edges[3];
-	triangleSet_[t].edges(edges[0],edges[1],edges[2]);
-
-	for (long i = 0; i < 3; i++)
-	{
-		if ( edges[i] == e )
-			continue;
-		if ( edgeSet_[edges[i]].from() == v ||
-		     edgeSet_[edges[i]].to()   == v )
-			return edges[i];
-	}
-	return -1;
-}
-
-bool
-TeTin::vertexOppEdges(long v, std::list<long> &edges)
-{
-//	Find one line that contains node
-	long a = oneEdgeWithVertex(v);
-	if (a == -1)
-		return false;
-
-//	1. Defina td como sendo o tri�ngulo que est� � direita da aresta a e
-	long td = edgeSet_[a].right(); // te como sendo o tri�ngulo que est�
-	long te = edgeSet_[a].left();  // � esquerda de a,
-
-	long ai = a; // 2. Defina ai como sendo aresta a 
-	long ti = td;//    e ti como sendo o tri�ngulo td,
-
-	long ao;
- 
-	if ( ti != -1 ) // 3. Se o tri�ngulo ti n�o for nulo,
-	{				//    insira aresta ao de ti que n�o � diretamente
-		ao = edgeOppVertex ( ti, v );// conectado a v no conjunto A,
-		if (ao == -1)
-			return false;
-		edges.push_back (ao);
-	}
-
-	while (ti != te)// 4. Enquanto ti for diferente do tri�ngulo te,
-	{
-		if (ti == -1)//	4.1. Se o tri�ngulo ti � nulo (esta' na
-		{			 //  borda da triangula��o) fa�a:
-			ti = te; //	 4.1.1. Defina ti como sendo o tri�ngulo te,
-			te = -1; //  4.1.2. Defina te como sendo nulo,
-			ai = a;  //  4.1.3. Defina ai como sendo aresta a,
-			if ( ti != -1 ) // 4.1.4. Se o tri�ngulo ti n�o for nulo,
-			{				// insira aresta ao de ti que n�o � diretamente
-				ao = edgeOppVertex ( ti, v );// conectado a v
-				if (ao == -1)
-					return false;
-				edges.push_back (ao); // a v no conjunto A,
-			}
-			continue;//	 4.1.5. Retorne a 4.
-		}
-
-		long aaux = edgeWithVertexDiffFromEdge ( ti, v, ai );// 4.2. Defina a
-		if (aaux == -1)	 // aresta aaux do tri�ngulo ti que conecta o
-			return false;// v�rtice v e � diferente de ai,
-
-		long taux;
-		if (edgeSet_[aaux].right() == ti) // 4.3. Defina taux como sendo  
-			taux = edgeSet_[aaux].left();//  o tri�ngulo que compartilha
-		else if (edgeSet_[aaux].left() == ti)// a aresta aaux com ti,
-			taux = edgeSet_[aaux].right();
-		else
-			return false;
-
-		ti = taux;// 4.4. Defina ti como sendo o tri�ngulo taux e ai 
-		ai = aaux;//	  como sendo aresta aaux,
-
-		if ( ti != -1 )// 4.5. Se o tri�ngulo ti n�o for nulo, insira
-		{			   //      aresta ao de ti que n�o � diretamente
-			ao = edgeOppVertex ( ti, v ); // conectado a v
-			if (ao == -1)							// no conjunto A,
-				return false;
-			edges.push_back (ao);
-		}
-	} // 4.6. Retorne a 4.
-	return true;
-}
-
-bool
-TeTin::vertexEdges(long v, std::list<long> &edges)
-{
-//	Find one line that contains node
-	long a = oneEdgeWithVertex(v);
-	if (a == -1)
-		return false;
-
-//	1. Defina td como sendo o tri�ngulo que est� � direita da aresta a e
-	long td = edgeSet_[a].right(); // te como sendo o tri�ngulo que est�
-	long te = edgeSet_[a].left();  // � esquerda de a,
-
-	long ai = a; // 2. Defina ai como sendo aresta a 
-	long ti = td;//    e ti como sendo o tri�ngulo td,
-
-	edges.push_back (ai);//	3. Insira a aresta ai no conjunto A,
-
-	while (ti != te)//	4. Enquanto ti for diferente do tri�ngulo te,
-	{
-		if (ti == -1)
-		{// 4.1. Se o tri�ngulo ti � nulo (esta' na borda da triangula��o) fa�a:
-			ti = te;// 4.1.1. Defina ti como sendo o tri�ngulo te,
-			te = -1;// 4.1.2. Defina te como sendo nulo,
-			ai = a;// 4.1.3. Defina ai como sendo aresta a,
-			continue;// 4.1.4. Retorne a 4.
-		}
-
-		long aaux = edgeWithVertexDiffFromEdge ( ti, v, ai );// 4.2. Defina a
-		if (aaux == -1)	 // aresta aaux do tri�ngulo ti que conecta o
-			return false;// v�rtice v e � diferente de ai,
-
-		long taux;
-		if (edgeSet_[aaux].right() == ti) // 4.3. Defina taux como sendo  
-			taux = edgeSet_[aaux].left();//  o tri�ngulo que compartilha
-		else if (edgeSet_[aaux].left() == ti)// a aresta aaux com ti,
-			taux = edgeSet_[aaux].right();
-		else
-			return false;
-
-		ti = taux;// 4.4. Defina ti como sendo o tri�ngulo taux e ai 
-		ai = aaux;//	  como sendo aresta aaux,
-
-		edges.push_back (ai);// 4.5. Se o tri�ngulo ti n�o for nulo, insira
-	} // 4.6. Retorne a 4.
-	return true;
-}
-
-bool
-TeTin::vertexOppVertices(long v, std::list<long> &vertices)
-{
-//	Find one line that contains node
-	long a = oneEdgeWithVertex(v);
-	if (a == -1)
-		return false;
-
-//	1. Defina td como sendo o tri�ngulo que est� � direita da aresta a e
-	long td = edgeSet_[a].right(); // te como sendo o tri�ngulo que est�
-	long te = edgeSet_[a].left();  // � esquerda de a,
-
-	long ai = a; // 2. Defina ai como sendo aresta a 
-	long ti = td;//    e ti como sendo o tri�ngulo td,
-
-	long vi = edgeSet_[a].from();// 3. Insira o v�rtice diferente de v
-	if (vi == v)				// conectado � aresta ai no conjunto V,
-		vi = edgeSet_[a].to();
-	vertices.push_back (vi);
-
-	while (ti != te)// 4. Enquanto ti for diferente do tri�ngulo te,
-	{
-		if (ti == -1)// 4.1. Se o tri�ngulo ti � nulo (esta' na borda 
-		{			 // da triangula��o) fa�a:
-			ti = te; //	4.1.1. Defina ti como sendo o tri�ngulo te,
-			te = -1; //	4.1.2. Defina te como sendo nulo,
-			ai = a;  //	4.1.3. Defina ai como sendo aresta a,
-			continue;//	4.1.4. Retorne a 4.
-		}
-
-		long aaux = edgeWithVertexDiffFromEdge ( ti, v, ai );// 4.2. Defina a
-		if (aaux == -1)	 // aresta aaux do tri�ngulo ti que conecta o
-			return false;// v�rtice v e � diferente de ai,
-
-		long taux;
-		if (edgeSet_[aaux].right() == ti) // 4.3. Defina taux como sendo  
-			taux = edgeSet_[aaux].left();//  o tri�ngulo que compartilha
-		else if (edgeSet_[aaux].left() == ti)// a aresta aaux com ti,
-			taux = edgeSet_[aaux].right();
-		else
-			return false;
-
-		ti = taux;// 4.4. Defina ti como sendo o tri�ngulo taux e ai 
-		ai = aaux;//	  como sendo aresta aaux,
-
-		vi = edgeSet_[ai].from();//	4.5. Insira o v�rtice diferente
-		if (vi == v)	// de v conectado � aresta ai no conjunto V,
-			vi = edgeSet_[ai].to();
-		vertices.push_back (vi);
-	}//	4.6. Retorne a 4.
-	return true;
-}
-
-bool
-TeTin::vertexTriangles(long v, std::list<long> &triangles)
-{
-//	Find one line that contains node
-	long a = oneEdgeWithVertex(v);
-	if (a == -1)
-		return false;
-
-//	1. Defina td como sendo o tri�ngulo que est� � direita da aresta a e
-	long td = edgeSet_[a].right(); // te como sendo o tri�ngulo que est�
-	long te = edgeSet_[a].left();  // � esquerda de a,
-
-	long ai = a; // 2. Defina ai como sendo aresta a 
-	long ti = td;//    e ti como sendo o tri�ngulo td,
- 
-	if ( ti != -1 ) // 3. Se o tri�ngulo ti n�o for nulo,
-	{				//    insira ti no conjunto T,
-		triangles.push_back (ti);
-	}
-
-	while (ti != te)// 4. Enquanto ti for diferente do tri�ngulo te,
-	{
-		if (ti == -1)//	4.1. Se o tri�ngulo ti � nulo (esta' na
-		{			 //  borda da triangula��o) fa�a:
-			ti = te; //	 4.1.1. Defina ti como sendo o tri�ngulo te,
-			te = -1; //  4.1.2. Defina te como sendo nulo,
-			ai = a;  //  4.1.3. Defina ai como sendo aresta a,
-			if ( ti != -1 ) // 4.1.4. Se o tri�ngulo ti n�o for nulo,
-			{				// insira ti no conjunto T,
-				triangles.push_back (ti);
-			}
-			continue;//	 4.1.5. Retorne a 4.
-		}
-
-		long aaux = edgeWithVertexDiffFromEdge ( ti, v, ai );// 4.2. Defina a
-		if (aaux == -1)	 // aresta aaux do tri�ngulo ti que conecta o
-			return false;// v�rtice v e � diferente de ai,
-
-		long taux;
-		if (edgeSet_[aaux].right() == ti) // 4.3. Defina taux como sendo  
-			taux = edgeSet_[aaux].left();//  o tri�ngulo que compartilha
-		else if (edgeSet_[aaux].left() == ti)// a aresta aaux com ti,
-			taux = edgeSet_[aaux].right();
-		else
-			return false;
-
-		ti = taux;// 4.4. Defina ti como sendo o tri�ngulo taux e ai 
-		ai = aaux;//	  como sendo aresta aaux,
-
-		if ( ti != -1 )// 4.5. Se o tri�ngulo ti n�o for nulo, insira
-		{			   //      aresta ao de ti que n�o � diretamente
-			triangles.push_back (ti);
-		}
-	} // 4.6. Retorne a 4.
-	return true;
-}
-
-bool
-TeTin::vertexOppEdges(long v, std::list<long> &triset, std::list<long> &edges)
-{
-	std::list<long>::iterator tii;
-	for (tii = triset.begin(); tii != triset.end(); tii++)
-	{
-		long ti = *tii;
-		long nedge = this->edgeOppVertex(ti, v);
-		edges.push_back(nedge);
-	}
-	return true;
-}
-
-long
-TeTin::oneTriangleWithVertex(long v)
-{
-//	Find one line that contains node
-	long a = oneEdgeWithVertex(v);
-	if (a == -1)
-		return -1;
-
-	long td = edgeSet_[a].right();
-	if ( td == -1 )
-		return edgeSet_[a].left();
-	else
-		return td;
-}
-
-bool
-TeTin::triangleContainsPoint(TeTinTriangle& t, TeCoord2D& pt) 
-{
-	double	totalArea, triangleArea;
-	TeCoord2D	vert[3];
-
-	this->trianglePoints(t, vert[0], vert[1], vert[2]);
-
-//	Calculate the base triangle area
-	triangleArea = fabs(( (vert[1].x() - vert[0].x()) *
-		              (vert[2].y() - vert[0].y()) ) -
-	 	            ( (vert[2].x() - vert[0].x()) *
-	 	              (vert[1].y() - vert[0].y()) ));
-	triangleArea *= 1.00001;
-	totalArea = fabs(( (vert[0].x() - pt.x()) * (vert[1].y() - pt.y()) ) -
-		         ( (vert[1].x() - pt.x()) * (vert[0].y() - pt.y()) ));
-	if (totalArea > triangleArea)
-		return false;
-
-	totalArea += fabs(( (vert[1].x() - pt.x()) * (vert[2].y() - pt.y()) ) -
-		          ( (vert[2].x() - pt.x()) * (vert[1].y() - pt.y()) ));
-	if (totalArea > triangleArea) 
-		return false;
-
-	totalArea += fabs(( (vert[0].x() - pt.x()) * (vert[2].y() - pt.y()) ) -
-		          ( (vert[2].x() - pt.x()) * (vert[0].y() - pt.y()) ));
-	if (totalArea > triangleArea) 
-		return false;
-
-	return true;
-}
-
-long
-TeTin::triangleAt (TeCoord2D& pt)
-{
-//Seja v um v�rtice qualquer da triangula��o T e p o ponto para o qual se deseja saber qual tri�ngulo t
-//	o cont�m.
-	long vi1;
-
-	TeTinEdgeSet::reverse_iterator i = edgeSet_.rbegin();
-	while ( i != edgeSet_.rend() )
-	{
-		vi1 = (*i++).from();
-		if (vi1 >= 0 ) // -1L)
-			break;
-	}
-	if ( i == edgeSet_.rend() )
-		return -1;
-
-//1. Defina o conjunto T={t1,..., tm} com os m tri�ngulos que compartilham o v�rtice vi,
-	std::list<long> triset;
-	this->vertexTriangles(vi1, triset);
-
-	TeCoord2D pf = vertexSet_[vi1].location();
-	if ( pf == pt )
-//2. Se vi � igual a p, o tri�ngulo que cont�m p � um dos tri�ngulos que compartilham vi.
-// Escolha qualquer um dos tri�ngulos e termine o algoritmo.
-		return ( *(triset.begin()) );
-
-//3. Defina A={a1,...,an} com as n arestas opostas a vi,
-	std::list<long> aedges;
-	this->vertexOppEdges(vi1, triset, aedges);
-
-//4. Defina V={v1,...,vm} com os m v�rtices dos tri�ngulos que cont�m o v�rtice vi,
-	std::list <long> vvertex;
-	this->vertexOppVertices(vi1, vvertex);
-
-//5. Insira o v�rtice v no conjunto VI de v�rtices intersectados,
-	std::set <long> viset;
-	viset.insert(vi1);
-
-//6. Defina o v�rtice auxiliar vaux como sendo vi,
-	long vaux = vi1;
-//   e aresta aaux como sendo inv�lida
-	long aaux = -1;
-	std::vector<long> auxset(3);
-	for (;;)
-	{
-//7. Para cada tri�ngulo ti de T, fa�a:
-		std::list<long>::iterator tii;
-		for (tii = triset.begin(); tii != triset.end(); tii++)
-		{
-			long ti = *tii;
-//7.1. Se o tri�ngulo ti cont�m o ponto pn, termine o algoritmo.
-			if ( this->triangleContainsPoint( ti, pt ) )
-				return ti;
-		}
-//8.	Para cada v�rtice vi de V, fa�a:
-		std::list<long>::iterator vii;
-		for (vii = vvertex.begin(); vii != vvertex.end(); vii++)
-		{
-			long vi = *vii;
-			TeCoord2D ptvi = vertexSet_[vi].location();
-			if ( ptvi == pt )
-//8.1. Se vi � igual a p, o tri�ngulo que cont�m p � um dos tri�ngulos que compartilham vi.
-			{
-				for (tii = triset.begin(); tii != triset.end(); tii++)
-				{
-					long ti = *tii;
-					long v0, v1, v2;
-					this->triangleVertices(ti, v0, v1, v2);
-					if ( v0 == vi || v1 == vi || v2 == vi)
-						return ti;
-				}
-				return -1;
-			}
-		}
-//9. Para cada v�rtice vi de V, fa�a:
-		for ( vii = vvertex.begin(); vii != vvertex.end(); vii++)
-		{
-			long vi = *vii;
-//9.1.	Se vi est� sobre r, fa�a:
-			TeCoord2D ptvi = vertexSet_[vi].location();
-			TeCoord2D pinter;
-			if ( TePerpendicularDistance(pf, pt, ptvi, pinter) < TePrecision::instance().precision() )
-			{
-				TeBox box1;
-				updateBox (box1, pf);
-				updateBox (box1, pt);
-
-				if (TeWithin (pinter, box1) )
-				{
-//9.1.1.	Redefina o conjunto A={a1,..., an} com as n arestas opostas a vi, diferentes de aaux,
-					aedges.clear();
-					this->vertexOppEdges(vi, aedges);
-//9.1.2.	Defina o conjunto Aaux={a1,..., am} com as m arestas compartilhadas por vaux,
-					std::list <long> vauxedges;
-					this->vertexEdges(vaux, vauxedges);
-//9.1.3.	Exclua do conjunto A todas as arestas que pertencem ao conjunto Aaux,
-					for (std::list<long>::iterator vai = vauxedges.begin(); vai != vauxedges.end(); vai++)
-						aedges.remove ( *vai );
-//9.1.4.	Exclua do conjunto A a aresta aaux,
-					aedges.remove ( aaux ); // better perfomance than remove algorithm
-//9.1.5.	Redefina o conjunto V={v1,..., vm} com os m v�rtices dos tri�ngulos que cont�m o v�rtice vi,
-//			diferentes de vaux,
-					vvertex.clear();
-					this->vertexOppVertices(vi, vvertex);
-//9.1.6.	Exclua do conjunto V todos os v�rtices que pertencem ao conjunto VI,
-					for (std::set<long>::iterator vvi = viset.begin(); vvi != viset.end(); vvi++)
-						vvertex.remove ( *vvi );
-//9.1.7.	Redefina o conjunto T={t1, ..., tk } com os k tri�ngulos que cont�m o v�rtice vi,
-					triset.clear();
-					this->vertexTriangles(vi, triset);
-//9.1.8.	Redefina o v�rtice auxiliar vaux como sendo vi,
-					vaux = vi;
-//9.1.8.	Insira o v�rtice vi no conjunto VI de v�rtices intersectados,
-					viset.insert(vi);
-//9.1.8.	Retorne a 7,
-					//pf = vertexSet_[vi].location();
-					break;
-				}
-			}
-		}
-		if ( vii != vvertex.end() )
-			continue; // do for (;;)
-
-//10.	Para cada aresta ai de A, fa�a:
-		std::list<long>::iterator aii;
-		for (aii = aedges.begin(); aii != aedges.end(); aii++)
-		{
-			long ai = *aii;
-//10.1.	Se o ponto p est� sobre ai, fa�a:
-			TeCoord2D pfr = vertexSet_[edgeSet_[ai].from()].location();
-			TeCoord2D pto = vertexSet_[edgeSet_[ai].to()].location();
-			TeCoord2D pinter;
-			if ( TePerpendicularDistance(pfr, pto, pt, pinter) < TePrecision::instance().precision() )
-			{
-				TeBox box1;
-				updateBox (box1, pfr);
-				updateBox (box1, pto);
-				if (TeWithin(pinter, box1) )
-				{
-//10.1.1. Escolha qualquer um dos tri�ngulos que compartilham ai.
-					long ti = edgeSet_[ai].left();
-//10.1.2.	Termine o algoritmo.
-					if ( (ti != -1) && (this->triangleContainsPoint(ti, pt)) )
-						return ( ti );
-					else
-					{
-						ti = edgeSet_[ai].right();
-						if ( (ti != -1) && (this->triangleContainsPoint(ti, pt)) )
-							return ( ti );
-						return -1;
-					}
-				}
-			}
-		}
-
-//11.	Para cada aresta ai de A, fa�a:
-		for (aii = aedges.begin(); aii != aedges.end(); aii++)
-		{
-			long ai = *aii;
-			long vt = edgeSet_[ai].to();
-			long vf = edgeSet_[ai].from();
-			TeCoord2D pi;
-//11.1.	Se ai intersecta r, fa�a:
-			if (TeSegmentsIntersectPoint(vertexSet_[vt].location(), vertexSet_[vf].location(), pf, pt, pi) )
-			{
-//11.1.2.	Defina os tri�ngulos t1 e t2 que compartilham a aresta ai.
-//11.1.3.	Se t2 est� contido no conjunto T , ent�o fa�a taux=t1,
-				long taux = edgeSet_[ai].left();
-				if (taux == -1)
-					return -1;
-				std::list<long>::iterator pos1 = find (triset.begin(), triset.end(), taux);
-				if ( pos1 != triset.end() )
-//11.1.4.	Sen�o, fa�a taux=t2,
-					taux = edgeSet_[ai].right();
-				if (taux == -1)
-					return -1;
-//11.1.5.	Se o tri�ngulo taux cont�m o ponto pn, termine o algoritmo.
-				if ( this->triangleContainsPoint( taux, pt ) )
-					return taux;
-//11.1.6.	Redefina o conjunto A={a1, a2} com as arestas do tri�ngulo taux diferentes de ai,
-				triangleSet_[taux].edges ( auxset[0], auxset[1], auxset[2] );
-				aedges.clear();
-				aedges.insert( aedges.begin(), auxset.begin(), auxset.end() );
-				aedges.remove( ai );
-//11.1.7.	Redefina o conjunto V={v1}. O v�rtice v1 � o v�rtice do tri�ngulo taux que n�o est�
-//			em nenhuma extremidade da aresta ai,
-				long vaux1 = edgeSet_[ai].from();
-				long vaux2 = edgeSet_[ai].to();
-				this->triangleVertices ( taux, auxset[0], auxset[1], auxset[2]);
-				vvertex.clear();
-				vvertex.insert ( vvertex.begin(), auxset.begin(), auxset.end() );
-				vvertex.remove ( vaux1 );
-				vvertex.remove ( vaux2 );
-
-//11.1.8.	Redefina o conjunto T={taux},
-				triset.clear();
-				triset.push_back ( taux );
-//11.1.9.	Redefina aaux como sendo ai,
-				aaux = ai;
-//11.1.10.	Retorne a 8;
-				break;
-			}
-		}
-//12.	Se n�o h� mais arestas em A, ent�o:
-		if ( aii == aedges.end() )
-		{
-//12.1.	Para cada tri�ngulo ti de T, fa�a:
-//			TeTinTriangleIterator tii;
-//			for ( tii = triangleBegin(); tii != triangleEnd(); tii++)
-			long ti;
-			long tEnd = triangleSet_.size();
-			for ( ti = 0; ti < tEnd; ti++)
-			{
-//				TeTinTriangle ti = *tii;
-	//12.1.1.	Se o tri�ngulo ti cont�m o ponto pn, termine o algoritmo.
-				if ( this->triangleContainsPoint( ti, pt ) )
-					return ti;
-			}
-			if (ti == tEnd )
-				return -1;
-		}
-	} // Do for (;;)
-	return -1;
-}
-
-bool
-TeTin::insertPoint(double x, double y, double value)
-{
-//	Get Point to be inserted from std::vector
-	TeCoord2D	pt(x,y);
-	if ( ! TeWithin (pt, vertexSet_.box()) )
-		return false;
-
-//	Find the triangle that owns the point pt	
-	long t = triangleAt ( pt );
-
-	if (t == -1)
-		return false;
-
-	TeCoord2D vert[3];
-	trianglePoints(t, vert[0], vert[1], vert[2]);
-
-	
-
-//	Verify if point is too close to one triangle vertex
-	long j;
-	for ( j = 0; j < 3; j++)
-	{
-		if (pt == vert[j]) // Using precision to compare
-			return false;
-	}
-
-//	Test if the point is on an edge
-	long nedge = -1;
-	double dmin = TeMAXFLOAT;
-	TeCoord2D pmin;
-	for (j = 0; j < 3; j++)
-	{
-		if ( TeWithinOrTouches (pt, vert[j], vert[(j+1)%3]) == false )
-			continue;
-
-		TeCoord2D paux;
-		double daux = TePerpendicularDistance(vert[j], vert[(j+1)%3], pt, paux);
-		if ((daux < TePrecision::instance().precision()) && (daux < dmin))
-		{//			On edge j
-			nedge = j;
-			dmin = daux;
-			pmin = paux;
-		}
-	}
-
-	vertexSet_.add( TeTinVertex (pt, value, NORMALVERTEX, -1 ) );
-	long v = vertexSet_.size()-1;
-
-	std::set<long> trianglesToTest;
-	if (nedge == -1)	// Not on an edge
-	{
-		this->twoNewTriangles(t, v, trianglesToTest);	//If not, split triang
-	}
-	else
-	{
-		long neighids[3];
-		this->triangle3Neighbors(t, neighids[0],neighids[1],neighids[2]);
-		long edges[3];
-		triangleSet_[t].edges( edges[0], edges[1], edges[2] );
-		for (j = 0; j < 3; j++)
-		{	// Check if neighbor triangle opposite vertex is too close
-			if ( neighids[j] == -1L )
-				continue;
-			long oppVertex = edgeOppVertex(neighids[j], edges[j]);
-			long vsize = vertexSet_.size();
-			if ( oppVertex < vsize )
-			{
-			TeCoord2D ptaux = vertexSet_[oppVertex].location();
-			if ( ptaux == pt )
-//			if ( vertexSet_[oppVertex].location() == pt )
-			{
-				// If necessary add code to change oppVertex type and value
-				return false;
-			}
-			}
-		}
-
-//		Duplicate triangle and its neighbor on the same edge
-		long an0 = this->duplicateTriangle( t, nedge, v, trianglesToTest);
-		if (neighids[nedge] != -1L)
-		{
-			long tv = neighids[nedge];
-			this->dupNeighTriangle( tv, an0, v, trianglesToTest);
-		}
-	}
-	this->testDelaunayForVertex(v, trianglesToTest);
-	return true;
-}
-
-bool
-TeTin::trianglePoints(TeTinTriangle& t, TeCoord2D& pt0, TeCoord2D& pt1, TeCoord2D& pt2)
-{
-	long vertex0, vertex1, vertex2;
-	this->triangleVertices(t, vertex0, vertex1, vertex2);
-
-	pt0 = vertexSet_[vertex0].location();
-	pt1 = vertexSet_[vertex1].location();
-	pt2 = vertexSet_[vertex2].location();
-
-	return true;
-}
-
-bool
-TeTin::triangleVertices(TeTinTriangle& t, long& vertex0, long& vertex1, long& vertex2)
-{
-	long edge0, edge1, edge2;
-	t.edges(edge0,edge1,edge2);
-
-	if (edgeSet_[edge0].to() == edgeSet_[edge1].to())
-	{
-		vertex0 = edgeSet_[edge0].from();
-		vertex1 = edgeSet_[edge0].to();
-		vertex2 = edgeSet_[edge1].from();
-	}
-	else if (edgeSet_[edge0].to() == edgeSet_[edge1].from())
-	{
-		vertex0 = edgeSet_[edge0].from();
-		vertex1 = edgeSet_[edge0].to();
-		vertex2 = edgeSet_[edge1].to();
-	}
-	else if (edgeSet_[edge0].from() == edgeSet_[edge1].from())
-	{
-		vertex0 = edgeSet_[edge0].to();
-		vertex1 = edgeSet_[edge0].from();
-		vertex2 = edgeSet_[edge1].to();
-	}
-	else if (edgeSet_[edge0].from() == edgeSet_[edge1].to())
-	{
-		vertex0 = edgeSet_[edge0].to();
-		vertex1 = edgeSet_[edge0].from();
-		vertex2 = edgeSet_[edge1].from();
-	}
-	else
-		return false;
-
-	return true;
-}
-
-bool
-TeTin::triangle3Neighbors(long t, long& neighbor0, long& neighbor1, long& neighbor2)
-{
-	long edge0, edge1, edge2;
-	triangleSet_[t].edges(edge0,edge1,edge2);
-
-	if (edgeSet_[edge0].left() == t)
-		neighbor0 = edgeSet_[edge0].right();
-	else
-		neighbor0 = edgeSet_[edge0].left();
-
-	if (edgeSet_[edge1].left() == t)
-		neighbor1 = edgeSet_[edge1].right();
-	else
-		neighbor1 = edgeSet_[edge1].left();
-
-	if (edgeSet_[edge2].left() == t)
-		neighbor2 = edgeSet_[edge2].right();
-	else
-		neighbor2 = edgeSet_[edge2].left();
-
-	return true;
-}
-
-long
-TeTin::triangleVertexAt(long t, long vertex)
-{
-	long vertices[3];
-	this->triangleVertices ( t, vertices[0],vertices[1],vertices[2] );
-
-	return vertices[vertex];
-}
-
-bool
-TeTin::twoNewTriangles(long t, long v, std::set<long>& triangles)
-{
-//1. Crie o v�rtice vn com os dados da amostra s,
-//	Sint4 vn = nodeId;
-
-//2. Crie 2 novos tri�ngulos t1 e t2,
-	long t1 = triangleSet_.size();
-	long t2 = t1+1;
-
-//3. Crie a nova aresta an0 que conecta os v�rtices vn e v0 e
-//   tem t e t1 como os tri�ngulos que compartilham a aresta.
-	long v0 = this->triangleVertexAt(t,0); //v0 e' o vertice 0 de t
-	edgeSet_.add( TeTinEdge (v, v0, t, t1, NORMALEDGE) );
-	long an0 = edgeSet_.size()-1;
-	vertexSet_[v].setOneEdge (an0);
-
-//4. Crie a nova aresta an1 que conecta os v�rtices vn e v1 e
-// 	tem t1 e t2 como os tri�ngulos que compartilham a aresta.
-	long v1 = this->triangleVertexAt(t,1); //v1 e' o vertice 1 de t
-	edgeSet_.add( TeTinEdge (v, v1, t1, t2, NORMALEDGE) );
-	long an1 = edgeSet_.size()-1;
-
-//5. Crie a nova aresta an2 que conecta os v�rtices vn e v2 e
-//	tem t2 e t como os tri�ngulos que compartilham a aresta.
-	long v2 = this->triangleVertexAt(t,2); //v2 e' o vertice 2 de t
-	edgeSet_.add( TeTinEdge (v, v2, t2, t, NORMALEDGE) );
-	long an2 = edgeSet_.size()-1;
-
-//6. Troque o tri�ngulo t por t1 na aresta a0,
-	long a0 = triangleSet_[t].edgeAt(0); // retorna aresta 0 de t
-	edgeSet_[a0].exchangeTriangle(t,t1);
-
-//7. Defina as arestas de t1 como sendo an0, a0 e an1,
-	triangleSet_.add ( TeTinTriangle (an0, a0, an1) );
-
-//8. Troque o tri�ngulo t por t2 na aresta a1,
-	long a1 = triangleSet_[t].edgeAt(1); // retorna aresta 1 de t
-	edgeSet_[a1].exchangeTriangle(t, t2);
-
-//9. Defina as arestas de t2 como sendo an1, a1 e an2,
-	triangleSet_.add ( TeTinTriangle (an1, a1, an2) );
-
-//10. Defina as arestas de t como sendo an2, a2 e an0,
-	long a2 = triangleSet_[t].edgeAt(2); // retorna aresta 2 de t
-	triangleSet_[t].setEdges(an2, a2, an0);
-
-	triangles.insert(t);
-	triangles.insert(t1);
-	triangles.insert(t2);
-	return true;
-}
-
-long
-TeTin::duplicateTriangle(long t, long n, long v, std::set<long>& triangles)
-{
-// Seja t o tri�ngulo que cont�m cuja n-�sima aresta an � a aresta 
-// pr�xima a amostra s ( n E {0,1,2} ). A aresta an conecta os v�rtices 
-// vn e vj, a aresta aj conecta os v�rtices vj e vk e a aresta ak conecta
-// os v�rtices vk e vn, sendo j o resto da divis�o de n+1 por 3 e k o resto
-// da divis�o de n+2 por 3.
-	long edges[3];
-	triangleSet_[t].edges(edges[0],edges[1],edges[2]);
-
-	long an = edges [ n ];
-	long aj = edges [ (n+1)%3 ];
-	long ak = edges [ (n+2)%3 ];
-
-	long vn = this->triangleVertexAt( t, n );
-
-//	1. Crie o v�rtice v com os dados da amostra s,
-//	2. Defina o tri�ngulo tv que compartilha a aresta an com t,
-	long tv = 0;
-	if (edgeSet_[an].left() == t)
-		tv = edgeSet_[an].right();
-	else if (edgeSet_[an].right() == t)
-		tv = edgeSet_[an].left();
-
-//	3. Defina o v�rtice vop do tri�ngulo t que n�o � conectado a aresta an,
-	long vop = this->triangleVertexAt ( t, (n+2)%3 );
-
-//	4. Crie o novo tri�ngulos t1,
-	long t1 = triangleSet_.size();
-
-//	5. Crie a nova aresta an0 que conecta os v�rtices v e vn e
-//	   tem t1 e tv como os tri�ngulos que compartilham a aresta.
-	edgeSet_.add( TeTinEdge (v, vn, t1, tv, NORMALEDGE) );
-	long an0 = edgeSet_.size()-1;
-
-//	6. Crie a nova aresta an1 que conecta os v�rtices v e vop e
-//	   tem t e t1 como os tri�ngulos que compartilham a aresta.
-	edgeSet_.add( TeTinEdge (v, vop, t, t1, NORMALEDGE) );
-	long an1 = edgeSet_.size()-1;
-
-//	7. Modifique a aresta an para conectar o v�rtice v ao inv�s de vn,
-	edgeSet_[an].exchangeVertex( vn, v );
-	vertexSet_[vn].setOneEdge ( an0 );
-
-//	8. Defina as arestas de t como sendo an, aj e an1,
-	triangleSet_[t].setEdges( an, aj, an1 );
-
-//	9. Modifique a aresta ak para compartilhar o tri�ngulo t1 ao inv�s de t,
-	edgeSet_[ak].exchangeTriangle( t, t1 );
-
-//	10. Defina as arestas de t1 como sendo an0, an1 e ak,
-	triangleSet_.add ( TeTinTriangle (an0, an1, ak) );
-
-	triangles.insert(t);
-	triangles.insert(t1);
-
-	return an0;
-}
-
-bool
-TeTin::dupNeighTriangle(long tv, long an0, long v, std::set<long>& triangles)
-{
-//	11.1. Crie o novo tri�ngulo t2,
-	long t2 = triangleSet_.size();
-
-//	11.2. Defina a aresta av do tri�ngulo tv que cont�m o v�rtice vn
-//	      (obs: s� h� uma aresta porque a outra foi modificada),
-	long vn = edgeSet_[an0].to(); //Due to assembly, dangerous
-	if ( vn == v )
-		vn = edgeSet_[an0].from();
-
-	long edges[3];
-	triangleSet_[tv].edges(edges[0],edges[1],edges[2]);
-	long i;
-	for (i = 0; i < 3; i++)
-	{
-		if ( (edgeSet_[edges[i]].from() == vn) ||
-			 (edgeSet_[edges[i]].to() == vn) )
-			break;
-	}
-	if (i == 3)
-		return false;
-	long av = edges[i];
-
-//	11.3. Defina as outras arestas de tv como sendo av1 e av2.
-	long av1 = edges[ (i+1)%3];
-	long av2 = edges[ (i+2)%3];
-
-//	11.4. Defina o v�rtice vvo conectado a vn por meio da aresta av,
-	long vvo;
-	if (edgeSet_[av].from() == vn)
-		vvo = edgeSet_[av].to();
-	else
-		vvo = edgeSet_[av].from();
-
-//	11.5. Crie a nova aresta an2 que conecta os v�rtices v e vvo e
-//	      tem t e t2 como os tri�ngulos que compartilham a aresta.
-	edgeSet_.add( TeTinEdge (v, vvo, tv, t2, NORMALEDGE) );
-	long an2 = edgeSet_.size()-1;
-
-//	11.6. Troque o tri�ngulo tv por t2 na aresta av,
-	edgeSet_[av].exchangeTriangle( tv, t2 );
-
-//	11.7. Troque o tri�ngulo tv por t2 na aresta an0,
-	edgeSet_[an0].exchangeTriangle( tv, t2 );
-
-//	11.8. Defina as arestas de tv como sendo an2, av1 e av2.
-	triangleSet_[tv].setEdges( an2, av1, av2 );
-
-//	11.9. Defina as arestas de t2 como sendo an0, av e an2,
-	triangleSet_.add ( TeTinTriangle ( an0, av, an2 ) );
-
-	triangles.insert(tv);
-	triangles.insert(t2);
-
-	return true;
-}
-
-void
-TeTin::testDelaunayForVertex(long v, std::set<long>& triangles)
-{
-	while ( triangles.size() )
-	{
-		std::set<long>::iterator i = triangles.begin();
-		long t = *i;
-		triangles.erase(t);
-		this->testDelaunayAt(t, v, triangles);
-	}
-}
-
-bool
-TeTin::testDelaunayAt(long t, long v, std::set<long>& triangles)
-{
-	//	Retrieve line of triangle common to neighbor triangle
-	long e = this->edgeOppVertex (t, v);
-
-//	Retrieve neighbour triangle (tviz) pointer
-	long tviz = edgeSet_[e].left();
-	if ( edgeSet_[e].left() == t )
-		tviz = edgeSet_[e].right();
-	if ( tviz == -1 )
-		return false;
-
-//	Define base triangle (tri) center point
-	TeCoord2D vert[3];
-	this->trianglePoints(t, vert[0], vert[1], vert[2]);
-
-//	Find opposite point to base triangle (tri) inside neighbour (tviz)
-	long vo = this->vertexOppEdge ( tviz, e );
-	TeCoord2D pto = vertexSet_[vo].location();
-
-//	To avoid overflow
-	TeCoord2D ptmin( TeMAXFLOAT, TeMAXFLOAT );
-	long i;
-	for (i = 0; i < 3; i++)
-		if ( vert[i] < ptmin )
-			ptmin = vert[i];
-
-	if ( ! ptmin.tooBig() )
-	{
-		TeCoord2D mptmin ( -ptmin.x(), -ptmin.y() );
-		for (i = 0; i < 3; i++)
-			vert[i] += mptmin;
-		pto += mptmin;
-	}
-
-	TeCoord2D ptc;
-	if ( ! TeFindTriangleCenter( vert[0], vert[1], vert[2], ptc ) )
-		return false;
-
-//	Calculate base triangle (tri) radius
-	double xaux = ptc.x() - vert[0].x();
-	double yaux = ptc.y() - vert[0].y();
-	double raio2 = xaux * xaux + yaux * yaux;
-
-//	Calculate distance from opposite point (tviz) to center point (tri)
-	xaux = ptc.x() - pto.x();
-	yaux = ptc.y() - pto.y();
-	double dist2 = xaux * xaux + yaux * yaux; 
-
-/*	float fr = (float)sqrt(raio2);
-	float fd = (float)sqrt(dist2);
-	if (fr <= fd)
-		return false; */
-
-	if ( raio2 <= dist2 )
-		return false;
-
-	//	If not, change edge between tri and ntri
-	bool status;
-	if ( status = this->swapEdges(t, tviz, e) )
-	{
-		triangles.insert(t);
-		triangles.insert(tviz);
-	}
-	return status;
-}
-
-bool
-TeTin::swapEdges( long t, long tv, long ai )
-{
-	if ( tv == -1 )
-		return false;
-// Seja t o tri�ngulo que cont�m cuja i-�sima aresta ai � a aresta
-//	que se deseja alterar ( i E {0,1,2} ). A aresta ai conecta os
-//	v�rtices vi e vj, a aresta aj conecta os v�rtices vj e vk e a
-//	aresta ak conecta os v�rtices vk e vi, sendo j o resto da divis�o
-//	de i+1 por 3 e k o resto da divis�o de i+2 por 3.
-
-	long tedges[3];
-	triangleSet_[t].edges ( tedges[0], tedges[1], tedges[2] );
-
-	long vertex[3];
-	this->triangleVertices ( t, vertex[0], vertex[1], vertex[2]);
-	long i;
-	for ( i= 0; i < 3; i++ )
-		if ( tedges[i] == ai )
-			break;
-
-	long aj = tedges [ (i+1) % 3 ];
-	long ak = tedges [ (i+2) % 3 ];
-
-	long vi = vertex [ i ];
-	long vj = vertex [ (i+1) % 3 ];
-	long vk = vertex [ (i+2) % 3 ];
-
-// Seja tv o tri�ngulo que compartilha a aresta ai com t. O v�rtice de
-//	tv que n�o � conectado pela aresta ai � o v�rtice vn. As outras
-//	arestas do tri�ngulo tv s�o am que conecta os v�rtices vi e vn e a
-//	aresta an conecta os v�rtices vn e vj.
-	
-	long vn = this->vertexOppEdge ( tv, ai );
-
-	long tvedges [3];
-	triangleSet_[tv].edges ( tvedges[0], tvedges[1], tvedges[2] );
-
-	long am, an = 0;
-	for ( long j = 0; j < 3; j++ )
-	{
-		if ( tvedges [ j ] == ai )
-			continue;
-
-		if ( edgeSet_[tvedges[j]].from() == vn )
-		{
-			if ( edgeSet_[tvedges[j]].to() == vi )
-				am = tvedges [ j ];
-			else if ( edgeSet_[tvedges[j]].to() == vj )
-				an = tvedges [ j ];
-		}
-		else if ( edgeSet_[tvedges[j]].to() == vn )
-		{
-			if ( edgeSet_[tvedges[j]].from() == vi )
-				am = tvedges [ j ];
-			else if ( edgeSet_[tvedges[j]].from() == vj )
-				an = tvedges [ j ];
-		}
-	}
-
-	TeCoord2D ptaux;
-	double tol = TePrecision::instance().precision();
-	if ( TePerpendicularDistance(vertexSet_[vk].location(), vertexSet_[vn].location(),
-								 vertexSet_[vi].location(), ptaux) < tol )
-		return false;
-	if ( TePerpendicularDistance(vertexSet_[vk].location(), vertexSet_[vn].location(),
-								 vertexSet_[vj].location(), ptaux) < TePrecision::instance().precision() )
-		return false;
-
-//	1. Se o segmento de reta formado conectando o v�rtice vk do
-//	   tri�ngulo t ao v�rtice vn de tv intersecta a aresta ai, fa�a:
-	TeCoord2D pi;
-	if (TeSegmentsIntersectPoint(vertexSet_[vi].location(), vertexSet_[vj].location(), vertexSet_[vk].location(), vertexSet_[vn].location(), pi) == false )
-		return false;
-
-//		1.1. Troque na aresta ai o v�rtice vi pelo vertice vk e o
-//			 v�rtice vj pelo v�rtice vn.
-	edgeSet_[ai].exchangeVertex ( vi, vk );
-	edgeSet_[ai].exchangeVertex ( vj, vn );
-
-	if ( vertexSet_[vi].oneEdge() == ai )
-		vertexSet_[vi].setOneEdge ( ak );
-	if ( vertexSet_[vj].oneEdge() == ai )
-		vertexSet_[vj].setOneEdge ( aj );
-
-//		1.2. Troque na aresta an o tri�ngulo tv pelo tri�ngulo t.
-	edgeSet_[an].exchangeTriangle( tv , t );
-
-//		1.3. Troque na aresta ak o tri�ngulo t pelo tri�ngulo tv.
-	edgeSet_[ak].exchangeTriangle( t, tv );
-
-//		1.4. Troque no tri�ngulo t a aresta ai pela aresta an e a
-//			 aresta ak pela aresta ai.
-	for ( i = 0; i < 3; i++ )
-		if ( tedges[i] == ai )
-			break;
-	tedges[i] = an;
-	tedges[(i+2)%3] = ai;
-	triangleSet_[t].setEdges ( tedges[0], tedges[1], tedges[2] );
-
-//		1.5. Troque no tri�ngulo tv a aresta ai pela aresta ak
-	for ( i = 0; i < 3; i++ )
-		if ( tvedges[i] == ai )
-			break;
-	tvedges [i] = ak;
-
-//		 e a aresta an pela aresta ai.
-	for ( i = 0; i < 3; i++ )
-		if (tvedges[i] == an )
-			break;
-	tvedges[i] = ai;
-
-	triangleSet_[tv].setEdges ( tvedges[0], tvedges[1], tvedges[2] );
-
-	return true;
-}
-
-bool
-TeTin::edgesInterBySegment( TeCoord2D& pf, TeCoord2D& pn, std::list<long> &aiset, std::list<long> &viset )
-{
-//		Seja o segmento de reta r que conecta os pontos pf  e pn,
-//1.	Defina o tri�ngulo tf que cont�m o ponto pf,
-	long tf = this->triangleAt (pf);
-	if (tf == -1)
-		return false;
-
-//2.	Defina o v�rtice vaux e aresta aaux, como sendo inv�lidos,
-	long vaux = -1;
-	long aaux = -1;
-
-//3.	Defina o conjunto A={a1, a2, a3} com as arestas de tf,
-	std::vector<long> auxset(3);
-	triangleSet_[tf].edges ( auxset[0], auxset[1], auxset[2] );
-	std::list<long> aedges ( auxset.begin(), auxset.end() );
-
-//4.	Defina o conjunto V={v1, v2, v3} com os v�rtices de tf,
-	this->triangleVertices ( tf, auxset[0], auxset[1], auxset[2]);
-	std::list <long> vvertex ( auxset.begin(), auxset.end() );
-
-//5.	Defina o conjunto T={tf},
-	std::list<long> triset( 1, tf );
-	std::set<long> visetaux;
-
-//6.	Para cada v�rtice vi de V, fa�a:
-	std::list<long>::iterator vii;
-	for (vii = vvertex.begin(); vii != vvertex.end(); vii++)
-	{
-		long vi = *vii;
-		TeCoord2D ptvi = vertexSet_[vi].location();
-		TeCoord2D pinter;
-
-//6.1.	Se o v�rtice vi coincide com pf, fa�a:
-		if ( ptvi == pf )
-		{
-//6.1.1.	Redefina A={a1,...,an} com as n arestas opostas a vi,
-			aedges.clear();
-			this->vertexOppEdges(vi, aedges);
-
-//6.1.2.	Redefina V={v1,...,vm} com os m v�rtices dos tri�ngulos que cont�m o v�rtice vi,
-			vvertex.clear();
-			this->vertexOppVertices(vi, vvertex);
-
-//6.1.3.	Redefina o conjunto T={t1,..., tm} com os m tri�ngulos que compartilham o v�rtice vi,
-			triset.clear();
-			this->vertexTriangles(vi, triset);
-
-//6.1.4.	Redefina o v�rtice auxiliar vaux como sendo vi,
-			vaux = vi;
-			visetaux.insert(vi);
-//6.1.5.	V� para 8,
-			break;
-		}
-	}
-	if ( vii == vvertex.end() )
-	{
-//7.	Para cada aresta ai de A, fa�a:
-		for (std::list<long>::iterator aii = aedges.begin(); aii != aedges.end(); aii++)
-		{
-			long ai = *aii;
-//7.1.	Se o ponto pf est� sobre ai, fa�a:
-			TeCoord2D pfr = vertexSet_[edgeSet_[ai].from()].location();
-			TeCoord2D pto = vertexSet_[edgeSet_[ai].to()].location();
-			TeCoord2D pinter;
-			if ( TePerpendicularDistance(pfr, pto, pf, pinter) < TePrecision::instance().precision() )
-			{
-//7.1.1.	Defina o tri�ngulo tv que compartilha ai com tf,
-				long tv = edgeSet_[ai].right();
-				if (tv == tf)
-					tv = edgeSet_[ai].left();
-				if (tv == -1)
-					return false;
-//7.1.2.	Redefina V={v1, v2, v3, v4} com os v�rtices de tv e tf,
-				vvertex.clear();
-				this->triangleVertices ( tv, auxset[0], auxset[1], auxset[2]);
-				vvertex.insert( vvertex.begin(), auxset.begin(), auxset.end() );
-				this->triangleVertices ( tf, auxset[0], auxset[1], auxset[2]);
-				vvertex.insert( vvertex.begin(), auxset.begin(), auxset.end() );
-				vvertex.sort();
-				vvertex.unique();
-//7.1.3.	Redefina A={a1, a2, a3, a4} com as arestas de tv e tf diferentes de ai,
-				aedges.clear();
-				triangleSet_[tv].edges ( auxset[0], auxset[1], auxset[2] );
-				aedges.insert( aedges.begin(), auxset.begin(), auxset.end() );
-				aedges.remove(ai);
-				triangleSet_[tf].edges ( auxset[0], auxset[1], auxset[2] );
-				aedges.insert( aedges.begin(), auxset.begin(), auxset.end() );
-				aedges.remove(ai);
-
-//7.1.4.	Redefina o conjunto T={tv, tf},
-				triset.push_back ( tv );
-//7.1.5.	Redefina a aresta auxiliar aaux como sendo ai,
-				aiset.push_back ( ai );
-				aaux = ai;
-//7.1.6.	V� para 8,
-				break;
-			}
-		}
-	}
-
-	for (;;)
-	{
-//8.	Para cada tri�ngulo ti de T, fa�a:
-		std::list<long>::iterator tii;
-		for ( tii = triset.begin(); tii != triset.end(); tii++)
-		{
-			long ti = *tii;
-//8.1.1.	Se o tri�ngulo ti cont�m o ponto pn, termine o algoritmo.
-			if ( this->triangleContainsPoint( ti, pn ) )
-				return true;
-		}
-//9.	Para cada v�rtice vi de V, fa�a:
-		std::list<long>::iterator vii;
-		for (vii = vvertex.begin(); vii != vvertex.end(); vii++)
-		{
-			long vi = *vii;
-			TeCoord2D ptvi = vertexSet_[vi].location();
-//9.1.	Se vi coincide com pn, fa�a:
-			if ( ptvi == pn )
-			{
-//9.1.1.	Insira o v�rtice vi no conjunto VI de v�rtices intersectados,
-				viset.push_back ( vi );
-//9.1.2.	Termine o algoritmo.
-				break;
-			}
-		}
-		if ( vii != vvertex.end() )
-			break; // do for (;;)
-
-//10.	Para cada v�rtice vi de V, fa�a:
-		for ( vii = vvertex.begin(); vii != vvertex.end(); vii++)
-		{
-			long vi = *vii;
-//10.1.	Se vi � diferente de vaux e est� sobre r, fa�a:
-			if ( vi != vaux )
-			{
-				TeCoord2D ptvi = vertexSet_[vi].location();
-				TeCoord2D pinter;
-				if ( TePerpendicularDistance(pf, pn, ptvi, pinter) < TePrecision::instance().precision() )
-				{
-					TeBox box1;
-					updateBox (box1, pf);
-					updateBox (box1, pn);
-					if (TeWithin (pinter, box1) )
-					{
-//10.1.1.	Redefina o conjunto A={a1,..., an} com as n arestas opostas a vi, excluindo as arestas de AI,
-						aedges.clear();
-						this->vertexOppEdges(vi, aedges);
-						std::list<long>::iterator aisi;
-						for ( aisi = aiset.begin(); aisi != aiset.end(); aisi++)
-							aedges.remove ( *aisi );
-//10.1.2.	Redefina o conjunto V={v1,..., vm} com os m v�rtices dos tri�ngulos que cont�m o v�rtice vi,
-//			excluindo os vertices de Vi,
-						vvertex.clear();
-						this->vertexOppVertices(vi, vvertex);
-						std::list<long>::iterator visi;
-						for ( visi = viset.begin(); visi != viset.end(); aisi++)
-							viset.remove ( *visi );
-//101.3.	Redefina o conjunto T={t1, ..., tk } com os k tri�ngulos que cont�m o v�rtice vi,
-						triset.clear();
-						this->vertexTriangles(vi, triset);
-//101.4.	Insira o v�rtice vi no conjunto VI de v�rtices intersectados,
-						viset.push_back ( vi );
-//101.5.	Defina o conjunto Ac={a1,..., aj} com as j arestas que cont�m vi, diferentes de aaux,
-//101.6.	Insira as arestas de Ac no conjunto AI de arestas intersectadas,
-						this->vertexEdges(vi, aiset);
-						aiset.sort();
-						aiset.unique();
-//10.7.	Redefina o v�rtice auxiliar vaux como sendo vi,
-						vaux = vi;
-//10.8.	Retorne a 8,
-						break;
-					}
-				}
-			}
-		}
-		if ( vii != vvertex.end() )
-			continue; // do for (;;)
-
-//11.	Para cada aresta ai de A, fa�a:
-		std::list<long>::iterator aii;
-		for (aii = aedges.begin(); aii != aedges.end(); aii++)
-		{
-			long ai = *aii;
-//11.1.	Se o ponto pn est� sobre ai, fa�a:
-			TeCoord2D pfr = vertexSet_[edgeSet_[ai].from()].location();
-			TeCoord2D pto = vertexSet_[edgeSet_[ai].to()].location();
-			TeCoord2D pinter;
-			if ( TePerpendicularDistance(pfr, pto, pn, pinter) < TePrecision::instance().precision() )
-			{
-				TeBox box1;
-				updateBox (box1, pfr);
-				updateBox (box1, pto);
-				if (TeWithin (pinter, box1) )
-				{
-//11.1.1.	Insira a aresta ai no conjunto AI de arestas intersectadas,
-					aiset.push_back ( ai );
-//11.1.2.	Termine o algoritmo.
-					break;
-				}
-			}
-		}
-		if ( aii != aedges.end() )
-			break; // do for (;;)
-
-//12.	Para cada aresta ai de A, fa�a:
-		for (aii = aedges.begin(); aii != aedges.end(); aii++)
-		{
-			long ai = *aii;
-			TeCoord2D pinter;
-			long vt = edgeSet_[ai].to();
-			long vf = edgeSet_[ai].from();
-//12.1.	Se ai intersecta r, fa�a:
-			if ( TeSegmentsIntersectPoint(vertexSet_[vt].location(), vertexSet_[vf].location(), pf, pn, pinter) )
-			{
-//12.1.1.	Insira a aresta ai no conjunto AI de arestas intersectadas,
-				aiset.push_back ( ai );
-//12.1.2.	Defina os tri�ngulos t1 e t2 que compartilham a aresta ai.
-//12.1.3.	Se t2 est� contido no conjunto T , ent�o fa�a taux=t1,
-				long taux = edgeSet_[ai].left();
-				if (taux == -1)
-					return false;
-				std::list<long>::iterator pos1 = find (triset.begin(), triset.end(), taux);
-				if ( pos1 != triset.end() )
-//12.1.4.	Sen�o, fa�a taux=t2,
-					taux = edgeSet_[ai].right();
-				if (taux == -1)
-					return false;
-//12.1.5.	Se o tri�ngulo taux cont�m o ponto pn, termine o algoritmo.
-				if ( this->triangleContainsPoint( taux, pn ) )
-					return true;
-//12.1.6.	Redefina o conjunto A={a1, a2} com as arestas do tri�ngulo taux diferentes de ai,
-				triangleSet_[taux].edges ( auxset[0], auxset[1], auxset[2] );
-				aedges.clear();
-				aedges.insert( aedges.begin(), auxset.begin(), auxset.end() );
-				aedges.remove( ai );
-//12.1.7.	Redefina o conjunto V={v1}. O v�rtice v1 � o v�rtice do tri�ngulo taux que n�o est�
-//			em nenhuma extremidade da aresta ai,
-				long vaux1 = edgeSet_[ai].from();
-				long vaux2 = edgeSet_[ai].to();
-				this->triangleVertices ( taux, auxset[0], auxset[1], auxset[2]);
-				vvertex.clear();
-				vvertex.insert ( vvertex.begin(), auxset.begin(), auxset.end() );
-				vvertex.remove ( vaux1 );
-				vvertex.remove ( vaux2 );
-
-//12.1.8.	Redefina o conjunto T={taux},
-				triset.clear();
-				triset.push_back ( taux );
-//12.1.9.	Redefina aaux como sendo ai,
-				aaux = ai;
-//12.1.10.	Retorne a 8;
-				break;
-			}
-		}
-	} // Do for (;;)
-	return true;
-}
-
-bool
-TeTin::insertSegment( TeCoord2D& pf, TeCoord2D& pn )
-{
-	if ( this->insertPoint( pf.x(), pf.y(), 100.) )
-	{
-		if ( this->insertPoint( pn.x(), pn.y(), 100.) )
-		{
-			std::list<long> aiset;
-			std::list<long> viset;
-			if ( this->edgesInterBySegment( pf, pn, aiset, viset ) )
-			{
-				if ( viset.size() == 0 )
-				{
-					while ( aiset.size() > 0 )
-					{
-//2.	Para cada aresta ai de A, fa�a:
-						std::list<long>::iterator aii;
-						for (aii = aiset.begin(); aii != aiset.end(); aii++)
-						{
-							long ai = *aii;
-//2.1.	Defina os tri�ngulos td e te compartilham ai,
-							long td = edgeSet_[ai].right();
-							long te = edgeSet_[ai].left();
-//2.2.	Defina os v�rtices vm e vn dos tri�ngulos td e te que n�o est�o sobre a aresta ai,
-							long vn = this->vertexOppEdge(td, ai);
-							long vm = this->vertexOppEdge(te, ai);
-//2.3.	Se r n�o intersecta o segmento que conecta os v�rtices vm e vn, fa�a:
-							TeCoord2D pi;
-							if ( TeSegmentsIntersectPoint(vertexSet_[vn].location(), vertexSet_[vm].location(), pf, pn, pi) )
-							{
-//2.3.1.	Se ai intersecta o segmento que conecta os v�rtices vm e vn, fa�a:
-								if ( this->swapEdges( td, te, ai ) )
-								{
-//2.3.1.1.	Redefina ai como sendo o segmento que conecta os v�rtices vm e vn,
-//2.3.1.2.	Redefina adequadamente os tri�ngulos tv e tf,
-//2.3.1.3.	Remova a aresta ai de A,
-									aiset.remove(ai);
-									break;
-								}
-							}
-						}
-						if ( aii != aiset.end() )
-							continue;
-//3.	Se n�o h� mais arestas em A, ent�o:
-//3.1.	Termine o algoritmo.
-//4.	Para cada aresta ai de A, fa�a:
-						aii = aiset.begin();
-						while ( aii != aiset.end() )
-						{
-							long ai = *aii;
-//4.1.	Defina os tri�ngulos td e te compartilham ai,
-							long td = edgeSet_[ai].right();
-							long te = edgeSet_[ai].left();
-//4.2.	Defina os v�rtices vm e vn dos tri�ngulos td e te que n�o est�o sobre a aresta ai,
-//4.3.	Se ai intersecta o segmento que conecta os v�rtices vm e vn, fa�a:
-							if ( this->swapEdges( td, te, ai ) )
-							{
-//4.3.1.	Redefina ai como sendo o segmento que conecta os v�rtices vm e vn,
-//4.3.2.	Redefina adequadamente os tri�ngulos tv e tf,
-								TeCoord2D pinter;
-								long vt = edgeSet_[ai].to();
-								long vf = edgeSet_[ai].from();
-								TeCoord2D pi;
-								if ( ( vertexSet_[vt].location() == pf ) ||
-									 ( vertexSet_[vf].location() == pf ) ||
-									 ( vertexSet_[vt].location() == pn ) ||
-									 ( vertexSet_[vf].location() == pn ) ||
-									 ( TeSegmentsIntersectPoint(vertexSet_[vt].location(), vertexSet_[vf].location(), pf, pn, pi) == false ))
-								{
-//4.3.3.	Se ai n�o intersecta r, fa�a:
-//4.3.3.1.	Remova a aresta ai de A
-									aiset.remove(ai);
-									aii = aiset.begin();
-								}
-								else
-									aii++;
-							}
-							else
-								aii++;
-						}
-//4.3.3.	Retorne a 2.
-					}
-					return true;
-				}
-			}
-		}
-	}
-	return false;
-}
-
-bool
-TeTin::createInitialTriangles(TeBox &box)
-{
-	// Make box 1% bigger
-	zoomOut(box, 1./1.01);
-
-	//	Create and insert initial nodes of the Tin
- 	vertexSet_.add( TeTinVertex (box.lowerLeft(), TeMAXFLOAT, NORMALVERTEX, 0 ) ); //v0
- 	vertexSet_.add( TeTinVertex (TeCoord2D(box.x1(),box.y2()), TeMAXFLOAT, NORMALVERTEX, 1 ) ); //v1
- 	vertexSet_.add( TeTinVertex (box.upperRight(), TeMAXFLOAT, NORMALVERTEX, 2 ) ); //v2
- 	vertexSet_.add( TeTinVertex (TeCoord2D(box.x2(),box.y1()), TeMAXFLOAT, NORMALVERTEX, 3 ) ); //v3
-
-//	Create and insert initial lines of the Tin
-	edgeSet_.add( TeTinEdge (0, 1, -1, 0, NORMALEDGE) ); //a0
-	edgeSet_.add( TeTinEdge (1, 2, -1, 0, NORMALEDGE) ); //a1
-	edgeSet_.add( TeTinEdge (2, 3, -1, 1, NORMALEDGE) ); //a2
-	edgeSet_.add( TeTinEdge (3, 0, -1, 1, NORMALEDGE) ); //a3
-	edgeSet_.add( TeTinEdge (0, 2,  0, 1, NORMALEDGE) ); //a4
-
-//	Create the two initial triangles of the Tin
-//	Update triangles edges
-	triangleSet_.add ( TeTinTriangle (0, 1, 4) );
-	triangleSet_.add ( TeTinTriangle (2, 3, 4) );
-
-	return true;
-}
-
-bool
-TeTin::insertLineSamples ( TeContourLine& line )
-{
-	TeLineSimplify(line, 20., 200.);
-	unsigned long i;
-	for ( i = 0; i < line.size(); i++ )
-	{
-		TeCoord2D pt = line[i];
-		this->insertPoint(pt.x(), pt.y(), line.value());
-	}
-	return true;
-}
-
-bool
-TeTin::isEdgeTriangle (long t)
-{
-	long neighids[3];
-	this->triangle3Neighbors(t, neighids[0],neighids[1],neighids[2]);
-
-	long i;
-	for (i = 0; i < 3; i++)
-		if ( neighids[i] == -1)
-			return true;
-	return false;
-}
-
-void
-TeTin::convexize ()
-{
-	unsigned long eii;
-
-	for (eii = 0; eii < edgeSet_.size(); eii++)
-	{
-		TeTinEdge ei = this->edge(eii);
-		if ((this->vertex(ei.from()).value() > TeTinBIGFLOAT ) ||
-			(this->vertex(ei.to  ()).value() > TeTinBIGFLOAT ) )
-		{
-			if ((this->vertex(ei.from()).value() > TeTinBIGFLOAT ) && 
-				(this->vertex(ei.to  ()).value() > TeTinBIGFLOAT ) )
-				continue;
-			else
-			{
-				long td = ei.right();
-				long te = ei.left();
-				if ( ! this->isEdgeTriangle(td) || ! this->isEdgeTriangle(te) )
-					this->swapEdges( td, te, eii );
-			}
-		}
-	}
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeTin.h"
+#include "TeStdFile.h"
+#include "TeException.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeUtils.h"
+//#include "geo.h"
+
+#include <iostream>
+#include <fstream>
+#include <algorithm>
+
+// TeTinTriangleSet
+
+bool
+TeTinTriangleSet::loadFromFile(std::string &fileName)
+{
+//	Open tin triangles file
+	std::string trianglesFile = fileName;
+	trianglesFile += ".tpl";
+
+	std::ifstream inStream;
+	inStream.open( trianglesFile.data(), std::ios::in | std::ios::binary );
+
+	if (! inStream.good() )
+		return false;
+
+	long laux;
+//#if defined(SPRWIN) || defined(LITTLEENDIAN) - File is saved in LITTLEENDIAN
+	inStream.read((char*)&laux, sizeof(long));
+	long numTriangles = laux;
+
+//	Create and std::set tin triangles std::vector
+	if ( this->size () )
+		this->clear ();
+	this->reserve (numTriangles);
+
+//	Read file for triangles data load
+	long lineid [3];
+	for (long i = 0; i < numTriangles; i++)
+	{
+		for (long j = 0; j < 3; j++)
+		{
+			if (! inStream.good() )
+				return false;
+			inStream.read((char*)&laux, sizeof(long));
+			lineid[j] = laux;
+		}
+		this->add ( TeTinTriangle (lineid[0],lineid[1],lineid[2]) );
+	}
+	return true;
+}
+
+bool
+TeTinVertexSet::loadFromFile(std::string &fileName)
+{
+//	Open tin vertices file
+	std::string verticesFile = fileName;
+	verticesFile += ".tnd";
+
+	std::ifstream inStream;
+	inStream.open( verticesFile.data(), std::ios::in | std::ios::binary );
+
+	if (! inStream.good() )
+		return false;
+
+	long laux;
+//#if defined(SPRWIN) || defined(LITTLEENDIAN) - File is saved in LITTLEENDIAN
+	inStream.read((char*)&laux, sizeof(long));
+	long numVertices = laux;
+
+//	Create and std::set tin vertices std::vector
+	if ( this->size () )
+		this->clear ();
+	this->reserve (numVertices);
+
+//	Read file for vertices data load
+	double x, y;
+	double value;
+	short vertexType;
+	for (long i = 0; i < numVertices; i++)
+	{
+		if (! inStream.good() )
+			return false;
+		inStream.read((char*)&x, sizeof(double));
+		if (! inStream.good() )
+			return false;
+		inStream.read((char*)&y, sizeof(double));
+		if (! inStream.good() )
+			return false;
+		inStream.read((char*)&value, sizeof(double));
+		if (! inStream.good() )
+			return false;
+		inStream.read((char*)&vertexType, sizeof(short));
+		this->add( TeTinVertex (TeCoord2D (x,y), value,
+			(TeTinVertexType) vertexType, -1 ) );
+	}
+	return true;
+}
+
+bool
+TeTinEdgeSet::loadFromFile(std::string &fileName)
+{
+//	Open tin edges file
+	std::string edgesFile = fileName;
+	edgesFile += ".tln";
+
+	std::ifstream inStream;
+	inStream.open( edgesFile.data(), std::ios::in | std::ios::binary );
+
+	if (! inStream.good() )
+		return false;
+
+	long laux;
+//#if defined(SPRWIN) || defined(LITTLEENDIAN) - File is saved in LITTLEENDIAN
+	inStream.read((char*)&laux, sizeof(long));
+	long numEdges = laux;
+
+//	Create and std::set tin edges std::vector
+	if ( this->size () )
+		this->clear ();
+	this->reserve (numEdges);
+
+//	Read file for edges data load
+	long from, to, left, right;
+	for (long i = 0; i < numEdges; i++)
+	{
+		if (! inStream.good() )
+			return false;
+		inStream.read((char*)&from, sizeof(long));
+		if (! inStream.good() )
+			return false;
+		inStream.read((char*)&to, sizeof(long));
+
+		if (! inStream.good() )
+			return false;
+		inStream.read((char*)&left, sizeof(long));
+		if (! inStream.good() )
+			return false;
+		inStream.read((char*)&right, sizeof(long));
+
+		this->add( TeTinEdge (from, to, left, right, NORMALEDGE) );
+	}
+	return true;
+}
+
+
+// TeTin
+
+bool
+TeTin::loadFromFile(std::string &fileName)
+{
+	if ( triangleSet_.loadFromFile ( fileName ) )
+	{
+		if ( vertexSet_.loadFromFile ( fileName ) )
+		{
+			if ( edgeSet_.loadFromFile ( fileName ) )
+				return true;
+		}
+	}
+	return false;
+}
+
+bool
+TeTin::getLines(TeLineSet &lineSet)
+{
+	std::vector<TeTinEdge>::iterator i = edgeSet_.begin();
+	while ( i != edgeSet_.end() )
+	{
+		long from = (*i).from();
+		long to = (*i).to();
+		TeCoord2D ptf = vertexSet_[from].location();
+		TeCoord2D ptt = vertexSet_[to].location();
+		i++;
+
+		TeLine2D line;
+		line.add (ptf);
+		line.add (ptt);
+		lineSet.add(line);
+	}
+	return true;
+}
+
+long
+TeTin::oneEdgeWithVertex(long v)
+{
+	long vsize = vertexSet_.size();
+	long edge;
+	if (v < vsize)
+	{
+		TeTinVertex vv = vertexSet_[v];
+		edge = vv.oneEdge();
+	}
+	else
+		return -1;
+
+	// Test to make sure there is no wrong index
+	if ( edge != -1 )
+		if ( ( edgeSet_[edge].to() == v ) ||
+			 ( edgeSet_[edge].from() == v ) )
+		return edge;
+
+	//Fail safe code, must return from previous code
+	static long	oldedge = 0;	// Set one edge only once
+
+	long j = 0;
+	while (j < 2)
+	{
+		unsigned long i;
+		for (i = oldedge; i < edgeSet_.size(); i++)
+		{
+			long from = edgeSet_[i].from();
+			long to   = edgeSet_[i].to();
+			if ( from == -1 || to == -1 )
+				continue;
+			if (from == v || to == v)
+			{
+				oldedge = i;
+				return i;
+			}
+		}
+		oldedge = 0;
+		j++;
+	}
+	return -1;
+}
+
+long
+TeTin::edgeOppVertex(TeTinTriangle& t, long v)
+{
+	long edges[3];
+	t.edges(edges[0],edges[1],edges[2]);
+
+	for (long i = 0; i < 3; i++)
+	{
+		if ( edgeSet_[edges[i]].from() != v &&
+		     edgeSet_[edges[i]].to()   != v )
+			return edges[i];
+	}
+	return -1;
+}
+
+long
+TeTin::vertexOppEdge(long t, long e)
+{
+	long edges[3];
+	triangleSet_[t].edges(edges[0],edges[1],edges[2]);
+
+	long vef(-1), vet(-1);
+	unsigned long i;
+	for (i = 0; i < 3; i++)
+	{
+		if ( edges[i] == e )
+		{
+			vef = edgeSet_[edges[i]].from();
+			vet = edgeSet_[edges[i]].to();
+			break;
+		}
+	}
+	if ( vef == -1 )
+		return -1;
+
+	for (i = 0; i < 3; i++)
+	{
+		if ( edges[i] != e )
+		{
+			if ( vef == edgeSet_[edges[i]].from() ||
+			     vet == edgeSet_[edges[i]].from() )
+				return edgeSet_[edges[i]].to();
+			if ( vef == edgeSet_[edges[i]].to() ||
+			     vet == edgeSet_[edges[i]].to() )
+				return edgeSet_[edges[i]].from();
+			return -1;
+		}
+	}
+	return -1;
+}
+
+long
+TeTin::edgeWithVertexDiffFromEdge(long t, long v, long e)
+{
+	long edges[3];
+	triangleSet_[t].edges(edges[0],edges[1],edges[2]);
+
+	for (long i = 0; i < 3; i++)
+	{
+		if ( edges[i] == e )
+			continue;
+		if ( edgeSet_[edges[i]].from() == v ||
+		     edgeSet_[edges[i]].to()   == v )
+			return edges[i];
+	}
+	return -1;
+}
+
+bool
+TeTin::vertexOppEdges(long v, std::list<long> &edges)
+{
+//	Find one line that contains node
+	long a = oneEdgeWithVertex(v);
+	if (a == -1)
+		return false;
+
+//	1. Defina td como sendo o triângulo que está à direita da aresta a e
+	long td = edgeSet_[a].right(); // te como sendo o triângulo que está
+	long te = edgeSet_[a].left();  // à esquerda de a,
+
+	long ai = a; // 2. Defina ai como sendo aresta a 
+	long ti = td;//    e ti como sendo o triângulo td,
+
+	long ao;
+ 
+	if ( ti != -1 ) // 3. Se o triângulo ti não for nulo,
+	{				//    insira aresta ao de ti que não é diretamente
+		ao = edgeOppVertex ( ti, v );// conectado a v no conjunto A,
+		if (ao == -1)
+			return false;
+		edges.push_back (ao);
+	}
+
+	while (ti != te)// 4. Enquanto ti for diferente do triângulo te,
+	{
+		if (ti == -1)//	4.1. Se o triângulo ti é nulo (esta' na
+		{			 //  borda da triangulação) faça:
+			ti = te; //	 4.1.1. Defina ti como sendo o triângulo te,
+			te = -1; //  4.1.2. Defina te como sendo nulo,
+			ai = a;  //  4.1.3. Defina ai como sendo aresta a,
+			if ( ti != -1 ) // 4.1.4. Se o triângulo ti não for nulo,
+			{				// insira aresta ao de ti que não é diretamente
+				ao = edgeOppVertex ( ti, v );// conectado a v
+				if (ao == -1)
+					return false;
+				edges.push_back (ao); // a v no conjunto A,
+			}
+			continue;//	 4.1.5. Retorne a 4.
+		}
+
+		long aaux = edgeWithVertexDiffFromEdge ( ti, v, ai );// 4.2. Defina a
+		if (aaux == -1)	 // aresta aaux do triângulo ti que conecta o
+			return false;// vértice v e é diferente de ai,
+
+		long taux;
+		if (edgeSet_[aaux].right() == ti) // 4.3. Defina taux como sendo  
+			taux = edgeSet_[aaux].left();//  o triângulo que compartilha
+		else if (edgeSet_[aaux].left() == ti)// a aresta aaux com ti,
+			taux = edgeSet_[aaux].right();
+		else
+			return false;
+
+		ti = taux;// 4.4. Defina ti como sendo o triângulo taux e ai 
+		ai = aaux;//	  como sendo aresta aaux,
+
+		if ( ti != -1 )// 4.5. Se o triângulo ti não for nulo, insira
+		{			   //      aresta ao de ti que não é diretamente
+			ao = edgeOppVertex ( ti, v ); // conectado a v
+			if (ao == -1)							// no conjunto A,
+				return false;
+			edges.push_back (ao);
+		}
+	} // 4.6. Retorne a 4.
+	return true;
+}
+
+bool
+TeTin::vertexEdges(long v, std::list<long> &edges)
+{
+//	Find one line that contains node
+	long a = oneEdgeWithVertex(v);
+	if (a == -1)
+		return false;
+
+//	1. Defina td como sendo o triângulo que está à direita da aresta a e
+	long td = edgeSet_[a].right(); // te como sendo o triângulo que está
+	long te = edgeSet_[a].left();  // à esquerda de a,
+
+	long ai = a; // 2. Defina ai como sendo aresta a 
+	long ti = td;//    e ti como sendo o triângulo td,
+
+	edges.push_back (ai);//	3. Insira a aresta ai no conjunto A,
+
+	while (ti != te)//	4. Enquanto ti for diferente do triângulo te,
+	{
+		if (ti == -1)
+		{// 4.1. Se o triângulo ti é nulo (esta' na borda da triangulação) faça:
+			ti = te;// 4.1.1. Defina ti como sendo o triângulo te,
+			te = -1;// 4.1.2. Defina te como sendo nulo,
+			ai = a;// 4.1.3. Defina ai como sendo aresta a,
+			continue;// 4.1.4. Retorne a 4.
+		}
+
+		long aaux = edgeWithVertexDiffFromEdge ( ti, v, ai );// 4.2. Defina a
+		if (aaux == -1)	 // aresta aaux do triângulo ti que conecta o
+			return false;// vértice v e é diferente de ai,
+
+		long taux;
+		if (edgeSet_[aaux].right() == ti) // 4.3. Defina taux como sendo  
+			taux = edgeSet_[aaux].left();//  o triângulo que compartilha
+		else if (edgeSet_[aaux].left() == ti)// a aresta aaux com ti,
+			taux = edgeSet_[aaux].right();
+		else
+			return false;
+
+		ti = taux;// 4.4. Defina ti como sendo o triângulo taux e ai 
+		ai = aaux;//	  como sendo aresta aaux,
+
+		edges.push_back (ai);// 4.5. Se o triângulo ti não for nulo, insira
+	} // 4.6. Retorne a 4.
+	return true;
+}
+
+bool
+TeTin::vertexOppVertices(long v, std::list<long> &vertices)
+{
+//	Find one line that contains node
+	long a = oneEdgeWithVertex(v);
+	if (a == -1)
+		return false;
+
+//	1. Defina td como sendo o triângulo que está à direita da aresta a e
+	long td = edgeSet_[a].right(); // te como sendo o triângulo que está
+	long te = edgeSet_[a].left();  // à esquerda de a,
+
+	long ai = a; // 2. Defina ai como sendo aresta a 
+	long ti = td;//    e ti como sendo o triângulo td,
+
+	long vi = edgeSet_[a].from();// 3. Insira o vértice diferente de v
+	if (vi == v)				// conectado à aresta ai no conjunto V,
+		vi = edgeSet_[a].to();
+	vertices.push_back (vi);
+
+	while (ti != te)// 4. Enquanto ti for diferente do triângulo te,
+	{
+		if (ti == -1)// 4.1. Se o triângulo ti é nulo (esta' na borda 
+		{			 // da triangulação) faça:
+			ti = te; //	4.1.1. Defina ti como sendo o triângulo te,
+			te = -1; //	4.1.2. Defina te como sendo nulo,
+			ai = a;  //	4.1.3. Defina ai como sendo aresta a,
+			continue;//	4.1.4. Retorne a 4.
+		}
+
+		long aaux = edgeWithVertexDiffFromEdge ( ti, v, ai );// 4.2. Defina a
+		if (aaux == -1)	 // aresta aaux do triângulo ti que conecta o
+			return false;// vértice v e é diferente de ai,
+
+		long taux;
+		if (edgeSet_[aaux].right() == ti) // 4.3. Defina taux como sendo  
+			taux = edgeSet_[aaux].left();//  o triângulo que compartilha
+		else if (edgeSet_[aaux].left() == ti)// a aresta aaux com ti,
+			taux = edgeSet_[aaux].right();
+		else
+			return false;
+
+		ti = taux;// 4.4. Defina ti como sendo o triângulo taux e ai 
+		ai = aaux;//	  como sendo aresta aaux,
+
+		vi = edgeSet_[ai].from();//	4.5. Insira o vértice diferente
+		if (vi == v)	// de v conectado à aresta ai no conjunto V,
+			vi = edgeSet_[ai].to();
+		vertices.push_back (vi);
+	}//	4.6. Retorne a 4.
+	return true;
+}
+
+bool
+TeTin::vertexTriangles(long v, std::list<long> &triangles)
+{
+//	Find one line that contains node
+	long a = oneEdgeWithVertex(v);
+	if (a == -1)
+		return false;
+
+//	1. Defina td como sendo o triângulo que está à direita da aresta a e
+	long td = edgeSet_[a].right(); // te como sendo o triângulo que está
+	long te = edgeSet_[a].left();  // à esquerda de a,
+
+	long ai = a; // 2. Defina ai como sendo aresta a 
+	long ti = td;//    e ti como sendo o triângulo td,
+ 
+	if ( ti != -1 ) // 3. Se o triângulo ti não for nulo,
+	{				//    insira ti no conjunto T,
+		triangles.push_back (ti);
+	}
+
+	while (ti != te)// 4. Enquanto ti for diferente do triângulo te,
+	{
+		if (ti == -1)//	4.1. Se o triângulo ti é nulo (esta' na
+		{			 //  borda da triangulação) faça:
+			ti = te; //	 4.1.1. Defina ti como sendo o triângulo te,
+			te = -1; //  4.1.2. Defina te como sendo nulo,
+			ai = a;  //  4.1.3. Defina ai como sendo aresta a,
+			if ( ti != -1 ) // 4.1.4. Se o triângulo ti não for nulo,
+			{				// insira ti no conjunto T,
+				triangles.push_back (ti);
+			}
+			continue;//	 4.1.5. Retorne a 4.
+		}
+
+		long aaux = edgeWithVertexDiffFromEdge ( ti, v, ai );// 4.2. Defina a
+		if (aaux == -1)	 // aresta aaux do triângulo ti que conecta o
+			return false;// vértice v e é diferente de ai,
+
+		long taux;
+		if (edgeSet_[aaux].right() == ti) // 4.3. Defina taux como sendo  
+			taux = edgeSet_[aaux].left();//  o triângulo que compartilha
+		else if (edgeSet_[aaux].left() == ti)// a aresta aaux com ti,
+			taux = edgeSet_[aaux].right();
+		else
+			return false;
+
+		ti = taux;// 4.4. Defina ti como sendo o triângulo taux e ai 
+		ai = aaux;//	  como sendo aresta aaux,
+
+		if ( ti != -1 )// 4.5. Se o triângulo ti não for nulo, insira
+		{			   //      aresta ao de ti que não é diretamente
+			triangles.push_back (ti);
+		}
+	} // 4.6. Retorne a 4.
+	return true;
+}
+
+bool
+TeTin::vertexOppEdges(long v, std::list<long> &triset, std::list<long> &edges)
+{
+	std::list<long>::iterator tii;
+	for (tii = triset.begin(); tii != triset.end(); tii++)
+	{
+		long ti = *tii;
+		long nedge = this->edgeOppVertex(ti, v);
+		edges.push_back(nedge);
+	}
+	return true;
+}
+
+long
+TeTin::oneTriangleWithVertex(long v)
+{
+//	Find one line that contains node
+	long a = oneEdgeWithVertex(v);
+	if (a == -1)
+		return -1;
+
+	long td = edgeSet_[a].right();
+	if ( td == -1 )
+		return edgeSet_[a].left();
+	else
+		return td;
+}
+
+bool
+TeTin::triangleContainsPoint(TeTinTriangle& t, TeCoord2D& pt) 
+{
+	double	totalArea, triangleArea;
+	TeCoord2D	vert[3];
+
+	this->trianglePoints(t, vert[0], vert[1], vert[2]);
+
+//	Calculate the base triangle area
+	triangleArea = fabs(( (vert[1].x() - vert[0].x()) *
+		              (vert[2].y() - vert[0].y()) ) -
+	 	            ( (vert[2].x() - vert[0].x()) *
+	 	              (vert[1].y() - vert[0].y()) ));
+	triangleArea *= 1.00001;
+	totalArea = fabs(( (vert[0].x() - pt.x()) * (vert[1].y() - pt.y()) ) -
+		         ( (vert[1].x() - pt.x()) * (vert[0].y() - pt.y()) ));
+	if (totalArea > triangleArea)
+		return false;
+
+	totalArea += fabs(( (vert[1].x() - pt.x()) * (vert[2].y() - pt.y()) ) -
+		          ( (vert[2].x() - pt.x()) * (vert[1].y() - pt.y()) ));
+	if (totalArea > triangleArea) 
+		return false;
+
+	totalArea += fabs(( (vert[0].x() - pt.x()) * (vert[2].y() - pt.y()) ) -
+		          ( (vert[2].x() - pt.x()) * (vert[0].y() - pt.y()) ));
+	if (totalArea > triangleArea) 
+		return false;
+
+	return true;
+}
+
+long
+TeTin::triangleAt (TeCoord2D& pt)
+{
+//Seja v um vértice qualquer da triangulação T e p o ponto para o qual se deseja saber qual triângulo t
+//	o contém.
+	long vi1;
+
+	TeTinEdgeSet::reverse_iterator i = edgeSet_.rbegin();
+	while ( i != edgeSet_.rend() )
+	{
+		vi1 = (*i++).from();
+		if (vi1 >= 0 ) // -1L)
+			break;
+	}
+	if ( i == edgeSet_.rend() )
+		return -1;
+
+//1. Defina o conjunto T={t1,..., tm} com os m triângulos que compartilham o vértice vi,
+	std::list<long> triset;
+	this->vertexTriangles(vi1, triset);
+
+	TeCoord2D pf = vertexSet_[vi1].location();
+	if ( pf == pt )
+//2. Se vi é igual a p, o triângulo que contém p é um dos triângulos que compartilham vi.
+// Escolha qualquer um dos triângulos e termine o algoritmo.
+		return ( *(triset.begin()) );
+
+//3. Defina A={a1,...,an} com as n arestas opostas a vi,
+	std::list<long> aedges;
+	this->vertexOppEdges(vi1, triset, aedges);
+
+//4. Defina V={v1,...,vm} com os m vértices dos triângulos que contém o vértice vi,
+	std::list <long> vvertex;
+	this->vertexOppVertices(vi1, vvertex);
+
+//5. Insira o vértice v no conjunto VI de vértices intersectados,
+	std::set <long> viset;
+	viset.insert(vi1);
+
+//6. Defina o vértice auxiliar vaux como sendo vi,
+	long vaux = vi1;
+//   e aresta aaux como sendo inválida
+	long aaux = -1;
+	std::vector<long> auxset(3);
+	for (;;)
+	{
+//7. Para cada triângulo ti de T, faça:
+		std::list<long>::iterator tii;
+		for (tii = triset.begin(); tii != triset.end(); tii++)
+		{
+			long ti = *tii;
+//7.1. Se o triângulo ti contém o ponto pn, termine o algoritmo.
+			if ( this->triangleContainsPoint( ti, pt ) )
+				return ti;
+		}
+//8.	Para cada vértice vi de V, faça:
+		std::list<long>::iterator vii;
+		for (vii = vvertex.begin(); vii != vvertex.end(); vii++)
+		{
+			long vi = *vii;
+			TeCoord2D ptvi = vertexSet_[vi].location();
+			if ( ptvi == pt )
+//8.1. Se vi é igual a p, o triângulo que contém p é um dos triângulos que compartilham vi.
+			{
+				for (tii = triset.begin(); tii != triset.end(); tii++)
+				{
+					long ti = *tii;
+					long v0, v1, v2;
+					this->triangleVertices(ti, v0, v1, v2);
+					if ( v0 == vi || v1 == vi || v2 == vi)
+						return ti;
+				}
+				return -1;
+			}
+		}
+//9. Para cada vértice vi de V, faça:
+		for ( vii = vvertex.begin(); vii != vvertex.end(); vii++)
+		{
+			long vi = *vii;
+//9.1.	Se vi está sobre r, faça:
+			TeCoord2D ptvi = vertexSet_[vi].location();
+			TeCoord2D pinter;
+			if ( TePerpendicularDistance(pf, pt, ptvi, pinter) < TePrecision::instance().precision() )
+			{
+				TeBox box1;
+				updateBox (box1, pf);
+				updateBox (box1, pt);
+				//extra cases
+				TeLine2D linter;
+				linter.add(pf);
+				linter.add(pt);
+				if (TeWithin (pinter, box1) || (TeWithin(pinter,linter)))
+				{
+//9.1.1.	Redefina o conjunto A={a1,..., an} com as n arestas opostas a vi, diferentes de aaux,
+					aedges.clear();
+					this->vertexOppEdges(vi, aedges);
+//9.1.2.	Defina o conjunto Aaux={a1,..., am} com as m arestas compartilhadas por vaux,
+					std::list <long> vauxedges;
+					this->vertexEdges(vaux, vauxedges);
+//9.1.3.	Exclua do conjunto A todas as arestas que pertencem ao conjunto Aaux,
+					for (std::list<long>::iterator vai = vauxedges.begin(); vai != vauxedges.end(); vai++)
+						aedges.remove ( *vai );
+//9.1.4.	Exclua do conjunto A a aresta aaux,
+					aedges.remove ( aaux ); // better perfomance than remove algorithm
+//9.1.5.	Redefina o conjunto V={v1,..., vm} com os m vértices dos triângulos que contém o vértice vi,
+//			diferentes de vaux,
+					vvertex.clear();
+					this->vertexOppVertices(vi, vvertex);
+//9.1.6.	Exclua do conjunto V todos os vértices que pertencem ao conjunto VI,
+					for (std::set<long>::iterator vvi = viset.begin(); vvi != viset.end(); vvi++)
+						vvertex.remove ( *vvi );
+//9.1.7.	Redefina o conjunto T={t1, ..., tk } com os k triângulos que contém o vértice vi,
+					triset.clear();
+					this->vertexTriangles(vi, triset);
+//9.1.8.	Redefina o vértice auxiliar vaux como sendo vi,
+					vaux = vi;
+//9.1.8.	Insira o vértice vi no conjunto VI de vértices intersectados,
+					viset.insert(vi);
+//9.1.8.	Retorne a 7,
+					//pf = vertexSet_[vi].location();
+					break;
+				}
+			}
+		}
+		if ( vii != vvertex.end() )
+			continue; // do for (;;)
+
+//10.	Para cada aresta ai de A, faça:
+		std::list<long>::iterator aii;
+		for (aii = aedges.begin(); aii != aedges.end(); aii++)
+		{
+			long ai = *aii;
+//10.1.	Se o ponto p está sobre ai, faça:
+			TeCoord2D pfr = vertexSet_[edgeSet_[ai].from()].location();
+			TeCoord2D pto = vertexSet_[edgeSet_[ai].to()].location();
+			TeCoord2D pinter;
+			if ( TePerpendicularDistance(pfr, pto, pt, pinter) < TePrecision::instance().precision() )
+			{
+				TeBox box1;
+				updateBox (box1, pfr);
+				updateBox (box1, pto);
+				if (TeWithin(pinter, box1) )
+				{
+//10.1.1. Escolha qualquer um dos triângulos que compartilham ai.
+					long ti = edgeSet_[ai].left();
+//10.1.2.	Termine o algoritmo.
+					if ( (ti != -1) && (this->triangleContainsPoint(ti, pt)) )
+						return ( ti );
+					else
+					{
+						ti = edgeSet_[ai].right();
+						if ( (ti != -1) && (this->triangleContainsPoint(ti, pt)) )
+							return ( ti );
+						return -1;
+					}
+				}
+			}
+		}
+
+//11.	Para cada aresta ai de A, faça:
+		for (aii = aedges.begin(); aii != aedges.end(); aii++)
+		{
+			long ai = *aii;
+			long vt = edgeSet_[ai].to();
+			long vf = edgeSet_[ai].from();
+			TeCoord2D pi;
+//11.1.	Se ai intersecta r, faça:
+			if (TeSegmentsIntersectPoint(vertexSet_[vt].location(), vertexSet_[vf].location(), pf, pt, pi) )
+			{
+//11.1.2.	Defina os triângulos t1 e t2 que compartilham a aresta ai.
+//11.1.3.	Se t2 está contido no conjunto T , então faça taux=t1,
+				long taux = edgeSet_[ai].left();
+				if (taux == -1)
+					return -1;
+				std::list<long>::iterator pos1 = find (triset.begin(), triset.end(), taux);
+				if ( pos1 != triset.end() )
+//11.1.4.	Senão, faça taux=t2,
+					taux = edgeSet_[ai].right();
+				if (taux == -1)
+					return -1;
+//11.1.5.	Se o triângulo taux contém o ponto pn, termine o algoritmo.
+				if ( this->triangleContainsPoint( taux, pt ) )
+					return taux;
+//11.1.6.	Redefina o conjunto A={a1, a2} com as arestas do triângulo taux diferentes de ai,
+				triangleSet_[taux].edges ( auxset[0], auxset[1], auxset[2] );
+				aedges.clear();
+				aedges.insert( aedges.begin(), auxset.begin(), auxset.end() );
+				aedges.remove( ai );
+//11.1.7.	Redefina o conjunto V={v1}. O vértice v1 é o vértice do triângulo taux que não está
+//			em nenhuma extremidade da aresta ai,
+				long vaux1 = edgeSet_[ai].from();
+				long vaux2 = edgeSet_[ai].to();
+				this->triangleVertices ( taux, auxset[0], auxset[1], auxset[2]);
+				vvertex.clear();
+				vvertex.insert ( vvertex.begin(), auxset.begin(), auxset.end() );
+				vvertex.remove ( vaux1 );
+				vvertex.remove ( vaux2 );
+
+//11.1.8.	Redefina o conjunto T={taux},
+				triset.clear();
+				triset.push_back ( taux );
+//11.1.9.	Redefina aaux como sendo ai,
+				aaux = ai;
+//11.1.10.	Retorne a 8;
+				break;
+			}
+		}
+//12.	Se não há mais arestas em A, então:
+		//if ( aii == aedges.end() )
+		//{
+//12.1.	Para cada triângulo ti de T, faça:
+//			TeTinTriangleIterator tii;
+//			for ( tii = triangleBegin(); tii != triangleEnd(); tii++)
+			long ti;
+			long tEnd = triangleSet_.size();
+			for ( ti = 0; ti < tEnd; ti++)
+			{
+//				TeTinTriangle ti = *tii;
+	//12.1.1.	Se o triângulo ti contém o ponto pn, termine o algoritmo.
+				if ( this->triangleContainsPoint( ti, pt ) )
+					return ti;
+			}
+			if (ti == tEnd )
+				return -1;
+		//}
+	} // Do for (;;)
+	return -1;
+}
+
+bool
+TeTin::insertPoint(double x, double y, double value)
+{
+//	Get Point to be inserted from std::vector
+	TeCoord2D	pt(x,y);
+	if ( ! TeWithin (pt, vertexSet_.box()) )
+		return false;
+
+//	Find the triangle that owns the point pt	
+	long t = triangleAt ( pt );
+
+	if (t == -1)
+		return false;
+
+	TeCoord2D vert[3];
+	trianglePoints(t, vert[0], vert[1], vert[2]);
+
+	
+
+//	Verify if point is too close to one triangle vertex
+	long j;
+	for ( j = 0; j < 3; j++)
+	{
+		if (pt == vert[j]) // Using precision to compare
+			return false;
+	}
+
+//	Test if the point is on an edge
+	long nedge = -1;
+	double dmin = TeMAXFLOAT;
+	TeCoord2D pmin;
+	for (j = 0; j < 3; j++)
+	{
+		if ( TeWithinOrTouches (pt, vert[j], vert[(j+1)%3]) == false )
+			continue;
+
+		TeCoord2D paux;
+		double daux = TePerpendicularDistance(vert[j], vert[(j+1)%3], pt, paux);
+		if ((daux < TePrecision::instance().precision()) && (daux < dmin))
+		{//			On edge j
+			nedge = j;
+			dmin = daux;
+			pmin = paux;
+		}
+	}
+
+	vertexSet_.add( TeTinVertex (pt, value, NORMALVERTEX, -1 ) );
+	long v = vertexSet_.size()-1;
+
+	std::set<long> trianglesToTest;
+	if (nedge == -1)	// Not on an edge
+	{
+		this->twoNewTriangles(t, v, trianglesToTest);	//If not, split triang
+	}
+	else
+	{
+		long neighids[3];
+		this->triangle3Neighbors(t, neighids[0],neighids[1],neighids[2]);
+		long edges[3];
+		triangleSet_[t].edges( edges[0], edges[1], edges[2] );
+		for (j = 0; j < 3; j++)
+		{	// Check if neighbor triangle opposite vertex is too close
+			if ( neighids[j] == -1L )
+				continue;
+			long oppVertex = edgeOppVertex(neighids[j], edges[j]);
+			long vsize = vertexSet_.size();
+			if ( oppVertex < vsize )
+			{
+			TeCoord2D ptaux = vertexSet_[oppVertex].location();
+			if ( ptaux == pt )
+			{
+				// If necessary add code to change oppVertex type and value
+				return false;
+			}
+			}
+		}
+
+//		Duplicate triangle and its neighbor on the same edge
+		long an0 = this->duplicateTriangle( t, nedge, v, trianglesToTest);
+		if (neighids[nedge] != -1L)
+		{
+			long tv = neighids[nedge];
+			this->dupNeighTriangle( tv, an0, v, trianglesToTest);
+		}
+	}
+	this->testDelaunayForVertex(v, trianglesToTest);
+	return true;
+}
+
+bool
+TeTin::triangle3DPoints(TeTinTriangle& t, TeCoord2D& pt0, TeCoord2D& pt1,
+					TeCoord2D& pt2, double& val0, double& val1, double& val2)
+{
+	long vertex0, vertex1, vertex2;
+	this->triangleVertices(t, vertex0, vertex1, vertex2);
+
+	pt0 = vertexSet_[vertex0].location();
+	pt1 = vertexSet_[vertex1].location();
+	pt2 = vertexSet_[vertex2].location();
+
+	val0 = vertexSet_[vertex0].value();
+	val1 = vertexSet_[vertex1].value();
+	val2 = vertexSet_[vertex2].value();
+
+	return true;
+}
+
+bool
+TeTin::trianglePoints(TeTinTriangle& t, TeCoord2D& pt0, TeCoord2D& pt1, TeCoord2D& pt2)
+{
+	long vertex0, vertex1, vertex2;
+	this->triangleVertices(t, vertex0, vertex1, vertex2);
+
+	pt0 = vertexSet_[vertex0].location();
+	pt1 = vertexSet_[vertex1].location();
+	pt2 = vertexSet_[vertex2].location();
+
+	return true;
+}
+
+bool
+TeTin::triangleVertices(TeTinTriangle& t, long& vertex0, long& vertex1, long& vertex2)
+{
+	long edge0, edge1, edge2;
+	t.edges(edge0,edge1,edge2);
+
+	if (edgeSet_[edge0].to() == edgeSet_[edge1].to())
+	{
+		vertex0 = edgeSet_[edge0].from();
+		vertex1 = edgeSet_[edge0].to();
+		vertex2 = edgeSet_[edge1].from();
+	}
+	else if (edgeSet_[edge0].to() == edgeSet_[edge1].from())
+	{
+		vertex0 = edgeSet_[edge0].from();
+		vertex1 = edgeSet_[edge0].to();
+		vertex2 = edgeSet_[edge1].to();
+	}
+	else if (edgeSet_[edge0].from() == edgeSet_[edge1].from())
+	{
+		vertex0 = edgeSet_[edge0].to();
+		vertex1 = edgeSet_[edge0].from();
+		vertex2 = edgeSet_[edge1].to();
+	}
+	else if (edgeSet_[edge0].from() == edgeSet_[edge1].to())
+	{
+		vertex0 = edgeSet_[edge0].to();
+		vertex1 = edgeSet_[edge0].from();
+		vertex2 = edgeSet_[edge1].from();
+	}
+	else
+		return false;
+
+	return true;
+}
+
+bool
+TeTin::triangle3Neighbors(long t, long& neighbor0, long& neighbor1, long& neighbor2)
+{
+	long edge0, edge1, edge2;
+	triangleSet_[t].edges(edge0,edge1,edge2);
+
+	if (edgeSet_[edge0].left() == t)
+		neighbor0 = edgeSet_[edge0].right();
+	else
+		neighbor0 = edgeSet_[edge0].left();
+
+	if (edgeSet_[edge1].left() == t)
+		neighbor1 = edgeSet_[edge1].right();
+	else
+		neighbor1 = edgeSet_[edge1].left();
+
+	if (edgeSet_[edge2].left() == t)
+		neighbor2 = edgeSet_[edge2].right();
+	else
+		neighbor2 = edgeSet_[edge2].left();
+
+	return true;
+}
+
+long
+TeTin::triangleVertexAt(long t, long vertex)
+{
+	long vertices[3];
+	this->triangleVertices ( t, vertices[0],vertices[1],vertices[2] );
+
+	return vertices[vertex];
+}
+
+bool
+TeTin::twoNewTriangles(long t, long v, std::set<long>& triangles)
+{
+//1. Crie o vértice vn com os dados da amostra s,
+//	Sint4 vn = nodeId;
+
+//2. Crie 2 novos triângulos t1 e t2,
+	long t1 = triangleSet_.size();
+	long t2 = t1+1;
+
+//3. Crie a nova aresta an0 que conecta os vértices vn e v0 e
+//   tem t e t1 como os triângulos que compartilham a aresta.
+	long v0 = this->triangleVertexAt(t,0); //v0 e' o vertice 0 de t
+	edgeSet_.add( TeTinEdge (v, v0, t, t1, NORMALEDGE) );
+	long an0 = edgeSet_.size()-1;
+	vertexSet_[v].setOneEdge(an0);
+
+//4. Crie a nova aresta an1 que conecta os vértices vn e v1 e
+// 	tem t1 e t2 como os triângulos que compartilham a aresta.
+	long v1 = this->triangleVertexAt(t,1); //v1 e' o vertice 1 de t
+	edgeSet_.add( TeTinEdge (v, v1, t1, t2, NORMALEDGE) );
+	long an1 = edgeSet_.size()-1;
+
+//5. Crie a nova aresta an2 que conecta os vértices vn e v2 e
+//	tem t2 e t como os triângulos que compartilham a aresta.
+	long v2 = this->triangleVertexAt(t,2); //v2 e' o vertice 2 de t
+	edgeSet_.add( TeTinEdge (v, v2, t2, t, NORMALEDGE) );
+	long an2 = edgeSet_.size()-1;
+
+//6. Troque o triângulo t por t1 na aresta a0,
+	long a0 = triangleSet_[t].edgeAt(0); // retorna aresta 0 de t
+	edgeSet_[a0].exchangeTriangle(t,t1);
+
+//7. Defina as arestas de t1 como sendo an0, a0 e an1,
+	triangleSet_.add ( TeTinTriangle (an0, a0, an1) );
+
+//8. Troque o triângulo t por t2 na aresta a1,
+	long a1 = triangleSet_[t].edgeAt(1); // retorna aresta 1 de t
+	edgeSet_[a1].exchangeTriangle(t, t2);
+
+//9. Defina as arestas de t2 como sendo an1, a1 e an2,
+	triangleSet_.add ( TeTinTriangle (an1, a1, an2) );
+
+//10. Defina as arestas de t como sendo an2, a2 e an0,
+	long a2 = triangleSet_[t].edgeAt(2); // retorna aresta 2 de t
+	triangleSet_[t].setEdges(an2, a2, an0);
+
+	triangles.insert(t);
+	triangles.insert(t1);
+	triangles.insert(t2);
+	return true;
+}
+
+long
+TeTin::duplicateTriangle(long t, long n, long v, std::set<long>& triangles)
+{
+// Seja t o triângulo que contém cuja n-ésima aresta an é a aresta 
+// próxima a amostra s ( n E {0,1,2} ). A aresta an conecta os vértices 
+// vn e vj, a aresta aj conecta os vértices vj e vk e a aresta ak conecta
+// os vértices vk e vn, sendo j o resto da divisão de n+1 por 3 e k o resto
+// da divisão de n+2 por 3.
+	long edges[3];
+	triangleSet_[t].edges(edges[0],edges[1],edges[2]);
+
+	long an = edges [ n ];
+	long aj = edges [ (n+1)%3 ];
+	long ak = edges [ (n+2)%3 ];
+
+	long vn = this->triangleVertexAt( t, n );
+
+//	1. Crie o vértice v com os dados da amostra s,
+//	2. Defina o triângulo tv que compartilha a aresta an com t,
+	long tv = 0;
+	if (edgeSet_[an].left() == t)
+		tv = edgeSet_[an].right();
+	else if (edgeSet_[an].right() == t)
+		tv = edgeSet_[an].left();
+
+//	3. Defina o vértice vop do triângulo t que não é conectado a aresta an,
+	long vop = this->triangleVertexAt ( t, (n+2)%3 );
+
+//	4. Crie o novo triângulos t1,
+	long t1 = triangleSet_.size();
+
+//	5. Crie a nova aresta an0 que conecta os vértices v e vn e
+//	   tem t1 e tv como os triângulos que compartilham a aresta.
+	edgeSet_.add( TeTinEdge (v, vn, t1, tv, NORMALEDGE) );
+	long an0 = edgeSet_.size()-1;
+
+//	6. Crie a nova aresta an1 que conecta os vértices v e vop e
+//	   tem t e t1 como os triângulos que compartilham a aresta.
+	edgeSet_.add( TeTinEdge (v, vop, t, t1, NORMALEDGE) );
+	long an1 = edgeSet_.size()-1;
+
+//	7. Modifique a aresta an para conectar o vértice v ao invés de vn,
+	edgeSet_[an].exchangeVertex( vn, v );
+	vertexSet_[vn].setOneEdge ( an0 );
+
+//	8. Defina as arestas de t como sendo an, aj e an1,
+	triangleSet_[t].setEdges( an, aj, an1 );
+
+//	9. Modifique a aresta ak para compartilhar o triângulo t1 ao invés de t,
+	edgeSet_[ak].exchangeTriangle( t, t1 );
+
+//	10. Defina as arestas de t1 como sendo an0, an1 e ak,
+	triangleSet_.add ( TeTinTriangle (an0, an1, ak) );
+
+	triangles.insert(t);
+	triangles.insert(t1);
+
+	return an0;
+}
+
+bool
+TeTin::dupNeighTriangle(long tv, long an0, long v, std::set<long>& triangles)
+{
+//	11.1. Crie o novo triângulo t2,
+	long t2 = triangleSet_.size();
+
+//	11.2. Defina a aresta av do triângulo tv que contém o vértice vn
+//	      (obs: só há uma aresta porque a outra foi modificada),
+	long vn = edgeSet_[an0].to(); //Due to assembly, dangerous
+	if ( vn == v )
+		vn = edgeSet_[an0].from();
+
+	long edges[3];
+	triangleSet_[tv].edges(edges[0],edges[1],edges[2]);
+	long i;
+	for (i = 0; i < 3; i++)
+	{
+		if ( (edgeSet_[edges[i]].from() == vn) ||
+			 (edgeSet_[edges[i]].to() == vn) )
+			break;
+	}
+	if (i == 3)
+		return false;
+	long av = edges[i];
+
+//	11.3. Defina as outras arestas de tv como sendo av1 e av2.
+	long av1 = edges[ (i+1)%3];
+	long av2 = edges[ (i+2)%3];
+
+//	11.4. Defina o vértice vvo conectado a vn por meio da aresta av,
+	long vvo;
+	if (edgeSet_[av].from() == vn)
+		vvo = edgeSet_[av].to();
+	else
+		vvo = edgeSet_[av].from();
+
+//	11.5. Crie a nova aresta an2 que conecta os vértices v e vvo e
+//	      tem t e t2 como os triângulos que compartilham a aresta.
+	edgeSet_.add( TeTinEdge (v, vvo, tv, t2, NORMALEDGE) );
+	long an2 = edgeSet_.size()-1;
+
+//	11.6. Troque o triângulo tv por t2 na aresta av,
+	edgeSet_[av].exchangeTriangle( tv, t2 );
+
+//	11.7. Troque o triângulo tv por t2 na aresta an0,
+	edgeSet_[an0].exchangeTriangle( tv, t2 );
+
+//	11.8. Defina as arestas de tv como sendo an2, av1 e av2.
+	triangleSet_[tv].setEdges( an2, av1, av2 );
+
+//	11.9. Defina as arestas de t2 como sendo an0, av e an2,
+	triangleSet_.add ( TeTinTriangle ( an0, av, an2 ) );
+
+	triangles.insert(tv);
+	triangles.insert(t2);
+
+	return true;
+}
+
+void
+TeTin::testDelaunayForVertex(long v, std::set<long>& triangles)
+{
+	while ( triangles.size() )
+	{
+		std::set<long>::iterator i = triangles.begin();
+		long t = *i;
+		triangles.erase(t);
+		this->testDelaunayAt(t, v, triangles);
+	}
+}
+
+bool
+TeTin::testDelaunayAt(long t, long v, std::set<long>& triangles)
+{
+	//	Retrieve line of triangle common to neighbor triangle
+	long e = this->edgeOppVertex (t, v);
+
+//	Retrieve neighbour triangle (tviz) pointer
+	long tviz = edgeSet_[e].left();
+	if ( edgeSet_[e].left() == t )
+		tviz = edgeSet_[e].right();
+	if ( tviz == -1 )
+		return false;
+
+//	Define base triangle (tri) center point
+	TeCoord2D vert[3];
+	this->trianglePoints(t, vert[0], vert[1], vert[2]);
+
+//	Find opposite point to base triangle (tri) inside neighbour (tviz)
+	long vo = this->vertexOppEdge ( tviz, e );
+	TeCoord2D pto = vertexSet_[vo].location();
+
+//	To avoid overflow
+	TeCoord2D ptmin( TeMAXFLOAT, TeMAXFLOAT );
+	long i;
+	for (i = 0; i < 3; i++)
+		if ( vert[i] < ptmin )
+			ptmin = vert[i];
+
+	if ( ! ptmin.tooBig() )
+	{
+		TeCoord2D mptmin ( -ptmin.x(), -ptmin.y() );
+		for (i = 0; i < 3; i++)
+			vert[i] += mptmin;
+		pto += mptmin;
+	}
+
+	TeCoord2D ptc;
+	if ( ! TeFindTriangleCenter( vert[0], vert[1], vert[2], ptc ) )
+		return false;
+
+//	Calculate base triangle (tri) radius
+	double xaux = ptc.x() - vert[0].x();
+	double yaux = ptc.y() - vert[0].y();
+	double raio2 = xaux * xaux + yaux * yaux;
+
+//	Calculate distance from opposite point (tviz) to center point (tri)
+	xaux = ptc.x() - pto.x();
+	yaux = ptc.y() - pto.y();
+	double dist2 = xaux * xaux + yaux * yaux; 
+
+/*	float fr = (float)sqrt(raio2);
+	float fd = (float)sqrt(dist2);
+	if (fr <= fd)
+		return false; */
+
+	if ( raio2 <= dist2 )
+		return false;
+
+	//	If not, change edge between tri and ntri
+	bool status;
+	if ( status = this->swapEdges(t, tviz, e) )
+	{
+		triangles.insert(t);
+		triangles.insert(tviz);
+	}
+	return status;
+}
+
+bool
+TeTin::swapEdges( long t, long tv, long ai )
+{
+	if ( tv == -1 )
+		return false;
+// Seja t o triângulo que contém cuja i-ésima aresta ai é a aresta
+//	que se deseja alterar ( i E {0,1,2} ). A aresta ai conecta os
+//	vértices vi e vj, a aresta aj conecta os vértices vj e vk e a
+//	aresta ak conecta os vértices vk e vi, sendo j o resto da divisão
+//	de i+1 por 3 e k o resto da divisão de i+2 por 3.
+
+	long tedges[3];
+	triangleSet_[t].edges ( tedges[0], tedges[1], tedges[2] );
+
+	long vertex[3];
+	this->triangleVertices ( t, vertex[0], vertex[1], vertex[2]);
+	long i;
+	for ( i= 0; i < 3; i++ )
+		if ( tedges[i] == ai )
+			break;
+
+	long aj = tedges [ (i+1) % 3 ];
+	long ak = tedges [ (i+2) % 3 ];
+
+	long vi = vertex [ i ];
+	long vj = vertex [ (i+1) % 3 ];
+	long vk = vertex [ (i+2) % 3 ];
+
+// Seja tv o triângulo que compartilha a aresta ai com t. O vértice de
+//	tv que não é conectado pela aresta ai é o vértice vn. As outras
+//	arestas do triângulo tv são am que conecta os vértices vi e vn e a
+//	aresta an conecta os vértices vn e vj.
+	
+	long vn = this->vertexOppEdge ( tv, ai );
+
+	long tvedges [3];
+	triangleSet_[tv].edges ( tvedges[0], tvedges[1], tvedges[2] );
+
+	long am, an = 0;
+	for ( long j = 0; j < 3; j++ )
+	{
+		if ( tvedges [ j ] == ai )
+			continue;
+
+		if ( edgeSet_[tvedges[j]].from() == vn )
+		{
+			if ( edgeSet_[tvedges[j]].to() == vi )
+				am = tvedges [ j ];
+			else if ( edgeSet_[tvedges[j]].to() == vj )
+				an = tvedges [ j ];
+		}
+		else if ( edgeSet_[tvedges[j]].to() == vn )
+		{
+			if ( edgeSet_[tvedges[j]].from() == vi )
+				am = tvedges [ j ];
+			else if ( edgeSet_[tvedges[j]].from() == vj )
+				an = tvedges [ j ];
+		}
+	}
+
+	TeCoord2D ptaux;
+	double tol = TePrecision::instance().precision();
+	if ( TePerpendicularDistance(vertexSet_[vk].location(), vertexSet_[vn].location(),
+								 vertexSet_[vi].location(), ptaux) < tol )
+		return false;
+	if ( TePerpendicularDistance(vertexSet_[vk].location(), vertexSet_[vn].location(),
+								 vertexSet_[vj].location(), ptaux) < TePrecision::instance().precision() )
+		return false;
+
+//	1. Se o segmento de reta formado conectando o vértice vk do
+//	   triângulo t ao vértice vn de tv intersecta a aresta ai, faça:
+	TeCoord2D pi;
+	if (TeSegmentsIntersectPoint(vertexSet_[vi].location(), vertexSet_[vj].location(), vertexSet_[vk].location(), vertexSet_[vn].location(), pi) == false )
+		return false;
+
+//		1.1. Troque na aresta ai o vértice vi pelo vertice vk e o
+//			 vértice vj pelo vértice vn.
+	edgeSet_[ai].exchangeVertex ( vi, vk );
+	edgeSet_[ai].exchangeVertex ( vj, vn );
+
+	if ( vertexSet_[vi].oneEdge() == ai )
+		vertexSet_[vi].setOneEdge ( ak );
+	if ( vertexSet_[vj].oneEdge() == ai )
+		vertexSet_[vj].setOneEdge ( aj );
+
+//		1.2. Troque na aresta an o triângulo tv pelo triângulo t.
+	edgeSet_[an].exchangeTriangle( tv , t );
+
+//		1.3. Troque na aresta ak o triângulo t pelo triângulo tv.
+	edgeSet_[ak].exchangeTriangle( t, tv );
+
+//		1.4. Troque no triângulo t a aresta ai pela aresta an e a
+//			 aresta ak pela aresta ai.
+	for ( i = 0; i < 3; i++ )
+		if ( tedges[i] == ai )
+			break;
+	tedges[i] = an;
+	tedges[(i+2)%3] = ai;
+	triangleSet_[t].setEdges ( tedges[0], tedges[1], tedges[2] );
+
+//		1.5. Troque no triângulo tv a aresta ai pela aresta ak
+	for ( i = 0; i < 3; i++ )
+		if ( tvedges[i] == ai )
+			break;
+	tvedges [i] = ak;
+
+//		 e a aresta an pela aresta ai.
+	for ( i = 0; i < 3; i++ )
+		if (tvedges[i] == an )
+			break;
+	tvedges[i] = ai;
+
+	triangleSet_[tv].setEdges ( tvedges[0], tvedges[1], tvedges[2] );
+	
+	return true;
+}
+
+bool
+TeTin::edgesInterBySegment( TeCoord2D& pf, TeCoord2D& pn, std::list<long> &aiset, std::list<long> &viset )
+{
+//		Seja o segmento de reta r que conecta os pontos pf  e pn,
+//1.	Defina o triângulo tf que contém o ponto pf,
+	long tf = this->triangleAt (pf);
+	if (tf == -1)
+		return false;
+
+//2.	Defina o vértice vaux e aresta aaux, como sendo inválidos,
+	long vaux = -1;
+	long aaux = -1;
+
+//3.	Defina o conjunto A={a1, a2, a3} com as arestas de tf,
+	std::vector<long> auxset(3);
+	triangleSet_[tf].edges ( auxset[0], auxset[1], auxset[2] );
+	std::list<long> aedges ( auxset.begin(), auxset.end() );
+
+//4.	Defina o conjunto V={v1, v2, v3} com os vértices de tf,
+	this->triangleVertices ( tf, auxset[0], auxset[1], auxset[2]);
+	std::list <long> vvertex ( auxset.begin(), auxset.end() );
+
+//5.	Defina o conjunto T={tf},
+	std::list<long> triset( 1, tf );
+	std::set<long> visetaux;
+
+//6.	Para cada vértice vi de V, faça:
+	std::list<long>::iterator vii;
+	for (vii = vvertex.begin(); vii != vvertex.end(); vii++)
+	{
+		long vi = *vii;
+		TeCoord2D ptvi = vertexSet_[vi].location();
+		TeCoord2D pinter;
+
+//6.1.	Se o vértice vi coincide com pf, faça:
+		if ( ptvi == pf )
+		{
+//6.1.1.	Redefina A={a1,...,an} com as n arestas opostas a vi,
+			aedges.clear();
+			this->vertexOppEdges(vi, aedges);
+
+//6.1.2.	Redefina V={v1,...,vm} com os m vértices dos triângulos que contém o vértice vi,
+			vvertex.clear();
+			this->vertexOppVertices(vi, vvertex);
+
+//6.1.3.	Redefina o conjunto T={t1,..., tm} com os m triângulos que compartilham o vértice vi,
+			triset.clear();
+			this->vertexTriangles(vi, triset);
+
+//6.1.4.	Redefina o vértice auxiliar vaux como sendo vi,
+			vaux = vi;
+			visetaux.insert(vi);
+//6.1.5.	Vá para 8,
+			break;
+		}
+	}
+	if ( vii == vvertex.end() )
+	{
+//7.	Para cada aresta ai de A, faça:
+		for (std::list<long>::iterator aii = aedges.begin(); aii != aedges.end(); aii++)
+		{
+			long ai = *aii;
+//7.1.	Se o ponto pf está sobre ai, faça:
+			TeCoord2D pfr = vertexSet_[edgeSet_[ai].from()].location();
+			TeCoord2D pto = vertexSet_[edgeSet_[ai].to()].location();
+			TeCoord2D pinter;
+			if ( TePerpendicularDistance(pfr, pto, pf, pinter) < TePrecision::instance().precision() )
+			{
+//7.1.1.	Defina o triângulo tv que compartilha ai com tf,
+				long tv = edgeSet_[ai].right();
+				if (tv == tf)
+					tv = edgeSet_[ai].left();
+				if (tv == -1)
+					return false;
+//7.1.2.	Redefina V={v1, v2, v3, v4} com os vértices de tv e tf,
+				vvertex.clear();
+				this->triangleVertices ( tv, auxset[0], auxset[1], auxset[2]);
+				vvertex.insert( vvertex.begin(), auxset.begin(), auxset.end() );
+				this->triangleVertices ( tf, auxset[0], auxset[1], auxset[2]);
+				vvertex.insert( vvertex.begin(), auxset.begin(), auxset.end() );
+				vvertex.sort();
+				vvertex.unique();
+//7.1.3.	Redefina A={a1, a2, a3, a4} com as arestas de tv e tf diferentes de ai,
+				aedges.clear();
+				triangleSet_[tv].edges ( auxset[0], auxset[1], auxset[2] );
+				aedges.insert( aedges.begin(), auxset.begin(), auxset.end() );
+				aedges.remove(ai);
+				triangleSet_[tf].edges ( auxset[0], auxset[1], auxset[2] );
+				aedges.insert( aedges.begin(), auxset.begin(), auxset.end() );
+				aedges.remove(ai);
+
+//7.1.4.	Redefina o conjunto T={tv, tf},
+				triset.push_back ( tv );
+//7.1.5.	Redefina a aresta auxiliar aaux como sendo ai,
+				aiset.push_back ( ai );
+				aaux = ai;
+//7.1.6.	Vá para 8,
+				break;
+			}
+		}
+	}
+
+	for (;;)
+	{
+//8.	Para cada triângulo ti de T, faça:
+		std::list<long>::iterator tii;
+		for ( tii = triset.begin(); tii != triset.end(); tii++)
+		{
+			long ti = *tii;
+//8.1.1.	Se o triângulo ti contém o ponto pn, termine o algoritmo.
+			if ( this->triangleContainsPoint( ti, pn ) )
+				return true;
+		}
+//9.	Para cada vértice vi de V, faça:
+		std::list<long>::iterator vii;
+		for (vii = vvertex.begin(); vii != vvertex.end(); vii++)
+		{
+			long vi = *vii;
+			TeCoord2D ptvi = vertexSet_[vi].location();
+//9.1.	Se vi coincide com pn, faça:
+			if ( ptvi == pn )
+			{
+//9.1.1.	Insira o vértice vi no conjunto VI de vértices intersectados,
+				viset.push_back ( vi );
+//9.1.2.	Termine o algoritmo.
+				break;
+			}
+		}
+		if ( vii != vvertex.end() )
+			break; // do for (;;)
+
+//10.	Para cada vértice vi de V, faça:
+		for ( vii = vvertex.begin(); vii != vvertex.end(); vii++)
+		{
+			long vi = *vii;
+//10.1.	Se vi é diferente de vaux e está sobre r, faça:
+			if ( vi != vaux )
+			{
+				TeCoord2D ptvi = vertexSet_[vi].location();
+				TeCoord2D pinter;
+				if ( TePerpendicularDistance(pf, pn, ptvi, pinter) < TePrecision::instance().precision() )
+				{
+					TeBox box1;
+					updateBox (box1, pf);
+					updateBox (box1, pn);
+					if (TeWithin (pinter, box1) )
+					{
+//10.1.1.	Redefina o conjunto A={a1,..., an} com as n arestas opostas a vi, excluindo as arestas de AI,
+						aedges.clear();
+						this->vertexOppEdges(vi, aedges);
+						std::list<long>::iterator aisi;
+						for ( aisi = aiset.begin(); aisi != aiset.end(); aisi++)
+							aedges.remove ( *aisi );
+//10.1.2.	Redefina o conjunto V={v1,..., vm} com os m vértices dos triângulos que contém o vértice vi,
+//			excluindo os vertices de Vi,
+						vvertex.clear();
+						this->vertexOppVertices(vi, vvertex);
+						std::list<long>::iterator visi;
+						for ( visi = viset.begin(); visi != viset.end(); aisi++)
+							viset.remove ( *visi );
+//101.3.	Redefina o conjunto T={t1, ..., tk } com os k triângulos que contém o vértice vi,
+						triset.clear();
+						this->vertexTriangles(vi, triset);
+//101.4.	Insira o vértice vi no conjunto VI de vértices intersectados,
+						viset.push_back ( vi );
+//101.5.	Defina o conjunto Ac={a1,..., aj} com as j arestas que contém vi, diferentes de aaux,
+//101.6.	Insira as arestas de Ac no conjunto AI de arestas intersectadas,
+						this->vertexEdges(vi, aiset);
+						aiset.sort();
+						aiset.unique();
+//10.7.	Redefina o vértice auxiliar vaux como sendo vi,
+						vaux = vi;
+//10.8.	Retorne a 8,
+						break;
+					}
+				}
+			}
+		}
+		if ( vii != vvertex.end() )
+			continue; // do for (;;)
+
+//11.	Para cada aresta ai de A, faça:
+		std::list<long>::iterator aii;
+		for (aii = aedges.begin(); aii != aedges.end(); aii++)
+		{
+			long ai = *aii;
+//11.1.	Se o ponto pn está sobre ai, faça:
+			TeCoord2D pfr = vertexSet_[edgeSet_[ai].from()].location();
+			TeCoord2D pto = vertexSet_[edgeSet_[ai].to()].location();
+			TeCoord2D pinter;
+			if ( TePerpendicularDistance(pfr, pto, pn, pinter) < TePrecision::instance().precision() )
+			{
+				TeBox box1;
+				updateBox (box1, pfr);
+				updateBox (box1, pto);
+				if (TeWithin (pinter, box1) )
+				{
+//11.1.1.	Insira a aresta ai no conjunto AI de arestas intersectadas,
+					aiset.push_back ( ai );
+//11.1.2.	Termine o algoritmo.
+					break;
+				}
+			}
+		}
+		if ( aii != aedges.end() )
+			break; // do for (;;)
+
+//12.	Para cada aresta ai de A, faça:
+		for (aii = aedges.begin(); aii != aedges.end(); aii++)
+		{
+			long ai = *aii;
+			TeCoord2D pinter;
+			long vt = edgeSet_[ai].to();
+			long vf = edgeSet_[ai].from();
+//12.1.	Se ai intersecta r, faça:
+			if ( TeSegmentsIntersectPoint(vertexSet_[vt].location(), vertexSet_[vf].location(), pf, pn, pinter) )
+			{
+//12.1.1.	Insira a aresta ai no conjunto AI de arestas intersectadas,
+				aiset.push_back ( ai );
+//12.1.2.	Defina os triângulos t1 e t2 que compartilham a aresta ai.
+//12.1.3.	Se t2 está contido no conjunto T , então faça taux=t1,
+				long taux = edgeSet_[ai].left();
+				if (taux == -1)
+					return false;
+				std::list<long>::iterator pos1 = find (triset.begin(), triset.end(), taux);
+				if ( pos1 != triset.end() )
+//12.1.4.	Senão, faça taux=t2,
+					taux = edgeSet_[ai].right();
+				if (taux == -1)
+					return false;
+//12.1.5.	Se o triângulo taux contém o ponto pn, termine o algoritmo.
+				if ( this->triangleContainsPoint( taux, pn ) )
+					return true;
+//12.1.6.	Redefina o conjunto A={a1, a2} com as arestas do triângulo taux diferentes de ai,
+				triangleSet_[taux].edges ( auxset[0], auxset[1], auxset[2] );
+				aedges.clear();
+				aedges.insert( aedges.begin(), auxset.begin(), auxset.end() );
+				aedges.remove( ai );
+//12.1.7.	Redefina o conjunto V={v1}. O vértice v1 é o vértice do triângulo taux que não está
+//			em nenhuma extremidade da aresta ai,
+				long vaux1 = edgeSet_[ai].from();
+				long vaux2 = edgeSet_[ai].to();
+				this->triangleVertices ( taux, auxset[0], auxset[1], auxset[2]);
+				vvertex.clear();
+				vvertex.insert ( vvertex.begin(), auxset.begin(), auxset.end() );
+				vvertex.remove ( vaux1 );
+				vvertex.remove ( vaux2 );
+
+//12.1.8.	Redefina o conjunto T={taux},
+				triset.clear();
+				triset.push_back ( taux );
+//12.1.9.	Redefina aaux como sendo ai,
+				aaux = ai;
+//12.1.10.	Retorne a 8;
+				break;
+			}
+		}
+	} // Do for (;;)
+	return true;
+}
+
+bool
+TeTin::insertSegment( TeCoord2D& pf, TeCoord2D& pn )
+{
+	if ( this->insertPoint( pf.x(), pf.y(), 100.) )
+	{
+		if ( this->insertPoint( pn.x(), pn.y(), 100.) )
+		{
+			std::list<long> aiset;
+			std::list<long> viset;
+			if ( this->edgesInterBySegment( pf, pn, aiset, viset ) )
+			{
+				if ( viset.size() == 0 )
+				{
+					while ( aiset.size() > 0 )
+					{
+//2.	Para cada aresta ai de A, faça:
+						std::list<long>::iterator aii;
+						for (aii = aiset.begin(); aii != aiset.end(); aii++)
+						{
+							long ai = *aii;
+//2.1.	Defina os triângulos td e te compartilham ai,
+							long td = edgeSet_[ai].right();
+							long te = edgeSet_[ai].left();
+//2.2.	Defina os vértices vm e vn dos triângulos td e te que não estão sobre a aresta ai,
+							long vn = this->vertexOppEdge(td, ai);
+							long vm = this->vertexOppEdge(te, ai);
+//2.3.	Se r não intersecta o segmento que conecta os vértices vm e vn, faça:
+							TeCoord2D pi;
+							if ( TeSegmentsIntersectPoint(vertexSet_[vn].location(), vertexSet_[vm].location(), pf, pn, pi) )
+							{
+//2.3.1.	Se ai intersecta o segmento que conecta os vértices vm e vn, faça:
+								if ( this->swapEdges( td, te, ai ) )
+								{
+//2.3.1.1.	Redefina ai como sendo o segmento que conecta os vértices vm e vn,
+//2.3.1.2.	Redefina adequadamente os triângulos tv e tf,
+//2.3.1.3.	Remova a aresta ai de A,
+									aiset.remove(ai);
+									break;
+								}
+							}
+						}
+						if ( aii != aiset.end() )
+							continue;
+//3.	Se não há mais arestas em A, então:
+//3.1.	Termine o algoritmo.
+//4.	Para cada aresta ai de A, faça:
+						aii = aiset.begin();
+						while ( aii != aiset.end() )
+						{
+							long ai = *aii;
+//4.1.	Defina os triângulos td e te compartilham ai,
+							long td = edgeSet_[ai].right();
+							long te = edgeSet_[ai].left();
+//4.2.	Defina os vértices vm e vn dos triângulos td e te que não estão sobre a aresta ai,
+//4.3.	Se ai intersecta o segmento que conecta os vértices vm e vn, faça:
+							if ( this->swapEdges( td, te, ai ) )
+							{
+//4.3.1.	Redefina ai como sendo o segmento que conecta os vértices vm e vn,
+//4.3.2.	Redefina adequadamente os triângulos tv e tf,
+								TeCoord2D pinter;
+								long vt = edgeSet_[ai].to();
+								long vf = edgeSet_[ai].from();
+								TeCoord2D pi;
+								if ( ( vertexSet_[vt].location() == pf ) ||
+									 ( vertexSet_[vf].location() == pf ) ||
+									 ( vertexSet_[vt].location() == pn ) ||
+									 ( vertexSet_[vf].location() == pn ) ||
+									 ( TeSegmentsIntersectPoint(vertexSet_[vt].location(), vertexSet_[vf].location(), pf, pn, pi) == false ))
+								{
+//4.3.3.	Se ai não intersecta r, faça:
+//4.3.3.1.	Remova a aresta ai de A
+									aiset.remove(ai);
+									aii = aiset.begin();
+								}
+								else
+									aii++;
+							}
+							else
+								aii++;
+						}
+//4.3.3.	Retorne a 2.
+					}
+					return true;
+				}
+			}
+		}
+	}
+	return false;
+}
+
+bool
+TeTin::createInitialTriangles(TeBox &box)
+{
+	// Make box 1% bigger
+	zoomOut(box, 1./1.01);
+
+	//	Create and insert initial nodes of the Tin
+ 	vertexSet_.add( TeTinVertex (box.lowerLeft(), TeMAXFLOAT, ONBOXVERTEX, 0 ) ); //v0
+ 	vertexSet_.add( TeTinVertex (TeCoord2D(box.x1(),box.y2()), TeMAXFLOAT,
+		                         ONBOXVERTEX, 1 ) ); //v1
+ 	vertexSet_.add( TeTinVertex (box.upperRight(), TeMAXFLOAT, ONBOXVERTEX, 2 ) ); //v2
+ 	vertexSet_.add( TeTinVertex (TeCoord2D(box.x2(),box.y1()), TeMAXFLOAT,
+		                         ONBOXVERTEX, 3 ) ); //v3
+
+//	Create and insert initial lines of the Tin
+	edgeSet_.add( TeTinEdge (0, 1, -1, 0, NORMALEDGE) ); //a0
+	edgeSet_.add( TeTinEdge (1, 2, -1, 0, NORMALEDGE) ); //a1
+	edgeSet_.add( TeTinEdge (2, 3, -1, 1, NORMALEDGE) ); //a2
+	edgeSet_.add( TeTinEdge (3, 0, -1, 1, NORMALEDGE) ); //a3
+	edgeSet_.add( TeTinEdge (0, 2,  0, 1, NORMALEDGE) ); //a4
+
+//	Create the two initial triangles of the Tin
+//	Update triangles edges
+	triangleSet_.add ( TeTinTriangle (0, 1, 4) );
+	triangleSet_.add ( TeTinTriangle (2, 3, 4) );
+
+	return true;
+}
+
+bool
+TeTin::insertLineSamples ( TeContourLine& line )
+{
+	TeLineSimplify(line, 20., 200.);
+	unsigned long i;
+	for ( i = 0; i < line.size(); i++ )
+	{
+		TeCoord2D pt = line[i];
+		this->insertPoint(pt.x(), pt.y(), line.value());
+	}
+	return true;
+}
+
+bool
+TeTin::isEdgeTriangle (long t)
+{
+	long neighids[3];
+	this->triangle3Neighbors(t, neighids[0],neighids[1],neighids[2]);
+
+	long i;
+	for (i = 0; i < 3; i++)
+		if ( neighids[i] == -1)
+			return true;
+	return false;
+}
+
+void
+TeTin::convexize ()
+{
+	unsigned long eii;
+
+	for (eii = 0; eii < edgeSet_.size(); eii++)
+	{
+		TeTinEdge ei = this->edge(eii);
+		if ((this->vertex(ei.from()).value() > TeTinBIGFLOAT ) ||
+			(this->vertex(ei.to  ()).value() > TeTinBIGFLOAT ) )
+		{
+			if ((this->vertex(ei.from()).value() > TeTinBIGFLOAT ) && 
+				(this->vertex(ei.to  ()).value() > TeTinBIGFLOAT ) )
+				continue;
+			else
+			{
+				long td = ei.right();
+				long te = ei.left();
+				if ( ! this->isEdgeTriangle(td) || ! this->isEdgeTriangle(te) )
+					this->swapEdges( td, te, eii );
+			}
+		}
+	}
+}
+
+//By Fernanda and Eduilson
+bool
+TeTin::createTIN(TeSampleSet& sampleSet, TeContourLineSet& contourSet)
+{
+//Creates original TIN
+  TeBox tinBox(sampleSet.box());
+
+  this->createInitialTriangles(tinBox);
+
+//Sets precision used for building TIN
+  double tol = TePrecision::instance().precision(); // Save old precision
+  double tinPrecision = tinBox.width() / 1.e6; // 1.e6th of deltaX
+  TePrecision::instance().setPrecision(tinPrecision);
+
+  if (TeProgress::instance())
+  {
+    TeProgress::instance()->setCaption("Create TIN");
+	TeProgress::instance()->setMessage("Creating TIN...");
+	TeProgress::instance()->setTotalSteps(sampleSet.size() + contourSet.size());
+  }
+
+  int step = 0;
+
+//Insert samples in TIN
+  int i=0;
+  TeSampleSet::iterator si;
+  for (si = sampleSet.begin(); si != sampleSet.end(); si++)
+  {
+    step++;
+    i+=1;
+	double x = (*si).location().x();
+    double y = (*si).location().y();
+	double z = (*si).value();
+	this->insertPoint(x, y, z);
+
+	TeProgress::instance()->setProgress(step);
+
+	if (TeProgress::instance()->wasCancelled())
+	  return false;
+  }
+
+  TeContourLineSet::iterator ci;
+  for (ci = contourSet.begin(); ci != contourSet.end(); ci++)
+  {
+	step++;
+
+    TeContourLine line( *ci );
+
+	TeLineSimplify(line, tinPrecision*400., tinPrecision*2000);
+
+	double z = (*ci).value();
+	TeContourLine::iterator li;
+	for (li = line.begin(); li != line.end(); li++)
+	{
+	  double x = (*li).x();
+	  double y = (*li).y();
+	  this->insertPoint(x, y, z);
+	}
+
+	TeProgress::instance()->setProgress(step);
+
+	if (TeProgress::instance()->wasCancelled())
+	{
+	  TeProgress::instance()->reset();
+	  return false;
+	}
+  }
+
+//Fixes edge triangles TIN
+  this->convexize();
+  //this->borderUp();
+  TePrecision::instance().setPrecision(tol);
+
+  TeProgress::instance()->reset();
+
+  return true;
+}
+
+bool 
+TeTin::createTIN(TeLayer* inputLayer_ptr, TePolygonSet &ps)
+{
+  TePolygon tp;
+  TeLinearRing tl;
+  int id = 0;
+  int j = 0;
+  int edgeit = 0;
+
+//Set querier parameters
+  bool loadGeometries = true;
+  bool loadAllAttributes = true;
+  TeQuerierParams querierParams(loadGeometries, loadAllAttributes);
+  querierParams.setParams(inputLayer_ptr);
+  TeQuerier querier(querierParams);
+
+//Load instances from layer based in querier parameters
+  if(querier.loadInstances())
+  {
+//  Returns loaded attributes list 
+	TeAttributeList attrList = querier.getAttrList();
+  }
+
+  //! Used to store the attribute's values
+  vector<string> attrValue (0);
+  //! Used to store the attribute's objects ID
+  vector<string> attrId (0);
+  int it = 0;
+  int it_id = 0;
+  int vecSize = 0;
+  int vecIdSize = 0;
+  int I = 0;
+  string Id;
+  //! Containers used to store the attributes values and objects ID
+  map<string, string> val1;
+  map<string, string> val2;
+  map<string, string> val3;
+
+//Traverse all the instances
+  TeSTInstance sti;
+  while(querier.fetchInstance(sti))
+  {// Get attribute's values
+    TePropertyVector vec = sti.getPropertyVector();
+	it_id+=1;
+	vecIdSize = it_id;
+	attrId.resize(vecIdSize);
+	attrId[I] = sti.getObjectId();
+	Id = attrId[I];
+	for(unsigned int i=0; i<vec.size(); ++i)
+	{
+	  string attrName = vec[i].attr_.rep_.name_;
+	  if(attrName == "val1")
+	  {
+	    it+=1;
+		vecSize = it;
+		attrValue.resize(vecSize);
+		attrValue[j] = vec[i].value_;
+		string testeATT = attrValue[j];
+		val1[Id] = attrValue[j];
+		j+=1;
+	  }
+	  if(attrName == "val2")
+	  {
+	    it+=1;
+		vecSize = it;
+		attrValue.resize(vecSize);
+		attrValue[j] = vec[i].value_;
+		string testeATT = attrValue[j];
+		val2[Id] = attrValue[j];
+		j+=1;
+	  }
+	  if(attrName == "val3")
+	  {
+		it+=1;
+		vecSize = it;
+		attrValue.resize(vecSize);
+		attrValue[j] = vec[i].value_;
+		string testeATT = attrValue[j];
+		val3[Id] = attrValue[j];
+		j+=1;
+	  }
+    }
+	I+=1;
+  }
+
+  TeBox tinBox(ps.box());
+  
+  for (unsigned int i=0; i<ps.size(); ++i)
+  {
+    tp=ps[i];
+	string psId = tp.objectId();
+	string value1 = val1[psId];
+	string value2 = val2[psId];
+	string value3 = val3[psId];
+	tl=tp.first();
+
+//  Get 3 polygon's points
+	TeSample sample1 (TeCoord2D(tl[0].x(), tl[0].y()), atof(value1.c_str()));
+	TeSample sample2 (TeCoord2D(tl[1].x(), tl[1].y()), atof(value2.c_str()));
+	TeSample sample3 (TeCoord2D(tl[2].x(), tl[2].y()), atof(value3.c_str()));
+//  Creates samples object ID
+	sample1.objectId(Te2String(id));
+	sample2.objectId(Te2String(id+1));
+	sample3.objectId(Te2String(id+2));
+	TeCoord2D s1 = sample1.location();
+	double v1 = sample1.value();
+	TeCoord2D s2 = sample2.location();
+	double v2 = sample2.value();
+	TeCoord2D s3 = sample3.location();
+	double v3 = sample3.value();
+
+//  Insert TIN nodes
+	TeTinVertexSet::iterator vi = vertexSet_.begin();
+	//if (!vertexSet_.find( TeTinVertex(s1,v1,NORMALVERTEX,0),vi) )
+	//{
+	//  vertexSet_.add( TeTinVertex(s1, v1, NORMALVERTEX, 0));
+	//  vi=vertexSet_.end()-1;
+	//  vi->objectId(sample1.objectId());
+	//}
+//  Gets vertex id
+	string id1 = vi->objectId();
+	//if(!vertexSet_.find( TeTinVertex(s2,v2,NORMALVERTEX,0),vi) )
+	//{
+	//  vertexSet_.add( TeTinVertex(s2, v2, NORMALVERTEX, 0));
+	//  vi=vertexSet_.end()-1;
+	//  vi->objectId(sample2.objectId());
+	//}
+	string id2 = vi->objectId();
+	//if(!vertexSet_.find( TeTinVertex(s3,v3,NORMALVERTEX,0),vi) )
+	//{
+	//  vertexSet_.add( TeTinVertex(s3, v3, NORMALVERTEX, 0));
+	//  vi=vertexSet_.end()-1;
+	//  vi->objectId(sample3.objectId());
+	//}
+	string id3 = vi->objectId();
+
+//  Insert TIN lines
+	TeTinEdgeSet::iterator ei = edgeSet_.begin();
+	//if (!edgeSet_.find( TeTinEdge(atol(id1.c_str()),atol(id2.c_str()),-1,-1,
+	//	                          NORMALEDGE),ei) )
+	//{
+	//  edgeSet_.add( TeTinEdge(atol(id1.c_str()),atol(id2.c_str()),-1,-1,
+	//	                      NORMALEDGE) );
+	//  ei=edgeSet_.end()-1;
+	//  ei->objectId(Te2String(edgeit));
+	//  ++edgeit;
+	//}
+//  Gets the edge id
+	string idedge1 = ei->objectId();
+	//if (!edgeSet_.find( TeTinEdge(atol(id2.c_str()),atol(id3.c_str()),-1,-1,
+	//	                          NORMALEDGE),ei) )
+	//{
+	//  edgeSet_.add( TeTinEdge(atol(id2.c_str()),atol(id3.c_str()),-1,-1,
+	//	                      NORMALEDGE) );
+	//  ei=edgeSet_.end()-1;
+	//  ei->objectId(Te2String(edgeit));
+	//  ++edgeit;
+	//}
+	string idedge2 = ei->objectId();
+	//if (!edgeSet_.find( TeTinEdge(atol(id3.c_str()),atol(id1.c_str()),-1,-1,
+	//	                          NORMALEDGE),ei) )
+	//{
+	//  edgeSet_.add( TeTinEdge(atol(id3.c_str()),atol(id1.c_str()),-1,-1,
+	//	                      NORMALEDGE) );
+	//  ei=edgeSet_.end()-1;
+	//  ei->objectId(Te2String(edgeit));
+	//  ++edgeit;
+	//}
+	string idedge3 = ei->objectId();
+
+//  Insert TIN triangles
+	triangleSet_.add( TeTinTriangle(atol(idedge1.c_str()),atol(idedge2.c_str()),
+		                            atol(idedge3.c_str())) );
+	id = id + 3;
+  }
+
+  return true;
+}
+
+bool
+TeTin::createTIN(TeLayer* inputLayer_ptr)
+{
+	//Set querier parameters
+	bool loadGeometries = true;
+	bool loadAllAttributes = true;
+	TeQuerierParams querierParams(loadGeometries, loadAllAttributes);
+	querierParams.setParams(inputLayer_ptr);
+	TeQuerier querier(querierParams);
+	TeBox tinBox(querierParams.box());
+
+	//Load instances from layer based in querier parameters
+	if(!querier.loadInstances())
+	{
+		cout << "Erro no carregamento dos objetos do layer" << endl;
+	}
+	
+	// Traverse all the instances 
+	TeSTInstance sti;
+	int i=0;
+	TeSampleSet sampleSet;
+	double x; 
+	double y; 
+	double z;
+	while(querier.fetchInstance(sti))
+	{
+		// Plot each attribute, its name and value
+		TePropertyVector vec = sti.getPropertyVector();
+		for(unsigned int i=0; i<vec.size(); ++i)
+		{
+			string  attrName = vec[i].attr_.rep_.name_;
+			if (attrName =="z")
+			{
+				string  attrValue = vec[i].value_;
+				z = atof (attrValue.c_str());
+			}
+		}
+
+		//Get geometries
+		if(sti.hasPoints())
+		{
+			TePointSet ponSet;
+			TePoint    pt;
+			sti.getGeometry(ponSet);
+
+			for(unsigned int i=0; i<ponSet.size(); ++i)
+			{
+				x = atof ( Te2String(ponSet[i].location().x(), 7).c_str() );
+				y = atof ( Te2String(ponSet[i].location().y(), 7).c_str());
+			}
+		}
+
+		cout << endl << endl;
+		//discard ONBOXVERTEX's vertex
+		if (z <= 340000000)
+			sampleSet.add ( TeSample(TeCoord2D(x, y), z) );
+
+	}
+	TeContourLineSet contourSet;
+	this->createTIN(sampleSet,contourSet);
+
+  return true;
+}
+
+bool
+TeTin::createAttrTable(TeTable& attrTable, TeDatabase* db, TeLayer* layer)
+{
+//Creates an attribute table
+//Defines a list of attributes
+  TeAttributeList attList;
+  TeAttribute at;
+  at.rep_.type_ = TeSTRING;
+  at.rep_.numChar_ = 16;
+  at.rep_.name_ = "object_id";
+  at.rep_.isPrimaryKey_ = true;
+  attList.push_back(at);
+
+  at.rep_.type_ = TeREAL;
+  at.rep_.decimals_ = 6;
+  at.rep_.name_ = "val1";
+  at.rep_.isPrimaryKey_ = false;
+  attList.push_back(at);
+
+  at.rep_.type_ = TeREAL;
+  at.rep_.decimals_ = 6;
+  at.rep_.name_ = "val2";
+  at.rep_.isPrimaryKey_ = false;
+  attList.push_back(at);
+
+  at.rep_.type_ = TeREAL;
+  at.rep_.decimals_ = 6;
+  at.rep_.name_ = "val3";
+  at.rep_.isPrimaryKey_ = false;
+  attList.push_back(at);
+
+  at.rep_.type_ = TeREAL;
+  at.rep_.decimals_ = 6;
+  at.rep_.name_ = "slope";
+  at.rep_.isPrimaryKey_ = false;
+  attList.push_back(at);
+
+  at.rep_.type_ = TeREAL;
+  at.rep_.decimals_ = 6;
+  at.rep_.name_ = "aspect";
+  at.rep_.isPrimaryKey_ = false;
+  attList.push_back(at);
+
+  string tablename (attrTable.name());
+//Creates an attribute table associated to the new layer
+//Creates a table in memory
+  TeTable attTable(tablename, attList, "object_id", "object_id");
+  if (!layer->createAttributeTable(attTable))
+	 return false;
+
+  attrTable = attTable;
+  return true;
+}
+
+bool
+TeTin::createPolygon(TePolygonSet ps, TeTable& attTable, int t, TeCoord2D& pt0,
+			         TeCoord2D& pt1, TeCoord2D& pt2, double& val0, double& val1,
+					 double& val2)
+{
+//Creates a set of polygons
+  TeLine2D line;
+  line.add(pt0);
+  line.add(pt1);
+  line.add(pt2);
+  line.add(pt0);
+
+  TeLinearRing r1(line);
+  TePolygon poly1;
+  poly1.add(r1);
+
+  poly1.objectId(Te2String(t));
+
+  ps.add(poly1);
+
+//Each row is related to one of the geometries by its objetc_id
+  TeTableRow row;
+  row.push_back(Te2String(t));
+  row.push_back(Te2String(val0,6));
+  row.push_back(Te2String(val1,6));
+  row.push_back(Te2String(val2,6));
+//Adds the row in the attributes table
+  attTable.add(row);
+  row.clear();
+
+  return true;
+}
+
+bool
+TeTin::createPolygon(TePolygonSet ps, TeTable& attTable, int t, TeCoord2D& pt0,
+			         TeCoord2D& pt1, TeCoord2D& pt2, double& val0, double& val1,
+					 double& val2,double& slope, double& aspect)
+{
+//Creates a set of polygons
+  TeLine2D line;
+  line.add(pt0);
+  line.add(pt1);
+  line.add(pt2);
+  line.add(pt0);
+
+  TeLinearRing r1(line);
+  TePolygon poly1;
+  poly1.add(r1);
+
+  poly1.objectId(Te2String(t));
+
+  ps.add(poly1);
+
+//Each row is related to one of the geometries by its objetc_id
+  TeTableRow row;
+  row.push_back(Te2String(t));
+  row.push_back(Te2String(val0,6));
+  row.push_back(Te2String(val1,6));
+  row.push_back(Te2String(val2,6));
+  row.push_back(Te2String(slope,2));
+  row.push_back(Te2String(aspect,2));
+  
+//Adds the row in the attributes table
+  attTable.add(row);
+  row.clear();
+
+  return true;
+}
+
+bool
+TeTin::saveTIN(TeDatabase* db, TeLayer* layer, TePolygonSet& ps,
+			   TeTable& attTable)
+{
+//Adds the polygon set to the layer
+//As addGeometry wasn´t called before, the table of polygons will have a default name
+  if (!layer->addPolygons(ps))
+	  return false;
+
+//Saves attributes table in database
+  if (!layer->saveAttributeTable(attTable))
+	  return false;
+
+  return true;
+}
+
+bool
+TeTin::saveVertexTIN(TeDatabase* db, TeLayer* layer, TePointSet& ps,
+			   TeTable& attTable)
+{
+//Adds the point set to the layer
+//As addGeometry wasn´t called before, the table of polygons will have a default name
+	if (!layer->addPoints(ps))
+	  return false;
+
+//Saves attributes table in database
+  if (!layer->saveAttributeTable(attTable))
+	  return false;
+
+  return true;
+}
+
+
+bool
+TeTin::saveTINdb(TeDatabase* db, string& outlayername, string& tablename)
+{
+  int triang = 0;
+  TePolygonSet ps;
+  TeBox bbox = this->box();
+
+//Creates a projection
+  TeDatum mDatum = TeDatumFactory::make("SAD69");
+  TeProjection* pUTM = new TeUtm(mDatum,0.0);
+
+//Checks if the attributes table already exist in database
+  if(db->tableExist(tablename))
+	  return false;
+
+//Checks if the layer already exist in database
+  if (db->layerExist(outlayername))
+	  return false;
+
+//Creates a new layer with selected layer's name
+  TeLayer* layer = new TeLayer(outlayername, db, bbox, pUTM);
+  if (layer->id() <= 0)   // layer wasn´t created properly
+	  return false;
+
+//Adds the geometry representation Polygons and stores it in a table with default name
+  if (!layer->addGeometry(TePOLYGONS))
+	  return false;
+
+//Creates attribute table with name selected by user
+  TeTable attTable (tablename);
+  if(!createAttrTable(attTable, db, layer))
+	  return false;
+
+  TeTinTriangleIterator ti;
+  for (ti = this->triangleBegin(); ti != this->triangleEnd(); ti++)
+  {
+	  long v0,v1,v2;
+	  this->triangleVertices(*ti,v0,v1,v2);
+	  if( vertex(v0).type() != ONBOXVERTEX && vertex(v1).type() != ONBOXVERTEX && vertex(v2).type() != ONBOXVERTEX) 
+	  {
+          TeCoord2D pt[3];
+		  double val[3];
+
+		//  Create triangles points
+		  this->triangle3DPoints(*ti, pt[0], pt[1], pt[2], val[0], val[1], val[2]);
+
+		//	Calculates triangle's slope
+		  double slope;
+		  this->slopeTriangle(*ti,slope,'g');
+
+		// Calculates triangle's aspect
+		  double aspect;
+		  this->aspectTriangle(*ti,aspect);
+
+		//  Create triangles
+		  if (!createPolygon(ps, attTable, triang, pt[0], pt[1], pt[2], val[0],
+						val[1], val[2],slope,aspect))
+		  return false;
+
+		  triang++;
+	  }
+  }
+ 
+  if (!saveTIN(db, layer, ps, attTable))
+	  return false;
+  
+  return true;
+}
+
+bool 
+TeTin::saveVertexTINdb(TeDatabase* db, string& outlayername, string& tablename)
+{
+  int triang = 0;
+  TePointSet ps;
+  TeBox bbox = this->box();
+
+//Creates a projection
+  TeDatum mDatum = TeDatumFactory::make("SAD69");
+  TeProjection* pUTM = new TeUtm(mDatum,0.0);
+
+//Checks if the attributes table already exist in database
+  if(db->tableExist(tablename))
+	  return false;
+
+//Checks if the layer already exist in database
+  if (db->layerExist(outlayername))
+	  return false;
+
+//Creates a new layer with selected layer's name
+  TeLayer* layer = new TeLayer(outlayername, db, bbox, pUTM);
+  if (layer->id() <= 0)   // layer wasn´t created properly
+	  return false;
+
+//Adds the geometry representation Points and stores it in a table with default name
+  if (!layer->addGeometry(TePOINTS))
+	  return false;
+
+//Creates attribute table with name selected by user
+  TeTable attTable (tablename);
+
+//Creates PointSet with TIN's vertex
+  if(!this->createPointSet(ps,attTable,layer,db))
+		return false;
+   
+  if (!saveVertexTIN(db, layer, ps, attTable))
+	  return false;
+  
+  return true;
+}
+
+void
+TeTin::borderUp ()
+{
+  unsigned long vii;
+  unsigned long eii;
+  unsigned long tit;
+  long edge0, edge1, edge2;
+  TeTinVertex vv;
+  TeTinEdge e;
+  TeTinTriangle t;
+
+  //Search ONBOXVERTEX vertex
+  for (vii = 0; vii < vertexSet_.size(); ++vii)
+  {
+	  if (vertexSet_[vii].type() == ONBOXVERTEX)
+	  {//if vertex has ONBOXVERTEX type
+	    //Search adjacent edges to the vertex
+	    std::list <long> vauxedges;
+		vertexEdges(vii, vauxedges);
+		std::list<long>::iterator eit;
+		for (eit = vauxedges.begin(); eit != vauxedges.end(); ++eit)
+		{
+		  //Swaps vertex reference in the edges (from and/or to) for NULL
+		  long from = edgeSet_[(*eit)].from();
+		  long to = edgeSet_[(*eit)].to();
+		  if (from == vii)
+			  edgeSet_[(*eit)].setVertices(-1, to);
+		  else if (to == vii)
+			  edgeSet_[(*eit)].setVertices(from, -1);
+		}
+		
+		unsigned long viiaux;
+		//For all vertex with index bigger than removed vertex
+		for (viiaux = vii + 1; viiaux < vertexSet_.size(); ++viiaux)
+		{
+			std::list <long> vedges;
+		    this->vertexEdges(viiaux, vedges);
+		    //Updates vertex index in the adjacent edges
+		    for (eit = vedges.begin(); eit != vedges.end(); ++eit)
+		    {
+		      long from = edgeSet_[(*eit)].from();
+		      long to = edgeSet_[(*eit)].to();
+			  if (from == viiaux)
+                  edgeSet_[(*eit)].setVertices(from-1, to);
+			  else if (to == viiaux)
+                  edgeSet_[(*eit)].setVertices(from, to-1);
+		    }
+		}
+		//Removes vertex from vertexSet
+		vertexSet_.erase(vii);
+		vii = vii - 1;
+	  }//end if vertex has ONBOXVERTEX type
+  }
+
+  //Search edges with NULL vertex from and/or to
+  for (eii = 0; eii < edgeSet_.size(); ++eii)
+  {
+	long vfrom = edgeSet_[eii].from();
+	long vto = edgeSet_[eii].to();
+	//if (edgeSet_[eii].from() == -1 || edgeSet_[eii].to() == -1)
+	if (vfrom == -1 || vto == -1)
+	{//if from or to are NULL
+	//Swaps edge reference in the triangles for NULL
+	  long tleft = edgeSet_[eii].left();
+	  long tright = edgeSet_[eii].right();
+
+	  //Check if triangle edges are equal eii
+	  if (tleft != -1)
+	  {
+	    //left triangle
+	    triangleSet_[tleft].edges(edge0, edge1, edge2);
+	    if (edge0 == eii)
+		    triangleSet_[tleft].setEdges(-1, edge1, edge2);
+	    if (edge1 == eii)
+		    triangleSet_[tleft].setEdges(edge0, -1, edge2);
+	    if (edge2 == eii)
+		    triangleSet_[tleft].setEdges(edge0, edge1, -1);
+	  }
+	  if (tright != -1)
+	  {
+	    //right triangle
+	    triangleSet_[tright].edges(edge0, edge1, edge2);
+	    if (edge0 == eii)
+		    triangleSet_[tright].setEdges(-1, edge1, edge2);
+	    if (edge1 == eii)
+		    triangleSet_[tright].setEdges(edge0, -1, edge2);
+	    if (edge2 == eii)
+		    triangleSet_[tright].setEdges(edge0, edge1, -1);
+	  }
+
+	  //Checks if vertex from and to have reference to this edge in onEdge
+	  //If, there is the reference, changes it to another adjacent edge.
+	  std::list <long> edgesadj;
+	  std::list<long>::iterator eit = edgesadj.begin();
+	  if (vfrom != -1)
+	  {
+	    if (vertexSet_[vfrom].oneEdge() == eii)//vertex from
+	    {
+	      this->vertexEdges(vfrom, edgesadj);
+		  for (eit = edgesadj.begin(); eit != edgesadj.end(); ++eit)
+		  {
+		    if ((*eit) != -1 && (*eit) != eii)
+		    {
+		      vertexSet_[vfrom].setOneEdge((*eit));
+		      break;
+		    }
+		  }
+	    }
+	  }
+
+	  if (vto != -1)
+	  {
+	    if (vertexSet_[vto].oneEdge() == eii)//vertex to
+	    {
+	      this->vertexEdges(vto, edgesadj);
+		  for (eit = edgesadj.begin(); eit != edgesadj.end(); ++eit)
+		  {
+		    if ((*eit) != -1 && (*eit) != eii)
+		    {
+		      vertexSet_[vto].setOneEdge((*eit));
+			  break;
+		    }
+		  }
+	    }
+	  }
+	  
+	  unsigned long eiiaux;
+	  for (eiiaux = eii + 1; eiiaux < edgeSet_.size(); ++eiiaux)
+	  {//For all edges with index bigger than removed edge
+	    //Updates edge index in the triangles left and right
+		  long left = edgeSet_[eiiaux].left();
+		  long right = edgeSet_[eiiaux].right();
+		  if (left != -1)
+	      {
+	        //left triangle
+	        triangleSet_[left].edges(edge0, edge1, edge2);
+	        if (edge0 == eiiaux)
+		        triangleSet_[left].setEdges(edge0 - 1, edge1, edge2);
+	        if (edge1 == eiiaux)
+		        triangleSet_[left].setEdges(edge0, edge1 - 1, edge2);
+	        if (edge2 == eiiaux)
+		        triangleSet_[left].setEdges(edge0, edge1, edge2 - 1);
+	      }
+	      if (right != -1)
+	      {
+            //right triangle
+	        triangleSet_[right].edges(edge0, edge1, edge2);
+	        if (edge0 == eiiaux)
+		        triangleSet_[right].setEdges(edge0 - 1, edge1, edge2);
+	        if (edge1 == eiiaux)
+		        triangleSet_[right].setEdges(edge0, edge1 - 1, edge2);
+	        if (edge2 == eiiaux)
+		        triangleSet_[right].setEdges(edge0, edge1, edge2 - 1);
+	      }
+
+	    //Updates onEdge of vertex
+	    //provavel erro aqui...tem q testar se o onedge e o edge apontado.
+		  //vertexSet_[edgeSet_[eiiaux].from()].setOneEdge(eiiaux-1);
+		  //vertexSet_[edgeSet_[eiiaux].to()].setOneEdge(eiiaux-1);
+		  if (vertexSet_[edgeSet_[eiiaux].from()].oneEdge() >= eiiaux)
+		  	  vertexSet_[edgeSet_[eiiaux].from()].setOneEdge(eiiaux-1);
+		  if (vertexSet_[edgeSet_[eiiaux].to()].oneEdge() >= eiiaux)
+		  	  vertexSet_[edgeSet_[eiiaux].to()].setOneEdge(eiiaux-1);
+		  
+	  }
+
+	  //Removes edge from edgeSet
+	  edgeSet_.erase(eii);
+	  eii = eii - 1;
+	}//end if from or to are NULL
+  }
+
+  //Search triangles with NULL reference
+  for (tit = 0; tit < triangleSet_.size(); ++tit)
+  {
+	triangleSet_[tit].edges(edge0, edge1, edge2);
+	if (edge0 == -1 || edge1 == -1 || edge2 == -1)
+	{//if triangle has NULL edge
+	  //For each triangle to be removed:
+	  //Changes triangle reference in the edges (left and right) to -1
+	  if (edge0 != -1)
+	  {
+		if (this->edge(edge0).left() == tit)
+		    this->edge(edge0).setTriangles(-1, this->edge(edge0).right());
+		else if (this->edge(edge0).right() == tit)
+		    this->edge(edge0).setTriangles(this->edge(edge0).left(), -1);
+      }
+
+	  if (edge1 != -1)
+	  {
+	    if (this->edge(edge1).left() == tit)
+		    this->edge(edge1).setTriangles(-1, this->edge(edge1).right());
+		else if (this->edge(edge1).right() == tit)
+		    this->edge(edge1).setTriangles(this->edge(edge1).left(), -1);
+	  }
+	  if (edge2 != -1)
+	  {
+	    if (this->edge(edge2).left() == tit)
+		    this->edge(edge2).setTriangles(-1, this->edge(edge2).right());
+		else if (this->edge(edge2).right() == tit)
+		    this->edge(edge2).setTriangles(this->edge(edge2).left(), -1);
+	  }
+
+	  //Updates triangle left and/or right of edges
+	  for (eii = 0; eii < edgeSet_.size(); ++eii)
+	  {
+          //Swaps triangles left and/or right reference in the edges for 
+          long tleft = edgeSet_[eii].left();
+          long tright = edgeSet_[eii].right();
+		  if (tleft >= tit)
+			  edgeSet_[eii].setTriangles(tleft - 1,tright);
+		  if (tright >= tit)
+			  edgeSet_[eii].setTriangles(tleft, tright - 1);
+	  }
+
+	  //Removes triangle from triangleSet
+	  triangleSet_.erase(tit);
+	  tit = tit - 1;
+	}//end if triangle has NULL edge
+  }
+
+
+}
+
+void
+TeTin::writeTriangleEdgesSPRFile (std::string& name, TeRaster* raster)
+{
+	fstream sprcfile;
+	sprcfile.open ( name.c_str(), ios::out );
+
+	sprcfile << "Total de vertices:" << vertexSet_.size()<<"\n"; 
+	sprcfile << "Indice Type"<<"\n";
+	for(unsigned int i=0;i < vertexSet_.size(); ++i)
+	{
+		TeCoord2D collin = raster->coord2Index(vertexSet_[i].location());
+
+		sprcfile << i <<" "<< vertexSet_[i].type()<<" "
+						   <<collin.x()<<"  "//<<vertexSet_[i].location().x()<<"  "
+						   <<collin.y()<<"  "//<<vertexSet_[i].location().y()<<"  "
+						   <<vertexSet_[i].value()<<"   "
+						   <<vertexSet_[i].oneEdge()<<"\n";
+	}
+
+    sprcfile << "Lista de Edges"<<"\n";
+	sprcfile << "Total de Edges:" << edgeSet_.size()<<"\n"; 
+	sprcfile << "Indice  FROM  TO  LEFT  RIGHT"<<"\n";
+	for(unsigned int i=0;i < edgeSet_.size(); ++i)
+	{
+		sprcfile << i <<"  "<< edgeSet_[i].from()<<"  "<<edgeSet_[i].to()<<"  "<<edgeSet_[i].left()<<"  "<<edgeSet_[i].right()<<"\n";
+	}
+
+	sprcfile << "Lista de Triangulos"<<"\n";
+	sprcfile << "Total de Triangulos:"<<triangleSet_.size()<<"\n";
+	sprcfile << "Indice  Edge0  Edge1  Edge2"<<"\n";
+	for (unsigned int i =0; i<triangleSet_.size(); ++i)
+	{
+		long e0, e1, e2;
+		triangleSet_[i].edges(e0,e1,e2);
+		sprcfile << i <<"  "<< e0<<"  "<< e1<<"  "<< e2<<"\n";
+	}
+
+	TeTin::TeTinTriangleIterator ti;
+	for (ti = this->triangleBegin(); ti != this->triangleEnd(); ti++)
+	{
+		TeCoord2D pt[3];
+		long from, to;
+		long edge0, edge1, edge2;
+		long t1, t2;
+		(*ti).edges(edge0, edge1, edge2);
+		from = this->edge(edge0).from();
+		to = this->edge(edge0).to();
+		t1 = edgeSet_[edge0].left();
+		t2 = edgeSet_[edge0].right();
+		
+		sprcfile << "Edge0: " << edge0 << "\n";
+		sprcfile << "Left triangle: " << t1 << "\n";
+		sprcfile << "Right triangle: " << t2 << "\n";
+		sprcfile << "Vertex from: " << from << "\n";
+		sprcfile << "Vertex to: " << to << "\n";
+		sprcfile << "---------------------------" << "\n";
+		sprcfile << "Edge1: " << edge1 << "\n";
+		from = this->edge(edge1).from();
+		to = this->edge(edge1).to();
+		t1 = edgeSet_[edge1].left();
+		t2 = edgeSet_[edge1].right();
+		sprcfile << "Left triangle: " << t1 << "\n";
+		sprcfile << "Right triangle: " << t2 << "\n";
+		sprcfile << "Vertex from: " << from << "\n";
+		sprcfile << "Vertex to: " << to << "\n";
+		sprcfile << "---------------------------" << "\n";
+		sprcfile << "Edge2: " << edge2 << "\n";
+		from = this->edge(edge2).from();
+		to = this->edge(edge2).to();
+		t1 = edgeSet_[edge2].left();
+		t2 = edgeSet_[edge2].right();
+		sprcfile << "Left triangle: " << t1 << "\n";
+		sprcfile << "Right triangle: " << t2 << "\n";
+		sprcfile << "Vertex from: " << from << "\n";
+		sprcfile << "Vertex to: " << to << "\n";
+		sprcfile << "---------------------------" << "\n";
+	}
+
+	sprcfile.close ();
+}
+
+void
+TeTin::areaTriangle (TeTinTriangle& t, float &area) //by Eduilson
+{
+	long v0, v1, v2;
+	this->triangleVertices(t, v0, v1, v2);
+	TeTinVertex vertex0, vertex1, vertex2;
+	vertex0 = this->vertex(v0);
+	vertex1 = this->vertex(v1);
+	vertex2 = this->vertex(v2);
+	//area = TriangleArea2D((float)vertex0.location().x(), (float)vertex0.location().y(),
+	//	                  (float)vertex1.location().x(), (float)vertex1.location().y(),
+	//					  (float)vertex2.location().x(), (float)vertex2.location().y());
+}
+
+bool 
+TeTin::normalTriangle(TeTinTriangle& t, std::vector<double> &nvector) //by Eduilson (adaptado do SPRING)
+{
+	long v0, v1, v2;
+	this->triangleVertices(t, v0, v1, v2);
+	TeTinVertex vertex0, vertex1, vertex2;
+	vertex0 = this->vertex(v0);
+	vertex1 = this->vertex(v1);
+	vertex2 = this->vertex(v2);
+
+	nvector.push_back(0);
+	nvector.push_back(0);
+	nvector.push_back(0);
+
+	//	Define normal vector (uvx,uvy,uvz)
+	double ux = vertex1.location().x() - vertex0.location().x(); 
+	double vx = vertex2.location().x() - vertex0.location().x(); 
+	double uy = vertex1.location().y() - vertex0.location().y(); 
+	double vy = vertex2.location().y() - vertex0.location().y(); 
+	double uz = vertex1.value() - vertex0.value();
+	double vz = vertex2.value() - vertex0.value();
+
+	if ( ( ux == 0 ) && ( vx == 0 ) )
+	{
+		nvector[0] = 1.;
+		nvector[1] = 0.;
+		nvector[2] = 0.;
+		return true;
+	}
+	if ( ( uy == 0 ) && ( vy == 0 ) )
+	{
+		nvector[0] = 0.;
+		nvector[1] = 1.;
+		nvector[2] = 0.;
+		return true;
+	}
+	if ( ( uz == 0 ) && ( vz == 0 ) )
+	{
+		nvector[0] = 0.;
+		nvector[1] = 0.;
+		nvector[2] = 1.;
+		return true;
+	}
+
+	nvector[2] = ux * vy - vx * uy;
+	if (nvector[2] < 0.)
+	{
+		//Make sure that normal vector is always positive
+		nvector[2] = -nvector[2];
+		nvector[0] = vy * uz - uy * vz;
+		nvector[1] = ux * vz - vx * uz;
+	}
+	else
+	{
+		nvector[0] = uy * vz - vy * uz;
+		nvector[1] = vx * uz - ux * vz;
+	}
+	return true;
+}
+
+void
+TeTin::slopeTriangle(TeTinTriangle& t,double &slope, char slopetype)
+{
+	slope = triangleGradient(t,'s',slopetype);
+}
+
+void
+TeTin::aspectTriangle(TeTinTriangle& t, double &aspect)
+{
+	aspect = triangleGradient(t,'a',' ');
+}
+
+
+double
+TeTin::triangleGradient(TeTinTriangle& t, char gradtype, char slopetype)
+{
+	long v0, v1, v2;
+	this->triangleVertices(t, v0, v1, v2);
+	TeTinVertex vertex0, vertex1, vertex2;
+	vertex0 = this->vertex(v0);
+	vertex1 = this->vertex(v1);
+	vertex2 = this->vertex(v2);
+	std::vector<double> nvector;
+	double	moduv, decliv,
+		pi180 = 180./3.1415927;
+	double	m1, m2;
+	double tol = (double).01;
+
+	//	Special cases
+
+	m1 = m2 = (double)TeMAXFLOAT;
+
+	if(((double)vertex1.location().y() - (double)vertex0.location().y()) != (double)0.0)
+		m1 = (vertex1.location().x() - vertex0.location().x()) / (vertex1.location().y() - vertex0.location().y());
+
+	if(((double)vertex2.location().y() - (double)vertex0.location().y()) != (double)0.0)
+		m2 = (vertex2.location().x() - vertex0.location().x()) / (vertex2.location().y() - vertex0.location().y());
+
+	if (fabs(m1 - m2) < tol)
+		//		Triangle with DUMMY Value
+		return (double)TeMAXFLOAT;
+
+	if ((vertex0.value() > TeTinBIGFLOAT) || (vertex1.value() > TeTinBIGFLOAT) || (vertex2.value() > TeTinBIGFLOAT))
+		//		Triangle with DUMMY Value
+		return (double)TeMAXFLOAT;
+
+	if ((vertex0.value() == vertex1.value()) && (vertex0.value() == vertex2.value()))
+	{
+		if (gradtype == 's')
+			//	Slope is zero
+			return 0.;
+		else
+			//	exposition DUMMY
+			return (double)TeMAXFLOAT;
+	}
+
+	this->normalTriangle(t, nvector);
+	moduv = sqrt(pow(nvector[0],2.) + pow(nvector[1],2.) +
+		pow(nvector[2],2.));
+
+	if (gradtype == 's')
+	{
+		//Case Slope		
+		if (slopetype == 'g') // degres
+			decliv = pi180*acos(nvector[2]/moduv);
+		else
+			decliv = tan(acos(nvector[2]/moduv)) * 100.;
+	}
+	else
+	{
+		//Case Aspect		
+		decliv = 90. - pi180*atan2(nvector[1],nvector[0]);
+		if (decliv < 0.)
+			decliv = 360. + decliv;
+	}
+
+	return decliv;
+}
+
+
+bool 
+TeTin::createPointSet(TePointSet& ps, TeTable& atttable, TeLayer* layer, TeDatabase* db)
+{
+	//Creates an attribute table
+	//Defines a list of attributes
+	TeAttributeList attList;
+	TeAttribute at;
+	at.rep_.type_ = TeSTRING;
+	at.rep_.numChar_ = 16;
+	at.rep_.name_ = "object_id";
+	at.rep_.isPrimaryKey_ = true;
+	attList.push_back(at);
+
+	at.rep_.type_ = TeREAL;
+	at.rep_.name_ = "z";
+	at.rep_.isPrimaryKey_ = false;
+	at.rep_.decimals_ = 6;
+	attList.push_back(at);
+
+	atttable.setAttributeList(attList);
+	atttable.setUniqueName("object_id");
+	atttable.setLinkName("object_id");
+
+	if (!layer->createAttributeTable(atttable))
+		return false;
+
+	for(unsigned int i=0;i < this->vertexSet_.size(); ++i)
+	{
+		if(vertexSet_[i].type() != ONBOXVERTEX)
+		{
+			TePoint pt(vertexSet_[i].location().x(),vertexSet_[i].location().y());
+			pt.objectId(Te2String(i));
+			ps.add(pt);
+			TeTableRow row;
+			row.push_back(Te2String(i));
+			row.push_back(Te2String(vertexSet_[i].value(),6));
+			atttable.add(row);
+			row.clear();
+		}
+	}
+	return true;
+}
+
+bool
+TeTin::defineInterLinesColumns(TeRaster* raster, TeTinTriangle t, int& fline, int& lline, int& fcol, int& lcol)
+{
+	double rx1 = raster->box().x1();// + (raster->params().resx_ / 2);
+	double ry2 = raster->box().y2();// - (raster->params().resy_ / 2);
+	
+	TeCoord2D llpt(TeCoord2D(TeMAXFLOAT, TeMAXFLOAT));
+	TeCoord2D urpt(TeCoord2D(-TeMAXFLOAT, -TeMAXFLOAT));
+
+	long v[3];
+	//busca vertices do triangulo
+	this->triangleVertices(t, v[0], v[1], v[2]);
+
+	for (int i = 0; i < 3; i++)
+	{
+		TeTinVertex vertex = this->vertex(v[i]);
+
+		if (vertex.type() == ONBOXVERTEX)
+			return false;
+
+		if (vertex.location() < llpt)
+			llpt = vertex.location();
+		if (urpt < vertex.location())
+			urpt = vertex.location();
+	}
+
+	llpt.x(llpt.x() - (raster->params().resx_ / 1000));
+	urpt.x(urpt.x() + (raster->params().resx_ / 1000));
+	llpt.y(llpt.y() - (raster->params().resy_ / 1000));
+	urpt.y(urpt.y() + (raster->params().resy_ / 1000));
+
+	//Calculate lines and columns intercepted
+	fcol = (int)((llpt.x() - rx1) / raster->params().resx_) - 1;
+	lcol = (int)((urpt.x() - rx1) / raster->params().resx_) + 1;
+	fline = (int)((ry2 - urpt.y()) / raster->params().resy_) - 1;
+	lline = (int)((ry2 - llpt.y()) / raster->params().resy_) + 1;
+
+	if ((raster->params().ncols_ <= fcol) || (lcol < 0) ||
+		(raster->params().nlines_ <= fline) || (lline < 0))
+		return false;
+
+	return true;
+}
+
+void
+TeTin::linearInterpolation(TeRaster* raster, int band, TeTinTriangle t, int fline, int lline,int fcol, int lcol)
+{
+	long v0,v1,v2;
+	
+	//busca vertices do triangulo
+	this->triangleVertices(t,v0,v1,v2);
+	std::list<long> vertices;
+
+	TeTinVertex vertex0 = this->vertex(v0);
+	TeTinVertex vertex1 = this->vertex(v1);
+	TeTinVertex vertex2 = this->vertex(v2);
+
+	double resx = raster->params().resx_;
+	double resy = raster->params().resy_;
+
+	double rx1 = raster->box().x1();// + (resx / 2);
+	double ry2 = raster->box().y2();// - (resy / 2);
+
+	double x1_x0 = vertex1.location().x() - vertex0.location().x();
+	double x2_x0 = vertex2.location().x() - vertex0.location().x();
+	double y1_y0 = vertex1.location().y() - vertex0.location().y();
+	double y2_y0 = vertex2.location().y() - vertex0.location().y();
+	double z1_z0 = vertex1.value() - vertex0.value();
+	double z2_z0 = vertex2.value() - vertex0.value();
+
+	for (int l = fline; l <= lline; l++)
+	{
+		for (int c = fcol; c <= lcol; c++)
+		{
+			TeCoord2D pt(TeCoord2D(rx1 + (c * resx), ry2 - (l * resy)));
+
+			if (!this->triangleContainsPoint(t, pt))
+				continue;
+
+			double detx = ((y1_y0 * z2_z0) - (y2_y0 * z1_z0)) * (pt.x() - vertex0.location().x());
+			double dety = ((z1_z0 * x2_x0) - (z2_z0 * x1_x0)) * (pt.y() - vertex0.location().y());
+			double detz = (x1_x0 * y2_y0) - (x2_x0 * y1_y0);
+
+			double z = (float)((detx + dety - (detz * vertex0.value())) / (- detz));
+
+			raster->setElement(c, l, z, band);
+		}
+	}
+}
+
+bool
+TeTin::interpolationPoint(TeCoord2D &pt, double &z)
+{
+	long t,v0,v1,v2;
+	//busca triangulo onde incide o ponto
+	t = this->triangleAt(pt);
+	if (t == -1 || t== NULL)
+	{
+		z=-1;
+		return false;
+	}
+	
+	//busca vertices do triangulo
+	this->triangleVertices(t,v0,v1,v2);
+	std::list<long> vertices;
+	
+	//Preenche a lista com todos os vertices vizinhos ao ponto
+	this->vertexOppVertices(v0,vertices);
+	this->vertexOppVertices(v1,vertices);
+	this->vertexOppVertices(v2,vertices);
+
+	//Elimina vertices iguais
+	vertices.sort();
+	vertices.unique();
+
+	double sum1=0, sum2=0;
+	std::list<long>::iterator it_vert;
+	for(it_vert = vertices.begin();it_vert!=vertices.end();it_vert++)
+	{
+		TeTinVertex &v = this->vertex(*it_vert);
+		if(v.type() != ONBOXVERTEX ) //eliminar os vertices ONBOXVERTEX
+		{
+			TeCoord2D pt2(v.location().x(),v.location().y());
+			double dist = TeDistance(pt,pt2);
+			sum1 = sum1 + (v.value()/dist);
+			sum2 = sum2 + (1/dist);
+		}
+	}
+
+	z = sum1/sum2;
+	return true;
+}
+
+bool 
+TeTin::slopeaspectPoint(TeCoord2D &pt,double &s,double &a)
+{
+	//busca triangulo onde incide o ponto
+	long t = this->triangleAt(pt);
+	if (t == -1 || t== NULL)
+		return false;
+	this->slopeTriangle(triangle(t),s,'g');
+	this->aspectTriangle(triangle(t),a);
+	return true;
+}
+
+bool
+TeTin::vertexOncontour(long &v)
+{
+	std::list<long> edges;
+	std::list<long>::iterator ie;
+	this->vertexEdges(v,edges);
+	for(ie = edges.begin(); ie != edges.end(); ie++)
+	{
+		if( (edge(*ie).left() == -1) || (edge(*ie).right() == -1))
+			return true;
+	}
+	return false;
+}
+
+bool
+TeTin::createSampleSet(TeSampleSet& sample)
+{
+	for(unsigned int i=0;i < vertexSet_.size(); ++i)
+		if(vertexSet_[i].type() != ONBOXVERTEX) 
+			sample.add ( TeSample(TeCoord2D(vertexSet_[i].location().x(), vertexSet_[i].location().y()), vertexSet_[i].value()) );
+
+	return true;
+}
\ No newline at end of file
diff --git a/src/terralib/kernel/TeTin.h b/src/terralib/kernel/TeTin.h
old mode 100755
new mode 100644
index 3b6d567..372b637
--- a/src/terralib/kernel/TeTin.h
+++ b/src/terralib/kernel/TeTin.h
@@ -1,445 +1,667 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeTin.h
-    \brief This file provides support for a TIN structure
-*/
-#ifndef  __TERRALIB_INTERNAL_TIN_H
-#define  __TERRALIB_INTERNAL_TIN_H
-
-#include "TeGeometry.h"
-#include <list>
-#include <set>
-
-/** @} */ 
- 
-/** @defgroup MathConst Mathematical constants and macro definitions for use in Tin
-  @{
- */
-const double	TeTinBIGFLOAT = TeMAXFLOAT / 10.;		//!< Near Maximum float value - TeMAXFLOAT / 10.
-
-//!  Tin Vertex types 
-enum TeTinVertexType 
-{ NORMALVERTEX = 0, ONCONTOURVERTEX = 1, ONBREAKLINEVERTEX = 0x10 };
-
-//!  A basic class for handling vertex of TIN
-/*!
-	\sa TeGeometry TeMeasure
-*/
-class TL_DLL TeTinVertex : public TeGeomSingle<TeCoord2D>, public TeMeasure
-{
-public:
-
-	//! Empty constructor
-	TeTinVertex() : TeMeasure ( TeMAXFLOAT ), oneEdge_ (-1) {}
-
-	//! Constructor with parameters
-	TeTinVertex( TeCoord2D xy, double value, TeTinVertexType type,
-		long edge ) :
-		TeGeomSingle<TeCoord2D> (xy), TeMeasure ( value ),
-		 type_ (type), oneEdge_ ( edge )
-		{ if ( ! xy.tooBig() ) TeGeometry::setBox(TeBox(xy,xy)); }
-
-// -- Methods
-//
-	//! Returns TRUE if a TeTinVertex is equal to other
-	bool operator== (const TeTinVertex& other) const
-	{
-		if((value_ == other.value_) && (type_ == other.type_) )
-		{
-			TeCoord2D p1 = location();
-			TeCoord2D p2 = other.location();
-			return p1==p2;
-		}
-		return false;
-	}
-
-	long oneEdge () 
-	{ return oneEdge_; }
-
-	void setOneEdge (long oneEdge) 
-	{ oneEdge_ = oneEdge; }
-
-	TeTinVertexType type () 
-	{ return type_; }
-
-	void setType (TeTinVertexType type) 
-	{ type_ = type; }
-
-	void value (double value) 
-	{ value_ = value; }
-
-	double value () 
-	{ return value_; }
-
-	TeGeomRep elemType() { return TeSAMPLES; }
-
-private:
-
-	TeTinVertexType type_;
-	long oneEdge_;
-};
-
-//!  A basic class for handling a std::set of TeTinVertex
-class TL_DLL TeTinVertexSet : public TeGeomComposite <TeTinVertex>
-{
-public:
-
-// -- Constructors
-
-	TeTinVertexSet() {}
-
-// -- Methods
-
-	bool loadFromFile (std::string &fileName);
-
-	TeGeomRep elemType() { return TeSAMPLES; }
-};
-
-//! Tin Edges type 
-enum TeTinEdgeType 
-{ NORMALEDGE, ONCONTOUREDGE, ONBREAKLINEEDGE };
-
-//!  A basic class for handling edges of a  TIN
-/*!
-	\sa TeGeometry
-*/
-class TL_DLL TeTinEdge : public TeGeometry
-{
-public:
-
-// -- Constructors
-
-	TeTinEdge() {}
-	TeTinEdge(long from, long to, long left, long right,
-		TeTinEdgeType type) :
-	from_ (from), to_ (to), left_ (left), right_ (right), type_ (type)
-	{}
-
-// -- Methods
-
-	//! Returns TRUE if a TeTinEdge is equal to other
-	bool operator== (const TeTinEdge& other) const
-	{
-		if( (to_ == other.to_) && (from_ == other.from_) &&
-			(left_ == other.left_) && (right_ == other.right_) &&
-			(type_ == other.type_) )
-			return true;
-
-		return false;
-	}
-
-	long from () 
-	{ return from_; }
-
-	long to () 
-	{ return to_; }
-
-	void setVertices (long from, long to)
-	{ 
-		from_ = from;
-		to_ = to;
-	}
-
-	void swapVertices ()
-	{ 
-		long aux = from_;
-		from_ = to_;
-		to_ = aux;
-	}
-
-	long left () 
-	{ return left_; }
-
-	long right ()
-	{ return right_; }
-
-	void setTriangles (long left, long right)
-	{ 
-		left_ = left;
-		right_ = right;
-	}
-
-	void swapTriangles ()
-	{ 
-		long aux = left_;
-		left_ = right_;
-		right_ = aux;
-	}
-	
-	void exchangeTriangle ( long t1, long t2 )
-	{
-		if (left_ == t1 )
-			left_ = t2;
-		else
-			right_ = t2;
-	}
-
-	void exchangeVertex ( long v1, long v2 )
-	{
-		if (from_ == v1 )
-			from_ = v2;
-		else
-			to_ = v2;
-	}
-
-	TeTinEdgeType type () 
-	{ return type_; }
-
-	void setType (TeTinEdgeType type) 
-	{ type_ = type; }
-
-	TeGeomRep elemType() { return TeSAMPLES; }
-
-private:
-
-	long	from_, to_;
-	long	left_, right_;
-	TeTinEdgeType type_;
-};
-
-//!  A basic class for handling a std::set of TeTinEdge
-class TL_DLL TeTinEdgeSet : public TeGeomComposite<TeTinEdge>
-{
-public:
-
-// -- Constructors
-
-	TeTinEdgeSet()	{}
-
-// -- Methods
-
-	bool loadFromFile (std::string &fileName);
-
-	TeGeomRep elemType() { return TeSAMPLES; }
-};
-
-//! TeTinTriangle: A class for handling a TIN triangle
-class TL_DLL TeTinTriangle : public TeGeometry
-{
-public:
-
-// -- Constructors
-
-	TeTinTriangle()
-	{
-		triEdges_[0] = -1;
-		triEdges_[1] = -1;
-		triEdges_[2] = -1;
-	}
-
-	TeTinTriangle(long first, long second, long third) 
-	{
-		triEdges_[0] = first;
-		triEdges_[1] = second;
-		triEdges_[2] = third;
-	}
-
-// -- Methods
-
-	//! Returns TRUE if a TeTinTriangle is equal to other
-	bool operator== (const TeTinTriangle& other) const
-	{
-		if( (triEdges_[0] == other.triEdges_[0]) &&
-			(triEdges_[1] == other.triEdges_[1]) &&
-			(triEdges_[2] == other.triEdges_[2]) )
-			return true;
-
-		return false;
-	}
-
-	void setEdges (long first, long second, long third)
-	{
-		triEdges_[0] = first;
-		triEdges_[1] = second;
-		triEdges_[2] = third;
-	}
-
-	//! Return triangle edges ids
-	/*!
-      \param first  first edge
-      \param second second edge
-      \param third  third edge
-	 */
-	void edges (long& first, long& second, long& third)
-	{
-		first  = triEdges_[0];
-		second = triEdges_[1];
-		third  = triEdges_[2];
-	}
-
-	long edgeAt (short num)
-	{
-		if ((num > -1) && (num < 3))
-			return triEdges_[num];
-		else
-			return -1;
-	}
-
-	TeGeomRep elemType() { return TeSAMPLES; }
-
-private:
-
-	long	triEdges_[3];
-};
-
-//! TeTinTriangle: A class for handling a std::set of TIN triangles
-class TL_DLL TeTinTriangleSet : public TeGeomComposite<TeTinTriangle>
-{
-public:
-
-// -- Constructors
-
-	TeTinTriangleSet()	{}
-
-// -- Methods
-
-	bool loadFromFile (std::string &fileName);
-
-	TeGeomRep elemType() { return TeSAMPLES; }
-};
-
-//! A class to handle a TIN
-class TL_DLL TeTin
-{
-public:
-
-// -- Constructors
-
-	TeTin() {}
-	TeTin(TeBox & /* box */) {}
-
-// -- Methods
-	void clear()
-	{
-		vertexSet_.clear();
-		triangleSet_.clear();
-		edgeSet_.clear();
-	}
-
-	TeBox box()
-	{ return vertexSet_.box(); }
-
-	bool createInitialTriangles(TeBox &box);
-	bool insertLineSamples ( TeContourLine& line );
-	bool loadFromFile(std::string &fileName);
-	bool getLines(TeLineSet &lineSet);
-	bool isEmpty ()
-	{ return ( vertexSet_.empty() && triangleSet_.empty() &&
-	           edgeSet_.empty() ); } 
-
-	TeTinEdge& edge (long i)
-	{ return edgeSet_[i]; }
-
-	TeTinVertex& vertex (long i)
-	{ return vertexSet_[i];	}
-
-	TeTinTriangle& triangle (long i)
-	{ return triangleSet_[i];	}
-
-	typedef TeTinVertexSet::iterator TeTinVertexIterator;
-
-	TeTinVertexIterator vertexBegin()
-	{ return vertexSet_.begin(); }
-
-	TeTinVertexIterator vertexEnd()
-	{ return vertexSet_.end(); }
-
-	typedef  TeTinEdgeSet::iterator TeTinEdgeIterator;
-
-	TeTinEdgeIterator edgeBegin()
-	{ return edgeSet_.begin(); }
-
-	TeTinEdgeIterator edgeEnd()
-	{ return edgeSet_.end(); }
-
-	typedef  TeTinTriangleSet::iterator TeTinTriangleIterator;
-
-	TeTinTriangleIterator triangleBegin()
-	{ return triangleSet_.begin(); }
-
-	TeTinTriangleIterator triangleEnd()
-	{ return triangleSet_.end(); }
-
-	bool triangleContainsPoint(TeTinTriangle& t, TeCoord2D& pt);
-	bool triangleContainsPoint(long t, TeCoord2D& pt)
-	{ return triangleContainsPoint(triangleSet_[t], pt); }
-
-	long edgeWithVertexDiffFromEdge(long t, long v, long e);
-	long oneTriangleWithVertex(long vertex);
-	long oneEdgeWithVertex(long vertex);
-
-	long edgeOppVertex(TeTinTriangle& triangle, long vertex);
-	long edgeOppVertex(long triangle, long vertex)
-	{ return edgeOppVertex(triangleSet_[triangle], vertex); }
-
-	long vertexOppEdge(long triangle, long edge);
-	bool vertexEdges(long vertex, std::list<long> &edges);
-	bool vertexOppEdges(long vertex, std::list<long> &edges);
-	bool vertexOppEdges(long v, std::list<long> &triset, std::list<long> &edges);
-
-	bool vertexOppVertices(long vertex, std::list<long> &vertices);
-	bool vertexSecondNeighVertices(long v, list<long> &vertices);
-	bool vertexTriangles(long vertex, std::list<long> &triangles);
-	bool triangle3Neighbors(long t, long& neighbor0, long& neighbor1, long& neighbor2);
-	long triangleAt (TeCoord2D& pt);
-
-	bool triangleVertices(TeTinTriangle& t, long& vertex0, long& vertex1, long& vertex2);
-	bool triangleVertices(long t, long& vertex0, long& vertex1, long& vertex2)
-	{ return this->triangleVertices(triangleSet_[t], vertex0, vertex1, vertex2); }
-
-	long triangleVertexAt(long t, long vertex);
-
-	bool trianglePoints(TeTinTriangle& t, TeCoord2D& pt0, TeCoord2D& pt1, TeCoord2D& pt2);
-	bool trianglePoints(long t, TeCoord2D& pt0, TeCoord2D& pt1, TeCoord2D& pt2)
-	{ return trianglePoints( triangleSet_[t], pt0, pt1, pt2); }
-	
-	bool twoNewTriangles(long t, long v, std::set<long>& triangles);
-	long duplicateTriangle(long t, long n, long v, std::set<long>& triangles);
-	bool dupNeighTriangle (long t, long e, long v, std::set<long>& triangles);
-
-	void testDelaunayForVertex(long v, std::set<long>& triangles);
-	bool testDelaunayAt(long t, long v, std::set<long>& triangles);
-
-	bool swapEdges( long t, long tv, long ai );
-
-	bool insertPoint(TeSample& xyz)
-	{ return insertPoint ( xyz.location().x(),xyz.location().y(),xyz.value() ); }
-
-	bool insertPoint(double x, double y, double value);
-
-	bool edgesInterBySegment( TeCoord2D& pf, TeCoord2D& pn, std::list<long> &aiset, std::list<long> &viset );
-	bool insertSegment( TeCoord2D& pf, TeCoord2D& pn );
-
-
-	void convexize ();
-	bool isEdgeTriangle (long t);
-
-	TeGeomRep elemType() { return TeSAMPLES; }
-private:
-
-	TeTinVertexSet		vertexSet_;
-	TeTinTriangleSet	triangleSet_;
-	TeTinEdgeSet		edgeSet_;
-};
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeTin.h
+    \brief This file provides support for a TIN structure
+*/
+#ifndef  __TERRALIB_INTERNAL_TIN_H
+#define  __TERRALIB_INTERNAL_TIN_H
+
+#include "TeGeometry.h"
+#include "TeLayer.h"
+#include "TeQuerier.h"
+#include "TeDatabase.h"
+
+#include <list>
+#include <set>
+
+/** @} */ 
+ 
+/** @defgroup MathConst Mathematical constants and macro definitions for use in Tin
+  @{
+ */
+const double	TeTinBIGFLOAT = TeMAXFLOAT / 10.;		//!< Near Maximum float value - TeMAXFLOAT / 10.
+
+//!  Tin Vertex types 
+//enum TeTinVertexType 
+//{ NORMALVERTEX = 0, ONCONTOURVERTEX = 1, ONBREAKLINEVERTEX = 0x10 };
+
+enum TeTinVertexType 
+{ NORMALVERTEX = 0, ONCONTOURVERTEX = 1, ONBOXVERTEX = 2, ONBREAKLINEVERTEX = 0x10 };
+
+//!  A basic class for handling vertex of TIN
+/*!
+	\sa TeGeometry TeMeasure
+*/
+class TL_DLL TeTinVertex : public TeGeomSingle<TeCoord2D>, public TeMeasure
+{
+public:
+
+	//! Empty constructor
+	TeTinVertex() : TeMeasure ( TeMAXFLOAT ), oneEdge_ (-1) {}
+
+	//! Constructor with parameters
+	TeTinVertex( TeCoord2D xy, double value, TeTinVertexType type,
+		long edge ) :
+		TeGeomSingle<TeCoord2D> (xy), TeMeasure ( value ),
+		 type_ (type), oneEdge_ ( edge )
+		{ if ( ! xy.tooBig() ) TeGeometry::setBox(TeBox(xy,xy)); }
+
+// -- Methods
+//
+	//! Returns TRUE if a TeTinVertex is equal to other
+	bool operator== (const TeTinVertex& other) const
+	{
+		if((value_ == other.value_) && (type_ == other.type_) )
+		{
+			TeCoord2D p1 = location();
+			TeCoord2D p2 = other.location();
+			return p1==p2;
+		}
+		return false;
+	}
+
+	long oneEdge () 
+	{ return oneEdge_; }
+
+	void setOneEdge (long oneEdge) 
+	{ oneEdge_ = oneEdge; }
+
+	TeTinVertexType type () 
+	{ return type_; }
+
+	void setType (TeTinVertexType type) 
+	{ type_ = type; }
+
+	void value (double value) 
+	{ value_ = value; }
+
+	
+
+	double value () 
+	{ return value_; }
+
+	
+	TeGeomRep elemType() { return TeSAMPLES; }
+
+private:
+
+	TeTinVertexType type_;
+	long         oneEdge_;
+	
+};
+
+//!  A basic class for handling a std::set of TeTinVertex
+class TL_DLL TeTinVertexSet : public TeGeomComposite <TeTinVertex>
+{
+public:
+
+// -- Constructors
+
+	TeTinVertexSet() {}
+
+// -- Methods
+
+	bool loadFromFile (std::string &fileName);
+
+	TeGeomRep elemType() { return TeSAMPLES; }
+};
+
+//! Tin Edges type 
+enum TeTinEdgeType 
+{ NORMALEDGE, ONCONTOUREDGE, ONBREAKLINEEDGE };
+
+//!  A basic class for handling edges of a  TIN
+/*!
+	\sa TeGeometry
+*/
+class TL_DLL TeTinEdge : public TeGeometry
+{
+public:
+
+// -- Constructors
+
+	TeTinEdge() {}
+	TeTinEdge(long from, long to, long left, long right,
+		TeTinEdgeType type) :
+	from_ (from), to_ (to), left_ (left), right_ (right), type_ (type)
+	{}
+
+// -- Methods
+
+	//! Returns TRUE if a TeTinEdge is equal to other
+	bool operator== (const TeTinEdge& other) const
+	{
+		if( (to_ == other.to_) && (from_ == other.from_) &&
+			(left_ == other.left_) && (right_ == other.right_) &&
+			(type_ == other.type_) )
+			return true;
+
+		return false;
+	}
+
+	long from () 
+	{ return from_; }
+
+	long to () 
+	{ return to_; }
+
+	void setVertices (long from, long to)
+	{ 
+		from_ = from;
+		to_ = to;
+	}
+
+	void swapVertices ()
+	{ 
+		long aux = from_;
+		from_ = to_;
+		to_ = aux;
+	}
+
+	long left () 
+	{ return left_; }
+
+	long right ()
+	{ return right_; }
+
+	void setTriangles (long left, long right)
+	{ 
+		left_ = left;
+		right_ = right;
+	}
+
+	void swapTriangles ()
+	{ 
+		long aux = left_;
+		left_ = right_;
+		right_ = aux;
+	}
+	
+	void exchangeTriangle ( long t1, long t2 )
+	{
+		if (left_ == t1 )
+			left_ = t2;
+		else
+			right_ = t2;
+	}
+
+	void exchangeVertex ( long v1, long v2 )
+	{
+		if (from_ == v1 )
+			from_ = v2;
+		else
+			to_ = v2;
+	}
+
+	TeTinEdgeType type () 
+	{ return type_; }
+
+	void setType (TeTinEdgeType type) 
+	{ type_ = type; }
+
+	TeGeomRep elemType() { return TeSAMPLES; }
+
+private:
+
+	long	from_, to_;
+	long	left_, right_;
+	TeTinEdgeType type_;
+};
+
+//!  A basic class for handling a std::set of TeTinEdge
+class TL_DLL TeTinEdgeSet : public TeGeomComposite<TeTinEdge>
+{
+public:
+
+// -- Constructors
+
+	TeTinEdgeSet()	{}
+
+// -- Methods
+
+	bool loadFromFile (std::string &fileName);
+
+	TeGeomRep elemType() { return TeSAMPLES; }
+};
+
+//! TeTinTriangle: A class for handling a TIN triangle
+class TL_DLL TeTinTriangle : public TeGeometry
+{
+public:
+
+// -- Constructors
+
+	TeTinTriangle()
+	{
+		triEdges_[0] = -1;
+		triEdges_[1] = -1;
+		triEdges_[2] = -1;
+	}
+
+	TeTinTriangle(long first, long second, long third) 
+	{
+		triEdges_[0] = first;
+		triEdges_[1] = second;
+		triEdges_[2] = third;
+	}
+
+// -- Methods
+
+	//! Returns TRUE if a TeTinTriangle is equal to other
+	bool operator== (const TeTinTriangle& other) const
+	{
+		if( (triEdges_[0] == other.triEdges_[0]) &&
+			(triEdges_[1] == other.triEdges_[1]) &&
+			(triEdges_[2] == other.triEdges_[2]) )
+			return true;
+
+		return false;
+	}
+
+	void setEdges (long first, long second, long third)
+	{
+		triEdges_[0] = first;
+		triEdges_[1] = second;
+		triEdges_[2] = third;
+	}
+
+	//! Return triangle edges ids
+	/*!
+      \param first  first edge
+      \param second second edge
+      \param third  third edge
+	 */
+	void edges (long& first, long& second, long& third)
+	{
+		first  = triEdges_[0];
+		second = triEdges_[1];
+		third  = triEdges_[2];
+	}
+
+	long edgeAt (short num)
+	{
+		if ((num > -1) && (num < 3))
+			return triEdges_[num];
+		else
+			return -1;
+	}
+
+	TeGeomRep elemType() { return TeSAMPLES; }
+
+private:
+
+	long	triEdges_[3];
+};
+
+//! TeTinTriangle: A class for handling a std::set of TIN triangles
+class TL_DLL TeTinTriangleSet : public TeGeomComposite<TeTinTriangle>
+{
+public:
+
+// -- Constructors
+
+	TeTinTriangleSet()	{}
+
+// -- Methods
+
+	bool loadFromFile (std::string &fileName);
+
+	TeGeomRep elemType() { return TeSAMPLES; }
+};
+
+//! A class to handle a TIN
+class TL_DLL TeTin
+{
+public:
+
+// -- Constructors
+
+	TeTin() {}
+	TeTin(TeBox & /* box */) {}
+
+// -- Methods
+
+	void clear()
+	{ vertexSet_.clear(); triangleSet_.clear(); edgeSet_.clear();}
+
+	TeBox box()
+	{ return vertexSet_.box(); }
+
+	bool createInitialTriangles(TeBox &box);
+	bool insertLineSamples ( TeContourLine& line );
+	bool loadFromFile(std::string &fileName);
+	bool getLines(TeLineSet &lineSet);
+	bool isEmpty ()
+	{ return ( vertexSet_.empty() && triangleSet_.empty() &&
+	           edgeSet_.empty() ); } 
+
+	TeTinEdge& edge (long i)
+	{ return edgeSet_[i]; }
+
+	TeTinVertex& vertex (long i)
+	{ return vertexSet_[i];	}
+
+	TeTinTriangle& triangle (long i)
+	{ return triangleSet_[i];	}
+
+	typedef TeTinVertexSet::iterator TeTinVertexIterator;
+
+	TeTinVertexIterator vertexBegin()
+	{ return vertexSet_.begin(); }
+
+	TeTinVertexIterator vertexEnd()
+	{ return vertexSet_.end(); }
+
+	typedef  TeTinEdgeSet::iterator TeTinEdgeIterator;
+
+	TeTinEdgeIterator edgeBegin()
+	{ return edgeSet_.begin(); }
+
+	TeTinEdgeIterator edgeEnd()
+	{ return edgeSet_.end(); }
+
+	typedef  TeTinTriangleSet::iterator TeTinTriangleIterator;
+
+	TeTinTriangleIterator triangleBegin()
+	{ return triangleSet_.begin(); }
+
+	TeTinTriangleIterator triangleEnd()
+	{ return triangleSet_.end(); }
+
+	bool triangleContainsPoint(TeTinTriangle& t, TeCoord2D& pt);
+	bool triangleContainsPoint(long t, TeCoord2D& pt)
+	{ return triangleContainsPoint(triangleSet_[t], pt); }
+
+	long edgeWithVertexDiffFromEdge(long t, long v, long e);
+	long oneTriangleWithVertex(long vertex);
+	long oneEdgeWithVertex(long vertex);
+
+	long edgeOppVertex(TeTinTriangle& triangle, long vertex);
+	long edgeOppVertex(long triangle, long vertex)
+	{ return edgeOppVertex(triangleSet_[triangle], vertex); }
+
+	long vertexOppEdge(long triangle, long edge);
+	bool vertexEdges(long vertex, std::list<long> &edges);
+	bool vertexOppEdges(long vertex, std::list<long> &edges);
+	bool vertexOppEdges(long v, std::list<long> &triset, std::list<long> &edges);
+
+	bool vertexOppVertices(long vertex, std::list<long> &vertices);
+	bool vertexSecondNeighVertices(long v, list<long> &vertices);
+	bool vertexTriangles(long vertex, std::list<long> &triangles);
+	bool triangle3Neighbors(long t, long& neighbor0, long& neighbor1, long& neighbor2);
+	long triangleAt (TeCoord2D& pt);
+
+	bool triangleVertices(TeTinTriangle& t, long& vertex0, long& vertex1, long& vertex2);
+	bool triangleVertices(long t, long& vertex0, long& vertex1, long& vertex2)
+	{ return this->triangleVertices(triangleSet_[t], vertex0, vertex1, vertex2); }
+
+	long triangleVertexAt(long t, long vertex);
+
+	bool triangle3DPoints(TeTinTriangle& t, TeCoord2D& pt0, TeCoord2D& pt1,
+		TeCoord2D& pt2, double& val0, double& val1, double& val2);
+	bool triangle3DPoints(long t, TeCoord2D& pt0, TeCoord2D& pt1, TeCoord2D& pt2,
+		double& val0, double& val1, double& val2)
+	{ return triangle3DPoints( triangleSet_[t], pt0, pt1, pt2, val0, val1, val2); }
+
+
+	bool trianglePoints(TeTinTriangle& t, TeCoord2D& pt0, TeCoord2D& pt1, TeCoord2D& pt2);
+	bool trianglePoints(long t, TeCoord2D& pt0, TeCoord2D& pt1, TeCoord2D& pt2)
+	{ return trianglePoints( triangleSet_[t], pt0, pt1, pt2); }
+	
+	bool twoNewTriangles(long t, long v, std::set<long>& triangles);
+	long duplicateTriangle(long t, long n, long v, std::set<long>& triangles);
+	bool dupNeighTriangle (long t, long e, long v, std::set<long>& triangles);
+
+	void testDelaunayForVertex(long v, std::set<long>& triangles);
+	bool testDelaunayAt(long t, long v, std::set<long>& triangles);
+
+	bool swapEdges( long t, long tv, long ai );
+
+	bool insertPoint(TeSample& xyz)
+	{ return insertPoint ( xyz.location().x(),xyz.location().y(),xyz.value() ); }
+
+	bool insertPoint(double x, double y, double value);
+
+	bool edgesInterBySegment( TeCoord2D& pf, TeCoord2D& pn, std::list<long> &aiset, std::list<long> &viset );
+	bool insertSegment( TeCoord2D& pf, TeCoord2D& pn );
+
+
+	void convexize ();
+	bool isEdgeTriangle (long t);
+
+	int sizeTriangles() 
+	{return triangleSet_.size();}
+
+	int sizeVertex()
+	{return vertexSet_.size();}
+
+	TeGeomRep elemType() { return TeSAMPLES; }
+
+	//! Creates TIN
+	/*!
+	  \param sampleSet	SampleSet
+	  \param contourSet ContourLineSet
+	  */
+	bool createTIN(TeSampleSet& sampleSet, TeContourLineSet& contourSet);
+
+	//! Creates TIN
+	/*!
+	  \param inputLayer_ptr layer
+	  \param ps				PolygonSet
+	  */
+	bool createTIN(TeLayer* inputLayer_ptr, TePolygonSet& ps);
+
+	//! Creates TIN from point's layer
+	/*!
+	  \param inputLayer_ptr layer
+	  */
+	bool createTIN(TeLayer* inputLayer_ptr);
+
+	//! Creates a attributes table
+	/*!
+      \param attTable	attributes table
+	  \param db			current database
+	  \param layer		layer
+	  */
+    bool createAttrTable(TeTable& attTable, TeDatabase* db, TeLayer* layer);
+
+	//! Creates polygons with points of triangles
+	/*!
+      \param ps			PolygonSet
+      \param attTable	attributes table
+      \param t			triangle's number
+	  \param pt0		triangle's point 0
+	  \param pt1		triangle's point 1
+	  \param pt2		triangle's point 2
+	  \param val0		point's 0 value
+	  \param val1		point's 1 value
+	  \param val2		point's 2 value
+	 */
+    bool createPolygon(TePolygonSet ps, TeTable& attTable, int t, TeCoord2D& pt0,
+		               TeCoord2D& pt1, TeCoord2D& pt2, double& val0, double& val1,
+					   double& val2);
+
+	//! Creates polygons with points of triangles
+	/*!
+      \param ps			PolygonSet
+      \param attTable	attributes table
+      \param t			triangle's number
+	  \param pt0		triangle's point 0
+	  \param pt1		triangle's point 1
+	  \param pt2		triangle's point 2
+	  \param val0		point's 0 value
+	  \param val1		point's 1 value
+	  \param val2		point's 2 value
+	  \param slope		slope's value of triangle
+	 */
+    bool createPolygon(TePolygonSet ps, TeTable& attTable, int t, TeCoord2D& pt0,
+		               TeCoord2D& pt1, TeCoord2D& pt2, double& val0, double& val1,
+					   double& val2, double& slope, double& aspect);
+
+    //! Add polygons in the layer and save attributes table in the database
+	/*!
+      \param db			current database
+	  \param layer		layer
+	  \param ps			PolygonSet
+	  \param attTable	attributes table
+	  */
+    bool saveTIN(TeDatabase* db, TeLayer* layer, TePolygonSet& ps,
+		         TeTable& attTable);
+
+    //! Add points in the layer and save attributes table in the database
+	/*!
+      \param db			current database
+	  \param layer		layer
+	  \param ps			PointSet
+	  \param attTable	attributes table
+	  */
+	bool saveVertexTIN(TeDatabase* db, TeLayer* layer, TePointSet& ps,
+			   TeTable& attTable);
+
+	//! Saves TIN in the database
+	/*!
+      \param db				current database
+	  \param outLayerName	layer name that will be created
+	  \param tablename		attributes table name that will be created
+	  */
+	bool saveTINdb(TeDatabase* db, string& outLayerName, string& tablename);
+
+	//! Saves vertex of TIN in the database
+	/*!
+      \param db				current database
+	  \param outLayerName	layer name that will be created
+	  \param tablename		attributes table name that will be created
+	  */
+	bool saveVertexTINdb(TeDatabase* db, string& outLayerName, string& tablename);
+	
+	//!  Deletes vertex ONBOXVERTEX and re-triangular TIN
+	void borderUp();
+
+	//! Saves TIN in SPRING file format
+	/*!
+	  \param name File's name
+	  */
+	void writeTriangleEdgesSPRFile (std::string& name, TeRaster* raster);
+
+	//! Calculates the area of triangle
+	/*!
+	  \param t		TeTinTriangle object
+	  \param area	area of triangle
+	  */
+	void areaTriangle (TeTinTriangle& t, float& area); //necessita testar o metodo de calculo de area do TeGeometryAlgorithms
+
+	//! Calculates the slope of triangle
+	/*!
+	  \param t			TeTinTriangle object
+	  \param slope		slope of triangle
+	  \param slopetype	type of slope (g = degres or r = radian)  
+	  */
+	void slopeTriangle (TeTinTriangle& t, double& slope, char slopetype); 
+
+	//! Calculates the aspect of triangle
+	/*!
+	  \param t		TeTinTriangle object
+	  \param aspect aspect of triangle
+	  */
+	void aspectTriangle (TeTinTriangle& t, double& aspect);
+
+	//! Creates a PointSet object with vertex of TIN
+	/*!
+	  \param ps			PointSet object
+	  \param atttable	attributes table
+	  \param layer		layer
+	  \param db			current database
+	  */
+	bool createPointSet(TePointSet& ps, TeTable& atttable, TeLayer* layer, TeDatabase* db);
+
+	//! Creates a sample object with vertex of TIN
+	/*!
+	  \param sample SampleSet object
+	  */
+	bool createSampleSet(TeSampleSet& sample);
+	
+	//! Calculates the gradient of triangle
+	/*!
+	  \param t			TeTinTriangle object
+	  \param gradtype	type of gradient (s = slope or a = aspect)
+	  \param slopetype	type of slope (g = degres or r = radian)
+	  */
+	double triangleGradient(TeTinTriangle& t, char gradtype, char slopetype);
+
+	//! Calculates the normal
+	/*!
+	  \param t			TeTinTriangle object
+	  \param nvector	normal vector
+	  */
+	bool normalTriangle(TeTinTriangle& t, std::vector<double>& nvector); // calculo da normal (adaptado do SPRING)
+
+	//! Calculates the lines and the columns intercepted by a triangle
+	/*!
+	  \param raster	pointer to a raster
+	  \param t		current triangle
+	  \param fline	first line of the raster
+	  \param lline	last line of the raster
+	  \param fcol	first column of the raster
+	  \param lcol	last column of the raster
+	  */
+	//Testado apenas para imagem. Necessita testar com grade.
+	bool defineInterLinesColumns(TeRaster* raster, TeTinTriangle t, int& fline, int& lline, int& fcol, int& lcol);
+
+	//! Fills the grid locations, inside a triangle, with a zvalue linearly evaluated
+	/*!
+	  \param raster	pointer to a raster
+	  \param band	current band
+	  \param t		current triangle
+	  \param fline	first line of the raster
+	  \param lline	last line of the raster
+	  \param fcol	first column of the raster
+	  \param lcol	last column of the raster
+	  */
+	//Testado apenas para imagem. Necessita testar com grade.
+	void linearInterpolation(TeRaster* raster, int band, TeTinTriangle t, int fline, int lline, int fcol, int lcol);
+
+	//! This function interpolates the average weighted by the inverse of the distance
+	/*!
+	  \param pt point coordinates
+	  \param z	point's value
+	  */
+	bool interpolationPoint(TeCoord2D& pt, double& z);
+
+	//! Calculates the slope and orientation on the point
+	/*!
+	  \param pt	point coordinates
+	  \param s	slope on the point
+	  \param a	orientation on the point
+	  */
+	bool slopeaspectPoint(TeCoord2D& pt,double& s,double& a);//Calculo de declividade e orientacao no ponto
+
+	bool vertexOncontour(long& v);
+
+private:
+
+	TeTinVertexSet		vertexSet_;
+	TeTinTriangleSet	triangleSet_;
+	TeTinEdgeSet		edgeSet_;
+};
+
+#endif
diff --git a/src/terralib/kernel/TeUtils.cpp b/src/terralib/kernel/TeUtils.cpp
old mode 100755
new mode 100644
index 7ee8343..3e473ae
--- a/src/terralib/kernel/TeUtils.cpp
+++ b/src/terralib/kernel/TeUtils.cpp
@@ -1,819 +1,1306 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeUtils.h"
-#include "TeDefines.h"
-#include "TeException.h"
-#include "TeAgnostic.h"
-
-#include <stdio.h>
-#include <ctype.h>
-#include <string>
-#include <cstring> 
-#include <cstdlib>
-
-/* The following includes are needed for memory checking */
-#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-  #include <windows.h>
-  #include <winbase.h>
-#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-  #include <unistd.h>
-  #include <string.h>
-  #include <errno.h>
-  #include <sys/resource.h>
-  #include <sys/types.h>
-  #include <sys/stat.h>  
-  #include <dirent.h>
-
-  #if defined( __FreeBSD__ )
-    #include <sys/sysctl.h> /* BSD workaround */
-  #endif
-#else
-  #error "Unsuported plataform for physical memory checking"
-#endif
-
-
-string
-Te2String ( const int value )
-{
-	char name [ TeNAME_LENGTH ];
-	sprintf ( name, "%d", value );
-	return name;
-}
-
-string
-Te2String ( const unsigned int value )
-{
-	char name [ TeNAME_LENGTH ];
-	sprintf ( name, "%u", value );
-	return name;
-}
-
-string
-Te2String ( const long value )
-{
-	char name [ TeNAME_LENGTH ];
-	sprintf ( name, "%ld", value );
-	return name;
-}
-
-string
-Te2String ( const unsigned long value )
-{
-	char name [ TeNAME_LENGTH ];
-	sprintf ( name, "%lu", value );
-	return name;
-}
-
-void
-TeTrim(string &str)
-{
-//empty strings are bad
-    if(str.empty())
-		return;
-//remove left whitespace, \t and \n
-	string::iterator it;
-    for(it=str.begin();it!=str.end() &&
-		((*it) == ' ' ||  (*it) == '\t' || (*it) == '\n');it++);
-		str.erase(str.begin(),it);
-//empty strings are bad
-    if(str.empty())
-		return;
-//remove right whitespace, \t and \n
-	it=str.end();
-    for(--it;it!=str.begin() && 
-	   ((*it) == ' ' ||  (*it) == '\t' || (*it) == '\n');--it);
-		str.erase(++it,str.end());
-}
-
-string
-TeRemoveSpecialChars ( string& str)
-{
-	string aux; 
-	string::iterator it;
-    for(it=str.begin();it!=str.end();it++)
-	{
-		if (isalnum(*it))
-			aux+=(*it);
-	}
-	return aux;
-}
-
-string
-Te2String ( const double value, int precision )
-{
-	char name [ TeNAME_LENGTH ];
-	sprintf(name, "%.*f", precision, value );
-	return name;
-}
-
-
-string
-Te2String ( const double value )
-{
-	char name [ TeNAME_LENGTH ];
-	sprintf ( name, "%e", value ); 
-	return name;
-}
-
-string 
-TeGetExtension ( const char* value )
-{
-	if (!value)
-		return string("");
-	string name = string(value);
-	int len = strlen ( value );
-	unsigned int ip = name.rfind('.');
-	if (ip == std::string::npos)
-		return "";
-	else
-		return name.substr(ip+1,len-1);
-}
-
-string 
-TeGetName ( const char* value )
-{
-	if (!value)
-		return string("");
-	string name = string(value);
-	int len = strlen ( value );
-
-	int sp = name.rfind('\\')+1;
-	int ip = (name.substr(sp,len-1)).rfind('.');
-	if (ip>0)
-		return name.substr(0,sp+ip);
-	else 
-		return name;
-}
-
-string
-TeGetBaseName ( const char* value )
-{
-	if (!value)
-		return string("");
-	string name = string(value);
-	int ip = name.rfind('.');
-	unsigned int is = name.rfind('\\');
-	if (is == std::string::npos)
-		is = name.rfind('/');
-	return name.substr(is+1,ip-is-1);
-}
-
-string 
-TeGetPath(const char* value)
-{
-	if (!value)
-		return string(".");
-	string name = string (value);
-	std::string::size_type ip = name.rfind('/');
-	if (ip == std::string::npos)
-		return string(".");
-	else
-		return name.substr(0,ip);
-}
-
-void
-TeConvertToUpperCase ( const string& name, char upName[] )
-{
-	
-	const char* old = name.c_str();
-
-	const char* p;
-	int i = 0;
-
-	for( p = old; p < old + strlen ( old) ; p++ )
-	{
-		if ( islower ( *p  ) )
-			upName[i] = toupper( *p );
-		else
-			upName [i] = *p;
-		i++;
-	}
-	upName[i] = '\0';
-}
-
-string
-TeConvertToUpperCase (const string &name)
-{
-	string aux = "";
-	for(unsigned int i=0; i < strlen(name.c_str()); i++)
-	{
-		if((name[i] >= 97) && (name[i] <= 122))
-			aux += name[i] - 32;
-       else
-			aux += name[i];
-    }
-	return aux;
-}
-
-
-string
-TeConvertToLowerCase (const string &name)
-{
-	string aux = "";
-	for(unsigned int i=0; i < strlen(name.c_str()); i++)
-	{
-		if((name[i] >= 65) && (name[i] <= 90))
-			aux += name[i] + 32;
-		else
-			aux += name[i];
-    }
-	return aux;
-}
-
-
-//-----------------------------------------------------------------------
-//
-//      Purpose:        STL split string utility
-//      Author:         Paul J. Weiss
-//      Extracted from: The Code Project (http://www.codeproject.com/)
-//
-//------------------------------------------------------------------------
-
-int TeSplitString(const string& input, const string& delimiter, vector<string>& results)
-{
-   int iPos = 0;
-   int newPos = -1;
-   int sizeS2 = delimiter.size();
-   int isize = input.size();
-
-   if (input.empty())
-	   return 0;
-  
-   vector<int> positions;
-
-   newPos = input.find (delimiter, 0);
-
-   if( newPos < 0 ) 
-   { 
-       results.push_back(input);
-	   return 1;
-   }
-
-   int numFound = 0;
-   while( newPos >= iPos )
-   {
-       numFound++;
-       positions.push_back(newPos);
-       iPos = newPos;
-       newPos = input.find (delimiter, iPos+sizeS2+1);
-   }
-
-   for( unsigned int i=0; i <= positions.size(); i++ )
-   {
-       string s;
-       if( i == 0 )
-	   {
-	   s = input.substr( i, positions[i] );
-	   }
-	   else
-	   {
-       int offset=0;
-	   if(i>0)	 offset= positions[i-1] + sizeS2;
-       if( offset < isize )
-       {
-           if( i == positions.size() )
-           {
-		s = input.substr(offset);
-           }
-           else if( i > 0 )
-           {
-                s = input.substr( positions[i-1] + sizeS2, positions[i] - positions[i-1] - sizeS2 );
-           }
-       }
-	   }
-       if( s.size() > 0 )
-       {
-               results.push_back(s);
-       }
-   }
-   return numFound;
-}
-
-bool TeNoCaseCmp(const char&  c1, const char& c2)
-{
-	return toupper(c1) == toupper(c2);
-}
-
-
-bool
-TeStringCompare(const string& str1, const string& str2, bool caseS)
-{
-	if (!caseS)
-	{
-		return ((str1.size() == str2.size()) &&
-			    equal(str1.begin(),str1.end(),str2.begin(),TeNoCaseCmp));
-	}
-	else
-		return (str1 == str2);
-}
-
-double 
-TeRoundD(double val, int precision)
-{
-	char name [ TeNAME_LENGTH ];
-	sprintf ( name, "%.*f", precision, val);
-	return atof(name);
-
-}
-
-bool
-TeCompareDouble(double a, double b, int precision)
-{
-	char bufa [ TeNAME_LENGTH ];
-	char bufb [ TeNAME_LENGTH ];
-	if (precision == 0)
-	{
-		sprintf ( bufa, "%f", a );
-		sprintf ( bufb, "%f", b );
-	}
-	else
-	{
-		sprintf ( bufa, "%.*f", precision, a );
-		sprintf ( bufb, "%.*f", precision, b );
-	}
-
-	string A = bufa;
-	string B = bufb;
-	return (A == B);
-}
-
-void TeWriteToFile(const string& fileName, const string& text, const string& mode)
-{
-	FILE *f;
-
-	f = fopen(fileName.c_str(), mode.c_str());
-
-	if(f != NULL)
-	{
-		fprintf(f, "%s", text.c_str());
-
-		fclose(f);
-	}
-
-	return;
-}
-
-double TeAdjustToPrecision(double val, int precision, bool reduce)
-{
-	double p = pow(10.0, (double)-precision);
-	
-	if (reduce)
-		return (val - p);
-
-	return (val + p);
-}
-
-string TeCheckName(const string& name, bool& changed, string& invalidChar)
-{
-	string newName = name;
-
-	changed = false;
-
-	if(newName[0] >= 0x30 && newName[0] <= 0x39)
-	{
-		invalidChar = "begin with a numeric character\n";
-        changed = true;
-	}
-    if(newName[0] == '_')
-    {
-        invalidChar += "begin with a invalid character: underscore _\n";
-        changed = true;
-    }
-
-	int ff = newName.find(" ");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: blank space\n";
-        changed = true;
-	}
-
-	ff = newName.find(".");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: dot '.'\n";
-        changed = true;
-	}
-
-	ff = newName.find("*");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: mathematical symbol '*'\n";
-        changed = true;
-	}
-
-	ff = newName.find("/");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: mathematical symbol '/'\n";
-        changed = true;
-	}
-
-	ff = newName.find("(");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: parentheses '('\n";
-        changed = true;
-	}
-
-	ff = newName.find(")");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: parentheses ')'\n";
-        changed = true;
-	}
-	ff = newName.find("-");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: mathematical symbol '-'\n";
-        changed = true;
-	}
-
-	ff = newName.find("+");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: mathematical symbol '+'\n";
-        changed = true;
-	}
-
-	ff = newName.find("%");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: mathematical symbol '%'\n";
-        changed = true;
-	}
-
-	ff = newName.find(">");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: mathematical symbol '>'\n";
-        changed = true;
-	}
-
-	ff = newName.find("<");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: mathematical symbol '<'\n";
-        changed = true;
-	}
-
-	ff = newName.find("&");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid character: mathematical symbol '&'\n";
-        changed = true;
-	}
-
-	ff = newName.find("$");
-	if(ff >= 0)
-	{
-        invalidChar += "invalid symbol: '$'\n";
-        changed = true;
-	}
-
-	string u = TeConvertToUpperCase(newName);
-	if(u=="OR" || u=="AND" || u=="NOT" || u=="LIKE" ||
-	   u=="SELECT" || u=="FROM" || u=="UPDATE" || u=="DELETE" ||u=="BY" || u=="GROUP" || u=="ORDER" ||
-	   u=="DROP" || u=="INTO" || u=="VALUE" || u=="IN" || u=="ASC" || u=="DESC"|| u=="COUNT" || u=="JOIN" ||
-	   u=="LEFT" || u=="RIGHT" || u=="INNER" || u=="UNION" || u=="IS" || u=="NULL" || u=="WHERE" ||
-	   u=="BETWEEN" || u=="DISTINCT" || u=="TRY" || u=="IT" || u=="INSERT" || u=="ALIASES" || u=="CREATE" ||
-	   u=="ALTER" || u=="TABLE" || u=="INDEX" || u=="ALL" || u=="HAVING" || u=="EXEC" || u== "SET" ||
-	   u == "AVG" || u == "MAX" || u == "MIN" || u == "SUM" || u == "FILTER" || u == "OFFSET"  || u == "LENGHT" )
-	{
-        invalidChar += "invalid name: using reserved word " + u + "\n";	
-        changed = true;
-	}
-
-	// check against geometry tables field names
-	string n = TeConvertToLowerCase(newName); 
-
-	if (n == "x" || n == "y" || n == "object_id" ||
-	   n == "geom_id" || n == "num_coords" || 
-	   n == "lower_x" || n == "lower_y" ||
-	   n == "upper_x" || n == "upper_y" ||
-	   n == "ext_max" || n == "spatial_data" ||
-	   n == "num_holes" || n == "parent_id" ||
-	   n == "col_number" || n == "row_number" || 
-	   n == "text_value" || n == "angle" ||
-	   n == "height" || n == "alignment_vert" ||
-	   n == "alignment_horiz" || n=="from_node" ||
-	   n == "to_node")
-	{
-        invalidChar += "invalid name: using reserved word " + n + "\n";	
-        changed = true;
-	}
-
-	// reserved words
-	if( (n=="zone") || (n=="comp") || (n=="no") || (n=="local") ||
-		(n=="level") || (n=="long"))
-	{
-        invalidChar += "invalid name: using reserved word " + n + "\n";	
-        changed = true;
-	}
-
-	return newName;
-}
-
-
-unsigned long int TeGetFreePhysicalMemory()
-{
-  unsigned long int freemem = 0;
-
-  #if defined __unix__
-    #if defined( __FreeBSD__ )
-      /* BSD workaround */
-      
-      unsigned int usermem;
-      size_t usermem_len = sizeof( usermem );
-      int mib[2] = { CTL_HW, HW_USERMEM };
-      
-      if( sysctl( mib, ( 2 * sizeof(int) ), &usermem, &usermem_len, NULL, 0 ) 
-        == 0 ) {
-        
-        freemem = (unsigned long int)usermem;
-      } else {
-        throw( "TeGetFreePhysicalMemory error" );
-      }
-    #else
-      /* Other linux stuff */
-      
-      freemem = (unsigned long int) sysconf( _SC_PAGESIZE ) *
-        (unsigned long int) sysconf( _SC_AVPHYS_PAGES );
-    #endif
-  #elif defined WIN32
-      LPMEMORYSTATUS status_buffer = new MEMORYSTATUS;
-      GlobalMemoryStatus( status_buffer );
-      freemem = (unsigned long int) status_buffer->dwAvailPhys;
-      delete status_buffer;
-  #else
-      #error "Unsuported plataform for physical memory checking"
-  #endif
-
-  return freemem;
-}
-
-
-unsigned long int TeGetTotalPhysicalMemory()
-{
-  unsigned long int totalmem = 0;
-
-  #if defined __unix__
-    #if defined( __FreeBSD__ )
-      /* BSD workaround */
-      
-      unsigned int physmem;
-      size_t physmem_len = sizeof( physmem );
-      int mib[2] = { CTL_HW, HW_PHYSMEM };
-      
-      if( sysctl( mib, ( 2 * sizeof(int) ), &physmem, &physmem_len, NULL, 0 ) 
-        == 0 ) {
-        
-        totalmem = (unsigned long int)physmem; 
-      } else {
-        throw( "TeGetTotalPhysicalMemory error" );
-      }
-    #else
-      /* Other linux stuff */  
-  
-      totalmem = (unsigned long int) sysconf( _SC_PAGESIZE ) *
-        (unsigned long int) sysconf( _SC_PHYS_PAGES );
-    #endif
-  #elif defined WIN32
-    LPMEMORYSTATUS status_buffer = new MEMORYSTATUS;
-    GlobalMemoryStatus( status_buffer );
-    totalmem = (unsigned long int) status_buffer->dwTotalPhys;
-    delete status_buffer;
-  #else
-    #error "Unsuported plataform for physical memory checking"
-  #endif
-
-  return totalmem;
-}
-
-unsigned long int TeGetFreeVirtualMemory()
-{
-  unsigned long int freemem = 0;
-
-  #if defined __unix__
-    struct rusage rusageinfo;
-    
-    if( getrusage( RUSAGE_SELF, &rusageinfo ) == 0 )
-    {
-      freemem = TeGetTotalVirtualMemory() - 
-        ((unsigned long int)( rusageinfo.ru_maxrss +
-        rusageinfo.ru_ixrss + 
-        rusageinfo.ru_idrss + 
-        rusageinfo.ru_isrss ) );
-    }
-  #elif defined WIN32
-    LPMEMORYSTATUS status_buffer = new MEMORYSTATUS;
-    GlobalMemoryStatus( status_buffer );
-    freemem = (unsigned long int) status_buffer->dwAvailVirtual;
-    delete status_buffer;
-  #else
-      #error "Unsuported plataform for virtual memory checking"
-  #endif
-
-  return freemem;
-}
-
-
-unsigned long int TeGetTotalVirtualMemory()
-{
-  unsigned long int totalmem = 0;
-
-  #if defined __unix__
-    struct rlimit info;
-     
-    if( getrlimit( RLIMIT_AS, &info ) == 0 )
-    {
-      totalmem = (unsigned long int)info.rlim_max;
-    };
-  #elif defined WIN32
-    LPMEMORYSTATUS status_buffer = new MEMORYSTATUS;
-    GlobalMemoryStatus( status_buffer );
-    totalmem = (unsigned long int) status_buffer->dwTotalVirtual;
-    delete status_buffer;
-  #else
-    #error "Unsuported plataform for virtual memory checking"
-  #endif
-
-  return totalmem;
-}
-
-unsigned int TeGetPhysProcNumber()
-{
-  unsigned int procnmb = 0;
-  
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    SYSTEM_INFO siSysInfo;
-    GetSystemInfo(&siSysInfo);
-    procnmb = (unsigned int)siSysInfo.dwNumberOfProcessors;
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-    procnmb = (unsigned int)sysconf(_SC_NPROCESSORS_ONLN );
-  #else
-    #error "ERROR: Unsupported platform"
-  #endif    
-
-  return procnmb;
-}
-  
-  
-bool TeGetTempFileName( std::string& filename )
-{
-  char* name = tempnam( 0, 0 );
-  
-  if( name == 0 ) {
-    filename.clear();
-    return false;
-  } else {
-    filename = std::string( name );
-    return true;
-  }
-}  
-
-
-unsigned long int TeGetFileSize( const std::string& filename )
-{
-  FILE* fileptr = fopen( filename.c_str(), "r" );
-  
-  if( fileptr == 0 ) {
-    throw TeException( CANNOT_OPEN_FILE, "File not found", false );
-  }
-  
-  fseek( fileptr, 0, SEEK_END );
-  
-  unsigned long int filesize = ( unsigned long int ) ftell( fileptr );
-  
-  fclose( fileptr );
-  
-  return filesize;
-}
-
-
-bool TeCheckFileExistence( const std::string& filename )
-{
-  FILE* fileptr = fopen( filename.c_str(), "r" );
-  
-  if( fileptr == 0 ) {
-    return false;
-  } else {
-    fclose( fileptr );
-    return true;
-  }
-}
-
-bool 
-TeGetDirFullFilesNames( const std::string& path,
-  const bool& recursive, std::vector< std::string >& filesnames )
-{
-  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
-    const std::string separator( "\\" );
-  
-    WIN32_FIND_DATA FindFileData;
-    HANDLE hFind;
-
-    hFind = FindFirstFile( (LPCTSTR)(path + "\\*" ).c_str(), 
-      &FindFileData);
-
-    if ( hFind == INVALID_HANDLE_VALUE ) {
-      return false;
-    } else {
-      while( FindNextFile( hFind, &FindFileData) != 0 ) 
-      {
-        if( FindFileData.dwFileAttributes & 
-          FILE_ATTRIBUTE_DIRECTORY ) 
-        {
-          if( recursive ) 
-          {
-            std::string recursive_path;
-            recursive_path = (char*)(FindFileData.cFileName);
-            
-            if( ! ( TeGetDirFullFilesNames( recursive_path, true,
-              filesnames ) ) ) {
-              
-              return false;
-            } 
-          }
-        } else {
-          std::string filename( (char*)FindFileData.cFileName );
-          filesnames.push_back( path + separator + filename );
-        }
-      } 
-    }
-  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
-    DIR* dirptr = opendir( path.c_str() );
-    
-    if( dirptr == 0 ) 
-    {
-      return false;
-    }
-    else
-    {
-      dirent* direntptr = readdir( dirptr );
-      struct stat stat_buf;
-      char filename[ 3000 ];
-      
-      while( direntptr )
-      {
-        filename[ 0 ] = '\0';
-        strcpy( filename, path.c_str() );
-        strcat( filename, "/" );
-        strcat( filename, direntptr->d_name );
-        
-        if( stat( filename, &stat_buf) )
-        {
-          closedir( dirptr );
-          return false;
-        }
-        else
-        {
-          if( S_ISDIR( stat_buf.st_mode ) )
-          {
-            if( recursive && ( strcmp( direntptr->d_name, "." ) != 0 ) && 
-              ( strcmp( direntptr->d_name, ".." ) != 0 ) )
-            {
-              if( TeGetDirFullFilesNames( filename, true, filesnames ) == false )
-              {
-                closedir( dirptr );
-                return false;
-              }
-            }
-          }
-          else
-          {
-            filesnames.push_back( filename );
-          }
-        }
-        
-        direntptr = readdir( dirptr );
-      }
-      
-      closedir( dirptr );
-    }
-  #else
-    #error "ERROR: Unsuported platform"
-  #endif   
-  
-  return true; 
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeUtils.h"
+#include "TeDefines.h"
+#include "TeException.h"
+#include "TeAgnostic.h"
+#include "TeProjection.h"
+#include "TeVectorRemap.h"
+
+
+#include <stdio.h>
+#include <ctype.h>
+#include <string>
+#include <cstring> 
+#include <cstdlib>
+
+/* The following includes are needed for memory checking */
+#if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+  #include <windows.h>
+  #include <winbase.h>
+#elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+  #include <unistd.h>
+  #include <string.h>
+  #include <errno.h>
+  #include <sys/resource.h>
+  #include <sys/types.h>
+  #include <sys/stat.h>  
+  #include <dirent.h>
+  #include <malloc.h>
+
+  #if defined( __FreeBSD__ )
+    #include <sys/sysctl.h> /* BSD workaround */
+  #endif
+#else
+  #error "Unsuported plataform for physical memory checking"
+#endif
+
+#include <fstream>
+
+string
+Te2String ( const int value )
+{
+	char name [ TeNAME_LENGTH ];
+	sprintf ( name, "%d", value );
+	return name;
+}
+
+string
+Te2String ( const unsigned int value )
+{
+	char name [ TeNAME_LENGTH ];
+	sprintf ( name, "%u", value );
+	return name;
+}
+
+string
+Te2String ( const long value )
+{
+	char name [ TeNAME_LENGTH ];
+	sprintf ( name, "%ld", value );
+	return name;
+}
+
+string
+Te2String ( const unsigned long value )
+{
+	char name [ TeNAME_LENGTH ];
+	sprintf ( name, "%lu", value );
+	return name;
+}
+
+void
+TeTrim(string &str)
+{
+//empty strings are bad
+    if(str.empty())
+		return;
+//remove left whitespace, \t and \n
+	string::iterator it;
+    for(it=str.begin();it!=str.end() &&
+		((*it) == ' ' ||  (*it) == '\t' || (*it) == '\n');it++);
+		str.erase(str.begin(),it);
+//empty strings are bad
+    if(str.empty())
+		return;
+//remove right whitespace, \t and \n
+	it=str.end();
+    for(--it;it!=str.begin() && 
+	   ((*it) == ' ' ||  (*it) == '\t' || (*it) == '\n' || (*it) == 13);--it);  //13 = CR = Carriage Return
+		str.erase(++it,str.end());
+}
+
+std::string
+TeRemoveSpecialChars ( const std::string& str)
+{
+	string aux; 
+	string::const_iterator it;
+    for(it=str.begin();it!=str.end();it++)
+	{
+		if (isalnum(*it))
+			aux+=(*it);
+	}
+	return aux;
+}
+
+std::string TeReplaceSpecialChars ( const std::string& str)
+{
+	bool changed;
+	return TeReplaceSpecialChars (str, changed);
+}
+
+std::string TeReplaceSpecialChars ( const std::string& str, bool& changed)
+{
+
+	changed = false;
+
+	std::vector<std::string> upperIn;
+	std::vector<std::string> upperOut;
+	std::vector<std::string> lowerIn;
+	std::vector<std::string> lowerOut;
+	std::vector<std::string> especialIn;
+	std::vector<std::string> especialOut;
+
+	TeGetAccentuatedUpperVector(upperIn, upperOut);
+	TeGetAccentuatedLowerVector(lowerIn, lowerOut);
+	TeGetEspecialCharsFixVector(especialIn, especialOut);
+
+
+	std::string outputStr(str.c_str());
+	for(unsigned int i = 0; i < outputStr.size(); ++i)
+	{
+		for(unsigned int j = 0; j < upperIn.size(); ++j)
+		{
+			if(outputStr[i] == upperIn[j][0])
+			{
+				outputStr[i] = upperOut[j][0];
+				changed = true;
+				break;
+			}
+		}
+		
+		for(unsigned int j = 0; j < lowerIn.size(); ++j)
+		{
+			if(outputStr[i] == lowerIn[j][0])
+			{
+				outputStr[i] = lowerOut[j][0];
+				changed = true;
+				break;
+			}
+		}
+
+		for(unsigned int j = 0; j < especialIn.size(); ++j)
+		{
+			if(outputStr[i] == especialIn[j][0])
+			{
+				outputStr[i] = especialOut[j][0];
+				changed = true;
+				break;
+			}
+		}	
+		
+	}
+
+	return outputStr;
+
+}
+
+void TeRemoveRightDecimalZeroes( const std::string& strIn,
+  char separatorSymbol, std::string& strOut )
+{
+  const std::string::size_type separatorIdx = strIn.find( separatorSymbol );
+  
+  if( separatorIdx == std::string::npos )
+  {
+    strOut = strIn;
+  }
+  else
+  {
+    std::string::size_type firstNonZeroIdx = 
+      strIn.find_last_not_of( '0' );
+      
+    if( firstNonZeroIdx != separatorIdx )
+    {
+      ++firstNonZeroIdx;
+    }
+    
+    strOut.clear();
+    
+    for( unsigned int strInIdx = 0 ; strInIdx < firstNonZeroIdx ; 
+      ++strInIdx )
+    {
+      strOut.push_back( strIn[ strInIdx ] );
+    }
+  }
+}
+
+string
+Te2String ( const double value, int precision )
+{
+	char name [ TeNAME_LENGTH ];
+	sprintf(name, "%.*f", precision, value );
+
+	std::string strOut(name);
+	size_t found = strOut.find(',');
+	if(found != std::string::npos)
+	{
+		strOut[(int)found] = '.';
+	}
+
+	return strOut;
+}
+
+
+string
+Te2String ( const double value )
+{
+	char name [ TeNAME_LENGTH ];
+	sprintf ( name, "%e", value );
+
+	std::string strOut(name);
+	size_t found = strOut.find(',');
+	if(found != std::string::npos)
+	{
+		strOut[(int)found] = '.';
+	}
+
+	return strOut;
+}
+
+string 
+TeGetExtension ( const char* value )
+{
+	if (!value)
+		return string("");
+	string name = string(value);
+	int len = strlen ( value );
+	unsigned int ip = name.rfind('.');
+	if (ip == std::string::npos)
+		return "";
+	else
+		return name.substr(ip+1,len-1);
+}
+
+string 
+TeGetName ( const char* value )
+{
+	if (!value)
+		return string("");
+	string name = string(value);
+	int len = strlen ( value );
+
+	int sp = name.rfind('\\')+1;
+	int ip = (name.substr(sp,len-1)).rfind('.');
+	int bp = (name.substr(sp,len-1)).rfind('/');
+	if ((ip>0)&& (ip > bp))
+		return name.substr(0,sp+ip);
+	else 
+		return name;
+}
+
+string
+TeGetBaseName ( const char* value )
+{
+	if (!value)
+		return string("");
+	string name = string(value);
+	size_t ip = name.rfind('.');
+	size_t is = name.rfind('\\');
+	if (is == std::string::npos)
+		is = name.rfind('/');
+	return name.substr(is+1,ip-is-1);
+}
+
+string 
+TeGetPath(const char* value)
+{
+	if (!value)
+		return string(".");
+	string name = string (value);
+	std::string::size_type ip = name.rfind('/');
+	if (ip == std::string::npos)
+		return string(".");
+	else
+		return name.substr(0,ip);
+}
+
+void
+TeConvertToUpperCase ( const string& name, char upName[] )
+{
+	
+	const char* old = name.c_str();
+
+	const char* p;
+	int i = 0;
+
+	for( p = old; p < old + strlen ( old) ; p++ )
+	{
+		if ( islower ( *p  ) )
+			upName[i] = toupper( *p );
+		else
+			upName [i] = *p;
+		i++;
+	}
+	upName[i] = '\0';
+}
+
+string
+TeConvertToUpperCase (const string &name)
+{
+	std::vector<std::string> upperIn;
+	std::vector<std::string> lowerIn;
+	std::vector<std::string> upperOut;
+	std::vector<std::string> lowerOut;
+	TeGetAccentuatedLowerVector(lowerIn, lowerOut);
+	TeGetAccentuatedUpperVector(upperIn, upperOut);	
+
+	bool flag = false;
+ 
+	string aux = "";
+	for(unsigned int i=0; i < strlen(name.c_str()); i++)
+	{
+		if((name[i] >= 97) && (name[i] <= 122))
+			aux += name[i] - 32;
+		else
+		{
+			for(unsigned j = 0; j < lowerIn.size(); j++)
+			{
+				if(name[i] == lowerIn[j][0])
+				{
+					aux += upperIn[j][0];
+					flag = true;
+					break;
+				}				
+			}
+
+			if(!flag)
+				aux += name[i];		
+			
+		}
+			
+    }
+	return aux;
+}
+
+
+string
+TeConvertToLowerCase (const string &name)
+{
+	std::vector<std::string> upperIn;
+	std::vector<std::string> lowerIn;
+	std::vector<std::string> upperOut;
+	std::vector<std::string> lowerOut;
+	TeGetAccentuatedLowerVector(lowerIn, lowerOut);
+	TeGetAccentuatedUpperVector(upperIn, upperOut);
+
+	bool flag = false;
+
+	string aux = "";
+	for(unsigned int i=0; i < strlen(name.c_str()); i++)
+	{
+		if((name[i] >= 65) && (name[i] <= 90))
+			aux += name[i] + 32;
+		else
+		{
+			for(unsigned j = 0; j < upperIn.size(); j++)
+			{
+				if(name[i] == upperIn[j][0])
+				{
+					aux += lowerIn[j][0];
+					flag = true;
+					break;
+				}
+				
+			}
+
+			if(!flag)
+				aux += name[i];	
+		}		
+
+    }
+	return aux;
+}
+
+
+//-----------------------------------------------------------------------
+//
+//      Purpose:        STL split string utility
+//      Author:         Paul J. Weiss
+//      Extracted from: The Code Project (http://www.codeproject.com/)
+//
+//------------------------------------------------------------------------
+
+int TeSplitString(const string& input, const string& delimiter, vector<string>& results)
+{
+   int iPos = 0;
+   int newPos = -1;
+   int sizeS2 = delimiter.size();
+   int isize = input.size();
+
+   if (input.empty())
+	   return 0;
+  
+   vector<int> positions;
+
+   newPos = input.find (delimiter, 0);
+
+   if( newPos < 0 ) 
+   { 
+       results.push_back(input);
+	   return 1;
+   }
+
+   int numFound = 0;
+   while( newPos >= iPos )
+   {
+       numFound++;
+       positions.push_back(newPos);
+       iPos = newPos;
+       newPos = input.find (delimiter, iPos+sizeS2+1);
+   }
+
+   for( unsigned int i=0; i <= positions.size(); i++ )
+   {
+       string s;
+       if( i == 0 )
+	   {
+	   s = input.substr( i, positions[i] );
+	   }
+	   else
+	   {
+       int offset=0;
+	   if(i>0)	 offset= positions[i-1] + sizeS2;
+       if( offset < isize )
+       {
+           if( i == positions.size() )
+           {
+		s = input.substr(offset);
+           }
+           else if( i > 0 )
+           {
+                s = input.substr( positions[i-1] + sizeS2, positions[i] - positions[i-1] - sizeS2 );
+           }
+       }
+	   }
+       if( s.size() > 0 )
+       {
+               results.push_back(s);
+       }
+   }
+   return numFound;
+}
+
+bool TeNoCaseCmp(const char&  c1, const char& c2)
+{
+	return toupper(c1) == toupper(c2);
+}
+
+
+bool
+TeStringCompare(const string& str1, const string& str2, bool caseS)
+{
+	if (!caseS)
+	{
+		return ((str1.size() == str2.size()) &&
+			    equal(str1.begin(),str1.end(),str2.begin(),TeNoCaseCmp));
+	}
+	else
+		return (str1 == str2);
+}
+
+double 
+TeRoundD(double val, int precision)
+{
+	char name [ TeNAME_LENGTH ];
+	sprintf ( name, "%.*f", precision, val);
+	return atof(name);
+
+}
+
+bool
+TeCompareDouble(double a, double b, int precision)
+{
+	char bufa [ TeNAME_LENGTH ];
+	char bufb [ TeNAME_LENGTH ];
+	if (precision == 0)
+	{
+		sprintf ( bufa, "%f", a );
+		sprintf ( bufb, "%f", b );
+	}
+	else
+	{
+		sprintf ( bufa, "%.*f", precision, a );
+		sprintf ( bufb, "%.*f", precision, b );
+	}
+
+	string A = bufa;
+	string B = bufb;
+	return (A == B);
+}
+
+void TeWriteToFile(const string& fileName, const string& text, const string& mode)
+{
+	FILE *f;
+
+	f = fopen(fileName.c_str(), mode.c_str());
+
+	if(f != NULL)
+	{
+		fprintf(f, "%s", text.c_str());
+
+		fclose(f);
+	}
+
+	return;
+}
+
+double TeAdjustToPrecision(double val, int precision, bool reduce)
+{
+	double p = pow(10.0, (double)-precision);
+	
+	if (reduce)
+		return (val - p);
+
+	return (val + p);
+}
+
+string TeCheckName(const string& name, bool& changed, string& invalidChar)
+{
+	string newName = name;
+
+	changed = false;
+
+	if(newName[0] >= 0x30 && newName[0] <= 0x39)
+	{
+		invalidChar = "begin with a numeric character\n";
+        changed = true;
+	}
+    if(newName[0] == '_')
+    {
+        invalidChar += "begin with a invalid character: underscore _\n";
+        changed = true;
+    }
+
+	int ff = newName.find(" ");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: blank space\n";
+        changed = true;
+	}
+
+	ff = newName.find(".");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: dot '.'\n";
+        changed = true;
+	}
+
+	ff = newName.find("*");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: mathematical symbol '*'\n";
+        changed = true;
+	}
+
+	ff = newName.find("/");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: mathematical symbol '/'\n";
+        changed = true;
+	}
+
+	ff = newName.find("(");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: parentheses '('\n";
+        changed = true;
+	}
+
+	ff = newName.find(")");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: parentheses ')'\n";
+        changed = true;
+	}
+	ff = newName.find("-");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: mathematical symbol '-'\n";
+        changed = true;
+	}
+
+	ff = newName.find("+");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: mathematical symbol '+'\n";
+        changed = true;
+	}
+
+	ff = newName.find("%");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: mathematical symbol '%'\n";
+        changed = true;
+	}
+
+	ff = newName.find(">");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: mathematical symbol '>'\n";
+        changed = true;
+	}
+
+	ff = newName.find("<");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: mathematical symbol '<'\n";
+        changed = true;
+	}
+
+	ff = newName.find("&");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid character: mathematical symbol '&'\n";
+        changed = true;
+	}
+
+	ff = newName.find("$");
+	if(ff >= 0)
+	{
+        invalidChar += "invalid symbol: '$'\n";
+        changed = true;
+	}
+
+	std::vector<std::string> vecInvalidChars;
+	vecInvalidChars.push_back("�");
+	vecInvalidChars.push_back("�");
+	vecInvalidChars.push_back("�");
+	vecInvalidChars.push_back("�");
+	vecInvalidChars.push_back("�");
+
+	for(unsigned int i = 0; i < vecInvalidChars.size(); ++i)
+	{
+		std::string invalidItem = vecInvalidChars[i];
+
+		ff = newName.find(invalidItem);
+		if(ff >= 0)
+		{
+			invalidChar += "invalid symbol: '" + invalidItem + "'\n";
+			changed = true;
+		}
+	}
+
+
+	string u = TeConvertToUpperCase(newName);
+	if(u=="OR" || u=="AND" || u=="NOT" || u=="LIKE" ||
+	   u=="SELECT" || u=="FROM" || u=="UPDATE" || u=="DELETE" ||u=="BY" || u=="GROUP" || u=="ORDER" ||
+	   u=="DROP" || u=="INTO" || u=="VALUE" || u=="IN" || u=="ASC" || u=="DESC"|| u=="COUNT" || u=="JOIN" ||
+	   u=="LEFT" || u=="RIGHT" || u=="INNER" || u=="UNION" || u=="IS" || u=="NULL" || u=="WHERE" ||
+	   u=="BETWEEN" || u=="DISTINCT" || u=="TRY" || u=="IT" || u=="INSERT" || u=="ALIASES" || u=="CREATE" ||
+	   u=="ALTER" || u=="TABLE" || u=="INDEX" || u=="ALL" || u=="HAVING" || u=="EXEC" || u== "SET" ||
+	   u == "AVG" || u == "MAX" || u == "MIN" || u == "SUM" || u == "FILTER" || u == "OFFSET"  || u == "LENGHT" )
+	{
+        invalidChar += "invalid name: using reserved word " + u + "\n";	
+        changed = true;
+	}
+
+	// check against geometry tables field names
+	string n = TeConvertToLowerCase(newName); 
+
+	if (n == "x" || n == "y" || n == "object_id" ||
+	   n == "geom_id" || n == "num_coords" || 
+	   n == "lower_x" || n == "lower_y" ||
+	   n == "upper_x" || n == "upper_y" ||
+	   n == "ext_max" || n == "spatial_data" ||
+	   n == "num_holes" || n == "parent_id" ||
+	   n == "col_number" || n == "row_number" || 
+	   n == "text_value" || n == "angle" ||
+	   n == "height" || n == "alignment_vert" ||
+	   n == "alignment_horiz" || n=="from_node" ||
+	   n == "to_node")
+	{
+        invalidChar += "invalid name: using reserved word " + n + "\n";	
+        changed = true;
+	}
+
+	// reserved words
+	if( (n=="zone") || (n=="comp") || (n=="no") || (n=="local") ||
+		(n=="level") || (n=="long"))
+	{
+        invalidChar += "invalid name: using reserved word " + n + "\n";	
+        changed = true;
+	}
+
+	return newName;
+}
+
+
+unsigned long int TeGetFreePhysicalMemory()
+{
+  unsigned long int freemem = 0;
+
+  #if defined __unix__
+    #if defined( __FreeBSD__ )
+      /* BSD workaround */
+      
+      unsigned int usermem;
+      size_t usermem_len = sizeof( usermem );
+      int mib[2] = { CTL_HW, HW_USERMEM };
+      
+      if( sysctl( mib, ( 2 * sizeof(int) ), &usermem, &usermem_len, NULL, 0 ) 
+        == 0 ) {
+        
+        freemem = (unsigned long int)usermem;
+      } else {
+        throw( "TeGetFreePhysicalMemory error" );
+      }
+    #else
+      /* Other linux stuff */
+      
+      freemem = (unsigned long int) sysconf( _SC_PAGESIZE ) *
+        (unsigned long int) sysconf( _SC_AVPHYS_PAGES );
+    #endif
+  #elif defined WIN32
+      LPMEMORYSTATUS status_buffer = new MEMORYSTATUS;
+      GlobalMemoryStatus( status_buffer );
+      freemem = (unsigned long int) status_buffer->dwAvailPhys;
+      delete status_buffer;
+  #else
+      #error "Unsuported plataform for physical memory checking"
+  #endif
+
+  return freemem;
+}
+
+
+unsigned long int TeGetTotalPhysicalMemory()
+{
+  unsigned long int totalmem = 0;
+
+  #if defined __unix__
+    #if defined( __FreeBSD__ )
+      /* BSD workaround */
+      
+      unsigned int physmem;
+      size_t physmem_len = sizeof( physmem );
+      int mib[2] = { CTL_HW, HW_PHYSMEM };
+      
+      if( sysctl( mib, ( 2 * sizeof(int) ), &physmem, &physmem_len, NULL, 0 ) 
+        == 0 ) {
+        
+        totalmem = (unsigned long int)physmem; 
+      } else {
+        throw( "TeGetTotalPhysicalMemory error" );
+      }
+    #else
+      /* Other linux stuff */  
+  
+      totalmem = (unsigned long int) sysconf( _SC_PAGESIZE ) *
+        (unsigned long int) sysconf( _SC_PHYS_PAGES );
+    #endif
+  #elif defined WIN32
+    LPMEMORYSTATUS status_buffer = new MEMORYSTATUS;
+    GlobalMemoryStatus( status_buffer );
+    totalmem = (unsigned long int) status_buffer->dwTotalPhys;
+    delete status_buffer;
+  #else
+    #error "Unsuported plataform for physical memory checking"
+  #endif
+
+  return totalmem;
+}
+
+unsigned long int TeGetFreeVirtualMemory()
+{
+  unsigned long int freemem = 0;
+
+  #if defined __unix__
+    #if defined( __FreeBSD__ )
+      struct rusage rusageinfo;
+      
+      if( getrusage( RUSAGE_SELF, &rusageinfo ) == 0 )
+      {
+        freemem = TeGetTotalVirtualMemory() - 
+          ((unsigned long int)( rusageinfo.ru_maxrss +
+          rusageinfo.ru_ixrss + 
+          rusageinfo.ru_idrss + 
+          rusageinfo.ru_isrss ) );
+      }
+    #else
+      /* Other linux stuff */
+      struct mallinfo meminfo;
+      meminfo = mallinfo();
+      
+      freemem = TeGetTotalVirtualMemory() - ( (unsigned long int)
+        ( meminfo.arena + meminfo.hblkhd ) );
+    #endif
+  #elif defined WIN32
+    LPMEMORYSTATUS status_buffer = new MEMORYSTATUS;
+    GlobalMemoryStatus( status_buffer );
+    freemem = (unsigned long int) status_buffer->dwAvailVirtual;
+    delete status_buffer;
+  #else
+      #error "Unsuported plataform for virtual memory checking"
+  #endif
+
+  return freemem;
+}
+
+
+unsigned long int TeGetTotalVirtualMemory()
+{
+  unsigned long int totalmem = 0;
+
+  #if defined __unix__
+    struct rlimit info;
+     
+    if( getrlimit( RLIMIT_AS, &info ) == 0 )
+    {
+      totalmem = (unsigned long int)info.rlim_max;
+    };
+  #elif defined WIN32
+    LPMEMORYSTATUS status_buffer = new MEMORYSTATUS;
+    GlobalMemoryStatus( status_buffer );
+    totalmem = (unsigned long int) status_buffer->dwTotalVirtual;
+    delete status_buffer;
+  #else
+    #error "Unsuported plataform for virtual memory checking"
+  #endif
+
+  return totalmem;
+}
+
+unsigned int TeGetPhysProcNumber()
+{
+  unsigned int procnmb = 0;
+  
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    SYSTEM_INFO siSysInfo;
+    GetSystemInfo(&siSysInfo);
+    procnmb = (unsigned int)siSysInfo.dwNumberOfProcessors;
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    procnmb = (unsigned int)sysconf(_SC_NPROCESSORS_ONLN );
+  #else
+    #error "ERROR: Unsupported platform"
+  #endif    
+
+  return procnmb;
+}
+  
+  
+bool TeGetTempFileName( std::string& filename )
+{
+  char* name = tempnam( 0, 0 );
+  
+  if( name == 0 ) {
+    filename.clear();
+    return false;
+  } else {
+    filename = std::string( name );
+    return true;
+  }
+}  
+
+
+unsigned long int TeGetFileSize( const std::string& filename )
+{
+  FILE* fileptr = fopen( filename.c_str(), "r" );
+  
+  if( fileptr == 0 ) {
+    throw TeException( CANNOT_OPEN_FILE, "File not found", false );
+  }
+  
+  fseek( fileptr, 0, SEEK_END );
+  
+  unsigned long int filesize = ( unsigned long int ) ftell( fileptr );
+  
+  fclose( fileptr );
+  
+  return filesize;
+}
+
+
+bool TeCheckFileExistence( const std::string& filename )
+{
+  FILE* fileptr = fopen( filename.c_str(), "r" );
+  
+  if( fileptr == 0 ) {
+    return false;
+  } else {
+    fclose( fileptr );
+    return true;
+  }
+}
+
+bool 
+TeGetDirFullFilesNames( const std::string& path,
+  const bool& recursive, std::vector< std::string >& filesnames )
+{
+  #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
+    const std::string separator( "\\" );
+  
+    WIN32_FIND_DATA FindFileData;
+    HANDLE hFind;
+
+    hFind = FindFirstFile( (LPCTSTR)(path + "\\*" ).c_str(), 
+      &FindFileData);
+
+    if ( hFind == INVALID_HANDLE_VALUE ) {
+      return false;
+    } else {
+      while( FindNextFile( hFind, &FindFileData) != 0 ) 
+      {
+        if( FindFileData.dwFileAttributes & 
+          FILE_ATTRIBUTE_DIRECTORY ) 
+        {
+          if( recursive && ( strcmp( (char*)(FindFileData.cFileName), "." ) != 0 ) && 
+            ( strcmp( (char*)(FindFileData.cFileName), ".." ) != 0 ) ) 
+          {
+            std::string recursive_path = path + separator + (char*)(FindFileData.cFileName);
+            
+            if( ! ( TeGetDirFullFilesNames( recursive_path, true,
+              filesnames ) ) ) 
+            {
+              return false;
+            } 
+          }
+        } else {
+          filesnames.push_back( path + separator + (char*)FindFileData.cFileName );
+        }
+      }
+
+      FindClose( hFind );
+    }
+  #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX
+    DIR* dirptr = opendir( path.c_str() );
+    
+    if( dirptr == 0 ) 
+    {
+      return false;
+    }
+    else
+    {
+      dirent* direntptr = readdir( dirptr );
+      struct stat stat_buf;
+      char filename[ 3000 ];
+      
+      while( direntptr )
+      {
+        filename[ 0 ] = '\0';
+        strcpy( filename, path.c_str() );
+        strcat( filename, "/" );
+        strcat( filename, direntptr->d_name );
+        
+        if( stat( filename, &stat_buf) )
+        {
+          closedir( dirptr );
+          return false;
+        }
+        else
+        {
+          if( S_ISDIR( stat_buf.st_mode ) )
+          {
+            if( recursive && ( strcmp( direntptr->d_name, "." ) != 0 ) && 
+              ( strcmp( direntptr->d_name, ".." ) != 0 ) )
+            {
+              if( TeGetDirFullFilesNames( filename, true, filesnames ) == false )
+              {
+                closedir( dirptr );
+                return false;
+              }
+            }
+          }
+          else
+          {
+            filesnames.push_back( filename );
+          }
+        }
+        
+        direntptr = readdir( dirptr );
+      }
+      
+      closedir( dirptr );
+    }
+  #else
+    #error "ERROR: Unsuported platform"
+  #endif   
+  
+  return true; 
+}
+
+bool TeCopyFile( const std::string& inputFileName,
+  const std::string& outputFileName )
+{
+  std::ifstream ifs(inputFileName.c_str(),std::ios::in | std::ios::binary);
+  if( ifs.is_open() )
+  {
+    std::ofstream ofs(outputFileName.c_str(),std::ios::out | std::ios::binary);
+    if( ofs.is_open() )
+    {
+      ofs << ifs.rdbuf();
+      return ! ofs.bad();
+    }
+    else
+    {
+      return false;
+    }
+  }
+  else
+  {
+    return false;
+  }
+}
+
+bool TeCompareFiles( const std::string& inputFileName1,
+    const std::string& inputFileName2 )
+{
+  std::ifstream ifs1(inputFileName1.c_str(),std::ios::in | std::ios::binary |
+    std::ios_base::ate );
+  std::ifstream ifs2(inputFileName2.c_str(),std::ios::in | std::ios::binary |
+    std::ios_base::ate );
+  
+  if( ifs1.is_open() && ifs2.is_open() )
+  {
+    if( ifs1.tellg() == ifs2.tellg() )
+    {  
+      ifs1.seekg( 0, ios_base::beg );
+      ifs2.seekg( 0, ios_base::beg );
+      
+      char data1 = 0;
+      char data2 = 0;
+      
+      while( ! ifs1.eof() )
+      {
+        if( ifs1.read( &data1, 1 ).bad() )
+          return false;
+        if( ifs2.read( &data2, 1 ).bad() )
+          return false;        
+        if( data1 != data2 )
+          return false;  
+      }
+      
+      return true;
+    }
+    else
+    {
+      return false;
+    }    
+  }
+  else
+  {
+    return false;
+  }
+}
+
+bool TeReplaceTextFileSubString( const std::string& inputFileName,
+    const std::string& outputFileName, const std::string& oldSubString,
+    const std::string& newSubString )
+{
+  std::ifstream ifs(inputFileName.c_str(),std::ios::in);
+  if( ifs.is_open() )
+  {
+    std::ofstream ofs(outputFileName.c_str(),std::ios::out);
+    
+    if( ofs.is_open() )
+    {
+      std::string lineStr;
+      std::string::size_type findPos = 0;
+      
+      do
+      {
+        getline( ifs, lineStr );
+        
+        while( ( findPos = lineStr.find( oldSubString, 0 ) ) < 
+          std::string::npos )
+        {
+          lineStr.erase( findPos, oldSubString.size() );
+          lineStr.insert( findPos, newSubString );
+        }
+        
+        ofs << lineStr << std::endl;
+      }
+      while( ! ifs.eof() );
+      
+      return ! ofs.bad();
+    }
+    else
+    {
+      return false;
+    }
+  }
+  else
+  {
+    return false;
+  }
+}
+
+unsigned long int TeCreateHashFromString( unsigned char const* inputString,
+  const unsigned int& inputStringSize )
+{
+  unsigned long int hash = 0;
+
+  for( register unsigned int idx = 0 ; idx < inputStringSize ; ++idx )
+  {  
+    hash = ((unsigned long int)inputString[ idx ]) + (hash << 6) + 
+      (hash << 16) - hash;
+  }
+  
+  return hash;
+}
+
+
+bool TeRenameInvalidFieldName(TeAttributeList &attr)
+{
+	TeAttributeList::iterator			it;
+	std::string							fieldName;
+	std::string							errorMessage;
+	bool								changed;
+	bool								renamed=false;
+	unsigned int						i=0;
+
+	for(it=attr.begin();it!=attr.end();it++)
+	{
+		fieldName=(*it).rep_.name_;
+		if(isdigit(fieldName[0]))
+		{
+			fieldName="Te" + fieldName;
+			renamed=true;
+		}
+		TeCheckName(fieldName, changed, errorMessage);
+		if(changed)
+		{
+			fieldName=TeRemoveSpecialChars(fieldName);
+			fieldName+="_A";
+			fieldName+=Te2String(++i);
+			renamed=true;
+		}
+		(*it).rep_.name_=fieldName;
+	}
+	return renamed;
+}
+
+void TeGetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut)
+{
+	especialIn.push_back("�"); 
+	especialIn.push_back("�");
+	especialIn.push_back("�");
+	especialIn.push_back("�");
+	especialIn.push_back("�");	
+
+	especialOut.push_back("a");
+	especialOut.push_back("o");
+	especialOut.push_back("1");
+	especialOut.push_back("2");
+	especialOut.push_back("3");	
+}
+
+void TeGetAccentuatedUpperVector(std::vector<std::string> & upperIn, std::vector<std::string> & upperOut)
+{
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+	upperIn.push_back("�");
+
+	upperOut.push_back("A");
+	upperOut.push_back("E");
+	upperOut.push_back("I");
+	upperOut.push_back("O");
+	upperOut.push_back("U");
+	upperOut.push_back("A");
+	upperOut.push_back("E");
+	upperOut.push_back("I");
+	upperOut.push_back("O");
+	upperOut.push_back("U");
+	upperOut.push_back("A");
+	upperOut.push_back("E");
+	upperOut.push_back("I");
+	upperOut.push_back("O");
+	upperOut.push_back("U");
+	upperOut.push_back("A");
+	upperOut.push_back("E");
+	upperOut.push_back("I");
+	upperOut.push_back("O");
+	upperOut.push_back("U");
+	upperOut.push_back("A");
+	upperOut.push_back("O");
+	upperOut.push_back("C");
+}
+
+void TeGetAccentuatedLowerVector(std::vector<std::string> & lowerIn, std::vector<std::string> & lowerOut)
+{
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+	lowerIn.push_back("�");
+
+	lowerOut.push_back("a");
+	lowerOut.push_back("e");
+	lowerOut.push_back("i");
+	lowerOut.push_back("o");
+	lowerOut.push_back("u");
+	lowerOut.push_back("a");
+	lowerOut.push_back("e");
+	lowerOut.push_back("i");
+	lowerOut.push_back("o");
+	lowerOut.push_back("u");
+	lowerOut.push_back("a");
+	lowerOut.push_back("e");
+	lowerOut.push_back("i");
+	lowerOut.push_back("o");
+	lowerOut.push_back("u");
+	lowerOut.push_back("a");
+	lowerOut.push_back("e");
+	lowerOut.push_back("i");
+	lowerOut.push_back("o");
+	lowerOut.push_back("u");
+	lowerOut.push_back("a");
+	lowerOut.push_back("o");
+	lowerOut.push_back("c");
+
+}
+
+ bool TeCheckBoxConsistency(const TeBox& box, TeProjection* boxProjection)
+ {
+	if(box.isValid() == false)
+	{
+		return false;
+	}
+
+	 TeBox boxToUse(box);
+	 if(boxProjection->name() != "LatLong")
+	 {
+		 TeProjectionParams params;
+		 params.name = "LatLong";
+		 params.datum = TeDatumFactory::make("SAD69");
+
+		 TeProjection* projLatLong = TeProjectionFactory::make(params);
+
+		 boxToUse = TeRemapBox(box, boxProjection, projLatLong);
+	 }
+
+	 if(boxToUse.x1() < -180. || boxToUse.y1() < -85. || boxToUse.x2() > 180. || boxToUse.y2() > 85.)
+	 {
+		 return false;
+	 }
+
+	 return true;
+ }
\ No newline at end of file
diff --git a/src/terralib/kernel/TeUtils.h b/src/terralib/kernel/TeUtils.h
old mode 100755
new mode 100644
index 5c85710..5484111
--- a/src/terralib/kernel/TeUtils.h
+++ b/src/terralib/kernel/TeUtils.h
@@ -1,295 +1,405 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeUtils.h
-     \brief This file contains some general purpose utilitary  functions
-*/
-#ifndef  __TERRALIB_INTERNAL_UTILS_H
-#define  __TERRALIB_INTERNAL_UTILS_H
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#include <string>
-#include <vector>
-#include <cstdio>
-#include <time.h>
-
-
-#include "TeCoord2D.h"
-#include "TeProgress.h"
-
-using namespace std;
-
-/** @defgroup Utils General purpose utilitary functions
- *  General purpose utilitary functions
- *  @{
- */
-
-/** @defgroup FileNameFunctions Functions to manipulate file names 
-	@ingroup  Utils
- *  @{
- */
-	//! Get the extension part (right to the dot) of a string
-	TL_DLL string TeGetExtension ( const char* value );
-
-	//! Get the name part (left to the dot) of a string, path included
-	TL_DLL string TeGetName ( const char* value );
-
-	//! Get the base name part of a string, strip path information
-	TL_DLL string TeGetBaseName ( const char* value );
-
-	//! Get the path part of a file name
-	TL_DLL string TeGetPath(const char* value);
-
-	//! Writes a string to a file.
-	/*!
-		\param fileName the file name to write to, including the directory.
-		\param text     the string with the text to write to.
-		\param mode     the mode used to write to the file (a | w | r).
-	*/
-	TL_DLL void TeWriteToFile(const string& fileName, const string& text, const string& mode);
-/** @} */ 
-
-/** @defgroup C2StringFunctions Functions convert numbers to strings
-	@ingroup  Utils
- *  @{
- */
-	//! Transforms an integer to string
-	TL_DLL string Te2String ( const int value );
-
-	//! Transforms an unsigned integer to string
-	TL_DLL string Te2String ( const unsigned int value );
-
-	//! Transforms a long to string
-	TL_DLL string Te2String ( const long value );
-
-	//! Transforms an unsigned long to string
-	TL_DLL string Te2String ( const unsigned long value );
-
-	//! Transforms a double to string floating point notation with precision decimal places
-	TL_DLL string Te2String ( const double value, int precision );
-
-	//! Transforms a double to string in exponential notation
-	TL_DLL string Te2String ( const double value );
-
-/** @} */ 
-
-/** @defgroup StringFunctions Functions to manipulate strings
- 	@ingroup  Utils
-*  @{
- */
-	//! Converts a string to upper case
-	TL_DLL void TeConvertToUpperCase ( const string& , char* );
-
-	//! Converts a string to upper case
-	TL_DLL string TeConvertToUpperCase (const string &name);
-
-	//! Converts a string to lower case
-	TL_DLL string TeConvertToLowerCase (const string &name);
-
-	//! Removes special characteres from a string
-	TL_DLL string TeRemoveSpecialChars ( string& str);
-
-	//! Removes left and right blank, tab and carriage return characters of a string
-	TL_DLL void TeTrim(string &str);
-
-	//! Splits a string, given a separator, in a vector of parts
-	TL_DLL int TeSplitString(const string& input, const string& delimiter, vector<string>& results);
-
-	//! Compares two strings
-	/*
-		\params caseS flag indicating if it is a case sensitive comparation
-	*/
-	TL_DLL bool TeStringCompare(const string& str1, const string& str2, bool caseS=false);
-
-
-	//! Validate a string to check if it can be used as a column name
-	/*
-		\param name			string to be checked
-		\param changed		output flag to identify that string has changed
-		\param invalidChar	output or sequence of chars that are invalid in the name
-		\return the modified valid name
-	*/
-	TL_DLL string TeCheckName(const string& name, bool& changed, string& invalidChar);
-/** @} */ 
-
-/** @defgroup MathFunctions Mathematical functions
- 	@ingroup  Utils
-*  @{
- */
-	//! Rounds a double to int
-	TL_DLL inline int TeRound(double val)
-	{	
-		if (val>=0)
-			return (int)(val+.5);
-		else
-			return (int)(val-.5);
-	}
-
-	//! Rounds a double value to a given number of decimal digits
-	TL_DLL double TeRoundD(double val, int precision=8);
-
-	//! Compares two doubles
-	TL_DLL bool TeCompareDouble(double a, double b, int precision);
-
-	//! Adjust a number to a given precision 
-	/*
-		\param val the number to be adjusted
-		\param precision the number of decimals places to be used
-		\param reduce flag to indicate that the number should be reduced instead to increased
-		\return the adjusted number
-	*/
-	TL_DLL double TeAdjustToPrecision(double val, int precision, bool reduce=false);
-
-	//! Rounds a double raster element index to an integer
-	/*
-		Raster elements have area, so raster element in upper-left position has
-		index from [-0.5,+0.5) in i and j dimension.
-	*/
-	TL_DLL inline int TeRoundRasterIndex(double val)
-	{	
-		int ind = (int) val;
-		if (val < (ind-0.5))
-			ind -= 1;
-		else if (val >= (ind+0.5))
-			ind += 1;
-		return ind;
-	}
-	/**
-	* Cubic root from x.
-	*
-	* @param x X.
-	* @return The cubic root from x.
-	*/         
-	TL_DLL inline double TeCubicRoot( double x )
-	{
-		if( x < 0 ) {
-		return ( -1. ) * pow(  ( -1. ) * x, ( 1. / 3. ) );
-		} else {
-			return pow(  x, ( 1. / 3. ) );
-		}
-	};
-	
-	/*! Comparassion of two floating points, considering a given precision */
-	TL_DLL inline bool TeFPEquals(double d1, double d2, double precision)
-	{
-		double eps1 = fabs(d1), 
-			eps2 = fabs(d2), 
-			eps;
-		eps = (eps1 > eps2) ? eps1 : eps2;
-		if (eps == 0.0)
-			return true; //both numbers are 0.0
-		eps *= precision;
-		return (fabs(d1 - d2) < eps);
-	}
-
-	//! Swap the bytes of a short value
-	static inline short swaps(short value)
-	{
-		short svalue = ((value & 0x00ff) << 8) | ((value >> 8) & 0x00ff);
-		return svalue;
-	}
-  
-  /**
-   * Returns the amount of free physical memory (bytes).
-   *
-   * @return The amount of free physical memory (bytes).
-   */
-  TL_DLL unsigned long int TeGetFreePhysicalMemory();
-
-  /**
-   * Returns the amount of total physical memory (bytes).
-   *
-   * @return The amount of total physical memory (bytes).
-   */
-  TL_DLL unsigned long int TeGetTotalPhysicalMemory();
-  
-  /**
-   * Returns the amount of free virtual memory (bytes)
-   * for the current process (physical + swapped).
-   *
-   * @return The amount of free virtual memory (bytes).
-   */
-  TL_DLL unsigned long int TeGetFreeVirtualMemory();
-
-  /**
-   * Returns the amount of total virtual memory (bytes)
-   * that can be claimed by the current process 
-   * (physical + swapped).
-   *
-   * @return The amount of total virtual memory (bytes).
-   */
-  TL_DLL unsigned long int TeGetTotalVirtualMemory();  
-  
-  /**
-   * Returns the number of physical processors.
-   *
-   * @return The number of physical processors.
-   */
-  TL_DLL unsigned int TeGetPhysProcNumber();  
-    
-  /**
-   * Generates a temporary unique file name.
-   *
-   * @param filename The generated file name.
-   * @return true if ok, false errors.
-   */
-  TL_DLL bool TeGetTempFileName( std::string& filename );    
-  
-  /**
-   * @brief The file size (bytes).
-   *
-   * @note Throws an exception if file not found. 
-   * @param filename The file name.
-   * @return The file size (bytes).
-   */
-  TL_DLL unsigned long int TeGetFileSize( const std::string& filename );  
-  
-  /**
-   * @brief Check the file existence.
-   *
-   * @param filename The file name.
-   * @return true if the file exists, false if not.
-   */
-  TL_DLL bool TeCheckFileExistence( const std::string& filename );
-  
-  //! Get the full names of all files inside the given directory.
-  /*
-    \param path The directory path.
-    \param recursive If true, a recursive search will be performed.
-    \param filesnames The files names.
-    \return true if OK, false on errors.
-  */
-  TL_DLL bool 
-  TeGetDirFullFilesNames( const std::string& path,
-    const bool& recursive,
-    std::vector< std::string >& filesnames );  
-
-
-/** @} */ 
-/** @} */ 
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeUtils.h
+     \brief This file contains some general purpose utilitary  functions
+*/
+#ifndef  __TERRALIB_INTERNAL_UTILS_H
+#define  __TERRALIB_INTERNAL_UTILS_H
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#include <string>
+#include <vector>
+#include <cstdio>
+#include <time.h>
+
+
+#include "TeCoord2D.h"
+#include "TeProgress.h"
+#include "TeAttribute.h"
+#include "TeBox.h"
+
+class TeProjection;
+
+using namespace std;
+
+/** @defgroup Utils General purpose utilitary functions
+ *  General purpose utilitary functions
+ *  @{
+ */
+
+/** @defgroup FileNameFunctions Functions to manipulate file names 
+	@ingroup  Utils
+ *  @{
+ */
+	//! Get the extension part (right to the dot) of a string
+	TL_DLL string TeGetExtension ( const char* value );
+
+	//! Get the name part (left to the dot) of a string, path included
+	TL_DLL string TeGetName ( const char* value );
+
+	//! Get the base name part of a string, strip path information
+	TL_DLL string TeGetBaseName ( const char* value );
+
+	//! Get the path part of a file name
+	TL_DLL string TeGetPath(const char* value);
+
+	//! Writes a string to a file.
+	/*!
+		\param fileName the file name to write to, including the directory.
+		\param text     the string with the text to write to.
+		\param mode     the mode used to write to the file (a | w | r).
+	*/
+	TL_DLL void TeWriteToFile(const string& fileName, const string& text, const string& mode);
+/** @} */ 
+
+/** @defgroup C2StringFunctions Functions convert numbers to strings
+	@ingroup  Utils
+ *  @{
+ */
+	//! Transforms an integer to string
+	TL_DLL string Te2String ( const int value );
+
+	//! Transforms an unsigned integer to string
+	TL_DLL string Te2String ( const unsigned int value );
+
+	//! Transforms a long to string
+	TL_DLL string Te2String ( const long value );
+
+	//! Transforms an unsigned long to string
+	TL_DLL string Te2String ( const unsigned long value );
+
+	//! Transforms a double to string floating point notation with precision decimal places
+	TL_DLL string Te2String ( const double value, int precision );
+
+	//! Transforms a double to string in exponential notation
+	TL_DLL string Te2String ( const double value );
+
+/** @} */ 
+
+/** @defgroup StringFunctions Functions to manipulate strings
+ 	@ingroup  Utils
+*  @{
+ */
+	//! Converts a string to upper case
+	TL_DLL void TeConvertToUpperCase ( const string& , char* );
+
+	//! Converts a string to upper case
+	TL_DLL string TeConvertToUpperCase (const string &name);
+
+	//! Converts a string to lower case
+	TL_DLL string TeConvertToLowerCase (const string &name);
+
+	//! Removes special characteres from a string
+	TL_DLL std::string TeRemoveSpecialChars ( const std::string& str);
+
+	//! Replace special characteres from a string
+	TL_DLL std::string TeReplaceSpecialChars ( const std::string& str);
+
+	//! Replace special characteres from a string 
+	TL_DLL std::string TeReplaceSpecialChars ( const std::string& str,  bool& changed);
+
+	//! Rename special field names
+	TL_DLL bool TeRenameInvalidFieldName(TeAttributeList &attr);
+  
+  //! Remove all occurrences right decimal zeros from the real number represented by strIn.
+  /*
+    \param strIn Input String.
+    \param separatorSymbol The symbol between the decimal string part
+    and the remaining characteres.
+    \param strOut Output string.
+  */
+  TL_DLL void TeRemoveRightDecimalZeroes( const std::string& strIn, 
+    char separatorSymbol, std::string& strOut );
+  
+
+	//! Removes left and right blank, tab and carriage return characters of a string
+	TL_DLL void TeTrim(string &str);
+
+	//! Splits a string, given a separator, in a vector of parts
+	TL_DLL int TeSplitString(const string& input, const string& delimiter, vector<string>& results);
+
+	//! Compares two strings
+	/*
+		\params caseS flag indicating if it is a case sensitive comparation
+	*/
+	TL_DLL bool TeStringCompare(const string& str1, const string& str2, bool caseS=false);
+
+
+	//! Validate a string to check if it can be used as a column name
+	/*
+		\param name			string to be checked
+		\param changed		output flag to identify that string has changed
+		\param invalidChar	output or sequence of chars that are invalid in the name
+		\return the modified valid name
+	*/
+	TL_DLL string TeCheckName(const string& name, bool& changed, string& invalidChar);
+/** @} */ 
+
+/** @defgroup MathFunctions Mathematical functions
+ 	@ingroup  Utils
+*  @{
+ */
+	//! Rounds a double to int
+	TL_DLL inline int TeRound(double val)
+	{	
+		if (val>=0)
+			return (int)(val+.5);
+		else
+			return (int)(val-.5);
+	}
+
+	//! Rounds a double value to a given number of decimal digits
+	TL_DLL double TeRoundD(double val, int precision=8);
+
+	//! Compares two doubles
+	TL_DLL bool TeCompareDouble(double a, double b, int precision);
+
+	//! Adjust a number to a given precision 
+	/*
+		\param val the number to be adjusted
+		\param precision the number of decimals places to be used
+		\param reduce flag to indicate that the number should be reduced instead to increased
+		\return the adjusted number
+	*/
+	TL_DLL double TeAdjustToPrecision(double val, int precision, bool reduce=false);
+
+	//! Rounds a double raster element index to an integer
+	/*
+		Raster elements have area, so raster element in upper-left position has
+		index from [-0.5,+0.5) in i and j dimension.
+	*/
+	TL_DLL inline int TeRoundRasterIndex(double val)
+	{	
+		int ind = (int) val;
+		if (val < (ind-0.5))
+			ind -= 1;
+		else if (val >= (ind+0.5))
+			ind += 1;
+		return ind;
+	}
+	/**
+	* Cubic root from x.
+	*
+	* @param x X.
+	* @return The cubic root from x.
+	*/         
+	TL_DLL inline double TeCubicRoot( double x )
+	{
+		if( x < 0 ) {
+		return ( -1. ) * pow(  ( -1. ) * x, ( 1. / 3. ) );
+		} else {
+			return pow(  x, ( 1. / 3. ) );
+		}
+	};
+	
+	/*! Comparassion of two floating points, considering a given precision */
+	TL_DLL inline bool TeFPEquals(double d1, double d2, double precision)
+	{
+		double eps1 = fabs(d1), 
+			eps2 = fabs(d2), 
+			eps;
+		eps = (eps1 > eps2) ? eps1 : eps2;
+		if (eps == 0.0)
+			return true; //both numbers are 0.0
+		eps *= precision;
+		return (fabs(d1 - d2) < eps);
+	}
+
+	//! Swap the bytes of a short value
+	static inline short swaps(short value)
+	{
+		short svalue = ((value & 0x00ff) << 8) | ((value >> 8) & 0x00ff);
+		return svalue;
+	}
+  
+  /**
+   * Returns the amount of free physical memory (bytes).
+   *
+   * @return The amount of free physical memory (bytes).
+   */
+  TL_DLL unsigned long int TeGetFreePhysicalMemory();
+
+  /**
+   * Returns the amount of total physical memory (bytes).
+   *
+   * @return The amount of total physical memory (bytes).
+   */
+  TL_DLL unsigned long int TeGetTotalPhysicalMemory();
+  
+  /**
+   * Returns the amount of free virtual memory (bytes)
+   * for the current process (physical + swapped).
+   *
+   * @return The amount of free virtual memory (bytes).
+   */
+  TL_DLL unsigned long int TeGetFreeVirtualMemory();
+
+  /**
+   * Returns the amount of total virtual memory (bytes)
+   * that can be claimed by the current process 
+   * (physical + swapped).
+   *
+   * @return The amount of total virtual memory (bytes).
+   */
+  TL_DLL unsigned long int TeGetTotalVirtualMemory();  
+  
+  /**
+   * Returns the number of physical processors.
+   *
+   * @return The number of physical processors.
+   */
+  TL_DLL unsigned int TeGetPhysProcNumber();  
+    
+  /**
+   * Generates a temporary unique file name.
+   *
+   * @param filename The generated file name.
+   * @return true if ok, false errors.
+   */
+  TL_DLL bool TeGetTempFileName( std::string& filename );    
+  
+  /**
+   * @brief The file size (bytes).
+   *
+   * @note Throws an exception if file not found. 
+   * @param filename The file name.
+   * @return The file size (bytes).
+   */
+  TL_DLL unsigned long int TeGetFileSize( const std::string& filename );  
+  
+  /**
+   * @brief Check the file existence.
+   *
+   * @param filename The file name.
+   * @return true if the file exists, false if not.
+   */
+  TL_DLL bool TeCheckFileExistence( const std::string& filename );
+  
+  //! Get the full names of all files inside the given directory.
+  /*
+    \param path The directory path.
+    \param recursive If true, a recursive search will be performed.
+    \param filesnames The files names.
+    \return true if OK, false on errors.
+  */
+  TL_DLL bool 
+  TeGetDirFullFilesNames( const std::string& path,
+    const bool& recursive,
+    std::vector< std::string >& filesnames );  
+    
+  /**
+   * @brief Creates a copy from the given input file name.
+   *
+   * @param inputFileName The input full file name.
+   * @param outputFileName The output full file name.
+   * @return true if OK, false if not.
+   */
+  TL_DLL bool TeCopyFile( const std::string& inputFileName,
+    const std::string& outputFileName );   
+    
+  /**
+   * @brief Compare two files.
+   *
+   * @param inputFileName1 The input full file 1 name.
+   * @param inputFileName2 The input full file 2 name.
+   * @return true if the two files are identical, false if not.
+   */
+  TL_DLL bool TeCompareFiles( const std::string& inputFileName1,
+    const std::string& inputFileName2 );      
+    
+  /**
+   * @brief Creates a copy from the given input text file name
+   * replacing all ocurrences of
+   *
+   * @param inputFileName The input full file name.
+   * @param inputFileName The output full file name.
+   * @param oldSubString The sub-string to be replaced from the input file.
+   * @param newSubString The new sub-string.
+   * @return true if OK, false if not.
+   */
+  TL_DLL bool TeReplaceTextFileSubString( const std::string& inputFileName,
+    const std::string& outputFileName, const std::string& oldSubString,
+    const std::string& newSubString );    
+    
+  /**
+   * @brief Creates a hash number from an input string.
+   * @details This algorithm was created for sdbm (a public-domain 
+   * reimplementation of ndbm) database library. It was found to do well in 
+   * scrambling bits, causing better distribution of the keys and fewer 
+   * splits. It also happens to be a good general hashing function with 
+   * good distribution. the actual function is 
+   * hash(i) = hash(i - 1) * 65599 + str[i]
+   * @param inputStringFileName The input full file name.
+   * @param inputStringSize Input string size.
+   * @return The generated hash value.
+   */
+  TL_DLL unsigned long int TeCreateHashFromString( 
+    unsigned char const* inputString,
+    const unsigned int& inputStringSize );      
+
+
+/** @} */ 
+/** @} */ 
+  
+   /**
+   * @brief Popule vectors with especial chars with accentuation and without 
+   *
+   * @param vectorIn Vector with accentuation.
+   * @param vectorOut Vector without accentuation.
+   * @return void
+   */
+  TL_DLL void TeGetEspecialCharsFixVector(std::vector<std::string> & especialIn, std::vector<std::string> & especialOut);
+
+   /**
+   * @brief Popule vectors with upper chars with accentuation and without 
+   *
+   * @param vectorIn Vector with accentuation.
+   * @param vectorOut Vector without accentuation.
+   * @return void
+   */
+  TL_DLL void TeGetAccentuatedUpperVector(std::vector<std::string> & upperIn, std::vector<std::string> & upperOut);
+
+   /**
+   * @brief Popule vectors with lower chars with accentuation and without 
+   *
+   * @param vectorIn Vector with accentuation.
+   * @param vectorOut Vector without accentuation.
+   * @return void
+   */
+  TL_DLL void TeGetAccentuatedLowerVector(std::vector<std::string> & lowerIn, std::vector<std::string> & lowerOut);
+
+   /**
+   * @brief Checks if the given box at the given projection is inside the LatLong's representation limits
+   *
+   * @param box The box to be verified
+   * @param boxProjection The projection of the box.
+   * @return TRUE if the box is consisnt, FALSE otherwise.
+   */
+  TL_DLL bool TeCheckBoxConsistency(const TeBox& box, TeProjection* boxProjection);
+
+#endif
+
+
diff --git a/src/terralib/kernel/TeVectorRemap.cpp b/src/terralib/kernel/TeVectorRemap.cpp
old mode 100755
new mode 100644
index e725e65..847d582
--- a/src/terralib/kernel/TeVectorRemap.cpp
+++ b/src/terralib/kernel/TeVectorRemap.cpp
@@ -1,156 +1,156 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32 
-#pragma warning ( disable: 4786 ) 
-#endif
-
-#include "TeVectorRemap.h"
-
-TeBox TeRemapBox ( TeBox& box, TeProjection* projFrom, TeProjection* projTo)
-{
-	if (projFrom == 0 || projTo == 0)
-		return box;
-
-	if (*projFrom == *projTo)
-		return box;
-
-	if(projFrom->name() == "NoProjection" || projTo->name() == "NoProjection")
-		return box;
-
-	projFrom->setDestinationProjection(projTo);
-
-	TeCoord2D	pll = box.lowerLeft (),
-				pur = box.upperRight (),
-				pul (pll.x(),pur.y()),
-				plr (pur.x(),pll.y());
-
-// Evaluate coordinates of box corners in Lat/Long
-
-	pll = projFrom->PC2LL (pll);
-	pur = projFrom->PC2LL (pur);
-	pul = projFrom->PC2LL (pul);
-	plr = projFrom->PC2LL (plr);
-
-// Evaluate the minimum box that includes all four corners
-
-	pll.x(std::min(pll.x(),pul.x()));
-	pll.y(std::min(pll.y(),plr.y()));
-	plr.x(std::max(plr.x(),pur.x()));
-	plr.y(std::min(pll.y(),plr.y()));
-	pur.x(std::max(pur.x(),plr.x()));
-	pur.y(std::max(pul.y(),pur.y()));
-	pul.x(std::min(pll.x(),pul.x()));
-	pul.y(std::max(pul.y(),pur.y()));
-
-
-// Bring coordinates of box corners to target projection
-
-	pll = projTo->LL2PC (pll);
-	pur = projTo->LL2PC (pur);
-	pul = projTo->LL2PC (pul);
-	plr = projTo->LL2PC (plr);
-
-// Evaluate the minimum box that includes all four corners
-
-	return TeBox (	std::min(pll.x(),pul.x()),
-					std::min(pll.y(),plr.y()),
-					std::max(pur.x(),plr.x()),
-					std::max(pul.y(),pur.y()));
-}
-
-void
-TeVectorRemap(TeCoord2D& c1, TeProjection* p1, TeCoord2D& c2, TeProjection* p2)
-{
-	p1->setDestinationProjection(p2);
-	TeCoord2D ll = p1->PC2LL(c1);
-	c2 = p2->LL2PC(ll);
-}
-
-void 
-TeVectorRemap(TeText& t1, TeProjection* p1, TeText& t2, TeProjection* p2)
-{
-	p1->setDestinationProjection(p2);
-	t2 = t1;
-	TeCoord2D nl = p1->PC2LL(t1.location());
-	TeCoord2D p =  p2->LL2PC(nl);
-	t2.setLocation(p);
-}
-
-void TeVectorRemap(TeCell& c1, TeProjection* p1, TeCell& c2, TeProjection* p2)
-{	
-	c2 = c1;
-	TeBox nb = TeRemapBox(c1.box(),p1,p2);
-	c2.setBox(nb);
-}
-
-TeBox TeRemapBoxPC2Geodetic (const TeBox& box, TeProjection* proj)
-{
-	if (proj == 0)
-		return box;
-
-	proj->setDestinationProjection(0);
-
-	TeCoord2D	pll = box.lowerLeft (),
-				pur = box.upperRight (),
-				pul (pll.x(),pur.y()),
-				plr (pur.x(),pll.y());
-
-	pll = proj->PC2LL (pll);
-	pur = proj->PC2LL (pur);
-	pul = proj->PC2LL (pul);
-	plr = proj->PC2LL (plr);
-
-// Evaluate the minimum box that includes all four corners
-
-	return TeBox (	std::min(pll.x(),pul.x()),
-					std::min(pll.y(),plr.y()),
-					std::max(pur.x(),plr.x()),
-					std::max(pul.y(),pur.y()));
-}
-
-TeBox TeRemapBoxGeodetic2PC (const TeBox& box, TeProjection* proj)
-{
-	if (proj == 0)
-		return box;
-
-	proj->setDestinationProjection(0);
-
-	TeCoord2D	pll = box.lowerLeft (),
-				pur = box.upperRight (),
-				pul (pll.x(),pur.y()),
-				plr (pur.x(),pll.y());
-
-	pll = proj->LL2PC (pll);
-	pur = proj->LL2PC (pur);
-	pul = proj->LL2PC (pul);
-	plr = proj->LL2PC (plr);
-
-// Evaluate the minimum box that includes all four corners
-
-	return TeBox (	std::min(pll.x(),pul.x()),
-					std::min(pll.y(),plr.y()),
-					std::max(pur.x(),plr.x()),
-					std::max(pul.y(),pur.y()));
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32 
+#pragma warning ( disable: 4786 ) 
+#endif
+
+#include "TeVectorRemap.h"
+
+TeBox TeRemapBox (const TeBox& box, TeProjection* projFrom, TeProjection* projTo)
+{
+	if (projFrom == 0 || projTo == 0)
+		return box;
+
+	if (*projFrom == *projTo)
+		return box;
+
+	if(projFrom->name() == "NoProjection" || projTo->name() == "NoProjection")
+		return box;
+
+	projFrom->setDestinationProjection(projTo);
+
+	TeCoord2D	pll = box.lowerLeft (),
+				pur = box.upperRight (),
+				pul (pll.x(),pur.y()),
+				plr (pur.x(),pll.y());
+
+// Evaluate coordinates of box corners in Lat/Long
+
+	pll = projFrom->PC2LL (pll);
+	pur = projFrom->PC2LL (pur);
+	pul = projFrom->PC2LL (pul);
+	plr = projFrom->PC2LL (plr);
+
+// Evaluate the minimum box that includes all four corners
+
+	pll.x(std::min(pll.x(),pul.x()));
+	pll.y(std::min(pll.y(),plr.y()));
+	plr.x(std::max(plr.x(),pur.x()));
+	plr.y(std::min(pll.y(),plr.y()));
+	pur.x(std::max(pur.x(),plr.x()));
+	pur.y(std::max(pul.y(),pur.y()));
+	pul.x(std::min(pll.x(),pul.x()));
+	pul.y(std::max(pul.y(),pur.y()));
+
+
+// Bring coordinates of box corners to target projection
+
+	pll = projTo->LL2PC (pll);
+	pur = projTo->LL2PC (pur);
+	pul = projTo->LL2PC (pul);
+	plr = projTo->LL2PC (plr);
+
+// Evaluate the minimum box that includes all four corners
+
+	return TeBox (	std::min(pll.x(),pul.x()),
+					std::min(pll.y(),plr.y()),
+					std::max(pur.x(),plr.x()),
+					std::max(pul.y(),pur.y()));
+}
+
+void
+TeVectorRemap(TeCoord2D& c1, TeProjection* p1, TeCoord2D& c2, TeProjection* p2)
+{
+	p1->setDestinationProjection(p2);
+	TeCoord2D ll = p1->PC2LL(c1);
+	c2 = p2->LL2PC(ll);
+}
+
+void 
+TeVectorRemap(TeText& t1, TeProjection* p1, TeText& t2, TeProjection* p2)
+{
+	p1->setDestinationProjection(p2);
+	t2 = t1;
+	TeCoord2D nl = p1->PC2LL(t1.location());
+	TeCoord2D p =  p2->LL2PC(nl);
+	t2.setLocation(p);
+}
+
+void TeVectorRemap(TeCell& c1, TeProjection* p1, TeCell& c2, TeProjection* p2)
+{	
+	c2 = c1;
+	TeBox nb = TeRemapBox(c1.box(),p1,p2);
+	c2.setBox(nb);
+}
+
+TeBox TeRemapBoxPC2Geodetic (const TeBox& box, TeProjection* proj)
+{
+	if (proj == 0)
+		return box;
+
+	proj->setDestinationProjection(0);
+
+	TeCoord2D	pll = box.lowerLeft (),
+				pur = box.upperRight (),
+				pul (pll.x(),pur.y()),
+				plr (pur.x(),pll.y());
+
+	pll = proj->PC2LL (pll);
+	pur = proj->PC2LL (pur);
+	pul = proj->PC2LL (pul);
+	plr = proj->PC2LL (plr);
+
+// Evaluate the minimum box that includes all four corners
+
+	return TeBox (	std::min(pll.x(),pul.x()),
+					std::min(pll.y(),plr.y()),
+					std::max(pur.x(),plr.x()),
+					std::max(pul.y(),pur.y()));
+}
+
+TeBox TeRemapBoxGeodetic2PC (const TeBox& box, TeProjection* proj)
+{
+	if (proj == 0)
+		return box;
+
+	proj->setDestinationProjection(0);
+
+	TeCoord2D	pll = box.lowerLeft (),
+				pur = box.upperRight (),
+				pul (pll.x(),pur.y()),
+				plr (pur.x(),pll.y());
+
+	pll = proj->LL2PC (pll);
+	pur = proj->LL2PC (pur);
+	pul = proj->LL2PC (pul);
+	plr = proj->LL2PC (plr);
+
+// Evaluate the minimum box that includes all four corners
+
+	return TeBox (	std::min(pll.x(),pul.x()),
+					std::min(pll.y(),plr.y()),
+					std::max(pur.x(),plr.x()),
+					std::max(pul.y(),pur.y()));
+}
+
diff --git a/src/terralib/kernel/TeVectorRemap.h b/src/terralib/kernel/TeVectorRemap.h
old mode 100755
new mode 100644
index 52a8e60..f35e24e
--- a/src/terralib/kernel/TeVectorRemap.h
+++ b/src/terralib/kernel/TeVectorRemap.h
@@ -1,86 +1,86 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeVectorRemap.h
-    \brief This file contains functions to remap vector structures
-*/
-#ifndef  __TERRALIB_INTERNAL_VECTORREMAP_H
-#define  __TERRALIB_INTERNAL_VECTORREMAP_H
-
-#include "TeProjection.h"
-#include "TeGeometry.h"
-
-//! Remaps a geometry. Templated by the type of geometry.
-/*
-	\param g1 the input geometry
-	\param p1 the initial projection
-	\param g2 to receive the remapped geometry
-	\param p1 the destination projection
-*/
-template<typename G>
-void TeVectorRemap (G& g1, TeProjection* p1, G& g2, TeProjection* p2)
-{
-	int nItens = g1.size();
-	for (int i=0; i<nItens; i++)
-	{
-		typename G::value_type e1 = g1[i];
-		typename G::value_type e2;
-		TeVectorRemap(e1,p1,e2,p2);
-		g2.add(e2);
-	}
-}
-
-//! Especialized version to remap coordinates
-TL_DLL void TeVectorRemap(TeCoord2D& pt1, TeProjection* p1, TeCoord2D& pt2, TeProjection* p2);
-
-//! Especialized version to remap cells
-TL_DLL void TeVectorRemap(TeCell& c1, TeProjection* p1, TeCell& c2, TeProjection* p2);
-
-//! Especialized version to remap texts
-TL_DLL void TeVectorRemap(TeText& t1, TeProjection* p1, TeText& t2, TeProjection* p2);
-
-//! Remaps a box from one projection to another
-/*
-	\param box the input box
-	\param projFrom the initial projection
-	\param projTo the destination projection
-	\returns the remmaped box
-*/
-TL_DLL TeBox TeRemapBox (TeBox& box, TeProjection* projFrom, TeProjection* projTo);
-
-//! Remaps a box from plane coordinate to geodetic coordinate
-/*
-	\param box the input box
-	\param proj the data projection
-	\returns the remmaped box
-*/
-TL_DLL TeBox TeRemapBoxPC2Geodetic (const TeBox& box, TeProjection* proj);
-
-//! Remaps a box from geodetic coordinate to plane coordinate
-/*
-	\param box the input box
-	\param proj the data projection
-	\returns the remmaped box
-*/
-TL_DLL TeBox TeRemapBoxGeodetic2PC (const TeBox& box, TeProjection* proj);
-
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeVectorRemap.h
+    \brief This file contains functions to remap vector structures
+*/
+#ifndef  __TERRALIB_INTERNAL_VECTORREMAP_H
+#define  __TERRALIB_INTERNAL_VECTORREMAP_H
+
+#include "TeProjection.h"
+#include "TeGeometry.h"
+
+//! Remaps a geometry. Templated by the type of geometry.
+/*
+	\param g1 the input geometry
+	\param p1 the initial projection
+	\param g2 to receive the remapped geometry
+	\param p1 the destination projection
+*/
+template<typename G>
+void TeVectorRemap (G& g1, TeProjection* p1, G& g2, TeProjection* p2)
+{
+	int nItens = g1.size();
+	for (int i=0; i<nItens; i++)
+	{
+		typename G::value_type e1 = g1[i];
+		typename G::value_type e2;
+		TeVectorRemap(e1,p1,e2,p2);
+		g2.add(e2);
+	}
+}
+
+//! Especialized version to remap coordinates
+TL_DLL void TeVectorRemap(TeCoord2D& pt1, TeProjection* p1, TeCoord2D& pt2, TeProjection* p2);
+
+//! Especialized version to remap cells
+TL_DLL void TeVectorRemap(TeCell& c1, TeProjection* p1, TeCell& c2, TeProjection* p2);
+
+//! Especialized version to remap texts
+TL_DLL void TeVectorRemap(TeText& t1, TeProjection* p1, TeText& t2, TeProjection* p2);
+
+//! Remaps a box from one projection to another
+/*
+	\param box the input box
+	\param projFrom the initial projection
+	\param projTo the destination projection
+	\returns the remmaped box
+*/
+TL_DLL TeBox TeRemapBox (const TeBox& box, TeProjection* projFrom, TeProjection* projTo);
+
+//! Remaps a box from plane coordinate to geodetic coordinate
+/*
+	\param box the input box
+	\param proj the data projection
+	\returns the remmaped box
+*/
+TL_DLL TeBox TeRemapBoxPC2Geodetic (const TeBox& box, TeProjection* proj);
+
+//! Remaps a box from geodetic coordinate to plane coordinate
+/*
+	\param box the input box
+	\param proj the data projection
+	\returns the remmaped box
+*/
+TL_DLL TeBox TeRemapBoxGeodetic2PC (const TeBox& box, TeProjection* proj);
+
+#endif
diff --git a/src/terralib/kernel/TeVersion.h b/src/terralib/kernel/TeVersion.h
old mode 100755
new mode 100644
index e0a763e..6df9215
--- a/src/terralib/kernel/TeVersion.h
+++ b/src/terralib/kernel/TeVersion.h
@@ -1,37 +1,37 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeVersion.h
-    \brief This file contains a macro to define the version of TerraLib
-*/
-#ifndef  __TERRALIB_INTERNAL_VERSION_H
-#define  __TERRALIB_INTERNAL_VERSION_H
-
-/**
-This macro changes whenever a new version of TerraLib is released.
-Stable versions are named only by numbers (ex. 3.1.1, 3.1.2).
-Whenever the suffix "_dev" is appended do the name of the version
-it means the non-stable development version after the numbered version.
-
-*/
-#define TERRALIB_VERSION "3.3.1"
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeVersion.h
+    \brief This file contains a macro to define the version of TerraLib
+*/
+#ifndef  __TERRALIB_INTERNAL_VERSION_H
+#define  __TERRALIB_INTERNAL_VERSION_H
+
+/**
+This macro changes whenever a new version of TerraLib is released.
+Stable versions are named only by numbers (ex. 3.1.1, 3.1.2).
+Whenever the suffix "_dev" is appended do the name of the version
+it means the non-stable development version after the numbered version.
+
+*/
+#define TERRALIB_VERSION "3.6.1_dev"
+#endif
diff --git a/src/terralib/kernel/TeView.h b/src/terralib/kernel/TeView.h
old mode 100755
new mode 100644
index 4f1ce61..16403cf
--- a/src/terralib/kernel/TeView.h
+++ b/src/terralib/kernel/TeView.h
@@ -1,233 +1,233 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeView.h
-    \brief This file provides TerraLib's definition of a View
-*/
-#ifndef  __TERRALIB_INTERNAL_VIEW_H
-#define  __TERRALIB_INTERNAL_VIEW_H
-
-#include "TeLayer.h"
-#include "TeTheme.h"
-#include "TeProjection.h"
-#include "TeViewNode.h"
-#include <algorithm>
-
-using namespace std;
-
-//! A class to deal with views in TerraLib
-/*!
-	A View is a structure that aggregated themes to be visualized or
-	processed in its own projection. Views may belong to a particular user.
-	\sa TeTheme TeViewNode
-*/
-class TL_DLL TeView
-{
-public:
-	//! Constructor
-    TeView( const string& name="", const string& user="", int id=0)
-		: id_(id), name_(name), user_(user), proj_(0), is_visible_(true), connectedId_(0), currentTheme_(-1)
-	{}
-
-	//! Destructor
-	virtual ~TeView () 
-	{
-		if(proj_)
-			delete proj_;
-	}
-
-	//! Returns view unique id
-	virtual int	id () { return id_; }
-
-	//! Sets view unique id
-	virtual void id (int id)
-	{
-		id_ = id;	// update view id
-		for (unsigned int th=0;th<viewTree_.size();th++)	//update its themes
-			viewTree_.retrieve(th)->view (id_);
-		viewTree_.view(id); 
-	}
-
-	//! Returns the view name
-	virtual string	name () { return name_; }
-
-	//! Sets the view name
-	virtual void name (const string& s) { name_ = s; }
-
-	//! Returns the view user name
-	virtual string	user () { return user_; }
-
-	//! Sets the view user name
-	virtual void user (const string& i) { user_ = i; }
-
-	//! Returns the view projection
-	virtual TeProjection* projection () { return proj_; }
-
-	//! Sets the view projection
-	virtual void projection (TeProjection* p) { proj_ = p; }
-
-	//! Returns TRUE if view is visible
-	virtual bool isVisible () { return is_visible_; }
-
-	//! Sets whether view is visible
-	virtual void isVisible (bool v) { is_visible_ = v; }
-
-	//! Returns the current box
-	virtual TeBox& getCurrentBox () { return currentBox_; }
-
-	//! Sets the current box
-	virtual void setCurrentBox (const TeBox& b) { currentBox_ = b; }
-
-	//! Returns the current theme id
-	virtual int getCurrentTheme () { return currentTheme_; }
-
-	//! Sets the current theme id
-	virtual void setCurrentTheme (const int& id) { currentTheme_ = id; }
-	
-	//! Returns the view tree where view belongs
-	virtual TeViewTree* root () { return &viewTree_; }
-
-	//! Adds a view node to the view tree
-	virtual void add( TeViewNode* node )
-	{
-		node->view (id_);
-		viewTree_.add ( node );
-	}
-
-	//! Removes a view node through its name from the view tree
-	virtual TeViewNode* remove(string name)
-	{
-		return viewTree_.remove(name);
-	}
-
-	//! Removes a view node through its identifier from the view tree
-	virtual TeViewNode* remove (int id)
-	{
-		return viewTree_.removeID(id);
-	}
-
-	//! Moves a node up
-	virtual void moveUp (TeViewNode* node)
-	{
-		viewTree_.moveUp(node);
-	}
-
-	//! Moves a node down
-	virtual void moveDown(TeViewNode* node)
-	{
-		viewTree_.moveDown(node);
-	}
-
-	//! Returns a node identified by its position
-	virtual TeViewNode* get(int i)
-	{
-		return viewTree_.retrieve(i);
-	}
-
-	//! Returns a node identified by its name and version
-	virtual TeTheme* get(string themeName)
-	{
-		TeTheme *ret = 0;
-		for (unsigned int th = 0;th < viewTree_.size();th++)
-		{
-			TeViewNode *node = viewTree_.retrieve(th);
-			if (node->type() == TeTHEME)
-			{
-				TeTheme *tmp = (TeTheme*)node;
-				if (tmp->name() == themeName)
-				{
-					ret = tmp;
-					break;
-				}
-			}
-		}
-		return ret;
-	}
-	
-	//! Sort the themes in the view
-	virtual void sort() 
-	{ viewTree_.sort(); }
-
-	//! Swap the order of two themes
-	virtual void swap( unsigned int i, unsigned int j)
-	{
-		viewTree_.swap(i,j);
-	}
-
-	//! Sets the themes visibility 
-	virtual void visibility( int vis )
-	{
-		viewTree_.visibility( vis );
-	}
-
-	//! Returns the themes visibility 
-	virtual int visibility()
-	{
-		return viewTree_.visibility();
-	}
-
-	//! Returns the number of themes in the view
-	virtual unsigned int size()
-		{ return viewTree_.size() ; }
-
-	//! Returns the vector of themes of the view sorted according to their priorities
-	virtual vector<TeViewNode*>& themes()
-	{ return viewTree_.nodes();}
-
-	//! Sets the id of the connected view
-	virtual void connectedId(int id) {connectedId_ = id;}
-
-	//! Returns the id of the connected view
-	virtual int connectedId() {return connectedId_;}
-
-	/*! Returns the boundary box of the view themes
-		\param onlyVisible If is true, returns the boundary box of visible themes, otherwise returns the boundary box of all themes
-	*/
-	virtual TeBox box( bool onlyVisible )
-	{ 
-		TeBox retval;
-		if ( root() ) 
-			retval = root()->box(onlyVisible,proj_); 
-		return retval;		
-	}; 
-
-private:
-	int				id_;	// view id
-	string			name_;	// view name
-	string			user_;	// user id
-	TeProjection*   proj_;
-	bool			is_visible_;
-
-	TeViewTree		viewTree_;
-	int				connectedId_; // connected view
-
-	TeBox			currentBox_; // current box
-	int				currentTheme_; // current theme id
-};
-
-//! A map from identifiers to pointers to views
-typedef map<int,TeView*> TeViewMap;
-
-#endif
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeView.h
+    \brief This file provides TerraLib's definition of a View
+*/
+#ifndef  __TERRALIB_INTERNAL_VIEW_H
+#define  __TERRALIB_INTERNAL_VIEW_H
+
+#include "TeLayer.h"
+#include "TeTheme.h"
+#include "TeProjection.h"
+#include "TeViewNode.h"
+#include <algorithm>
+
+using namespace std;
+
+//! A class to deal with views in TerraLib
+/*!
+	A View is a structure that aggregated themes to be visualized or
+	processed in its own projection. Views may belong to a particular user.
+	\sa TeTheme TeViewNode
+*/
+class TL_DLL TeView
+{
+public:
+	//! Constructor
+    TeView( const string& name="", const string& user="", int id=0)
+		: id_(id), name_(name), user_(user), proj_(0), is_visible_(true), connectedId_(0), currentTheme_(-1)
+	{}
+
+	//! Destructor
+	virtual ~TeView () 
+	{
+		if(proj_)
+			delete proj_;
+	}
+
+	//! Returns view unique id
+	virtual int	id () { return id_; }
+
+	//! Sets view unique id
+	virtual void id (int id)
+	{
+		id_ = id;	// update view id
+		for (unsigned int th=0;th<viewTree_.size();th++)	//update its themes
+			viewTree_.retrieve(th)->view (id_);
+		viewTree_.view(id); 
+	}
+
+	//! Returns the view name
+	virtual string	name () { return name_; }
+
+	//! Sets the view name
+	virtual void name (const string& s) { name_ = s; }
+
+	//! Returns the view user name
+	virtual string	user () { return user_; }
+
+	//! Sets the view user name
+	virtual void user (const string& i) { user_ = i; }
+
+	//! Returns the view projection
+	virtual TeProjection* projection () { return proj_; }
+
+	//! Sets the view projection
+	virtual void projection (TeProjection* p) { proj_ = p; }
+
+	//! Returns TRUE if view is visible
+	virtual bool isVisible () { return is_visible_; }
+
+	//! Sets whether view is visible
+	virtual void isVisible (bool v) { is_visible_ = v; }
+
+	//! Returns the current box
+	virtual TeBox& getCurrentBox () { return currentBox_; }
+
+	//! Sets the current box
+	virtual void setCurrentBox (const TeBox& b) { currentBox_ = b; }
+
+	//! Returns the current theme id
+	virtual int getCurrentTheme () { return currentTheme_; }
+
+	//! Sets the current theme id
+	virtual void setCurrentTheme (const int& id) { currentTheme_ = id; }
+	
+	//! Returns the view tree where view belongs
+	virtual TeViewTree* root () { return &viewTree_; }
+
+	//! Adds a view node to the view tree
+	virtual void add( TeViewNode* node, const bool& updatePriority = true)
+	{
+		node->view (id_);
+		viewTree_.add ( node, updatePriority );
+	}
+
+	//! Removes a view node through its name from the view tree
+	virtual TeViewNode* remove(string name)
+	{
+		return viewTree_.remove(name);
+	}
+
+	//! Removes a view node through its identifier from the view tree
+	virtual TeViewNode* remove (int id)
+	{
+		return viewTree_.removeID(id);
+	}
+
+	//! Moves a node up
+	virtual void moveUp (TeViewNode* node)
+	{
+		viewTree_.moveUp(node);
+	}
+
+	//! Moves a node down
+	virtual void moveDown(TeViewNode* node)
+	{
+		viewTree_.moveDown(node);
+	}
+
+	//! Returns a node identified by its position
+	virtual TeViewNode* get(int i)
+	{
+		return viewTree_.retrieve(i);
+	}
+
+	//! Returns a node identified by its name and version
+	virtual TeTheme* get(string themeName)
+	{
+		TeTheme *ret = 0;
+		for (unsigned int th = 0;th < viewTree_.size();th++)
+		{
+			TeViewNode *node = viewTree_.retrieve(th);
+			if (node->type() == TeTHEME)
+			{
+				TeTheme *tmp = (TeTheme*)node;
+				if (tmp->name() == themeName)
+				{
+					ret = tmp;
+					break;
+				}
+			}
+		}
+		return ret;
+	}
+	
+	//! Sort the themes in the view
+	virtual void sort() 
+	{ viewTree_.sort(); }
+
+	//! Swap the order of two themes
+	virtual void swap( unsigned int i, unsigned int j)
+	{
+		viewTree_.swap(i,j);
+	}
+
+	//! Sets the themes visibility 
+	virtual void visibility( int vis )
+	{
+		viewTree_.visibility( vis );
+	}
+
+	//! Returns the themes visibility 
+	virtual int visibility()
+	{
+		return viewTree_.visibility();
+	}
+
+	//! Returns the number of themes in the view
+	virtual unsigned int size()
+		{ return viewTree_.size() ; }
+
+	//! Returns the vector of themes of the view sorted according to their priorities
+	virtual vector<TeViewNode*>& themes()
+	{ return viewTree_.nodes();}
+
+	//! Sets the id of the connected view
+	virtual void connectedId(int id) {connectedId_ = id;}
+
+	//! Returns the id of the connected view
+	virtual int connectedId() {return connectedId_;}
+
+	/*! Returns the boundary box of the view themes
+		\param onlyVisible If is true, returns the boundary box of visible themes, otherwise returns the boundary box of all themes
+	*/
+	virtual TeBox box( bool onlyVisible )
+	{ 
+		TeBox retval;
+		if ( root() ) 
+			retval = root()->box(onlyVisible,proj_); 
+		return retval;		
+	}; 
+
+private:
+	int				id_;	// view id
+	string			name_;	// view name
+	string			user_;	// user id
+	TeProjection*   proj_;
+	bool			is_visible_;
+
+	TeViewTree		viewTree_;
+	int				connectedId_; // connected view
+
+	TeBox			currentBox_; // current box
+	int				currentTheme_; // current theme id
+};
+
+//! A map from identifiers to pointers to views
+typedef map<int,TeView*> TeViewMap;
+
+#endif
+
+
+
diff --git a/src/terralib/kernel/TeViewNode.cpp b/src/terralib/kernel/TeViewNode.cpp
old mode 100755
new mode 100644
index 1349ab8..e47f8e8
--- a/src/terralib/kernel/TeViewNode.cpp
+++ b/src/terralib/kernel/TeViewNode.cpp
@@ -1,362 +1,372 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include "TeViewNode.h"
-#include "TeTheme.h"
-#include "TeLayer.h"
-#include "TeProjection.h"
-
-TeBox 
-TeViewTree::box(bool onlyVisible, TeProjection* destProjection)
-{
-	TeBox retval;
-	if ( destProjection  == 0 )
-		return retval;
-
-	for (vector<TeViewNode*>::iterator child = nodes_.begin(); child != nodes_.end(); ++child)
-	{
-		TeViewNode* pt = (*child);
-		if( pt->type() == TeTREE )
-			updateBox( retval, ( (TeViewTree*)pt)->box( onlyVisible, destProjection ) );
-		else
-		{
-			
-			TeAbstractTheme* theme = (TeAbstractTheme*)(pt);
-
-			if( onlyVisible && !( theme->visibility() & 0x00000001 ) )
-				continue;
-
-			TeBox themeBox = theme->getThemeBox(); 
-			if(!themeBox.isValid()) 
-				continue;			
-			theme->getThemeProjection()->setDestinationProjection(destProjection);
-			TeCoord2D ll = themeBox.lowerLeft();
-			TeCoord2D ur = themeBox.upperRight();
-			TeBox convertedBox(theme->getThemeProjection()->PC2LL(ll),
-							theme->getThemeProjection()->PC2LL(ur));
-			ll = convertedBox.lowerLeft();
-			ur = convertedBox.upperRight();
-			convertedBox = TeBox(destProjection->LL2PC(ll),destProjection->LL2PC(ur));
-			updateBox(retval, convertedBox);
-		}
-	}
-	return retval;
-}
-
-bool 
-TeViewTree::assertsPriorities()
-{
-	bool updated = false;
-	for ( unsigned int i=0; i<nodes_.size(); ++i)
-	{
-		TeViewNode* node = nodes_[i];
-		if ( (node != NULL) && ( node->priority() != (int)i ) )
-		{
-			node->priority(i);
-			updated = true;
-		}
-		if ( node->type() == TeTREE )
-		{
-			TeViewTree* tree = (TeViewTree*)node;
-			if ( ( tree != NULL ) 
-				&& ( tree->assertsPriorities()== true) 
-				&& ( updated == false ) )
-				updated = true;
-		}	
-	}
-	return updated;
-}
-
-TeViewTree::~TeViewTree ()
-{
-	// For all my children, delete them
-    vector<TeViewNode*>::iterator child = nodes_.begin();
-    while( child != nodes_.end() ) 
-	{
-		// Create a temporary pointer to store the child's
-		// address
-		TeViewNode* pt = (*child);
-
-        // Remove the child from the list
-		nodes_.erase(child);
-		child = nodes_.begin();
-
-		// Ok, now the child's parent points to NULL and we can
-		// safely call the child's destructor
-		delete pt;
-		pt = 0;
-	}
-}
-
-void 
-TeViewTree::visibility(int vis)
-{
-	for (vector<TeViewNode*>::iterator child = nodes_.begin();
-			child != nodes_.end(); ++child)
-	{
-		TeViewNode* pt = (*child);
-		pt->visibility( vis );
-	}
-}
-
-int TeViewTree::visibility()
-{
-	for (vector<TeViewNode*>::iterator child = nodes_.begin();
-			child != nodes_.end(); ++child)
-	{
-		TeViewNode* pt = (*child);
-		if ( pt->visibility() == 1 )
-			return 1;
-	}
-	return 0;
-}
-
-void 
-TeViewTree::swap(unsigned int i, unsigned int j)
-{
-	if (i==j || i>=nodes_.size() || j>=nodes_.size())
-		return;
-	TeViewNode* temp = nodes_[i];
-	nodes_[i] = nodes_[j];
-	nodes_[j] = temp;
-	nodes_[i]->priority (i);
-	nodes_[j]->priority (j);
-}
-
-
-void
-TeViewTree::moveUp(TeViewNode* node)
-{
-	for (unsigned int i=0 ; i<nodes_.size() ; i++)
-	{
-		if (node == nodes_[i])
-		{
-			swap (i, i-1);
-			return;
-		}
-	}
-}
-
-void 
-TeViewTree::moveDown(TeViewNode* node)
-{
-	if (!node)
-		return;
-
-	for (unsigned int i=0 ; i<nodes_.size() ; ++i)
-	{
-		if (node == nodes_[i])
-		{
-			swap (i, i+1);
-			return;
-		}
-	}
-}
-
-void TeViewTree::add(TeViewNode* node)
-{
-	node->setParent ( this ); // I am the father
-	node->priority(static_cast<int>(nodes_.size()));
-	nodes_.push_back (node);
-}
-
-//!	Removes a node identified by its name
-TeViewNode* 
-TeViewTree::remove (const string& name)
-{
-	vector<TeViewNode*>::iterator child = nodes_.begin();
-	while ( child != nodes_.end() )
-	{
-		TeViewNode* pt = (*child);
-		if (pt->name() == name)
-		{
-			nodes_.erase(child);
-			return pt;
-		}
-		if(pt->type() == TeTREE)
-		{
-			TeViewNode* result = pt->remove(name);
-			if(result) return result;
-		}
-		++child;
-	}
-	return 0;
-}
-
-//!	Removes a node through its identifier
-TeViewNode* 
-TeViewTree::removeID (int id) 
-{ 
-	for (vector<TeViewNode*>::iterator child = nodes_.begin();
-			child != nodes_.end(); ++child)
-	{
-		TeViewNode* pt = (*child);
-		if(pt->id() == id)
-		{
-			nodes_.erase(child);
-			return pt;
-		}
-		if(pt->type() == TeTREE)
-		{
-			TeViewNode* result = pt->removeID(id);
-			if(result) return result;
-		}
-	}
-	return 0;
-}
-
-void 
-TeViewTree::draw ()
-{				  
-	vector<TeViewNode*>::iterator child = nodes_.begin();
-	while ( child != nodes_.end() )
-	{
-		TeViewNode* pt = (*child);
-		pt->draw();
-		++child;
-	}
-}
-
-void 
-TeViewTree::sort()
-{
-	int i, j;
-	for (i = 0; i < (int)size() - 1; ++i)
-	{
-		for (j = i+1; j < (int)size(); ++j)
-		{
-			if (nodes_[i]->priority() > nodes_[j]->priority())
-			{
-				TeViewNode* temp = nodes_[i];
-				nodes_[i] = nodes_[j];
-				nodes_[j] = temp;
-			}
-		}
-	}
-}
-
-void 
-TeViewTree::clear()
-{
-	// For all my children, delete them
-    vector<TeViewNode*>::iterator child = nodes_.begin();
-    while( child != nodes_.end() ) 
-	{
-		// Create a temporary pointer to store the child's
-		// address
-		TeViewNode* pt = (*child);
-
-        // Remove the child from the list
-		nodes_.erase(child);
-
-		if( pt->type() == TeTREE )
-			((TeViewTree*)pt)->clear();
-		
-		child = nodes_.begin();
-	}
-}
-
-int 
-TeViewTree::moveTop (TeViewNode* node)
-{
-	TeViewNode* parent = node->parent();
-	if(parent == NULL) 
-		return -1;
-	if(parent->type() != TeTREE) 
-		return -1;
-	TeViewTree* tree = (TeViewTree*)parent;
-	int i = 0;
-	while(tree->retrieve(0) != node && tree->retrieve(0) != NULL)
-	{
-		tree->moveUp(node);
-		++i;
-	}
-	return i;
-}
-
-int 
-TeViewTree::moveBottom(TeViewNode* node)
-{
-	TeViewNode* parent = node->parent();
-	if (parent == 0 || parent->type() != TeTREE)
-		return -1;
-	TeViewTree* tree = (TeViewTree*)parent;
-	int i = 0;
-	while(tree->nodes().back() != node && tree->nodes().back() != 0)
-	{
-		tree->moveDown(node);
-		++i;
-	}
-	return i;
-}
-
-
-void 
-TeViewTree::insertFront(TeViewNode* node)
-{
-	node->setParent( this ); // I am the father
-	nodes_.insert(nodes_.begin(), node);
-	int ind = 0;
-	for (vector<TeViewNode*>::iterator child = nodes_.begin();
-			child != nodes_.end(); ++child)
-	{
-		TeViewNode* pt = (*child);
-		if ( pt )
-			pt->priority( ind++ ); 
-	}
-}
-
-TeViewNode* 
-TeViewTree::find (int id) 
-{ 
-	for (vector<TeViewNode*>::iterator child = nodes_.begin();
-			child != nodes_.end(); ++child)
-	{
-		TeViewNode* pt = (*child);
-		if(pt->id() == id)
-			return pt;
-		if(pt->type() == TeTREE)
-		{
-			TeViewNode* result = ((TeViewTree*)(pt))->find(id);
-			if(result) 
-				return result;
-		}
-	}
-	return 0;
-}
-TeViewNode* 
-TeViewTree::find( std::string name, bool caseS) 
-{ 
-	for (vector<TeViewNode*>::iterator child = nodes_.begin();
-			child != nodes_.end(); ++child)
-	{
-		TeViewNode* pt = (*child);
-		if( TeStringCompare( pt->name(), name, caseS ) )
-			return pt;
-		if( pt->type() == TeTREE )
-		{
-			TeViewNode* result = ((TeViewTree*)(pt))->find( name, caseS );
-			if (result) 
-				return result;
-		}
-	}
-	return 0;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include "TeViewNode.h"
+#include "TeTheme.h"
+#include "TeLayer.h"
+#include "TeProjection.h"
+
+TeViewNodeParams::~TeViewNodeParams()
+{
+}
+
+TeBox 
+TeViewTree::box(bool onlyVisible, TeProjection* destProjection)
+{
+	TeBox retval;
+	if ( destProjection  == 0 )
+		return retval;
+
+	for (vector<TeViewNode*>::iterator child = nodes_.begin(); child != nodes_.end(); ++child)
+	{
+		TeViewNode* pt = (*child);
+		if( pt->type() == TeTREE )
+			updateBox( retval, ( (TeViewTree*)pt)->box( onlyVisible, destProjection ) );
+		else
+		{
+			
+			TeAbstractTheme* theme = (TeAbstractTheme*)(pt);
+
+			if( (onlyVisible && !( theme->visibility() & 0x00000001 )) || !theme->isAvailable())
+				continue;
+
+			TeBox themeBox = theme->getThemeBox(); 
+			if(!themeBox.isValid()) 
+				continue;
+			if(!(*theme->getThemeProjection() == *destProjection))
+			{
+				theme->getThemeProjection()->setDestinationProjection(destProjection);
+				TeCoord2D ll = themeBox.lowerLeft();
+				TeCoord2D ur = themeBox.upperRight();
+				TeBox convertedBox(theme->getThemeProjection()->PC2LL(ll),
+								theme->getThemeProjection()->PC2LL(ur));
+				ll = convertedBox.lowerLeft();
+				ur = convertedBox.upperRight();
+				themeBox = TeBox(destProjection->LL2PC(ll),destProjection->LL2PC(ur));
+			}
+			updateBox(retval, themeBox);
+		}
+	}
+	return retval;
+}
+
+bool 
+TeViewTree::assertsPriorities()
+{
+	bool updated = false;
+	for ( unsigned int i=0; i<nodes_.size(); ++i)
+	{
+		TeViewNode* node = nodes_[i];
+		if ( (node != NULL) && ( node->priority() != (int)i ) )
+		{
+			node->priority(i);
+			updated = true;
+		}
+		if ( node->type() == TeTREE )
+		{
+			TeViewTree* tree = (TeViewTree*)node;
+			if ( ( tree != NULL ) 
+				&& ( tree->assertsPriorities()== true) 
+				&& ( updated == false ) )
+				updated = true;
+		}	
+	}
+	return updated;
+}
+
+TeViewTree::~TeViewTree ()
+{
+	// For all my children, delete them
+    vector<TeViewNode*>::iterator child = nodes_.begin();
+    while( child != nodes_.end() ) 
+	{
+		// Create a temporary pointer to store the child's
+		// address
+		TeViewNode* pt = (*child);
+
+        // Remove the child from the list
+		nodes_.erase(child);
+		child = nodes_.begin();
+
+		// Ok, now the child's parent points to NULL and we can
+		// safely call the child's destructor
+		delete pt;
+		pt = 0;
+	}
+}
+
+void 
+TeViewTree::visibility(int vis)
+{
+	for (vector<TeViewNode*>::iterator child = nodes_.begin();
+			child != nodes_.end(); ++child)
+	{
+		TeViewNode* pt = (*child);
+		pt->visibility( vis );
+	}
+}
+
+int TeViewTree::visibility()
+{
+	for (vector<TeViewNode*>::iterator child = nodes_.begin();
+			child != nodes_.end(); ++child)
+	{
+		TeViewNode* pt = (*child);
+		if ( pt->visibility() == 1 )
+			return 1;
+	}
+	return 0;
+}
+
+void 
+TeViewTree::swap(unsigned int i, unsigned int j)
+{
+	if (i==j || i>=nodes_.size() || j>=nodes_.size())
+		return;
+	TeViewNode* temp = nodes_[i];
+	nodes_[i] = nodes_[j];
+	nodes_[j] = temp;
+	nodes_[i]->priority (i);
+	nodes_[j]->priority (j);
+}
+
+
+void
+TeViewTree::moveUp(TeViewNode* node)
+{
+	for (unsigned int i=0 ; i<nodes_.size() ; i++)
+	{
+		if (node == nodes_[i])
+		{
+			swap (i, i-1);
+			return;
+		}
+	}
+}
+
+void 
+TeViewTree::moveDown(TeViewNode* node)
+{
+	if (!node)
+		return;
+
+	for (unsigned int i=0 ; i<nodes_.size() ; ++i)
+	{
+		if (node == nodes_[i])
+		{
+			swap (i, i+1);
+			return;
+		}
+	}
+}
+
+void TeViewTree::add(TeViewNode* node, const bool& updatePriority)
+{
+	node->setParent ( this ); // I am the father
+
+	if(updatePriority)
+		node->priority(static_cast<int>(nodes_.size()));
+
+	nodes_.push_back (node);
+}
+
+//!	Removes a node identified by its name
+TeViewNode* 
+TeViewTree::remove (const string& name)
+{
+	vector<TeViewNode*>::iterator child = nodes_.begin();
+	while ( child != nodes_.end() )
+	{
+		TeViewNode* pt = (*child);
+		if (pt->name() == name)
+		{
+			nodes_.erase(child);
+			return pt;
+		}
+		if(pt->type() == TeTREE)
+		{
+			TeViewNode* result = pt->remove(name);
+			if(result) return result;
+		}
+		++child;
+	}
+	return 0;
+}
+
+//!	Removes a node through its identifier
+TeViewNode* 
+TeViewTree::removeID (int id) 
+{ 
+	for (vector<TeViewNode*>::iterator child = nodes_.begin();
+			child != nodes_.end(); ++child)
+	{
+		TeViewNode* pt = (*child);
+		if(pt->id() == id)
+		{
+			nodes_.erase(child);
+			return pt;
+		}
+		if(pt->type() == TeTREE)
+		{
+			TeViewNode* result = pt->removeID(id);
+			if(result) return result;
+		}
+	}
+	return 0;
+}
+
+void 
+TeViewTree::draw ()
+{				  
+	vector<TeViewNode*>::iterator child = nodes_.begin();
+	while ( child != nodes_.end() )
+	{
+		TeViewNode* pt = (*child);
+		pt->draw();
+		++child;
+	}
+}
+
+void 
+TeViewTree::sort()
+{
+	int i, j;
+	for (i = 0; i < (int)size() - 1; ++i)
+	{
+		for (j = i+1; j < (int)size(); ++j)
+		{
+			if (nodes_[i]->priority() > nodes_[j]->priority())
+			{
+				TeViewNode* temp = nodes_[i];
+				nodes_[i] = nodes_[j];
+				nodes_[j] = temp;
+			}
+		}
+	}
+}
+
+void 
+TeViewTree::clear()
+{
+	// For all my children, delete them
+    vector<TeViewNode*>::iterator child = nodes_.begin();
+    while( child != nodes_.end() ) 
+	{
+		// Create a temporary pointer to store the child's
+		// address
+		TeViewNode* pt = (*child);
+
+        // Remove the child from the list
+		nodes_.erase(child);
+
+		if( pt->type() == TeTREE )
+			((TeViewTree*)pt)->clear();
+		
+		child = nodes_.begin();
+	}
+}
+
+int 
+TeViewTree::moveTop (TeViewNode* node)
+{
+	TeViewNode* parent = node->parent();
+	if(parent == NULL) 
+		return -1;
+	if(parent->type() != TeTREE) 
+		return -1;
+	TeViewTree* tree = (TeViewTree*)parent;
+	int i = 0;
+	while(tree->retrieve(0) != node && tree->retrieve(0) != NULL)
+	{
+		tree->moveUp(node);
+		++i;
+	}
+	return i;
+}
+
+int 
+TeViewTree::moveBottom(TeViewNode* node)
+{
+	TeViewNode* parent = node->parent();
+	if (parent == 0 || parent->type() != TeTREE)
+		return -1;
+	TeViewTree* tree = (TeViewTree*)parent;
+	int i = 0;
+	while(tree->nodes().back() != node && tree->nodes().back() != 0)
+	{
+		tree->moveDown(node);
+		++i;
+	}
+	return i;
+}
+
+
+void 
+TeViewTree::insertFront(TeViewNode* node)
+{
+	node->setParent( this ); // I am the father
+	nodes_.insert(nodes_.begin(), node);
+	int ind = 0;
+	for (vector<TeViewNode*>::iterator child = nodes_.begin();
+			child != nodes_.end(); ++child)
+	{
+		TeViewNode* pt = (*child);
+		if ( pt )
+			pt->priority( ind++ ); 
+	}
+}
+
+TeViewNode* 
+TeViewTree::find (int id) 
+{ 
+	for (vector<TeViewNode*>::iterator child = nodes_.begin();
+			child != nodes_.end(); ++child)
+	{
+		TeViewNode* pt = (*child);
+		if(pt->id() == id)
+			return pt;
+		if(pt->type() == TeTREE)
+		{
+			TeViewNode* result = ((TeViewTree*)(pt))->find(id);
+			if(result) 
+				return result;
+		}
+	}
+	return 0;
+}
+TeViewNode* 
+TeViewTree::find( std::string name, bool caseS) 
+{ 
+	for (vector<TeViewNode*>::iterator child = nodes_.begin();
+			child != nodes_.end(); ++child)
+	{
+		TeViewNode* pt = (*child);
+		if( TeStringCompare( pt->name(), name, caseS ) )
+			return pt;
+		if( pt->type() == TeTREE )
+		{
+			TeViewNode* result = ((TeViewTree*)(pt))->find( name, caseS );
+			if (result) 
+				return result;
+		}
+	}
+	return 0;
+}
diff --git a/src/terralib/kernel/TeViewNode.h b/src/terralib/kernel/TeViewNode.h
old mode 100755
new mode 100644
index 4ee7c1b..a679498
--- a/src/terralib/kernel/TeViewNode.h
+++ b/src/terralib/kernel/TeViewNode.h
@@ -1,404 +1,411 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeViewNode.h
-    \brief This file provides TerraLib's tree structure of views
-*/
-#ifndef  __TERRALIB_INTERNAL_VIEWNODE_H
-#define  __TERRALIB_INTERNAL_VIEWNODE_H
-
-#define THEME_GROUP
-
-#include "TeDefines.h"
-#include "TeBox.h"
-#include "TeAbstractFactory.h"
-
-#include <iostream>
-#include <string>
-#include <vector>
-using namespace std;
-
-class TeProjection;
-class TeViewNode;
-
-//! Type of view node
-enum TeViewNodeType
-{ TeTHEME=0, TeTREE=1, TeEXTERNALTHEME=2, TeFILETHEME=3 }; 
-
-
-//!  A class to represent the view node parameters 
-/*!  
-	 This class contains the main view node parameters and it is used 
-	 by the factory responsible for creating view node objects. 
-	 
-	\sa
-     TeViewNode
-*/
-class TL_DLL TeViewNodeParams
-{
-public:
-	//! Constructor
-	TeViewNodeParams(const string& name="", const int& id=0, const int& viewId=0, 
-		const int nodeType=0, const int& priority=0, TeViewNode* parentNode=0,
-		const int parentId=0):
-		name_(name),
-		id_(id),
-		viewId_(viewId),
-		nodeType_(nodeType),
-		priority_(priority),
-		myParent_(parentNode),
-		myParentId_(parentId)
-	{ }
-
-	//! Copy constructor
-	TeViewNodeParams(const TeViewNodeParams& params)
-	{
-		name_ = params.name_;
-        id_ = params.id_;
-		viewId_ = params.viewId_; 
-        nodeType_ = params.nodeType_; 
-		priority_ = params.priority_;
-		myParent_ = params.myParent_;
-		myParentId_ = params.myParentId_; 
-	}
-
-	//! Returns the view node type 
-	int getProductId() { return nodeType_; }
-
-    //! Node name
-	string			name_;		
-	//! Node identity
-	int				id_;
-	//! View identity that contains this node 
-	int				viewId_;	
-	//! Node type
-	int				nodeType_;
-	//! Precedence when stored in a view
-	int				priority_;
-	//! Pointer to its parent 
-	TeViewNode* 	myParent_;  
-	//! Node parent id
-	int 			myParentId_;
-};
-
-
-//!  A class to deal with nodes of a view 
-/*!  
-	 In Terralib, a view is composed of nodes. This is a base class 
-	 used to specialize view node types. 
-
-	\sa
-     TeView TeViewNodeParams
-*/
-class TL_DLL TeViewNode
-{
-public:
-	//! Empty constructor
-    TeViewNode(const string& name="", TeViewNode* parent=0, const int& view=0, const int& id=0, const int& nodeType=0): 
-	  viewNodeParams_(name, id, view, nodeType, 0, parent)
-	{ }
-	
-	//! Constructor
-    TeViewNode(const TeViewNodeParams& viewNodeParams): 
-	  viewNodeParams_(viewNodeParams)
-	{ }
-
-	//! Destructor
-	virtual ~TeViewNode()
-	{}
-
-	//! Inserts a new child in the tree hierachy. Fails if the object is a leaf
-	virtual void add (TeViewNode*) {}
-
-    //!	Remove an existing child identified by its id from the tree hierarchy
-    /*!	
-		Fails if the object is a leaf
-	    Should be used in conjunction with a delete 
-	*/	
-	virtual TeViewNode* removeID (int /* id */) { return 0; }
- 
-   //!	Remove an existing child identified by its name from the tree hierarchy
-    /*!	
-		Fails if the object is a leaf
-	    Should be used in conjunction with a delete 
-	*/	
-	virtual TeViewNode* remove (const string& /*name*/) { return 0; }
-
-	//! Retrieve a node identified by its identifier from the tree structure
-	virtual TeViewNode* retrieve (int)  { return 0; }
-
-	//! Returns a pointer to a parent node
-	virtual TeViewNode* parent()
-	{ return viewNodeParams_.myParent_; }
-
-	//! Returns the identifier of a node parent
-	virtual int parentId()
-	{
-		if (viewNodeParams_.myParent_)
-			return viewNodeParams_.myParent_->id(); 
-		else
-			return viewNodeParams_.myParentId_;
-	}
-
-	//! Sets the identification of the parent node
-	virtual void parentId(int i) 
-	{
-		if (viewNodeParams_.myParent_)
-			viewNodeParams_.myParent_->id(i);
-		viewNodeParams_.myParentId_ = i;
-	}
-
-	//! Sets the parent of node
-	virtual void setParent ( TeViewNode* node )
-	{ 
-		viewNodeParams_.myParent_ = node; 
-		viewNodeParams_.myParentId_ = (viewNodeParams_.myParent_)? viewNodeParams_.myParent_->id():0;
-	}
-
-	//! Returns the identification of a node
-	virtual int		id () { return viewNodeParams_.id_; }
-
-	//! Sets the identification of a node
-	virtual void	id (int i){ viewNodeParams_.id_ = i; }
-
-	//! Returns the name of a node
-	virtual string	name () { return viewNodeParams_.name_; }
-	//! Sets the name of a node
-	virtual void	name (const string& s) { viewNodeParams_.name_ = s; }
-
-	//! Returns the priority of a node
-	virtual int		priority() { return viewNodeParams_.priority_; }
-	//! Sets the priority of a node
-	virtual void	priority(int i) { viewNodeParams_.priority_ = i; }
-
-	//! Sets the view identification of a node
-	virtual void	view (int viewId) { viewNodeParams_.viewId_ = viewId; }
-	//! Returns the view identification of a node
-	virtual int		view () { return viewNodeParams_.viewId_ ; }
-
-	//! Returns the node type
-	virtual int type() { return viewNodeParams_.nodeType_; };
-	//! Sets the node type
-	virtual void type(const int& t) { viewNodeParams_.nodeType_ = t; }
-
-	//! Moves a node up in the tree structure
-	virtual void moveUp ()
-	{
-		if (viewNodeParams_.myParent_)
-			viewNodeParams_.myParent_->moveUp (this);
-	}
-	
-	//! Moves a node down in the tree structure
-	virtual void moveDown ()
-	{
-		if (viewNodeParams_.myParent_)
-			viewNodeParams_.myParent_->moveDown (this);
-	}
-
-	//! Swaps nodes 
-	virtual void swap ( unsigned int, unsigned int ) {}
-
-	//! Sets the nodes visibility 
-	virtual void visibility ( int ){}; 
-
-	//! Returns the nodes visibility 
-	virtual int visibility(){ return 1; };
-
-	//! Draws a node
-	virtual void draw() {}
-
-	//! Sorts the node
-	virtual void sort() {}
-	
-	static TeViewNode*	DefaultObject()
-	{	return 0; }
-
-	virtual int getProductId() const
-	{	return viewNodeParams_.nodeType_; }
-
-	virtual TeViewNodeParams& viewNodeParams()
-	{	return viewNodeParams_; }
-
-	virtual void viewNodeParams(TeViewNodeParams& p)
-	{	viewNodeParams_ = p; }
-
-
-protected:
-
-	virtual void	moveUp (TeViewNode*) {}
-	virtual void	moveDown (TeViewNode*) {}
-
-	//! Node parameters
-	TeViewNodeParams	viewNodeParams_;
-};
-
-
-//!  This class implements a virtual factory to create view node types. 
-/*!  
-	 This class is a base virtual factory used to specialize 
-	 other factories that create particular node view types. 
-
-	\sa
-     TeAbstractFactory TeViewNode TeViewNodeParams
-*/
-class TL_DLL TeViewNodeFactory : public TeAbstractFactory<TeViewNode,TeViewNodeParams, int>
-{
-public:
-	//! Constructor based on the view node type
-	TeViewNodeFactory(const int& nodeType) : 
-	  TeAbstractFactory<TeViewNode,TeViewNodeParams, int>(nodeType)
-	{ }
-};
-
-
-//! A class to deal with branchs in a view tree structure  
-class TL_DLL TeViewTree: public TeViewNode
-{
-public:
-
-	//! Constructor
-	TeViewTree(const string& name=""): TeViewNode(name, 0, 0, 0, (int)TeTREE)
-	{ }
-
-	//! Constructor
-    TeViewTree(const TeViewNodeParams& params): 
-	  TeViewNode(params)
-	{ }
-
-
-	//! Destructor
-	virtual ~TeViewTree ();
-
-	//! Sets the nodes visibility 
-	virtual void visibility (int vis);
-
-	//! Returns the nodes visibility 
-	virtual int visibility ();
-
-	//! Swap nodes
-	virtual void swap (unsigned int i, unsigned int j);
-
-	//! Moves a node up in the tree structure
-	virtual void moveUp (TeViewNode* node);
-
-	//! Moves a node down in the tree structure
-	virtual void moveDown (TeViewNode* node);
-
-	//! Adds a node to the structure
-	virtual void add (TeViewNode* node);
-
-    //!	Removes a node identified by its name
-	virtual TeViewNode* remove (const string& name);
-
-    //!	Removes a node through its identifier
-	virtual TeViewNode* removeID (int id) ;
-
-    //!	Retrieves a node through its index
-	virtual TeViewNode* retrieve (unsigned int i) 
-	{ return nodes_[i]; }
-
-	//! Draw a node
-	virtual void draw ();
-
-	//! Returns the size of the structure
-	unsigned int size()
-    { return nodes_.size(); }
-
-	//! Returns the vector of View nodes
-	vector<TeViewNode*>& nodes()
-	{ return nodes_; }
-
-	//! Sort the vector of nodes according to their priorities
-	void sort();
-
-	//! Unlinks the nodes from the view tree
-	virtual void clear();
-	
-	/*! Move the given node to the top of it's tree.
-	  \param node to be moved
-	  \return the number of positions the node has been moved
-	*/
-	virtual int moveTop (TeViewNode* node);
-
-	/*!	Move the given node to the bottom of it's tree.
-	  \param node to be moved
-	  \return the number of positions the node has been moved
-	*/
-	int moveBottom(TeViewNode* node);
-
-	/*!
-	Inserts the given node to at the begin of the view tree.
-	\param node node to be added
-	*/
-	virtual void insertFront(TeViewNode* node);
-
-	/*! Look at a View Tree for a node with the given id.
-		\param id Id of the node to be found
-	*/
-	virtual TeViewNode* find (int id);
-
-	/*! Look at a View Tree for a node with the given name.
-		\param name name of the node to be found
-		\param caseS(optional) true if the given name is case sensitive
-	*/
-	virtual TeViewNode* find( std::string name, bool caseS = false );
-
-	/*! Returns the boundary box of the tree view themes
-	\param projection The returned box coordinates will be in the given projection 
-	*/
-	virtual TeBox box(bool onlyVisible, TeProjection* projection );
-
-	/*!	Asserts the nodes priorities by the positions.
-		Returns true if any priority was updated, otherwise returns false.
-	*/
-	virtual bool assertsPriorities();
-
-private:
-	vector<TeViewNode*> nodes_;
-};
-
-
-//!  This class implements a factory to create view tree objects. 
-/*!  
-	 This class is a factory that create view nodes 
-	 of the type TeTREE, that is, view tree objects.
-
-	\sa
-     TeViewNodeFactory TeViewNodeParams TeViewTree  
-*/
-class TL_DLL TeViewTreeFactory : public TeViewNodeFactory
-{
-public:
-	//! Constructor 
-	TeViewTreeFactory() : TeViewNodeFactory((int)TeTREE)
-	{}
-
-	//! Created view tree objects 
-	TeViewTree* build(TeViewNodeParams* params)
-	{	
-		TeViewNodeParams auxParams = *params;
-		return new TeViewTree(auxParams);	
-	}
-};
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeViewNode.h
+    \brief This file provides TerraLib's tree structure of views
+*/
+#ifndef  __TERRALIB_INTERNAL_VIEWNODE_H
+#define  __TERRALIB_INTERNAL_VIEWNODE_H
+
+#define THEME_GROUP
+
+#include "TeDefines.h"
+#include "TeBox.h"
+#include "TeAbstractFactory.h"
+
+#include <iostream>
+#include <string>
+#include <vector>
+using namespace std;
+
+class TeProjection;
+class TeViewNode;
+
+//! Type of view node
+enum TeViewNodeType
+{ TeTHEME=0, TeTREE=1, TeEXTERNALTHEME=2, TeFILETHEME=3 }; 
+
+
+//!  A class to represent the view node parameters 
+/*!  
+	 This class contains the main view node parameters and it is used 
+	 by the factory responsible for creating view node objects. 
+	 
+	\sa
+     TeViewNode
+*/
+class TL_DLL TeViewNodeParams
+{
+public:
+	//! Constructor
+	TeViewNodeParams(const string& name="", const int& id=0, const int& viewId=0, 
+		const int nodeType=0, const int& priority=0, TeViewNode* parentNode=0,
+		const int parentId=0):
+		name_(name),
+		id_(id),
+		viewId_(viewId),
+		nodeType_(nodeType),
+		priority_(priority),
+		myParent_(parentNode),
+		myParentId_(parentId)
+	{ }
+
+	//! Copy constructor
+	TeViewNodeParams(const TeViewNodeParams& params)
+	{
+		name_ = params.name_;
+        id_ = params.id_;
+		viewId_ = params.viewId_; 
+        nodeType_ = params.nodeType_; 
+		priority_ = params.priority_;
+		myParent_ = params.myParent_;
+		myParentId_ = params.myParentId_; 
+	}
+
+	virtual ~TeViewNodeParams();
+	//! Returns the view node type 
+	int getProductId() { return nodeType_; }
+
+    //! Node name
+	string			name_;		
+	//! Node identity
+	int				id_;
+	//! View identity that contains this node 
+	int				viewId_;	
+	//! Node type
+	int				nodeType_;
+	//! Precedence when stored in a view
+	int				priority_;
+	//! Pointer to its parent 
+	TeViewNode* 	myParent_;  
+	//! Node parent id
+	int 			myParentId_;
+};
+
+
+//!  A class to deal with nodes of a view 
+/*!  
+	 In Terralib, a view is composed of nodes. This is a base class 
+	 used to specialize view node types. 
+
+	\sa
+     TeView TeViewNodeParams
+*/
+class TL_DLL TeViewNode
+{
+public:
+	//! Empty constructor
+    TeViewNode(const string& name="", TeViewNode* parent=0, const int& view=0, const int& id=0, const int& nodeType=0): 
+	  viewNodeParams_(name, id, view, nodeType, 0, parent)
+	{ }
+	
+	//! Constructor
+    TeViewNode(const TeViewNodeParams& viewNodeParams): 
+	  viewNodeParams_(viewNodeParams)
+	{ }
+
+	//! Destructor
+	virtual ~TeViewNode()
+	{}
+
+	//! Makes a copy of the object
+	virtual TeViewNode* clone() 
+	{
+		return new TeViewNode(viewNodeParams_);
+	};
+
+	//! Inserts a new child in the tree hierachy. Fails if the object is a leaf
+	virtual void add (TeViewNode*, const bool& /*updatePriority*/ = true) {}
+
+    //!	Remove an existing child identified by its id from the tree hierarchy
+    /*!	
+		Fails if the object is a leaf
+	    Should be used in conjunction with a delete 
+	*/	
+	virtual TeViewNode* removeID (int /* id */) { return 0; }
+ 
+   //!	Remove an existing child identified by its name from the tree hierarchy
+    /*!	
+		Fails if the object is a leaf
+	    Should be used in conjunction with a delete 
+	*/	
+	virtual TeViewNode* remove (const string& /*name*/) { return 0; }
+
+	//! Retrieve a node identified by its identifier from the tree structure
+	virtual TeViewNode* retrieve (int)  { return 0; }
+
+	//! Returns a pointer to a parent node
+	virtual TeViewNode* parent()
+	{ return viewNodeParams_.myParent_; }
+
+	//! Returns the identifier of a node parent
+	virtual int parentId()
+	{
+		if (viewNodeParams_.myParent_)
+			return viewNodeParams_.myParent_->id(); 
+		else
+			return viewNodeParams_.myParentId_;
+	}
+
+	//! Sets the identification of the parent node
+	virtual void parentId(int i) 
+	{
+		if (viewNodeParams_.myParent_)
+			viewNodeParams_.myParent_->id(i);
+		viewNodeParams_.myParentId_ = i;
+	}
+
+	//! Sets the parent of node
+	virtual void setParent ( TeViewNode* node )
+	{ 
+		viewNodeParams_.myParent_ = node; 
+		viewNodeParams_.myParentId_ = (viewNodeParams_.myParent_)? viewNodeParams_.myParent_->id():0;
+	}
+
+	//! Returns the identification of a node
+	virtual int		id () { return viewNodeParams_.id_; }
+
+	//! Sets the identification of a node
+	virtual void	id (int i){ viewNodeParams_.id_ = i; }
+
+	//! Returns the name of a node
+	virtual string	name () { return viewNodeParams_.name_; }
+	//! Sets the name of a node
+	virtual void	name (const string& s) { viewNodeParams_.name_ = s; }
+
+	//! Returns the priority of a node
+	virtual int		priority() const { return viewNodeParams_.priority_; }
+	//! Sets the priority of a node
+	virtual void	priority(int i) { viewNodeParams_.priority_ = i; }
+
+	//! Sets the view identification of a node
+	virtual void	view (int viewId) { viewNodeParams_.viewId_ = viewId; }
+	//! Returns the view identification of a node
+	virtual int		view () { return viewNodeParams_.viewId_ ; }
+
+	//! Returns the node type
+	virtual int type() { return viewNodeParams_.nodeType_; };
+	//! Sets the node type
+	virtual void type(const int& t) { viewNodeParams_.nodeType_ = t; }
+
+	//! Moves a node up in the tree structure
+	virtual void moveUp ()
+	{
+		if (viewNodeParams_.myParent_)
+			viewNodeParams_.myParent_->moveUp (this);
+	}
+	
+	//! Moves a node down in the tree structure
+	virtual void moveDown ()
+	{
+		if (viewNodeParams_.myParent_)
+			viewNodeParams_.myParent_->moveDown (this);
+	}
+
+	//! Swaps nodes 
+	virtual void swap ( unsigned int, unsigned int ) {}
+
+	//! Sets the nodes visibility 
+	virtual void visibility ( int ){}; 
+
+	//! Returns the nodes visibility 
+	virtual int visibility(){ return 1; };
+
+	//! Draws a node
+	virtual void draw() {}
+
+	//! Sorts the node
+	virtual void sort() {}
+	
+	static TeViewNode*	DefaultObject()
+	{	return 0; }
+
+	virtual int getProductId() const
+	{	return viewNodeParams_.nodeType_; }
+
+	virtual TeViewNodeParams& viewNodeParams()
+	{	return viewNodeParams_; }
+
+	virtual void viewNodeParams(TeViewNodeParams& p)
+	{	viewNodeParams_ = p; }
+
+
+protected:
+
+	virtual void	moveUp (TeViewNode*) {}
+	virtual void	moveDown (TeViewNode*) {}
+
+	//! Node parameters
+	TeViewNodeParams	viewNodeParams_;
+};
+
+
+//!  This class implements a virtual factory to create view node types. 
+/*!  
+	 This class is a base virtual factory used to specialize 
+	 other factories that create particular node view types. 
+
+	\sa
+     TeAbstractFactory TeViewNode TeViewNodeParams
+*/
+class TL_DLL TeViewNodeFactory : public TeAbstractFactory<TeViewNode,TeViewNodeParams, int>
+{
+public:
+	//! Constructor based on the view node type
+	TeViewNodeFactory(const int& nodeType) : 
+	  TeAbstractFactory<TeViewNode,TeViewNodeParams, int>(nodeType)
+	{ }
+};
+
+
+//! A class to deal with branchs in a view tree structure  
+class TL_DLL TeViewTree: public TeViewNode
+{
+public:
+
+	//! Constructor
+	TeViewTree(const string& name=""): TeViewNode(name, 0, 0, 0, (int)TeTREE)
+	{ }
+
+	//! Constructor
+    TeViewTree(const TeViewNodeParams& params): 
+	  TeViewNode(params)
+	{ }
+
+
+	//! Destructor
+	virtual ~TeViewTree ();
+
+	//! Sets the nodes visibility 
+	virtual void visibility (int vis);
+
+	//! Returns the nodes visibility 
+	virtual int visibility ();
+
+	//! Swap nodes
+	virtual void swap (unsigned int i, unsigned int j);
+
+	//! Moves a node up in the tree structure
+	virtual void moveUp (TeViewNode* node);
+
+	//! Moves a node down in the tree structure
+	virtual void moveDown (TeViewNode* node);
+
+	//! Adds a node to the structure
+	virtual void add (TeViewNode* node, const bool& updatePriority = true);
+
+    //!	Removes a node identified by its name
+	virtual TeViewNode* remove (const string& name);
+
+    //!	Removes a node through its identifier
+	virtual TeViewNode* removeID (int id) ;
+
+    //!	Retrieves a node through its index
+	virtual TeViewNode* retrieve (unsigned int i) 
+	{ return nodes_[i]; }
+
+	//! Draw a node
+	virtual void draw ();
+
+	//! Returns the size of the structure
+	unsigned int size()
+    { return (unsigned int)nodes_.size(); }
+
+	//! Returns the vector of View nodes
+	vector<TeViewNode*>& nodes()
+	{ return nodes_; }
+
+	//! Sort the vector of nodes according to their priorities
+	void sort();
+
+	//! Unlinks the nodes from the view tree
+	virtual void clear();
+	
+	/*! Move the given node to the top of it's tree.
+	  \param node to be moved
+	  \return the number of positions the node has been moved
+	*/
+	virtual int moveTop (TeViewNode* node);
+
+	/*!	Move the given node to the bottom of it's tree.
+	  \param node to be moved
+	  \return the number of positions the node has been moved
+	*/
+	int moveBottom(TeViewNode* node);
+
+	/*!
+	Inserts the given node to at the begin of the view tree.
+	\param node node to be added
+	*/
+	virtual void insertFront(TeViewNode* node);
+
+	/*! Look at a View Tree for a node with the given id.
+		\param id Id of the node to be found
+	*/
+	virtual TeViewNode* find (int id);
+
+	/*! Look at a View Tree for a node with the given name.
+		\param name name of the node to be found
+		\param caseS(optional) true if the given name is case sensitive
+	*/
+	virtual TeViewNode* find( std::string name, bool caseS = false );
+
+	/*! Returns the boundary box of the tree view themes
+	\param projection The returned box coordinates will be in the given projection 
+	*/
+	virtual TeBox box(bool onlyVisible, TeProjection* projection );
+
+	/*!	Asserts the nodes priorities by the positions.
+		Returns true if any priority was updated, otherwise returns false.
+	*/
+	virtual bool assertsPriorities();
+
+private:
+	vector<TeViewNode*> nodes_;
+};
+
+
+//!  This class implements a factory to create view tree objects. 
+/*!  
+	 This class is a factory that create view nodes 
+	 of the type TeTREE, that is, view tree objects.
+
+	\sa
+     TeViewNodeFactory TeViewNodeParams TeViewTree  
+*/
+class TL_DLL TeViewTreeFactory : public TeViewNodeFactory
+{
+public:
+	//! Constructor 
+	TeViewTreeFactory() : TeViewNodeFactory((int)TeTREE)
+	{}
+
+	//! Created view tree objects 
+	TeViewTree* build(TeViewNodeParams* params)
+	{	
+		TeViewNodeParams auxParams = *params;
+		return new TeViewTree(auxParams);	
+	}
+};
+
+#endif
+
diff --git a/src/terralib/kernel/TeViewTreeIterator.cpp b/src/terralib/kernel/TeViewTreeIterator.cpp
old mode 100755
new mode 100644
index c2b30f5..f82719a
--- a/src/terralib/kernel/TeViewTreeIterator.cpp
+++ b/src/terralib/kernel/TeViewTreeIterator.cpp
@@ -1,140 +1,140 @@
-/*
-** ---------------------------------------------------------------
-** TeViewTreeIterator.cpp - 
-**
-*/
-
-/*
-** ---------------------------------------------------------------
-** Includes:
-*/
-
-#include "TeViewTreeIterator.h"
-
-
-/*
-** ---------------------------------------------------------------
-** Methods implementations:
-*/
-
-void TeViewTreeIterator::next()
-{
-  do
-  {
-    StackElem& elem = TravStack.top();
-    elem.ind++;
-
-    if(elem.ind >= (int)(elem.tree->size()))
-    {
-      if(TravStack.size() <= 1) break; // reached the end of the list
-
-      TravStack.pop();
-      continue;
-    }
-
-    TeViewNode* node = elem.tree->retrieve(elem.ind);
-//    if(node->type() == TeTHEME) break;   // reached a leaf
-    if(node->type() != TeTREE) break;
-
-    TravStack.push(StackElem((TeViewTree*)node, -1));
-    break;
-  }while(1);
-}
-
-
-void TeViewTreeRevIterator::next()
-{
-  do
-  {
-    StackElem& elem = TravStack.top();
-    elem.ind--;
-
-    if(elem.ind < 0)
-    {
-      if(TravStack.size() <= 1) break; // reached the end of the list
-
-      TravStack.pop();
-      continue;
-    }
-
-    TeViewNode* node = elem.tree->retrieve(elem.ind);
-//    if(node->type() == TeTHEME) break;   // reached a leaf
-    if(node->type() != TeTREE) break;  // reached a leaf
-
-    TravStack.push(StackElem((TeViewTree*)node));
-    break;
-  }while(1);
-}
-
-/*!
-  Move to the next leaf on the tree.
-*/
-void TeViewTreeIterator::nextLeaf()
-{
-  do
-  {
-    StackElem& elem = TravStack.top();
-    elem.ind++;
-
-    if(elem.ind >= (int)(elem.tree->size()))
-    {
-      if(TravStack.size() <= 1) break; // reached the end of the list
-
-      TravStack.pop();
-      continue;
-    }
-
-    TeViewNode* node = elem.tree->retrieve(elem.ind);
-    //if(node->type() == TeTHEME) break;   // reached a leaf
-    if(node->type() != TeTREE) break;   // reached a leaf
-
-    TravStack.push(StackElem((TeViewTree*)node, -1));
-
-  }while(1);
-}
-
-/*!
-  Move to the next leaf on the tree.
-*/
-void TeViewTreeRevIterator::nextLeaf()
-{
-  do
-  {
-    StackElem& elem = TravStack.top();
-    elem.ind--;
-
-    if(elem.ind < 0)
-    {
-      if(TravStack.size() <= 1) break; // reached the end of the list
-
-      TravStack.pop();
-      continue;
-    }
-
-    TeViewNode* node = elem.tree->retrieve(elem.ind);
-//    if(node->type() == TeTHEME) break;   // reached a leaf
-    if(node->type() != TeTREE) break;   // reached a leaf
-
-    TravStack.push(StackElem((TeViewTree*)node));
-
-  }while(1);
-}
-
-
-/*!
-  Move to the next node in the tree skipping the current
-  node children.
-*/
-void TeViewTreeIterator::skipChildren()
-{
-  StackElem& elem = TravStack.top();
-  if(elem.ind == -1) elem.ind = elem.tree->size();
-  next();
-}
-
-void TeViewTreeRevIterator::skipChildren()
-{
-  StackElem& elem = TravStack.top();
-  if(elem.ind == (int)(elem.tree->size())) elem.ind = -1;
-  next();
-}
+/*
+** ---------------------------------------------------------------
+** TeViewTreeIterator.cpp - 
+**
+*/
+
+/*
+** ---------------------------------------------------------------
+** Includes:
+*/
+
+#include "TeViewTreeIterator.h"
+
+
+/*
+** ---------------------------------------------------------------
+** Methods implementations:
+*/
+
+void TeViewTreeIterator::next()
+{
+  do
+  {
+    StackElem& elem = TravStack.top();
+    elem.ind++;
+
+    if(elem.ind >= (int)(elem.tree->size()))
+    {
+      if(TravStack.size() <= 1) break; // reached the end of the list
+
+      TravStack.pop();
+      continue;
+    }
+
+    TeViewNode* node = elem.tree->retrieve(elem.ind);
+//    if(node->type() == TeTHEME) break;   // reached a leaf
+    if(node->type() != TeTREE) break;
+
+    TravStack.push(StackElem((TeViewTree*)node, -1));
+    break;
+  }while(1);
+}
+
+
+void TeViewTreeRevIterator::next()
+{
+  do
+  {
+    StackElem& elem = TravStack.top();
+    elem.ind--;
+
+    if(elem.ind < 0)
+    {
+      if(TravStack.size() <= 1) break; // reached the end of the list
+
+      TravStack.pop();
+      continue;
+    }
+
+    TeViewNode* node = elem.tree->retrieve(elem.ind);
+//    if(node->type() == TeTHEME) break;   // reached a leaf
+    if(node->type() != TeTREE) break;  // reached a leaf
+
+    TravStack.push(StackElem((TeViewTree*)node));
+    break;
+  }while(1);
+}
+
+/*!
+  Move to the next leaf on the tree.
+*/
+void TeViewTreeIterator::nextLeaf()
+{
+  do
+  {
+    StackElem& elem = TravStack.top();
+    elem.ind++;
+
+    if(elem.ind >= (int)(elem.tree->size()))
+    {
+      if(TravStack.size() <= 1) break; // reached the end of the list
+
+      TravStack.pop();
+      continue;
+    }
+
+    TeViewNode* node = elem.tree->retrieve(elem.ind);
+    //if(node->type() == TeTHEME) break;   // reached a leaf
+    if(node->type() != TeTREE) break;   // reached a leaf
+
+    TravStack.push(StackElem((TeViewTree*)node, -1));
+
+  }while(1);
+}
+
+/*!
+  Move to the next leaf on the tree.
+*/
+void TeViewTreeRevIterator::nextLeaf()
+{
+  do
+  {
+    StackElem& elem = TravStack.top();
+    elem.ind--;
+
+    if(elem.ind < 0)
+    {
+      if(TravStack.size() <= 1) break; // reached the end of the list
+
+      TravStack.pop();
+      continue;
+    }
+
+    TeViewNode* node = elem.tree->retrieve(elem.ind);
+//    if(node->type() == TeTHEME) break;   // reached a leaf
+    if(node->type() != TeTREE) break;   // reached a leaf
+
+    TravStack.push(StackElem((TeViewTree*)node));
+
+  }while(1);
+}
+
+
+/*!
+  Move to the next node in the tree skipping the current
+  node children.
+*/
+void TeViewTreeIterator::skipChildren()
+{
+  StackElem& elem = TravStack.top();
+  if(elem.ind == -1) elem.ind = elem.tree->size();
+  next();
+}
+
+void TeViewTreeRevIterator::skipChildren()
+{
+  StackElem& elem = TravStack.top();
+  if(elem.ind == (int)(elem.tree->size())) elem.ind = -1;
+  next();
+}
diff --git a/src/terralib/kernel/TeViewTreeIterator.h b/src/terralib/kernel/TeViewTreeIterator.h
old mode 100755
new mode 100644
index c800ebf..a097b45
--- a/src/terralib/kernel/TeViewTreeIterator.h
+++ b/src/terralib/kernel/TeViewTreeIterator.h
@@ -1,193 +1,193 @@
-/* $Id: TeViewTreeIterator.h,v 1.3 2007/10/22 17:05:54 juan Exp $
-** ---------------------------------------------------------------
-** TeViewTreeIterator - 
-**
-*/
-
-#ifndef TEVIEWTREEITERATOR_H
-#define TEVIEWTREEITERATOR_H
-
-/*
-** ---------------------------------------------------------------
-** Includes:
-*/
-
-// TerraLib includes
-#include "TeException.h"
-#include "TeViewNode.h"
-
-// STL includes
-#include <vector>
-#include <stack>
-
-/*
-** ---------------------------------------------------------------
-** Defines:
-*/
-
-/* 
-  One stl module included by some TerraLib files define a macro named
-  next which conflicts whith the TeViewTreeInterator::next method. So
-  we choosed to undefine it.
-*/
-#undef next  
-
-
-/*
-** ---------------------------------------------------------------
-** Class definition:
-*/
-
-class TL_DLL TeViewTreeIterator
-{
-public:
-  TeViewTreeIterator(TeViewTree* root);
-
-  void first();
-  void firstLeaf();
-  void next();
-  void nextLeaf();
-  void skipChildren();  //!< move to the next node skipping the current node childs
-
-//  void Previous();
-
-  bool isDone();
-
-  TeViewNode* currentNode();
-  int currentDepth();  //!< Returns the depth of the current node. The root has depth is 0.
-
-protected:
-private:
-  struct StackElem{
-    StackElem(TeViewTree* tr, int i){ tree = tr; ind = i; }
-    TeViewTree* tree;
-    int ind;           //!< index of the current child in the tree
-  };
-
-  std::stack<StackElem> TravStack; //!< traversal stack
-};
-
-class TL_DLL TeViewTreeRevIterator
-{
-public:
-  TeViewTreeRevIterator(TeViewTree* root);
-
-  void first();
-  void firstLeaf();
-  void next();
-  void nextLeaf();
-  void skipChildren();  //!< move to the next node skipping the current node childs
-
-//  void Previous();
-
-  bool isDone();
-
-  TeViewNode* currentNode();
-  int currentDepth();  //!< Returns the depth of the current node. The root has depth is 0.
-
-protected:
-private:
-  struct StackElem{
-    StackElem(TeViewTree* tr, int i){ tree = tr; ind = i; }
-    StackElem(TeViewTree* tr){ tree = tr; ind = tr->size(); }
-    TeViewTree* tree;
-    int ind;           //!< index of the current child in the tree
-  };
-
-  std::stack<StackElem> TravStack; // traversal stack
-};
-
-
-/*
-** ---------------------------------------------------------------
-** Inline methods:
-*/
-
-inline TeViewTreeIterator::TeViewTreeIterator(TeViewTree* root)
-{
-  TravStack.push(StackElem(root, -1));
-}
-
-inline TeViewTreeRevIterator::TeViewTreeRevIterator(TeViewTree* root)
-{
-  TravStack.push(StackElem(root));
-}
-
-inline void TeViewTreeIterator::first()
-{
-  while(TravStack.size() > 1)
-    TravStack.pop();
-  TravStack.top().ind = -1;
-}
-
-inline void TeViewTreeRevIterator::first()
-{
-  while(TravStack.size() > 1)
-    TravStack.pop();
-  TravStack.top().ind = TravStack.top().tree->size();
-}
-
-inline void TeViewTreeIterator::firstLeaf()
-{
-  first();
-  nextLeaf();
-}
-
-inline void TeViewTreeRevIterator::firstLeaf()
-{
-  first();
-  nextLeaf();
-}
-
-inline bool TeViewTreeIterator::isDone()
-{
-  if(TravStack.size() > 1) return false;
-  
-  StackElem& elem = TravStack.top();
-  if(elem.ind < (int)(elem.tree->size())) return false;
-  
-  return true;
-}
-
-inline bool TeViewTreeRevIterator::isDone()
-{
-  if(TravStack.size() > 1) return false;
-  
-  StackElem& elem = TravStack.top();
-  if(elem.ind >= 0) return false;
-  
-  return true;
-}
-
-inline TeViewNode* TeViewTreeIterator::currentNode()
-{
-  StackElem& elem = TravStack.top();
-  if(elem.ind == -1) return elem.tree;
-
-  return elem.tree->retrieve(elem.ind);
-}
-
-inline TeViewNode* TeViewTreeRevIterator::currentNode()
-{
-  StackElem& elem = TravStack.top();
-  if(elem.ind == (int)(elem.tree->size())) return elem.tree;
-
-  return elem.tree->retrieve(elem.ind);  
-}
-
-inline int TeViewTreeIterator::currentDepth()
-{
-  return TravStack.size() - 1;
-}
-
-inline int TeViewTreeRevIterator::currentDepth()
-{
-  return TravStack.size() - 1;
-}
-
-
-#ifdef te__next_back__
-#define next te__next_back__
-#undef te__next_back__  // some stl module defines a macro named next that is generating conflics with 
-#endif
-#endif
+/* $Id: TeViewTreeIterator.h 6480 2007-10-22 17:05:59Z juan $
+** ---------------------------------------------------------------
+** TeViewTreeIterator - 
+**
+*/
+
+#ifndef TEVIEWTREEITERATOR_H
+#define TEVIEWTREEITERATOR_H
+
+/*
+** ---------------------------------------------------------------
+** Includes:
+*/
+
+// TerraLib includes
+#include "TeException.h"
+#include "TeViewNode.h"
+
+// STL includes
+#include <vector>
+#include <stack>
+
+/*
+** ---------------------------------------------------------------
+** Defines:
+*/
+
+/* 
+  One stl module included by some TerraLib files define a macro named
+  next which conflicts whith the TeViewTreeInterator::next method. So
+  we choosed to undefine it.
+*/
+#undef next  
+
+
+/*
+** ---------------------------------------------------------------
+** Class definition:
+*/
+
+class TL_DLL TeViewTreeIterator
+{
+public:
+  TeViewTreeIterator(TeViewTree* root);
+
+  void first();
+  void firstLeaf();
+  void next();
+  void nextLeaf();
+  void skipChildren();  //!< move to the next node skipping the current node childs
+
+//  void Previous();
+
+  bool isDone();
+
+  TeViewNode* currentNode();
+  int currentDepth();  //!< Returns the depth of the current node. The root has depth is 0.
+
+protected:
+private:
+  struct StackElem{
+    StackElem(TeViewTree* tr, int i){ tree = tr; ind = i; }
+    TeViewTree* tree;
+    int ind;           //!< index of the current child in the tree
+  };
+
+  std::stack<StackElem> TravStack; //!< traversal stack
+};
+
+class TL_DLL TeViewTreeRevIterator
+{
+public:
+  TeViewTreeRevIterator(TeViewTree* root);
+
+  void first();
+  void firstLeaf();
+  void next();
+  void nextLeaf();
+  void skipChildren();  //!< move to the next node skipping the current node childs
+
+//  void Previous();
+
+  bool isDone();
+
+  TeViewNode* currentNode();
+  int currentDepth();  //!< Returns the depth of the current node. The root has depth is 0.
+
+protected:
+private:
+  struct StackElem{
+    StackElem(TeViewTree* tr, int i){ tree = tr; ind = i; }
+    StackElem(TeViewTree* tr){ tree = tr; ind = tr->size(); }
+    TeViewTree* tree;
+    int ind;           //!< index of the current child in the tree
+  };
+
+  std::stack<StackElem> TravStack; // traversal stack
+};
+
+
+/*
+** ---------------------------------------------------------------
+** Inline methods:
+*/
+
+inline TeViewTreeIterator::TeViewTreeIterator(TeViewTree* root)
+{
+  TravStack.push(StackElem(root, -1));
+}
+
+inline TeViewTreeRevIterator::TeViewTreeRevIterator(TeViewTree* root)
+{
+  TravStack.push(StackElem(root));
+}
+
+inline void TeViewTreeIterator::first()
+{
+  while(TravStack.size() > 1)
+    TravStack.pop();
+  TravStack.top().ind = -1;
+}
+
+inline void TeViewTreeRevIterator::first()
+{
+  while(TravStack.size() > 1)
+    TravStack.pop();
+  TravStack.top().ind = TravStack.top().tree->size();
+}
+
+inline void TeViewTreeIterator::firstLeaf()
+{
+  first();
+  nextLeaf();
+}
+
+inline void TeViewTreeRevIterator::firstLeaf()
+{
+  first();
+  nextLeaf();
+}
+
+inline bool TeViewTreeIterator::isDone()
+{
+  if(TravStack.size() > 1) return false;
+  
+  StackElem& elem = TravStack.top();
+  if(elem.ind < (int)(elem.tree->size())) return false;
+  
+  return true;
+}
+
+inline bool TeViewTreeRevIterator::isDone()
+{
+  if(TravStack.size() > 1) return false;
+  
+  StackElem& elem = TravStack.top();
+  if(elem.ind >= 0) return false;
+  
+  return true;
+}
+
+inline TeViewNode* TeViewTreeIterator::currentNode()
+{
+  StackElem& elem = TravStack.top();
+  if(elem.ind == -1) return elem.tree;
+
+  return elem.tree->retrieve(elem.ind);
+}
+
+inline TeViewNode* TeViewTreeRevIterator::currentNode()
+{
+  StackElem& elem = TravStack.top();
+  if(elem.ind == (int)(elem.tree->size())) return elem.tree;
+
+  return elem.tree->retrieve(elem.ind);  
+}
+
+inline int TeViewTreeIterator::currentDepth()
+{
+  return TravStack.size() - 1;
+}
+
+inline int TeViewTreeRevIterator::currentDepth()
+{
+  return TravStack.size() - 1;
+}
+
+
+#ifdef te__next_back__
+#define next te__next_back__
+#undef te__next_back__  // some stl module defines a macro named next that is generating conflics with 
+#endif
+#endif
diff --git a/src/terralib/kernel/TeViewTreeUtils.cpp b/src/terralib/kernel/TeViewTreeUtils.cpp
old mode 100755
new mode 100644
index 69889ec..3b3e0c6
--- a/src/terralib/kernel/TeViewTreeUtils.cpp
+++ b/src/terralib/kernel/TeViewTreeUtils.cpp
@@ -1,104 +1,104 @@
-/*
-** ---------------------------------------------------------------
-** teviewtreeutils.cpp - This module contains some functions to be 
-** used with the TeViewTree class. These functions should probably be
-** methods of the own TeView class.
-**
-*/
-
-/*
-** ---------------------------------------------------------------
-** Includes:
-*/
-
-
-#include "TeViewTreeUtils.h"
-#include "TeViewTreeIterator.h"
-
-/*
-** ----------------------------------------------------------------------------
-** Constants:
-*/
-
-
-/*
-** ---------------------------------------------------------------
-** Internal Functions:
-*/
-
-/*
-** ---------------------------------------------------------------
-** Public Functions:
-*/
-
-
-void TeClearViewTree(TeViewTree* vtree)
-{
-  if(vtree==NULL) return;
-
-  while(vtree->size() > 0)
-  {
-    TeViewNode* node = vtree->removeID(vtree->size() - 1);
-
-    if(node == NULL) continue;
-
-    if(node->type() == TeTREE)
-      TeClearViewTree((TeViewTree*)node);
-    delete node;
-  }
-}
-
-/*!
-   \brief Look at a View Tree for a theme with the given name.
-
-   This function creates a simple theme with the given parameters. 
-   A simple theme is a non thematic theme without any associated 
-   where clause and with only one attribute table associated to it. 
-   It is assumed that, given the feature (layer) name, 
-   its the attributes table is named name_attr while the geometries
-   tables are called namePontos, nameLinhas and namePoligonos for
-   respectively the Points geometry table, Lines geometry table and
-   Poligons geometry table.
-
-   \param vtree theme name and also name of the theme associated feature(layer)
-   \param name name of the theme to be found
-   \param case_sensitive(optional) name of the key field of the associated 
-                        attribute table. If no key is given it is
-                        assumed that the key name is object_id.
-*/
-TeTheme* TeFindTheme(TeViewTree& vtree, char* name, bool case_sensitive)
-{
-  TeTheme* theme = NULL;
-  TeViewTreeIterator it(&vtree);
-
-  for(it.firstLeaf();!(it.isDone());it.nextLeaf())
-  {
-    TeViewNode* node = it.currentNode();
-    int ret; // return value of the string comparation functions
-
-    if(node->type() != TeTHEME) 
-      continue;
-
-    if(case_sensitive)
-      ret = strcmp(name, node->name().c_str());
-    else
-    {
-//      ret = stricmp(name, node->name().c_str()); // do not work for Linux
-      string s1 = TeConvertToLowerCase(string(name));
-      string s2 = TeConvertToLowerCase(node->name());
-      if (s1 == s2)
-      	ret = 0;
-      else
-      	ret = -1;
-   }
-
-    if(ret == 0)
-    {
-      theme = (TeTheme*)node;
-      break;
-    }
-
-  }
-
-  return theme;
-}
+/*
+** ---------------------------------------------------------------
+** teviewtreeutils.cpp - This module contains some functions to be 
+** used with the TeViewTree class. These functions should probably be
+** methods of the own TeView class.
+**
+*/
+
+/*
+** ---------------------------------------------------------------
+** Includes:
+*/
+
+
+#include "TeViewTreeUtils.h"
+#include "TeViewTreeIterator.h"
+
+/*
+** ----------------------------------------------------------------------------
+** Constants:
+*/
+
+
+/*
+** ---------------------------------------------------------------
+** Internal Functions:
+*/
+
+/*
+** ---------------------------------------------------------------
+** Public Functions:
+*/
+
+
+void TeClearViewTree(TeViewTree* vtree)
+{
+  if(vtree==NULL) return;
+
+  while(vtree->size() > 0)
+  {
+    TeViewNode* node = vtree->removeID(vtree->size() - 1);
+
+    if(node == NULL) continue;
+
+    if(node->type() == TeTREE)
+      TeClearViewTree((TeViewTree*)node);
+    delete node;
+  }
+}
+
+/*!
+   \brief Look at a View Tree for a theme with the given name.
+
+   This function creates a simple theme with the given parameters. 
+   A simple theme is a non thematic theme without any associated 
+   where clause and with only one attribute table associated to it. 
+   It is assumed that, given the feature (layer) name, 
+   its the attributes table is named name_attr while the geometries
+   tables are called namePontos, nameLinhas and namePoligonos for
+   respectively the Points geometry table, Lines geometry table and
+   Poligons geometry table.
+
+   \param vtree theme name and also name of the theme associated feature(layer)
+   \param name name of the theme to be found
+   \param case_sensitive(optional) name of the key field of the associated 
+                        attribute table. If no key is given it is
+                        assumed that the key name is object_id.
+*/
+TeTheme* TeFindTheme(TeViewTree& vtree, char* name, bool case_sensitive)
+{
+  TeTheme* theme = NULL;
+  TeViewTreeIterator it(&vtree);
+
+  for(it.firstLeaf();!(it.isDone());it.nextLeaf())
+  {
+    TeViewNode* node = it.currentNode();
+    int ret; // return value of the string comparation functions
+
+    if(node->type() != TeTHEME) 
+      continue;
+
+    if(case_sensitive)
+      ret = strcmp(name, node->name().c_str());
+    else
+    {
+//      ret = stricmp(name, node->name().c_str()); // do not work for Linux
+      string s1 = TeConvertToLowerCase(string(name));
+      string s2 = TeConvertToLowerCase(node->name());
+      if (s1 == s2)
+      	ret = 0;
+      else
+      	ret = -1;
+   }
+
+    if(ret == 0)
+    {
+      theme = (TeTheme*)node;
+      break;
+    }
+
+  }
+
+  return theme;
+}
diff --git a/src/terralib/kernel/TeViewTreeUtils.h b/src/terralib/kernel/TeViewTreeUtils.h
old mode 100755
new mode 100644
index 61dbf19..a13b6c9
--- a/src/terralib/kernel/TeViewTreeUtils.h
+++ b/src/terralib/kernel/TeViewTreeUtils.h
@@ -1,39 +1,39 @@
-/*
-** ---------------------------------------------------------------
-** teviewtreeutils.h:
-**
-*/
-
-
-#ifndef TEVIEWTREEUTILS_H_
-#define TEVIEWTREEUTILS_H_
-
-/*
-** ---------------------------------------------------------------
-** Includes:
-*/
-
-#include "TeViewNode.h"
-#include "TeTheme.h"
-
-
-/*
-** ---------------------------------------------------------------
-** Functions Prototypes:
-*/
-
-TL_DLL void TeClearViewTree(TeViewTree* vtree);
-TL_DLL TeTheme* TeFindTheme(TeViewTree& vtree, char* name, bool case_sensitive = false);
-
-/*
-** ---------------------------------------------------------------
-** Inline Functions:
-*/
-
-
-/*
-** ---------------------------------------------------------------
-** End:
-*/
-
-#endif
+/*
+** ---------------------------------------------------------------
+** teviewtreeutils.h:
+**
+*/
+
+
+#ifndef TEVIEWTREEUTILS_H_
+#define TEVIEWTREEUTILS_H_
+
+/*
+** ---------------------------------------------------------------
+** Includes:
+*/
+
+#include "TeViewNode.h"
+#include "TeTheme.h"
+
+
+/*
+** ---------------------------------------------------------------
+** Functions Prototypes:
+*/
+
+TL_DLL void TeClearViewTree(TeViewTree* vtree);
+TL_DLL TeTheme* TeFindTheme(TeViewTree& vtree, char* name, bool case_sensitive = false);
+
+/*
+** ---------------------------------------------------------------
+** Inline Functions:
+*/
+
+
+/*
+** ---------------------------------------------------------------
+** End:
+*/
+
+#endif
diff --git a/src/terralib/kernel/TeVisual.cpp b/src/terralib/kernel/TeVisual.cpp
old mode 100755
new mode 100644
index 87593f5..2ea09d0
--- a/src/terralib/kernel/TeVisual.cpp
+++ b/src/terralib/kernel/TeVisual.cpp
@@ -1,258 +1,258 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include <TeVisual.h>
-
-TeBaseVisualParams::TeBaseVisualParams(TeGeomRep rep, const string& visualType) :
-		symbId_ (TePolyTypeFill),
-		color_ (255,0,0),
-	    transparency_ (0),
-		width_ (0),
-	   	contourSymbId_ (TeLnTypeContinuous),
-		contourColor_(0,255,255),
-		contourTransparency_ (0),
-		contourWidth_ (1),
-		sizeValue_ (0),
-		ptAngle_ (0),
-		family_ ("Verdana"),
-		bold_ (false),
-		italic_(false),
-		alignmentVert_(0),
-		alignmentHoriz_(0),
-		tabSize_(6),
-		lineSpace_(1),
-		fixedSize_(false),
-		visualType_(visualType),
-		geomRep_(rep)
-{
-	switch (rep)
-	{
-		case TePOLYGONS:
-		case TeCELLS:
-			symbId_= TePolyTypeFill;
-			contourSymbId_= TeLnTypeContinuous;
-			break;
-		case TeLINES:
-			symbId_= TeLnTypeContinuous;
-			width_ = 1;
-			break;
-		case TePOINTS:
-		case TeNODES:
-			symbId_= TePtTypeBox;
-			sizeValue_ = 3;
-			break;
-		case TeTEXT:
-			sizeValue_= 12;
-			break;
-		default:
-			break;
-	}
-}
-
-// Copy constructor
-TeBaseVisualParams::TeBaseVisualParams(const TeBaseVisualParams& other)
-{	
-	symbId_ = other.symbId_;
-	color_ = other.color_;
-	transparency_ = other.transparency_;
-	width_ = other.width_;
-
-	contourSymbId_ = other.contourSymbId_;
-	contourColor_ = other.contourColor_;
-	contourTransparency_ = other.contourTransparency_;
-	contourWidth_ = other.contourWidth_;
-		
-	sizeValue_ = other.sizeValue_;
-	ptAngle_ = other.ptAngle_;
-	
-	family_ = other.family_;
-	bold_ = other.bold_;
-	italic_ = other.italic_;
-	fixedSize_ = other.fixedSize_;
-	alignmentVert_ = other.alignmentVert_;
-	alignmentHoriz_ = other.alignmentHoriz_;
-	tabSize_ = other.tabSize_;
-	lineSpace_ = other.lineSpace_;
-
-	visualType_ = other.visualType_;
-	geomRep_ = other.geomRep_; 
-}
-
-// Assignment operator
-TeBaseVisualParams& 
-TeBaseVisualParams::operator=(const TeBaseVisualParams& vis)
-{
-	if ( this != &vis )
-	{
-		symbId_ = vis.symbId_;
-		color_ = vis.color_;
-		transparency_ = vis.transparency_;
-		width_ = vis.width_;
-
-		contourSymbId_ = vis.contourSymbId_;
-		contourColor_ = vis.contourColor_;
-		contourTransparency_ = vis.contourTransparency_;
-		contourWidth_ = vis.contourWidth_;
-		
-		sizeValue_ = vis.sizeValue_;
-		ptAngle_ = vis.ptAngle_;
-		
-		family_ = vis.family_;
-		bold_ = vis.bold_;
-		italic_ = vis.italic_;
-		fixedSize_ = vis.fixedSize_;
-		alignmentVert_ = vis.alignmentVert_;
-		alignmentHoriz_ = vis.alignmentHoriz_;
-		tabSize_ = vis.tabSize_;
-		lineSpace_ = vis.lineSpace_;
-
-		visualType_ = vis.visualType_;
-		geomRep_ = vis.geomRep_;
-	}
-	return *this;
-}
-
-// Returns TRUE if param1 is equal to param2 or FALSE if they are different.
-bool 
-TeBaseVisualParams::operator== (const TeBaseVisualParams& vis)
-{
-	return ( symbId_ == vis.symbId_ &&
-		color_ == vis.color_ &&
-		transparency_ == vis.transparency_ &&
-		width_ == vis.width_ &&
-		contourSymbId_ == vis.contourSymbId_ &&
-		contourColor_ == vis.contourColor_ &&
-		contourTransparency_ == vis.contourTransparency_ &&
-		contourWidth_ == vis.contourWidth_ &&
-		sizeValue_ == vis.sizeValue_ &&
-		ptAngle_ == vis.ptAngle_ &&
-		family_ == vis.family_ &&
-		bold_ == vis.bold_ &&
-		italic_ == vis.italic_ &&
-		fixedSize_ == vis.fixedSize_ &&
-		alignmentVert_ == vis.alignmentVert_ &&
-		alignmentHoriz_ == vis.alignmentHoriz_ &&
-		tabSize_ == vis.tabSize_ && 
-		lineSpace_ == vis.lineSpace_  &&
-		visualType_ == vis.visualType_ &&
-		geomRep_ == vis.geomRep_);
-}
-
-// Returns visual to the default parameters 
-void 
-TeBaseVisualParams::clear()
-{
-	symbId_ = TePolyTypeFill;
-	color_ = TeColor(255,0,0);
-	transparency_=0;
-	width_ = 0; 
-	contourSymbId_ = TeLnTypeContinuous;
-	contourColor_ = TeColor (0,255,255);
-	contourTransparency_ = 0;
-	contourWidth_ = 1;
-	sizeValue_ = 0;
-	ptAngle_ = 0;
-	family_ = "Verdana";
-	bold_  = false;
-	italic_ = false;
-	alignmentVert_ = 0;
-	alignmentHoriz_ = 0;
-	tabSize_ = 6;
-	lineSpace_ = 1;
-	fixedSize_ = false;
-	geomRep_ = TePOLYGONS;
-	visualType_="tevisual";
-}
-
-// Copies only the basic visual parameters from another visual
-void 
-TeBaseVisualParams::setBasic (TeBaseVisualParams &vis)
-{
-	symbId_ = vis.symbId_;
-	color_ = vis.color_;
-	transparency_ = vis.transparency_;
-	width_ = vis.width_;
-
-	contourSymbId_ = vis.contourSymbId_;
-	contourColor_ = vis.contourColor_;
-	contourTransparency_ = vis.contourTransparency_;
-	contourWidth_ = vis.contourWidth_;
-	
-	sizeValue_ = vis.sizeValue_;
-	ptAngle_ = vis.ptAngle_;
-	
-	family_ = vis.family_;
-	bold_ = vis.bold_;
-	italic_ = vis.italic_;
-	fixedSize_ = vis.fixedSize_;
-	alignmentVert_ = vis.alignmentVert_;
-	alignmentHoriz_ = vis.alignmentHoriz_;
-	tabSize_ = vis.tabSize_;
-	lineSpace_ = vis.lineSpace_;
-	geomRep_ = vis.geomRep_;
-	visualType_="tevisual";
-}
-
-//--------------
-
-TeVisual::TeVisual(TeGeomRep rep) : 
-		params_ (TeBaseVisualParams(rep, "tevisual"))
-{
-}
-		
-// Copy constructor
-TeVisual::TeVisual(const TeVisual& other)
-{	
-	params_ = other.params_;
-}
-
-// Assignment operator
-TeVisual& 
-TeVisual::operator=(const TeVisual& vis)
-{
-	if ( this != &vis )
-		params_ = vis.params_;
-	return *this;
-}
-
-// Returns TRUE if param1 is equal to param2 or FALSE if they are different.
-bool 
-TeVisual::operator== (const TeVisual& vis)
-{
-	return ( params_ == vis.params_);
-}
-
-// Returns visual to the default parameters 
-void 
-TeVisual::clear()
-{
-	params_.clear();
-}
-
-// Copies only the basic visual parameters from another visual
-void 
-TeVisual::setBasic (TeVisual &vis)
-{
-	params_.setBasic(vis.params_);
-}
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include <TeVisual.h>
+
+TeBaseVisualParams::TeBaseVisualParams(TeGeomRep rep, const string& visualType) :
+		symbId_ (TePolyTypeFill),
+		color_ (255,0,0),
+	    transparency_ (0),
+		width_ (0),
+	   	contourSymbId_ (TeLnTypeContinuous),
+		contourColor_(0,255,255),
+		contourTransparency_ (0),
+		contourWidth_ (1),
+		sizeValue_ (0),
+		ptAngle_ (0),
+		family_ ("Verdana"),
+		bold_ (false),
+		italic_(false),
+		alignmentVert_(0),
+		alignmentHoriz_(0),
+		tabSize_(6),
+		lineSpace_(1),
+		fixedSize_(false),
+		visualType_(visualType),
+		geomRep_(rep)
+{
+	switch (rep)
+	{
+		case TePOLYGONS:
+		case TeCELLS:
+			symbId_= TePolyTypeFill;
+			contourSymbId_= TeLnTypeContinuous;
+			break;
+		case TeLINES:
+			symbId_= TeLnTypeContinuous;
+			width_ = 1;
+			break;
+		case TePOINTS:
+		case TeNODES:
+			symbId_= TePtTypeBox;
+			sizeValue_ = 3;
+			break;
+		case TeTEXT:
+			sizeValue_= 12;
+			break;
+		default:
+			break;
+	}
+}
+
+// Copy constructor
+TeBaseVisualParams::TeBaseVisualParams(const TeBaseVisualParams& other)
+{	
+	symbId_ = other.symbId_;
+	color_ = other.color_;
+	transparency_ = other.transparency_;
+	width_ = other.width_;
+
+	contourSymbId_ = other.contourSymbId_;
+	contourColor_ = other.contourColor_;
+	contourTransparency_ = other.contourTransparency_;
+	contourWidth_ = other.contourWidth_;
+		
+	sizeValue_ = other.sizeValue_;
+	ptAngle_ = other.ptAngle_;
+	
+	family_ = other.family_;
+	bold_ = other.bold_;
+	italic_ = other.italic_;
+	fixedSize_ = other.fixedSize_;
+	alignmentVert_ = other.alignmentVert_;
+	alignmentHoriz_ = other.alignmentHoriz_;
+	tabSize_ = other.tabSize_;
+	lineSpace_ = other.lineSpace_;
+
+	visualType_ = other.visualType_;
+	geomRep_ = other.geomRep_; 
+}
+
+// Assignment operator
+TeBaseVisualParams& 
+TeBaseVisualParams::operator=(const TeBaseVisualParams& vis)
+{
+	if ( this != &vis )
+	{
+		symbId_ = vis.symbId_;
+		color_ = vis.color_;
+		transparency_ = vis.transparency_;
+		width_ = vis.width_;
+
+		contourSymbId_ = vis.contourSymbId_;
+		contourColor_ = vis.contourColor_;
+		contourTransparency_ = vis.contourTransparency_;
+		contourWidth_ = vis.contourWidth_;
+		
+		sizeValue_ = vis.sizeValue_;
+		ptAngle_ = vis.ptAngle_;
+		
+		family_ = vis.family_;
+		bold_ = vis.bold_;
+		italic_ = vis.italic_;
+		fixedSize_ = vis.fixedSize_;
+		alignmentVert_ = vis.alignmentVert_;
+		alignmentHoriz_ = vis.alignmentHoriz_;
+		tabSize_ = vis.tabSize_;
+		lineSpace_ = vis.lineSpace_;
+
+		visualType_ = vis.visualType_;
+		geomRep_ = vis.geomRep_;
+	}
+	return *this;
+}
+
+// Returns TRUE if param1 is equal to param2 or FALSE if they are different.
+bool 
+TeBaseVisualParams::operator== (const TeBaseVisualParams& vis)
+{
+	return ( symbId_ == vis.symbId_ &&
+		color_ == vis.color_ &&
+		transparency_ == vis.transparency_ &&
+		width_ == vis.width_ &&
+		contourSymbId_ == vis.contourSymbId_ &&
+		contourColor_ == vis.contourColor_ &&
+		contourTransparency_ == vis.contourTransparency_ &&
+		contourWidth_ == vis.contourWidth_ &&
+		sizeValue_ == vis.sizeValue_ &&
+		ptAngle_ == vis.ptAngle_ &&
+		family_ == vis.family_ &&
+		bold_ == vis.bold_ &&
+		italic_ == vis.italic_ &&
+		fixedSize_ == vis.fixedSize_ &&
+		alignmentVert_ == vis.alignmentVert_ &&
+		alignmentHoriz_ == vis.alignmentHoriz_ &&
+		tabSize_ == vis.tabSize_ && 
+		lineSpace_ == vis.lineSpace_  &&
+		visualType_ == vis.visualType_ &&
+		geomRep_ == vis.geomRep_);
+}
+
+// Returns visual to the default parameters 
+void 
+TeBaseVisualParams::clear()
+{
+	symbId_ = TePolyTypeFill;
+	color_ = TeColor(255,0,0);
+	transparency_=0;
+	width_ = 0; 
+	contourSymbId_ = TeLnTypeContinuous;
+	contourColor_ = TeColor (0,255,255);
+	contourTransparency_ = 0;
+	contourWidth_ = 1;
+	sizeValue_ = 0;
+	ptAngle_ = 0;
+	family_ = "Verdana";
+	bold_  = false;
+	italic_ = false;
+	alignmentVert_ = 0;
+	alignmentHoriz_ = 0;
+	tabSize_ = 6;
+	lineSpace_ = 1;
+	fixedSize_ = false;
+	geomRep_ = TePOLYGONS;
+	visualType_="tevisual";
+}
+
+// Copies only the basic visual parameters from another visual
+void 
+TeBaseVisualParams::setBasic (TeBaseVisualParams &vis)
+{
+	symbId_ = vis.symbId_;
+	color_ = vis.color_;
+	transparency_ = vis.transparency_;
+	width_ = vis.width_;
+
+	contourSymbId_ = vis.contourSymbId_;
+	contourColor_ = vis.contourColor_;
+	contourTransparency_ = vis.contourTransparency_;
+	contourWidth_ = vis.contourWidth_;
+	
+	sizeValue_ = vis.sizeValue_;
+	ptAngle_ = vis.ptAngle_;
+	
+	family_ = vis.family_;
+	bold_ = vis.bold_;
+	italic_ = vis.italic_;
+	fixedSize_ = vis.fixedSize_;
+	alignmentVert_ = vis.alignmentVert_;
+	alignmentHoriz_ = vis.alignmentHoriz_;
+	tabSize_ = vis.tabSize_;
+	lineSpace_ = vis.lineSpace_;
+	geomRep_ = vis.geomRep_;
+	visualType_="tevisual";
+}
+
+//--------------
+
+TeVisual::TeVisual(TeGeomRep rep) : 
+		params_ (TeBaseVisualParams(rep, "tevisual"))
+{
+}
+		
+// Copy constructor
+TeVisual::TeVisual(const TeVisual& other)
+{	
+	params_ = other.params_;
+}
+
+// Assignment operator
+TeVisual& 
+TeVisual::operator=(const TeVisual& vis)
+{
+	if ( this != &vis )
+		params_ = vis.params_;
+	return *this;
+}
+
+// Returns TRUE if param1 is equal to param2 or FALSE if they are different.
+bool 
+TeVisual::operator== (const TeVisual& vis)
+{
+	return ( params_ == vis.params_);
+}
+
+// Returns visual to the default parameters 
+void 
+TeVisual::clear()
+{
+	params_.clear();
+}
+
+// Copies only the basic visual parameters from another visual
+void 
+TeVisual::setBasic (TeVisual &vis)
+{
+	params_.setBasic(vis.params_);
+}
+
+
diff --git a/src/terralib/kernel/TeVisual.h b/src/terralib/kernel/TeVisual.h
old mode 100755
new mode 100644
index 1afd986..7204eb5
--- a/src/terralib/kernel/TeVisual.h
+++ b/src/terralib/kernel/TeVisual.h
@@ -1,369 +1,369 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeVisual.h
-    \brief This file deals with the visual presentation characteristics of geometries in TerraLib
-*/
-#ifndef  __TERRALIB_INTERNAL_VISUAL_H
-#define  __TERRALIB_INTERNAL_VISUAL_H
-
-#include "TeDefines.h"
-#include "TeDataTypes.h"
-#include "TeAbstractFactory.h"
-
-class TeRasterTransform;
-
-#include <string>
-#include <map>
-
-using namespace std;
-
-
-//! A structure for supporting a color definition
-struct TL_DLL TeColor
-{
-	//! Red component
-	int red_;
-
-	//! Green component 
-	int green_; 	
-	
-	//! Blue component
-	int blue_;	
-	
-	//! Color name
-	string name_;
-	
-	//! Empty constructor
-	TeColor () : red_(0),green_(0),blue_(0), name_("") {}
-
-	//! Constructor with parameters
-	TeColor (int r, int g, int b, const string& name="") : red_(r),green_(g),blue_(b), name_(name) {}
-
-	//! Set parameters of colors
-	void init (int r, int g, int b, const string& name="") {red_=r,green_=g,blue_=b;name_=name; }
-
-
-	//! Returns TRUE if color1 is equal to color2 or FALSE if they are different.
-	bool operator== (const TeColor& color)
-	{
-		return (red_==color.red_ && green_==color.green_ && blue_==color.blue_);
-	}
-
-	//! Assignment operator
-	TeColor& operator= ( const TeColor& color )
-	{
-		if ( this != &color )
-		{	
-			red_ = color.red_;
-			green_ = color.green_;
-			blue_ = color.blue_;
-			name_ = color.name_;
-		}
-		return *this;
-	}
-};
-
-//!  A class to represent the base visual parameters 
-/*!  
-	 This class contains the base visual parameters and it is used 
-	 by the factory responsible for creating visual objects. 
-	 
-	\sa
-     TeVisual
-*/
-class TL_DLL TeBaseVisualParams
-{
-public:
-	//! Constructor
-	TeBaseVisualParams(TeGeomRep rep = TePOLYGONS, const string& visualType = "tevisual"); 
-
-	//! Copy constructor
-	TeBaseVisualParams(const TeBaseVisualParams& other);
-
-	//! Destructor
-	virtual ~TeBaseVisualParams() {}
-
-	//! Assignment operator
-	virtual TeBaseVisualParams& operator=(const TeBaseVisualParams& visParams);
-
-	//! Returns TRUE if param1 is equal to param2 or FALSE if they are different.
-	virtual bool operator== (const TeBaseVisualParams& visParams);
-
-	//! Returns visual to the default parameters 
-	virtual void clear();
-
-	//! Copies only the basic visual parameters from another visual
-	virtual void setBasic (TeBaseVisualParams &visParams);
-
-	//! Returns the visual params type 
-	string getProductId() { return visualType_; }
-
-	//! Symbol id that define the style for the geometry filling
-    int			symbId_;			
-	//! Color used for geometry filling (line, point and text color)
-	TeColor		color_;				
-	//! Percentage of transparency for the geometry filling
-	int			transparency_;		
-	//! Width for line geometry
-	int			width_;				
-	
-	//! Symbol id that define the style for the geometry outline
-	int			contourSymbId_;			
-	//! Contour color for the geometry outline
-	TeColor		contourColor_;			
-	//! Percentage of transparency for the geometry outline
-	int			contourTransparency_;	
-	//! Width for the geometry outline
-	int			contourWidth_;			
-
-	//! Point size
-	int			sizeValue_;	
-	//! Point angle
-	int			ptAngle_;				
-	
-	// Text attributes
-	//! Text family
-	string		family_;	
-	//! Flag to indicate if text is bold
-	bool		bold_;			
-	//! Flag to indicate if text is italic
-	bool		italic_;	
-	//! Position of vertical alignment
-	double		alignmentVert_;		
-	//! Position of horizontal alignment
-	double		alignmentHoriz_;	
-	//! Number of spaces defined in a tab character
-	int			tabSize_;		
-	//! Spacing between lines
-	int			lineSpace_;	
-	//! Flag to indicate that element has a fixed size, don�t follow zoom operations	
-	bool		fixedSize_;			
-
-	//! Visual type used in factory strategy
-	string		visualType_;
-	//! Geometric representation associated with this visual 
-	TeGeomRep   geomRep_;				
-};
-
-//! This class is used to store the standard presentation characteristics of vector geometries
-class TL_DLL TeVisual
-{
-public :
-	
-	//! Empty constructor
-	TeVisual(TeGeomRep rep = TePOLYGONS);
-
-	//! Destructor
-	virtual ~TeVisual() {}
-
-	//! Copy constructor
-	TeVisual(const TeVisual& other);
-
-	//! Assignment operator
-	virtual TeVisual& operator=(const TeVisual& vis);
-
-	//! Returns TRUE if param1 is equal to param2 or FALSE if they are different.
-	virtual bool operator== (const TeVisual& vis);
-
-	//! Returns visual to the default parameters 
-	virtual void clear();
-
-	//! Copies only the basic visual parameters from another visual
-	virtual void setBasic (TeVisual &vis);
-
-	//! Sets the color used for geometry filling and line, point and text color
-	virtual void color(const TeColor& color) 
-	{	params_.color_ = color;}
-
-	//! Returns the color used for geometry filling and line, point and text color
-	virtual TeColor& color() 
-	{ return params_.color_; }
-
-	//! Sets the style for the filling of geometries
-	virtual void style(int s) 
-	{ params_.symbId_ = s; }
-
-	//! Returns the style for the filling of geometries
-	virtual int	style() 
-	{ return params_.symbId_; }
-
-	//! Sets the percentage of transparency for polygons and cells
-	virtual void transparency(int t)
-	{ params_.transparency_ = t; }
-
-	//! Returns the percentage of transparency used in polygons and cells
-	virtual int transparency()
-	{ return params_.transparency_; }
-
-	//! Sets the color for the polygons and cells outlines
-	virtual void contourColor(const TeColor& color) 
-	{ params_.contourColor_ = color;}
-
-	//! Returns the color used in the polygons and cells outlines
-	virtual TeColor& contourColor() 
-	{ return params_.contourColor_; }
-
-	//! Sets the percentage of transparency for the polygon ans cells outlines
-	virtual void contourTransparency(int t) 
-	{ params_.contourTransparency_ = t;}
-
-	//! Returns the color used in the polygons and cells outlines
-	virtual int	contourTransparency() 
-	{ return params_.contourTransparency_; }
-
-	//! Sets the contour width for the polygons and cells outlines
-	virtual void contourWidth(int w) 
-	{ params_.contourWidth_ = w; }
-
-	//! Returns the contour width used in the polygons and cells outlines
-	virtual int	contourWidth()  
-	{ return params_.contourWidth_; }
-
-	//! Sets the contour style for the polygons and cells outlines
-	virtual void contourStyle(int s) 
-	{ params_.contourSymbId_ = s; }
-
-	//! Returns the contour style used in the polygons and cells outlines
-	virtual int	contourStyle() 
-	{ return params_.contourSymbId_; }
-
-	//! Sets the width
-	virtual void width(int w) 
-	{ params_.width_ = w; }
-
-	//! Returns the width
-	virtual int	 width ()  
-	{ return params_.width_; }
-
-	//! Sets the point size
-	virtual void size (int s)  
-	{ params_.sizeValue_ = s; }
-
-	//! Returns the point size
-	virtual int	size ()  
-	{ return params_.sizeValue_; }
-
-	//! Sets the text family for fonts
-	virtual void family (string f) 
-	{ params_.family_ = f; }
-
-	//! Returns font�s family
-	virtual string family () 
-	{ return params_.family_ ; }
-
-	//! Sets the bold style for texts
-	virtual void bold (bool b) 
-	{ params_.bold_ = b; }
-
-	//! Returns the bold style used in the texts
-	virtual bool bold () 
-	{ return params_.bold_; }
-
-	//! Sets the italic style for texts
-	virtual void italic (bool i) 
-	{ params_.italic_ = i; }
-
-	//! Returns the italic style used in the texts
-	virtual bool italic () 
-	{ return params_.italic_; }
-
-	//!  Sets a flag indicating if the text will have a fixed size
-	virtual void fixedSize (bool i) 
-	{ params_.fixedSize_ = i; }
-
-	//!  Retuns a flag indicating if an text have a fixed size
-	virtual bool fixedSize () 
-	{ return params_.fixedSize_; }
-
-	//!  Sets the vertical alignment of texts
-	virtual void alignmentVert(double a) 
-	{ params_.alignmentVert_ = a; }
-
-	//!  Retuns the vertical alignment of texts
-	virtual double alignmentVert() 
-	{ return params_.alignmentVert_; }
-
-	//!  Sets the horizontal alignment of texts
-	virtual void alignmentHoriz(double a) 
-	{ params_.alignmentHoriz_ = a; }
-
-	//!  Retuns the horizontal alignment of texts
-	virtual double alignmentHoriz() 
-	{ return params_.alignmentHoriz_; }
-
-	//! Sets the number of spaces defined in a tab character
-	virtual void tabSize (int s) 
-	{ params_.tabSize_ = s; }
-
-	//! Returns the number of spaces defined in a tab character
-	virtual int	tabSize () 
-	{ return params_.tabSize_; }
-
-	//! Sets the spacing between lines
-	virtual void lineSpace (int s) 
-	{ params_.lineSpace_ = s; }
-
-	//! Returns the spacing between lines
-	virtual int	lineSpace () 
-	{ return params_.lineSpace_; }
-
-	//! Returns the angle of points and symbols
-	virtual int   ptAngle() 
-	{return params_.ptAngle_; }
-
-	//! Sets the angle of points and symbols
-	virtual void  ptAngle(int p) 
-	{params_.ptAngle_ = p;}
-
-	//! Creates another visual pointer and copies its content
-	virtual TeVisual* copy()
-	{
-		TeVisual* retval = new TeVisual();
-		*retval = *this;
-		return retval;
-	}
-
-	//! Returns a default visual object
-	static TeVisual* DefaultObject()  
-	{ return new TeVisual(); }
-
-protected:
-	TeBaseVisualParams	params_;
-};
-
-
-//! A factory to build TeVisual objects
-class TL_DLL TeVisualFactory : public TeAbstractFactory<TeVisual, TeBaseVisualParams, string>
-{
-public:
-	TeVisualFactory(const string& facName) : TeAbstractFactory<TeVisual, TeBaseVisualParams, string>(facName)
-	{}
-		virtual TeVisual* build ()
-	{	return new TeVisual(); }
-};
-
-//! Export the type that represents the definition of visual for raster data
-typedef TeRasterTransform TeRasterVisual;
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeVisual.h
+    \brief This file deals with the visual presentation characteristics of geometries in TerraLib
+*/
+#ifndef  __TERRALIB_INTERNAL_VISUAL_H
+#define  __TERRALIB_INTERNAL_VISUAL_H
+
+#include "TeDefines.h"
+#include "TeDataTypes.h"
+#include "TeAbstractFactory.h"
+
+class TeRasterTransform;
+
+#include <string>
+#include <map>
+
+using namespace std;
+
+
+//! A structure for supporting a color definition
+struct TL_DLL TeColor
+{
+	//! Red component
+	int red_;
+
+	//! Green component 
+	int green_; 	
+	
+	//! Blue component
+	int blue_;	
+	
+	//! Color name
+	string name_;
+	
+	//! Empty constructor
+	TeColor () : red_(0),green_(0),blue_(0), name_("") {}
+
+	//! Constructor with parameters
+	TeColor (int r, int g, int b, const string& name="") : red_(r),green_(g),blue_(b), name_(name) {}
+
+	//! Set parameters of colors
+	void init (int r, int g, int b, const string& name="") {red_=r,green_=g,blue_=b;name_=name; }
+
+
+	//! Returns TRUE if color1 is equal to color2 or FALSE if they are different.
+	bool operator== (const TeColor& color)
+	{
+		return (red_==color.red_ && green_==color.green_ && blue_==color.blue_);
+	}
+
+	//! Assignment operator
+	TeColor& operator= ( const TeColor& color )
+	{
+		if ( this != &color )
+		{	
+			red_ = color.red_;
+			green_ = color.green_;
+			blue_ = color.blue_;
+			name_ = color.name_;
+		}
+		return *this;
+	}
+};
+
+//!  A class to represent the base visual parameters 
+/*!  
+	 This class contains the base visual parameters and it is used 
+	 by the factory responsible for creating visual objects. 
+	 
+	\sa
+     TeVisual
+*/
+class TL_DLL TeBaseVisualParams
+{
+public:
+	//! Constructor
+	TeBaseVisualParams(TeGeomRep rep = TePOLYGONS, const string& visualType = "tevisual"); 
+
+	//! Copy constructor
+	TeBaseVisualParams(const TeBaseVisualParams& other);
+
+	//! Destructor
+	virtual ~TeBaseVisualParams() {}
+
+	//! Assignment operator
+	virtual TeBaseVisualParams& operator=(const TeBaseVisualParams& visParams);
+
+	//! Returns TRUE if param1 is equal to param2 or FALSE if they are different.
+	virtual bool operator== (const TeBaseVisualParams& visParams);
+
+	//! Returns visual to the default parameters 
+	virtual void clear();
+
+	//! Copies only the basic visual parameters from another visual
+	virtual void setBasic (TeBaseVisualParams &visParams);
+
+	//! Returns the visual params type 
+	string getProductId() { return visualType_; }
+
+	//! Symbol id that define the style for the geometry filling
+    int			symbId_;			
+	//! Color used for geometry filling (line, point and text color)
+	TeColor		color_;				
+	//! Percentage of transparency for the geometry filling
+	int			transparency_;		
+	//! Width for line geometry
+	int			width_;				
+	
+	//! Symbol id that define the style for the geometry outline
+	int			contourSymbId_;			
+	//! Contour color for the geometry outline
+	TeColor		contourColor_;			
+	//! Percentage of transparency for the geometry outline
+	int			contourTransparency_;	
+	//! Width for the geometry outline
+	int			contourWidth_;			
+
+	//! Point size
+	int			sizeValue_;	
+	//! Point angle
+	int			ptAngle_;				
+	
+	// Text attributes
+	//! Text family
+	string		family_;	
+	//! Flag to indicate if text is bold
+	bool		bold_;			
+	//! Flag to indicate if text is italic
+	bool		italic_;	
+	//! Position of vertical alignment
+	double		alignmentVert_;		
+	//! Position of horizontal alignment
+	double		alignmentHoriz_;	
+	//! Number of spaces defined in a tab character
+	int			tabSize_;		
+	//! Spacing between lines
+	int			lineSpace_;	
+	//! Flag to indicate that element has a fixed size, don�t follow zoom operations	
+	bool		fixedSize_;			
+
+	//! Visual type used in factory strategy
+	string		visualType_;
+	//! Geometric representation associated with this visual 
+	TeGeomRep   geomRep_;				
+};
+
+//! This class is used to store the standard presentation characteristics of vector geometries
+class TL_DLL TeVisual
+{
+public :
+	
+	//! Empty constructor
+	TeVisual(TeGeomRep rep = TePOLYGONS);
+
+	//! Destructor
+	virtual ~TeVisual() {}
+
+	//! Copy constructor
+	TeVisual(const TeVisual& other);
+
+	//! Assignment operator
+	virtual TeVisual& operator=(const TeVisual& vis);
+
+	//! Returns TRUE if param1 is equal to param2 or FALSE if they are different.
+	virtual bool operator== (const TeVisual& vis);
+
+	//! Returns visual to the default parameters 
+	virtual void clear();
+
+	//! Copies only the basic visual parameters from another visual
+	virtual void setBasic (TeVisual &vis);
+
+	//! Sets the color used for geometry filling and line, point and text color
+	virtual void color(const TeColor& color) 
+	{	params_.color_ = color;}
+
+	//! Returns the color used for geometry filling and line, point and text color
+	virtual TeColor& color() 
+	{ return params_.color_; }
+
+	//! Sets the style for the filling of geometries
+	virtual void style(int s) 
+	{ params_.symbId_ = s; }
+
+	//! Returns the style for the filling of geometries
+	virtual int	style() 
+	{ return params_.symbId_; }
+
+	//! Sets the percentage of transparency for polygons and cells
+	virtual void transparency(int t)
+	{ params_.transparency_ = t; }
+
+	//! Returns the percentage of transparency used in polygons and cells
+	virtual int transparency()
+	{ return params_.transparency_; }
+
+	//! Sets the color for the polygons and cells outlines
+	virtual void contourColor(const TeColor& color) 
+	{ params_.contourColor_ = color;}
+
+	//! Returns the color used in the polygons and cells outlines
+	virtual TeColor& contourColor() 
+	{ return params_.contourColor_; }
+
+	//! Sets the percentage of transparency for the polygon ans cells outlines
+	virtual void contourTransparency(int t) 
+	{ params_.contourTransparency_ = t;}
+
+	//! Returns the color used in the polygons and cells outlines
+	virtual int	contourTransparency() 
+	{ return params_.contourTransparency_; }
+
+	//! Sets the contour width for the polygons and cells outlines
+	virtual void contourWidth(int w) 
+	{ params_.contourWidth_ = w; }
+
+	//! Returns the contour width used in the polygons and cells outlines
+	virtual int	contourWidth()  
+	{ return params_.contourWidth_; }
+
+	//! Sets the contour style for the polygons and cells outlines
+	virtual void contourStyle(int s) 
+	{ params_.contourSymbId_ = s; }
+
+	//! Returns the contour style used in the polygons and cells outlines
+	virtual int	contourStyle() 
+	{ return params_.contourSymbId_; }
+
+	//! Sets the width
+	virtual void width(int w) 
+	{ params_.width_ = w; }
+
+	//! Returns the width
+	virtual int	 width ()  
+	{ return params_.width_; }
+
+	//! Sets the point size
+	virtual void size (int s)  
+	{ params_.sizeValue_ = s; }
+
+	//! Returns the point size
+	virtual int	size ()  
+	{ return params_.sizeValue_; }
+
+	//! Sets the text family for fonts
+	virtual void family (string f) 
+	{ params_.family_ = f; }
+
+	//! Returns font�s family
+	virtual string family () 
+	{ return params_.family_ ; }
+
+	//! Sets the bold style for texts
+	virtual void bold (bool b) 
+	{ params_.bold_ = b; }
+
+	//! Returns the bold style used in the texts
+	virtual bool bold () 
+	{ return params_.bold_; }
+
+	//! Sets the italic style for texts
+	virtual void italic (bool i) 
+	{ params_.italic_ = i; }
+
+	//! Returns the italic style used in the texts
+	virtual bool italic () 
+	{ return params_.italic_; }
+
+	//!  Sets a flag indicating if the text will have a fixed size
+	virtual void fixedSize (bool i) 
+	{ params_.fixedSize_ = i; }
+
+	//!  Retuns a flag indicating if an text have a fixed size
+	virtual bool fixedSize () 
+	{ return params_.fixedSize_; }
+
+	//!  Sets the vertical alignment of texts
+	virtual void alignmentVert(double a) 
+	{ params_.alignmentVert_ = a; }
+
+	//!  Retuns the vertical alignment of texts
+	virtual double alignmentVert() 
+	{ return params_.alignmentVert_; }
+
+	//!  Sets the horizontal alignment of texts
+	virtual void alignmentHoriz(double a) 
+	{ params_.alignmentHoriz_ = a; }
+
+	//!  Retuns the horizontal alignment of texts
+	virtual double alignmentHoriz() 
+	{ return params_.alignmentHoriz_; }
+
+	//! Sets the number of spaces defined in a tab character
+	virtual void tabSize (int s) 
+	{ params_.tabSize_ = s; }
+
+	//! Returns the number of spaces defined in a tab character
+	virtual int	tabSize () 
+	{ return params_.tabSize_; }
+
+	//! Sets the spacing between lines
+	virtual void lineSpace (int s) 
+	{ params_.lineSpace_ = s; }
+
+	//! Returns the spacing between lines
+	virtual int	lineSpace () 
+	{ return params_.lineSpace_; }
+
+	//! Returns the angle of points and symbols
+	virtual int   ptAngle() 
+	{return params_.ptAngle_; }
+
+	//! Sets the angle of points and symbols
+	virtual void  ptAngle(int p) 
+	{params_.ptAngle_ = p;}
+
+	//! Creates another visual pointer and copies its content
+	virtual TeVisual* copy()
+	{
+		TeVisual* retval = new TeVisual();
+		*retval = *this;
+		return retval;
+	}
+
+	//! Returns a default visual object
+	static TeVisual* DefaultObject()  
+	{ return new TeVisual(); }
+
+protected:
+	TeBaseVisualParams	params_;
+};
+
+
+//! A factory to build TeVisual objects
+class TL_DLL TeVisualFactory : public TeAbstractFactory<TeVisual, TeBaseVisualParams, string>
+{
+public:
+	TeVisualFactory(const string& facName) : TeAbstractFactory<TeVisual, TeBaseVisualParams, string>(facName)
+	{}
+		virtual TeVisual* build ()
+	{	return new TeVisual(); }
+};
+
+//! Export the type that represents the definition of visual for raster data
+typedef TeRasterTransform TeRasterVisual;
+
+#endif
+
diff --git a/src/terralib/kernel/checkvec.h b/src/terralib/kernel/checkvec.h
old mode 100755
new mode 100644
index 057bfc8..50cbefb
--- a/src/terralib/kernel/checkvec.h
+++ b/src/terralib/kernel/checkvec.h
@@ -1,71 +1,71 @@
-/************************************************************************************
- TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-// include/checkvec : vector class with checked limits
-#ifndef CHECKVEC_H 
-#define CHECKVEC_H
-#include<cassert>
-#include<vector>
-
-namespace br_stl
-{
-	template<class T>
-	class checkedVector : public std::vector<T>
-	{
-	public:
-		// inherited types
-		typedef typename checkedVector::size_type size_type;
-		typedef typename checkedVector::iterator iterator;
-		typedef typename checkedVector::difference_type difference_type;
-		typedef typename checkedVector::reference reference;
-		typedef typename checkedVector::const_reference const_reference;
-
-		checkedVector() {
-		}
-
-		checkedVector(size_type n, const T& value = T())
-		: std::vector<T>(n, value) {
-		}
-
-	//	  checkedVector(iterator i, iterator j)
-	//      : std::vector<T>(i, j) {}
-
-		reference operator[](difference_type index) {
-			assert(index >=0 
-				&& index < static_cast<difference_type>(this->size()));
-			return std::vector<T>::operator[](index);
-		}
-
-
-			const_reference operator[](difference_type index) const {
-			assert(index >=0 
-				&& index < static_cast<difference_type>(this->size()));
-			return std::vector<T>::operator[](index);
-		}
-
-	};
-}
-
-
-#endif
-
+/************************************************************************************
+ TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+// include/checkvec : vector class with checked limits
+#ifndef CHECKVEC_H 
+#define CHECKVEC_H
+#include<cassert>
+#include<vector>
+
+namespace br_stl
+{
+	template<class T>
+	class checkedVector : public std::vector<T>
+	{
+	public:
+		// inherited types
+		typedef typename checkedVector::size_type size_type;
+		typedef typename checkedVector::iterator iterator;
+		typedef typename checkedVector::difference_type difference_type;
+		typedef typename checkedVector::reference reference;
+		typedef typename checkedVector::const_reference const_reference;
+
+		checkedVector() {
+		}
+
+		checkedVector(size_type n, const T& value = T())
+		: std::vector<T>(n, value) {
+		}
+
+	//	  checkedVector(iterator i, iterator j)
+	//      : std::vector<T>(i, j) {}
+
+		reference operator[](difference_type index) {
+			assert(index >=0 
+				&& index < static_cast<difference_type>(this->size()));
+			return std::vector<T>::operator[](index);
+		}
+
+
+			const_reference operator[](difference_type index) const {
+			assert(index >=0 
+				&& index < static_cast<difference_type>(this->size()));
+			return std::vector<T>::operator[](index);
+		}
+
+	};
+}
+
+
+#endif
+
diff --git a/src/terralib/kernel/dynpq.h b/src/terralib/kernel/dynpq.h
old mode 100755
new mode 100644
index ba4c184..5b7f5cf
--- a/src/terralib/kernel/dynpq.h
+++ b/src/terralib/kernel/dynpq.h
@@ -1,190 +1,190 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-// include/dynpq.h
-#ifndef DYNPQ_H
-#define DYNPQ_H
-#include<checkvec.h>
-#include<algorithm>
-#include<showseq.h>
-
-namespace br_stl
-{
-	// compares the associated values of passed iterators
-	template<class T>
-	struct IterGreater
-	{
-		bool operator()( T x,  T y) const
-		{
-			return *y < *x;
-		}
-	};
-
-	template <class key_type>
-	class dynamic_priority_queue
-	{
-	public:
-		// public type definitions
-		typedef typename std::vector<key_type>::size_type size_type;
-		typedef typename std::vector<key_type>::difference_type index_type;
-
-		// constructor
-		dynamic_priority_queue(std::vector<key_type>& v);
-
-		// change a value at position 'at'
-		void changeKeyAt(index_type at, key_type k);
-
-		// index of the smallest element (= highest priority)
-		index_type topIndex() const { return c.front() - first; }
-
-		// value of the smallest element (= highest priority)
-		const key_type& topKey() const { return *c.front(); }
-
-		void pop();       // remove smallest element from the heap
-
-		bool empty() const { return csize == 0;}
-		size_type size() const { return csize;}
-
-	private:
-	//    checkedVector<index_type> Indices;      // auxiliary vector ANAP
-		vector<index_type> Indices;      // auxiliary vector
-		typedef typename std::vector<key_type>::iterator randomAccessIterator;
-	//    checkedVector<randomAccessIterator> c;  // heap of iterators  ANAP
-		vector<randomAccessIterator> c;  // heap of iterators 
-		randomAccessIterator first;             // beginning of the external vector
-		IterGreater<randomAccessIterator> comp; // comparison object
-		index_type csize;                       // current heap size
-
-		// heap update (see below)
-		void goUp(index_type);
-		void goDown(index_type);
-	};
-
-	template <class key_type>
-	dynamic_priority_queue<key_type>::dynamic_priority_queue(
-		std::vector<key_type>& v)
-	: Indices(v.size()), c(v.size()), first(v.begin()),
-	csize(v.size())
-	{
-		// store iterators and generate heap
-		for(index_type i = 0; i< csize; ++i) 
-		c[i] = v.begin()+i;
-		make_heap(c.begin(), c.end(), comp);        // STL
-
-		// construct index array
-		for(index_type ii = 0; ii< csize; ++ii) // ANAP i-> ii
-		Indices[c[ii] - first] = ii;
-	}
-
-	template <class key_type>
-	void dynamic_priority_queue<key_type>::changeKeyAt(
-									index_type at, key_type k)
-	{
-	index_type idx = Indices[at];
-
-	//  if (idx < csize) //ANAP
-	// {
-	assert(idx < csize);   // value still present in the queue?
-
-	if(*c[idx] != k)       // in case of equality, do nothing
-		if(k > *c[idx])
-		{
-			*c[idx] = k;   // enter heavier value
-			goDown(idx);   // reorganize heap
-		}
-		else
-		{
-			*c[idx] = k;   // enter lighter value
-			goUp(idx);     // reorganize heap
-		}
-	//	 }
-	// else cout << "erro no dynamic_priority_queue<key_type>::changeKeyAt" << idx << csize << k << endl;
-	}
-
-	template <class key_type>
-	void dynamic_priority_queue<key_type>::goUp(index_type idx)
-	{
-		index_type Predecessor = (idx-1)/2;
-		randomAccessIterator temp = c[idx];
-
-		while(Predecessor != idx && comp(c[Predecessor], temp))
-		{
-			c[idx] = c[Predecessor];
-			Indices[c[idx]-first] = idx;
-			idx = Predecessor;
-			Predecessor = (idx-1)/2;
-		}
-	    
-		c[idx] = temp;
-		Indices[c[idx]-first] = idx;
-	}
-
-	template <class key_type>
-	void dynamic_priority_queue<key_type>::goDown(index_type idx)
-	{
-		index_type Successor = (idx+1)*2-1;
-
-		if(Successor < csize-1
-			&& comp(c[Successor], c[Successor+1]))
-			++Successor;
-		randomAccessIterator temp = c[idx];
-
-		while(Successor < csize && comp(temp, c[Successor]))
-		{
-			c[idx] = c[Successor];
-			Indices[c[idx]-first] = idx;
-			idx = Successor;
-			Successor = (idx+1)*2-1;
-
-			if(Successor < csize-1
-			&& comp(c[Successor], c[Successor+1]))
-				++Successor;
-		}
-		c[idx] = temp;
-		Indices[c[idx]-first] = idx;
-	}
-
-	/* The method pop() removes the topmost element from the heap. This is
-	done by moving the last element to the top and blocking the freed
-	position with --csize. Subsequently, the element sinks down to its
-	proper position. */
-
-	template <class key_type>
-	void dynamic_priority_queue<key_type>::pop()
-	{
-	// overwrite iterator at the top with the 
-	// address of the last element
-	c[0] = c[--csize];
-
-	// enter the new address 0 at the position belonging 
-	// to this element in the auxiliary array
-	Indices[c[0]-first] = 0;
-
-	// let the element at the top sink to the correct
-	// position corresponding to its weight
-	goDown(0);
-	}
-
-} // namespace br_stl
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+// include/dynpq.h
+#ifndef DYNPQ_H
+#define DYNPQ_H
+#include<checkvec.h>
+#include<algorithm>
+#include<showseq.h>
+
+namespace br_stl
+{
+	// compares the associated values of passed iterators
+	template<class T>
+	struct IterGreater
+	{
+		bool operator()( T x,  T y) const
+		{
+			return *y < *x;
+		}
+	};
+
+	template <class key_type>
+	class dynamic_priority_queue
+	{
+	public:
+		// public type definitions
+		typedef typename std::vector<key_type>::size_type size_type;
+		typedef typename std::vector<key_type>::difference_type index_type;
+
+		// constructor
+		dynamic_priority_queue(std::vector<key_type>& v);
+
+		// change a value at position 'at'
+		void changeKeyAt(index_type at, key_type k);
+
+		// index of the smallest element (= highest priority)
+		index_type topIndex() const { return c.front() - first; }
+
+		// value of the smallest element (= highest priority)
+		const key_type& topKey() const { return *c.front(); }
+
+		void pop();       // remove smallest element from the heap
+
+		bool empty() const { return csize == 0;}
+		size_type size() const { return csize;}
+
+	private:
+	//    checkedVector<index_type> Indices;      // auxiliary vector ANAP
+		vector<index_type> Indices;      // auxiliary vector
+		typedef typename std::vector<key_type>::iterator randomAccessIterator;
+	//    checkedVector<randomAccessIterator> c;  // heap of iterators  ANAP
+		vector<randomAccessIterator> c;  // heap of iterators 
+		randomAccessIterator first;             // beginning of the external vector
+		IterGreater<randomAccessIterator> comp; // comparison object
+		index_type csize;                       // current heap size
+
+		// heap update (see below)
+		void goUp(index_type);
+		void goDown(index_type);
+	};
+
+	template <class key_type>
+	dynamic_priority_queue<key_type>::dynamic_priority_queue(
+		std::vector<key_type>& v)
+	: Indices(v.size()), c(v.size()), first(v.begin()),
+	csize(v.size())
+	{
+		// store iterators and generate heap
+		for(index_type i = 0; i< csize; ++i) 
+		c[i] = v.begin()+i;
+		make_heap(c.begin(), c.end(), comp);        // STL
+
+		// construct index array
+		for(index_type ii = 0; ii< csize; ++ii) // ANAP i-> ii
+		Indices[c[ii] - first] = ii;
+	}
+
+	template <class key_type>
+	void dynamic_priority_queue<key_type>::changeKeyAt(
+									index_type at, key_type k)
+	{
+	index_type idx = Indices[at];
+
+	//  if (idx < csize) //ANAP
+	// {
+	assert(idx < csize);   // value still present in the queue?
+
+	if(*c[idx] != k)       // in case of equality, do nothing
+		if(k > *c[idx])
+		{
+			*c[idx] = k;   // enter heavier value
+			goDown(idx);   // reorganize heap
+		}
+		else
+		{
+			*c[idx] = k;   // enter lighter value
+			goUp(idx);     // reorganize heap
+		}
+	//	 }
+	// else cout << "erro no dynamic_priority_queue<key_type>::changeKeyAt" << idx << csize << k << endl;
+	}
+
+	template <class key_type>
+	void dynamic_priority_queue<key_type>::goUp(index_type idx)
+	{
+		index_type Predecessor = (idx-1)/2;
+		randomAccessIterator temp = c[idx];
+
+		while(Predecessor != idx && comp(c[Predecessor], temp))
+		{
+			c[idx] = c[Predecessor];
+			Indices[c[idx]-first] = idx;
+			idx = Predecessor;
+			Predecessor = (idx-1)/2;
+		}
+	    
+		c[idx] = temp;
+		Indices[c[idx]-first] = idx;
+	}
+
+	template <class key_type>
+	void dynamic_priority_queue<key_type>::goDown(index_type idx)
+	{
+		index_type Successor = (idx+1)*2-1;
+
+		if(Successor < csize-1
+			&& comp(c[Successor], c[Successor+1]))
+			++Successor;
+		randomAccessIterator temp = c[idx];
+
+		while(Successor < csize && comp(temp, c[Successor]))
+		{
+			c[idx] = c[Successor];
+			Indices[c[idx]-first] = idx;
+			idx = Successor;
+			Successor = (idx+1)*2-1;
+
+			if(Successor < csize-1
+			&& comp(c[Successor], c[Successor+1]))
+				++Successor;
+		}
+		c[idx] = temp;
+		Indices[c[idx]-first] = idx;
+	}
+
+	/* The method pop() removes the topmost element from the heap. This is
+	done by moving the last element to the top and blocking the freed
+	position with --csize. Subsequently, the element sinks down to its
+	proper position. */
+
+	template <class key_type>
+	void dynamic_priority_queue<key_type>::pop()
+	{
+	// overwrite iterator at the top with the 
+	// address of the last element
+	c[0] = c[--csize];
+
+	// enter the new address 0 at the position belonging 
+	// to this element in the auxiliary array
+	Indices[c[0]-first] = 0;
+
+	// let the element at the top sink to the correct
+	// position corresponding to its weight
+	goDown(0);
+	}
+
+} // namespace br_stl
+#endif
+
diff --git a/src/terralib/kernel/gra_util.h b/src/terralib/kernel/gra_util.h
old mode 100755
new mode 100644
index 10f7213..3d77e9e
--- a/src/terralib/kernel/gra_util.h
+++ b/src/terralib/kernel/gra_util.h
@@ -1,259 +1,259 @@
-#ifndef GRAPH_UTILITIES_H
-#define GRAPH_UTILITIES_H
-
-#include<place.h>
-#include<graph.h>
-#include<fstream>
-#include<myrandom.h>
-#include<string>
-#include<iostream>
-
-namespace br_stl {
-
-/* During automatic creation of an undirected graph, a name must be
-   generated for each vertex. The following auxiliary function
-   converts the current number into a string object which is entered
-   as identifier. */
-
-// auxiliary function for generating strings out of numbers
-std::string i2string(unsigned int i) {
-    if(i==0) return std::string("0");
-    char buf[] = "0000000000000000";
-    char *pos = buf + sizeof(buf)-1;  // point to end
-   
-    do
-      *--pos = i % 10 + '0';
-    while(i /=10);
-    return std::string(pos);
-}
-
-/* The function create_vertex_set() creates a number of vertices with
-   random coordinates between 0 and maxX or maxY in a graph G
-   according to its size (G.size()). */
-   
-template<class EdgeType>
-void create_vertex_set(Graph<Place, EdgeType>& G,
-                  int count, int maxX, int maxY) {
-    Random xRandom(maxX),
-           yRandom(maxY);
-
-    // create vertices with random coordinates
-    int i = -1;
-    while(++i < count)
-      G.insert(Place(xRandom(), yRandom(),i2string(i)));
-}
-
-template<class EdgeType>
-void connectNeighbors(Graph<Place, EdgeType>& G) {
-    for(size_t i = 0; i < G.size(); ++i) {
-       Place iPlace = G[i].first;
-
-       for(size_t j = i+1; j < G.size(); ++j) {
-          Place jPlace = G[j].first;
-
-          Place MidPoint((iPlace.X()+jPlace.X())/2,
-                         (iPlace.Y()+jPlace.Y())/2);
-
-         /* The following loop is not run-time optimized. A possible
-            optimization could be to sort the places by their x
-            coordinates so that only a small relevant range must be
-            searched. The relevant range results from the fact that
-            the places to be compared must lie inside a circle around
-            the mid-point whose diameter is equal to the distance
-            between the places i and j. */
-
-          size_t k = 0;
-          unsigned long int e2 = DistSquare(iPlace, MidPoint);
-
-          while(k < G.size()) {      // not run-time optimized
-             if(k != j && k != i &&
-                DistSquare(G[k].first, MidPoint) < e2)
-                    break;
-             ++k;
-          }
-
-          if(k == G.size())  {// no nearer place found
-             EdgeType dist = Distance(iPlace, jPlace);
-             G.connectVertices(i, j, dist);
-          }
-       }
-    }
-}
-
-
-// Only for undirected graphs!
-template<class EdgeType>
-void createTeXfile(const char * Filename,
-                   Graph<Place, EdgeType>& G,
-                   double ScalingFactor,
-                   int xMax, int yMax) {
-    assert(!G.isDirected());
-    std::ofstream Output(Filename);
-
-    if(!Output) {
-        std::cerr << Filename
-             << " cannot be opened!\n";
-        exit(1);
-    }
-
-    Output  << "%% This is a generated file!\n"
-         << "\\unitlength 1.00mm\n"
-         << "\\begin{picture}("
-         << xMax << ','
-         << yMax << ")\n";
-
-    for(size_t iv = 0; iv < G.size(); ++iv) {
-       // Point
-       Output << "\\put("
-               << G[iv].first.X()*ScalingFactor
-               << ','
-               << G[iv].first.Y()*ScalingFactor
-               << "){\\circle*{1.0}}\n";
-
-       // node name
-       Output << "\\put("
-               << (1.0 + G[iv].first.X()*ScalingFactor)
-               << ','
-               << G[iv].first.Y()*ScalingFactor
-               << "){\\makebox(0,0)[lb]{{\\tiny "
-               << G[iv].first            // name
-               << "}}}\n";
-
-       /* All edges are drawn. In order to prevent them from appearing
-          twice in the undirected graph, they are only drawn in the
-          direction of the greater index. */
-
-       typename Graph<Place,EdgeType>::Successor::const_iterator I =
-         //       std::map< int, EdgeType >::const_iterator I =
-                           G[iv].second.begin();
-
-       while(I != G[iv].second.end()) {
-          size_t n = (*I).first;
-          if(n > iv) {             // otherwise, ignore
-             double x1,x2,y1,y2,dx,dy;
-             x1 =  G[iv].first.X()*ScalingFactor;
-             y1 =  G[iv].first.Y()*ScalingFactor;
-             x2 =  G[n].first.X()*ScalingFactor;
-             y2 =  G[n].first.Y()*ScalingFactor;
-             dx = x2-x1; dy = y2-y1;
-             double dist = std::sqrt(dx*dx+dy*dy);
-             int wdh = int(5*dist);
-             dx = dx/wdh; dy = dy/wdh;
-             Output << "\\multiput(" << x1 << "," << y1 << ")("
-              << dx << "," << dy << "){" << wdh
-                   << "}{\\circle*{0.1}}\n";
-          }
-          ++I;
-       }
-    }
-    Output << "\\end{picture}\n";
-}
-
-/* This is similar to createTeXfile, but creates
-   metapost-output which can with metapost directly
-   be converted to postscript. The adaption of this routine
-   was made by Andreas Scherer.
-   Only for undirected graphs! */
-
-template<class EdgeType>
-void createMPfile(char * Filename,
-                  Graph<Place, EdgeType>& G,
-                  double ScalingFactor) {
-    assert(!G.isDirected());
-    std::ofstream Output(Filename);
-
-    if(!Output) {
-        std::cerr << Filename
-             << " cannot be opened!\n";
-        exit(1);
-    }
-
-    Output  << "%%%% createMPfile(): This is a generated file!\n"
-         << "input boxes\n\n"
-         << "beginfig(1);\nu=1mm; % unitlength\n"
-         << "defaultscale := 0.8; % small numbers\n";
-
-    for(register size_t iv = 0; iv < G.size(); ++iv) {
-       // Point
-       Output << " drawdot( "
-               << G[iv].first.X()*ScalingFactor
-               << "u, "
-               << G[iv].first.Y()*ScalingFactor
-               << "u)  withpen pencircle scaled 1mm;\n";
-
-       // node name
-       Output << " label.urt( \""
-              << G[iv].first << "\", ( "
-               << G[iv].first.X()*ScalingFactor
-               << "u, "
-               << G[iv].first.Y()*ScalingFactor
-               << "u) ); " << std::endl;
-
-       /* All edges are drawn. In order to prevent them from appearing
-          twice in the undirected graph, they are only drawn in the
-          direction of the greater index. */
-
-
-       typename Graph<Place, EdgeType>::Successor::const_iterator I =
-         //        std:: map<int, EdgeType>::const_iterator I =
-                           G[iv].second.begin();
-
-       while(I != G[iv].second.end()) {
-          size_t n = (*I).first;
-          if(n > iv) {             // otherwise, ignore
-             Output << "  draw ( "
-                    << G[iv].first.X()*ScalingFactor << "u, "
-                    << G[iv].first.Y()*ScalingFactor 
-                    << "u ) -- ( "
-                    << G[n].first.X()*ScalingFactor << "u, "
-                    << G[n].first.Y()*ScalingFactor
-                    << "u );" << std::endl;
-          }
-          ++I;
-       }
-    }
-    Output << "endfig;" << std::endl << "end." << std::endl;
-}
-
-/* This function (written by A. Scherer) writes a path
-   within a graph as a separate metapost-file */
-
-template<class EdgeType>
-void writeMPpath(char * Filename,
-                 Graph<Place, EdgeType>& G,
-                 std::vector< int >& V,
-                 double ScalingFactor,
-                 int Start) {
-    std::ofstream Output(Filename);
-
-    if(!Output) {
-        std::cerr << Filename
-             << " cannot be opened!\n";
-        exit(1);
-    }
-
-    Output  << "%%%% writeMPpath(): This is a generated file!\n"
-            << "beginfig( 1 );\nu=1mm; % unitlength" << std::endl
-            << "pickup pencircle scaled 2pt;\n"  // line width
-            << "  draw ( "
-            << G[ Start ].first.X() * ScalingFactor
-         << "u, "
-         << G[ Start ].first.Y() * ScalingFactor
-         << "u)";
-
-     while ( V[ Start ] >= 0 ) {
-         int Successor = V[ Start ];
-         Output << std::endl << "    -- ( "
-             << G[ Successor ].first.X() * ScalingFactor
-             << "u, "
-             << G[ Successor ].first.Y() * ScalingFactor
-             << " u)";
-         Start = Successor;
-     }
-     Output << ";\n" << "endfig;\n" << "end." << std::endl;
-}
-
-} // namespace br_stl
-
-#endif  // graphUtilities
-
+#ifndef GRAPH_UTILITIES_H
+#define GRAPH_UTILITIES_H
+
+#include<place.h>
+#include<graph.h>
+#include<fstream>
+#include<myrandom.h>
+#include<string>
+#include<iostream>
+
+namespace br_stl {
+
+/* During automatic creation of an undirected graph, a name must be
+   generated for each vertex. The following auxiliary function
+   converts the current number into a string object which is entered
+   as identifier. */
+
+// auxiliary function for generating strings out of numbers
+std::string i2string(unsigned int i) {
+    if(i==0) return std::string("0");
+    char buf[] = "0000000000000000";
+    char *pos = buf + sizeof(buf)-1;  // point to end
+   
+    do
+      *--pos = i % 10 + '0';
+    while(i /=10);
+    return std::string(pos);
+}
+
+/* The function create_vertex_set() creates a number of vertices with
+   random coordinates between 0 and maxX or maxY in a graph G
+   according to its size (G.size()). */
+   
+template<class EdgeType>
+void create_vertex_set(Graph<Place, EdgeType>& G,
+                  int count, int maxX, int maxY) {
+    Random xRandom(maxX),
+           yRandom(maxY);
+
+    // create vertices with random coordinates
+    int i = -1;
+    while(++i < count)
+      G.insert(Place(xRandom(), yRandom(),i2string(i)));
+}
+
+template<class EdgeType>
+void connectNeighbors(Graph<Place, EdgeType>& G) {
+    for(size_t i = 0; i < G.size(); ++i) {
+       Place iPlace = G[i].first;
+
+       for(size_t j = i+1; j < G.size(); ++j) {
+          Place jPlace = G[j].first;
+
+          Place MidPoint((iPlace.X()+jPlace.X())/2,
+                         (iPlace.Y()+jPlace.Y())/2);
+
+         /* The following loop is not run-time optimized. A possible
+            optimization could be to sort the places by their x
+            coordinates so that only a small relevant range must be
+            searched. The relevant range results from the fact that
+            the places to be compared must lie inside a circle around
+            the mid-point whose diameter is equal to the distance
+            between the places i and j. */
+
+          size_t k = 0;
+          unsigned long int e2 = DistSquare(iPlace, MidPoint);
+
+          while(k < G.size()) {      // not run-time optimized
+             if(k != j && k != i &&
+                DistSquare(G[k].first, MidPoint) < e2)
+                    break;
+             ++k;
+          }
+
+          if(k == G.size())  {// no nearer place found
+             EdgeType dist = Distance(iPlace, jPlace);
+             G.connectVertices(i, j, dist);
+          }
+       }
+    }
+}
+
+
+// Only for undirected graphs!
+template<class EdgeType>
+void createTeXfile(const char * Filename,
+                   Graph<Place, EdgeType>& G,
+                   double ScalingFactor,
+                   int xMax, int yMax) {
+    assert(!G.isDirected());
+    std::ofstream Output(Filename);
+
+    if(!Output) {
+        std::cerr << Filename
+             << " cannot be opened!\n";
+        exit(1);
+    }
+
+    Output  << "%% This is a generated file!\n"
+         << "\\unitlength 1.00mm\n"
+         << "\\begin{picture}("
+         << xMax << ','
+         << yMax << ")\n";
+
+    for(size_t iv = 0; iv < G.size(); ++iv) {
+       // Point
+       Output << "\\put("
+               << G[iv].first.X()*ScalingFactor
+               << ','
+               << G[iv].first.Y()*ScalingFactor
+               << "){\\circle*{1.0}}\n";
+
+       // node name
+       Output << "\\put("
+               << (1.0 + G[iv].first.X()*ScalingFactor)
+               << ','
+               << G[iv].first.Y()*ScalingFactor
+               << "){\\makebox(0,0)[lb]{{\\tiny "
+               << G[iv].first            // name
+               << "}}}\n";
+
+       /* All edges are drawn. In order to prevent them from appearing
+          twice in the undirected graph, they are only drawn in the
+          direction of the greater index. */
+
+       typename Graph<Place,EdgeType>::Successor::const_iterator I =
+         //       std::map< int, EdgeType >::const_iterator I =
+                           G[iv].second.begin();
+
+       while(I != G[iv].second.end()) {
+          size_t n = (*I).first;
+          if(n > iv) {             // otherwise, ignore
+             double x1,x2,y1,y2,dx,dy;
+             x1 =  G[iv].first.X()*ScalingFactor;
+             y1 =  G[iv].first.Y()*ScalingFactor;
+             x2 =  G[n].first.X()*ScalingFactor;
+             y2 =  G[n].first.Y()*ScalingFactor;
+             dx = x2-x1; dy = y2-y1;
+             double dist = std::sqrt(dx*dx+dy*dy);
+             int wdh = int(5*dist);
+             dx = dx/wdh; dy = dy/wdh;
+             Output << "\\multiput(" << x1 << "," << y1 << ")("
+              << dx << "," << dy << "){" << wdh
+                   << "}{\\circle*{0.1}}\n";
+          }
+          ++I;
+       }
+    }
+    Output << "\\end{picture}\n";
+}
+
+/* This is similar to createTeXfile, but creates
+   metapost-output which can with metapost directly
+   be converted to postscript. The adaption of this routine
+   was made by Andreas Scherer.
+   Only for undirected graphs! */
+
+template<class EdgeType>
+void createMPfile(char * Filename,
+                  Graph<Place, EdgeType>& G,
+                  double ScalingFactor) {
+    assert(!G.isDirected());
+    std::ofstream Output(Filename);
+
+    if(!Output) {
+        std::cerr << Filename
+             << " cannot be opened!\n";
+        exit(1);
+    }
+
+    Output  << "%%%% createMPfile(): This is a generated file!\n"
+         << "input boxes\n\n"
+         << "beginfig(1);\nu=1mm; % unitlength\n"
+         << "defaultscale := 0.8; % small numbers\n";
+
+    for(register size_t iv = 0; iv < G.size(); ++iv) {
+       // Point
+       Output << " drawdot( "
+               << G[iv].first.X()*ScalingFactor
+               << "u, "
+               << G[iv].first.Y()*ScalingFactor
+               << "u)  withpen pencircle scaled 1mm;\n";
+
+       // node name
+       Output << " label.urt( \""
+              << G[iv].first << "\", ( "
+               << G[iv].first.X()*ScalingFactor
+               << "u, "
+               << G[iv].first.Y()*ScalingFactor
+               << "u) ); " << std::endl;
+
+       /* All edges are drawn. In order to prevent them from appearing
+          twice in the undirected graph, they are only drawn in the
+          direction of the greater index. */
+
+
+       typename Graph<Place, EdgeType>::Successor::const_iterator I =
+         //        std:: map<int, EdgeType>::const_iterator I =
+                           G[iv].second.begin();
+
+       while(I != G[iv].second.end()) {
+          size_t n = (*I).first;
+          if(n > iv) {             // otherwise, ignore
+             Output << "  draw ( "
+                    << G[iv].first.X()*ScalingFactor << "u, "
+                    << G[iv].first.Y()*ScalingFactor 
+                    << "u ) -- ( "
+                    << G[n].first.X()*ScalingFactor << "u, "
+                    << G[n].first.Y()*ScalingFactor
+                    << "u );" << std::endl;
+          }
+          ++I;
+       }
+    }
+    Output << "endfig;" << std::endl << "end." << std::endl;
+}
+
+/* This function (written by A. Scherer) writes a path
+   within a graph as a separate metapost-file */
+
+template<class EdgeType>
+void writeMPpath(char * Filename,
+                 Graph<Place, EdgeType>& G,
+                 std::vector< int >& V,
+                 double ScalingFactor,
+                 int Start) {
+    std::ofstream Output(Filename);
+
+    if(!Output) {
+        std::cerr << Filename
+             << " cannot be opened!\n";
+        exit(1);
+    }
+
+    Output  << "%%%% writeMPpath(): This is a generated file!\n"
+            << "beginfig( 1 );\nu=1mm; % unitlength" << std::endl
+            << "pickup pencircle scaled 2pt;\n"  // line width
+            << "  draw ( "
+            << G[ Start ].first.X() * ScalingFactor
+         << "u, "
+         << G[ Start ].first.Y() * ScalingFactor
+         << "u)";
+
+     while ( V[ Start ] >= 0 ) {
+         int Successor = V[ Start ];
+         Output << std::endl << "    -- ( "
+             << G[ Successor ].first.X() * ScalingFactor
+             << "u, "
+             << G[ Successor ].first.Y() * ScalingFactor
+             << " u)";
+         Start = Successor;
+     }
+     Output << ";\n" << "endfig;\n" << "end." << std::endl;
+}
+
+} // namespace br_stl
+
+#endif  // graphUtilities
+
diff --git a/src/terralib/kernel/graph.h b/src/terralib/kernel/graph.h
old mode 100755
new mode 100644
index 0f19e16..1c21b70
--- a/src/terralib/kernel/graph.h
+++ b/src/terralib/kernel/graph.h
@@ -1,379 +1,379 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file graph.h
-    \brief This file contains structures and definitions used to manipulate a graph strucutre
-	\note this code came from the book "Desining Components with C++ STL" -
-	Ulrich Breymann - Addison-Wesley - pag 243
-*/
-#ifndef GRAPH_H
-#define GRAPH_H
-#include<cassert>
-#include<vector>
-#include<map>
-#include<stack>
-#include<iostream>
-#include <TeDefines.h>
-
-namespace br_stl
-{
-	// empty parameter class with a minimal set of operations
-	// if there are no weights for edges necessary
-	struct TL_DLL Empty
-	{
-	public:
-		Empty(int=0) {}
-		bool operator<(const Empty&) const { return true;}
-	};
-
-	inline std::ostream& operator<<(std::ostream& os, const Empty&) { return os;}
-	inline std::istream& operator>>(std::istream& is, Empty& ) { return is;}
-
-	template<class VertexType, class EdgeType>
-	class Graph
-	{
-	public:
-		// public type interface
-		typedef std::map<int, EdgeType > Successor;
-		typedef std::pair<VertexType, Successor> vertex;
-		typedef std::vector<vertex> GraphType;
-		typedef typename GraphType::iterator iterator;
-		typedef typename GraphType::const_iterator const_iterator;
-
-		/* The following constructor initializes the output channel with
-		cerr. A parameter must be specified as to whether the graph is
-		directed or undirected, because this is an essential property
-		of a graph. */
-
-		Graph(bool g, std::ostream& os = cerr)
-		: directed(g), pOut(&os) 
-		{ }
-
-		bool isDirected() const { return directed;}
-
-		/* A graph is a special kind of container to which something can
-		be added and whose elements can be accessed. Therefore, typical
-		container methods follow, which in their extent are limited to
-		those needed in the book's examples. Thus, there is no method
-		for explicit removal of a vertex or an edge from the graph. */
-
-		size_t size() const  { return C.size();}
-
-		iterator begin()     { return C.begin();}
-		iterator end()       { return C.end();}
-
-		// access to vertex i}
-		vertex& operator[](int i)
-		{
-			// the access is safe, because C is a checkedVector
-			return C[i];
-		}
-
-		// return the position of the vertex, if it does not exist return -1
-		int getPosition(const VertexType& e); 
-
-		// addition of a vertex
-		int  insert(const VertexType& e);
-
-		// addition of an edge between e1 and e2
-		void insert(const VertexType& e1, const VertexType& e2,
-					const EdgeType& Value);
-
-		// addition of an edge between vertices no. i and j
-		void connectVertices(int i, int j, const EdgeType& Value);
-
-		// set the edge value between vertices no. i and j
-		bool setEdgeValue(const VertexType& e1, const VertexType& e2, const EdgeType& Value);
-
-		/* The following methods are useful tools for displaying
-		information on a graph and check its structure.*/
-
-		// checking of a read data model
-		// output on the channel passed to check()
-		void check(std::ostream& = std::cout);
-
-		// determine the number of edges
-		size_t CountEdges();
-
-		/* determine whether the graph contains cycles and in which way it
-		is connected. The method combines two tasks, because they can
-		be carried out in a single run.*/
-		void CycleAndConnect(std::ostream& = cout);
-		int sucessors(int index);
-
-	private:
-		bool directed;
-		GraphType C;          // container
-		std::ostream* pOut;
-	};      // class Graph
-
-
-	template<class VertexType, class EdgeType>
-	int Graph<VertexType,EdgeType>::getPosition(const VertexType& e) 
-	{
-		for(size_t i = 0; i < size(); ++i)
-		if(e == C[i].first)
-			return i;
-
-		return -1;
-	}
-		
-	/* In order to avoid ambiguities, a vertex is only entered if it does
-	not yet exist. The sequential search is not particularly fast; on the
-	other hand, this process is only needed once during the construction
-	of the graph. The position of the vertex is returned. */
-
-	template<class VertexType, class EdgeType>
-	int Graph<VertexType,EdgeType>::insert(const VertexType& e) 
-	{
-		int pos = getPosition(e);
-		if(pos<0)
-		{
-			// if not found, insert:
-			C.push_back(vertex(e, Successor()));
-			return size()-1;
-		}
-
-		return pos;
-	}
-
-	/* An edge is inserted by first inserting the vertices, if needed, and
-	by determining their positions. The edge construction itself is 
-	carried out by the function connectVertices(). It is passed the
-	vertex numbers and, because of the absence of a search procedure, 
-	it is very fast. */
-
-	template<class VertexType, class EdgeType>
-	void Graph<VertexType,EdgeType>::insert(const VertexType& e1,
-										const VertexType& e2,
-										const EdgeType& Value)
-	{
-		int pos1 = insert(e1);
-		int pos2 = insert(e2);
-		connectVertices(pos1, pos2, Value);
-	}
-
-	template<class VertexType, class EdgeType>
-	void Graph<VertexType,EdgeType>::connectVertices(
-				int pos1, int pos2, const EdgeType& Value) 
-	{
-		(C[pos1].second)[pos2] = Value;
-
-		if(!directed)  // automatically insert opposite direction too
-		(C[pos2].second)[pos1] = Value;
-	}
-
-	template<class VertexType, class EdgeType>
-	bool Graph<VertexType,EdgeType>::setEdgeValue(const VertexType& e1,
-										const VertexType& e2,
-										const EdgeType& Value) 
-	{
-		int pos1 = getPosition(e1);
-		int pos2 = getPosition(e2);
-
-		if((pos1<0) || (pos2<0))
-			return false;
-
-		(C[pos1].second)[pos2] = Value;
-
-		if(!directed)  // automatically insert opposite direction too
-		(C[pos1].second)[pos2] = Value;
-
-		return true;
-	}
-
-
-	template<class VertexType, class EdgeType>
-	void Graph<VertexType,EdgeType>::check(std::ostream& os)
-	{
-		os << "The graph is ";
-		if(!isDirected())
-			os << "un";
-
-		os << "directed and has "
-		<< size() << " vertices and "
-		<< CountEdges()
-		<< " edges\n";
-		CycleAndConnect(os);
-	}
-
-	template<class VertexType, class EdgeType>
-	size_t Graph<VertexType,EdgeType>::CountEdges()
-	{
-		size_t edges = 0;
-		iterator temp = begin();
-
-		while(temp != end())
-			edges += (*temp++).second.size();
-
-		if(!directed)
-			edges /= 2;
-		return edges;
-	}
-
-	// Type for next function
-	enum VertStatus {notVisited, visited, processed};
-
-	template<class VertexType, class EdgeType>
-	int Graph<VertexType, EdgeType>::sucessors(int index) {
-		typename Successor::const_iterator
-		start  = operator[](index).second.begin(),
-		end    = operator[](index).second.end();
-		int nSucc = 0;
-		while(start != end)
-		{
-			nSucc++;
-			++start;
-		}
-
-		return nSucc;
-	}
-	template<class VertexType, class EdgeType>
-	void Graph<VertexType, EdgeType>::CycleAndConnect(std::ostream& os) {
-		int Cycles = 0;
-		int ComponentNumber = 0;
-		std::stack<int, std::vector<int> > verticesStack;  // vertices to be visited
-
-		/* In order to prevent multiple visits to vertices in possible
-		cycles, which entails the risk of infinite loops, the vertices
-		are marked for having been visited or finished being processed.
-		This purpose is served by the vector VertexState. */
-	       
-		// assign all vertices the state `not visited'
-		std::vector<VertStatus> VertexState(size(), notVisited);
-
-		/* If, starting from one vertex, an attempt is made to reach all
-		other vertices, success is not guaranteed in weakly or
-		non-connected graphs. Therefore, each vertex is visited. If it
-		is found that a vertex has already been visited, it does not
-		need to be processed any further. */
-
-		// visit all vertices
-		for(size_t i = 0; i < size(); ++i)
-		{
-			if(VertexState[i] == notVisited)
-			{
-				++ComponentNumber;
-				// store on stack for further processing
-				verticesStack.push(i);
-
-				// process stack
-				while(!verticesStack.empty())
-				{
-					int theVertex = verticesStack.top();
-					verticesStack.pop();
-					if(VertexState[theVertex] == visited)
-					VertexState[theVertex] = processed;
-					else
-					if(VertexState[theVertex] == notVisited)
-					{
-						VertexState[theVertex] = visited;
-						// new vertex, earmark for processed mark
-						verticesStack.push(theVertex);
-
-						/* If one of the successors of a newly found vertex
-							bears the visited mark, the algorithm has already
-							passed this point once, and there is a cycle. */
-		                     
-						// earmark successor:
-						typename Successor::const_iterator
-							start  = operator[](theVertex).second.begin(),
-							end    = operator[](theVertex).second.end();
-
-						while(start != end)
-						{
-							int Succ = (*start).first;
-
-							if(VertexState[Succ] == visited)
-							{
-								++Cycles;   // someone's been here already!
-								(*pOut) << "at least vertex "
-								<< operator[](Succ).first
-								<< " lies in a cycle\n";
-							}
-
-							/* Otherwise, the vertex has already been
-								processed and therefore should not be
-								considered again, or it has not yet been
-								visited and is earmarked on the stack. */
-		                          
-							if(VertexState[Succ] == notVisited)
-								verticesStack.push(Succ);
-							++start;
-						}
-					}
-				}  // stack empty?
-			}     //  if(VertexState}...
-		}       // for()} ...
-
-		/* Now we only need the output. In case of directed, weakly
-		connected graphs, the algorithm counts several components. In
-		order to make the output conform to the above definitions,
-		although with less content of information, a distinction is
-		made as to whether the graph is directed or not. */
-
-		if(directed)
-		{
-			if(ComponentNumber == 1)
-				os << "The graph is strongly connected.\n";
-			else
-				os << "The graph is not or weakly "
-					"connected.\n";
-		}
-		else
-			os	<< "The graph has "
-				<< ComponentNumber
-				<< " component(s)." << std::endl;
-
-		os << "The graph has ";
-		if(Cycles == 0)
-			os << "no ";
-		os << "cycles." << std::endl;
-	}
-
-	template<class VertexType, class EdgeType>
-	std::ostream& operator<<(std::ostream& os, Graph<VertexType,EdgeType>& G)
-	{
-		// display of vertices with successors
-		for(size_t i = 0; i < G.size(); ++i)
-		{
-			os << G[i].first << " <";
-			typename Graph<VertexType,EdgeType>::Successor::const_iterator
-								startN = G[i].second.begin(),
-								endN   = G[i].second.end();
-
-			while(startN != endN)
-			{
-				os << G[(*startN).first].first << ' ' // vertex
-				<< (*startN).second << ' ';        // edge value
-				++startN;
-			}
-			os << ">" << std::endl;
-		}
-		return os;
-	}
-} // namespace br_stl
-
-
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file graph.h
+    \brief This file contains structures and definitions used to manipulate a graph strucutre
+	\note this code came from the book "Desining Components with C++ STL" -
+	Ulrich Breymann - Addison-Wesley - pag 243
+*/
+#ifndef GRAPH_H
+#define GRAPH_H
+#include<cassert>
+#include<vector>
+#include<map>
+#include<stack>
+#include<iostream>
+#include <TeDefines.h>
+
+namespace br_stl
+{
+	// empty parameter class with a minimal set of operations
+	// if there are no weights for edges necessary
+	struct TL_DLL Empty
+	{
+	public:
+		Empty(int=0) {}
+		bool operator<(const Empty&) const { return true;}
+	};
+
+	inline std::ostream& operator<<(std::ostream& os, const Empty&) { return os;}
+	inline std::istream& operator>>(std::istream& is, Empty& ) { return is;}
+
+	template<class VertexType, class EdgeType>
+	class Graph
+	{
+	public:
+		// public type interface
+		typedef std::map<int, EdgeType > Successor;
+		typedef std::pair<VertexType, Successor> vertex;
+		typedef std::vector<vertex> GraphType;
+		typedef typename GraphType::iterator iterator;
+		typedef typename GraphType::const_iterator const_iterator;
+
+		/* The following constructor initializes the output channel with
+		cerr. A parameter must be specified as to whether the graph is
+		directed or undirected, because this is an essential property
+		of a graph. */
+
+		Graph(bool g, std::ostream& os = cerr)
+		: directed(g), pOut(&os) 
+		{ }
+
+		bool isDirected() const { return directed;}
+
+		/* A graph is a special kind of container to which something can
+		be added and whose elements can be accessed. Therefore, typical
+		container methods follow, which in their extent are limited to
+		those needed in the book's examples. Thus, there is no method
+		for explicit removal of a vertex or an edge from the graph. */
+
+		size_t size() const  { return C.size();}
+
+		iterator begin()     { return C.begin();}
+		iterator end()       { return C.end();}
+
+		// access to vertex i}
+		vertex& operator[](int i)
+		{
+			// the access is safe, because C is a checkedVector
+			return C[i];
+		}
+
+		// return the position of the vertex, if it does not exist return -1
+		int getPosition(const VertexType& e); 
+
+		// addition of a vertex
+		int  insert(const VertexType& e);
+
+		// addition of an edge between e1 and e2
+		void insert(const VertexType& e1, const VertexType& e2,
+					const EdgeType& Value);
+
+		// addition of an edge between vertices no. i and j
+		void connectVertices(int i, int j, const EdgeType& Value);
+
+		// set the edge value between vertices no. i and j
+		bool setEdgeValue(const VertexType& e1, const VertexType& e2, const EdgeType& Value);
+
+		/* The following methods are useful tools for displaying
+		information on a graph and check its structure.*/
+
+		// checking of a read data model
+		// output on the channel passed to check()
+		void check(std::ostream& = std::cout);
+
+		// determine the number of edges
+		size_t CountEdges();
+
+		/* determine whether the graph contains cycles and in which way it
+		is connected. The method combines two tasks, because they can
+		be carried out in a single run.*/
+		void CycleAndConnect(std::ostream& = cout);
+		int sucessors(int index);
+
+	private:
+		bool directed;
+		GraphType C;          // container
+		std::ostream* pOut;
+	};      // class Graph
+
+
+	template<class VertexType, class EdgeType>
+	int Graph<VertexType,EdgeType>::getPosition(const VertexType& e) 
+	{
+		for(size_t i = 0; i < size(); ++i)
+		if(e == C[i].first)
+			return i;
+
+		return -1;
+	}
+		
+	/* In order to avoid ambiguities, a vertex is only entered if it does
+	not yet exist. The sequential search is not particularly fast; on the
+	other hand, this process is only needed once during the construction
+	of the graph. The position of the vertex is returned. */
+
+	template<class VertexType, class EdgeType>
+	int Graph<VertexType,EdgeType>::insert(const VertexType& e) 
+	{
+		int pos = getPosition(e);
+		if(pos<0)
+		{
+			// if not found, insert:
+			C.push_back(vertex(e, Successor()));
+			return size()-1;
+		}
+
+		return pos;
+	}
+
+	/* An edge is inserted by first inserting the vertices, if needed, and
+	by determining their positions. The edge construction itself is 
+	carried out by the function connectVertices(). It is passed the
+	vertex numbers and, because of the absence of a search procedure, 
+	it is very fast. */
+
+	template<class VertexType, class EdgeType>
+	void Graph<VertexType,EdgeType>::insert(const VertexType& e1,
+										const VertexType& e2,
+										const EdgeType& Value)
+	{
+		int pos1 = insert(e1);
+		int pos2 = insert(e2);
+		connectVertices(pos1, pos2, Value);
+	}
+
+	template<class VertexType, class EdgeType>
+	void Graph<VertexType,EdgeType>::connectVertices(
+				int pos1, int pos2, const EdgeType& Value) 
+	{
+		(C[pos1].second)[pos2] = Value;
+
+		if(!directed)  // automatically insert opposite direction too
+		(C[pos2].second)[pos1] = Value;
+	}
+
+	template<class VertexType, class EdgeType>
+	bool Graph<VertexType,EdgeType>::setEdgeValue(const VertexType& e1,
+										const VertexType& e2,
+										const EdgeType& Value) 
+	{
+		int pos1 = getPosition(e1);
+		int pos2 = getPosition(e2);
+
+		if((pos1<0) || (pos2<0))
+			return false;
+
+		(C[pos1].second)[pos2] = Value;
+
+		if(!directed)  // automatically insert opposite direction too
+		(C[pos1].second)[pos2] = Value;
+
+		return true;
+	}
+
+
+	template<class VertexType, class EdgeType>
+	void Graph<VertexType,EdgeType>::check(std::ostream& os)
+	{
+		os << "The graph is ";
+		if(!isDirected())
+			os << "un";
+
+		os << "directed and has "
+		<< size() << " vertices and "
+		<< CountEdges()
+		<< " edges\n";
+		CycleAndConnect(os);
+	}
+
+	template<class VertexType, class EdgeType>
+	size_t Graph<VertexType,EdgeType>::CountEdges()
+	{
+		size_t edges = 0;
+		iterator temp = begin();
+
+		while(temp != end())
+			edges += (*temp++).second.size();
+
+		if(!directed)
+			edges /= 2;
+		return edges;
+	}
+
+	// Type for next function
+	enum VertStatus {notVisited, visited, processed};
+
+	template<class VertexType, class EdgeType>
+	int Graph<VertexType, EdgeType>::sucessors(int index) {
+		typename Successor::const_iterator
+		start  = operator[](index).second.begin(),
+		end    = operator[](index).second.end();
+		int nSucc = 0;
+		while(start != end)
+		{
+			nSucc++;
+			++start;
+		}
+
+		return nSucc;
+	}
+	template<class VertexType, class EdgeType>
+	void Graph<VertexType, EdgeType>::CycleAndConnect(std::ostream& os) {
+		int Cycles = 0;
+		int ComponentNumber = 0;
+		std::stack<int, std::vector<int> > verticesStack;  // vertices to be visited
+
+		/* In order to prevent multiple visits to vertices in possible
+		cycles, which entails the risk of infinite loops, the vertices
+		are marked for having been visited or finished being processed.
+		This purpose is served by the vector VertexState. */
+	       
+		// assign all vertices the state `not visited'
+		std::vector<VertStatus> VertexState(size(), notVisited);
+
+		/* If, starting from one vertex, an attempt is made to reach all
+		other vertices, success is not guaranteed in weakly or
+		non-connected graphs. Therefore, each vertex is visited. If it
+		is found that a vertex has already been visited, it does not
+		need to be processed any further. */
+
+		// visit all vertices
+		for(size_t i = 0; i < size(); ++i)
+		{
+			if(VertexState[i] == notVisited)
+			{
+				++ComponentNumber;
+				// store on stack for further processing
+				verticesStack.push(i);
+
+				// process stack
+				while(!verticesStack.empty())
+				{
+					int theVertex = verticesStack.top();
+					verticesStack.pop();
+					if(VertexState[theVertex] == visited)
+					VertexState[theVertex] = processed;
+					else
+					if(VertexState[theVertex] == notVisited)
+					{
+						VertexState[theVertex] = visited;
+						// new vertex, earmark for processed mark
+						verticesStack.push(theVertex);
+
+						/* If one of the successors of a newly found vertex
+							bears the visited mark, the algorithm has already
+							passed this point once, and there is a cycle. */
+		                     
+						// earmark successor:
+						typename Successor::const_iterator
+							start  = operator[](theVertex).second.begin(),
+							end    = operator[](theVertex).second.end();
+
+						while(start != end)
+						{
+							int Succ = (*start).first;
+
+							if(VertexState[Succ] == visited)
+							{
+								++Cycles;   // someone's been here already!
+								(*pOut) << "at least vertex "
+								<< operator[](Succ).first
+								<< " lies in a cycle\n";
+							}
+
+							/* Otherwise, the vertex has already been
+								processed and therefore should not be
+								considered again, or it has not yet been
+								visited and is earmarked on the stack. */
+		                          
+							if(VertexState[Succ] == notVisited)
+								verticesStack.push(Succ);
+							++start;
+						}
+					}
+				}  // stack empty?
+			}     //  if(VertexState}...
+		}       // for()} ...
+
+		/* Now we only need the output. In case of directed, weakly
+		connected graphs, the algorithm counts several components. In
+		order to make the output conform to the above definitions,
+		although with less content of information, a distinction is
+		made as to whether the graph is directed or not. */
+
+		if(directed)
+		{
+			if(ComponentNumber == 1)
+				os << "The graph is strongly connected.\n";
+			else
+				os << "The graph is not or weakly "
+					"connected.\n";
+		}
+		else
+			os	<< "The graph has "
+				<< ComponentNumber
+				<< " component(s)." << std::endl;
+
+		os << "The graph has ";
+		if(Cycles == 0)
+			os << "no ";
+		os << "cycles." << std::endl;
+	}
+
+	template<class VertexType, class EdgeType>
+	std::ostream& operator<<(std::ostream& os, Graph<VertexType,EdgeType>& G)
+	{
+		// display of vertices with successors
+		for(size_t i = 0; i < G.size(); ++i)
+		{
+			os << G[i].first << " <";
+			typename Graph<VertexType,EdgeType>::Successor::const_iterator
+								startN = G[i].second.begin(),
+								endN   = G[i].second.end();
+
+			while(startN != endN)
+			{
+				os << G[(*startN).first].first << ' ' // vertex
+				<< (*startN).second << ' ';        // edge value
+				++startN;
+			}
+			os << ">" << std::endl;
+		}
+		return os;
+	}
+} // namespace br_stl
+
+
+
+#endif
+
diff --git a/src/terralib/kernel/lexTemporal.cpp b/src/terralib/kernel/lexTemporal.cpp
old mode 100755
new mode 100644
index be24237..f821cca
--- a/src/terralib/kernel/lexTemporal.cpp
+++ b/src/terralib/kernel/lexTemporal.cpp
@@ -1,1927 +1,1927 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header: /home/terralib/src/terralib/kernel/lexTemporal.cpp,v 1.9 2009/01/21 13:00:00 enivaldo Exp $
- */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-
-#include <stdio.h>
-#include <errno.h>
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
-
-#ifdef __cplusplus
-
-#include <stdlib.h>
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-#if __STDC__
-
-#define YY_USE_PROTOS
-#define YY_USE_CONST
-
-#endif	/* __STDC__ */
-#endif	/* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#define YY_BUF_SIZE 16384
-
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
- * avoids problems with code like:
- *
- * 	if ( condition_holds )
- *		yyless( 5 );
- *	else
- *		do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-		*yy_cp = yy_hold_char; \
-		YY_RESTORE_YY_MORE_OFFSET \
-		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via yyrestart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-	};
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-
-static int yy_n_chars;		/* number of characters read into yy_ch_buf */
-
-
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1;		/* whether we need to initialize */
-static int yy_start = 0;	/* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_is_interactive = is_interactive; \
-	}
-
-#define yy_set_bol(at_bol) \
-	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_at_bol = at_bol; \
-	}
-
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-
-
-#define YY_USES_REJECT
-
-#define yywrap() 1
-#define YY_SKIP_YYWRAP
-typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-typedef int yy_state_type;
-extern int yylineno;
-int yylineno = 1;
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
-	yytext_ptr = yy_bp; \
-	yyleng = (int) (yy_cp - yy_bp); \
-	yy_hold_char = *yy_cp; \
-	*yy_cp = '\0'; \
-	yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 35
-#define YY_END_OF_BUFFER 36
-static yyconst short int yy_acclist[257] =
-    {   0,
-       36,   34,   35,    1,    2,   34,   35,   33,   35,    2,
-       34,   35,    3,   34,   35,    4,   34,   35,   34,   35,
-       23,   34,   35,   34,   35,   34,   35,   26,   34,   35,
-       34,   35,   34,   35,   34,   35,    1,    3,    4,   31,
-       32,   23,   30,   30,   26,   30,   26,   30,   30,   27,
-       30,   30,   28,   30,   26,   30,   26,   30,   26,   30,
-       29,   30,   30,   30,   30,   30,   30,   30,   30,   26,
-       30,   26,   30,   26,   30,   26,   30,   30,   30,   30,
-       30,   30,   30,   30,   30,   24,   26,   30,   26,   30,
-       26,   30,   26,   30,   26,   30,   16,   30,   30,   30,
-
-       30,   30,   30,   30,   30,   30,   24,   26,   30,   26,
-       30,   26,   30,   26,   30,   26,   30,   26,   30,   30,
-       15,   30,   30,   30,   30,   30,   30,   30,   18,   30,
-       24,   26,   30,   26,   30,   26,   30,   26,   30,   26,
-       30,   26,   30,   30,   30,   17,   30,   30,   30,   30,
-       30,   30,   30,   30,   30,   30,   30,   26,   30,   26,
-       30,   26,   30,   26,   30,   26,   30,   30,   30,   14,
-       30,   21,   30,   13,   30,   30,   30,   30,   30,   30,
-       30,   30,   30,   30,   26,   30,   26,   30,   26,   30,
-       26,   30,   30,   30,   30,   30,   30,   30,   30,   30,
-
-       30,   30,   30,   26,   30,   26,   30,   26,   30,   30,
-       30,   30,   30,   30,   11,   30,   30,   30,   30,   30,
-       30,   25,   25,   26,   30,   26,   30,   19,   30,   20,
-       30,    7,   30,   30,   30,    5,   30,    8,   30,   30,
-       30,   30,   26,   30,    6,   30,    9,   30,   30,   12,
-       30,   22,   30,   30,   10,   30
-    } ;
-
-static yyconst short int yy_accept[189] =
-    {   0,
-        1,    1,    1,    2,    4,    8,   10,   13,   16,   19,
-       21,   24,   26,   28,   31,   33,   35,   37,   38,   39,
-       40,   41,   42,   42,   43,   44,   45,   47,   49,   50,
-       52,   53,   53,   55,   57,   59,   61,   63,   64,   65,
-       66,   67,   68,   69,   70,   70,   72,   74,   76,   78,
-       79,   80,   81,   82,   83,   84,   85,   86,   87,   89,
-       91,   93,   95,   97,   99,  100,  101,  102,  103,  104,
-      105,  106,  107,  107,  108,  110,  112,  114,  116,  118,
-      120,  121,  123,  124,  125,  126,  127,  128,  129,  131,
-      131,  132,  134,  136,  138,  140,  142,  144,  145,  146,
-
-      148,  149,  150,  151,  152,  153,  154,  155,  156,  157,
-      158,  158,  158,  160,  162,  164,  166,  168,  169,  170,
-      172,  174,  176,  177,  178,  179,  180,  181,  182,  183,
-      184,  185,  185,  185,  187,  189,  191,  193,  194,  195,
-      196,  197,  198,  199,  200,  201,  202,  203,  204,  204,
-      204,  206,  208,  210,  211,  212,  213,  214,  215,  217,
-      218,  219,  220,  221,  222,  223,  224,  226,  228,  230,
-      232,  234,  235,  236,  238,  240,  241,  242,  243,  245,
-      247,  249,  250,  252,  254,  255,  257,  257
-    } ;
-
-static yyconst int yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    1,    1,    1,    1,    1,    1,    1,    5,
-        6,    7,    1,    1,    1,    1,    8,    9,    9,    9,
-        9,    9,    9,    9,    9,    9,    9,   10,    1,    1,
-        1,    1,    1,    1,   11,   12,   13,   14,   15,   16,
-       17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
-       27,   28,   29,   30,   31,   32,   33,   20,   34,   20,
-        1,    1,    1,    1,   35,    1,   20,   20,   20,   20,
-
-       36,   20,   20,   20,   20,   20,   20,   20,   37,   20,
-       20,   20,   20,   20,   38,   20,   20,   20,   20,   20,
-       20,   20,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst int yy_meta[39] =
-    {   0,
-        1,    1,    2,    1,    1,    1,    1,    1,    3,    1,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3
-    } ;
-
-static yyconst short int yy_base[190] =
-    {   0,
-        0,    0,  242,  581,  239,  581,  581,  234,  232,   32,
-       33,  213,    0,   29,  209,  205,  195,  228,  224,  222,
-      581,  581,  217,   36,    0,  211,   54,   79,  194,    0,
-      103,   40,    0,  124,  149,  185,    0,  211,  195,   31,
-      204,  199,  202,  200,  205,  173,  198,  175,  222,  175,
-      177,  182,  181,   40,  181,  188,  190,  191,  247,  272,
-      161,  296,  160,  172,  167,  163,  163,  163,  165,  174,
-      167,  157,  175,  173,  143,  321,  142,  345,  141,  370,
-      161,    0,  146,  157,  149,  149,  398,  146,    0,   45,
-       50,  132,  131,  414,  130,  439,  128,   28,  150,    0,
-
-      140,  146,  143,  142,  125,   46,  140,  122,  122,  135,
-      141,  140,  110,  108,  464,  107,  489,  129,  128,    0,
-        0,    0,  111,  124,  111,  121,  103,  116,  115,  118,
-       94,   55,   65,   89,   87,  514,   86,  108,  111,  105,
-       94,   99,   86,  103,   82,   83,   82,   94,   98,   97,
-       67,   66,  539,   82,   73,   72,   71,   74,    0,   74,
-       66,   72,   60,   78,   78,   69,   48,   47,    0,    0,
-        0,   69,   65,    0,    0,   70,   51,   48,   33,    0,
-        0,   43,    0,    0,   28,    0,  581,   43,  577
-    } ;
-
-static yyconst short int yy_def[190] =
-    {   0,
-      187,    1,  187,  187,  187,  187,  187,  187,  187,  187,
-      187,  188,  188,  188,  188,  188,  188,  187,  187,  187,
-      187,  187,  187,  187,  188,  188,  188,   14,  188,  188,
-      188,  187,  188,  188,   27,   35,  188,  188,  188,  188,
-      188,  188,  188,  188,  187,  188,   34,   47,   47,  188,
-      188,  188,  188,  188,  188,  188,  188,  189,  188,   46,
-       60,   60,   62,  188,  188,  188,  188,  188,  188,  188,
-      188,  188,  187,  189,   59,   59,   76,   76,   78,   78,
-      188,  188,  188,  188,  188,  188,  188,  188,  188,  187,
-      189,   76,   76,   76,   94,   94,   96,  188,  188,  188,
-
-      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
-      187,  187,   94,   94,   94,  115,  115,  188,  188,  188,
-      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
-      188,  187,  187,  115,  115,  115,  136,  188,  188,  188,
-      188,  188,  188,  188,  188,  188,  188,  188,  187,  187,
-      136,  136,  136,  188,  188,  188,  188,  188,  188,  188,
-      188,  188,  188,  188,  187,  187,  153,  153,  188,  188,
-      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
-      188,  188,  188,  188,  188,  188,    0,  187,  187
-    } ;
-
-static yyconst short int yy_nxt[620] =
-    {   0,
-        4,    5,    6,    7,    8,    9,    4,   10,   11,    4,
-       12,   13,   13,   14,   13,   13,   13,   14,   13,   13,
-       13,   13,   14,   15,   16,   13,   13,   13,   14,   17,
-       13,   13,   13,   14,    4,   13,   14,   13,   21,   22,
-       23,   24,   27,   23,   24,   25,   27,   45,   32,   52,
-       68,   27,   69,   90,  111,   53,  186,   27,   91,  112,
-      118,  119,   27,  132,  149,   27,   28,   34,  185,  126,
-      179,   34,  127,  133,  150,  184,   34,  166,  149,  183,
-      182,  181,   34,  180,  179,  167,  165,   34,  178,  177,
-       34,   35,   36,  176,  175,  174,   36,  173,  172,  171,
-
-      170,   36,  169,  167,  151,  166,  165,   36,  164,  163,
-      162,  161,   36,  160,  159,   36,   38,  158,  157,  156,
-       39,  155,  154,  153,  151,   40,  134,  148,  147,  146,
-      145,   41,   42,  144,  143,   43,   44,   46,  142,  141,
-      140,   46,  139,  138,  136,  134,   46,  113,  133,  132,
-      131,  130,   46,  129,  128,  125,  124,   46,  123,  122,
-       46,   47,   48,  121,  120,  117,   48,  115,  113,   92,
-      110,   48,  102,  101,  100,   99,   98,   48,   96,   94,
-       92,   91,   48,   90,   89,   48,   59,   88,   87,   86,
-       59,   85,   84,   83,   82,   59,   81,   80,   78,   74,
-
-       72,   59,   71,   70,   67,   66,   59,   65,   64,   59,
-       60,   61,   62,   58,   57,   61,   56,   55,   54,   51,
-       61,   50,   49,   37,   33,   32,   61,   20,   19,   18,
-       31,   61,   30,   29,   61,   63,   26,   20,   19,   63,
-       18,  187,  187,  187,   63,  187,  187,  187,  187,  187,
-       63,  187,  187,  187,  187,   63,  187,  187,   63,   49,
-       75,  187,  187,  187,   75,  187,  187,  187,  187,   75,
-      187,  187,  187,  187,  187,   75,  187,  187,  187,  187,
-       75,  187,  187,   75,   76,   77,  187,  187,  187,   77,
-      187,  187,  187,  187,   77,  187,  187,  187,  187,  187,
-
-       77,  187,  187,  187,  187,   77,  187,  187,   77,   79,
-      187,  187,  187,   79,  187,  187,  187,  187,   79,  187,
-      187,  187,  187,  187,   79,  187,  187,  187,  187,   79,
-      187,  187,   79,   62,   93,  187,  187,  187,   93,  187,
-      187,  187,  187,   93,  187,  187,  187,  187,  187,   93,
-      187,  187,  187,  187,   93,  187,  187,   93,   95,  187,
-      187,  187,   95,  187,  187,  187,  187,   95,  187,  187,
-      187,  187,  187,   95,  187,  187,  187,  187,   95,  187,
-      187,   95,   78,   97,  187,  187,  187,   97,  187,  187,
-      187,  187,   97,  187,  187,  187,  187,  187,   97,  187,
-
-      187,  187,  187,   97,  187,  187,   97,   80,  103,  104,
-      187,  105,  106,  187,  187,  187,  187,  187,  187,  187,
-      107,  187,  108,  187,  187,  187,  109,  114,  187,  187,
-      187,  114,  187,  187,  187,  187,  114,  187,  187,  187,
-      187,  187,  114,  187,  187,  187,  187,  114,  187,  187,
-      114,   94,  116,  187,  187,  187,  116,  187,  187,  187,
-      187,  116,  187,  187,  187,  187,  187,  116,  187,  187,
-      187,  187,  116,  187,  187,  116,   96,  135,  187,  187,
-      187,  135,  187,  187,  187,  187,  135,  187,  187,  187,
-      187,  187,  135,  187,  187,  187,  187,  135,  187,  187,
-
-      135,  115,  137,  187,  187,  187,  137,  187,  187,  187,
-      187,  137,  187,  187,  187,  187,  187,  137,  187,  187,
-      187,  187,  137,  187,  187,  137,  117,  152,  187,  187,
-      187,  152,  187,  187,  187,  187,  152,  187,  187,  187,
-      187,  187,  152,  187,  187,  187,  187,  152,  187,  187,
-      152,  136,  168,  187,  187,  187,  168,  187,  187,  187,
-      187,  168,  187,  187,  187,  187,  187,  168,  187,  187,
-      187,  187,  168,  187,  187,  168,  153,   73,  187,   73,
-        3,  187,  187,  187,  187,  187,  187,  187,  187,  187,
-      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
-
-      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
-      187,  187,  187,  187,  187,  187,  187,  187,  187
-    } ;
-
-static yyconst short int yy_chk[620] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,   10,   10,
-       11,   11,   14,   24,   24,  188,   14,   32,   32,   40,
-       54,   14,   54,   90,   90,   40,  185,   14,   91,   91,
-       98,   98,   14,  132,  132,   14,   14,   27,  182,  106,
-      179,   27,  106,  133,  133,  178,   27,  166,  166,  177,
-      176,  173,   27,  172,  168,  167,  165,   27,  164,  163,
-       27,   27,   28,  162,  161,  160,   28,  158,  157,  156,
-
-      155,   28,  154,  152,  151,  150,  149,   28,  148,  147,
-      146,  145,   28,  144,  143,   28,   31,  142,  141,  140,
-       31,  139,  138,  137,  135,   31,  134,  131,  130,  129,
-      128,   31,   31,  127,  126,   31,   31,   34,  125,  124,
-      123,   34,  119,  118,  116,  114,   34,  113,  112,  111,
-      110,  109,   34,  108,  107,  105,  104,   34,  103,  102,
-       34,   34,   35,  101,   99,   97,   35,   95,   93,   92,
-       88,   35,   86,   85,   84,   83,   81,   35,   79,   77,
-       75,   74,   35,   73,   72,   35,   46,   71,   70,   69,
-       46,   68,   67,   66,   65,   46,   64,   63,   61,   58,
-
-       57,   46,   56,   55,   53,   52,   46,   51,   50,   46,
-       46,   47,   48,   45,   44,   47,   43,   42,   41,   39,
-       47,   38,   36,   29,   26,   23,   47,   20,   19,   18,
-       17,   47,   16,   15,   47,   49,   12,    9,    8,   49,
-        5,    3,    0,    0,   49,    0,    0,    0,    0,    0,
-       49,    0,    0,    0,    0,   49,    0,    0,   49,   49,
-       59,    0,    0,    0,   59,    0,    0,    0,    0,   59,
-        0,    0,    0,    0,    0,   59,    0,    0,    0,    0,
-       59,    0,    0,   59,   59,   60,    0,    0,    0,   60,
-        0,    0,    0,    0,   60,    0,    0,    0,    0,    0,
-
-       60,    0,    0,    0,    0,   60,    0,    0,   60,   62,
-        0,    0,    0,   62,    0,    0,    0,    0,   62,    0,
-        0,    0,    0,    0,   62,    0,    0,    0,    0,   62,
-        0,    0,   62,   62,   76,    0,    0,    0,   76,    0,
-        0,    0,    0,   76,    0,    0,    0,    0,    0,   76,
-        0,    0,    0,    0,   76,    0,    0,   76,   78,    0,
-        0,    0,   78,    0,    0,    0,    0,   78,    0,    0,
-        0,    0,    0,   78,    0,    0,    0,    0,   78,    0,
-        0,   78,   78,   80,    0,    0,    0,   80,    0,    0,
-        0,    0,   80,    0,    0,    0,    0,    0,   80,    0,
-
-        0,    0,    0,   80,    0,    0,   80,   80,   87,   87,
-        0,   87,   87,    0,    0,    0,    0,    0,    0,    0,
-       87,    0,   87,    0,    0,    0,   87,   94,    0,    0,
-        0,   94,    0,    0,    0,    0,   94,    0,    0,    0,
-        0,    0,   94,    0,    0,    0,    0,   94,    0,    0,
-       94,   94,   96,    0,    0,    0,   96,    0,    0,    0,
-        0,   96,    0,    0,    0,    0,    0,   96,    0,    0,
-        0,    0,   96,    0,    0,   96,   96,  115,    0,    0,
-        0,  115,    0,    0,    0,    0,  115,    0,    0,    0,
-        0,    0,  115,    0,    0,    0,    0,  115,    0,    0,
-
-      115,  115,  117,    0,    0,    0,  117,    0,    0,    0,
-        0,  117,    0,    0,    0,    0,    0,  117,    0,    0,
-        0,    0,  117,    0,    0,  117,  117,  136,    0,    0,
-        0,  136,    0,    0,    0,    0,  136,    0,    0,    0,
-        0,    0,  136,    0,    0,    0,    0,  136,    0,    0,
-      136,  136,  153,    0,    0,    0,  153,    0,    0,    0,
-        0,  153,    0,    0,    0,    0,    0,  153,    0,    0,
-        0,    0,  153,    0,    0,  153,  153,  189,    0,  189,
-      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
-      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
-
-      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
-      187,  187,  187,  187,  187,  187,  187,  187,  187
-    } ;
-
-static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
-static char *yy_full_match;
-static int yy_lp;
-#define REJECT \
-{ \
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
-yy_cp = yy_full_match; /* restore poss. backed-over text */ \
-++yy_lp; \
-goto find_rule; \
-}
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#define INITIAL 0
-/*
-* Lex
-*/
-#include <string.h>
-#include <yyTemporal.h>
-
-extern const char *myinputptr;	/* current position in myinput */
-extern long  myinputlim;		/* end of data */
-
-int   lineno;
-char lexOut[1000];
-char sqlOutLex[1000];
-
-#undef YY_INPUT
-extern int my_yyinput(char* buf, int max_size);
-#define YY_INPUT(buffer, result, size) (result=my_yyinput(buffer,size))
-
-void initLexOut()
-{
-	for(int i=0; i<1000; ++i)
-	{
-		lexOut[i] = '\0';
-		sqlOutLex[i] = '\0';
-	}
-	return;
-}
-
-int my_yyinput(char* buf, int max_size)
-{
-	int n = max_size;
-//	int s = myinputlim - (int)myinputptr;
-	long s = myinputlim - (long)myinputptr;
-	if(max_size>s)
-		n = s;
-		
-	//int n = min(max_size, myinputlim - (int)myinputptr);
-	if(n>0)
-	{
-		initLexOut(); 
-		memcpy(buf, myinputptr, n);		
-		myinputptr += n;
-	}	
-	return n;
-}
-
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
-#else
-extern int yywrap YY_PROTO(( void ));
-#endif
-#endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
-#endif
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines.  This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-	if ( yy_current_buffer->yy_is_interactive ) \
-		{ \
-		int c = '*', n; \
-		for ( n = 0; n < max_size && \
-			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-			buf[n] = (char) c; \
-		if ( c == '\n' ) \
-			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( yyin ) ) \
-			YY_FATAL_ERROR( "input in flex scanner failed" ); \
-		result = n; \
-		} \
-	else \
-		{ \
-		errno=0; \
-		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-			{ \
-			if( errno != EINTR) \
-				{ \
-				YY_FATAL_ERROR( "input in flex scanner failed" ); \
-				break; \
-				} \
-			errno=0; \
-			clearerr(yyin); \
-			} \
-		}
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-	YY_USER_ACTION
-
-YY_DECL
-	{
-	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
-	register int yy_act;
-
-
-
-
-	if ( yy_init )
-		{
-		yy_init = 0;
-
-#ifdef YY_USER_INIT
-		YY_USER_INIT;
-#endif
-
-		if ( ! yy_start )
-			yy_start = 1;	/* first start state */
-
-		if ( ! yyin )
-			yyin = stdin;
-
-		if ( ! yyout )
-			yyout = stdout;
-
-		if ( ! yy_current_buffer )
-			yy_current_buffer =
-				yy_create_buffer( yyin, YY_BUF_SIZE );
-
-		yy_load_buffer_state();
-		}
-
-	while ( 1 )		/* loops until end-of-file is reached */
-		{
-		yy_cp = yy_c_buf_p;
-
-		/* Support of yytext. */
-		*yy_cp = yy_hold_char;
-
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
-
-		yy_current_state = yy_start;
-		yy_state_ptr = yy_state_buf;
-		*yy_state_ptr++ = yy_current_state;
-yy_match:
-		do
-			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-				{
-				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 188 )
-					yy_c = yy_meta[(unsigned int) yy_c];
-				}
-			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-			*yy_state_ptr++ = yy_current_state;
-			++yy_cp;
-			}
-		while ( yy_base[yy_current_state] != 581 );
-
-yy_find_action:
-		yy_current_state = *--yy_state_ptr;
-		yy_lp = yy_accept[yy_current_state];
-/* find_rule:  we branch to this label when backing up */
-		for ( ; ; ) /* until we find what rule we matched */
-			{
-			if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
-				{
-				yy_act = yy_acclist[yy_lp];
-					{
-					yy_full_match = yy_cp;
-					break;
-					}
-				}
-			--yy_cp;
-			yy_current_state = *--yy_state_ptr;
-			yy_lp = yy_accept[yy_current_state];
-			}
-
-		YY_DO_BEFORE_ACTION;
-
-		if ( yy_act != YY_END_OF_BUFFER )
-			{
-			int yyl;
-			for ( yyl = 0; yyl < yyleng; ++yyl )
-				if ( yytext[yyl] == '\n' )
-					++yylineno;
-			}
-
-do_action:	/* This label is used only to access EOF actions. */
-
-
-		switch ( yy_act )
-	{ /* beginning of action switch */
-case 1:
-YY_RULE_SETUP
-{ ; } 
-	YY_BREAK
-case 2:
-YY_RULE_SETUP
-{ ; }
-	YY_BREAK
-case 3:
-YY_RULE_SETUP
-{	strncat(sqlOutLex, yytext, strlen(yytext)); };
-	YY_BREAK
-case 4:
-YY_RULE_SETUP
-{  strncat(sqlOutLex, yytext, strlen(yytext)); };
-	YY_BREAK
-case 5:
-case 6:
-case 7:
-case 8:
-case 9:
-case 10:
-case 11:
-case 12:
-YY_RULE_SETUP
-{ strncat(lexOut, yytext, strlen(yytext));
-		strncat(lexOut, ";", 1); 
-		return TEMPORALRELATION; }
-	YY_BREAK
-case 13:
-case 14:
-case 15:
-case 16:
-case 17:
-case 18:
-case 19:
-case 20:
-case 21:
-case 22:
-YY_RULE_SETUP
-{ strncat(lexOut, yytext, strlen(yytext)); 
-		  return CHRONON; }
-	YY_BREAK
-case 23:
-YY_RULE_SETUP
-{ strncat(lexOut, yytext, strlen(yytext)); strncat(lexOut, ";", 1); return NUMBER;}
-	YY_BREAK
-case 24:
-YY_RULE_SETUP
-{ strncat(lexOut, yytext, strlen(yytext)); strncat(lexOut, ";", 1); return NUMBER;  }
-	YY_BREAK
-case 25:
-YY_RULE_SETUP
-{ strncat(lexOut, yytext, strlen(yytext)); strncat(lexOut, ";", 1); return NUMBER; }
-	YY_BREAK
-case 26:
-YY_RULE_SETUP
-{ strncat(lexOut, yytext, strlen(yytext)); strncat(lexOut, ";", 1); return MASK;}
-	YY_BREAK
-case 27:
-YY_RULE_SETUP
-{strncat(sqlOutLex, yytext, strlen(yytext)); return OR;} 
-	YY_BREAK
-case 28:
-YY_RULE_SETUP
-{strncat(sqlOutLex, yytext, strlen(yytext)); return AND;}
-	YY_BREAK
-case 29:
-YY_RULE_SETUP
-{strncat(sqlOutLex, yytext, strlen(yytext)); return NOT;}
-	YY_BREAK
-case 30:
-YY_RULE_SETUP
-{ strncat(lexOut, yytext, strlen(yytext)); strncat(lexOut, ";", 1); return NAME; }
-	YY_BREAK
-case 31:
-YY_RULE_SETUP
-{
-#if TePLATFORM != TePLATFORMCODE_AIX
-		int	yyinput();
-#endif
-		unsigned char c1=0,c2=yyinput();
-		while (1)
-		{
-			if ((char)c2==EOF) break;
-			if ((c1=='*') && (c2=='/')) break;
-			if (c2=='\n') {lineno++;}
-			c1=c2;
-			c2=yyinput();
-		}
-	}
-	YY_BREAK
-case 32:
-YY_RULE_SETUP
-{
-#if TePLATFORM != TePLATFORMCODE_AIX
-		int	yyinput();
-#endif
-		unsigned char c1=yyinput();
-		while (1)
-		{
-			if (c1=='\n') {lineno++;break;}
-			c1=yyinput();
-		}
-	}
-	YY_BREAK
-case 33:
-YY_RULE_SETUP
-{ lineno++; }
-	YY_BREAK
-case 34:
-YY_RULE_SETUP
-{ return yytext[0]; }
-	YY_BREAK
-case YY_STATE_EOF(INITIAL):
-{ return 0; }
-	YY_BREAK
-case 35:
-YY_RULE_SETUP
-ECHO;
-	YY_BREAK
-
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = yy_hold_char;
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * yylex().  If so, then we have to assure
-			 * consistency between yy_current_buffer and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			yy_n_chars = yy_current_buffer->yy_n_chars;
-			yy_current_buffer->yy_input_file = yyin;
-			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state();
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-			yy_bp = yytext_ptr + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
-
-			else
-				{
-				yy_cp = yy_c_buf_p;
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer() )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				yy_did_buffer_switch_on_eof = 0;
-
-				if ( yywrap() )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				yy_c_buf_p =
-					yytext_ptr + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				yy_c_buf_p =
-				&yy_current_buffer->yy_ch_buf[yy_n_chars];
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
-	} /* end of yylex */
-
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-
-static int yy_get_next_buffer()
-	{
-	register char *dest = yy_current_buffer->yy_ch_buf;
-	register char *source = yytext_ptr;
-	register int number_to_move, i;
-	int ret_val;
-
-	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( yy_current_buffer->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
-
-	else
-		{
-		int num_to_read =
-			yy_current_buffer->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
-			YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
-
-			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = yy_current_buffer;
-
-			int yy_c_buf_p_offset =
-				(int) (yy_c_buf_p - b->yy_ch_buf);
-
-			if ( b->yy_is_our_buffer )
-				{
-				int new_size = b->yy_buf_size * 2;
-
-				if ( new_size <= 0 )
-					b->yy_buf_size += b->yy_buf_size / 8;
-				else
-					b->yy_buf_size *= 2;
-
-				b->yy_ch_buf = (char *)
-					/* Include room in for 2 EOB chars. */
-					yy_flex_realloc( (void *) b->yy_ch_buf,
-							 b->yy_buf_size + 2 );
-				}
-			else
-				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = 0;
-
-			if ( ! b->yy_ch_buf )
-				YY_FATAL_ERROR(
-				"fatal error - scanner input buffer overflow" );
-
-			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = yy_current_buffer->yy_buf_size -
-						number_to_move - 1;
-#endif
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
-			yy_n_chars, num_to_read );
-
-		yy_current_buffer->yy_n_chars = yy_n_chars;
-		}
-
-	if ( yy_n_chars == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			yyrestart( yyin );
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			yy_current_buffer->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	yy_n_chars += number_to_move;
-	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
-
-	return ret_val;
-	}
-
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-static yy_state_type yy_get_previous_state()
-	{
-	register yy_state_type yy_current_state;
-	register char *yy_cp;
-
-	yy_current_state = yy_start;
-	yy_state_ptr = yy_state_buf;
-	*yy_state_ptr++ = yy_current_state;
-
-	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
-		{
-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-			{
-			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 188 )
-				yy_c = yy_meta[(unsigned int) yy_c];
-			}
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		*yy_state_ptr++ = yy_current_state;
-		}
-
-	return yy_current_state;
-	}
-
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
-	{
-	register int yy_is_jam;
-
-	register YY_CHAR yy_c = 1;
-	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-		{
-		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 188 )
-			yy_c = yy_meta[(unsigned int) yy_c];
-		}
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 187);
-	if ( ! yy_is_jam )
-		*yy_state_ptr++ = yy_current_state;
-
-	return yy_is_jam ? 0 : yy_current_state;
-	}
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
-	{
-	register char *yy_cp = yy_c_buf_p;
-
-	/* undo effects of setting up yytext */
-	*yy_cp = yy_hold_char;
-
-	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
-		{ /* need to shift things up to make room */
-		/* +2 for EOB chars. */
-		register int number_to_move = yy_n_chars + 2;
-		register char *dest = &yy_current_buffer->yy_ch_buf[
-					yy_current_buffer->yy_buf_size + 2];
-		register char *source =
-				&yy_current_buffer->yy_ch_buf[number_to_move];
-
-		while ( source > yy_current_buffer->yy_ch_buf )
-			*--dest = *--source;
-
-		yy_cp += (int) (dest - source);
-		yy_bp += (int) (dest - source);
-		yy_current_buffer->yy_n_chars =
-			yy_n_chars = yy_current_buffer->yy_buf_size;
-
-		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
-		}
-
-	*--yy_cp = (char) c;
-
-	if ( c == '\n' )
-		--yylineno;
-
-	yytext_ptr = yy_bp;
-	yy_hold_char = *yy_cp;
-	yy_c_buf_p = yy_cp;
-	}
-#endif	/* ifndef YY_NO_UNPUT */
-
-
-#ifdef __cplusplus
-static int yyinput()
-#else
-static int input()
-#endif
-	{
-	int c;
-
-	*yy_c_buf_p = yy_hold_char;
-
-	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
-			/* This was really a NUL. */
-			*yy_c_buf_p = '\0';
-
-		else
-			{ /* need more input */
-			int offset = yy_c_buf_p - yytext_ptr;
-			++yy_c_buf_p;
-
-			switch ( yy_get_next_buffer() )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					yyrestart( yyin );
-
-					/* fall through */
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( yywrap() )
-						return EOF;
-
-					if ( ! yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-#ifdef __cplusplus
-					return yyinput();
-#else
-					return input();
-#endif
-					}
-
-				case EOB_ACT_CONTINUE_SCAN:
-					yy_c_buf_p = yytext_ptr + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
-	*yy_c_buf_p = '\0';	/* preserve yytext */
-	yy_hold_char = *++yy_c_buf_p;
-
-	if ( c == '\n' )
-		++yylineno;
-
-	return c;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
-	{
-	if ( ! yy_current_buffer )
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
-	yy_init_buffer( yy_current_buffer, input_file );
-	yy_load_buffer_state();
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
-	{
-	if ( yy_current_buffer == new_buffer )
-		return;
-
-	if ( yy_current_buffer )
-		{
-		/* Flush out information for old buffer. */
-		*yy_c_buf_p = yy_hold_char;
-		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
-		yy_current_buffer->yy_n_chars = yy_n_chars;
-		}
-
-	yy_current_buffer = new_buffer;
-	yy_load_buffer_state();
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (yywrap()) processing, but the only time this flag
-	 * is looked at is after yywrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	yy_did_buffer_switch_on_eof = 1;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
-	{
-	yy_n_chars = yy_current_buffer->yy_n_chars;
-	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
-	yyin = yy_current_buffer->yy_input_file;
-	yy_hold_char = *yy_c_buf_p;
-	}
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
-	{
-	YY_BUFFER_STATE b;
-
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_buf_size = size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_is_our_buffer = 1;
-
-	yy_init_buffer( b, file );
-
-	return b;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-	{
-	if ( ! b )
-		return;
-
-	if ( b == yy_current_buffer )
-		yy_current_buffer = (YY_BUFFER_STATE) 0;
-
-	if ( b->yy_is_our_buffer )
-		yy_flex_free( (void *) b->yy_ch_buf );
-
-	yy_flex_free( (void *) b );
-	}
-
-
-#ifndef _WIN32
-#include <unistd.h>
-#else
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-//extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
-	{
-	yy_flush_buffer( b );
-
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
-
-#if YY_ALWAYS_INTERACTIVE
-	b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
-	b->yy_is_interactive = 0;
-#else
-//	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
-	{
-	if ( ! b )
-		return;
-
-	b->yy_n_chars = 0;
-
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-	b->yy_buf_pos = &b->yy_ch_buf[0];
-
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	if ( b == yy_current_buffer )
-		yy_load_buffer_state();
-	}
-
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
-	{
-	YY_BUFFER_STATE b;
-
-	if ( size < 2 ||
-	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
-	     base[size-1] != YY_END_OF_BUFFER_CHAR )
-		/* They forgot to leave room for the EOB's. */
-		return 0;
-
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
-	b->yy_buf_pos = b->yy_ch_buf = base;
-	b->yy_is_our_buffer = 0;
-	b->yy_input_file = 0;
-	b->yy_n_chars = b->yy_buf_size;
-	b->yy_is_interactive = 0;
-	b->yy_at_bol = 1;
-	b->yy_fill_buffer = 0;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	yy_switch_to_buffer( b );
-
-	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
-	{
-	int len;
-	for ( len = 0; yy_str[len]; ++len )
-		;
-
-	return yy_scan_bytes( yy_str, len );
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
-	{
-	YY_BUFFER_STATE b;
-	char *buf;
-	yy_size_t n;
-	int i;
-
-	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = len + 2;
-	buf = (char *) yy_flex_alloc( n );
-	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
-	for ( i = 0; i < len; ++i )
-		buf[i] = bytes[i];
-
-	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = yy_scan_buffer( buf, n );
-	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
-	/* It's okay to grow etc. this buffer, and we should throw it
-	 * away when we're done.
-	 */
-	b->yy_is_our_buffer = 1;
-
-	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
-	{
-	if ( yy_start_stack_ptr >= yy_start_stack_depth )
-		{
-		yy_size_t new_size;
-
-		yy_start_stack_depth += YY_START_STACK_INCR;
-		new_size = yy_start_stack_depth * sizeof( int );
-
-		if ( ! yy_start_stack )
-			yy_start_stack = (int *) yy_flex_alloc( new_size );
-
-		else
-			yy_start_stack = (int *) yy_flex_realloc(
-					(void *) yy_start_stack, new_size );
-
-		if ( ! yy_start_stack )
-			YY_FATAL_ERROR(
-			"out of memory expanding start-condition stack" );
-		}
-
-	yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
-	BEGIN(new_state);
-	}
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
-	{
-	if ( --yy_start_stack_ptr < 0 )
-		YY_FATAL_ERROR( "start-condition stack underflow" );
-
-	BEGIN(yy_start_stack[yy_start_stack_ptr]);
-	}
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
-	{
-	return yy_start_stack[yy_start_stack_ptr - 1];
-	}
-#endif
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
-	{
-	(void) fprintf( stderr, "%s\n", msg );
-	exit( YY_EXIT_FAILURE );
-	}
-
-
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-		yytext[yyleng] = yy_hold_char; \
-		yy_c_buf_p = yytext + n; \
-		yy_hold_char = *yy_c_buf_p; \
-		*yy_c_buf_p = '\0'; \
-		yyleng = n; \
-		} \
-	while ( 0 )
-
-
-/* Internal utility routines. */
-
-#ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
-	{
-	register int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
-	}
-#endif
-
-#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
-	{
-	register int n;
-	for ( n = 0; s[n]; ++n )
-		;
-
-	return n;
-	}
-#endif
-
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
-	{
-	return (void *) malloc( size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
-	{
-	/* The cast to (char *) in the following accommodates both
-	 * implementations that use char* generic pointers, and those
-	 * that use void* generic pointers.  It works with the latter
-	 * because both ANSI C and C++ allow castless assignment from
-	 * any pointer type to void*, and deal with argument conversions
-	 * as though doing an assignment.
-	 */
-	return (void *) realloc( (char *) ptr, size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
-	{
-	free( ptr );
-	}
-
-#if YY_MAIN
-int main()
-	{
-	yylex();
-	return 0;
-	}
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header$
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include <stdio.h>
+#include <errno.h>
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else	/* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif	/* __STDC__ */
+#endif	/* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator).  This
+ * avoids problems with code like:
+ *
+ * 	if ( condition_holds )
+ *		yyless( 5 );
+ *	else
+ *		do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		*yy_cp = yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+	};
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1;		/* whether we need to initialize */
+static int yy_start = 0;	/* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_is_interactive = is_interactive; \
+	}
+
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_at_bol = at_bol; \
+	}
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+#define YY_USES_REJECT
+
+#define yywrap() 1
+#define YY_SKIP_YYWRAP
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern int yylineno;
+int yylineno = 1;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yytext_ptr = yy_bp; \
+	yyleng = (int) (yy_cp - yy_bp); \
+	yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 35
+#define YY_END_OF_BUFFER 36
+static yyconst short int yy_acclist[257] =
+    {   0,
+       36,   34,   35,    1,    2,   34,   35,   33,   35,    2,
+       34,   35,    3,   34,   35,    4,   34,   35,   34,   35,
+       23,   34,   35,   34,   35,   34,   35,   26,   34,   35,
+       34,   35,   34,   35,   34,   35,    1,    3,    4,   31,
+       32,   23,   30,   30,   26,   30,   26,   30,   30,   27,
+       30,   30,   28,   30,   26,   30,   26,   30,   26,   30,
+       29,   30,   30,   30,   30,   30,   30,   30,   30,   26,
+       30,   26,   30,   26,   30,   26,   30,   30,   30,   30,
+       30,   30,   30,   30,   30,   24,   26,   30,   26,   30,
+       26,   30,   26,   30,   26,   30,   16,   30,   30,   30,
+
+       30,   30,   30,   30,   30,   30,   24,   26,   30,   26,
+       30,   26,   30,   26,   30,   26,   30,   26,   30,   30,
+       15,   30,   30,   30,   30,   30,   30,   30,   18,   30,
+       24,   26,   30,   26,   30,   26,   30,   26,   30,   26,
+       30,   26,   30,   30,   30,   17,   30,   30,   30,   30,
+       30,   30,   30,   30,   30,   30,   30,   26,   30,   26,
+       30,   26,   30,   26,   30,   26,   30,   30,   30,   14,
+       30,   21,   30,   13,   30,   30,   30,   30,   30,   30,
+       30,   30,   30,   30,   26,   30,   26,   30,   26,   30,
+       26,   30,   30,   30,   30,   30,   30,   30,   30,   30,
+
+       30,   30,   30,   26,   30,   26,   30,   26,   30,   30,
+       30,   30,   30,   30,   11,   30,   30,   30,   30,   30,
+       30,   25,   25,   26,   30,   26,   30,   19,   30,   20,
+       30,    7,   30,   30,   30,    5,   30,    8,   30,   30,
+       30,   30,   26,   30,    6,   30,    9,   30,   30,   12,
+       30,   22,   30,   30,   10,   30
+    } ;
+
+static yyconst short int yy_accept[189] =
+    {   0,
+        1,    1,    1,    2,    4,    8,   10,   13,   16,   19,
+       21,   24,   26,   28,   31,   33,   35,   37,   38,   39,
+       40,   41,   42,   42,   43,   44,   45,   47,   49,   50,
+       52,   53,   53,   55,   57,   59,   61,   63,   64,   65,
+       66,   67,   68,   69,   70,   70,   72,   74,   76,   78,
+       79,   80,   81,   82,   83,   84,   85,   86,   87,   89,
+       91,   93,   95,   97,   99,  100,  101,  102,  103,  104,
+      105,  106,  107,  107,  108,  110,  112,  114,  116,  118,
+      120,  121,  123,  124,  125,  126,  127,  128,  129,  131,
+      131,  132,  134,  136,  138,  140,  142,  144,  145,  146,
+
+      148,  149,  150,  151,  152,  153,  154,  155,  156,  157,
+      158,  158,  158,  160,  162,  164,  166,  168,  169,  170,
+      172,  174,  176,  177,  178,  179,  180,  181,  182,  183,
+      184,  185,  185,  185,  187,  189,  191,  193,  194,  195,
+      196,  197,  198,  199,  200,  201,  202,  203,  204,  204,
+      204,  206,  208,  210,  211,  212,  213,  214,  215,  217,
+      218,  219,  220,  221,  222,  223,  224,  226,  228,  230,
+      232,  234,  235,  236,  238,  240,  241,  242,  243,  245,
+      247,  249,  250,  252,  254,  255,  257,  257
+    } ;
+
+static yyconst int yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    1,    1,    1,    1,    1,    1,    1,    5,
+        6,    7,    1,    1,    1,    1,    8,    9,    9,    9,
+        9,    9,    9,    9,    9,    9,    9,   10,    1,    1,
+        1,    1,    1,    1,   11,   12,   13,   14,   15,   16,
+       17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
+       27,   28,   29,   30,   31,   32,   33,   20,   34,   20,
+        1,    1,    1,    1,   35,    1,   20,   20,   20,   20,
+
+       36,   20,   20,   20,   20,   20,   20,   20,   37,   20,
+       20,   20,   20,   20,   38,   20,   20,   20,   20,   20,
+       20,   20,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static yyconst int yy_meta[39] =
+    {   0,
+        1,    1,    2,    1,    1,    1,    1,    1,    3,    1,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3
+    } ;
+
+static yyconst short int yy_base[190] =
+    {   0,
+        0,    0,  242,  581,  239,  581,  581,  234,  232,   32,
+       33,  213,    0,   29,  209,  205,  195,  228,  224,  222,
+      581,  581,  217,   36,    0,  211,   54,   79,  194,    0,
+      103,   40,    0,  124,  149,  185,    0,  211,  195,   31,
+      204,  199,  202,  200,  205,  173,  198,  175,  222,  175,
+      177,  182,  181,   40,  181,  188,  190,  191,  247,  272,
+      161,  296,  160,  172,  167,  163,  163,  163,  165,  174,
+      167,  157,  175,  173,  143,  321,  142,  345,  141,  370,
+      161,    0,  146,  157,  149,  149,  398,  146,    0,   45,
+       50,  132,  131,  414,  130,  439,  128,   28,  150,    0,
+
+      140,  146,  143,  142,  125,   46,  140,  122,  122,  135,
+      141,  140,  110,  108,  464,  107,  489,  129,  128,    0,
+        0,    0,  111,  124,  111,  121,  103,  116,  115,  118,
+       94,   55,   65,   89,   87,  514,   86,  108,  111,  105,
+       94,   99,   86,  103,   82,   83,   82,   94,   98,   97,
+       67,   66,  539,   82,   73,   72,   71,   74,    0,   74,
+       66,   72,   60,   78,   78,   69,   48,   47,    0,    0,
+        0,   69,   65,    0,    0,   70,   51,   48,   33,    0,
+        0,   43,    0,    0,   28,    0,  581,   43,  577
+    } ;
+
+static yyconst short int yy_def[190] =
+    {   0,
+      187,    1,  187,  187,  187,  187,  187,  187,  187,  187,
+      187,  188,  188,  188,  188,  188,  188,  187,  187,  187,
+      187,  187,  187,  187,  188,  188,  188,   14,  188,  188,
+      188,  187,  188,  188,   27,   35,  188,  188,  188,  188,
+      188,  188,  188,  188,  187,  188,   34,   47,   47,  188,
+      188,  188,  188,  188,  188,  188,  188,  189,  188,   46,
+       60,   60,   62,  188,  188,  188,  188,  188,  188,  188,
+      188,  188,  187,  189,   59,   59,   76,   76,   78,   78,
+      188,  188,  188,  188,  188,  188,  188,  188,  188,  187,
+      189,   76,   76,   76,   94,   94,   96,  188,  188,  188,
+
+      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
+      187,  187,   94,   94,   94,  115,  115,  188,  188,  188,
+      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
+      188,  187,  187,  115,  115,  115,  136,  188,  188,  188,
+      188,  188,  188,  188,  188,  188,  188,  188,  187,  187,
+      136,  136,  136,  188,  188,  188,  188,  188,  188,  188,
+      188,  188,  188,  188,  187,  187,  153,  153,  188,  188,
+      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
+      188,  188,  188,  188,  188,  188,    0,  187,  187
+    } ;
+
+static yyconst short int yy_nxt[620] =
+    {   0,
+        4,    5,    6,    7,    8,    9,    4,   10,   11,    4,
+       12,   13,   13,   14,   13,   13,   13,   14,   13,   13,
+       13,   13,   14,   15,   16,   13,   13,   13,   14,   17,
+       13,   13,   13,   14,    4,   13,   14,   13,   21,   22,
+       23,   24,   27,   23,   24,   25,   27,   45,   32,   52,
+       68,   27,   69,   90,  111,   53,  186,   27,   91,  112,
+      118,  119,   27,  132,  149,   27,   28,   34,  185,  126,
+      179,   34,  127,  133,  150,  184,   34,  166,  149,  183,
+      182,  181,   34,  180,  179,  167,  165,   34,  178,  177,
+       34,   35,   36,  176,  175,  174,   36,  173,  172,  171,
+
+      170,   36,  169,  167,  151,  166,  165,   36,  164,  163,
+      162,  161,   36,  160,  159,   36,   38,  158,  157,  156,
+       39,  155,  154,  153,  151,   40,  134,  148,  147,  146,
+      145,   41,   42,  144,  143,   43,   44,   46,  142,  141,
+      140,   46,  139,  138,  136,  134,   46,  113,  133,  132,
+      131,  130,   46,  129,  128,  125,  124,   46,  123,  122,
+       46,   47,   48,  121,  120,  117,   48,  115,  113,   92,
+      110,   48,  102,  101,  100,   99,   98,   48,   96,   94,
+       92,   91,   48,   90,   89,   48,   59,   88,   87,   86,
+       59,   85,   84,   83,   82,   59,   81,   80,   78,   74,
+
+       72,   59,   71,   70,   67,   66,   59,   65,   64,   59,
+       60,   61,   62,   58,   57,   61,   56,   55,   54,   51,
+       61,   50,   49,   37,   33,   32,   61,   20,   19,   18,
+       31,   61,   30,   29,   61,   63,   26,   20,   19,   63,
+       18,  187,  187,  187,   63,  187,  187,  187,  187,  187,
+       63,  187,  187,  187,  187,   63,  187,  187,   63,   49,
+       75,  187,  187,  187,   75,  187,  187,  187,  187,   75,
+      187,  187,  187,  187,  187,   75,  187,  187,  187,  187,
+       75,  187,  187,   75,   76,   77,  187,  187,  187,   77,
+      187,  187,  187,  187,   77,  187,  187,  187,  187,  187,
+
+       77,  187,  187,  187,  187,   77,  187,  187,   77,   79,
+      187,  187,  187,   79,  187,  187,  187,  187,   79,  187,
+      187,  187,  187,  187,   79,  187,  187,  187,  187,   79,
+      187,  187,   79,   62,   93,  187,  187,  187,   93,  187,
+      187,  187,  187,   93,  187,  187,  187,  187,  187,   93,
+      187,  187,  187,  187,   93,  187,  187,   93,   95,  187,
+      187,  187,   95,  187,  187,  187,  187,   95,  187,  187,
+      187,  187,  187,   95,  187,  187,  187,  187,   95,  187,
+      187,   95,   78,   97,  187,  187,  187,   97,  187,  187,
+      187,  187,   97,  187,  187,  187,  187,  187,   97,  187,
+
+      187,  187,  187,   97,  187,  187,   97,   80,  103,  104,
+      187,  105,  106,  187,  187,  187,  187,  187,  187,  187,
+      107,  187,  108,  187,  187,  187,  109,  114,  187,  187,
+      187,  114,  187,  187,  187,  187,  114,  187,  187,  187,
+      187,  187,  114,  187,  187,  187,  187,  114,  187,  187,
+      114,   94,  116,  187,  187,  187,  116,  187,  187,  187,
+      187,  116,  187,  187,  187,  187,  187,  116,  187,  187,
+      187,  187,  116,  187,  187,  116,   96,  135,  187,  187,
+      187,  135,  187,  187,  187,  187,  135,  187,  187,  187,
+      187,  187,  135,  187,  187,  187,  187,  135,  187,  187,
+
+      135,  115,  137,  187,  187,  187,  137,  187,  187,  187,
+      187,  137,  187,  187,  187,  187,  187,  137,  187,  187,
+      187,  187,  137,  187,  187,  137,  117,  152,  187,  187,
+      187,  152,  187,  187,  187,  187,  152,  187,  187,  187,
+      187,  187,  152,  187,  187,  187,  187,  152,  187,  187,
+      152,  136,  168,  187,  187,  187,  168,  187,  187,  187,
+      187,  168,  187,  187,  187,  187,  187,  168,  187,  187,
+      187,  187,  168,  187,  187,  168,  153,   73,  187,   73,
+        3,  187,  187,  187,  187,  187,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
+
+      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  187,  187
+    } ;
+
+static yyconst short int yy_chk[620] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,   10,   10,
+       11,   11,   14,   24,   24,  188,   14,   32,   32,   40,
+       54,   14,   54,   90,   90,   40,  185,   14,   91,   91,
+       98,   98,   14,  132,  132,   14,   14,   27,  182,  106,
+      179,   27,  106,  133,  133,  178,   27,  166,  166,  177,
+      176,  173,   27,  172,  168,  167,  165,   27,  164,  163,
+       27,   27,   28,  162,  161,  160,   28,  158,  157,  156,
+
+      155,   28,  154,  152,  151,  150,  149,   28,  148,  147,
+      146,  145,   28,  144,  143,   28,   31,  142,  141,  140,
+       31,  139,  138,  137,  135,   31,  134,  131,  130,  129,
+      128,   31,   31,  127,  126,   31,   31,   34,  125,  124,
+      123,   34,  119,  118,  116,  114,   34,  113,  112,  111,
+      110,  109,   34,  108,  107,  105,  104,   34,  103,  102,
+       34,   34,   35,  101,   99,   97,   35,   95,   93,   92,
+       88,   35,   86,   85,   84,   83,   81,   35,   79,   77,
+       75,   74,   35,   73,   72,   35,   46,   71,   70,   69,
+       46,   68,   67,   66,   65,   46,   64,   63,   61,   58,
+
+       57,   46,   56,   55,   53,   52,   46,   51,   50,   46,
+       46,   47,   48,   45,   44,   47,   43,   42,   41,   39,
+       47,   38,   36,   29,   26,   23,   47,   20,   19,   18,
+       17,   47,   16,   15,   47,   49,   12,    9,    8,   49,
+        5,    3,    0,    0,   49,    0,    0,    0,    0,    0,
+       49,    0,    0,    0,    0,   49,    0,    0,   49,   49,
+       59,    0,    0,    0,   59,    0,    0,    0,    0,   59,
+        0,    0,    0,    0,    0,   59,    0,    0,    0,    0,
+       59,    0,    0,   59,   59,   60,    0,    0,    0,   60,
+        0,    0,    0,    0,   60,    0,    0,    0,    0,    0,
+
+       60,    0,    0,    0,    0,   60,    0,    0,   60,   62,
+        0,    0,    0,   62,    0,    0,    0,    0,   62,    0,
+        0,    0,    0,    0,   62,    0,    0,    0,    0,   62,
+        0,    0,   62,   62,   76,    0,    0,    0,   76,    0,
+        0,    0,    0,   76,    0,    0,    0,    0,    0,   76,
+        0,    0,    0,    0,   76,    0,    0,   76,   78,    0,
+        0,    0,   78,    0,    0,    0,    0,   78,    0,    0,
+        0,    0,    0,   78,    0,    0,    0,    0,   78,    0,
+        0,   78,   78,   80,    0,    0,    0,   80,    0,    0,
+        0,    0,   80,    0,    0,    0,    0,    0,   80,    0,
+
+        0,    0,    0,   80,    0,    0,   80,   80,   87,   87,
+        0,   87,   87,    0,    0,    0,    0,    0,    0,    0,
+       87,    0,   87,    0,    0,    0,   87,   94,    0,    0,
+        0,   94,    0,    0,    0,    0,   94,    0,    0,    0,
+        0,    0,   94,    0,    0,    0,    0,   94,    0,    0,
+       94,   94,   96,    0,    0,    0,   96,    0,    0,    0,
+        0,   96,    0,    0,    0,    0,    0,   96,    0,    0,
+        0,    0,   96,    0,    0,   96,   96,  115,    0,    0,
+        0,  115,    0,    0,    0,    0,  115,    0,    0,    0,
+        0,    0,  115,    0,    0,    0,    0,  115,    0,    0,
+
+      115,  115,  117,    0,    0,    0,  117,    0,    0,    0,
+        0,  117,    0,    0,    0,    0,    0,  117,    0,    0,
+        0,    0,  117,    0,    0,  117,  117,  136,    0,    0,
+        0,  136,    0,    0,    0,    0,  136,    0,    0,    0,
+        0,    0,  136,    0,    0,    0,    0,  136,    0,    0,
+      136,  136,  153,    0,    0,    0,  153,    0,    0,    0,
+        0,  153,    0,    0,    0,    0,    0,  153,    0,    0,
+        0,    0,  153,    0,    0,  153,  153,  189,    0,  189,
+      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
+
+      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  187,  187
+    } ;
+
+static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
+static char *yy_full_match;
+static int yy_lp;
+#define REJECT \
+{ \
+*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
+yy_cp = yy_full_match; /* restore poss. backed-over text */ \
+++yy_lp; \
+goto find_rule; \
+}
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#define INITIAL 0
+/*
+* Lex
+*/
+#include <string.h>
+#include <yyTemporal.h>
+
+extern const char *myinputptr;	/* current position in myinput */
+extern long  myinputlim;		/* end of data */
+
+int   lineno;
+char lexOut[1000];
+char sqlOutLex[1000];
+
+#undef YY_INPUT
+extern int my_yyinput(char* buf, int max_size);
+#define YY_INPUT(buffer, result, size) (result=my_yyinput(buffer,size))
+
+void initLexOut()
+{
+	for(int i=0; i<1000; ++i)
+	{
+		lexOut[i] = '\0';
+		sqlOutLex[i] = '\0';
+	}
+	return;
+}
+
+int my_yyinput(char* buf, int max_size)
+{
+	int n = max_size;
+//	int s = myinputlim - (int)myinputptr;
+	long s = myinputlim - (long)myinputptr;
+	if(max_size>s)
+		n = s;
+		
+	//int n = min(max_size, myinputlim - (int)myinputptr);
+	if(n>0)
+	{
+		initLexOut(); 
+		memcpy(buf, myinputptr, n);		
+		myinputptr += n;
+	}	
+	return n;
+}
+
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines.  This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( yy_current_buffer->yy_is_interactive ) \
+		{ \
+		int c = '*', n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else \
+		{ \
+		errno=0; \
+		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+			{ \
+			if( errno != EINTR) \
+				{ \
+				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+				break; \
+				} \
+			errno=0; \
+			clearerr(yyin); \
+			} \
+		}
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+	YY_USER_ACTION
+
+YY_DECL
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp, *yy_bp;
+	register int yy_act;
+
+
+
+
+	if ( yy_init )
+		{
+		yy_init = 0;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! yy_start )
+			yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! yy_current_buffer )
+			yy_current_buffer =
+				yy_create_buffer( yyin, YY_BUF_SIZE );
+
+		yy_load_buffer_state();
+		}
+
+	while ( 1 )		/* loops until end-of-file is reached */
+		{
+		yy_cp = yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yy_start;
+		yy_state_ptr = yy_state_buf;
+		*yy_state_ptr++ = yy_current_state;
+yy_match:
+		do
+			{
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 188 )
+					yy_c = yy_meta[(unsigned int) yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+			*yy_state_ptr++ = yy_current_state;
+			++yy_cp;
+			}
+		while ( yy_base[yy_current_state] != 581 );
+
+yy_find_action:
+		yy_current_state = *--yy_state_ptr;
+		yy_lp = yy_accept[yy_current_state];
+/* find_rule:  we branch to this label when backing up */
+		for ( ; ; ) /* until we find what rule we matched */
+			{
+			if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
+				{
+				yy_act = yy_acclist[yy_lp];
+					{
+					yy_full_match = yy_cp;
+					break;
+					}
+				}
+			--yy_cp;
+			yy_current_state = *--yy_state_ptr;
+			yy_lp = yy_accept[yy_current_state];
+			}
+
+		YY_DO_BEFORE_ACTION;
+
+		if ( yy_act != YY_END_OF_BUFFER )
+			{
+			int yyl;
+			for ( yyl = 0; yyl < yyleng; ++yyl )
+				if ( yytext[yyl] == '\n' )
+					++yylineno;
+			}
+
+do_action:	/* This label is used only to access EOF actions. */
+
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+case 1:
+YY_RULE_SETUP
+{ ; } 
+	YY_BREAK
+case 2:
+YY_RULE_SETUP
+{ ; }
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+{	strncat(sqlOutLex, yytext, strlen(yytext)); };
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+{  strncat(sqlOutLex, yytext, strlen(yytext)); };
+	YY_BREAK
+case 5:
+case 6:
+case 7:
+case 8:
+case 9:
+case 10:
+case 11:
+case 12:
+YY_RULE_SETUP
+{ strncat(lexOut, yytext, strlen(yytext));
+		strncat(lexOut, ";", 1); 
+		return TEMPORALRELATION; }
+	YY_BREAK
+case 13:
+case 14:
+case 15:
+case 16:
+case 17:
+case 18:
+case 19:
+case 20:
+case 21:
+case 22:
+YY_RULE_SETUP
+{ strncat(lexOut, yytext, strlen(yytext)); 
+		  return CHRONON; }
+	YY_BREAK
+case 23:
+YY_RULE_SETUP
+{ strncat(lexOut, yytext, strlen(yytext)); strncat(lexOut, ";", 1); return NUMBER;}
+	YY_BREAK
+case 24:
+YY_RULE_SETUP
+{ strncat(lexOut, yytext, strlen(yytext)); strncat(lexOut, ";", 1); return NUMBER;  }
+	YY_BREAK
+case 25:
+YY_RULE_SETUP
+{ strncat(lexOut, yytext, strlen(yytext)); strncat(lexOut, ";", 1); return NUMBER; }
+	YY_BREAK
+case 26:
+YY_RULE_SETUP
+{ strncat(lexOut, yytext, strlen(yytext)); strncat(lexOut, ";", 1); return MASK;}
+	YY_BREAK
+case 27:
+YY_RULE_SETUP
+{strncat(sqlOutLex, yytext, strlen(yytext)); return OR;} 
+	YY_BREAK
+case 28:
+YY_RULE_SETUP
+{strncat(sqlOutLex, yytext, strlen(yytext)); return AND;}
+	YY_BREAK
+case 29:
+YY_RULE_SETUP
+{strncat(sqlOutLex, yytext, strlen(yytext)); return NOT;}
+	YY_BREAK
+case 30:
+YY_RULE_SETUP
+{ strncat(lexOut, yytext, strlen(yytext)); strncat(lexOut, ";", 1); return NAME; }
+	YY_BREAK
+case 31:
+YY_RULE_SETUP
+{
+#if TePLATFORM != TePLATFORMCODE_AIX
+		int	yyinput();
+#endif
+		unsigned char c1=0,c2=yyinput();
+		while (1)
+		{
+			if ((char)c2==EOF) break;
+			if ((c1=='*') && (c2=='/')) break;
+			if (c2=='\n') {lineno++;}
+			c1=c2;
+			c2=yyinput();
+		}
+	}
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+{
+#if TePLATFORM != TePLATFORMCODE_AIX
+		int	yyinput();
+#endif
+		unsigned char c1=yyinput();
+		while (1)
+		{
+			if (c1=='\n') {lineno++;break;}
+			c1=yyinput();
+		}
+	}
+	YY_BREAK
+case 33:
+YY_RULE_SETUP
+{ lineno++; }
+	YY_BREAK
+case 34:
+YY_RULE_SETUP
+{ return yytext[0]; }
+	YY_BREAK
+case YY_STATE_EOF(INITIAL):
+{ return 0; }
+	YY_BREAK
+case 35:
+YY_RULE_SETUP
+ECHO;
+	YY_BREAK
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between yy_current_buffer and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yy_n_chars = yy_current_buffer->yy_n_chars;
+			yy_current_buffer->yy_input_file = yyin;
+			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state();
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+			yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yy_c_buf_p;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer() )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap() )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yy_c_buf_p =
+					yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yy_c_buf_p =
+				&yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+	{
+	register char *dest = yy_current_buffer->yy_ch_buf;
+	register char *source = yytext_ptr;
+	register int number_to_move, i;
+	int ret_val;
+
+	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( yy_current_buffer->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+	else
+		{
+		int num_to_read =
+			yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+			YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = yy_current_buffer;
+
+			int yy_c_buf_p_offset =
+				(int) (yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yy_flex_realloc( (void *) b->yy_ch_buf,
+							 b->yy_buf_size + 2 );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = yy_current_buffer->yy_buf_size -
+						number_to_move - 1;
+#endif
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+			yy_n_chars, num_to_read );
+
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	if ( yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin );
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			yy_current_buffer->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	yy_n_chars += number_to_move;
+	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+	return ret_val;
+	}
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp;
+
+	yy_current_state = yy_start;
+	yy_state_ptr = yy_state_buf;
+	*yy_state_ptr++ = yy_current_state;
+
+	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+		{
+		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 188 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		*yy_state_ptr++ = yy_current_state;
+		}
+
+	return yy_current_state;
+	}
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+	{
+	register int yy_is_jam;
+
+	register YY_CHAR yy_c = 1;
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 188 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 187);
+	if ( ! yy_is_jam )
+		*yy_state_ptr++ = yy_current_state;
+
+	return yy_is_jam ? 0 : yy_current_state;
+	}
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+	{
+	register char *yy_cp = yy_c_buf_p;
+
+	/* undo effects of setting up yytext */
+	*yy_cp = yy_hold_char;
+
+	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		{ /* need to shift things up to make room */
+		/* +2 for EOB chars. */
+		register int number_to_move = yy_n_chars + 2;
+		register char *dest = &yy_current_buffer->yy_ch_buf[
+					yy_current_buffer->yy_buf_size + 2];
+		register char *source =
+				&yy_current_buffer->yy_ch_buf[number_to_move];
+
+		while ( source > yy_current_buffer->yy_ch_buf )
+			*--dest = *--source;
+
+		yy_cp += (int) (dest - source);
+		yy_bp += (int) (dest - source);
+		yy_current_buffer->yy_n_chars =
+			yy_n_chars = yy_current_buffer->yy_buf_size;
+
+		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+		}
+
+	*--yy_cp = (char) c;
+
+	if ( c == '\n' )
+		--yylineno;
+
+	yytext_ptr = yy_bp;
+	yy_hold_char = *yy_cp;
+	yy_c_buf_p = yy_cp;
+	}
+#endif	/* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+	{
+	int c;
+
+	*yy_c_buf_p = yy_hold_char;
+
+	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			/* This was really a NUL. */
+			*yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			int offset = yy_c_buf_p - yytext_ptr;
+			++yy_c_buf_p;
+
+			switch ( yy_get_next_buffer() )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yyrestart( yyin );
+
+					/* fall through */
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yywrap() )
+						return EOF;
+
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput();
+#else
+					return input();
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					yy_c_buf_p = yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
+	*yy_c_buf_p = '\0';	/* preserve yytext */
+	yy_hold_char = *++yy_c_buf_p;
+
+	if ( c == '\n' )
+		++yylineno;
+
+	return c;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+	{
+	if ( ! yy_current_buffer )
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+	yy_init_buffer( yy_current_buffer, input_file );
+	yy_load_buffer_state();
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+	{
+	if ( yy_current_buffer == new_buffer )
+		return;
+
+	if ( yy_current_buffer )
+		{
+		/* Flush out information for old buffer. */
+		*yy_c_buf_p = yy_hold_char;
+		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	yy_current_buffer = new_buffer;
+	yy_load_buffer_state();
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yy_did_buffer_switch_on_eof = 1;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+	{
+	yy_n_chars = yy_current_buffer->yy_n_chars;
+	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+	yyin = yy_current_buffer->yy_input_file;
+	yy_hold_char = *yy_c_buf_p;
+	}
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	yy_init_buffer( b, file );
+
+	return b;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+	{
+	if ( ! b )
+		return;
+
+	if ( b == yy_current_buffer )
+		yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		yy_flex_free( (void *) b->yy_ch_buf );
+
+	yy_flex_free( (void *) b );
+	}
+
+
+#ifndef _WIN32
+#include <unistd.h>
+#else
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+//extern int isatty YY_PROTO(( int ));
+#endif
+#endif
+#endif
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+	{
+	yy_flush_buffer( b );
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+	b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+	b->yy_is_interactive = 0;
+#else
+//	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+	{
+	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == yy_current_buffer )
+		yy_load_buffer_state();
+	}
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return 0;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = 0;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	yy_switch_to_buffer( b );
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+	{
+	int len;
+	for ( len = 0; yy_str[len]; ++len )
+		;
+
+	return yy_scan_bytes( yy_str, len );
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+	{
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n;
+	int i;
+
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = len + 2;
+	buf = (char *) yy_flex_alloc( n );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+	for ( i = 0; i < len; ++i )
+		buf[i] = bytes[i];
+
+	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yy_scan_buffer( buf, n );
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+	{
+	if ( yy_start_stack_ptr >= yy_start_stack_depth )
+		{
+		yy_size_t new_size;
+
+		yy_start_stack_depth += YY_START_STACK_INCR;
+		new_size = yy_start_stack_depth * sizeof( int );
+
+		if ( ! yy_start_stack )
+			yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+		else
+			yy_start_stack = (int *) yy_flex_realloc(
+					(void *) yy_start_stack, new_size );
+
+		if ( ! yy_start_stack )
+			YY_FATAL_ERROR(
+			"out of memory expanding start-condition stack" );
+		}
+
+	yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+	BEGIN(new_state);
+	}
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+	{
+	if ( --yy_start_stack_ptr < 0 )
+		YY_FATAL_ERROR( "start-condition stack underflow" );
+
+	BEGIN(yy_start_stack[yy_start_stack_ptr]);
+	}
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+	{
+	return yy_start_stack[yy_start_stack_ptr - 1];
+	}
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+	{
+	(void) fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
+	}
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		yytext[yyleng] = yy_hold_char; \
+		yy_c_buf_p = yytext + n; \
+		yy_hold_char = *yy_c_buf_p; \
+		*yy_c_buf_p = '\0'; \
+		yyleng = n; \
+		} \
+	while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+	{
+	register int i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+	}
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+	{
+	register int n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+	}
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+	{
+	return (void *) malloc( size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+	{
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return (void *) realloc( (char *) ptr, size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+	{
+	free( ptr );
+	}
+
+#if YY_MAIN
+int main()
+	{
+	yylex();
+	return 0;
+	}
+#endif
+
diff --git a/src/terralib/kernel/showseq.h b/src/terralib/kernel/showseq.h
old mode 100755
new mode 100644
index 4d9a1fc..04276a8
--- a/src/terralib/kernel/showseq.h
+++ b/src/terralib/kernel/showseq.h
@@ -1,23 +1,23 @@
-// Template zur Anzeige von Sequenzen
-// Template for the display of sequences (file include/showseq)
-#ifndef SHOWSEQ_H
-#define SHOWSEQ_H
-
-#include<iostream>
-
-namespace br_stl {
-
-template<class Container>
-void showSequence(const Container& s, const char* sep = " ",
-                  std::ostream& where = std::cout) {
-   typename Container::const_iterator iter = s.begin();
-   while(iter != s.end())
-      where << *iter++ << sep;
-   where << std::endl;
-}
-
-
-} // namespace br_stl
-
-#endif
-
+// Template zur Anzeige von Sequenzen
+// Template for the display of sequences (file include/showseq)
+#ifndef SHOWSEQ_H
+#define SHOWSEQ_H
+
+#include<iostream>
+
+namespace br_stl {
+
+template<class Container>
+void showSequence(const Container& s, const char* sep = " ",
+                  std::ostream& where = std::cout) {
+   typename Container::const_iterator iter = s.begin();
+   while(iter != s.end())
+      where << *iter++ << sep;
+   where << std::endl;
+}
+
+
+} // namespace br_stl
+
+#endif
+
diff --git a/src/terralib/kernel/yyTemporal.cpp b/src/terralib/kernel/yyTemporal.cpp
old mode 100755
new mode 100644
index af50c96..01aaa45
--- a/src/terralib/kernel/yyTemporal.cpp
+++ b/src/terralib/kernel/yyTemporal.cpp
@@ -1,495 +1,495 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifdef WIN32
-#pragma warning ( disable: 4786 )
-#endif
-
-#ifndef lint
-static char const 
-yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $";
-#endif
-#include <stdlib.h>
-#define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-#define YYLEX yylex()
-#define YYEMPTY -1
-#define yyclearin (yychar=(YYEMPTY))
-#define yyerrok (yyerrflag=0)
-#define YYRECOVERING() (yyerrflag!=0)
-static int yygrowstack();
-#define YYPREFIX "yy"
-#include <stdio.h>
-#include <iostream>
-#include <string.h>
-#include <TeDatabase.h>
-
-extern int yylex();
-extern void initLexOut();
-
-extern char lexOut[1000];
-extern char sqlOutLex[1000];
-
-char sqlOut[1000];
-char tempSql[1000];
-string aux;
-
-const char*	myinputptr;
-string  myinputptr_aux;
-long myinputlim;	
-
-TeDatabase* database_;
-
-int initParse(const string& strIn, TeDatabase* db)
-{	
-	for(int i=0; i<1000; ++i)
-	{
-		sqlOut[i] = '\0';
-		tempSql[i]= '\0';
-	}
-
-	//myinputptr = new char();
-	//memcpy(myinputptr, strIn.c_str(), strIn.size ());
-	myinputptr_aux = strIn;
-	myinputptr = myinputptr_aux.c_str();
-	
-	myinputlim = (long)myinputptr + strIn.size ();	
-	database_ = db;
-	return 1;
-}
-
-void yyerror(char* msg)
-{	
-	if(strcmp(msg,"syntax error"))
-		printf(" Syntax Error : %s\n", msg);
-}
-
-#define YYERRCODE 256
-#define TEMPORALRELATION 257
-#define CHRONON 258
-#define NAME 259
-#define NUMBER 260
-#define MASK 261
-#define OR 262
-#define AND 263
-#define NOT 264
-const short yylhs[] = {                                        -1,
-    0,    0,    0,    0,    0,
-};
-const short yylen[] = {                                         2,
-   15,    2,    3,    3,    3,
-};
-const short yydefred[] = {                                      0,
-    0,    0,    0,    0,    0,    2,    0,    0,    0,    0,
-    3,    0,    4,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    1,
-};
-const short yydgoto[] = {                                       4,
-};
-const short yysindex[] = {                                    -40,
-  -52,  -40,  -40, -260, -251,    0,  -37,  -40,  -40,  -50,
-    0, -253,    0, -246,  -45, -242,  -43, -243,  -41, -241,
-  -39, -240,  -36, -236,    0,
-};
-const short yyrindex[] = {                                      0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    1,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,
-};
-const short yygindex[] = {                                      3,
-};
-#define YYTABLESIZE 263
-const short yytable[] = {                                       3,
-    5,    8,    9,   11,    6,    7,    5,   10,   14,    9,
-   12,   13,   15,   16,   17,   18,   19,   20,   21,   22,
-   23,   25,   24,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    5,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    1,    0,
-    0,    0,    0,    2,    8,    9,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    5,
-};
-const short yycheck[] = {                                      40,
-    0,  262,  263,   41,    2,    3,   59,  259,   59,  263,
-    8,    9,  259,   59,  257,   59,  260,   59,  260,   59,
-  261,  258,   59,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   41,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  259,   -1,
-   -1,   -1,   -1,  264,  262,  263,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  262,
-};
-#define YYFINAL 4
-#ifndef YYDEBUG
-#define YYDEBUG 0
-#endif
-#define YYMAXTOKEN 264
-#if YYDEBUG
-const char * const yyname[] = {
-"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,"'('","')'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"TEMPORALRELATION",
-"CHRONON","NAME","NUMBER","MASK","OR","AND","NOT",
-};
-const char * const yyrule[] = {
-"$accept : exp",
-"exp : NAME ';' NAME ';' NAME ';' TEMPORALRELATION ';' NUMBER ';' NUMBER ';' MASK ';' CHRONON",
-"exp : NOT exp",
-"exp : '(' exp ')'",
-"exp : exp AND exp",
-"exp : exp OR exp",
-};
-#endif
-#ifndef YYSTYPE
-typedef int YYSTYPE;
-#endif
-#if YYDEBUG
-#include <stdio.h>
-#endif
-#ifdef YYSTACKSIZE
-#undef YYMAXDEPTH
-#define YYMAXDEPTH YYSTACKSIZE
-#else
-#ifdef YYMAXDEPTH
-#define YYSTACKSIZE YYMAXDEPTH
-#else
-#define YYSTACKSIZE 10000
-#define YYMAXDEPTH 10000
-#endif
-#endif
-#define YYINITSTACKSIZE 200
-int yydebug;
-int yynerrs;
-int yyerrflag;
-int yychar;
-short *yyssp;
-YYSTYPE *yyvsp;
-YYSTYPE yyval;
-YYSTYPE yylval;
-short *yyss;
-short *yysslim;
-YYSTYPE *yyvs;
-int yystacksize;
-
-
-/* allocate initial stack or double stack size, up to YYMAXDEPTH */
-static int yygrowstack()
-{
-    int newsize, i;
-    short *newss;
-    YYSTYPE *newvs;
-
-    if ((newsize = yystacksize) == 0)
-        newsize = YYINITSTACKSIZE;
-    else if (newsize >= YYMAXDEPTH)
-        return -1;
-    else if ((newsize *= 2) > YYMAXDEPTH)
-        newsize = YYMAXDEPTH;
-    i = yyssp - yyss;
-    newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :
-      (short *)malloc(newsize * sizeof *newss);
-    if (newss == NULL)
-        return -1;
-    yyss = newss;
-    yyssp = newss + i;
-    newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :
-      (YYSTYPE *)malloc(newsize * sizeof *newvs);
-    if (newvs == NULL)
-        return -1;
-    yyvs = newvs;
-    yyvsp = newvs + i;
-    yystacksize = newsize;
-    yysslim = yyss + newsize - 1;
-    return 0;
-}
-
-#define YYABORT goto yyabort
-#define YYREJECT goto yyabort
-#define YYACCEPT goto yyaccept
-#define YYERROR goto yyerrlab
-
-#ifndef YYPARSE_PARAM
-#if defined(__cplusplus) || __STDC__
-#define YYPARSE_PARAM_ARG void
-#define YYPARSE_PARAM_DECL
-#else	/* ! ANSI-C/C++ */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif	/* ANSI-C/C++ */
-#else	/* YYPARSE_PARAM */
-#ifndef YYPARSE_PARAM_TYPE
-#define YYPARSE_PARAM_TYPE void *
-#endif
-#if defined(__cplusplus) || __STDC__
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else	/* ! ANSI-C/C++ */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;
-#endif	/* ANSI-C/C++ */
-#endif	/* ! YYPARSE_PARAM */
-
-int
-yyparse (string& sql/*, YYPARSE_PARAM_ARG*/)
-    YYPARSE_PARAM_DECL
-{
-    register int yym, yyn, yystate;
-	string aux = "";
-#if YYDEBUG
-    register const char *yys;
-
-    if ((yys = getenv("YYDEBUG")))
-    {
-        yyn = *yys;
-        if (yyn >= '0' && yyn <= '9')
-            yydebug = yyn - '0';
-    }
-#endif
-
-    yynerrs = 0;
-    yyerrflag = 0;
-    yychar = (-1);
-
-    if (yyss == NULL && yygrowstack()) goto yyoverflow;
-    yyssp = yyss;
-    yyvsp = yyvs;
-    *yyssp = yystate = 0;
-
-yyloop:
-    if ((yyn = yydefred[yystate])) goto yyreduce;
-    if (yychar < 0)
-    {
-        if ((yychar = yylex()) < 0) yychar = 0;
-#if YYDEBUG
-        if (yydebug)
-        {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
-            printf("%sdebug: state %d, reading %d (%s)\n",
-                    YYPREFIX, yystate, yychar, yys);
-        }
-#endif
-    }
-    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
-    {
-#if YYDEBUG
-        if (yydebug)
-            printf("%sdebug: state %d, shifting to state %d\n",
-                    YYPREFIX, yystate, yytable[yyn]);
-#endif
-        if (yyssp >= yysslim && yygrowstack())
-        {
-            goto yyoverflow;
-        }
-        *++yyssp = yystate = yytable[yyn];
-        *++yyvsp = yylval;
-        yychar = (-1);
-        if (yyerrflag > 0)  --yyerrflag;
-        goto yyloop;
-    }
-    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
-    {
-        yyn = yytable[yyn];
-        goto yyreduce;
-    }
-    if (yyerrflag) goto yyinrecovery;
-#if defined(lint) || defined(__GNUC__)
-	yyerror("syntax error");
-   ++yynerrs;
-#endif
-yyinrecovery:
-    if (yyerrflag < 3)
-    {
-        yyerrflag = 3;
-        for (;;)
-        {
-            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
-                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
-            {
-#if YYDEBUG
-                if (yydebug)
-                    printf("%sdebug: state %d, error recovery shifting\
- to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
-#endif
-                if (yyssp >= yysslim && yygrowstack())
-                {
-                    goto yyoverflow;
-                }
-                *++yyssp = yystate = yytable[yyn];
-                *++yyvsp = yylval;
-                goto yyloop;
-            }
-            else
-            {
-#if YYDEBUG
-                if (yydebug)
-                    printf("%sdebug: error recovery discarding state %d\n",
-                            YYPREFIX, *yyssp);
-#endif
-                if (yyssp <= yyss) goto yyabort;
-                --yyssp;
-                --yyvsp;
-            }
-        }
-    }
-    else
-    {
-        if (yychar == 0) goto yyabort;
-#if YYDEBUG
-        if (yydebug)
-        {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
-            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
-                    YYPREFIX, yystate, yychar, yys);
-        }
-#endif
-        yychar = (-1);
-        goto yyloop;
-    }
-yyreduce:
-#if YYDEBUG
-    if (yydebug)
-        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
-                YYPREFIX, yystate, yyn, yyrule[yyn]);
-#endif
-    yym = yylen[yyn];
-    yyval = yyvsp[1-yym];
-    switch (yyn)
-    {
-case 1:
-{	 
-				strncat(sqlOut, sqlOutLex, strlen(sqlOutLex));
-				aux = database_->getSQLTemporalWhere (string(lexOut)); 
-				memcpy(tempSql, aux.c_str(), aux.size());
-				strncat(sqlOut, tempSql, strlen(tempSql));
-				initLexOut(); 
-			}
-break;
-    }
-    yyssp -= yym;
-    yystate = *yyssp;
-    yyvsp -= yym;
-    yym = yylhs[yyn];
-    if (yystate == 0 && yym == 0)
-    {
-#if YYDEBUG
-        if (yydebug)
-            printf("%sdebug: after reduction, shifting from state 0 to\
- state %d\n", YYPREFIX, YYFINAL);
-#endif
-        yystate = YYFINAL;
-        *++yyssp = YYFINAL;
-        *++yyvsp = yyval;
-        if (yychar < 0)
-        {
-            if ((yychar = yylex()) < 0) yychar = 0;
-#if YYDEBUG
-            if (yydebug)
-            {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
-                printf("%sdebug: state %d, reading %d (%s)\n",
-                        YYPREFIX, YYFINAL, yychar, yys);
-            }
-#endif
-        }
-        if (yychar == 0) goto yyaccept;
-        goto yyloop;
-    }
-    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
-        yystate = yytable[yyn];
-    else
-        yystate = yydgoto[yym];
-#if YYDEBUG
-    if (yydebug)
-        printf("%sdebug: after reduction, shifting from state %d \
-to state %d\n", YYPREFIX, *yyssp, yystate);
-#endif
-    if (yyssp >= yysslim && yygrowstack())
-    {
-        goto yyoverflow;
-    }
-    *++yyssp = yystate;
-    *++yyvsp = yyval;
-    goto yyloop;
-yyoverflow:
-    yyerror("yacc stack overflow");
-yyabort:
-    return (1);
-yyaccept:
-    {
-		sql = string(sqlOut);
-		//delete(myinputptr); cai!!!!
-		return (0);
-	}
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifdef WIN32
+#pragma warning ( disable: 4786 )
+#endif
+
+#ifndef lint
+static char const 
+yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $";
+#endif
+#include <stdlib.h>
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+#define YYLEX yylex()
+#define YYEMPTY -1
+#define yyclearin (yychar=(YYEMPTY))
+#define yyerrok (yyerrflag=0)
+#define YYRECOVERING() (yyerrflag!=0)
+static int yygrowstack();
+#define YYPREFIX "yy"
+#include <stdio.h>
+#include <iostream>
+#include <string.h>
+#include <TeDatabase.h>
+
+extern int yylex();
+extern void initLexOut();
+
+extern char lexOut[1000];
+extern char sqlOutLex[1000];
+
+char sqlOut[1000];
+char tempSql[1000];
+string aux;
+
+const char*	myinputptr;
+string  myinputptr_aux;
+long myinputlim;	
+
+TeDatabase* database_;
+
+int initParse(const string& strIn, TeDatabase* db)
+{	
+	for(int i=0; i<1000; ++i)
+	{
+		sqlOut[i] = '\0';
+		tempSql[i]= '\0';
+	}
+
+	//myinputptr = new char();
+	//memcpy(myinputptr, strIn.c_str(), strIn.size ());
+	myinputptr_aux = strIn;
+	myinputptr = myinputptr_aux.c_str();
+	
+	myinputlim = (long)myinputptr + strIn.size ();	
+	database_ = db;
+	return 1;
+}
+
+void yyerror(char* msg)
+{	
+	if(strcmp(msg,"syntax error"))
+		printf(" Syntax Error : %s\n", msg);
+}
+
+#define YYERRCODE 256
+#define TEMPORALRELATION 257
+#define CHRONON 258
+#define NAME 259
+#define NUMBER 260
+#define MASK 261
+#define OR 262
+#define AND 263
+#define NOT 264
+const short yylhs[] = {                                        -1,
+    0,    0,    0,    0,    0,
+};
+const short yylen[] = {                                         2,
+   15,    2,    3,    3,    3,
+};
+const short yydefred[] = {                                      0,
+    0,    0,    0,    0,    0,    2,    0,    0,    0,    0,
+    3,    0,    4,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    1,
+};
+const short yydgoto[] = {                                       4,
+};
+const short yysindex[] = {                                    -40,
+  -52,  -40,  -40, -260, -251,    0,  -37,  -40,  -40,  -50,
+    0, -253,    0, -246,  -45, -242,  -43, -243,  -41, -241,
+  -39, -240,  -36, -236,    0,
+};
+const short yyrindex[] = {                                      0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    1,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,
+};
+const short yygindex[] = {                                      3,
+};
+#define YYTABLESIZE 263
+const short yytable[] = {                                       3,
+    5,    8,    9,   11,    6,    7,    5,   10,   14,    9,
+   12,   13,   15,   16,   17,   18,   19,   20,   21,   22,
+   23,   25,   24,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    5,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    1,    0,
+    0,    0,    0,    2,    8,    9,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    5,
+};
+const short yycheck[] = {                                      40,
+    0,  262,  263,   41,    2,    3,   59,  259,   59,  263,
+    8,    9,  259,   59,  257,   59,  260,   59,  260,   59,
+  261,  258,   59,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   41,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  259,   -1,
+   -1,   -1,   -1,  264,  262,  263,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,  262,
+};
+#define YYFINAL 4
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 264
+#if YYDEBUG
+const char * const yyname[] = {
+"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,"'('","')'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"TEMPORALRELATION",
+"CHRONON","NAME","NUMBER","MASK","OR","AND","NOT",
+};
+const char * const yyrule[] = {
+"$accept : exp",
+"exp : NAME ';' NAME ';' NAME ';' TEMPORALRELATION ';' NUMBER ';' NUMBER ';' MASK ';' CHRONON",
+"exp : NOT exp",
+"exp : '(' exp ')'",
+"exp : exp AND exp",
+"exp : exp OR exp",
+};
+#endif
+#ifndef YYSTYPE
+typedef int YYSTYPE;
+#endif
+#if YYDEBUG
+#include <stdio.h>
+#endif
+#ifdef YYSTACKSIZE
+#undef YYMAXDEPTH
+#define YYMAXDEPTH YYSTACKSIZE
+#else
+#ifdef YYMAXDEPTH
+#define YYSTACKSIZE YYMAXDEPTH
+#else
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH 10000
+#endif
+#endif
+#define YYINITSTACKSIZE 200
+int yydebug;
+int yynerrs;
+int yyerrflag;
+int yychar;
+short *yyssp;
+YYSTYPE *yyvsp;
+YYSTYPE yyval;
+YYSTYPE yylval;
+short *yyss;
+short *yysslim;
+YYSTYPE *yyvs;
+int yystacksize;
+
+
+/* allocate initial stack or double stack size, up to YYMAXDEPTH */
+static int yygrowstack()
+{
+    int newsize, i;
+    short *newss;
+    YYSTYPE *newvs;
+
+    if ((newsize = yystacksize) == 0)
+        newsize = YYINITSTACKSIZE;
+    else if (newsize >= YYMAXDEPTH)
+        return -1;
+    else if ((newsize *= 2) > YYMAXDEPTH)
+        newsize = YYMAXDEPTH;
+    i = yyssp - yyss;
+    newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :
+      (short *)malloc(newsize * sizeof *newss);
+    if (newss == NULL)
+        return -1;
+    yyss = newss;
+    yyssp = newss + i;
+    newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :
+      (YYSTYPE *)malloc(newsize * sizeof *newvs);
+    if (newvs == NULL)
+        return -1;
+    yyvs = newvs;
+    yyvsp = newvs + i;
+    yystacksize = newsize;
+    yysslim = yyss + newsize - 1;
+    return 0;
+}
+
+#define YYABORT goto yyabort
+#define YYREJECT goto yyabort
+#define YYACCEPT goto yyaccept
+#define YYERROR goto yyerrlab
+
+#ifndef YYPARSE_PARAM
+#if defined(__cplusplus) || __STDC__
+#define YYPARSE_PARAM_ARG void
+#define YYPARSE_PARAM_DECL
+#else	/* ! ANSI-C/C++ */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif	/* ANSI-C/C++ */
+#else	/* YYPARSE_PARAM */
+#ifndef YYPARSE_PARAM_TYPE
+#define YYPARSE_PARAM_TYPE void *
+#endif
+#if defined(__cplusplus) || __STDC__
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else	/* ! ANSI-C/C++ */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;
+#endif	/* ANSI-C/C++ */
+#endif	/* ! YYPARSE_PARAM */
+
+int
+yyparse (string& sql/*, YYPARSE_PARAM_ARG*/)
+    YYPARSE_PARAM_DECL
+{
+    register int yym, yyn, yystate;
+	string aux = "";
+#if YYDEBUG
+    register const char *yys;
+
+    if ((yys = getenv("YYDEBUG")))
+    {
+        yyn = *yys;
+        if (yyn >= '0' && yyn <= '9')
+            yydebug = yyn - '0';
+    }
+#endif
+
+    yynerrs = 0;
+    yyerrflag = 0;
+    yychar = (-1);
+
+    if (yyss == NULL && yygrowstack()) goto yyoverflow;
+    yyssp = yyss;
+    yyvsp = yyvs;
+    *yyssp = yystate = 0;
+
+yyloop:
+    if ((yyn = yydefred[yystate])) goto yyreduce;
+    if (yychar < 0)
+    {
+        if ((yychar = yylex()) < 0) yychar = 0;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys = 0;
+            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
+            if (!yys) yys = "illegal-symbol";
+            printf("%sdebug: state %d, reading %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+    }
+    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
+            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: state %d, shifting to state %d\n",
+                    YYPREFIX, yystate, yytable[yyn]);
+#endif
+        if (yyssp >= yysslim && yygrowstack())
+        {
+            goto yyoverflow;
+        }
+        *++yyssp = yystate = yytable[yyn];
+        *++yyvsp = yylval;
+        yychar = (-1);
+        if (yyerrflag > 0)  --yyerrflag;
+        goto yyloop;
+    }
+    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
+            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
+    {
+        yyn = yytable[yyn];
+        goto yyreduce;
+    }
+    if (yyerrflag) goto yyinrecovery;
+#if defined(lint) || defined(__GNUC__)
+	yyerror("syntax error");
+   ++yynerrs;
+#endif
+yyinrecovery:
+    if (yyerrflag < 3)
+    {
+        yyerrflag = 3;
+        for (;;)
+        {
+            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
+                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
+#endif
+                if (yyssp >= yysslim && yygrowstack())
+                {
+                    goto yyoverflow;
+                }
+                *++yyssp = yystate = yytable[yyn];
+                *++yyvsp = yylval;
+                goto yyloop;
+            }
+            else
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: error recovery discarding state %d\n",
+                            YYPREFIX, *yyssp);
+#endif
+                if (yyssp <= yyss) goto yyabort;
+                --yyssp;
+                --yyvsp;
+            }
+        }
+    }
+    else
+    {
+        if (yychar == 0) goto yyabort;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys = 0;
+            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
+            if (!yys) yys = "illegal-symbol";
+            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+        yychar = (-1);
+        goto yyloop;
+    }
+yyreduce:
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+                YYPREFIX, yystate, yyn, yyrule[yyn]);
+#endif
+    yym = yylen[yyn];
+    yyval = yyvsp[1-yym];
+    switch (yyn)
+    {
+case 1:
+{	 
+				strncat(sqlOut, sqlOutLex, strlen(sqlOutLex));
+				aux = database_->getSQLTemporalWhere (string(lexOut)); 
+				memcpy(tempSql, aux.c_str(), aux.size());
+				strncat(sqlOut, tempSql, strlen(tempSql));
+				initLexOut(); 
+			}
+break;
+    }
+    yyssp -= yym;
+    yystate = *yyssp;
+    yyvsp -= yym;
+    yym = yylhs[yyn];
+    if (yystate == 0 && yym == 0)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
+#endif
+        yystate = YYFINAL;
+        *++yyssp = YYFINAL;
+        *++yyvsp = yyval;
+        if (yychar < 0)
+        {
+            if ((yychar = yylex()) < 0) yychar = 0;
+#if YYDEBUG
+            if (yydebug)
+            {
+                yys = 0;
+                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
+                if (!yys) yys = "illegal-symbol";
+                printf("%sdebug: state %d, reading %d (%s)\n",
+                        YYPREFIX, YYFINAL, yychar, yys);
+            }
+#endif
+        }
+        if (yychar == 0) goto yyaccept;
+        goto yyloop;
+    }
+    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
+            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
+        yystate = yytable[yyn];
+    else
+        yystate = yydgoto[yym];
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yyssp, yystate);
+#endif
+    if (yyssp >= yysslim && yygrowstack())
+    {
+        goto yyoverflow;
+    }
+    *++yyssp = yystate;
+    *++yyvsp = yyval;
+    goto yyloop;
+yyoverflow:
+    yyerror("yacc stack overflow");
+yyabort:
+    return (1);
+yyaccept:
+    {
+		sql = string(sqlOut);
+		//delete(myinputptr); cai!!!!
+		return (0);
+	}
+}
diff --git a/src/terralib/kernel/yyTemporal.h b/src/terralib/kernel/yyTemporal.h
old mode 100755
new mode 100644
index d0ee19e..0ddc760
--- a/src/terralib/kernel/yyTemporal.h
+++ b/src/terralib/kernel/yyTemporal.h
@@ -1,35 +1,35 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifndef YYERRCODE
-#define YYERRCODE 256
-#endif
-
-#define TEMPORALRELATION 257
-#define CHRONON 258
-#define NAME 259
-#define NUMBER 260
-#define MASK 261
-#define OR 262
-#define AND 263
-#define NOT 264
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef YYERRCODE
+#define YYERRCODE 256
+#endif
+
+#define TEMPORALRELATION 257
+#define CHRONON 258
+#define NAME 259
+#define NUMBER 260
+#define MASK 261
+#define OR 262
+#define AND 263
+#define NOT 264
diff --git a/src/terralib/stat/TeBayesFunctions.cpp b/src/terralib/stat/TeBayesFunctions.cpp
old mode 100755
new mode 100644
index efccbf5..af83386
--- a/src/terralib/stat/TeBayesFunctions.cpp
+++ b/src/terralib/stat/TeBayesFunctions.cpp
@@ -1,90 +1,90 @@
-#include "TeBayesFunctions.h"
-
-// TeGlobalEmpiricalBayes				// Function declaration
-bool TeGlobalEmpiricalBayes(TeSTStatInstanceSet *rs, double rate)
-{
-	TeSTStatInstanceSet::iterator it = rs->begin();
-	
-	long int Narea=0;	// number of areas
-	long int count;		// Counter
-	double m_hat;		// the global rate
-	double n_;			// the mean population in risk
-	double s2=0;		// s2 = sum(n(i)(r(i) - m_hat)^2)/n
-	double sum_n=0;		//
-	double sum_y=0;		//
-	vector<double> r;	// the rate for each area
-	vector<double> n;	// the population in each area
-	vector<double> y;	// the cases in each area
-	double aux;			// auxiliary variable
-
-	try{
-
-		while(it != rs->end())
-		{
-			(*it).getDoubleProperty(0,aux);
-			n.push_back(aux);
-			(*it).getDoubleProperty(1,aux);
-			y.push_back(aux);
-			++Narea;
-			r.push_back(y[Narea-1]/n[Narea-1]);
-			sum_n+=n[Narea-1];
-			sum_y+=y[Narea-1];
-			++it;
-		
-			// Check if the population is smaller than the 
-			// number of cases
-			//if(n[Narea-1]<=y[Narea-1])
-			//	throw TeGlobalBayesException(BAYES_GREATER_CASES);
-			if(n[Narea-1]<=0)
-				throw TeGlobalBayesException(BAYES_NULL_POPULATION);
-		}
-
-		m_hat = sum_y/sum_n;
-		n_	  = sum_n/Narea;
-
-		for(count=0;count<Narea;count++)
-		{
-			s2+= n[count]*(r[count]-m_hat)*(r[count]-m_hat);
-		}
-		s2=s2/sum_n;
-
-		it = rs->begin();
-		aux = s2 - (m_hat/n_);
-	
-		if(aux<=0)
-		{
-            aux = 0;
-        }
-
-		double Theta_i, Ci, pop, cases;
-		while(it != rs->end())
-		{
-			(*it).getDoubleProperty(0,pop);
-			(*it).getDoubleProperty(1,cases);
-			if ((aux == 0) && (m_hat == 0))
-                Ci = 1;
-            else 
-			    Ci = (aux)/(aux + (m_hat/pop));
-			Theta_i = Ci*(cases/pop) + (1-Ci)*m_hat;
-			(*it).setDoubleProperty(2,Theta_i*rate);
-			++it;
-		}
-
-	}catch(TeGlobalBayesException e)
-		{
-/*			switch(e.getErrorCode()){
-			case BAYES_GREATER_CASES:
-			break;
-			case BAYES_NULL_POPULATION:
-			break;
-			}*/
-      e.getErrorCode();
-			return(false);
-		}
-
-	return(true);
-}
-
-
-
-
+#include "TeBayesFunctions.h"
+
+// TeGlobalEmpiricalBayes				// Function declaration
+bool TeGlobalEmpiricalBayes(TeSTStatInstanceSet *rs, double rate)
+{
+	TeSTStatInstanceSet::iterator it = rs->begin();
+	
+	long int Narea=0;	// number of areas
+	long int count;		// Counter
+	double m_hat;		// the global rate
+	double n_;			// the mean population in risk
+	double s2=0;		// s2 = sum(n(i)(r(i) - m_hat)^2)/n
+	double sum_n=0;		//
+	double sum_y=0;		//
+	vector<double> r;	// the rate for each area
+	vector<double> n;	// the population in each area
+	vector<double> y;	// the cases in each area
+	double aux;			// auxiliary variable
+
+	try{
+
+		while(it != rs->end())
+		{
+			(*it).getDoubleProperty(0,aux);
+			n.push_back(aux);
+			(*it).getDoubleProperty(1,aux);
+			y.push_back(aux);
+			++Narea;
+			r.push_back(y[Narea-1]/n[Narea-1]);
+			sum_n+=n[Narea-1];
+			sum_y+=y[Narea-1];
+			++it;
+		
+			// Check if the population is smaller than the 
+			// number of cases
+			//if(n[Narea-1]<=y[Narea-1])
+			//	throw TeGlobalBayesException(BAYES_GREATER_CASES);
+			if(n[Narea-1]<=0)
+				throw TeGlobalBayesException(BAYES_NULL_POPULATION);
+		}
+
+		m_hat = sum_y/sum_n;
+		n_	  = sum_n/Narea;
+
+		for(count=0;count<Narea;count++)
+		{
+			s2+= n[count]*(r[count]-m_hat)*(r[count]-m_hat);
+		}
+		s2=s2/sum_n;
+
+		it = rs->begin();
+		aux = s2 - (m_hat/n_);
+	
+		if(aux<=0)
+		{
+            aux = 0;
+        }
+
+		double Theta_i, Ci, pop, cases;
+		while(it != rs->end())
+		{
+			(*it).getDoubleProperty(0,pop);
+			(*it).getDoubleProperty(1,cases);
+			if ((aux == 0) && (m_hat == 0))
+                Ci = 1;
+            else 
+			    Ci = (aux)/(aux + (m_hat/pop));
+			Theta_i = Ci*(cases/pop) + (1-Ci)*m_hat;
+			(*it).setDoubleProperty(2,Theta_i*rate);
+			++it;
+		}
+
+	}catch(TeGlobalBayesException e)
+		{
+/*			switch(e.getErrorCode()){
+			case BAYES_GREATER_CASES:
+			break;
+			case BAYES_NULL_POPULATION:
+			break;
+			}*/
+      e.getErrorCode();
+			return(false);
+		}
+
+	return(true);
+}
+
+
+
+
diff --git a/src/terralib/stat/TeBayesFunctions.h b/src/terralib/stat/TeBayesFunctions.h
old mode 100755
new mode 100644
index 18f5bad..ede9d97
--- a/src/terralib/stat/TeBayesFunctions.h
+++ b/src/terralib/stat/TeBayesFunctions.h
@@ -1,208 +1,208 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeBayesFunctions.h
-    \brief This file contains functions to calculate Bayesian Indexes 
-*/
-
-#ifndef __TEBAYESFUNCTIONSH__
-#define __TEBAYESFUNCTIONSH__
-
-#include "TeStatDataStructures.h"
-#include "TeSTElementSet.h"
-#include "TeNeighbours.h"
-
-/** @defgroup STEBayesEstimation Bayes Estimation from TerraLib's spatio-temporal containers
- *  @ingroup SpatialStatistics
- *  @{
-*/
-//! Error codes
-enum TeGlobalBayesError {
-   BAYES_GREATER_CASES,
-   BAYES_NULL_POPULATION
-};
-
-//! A class of exceptions
-class STAT_DLL TeGlobalBayesException  {
-   TeGlobalBayesError error_;
-
-public:
-
-  TeGlobalBayesException(TeGlobalBayesError e) {
-    error_ = e;
-  }
-
-  TeGlobalBayesError getErrorCode() {
-    return error_;
-  }
-};
-
-
-//! Calculates the Global Empirical Bayes 
-STAT_DLL bool TeGlobalEmpiricalBayes(TeSTStatInstanceSet *rs, double rate);
-
-/* Taxa Bayesiana Local -- recebe conjunto de areas, cria matriz de vizinhanca,
-   e estima taxa local baseado na vizinhanca.
-
-   As duas primeiras propriedades das areas sao populacao e casos.
-   Ha mais duas propriedades double onde serao armazenados total de casos e total
-   de populacao dos vizinhos.
-
-  teta[i]=w[i]*r[i]+(1-w[i])*c[i]
-  w[i]=V/(V+r[i]))
-  V=Sum(Area i,Pop[i]*(ri-m)^2)/Sum(Area i,Pop[i])-m/PopMedia
-*/
-/** Calculates the local Empirical Bayes	*/
-template<typename Matrix> bool 
-TeLocalEmpiricalBayes(TeSTElementSet *rs, Matrix* neighMatrix, string& colname, double rate);
-/** @} */
-
-//Implementation 
-template<typename Matrix> bool 
-TeLocalEmpiricalBayes(TeSTElementSet *rs, Matrix* neighMatrix, string& colname, double rate)
-{
-	//Percorre areas, calculando populacao e contagem total dos vizinhos
-	typename TeSTElementSet::iterator it = rs->begin(); 
-	double 	neiPop,  //Somatorio da populacao de uma area e seus vizinhos
-		neiCases; //Somatorio de casos de uma area e seus vizinhos
-	double 	myPop,    //Populacao de uma area
-		myCases;  //Casos de uma area
-
-	std::string val;
-
-	//Adds a new property in the element set
-	TeAttribute r;
-	r.rep_.name_ = "neiPop";
-	r.rep_.type_ = TeREAL;
-	r.rep_.decimals_ = 15;
-    	rs->addProperty(r);
-	r.rep_.name_ = "neiCases";
-	rs->addProperty(r);
-
-	//! Gets the indexes of the added attributes
-	int indexAttrPop = rs->getAttributeIndex("neiPop");
-	int indexAttrCases = rs->getAttributeIndex("neiCases");
-   
-	//Calcula numero de casos e populacao de uma area e seus vizinhos para todas as 
-   	//areas --> propriedades neiPop e neiCases
-    	while ( it != rs->end()) 
-	{
-		
-		//Inicializa total de casos e de populacao
-		(*it).getPropertyValue(val, 0);
-		myPop = atof(val.c_str());
-		neiPop = myPop;
-		(*it).getPropertyValue(val, 1);
-		neiCases = atof(val.c_str());
-
-		TeNeighboursMap  neighbors = neighMatrix->getMapNeighbours((*it).objectId());
-		if ((myPop > 0)  && (neighbors.size() > 0)) 
-		{
-			typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
-			//Total de casos e de populacao
-			while(itNeigs != neighbors.end())
-			{
-			//Pega numero de casos e de populacao
-			rs->getAttributeValue((*itNeigs).first, 0, val);
-			neiPop += atof(val.c_str());
-			rs->getAttributeValue((*itNeigs).first, 1, val);
-			neiCases += atof(val.c_str());
-			(++itNeigs);
-			}
-        	}
-
-        	(*it).addPropertyValue(Te2String(neiPop, 9));
-		(*it).addPropertyValue(Te2String(neiCases, 9));
-        	(++it);
-	}
-
-	double 	m, //taxa de uma area e seus vizinhos
-		variance, //variancia de uma area e seus vizinhos
-		V, W, LocalBayesRate;
-	double 	neiJPop, //Populacao de uma area vizinha
-		neiJCases; //Casos de uma area vizinha
-
-	// adds rate property
-	r.rep_.name_ = colname;
-	r.rep_.type_ = TeREAL;
-	r.rep_.decimals_ = 15;
-    	rs->addProperty(r);
-	it = rs->begin(); 
-	//Calcula taxa corrigida local para cada area
-   	 while ( it != rs->end())
-	{
-		//Pega numero de casos e de populacao
-		(*it).getPropertyValue(val, 0);
-		myPop = atof(val.c_str());
-		(*it).getPropertyValue(val, 1);
-		myCases = atof(val.c_str());
-	
-		(*it).getPropertyValue(val, indexAttrPop);
-		neiPop = atof(val.c_str());
-		(*it).getPropertyValue(val, indexAttrCases);
-		neiCases = atof(val.c_str());
-
-        	if (neiPop <= 0) 
-			return false;
-		m = (double)neiCases/(double)neiPop;
-
-        	TeNeighboursMap  neighbors = neighMatrix->getMapNeighbours((*it).objectId());
-	        if (neighbors.size() == 0) 
-		{
-            		LocalBayesRate = (myPop > 0) ? (double)myCases/(double)myPop : 0.0;
-        	}
-        	else 
-		{
-			//Calculo da variancia
-			typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
-			variance = (double)myPop * pow((double)myCases/(double)myPop - m,2);
-			//Total de casos e de populacao
-			while(itNeigs != neighbors.end())
-			{
-				//Pega numero de casos e de populacao
-				rs->getAttributeValue((*itNeigs).first, 0, val);
-				neiJPop = atof(val.c_str());
-				rs->getAttributeValue((*itNeigs).first, 1, val);
-				neiJCases = atof(val.c_str());
-			
-				variance += (double)neiJPop * pow((double)neiJCases/(double)neiJPop - m,2);
-				(++itNeigs);
-			}
-        		variance /= (double) neiPop;
-			//Calculo da taxa
-			V = variance - (m * ((double)neighbors.size()+1)/(double)neiPop);
-			if (V < 0) 
-			V = 0;
-			if ((V == 0) && (m == 0))
-			W  = 1;
-			else 
-			W = V/(V + (m/(double)myPop));
-			LocalBayesRate = W * (double)myCases/(double)myPop + (1 - W) * m;
-
-    		}
-    		LocalBayesRate *= rate;
-		(*it).addPropertyValue(Te2String(LocalBayesRate, 9));
-    		(++it);
-  	}
-	return true;
-}
-#endif
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeBayesFunctions.h
+    \brief This file contains functions to calculate Bayesian Indexes 
+*/
+
+#ifndef __TEBAYESFUNCTIONSH__
+#define __TEBAYESFUNCTIONSH__
+
+#include "TeStatDataStructures.h"
+#include "TeSTElementSet.h"
+#include "TeNeighbours.h"
+
+/** @defgroup STEBayesEstimation Bayes Estimation from TerraLib's spatio-temporal containers
+ *  @ingroup SpatialStatistics
+ *  @{
+*/
+//! Error codes
+enum TeGlobalBayesError {
+   BAYES_GREATER_CASES,
+   BAYES_NULL_POPULATION
+};
+
+//! A class of exceptions
+class STAT_DLL TeGlobalBayesException  {
+   TeGlobalBayesError error_;
+
+public:
+
+  TeGlobalBayesException(TeGlobalBayesError e) {
+    error_ = e;
+  }
+
+  TeGlobalBayesError getErrorCode() {
+    return error_;
+  }
+};
+
+
+//! Calculates the Global Empirical Bayes 
+STAT_DLL bool TeGlobalEmpiricalBayes(TeSTStatInstanceSet *rs, double rate);
+
+/* Taxa Bayesiana Local -- recebe conjunto de areas, cria matriz de vizinhanca,
+   e estima taxa local baseado na vizinhanca.
+
+   As duas primeiras propriedades das areas sao populacao e casos.
+   Ha mais duas propriedades double onde serao armazenados total de casos e total
+   de populacao dos vizinhos.
+
+  teta[i]=w[i]*r[i]+(1-w[i])*c[i]
+  w[i]=V/(V+r[i]))
+  V=Sum(Area i,Pop[i]*(ri-m)^2)/Sum(Area i,Pop[i])-m/PopMedia
+*/
+/** Calculates the local Empirical Bayes	*/
+template<typename Matrix> bool 
+TeLocalEmpiricalBayes(TeSTElementSet *rs, Matrix* neighMatrix, string& colname, double rate);
+/** @} */
+
+//Implementation 
+template<typename Matrix> bool 
+TeLocalEmpiricalBayes(TeSTElementSet *rs, Matrix* neighMatrix, string& colname, double rate)
+{
+	//Percorre areas, calculando populacao e contagem total dos vizinhos
+	typename TeSTElementSet::iterator it = rs->begin(); 
+	double 	neiPop,  //Somatorio da populacao de uma area e seus vizinhos
+		neiCases; //Somatorio de casos de uma area e seus vizinhos
+	double 	myPop,    //Populacao de uma area
+		myCases;  //Casos de uma area
+
+	std::string val;
+
+	//Adds a new property in the element set
+	TeAttribute r;
+	r.rep_.name_ = "neiPop";
+	r.rep_.type_ = TeREAL;
+	r.rep_.decimals_ = 15;
+    	rs->addProperty(r);
+	r.rep_.name_ = "neiCases";
+	rs->addProperty(r);
+
+	//! Gets the indexes of the added attributes
+	int indexAttrPop = rs->getAttributeIndex("neiPop");
+	int indexAttrCases = rs->getAttributeIndex("neiCases");
+   
+	//Calcula numero de casos e populacao de uma area e seus vizinhos para todas as 
+   	//areas --> propriedades neiPop e neiCases
+    	while ( it != rs->end()) 
+	{
+		
+		//Inicializa total de casos e de populacao
+		(*it).getPropertyValue(val, 0);
+		myPop = atof(val.c_str());
+		neiPop = myPop;
+		(*it).getPropertyValue(val, 1);
+		neiCases = atof(val.c_str());
+
+		TeNeighboursMap  neighbors = neighMatrix->getMapNeighbours((*it).objectId());
+		if ((myPop > 0)  && (neighbors.size() > 0)) 
+		{
+			typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
+			//Total de casos e de populacao
+			while(itNeigs != neighbors.end())
+			{
+			//Pega numero de casos e de populacao
+			rs->getAttributeValue((*itNeigs).first, 0, val);
+			neiPop += atof(val.c_str());
+			rs->getAttributeValue((*itNeigs).first, 1, val);
+			neiCases += atof(val.c_str());
+			(++itNeigs);
+			}
+        	}
+
+        	(*it).addPropertyValue(Te2String(neiPop, 9));
+		(*it).addPropertyValue(Te2String(neiCases, 9));
+        	(++it);
+	}
+
+	double 	m, //taxa de uma area e seus vizinhos
+		variance, //variancia de uma area e seus vizinhos
+		V, W, LocalBayesRate;
+	double 	neiJPop, //Populacao de uma area vizinha
+		neiJCases; //Casos de uma area vizinha
+
+	// adds rate property
+	r.rep_.name_ = colname;
+	r.rep_.type_ = TeREAL;
+	r.rep_.decimals_ = 15;
+    	rs->addProperty(r);
+	it = rs->begin(); 
+	//Calcula taxa corrigida local para cada area
+   	 while ( it != rs->end())
+	{
+		//Pega numero de casos e de populacao
+		(*it).getPropertyValue(val, 0);
+		myPop = atof(val.c_str());
+		(*it).getPropertyValue(val, 1);
+		myCases = atof(val.c_str());
+	
+		(*it).getPropertyValue(val, indexAttrPop);
+		neiPop = atof(val.c_str());
+		(*it).getPropertyValue(val, indexAttrCases);
+		neiCases = atof(val.c_str());
+
+        	if (neiPop <= 0) 
+			return false;
+		m = (double)neiCases/(double)neiPop;
+
+        	TeNeighboursMap  neighbors = neighMatrix->getMapNeighbours((*it).objectId());
+	        if (neighbors.size() == 0) 
+		{
+            		LocalBayesRate = (myPop > 0) ? (double)myCases/(double)myPop : 0.0;
+        	}
+        	else 
+		{
+			//Calculo da variancia
+			typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
+			variance = (double)myPop * pow((double)myCases/(double)myPop - m,2);
+			//Total de casos e de populacao
+			while(itNeigs != neighbors.end())
+			{
+				//Pega numero de casos e de populacao
+				rs->getAttributeValue((*itNeigs).first, 0, val);
+				neiJPop = atof(val.c_str());
+				rs->getAttributeValue((*itNeigs).first, 1, val);
+				neiJCases = atof(val.c_str());
+			
+				variance += (double)neiJPop * pow((double)neiJCases/(double)neiJPop - m,2);
+				(++itNeigs);
+			}
+        		variance /= (double) neiPop;
+			//Calculo da taxa
+			V = variance - (m * ((double)neighbors.size()+1)/(double)neiPop);
+			if (V < 0) 
+			V = 0;
+			if ((V == 0) && (m == 0))
+			W  = 1;
+			else 
+			W = V/(V + (m/(double)myPop));
+			LocalBayesRate = W * (double)myCases/(double)myPop + (1 - W) * m;
+
+    		}
+    		LocalBayesRate *= rate;
+		(*it).addPropertyValue(Te2String(LocalBayesRate, 9));
+    		(++it);
+  	}
+	return true;
+}
+#endif
diff --git a/src/terralib/stat/TeKMeansGrouping.h b/src/terralib/stat/TeKMeansGrouping.h
old mode 100755
new mode 100644
index b654d33..80077fb
--- a/src/terralib/stat/TeKMeansGrouping.h
+++ b/src/terralib/stat/TeKMeansGrouping.h
@@ -1,163 +1,163 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeKMeansGrouping.h
-    \brief This file contains functions related to the K Means clustering algorithm
-*/
-#ifndef  __TERRALIB_INTERNAL_KMEANSGROUPING_H
-#define  __TERRALIB_INTERNAL_KMEANSGROUPING_H
-
-#include "TeGroupingAlgorithms.h"
-
-template<typename I, typename T>  int
-TeMinimumDistance(I it, T& centroides )
-{
-	double distmin = TeMAXFLOAT, dist; 
-	int j = -1;
-	for (int i=0; i< centroides.size(); i++)
-	{
-	     dist = TeEuclidianDistance(it,centroides[i]);
-	     if ( dist < distmin )
-	     {  
-			 j = i; 
-			 distmin = dist; 
-		 }
-	}
-	return j;
-}
-
-template<typename I, typename T> 
-double
-TeEuclidianDistance(I it, T& centroide)
-{
-	double val = 0;
-	int n = centroide.size();
-	for (int i=0; i<n; i++)
-	{
-		double v1 = (*it)[i];
-		double v2 = centroide[i];
-		val += pow(v1-v2,2);
-	}
-	return sqrt(val);
-}
-
-
-template<typename T> 
-void
-Initialize(T& centroide, vector<double>& minValue, vector<double>& maxValue)
-{
-	int n = centroide.size();
-	for (int i=0; i<n; i++)
-	{
-		double val = (rand()* (maxValue[i]-minValue[i]))/RAND_MAX;
-		centroide[i] = val;
-	}
-	return;
-}
-
-template<typename T> 
-bool 
-CheckConvergence(T& toUpdate, T& newCentroides, double limiar )
-{
-
-	int k = newCentroides.size();
-	int n = newCentroides[0].size();
-	for (int i=0; i<k; i++)
-		for (int j = 0; j<n; j++)
-		{
-			double num = newCentroides[i][j];
-			double den = toUpdate[i][j];
-/*			if (num > den)
-			{
-				double aux = den;
-				den = num;
-				num = aux;
-			}
-			val = (1-num/den)*100.;
-			if (val > limiar)
-				return false;
-*/
-			if (num != den)
-				return false;
-		}
-	return true;
-}
-
-template<typename It, typename C> 
-void
-ReCalculate(It it, C& nearest)
-{
-	for (int i=0; i<nearest.size(); i++)
-		nearest[i] = (nearest[i] + (*it)[i])/2.0;
-	return;
-}
-
-
-template<typename It, typename C> void
-TeKMeans (It begin, It end, C& result, double conv) 
-{
-	srand( static_cast<unsigned>(time(NULL)));
-	C centroides(result), centr_aux(result);
-    
-	int n = result[0].size();
-	vector<double> minValue(n);
-	vector<double> maxValue(n);
-
-	TeMinimumValue(begin, end, minValue);
-	TeMaximumValue(begin, end, maxValue);
-
-	for (int i=0; i<result.size();  i++)
-	{
-		// Falta verificar se n�o gera centroides iniciais iguais
-		Initialize(centroides[i], minValue, maxValue);
-	}
-
-	centr_aux = centroides;
-	bool converge = false;
-	int  j, niter=0;
-
-	while (!converge)
-	{
-		for (It it=begin; it!= end; it++) 
-		{
-			j = TeMinimumDistance(it, centroides);
-			ReCalculate(it,centr_aux[j]);
-		}
-		converge = CheckConvergence(centroides, centr_aux,conv);
-		centroides = centr_aux;
-		niter++;
-   }
-   result = centroides;
-}
-
-template<typename ItIn, typename C, typename ItOut> void
-TeEuclidianClassify (ItIn begin, ItIn end, ItOut& result, C& kmeans) 
-{
-	int j;
-	for (ItIn it=begin; it!= end; it++) 
-	{
-		j = TeMinimumDistance(it, kmeans);
-		(*result) = j;
-		result++;
-	}
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeKMeansGrouping.h
+    \brief This file contains functions related to the K Means clustering algorithm
+*/
+#ifndef  __TERRALIB_INTERNAL_KMEANSGROUPING_H
+#define  __TERRALIB_INTERNAL_KMEANSGROUPING_H
+
+#include "TeGroupingAlgorithms.h"
+
+template<typename I, typename T>  int
+TeMinimumDistance(I it, T& centroides )
+{
+	double distmin = TeMAXFLOAT, dist; 
+	int j = -1;
+	for (int i=0; i< centroides.size(); i++)
+	{
+	     dist = TeEuclidianDistance(it,centroides[i]);
+	     if ( dist < distmin )
+	     {  
+			 j = i; 
+			 distmin = dist; 
+		 }
+	}
+	return j;
+}
+
+template<typename I, typename T> 
+double
+TeEuclidianDistance(I it, T& centroide)
+{
+	double val = 0;
+	int n = centroide.size();
+	for (int i=0; i<n; i++)
+	{
+		double v1 = (*it)[i];
+		double v2 = centroide[i];
+		val += pow(v1-v2,2);
+	}
+	return sqrt(val);
+}
+
+
+template<typename T> 
+void
+Initialize(T& centroide, vector<double>& minValue, vector<double>& maxValue)
+{
+	int n = centroide.size();
+	for (int i=0; i<n; i++)
+	{
+		double val = (rand()* (maxValue[i]-minValue[i]))/RAND_MAX;
+		centroide[i] = val;
+	}
+	return;
+}
+
+template<typename T> 
+bool 
+CheckConvergence(T& toUpdate, T& newCentroides, double limiar )
+{
+
+	int k = newCentroides.size();
+	int n = newCentroides[0].size();
+	for (int i=0; i<k; i++)
+		for (int j = 0; j<n; j++)
+		{
+			double num = newCentroides[i][j];
+			double den = toUpdate[i][j];
+/*			if (num > den)
+			{
+				double aux = den;
+				den = num;
+				num = aux;
+			}
+			val = (1-num/den)*100.;
+			if (val > limiar)
+				return false;
+*/
+			if (num != den)
+				return false;
+		}
+	return true;
+}
+
+template<typename It, typename C> 
+void
+ReCalculate(It it, C& nearest)
+{
+	for (int i=0; i<nearest.size(); i++)
+		nearest[i] = (nearest[i] + (*it)[i])/2.0;
+	return;
+}
+
+
+template<typename It, typename C> void
+TeKMeans (It begin, It end, C& result, double conv) 
+{
+	srand( static_cast<unsigned>(time(NULL)));
+	C centroides(result), centr_aux(result);
+    
+	int n = result[0].size();
+	vector<double> minValue(n);
+	vector<double> maxValue(n);
+
+	TeMinimumValue(begin, end, minValue);
+	TeMaximumValue(begin, end, maxValue);
+
+	for (int i=0; i<result.size();  i++)
+	{
+		// Falta verificar se n�o gera centroides iniciais iguais
+		Initialize(centroides[i], minValue, maxValue);
+	}
+
+	centr_aux = centroides;
+	bool converge = false;
+	int  j, niter=0;
+
+	while (!converge)
+	{
+		for (It it=begin; it!= end; it++) 
+		{
+			j = TeMinimumDistance(it, centroides);
+			ReCalculate(it,centr_aux[j]);
+		}
+		converge = CheckConvergence(centroides, centr_aux,conv);
+		centroides = centr_aux;
+		niter++;
+   }
+   result = centroides;
+}
+
+template<typename ItIn, typename C, typename ItOut> void
+TeEuclidianClassify (ItIn begin, ItIn end, ItOut& result, C& kmeans) 
+{
+	int j;
+	for (ItIn it=begin; it!= end; it++) 
+	{
+		j = TeMinimumDistance(it, kmeans);
+		(*result) = j;
+		result++;
+	}
+}
 #endif
\ No newline at end of file
diff --git a/src/terralib/stat/TeKernelFunctions.cpp b/src/terralib/stat/TeKernelFunctions.cpp
old mode 100755
new mode 100644
index 0b1d7c4..044b9f7
--- a/src/terralib/stat/TeKernelFunctions.cpp
+++ b/src/terralib/stat/TeKernelFunctions.cpp
@@ -1,66 +1,66 @@
-/************************************************************************************
-Exploring and analysis of geographical data using TerraLib and TerraView
-Copyright � 2003-2007 INPE and LESTE/UFMG.
-
-Partially funded by CNPq - Project SAUDAVEL, under grant no. 552044/2002-4,
-SENASP-MJ and INPE
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This program is distributed hoping it will be useful, however, WITHOUT ANY 
-WARRANTIES; neither to the implicit warranty of MERCHANTABILITY OR SUITABILITY FOR
-AN SPECIFIC FINALITY. Consult the GNU General Public License for more details.
-
-You must have received a copy of the GNU General Public License with this program.
-In negative case, write to the Free Software Foundation, Inc. in the following
-address: 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
-***********************************************************************************/
-
-#include "TeKernelFunctions.h"
-#include "TeDefines.h"
-#include <math.h>
-
-
-double TeKernelQuartic(double tau, double distance, double intensity) 
-{
-    if (distance > tau)
-		return 0.0;
-
-	return intensity * (3.0 / (tau * tau * TePI)) *
-		pow(1 - ((distance * distance)/ (tau * tau)),2.0);
-}
-
-double TeKernelNormal(double tau, double distance, double intensity)
-{
-	return intensity * (1.0 / (tau * tau * 2 * TePI)) *
-		exp(-1.0 * (distance * distance)/ (2 * tau * tau));
-}
-
-double TeKernelUniform(double tau, double distance, double intensity)
-{
-    if (distance > tau)
-		return 0.0;
-
-	return intensity;
-}
-
-double TeKernelTriangular(double tau, double distance, double intensity)
-{
-    if (distance > tau)
-		return 0.0;
-
-	return intensity * (1.0 - 1.0/tau) * distance;
-}
-
-double TeKernelNegExponential(double tau, double distance, double intensity)
-{
-    if (distance > tau)
-		return 0.0;
-
-	return intensity * exp(-3.0 * distance);
-}
-
-
+/************************************************************************************
+Exploring and analysis of geographical data using TerraLib and TerraView
+Copyright � 2003-2007 INPE and LESTE/UFMG.
+
+Partially funded by CNPq - Project SAUDAVEL, under grant no. 552044/2002-4,
+SENASP-MJ and INPE
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This program is distributed hoping it will be useful, however, WITHOUT ANY 
+WARRANTIES; neither to the implicit warranty of MERCHANTABILITY OR SUITABILITY FOR
+AN SPECIFIC FINALITY. Consult the GNU General Public License for more details.
+
+You must have received a copy of the GNU General Public License with this program.
+In negative case, write to the Free Software Foundation, Inc. in the following
+address: 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
+***********************************************************************************/
+
+#include "TeKernelFunctions.h"
+#include "TeDefines.h"
+#include <math.h>
+
+
+double TeKernelQuartic(double tau, double distance, double intensity) 
+{
+    if (distance > tau)
+		return 0.0;
+
+	return intensity * (3.0 / (tau * tau * TePI)) *
+		pow(1 - ((distance * distance)/ (tau * tau)),2.0);
+}
+
+double TeKernelNormal(double tau, double distance, double intensity)
+{
+	return intensity * (1.0 / (tau * tau * 2 * TePI)) *
+		exp(-1.0 * (distance * distance)/ (2 * tau * tau));
+}
+
+double TeKernelUniform(double tau, double distance, double intensity)
+{
+    if (distance > tau)
+		return 0.0;
+
+	return intensity;
+}
+
+double TeKernelTriangular(double tau, double distance, double intensity)
+{
+    if (distance > tau)
+		return 0.0;
+
+	return intensity * (1.0 - 1.0/tau) * distance;
+}
+
+double TeKernelNegExponential(double tau, double distance, double intensity)
+{
+    if (distance > tau)
+		return 0.0;
+
+	return intensity * exp(-3.0 * distance);
+}
+
+
diff --git a/src/terralib/stat/TeKernelFunctions.h b/src/terralib/stat/TeKernelFunctions.h
old mode 100755
new mode 100644
index 646b2ce..d931159
--- a/src/terralib/stat/TeKernelFunctions.h
+++ b/src/terralib/stat/TeKernelFunctions.h
@@ -1,682 +1,682 @@
-/************************************************************************************
-Exploring and analysis of geographical data using TerraLib and TerraView
-Copyright � 2003-2007 INPE and LESTE/UFMG.
-
-Partially funded by CNPq - Project SAUDAVEL, under grant no. 552044/2002-4,
-SENASP-MJ and INPE
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This program is distributed hoping it will be useful, however, WITHOUT ANY 
-WARRANTIES; neither to the implicit warranty of MERCHANTABILITY OR SUITABILITY FOR
-AN SPECIFIC FINALITY. Consult the GNU General Public License for more details.
-
-You must have received a copy of the GNU General Public License with this program.
-In negative case, write to the Free Software Foundation, Inc. in the following
-address: 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
-***********************************************************************************/
-/*! \file TeKernelFunctions.h
-    \brief This file contains functions to spatial kernel estimation: basic, adaptive and ratio 
-*/
-
-#ifndef __TERRALIB_INTERNAL_KERNELFUNCTIONS_H
-#define __TERRALIB_INTERNAL_KERNELFUNCTIONS_H
-
-#include "TeException.h"
-#include "TeKernelParams.h"
-#include "TeStatDefines.h"
-#include "TeGeometryAlgorithms.h"
-#include "TeProgress.h"
-
-
-#define   INVALID_KERNEL -TeMAXFLOAT
-
-#define IDX_ATTR            0
-#define IDX_KERNEL          0
-#define IDX_NUMERATOR       1
-#define IDX_KERNEL1         0
-#define IDX_KERNEL2         1
-
-enum TeKernelError {
- KERNEL_NO_CENTROID,
-   KERNEL_ALL_NULL,
-   KERNEL_INVALID_AREA,
-   KERNEL_INVALID_VALUE,
-   KERNEL_NO_VALUE
-};
-
-class STAT_DLL TeKernelException  {
-
-  TeKernelError error_;
-
-public:
-
-  TeKernelException(TeKernelError e) {
-    error_ = e;
-  }
-
-  TeKernelError getErrorCode() {
-    return error_;
-  }
-};
-
-
-
-/*! Kernel functions 
-
- * \param tau spatial threshold to define neighboorhood
- * \param distance distance between event and region centroid
- * \param intensity attribute value for event
-*/
-STAT_DLL double TeKernelQuartic(double tau, double distance, double intensity);
-STAT_DLL double TeKernelNormal(double tau, double distance, double intensity);
-STAT_DLL double TeKernelUniform(double tau, double distance, double intensity);
-STAT_DLL double TeKernelTriangular(double tau, double distance, double intensity);
-STAT_DLL double TeKernelNegExponential(double tau, double distance, double intensity);
-
-
-/**
- * Calcula a media geometrica de um conjunto de valores atraves da 
- * utilizacao de logaritmos
- * Implementado pelo Andre
- **/
-template <typename ItReg>
-double TeKernelGeometricMean(ItReg& beginReg, ItReg& endReg, int idx)
-{
-   double mantissa, MediaE, MediaM;
-   int expoente, Cont;
-   int MediaETmp = 0;
-   double MediaMTmp = 0;
-
-   double log_two = log(2.0);
-   Cont = 0;
-   ItReg it = beginReg;
-   double val;
-   while (it != endReg) {  
-         if ((*it).getDoubleProperty(idx, val) && (val > 0))
-         {
-            mantissa = frexp(val,&expoente);
-            MediaMTmp = MediaMTmp+log(mantissa);
-            MediaETmp = MediaETmp+expoente;
-            Cont++;
-         }
-         ++it;
-   }
-
-   MediaE = MediaETmp;
-   MediaM = (MediaMTmp+(MediaE*log_two))/Cont;
-   MediaM = exp(MediaM);
-
-   return MediaM;
-}
-
-
-
-/*! \brief Evaluates normalization factor for kernel
- * \param begin begin of event set iterator
- * \param end   end of event set iterator
- * \return sum of intensities
- **/
-template <typename ItEvt>
-double KernelNormalizationFactor(ItEvt itBegin, ItEvt itEnd) {
-
-  double normFactor = 0;
-  double intensity;
-
-  ItEvt evtIter = itBegin;
-
-   while (evtIter != itEnd) {
-
-     (*evtIter).getDoubleProperty(IDX_ATTR, intensity);
-     normFactor += intensity;
-      ++evtIter;
-    }
-
-  return normFactor;
-
-}
-
-
-/*! \brief Evaluates kernel value of events with intensity (attribute)
- * for one support region, for a kernel function
- * \param center support region centroid
- * \param begin  begin of event set iterator
- * \param end    end of event set iterator
- * \param radius spatial threshold
- * \param kfunc  type of kernel function
- * This function assumes that intensity value of event is available on its first
- * property - if it does not exist, it is set to 1.0 (identity)
- **/
-template <typename ItEvt>
-double TeKernelValue (TeCoord2D& center, ItEvt& begin, ItEvt& end, 
-					  double radius, TeKernelFunctionType kfunc)
-{
-
-  string    intstr;
-
-	TeCoord2D location;		//Event spatial location
-  double    intensity;	//Event intensity
-
-  //Final kernel value
-	double kernel = 0; 
-
-  //Iterates through events, getting their location and intensity values
-  //and updating kernel value
-	ItEvt it = begin;
-	while (it != end) 
-	{
-		(*it).centroid(location);
-
-		//If there is no properties, assume intensity of one
-	    if (!(*it).getDoubleProperty(IDX_ATTR, intensity)) {
-				intensity = 1.0;
-		}
-
-		//Evaluates kernel value for one event
-		double distance = TeDistance (location,center);
-		double localK;
-
-		switch(kfunc) {
-		case TeKQuartic:
-			localK = TeKernelQuartic(radius,distance,intensity);
-			break;
-		case TeKNormal:
-			localK = TeKernelNormal(radius,distance,intensity);
-			break;
-		case TeKTriangular:
-			localK = TeKernelTriangular(radius,distance,intensity);
-			break;
-		case TeKNegExponential:
-			localK = TeKernelNegExponential(radius,distance,intensity);
-			break;
-		case TeKUniform:
-			localK = TeKernelUniform(radius,distance,intensity);
-			break;
-		}
-		kernel += localK; 
-	    ++it;
-
-	}
-	return kernel;
-}
-
-/*! \brief Normalizes kernel values based on type of computation. 
- *  \brief Gets value from IDX_KERNEL and stores it at the same place 
- * \param events set of spatial events
- * \param regionsBegin begin of regions iterator
- * \param reginsEnd end of region iterator
- * \param kfunc type of kernel function
- * \param ktype type of computation (SMA, density or probability)
- * \param radius spatial threshold
- **/
-template<typename EventSet, typename ItRegionSet>
-bool TeKernelNormalize(EventSet& events, 
-                   ItRegionSet& regionsBegin,
-                   ItRegionSet& regionsEnd,
-                   TeKernelComputeType  kType,
-                   double totKernel,
-                   int idxProp)
-{
-
-  double normKernel, kernel, area;
-  try {
-
-  //Evaluates sum of attributes for normalization
-    double normFactor = 
-      KernelNormalizationFactor(events.begin(), events.end());
-
-    //Reiterates through regions defining normalized kernel value,
-    //given the computation type
-    ItRegionSet regIter = regionsBegin;
-    while (regIter != regionsEnd) 
-    {
-      
-      (*regIter).getDoubleProperty(idxProp, kernel);
-      if (kernel < 0) {
-         throw TeKernelException(KERNEL_INVALID_VALUE);
-      }
-
-      //Evaluates value based on computation type
-      switch(kType) {
-      case TeKMovingAverage:
-        normKernel = (kernel * normFactor)/totKernel;
-        break;
-      case TeKDensity:
-        //If region does not have an area, assumes one
-        (*regIter).area(area); 
-        if (area <= 0) {
-          throw TeKernelException(KERNEL_INVALID_AREA);
-        }
-        normKernel = ((kernel * normFactor)/totKernel)/area;
-        break;
-      case TeKProbability:
-        normKernel = kernel/totKernel;
-        break;
-      }
-
-      //Store final value
-      (*regIter).setDoubleProperty(idxProp, normKernel);
-      ++regIter;
-    }  
-  } catch (TeKernelException /* e */) {
-//    int a = e.getErrorCode();
-    return false;
-  }
-  return true;
-}
-
-
-/*! \brief Evaluates kernel value for all support regions, 
- * storing values either on IDX_KERNEL or IDX_NUMERATOR.  
- * \param events set of spatial events
- * \param regionsBegin begin of regions iterator
- * \param reginsEnd end of region iterator
- * \param kfunc type of kernel function
- * \param ktype type of computation (SMA, density or probability)
- * \param radius spatial threshold
- * \param idxProp index of double property
- **/
-template<typename EventSet, typename ItRegionSet>
-bool TeStatIntKernel(EventSet& events, 
-                   ItRegionSet& regionsBegin,
-                   ItRegionSet& regionsEnd,
-                   TeKernelFunctionType kfunc, 
-                   TeKernelComputeType  kType,
-                   double radius,  
-                   int idxProp)
-{
-
-
-  //Support region attributes
-  TeCoord2D location;
-  double    kernel;
-  
-  //Regions iterator
-  ItRegionSet regIter = regionsBegin;
-  // Sum of kernels
-  double totKernel = 0;
-
-  //Treats unexpected expections returning false
-  try {
-
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-	int nsteps = 0;
-    //Iterates through regions
-    while (regIter != regionsEnd) 
-    {
-      (*regIter).centroid(location); 
-      
-      //Define iterators for event sets -- may optimize
-      typename EventSet::iterator subSetBegin = events.begin(location,radius);
-      typename EventSet::iterator subSetEnd = events.end(location,radius);
-      if (kfunc == TeKNormal) {
-        subSetBegin = events.begin();
-        subSetEnd = events.end();
-      }
-
-      //Evaluates kernel value for region
-      kernel = TeKernelValue(location, subSetBegin, subSetEnd, 
-        radius, kfunc);
-      
-      totKernel += kernel;
-
-      (*regIter).setDoubleProperty(idxProp, kernel);
-      ++regIter; 
-	  t2 = clock();
-	  ++nsteps;
-	  if (TeProgress::instance())
-	  {
-		 if (int(t2-t1) > dt)
-		 {
-			t1 = t2;
-			if (TeProgress::instance()->wasCancelled())
-				break;
-			if((int)(t2-t0) > dt2)
-				TeProgress::instance()->setProgress(nsteps);
-		 }
-	  }
-	}
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-    if (totKernel <= 0) {
-      throw TeKernelException(KERNEL_ALL_NULL);
-    }
-
-    return TeKernelNormalize(events, regionsBegin, regionsEnd, kType, totKernel,
-      idxProp);
-
-  } catch (TeKernelException /* e */) {
-//    int a = e.getErrorCode();
-    return false;
-  }
-  
-  return true;
-}
-
-
-/*! \brief Evaluates adaptive kernel value for all support regions, 
- * storing values (intermediary and final) in double property idxProp  
- * \param events set of spatial events
- * \param regionsBegin begin of regions iterator
- * \param reginsEnd end of region iterator
- * \param kfunc type of kernel function
- * \param ktype type of computation (SMA, density or probability)
- * \param numReg number of support regions -- need to evaluate initial radius
- * \param totalArea total area of support regions -- need to evaluate initial radius
- * \param idxProp index of double property
- **/
-template<typename EventSet, typename ItRegionSet>
-bool TeStatAdaptiveGeoMeanIntKernel(EventSet& events, 
-                                    ItRegionSet& regionsBegin,
-                                    ItRegionSet& regionsEnd,
-                                    TeKernelFunctionType kfunc,
-                                    TeKernelComputeType ktype,
-                                    int /* numReg */,
-                                    double totalArea,
-                                    int idxProp) 
-{
-
-  try {
-
-    //Evaluate kernel with a fixed radius, based on formula, storing in vecValues
-    double radius = 0.68*pow((double)events.numObjects(),-0.2)*sqrt(totalArea);
-    double sqArea = sqrt(totalArea);
-    if (!TeStatIntKernel(events, regionsBegin, regionsEnd,
-      kfunc, ktype, radius, idxProp))
-      return false;
-    
-    //Evaluate geometric mean of kernel values, to adjust radius
-    double meanKernel = TeKernelGeometricMean(regionsBegin, regionsEnd, idxProp);
-    
-    if (meanKernel <= 0) {
-      throw TeKernelException(TeKernelException(KERNEL_ALL_NULL));
-    }
-    
-    //Now, reassign radius, evaluating final value for kernel
-    
-    ItRegionSet regIter = regionsBegin;
-    double    prevKernel;
-    double    newKernel;
-    double    newRadius;
-    double    totKernel = 0;
-    TeCoord2D location;
-    
-	int dt = CLOCKS_PER_SEC/4;
-	int dt2 = CLOCKS_PER_SEC * 5;
-	clock_t	t0, t1, t2;
-	t2 = clock();
-	t0 = t1 = t2;
-	int nsteps = 0;
-
-    //Iterates through regions
-    while (regIter != regionsEnd) 
-    {
-      (*regIter).centroid(location); 
-      
-      //Define iterators for event sets -- may optimize
-      typename EventSet::iterator subSetBegin = events.begin(location,radius);
-      typename EventSet::iterator subSetEnd = events.end(location,radius);
-      if (kfunc == TeKNormal) {
-        subSetBegin = events.begin();
-        subSetEnd = events.end();
-      }
-
-      if (!((*regIter).getDoubleProperty(idxProp, prevKernel)) || (prevKernel < 0)) {
-         throw TeKernelException(KERNEL_INVALID_VALUE);
-      }
-  
-      if (prevKernel > 0) {
-        newRadius = radius*pow((meanKernel/prevKernel),0.5);
-        if (newRadius > sqArea/4.0)
-          newRadius = sqArea/4.0; //Para funcionar quando o valor eh muito pequeno
-        newKernel = TeKernelValue(location, subSetBegin, subSetEnd,  newRadius, kfunc);
-      }
-      else {
-        newKernel = 0.0;
-      }
-      
-      totKernel += newKernel;
-      (*regIter).setDoubleProperty(idxProp, newKernel);
-      ++regIter; 
-	  t2 = clock();
-	  ++nsteps;
-	  if (TeProgress::instance())
-	  {
-		 if (int(t2-t1) > dt)
-		 {
-			t1 = t2;
-			if (TeProgress::instance()->wasCancelled())
-				break;
-			if((int)(t2-t0) > dt2)
-				TeProgress::instance()->setProgress(nsteps);
-		 }
-	  }
-    }
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-    if (totKernel <= 0) {
-      throw TeKernelException(KERNEL_ALL_NULL);
-    }
-
-    return TeKernelNormalize(events, regionsBegin, regionsEnd, ktype, totKernel,
-      idxProp);
-  } catch (TeKernelException /* e */) { 
-//      int a = e.getErrorCode();
-      return false;
-  }
-    
-  return true;
-}
-
-
-
-/*! Class to apply kernel method
-*
-*/
-class STAT_DLL TeStatKernel {
-
-public:
-
-  //! type of kernel function
-  TeKernelFunctionType kfunc_;
-  //! type of computation
-  TeKernelComputeType  ktype_;
-  //! spatial threshold
-  double               radius_;
-  //! sum of support region areas
-  double               totalArea_;
-  //! number of support regions
-  int                  numReg_;
-  
-  TeStatKernel() {
-    kfunc_ = TeKQuartic;
-    ktype_ = TeKDensity;
-    radius_ = 0;
-    totalArea_ = 0;
-    numReg_ = 0;
-  }
-
-  /*! \brief Apply kernel method to a specif set of support regions
-   * and events, storing results in resName_.
-   * \param events set of point events
-   * \param regionsBegin iterator for support regions
-   * \param regionsEnd   iterator for support regions
-   * If radius_ is 0, then applies adaptive kernel.
-   */
-  template<typename EventSet, typename ItRegionSet>
-  bool apply(EventSet& events, 
-    ItRegionSet regionsBegin,
-    ItRegionSet regionsEnd) {
-    if (totalArea_ <= 0) {
-      return false;
-    }
-
-    if (numReg_ <= 0) {
-      return false;
-    }
-
-    bool result;
-    //Radius defined, kernel with a fixed radius
-    if (radius_ > 0) {
-      result = TeStatIntKernel(events,regionsBegin, regionsEnd, 
-        kfunc_,ktype_, radius_, IDX_KERNEL);
-      
-    }
-    //Radius undefined, adaptive kernel
-    else {
-      result = TeStatAdaptiveGeoMeanIntKernel(events,  regionsBegin, regionsEnd, 
-        kfunc_, ktype_, numReg_, totalArea_, IDX_KERNEL); 
-
-    }
-    return result;
-  }
-
-};
-
-
-
-class STAT_DLL TeStatKernelRatio
-{
-  public:
-  int						numReg_;
-  
-  public:
-
-  TeKernelCombinationType	kComb_;
-  TeKernelComputeType		  ktype_;
-  TeKernelFunctionType		kfunc1_;
-  double					        radius1_;
-  TeKernelFunctionType		kfunc2_;
-  double				        	radius2_;
-  double				        	totalArea_;
-
-  
-  TeStatKernelRatio() {
-    kComb_ = TeKRatio;
-    kfunc1_ =  kfunc2_ = TeKQuartic;
-    ktype_ = TeKDensity;
-    radius1_ = radius2_ = 0;
-    totalArea_ = 0;
-    numReg_ = 0;
-  }
-   
-  template <typename EventSet1, typename EventSet2, typename ItRegionSet>
-  bool apply (EventSet1& ev1, 
-    EventSet2& ev2, 
-    ItRegionSet regBegin, 
-    ItRegionSet regEnd) {
-   
-    
-    if (totalArea_ <= 0)
-      return false;
-    
-    if (numReg_ <= 0) 
-      return false;
-    
-    //Calcula kernel para primeiro conjunto
-
-    bool result;
-    //Radius defined, kernel with a fixed radius
-    if (radius1_ > 0) {
-      result = TeStatIntKernel(ev1,regBegin, regEnd, 
-        kfunc1_,ktype_, radius1_, IDX_KERNEL1);
-      
-    }
-    //Radius undefined, adaptive kernel
-    else {
-      result = TeStatAdaptiveGeoMeanIntKernel(ev1,  regBegin, regEnd, 
-        kfunc1_, ktype_, numReg_, totalArea_, IDX_KERNEL1); 
-
-    }
-    
-    if (!result)
-      return result;
-
-  
-    //Calcula kernel para segundo conjunto
-     //Radius defined, kernel with a fixed radius
-    if (radius2_ > 0) {
-      result = TeStatIntKernel(ev2,regBegin, regEnd, 
-        kfunc2_,ktype_, radius2_, IDX_KERNEL2);
-      
-    }
-    //Radius undefined, adaptive kernel
-    else {
-      result = TeStatAdaptiveGeoMeanIntKernel(ev2,  regBegin, regEnd, 
-        kfunc2_, ktype_, numReg_, totalArea_, IDX_KERNEL2); 
-
-    }
-
-    if (!result)
-      return result;
-    
-    //Itera calculando o tipo de combinacao e armazenando no valor da regiao
-    //Percorre todas as regioes
-//    int Cont = 0;
-    double kernel;
-    double k1;
-    double k2;
-    double area;
-    
-    ItRegionSet regIter = regBegin;
- 
-    while (regIter != regEnd) 
-    {
-  
-      (*regIter).area(area);
-      
-      (*regIter).getDoubleProperty(IDX_KERNEL1, k1);
-      (*regIter).getDoubleProperty(IDX_KERNEL2, k2);
-      
-      switch(kComb_) 
-      {
-      case TeKRatio:
-        if (k2 == 0.0)
-          kernel = 0.0;//INVALID_KERNEL;
-        else
-          kernel = k1/k2;
-        break;
-      case TeKLogRatio:
-        if (k2 == 0.0)
-          kernel = INVALID_KERNEL;
-        else
-          kernel = log(k1/k2);
-        break;
-      case TeAbsDifference:
-        kernel = k1 - k2;
-        break;
-      case TeRelDifference:
-        kernel = (k1 - k2) * area;
-        break;
-      case TeAbsSum:
-        kernel = k1+k2;
-        break;
-      case TeRelSum:
-        kernel = (k1 + k2) * area;
-        break;
-      }
-	  (*regIter).setDoubleProperty(IDX_KERNEL, kernel);
-	  ++regIter; 
-    }
-    
-    return true;
-  }
-                       
-};
-
-
-#endif
-
-
-
-
-
+/************************************************************************************
+Exploring and analysis of geographical data using TerraLib and TerraView
+Copyright � 2003-2007 INPE and LESTE/UFMG.
+
+Partially funded by CNPq - Project SAUDAVEL, under grant no. 552044/2002-4,
+SENASP-MJ and INPE
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This program is distributed hoping it will be useful, however, WITHOUT ANY 
+WARRANTIES; neither to the implicit warranty of MERCHANTABILITY OR SUITABILITY FOR
+AN SPECIFIC FINALITY. Consult the GNU General Public License for more details.
+
+You must have received a copy of the GNU General Public License with this program.
+In negative case, write to the Free Software Foundation, Inc. in the following
+address: 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
+***********************************************************************************/
+/*! \file TeKernelFunctions.h
+    \brief This file contains functions to spatial kernel estimation: basic, adaptive and ratio 
+*/
+
+#ifndef __TERRALIB_INTERNAL_KERNELFUNCTIONS_H
+#define __TERRALIB_INTERNAL_KERNELFUNCTIONS_H
+
+#include "TeException.h"
+#include "TeKernelParams.h"
+#include "TeStatDefines.h"
+#include "TeGeometryAlgorithms.h"
+#include "TeProgress.h"
+
+
+#define   INVALID_KERNEL -TeMAXFLOAT
+
+#define IDX_ATTR            0
+#define IDX_KERNEL          0
+#define IDX_NUMERATOR       1
+#define IDX_KERNEL1         0
+#define IDX_KERNEL2         1
+
+enum TeKernelError {
+ KERNEL_NO_CENTROID,
+   KERNEL_ALL_NULL,
+   KERNEL_INVALID_AREA,
+   KERNEL_INVALID_VALUE,
+   KERNEL_NO_VALUE
+};
+
+class STAT_DLL TeKernelException  {
+
+  TeKernelError error_;
+
+public:
+
+  TeKernelException(TeKernelError e) {
+    error_ = e;
+  }
+
+  TeKernelError getErrorCode() {
+    return error_;
+  }
+};
+
+
+
+/*! Kernel functions 
+
+ * \param tau spatial threshold to define neighboorhood
+ * \param distance distance between event and region centroid
+ * \param intensity attribute value for event
+*/
+STAT_DLL double TeKernelQuartic(double tau, double distance, double intensity);
+STAT_DLL double TeKernelNormal(double tau, double distance, double intensity);
+STAT_DLL double TeKernelUniform(double tau, double distance, double intensity);
+STAT_DLL double TeKernelTriangular(double tau, double distance, double intensity);
+STAT_DLL double TeKernelNegExponential(double tau, double distance, double intensity);
+
+
+/**
+ * Calcula a media geometrica de um conjunto de valores atraves da 
+ * utilizacao de logaritmos
+ * Implementado pelo Andre
+ **/
+template <typename ItReg>
+double TeKernelGeometricMean(ItReg& beginReg, ItReg& endReg, int idx)
+{
+   double mantissa, MediaE, MediaM;
+   int expoente, Cont;
+   int MediaETmp = 0;
+   double MediaMTmp = 0;
+
+   double log_two = log(2.0);
+   Cont = 0;
+   ItReg it = beginReg;
+   double val;
+   while (it != endReg) {  
+         if ((*it).getDoubleProperty(idx, val) && (val > 0))
+         {
+            mantissa = frexp(val,&expoente);
+            MediaMTmp = MediaMTmp+log(mantissa);
+            MediaETmp = MediaETmp+expoente;
+            Cont++;
+         }
+         ++it;
+   }
+
+   MediaE = MediaETmp;
+   MediaM = (MediaMTmp+(MediaE*log_two))/Cont;
+   MediaM = exp(MediaM);
+
+   return MediaM;
+}
+
+
+
+/*! \brief Evaluates normalization factor for kernel
+ * \param begin begin of event set iterator
+ * \param end   end of event set iterator
+ * \return sum of intensities
+ **/
+template <typename ItEvt>
+double KernelNormalizationFactor(ItEvt itBegin, ItEvt itEnd) {
+
+  double normFactor = 0;
+  double intensity;
+
+  ItEvt evtIter = itBegin;
+
+   while (evtIter != itEnd) {
+
+     (*evtIter).getDoubleProperty(IDX_ATTR, intensity);
+     normFactor += intensity;
+      ++evtIter;
+    }
+
+  return normFactor;
+
+}
+
+
+/*! \brief Evaluates kernel value of events with intensity (attribute)
+ * for one support region, for a kernel function
+ * \param center support region centroid
+ * \param begin  begin of event set iterator
+ * \param end    end of event set iterator
+ * \param radius spatial threshold
+ * \param kfunc  type of kernel function
+ * This function assumes that intensity value of event is available on its first
+ * property - if it does not exist, it is set to 1.0 (identity)
+ **/
+template <typename ItEvt>
+double TeKernelValue (TeCoord2D& center, ItEvt& begin, ItEvt& end, 
+					  double radius, TeKernelFunctionType kfunc)
+{
+
+  string    intstr;
+
+	TeCoord2D location;		//Event spatial location
+  double    intensity;	//Event intensity
+
+  //Final kernel value
+	double kernel = 0; 
+
+  //Iterates through events, getting their location and intensity values
+  //and updating kernel value
+	ItEvt it = begin;
+	while (it != end) 
+	{
+		(*it).centroid(location);
+
+		//If there is no properties, assume intensity of one
+	    if (!(*it).getDoubleProperty(IDX_ATTR, intensity)) {
+				intensity = 1.0;
+		}
+
+		//Evaluates kernel value for one event
+		double distance = TeDistance (location,center);
+		double localK;
+
+		switch(kfunc) {
+		case TeKQuartic:
+			localK = TeKernelQuartic(radius,distance,intensity);
+			break;
+		case TeKNormal:
+			localK = TeKernelNormal(radius,distance,intensity);
+			break;
+		case TeKTriangular:
+			localK = TeKernelTriangular(radius,distance,intensity);
+			break;
+		case TeKNegExponential:
+			localK = TeKernelNegExponential(radius,distance,intensity);
+			break;
+		case TeKUniform:
+			localK = TeKernelUniform(radius,distance,intensity);
+			break;
+		}
+		kernel += localK; 
+	    ++it;
+
+	}
+	return kernel;
+}
+
+/*! \brief Normalizes kernel values based on type of computation. 
+ *  \brief Gets value from IDX_KERNEL and stores it at the same place 
+ * \param events set of spatial events
+ * \param regionsBegin begin of regions iterator
+ * \param reginsEnd end of region iterator
+ * \param kfunc type of kernel function
+ * \param ktype type of computation (SMA, density or probability)
+ * \param radius spatial threshold
+ **/
+template<typename EventSet, typename ItRegionSet>
+bool TeKernelNormalize(EventSet& events, 
+                   ItRegionSet& regionsBegin,
+                   ItRegionSet& regionsEnd,
+                   TeKernelComputeType  kType,
+                   double totKernel,
+                   int idxProp)
+{
+
+  double normKernel, kernel, area;
+  try {
+
+  //Evaluates sum of attributes for normalization
+    double normFactor = 
+      KernelNormalizationFactor(events.begin(), events.end());
+
+    //Reiterates through regions defining normalized kernel value,
+    //given the computation type
+    ItRegionSet regIter = regionsBegin;
+    while (regIter != regionsEnd) 
+    {
+      
+      (*regIter).getDoubleProperty(idxProp, kernel);
+      if (kernel < 0) {
+         throw TeKernelException(KERNEL_INVALID_VALUE);
+      }
+
+      //Evaluates value based on computation type
+      switch(kType) {
+      case TeKMovingAverage:
+        normKernel = (kernel * normFactor)/totKernel;
+        break;
+      case TeKDensity:
+        //If region does not have an area, assumes one
+        (*regIter).area(area); 
+        if (area <= 0) {
+          throw TeKernelException(KERNEL_INVALID_AREA);
+        }
+        normKernel = ((kernel * normFactor)/totKernel)/area;
+        break;
+      case TeKProbability:
+        normKernel = kernel/totKernel;
+        break;
+      }
+
+      //Store final value
+      (*regIter).setDoubleProperty(idxProp, normKernel);
+      ++regIter;
+    }  
+  } catch (TeKernelException /* e */) {
+//    int a = e.getErrorCode();
+    return false;
+  }
+  return true;
+}
+
+
+/*! \brief Evaluates kernel value for all support regions, 
+ * storing values either on IDX_KERNEL or IDX_NUMERATOR.  
+ * \param events set of spatial events
+ * \param regionsBegin begin of regions iterator
+ * \param reginsEnd end of region iterator
+ * \param kfunc type of kernel function
+ * \param ktype type of computation (SMA, density or probability)
+ * \param radius spatial threshold
+ * \param idxProp index of double property
+ **/
+template<typename EventSet, typename ItRegionSet>
+bool TeStatIntKernel(EventSet& events, 
+                   ItRegionSet& regionsBegin,
+                   ItRegionSet& regionsEnd,
+                   TeKernelFunctionType kfunc, 
+                   TeKernelComputeType  kType,
+                   double radius,  
+                   int idxProp)
+{
+
+
+  //Support region attributes
+  TeCoord2D location;
+  double    kernel;
+  
+  //Regions iterator
+  ItRegionSet regIter = regionsBegin;
+  // Sum of kernels
+  double totKernel = 0;
+
+  //Treats unexpected expections returning false
+  try {
+
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+	int nsteps = 0;
+    //Iterates through regions
+    while (regIter != regionsEnd) 
+    {
+      (*regIter).centroid(location); 
+      
+      //Define iterators for event sets -- may optimize
+      typename EventSet::iterator subSetBegin = events.begin(location,radius);
+      typename EventSet::iterator subSetEnd = events.end(location,radius);
+      if (kfunc == TeKNormal) {
+        subSetBegin = events.begin();
+        subSetEnd = events.end();
+      }
+
+      //Evaluates kernel value for region
+      kernel = TeKernelValue(location, subSetBegin, subSetEnd, 
+        radius, kfunc);
+      
+      totKernel += kernel;
+
+      (*regIter).setDoubleProperty(idxProp, kernel);
+      ++regIter; 
+	  t2 = clock();
+	  ++nsteps;
+	  if (TeProgress::instance())
+	  {
+		 if (int(t2-t1) > dt)
+		 {
+			t1 = t2;
+			if (TeProgress::instance()->wasCancelled())
+				break;
+			if((int)(t2-t0) > dt2)
+				TeProgress::instance()->setProgress(nsteps);
+		 }
+	  }
+	}
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+    if (totKernel <= 0) {
+      throw TeKernelException(KERNEL_ALL_NULL);
+    }
+
+    return TeKernelNormalize(events, regionsBegin, regionsEnd, kType, totKernel,
+      idxProp);
+
+  } catch (TeKernelException /* e */) {
+//    int a = e.getErrorCode();
+    return false;
+  }
+  
+  return true;
+}
+
+
+/*! \brief Evaluates adaptive kernel value for all support regions, 
+ * storing values (intermediary and final) in double property idxProp  
+ * \param events set of spatial events
+ * \param regionsBegin begin of regions iterator
+ * \param reginsEnd end of region iterator
+ * \param kfunc type of kernel function
+ * \param ktype type of computation (SMA, density or probability)
+ * \param numReg number of support regions -- need to evaluate initial radius
+ * \param totalArea total area of support regions -- need to evaluate initial radius
+ * \param idxProp index of double property
+ **/
+template<typename EventSet, typename ItRegionSet>
+bool TeStatAdaptiveGeoMeanIntKernel(EventSet& events, 
+                                    ItRegionSet& regionsBegin,
+                                    ItRegionSet& regionsEnd,
+                                    TeKernelFunctionType kfunc,
+                                    TeKernelComputeType ktype,
+                                    int /* numReg */,
+                                    double totalArea,
+                                    int idxProp) 
+{
+
+  try {
+
+    //Evaluate kernel with a fixed radius, based on formula, storing in vecValues
+    double radius = 0.68*pow((double)events.numObjects(),-0.2)*sqrt(totalArea);
+    double sqArea = sqrt(totalArea);
+    if (!TeStatIntKernel(events, regionsBegin, regionsEnd,
+      kfunc, ktype, radius, idxProp))
+      return false;
+    
+    //Evaluate geometric mean of kernel values, to adjust radius
+    double meanKernel = TeKernelGeometricMean(regionsBegin, regionsEnd, idxProp);
+    
+    if (meanKernel <= 0) {
+      throw TeKernelException(TeKernelException(KERNEL_ALL_NULL));
+    }
+    
+    //Now, reassign radius, evaluating final value for kernel
+    
+    ItRegionSet regIter = regionsBegin;
+    double    prevKernel;
+    double    newKernel;
+    double    newRadius;
+    double    totKernel = 0;
+    TeCoord2D location;
+    
+	int dt = CLOCKS_PER_SEC/4;
+	int dt2 = CLOCKS_PER_SEC * 5;
+	clock_t	t0, t1, t2;
+	t2 = clock();
+	t0 = t1 = t2;
+	int nsteps = 0;
+
+    //Iterates through regions
+    while (regIter != regionsEnd) 
+    {
+      (*regIter).centroid(location); 
+      
+      //Define iterators for event sets -- may optimize
+      typename EventSet::iterator subSetBegin = events.begin(location,radius);
+      typename EventSet::iterator subSetEnd = events.end(location,radius);
+      if (kfunc == TeKNormal) {
+        subSetBegin = events.begin();
+        subSetEnd = events.end();
+      }
+
+      if (!((*regIter).getDoubleProperty(idxProp, prevKernel)) || (prevKernel < 0)) {
+         throw TeKernelException(KERNEL_INVALID_VALUE);
+      }
+  
+      if (prevKernel > 0) {
+        newRadius = radius*pow((meanKernel/prevKernel),0.5);
+        if (newRadius > sqArea/4.0)
+          newRadius = sqArea/4.0; //Para funcionar quando o valor eh muito pequeno
+        newKernel = TeKernelValue(location, subSetBegin, subSetEnd,  newRadius, kfunc);
+      }
+      else {
+        newKernel = 0.0;
+      }
+      
+      totKernel += newKernel;
+      (*regIter).setDoubleProperty(idxProp, newKernel);
+      ++regIter; 
+	  t2 = clock();
+	  ++nsteps;
+	  if (TeProgress::instance())
+	  {
+		 if (int(t2-t1) > dt)
+		 {
+			t1 = t2;
+			if (TeProgress::instance()->wasCancelled())
+				break;
+			if((int)(t2-t0) > dt2)
+				TeProgress::instance()->setProgress(nsteps);
+		 }
+	  }
+    }
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+    if (totKernel <= 0) {
+      throw TeKernelException(KERNEL_ALL_NULL);
+    }
+
+    return TeKernelNormalize(events, regionsBegin, regionsEnd, ktype, totKernel,
+      idxProp);
+  } catch (TeKernelException /* e */) { 
+//      int a = e.getErrorCode();
+      return false;
+  }
+    
+  return true;
+}
+
+
+
+/*! Class to apply kernel method
+*
+*/
+class STAT_DLL TeStatKernel {
+
+public:
+
+  //! type of kernel function
+  TeKernelFunctionType kfunc_;
+  //! type of computation
+  TeKernelComputeType  ktype_;
+  //! spatial threshold
+  double               radius_;
+  //! sum of support region areas
+  double               totalArea_;
+  //! number of support regions
+  int                  numReg_;
+  
+  TeStatKernel() {
+    kfunc_ = TeKQuartic;
+    ktype_ = TeKDensity;
+    radius_ = 0;
+    totalArea_ = 0;
+    numReg_ = 0;
+  }
+
+  /*! \brief Apply kernel method to a specif set of support regions
+   * and events, storing results in resName_.
+   * \param events set of point events
+   * \param regionsBegin iterator for support regions
+   * \param regionsEnd   iterator for support regions
+   * If radius_ is 0, then applies adaptive kernel.
+   */
+  template<typename EventSet, typename ItRegionSet>
+  bool apply(EventSet& events, 
+    ItRegionSet regionsBegin,
+    ItRegionSet regionsEnd) {
+    if (totalArea_ <= 0) {
+      return false;
+    }
+
+    if (numReg_ <= 0) {
+      return false;
+    }
+
+    bool result;
+    //Radius defined, kernel with a fixed radius
+    if (radius_ > 0) {
+      result = TeStatIntKernel(events,regionsBegin, regionsEnd, 
+        kfunc_,ktype_, radius_, IDX_KERNEL);
+      
+    }
+    //Radius undefined, adaptive kernel
+    else {
+      result = TeStatAdaptiveGeoMeanIntKernel(events,  regionsBegin, regionsEnd, 
+        kfunc_, ktype_, numReg_, totalArea_, IDX_KERNEL); 
+
+    }
+    return result;
+  }
+
+};
+
+
+
+class STAT_DLL TeStatKernelRatio
+{
+  public:
+  int						numReg_;
+  
+  public:
+
+  TeKernelCombinationType	kComb_;
+  TeKernelComputeType		  ktype_;
+  TeKernelFunctionType		kfunc1_;
+  double					        radius1_;
+  TeKernelFunctionType		kfunc2_;
+  double				        	radius2_;
+  double				        	totalArea_;
+
+  
+  TeStatKernelRatio() {
+    kComb_ = TeKRatio;
+    kfunc1_ =  kfunc2_ = TeKQuartic;
+    ktype_ = TeKDensity;
+    radius1_ = radius2_ = 0;
+    totalArea_ = 0;
+    numReg_ = 0;
+  }
+   
+  template <typename EventSet1, typename EventSet2, typename ItRegionSet>
+  bool apply (EventSet1& ev1, 
+    EventSet2& ev2, 
+    ItRegionSet regBegin, 
+    ItRegionSet regEnd) {
+   
+    
+    if (totalArea_ <= 0)
+      return false;
+    
+    if (numReg_ <= 0) 
+      return false;
+    
+    //Calcula kernel para primeiro conjunto
+
+    bool result;
+    //Radius defined, kernel with a fixed radius
+    if (radius1_ > 0) {
+      result = TeStatIntKernel(ev1,regBegin, regEnd, 
+        kfunc1_,ktype_, radius1_, IDX_KERNEL1);
+      
+    }
+    //Radius undefined, adaptive kernel
+    else {
+      result = TeStatAdaptiveGeoMeanIntKernel(ev1,  regBegin, regEnd, 
+        kfunc1_, ktype_, numReg_, totalArea_, IDX_KERNEL1); 
+
+    }
+    
+    if (!result)
+      return result;
+
+  
+    //Calcula kernel para segundo conjunto
+     //Radius defined, kernel with a fixed radius
+    if (radius2_ > 0) {
+      result = TeStatIntKernel(ev2,regBegin, regEnd, 
+        kfunc2_,ktype_, radius2_, IDX_KERNEL2);
+      
+    }
+    //Radius undefined, adaptive kernel
+    else {
+      result = TeStatAdaptiveGeoMeanIntKernel(ev2,  regBegin, regEnd, 
+        kfunc2_, ktype_, numReg_, totalArea_, IDX_KERNEL2); 
+
+    }
+
+    if (!result)
+      return result;
+    
+    //Itera calculando o tipo de combinacao e armazenando no valor da regiao
+    //Percorre todas as regioes
+//    int Cont = 0;
+    double kernel;
+    double k1;
+    double k2;
+    double area;
+    
+    ItRegionSet regIter = regBegin;
+ 
+    while (regIter != regEnd) 
+    {
+  
+      (*regIter).area(area);
+      
+      (*regIter).getDoubleProperty(IDX_KERNEL1, k1);
+      (*regIter).getDoubleProperty(IDX_KERNEL2, k2);
+      
+      switch(kComb_) 
+      {
+      case TeKRatio:
+        if (k2 == 0.0)
+          kernel = 0.0;//INVALID_KERNEL;
+        else
+          kernel = k1/k2;
+        break;
+      case TeKLogRatio:
+        if (k2 == 0.0)
+          kernel = INVALID_KERNEL;
+        else
+          kernel = log(k1/k2);
+        break;
+      case TeAbsDifference:
+        kernel = k1 - k2;
+        break;
+      case TeRelDifference:
+        kernel = (k1 - k2) * area;
+        break;
+      case TeAbsSum:
+        kernel = k1+k2;
+        break;
+      case TeRelSum:
+        kernel = (k1 + k2) * area;
+        break;
+      }
+	  (*regIter).setDoubleProperty(IDX_KERNEL, kernel);
+	  ++regIter; 
+    }
+    
+    return true;
+  }
+                       
+};
+
+
+#endif
+
+
+
+
+
diff --git a/src/terralib/stat/TeKernelParams.h b/src/terralib/stat/TeKernelParams.h
old mode 100755
new mode 100644
index 47cd5ff..ce979d5
--- a/src/terralib/stat/TeKernelParams.h
+++ b/src/terralib/stat/TeKernelParams.h
@@ -1,112 +1,112 @@
-/************************************************************************************
-Exploring and analysis of geographical data using TerraLib and TerraView
-Copyright � 2003-2007 INPE and LESTE/UFMG.
-
-Partially funded by CNPq - Project SAUDAVEL, under grant no. 552044/2002-4,
-SENASP-MJ and INPE
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This program is distributed hoping it will be useful, however, WITHOUT ANY 
-WARRANTIES; neither to the implicit warranty of MERCHANTABILITY OR SUITABILITY FOR
-AN SPECIFIC FINALITY. Consult the GNU General Public License for more details.
-
-You must have received a copy of the GNU General Public License with this program.
-In negative case, write to the Free Software Foundation, Inc. in the following
-address: 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
-***********************************************************************************/
-/*! \file TeKernelParams.h
-    \brief This file contains structures and definitions about Kernel parameters
-*/
-#ifndef __TERRALIB_INTERNAL_KERNELPARAMS_H
-#define __TERRALIB_INTERNAL_KERNELPARAMS_H
-
-#include "TeStatDefines.h"
-#include "TeUtils.h"
-
-#include <string>
-#include <vector>
-using namespace std;
-
-//! Kernel Algorithm types
-enum TeKernelFunctionType 
- {TeKQuartic, TeKNormal, TeKUniform, TeKTriangular, TeKNegExponential};
-
-
-//! Kernel Evaluation types
-enum TeKernelComputeType 
-{TeKDensity, TeKMovingAverage, TeKProbability};
-
-enum TeKernelCombinationType
-{TeKRatio, TeKLogRatio, TeAbsDifference, TeRelDifference, TeAbsSum, TeRelSum};
-
-
-/*! \struct TeKernelParams
-	Kernel parameters representation
-*/
-struct STAT_DLL TeKernelParams
-{
-	//first event theme
-	int						eventThemeId1_;			// event theme id
-	string					eventThemeName1_;		// event theme name
-	string					intensityAttrName1_;	// intensity attribute name 		
-	string					intensityAttrTable1_;	// table name that keeps the intensity attribute
-	TeKernelFunctionType	kernelFunction1_;		// kernel function
-	TeKernelComputeType		computeType1_;
-	double					radiusValue1_;			// radius value if the kernel is not adaptative 
-
-	TeKernelCombinationType	combinationType_;
-	
-	//second event theme (if Kernel ratio)
-	int						eventThemeId2_;			// event theme id
-	string					eventThemeName2_;		// event theme name
-	string					intensityAttrName2_;	// intensity attribute name 		
-	string					intensityAttrTable2_;	// table name that keeps the intensity attribute
-	TeKernelFunctionType	kernelFunction2_;		// kernel function
-	TeKernelComputeType		computeType2_;
-	double					radiusValue2_;			// radius value if the kernel is not adaptative 
-	
-	//informations about the kernel result
-	int						supportThemeId_;		// support theme id
-	string					supportThemeName_;		// support theme name 
-	string					supportThemeTable_;		// support theme table that keeps the kernel results 
-	string					supportThemeAttr_;		// attribute name of the support theme table that keeps the kernel results   	
-	int						generatedLayerId_;		// id of the generated layer (when it�s raster) 
-	string					generatedLayerName_;	// name of the generated layer (when it�s raster)
-	
-	//! Empty constructor
-	TeKernelParams():
-		eventThemeId1_(0),
-		eventThemeName1_(""),
-		intensityAttrName1_(""),
-		intensityAttrTable1_(""),
-		kernelFunction1_(TeKQuartic),
-		computeType1_(TeKDensity),
-		radiusValue1_(0.0),
-		combinationType_(TeKRatio),
-		eventThemeId2_(0),
-		eventThemeName2_(""),
-		intensityAttrName2_(""),
-		intensityAttrTable2_(""),
-		kernelFunction2_(TeKQuartic),
-		computeType2_(TeKDensity),
-		radiusValue2_(0.0),
-		supportThemeId_(0),
-		supportThemeName_(""),
-		supportThemeTable_(""),
-		supportThemeAttr_(""),
-		generatedLayerId_(0),
-		generatedLayerName_("")
-		{}
-
-};
-
-//! A vector of TeKernelParams
-typedef vector<TeKernelParams> TeKernelParamsVector;
-
-
-#endif
-
+/************************************************************************************
+Exploring and analysis of geographical data using TerraLib and TerraView
+Copyright � 2003-2007 INPE and LESTE/UFMG.
+
+Partially funded by CNPq - Project SAUDAVEL, under grant no. 552044/2002-4,
+SENASP-MJ and INPE
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This program is distributed hoping it will be useful, however, WITHOUT ANY 
+WARRANTIES; neither to the implicit warranty of MERCHANTABILITY OR SUITABILITY FOR
+AN SPECIFIC FINALITY. Consult the GNU General Public License for more details.
+
+You must have received a copy of the GNU General Public License with this program.
+In negative case, write to the Free Software Foundation, Inc. in the following
+address: 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
+***********************************************************************************/
+/*! \file TeKernelParams.h
+    \brief This file contains structures and definitions about Kernel parameters
+*/
+#ifndef __TERRALIB_INTERNAL_KERNELPARAMS_H
+#define __TERRALIB_INTERNAL_KERNELPARAMS_H
+
+#include "TeStatDefines.h"
+#include "TeUtils.h"
+
+#include <string>
+#include <vector>
+using namespace std;
+
+//! Kernel Algorithm types
+enum TeKernelFunctionType 
+ {TeKQuartic, TeKNormal, TeKUniform, TeKTriangular, TeKNegExponential};
+
+
+//! Kernel Evaluation types
+enum TeKernelComputeType 
+{TeKDensity, TeKMovingAverage, TeKProbability};
+
+enum TeKernelCombinationType
+{TeKRatio, TeKLogRatio, TeAbsDifference, TeRelDifference, TeAbsSum, TeRelSum};
+
+
+/*! \struct TeKernelParams
+	Kernel parameters representation
+*/
+struct STAT_DLL TeKernelParams
+{
+	//first event theme
+	int						eventThemeId1_;			// event theme id
+	string					eventThemeName1_;		// event theme name
+	string					intensityAttrName1_;	// intensity attribute name 		
+	string					intensityAttrTable1_;	// table name that keeps the intensity attribute
+	TeKernelFunctionType	kernelFunction1_;		// kernel function
+	TeKernelComputeType		computeType1_;
+	double					radiusValue1_;			// radius value if the kernel is not adaptative 
+
+	TeKernelCombinationType	combinationType_;
+	
+	//second event theme (if Kernel ratio)
+	int						eventThemeId2_;			// event theme id
+	string					eventThemeName2_;		// event theme name
+	string					intensityAttrName2_;	// intensity attribute name 		
+	string					intensityAttrTable2_;	// table name that keeps the intensity attribute
+	TeKernelFunctionType	kernelFunction2_;		// kernel function
+	TeKernelComputeType		computeType2_;
+	double					radiusValue2_;			// radius value if the kernel is not adaptative 
+	
+	//informations about the kernel result
+	int						supportThemeId_;		// support theme id
+	string					supportThemeName_;		// support theme name 
+	string					supportThemeTable_;		// support theme table that keeps the kernel results 
+	string					supportThemeAttr_;		// attribute name of the support theme table that keeps the kernel results   	
+	int						generatedLayerId_;		// id of the generated layer (when it�s raster) 
+	string					generatedLayerName_;	// name of the generated layer (when it�s raster)
+	
+	//! Empty constructor
+	TeKernelParams():
+		eventThemeId1_(0),
+		eventThemeName1_(""),
+		intensityAttrName1_(""),
+		intensityAttrTable1_(""),
+		kernelFunction1_(TeKQuartic),
+		computeType1_(TeKDensity),
+		radiusValue1_(0.0),
+		combinationType_(TeKRatio),
+		eventThemeId2_(0),
+		eventThemeName2_(""),
+		intensityAttrName2_(""),
+		intensityAttrTable2_(""),
+		kernelFunction2_(TeKQuartic),
+		computeType2_(TeKDensity),
+		radiusValue2_(0.0),
+		supportThemeId_(0),
+		supportThemeName_(""),
+		supportThemeTable_(""),
+		supportThemeAttr_(""),
+		generatedLayerId_(0),
+		generatedLayerName_("")
+		{}
+
+};
+
+//! A vector of TeKernelParams
+typedef vector<TeKernelParams> TeKernelParamsVector;
+
+
+#endif
+
diff --git a/src/terralib/stat/TeMSVFactory.cpp b/src/terralib/stat/TeMSVFactory.cpp
old mode 100755
new mode 100644
index 3569ca9..cc6f614
--- a/src/terralib/stat/TeMSVFactory.cpp
+++ b/src/terralib/stat/TeMSVFactory.cpp
@@ -1,163 +1,163 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <TeMSVFactory.h>
-#include <vector>
-
-using namespace std;
-
-static TeSemivariogram_Factory semivar("Semivariogram");
-static TeCorrelogram_Factory	 correlo("Correlogram");
-static TeSemimadogram_Factory  semimad("Semimadogram");
-static TeCovariance_Factory	 covaria("Covariance");
-
-
-///////////////////////////////
-TeMatrix
-TeSemivariogram :: calculate ()
-{
-	TeMatrix		msvar;
-	vector<double>	dis, gam, np;
-	double			dmin, dmax, dirmin, dirmax, tolincr, inc;
-	int				lin, col, nl, nrow, ncol;
-
-	// Le o n�mero de linha e coluna da matriz de entrada
-	nrow = MSVmatrix_->Nrow()-1;
-	ncol = MSVmatrix_->Ncol()-1;
-
-	// Inicializa a matriz de retorno
-	msvar.Init((int)MSVnlag_, 2.);
-
-	// Inicializa vetores auxiliares
-	for (nl=0; nl<MSVnlag_; ++nl)
-	{
-		np.push_back(0.);
-		dis.push_back(0.);
-		gam.push_back(0.);
-	}
-
-	// Define a tolerancia do incremento = 50% do increm.
-	tolincr = MSVincr_/2.;
-
-	// Define dire��o minima e m�xima
-	dirmin = dirmax = 0.0;
-	if (MSVtoldir_ != 90.0)
-	{
-		dirmin = MSVdir_ - MSVtoldir_;
-		dirmax = MSVdir_ + MSVtoldir_;
-	}
-
-	// Inicializa variavel auxiliar
-	inc = MSVincr_;
-
-	for (nl=0; nl<MSVnlag_; ++nl)
-	{
-		dmin = inc - tolincr;
-		dmax = inc + tolincr;
-
-		for (lin=0; lin<nrow; ++lin)
-		{
-			for (col=0; col<ncol; ++col)
-			{
-				if ( MSVtoldir_ == 90.0) // Omnidirecional
-				{
-					if ( lin<col && (*MSVmatrix_)(lin,col)>0. && (*MSVmatrix_)(lin,col)<=tolincr && nl==0 )
-					{
-						np[nl] = np[nl] + 1.;
-						dis[nl] = dis[nl] + (*MSVmatrix_)(lin,col);
-						gam[nl] = gam[nl] + (( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ) * ( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ));
-					}
-					else if ( lin<col && (*MSVmatrix_)(lin,col)>dmin && (*MSVmatrix_)(lin,col)<=dmax && nl!=0 )
-					{
-						np[nl] = np[nl] + 1.;
-						dis[nl] = dis[nl] + (*MSVmatrix_)(lin,col);
-						gam[nl] = gam[nl] + (( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ) * ( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ));
-					}
-				}
-				else // Direcional
-				{
-					if ( lin<col && (*MSVmatrix_)(lin,col)>0. && (*MSVmatrix_)(lin,col)<=tolincr && (*MSVmatrix_)(col,lin)>=dirmin && (*MSVmatrix_)(col,lin)<=dirmax && nl==0 )
-					{
-						np[nl] = np[nl] + 1.;
-						dis[nl] = dis[nl] + (*MSVmatrix_)(lin,col);
-						gam[nl] = gam[nl] + (( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ) * ( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ));
-					}
-					else if ( lin<col && (*MSVmatrix_)(lin,col)>dmin && (*MSVmatrix_)(lin,col)<=dmax && (*MSVmatrix_)(col,lin)>=dirmin && (*MSVmatrix_)(col,lin)<=dirmax && nl!=0 )
-					{
-						np[nl] = np[nl] + 1.;
-						dis[nl] = dis[nl] + (*MSVmatrix_)(lin,col);
-						gam[nl] = gam[nl] + (( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ) * ( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ));
-					}
-				}
-			}
-		}
-		if (nl != 0)
-			inc = MSVincr_ + inc;
-	}
-
-	// Reporta o semivariograma
-	for (nl=0; nl<MSVnlag_; ++nl)
-	{
-
-		if (np[nl] != 0)
-		{
-			dis[nl] = dis[nl] / np[nl];
-			gam[nl] = (gam[nl] / np[nl])*.5;
-		}
-    
-    	//Preenche a matriz de retorno da funcao
-    	msvar(nl,0) = dis[nl];
-    	msvar(nl,1) = gam[nl];
-	}
-	return msvar;
-}
-
-
-///////////////////////////////
-TeMatrix
-TeCorrelogram :: calculate ()
-{
-	TeMatrix		msvar;
-
-	return msvar;
-}
-
-
-///////////////////////////////
-TeMatrix
-TeSemimadogram :: calculate ()
-{
-	TeMatrix		msvar;
-
-	return msvar;
-}
-
-
-///////////////////////////////
-TeMatrix
-TeCovariance :: calculate ()
-{
-	TeMatrix		msvar;
-
-	return msvar;
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <TeMSVFactory.h>
+#include <vector>
+
+using namespace std;
+
+static TeSemivariogram_Factory semivar("Semivariogram");
+static TeCorrelogram_Factory	 correlo("Correlogram");
+static TeSemimadogram_Factory  semimad("Semimadogram");
+static TeCovariance_Factory	 covaria("Covariance");
+
+
+///////////////////////////////
+TeMatrix
+TeSemivariogram :: calculate ()
+{
+	TeMatrix		msvar;
+	vector<double>	dis, gam, np;
+	double			dmin, dmax, dirmin, dirmax, tolincr, inc;
+	int				lin, col, nl, nrow, ncol;
+
+	// Le o n�mero de linha e coluna da matriz de entrada
+	nrow = MSVmatrix_->Nrow()-1;
+	ncol = MSVmatrix_->Ncol()-1;
+
+	// Inicializa a matriz de retorno
+	msvar.Init((int)MSVnlag_, 2.);
+
+	// Inicializa vetores auxiliares
+	for (nl=0; nl<MSVnlag_; ++nl)
+	{
+		np.push_back(0.);
+		dis.push_back(0.);
+		gam.push_back(0.);
+	}
+
+	// Define a tolerancia do incremento = 50% do increm.
+	tolincr = MSVincr_/2.;
+
+	// Define dire��o minima e m�xima
+	dirmin = dirmax = 0.0;
+	if (MSVtoldir_ != 90.0)
+	{
+		dirmin = MSVdir_ - MSVtoldir_;
+		dirmax = MSVdir_ + MSVtoldir_;
+	}
+
+	// Inicializa variavel auxiliar
+	inc = MSVincr_;
+
+	for (nl=0; nl<MSVnlag_; ++nl)
+	{
+		dmin = inc - tolincr;
+		dmax = inc + tolincr;
+
+		for (lin=0; lin<nrow; ++lin)
+		{
+			for (col=0; col<ncol; ++col)
+			{
+				if ( MSVtoldir_ == 90.0) // Omnidirecional
+				{
+					if ( lin<col && (*MSVmatrix_)(lin,col)>0. && (*MSVmatrix_)(lin,col)<=tolincr && nl==0 )
+					{
+						np[nl] = np[nl] + 1.;
+						dis[nl] = dis[nl] + (*MSVmatrix_)(lin,col);
+						gam[nl] = gam[nl] + (( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ) * ( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ));
+					}
+					else if ( lin<col && (*MSVmatrix_)(lin,col)>dmin && (*MSVmatrix_)(lin,col)<=dmax && nl!=0 )
+					{
+						np[nl] = np[nl] + 1.;
+						dis[nl] = dis[nl] + (*MSVmatrix_)(lin,col);
+						gam[nl] = gam[nl] + (( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ) * ( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ));
+					}
+				}
+				else // Direcional
+				{
+					if ( lin<col && (*MSVmatrix_)(lin,col)>0. && (*MSVmatrix_)(lin,col)<=tolincr && (*MSVmatrix_)(col,lin)>=dirmin && (*MSVmatrix_)(col,lin)<=dirmax && nl==0 )
+					{
+						np[nl] = np[nl] + 1.;
+						dis[nl] = dis[nl] + (*MSVmatrix_)(lin,col);
+						gam[nl] = gam[nl] + (( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ) * ( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ));
+					}
+					else if ( lin<col && (*MSVmatrix_)(lin,col)>dmin && (*MSVmatrix_)(lin,col)<=dmax && (*MSVmatrix_)(col,lin)>=dirmin && (*MSVmatrix_)(col,lin)<=dirmax && nl!=0 )
+					{
+						np[nl] = np[nl] + 1.;
+						dis[nl] = dis[nl] + (*MSVmatrix_)(lin,col);
+						gam[nl] = gam[nl] + (( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ) * ( (*MSVmatrix_)(lin,lin) - (*MSVmatrix_)(col,col) ));
+					}
+				}
+			}
+		}
+		if (nl != 0)
+			inc = MSVincr_ + inc;
+	}
+
+	// Reporta o semivariograma
+	for (nl=0; nl<MSVnlag_; ++nl)
+	{
+
+		if (np[nl] != 0)
+		{
+			dis[nl] = dis[nl] / np[nl];
+			gam[nl] = (gam[nl] / np[nl])*.5;
+		}
+    
+    	//Preenche a matriz de retorno da funcao
+    	msvar(nl,0) = dis[nl];
+    	msvar(nl,1) = gam[nl];
+	}
+	return msvar;
+}
+
+
+///////////////////////////////
+TeMatrix
+TeCorrelogram :: calculate ()
+{
+	TeMatrix		msvar;
+
+	return msvar;
+}
+
+
+///////////////////////////////
+TeMatrix
+TeSemimadogram :: calculate ()
+{
+	TeMatrix		msvar;
+
+	return msvar;
+}
+
+
+///////////////////////////////
+TeMatrix
+TeCovariance :: calculate ()
+{
+	TeMatrix		msvar;
+
+	return msvar;
+}
diff --git a/src/terralib/stat/TeMSVFactory.h b/src/terralib/stat/TeMSVFactory.h
old mode 100755
new mode 100644
index 43b7745..8fc69e9
--- a/src/terralib/stat/TeMSVFactory.h
+++ b/src/terralib/stat/TeMSVFactory.h
@@ -1,191 +1,195 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeMSVFactory.h
-    \brief This file contains support do deal with Measures of Spatial Variability
-*/
-#ifndef __TERRALIB_INTERNAL_SPATIALMEASUREFACTORY_H
-#define __TERRALIB_INTERNAL_SPATIALMEASUREFACTORY_H
-
-#ifdef WIN32 
-#pragma warning ( disable: 4786 ) 
-#endif
-
-
-#include <map>
-#include <string>
-#include <TeMatrix.h>
-#include <TeFactory.h>
-
-using namespace std;
-
-/** @defgroup MSV Classes and structures to deal with measures of spatial variability 
- *  @{
- 	@ingroup SpatialStatistics
- */
-//! Struct of parameters for measures of spatial variability 
-struct TeMSVParams
-{
-	TeMatrix	MSVPmatrix_;
-	double		MSVPdir_;
-	double		MSVPtoldir_;
-	double		MSVPincr_;
-	double		MSVPnlag_;
-};
-
-//! An abstract class for measures of spatial variability 
-class TeMSV		
-{
-public:
-	TeMSV (){};
-	virtual ~TeMSV () {}
-
-	virtual TeMatrix	calculate ()=0;
-	static TeMSV* DefaultObject(TeMSVParams){ return 0; }		
-	void setMatrix(TeMatrix* m) {MSVmatrix_ = m;}
-
-protected:
-	TeMatrix*	MSVmatrix_;
-	double		MSVdir_;
-	double		MSVtoldir_;
-	double		MSVincr_;
-	double		MSVnlag_;		
-};
-
-
-//! A class that represents a semivariogram
-class TeSemivariogram : public TeMSV
-{
-public:
-	TeSemivariogram(const TeMSVParams& params){
-		MSVdir_ = params.MSVPdir_;
-		MSVtoldir_ = params.MSVPtoldir_;
-		MSVincr_ = params.MSVPincr_;
-		MSVnlag_ = params.MSVPnlag_;
-	}
-	
-	~TeSemivariogram() { }
-
-	virtual TeMatrix	calculate ();	
-};
-
-
-//! A class that represents a correlogram
-class TeCorrelogram : public TeMSV
-{
-public:
-		TeCorrelogram(const TeMSVParams& params){
-		MSVdir_ = params.MSVPdir_;
-		MSVtoldir_ = params.MSVPtoldir_;
-		MSVincr_ = params.MSVPincr_;
-		MSVnlag_ = params.MSVPnlag_;
-	}		
-	
-	~TeCorrelogram(){};
-
-	virtual TeMatrix	calculate ();	
-};
-
-//! A class that represents a Semimadogram
-class TeSemimadogram : public TeMSV
-{
-public:
-		TeSemimadogram(const TeMSVParams& params){
-		MSVdir_ = params.MSVPdir_;
-		MSVtoldir_ = params.MSVPtoldir_;
-		MSVincr_ = params.MSVPincr_;
-		MSVnlag_ = params.MSVPnlag_;
-	}		
-	
-	~TeSemimadogram(){};
-
-	virtual TeMatrix	calculate ();	
-};
-
-//! A class that represents a covariance
-class TeCovariance : public TeMSV
-{
-public:
-		TeCovariance(const TeMSVParams& params){
-		MSVdir_ = params.MSVPdir_;
-		MSVtoldir_ = params.MSVPtoldir_;
-		MSVincr_ = params.MSVPincr_;
-		MSVnlag_ = params.MSVPnlag_;
-	}		
-	
-	~TeCovariance(){};
-
-	virtual TeMatrix	calculate ();	
-};
-
-
-//! An abstract factory of spatial variability measures
-class TeMSVFactory : public TeFactory<TeMSV, TeMSVParams>
-{
-public:
-	TeMSVFactory(const string& name) : TeFactory<TeMSV, TeMSVParams>(name){}
-	virtual TeMSV* build(const TeMSVParams&) = 0;
-};
-
-
-//! A concrete factory of semivariograms
-class TeSemivariogram_Factory : public TeMSVFactory
-{
-public:
-	TeSemivariogram_Factory (const string& name) : TeMSVFactory(name){}
-
-	virtual TeMSV* build(const TeMSVParams& params){return new TeSemivariogram(params);}
-};
-
-
-//! A concrete factory of correlograms
-class TeCorrelogram_Factory : public TeMSVFactory
-{
-public:
-	TeCorrelogram_Factory (const string& name) : TeMSVFactory (name){}
-
-	virtual TeMSV* build (const TeMSVParams& params){return new TeCorrelogram(params);}
-};
-
-
-//! A concrete factory of semimadograms
-class TeSemimadogram_Factory : public TeMSVFactory
-{
-public:
-	TeSemimadogram_Factory (const string& name) : TeMSVFactory (name){}
-
-	virtual TeMSV* build (const TeMSVParams& params){return new TeSemimadogram(params);}
-};
-
-
-//! A concrete factory of covariances
-class TeCovariance_Factory : public TeMSVFactory
-{
-public:
-	TeCovariance_Factory (const string& name) : TeMSVFactory (name){}
-
-	virtual TeMSV* build (const TeMSVParams& params){return new TeCovariance(params);}
-};
-/** @} */ 
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeMSVFactory.h
+    \brief This file contains support do deal with Measures of Spatial Variability
+*/
+#ifndef __TERRALIB_INTERNAL_SPATIALMEASUREFACTORY_H
+#define __TERRALIB_INTERNAL_SPATIALMEASUREFACTORY_H
+
+#ifdef WIN32 
+#pragma warning ( disable: 4786 ) 
+#endif
+
+
+#include <map>
+#include <string>
+#include <TeMatrix.h>
+#include <TeFactory.h>
+
+#include "TeStatDefines.h"
+
+using namespace std;
+
+/** @defgroup MSV Classes and structures to deal with measures of spatial variability 
+ *  @{
+ 	@ingroup SpatialStatistics
+ */
+//! Struct of parameters for measures of spatial variability 
+struct STAT_DLL TeMSVParams
+{
+	TeMatrix	MSVPmatrix_;
+	double		MSVPdir_;
+	double		MSVPtoldir_;
+	double		MSVPincr_;
+	double		MSVPnlag_;
+
+	virtual string decName() const { return ""; }
+};
+
+//! An abstract class for measures of spatial variability 
+class STAT_DLL TeMSV		
+{
+public:
+	TeMSV (){};
+	virtual ~TeMSV () {}
+
+	virtual TeMatrix	calculate ()=0;
+	static TeMSV* DefaultObject(TeMSVParams){ return 0; }		
+	void setMatrix(TeMatrix* m) {MSVmatrix_ = m;}
+
+protected:
+	TeMatrix*	MSVmatrix_;
+	double		MSVdir_;
+	double		MSVtoldir_;
+	double		MSVincr_;
+	double		MSVnlag_;		
+};
+
+
+//! A class that represents a semivariogram
+class STAT_DLL TeSemivariogram : public TeMSV
+{
+public:
+	TeSemivariogram(const TeMSVParams& params){
+		MSVdir_ = params.MSVPdir_;
+		MSVtoldir_ = params.MSVPtoldir_;
+		MSVincr_ = params.MSVPincr_;
+		MSVnlag_ = params.MSVPnlag_;
+	}
+	
+	~TeSemivariogram() { }
+
+	virtual TeMatrix	calculate ();	
+};
+
+
+//! A class that represents a correlogram
+class STAT_DLL TeCorrelogram : public TeMSV
+{
+public:
+		TeCorrelogram(const TeMSVParams& params){
+		MSVdir_ = params.MSVPdir_;
+		MSVtoldir_ = params.MSVPtoldir_;
+		MSVincr_ = params.MSVPincr_;
+		MSVnlag_ = params.MSVPnlag_;
+	}		
+	
+	~TeCorrelogram(){};
+
+	virtual TeMatrix	calculate ();	
+};
+
+//! A class that represents a Semimadogram
+class STAT_DLL TeSemimadogram : public TeMSV
+{
+public:
+		TeSemimadogram(const TeMSVParams& params){
+		MSVdir_ = params.MSVPdir_;
+		MSVtoldir_ = params.MSVPtoldir_;
+		MSVincr_ = params.MSVPincr_;
+		MSVnlag_ = params.MSVPnlag_;
+	}		
+	
+	~TeSemimadogram(){};
+
+	virtual TeMatrix	calculate ();	
+};
+
+//! A class that represents a covariance
+class STAT_DLL TeCovariance : public TeMSV
+{
+public:
+		TeCovariance(const TeMSVParams& params){
+		MSVdir_ = params.MSVPdir_;
+		MSVtoldir_ = params.MSVPtoldir_;
+		MSVincr_ = params.MSVPincr_;
+		MSVnlag_ = params.MSVPnlag_;
+	}		
+	
+	~TeCovariance(){};
+
+	virtual TeMatrix	calculate ();	
+};
+
+
+//! An abstract factory of spatial variability measures
+class STAT_DLL TeMSVFactory : public TeFactory<TeMSV, TeMSVParams>
+{
+public:
+	TeMSVFactory(const string& name) : TeFactory<TeMSV, TeMSVParams>(name){}
+	virtual TeMSV* build(const TeMSVParams&) = 0;
+};
+
+
+//! A concrete factory of semivariograms
+class STAT_DLL TeSemivariogram_Factory : public TeMSVFactory
+{
+public:
+	TeSemivariogram_Factory (const string& name) : TeMSVFactory(name){}
+
+	virtual TeMSV* build(const TeMSVParams& params){return new TeSemivariogram(params);}
+};
+
+
+//! A concrete factory of correlograms
+class STAT_DLL TeCorrelogram_Factory : public TeMSVFactory
+{
+public:
+	TeCorrelogram_Factory (const string& name) : TeMSVFactory (name){}
+
+	virtual TeMSV* build (const TeMSVParams& params){return new TeCorrelogram(params);}
+};
+
+
+//! A concrete factory of semimadograms
+class STAT_DLL TeSemimadogram_Factory : public TeMSVFactory
+{
+public:
+	TeSemimadogram_Factory (const string& name) : TeMSVFactory (name){}
+
+	virtual TeMSV* build (const TeMSVParams& params){return new TeSemimadogram(params);}
+};
+
+
+//! A concrete factory of covariances
+class STAT_DLL TeCovariance_Factory : public TeMSVFactory
+{
+public:
+	TeCovariance_Factory (const string& name) : TeMSVFactory (name){}
+
+	virtual TeMSV* build (const TeMSVParams& params){return new TeCovariance(params);}
+};
+/** @} */ 
+#endif
+
+
diff --git a/src/terralib/stat/TeSemivarModelFactory.cpp b/src/terralib/stat/TeSemivarModelFactory.cpp
old mode 100755
new mode 100644
index 457bdd3..60d9645
--- a/src/terralib/stat/TeSemivarModelFactory.cpp
+++ b/src/terralib/stat/TeSemivarModelFactory.cpp
@@ -1,198 +1,198 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include <TeSemivarModelFactory.h>
-#include <math.h>
-#include <vector>
-using namespace std;
-
-static TeEsfericSemivar_Factory mesf("Esferic");
-static TeExponentialSemivar_Factory mexp("Exponential");
-static TeGaussianSemivar_Factory mgau("Gaussian");
-
-
-TeMatrix
-TeEsfericSemivarModel :: calculate (TeMatrix& g)
-{
-	TeMatrix		mxesf;
-	vector<double>	esf;
-	int				i, nlag;
-	double			c0, c1, a;
-
-	c0=modeloefeitopepita_;
-	c1=modelocontribuicao_;
-	a=modeloalcance_;
-	nlag = g.Nrow();
-	mxesf.Init(nlag+1, 2);
-
-	for (i=0; i<nlag; ++i)
-	{
-		if (g(i,0) == 0)
-			esf.push_back(c0);
-
-		else if (g(i,0) > 0 && g(i,0) < 1000000.0)
-		{
-			esf.push_back( c0 + c1*(1.5*(g(i,0)/a)) - 0.5*(pow(g(i,0)/a,3) ));
-			if (esf[i] > c0+c1)
-				esf[i]=c0+c1;
-		}
-
-		else 
-            esf.push_back(c0+c1);
-    
-		// Escreve Saida
-		mxesf(i+1,0) = g(i,0); // h
-        mxesf(i+1,1) = esf[i]; // gama(h)
-    }
-
-	// quando h=0 => gama(h)=c0
-	mxesf(0,1)=c0;
-
-	// acrescentar o �ltimo valor
-	mxesf(nlag,0)= mxesf(nlag-1,0) + (mxesf(nlag-1,0) - mxesf(nlag-2,0));
-    mxesf(nlag,1)= mxesf(nlag-1,1);
-
-	return mxesf;
-}
-
-TeMatrix
-TeExponentialSemivarModel :: calculate (TeMatrix& g)
-{
-	TeMatrix		mxexp;
-	vector<double>	expo;
-	int				i, nlag;
-	double			c0, c1, a;
-
-	c0=modeloefeitopepita_;
-	c1=modelocontribuicao_;
-	a=modeloalcance_;
-	nlag = g.Nrow();
-	mxexp.Init(nlag+1, 2);
-
-	for (i=0; i<nlag; ++i)
-	{
-		if (g(i,0) == 0)
-			expo.push_back(c0);
-
-		//expo(i) = c0 + c1*( 1 - exp( -(3*g(i,1))/a) );
-		expo.push_back(c0 + c1*( 1 - exp( -(3*g(i,0))/a) ));
-
-		// Escreve Saida
-		mxexp(i+1,0) = g(i,0); // h
-        mxexp(i+1,1) = expo[i]; // gama(h)
-    }
-
-	// quando h=0 => gama(h)=c0
-	mxexp(0,1)=c0;
-
-	// acrescentar o �ltimo valor
-	mxexp(nlag,0)= mxexp(nlag-1,0) + (mxexp(nlag-1,0) - mxexp(nlag-2,0));
-    mxexp(nlag,1)= mxexp(nlag-1,1);
-
-	return mxexp;
-}
-
-TeMatrix
-TeGaussianSemivarModel :: calculate (TeMatrix& g)
-{
-	TeMatrix		mxgau;
-	vector<double>	gau;
-	int				i, nlag;
-	double			c0, c1, a;
-
-	c0=modeloefeitopepita_;
-	c1=modelocontribuicao_;
-	a=modeloalcance_;
-	nlag = g.Nrow();
-	mxgau.Init(nlag+1, 2);
-
-	for (i=0; i<nlag; ++i)
-	{
-		if (g(i,0) == 0)
-			gau.push_back(c0);
-
-	   // gaus(i) = c0 + c1*( 1 - exp(-3*(g(i,1)/a)^2) );
-		gau.push_back( c0 + c1*( 1 - exp(-3*pow(g(i,0)/a,2))) );
-
-		// Escreve Saida
-		mxgau(i+1,0) = g(i,0); // h
-        mxgau(i+1,1) = gau[i]; // gama(h)
-    }
-
-	// quando h=0 => gama(h)=c0
-	mxgau(0,1)=c0;
-
-	// acrescentar o �ltimo valor
-	mxgau(nlag,0)= mxgau(nlag-1,0) + (mxgau(nlag-1,0) - mxgau(nlag-2,0));
-    mxgau(nlag,1)= mxgau(nlag-1,1);
-
-	return mxgau;
-}
-
-
-/*
-for i=1:nlag;
-    if (g(i,1) == 0)
-        sphe(i) = c0;
-        gaus(i) = c0;
-        expo(i) = c0;
-    elseif (g(i,1) > 0 & g(i,1) < a)
-        sphe(i) = c0 + c1*((1.5*(g(i,1)/a) - 0.5*((g(i,1)/a)^3)));
-    else 
-        if (g(i,1) >= a)
-            sphe(i)=c0+c1;
-        end
-    end
-    gaus(i) = c0 + c1*( 1 - exp(-3*(g(i,1)/a)^2) );
-    expo(i) = c0 + c1*( 1 - exp( -(3*g(i,1))/a) );
-    
-    % Escreve Saida
-    m(i+1,1) = g(i,1);% lag distance
-
-    switch (model)
-        case 1
-            m(i+1,2) = sphe(i);
-        case 2
-            m(i+1,2) = expo(i);
-        case 3
-            m(i+1,2) = gaus(i);
-        otherwise      
-            m(i+1,2) = 0;
-    end
-end
-
-%Para o modelo quando h=0 => gamma(h)=c0
-m(1,2)=c0;
-
-%Para o modelo quando h >= a => gamma(h)=c0+c1
-switch (model)
-    case 1 %Para modelo esferico
-    m(nlag+2,2)= c0+c1;
-
-    case 2 %Para modelo exponencial
-    m(nlag+2,2)= m(nlag+1,2);
-    
-    case 3 %Para modelo gaussiano
-    m(nlag+2,2)= m(nlag+1,2);
-end
-*/
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include <TeSemivarModelFactory.h>
+#include <math.h>
+#include <vector>
+using namespace std;
+
+static TeEsfericSemivar_Factory mesf("Esferic");
+static TeExponentialSemivar_Factory mexp("Exponential");
+static TeGaussianSemivar_Factory mgau("Gaussian");
+
+
+TeMatrix
+TeEsfericSemivarModel :: calculate (TeMatrix& g)
+{
+	TeMatrix		mxesf;
+	vector<double>	esf;
+	int				i, nlag;
+	double			c0, c1, a;
+
+	c0=modeloefeitopepita_;
+	c1=modelocontribuicao_;
+	a=modeloalcance_;
+	nlag = g.Nrow();
+	mxesf.Init(nlag+1, 2);
+
+	for (i=0; i<nlag; ++i)
+	{
+		if (g(i,0) == 0)
+			esf.push_back(c0);
+
+		else if (g(i,0) > 0 && g(i,0) < 1000000.0)
+		{
+			esf.push_back( c0 + c1*(1.5*(g(i,0)/a)) - 0.5*(pow(g(i,0)/a,3) ));
+			if (esf[i] > c0+c1)
+				esf[i]=c0+c1;
+		}
+
+		else 
+            esf.push_back(c0+c1);
+    
+		// Escreve Saida
+		mxesf(i+1,0) = g(i,0); // h
+        mxesf(i+1,1) = esf[i]; // gama(h)
+    }
+
+	// quando h=0 => gama(h)=c0
+	mxesf(0,1)=c0;
+
+	// acrescentar o �ltimo valor
+	mxesf(nlag,0)= mxesf(nlag-1,0) + (mxesf(nlag-1,0) - mxesf(nlag-2,0));
+    mxesf(nlag,1)= mxesf(nlag-1,1);
+
+	return mxesf;
+}
+
+TeMatrix
+TeExponentialSemivarModel :: calculate (TeMatrix& g)
+{
+	TeMatrix		mxexp;
+	vector<double>	expo;
+	int				i, nlag;
+	double			c0, c1, a;
+
+	c0=modeloefeitopepita_;
+	c1=modelocontribuicao_;
+	a=modeloalcance_;
+	nlag = g.Nrow();
+	mxexp.Init(nlag+1, 2);
+
+	for (i=0; i<nlag; ++i)
+	{
+		if (g(i,0) == 0)
+			expo.push_back(c0);
+
+		//expo(i) = c0 + c1*( 1 - exp( -(3*g(i,1))/a) );
+		expo.push_back(c0 + c1*( 1 - exp( -(3*g(i,0))/a) ));
+
+		// Escreve Saida
+		mxexp(i+1,0) = g(i,0); // h
+        mxexp(i+1,1) = expo[i]; // gama(h)
+    }
+
+	// quando h=0 => gama(h)=c0
+	mxexp(0,1)=c0;
+
+	// acrescentar o �ltimo valor
+	mxexp(nlag,0)= mxexp(nlag-1,0) + (mxexp(nlag-1,0) - mxexp(nlag-2,0));
+    mxexp(nlag,1)= mxexp(nlag-1,1);
+
+	return mxexp;
+}
+
+TeMatrix
+TeGaussianSemivarModel :: calculate (TeMatrix& g)
+{
+	TeMatrix		mxgau;
+	vector<double>	gau;
+	int				i, nlag;
+	double			c0, c1, a;
+
+	c0=modeloefeitopepita_;
+	c1=modelocontribuicao_;
+	a=modeloalcance_;
+	nlag = g.Nrow();
+	mxgau.Init(nlag+1, 2);
+
+	for (i=0; i<nlag; ++i)
+	{
+		if (g(i,0) == 0)
+			gau.push_back(c0);
+
+	   // gaus(i) = c0 + c1*( 1 - exp(-3*(g(i,1)/a)^2) );
+		gau.push_back( c0 + c1*( 1 - exp(-3*pow(g(i,0)/a,2))) );
+
+		// Escreve Saida
+		mxgau(i+1,0) = g(i,0); // h
+        mxgau(i+1,1) = gau[i]; // gama(h)
+    }
+
+	// quando h=0 => gama(h)=c0
+	mxgau(0,1)=c0;
+
+	// acrescentar o �ltimo valor
+	mxgau(nlag,0)= mxgau(nlag-1,0) + (mxgau(nlag-1,0) - mxgau(nlag-2,0));
+    mxgau(nlag,1)= mxgau(nlag-1,1);
+
+	return mxgau;
+}
+
+
+/*
+for i=1:nlag;
+    if (g(i,1) == 0)
+        sphe(i) = c0;
+        gaus(i) = c0;
+        expo(i) = c0;
+    elseif (g(i,1) > 0 & g(i,1) < a)
+        sphe(i) = c0 + c1*((1.5*(g(i,1)/a) - 0.5*((g(i,1)/a)^3)));
+    else 
+        if (g(i,1) >= a)
+            sphe(i)=c0+c1;
+        end
+    end
+    gaus(i) = c0 + c1*( 1 - exp(-3*(g(i,1)/a)^2) );
+    expo(i) = c0 + c1*( 1 - exp( -(3*g(i,1))/a) );
+    
+    % Escreve Saida
+    m(i+1,1) = g(i,1);% lag distance
+
+    switch (model)
+        case 1
+            m(i+1,2) = sphe(i);
+        case 2
+            m(i+1,2) = expo(i);
+        case 3
+            m(i+1,2) = gaus(i);
+        otherwise      
+            m(i+1,2) = 0;
+    end
+end
+
+%Para o modelo quando h=0 => gamma(h)=c0
+m(1,2)=c0;
+
+%Para o modelo quando h >= a => gamma(h)=c0+c1
+switch (model)
+    case 1 %Para modelo esferico
+    m(nlag+2,2)= c0+c1;
+
+    case 2 %Para modelo exponencial
+    m(nlag+2,2)= m(nlag+1,2);
+    
+    case 3 %Para modelo gaussiano
+    m(nlag+2,2)= m(nlag+1,2);
+end
+*/
diff --git a/src/terralib/stat/TeSemivarModelFactory.h b/src/terralib/stat/TeSemivarModelFactory.h
old mode 100755
new mode 100644
index 19d115c..df86e57
--- a/src/terralib/stat/TeSemivarModelFactory.h
+++ b/src/terralib/stat/TeSemivarModelFactory.h
@@ -1,154 +1,158 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSemivarModelFactory.h
-    \brief This file contains support do deal with factory semivar model
-*/
-
-#ifndef __TERRALIB_INTERNAL_SEMIVARMODEL_H
-#define __TERRALIB_INTERNAL_SEMIVARMODEL_H
-
-#ifdef WIN32 
-#pragma warning ( disable: 4786 ) 
-#endif
-
-#include <TeMatrix.h>
-#include <TeFactory.h>
-
-/** @defgroup Semivar Classes to deal with the adjust of semivariogram models 
- *  @{
-	@ingroup SpatialStatistics
- */
-//! The parameters of a semivariogram model
-struct TeSemivarModelParams
-{
-	double		efeitopepita_;
-	double		contribuicao_;
-	double		alcance_;
-};
-
-
-//! An abstract semivariogram adjust model
-class TeSemivarModel		
-{
-public:
-	TeSemivarModel (){};
-	virtual ~TeSemivarModel (){};
-
-	virtual TeMatrix	calculate (TeMatrix&)=0;
-	static TeSemivarModel* DefaultObject(TeSemivarModelParams){ return 0; }
-
-protected:
-	double		modeloefeitopepita_;
-	double		modelocontribuicao_;
-	double		modeloalcance_;
-};
-
-//! A spherical semivariogram adjust model
-class TeEsfericSemivarModel : public TeSemivarModel
-{
-public:
-		TeEsfericSemivarModel(const TeSemivarModelParams& params){
-		modeloefeitopepita_ = params.efeitopepita_;
-		modelocontribuicao_ = params.contribuicao_;
-		modeloalcance_ = params.alcance_;
-	}		
-	
-	virtual ~TeEsfericSemivarModel(){};
-
-	virtual TeMatrix	calculate (TeMatrix&);	
-};
-
-//! An exponential semivariogram adjust model
-class TeExponentialSemivarModel : public TeSemivarModel
-{
-public:
-		TeExponentialSemivarModel(const TeSemivarModelParams& params){
-		modeloefeitopepita_ = params.efeitopepita_;
-		modelocontribuicao_ = params.contribuicao_;
-		modeloalcance_ = params.alcance_;
-	}		
-	
-	virtual ~TeExponentialSemivarModel(){};
-
-	virtual TeMatrix	calculate (TeMatrix&);	
-};
-
-//! A gaussian semivariogram adjust model
-class TeGaussianSemivarModel : public TeSemivarModel
-{
-public:
-		TeGaussianSemivarModel(const TeSemivarModelParams& params){
-		modeloefeitopepita_ = params.efeitopepita_;
-		modelocontribuicao_ = params.contribuicao_;
-		modeloalcance_ = params.alcance_;
-	}		
-	
-	virtual ~TeGaussianSemivarModel(){};
-
-	virtual TeMatrix	calculate (TeMatrix&);	
-};
-
-//! An abstract factory of a semivariogram adjust model
-class TeSemivarModelFactory : public TeFactory<TeSemivarModel, TeSemivarModelParams>
-{
-public:
-	TeSemivarModelFactory( const string& name) : TeFactory<TeSemivarModel, TeSemivarModelParams>(name){}
-
-	virtual TeSemivarModel* build( const TeSemivarModelParams&) = 0;
-};
-
-
-//! A concrete factory to build a spheric adjust model
-class TeEsfericSemivar_Factory : public TeSemivarModelFactory
-{
-public:
-	TeEsfericSemivar_Factory (const string& name) : TeSemivarModelFactory(name){}
-
-	virtual TeSemivarModel* build(const TeSemivarModelParams& params){return new TeEsfericSemivarModel(params);}
-};
-
-
-//! A concrete factory to build a exponential adjust model
-class TeExponentialSemivar_Factory : public TeSemivarModelFactory
-{
-public:
-	TeExponentialSemivar_Factory (const string& name) : TeSemivarModelFactory(name){}
-
-	virtual TeSemivarModel* build(const TeSemivarModelParams& params){return new TeExponentialSemivarModel(params);}
-};
-
-
-//! A concrete factory to build a gaussian adjust model
-class TeGaussianSemivar_Factory : public TeSemivarModelFactory
-{
-public:
-	TeGaussianSemivar_Factory (const string& name) : TeSemivarModelFactory(name){}
-
-	virtual TeSemivarModel* build(const TeSemivarModelParams& params){return new TeGaussianSemivarModel(params);}
-};
-/** @} */ 
-
-
-#endif
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSemivarModelFactory.h
+    \brief This file contains support do deal with factory semivar model
+*/
+
+#ifndef __TERRALIB_INTERNAL_SEMIVARMODEL_H
+#define __TERRALIB_INTERNAL_SEMIVARMODEL_H
+
+#ifdef WIN32 
+#pragma warning ( disable: 4786 ) 
+#endif
+
+#include <TeMatrix.h>
+#include <TeFactory.h>
+
+#include "TeStatDefines.h"
+
+/** @defgroup Semivar Classes to deal with the adjust of semivariogram models 
+ *  @{
+	@ingroup SpatialStatistics
+ */
+//! The parameters of a semivariogram model
+struct STAT_DLL TeSemivarModelParams
+{
+	double		efeitopepita_;
+	double		contribuicao_;
+	double		alcance_;
+
+	virtual string decName() const { return ""; }
+};
+
+
+//! An abstract semivariogram adjust model
+class STAT_DLL TeSemivarModel		
+{
+public:
+	TeSemivarModel (){};
+	virtual ~TeSemivarModel (){};
+
+	virtual TeMatrix	calculate (TeMatrix&)=0;
+	static TeSemivarModel* DefaultObject(TeSemivarModelParams){ return 0; }
+
+protected:
+	double		modeloefeitopepita_;
+	double		modelocontribuicao_;
+	double		modeloalcance_;
+};
+
+//! A spherical semivariogram adjust model
+class STAT_DLL TeEsfericSemivarModel : public TeSemivarModel
+{
+public:
+		TeEsfericSemivarModel(const TeSemivarModelParams& params){
+		modeloefeitopepita_ = params.efeitopepita_;
+		modelocontribuicao_ = params.contribuicao_;
+		modeloalcance_ = params.alcance_;
+	}		
+	
+	virtual ~TeEsfericSemivarModel(){};
+
+	virtual TeMatrix	calculate (TeMatrix&);	
+};
+
+//! An exponential semivariogram adjust model
+class STAT_DLL TeExponentialSemivarModel : public TeSemivarModel
+{
+public:
+		TeExponentialSemivarModel(const TeSemivarModelParams& params){
+		modeloefeitopepita_ = params.efeitopepita_;
+		modelocontribuicao_ = params.contribuicao_;
+		modeloalcance_ = params.alcance_;
+	}		
+	
+	virtual ~TeExponentialSemivarModel(){};
+
+	virtual TeMatrix	calculate (TeMatrix&);	
+};
+
+//! A gaussian semivariogram adjust model
+class STAT_DLL TeGaussianSemivarModel : public TeSemivarModel
+{
+public:
+		TeGaussianSemivarModel(const TeSemivarModelParams& params){
+		modeloefeitopepita_ = params.efeitopepita_;
+		modelocontribuicao_ = params.contribuicao_;
+		modeloalcance_ = params.alcance_;
+	}		
+	
+	virtual ~TeGaussianSemivarModel(){};
+
+	virtual TeMatrix	calculate (TeMatrix&);	
+};
+
+//! An abstract factory of a semivariogram adjust model
+class STAT_DLL TeSemivarModelFactory : public TeFactory<TeSemivarModel, TeSemivarModelParams>
+{
+public:
+	TeSemivarModelFactory( const string& name) : TeFactory<TeSemivarModel, TeSemivarModelParams>(name){}
+
+	virtual TeSemivarModel* build( const TeSemivarModelParams&) = 0;
+};
+
+
+//! A concrete factory to build a spheric adjust model
+class STAT_DLL TeEsfericSemivar_Factory : public TeSemivarModelFactory
+{
+public:
+	TeEsfericSemivar_Factory (const string& name) : TeSemivarModelFactory(name){}
+
+	virtual TeSemivarModel* build(const TeSemivarModelParams& params){return new TeEsfericSemivarModel(params);}
+};
+
+
+//! A concrete factory to build a exponential adjust model
+class STAT_DLL TeExponentialSemivar_Factory : public TeSemivarModelFactory
+{
+public:
+	TeExponentialSemivar_Factory (const string& name) : TeSemivarModelFactory(name){}
+
+	virtual TeSemivarModel* build(const TeSemivarModelParams& params){return new TeExponentialSemivarModel(params);}
+};
+
+
+//! A concrete factory to build a gaussian adjust model
+class STAT_DLL TeGaussianSemivar_Factory : public TeSemivarModelFactory
+{
+public:
+	TeGaussianSemivar_Factory (const string& name) : TeSemivarModelFactory(name){}
+
+	virtual TeSemivarModel* build(const TeSemivarModelParams& params){return new TeGaussianSemivarModel(params);}
+};
+/** @} */ 
+
+
+#endif
+
+
diff --git a/src/terralib/stat/TeSkaterArvore.cpp b/src/terralib/stat/TeSkaterArvore.cpp
old mode 100755
new mode 100644
index f8fcc7b..b624c6d
--- a/src/terralib/stat/TeSkaterArvore.cpp
+++ b/src/terralib/stat/TeSkaterArvore.cpp
@@ -1,62 +1,62 @@
-//---------------------------------------------------------------------------
-#ifdef WIN32
-#pragma hdrstop
-#endif
-#include <stdlib.h>
-#include "TeSkaterArvore.h"
-#include "heap.h"
-void  TArvore::Monta_Arvore(TSkaterGrafo *Grafo){
-  Heap = new THeap(Grafo->MyGrafo->Size);
-  Prim(Grafo);
-};
-
-/**********************************/
-void  TArvore::Prim(TSkaterGrafo *Grafo) {
-  int Menor;
-  int Viz;
-  double Peso;
-  int* Pai;
-
-	Pai = (int*)malloc(sizeof(int)*(Grafo->MyGrafo->Size));
-	if (Pai == NULL)
-		FatalError("Falta memoria");
-	try
-	{
-		while (!(Heap->Empty()))
-		{
-			Menor = Heap->Extract_Min();
-			Grafo->MyGrafo->Nos[Menor].Mark=0; //Marca que o nodo esta fora da Fila
-			for(Grafo->Adjacente(&Viz,&Peso,Menor);Viz!=-1;Grafo->Adjacente(&Viz,&Peso,Menor))
-			{
-			  if (Grafo->MyGrafo->Nos[Viz].Mark && Peso<(Heap->Key(Viz)))
-			  {
-				 Pai[Viz]=Menor;
-				 Heap->SetKey(Viz,Peso);
-			  };
-			}
-			
-			if(Menor)
-			{ 
-				try
-				{
-					//Testa se nao e a raiz. Raiz nao tem pai nem e filho
-					Grafo->MyGrafo->Nos[Pai[Menor]].ArViz->Insere(Menor,0);
-				}
-				catch(...)
-				{
-					continue;
-				}
-			}
-		}
-	}
-	catch(...)
-	{
-		return;
-	}
-};
-//---------------------------------------------------------------------------
-TArvore::~TArvore(){
- delete Heap;
-};
-
-
+//---------------------------------------------------------------------------
+#ifdef WIN32
+#pragma hdrstop
+#endif
+#include <stdlib.h>
+#include "TeSkaterArvore.h"
+#include "heap.h"
+void  TArvore::Monta_Arvore(TSkaterGrafo *Grafo){
+  Heap = new THeap(Grafo->MyGrafo->Size);
+  Prim(Grafo);
+};
+
+/**********************************/
+void  TArvore::Prim(TSkaterGrafo *Grafo) {
+  int Menor;
+  int Viz;
+  double Peso;
+  int* Pai;
+
+	Pai = (int*)malloc(sizeof(int)*(Grafo->MyGrafo->Size));
+	if (Pai == NULL)
+		FatalError("Falta memoria");
+	try
+	{
+		while (!(Heap->Empty()))
+		{
+			Menor = Heap->Extract_Min();
+			Grafo->MyGrafo->Nos[Menor].Mark=0; //Marca que o nodo esta fora da Fila
+			for(Grafo->Adjacente(&Viz,&Peso,Menor);Viz!=-1;Grafo->Adjacente(&Viz,&Peso,Menor))
+			{
+			  if (Grafo->MyGrafo->Nos[Viz].Mark && Peso<(Heap->Key(Viz)))
+			  {
+				 Pai[Viz]=Menor;
+				 Heap->SetKey(Viz,Peso);
+			  };
+			}
+			
+			if(Menor)
+			{ 
+				try
+				{
+					//Testa se nao e a raiz. Raiz nao tem pai nem e filho
+					Grafo->MyGrafo->Nos[Pai[Menor]].ArViz->Insere(Menor,0);
+				}
+				catch(...)
+				{
+					continue;
+				}
+			}
+		}
+	}
+	catch(...)
+	{
+		return;
+	}
+};
+//---------------------------------------------------------------------------
+TArvore::~TArvore(){
+ delete Heap;
+};
+
+
diff --git a/src/terralib/stat/TeSkaterArvore.h b/src/terralib/stat/TeSkaterArvore.h
old mode 100755
new mode 100644
index 3627998..917c7e8
--- a/src/terralib/stat/TeSkaterArvore.h
+++ b/src/terralib/stat/TeSkaterArvore.h
@@ -1,20 +1,20 @@
-//---------------------------------------------------------------------------
-#ifndef ArvoreH
-#define ArvoreH
-
-#include "TeStatDefines.h"
-#include "TeSkaterGrafo.h"
-#include "heap.h"
-
-class STAT_DLL TArvore{
-  private:
-      THeap *Heap;
-      void  Prim(TSkaterGrafo *);
-  public:
-      ~TArvore();
-      void  Monta_Arvore(TSkaterGrafo *);
-
-};
-
-//---------------------------------------------------------------------------
-#endif
+//---------------------------------------------------------------------------
+#ifndef ArvoreH
+#define ArvoreH
+
+#include "TeStatDefines.h"
+#include "TeSkaterGrafo.h"
+#include "heap.h"
+
+class STAT_DLL TArvore{
+  private:
+      THeap *Heap;
+      void  Prim(TSkaterGrafo *);
+  public:
+      ~TArvore();
+      void  Monta_Arvore(TSkaterGrafo *);
+
+};
+
+//---------------------------------------------------------------------------
+#endif
diff --git a/src/terralib/stat/TeSkaterFunctions.cpp b/src/terralib/stat/TeSkaterFunctions.cpp
old mode 100755
new mode 100644
index 589699e..8e3ab46
--- a/src/terralib/stat/TeSkaterFunctions.cpp
+++ b/src/terralib/stat/TeSkaterFunctions.cpp
@@ -1,343 +1,343 @@
-//---------------------------------------------------------------------------
-#include <stdio.h>
-#ifdef WIN32
-#pragma hdrstop
-#endif
-
-#include "TeSkaterFunctions.h"
-#include <TeDefines.h>
-#include "TeAttribute.h"
-#include "TeUtils.h"
-#include "TeSTElementSet.h"
-
-//---------------------------------------------------------------------------
-TParticao::TParticao(TSkaterGrafo *G){
-  Grafo=G;
-  QuedaDesv = new TFilaDouble;
-  Clusters = new TFilaR;
-  Clusters->Insere(0,TeMAXFLOAT,(long)TeMAXFLOAT);
-  Num_Grupos = 1;
-};
-
-//---------------------------------------------------------------------------
-TParticao::~TParticao(){
-  delete Clusters;
-};
-
-//---------------------------------------------------------------------------
-double*  TParticao::BFS_Media(int Raiz,int Exceto,long *Populacao){
- double *Acc;
- double Peso;// Usado na busca dos filhos
- int Indice; // Usado na busca dos filhos
- int i;
- int n=0;
- int Atual; // No sendo visitado
- TFilaInt *Fila;
-
- Acc = new double[Grafo->MyGrafo->Num_Var];
- for(i=0;i<Grafo->MyGrafo->Num_Var;i++)
-   Acc[i] =0;
- *Populacao = 0;
-
- Fila = new TFilaInt;
- Fila->Insere(Raiz);
-
- while (Fila->Size()){
-   Atual = Fila->Retira();
-
-   /** Calculo da Media **/
-   n++;
-   for(i=0;i<Grafo->MyGrafo->Num_Var;i++)
-    Acc[i] += Grafo->MyGrafo->Nos[Atual].Variaveis[i];
-   *Populacao = *Populacao + Grafo->MyGrafo->Nos[Atual].Populacao;
-
-   /** Insere Filhos na Lista **/
-   Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
-   while(Indice!=-1){
-      if (Indice != Exceto)
-        Fila->Insere(Indice);
-      Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
-   };
- };
- for(i=0;i<Grafo->MyGrafo->Num_Var;i++)
-   Acc[i] /=n;
-
- delete Fila;
- return Acc;
-};
-//---------------------------------------------------------------------------
-
-double  TParticao::BFS_Desvio(int Raiz,int Exceto,double *Media){
- double Acc=0;
- double Peso;// Usado na busca dos filhos
- int Indice; // Usado na busca dos filhos
- int Atual; // No sendo visitado
- TFilaInt *Fila;
-
- Fila = new TFilaInt;
- Fila->Insere(Raiz);
-
- while (Fila->Size()){
-   Atual = Fila->Retira();
-
-   /** Calculo do desvio **/
-   Acc += Dist(Atual,Media);
-
-   /** Insere Filhos na Lista **/
-   Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
-   while(Indice != -1){
-      if (Indice != Exceto)
-        Fila->Insere(Indice);
-      Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
-   };
- };
- return Acc;
-};
-
-//---------------------------------------------------------------------------
-double  TParticao::Dist(int Atual,double *Media){
-  int i;
-  double Acc=0;
-
-  for(i=0;i<Grafo->MyGrafo->Num_Var;i++)
-    Acc += (Grafo->MyGrafo->Nos[Atual].Variaveis[i] - Media[i]) *
-           (Grafo->MyGrafo->Nos[Atual].Variaveis[i] - Media[i]);
-  return Acc;
-};
-
-//---------------------------------------------------------------------------
-
-void  TParticao::BFS_Main(TFilaR::Item_ptr Item){//Raiz,Populacao,Desvio
- //int i=0;
- int Atual; // No sendo visitado
- double Peso;// Usado na busca dos filhos
- int Indice=0; // Usado na busca dos filhos
- double *M1,*M2,D1,D2;
- long Pop1,Pop2;
- double D_Min = TeMAXFLOAT;
- double DMin1;
- double DMin2;
- long Raiz1,PopMin1;
- long Raiz2,PopMin2;
- TFilaInt *Fila;
-
- if (!Item->Desvio) return;
-
- Fila = new TFilaInt;
- Fila->Insere(Item->Raiz);
-
- M1 = new double[Grafo->MyGrafo->Num_Var];
- M2 = new double[Grafo->MyGrafo->Num_Var];
-
- while (Fila->Size()){
-   Atual = Fila->Retira();
-    //i++;
-   /* Insere Filhos na fila */
-     Grafo->MyGrafo->Nos[Atual].ArViz->AdjacenteB(&Indice,&Peso);
-     while (Indice != -1){
-      Fila->Insere(Indice);
-      M1 = BFS_Media(Indice,0,&Pop1);
-      D1 = BFS_Desvio(Indice,0,M1);
-
-      M2 = BFS_Media(Item->Raiz,Indice,&Pop2);
-      D2 = BFS_Desvio(Item->Raiz,Indice,M2);
-      if (((D1+D2) < D_Min) && (Pop1 > PopMin) && (Pop2 > PopMin)) { //encontrou um minimo
-           D_Min = (D1+D2);
-           Raiz1 = Indice;
-           Raiz2 = Atual;
-           PopMin1 = Pop1;
-           PopMin2 = Pop2;
-           DMin1 = D1;
-           DMin2 = D2;
-      };
-      Grafo->MyGrafo->Nos[Atual].ArViz->AdjacenteB(&Indice,&Peso);
-     };
-   };
-   /*Atualizacao dos dados*/
-if (D_Min != TeMAXFLOAT){
-   Item->D1 = DMin1;
-   Item->D2 = DMin2;
-   Item->P1 = PopMin1;
-   Item->P2 = PopMin2;
-   Item->R1 = Raiz1;
-   Item->R2 = Raiz2;
-   Item->Queda = Item->Desvio - DMin1 - DMin2;
- } else
-   Item->Desvio = 0;
-
-   delete Fila;
-   delete M1;
-   delete M2;
-};
-
-//---------------------------------------------------------------------------
-void  TParticao::Particiona(int N_Grp,long Pop){
-  int i;
-  int Raiz;
-  int Sai;
-  double QMax;
-  int R1,R2;
-  double D1,D2;
-  long P1,P2;
-  TFilaR::Item_ptr Item;
-  double Acc;
-
-  PopMin = Pop;
-
-  if (Pop == -1){ // Nao levar em conta populacao
-    while (N_Grp != Num_Grupos){
-      Item = Clusters->mFila->Head;
-      for(i=0;i<Clusters->mFila->Size;i++){
-        if (!Item->Queda) BFS_Main(Item);
-        Item = Item->Proximo;
-      };
-      Item = Clusters->mFila->Head;
-      QMax = 0;
-      for(i=0;i<Clusters->mFila->Size;i++){
-        if (Item->Queda > QMax){
-          QMax = Item->Queda;
-          Raiz = Item->Raiz;
-          R1 = Item->R1;
-          R2 = Item->R2;
-          D1 = Item->D1;
-          D2 = Item->D2;
-          P1 = Item->P1;
-          P2 = Item->P2;
-        };
-        Item = Item->Proximo;
-      };
-     Grafo->MyGrafo->Nos[R2].ArViz->Retira(R1);
-     Num_Grupos++;
-     Clusters->Insere(R1,D1,P1);
-     Clusters->Retira(Raiz);
-     Clusters->Insere(Raiz,D2,P2);
-     Acc = 0;
-     while (Clusters->Proximo() != -1) Acc += Clusters->mFila->Atual->Desvio;
-     QuedaDesv->Insere(Acc);
-    };
-  } else
-    if (N_Grp == 0)
-  {
-    Sai=0;
-    while (!Sai){
-      Item = Clusters->mFila->Head;
-      for(i=0;i<Clusters->mFila->Size;i++){
-        if (!Item->Queda) BFS_Main(Item);
-        Item = Item->Proximo;
-      };
-
-      Item = Clusters->mFila->Head;
-      QMax = 0;
-      Sai = 1;
-      for(i=0;i<Clusters->mFila->Size;i++){
-        if (Item->Desvio) Sai = 0;
-        if (Item->Queda > QMax){
-          QMax = Item->Queda;
-          Raiz = Item->Raiz;
-          R1 = Item->R1;
-          R2 = Item->R2;
-          D1 = Item->D1;
-          D2 = Item->D2;
-          P1 = Item->P1;
-          P2 = Item->P2;
-        };
-        Item = Item->Proximo;
-      };
-     if (!Sai){
-       Grafo->MyGrafo->Nos[R2].ArViz->Retira(R1);
-       Num_Grupos++;
-       Clusters->Insere(R1,D1,P1);
-       Clusters->Retira(Raiz);
-       Clusters->Insere(Raiz,D2,P2);
-       Acc = 0;
-       while (Clusters->Proximo() != -1) Acc += Clusters->mFila->Atual->Desvio;
-       QuedaDesv->Insere(Acc);
-      };
-    };//while
-  } else { // Grupos com populacao restringida
-    Sai=0;
-    while (!Sai){
-      Item = Clusters->mFila->Head;
-      for(i=0;i<Clusters->mFila->Size;i++){
-        if (!Item->Queda) BFS_Main(Item);
-        Item = Item->Proximo;
-      };
-
-      Item = Clusters->mFila->Head;
-      QMax = 0;
-      Sai = 1;
-      for(i=0;i<Clusters->mFila->Size;i++){
-        if (Item->Desvio) Sai = 0;
-        if (Item->Queda > QMax){
-          QMax = Item->Queda;
-          Raiz = Item->Raiz;
-          R1 = Item->R1;
-          R2 = Item->R2;
-          D1 = Item->D1;
-          D2 = Item->D2;
-          P1 = Item->P1;
-          P2 = Item->P2;
-        };
-        Item = Item->Proximo;
-      };
-     if (!Sai){
-       Grafo->MyGrafo->Nos[R2].ArViz->Retira(R1);
-       Num_Grupos++;
-       Clusters->Insere(R1,D1,P1);
-       Clusters->Retira(Raiz);
-       Clusters->Insere(Raiz,D2,P2);
-       Acc = 0;
-       while (Clusters->Proximo() != -1) Acc += Clusters->mFila->Atual->Desvio;
-       QuedaDesv->Insere(Acc);
-       if (Num_Grupos >= N_Grp) Sai = 1;
-      };
-    };//while
- }//else
-};
-//---------------------------------------------------------------
-
-void  TParticao::BFS_Salva(TeSTElementSet& regSet, string name){
- double Peso;// Usado na busca dos filhos
- int Indice; // Usado na busca dos filhos
- int Atual; // No sendo visitado
- int i=1;
- TFilaInt *Fila;
- int Raiz;
-
- TeAttributeRep rep;
- rep.name_ = name;
- rep.type_ = TeINT;
- regSet.addProperty(rep, "");
- int index = regSet.getAttributeIndex(name); //get the index of the inserted attribute
-
- Raiz=Clusters->Proximo();
- while (Raiz != -1){
-
-   string value = Te2String(i);
-
-   Fila = new TFilaInt;
-   Fila->Insere(Raiz);
-
-   while (Fila->Size()){
-     Atual = Fila->Retira();
-
-     /** Insere Filhos na Lista **/
-     Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
-     while(Indice != -1)
-	 {
-        Fila->Insere(Indice);
-        Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
-     };
-     //set the attribute in the set
-	 TeSTInstance* ins = regSet.getSTInstance(Grafo->MyGrafo->Nos[Atual].Label);
-	 if(ins)
-		ins->setPropertyValue(index, value); 
-   }
-   i++;
-   Raiz=Clusters->Proximo();
-  }
-}
-
-
-
-
+//---------------------------------------------------------------------------
+#include <stdio.h>
+#ifdef WIN32
+#pragma hdrstop
+#endif
+
+#include "TeSkaterFunctions.h"
+#include <TeDefines.h>
+#include "TeAttribute.h"
+#include "TeUtils.h"
+#include "TeSTElementSet.h"
+
+//---------------------------------------------------------------------------
+TParticao::TParticao(TSkaterGrafo *G){
+  Grafo=G;
+  QuedaDesv = new TFilaDouble;
+  Clusters = new TFilaR;
+  Clusters->Insere(0,TeMAXFLOAT,(long)TeMAXFLOAT);
+  Num_Grupos = 1;
+};
+
+//---------------------------------------------------------------------------
+TParticao::~TParticao(){
+  delete Clusters;
+};
+
+//---------------------------------------------------------------------------
+double*  TParticao::BFS_Media(int Raiz,int Exceto,long *Populacao){
+ double *Acc;
+ double Peso;// Usado na busca dos filhos
+ int Indice; // Usado na busca dos filhos
+ int i;
+ int n=0;
+ int Atual; // No sendo visitado
+ TFilaInt *Fila;
+
+ Acc = new double[Grafo->MyGrafo->Num_Var];
+ for(i=0;i<Grafo->MyGrafo->Num_Var;i++)
+   Acc[i] =0;
+ *Populacao = 0;
+
+ Fila = new TFilaInt;
+ Fila->Insere(Raiz);
+
+ while (Fila->Size()){
+   Atual = Fila->Retira();
+
+   /** Calculo da Media **/
+   n++;
+   for(i=0;i<Grafo->MyGrafo->Num_Var;i++)
+    Acc[i] += Grafo->MyGrafo->Nos[Atual].Variaveis[i];
+   *Populacao = *Populacao + Grafo->MyGrafo->Nos[Atual].Populacao;
+
+   /** Insere Filhos na Lista **/
+   Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
+   while(Indice!=-1){
+      if (Indice != Exceto)
+        Fila->Insere(Indice);
+      Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
+   };
+ };
+ for(i=0;i<Grafo->MyGrafo->Num_Var;i++)
+   Acc[i] /=n;
+
+ delete Fila;
+ return Acc;
+};
+//---------------------------------------------------------------------------
+
+double  TParticao::BFS_Desvio(int Raiz,int Exceto,double *Media){
+ double Acc=0;
+ double Peso;// Usado na busca dos filhos
+ int Indice; // Usado na busca dos filhos
+ int Atual; // No sendo visitado
+ TFilaInt *Fila;
+
+ Fila = new TFilaInt;
+ Fila->Insere(Raiz);
+
+ while (Fila->Size()){
+   Atual = Fila->Retira();
+
+   /** Calculo do desvio **/
+   Acc += Dist(Atual,Media);
+
+   /** Insere Filhos na Lista **/
+   Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
+   while(Indice != -1){
+      if (Indice != Exceto)
+        Fila->Insere(Indice);
+      Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
+   };
+ };
+ return Acc;
+};
+
+//---------------------------------------------------------------------------
+double  TParticao::Dist(int Atual,double *Media){
+  int i;
+  double Acc=0;
+
+  for(i=0;i<Grafo->MyGrafo->Num_Var;i++)
+    Acc += (Grafo->MyGrafo->Nos[Atual].Variaveis[i] - Media[i]) *
+           (Grafo->MyGrafo->Nos[Atual].Variaveis[i] - Media[i]);
+  return Acc;
+};
+
+//---------------------------------------------------------------------------
+
+void  TParticao::BFS_Main(TFilaR::Item_ptr Item){//Raiz,Populacao,Desvio
+ //int i=0;
+ int Atual; // No sendo visitado
+ double Peso;// Usado na busca dos filhos
+ int Indice=0; // Usado na busca dos filhos
+ double *M1,*M2,D1,D2;
+ long Pop1,Pop2;
+ double D_Min = TeMAXFLOAT;
+ double DMin1;
+ double DMin2;
+ long Raiz1,PopMin1;
+ long Raiz2,PopMin2;
+ TFilaInt *Fila;
+
+ if (!Item->Desvio) return;
+
+ Fila = new TFilaInt;
+ Fila->Insere(Item->Raiz);
+
+ M1 = new double[Grafo->MyGrafo->Num_Var];
+ M2 = new double[Grafo->MyGrafo->Num_Var];
+
+ while (Fila->Size()){
+   Atual = Fila->Retira();
+    //i++;
+   /* Insere Filhos na fila */
+     Grafo->MyGrafo->Nos[Atual].ArViz->AdjacenteB(&Indice,&Peso);
+     while (Indice != -1){
+      Fila->Insere(Indice);
+      M1 = BFS_Media(Indice,0,&Pop1);
+      D1 = BFS_Desvio(Indice,0,M1);
+
+      M2 = BFS_Media(Item->Raiz,Indice,&Pop2);
+      D2 = BFS_Desvio(Item->Raiz,Indice,M2);
+      if (((D1+D2) < D_Min) && (Pop1 > PopMin) && (Pop2 > PopMin)) { //encontrou um minimo
+           D_Min = (D1+D2);
+           Raiz1 = Indice;
+           Raiz2 = Atual;
+           PopMin1 = Pop1;
+           PopMin2 = Pop2;
+           DMin1 = D1;
+           DMin2 = D2;
+      };
+      Grafo->MyGrafo->Nos[Atual].ArViz->AdjacenteB(&Indice,&Peso);
+     };
+   };
+   /*Atualizacao dos dados*/
+if (D_Min != TeMAXFLOAT){
+   Item->D1 = DMin1;
+   Item->D2 = DMin2;
+   Item->P1 = PopMin1;
+   Item->P2 = PopMin2;
+   Item->R1 = Raiz1;
+   Item->R2 = Raiz2;
+   Item->Queda = Item->Desvio - DMin1 - DMin2;
+ } else
+   Item->Desvio = 0;
+
+   delete Fila;
+   delete M1;
+   delete M2;
+};
+
+//---------------------------------------------------------------------------
+void  TParticao::Particiona(int N_Grp,long Pop){
+  int i;
+  int Raiz;
+  int Sai;
+  double QMax;
+  int R1,R2;
+  double D1,D2;
+  long P1,P2;
+  TFilaR::Item_ptr Item;
+  double Acc;
+
+  PopMin = Pop;
+
+  if (Pop == -1){ // Nao levar em conta populacao
+    while (N_Grp != Num_Grupos){
+      Item = Clusters->mFila->Head;
+      for(i=0;i<Clusters->mFila->Size;i++){
+        if (!Item->Queda) BFS_Main(Item);
+        Item = Item->Proximo;
+      };
+      Item = Clusters->mFila->Head;
+      QMax = 0;
+      for(i=0;i<Clusters->mFila->Size;i++){
+        if (Item->Queda > QMax){
+          QMax = Item->Queda;
+          Raiz = Item->Raiz;
+          R1 = Item->R1;
+          R2 = Item->R2;
+          D1 = Item->D1;
+          D2 = Item->D2;
+          P1 = Item->P1;
+          P2 = Item->P2;
+        };
+        Item = Item->Proximo;
+      };
+     Grafo->MyGrafo->Nos[R2].ArViz->Retira(R1);
+     Num_Grupos++;
+     Clusters->Insere(R1,D1,P1);
+     Clusters->Retira(Raiz);
+     Clusters->Insere(Raiz,D2,P2);
+     Acc = 0;
+     while (Clusters->Proximo() != -1) Acc += Clusters->mFila->Atual->Desvio;
+     QuedaDesv->Insere(Acc);
+    };
+  } else
+    if (N_Grp == 0)
+  {
+    Sai=0;
+    while (!Sai){
+      Item = Clusters->mFila->Head;
+      for(i=0;i<Clusters->mFila->Size;i++){
+        if (!Item->Queda) BFS_Main(Item);
+        Item = Item->Proximo;
+      };
+
+      Item = Clusters->mFila->Head;
+      QMax = 0;
+      Sai = 1;
+      for(i=0;i<Clusters->mFila->Size;i++){
+        if (Item->Desvio) Sai = 0;
+        if (Item->Queda > QMax){
+          QMax = Item->Queda;
+          Raiz = Item->Raiz;
+          R1 = Item->R1;
+          R2 = Item->R2;
+          D1 = Item->D1;
+          D2 = Item->D2;
+          P1 = Item->P1;
+          P2 = Item->P2;
+        };
+        Item = Item->Proximo;
+      };
+     if (!Sai){
+       Grafo->MyGrafo->Nos[R2].ArViz->Retira(R1);
+       Num_Grupos++;
+       Clusters->Insere(R1,D1,P1);
+       Clusters->Retira(Raiz);
+       Clusters->Insere(Raiz,D2,P2);
+       Acc = 0;
+       while (Clusters->Proximo() != -1) Acc += Clusters->mFila->Atual->Desvio;
+       QuedaDesv->Insere(Acc);
+      };
+    };//while
+  } else { // Grupos com populacao restringida
+    Sai=0;
+    while (!Sai){
+      Item = Clusters->mFila->Head;
+      for(i=0;i<Clusters->mFila->Size;i++){
+        if (!Item->Queda) BFS_Main(Item);
+        Item = Item->Proximo;
+      };
+
+      Item = Clusters->mFila->Head;
+      QMax = 0;
+      Sai = 1;
+      for(i=0;i<Clusters->mFila->Size;i++){
+        if (Item->Desvio) Sai = 0;
+        if (Item->Queda > QMax){
+          QMax = Item->Queda;
+          Raiz = Item->Raiz;
+          R1 = Item->R1;
+          R2 = Item->R2;
+          D1 = Item->D1;
+          D2 = Item->D2;
+          P1 = Item->P1;
+          P2 = Item->P2;
+        };
+        Item = Item->Proximo;
+      };
+     if (!Sai){
+       Grafo->MyGrafo->Nos[R2].ArViz->Retira(R1);
+       Num_Grupos++;
+       Clusters->Insere(R1,D1,P1);
+       Clusters->Retira(Raiz);
+       Clusters->Insere(Raiz,D2,P2);
+       Acc = 0;
+       while (Clusters->Proximo() != -1) Acc += Clusters->mFila->Atual->Desvio;
+       QuedaDesv->Insere(Acc);
+       if (Num_Grupos >= N_Grp) Sai = 1;
+      };
+    };//while
+ }//else
+};
+//---------------------------------------------------------------
+
+void  TParticao::BFS_Salva(TeSTElementSet& regSet, string name){
+ double Peso;// Usado na busca dos filhos
+ int Indice; // Usado na busca dos filhos
+ int Atual; // No sendo visitado
+ int i=1;
+ TFilaInt *Fila;
+ int Raiz;
+
+ TeAttributeRep rep;
+ rep.name_ = name;
+ rep.type_ = TeINT;
+ regSet.addProperty(rep, "");
+ int index = regSet.getAttributeIndex(name); //get the index of the inserted attribute
+
+ Raiz=Clusters->Proximo();
+ while (Raiz != -1){
+
+   string value = Te2String(i);
+
+   Fila = new TFilaInt;
+   Fila->Insere(Raiz);
+
+   while (Fila->Size()){
+     Atual = Fila->Retira();
+
+     /** Insere Filhos na Lista **/
+     Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
+     while(Indice != -1)
+	 {
+        Fila->Insere(Indice);
+        Grafo->MyGrafo->Nos[Atual].ArViz->Adjacente(&Indice,&Peso);
+     };
+     //set the attribute in the set
+	 TeSTInstance* ins = regSet.getSTInstance(Grafo->MyGrafo->Nos[Atual].Label);
+	 if(ins)
+		ins->setPropertyValue(index, value); 
+   }
+   i++;
+   Raiz=Clusters->Proximo();
+  }
+}
+
+
+
+
diff --git a/src/terralib/stat/TeSkaterFunctions.h b/src/terralib/stat/TeSkaterFunctions.h
old mode 100755
new mode 100644
index ec39077..33f7ce7
--- a/src/terralib/stat/TeSkaterFunctions.h
+++ b/src/terralib/stat/TeSkaterFunctions.h
@@ -1,113 +1,113 @@
-//---------------------------------------------------------------------------
-#ifndef ParticaoH
-#define ParticaoH
-
-
-
-#define SKATER_SEM_POPULACAO 0
-#define SKATER_COM_POPULACAO 1
-
-
-#define SKATER_POR_GRUPO     0
-#define SKATER_POR_POPULACAO 1
-#define SKATER_POR_AMBOS     2
-
-#include "TeSkaterGrafo.h"
-#include "TeSkaterArvore.h"
-#include "filaR.h"
-#include "filaDouble.h"
-#include "filaInt.h"
-#include <string>
-#include <vector>
-using namespace std;
-
-class TeElementSet;
-
-class STAT_DLL TParticao{
-private:
-  double*  BFS_Media(int,int,long*);
-  double  BFS_Desvio(int,int,double*);
-  double  Dist(int,double*);
-  void  BFS_Main(TFilaR::Item_ptr);//Raiz,Populacao,Desvio
-  TSkaterGrafo *Grafo;
-  long PopMin;
-  int Num_Grupos;
-public:
-  TFilaR *Clusters;
-  TParticao(TSkaterGrafo*);
-  ~TParticao();
-  TFilaDouble *QuedaDesv; 
-  void  Particiona(int,long);
-  void  BFS_Salva(TeSTElementSet& regSet, string name);
-};
-
-/** Funcao de regionalizacao de um conjunto de poligonos
- *  hasPop: se ha atributo de populacao, que devera ser o ultimo
- *  tipo:   tipo de quebra, por grupo, por populacao ou por ambos
- *  nGrupos: numero de grupos de quebra
- *  popMin:  tamanho minimo da populacao
- *  regSet:  conjunto de areas a serem regionalizadas, com seus atributos
- *  hetDrop: heterogeneidade dado cada uma das divisoes
- **/
-template<typename Matrix> bool 
-TeSkaterFunction(bool hasPop, int tipo, int nGrupos, int popMin, TeSTElementSet& regSet, 
-				  Matrix* proxMatrix, string resName, vector<double>& hetDrop); 
-
-
-template<typename Matrix> bool 
-TeSkaterFunction(bool hasPop, int tipo, int nGrupos, int popMin, TeSTElementSet& regSet, 
-				 Matrix* proxMatrix, string name, vector<double>& hetDrop) 
-{
-  
-	TParticao *Particao = 0;
-	try
-	{
-		//Monta grafo a partir do conjunto 
-	  TSkaterGrafo g(hasPop);
-	  if (!g.MontaGrafo(regSet, proxMatrix)) {
-		return false;
-	  }
-
-	  TArvore* a = new TArvore();
-	  a->Monta_Arvore(&g);
-	  delete a;
-
-  
-	  Particao = new TParticao(&g);
-	  switch (tipo) {
-	  case SKATER_POR_GRUPO:
-		 Particao->Particiona(nGrupos,-1);
-		 break;
-	  case SKATER_POR_POPULACAO:
-		 Particao->Particiona(0,popMin);
-		 break;
-	  case SKATER_POR_AMBOS:
-		 Particao->Particiona(nGrupos,popMin);
-		 break;
-	  }
-
-	  Particao->BFS_Salva(regSet, name);
-
-	  //Copia as quedas a partir do numero de grupos para hetDrop,
-	  //comecando do menor
-	  hetDrop.clear();
-	  int size = Particao->QuedaDesv->Size();
-	  for (int gr = 0; gr < size; gr++) {
-		double het = Particao->QuedaDesv->Retira();
-		hetDrop.push_back(het);
-	  }
-	  delete Particao;
-	}
-	catch(...)
-	{
-		if(Particao)
-			delete Particao;
-
-		return false;
-	}
-
-  return true;
-}
-
-//---------------------------------------------------------------------------
-#endif
+//---------------------------------------------------------------------------
+#ifndef ParticaoH
+#define ParticaoH
+
+
+
+#define SKATER_SEM_POPULACAO 0
+#define SKATER_COM_POPULACAO 1
+
+
+#define SKATER_POR_GRUPO     0
+#define SKATER_POR_POPULACAO 1
+#define SKATER_POR_AMBOS     2
+
+#include "TeSkaterGrafo.h"
+#include "TeSkaterArvore.h"
+#include "filaR.h"
+#include "filaDouble.h"
+#include "filaInt.h"
+#include <string>
+#include <vector>
+using namespace std;
+
+class TeElementSet;
+
+class STAT_DLL TParticao{
+private:
+  double*  BFS_Media(int,int,long*);
+  double  BFS_Desvio(int,int,double*);
+  double  Dist(int,double*);
+  void  BFS_Main(TFilaR::Item_ptr);//Raiz,Populacao,Desvio
+  TSkaterGrafo *Grafo;
+  long PopMin;
+  int Num_Grupos;
+public:
+  TFilaR *Clusters;
+  TParticao(TSkaterGrafo*);
+  ~TParticao();
+  TFilaDouble *QuedaDesv; 
+  void  Particiona(int,long);
+  void  BFS_Salva(TeSTElementSet& regSet, string name);
+};
+
+/** Funcao de regionalizacao de um conjunto de poligonos
+ *  hasPop: se ha atributo de populacao, que devera ser o ultimo
+ *  tipo:   tipo de quebra, por grupo, por populacao ou por ambos
+ *  nGrupos: numero de grupos de quebra
+ *  popMin:  tamanho minimo da populacao
+ *  regSet:  conjunto de areas a serem regionalizadas, com seus atributos
+ *  hetDrop: heterogeneidade dado cada uma das divisoes
+ **/
+template<typename Matrix> bool 
+TeSkaterFunction(bool hasPop, int tipo, int nGrupos, int popMin, TeSTElementSet& regSet, 
+				  Matrix* proxMatrix, string resName, vector<double>& hetDrop); 
+
+
+template<typename Matrix> bool 
+TeSkaterFunction(bool hasPop, int tipo, int nGrupos, int popMin, TeSTElementSet& regSet, 
+				 Matrix* proxMatrix, string name, vector<double>& hetDrop) 
+{
+  
+	TParticao *Particao = 0;
+	try
+	{
+		//Monta grafo a partir do conjunto 
+	  TSkaterGrafo g(hasPop);
+	  if (!g.MontaGrafo(regSet, proxMatrix)) {
+		return false;
+	  }
+
+	  TArvore* a = new TArvore();
+	  a->Monta_Arvore(&g);
+	  delete a;
+
+  
+	  Particao = new TParticao(&g);
+	  switch (tipo) {
+	  case SKATER_POR_GRUPO:
+		 Particao->Particiona(nGrupos,-1);
+		 break;
+	  case SKATER_POR_POPULACAO:
+		 Particao->Particiona(0,popMin);
+		 break;
+	  case SKATER_POR_AMBOS:
+		 Particao->Particiona(nGrupos,popMin);
+		 break;
+	  }
+
+	  Particao->BFS_Salva(regSet, name);
+
+	  //Copia as quedas a partir do numero de grupos para hetDrop,
+	  //comecando do menor
+	  hetDrop.clear();
+	  int size = Particao->QuedaDesv->Size();
+	  for (int gr = 0; gr < size; gr++) {
+		double het = Particao->QuedaDesv->Retira();
+		hetDrop.push_back(het);
+	  }
+	  delete Particao;
+	}
+	catch(...)
+	{
+		if(Particao)
+			delete Particao;
+
+		return false;
+	}
+
+  return true;
+}
+
+//---------------------------------------------------------------------------
+#endif
diff --git a/src/terralib/stat/TeSkaterGrafo.cpp b/src/terralib/stat/TeSkaterGrafo.cpp
old mode 100755
new mode 100644
index c20ab91..84b5785
--- a/src/terralib/stat/TeSkaterGrafo.cpp
+++ b/src/terralib/stat/TeSkaterGrafo.cpp
@@ -1,77 +1,77 @@
-//---------------------------------------------------------------------------
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#ifdef WIN32
-#pragma hdrstop
-#endif
-
-#include "TeSkaterGrafo.h"
-
-
-TSkaterGrafo::TSkaterGrafo(bool hasPop){
-
-   MyGrafo= new MyGrafo_t;
-   MyGrafo->Nos = (Grafo_ptr) malloc(sizeof(Grafo_t));
-   MyGrafo->Size = 0;
-   Tem_Pop = (hasPop) ? 1 : 0;
-};
-
-
-/*************************/
-int TSkaterGrafo::GetSize(){
-
-  return MyGrafo->Size; //Retorna o tamanho do grafo
-};
-
-
-/*************************/
-double TSkaterGrafo::Distancia(int L_indice, int V_indice){
-
-   int i;
-   double Acc=0;
-
-   for(i=0;i < MyGrafo->Num_Var;i++)
-      Acc += (MyGrafo->Nos[L_indice].Variaveis[i] - MyGrafo->Nos[V_indice].Variaveis[i]) *
-             (MyGrafo->Nos[L_indice].Variaveis[i] - MyGrafo->Nos[V_indice].Variaveis[i]);
-   return sqrt(Acc);
-};
-
-//-------------------------------------
-void  TSkaterGrafo::Escalona(double *X, double *Y){
-  *X = Cx *(*X + Gamax);
-  *Y = Cy *(*Y + Gamay);
-};
-
-/***************************/
-//Retorna o Indice e o peso do proximo Vizinho -1 se nao houver mais vizinhos
-void  TSkaterGrafo::Adjacente(int *Indice,double *Peso,int i){
-   MyGrafo->Nos[i].Vizinhos->Adjacente(Indice,Peso);
-};
-
-void  TSkaterGrafo::Adjacente1(int *Indice,double *Peso,int i){
-   MyGrafo->Nos[i].ArViz->Adjacente(Indice,Peso);
-};
-
-//--------------------------------------------------------
-void  TSkaterGrafo::Escala(int Altura,int Largura){
-
-  Cx = (Largura - 2*(RAIO))/(X_max-X_min);
-  Gamax = -RAIO/Cx - X_min;
-
-  Cy = (Altura - 2*(RAIO))/(Y_max-Y_min);
-  Gamay = -RAIO/Cy - Y_min;
-};
-//--------------------------------------------------------
-double  TSkaterGrafo::Get_X(int Indice){
-   return MyGrafo->Nos[Indice].X;
-};
-
-//--------------------------------------------------------
-double  TSkaterGrafo::Get_Y(int Indice){
-   return MyGrafo->Nos[Indice].Y;
-};
-//---------------------------------------------
-int  TSkaterGrafo::GetNum_Var(){
-  return MyGrafo->Num_Var;
-};
+//---------------------------------------------------------------------------
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#ifdef WIN32
+#pragma hdrstop
+#endif
+
+#include "TeSkaterGrafo.h"
+
+
+TSkaterGrafo::TSkaterGrafo(bool hasPop){
+
+   MyGrafo= new MyGrafo_t;
+   MyGrafo->Nos = (Grafo_ptr) malloc(sizeof(Grafo_t));
+   MyGrafo->Size = 0;
+   Tem_Pop = (hasPop) ? 1 : 0;
+};
+
+
+/*************************/
+int TSkaterGrafo::GetSize(){
+
+  return MyGrafo->Size; //Retorna o tamanho do grafo
+};
+
+
+/*************************/
+double TSkaterGrafo::Distancia(int L_indice, int V_indice){
+
+   int i;
+   double Acc=0;
+
+   for(i=0;i < MyGrafo->Num_Var;i++)
+      Acc += (MyGrafo->Nos[L_indice].Variaveis[i] - MyGrafo->Nos[V_indice].Variaveis[i]) *
+             (MyGrafo->Nos[L_indice].Variaveis[i] - MyGrafo->Nos[V_indice].Variaveis[i]);
+   return sqrt(Acc);
+};
+
+//-------------------------------------
+void  TSkaterGrafo::Escalona(double *X, double *Y){
+  *X = Cx *(*X + Gamax);
+  *Y = Cy *(*Y + Gamay);
+};
+
+/***************************/
+//Retorna o Indice e o peso do proximo Vizinho -1 se nao houver mais vizinhos
+void  TSkaterGrafo::Adjacente(int *Indice,double *Peso,int i){
+   MyGrafo->Nos[i].Vizinhos->Adjacente(Indice,Peso);
+};
+
+void  TSkaterGrafo::Adjacente1(int *Indice,double *Peso,int i){
+   MyGrafo->Nos[i].ArViz->Adjacente(Indice,Peso);
+};
+
+//--------------------------------------------------------
+void  TSkaterGrafo::Escala(int Altura,int Largura){
+
+  Cx = (Largura - 2*(RAIO))/(X_max-X_min);
+  Gamax = -RAIO/Cx - X_min;
+
+  Cy = (Altura - 2*(RAIO))/(Y_max-Y_min);
+  Gamay = -RAIO/Cy - Y_min;
+};
+//--------------------------------------------------------
+double  TSkaterGrafo::Get_X(int Indice){
+   return MyGrafo->Nos[Indice].X;
+};
+
+//--------------------------------------------------------
+double  TSkaterGrafo::Get_Y(int Indice){
+   return MyGrafo->Nos[Indice].Y;
+};
+//---------------------------------------------
+int  TSkaterGrafo::GetNum_Var(){
+  return MyGrafo->Num_Var;
+};
diff --git a/src/terralib/stat/TeSkaterGrafo.h b/src/terralib/stat/TeSkaterGrafo.h
old mode 100755
new mode 100644
index 8d28dfb..ec51a63
--- a/src/terralib/stat/TeSkaterGrafo.h
+++ b/src/terralib/stat/TeSkaterGrafo.h
@@ -1,188 +1,188 @@
-
-//---------------------------------------------------------------------------
-#ifndef GrafoH
-#define GrafoH
-//---------------------------------------------------------------------------
-
-#include "TeSTElementSet.h"
-#include "TeNeighbours.h"
-#include "lista.h"
-
-#define RAIO 4
-
-class STAT_DLL TSkaterGrafo {
-
-public:
-
-    typedef struct No_Grafo
-	{
-      char Label[50];
-      double X;
-      double Y;
-      TListaVizinho *Vizinhos;
-      TListaVizinho *ArViz;
-      double *Variaveis;
-      int Populacao;
-      char Mark;
-    } Grafo_t, *Grafo_ptr;
-
-    typedef struct Grafo
-	{
-       Grafo_ptr Nos;
-       int Num_Var;
-       int Size;
-    }MyGrafo_t,*MyGrafo_ptr;
-
-/**** Funcoes Publicas ****/
- TSkaterGrafo(bool hasPop);
- template<typename Matrix> bool  MontaGrafo(TeSTElementSet& regSet, Matrix* proxMatrix);
- void  Escalona(double *,double *);
- void  Escala(int,int);
- void  Adjacente(int *,double *,int i);
- void  Adjacente1(int *,double *,int i);
- int Size() {return GetSize();}
- double MinX() {return X_min;}
- double MaxX() {return X_max;}
- double MinY() {return Y_min;}
- double MaxY() {return Y_max;}
- double Coord_X(int Indice){return Get_X(Indice);}
- double Coord_Y(int Indice) {return Get_Y(Indice);}
- int Num_Var() {return GetNum_Var();}
-
-
- /***** Area Privada *****/
-private:
-    MyGrafo_ptr MyGrafo;
-	std::map<std::string,unsigned int> Hash_;
-
-	double X_min,X_max;//Usado para conversao de escala
-    double Y_min,Y_max;//Usado para conversao de escala
-    double Cx,Gamax;   //Usados na conversao de escala
-    double Cy,Gamay;   //Usados na conversao de escala
-
-    double  Distancia(int,int);
-    double  Get_X(int Indice);
-    double  Get_Y(int Indice);
-    int GetSize();
-    int  GetNum_Var();
-
-     //Variaveis que sao inicializadas de fora
-    char *NArq;
-    char *NViz;
-    char Tem_Pop;
-
-    friend class TArvore;
-    friend class TParticao;
-    friend class TPrincipal;
-    friend class TEstatistica;
-};
-
-template<typename Matrix> bool  
-TSkaterGrafo::MontaGrafo(TeSTElementSet& regSet, Matrix* proxMatrix)
-{
-
-//  long nAreas = regSet.numElements();
-
-  typename TeSTElementSet::iterator it = regSet.begin(); 
-  int  nCov   = (*it).getProperties().size();
-
-
-  //Monta lista de areas
-
-  TeCoord2D centroid;
-  (*it).centroid(centroid);
-  X_min=X_max=centroid.x();
-  Y_min=Y_max=centroid.y();
-  //Obtem o numero de variaveis --> se tem populacao e menos um
-  if (this->Tem_Pop)
-          MyGrafo->Num_Var = nCov-1; //Obtem o numero de variaveis
-  else
-          MyGrafo->Num_Var = nCov;
-
-  string val;
-  int i;
-
-  //Monta areas
-  while (it != regSet.end()) 
-  {
-		(*it).centroid(centroid);    
-		MyGrafo->Nos = 
-		  (Grafo_ptr) realloc(MyGrafo->Nos,sizeof(Grafo_t)*((MyGrafo->Size)+1));
-		sprintf(MyGrafo->Nos[MyGrafo->Size].Label,"%s",(*it).objectId().c_str());
-		MyGrafo->Nos[MyGrafo->Size].Vizinhos = NULL;
-		MyGrafo->Nos[MyGrafo->Size].ArViz = NULL;
-
-		Hash_[std::string(MyGrafo->Nos[MyGrafo->Size].Label)] = MyGrafo->Size;
-
-		MyGrafo->Nos[MyGrafo->Size].X = centroid.x();
-		if(centroid.x() < X_min) X_min =centroid.x();// Procura limites da tela
-		else if(centroid.x() > X_max) X_max = centroid.x();
-    
-		MyGrafo->Nos[MyGrafo->Size].Y =centroid.y();
-		if(centroid.y()< Y_min) Y_min = centroid.y(); //Procura limites da tela
-		else if(centroid.y() > Y_max) Y_max = centroid.y();
-    
-		MyGrafo->Nos[MyGrafo->Size].Variaveis = 
-		  (double *) malloc(sizeof(double)*MyGrafo->Num_Var);
-		for(i=0;i<MyGrafo->Num_Var;i++) {
-		  (*it).getPropertyValue(val, i);
-		  MyGrafo->Nos[MyGrafo->Size].Variaveis[i] = atof(val.c_str()); 
-		}
-		if (Tem_Pop) {
-		  (*it).getPropertyValue(val, MyGrafo->Num_Var);
-		  MyGrafo->Nos[MyGrafo->Size].Populacao = (int)atof(val.c_str());//covs[a*nCov+nCov-1];
-		}
-		else
-		  MyGrafo->Nos[MyGrafo->Size].Populacao = 0;
-    
-		MyGrafo->Nos[MyGrafo->Size].Mark=1;
-		(MyGrafo->Size)++;
-		(++it);
-  }
-
-  int L_indice,V_indice;
-  double dist;
-
-  it = regSet.begin();
-	
-	while ( it != regSet.end())
-	{
-		TeNeighboursMap	neighbors = proxMatrix->getMapNeighbours((*it).objectId());
-
-		//Grafo eh desconexo
-		if (neighbors.size() == 0) 
-		{
-			Hash_.clear();
-		  return false;
-		}
-		
-		std::map<std::string,unsigned int>::iterator ith = Hash_.find((*it).objectId());
-		if (ith != Hash_.end())
-			L_indice = ith->second;
-		else
-			L_indice = 0;
-
-		MyGrafo->Nos[L_indice].Vizinhos = new TListaVizinho;
-		MyGrafo->Nos[L_indice].ArViz = new TListaVizinho;
-
-		typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
-	 			
-		while(itNeigs != neighbors.end())
-		{
-			ith = Hash_.find((*itNeigs).first);
-			if (ith != Hash_.end())
-				V_indice = ith->second;
-			else
-				V_indice = 0;
-		   dist = Distancia(L_indice,V_indice);
-		   MyGrafo->Nos[L_indice].Vizinhos->Insere(V_indice,dist);
-		   (++itNeigs);
-		}
-		(++it);
-	}
-
-  Hash_.clear();
-  return true;
-}
-
-#endif
+
+//---------------------------------------------------------------------------
+#ifndef GrafoH
+#define GrafoH
+//---------------------------------------------------------------------------
+
+#include "TeSTElementSet.h"
+#include "TeNeighbours.h"
+#include "lista.h"
+
+#define RAIO 4
+
+class STAT_DLL TSkaterGrafo {
+
+public:
+
+    typedef struct No_Grafo
+	{
+      char Label[50];
+      double X;
+      double Y;
+      TListaVizinho *Vizinhos;
+      TListaVizinho *ArViz;
+      double *Variaveis;
+      int Populacao;
+      char Mark;
+    } Grafo_t, *Grafo_ptr;
+
+    typedef struct Grafo
+	{
+       Grafo_ptr Nos;
+       int Num_Var;
+       int Size;
+    }MyGrafo_t,*MyGrafo_ptr;
+
+/**** Funcoes Publicas ****/
+ TSkaterGrafo(bool hasPop);
+ template<typename Matrix> bool  MontaGrafo(TeSTElementSet& regSet, Matrix* proxMatrix);
+ void  Escalona(double *,double *);
+ void  Escala(int,int);
+ void  Adjacente(int *,double *,int i);
+ void  Adjacente1(int *,double *,int i);
+ int Size() {return GetSize();}
+ double MinX() {return X_min;}
+ double MaxX() {return X_max;}
+ double MinY() {return Y_min;}
+ double MaxY() {return Y_max;}
+ double Coord_X(int Indice){return Get_X(Indice);}
+ double Coord_Y(int Indice) {return Get_Y(Indice);}
+ int Num_Var() {return GetNum_Var();}
+
+
+ /***** Area Privada *****/
+private:
+    MyGrafo_ptr MyGrafo;
+	std::map<std::string,unsigned int> Hash_;
+
+	double X_min,X_max;//Usado para conversao de escala
+    double Y_min,Y_max;//Usado para conversao de escala
+    double Cx,Gamax;   //Usados na conversao de escala
+    double Cy,Gamay;   //Usados na conversao de escala
+
+    double  Distancia(int,int);
+    double  Get_X(int Indice);
+    double  Get_Y(int Indice);
+    int GetSize();
+    int  GetNum_Var();
+
+     //Variaveis que sao inicializadas de fora
+    char *NArq;
+    char *NViz;
+    char Tem_Pop;
+
+    friend class TArvore;
+    friend class TParticao;
+    friend class TPrincipal;
+    friend class TEstatistica;
+};
+
+template<typename Matrix> bool  
+TSkaterGrafo::MontaGrafo(TeSTElementSet& regSet, Matrix* proxMatrix)
+{
+
+//  long nAreas = regSet.numElements();
+
+  typename TeSTElementSet::iterator it = regSet.begin(); 
+  int  nCov   = (*it).getProperties().size();
+
+
+  //Monta lista de areas
+
+  TeCoord2D centroid;
+  (*it).centroid(centroid);
+  X_min=X_max=centroid.x();
+  Y_min=Y_max=centroid.y();
+  //Obtem o numero de variaveis --> se tem populacao e menos um
+  if (this->Tem_Pop)
+          MyGrafo->Num_Var = nCov-1; //Obtem o numero de variaveis
+  else
+          MyGrafo->Num_Var = nCov;
+
+  string val;
+  int i;
+
+  //Monta areas
+  while (it != regSet.end()) 
+  {
+		(*it).centroid(centroid);    
+		MyGrafo->Nos = 
+		  (Grafo_ptr) realloc(MyGrafo->Nos,sizeof(Grafo_t)*((MyGrafo->Size)+1));
+		sprintf(MyGrafo->Nos[MyGrafo->Size].Label,"%s",(*it).objectId().c_str());
+		MyGrafo->Nos[MyGrafo->Size].Vizinhos = NULL;
+		MyGrafo->Nos[MyGrafo->Size].ArViz = NULL;
+
+		Hash_[std::string(MyGrafo->Nos[MyGrafo->Size].Label)] = MyGrafo->Size;
+
+		MyGrafo->Nos[MyGrafo->Size].X = centroid.x();
+		if(centroid.x() < X_min) X_min =centroid.x();// Procura limites da tela
+		else if(centroid.x() > X_max) X_max = centroid.x();
+    
+		MyGrafo->Nos[MyGrafo->Size].Y =centroid.y();
+		if(centroid.y()< Y_min) Y_min = centroid.y(); //Procura limites da tela
+		else if(centroid.y() > Y_max) Y_max = centroid.y();
+    
+		MyGrafo->Nos[MyGrafo->Size].Variaveis = 
+		  (double *) malloc(sizeof(double)*MyGrafo->Num_Var);
+		for(i=0;i<MyGrafo->Num_Var;i++) {
+		  (*it).getPropertyValue(val, i);
+		  MyGrafo->Nos[MyGrafo->Size].Variaveis[i] = atof(val.c_str()); 
+		}
+		if (Tem_Pop) {
+		  (*it).getPropertyValue(val, MyGrafo->Num_Var);
+		  MyGrafo->Nos[MyGrafo->Size].Populacao = (int)atof(val.c_str());//covs[a*nCov+nCov-1];
+		}
+		else
+		  MyGrafo->Nos[MyGrafo->Size].Populacao = 0;
+    
+		MyGrafo->Nos[MyGrafo->Size].Mark=1;
+		(MyGrafo->Size)++;
+		(++it);
+  }
+
+  int L_indice,V_indice;
+  double dist;
+
+  it = regSet.begin();
+	
+	while ( it != regSet.end())
+	{
+		TeNeighboursMap	neighbors = proxMatrix->getMapNeighbours((*it).objectId());
+
+		//Grafo eh desconexo
+		if (neighbors.size() == 0) 
+		{
+			Hash_.clear();
+		  return false;
+		}
+		
+		std::map<std::string,unsigned int>::iterator ith = Hash_.find((*it).objectId());
+		if (ith != Hash_.end())
+			L_indice = ith->second;
+		else
+			L_indice = 0;
+
+		MyGrafo->Nos[L_indice].Vizinhos = new TListaVizinho;
+		MyGrafo->Nos[L_indice].ArViz = new TListaVizinho;
+
+		typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
+	 			
+		while(itNeigs != neighbors.end())
+		{
+			ith = Hash_.find((*itNeigs).first);
+			if (ith != Hash_.end())
+				V_indice = ith->second;
+			else
+				V_indice = 0;
+		   dist = Distancia(L_indice,V_indice);
+		   MyGrafo->Nos[L_indice].Vizinhos->Insere(V_indice,dist);
+		   (++itNeigs);
+		}
+		(++it);
+	}
+
+  Hash_.clear();
+  return true;
+}
+
+#endif
diff --git a/src/terralib/stat/TeSpatialStatistics.h b/src/terralib/stat/TeSpatialStatistics.h
old mode 100755
new mode 100644
index 74a6b92..0f2e792
--- a/src/terralib/stat/TeSpatialStatistics.h
+++ b/src/terralib/stat/TeSpatialStatistics.h
@@ -1,796 +1,796 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeSpatialStatistics.h
-    \brief This file provides support for spatial statistics functions
-*/
-#ifndef  __TERRALIB_INTERNAL_SPATIALSTATISTICS_H
-#define  __TERRALIB_INTERNAL_SPATIALSTATISTICS_H
-
-#include <string>
-#include <vector>
-#include <map>
-#include <set>
-using namespace std;
-
-#include "TeStatistics.h"
-#include "TeProgress.h"
-#include "TeSTEvent.h"
-#include "TeNeighbours.h"
- 
-/** @defgroup SpatialStatistics Spatial Statistics Algorithms
- *  TerraLib spatial statistics algorithms.
- *  @{
-*/
-
-/** Calculates the local mean of an attribute of and the number of neighbors for a set of objects
-	\param elemSet		a set of objects  
-	\param proxMatrix	the proximity matrix of this object set  
-	\param indexAttr	the position in the objects vector of properties that contains the requested attribute 
-	\return the function adds two properties to the objects: "Local Mean" and "NumNeighbors" and returns true of false
-*/
-template<typename Set, typename Matrix> 
-bool 
-TeLocalMean (Set* elemSet, Matrix* proxMatrix, int indexAttr=0); 
-
-/** Calculates the standard deviation of an attribute and the local mean of the standard deviation  for a set of objects
-	\param elemSet		a set of objects  
-	\param proxMatrix	the proximity matrix of this object set  
-	\param indexAttr	the position in the objects vector of properties that contains the requested attribute 
-	\return the function adds two properties to the objects: "Z" and "WZ" and returns true of false
-*/
-template<typename Set, typename Matrix>  
-bool 
-TeZAndWZ (Set* elemSet, Matrix* proxMatrix, int indexAttr);
-
-/** @defgroup TeMoranIndex Moran Index Algorithm
- *  @ingroup SpatialStatistics
- *  @{
-*/
-
-/** Calculates the Global Moran index of an attribute  for a set of objects 
-	\param elemSet		a set of objects 
-	\param mean			the global mean for the choosen the atrribute
-	\param var			the variance for the choosen the atrribute
-	\param proxMatrix	the proximity matrix of this object set  
-	\param indexAttr	the position in the objects vector of properties that contains the requested attribute  
-	\return the Global Moran index
-*/
-template<typename Set, typename Matrix> 
-double
-TeMoranIndex2 (Set* elemSet, const double& mean, const double& var, Matrix* proxMatrix, int indexAttr=0); 
-
-/** Calculates the Local and the Global Moran index of an attribute for a set of objects
-	\param elemSet		a set of objects 
-	\param indexZ		the position in the objects vector of properties that contains the deviations (Z)    
-	\param indexWZ		the position in the objects vector of properties that contains the local mean deviations (WZ) 
-	\return the function adds one property to the objects: "MoranIndex" and returns the Global Moran index
-*/
-template<typename Set> 
-double
-TeMoranIndex (Set* elemSet, int indexZ, int indexWZ); 
-
-
-/** Calculates the Global Moran significance of an attribute  for a set of objects  
-	\param elemSet				a set of objects  
-	\param proxMatrix			the proximity matrix of this object set   
-	\param indexAttr			the position in the objects vector of properties that contains the deviations (Z)    
-	\param permutationsNumber	number of the permutations used to calculate the significance
-	\param moranIndex			the Global Moran index 
-	\return the Global Moran significance
-*/
-template<typename Set, typename Matrix> 
-double
-TeGlobalMoranSignificance (Set* elemSet, Matrix* proxMatrix, int indexAttr,
-						   unsigned int permutationsNumber, double moranIndex); 
-
-
-/** Classifies the objects based in the scatterplot of Moran index and its statistical significance
-	\param elemSet		a set of objects 
-	\param indexLISAMap	the position in the objects vector of properties that contains the statistical significances of the moran local indexes (LISA) 
-	\param indexBoxMap	the position in the objects vector of properties that contains the classifications of the statistical significance of the moran local indexes 
-	\return the function adds one property to the objects: "MoranMap"
-*/
-template<typename Set> 
-void
-TeMoranMap (Set* elemSet, int indexLISAMap, int indexBoxMap); 
-
-/** @} */ 
-
-/** Calculates the G and G* statistics of an attribute  for a set of objects 
-	\param elemSet		a set of objects 
-	\param proxMatrix	the proximity matrix of this object set      
-	\param indexAttr	the position in the objects vector of properties that contains the requested attribute  
-	\return the function adds two properties to the objects: "G" and "GStar"
-*/
-template<typename Set, typename Matrix> bool 
-TeGStatistics (Set* elemSet, Matrix* proxMatrix, int indexAttr=0 ); 
-
-
-/** Classifies the objects in quadrants based in the scatterplot of moran index 
-	\param elemSet		a set of objects 
-	\param indexZ		the position in the objects vector of properties that contains the deviations (Z)    
-	\param indexWZ		the position in the objects vector of properties that contains the local mean deviations (WZ) 
-	\param mean			the global mean
-	\return the function adds one property to the objects: "BoxMap"
-*/
-template<typename Set> void
-TeBoxMap (Set* elemSet, int indexZ, int indexWZ, double mean); 
-
-/** Evaluates the statistical significance of the moran local indexes (LISA) 
-	\param elemSet		a set of objects 
-	\param indexZ		the position in the objects vector of properties that contains the deviations (Z)    
-	\param indexLISA	the position in the objects vector of properties that contains the local moran indexes (LISA) 
-	\param indexNeighNum		the position in the objects vector of properties that contains the the numbers of neighbours of an object  
-	\param permutationsNumber	number of the permutations used to evaluate the significance
-	\return the function adds one property to the objects: "LISASig"
-*/
-template<typename Set> bool 
-TeLisaStatisticalSignificance ( Set* elemSet, int indexZ, int indexLISA, int indexNeighNum, int permutationsNumber);  
-
-
-/** Classifies the objects based in the statistical significance of the moran local indexes (LISA) 
-	\param elemSet				a set of objects  
-	\param indexSignifLISA		the position in the objects vector of properties that contains the statistical significances of the local moran indexes (LISA) 
-	\param permutationNumber	number of the permutations used to evaluate the significance
-	\return the function adds one property to the objects: "LISAMap"
-*/
-template<typename Set> void
-TeLisaMap (Set* elemSet, int indexSignifLISA, int /* permutationNumber */); 
-
-/** @defgroup ContBayesEstimation Bayes Estimation from general containers
- *  @ingroup SpatialStatistics
- *  @{
-*/
-/** Calculates the empirical Bayes estimation from a container of values */
-template <typename It> void
-TeEmpiricalBayes (It rBegin, It rEnd, It n, double mean, double variance, It bayes)
-{
-	double w= 0.;
-	while (rBegin != rEnd)
-	{
-		w = variance / ( variance + ( mean/(*n)) );
-		*bayes = w*(*rBegin) + (1-w)*mean;
-		rBegin++; n++; bayes++;
-	}
-}
-
-//* Calculates the Local Bayes estimation from a container of values */
-template <typename It> void
-TeSpatialEmpiricalBayes (It rBegin, It rEnd, It n, It mean, It variance, It bayes)
-{
-	double w = 0.;
-	while (rBegin != rEnd)
-	{
-		w = (*variance)/( (*variance) + ( (*mean)/n ));	
-		*bayes = w*(*rBegin) + (1-w)*(*mean);
-		rBegin++; n++; mean++; variance++; bayes++;
-	}
-}
-  
-/** @} */ 
-/** @} */ 
-
-// --- Template function implementation ---
-template<typename Set, typename Matrix>  bool 
-TeLocalMean (Set* elemSet, Matrix* proxMatrix, int indexAttr)
-{
-	typename Set::iterator itObjs = elemSet->begin();
-	int numberNeighbors;
-
-	if(!proxMatrix->getWeightsParams())
-		return false;
-	bool isNorm = proxMatrix->getWeightsParams()->norm_;
-
-	//adds the attributes in the set
-	TeAttribute att;
-	att.rep_.type_ = TeREAL;
-	att.rep_.decimals_ = 15;
-	att.rep_.name_ = "LocalMean";
-
-	elemSet->addProperty(att);
-	
-	att.rep_.name_  = "NumNeighbors";
-	att.rep_.type_ = TeINT;
-	elemSet->addProperty(att);
-
-	while (itObjs != elemSet->end())
-	{
-		double sum = 0.;
-		double localMean = 0.;
-
-		TeNeighboursMap neighbors = proxMatrix->getMapNeighbours((*itObjs).objectId());
-		typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
-		numberNeighbors = neighbors.size();
-		
-		while(itNeigs != neighbors.end())
-		{
-			//retrieve the neighbor attribute value
-			string valAux;
-			string objIdAux = (*itNeigs).first;
-			if(!elemSet->getAttributeValue(objIdAux, indexAttr, valAux))
-				return false;
-			double val = atof(valAux.c_str());
-						
-			// find the weight associated with the neighbor (attribute of index 0)
-			double weight = (*itNeigs).second.Weight();
-			//verify if the weight is normalized by number of neighbours
-			if(!isNorm)
-				weight = weight/numberNeighbors;
-			sum +=  weight * val;  
-			++itNeigs;
-		}
-
-		localMean = sum;
-		
-		(*itObjs).addPropertyValue(Te2String(localMean,9));
-		(*itObjs).addPropertyValue(Te2String(numberNeighbors)); 
-		
-		++itObjs;
-	}
-
-	return true;
-}
-
-template<typename Set, typename Matrix>  
-bool 
-TeZAndWZ (Set* elemSet, Matrix* proxMatrix, int indexAttr)
-{
-	// calculate the standard deviation Z
-	double mean = TeFirstMoment (elemSet->begin(), elemSet->end(), 0); 
-
-	TeAttribute att;
-	att.rep_.type_ = TeREAL;
-	att.rep_.decimals_ = 15;
-	att.rep_.name_ = "Z";
-	elemSet->addProperty(att);
-
-	typename Set::iterator it = elemSet->begin();
-	while (it != elemSet->end())
-	{
-		double val = (*it)[indexAttr];
-		(*it).addPropertyValue(Te2String((val-mean), 9)); 
-		++it;
-	}
-
-	int indexZ = elemSet->getAttributeList().size()-1;
-
-	// calculate the local mean of Z (WZ)
-	att.rep_.name_ = "WZ";
-	att.rep_.type_ = TeREAL;
-	elemSet->addProperty(att);
-	
-	typename Set::iterator itObjs = elemSet->begin();
-	int numberNeighbors;
-
-	if(!proxMatrix->getWeightsParams())
-		return false;
-	bool isNorm = proxMatrix->getWeightsParams()->norm_;
-
-	while (itObjs != elemSet->end())
-	{
-		double sum = 0.;
-		TeNeighboursMap neighbors = proxMatrix->getMapNeighbours((*itObjs).objectId());
-		typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
-		numberNeighbors = neighbors.size();
-		
-		while(itNeigs != neighbors.end())
-		{
-			//retrieve the neighbor attribute value
-			string valAux;
-			string objIdAux = (*itNeigs).first;
-			if(!elemSet->getAttributeValue(objIdAux, indexZ, valAux))
-				return false;
-			double val = atof(valAux.c_str());
-						
-			// find the weight associated with the neighbor (attribute of index 0)
-			double weight = (*itNeigs).second.Weight();
-			//verify if the weight is normalized by number of neighbours
-			if(!isNorm)
-				weight = weight/numberNeighbors;
-			sum +=  weight * val;  
-			++itNeigs;
-		}
-		(*itObjs).addPropertyValue(Te2String(sum,9));	
-		++itObjs;
-	}
-	return true;
-}
-
-template<typename Set, typename Matrix> double
-TeMoranIndex2 (Set* elemSet, const double& mean, const double& var, Matrix* proxMatrix, int indexAttr)
-{
-	double moran = 0;
-	typename Set::iterator itObjs = elemSet->begin();
-	int numberObjs = elemSet->numSTInstance();
-	if(!proxMatrix->getWeightsParams())
-		return false;
-	bool isNorm = proxMatrix->getWeightsParams()->norm_;
-
-	while ( itObjs != elemSet->end())
-	{
-		double normObjVal = (*itObjs)[indexAttr] - mean;
-		double li = 0.;
-		double weightSum = 0.;
-
-		
-		TeNeighboursMap neighbors = proxMatrix->getMapNeighbours((*itObjs).objectId());
-		typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
-		int numberNeighbors = neighbors.size();
-
-		while(itNeigs != neighbors.end())
-		{
-			//retrieve the neighbor attribute value
-			string valAux; 
-			string objIdAux = (*itNeigs).first;
-			if(!elemSet->getAttributeValue (objIdAux, indexAttr, valAux))
-				return 0.;
-			double val = atof(valAux.c_str());	
-
-			 // normalize the property
-			double normNeighVal =  val - mean;
-
-			// find the weight associated with the neighbor (attribute of index 0)
-			double weight = (*itNeigs).second.Weight();
-			//verify if the weight is normalized by number of neighbours
-			if(!isNorm)
-				weight = weight/numberNeighbors;
-			li +=  weight * ( normNeighVal )  * ( normObjVal );  // se dividir pela vari�ncia � o �ndice local de moran
-			weightSum += weight;
-			++itNeigs;
-		}
-
-		if (weightSum != 0.)
-			li /= weightSum;
-		
-		moran += li;
-
-		++itObjs;
-	}
-
-	if ( numberObjs > 1 )
-		return moran /  ( var * ( numberObjs - 1 ) );
-	else 
-		return moran / var;
-}
-
-template<typename Set> double
-TeMoranIndex (Set* elemSet, int indexZ, int indexWZ)
-{
-	double variance = 0.;
-	double sum = 0;
-	int number = 0;
-
-	variance = TeSecondMoment (elemSet->begin(), elemSet->end(), 0, indexZ);  
-	typename Set::iterator it = elemSet->begin();
-
-	//keep 
-	TeAttribute att;
-	att.rep_.type_ = TeREAL;
-	att.rep_.decimals_ = 15;
-	att.rep_.name_ = "MoranIndex"; 
-	elemSet->addProperty(att); 
-	
-	while (it != elemSet->end())
-	{
-		double z = (*it)[indexZ];
-		double wz = (*it)[indexWZ];
-		double ZxWZ;
-		if(variance==0)
-			ZxWZ = 0.;
-		else
-			ZxWZ = (z*wz)/variance; 
-
-		//keep 
-		(*it).addPropertyValue(Te2String(ZxWZ, 9)); 
-		
-		sum += ZxWZ;
-		number++; 
-		++it; 
-	}
-	
-	return sum /= number;
-}
-
-template<typename Set, typename Matrix> double
-TeGlobalMoranSignificance (Set* elemSet, Matrix* proxMatrix, int indexAttr,
-						   unsigned int permutationsNumber, double moranIndex)
-{
-	
-	vector<double> permutationsResults(permutationsNumber);
-	double significance;
-	
-	unsigned int objectsNumber = elemSet->numSTInstance();
-	
-	//progress bar
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(permutationsNumber);
-		
-	vector<double> deviations(objectsNumber);
-	vector<double>::iterator itDev = deviations.begin();
-	typename Set::iterator itObjs = elemSet->begin();
-	while(itObjs != elemSet->end())
-	{
-		(*itDev) = (*itObjs)[indexAttr]; //attribute value
-		++itObjs;
-		++itDev;
-	}
-
-	TeStatisticValMap stat;
-	if(!TeCalculateStatistics(elemSet->begin(), elemSet->end(), stat, 0))
-		return 0.;
-
-	double mean = stat[TeMEAN];
-	double var = stat[TeVARIANCE];
-
-	srand(time(0));	
-	unsigned int i;
-	for (i = 0; i < permutationsNumber; i++)
-	{
-		Set changedObjects;
-		if(elemSet->getTheme())
-			changedObjects.setTheme(elemSet->getTheme());
-		else if(elemSet->getLayer())
-			changedObjects.setLayer(elemSet->getLayer());
-
-		changedObjects.setAttributeList(elemSet->getAttributeList());
-
-		itObjs = elemSet->begin();
-
-		// chande values 
-		while(itObjs != elemSet->end())
-		{
-			TeSTEvent stoChange;
-			stoChange.objectId((*itObjs).objectId());
-
-			double ranaux = rand();
-			int randon = (int) ((ranaux * (objectsNumber-1))/RAND_MAX);
-			double value = deviations[randon];
-			stoChange.addPropertyValue(Te2String(value,9));
-			changedObjects.insertSTInstance (stoChange);
-			++itObjs;
-		}
-		
-		permutationsResults[i] = TeMoranIndex2 (&changedObjects, mean, var, proxMatrix, 0);
-
-		if(TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return 0.;
-			}
-			else
-				TeProgress::instance()->setProgress(i);
-		}
-	}
-
-	// verify the significance
-	int position = 0;
-	significance = 0;
-	unsigned int k;
-	for (k = 0; k < permutationsNumber; k++)
-	{
-		if (moranIndex < permutationsResults[k]) //>
-			position++;
-	}
-	if ( moranIndex >= 0)
-		significance = (double) (position+1) / (permutationsNumber+1);
-	else
-		significance = (double) (permutationsNumber-position)/(permutationsNumber+1);
-		
-	
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-		
-	return significance;
-}
-
-
-template<typename Set>  void
-TeMoranMap (Set* elemSet, int indexLISAMap, int indexBoxMap)
-{
-	//keep
-	TeAttribute att;
-	att.rep_.decimals_ = 15;
-	att.rep_.type_ = TeREAL;
-	att.rep_.name_ = "MoranMap"; 
-	elemSet->addProperty(att); 
-
-	typename Set::iterator it = elemSet->begin();
-	while ( it != elemSet->end())
-	{
-		double result = 0.0;
-		int lisaMap = (int)((*it)[indexLISAMap]);
-
-		if (lisaMap != 0)
-			result = (*it)[indexBoxMap];
-				
-		//keep
-		(*it).addPropertyValue(Te2String(result, 9)); 
-
-		++it;
-	}
-}
-
-template<typename Set, typename Matrix>  bool 
-TeGStatistics (Set* elemSet, Matrix* proxMatrix, int indexAttr)
-{
-
-	typename Set::iterator itObjs = elemSet->begin();
-	double totalSum = 0.;
-	double excludSum = 0.;
-
-	totalSum = TeSum(itObjs, elemSet->end(), indexAttr);
-	
-	itObjs = elemSet->begin();
-
-	//progress bar
-	int step = 0;
-	int numSteps = elemSet->numSTInstance();
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(numSteps);
-
-	//adds the index attributes in the sET
-	TeAttribute att;
-	att.rep_.name_ = "G"; 
-	att.rep_.type_ = TeREAL;
-	att.rep_.decimals_ = 15;
-	elemSet->addProperty(att); 
-	
-	att.rep_.name_ = "GStar";
-	elemSet->addProperty(att); 
-	
-	while ( itObjs != elemSet->end() )
-	{
-		double valObj = (*itObjs)[indexAttr];
-		excludSum = totalSum - valObj;
-		
-		double G = 0;
-		double GStar = valObj;
-	
-		TeNeighboursMap neighbors = proxMatrix->getMapNeighbours((*itObjs).objectId());
-		typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
-		int neigNumber = neighbors.size();
-
-		if(itNeigs != neighbors.end())
-		{
-			while(itNeigs != neighbors.end())
-			{
-				// retrieve the property value associated to this neighbor 
-				double val;
-				string valAux;
-				string objIdAux = (*itNeigs).first;
-				if(!elemSet->getAttributeValue (objIdAux, indexAttr, valAux))
-					return false;
-				val = atof(valAux.c_str());
-				G +=  val;
-				GStar +=  val;
-				
-				++itNeigs;
-			}
-
-			G /= neigNumber;
-			GStar /= (neigNumber+1);
-				
-			G /= excludSum; 
-			GStar /= totalSum;
-		}
-	
-		//insert the index G in the set
-		(*itObjs).addPropertyValue(Te2String(G, 9)); 
-		//insert the index GStar in the set
-		(*itObjs).addPropertyValue(Te2String(GStar,9)); 
-
-		++itObjs;
-
-		if(TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			else
-				TeProgress::instance()->setProgress(step);
-		}	
-		++step;
-	}
-	
-
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-	return true;
-}
-
-template<typename Set>  void
-TeBoxMap (Set* elemSet, int indexZ, int indexWZ, double mean)
-{	
-	//keep in the set
-	TeAttribute att;
-	att.rep_.name_ = "BoxMap"; 
-	att.rep_.type_ = TeINT;
-	elemSet->addProperty(att);
-
-	typename Set::iterator it_begin = elemSet->begin(); 
-	while ( it_begin != elemSet->end())
-	{
-		int result=0;
-
-		if ( ((*it_begin)[indexZ] >= mean) &&  ((*it_begin)[indexWZ] >= mean))   
-			result = 1;
-		else if ( ((*it_begin)[indexZ] < mean)  &&  ((*it_begin)[indexWZ] >= mean))	
-			result = 4;	
-		else if ( ((*it_begin)[indexZ] < mean)  &&  ((*it_begin)[indexWZ] < mean))
-			result = 2;		
-		else if ( ((*it_begin)[indexZ] >= mean) &&  ((*it_begin)[indexWZ] < mean))
-			result = 3;
-
-		(*it_begin).addPropertyValue(Te2String(result)); 
-
-		++it_begin;
-	}	
-}
-
-template<typename Set>  bool
-TeLisaStatisticalSignificance (Set* elemSet, int indexZ, int indexLISA, 
-									 int indexNeighNum, int permutationsNumber) 
- {
-	double sum;
-	double WZperm;
-	double significance;
-
-	typename Set::iterator it = elemSet->begin();
-
-	double variance = TeSecondMoment (it, elemSet->end(), 0, indexZ);
-
-	int index = 0;
-	it = elemSet->begin();
-	int objectsNumber = elemSet->numSTInstance();
-
-	//progress bar
-	int step = 0;
-	if(TeProgress::instance())
-		TeProgress::instance()->setTotalSteps(objectsNumber);
-
-	vector<double> deviations(objectsNumber);
-	vector<double>::iterator it_dev = deviations.begin();
-	while(it != elemSet->end())
-	{
-		(*it_dev) = (*it)[indexZ];
-		++it;
-		++it_dev;
-	}
-
-	it = elemSet->begin();
-	srand(time(0));
-
-	//keep
-	TeAttribute att;
-	att.rep_.name_ = "LISASig"; 
-	att.rep_.type_ = TeREAL;
-	att.rep_.decimals_ = 15;
-	elemSet->addProperty(att); 
-
-	while ( it != elemSet->end())
-	{
-		int neighborsNumber = (int)((*it)[indexNeighNum]);
-
-		vector<double> permut(permutationsNumber);
-		
-		for (int j = 0; j < permutationsNumber; j++)
-		{
-			int randon = 0;
-			sum = 0;
-			set<int> setNeigh;
-			for (int k = 0; k < neighborsNumber; k++)
-			{
-				double ranaux = rand();
-				randon = (int)((ranaux * (objectsNumber-1))/RAND_MAX);
-				if (index == randon || (setNeigh.find(randon) != setNeigh.end()) )
-					k--;	// raffle annulled	
-				else
-				{		
-					setNeigh.insert(randon);
-					sum += deviations[randon];
-				}
-			}
-
-			if(neighborsNumber==0)
-				WZperm = 0.;
-			else
-				WZperm = sum/neighborsNumber;
-
-			if(variance==0)
-				permut[j] = 0.;
-			else
-				permut[j] = deviations[index] * WZperm / variance;
-		}	
-
-		int position = 0;
-		for (int k = 0; k < permutationsNumber; k++)
-		{
-			if (((*it)[indexLISA]) > permut[k])
-				position++;
-		}
- 		if ( ((*it)[indexLISA]) >= 0)
-			significance = (double) (permutationsNumber-position)/(permutationsNumber+1);
-		else
-			significance = (double) position/( permutationsNumber + 1 );
-			
-		(*it).addPropertyValue(Te2String(significance, 9)); 
-
-		++it;
-		++index;
-
-		if(TeProgress::instance())
-		{
-			if (TeProgress::instance()->wasCancelled())
-			{
-				TeProgress::instance()->reset();
-				return false;
-			}
-			else
-				TeProgress::instance()->setProgress(step);
-		}	
-		++step;
-	}
-
-	if (TeProgress::instance())
-		TeProgress::instance()->reset();
-
-	return true;
-}
-
-
-template<typename Set> void 
-TeLisaMap (Set* elemSet, int indexSignifLISA, int /* permutationNumber */)
-{
-	//keep
-	TeAttribute att;
-	att.rep_.name_ = "LISAMap"; 
-	att.rep_.type_ = TeINT;
-	elemSet->addProperty(att); 
-
-	typename Set::iterator begin = elemSet->begin();
-	while (begin != elemSet->end())
-	{
-		int significanceClass = 0;
-		if ( ( (*begin)[indexSignifLISA] <= 0.001 ))  /*&& (permutationNumber >= 999)*/ 
-			significanceClass = 3;
-		else if ( ((*begin)[indexSignifLISA] <= 0.01) && ((*begin)[indexSignifLISA] > 0.001 )) /*&& (permutationNumber >= 99)*/ 
-			significanceClass = 2;
-		else if ( ((*begin)[indexSignifLISA] <= 0.05) && ((*begin)[indexSignifLISA] > 0.01))
-			significanceClass = 1;
-
-		//keep
-		(*begin).addPropertyValue(Te2String(significanceClass));
-
-		++begin;
-	}
-}
-
-/*! \example proxMatrixAndSpatialStatistics.cpp
-	Shows how to create a proximity matrix from a Spatial Temporal Element Set (STElementSet) and calculate spatial statistics
-   */
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeSpatialStatistics.h
+    \brief This file provides support for spatial statistics functions
+*/
+#ifndef  __TERRALIB_INTERNAL_SPATIALSTATISTICS_H
+#define  __TERRALIB_INTERNAL_SPATIALSTATISTICS_H
+
+#include <string>
+#include <vector>
+#include <map>
+#include <set>
+using namespace std;
+
+#include "TeStatistics.h"
+#include "TeProgress.h"
+#include "TeSTEvent.h"
+#include "TeNeighbours.h"
+ 
+/** @defgroup SpatialStatistics Spatial Statistics Algorithms
+ *  TerraLib spatial statistics algorithms.
+ *  @{
+*/
+
+/** Calculates the local mean of an attribute of and the number of neighbors for a set of objects
+	\param elemSet		a set of objects  
+	\param proxMatrix	the proximity matrix of this object set  
+	\param indexAttr	the position in the objects vector of properties that contains the requested attribute 
+	\return the function adds two properties to the objects: "Local Mean" and "NumNeighbors" and returns true of false
+*/
+template<typename Set, typename Matrix> 
+bool 
+TeLocalMean (Set* elemSet, Matrix* proxMatrix, int indexAttr=0); 
+
+/** Calculates the standard deviation of an attribute and the local mean of the standard deviation  for a set of objects
+	\param elemSet		a set of objects  
+	\param proxMatrix	the proximity matrix of this object set  
+	\param indexAttr	the position in the objects vector of properties that contains the requested attribute 
+	\return the function adds two properties to the objects: "Z" and "WZ" and returns true of false
+*/
+template<typename Set, typename Matrix>  
+bool 
+TeZAndWZ (Set* elemSet, Matrix* proxMatrix, int indexAttr);
+
+/** @defgroup TeMoranIndex Moran Index Algorithm
+ *  @ingroup SpatialStatistics
+ *  @{
+*/
+
+/** Calculates the Global Moran index of an attribute  for a set of objects 
+	\param elemSet		a set of objects 
+	\param mean			the global mean for the choosen the atrribute
+	\param var			the variance for the choosen the atrribute
+	\param proxMatrix	the proximity matrix of this object set  
+	\param indexAttr	the position in the objects vector of properties that contains the requested attribute  
+	\return the Global Moran index
+*/
+template<typename Set, typename Matrix> 
+double
+TeMoranIndex2 (Set* elemSet, const double& mean, const double& var, Matrix* proxMatrix, int indexAttr=0); 
+
+/** Calculates the Local and the Global Moran index of an attribute for a set of objects
+	\param elemSet		a set of objects 
+	\param indexZ		the position in the objects vector of properties that contains the deviations (Z)    
+	\param indexWZ		the position in the objects vector of properties that contains the local mean deviations (WZ) 
+	\return the function adds one property to the objects: "MoranIndex" and returns the Global Moran index
+*/
+template<typename Set> 
+double
+TeMoranIndex (Set* elemSet, int indexZ, int indexWZ); 
+
+
+/** Calculates the Global Moran significance of an attribute  for a set of objects  
+	\param elemSet				a set of objects  
+	\param proxMatrix			the proximity matrix of this object set   
+	\param indexAttr			the position in the objects vector of properties that contains the deviations (Z)    
+	\param permutationsNumber	number of the permutations used to calculate the significance
+	\param moranIndex			the Global Moran index 
+	\return the Global Moran significance
+*/
+template<typename Set, typename Matrix> 
+double
+TeGlobalMoranSignificance (Set* elemSet, Matrix* proxMatrix, int indexAttr,
+						   unsigned int permutationsNumber, double moranIndex); 
+
+
+/** Classifies the objects based in the scatterplot of Moran index and its statistical significance
+	\param elemSet		a set of objects 
+	\param indexLISAMap	the position in the objects vector of properties that contains the statistical significances of the moran local indexes (LISA) 
+	\param indexBoxMap	the position in the objects vector of properties that contains the classifications of the statistical significance of the moran local indexes 
+	\return the function adds one property to the objects: "MoranMap"
+*/
+template<typename Set> 
+void
+TeMoranMap (Set* elemSet, int indexLISAMap, int indexBoxMap); 
+
+/** @} */ 
+
+/** Calculates the G and G* statistics of an attribute  for a set of objects 
+	\param elemSet		a set of objects 
+	\param proxMatrix	the proximity matrix of this object set      
+	\param indexAttr	the position in the objects vector of properties that contains the requested attribute  
+	\return the function adds two properties to the objects: "G" and "GStar"
+*/
+template<typename Set, typename Matrix> bool 
+TeGStatistics (Set* elemSet, Matrix* proxMatrix, int indexAttr=0 ); 
+
+
+/** Classifies the objects in quadrants based in the scatterplot of moran index 
+	\param elemSet		a set of objects 
+	\param indexZ		the position in the objects vector of properties that contains the deviations (Z)    
+	\param indexWZ		the position in the objects vector of properties that contains the local mean deviations (WZ) 
+	\param mean			the global mean
+	\return the function adds one property to the objects: "BoxMap"
+*/
+template<typename Set> void
+TeBoxMap (Set* elemSet, int indexZ, int indexWZ, double mean); 
+
+/** Evaluates the statistical significance of the moran local indexes (LISA) 
+	\param elemSet		a set of objects 
+	\param indexZ		the position in the objects vector of properties that contains the deviations (Z)    
+	\param indexLISA	the position in the objects vector of properties that contains the local moran indexes (LISA) 
+	\param indexNeighNum		the position in the objects vector of properties that contains the the numbers of neighbours of an object  
+	\param permutationsNumber	number of the permutations used to evaluate the significance
+	\return the function adds one property to the objects: "LISASig"
+*/
+template<typename Set> bool 
+TeLisaStatisticalSignificance ( Set* elemSet, int indexZ, int indexLISA, int indexNeighNum, int permutationsNumber);  
+
+
+/** Classifies the objects based in the statistical significance of the moran local indexes (LISA) 
+	\param elemSet				a set of objects  
+	\param indexSignifLISA		the position in the objects vector of properties that contains the statistical significances of the local moran indexes (LISA) 
+	\param permutationNumber	number of the permutations used to evaluate the significance
+	\return the function adds one property to the objects: "LISAMap"
+*/
+template<typename Set> void
+TeLisaMap (Set* elemSet, int indexSignifLISA, int /* permutationNumber */); 
+
+/** @defgroup ContBayesEstimation Bayes Estimation from general containers
+ *  @ingroup SpatialStatistics
+ *  @{
+*/
+/** Calculates the empirical Bayes estimation from a container of values */
+template <typename It> void
+TeEmpiricalBayes (It rBegin, It rEnd, It n, double mean, double variance, It bayes)
+{
+	double w= 0.;
+	while (rBegin != rEnd)
+	{
+		w = variance / ( variance + ( mean/(*n)) );
+		*bayes = w*(*rBegin) + (1-w)*mean;
+		rBegin++; n++; bayes++;
+	}
+}
+
+//* Calculates the Local Bayes estimation from a container of values */
+template <typename It> void
+TeSpatialEmpiricalBayes (It rBegin, It rEnd, It n, It mean, It variance, It bayes)
+{
+	double w = 0.;
+	while (rBegin != rEnd)
+	{
+		w = (*variance)/( (*variance) + ( (*mean)/n ));	
+		*bayes = w*(*rBegin) + (1-w)*(*mean);
+		rBegin++; n++; mean++; variance++; bayes++;
+	}
+}
+  
+/** @} */ 
+/** @} */ 
+
+// --- Template function implementation ---
+template<typename Set, typename Matrix>  bool 
+TeLocalMean (Set* elemSet, Matrix* proxMatrix, int indexAttr)
+{
+	typename Set::iterator itObjs = elemSet->begin();
+	int numberNeighbors;
+
+	if(!proxMatrix->getWeightsParams())
+		return false;
+	bool isNorm = proxMatrix->getWeightsParams()->norm_;
+
+	//adds the attributes in the set
+	TeAttribute att;
+	att.rep_.type_ = TeREAL;
+	att.rep_.decimals_ = 15;
+	att.rep_.name_ = "LocalMean";
+
+	elemSet->addProperty(att);
+	
+	att.rep_.name_  = "NumNeighbors";
+	att.rep_.type_ = TeINT;
+	elemSet->addProperty(att);
+
+	while (itObjs != elemSet->end())
+	{
+		double sum = 0.;
+		double localMean = 0.;
+
+		TeNeighboursMap neighbors = proxMatrix->getMapNeighbours((*itObjs).objectId());
+		typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
+		numberNeighbors = neighbors.size();
+		
+		while(itNeigs != neighbors.end())
+		{
+			//retrieve the neighbor attribute value
+			string valAux;
+			string objIdAux = (*itNeigs).first;
+			if(!elemSet->getAttributeValue(objIdAux, indexAttr, valAux))
+				return false;
+			double val = atof(valAux.c_str());
+						
+			// find the weight associated with the neighbor (attribute of index 0)
+			double weight = (*itNeigs).second.Weight();
+			//verify if the weight is normalized by number of neighbours
+			if(!isNorm)
+				weight = weight/numberNeighbors;
+			sum +=  weight * val;  
+			++itNeigs;
+		}
+
+		localMean = sum;
+		
+		(*itObjs).addPropertyValue(Te2String(localMean,9));
+		(*itObjs).addPropertyValue(Te2String(numberNeighbors)); 
+		
+		++itObjs;
+	}
+
+	return true;
+}
+
+template<typename Set, typename Matrix>  
+bool 
+TeZAndWZ (Set* elemSet, Matrix* proxMatrix, int indexAttr)
+{
+	// calculate the standard deviation Z
+	double mean = TeFirstMoment (elemSet->begin(), elemSet->end(), 0); 
+
+	TeAttribute att;
+	att.rep_.type_ = TeREAL;
+	att.rep_.decimals_ = 15;
+	att.rep_.name_ = "Z";
+	elemSet->addProperty(att);
+
+	typename Set::iterator it = elemSet->begin();
+	while (it != elemSet->end())
+	{
+		double val = (*it)[indexAttr];
+		(*it).addPropertyValue(Te2String((val-mean), 9)); 
+		++it;
+	}
+
+	int indexZ = elemSet->getAttributeList().size()-1;
+
+	// calculate the local mean of Z (WZ)
+	att.rep_.name_ = "WZ";
+	att.rep_.type_ = TeREAL;
+	elemSet->addProperty(att);
+	
+	typename Set::iterator itObjs = elemSet->begin();
+	int numberNeighbors;
+
+	if(!proxMatrix->getWeightsParams())
+		return false;
+	bool isNorm = proxMatrix->getWeightsParams()->norm_;
+
+	while (itObjs != elemSet->end())
+	{
+		double sum = 0.;
+		TeNeighboursMap neighbors = proxMatrix->getMapNeighbours((*itObjs).objectId());
+		typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
+		numberNeighbors = neighbors.size();
+		
+		while(itNeigs != neighbors.end())
+		{
+			//retrieve the neighbor attribute value
+			string valAux;
+			string objIdAux = (*itNeigs).first;
+			if(!elemSet->getAttributeValue(objIdAux, indexZ, valAux))
+				return false;
+			double val = atof(valAux.c_str());
+						
+			// find the weight associated with the neighbor (attribute of index 0)
+			double weight = (*itNeigs).second.Weight();
+			//verify if the weight is normalized by number of neighbours
+			if(!isNorm)
+				weight = weight/numberNeighbors;
+			sum +=  weight * val;  
+			++itNeigs;
+		}
+		(*itObjs).addPropertyValue(Te2String(sum,9));	
+		++itObjs;
+	}
+	return true;
+}
+
+template<typename Set, typename Matrix> double
+TeMoranIndex2 (Set* elemSet, const double& mean, const double& var, Matrix* proxMatrix, int indexAttr)
+{
+	double moran = 0;
+	typename Set::iterator itObjs = elemSet->begin();
+	int numberObjs = elemSet->numSTInstance();
+	if(!proxMatrix->getWeightsParams())
+		return false;
+	bool isNorm = proxMatrix->getWeightsParams()->norm_;
+
+	while ( itObjs != elemSet->end())
+	{
+		double normObjVal = (*itObjs)[indexAttr] - mean;
+		double li = 0.;
+		double weightSum = 0.;
+
+		
+		TeNeighboursMap neighbors = proxMatrix->getMapNeighbours((*itObjs).objectId());
+		typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
+		int numberNeighbors = neighbors.size();
+
+		while(itNeigs != neighbors.end())
+		{
+			//retrieve the neighbor attribute value
+			string valAux; 
+			string objIdAux = (*itNeigs).first;
+			if(!elemSet->getAttributeValue (objIdAux, indexAttr, valAux))
+				return 0.;
+			double val = atof(valAux.c_str());	
+
+			 // normalize the property
+			double normNeighVal =  val - mean;
+
+			// find the weight associated with the neighbor (attribute of index 0)
+			double weight = (*itNeigs).second.Weight();
+			//verify if the weight is normalized by number of neighbours
+			if(!isNorm)
+				weight = weight/numberNeighbors;
+			li +=  weight * ( normNeighVal )  * ( normObjVal );  // se dividir pela vari�ncia � o �ndice local de moran
+			weightSum += weight;
+			++itNeigs;
+		}
+
+		if (weightSum != 0.)
+			li /= weightSum;
+		
+		moran += li;
+
+		++itObjs;
+	}
+
+	if ( numberObjs > 1 )
+		return moran /  ( var * ( numberObjs - 1 ) );
+	else 
+		return moran / var;
+}
+
+template<typename Set> double
+TeMoranIndex (Set* elemSet, int indexZ, int indexWZ)
+{
+	double variance = 0.;
+	double sum = 0;
+	int number = 0;
+
+	variance = TeSecondMoment (elemSet->begin(), elemSet->end(), 0, indexZ);  
+	typename Set::iterator it = elemSet->begin();
+
+	//keep 
+	TeAttribute att;
+	att.rep_.type_ = TeREAL;
+	att.rep_.decimals_ = 15;
+	att.rep_.name_ = "MoranIndex"; 
+	elemSet->addProperty(att); 
+	
+	while (it != elemSet->end())
+	{
+		double z = (*it)[indexZ];
+		double wz = (*it)[indexWZ];
+		double ZxWZ;
+		if(variance==0)
+			ZxWZ = 0.;
+		else
+			ZxWZ = (z*wz)/variance; 
+
+		//keep 
+		(*it).addPropertyValue(Te2String(ZxWZ, 9)); 
+		
+		sum += ZxWZ;
+		number++; 
+		++it; 
+	}
+	
+	return sum /= number;
+}
+
+template<typename Set, typename Matrix> double
+TeGlobalMoranSignificance (Set* elemSet, Matrix* proxMatrix, int indexAttr,
+						   unsigned int permutationsNumber, double moranIndex)
+{
+	
+	vector<double> permutationsResults(permutationsNumber);
+	double significance;
+	
+	unsigned int objectsNumber = elemSet->numSTInstance();
+	
+	//progress bar
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(permutationsNumber);
+		
+	vector<double> deviations(objectsNumber);
+	vector<double>::iterator itDev = deviations.begin();
+	typename Set::iterator itObjs = elemSet->begin();
+	while(itObjs != elemSet->end())
+	{
+		(*itDev) = (*itObjs)[indexAttr]; //attribute value
+		++itObjs;
+		++itDev;
+	}
+
+	TeStatisticValMap stat;
+	if(!TeCalculateStatistics(elemSet->begin(), elemSet->end(), stat, 0))
+		return 0.;
+
+	double mean = stat[TeMEAN];
+	double var = stat[TeVARIANCE];
+
+	srand(time(0));	
+	unsigned int i;
+	for (i = 0; i < permutationsNumber; i++)
+	{
+		Set changedObjects;
+		if(elemSet->getTheme())
+			changedObjects.setTheme(elemSet->getTheme());
+		else if(elemSet->getLayer())
+			changedObjects.setLayer(elemSet->getLayer());
+
+		changedObjects.setAttributeList(elemSet->getAttributeList());
+
+		itObjs = elemSet->begin();
+
+		// chande values 
+		while(itObjs != elemSet->end())
+		{
+			TeSTEvent stoChange;
+			stoChange.objectId((*itObjs).objectId());
+
+			double ranaux = rand();
+			int randon = (int) ((ranaux * (objectsNumber-1))/RAND_MAX);
+			double value = deviations[randon];
+			stoChange.addPropertyValue(Te2String(value,9));
+			changedObjects.insertSTInstance (stoChange);
+			++itObjs;
+		}
+		
+		permutationsResults[i] = TeMoranIndex2 (&changedObjects, mean, var, proxMatrix, 0);
+
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return 0.;
+			}
+			else
+				TeProgress::instance()->setProgress(i);
+		}
+	}
+
+	// verify the significance
+	int position = 0;
+	significance = 0;
+	unsigned int k;
+	for (k = 0; k < permutationsNumber; k++)
+	{
+		if (moranIndex < permutationsResults[k]) //>
+			position++;
+	}
+	if ( moranIndex >= 0)
+		significance = (double) (position+1) / (permutationsNumber+1);
+	else
+		significance = (double) (permutationsNumber-position)/(permutationsNumber+1);
+		
+	
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+		
+	return significance;
+}
+
+
+template<typename Set>  void
+TeMoranMap (Set* elemSet, int indexLISAMap, int indexBoxMap)
+{
+	//keep
+	TeAttribute att;
+	att.rep_.decimals_ = 15;
+	att.rep_.type_ = TeREAL;
+	att.rep_.name_ = "MoranMap"; 
+	elemSet->addProperty(att); 
+
+	typename Set::iterator it = elemSet->begin();
+	while ( it != elemSet->end())
+	{
+		double result = 0.0;
+		int lisaMap = (int)((*it)[indexLISAMap]);
+
+		if (lisaMap != 0)
+			result = (*it)[indexBoxMap];
+				
+		//keep
+		(*it).addPropertyValue(Te2String(result, 9)); 
+
+		++it;
+	}
+}
+
+template<typename Set, typename Matrix>  bool 
+TeGStatistics (Set* elemSet, Matrix* proxMatrix, int indexAttr)
+{
+
+	typename Set::iterator itObjs = elemSet->begin();
+	double totalSum = 0.;
+	double excludSum = 0.;
+
+	totalSum = TeSum(itObjs, elemSet->end(), indexAttr);
+	
+	itObjs = elemSet->begin();
+
+	//progress bar
+	int step = 0;
+	int numSteps = elemSet->numSTInstance();
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(numSteps);
+
+	//adds the index attributes in the sET
+	TeAttribute att;
+	att.rep_.name_ = "G"; 
+	att.rep_.type_ = TeREAL;
+	att.rep_.decimals_ = 15;
+	elemSet->addProperty(att); 
+	
+	att.rep_.name_ = "GStar";
+	elemSet->addProperty(att); 
+	
+	while ( itObjs != elemSet->end() )
+	{
+		double valObj = (*itObjs)[indexAttr];
+		excludSum = totalSum - valObj;
+		
+		double G = 0;
+		double GStar = valObj;
+	
+		TeNeighboursMap neighbors = proxMatrix->getMapNeighbours((*itObjs).objectId());
+		typename TeNeighboursMap::iterator itNeigs = neighbors.begin();
+		int neigNumber = neighbors.size();
+
+		if(itNeigs != neighbors.end())
+		{
+			while(itNeigs != neighbors.end())
+			{
+				// retrieve the property value associated to this neighbor 
+				double val;
+				string valAux;
+				string objIdAux = (*itNeigs).first;
+				if(!elemSet->getAttributeValue (objIdAux, indexAttr, valAux))
+					return false;
+				val = atof(valAux.c_str());
+				G +=  val;
+				GStar +=  val;
+				
+				++itNeigs;
+			}
+
+			G /= neigNumber;
+			GStar /= (neigNumber+1);
+				
+			G /= excludSum; 
+			GStar /= totalSum;
+		}
+	
+		//insert the index G in the set
+		(*itObjs).addPropertyValue(Te2String(G, 9)); 
+		//insert the index GStar in the set
+		(*itObjs).addPropertyValue(Te2String(GStar,9)); 
+
+		++itObjs;
+
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}	
+		++step;
+	}
+	
+
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+	return true;
+}
+
+template<typename Set>  void
+TeBoxMap (Set* elemSet, int indexZ, int indexWZ, double mean)
+{	
+	//keep in the set
+	TeAttribute att;
+	att.rep_.name_ = "BoxMap"; 
+	att.rep_.type_ = TeINT;
+	elemSet->addProperty(att);
+
+	typename Set::iterator it_begin = elemSet->begin(); 
+	while ( it_begin != elemSet->end())
+	{
+		int result=0;
+
+		if ( ((*it_begin)[indexZ] >= mean) &&  ((*it_begin)[indexWZ] >= mean))   
+			result = 1;
+		else if ( ((*it_begin)[indexZ] < mean)  &&  ((*it_begin)[indexWZ] >= mean))	
+			result = 4;	
+		else if ( ((*it_begin)[indexZ] < mean)  &&  ((*it_begin)[indexWZ] < mean))
+			result = 2;		
+		else if ( ((*it_begin)[indexZ] >= mean) &&  ((*it_begin)[indexWZ] < mean))
+			result = 3;
+
+		(*it_begin).addPropertyValue(Te2String(result)); 
+
+		++it_begin;
+	}	
+}
+
+template<typename Set>  bool
+TeLisaStatisticalSignificance (Set* elemSet, int indexZ, int indexLISA, 
+									 int indexNeighNum, int permutationsNumber) 
+ {
+	double sum;
+	double WZperm;
+	double significance;
+
+	typename Set::iterator it = elemSet->begin();
+
+	double variance = TeSecondMoment (it, elemSet->end(), 0, indexZ);
+
+	int index = 0;
+	it = elemSet->begin();
+	int objectsNumber = elemSet->numSTInstance();
+
+	//progress bar
+	int step = 0;
+	if(TeProgress::instance())
+		TeProgress::instance()->setTotalSteps(objectsNumber);
+
+	vector<double> deviations(objectsNumber);
+	vector<double>::iterator it_dev = deviations.begin();
+	while(it != elemSet->end())
+	{
+		(*it_dev) = (*it)[indexZ];
+		++it;
+		++it_dev;
+	}
+
+	it = elemSet->begin();
+	srand(time(0));
+
+	//keep
+	TeAttribute att;
+	att.rep_.name_ = "LISASig"; 
+	att.rep_.type_ = TeREAL;
+	att.rep_.decimals_ = 15;
+	elemSet->addProperty(att); 
+
+	while ( it != elemSet->end())
+	{
+		int neighborsNumber = (int)((*it)[indexNeighNum]);
+
+		vector<double> permut(permutationsNumber);
+		
+		for (int j = 0; j < permutationsNumber; j++)
+		{
+			int randon = 0;
+			sum = 0;
+			set<int> setNeigh;
+			for (int k = 0; k < neighborsNumber; k++)
+			{
+				double ranaux = rand();
+				randon = (int)((ranaux * (objectsNumber-1))/RAND_MAX);
+				if (index == randon || (setNeigh.find(randon) != setNeigh.end()) )
+					k--;	// raffle annulled	
+				else
+				{		
+					setNeigh.insert(randon);
+					sum += deviations[randon];
+				}
+			}
+
+			if(neighborsNumber==0)
+				WZperm = 0.;
+			else
+				WZperm = sum/neighborsNumber;
+
+			if(variance==0)
+				permut[j] = 0.;
+			else
+				permut[j] = deviations[index] * WZperm / variance;
+		}	
+
+		int position = 0;
+		for (int k = 0; k < permutationsNumber; k++)
+		{
+			if (((*it)[indexLISA]) > permut[k])
+				position++;
+		}
+ 		if ( ((*it)[indexLISA]) >= 0)
+			significance = (double) (permutationsNumber-position)/(permutationsNumber+1);
+		else
+			significance = (double) position/( permutationsNumber + 1 );
+			
+		(*it).addPropertyValue(Te2String(significance, 9)); 
+
+		++it;
+		++index;
+
+		if(TeProgress::instance())
+		{
+			if (TeProgress::instance()->wasCancelled())
+			{
+				TeProgress::instance()->reset();
+				return false;
+			}
+			else
+				TeProgress::instance()->setProgress(step);
+		}	
+		++step;
+	}
+
+	if (TeProgress::instance())
+		TeProgress::instance()->reset();
+
+	return true;
+}
+
+
+template<typename Set> void 
+TeLisaMap (Set* elemSet, int indexSignifLISA, int /* permutationNumber */)
+{
+	//keep
+	TeAttribute att;
+	att.rep_.name_ = "LISAMap"; 
+	att.rep_.type_ = TeINT;
+	elemSet->addProperty(att); 
+
+	typename Set::iterator begin = elemSet->begin();
+	while (begin != elemSet->end())
+	{
+		int significanceClass = 0;
+		if ( ( (*begin)[indexSignifLISA] <= 0.001 ))  /*&& (permutationNumber >= 999)*/ 
+			significanceClass = 3;
+		else if ( ((*begin)[indexSignifLISA] <= 0.01) && ((*begin)[indexSignifLISA] > 0.001 )) /*&& (permutationNumber >= 99)*/ 
+			significanceClass = 2;
+		else if ( ((*begin)[indexSignifLISA] <= 0.05) && ((*begin)[indexSignifLISA] > 0.01))
+			significanceClass = 1;
+
+		//keep
+		(*begin).addPropertyValue(Te2String(significanceClass));
+
+		++begin;
+	}
+}
+
+/*! \example proxMatrixAndSpatialStatistics.cpp
+	Shows how to create a proximity matrix from a Spatial Temporal Element Set (STElementSet) and calculate spatial statistics
+   */
+#endif
+
diff --git a/src/terralib/stat/TeStatDataStructures.cpp b/src/terralib/stat/TeStatDataStructures.cpp
old mode 100755
new mode 100644
index 4782bd3..49b9b65
--- a/src/terralib/stat/TeStatDataStructures.cpp
+++ b/src/terralib/stat/TeStatDataStructures.cpp
@@ -1,107 +1,107 @@
-/************************************************************************************
-Exploring and analysis of geographical data using TerraLib and TerraView
-Copyright � 2003-2007 INPE and LESTE/UFMG.
-
-Partially funded by CNPq - Project SAUDAVEL, under grant no. 552044/2002-4,
-SENASP-MJ and INPE
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This program is distributed hoping it will be useful, however, WITHOUT ANY 
-WARRANTIES; neither to the implicit warranty of MERCHANTABILITY OR SUITABILITY FOR
-AN SPECIFIC FINALITY. Consult the GNU General Public License for more details.
-
-You must have received a copy of the GNU General Public License with this program.
-In negative case, write to the Free Software Foundation, Inc. in the following
-address: 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
-***********************************************************************************/
-
-
-#include "TeStatDataStructures.h"
-#include "TeSTElementSet.h"
-
-
-TeSTStatInstance::TeSTStatInstance(int nDlbProp) : TeSTInstance() 
-{
-     initDbl(nDlbProp);
-}
-
-        
-TeSTStatInstance::TeSTStatInstance(TeSTInstance& other, int nd, int ad): TeSTInstance(other)
-{
-      initDbl(nd+ad);
-      int n;
-      //Copia propriedades de um como double
-      TeProperty prop;
-      for(n = 0; n < nd; n++) 
-	  {
-        other.getProperty(prop, n);
-        if ((prop.attr_.rep_.type_ != TeREAL) &&
-          (prop.attr_.rep_.type_ != TeINT)) 
-		{
-          dblProperties_[n] = 0.0;
-        }
-        else 
-		{
-          dblProperties_[n] = atof(prop.value_.c_str());
-        }
-      }
-}
-
-    
-TeSTStatInstance::TeSTStatInstance(const TeSTStatInstance& other) : TeSTInstance(other) 
-{
-    dblProperties_.clear();  
-	for(unsigned int n = 0; n < other.dblProperties_.size(); n++) 
-	{
-       dblProperties_.push_back (other.dblProperties_[n]);
-    }
-}
-    
-TeSTStatInstance& 
-TeSTStatInstance::operator=(const TeSTStatInstance& other)
-{
-	if ( this != &other )
-	{
-		this->dblProperties_.clear();
-		for(unsigned int n = 0; n < other.dblProperties_.size(); n++) 
-		{
-			dblProperties_.push_back (other.dblProperties_[n]);
-		}
-	}
-	return *this;
-}
-    
-
-TeSTStatInstanceSet& 
-TeSTStatInstanceSet::operator=(const TeSTStatInstanceSet& other)
-{
-	if ( this != &other )
-	{
-		this->objs_=other.objs_;
-	}
-	return *this;
-}
-
-void
-TeSTStatInstanceSet::Copy(TeSTElementSet& stoSet, int nDbl, int aDbl) 
-{
-      TeSTElementSet::iterator it = stoSet.begin();
-      while (it != stoSet.end()) 
-	  {
-        //Insere elemento no mapa atual e inicializa double
-        TeSTStatInstance st(*it, nDbl, aDbl);
-        objs_.push_back(st);  
-		++it;
-      }
-}
-    
-    
-int TeSTStatInstanceSet::numObjects() 
-{
-      return objs_.size();
-}
-    
+/************************************************************************************
+Exploring and analysis of geographical data using TerraLib and TerraView
+Copyright � 2003-2007 INPE and LESTE/UFMG.
+
+Partially funded by CNPq - Project SAUDAVEL, under grant no. 552044/2002-4,
+SENASP-MJ and INPE
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This program is distributed hoping it will be useful, however, WITHOUT ANY 
+WARRANTIES; neither to the implicit warranty of MERCHANTABILITY OR SUITABILITY FOR
+AN SPECIFIC FINALITY. Consult the GNU General Public License for more details.
+
+You must have received a copy of the GNU General Public License with this program.
+In negative case, write to the Free Software Foundation, Inc. in the following
+address: 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
+***********************************************************************************/
+
+
+#include "TeStatDataStructures.h"
+#include "TeSTElementSet.h"
+
+
+TeSTStatInstance::TeSTStatInstance(int nDlbProp) : TeSTInstance() 
+{
+     initDbl(nDlbProp);
+}
+
+        
+TeSTStatInstance::TeSTStatInstance(TeSTInstance& other, int nd, int ad): TeSTInstance(other)
+{
+      initDbl(nd+ad);
+      int n;
+      //Copia propriedades de um como double
+      TeProperty prop;
+      for(n = 0; n < nd; n++) 
+	  {
+        other.getProperty(prop, n);
+        if ((prop.attr_.rep_.type_ != TeREAL) &&
+          (prop.attr_.rep_.type_ != TeINT)) 
+		{
+          dblProperties_[n] = 0.0;
+        }
+        else 
+		{
+          dblProperties_[n] = atof(prop.value_.c_str());
+        }
+      }
+}
+
+    
+TeSTStatInstance::TeSTStatInstance(const TeSTStatInstance& other) : TeSTInstance(other) 
+{
+    dblProperties_.clear();  
+	for(unsigned int n = 0; n < other.dblProperties_.size(); n++) 
+	{
+       dblProperties_.push_back (other.dblProperties_[n]);
+    }
+}
+    
+TeSTStatInstance& 
+TeSTStatInstance::operator=(const TeSTStatInstance& other)
+{
+	if ( this != &other )
+	{
+		this->dblProperties_.clear();
+		for(unsigned int n = 0; n < other.dblProperties_.size(); n++) 
+		{
+			dblProperties_.push_back (other.dblProperties_[n]);
+		}
+	}
+	return *this;
+}
+    
+
+TeSTStatInstanceSet& 
+TeSTStatInstanceSet::operator=(const TeSTStatInstanceSet& other)
+{
+	if ( this != &other )
+	{
+		this->objs_=other.objs_;
+	}
+	return *this;
+}
+
+void
+TeSTStatInstanceSet::Copy(TeSTElementSet& stoSet, int nDbl, int aDbl) 
+{
+      TeSTElementSet::iterator it = stoSet.begin();
+      while (it != stoSet.end()) 
+	  {
+        //Insere elemento no mapa atual e inicializa double
+        TeSTStatInstance st(*it, nDbl, aDbl);
+        objs_.push_back(st);  
+		++it;
+      }
+}
+    
+    
+int TeSTStatInstanceSet::numObjects() 
+{
+      return objs_.size();
+}
+    
diff --git a/src/terralib/stat/TeStatDataStructures.h b/src/terralib/stat/TeStatDataStructures.h
old mode 100755
new mode 100644
index f1cebd0..a33e86d
--- a/src/terralib/stat/TeStatDataStructures.h
+++ b/src/terralib/stat/TeStatDataStructures.h
@@ -1,472 +1,472 @@
-/************************************************************************************
-Exploring and analysis of geographical data using TerraLib and TerraView
-Copyright � 2003-2007 INPE and LESTE/UFMG.
-
-Partially funded by CNPq - Project SAUDAVEL, under grant no. 552044/2002-4,
-SENASP-MJ and INPE
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This program is distributed hoping it will be useful, however, WITHOUT ANY 
-WARRANTIES; neither to the implicit warranty of MERCHANTABILITY OR SUITABILITY FOR
-AN SPECIFIC FINALITY. Consult the GNU General Public License for more details.
-
-You must have received a copy of the GNU General Public License with this program.
-In negative case, write to the Free Software Foundation, Inc. in the following
-address: 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
-***********************************************************************************/
-/*! \file TeStatDataStructures.h
-    \brief This file deals with special data structures for spatial statistics 
-*/
-#ifndef __TERRALIB_INTERNAL_STATDATASTRUCTURES_H
-#define __TERRALIB_INTERNAL_STATDATASTRUCTURES_H
-
-#include "TeStatDefines.h"
-#include "TeProjection.h"
-#include "TeRaster.h"
-#include "TeAttribute.h"
-#include "TeCoord2D.h"
-#include "TeSTInstance.h"
-
-class TeSTElementSet;
-
-class STAT_DLL TeGridElement
-{
-	TeRaster* parent_;
-
-public:
-	int col_;
-	int lin_;
-
-	TeGridElement(TeRaster* rst=0, int col=0, int lin=0):
-	parent_(rst),
-	col_(col),
-	lin_(lin)
-	{}
-
-	void setColLin(int col, int lin)
-	{ 	col_ = col; lin_ = lin; 	}
-
-	void setRaster(TeRaster* rst)
-	{	parent_ = rst; }
-
-	void addProperty(TeProperty propK)
-	{	
-		double val = atof(propK.value_.c_str());
-		parent_->setElement(col_,lin_,val);
-	}
-
-	bool getDoubleProperty(int idx, double& value) 
-	{	return parent_->getElement(col_, lin_, value, idx);	}
-
-	bool setDoubleProperty(int idx , double value) 
-	{	return parent_->setElement(col_,lin_, value, idx);	}
-
-	bool getPropertyValue(const string& /* name */, string& value) 
-	{
-		double val;
-		if (parent_->getElement(col_,lin_,val)) 
-		{
-			value = Te2String(val,12);
-			return true;
-		}
-		value = Te2String(-1.0);
-		return false;
-	}
-
-	bool setPropertyValue(const string& /* name */, const string&  value) 
-	{
-		double val;
-		val = atof(value.c_str());
-		return parent_->setElement(col_,lin_,val);
-	}
-
-	bool centroid(TeCoord2D& loc)
-	{
-		TeCoord2D pt(col_,lin_);
-		loc = parent_->index2Coord(pt);
-		return true;
-	}
-
-	bool area(double& a)
-	{
-		a = parent_->params().resx_ * parent_->params().resy_;
-		return true;
-	}
-};
-//!  A grid support to generate a map of kernel
-/*! 
-	 This is a wrapper around TeRaster class in order to use  it as
-	 the output of a kernel algorithm. It provides iterators and  methods
-	 so that Kernel Map algorithms can use it in the same way as when using 
-	 a set of polygonal regions as support.
-*/
-class STAT_DLL TeKernelGridSupport
-{
-	TeRaster* rasterImp_;
-public:
-
-	TeKernelGridSupport(TeBox& bb, int ncols, TeProjection* proj, unsigned int nBands = 1)
-	{
-		TeRasterParams par;
-		par.decoderIdentifier_=  "MEM";
-		par.fileName_ = "rasterTemp";
-		rasterImp_ =0;
-
-		double resx = bb.width()/ncols;
-		TeBox newBox = adjustToCut(bb,resx,resx);
-		par.boundingBoxResolution(newBox.x1_,newBox.y1_,newBox.x2_,newBox.y2_,resx,resx);
-		newBox = par.boundingBox();
-		par.nBands(nBands);
-		par.projection(proj);
-		par.setDataType(TeDOUBLE);
-		par.setDummy(-TeMAXFLOAT);
-		par.setPhotometric(TeRasterParams::TeMultiBand);
-		par.useDummy_ = true;
-		par.mode_ = 'c';
-
-		rasterImp_ = new TeRaster(par);
-		if(!rasterImp_)
-			rasterImp_ = 0;
-
-		if (!rasterImp_->init())
-		{
-			delete rasterImp_;
-			rasterImp_ = 0;
-		}
-	}
-
-
-	~TeKernelGridSupport()
-	{
-		if (rasterImp_)
-		{
-			delete rasterImp_;
-			rasterImp_ = 0;
-		}
-	}
-
-	bool status()
-	{	return (rasterImp_ && rasterImp_->status()); }
-
-	double totalArea() 
-	{ return TeGeometryArea(rasterImp_->params().boundingBox()); }
-
- 	int numObjects() 
-	{
-		TeRasterParams par;
-		par = rasterImp_->params();
-		return par.ncols_ * par.nlines_;
-	}
-
-	//-----
-	class iterator
-	{
-		friend class TeKernelGridSupport;
-
-	protected:
-		TeRaster::iterator  curItRaster_; //guarda iterador que pode ser de poligono ou nao
-		TeGridElement elem_;
-
-	public:
-		iterator(TeRaster* rst=0): curItRaster_(0)
-		{ elem_.setRaster(rst); }
-
-		~iterator() {}
-
-		iterator(TeRaster::iterator itr, TeRaster* rst=0) :
-			curItRaster_(itr)
-		{ 
-			elem_.setRaster(rst);
-			elem_.setColLin(curItRaster_.currentColumn(), curItRaster_.currentLine());
-		}
-
-		iterator& operator++()
-		{
-			//curItRaster_->operator++();
-			curItRaster_.moveForward();
-			elem_.setColLin(curItRaster_.currentColumn(), curItRaster_.currentLine());
-			return *this;
-		}
-
-		bool operator==(const iterator& rhs) const
-		{ return ((this->curItRaster_) ==   (rhs.curItRaster_)); }
-
-		bool operator!=(const iterator& rhs) const
-		{ return !((this->curItRaster_) ==   (rhs.curItRaster_));}
-
-		iterator& operator=(const iterator& other)
-		{
-			if ( this != &other )
-			{
-				curItRaster_ = other.curItRaster_;
-				elem_ = other.elem_;
-			}
-			return *this;
-		}
-
-		TeGridElement& operator*() { return elem_; }
-
-		TeGridElement& operator->() { return elem_; }
-	};
-
-  	//-----
-	class iteratorPoly
-	{
-		friend class TeKernelGridSupport;
-
-	protected:
-    TeRaster::iteratorPoly curItRaster_; //guarda iterador que pode ser de poligono ou nao
-		TeGridElement elem_;
-
-	public:
-		iteratorPoly(TeRaster* rst=0): curItRaster_(0)
-		{ elem_.setRaster(rst); }
-
-        ~iteratorPoly() {}
-
-		iteratorPoly(TeRaster::iteratorPoly itr, TeRaster* rst=0) :
-			curItRaster_(itr)
-		{ 
-			elem_.setRaster(rst);
-			elem_.setColLin(curItRaster_.currentColumn(), curItRaster_.currentLine());
-		}
-
-		iteratorPoly& operator++()
-		{
-			//curItRaster_->operator++();
-			curItRaster_.moveForward();
-			elem_.setColLin(curItRaster_.currentColumn(), curItRaster_.currentLine());
-			return *this;
-		}
-
-		bool operator==(const iteratorPoly& rhs) const
-		{	return ((this->curItRaster_) ==   (rhs.curItRaster_)); }
-
-		bool operator!=(const iteratorPoly& rhs) const
-		{ return !((this->curItRaster_) ==   (rhs.curItRaster_)); }
-
-		iteratorPoly& operator=(const iteratorPoly& other)
-		{
-			if ( this != &other )
-			{
-				curItRaster_ = other.curItRaster_;
-				elem_ = other.elem_;
-			}
-			return *this;
-		}
-
-		TeGridElement& operator*() { return elem_; }
-
-		TeGridElement& operator->() { return elem_; }
-	};
-
-
-	//-----
-
-	TeRaster* raster()
-	{	return rasterImp_; }
-
-	iterator begin()
-	{
-		TeRasterParams par = rasterImp_->params();
-		TeRaster::iterator itbegin(0,0,par.ncols_,par.nlines_,par.nBands(),rasterImp_);
-		TeKernelGridSupport::iterator it(itbegin,rasterImp_);
-		return it;
-	}
-
-	iteratorPoly begin(TePolygon poly)
-	{
-		TeRaster::iteratorPoly itRasterBegin_ = rasterImp_->begin(poly,TeBBoxPixelInters);
-		TeKernelGridSupport::iteratorPoly it(itRasterBegin_, rasterImp_);
-		return it;
-	}
-
-	iterator end()
-	{
-		TeRasterParams par = rasterImp_->params();
-		TeRaster::iterator itend =  TeRaster::iterator(par.ncols_,par.nlines_-1,par.ncols_,par.nlines_,par.nBands(),rasterImp_);
-		TeKernelGridSupport::iterator it(itend,rasterImp_);
-		return it;
-	}
-
-	iteratorPoly end(TePolygon poly)
-	{
-		TeRaster::iteratorPoly itRasterEnd_ =  rasterImp_->end(poly,TeBBoxPixelInters);
-		TeKernelGridSupport::iteratorPoly it(itRasterEnd_,rasterImp_);
-		return it;
-	}
-};
-
-
-/////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////
-//! An instance in time of a spatial object, with specialized members for TerraStat
-class STAT_DLL TeSTStatInstance : public  TeSTInstance
-{
-
-  protected:
-
-	vector<double> dblProperties_;
-
-	//! inicialize the vector of double
-	void initDbl(int n) 
-	{
-		for(int i=0; i<n; ++i)
-			dblProperties_.push_back (0.0);
-	}
-
-  public:
-    
-	//! Constructor
-	TeSTStatInstance(int nDlbProp = 0); 
-
-    //! Constructor
-    TeSTStatInstance(TeSTInstance& other, int nd, int ad); 
-    
-	//! Copy constructor
-    TeSTStatInstance(const TeSTStatInstance& other);     
-
-	//! Destructor
-    virtual ~TeSTStatInstance()
-	{ }
-
-	//! Assign operator
-	TeSTStatInstance& operator=(const TeSTStatInstance& other);
-
-    bool setDoubleProperty(unsigned int idx, double value) 
-	{
-		if (idx >= dblProperties_.size())
-        	return false;
-		dblProperties_[idx] = value;
-		return true;
-    }
-
-    bool getDoubleProperty(unsigned int idx, double& value) 
-	{
-		if (idx >= dblProperties_.size())
-			return false;
-		value = dblProperties_[idx];
-		return true;
-    }
-
-};
- 
-class STAT_DLL TeSTStatInstanceSet  
-{
-  
-  
-  protected:
-    
-    // map of object identification to its instances in time
-    vector<TeSTStatInstance >	objs_;	
-    
-  public:
-    
-   //! Constructor 
-    TeSTStatInstanceSet() 
-	{}
-
-	//! Destructor
-	virtual ~TeSTStatInstanceSet()
-	{}
-
-	//! Copy constructor
-    TeSTStatInstanceSet(const TeSTStatInstanceSet& other)
-	{
-		this->objs_ = other.objs_;
-	}
-
-	//! Assign operator
-	virtual TeSTStatInstanceSet& operator=(const TeSTStatInstanceSet& other);
-
-    
-    void Copy(TeSTElementSet& stoSet, int nDbl=0, int aDbl = 0); 
-    
-    int numObjects(); 
-    
-    class iterator {
-      vector<TeSTStatInstance >::iterator it_;
-      
-    public:
-      iterator(vector<TeSTStatInstance >::iterator i){it_ = i;}
-      
-      ~iterator(){}
-      
-      iterator& operator++()
-      {
-        ++it_;
-        return *this;
-      }
-      
-      bool operator==(const iterator& rhs) const
-      {
-        return ((this->it_) ==   (rhs.it_));
-      }
-      
-      bool operator!=(const iterator& rhs) const
-      {
-        return !((this->it_) ==   (rhs.it_));
-      }
-      
-      iterator& operator=(const iterator& other)
-      {
-        if ( this != &other )
-        {
-          it_ = other.it_;
-        }
-        return *this;
-      }
-      
-      TeSTStatInstance& operator*() { return *(it_); }
-    };
-    
-    iterator begin() {  
-      return TeSTStatInstanceSet::iterator(objs_.begin());
-    }
-    
-    iterator end() {
-      return TeSTStatInstanceSet::iterator(objs_.end());
-    }
-    
-};
-
-// Classe de eventos pontuais
-class STAT_DLL TePointTInstanceSet : public TeSTStatInstanceSet
-{
-
-  public:
-
-	TePointTInstanceSet() : TeSTStatInstanceSet() 
-	{}
-
-  //! Destructor
-	~TePointTInstanceSet()
-	{}
-
-  
-  iterator begin(const TeCoord2D& /* center */, const double& /* radius */)
-  {
-    return TeSTStatInstanceSet::begin();
-  }
-
-  iterator end(const TeCoord2D& /* center */, const double& /* radius */)
-  {
-    return TeSTStatInstanceSet::end();
-  }
-
-  iterator begin()
-  {
-    return TeSTStatInstanceSet::begin();
-  }
-
-  iterator end()
-  {
-    return TeSTStatInstanceSet::end();
-  }
-};
-
-#endif
+/************************************************************************************
+Exploring and analysis of geographical data using TerraLib and TerraView
+Copyright � 2003-2007 INPE and LESTE/UFMG.
+
+Partially funded by CNPq - Project SAUDAVEL, under grant no. 552044/2002-4,
+SENASP-MJ and INPE
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This program is distributed hoping it will be useful, however, WITHOUT ANY 
+WARRANTIES; neither to the implicit warranty of MERCHANTABILITY OR SUITABILITY FOR
+AN SPECIFIC FINALITY. Consult the GNU General Public License for more details.
+
+You must have received a copy of the GNU General Public License with this program.
+In negative case, write to the Free Software Foundation, Inc. in the following
+address: 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
+***********************************************************************************/
+/*! \file TeStatDataStructures.h
+    \brief This file deals with special data structures for spatial statistics 
+*/
+#ifndef __TERRALIB_INTERNAL_STATDATASTRUCTURES_H
+#define __TERRALIB_INTERNAL_STATDATASTRUCTURES_H
+
+#include "TeStatDefines.h"
+#include "TeProjection.h"
+#include "TeRaster.h"
+#include "TeAttribute.h"
+#include "TeCoord2D.h"
+#include "TeSTInstance.h"
+
+class TeSTElementSet;
+
+class STAT_DLL TeGridElement
+{
+	TeRaster* parent_;
+
+public:
+	int col_;
+	int lin_;
+
+	TeGridElement(TeRaster* rst=0, int col=0, int lin=0):
+	parent_(rst),
+	col_(col),
+	lin_(lin)
+	{}
+
+	void setColLin(int col, int lin)
+	{ 	col_ = col; lin_ = lin; 	}
+
+	void setRaster(TeRaster* rst)
+	{	parent_ = rst; }
+
+	void addProperty(TeProperty propK)
+	{	
+		double val = atof(propK.value_.c_str());
+		parent_->setElement(col_,lin_,val);
+	}
+
+	bool getDoubleProperty(int idx, double& value) 
+	{	return parent_->getElement(col_, lin_, value, idx);	}
+
+	bool setDoubleProperty(int idx , double value) 
+	{	return parent_->setElement(col_,lin_, value, idx);	}
+
+	bool getPropertyValue(const string& /* name */, string& value) 
+	{
+		double val;
+		if (parent_->getElement(col_,lin_,val)) 
+		{
+			value = Te2String(val,12);
+			return true;
+		}
+		value = Te2String(-1.0);
+		return false;
+	}
+
+	bool setPropertyValue(const string& /* name */, const string&  value) 
+	{
+		double val;
+		val = atof(value.c_str());
+		return parent_->setElement(col_,lin_,val);
+	}
+
+	bool centroid(TeCoord2D& loc)
+	{
+		TeCoord2D pt(col_,lin_);
+		loc = parent_->index2Coord(pt);
+		return true;
+	}
+
+	bool area(double& a)
+	{
+		a = parent_->params().resx_ * parent_->params().resy_;
+		return true;
+	}
+};
+//!  A grid support to generate a map of kernel
+/*! 
+	 This is a wrapper around TeRaster class in order to use  it as
+	 the output of a kernel algorithm. It provides iterators and  methods
+	 so that Kernel Map algorithms can use it in the same way as when using 
+	 a set of polygonal regions as support.
+*/
+class STAT_DLL TeKernelGridSupport
+{
+	TeRaster* rasterImp_;
+public:
+
+	TeKernelGridSupport(TeBox& bb, int ncols, TeProjection* proj, unsigned int nBands = 1)
+	{
+		TeRasterParams par;
+		par.decoderIdentifier_=  "MEM";
+		par.fileName_ = "rasterTemp";
+		rasterImp_ =0;
+
+		double resx = bb.width()/ncols;
+		TeBox newBox = adjustToCut(bb,resx,resx);
+		par.boundingBoxResolution(newBox.x1_,newBox.y1_,newBox.x2_,newBox.y2_,resx,resx);
+		newBox = par.boundingBox();
+		par.nBands(nBands);
+		par.projection(proj);
+		par.setDataType(TeDOUBLE);
+		par.setDummy(-TeMAXFLOAT);
+		par.setPhotometric(TeRasterParams::TeMultiBand);
+		par.useDummy_ = true;
+		par.mode_ = 'c';
+
+		rasterImp_ = new TeRaster(par);
+		if(!rasterImp_)
+			rasterImp_ = 0;
+
+		if (!rasterImp_->init())
+		{
+			delete rasterImp_;
+			rasterImp_ = 0;
+		}
+	}
+
+
+	~TeKernelGridSupport()
+	{
+		if (rasterImp_)
+		{
+			delete rasterImp_;
+			rasterImp_ = 0;
+		}
+	}
+
+	bool status()
+	{	return (rasterImp_ && rasterImp_->status()); }
+
+	double totalArea() 
+	{ return TeGeometryArea(rasterImp_->params().boundingBox()); }
+
+ 	int numObjects() 
+	{
+		TeRasterParams par;
+		par = rasterImp_->params();
+		return par.ncols_ * par.nlines_;
+	}
+
+	//-----
+	class iterator
+	{
+		friend class TeKernelGridSupport;
+
+	protected:
+		TeRaster::iterator  curItRaster_; //guarda iterador que pode ser de poligono ou nao
+		TeGridElement elem_;
+
+	public:
+		iterator(TeRaster* rst=0): curItRaster_(0)
+		{ elem_.setRaster(rst); }
+
+		~iterator() {}
+
+		iterator(TeRaster::iterator itr, TeRaster* rst=0) :
+			curItRaster_(itr)
+		{ 
+			elem_.setRaster(rst);
+			elem_.setColLin(curItRaster_.currentColumn(), curItRaster_.currentLine());
+		}
+
+		iterator& operator++()
+		{
+			//curItRaster_->operator++();
+			curItRaster_.moveForward();
+			elem_.setColLin(curItRaster_.currentColumn(), curItRaster_.currentLine());
+			return *this;
+		}
+
+		bool operator==(const iterator& rhs) const
+		{ return ((this->curItRaster_) ==   (rhs.curItRaster_)); }
+
+		bool operator!=(const iterator& rhs) const
+		{ return !((this->curItRaster_) ==   (rhs.curItRaster_));}
+
+		iterator& operator=(const iterator& other)
+		{
+			if ( this != &other )
+			{
+				curItRaster_ = other.curItRaster_;
+				elem_ = other.elem_;
+			}
+			return *this;
+		}
+
+		TeGridElement& operator*() { return elem_; }
+
+		TeGridElement& operator->() { return elem_; }
+	};
+
+  	//-----
+	class iteratorPoly
+	{
+		friend class TeKernelGridSupport;
+
+	protected:
+    TeRaster::iteratorPoly curItRaster_; //guarda iterador que pode ser de poligono ou nao
+		TeGridElement elem_;
+
+	public:
+		iteratorPoly(TeRaster* rst=0): curItRaster_(0)
+		{ elem_.setRaster(rst); }
+
+        ~iteratorPoly() {}
+
+		iteratorPoly(TeRaster::iteratorPoly itr, TeRaster* rst=0) :
+			curItRaster_(itr)
+		{ 
+			elem_.setRaster(rst);
+			elem_.setColLin(curItRaster_.currentColumn(), curItRaster_.currentLine());
+		}
+
+		iteratorPoly& operator++()
+		{
+			//curItRaster_->operator++();
+			curItRaster_.moveForward();
+			elem_.setColLin(curItRaster_.currentColumn(), curItRaster_.currentLine());
+			return *this;
+		}
+
+		bool operator==(const iteratorPoly& rhs) const
+		{	return ((this->curItRaster_) ==   (rhs.curItRaster_)); }
+
+		bool operator!=(const iteratorPoly& rhs) const
+		{ return !((this->curItRaster_) ==   (rhs.curItRaster_)); }
+
+		iteratorPoly& operator=(const iteratorPoly& other)
+		{
+			if ( this != &other )
+			{
+				curItRaster_ = other.curItRaster_;
+				elem_ = other.elem_;
+			}
+			return *this;
+		}
+
+		TeGridElement& operator*() { return elem_; }
+
+		TeGridElement& operator->() { return elem_; }
+	};
+
+
+	//-----
+
+	TeRaster* raster()
+	{	return rasterImp_; }
+
+	iterator begin()
+	{
+		TeRasterParams par = rasterImp_->params();
+		TeRaster::iterator itbegin(0,0,par.ncols_,par.nlines_,par.nBands(),rasterImp_);
+		TeKernelGridSupport::iterator it(itbegin,rasterImp_);
+		return it;
+	}
+
+	iteratorPoly begin(TePolygon poly)
+	{
+		TeRaster::iteratorPoly itRasterBegin_ = rasterImp_->begin(poly,TeBBoxPixelInters);
+		TeKernelGridSupport::iteratorPoly it(itRasterBegin_, rasterImp_);
+		return it;
+	}
+
+	iterator end()
+	{
+		TeRasterParams par = rasterImp_->params();
+		TeRaster::iterator itend =  TeRaster::iterator(par.ncols_,par.nlines_-1,par.ncols_,par.nlines_,par.nBands(),rasterImp_);
+		TeKernelGridSupport::iterator it(itend,rasterImp_);
+		return it;
+	}
+
+	iteratorPoly end(TePolygon poly)
+	{
+		TeRaster::iteratorPoly itRasterEnd_ =  rasterImp_->end(poly,TeBBoxPixelInters);
+		TeKernelGridSupport::iteratorPoly it(itRasterEnd_,rasterImp_);
+		return it;
+	}
+};
+
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+//! An instance in time of a spatial object, with specialized members for TerraStat
+class STAT_DLL TeSTStatInstance : public  TeSTInstance
+{
+
+  protected:
+
+	vector<double> dblProperties_;
+
+	//! inicialize the vector of double
+	void initDbl(int n) 
+	{
+		for(int i=0; i<n; ++i)
+			dblProperties_.push_back (0.0);
+	}
+
+  public:
+    
+	//! Constructor
+	TeSTStatInstance(int nDlbProp = 0); 
+
+    //! Constructor
+    TeSTStatInstance(TeSTInstance& other, int nd, int ad); 
+    
+	//! Copy constructor
+    TeSTStatInstance(const TeSTStatInstance& other);     
+
+	//! Destructor
+    virtual ~TeSTStatInstance()
+	{ }
+
+	//! Assign operator
+	TeSTStatInstance& operator=(const TeSTStatInstance& other);
+
+    bool setDoubleProperty(unsigned int idx, double value) 
+	{
+		if (idx >= dblProperties_.size())
+        	return false;
+		dblProperties_[idx] = value;
+		return true;
+    }
+
+    bool getDoubleProperty(unsigned int idx, double& value) 
+	{
+		if (idx >= dblProperties_.size())
+			return false;
+		value = dblProperties_[idx];
+		return true;
+    }
+
+};
+ 
+class STAT_DLL TeSTStatInstanceSet  
+{
+  
+  
+  protected:
+    
+    // map of object identification to its instances in time
+    vector<TeSTStatInstance >	objs_;	
+    
+  public:
+    
+   //! Constructor 
+    TeSTStatInstanceSet() 
+	{}
+
+	//! Destructor
+	virtual ~TeSTStatInstanceSet()
+	{}
+
+	//! Copy constructor
+    TeSTStatInstanceSet(const TeSTStatInstanceSet& other)
+	{
+		this->objs_ = other.objs_;
+	}
+
+	//! Assign operator
+	virtual TeSTStatInstanceSet& operator=(const TeSTStatInstanceSet& other);
+
+    
+    void Copy(TeSTElementSet& stoSet, int nDbl=0, int aDbl = 0); 
+    
+    int numObjects(); 
+    
+    class iterator {
+      vector<TeSTStatInstance >::iterator it_;
+      
+    public:
+      iterator(vector<TeSTStatInstance >::iterator i){it_ = i;}
+      
+      ~iterator(){}
+      
+      iterator& operator++()
+      {
+        ++it_;
+        return *this;
+      }
+      
+      bool operator==(const iterator& rhs) const
+      {
+        return ((this->it_) ==   (rhs.it_));
+      }
+      
+      bool operator!=(const iterator& rhs) const
+      {
+        return !((this->it_) ==   (rhs.it_));
+      }
+      
+      iterator& operator=(const iterator& other)
+      {
+        if ( this != &other )
+        {
+          it_ = other.it_;
+        }
+        return *this;
+      }
+      
+      TeSTStatInstance& operator*() { return *(it_); }
+    };
+    
+    iterator begin() {  
+      return TeSTStatInstanceSet::iterator(objs_.begin());
+    }
+    
+    iterator end() {
+      return TeSTStatInstanceSet::iterator(objs_.end());
+    }
+    
+};
+
+// Classe de eventos pontuais
+class STAT_DLL TePointTInstanceSet : public TeSTStatInstanceSet
+{
+
+  public:
+
+	TePointTInstanceSet() : TeSTStatInstanceSet() 
+	{}
+
+  //! Destructor
+	~TePointTInstanceSet()
+	{}
+
+  
+  iterator begin(const TeCoord2D& /* center */, const double& /* radius */)
+  {
+    return TeSTStatInstanceSet::begin();
+  }
+
+  iterator end(const TeCoord2D& /* center */, const double& /* radius */)
+  {
+    return TeSTStatInstanceSet::end();
+  }
+
+  iterator begin()
+  {
+    return TeSTStatInstanceSet::begin();
+  }
+
+  iterator end()
+  {
+    return TeSTStatInstanceSet::end();
+  }
+};
+
+#endif
diff --git a/src/terralib/stat/TeStatDefines.h b/src/terralib/stat/TeStatDefines.h
index 2def9ef..05ea875 100644
--- a/src/terralib/stat/TeStatDefines.h
+++ b/src/terralib/stat/TeStatDefines.h
@@ -1,56 +1,56 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDefines.h
-    \brief Provides a set of general definitions used by Terralib
-*/
-#ifndef  __STAT_INTERNAL_DEFINES_H
-#define  __STAT_INTERNAL_DEFINES_H
-
-#include <string> 
-
-/** @defgroup Defines Defines and constants
-  @{
- */
-
-/** @defgroup STAT_AS_DLL macros.
-  @{
- */
-#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
-
-#if defined(_MSC_VER) /* MSVC Compiler */
-#pragma warning(disable: 4251)
-#endif
-
-#ifdef STAT_AS_DLL
-#define STAT_DLL __declspec(dllexport)
-#else
-#define STAT_DLL __declspec(dllimport)
-#endif
-
-#else
-#define STAT_DLL
-#endif
-/** @} */ 
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDefines.h
+    \brief Provides a set of general definitions used by Terralib
+*/
+#ifndef  __STAT_INTERNAL_DEFINES_H
+#define  __STAT_INTERNAL_DEFINES_H
+
+#include <string> 
+
+/** @defgroup Defines Defines and constants
+  @{
+ */
+
+/** @defgroup STAT_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef STAT_AS_DLL
+#define STAT_DLL __declspec(dllexport)
+#else
+#define STAT_DLL __declspec(dllimport)
+#endif
+
+#else
+#define STAT_DLL
+#endif
+/** @} */ 
+
+#endif
+
diff --git a/src/terralib/stat/TeTreeMinimum.cpp b/src/terralib/stat/TeTreeMinimum.cpp
old mode 100755
new mode 100644
index 72262e0..2ebe259
--- a/src/terralib/stat/TeTreeMinimum.cpp
+++ b/src/terralib/stat/TeTreeMinimum.cpp
@@ -1,391 +1,391 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include <math.h>
-#include "TeTreeMinimum.h"
-#include "TeSTElementSet.h"
-#include "TeGeneralizedProxMatrix.h"
-
-bool 
-compare_dissimilarity(const TeMSTGraphLink &graph_link1, const TeMSTGraphLink &graph_link2)
-{
-	if (graph_link1.Dissimilarity_ < graph_link2.Dissimilarity_) 
-		return true;
-	else
-		return false;
-}
-
-void TeCreateDissMatrix (TeSTElementSet* objects, TeGeneralizedProxMatrix* proxMatrix,
-					   TeMSTMatrix& mat_diss, double& Diss_max)
-{
-	
-	string objectId1, objectId2;
-	TeNeighboursMap neighbors; 
-	int num_neighbors;
-	double val1, val2;
-	int DISS_TYPE = 1;
-	double Diss = 0.;	
-	Diss_max = 0.;	
-	TeMSTGraph graph_;
-	int tamanho = 0;
-
-	TeSTElementSet::iterator it = objects->begin();
-	while ( it != objects->end() )
-	{
-		it->slice(0);
-		objectId1 = it->objectId();
-		
-		neighbors = proxMatrix->getMapNeighbours(objectId1);
-		TeNeighboursMap::iterator itNeigs = neighbors.begin();
-		num_neighbors = neighbors.size();
-		graph_.clear();
-		tamanho = graph_.size();
-		double difer = 0.;
-		while(itNeigs != neighbors.end())
-		{
-			objectId2 = itNeigs->first;
-			Diss = 0.; 
-			TePropertyVector* propVec = objects->getPropertyVector(objectId2);
-			if(!propVec)
-				continue;
-
-			for(unsigned j=0; j<propVec->size(); ++j)
-			{
-				val1 = it->operator[](j);
-				val2 = atof(propVec->operator[](j).value_.c_str());		
-				difer = val1 - val2;
-				if (DISS_TYPE)
-					Diss+= difer*difer;		// distancia euclidiana (y=1)
-				else
-					Diss+= double(fabs(difer));		// distancia quarteirao (y=0)
-			}
-			if (DISS_TYPE)
-				Diss = sqrt(Diss);
-			
-			//	guarda maior valor
-			if (Diss > Diss_max)
-				Diss_max = Diss;
-
-			//escrever na estrutura map de grafos
-			if (objectId1 != objectId2)
-				graph_.push_back(TeMSTGraphLink(objectId1,objectId2,Diss));
-			
-			++itNeigs;
-		}
-		sort(graph_.begin(), graph_.end(), compare_dissimilarity); 
-		mat_diss[objectId1] = graph_;
-		++it;
-    }
-}
-
-
-void
-TeCreateMinimumTree (TeSTElementSet* objects, TeMSTMatrix& DissMatrix, 
-					 TeMSTGraph& Min_Tree, double Diss_max)
-{
-	// GERAR ARVORE MINIMA
-	vector<string> nos_MimTree;
-	
-	// escolha do primeiro n�
-	TeSTElementSet::iterator it = objects->begin();
-	string objId1 = it->objectId();	
-	int num_nos = 0;	//n�mero de n�s na �rvore m�nima
-
-	//armazena o primeiro vizinho do primeiro objeto. Os vizinhos est�o ordenados pela dissimilaridade
-	nos_MimTree.push_back(objId1); 
-	++num_nos;
-	string objId2 = DissMatrix[objId1][0].GeoId2_;  //A matriz possui as linhas ordenadas pela menor dissimilaridade
-	nos_MimTree.push_back(objId2);
-	++num_nos;
-
-	//Min_Tree: grafo da �rvore m�nima
-	TeMSTGraphLink link1(objId1, objId2, DissMatrix[objId1][0].Dissimilarity_);
-	Min_Tree.push_back(link1);
-
-	//apaga o vizinho que entrou na �rvore m�nima da matrix
-	double Diss_mim;
-	TeMSTGraph::iterator it_link = DissMatrix[objId1].begin();
-	if(it_link!=DissMatrix[objId1].end())
-		DissMatrix[objId1].erase(it_link);	//apaga link j� analisado
-
-	int num_objects = objects->numSTInstance();
-	bool no_novo = false;
-
-	//Min_Tree ter� num_objects n�s e num_objects-1 arestas
-	while ((num_nos) < num_objects)
-	{
-		Diss_mim = Diss_max;
-		no_novo = false;
-		//para cada n� da �rvore m�nima selecione as arestas que ligam a um v�tice ainda n�o existente na 
-		//�rvore m�nima
-		// e escolha a aresta com menor dissimilaridade para entrar na �rvore m�nima
-		for (unsigned int i = 0; i < nos_MimTree.size(); i++)
-		{
-			string no_atual = nos_MimTree[i];
-			unsigned int size = DissMatrix[no_atual].size();
-			double diss = DissMatrix[no_atual][0].Dissimilarity_;
-			if ((size != 0) && (diss <= Diss_mim))
-			{
-				objId1 = DissMatrix[nos_MimTree[i]][0].GeoId1_; 
-				objId2 = DissMatrix[nos_MimTree[i]][0].GeoId2_;
-				Diss_mim = DissMatrix[nos_MimTree[i]][0].Dissimilarity_; 
-				no_novo = true;
-			}
-		}
-
-		if(!no_novo) //n�o achou nenhuma aresta
-			num_nos = num_objects;
-
-		// verifica se n� j� pertence � �rvore
-		//se objId2 j� existe na �rove n�o podemos considerar essa aresta
-		vector<string>::iterator itFind = find(nos_MimTree.begin(), nos_MimTree.end(), objId2);
-		if(itFind!=nos_MimTree.end())
-			no_novo = false;
-				
-		// se n� � novo, inclui link na �rvore m�nima
-		if (no_novo)
-		{
-			//nos_MimTree[num_nos++] = objId2;
-			nos_MimTree.push_back(objId2);
-			++num_nos;
-			TeMSTGraphLink link2(objId1, objId2, Diss_mim);
-			Min_Tree.push_back(link2);
-		}
-		
-		TeMSTGraph::iterator it_link2 = DissMatrix[objId1].begin();
-		if(it_link2!=DissMatrix[objId1].end())
-			DissMatrix[objId1].erase(it_link2);	//apaga link j� analisado
-	}
-}
-
-
-void
-TeCreateSubTrees(TeSTElementSet* objects, TeMSTGraph& Min_Tree, int num_regioes)
-{ 
-	double	SSA1 = 0., SSA2 = 0., SSTO = 0.;
-	TeMSTGraph::iterator it1 = Min_Tree.begin();
-	TeMSTGraph::iterator it2 = Min_Tree.begin();
-	TeMSTGraph::iterator itMax = Min_Tree.begin();
-	
-	vector<string> subtree_vertexes_1, subtree1;
-	vector<string> subtree_vertexes_2, subtree2;
-
-	int attributes_number = objects->begin()->getPropertyVector().size();
-
-	//estruturas para armazenar estatisticas
-	vector <double> sum1(attributes_number, 0.);
-	vector <double> sum2(attributes_number, 0.);
-	vector <double> total_sum(attributes_number, 0.);
-	vector <double> mean1(attributes_number, 0.);
-	vector <double> mean2(attributes_number, 0.);
-	vector <double> global_mean(attributes_number, 0.);
-
-	//pegar os atributos e colocar em um map
-	map<string, vector<double> >  attrObjects;
-	TeSTElementSet::iterator attrIt =  objects->begin();
-	while(attrIt!=objects->end())
-	{
-		vector<double> attrs;
-		for(int i=0; i<attributes_number; ++i)
-			attrs.push_back(atof((*attrIt).getPropertyVector()[i].value_.c_str()));
-		attrObjects[(*attrIt).objectId()]=attrs;
-
-		++attrIt;
-	}
-	
-	// h� necessidade de zerar o slice!
-	for (int regiao = 1; regiao < num_regioes; regiao++)
-	{
-		double link_cost = 0.;
-		TeMSTGraphLink bigest_cost("","",0.); 
-		int contagem = 0;
-		it1 = Min_Tree.begin();
-		while (it1 != Min_Tree.end())
-		{
-			TeMSTGraph MT_copy;
-			 
-			string GeoId1 = it1->GeoId1_;
-			string GeoId2 = it1->GeoId2_;
-			subtree_vertexes_1.clear();			
-			subtree_vertexes_2.clear();
-
-			//estruturas para armazenar as estat�sticas
-			fill(sum1.begin(), sum1.end(), 0.);
-			fill(sum2.begin(), sum2.end(), 0.);
-			fill(total_sum.begin(), total_sum.end(), 0.);
-			fill(mean1.begin(), mean1.end(), 0.);
-			fill(mean2.begin(), mean2.end(), 0.);
-			fill(global_mean.begin(), global_mean.end(), 0.);
-
-			subtree_vertexes_1.push_back(GeoId1);
-			subtree_vertexes_2.push_back(GeoId2);
-			for (int i = 0; i < attributes_number  ; ++i)
-			{
-                sum1[i] += attrObjects[GeoId1][i];
-				sum2[i] += attrObjects[GeoId2][i];
-			}
-
-			string new_vertixe;
-
-			unsigned int actual_vert = 0;
-			bool new_v = false;
-
-			//percorre o primeiro vetor
-			while (actual_vert < subtree_vertexes_1.size())
-			{
-				it2 = Min_Tree.begin();
-				new_v = false; //verificar a posi��o desse
-				while (it2 != Min_Tree.end())
-				{
-					if ((subtree_vertexes_1[actual_vert] == it2->GeoId1_) && 
-						(subtree_vertexes_2[0] != it2->GeoId2_ ))
-					{
-						new_vertixe = it2->GeoId2_; 
-						new_v = true;
-					} 
-					else if ((subtree_vertexes_1[actual_vert] == it2->GeoId2_) && 
-						(subtree_vertexes_2[0] != it2->GeoId1_ ))
-					{
-						new_vertixe = it2->GeoId1_; 
-						new_v = true;
-					}
-					if ((new_v) && (find(subtree_vertexes_1.begin(), subtree_vertexes_1.end(), new_vertixe) == subtree_vertexes_1.end()))
-					{
-							subtree_vertexes_1.push_back(new_vertixe);
-							//pegar a soma
-							for (int i = 0; i < attributes_number  ; ++i)
-								sum1[i] += attrObjects[new_vertixe][i];
-					}
-					++it2;
-				}
-				actual_vert++;
-			}
-
-			actual_vert = 0;
-			while (actual_vert < subtree_vertexes_2.size())
-			{
-				it2 = Min_Tree.begin();
-				new_v = false;
-
-				while (it2 != Min_Tree.end())
-				{
-					if ((subtree_vertexes_2[actual_vert] == it2->GeoId1_) && 
-						(subtree_vertexes_1[0] != it2->GeoId2_ ))
-					{
-						new_vertixe = it2->GeoId2_; new_v = true;
-					} else if ((subtree_vertexes_2[actual_vert] == it2->GeoId2_) && 
-						(subtree_vertexes_1[0] != it2->GeoId1_ ))
-					{
-						new_vertixe = it2->GeoId1_; new_v = true;
-					}
-					if ((new_v) && (find(subtree_vertexes_2.begin(), subtree_vertexes_2.end(), new_vertixe) == subtree_vertexes_2.end()))
-					{
-							subtree_vertexes_2.push_back(new_vertixe);
-							//pegar a soma
-							for (int i = 0; i < attributes_number  ; ++i)
-								sum2[i] += attrObjects[new_vertixe][i];
-					}
-					++it2;
-				}
-				++actual_vert;
-			}				
-
-			//-----------------------------------------------------------
-			//Calcular o vetor m�dia
-			int tam1 = subtree_vertexes_1.size();
-			int tam2 = subtree_vertexes_2.size();
-			
-			for (int k = 0; k < attributes_number ; k++)
-				total_sum[k] = sum1[k] + sum2[k];
-			
-			for (int j = 0; j < attributes_number ; j++)
-			{
-				 mean1[j] = sum1[j]/tam1; 
-				 mean2[j] =	sum2[j]/tam2;
-				 global_mean[j] = total_sum[j]/(tam1+tam2);
-			}			
-
-			// Calculo do SSTO e SSA's		
-			double SSA1 = 0.; SSA2 = 0.; SSTO = 0.; 
-			double desvio1 = 0., desvio2 = 0., desvioGlobal = 0.;
-			double valor = 0.;
-			vector<string>::iterator it_s = subtree_vertexes_1.begin();
-			while ( it_s != subtree_vertexes_1.end() ) //calcula desvio dos atributos dos objetos que est�o no vetor 1
-			{
-				for (int i=0; i<attributes_number; i++)
-				{
-					valor = attrObjects[(*it_s).c_str()][i];
-					desvio1 = valor - mean1[i];
-					desvioGlobal = valor - global_mean[i];
-					SSA1 += desvio1*desvio1;
-					SSTO += desvioGlobal*desvioGlobal;
-				}
-				++it_s;
-			}
-
-			it_s = subtree_vertexes_2.begin();
-			while ( it_s != subtree_vertexes_2.end() )  //calcula desvio dos atributos dos objetos que est�o no vetor 2
-			{
-				for (int i=0; i<attributes_number; i++)
-				{
-					valor = attrObjects[(*it_s).c_str()][i];
-					desvio2 = valor - mean2[i];
-					desvioGlobal = valor - global_mean[i];
-					SSA2 += desvio2*desvio2;
-					SSTO += desvioGlobal*desvioGlobal;
-				}
-				++it_s;
-			}
-			
-			// Calculo do custo de aresta
-			double link_cost = SSTO - SSA1 - SSA2;
-
-			if (link_cost > bigest_cost.Dissimilarity_)
-			{
-				bigest_cost.Dissimilarity_ = link_cost;
-				bigest_cost.GeoId1_= GeoId1;
-				bigest_cost.GeoId2_= GeoId2;
-				subtree1 = subtree_vertexes_1;
-				subtree2 = subtree_vertexes_2;
-				itMax = it1; //armazena o iterator para o n� mais caro
-			}
-
-			++it1;
-		}
-		// excluir link
-		string teste1 = itMax->GeoId1_;
-		string teste2 = itMax->GeoId2_;
-		Min_Tree.erase(itMax);
-
-		// atualizar slice
-		vector<string>::iterator it_s = subtree2.begin();
-		int contador = 0;
-		while (it_s != subtree2.end())
-		{
-			TeSTInstance* st = objects->getSTInstance((*it_s).c_str());
-			if(st)
-				st->slice (regiao);
-			it_s++;
-			contador++;
-		}
-	}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include <math.h>
+#include "TeTreeMinimum.h"
+#include "TeSTElementSet.h"
+#include "TeGeneralizedProxMatrix.h"
+
+bool 
+compare_dissimilarity(const TeMSTGraphLink &graph_link1, const TeMSTGraphLink &graph_link2)
+{
+	if (graph_link1.Dissimilarity_ < graph_link2.Dissimilarity_) 
+		return true;
+	else
+		return false;
+}
+
+void TeCreateDissMatrix (TeSTElementSet* objects, TeGeneralizedProxMatrix* proxMatrix,
+					   TeMSTMatrix& mat_diss, double& Diss_max)
+{
+	
+	string objectId1, objectId2;
+	TeNeighboursMap neighbors; 
+	int num_neighbors;
+	double val1, val2;
+	int DISS_TYPE = 1;
+	double Diss = 0.;	
+	Diss_max = 0.;	
+	TeMSTGraph graph_;
+	int tamanho = 0;
+
+	TeSTElementSet::iterator it = objects->begin();
+	while ( it != objects->end() )
+	{
+		it->slice(0);
+		objectId1 = it->objectId();
+		
+		neighbors = proxMatrix->getMapNeighbours(objectId1);
+		TeNeighboursMap::iterator itNeigs = neighbors.begin();
+		num_neighbors = neighbors.size();
+		graph_.clear();
+		tamanho = graph_.size();
+		double difer = 0.;
+		while(itNeigs != neighbors.end())
+		{
+			objectId2 = itNeigs->first;
+			Diss = 0.; 
+			TePropertyVector* propVec = objects->getPropertyVector(objectId2);
+			if(!propVec)
+				continue;
+
+			for(unsigned j=0; j<propVec->size(); ++j)
+			{
+				val1 = it->operator[](j);
+				val2 = atof(propVec->operator[](j).value_.c_str());		
+				difer = val1 - val2;
+				if (DISS_TYPE)
+					Diss+= difer*difer;		// distancia euclidiana (y=1)
+				else
+					Diss+= double(fabs(difer));		// distancia quarteirao (y=0)
+			}
+			if (DISS_TYPE)
+				Diss = sqrt(Diss);
+			
+			//	guarda maior valor
+			if (Diss > Diss_max)
+				Diss_max = Diss;
+
+			//escrever na estrutura map de grafos
+			if (objectId1 != objectId2)
+				graph_.push_back(TeMSTGraphLink(objectId1,objectId2,Diss));
+			
+			++itNeigs;
+		}
+		sort(graph_.begin(), graph_.end(), compare_dissimilarity); 
+		mat_diss[objectId1] = graph_;
+		++it;
+    }
+}
+
+
+void
+TeCreateMinimumTree (TeSTElementSet* objects, TeMSTMatrix& DissMatrix, 
+					 TeMSTGraph& Min_Tree, double Diss_max)
+{
+	// GERAR ARVORE MINIMA
+	vector<string> nos_MimTree;
+	
+	// escolha do primeiro n�
+	TeSTElementSet::iterator it = objects->begin();
+	string objId1 = it->objectId();	
+	int num_nos = 0;	//n�mero de n�s na �rvore m�nima
+
+	//armazena o primeiro vizinho do primeiro objeto. Os vizinhos est�o ordenados pela dissimilaridade
+	nos_MimTree.push_back(objId1); 
+	++num_nos;
+	string objId2 = DissMatrix[objId1][0].GeoId2_;  //A matriz possui as linhas ordenadas pela menor dissimilaridade
+	nos_MimTree.push_back(objId2);
+	++num_nos;
+
+	//Min_Tree: grafo da �rvore m�nima
+	TeMSTGraphLink link1(objId1, objId2, DissMatrix[objId1][0].Dissimilarity_);
+	Min_Tree.push_back(link1);
+
+	//apaga o vizinho que entrou na �rvore m�nima da matrix
+	double Diss_mim;
+	TeMSTGraph::iterator it_link = DissMatrix[objId1].begin();
+	if(it_link!=DissMatrix[objId1].end())
+		DissMatrix[objId1].erase(it_link);	//apaga link j� analisado
+
+	int num_objects = objects->numSTInstance();
+	bool no_novo = false;
+
+	//Min_Tree ter� num_objects n�s e num_objects-1 arestas
+	while ((num_nos) < num_objects)
+	{
+		Diss_mim = Diss_max;
+		no_novo = false;
+		//para cada n� da �rvore m�nima selecione as arestas que ligam a um v�tice ainda n�o existente na 
+		//�rvore m�nima
+		// e escolha a aresta com menor dissimilaridade para entrar na �rvore m�nima
+		for (unsigned int i = 0; i < nos_MimTree.size(); i++)
+		{
+			string no_atual = nos_MimTree[i];
+			unsigned int size = DissMatrix[no_atual].size();
+			double diss = DissMatrix[no_atual][0].Dissimilarity_;
+			if ((size != 0) && (diss <= Diss_mim))
+			{
+				objId1 = DissMatrix[nos_MimTree[i]][0].GeoId1_; 
+				objId2 = DissMatrix[nos_MimTree[i]][0].GeoId2_;
+				Diss_mim = DissMatrix[nos_MimTree[i]][0].Dissimilarity_; 
+				no_novo = true;
+			}
+		}
+
+		if(!no_novo) //n�o achou nenhuma aresta
+			num_nos = num_objects;
+
+		// verifica se n� j� pertence � �rvore
+		//se objId2 j� existe na �rove n�o podemos considerar essa aresta
+		vector<string>::iterator itFind = find(nos_MimTree.begin(), nos_MimTree.end(), objId2);
+		if(itFind!=nos_MimTree.end())
+			no_novo = false;
+				
+		// se n� � novo, inclui link na �rvore m�nima
+		if (no_novo)
+		{
+			//nos_MimTree[num_nos++] = objId2;
+			nos_MimTree.push_back(objId2);
+			++num_nos;
+			TeMSTGraphLink link2(objId1, objId2, Diss_mim);
+			Min_Tree.push_back(link2);
+		}
+		
+		TeMSTGraph::iterator it_link2 = DissMatrix[objId1].begin();
+		if(it_link2!=DissMatrix[objId1].end())
+			DissMatrix[objId1].erase(it_link2);	//apaga link j� analisado
+	}
+}
+
+
+void
+TeCreateSubTrees(TeSTElementSet* objects, TeMSTGraph& Min_Tree, int num_regioes)
+{ 
+	double	SSA1 = 0., SSA2 = 0., SSTO = 0.;
+	TeMSTGraph::iterator it1 = Min_Tree.begin();
+	TeMSTGraph::iterator it2 = Min_Tree.begin();
+	TeMSTGraph::iterator itMax = Min_Tree.begin();
+	
+	vector<string> subtree_vertexes_1, subtree1;
+	vector<string> subtree_vertexes_2, subtree2;
+
+	int attributes_number = objects->begin()->getPropertyVector().size();
+
+	//estruturas para armazenar estatisticas
+	vector <double> sum1(attributes_number, 0.);
+	vector <double> sum2(attributes_number, 0.);
+	vector <double> total_sum(attributes_number, 0.);
+	vector <double> mean1(attributes_number, 0.);
+	vector <double> mean2(attributes_number, 0.);
+	vector <double> global_mean(attributes_number, 0.);
+
+	//pegar os atributos e colocar em um map
+	map<string, vector<double> >  attrObjects;
+	TeSTElementSet::iterator attrIt =  objects->begin();
+	while(attrIt!=objects->end())
+	{
+		vector<double> attrs;
+		for(int i=0; i<attributes_number; ++i)
+			attrs.push_back(atof((*attrIt).getPropertyVector()[i].value_.c_str()));
+		attrObjects[(*attrIt).objectId()]=attrs;
+
+		++attrIt;
+	}
+	
+	// h� necessidade de zerar o slice!
+	for (int regiao = 1; regiao < num_regioes; regiao++)
+	{
+		double link_cost = 0.;
+		TeMSTGraphLink bigest_cost("","",0.); 
+		int contagem = 0;
+		it1 = Min_Tree.begin();
+		while (it1 != Min_Tree.end())
+		{
+			TeMSTGraph MT_copy;
+			 
+			string GeoId1 = it1->GeoId1_;
+			string GeoId2 = it1->GeoId2_;
+			subtree_vertexes_1.clear();			
+			subtree_vertexes_2.clear();
+
+			//estruturas para armazenar as estat�sticas
+			fill(sum1.begin(), sum1.end(), 0.);
+			fill(sum2.begin(), sum2.end(), 0.);
+			fill(total_sum.begin(), total_sum.end(), 0.);
+			fill(mean1.begin(), mean1.end(), 0.);
+			fill(mean2.begin(), mean2.end(), 0.);
+			fill(global_mean.begin(), global_mean.end(), 0.);
+
+			subtree_vertexes_1.push_back(GeoId1);
+			subtree_vertexes_2.push_back(GeoId2);
+			for (int i = 0; i < attributes_number  ; ++i)
+			{
+                sum1[i] += attrObjects[GeoId1][i];
+				sum2[i] += attrObjects[GeoId2][i];
+			}
+
+			string new_vertixe;
+
+			unsigned int actual_vert = 0;
+			bool new_v = false;
+
+			//percorre o primeiro vetor
+			while (actual_vert < subtree_vertexes_1.size())
+			{
+				it2 = Min_Tree.begin();
+				new_v = false; //verificar a posi��o desse
+				while (it2 != Min_Tree.end())
+				{
+					if ((subtree_vertexes_1[actual_vert] == it2->GeoId1_) && 
+						(subtree_vertexes_2[0] != it2->GeoId2_ ))
+					{
+						new_vertixe = it2->GeoId2_; 
+						new_v = true;
+					} 
+					else if ((subtree_vertexes_1[actual_vert] == it2->GeoId2_) && 
+						(subtree_vertexes_2[0] != it2->GeoId1_ ))
+					{
+						new_vertixe = it2->GeoId1_; 
+						new_v = true;
+					}
+					if ((new_v) && (find(subtree_vertexes_1.begin(), subtree_vertexes_1.end(), new_vertixe) == subtree_vertexes_1.end()))
+					{
+							subtree_vertexes_1.push_back(new_vertixe);
+							//pegar a soma
+							for (int i = 0; i < attributes_number  ; ++i)
+								sum1[i] += attrObjects[new_vertixe][i];
+					}
+					++it2;
+				}
+				actual_vert++;
+			}
+
+			actual_vert = 0;
+			while (actual_vert < subtree_vertexes_2.size())
+			{
+				it2 = Min_Tree.begin();
+				new_v = false;
+
+				while (it2 != Min_Tree.end())
+				{
+					if ((subtree_vertexes_2[actual_vert] == it2->GeoId1_) && 
+						(subtree_vertexes_1[0] != it2->GeoId2_ ))
+					{
+						new_vertixe = it2->GeoId2_; new_v = true;
+					} else if ((subtree_vertexes_2[actual_vert] == it2->GeoId2_) && 
+						(subtree_vertexes_1[0] != it2->GeoId1_ ))
+					{
+						new_vertixe = it2->GeoId1_; new_v = true;
+					}
+					if ((new_v) && (find(subtree_vertexes_2.begin(), subtree_vertexes_2.end(), new_vertixe) == subtree_vertexes_2.end()))
+					{
+							subtree_vertexes_2.push_back(new_vertixe);
+							//pegar a soma
+							for (int i = 0; i < attributes_number  ; ++i)
+								sum2[i] += attrObjects[new_vertixe][i];
+					}
+					++it2;
+				}
+				++actual_vert;
+			}				
+
+			//-----------------------------------------------------------
+			//Calcular o vetor m�dia
+			int tam1 = subtree_vertexes_1.size();
+			int tam2 = subtree_vertexes_2.size();
+			
+			for (int k = 0; k < attributes_number ; k++)
+				total_sum[k] = sum1[k] + sum2[k];
+			
+			for (int j = 0; j < attributes_number ; j++)
+			{
+				 mean1[j] = sum1[j]/tam1; 
+				 mean2[j] =	sum2[j]/tam2;
+				 global_mean[j] = total_sum[j]/(tam1+tam2);
+			}			
+
+			// Calculo do SSTO e SSA's		
+			double SSA1 = 0.; SSA2 = 0.; SSTO = 0.; 
+			double desvio1 = 0., desvio2 = 0., desvioGlobal = 0.;
+			double valor = 0.;
+			vector<string>::iterator it_s = subtree_vertexes_1.begin();
+			while ( it_s != subtree_vertexes_1.end() ) //calcula desvio dos atributos dos objetos que est�o no vetor 1
+			{
+				for (int i=0; i<attributes_number; i++)
+				{
+					valor = attrObjects[(*it_s).c_str()][i];
+					desvio1 = valor - mean1[i];
+					desvioGlobal = valor - global_mean[i];
+					SSA1 += desvio1*desvio1;
+					SSTO += desvioGlobal*desvioGlobal;
+				}
+				++it_s;
+			}
+
+			it_s = subtree_vertexes_2.begin();
+			while ( it_s != subtree_vertexes_2.end() )  //calcula desvio dos atributos dos objetos que est�o no vetor 2
+			{
+				for (int i=0; i<attributes_number; i++)
+				{
+					valor = attrObjects[(*it_s).c_str()][i];
+					desvio2 = valor - mean2[i];
+					desvioGlobal = valor - global_mean[i];
+					SSA2 += desvio2*desvio2;
+					SSTO += desvioGlobal*desvioGlobal;
+				}
+				++it_s;
+			}
+			
+			// Calculo do custo de aresta
+			double link_cost = SSTO - SSA1 - SSA2;
+
+			if (link_cost > bigest_cost.Dissimilarity_)
+			{
+				bigest_cost.Dissimilarity_ = link_cost;
+				bigest_cost.GeoId1_= GeoId1;
+				bigest_cost.GeoId2_= GeoId2;
+				subtree1 = subtree_vertexes_1;
+				subtree2 = subtree_vertexes_2;
+				itMax = it1; //armazena o iterator para o n� mais caro
+			}
+
+			++it1;
+		}
+		// excluir link
+		string teste1 = itMax->GeoId1_;
+		string teste2 = itMax->GeoId2_;
+		Min_Tree.erase(itMax);
+
+		// atualizar slice
+		vector<string>::iterator it_s = subtree2.begin();
+		int contador = 0;
+		while (it_s != subtree2.end())
+		{
+			TeSTInstance* st = objects->getSTInstance((*it_s).c_str());
+			if(st)
+				st->slice (regiao);
+			it_s++;
+			contador++;
+		}
+	}
 }
\ No newline at end of file
diff --git a/src/terralib/stat/TeTreeMinimum.h b/src/terralib/stat/TeTreeMinimum.h
old mode 100755
new mode 100644
index 168cf17..6c6953b
--- a/src/terralib/stat/TeTreeMinimum.h
+++ b/src/terralib/stat/TeTreeMinimum.h
@@ -1,88 +1,88 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-/*! \file TeTreeMinimum.h
-    This file contains functions related to the Tree Minimum clustering algorithm
-*/
-#ifndef  __TERRALIB_INTERNAL_TREEMINIMUM_H
-#define  __TERRALIB_INTERNAL_TREEMINIMUM_H
-
-#include <vector>
-#include <map>
-#include <string>
-
-class TeSTElementSet;
-class TeGeneralizedProxMatrix;
-
-using namespace std;
-
-class TeMSTGraphLink
-{
-public:
-	string GeoId1_;
-	string GeoId2_;
-	double Dissimilarity_;
-
-	~TeMSTGraphLink()
-	{}
-
-
-	TeMSTGraphLink() :
-		GeoId1_(""),
-		GeoId2_("")
-	{}
-
-	TeMSTGraphLink(const string& GeoId1, const string& GeoId2):
-		GeoId1_(GeoId1),
-		GeoId2_(GeoId2)
-	{}
-
-	TeMSTGraphLink(const string& GeoId1, const string& GeoId2, const double Dissimilarity)  :
-		GeoId1_(GeoId1),
-		GeoId2_(GeoId2),
-		Dissimilarity_(Dissimilarity)
-	{}
-
- 
-	void set_Dissimilatiry (const double Dissimilarity)
-	{	Dissimilarity_ = Dissimilarity;	}
-
-	bool compare_dissimilarity(const TeMSTGraphLink& graph_link1, const TeMSTGraphLink& graph_link2);
-};
-
-
-
-typedef vector<TeMSTGraphLink> TeMSTGraph;
-
-typedef map<string,TeMSTGraph> TeMSTMatrix;
-
-//! Calcula a dissimilaridade entre os vizinhos e gera um grafo de dissimilaridade 
-void TeCreateDissMatrix (TeSTElementSet* Objects, TeGeneralizedProxMatrix* proxMatrix, TeMSTMatrix& mat_diss, double& Diss_max);
-
-//! Gera a �rvore m�nima
-void TeCreateMinimumTree (TeSTElementSet* Objects, TeMSTMatrix& DissMatrix, TeMSTGraph& Min_Tree, double Diss_max);
-
-//! Divide a �rvore m�nima em sub �rvores regionalizadas
-void TeCreateSubTrees(TeSTElementSet* objects, TeMSTGraph& Min_Tree, int num_regioes);
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+/*! \file TeTreeMinimum.h
+    This file contains functions related to the Tree Minimum clustering algorithm
+*/
+#ifndef  __TERRALIB_INTERNAL_TREEMINIMUM_H
+#define  __TERRALIB_INTERNAL_TREEMINIMUM_H
+
+#include <vector>
+#include <map>
+#include <string>
+
+class TeSTElementSet;
+class TeGeneralizedProxMatrix;
+
+using namespace std;
+
+class TeMSTGraphLink
+{
+public:
+	string GeoId1_;
+	string GeoId2_;
+	double Dissimilarity_;
+
+	~TeMSTGraphLink()
+	{}
+
+
+	TeMSTGraphLink() :
+		GeoId1_(""),
+		GeoId2_("")
+	{}
+
+	TeMSTGraphLink(const string& GeoId1, const string& GeoId2):
+		GeoId1_(GeoId1),
+		GeoId2_(GeoId2)
+	{}
+
+	TeMSTGraphLink(const string& GeoId1, const string& GeoId2, const double Dissimilarity)  :
+		GeoId1_(GeoId1),
+		GeoId2_(GeoId2),
+		Dissimilarity_(Dissimilarity)
+	{}
+
+ 
+	void set_Dissimilatiry (const double Dissimilarity)
+	{	Dissimilarity_ = Dissimilarity;	}
+
+	bool compare_dissimilarity(const TeMSTGraphLink& graph_link1, const TeMSTGraphLink& graph_link2);
+};
+
+
+
+typedef vector<TeMSTGraphLink> TeMSTGraph;
+
+typedef map<string,TeMSTGraph> TeMSTMatrix;
+
+//! Calcula a dissimilaridade entre os vizinhos e gera um grafo de dissimilaridade 
+void TeCreateDissMatrix (TeSTElementSet* Objects, TeGeneralizedProxMatrix* proxMatrix, TeMSTMatrix& mat_diss, double& Diss_max);
+
+//! Gera a �rvore m�nima
+void TeCreateMinimumTree (TeSTElementSet* Objects, TeMSTMatrix& DissMatrix, TeMSTGraph& Min_Tree, double Diss_max);
+
+//! Divide a �rvore m�nima em sub �rvores regionalizadas
+void TeCreateSubTrees(TeSTElementSet* objects, TeMSTGraph& Min_Tree, int num_regioes);
+
 #endif
\ No newline at end of file
diff --git a/src/terralib/stat/erro.h b/src/terralib/stat/erro.h
old mode 100755
new mode 100644
index 80ca0b6..7bcb521
--- a/src/terralib/stat/erro.h
+++ b/src/terralib/stat/erro.h
@@ -1,6 +1,6 @@
-#ifndef ErroH
-#define ErroH
-#include <stdlib.h>
-#include <stdio.h>
-#define FatalError(x) {printf("%s\n", x); exit(0);}
-#endif
+#ifndef ErroH
+#define ErroH
+#include <stdlib.h>
+#include <stdio.h>
+#define FatalError(x) {printf("%s\n", x); exit(0);}
+#endif
diff --git a/src/terralib/stat/filaDouble.cpp b/src/terralib/stat/filaDouble.cpp
old mode 100755
new mode 100644
index 0448d34..6fa89b2
--- a/src/terralib/stat/filaDouble.cpp
+++ b/src/terralib/stat/filaDouble.cpp
@@ -1,58 +1,58 @@
-//---------------------------------------------------------------------------
-#include <stdlib.h>
-#include "erro.h"
-#ifdef WIN32
-#pragma hdrstop
-#endif
-
-#include "filaDouble.h"
-TFilaDouble::TFilaDouble(){
-     mFila = (Fila_ptr) malloc(sizeof(Fila_t));
-     if (!mFila) FatalError("Mem�ria FilaInt");
-     mFila->Head = NULL;
-     mFila->Tail = NULL;
-     mFila->Size = 0;
-}
-//---------------------------------------------------------------------------
-TFilaDouble::~TFilaDouble(){
- delete mFila;
-}
-//---------------------------------------------------------------------------
-void TFilaDouble::Insere(double Item){
-   Item_ptr novo;
-
-    novo=(Item_ptr) malloc(sizeof(Item_t));
-    if (!novo){
-        FatalError("Falta de mem�ria!");
-    }
-    novo->Item = Item;
-    novo->Proximo = NULL;
-    if(mFila->Size)
-      mFila->Tail->Proximo = novo;
-    else
-      mFila->Head = novo;
-    mFila->Tail = novo;
-    (mFila->Size)++;
-}
-//---------------------------------------------------------------------------
-double  TFilaDouble::Retira(){
-  Item_ptr Aux;
-  double i;
-
-  if(!mFila->Size) {
-    FatalError("Tirando de Fila Vazia!");
-  }
-
-  Aux = mFila->Head;
-  i=Aux->Item;
-  mFila->Head = mFila->Head->Proximo;
-  if (mFila->Size == 1) mFila->Tail = NULL;
-  (mFila->Size)--;
-  free(Aux);
-  return i;
-}
-//---------------------------------------------------------------------------
-int  TFilaDouble::GetSize(){
- return mFila->Size;
-}
-
+//---------------------------------------------------------------------------
+#include <stdlib.h>
+#include "erro.h"
+#ifdef WIN32
+#pragma hdrstop
+#endif
+
+#include "filaDouble.h"
+TFilaDouble::TFilaDouble(){
+     mFila = (Fila_ptr) malloc(sizeof(Fila_t));
+     if (!mFila) FatalError("Mem�ria FilaInt");
+     mFila->Head = NULL;
+     mFila->Tail = NULL;
+     mFila->Size = 0;
+}
+//---------------------------------------------------------------------------
+TFilaDouble::~TFilaDouble(){
+ delete mFila;
+}
+//---------------------------------------------------------------------------
+void TFilaDouble::Insere(double Item){
+   Item_ptr novo;
+
+    novo=(Item_ptr) malloc(sizeof(Item_t));
+    if (!novo){
+        FatalError("Falta de mem�ria!");
+    }
+    novo->Item = Item;
+    novo->Proximo = NULL;
+    if(mFila->Size)
+      mFila->Tail->Proximo = novo;
+    else
+      mFila->Head = novo;
+    mFila->Tail = novo;
+    (mFila->Size)++;
+}
+//---------------------------------------------------------------------------
+double  TFilaDouble::Retira(){
+  Item_ptr Aux;
+  double i;
+
+  if(!mFila->Size) {
+    FatalError("Tirando de Fila Vazia!");
+  }
+
+  Aux = mFila->Head;
+  i=Aux->Item;
+  mFila->Head = mFila->Head->Proximo;
+  if (mFila->Size == 1) mFila->Tail = NULL;
+  (mFila->Size)--;
+  free(Aux);
+  return i;
+}
+//---------------------------------------------------------------------------
+int  TFilaDouble::GetSize(){
+ return mFila->Size;
+}
+
diff --git a/src/terralib/stat/filaDouble.h b/src/terralib/stat/filaDouble.h
old mode 100755
new mode 100644
index 9275dbd..11e68d9
--- a/src/terralib/stat/filaDouble.h
+++ b/src/terralib/stat/filaDouble.h
@@ -1,30 +1,30 @@
-//---------------------------------------------------------------------------
-#ifndef FilaDoubleH
-#define FilaDoubleH
-
-#include "TeStatDefines.h"
-
-class STAT_DLL TFilaDouble {
-  private:
-    typedef struct it {
-      double Item;
-      struct it *Proximo;
-    }Item_t,*Item_ptr;
-
-    typedef struct Fila {
-      Item_ptr Head;
-      Item_ptr Tail;
-      int Size;
-    }Fila_t,*Fila_ptr;
-    Fila_ptr mFila;
-   int  GetSize();
-public:
-  TFilaDouble();
-  ~TFilaDouble();
-  void Insere(double);
-  double  Retira();
-  int Size() {return GetSize();}
-};
-
-//---------------------------------------------------------------------------
-#endif
+//---------------------------------------------------------------------------
+#ifndef FilaDoubleH
+#define FilaDoubleH
+
+#include "TeStatDefines.h"
+
+class STAT_DLL TFilaDouble {
+  private:
+    typedef struct it {
+      double Item;
+      struct it *Proximo;
+    }Item_t,*Item_ptr;
+
+    typedef struct Fila {
+      Item_ptr Head;
+      Item_ptr Tail;
+      int Size;
+    }Fila_t,*Fila_ptr;
+    Fila_ptr mFila;
+   int  GetSize();
+public:
+  TFilaDouble();
+  ~TFilaDouble();
+  void Insere(double);
+  double  Retira();
+  int Size() {return GetSize();}
+};
+
+//---------------------------------------------------------------------------
+#endif
diff --git a/src/terralib/stat/filaInt.cpp b/src/terralib/stat/filaInt.cpp
old mode 100755
new mode 100644
index 6fc1012..cc947c8
--- a/src/terralib/stat/filaInt.cpp
+++ b/src/terralib/stat/filaInt.cpp
@@ -1,58 +1,58 @@
-//---------------------------------------------------------------------------
-#include <stdlib.h>
-#ifdef WIN32
-#pragma hdrstop
-#endif
-
-#include "erro.h"
-#include "filaInt.h"
-TFilaInt::TFilaInt(){
-     mFila = (Fila_ptr) malloc(sizeof(Fila_t));
-     if (!mFila) FatalError("Mem�ria FilaInt");
-     mFila->Head = NULL;
-     mFila->Tail = NULL;
-     mFila->Size = 0;
-}
-//---------------------------------------------------------------------------
-TFilaInt::~TFilaInt(){
- delete mFila;
-}
-//---------------------------------------------------------------------------
-void  TFilaInt::Insere(int Raiz){
-   Item_ptr novo;
-
-    novo=(Item_ptr) malloc(sizeof(Item_t));
-    if (!novo){
-       FatalError("Falta de mem�ria!");
-    }
-    novo->Raiz = Raiz;
-    novo->Proximo = NULL;
-    if(mFila->Size)
-      mFila->Tail->Proximo = novo;
-    else
-      mFila->Head = novo;
-    mFila->Tail = novo;
-    (mFila->Size)++;
-}
-//---------------------------------------------------------------------------
-int  TFilaInt::Retira(){
-  Item_ptr Aux;
-  int i;
-
-  if(!mFila->Size) {
-    FatalError("Tirando de Fila Vazia!");
-  }
-
-  Aux = mFila->Head;
-  i=Aux->Raiz;
-  mFila->Head = mFila->Head->Proximo;
-  if (mFila->Size == 1) mFila->Tail = NULL;
-  (mFila->Size)--;
-  free(Aux);
-  return i;
-}
-//---------------------------------------------------------------------------
-int  TFilaInt::GetSize(){
- return mFila->Size;
-}
-
+//---------------------------------------------------------------------------
+#include <stdlib.h>
+#ifdef WIN32
+#pragma hdrstop
+#endif
+
+#include "erro.h"
+#include "filaInt.h"
+TFilaInt::TFilaInt(){
+     mFila = (Fila_ptr) malloc(sizeof(Fila_t));
+     if (!mFila) FatalError("Mem�ria FilaInt");
+     mFila->Head = NULL;
+     mFila->Tail = NULL;
+     mFila->Size = 0;
+}
+//---------------------------------------------------------------------------
+TFilaInt::~TFilaInt(){
+ delete mFila;
+}
+//---------------------------------------------------------------------------
+void  TFilaInt::Insere(int Raiz){
+   Item_ptr novo;
+
+    novo=(Item_ptr) malloc(sizeof(Item_t));
+    if (!novo){
+       FatalError("Falta de mem�ria!");
+    }
+    novo->Raiz = Raiz;
+    novo->Proximo = NULL;
+    if(mFila->Size)
+      mFila->Tail->Proximo = novo;
+    else
+      mFila->Head = novo;
+    mFila->Tail = novo;
+    (mFila->Size)++;
+}
+//---------------------------------------------------------------------------
+int  TFilaInt::Retira(){
+  Item_ptr Aux;
+  int i;
+
+  if(!mFila->Size) {
+    FatalError("Tirando de Fila Vazia!");
+  }
+
+  Aux = mFila->Head;
+  i=Aux->Raiz;
+  mFila->Head = mFila->Head->Proximo;
+  if (mFila->Size == 1) mFila->Tail = NULL;
+  (mFila->Size)--;
+  free(Aux);
+  return i;
+}
+//---------------------------------------------------------------------------
+int  TFilaInt::GetSize(){
+ return mFila->Size;
+}
+
diff --git a/src/terralib/stat/filaInt.h b/src/terralib/stat/filaInt.h
old mode 100755
new mode 100644
index 4812883..07fca89
--- a/src/terralib/stat/filaInt.h
+++ b/src/terralib/stat/filaInt.h
@@ -1,31 +1,31 @@
-//---------------------------------------------------------------------------
-#ifndef FilaIntH
-#define FilaIntH
-
-#include "TeStatDefines.h"
-
-class STAT_DLL TFilaInt 
-{
-  private:
-    typedef struct it {
-      int Raiz;
-      struct it *Proximo;
-    }Item_t,*Item_ptr;
-
-    typedef struct Fila {
-      Item_ptr Head;
-      Item_ptr Tail;
-      int Size;
-    }Fila_t,*Fila_ptr;
-    Fila_ptr mFila;
-   int  GetSize();
-public:
-  TFilaInt();
-  ~TFilaInt();
-  void  Insere(int);
-  int  Retira();
-  int Size() {return GetSize();}
-};
-
-//---------------------------------------------------------------------------
-#endif
+//---------------------------------------------------------------------------
+#ifndef FilaIntH
+#define FilaIntH
+
+#include "TeStatDefines.h"
+
+class STAT_DLL TFilaInt 
+{
+  private:
+    typedef struct it {
+      int Raiz;
+      struct it *Proximo;
+    }Item_t,*Item_ptr;
+
+    typedef struct Fila {
+      Item_ptr Head;
+      Item_ptr Tail;
+      int Size;
+    }Fila_t,*Fila_ptr;
+    Fila_ptr mFila;
+   int  GetSize();
+public:
+  TFilaInt();
+  ~TFilaInt();
+  void  Insere(int);
+  int  Retira();
+  int Size() {return GetSize();}
+};
+
+//---------------------------------------------------------------------------
+#endif
diff --git a/src/terralib/stat/filaR.cpp b/src/terralib/stat/filaR.cpp
old mode 100755
new mode 100644
index f023f93..5860581
--- a/src/terralib/stat/filaR.cpp
+++ b/src/terralib/stat/filaR.cpp
@@ -1,79 +1,79 @@
-//---------------------------------------------------------------------------
-#include <stdlib.h>
-#ifdef WIN32
-#pragma hdrstop
-#endif
-
-#include "filaR.h"
-#include "erro.h"
-
-TFilaR::TFilaR(){
-     mFila = (Fila_ptr) malloc(sizeof(Fila_t));
-     if (!mFila) FatalError("Mem�ria FilaR");
-     mFila->Head = NULL;
-     mFila->Next = NULL;
-     mFila->Atual = NULL;
-     mFila->Size = 0;
-}
-//---------------------------------------------------------------------------
-TFilaR::~TFilaR(){
- delete mFila;
-}
-//---------------------------------------------------------------------------
-void  TFilaR::Insere(int Raiz,double Desvio,long Populacao){
-   Item_ptr novo;
-
-    novo=(Item_ptr) malloc(sizeof(Item_t));
-    if (!novo) {
-      FatalError("Falta de mem�ria!");
-    }
-    novo->Raiz = Raiz;
-    novo->Desvio = Desvio;
-    novo->Queda = 0;
-    novo->Populacao = Populacao;
-    novo->Proximo = mFila->Head;
-
-    mFila->Head = novo;
-    mFila->Atual = novo;
-    mFila->Next = novo;
-    (mFila->Size)++;
-}
-//---------------------------------------------------------------------------
-void  TFilaR::Retira(int Raiz){
-  Item_ptr Aux,Prev;
-
-  if(!mFila->Size) {
-    FatalError("Fila Vazia!");
-  }
-
-  Aux = mFila->Head;
-  if(Aux->Raiz == Raiz) {
-    mFila->Head = Aux->Proximo;
-    (mFila->Size)--;
-  } else {
-     while (Aux && Aux->Raiz != Raiz){
-       Prev = Aux;
-       Aux = Aux->Proximo;
-     }
-     Prev->Proximo = Aux->Proximo;
-     (mFila->Size)--;
-     free(Aux);
-  }
-  mFila->Atual = mFila->Head;
-  mFila->Next = mFila->Head;
-}
-//---------------------------------------------------------------------------
-int  TFilaR::Proximo(){
-  int i;
-  if(!mFila->Next) {
-    mFila->Next = mFila->Head;
-    mFila->Atual = mFila->Head;
-    return -1;
-  }
-  i = mFila->Next->Raiz;
-  mFila->Atual = mFila->Next;
-  mFila->Next = mFila->Next->Proximo;
-  return i;
-}
-//---------------------------------------------------------------------------
-
+//---------------------------------------------------------------------------
+#include <stdlib.h>
+#ifdef WIN32
+#pragma hdrstop
+#endif
+
+#include "filaR.h"
+#include "erro.h"
+
+TFilaR::TFilaR(){
+     mFila = (Fila_ptr) malloc(sizeof(Fila_t));
+     if (!mFila) FatalError("Mem�ria FilaR");
+     mFila->Head = NULL;
+     mFila->Next = NULL;
+     mFila->Atual = NULL;
+     mFila->Size = 0;
+}
+//---------------------------------------------------------------------------
+TFilaR::~TFilaR(){
+ delete mFila;
+}
+//---------------------------------------------------------------------------
+void  TFilaR::Insere(int Raiz,double Desvio,long Populacao){
+   Item_ptr novo;
+
+    novo=(Item_ptr) malloc(sizeof(Item_t));
+    if (!novo) {
+      FatalError("Falta de mem�ria!");
+    }
+    novo->Raiz = Raiz;
+    novo->Desvio = Desvio;
+    novo->Queda = 0;
+    novo->Populacao = Populacao;
+    novo->Proximo = mFila->Head;
+
+    mFila->Head = novo;
+    mFila->Atual = novo;
+    mFila->Next = novo;
+    (mFila->Size)++;
+}
+//---------------------------------------------------------------------------
+void  TFilaR::Retira(int Raiz){
+  Item_ptr Aux,Prev;
+
+  if(!mFila->Size) {
+    FatalError("Fila Vazia!");
+  }
+
+  Aux = mFila->Head;
+  if(Aux->Raiz == Raiz) {
+    mFila->Head = Aux->Proximo;
+    (mFila->Size)--;
+  } else {
+     while (Aux && Aux->Raiz != Raiz){
+       Prev = Aux;
+       Aux = Aux->Proximo;
+     }
+     Prev->Proximo = Aux->Proximo;
+     (mFila->Size)--;
+     free(Aux);
+  }
+  mFila->Atual = mFila->Head;
+  mFila->Next = mFila->Head;
+}
+//---------------------------------------------------------------------------
+int  TFilaR::Proximo(){
+  int i;
+  if(!mFila->Next) {
+    mFila->Next = mFila->Head;
+    mFila->Atual = mFila->Head;
+    return -1;
+  }
+  i = mFila->Next->Raiz;
+  mFila->Atual = mFila->Next;
+  mFila->Next = mFila->Next->Proximo;
+  return i;
+}
+//---------------------------------------------------------------------------
+
diff --git a/src/terralib/stat/filaR.h b/src/terralib/stat/filaR.h
old mode 100755
new mode 100644
index 26b0ce4..4960e61
--- a/src/terralib/stat/filaR.h
+++ b/src/terralib/stat/filaR.h
@@ -1,38 +1,38 @@
-//---------------------------------------------------------------------------
-#ifndef FilaRH
-#define FilaRH
-
-#include "TeStatDefines.h"
-
-class STAT_DLL TFilaR {
-public:
-    typedef struct Item {
-      int Raiz; // Indice no vetor da raiz do grupamento
-      double Centro_X,Centro_Y; // Centroide do grupamento
-      int Num_Areas; // Numero de areas dentro do grupamento
-      double Desvio; // Desvio dentro do grupamento
-      double Queda; // Quanto cai o desvio com uma particao
-      double D1,D2; // desvio nos dois grupos gerados
-      int R1,R2; // Indice no vetor das raizes dos grupos gerados
-      long P1,P2; // populacao nos grupos gerados
-      long Populacao; // Populacao do grupamento
-      struct Item *Proximo; // Proximo item na lista de raizes
-    }Item_t,*Item_ptr;
-
-    typedef struct Fila {
-      Item_ptr Head;
-      int Size;
-      Item_ptr Atual;// Utilizado para acesso aos dados
-      Item_ptr Next; //Para Pesquisa
-    }Fila_t,*Fila_ptr;
-
-  Fila_ptr mFila;
-  
-  TFilaR();
-  ~TFilaR();
-  void  Insere(int,double,long);
-  void  Retira(int);
-  int  Proximo();
-};
-//---------------------------------------------------------------------------
-#endif
+//---------------------------------------------------------------------------
+#ifndef FilaRH
+#define FilaRH
+
+#include "TeStatDefines.h"
+
+class STAT_DLL TFilaR {
+public:
+    typedef struct Item {
+      int Raiz; // Indice no vetor da raiz do grupamento
+      double Centro_X,Centro_Y; // Centroide do grupamento
+      int Num_Areas; // Numero de areas dentro do grupamento
+      double Desvio; // Desvio dentro do grupamento
+      double Queda; // Quanto cai o desvio com uma particao
+      double D1,D2; // desvio nos dois grupos gerados
+      int R1,R2; // Indice no vetor das raizes dos grupos gerados
+      long P1,P2; // populacao nos grupos gerados
+      long Populacao; // Populacao do grupamento
+      struct Item *Proximo; // Proximo item na lista de raizes
+    }Item_t,*Item_ptr;
+
+    typedef struct Fila {
+      Item_ptr Head;
+      int Size;
+      Item_ptr Atual;// Utilizado para acesso aos dados
+      Item_ptr Next; //Para Pesquisa
+    }Fila_t,*Fila_ptr;
+
+  Fila_ptr mFila;
+  
+  TFilaR();
+  ~TFilaR();
+  void  Insere(int,double,long);
+  void  Retira(int);
+  int  Proximo();
+};
+//---------------------------------------------------------------------------
+#endif
diff --git a/src/terralib/stat/hash.cpp b/src/terralib/stat/hash.cpp
old mode 100755
new mode 100644
index 5ed036a..272eabf
--- a/src/terralib/stat/hash.cpp
+++ b/src/terralib/stat/hash.cpp
@@ -1,59 +1,59 @@
-/*
-DO NOT USE!
-This is a DEPRECATED file not used anymore in any part of the statics library
-used by TerraLib. Its being kept for compatibility reasons and it will be removed 
-from further TerraLib distributions.
-*/
-//---------------------------------------------------------------------------
-#ifdef WIN32
-#pragma hdrstop
-#endif
-#include <stdlib.h>
-#include <stdio.h>
-#include "hash.h"
-
-THash::THash(){//Construtora
-   MyHash = new Hash_t[HASH_SIZE];
-   if(!MyHash) 
-     FatalError("Falta de mem�ria para o Hash");
-};
-
-void  THash::Insere(char* SKey,unsigned int Indice){
-  unsigned int Hash_Indice;
-  unsigned long Key;
-  Hash_ptr Novo;
-
-  sscanf(SKey,"%ld",&Key);
-
-  Novo = (Hash_ptr) malloc(sizeof(Hash_t));
-  if(!Novo) FatalError("Falta de mem�ria para o Hash");
-
-  Hash_Indice = Hash_Function(Key);
-  Novo->Next = MyHash[Hash_Indice].Next;
-  Novo->Key = Key;
-  Novo->Indice = Indice;
-  MyHash[Hash_Indice].Next = Novo;
-};
-
-unsigned int  THash::Pesquisa(const char* SKey){
-   Hash_ptr Aux;
-   unsigned int Hash_Indice;
-   unsigned long Key;
-
-   sscanf(SKey,"%ld",&Key);
-   Hash_Indice = Hash_Function(Key); //Obtem posicao no Hash
-   Aux=MyHash[Hash_Indice].Next;//Prepara para a pesquisa
-   while((Aux != NULL) && (Aux->Key != Key)) Aux=Aux->Next;//Faz a pesquisa
-
-   if (Aux == NULL) {
-    FatalError("Pesquisa no hash");
-   }
-   return Aux->Indice;//Retorna o resultado
-};
-
-unsigned int  THash::Hash_Function(unsigned long Key){
-  return Key%HASH_SIZE;
-};
-
-//---------------------------------------------------------------------------
-
+/*
+DO NOT USE!
+This is a DEPRECATED file not used anymore in any part of the statics library
+used by TerraLib. Its being kept for compatibility reasons and it will be removed 
+from further TerraLib distributions.
+*/
+//---------------------------------------------------------------------------
+#ifdef WIN32
+#pragma hdrstop
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#include "hash.h"
+
+THash::THash(){//Construtora
+   MyHash = new Hash_t[HASH_SIZE];
+   if(!MyHash) 
+     FatalError("Falta de mem�ria para o Hash");
+};
+
+void  THash::Insere(char* SKey,unsigned int Indice){
+  unsigned int Hash_Indice;
+  unsigned long Key;
+  Hash_ptr Novo;
+
+  sscanf(SKey,"%ld",&Key);
+
+  Novo = (Hash_ptr) malloc(sizeof(Hash_t));
+  if(!Novo) FatalError("Falta de mem�ria para o Hash");
+
+  Hash_Indice = Hash_Function(Key);
+  Novo->Next = MyHash[Hash_Indice].Next;
+  Novo->Key = Key;
+  Novo->Indice = Indice;
+  MyHash[Hash_Indice].Next = Novo;
+};
+
+unsigned int  THash::Pesquisa(const char* SKey){
+   Hash_ptr Aux;
+   unsigned int Hash_Indice;
+   unsigned long Key;
+
+   sscanf(SKey,"%ld",&Key);
+   Hash_Indice = Hash_Function(Key); //Obtem posicao no Hash
+   Aux=MyHash[Hash_Indice].Next;//Prepara para a pesquisa
+   while((Aux != NULL) && (Aux->Key != Key)) Aux=Aux->Next;//Faz a pesquisa
+
+   if (Aux == NULL) {
+    FatalError("Pesquisa no hash");
+   }
+   return Aux->Indice;//Retorna o resultado
+};
+
+unsigned int  THash::Hash_Function(unsigned long Key){
+  return Key%HASH_SIZE;
+};
+
+//---------------------------------------------------------------------------
+
diff --git a/src/terralib/stat/hash.h b/src/terralib/stat/hash.h
old mode 100755
new mode 100644
index 2c5e93a..1cc65ec
--- a/src/terralib/stat/hash.h
+++ b/src/terralib/stat/hash.h
@@ -1,33 +1,33 @@
-/*
-DO NOT USE!
-This is a DEPRECATED file not used anymore in any part of the statics library
-used by TerraLib. Its being kept for compatibility reasons and it will be removed 
-from further TerraLib distributions.
-*/
-
-//---------------------------------------------------------------------------
-#ifndef HashH
-#define HashH
-#define HASH_SIZE 1000
-#include "erro.h"
-class THash{
-
-/*** Area Privada ***/
-private:
-  typedef struct Hash_Type{
-     unsigned long Key;
-     unsigned int Indice;
-     struct Hash_Type *Next;
-  }Hash_t,*Hash_ptr;
-
-  Hash_ptr MyHash;
-  unsigned int  Hash_Function(unsigned long);
-
-/*** Area Publica ***/
-public:
-   THash();//Construtora
-   void  Insere(char *,unsigned int);
-   unsigned int  Pesquisa(const char *);
-};
-//---------------------------------------------------------------------------
-#endif
+/*
+DO NOT USE!
+This is a DEPRECATED file not used anymore in any part of the statics library
+used by TerraLib. Its being kept for compatibility reasons and it will be removed 
+from further TerraLib distributions.
+*/
+
+//---------------------------------------------------------------------------
+#ifndef HashH
+#define HashH
+#define HASH_SIZE 1000
+#include "erro.h"
+class THash{
+
+/*** Area Privada ***/
+private:
+  typedef struct Hash_Type{
+     unsigned long Key;
+     unsigned int Indice;
+     struct Hash_Type *Next;
+  }Hash_t,*Hash_ptr;
+
+  Hash_ptr MyHash;
+  unsigned int  Hash_Function(unsigned long);
+
+/*** Area Publica ***/
+public:
+   THash();//Construtora
+   void  Insere(char *,unsigned int);
+   unsigned int  Pesquisa(const char *);
+};
+//---------------------------------------------------------------------------
+#endif
diff --git a/src/terralib/stat/heap.cpp b/src/terralib/stat/heap.cpp
old mode 100755
new mode 100644
index d8d88b2..8d4a327
--- a/src/terralib/stat/heap.cpp
+++ b/src/terralib/stat/heap.cpp
@@ -1,125 +1,125 @@
-//---------------------------------------------------------------------------
-#include <limits.h>
-#include <stdlib.h>
-#ifdef WIN32
-#pragma hdrstop
-#endif
-
-#include "heap.h"
-#include "erro.h"
-
-
-/********* Mantem a propriedade de Heap (Para Baixo) *****/
-void  THeap::DownHeap(int i){
-   int l;// esquerda
-   int r;// direita
-
-   int max;
-   TipoHeap_t swap;
-
-   l=2*i; //filho da esquerda de i
-   r=2*i+1;// filho da direita de i
-   if ((l<=MyHeap->Size) && (MyHeap->Nos[l].Chave < MyHeap->Nos[r].Chave))
-      max=l;
-    else
-      max=i;
-   if ((r<=MyHeap->Size) && (MyHeap->Nos[r].Chave < MyHeap->Nos[max].Chave))
-      max=r;
-   if (max!=i) {
-      /* Atualiza KeyAux */
-      KeyAux[MyHeap->Nos[i].Indice] = max;
-      KeyAux[MyHeap->Nos[max].Indice] = i;
-
-      /*** Troca Heap[i] com Heap[max] ***/
-      swap = MyHeap->Nos[i];
-      MyHeap->Nos[i] = MyHeap->Nos[max];
-      MyHeap->Nos[max] = swap;
-      /***  Fim da troca *****/
-      DownHeap(max); // Continua o processo
-     };
-};
-
-/******** Mantem a propriedade de Heap (Para Cima) *********/
-void THeap::UpHeap(int i){
-  TipoHeap_t Aux;
-  int swap;
-
-  Aux = MyHeap->Nos[i];
-  /* Guarda a posicao ocupada pelo Indice[i] no Heap */
-  swap = MyHeap->Nos[i].Indice;
-
-  while (i>1 && MyHeap->Nos[i/2].Chave > Aux.Chave){
-
-     /* Atualiza a KeyAux */
-     KeyAux[MyHeap->Nos[i/2].Indice] = i;
-
-     MyHeap->Nos[i] = MyHeap->Nos[i/2];
-     i/=2;
-  };
-  MyHeap->Nos[i] = Aux;
-  /* Atualiza a posicao do KeyAux do item que subiu no Heap */
-  KeyAux[swap] = i;
-};
-
-/******** Funcao que monta o Heap a partir de um Array *****/
-void THeap::Build_Heap(){
-   int i;
-
-   for (i=(MyHeap->Size)/2;i>=1;i--)
-      THeap::DownHeap(i);
-};
-
-/******** Extrai o elemento de maior prioridade e remonta o Heap ********/
-int THeap::Extract_Min(){
-    int min;
-
-    if (MyHeap->Size<1) FatalError("Heap Vazio"); /*acrescentar mensagem de erro*/
-    min=MyHeap->Nos[1].Indice;
-
-    /** Atualiza o KeyAux do Item que foi pra frente */
-    KeyAux[MyHeap->Nos[MyHeap->Size].Indice] = 1;
-    /** Atualiza o KeyAux do Item que foi pro vinagre */
-    KeyAux[MyHeap->Nos[1].Indice] = -1;
-
-    MyHeap->Nos[1] = MyHeap->Nos[MyHeap->Size];
-
-    (MyHeap->Size)--;
-    DownHeap(1);
-    return min;
-};
-
-THeap::THeap(int Size){
-   int i;
-  /*** Inicializacao do Heap ***/
-  MyHeap = new Heap_t;
-  MyHeap->Size = Size;
-  MyHeap->Nos = (TipoHeap_ptr) malloc(sizeof(TipoHeap_t)*(MyHeap->Size+1));
-  KeyAux = (int *) malloc(sizeof(int)*Size);
-  /*** Preenchimento do Heap ***/
-  MyHeap->Nos[1].Chave = 0; // Inicializacao do nodo 1
-  MyHeap->Nos[1].Indice = 0;
-  KeyAux[0]=1;
-  for(i=2;i<=MyHeap->Size;i++) {
-    KeyAux[i-1]=i;
-    MyHeap->Nos[i].Chave = INT_MAX;
-    MyHeap->Nos[i].Indice = i-1;
-  };
-};
-
-/****************************/
- int THeap::Empty(){
-   return !(MyHeap->Size);
- };
-
-/*************************/
-double  THeap::GetKey(int Indice){
-   return MyHeap->Nos[KeyAux[Indice]].Chave;
-};
-
-/****************************/
-void  THeap::SetKey(int Indice,double NKey){
-   MyHeap->Nos[KeyAux[Indice]].Chave = NKey;
-   UpHeap(KeyAux[Indice]);
-};
-
-
+//---------------------------------------------------------------------------
+#include <limits.h>
+#include <stdlib.h>
+#ifdef WIN32
+#pragma hdrstop
+#endif
+
+#include "heap.h"
+#include "erro.h"
+
+
+/********* Mantem a propriedade de Heap (Para Baixo) *****/
+void  THeap::DownHeap(int i){
+   int l;// esquerda
+   int r;// direita
+
+   int max;
+   TipoHeap_t swap;
+
+   l=2*i; //filho da esquerda de i
+   r=2*i+1;// filho da direita de i
+   if ((l<=MyHeap->Size) && (MyHeap->Nos[l].Chave < MyHeap->Nos[r].Chave))
+      max=l;
+    else
+      max=i;
+   if ((r<=MyHeap->Size) && (MyHeap->Nos[r].Chave < MyHeap->Nos[max].Chave))
+      max=r;
+   if (max!=i) {
+      /* Atualiza KeyAux */
+      KeyAux[MyHeap->Nos[i].Indice] = max;
+      KeyAux[MyHeap->Nos[max].Indice] = i;
+
+      /*** Troca Heap[i] com Heap[max] ***/
+      swap = MyHeap->Nos[i];
+      MyHeap->Nos[i] = MyHeap->Nos[max];
+      MyHeap->Nos[max] = swap;
+      /***  Fim da troca *****/
+      DownHeap(max); // Continua o processo
+     };
+};
+
+/******** Mantem a propriedade de Heap (Para Cima) *********/
+void THeap::UpHeap(int i){
+  TipoHeap_t Aux;
+  int swap;
+
+  Aux = MyHeap->Nos[i];
+  /* Guarda a posicao ocupada pelo Indice[i] no Heap */
+  swap = MyHeap->Nos[i].Indice;
+
+  while (i>1 && MyHeap->Nos[i/2].Chave > Aux.Chave){
+
+     /* Atualiza a KeyAux */
+     KeyAux[MyHeap->Nos[i/2].Indice] = i;
+
+     MyHeap->Nos[i] = MyHeap->Nos[i/2];
+     i/=2;
+  };
+  MyHeap->Nos[i] = Aux;
+  /* Atualiza a posicao do KeyAux do item que subiu no Heap */
+  KeyAux[swap] = i;
+};
+
+/******** Funcao que monta o Heap a partir de um Array *****/
+void THeap::Build_Heap(){
+   int i;
+
+   for (i=(MyHeap->Size)/2;i>=1;i--)
+      THeap::DownHeap(i);
+};
+
+/******** Extrai o elemento de maior prioridade e remonta o Heap ********/
+int THeap::Extract_Min(){
+    int min;
+
+    if (MyHeap->Size<1) FatalError("Heap Vazio"); /*acrescentar mensagem de erro*/
+    min=MyHeap->Nos[1].Indice;
+
+    /** Atualiza o KeyAux do Item que foi pra frente */
+    KeyAux[MyHeap->Nos[MyHeap->Size].Indice] = 1;
+    /** Atualiza o KeyAux do Item que foi pro vinagre */
+    KeyAux[MyHeap->Nos[1].Indice] = -1;
+
+    MyHeap->Nos[1] = MyHeap->Nos[MyHeap->Size];
+
+    (MyHeap->Size)--;
+    DownHeap(1);
+    return min;
+};
+
+THeap::THeap(int Size){
+   int i;
+  /*** Inicializacao do Heap ***/
+  MyHeap = new Heap_t;
+  MyHeap->Size = Size;
+  MyHeap->Nos = (TipoHeap_ptr) malloc(sizeof(TipoHeap_t)*(MyHeap->Size+1));
+  KeyAux = (int *) malloc(sizeof(int)*Size);
+  /*** Preenchimento do Heap ***/
+  MyHeap->Nos[1].Chave = 0; // Inicializacao do nodo 1
+  MyHeap->Nos[1].Indice = 0;
+  KeyAux[0]=1;
+  for(i=2;i<=MyHeap->Size;i++) {
+    KeyAux[i-1]=i;
+    MyHeap->Nos[i].Chave = INT_MAX;
+    MyHeap->Nos[i].Indice = i-1;
+  };
+};
+
+/****************************/
+ int THeap::Empty(){
+   return !(MyHeap->Size);
+ };
+
+/*************************/
+double  THeap::GetKey(int Indice){
+   return MyHeap->Nos[KeyAux[Indice]].Chave;
+};
+
+/****************************/
+void  THeap::SetKey(int Indice,double NKey){
+   MyHeap->Nos[KeyAux[Indice]].Chave = NKey;
+   UpHeap(KeyAux[Indice]);
+};
+
+
diff --git a/src/terralib/stat/heap.h b/src/terralib/stat/heap.h
old mode 100755
new mode 100644
index ee69385..16b6ddd
--- a/src/terralib/stat/heap.h
+++ b/src/terralib/stat/heap.h
@@ -1,38 +1,38 @@
-//---------------------------------------------------------------------------
-#ifndef heapH
-#define heapH
-
-#include "TeStatDefines.h"
-#include "TeSkaterGrafo.h"
-//---------------------------------------------------------------------------
-class STAT_DLL THeap {
-
-/********  Area Privada  *********/
-private:
-    /* Tipo dos nos do heap */
-    typedef struct TipoHeap {
-        double Chave;
-        int Indice;
-      }TipoHeap_t,*TipoHeap_ptr;
-
-    /* Estrutura do TAD Heap : Tamanho + Vetor */
-    typedef struct Heap {
-        int Size;
-        TipoHeap_ptr Nos;
-        }Heap_t, *Heap_ptr;
-   int *KeyAux;
-   Heap_ptr MyHeap;
-   void  Build_Heap();
-   void  UpHeap(int);
-   void  DownHeap(int);
-   double  GetKey(int);
-
-/********  Area Publica  *********/
-public:
-   THeap(int);
-   double Key(int Indice) {return GetKey(Indice);}
-   void  SetKey(int,double);
-   int  Extract_Min();
-   int  Empty();
-};
-#endif
+//---------------------------------------------------------------------------
+#ifndef heapH
+#define heapH
+
+#include "TeStatDefines.h"
+#include "TeSkaterGrafo.h"
+//---------------------------------------------------------------------------
+class STAT_DLL THeap {
+
+/********  Area Privada  *********/
+private:
+    /* Tipo dos nos do heap */
+    typedef struct TipoHeap {
+        double Chave;
+        int Indice;
+      }TipoHeap_t,*TipoHeap_ptr;
+
+    /* Estrutura do TAD Heap : Tamanho + Vetor */
+    typedef struct Heap {
+        int Size;
+        TipoHeap_ptr Nos;
+        }Heap_t, *Heap_ptr;
+   int *KeyAux;
+   Heap_ptr MyHeap;
+   void  Build_Heap();
+   void  UpHeap(int);
+   void  DownHeap(int);
+   double  GetKey(int);
+
+/********  Area Publica  *********/
+public:
+   THeap(int);
+   double Key(int Indice) {return GetKey(Indice);}
+   void  SetKey(int,double);
+   int  Extract_Min();
+   int  Empty();
+};
+#endif
diff --git a/src/terralib/stat/lista.cpp b/src/terralib/stat/lista.cpp
old mode 100755
new mode 100644
index 42f8131..7fe918a
--- a/src/terralib/stat/lista.cpp
+++ b/src/terralib/stat/lista.cpp
@@ -1,117 +1,117 @@
-//---------------------------------------------------------------------------
-#include <stdlib.h>
-#include <stdio.h>
-
-#ifdef WIN32
-#pragma hdrstop
-#endif
-
-#include "lista.h"
-//---------------------------------------------------------------------------
-TListaVizinho::TListaVizinho(){
-     Lista = (Lista_ptr) malloc(sizeof(Lista_t));
-     if (!Lista) {
-       FatalError("Erro interno A1! \n Entre em contato com o desenvolvedor.");
-     };
-     Lista->Head = NULL;
-     Lista->Next = NULL;
-     Lista->NextB = NULL;
-     Lista->Size = 0;
-  };
-
-//---------------------------------------------------------------------------
-void  TListaVizinho::Insere(int indice,double peso){
-    Vizinho_ptr novo;
-
-    novo=(Vizinho_ptr) malloc(sizeof(Vizinho_t));
-    if (!novo) FatalError("Lista Erro"); /* Incluir mensagem de erro */
-
-    novo->Indice = indice;
-    novo->Peso = peso;
-    novo->Proximo = Lista->Head;
-
-    Lista->Head = novo;
-    Lista->Next=novo;
-    Lista->NextB=novo;
-    (Lista->Size)++;
-
- };
-
-//---------------------------------------------------------------------------
-void  TListaVizinho::Adjacente(int *Indice,double *Peso) 
-{
-	try
-	{
-		if(!Lista) 
-		{
-			*Indice =-1;
-			return;
-		}
-		
-		if(Lista->Size==0)
-		{ 
-			*Indice =-1;
-			return; 
-		}
-
-		if (Lista->Next) {
-		 *Indice = Lista->Next->Indice;
-		 *Peso = Lista->Next->Peso;
-		 Lista->Next=Lista->Next->Proximo;
-	   }
-	   else {
-		 *Indice = -1;
-		 Lista->Next = Lista->Head;
-	   }
-	}
-	catch(...)
-	{
-		*Indice = -1;
-		return;
-	}
- };
-
-//---------------------------------------------------------------------------
-void TListaVizinho::AdjacenteB(int *Indice,double *Peso){
-
-
-   if (Lista->NextB) {
-     *Indice = Lista->NextB->Indice;
-     *Peso = Lista->NextB->Peso;
-     Lista->NextB=Lista->NextB->Proximo;
-   }
-   else {
-     *Indice = -1;
-     Lista->NextB = Lista->Head;
-   };
- };
-
-//---------------------------------------------------------------------------
-int TListaVizinho::GetSize(){
-  return Lista->Size;
-};
-
-//---------------------------------------------------------------------------
-void TListaVizinho::Retira(int Indice){
-  Vizinho_ptr Aux,Prev;
-
-  if(!Lista->Size) {
-    FatalError("Erro interno A2! \n\nEntre em contato com o desenvolvedor.");
-  };
-
-  Aux = Lista->Head;
-  if(Aux->Indice == Indice) {
-    Lista->Head = Aux->Proximo;
-    (Lista->Size)--;
-    Lista->Next = Aux->Proximo;
-    Lista->NextB = Aux->Proximo;
-  } else {
-     Prev = Aux;
-     for(;Aux->Indice != Indice;Aux = Aux->Proximo)
-       Prev = Aux;
-     Prev->Proximo = Aux->Proximo;
-     (Lista->Size)--;
-     free(Aux);
-  };
-};
-
+//---------------------------------------------------------------------------
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifdef WIN32
+#pragma hdrstop
+#endif
+
+#include "lista.h"
+//---------------------------------------------------------------------------
+TListaVizinho::TListaVizinho(){
+     Lista = (Lista_ptr) malloc(sizeof(Lista_t));
+     if (!Lista) {
+       FatalError("Erro interno A1! \n Entre em contato com o desenvolvedor.");
+     };
+     Lista->Head = NULL;
+     Lista->Next = NULL;
+     Lista->NextB = NULL;
+     Lista->Size = 0;
+  };
+
+//---------------------------------------------------------------------------
+void  TListaVizinho::Insere(int indice,double peso){
+    Vizinho_ptr novo;
+
+    novo=(Vizinho_ptr) malloc(sizeof(Vizinho_t));
+    if (!novo) FatalError("Lista Erro"); /* Incluir mensagem de erro */
+
+    novo->Indice = indice;
+    novo->Peso = peso;
+    novo->Proximo = Lista->Head;
+
+    Lista->Head = novo;
+    Lista->Next=novo;
+    Lista->NextB=novo;
+    (Lista->Size)++;
+
+ };
+
+//---------------------------------------------------------------------------
+void  TListaVizinho::Adjacente(int *Indice,double *Peso) 
+{
+	try
+	{
+		if(!Lista) 
+		{
+			*Indice =-1;
+			return;
+		}
+		
+		if(Lista->Size==0)
+		{ 
+			*Indice =-1;
+			return; 
+		}
+
+		if (Lista->Next) {
+		 *Indice = Lista->Next->Indice;
+		 *Peso = Lista->Next->Peso;
+		 Lista->Next=Lista->Next->Proximo;
+	   }
+	   else {
+		 *Indice = -1;
+		 Lista->Next = Lista->Head;
+	   }
+	}
+	catch(...)
+	{
+		*Indice = -1;
+		return;
+	}
+ };
+
+//---------------------------------------------------------------------------
+void TListaVizinho::AdjacenteB(int *Indice,double *Peso){
+
+
+   if (Lista->NextB) {
+     *Indice = Lista->NextB->Indice;
+     *Peso = Lista->NextB->Peso;
+     Lista->NextB=Lista->NextB->Proximo;
+   }
+   else {
+     *Indice = -1;
+     Lista->NextB = Lista->Head;
+   };
+ };
+
+//---------------------------------------------------------------------------
+int TListaVizinho::GetSize(){
+  return Lista->Size;
+};
+
+//---------------------------------------------------------------------------
+void TListaVizinho::Retira(int Indice){
+  Vizinho_ptr Aux,Prev;
+
+  if(!Lista->Size) {
+    FatalError("Erro interno A2! \n\nEntre em contato com o desenvolvedor.");
+  };
+
+  Aux = Lista->Head;
+  if(Aux->Indice == Indice) {
+    Lista->Head = Aux->Proximo;
+    (Lista->Size)--;
+    Lista->Next = Aux->Proximo;
+    Lista->NextB = Aux->Proximo;
+  } else {
+     Prev = Aux;
+     for(;Aux->Indice != Indice;Aux = Aux->Proximo)
+       Prev = Aux;
+     Prev->Proximo = Aux->Proximo;
+     (Lista->Size)--;
+     free(Aux);
+  };
+};
+
diff --git a/src/terralib/stat/lista.h b/src/terralib/stat/lista.h
old mode 100755
new mode 100644
index b72745a..b410e5f
--- a/src/terralib/stat/lista.h
+++ b/src/terralib/stat/lista.h
@@ -1,33 +1,33 @@
-#ifndef ListaH
-#define ListaH
-
-#include "TeStatDefines.h"
-#include "erro.h"
-
-class STAT_DLL TListaVizinho{
-
-private:
-    typedef struct Vizinho {
-      int Indice;
-      double Peso;
-      struct Vizinho *Proximo;
-    }Vizinho_t,*Vizinho_ptr;
-
-    typedef struct ListaVizinho{
-      Vizinho_ptr Head;
-      int Size;
-      Vizinho_ptr Next; /* Utilizado para pesquisa */
-      Vizinho_ptr NextB; /* Utilizado para pesquisa e apelacao */
-      }Lista_t, *Lista_ptr;
-
-    Lista_ptr Lista;
-    int  GetSize();
-public:
-  TListaVizinho();
-  void  Insere(int,double);
-  void  Retira(int);
-  void  Adjacente(int *,double *);
-  void  AdjacenteB(int *,double *);
-  int Size;
-};
-#endif
+#ifndef ListaH
+#define ListaH
+
+#include "TeStatDefines.h"
+#include "erro.h"
+
+class STAT_DLL TListaVizinho{
+
+private:
+    typedef struct Vizinho {
+      int Indice;
+      double Peso;
+      struct Vizinho *Proximo;
+    }Vizinho_t,*Vizinho_ptr;
+
+    typedef struct ListaVizinho{
+      Vizinho_ptr Head;
+      int Size;
+      Vizinho_ptr Next; /* Utilizado para pesquisa */
+      Vizinho_ptr NextB; /* Utilizado para pesquisa e apelacao */
+      }Lista_t, *Lista_ptr;
+
+    Lista_ptr Lista;
+    int  GetSize();
+public:
+  TListaVizinho();
+  void  Insere(int,double);
+  void  Retira(int);
+  void  Adjacente(int *,double *);
+  void  AdjacenteB(int *,double *);
+  int Size;
+};
+#endif
diff --git a/src/terralib/stat/mtrand.cpp b/src/terralib/stat/mtrand.cpp
new file mode 100644
index 0000000..e6a8807
--- /dev/null
+++ b/src/terralib/stat/mtrand.cpp
@@ -0,0 +1,50 @@
+// mtrand.cpp, see include file mtrand.h for information
+
+#include "mtrand.h"
+// non-inline function definitions and static member definitions cannot
+// reside in header file because of the risk of multiple declarations
+
+// initialization of static private members
+unsigned long MTRand_int32::state[n] = {0x0UL};
+int MTRand_int32::p = 0;
+bool MTRand_int32::init = false;
+
+void MTRand_int32::gen_state() { // generate new state vector
+  for (int i = 0; i < (n - m); ++i)
+    state[i] = state[i + m] ^ twiddle(state[i], state[i + 1]);
+  for (int i = n - m; i < (n - 1); ++i)
+    state[i] = state[i + m - n] ^ twiddle(state[i], state[i + 1]);
+  state[n - 1] = state[m - 1] ^ twiddle(state[n - 1], state[0]);
+  p = 0; // reset position
+}
+
+void MTRand_int32::seed(unsigned long s) {  // init by 32 bit seed
+  state[0] = s & 0xFFFFFFFFUL; // for > 32 bit machines
+  for (int i = 1; i < n; ++i) {
+    state[i] = 1812433253UL * (state[i - 1] ^ (state[i - 1] >> 30)) + i;
+// see Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier
+// in the previous versions, MSBs of the seed affect only MSBs of the array state
+// 2002/01/09 modified by Makoto Matsumoto
+    state[i] &= 0xFFFFFFFFUL; // for > 32 bit machines
+  }
+  p = n; // force gen_state() to be called for next random number
+}
+
+void MTRand_int32::seed(const unsigned long* array, int size) { // init by array
+  seed(19650218UL);
+  int i = 1, j = 0;
+  for (int k = ((n > size) ? n : size); k; --k) {
+    state[i] = (state[i] ^ ((state[i - 1] ^ (state[i - 1] >> 30)) * 1664525UL))
+      + array[j] + j; // non linear
+    state[i] &= 0xFFFFFFFFUL; // for > 32 bit machines
+    ++j; j %= size;
+    if ((++i) == n) { state[0] = state[n - 1]; i = 1; }
+  }
+  for (int k = n - 1; k; --k) {
+    state[i] = (state[i] ^ ((state[i - 1] ^ (state[i - 1] >> 30)) * 1566083941UL)) - i;
+    state[i] &= 0xFFFFFFFFUL; // for > 32 bit machines
+    if ((++i) == n) { state[0] = state[n - 1]; i = 1; }
+  }
+  state[0] = 0x80000000UL; // MSB is 1; assuring non-zero initial array
+  p = n; // force gen_state() to be called for next random number
+}
diff --git a/src/terralib/stat/mtrand.h b/src/terralib/stat/mtrand.h
new file mode 100644
index 0000000..0f49489
--- /dev/null
+++ b/src/terralib/stat/mtrand.h
@@ -0,0 +1,153 @@
+// mtrand.h
+// C++ include file for MT19937, with initialization improved 2002/1/26.
+// Coded by Takuji Nishimura and Makoto Matsumoto.
+// Ported to C++ by Jasper Bedaux 2003/1/1 (see http://www.bedaux.net/mtrand/).
+// The generators returning floating point numbers are based on
+// a version by Isaku Wada, 2002/01/09
+//
+// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// 1. Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the distribution.
+//
+// 3. The names of its contributors may not be used to endorse or promote
+//    products derived from this software without specific prior written
+//    permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Any feedback is very welcome.
+// http://www.math.keio.ac.jp/matumoto/emt.html
+// email: matumoto at math.keio.ac.jp
+//
+// Feedback about the C++ port should be sent to Jasper Bedaux,
+// see http://www.bedaux.net/mtrand/ for e-mail address and info.
+
+#ifndef MTRAND_H
+#define MTRAND_H
+
+class MTRand_int32 { // Mersenne Twister random number generator
+public:
+// default constructor: uses default seed only if this is the first instance
+  MTRand_int32() { if (!init) seed(5489UL); init = true; }
+// constructor with 32 bit int as seed
+  MTRand_int32(unsigned long s) { seed(s); init = true; }
+// constructor with array of size 32 bit ints as seed
+  MTRand_int32(const unsigned long* array, int size) { seed(array, size); init = true; }
+// the two seed functions
+  void seed(unsigned long); // seed with 32 bit integer
+  void seed(const unsigned long*, int size); // seed with array
+// overload operator() to make this a generator (functor)
+  unsigned long operator()() { return rand_int32(); }
+// 2007-02-11: made the destructor virtual; thanks "double more" for pointing this out
+  virtual ~MTRand_int32() {} // destructor
+protected: // used by derived classes, otherwise not accessible; use the ()-operator
+  unsigned long rand_int32(); // generate 32 bit random integer
+private:
+  static const int n = 624, m = 397; // compile time constants
+// the variables below are static (no duplicates can exist)
+  static unsigned long state[n]; // state vector array
+  static int p; // position in state array
+  static bool init; // true if init function is called
+// private functions used to generate the pseudo random numbers
+  unsigned long twiddle(unsigned long, unsigned long); // used by gen_state()
+  void gen_state(); // generate new state
+// make copy constructor and assignment operator unavailable, they don't make sense
+  MTRand_int32(const MTRand_int32&); // copy constructor not defined
+  void operator=(const MTRand_int32&); // assignment operator not defined
+};
+
+// inline for speed, must therefore reside in header file
+inline unsigned long MTRand_int32::twiddle(unsigned long u, unsigned long v) {
+  return (((u & 0x80000000UL) | (v & 0x7FFFFFFFUL)) >> 1)
+    ^ ((v & 1UL) ? 0x9908B0DFUL : 0x0UL);
+}
+
+inline unsigned long MTRand_int32::rand_int32() { // generate 32 bit random int
+  if (p == n) gen_state(); // new state vector needed
+// gen_state() is split off to be non-inline, because it is only called once
+// in every 624 calls and otherwise irand() would become too big to get inlined
+  unsigned long x = state[p++];
+  x ^= (x >> 11);
+  x ^= (x << 7) & 0x9D2C5680UL;
+  x ^= (x << 15) & 0xEFC60000UL;
+  return x ^ (x >> 18);
+}
+
+// generates double floating point numbers in the half-open interval [0, 1)
+class MTRand : public MTRand_int32 {
+public:
+  MTRand() : MTRand_int32() {}
+  MTRand(unsigned long seed) : MTRand_int32(seed) {}
+  MTRand(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
+  ~MTRand() {}
+  double operator()() {
+    return static_cast<double>(rand_int32()) * (1. / 4294967296.); } // divided by 2^32
+private:
+  MTRand(const MTRand&); // copy constructor not defined
+  void operator=(const MTRand&); // assignment operator not defined
+};
+
+// generates double floating point numbers in the closed interval [0, 1]
+class MTRand_closed : public MTRand_int32 {
+public:
+  MTRand_closed() : MTRand_int32() {}
+  MTRand_closed(unsigned long seed) : MTRand_int32(seed) {}
+  MTRand_closed(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
+  ~MTRand_closed() {}
+  double operator()() {
+    return static_cast<double>(rand_int32()) * (1. / 4294967295.); } // divided by 2^32 - 1
+private:
+  MTRand_closed(const MTRand_closed&); // copy constructor not defined
+  void operator=(const MTRand_closed&); // assignment operator not defined
+};
+
+// generates double floating point numbers in the open interval (0, 1)
+class MTRand_open : public MTRand_int32 {
+public:
+  MTRand_open() : MTRand_int32() {}
+  MTRand_open(unsigned long seed) : MTRand_int32(seed) {}
+  MTRand_open(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
+  ~MTRand_open() {}
+  double operator()() {
+    return (static_cast<double>(rand_int32()) + .5) * (1. / 4294967296.); } // divided by 2^32
+private:
+  MTRand_open(const MTRand_open&); // copy constructor not defined
+  void operator=(const MTRand_open&); // assignment operator not defined
+};
+
+// generates 53 bit resolution doubles in the half-open interval [0, 1)
+class MTRand53 : public MTRand_int32 {
+public:
+  MTRand53() : MTRand_int32() {}
+  MTRand53(unsigned long seed) : MTRand_int32(seed) {}
+  MTRand53(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
+  ~MTRand53() {}
+  double operator()() {
+    return (static_cast<double>(rand_int32() >> 5) * 67108864. + 
+      static_cast<double>(rand_int32() >> 6)) * (1. / 9007199254740992.); }
+private:
+  MTRand53(const MTRand53&); // copy constructor not defined
+  void operator=(const MTRand53&); // assignment operator not defined
+};
+
+#endif // MTRAND_H
diff --git a/src/terralib/utils/TeColorUtils.cpp b/src/terralib/utils/TeColorUtils.cpp
old mode 100755
new mode 100644
index fe336d5..e1c6bcd
--- a/src/terralib/utils/TeColorUtils.cpp
+++ b/src/terralib/utils/TeColorUtils.cpp
@@ -1,750 +1,750 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-#include <TeColorUtils.h>
-#include <TeDatabase.h>
-#include <TeAsciiFile.h>
-#include <cstring>
-
-bool getColors(std::vector<std::string>& ramps, int nc, std::vector<TeColor> &colors)
-{
-	if (ramps.empty())
-		ramps.push_back("RED");
-
-	TeColor	RGB;
-	map<string, TeColor> mapcor;
-
-	RGB.name_ = "RED";
-	RGB.red_ = 240;
-	RGB.green_ = 0;
-	RGB.blue_ = 0;
-	mapcor["RED"] = RGB;
-
-	RGB.name_ = "GREEN";
-	RGB.red_ = 0;
-	RGB.green_ = 240;
-	RGB.blue_ = 0;
-	mapcor["GREEN"] = RGB;
-
-	RGB.name_ = "BLUE";
-	RGB.red_ = 0;
-	RGB.green_ = 0;
-	RGB.blue_ = 240;
-	mapcor["BLUE"] = RGB;
-
-	RGB.name_ = "YELLOW";
-	RGB.red_ = 255;
-	RGB.green_ = 255;
-	RGB.blue_ = 100;
-	mapcor["YELLOW"] = RGB;
-
-	RGB.name_ = "CYAN";
-	RGB.red_ = 100;
-	RGB.green_ = 255;
-	RGB.blue_ = 255;
-	mapcor["CYAN"] = RGB;
-
-	RGB.name_ = "MAGENTA";
-	RGB.red_ = 255;
-	RGB.green_ = 100;
-	RGB.blue_ = 255;
-	mapcor["MAGENTA"] = RGB;
-
-	RGB.name_ = "ORANGE";
-	RGB.red_ = 255;
-	RGB.green_ = 140;
-	RGB.blue_ = 0;
-	mapcor["ORANGE"] = RGB;
-
-	RGB.name_ = "GRAY";
-	RGB.red_ = 240;
-	RGB.green_ = 240;
-	RGB.blue_ = 240;
-	mapcor["GRAY"] = RGB;
-
-	RGB.name_ = "BLACK";
-	RGB.red_ = 0;
-	RGB.green_ = 0;
-	RGB.blue_ = 0;
-	mapcor["BLACK"] = RGB;
-
-	int	ii, jj;
-	int n = 200;
-	
-	TeColor cfrom = mapcor[ramps[0]];
-	TeColor	cto, cor;
-
-	vector<TeColor> allColors;
-	if (ramps.size() == 1)
-	{
-		cto.red_ = cfrom.red_ / 5;
-		cto.green_ = cfrom.green_ / 5;
-		cto.blue_ = cfrom.blue_ / 5;
-		double dr = (double)(cto.red_ - cfrom.red_) / (double)n;
-		double dg = (double)(cto.green_ - cfrom.green_) / (double)n;
-		double db = (double)(cto.blue_ - cfrom.blue_) / (double)n;
-
-		for(jj=0; jj<n; jj++)
-		{
-			cor.red_ = cfrom.red_ + (int)(dr * (double)jj);
-			cor.green_ = cfrom.green_ + (int)(dg * (double)jj);
-			cor.blue_ = cfrom.blue_ + (int)(db * (double)jj);
-			allColors.push_back(cor);
-		}
-	}
-	else
-	{
-		ii = 1;
-		while(ii < (int)ramps.size())
-		{
-			cto = mapcor[ramps[ii]];
-
-			double dr = (double)(cto.red_ - cfrom.red_) / (double)n;
-			double dg = (double)(cto.green_ - cfrom.green_) / (double)n;
-			double db = (double)(cto.blue_ - cfrom.blue_) / (double)n;
-
-			for(jj=0; jj<n; jj++)
-			{
-				cor.red_ = cfrom.red_ + (int)(dr * (double)jj);
-				cor.green_ = cfrom.green_ + (int)(dg * (double)jj);
-				cor.blue_ = cfrom.blue_ + (int)(db * (double)jj);
-				allColors.push_back(cor);
-			}
-			cfrom = cto;
-			ii++;
-		}
-	}
-	double step = 0.;
-	if (nc > 1)
-		step = (double)(allColors.size()) / (double)(nc-1);
-	for (int i=0; i<nc; i++)
-	{
-		int ind = (int)(step * (double)i + .5);
-		if (ind > (int)(allColors.size() - 1))
-			ind = allColors.size() - 1;
-		colors.push_back(allColors[ind]);
-	}
-	allColors.clear();
-	return true;
-}
-
-
-void generateColorBarMap(vector<ColorBar>& inputColorVec, int ncores, map<int, vector<TeColor> >& colorMap)
-{
-	if(inputColorVec.empty())
-	{
-		TeColor c(255, 0, 0);
-		ColorBar b;
-		b.color(c);
-//		b.distance_ = 1.;
-		b.distance_ = 0.;
-		inputColorVec.push_back(b);
-
-		c.init(60, 0, 0);
-		b.color(c);
-		b.distance_ = 1.;
-		inputColorVec.push_back(b);
-	}
-
-	int i, nc;
-	if(inputColorVec.empty())
-		return;
-
-	double totalDistance = inputColorVec[inputColorVec.size()-1].distance_;
-	double dd = (double)ncores / totalDistance;
-
-	colorMap.clear();
-	for(i=0; i<(int)inputColorVec.size()-1; ++i)
-	{
-		nc = TeRound(dd * (fabs(inputColorVec[i+1].distance_) - fabs(inputColorVec[i].distance_)));
-		TeColor corFrom, corTo;
-		hsv2Rgb(corFrom,inputColorVec[i].h_, inputColorVec[i].s_, inputColorVec[i].v_);
-		hsv2Rgb(corTo,inputColorVec[i+1].h_, inputColorVec[i+1].s_, inputColorVec[i+1].v_);
-//		TeColor corFrom = inputColorVec[i].cor_;
-//		TeColor corTo = inputColorVec[i+1].cor_;
-		colorMap[i] = getColors(corFrom, corTo, nc);
-	}
-	vector<TeColor> vv;
-	colorMap[i] = vv;
-}
-
-vector<TeColor> getColors(TeColor cfrom, TeColor cto, int nc)
-{
-	int n = 255, i, j;
-	vector<TeColor> colorVec;
-	TeColor cor;
-
-	vector<TeColor> allColors;
-	double dr = (double)(cto.red_ - cfrom.red_) / (double)n;
-	double dg = (double)(cto.green_ - cfrom.green_) / (double)n;
-	double db = (double)(cto.blue_ - cfrom.blue_) / (double)n;
-
-	for(j=0; j<n; j++)
-	{
-		cor.red_ = cfrom.red_ + (int)(dr * (double)j);
-		cor.green_ = cfrom.green_ + (int)(dg * (double)j);
-		cor.blue_ = cfrom.blue_ + (int)(db * (double)j);
-		allColors.push_back(cor);
-	}
-	double step = 0.;
-	if (nc > 1)
-		step = (double)(allColors.size()) / (double)(nc-1);
-	for (i=0; i<nc; ++i)
-	{
-		int ind = (int)(step * (double)i + .5);
-		if (ind > (int)(allColors.size() - 1))
-			ind = allColors.size() - 1;
-		colorVec.push_back(allColors[ind]);
-	}
-	allColors.clear();
-	return colorVec;
-}
-
-vector<ColorBar>  getColorBarVector(string& groupingColors, const bool& first)
-{
-	vector<ColorBar> cbVec;
-	char	buf[1000];
-	string ss;
-	TeColor	cor(255, 255, 255);
-
-	if(groupingColors.empty())
-		groupingColors = "R-";
-	if(groupingColors.size() == 1)
-		groupingColors += "-";
-
-	size_t t = groupingColors.find(";");
-	string s = groupingColors;
-
-	if(t == string::npos)
-	{
-		s += "-";
-		size_t a = s.find("-");
-
-		double dist = -1.;
-		while(a != string::npos)
-		{
-			memset(buf, '\0', 1000);
-			s.copy(buf, a);
-			ss = buf;
-
-			a++;
-			memset(buf, '\0', 1000);
-			s.copy(buf, s.size()-a, a);
-			s = buf;
-			a = s.find("-");
-
-			if("R" == ss)
-				cor.init(240, 0, 0);
-			else if("G" == ss)
-				cor.init(0, 240, 0);
-			else if("B" == ss)
-				cor.init(0, 0, 240);
-			else if("Cy" == ss)
-				cor.init(100, 255, 255);
-			else if("Or" == ss)
-				cor.init(255, 140, 0);
-			else if("Mg" == ss)
-				cor.init(255, 100, 255);
-			else if("Y" == ss)
-				cor.init(255, 255, 100);
-			else
-				cor.init(240, 240, 240);
-
-			ColorBar cb;
-			cb.color(cor);
-			dist += 1.;
-			cb.distance_ = dist;
-			cbVec.push_back(cb);
-		}
-		if(cbVec.size() == 1)
-		{
-			cor.init(cor.red_/5, cor.green_/5, cor.blue_/5);
-			ColorBar cb;
-			cb.color(cor);
-			dist += 1.;
-			cb.distance_ = dist;
-			cbVec.push_back(cb);
-		}
-	}
-	else
-	{
-		t = groupingColors.find("|");
-		if(first)
-		{
-			if(t != string::npos)
-			{
-				memset(buf, '\0', 1000);
-				s.copy(buf, t, 0);
-				s = buf;
-			}
-		}
-		else
-		{
-			if(t != string::npos)
-			{
-				memset(buf, '\0', 1000);
-				s.copy(buf, s.size()-t-1, t+1);
-				s = buf;
-			}
-			else // error
-			{
-				ColorBar cb;
-				cbVec.clear();
-				TeColor c;
-				hsv2Rgb(c, 0, 255, 255);
-				cb.color(c);
-				cb.distance_ = 0.;
-				cbVec.push_back(cb);
-				hsv2Rgb(c, 240, 255, 255);
-				cb.color(c);
-				cb.distance_ = 1.;
-				cbVec.push_back(cb);
-				return cbVec;
-			}
-		}
-
-		size_t a = s.find("-");
-
-		while(a != string::npos)
-		{
-			if(a == 0) // hue = -1
-				a = s.find("-", 1);
-			int cc = 0;
-			memset(buf, '\0', 1000);
-			s.copy(buf, a);
-			ss = buf;
-
-			a++;
-			memset(buf, '\0', 1000);
-			s.copy(buf, s.size()-a, a);
-			s = buf;
-			a = s.find("-");
-			if(a == 0) // hue = -1
-				a = s.find("-", 1);
-			
-			string sss;
-			vector<double> vVec;
-			size_t aa = ss.find(";");
-			while(aa != string::npos)
-			{
-				cc++;
-				memset(buf, '\0', 1000);
-				ss.copy(buf, aa);
-				sss = buf;
-				double v = atof(sss.c_str());
-				vVec.push_back(v);
-
-				aa++;
-				memset(buf, '\0', 1000);
-				ss.copy(buf, ss.size()-aa, aa);
-				ss = buf;
-				aa = ss.find(";");
-			}
-			ColorBar cb;
-			double brilho, dist = atof(ss.c_str());
-			cb.distance_ = dist;
-
-			if(vVec.empty()) // error in group color
-			{
-				cbVec.clear();
-				TeColor c;
-				hsv2Rgb(c, 0, 255, 255);
-				cb.color(c);
-				cb.distance_ = 0.;
-				cbVec.push_back(cb);
-				hsv2Rgb(c, 240, 255, 255);
-				cb.color(c);
-				cb.distance_ = 1.;
-				cbVec.push_back(cb);
-				return cbVec;
-			}
-
-			if(vVec.size() >= 4)
-			{
-				cor.init((int)vVec[0], (int)vVec[1], (int)vVec[2]);
-				brilho = vVec[3];
-				cb.color(cor);
-			}
-			else
-			{
-				int h = (int)vVec[0];
-				int	s = (int)vVec[1];
-				int v = (int)vVec[2];
-				TeColor c;
-				hsv2Rgb(c, h, s, v);
-				cb.color(c);
-			}
-
-			cbVec.push_back(cb);
-
-			if(a == string::npos)
-			{
-				cc = 0;
-				vVec.clear();
-				ss = s;
-				size_t aa = ss.find(";");
-				while(aa != string::npos)
-				{
-					cc++;
-					memset(buf, '\0', 1000);
-					ss.copy(buf, aa);
-					sss = buf;
-					double v = atof(sss.c_str());
-					vVec.push_back(v);
-
-					aa++;
-					memset(buf, '\0', 1000);
-					ss.copy(buf, ss.size()-aa, aa);
-					ss = buf;
-					aa = ss.find(";");
-				}
-				ColorBar cb;
-				double brilho, dist = atof(ss.c_str());
-				cb.distance_ = dist;
-
-				if(vVec.size() >= 4)
-				{
-					cor.init((int)vVec[0], (int)vVec[1], (int)vVec[2]);
-					brilho = vVec[3];
-					cb.color(cor);
-				}
-				else
-				{
-					int h = (int)vVec[0];
-					int	s = (int)vVec[1];
-					int v = (int)vVec[2];
-					TeColor c;
-					hsv2Rgb(c, h, s, v);
-					cb.color(c);
-				}
-
-				cbVec.push_back(cb);
-			}
-		}
-	}
-	return cbVec;
-}
-
-
-vector<TeColor> getColors(vector<ColorBar>& iVec, int ncores)
-{
-	vector<TeColor> cVec;
-	vector<TeColor> outVec;
-	map<int, vector<TeColor> > colorMap;
-
-	generateColorBarMap(iVec, ncores * 255, colorMap);
-
-	map<int, vector<TeColor> > :: iterator it = colorMap.begin();
-
-	while(it != colorMap.end())
-	{
-		vector<TeColor>& cores = it->second;
-		vector<TeColor> :: iterator i = cores.begin();
-
-		while(i != cores.end())
-		{
-			cVec.push_back(*i);
-			i++;
-		}
-		it++;
-	}
-
-	int s = (int)cVec.size();
-	double d, dd = (double)s /(double)(ncores-1);
-	int	i = 0, j;
-
-	while(i < ncores)
-	{
-		d = dd * (double)i;
-		j = TeRound(d);
-		if(j >= s)
-			j = s - 1;
-		if((int)cVec.size() > j)
-			outVec.push_back(cVec[j]);
-		i++;
-	}
-	return outVec;
-}
-
-string getColors(vector<ColorBar>& aVec, vector<ColorBar>& bVec, int groupingMode)
-{
-	string s, ss;
-	vector<ColorBar> colorBarVec = aVec;
-	vector<ColorBar> :: iterator it;
-
-	int r, g, b;
-	double d;
-//	double br, d;
-
-	it = colorBarVec.begin();
-	while(it != colorBarVec.end())
-	{
-		ColorBar cb = (*it);
-		TeColor cor;
-		hsv2Rgb(cor, cb.h_, cb.s_, cb.v_);
-		r = cor.red_;
-		g = cor.green_;
-		b = cor.blue_;
-		d = cb.distance_;
-
-		s += Te2String(cb.h_) + ";" + Te2String(cb.s_) + ";" + Te2String(cb.v_) + ";" + Te2String(d, 2);
-		if(s.size() > 255)
-		{
-			s = ss;
-			break;
-		}
-
-		ss = s;		
-		it++;
-		if(it != colorBarVec.end())
-			s += "-";
-	}
-
-	if(groupingMode == TeStdDeviation)
-	{
-		s += "|";
-
-		colorBarVec = bVec;
-		it = colorBarVec.begin();
-		while(it != colorBarVec.end())
-		{
-			ColorBar cb = (*it);
-			TeColor cor;
-			hsv2Rgb(cor, cb.h_, cb.s_, cb.v_);
-			r = cor.red_;
-			g = cor.green_;
-			b = cor.blue_;
-			d = cb.distance_;
-
-			s += Te2String(cb.h_) + ";" + Te2String(cb.s_) + ";" + Te2String(cb.v_) + ";" + Te2String(d, 2);
-			if(s.size() > 255)
-			{
-				s = ss;
-				break;
-			}
-
-			ss = s;		
-			it++;
-			if(it != colorBarVec.end())
-				s += "-";
-		}
-	}
-
-	return s;
-}
-
-void rgb2Hsv(const TeColor& c, int& h, int& s, int& v)
-{
-	double r = (double)(c.red_ / 255.);
-	double g = (double)(c.green_ / 255.);
-	double b = (double)(c.blue_ / 255.);
-
-	double hh, ss, vv;
-	RGBtoHSV(r, g, b, hh, ss, vv);
-
-	h = TeRound(hh);
-	s = TeRound(255. * ss);
-	v = TeRound(255. * vv);
-}
-
-// r,g,b values are from 0 to 1
-// h = [0,360], s = [0,1], v = [0,1]
-//		if s == 0, then h = -1 (undefined)
-
-void RGBtoHSV(const double& r, const double& g, const double& b, double& h, double& s, double& v )
-{
-	if(r == g && g == b) // achromatic (grey)
-	{
-		h = - 1;
-		s = 0;
-		v = r;
-		return;
-	}
-
-	double min, max, delta;
-
-	min = MIN(r, g);
-	min = MIN(min, b);
-	max = MAX(r, g);
-	max = MAX(max, b);
-	v = max;				// v
-
-	delta = max - min;
-
-	if( max != 0 )
-		s = delta / max;		// s
-	else {
-		// r = g = b = 0		// s = 0, v is undefined
-		s = 0;
-		h = -1;
-		return;
-	}
-
-	if( r == max )
-		h = ( g - b ) / delta;		// between yellow & magenta
-	else if( g == max )
-		h = 2 + ( b - r ) / delta;	// between cyan & yellow
-	else
-		h = 4 + ( r - g ) / delta;	// between magenta & cyan
-
-	h *= 60;				// degrees
-	if( h < 0 )
-		h += 360;
-
-}
-
-void hsv2Rgb(TeColor& c, const int& h, const int& s, const int& v)
-{
-	double	r, g, b;
-	double hh = (double)h;
-	double ss = (double)s / 255.;
-	double vv = (double)v / 255.;
-
-	HSVtoRGB(r, g, b, hh, ss, vv);
-
-	c.red_ = TeRound(r * 255.);
-	c.green_ = TeRound(g * 255.);
-	c.blue_ = TeRound(b * 255.);
-}
-
-void HSVtoRGB( double& r, double& g, double& b, const double& h, const double& s, const double& v )
-{
-	int i;
-	double f, p, q, t, hh = h;
-
-	if( s == 0 || h == -1) {
-		// achromatic (grey)
-		r = g = b = v;
-		return;
-	}
-
-	hh /= 60;			// sector 0 to 5
-	i = TeRound(floor(hh));
-	f = hh - i;			// factorial part of h
-	p = v * ( 1 - s );
-	q = v * ( 1 - s * f );
-	t = v * ( 1 - s * ( 1 - f ) );
-
-	switch( i ) {
-		case 0:
-			r = v;
-			g = t;
-			b = p;
-			break;
-		case 1:
-			r = q;
-			g = v;
-			b = p;
-			break;
-		case 2:
-			r = p;
-			g = v;
-			b = t;
-			break;
-		case 3:
-			r = p;
-			g = q;
-			b = v;
-			break;
-		case 4:
-			r = t;
-			g = p;
-			b = v;
-			break;
-		default:		// case 5:
-			r = v;
-			g = p;
-			b = q;
-			break;
-	}
-}
-
-
-unsigned int  TeReadColorRampTextFile(const string& fileName, map<string,string>& colorRamps)
-{
-	string name;
-	string rgb;
-	vector<string> aux;
-	double r, g, b;
-	double h, s, v;
-	unsigned int ncolors = 0;
-	unsigned int n;
-	try
-	{
-		TeAsciiFile file(fileName);
-		do
-		{
-			string ramp;
-			try 
-			{
-				name = file.readLine();
-				ncolors = file.readInt();
-				file.findNewLine();
-				for (n=0; n<ncolors-1; ++n)
-				{
-					rgb = file.readLine();
-					aux.clear();
-					TeSplitString(rgb, ",", aux);
-					TeTrim(aux[0]);
-					TeTrim(aux[1]);
-					TeTrim(aux[2]);
-					r = atof(aux[0].c_str());	
-					g = atof(aux[1].c_str());
-					b = atof(aux[2].c_str());
-					RGBtoHSV(r, g, b, h, s, v);
-	                
-					ramp += Te2String(int(h)) + ";";
-					ramp += Te2String(int(s*255.)) + ";";
-					ramp += Te2String(int(v)) + ";";
-					ramp += Te2String(n) + "-";
-				}
-				rgb = file.readLine();
-				aux.clear();
-				TeSplitString(rgb, ",", aux);
-				TeTrim(aux[0]);
-				TeTrim(aux[1]);
-				TeTrim(aux[2]);
-				r = atof(aux[0].c_str());	
-				g = atof(aux[1].c_str());
-				b = atof(aux[2].c_str());
-				RGBtoHSV(r, g, b, h, s, v);
-	            
-				ramp += Te2String(int(h)) + ";";
-				ramp += Te2String(int(s*255.)) + ";";
-				ramp += Te2String(int(v))+ ";";
-				ramp += Te2String(n);
-				++ncolors;
-				TeTrim(name);
-				colorRamps[name]=ramp;
-			}
-			catch(...)
-			{
-				break;
-			}
-		}while(true);
-	}
-	catch(...)
-	{
-		return 0;
-	}
-	return colorRamps.size();
-}
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+#include <TeColorUtils.h>
+#include <TeDatabase.h>
+#include <TeAsciiFile.h>
+#include <cstring>
+
+bool getColors(std::vector<std::string>& ramps, int nc, std::vector<TeColor> &colors)
+{
+	if (ramps.empty())
+		ramps.push_back("RED");
+
+	TeColor	RGB;
+	map<string, TeColor> mapcor;
+
+	RGB.name_ = "RED";
+	RGB.red_ = 240;
+	RGB.green_ = 0;
+	RGB.blue_ = 0;
+	mapcor["RED"] = RGB;
+
+	RGB.name_ = "GREEN";
+	RGB.red_ = 0;
+	RGB.green_ = 240;
+	RGB.blue_ = 0;
+	mapcor["GREEN"] = RGB;
+
+	RGB.name_ = "BLUE";
+	RGB.red_ = 0;
+	RGB.green_ = 0;
+	RGB.blue_ = 240;
+	mapcor["BLUE"] = RGB;
+
+	RGB.name_ = "YELLOW";
+	RGB.red_ = 255;
+	RGB.green_ = 255;
+	RGB.blue_ = 100;
+	mapcor["YELLOW"] = RGB;
+
+	RGB.name_ = "CYAN";
+	RGB.red_ = 100;
+	RGB.green_ = 255;
+	RGB.blue_ = 255;
+	mapcor["CYAN"] = RGB;
+
+	RGB.name_ = "MAGENTA";
+	RGB.red_ = 255;
+	RGB.green_ = 100;
+	RGB.blue_ = 255;
+	mapcor["MAGENTA"] = RGB;
+
+	RGB.name_ = "ORANGE";
+	RGB.red_ = 255;
+	RGB.green_ = 140;
+	RGB.blue_ = 0;
+	mapcor["ORANGE"] = RGB;
+
+	RGB.name_ = "GRAY";
+	RGB.red_ = 240;
+	RGB.green_ = 240;
+	RGB.blue_ = 240;
+	mapcor["GRAY"] = RGB;
+
+	RGB.name_ = "BLACK";
+	RGB.red_ = 0;
+	RGB.green_ = 0;
+	RGB.blue_ = 0;
+	mapcor["BLACK"] = RGB;
+
+	int	ii, jj;
+	int n = 200;
+	
+	TeColor cfrom = mapcor[ramps[0]];
+	TeColor	cto, cor;
+
+	vector<TeColor> allColors;
+	if (ramps.size() == 1)
+	{
+		cto.red_ = cfrom.red_ / 5;
+		cto.green_ = cfrom.green_ / 5;
+		cto.blue_ = cfrom.blue_ / 5;
+		double dr = (double)(cto.red_ - cfrom.red_) / (double)n;
+		double dg = (double)(cto.green_ - cfrom.green_) / (double)n;
+		double db = (double)(cto.blue_ - cfrom.blue_) / (double)n;
+
+		for(jj=0; jj<n; jj++)
+		{
+			cor.red_ = cfrom.red_ + (int)(dr * (double)jj);
+			cor.green_ = cfrom.green_ + (int)(dg * (double)jj);
+			cor.blue_ = cfrom.blue_ + (int)(db * (double)jj);
+			allColors.push_back(cor);
+		}
+	}
+	else
+	{
+		ii = 1;
+		while(ii < (int)ramps.size())
+		{
+			cto = mapcor[ramps[ii]];
+
+			double dr = (double)(cto.red_ - cfrom.red_) / (double)n;
+			double dg = (double)(cto.green_ - cfrom.green_) / (double)n;
+			double db = (double)(cto.blue_ - cfrom.blue_) / (double)n;
+
+			for(jj=0; jj<n; jj++)
+			{
+				cor.red_ = cfrom.red_ + (int)(dr * (double)jj);
+				cor.green_ = cfrom.green_ + (int)(dg * (double)jj);
+				cor.blue_ = cfrom.blue_ + (int)(db * (double)jj);
+				allColors.push_back(cor);
+			}
+			cfrom = cto;
+			ii++;
+		}
+	}
+	double step = 0.;
+	if (nc > 1)
+		step = (double)(allColors.size()) / (double)(nc-1);
+	for (int i=0; i<nc; i++)
+	{
+		int ind = (int)(step * (double)i + .5);
+		if (ind > (int)(allColors.size() - 1))
+			ind = allColors.size() - 1;
+		colors.push_back(allColors[ind]);
+	}
+	allColors.clear();
+	return true;
+}
+
+
+void generateColorBarMap(vector<ColorBar>& inputColorVec, int ncores, map<int, vector<TeColor> >& colorMap)
+{
+	if(inputColorVec.empty())
+	{
+		TeColor c(255, 0, 0);
+		ColorBar b;
+		b.color(c);
+//		b.distance_ = 1.;
+		b.distance_ = 0.;
+		inputColorVec.push_back(b);
+
+		c.init(60, 0, 0);
+		b.color(c);
+		b.distance_ = 1.;
+		inputColorVec.push_back(b);
+	}
+
+	int i, nc;
+	if(inputColorVec.empty())
+		return;
+
+	double totalDistance = inputColorVec[inputColorVec.size()-1].distance_;
+	double dd = (double)ncores / totalDistance;
+
+	colorMap.clear();
+	for(i=0; i<(int)inputColorVec.size()-1; ++i)
+	{
+		nc = TeRound(dd * (fabs(inputColorVec[i+1].distance_) - fabs(inputColorVec[i].distance_)));
+		TeColor corFrom, corTo;
+		hsv2Rgb(corFrom,inputColorVec[i].h_, inputColorVec[i].s_, inputColorVec[i].v_);
+		hsv2Rgb(corTo,inputColorVec[i+1].h_, inputColorVec[i+1].s_, inputColorVec[i+1].v_);
+//		TeColor corFrom = inputColorVec[i].cor_;
+//		TeColor corTo = inputColorVec[i+1].cor_;
+		colorMap[i] = getColors(corFrom, corTo, nc);
+	}
+	vector<TeColor> vv;
+	colorMap[i] = vv;
+}
+
+vector<TeColor> getColors(TeColor cfrom, TeColor cto, int nc)
+{
+	int n = 255, i, j;
+	vector<TeColor> colorVec;
+	TeColor cor;
+
+	vector<TeColor> allColors;
+	double dr = (double)(cto.red_ - cfrom.red_) / (double)n;
+	double dg = (double)(cto.green_ - cfrom.green_) / (double)n;
+	double db = (double)(cto.blue_ - cfrom.blue_) / (double)n;
+
+	for(j=0; j<n; j++)
+	{
+		cor.red_ = cfrom.red_ + (int)(dr * (double)j);
+		cor.green_ = cfrom.green_ + (int)(dg * (double)j);
+		cor.blue_ = cfrom.blue_ + (int)(db * (double)j);
+		allColors.push_back(cor);
+	}
+	double step = 0.;
+	if (nc > 1)
+		step = (double)(allColors.size()) / (double)(nc-1);
+	for (i=0; i<nc; ++i)
+	{
+		int ind = (int)(step * (double)i + .5);
+		if (ind > (int)(allColors.size() - 1))
+			ind = allColors.size() - 1;
+		colorVec.push_back(allColors[ind]);
+	}
+	allColors.clear();
+	return colorVec;
+}
+
+vector<ColorBar>  getColorBarVector(string& groupingColors, const bool& first)
+{
+	vector<ColorBar> cbVec;
+	char	buf[1000];
+	string ss;
+	TeColor	cor(255, 255, 255);
+
+	if(groupingColors.empty())
+		groupingColors = "R-";
+	if(groupingColors.size() == 1)
+		groupingColors += "-";
+
+	size_t t = groupingColors.find(";");
+	string s = groupingColors;
+
+	if(t == string::npos)
+	{
+		s += "-";
+		size_t a = s.find("-");
+
+		double dist = -1.;
+		while(a != string::npos)
+		{
+			memset(buf, '\0', 1000);
+			s.copy(buf, a);
+			ss = buf;
+
+			a++;
+			memset(buf, '\0', 1000);
+			s.copy(buf, s.size()-a, a);
+			s = buf;
+			a = s.find("-");
+
+			if("R" == ss)
+				cor.init(240, 0, 0);
+			else if("G" == ss)
+				cor.init(0, 240, 0);
+			else if("B" == ss)
+				cor.init(0, 0, 240);
+			else if("Cy" == ss)
+				cor.init(100, 255, 255);
+			else if("Or" == ss)
+				cor.init(255, 140, 0);
+			else if("Mg" == ss)
+				cor.init(255, 100, 255);
+			else if("Y" == ss)
+				cor.init(255, 255, 100);
+			else
+				cor.init(240, 240, 240);
+
+			ColorBar cb;
+			cb.color(cor);
+			dist += 1.;
+			cb.distance_ = dist;
+			cbVec.push_back(cb);
+		}
+		if(cbVec.size() == 1)
+		{
+			cor.init(cor.red_/5, cor.green_/5, cor.blue_/5);
+			ColorBar cb;
+			cb.color(cor);
+			dist += 1.;
+			cb.distance_ = dist;
+			cbVec.push_back(cb);
+		}
+	}
+	else
+	{
+		t = groupingColors.find("|");
+		if(first)
+		{
+			if(t != string::npos)
+			{
+				memset(buf, '\0', 1000);
+				s.copy(buf, t, 0);
+				s = buf;
+			}
+		}
+		else
+		{
+			if(t != string::npos)
+			{
+				memset(buf, '\0', 1000);
+				s.copy(buf, s.size()-t-1, t+1);
+				s = buf;
+			}
+			else // error
+			{
+				ColorBar cb;
+				cbVec.clear();
+				TeColor c;
+				hsv2Rgb(c, 0, 255, 255);
+				cb.color(c);
+				cb.distance_ = 0.;
+				cbVec.push_back(cb);
+				hsv2Rgb(c, 240, 255, 255);
+				cb.color(c);
+				cb.distance_ = 1.;
+				cbVec.push_back(cb);
+				return cbVec;
+			}
+		}
+
+		size_t a = s.find("-");
+
+		while(a != string::npos)
+		{
+			if(a == 0) // hue = -1
+				a = s.find("-", 1);
+			int cc = 0;
+			memset(buf, '\0', 1000);
+			s.copy(buf, a);
+			ss = buf;
+
+			a++;
+			memset(buf, '\0', 1000);
+			s.copy(buf, s.size()-a, a);
+			s = buf;
+			a = s.find("-");
+			if(a == 0) // hue = -1
+				a = s.find("-", 1);
+			
+			string sss;
+			vector<double> vVec;
+			size_t aa = ss.find(";");
+			while(aa != string::npos)
+			{
+				cc++;
+				memset(buf, '\0', 1000);
+				ss.copy(buf, aa);
+				sss = buf;
+				double v = atof(sss.c_str());
+				vVec.push_back(v);
+
+				aa++;
+				memset(buf, '\0', 1000);
+				ss.copy(buf, ss.size()-aa, aa);
+				ss = buf;
+				aa = ss.find(";");
+			}
+			ColorBar cb;
+			double brilho, dist = atof(ss.c_str());
+			cb.distance_ = dist;
+
+			if(vVec.empty()) // error in group color
+			{
+				cbVec.clear();
+				TeColor c;
+				hsv2Rgb(c, 0, 255, 255);
+				cb.color(c);
+				cb.distance_ = 0.;
+				cbVec.push_back(cb);
+				hsv2Rgb(c, 240, 255, 255);
+				cb.color(c);
+				cb.distance_ = 1.;
+				cbVec.push_back(cb);
+				return cbVec;
+			}
+
+			if(vVec.size() >= 4)
+			{
+				cor.init((int)vVec[0], (int)vVec[1], (int)vVec[2]);
+				brilho = vVec[3];
+				cb.color(cor);
+			}
+			else
+			{
+				int h = (int)vVec[0];
+				int	s = (int)vVec[1];
+				int v = (int)vVec[2];
+				TeColor c;
+				hsv2Rgb(c, h, s, v);
+				cb.color(c);
+			}
+
+			cbVec.push_back(cb);
+
+			if(a == string::npos)
+			{
+				cc = 0;
+				vVec.clear();
+				ss = s;
+				size_t aa = ss.find(";");
+				while(aa != string::npos)
+				{
+					cc++;
+					memset(buf, '\0', 1000);
+					ss.copy(buf, aa);
+					sss = buf;
+					double v = atof(sss.c_str());
+					vVec.push_back(v);
+
+					aa++;
+					memset(buf, '\0', 1000);
+					ss.copy(buf, ss.size()-aa, aa);
+					ss = buf;
+					aa = ss.find(";");
+				}
+				ColorBar cb;
+				double brilho, dist = atof(ss.c_str());
+				cb.distance_ = dist;
+
+				if(vVec.size() >= 4)
+				{
+					cor.init((int)vVec[0], (int)vVec[1], (int)vVec[2]);
+					brilho = vVec[3];
+					cb.color(cor);
+				}
+				else
+				{
+					int h = (int)vVec[0];
+					int	s = (int)vVec[1];
+					int v = (int)vVec[2];
+					TeColor c;
+					hsv2Rgb(c, h, s, v);
+					cb.color(c);
+				}
+
+				cbVec.push_back(cb);
+			}
+		}
+	}
+	return cbVec;
+}
+
+
+vector<TeColor> getColors(vector<ColorBar>& iVec, int ncores)
+{
+	vector<TeColor> cVec;
+	vector<TeColor> outVec;
+	map<int, vector<TeColor> > colorMap;
+
+	generateColorBarMap(iVec, ncores * 255, colorMap);
+
+	map<int, vector<TeColor> > :: iterator it = colorMap.begin();
+
+	while(it != colorMap.end())
+	{
+		vector<TeColor>& cores = it->second;
+		vector<TeColor> :: iterator i = cores.begin();
+
+		while(i != cores.end())
+		{
+			cVec.push_back(*i);
+			i++;
+		}
+		it++;
+	}
+
+	int s = (int)cVec.size();
+	double d, dd = (double)s /(double)(ncores-1);
+	int	i = 0, j;
+
+	while(i < ncores)
+	{
+		d = dd * (double)i;
+		j = TeRound(d);
+		if(j >= s)
+			j = s - 1;
+		if((int)cVec.size() > j)
+			outVec.push_back(cVec[j]);
+		i++;
+	}
+	return outVec;
+}
+
+string getColors(vector<ColorBar>& aVec, vector<ColorBar>& bVec, int groupingMode)
+{
+	string s, ss;
+	vector<ColorBar> colorBarVec = aVec;
+	vector<ColorBar> :: iterator it;
+
+	int r, g, b;
+	double d;
+//	double br, d;
+
+	it = colorBarVec.begin();
+	while(it != colorBarVec.end())
+	{
+		ColorBar cb = (*it);
+		TeColor cor;
+		hsv2Rgb(cor, cb.h_, cb.s_, cb.v_);
+		r = cor.red_;
+		g = cor.green_;
+		b = cor.blue_;
+		d = cb.distance_;
+
+		s += Te2String(cb.h_) + ";" + Te2String(cb.s_) + ";" + Te2String(cb.v_) + ";" + Te2String(d, 2);
+		if(s.size() > 255)
+		{
+			s = ss;
+			break;
+		}
+
+		ss = s;		
+		it++;
+		if(it != colorBarVec.end())
+			s += "-";
+	}
+
+	if(groupingMode == TeStdDeviation)
+	{
+		s += "|";
+
+		colorBarVec = bVec;
+		it = colorBarVec.begin();
+		while(it != colorBarVec.end())
+		{
+			ColorBar cb = (*it);
+			TeColor cor;
+			hsv2Rgb(cor, cb.h_, cb.s_, cb.v_);
+			r = cor.red_;
+			g = cor.green_;
+			b = cor.blue_;
+			d = cb.distance_;
+
+			s += Te2String(cb.h_) + ";" + Te2String(cb.s_) + ";" + Te2String(cb.v_) + ";" + Te2String(d, 2);
+			if(s.size() > 255)
+			{
+				s = ss;
+				break;
+			}
+
+			ss = s;		
+			it++;
+			if(it != colorBarVec.end())
+				s += "-";
+		}
+	}
+
+	return s;
+}
+
+void rgb2Hsv(const TeColor& c, int& h, int& s, int& v)
+{
+	double r = (double)(c.red_ / 255.);
+	double g = (double)(c.green_ / 255.);
+	double b = (double)(c.blue_ / 255.);
+
+	double hh, ss, vv;
+	RGBtoHSV(r, g, b, hh, ss, vv);
+
+	h = TeRound(hh);
+	s = TeRound(255. * ss);
+	v = TeRound(255. * vv);
+}
+
+// r,g,b values are from 0 to 1
+// h = [0,360], s = [0,1], v = [0,1]
+//		if s == 0, then h = -1 (undefined)
+
+void RGBtoHSV(const double& r, const double& g, const double& b, double& h, double& s, double& v )
+{
+	if(r == g && g == b) // achromatic (grey)
+	{
+		h = - 1;
+		s = 0;
+		v = r;
+		return;
+	}
+
+	double min, max, delta;
+
+	min = MIN(r, g);
+	min = MIN(min, b);
+	max = MAX(r, g);
+	max = MAX(max, b);
+	v = max;				// v
+
+	delta = max - min;
+
+	if( max != 0 )
+		s = delta / max;		// s
+	else {
+		// r = g = b = 0		// s = 0, v is undefined
+		s = 0;
+		h = -1;
+		return;
+	}
+
+	if( r == max )
+		h = ( g - b ) / delta;		// between yellow & magenta
+	else if( g == max )
+		h = 2 + ( b - r ) / delta;	// between cyan & yellow
+	else
+		h = 4 + ( r - g ) / delta;	// between magenta & cyan
+
+	h *= 60;				// degrees
+	if( h < 0 )
+		h += 360;
+
+}
+
+void hsv2Rgb(TeColor& c, const int& h, const int& s, const int& v)
+{
+	double	r, g, b;
+	double hh = (double)h;
+	double ss = (double)s / 255.;
+	double vv = (double)v / 255.;
+
+	HSVtoRGB(r, g, b, hh, ss, vv);
+
+	c.red_ = TeRound(r * 255.);
+	c.green_ = TeRound(g * 255.);
+	c.blue_ = TeRound(b * 255.);
+}
+
+void HSVtoRGB( double& r, double& g, double& b, const double& h, const double& s, const double& v )
+{
+	int i;
+	double f, p, q, t, hh = h;
+
+	if( s == 0 || h == -1) {
+		// achromatic (grey)
+		r = g = b = v;
+		return;
+	}
+
+	hh /= 60;			// sector 0 to 5
+	i = TeRound(floor(hh));
+	f = hh - i;			// factorial part of h
+	p = v * ( 1 - s );
+	q = v * ( 1 - s * f );
+	t = v * ( 1 - s * ( 1 - f ) );
+
+	switch( i ) {
+		case 0:
+			r = v;
+			g = t;
+			b = p;
+			break;
+		case 1:
+			r = q;
+			g = v;
+			b = p;
+			break;
+		case 2:
+			r = p;
+			g = v;
+			b = t;
+			break;
+		case 3:
+			r = p;
+			g = q;
+			b = v;
+			break;
+		case 4:
+			r = t;
+			g = p;
+			b = v;
+			break;
+		default:		// case 5:
+			r = v;
+			g = p;
+			b = q;
+			break;
+	}
+}
+
+
+unsigned int  TeReadColorRampTextFile(const string& fileName, map<string,string>& colorRamps)
+{
+	string name;
+	string rgb;
+	vector<string> aux;
+	double r, g, b;
+	double h, s, v;
+	unsigned int ncolors = 0;
+	unsigned int n;
+	try
+	{
+		TeAsciiFile file(fileName);
+		do
+		{
+			string ramp;
+			try 
+			{
+				name = file.readLine();
+				ncolors = file.readInt();
+				file.findNewLine();
+				for (n=0; n<ncolors-1; ++n)
+				{
+					rgb = file.readLine();
+					aux.clear();
+					TeSplitString(rgb, ",", aux);
+					TeTrim(aux[0]);
+					TeTrim(aux[1]);
+					TeTrim(aux[2]);
+					r = atof(aux[0].c_str());	
+					g = atof(aux[1].c_str());
+					b = atof(aux[2].c_str());
+					RGBtoHSV(r, g, b, h, s, v);
+	                
+					ramp += Te2String(int(h)) + ";";
+					ramp += Te2String(int(s*255.)) + ";";
+					ramp += Te2String(int(v)) + ";";
+					ramp += Te2String(n) + "-";
+				}
+				rgb = file.readLine();
+				aux.clear();
+				TeSplitString(rgb, ",", aux);
+				TeTrim(aux[0]);
+				TeTrim(aux[1]);
+				TeTrim(aux[2]);
+				r = atof(aux[0].c_str());	
+				g = atof(aux[1].c_str());
+				b = atof(aux[2].c_str());
+				RGBtoHSV(r, g, b, h, s, v);
+	            
+				ramp += Te2String(int(h)) + ";";
+				ramp += Te2String(int(s*255.)) + ";";
+				ramp += Te2String(int(v))+ ";";
+				ramp += Te2String(n);
+				++ncolors;
+				TeTrim(name);
+				colorRamps[name]=ramp;
+			}
+			catch(...)
+			{
+				break;
+			}
+		}while(true);
+	}
+	catch(...)
+	{
+		return 0;
+	}
+	return colorRamps.size();
+}
diff --git a/src/terralib/utils/TeColorUtils.h b/src/terralib/utils/TeColorUtils.h
old mode 100755
new mode 100644
index 989a34c..30a40e2
--- a/src/terralib/utils/TeColorUtils.h
+++ b/src/terralib/utils/TeColorUtils.h
@@ -1,92 +1,94 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeColorUtils.h
-    \brief This file contains functions to manipulate a structure representing a color
-*/
-#ifndef  __TERRALIB_INTERNAL_COLORUTILS_H
-#define  __TERRALIB_INTERNAL_COLORUTILS_H
-
-
-#include "TeVisual.h"
-#include "TeUtils.h"
-
-void rgb2Hsv(const TeColor& c, int& h, int& s, int& v);
-void RGBtoHSV(const double& r, const double& g, const double& b, double& h, double& s, double& v );
-void hsv2Rgb(TeColor& c, const int& h, const int& s, const int& v);
-void HSVtoRGB( double& r, double& g, double& b, const double& h, const double& s, const double& v );
-
-struct ColorBar {
-	TeColor cor_;
-	int		h_;
-	int		s_;
-	int		v_;
-	double	distance_;
-
-	void color(const TeColor& c){cor_ = c; rgb2Hsv(cor_, h_, s_, v_);}
-
-	ColorBar& operator= (const ColorBar& cb)
-	{
-		cor_ = cb.cor_;
-		h_ = cb.h_;
-		s_ = cb.s_;
-		v_ = cb.v_;
-		distance_ = cb.distance_;
-
-		return *this;
-	}
-
-	bool operator<= (const ColorBar& cb) const
-	{
-		return (distance_ <= cb.distance_);
-	}
-
-	bool operator< (const ColorBar& cb) const
-	{
-		return (distance_ < cb.distance_);
-	}
-};
-
-#include <vector>
-#include <string>
-#include <map>
-
-//! Generates a graduated color scale following a sequence of basic colors
-/*!
-	The possible basic colors are "RED", "GREEN", "BLUE", "YELLOW", "CYAN", "MAGENTA", "GRAY" and  "BLACK"
-	\param ramps	vector with the sequence color ramps used to build the scale 
-	\param nc		desired number of colors on the scale
-	\param colors	resulting color scale
-	\returns true if color scale was successfully generated and false otherwise
-*/
-bool getColors(std::vector<std::string>& ramps, int nc, std::vector<TeColor>& colors);
-vector<TeColor> getColors(TeColor cfrom, TeColor cto, int nc);
-vector<TeColor> getColors(vector<ColorBar>& iVec, int ncores);
-string getColors(vector<ColorBar>& aVec, vector<ColorBar>& bVec, int groupingMode);
-void generateColorBarMap(vector<ColorBar>& inputColorVec, int ncores, map<int, vector<TeColor> >& colorMap);
-vector<ColorBar> getColorBarVector(string& scores, const bool& first);
-unsigned int  TeReadColorRampTextFile(const string& fileName, map<string,string>& colorRamps);
-
-#endif
-
-
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeColorUtils.h
+    \brief This file contains functions to manipulate a structure representing a color
+*/
+#ifndef  __TERRALIB_INTERNAL_COLORUTILS_H
+#define  __TERRALIB_INTERNAL_COLORUTILS_H
+
+
+#include "TeVisual.h"
+#include "TeUtils.h"
+
+#include "TeUtilsDefines.h"
+
+TLUTILS_DLL void rgb2Hsv(const TeColor& c, int& h, int& s, int& v);
+TLUTILS_DLL void RGBtoHSV(const double& r, const double& g, const double& b, double& h, double& s, double& v );
+TLUTILS_DLL void hsv2Rgb(TeColor& c, const int& h, const int& s, const int& v);
+TLUTILS_DLL void HSVtoRGB( double& r, double& g, double& b, const double& h, const double& s, const double& v );
+
+struct TLUTILS_DLL ColorBar {
+	TeColor cor_;
+	int		h_;
+	int		s_;
+	int		v_;
+	double	distance_;
+
+	void color(const TeColor& c){cor_ = c; rgb2Hsv(cor_, h_, s_, v_);}
+
+	ColorBar& operator= (const ColorBar& cb)
+	{
+		cor_ = cb.cor_;
+		h_ = cb.h_;
+		s_ = cb.s_;
+		v_ = cb.v_;
+		distance_ = cb.distance_;
+
+		return *this;
+	}
+
+	bool operator<= (const ColorBar& cb) const
+	{
+		return (distance_ <= cb.distance_);
+	}
+
+	bool operator< (const ColorBar& cb) const
+	{
+		return (distance_ < cb.distance_);
+	}
+};
+
+#include <vector>
+#include <string>
+#include <map>
+
+//! Generates a graduated color scale following a sequence of basic colors
+/*!
+	The possible basic colors are "RED", "GREEN", "BLUE", "YELLOW", "CYAN", "MAGENTA", "GRAY" and  "BLACK"
+	\param ramps	vector with the sequence color ramps used to build the scale 
+	\param nc		desired number of colors on the scale
+	\param colors	resulting color scale
+	\returns true if color scale was successfully generated and false otherwise
+*/
+TLUTILS_DLL bool getColors(std::vector<std::string>& ramps, int nc, std::vector<TeColor>& colors);
+TLUTILS_DLL vector<TeColor> getColors(TeColor cfrom, TeColor cto, int nc);
+TLUTILS_DLL vector<TeColor> getColors(vector<ColorBar>& iVec, int ncores);
+TLUTILS_DLL string getColors(vector<ColorBar>& aVec, vector<ColorBar>& bVec, int groupingMode);
+TLUTILS_DLL void generateColorBarMap(vector<ColorBar>& inputColorVec, int ncores, map<int, vector<TeColor> >& colorMap);
+TLUTILS_DLL vector<ColorBar> getColorBarVector(string& scores, const bool& first);
+TLUTILS_DLL unsigned int  TeReadColorRampTextFile(const string& fileName, map<string,string>& colorRamps);
+
+#endif
+
+
+
diff --git a/src/terralib/utils/TeDatabaseUtils.cpp b/src/terralib/utils/TeDatabaseUtils.cpp
old mode 100755
new mode 100644
index 7b61c50..8afdfd7
--- a/src/terralib/utils/TeDatabaseUtils.cpp
+++ b/src/terralib/utils/TeDatabaseUtils.cpp
@@ -1,582 +1,1428 @@
-/************************************************************************************
-TerraView - visualization and exploration of geographical databases using TerraLib.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-This file is part of TerraView. TerraView is free software; you can redistribute it 
-and/or modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-You should have received a copy of the GNU General Public License
-along with TerraView.
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The software provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use of
-this program and its documentation.
-*************************************************************************************/
-
-#include <TeDatabaseUtils.h>
-#include <TeLayerFunctions.h>
-
-
-bool isTerralibModel(TeDatabase* db)
-{
-	vector<string>::iterator it;
-	vector<string> tables;
-	db->listTables(tables);
-
-	for(unsigned int i = 0; i<tables.size(); i++)
-	{
-		if((it = find(tables.begin(), tables.end(), "te_projection")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_layer")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_layer_table")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_tables_relation")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_representation")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_view")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_theme")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_grouping")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_theme_table")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_legend")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_visual")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_visual_raster")) == tables.end())
-			return false;
-		if((it = find(tables.begin(), tables.end(), "te_database")) == tables.end())
-			return false;
-	}
-	if(tables.size() == 0)
-		return false;
-
-	return true;
-}
-
-
-bool TeCopyDatabase(TeDatabase* dbFrom, TeDatabase* dbTo)
-{
-	// -- Step 1 : copies the external tables
-	TeAttrTableVector externs;
-	dbFrom->getAttrTables(externs,TeAttrExternal);
-	if (!externs.empty())
-	{
-		TeDatabasePortal* portal = dbFrom->getPortal();
-		if (!portal)
-		{
-			// log error here
-			return false;
-		}
-
-		for (unsigned int nt=0; nt < externs.size(); nt++)
-		{
-			TeTable table = externs[nt];
-			table.setId(-1);
-			string sql = "select * from " + table.name();
-			if (!portal->query(sql) || portal->numRows() == 0)
-			{
-				portal->freeResult();
-				continue;
-			}
-			if (!dbTo->createTable(table.name(),table.attributeList()))
-			{
-				portal->freeResult();
-				continue;
-			}
-			unsigned int nr=0;
-			while (portal->fetchRow())
-			{
-				TeTableRow row;
-				for(int i = 0; i < portal->numFields(); i++)
-					row.push_back(portal->getData(i));
-				table.add(row);
-				nr++;
-				if (nr % 200)
-				{
-					dbTo->insertTable(table);
-					table.clear();
-					nr = 0;
-				}
-			}
-			if (table.size() >0)
-				dbTo->insertTable(table);
-				table.clear();	
-			dbTo->insertTableInfo(-1,table);
-			portal->freeResult();
-		}
-		delete portal;
-	}
-
-	// -- Step 2: Copies the layers
-	if(!dbFrom->loadLayerSet())
-	{
-		// log error here
-		return false;
-	}
-
-	TeLayerMap& fromLayerMap = dbFrom->layerMap();
-	TeLayerMap::iterator itFrom = fromLayerMap.begin();
-
-	while(itFrom != fromLayerMap.end())
-	{
-		TeLayer* fromLayer = (*itFrom).second;
-		TeLayer* toLayer = new TeLayer(fromLayer->name(), dbTo, fromLayer->projection());
-		map<string, string> tables;
-		if (!TeCopyLayerToLayer(fromLayer, toLayer, &tables))
-		{
-			// log error here: layer couldn�t be copied
-		}
-		++itFrom;
-	}
-	// -- Set 3: Copies the views and themes
-	if(!dbFrom->loadViewSet(dbFrom->user()))
-	{
-		// log error here
-		return false;
-	}
-
-	if(!dbTo->loadLayerSet())
-	{
-		// log error here
-		return false;
-	}
-
-	TeViewMap&	fromViewMap = dbFrom->viewMap();
-	TeViewMap::iterator itvFrom = fromViewMap.begin();
-	while (itvFrom != fromViewMap.end())
-	{
-		TeView* fromView = (*itvFrom).second;			
-		TeView* toView = new TeView();
-
-		TeProjection* toViewProjection = 0;
-		if (fromView->projection())
-			 toViewProjection = TeProjectionFactory::make(fromView->projection()->params());
-		
-		toView->projection(toViewProjection);
-		toView->name(fromView->name());
-		toView->user(dbTo->user());
-		toView->isVisible(fromView->isVisible());
-
-		TeBox b;
-		toView->setCurrentBox(b);
-		toView->setCurrentTheme(-1);
-
-		if (!dbTo->insertView(toView))
-		{
-			// log error here
-			++itvFrom;
-			continue;
-		}
-		dbTo->insertView(toView);
-		if(dbTo->projectMap().empty() == false)
-		{
-			TeProjectMap& pm = dbTo->projectMap();
-			TeProject* project = pm.begin()->second;
-			project->addView(toView->id());
-		}
-		dbTo->insertProjectViewRel(1, toView->id());
-
-		TeLayerMap& toLayerMap = dbTo->layerMap();			
-		vector<TeViewNode*>& themeVec = fromView->themes();
-		for (unsigned int i = 0; i < themeVec.size(); ++i)
-		{
-			TeTheme* themeFrom = (TeTheme*) themeVec[i];
-			string fromLayerName = themeFrom->layer()->name();
-			TeLayer* toLayer = 0;
-			TeLayerMap::iterator itTo = toLayerMap.begin();
-			while(itTo != toLayerMap.end())
-			{
-				if(itTo->second->name() == fromLayerName)
-				{
-					toLayer = itTo->second;
-					break;
-				}
-				++itTo;
-			}
-
-			if (!toLayer )
-			{
-				// log error here
-				continue;
-			}
-			
-			TeTheme* themeTo = new TeTheme(themeFrom->name(), toLayer);
-			toView->add(themeTo);
-						
-			themeTo->outOfCollectionLegend(themeFrom->outOfCollectionLegend());
-			themeTo->withoutDataConnectionLegend(themeFrom->withoutDataConnectionLegend ());
-			themeTo->defaultLegend(themeFrom->defaultLegend());
-			themeTo->pointingLegend(themeFrom->pointingLegend());
-			themeTo->queryLegend(themeFrom->queryLegend());
-
-			TeAttrTableVector tftablevec = themeFrom->attrTables();
-			TeAttrTableVector tttablevec;
-
-			for (unsigned int nt=0; nt<tftablevec.size(); nt++)
-			{
-				TeTable attTable(tftablevec[nt].name());
-				dbTo->loadTableInfo(attTable);
-				tttablevec.push_back(attTable);
-			}
-			themeTo->setAttTables(tttablevec);
-			themeTo->attributeRest(themeFrom->attributeRest());
-			themeTo->temporalRest(themeFrom->temporalRest());
-			themeTo->spatialRest(themeFrom->spatialRest());
-			themeTo->visibleRep(themeFrom->visibleRep());
-			if(!themeTo->save() || !themeTo->buildCollection())
-			{
-				// log error here
-				continue;
-			}
-			themeTo->generateLabelPositions();
-			
-			if(themeFrom->grouping().groupMode_ != TeNoGrouping)
-			{
-				TeGrouping grouping;
-				grouping = themeFrom->grouping();				
-				themeTo->buildGrouping(grouping);
-				TeLegendEntryVector& legends = themeFrom->legend();
-				for (unsigned int nl=0; nl<legends.size(); nl++)
-					themeTo->setGroupingVisual(nl+1,legends[nl].getVisualMap());
-				if (!themeTo->saveGrouping())
-				{
-						// log error here
-				}
-			}
-		} // end for each theme
-		++itvFrom;
-	} // end for each view
-	return true;
-}
-
-vector<string> getObjects(TeTheme* theme, int sel)
-{
-	vector<string> svec;
-	if(!theme)
-		return svec;
-
-	TeDatabase* db = 0;
-	if(theme->getProductId() == TeEXTERNALTHEME)
-		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
-	else if(theme->getProductId() == TeTHEME)
-		db = static_cast<TeTheme*>(theme)->layer()->database();
-
-	if(db == 0)
-		return svec;
-
-	string C = theme->collectionTable();
-	string CA = theme->collectionAuxTable();
-	string input;
-
-	if(sel == TeSelectedByPointing)
-		input += " WHERE " + C + ".c_object_status = 1 OR " + C + ".c_object_status = 3";
-	else if(sel == TeNotSelectedByPointing)
-		input += " WHERE " + C + ".c_object_status = 0 OR " + C + ".c_object_status = 2";
-	else if(sel == TeSelectedByQuery)
-		input += " WHERE " + C + ".c_object_status = 2 OR " + C + ".c_object_status = 3";
-	else if(sel == TeNotSelectedByQuery)
-		input += " WHERE " + C + ".c_object_status = 0 OR " + C + ".c_object_status = 1";
-	else if(sel == TeSelectedByPointingAndQuery)
-		input += " WHERE " + C + ".c_object_status = 3";
-	else if(sel == TeSelectedByPointingOrQuery)
-		input += " WHERE " + C + ".c_object_status <> 0";
-	else if(sel == TeGrouped)
-		input += " WHERE " + C + ".c_legend_id <> 0";
-	else if(sel == TeNotGrouped)
-		input += " WHERE " + C + ".c_legend_id = 0";
-
-	string query = "SELECT " + C + ".c_object_id FROM " + C + " LEFT JOIN " + CA;
-	query += " ON " + C + ".c_object_id = " + CA + ".object_id" + input;
-
-	TeDatabasePortal* portal = db->getPortal();
-	if (portal->query(query) == false)
-	{
-		delete portal;
-		return svec;
-	}
-	while (portal->fetchRow())
-		svec.push_back(portal->getData(0));
-
-	delete portal;
-	return svec;
-}
-
-vector<string> getItems(TeTheme* theme, int sel)
-{
-	vector<string> svec;
-	if(!theme)
-		return svec;
-
-	TeDatabase* db = 0;
-	if(theme->getProductId() == TeEXTERNALTHEME)
-		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
-	else if(theme->getProductId() == TeTHEME)
-		db = static_cast<TeTheme*>(theme)->layer()->database();
-
-	if(db == 0)
-		return svec;
-
-	string C = theme->collectionTable();
-	string CA = theme->collectionAuxTable();
-	string input;
-
-	if(sel == TeSelectedByPointing)
-		input += " WHERE " + CA + ".grid_status = 1 OR " + CA + ".grid_status = 3";
-	else if(sel == TeNotSelectedByPointing)
-		input += " WHERE " + CA + ".grid_status = 0 OR " + CA + ".grid_status = 2";
-	else if(sel == TeSelectedByQuery)
-		input += " WHERE " + CA + ".grid_status = 2 OR " + CA + ".grid_status = 3";
-	else if(sel == TeNotSelectedByQuery)
-		input += " WHERE " + CA + ".grid_status = 0 OR " + CA + ".grid_status = 1";
-	else if(sel == TeSelectedByPointingAndQuery)
-		input += " WHERE " + CA + ".grid_status = 3";
-	else if(sel == TeSelectedByPointingOrQuery)
-		input += " WHERE " + CA + ".grid_status <> 0";
-	else if(sel == TeGrouped)
-		input += " WHERE " + C + ".c_legend_id <> 0";
-	else if(sel == TeNotGrouped)
-		input += " WHERE " + C + ".c_legend_id = 0";
-
-	string query = "SELECT " + CA + ".unique_id FROM " + C + " LEFT JOIN " + CA;
-	query += " ON " + C + ".c_object_id = " + CA + ".object_id" + input;
-
-	TeDatabasePortal* portal = db->getPortal();
-	if (portal->query(query) == false)
-	{
-		delete portal;
-		return svec;
-	}
-	while (portal->fetchRow())
-		svec.push_back(portal->getData(0));
-
-	delete portal;
-	return svec;
-}
-
-vector<string> getObjects(TeTheme* theme, vector<string>& itens)
-{
-	vector<string> svec;
-	if(!theme)
-		return svec;
-
-	TeDatabase* db = 0;
-	if(theme->getProductId() == TeEXTERNALTHEME)
-		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
-	else if(theme->getProductId() == TeTHEME)
-		db = static_cast<TeTheme*>(theme)->layer()->database();
-
-	if(db == 0)
-		return svec;
-
-	TeDatabasePortal* portal = db->getPortal();
-	string C = theme->collectionTable();
-	string CA = theme->collectionAuxTable();
-
-	string query = "SELECT " + C + ".c_object_id FROM " + C + " LEFT JOIN " + CA;
-	query += " ON " + C + ".c_object_id = " + CA + ".object_id";
-	query += " WHERE " + CA + ".unique_id IN ";
-
-	set<string> idSet;
-  
-  vector< string >::iterator it_begin = itens.begin();
-  vector< string >::iterator it_end = itens.end();
-  
-	vector<string> inVec = generateInClauses(it_begin, it_end, db, false);
-	vector<string>::iterator it;
-	for(it=inVec.begin(); it!=inVec.end(); ++it)
-	{
-		if((*it).empty() == false)
-		{
-			string sel = query + *it;
-			if (portal->query(sel) == false)
-			{
-				delete portal;
-				return svec;
-			}
-			while (portal->fetchRow())
-				idSet.insert(portal->getData(0));
-			portal->freeResult();
-		}
-	}
-	delete portal;
-
-	set<string>::iterator sit;
-	for(sit=idSet.begin(); sit!=idSet.end(); ++sit)
-		svec.push_back(*sit);
-	return svec;
-}
-
-vector<string> getItems(TeTheme* theme, vector<string>& objects)
-{
-	vector<string> svec;
-	if(!theme)
-		return svec;
-
-	TeDatabase* db = 0;
-	if(theme->getProductId() == TeEXTERNALTHEME)
-		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
-	else if(theme->getProductId() == TeTHEME)
-		db = static_cast<TeTheme*>(theme)->layer()->database();
-
-	if(db == 0)
-		return svec;
-
-	TeDatabasePortal* portal = db->getPortal();
-	string C = theme->collectionTable();
-	string CA = theme->collectionAuxTable();
-
-	string query = "SELECT " + CA + ".unique_id FROM " + C + " LEFT JOIN " + CA;
-	query += " ON " + C + ".c_object_id = " + CA + ".object_id";
-	query += " WHERE " + C + ".c_object_id IN ";
-  
-  vector< string >::iterator it_begin = objects.begin();
-  vector< string >::iterator it_end = objects.end();  
-
-	vector<string> inVec = generateInClauses(it_begin, it_end, db);
-	vector<string>::iterator it;
-	for(it=inVec.begin(); it!=inVec.end(); ++it)
-	{
-		if((*it).empty() == false)
-		{
-			string sel = query + *it;
-			if (portal->query(sel) == false)
-			{
-				delete portal;
-				return svec;
-			}
-			while (portal->fetchRow())
-				svec.push_back(portal->getData(0));
-			portal->freeResult();
-		}
-	}
-	delete portal;
-	return svec;
-}
-
-map<string, vector<string> > getObject2ItemsMap(TeTheme* theme, vector<string>& itens)
-{
-	map<string, vector<string> > outMap;
-	if(!theme)
-		return outMap;
-
-	TeDatabase* db = 0;
-	if(theme->getProductId() == TeEXTERNALTHEME)
-		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
-	else if(theme->getProductId() == TeTHEME)
-		db = static_cast<TeTheme*>(theme)->layer()->database();
-
-	if(db == 0)
-		return outMap;
-
-	TeDatabasePortal* portal = db->getPortal();
-	string C = theme->collectionTable();
-	string CA = theme->collectionAuxTable();
-
-	string query = "SELECT " + C + ".c_object_id, " + CA + ".unique_id FROM " + C + " LEFT JOIN " + CA;
-	query += " ON " + C + ".c_object_id = " + CA + ".object_id";
-	query += " WHERE " + CA + ".unique_id IN ";
-  
-  vector< string >::iterator it_begin = itens.begin();
-  vector< string >::iterator it_end = itens.end();   
-
-	vector<string> inVec = generateInClauses(it_begin, it_end, db, false);
-	vector<string>::iterator it;
-	for(it=inVec.begin(); it!=inVec.end(); ++it)
-	{
-		if((*it).empty() == false)
-		{
-			string sel = query + *it;
-			if (portal->query(sel) == false)
-			{
-				delete portal;
-				return outMap;
-			}
-			while (portal->fetchRow())
-				outMap[portal->getData(0)].push_back(portal->getData(1));
-			portal->freeResult();
-		}
-	}
-	delete portal;
-
-	return outMap;
-}
-
-vector<string>
-generateItemsInClauseVec(TeTheme* theme, string& where)
-{
-	vector<string> inClauseVector;
-	TeDatabase* db = 0;
-	string	CT = theme->collectionTable();
-	string	CA = theme->collectionAuxTable();
-	string	from = " FROM " + CT + " LEFT JOIN " + CA + " ON " + CT + ".c_object_id = " + CA + ".object_id";
-
-	if(theme->getProductId()==TeTHEME)
-		db = theme->layer()->database();
-	else if(theme->getProductId()==TeEXTERNALTHEME)
-		db = ((TeExternalTheme*) theme)->getSourceDatabase();
-
-	if(db == 0)
-		return inClauseVector;
-
-	TeDatabasePortal* portal = db->getPortal();
-	string sel = "SELECT " + CT + ".c_object_id, " + CA + ".unique_id " + from;
-
-	if(where.empty() == false)
-		sel += " " + where;
-
-	map<string, vector<string> > objMap;
-	if(portal->query(sel))
-	{
-		while(portal->fetchRow())
-			objMap[portal->getData(0)].push_back(portal->getData(1));
-	}
-
-	map<string, vector<string> >::iterator mit;
-	vector<string>::iterator it;
-
-	int i, chunkSize = 200;
-	string inClause;
-	
-	i = 0;
-	bool chunk = true;
-	for(mit=objMap.begin(); mit!=objMap.end(); ++mit)
-	{
-		if (chunk == true)
-		{
-			chunk = false;
-			if (!inClause.empty())
-			{
-				inClause[inClause.size() - 1] = ')';
-				inClauseVector.push_back(inClause);
-				inClause.clear();
-			}
-			inClause = "(";
-		}
-		for(it=mit->second.begin(); it!=mit->second.end(); ++it)
-		{
-			inClause += *it + ",";
-			i++;
-			if (i%chunkSize == 0)
-				chunk = true;
-		}
-	}
-	if (!inClause.empty())
-	{
-		inClause[inClause.size() - 1] = ')';
-		inClauseVector.push_back(inClause);
-	}
-	return inClauseVector;
-}
-
-
-
+/************************************************************************************
+TerraView - visualization and exploration of geographical databases using TerraLib.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+This file is part of TerraView. TerraView is free software; you can redistribute it 
+and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+You should have received a copy of the GNU General Public License
+along with TerraView.
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The software provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use of
+this program and its documentation.
+*************************************************************************************/
+
+#include <TeDatabaseUtils.h>
+#include <TeLayerFunctions.h>
+#include <TeDBConnectionsPool.h>
+#include <TeFileTheme.h>
+
+#include <TeRasterTransform.h>
+
+bool isTerralibModel(TeDatabase* db)
+{
+	if(db == NULL)
+	{
+		return false;
+	}
+	if(!db->tableExist("te_projection"))
+		return false;
+	if(!db->tableExist("te_layer"))
+		return false;
+	if(!db->tableExist("te_layer_table"))
+		return false;
+	if(!db->tableExist("te_tables_relation"))
+		return false;
+	if(!db->tableExist("te_representation"))
+		return false;
+	if(!db->tableExist("te_view"))
+		return false;
+	if(!db->tableExist("te_theme"))
+		return false;
+	if(!db->tableExist("te_grouping"))
+		return false;
+	if(!db->tableExist("te_theme_table"))
+		return false;
+	if(!db->tableExist("te_legend"))
+		return false;
+	if(!db->tableExist("te_visual"))
+		return false;
+	if(!db->tableExist("te_visual_raster"))
+		return false;
+	if(!db->tableExist("te_database"))
+		return false;
+
+	return true;
+}
+
+
+bool TeCopyDatabase(TeDatabase* dbFrom, TeDatabase* dbTo)
+{
+	// -- Step 1 : copies the external tables
+	TeAttrTableVector externs;
+	dbFrom->getAttrTables(externs,TeAttrExternal);
+	if (!externs.empty())
+	{
+		TeDatabasePortal* portal = dbFrom->getPortal();
+		if (!portal)
+		{
+			// log error here
+			return false;
+		}
+
+		for (unsigned int nt=0; nt < externs.size(); nt++)
+		{
+			TeTable table = externs[nt];
+			table.setId(-1);
+			string sql = "select * from " + table.name();
+			if (!portal->query(sql) || portal->numRows() == 0)
+			{
+				portal->freeResult();
+				continue;
+			}
+			if (!dbTo->createTable(table.name(),table.attributeList()))
+			{
+				portal->freeResult();
+				continue;
+			}
+			unsigned int nr=0;
+			while (portal->fetchRow())
+			{
+				TeTableRow row;
+				for(int i = 0; i < portal->numFields(); i++)
+					row.push_back(portal->getData(i));
+				table.add(row);
+				nr++;
+				if (nr % 200)
+				{
+					dbTo->insertTable(table);
+					table.clear();
+					nr = 0;
+				}
+			}
+			if (table.size() >0)
+				dbTo->insertTable(table);
+				table.clear();	
+			dbTo->insertTableInfo(-1,table);
+			portal->freeResult();
+		}
+		delete portal;
+	}
+
+	// -- Step 2: Copies the layers
+	if(!dbFrom->loadLayerSet())
+	{
+		// log error here
+		return false;
+	}
+
+	TeLayerMap& fromLayerMap = dbFrom->layerMap();
+	TeLayerMap::iterator itFrom = fromLayerMap.begin();
+
+	while(itFrom != fromLayerMap.end())
+	{
+		TeLayer* fromLayer = (*itFrom).second;
+		TeLayer* toLayer = new TeLayer(fromLayer->name(), dbTo, fromLayer->projection());
+		map<string, string> tables;
+		if (!TeCopyLayerToLayer(fromLayer, toLayer, &tables))
+		{
+			// log error here: layer couldn�t be copied
+		}
+		++itFrom;
+	}
+	// -- Set 3: Copies the views and themes
+	if(!dbFrom->loadViewSet(dbFrom->user()))
+	{
+		// log error here
+		return false;
+	}
+
+	if(!dbTo->loadLayerSet())
+	{
+		// log error here
+		return false;
+	}
+
+	TeViewMap&	fromViewMap = dbFrom->viewMap();
+	TeViewMap::iterator itvFrom = fromViewMap.begin();
+	while (itvFrom != fromViewMap.end())
+	{
+		TeView* fromView = (*itvFrom).second;			
+		TeView* toView = new TeView();
+
+		TeProjection* toViewProjection = 0;
+		if (fromView->projection())
+			 toViewProjection = TeProjectionFactory::make(fromView->projection()->params());
+		
+		toView->projection(toViewProjection);
+		toView->name(fromView->name());
+		toView->user(dbTo->user());
+		toView->isVisible(fromView->isVisible());
+
+		TeBox b;
+		toView->setCurrentBox(b);
+		toView->setCurrentTheme(-1);
+
+		if (!dbTo->insertView(toView))
+		{
+			// log error here
+			++itvFrom;
+			continue;
+		}
+		dbTo->insertView(toView);
+		if(dbTo->projectMap().empty() == false)
+		{
+			TeProjectMap& pm = dbTo->projectMap();
+			TeProject* project = pm.begin()->second;
+			project->addView(toView->id());
+		}
+		dbTo->insertProjectViewRel(1, toView->id());
+
+		TeLayerMap& toLayerMap = dbTo->layerMap();			
+		vector<TeViewNode*>& themeVec = fromView->themes();
+		for (unsigned int i = 0; i < themeVec.size(); ++i)
+		{
+			TeTheme* themeFrom = (TeTheme*) themeVec[i];
+			string fromLayerName = themeFrom->layer()->name();
+			TeLayer* toLayer = 0;
+			TeLayerMap::iterator itTo = toLayerMap.begin();
+			while(itTo != toLayerMap.end())
+			{
+				if(itTo->second->name() == fromLayerName)
+				{
+					toLayer = itTo->second;
+					break;
+				}
+				++itTo;
+			}
+
+			if (!toLayer )
+			{
+				// log error here
+				continue;
+			}
+			
+			TeTheme* themeTo = new TeTheme(themeFrom->name(), toLayer);
+			toView->add(themeTo);
+						
+			themeTo->outOfCollectionLegend(themeFrom->outOfCollectionLegend());
+			themeTo->withoutDataConnectionLegend(themeFrom->withoutDataConnectionLegend ());
+			themeTo->defaultLegend(themeFrom->defaultLegend());
+			themeTo->pointingLegend(themeFrom->pointingLegend());
+			themeTo->queryLegend(themeFrom->queryLegend());
+
+			TeAttrTableVector tftablevec = themeFrom->attrTables();
+			TeAttrTableVector tttablevec;
+
+			for (unsigned int nt=0; nt<tftablevec.size(); nt++)
+			{
+				TeTable attTable(tftablevec[nt].name());
+				dbTo->loadTableInfo(attTable); 
+				tttablevec.push_back(attTable);
+			}
+			themeTo->setAttTables(tttablevec);
+			themeTo->attributeRest(themeFrom->attributeRest());
+			themeTo->temporalRest(themeFrom->temporalRest());
+			themeTo->spatialRest(themeFrom->spatialRest());
+			themeTo->visibleRep(themeFrom->visibleRep());
+			if(!themeTo->save() || !themeTo->buildCollection())
+			{
+				// log error here
+				continue;
+			}
+			themeTo->generateLabelPositions();
+			
+			if(themeFrom->grouping().groupMode_ != TeNoGrouping)
+			{
+				TeGrouping grouping;
+				grouping = themeFrom->grouping();				
+				themeTo->buildGrouping(grouping);
+				TeLegendEntryVector& legends = themeFrom->legend();
+				for (unsigned int nl=0; nl<legends.size(); nl++)
+					themeTo->setGroupingVisual(nl+1,legends[nl].getVisualMap());
+				if (!themeTo->saveGrouping())
+				{
+						// log error here
+				}
+			}
+		} // end for each theme
+		++itvFrom;
+	} // end for each view
+	return true;
+}
+
+//vector<string> getObjects(TeTheme* theme, int sel)
+//{
+//	vector<string> svec;
+//	if(!theme)
+//		return svec;
+//
+//	TeDatabase* db = 0;
+//	if(theme->getProductId() == TeEXTERNALTHEME)
+//		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
+//	else if(theme->getProductId() == TeTHEME)
+//		db = static_cast<TeTheme*>(theme)->layer()->database();
+//
+//	if(db == 0)
+//		return svec;
+//
+//	string C = theme->collectionTable();
+//	string CA = theme->collectionAuxTable();
+//	string input;
+//
+//	if(sel == TeSelectedByPointing)
+//		input += " WHERE " + C + ".c_object_status = 1 OR " + C + ".c_object_status = 3";
+//	else if(sel == TeNotSelectedByPointing)
+//		input += " WHERE " + C + ".c_object_status = 0 OR " + C + ".c_object_status = 2";
+//	else if(sel == TeSelectedByQuery)
+//		input += " WHERE " + C + ".c_object_status = 2 OR " + C + ".c_object_status = 3";
+//	else if(sel == TeNotSelectedByQuery)
+//		input += " WHERE " + C + ".c_object_status = 0 OR " + C + ".c_object_status = 1";
+//	else if(sel == TeSelectedByPointingAndQuery)
+//		input += " WHERE " + C + ".c_object_status = 3";
+//	else if(sel == TeSelectedByPointingOrQuery)
+//		input += " WHERE " + C + ".c_object_status <> 0";
+//	else if(sel == TeGrouped)
+//		input += " WHERE " + C + ".c_legend_id <> 0";
+//	else if(sel == TeNotGrouped)
+//		input += " WHERE " + C + ".c_legend_id = 0";
+//
+//	string query = "SELECT " + C + ".c_object_id FROM " + C + " LEFT JOIN " + CA;
+//	query += " ON " + C + ".c_object_id = " + CA + ".object_id" + input;
+//
+//	TeDatabasePortal* portal = db->getPortal();
+//	if (portal->query(query) == false)
+//	{
+//		delete portal;
+//		return svec;
+//	}
+//	while (portal->fetchRow())
+//		svec.push_back(portal->getData(0));
+//
+//	delete portal;
+//	return svec;
+//}
+//
+//vector<string> getItems(TeTheme* theme, int sel)
+//{
+//	vector<string> svec;
+//	if(!theme)
+//		return svec;
+//
+//	TeDatabase* db = 0;
+//	if(theme->getProductId() == TeEXTERNALTHEME)
+//		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
+//	else if(theme->getProductId() == TeTHEME)
+//		db = static_cast<TeTheme*>(theme)->layer()->database();
+//
+//	if(db == 0)
+//		return svec;
+//
+//	string C = theme->collectionTable();
+//	string CA = theme->collectionAuxTable();
+//	string input;
+//
+//	if(sel == TeSelectedByPointing)
+//		input += " WHERE " + CA + ".grid_status = 1 OR " + CA + ".grid_status = 3";
+//	else if(sel == TeNotSelectedByPointing)
+//		input += " WHERE " + CA + ".grid_status = 0 OR " + CA + ".grid_status = 2";
+//	else if(sel == TeSelectedByQuery)
+//		input += " WHERE " + CA + ".grid_status = 2 OR " + CA + ".grid_status = 3";
+//	else if(sel == TeNotSelectedByQuery)
+//		input += " WHERE " + CA + ".grid_status = 0 OR " + CA + ".grid_status = 1";
+//	else if(sel == TeSelectedByPointingAndQuery)
+//		input += " WHERE " + CA + ".grid_status = 3";
+//	else if(sel == TeSelectedByPointingOrQuery)
+//		input += " WHERE " + CA + ".grid_status <> 0";
+//	else if(sel == TeGrouped)
+//		input += " WHERE " + C + ".c_legend_id <> 0";
+//	else if(sel == TeNotGrouped)
+//		input += " WHERE " + C + ".c_legend_id = 0";
+//
+//	string query = "SELECT " + CA + ".unique_id FROM " + C + " LEFT JOIN " + CA;
+//	query += " ON " + C + ".c_object_id = " + CA + ".object_id" + input;
+//
+//	TeDatabasePortal* portal = db->getPortal();
+//	if (portal->query(query) == false)
+//	{
+//		delete portal;
+//		return svec;
+//	}
+//	while (portal->fetchRow())
+//		svec.push_back(portal->getData(0));
+//
+//	delete portal;
+//	return svec;
+//}
+//
+//vector<string> getObjects(TeTheme* theme, vector<string>& itens)
+//{
+//	vector<string> svec;
+//	if(!theme)
+//		return svec;
+//
+//	TeDatabase* db = 0;
+//	if(theme->getProductId() == TeEXTERNALTHEME)
+//		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
+//	else if(theme->getProductId() == TeTHEME)
+//		db = static_cast<TeTheme*>(theme)->layer()->database();
+//
+//	if(db == 0)
+//		return svec;
+//
+//	TeDatabasePortal* portal = db->getPortal();
+//	string C = theme->collectionTable();
+//	string CA = theme->collectionAuxTable();
+//
+//	string query = "SELECT " + C + ".c_object_id FROM " + C + " LEFT JOIN " + CA;
+//	query += " ON " + C + ".c_object_id = " + CA + ".object_id";
+//	query += " WHERE " + CA + ".unique_id IN ";
+//
+//	set<string> idSet;
+//  
+//  vector< string >::iterator it_begin = itens.begin();
+//  vector< string >::iterator it_end = itens.end();
+//  
+//	vector<string> inVec = generateInClauses(it_begin, it_end, db, false);
+//	vector<string>::iterator it;
+//	for(it=inVec.begin(); it!=inVec.end(); ++it)
+//	{
+//		if((*it).empty() == false)
+//		{
+//			string sel = query + *it;
+//			if (portal->query(sel) == false)
+//			{
+//				delete portal;
+//				return svec;
+//			}
+//			while (portal->fetchRow())
+//				idSet.insert(portal->getData(0));
+//			portal->freeResult();
+//		}
+//	}
+//	delete portal;
+//
+//	set<string>::iterator sit;
+//	for(sit=idSet.begin(); sit!=idSet.end(); ++sit)
+//		svec.push_back(*sit);
+//	return svec;
+//}
+//
+//vector<string> getItems(TeTheme* theme, vector<string>& objects)
+//{
+//	vector<string> svec;
+//	if(!theme)
+//		return svec;
+//
+//	TeDatabase* db = 0;
+//	if(theme->getProductId() == TeEXTERNALTHEME)
+//		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
+//	else if(theme->getProductId() == TeTHEME)
+//		db = static_cast<TeTheme*>(theme)->layer()->database();
+//
+//	if(db == 0)
+//		return svec;
+//
+//	TeDatabasePortal* portal = db->getPortal();
+//	string C = theme->collectionTable();
+//	string CA = theme->collectionAuxTable();
+//
+//	string query = "SELECT " + CA + ".unique_id FROM " + C + " LEFT JOIN " + CA;
+//	query += " ON " + C + ".c_object_id = " + CA + ".object_id";
+//	query += " WHERE " + C + ".c_object_id IN ";
+//  
+//  vector< string >::iterator it_begin = objects.begin();
+//  vector< string >::iterator it_end = objects.end();  
+//
+//	vector<string> inVec = generateInClauses(it_begin, it_end, db);
+//	vector<string>::iterator it;
+//	for(it=inVec.begin(); it!=inVec.end(); ++it)
+//	{
+//		if((*it).empty() == false)
+//		{
+//			string sel = query + *it;
+//			if (portal->query(sel) == false)
+//			{
+//				delete portal;
+//				return svec;
+//			}
+//			while (portal->fetchRow())
+//				svec.push_back(portal->getData(0));
+//			portal->freeResult();
+//		}
+//	}
+//	delete portal;
+//	return svec;
+//}
+//
+map<string, vector<string> > getObject2ItemsMap(TeTheme* theme, vector<string>& itens)
+{
+	map<string, vector<string> > outMap;
+	if(!theme)
+		return outMap;
+
+	TeDatabase* db = 0;
+	if(theme->getProductId() == TeEXTERNALTHEME)
+		db = static_cast<TeExternalTheme*>(theme)->getSourceDatabase();
+	else if(theme->getProductId() == TeTHEME)
+		db = static_cast<TeTheme*>(theme)->layer()->database();
+
+	if(db == 0)
+		return outMap;
+
+	TeDatabasePortal* portal = db->getPortal();
+	string C = theme->collectionTable();
+	string CA = theme->collectionAuxTable();
+
+	string query = "SELECT " + C + ".c_object_id, " + CA + ".unique_id FROM " + C + " LEFT JOIN " + CA;
+	query += " ON " + C + ".c_object_id = " + CA + ".object_id";
+	query += " WHERE " + CA + ".unique_id IN ";
+  
+  vector< string >::iterator it_begin = itens.begin();
+  vector< string >::iterator it_end = itens.end();   
+
+	vector<string> inVec = generateInClauses(it_begin, it_end, db, false);
+	vector<string>::iterator it;
+	for(it=inVec.begin(); it!=inVec.end(); ++it)
+	{
+		if((*it).empty() == false)
+		{
+			string sel = query + *it;
+			if (portal->query(sel) == false)
+			{
+				delete portal;
+				return outMap;
+			}
+			while (portal->fetchRow())
+				outMap[portal->getData(0)].push_back(portal->getData(1));
+			portal->freeResult();
+		}
+	}
+	delete portal;
+
+	return outMap;
+}
+
+vector<string>
+generateItemsInClauseVec(TeTheme* theme, string& where)
+{
+	vector<string> inClauseVector;
+	TeDatabase* db = 0;
+	string	CT = theme->collectionTable();
+	string	CA = theme->collectionAuxTable();
+	string	from = " FROM " + CT + " LEFT JOIN " + CA + " ON " + CT + ".c_object_id = " + CA + ".object_id";
+
+	if(theme->getProductId()==TeTHEME)
+		db = theme->layer()->database();
+	else if(theme->getProductId()==TeEXTERNALTHEME)
+		db = ((TeExternalTheme*) theme)->getSourceDatabase();
+
+	if(db == 0)
+		return inClauseVector;
+
+	TeDatabasePortal* portal = db->getPortal();
+	string sel = "SELECT " + CT + ".c_object_id, " + CA + ".unique_id " + from;
+
+	if(where.empty() == false)
+		sel += " " + where;
+
+	map<string, vector<string> > objMap;
+	if(portal->query(sel))
+	{
+		while(portal->fetchRow())
+			objMap[portal->getData(0)].push_back(portal->getData(1));
+	}
+
+	map<string, vector<string> >::iterator mit;
+	vector<string>::iterator it;
+
+	int i, chunkSize = 200;
+	string inClause;
+	
+	i = 0;
+	bool chunk = true;
+	for(mit=objMap.begin(); mit!=objMap.end(); ++mit)
+	{
+		if (chunk == true)
+		{
+			chunk = false;
+			if (!inClause.empty())
+			{
+				inClause[inClause.size() - 1] = ')';
+				inClauseVector.push_back(inClause);
+				inClause.clear();
+			}
+			inClause = "(";
+		}
+		for(it=mit->second.begin(); it!=mit->second.end(); ++it)
+		{
+			inClause += *it + ",";
+			i++;
+			if (i%chunkSize == 0)
+				chunk = true;
+		}
+	}
+	if (!inClause.empty())
+	{
+		inClause[inClause.size() - 1] = ')';
+		inClauseVector.push_back(inClause);
+	}
+	return inClauseVector;
+}
+
+TeViewNode* findNode(const std::set<TeViewNode*>& orphanNodes, const int nodeId)
+{
+	TeViewNode* node = NULL;
+	std::set<TeViewNode*>::const_iterator it;
+
+	for(it = orphanNodes.begin(); it != orphanNodes.end(); ++it)
+	{
+		node = ((*it)->id() == nodeId) ? *it : 
+				(*it)->type() == TeTREE ? 
+				   ((TeViewTree*)(*it))->find(nodeId) :
+				    NULL;
+
+		if(node != NULL)
+		{
+			break;
+		}
+	}
+
+	return node;
+}
+
+void updateNodesTrees(std::set<TeViewNode*>& orphanNodes, TeView* view)
+{
+	std::set<TeViewNode*>::iterator it;
+
+	while(!orphanNodes.empty())
+	{
+		it = orphanNodes.begin();
+		TeViewNode* node = *it;
+
+		TeViewNode* group = findNode(orphanNodes, node->parentId());
+
+		if(group == NULL)
+		{
+			group = view->root()->find(node->parentId());
+		}
+
+		if(group != NULL)
+		{
+			int pri = node->priority();
+			group->add(node, false);
+			node->priority(pri);
+		}
+
+		orphanNodes.erase(node);
+	}
+}
+
+bool loadViewSetAndThemeGroups(TeDatabase* db, const std::string& userName)
+{
+	std::vector<TeAbstractTheme*> vecExternalThemes;
+	std::set<TeViewNode*> orphanNodes;
+
+	//clear view map
+	TeViewMap::iterator it = db->viewMap().begin();
+	while (it != db->viewMap().end())
+	{
+		if(it->second)
+			delete it->second;
+		++it;
+	}
+	db->viewMap().clear();
+
+	//clear theme map
+	TeThemeMap::iterator itTheme = db->themeMap().begin();
+	while (itTheme != db->themeMap().end())
+	{
+		if(itTheme->second)
+			delete itTheme->second;
+		++itTheme;
+	}
+
+	//clear invalid theme map
+	itTheme = db->invalidThemeMap().begin();
+	while (itTheme != db->invalidThemeMap().end())
+	{
+		if(itTheme->second)
+			delete itTheme->second;
+		++itTheme;
+	}
+	db->invalidThemeMap().clear();
+	db->themeMap().clear();
+	db->legendMap().clear();
+	
+	//load view, projection, themes and grouping
+	string sql = " SELECT ";
+	sql += " te_view.*, "; //0-9  (10 columns)
+	sql += " te_projection.*, "; //10 - 26 (17 columns)
+	sql += " te_theme.*, "; // 27 - 46 (20 columns)
+	sql += " te_grouping.*, "; //47 - 56 (10 columns)
+	sql += " te_legend.*,  "; // 57 - 63    (7 columns)
+	sql += " te_visual.*, "; //  64 - 87 (24 columns)
+	sql += " te_visual_raster.* "; //  88 (7 columns)
+
+	sql += " FROM ((((((te_view INNER JOIN te_projection ";
+	sql += " ON te_view.projection_id = te_projection.projection_id) ";
+	sql += " LEFT JOIN te_theme ON te_view.view_id = te_theme.view_id ) ";
+	sql += " LEFT JOIN te_grouping ON te_theme.theme_id = te_grouping.theme_id) ";
+	sql += " LEFT JOIN te_legend ON te_theme.theme_id = te_legend.theme_id) ";
+	sql += " LEFT JOIN te_visual ON te_visual.legend_id = te_legend.legend_id) ";
+	sql += " LEFT JOIN te_visual_raster ON te_theme.theme_id = te_visual_raster.theme_id) ";
+			
+	sql += " WHERE ";
+	if (!userName.empty())
+		sql += " te_view.user_name = '" + userName + "'";
+	else
+		sql += " te_view.user_name = '" + db->user() + "'";
+	sql += " ORDER BY te_view.view_id, te_theme.priority, te_theme.theme_id, te_legend.legend_id, ";
+	sql += " te_legend.group_id, te_visual.geom_type, te_visual_raster.band_in  "; 
+
+	TeDatabasePortal* portal = db->getPortal();
+	if (!portal)
+		return false;
+	
+	if (!portal->query(sql))
+	{	
+		delete portal;
+		return false;
+	}
+	
+	int lastViewId = -1;
+	TeView *view = 0;
+	bool hasNewRow = portal->fetchRow(); //idicates that this portal was fetched 
+	while(hasNewRow)
+	{
+		//load view and its projection 
+		if(lastViewId!=atoi(portal->getData(0)))
+		{
+			//store the last view
+			if(view)
+			{
+				updateNodesTrees(orphanNodes, view);
+				db->viewMap()[view->id()] = view;
+				view = 0;
+			}
+			TeProjection* proj = 0;
+			if(!portal->getProjection(&proj, 10)) //load projection
+			{
+				delete portal;
+				return false;
+			}
+			view = new TeView();
+			if(!portal->getView(*view, 0)) //load view
+			{
+				delete portal;
+				delete view;
+				return false;
+			}
+			if (proj != 0)
+				view->projection(proj);
+			lastViewId = view->id();
+		}  
+		
+		//make the rigth object
+		string aux = portal->getData(27);
+		if (aux.empty())
+		{
+			hasNewRow = portal->fetchRow();
+			continue;
+		}
+
+		TeViewNodeType viewNodeType = (TeViewNodeType)portal->getInt(33);
+
+		if(viewNodeType == TeTREE)
+		{
+			TeViewTree* vTree = new TeViewTree;
+			vTree->id(portal->getInt(27));
+			vTree->view(portal->getInt(29));
+			vTree->name(portal->getData(30));
+			int parentId = portal->getInt(31);
+			vTree->priority(portal->getInt(32));
+			
+			if(vTree->id() == parentId)
+			{
+				view->add(vTree, false);
+			}
+			else
+			{
+				orphanNodes.insert(vTree);
+			}
+
+			vTree->parentId(parentId);
+			
+			hasNewRow = portal->fetchRow();
+			continue;
+		}
+		else 
+		{
+			TeViewNode* viewNode = TeViewNodeFactory::make(viewNodeType);
+
+			if(!viewNode)
+			{
+				int currentThemeId = portal->getInt(27);
+
+				while((hasNewRow = portal->fetchRow()) && (portal->getInt(27) == currentThemeId))
+					;
+
+				continue;
+			}
+
+			if(!portal->getTheme(static_cast<TeAbstractTheme&>(*viewNode), 27))
+			{
+				delete viewNode;
+				delete portal;
+				return false;
+			}
+
+			if(viewNodeType == TeTHEME)
+			{
+				//load layer
+				int id = static_cast<TeTheme*>(viewNode)->layerId();
+				TeLayerMap::iterator it = db->layerMap().find(id);
+				if (it == db->layerMap().end())
+					db->loadLayerSet();
+				
+				static_cast<TeTheme*>(viewNode)->layer(db->layerMap()[id]);
+			}
+			
+			TeAbstractTheme* theme = static_cast<TeAbstractTheme*>(viewNode);
+
+			//load grouping 
+			TeGrouping group;
+			if(portal->getGrouping(group, 47))
+				theme->grouping(group);
+
+			//load all legends of this theme
+			//and its visual
+			bool hasLegsToThisTheme = true;
+			while(hasLegsToThisTheme)
+			{
+				//legend
+				TeLegendEntry legend;
+				if(!portal->getLegend(legend, 57))
+				{
+					delete theme;
+					delete view;
+					delete portal;
+					return false;
+				}
+
+				//visual
+				TeRasterVisual* rasterVisual = theme->rasterVisual();
+				if(rasterVisual == NULL)
+				{
+					rasterVisual = new TeRasterVisual();
+				}
+				bool hasVisualToThisLeg = true;
+				bool hasRasterVisual = false;
+				while(hasVisualToThisLeg)
+				{
+					TeVisual* visual = TeVisualFactory::make("tevisual");
+					TeGeomRep geomRep;
+					if(portal->getVisual(visual, geomRep, 64))
+						legend.setVisual(visual, geomRep);
+										
+					if(rasterVisual != NULL && portal->getRasterVisual(*rasterVisual, 88))
+						hasRasterVisual=true;
+					
+					hasNewRow = portal->fetchRow();
+					if(!hasNewRow || portal->getInt(59)!= legend.group() || portal->getInt(57)!= legend.id())
+						hasVisualToThisLeg = false;
+				}
+
+				//Set raster visual to this theme
+				if(hasRasterVisual)
+					theme->rasterVisual(rasterVisual);
+				else
+					delete rasterVisual;
+
+				//Set legend to this theme
+				theme->legend(legend); 
+																
+				//fill legend buffer
+				if(legend.group() == -6)	
+					db->legendMap()[legend.id()] = &theme->queryAndPointingLegend();
+				else if(legend.group() == -5)	
+					db->legendMap()[legend.id()] = &theme->queryLegend(); 
+				else if (legend.group() == -4)
+					db->legendMap()[legend.id()] = &theme->pointingLegend(); 
+				else if (legend.group() == -3)
+					db->legendMap()[legend.id()] = &theme->defaultLegend(); 
+				else if (legend.group() == -2)
+					db->legendMap()[legend.id()] = &theme->withoutDataConnectionLegend(); 
+				else if (legend.group() == -1)
+					db->legendMap()[legend.id()] = &theme->outOfCollectionLegend(); 
+				else if (legend.group() == -10) //own legend
+				{
+					TeLegendEntry* legendTemp = new TeLegendEntry(legend);
+					db->legendMap()[legend.id()] = legendTemp;
+				}				
+				
+				if(!hasNewRow || portal->getInt(27)!= theme->id())
+					hasLegsToThisTheme = false;
+			}
+				
+			for (unsigned int i = 0; i < theme->legend().size(); ++i)
+				db->legendMap()[theme->legend()[i].id()] = &theme->legend()[i];
+
+			if(viewNode->type()==(int)TeTHEME)
+			{
+				//load theme table
+				if(!db->loadThemeTable(static_cast<TeTheme*>(theme)))
+				{
+					delete portal;
+					return false;
+				}
+			}
+			
+			if(viewNode->type() != (int)TeEXTERNALTHEME)
+			{
+				//load specific theme parameters
+				if(!theme->loadMetadata(db))
+				{
+					db->invalidThemeMap()[viewNode->id()] = theme;
+					continue;
+				}
+				db->themeMap()[viewNode->id()] = theme;
+			}
+			else
+			{
+				vecExternalThemes.push_back(theme);
+			}
+			
+			int pri = theme->priority();
+
+			//verifica se o tema pertence a algum agrupamento.
+			if(theme->parentId() != 0 && theme->id() != theme->parentId())
+			{
+				orphanNodes.insert(theme);
+			}
+			else
+			{
+				view->add(theme, false);
+			}
+
+			theme->priority(pri);
+		}
+	}
+
+	//store the last view
+	if(view)
+	{
+		updateNodesTrees(orphanNodes, view);
+		db->viewMap()[view->id()] = view;
+		view = 0;
+	}
+
+	if(!vecExternalThemes.empty())
+	{
+		if(!db->loadExternalThemes(vecExternalThemes))
+		{
+			//todos se tornam invalidos
+			for(unsigned int i = 0; i < vecExternalThemes.size(); ++i)
+			{
+				TeView* view = db->viewMap()[vecExternalThemes[i]->view()];
+
+				db->invalidThemeMap()[vecExternalThemes[i]->id()] = vecExternalThemes[i];
+				view->remove(vecExternalThemes[i]->id());
+			}
+			return true;
+		}
+
+		TeViewMap::iterator itView = db->viewMap().begin();
+		while(itView != db->viewMap().end())
+		{
+			unsigned int i = 0;
+			while(i < itView->second->themes().size())
+			{
+				unsigned int id = itView->second->themes()[i]->id();
+				if(db->invalidThemeMap().find(id) != db->invalidThemeMap().end())
+					itView->second->remove(id);
+				else
+					++i;
+			}
+			++itView;
+		}
+	}
+
+	delete portal;
+	return true;
+}
+
+bool TeCopyView(TeView* view, TeDatabase* inputDatabase, const std::string& newViewName, const std::string& newViewUser, const std::set<int>& setThemeIds, TeDatabase* outputDatabase, std::vector<bool>& vecResult)
+{
+	TeDatabase* dbIn = inputDatabase;
+	TeDatabase* dbOut = outputDatabase;
+	if(dbOut == NULL)
+	{
+		dbOut = dbIn;
+	}
+
+	/*if(!dbOut->beginTransaction())
+	{
+		return false;
+	}*/
+
+	TeProjection* proj = view->projection();
+	TeProjection* newProjection = TeProjectionFactory::make(proj->params());
+
+	TeView* newView = new TeView(newViewName, newViewUser);
+	newView->setCurrentBox(view->getCurrentBox());
+	newView->projection(newProjection);
+
+	/*if(!dbOut->insertView(newView))
+	{
+		delete newView;
+		dbOut->rollbackTransaction();
+		return false;
+	}*/	
+
+	if(!dbOut->insertView(newView))
+	{
+		delete newView;
+		return false;
+	}
+
+	for(unsigned int th = 0; th < view->size(); ++th)
+	{
+		TeViewNode* node = view->get(th);
+
+		if(!setThemeIds.empty())
+		{
+			if(setThemeIds.find(node->id()) == setThemeIds.end())
+			{
+				continue;
+			}
+		}
+
+		TeViewNode* viewNode = TeCopyViewNode(node, dbIn, dbOut, newView->id());
+		bool result = false;
+		if(viewNode != NULL)
+		{
+			result = true;
+		}
+		vecResult.push_back(result);
+
+		/*if(!TeCopyViewNode(node, dbIn, dbOut, newView->id()))
+		{			
+			TeViewMap::iterator it = dbOut->viewMap().find(newView->id());
+			if(it != dbOut->viewMap().end())
+			{
+				dbOut->viewMap().erase(it);
+			}
+			delete newView;
+			dbOut->rollbackTransaction();
+			return false;
+		}*/
+	}
+
+	/*if(!dbOut->commitTransaction())
+	{
+		dbOut->rollbackTransaction();
+		return false;
+	}*/
+
+	return true;
+}
+
+TeViewNode* TeCopyViewNode(TeViewNode* node, TeDatabase* inputDatabase, TeDatabase* outputDatabase, const int& newViewId)
+{
+	if(node == NULL)
+	{
+		return NULL;
+	}
+
+	if(!outputDatabase->beginTransaction())
+	{
+		return NULL;
+	}
+
+	TeViewNode* newViewNode = NULL;
+	if (node->type() == TeTREE)
+	{
+		TeViewTree* tree = dynamic_cast<TeViewTree*>(node);
+		if(tree == NULL)
+		{
+			outputDatabase->rollbackTransaction();
+			return NULL;
+		}
+
+		TeViewTree* newTree = new TeViewTree(tree->viewNodeParams());
+		newTree->id(0);
+
+		if(!outputDatabase->insertViewTree(newTree))
+		{
+			outputDatabase->rollbackTransaction();
+			delete newTree;
+			return NULL;
+		}
+
+		std::vector<TeViewNode*>& vecNodes = tree->nodes();
+		for(unsigned int i = 0; i < vecNodes.size(); ++i)
+		{
+			int parentId = vecNodes[i]->parentId();
+			vecNodes[i]->parentId(newTree->id());
+
+			TeViewNode* newChild = TeCopyViewNode(vecNodes[i], inputDatabase, outputDatabase, newViewId);
+			
+			vecNodes[i]->parentId(parentId);
+
+			if(newChild == NULL)
+			{
+				outputDatabase->rollbackTransaction();
+				delete newTree;
+				return NULL;
+			}
+			newTree->add(newChild);
+		}
+
+		newViewNode = newTree;
+	}
+	else
+	{
+		newViewNode = node->clone();
+		newViewNode->view(newViewId);
+		newViewNode->id(0);
+		if(node->id() == node->parentId() || node->parentId() == 0)
+		{
+			newViewNode->parentId(0);
+		}
+
+		TeAbstractTheme* newAbsTheme = dynamic_cast<TeAbstractTheme*>(newViewNode);
+		if(newAbsTheme == NULL)
+		{
+			outputDatabase->rollbackTransaction();
+			delete newViewNode;
+			return NULL;
+		}
+
+		if(newAbsTheme->type() == TeTHEME || newAbsTheme->type() == TeEXTERNALTHEME)
+		{
+			TeTheme* theme = dynamic_cast<TeTheme*>(node);
+			TeTheme* newTheme = dynamic_cast<TeTheme*>(newAbsTheme);
+			if(newTheme != NULL)
+			{
+				newTheme->collectionTable("");
+				newTheme->collectionAuxTable("");
+				
+				if(newAbsTheme->type() == TeTHEME)
+				{
+					bool found = false;
+
+					TeLayerMap& layerMap = outputDatabase->layerMap();
+					TeLayerMap::iterator itLayer = layerMap.begin();
+					while(itLayer != layerMap.end())
+					{
+						if(theme->layer()->name() == itLayer->second->name())
+						{
+							newTheme->layer(itLayer->second);
+							found = true;
+							break;
+						}
+						++itLayer;
+					}
+
+					if(found == false)
+					{
+						TeLayer* outputLayer = new TeLayer(theme->layer()->name(), outputDatabase, theme->layer()->projection());
+						if(!TeCopyLayerToLayer(theme->layer(), outputLayer))
+						{
+							outputDatabase->rollbackTransaction();
+							delete newViewNode;
+							return NULL;
+						}
+						newTheme->layer(outputLayer);						
+					}
+		
+					TeAttrTableVector tableVectorInExternal;
+					inputDatabase->getAttrTables(tableVectorInExternal, TeAttrExternal);
+
+					for(unsigned int i = 0; i < tableVectorInExternal.size(); ++i)
+					{
+						if(!outputDatabase->tableExist(tableVectorInExternal[i].name()))
+						{
+							if(!outputDatabase->createTable(tableVectorInExternal[i].name(), tableVectorInExternal[i].attributeList()))
+							{
+								outputDatabase->rollbackTransaction();
+								delete newViewNode;
+								return NULL;
+							}
+							TeTable& table = tableVectorInExternal[i];
+							table.setId(-1);
+							if(!outputDatabase->insertTableInfo(-1, table))
+							{
+								outputDatabase->rollbackTransaction();
+								delete newViewNode;
+								return NULL;
+							}
+
+							if(!TeCopyTable(inputDatabase, tableVectorInExternal[i].name(), outputDatabase, tableVectorInExternal[i].name()))
+							{
+								outputDatabase->rollbackTransaction();
+								delete newViewNode;
+								return NULL;
+							}
+						}
+					}
+
+					TeAttrTableVector& tableVectorIn = theme->attrTables();
+					TeAttrTableVector tableVectorOut;
+
+					for(unsigned int i = 0; i < tableVectorIn.size(); ++i)
+					{
+						TeTable attTable(tableVectorIn[i].name());
+						outputDatabase->loadTableInfo(attTable); 
+						if(tableVectorIn[i].tableType() == TeAttrExternal)
+						{
+							// Gets the related table id from output database
+							std::string relatedTableName = tableVectorIn[i].relatedTableName();
+							TeTable relatedTable(relatedTableName);
+							outputDatabase->loadTableInfo(relatedTable);							
+							// Updates the external table
+							attTable.setTableType(TeAttrExternal, relatedTable.id(), tableVectorIn[i].relatedAttribute());
+							attTable.relatedTableName(relatedTableName);
+							attTable.setLinkName(tableVectorIn[i].linkName());
+						}
+						tableVectorOut.push_back(attTable);
+					}
+					newTheme->setAttTables(tableVectorOut);
+				}				
+			}
+		}
+		else if(newAbsTheme->type() == TeFILETHEME)
+		{
+			TeFileTheme* newTheme = dynamic_cast<TeFileTheme*>(newAbsTheme);
+			if(newTheme != NULL)
+			{
+				if(!newTheme->createFileThemeTable(outputDatabase))
+				{
+					outputDatabase->rollbackTransaction();
+					delete newViewNode;
+					return NULL;
+				}
+
+				newTheme->setLocalDatabase(outputDatabase);
+				TeProjection* projIn = newTheme->getThemeProjection();
+				TeProjection* projOut = TeProjectionFactory::make(projIn->params());
+
+				if(!outputDatabase->insertProjection(projOut))
+				{
+					outputDatabase->rollbackTransaction();
+					delete newViewNode;
+					return NULL;
+				}
+
+				newTheme->setThemeProjection(projOut);
+			}			
+		}
+
+		if(newAbsTheme->type() == TeEXTERNALTHEME)
+		{
+			TeExternalTheme* newExternalTheme = dynamic_cast<TeExternalTheme*>(newAbsTheme);
+			if(newExternalTheme == NULL)
+			{
+				outputDatabase->rollbackTransaction();
+				delete newViewNode;
+				return NULL;
+			}
+
+			TeDBConnectionsPool::createDBConnectionTable(outputDatabase);
+			if(newExternalTheme->createExternalThemeTable(outputDatabase) == 0)
+			{
+				outputDatabase->rollbackTransaction();
+				delete newViewNode;
+				return NULL;
+			}
+
+			TeDatabase* remoteDb = newExternalTheme->getRemoteTheme()->layer()->database();
+			TeDBConnectionsPool::instance().saveExternalDBConnection(outputDatabase, remoteDb);
+			int dbId = TeDBConnectionsPool::instance().getDatabaseIdx(remoteDb);
+
+			newExternalTheme->setSourceDatabase(outputDatabase);
+			newExternalTheme->setRemoteDbId(dbId);
+
+			if(!newExternalTheme->save())
+			{
+				outputDatabase->rollbackTransaction();
+				delete newViewNode;
+				return NULL;
+			}
+		}
+		else
+		{
+			if(!newAbsTheme->save())
+			{
+				outputDatabase->rollbackTransaction();
+				delete newViewNode;
+				return NULL;
+			}
+		}
+
+		
+//copies the collection, if necessary
+		if(newAbsTheme->type() == TeTHEME || newAbsTheme->type() == TeEXTERNALTHEME)
+		{
+			TeTheme* theme = dynamic_cast<TeTheme*>(node);
+			TeTheme* newTheme = dynamic_cast<TeTheme*>(newAbsTheme);
+			if(theme != NULL && newTheme != NULL)
+			{
+				if(inputDatabase->tableExist(theme->collectionTable()) && outputDatabase->tableExist(newTheme->collectionTable()))
+				{
+					if(!TeCopyTable(inputDatabase, theme->collectionTable(), outputDatabase, newTheme->collectionTable()))
+					{
+						outputDatabase->rollbackTransaction();
+						delete newViewNode;
+						return NULL;
+					}
+				}
+				if(inputDatabase->tableExist(theme->collectionAuxTable()) && outputDatabase->tableExist(newTheme->collectionAuxTable()))
+				{
+					if(newAbsTheme->type() == TeTHEME)
+					{
+						newTheme->populateCollectionAux();
+					}
+					/*TeAttributeList attrListColAuxIn;
+					if(!inputDatabase->getAttributeList(theme->collectionAuxTable(), attrListColAuxIn))
+					{
+					}
+					for(unsigned int i = 0; i < attrListColAuxIn.size(); ++i)
+					{
+						TeAttribute attrOut;
+						if(!outputDatabase->columnExist(newTheme->collectionAuxTable(), attrListColAuxIn[i].rep_.name_, attrOut))
+						{
+							if(!outputDatabase->addColumn(newTheme->collectionAuxTable(), attrListColAuxIn[i].rep_))
+							{
+								outputDatabase->rollbackTransaction();
+								delete newViewNode;
+								return NULL;
+							}
+						}
+					}
+
+					if(!TeCopyTable(inputDatabase, theme->collectionAuxTable(), outputDatabase, newTheme->collectionAuxTable()))
+					{
+						outputDatabase->rollbackTransaction();
+						delete newViewNode;
+						return NULL;
+					}*/
+				}
+				
+			}
+		
+			if(theme->grouping().groupMode_ != TeNoGrouping)
+			{
+				TeGrouping grouping;
+				grouping = theme->grouping();				
+				if(!newTheme->buildGrouping(grouping))
+				{
+					outputDatabase->rollbackTransaction();
+					delete newViewNode;
+					return NULL;
+				}
+				TeLegendEntryVector& legends = theme->legend();
+				for (unsigned int nl=0; nl<legends.size(); nl++)
+				{
+					if(!newTheme->setGroupingVisual(nl+1,legends[nl].getVisualMap()))
+					{
+						outputDatabase->rollbackTransaction();
+						delete newViewNode;
+						return NULL;
+					}
+				}
+				if(!newTheme->saveGrouping())
+				{
+					outputDatabase->rollbackTransaction();
+					delete newViewNode;
+					return NULL;
+				}
+				if(!newTheme->saveLegendInCollection())
+				{
+					outputDatabase->rollbackTransaction();
+					delete newViewNode;
+					return NULL;
+				}
+			}
+		}
+	}
+
+	if(newViewNode != NULL)
+	{
+		if(!outputDatabase->commitTransaction())
+		{
+			outputDatabase->rollbackTransaction();
+		}
+	}
+	else
+	{
+		outputDatabase->rollbackTransaction();		
+	}
+
+	return newViewNode;
+}
+
+bool TeCopyTable(TeDatabase* inputDatabase, const std::string& inputTable, TeDatabase* outputDatabase, const std::string& outputTable)
+{
+	if(!inputDatabase->tableExist(inputTable) || !outputDatabase->tableExist(outputTable))
+	{
+		return false;
+	}
+
+	TeDatabasePortal* portal = inputDatabase->getPortal();
+	std::string sql = "SELECT * FROM " + inputTable;
+	if(!portal->query(sql))
+	{
+		return false;
+	}
+	
+	TeAttributeList& attrList = portal->getAttributeList();
+
+	unsigned int numColumns = attrList.size();
+
+	TeTable table(outputTable);
+	table.setAttributeList(attrList);
+
+	while(portal->fetchRow())
+	{
+		TeTableRow row;
+		for(unsigned int i = 0; i < numColumns; ++i)
+		{
+			row.push_back(portal->getData(i));
+		}
+		table.add(row);
+
+		if(table.size() % 100 == 0)
+		{
+			if(!outputDatabase->insertTable(table))
+			{
+				delete portal;
+				return false;
+			}
+			table.clear();
+		}	
+	}
+
+	if(table.size() > 0)
+	{
+		if(!outputDatabase->insertTable(table))
+		{
+			delete portal;
+			return false;
+		}
+	}
+	table.clear();
+
+	delete portal;
+
+	return true;
+}
+
+
diff --git a/src/terralib/utils/TeDatabaseUtils.h b/src/terralib/utils/TeDatabaseUtils.h
old mode 100755
new mode 100644
index 9824915..0d83032
--- a/src/terralib/utils/TeDatabaseUtils.h
+++ b/src/terralib/utils/TeDatabaseUtils.h
@@ -1,122 +1,124 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeDatabaseUtils.h
-    \brief This file contains some utilitary functions to extended the TerraLib data model for TerraView like applications.
-*/
-#ifndef __TERRALIB_INTERNAL_DATABASEUTILS_H
-#define __TERRALIB_INTERNAL_DATABASEUTILS_H
-
-
-#include <TeDatabase.h>
-#include <TeExternalTheme.h>
-#include <string>
-#include <vector>
-using std::string;
-using std::vector;
-
-
-/** @defgroup DBUtils Utilitary functions
-    @ingroup  DatabaseUtils
-	A set of utilitary functions
- *  @{
- */
-/**  This function copies the contents of a TerraLib database to another TerraLib database
-	\param dbFrom A pointer to the source database
-	\param dbTo	  A pointer to the destination database
-*/
-bool TeCopyDatabase(TeDatabase* dbFrom, TeDatabase* dbTo);
-
-
-/** Returns true whether a database contains the TerraLib data model
-	\param db	pointer do a TerraLib database
-*/
-bool isTerralibModel(TeDatabase* db);
-
-vector<string> generateItemsInClauseVec(TeTheme* theme, string& where);
-
-vector<string> getObjects(TeTheme* theme, int sel);
-
-vector<string> getItems(TeTheme* theme, int sel);
-
-vector<string> getObjects(TeTheme* theme, vector<string>& itens);
-
-map<string, vector<string> > getObject2ItemsMap(TeTheme* theme, vector<string>& itens);
-
-vector<string> getItems(TeTheme* theme, vector<string>& objcts);
-
-template <typename Iterator>
-vector<string>
-generateItemsInClauses(Iterator& begin, Iterator& end, TeTheme* theme)
-{
-	vector<string> itenVec;
-	Iterator temp = begin;
-	while (temp != end)
-	{
-		itenVec.push_back(*temp);
-		temp++;
-	}
-
-	map<string, vector<string> > objMap = getObject2ItemsMap(theme, itenVec);
-	map<string, vector<string> >::iterator mit;
-	vector<string>::iterator it;
-
-	int i, chunkSize = 200;
-	string inClause;
-	vector<string> inClauseVector;
-	
-	i = 0;
-	bool chunk = true;
-	for(mit=objMap.begin(); mit!=objMap.end(); ++mit)
-	{
-		if (chunk == true)
-		{
-			chunk = false;
-			if (!inClause.empty())
-			{
-				inClause[inClause.size() - 1] = ')';
-				inClauseVector.push_back(inClause);
-				inClause.clear();
-			}
-			inClause = "(";
-		}
-		for(it=mit->second.begin(); it!=mit->second.end(); ++it)
-		{
-			inClause += *it + ",";
-			i++;
-			if (i%chunkSize == 0)
-				chunk = true;
-		}
-	}
-	if (!inClause.empty())
-	{
-		inClause[inClause.size() - 1] = ')';
-		inClauseVector.push_back(inClause);
-	}
-	return inClauseVector;
-}
-
-
-//@}
-
-#endif
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeDatabaseUtils.h
+    \brief This file contains some utilitary functions to extended the TerraLib data model for TerraView like applications.
+*/
+#ifndef __TERRALIB_INTERNAL_DATABASEUTILS_H
+#define __TERRALIB_INTERNAL_DATABASEUTILS_H
+
+
+#include <TeDatabase.h>
+#include <TeExternalTheme.h>
+#include <string>
+#include <vector>
+
+#include "TeUtilsDefines.h"
+
+using std::string;
+using std::vector;
+
+
+/** @defgroup DBUtils Utilitary functions
+    @ingroup  DatabaseUtils
+	A set of utilitary functions
+ *  @{
+ */
+/**  This function copies the contents of a TerraLib database to another TerraLib database
+	\param dbFrom A pointer to the source database
+	\param dbTo	  A pointer to the destination database
+*/
+TLUTILS_DLL bool TeCopyDatabase(TeDatabase* dbFrom, TeDatabase* dbTo);
+
+
+/** Returns true whether a database contains the TerraLib data model
+	\param db	pointer do a TerraLib database
+*/
+TLUTILS_DLL bool isTerralibModel(TeDatabase* db);
+
+TLUTILS_DLL vector<string> generateItemsInClauseVec(TeTheme* theme, string& where);
+
+TLUTILS_DLL map<string, vector<string> > getObject2ItemsMap(TeTheme* theme, vector<string>& itens);
+
+template <typename Iterator>
+vector<string>
+generateItemsInClauses(Iterator& begin, Iterator& end, TeTheme* theme)
+{
+	vector<string> itenVec;
+	Iterator temp = begin;
+	while (temp != end)
+	{
+		itenVec.push_back(*temp);
+		temp++;
+	}
+
+	map<string, vector<string> > objMap = getObject2ItemsMap(theme, itenVec);
+	map<string, vector<string> >::iterator mit;
+	vector<string>::iterator it;
+
+	int i, chunkSize = 200;
+	string inClause;
+	vector<string> inClauseVector;
+	
+	i = 0;
+	bool chunk = true;
+	for(mit=objMap.begin(); mit!=objMap.end(); ++mit)
+	{
+		if (chunk == true)
+		{
+			chunk = false;
+			if (!inClause.empty())
+			{
+				inClause[inClause.size() - 1] = ')';
+				inClauseVector.push_back(inClause);
+				inClause.clear();
+			}
+			inClause = "(";
+		}
+		for(it=mit->second.begin(); it!=mit->second.end(); ++it)
+		{
+			inClause += *it + ",";
+			i++;
+			if (i%chunkSize == 0)
+				chunk = true;
+		}
+	}
+	if (!inClause.empty())
+	{
+		inClause[inClause.size() - 1] = ')';
+		inClauseVector.push_back(inClause);
+	}
+	return inClauseVector;
+}
+
+TLUTILS_DLL bool loadViewSetAndThemeGroups(TeDatabase* db, const std::string& userName);
+
+TLUTILS_DLL bool TeCopyView(TeView* view, TeDatabase* inputDatabase, const std::string& newViewName, const std::string& newViewUser, const std::set<int>& setThemeIds, TeDatabase* outputDatabase, std::vector<bool>& vecResult);
+
+TLUTILS_DLL TeViewNode* TeCopyViewNode(TeViewNode* node, TeDatabase* inputDatabase, TeDatabase* outputDatabase, const int& newViewId);
+
+TLUTILS_DLL bool TeCopyTable(TeDatabase* inputDatabase, const std::string& inputTable, TeDatabase* outputDatabase, const std::string& outputTable);
+
+//@}
+
+#endif
+
diff --git a/src/terralib/utils/TeUpdateDBVersion.cpp b/src/terralib/utils/TeUpdateDBVersion.cpp
old mode 100755
new mode 100644
index 96d19d6..28f3a75
--- a/src/terralib/utils/TeUpdateDBVersion.cpp
+++ b/src/terralib/utils/TeUpdateDBVersion.cpp
@@ -1,1641 +1,1737 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#include "TeUpdateDBVersion.h"
-
-bool isLowerVersion(const std::string& version1, const std::string& version2)
-{
-	bool isLower = false;
-
-	std::vector<std::string> vecVersion1;
-	std::vector<std::string> vecVersion2;
-	
-	TeSplitString(version1, ".", vecVersion1);
-	TeSplitString(version2, ".", vecVersion2);
-
-	if(vecVersion1.size() < vecVersion2.size())
-	{
-		for(unsigned int i = vecVersion1.size(); i < vecVersion2.size(); ++i)
-		{
-			vecVersion1.push_back("0");
-		}
-	}
-	else if(vecVersion2.size() < vecVersion1.size())
-	{
-		for(unsigned int i = vecVersion2.size(); i < vecVersion1.size(); ++i)
-		{
-			vecVersion2.push_back("0");
-		}
-	}
-
-	for(unsigned int i = 0; i < vecVersion1.size(); ++i)
-	{
-		int sub1 = atoi(vecVersion1[i].c_str());
-		int sub2 = atoi(vecVersion2[i].c_str());
-
-		if(sub1 != sub2)
-		{
-			if(sub1 < sub2)
-			{
-				isLower = true;
-			}
-			break;
-		}
-	}
-	
-	return isLower;
-}
-
-bool needUpdateDB(TeDatabase* db, string& DBversion)
-{
-	TeDatabasePortal* portal = db->getPortal();
-	if(!portal)
-		return false;
-
-	string sql = " SELECT db_version FROM te_database ";
-	//The database does not have the te_database connection
-	if(!portal->query(sql))
-	{
-		DBversion = "";
-		delete portal;
-		return false;
-	}
-
-	if(!portal->fetchRow())
-	{
-		DBversion = "";
-		delete portal;
-		return true;
-	}
-
-	DBversion = portal->getData(0);
-	if(DBversion==TeDBVERSION)
-	{
-		delete portal;
-		return false;
-	}
-	
-	delete portal;
-	return true;
-}
-
-
-bool updateDBVersion(TeDatabase* db, string& DBversion, string& errorMessage)
-{
-	//from old version to 3.0
-	db->beginTransaction();
-	if(DBversion=="")
-	{
-		if(!updateDB30To301(db, errorMessage))
-		{
-			db->rollbackTransaction();
-			return false;
-		}
-
-		if(!updateDB20To30(db, errorMessage))
-		{
-			db->rollbackTransaction();
-			return false;
-		}
-		
-		DBversion = "3.0.1";
-	}
-
-	//from 3.0 to 3.0.1
-	if(DBversion=="3.0") 
-	{
-		if(!updateDB30To301(db, errorMessage))
-		{
-			db->rollbackTransaction();
-			return false;
-		}
-
-		DBversion = "3.0.1";
-	}
-
-	//from 3.0.1 to 3.0.2
-	if(DBversion=="3.0.1") 
-	{
-		if(!updateDB301To302(db, errorMessage))
-		{
-			db->rollbackTransaction();
-			return false;
-		}
-
-		DBversion = "3.0.2";
-	}
-
-	//from 3.0.2 to 3.1.0
-	if(DBversion=="3.0.2") 
-	{
-		if(!updateDB302To310(db, errorMessage))
-		{
-			db->rollbackTransaction();
-			return false;
-		}
-
-		DBversion = "3.1.0";
-	}
-
-	if(DBversion=="3.1.0")
-	{
-		if(!updateDB310To311(db, errorMessage))
-		{
-			db->rollbackTransaction();
-			return false;
-		}
-
-		DBversion = "3.1.1";
-	}
-
-	if(DBversion=="3.1.1")
-	{
-		if(!updateDB311To320(db, errorMessage))
-		{
-			db->rollbackTransaction();
-			return false;
-		}
-		DBversion = "3.2.0";
-	}
-
-	if(DBversion=="3.2.0")
-	{
-		if(!updateDB320To3201(db, errorMessage))
-		{
-			db->rollbackTransaction();
-			return false;
-		}
-		DBversion = "3.2.0.1";
-	}
-
-	if(DBversion=="3.2.0.1")
-	{
-		if(!updateDB3201To331(db, errorMessage))
-		{
-			db->rollbackTransaction();
-			return false;
-		}
-		DBversion = "3.3.1";
-	}
-	
-	if(DBversion!=TeDBVERSION)
-	{
-		db->rollbackTransaction();
-		return false;
-	}
-
-	string del= "DELETE FROM te_database"; 
-	if(!db->execute(del))
-	{
-		db->rollbackTransaction();
-		return false;
-	}
-
-	string ins = "INSERT INTO te_database (db_version) VALUES ('"+ TeDBVERSION +"')";
-	if(!db->execute(ins))
-	{
-		db->rollbackTransaction();
-		return false;
-	}
-
-	db->commitTransaction();
-	return true;
-}
-
-
-bool updateDB20To30(TeDatabase* db, string& errorMessage)
-{
-	TeAttribute fattr;
-
-	// ----- te_grouping 
-
-	if(db->columnExist("te_grouping", "grouping_function", fattr) == false)
-	{
-		TeAttributeRep atRep;
-		atRep.type_ = TeSTRING;
-		atRep.name_ = "grouping_function";
-		atRep.numChar_ = 10;
-		if(db->addColumn("te_grouping", atRep) == false)
-		{
-			errorMessage = "The column grouping_function could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-
-		string upd;
-		if(db->columnExist("te_theme_application", "group_function", fattr))
-		{
-			upd =	" UPDATE te_grouping g, te_theme_application ta ";
-			upd +=	" SET g.grouping_function = ta.group_function ";
-			upd +=	" WHERE ta.theme_id = g.theme_id ";
-
-			if(!db->execute (upd))
-			{
-				errorMessage = db->errorMessage();
-				return false;
-			}
-
-			db->deleteColumn("te_theme_application", "group_function");
-		}
-		else
-		{
-			upd =	" UPDATE te_grouping g ";
-			upd +=	" SET g.grouping_function = 'AVG' ";
-			
-			if(!db->execute (upd))
-			{
-				errorMessage = db->errorMessage();
-				return false;
-			}
-		}
-	}
-
-	// ----- te_theme_application
-
-	if(db->columnExist("te_theme_application", "chart_function", fattr) == false)
-	{
-		TeAttributeRep atRep;
-		atRep.type_ = TeSTRING;
-		atRep.name_ = "chart_function";
-		atRep.numChar_ = 10;
-		if(db->addColumn("te_theme_application", atRep) == false)
-		{
-			errorMessage = "The column chart_function could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-		db->execute("UPDATE te_theme_application SET chart_function = 'AVG'");
-	}
-
-	// ----- te_theme 
-	if(db->columnExist("te_theme", "visible_rep", fattr) == false)
-	{
-		TeAttributeRep atRep;
-		atRep.type_ = TeINT;
-		atRep.name_ = "visible_rep";
-		if(db->addColumn("te_theme", atRep) == false)
-		{
-			errorMessage = "The column visible_rep could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-
-		atRep.name_ = "enable_visibility";
-		if(db->addColumn("te_theme", atRep) == false)
-		{
-			errorMessage = "The column enable_visibility could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-
-		string upd = " UPDATE te_theme t, te_theme_application ta ";
-		upd +=       " SET t.visible_rep = ta.visible_rep ";
-		upd +=       " WHERE ta.theme_id = t.theme_id ";
-		if(!db->execute (upd))
-		{
-			errorMessage = db->errorMessage();
-			return false;
-		}
-
-		upd =		 " UPDATE te_theme t, te_theme_application ta ";
-		upd +=       " SET t.enable_visibility = ta.enable_visibility ";
-		upd +=       " WHERE ta.theme_id = t.theme_id ";
-		if(!db->execute (upd))
-		{
-			errorMessage = db->errorMessage();
-			return false;
-		}
-			
-		db->deleteColumn("te_theme_application", "visible_rep");
-		db->deleteColumn("te_theme_application", "enable_visibility");
-	}
-
-	//if for ADO passar todas as tabelas para aceitar comprimento iguel a zero!!!
-	if(db->dbmsName() == "Ado")
-	{
-		//te_layer 
-		//te_layer_table
-		db->allowEmptyString ("te_layer_table", "attr_initial_time");
-		db->allowEmptyString ("te_layer_table", "attr_final_time");
-		db->allowEmptyString ("te_layer_table", "user_name");
-
-		//te_representation
-		db->allowEmptyString ("te_representation", "description");
-		
-		//te_view
-		db->allowEmptyString ("te_view", "user_name");
-
-		//te_visual
-		db->allowEmptyString ("te_visual", "lib_name");
-		db->allowEmptyString ("te_visual", "contour_lib_name");
-		db->allowEmptyString ("te_visual", "family");
-
-		//te_legend
-		db->allowEmptyString ("te_legend", "lower_value");
-		db->allowEmptyString ("te_legend", "upper_value");
-		db->allowEmptyString ("te_legend", "label");
-		
-		//te_theme
-		db->allowEmptyString ("te_theme", "generate_attribute_where");
-		db->allowEmptyString ("te_theme", "generate_spatial_where");
-		db->allowEmptyString ("te_theme", "generate_temporal_where");
-		db->allowEmptyString ("te_theme", "collection_table");
-
-		//te_grouping
-		db->allowEmptyString ("te_grouping", "grouping_attr");
-		db->allowEmptyString ("te_grouping", "grouping_norm_attr");
-		db->allowEmptyString ("te_grouping", "grouping_function");
-
-		//te_theme_application
-		db->allowEmptyString ("te_theme_application", "refine_attribute_where");
-		db->allowEmptyString ("te_theme_application", "refine_spatial_where");
-		db->allowEmptyString ("te_theme_application", "refine_temporal_where");
-		db->allowEmptyString ("te_theme_application", "grouping_color");
-		db->allowEmptyString ("te_theme_application", "pie_dimension_attr");
-		db->allowEmptyString ("te_theme_application", "text_table");
-		db->allowEmptyString ("te_theme_application", "chart_function");
-	}
-
-	//------------ auxiliary collection  
-	TeDatabasePortal* portal = db->getPortal();
-	if(!portal)
-		return false;
-
-	string sql = " SELECT theme_id, visible_rep FROM te_theme ";
-	if(!portal->query(sql))
-	{
-		delete portal;
-		return true;
-	}
-
-	while(portal->fetchRow ())
-	{
-		string	themeId = portal->getData(0);
-		int		visRep  = atoi(portal->getData(1));
-
-		string collExtTable = "te_collection_"+ themeId +"_aux";
-		
-		if	((db->tableExist("te_collection_"+ themeId)) && 
-			((visRep & TeRASTER) != TeRASTER)			 && 
-			(!db->tableExist(collExtTable)))
-		{
-			TeTheme* theme = new TeTheme();
-			theme->id(atoi(themeId.c_str()));
-			if(!db->loadTheme (theme))
-			{
-				delete portal;
-				return false;
-			}
-
-			string up = "UPDATE " + theme->collectionTable() + " SET c_object_status = 0";
-			up += " WHERE c_object_status <> " + Te2String(theme->pointingLegend().id());
-			up += " AND c_object_status <> " + Te2String(theme->queryLegend().id());
-			up += " AND c_object_status <> " + Te2String(theme->queryAndPointingLegend().id());
-			db->execute(up);
-
-			up = "UPDATE " + theme->collectionTable() + " SET c_object_status = 1";
-			up += " WHERE c_object_status = " + Te2String(theme->pointingLegend().id());
-			db->execute(up);
-
-			up = "UPDATE " + theme->collectionTable() + " SET c_object_status = 2";
-			up += " WHERE c_object_status = " + Te2String(theme->queryLegend().id());
-			db->execute(up);
-
-			up = "UPDATE " + theme->collectionTable() + " SET c_object_status = 3";
-			up += " WHERE c_object_status = " + Te2String(theme->queryAndPointingLegend().id());
-			db->execute(up);
-
-			if ((!theme->createCollectionAuxTable()) || (!theme->populateCollectionAux())) 
-			{
-				errorMessage = "Fail to mount the auxiliary table of the collection!\n";
-				errorMessage += db->errorMessage();
-				delete portal;
-				return false;
-			}
-
-			theme->collectionAuxTable(collExtTable);
-			theme->addThemeTable(collExtTable);
-					
-			string oldTCE = theme->collectionTable() + "_ext";
-			if (db->tableExist(oldTCE))
-			{
-				string delTable = "DROP TABLE " + oldTCE;
-				db->execute(delTable);
-			}
-		}
-		
-	}
-	//------------ end auxiliary collection  
-
-	portal->freeResult();
-
-	//------------ text table  
-	// if text table have not text visual table associated, create it
-	string sel = "SELECT geom_table FROM te_representation WHERE";
-	sel += " geom_type = " + Te2String(TeTEXT);
-	if(portal->query(sel))
-	{
-		while(portal->fetchRow())
-		{
-			string table = portal->getData(0);
-			string tvis = table + "_txvisual";
-			if(!db->tableExist(tvis))
-			{
-				TeAttributeList atl;
-				TeAttribute		at;
-
-				at.rep_.name_ = "geom_id";
-				at.rep_.type_ = TeINT;
-				at.rep_.numChar_ = 0;
-				at.rep_.isPrimaryKey_ = true;
-				atl.push_back(at);
-
-				at.rep_.isPrimaryKey_ = false;
-				at.rep_.name_ = "dot_height";
-				at.rep_.type_ = TeINT;
-				atl.push_back(at);
-
-				at.rep_.name_ = "fix_size";
-				at.rep_.type_ = TeINT;
-				atl.push_back(at);
-
-				at.rep_.name_ = "color";
-				at.rep_.type_ = TeINT;
-				atl.push_back(at);
-
-				at.rep_.name_ = "family";
-				at.rep_.type_ = TeSTRING;
-				at.rep_.numChar_ = 128;
-				atl.push_back(at);
-
-				at.rep_.name_ = "bold";
-				at.rep_.type_ = TeINT;
-				at.rep_.numChar_ = 0;
-				atl.push_back(at);
-
-				at.rep_.name_ = "italic";
-				at.rep_.type_ = TeINT;
-				atl.push_back(at);
-
-				db->createTable(tvis, atl);
-				string fk = "fk_" + tvis;
-				db->createRelation(fk, tvis, "geom_id", table, "geom_id", true);
-				string ins = "INSERT INTO " + tvis + " (geom_id) SELECT geom_id FROM " + table;
-				db->execute(ins);
-
-				string popule = "UPDATE " + tvis;
-				popule += " SET dot_height = 12";
-				popule += ", fix_size = 0";
-				popule += ", color = 16711680";
-				popule += ", family = 'verdana'";
-				popule += ", bold = 1";
-				popule += ", italic = 0";
-				if(!db->execute(popule))
-				{
-					errorMessage = "Fail to generate the text visual table!\n";
-					errorMessage += db->errorMessage();
-					delete portal;
-					return false;;
-				}
-			}
-		}
-	}
-	//------------ end text table  
-	delete portal;
-	return true;
-}
-
-
-bool updateDB30To301(TeDatabase* db, string& errorMessage)
-{
-	TeAttribute fattr;
-
-	TeDatabasePortal* portal = db->getPortal();
-	if(!portal)
-		return false;
-
-	// ----- collection_table
-
-	string sql = " SELECT collection_table FROM te_theme ";   
-	if(!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-
-	while(portal->fetchRow())
-	{
-		string collName = portal->getData(0);
-		if(	(db->tableExist(collName)) && 
-			(!db->columnExist(collName, "c_object_status", fattr)))
-		{
-			TeAttributeRep atRep;
-			atRep.type_ = TeINT;
-			atRep.name_ = "c_object_status";
-			if(db->addColumn(collName, atRep) == false)
-			{
-				errorMessage = "The column c_object_status could not be appended!\n";
-				errorMessage += db->errorMessage();
-				delete portal;
-				return false;
-			}
-
-			string upd = " UPDATE "+collName+" t1, "+collName+" t2 ";
-			upd +=	" SET t1.c_object_status = t2.c_legend_result ";
-			upd +=	" WHERE t1.c_object_id = t2.c_object_id ";
-
-			if(!db->execute (upd))
-			{
-				errorMessage = db->errorMessage();
-				delete portal;
-				return false;
-			}
-
-			db->deleteColumn(collName, "c_legend_result");
-		}
-	}
-
-	delete portal;
-	return true; 
-}
-
-
-bool updateDB301To302(TeDatabase* db, string& errorMessage)
-{
-		
-	TeDatabasePortal* portal = db->getPortal();
-	if(!portal)
-		return false;
-
-	// ----- valid attribute table 
-	
-	TeAttrTableVector attrTableVec;
-	if(db->getAttrTables(attrTableVec))
-	{
-		for(unsigned int i=0; i<attrTableVec.size(); ++i)
-		{
-			TeTable fromTable = attrTableVec[i];
-			bool	flag = false;
-			
-			if(fromTable.tableType()==TeAttrMedia)
-				continue;
-
-			//verify if there is another table with the same name
-			for(unsigned int j=0; j<i; ++j)
-			{
-				if(TeConvertToUpperCase(attrTableVec[j].name())==TeConvertToUpperCase(fromTable.name())) 
-				{
-					flag = true;
-					break;
-				}
-			}
-
-			if(flag)
-				continue;
-			
-			if(db->validTable(fromTable)) //fromTable was modified
-			{
-				TeAttributeList newAttrList = fromTable.attributeList();
-				TeAttributeList oldAttrList = attrTableVec[i].attributeList();
-				TeAttributeList::iterator newAttIt = newAttrList.begin();
-				TeAttributeList::iterator oldAttIt = oldAttrList.begin();
-
-				bool change = false;
-				while(newAttIt!=newAttrList.end())
-				{
-					if(((*oldAttIt).rep_.name_) != ((*newAttIt).rep_.name_))
-					{
-						TeAttributeRep rep = (*newAttIt).rep_;
-						if(db->alterTable(fromTable.name(), rep, (*oldAttIt).rep_.name_))
-							change = true;
-					}
-
-					++newAttIt;
-					++oldAttIt;
-				}
-
-				if(change)
-				{
-					// update te_layer_table
-					string upd = " UPDATE te_layer_table ";
-					upd +=	" SET unique_id = '"+ fromTable.uniqueName() +"'";
-					upd +=  ", attr_link = '"+ fromTable.linkName() +"'";
-					upd +=	" WHERE attr_table = '"+ fromTable.name() +"'";
-
-					if(!db->execute (upd))
-					{
-						delete portal;
-						errorMessage = "Error updating te_layer_table!\n";
-						errorMessage += db->errorMessage();
-						return false;
-					}
-				}
-			}//if
-		}//for
-		portal->freeResult();
-	}
-
-	// ----- te_grouping table
-
-	string sel = " SELECT theme_id, grouping_attr, grouping_attr_type FROM te_grouping ";
-	if(!portal->query(sel))
-	{
-		delete portal;
-		return false;
-	}
-
-	while(portal->fetchRow())
-	{
-		string themeId, gAttr;
-		themeId = portal->getData(0);
-		gAttr = portal->getData(1);
-		int gTypr = portal->getInt(2);
-		
-		if(((gAttr.empty()) || (gAttr=="NONE")) && (gTypr==0))
-		{
-			string del = " DELETE FROM te_grouping WHERE theme_id = "+ themeId; 
-			db->execute(del);
-		}
-	}
-
-	// ----- te_grouping table
-
-	delete portal;
-	return true; 
-}
-
-bool PostgreSQLUpdateDB302To310(TeDatabase* db, TeGeomRep rep, const string& geomTableName)
-{
-	string geomColumnName = "spatial_box";
-
-	if(rep & TeRASTER)
-		geomColumnName = "block_box";
-
-	TeAttribute attr;
-
-// verifies if table already has a box column
-	if(db->columnExist(geomTableName, geomColumnName, attr))
-		return true;
-
-// add box column
-	string sql  = "ALTER TABLE " + geomTableName;
-			sql += " ADD COLUMN " + geomColumnName + " BOX";
-
-	if(!db->execute(sql))
-		return false;
-
-// make sure box column exist	
-	if(!db->columnExist(geomTableName, geomColumnName, attr))
-		return false;
-
-// populate column with values from older one
-	sql  = "UPDATE " + geomTableName;
-
-	if(rep & TePOINTS)
-		sql += " SET " + geomColumnName + " = box(point(x, y), point(x, y))";
-	else
-		sql += " SET " + geomColumnName + " = box(point(upper_x, upper_y), point(lower_x, lower_y))";
-
-	if(!db->execute(sql))
-		return false;
-
-// check if there is no null values
-	sql  = "SELECT * FROM " + geomTableName;
-	sql += " WHERE " + geomColumnName + " IS NULL";
-
-	TeDatabasePortal* p = db->getPortal();
-
-	if(!p)
-		return false;
-
-	 if(!p->query(sql))
-	 {
-		 delete p;
-
-		 return false;
-	 }
-
-     if(p->fetchRow())
-     {
-         delete p;
-
-         return false;
-	 }
-
-     delete p;
-
-// add not null for box column
-	sql  = "ALTER TABLE " + geomTableName;
-	sql += " ALTER COLUMN " + geomColumnName + " SET NOT NULL";
-
-	if(!db->execute(sql))
-		return false;
-	
-// create GiST index
-	if(!db->createSpatialIndex(geomTableName, geomColumnName))
-		return false;
-
-// for points is enough
-	if(rep & TePOINTS)
-		return true;
-
-// drop older B-Tree index
-	sql = "DROP INDEX " +  geomTableName + "_idx_box";
-
-	if(!db->execute(sql))
-		return false;
-
-// drop older box column
-	sql  = "ALTER TABLE " + geomTableName;
-	sql += " DROP COLUMN lower_x";
-
-	if(!db->execute(sql))
-		return false;
-
-	sql  = "ALTER TABLE " + geomTableName;
-	sql += " DROP COLUMN lower_y";
-
-	if(!db->execute(sql))
-		return false;
-
-	sql  = "ALTER TABLE " + geomTableName;
-	sql += " DROP COLUMN upper_x";
-
-	if(!db->execute(sql))
-		return false;
-
-	sql  = "ALTER TABLE " + geomTableName;
-	sql += " DROP COLUMN upper_y";
-
-	if(!db->execute(sql))
-		return false;
-
-	return true;
-}
-
-bool updateDB302To310(TeDatabase* db, string& errorMessage)
-{
-	// Append the column "grouping_chronon" in the "te_grouping"
-	// table if he column doesn�t exist
-	TeAttribute attr;
-	if(db->columnExist("te_grouping", "grouping_chronon", attr) == false)
-	{
-		TeAttributeRep atRep;
-		atRep.type_ = TeINT;
-		atRep.name_ = "grouping_chronon";
-		if(db->addColumn("te_grouping", atRep) == false)
-		{
-			errorMessage = "The column grouping_chronon could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-
-		// Set the new column "grouping_chronon" to no chronon
-		string upd = " UPDATE te_grouping ";
-		upd +=	" SET grouping_chronon = 0 ";	
-		if(!db->execute (upd))
-		{
-			errorMessage = db->errorMessage();
-			return false;
-		}
-
-	}
-
-	if(db->dbmsName() == "MySQL")
-	{
-		TeAttributeRep rep;
-		rep.name_ = "visible_rep";
-		rep.type_ = TeINT;
-		
-		if (db->alterTable("te_theme", rep) == false)
-		{
-			errorMessage = db->errorMessage();
-			return false;
-		}
-	}
-	else if(db->dbmsName() == "PostgreSQL")
-	{
-		if(!db->execute("BEGIN TRANSACTION"))
-		{
-			errorMessage = db->errorMessage();
-			return false;
-		}
-
-		if(!db->loadLayerSet())
-		{
-			db->execute("ROLLBACK TRANSACTION");
-			return false;
-		}
-
-		TeLayerMap& layerMap = db->layerMap();
-
-		TeLayerMap::iterator itLayer = layerMap.begin();
-
-//		for each layer, find representations to update box columns
-		while(itLayer != layerMap.end())
-		{
-// update point geometry table
-			TeRepresentation* rep = itLayer->second->getRepresentation(TePOINTS);
-
-			if(rep)
-			{
-				string geomTableName = rep->tableName_;
-
-				if(!PostgreSQLUpdateDB302To310(db, TePOINTS, geomTableName))
-				{
-					db->execute("ROLLBACK TRANSACTION");
-
-					return false;
-				}
-			}
-
-// update line geometry table
-			rep = itLayer->second->getRepresentation(TeLINES);
-
-			if(rep)
-			{
-				string geomTableName = rep->tableName_;
-
-				if(!PostgreSQLUpdateDB302To310(db, TeLINES, geomTableName))
-				{
-					db->execute("ROLLBACK TRANSACTION");
-
-					return false;
-				}
-			}
-
-// update polygon geometry table
-			rep = itLayer->second->getRepresentation(TePOLYGONS);
-
-			if(rep)
-			{
-				string geomTableName = rep->tableName_;
-
-				if(!PostgreSQLUpdateDB302To310(db, TePOLYGONS, geomTableName))
-				{
-					db->execute("ROLLBACK TRANSACTION");
-
-					return false;
-				}
-			}
-
-// update raster geometry table
-			rep = itLayer->second->getRepresentation(TeRASTER);
-
-			if(rep)
-			{
-				string rasterGeomTableName = rep->tableName_;
-
-				string sql = "SELECT raster_table FROM " + rasterGeomTableName;
-
-				TeDatabasePortal* p = db->getPortal();
-
-				if(!p)
-				{
-					db->execute("ROLLBACK TRANSACTION");
-
-					return false;
-				}
-
-				if(!p->query(sql))
-				{
-					delete p;
-
-					db->execute("ROLLBACK TRANSACTION");
-
-					return false;
-				}
-
-				while(p->fetchRow())
-				{
-					string geomTableName = p->getData(0);
-
-					if(!PostgreSQLUpdateDB302To310(db, TeRASTER, geomTableName))
-					{
-						delete p;
-
-						db->execute("ROLLBACK TRANSACTION");
-
-						return false;
-					}
-				}
-
-				delete p;
-			}
-
-// update cell geometry table
-			rep = itLayer->second->getRepresentation(TeCELLS);
-
-			if(rep)
-			{
-				string geomTableName = rep->tableName_;
-
-				if(!PostgreSQLUpdateDB302To310(db, TeCELLS, geomTableName))
-				{
-					db->execute("ROLLBACK TRANSACTION");
-
-					return false;
-				}
-			}
-
-// update node geometry table
-			rep = itLayer->second->getRepresentation(TeNODES);
-
-			if(rep)
-			{
-				string geomTableName = rep->tableName_;
-
-				if(!PostgreSQLUpdateDB302To310(db, TeNODES, geomTableName))
-				{
-					db->execute("ROLLBACK TRANSACTION");
-
-					return false;
-				}
-			}
-
-			++itLayer;
-		}
-
-		if(!db->execute("COMMIT TRANSACTION"))
-		{
-			errorMessage = db->errorMessage();
-			return false;
-		}
-	}
-	else if(db->dbmsName() == "PostGIS")
-	{
-		if(!db->execute("BEGIN TRANSACTION"))
-		{
-			errorMessage = db->errorMessage();
-			return false;
-		}
-
-		if(!db->loadLayerSet())
-		{
-			db->execute("ROLLBACK TRANSACTION");
-
-			return false;
-		}
-
-		TeLayerMap& layerMap = db->layerMap();
-
-		TeLayerMap::iterator itLayer = layerMap.begin();
-
-//		for each layer, find representations to update box columns
-		while(itLayer != layerMap.end())
-		{
-// update raster geometry table
-			TeRepresentation* rep = itLayer->second->getRepresentation(TeRASTER);
-
-			if(rep)
-			{
-				string rasterGeomTableName = rep->tableName_;
-
-				string sql = "SELECT raster_table FROM " + rasterGeomTableName;
-
-				TeDatabasePortal* p = db->getPortal();
-
-				if(!p)
-				{
-					db->execute("ROLLBACK TRANSACTION");
-
-					return false;
-				}
-
-				if(!p->query(sql))
-				{
-					delete p;
-
-					db->execute("ROLLBACK TRANSACTION");
-
-					return false;
-				}
-
-				while(p->fetchRow())
-				{
-					string geomTableName = p->getData(0);
-
-					if(!PostgreSQLUpdateDB302To310(db, TeRASTER, geomTableName))
-					{
-						delete p;
-
-						db->execute("ROLLBACK TRANSACTION");
-
-						return false;
-					}
-				}
-
-				delete p;
-			}
-
-			++itLayer;
-		}
-
-		if(!db->execute("COMMIT TRANSACTION"))
-		{
-			errorMessage = db->errorMessage();
-			return false;
-		}
-	}
-
-	return true;
-}
-
-bool updateDB310To311(TeDatabase* db, string& errorMessage)
-{
-	string sql = " SELECT collection_table FROM te_theme ";
-	TeDatabasePortal* portal = db->getPortal();
-	if(!portal)
-		return false;
-
-	if(!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-
-	while(portal->fetchRow())
-	{
-		string tableName = portal->getData(0);
-		if(!db->tableExist(tableName+"_aux"))
-			continue;
-
-		TeDatabasePortal* portal2 = db->getPortal();
-		if(!portal2)
-		{
-			delete portal;
-			return false;
-		}
-
-		sql = " SELECT * FROM "+ tableName+"_aux WHERE 1=2";
-		if(!portal2->query(sql))
-		{
-			delete portal;
-			delete portal2;
-			return false;
-		}
-
-		TeAttributeList attrList;
-		for(int i=0; i<portal2->numFields(); ++i)
-		{
-      TeAttribute attr = portal2->getAttribute(i);
-      attr.rep_.isPrimaryKey_= false;
-			if(TeConvertToUpperCase(portal2->getAttribute(i).rep_.name_) != "UNIQUE_ID" )
-				attrList.push_back(attr);
-		}
-
-        delete portal2;
-
-		//add new autonumber column
-		TeAttribute attr;
-		attr.rep_.name_= "unique_id" ;
-		attr.rep_.type_= TeINT;
-		attr.rep_.isAutoNumber_ = true;
-		attr.rep_.isPrimaryKey_ = true;
-		attrList.push_back(attr);
-		
-		//create new table 
-		if(!db->createTable(tableName+"_aux2", attrList))
-		{
-			errorMessage = "Error creating table "+ tableName+"_aux2 !\n";
-			errorMessage += db->errorMessage();
-			delete portal;
-			return false;
-		}
-
-		//insert records
-		string ins = " INSERT INTO "+ tableName +"_aux2 ( ";
-		string ins2 ="";
-		for(unsigned int j=0; j<(attrList.size()-1); ++j)
-		{
-			if(j>0)
-				ins2 += ",";
-			ins2 += attrList[j].rep_.name_;
-		}
-		ins += ins2 +" ) SELECT "+ ins2;
-		ins += " FROM "+ tableName+"_aux";
-		if(!db->execute(ins))
-		{
-			errorMessage = "Error inserting table "+ tableName+"_aux2 !\n";
-			errorMessage += db->errorMessage();
-			delete portal;
-			return false;
-		}
-
-		sql = " DROP TABLE "+ tableName+"_aux";
-		if(db->tableExist(tableName+"_aux"))
-		{
-			if(!db->execute(sql))
-			{
-				errorMessage = "Error dropping table "+ tableName+"_aux2 !\n";
-				errorMessage += db->errorMessage();
-				delete portal;
-				return false;
-			}
-		}
-		
-		if(!db->alterTable(tableName+"_aux2", tableName+"_aux"))
-		{
-			errorMessage = "Error renaming table "+ tableName+"_aux2 !\n";
-			errorMessage += db->errorMessage();
-			delete portal;
-			return false;
-		}
-	}
-
-	delete portal;
-	return true;
-}
-
-bool updateDB311To320(TeDatabase* db, string& errorMessage)
-{
-	if (!db->tableExist("te_project"))
-	{
-		if (!db->createProjectTable())
-		{
-			errorMessage = "Error creating te_project table\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-
-	if (!db->tableExist("te_project_view"))
-	{
-		if (!db->createProjectViewTable())
- 		{
-			errorMessage = "Error creating te_project_view table\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-	
-	//remove columns of the table te_visual
-	TeAttribute	attr;
-	attr.rep_.name_ = "lib_name";
-	attr.rep_.type_ = TeSTRING;
-		
-	if(db->columnExist("te_visual", attr.rep_.name_,attr))
-	{
-        //remove column lib_name
-		if(!db->deleteColumn("te_visual", attr.rep_.name_))
-		{
-			errorMessage = "Error removing a column of the te_visual table\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-
-	attr.rep_.name_ = "contour_lib_name";
-	if(db->columnExist("te_visual", attr.rep_.name_,attr))
-	{
-        //remove column lib_name
-		if(!db->deleteColumn("te_visual", attr.rep_.name_))
-		{
-			errorMessage = "Error removing a column of the te_visual table\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-
-	return true;
-}
-
-bool updateDB320To3201(TeDatabase* db, string& errorMessage)
-{
-	//--- remove the table te_color_scheme
-	if(db->tableExist("te_color_scheme"))
-	{
-		db->deleteTable("te_color_scheme");
-	}
-	
-	//--- store the theme box 
-	//verify if the theme box is stored 
-	TeAttribute	attr;
-	attr.rep_.name_ = "lower_x";
-	attr.rep_.type_ = TeREAL;
-
-  //create the columns
-	TeAttributeRep atRep;
-	atRep.type_ = TeREAL;
-	atRep.name_ = "lower_x";
-	atRep.decimals_ = 15;
-	atRep.defaultValue_ = "0.0";
-
-	if(!db->columnExist("te_theme", attr.rep_.name_,attr))
-	{
-		if(db->addColumn("te_theme", atRep) == false)
-		{
-			errorMessage = "The theme box could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-	attr.rep_.name_ = "lower_y";
-	if(!db->columnExist("te_theme", attr.rep_.name_,attr))
-	{
-		atRep.name_ = "lower_y";
-		if(db->addColumn("te_theme", atRep) == false)
-		{
-			errorMessage = "The theme box could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-	attr.rep_.name_ = "upper_x";
-	if(!db->columnExist("te_theme", attr.rep_.name_,attr))
-	{
-		atRep.name_ = "upper_x";
-		if(db->addColumn("te_theme", atRep) == false)
-		{
-			errorMessage = "The theme box could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-	attr.rep_.name_ = "upper_y";
-	if(!db->columnExist("te_theme", attr.rep_.name_,attr))
-	{
-		atRep.name_ = "upper_y";
-		if(db->addColumn("te_theme", atRep) == false)
-		{
-			errorMessage = "The theme box could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-
-	//--- store the view box and current theme 
-	//verify if the view box is stored 
-	attr.rep_.name_ = "lower_x";
-	attr.rep_.type_ = TeREAL;
-
-	//create the columns
-	if(!db->columnExist("te_view", attr.rep_.name_,attr))
-	{
-		atRep.type_ = TeREAL;
-		atRep.name_ = "lower_x";
-		atRep.decimals_ = 15;
-		atRep.defaultValue_ = "0.0";
-		if(db->addColumn("te_view", atRep) == false)
-		{
-			//delete portal;
-			errorMessage = "The view box could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-	attr.rep_.name_ = "lower_y";
-	if(!db->columnExist("te_view", attr.rep_.name_,attr))
-	{
-		atRep.name_ = "lower_y";
-		if(db->addColumn("te_view", atRep) == false)
-		{
-			//delete portal;
-			errorMessage = "The view box could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-	attr.rep_.name_ = "upper_x";
-	if(!db->columnExist("te_view", attr.rep_.name_,attr))
-	{
-		atRep.name_ = "upper_x";
-		if(db->addColumn("te_view", atRep) == false)
-		{
-			//delete portal;
-			errorMessage = "The view box could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-	attr.rep_.name_ = "upper_y";
-	if(!db->columnExist("te_view", attr.rep_.name_,attr))
-	{
-		atRep.name_ = "upper_y";
-		if(db->addColumn("te_view", atRep) == false)
-		{
-			//delete portal;
-			errorMessage = "The view box could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-	atRep.type_ = TeINT;
-	atRep.name_ = "current_theme";
-	atRep.decimals_ = 0;
-	attr.rep_.name_ = "current_theme";
-	if(!db->columnExist("te_view", attr.rep_.name_,attr))
-	{
-		if(db->addColumn("te_view", atRep) == false)
-		{
-			//delete portal;
-			errorMessage = "The view current theme could not be appended!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-		//create foreign key
-		if (!db->createRelation("fk_view_current_theme", "te_view", "current_theme", "te_theme", "theme_id", false))
-		{
-			//delete portal;
-			errorMessage = "Error creating foreign key in the view table!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-
-	//fill the box theme
-	string sql = "SELECT te_theme.name, te_view.user_name ";
-	sql += " FROM te_theme INNER JOIN te_view ON te_theme.view_id = te_view.view_id ";
-	TeDatabasePortal* portal = db->getPortal();
-	if(!portal)
-		return false;
-	
-	if(!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-
-	string originalUser = db->user();
-	while(portal->fetchRow())
-	{
-		string themeName = string(portal->getData(0));
-		string userName = string(portal->getData(1));
-		db->user(userName);
-
-		TeTheme theme(themeName);
-		if(!db->loadTheme(&theme))
-		{
-			delete portal;
-			errorMessage = "Error updating theme box!";
-			return false;
-		}
-
-		if(theme.type()==TeTREE)
-			continue;
-
-		//select the theme box
-		TeBox bb;
-		if (theme.layer()->hasGeometry(TeRASTER))
-			bb = theme.layer()->box();
-
-		if (theme.layer()->hasGeometry(TeRASTERFILE))
-			updateBox(bb,theme.layer()->getRepresentation(TeRASTERFILE)->box_);
-
-		string colTabName = theme.collectionTable();
-		if (!colTabName.empty())
-		{
-			string sqlfrom;
-			string geomTable;
-			if (theme.layer()->hasGeometry(TePOINTS))
-			{
-				geomTable = theme.layer()->tableName(TePOINTS);
-				sqlfrom = colTabName + " LEFT JOIN " + geomTable;
-				sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
-				TeBox bpt;
-				if(db->getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TePOINTS,bpt))
-					updateBox(bb,bpt);
-			}
-			if (theme.layer()->hasGeometry(TeLINES))
-			{
-				geomTable = theme.layer()->tableName(TeLINES);
-				sqlfrom = colTabName + " LEFT JOIN " + geomTable;
-				sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
-				TeBox bln;
-				if (db->getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeLINES,bln))
-					updateBox(bb,bln);
-			}
-			if (theme.layer()->hasGeometry(TePOLYGONS))
-			{
-				geomTable = theme.layer()->tableName(TePOLYGONS);
-				sqlfrom = colTabName + " LEFT JOIN " + geomTable;
-				sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
-				TeBox bpol;
-				if (db->getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TePOLYGONS,bpol))
-					updateBox(bb,bpol);
-			}
-
-			if (theme.layer()->hasGeometry(TeCELLS))
-			{
-				geomTable = theme.layer()->tableName(TeCELLS);
-				sqlfrom = colTabName + " LEFT JOIN " + geomTable;
-				sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
-				TeBox bpol;
-				if (db->getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeCELLS,bpol))
-					updateBox(bb,bpol);
-			}
-
-			if (theme.layer()->hasGeometry(TeTEXT))
-			{
-				geomTable = theme.layer()->tableName(TeTEXT);
-				sqlfrom = colTabName + " LEFT JOIN " + geomTable;
-				sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
-				TeBox bpol;
-				if (db->getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeTEXT,bpol))
-					updateBox(bb,bpol);
-			}	
-		}
-					
-		//update theme box
-		string update = "UPDATE te_theme SET ";
-		update += "  lower_x = " + Te2String(bb.x1()); 
-		update += ", lower_y = " + Te2String(bb.y1()); 
-		update += ", upper_x = " + Te2String(bb.x2()); 
-		update += ", upper_y = " + Te2String(bb.y2()); 
-		update += " WHERE theme_id=" + Te2String (theme.id());
-		if(!db->execute(update))
-		{
-			delete portal;
-			errorMessage = "Error updating theme box!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-    }
-
-	db->clear();
-	portal->freeResult();
-	db->user(originalUser);
-
-	//fill the box view
-	sql = "SELECT view_id, MIN(lower_x), MIN(lower_y), MAX(upper_x), MAX(upper_y) ";
-	sql += " FROM te_theme GROUP BY view_id ";
-	
-	if(!portal->query(sql))
-	{
-		delete portal;
-		return false;
-	}
-
-	while(portal->fetchRow())
-	{
-		string viewId = string(portal->getData(0));
-		string update = " UPDATE te_view SET ";
-		update += " lower_x = "+ string(portal->getData(1));
-		update += ", lower_y = "+ string(portal->getData(2));
-		update += ", upper_x = "+ string(portal->getData(3));
-		update += ", upper_y = "+ string(portal->getData(4));
-		update += ", current_theme = NULL ";
-		update += " WHERE view_id = "+ viewId;
-
-		if(!db->execute(update))
-		{
-			delete portal;
-			errorMessage = "Error updating view box!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-    }
-
-	//------ Project information
-	attr.rep_.name_ = "current_view";
-	attr.rep_.type_ = TeINT;
-
-	//if there is the column "current_view", delete it and create it again 
-	if(db->columnExist("te_project", attr.rep_.name_, attr))
-		db->deleteColumn("te_project", attr.rep_.name_);
-	
-	attr.rep_.defaultValue_ = "0";
-	if(!db->addColumn("te_project", attr.rep_))
-	{
-		delete portal;
-		errorMessage = "The project view could not be appended!\n";
-		errorMessage += db->errorMessage();
-		return false;
-	}
-	
-	TeProject project;
-	project.setName("TV_Project");
-	project.setDescription("TerraView_Default_Project");
-	project.setCurrentViewId(-1); // not have project
-	if(!db->insertProject(&project))
-	{
-		delete portal;
-		errorMessage = "Error inserting terraView default project!\n";
-		errorMessage += db->errorMessage();
-		return false;
-	}
-
-	portal->freeResult();
-	if(!portal->query("SELECT view_id FROM te_view"))
-	{
-		errorMessage = db->errorMessage();
-		delete portal;
-		return false;
-	}
-	while(portal->fetchRow())
-	{
-		string viewId = string(portal->getData(0));
-		string ins = "INSERT INTO te_project_view (project_id, view_id) VALUES (";
-		ins += Te2String(project.id()) +  "," + viewId + ")";
-		if(!db->execute(ins))
-		{
-			errorMessage = db->errorMessage();
-			delete portal;
-			return false;
-		}
-	}
-
-	delete portal;
-	return true;
-}
-
-bool updateDB3201To331(TeDatabase* db, string& errorMessage)
-{
-//alter the columns types
-	TeAttributeRep repAlter;
-	repAlter.name_ = "generate_attribute_where";
-	repAlter.type_ = TeSTRING;
-	repAlter.numChar_ = 0;
-	if(!db->alterTable("te_theme", repAlter))
-	{
-		errorMessage = "Could not alter the 'generate_attribute_where' column type!\n";
-		errorMessage += db->errorMessage();
-		return false;
-	}
-
-	repAlter.name_ = "generate_spatial_where";
-	if(!db->alterTable("te_theme", repAlter))
-	{
-		errorMessage = "Could not alter the 'generate_spatial_where' column type!\n";
-		errorMessage += db->errorMessage();
-		return false;
-	}
-
-	repAlter.name_ = "generate_temporal_where";
-	if(!db->alterTable("te_theme", repAlter))
-	{
-		errorMessage = "Could not alter the 'generate_temporal_where' column type!\n";
-		errorMessage += db->errorMessage();
-		return false;
-	}
-
-//create the time columns
-	TeAttributeRep rep;
-	rep.name_ = "edition_time";
-	rep.type_ = TeDATETIME;
-
-	TeAttribute	attr;	
-    if(!db->columnExist("te_layer", rep.name_, attr))
-	{
-		if(db->addColumn("te_layer", rep) == false)
-		{
-			errorMessage = "The edition time column could not be added to the layer table!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-
-	rep.name_ = "creation_time";
-	if(!db->columnExist("te_theme", rep.name_, attr))
-	{
-		if(db->addColumn("te_theme", rep) == false)
-		{
-			errorMessage = "The creation time column could not be added to the theme table!\n";
-			errorMessage += db->errorMessage();
-			return false;
-		}
-	}
-
-//update the time columns
-	TeTime timeNow;
-	timeNow.now();
-
-	std::string sql = "UPDATE te_layer SET edition_time = " + db->getSQLTime(timeNow);
-	if(!db->execute(sql))
-	{
-		errorMessage = "Could not update the edition time column in the layer table!\n";
-		errorMessage += db->errorMessage();
-		return false;
-	}
-
-	sql = "UPDATE te_theme SET creation_time = " + db->getSQLTime(timeNow);
-	if(!db->execute(sql))
-	{
-		errorMessage = "Could not update the creation time column in the theme table!\n";
-		errorMessage += db->errorMessage();
-		return false;
-	}
-
-	return true;
-}
-
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#include "TeUpdateDBVersion.h"
+
+bool isLowerVersion(const std::string& version1, const std::string& version2)
+{
+	bool isLower = false;
+
+	std::vector<std::string> vecVersion1;
+	std::vector<std::string> vecVersion2;
+	
+	TeSplitString(version1, ".", vecVersion1);
+	TeSplitString(version2, ".", vecVersion2);
+
+	if(vecVersion1.size() < vecVersion2.size())
+	{
+		for(unsigned int i = vecVersion1.size(); i < vecVersion2.size(); ++i)
+		{
+			vecVersion1.push_back("0");
+		}
+	}
+	else if(vecVersion2.size() < vecVersion1.size())
+	{
+		for(unsigned int i = vecVersion2.size(); i < vecVersion1.size(); ++i)
+		{
+			vecVersion2.push_back("0");
+		}
+	}
+
+	for(unsigned int i = 0; i < vecVersion1.size(); ++i)
+	{
+		int sub1 = atoi(vecVersion1[i].c_str());
+		int sub2 = atoi(vecVersion2[i].c_str());
+
+		if(sub1 != sub2)
+		{
+			if(sub1 < sub2)
+			{
+				isLower = true;
+			}
+			break;
+		}
+	}
+	
+	return isLower;
+}
+
+bool needUpdateDB(TeDatabase* db, string& DBversion)
+{
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+
+	string sql = " SELECT db_version FROM te_database ";
+	//The database does not have the te_database connection
+	if(!portal->query(sql))
+	{
+		DBversion = "";
+		delete portal;
+		return false;
+	}
+
+	if(!portal->fetchRow())
+	{
+		DBversion = "";
+		delete portal;
+		return true;
+	}
+
+	DBversion = portal->getData(0);
+	if(DBversion==TeDBVERSION)
+	{
+		delete portal;
+		return false;
+	}
+	
+	delete portal;
+	return true;
+}
+
+
+bool updateDBVersion(TeDatabase* db, string& DBversion, string& errorMessage)
+{
+	//from old version to 3.0
+	db->beginTransaction();
+	if(DBversion=="")
+	{
+		if(!updateDB20To30(db, errorMessage))
+		{
+			db->rollbackTransaction();
+			return false;
+		}
+		
+		DBversion = "3.0";
+	}
+
+	//from 3.0 to 3.0.1
+	if(DBversion=="3.0") 
+	{
+		if(!updateDB30To301(db, errorMessage))
+		{
+			db->rollbackTransaction();
+			return false;
+		}
+
+		DBversion = "3.0.1";
+	}
+
+	//from 3.0.1 to 3.0.2
+	if(DBversion=="3.0.1") 
+	{
+		if(!updateDB301To302(db, errorMessage))
+		{
+			db->rollbackTransaction();
+			return false;
+		}
+
+		DBversion = "3.0.2";
+	}
+
+	//from 3.0.2 to 3.1.0
+	if(DBversion=="3.0.2") 
+	{
+		if(!updateDB302To310(db, errorMessage))
+		{
+			db->rollbackTransaction();
+			return false;
+		}
+
+		DBversion = "3.1.0";
+	}
+
+	if(DBversion=="3.1.0")
+	{
+		if(!updateDB310To311(db, errorMessage))
+		{
+			db->rollbackTransaction();
+			return false;
+		}
+
+		DBversion = "3.1.1";
+	}
+
+	if(DBversion=="3.1.1")
+	{
+		if(!updateDB311To320(db, errorMessage))
+		{
+			db->rollbackTransaction();
+			return false;
+		}
+		DBversion = "3.2.0";
+	}
+
+	if(DBversion=="3.2.0")
+	{
+		if(!updateDB320To3201(db, errorMessage))
+		{
+			db->rollbackTransaction();
+			return false;
+		}
+		DBversion = "3.2.0.1";
+	}
+
+	if(DBversion=="3.2.0.1")
+	{
+		if(!updateDB3201To331(db, errorMessage))
+		{
+			db->rollbackTransaction();
+			return false;
+		}
+		DBversion = "3.3.1";
+	}
+
+	if(DBversion=="3.3.1")
+	{
+		if(!updateDB331To400(db, errorMessage))
+		{
+			db->rollbackTransaction();
+			return false;
+		}
+		DBversion = "4.0.0";
+	}
+ 	
+	if(DBversion!=TeDBVERSION)
+	{
+		db->rollbackTransaction();
+		return false;
+	}
+
+	string del= "DELETE FROM te_database"; 
+	if(!db->execute(del))
+	{
+		db->rollbackTransaction();
+		return false;
+	}
+
+	string ins = "INSERT INTO te_database (db_version) VALUES ('"+ TeDBVERSION +"')";
+	if(!db->execute(ins))
+	{
+		db->rollbackTransaction();
+		return false;
+	}
+
+	db->commitTransaction();
+	return true;
+}
+
+
+bool updateDB20To30(TeDatabase* db, string& errorMessage)
+{
+	TeAttribute fattr;
+
+	// ----- te_grouping 
+
+	if(db->columnExist("te_grouping", "grouping_function", fattr) == false)
+	{
+		TeAttributeRep atRep;
+		atRep.type_ = TeSTRING;
+		atRep.name_ = "grouping_function";
+		atRep.numChar_ = 10;
+		if(db->addColumn("te_grouping", atRep) == false)
+		{
+			errorMessage = "The column grouping_function could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+
+		string upd;
+		if(db->columnExist("te_theme_application", "group_function", fattr))
+		{
+			upd =	" UPDATE te_grouping g, te_theme_application ta ";
+			upd +=	" SET g.grouping_function = ta.group_function ";
+			upd +=	" WHERE ta.theme_id = g.theme_id ";
+
+			if(!db->execute (upd))
+			{
+				errorMessage = db->errorMessage();
+				return false;
+			}
+
+			db->deleteColumn("te_theme_application", "group_function");
+		}
+		else
+		{
+			upd =	" UPDATE te_grouping g ";
+			upd +=	" SET g.grouping_function = 'AVG' ";
+			
+			if(!db->execute (upd))
+			{
+				errorMessage = db->errorMessage();
+				return false;
+			}
+		}
+	}
+
+	// ----- te_theme_application
+
+	if(db->columnExist("te_theme_application", "chart_function", fattr) == false)
+	{
+		TeAttributeRep atRep;
+		atRep.type_ = TeSTRING;
+		atRep.name_ = "chart_function";
+		atRep.numChar_ = 10;
+		if(db->addColumn("te_theme_application", atRep) == false)
+		{
+			errorMessage = "The column chart_function could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+		db->execute("UPDATE te_theme_application SET chart_function = 'AVG'");
+	}
+
+	// ----- te_theme 
+	if(db->columnExist("te_theme", "visible_rep", fattr) == false)
+	{
+		TeAttributeRep atRep;
+		atRep.type_ = TeINT;
+		atRep.name_ = "visible_rep";
+		if(db->addColumn("te_theme", atRep) == false)
+		{
+			errorMessage = "The column visible_rep could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+
+		atRep.name_ = "enable_visibility";
+		if(db->addColumn("te_theme", atRep) == false)
+		{
+			errorMessage = "The column enable_visibility could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+
+		string upd = " UPDATE te_theme t, te_theme_application ta ";
+		upd +=       " SET t.visible_rep = ta.visible_rep ";
+		upd +=       " WHERE ta.theme_id = t.theme_id ";
+		if(!db->execute (upd))
+		{
+			errorMessage = db->errorMessage();
+			return false;
+		}
+
+		upd =		 " UPDATE te_theme t, te_theme_application ta ";
+		upd +=       " SET t.enable_visibility = ta.enable_visibility ";
+		upd +=       " WHERE ta.theme_id = t.theme_id ";
+		if(!db->execute (upd))
+		{
+			errorMessage = db->errorMessage();
+			return false;
+		}
+			
+		db->deleteColumn("te_theme_application", "visible_rep");
+		db->deleteColumn("te_theme_application", "enable_visibility");
+	}
+
+	//if for ADO passar todas as tabelas para aceitar comprimento iguel a zero!!!
+	if(db->dbmsName() == "Ado")
+	{
+		//te_layer 
+		//te_layer_table
+		db->allowEmptyString ("te_layer_table", "attr_initial_time");
+		db->allowEmptyString ("te_layer_table", "attr_final_time");
+		db->allowEmptyString ("te_layer_table", "user_name");
+
+		//te_representation
+		db->allowEmptyString ("te_representation", "description");
+		
+		//te_view
+		db->allowEmptyString ("te_view", "user_name");
+
+		//te_visual
+		db->allowEmptyString ("te_visual", "lib_name");
+		db->allowEmptyString ("te_visual", "contour_lib_name");
+		db->allowEmptyString ("te_visual", "family");
+
+		//te_legend
+		db->allowEmptyString ("te_legend", "lower_value");
+		db->allowEmptyString ("te_legend", "upper_value");
+		db->allowEmptyString ("te_legend", "label");
+		
+		//te_theme
+		db->allowEmptyString ("te_theme", "generate_attribute_where");
+		db->allowEmptyString ("te_theme", "generate_spatial_where");
+		db->allowEmptyString ("te_theme", "generate_temporal_where");
+		db->allowEmptyString ("te_theme", "collection_table");
+
+		//te_grouping
+		db->allowEmptyString ("te_grouping", "grouping_attr");
+		db->allowEmptyString ("te_grouping", "grouping_norm_attr");
+		db->allowEmptyString ("te_grouping", "grouping_function");
+
+		//te_theme_application
+		db->allowEmptyString ("te_theme_application", "refine_attribute_where");
+		db->allowEmptyString ("te_theme_application", "refine_spatial_where");
+		db->allowEmptyString ("te_theme_application", "refine_temporal_where");
+		db->allowEmptyString ("te_theme_application", "grouping_color");
+		db->allowEmptyString ("te_theme_application", "pie_dimension_attr");
+		db->allowEmptyString ("te_theme_application", "text_table");
+		db->allowEmptyString ("te_theme_application", "chart_function");
+	}
+
+	//------------ auxiliary collection  
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+
+	string sql = " SELECT theme_id, visible_rep FROM te_theme ";
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return true;
+	}
+
+	while(portal->fetchRow ())
+	{
+		string	themeId = portal->getData(0);
+		int		visRep  = atoi(portal->getData(1));
+
+		string collExtTable = "te_collection_"+ themeId +"_aux";
+		
+		if	((db->tableExist("te_collection_"+ themeId)) && 
+			((visRep & TeRASTER) != TeRASTER)			 && 
+			(!db->tableExist(collExtTable)))
+		{
+			TeTheme* theme = new TeTheme();
+			theme->id(atoi(themeId.c_str()));
+			if(!db->loadTheme (theme))
+			{
+				delete portal;
+				return false;
+			}
+
+			string up = "UPDATE " + theme->collectionTable() + " SET c_object_status = 0";
+			up += " WHERE c_object_status <> " + Te2String(theme->pointingLegend().id());
+			up += " AND c_object_status <> " + Te2String(theme->queryLegend().id());
+			up += " AND c_object_status <> " + Te2String(theme->queryAndPointingLegend().id());
+			db->execute(up);
+
+			up = "UPDATE " + theme->collectionTable() + " SET c_object_status = 1";
+			up += " WHERE c_object_status = " + Te2String(theme->pointingLegend().id());
+			db->execute(up);
+
+			up = "UPDATE " + theme->collectionTable() + " SET c_object_status = 2";
+			up += " WHERE c_object_status = " + Te2String(theme->queryLegend().id());
+			db->execute(up);
+
+			up = "UPDATE " + theme->collectionTable() + " SET c_object_status = 3";
+			up += " WHERE c_object_status = " + Te2String(theme->queryAndPointingLegend().id());
+			db->execute(up);
+
+			if ((!theme->createCollectionAuxTable()) || (!theme->populateCollectionAux())) 
+			{
+				errorMessage = "Fail to mount the auxiliary table of the collection!\n";
+				errorMessage += db->errorMessage();
+				delete portal;
+				return false;
+			}
+
+			theme->collectionAuxTable(collExtTable);
+			theme->addThemeTable(collExtTable);
+					
+			string oldTCE = theme->collectionTable() + "_ext";
+			if (db->tableExist(oldTCE))
+			{
+				string delTable = "DROP TABLE " + oldTCE;
+				db->execute(delTable);
+			}
+		}
+		
+	}
+	//------------ end auxiliary collection  
+
+	portal->freeResult();
+
+	//------------ text table  
+	// if text table have not text visual table associated, create it
+	string sel = "SELECT geom_table FROM te_representation WHERE";
+	sel += " geom_type = " + Te2String(TeTEXT);
+	if(portal->query(sel))
+	{
+		while(portal->fetchRow())
+		{
+			string table = portal->getData(0);
+			string tvis = table + "_txvisual";
+			if(!db->tableExist(tvis))
+			{
+				TeAttributeList atl;
+				TeAttribute		at;
+
+				at.rep_.name_ = "geom_id";
+				at.rep_.type_ = TeINT;
+				at.rep_.numChar_ = 0;
+				at.rep_.isPrimaryKey_ = true;
+				atl.push_back(at);
+
+				at.rep_.isPrimaryKey_ = false;
+				at.rep_.name_ = "dot_height";
+				at.rep_.type_ = TeINT;
+				atl.push_back(at);
+
+				at.rep_.name_ = "fix_size";
+				at.rep_.type_ = TeINT;
+				atl.push_back(at);
+
+				at.rep_.name_ = "color";
+				at.rep_.type_ = TeINT;
+				atl.push_back(at);
+
+				at.rep_.name_ = "family";
+				at.rep_.type_ = TeSTRING;
+				at.rep_.numChar_ = 128;
+				atl.push_back(at);
+
+				at.rep_.name_ = "bold";
+				at.rep_.type_ = TeINT;
+				at.rep_.numChar_ = 0;
+				atl.push_back(at);
+
+				at.rep_.name_ = "italic";
+				at.rep_.type_ = TeINT;
+				atl.push_back(at);
+
+				db->createTable(tvis, atl);
+				string fk = "fk_" + tvis;
+				db->createRelation(fk, tvis, "geom_id", table, "geom_id", true);
+				string ins = "INSERT INTO " + tvis + " (geom_id) SELECT geom_id FROM " + table;
+				db->execute(ins);
+
+				string popule = "UPDATE " + tvis;
+				popule += " SET dot_height = 12";
+				popule += ", fix_size = 0";
+				popule += ", color = 16711680";
+				popule += ", family = 'verdana'";
+				popule += ", bold = 1";
+				popule += ", italic = 0";
+				if(!db->execute(popule))
+				{
+					errorMessage = "Fail to generate the text visual table!\n";
+					errorMessage += db->errorMessage();
+					delete portal;
+					return false;;
+				}
+			}
+		}
+	}
+	//------------ end text table  
+	delete portal;
+	return true;
+}
+
+
+bool updateDB30To301(TeDatabase* db, string& errorMessage)
+{
+	TeAttribute fattr;
+
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+
+	// ----- collection_table
+
+	string sql = " SELECT collection_table FROM te_theme ";   
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		string collName = portal->getData(0);
+		if(	(db->tableExist(collName)) && 
+			(!db->columnExist(collName, "c_object_status", fattr)))
+		{
+			TeAttributeRep atRep;
+			atRep.type_ = TeINT;
+			atRep.name_ = "c_object_status";
+			if(db->addColumn(collName, atRep) == false)
+			{
+				errorMessage = "The column c_object_status could not be appended!\n";
+				errorMessage += db->errorMessage();
+				delete portal;
+				return false;
+			}
+
+			string upd = " UPDATE "+collName+" t1, "+collName+" t2 ";
+			upd +=	" SET t1.c_object_status = t2.c_legend_result ";
+			upd +=	" WHERE t1.c_object_id = t2.c_object_id ";
+
+			if(!db->execute (upd))
+			{
+				errorMessage = db->errorMessage();
+				delete portal;
+				return false;
+			}
+
+			db->deleteColumn(collName, "c_legend_result");
+		}
+	}
+
+	delete portal;
+	return true; 
+}
+
+
+bool updateDB301To302(TeDatabase* db, string& errorMessage)
+{
+		
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+
+	// ----- valid attribute table 
+	
+	TeAttrTableVector attrTableVec;
+	if(db->getAttrTables(attrTableVec))
+	{
+		for(unsigned int i=0; i<attrTableVec.size(); ++i)
+		{
+			TeTable fromTable = attrTableVec[i];
+			bool	flag = false;
+			
+			if(fromTable.tableType()==TeAttrMedia)
+				continue;
+
+			//verify if there is another table with the same name
+			for(unsigned int j=0; j<i; ++j)
+			{
+				if(TeConvertToUpperCase(attrTableVec[j].name())==TeConvertToUpperCase(fromTable.name())) 
+				{
+					flag = true;
+					break;
+				}
+			}
+
+			if(flag)
+				continue;
+			
+			if(db->validTable(fromTable)) //fromTable was modified
+			{
+				TeAttributeList newAttrList = fromTable.attributeList();
+				TeAttributeList oldAttrList = attrTableVec[i].attributeList();
+				TeAttributeList::iterator newAttIt = newAttrList.begin();
+				TeAttributeList::iterator oldAttIt = oldAttrList.begin();
+
+				bool change = false;
+				while(newAttIt!=newAttrList.end())
+				{
+					if(((*oldAttIt).rep_.name_) != ((*newAttIt).rep_.name_))
+					{
+						TeAttributeRep rep = (*newAttIt).rep_;
+						if(db->alterTable(fromTable.name(), rep, (*oldAttIt).rep_.name_))
+							change = true;
+					}
+
+					++newAttIt;
+					++oldAttIt;
+				}
+
+				if(change)
+				{
+					// update te_layer_table
+					string upd = " UPDATE te_layer_table ";
+					upd +=	" SET unique_id = '"+ fromTable.uniqueName() +"'";
+					upd +=  ", attr_link = '"+ fromTable.linkName() +"'";
+					upd +=	" WHERE attr_table = '"+ fromTable.name() +"'";
+
+					if(!db->execute (upd))
+					{
+						delete portal;
+						errorMessage = "Error updating te_layer_table!\n";
+						errorMessage += db->errorMessage();
+						return false;
+					}
+				}
+			}//if
+		}//for
+		portal->freeResult();
+	}
+
+	// ----- te_grouping table
+
+	string sel = " SELECT theme_id, grouping_attr, grouping_attr_type FROM te_grouping ";
+	if(!portal->query(sel))
+	{
+		delete portal;
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		string themeId, gAttr;
+		themeId = portal->getData(0);
+		gAttr = portal->getData(1);
+		int gTypr = portal->getInt(2);
+		
+		if(((gAttr.empty()) || (gAttr=="NONE")) && (gTypr==0))
+		{
+			string del = " DELETE FROM te_grouping WHERE theme_id = "+ themeId; 
+			db->execute(del);
+		}
+	}
+
+	// ----- te_grouping table
+
+	delete portal;
+	return true; 
+}
+
+bool PostgreSQLUpdateDB302To310(TeDatabase* db, TeGeomRep rep, const string& geomTableName)
+{
+	string geomColumnName = "spatial_box";
+
+	if(rep & TeRASTER)
+		geomColumnName = "block_box";
+
+	TeAttribute attr;
+
+// verifies if table already has a box column
+	if(db->columnExist(geomTableName, geomColumnName, attr))
+		return true;
+
+// add box column
+	string sql  = "ALTER TABLE " + geomTableName;
+			sql += " ADD COLUMN " + geomColumnName + " BOX";
+
+	if(!db->execute(sql))
+		return false;
+
+// make sure box column exist	
+	if(!db->columnExist(geomTableName, geomColumnName, attr))
+		return false;
+
+// populate column with values from older one
+	sql  = "UPDATE " + geomTableName;
+
+	if(rep & TePOINTS)
+		sql += " SET " + geomColumnName + " = box(point(x, y), point(x, y))";
+	else
+		sql += " SET " + geomColumnName + " = box(point(upper_x, upper_y), point(lower_x, lower_y))";
+
+	if(!db->execute(sql))
+		return false;
+
+// check if there is no null values
+	sql  = "SELECT * FROM " + geomTableName;
+	sql += " WHERE " + geomColumnName + " IS NULL";
+
+	TeDatabasePortal* p = db->getPortal();
+
+	if(!p)
+		return false;
+
+	 if(!p->query(sql))
+	 {
+		 delete p;
+
+		 return false;
+	 }
+
+     if(p->fetchRow())
+     {
+         delete p;
+
+         return false;
+	 }
+
+     delete p;
+
+// add not null for box column
+	sql  = "ALTER TABLE " + geomTableName;
+	sql += " ALTER COLUMN " + geomColumnName + " SET NOT NULL";
+
+	if(!db->execute(sql))
+		return false;
+	
+// create GiST index
+	if(!db->createSpatialIndex(geomTableName, geomColumnName))
+		return false;
+
+// for points is enough
+	if(rep & TePOINTS)
+		return true;
+
+// drop older B-Tree index
+	sql = "DROP INDEX " +  geomTableName + "_idx_box";
+
+	if(!db->execute(sql))
+		return false;
+
+// drop older box column
+	sql  = "ALTER TABLE " + geomTableName;
+	sql += " DROP COLUMN lower_x";
+
+	if(!db->execute(sql))
+		return false;
+
+	sql  = "ALTER TABLE " + geomTableName;
+	sql += " DROP COLUMN lower_y";
+
+	if(!db->execute(sql))
+		return false;
+
+	sql  = "ALTER TABLE " + geomTableName;
+	sql += " DROP COLUMN upper_x";
+
+	if(!db->execute(sql))
+		return false;
+
+	sql  = "ALTER TABLE " + geomTableName;
+	sql += " DROP COLUMN upper_y";
+
+	if(!db->execute(sql))
+		return false;
+
+	return true;
+}
+
+bool updateDB302To310(TeDatabase* db, string& errorMessage)
+{
+	// Append the column "grouping_chronon" in the "te_grouping"
+	// table if he column doesn�t exist
+	TeAttribute attr;
+	if(db->columnExist("te_grouping", "grouping_chronon", attr) == false)
+	{
+		TeAttributeRep atRep;
+		atRep.type_ = TeINT;
+		atRep.name_ = "grouping_chronon";
+		if(db->addColumn("te_grouping", atRep) == false)
+		{
+			errorMessage = "The column grouping_chronon could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+
+		// Set the new column "grouping_chronon" to no chronon
+		string upd = " UPDATE te_grouping ";
+		upd +=	" SET grouping_chronon = 0 ";	
+		if(!db->execute (upd))
+		{
+			errorMessage = db->errorMessage();
+			return false;
+		}
+
+	}
+
+	if(db->dbmsName() == "MySQL")
+	{
+		TeAttributeRep rep;
+		rep.name_ = "visible_rep";
+		rep.type_ = TeINT;
+		
+		if (db->alterTable("te_theme", rep) == false)
+		{
+			errorMessage = db->errorMessage();
+			return false;
+		}
+	}
+	else if(db->dbmsName() == "PostgreSQL")
+	{
+		if(!db->execute("BEGIN TRANSACTION"))
+		{
+			errorMessage = db->errorMessage();
+			return false;
+		}
+
+		if(!db->loadLayerSet())
+		{
+			db->execute("ROLLBACK TRANSACTION");
+			return false;
+		}
+
+		TeLayerMap& layerMap = db->layerMap();
+
+		TeLayerMap::iterator itLayer = layerMap.begin();
+
+//		for each layer, find representations to update box columns
+		while(itLayer != layerMap.end())
+		{
+// update point geometry table
+			TeRepresentation* rep = itLayer->second->getRepresentation(TePOINTS);
+
+			if(rep)
+			{
+				string geomTableName = rep->tableName_;
+
+				if(!PostgreSQLUpdateDB302To310(db, TePOINTS, geomTableName))
+				{
+					db->execute("ROLLBACK TRANSACTION");
+
+					return false;
+				}
+			}
+
+// update line geometry table
+			rep = itLayer->second->getRepresentation(TeLINES);
+
+			if(rep)
+			{
+				string geomTableName = rep->tableName_;
+
+				if(!PostgreSQLUpdateDB302To310(db, TeLINES, geomTableName))
+				{
+					db->execute("ROLLBACK TRANSACTION");
+
+					return false;
+				}
+			}
+
+// update polygon geometry table
+			rep = itLayer->second->getRepresentation(TePOLYGONS);
+
+			if(rep)
+			{
+				string geomTableName = rep->tableName_;
+
+				if(!PostgreSQLUpdateDB302To310(db, TePOLYGONS, geomTableName))
+				{
+					db->execute("ROLLBACK TRANSACTION");
+
+					return false;
+				}
+			}
+
+// update raster geometry table
+			rep = itLayer->second->getRepresentation(TeRASTER);
+
+			if(rep)
+			{
+				string rasterGeomTableName = rep->tableName_;
+
+				string sql = "SELECT raster_table FROM " + rasterGeomTableName;
+
+				TeDatabasePortal* p = db->getPortal();
+
+				if(!p)
+				{
+					db->execute("ROLLBACK TRANSACTION");
+
+					return false;
+				}
+
+				if(!p->query(sql))
+				{
+					delete p;
+
+					db->execute("ROLLBACK TRANSACTION");
+
+					return false;
+				}
+
+				while(p->fetchRow())
+				{
+					string geomTableName = p->getData(0);
+
+					if(!PostgreSQLUpdateDB302To310(db, TeRASTER, geomTableName))
+					{
+						delete p;
+
+						db->execute("ROLLBACK TRANSACTION");
+
+						return false;
+					}
+				}
+
+				delete p;
+			}
+
+// update cell geometry table
+			rep = itLayer->second->getRepresentation(TeCELLS);
+
+			if(rep)
+			{
+				string geomTableName = rep->tableName_;
+
+				if(!PostgreSQLUpdateDB302To310(db, TeCELLS, geomTableName))
+				{
+					db->execute("ROLLBACK TRANSACTION");
+
+					return false;
+				}
+			}
+
+// update node geometry table
+			rep = itLayer->second->getRepresentation(TeNODES);
+
+			if(rep)
+			{
+				string geomTableName = rep->tableName_;
+
+				if(!PostgreSQLUpdateDB302To310(db, TeNODES, geomTableName))
+				{
+					db->execute("ROLLBACK TRANSACTION");
+
+					return false;
+				}
+			}
+
+			++itLayer;
+		}
+
+		if(!db->execute("COMMIT TRANSACTION"))
+		{
+			errorMessage = db->errorMessage();
+			return false;
+		}
+	}
+	else if(db->dbmsName() == "PostGIS")
+	{
+		if(!db->execute("BEGIN TRANSACTION"))
+		{
+			errorMessage = db->errorMessage();
+			return false;
+		}
+
+		if(!db->loadLayerSet())
+		{
+			db->execute("ROLLBACK TRANSACTION");
+
+			return false;
+		}
+
+		TeLayerMap& layerMap = db->layerMap();
+
+		TeLayerMap::iterator itLayer = layerMap.begin();
+
+//		for each layer, find representations to update box columns
+		while(itLayer != layerMap.end())
+		{
+// update raster geometry table
+			TeRepresentation* rep = itLayer->second->getRepresentation(TeRASTER);
+
+			if(rep)
+			{
+				string rasterGeomTableName = rep->tableName_;
+
+				string sql = "SELECT raster_table FROM " + rasterGeomTableName;
+
+				TeDatabasePortal* p = db->getPortal();
+
+				if(!p)
+				{
+					db->execute("ROLLBACK TRANSACTION");
+
+					return false;
+				}
+
+				if(!p->query(sql))
+				{
+					delete p;
+
+					db->execute("ROLLBACK TRANSACTION");
+
+					return false;
+				}
+
+				while(p->fetchRow())
+				{
+					string geomTableName = p->getData(0);
+
+					if(!PostgreSQLUpdateDB302To310(db, TeRASTER, geomTableName))
+					{
+						delete p;
+
+						db->execute("ROLLBACK TRANSACTION");
+
+						return false;
+					}
+				}
+
+				delete p;
+			}
+
+			++itLayer;
+		}
+
+		if(!db->execute("COMMIT TRANSACTION"))
+		{
+			errorMessage = db->errorMessage();
+			return false;
+		}
+	}
+
+	return true;
+}
+
+bool updateDB310To311(TeDatabase* db, string& errorMessage)
+{
+	string sql = " SELECT collection_table FROM te_theme ";
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		string tableName = portal->getData(0);
+		if(!db->tableExist(tableName+"_aux"))
+			continue;
+
+		TeDatabasePortal* portal2 = db->getPortal();
+		if(!portal2)
+		{
+			delete portal;
+			return false;
+		}
+
+		sql = " SELECT * FROM "+ tableName+"_aux WHERE 1=2";
+		if(!portal2->query(sql))
+		{
+			delete portal;
+			delete portal2;
+			return false;
+		}
+
+		TeAttributeList attrList;
+		for(int i=0; i<portal2->numFields(); ++i)
+		{
+      TeAttribute attr = portal2->getAttribute(i);
+      attr.rep_.isPrimaryKey_= false;
+			if(TeConvertToUpperCase(portal2->getAttribute(i).rep_.name_) != "UNIQUE_ID" )
+				attrList.push_back(attr);
+		}
+
+        delete portal2;
+
+		//add new autonumber column
+		TeAttribute attr;
+		attr.rep_.name_= "unique_id" ;
+		attr.rep_.type_= TeINT;
+		attr.rep_.isAutoNumber_ = true;
+		attr.rep_.isPrimaryKey_ = true;
+		attrList.push_back(attr);
+		
+		//create new table 
+		if(!db->createTable(tableName+"_aux2", attrList))
+		{
+			errorMessage = "Error creating table "+ tableName+"_aux2 !\n";
+			errorMessage += db->errorMessage();
+			delete portal;
+			return false;
+		}
+
+		//insert records
+		string ins = " INSERT INTO "+ tableName +"_aux2 ( ";
+		string ins2 ="";
+		for(unsigned int j=0; j<(attrList.size()-1); ++j)
+		{
+			if(j>0)
+				ins2 += ",";
+			ins2 += attrList[j].rep_.name_;
+		}
+		ins += ins2 +" ) SELECT "+ ins2;
+		ins += " FROM "+ tableName+"_aux";
+		if(!db->execute(ins))
+		{
+			errorMessage = "Error inserting table "+ tableName+"_aux2 !\n";
+			errorMessage += db->errorMessage();
+			delete portal;
+			return false;
+		}
+
+		sql = " DROP TABLE "+ tableName+"_aux";
+		if(db->tableExist(tableName+"_aux"))
+		{
+			if(!db->execute(sql))
+			{
+				errorMessage = "Error dropping table "+ tableName+"_aux2 !\n";
+				errorMessage += db->errorMessage();
+				delete portal;
+				return false;
+			}
+		}
+		
+		if(!db->alterTable(tableName+"_aux2", tableName+"_aux"))
+		{
+			errorMessage = "Error renaming table "+ tableName+"_aux2 !\n";
+			errorMessage += db->errorMessage();
+			delete portal;
+			return false;
+		}
+	}
+
+	delete portal;
+	return true;
+}
+
+bool updateDB311To320(TeDatabase* db, string& errorMessage)
+{
+	if (!db->tableExist("te_project"))
+	{
+		if (!db->createProjectTable())
+		{
+			errorMessage = "Error creating te_project table\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+
+	if (!db->tableExist("te_project_view"))
+	{
+		if (!db->createProjectViewTable())
+ 		{
+			errorMessage = "Error creating te_project_view table\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+	
+	//remove columns of the table te_visual
+	TeAttribute	attr;
+	attr.rep_.name_ = "lib_name";
+	attr.rep_.type_ = TeSTRING;
+		
+	if(db->columnExist("te_visual", attr.rep_.name_,attr))
+	{
+        //remove column lib_name
+		if(!db->deleteColumn("te_visual", attr.rep_.name_))
+		{
+			errorMessage = "Error removing a column of the te_visual table\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+
+	attr.rep_.name_ = "contour_lib_name";
+	if(db->columnExist("te_visual", attr.rep_.name_,attr))
+	{
+        //remove column lib_name
+		if(!db->deleteColumn("te_visual", attr.rep_.name_))
+		{
+			errorMessage = "Error removing a column of the te_visual table\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+
+	return true;
+}
+
+bool updateDB320To3201(TeDatabase* db, string& errorMessage)
+{
+	//--- remove the table te_color_scheme
+	if(db->tableExist("te_color_scheme"))
+	{
+		db->deleteTable("te_color_scheme");
+	}
+	
+	//--- store the theme box 
+	//verify if the theme box is stored 
+	TeAttribute	attr;
+	attr.rep_.name_ = "lower_x";
+	attr.rep_.type_ = TeREAL;
+
+  //create the columns
+	TeAttributeRep atRep;
+	atRep.type_ = TeREAL;
+	atRep.name_ = "lower_x";
+	atRep.decimals_ = 15;
+	atRep.defaultValue_ = "0.0";
+
+	if(!db->columnExist("te_theme", attr.rep_.name_,attr))
+	{
+		if(db->addColumn("te_theme", atRep) == false)
+		{
+			errorMessage = "The theme box could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+	attr.rep_.name_ = "lower_y";
+	if(!db->columnExist("te_theme", attr.rep_.name_,attr))
+	{
+		atRep.name_ = "lower_y";
+		if(db->addColumn("te_theme", atRep) == false)
+		{
+			errorMessage = "The theme box could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+	attr.rep_.name_ = "upper_x";
+	if(!db->columnExist("te_theme", attr.rep_.name_,attr))
+	{
+		atRep.name_ = "upper_x";
+		if(db->addColumn("te_theme", atRep) == false)
+		{
+			errorMessage = "The theme box could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+	attr.rep_.name_ = "upper_y";
+	if(!db->columnExist("te_theme", attr.rep_.name_,attr))
+	{
+		atRep.name_ = "upper_y";
+		if(db->addColumn("te_theme", atRep) == false)
+		{
+			errorMessage = "The theme box could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+
+	//--- store the view box and current theme 
+	//verify if the view box is stored 
+	attr.rep_.name_ = "lower_x";
+	attr.rep_.type_ = TeREAL;
+
+	//create the columns
+	if(!db->columnExist("te_view", attr.rep_.name_,attr))
+	{
+		atRep.type_ = TeREAL;
+		atRep.name_ = "lower_x";
+		atRep.decimals_ = 15;
+		atRep.defaultValue_ = "0.0";
+		if(db->addColumn("te_view", atRep) == false)
+		{
+			//delete portal;
+			errorMessage = "The view box could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+	attr.rep_.name_ = "lower_y";
+	if(!db->columnExist("te_view", attr.rep_.name_,attr))
+	{
+		atRep.name_ = "lower_y";
+		if(db->addColumn("te_view", atRep) == false)
+		{
+			//delete portal;
+			errorMessage = "The view box could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+	attr.rep_.name_ = "upper_x";
+	if(!db->columnExist("te_view", attr.rep_.name_,attr))
+	{
+		atRep.name_ = "upper_x";
+		if(db->addColumn("te_view", atRep) == false)
+		{
+			//delete portal;
+			errorMessage = "The view box could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+	attr.rep_.name_ = "upper_y";
+	if(!db->columnExist("te_view", attr.rep_.name_,attr))
+	{
+		atRep.name_ = "upper_y";
+		if(db->addColumn("te_view", atRep) == false)
+		{
+			//delete portal;
+			errorMessage = "The view box could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+	atRep.type_ = TeINT;
+	atRep.name_ = "current_theme";
+	atRep.decimals_ = 0;
+	attr.rep_.name_ = "current_theme";
+	if(!db->columnExist("te_view", attr.rep_.name_,attr))
+	{
+		if(db->addColumn("te_view", atRep) == false)
+		{
+			//delete portal;
+			errorMessage = "The view current theme could not be appended!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+		//create foreign key
+		if (!db->createRelation("fk_view_current_theme", "te_view", "current_theme", "te_theme", "theme_id", false))
+		{
+			//delete portal;
+			errorMessage = "Error creating foreign key in the view table!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+
+	//fill the box theme
+	string sql = "SELECT te_theme.name, te_view.user_name ";
+	sql += " FROM te_theme INNER JOIN te_view ON te_theme.view_id = te_view.view_id ";
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+	
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	string originalUser = db->user();
+	while(portal->fetchRow())
+	{
+		string themeName = string(portal->getData(0));
+		string userName = string(portal->getData(1));
+		db->user(userName);
+
+		TeTheme theme(themeName);
+		if(!db->loadTheme(&theme))
+		{
+			delete portal;
+			errorMessage = "Error updating theme box!";
+			return false;
+		}
+
+		if(theme.type()==TeTREE)
+			continue;
+
+		//select the theme box
+		TeBox bb;
+		if (theme.layer()->hasGeometry(TeRASTER))
+			bb = theme.layer()->box();
+
+		if (theme.layer()->hasGeometry(TeRASTERFILE))
+			updateBox(bb,theme.layer()->getRepresentation(TeRASTERFILE)->box_);
+
+		string colTabName = theme.collectionTable();
+		if (!colTabName.empty())
+		{
+			string sqlfrom;
+			string geomTable;
+			if (theme.layer()->hasGeometry(TePOINTS))
+			{
+				geomTable = theme.layer()->tableName(TePOINTS);
+				sqlfrom = colTabName + " LEFT JOIN " + geomTable;
+				sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
+				TeBox bpt;
+				if(db->getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TePOINTS,bpt))
+					updateBox(bb,bpt);
+			}
+			if (theme.layer()->hasGeometry(TeLINES))
+			{
+				geomTable = theme.layer()->tableName(TeLINES);
+				sqlfrom = colTabName + " LEFT JOIN " + geomTable;
+				sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
+				TeBox bln;
+				if (db->getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeLINES,bln))
+					updateBox(bb,bln);
+			}
+			if (theme.layer()->hasGeometry(TePOLYGONS))
+			{
+				geomTable = theme.layer()->tableName(TePOLYGONS);
+				sqlfrom = colTabName + " LEFT JOIN " + geomTable;
+				sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
+				TeBox bpol;
+				if (db->getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TePOLYGONS,bpol))
+					updateBox(bb,bpol);
+			}
+
+			if (theme.layer()->hasGeometry(TeCELLS))
+			{
+				geomTable = theme.layer()->tableName(TeCELLS);
+				sqlfrom = colTabName + " LEFT JOIN " + geomTable;
+				sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
+				TeBox bpol;
+				if (db->getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeCELLS,bpol))
+					updateBox(bb,bpol);
+			}
+
+			if (theme.layer()->hasGeometry(TeTEXT))
+			{
+				geomTable = theme.layer()->tableName(TeTEXT);
+				sqlfrom = colTabName + " LEFT JOIN " + geomTable;
+				sqlfrom += " ON " + colTabName + ".c_object_id = " + geomTable + ".object_id";
+				TeBox bpol;
+				if (db->getMBRSelectedObjects(geomTable,"spatial_data", sqlfrom, "","",TeTEXT,bpol))
+					updateBox(bb,bpol);
+			}	
+		}
+					
+		//update theme box
+		string update = "UPDATE te_theme SET ";
+		update += "  lower_x = " + Te2String(bb.x1()); 
+		update += ", lower_y = " + Te2String(bb.y1()); 
+		update += ", upper_x = " + Te2String(bb.x2()); 
+		update += ", upper_y = " + Te2String(bb.y2()); 
+		update += " WHERE theme_id=" + Te2String (theme.id());
+		if(!db->execute(update))
+		{
+			delete portal;
+			errorMessage = "Error updating theme box!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+    }
+
+	db->clear();
+	portal->freeResult();
+	db->user(originalUser);
+
+	//fill the box view
+	sql = "SELECT view_id, MIN(lower_x), MIN(lower_y), MAX(upper_x), MAX(upper_y) ";
+	sql += " FROM te_theme GROUP BY view_id ";
+	
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		string viewId = string(portal->getData(0));
+		string update = " UPDATE te_view SET ";
+		update += " lower_x = "+ string(portal->getData(1));
+		update += ", lower_y = "+ string(portal->getData(2));
+		update += ", upper_x = "+ string(portal->getData(3));
+		update += ", upper_y = "+ string(portal->getData(4));
+		update += ", current_theme = NULL ";
+		update += " WHERE view_id = "+ viewId;
+
+		if(!db->execute(update))
+		{
+			delete portal;
+			errorMessage = "Error updating view box!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+    }
+
+	//------ Project information
+	attr.rep_.name_ = "current_view";
+	attr.rep_.type_ = TeINT;
+
+	//if there is the column "current_view", delete it and create it again 
+	if(db->columnExist("te_project", attr.rep_.name_, attr))
+		db->deleteColumn("te_project", attr.rep_.name_);
+	
+	attr.rep_.defaultValue_ = "0";
+	if(!db->addColumn("te_project", attr.rep_))
+	{
+		delete portal;
+		errorMessage = "The project view could not be appended!\n";
+		errorMessage += db->errorMessage();
+		return false;
+	}
+	
+	TeProject project;
+	project.setName("TV_Project");
+	project.setDescription("TerraView_Default_Project");
+	project.setCurrentViewId(-1); // not have project
+	if(!db->insertProject(&project))
+	{
+		delete portal;
+		errorMessage = "Error inserting terraView default project!\n";
+		errorMessage += db->errorMessage();
+		return false;
+	}
+
+	portal->freeResult();
+	if(!portal->query("SELECT view_id FROM te_view"))
+	{
+		errorMessage = db->errorMessage();
+		delete portal;
+		return false;
+	}
+	while(portal->fetchRow())
+	{
+		string viewId = string(portal->getData(0));
+		string ins = "INSERT INTO te_project_view (project_id, view_id) VALUES (";
+		ins += Te2String(project.id()) +  "," + viewId + ")";
+		if(!db->execute(ins))
+		{
+			errorMessage = db->errorMessage();
+			delete portal;
+			return false;
+		}
+	}
+
+	delete portal;
+	return true;
+}
+
+bool updateDB3201To331(TeDatabase* db, string& errorMessage)
+{
+//alter the columns types
+	TeAttributeRep repAlter;
+	repAlter.name_ = "generate_attribute_where";
+	repAlter.type_ = TeSTRING;
+	repAlter.numChar_ = 0;
+	if(!db->alterTable("te_theme", repAlter))
+	{
+		errorMessage = "Could not alter the 'generate_attribute_where' column type!\n";
+		errorMessage += db->errorMessage();
+		return false;
+	}
+
+	repAlter.name_ = "generate_spatial_where";
+	if(!db->alterTable("te_theme", repAlter))
+	{
+		errorMessage = "Could not alter the 'generate_spatial_where' column type!\n";
+		errorMessage += db->errorMessage();
+		return false;
+	}
+
+	repAlter.name_ = "generate_temporal_where";
+	if(!db->alterTable("te_theme", repAlter))
+	{
+		errorMessage = "Could not alter the 'generate_temporal_where' column type!\n";
+		errorMessage += db->errorMessage();
+		return false;
+	}
+
+//create the time columns
+	TeAttributeRep rep;
+	rep.name_ = "edition_time";
+	rep.type_ = TeDATETIME;
+
+	TeAttribute	attr;	
+    if(!db->columnExist("te_layer", rep.name_, attr))
+	{
+		if(db->addColumn("te_layer", rep) == false)
+		{
+			errorMessage = "The edition time column could not be added to the layer table!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+
+	rep.name_ = "creation_time";
+	if(!db->columnExist("te_theme", rep.name_, attr))
+	{
+		if(db->addColumn("te_theme", rep) == false)
+		{
+			errorMessage = "The creation time column could not be added to the theme table!\n";
+			errorMessage += db->errorMessage();
+			return false;
+		}
+	}
+
+//update the time columns
+	TeTime timeNow;
+	timeNow.now();
+
+	std::string sql = "UPDATE te_layer SET edition_time = " + db->getSQLTime(timeNow);
+	if(!db->execute(sql))
+	{
+		errorMessage = "Could not update the edition time column in the layer table!\n";
+		errorMessage += db->errorMessage();
+		return false;
+	}
+
+	sql = "UPDATE te_theme SET creation_time = " + db->getSQLTime(timeNow);
+	if(!db->execute(sql))
+	{
+		errorMessage = "Could not update the creation time column in the theme table!\n";
+		errorMessage += db->errorMessage();
+		return false;
+	}
+
+	return true;
+}
+
+bool updateDB331To400(TeDatabase* db, string& errorMessage)
+{
+	TeDatabasePortal* portal = db->getPortal();
+	if(!portal)
+		return false;
+
+	string sql = " SELECT geom_table FROM te_representation WHERE geom_type = 512 ";
+
+//The database does not have the te_database connection
+	if(!portal->query(sql))
+	{
+		delete portal;
+		return false;
+	}
+
+	while(portal->fetchRow())
+	{
+		std::string	rasterTableName = portal->getData(0);
+
+		TeDatabasePortal* portalRaster = db->getPortal();
+
+		if(!portalRaster)
+		{
+			delete portal;
+			return false;
+		}
+
+		string sql = " SELECT lut_table FROM " +  rasterTableName;
+
+//The database does not have the te_database connection
+		if(!portalRaster->query(sql))
+		{
+			delete portal;
+			delete portalRaster;
+			return false;
+		}
+
+		while(portalRaster->fetchRow())
+		{
+			TeAttribute attr;
+
+// ----- raster_metadata
+			std::string rasterMetadaTable = rasterTableName + "_metadata";
+
+			if(db->columnExist(rasterMetadaTable, "band_name", attr) == false)
+			{
+				TeAttributeRep attRep;
+				attRep.name_ = "band_name";
+				attRep.type_ = TeSTRING;
+				attRep.numChar_ = 255;
+								
+				if(db->addColumn(rasterMetadaTable, attRep) == false)
+				{
+					errorMessage = "The column band_name could not be appended!\n";
+					errorMessage += db->errorMessage();
+					delete portal;
+					delete portalRaster;
+					return false;
+				}
+			}
+
+// ----- raster_lut
+			std::string rasterLutTable = portalRaster->getData(0);
+
+			if(db->tableExist(rasterLutTable))
+			{
+				if(db->columnExist(rasterLutTable, "class_name", attr) == false)
+				{
+					TeAttributeRep attRep;
+					attRep.name_ = "class_name";
+					attRep.type_ = TeSTRING;
+					attRep.numChar_ = 255;
+										
+					if(db->addColumn(rasterLutTable, attRep) == false)
+					{
+						errorMessage = "The column class_name could not be appended!\n";
+						errorMessage += db->errorMessage();
+						delete portal;
+						delete portalRaster;
+						return false;
+					}
+				}
+			}
+		}
+
+		delete portalRaster;
+	}
+
+	delete portal;
+
+	return true;
+}
diff --git a/src/terralib/utils/TeUpdateDBVersion.h b/src/terralib/utils/TeUpdateDBVersion.h
old mode 100755
new mode 100644
index 52c63c3..0e4f47d
--- a/src/terralib/utils/TeUpdateDBVersion.h
+++ b/src/terralib/utils/TeUpdateDBVersion.h
@@ -1,66 +1,70 @@
-/************************************************************************************
- TerraLib - a library for developing GIS applications.
-Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-/*! \file TeUpdateDBVersion.h
-    \brief This file contains the routines to update a TerraLib database to its different versions
-*/
-
-#ifndef  __TERRALIB_INTERNAL_UPDATEDBVERSION_H
-#define  __TERRALIB_INTERNAL_UPDATEDBVERSION_H
-
-#include "TeDatabase.h"
-
-//! verify if a version is lower than othen version 
-bool isLowerVersion(const std::string& version1, const std::string& version2);
-
-//! verify if the database needs update 
-bool needUpdateDB(TeDatabase* db, string& DBversion);
-
-//! update database version 
-bool updateDBVersion(TeDatabase* db, string& DBversion, string& errorMessage);
-
-//! update database from release 2.0 to release 3.0
-bool updateDB20To30(TeDatabase* db, string& errorMessage);
-
-//! update database from release 3.0 to release 3.0.1
-bool updateDB30To301(TeDatabase* db, string& errorMessage);
-
-//! update database from release 3.0.1 to release 3.0.2 (3.0 Plus)
-bool updateDB301To302(TeDatabase* db, string& errorMessage); 
- 
-//! update database from release 3.0.2 to release 3.1.0
-bool updateDB302To310(TeDatabase* db, string& errorMessage); 
-
-//! update database from release 3.1.0 to release 3.1.1
-bool updateDB310To311(TeDatabase* db, string& errorMessage); 
-
-//! update database from release 3.1.1 to release 3.2.0
-bool updateDB311To320(TeDatabase* db, string& errorMessage); 
-
-//! update database from release 3.2.0 to release 3.2.0.1
-bool updateDB320To3201(TeDatabase* db, string& errorMessage);
-
-//! update database from release 3.2.0.1 to release 3.3.1
-bool updateDB3201To331(TeDatabase* db, string& errorMessage);
-
-#endif
-
+/************************************************************************************
+ TerraLib - a library for developing GIS applications.
+Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeUpdateDBVersion.h
+    \brief This file contains the routines to update a TerraLib database to its different versions
+*/
+
+#ifndef  __TERRALIB_INTERNAL_UPDATEDBVERSION_H
+#define  __TERRALIB_INTERNAL_UPDATEDBVERSION_H
+
+#include "TeDatabase.h"
+#include "TeUtilsDefines.h"
+
+//! verify if a version is lower than othen version 
+TLUTILS_DLL bool isLowerVersion(const std::string& version1, const std::string& version2);
+
+//! verify if the database needs update 
+TLUTILS_DLL bool needUpdateDB(TeDatabase* db, string& DBversion);
+
+//! update database version 
+TLUTILS_DLL bool updateDBVersion(TeDatabase* db, string& DBversion, string& errorMessage);
+
+//! update database from release 2.0 to release 3.0
+TLUTILS_DLL bool updateDB20To30(TeDatabase* db, string& errorMessage);
+
+//! update database from release 3.0 to release 3.0.1
+TLUTILS_DLL bool updateDB30To301(TeDatabase* db, string& errorMessage);
+
+//! update database from release 3.0.1 to release 3.0.2 (3.0 Plus)
+TLUTILS_DLL bool updateDB301To302(TeDatabase* db, string& errorMessage); 
+ 
+//! update database from release 3.0.2 to release 3.1.0
+TLUTILS_DLL bool updateDB302To310(TeDatabase* db, string& errorMessage); 
+
+//! update database from release 3.1.0 to release 3.1.1
+TLUTILS_DLL bool updateDB310To311(TeDatabase* db, string& errorMessage); 
+
+//! update database from release 3.1.1 to release 3.2.0
+TLUTILS_DLL bool updateDB311To320(TeDatabase* db, string& errorMessage); 
+
+//! update database from release 3.2.0 to release 3.2.0.1
+TLUTILS_DLL bool updateDB320To3201(TeDatabase* db, string& errorMessage);
+
+//! update database from release 3.2.0.1 to release 3.3.1
+TLUTILS_DLL bool updateDB3201To331(TeDatabase* db, string& errorMessage);
+
+//! update database from release 3.3.1 to release 4.0.0
+TLUTILS_DLL bool updateDB331To400(TeDatabase* db, string& errorMessage);
+
+#endif
+
diff --git a/src/terralib/utils/TeUtilsDefines.h b/src/terralib/utils/TeUtilsDefines.h
new file mode 100644
index 0000000..0b01b50
--- /dev/null
+++ b/src/terralib/utils/TeUtilsDefines.h
@@ -0,0 +1,49 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+/*! \file TeUtilsDefines.h
+    \brief Provides a set of general definitions used by te_utils project.
+*/
+#ifndef  __TERRALIB_INTERNAL_UTILSDEFINES_H
+#define  __TERRALIB_INTERNAL_UTILSDEFINES_H
+
+/** @defgroup TerraLib_AS_DLL macros.
+  @{
+ */
+#if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
+
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning(disable: 4251)
+#endif
+
+#ifdef TLUTILS_AS_DLL
+#define TLUTILS_DLL __declspec(dllexport)
+#else
+#define TLUTILS_DLL __declspec(dllimport)
+#endif
+
+#else
+#define TLUTILS_DLL
+#endif
+/** @} */ 
+
+#endif //__TERRALIB_INTERNAL_UTILSDEFINES_H
diff --git a/src/terralib/utils/TeWKBGeometryDecoder.cpp b/src/terralib/utils/TeWKBGeometryDecoder.cpp
index 436600a..57a6c4c 100644
--- a/src/terralib/utils/TeWKBGeometryDecoder.cpp
+++ b/src/terralib/utils/TeWKBGeometryDecoder.cpp
@@ -1,372 +1,472 @@
-#include <TeWKBGeometryDecoder.h>
-
-//TerraLib include files
-#include <TeGeometry.h>
-#include <TeException.h>
-
-#ifdef WIN32
-#include <winsock.h>
-#else
-#include <netinet/in.h>
-#endif
-
-//STL include files
-#include <cstring>
-
-bool isLittleEndian = !(((unsigned int) 1) == htonl((unsigned int) 1));
-
-unsigned int SwapUInt(const unsigned int& uintVal)
-{
-	char uintIn[4], uintOut[4];
-
-	unsigned int outVal;
-
-	memcpy(uintIn,&uintVal,4);
-
-	uintOut[0] = uintIn[3];
-	uintOut[1] = uintIn[2];
-	uintOut[2] = uintIn[1];
-	uintOut[3] = uintIn[0];
-
-	memcpy (&outVal,uintOut,4);
-
-	return outVal;
-}
-
-void encodeRing(const TeLine2D& line, char*& wkbLine, unsigned int& size)
-{
-	unsigned int nPoints = line.size();
-	size = sizeof(unsigned int) + (nPoints*2*sizeof(double));
-
-	wkbLine = new char[size];
-	char* l = wkbLine;
-
-	//nPoints
-	memcpy(l, &nPoints , sizeof(unsigned int));
-	l += sizeof(unsigned int);
-
-	for(unsigned int i = 0; i < nPoints ; ++i)
-	{
-		double x = line[i].x();
-		double y = line[i].y();
-
-		memcpy(l, &x, sizeof(double));
-		l += sizeof(double);
-		
-		memcpy(l, &y, sizeof(double));
-		l += sizeof(double);
-	}
-}
-
-void decodeCoord(const char*& wkb, TeCoord2D& point, const char& byteOrder)
-{
-
-	union
-	{
-		double dWord_;
-		unsigned int aux_[2];
-	} swapx1, swapy1;
-
-	memcpy(&swapx1.dWord_, wkb, sizeof(double));
-	memcpy(&swapy1.dWord_, wkb + sizeof(double), sizeof(double));
-
-	wkb += 2*(sizeof(double)); // x + y
-
-	// 0 = Big Endian (wkbXDR)
-	if((byteOrder == 0) && isLittleEndian)
-	{
-		union
-		{
-			double dWord_;
-			unsigned int aux_[2];
-		} swapx2, swapy2;
-
-		swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
-		swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
-
-		swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
-		swapy2.aux_[0] = ntohl(swapy1.aux_[1]);	
-		
-		point.x(swapx2.dWord_);
-		point.y(swapy2.dWord_);
-
-		return;
-	}
-	else if((byteOrder == 0) && !isLittleEndian)
-	{
-		union
-		{
-			double dWord_;
-			unsigned int aux_[2];
-		} swapx2, swapy2;
-
-		swapx2.aux_[1] = SwapUInt(swapx1.aux_[0]);
-		swapx2.aux_[0] = SwapUInt(swapx1.aux_[1]);
-
-		swapy2.aux_[1] = SwapUInt(swapy1.aux_[0]);
-		swapy2.aux_[0] = SwapUInt(swapy1.aux_[1]);
-		
-		point.x(swapx2.dWord_);
-		point.y(swapy2.dWord_);
-
-		return ;
-	}
-
-	point.x(swapx1.dWord_);
-	point.y(swapy1.dWord_);
-}
-
-void decodeRing(const char*& wkb, TeLine2D& line, const char& byteOrder, const int& lineSize)
-{
-	const char* aux = wkb;
-	
-	for(int i = 0; i < lineSize; i++)
-	{
-		TeCoord2D point;
-		decodeCoord(aux, point, byteOrder);
-		line.add(point);
-	}
-}
-
-void getWKBHeader(const char*& wkb, char& byteOrder, unsigned int& wkbType, unsigned int& numGeometries)
-{
-	const int byteOrderPlusGeomType = sizeof(unsigned char) + sizeof(unsigned int);	
-
-	memcpy(&byteOrder, wkb, sizeof(unsigned char));		
-	memcpy(&wkbType, wkb + sizeof(unsigned char), sizeof(unsigned int));
-
-	const char* aux = wkb;
-	aux += byteOrderPlusGeomType;
-	
-
-	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-	if(byteOrder == 0 && isLittleEndian)
-	{
-		wkbType = ntohl(wkbType);
-	}
-	else if(byteOrder == 1 && !isLittleEndian)
-	{
-		wkbType = SwapUInt(wkbType);
-	}	
-
-	numGeometries = 0;
-
-	if(wkbType > 1 && wkbType <= 7)
-	{
-		memcpy(&numGeometries, aux, sizeof(unsigned int));
-		aux += sizeof(unsigned int);
-
-		// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-		if(byteOrder == 0 && isLittleEndian)
-		{
-			numGeometries = ntohl(numGeometries);	
-		}
-		else if(byteOrder == 1 && !isLittleEndian)
-		{
-			numGeometries = SwapUInt(numGeometries);
-		}
-	}
-}
-
-void TeWKBGeometryDecoder::encodePolygon(const TePolygon& polygon, char*& wkbPoly, unsigned int& size)
-{
-	char byteOrder;
-	unsigned int wkbType = 3;//WKBPolygon
-	unsigned int nRings = polygon.size();
-
-	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-	if(((unsigned int) 1) == htonl((unsigned int) 1))
-	{
-		byteOrder = 0;
-	}
-	else
-	{
-		byteOrder = 1;		
-	}
-
-	//cabecalho
-	size = sizeof(char) + (2*sizeof(unsigned int));
-
-	//rings
-	for(unsigned int i = 0; i < nRings ; ++i)
-	{
-		size += sizeof(unsigned int) + (2 * sizeof(double) * polygon[i].size());
-	}
-	
-	wkbPoly = new char[size];
-	char* p = wkbPoly;
-
-	//byteOrder	
-	memcpy(p, &byteOrder , sizeof(char));
-	p += sizeof(char);
-
-	//WKBPolygon
-	memcpy(p, &wkbType , sizeof(unsigned int));
-	p += sizeof(unsigned int);
-
-	//Rings
-	memcpy(p, &nRings , sizeof(unsigned int));
-	p += sizeof(unsigned int);
-
-	TePolygon::iterator it;
-
-	for(it = polygon.begin(); it != polygon.end(); ++it)
-	{
-		char* ring;
-		unsigned int rSize;
-		
-		encodeRing((*it), ring, rSize);
-
-		memcpy(p, ring, rSize);
-		p += rSize; 
-
-		delete [] ring;
-	}
-}
-
-void TeWKBGeometryDecoder::encodeLine(const TeLine2D& line, char*& wkbLine, unsigned int& size)
-{
-	char byteOrder;
-	unsigned int nPoints = line.size();
-	unsigned int wkbType = 2;//WKBLineString
-
-	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-	if(((unsigned int) 1) == htonl((unsigned int) 1))
-	{
-		byteOrder = 0;
-	}
-	else
-	{
-		byteOrder = 1;		
-	}
-
-	size = sizeof(char) + sizeof(unsigned int) + sizeof(unsigned int) + (2 * sizeof(double) * nPoints);
-
-	wkbLine = new char[size];
-	char* l = wkbLine;
-
-	//byteOrder	
-	memcpy(l, &byteOrder , sizeof(char));
-	l += sizeof(char);
-
-	//WKBLineString
-	memcpy(l, &wkbType , sizeof(unsigned int));
-	l += sizeof(unsigned int);
-
-	char* ring;
-	unsigned int lSize;
-	encodeRing(line, ring, lSize);
-
-	memcpy(l, ring, lSize);
-	delete []ring;
-}
-
-void TeWKBGeometryDecoder::encodePoint(const TeCoord2D& point, char*& wkbPoint, unsigned int& size)
-{
-	char byteOrder;
-	unsigned int wkbType = 1;//WKBPoint
-
-	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
-	if(((unsigned int) 1) == htonl((unsigned int) 1))
-	{
-		byteOrder = 0;
-	}
-	else
-	{
-		byteOrder = 1;		
-	}
-
-	//cabecalho
-	size = sizeof(char) + sizeof(int) + (2 * sizeof(double));
-	
-	char* p = new char[size];
-	wkbPoint = p;
-
-	//byteOrder	
-	memcpy(p, &byteOrder , sizeof(char));
-	p += sizeof(char);
-
-	//WKBPoint
-	memcpy(p, &wkbType , sizeof(unsigned int));
-	p += sizeof(unsigned int);
-
-	double x = point.x();
-	double y = point.y();
-
-	memcpy(p, &x, sizeof(double));
-	p += sizeof(double);
-	memcpy(p, &y, sizeof(double));
-	p += sizeof(double);
-}
-
-void TeWKBGeometryDecoder::decodePolygon(const char*& wkbPoly, TePolygon& poly)
-{
-	char byteOrder;
-	unsigned int wkbType;
-	unsigned int numGeometries;
-
-	getWKBHeader(wkbPoly, byteOrder, wkbType, numGeometries);
-	
-	if(wkbType != 3)
-	{
-		throw TeException(UNKNOWN_ERROR_TYPE, "Binary data doesn't supported!");
-	}
-
-	const char* aux = wkbPoly;
-
-	//Size of header
-	aux += sizeof(char) + (2*sizeof(unsigned int));
-
-	for(unsigned int i = 0; i < numGeometries; i++)
-	{
-		unsigned int ringSize;
-		memcpy(&ringSize, aux, sizeof(unsigned int));
-
-		aux += sizeof(unsigned int);
-
-		TeLinearRing ring;
-		decodeRing(aux, ring, byteOrder, ringSize);
-
-		aux += ringSize*2*sizeof(double);
-		poly.add(ring);
-	}
-}
-
-void TeWKBGeometryDecoder::decodeLine(const char*& wkbLine, TeLine2D& line)
-{
-	char byteOrder;
-	unsigned int wkbType;
-	unsigned int numCoords;
-
-	getWKBHeader(wkbLine, byteOrder, wkbType, numCoords);
-	
-	if(wkbType != 2)
-	{
-		throw TeException(UNKNOWN_ERROR_TYPE, "Binary data doesn't supported!");
-	}
-
-	//Size of header
-	const char* aux = wkbLine;
-	aux += sizeof(char) + (2*sizeof(unsigned int));
-
-	decodeRing(aux, line, byteOrder, numCoords);
-}
-
-void TeWKBGeometryDecoder::decodePoint(const char*& wkbPoint, TeCoord2D& point)
-{
-	char byteOrder;
-	unsigned int wkbType;
-	unsigned int numGeometries;
-
-	getWKBHeader(wkbPoint, byteOrder, wkbType, numGeometries);
-	
-	if(wkbType != 1)
-		throw TeException(UNKNOWN_ERROR_TYPE, "Binary data doesn't supported!");
-
-	//Size of header
-
-	wkbPoint += sizeof(char) + sizeof(int);
-
-	decodeCoord(wkbPoint, point, byteOrder);
-}
-
+#include <TeWKBGeometryDecoder.h>
+
+//TerraLib include files
+#include <TeGeometry.h>
+#include <TeException.h>
+
+#ifdef WIN32
+#include <winsock.h>
+#else
+#include <netinet/in.h>
+#endif
+
+//STL include files
+#include <cstring>
+
+bool isLittleEndian()
+{
+	return !(((unsigned int) 1) == htonl((unsigned int) 1));
+}
+
+unsigned int SwapUInt(const unsigned int& uintVal)
+{
+	char uintIn[4], uintOut[4];
+
+	unsigned int outVal;
+
+	memcpy(uintIn,&uintVal,4);
+
+	uintOut[0] = uintIn[3];
+	uintOut[1] = uintIn[2];
+	uintOut[2] = uintIn[1];
+	uintOut[3] = uintIn[0];
+
+	memcpy (&outVal,uintOut,4);
+
+	return outVal;
+}
+
+void encodeRing(const TeLine2D& line, char*& wkbLine, unsigned int& size)
+{
+	unsigned int nPoints = line.size();
+	size = sizeof(unsigned int) + (nPoints*2*sizeof(double));
+
+	wkbLine = new char[size];
+	char* l = wkbLine;
+
+	//nPoints
+	memcpy(l, &nPoints , sizeof(unsigned int));
+	l += sizeof(unsigned int);
+
+	for(unsigned int i = 0; i < nPoints ; ++i)
+	{
+		double x = line[i].x();
+		double y = line[i].y();
+
+		memcpy(l, &x, sizeof(double));
+		l += sizeof(double);
+		
+		memcpy(l, &y, sizeof(double));
+		l += sizeof(double);
+	}
+}
+
+void decodeCoord(const char*& wkb, TeCoord2D& point, const char& byteOrder, unsigned int& readBytes)
+{
+	union
+	{
+		double dWord_;
+		unsigned int aux_[2];
+	} swapx1, swapy1;
+
+	memcpy(&swapx1.dWord_, wkb, sizeof(double));
+	memcpy(&swapy1.dWord_, wkb + sizeof(double), sizeof(double));
+
+	readBytes = 2*(sizeof(double));
+	wkb += readBytes; // x + y
+
+	// 0 = Big Endian (wkbXDR)
+	if((byteOrder == 0) && isLittleEndian())
+	{
+		union
+		{
+			double dWord_;
+			unsigned int aux_[2];
+		} swapx2, swapy2;
+
+		swapx2.aux_[1] = ntohl(swapx1.aux_[0]);
+		swapx2.aux_[0] = ntohl(swapx1.aux_[1]);
+
+		swapy2.aux_[1] = ntohl(swapy1.aux_[0]);
+		swapy2.aux_[0] = ntohl(swapy1.aux_[1]);	
+		
+		point.x(swapx2.dWord_);
+		point.y(swapy2.dWord_);
+
+		return;
+	}
+	else if((byteOrder == 0) && !isLittleEndian())
+	{
+		union
+		{
+			double dWord_;
+			unsigned int aux_[2];
+		} swapx2, swapy2;
+
+		swapx2.aux_[1] = SwapUInt(swapx1.aux_[0]);
+		swapx2.aux_[0] = SwapUInt(swapx1.aux_[1]);
+
+		swapy2.aux_[1] = SwapUInt(swapy1.aux_[0]);
+		swapy2.aux_[0] = SwapUInt(swapy1.aux_[1]);
+		
+		point.x(swapx2.dWord_);
+		point.y(swapy2.dWord_);
+
+		return ;
+	}
+
+	point.x(swapx1.dWord_);
+	point.y(swapy1.dWord_);
+}
+
+void decodeRing(const char*& wkb, TeLine2D& line, const char& byteOrder, const int& lineSize, unsigned int& readBytes)
+{
+	const char* aux = wkb;
+	unsigned int ringReadBytes = 0;
+	
+	for(int i = 0; i < lineSize; i++)
+	{
+		TeCoord2D point;
+		decodeCoord(aux, point, byteOrder, ringReadBytes);
+		line.add(point);
+		readBytes += ringReadBytes;
+	}
+}
+
+void getWKBHeader(const char*& wkb, char& byteOrder, unsigned int& wkbType, unsigned int& numGeometries)
+{
+	const int byteOrderPlusGeomType = sizeof(unsigned char) + sizeof(unsigned int);	
+
+	memcpy(&byteOrder, wkb, sizeof(unsigned char));		
+	memcpy(&wkbType, wkb + sizeof(unsigned char), sizeof(unsigned int));
+
+	const char* aux = wkb;
+	aux += byteOrderPlusGeomType;
+	
+	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+	if(byteOrder == 0 && isLittleEndian())
+	{
+		wkbType = ntohl(wkbType);
+	}
+	else if(byteOrder == 1 && !isLittleEndian())
+	{
+		wkbType = SwapUInt(wkbType);
+	}	
+
+	numGeometries = 0;
+
+	if(wkbType > 1 && wkbType <= 7)
+	{
+		memcpy(&numGeometries, aux, sizeof(unsigned int));
+		aux += sizeof(unsigned int);
+
+		// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+		if(byteOrder == 0 && isLittleEndian())
+		{
+			numGeometries = ntohl(numGeometries);	
+		}
+		else if(byteOrder == 1 && !isLittleEndian())
+		{
+			numGeometries = SwapUInt(numGeometries);
+		}
+	}
+}
+
+void TeWKBGeometryDecoder::encodePolygon(const TePolygon& polygon, char*& wkbPoly, unsigned int& size)
+{
+	char byteOrder;
+	unsigned int wkbType = 3;//WKBPolygon
+	unsigned int nRings = polygon.size();
+
+	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+	byteOrder = (!isLittleEndian()) ? 0 : 1;
+//	if(((unsigned int) 1) == htonl((unsigned int) 1))
+//	{
+//		byteOrder = 0;
+//	}
+//	else
+//	{
+//		byteOrder = 1;
+//	}
+
+	//cabecalho
+	size = sizeof(char) + (2*sizeof(unsigned int));
+
+	//rings
+	for(unsigned int i = 0; i < nRings ; ++i)
+	{
+		size += sizeof(unsigned int) + (2 * sizeof(double) * polygon[i].size());
+	}
+	
+	wkbPoly = new char[size];
+	char* p = wkbPoly;
+
+	//byteOrder	
+	memcpy(p, &byteOrder , sizeof(char));
+	p += sizeof(char);
+
+	//WKBPolygon
+	memcpy(p, &wkbType , sizeof(unsigned int));
+	p += sizeof(unsigned int);
+
+	//Rings
+	memcpy(p, &nRings , sizeof(unsigned int));
+	p += sizeof(unsigned int);
+
+	TePolygon::iterator it;
+
+	for(it = polygon.begin(); it != polygon.end(); ++it)
+	{
+		char* ring;
+		unsigned int rSize;
+		
+		encodeRing((*it), ring, rSize);
+
+		memcpy(p, ring, rSize);
+		p += rSize; 
+
+		delete [] ring;
+	}
+}
+
+void TeWKBGeometryDecoder::encodeLine(const TeLine2D& line, char*& wkbLine, unsigned int& size)
+{
+	char byteOrder;
+	unsigned int nPoints = line.size();
+	unsigned int wkbType = 2;//WKBLineString
+
+	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+	byteOrder = (!isLittleEndian()) ? 0 : 1;
+//	if(((unsigned int) 1) == htonl((unsigned int) 1))
+//	{
+//		byteOrder = 0;
+//	}
+//	else
+//	{
+//		byteOrder = 1;
+//	}
+
+	size = sizeof(char) + sizeof(unsigned int) + sizeof(unsigned int) + (2 * sizeof(double) * nPoints);
+
+	wkbLine = new char[size];
+	char* l = wkbLine;
+
+	//byteOrder	
+	memcpy(l, &byteOrder , sizeof(char));
+	l += sizeof(char);
+
+	//WKBLineString
+	memcpy(l, &wkbType , sizeof(unsigned int));
+	l += sizeof(unsigned int);
+
+	char* ring;
+	unsigned int lSize;
+	encodeRing(line, ring, lSize);
+
+	memcpy(l, ring, lSize);
+	delete []ring;
+}
+
+void TeWKBGeometryDecoder::encodePoint(const TeCoord2D& point, char*& wkbPoint, unsigned int& size)
+{
+	char byteOrder;
+	unsigned int wkbType = 1;//WKBPoint
+
+	// 0 = Big Endian (wkbXDR) e 1 = Little Endian (wkbNDR)
+	byteOrder = (!isLittleEndian()) ? 0 : 1;
+//	if(((unsigned int) 1) == htonl((unsigned int) 1))
+//	{
+//		byteOrder = 0;
+//	}
+//	else
+//	{
+//		byteOrder = 1;
+//	}
+
+	//cabecalho
+	size = sizeof(char) + sizeof(int) + (2 * sizeof(double));
+	
+	char* p = new char[size];
+	wkbPoint = p;
+
+	//byteOrder	
+	memcpy(p, &byteOrder , sizeof(char));
+	p += sizeof(char);
+
+	//WKBPoint
+	memcpy(p, &wkbType , sizeof(unsigned int));
+	p += sizeof(unsigned int);
+
+	double x = point.x();
+	double y = point.y();
+
+	memcpy(p, &x, sizeof(double));
+	p += sizeof(double);
+	memcpy(p, &y, sizeof(double));
+	p += sizeof(double);
+}
+
+void TeWKBGeometryDecoder::decodePolygon(const char*& wkbPoly, TePolygon& poly, unsigned int& readBytes)
+{
+	char byteOrder;
+	unsigned int wkbType;
+	unsigned int numGeometries;
+
+	getWKBHeader(wkbPoly, byteOrder, wkbType, numGeometries);
+	
+	if(wkbType != 3)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Binary data doesn't supported!");
+
+	const char* aux = wkbPoly;
+
+	//Size of header
+	readBytes = sizeof(char) + (2*sizeof(unsigned int));
+	aux += readBytes;
+	unsigned int polyReadBytes = 0;
+
+	for(unsigned int i = 0; i < numGeometries; i++)
+	{
+		unsigned int ringSize;
+		memcpy(&ringSize, aux, sizeof(unsigned int));
+
+		polyReadBytes += sizeof(unsigned int);
+		aux += sizeof(unsigned int);
+
+		TeLinearRing ring;
+		unsigned int ringReadBytes = 0;
+		decodeRing(aux, ring, byteOrder, ringSize, ringReadBytes);
+
+		polyReadBytes += ringReadBytes;
+		aux += ringReadBytes;
+		
+		poly.add(ring);
+	}
+	readBytes += polyReadBytes;
+}
+
+void TeWKBGeometryDecoder::decodeLine(const char*& wkbLine, TeLine2D& line, unsigned int& readBytes)
+{
+	char byteOrder;
+	unsigned int wkbType;
+	unsigned int numCoords;
+
+	getWKBHeader(wkbLine, byteOrder, wkbType, numCoords);
+	
+	if(wkbType != 2)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Binary data doesn't supported!");
+
+	//Size of header
+	const char* aux = wkbLine;
+	readBytes = sizeof(char) + (2*sizeof(unsigned int));
+	aux += readBytes;
+	
+	unsigned int lineReadBytes = 0;
+	decodeRing(aux, line, byteOrder, numCoords, lineReadBytes);
+	readBytes += lineReadBytes;
+}
+
+void TeWKBGeometryDecoder::decodePoint(const char*& wkbPoint, TeCoord2D& point, unsigned int& readBytes)
+{
+	char byteOrder;
+	unsigned int wkbType;
+	unsigned int numGeometries;
+
+	getWKBHeader(wkbPoint, byteOrder, wkbType, numGeometries);
+	
+	if(wkbType != 1)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Binary data doesn't supported!");
+
+	//Size of header
+	const char* aux = wkbPoint;
+	readBytes = sizeof(char) + sizeof(int);
+	aux += readBytes;
+
+	unsigned int ptReadBytes = 0;
+	decodeCoord(aux, point, byteOrder, ptReadBytes);
+	readBytes += ptReadBytes;
+}
+
+void TeWKBGeometryDecoder::decodePolygonSet(const char*& wkbMultiPolygon, TePolygonSet& pset, unsigned int& readBytes)
+{
+	char byteOrder;
+	unsigned int wkbType;
+	unsigned int numGeometries;
+
+	getWKBHeader(wkbMultiPolygon, byteOrder, wkbType, numGeometries);
+	
+	if(wkbType != 6)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Binary data doesn't supported!");
+
+	const char* aux = wkbMultiPolygon;
+
+	//Size of header
+	readBytes = sizeof(char) + (2*sizeof(unsigned int));
+	aux += readBytes;
+
+	for(unsigned int i = 0; i < numGeometries; i++)
+	{
+		unsigned int polyReadBytes = 0;
+		TePolygon poly;
+		decodePolygon(aux, poly, polyReadBytes);
+		readBytes += polyReadBytes;
+		aux += polyReadBytes;
+		pset.add(poly);
+	}
+}
+
+void TeWKBGeometryDecoder::decodeLineSet(const char*& wkbMultiLine, TeLineSet& lset, unsigned int& readBytes)
+{
+	char byteOrder;
+	unsigned int wkbType;
+	unsigned int numGeometries;
+
+	getWKBHeader(wkbMultiLine, byteOrder, wkbType, numGeometries);
+	
+	if(wkbType != 5)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Binary data doesn't supported!");
+
+	const char* aux = wkbMultiLine;
+
+	//Size of header
+	readBytes = sizeof(char) + (2*sizeof(unsigned int));
+	aux += readBytes;
+
+	for(unsigned int i = 0; i < numGeometries; i++)
+	{
+		unsigned int lineReadBytes = 0;
+		TeLine2D l;
+		decodeLine(aux, l, lineReadBytes);
+		readBytes += lineReadBytes;
+		aux += lineReadBytes;
+		lset.add(l);
+	}
+}
+
+void TeWKBGeometryDecoder::decodePointSet(const char*& wkbMultiPoint, TePointSet& ptset, unsigned int& readBytes)
+{
+	char byteOrder;
+	unsigned int wkbType;
+	unsigned int numGeometries;
+
+	getWKBHeader(wkbMultiPoint, byteOrder, wkbType, numGeometries);
+	
+	if(wkbType != 4)
+		throw TeException(UNKNOWN_ERROR_TYPE, "Binary data doesn't supported!");
+
+	const char* aux = wkbMultiPoint;
+
+	//Size of header
+	readBytes = sizeof(char) + (2*sizeof(unsigned int));
+	aux += readBytes;
+
+	for(unsigned int i = 0; i < numGeometries; i++)
+	{
+		unsigned int ptReadBytes = 0;
+		TeCoord2D c;
+		decodePoint(aux, c, ptReadBytes);
+		readBytes += ptReadBytes;
+		aux += ptReadBytes;
+		TePoint pt(c);
+		ptset.add(pt);
+	}
+}
diff --git a/src/terralib/utils/TeWKBGeometryDecoder.h b/src/terralib/utils/TeWKBGeometryDecoder.h
index 22a71b5..97fc130 100644
--- a/src/terralib/utils/TeWKBGeometryDecoder.h
+++ b/src/terralib/utils/TeWKBGeometryDecoder.h
@@ -1,94 +1,124 @@
-/************************************************************************************
-TerraLib - a library for developing GIS applications.
-Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
-
-This code is part of the TerraLib library.
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library.
-
-The authors reassure the license terms regarding the warranties.
-They specifically disclaim any warranties, including, but not limited to,
-the implied warranties of merchantability and fitness for a particular purpose.
-The library provided hereunder is on an "as is" basis, and the authors have no
-obligation to provide maintenance, support, updates, enhancements, or modifications.
-In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
-indirect, special, incidental, or consequential damages arising out of the use
-of this library and its documentation.
-*************************************************************************************/
-
-#ifndef  __TERRALIB_INTERNAL_WKBGEOMETRYDECODER_H
-#define  __TERRALIB_INTERNAL_WKBGEOMETRYDECODER_H
-
-//Forward declarations
-class TePolygon;
-class TeLine2D;
-class TeCoord2D;
-
-/** @namespace TeWKBGeometryDecoder
- *
- * @brief Contains decoding/encoding functions for TerraLib geometries into WKB-like geometries. 
- *
- * WKB format is used to struct information about geomtries in well-know manner. It is an interchange format.
- * For more information about WBK format see 
- * <A HREF="">WKB representation.</A>.
- */
-namespace TeWKBGeometryDecoder
-{
-    /** @name Encoding Methods
-		* Methods used to encode TeGeometry objects into pointers to char* in WKB format.
-		*/
-	//@{		
-
-	/** @brief Encodes a TePolygon into a WKB. 
-	 *	@param polygon Polygon to be encoded. [in]
-	 *	@param wkbPoly WKB genenerated by the polygon. [out]
-	 *	@param size The size of WKB in byte. [out]
-	 */
-	void encodePolygon(const TePolygon& polygon, char*& wkbPoly, unsigned int& size);
-
-	/** @brief Encodes a TeLine2D into a WKB. 
-	 *	@param line Polygon to be encoded. [in]
-	 *	@param wkbLIne WKB genenerated by the line. [out]
-	 *	@param size The size of WKB in byte. [out]
-	 */
-	void encodeLine(const TeLine2D& line, char*& wkbLine, unsigned int& size);
-
-	/** @brief Encodes a TeCoord2D into a WKB. 
-	 *	@param polygon Polygon to be encoded. [in]
-	 *	@param wkbPoly WKB genenerated by the polygon. [out]
-	 *	@param size The size of WKB in byte. [out]
-	 */
-	void encodePoint(const TeCoord2D& point, char*& wkbPoint, unsigned int& size);
-	//@}
-
-    /** @name Decoding Methods
-		* Methods used to decode pointers to char* in WKB format into code TeGeometry objects.
-		*/
-	//@{		
-
-	/** @brief Decodes a WKB into a TePolygon object.
-	 *	@param wkbPoly WKB to be decoded. [in]
-	 *	@param poly TePolygon decoded. [out]
-	 */
-	void decodePolygon(const char*& wkbPoly, TePolygon& poly);
-
-	/** @brief Decodes a WKB into a TeLine2D object.
-	 *	@param wkbLine WKB to be decoded. [in]
-	 *	@param line TeLine2D decoded. [out]
-	 */
-	void decodeLine(const char*& wkbLine, TeLine2D& line);
-
-	/** @brief Decodes a WKB into a TeCoord2D object.
-	 *	@param wkbPoint WKB to be decoded. [in]
-	 *	@param point TeCoord2D decoded. [out]
-	 */
-	void decodePoint(const char*& wkbPoint, TeCoord2D& point);
-	//@}
-};
-
-#endif  //__TERRALIB_INTERNAL_WKBGEOMETRYENCODER_H
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_WKBGEOMETRYDECODER_H
+#define  __TERRALIB_INTERNAL_WKBGEOMETRYDECODER_H
+
+#include "TeUtilsDefines.h"
+
+//Forward declarations
+class TePolygon;
+class TeLine2D;
+class TeCoord2D;
+class TePolygonSet;
+class TeLineSet;
+class TePointSet;
+
+/** @namespace TeWKBGeometryDecoder
+ *
+ * @brief Contains decoding/encoding functions for TerraLib geometries into WKB-like geometries. 
+ *
+ * WKB format is used to struct information about geomtries in well-know manner. It is an interchange format.
+ * For more information about WBK format see 
+ * <A HREF="">WKB representation.</A>.
+ */
+namespace TeWKBGeometryDecoder
+{
+    /** @name Encoding Methods
+		* Methods used to encode TeGeometry objects into pointers to char* in WKB format.
+		*/
+	//@{		
+
+	/** @brief Encodes a TePolygon into a WKB. 
+	 *	@param polygon Polygon to be encoded. [in]
+	 *	@param wkbPoly WKB genenerated by the polygon. [out]
+	 *	@param size The size of WKB in byte. [out]
+	 */
+	TLUTILS_DLL void encodePolygon(const TePolygon& polygon, char*& wkbPoly, unsigned int& size);
+
+	/** @brief Encodes a TeLine2D into a WKB. 
+	 *	@param line Polygon to be encoded. [in]
+	 *	@param wkbLIne WKB genenerated by the line. [out]
+	 *	@param size The size of WKB in byte. [out]
+	 */
+	TLUTILS_DLL void encodeLine(const TeLine2D& line, char*& wkbLine, unsigned int& size);
+
+	/** @brief Encodes a TeCoord2D into a WKB. 
+	 *	@param polygon Polygon to be encoded. [in]
+	 *	@param wkbPoly WKB genenerated by the polygon. [out]
+	 *	@param size The size of WKB in byte. [out]
+	 */
+	TLUTILS_DLL void encodePoint(const TeCoord2D& point, char*& wkbPoint, unsigned int& size);
+	//@}
+
+    /** @name Decoding Methods
+		* Methods used to decode pointers to char* in WKB format into code TeGeometry objects.
+		*/
+	//@{		
+
+	/** @brief Decodes a WKB into a TePolygon object.
+	 *	@param wkbPoly WKB to be decoded. [in]
+	 *	@param poly TePolygon decoded. [out]
+	 *  @param readBytes number of bytes that were read. [out]
+	 */
+	TLUTILS_DLL void decodePolygon(const char*& wkbPoly, TePolygon& poly, unsigned int& readBytes);
+
+	/** @brief Decodes a WKB into a TeLine2D object.
+	 *	@param wkbLine WKB to be decoded. [in]
+	 *	@param line TeLine2D decoded. [out]
+	 *  @param readBytes number of bytes that were read. [out]
+	 */
+	TLUTILS_DLL void decodeLine(const char*& wkbLine, TeLine2D& line, unsigned int& readBytes);
+
+	/** @brief Decodes a WKB into a TeCoord2D object.
+	 *	@param wkbPoint WKB to be decoded. [in]
+	 *	@param point TeCoord2D decoded. [out]
+	 *  @param readBytes number of bytes that were read. [out]
+	 */
+	TLUTILS_DLL void decodePoint(const char*& wkbPoint, TeCoord2D& point, unsigned int& readBytes);
+
+	/** @brief Decodes a WKB into a TePolygonSet object.
+	 *	@param wkbMultiPolygon WKB to be decoded. [in]
+	 *	@param pset TePolygonSet decoded. [out]
+	 *  @param readBytes number of bytes that were read. [out]
+	 */
+	TLUTILS_DLL void decodePolygonSet(const char*& wkbMultiPolygon, TePolygonSet& pset, unsigned int& readBytes);
+
+	/** @brief Decodes a WKB into a TeLineSet object.
+	 *	@param wkbMultiLine WKB to be decoded. [in]
+	 *	@param lset TeLineSet decoded. [out]
+	 *  @param readBytes number of bytes that were read. [out]
+	 */
+	TLUTILS_DLL void decodeLineSet(const char*& wkbMultiLine, TeLineSet& lset, unsigned int& readBytes);
+
+	/** @brief Decodes a WKB into a TePointSet object.
+	 *	@param wkbMultiPoint WKB to be decoded. [in]
+	 *	@param ptset TePointSet decoded. [out]
+	 *  @param readBytes number of bytes that were read. [out]
+	 */
+	TLUTILS_DLL void decodePointSet(const char*& wkbMultiPoint, TePointSet& ptset, unsigned int& readBytes);
+
+	//@}
+};
+
+#endif  //__TERRALIB_INTERNAL_WKBGEOMETRYENCODER_H
diff --git a/src/terralib/utils/TeWKTGeometryDecoder.cpp b/src/terralib/utils/TeWKTGeometryDecoder.cpp
new file mode 100644
index 0000000..6fe47df
--- /dev/null
+++ b/src/terralib/utils/TeWKTGeometryDecoder.cpp
@@ -0,0 +1,150 @@
+#include <TeWKTGeometryDecoder.h>
+
+//TerraLib include files
+#include <TeGeometry.h>
+#include <TeException.h>
+
+string getWKTPoint(const TeCoord2D& pt)
+{
+	string wkt;
+
+	wkt = Te2String(pt.x(), 10) + " " + Te2String(pt.y(), 10);
+
+	return wkt;
+}
+
+string getWKTLine(const TeLine2D& line)
+{
+	string wkt;
+
+	for(unsigned int i = 0; i < line.size(); i++)
+	{
+		if(i > 0)
+			wkt += ",";
+
+		wkt += getWKTPoint(line[i]);
+	}
+
+	return wkt;
+}
+
+string getOnlyGeometry(const string& wkt)
+{
+	int posI = wkt.find_first_of("("),
+		posF = wkt.find_last_of(")");
+
+	posI += 1;
+	string res = wkt.substr(posI, posF - posI);
+
+	return res;
+}
+
+string removeInvalidChars(const string& wkt)
+{
+	string res = wkt;
+
+	int pos = res.find("(");
+
+	if(pos == string::npos)
+		pos = res.find(")");
+
+	while(pos != string::npos)
+	{
+		res.erase(pos, 1);
+
+		pos = res.find("(");
+
+		if(pos == string::npos)
+			pos = res.find(")");
+	}
+
+	return res;
+}
+
+TeCoord2D getCoord(const string& pt)
+{
+	TeCoord2D p;
+	vector<string> ptS;
+	TeSplitString(pt, " ", ptS);
+
+	if(ptS.size() == 2)
+		p.setXY(atof(ptS[0].c_str()), atof(ptS[1].c_str()));
+
+	return p;
+}
+
+TeLine2D getLine(const string& line)
+{
+	TeLine2D l;
+	vector<string> pts;
+	vector<string>::iterator it;
+
+	TeSplitString(line, ",", pts);
+
+	for(it = pts.begin(); it != pts.end(); ++it)
+		l.add(getCoord(*it));
+
+	return l;
+}
+
+void TeWKTGeometryDecoder::encodePolygon(const TePolygon& polygon, string& wktPoly)
+{
+	if(polygon.size() > 0)
+	{
+		wktPoly = "POLYGON(";
+
+		for(unsigned int i = 0; i < polygon.size(); i++)
+		{
+			if(i > 0)
+				wktPoly += ",";
+
+			wktPoly += "(" + getWKTLine(polygon[i]) + ")";
+		}
+
+		wktPoly += ")";
+	}
+}
+
+void TeWKTGeometryDecoder::encodeLine(const TeLine2D& line, string& wktLine)
+{
+	if(line.size() >= 2)
+	{
+		wktLine = "LINESTRING(";
+		wktLine += getWKTLine(line);
+		wktLine += ")";
+	}
+}
+
+void TeWKTGeometryDecoder::encodePoint(const TeCoord2D& point, string& wktPoint)
+{
+	wktPoint = "POINT(" + getWKTPoint(point) + ")"; 
+}
+
+void TeWKTGeometryDecoder::decodePolygon(const string& wktPoly, TePolygon& poly)
+{
+	string oGeom = getOnlyGeometry(wktPoly);
+	vector<string> lines;
+	vector<string>::iterator it;
+
+	TeSplitString(oGeom, "),(", lines);
+
+	for(it = lines.begin(); it != lines.end(); ++it)
+	{
+		string line = removeInvalidChars(*it);
+		TeLine2D l = getLine(line);
+		poly.add(l);
+	}
+}
+
+void TeWKTGeometryDecoder::decodeLine(const string& wktLine, TeLine2D& line)
+{
+	string oGeom = getOnlyGeometry(wktLine);
+	line = getLine(oGeom);
+}
+
+void TeWKTGeometryDecoder::decodePoint(const string& wktPoint, TeCoord2D& point)
+{
+	string oGeom = getOnlyGeometry(wktPoint);
+	point = getCoord(oGeom);
+}
+
diff --git a/src/terralib/utils/TeWKTGeometryDecoder.h b/src/terralib/utils/TeWKTGeometryDecoder.h
new file mode 100644
index 0000000..d53f619
--- /dev/null
+++ b/src/terralib/utils/TeWKTGeometryDecoder.h
@@ -0,0 +1,97 @@
+/************************************************************************************
+TerraLib - a library for developing GIS applications.
+Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
+
+This code is part of the TerraLib library.
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library.
+
+The authors reassure the license terms regarding the warranties.
+They specifically disclaim any warranties, including, but not limited to,
+the implied warranties of merchantability and fitness for a particular purpose.
+The library provided hereunder is on an "as is" basis, and the authors have no
+obligation to provide maintenance, support, updates, enhancements, or modifications.
+In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
+indirect, special, incidental, or consequential damages arising out of the use
+of this library and its documentation.
+*************************************************************************************/
+
+#ifndef  __TERRALIB_INTERNAL_WKTGEOMETRYDECODER_H
+#define  __TERRALIB_INTERNAL_WKTGEOMETRYDECODER_H
+
+#include "TeUtilsDefines.h"
+
+//STL include files
+#include <string>
+using namespace std;
+
+//Forward declarations
+class TePolygon;
+class TeLine2D;
+class TeCoord2D;
+
+/** @namespace TeWKTGeometryDecoder
+ *
+ * @brief Contains decoding/encoding functions for TerraLib geometries into WKT-like geometries. 
+ *
+ * WKT format is used to struct information about geometries in well-know manner. It is an interchange format.
+ * For more information about WKT format see 
+ * <A HREF="">WKT representation.</A>.
+ */
+namespace TeWKTGeometryDecoder
+{
+    /** @name Encoding Methods
+		* Methods used to encode TeGeometry objects into strings in WKT format.
+		*/
+	//@{		
+
+	/** @brief Encodes a TePolygon into a WKT. 
+	 *	@param polygon Polygon to be encoded. 
+	 *	@param[out] wktPoly WKT genenerated by the polygon.
+	 */
+	TLUTILS_DLL void encodePolygon(const TePolygon& polygon, string& wktPoly);
+
+	/** @brief Encodes a TeLine2D into a WKT. 
+	 *	@param line Polygon to be encoded.
+	 *	@param wktLine[out] WKT genenerated by the line.
+	 */
+	TLUTILS_DLL void encodeLine(const TeLine2D& line, string& wktLine);
+
+	/** @brief Encodes a TeCoord2D into a WKT. 
+	 *	@param polygon Polygon to be encoded.
+	 *	@param[out] wktPoint WKT genenerated by the point.
+	 */
+	TLUTILS_DLL void encodePoint(const TeCoord2D& point, string& wktPoint);
+	//@}
+
+    /** @name Decoding Methods
+		* Methods used to decode strings in WKT format into code TeGeometry objects.
+		*/
+	//@{		
+
+	/** @brief Decodes a WKT into a TePolygon object.
+	 *	@param wktPoly WKT to be decoded. 
+	 *	@param[out] poly TePolygon decoded.
+	 */
+	TLUTILS_DLL void decodePolygon(const string& wktPoly, TePolygon& poly);
+
+	/** @brief Decodes a WKT into a TeLine2D object.
+	 *	@param wktLine WKT to be decoded.
+	 *	@param[out] line TeLine2D decoded.
+	 */
+	TLUTILS_DLL void decodeLine(const string& wktLine, TeLine2D& line);
+
+	/** @brief Decodes a WKT into a TeCoord2D object.
+	 *	@param wktPoint WKT to be decoded.
+	 *	@param[out] point TeCoord2D decoded.
+	 */
+	TLUTILS_DLL void decodePoint(const string& wktPoint, TeCoord2D& point);
+	//@}
+};
+
+#endif  //__TERRALIB_INTERNAL_WKTGEOMETRYENCODER_H
diff --git a/src/terralib/utils/mtrand.cpp b/src/terralib/utils/mtrand.cpp
new file mode 100644
index 0000000..e6a8807
--- /dev/null
+++ b/src/terralib/utils/mtrand.cpp
@@ -0,0 +1,50 @@
+// mtrand.cpp, see include file mtrand.h for information
+
+#include "mtrand.h"
+// non-inline function definitions and static member definitions cannot
+// reside in header file because of the risk of multiple declarations
+
+// initialization of static private members
+unsigned long MTRand_int32::state[n] = {0x0UL};
+int MTRand_int32::p = 0;
+bool MTRand_int32::init = false;
+
+void MTRand_int32::gen_state() { // generate new state vector
+  for (int i = 0; i < (n - m); ++i)
+    state[i] = state[i + m] ^ twiddle(state[i], state[i + 1]);
+  for (int i = n - m; i < (n - 1); ++i)
+    state[i] = state[i + m - n] ^ twiddle(state[i], state[i + 1]);
+  state[n - 1] = state[m - 1] ^ twiddle(state[n - 1], state[0]);
+  p = 0; // reset position
+}
+
+void MTRand_int32::seed(unsigned long s) {  // init by 32 bit seed
+  state[0] = s & 0xFFFFFFFFUL; // for > 32 bit machines
+  for (int i = 1; i < n; ++i) {
+    state[i] = 1812433253UL * (state[i - 1] ^ (state[i - 1] >> 30)) + i;
+// see Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier
+// in the previous versions, MSBs of the seed affect only MSBs of the array state
+// 2002/01/09 modified by Makoto Matsumoto
+    state[i] &= 0xFFFFFFFFUL; // for > 32 bit machines
+  }
+  p = n; // force gen_state() to be called for next random number
+}
+
+void MTRand_int32::seed(const unsigned long* array, int size) { // init by array
+  seed(19650218UL);
+  int i = 1, j = 0;
+  for (int k = ((n > size) ? n : size); k; --k) {
+    state[i] = (state[i] ^ ((state[i - 1] ^ (state[i - 1] >> 30)) * 1664525UL))
+      + array[j] + j; // non linear
+    state[i] &= 0xFFFFFFFFUL; // for > 32 bit machines
+    ++j; j %= size;
+    if ((++i) == n) { state[0] = state[n - 1]; i = 1; }
+  }
+  for (int k = n - 1; k; --k) {
+    state[i] = (state[i] ^ ((state[i - 1] ^ (state[i - 1] >> 30)) * 1566083941UL)) - i;
+    state[i] &= 0xFFFFFFFFUL; // for > 32 bit machines
+    if ((++i) == n) { state[0] = state[n - 1]; i = 1; }
+  }
+  state[0] = 0x80000000UL; // MSB is 1; assuring non-zero initial array
+  p = n; // force gen_state() to be called for next random number
+}
diff --git a/src/terralib/utils/mtrand.h b/src/terralib/utils/mtrand.h
new file mode 100644
index 0000000..c58ab07
--- /dev/null
+++ b/src/terralib/utils/mtrand.h
@@ -0,0 +1,156 @@
+// mtrand.h
+// C++ include file for MT19937, with initialization improved 2002/1/26.
+// Coded by Takuji Nishimura and Makoto Matsumoto.
+// Ported to C++ by Jasper Bedaux 2003/1/1 (see http://www.bedaux.net/mtrand/).
+// The generators returning floating point numbers are based on
+// a version by Isaku Wada, 2002/01/09
+//
+// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// 1. Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the distribution.
+//
+// 3. The names of its contributors may not be used to endorse or promote
+//    products derived from this software without specific prior written
+//    permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Any feedback is very welcome.
+// http://www.math.keio.ac.jp/matumoto/emt.html
+// email: matumoto at math.keio.ac.jp
+//
+// Feedback about the C++ port should be sent to Jasper Bedaux,
+// see http://www.bedaux.net/mtrand/ for e-mail address and info.
+
+#ifndef MTRAND_H
+#define MTRAND_H
+
+#include "TeUtilsDefines.h"
+
+class TLUTILS_DLL MTRand_int32 { // Mersenne Twister random number generator
+public:
+// default constructor: uses default seed only if this is the first instance
+  MTRand_int32() { if (!init) seed(5489UL); init = true; }
+// constructor with 32 bit int as seed
+  MTRand_int32(unsigned long s) { seed(s); init = true; }
+// constructor with array of size 32 bit ints as seed
+  MTRand_int32(const unsigned long* array, int size) { seed(array, size); init = true; }
+// the two seed functions
+  void seed(unsigned long); // seed with 32 bit integer
+  void seed(const unsigned long*, int size); // seed with array
+// overload operator() to make this a generator (functor)
+  unsigned long operator()() { return rand_int32(); }
+// 2007-02-11: made the destructor virtual; thanks "double more" for pointing this out
+  virtual ~MTRand_int32() {} // destructor
+protected: // used by derived classes, otherwise not accessible; use the ()-operator
+  unsigned long rand_int32(); // generate 32 bit random integer
+private:
+  static const int n = 624; // compile time constants
+  static const int m = 397; // compile time constants
+// the variables below are static (no duplicates can exist)
+  static unsigned long state[n]; // state vector array
+  static int p; // position in state array
+  static bool init; // true if init function is called
+// private functions used to generate the pseudo random numbers
+  unsigned long twiddle(unsigned long, unsigned long); // used by gen_state()
+  void gen_state(); // generate new state
+// make copy constructor and assignment operator unavailable, they don't make sense
+  MTRand_int32(const MTRand_int32&); // copy constructor not defined
+  void operator=(const MTRand_int32&); // assignment operator not defined
+};
+
+// inline for speed, must therefore reside in header file
+inline unsigned long MTRand_int32::twiddle(unsigned long u, unsigned long v) {
+  return (((u & 0x80000000UL) | (v & 0x7FFFFFFFUL)) >> 1)
+    ^ ((v & 1UL) ? 0x9908B0DFUL : 0x0UL);
+}
+
+inline unsigned long MTRand_int32::rand_int32() { // generate 32 bit random int
+  if (p == n) gen_state(); // new state vector needed
+// gen_state() is split off to be non-inline, because it is only called once
+// in every 624 calls and otherwise irand() would become too big to get inlined
+  unsigned long x = state[p++];
+  x ^= (x >> 11);
+  x ^= (x << 7) & 0x9D2C5680UL;
+  x ^= (x << 15) & 0xEFC60000UL;
+  return x ^ (x >> 18);
+}
+
+// generates double floating point numbers in the half-open interval [0, 1)
+class TLUTILS_DLL MTRand : public MTRand_int32 {
+public:
+  MTRand() : MTRand_int32() {}
+  MTRand(unsigned long seed) : MTRand_int32(seed) {}
+  MTRand(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
+  ~MTRand() {}
+  double operator()() {
+    return static_cast<double>(rand_int32()) * (1. / 4294967296.); } // divided by 2^32
+private:
+  MTRand(const MTRand&); // copy constructor not defined
+  void operator=(const MTRand&); // assignment operator not defined
+};
+
+// generates double floating point numbers in the closed interval [0, 1]
+class TLUTILS_DLL MTRand_closed : public MTRand_int32 {
+public:
+  MTRand_closed() : MTRand_int32() {}
+  MTRand_closed(unsigned long seed) : MTRand_int32(seed) {}
+  MTRand_closed(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
+  ~MTRand_closed() {}
+  double operator()() {
+    return static_cast<double>(rand_int32()) * (1. / 4294967295.); } // divided by 2^32 - 1
+private:
+  MTRand_closed(const MTRand_closed&); // copy constructor not defined
+  void operator=(const MTRand_closed&); // assignment operator not defined
+};
+
+// generates double floating point numbers in the open interval (0, 1)
+class TLUTILS_DLL MTRand_open : public MTRand_int32 {
+public:
+  MTRand_open() : MTRand_int32() {}
+  MTRand_open(unsigned long seed) : MTRand_int32(seed) {}
+  MTRand_open(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
+  ~MTRand_open() {}
+  double operator()() {
+    return (static_cast<double>(rand_int32()) + .5) * (1. / 4294967296.); } // divided by 2^32
+private:
+  MTRand_open(const MTRand_open&); // copy constructor not defined
+  void operator=(const MTRand_open&); // assignment operator not defined
+};
+
+// generates 53 bit resolution doubles in the half-open interval [0, 1)
+class TLUTILS_DLL MTRand53 : public MTRand_int32 {
+public:
+  MTRand53() : MTRand_int32() {}
+  MTRand53(unsigned long seed) : MTRand_int32(seed) {}
+  MTRand53(const unsigned long* seed, int size) : MTRand_int32(seed, size) {}
+  ~MTRand53() {}
+  double operator()() {
+    return (static_cast<double>(rand_int32() >> 5) * 67108864. + 
+      static_cast<double>(rand_int32() >> 6)) * (1. / 9007199254740992.); }
+private:
+  MTRand53(const MTRand53&); // copy constructor not defined
+  void operator=(const MTRand53&); // assignment operator not defined
+};
+
+#endif // MTRAND_H
diff --git a/src/tiff/cpl_csv.c b/src/tiff/cpl_csv.c
new file mode 100644
index 0000000..47ac1b5
--- /dev/null
+++ b/src/tiff/cpl_csv.c
@@ -0,0 +1,1016 @@
+/******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * cpl_csv.c: Support functions for accessing CSV files.
+ *
+ * $Log$
+ * Revision 1.16  2003/07/10 18:03:28  warmerda
+ * don't crash if NULL passed to gtCSVAccess()
+ *
+ * Revision 1.15  2003/01/20 06:46:35  warmerda
+ * search for pcs.csv, not horiz_cs.csv
+ *
+ * Revision 1.14  2003/01/15 04:39:58  warmerda
+ * change internal name of CSVAccess
+ *
+ * Revision 1.13  2002/11/28 22:26:41  warmerda
+ * upgraded to proper CSV formatting, and in-memory caching
+ *
+ * Revision 1.12  2002/06/19 03:51:15  warmerda
+ * migrated cpl_csv.h into cpl_serv.h
+ *
+ * Revision 1.11  2001/03/05 04:49:56  warmerda
+ * try to clear CPLReadLine buffer on deaccess
+ *
+ * Revision 1.10  2001/01/17 15:32:19  warmerda
+ * Include /usr/share/epsg_csv and share/epsg_csv in csv search path.
+ *
+ * Revision 1.9  2000/12/12 19:34:36  warmerda
+ * Use CSV_DATA_DIR if defined.
+ *
+ * Revision 1.8  2000/08/22 04:33:33  warmerda
+ * added support for /usr/local/shared/epsg_csv
+ *
+ * Revision 1.7  1999/12/03 14:42:59  warmerda
+ * Passing a NULL filename into CSVAccess() now results in a graceful
+ * failure to open the file.
+ *
+ * Revision 1.6  1999/06/26 17:28:51  warmerda
+ * Fixed reading of records with newlines embedded in quoted strings.
+ *
+ * Revision 1.5  1999/05/04 03:07:24  warmerda
+ * avoid warning
+ *
+ * Revision 1.4  1999/04/28 19:59:56  warmerda
+ * added some doxygen style documentation
+ *
+ * Revision 1.3  1999/03/17 19:53:15  geotiff
+ * sys includes moved to cpl_serv.h
+ *
+ * Revision 1.2  1999/03/10 16:54:42  geotiff
+ * Added use of the GEOTIFF_CSV environment variable to locate CSV files.
+ *
+ * Revision 1.1  1999/03/09 15:57:04  geotiff
+ * New
+ *
+ * Revision 1.2  1999/02/24 16:23:21  warmerda
+ * added lots
+ *
+ * Revision 1.1  1999/01/05 16:52:36  warmerda
+ * New
+ *
+ */
+
+#include "cpl_serv.h"
+#include "geo_tiffp.h"
+
+/* ==================================================================== */
+/*      The CSVTable is a persistant set of info about an open CSV      */
+/*      table.  While it doesn't currently maintain a record index,     */
+/*      or in-memory copy of the table, it could be changed to do so    */
+/*      in the future.                                                  */
+/* ==================================================================== */
+typedef struct ctb {
+    FILE        *fp;
+
+    struct ctb *psNext;
+
+    char        *pszFilename;
+
+    char        **papszFieldNames;
+
+    char        **papszRecFields;
+
+    int         iLastLine;
+
+    /* Cache for whole file */
+    int         nLineCount;
+    char        **papszLines;
+    int         *panLineIndex;
+    char        *pszRawData;
+} CSVTable;
+
+static CSVTable *psCSVTableList = NULL;
+
+/************************************************************************/
+/*                             CSVAccess()                              */
+/*                                                                      */
+/*      This function will fetch a handle to the requested table.       */
+/*      If not found in the ``open table list'' the table will be       */
+/*      opened and added to the list.  Eventually this function may     */
+/*      become public with an abstracted return type so that            */
+/*      applications can set options about the table.  For now this     */
+/*      isn't done.                                                     */
+/************************************************************************/
+
+static CSVTable *gtCSVAccess( const char * pszFilename )
+
+{
+    CSVTable    *psTable;
+    FILE        *fp;
+
+    if( pszFilename == NULL )
+        return NULL;
+
+/* -------------------------------------------------------------------- */
+/*      Is the table already in the list.                               */
+/* -------------------------------------------------------------------- */
+    for( psTable = psCSVTableList; psTable != NULL; psTable = psTable->psNext )
+    {
+        if( EQUAL(psTable->pszFilename,pszFilename) )
+        {
+            /*
+             * Eventually we should consider promoting to the front of
+             * the list to accelerate frequently accessed tables.
+             */
+            
+            return( psTable );
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      If not, try to open it.                                         */
+/* -------------------------------------------------------------------- */
+    fp = VSIFOpen( pszFilename, "rb" );
+    if( fp == NULL )
+        return NULL;
+
+/* -------------------------------------------------------------------- */
+/*      Create an information structure about this table, and add to    */
+/*      the front of the list.                                          */
+/* -------------------------------------------------------------------- */
+    psTable = (CSVTable *) CPLCalloc(sizeof(CSVTable),1);
+
+    psTable->fp = fp;
+    psTable->pszFilename = CPLStrdup( pszFilename );
+    psTable->psNext = psCSVTableList;
+    
+    psCSVTableList = psTable;
+
+/* -------------------------------------------------------------------- */
+/*      Read the table header record containing the field names.        */
+/* -------------------------------------------------------------------- */
+    psTable->papszFieldNames = CSVReadParseLine( fp );
+
+    return( psTable );
+}
+
+/************************************************************************/
+/*                            CSVDeaccess()                             */
+/************************************************************************/
+
+void CSVDeaccess( const char * pszFilename )
+
+{
+    CSVTable    *psLast, *psTable;
+    
+/* -------------------------------------------------------------------- */
+/*      A NULL means deaccess all tables.                               */
+/* -------------------------------------------------------------------- */
+    if( pszFilename == NULL )
+    {
+        while( psCSVTableList != NULL )
+            CSVDeaccess( psCSVTableList->pszFilename );
+        
+        return;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Find this table.                                                */
+/* -------------------------------------------------------------------- */
+    psLast = NULL;
+    for( psTable = psCSVTableList;
+         psTable != NULL && !EQUAL(psTable->pszFilename,pszFilename);
+         psTable = psTable->psNext )
+    {
+        psLast = psTable;
+    }
+
+    if( psTable == NULL )
+    {
+        return;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Remove the link from the list.                                  */
+/* -------------------------------------------------------------------- */
+    if( psLast != NULL )
+        psLast->psNext = psTable->psNext;
+    else
+        psCSVTableList = psTable->psNext;
+
+/* -------------------------------------------------------------------- */
+/*      Free the table.                                                 */
+/* -------------------------------------------------------------------- */
+    if( psTable->fp != NULL )
+        VSIFClose( psTable->fp );
+
+    CSLDestroy( psTable->papszFieldNames );
+    CSLDestroy( psTable->papszRecFields );
+    CPLFree( psTable->pszFilename );
+    CPLFree( psTable->panLineIndex );
+    CPLFree( psTable->pszRawData );
+    CPLFree( psTable->papszLines );
+
+    CPLFree( psTable );
+
+    CPLReadLine( NULL );
+}
+
+/************************************************************************/
+/*                            CSVSplitLine()                            */
+/*                                                                      */
+/*      Tokenize a CSV line into fields in the form of a string         */
+/*      list.  This is used instead of the CPLTokenizeString()          */
+/*      because it provides correct CSV escaping and quoting            */
+/*      semantics.                                                      */
+/************************************************************************/
+
+static char **CSVSplitLine( const char *pszString )
+
+{
+    char        **papszRetList = NULL;
+    char        *pszToken;
+    int         nTokenMax, nTokenLen;
+
+    pszToken = (char *) CPLCalloc(10,1);
+    nTokenMax = 10;
+    
+    while( pszString != NULL && *pszString != '\0' )
+    {
+        int     bInString = FALSE;
+
+        nTokenLen = 0;
+        
+        /* Try to find the next delimeter, marking end of token */
+        for( ; *pszString != '\0'; pszString++ )
+        {
+
+            /* End if this is a delimeter skip it and break. */
+            if( !bInString && *pszString == ',' )
+            {
+                pszString++;
+                break;
+            }
+            
+            if( *pszString == '"' )
+            {
+                if( !bInString || pszString[1] != '"' )
+                {
+                    bInString = !bInString;
+                    continue;
+                }
+                else  /* doubled quotes in string resolve to one quote */
+                {
+                    pszString++;
+                }
+            }
+
+            if( nTokenLen >= nTokenMax-2 )
+            {
+                nTokenMax = nTokenMax * 2 + 10;
+                pszToken = (char *) CPLRealloc( pszToken, nTokenMax );
+            }
+
+            pszToken[nTokenLen] = *pszString;
+            nTokenLen++;
+        }
+
+        pszToken[nTokenLen] = '\0';
+        papszRetList = CSLAddString( papszRetList, pszToken );
+
+        /* If the last token is an empty token, then we have to catch
+         * it now, otherwise we won't reenter the loop and it will be lost. 
+         */
+        if ( *pszString == '\0' && *(pszString-1) == ',' )
+        {
+            papszRetList = CSLAddString( papszRetList, "" );
+        }
+    }
+
+    if( papszRetList == NULL )
+        papszRetList = (char **) CPLCalloc(sizeof(char *),1);
+
+    CPLFree( pszToken );
+
+    return papszRetList;
+}
+
+/************************************************************************/
+/*                          CSVFindNextLine()                           */
+/*                                                                      */
+/*      Find the start of the next line, while at the same time zero    */
+/*      terminating this line.  Take into account that there may be     */
+/*      newline indicators within quoted strings, and that quotes       */
+/*      can be escaped with a backslash.                                */
+/************************************************************************/
+
+static char *CSVFindNextLine( char *pszThisLine )
+
+{
+    int  nQuoteCount = 0, i;
+
+    for( i = 0; pszThisLine[i] != '\0'; i++ )
+    {
+        if( pszThisLine[i] == '\"'
+            && (i == 0 || pszThisLine[i-1] != '\\') )
+            nQuoteCount++;
+
+        if( (pszThisLine[i] == 10 || pszThisLine[i] == 13)
+            && (nQuoteCount % 2) == 0 )
+            break;
+    }
+
+    while( pszThisLine[i] == 10 || pszThisLine[i] == 13 )
+        pszThisLine[i++] = '\0';
+
+    if( pszThisLine[i] == '\0' )
+        return NULL;
+    else
+        return pszThisLine + i;
+}
+
+/************************************************************************/
+/*                             CSVIngest()                              */
+/*                                                                      */
+/*      Load entire file into memory and setup index if possible.       */
+/************************************************************************/
+
+static void CSVIngest( const char *pszFilename )
+
+{
+    CSVTable *psTable = gtCSVAccess( pszFilename );
+    int       nFileLen, i, nMaxLineCount, iLine = 0;
+    char *pszThisLine;
+
+    if( psTable->pszRawData != NULL )
+        return;
+
+/* -------------------------------------------------------------------- */
+/*      Ingest whole file.                                              */
+/* -------------------------------------------------------------------- */
+    VSIFSeek( psTable->fp, 0, SEEK_END );
+    nFileLen = VSIFTell( psTable->fp );
+    VSIRewind( psTable->fp );
+
+    psTable->pszRawData = (char *) CPLMalloc(nFileLen+1);
+    if( (int) VSIFRead( psTable->pszRawData, 1, nFileLen, psTable->fp ) 
+        != nFileLen )
+    {
+        CPLFree( psTable->pszRawData );
+        psTable->pszRawData = NULL;
+
+        CPLError( CE_Failure, CPLE_FileIO, "Read of file %s failed.", 
+                  psTable->pszFilename );
+        return;
+    }
+
+    psTable->pszRawData[nFileLen] = '\0';
+
+/* -------------------------------------------------------------------- */
+/*      Get count of newlines so we can allocate line array.            */
+/* -------------------------------------------------------------------- */
+    nMaxLineCount = 0;
+    for( i = 0; i < nFileLen; i++ )
+    {
+        if( psTable->pszRawData[i] == 10 )
+            nMaxLineCount++;
+    }
+
+    psTable->papszLines = (char **) CPLCalloc(sizeof(char*),nMaxLineCount);
+    
+/* -------------------------------------------------------------------- */
+/*      Build a list of record pointers into the raw data buffer        */
+/*      based on line terminators.  Zero terminate the line             */
+/*      strings.                                                        */
+/* -------------------------------------------------------------------- */
+    /* skip header line */
+    pszThisLine = CSVFindNextLine( psTable->pszRawData );
+
+    while( pszThisLine != NULL && iLine < nMaxLineCount )
+    {
+        psTable->papszLines[iLine++] = pszThisLine;
+        pszThisLine = CSVFindNextLine( pszThisLine );
+    }
+
+    psTable->nLineCount = iLine;
+
+/* -------------------------------------------------------------------- */
+/*      Allocate and populate index array.  Ensure they are in          */
+/*      ascending order so that binary searches can be done on the      */
+/*      array.                                                          */
+/* -------------------------------------------------------------------- */
+    psTable->panLineIndex = (int *) CPLMalloc(sizeof(int)*psTable->nLineCount);
+    for( i = 0; i < psTable->nLineCount; i++ )
+    {
+        psTable->panLineIndex[i] = atoi(psTable->papszLines[i]);
+
+        if( i > 0 && psTable->panLineIndex[i] < psTable->panLineIndex[i-1] )
+        {
+            CPLFree( psTable->panLineIndex );
+            psTable->panLineIndex = NULL;
+            break;
+        }
+    }
+
+    psTable->iLastLine = -1;
+
+/* -------------------------------------------------------------------- */
+/*      We should never need the file handle against, so close it.      */
+/* -------------------------------------------------------------------- */
+    VSIFClose( psTable->fp );
+    psTable->fp = NULL;
+}
+
+/************************************************************************/
+/*                          CSVReadParseLine()                          */
+/*                                                                      */
+/*      Read one line, and return split into fields.  The return        */
+/*      result is a stringlist, in the sense of the CSL functions.      */
+/************************************************************************/
+
+char **CSVReadParseLine( FILE * fp )
+
+{
+    const char  *pszLine;
+    char        *pszWorkLine;
+    char        **papszReturn;
+
+    CPLAssert( fp != NULL );
+    if( fp == NULL )
+        return( NULL );
+    
+    pszLine = CPLReadLine( fp );
+    if( pszLine == NULL )
+        return( NULL );
+
+/* -------------------------------------------------------------------- */
+/*      If there are no quotes, then this is the simple case.           */
+/*      Parse, and return tokens.                                       */
+/* -------------------------------------------------------------------- */
+    if( strchr(pszLine,'\"') == NULL )
+        return CSVSplitLine( pszLine );
+
+/* -------------------------------------------------------------------- */
+/*      We must now count the quotes in our working string, and as      */
+/*      long as it is odd, keep adding new lines.                       */
+/* -------------------------------------------------------------------- */
+    pszWorkLine = CPLStrdup( pszLine );
+
+    while( TRUE )
+    {
+        int             i, nCount = 0;
+
+        for( i = 0; pszWorkLine[i] != '\0'; i++ )
+        {
+            if( pszWorkLine[i] == '\"'
+                && (i == 0 || pszWorkLine[i-1] != '\\') )
+                nCount++;
+        }
+
+        if( nCount % 2 == 0 )
+            break;
+
+        pszLine = CPLReadLine( fp );
+        if( pszLine == NULL )
+            break;
+
+        pszWorkLine = (char *)
+            CPLRealloc(pszWorkLine,
+                       strlen(pszWorkLine) + strlen(pszLine) + 1);
+        strcat( pszWorkLine, pszLine );
+    }
+    
+    papszReturn = CSVSplitLine( pszWorkLine );
+
+    CPLFree( pszWorkLine );
+
+    return papszReturn;
+}
+
+/************************************************************************/
+/*                             CSVCompare()                             */
+/*                                                                      */
+/*      Compare a field to a search value using a particular            */
+/*      criteria.                                                       */
+/************************************************************************/
+
+static int CSVCompare( const char * pszFieldValue, const char * pszTarget,
+                       CSVCompareCriteria eCriteria )
+
+{
+    if( eCriteria == CC_ExactString )
+    {
+        return( strcmp( pszFieldValue, pszTarget ) == 0 );
+    }
+    else if( eCriteria == CC_ApproxString )
+    {
+        return( EQUAL( pszFieldValue, pszTarget ) );
+    }
+    else if( eCriteria == CC_Integer )
+    {
+        return( atoi(pszFieldValue) == atoi(pszTarget) );
+    }
+
+    return FALSE;
+}
+
+/************************************************************************/
+/*                            CSVScanLines()                            */
+/*                                                                      */
+/*      Read the file scanline for lines where the key field equals     */
+/*      the indicated value with the suggested comparison criteria.     */
+/*      Return the first matching line split into fields.               */
+/************************************************************************/
+
+char **CSVScanLines( FILE *fp, int iKeyField, const char * pszValue,
+                     CSVCompareCriteria eCriteria )
+
+{
+    char        **papszFields = NULL;
+    int         bSelected = FALSE, nTestValue;
+
+    CPLAssert( pszValue != NULL );
+    CPLAssert( iKeyField >= 0 );
+    CPLAssert( fp != NULL );
+    
+    nTestValue = atoi(pszValue);
+    
+    while( !bSelected ) {
+        papszFields = CSVReadParseLine( fp );
+        if( papszFields == NULL )
+            return( NULL );
+
+        if( CSLCount( papszFields ) < iKeyField+1 )
+        {
+            /* not selected */
+        }
+        else if( eCriteria == CC_Integer
+                 && atoi(papszFields[iKeyField]) == nTestValue )
+        {
+            bSelected = TRUE;
+        }
+        else
+        {
+            bSelected = CSVCompare( papszFields[iKeyField], pszValue,
+                                    eCriteria );
+        }
+
+        if( !bSelected )
+        {
+            CSLDestroy( papszFields );
+            papszFields = NULL;
+        }
+    }
+    
+    return( papszFields );
+}
+
+/************************************************************************/
+/*                        CSVScanLinesIndexed()                         */
+/*                                                                      */
+/*      Read the file scanline for lines where the key field equals     */
+/*      the indicated value with the suggested comparison criteria.     */
+/*      Return the first matching line split into fields.               */
+/************************************************************************/
+
+static char **
+CSVScanLinesIndexed( CSVTable *psTable, int nKeyValue )
+
+{
+    int         iTop, iBottom, iMiddle, iResult = -1;
+
+    CPLAssert( psTable->panLineIndex != NULL );
+
+/* -------------------------------------------------------------------- */
+/*      Find target record with binary search.                          */
+/* -------------------------------------------------------------------- */
+    iTop = psTable->nLineCount-1;
+    iBottom = 0;
+
+    while( iTop >= iBottom )
+    {
+        iMiddle = (iTop + iBottom) / 2;
+        if( psTable->panLineIndex[iMiddle] > nKeyValue )
+            iTop = iMiddle - 1;
+        else if( psTable->panLineIndex[iMiddle] < nKeyValue )
+            iBottom = iMiddle + 1;
+        else
+        {
+            iResult = iMiddle;
+            break;
+        }
+    }
+
+    if( iResult == -1 )
+        return NULL;
+
+/* -------------------------------------------------------------------- */
+/*      Parse target line, and update iLastLine indicator.              */
+/* -------------------------------------------------------------------- */
+    psTable->iLastLine = iResult;
+    
+    return CSVSplitLine( psTable->papszLines[iResult] );
+}
+
+/************************************************************************/
+/*                        CSVScanLinesIngested()                        */
+/*                                                                      */
+/*      Read the file scanline for lines where the key field equals     */
+/*      the indicated value with the suggested comparison criteria.     */
+/*      Return the first matching line split into fields.               */
+/************************************************************************/
+
+static char **
+CSVScanLinesIngested( CSVTable *psTable, int iKeyField, const char * pszValue,
+                      CSVCompareCriteria eCriteria )
+
+{
+    char        **papszFields = NULL;
+    int         bSelected = FALSE, nTestValue;
+
+    CPLAssert( pszValue != NULL );
+    CPLAssert( iKeyField >= 0 );
+
+    nTestValue = atoi(pszValue);
+    
+/* -------------------------------------------------------------------- */
+/*      Short cut for indexed files.                                    */
+/* -------------------------------------------------------------------- */
+    if( iKeyField == 0 && eCriteria == CC_Integer 
+        && psTable->panLineIndex != NULL )
+        return CSVScanLinesIndexed( psTable, nTestValue );
+    
+/* -------------------------------------------------------------------- */
+/*      Scan from in-core lines.                                        */
+/* -------------------------------------------------------------------- */
+    while( !bSelected && psTable->iLastLine+1 < psTable->nLineCount ) {
+        psTable->iLastLine++;
+        papszFields = CSVSplitLine( psTable->papszLines[psTable->iLastLine] );
+
+        if( CSLCount( papszFields ) < iKeyField+1 )
+        {
+            /* not selected */
+        }
+        else if( eCriteria == CC_Integer
+                 && atoi(papszFields[iKeyField]) == nTestValue )
+        {
+            bSelected = TRUE;
+        }
+        else
+        {
+            bSelected = CSVCompare( papszFields[iKeyField], pszValue,
+                                    eCriteria );
+        }
+
+        if( !bSelected )
+        {
+            CSLDestroy( papszFields );
+            papszFields = NULL;
+        }
+    }
+    
+    return( papszFields );
+}
+
+/************************************************************************/
+/*                            CSVScanFile()                             */
+/*                                                                      */
+/*      Scan a whole file using criteria similar to above, but also     */
+/*      taking care of file opening and closing.                        */
+/************************************************************************/
+
+char **CSVScanFile( const char * pszFilename, int iKeyField,
+                    const char * pszValue, CSVCompareCriteria eCriteria )
+
+{
+    CSVTable    *psTable;
+
+/* -------------------------------------------------------------------- */
+/*      Get access to the table.                                        */
+/* -------------------------------------------------------------------- */
+    CPLAssert( pszFilename != NULL );
+
+    if( iKeyField < 0 )
+        return NULL;
+
+    psTable = gtCSVAccess( pszFilename );
+    if( psTable == NULL )
+        return NULL;
+    
+    CSVIngest( pszFilename );
+
+/* -------------------------------------------------------------------- */
+/*      Does the current record match the criteria?  If so, just        */
+/*      return it again.                                                */
+/* -------------------------------------------------------------------- */
+    if( iKeyField >= 0
+        && iKeyField < CSLCount(psTable->papszRecFields)
+        && CSVCompare(pszValue,psTable->papszRecFields[iKeyField],eCriteria) )
+    {
+        return psTable->papszRecFields;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Scan the file from the beginning, replacing the ``current       */
+/*      record'' in our structure with the one that is found.           */
+/* -------------------------------------------------------------------- */
+    psTable->iLastLine = -1;
+    CSLDestroy( psTable->papszRecFields );
+
+    if( psTable->pszRawData != NULL )
+        psTable->papszRecFields = 
+            CSVScanLinesIngested( psTable, iKeyField, pszValue, eCriteria );
+    else
+    {
+        VSIRewind( psTable->fp );
+        CPLReadLine( psTable->fp );         /* throw away the header line */
+    
+        psTable->papszRecFields =
+            CSVScanLines( psTable->fp, iKeyField, pszValue, eCriteria );
+    }
+
+    return( psTable->papszRecFields );
+}
+
+/************************************************************************/
+/*                           CPLGetFieldId()                            */
+/*                                                                      */
+/*      Read the first record of a CSV file (rewinding to be sure),     */
+/*      and find the field with the indicated name.  Returns -1 if      */
+/*      it fails to find the field name.  Comparison is case            */
+/*      insensitive, but otherwise exact.  After this function has      */
+/*      been called the file pointer will be positioned just after      */
+/*      the first record.                                               */
+/************************************************************************/
+
+int CSVGetFieldId( FILE * fp, const char * pszFieldName )
+
+{
+    char        **papszFields;
+    int         i;
+    
+    CPLAssert( fp != NULL && pszFieldName != NULL );
+
+    VSIRewind( fp );
+
+    papszFields = CSVReadParseLine( fp );
+    for( i = 0; papszFields != NULL && papszFields[i] != NULL; i++ )
+    {
+        if( EQUAL(papszFields[i],pszFieldName) )
+        {
+            CSLDestroy( papszFields );
+            return i;
+        }
+    }
+
+    CSLDestroy( papszFields );
+
+    return -1;
+}
+
+/************************************************************************/
+/*                         CSVGetFileFieldId()                          */
+/*                                                                      */
+/*      Same as CPLGetFieldId(), except that we get the file based      */
+/*      on filename, rather than having an existing handle.             */
+/************************************************************************/
+
+int CSVGetFileFieldId( const char * pszFilename, const char * pszFieldName )
+
+{
+    CSVTable    *psTable;
+    int         i;
+    
+/* -------------------------------------------------------------------- */
+/*      Get access to the table.                                        */
+/* -------------------------------------------------------------------- */
+    CPLAssert( pszFilename != NULL );
+
+    psTable = gtCSVAccess( pszFilename );
+    if( psTable == NULL )
+        return -1;
+
+/* -------------------------------------------------------------------- */
+/*      Find the requested field.                                       */
+/* -------------------------------------------------------------------- */
+    for( i = 0;
+         psTable->papszFieldNames != NULL
+             && psTable->papszFieldNames[i] != NULL;
+         i++ )
+    {
+        if( EQUAL(psTable->papszFieldNames[i],pszFieldName) )
+        {
+            return i;
+        }
+    }
+
+    return -1;
+}
+
+
+/************************************************************************/
+/*                         CSVScanFileByName()                          */
+/*                                                                      */
+/*      Same as CSVScanFile(), but using a field name instead of a      */
+/*      field number.                                                   */
+/************************************************************************/
+
+char **CSVScanFileByName( const char * pszFilename,
+                          const char * pszKeyFieldName,
+                          const char * pszValue, CSVCompareCriteria eCriteria )
+
+{
+    int         iKeyField;
+
+    iKeyField = CSVGetFileFieldId( pszFilename, pszKeyFieldName );
+    if( iKeyField == -1 )
+        return NULL;
+
+    return( CSVScanFile( pszFilename, iKeyField, pszValue, eCriteria ) );
+}
+
+/************************************************************************/
+/*                            CSVGetField()                             */
+/*                                                                      */
+/*      The all-in-one function to fetch a particular field value       */
+/*      from a CSV file.  Note this function will return an empty       */
+/*      string, rather than NULL if it fails to find the desired        */
+/*      value for some reason.  The caller can't establish that the     */
+/*      fetch failed.                                                   */
+/************************************************************************/
+
+const char *CSVGetField( const char * pszFilename,
+                         const char * pszKeyFieldName,
+                         const char * pszKeyFieldValue,
+                         CSVCompareCriteria eCriteria,
+                         const char * pszTargetField )
+
+{
+    CSVTable    *psTable;
+    char        **papszRecord;
+    int         iTargetField;
+    
+/* -------------------------------------------------------------------- */
+/*      Find the table.                                                 */
+/* -------------------------------------------------------------------- */
+    psTable = gtCSVAccess( pszFilename );
+    if( psTable == NULL )
+        return "";
+
+/* -------------------------------------------------------------------- */
+/*      Find the correct record.                                        */
+/* -------------------------------------------------------------------- */
+    papszRecord = CSVScanFileByName( pszFilename, pszKeyFieldName,
+                                     pszKeyFieldValue, eCriteria );
+
+    if( papszRecord == NULL )
+        return "";
+
+/* -------------------------------------------------------------------- */
+/*      Figure out which field we want out of this.                     */
+/* -------------------------------------------------------------------- */
+    iTargetField = CSVGetFileFieldId( pszFilename, pszTargetField );
+    if( iTargetField < 0 )
+        return "";
+
+    if( iTargetField >= CSLCount( papszRecord ) )
+        return "";
+
+    return( papszRecord[iTargetField] );
+}
+
+/************************************************************************/
+/*                            CSVFilename()                             */
+/*                                                                      */
+/*      Return the full path to a particular CSV file.  This will       */
+/*      eventually be something the application can override.           */
+/************************************************************************/
+
+static const char *(*pfnCSVFilenameHook)(const char *) = NULL;
+
+const char * CSVFilename( const char *pszBasename )
+
+{
+    static char		szPath[512];
+
+    if( pfnCSVFilenameHook == NULL )
+    {
+        FILE	*fp = NULL;
+
+        if( getenv("GEOTIFF_CSV") != NULL )
+        {
+            sprintf( szPath, "%s/%s", getenv("GEOTIFF_CSV"), pszBasename );
+        }
+#ifdef CSV_DATA_DIR
+        else 
+        {
+            sprintf( szPath, "%s/%s", CSV_DATA_DIR, pszBasename );
+        }
+#else
+        else if( (fp = fopen( "/usr/local/share/epsg/csv/pcs.csv", "rt" )) != NULL )
+        {
+            sprintf( szPath, "/usr/local/share/epsg/csv/%s", pszBasename );
+        }
+        else if( (fp = fopen( "csv/pcs.csv", "rt" )) != NULL )
+        {
+            sprintf( szPath, "csv/%s", pszBasename );
+        }
+        else if( (fp = fopen( "share/epsg_csv/pcs.csv", "rt" )) != NULL )
+        {
+            sprintf( szPath, "share/epsg_csv/%s", pszBasename );
+        }
+        else if( (fp = fopen( "/usr/share/epsg_csv/pcs.csv", "rt" )) != NULL )
+        {
+            sprintf( szPath, "/usr/share/epsg_csv/%s", pszBasename );
+        }
+        else
+        {
+            sprintf( szPath, "/usr/local/share/epsg_csv/%s", pszBasename );
+        }
+#endif
+
+        if( fp != NULL )
+            fclose( fp );
+        
+        return( szPath );
+    }
+    else
+        return( pfnCSVFilenameHook( pszBasename ) );
+}
+
+/************************************************************************/
+/*                         SetCSVFilenameHook()                         */
+/*                                                                      */
+/*      Applications can use this to set a function that will           */
+/*      massage CSV filenames.                                          */
+/************************************************************************/
+
+/**
+ * Override CSV file search method.
+ *
+ * @param CSVFileOverride The pointer to a function which will return the
+ * full path for a given filename.
+  *
+
+This function allows an application to override how the GTIFGetDefn() and related function find the CSV (Comma Separated
+Value) values required. The pfnHook argument should be a pointer to a function that will take in a CSV filename and return a
+full path to the file. The returned string should be to an internal static buffer so that the caller doesn't have to free the result.
+
+<b>Example:</b><br>
+
+The listgeo utility uses the following override function if the user
+specified a CSV file directory with the -t commandline switch (argument
+put into CSVDirName).  <p>
+
+<pre>
+
+    ...
+
+
+    SetCSVFilenameHook( CSVFileOverride );
+
+    ...
+
+
+static const char *CSVFileOverride( const char * pszInput )
+
+{
+    static char         szPath[1024];
+
+#ifdef WIN32
+    sprintf( szPath, "%s\\%s", CSVDirName, pszInput );
+#else    
+    sprintf( szPath, "%s/%s", CSVDirName, pszInput );
+#endif    
+
+    return( szPath );
+}
+</pre>
+
+*/
+
+void SetCSVFilenameHook( const char *(*pfnNewHook)( const char * ) )
+
+{
+    pfnCSVFilenameHook = pfnNewHook;
+}
diff --git a/src/tiff/cpl_csv.h b/src/tiff/cpl_csv.h
new file mode 100644
index 0000000..94e927d
--- /dev/null
+++ b/src/tiff/cpl_csv.h
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * $Id: cpl_csv.h 13 2002-07-30 20:02:48Z juan $
+ *
+ * Project:  Common Portability Library
+ * Purpose:  Functions for reading and scaning CSV (comma separated,
+ *           variable length text files holding tables) files.  
+ * Author:   Frank Warmerdam, warmerda at home.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log$
+ * Revision 1.1  2002/02/04 18:49:02  juan
+ * Arquivo adicionado
+ *
+ * Revision 1.1  1999/10/06 19:26:24  juan
+ * Add files for geotiff
+ *
+ * Revision 1.2  1999/03/17 20:42:40  geotiff
+ * Dont export the CSV functions from the DLL
+ *
+ * Revision 1.1  1999/03/09 15:57:04  geotiff
+ * New
+ *
+ * Revision 1.2  1999/02/24 16:22:58  warmerda
+ * cpl_csv.c
+ *
+ */
+
+#ifndef CPL_CSV_H_INCLUDED
+#define CPL_CSV_H_INCLUDED
+
+#include "cpl_serv.h"
+
+CPL_C_START
+
+typedef enum {
+    CC_ExactString,
+    CC_ApproxString,
+    CC_Integer
+} CSVCompareCriteria;
+
+const char  *CSVFilename( const char * );
+
+char  **CSVReadParseLine( FILE * );
+char  **CSVScanLines( FILE *, int, const char *, CSVCompareCriteria );
+char  **CSVScanFile( const char *, int, const char *,
+                            CSVCompareCriteria );
+char  **CSVScanFileByName( const char *, const char *, const char *,
+                                  CSVCompareCriteria );
+int  CSVGetFieldId( FILE *, const char * );
+int  CSVGetFileFieldId( const char *, const char * );
+
+void  CSVDeaccess( const char * );
+
+const char  *CSVGetField( const char *, const char *, const char *,
+                                 CSVCompareCriteria, const char * );
+
+void CPL_DLL SetCSVFilenameHook( const char *(*)(const char *) );
+
+CPL_C_END
+
+#endif /* ndef CPL_CSV_H_INCLUDED */
+
diff --git a/src/tiff/cpl_serv.c b/src/tiff/cpl_serv.c
new file mode 100644
index 0000000..3e6b1e9
--- /dev/null
+++ b/src/tiff/cpl_serv.c
@@ -0,0 +1,596 @@
+/******************************************************************************
+ * Copyright (c) 1998, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * cpl_serv.c: Various Common Portability Library derived convenience functions
+ *
+ * $Log$
+ * Revision 1.8  2001/07/09 20:14:37  warmerda
+ * Another problem freeing pszRLBuffer and not setting to NULL.
+ *
+ * Revision 1.7  2001/04/17 13:40:43  warmerda
+ * fixed freeing of line buffer in CPLReadLine(), init ptr to NULL
+ *
+ * Revision 1.6  2001/03/05 04:56:17  warmerda
+ * make it possible to deallocate CPLReadLine buffer
+ *
+ * Revision 1.5  2000/09/30 03:35:05  warmerda
+ * Fixed CPLReadLine() to use avoid calling VSIRealloc() on a NULL pointer.
+ *
+ * Revision 1.4  1999/06/25 04:35:26  warmerda
+ * Fixed to actually support long lines.
+ *
+ * Revision 1.3  1999/03/17 20:43:03  geotiff
+ * Avoid use of size_t keyword
+ *
+ * Revision 1.2  1999/03/10 18:22:39  geotiff
+ * Added string.h, fixed backslash escaping
+ *
+ * Revision 1.1  1999/03/09 15:57:04  geotiff
+ * New
+ *
+ */
+
+#include "cpl_serv.h"
+#include "geo_tiffp.h"
+
+#ifdef HAVE_STRING_H
+#  include <string.h>
+#endif
+#if defined(HAVE_STRINGS_H) && !defined(HAVE_STRING_H)
+#  include <strings.h>
+#endif
+
+/************************************************************************/
+/*                             CPLCalloc()                              */
+/************************************************************************/
+
+void *CPLCalloc( int nCount, int nSize )
+
+{
+    void	*pReturn;
+
+    if( nSize == 0 )
+        return NULL;
+    
+    pReturn = VSICalloc( nCount, nSize );
+    if( pReturn == NULL )
+    {
+        CPLError( CE_Fatal, CPLE_OutOfMemory,
+                  "CPLCalloc(): Out of memory allocating %d bytes.\n",
+                  nSize * nCount );
+    }
+
+    return pReturn;
+}
+
+/************************************************************************/
+/*                             CPLMalloc()                              */
+/************************************************************************/
+
+void *CPLMalloc( int nSize )
+
+{
+    void	*pReturn;
+
+    if( nSize == 0 )
+        return NULL;
+    
+    pReturn = VSIMalloc( nSize );
+    if( pReturn == NULL )
+    {
+        CPLError( CE_Fatal, CPLE_OutOfMemory,
+                  "CPLMalloc(): Out of memory allocating %d bytes.\n",
+                  nSize );
+    }
+
+    return pReturn;
+}
+
+/************************************************************************/
+/*                             CPLRealloc()                             */
+/************************************************************************/
+
+void * CPLRealloc( void * pData, int nNewSize )
+
+{
+    void	*pReturn;
+
+    if( pData == NULL )
+        pReturn = VSIMalloc( nNewSize );
+    else
+        pReturn = VSIRealloc( pData, nNewSize );
+    
+    if( pReturn == NULL )
+    {
+        CPLError( CE_Fatal, CPLE_OutOfMemory,
+                  "CPLRealloc(): Out of memory allocating %d bytes.\n",
+                  nNewSize );
+    }
+
+    return pReturn;
+}
+
+/************************************************************************/
+/*                             CPLStrdup()                              */
+/************************************************************************/
+
+char *CPLStrdup( const char * pszString )
+
+{
+    char	*pszReturn;
+
+    if( pszString == NULL )
+        pszString = "";
+
+    pszReturn = VSIMalloc( strlen(pszString)+1 );
+        
+    if( pszReturn == NULL )
+    {
+        CPLError( CE_Fatal, CPLE_OutOfMemory,
+                  "CPLStrdup(): Out of memory allocating %d bytes.\n",
+                  strlen(pszString) );
+        
+    }
+
+    strcpy( pszReturn, pszString );
+    
+    return( pszReturn );
+}
+
+/************************************************************************/
+/*                            CPLReadLine()                             */
+/*                                                                      */
+/*      Read a line of text from the given file handle, taking care     */
+/*      to capture CR and/or LF and strip off ... equivelent of         */
+/*      DKReadLine().  Pointer to an internal buffer is returned.       */
+/*      The application shouldn't free it, or depend on it's value      */
+/*      past the next call to CPLReadLine()                             */
+/************************************************************************/
+
+const char *CPLReadLine( FILE * fp )
+
+{
+    static char	*pszRLBuffer = NULL;
+    static int	nRLBufferSize = 0;
+    int		nLength, nReadSoFar = 0;
+
+/* -------------------------------------------------------------------- */
+/*      Cleanup case.                                                   */
+/* -------------------------------------------------------------------- */
+    if( fp == NULL )
+    {
+        CPLFree( pszRLBuffer );
+        pszRLBuffer = NULL;
+        nRLBufferSize = 0;
+        return NULL;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Loop reading chunks of the line till we get to the end of       */
+/*      the line.                                                       */
+/* -------------------------------------------------------------------- */
+    do {
+/* -------------------------------------------------------------------- */
+/*      Grow the working buffer if we have it nearly full.  Fail out    */
+/*      of read line if we can't reallocate it big enough (for          */
+/*      instance for a _very large_ file with no newlines).             */
+/* -------------------------------------------------------------------- */
+        if( nRLBufferSize-nReadSoFar < 128 )
+        {
+            nRLBufferSize = nRLBufferSize*2 + 128;
+            if( pszRLBuffer == NULL )
+                pszRLBuffer = (char *) VSIMalloc(nRLBufferSize);
+            else
+                pszRLBuffer = (char *) VSIRealloc(pszRLBuffer, nRLBufferSize);
+            if( pszRLBuffer == NULL )
+            {
+                nRLBufferSize = 0;
+                return NULL;
+            }
+        }
+
+/* -------------------------------------------------------------------- */
+/*      Do the actual read.                                             */
+/* -------------------------------------------------------------------- */
+        if( VSIFGets( pszRLBuffer+nReadSoFar, nRLBufferSize-nReadSoFar, fp )
+            == NULL )
+        {
+            CPLFree( pszRLBuffer );
+            pszRLBuffer = NULL;
+            nRLBufferSize = 0;
+
+            return NULL;
+        }
+
+        nReadSoFar = strlen(pszRLBuffer);
+
+    } while( nReadSoFar == nRLBufferSize - 1
+             && pszRLBuffer[nRLBufferSize-2] != 13
+             && pszRLBuffer[nRLBufferSize-2] != 10 );
+
+/* -------------------------------------------------------------------- */
+/*      Clear CR and LF off the end.                                    */
+/* -------------------------------------------------------------------- */
+    nLength = strlen(pszRLBuffer);
+    if( nLength > 0
+        && (pszRLBuffer[nLength-1] == 10 || pszRLBuffer[nLength-1] == 13) )
+    {
+        pszRLBuffer[--nLength] = '\0';
+    }
+    
+    if( nLength > 0
+        && (pszRLBuffer[nLength-1] == 10 || pszRLBuffer[nLength-1] == 13) )
+    {
+        pszRLBuffer[--nLength] = '\0';
+    }
+
+    return( pszRLBuffer );
+}
+
+
+/*=====================================================================
+                    StringList manipulation functions.
+ =====================================================================*/
+
+/**********************************************************************
+ *                       CSLAddString()
+ *
+ * Append a string to a StringList and return a pointer to the modified
+ * StringList.
+ * If the input StringList is NULL, then a new StringList is created.
+ **********************************************************************/
+char **CSLAddString(char **papszStrList, const char *pszNewString)
+{
+    int nItems=0;
+
+    if (pszNewString == NULL)
+        return papszStrList;    /* Nothing to do!*/
+
+    /* Allocate room for the new string */
+    if (papszStrList == NULL)
+        papszStrList = (char**) CPLCalloc(2,sizeof(char*));
+    else
+    {
+        nItems = CSLCount(papszStrList);
+        papszStrList = (char**)CPLRealloc(papszStrList, 
+                                          (nItems+2)*sizeof(char*));
+    }
+
+    /* Copy the string in the list */
+    papszStrList[nItems] = CPLStrdup(pszNewString);
+    papszStrList[nItems+1] = NULL;
+
+    return papszStrList;
+}
+
+/**********************************************************************
+ *                       CSLCount()
+ *
+ * Return the number of lines in a Stringlist.
+ **********************************************************************/
+int CSLCount(char **papszStrList)
+{
+    int nItems=0;
+
+    if (papszStrList)
+    {
+        while(*papszStrList != NULL)
+        {
+            nItems++;
+            papszStrList++;
+        }
+    }
+
+    return nItems;
+}
+
+
+/************************************************************************/
+/*                            CSLGetField()                             */
+/*                                                                      */
+/*      Fetches the indicated field, being careful not to crash if      */
+/*      the field doesn't exist within this string list.  The           */
+/*      returned pointer should not be freed, and doesn't               */
+/*      necessarily last long.                                          */
+/************************************************************************/
+
+const char * CSLGetField( char ** papszStrList, int iField )
+
+{
+    int         i;
+
+    if( papszStrList == NULL || iField < 0 )
+        return( "" );
+
+    for( i = 0; i < iField+1; i++ )
+    {
+        if( papszStrList[i] == NULL )
+            return "";
+    }
+
+    return( papszStrList[iField] );
+}
+
+/**********************************************************************
+ *                       CSLDestroy()
+ *
+ * Free all memory used by a StringList.
+ **********************************************************************/
+void CSLDestroy(char **papszStrList)
+{
+    char **papszPtr;
+
+    if (papszStrList)
+    {
+        papszPtr = papszStrList;
+        while(*papszPtr != NULL)
+        {
+            CPLFree(*papszPtr);
+            papszPtr++;
+        }
+
+        CPLFree(papszStrList);
+    }
+}
+
+
+/**********************************************************************
+ *                       CSLDuplicate()
+ *
+ * Allocate and return a copy of a StringList.
+ **********************************************************************/
+char    **CSLDuplicate(char **papszStrList)
+{
+    char **papszNewList, **papszSrc, **papszDst;
+    int  nLines;
+
+    nLines = CSLCount(papszStrList);
+
+    if (nLines == 0)
+        return NULL;
+
+    papszNewList = (char **)CPLMalloc((nLines+1)*sizeof(char*));
+    papszSrc = papszStrList;
+    papszDst = papszNewList;
+
+    while(*papszSrc != NULL)
+    {
+        *papszDst = CPLStrdup(*papszSrc);
+
+        papszSrc++;
+        papszDst++;
+    }
+    *papszDst = NULL;
+
+    return papszNewList;
+}
+
+/**********************************************************************
+ *                       CSLTokenizeString()
+ *
+ * Tokenizes a string and returns a StringList with one string for
+ * each token.
+ **********************************************************************/
+char    **CSLTokenizeString( const char *pszString )
+{
+    return CSLTokenizeStringComplex( pszString, " ", TRUE, FALSE );
+}
+
+/************************************************************************/
+/*                      CSLTokenizeStringComplex()                      */
+/*                                                                      */
+/*      The ultimate tokenizer?                                         */
+/************************************************************************/
+
+char ** CSLTokenizeStringComplex( const char * pszString,
+                                  const char * pszDelimiters,
+                                  int bHonourStrings, int bAllowEmptyTokens )
+
+{
+    char	**papszRetList = NULL;
+    char 	*pszToken;
+    int		nTokenMax, nTokenLen;
+
+    pszToken = (char *) CPLCalloc(10,1);
+    nTokenMax = 10;
+    
+    while( pszString != NULL && *pszString != '\0' )
+    {
+        int	bInString = FALSE;
+
+        nTokenLen = 0;
+        
+        /* Try to find the next delimeter, marking end of token */
+        for( ; *pszString != '\0'; pszString++ )
+        {
+
+            /* End if this is a delimeter skip it and break. */
+            if( !bInString && strchr(pszDelimiters, *pszString) != NULL )
+            {
+                pszString++;
+                break;
+            }
+            
+            /* If this is a quote, and we are honouring constant
+               strings, then process the constant strings, with out delim
+               but don't copy over the quotes */
+            if( bHonourStrings && *pszString == '"' )
+            {
+                if( bInString )
+                {
+                    bInString = FALSE;
+                    continue;
+                }
+                else
+                {
+                    bInString = TRUE;
+                    continue;
+                }
+            }
+
+            /* Within string constants we allow for escaped quotes, but
+               in processing them we will unescape the quotes */
+            if( bInString && pszString[0] == '\\' && pszString[1] == '"' )
+            {
+                pszString++;
+            }
+
+            /* Within string constants a \\ sequence reduces to \ */
+            else if( bInString
+                     && pszString[0] == '\\' && pszString[1] == '\\' )
+            {
+                pszString++;
+            }
+
+            if( nTokenLen >= nTokenMax-1 )
+            {
+                nTokenMax = nTokenMax * 2 + 10;
+                pszToken = (char *) CPLRealloc( pszToken, nTokenMax );
+            }
+
+            pszToken[nTokenLen] = *pszString;
+            nTokenLen++;
+        }
+
+        pszToken[nTokenLen] = '\0';
+
+        if( pszToken[0] != '\0' || bAllowEmptyTokens )
+        {
+            papszRetList = CSLAddString( papszRetList, pszToken );
+        }
+    }
+
+    if( papszRetList == NULL )
+        papszRetList = (char **) CPLCalloc(sizeof(char *),1);
+
+    CPLFree( pszToken );
+
+    return papszRetList;
+}
+
+/* static buffer to store the last error message.  We'll assume that error
+ * messages cannot be longer than 2000 chars... which is quite reasonable
+ * (that's 25 lines of 80 chars!!!)
+ */
+static char gszCPLLastErrMsg[2000] = "";
+static int  gnCPLLastErrNo = 0;
+
+static void (*gpfnCPLErrorHandler)(CPLErr, int, const char *) = NULL;
+
+/**********************************************************************
+ *                          CPLError()
+ *
+ * This function records an error code and displays the error message
+ * to stderr.
+ *
+ * The error code can be accessed later using CPLGetLastErrNo()
+ **********************************************************************/
+void    CPLError(CPLErr eErrClass, int err_no, const char *fmt, ...)
+{
+    va_list args;
+
+    /* Expand the error message 
+     */
+    va_start(args, fmt);
+    vsprintf(gszCPLLastErrMsg, fmt, args);
+    va_end(args);
+
+    /* If the user provided his own error handling function, then call
+     * it, otherwise print the error to stderr and return.
+     */
+    gnCPLLastErrNo = err_no;
+
+    if (gpfnCPLErrorHandler != NULL)
+    {
+        gpfnCPLErrorHandler(eErrClass, err_no, gszCPLLastErrMsg);
+    }
+    else
+    {
+        fprintf(stderr, "ERROR %d: %s\n", gnCPLLastErrNo, gszCPLLastErrMsg);
+    }
+
+    if( eErrClass == CE_Fatal )
+        abort();
+}
+
+/**********************************************************************
+ *                          CPLErrorReset()
+ *
+ * Erase any traces of previous errors.
+ **********************************************************************/
+void    CPLErrorReset()
+{
+    gnCPLLastErrNo = 0;
+    gszCPLLastErrMsg[0] = '\0';
+}
+
+
+/**********************************************************************
+ *                          CPLGetLastErrorNo()
+ *
+ **********************************************************************/
+int     CPLGetLastErrorNo()
+{
+    return gnCPLLastErrNo;
+}
+
+/**********************************************************************
+ *                          CPLGetLastErrorMsg()
+ *
+ **********************************************************************/
+const char* CPLGetLastErrorMsg()
+{
+    return gszCPLLastErrMsg;
+}
+
+/**********************************************************************
+ *                          CPLSetErrorHandler()
+ *
+ * Allow the library's user to specify his own error handler function.
+ *
+ * A valid error handler is a C function with the following prototype:
+ *
+ *     void MyErrorHandler(int errno, const char *msg)
+ *
+ * Pass NULL to come back to the default behavior.
+ **********************************************************************/
+
+void     CPLSetErrorHandler(void (*pfnErrorHandler)(CPLErr, int, const char *))
+{
+    gpfnCPLErrorHandler = pfnErrorHandler;
+}
+
+/************************************************************************/
+/*                             _CPLAssert()                             */
+/*                                                                      */
+/*      This function is called only when an assertion fails.           */
+/************************************************************************/
+
+void _CPLAssert( const char * pszExpression, const char * pszFile,
+                 int iLine )
+
+{
+    CPLError( CE_Fatal, CPLE_AssertionFailed,
+              "Assertion `%s' failed\n"
+              "in file `%s', line %d\n",
+              pszExpression, pszFile, iLine );
+}
diff --git a/src/tiff/cpl_serv.h b/src/tiff/cpl_serv.h
new file mode 100644
index 0000000..7aec076
--- /dev/null
+++ b/src/tiff/cpl_serv.h
@@ -0,0 +1,276 @@
+/******************************************************************************
+ * Copyright (c) 1998, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * cpl_serv.h
+ *
+ * This include file derived and simplified from the GDAL Common Portability
+ * Library.
+ */
+
+#ifndef CPL_SERV_H_INCLUDED
+#define CPL_SERV_H_INCLUDED
+
+/* ==================================================================== */
+/*	Standard include files.						*/
+/* ==================================================================== */
+
+#include "geo_config.h"
+#include <stdio.h>
+
+#include <math.h>
+
+#ifdef HAVE_STRING_H
+#  include <string.h>
+#endif
+#if defined(HAVE_STRINGS_H) && !defined(HAVE_STRING_H)
+#  include <strings.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+#endif
+
+/**********************************************************************
+ * Do we want to build as a DLL on windows?
+ **********************************************************************/
+#if !defined(CPL_DLL)
+#  if defined(_WIN32) && defined(BUILD_AS_DLL)
+#    define CPL_DLL     __declspec(dllexport)
+#  else
+#    define CPL_DLL
+#  endif
+#endif
+
+/* ==================================================================== */
+/*      Other standard services.                                        */
+/* ==================================================================== */
+#ifdef __cplusplus
+#  define CPL_C_START		extern "C" {
+#  define CPL_C_END		}
+#else
+#  define CPL_C_START
+#  define CPL_C_END
+#endif
+
+#ifndef NULL
+#  define NULL	0
+#endif
+
+#ifndef FALSE
+#  define FALSE	0
+#endif
+
+#ifndef TRUE
+#  define TRUE	1
+#endif
+
+#ifndef MAX
+#  define MIN(a,b)      ((a<b) ? a : b)
+#  define MAX(a,b)      ((a>b) ? a : b)
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef ABS
+#  define ABS(x)        ((x<0) ? (-1*(x)) : x)
+#endif
+
+#ifndef EQUAL
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#  define EQUALN(a,b,n)           (strnicmp(a,b,n)==0)
+#  define EQUAL(a,b)              (stricmp(a,b)==0)
+#else
+#  define EQUALN(a,b,n)           (strncasecmp(a,b,n)==0)
+#  define EQUAL(a,b)              (strcasecmp(a,b)==0)
+#endif
+#endif
+
+/* ==================================================================== */
+/*      VSI Services (just map directly onto Standard C services.       */
+/* ==================================================================== */
+
+#define VSIFOpen	fopen
+#define VSIFClose	fclose
+#define VSIFEof		feof
+#define VSIFPrintf	fprintf
+#define VSIFPuts	fputs
+#define VSIFPutc	fputc
+#define VSIFGets	fgets
+#define VSIRewind	rewind
+#define VSIFSeek        fseek
+#define VSIFTell        ftell
+#define VSIFRead        fread
+
+#ifndef notdef
+#define VSICalloc(x,y)	_GTIFcalloc(x*y)
+#define VSIMalloc	_GTIFcalloc
+#define VSIFree	        _GTIFFree
+#define VSIRealloc      _GTIFrealloc
+#else
+#define VSICalloc(x,y)	(((char *) _GTIFcalloc(x*y+4)) + 4)
+#define VSIMalloc(x)	(((char *) _GTIFcalloc((x)+4)) + 4)
+#define VSIFree(x)      _GTIFFree(((char *) (x)) - 4)
+#define VSIRealloc(p,n) (((char *) _GTIFrealloc(((char *)p)-4,(n)+4)) + 4)
+#endif
+
+/* -------------------------------------------------------------------- */
+/*      Safe malloc() API.  Thin cover over VSI functions with fatal    */
+/*      error reporting if memory allocation fails.                     */
+/* -------------------------------------------------------------------- */
+CPL_C_START
+
+#define CPLMalloc  gtCPLMalloc
+#define CPLCalloc  gtCPLCalloc
+#define CPLRealloc gtCPLRealloc
+#define CPLStrdup  gtCPLStrdup
+
+void  *CPLMalloc( int );
+void  *CPLCalloc( int, int );
+void  *CPLRealloc( void *, int );
+char  *CPLStrdup( const char * );
+
+#define CPLFree(x)	{ if( x != NULL ) VSIFree(x); }
+
+/* -------------------------------------------------------------------- */
+/*      Read a line from a text file, and strip of CR/LF.               */
+/* -------------------------------------------------------------------- */
+
+#define CPLReadLine gtCPLReadLine
+
+const char *CPLReadLine( FILE * );
+
+/*=====================================================================
+                   Error handling functions (cpl_error.c)
+ =====================================================================*/
+
+typedef enum
+{
+    CE_None = 0,
+    CE_Log = 1,
+    CE_Warning = 2,
+    CE_Failure = 3,
+    CE_Fatal = 4
+} CPLErr;
+
+#define CPLError      gtCPLError
+#define CPLErrorReset gtCPLErrorReset
+#define CPLGetLastErrorNo gtCPLGetLastErrorNo
+#define CPLGetLastErrorMsg gtCPLGetLastErrorMsg
+#define CPLSetErrorHandler gtCPLSetErrorHandler
+#define _CPLAssert    gt_CPLAssert
+
+void  CPLError(CPLErr eErrClass, int err_no, const char *fmt, ...);
+void  CPLErrorReset();
+int   CPLGetLastErrorNo();
+const char  * CPLGetLastErrorMsg();
+void  CPLSetErrorHandler(void(*pfnErrorHandler)(CPLErr,int,
+                                                       const char *));
+void  _CPLAssert( const char *, const char *, int );
+
+#ifdef DEBUG
+#  define CPLAssert(expr)  ((expr) ? (void)(0) : _CPLAssert(#expr,__FILE__,__LINE__))
+#else
+#  define CPLAssert(expr)
+#endif
+
+CPL_C_END
+
+/* ==================================================================== */
+/*      Well known error codes.                                         */
+/* ==================================================================== */
+
+#define CPLE_AppDefined			1
+#define CPLE_OutOfMemory		2
+#define CPLE_FileIO			3
+#define CPLE_OpenFailed			4
+#define CPLE_IllegalArg			5
+#define CPLE_NotSupported		6
+#define CPLE_AssertionFailed		7
+#define CPLE_NoWriteAccess		8
+
+/*=====================================================================
+                   Stringlist functions (strlist.c)
+ =====================================================================*/
+CPL_C_START
+
+#define CSLAddString gtCSLAddString
+#define CSLCount     gtCSLCount
+#define CSLGetField  gtCSLGetField
+#define CSLDestroy   gtCSLDestroy
+#define CSLDuplicate gtCSLDuplicate
+#define CSLTokenizeString gtCSLTokenizeString
+#define CSLTokenizeStringComplex gtCSLTokenizeStringComplex
+
+char    **CSLAddString(char **papszStrList, const char *pszNewString);
+int     CSLCount(char **papszStrList);
+const char *CSLGetField( char **, int );
+void    CSLDestroy(char **papszStrList);
+char    **CSLDuplicate(char **papszStrList);
+
+char    **CSLTokenizeString(const char *pszString );
+char    **CSLTokenizeStringComplex(const char *pszString,
+                                   const char *pszDelimiter,
+                                   int bHonourStrings, int bAllowEmptyTokens );
+
+/* ==================================================================== */
+/*      .csv file related functions (from cpl_csv.c)                    */
+/* ==================================================================== */
+
+typedef enum {
+    CC_ExactString,
+    CC_ApproxString,
+    CC_Integer
+} CSVCompareCriteria;
+
+#define CSVFilename gtCSVFilename
+#define CSVReadParseLine gtCSVReadParseLine
+#define CSVScanLines gtCSVScanLines
+#define CSVScanFile gtCSVScanFile
+#define CSVScanFileByName gtCSVScanFileByName
+#define CSVGetFieldId gtCSVGetFieldId
+#define CSVDeaccess gtCSVDeaccess
+#define CSVGetField gtCSVGetField
+#define SetCSVFilenameHook gtSetCSVFilenameHook
+#define CSVGetFileFieldId gtCSVGetFileFieldId
+
+const char  *CSVFilename( const char * );
+
+char  **CSVReadParseLine( FILE * );
+char  **CSVScanLines( FILE *, int, const char *, CSVCompareCriteria );
+char  **CSVScanFile( const char *, int, const char *,
+                            CSVCompareCriteria );
+char  **CSVScanFileByName( const char *, const char *, const char *,
+                                  CSVCompareCriteria );
+int  CSVGetFieldId( FILE *, const char * );
+int  CSVGetFileFieldId( const char *, const char * );
+
+void  CSVDeaccess( const char * );
+
+const char  *CSVGetField( const char *, const char *, const char *,
+                                 CSVCompareCriteria, const char * );
+
+void CPL_DLL SetCSVFilenameHook( const char *(*)(const char *) );
+
+CPL_C_END
+
+#endif /* ndef CPL_SERV_H_INCLUDED */
diff --git a/src/tiff/csv/README b/src/tiff/csv/README
new file mode 100644
index 0000000..6b44468
--- /dev/null
+++ b/src/tiff/csv/README
@@ -0,0 +1,38 @@
+	EPSG Tables
+	===========
+
+The .csv files in this directory are an extract of tables from the EPSG
+projection database in CSV (comma separated value) format.  These same
+files come with the source distribution in the libgeotiff/csv directory.
+Information and source to extract these tables from the EPSG database
+can be found in the source distribution libgeotiff/csv/odbc2csv directory.
+
+Detailed information on the EPSG database can be found at:
+
+  http://www.petroconsultants.com/products/geodetic.htm
+
+
+The tables containing the basic data are: 
+
+ compd_cs:	compound coordinate system data. 
+ ellipsoid:	ellipsoid data. 
+ ellips_alias:	ellipsoid alias data. 
+ geod_datum:	geodetic datum data. 
+ gdatum_alias:	geodetic datum alias data. 
+ geod_trf:	geodetic transformation data. 
+ horiz_cs:	geographic and projected coordinate system data (GCS/PCS codes)
+ p_meridian:	prime meridian data. 
+ trf_method:	transformation method and parameter data. 
+ trf_nonpolynomial: projection and 3- or 7-parameter geodetic
+                    transformation parameter values. 
+ trf_path:	geodetic transformation path data. 
+ uom_angle:	angle unit data. 
+ uom_an_alias:	angle unit alias data: currently not populated. 
+ uom_length:	length unit data. 
+ uom_le_alias:	length unit alias data. 
+ uom_scale:	scale unit data. 
+ uom_sc_alias:	scale unit alias data: currently not populated. 
+ vert_datum:	vertical datum data. 
+ vert_cs:	vertical coordinate system data. 
+ vert_offset:	vertical coordinate system transformation data.
+
diff --git a/src/tiff/csv/alias.csv b/src/tiff/csv/alias.csv
new file mode 100644
index 0000000..9645d35
--- /dev/null
+++ b/src/tiff/csv/alias.csv
@@ -0,0 +1,2001 @@
+"ALIAS CODE","OBJECT_TABLE_NAME","OBJECT_CODE","NAMING_SYSTEM_CODE","ALIAS","REMARKS"
+1,Coordinate_Operation,1274,7300,LKS94(ETRF89) to WGS 84 (1),
+4,Datum,6258,7300,ETRF89,
+5,Ellipsoid,7013,7300,Modified Clarke 1880 (South Africa),The Clarke 1880 (Arc) figure is one of several modifications to the original definition.  The name Clarke Modified is usually taken to be the RGS modification.  But in southern Africa it is usually taken to be the Arc or Cape modification.
+6,Coordinate_Operation,8570,7300,ED50 to EUREF89 (2),
+7,Unit of Measure,9001,7300,meter,
+8,Unit of Measure,9036,7300,kilometer,Spelling used in US
+9,Coordinate Reference System,21100,7300,Genuk / NEIEZ,
+10,Coordinate_Operation,1036,7301,OSTN97,
+11,Coordinate_Operation,1123,7301,Genuk to WGS 84 (1),
+12,Coordinate_Operation,1149,7301,ETRF89 to WGS 84 (1),
+13,Coordinate_Operation,1273,7301,HD72 to ETRF89 (1),
+14,Coordinate_Operation,1309,7301,DHDN to ETRF89 (1),
+15,Coordinate_Operation,1310,7301,Pulkovo 1942 to ETRF89 (1),
+16,Coordinate_Operation,1311,7301,ED50 to WGS 84 (18),
+17,Coordinate_Operation,1331,7301,EST92 to ETRF89 (1),
+19,Coordinate_Operation,1513,7301,Final Datum 1958 to WGS 84 (1),
+20,Coordinate_Operation,1571,7301,Amersfoort to ETRF89 (1),
+21,Coordinate_Operation,1584,7301,Levant to WGS 72BE (1),
+22,Coordinate_Operation,1585,7301,Levant to WGS 84 (2),
+23,Coordinate_Operation,1586,7301,Levant to WGS 84 (3),
+24,Coordinate_Operation,1587,7301,Levant to WGS 84 (4),
+26,Coordinate_Operation,1589,7301,ED50 to ETRF89 (3),
+28,Coordinate_Operation,1611,7301,IRENET95 to ETRF89 (1),
+29,Coordinate Reference System,2140,7301,NAD83(CSRS98) / SCoPQ zone 3,
+30,Coordinate Reference System,2141,7301,NAD83(CSRS98) / SCoPQ zone 4,
+31,Coordinate Reference System,2142,7301,NAD83(CSRS98) / SCoPQ zone 5,
+32,Coordinate Reference System,2143,7301,NAD83(CSRS98) / SCoPQ zone 6,
+33,Coordinate Reference System,2144,7301,NAD83(CSRS98) / SCoPQ zone 7,
+34,Coordinate Reference System,2145,7301,NAD83(CSRS98) / SCoPQ zone 8,
+35,Coordinate Reference System,2146,7301,NAD83(CSRS98) / SCoPQ zone 9,
+36,Coordinate Reference System,2147,7301,NAD83(CSRS98) / SCoPQ zone 10,
+37,Coordinate Reference System,2159,7301,Sierra Leone 1924 / Peninsular Grid,
+38,Coordinate Reference System,2291,7301,NAD83 / PEI Stereo,
+39,Coordinate Reference System,3200,7301,Final Datum 1958 / Iraq zone,
+40,Coordinate Reference System,4132,7301,Final Datum 1958 (Iran),
+41,Coordinate Reference System,4140,7301,NAD83(CSRS),
+42,Coordinate Reference System,4172,7301,National Geodetic System [Argentina],see http://www.igm.gov.ar/posgar.html
+43,Coordinate Reference System,4211,7301,Genuk,
+44,Datum,4218,7301,Bogota,
+45,Coordinate Reference System,4227,7301,Levant,
+46,Coordinate Reference System,4258,7301,ETRF89,
+47,Coordinate Reference System,4272,7301,GD49,
+48,Coordinate Reference System,4813,7301,Genuk (Jakarta),
+49,Datum,5104,7301,Huang Hai 1956,
+50,Datum,6120,7301,Old Greek,"Adjective ""Old"" applied since introduction of GGRS87 (code 6121)"
+51,Datum,6125,7301,Samboja P2 exc T9,
+52,Datum,6160,7301,Quini-Huao,
+53,Datum,6174,7301,Sierra Leone Peninsular 1924,
+54,Datum,6211,7301,Genuk,
+55,Datum,6218,7301,Bogota,
+56,Datum,6222,7301,South Africa,
+57,Datum,6227,7301,Levant,
+58,Datum,6258,7301,European Terrestrial Reference Frame 1989,
+59,Datum,6269,7301,NAD83 (1986),
+60,Datum,6272,7301,GD49,
+61,Datum,6308,7301,Rikets koordinatsystem 1938,
+62,Ellipsoid,7012,7301,Clarke Modified 1880,The Clarke 1880 (RGS) figure is one of several modifications to the original definition.  The name Clarke Modified is usually taken to be the RGS modification.
+63,Ellipsoid,7013,7301,Clarke 1880 (Cape),
+64,Ellipsoid,7019,7301,International 1979,Adopted by IUGG 1979 Canberra as the Geodetic Reference Spheroid of 1980 (GRS 1980).
+65,Ellipsoid,7022,7301,Hayford 1909,Described as a=6378388 m. and b=6356909 m. from which 1/f derived to be 296.95926...   The figure was adopted as the International ellipsoid in 1924 but with 1/f taken as 297 exactly from which b is derved as 6356911.946 m.
+66,Ellipsoid,7029,7301,McCaw 1924,
+67,Ellipsoid,7030,7301,WGS84,
+68,Ellipsoid,7036,7301,International 1967,More usually known as GRS 1967 to avoid confusion with the International 1924 figure.
+69,Ellipsoid,7043,7301,NWL 10D,Used by Transit Broadcast Ephemeris before 1989. Also referred to as WGS72 spheroid.
+70,Coordinate_Operation,8568,7301,Levant to WGS 84 (1),
+71,Coordinate_Operation,8570,7301,ED50 to ETRF89 (2),
+72,Coordinate_Operation Parameter,8602,7301,Longitude rotation,
+73,Prime Meridian,8913,7301,Kristiania,
+74,Unit of Measure,9001,7301,International metre,
+75,Unit of Measure,9002,7301,international foot,
+76,Unit of Measure,9003,7301,American foot,
+77,Unit of Measure,9005,7301,South African geodetic foot,Not to be confused with the Cape foot.
+78,Unit of Measure,9030,7301,International nautical mile,
+79,Unit of Measure,9039,7301,link (Clarke's ratio),
+80,Unit of Measure,9040,7301,yard,
+81,Unit of Measure,9041,7301,foot,
+82,Unit of Measure,9042,7301,chain,
+83,Unit of Measure,9043,7301,link,
+84,Unit of Measure,9050,7301,yard,
+85,Unit of Measure,9051,7301,foot,
+86,Unit of Measure,9052,7301,chain,
+87,Unit of Measure,9053,7301,link,
+88,Unit of Measure,9060,7301,yard,
+89,Unit of Measure,9061,7301,foot,
+90,Unit of Measure,9062,7301,chain,
+91,Unit of Measure,9063,7301,link,
+92,Unit of Measure,9070,7301,foot,
+93,Unit of Measure,9080,7301,Indian geodetic foot,
+94,Unit of Measure,9081,7301,Indian geodetic foot,
+95,Unit of Measure,9084,7301,yard,= 3 Indian feet.
+96,Unit of Measure,9085,7301,yard,= 3 Indian feet.
+97,Unit of Measure,9094,7301,foot,
+98,Unit of Measure,9114,7301,mil,"Alias also applies to other variations of a mil, especially mil_6300 and mil_6000."
+100,Coordinate_Operation,17001,7301,Ghana TM,
+101,Coordinate_Operation,17901,7301,Mount Eden Circuit 1949,
+102,Coordinate_Operation,17902,7301,Bay of Plenty Circuit 1949,
+103,Coordinate_Operation,17903,7301,Poverty Bay Circuit 1949,
+104,Coordinate_Operation,17904,7301,Hawkes Bay Circuit 1949,
+105,Coordinate_Operation,17905,7301,Taranaki Circuit 1949,
+106,Coordinate_Operation,17906,7301,Tuhirangi Circuit 1949,
+107,Coordinate_Operation,17907,7301,Wanganui Circuit 1949,
+108,Coordinate_Operation,17908,7301,Wairarapa Circuit 1949,
+109,Coordinate_Operation,17909,7301,Wellington Circuit 1949,
+110,Coordinate_Operation,17910,7301,Collingwood Circuit 1949,
+111,Coordinate_Operation,17911,7301,Nelson Circuit 1949,
+112,Coordinate_Operation,17912,7301,Karamea Circuit 1949,
+113,Coordinate_Operation,17913,7301,Buller Circuit 1949,
+114,Coordinate_Operation,17914,7301,Grey Circuit 1949,
+115,Coordinate_Operation,17915,7301,Amuri Circuit 1949,
+116,Coordinate_Operation,17916,7301,Marlborough Circuit 1949,
+117,Coordinate_Operation,17917,7301,Hokitika Circuit 1949,
+118,Coordinate_Operation,17918,7301,Okarito Circuit 1949,
+119,Coordinate_Operation,17919,7301,Jacksons Bay Circuit 1949,
+120,Coordinate_Operation,17920,7301,Mount Pleasant Circuit 1949,
+121,Coordinate_Operation,17921,7301,Gawler Circuit 1949,
+122,Coordinate_Operation,17922,7301,Timaru Circuit 1949,
+123,Coordinate_Operation,17923,7301,Lindis Peak Circuit 1949,
+124,Coordinate_Operation,17924,7301,Mount Nicholas Circuit 1949,
+125,Coordinate_Operation,17925,7301,Mount York Circuit 1949,
+126,Coordinate_Operation,17926,7301,Observation Point Circuit 1949,
+127,Coordinate_Operation,17927,7301,North Taieri Circuit 1949,
+128,Coordinate_Operation,17928,7301,Bluff Circuit 1949,
+129,Coordinate_Operation,19906,7301,IOEPC Lambert,Sometimes seen defined with 2 standard parallels.
+130,Coordinate_Operation,19959,7301,Gold Coast Grid,
+131,Coordinate_Operation,19963,7301,Sierra Leone Peninsula Grid,
+132,Coordinate Reference System,21100,7301,Genuk (Jakarta) / NEIEZ,
+133,Coordinate Reference System,21148,7301,Genuk / UTM zone 48S,
+134,Coordinate Reference System,21150,7301,Genuk / UTM zone 50S,
+135,Coordinate Reference System,22700,7301,Levant / Levant Zone,
+136,Coordinate Reference System,22770,7301,Levant / Syria Lambert,
+137,Coordinate Reference System,22780,7301,Levant / Levant Stereographic,
+138,Coordinate Reference System,25828,7301,ETRF89 / UTM zone 28N,
+139,Coordinate Reference System,25829,7301,ETRF89 / UTM zone 29N,
+140,Coordinate Reference System,25830,7301,ETRF89 / UTM zone 30N,
+141,Coordinate Reference System,25831,7301,ETRF89 / UTM zone 31N,
+142,Coordinate Reference System,25832,7301,ETRF89 / UTM zone 32N,
+143,Coordinate Reference System,25833,7301,ETRF89 / UTM zone 33N,
+144,Coordinate Reference System,25834,7301,ETRF89 / UTM zone 34N,
+145,Coordinate Reference System,25835,7301,ETRF89 / UTM zone 35N,
+146,Coordinate Reference System,25836,7301,ETRF89 / UTM zone 36N,
+147,Coordinate Reference System,25837,7301,ETRF89 / UTM zone 37N,
+148,Coordinate Reference System,25838,7301,ETRF89 / UTM zone 38N,
+149,Coordinate Reference System,25884,7301,ETRF89 / TM Baltic93,
+150,Coordinate Reference System,27258,7301,GD49 / UTM zone 58,
+151,Coordinate Reference System,27259,7301,GD49 / UTM zone 59,
+152,Coordinate Reference System,27260,7301,GD49 / UTM zone 60,
+153,Coordinate Reference System,27291,7301,GD49 / North Island Grid,
+154,Coordinate Reference System,27292,7301,GD49 / South Island Grid,
+155,Coordinate Reference System,30592,7301,Nord Sahara 1959/Voirol Unifie S Algerie,
+156,Coordinate Reference System,30791,7301,Nord Sahara 1959 / Lambert Nord Voirol Unifie 1960,Voirol Unifie 1960 is NOT a geodetic datum nor GeogCRS.  It is two Lambert projected coordinate reference systems based on Nord Sahara 1959 Datum. See also code 30792.
+157,Coordinate Reference System,30792,7301,Nord Sahara 1959 / Lambert Sud Voirol Unifie 1960,Voirol Unifie 1960 is NOT a geodetic datum nor GeogCRS.  It is two Lambert projected coordinate reference systems based on Nord Sahara 1959 Datum. See also code 30791.
+158,Coordinate Reference System,31170,7301,Zanderij / Surinam Old TM,Old country name spelling.
+159,Coordinate Reference System,31171,7301,Zanderij / Surinam TM,Old spelling for country name.
+160,Coordinate Reference System,31300,7301,Belge Lambert 72,
+161,Coordinate_Operation,1026,7302,Madrid to ED50 (1),
+162,Coordinate_Operation,1027,7302,Madrid to ED50 (2),
+163,Coordinate_Operation,1028,7302,Madrid to ED50 (3),
+164,Coordinate_Operation,1029,7302,RD New to ED50/UTM31 (1),
+165,Coordinate_Operation,1030,7302,ED50/UTM31 to RD New (1),
+166,Coordinate_Operation,1031,7302,RD New to ED50/UTM31 (2),
+167,Coordinate_Operation,1032,7302,ED50/UTM31 to RD New (2),
+168,Coordinate_Operation,1274,7302,CS42 to LKS94 (1),
+169,Coordinate_Operation,1283,7302,LKS94 to WGS 84 (1),
+170,Coordinate Reference System,2000,7302,Anguilla 1957 / BWI Grid,
+171,Coordinate Reference System,2001,7302,Antigua 1943 / BWI Grid,
+172,Coordinate Reference System,2002,7302,Dominica 1945 / BWI Grid,
+173,Coordinate Reference System,2003,7302,Grenada 1953 / BWI Grid,
+174,Coordinate Reference System,2004,7302,Montserrat 58 / BWI Grid,
+175,Coordinate Reference System,2005,7302,St Kitts 1955 / BWI Grid,
+176,Coordinate Reference System,2006,7302,St Lucia 1955 / BWI Grid,
+177,Coordinate Reference System,2007,7302,St Vincent 45 / BWI Grid,
+178,Coordinate Reference System,2008,7302,CGQ77 / SCoPQ zone 2,
+179,Coordinate Reference System,2009,7302,CGQ77 / SCoPQ zone 3,
+180,Coordinate Reference System,2010,7302,CGQ77 / SCoPQ zone 4,
+181,Coordinate Reference System,2011,7302,CGQ77 / SCoPQ zone 5,
+182,Coordinate Reference System,2012,7302,CGQ77 / SCoPQ zone 6,
+183,Coordinate Reference System,2013,7302,CGQ77 / SCoPQ zone 7,
+184,Coordinate Reference System,2014,7302,CGQ77 / SCoPQ zone 8,
+185,Coordinate Reference System,2015,7302,CGQ77 / SCoPQ zone 9,
+186,Coordinate Reference System,2016,7302,CGQ77 / SCoPQ zone 10,
+187,Coordinate Reference System,2036,7302,NAD83(CSRS) / NB Stereo,
+188,Coordinate Reference System,2037,7302,NAD83(CSRS) / UTM 19N,
+189,Coordinate Reference System,2038,7302,NAD83(CSRS) / UTM 20N,
+190,Coordinate Reference System,2039,7302,Israeli TM Grid,
+191,Coordinate Reference System,2040,7302,Locodjo 65 / UTM 30N,
+192,Coordinate Reference System,2041,7302,Abidjan 87 / UTM 30N,
+193,Coordinate Reference System,2042,7302,Locodjo 65 / UTM 29N,
+194,Coordinate Reference System,2043,7302,Abidjan 87 / UTM 29N,
+195,Coordinate Reference System,2044,7302,Hanoi 72 / Gauss zone 18,
+196,Coordinate Reference System,2045,7302,Hanoi 72 / Gauss zone 19,
+197,Coordinate Reference System,2046,7302,New S African CS zone 15,
+198,Coordinate Reference System,2047,7302,New S African CS zone 17,
+199,Coordinate Reference System,2048,7302,New S African CS zone 19,
+200,Coordinate Reference System,2049,7302,New S African CS zone 21,
+201,Coordinate Reference System,2050,7302,New S African CS zone 23,
+202,Coordinate Reference System,2051,7302,New S African CS zone 25,
+203,Coordinate Reference System,2052,7302,New S African CS zone 27,
+204,Coordinate Reference System,2053,7302,New S African CS zone 29,
+205,Coordinate Reference System,2054,7302,New S African CS zone 31,
+206,Coordinate Reference System,2055,7302,New S African CS zone 33,
+207,Coordinate Reference System,2056,7302,LV95,
+208,Coordinate Reference System,2066,7302,Mount Dillon / Tobago,
+209,Coordinate Reference System,2067,7302,Naparima 1955 / UTM 20N,
+210,Coordinate Reference System,2081,7302,Chos Malal / Argentina 2,
+211,Coordinate Reference System,2082,7302,Pampa d Castillo / Arg 2,
+212,Coordinate Reference System,2083,7302,Hito XVIII / Argentina 2,
+213,Coordinate Reference System,2084,7302,Hito XVIII / UTM 19S,
+214,Coordinate Reference System,2089,7302,Yemen NGN96 / UTM 38N,
+215,Coordinate Reference System,2090,7302,Yemen NGN96 / UTM 39N,
+216,Coordinate Reference System,2091,7302,S Yemen / Gauss zone 8,
+217,Coordinate Reference System,2092,7302,S Yemen / Gauss zone 9,
+218,Coordinate Reference System,2096,7302,Korean 1985 / East Belt,
+219,Coordinate Reference System,2097,7302,Korean 1985 / Cen. Belt,
+220,Coordinate Reference System,2098,7302,Korean 1985 / West Belt,
+221,Coordinate Reference System,2099,7302,Qatar Plane CS,
+222,Coordinate Reference System,2136,7301,Accra / Gold Coast Grid,
+223,Coordinate Reference System,2137,7301,Accra / Ghana TM,
+224,Coordinate Reference System,2157,7302,IRENET95 / ITM,
+225,Coordinate Reference System,2200,7302,ATS77 / NB Stereographic,
+226,Coordinate Reference System,2290,7302,ATS77 / PEI Stereo,
+227,Coordinate Reference System,2291,7302,NAD83(CSRS) / PEI Stereo,
+228,Coordinate Reference System,2294,7302,ATS77 / MTM NS zone 4,
+229,Coordinate Reference System,2295,7302,ATS77 / MTM NS zone 5,
+230,Coordinate Reference System,2393,7302,KKJ / Finland zone 3,
+231,Coordinate Reference System,2600,7302,LKS94,
+232,Coordinate Reference System,3561,7302,Old Hawaiian / SP zone 1,
+233,Coordinate Reference System,3562,7302,Old Hawaiian / SP zone 2,
+234,Coordinate Reference System,3563,7302,Old Hawaiian / SP zone 3,
+235,Coordinate Reference System,3564,7302,Old Hawaiian / SP zone 4,
+236,Coordinate Reference System,3565,7302,Old Hawaiian / SP zone 5,
+237,Coordinate Reference System,3991,7302,Puerto Rico SPCS 27,
+238,Coordinate Reference System,4134,7302,PSD93,
+239,Coordinate Reference System,4215,7302,BD 50,
+240,Coordinate Reference System,4268,7302,NAD Michigan,
+241,Coordinate Reference System,4313,7302,BD 72,
+242,Coordinate Reference System,4609,7302,CGQ77,
+243,Coordinate Reference System,4809,7302,BD 50 (Brussels),
+244,Datum,5100,7302,msl,
+245,Datum,5101,7302,ODN,
+246,Datum,5102,7302,NGVD29,
+247,Datum,5103,7302,NAVD88,
+248,Datum,5104,7302,Yellow Sea,
+249,Datum,5105,7302,Baltic,
+250,Datum,5106,7302,Caspian,
+251,Datum,5107,7302,NGF,
+252,Datum,5109,7302,NAP,
+253,Datum,5111,7302,AHD,
+254,Datum,5112,7302,AHD (Tasmania),
+255,Datum,5114,7302,CVD28,
+256,Datum,5115,7302,Piraeus86,
+257,Datum,5116,7302,N60,
+258,Datum,5117,7302,RH70,
+259,Datum,5118,7302,NGF - Lallemand,
+260,Datum,5119,7302,NGF - IGN69,
+261,Datum,5120,7302,NGF - IGN78,
+262,Datum,5122,7302,JapanVD,
+263,Datum,5123,7302,PHD93,
+264,Datum,5127,7302,LN02,
+265,Datum,5128,7302,LHN95,
+266,Datum,5129,7302,EVRF2000,
+267,Coordinate Reference System,5701,7302,ODN,
+268,Coordinate Reference System,5702,7302,NGVD29,
+269,Coordinate Reference System,5703,7302,NAVD88,
+270,Coordinate Reference System,5709,7302,NAP,
+271,Coordinate Reference System,5711,7302,AHD,
+272,Coordinate Reference System,5712,7302,AHD (Tasmania),
+273,Coordinate Reference System,5713,7302,CVD28,
+274,Coordinate Reference System,5714,7302,msl height,
+275,Coordinate Reference System,5715,7302,msl depth,
+276,Coordinate Reference System,5723,7302,Japan Levelling Datum,
+277,Coordinate Reference System,5724,7302,PHD93,
+278,Coordinate Reference System,5728,7302,LN02,
+279,Coordinate Reference System,5729,7302,LHN95,
+280,Coordinate Reference System,5730,7302,EVRS2000,
+281,Datum,6121,7302,GGRS87,
+282,Datum,6122,7302,ATS77,
+283,Datum,6123,7302,KKJ,
+284,Datum,6124,7302,RT90,
+285,Datum,6126,7302,LKS94 (ETRS89),
+286,Datum,6130,7302,Moznet,
+287,Datum,6132,7302,FD58,
+288,Datum,6133,7302,EST92,
+289,Datum,6134,7302,PSD93,
+290,Datum,6140,7302,NAD83(CSRS98),
+291,Datum,6151,7302,CHTRF95,
+292,Datum,6152,7302,NAD83(HARN),
+293,Datum,6154,7302,ED50(ED77),
+294,Datum,6156,7302,S-JTSK,
+295,Datum,6159,7302,ELD79,
+296,Datum,6163,7302,YNGN96,
+297,Datum,6170,7302,SIRGAS,
+298,Datum,6171,7302,RGF93,
+299,Datum,6172,7302,POSGAR,
+300,Datum,6202,7302,AGD66,
+301,Datum,6203,7302,AGD84,
+302,Datum,6204,7302,Ain el Abd,
+303,Datum,6215,7302,Belge 1950,
+304,Datum,6230,7302,ED50,
+305,Datum,6231,7302,ED87,
+306,Datum,6237,7302,HD72,
+307,Datum,6238,7302,ID74,
+308,Datum,6242,7302,JAD69,
+309,Datum,6246,7302,KOC,
+310,Datum,6248,7302,PSAD56,
+311,Datum,6258,7302,ETRS89,
+312,Datum,6267,7302,NAD27,
+313,Datum,6269,7302,NAD83,
+314,Datum,6272,7302,NZGD49,
+315,Datum,6275,7302,NTF,
+316,Datum,6278,7302,OSGB70,
+317,Datum,6279,7302,OS(SN)80,
+318,Datum,6280,7302,Padang,
+319,Datum,6283,7302,GDA94,
+320,Datum,6291,7302,SAD69,
+321,Datum,6297,7302,Tananarive,
+322,Datum,6303,7302,TC(1948),
+323,Datum,6305,7302,Voirol Unifie,
+324,Datum,6308,7302,RT38,
+325,Datum,6312,7302,MGI,
+326,Datum,6313,7302,Belge 1972,
+327,Datum,6314,7302,DHDN,
+328,Datum,6318,7302,NGN,
+329,Datum,6319,7302,KUDAMS,
+330,Datum,6322,7302,WGS 72,
+331,Datum,6324,7302,WGS 72BE,
+332,Datum,6326,7302,WGS 84,
+333,Datum,6608,7302,NAD27(76),
+334,Datum,6609,7302,CGQ77,
+335,Datum,6901,7302,ATF (Paris),
+336,Datum,6902,7302,NDG (Paris),
+337,Ellipsoid,7003,7302,ANS,
+338,Coordinate Reference System,7401,7302,NTF / France II + Lalle,
+339,Coordinate Reference System,7402,7302,NTF / France II + IGN69,
+340,Coordinate Reference System,7403,7302,NTF / France III + IGN69,
+341,Coordinate Reference System,7405,7302,GB National Grid + ODN,
+342,Coordinate Reference System,7407,7302,NAD27 / TX_N + NGVD29,
+343,Coordinate_Operation Parameter,8663,7302,k,
+344,Unit of Measure,9001,7302,m,
+345,Unit of Measure,9002,7302,ft,
+346,Unit of Measure,9003,7302,ftUS,
+347,Unit of Measure,9005,7302,ftCla,
+348,Unit of Measure,9014,7302,f,
+349,Unit of Measure,9030,7302,NM,
+350,Unit of Measure,9031,7302,GLM,
+351,Unit of Measure,9033,7302,chUS,
+352,Unit of Measure,9034,7302,lkUS,
+353,Unit of Measure,9035,7302,miUS,
+354,Unit of Measure,9036,7302,km,
+355,Unit of Measure,9037,7302,ydCla,
+356,Unit of Measure,9038,7302,chCla,
+357,Unit of Measure,9039,7302,lkCla,
+358,Unit of Measure,9040,7302,ydSe,
+359,Unit of Measure,9041,7302,ftSe,
+360,Unit of Measure,9042,7302,chSe,
+361,Unit of Measure,9043,7302,lkSe,
+362,Unit of Measure,9050,7302,ydBnA,
+363,Unit of Measure,9051,7302,ftBnA,
+364,Unit of Measure,9052,7302,chBnA,
+365,Unit of Measure,9053,7302,lkBnA,
+366,Unit of Measure,9060,7302,ydBnB,
+367,Unit of Measure,9061,7302,ftBnB,
+368,Unit of Measure,9062,7302,chBnB,
+369,Unit of Measure,9063,7302,lkBnB,
+370,Unit of Measure,9070,7302,ftBr(65),
+371,Unit of Measure,9080,7302,ftInd,
+372,Unit of Measure,9081,7302,ftInd(37),
+373,Unit of Measure,9082,7302,ftInd(62),
+374,Unit of Measure,9083,7302,ftInd(75),
+375,Unit of Measure,9084,7302,ydInd,
+376,Unit of Measure,9085,7302,ydInd(37),
+377,Unit of Measure,9086,7302,ydInd(62),
+378,Unit of Measure,9087,7302,ydInd(75),
+379,Unit of Measure,9093,7302,mi,
+380,Unit of Measure,9094,7302,ftGC,
+381,Unit of Measure,9101,7302,rad,
+382,Unit of Measure,9102,7302,deg,
+383,Unit of Measure,9103,7302,min,
+384,Unit of Measure,9104,7302,sec,
+385,Unit of Measure,9105,7302,gr,
+386,Unit of Measure,9106,7302,g,
+387,Unit of Measure,9107,7302,DMS,
+388,Unit of Measure,9108,7302,DMSH,
+389,Unit of Measure,9109,7302,�rad,
+390,Unit of Measure,9110,7302,DDD.MMSSsss,
+391,Unit of Measure,9111,7302,DDD.MMm,
+392,Unit of Measure,9112,7302,c,
+393,Unit of Measure,9113,7302,cc,
+394,Unit of Measure,9114,7302,mil,
+395,Unit of Measure,9202,7302,ppm,
+396,Unit of Measure,9204,7302,Bin330ftUS,
+397,Unit of Measure,9205,7302,Bin165ftUS,
+398,Unit of Measure,9206,7302,Bin82.5ftUS,
+399,Unit of Measure,9207,7302,Bin37.5m,
+400,Unit of Measure,9208,7302,Bin25m,
+401,Unit of Measure,9209,7302,Bin12.5m,
+402,Unit of Measure,9210,7302,Bin6.25m,
+403,Unit of Measure,9211,7302,Bin3.125m,
+404,Coordinate_Operation Method,9633,7302,OSTN,
+405,Coordinate_Operation Method,9824,7302,UTM,
+406,Coordinate_Operation,10101,7302,Alabama East,
+407,Coordinate_Operation,10102,7302,Alabama West,
+408,Coordinate_Operation,10131,7302,Alabama East,
+409,Coordinate_Operation,10132,7302,Alabama West,
+410,Coordinate_Operation,10201,7302,Arizona East,
+411,Coordinate_Operation,10202,7302,Arizona Central,
+412,Coordinate_Operation,10203,7302,Arizona West,
+413,Coordinate_Operation,10231,7302,Arizona East,
+414,Coordinate_Operation,10232,7302,Arizona Central,
+415,Coordinate_Operation,10233,7302,Arizona West,
+416,Coordinate_Operation,10301,7302,Arkansas North,
+417,Coordinate_Operation,10302,7302,Arkansas South,
+418,Coordinate_Operation Method,9809,7301,Roussilhe,
+419,Coordinate_Operation,10331,7302,Arkansas North,
+420,Coordinate_Operation,10332,7302,Arkansas South,
+421,Coordinate_Operation,10401,7302,California zone I,
+422,Coordinate_Operation,10402,7302,California zone II,
+423,Coordinate_Operation,10403,7302,California zone III,
+424,Coordinate_Operation,10404,7302,California zone IV,
+425,Coordinate_Operation,10405,7302,California zone V,
+426,Coordinate_Operation,10406,7302,California zone VI,
+427,Coordinate_Operation,10407,7302,California zone VII,
+428,Coordinate_Operation,10431,7302,California zone 1,
+429,Coordinate_Operation,10432,7302,California zone 2,
+430,Coordinate_Operation,10433,7302,California zone 3,
+431,Coordinate_Operation,10434,7302,California zone 4,
+432,Coordinate_Operation,10435,7302,California zone 5,
+433,Coordinate_Operation,10436,7302,California zone 6,
+434,Coordinate_Operation,10501,7302,Colorado North,
+435,Coordinate_Operation,10503,7302,Colorado South,
+436,Coordinate_Operation,10531,7302,Colorado North,
+437,Coordinate_Operation,10533,7302,Colorado South,
+438,Coordinate_Operation,10600,7302,Connecticut,
+439,Coordinate_Operation,10630,7302,Connecticut,
+440,Coordinate_Operation,10700,7302,Delaware,
+441,Coordinate_Operation,10730,7302,Delaware,
+442,Coordinate_Operation,10901,7302,Florida East,
+443,Coordinate_Operation,10902,7302,Florida West,
+444,Coordinate_Operation,10903,7302,Florida North,
+445,Coordinate_Operation,10931,7302,Florida East,
+446,Coordinate_Operation,10932,7302,Florida West,
+447,Coordinate_Operation,10933,7302,Florida North,
+448,Coordinate_Operation,11001,7302,Georgia East,
+449,Coordinate_Operation,11002,7302,Georgia West,
+450,Coordinate_Operation,11031,7302,Georgia East,
+451,Coordinate_Operation,11032,7302,Georgia West,
+452,Coordinate_Operation,11101,7302,Idaho East,
+453,Coordinate_Operation,11102,7302,Idaho Central,
+454,Coordinate_Operation,11103,7302,Idaho West,
+455,Coordinate_Operation,11131,7302,Idaho East,
+456,Coordinate_Operation,11132,7302,Idaho Central,
+457,Coordinate_Operation,11133,7302,Idaho West,
+458,Coordinate_Operation,11201,7302,Illinois East,
+459,Coordinate_Operation,11202,7302,Illinois West,
+460,Coordinate_Operation,11231,7302,Illinois East,
+461,Coordinate_Operation,11232,7302,Illinois West,
+462,Coordinate_Operation,11301,7302,Indiana East,
+463,Coordinate_Operation,11302,7302,Indiana West,
+464,Coordinate_Operation,11331,7302,Indiana East,
+465,Coordinate_Operation,11332,7302,Indiana West,
+466,Coordinate_Operation,11401,7302,Iowa North,
+467,Coordinate_Operation,11402,7302,Iowa South,
+468,Coordinate_Operation,11431,7302,Iowa North,
+469,Coordinate_Operation,11432,7302,Iowa South,
+470,Coordinate_Operation,11501,7302,Kansas North,
+471,Coordinate_Operation,11502,7302,Kansas South,
+472,Coordinate_Operation,11531,7302,Kansas North,
+473,Coordinate_Operation,11532,7302,Kansas South,
+474,Coordinate_Operation,11601,7302,Kentucky North,
+475,Coordinate_Operation,11602,7302,Kentucky South,
+476,Coordinate_Operation,11631,7302,Kentucky North,
+477,Coordinate_Operation,11632,7302,Kentucky South,
+478,Coordinate_Operation,11701,7302,Louisiana North,
+479,Coordinate_Operation,11702,7302,Louisiana South,
+480,Coordinate_Operation,11731,7302,Louisiana North,
+481,Coordinate_Operation,11732,7302,Louisiana South,
+482,Coordinate_Operation,11801,7302,Maine East,
+483,Coordinate_Operation,11802,7302,Maine West,
+484,Coordinate_Operation,11831,7302,Maine East,
+485,Coordinate_Operation,11832,7302,Maine West,
+486,Coordinate_Operation,11900,7302,Maryland,
+487,Coordinate_Operation,11930,7302,Maryland,
+488,Coordinate_Operation,12001,7302,Massachusetts Mainland,
+489,Coordinate_Operation,12002,7302,Massachusetts Island,
+490,Coordinate_Operation,12031,7302,Massachusetts Mainland,
+491,Coordinate_Operation,12032,7302,Massachusetts Island,
+492,Coordinate_Operation,12101,7302,Michigan East,
+493,Coordinate_Operation,12102,7302,Michigan Old Central,
+494,Coordinate_Operation,12111,7302,Michigan North,
+495,Coordinate_Operation,12112,7302,Michigan Central,
+496,Coordinate_Operation,12113,7302,Michigan South,
+497,Coordinate_Operation,12141,7302,Michigan North,
+498,Coordinate_Operation,12142,7302,Michigan Central,
+499,Coordinate_Operation,12143,7302,Michigan South,
+500,Coordinate_Operation,12201,7302,Minnesota North,
+501,Coordinate_Operation,12202,7302,Minnesota Central,
+502,Coordinate_Operation,12203,7302,Minnesota South,
+503,Coordinate_Operation,12231,7302,Minnesota North,
+504,Coordinate_Operation,12232,7302,Minnesota Central,
+505,Coordinate_Operation,12233,7302,Minnesota South,
+506,Coordinate_Operation,12301,7302,Mississippi East,
+507,Coordinate_Operation,12302,7302,Mississippi West,
+508,Coordinate_Operation,12331,7302,Mississippi East,
+509,Coordinate_Operation,12332,7302,Mississippi West,
+510,Coordinate_Operation,12401,7302,Missouri  East,
+511,Coordinate_Operation,12402,7302,Missouri Central,
+512,Coordinate_Operation,12403,7302,Missouri West,
+513,Coordinate_Operation,12431,7302,Missouri East,
+514,Coordinate_Operation,12432,7302,Missouri Central,
+515,Coordinate_Operation,12433,7302,Missouri West,
+516,Coordinate_Operation,12501,7302,Montana North,
+517,Coordinate_Operation,12502,7302,Montana Central,
+518,Coordinate_Operation,12503,7302,Montana South,
+519,Coordinate_Operation,12530,7302,Montana,
+520,Coordinate_Operation,12601,7302,Nebraska North,
+521,Coordinate_Operation,12602,7302,Nebraska South,
+522,Coordinate_Operation,12630,7302,Nebraska,
+523,Coordinate_Operation,12701,7302,Nevada  East,
+524,Coordinate_Operation,12702,7302,Nevada Central,
+525,Coordinate_Operation,12703,7302,Nevada West,
+526,Coordinate_Operation,12731,7302,Nevada East,
+527,Coordinate_Operation,12732,7302,Nevada Central,
+528,Coordinate_Operation,12733,7302,Nevada West,
+529,Coordinate_Operation,12800,7302,New Hampshire,
+530,Coordinate_Operation,12830,7302,New Hampshire,
+531,Coordinate_Operation,12900,7302,New Jersey,
+532,Coordinate_Operation,12930,7302,New Jersey,
+533,Coordinate_Operation,13001,7302,New Mexico East,
+534,Coordinate_Operation,13002,7302,New Mexico Central,
+535,Coordinate_Operation,13003,7302,New Mexico West,
+536,Coordinate_Operation,13031,7302,New Mexico East,
+537,Coordinate_Operation,13032,7302,New Mexico Central,
+538,Coordinate_Operation,13033,7302,New Mexico West,
+539,Coordinate_Operation,13101,7302,New York East,
+540,Coordinate_Operation,13102,7302,New York Central,
+541,Coordinate_Operation,13103,7302,New York  West,
+542,Coordinate_Operation,13104,7302,New York Long Island,
+543,Coordinate_Operation,13131,7302,New York East,
+544,Coordinate_Operation,13132,7302,New York Central,
+545,Coordinate_Operation,13133,7302,New York  West,
+546,Coordinate_Operation,13134,7302,New York Long Island,
+547,Coordinate_Operation,13200,7302,North Carolina,
+548,Coordinate_Operation,13230,7302,North Carolina,
+549,Coordinate_Operation,13301,7302,North Dakota North,
+550,Coordinate_Operation,13302,7302,North Dakota South,
+551,Coordinate_Operation,13331,7302,North Dakota North,
+552,Coordinate_Operation,13332,7302,North Dakota South,
+553,Coordinate_Operation,13401,7302,Ohio North,
+554,Coordinate_Operation,13402,7302,Ohio South,
+555,Coordinate_Operation,13431,7302,Ohio North,
+556,Coordinate_Operation,13432,7302,Ohio South,
+557,Coordinate_Operation,13501,7302,Oklahoma North,
+558,Coordinate_Operation,13502,7302,Oklahoma South,
+559,Coordinate_Operation,13531,7302,Oklahoma North,
+560,Coordinate_Operation,13532,7302,Oklahoma South,
+561,Coordinate_Operation,13601,7302,Oregon North,
+562,Coordinate_Operation,13602,7302,Oregon South,
+563,Coordinate_Operation,13631,7302,Oregon North,
+564,Coordinate_Operation,13632,7302,Oregon South,
+565,Coordinate_Operation,13701,7302,Pennsylvania North,
+566,Coordinate_Operation,13702,7302,Pennsylvania South,
+567,Coordinate_Operation,13731,7302,Pennsylvania North,
+568,Coordinate_Operation,13732,7302,Pennsylvania South,
+569,Coordinate_Operation,13800,7302,Rhode Island,
+570,Coordinate_Operation,13830,7302,Rhode Island,
+571,Coordinate_Operation,13901,7302,South Carolina North,
+572,Coordinate_Operation,13902,7302,South Carolina South,
+573,Coordinate_Operation,13930,7302,South Carolina,
+574,Coordinate_Operation,14001,7302,South Dakota North,
+575,Coordinate_Operation,14002,7302,South Dakota South,
+576,Coordinate_Operation,14031,7302,South Dakota North,
+577,Coordinate_Operation,14032,7302,South Dakota South,
+578,Coordinate_Operation,14100,7302,Tennessee,
+579,Coordinate_Operation,14130,7302,Tennessee,
+580,Coordinate_Operation,14201,7302,Texas North,
+581,Coordinate_Operation,14202,7302,Texas North Central,
+582,Coordinate_Operation,14203,7302,Texas Central,
+583,Coordinate_Operation,14204,7302,Texas South Central,
+584,Coordinate_Operation,14205,7302,Texas South,
+585,Coordinate_Operation,14231,7302,Texas North,
+586,Coordinate_Operation,14232,7302,Texas North Central,
+587,Coordinate_Operation,14233,7302,Texas Central,
+588,Coordinate_Operation,14234,7302,Texas South Central,
+589,Coordinate_Operation,14235,7302,Texas South,
+590,Coordinate_Operation,14301,7302,Utah North,
+591,Coordinate_Operation,14302,7302,Utah Central,
+592,Coordinate_Operation,14303,7302,Utah South,
+593,Coordinate_Operation,14331,7302,Utah North,
+594,Coordinate_Operation,14332,7302,Utah Central,
+595,Coordinate_Operation,14333,7302,Utah South,
+596,Coordinate_Operation,14400,7302,Vermont,
+597,Coordinate_Operation,14430,7302,Vermont,
+598,Coordinate_Operation,14501,7302,Virginia North,
+599,Coordinate_Operation,14502,7302,Virginia South,
+600,Coordinate_Operation,14531,7302,Virginia North,
+601,Coordinate_Operation,14532,7302,Virginia South,
+602,Coordinate_Operation,14601,7302,Washington North,
+603,Coordinate_Operation,14602,7302,Washington South,
+604,Coordinate_Operation,14631,7302,Washington North,
+605,Coordinate_Operation,14632,7302,Washington South,
+606,Coordinate_Operation,14701,7302,West Virginia North,
+607,Coordinate_Operation,14702,7302,West Virginia South,
+608,Coordinate_Operation,14731,7302,West Virginia North,
+609,Coordinate_Operation,14732,7302,West Virginia South,
+610,Coordinate_Operation,14801,7302,Wisconsin North,
+611,Coordinate_Operation,14802,7302,Wisconsin Central,
+612,Coordinate_Operation,14803,7302,Wisconsin South,
+613,Coordinate_Operation,14831,7302,Wisconsin North,
+614,Coordinate_Operation,14832,7302,Wisconsin Central,
+615,Coordinate_Operation,14833,7302,Wisconsin South,
+616,Coordinate_Operation,14901,7302,Wyoming East,
+617,Coordinate_Operation,14902,7302,Wyoming East Central,
+618,Coordinate_Operation,14903,7302,Wyoming West Central,
+619,Coordinate_Operation,14904,7302,Wyoming West,
+620,Coordinate_Operation,14931,7302,Wyoming East,
+621,Coordinate_Operation,14932,7302,Wyoming East Central,
+622,Coordinate_Operation,14933,7302,Wyoming West Central,
+623,Coordinate_Operation,14934,7302,Wyoming West,
+624,Coordinate_Operation,15001,7302,Alaska zone 1,
+625,Coordinate_Operation,15002,7302,Alaska zone 2,
+626,Coordinate_Operation,15003,7302,Alaska zone 3,
+627,Coordinate_Operation,15004,7302,Alaska zone 4,
+628,Coordinate_Operation,15005,7302,Alaska zone 5,
+629,Coordinate_Operation,15006,7302,Alaska zone 6,
+630,Coordinate_Operation,15007,7302,Alaska zone 7,
+631,Coordinate_Operation,15008,7302,Alaska zone 8,
+632,Coordinate_Operation,15009,7302,Alaska zone 9,
+633,Coordinate_Operation,15010,7302,Alaska zone 10,
+634,Coordinate_Operation,15031,7302,Alaska zone 1,
+635,Coordinate_Operation,15032,7302,Alaska zone 2,
+636,Coordinate_Operation,15033,7302,Alaska zone 3,
+637,Coordinate_Operation,15034,7302,Alaska zone 4,
+638,Coordinate_Operation,15035,7302,Alaska zone 5,
+639,Coordinate_Operation,15036,7302,Alaska zone 6,
+640,Coordinate_Operation,15037,7302,Alaska zone 7,
+641,Coordinate_Operation,15038,7302,Alaska zone 8,
+642,Coordinate_Operation,15039,7302,Alaska zone 9,
+643,Coordinate_Operation,15040,7302,Alaska zone 10,
+644,Coordinate_Operation,15101,7302,Hawaii  zone 1,
+645,Coordinate_Operation,15102,7302,Hawaii  zone 2,
+646,Coordinate_Operation,15103,7302,Hawaii  zone 3,
+647,Coordinate_Operation,15104,7302,Hawaii  zone 4,
+648,Coordinate_Operation,15105,7302,Hawaii  zone 5,
+649,Coordinate_Operation,15131,7302,Hawaii zone 1,
+650,Coordinate_Operation,15132,7302,Hawaii zone 2,
+651,Coordinate_Operation,15133,7302,Hawaii zone 3,
+652,Coordinate_Operation,15134,7302,Hawaii zone 4,
+653,Coordinate_Operation,15135,7302,Hawaii zone 5,
+654,Coordinate_Operation,15201,7302,Puerto Rico,
+655,Coordinate_Operation,15202,7302,St. Croix,
+656,Coordinate_Operation,15230,7302,Puerto Rico & Virgin Is.,
+657,Coordinate_Operation,15914,7302,BLM 14N (ftUS),
+658,Coordinate_Operation,15915,7302,BLM 15N (ftUS),
+659,Coordinate_Operation,15916,7302,BLM 16N (ftUS),
+660,Coordinate_Operation,15917,7302,BLM 17N (ftUS),
+661,Coordinate_Operation,16061,7302,UPS North,
+662,Coordinate_Operation,16062,7302,UPS South,
+663,Coordinate_Operation,16261,7302,3-degree Gauss zone 1,
+664,Coordinate_Operation,16262,7302,3-degree Gauss zone 2,
+665,Coordinate_Operation,16263,7302,3-degree Gauss zone 3,
+666,Coordinate_Operation,16264,7302,3-degree Gauss zone 4,
+667,Coordinate_Operation,16265,7302,3-degree Gauss zone 5,
+668,Coordinate_Operation,16266,7302,3-degree Gauss zone 6,
+669,Coordinate_Operation,16267,7302,3-degree Gauss zone 7,
+670,Coordinate_Operation,16268,7302,3-degree Gauss zone 8,
+671,Coordinate_Operation,16361,7302,3-deg Gauss-Kruger 3E,
+672,Coordinate_Operation,16362,7302,3-deg Gauss-Kruger 6E,
+673,Coordinate_Operation,16363,7302,3-deg Gauss-Kruger 9E,
+674,Coordinate_Operation,16364,7302,3-deg Gauss-Kruger 12E,
+675,Coordinate_Operation,16365,7302,3-deg Gauss-Kruger 15E,
+676,Coordinate_Operation,16366,7302,3-deg Gauss-Kruger 18E,
+677,Coordinate_Operation,16367,7302,3-deg Gauss-Kruger 21E,
+678,Coordinate_Operation,16368,7302,3-deg Gauss-Kruger 24E,
+679,Coordinate_Operation,17348,7302,MGA zone 48,
+680,Coordinate_Operation,17349,7302,MGA zone 49,
+681,Coordinate_Operation,17350,7302,MGA zone 50,
+682,Coordinate_Operation,17351,7302,MGA zone 51,
+683,Coordinate_Operation,17352,7302,MGA zone 52,
+684,Coordinate_Operation,17353,7302,MGA zone 53,
+685,Coordinate_Operation,17354,7302,MGA zone 54,
+686,Coordinate_Operation,17355,7302,MGA zone 55,
+687,Coordinate_Operation,17356,7302,MGA zone 56,
+688,Coordinate_Operation,17357,7302,MGA zone 57,
+689,Coordinate_Operation,17358,7302,MGA zone 58,
+690,Coordinate_Operation,17448,7302,AMG zone 48,
+691,Coordinate_Operation,17449,7302,AMG zone 49,
+692,Coordinate_Operation,17450,7302,AMG zone 50,
+693,Coordinate_Operation,17451,7302,AMG zone 51,
+694,Coordinate_Operation,17452,7302,AMG zone 52,
+695,Coordinate_Operation,17453,7302,AMG zone 53,
+696,Coordinate_Operation,17454,7302,AMG zone 54,
+697,Coordinate_Operation,17455,7302,AMG zone 55,
+698,Coordinate_Operation,17456,7302,AMG zone 56,
+699,Coordinate_Operation,17457,7302,AMG zone 57,
+700,Coordinate_Operation,17458,7302,AMG zone 58,
+701,Coordinate_Operation,17515,7302,S. African Grid zone 15,
+702,Coordinate_Operation,17517,7302,S. African Grid zone 17,
+703,Coordinate_Operation,17519,7302,S. African Grid zone 19,
+704,Coordinate_Operation,17521,7302,S. African Grid zone 21,
+705,Coordinate_Operation,17523,7302,S. African Grid zone 23,
+706,Coordinate_Operation,17525,7302,S. African Grid zone 25,
+707,Coordinate_Operation,17527,7302,S. African Grid zone 27,
+708,Coordinate_Operation,17529,7302,S. African Grid zone 29,
+709,Coordinate_Operation,17531,7302,S. African Grid zone 31,
+710,Coordinate_Operation,17533,7302,S. African Grid zone 33,
+711,Coordinate_Operation,17611,7302,SW African Grid zone 11,
+712,Coordinate_Operation,17613,7302,SW African Grid zone 13,
+713,Coordinate_Operation,17615,7302,SW African Grid zone 15,
+714,Coordinate_Operation,17617,7302,SW African Grid zone 17,
+715,Coordinate_Operation,17619,7302,SW African Grid zone 19,
+716,Coordinate_Operation,17621,7302,SW African Grid zone 21,
+717,Coordinate_Operation,17623,7302,SW African Grid zone 23,
+718,Coordinate_Operation,17625,7302,SW African Grid zone 25,
+719,Coordinate_Operation,17702,7302,MTM zone 2,
+720,Coordinate_Operation,17801,7302,Japan zone I,
+721,Coordinate_Operation,17802,7302,Japan zone II,
+722,Coordinate_Operation,17803,7302,Japan zone III,
+723,Coordinate_Operation,17804,7302,Japan zone IV,
+724,Coordinate_Operation,17805,7302,Japan zone V,
+725,Coordinate_Operation,17806,7302,Japan zone VI,
+726,Coordinate_Operation,17807,7302,Japan zone VII,
+727,Coordinate_Operation,17808,7302,Japan zone VIII,
+728,Coordinate_Operation,17809,7302,Japan zone IX,
+729,Coordinate_Operation,17810,7302,Japan zone X,
+730,Coordinate_Operation,17811,7302,Japan zone XI,
+731,Coordinate_Operation,17812,7302,Japan zone XII,
+732,Coordinate_Operation,17813,7302,Japan zone XIII,
+733,Coordinate_Operation,17814,7302,Japan zone XIV,
+734,Coordinate_Operation,17815,7302,Japan zone XV,
+735,Coordinate_Operation,17816,7302,Japan zone XVI,
+736,Coordinate_Operation,17817,7302,Japan zone XVII,
+737,Coordinate_Operation,17818,7302,Japan zone XVIII,
+738,Coordinate_Operation,17901,7302,Mt Eden Circuit,
+739,Coordinate_Operation,17920,7302,Mt Pleasant Circuit,
+740,Coordinate_Operation,17924,7302,Mt Nicholas Circuit,
+741,Coordinate_Operation,17925,7302,Mt York Circuit,
+742,Coordinate_Operation,17926,7302,Observation Pt Circuit,
+743,Coordinate_Operation,18031,7302,Argentina 1,
+744,Coordinate_Operation,18032,7302,Argentina 2,
+745,Coordinate_Operation,18033,7302,Argentina 3,
+746,Coordinate_Operation,18034,7302,Argentina 4,
+747,Coordinate_Operation,18035,7302,Argentina 5,
+748,Coordinate_Operation,18036,7302,Argentina 6,
+749,Coordinate_Operation,18037,7302,Argentina 7,
+750,Coordinate_Operation,18044,7302,M28,
+751,Coordinate_Operation,18045,7302,M31,
+752,Coordinate_Operation,18046,7302,M34,
+753,Coordinate_Operation,18051,7302,Colombia 3W,
+754,Coordinate_Operation,18052,7302,Colombia Bogota,
+755,Coordinate_Operation,18053,7302,Colombia 3E,
+756,Coordinate_Operation,18054,7302,Colombia 6E,
+757,Coordinate_Operation,18071,7302,Blue Belt,
+758,Coordinate_Operation,18072,7302,Red Belt,
+759,Coordinate_Operation,18073,7302,Purple Belt,
+760,Coordinate_Operation,18074,7302,Extended Purple Belt,
+761,Coordinate_Operation,18141,7302,North Island Grid,
+762,Coordinate_Operation,18142,7302,South Island Grid,
+763,Coordinate_Operation,18193,7302,Finland zone 3,
+764,Coordinate_Operation,18203,7302,ICS,
+765,Coordinate_Operation,18204,7302,ITM,
+766,Coordinate_Operation,18231,7302,India zone I,
+767,Coordinate_Operation,18232,7302,India zone IIa,
+768,Coordinate_Operation,18233,7302,India zone IIIa,
+769,Coordinate_Operation,18234,7302,India zone IVa,
+770,Coordinate_Operation,18235,7302,India zone IIb,
+771,Coordinate_Operation,18236,7302,India zone I,
+772,Coordinate_Operation,18237,7302,India zone IIa,
+773,Coordinate_Operation,18238,7302,India zone IIb,
+774,Coordinate_Operation,19900,7302,Bahrain Grid,
+775,Coordinate_Operation,19905,7302,NEIEZ,
+776,Coordinate_Operation,19917,7302,NZMG,
+777,Coordinate_Operation,19922,7302,LV03,
+778,Coordinate_Operation,19923,7302,LV03C,
+779,Coordinate_Operation,19928,7302,KTM,
+780,Coordinate_Operation,19929,7302,2.5 gon West,
+781,Coordinate_Operation,19931,7302,EOV,
+782,Coordinate_Operation,19933,7302,PEI Stereographic ATS77,
+783,Coordinate_Operation,19935,7302,R.S.O. Malaya,
+784,Coordinate_Operation,19945,7302,NB Stereographic ATS77,
+785,Coordinate_Operation,19946,7302,NB Stereographic NAD83,
+786,Coordinate_Operation,19950,7302,LV95,
+787,Coordinate_Operation,19951,7302,Nakhl e Taqi,
+788,Coordinate_Operation,19956,7302,R.S.O. Borneo (chSe),
+789,Coordinate_Operation,19957,7302,R.S.O. Borneo (ftSe),
+790,Coordinate_Operation,19958,7302,R.S.O. Borneo (m),
+791,Coordinate_Operation,19960,7302,PEI Stereographic NAD83,
+792,Coordinate_Operation,19962,7302,ITM,
+793,Coordinate Reference System,20004,7302,1995 Coord. Sys. zone 4,
+794,Coordinate Reference System,20005,7302,1995 Coord. Sys. zone 5,
+795,Coordinate Reference System,20006,7302,1995 Coord. Sys. zone 6,
+796,Coordinate Reference System,20007,7302,1995 Coord. Sys. zone 7,
+797,Coordinate Reference System,20008,7302,1995 Coord. Sys. zone 8,
+798,Coordinate Reference System,20009,7302,1995 Coord. Sys. zone 9,
+799,Coordinate Reference System,20010,7302,1995 Coord. Sys. zone 10,
+800,Coordinate Reference System,20011,7302,1995 Coord. Sys. zone 11,
+801,Coordinate Reference System,20012,7302,1995 Coord. Sys. zone 12,
+802,Coordinate Reference System,20013,7302,1995 Coord. Sys. zone 13,
+803,Coordinate Reference System,20014,7302,1995 Coord. Sys. zone 14,
+804,Coordinate Reference System,20015,7302,1995 Coord. Sys. zone 15,
+805,Coordinate Reference System,20016,7302,1995 Coord. Sys. zone 16,
+806,Coordinate Reference System,20017,7302,1995 Coord. Sys. zone 17,
+807,Coordinate Reference System,20018,7302,1995 Coord. Sys. zone 18,
+808,Coordinate Reference System,20019,7302,1995 Coord. Sys. zone 19,
+809,Coordinate Reference System,20020,7302,1995 Coord. Sys. zone 20,
+810,Coordinate Reference System,20021,7302,1995 Coord. Sys. zone 21,
+811,Coordinate Reference System,20022,7302,1995 Coord. Sys. zone 22,
+812,Coordinate Reference System,20023,7302,1995 Coord. Sys. zone 23,
+813,Coordinate Reference System,20024,7302,1995 Coord. Sys. zone 24,
+814,Coordinate Reference System,20025,7302,1995 Coord. Sys. zone 25,
+815,Coordinate Reference System,20026,7302,1995 Coord. Sys. zone 26,
+816,Coordinate Reference System,20027,7302,1995 Coord. Sys. zone 27,
+817,Coordinate Reference System,20028,7302,1995 Coord. Sys. zone 28,
+818,Coordinate Reference System,20029,7302,1995 Coord. Sys. zone 29,
+819,Coordinate Reference System,20030,7302,1995 Coord. Sys. zone 30,
+820,Coordinate Reference System,20031,7302,1995 Coord. Sys. zone 31,
+821,Coordinate Reference System,20032,7302,1995 Coord. Sys. zone 32,
+822,Coordinate Reference System,20064,7302,Pulkovo 1995 / Gauss 4N,
+823,Coordinate Reference System,20065,7302,Pulkovo 1995 / Gauss 5N,
+824,Coordinate Reference System,20066,7302,Pulkovo 1995 / Gauss 6N,
+825,Coordinate Reference System,20067,7302,Pulkovo 1995 / Gauss 7N,
+826,Coordinate Reference System,20068,7302,Pulkovo 1995 / Gauss 8N,
+827,Coordinate Reference System,20069,7302,Pulkovo 1995 / Gauss 9N,
+828,Coordinate Reference System,20070,7302,Pulkovo 1995 / Gauss 10N,
+829,Coordinate Reference System,20071,7302,Pulkovo 1995 / Gauss 11N,
+830,Coordinate Reference System,20072,7302,Pulkovo 1995 / Gauss 12N,
+831,Coordinate Reference System,20073,7302,Pulkovo 1995 / Gauss 13N,
+832,Coordinate Reference System,20074,7302,Pulkovo 1995 / Gauss 14N,
+833,Coordinate Reference System,20075,7302,Pulkovo 1995 / Gauss 15N,
+834,Coordinate Reference System,20076,7302,Pulkovo 1995 / Gauss 16N,
+835,Coordinate Reference System,20077,7302,Pulkovo 1995 / Gauss 17N,
+836,Coordinate Reference System,20078,7302,Pulkovo 1995 / Gauss 18N,
+837,Coordinate Reference System,20079,7302,Pulkovo 1995 / Gauss 19N,
+838,Coordinate Reference System,20080,7302,Pulkovo 1995 / Gauss 20N,
+839,Coordinate Reference System,20081,7302,Pulkovo 1995 / Gauss 21N,
+840,Coordinate Reference System,20082,7302,Pulkovo 1995 / Gauss 22N,
+841,Coordinate Reference System,20083,7302,Pulkovo 1995 / Gauss 23N,
+842,Coordinate Reference System,20084,7302,Pulkovo 1995 / Gauss 24N,
+843,Coordinate Reference System,20085,7302,Pulkovo 1995 / Gauss 25N,
+844,Coordinate Reference System,20086,7302,Pulkovo 1995 / Gauss 26N,
+845,Coordinate Reference System,20087,7302,Pulkovo 1995 / Gauss 27N,
+846,Coordinate Reference System,20088,7302,Pulkovo 1995 / Gauss 28N,
+847,Coordinate Reference System,20089,7302,Pulkovo 1995 / Gauss 29N,
+848,Coordinate Reference System,20090,7302,Pulkovo 1995 / Gauss 30N,
+849,Coordinate Reference System,20091,7302,Pulkovo 1995 / Gauss 31N,
+850,Coordinate Reference System,20092,7302,Pulkovo 1995 / Gauss 32N,
+851,Coordinate Reference System,20437,7302,Ain el Abd / UTM 37N,
+852,Coordinate Reference System,20438,7302,Ain el Abd / UTM 38N,
+853,Coordinate Reference System,20439,7302,Ain el Abd / UTM 39N,
+854,Coordinate Reference System,20790,7302,Lisbon / Portuguese National Grid,
+855,Coordinate Reference System,21100,7302,Batavia / NEIEZ,
+856,Coordinate Reference System,21291,7302,Barbados 1938 / BWI Grid,
+857,Coordinate Reference System,21292,7302,Barbados NationaI Grid,
+858,Coordinate Reference System,21413,7302,Beijing / Gauss zone 13,
+859,Coordinate Reference System,21414,7302,Beijing / Gauss zone 14,
+860,Coordinate Reference System,21415,7302,Beijing / Gauss zone 15,
+861,Coordinate Reference System,21416,7302,Beijing / Gauss zone 16,
+862,Coordinate Reference System,21417,7302,Beijing / Gauss zone 17,
+863,Coordinate Reference System,21418,7302,Beijing / Gauss zone 18,
+864,Coordinate Reference System,21419,7302,Beijing / Gauss zone 19,
+865,Coordinate Reference System,21420,7302,Beijing / Gauss zone 20,
+866,Coordinate Reference System,21421,7302,Beijing / Gauss zone 21,
+867,Coordinate Reference System,21422,7302,Beijing / Gauss zone 22,
+868,Coordinate Reference System,21423,7302,Beijing / Gauss zone 23,
+869,Coordinate Reference System,21473,7302,Beijing / Gauss 13N,
+870,Coordinate Reference System,21474,7302,Beijing / Gauss 14N,
+871,Coordinate Reference System,21475,7302,Beijing / Gauss 15N,
+872,Coordinate Reference System,21476,7302,Beijing / Gauss 16N,
+873,Coordinate Reference System,21477,7302,Beijing / Gauss 17N,
+874,Coordinate Reference System,21478,7302,Beijing / Gauss 18N,
+875,Coordinate Reference System,21479,7302,Beijing / Gauss 19N,
+876,Coordinate Reference System,21480,7302,Beijing / Gauss 20N,
+877,Coordinate Reference System,21481,7302,Beijing / Gauss 21N,
+878,Coordinate Reference System,21482,7302,Beijing / Gauss 22N,
+879,Coordinate Reference System,21483,7302,Beijing / Gauss 23N,
+880,Coordinate Reference System,21500,7302,Belge Lambert 50,
+881,Coordinate Reference System,21780,7302,LV03C,
+882,Coordinate Reference System,21781,7302,LV03,
+883,Coordinate Reference System,21891,7302,Bogota / Colombia 3W,
+884,Coordinate Reference System,21892,7302,Bogota / Colombia Bogota,
+885,Coordinate Reference System,21893,7302,Bogota / Colombia 3E,
+886,Coordinate Reference System,21894,7302,Bogota / Colombia 6E,
+887,Coordinate Reference System,22191,7302,C Inchauspe /Argentina 1,
+888,Coordinate Reference System,22192,7302,C Inchauspe /Argentina 2,
+889,Coordinate Reference System,22193,7302,C Inchauspe /Argentina 3,
+890,Coordinate Reference System,22194,7302,C Inchauspe /Argentina 4,
+891,Coordinate Reference System,22195,7302,C Inchauspe /Argentina 5,
+892,Coordinate Reference System,22196,7302,C Inchauspe /Argentina 6,
+893,Coordinate Reference System,22197,7302,C Inchauspe /Argentina 7,
+894,Coordinate Reference System,22275,7302,South African CS zone 15,
+895,Coordinate Reference System,22277,7302,South African CS zone 17,
+896,Coordinate Reference System,22279,7302,South African CS zone 19,
+897,Coordinate Reference System,22281,7302,South African CS zone 21,
+898,Coordinate Reference System,22283,7302,South African CS zone 23,
+899,Coordinate Reference System,22285,7302,South African CS zone 25,
+900,Coordinate Reference System,22287,7302,South African CS zone 27,
+901,Coordinate Reference System,22289,7302,South African CS zone 29,
+902,Coordinate Reference System,22291,7302,South African CS zone 31,
+903,Coordinate Reference System,22293,7302,South African CS zone 33,
+904,Coordinate Reference System,22300,7302,Tunisia Mining Grid,
+905,Coordinate Reference System,22523,7302,Corrego Alegre / UTM 23S,
+906,Coordinate Reference System,22524,7302,Corrego Alegre / UTM 24S,
+907,Coordinate Reference System,22994,7302,Egypt 1907 / Ext. Purple,
+908,Coordinate Reference System,23946,7302,Indian 1954 / UTM 46N,
+909,Coordinate Reference System,23947,7302,Indian 1954 / UTM 47N,
+910,Coordinate Reference System,23948,7302,Indian 1954 / UTM 48N,
+911,Coordinate Reference System,24047,7302,Indian 1975 / UTM 47N,
+912,Coordinate Reference System,24048,7302,Indian 1975 / UTM 48N,
+913,Coordinate Reference System,24100,7302,Jamaica 1875 / Old Grid,
+914,Coordinate Reference System,24200,7302,JAD69 / Jamaica Grid,
+915,Coordinate Reference System,24305,7302,Kalianpur 37 / UTM 45N,
+916,Coordinate Reference System,24306,7302,Kalianpur 37 / UTM 46N,
+917,Coordinate Reference System,24311,7302,Kalianpur 62 / UTM 41N,
+918,Coordinate Reference System,24312,7302,Kalianpur 62 / UTM 42N,
+919,Coordinate Reference System,24313,7302,Kalianpur 62 / UTM 43N,
+920,Coordinate Reference System,24342,7302,Kalianpur 75 / UTM 42N,
+921,Coordinate Reference System,24343,7302,Kalianpur 75 / UTM 43N,
+922,Coordinate Reference System,24344,7302,Kalianpur 75 / UTM 44N,
+923,Coordinate Reference System,24345,7302,Kalianpur 75 / UTM 45N,
+924,Coordinate Reference System,24346,7302,Kalianpur 75 / UTM 46N,
+925,Coordinate Reference System,24347,7302,Kalianpur 75 / UTM 47N,
+926,Coordinate Reference System,24370,7302,Kalianpur / India 0,
+927,Coordinate Reference System,24371,7302,Kalianpur / India I,
+928,Coordinate Reference System,24372,7302,Kalianpur / India IIa,
+929,Coordinate Reference System,24373,7302,Kalianpur / India III,
+930,Coordinate Reference System,24374,7302,Kalianpur / India IV,
+931,Coordinate Reference System,24375,7302,Kalianpur 37 / India IIb,
+932,Coordinate Reference System,24376,7302,Kalianpur 62 / India I,
+933,Coordinate Reference System,24377,7302,Kalianpur 62 / India IIa,
+934,Coordinate Reference System,24378,7302,Kalianpur 75 / India I,
+935,Coordinate Reference System,24379,7302,Kalianpur 75 / India IIa,
+936,Coordinate Reference System,24380,7302,Kalianpur 75 / India IIb,
+937,Coordinate Reference System,24381,7302,Kalianpur 75 / India III,
+938,Coordinate Reference System,24382,7302,Kalianpur / India IIb,
+939,Coordinate Reference System,24383,7302,Kalianpur 75 / India IV,
+940,Coordinate Reference System,24892,7302,PSAD56 / Peru central,
+941,Coordinate Reference System,25000,7302,Leigon / Ghana Grid,
+942,Coordinate Reference System,25391,7302,Luzon / Philippines I,
+943,Coordinate Reference System,25392,7302,Luzon / Philippines II,
+944,Coordinate Reference System,25393,7302,Luzon / Philippines III,
+945,Coordinate Reference System,25394,7302,Luzon / Philippines IV,
+946,Coordinate Reference System,25395,7302,Luzon / Philippines V,
+947,Coordinate Reference System,25700,7302,Makassar / NEIEZ,
+948,Coordinate Reference System,25932,7302,Malongo 1987 / UTM 32S,
+949,Coordinate Reference System,26391,7302,Minna / Nigeria West,
+950,Coordinate Reference System,26393,7302,Minna / Nigeria East,
+951,Coordinate Reference System,26591,7302,Monte Mario / Italy 1,
+952,Coordinate Reference System,26592,7302,Monte Mario / Italy 2,
+953,Coordinate Reference System,26632,7302,M'poraloko / UTM 32N,
+954,Coordinate Reference System,26692,7302,M'poraloko / UTM 32S,
+955,Coordinate Reference System,26741,7302,NAD27 / California I,
+956,Coordinate Reference System,26742,7302,NAD27 / California II,
+957,Coordinate Reference System,26743,7302,NAD27 / California III,
+958,Coordinate Reference System,26744,7302,NAD27 / California IV,
+959,Coordinate Reference System,26745,7302,NAD27 / California V,
+960,Coordinate Reference System,26746,7302,NAD27 / California VI,
+961,Coordinate Reference System,26747,7302,NAD27 / California VII,
+962,Coordinate Reference System,26786,7302,NAD27 / Massachusetts,
+963,Coordinate Reference System,26787,7302,NAD27 / Massachusetts Is,
+964,Coordinate Reference System,26792,7302,NAD27 / Minnesota Cent.,
+965,Coordinate Reference System,26801,7302,NAD27 / Michigan East,
+966,Coordinate Reference System,26802,7302,NAD27 / Michigan Old Cen,
+967,Coordinate Reference System,26803,7302,NAD27 / Michigan West,
+968,Coordinate Reference System,26811,7302,NAD27 / Michigan North,
+969,Coordinate Reference System,26812,7302,NAD27 / Michigan Central,
+970,Coordinate Reference System,26813,7302,NAD27 / Michigan South,
+971,Coordinate Reference System,26941,7302,NAD83 / California 1,
+972,Coordinate Reference System,26942,7302,NAD83 / California 2,
+973,Coordinate Reference System,26943,7302,NAD83 / California 3,
+974,Coordinate Reference System,26944,7302,NAD83 / California 4,
+975,Coordinate Reference System,26945,7302,NAD83 / California 5,
+976,Coordinate Reference System,26946,7302,NAD83 / California 6,
+977,Coordinate Reference System,26986,7302,NAD83 / Massachusetts,
+978,Coordinate Reference System,26987,7302,NAD83 / Massachusetts Is,
+979,Coordinate Reference System,26992,7302,NAD83 / Minnesota Cent.,
+980,Coordinate Reference System,27038,7302,Nahrwan 1967 / UTM 38N,
+981,Coordinate Reference System,27039,7302,Nahrwan 1967 / UTM 39N,
+982,Coordinate Reference System,27040,7302,Nahrwan 1967 / UTM 40N,
+983,Coordinate Reference System,27120,7302,Naparima 1972 / UTM 20N,
+984,Coordinate Reference System,27200,7302,GD49 / NZ Map Grid,
+985,Coordinate Reference System,27391,7302,NGO 1948 / I,
+986,Coordinate Reference System,27392,7302,NGO 1948 / II,
+987,Coordinate Reference System,27393,7302,NGO 1948 / III,
+988,Coordinate Reference System,27394,7302,NGO 1948 / IV,
+989,Coordinate Reference System,27395,7302,NGO 1948 / V,
+990,Coordinate Reference System,27396,7302,NGO 1948 / VI,
+991,Coordinate Reference System,27397,7302,NGO 1948 / VII,
+992,Coordinate Reference System,27398,7302,NGO 1948 / VIII,
+993,Coordinate Reference System,27500,7302,ATF / Nord de Guerre,
+994,Coordinate Reference System,27581,7302,NTF / France I,
+995,Coordinate Reference System,27582,7302,NTF / France II,
+996,Coordinate Reference System,27583,7302,NTF / France III,
+997,Coordinate Reference System,27584,7302,NTF / France IV,
+998,Coordinate Reference System,27591,7302,NTF / Nord France,
+999,Coordinate Reference System,27592,7302,NTF / Centre France,
+1000,Coordinate Reference System,27593,7302,NTF / Sud France,
+1001,Coordinate Reference System,27594,7302,NTF / Corse,
+1002,Coordinate Reference System,27700,7302,British National Grid,
+1003,Coordinate Reference System,28191,7302,Palestine Grid,
+1004,Coordinate Reference System,28192,7302,Palestine Belt,
+1005,Coordinate Reference System,28193,7302,Israeli CS Grid,
+1006,Coordinate Reference System,28232,7302,Point Noire / UTM 32S,
+1007,Coordinate Reference System,28402,7302,1942 Coord. Sys. zone 2,
+1008,Coordinate Reference System,28403,7302,1942 Coord. Sys. zone 3,
+1009,Coordinate Reference System,28404,7302,1942 Coord. Sys. zone 4,
+1010,Coordinate Reference System,28405,7302,1942 Coord. Sys. zone 5,
+1011,Coordinate Reference System,28406,7302,1942 Coord. Sys. zone 6,
+1012,Coordinate Reference System,28407,7302,1942 Coord. Sys. zone 7,
+1013,Coordinate Reference System,28408,7302,1942 Coord. Sys. zone 8,
+1014,Coordinate Reference System,28409,7302,1942 Coord. Sys. zone 9,
+1015,Coordinate Reference System,28410,7302,1942 Coord. Sys. zone 10,
+1016,Coordinate Reference System,28411,7302,1942 Coord. Sys. zone 11,
+1017,Coordinate Reference System,28412,7302,1942 Coord. Sys. zone 12,
+1018,Coordinate Reference System,28413,7302,1942 Coord. Sys. zone 13,
+1019,Coordinate Reference System,28414,7302,1942 Coord. Sys. zone 14,
+1020,Coordinate Reference System,28415,7302,1942 Coord. Sys. zone 15,
+1021,Coordinate Reference System,28416,7302,1942 Coord. Sys. zone 16,
+1022,Coordinate Reference System,28417,7302,1942 Coord. Sys. zone 17,
+1023,Coordinate Reference System,28418,7302,1942 Coord. Sys. zone 18,
+1024,Coordinate Reference System,28419,7302,1942 Coord. Sys. zone 19,
+1025,Coordinate Reference System,28420,7302,1942 Coord. Sys. zone 20,
+1026,Coordinate Reference System,28421,7302,1942 Coord. Sys. zone 21,
+1027,Coordinate Reference System,28422,7302,1942 Coord. Sys. zone 22,
+1028,Coordinate Reference System,28423,7302,1942 Coord. Sys. zone 23,
+1029,Coordinate Reference System,28424,7302,1942 Coord. Sys. zone 24,
+1030,Coordinate Reference System,28425,7302,1942 Coord. Sys. zone 25,
+1031,Coordinate Reference System,28426,7302,1942 Coord. Sys. zone 26,
+1032,Coordinate Reference System,28427,7302,1942 Coord. Sys. zone 27,
+1033,Coordinate Reference System,28428,7302,1942 Coord. Sys. zone 28,
+1034,Coordinate Reference System,28429,7302,1942 Coord. Sys. zone 29,
+1035,Coordinate Reference System,28430,7302,1942 Coord. Sys. zone 30,
+1036,Coordinate Reference System,28431,7302,1942 Coord. Sys. zone 31,
+1037,Coordinate Reference System,28432,7302,1942 Coord. Sys. zone 32,
+1038,Coordinate Reference System,28462,7302,Pulkovo / Gauss 2N,
+1039,Coordinate Reference System,28463,7302,Pulkovo / Gauss 3N,
+1040,Coordinate Reference System,28464,7302,Pulkovo / Gauss 4N,
+1041,Coordinate Reference System,28465,7302,Pulkovo / Gauss 5N,
+1042,Coordinate Reference System,28466,7302,Pulkovo / Gauss 6N,
+1043,Coordinate Reference System,28467,7302,Pulkovo / Gauss 7N,
+1044,Coordinate Reference System,28468,7302,Pulkovo / Gauss 8N,
+1045,Coordinate Reference System,28469,7302,Pulkovo / Gauss 9N,
+1046,Coordinate Reference System,28470,7302,Pulkovo / Gauss 10N,
+1047,Coordinate Reference System,28471,7302,Pulkovo / Gauss 11N,
+1048,Coordinate Reference System,28472,7302,Pulkovo / Gauss 12N,
+1049,Coordinate Reference System,28473,7302,Pulkovo / Gauss 13N,
+1050,Coordinate Reference System,28474,7302,Pulkovo / Gauss 14N,
+1051,Coordinate Reference System,28475,7302,Pulkovo / Gauss 15N,
+1052,Coordinate Reference System,28476,7302,Pulkovo / Gauss 16N,
+1053,Coordinate Reference System,28477,7302,Pulkovo / Gauss 17N,
+1054,Coordinate Reference System,28478,7302,Pulkovo / Gauss 18N,
+1055,Coordinate Reference System,28479,7302,Pulkovo / Gauss 19N,
+1056,Coordinate Reference System,28480,7302,Pulkovo / Gauss 20N,
+1057,Coordinate Reference System,28481,7302,Pulkovo / Gauss 21N,
+1058,Coordinate Reference System,28482,7302,Pulkovo / Gauss 22N,
+1059,Coordinate Reference System,28483,7302,Pulkovo / Gauss 23N,
+1060,Coordinate Reference System,28484,7302,Pulkovo / Gauss 24N,
+1061,Coordinate Reference System,28485,7302,Pulkovo / Gauss 25N,
+1062,Coordinate Reference System,28486,7302,Pulkovo / Gauss 26N,
+1063,Coordinate Reference System,28487,7302,Pulkovo / Gauss 27N,
+1064,Coordinate Reference System,28488,7302,Pulkovo / Gauss 28N,
+1065,Coordinate Reference System,28489,7302,Pulkovo / Gauss 29N,
+1066,Coordinate Reference System,28490,7302,Pulkovo / Gauss 30N,
+1067,Coordinate Reference System,28491,7302,Pulkovo / Gauss 31N,
+1068,Coordinate Reference System,28492,7302,Pulkovo / Gauss 32N,
+1069,Coordinate Reference System,28600,7302,Qatar National Grid,
+1070,Coordinate Reference System,29220,7302,Sapper Hill / UTM 20S,
+1071,Coordinate Reference System,29221,7302,Sapper Hill / UTM 21S,
+1072,Coordinate Reference System,29333,7302,Schwarzeck / UTM 33S,
+1073,Coordinate Reference System,29371,7302,SW African CS zone 11,
+1074,Coordinate Reference System,29373,7302,SW African CS zone 13,
+1075,Coordinate Reference System,29375,7302,SW African CS zone 15,
+1076,Coordinate Reference System,29377,7302,SW African CS zone 17,
+1077,Coordinate Reference System,29379,7302,SW African CS zone 19,
+1078,Coordinate Reference System,29381,7302,SW African CS zone 21,
+1079,Coordinate Reference System,29383,7302,SW African CS zone 23,
+1080,Coordinate Reference System,29385,7302,SW African CS zone 25,
+1081,Coordinate Reference System,29700,7302,Tananarive  / Laborde,
+1082,Coordinate Reference System,29738,7302,Tananarive / UTM 38S,
+1083,Coordinate Reference System,29739,7302,Tananarive / UTM 39S,
+1084,Coordinate Reference System,29849,7302,Timbalai 1948 / UTM 49N,
+1085,Coordinate Reference System,29850,7302,Timbalai 1948 / UTM 50N,
+1086,Coordinate Reference System,29871,7302,Timbalai  / Borneo (ch),
+1087,Coordinate Reference System,29872,7302,Timbalai  / Borneo (ft),
+1088,Coordinate Reference System,29873,7302,Timbalai  / Borneo (m),
+1089,Coordinate Reference System,29900,7302,TM65 / Irish Nat Grid,
+1090,Coordinate Reference System,30161,7302,Tokyo / Japan zone I,
+1091,Coordinate Reference System,30162,7302,Tokyo / Japan zone II,
+1092,Coordinate Reference System,30163,7302,Tokyo / Japan zone III,
+1093,Coordinate Reference System,30164,7302,Tokyo / Japan zone IV,
+1094,Coordinate Reference System,30165,7302,Tokyo / Japan zone V,
+1095,Coordinate Reference System,30166,7302,Tokyo / Japan zone VI,
+1096,Coordinate Reference System,30167,7302,Tokyo / Japan zone VII,
+1097,Coordinate Reference System,30168,7302,Tokyo / Japan zone VIII,
+1098,Coordinate Reference System,30169,7302,Tokyo / Japan zone IX,
+1099,Coordinate Reference System,30170,7302,Tokyo / Japan zone X,
+1100,Coordinate Reference System,30171,7302,Tokyo / Japan zone XI,
+1101,Coordinate Reference System,30172,7302,Tokyo / Japan zone XII,
+1102,Coordinate Reference System,30173,7302,Tokyo / Japan zone XIII,
+1103,Coordinate Reference System,30174,7302,Tokyo / Japan zone XIV,
+1104,Coordinate Reference System,30175,7302,Tokyo / Japan zone XV,
+1105,Coordinate Reference System,30176,7302,Tokyo / Japan zone XVI,
+1106,Coordinate Reference System,30177,7302,Tokyo / Japan zone XVII,
+1107,Coordinate Reference System,30178,7302,Tokyo / Japan zone XVIII,
+1108,Coordinate Reference System,30200,7302,Trinidad 1903 / Trinidad,
+1109,Coordinate Reference System,30491,7302,Voirol /N Algerie ancien,
+1110,Coordinate Reference System,30492,7302,Voirol /S Algerie ancien,
+1111,Coordinate Reference System,30729,7302,Nord Sahara / UTM 29N,
+1112,Coordinate Reference System,30730,7302,Nord Sahara / UTM 30N,
+1113,Coordinate Reference System,30731,7302,Nord Sahara / UTM 31N,
+1114,Coordinate Reference System,30732,7302,Nord Sahara / UTM 32N,
+1115,Coordinate Reference System,30791,7302,Nord Sahara / N Algerie,
+1116,Coordinate Reference System,30792,7302,Nord Sahara / S Algerie,
+1117,Coordinate Reference System,31265,7302,MGI / Gauss zone 5,
+1118,Coordinate Reference System,31266,7302,MGI / Gauss zone 6,
+1119,Coordinate Reference System,31267,7302,MGI / Gauss zone 7,
+1120,Coordinate Reference System,31268,7302,MGI / Gauss zone 8,
+1121,Coordinate Reference System,31291,7302,MGI / Austria West,
+1122,Coordinate Reference System,31292,7302,MGI / Austria Central,
+1123,Coordinate Reference System,31293,7302,MGI / Austria East,
+1124,Coordinate Reference System,31370,7302,BD 72 / Lambert 72,
+1125,Coordinate Reference System,31461,7302,DHDN / Gauss zone 1,
+1126,Coordinate Reference System,31462,7302,DHDN / Gauss zone 2,
+1127,Coordinate Reference System,31463,7302,DHDN / Gauss zone 3,
+1128,Coordinate Reference System,31464,7302,DHDN / Gauss zone 4,
+1129,Coordinate Reference System,31465,7302,DHDN / Gauss zone 5,
+1130,Coordinate Reference System,31600,7302,Stereo 33,
+1131,Coordinate Reference System,31700,7302,Stereo 70,
+1132,Coordinate Reference System,32013,7302,NAD27 / New Mexico Cent.,
+1133,Coordinate Reference System,32018,7302,NAD27 / New York Long Is,
+1134,Coordinate Reference System,32020,7302,NAD27 / North Dakota N,
+1135,Coordinate Reference System,32021,7302,NAD27 / North Dakota S,
+1136,Coordinate Reference System,32028,7302,NAD27 / Pennsylvania N,
+1137,Coordinate Reference System,32029,7302,NAD27 / Pennsylvania S,
+1138,Coordinate Reference System,32031,7302,NAD27 / South Carolina N,
+1139,Coordinate Reference System,32033,7302,NAD27 / South Carolina S,
+1140,Coordinate Reference System,32034,7302,NAD27 / South Dakota N,
+1141,Coordinate Reference System,32035,7302,NAD27 / South Dakota S,
+1142,Coordinate Reference System,32038,7302,NAD27 / Texas North Cen.,
+1143,Coordinate Reference System,32040,7302,NAD27 / Texas South Cen.,
+1144,Coordinate Reference System,32050,7302,NAD27 / West Virginia N,
+1145,Coordinate Reference System,32051,7302,NAD27 / West Virginia S,
+1146,Coordinate Reference System,32053,7302,NAD27 / Wisconsin Cen.,
+1147,Coordinate Reference System,32056,7302,NAD27 / Wyoming E. Cen.,
+1148,Coordinate Reference System,32057,7302,NAD27 / Wyoming W. Cen.,
+1149,Coordinate Reference System,32113,7302,NAD83 / New Mexico Cent.,
+1150,Coordinate Reference System,32118,7302,NAD83 / New York Long Is,
+1151,Coordinate Reference System,32120,7302,NAD83 / North Dakota N,
+1152,Coordinate Reference System,32121,7302,NAD83 / North Dakota S,
+1153,Coordinate Reference System,32128,7302,NAD83 / Pennsylvania N,
+1154,Coordinate Reference System,32129,7302,NAD83 / Pennsylvania S,
+1155,Coordinate Reference System,32134,7302,NAD83 / South Dakota N,
+1156,Coordinate Reference System,32135,7302,NAD83 / South Dakota S,
+1157,Coordinate Reference System,32138,7302,NAD83 / Texas North Cen.,
+1158,Coordinate Reference System,32140,7302,NAD83 / Texas South Cen.,
+1159,Coordinate Reference System,32150,7302,NAD83 / West Virginia N,
+1160,Coordinate Reference System,32151,7302,NAD83 / West Virginia S,
+1161,Coordinate Reference System,32153,7302,NAD83 / Wisconsin Cen.,
+1162,Coordinate Reference System,32156,7302,NAD83 / Wyoming E. Cen.,
+1163,Coordinate Reference System,32157,7302,NAD83 / Wyoming W. Cen.,
+1164,Unit of Measure,9001,7306,m,
+1165,Unit of Measure,9002,7306,ft,
+1166,Unit of Measure,9003,7306,ftUS,
+1167,Unit of Measure,9005,7306,ftCla,
+1168,Unit of Measure,9014,7306,fathom,
+1169,Unit of Measure,9030,7306,nautmi,
+1170,Unit of Measure,9031,7306,mGer,
+1171,Unit of Measure,9033,7306,chUS,
+1172,Unit of Measure,9034,7306,lkUS,
+1173,Unit of Measure,9035,7306,miUS,
+1174,Unit of Measure,9036,7306,km,
+1175,Unit of Measure,9037,7306,ydCla,
+1176,Unit of Measure,9038,7306,chCla,
+1177,Unit of Measure,9039,7306,lkCla,
+1178,Unit of Measure,9040,7306,ydSe,
+1179,Unit of Measure,9041,7306,ftSe,
+1180,Unit of Measure,9042,7306,chSe,
+1181,Unit of Measure,9043,7306,lkSe,
+1182,Unit of Measure,9050,7306,ydBnA,
+1183,Unit of Measure,9051,7306,ftBnA,
+1184,Unit of Measure,9052,7306,chBnA,
+1185,Unit of Measure,9053,7306,lkBnA,
+1186,Unit of Measure,9060,7306,ydBnB,
+1187,Unit of Measure,9061,7306,ftBnB,
+1188,Unit of Measure,9062,7306,chBnB,
+1189,Unit of Measure,9063,7306,lkBnB,
+1190,Unit of Measure,9070,7306,ftBr(65),
+1191,Unit of Measure,9080,7306,ftInd,
+1192,Unit of Measure,9081,7306,ftInd(37),
+1193,Unit of Measure,9082,7306,ftInd(62),
+1194,Unit of Measure,9083,7306,ftInd(75),
+1195,Unit of Measure,9084,7306,ydInd,
+1196,Unit of Measure,9085,7306,ydInd(37),
+1197,Unit of Measure,9086,7306,ydInd(62),
+1198,Unit of Measure,9087,7306,ydInd(75),
+1199,Unit of Measure,9093,7306,mi,
+1200,Unit of Measure,9094,7306,ftGC,
+1201,Unit of Measure,9101,7306,rad,
+1202,Unit of Measure,9102,7306,dega,
+1203,Unit of Measure,9103,7306,mina,
+1204,Unit of Measure,9104,7306,seca,
+1205,Unit of Measure,9105,7306,gr,
+1206,Unit of Measure,9106,7306,gon,
+1207,Unit of Measure,9107,7306,dega,
+1208,Unit of Measure,9108,7306,dega,
+1209,Unit of Measure,9109,7306,urad,
+1210,Unit of Measure,9110,7306,dega,
+1211,Unit of Measure,9111,7306,dega,
+1212,Unit of Measure,9112,7306,cgr,
+1213,Unit of Measure,9113,7306,ccgr,
+1214,Unit of Measure,9114,7306,mila,
+1215,Coordinate_Operation Method,9824,7302,UTM grid system,
+1216,Coordinate Reference System,4143,7301,C�te D'Ivoire,Same alias also applied to Locodjo 1965 (code 4142).
+1217,Coordinate Reference System,4143,7301,Port Bouet,Same alias also applied to Locodjo 1965 (code 4142).
+1218,Coordinate Reference System,4142,7301,Port Bouet,Same alias also applied to Abidjan 1987 (code 4143).
+1219,Coordinate Reference System,4142,7301,C�te D'Ivoire,Same alias also applied to Abidjan 1987 (code 4143).
+1220,Coordinate Reference System,2164,7301,Cote d'Ivoire / TM 5 NW,Same alias used for Abidjan 1987 / TM 5 NW (code 2165).
+1221,Coordinate Reference System,2164,7301,Port Bouet / TM 5 NW,Same alias used for Abidjan 1987 / TM 5 NW (code 2165).
+1222,Coordinate Reference System,2165,7301,Cote d'Ivoire / TM 5 NW,Same alias used for Locodjo 1965 / TM 5 NW (code 2164).
+1223,Coordinate Reference System,2165,7301,Port Bouet / TM 5 NW,Same alias used for Abidjan 1987 / TM 5 NW (code 2165).
+1224,Coordinate_Operation,1588,7301,ED50 to EUREF89 (1),
+1225,Coordinate_Operation,1588,7301,ED50 to ETRF89 (1),
+1227,Coordinate_Operation,1589,7301,ED50 to EUREF89 (3),
+1229,Datum,6181,7301,LUREF,
+1230,Datum,6180,7302,EST97,
+1231,Datum,6179,7301,42/58,
+1232,Datum,6178,7301,42/83,
+1233,Datum,6312,7308,HR1901,
+1234,Datum,6312,7309,D48,
+1235,Coordinate_Operation Method,9807,7301,Gauss-Kruger,
+1236,Coordinate_Operation Method,9807,7302,TM,
+1237,Datum,6818,7301,Jednotn� Trigonometrick� S�te Katastr�ln� (Ferro),
+1238,Coordinate Reference System,2393,7301,KKJ / Basic Coordinate System zone 3,
+1239,Coordinate Reference System,2391,7301,KKJ / Basic Coordinate System zone 1,
+1240,Coordinate Reference System,2392,7301,KKJ / Basic Coordinate System zone 2,
+1241,Coordinate Reference System,2394,7301,KKJ / Basic Coordinate System zone 4,
+1242,Coordinate Reference System,31467,7301,DHDN / 3-degree Gauss-Kruger zone 3,
+1243,Coordinate Reference System,31468,7301,DHDN / 3-degree Gauss-Kruger zone 4,
+1244,Coordinate Reference System,31469,7301,DHDN / 3-degree Gauss-Kruger zone 5,
+1247,Coordinate Reference System,4178,7301,42/83,
+1248,Coordinate Reference System,31466,7301,DHDN / 3-degree Gauss-Kruger zone 2,
+1249,Coordinate Reference System,2166,7301,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 3,
+1250,Coordinate Reference System,2167,7301,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 4,
+1251,Coordinate Reference System,4181,7301,LUREF,
+1253,Coordinate Reference System,4258,7301,EUREF89,
+1254,Coordinate Reference System,2170,7301,EUREF89 / CS92,
+1255,Coordinate Reference System,4312,7308,HR1901,
+1256,Coordinate Reference System,4312,7309,D48,
+1257,Coordinate Reference System,4805,7308,HR1901 (Ferro),
+1258,Coordinate Reference System,4805,7309,D48 (Ferro),
+1259,Coordinate Reference System,31275,7308,HDKS zone 5,HDKS = Hrvatski Drzavni Koordinatni Sustav
+1260,Coordinate Reference System,31276,7308,HDKS zone 6,HDKS = Hrvatski Drzavni Koordinatni Sustav
+1261,Coordinate Reference System,31275,7309,D48 zone 5,
+1262,Coordinate Reference System,2169,7301,LUREF / Gauss,
+1263,Coordinate Reference System,31467,7310,PD/83 / Gauss-Kruger zone 3,PD/83 is the result of the transformation from Pulkovo 1942(83) to DHDN for Thuringen.
+1264,Coordinate Reference System,31468,7310,PD/83 / Gauss-Kruger zone 4,PD/83 is the result of the transformation from Pulkovo 1942(83) to DHDN for Thuringen.
+1265,Coordinate Reference System,31468,7310,RD/83 / Gauss-Kruger zone 4,RD/83 is the result of the transformation from Pulkovo 1942(83) to DHDN for Sachsen.
+1266,Coordinate Reference System,31469,7310,RD/83 / Gauss-Kruger zone 4,RD/83 is the result of the transformation from Pulkovo 1942(83) to DHDN for Sachsen.
+1267,Coordinate_Operation,1620,7308,HR1901 to ETRS89 (2),
+1268,Coordinate_Operation,1619,7307,AT_MGI to ETRS89,
+1269,Coordinate_Operation,1622,7307,CZ_S-JTSK to ETRS89,
+1270,Coordinate_Operation,1620,7307,HR_HDKS to ETRS89,
+1271,Coordinate_Operation,1624,7307,SK_S-JTSK to ETRS89,
+1272,Coordinate_Operation,1626,7307,DK_ED50 to ETRS89,
+1273,Coordinate_Operation,1628,7307,GI_ED50 to ETRS89,
+1274,Coordinate_Operation,1630,7307,ES_ED50 (BAL99) to ETRS89,
+1275,Coordinate_Operation,1632,7307,ES_ED50 (EST99) to ETRS89,
+1276,Coordinate_Operation,1634,7307,ES_ED50 (ZNW99) to ETRS89,
+1277,Coordinate_Operation,1636,7307,TR_ED50 to ETRS89,
+1278,Coordinate_Operation,1638,7307,FI_KKJ to ETRS89,
+1279,Coordinate_Operation,1640,7307,IE_Ireland65 to ETRS89,IE_Ireland65 to ETRS89 applies to the Republic of Ireland. Also referred to in EuroGeographics as NI_Ireland65 to ETRS89 for Northern Ireland.
+1280,Coordinate_Operation,1642,7307,LU_LUREF to ETRS89,
+1281,Coordinate_Operation,1644,7307,PL_42/58 to ETRS89,
+1282,Coordinate_Operation,1646,7307,CH_CH1903 to ETRS89,
+1283,Coordinate_Operation,1647,7307,CH_CH1903+ to ETRS89,
+1284,Coordinate_Operation,1648,7307,EE_L-EST97 to ETRS89,
+1285,Coordinate_Operation,1650,7307,FR_ED50 to ETRS89,
+1286,Coordinate_Operation,1651,7307,FR_NTF to ETRS89,
+1287,Coordinate_Operation,1653,7307,NO_NGO1948 to ETRS89,
+1288,Coordinate_Operation,1657,7307,PT_D73 to ETRS89,
+1289,Coordinate_Operation,1655,7307,PT_DLX(HAY) to ETRS89,
+1290,Coordinate_Operation,1652,7307,BE_BD72 to ETRS89,
+1291,Coordinate Reference System,31282,7302,MGI / Austria Central,
+1292,Coordinate Reference System,31283,7302,MGI / Austria East,
+1293,Coordinate Reference System,31281,7302,MGI / Austria West,
+1294,Datum,6176,7302,AAD98,
+1295,Coordinate Reference System,4176,7302,AAD98,
+1296,Datum,6167,7302,NZGD2000,
+1297,Coordinate Reference System,2193,7302,NZGD2000 / NZTM,
+1298,Coordinate_Operation,19971,7302,NZTM,
+1299,Datum,6186,7302,S-JTSK,
+1300,Datum,5119,7301,Nivellement general de la France,This alias is also used for other datum realisations: see NGF - Lallemand (code 5118) and NGF - IGN78 (code 5120).
+1301,Datum,5119,7301,NGF,This alias is also used for other datum realisations: see NGF - Lallemand (code 5118) and NGF - IGN78 (code 5120).
+1302,Datum,5120,7301,NGF,This alias is also used for other datum realisations: see NGF - Lallemand (code 5118) and NGF - IGN69 (code 5119).
+1303,Datum,5118,7301,NGF,This alias is also used for other datum realisations: see NGF - IGN69 (code 5119) and NGF - IGN78 (code 5120).
+1304,Datum,5120,7301,Nivellement general de la France,This alias is also used for other datum realisations: see NGF - Lallemand (code 5118) and NGF - IGN69 (code 5119).
+1305,Datum,5118,7301,Nivellement general de la France,This alias is also used for other datum realisations: see NGF - IGN69 (code 5119) and NGF - IGN78 (code 5120).
+1306,Datum,6143,7301,C�te D'Ivoire (Ivory Coast),This alias is not unique: it is also used for code 6142.
+1307,Datum,6142,7301,C�te D'Ivoire (Ivory Coast),This alias is not unique: it is also used for code 6143.
+1308,Coordinate Reference System,4300,7301,1975 Mapping Adjustment,
+1309,Coordinate Reference System,2196,7301,EUREF89 / Kp2000 Jutland,
+1310,Coordinate Reference System,2196,7301,System 2000 Jylland zoner,
+1311,Coordinate Reference System,2197,7301,EUREF89 / Kp2000 Zealand,
+1312,Coordinate Reference System,2197,7301,System 2000 Sjaelland zoner,
+1313,Coordinate Reference System,2198,7301,EUREF89 / Kp2000 Bornholm,
+1314,Coordinate Reference System,2198,7301,System 2000 Bornholm zoner,
+1315,Datum,6189,7301,SIRGAS-REGVEN,
+1316,Datum,6189,7302,REGVEN,
+1317,datum,6171,7300,R�seau G�od�sique Fran�ais 1993,
+1318,datum,6172,7300,Posiciones Geod�sicas Argentinas,
+1319,datum,6186,7300,Jednotn� Trigonometrick� S�te Katastr�ln�,
+1320,Coordinate Reference System,4314,7310,PD/83,Used for describing result of transformation from Pulkovo 1942(83) to DHDN for Thuringen.
+1321,Coordinate Reference System,4314,7310,RD/83,Used for describing result of transformation from Pulkovo 1942(83) to DHDN for Sachsen.
+1322,Coordinate_Operation,15304,7302,Arizona East (ft),
+1323,Coordinate_Operation,15305,7302,Arizona Central (ft),
+1324,Coordinate_Operation,15306,7302,Arizona West (ft),
+1325,Coordinate_Operation,15307,7302,California zone 1 (ftUS),
+1326,Coordinate_Operation,15308,7302,California zone 2 (ftUS),
+1327,Coordinate_Operation,15309,7302,California zone 3 (ftUS),
+1328,Coordinate_Operation,15310,7302,California zone 4 (ftUS),
+1329,Coordinate_Operation,15311,7302,California zone 5 (ftUS),
+1330,Coordinate_Operation,15312,7302,California zone 6 (ftUS),
+1331,Coordinate_Operation,15313,7302,Colorado North (ftUS),
+1332,Coordinate_Operation,15314,7302,Colorado Central (ftUS),
+1333,Coordinate_Operation,15315,7302,Colorado South (ftUS),
+1334,Coordinate_Operation,15316,7301,Connecticut (ft US),
+1335,Coordinate_Operation,15317,7302,Delaware (ftUS),
+1336,Coordinate_Operation,15318,7301,Florida East (ft US),
+1337,Coordinate_Operation,15319,7302,Florida West (ftUS),
+1338,Coordinate_Operation,15320,7302,Florida North (ftUS),
+1339,Coordinate_Operation,15321,7302,Georgia East (ftUS),
+1340,Coordinate_Operation,15322,7302,Georgia West (ftUS),
+1341,Coordinate_Operation,15323,7302,Idaho East (ftUS),
+1342,Coordinate_Operation,15324,7302,Idaho Central (ftUS),
+1343,Coordinate_Operation,15325,7302,Idaho West (ftUS),
+1344,Coordinate_Operation,15326,7302,Indiana East (ftUS),
+1345,Coordinate_Operation,15327,7302,Indiana West (ftUS),
+1346,Coordinate_Operation,15328,7302,Kentucky North (ftUS),
+1347,Coordinate_Operation,15329,7302,Kentucky South (ftUS),
+1348,Coordinate_Operation,15330,7302,Maryland (ftUS),
+1349,Coordinate_Operation,15331,7302,Massachusetts Mainland (ftUS),
+1350,Coordinate_Operation,15332,7302,Massachusetts Island (ftUS),
+1351,Coordinate_Operation,15333,7302,Michigan North (ft),
+1352,Coordinate_Operation,15334,7302,Michigan Central (ft),
+1353,Coordinate_Operation,15335,7302,Michigan South (ft),
+1354,Coordinate_Operation,15336,7302,Mississippi East (ftUS),
+1355,Coordinate_Operation,15337,7302,Mississippi West (ftUS),
+1356,Coordinate_Operation,15338,7301,Montana (ftUS),
+1357,Coordinate_Operation,15339,7302,New Mexico East (ftUS),
+1358,Coordinate_Operation,15340,7302,New Mexico Central (ftUS),
+1359,Coordinate_Operation,15341,7302,New Mexico West (ftUS),
+1360,Coordinate_Operation,15342,7302,New York East (ftUS),
+1361,Coordinate_Operation,15343,7302,New York Central (ftUS),
+1362,Coordinate_Operation,15344,7302,New York  West (ftUS),
+1363,Coordinate_Operation,15345,7302,New York Long Island (ftUS),
+1364,Coordinate_Operation,15346,7302,North Carolina (ftUS),
+1365,Coordinate_Operation,15347,7302,North Dakota North (ft),
+1366,Coordinate_Operation,15348,7302,North Dakota South (ft),
+1367,Coordinate_Operation,15349,7302,Oklahoma North (ftUS),
+1368,Coordinate_Operation,15350,7302,Oklahoma South (ftUS),
+1369,Coordinate_Operation,15351,7302,Oregon North (ft),
+1370,Coordinate_Operation,15352,7302,Oregon South (ft),
+1371,Coordinate_Operation,15353,7302,Pennsylvania North (ftUS),
+1372,Coordinate_Operation,15354,7301,Pennsylvania South (ftUS),
+1373,Coordinate_Operation,15355,7302,South Carolina (ft),
+1374,Coordinate_Operation,15356,7302,Tennessee (ftUS),
+1375,Coordinate_Operation,15357,7302,Texas North (ftUS),
+1376,Coordinate_Operation,15358,7302,Texas North Central (ftUS),
+1377,Coordinate_Operation,15359,7302,Texas Central (ftUS),
+1378,Coordinate_Operation,15360,7302,Texas South Central (ftUS),
+1379,Coordinate_Operation,15361,7302,Texas South (ftUS),
+1380,Coordinate_Operation,15362,7302,Utah North (ft),
+1381,Coordinate_Operation,15363,7302,Utah Central (ft),
+1382,Coordinate_Operation,15364,7302,Utah South (ft),
+1383,Coordinate_Operation,15365,7302,Virginia North (ftUS),
+1384,Coordinate_Operation,15366,7302,Virginia South (ftUS),
+1385,Coordinate_Operation,15367,7302,Washington North (ftUS),
+1386,Coordinate_Operation,15368,7302,Washington South (ftUS),
+1387,Coordinate_Operation,15369,7302,Wisconsin North (ftUS),
+1388,Coordinate_Operation,15370,7302,Wisconsin Central (ftUS),
+1389,Coordinate_Operation,15371,7302,Wisconsin South (ftUS),
+1390,datum,6190,7302,POSGAR 98,
+1391,datum,6190,7300,Posiciones Geod�sicas Argentinas 1998,
+1392,Coordinate Reference System,4190,7301,National Geodetic System [Argentina],see http://www.igm.gov.ar/posgar.html
+1393,datum,6182,7301,Observatario Flores,
+1394,datum,6182,7302,Azores Occidental 1939,
+1395,datum,6183,7301,Graciosa Base SW,
+1396,datum,6183,7302,Azores Central 1948,
+1397,datum,6184,7301,Sao Bras,
+1398,datum,6184,7302,Azores Oriental 1940,
+1399,Coordinate Reference System,4182,7301,Observatorio Flores,
+1400,Coordinate Reference System,4183,7301,Graciosa,
+1401,Coordinate Reference System,4184,7301,Sao Braz,
+1402,Coordinate_Operation,18084,7301,France zone IV,
+1403,Coordinate_Operation,18083,7301,France zone III,
+1404,Coordinate_Operation,18082,7301,France zone II,
+1405,Coordinate_Operation,18081,7301,France zone I,
+1406,Coordinate_Operation,18093,7301,Sud France,
+1407,Coordinate_Operation,18094,7301,Corse,
+1408,Coordinate_Operation,18092,7301,Centre France,
+1409,Coordinate_Operation,18091,7301,Nord France,
+1410,Coordinate Reference System,27561,7301,NTF (Paris) / Nord France,
+1411,Coordinate Reference System,27562,7301,NTF (Paris) / Centre France,
+1412,Coordinate Reference System,27563,7301,NTF (Paris) / Sud France,
+1413,Coordinate Reference System,27564,7301,NTF (Paris) / Corse,
+1414,Coordinate Reference System,27571,7301,NTF (Paris) / France I,
+1415,Coordinate Reference System,27572,7301,NTF (Paris) / France II,
+1416,Coordinate Reference System,27573,7301,NTF (Paris) / France III,
+1417,Coordinate Reference System,27574,7301,NTF (Paris) / France IV,
+1418,Coordinate Reference System,27572,7301,NTF (Paris) / Lambert zone II Etendue,
+1419,datum,6156,7300,Jednotn� Trigonometrick� S�te Katastr�ln�,
+1421,Coordinate_Operation,1751,7301,Amersfoort to ETRF89 (1),
+1422,Coordinate Reference System,2168,7301,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 5,
+1423,Coordinate_Operation,15302,7302,Tennessee,
+1424,Coordinate_Operation,16269,7302,3-degree Gauss zone 9,
+1425,Coordinate_Operation,16270,7302,3-degree Gauss zone 10,
+1426,Coordinate_Operation,16271,7302,3-degree Gauss zone 11,
+1427,Coordinate_Operation,16272,7302,3-degree Gauss zone 12,
+1428,Coordinate_Operation,16273,7302,3-degree Gauss zone 13,
+1429,Coordinate_Operation,16274,7302,3-degree Gauss zone 14,
+1430,Coordinate_Operation,16275,7302,3-degree Gauss zone 15,
+1431,datum,6123,7300,Kartasto Koordinaati J�rjestelm� 1966,
+1432,Coordinate Reference System,2181,7301,ED50 / Turkey zone 9,
+1433,Coordinate Reference System,2182,7301,ED50 / Turkey zone 10,
+1434,Coordinate Reference System,2183,7301,ED50 / Turkey zone 11,
+1435,Coordinate Reference System,2184,7301,ED50 / Turkey zone 12,
+1436,Coordinate Reference System,2185,7301,ED50 / Turkey zone 13,
+1437,Coordinate Reference System,2186,7301,ED50 / Turkey zone 14,
+1438,Coordinate Reference System,2187,7301,ED50 / Turkey zone 15,
+1439,Coordinate Reference System,2188,7301,Observatorio Flores / UTM zone 25N,
+1440,Coordinate Reference System,2189,7301,Graciosa / UTM zone 26N,
+1441,Coordinate Reference System,2190,7301,Sao Braz / UTM zone 26N,
+1442,Coordinate_Operation,1781,7310,PD/83 to ETRS89,
+1443,Coordinate_Operation,1782,7310,RD/83 to ETRS89,
+1444,Coordinate Reference System,4207,7301,Lisbon 1937,
+1445,Coordinate Reference System,4803,7301,Lisbon 1937 (Lisbon),
+1446,Coordinate Reference System,20791,7301,Lisbon 1937 (Lisbon)/Portuguese Grid,
+1447,Coordinate Reference System,20790,7301,Lisbon 1937 (Lisbon)/Portuguese National Grid,
+1448,Coordinate_Operation,18411,7301,Afrique Occidentale Fran�aise Senegal zone,
+1449,Coordinate_Operation,18412,7301,Afrique Occidentale Fran�aise C�te d'Ivoire zone,
+1450,Coordinate_Operation,18413,7301,Afrique Occidentale Fran�aise Dahomey zone,
+1451,Coordinate_Operation,18415,7301,Afrique Equatoriale Fran�aise ouest zone,
+1452,Coordinate_Operation,18416,7301,Afrique Equatoriale Fran�aise centrale zone,
+1453,Coordinate_Operation,18417,7301,Afrique Equatoriale Fran�aise est zone,
+1454,Coordinate_Operation,18414,7301,Afrique Occidentale Fran�aise Niger zone,
+1455,Coordinate_Operation,18411,7302,AOF Senegal zone,
+1456,Coordinate_Operation,18412,7302,AOF C�te d'Ivoire zone,
+1457,Coordinate_Operation,18413,7302,AOF Dahomey zone,
+1458,Coordinate_Operation,18414,7302,AOF Niger zone,
+1459,Coordinate_Operation,18415,7302,AEF west,
+1460,Coordinate_Operation,18416,7302,AEF central,
+1461,Coordinate_Operation,18417,7302,AEF east,
+1462,Coordinate_Operation Method,9823,7301,Plate Carr�e,This alias only applies if the latitude of natural origin is at the equator.
+1464,Coordinate_Operation,1469,7301,C�te D'Ivoire to WGS 84 (1),Same alias also applied to Abidjan 1987 to WGS 84 (1) (code 1470).
+1465,Coordinate_Operation,1469,7301,Port Bouet to WGS 84 (1),Same alias also applied to Abidjan 1987 to WGS 84 (1) (code 1470).
+1466,Coordinate_Operation,1470,7301,C�te D'Ivoire to WGS 84 (1),Same alias also applied to Locodjo 1965 to WGS 84 (1) (code 1469).
+1467,Coordinate_Operation,1470,7301,Port Bouet to WGS 84 (1),Same alias also applied to Locodjo 1965 to WGS 84 (1) (code 1469).
+1468,Coordinate Reference System,2040,7301,Port Bouet / UTM zone 30N,Same alias used for Abidjan 1987 / UTM zone 30N (code 2041).
+1469,Coordinate Reference System,2040,7301,C�te d'Ivoire / UTM zone 30N,Same alias used for Abidjan 1987 / UTM zone 30N (code 2041).
+1470,Coordinate Reference System,2041,7301,Port Bouet / UTM zone 30N,Same alias used for Locodjo 1965 / UTM zone 30N (code 2040).
+1471,Coordinate Reference System,2041,7301,C�te d'Ivoire / UTM zone 30N,Same alias used for Locodjo 1965 / UTM zone 30N (code 2040).
+1472,Coordinate Reference System,2042,7301,Port Bouet / UTM zone 29N,Same alias used for Abidjan 1987 / UTM zone 29N (code 2043).
+1473,Coordinate Reference System,2042,7301,C�te d'Ivoire / UTM zone 29N,Same alias used for Abidjan 1987 / UTM zone 29N (code 2043).
+1474,Coordinate Reference System,2043,7301,Port Bouet / UTM zone 29N,Same alias used for Locodjo 1965 / UTM zone 29N (code 2042).
+1475,Coordinate Reference System,2043,7301,C�te d'Ivoire / UTM zone 29N,Same alias used for Locodjo 1965 / UTM zone 29N (code 2042).
+1479,Coordinate_Operation,18421,7301,Greenland zone 1 west,
+1480,Coordinate_Operation,18428,7301,Greenland zone 8 west,
+1481,Coordinate Reference System,2297,7301,Qornoq 1927 / Greenland zone 1 west,
+1482,Coordinate Reference System,2307,7301,Qornoq 1927 / Greenland zone 8 west,
+1483,Coordinate Reference System,32113,7301,NAD83 / New Mexico Central (m),
+1484,Coordinate Reference System,26949,7301,NAD83 / Arizona Central (m),
+1485,Coordinate Reference System,26929,7301,NAD83 / Alabama East (m),
+1486,Coordinate Reference System,26930,7301,NAD83 / Alabama West (m),
+1487,Coordinate Reference System,26931,7301,NAD83 / Alaska zone 1 (m),
+1488,Coordinate Reference System,26940,7301,NAD83 / Alaska zone 10 (m),
+1489,Coordinate Reference System,26932,7301,NAD83 / Alaska zone 2 (m),
+1490,Coordinate Reference System,26933,7301,NAD83 / Alaska zone 3 (m),
+1491,Coordinate Reference System,26934,7301,NAD83 / Alaska zone 4 (m),
+1492,Coordinate Reference System,26935,7301,NAD83 / Alaska zone 5 (m),
+1493,Coordinate Reference System,26936,7301,NAD83 / Alaska zone 6 (m),
+1494,Coordinate Reference System,26937,7301,NAD83 / Alaska zone 7 (m),
+1495,Coordinate Reference System,26938,7301,NAD83 / Alaska zone 8 (m),
+1496,Coordinate Reference System,26939,7301,NAD83 / Alaska zone 9 (m),
+1497,Coordinate Reference System,26948,7301,NAD83 / Arizona East (m),
+1498,Coordinate Reference System,26950,7301,NAD83 / Arizona West (m),
+1499,Coordinate Reference System,26951,7301,NAD83 / Arkansas North (m),
+1500,Coordinate Reference System,26952,7301,NAD83 / Arkansas South (m),
+1501,Coordinate Reference System,26941,7301,NAD83 / California zone 1 (m),
+1502,Coordinate Reference System,26942,7301,NAD83 / California zone 2 (m),
+1503,Coordinate Reference System,26943,7301,NAD83 / California zone 3 (m),
+1504,Coordinate Reference System,26944,7301,NAD83 / California zone 4 (m),
+1505,Coordinate Reference System,26945,7301,NAD83 / California zone 5 (m),
+1506,Coordinate Reference System,26946,7301,NAD83 / California zone 6 (m),
+1507,Coordinate Reference System,26954,7301,NAD83 / Colorado Central (m),
+1508,Coordinate Reference System,26953,7301,NAD83 / Colorado North (m),
+1509,Coordinate Reference System,26955,7301,NAD83 / Colorado South (m),
+1510,Coordinate Reference System,26956,7301,NAD83 / Connecticut (m),
+1511,Coordinate Reference System,26957,7301,NAD83 / Delaware (m),
+1512,Coordinate Reference System,26958,7301,NAD83 / Florida East (m),
+1513,Coordinate Reference System,26960,7301,NAD83 / Florida North (m),
+1514,Coordinate Reference System,26959,7301,NAD83 / Florida West (m),
+1515,Coordinate Reference System,26966,7301,NAD83 / Georgia East (m),
+1516,Coordinate Reference System,26967,7301,NAD83 / Georgia West (m),
+1517,Coordinate Reference System,26961,7301,NAD83 / Hawaii zone 1 (m),
+1518,Coordinate Reference System,26962,7301,NAD83 / Hawaii zone 2 (m),
+1519,Coordinate Reference System,26963,7301,NAD83 / Hawaii zone 3 (m),
+1520,Coordinate Reference System,26964,7301,NAD83 / Hawaii zone 4 (m),
+1521,Coordinate Reference System,26965,7301,NAD83 / Hawaii zone 5 (m),
+1522,Coordinate Reference System,26969,7301,NAD83 / Idaho Central (m),
+1523,Coordinate Reference System,26968,7301,NAD83 / Idaho East (m),
+1524,Coordinate Reference System,26970,7301,NAD83 / Idaho West (m),
+1525,Coordinate Reference System,26971,7301,NAD83 / Illinois East (m),
+1526,Coordinate Reference System,26972,7301,NAD83 / Illinois West (m),
+1527,Coordinate Reference System,26973,7301,NAD83 / Indiana East (m),
+1528,Coordinate Reference System,26974,7301,NAD83 / Indiana West (m),
+1529,Coordinate Reference System,26975,7301,NAD83 / Iowa North (m),
+1530,Coordinate Reference System,26976,7301,NAD83 / Iowa South (m),
+1531,Coordinate Reference System,26977,7301,NAD83 / Kansas North (m),
+1532,Coordinate Reference System,26978,7301,NAD83 / Kansas South (m),
+1533,Coordinate Reference System,2205,7301,NAD83 / Kentucky North (m),
+1534,Coordinate Reference System,26980,7301,NAD83 / Kentucky South (m),
+1535,Coordinate Reference System,26981,7301,NAD83 / Louisiana North (m),
+1536,Coordinate Reference System,26982,7301,NAD83 / Louisiana South (m),
+1537,Coordinate Reference System,26983,7301,NAD83 / Maine East (m),
+1538,Coordinate Reference System,26984,7301,NAD83 / Maine West (m),
+1539,Coordinate Reference System,26985,7301,NAD83 / Maryland (m),
+1540,Coordinate Reference System,26987,7301,NAD83 / Massachusetts Island (m),
+1541,Coordinate Reference System,26986,7301,NAD83 / Massachusetts Mainland (m),
+1542,Coordinate Reference System,26989,7301,NAD83 / Michigan Central (m),
+1543,Coordinate Reference System,26988,7301,NAD83 / Michigan North (m),
+1544,Coordinate Reference System,26990,7301,NAD83 / Michigan South (m),
+1545,Coordinate Reference System,26992,7301,NAD83 / Minnesota Central (m),
+1546,Coordinate Reference System,26991,7301,NAD83 / Minnesota North (m),
+1547,Coordinate Reference System,26993,7301,NAD83 / Minnesota South (m),
+1548,Coordinate Reference System,26994,7301,NAD83 / Mississippi East (m),
+1549,Coordinate Reference System,26995,7301,NAD83 / Mississippi West (m),
+1550,Coordinate Reference System,26997,7301,NAD83 / Missouri Central (m),
+1551,Coordinate Reference System,26996,7301,NAD83 / Missouri East (m),
+1552,Coordinate Reference System,26998,7301,NAD83 / Missouri West (m),
+1553,Coordinate Reference System,32100,7301,NAD83 / Montana (m),
+1554,Coordinate Reference System,32104,7301,NAD83 / Nebraska (m),
+1555,Coordinate Reference System,32108,7301,NAD83 / Nevada Central (m),
+1556,Coordinate Reference System,32107,7301,NAD83 / Nevada East (m),
+1557,Coordinate Reference System,32109,7301,NAD83 / Nevada West (m),
+1558,Coordinate Reference System,32110,7301,NAD83 / New Hampshire (m),
+1559,Coordinate Reference System,32111,7301,NAD83 / New Jersey (m),
+1560,Coordinate Reference System,32112,7301,NAD83 / New Mexico East (m),
+1561,Coordinate Reference System,32114,7301,NAD83 / New Mexico West (m),
+1562,Coordinate Reference System,32116,7301,NAD83 / New York Central (m),
+1563,Coordinate Reference System,32115,7301,NAD83 / New York East (m),
+1564,Coordinate Reference System,32118,7301,NAD83 / New York Long Island (m),
+1565,Coordinate Reference System,32117,7301,NAD83 / New York West (m),
+1566,Coordinate Reference System,32119,7301,NAD83 / North Carolina (m),
+1567,Coordinate Reference System,32120,7301,NAD83 / North Dakota North (m),
+1568,Coordinate Reference System,32121,7301,NAD83 / North Dakota South (m),
+1569,Coordinate Reference System,32122,7301,NAD83 / Ohio North (m),
+1570,Coordinate Reference System,32123,7301,NAD83 / Ohio South (m),
+1571,Coordinate Reference System,32124,7301,NAD83 / Oklahoma North (m),
+1572,Coordinate Reference System,32125,7301,NAD83 / Oklahoma South (m),
+1573,Coordinate Reference System,32126,7301,NAD83 / Oregon North (m),
+1574,Coordinate Reference System,32127,7301,NAD83 / Oregon South (m),
+1575,Coordinate Reference System,32128,7301,NAD83 / Pennsylvania North (m),
+1576,Coordinate Reference System,32129,7301,NAD83 / Pennsylvania South (m),
+1577,Coordinate Reference System,32130,7301,NAD83 / Rhode Island (m),
+1578,Coordinate Reference System,32133,7301,NAD83 / South Carolina (m),
+1579,Coordinate Reference System,32134,7301,NAD83 / South Dakota North (m),
+1580,Coordinate Reference System,32135,7301,NAD83 / South Dakota South (m),
+1581,Coordinate Reference System,32136,7301,NAD83 / Tennessee (m),
+1582,Coordinate Reference System,32139,7301,NAD83 / Texas Central (m),
+1583,Coordinate Reference System,32137,7301,NAD83 / Texas North (m),
+1584,Coordinate Reference System,32138,7301,NAD83 / Texas North Central (m),
+1585,Coordinate Reference System,32141,7301,NAD83 / Texas South (m),
+1586,Coordinate Reference System,32140,7301,NAD83 / Texas South Central (m),
+1587,Coordinate Reference System,32143,7301,NAD83 / Utah Central (m),
+1588,Coordinate Reference System,32142,7301,NAD83 / Utah North (m),
+1589,Coordinate Reference System,32144,7301,NAD83 / Utah South (m),
+1590,Coordinate Reference System,32145,7301,NAD83 / Vermont (m),
+1591,Coordinate Reference System,32146,7301,NAD83 / Virginia North (m),
+1592,Coordinate Reference System,32147,7301,NAD83 / Virginia South (m),
+1593,Coordinate Reference System,32148,7301,NAD83 / Washington North (m),
+1594,Coordinate Reference System,32149,7301,NAD83 / Washington South (m),
+1595,Coordinate Reference System,32150,7301,NAD83 / West Virginia North (m),
+1596,Coordinate Reference System,32151,7301,NAD83 / West Virginia South (m),
+1597,Coordinate Reference System,32153,7301,NAD83 / Wisconsin Central (m),
+1598,Coordinate Reference System,32152,7301,NAD83 / Wisconsin North (m),
+1599,Coordinate Reference System,32154,7301,NAD83 / Wisconsin South (m),
+1600,Coordinate Reference System,32155,7301,NAD83 / Wyoming East (m),
+1601,Coordinate Reference System,32156,7301,NAD83 / Wyoming East Central (m),
+1602,Coordinate Reference System,32158,7301,NAD83 / Wyoming West (m),
+1603,Coordinate Reference System,32157,7301,NAD83 / Wyoming West Central (m),
+1604,Coordinate Reference System,32161,7301,NAD83 / Puerto Rico & Virgin Is. (m),
+1605,Coordinate_Operation,10131,7301,Alabama CS83 East zone,
+1606,Coordinate_Operation,10132,7301,Alabama CS83 West zone,
+1607,Coordinate_Operation,10231,7301,Arizona CS83 East zone,
+1608,Coordinate_Operation,10232,7301,Arizona CS83 Central zone,
+1609,Coordinate_Operation,10233,7301,Arizona CS83 West zone,
+1610,Coordinate_Operation,10331,7301,Arkansas CS83 North zone,
+1611,Coordinate_Operation,10332,7301,Arkansas CS83 South zone,
+1612,Coordinate_Operation,10431,7301,California CS83 zone 1,
+1613,Coordinate_Operation,10432,7301,California CS83 zone 2,
+1614,Coordinate_Operation,10433,7301,California CS83 zone 3,
+1615,Coordinate_Operation,10434,7301,California CS83 zone 4,
+1616,Coordinate_Operation,10435,7301,California CS83 zone 5,
+1617,Coordinate_Operation,10436,7301,California CS83 zone 6,
+1618,Coordinate_Operation,10531,7301,Colorado CS83 North zone,
+1619,Coordinate_Operation,10532,7301,Colorado CS83 Central zone,
+1620,Coordinate_Operation,10533,7301,Colorado CS83 South zone,
+1621,Coordinate_Operation,10630,7301,Connecticut CS83,
+1622,Coordinate_Operation,10730,7301,Delaware CS83,
+1623,Coordinate_Operation,10931,7301,Florida CS83 East zone,
+1624,Coordinate_Operation,10932,7301,Florida CS83 West zone,
+1625,Coordinate_Operation,10933,7301,Florida CS83 North zone,
+1626,Coordinate_Operation,11031,7301,Georgia CS83 East zone,
+1627,Coordinate_Operation,11032,7301,Georgia CS83 West zone,
+1628,Coordinate_Operation,11131,7301,Idaho CS83 East zone,
+1629,Coordinate_Operation,11132,7301,Idaho CS83 Central zone,
+1630,Coordinate_Operation,11133,7301,Idaho CS83 West zone,
+1631,Coordinate_Operation,11231,7301,Illinois CS83 East zone,
+1632,Coordinate_Operation,11232,7301,Illinois CS83 West zone,
+1633,Coordinate_Operation,11331,7301,Indiana CS83 East zone,
+1634,Coordinate_Operation,11332,7301,Indiana CS83 West zone,
+1635,Coordinate_Operation,11431,7301,Iowa CS83 North zone,
+1636,Coordinate_Operation,11432,7301,Iowa CS83 South zone,
+1637,Coordinate_Operation,11531,7301,Kansas CS83 North zone,
+1638,Coordinate_Operation,11532,7301,Kansas CS83 South zone,
+1640,Coordinate_Operation,11632,7301,Kentucky CS83 South zone,
+1641,Coordinate_Operation,11731,7301,Louisiana CS83 North zone,
+1642,Coordinate_Operation,11732,7301,Louisiana CS83 South zone,
+1643,Coordinate_Operation,11831,7301,Maine CS83 East zone,
+1644,Coordinate_Operation,11832,7301,Maine CS83 West zone,
+1645,Coordinate_Operation,11930,7301,Maryland CS83,
+1646,Coordinate_Operation,12031,7301,Massachusetts CS83 Mainland zone,
+1647,Coordinate_Operation,12032,7301,Massachusetts CS83 Island zone,
+1648,Coordinate_Operation,12141,7301,Michigan CS83 North zone,
+1649,Coordinate_Operation,12142,7301,Michigan CS83 Central zone,
+1650,Coordinate_Operation,12143,7301,Michigan CS83 South zone,
+1651,Coordinate_Operation,12231,7301,Minnesota CS83 North zone,
+1652,Coordinate_Operation,12232,7301,Minnesota CS83 Central zone,
+1653,Coordinate_Operation,12233,7301,Minnesota CS83 South zone,
+1654,Coordinate_Operation,12331,7301,Mississippi CS83 East zone,
+1655,Coordinate_Operation,12332,7301,Mississippi CS83 West zone,
+1656,Coordinate_Operation,12431,7301,Missouri CS83 East zone,
+1657,Coordinate_Operation,12433,7301,Missouri CS83 West zone,
+1658,Coordinate_Operation,12530,7301,Montana CS83,
+1659,Coordinate_Operation,12630,7301,Nebraska CS83,
+1660,Coordinate_Operation,12731,7301,Nevada CS83 East zone,
+1661,Coordinate_Operation,12732,7301,Nevada CS83 Central zone,
+1662,Coordinate_Operation,12733,7301,Nevada CS83 West zone,
+1663,Coordinate_Operation,12830,7301,New Hampshire CS83,
+1664,Coordinate_Operation,12930,7301,New Jersey CS83,
+1665,Coordinate_Operation,13031,7301,New Mexico CS83 East zone,
+1666,Coordinate_Operation,13032,7301,New Mexico CS83 Central zone,
+1667,Coordinate_Operation,13033,7301,New Mexico CS83 West zone,
+1668,Coordinate_Operation,13131,7301,New York CS83 East zone,
+1669,Coordinate_Operation,13132,7301,New York CS83 Central zone,
+1670,Coordinate_Operation,13133,7301,New York CS83 West zone,
+1671,Coordinate_Operation,13134,7301,New York CS83 Long Island zone,
+1672,Coordinate_Operation,13230,7301,North Carolina CS83,
+1673,Coordinate_Operation,13331,7301,North Dakota CS83 North zone,
+1674,Coordinate_Operation,13332,7301,North Dakota CS83 South zone,
+1675,Coordinate_Operation,13431,7301,Ohio CS83 North zone,
+1676,Coordinate_Operation,13432,7301,Ohio CS83 South zone,
+1677,Coordinate_Operation,13531,7301,Oklahoma CS83 North zone,
+1678,Coordinate_Operation,13532,7301,Oklahoma CS83 South zone,
+1679,Coordinate_Operation,13631,7301,Oregon CS83 North zone,
+1680,Coordinate_Operation,13632,7301,Oregon CS83 South zone,
+1681,Coordinate_Operation,13731,7301,Pennsylvania CS83 North zone,
+1682,Coordinate_Operation,13732,7301,Pennsylvania CS83 South zone,
+1683,Coordinate_Operation,13830,7301,Rhode Island CS83,
+1684,Coordinate_Operation,13930,7301,South Carolina CS83,
+1685,Coordinate_Operation,14031,7301,South Dakota CS83 North zone,
+1686,Coordinate_Operation,14032,7301,South Dakota CS83 South zone,
+1687,Coordinate_Operation,14130,7301,Tennessee CS83,
+1688,Coordinate_Operation,14231,7301,Texas CS83 North zone,
+1689,Coordinate_Operation,14232,7301,Texas CS83 North Central zone,
+1690,Coordinate_Operation,14233,7301,Texas CS83 Central zone,
+1691,Coordinate_Operation,14234,7301,Texas CS83 South Central zone,
+1692,Coordinate_Operation,14235,7301,Texas CS83 South zone,
+1693,Coordinate_Operation,14331,7301,Utah CS83 North zone,
+1694,Coordinate_Operation,14332,7301,Utah CS83 Central zone,
+1695,Coordinate_Operation,14333,7301,Utah CS83 South zone,
+1696,Coordinate_Operation,14430,7301,Vermont CS83,
+1697,Coordinate_Operation,14531,7301,Virginia CS83 North zone,
+1698,Coordinate_Operation,14532,7301,Virginia CS83 South zone,
+1699,Coordinate_Operation,14631,7301,Washington CS83 North zone,
+1700,Coordinate_Operation,14632,7301,Washington CS83 South zone,
+1701,Coordinate_Operation,14731,7301,West Virginia CS83 North zone,
+1702,Coordinate_Operation,14732,7301,West Virginia CS83 South zone,
+1703,Coordinate_Operation,14831,7301,Wisconsin CS83 North zone,
+1704,Coordinate_Operation,14832,7301,Wisconsin CS83 Central zone,
+1705,Coordinate_Operation,14833,7301,Wisconsin CS83 South zone,
+1706,Coordinate_Operation,14931,7301,Wyoming CS83 East zone,
+1707,Coordinate_Operation,14932,7301,Wyoming CS83 East Central zone,
+1708,Coordinate_Operation,14933,7301,Wyoming CS83 West Central zone,
+1709,Coordinate_Operation,14934,7301,Wyoming CS83 West zone,
+1710,Coordinate_Operation,15031,7301,Alaska CS83 zone 1,
+1711,Coordinate_Operation,15032,7301,Alaska CS83 zone 2,
+1712,Coordinate_Operation,15033,7301,Alaska CS83 zone 3,
+1713,Coordinate_Operation,15034,7301,Alaska CS83 zone 4,
+1714,Coordinate_Operation,15035,7301,Alaska CS83 zone 5,
+1715,Coordinate_Operation,15036,7301,Alaska CS83 zone 6,
+1716,Coordinate_Operation,15037,7301,Alaska CS83 zone 7,
+1717,Coordinate_Operation,15038,7301,Alaska CS83 zone 8,
+1718,Coordinate_Operation,15039,7301,Alaska CS83 zone 9,
+1719,Coordinate_Operation,15040,7301,Alaska CS83 zone 10,
+1720,Coordinate_Operation,15131,7301,Hawaii CS83 zone 1,
+1721,Coordinate_Operation,15132,7301,Hawaii CS83 zone 2,
+1722,Coordinate_Operation,15133,7301,Hawaii CS83 zone 3,
+1723,Coordinate_Operation,15134,7301,Hawaii CS83 zone 4,
+1724,Coordinate_Operation,15135,7301,Hawaii CS83 zone 5,
+1725,Coordinate_Operation,15230,7301,Puerto Rico & Virgin Islands CS83,
+1726,Coordinate_Operation,15303,7301,Kentucky CS83 North zone,
+1727,Coordinate_Operation,12432,7301,Missouri CS83 Central zone,
+1728,Coordinate_Operation,15303,7302,Kentucky North,
+1729,Coordinate_Operation,10532,7302,Colorado Central,
+1730,Coordinate Reference System,4282,7301,Congo 1960 Pointe Noire,
+1731,Coordinate Reference System,28232,7301,Congo 1960 Pointe Noire / UTM zone 32S,
+1732,Coordinate_Operation,1801,7301,Congo 1960 Pointe Noire to WGS 84 (2),
+1733,Coordinate_Operation,1802,7301,Congo 1960 Pointe Noire to WGS 84 (3),
+1734,Coordinate_Operation,1200,7301,Congo 1960 Pointe Noire to WGS 84 (1),
+1735,Coordinate_Operation,15914,7301,BLM zone 14N in feet,
+1736,Coordinate_Operation,15915,7301,BLM zone 15N in feet,
+1737,Coordinate_Operation,15916,7301,BLM zone 16N in feet,
+1738,Coordinate_Operation,15917,7301,BLM zone 17N in feet,
+1739,Coordinate Reference System,21149,7301,Genuk / UTM zone 49S,
+1740,Coordinate Reference System,2308,7301,Genuk / TM 109 SE,
+1741,Datum,5133,7302,AIOC95,
+1742,Coordinate Reference System,5705,7301,Kronshstadt,
+1743,Datum,6199,7301,New Egyptian,Old Egyptian is an alias for Egypt 1907 (code 6229).
+1744,Datum,6229,7301,Old Egyptian,New Egyptian is an alias for Egypt 1930 (code 6199).
+1745,Coordinate Reference System,4199,7301,New Egyptian,Old Egyptian is an alias for Egypt 1907 (code 4229).
+1746,Coordinate Reference System,4229,7301,Old Egyptian,New Egyptian is an alias for Egypt 1930 (code 4199).
+1747,Coordinate_Operation,1516,7301,PSAD56 to WGS 84,
+1748,Coordinate_Operation,1813,7301,Genuk to WGS 84 (ONWJ),
+1749,Coordinate Reference System,32064,7301,NAD27 / UTM zone 14N (ftUS),Non-metric equivalent of NAD27 / UTM zone 14N (code 26714). UTM is a metric system so strictly this is not UTM.
+1750,Coordinate Reference System,32065,7301,NAD27 / UTM zone 15N (ftUS),Non-metric equivalent of NAD27 / UTM zone 15N (code 26715). UTM is a metric system so strictly this is not UTM.
+1751,Coordinate Reference System,32066,7301,NAD27 / UTM zone 16N (ftUS),Non-metric equivalent of NAD27 / UTM zone 16N (code 26716). UTM is a metric system so strictly this is not UTM.
+1752,Coordinate Reference System,32067,7301,NAD27 / UTM zone 17N (ftUS),Non-metric equivalent of NAD27 / UTM zone 17N (code 26717). UTM is a metric system so strictly this is not UTM.
+1754,Coordinate Reference System,2319,7301,ED50 / 3-degree Gauss-Kruger CM 27E,
+1755,Coordinate Reference System,2320,7301,ED50 / 3-degree Gauss-Kruger CM 30E,
+1756,Coordinate Reference System,2321,7301,ED50 / 3-degree Gauss-Kruger CM 33E,
+1757,Coordinate Reference System,2322,7301,ED50 / 3-degree Gauss-Kruger CM 36E,
+1758,Coordinate Reference System,2323,7301,ED50 / 3-degree Gauss-Kruger CM 39E,
+1759,Coordinate Reference System,2324,7301,ED50 / 3-degree Gauss-Kruger CM 42E,
+1760,Coordinate Reference System,2325,7301,ED50 / 3-degree Gauss-Kruger CM 45E,
+1761,Datum,6612,7302,JGD2000,
+1762,Datum,5137,7301,Huang Hai 1985,
+1763,Datum,5135,7302,HKPD,
+1765,Coordinate Reference System,5736,7301,Huang Hai 1956,
+1766,Coordinate Reference System,5738,7302,HKPD,
+1767,Coordinate Reference System,2343,7301,Xian 1980 / 6-degree Gauss-Kruger CM 105E,
+1768,Coordinate Reference System,2344,7301,Xian 1980 / 6-degree Gauss-Kruger CM 111E,
+1769,Coordinate Reference System,2338,7301,Xian 1980 / 6-degree Gauss-Kruger CM 75E,
+1770,Coordinate Reference System,2342,7301,Xian 1980 / 6-degree Gauss-Kruger CM 99E,
+1771,Coordinate Reference System,2348,7301,Xian 1980 / 6-degree Gauss-Kruger CM 135E,
+1772,Coordinate Reference System,2339,7301,Xian 1980 / 6-degree Gauss-Kruger CM 81E,
+1773,Coordinate Reference System,2340,7301,Xian 1980 / 6-degree Gauss-Kruger CM 87E,
+1774,Coordinate Reference System,2341,7301,Xian 1980 / 6-degree Gauss-Kruger CM 93E,
+1775,Coordinate Reference System,2345,7301,Xian 1980 / 6-degree Gauss-Kruger CM 117E,
+1776,Coordinate Reference System,2346,7301,Xian 1980 / 6-degree Gauss-Kruger CM 123E,
+1777,Coordinate Reference System,2347,7301,Xian 1980 / 6-degree Gauss-Kruger CM 129E,
+1778,Datum,6611,7302,HK80,
+1779,Datum,5135,7301,Ordnance Datum,This is the former name.
+1780,Datum,5136,7301,Admiralty Datum,This is the former name.
+1781,Coordinate Reference System,5737,7301,Huang Hai 1985,
+1782,Coordinate Reference System,2326,7302,HK 1980 Grid System,
+1783,Coordinate Reference System,4611,7302,HK1980,
+1784,Coordinate_Operation Parameter,8802,7301,Central Meridian,"Abbeviated as ""CM""."
+1785,Coordinate_Operation Parameter,8802,7302,CM,"Abbreviation for ""Central Meridian""."
+1786,Coordinate Reference System,2327,7301,Xian 1980 / 6-degree Gauss-Kruger zone 13,Part of the China National Coordinate System of 1980.
+1787,Coordinate Reference System,2328,7301,Xian 1980 / 6-degree Gauss-Kruger zone 14,Part of the China National Coordinate System of 1980.
+1788,Coordinate Reference System,2329,7301,Xian 1980 / 6-degree Gauss-Kruger zone 15,Part of the China National Coordinate System of 1980.
+1789,Coordinate Reference System,2330,7301,Xian 1980 / 6-degree Gauss-Kruger zone 16,Part of the China National Coordinate System of 1980.
+1790,Coordinate Reference System,2331,7301,Xian 1980 / 6-degree Gauss-Kruger zone 17,Part of the China National Coordinate System of 1980.
+1791,Coordinate Reference System,2332,7301,Xian 1980 / 6-degree Gauss-Kruger zone 18,Part of the China National Coordinate System of 1980.
+1792,Coordinate Reference System,2333,7301,Xian 1980 / 6-degree Gauss-Kruger zone 19,Part of the China National Coordinate System of 1980.
+1793,Coordinate Reference System,2334,7301,Xian 1980 / 6-degree Gauss-Kruger zone 20,Part of the China National Coordinate System of 1980.
+1794,Coordinate Reference System,2335,7301,Xian 1980 / 6-degree Gauss-Kruger zone 21,Part of the China National Coordinate System of 1980.
+1795,Coordinate Reference System,2336,7301,Xian 1980 / 6-degree Gauss-Kruger zone 22,Part of the China National Coordinate System of 1980.
+1796,Coordinate Reference System,2333,7301,Xian 1980 / 6-degree Gauss-Kruger zone 23,Part of the China National Coordinate System of 1980.
+1797,Coordinate Reference System,21413,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 13,
+1798,Coordinate Reference System,21414,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 14,
+1799,Coordinate Reference System,21415,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 15,
+1800,Coordinate Reference System,21416,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 16,
+1801,Coordinate Reference System,21417,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 17,
+1802,Coordinate Reference System,21418,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 18,
+1803,Coordinate Reference System,21419,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 19,
+1804,Coordinate Reference System,21420,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 20,
+1805,Coordinate Reference System,21421,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 21,
+1806,Coordinate Reference System,21422,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 22,
+1807,Coordinate Reference System,21423,7301,Beijing 1954 / 6-degree Gauss-Kruger zone 23,
+1808,Coordinate Reference System,21453,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 75E,
+1809,Coordinate Reference System,21454,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 81E,
+1810,Coordinate Reference System,21455,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 87E,
+1811,Coordinate Reference System,21456,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 93E,
+1812,Coordinate Reference System,21457,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 99E,
+1813,Coordinate Reference System,21458,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 105E,
+1814,Coordinate Reference System,21459,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 111E,
+1815,Coordinate Reference System,21460,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 117E,
+1816,Coordinate Reference System,21461,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 123E,
+1817,Coordinate Reference System,21462,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 129E,
+1818,Coordinate Reference System,21463,7301,Beijing 1954 / 6-degree Gauss-Kruger CM 135E,
+1819,Coordinate_Operation,5405,7302,HKPD to Hong Kong Chart,
+1820,Coordinate Reference System,2044,7301,Hanoi 1972 / 6-degree Gauss-Kruger zone 18,
+1821,Coordinate Reference System,2045,7301,Hanoi 1972 / 6-degree Gauss-Kruger zone 18,
+1822,Coordinate Reference System,2462,7301,Albanian 1987 / 6-degree Gauss-Kruger zone 4,
+1823,Coordinate Reference System,2397,7301,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 3,
+1824,Coordinate Reference System,2398,7301,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 4,
+1825,Coordinate Reference System,2399,7301,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 3,
+1826,Coordinate Reference System,2395,7302,S Yemen / Gauss zone 8,
+1827,Coordinate Reference System,2396,7302,S Yemen / Gauss zone 9,
+1828,Coordinate Reference System,2396,7301,South Yemen / 6-degree Gauss-Kruger zone 9,
+1829,Coordinate Reference System,2395,7301,South Yemen / 6-degree Gauss-Kruger zone 8,
+1830,Coordinate_Operation,18031,7301,Gauss-Kruger zone 1,
+1831,Coordinate_Operation,18032,7301,Gauss-Kruger zone 2,
+1832,Coordinate_Operation,18033,7301,Gauss-Kruger zone 3,
+1833,Coordinate_Operation,18034,7301,Gauss-Kruger zone 4,
+1834,Coordinate_Operation,18035,7301,Gauss-Kruger zone 5,
+1835,Coordinate_Operation,18036,7301,Gauss-Kruger zone 6,
+1836,Coordinate_Operation,18037,7301,Gauss-Kruger zone 7,
+1837,Coordinate Reference System,22191,7301,Campo Inchauspe / Gauss-Kruger zone 1,
+1838,Coordinate Reference System,22192,7301,Campo Inchauspe / Gauss-Kruger zone 2,
+1839,Coordinate Reference System,22193,7301,Campo Inchauspe / Gauss-Kruger zone 3,
+1840,Coordinate Reference System,22194,7301,Campo Inchauspe / Gauss-Kruger zone 4,
+1841,Coordinate Reference System,22195,7301,Campo Inchauspe / Gauss-Kruger zone 5,
+1842,Coordinate Reference System,22196,7301,Campo Inchauspe / Gauss-Kruger zone 6,
+1843,Coordinate Reference System,22197,7301,Campo Inchauspe / Gauss-Kruger zone 7,
+1844,Coordinate Reference System,2081,7301,Chos Malal 1914 / Gauss-Kruger zone 2,
+1845,Coordinate Reference System,2082,7301,Pampa del Castillo / Gauss-Kruger zone 2,
+1846,Coordinate Reference System,2083,7301,Hito XVIII 1963 / Gauss-Kruger zone 2,
+1847,Coordinate Reference System,20004,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 4,
+1848,Coordinate Reference System,20005,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 5,
+1849,Coordinate Reference System,20006,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 6,
+1850,Coordinate Reference System,20007,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 7,
+1851,Coordinate Reference System,20008,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 8,
+1852,Coordinate Reference System,20009,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 9,
+1853,Coordinate Reference System,20010,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 10,
+1854,Coordinate Reference System,20011,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 11,
+1855,Coordinate Reference System,20012,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 12,
+1856,Coordinate Reference System,20013,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 13,
+1857,Coordinate Reference System,20014,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 14,
+1858,Coordinate Reference System,20015,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 15,
+1859,Coordinate Reference System,20016,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 16,
+1860,Coordinate Reference System,20017,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 17,
+1861,Coordinate Reference System,20018,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 18,
+1862,Coordinate Reference System,20019,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 19,
+1863,Coordinate Reference System,20020,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 20,
+1864,Coordinate Reference System,20021,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 21,
+1865,Coordinate Reference System,20022,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 22,
+1866,Coordinate Reference System,20023,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 23,
+1867,Coordinate Reference System,20024,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 24,
+1868,Coordinate Reference System,20025,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 25,
+1869,Coordinate Reference System,20026,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 26,
+1870,Coordinate Reference System,20027,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 27,
+1871,Coordinate Reference System,20028,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 28,
+1872,Coordinate Reference System,20029,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 29,
+1873,Coordinate Reference System,20030,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 30,
+1874,Coordinate Reference System,20031,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 31,
+1875,Coordinate Reference System,20032,7301,Pulkovo 1995 / 6-degree Gauss-Kruger zone 32,
+1876,Coordinate Reference System,28402,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 2,
+1877,Coordinate Reference System,28403,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 3,
+1878,Coordinate Reference System,28404,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 4,
+1879,Coordinate Reference System,28405,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 5,
+1880,Coordinate Reference System,28406,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 6,
+1881,Coordinate Reference System,28407,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 7,
+1882,Coordinate Reference System,28408,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 8,
+1883,Coordinate Reference System,28409,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 9,
+1884,Coordinate Reference System,28410,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 10,
+1885,Coordinate Reference System,28411,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 11,
+1886,Coordinate Reference System,28412,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 12,
+1887,Coordinate Reference System,28413,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 13,
+1888,Coordinate Reference System,28414,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 14,
+1889,Coordinate Reference System,28415,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 15,
+1890,Coordinate Reference System,28416,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 16,
+1891,Coordinate Reference System,28417,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 17,
+1892,Coordinate Reference System,28418,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 18,
+1893,Coordinate Reference System,28419,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 19,
+1894,Coordinate Reference System,28420,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 20,
+1895,Coordinate Reference System,28421,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 21,
+1896,Coordinate Reference System,28422,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 22,
+1897,Coordinate Reference System,28423,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 23,
+1898,Coordinate Reference System,28424,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 24,
+1899,Coordinate Reference System,28425,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 25,
+1900,Coordinate Reference System,28426,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 26,
+1901,Coordinate Reference System,28427,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 27,
+1902,Coordinate Reference System,28428,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 28,
+1903,Coordinate Reference System,28429,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 29,
+1904,Coordinate Reference System,28430,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 30,
+1905,Coordinate Reference System,28431,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 31,
+1906,Coordinate Reference System,28432,7301,Pulkovo 1942 / 6-degree Gauss-Kruger zone 32,
+1907,Coordinate Reference System,2463,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 21E,
+1908,Coordinate Reference System,2464,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 27E,
+1909,Coordinate Reference System,2465,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 33E,
+1910,Coordinate Reference System,2466,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 39E,
+1911,Coordinate Reference System,2467,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 45E,
+1912,Coordinate Reference System,2468,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 51E,
+1913,Coordinate Reference System,2469,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 57E,
+1914,Coordinate Reference System,2470,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 63E,
+1915,Coordinate Reference System,2471,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 69E,
+1916,Coordinate Reference System,2472,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 75E,
+1917,Coordinate Reference System,2473,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 81E,
+1918,Coordinate Reference System,2474,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 87E,
+1919,Coordinate Reference System,2475,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 93E,
+1920,Coordinate Reference System,2476,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 99E,
+1921,Coordinate Reference System,2477,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 105E,
+1922,Coordinate Reference System,2478,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 111E,
+1923,Coordinate Reference System,2479,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 117E,
+1924,Coordinate Reference System,2480,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 123E,
+1925,Coordinate Reference System,2481,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 129E,
+1926,Coordinate Reference System,2482,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 135E,
+1927,Coordinate Reference System,2483,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 141E,
+1928,Coordinate Reference System,2484,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 147E,
+1929,Coordinate Reference System,2485,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 153E,
+1930,Coordinate Reference System,2486,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 159E,
+1931,Coordinate Reference System,2487,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 165E,
+1932,Coordinate Reference System,2488,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 171E,
+1933,Coordinate Reference System,2489,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 177E,
+1934,Coordinate Reference System,2490,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 177W,
+1935,Coordinate Reference System,2491,7301,Pulkovo 1995 / 6-degree Gauss-Kruger CM 171W,
+1936,Coordinate Reference System,2492,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 9E,
+1937,Coordinate Reference System,2493,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 15E,
+1938,Coordinate Reference System,2494,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 21E,
+1939,Coordinate Reference System,2495,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 27E,
+1940,Coordinate Reference System,2496,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 33E,
+1941,Coordinate Reference System,2497,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 39E,
+1942,Coordinate Reference System,2498,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 45E,
+1943,Coordinate Reference System,2499,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 51E,
+1944,Coordinate Reference System,2500,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 57E,
+1945,Coordinate Reference System,2501,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 63E,
+1946,Coordinate Reference System,2502,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 69E,
+1947,Coordinate Reference System,2503,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 75E,
+1948,Coordinate Reference System,2504,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 81E,
+1949,Coordinate Reference System,2505,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 87E,
+1950,Coordinate Reference System,2506,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 93E,
+1951,Coordinate Reference System,2507,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 99E,
+1952,Coordinate Reference System,2508,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 105E,
+1953,Coordinate Reference System,2509,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 111E,
+1954,Coordinate Reference System,2510,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 117E,
+1955,Coordinate Reference System,2511,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 123E,
+1956,Coordinate Reference System,2512,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 129E,
+1957,Coordinate Reference System,2513,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 135E,
+1958,Coordinate Reference System,2514,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 141E,
+1959,Coordinate Reference System,2515,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 147E,
+1960,Coordinate Reference System,2516,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 153E,
+1961,Coordinate Reference System,2517,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 159E,
+1962,Coordinate Reference System,2518,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 165E,
+1963,Coordinate Reference System,2519,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 171E,
+1964,Coordinate Reference System,2520,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 177E,
+1965,Coordinate Reference System,2521,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 177W,
+1966,Coordinate Reference System,2522,7301,Pulkovo 1942 / 6-degree Gauss-Kruger CM 171W,
+1967,Unit of Measure,9115,7302,DM,
+1968,Unit of Measure,9115,7306,dega,
+1969,Coordinate_Operation,1833,7311,ID74 to DGN-95 (3),DGN-95 is a synonym in Indonesia for WGS 84.
+1970,Coordinate_Operation,1832,7311,ID74 to DGN-95 (2),DGN-95 is a synonym in Indonesia for WGS 84.
+1971,Coordinate_Operation,1248,7311,ID74 to DGN-95 (1),DGN-95 is a synonym in Indonesia for WGS 84.
+1972,Coordinate Reference System,2309,7311,DGN-95 / TM 116 SE,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1973,Coordinate Reference System,2310,7311,DGN-95 / TM 132 SE,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1974,Coordinate Reference System,32646,7311,DGN-95 / UTM zone 46N,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1975,Coordinate Reference System,32647,7311,DGN-95 / UTM zone 47N,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1976,Coordinate Reference System,32648,7311,DGN-95 / UTM zone 48N,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1977,Coordinate Reference System,32649,7311,DGN-95 / UTM zone 49N,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1978,Coordinate Reference System,32650,7311,DGN-95 / UTM zone 50N,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1979,Coordinate Reference System,32651,7311,DGN-95 / UTM zone 51N,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1980,Coordinate Reference System,32652,7311,DGN-95 / UTM zone 52N,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1981,Coordinate Reference System,32747,7311,DGN-95 / UTM zone 47S,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1982,Coordinate Reference System,32748,7311,DGN-95 / UTM zone 48S,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1983,Coordinate Reference System,32749,7311,DGN-95 / UTM zone 49S,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1984,Coordinate Reference System,32750,7311,DGN-95 / UTM zone 50S,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1985,Coordinate Reference System,32751,7311,DGN-95 / UTM zone 51S,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1986,Coordinate Reference System,32752,7311,DGN-95 / UTM zone 52S,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1987,Coordinate Reference System,32753,7311,DGN-95 / UTM zone 53S,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1988,Coordinate Reference System,32754,7311,DGN-95 / UTM zone 54S,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1990,Coordinate Reference System,4326,7311,DGN-95,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1991,Coordinate Reference System,4327,7311,DGN-95 (geographic 3D),Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1992,Coordinate Reference System,4328,7311,DGN-95 (geocentric),Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1993,Datum,6326,7311,DGN-95,Datum Geodesi Nasional 1995 (DGN-95) is a synonym for WGS 84 in Indonesia.
+1994,Coordinate_Operation,1814,7301,Genuk to WGS 84 (3),
+1996,Datum,6820,7302,Segara (Jakarta),
+1997,Datum,6613,7302,Segara,
+1998,Datum,6613,7301,Samboja,Samboja-1 is one of two stations used as the baseline for extension to government triangulation by Total Indonesia in 1970-71.
+1999,Datum,6613,7301,P2 Exc,P2 Exc is one of two stations used as the baseline for extension to government triangulation by Total Indonesia in 1970-71. P2 Exc is a replacement satellite station to the destroyed station P2.
+2000,Datum,6613,7301,P2 Exc-T9,P2 Exc was a replacement satellite station to the destroyed station P2 from which several Toran stations including T9 were coordinated in 1970-71. When further control work was executed in 1995 P2 Exc was by then destroyed and T9 was used as its origin.
+2001,Coordinate Reference System,4613,7301,Samboja,Oil industry extension in the Mahakam delta region. Also known as P2 Exc and P2 Exc-T9.
+2002,Coordinate Reference System,4613,7301,P2 Exc-T9,Oil industry extension in the Mahakam delta region. Also known as P2 Exc and Samboja.
+2003,Coordinate Reference System,4613,7301,P2 Exc,Oil industry extension in the Mahakam delta region. Also known as P2 Exc-T9 and Samboja.
+2004,Coordinate_Operation,1838,7301,Samboja to WGS 84 (4),
+2005,Coordinate_Operation,1838,7301,P2 Exc-T9 to WGS 84 (4),
+2006,Datum,6614,7302,QND95,
+2008,Coordinate Reference System,2933,7301,Samboja / UTM zone 50S,
+2009,Coordinate Reference System,2933,7301,P2 Exc-T9 / UTM zone 50S,
+2010,Unit of Measure,9110,7301,sexagesimal degree,
+2011,Coordinate Reference System,2952,7301,NAD83(CSRS) / SCoPQ zone 10,
+2012,Coordinate Reference System,2945,7301,NAD83(CSRS) / SCoPQ zone 3,
+2013,Coordinate Reference System,2946,7301,NAD83(CSRS) / SCoPQ zone 4,
+2014,Coordinate Reference System,2947,7301,NAD83(CSRS) / SCoPQ zone 5,
+2015,Coordinate Reference System,2948,7301,NAD83(CSRS) / SCoPQ zone 6,
+2016,Coordinate Reference System,2949,7301,NAD83(CSRS) / SCoPQ zone 7,
+2017,Coordinate Reference System,2950,7301,NAD83(CSRS) / SCoPQ zone 8,
+2018,Coordinate Reference System,2951,7301,NAD83(CSRS) / SCoPQ zone 9,
+2019,Coordinate_Operation,18071,7301,Green Belt,
+2020,Coordinate Reference System,22991,7301,Egypt 1907 / Green Belt,
+2021,Coordinate_Operation Parameter,8806,7301,False westing,"This alias applies only in the case of projection methods which have an axis positive west, e.g. Transverse Mercator (South Orientated)."
+2022,Coordinate_Operation Parameter,8807,7301,False southing,"This alias applies only in the case of projection methods which have an axis positive south, e.g. Transverse Mercator (South Orientated)."
diff --git a/src/tiff/csv/area.csv b/src/tiff/csv/area.csv
new file mode 100644
index 0000000..67cfab0
--- /dev/null
+++ b/src/tiff/csv/area.csv
@@ -0,0 +1,1751 @@
+"AREA_CODE","AREA_NAME","AREA_OF_USE","ISO_A2_CODE","ISO_A3_CODE","ISO_N_CODE","REMARKS","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","DEPRECATED"
+1118,China - Hong Kong,China - Hong Kong special administrative region.,HK,HKG,344,"""Hong Kong"" in ISO 3166",EPSG,EPSG,2002-06-22 00:00:00,2002.16,0
+1119,Hungary,Hungary.,HU,HUN,348,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1120,Iceland,Iceland.,IS,ISL,352,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1121,India,India.,IN,IND,356,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1122,Indonesia,Indonesia.,ID,IDN,360,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1123,"Iran, Islamic Republic of",Islamic Republic of Iran,IR,IRN,364,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1124,Iraq,Iraq.,IQ,IRQ,368,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1125,Ireland,Ireland.,IE,IRL,372,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1126,Israel,Israel.,IL,ISR,376,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1127,Italy,Italy.,IT,ITA,380,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1128,Jamaica,Jamaica.,JM,JAM,388,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1129,Japan,Japan.,JP,JPN,392,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1130,Jordan,Jordan.,JO,JOR,400,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1131,Kazakstan,Kazakstan.,KZ,KAZ,398,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1132,Kenya,Kenya.,KE,KEN,404,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1133,Kiribati,Kiribati.,KI,KIR,296,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1134,"Korea, Democratic People's Republic of (North Korea)",Democratic People's Republic of Korea (North Korea).,KP,PRK,408,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1135,"Korea, Republic of (South Korea)",Republic of Korea (South Korea).,KR,KOR,410,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1136,Kuwait,Kuwait.,KW,KWT,414,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1137,Kyrgyzstan,Kyrgyzstan.,KG,KGZ,417,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1138,Lao People's Democratic Republic (Laos).,Lao People's Democratic Republic (Laos).,LA,LAO,418,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1139,Latvia,Latvia.,LV,LVA,428,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1140,Lebanon,Lebanon.,LB,LBN,422,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1141,Lesotho,Lesotho.,LS,LSO,426,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1142,Liberia,Liberia.,LR,LBR,430,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1143,Libyan Arab Jamahiriya,Libyan Arab Jamahiriya.,LY,LBY,434,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1144,Liechtenstein,Liechtenstein.,LI,LIE,438,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1145,Lithuania,Lithuania.,LT,LTU,440,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1146,Luxembourg,Luxembourg.,LU,LUX,442,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1147,China - Macau,China - Macau special administrative region.,MO,MAC,446,"""Macau"" in ISO 3166.",EPSG,EPSG,2002-06-22 00:00:00,2002.16,0
+1148,"Macedonia, The Former Yugoslav Republic of",The Former Yugoslav Republic of Macedonia.,MK,MKD,807,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1149,Madagascar,Madagascar.,MG,MDG,450,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1150,Malawi,Malawi.,MW,MWI,454,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1151,Malaysia,Malaysia.,MY,MYS,458,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1152,Maldives,Maldives.,MV,MDV,462,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1153,Mali,Mali.,ML,MLI,466,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1154,Malta,Malta.,MT,MLT,470,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1155,Marshall Islands,Marshall Islands.,MH,MHL,584,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1156,Martinique,Martinique.,MQ,MTQ,474,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1157,Mauritania,Mauritania.,MR,MRT,478,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1158,Mauritius,Mauritius.,MU,MUS,480,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1159,Mayotte,Mayotte.,YT,MYT,175,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1160,Mexico,Mexico.,MX,MEX,484,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1161,"Micronesia, Federated States of",Federated States of Micronesia.,FM,FSM,583,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1162,"Moldova, Republic of",Republic of Moldova,MD,MDA,498,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1163,Monaco,Monaco.,MC,MCO,492,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1164,Mongolia,Mongolia.,MN,MNG,496,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1165,Montserrat,Montserrat.,MS,MSR,500,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1166,Morocco,Morocco.,MA,MAR,504,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1167,Mozambique,Mozambique.,MZ,MOZ,508,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1168,Myanmar (Burma),Myanmar (Burma).,MM,MMR,104,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/isoISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1169,Namibia,Namibia.,NA,NAM,516,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1170,Nauru,Nauru.,NR,NRU,520,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1171,Nepal,Nepal.,NP,NPL,524,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1172,Netherlands,Netherlands.,NL,NLD,528,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1173,Netherlands Antilles,Netherlands Antilles.,AN,ANT,530,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1174,New Caledonia,New Caledonia.,NC,NCL,540,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1175,New Zealand,New Zealand.,NZ,NZL,554,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1176,Nicaragua,Nicaragua.,NI,NIC,558,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1177,Niger,Niger.,NE,NER,562,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1178,Nigeria,Nigeria.,NG,NGA,566,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1179,Niue,Niue.,NU,NIU,570,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1180,Norfolk Island,Norfolk Island.,NF,NFK,574,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1181,Northern Mariana Islands,Northern Mariana Islands.,MP,MNP,580,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1182,Norway,Norway.,NO,NOR,578,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1183,Oman,Oman.,OM,OMN,512,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1184,Pakistan,Pakistan.,PK,PAK,586,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1185,Palau,Palau.,PW,PLW,585,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1186,Panama,Panama.,PA,PAN,591,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1187,Papua New Guinea (PNG),Papua New Guinea (PNG).,PG,PNG,598,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1188,Paraguay,Paraguay.,PY,PRY,600,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1189,Peru,Peru.,PE,PER,604,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1190,Philippines,Philippines.,PH,PHL,608,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1191,Pitcairn,Pitcairn.,PN,PCN,612,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1192,Poland,Poland.,PL,POL,616,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1193,Portugal,Portugal.,PT,PRT,620,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1194,Puerto Rico,Puerto Rico.,PR,PRI,630,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1195,Qatar,Qatar.,QA,QAT,634,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1196,Reunion,Reunion.,RE,REU,638,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1197,Romania,Romania.,RO,ROU,642,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1198,Russian Federation,Russian Federation.,RU,RUS,643,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1199,Rwanda,Rwanda.,RW,RWA,646,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1200,Saint Kitts and Nevis,Saint Kitts and Nevis.,KN,KNA,659,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1201,Saint Lucia,Saint Lucia.,LC,LCA,662,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1202,Saint Vincent and the Grenadines,Saint Vincent and the Grenadines.,VC,VCT,670,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1203,Samoa,Samoa.,WS,WSM,882,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1204,San Marino,San Marino.,SM,SMR,674,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1205,Sao Tome and Principe,Sao Tome and Principe.,ST,STP,678,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1206,Saudi Arabia,Saudi Arabia.,SA,SAU,682,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1207,Senegal,Senegal.,SN,SEN,686,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1208,Seychelles,Seychelles.,SC,SYC,690,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1209,Sierra Leone,Sierra Leone.,SL,SLE,694,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1210,Singapore,Singapore.,SG,SGP,702,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1211,Slovakia (Slovak Republic),Slovakia (Slovak Republic).,SK,SVK,703,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1212,Slovenia,Slovenia.,SI,SVN,705,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1213,Solomon Islands,Solomon Islands.,SB,SLB,90,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1214,Somalia,Somalia.,SO,SOM,706,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1215,South Africa,South Africa.,ZA,ZAF,710,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1216,South Georgia and the South Sandwich Islands,South Georgia and the South Sandwich Islands.,GS,SGS,239,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1217,Spain,Spain.,ES,ESP,724,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1218,Sri Lanka,Sri Lanka.,LK,LKA,144,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1219,Saint Helena,Saint Helena.,SH,SHN,654,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1220,Saint Pierre and Miquelon,Saint Pierre and Miquelon.,PM,SPM,666,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1221,Sudan,Sudan.,SD,SDN,736,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1222,Suriname,Suriname.,SR,SUR,740,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1223,Svalbard and Jan Mayen,Svalbard and Jan Mayen.,SJ,SJM,744,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1224,Swaziland,Swaziland.,SZ,SWZ,748,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1225,Sweden,Sweden.,SE,SWE,752,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1226,Switzerland,Switzerland.,CH,CHE,756,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1227,Syrian Arab Republic,Syrian Arab Republic.,SY,SYR,760,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1228,"Taiwan, Province of China","Taiwan, Province of China",TW,TWN,158,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1229,Tajikistan,Tajikistan.,TJ,TJK,762,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1230,"Tanzania, United Republic of",United Republic of Tanzania.,TZ,TZA,834,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1231,Thailand,Thailand.,TH,THA,764,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1232,Togo,Togo.,TG,TGO,768,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1233,Tokelau,Tokelau.,TK,TKL,772,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1234,Tonga,Tonga.,TO,TON,776,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1235,Trinidad and Tobago,Trinidad and Tobago.,TT,TTO,780,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1236,Tunisia,Tunisia.,TN,TUN,788,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1237,Turkey,Turkey.,TR,TUR,792,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1238,Turkmenistan,Turkmenistan.,TM,TKM,795,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1239,Turks and Caicos Islands,Turks and Caicos Islands.,TC,TCA,796,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1240,Tuvalu,Tuvalu.,TV,TUV,798,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1241,Uganda,Uganda.,UG,UGA,800,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1242,Ukraine,Ukraine.,UA,UKR,804,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1243,United Arab Emirates (UAE),United Arab Emirates (UAE).,AE,ARE,784,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1244,United Kingdom (UK),United Kingdom (UK).,GB,GBR,826,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1245,United States (USA),United States (USA).,US,USA,840,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1246,United States Minor Outlying Islands,United States Minor Outlying Islands,UM,UMI,581,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1247,Uruguay,Uruguay.,UY,URY,858,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1248,Uzbekistan,Uzbekistan.,UZ,UZB,860,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1249,Vanuatu,Vanuatu.,VU,VUT,548,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1250,Holy See (Vatican City State),Holy See (Vatican City State),VA,VAT,336,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1251,Venezuela,Venezuela.,VE,VEN,862,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1252,Vietnam,Vietnam.,VN,VNM,704,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1253,"Virgin Islands, British",British Virgin Islands.,VG,VGB,92,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1254,"Virgin Islands, US",US Virgin Islands.,VI,VIR,850,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1255,Wallis and Futuna,Wallis and Futuna.,WF,WLF,876,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1256,Western Sahara,Western Sahara.,EH,ESH,732,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1257,Yemen,Yemen.,YE,YEM,887,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1258,Yugoslavia,Yugoslavia.,YU,YUG,891,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1259,"Congo, The Democratic Republic of the Congo (Zaire)",The Democratic Republic of the Congo (Zaire).,CD,COD,180,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1260,Zambia,Zambia.,ZM,ZMB,894,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1261,Zimbabwe,Zimbabwe.,ZW,ZWE,716,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1262,World,World.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1263,Not specified,Not specified.,,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+1264,UK - Great Britain onshore,United Kingdom (UK) - Great Britain - England  Scotland  Wales - onshore; Isle of Man.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1265,Argentina - Comodoro Rivadavia,Argentina - Comodoro Rivadavia area.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1266,Venezuela - Puerto La Cruz,Venezuela - Puerto La Cruz area.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1267,Venezuela - Barinas,Venezuela - Barinas area.,,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+1268,Venezuela - Falcon state,Venezuela - Falcon state.,,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+1269,Venezuela - Pedregal area of Falcon state,Venezuela - Pedregal area of Falcon state.,,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+1270,Venezuela - Maracaibo south,Venezuela - south Maracaibo area.,,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+1271,Africa - Ethiopia and Sudan,Ethiopia; Sudan.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1272,Asia - Middle East - Kuwait and Saudi,Kuwait; Saudi Arabia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1273,Antigua,Antigua and Barbuda - Antigua.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+1274,Brazil - Aratu,Brazil - coastal areas south of 2 deg 55 min South.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1275,Netherlands - onshore,Netherlands - onshore.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1276,"Africa - Botswana, Malawi, Zambia, Zimbabwe.",Botswana; Malawi; Zambia; Zimbabwe.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1277,"Africa - Kenya, Tanzania and Uganda",Kenya; Tanzania; Uganda.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1278,Antarctica - Australian sector,Antarctica - Australian sector.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1279,Australasia - Australia and PNG - AGD66,Australia - Australian Capital Territory (ACT); New South Wales (NSW); Northern Territory (NT); Tasmania; Victoria.  Papua New Guinea (PNG).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1280,Australia - Western Australia (WA),Australia - Western Australia (WA).,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1281,Australia - mainland,Australia - Australian Capital Territory (ACT); New South Wales (NSW); Northern Territories (NT); Queensland; South Australia (SA); Western Australia (WA); Victoria.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1282,Australia - Tasmania,Australia - Tasmania.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1283,Canada - Maritime Provinces,Canada - New Brunswick; Nova Scotia; Prince Edward Island.,,,,,EPSG,EPSG,1997-07-22 00:00:00,,0
+1284,Europe - Soviet Union,Armenia;  Azerbaijan;  Belorus;  Estonia;  Georgia;  Kazakstan;  Kirgizstan;  Latvia;  Lithuania;  Moldavia;  Russian Federation;  Tadzhikistan;  Turkmenistan;  Ukraine;  Uzbekistan.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1285,Indonesia - Java,Indonesia - Java.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1286,Europe - Liechtenstein and Switzerland.,Liechtenstein; Switzerland.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1287,Indonesia - Banga & Belitung Islands.,Indonesia - Banga & Belitung Islands.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1288,Angola - Angola proper,Angola - Angola proper,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1289,Canada - CVD28,Canada - Alberta; British Columbia; Manitoba; New Brunswick; Nova Scotia; Ontario; Prince Edward Island; Quebec; Saskatchewan.,,,,,EPSG,EPSG,1996-12-12 00:00:00,,0
+1290,Africa - Botswana and South Africa.,Botswana; South Africa.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1291,Asia - Caspian Sea,Azerbaijan - offshore; Kazakstan - offshore;  Russian Federation - Caspian Sea;  Turkmenistan - offshore.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1292,Argentina - Neuquen province,Argentina - Neuquen province.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1024,Afghanistan,Afghanistan.,AF,AFG,4,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1025,Albania,Albania.,AL,ALB,8,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1026,Algeria,Algeria.,DZ,DZA,12,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1027,American Samoa,American Samoa.,AS,ASM,16,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1028,Andorra,Andorra.,AD,AND,20,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1029,Angola,Angola.,AO,AGO,24,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1030,Anguilla,Anguilla.,AI,AIA,660,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1031,Antarctica,Antarctica.,AQ,ATA,10,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1032,Antigua and Barbuda,Antigua and Barbuda.,AG,ATG,28,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1033,Argentina,Argentina.,AR,ARG,32,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1034,Armenia,Armenia.,AM,ARM,51,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1035,Aruba,Aruba.,AW,ABW,533,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1036,Australia,Australia.,AU,AUS,36,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1037,Austria,Austria.,AT,AUT,40,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1038,Azerbaijan,Azerbaijan.,AZ,AZE,31,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1039,Bahamas,Bahamas.,BS,BHS,44,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1040,Bahrain,Bahrain.,BH,BHR,48,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1041,Bangladesh,Bangladesh.,BD,BGD,50,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1042,Barbados,Barbados.,BB,BRB,52,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1043,Belarus,Belarus.,BY,BLR,112,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1044,Belgium,Belgium.,BE,BEL,56,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1045,Belize,Belize.,BZ,BLZ,84,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1046,Benin,Benin.,BJ,BEN,204,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1047,Bermuda,Bermuda.,BM,BMU,60,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1048,Bhutan,Bhutan.,BT,BTN,64,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1049,Bolivia,Bolivia.,BO,BOL,68,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1050,Bosnia and Herzegowina,Bosnia and Herzegowina.,BA,BIH,70,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1051,Botswana,Botswana.,BW,BWA,72,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1052,Bouvet Island,Bouvet Island.,BV,BVT,74,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1053,Brazil,Brazil.,BR,BRA,76,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1054,British Indian Ocean Territory,British Indian Ocean Territory.,IO,IOT,86,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1055,Brunei Darussalam,Brunei Darussalam.,BN,BRN,96,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1056,Bulgaria,Bulgaria.,BG,BGR,100,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1057,Burkina Faso,Burkina Faso.,BF,BFA,854,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1058,Burundi,Burundi.,BI,BDI,108,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1059,Cambodia,Cambodia.,KH,KHM,116,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1060,Cameroon,Cameroon.,CM,CMR,120,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1061,Canada,Canada - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon.,CA,CAN,124,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1062,Cape Verde,Cape Verde.,CV,CPV,132,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1063,Cayman Islands,Cayman Islands.,KY,CYM,136,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1064,Central African Republic,Central African Republic.,CF,CAF,140,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1065,Chad,Chad.,TD,TCD,148,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1066,Chile,Chile.,CL,CHL,152,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1067,China,China.,CN,CHN,156,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1068,Christmas Island,Christmas Island.,CX,CXR,162,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1069,Cocos (Keeling) Islands,Cocos (Keeling) Islands.,CC,CCK,166,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1070,Colombia,Colombia.,CO,COL,170,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1071,Comoros,Comoros.,KM,COM,174,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1072,Congo,Congo.,CG,COG,178,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1073,Cook Islands,Cook Islands.,CK,COK,184,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1074,Costa Rica,Costa Rica.,CR,CRI,188,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1075,Cote d'Ivoire (Ivory Coast),C�te d'Ivoire (Ivory Coast).,CI,CIV,384,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1076,Croatia,Croatia.,HR,HRV,191,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1077,Cuba,Cuba.,CU,CUB,192,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1078,Cyprus,Cyprus.,CY,CYP,196,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1079,Czech Republic,Czech Republic.,CZ,CZE,203,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1080,Denmark,Denmark.,DK,DNK,208,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1081,Djibouti,Djibouti.,DJ,DJI,262,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1082,Dominica,Dominica.,DM,DMA,212,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1083,Dominican Republic,Dominican Republic.,DO,DOM,214,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1084,East Timor,East Timor.,TP,TMP,626,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1085,Ecuador,Ecuador.,EC,ECU,218,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1086,Egypt,Egypt.,EG,EGY,818,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1087,El Salvador,El Salvador.,SV,SLV,222,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1088,Equatorial Guinea,Equatorial Guinea.,GQ,GNQ,226,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1089,Eritrea,Eritrea.,ER,ERI,232,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1090,Estonia,Estonia.,EE,EST,233,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1091,Ethiopia,Ethiopia.,ET,ETH,231,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1092,Falkland Islands (Malvinas),Falkland Islands (Malvinas).,FK,FLK,238,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1093,Faroe Islands,Faroe Islands.,FO,FRO,234,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1094,Fiji,Fiji.,FJ,FJI,242,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1095,Finland,Finland.,FI,FIN,246,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1096,France,France.,FR,FRA,250,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1097,French Guiana,French Guiana.,GF,GUF,254,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1098,French Polynesia,French Polynesia.,PF,PYF,258,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1099,French Southern Territories,French Southern Territories.,TF,ATF,260,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1100,Gabon,Gabon.,GA,GAB,266,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1101,Gambia,Gambia.,GM,GMB,270,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1102,Georgia,Georgia.,GE,GEO,268,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1103,Germany,Germany.,DE,DEU,276,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1104,Ghana,Ghana.,GH,GHA,288,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1105,Gibraltar,Gibraltar.,GI,GIB,292,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1106,Greece,Greece.,GR,GRC,300,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1107,Greenland,Greenland.,GL,GRL,304,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1108,Grenada,Grenada.,GD,GRD,308,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1109,Guadeloupe,Guadeloupe.,GP,GLP,312,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1110,Guam,Guam.,GU,GUM,316,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1111,Guatemala,Guatemala.,GT,GTM,320,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1112,Guinea,Guinea.,GN,GIN,324,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1113,Guinea-Bissau,Guinea-Bissau.,GW,GNB,624,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1114,Guyana,Guyana.,GY,GUY,328,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1115,Haiti,Haiti.,HT,HTI,332,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1116,Heard Island and McDonald Islands,Heard Island and McDonald Islands.,HM,HMD,334,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1117,Honduras,Honduras.,HN,HND,340,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,2002.341,0
+1293,Brazil - Corrego Alegre,Brazil - NE coastal area between 45 deg W and 40 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1294,Portugal - onshore,Portugal - onshore.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1295,Germany - DHDN,"Germany - onshore - Baden-Wurtemberg, Bayern, Hessen, Niedersachsen, Nordrhein-Westfalen, Rheinland-Pfalz, Saarland, Schleswig-Holstein. Also former DDR states of Sachsen and Thuringen by transformation.",,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1296,Europe - ED50,Europe - west - Denmark; Faroe Islands; France offshore; Italy; Ireland offshore; Netherlands offshore; Germany offshore; Greece (offshore); North Sea; Norway; Spain; Turkey; United Kingdom UKCS offshore. Egypt - Western Desert.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1297,Europe - ED87,Europe - west.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1298,Europe - ETRS89,Europe: Austria; Belgium; Bosnia and Herzegovina; Croatia; Czech Republic; Denmark; Estonia; Finland; France; Germany; Hungary; Italy; Latvia; Liechtenstein; Lithuania; Luxembourg; Netherlands; Norway; Poland; Portugal; Romania; Slovakia; Slovenia; Spain; Sweden; Switzerland; United Kingdom (UK).,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1299,Europe - EVRF2000,Europe: Austria; Belgium; Bosnia and Herzegovina; Croatia; Czech Republic; Denmark; Estonia; Finland; France; Germany; Hungary; Italy; Latvia; Liechtenstein; Lithuania; Luxembourg; Netherlands; Norway; Poland; Portugal; Romania; Slovakia; Slovenia; Spain; Sweden; Switzerland; United Kingdom (UK).,,,,,EPSG,EPSG,2001-09-03 00:00:00,,0
+1300,Iran - FD58,Islamic Republic of Iran - Gulf coast and Arwaz areas.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+1301,Portugal - central Azores,"Portugal - central Azores - Graciosa, Terceira, Sao Jorge, Pico, Faial.",,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1302,Asia - Cambodia and Vietnam,Cambodia; Vietnam.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1303,South America - Tierra del Fuego.,Argentina and Chile - Tierra del Fuego.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1304,Asia - Myanmar and Thailand,Myanmar (Burma); Thailand.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1305,Europe - Ireland (Republic and Ulster),Ireland. United Kingdom (UK) - Northern Ireland (Ulster).,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+1306,Europe - Czechoslovakia,Czech Republic; Slovakia.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1307,Asia - Bangladesh; India; Myanmur; Pakistan.,Bangladesh; India; Myanmar (Burma); Pakistan.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1308,Asia - Bangladesh; India; Pakistan.,Bangladesh; India; Pakistan.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1309,Asia - Malaysia (west) and Singapore.,Malaysia - West Malaysia; Singapore.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1310,Kuwait - Kuwait City,Kuwait - Kuwait City.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1311,Venezuela - Cabinas,Venezuela - Cabinas area.,,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+1312,Venezuela - Lake Maracaibo,Venezuela - Lake Maracaibo area.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1313,Venezuela - Loma Quintana,Venezuela - north.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1314,Portugal - Madeira islands,"Portugal - Madeira, Porto Santo and Desertas islands.",,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1315,Mozambique - west.,Mozambique - west.,,,,,EPSG,EPSG,1998-04-16 00:00:00,,0
+1316,Indonesia - Sulawesi SW,Indonesia - south west Sulawesi.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1317,Angola - Cabinda offshore,Angola - Cabinda offshore.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1318,Angola - Cabinda,Angola - Cabinda,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1319,Venezuela - Maracaibo area,Venezuela - Maracaibo area.,,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+1320,Venezuela - Maturin,Venezuela - Maturin area.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1321,Europe - MGI,"Austria. Bosnia and Herzegowina. Croatia. FYR Macedonia. Slovenia. Yugoslavia (Serbia, Montenegro).",,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1322,Trinidad and Tobago - Tobago,Trinidad and Tobago - Tobago.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1323,USA - conus,United States (USA) - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virg [...]
+1324,USA (all states),United States (USA) - Alabama; Alaska; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Hawaii; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas [...]
+1325,North America - all Canada and USA subunits,North America: Canada - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland; North West Territories; Nova Scotia; Nunavet; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon. United States (USA) - Alabama; Alaska; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; [...]
+1326,France - mainland,France - mainland.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1327,France - Corsica,France - Corsica.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1328,Indonesia - Kalimantan E - Mahakam delta,Indonesia - east Kalimantan - Mahakam delta area.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1329,Mozambique - south,Mozambique - south.,,,,,EPSG,EPSG,1998-04-16 00:00:00,,0
+1330,USA - Alaska,United States (USA) - Alaska,,,,,EPSG,EPSG,2001-09-03 00:00:00,,0
+1331,USA - Alaska - St. George Island,United States (USA) - Alaska - St. George Island.,,,,,EPSG,EPSG,1999-05-24 00:00:00,,0
+2040,WGS84 / UTM zone 21N,Between 60 and 54 deg West; northern hemisphere. Barbados. Brazil. Canada - Newfoundland; Quebec. French Guiana. Greenland. Guyana. St. Pierre and Miquelon. Suriname.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2041,WGS84 / UTM zone 21S,Between 60 and 54 deg West; southern hemisphere. Argentina. Bolivia. Brazil. Falkland Islands (Malvinas). Paraguay. Uruguay.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2042,WGS84 / UTM zone 22N,Between 54 and 48 deg West; northern hemisphere. Brazil. Canada - Newfoundland. French Guiana. Greenland.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2043,WGS84 / UTM zone 22S,Between 54 and 48 deg West; southern hemisphere. Brazil.  Uruguay.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2044,WGS84 / UTM zone 23N,Between 48 and 42 deg West; northern hemisphere. Greenland.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2045,WGS84 / UTM zone 23S,Between 48 and 42 deg West; southern hemisphere. Brazil.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2046,WGS84 / UTM zone 24N,Between 42 and 36 deg West; northern hemisphere. Greenland.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2047,WGS84 / UTM zone 24S,Between 42 and 36 deg West; southern hemisphere. Brazil. South Georgia and the South Sandwich Islands.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2048,WGS84 / UTM zone 25N,Between 36 and 30 deg West; northern hemisphere. Greenland.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2049,WGS84 / UTM zone 25S,Between 36 and 30 deg West; southern hemisphere. Brazil.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2050,WGS84 / UTM zone 26N,Between 30 and 24 deg West; northern hemisphere. Greenland. Iceland.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2051,WGS84 / UTM zone 26S,Between 30 and 24 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2052,WGS84 / UTM zone 27N,Between 24 and 18 deg West; northern hemisphere. Greenland. Iceland.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2053,WGS84 / UTM zone 27S,Between 24 and 18 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2054,WGS84 / UTM zone 28N,Between 18 and 12 deg West; northern hemisphere. Gambia. Greenland. Guinea. Guinea-Bissau. Iceland. Ireland - offshore Porcupine Basin. Mauritania. Morocco. Senegal. Sierra Leone. Western Sahara.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2055,WGS84 / UTM zone 28S,Between 18 and 12 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2056,WGS84 / UTM zone 29N,Between 12 and 6 deg West; northern hemisphere. Algeria. Cote D'Ivoire (Ivory Coast). Faroe Islands. Guinea. Ireland. Mali. Mauritania. Morocco. Portugal. Sierra Leone. Spain. United Kingdom (UK). Western Sahara.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2057,WGS84 / UTM zone 29S,Between 12 and 6 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2058,WGS84 / UTM zone 30N,Between 6 deg West and 0 deg East; northern hemisphere. Algeria. Burkino Faso. Cote' Ivoire (Ivory Coast). Faroe Islands - offshore. France. Ghana. Gibraltar. Ireland - offshore Irish Sea. Mali. Mauritania. Morocco. Spain. United Kingdom (UK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2059,WGS84 / UTM zone 30S,Between 6 deg West and 0 deg East; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2060,WGS84 / UTM zone 31N,Between 0 and 6 deg East; northern hemisphere. Algeria. Andorra. Benin. Bukino Faso. Denmark - North Sea. France. Germany - North Sea. Ghana. Luxembourg. Mali. Netherlands. Niger. Nigeria. Norway. Spain. Togo. United Kingdom (UK) - North Sea.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2061,WGS84 / UTM zone 31S,Between 0 and 6 deg East; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2062,WGS84 / UTM zone 32N,Between 6 and 12 deg East; northern hemisphere. Algeria. Austria. Cameroon. Denmark. Equatorial Guinea. France. Gabon. Germany. Italy. Libya. Liechtenstein. Monaco. Netherlands. Niger. Nigeria. Norway. Sao Tome and Principe. Svalbard and Jan Mayen Islands. Sweden. Switzerland. Tunisia. Vatican City State.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2063,WGS84 / UTM zone 32S,Between 6 and 12 deg East; southern hemisphere. Angola. Congo. Gabon. Namibia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2064,WGS84 / UTM zone 33N,Between 12 and 18 deg East; northern hemisphere. Austria. Bosnia and Herzegowina. Cmeroon. Central African Republic. Chad. Congo. Croatia. Czech Republic. Democratic Republic of the Congo (Zaire). Gabon. Germany. Hungary. Italy. Libya. Malta. Niger. Nigeria. Norway. Poland. San Marino. Slovakia. Slovenia. Svalbard and Jan Mayen Islands. Sweden.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2065,WGS84 / UTM zone 33S,Between 12 and 18 deg East; southern hemisphere. Angola. Congo. Democratic Republic of the Congo (Zaire). Gabon. Namibia. South Africa.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2066,WGS84 / UTM zone 34N,Between 18 and 24 deg East; northern hemisphere. Albania. Belarus. Bosnia and Herzegowina. Bulgaria. Central African Republic. Chad. Croatia. Democratic Republic of the Congo (Zaire). Estonia. Finland. FYR Macedonia. Greece. Hungary. Italy. Latvia. Libya. Lithuania. Norway. Poland. Romania. Russian Federation. Slovakia. Sudan. Svalbard. Sweden. Ukraine. Yugoslavia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2067,WGS84 / UTM zone 34S,Between 18 and 24 deg East; southern hemisphere. Angola. Botswana. Democratic Republic of the Congo (Zaire). Namibia. South Africa. Zambia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2068,WGS84 / UTM zone 35N,Between 24 and 30 deg East; northern hemisphere. Belarus. Bulgaria. Central African Republic. Democratic Republic of the Congo (Zaire). Egypt. Estonia. Finland. Greece. Latvia. Lesotho. Libya. Lithuania. Moldova. Norway. Romania. Russian Federation. Sudan. Svalbard. Turkey. Uganda. Ukraine.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2069,WGS84 / UTM zone 35S,Between 24 and 30 deg East; southern hemisphere. Botswana. Burundi. Democratic Republic of the Congo (Zaire). Rwanda. South Africa. Tanzania. Uganda. Zambia. Zimbabwe.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2070,WGS84 / UTM zone 36N,Between 30 and 36 deg East; northern hemisphere. Belarus. Cyprus. Egypt. Ethiopia. Finland. Israel. Jordan. Kenya. Lebanon. Norway. Russian Federation. Saudi Arabia. Sudan. Syria. Turkey. Uganda. Ukraine.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2071,WGS84 / UTM zone 36S,Between 30 and 36 deg East; southern hemisphere. Burundi. Kenya. Malawi. Mozambique. Rwanda. South Africa. Swaziland. Tanzania. Uganda. Zambia. Zimbabwe.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2072,WGS84 / UTM zone 37N,Between 36 and 42 deg East; northern hemisphere. Djibouti. Egypt. Eritrea. Ethiopia. Georgia. Iraq. Jordan. Kenya. Lebanon. Russian Federation. Saudi Arabia. Somalia. Sudan. Syria. Turkey. Ukraine.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2073,WGS84 / UTM zone 37S,Between 36 and 42 deg East; southern hemisphere. Kenya. Mozambique. Tanzania.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2074,WGS84 / UTM zone 38N,Between 42 and 48 deg East; northern hemisphere. Armenia. Azerbaijan. Djibouti. Eritrea. Ethiopia. Georgia. Islamic Republic of Iran. Iraq. Kazakstan. Kuwait. Russian Federation. Saudi Arabia. Somalia. Turkey. Yemen.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2075,WGS84 / UTM zone 38S,Between 42 and 48 deg East; southern hemisphere. Madagascar.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2076,WGS84 / UTM zone 39N,Between 48 and 54 deg East; northern hemisphere. Azerbaijan. Bahrain. Islamic Republic of Iran. Kazakstan. Kuwait. Oman. Qatar. Russian Federation. Saudi Arabia. Somalia. Turkmenistan. United Arab Emirates. Yemen.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2077,WGS84 / UTM zone 39S,Between 48 and 54 deg East; southern hemisphere. Madagascar.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2078,WGS84 / UTM zone 40N,Between 54 and 60 deg East; northern hemisphere. Islamic Republic of Iran. Kazakstan. Oman. Russian Federation. Saudi Arabia. Turkmenistan. United Arab Emirates. Uzbekistan.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2079,WGS84 / UTM zone 40S,Between 54 and 60 deg East; southern hemisphere. Seychelles.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2080,WGS84 / UTM zone 41N,Between 60 and 66 deg East; northern hemisphere. Afghanistan. Islamic Republic of Iran. Kazakstan. Pakistan. Russian Federation. Turkmenistan.  Uzbekistan.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2081,WGS84 / UTM zone 41S,Between 60 and 66 deg East; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2082,WGS84 / UTM zone 42N,Between 66 and 72 deg East; northern hemisphere. Afghanistan. India. Kazakstan. Kyrgyzstan. Pakistan. Russian Federation. Tajikistan. Uzbekistan.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2083,WGS84 / UTM zone 42S,Between 66 and 72 deg East; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2084,WGS84 / UTM zone 43N,Between 72 and 78 deg East; northern hemisphere. China. India. Kazakstan. Kyrgyzstan. Maldives. Pakistan. Russian Federation. Tajikistan.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2085,WGS84 / UTM zone 43S,Between 72 and 78 deg East; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1332,USA - Alaska - St. Lawrence Island,United States (USA) - Alaska - St. Lawrence Island.,,,,,EPSG,EPSG,1999-05-24 00:00:00,,0
+1333,USA - Alaska - St. Paul Island,United States (USA) - Alaska - St. Paul Island.,,,,,EPSG,EPSG,1999-05-24 00:00:00,,0
+1334,USA - Hawaii,United States (USA) - Hawaii.,,,,,EPSG,EPSG,1999-05-24 00:00:00,,0
+1335,Caribbean - Puerto Rico and the Virgin Islands,Puerto Rico; Virgin Islands (British); Virgin Islands (US).,,,,,EPSG,EPSG,1999-05-24 00:00:00,,0
+1336,Canada - CSRS98,Canada - Alberta; New Brunswick; Saskatchewan; Prince Edward Island; and Quebec.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,1
+1337,USA and American Samoa HARN,American Samoa. United States (USA) - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Hawaii; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Dakota; Ohio; Oklahoma; Oregon; Rhode Island; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia;  [...]
+1338,Iran - Taheri refinery,Islamic Republic of Iran - Taheri refinery site only.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1339,Trinidad and Tobago - Trinidad,Trinidad and Tobago - Trinidad.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1340,Yemen - South Yemen,Yemen - South Yemen.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1341,South America - all countries,"South America - Argentina, Brazil, Bolivia, Chile, Colombia, Ecuador, French Guiana, Guyana, Paraguay, Peru, Suriname, Uruguay, Venezuela.",,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1342,Sierra Leone - Freetown Peninsula,Sierra Leone - Freetown Peninsula.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1343,Germany - east Germany all states,Germany - states of former East Germany (DDR) - Brandenburg; Mecklenburg-Vorpommern; Sachsen; Sachsen-Anhalt; Thuringen.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1344,Portugal - western Azores,"Portugal - western Azores - Flores, Corvo.",,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1345,Portugal - eastern Azores,"Portugal - eastern Azores - Sao Miguel, Santa Maria.",,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1346,Qatar - onshore,Qatar - onshore.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1347,Belgium - onshore,Belgium - onshore.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1348,South America - PSAD56,Bolivia; Ecuador; Peru; [Venezuela].,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1349,North America - NAD27,North and central America: Antigua and Barbuda. Belize. Canada - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland; North West Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon. Costa Rica. Cuba. El Salvador. Guatemala. Honduras. Mexico. Nicaragua. United States (USA) - Alabama; Alaska; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kans [...]
+1350,North America - NAD83,North America: Canada - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland; North West Territories; Nova Scotia; Nunavet; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon. Greenland. Mexico. United States (USA) - Alabama; Alaska; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Hawaii; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississ [...]
+1351,Asia - Middle East - Nahrwan,Arabian Gulf; Kuwait; Qatar - offshore; United Arab Emirates (UAE) - Abu Dhabi; Dubai; Sharjah; Ajman; Fujairah; Ras Al Kaimah; Umm Al Qaiwain.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1352,Norway - onshore,Norway - onshore.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1353,France - onshore,France - onshore.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1354,Europe - British Isles - UK and Ireland,Ireland - onshore.  United Kingdom (UK) - onshore - England; Scotland; Wales; Northern Ireland.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1355,Indonesia - Sumatra,Indonesia - Sumatra.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1356,"Asia - Middle East - Israel, Jordan and Palestine Territory",Israel; Jordan; Palestine Territory.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.34,0
+1357,Europe - Pulkovo,Armenia; Azerbaijan; Belarus; Estonia; Georgia; Kazakstan; Kirgistan; Latvia; Lithuania; Moldova; Russian Federation; Tadzhikstan; Turkmenistan; Ukraine; Uzbekistan; Germany (former DDR); Czech Republic; Slovakia; Hungary; Poland; Romania; Latvia; Lithuania; Estonia; Albania.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1358,South America - SAD69,South America - Brazil.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1359,Indonesia - Kalimantan SE,Indonesia - southeast Kalimantan.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1360,Indonesia - Kalimantan E,Indonesia - east Kalimantan.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1361,Sudan - south,Sudan - south.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1362,Asia - Brunei and East Malaysia,Brunei; Malaysia - East Malaysia (Sabah; Sarawak).,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1363,UAE - Abu Dhabi and Dubai,United Arab Emirates (UAE) - Abu Dhabi; Dubai.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1364,Asia - Japan and Korea,Japan; North Korea; South Korea.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1365,Algeria - N of 32 deg N,Algeria - north of 32 deg North.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1366,"Africa - Algeria, Morocco and Tunisia",Algeria; Morocco; Tunisia.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1367,Canada - Ontario,Canada - Ontario.,,,,,EPSG,EPSG,1999-05-12 00:00:00,,0
+1368,Canada - Quebec,Canada - Quebec.,,,,,EPSG,EPSG,1999-10-22 00:00:00,,0
+1369,France - Alsace,France - Alsace.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1370,Venezuela - Deltana,Venezuela - Deltana area.,,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+1371,Venezuela - Guarico state,Venezuela - Guarico state.,,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+1372,USA - Alabama,United States (USA) - Alabama.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1373,USA - Arizona,United States (USA) - Arizona.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1374,USA - Arkansas,United States (USA) - Arkansas.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1375,USA - California,United States (USA) - California.,,,,,EPSG,EPSG,2001-09-03 00:00:00,,0
+1376,USA - Colorado,United States (USA) - Colorado.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1377,USA - Connecticut,United States (USA) - Connecticut - counties of Fairfield; Hartford; Litchfield; Middlesex; New Haven; New London; Tolland; Windham.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+1378,USA - Delaware,United States (USA) - Delaware - counties of Kent; New Castle; Sussex.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+1379,USA - Florida,United States (USA) - Florida.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1380,USA - Georgia,United States (USA) - Georgia.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1381,USA - Idaho,United States (USA) - Idaho.,,,,,EPSG,EPSG,2001-09-03 00:00:00,,0
+1382,USA - Illinois,United States (USA) - Illinois.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1383,USA - Indiana,United States (USA) - Indiana.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1384,USA - Iowa,United States (USA) - Iowa.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1385,USA - Kansas,United States (USA) - Kansas.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1386,USA - Kentucky,United States (USA) - Kentucky.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1387,USA - Louisiana,United States (USA) - Louisiana.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1388,USA - Maine,United States (USA) - Maine.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1389,USA - Maryland,United States (USA) - Maryland - counties of Allegany; Anne Arundel; Baltimore; Calvert; Caroline; Carroll; Cecil; Charles; Dorchester; Frederick; Garrett; Harford; Howard; Kent; Montgomery; Prince Georges; Queen Annes; Somerset; St. Marys; Talbot; Washington; Wicomico; Worcester.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+1390,USA - Massachusetts,United States (USA) - Massachusetts.,,,,,EPSG,EPSG,2001-09-03 00:00:00,,0
+1391,USA - Michigan,United States (USA) - Michigan.,,,,,EPSG,EPSG,1996-12-12 00:00:00,,0
+1392,USA - Minnesota,United States (USA) - Minnesota.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1393,USA - Mississippi,United States (USA) - Mississippi.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1394,USA - Missouri,United States (USA) - Missouri.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1395,USA - Montana,United States (USA) - Montana - counties of Beaverhead; Big Horn; Blaine; Broadwater; Carbon; Carter; Cascade; Chouteau; Custer; Daniels; Dawson; Deer Lodge; Fallon; Fergus; Flathead; Gallatin; Garfield; Glacier; Golden Valley; Granite; Hill; Jefferson; Judith Basin; Lake; Lewis and Clark; Liberty; Lincoln; Madison; McCone; Meagher; Mineral; Missoula; Musselshell; Park; Petroleum; Phillips; Pondera; Powder River; Powell; Prairie; Ravalli; Richland; Roosevelt; Rosebud;  [...]
+1396,USA - Nebraska,United States (USA) - Nebraska - counties of Adams; Antelope; Arthur; Banner; Blaine; Boone; Box Butte; Boyd; Brown; Buffalo; Burt; Butler; Cass; Cedar; Chase; Cherry; Cheyenne; Clay; Colfax; Cuming; Custer; Dakota; Dawes; Dawson; Deuel; Dixon; Dodge; Douglas; Dundy; Fillmore; Franklin; Frontier; Furnas; Gage; Garden; Garfield; Gosper; Grant; Greeley; Hall; Hamilton; Harlan; Hayes; Hitchcock; Holt; Hooker; Howard; Jefferson; Johnson; Kearney; Keith; Keya Paha; Kimball [...]
+1397,USA - Nevada,United States (USA) - Nevada.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1398,USA - New Hampshire,United States (USA) - New Hampshire - counties of Belknap; Carroll; Cheshire; Coos; Grafton; Hillsborough; Merrimack; Rockingham; Strafford; Sullivan.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1399,USA - New Jersey,United States (USA) - New Jersey - counties of Atlantic; Bergen; Burlington; Camden; Cape May; Cumberland; Essex; Gloucester; Hudson; Hunterdon; Mercer; Middlesex; Monmouth; Morris; Ocean; Passaic; Salem; Somerset; Sussex; Union; Warren.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1400,USA - New Mexico,United States (USA) - New Mexico.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1401,USA - New York,United States (USA) - New York.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1402,USA - North Carolina,United States (USA) - North Carolina - counties of Alamance; Alexander; Alleghany; Anson; Ashe; Avery; Beaufort; Bertie; Bladen; Brunswick; Buncombe; Burke; Cabarrus; Caldwell; Camden; Carteret; Caswell; Catawba; Chatham; Cherokee; Chowan; Clay; Cleveland; Columbus; Craven; Cumberland; Currituck; Dare; Davidson; Davie; Duplin; Durham; Edgecombe; Forsyth; Franklin; Gaston; Gates; Graham; Granville; Greene; Guilford; Halifax; Harnett; Haywood; Henderson; Hertford; [...]
+1403,USA - North Dakota,United States (USA) - North Dakota.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1404,USA - Ohio,United States (USA) - Ohio.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1405,USA - Oklahoma,United States (USA) - Oklahoma.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1406,USA - Oregon,United States (USA) - Oregon.,,,,,EPSG,EPSG,2001-09-03 00:00:00,,0
+1407,USA - Pennsylvania,United States (USA) - Pennsylvania.,,,,,EPSG,EPSG,2001-09-03 00:00:00,,0
+1408,USA - Rhode Island,United States (USA) - Rhode Island - counties of Bristol; Kent; Newport; Providence; Washington.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1409,USA - South Carolina,United States (USA) - South Carolina - counties of Abbeville; Aiken; Allendale; Anderson; Bamberg; Barnwell; Beaufort; Berkeley; Calhoun; Charleston; Cherokee; Chester; Chesterfield; Clarendon; Colleton; Darlington; Dillon; Dorchester; Edgefield; Fairfield; Florence; Georgetown; Greenville; Greenwood; Hampton; Horry; Jasper; Kershaw; Lancaster; Laurens; Lee; Lexington; Marion; Marlboro; McCormick; Newberry; Oconee; Orangeburg; Pickens; Richland; Saluda; Spartanb [...]
+1410,USA - South Dakota,United States (USA) - South Dakota.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1411,USA - Tennessee,United States (USA) - Tennessee - counties of Anderson; Bedford; Benton; Bledsoe; Blount; Bradley; Campbell; Cannon; Carroll; Carter; Cheatham; Chester; Claiborne; Clay; Cocke; Coffee; Crockett; Cumberland; Davidson; De Kalb; Decatur; Dickson; Dyer; Fayette; Fentress; Franklin; Gibson; Giles; Grainger; Greene; Grundy; Hamblen; Hamilton; Hancock; Hardeman; Hardin; Hawkins; Haywood; Henderson; Henry; Hickman; Houston; Humphreys; Jackson; Jefferson; Johnson; Knox; Lake; [...]
+1412,USA - Texas,United States (USA) - Texas.,,,,,EPSG,EPSG,2001-09-03 00:00:00,,0
+1413,USA - Utah,United States (USA) - Utah.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1414,USA - Vermont,United States (USA) - Vermont - counties of Addison; Bennington; Caledonia; Chittenden; Essex; Franklin; Grand Isle; Lamoille; Orange; Orleans; Rutland; Washington; Windham; Windsor.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1415,USA - Virginia,United States (USA) - Virginia.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1416,USA - Washington,United States (USA) - Washington.,,,,,EPSG,EPSG,2001-09-03 00:00:00,,0
+1417,USA - West Virginia,United States (USA) - West Virginia.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1418,USA - Wisconsin,United States (USA) - Wisconsin.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1419,USA - Wyoming,United States (USA) - Wyoming.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+1420,Canada - Quebec - E of 57 deg W,Canada - Quebec - east of 57 deg West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1421,Canada - Quebec - 60 to 57 deg W.,Canada - Quebec between 60 and 57 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1422,Canada - Quebec - 63 to 60 deg W,Canada - Quebec between 63 and 60 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1423,Canada - Quebec - 66 to 63 deg W,Canada - Quebec between 66 and 63 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1424,Canada - Quebec - 69 to 66 deg W,Canada - Quebec between 69 and  66 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1425,Canada - Quebec - 72 to 69 deg W,Canada - Quebec between 72 and 69 deg West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1426,Canada - Quebec - 75 to 72 deg W,Canada - Quebec between 75 and 72 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1427,Canada - Quebec - 78 to 75 deg W,Canada - Quebec between 78 and 75 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1428,Canada - Quebec - W of 78 deg W,Canada - Quebec west of 78 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1429,Canada - Ontario - E of 75 deg W,Canada - Ontario - east of 75 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1430,Canada - Ontario - 78 to 75 deg W,Canada - Ontario - between 78 and 75 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1431,Canada - Ontario - MTM zone 10,Canada - Ontario - between 79 deg 30 min and 78 deg W in area to north of 47 deg N; between 80 deg 15 min and 78 deg W in area between 46 deg and 47 deg N; between 81 deg and 78 deg W in area south of 46 deg N.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1432,Canada - Ontario - MTM zone 11,Canada - Ontario - south of 46 deg N and west of 81 deg West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1433,Canada - Ontario - MTM zone 12,Canada - Ontario - between 82 deg 30 min and 79 deg 30 min W in area to north of 47 deg N; between 82 deg 30 min and 80 deg 15 min W in area between 46 deg and 47 deg N; between 82 deg 30 min and 79 deg 30 min W in area north of 47 deg N.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1434,Canada - Ontario - MTM zone 13,Canada - Ontario - between 85 deg 30 min and 82 deg 30 min West and north of 46 deg North.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1435,Canada - Ontario - 88.5 to 85.5 deg W,Canada - Ontario - between 88 deg 30 min and 85 deg 30 min West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1436,Canada - Ontario - 91.5 to 88.5 deg W,Canada - Ontario - between 91 deg 30 min and 88 deg 30 min West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1437,Canada - Ontario - 94.5 to 91.5 deg W,Canada - Ontario - between 94 deg 30 min and 91 deg 30 min West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1438,Canada - Ontario - W of 94.5 deg W,Canada - Ontario - west of 94 deg 30 min West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1439,Canada - Ontario - 96 to 90 deg W,Canada - Ontario - between 96 and 90 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1440,Canada - Ontario - 90 to 84 deg W,Canada - Ontario - between 90 and 84 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1441,Canada - Ontario - 84 to 78 deg W,Canada - Ontario - between 84 and 78 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1442,Canada - Ontario - E of 78 deg W,Canada - Ontario - east of 78 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1443,Canada - Quebec - 78 to 72 deg W,Canada - Quebec - between 78 and 72 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1444,Canada - Quebec - 72 to 66 deg W,Canada - Quebec - between 72 and 66 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1445,Canada - Quebec - 66 to 60 deg W,Canada - Quebec - between 66 and 60 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1446,Canada - Quebec - E of 60 deg W,Canada - Quebec - east of 60 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1447,Canada - New Brunswick,Canada - New Brunswick.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1448,Canada - 72 to 66 deg W,Canada - New Brunswick west of 66 deg West; Quebec between 72 and 66 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1449,Canada - 66 to 60 deg W,Canada - New Brunswick east of 66 deg West; Nova Scotia; Prince Edward Island; Quebec between 66 and 60 deg West.,,,,,EPSG,EPSG,2002-07-13 00:00:00,2002.41,0
+1450,Cote d'Ivoire (Ivory Coast) - E of 6 deg W,C�te d'Ivoire (Ivory Coast) east of 6 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1451,Cote d'Ivoire (Ivory Coast) - W of 6 deg W,C�te d'Ivoire (Ivory Coast) west of 6 deg West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1452,Vietnam - W of 108 deg E,Vietnam - west of 108 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1453,Vietnam - E of 108 deg E,Vietnam - east of 108 deg East.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+1454,South Africa - Walvis Bay,South Africa - Walvis Bay.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1455,South Africa - W of 18 deg E,South Africa - west of 18 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1456,South Africa - 18 to 20 deg E,South Africa - between 18 and 20 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1457,South Africa - 20 to 22 deg E,South Africa - between 20 and 22 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1458,South Africa - 22 to 24 deg E,South Africa - between 22 and 24 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1459,South Africa - 24 to 26 deg E,Lesotho  - west of 26 deg East. South Africa - between 24 and 26 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1460,South Africa - 26 to 28 deg E,Lesotho  - east of 26 deg East.  South Africa - between 26 and 28 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1461,South Africa - 28 to 30 deg E,South Africa - between 28 and 30 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1462,South Africa - 30 to 32 deg E,South Africa - between 30 and 32 deg East.  Swaziland.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1463,South Africa - E of 32 deg E,South Africa - east of 32 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1464,Iran - W of 48 deg E,Islamic Republic of Iran - west of 48 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1465,Iran - 48 to 54 deg E,Islamic Republic of Iran - between 48 and 54 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1466,Iran - 54 to 60 deg E,Islamic Republic of Iran - between 54 and 60 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1467,Iran - E of 60 deg E,Islamic Republic of Iran - east of 60 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1468,Guinea - W of 12 deg W,Guinea - west of 12 deg West.,,,,,EPSG,EPSG,1999-12-09 00:00:00,,0
+1469,Guinea - E of 12 deg W,Guinea - east of 12 deg West.,,,,,EPSG,EPSG,1999-12-09 00:00:00,,0
+1470,Libya - W of 10 degrees E,Libyan Arab Jamahiriya - west of 10 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1471,Libya - 10 to 12 degrees E,Libyan Arab Jamahiriya - between 10 and 12 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1472,Libya - 12 to 14 degrees E,Libyan Arab Jamahiriya - between 12 and 14 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1473,Libya - 14 to 16 degrees E,Libyan Arab Jamahiriya - between 14 and 16 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1474,Libya - 16 to 18 degrees E,Libyan Arab Jamahiriya - between 16 and 18 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1475,Libya - 18 to 20 degrees E,Libyan Arab Jamahiriya - between 18 and 20 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1476,Libya - 20 to 22 degrees E,Libyan Arab Jamahiriya - between 20 and 22 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1477,Libya - 22 to 24 degrees E,Libyan Arab Jamahiriya - between 22 and 24 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1478,Libya - E of 24 degrees E,Libyan Arab Jamahiriya - east of 24 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1479,Libya - W of 12 degrees E,Libyan Arab Jamahiriya - west of 12 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1480,Libya - 12 to 18 degrees E,Libyan Arab Jamahiriya - between 12 and 18 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1481,Libya - 18 to 24 degrees E,Libyan Arab Jamahiriya - between 18 and 24 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1482,Libya - W of 15 degrees E,Libyan Arab Jamahiriya - west of 15 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1483,Argentina - Neuquen province - 70.5 to 67.5 deg W,Argentina - Neuquen province between 70 deg 30 min and 67 deg 30 min West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1484,Argentina - Comodoro Rivadavia - W of 67.5 deg W,Argentina - Comodoro Rivadavia area west of 67 deg 30 min West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1485,Argentina - Tierra del Fuego - onshore W of 67.5 deg W,Argentina - Tierra del Fuego onshore west of 67 deg 30 min West.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1486,Argentina - Tierra del Fuego - offshore,Argentina - Tierra del Fuego offshore.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1487,Cuba - N of 21.5 deg N,Cuba - north of 21deg 30min North.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1488,Cuba - S of 21.5 deg N,Cuba - south of 21deg 30min North.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1489,Tunisia - offshore,Tunisia - offshore.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1490,Yemen - W of 48 deg E,Yemen - west of 48 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1491,Yemen - E of 48 deg E,Yemen - east of 48 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1492,Yemen - South Yemen - W of 48 deg E,Yemen - South Yemen west of 48 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1493,Yemen - South Yemen - E of 48 deg E,Yemen - South Yemen east of 48 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1494,Vietnam - Meekong delta,Vietnam - Meekong delta.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1495,Vietnam - offshore Nam Con Son basin,Vietnam - offshore Nam Con Son basin.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1496,South Korea - E of 128 deg E,Republic of Korea (South Korea) - east of 128 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1497,South Korea - 126 to 128 deg E.,Republic of Korea (South Korea) - between 126 and 128 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1498,South Korea - W of 126 deg E,Republic of Korea (South Korea) - west of 126 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1499,Venezuela - Maracaibo - blocks I II and III..,"Venezuela - Maracaibo area offshore blocks I, II and III.",,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+1500,New Zealand - North Island,New Zealand - North Island.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1501,New Zealand - South Island,New Zealand - South Island.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1502,New Zealand - offshore W of 168 deg E,New Zealand - offshore west of 168 deg East.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1503,New Zealand - offshore 168 to 174 deg E,New Zealand - offshore between 168 and 174 deg East.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1504,New Zealand - offshore E of 174 deg E,New Zealand - offshore east of 174 deg East.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1505,Ghana - offshore,Ghana - offshore.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1506,Canada - Saskatchewan - E of 108 deg W,Canada - Saskatchewan east of 108 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1507,Canada - Alberta and Saskatchewan - 114 to 108 deg W,Canada - Alberta east of 114 deg West; Saskatchewan west of 108 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1508,Canada - Alberta W of 114 deg W,Canada - Alberta west of 114 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1509,Sierra Leone - W of 12 deg W,Sierra Leone - west of 12 deg West.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1510,Sierra Leone - E of 12 deg W,Sierra Leone - east of 12 deg West.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1511,USA - conus and Alaska,United States (USA) - Alabama; Alaska; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas;  [...]
+1512,Germany - east Germany - W of 10.5 deg E,Germany - states of former East Germany (DDR) west of 10 deg 30 min East - Thuringen.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1513,Germany - east Germany - 10.5 to 13.5 deg E,Germany - states of former East Germany (DDR) between 10 deg 30 min and 13 deg 30 min East - Brandenburg; Mecklenburg-Vorpommern; Sachsen; Sachsen-Anhalt; Thuringen.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1514,Germany - east Germany - E of 13.5 deg E,Germany - states of former East Germany (DDR) east of 13 deg 30 min East - Brandenburg; Mecklenburg-Vorpommern; Sachsen.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1515,Poland - zone I,Poland - southeast - south of 52 deg 20 min North and east of 18 deg East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1516,Poland - zone II,Poland - northeast - north of 51 deg 20 min North and east of 19 deg East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1517,Poland - zone III,Poland - northwest - north of 52 deg 10 min North and west of 20 deg East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1518,Poland - zone IV,Poland - southwest - south of  53 deg 20 min North and west of 19 deg 05 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1519,Poland - zone V,"Poland - south central - between 49 deg 20 min North and 51 deg 20 min North, 18 deg 20 min East and 19 deg 40min East.",,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1520,Poland - W of 16.5 deg E,Poland - west of 16 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1521,Poland - 16.5 to 19.5 deg E,Poland - between 16 deg 30 min and 19 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1522,Poland - 19.5 to 22.5 deg E,Poland - between 19 deg 30 min and 22 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1523,Poland - E of 22.5 deg E,Poland - east of 22 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1524,Turkey - W of 28.5 deg E,Turkey west of 28 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1525,Turkey - 28.5 to 31.5 deg E,Turkey between 28 deg 30 min and 31 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1526,Turkey - 31.5 to 34.5 deg E,Turkey between 31 deg 30 min and 34 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1527,Turkey - 34.5 to 37.5 deg E,Turkey between 34 deg 30 min and 37 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1528,Turkey - 37.5 to 40.5 deg E,Turkey between 37 deg 30 min and 40 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1529,Turkey - 40.5 to 43.5 deg E,Turkey between 40 deg 30 min and 43 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1530,Turkey - E of 43.5 deg E,Turkey east of 43 deg 30 min East.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1531,Canada - New Brunswick - W of 66 deg W,Canada - New Brunswick - west of 66 deg West.,,,,,EPSG,EPSG,1997-07-22 00:00:00,,0
+1532,Canada - Maritime Provinces - E of 66 deg W,Canada - New Brunswick - east of 66 deg W.; Canada - Nova Scotia; Canada - Prince Edward Island.,,,,,EPSG,EPSG,1997-07-22 00:00:00,,0
+1533,Canada - Prince Edward Island,Canada - Prince Edward Island.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1534,Canada - Nova Scotia - E of 63 deg W,Canada - Nova Scotia - east of 63 deg West.,,,,,EPSG,EPSG,1999-05-24 00:00:00,,0
+1535,Canada - Nova Scotia - W of 63 deg W,Canada - Nova Scotia - west of 63 deg West.,,,,,EPSG,EPSG,1999-05-24 00:00:00,,0
+1536,Finland - W of 22.5 deg E,Finland - west of 22 deg 30 min East.,,,,,EPSG,EPSG,1997-07-22 00:00:00,,0
+1537,Finland - 22.5 deg to 25.5 deg E,Finland - between 22 deg 30 min and 25 deg 30 min East.,,,,,EPSG,EPSG,1997-07-22 00:00:00,,0
+1538,Finland - zone 3,Finland - between 25 deg 30 min and 28 deg 30 min East for Basic Coordinate System and all Finland for Uniform Coordinate System.,,,,,EPSG,EPSG,2001-09-03 00:00:00,,0
+1539,Finland - E of 28.5 deg E,Finland - east of 28 deg 30 min East.,,,,,EPSG,EPSG,1997-07-22 00:00:00,,0
+1540,Mozambique - W of 36 deg E,Mozambique - west of 36 deg East.,,,,,EPSG,EPSG,1998-04-16 00:00:00,,0
+1541,Mozambique - E of 36 deg E,Mozambique - east of 36 deg East.,,,,,EPSG,EPSG,1998-04-16 00:00:00,,0
+1542,Asia - Cambodia and Vietnam - W of 108 deg E,Cambodia; Vietnam west of 108 deg East.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+1544,Oman - W of 54 deg E,Oman - west of 54 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1545,Oman - E of 54 deg E,Oman - east of 54 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1546,USA - Hawaii - island of Hawaii,United States (USA) - Hawaii - island of Hawaii.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1547,USA - Hawaii - Maui; Kahoolawe; Lanai; Molokai.,United States (USA) - Hawaii - Maui; Kahoolawe; Lanai; Molokai.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1548,USA - Hawaii - Oahu.,United States (USA) - Hawaii - Oahu.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1549,USA - Hawaii - Kauai.,United States (USA) - Hawaii - Kauai.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1550,USA - Hawaii - Niihau.,United States (USA) - Hawaii - Niihau.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1551,Grenada including Grenada Grenadines,Grenada (including Grenada Grenadines).,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+1552,Africa - Ethiopia and Sudan - W of 42 deg E,Ethiopia - west of 42 degrees East.  Sudan - west of 42 degrees East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1553,Africa - Ethiopia and Sudan - E of 42 deg E,Ethiopia - east of 42 degrees East.  Sudan - east of 42 degrees East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1554,Somalia - W of 48 deg E,Somalia - west of 48 degrees East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1555,Somalia - E of 48 deg E,Somalia - east of 48 degrees East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1556,Australia - 102 to 108 deg E,Australia - between 102 and 108 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1557,Australia - 108 to 114 deg E,Australia - between 108 and 114 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1558,Australia - 114 to 120 deg E,Australia - between 114 and 120 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1559,Australia - 120 to 126 deg E,Australia - between 120 and 126 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1560,Australia - 126 to 132 deg E,Australia - between 126 and 132 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1561,Australia - 132 to 138 deg E,Australia - between 132 and 138 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1562,Australia - 138 to 144 deg E,Australia - between 138 and 144 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1563,Australia - 144 to 150 deg E,Australia - between 144 and 150 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1564,Australia - 150 to 156 deg E,Australia - between 150 and 156 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1565,Australia - 156 to 162 deg E,Australia - between 156 and 162 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1566,Australia - 162 to 168 deg E,Australia - between 162 and 168 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1567,Australasia - Australia and PNG - 138 to 144 deg E,Australia - between 138 and 144 deg East.  Papua New Guinea (PNG) - west of 144 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1568,Australasia - Australia and PNG - 144 to 150 deg E,Australia - between 144 and 150 deg East.  Papua New Guinea (PNG) - east of 144 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1569,Saudi Arabia - W of 42 deg E,Saudi Arabia - west of 42 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1570,Saudi Arabia - E of 48 deg E,Saudi Arabia - east of 48 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1571,Asia - Middle East - Kuwait and Saudi - 42 to 48 deg E,Kuwait.  Saudi Arabia - between 42 and 48 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1572,Brazil - Aratu - W of 48 deg W,Brazil - coastal areas south of 2 deg 55 min South and west of 48 deg West.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1573,Brazil - Aratu - 48 to 42 deg W,Brazil - coastal areas south of 2 deg 55 min South and between 48 and 42 deg West; offshore Santos basin.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1574,Brazil - Aratu - E of 42 deg W,Brazil - coastal areas south of 2 deg 55 min South and east of 42 deg West; offshore Campos basin.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1575,Africa - Botswana and Zambia - W of 24 deg E,Botswana and Zambia - west of 24 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1576,"Africa - Botswana, Zambia and Zimbabwe - 24 to 30 deg E",Botswana - east of 24 deg East; Zambia - between 24 and 30 deg East; Zimbabwe west of 30 deg East .,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1577,"Africa - Malawi, Zambia and Zimbabwe - E of 30 deg E",Malawi.  Zambia and Zimbabwe - east of 30 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1578,Uganda - N of equator and W of 30 deg E,Uganda - north of equator and west of 30 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1579,Africa - Tanzania and Uganda - S of equator and W of 30 deg E,Tanzania - west of 30 deg East; Uganda south of equator and west of 30 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1580,Africa - Kenya and Uganda - N of equator and 30 to 36 deg E,Kenya - north of equator and west of 36 deg East; Uganda north of equator and east of 30 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1581,"Africa - Kenya, Tanzania and Uganda - S of equator and 30 to 36 deg E",Kenya - south of equator and west of 36 deg East; Tanzania - 30 to 36 deg East; Uganda south of equator and east of 30 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1582,Kenya - N of equator and E of 36 deg E,Kenya - north of equator and east of 36 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1583,Africa - Kenya and Tanzania - S of equator and E of 36 deg E,Kenya - south of equator and east of 36 deg East; Tanzania - east of 36 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1584,Indonesia - Java - W of 108 deg E,Indonesia - Java - west of 108 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1585,Indonesia - Java - E of 114 deg E,Indonesia - Java - east of 114 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1586,Indonesia - Java - 108 to 114 deg E,Indonesia - Java - between 108 and 114 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1587,China - W of 78 deg E,China - west of 78 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1588,China - 78 to 84 deg E,China - between 78 and 84 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1589,China - 84 to 90 deg E,China - between 84 and 90 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1590,China - 90 to 96 deg E,China - between 90 and 96 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1591,China - 96 to 102 deg E,China - between 96 and 102 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1592,China - 102 to 108 deg E,China - between 102 and 108 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1593,China - 108 to 114 deg E,China - between 108 and 114 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1594,China - 114 to 120 deg E,China - between 114 and 120 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1595,China - 120 to 126 deg E,China - between 120 and 126 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1596,China - 126 to 132 deg E,China - between 126 and 132 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1597,China - E of 132 deg E,China - east of 132 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1598,Colombia - W of 75d 35m W,Colombia - west of 1 deg 30 min W of Bogota (75d 34m 51.30s W of Greenwich).,,,,,EPSG,EPSG,1997-04-11 00:00:00,,0
+1599,Colombia - 75d 35m to 72d 35m W,Colombia - between 1 deg 30 min W and 1 deg 30 min E of Bogota (75d 35m W and 72d 35m W of Greenwich).,,,,,EPSG,EPSG,1997-04-11 00:00:00,,0
+1600,Colombia - 72d 35m to 69d 35m W,Colombia - between 1 deg 30 min and 4 deg 30 min E of Bogota (72d 35m and 69d 34m W of Greenwich).,,,,,EPSG,EPSG,1997-04-11 00:00:00,,0
+1601,Colombia - E of 69d 35m W,Colombia - east of 4 deg 30 min E of Bogota (69d 34m 51.3s W of Greenwich).,,,,,EPSG,EPSG,1997-04-11 00:00:00,,0
+1602,Colombia - offshore W of 78 deg W,Colombia - offshore west of 78 deg W of Greenwich.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1603,Colombia - offshore E of 78 deg W,Colombia - offshore east of 78 deg W of Greenwich.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1604,Angola - Angola proper - offshore,Angola - Angola proper - offshore,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+1605,Angola - Angola proper - offshore block 15,Angola - Angola proper - offshore block 15,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+1606,Angola - Angola proper - offshore - W of 12 deg E,Angola - Angola proper - offshore - west of 12 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1607,Angola - 12 to 18 deg E,Angola - between 12 and 18 deg East.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+1608,Argentina - W of 70.5 deg W,Argentina - west of 70 deg 30 min West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1609,Argentina - 70.5 to 67.5 deg W,Argentina - between 70 deg 30 min and 67 deg 30 min West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1610,Argentina - 67.5 to 64.5 deg W,Argentina - between 67 deg 30 min and 64 deg 30 min West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1611,Argentina - 64.5 to 61.5 deg W,Argentina - between 64 deg 30 min and 61 deg 30 min West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1612,Argentina - 61.5 to 58.5 deg W,Argentina - between 61 deg 30 min and 58 deg 30 min West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1613,Argentina - 58.5 to 55.5 deg W,Argentina - between 58 deg 30 min and 55 deg 30 min West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1614,Argentina - E of 55.5 deg W,Argentina - east of 55 deg 30 min West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1615,Botswana - W of 21 deg E,Botswana - west of 21 deg East.,,,,,EPSG,EPSG,1995-12-08 00:00:00,,0
+1616,Botswana - 21 to 27 deg E,Botswana - between 21 and 27deg East.,,,,,EPSG,EPSG,1995-12-08 00:00:00,,0
+1617,Botswana - E of 27 deg E,Botswana - east of 27 deg East.,,,,,EPSG,EPSG,1995-12-08 00:00:00,,0
+1618,Tunisia - onshore,Tunisia - onshore.,,,,,EPSG,EPSG,1999-11-15 00:00:00,,0
+1619,Tunisia - N of 34 deg 39 min N,Tunisia - north of 38.5 grads (34 deg 39 min) North.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1620,Tunisia - S of 34 deg 39 min N,Tunisia - south of 38.5 grads (34 deg 39 min) North.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1621,Brazil - Corrego Alegre - W of 42 deg W,Brazil - NE coastal area between 45 deg West and 42 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1622,Brazil - Corrego Alegre - E of 42 deg W,Brazil - NE coastal area between 42 deg West and 40 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1623,Asia - Middle East - Lebanon and Syria,Lebanon. Syrian Arab Republic.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1624,Germany - W of 7.5 deg E,"Germany west of 7 deg 30 min East - Niedersachsen, Nordrhein-Westfalen, Rheinland-Pfalz, Saarland.",,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1625,Germany - 7.5 to 10.5 deg E,"Germany - former West Germany onshore between 7 deg 30 min and 10 deg 30 min East - Baden-Wurtemberg, Bayern, Hessen, Niedersachsen, Nordrhein-Westfalen, Rhineland-Pfalz, Schleswig-Holstein. Also former East German (DDR) state of Thuringen by transformation.",,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1626,Germany - 10.5 to 13.5 deg E,"Germany - former West Germany onshore between 10 deg 30 min and 13 deg 30 min East - Bayern, Niedersachsen, Schleswig-Holstein. Also former East German (DDR) states of Sachsen and Thuringen by transformation.",,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1627,Germany - 13.5 to 16.5 deg E,Germany - former West Germany onshore east of 13 deg 30 min East - Bayern. Also former East German (DDR) state of Sachsen by transformation.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1628,Germany - W of 4.5 deg E,Germany - onshore west of 4 deg 30 min East.,,,,Not valid - do not use !,EPSG,EPSG,2000-03-07 00:00:00,,1
+1629,UK - offshore North Sea,United Kingdom (UKCS) - offshore North Sea.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+1630,Netherlands - offshore,Netherlands - offshore North Sea.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+1631,Europe - ED50 / UTM 28,Europe - between 18 and 12 deg West - Ireland offshore; Spain (Canary Islands); United Kingdom (UKCS) offshore.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1632,Europe - ED50 / UTM 29,Europe - between 12 and 6 deg West - Portugal; Spain; Ireland offshore; United Kingdom (UKCS) offshore.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1633,Europe - ED50 / UTM 30,Europe - between 6 deg West and 0 deg East - Faroe Islands; France offshore; Gibraltar; Ireland offshore; Spain; United Kingdom - UKCS offshore - North Sea west of 0 d eg East).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1634,Europe - ED50 / UTM 31,Europe - between 0 and 6 deg East - Denmark (North Sea); Germany offshore; Netherlands offshore; Norway; Spain (Balearic Islands); United Kingdom (UKCS) offshore.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1635,Europe - ED50 / UTM 32,Europe - between 6 and 12 deg East - Denmark; Germany offshore; Italy; Netherlands offshore; Norway.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1636,Europe - ED50 / UTM 33,Europe - between 12 and 18 deg East - Denmark (Bornholm); Italy; Norway.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1637,Europe - ED50 / UTM 34,Europe - between 18 and 24 deg East - Greece; Norway.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1638,Europe - ED50 / UTM 35,Europe - between 24 and 30 deg East - Greece; Norway; Turkey. Egypt - Western Desert.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1639,Europe - ED50 / UTM 36,Europe - between 30 and 36 deg East - Turkey.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1640,Europe - ED50 / UTM 37,Europe - between 36 and 42 deg East - Turkey.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1641,Europe - ED50 / UTM 38,Europe - between 42 and 48 deg East - Turkey.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1642,Egypt - Sinai peninsula,Egypt - Sinai peninsula.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+1643,Egypt - E of 29 deg E,Egypt - east of 29 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1644,Egypt - W of 29 deg E; N of 28 deg 11 min N,Egypt - west of 29 deg E; north of approximately 28 deg 11 min North.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1645,Egypt - W of 29 deg E; S of 28 deg 11 min N,Egypt - west of 29 deg E; south of approximately 28 deg 11 min North.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1646,Europe - Estonia;  Latvia;  Lithuania.,Estonia;  Latvia;  Lithuania.,,,,,EPSG,EPSG,1998-12-14 00:00:00,,0
+1647,Indonesia - N of equator and W of 96 deg E,Indonesia - north of equator and west of 96 deg East.,,,,,EPSG,EPSG,1995-08-08 00:00:00,,0
+1648,Indonesia - S of equator and W of 96 deg E,Indonesia - south of equator and west of 96 deg East.,,,,,EPSG,EPSG,1995-08-08 00:00:00,,0
+1649,Indonesia - N of equator and 96 to 102 deg E,Indonesia - north of equator and between 96 and 102 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1650,Indonesia - S of equator and 96 to 102 deg E,Indonesia - south of equator and between 96 and 102 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1651,Indonesia - N of equator and 102 to 108 deg E,Indonesia - north of equator and between 102 and 108 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1652,Indonesia - S of equator and 102 to 108 deg E,Indonesia - south of equator and between 102 and 108 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1653,Indonesia - N of equator and 108 to 114 deg E,Indonesia - north of equator and between 108 and 114 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1654,Indonesia - S of equator and 108 to 114 deg E,Indonesia - south of equator and between 108 and 114 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1655,Indonesia - N of equator and 114 to 120 deg E,Indonesia - north of equator and between 114 and 120 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1656,Indonesia - S of equator and 114 to 120 deg E,Indonesia - south of equator and between 114 and 120 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1657,Indonesia - N of equator and 120 to 126 deg E,Indonesia - north of equator and between 120 and 126 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1658,Indonesia - S of equator and 120 to 126 deg E,Indonesia - south of equator and between 120 and 126 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1659,Indonesia - N of equator and 126 to 132 deg E,Indonesia - north of equator and between 126 and 132 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1660,Indonesia - S of equator and 126 to 132 deg E,Indonesia - south of equator and between 126 and 132 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1661,Indonesia - N of equator and 132 to 138 deg E,Indonesia - north of equator and east of 132 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1662,Indonesia - S of equator and 132 to 138 deg E,Indonesia - south of equator and between 132 and 138 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1663,Indonesia - S of equator and E of 138 deg E,Indonesia - south of equator and east of 138 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1664,Myanmar (Burma) - W of 96 deg E,Myanmar (Burma) - west of 96 deg East.,,,,,EPSG,EPSG,1998-06-13 00:00:00,,0
+1665,Asia - Myanmar and Thailand - 96 to 102 deg E,Myanmar (Burma) - east of 96 deg East; Thailand - west of 102 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1666,Thailand - E of 102 deg E,Thailand - east of 102 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1667,Thailand - W of 102 deg E,Thailand - west of 102 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1668,Pakistan - N of 35 deg 35 min N,Pakistan - north of 35 deg 35 min North.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1669,Asia - India; Pakistan - 28 to 35.5 deg N,India north of 28 deg North; Pakistan 28 deg to 35 deg 35 min North.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1670,Asia - India; Pakistan - zone IIa,India - between 21 and 28 deg North and west of 82 deg East; Pakistan - south of 28 deg North.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1671,Asia - Bangladesh; India; Myanmur; Pakistan - zone IIb,Bangladesh; India - north of 22 deg North and east of 82 deg East; Myanmar (Burma) - north of 22 deg North.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1672,India - 15 to 21 deg N,India - between 15 and 21 deg North.,,,,,EPSG,EPSG,2000-04-23 00:00:00,,0
+1673,India - S of 15 deg N,India - south of 15 deg North.,,,,,EPSG,EPSG,2000-04-23 00:00:00,,0
+1674,Bangladesh - W of 90 deg E,Bangladesh - west of 90 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1675,Bangladesh - E of 90 deg E,Bangladesh - east of 90 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1676,India - N of 28 deg N,India - north of 28 deg North.,,,,,EPSG,EPSG,2000-04-23 00:00:00,,0
+1677,India - 21 to 28deg N and W of 82 deg E,India - between 21 and 28 deg North and west of 82 deg East.,,,,,EPSG,EPSG,2000-04-23 00:00:00,,0
+1678,India - N of 21 deg N and E of 82 deg E,India - north of 21 deg North and east of 82 deg East.,,,,,EPSG,EPSG,2000-04-23 00:00:00,,0
+1679,India - W of 72 deg E,India - west of 72 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1680,India - 72 to 78 deg E,India - between 72 and 78 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1681,India - 78 to 84 deg E,India - between 78 and 84 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1682,India - 84 to 90 deg E,India - between 84 and 90 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1683,India - 90 to 96 deg E,India - between 90 and 96 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1684,India - E of 96 deg E,India - east of 96 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1685,Pakistan - N of 28 deg N,Pakistan - north of 28 deg North.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1686,Pakistan - S of 28 deg N,Pakistan - south of 28 deg North.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1687,Pakistan - W of 66 deg E,Pakistan - west of 66 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1688,Pakistan - 66 to 72 deg E,Pakistan - between 66 and 72 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1689,Pakistan - E of 72 deg E,Pakistan - east of 72 deg East.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1690,Malaysia - West Malaysia,Malaysia - West Malaysia.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1691,Malaysia - West Malaysia - W of 102 deg E,Malaysia - West Malaysia west of 102 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1692,Malaysia - West Malaysia - E of 102 deg E,Malaysia - West Malaysia east of 102 deg East.,,,,,EPSG,EPSG,1995-07-21 00:00:00,,0
+1693,Venezuela - W of 72 deg W,Venezuela - west of 72 deg West.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1694,Venezuela - 72 to 66 deg W,Venezuela - between 72 and 66 deg West.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1695,Venezuela - E of 66 deg W,Venezuela - east of 66 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1696,Gabon - N of equator,Gabon - north of equator.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1697,Gabon - S of equator,Gabon - south of equator.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1698,Philippines - zone I,Philippines - west of 118 deg East.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1699,Philippines - zone II,Philippines - Palawan; Calamian Islands.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1700,Philippines - zone III,Philippines - Luzon (except SE part;); Mindoro.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1701,Philippines - zone IV,Philippines - SE Luzon; Tablas; Masbate; Panay; Cebu; Negros; west Mindanao.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1702,Philippines - zone V,Philippines - east Mindanao; Bohol; Samar.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1703,Morocco - N of 31.5 deg N,Morocco north of 35 grads (31 deg 30 min) North.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1704,Morocco - 27.9 to 31.5 deg N,Morocco between 31 and 35 grads (27 deg 54 min and 31 deg 30 min) North.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1705,Morocco - S of 27.9 deg N,Morocco south of 31grads  (27 deg 54 min) North.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1706,Austria - W of 11 deg 50 min E,Austria west of 11deg 50min East of Greenwich (29 deg 30 min East of Ferro).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1707,Austria - 11 deg 50 min to 14deg 50min E,Austria between 11deg 50min and 14deg 50min East of Greenwich (29 deg 30 min and 32 deg 30 min East of Ferro).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1708,Austria - E of 14 deg 50 min E,Austria east of 14deg 50min East of Greenwich (32 deg 30 min East of Ferro).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1709,Europe - former Yugoslavia - W of 16.5 deg E,Bosnia and Herzegowina west of 16 deg 30 min E; Croatia west of 16 deg 30 min E; Slovenia.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1710,Europe - former Yugoslavia - 16.5 to 29.5 deg E,Bosnia and Herzegowina east of 16 deg 30 min E; Croatia east of 16 deg 30 min E; Yugoslavia west of 19 deg 30 min E.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1711,Europe - former Yugoslavia - 19.5 to 22.5 deg E,FYR Macedonia west of 22 deg 30 min E; Yugoslavia between 19 deg 30 min and 22 deg 30 min E.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1712,Europe - former Yugoslavia - E of 22.5 deg E,FYR Macedonia and Yugoslavia east of 22 deg 30 min E.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1713,Nigeria - E of 10.5 deg E,Nigeria east of 10 deg 30 min East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1714,Nigeria - 6.5 to10.5 deg E,Nigeria between 6 deg 30 min and 10 deg 30 min East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1715,Nigeria - W of 6.5 deg E,Nigeria west of 6 deg 30 min East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1716,Nigeria - offshore deep water - W of 6 deg E,Nigeria - offshore beyond continental shelf west of 6 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1717,Nigeria - offshore deep water,Nigeria - offshore beyond continental shelf.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1718,Italy - W of 12 deg E,Italy - west of 12 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1719,Italy - E of 12 deg E,Italy - east of 12 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1720,USA - Michigan - SPCS - E,United States (USA) - Michigan - counties of Alcona; Alpena; Arenac; Bay; Cheboygan; Clinton; Crawford; Genesee; Gladwin; Gratiot; Hillsdale; Huron; Ingham; Iosco; Jackson; Lapeer; Lenawee; Livingston; Macomb; Midland; Monroe; Montmorency; Oakland; Ogemaw; Oscoda; Otsego; Presque Isle; Roscommon; Saginaw; Sanilac; Shiawassee; St. Clair; Tuscola; Washtenaw; Wayne.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1721,USA - Michigan - SPCS - old central,United States (USA) - Michigan - counties of Allegan; Antrim; Barry; Benzie; Berrien; Branch; Calhoun; Cass; Charlevoix; Clare; Eaton; Emmet; Grand Traverse; Ionia; Isabella; Kalamazoo; Kalkaska; Kent; Lake; Leelanau; Manistee; Mason; Mecosta; Missaukee; Montcalm; Muskegon; Newaygo; Oceana; Osceola; Ottawa; St. Joseph; Van Buren; Wexford.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+1722,USA - Michigan - SPCS - W,United States (USA) - Michigan - counties of Alger; Baraga; Chippewa; Delta; Dickinson; Gogebic; Houghton; Iron; Keweenaw; Luce; Mackinac; Marquette; Menominee; Ontonagon; Schoolcraft.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1723,USA - Michigan - SPCS - N,United States (USA) - Michigan north of approximately 45d 45m North - counties of Alger; Baraga; Chippewa; Delta; Dickinson; Gogebic; Houghton; Iron; Keweenaw; Luce; Mackinac; Marquette; Menominee; Ontonagon; Schoolcraft.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+1724,USA - Michigan - SPCS - central,United States (USA) - Michigan between approximately 45d 45m & 43d 55m North - counties of Alcona; Alpena; Antrim; Arenac; Benzie; Charlevoix; Cheboygan; Clare; Crawford; Emmet; Gladwin; Grand Traverse; Iosco; Kalkaska; Lake; Leelanau; Manistee; Mason; Missaukee; Montmorency; Ogemaw; Osceola; Oscoda; Otsego; Presque Isle; Roscommon; Wexford.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+1725,USA - Michigan - SPCS - S,United States (USA) - Michigan south of approximately 43d 55m North - counties of Allegan; Barry; Bay; Berrien; Branch; Calhoun; Cass; Clinton; Eaton; Genesee; Gratiot; Hillsdale; Huron; Ingham; Ionia; Isabella; Jackson; Kalamazoo; Kent; Lapeer; Lenawee; Livingston; Macomb; Mecosta; Midland; Monroe; Montcalm; Muskegon; Newaygo; Oakland; Oceana; Ottawa; Saginaw; Sanilac; Shiawassee; St. Clair; St. Joseph; Tuscola; Van Buren; Washtenaw; Wayne.,,,,,EPSG,EPSG,2 [...]
+1726,Mozambique - offshore,Mozambique - offshore.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+1727,Suriname - offshore,Suriname - offshore.,,,,,EPSG,EPSG,2000-06-10 00:00:00,,0
+1728,Algeria - N of 34 deg 39 min N,Algeria - north of 38.5 grads (34 deg 39 min) North.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1729,Algeria - 31 deg 30 min  of 34 deg 39 min N,Algeria - 35 grads to 38.5 grads (31 deg 30 min to 34 deg 39 min) North.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1730,North America - NAVD88,North America: Canada - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland; North West Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon. United States (USA) - Alabama; Alaska; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; N [...]
+1731,France - N of 48.15 deg N,France north of 53.5 grads (48 deg 09 min) North.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1732,France - 45.45 to 48.15 deg N,France 50.5 to 53.5 grads (45 deg 27 min to 48 deg 09 min) North.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1733,France - S of 45.45 deg N,France south of 50.5 grads (45 deg 27 min) North.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1734,France - 45.45 to 48.15 deg N. Also all mainland.,France 50.5 to 53.5 grads (45 deg 27 min to 48 deg 09 min) North. Also used over all mainland France.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1735,Algeria - W of 6 deg W,Algeria - west of 6 deg West (of Greenwich).,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1736,Algeria - 6 to 0 deg W,Algeria - between 6 deg West and 0 deg East (of Greenwich).,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1737,Algeria - 0 to 6 deg E,Algeria - between 0 and 6 deg East (of Greenwich).,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1738,Algeria - E of 6 deg E,Algeria - east of 6 deg East (of Greenwich).,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1739,Kuwait - W of 48 deg E,Kuwait - west of 48 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1740,Kuwait - E of 48 deg E,Kuwait - east of 48 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1741,Norway - zone I,Norway - west of 3deg 30min W of Oslo (7deg 13min 22.5sec E of Greenwich).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1742,Norway - zone II,Norway - between 3deg 30min W and 1deg 10min W of Oslo (7deg 13min 22.5sec E  and 9deg 33min 22.5sec E of Greenwich).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1743,Norway - zone III,Norway - between 1deg 10min W and 1deg 15min E of Oslo (9deg 33min 22.5sec E and 11deg 58min 22.5sec E of Greenwich).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1744,Norway - zone IV,Norway - between 1deg 15min E and 4deg 20min E of Oslo (11deg 58min 22.5sec E and 15deg 03min 22.5sec E of Greenwich).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1745,Norway - zone V,Norway - between 4deg 20min E and 8deg 10min E of Oslo (15deg 03min 22.5sec E and 18deg 53min 22.5sec E of Greenwich).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1746,Norway - zone VI,Norway - between 8deg 10min E and 12deg 10min E of Oslo (18deg 53min 22.5sec E and 22deg 53min 22.5sec E of Greenwich).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1747,Norway - zone VII,Norway - between 12deg 10min E and 16deg 15min E of Oslo (22deg 53min 22.5sec E and 26deg 58min 22.5sec E of Greenwich).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1748,Norway - zone VIII,Norway - east of 16deg 15min E of Oslo (26deg 58min 22.5sec E of Greenwich).,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+1749,Asia - Middle East - Nahrwan / UTM 39,Kuwait east of 48 deg East.  Qatar - offshore.  United Arab Emirates (UAE) - Abu Dhabi - west of 54 deg East.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1750,UAE - E of 54 deg E,United Arab Emirates (UAE) - Abu Dhabi east of 54 deg East; Dubai; Sharjah; Ajman; Fujairah; Ras Al Kaimah; Umm Al Qaiwain.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1751,Peru - E of 73 deg W,Peru - east of 73 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1752,Peru - 79 to 73 deg W,Peru - between 79 and 73 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1753,Peru - W of 79 deg W,Peru - west of 79 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+1754,Brazil - offshore Amazon Cone,Brazil - offshore Amazon Cone.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+1755,South America - PSAD56 / UTM 17S,"South America (Chile; Ecuador; Peru) between 84 and 78 deg West, southern hemisphere.",,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1756,South America - PSAD56 / UTM 18N,"South America (Ecuador;  [Venezuela]) between 78 and 72 deg West, northern hemisphere.",,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1757,South America - PSAD56 / UTM 18S,"South America (Chile; Ecuador; Peru) between 78 and 72 deg West, southern hemisphere.",,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1758,South America - PSAD56 / UTM 19N,"South America (Netherlands Antilles; [Venezuela]) between 72 and 66 deg West, northern hemisphere.",,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1759,South America - PSAD56 / UTM 19S,"South America (Bolivia; Chile; Peru) between 72 and 66 deg West, southern hemisphere.",,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1760,South America - PSAD56 / UTM 20N,"South America (Guyana; [Venezuela]) between 66 and 60 deg West, northern hemisphere.",,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1761,South America - PSAD56 / UTM 20S,"South America (Bolivia) between 66 and 60 deg West, southern hemisphere.",,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1762,South America - PSAD56 / UTM 21N,"South America (Guyana) between 60 and 54 deg West, northern hemisphere.",,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1763,Russia - W of 24 deg E,Russian Federation - west of 24 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1764,Russia - 24 to 30 deg E,Russian Federation - between 24 and 30 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1765,Russia - 30 to 36 deg E,Russian Federation - between 30 and 36 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1766,Russia - 36 to 42 deg E,Russian Federation - between 36 and 42 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1767,Russia - 42 to 48 deg E,Russian Federation - between 42 and 48 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1768,Russia - 48 to 54 deg E,Russian Federation - between 48 and 54 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1769,Russia - 54 to 60 deg E,Russian Federation - between 54 and 60 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1770,Russia - 60 to 66 deg E,Russian Federation - between 60 and 66 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1771,Russia - 66 to 72 deg E,Russian Federation - between 66 and 72 deg East .,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1772,Russia - 72 to 78 deg E,Russian Federation - between 72 and 78 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1773,Russia - 78 to 84 deg E,Russian Federation - between 78 and 84 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1774,Russia - 84 to 90 deg E,Russian Federation - between 84 and 90 deg East.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+1775,Russia - 90 to 96 deg E,Russian Federation - between 90 and 96 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1776,Russia - 96 to 102 deg E,Russian Federation - between 96 and 102 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1777,Russia - 102 to 108 deg E,Russian Federation - between 102 and 108 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1778,Russia - 108 to 114 deg E,Russian Federation - between 108 and 114 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1779,Russia - 114 to 120 deg E,Russian Federation - between 114 and 120 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1780,Russia - 120 to 126 deg E,Russian Federation - between 120 and 126 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1781,Russia - 126 to 132 deg E,Russian Federation - between 126 and 132 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1782,Russia - 132 to 138 deg E,Russian Federation - between 132 and 138 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1783,Russia - 138 to 144 deg E,Russian Federation - between 138 and 144 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1784,Russia - 144 to 150 deg E,Russian Federation - between 144 and 150 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1785,Russia - 150 to 156 deg E,Russian Federation - between 150 and 156 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1786,Russia - 156 to 162 deg E,Russian Federation - between 156 and 162 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1787,Russia - 162 to 168 deg E,Russian Federation - between 162 and 168 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1788,Russia - 168 to 174 deg E,Russian Federation - between 168 and 174 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1789,Russia - 174 to 180 deg E,Russian Federation - between 174 and 180 deg East .,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1790,Russia - 180 to 174 deg W,Russian Federation - between 180 deg East and 174 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1791,Russia - E of 174 deg W,Russian Federation - east of 174 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1792,Europe - 6deg GK CM 15,Czech Republic and Germany ( former DDR) - east of 12 deg East; Poland and Slovakia - west of 18 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1793,Europe - 6deg GK CM 21,Estonia; Latvia; Lithuania; Russian Federation; Ukraine; - west of 24 deg East; Poland - east of 24 deg East; Slovakia east of 18 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1794,Europe - 6deg GK CM 27,Belarus - west of 30 deg East;  Estonia; Latvia & Lithuania - east of 24 deg East;  Moldova;  Russian Federation &  Ukraine - 24 to 30 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1795,Europe - 6deg GK CM 33,Belarus - east of 30 deg East;  Russian Federation  &  Ukraine  - 30 to 36 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1796,Europe - 6deg GK CM 39,Georgia - west of 36 deg East;  Russian Federation  - 36 to 42 deg East;  Ukraine - east of 36 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1797,Europe - 6deg GK CM 45,Armenia - west of 48 deg East;  Azerbaijan - west of 48 deg East;  Georgia - east of 42 deg East;  Russian Federation - 42 to 48 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1798,Asia - 6deg GK CM 51,Azerbaijan - east of 48 deg East;  Kazakstan - west of 54 deg East;  Russian Federation - 48 to 54 deg East;  Turkmenistan - west of 54 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1799,Asia - 6deg GK CM 57,Kazakstan;  Russian Federation;  Turkmenistan  - 54 deg  to 60 deg East; Uzbekistan - west of 60 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1800,Asia - 6deg GK CM 63,Kazakstan;  Russian Federation;  Uzbekistan - 60 to 66 deg East;  Turkmenistan - east of 60 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1801,Asia - 6deg GK CM 69,Kazakstan &  Russian Federation - 66 to 72 deg East;  Kirgistan & Tadzhikstan - west of 72 deg East;  Uzbekistan - east of 66 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1802,Asia - 6deg GK CM 75,Kazakstan;  Kirgizstan;  Russian Federation - 72 to 78 deg East;  Tadzhikstan - east of 72 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1803,Asia - 6deg GK CM 81,Kazakstan &  Russian Federation - 78 to 84 deg East; Kirgizstan - east of 78 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1804,Asia - 6deg GK CM 87,Kazakstan - east of 84 deg East;  Russian Federation - 84 to 90 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1805,Europe - 6deg GK CM 9,Czech Republic and Germany (former DDR) - west of 12 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.361,0
+1806,South America - SAD69 / UTM 17S,South America - between 84 and 78 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1807,South America - SAD69 / UTM 18N,South America - between 78 and 72 deg West; northern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1808,South America - SAD69 / UTM 18S,South America - Brazil - between 78 and 72 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1809,South America - SAD69 / UTM 19N,South America - between 72 and 66 deg West; northern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1810,South America - SAD69 / UTM 19S,South America - Brazil - between 72 and 66 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1811,South America - SAD69 / UTM 20N,South America - between 66 and 60 deg West; northern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1812,South America - SAD69 / UTM 20S,South America - Brazil - between 66 and 60 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1813,South America - SAD69 / UTM 21N,South America - between 60 and 54 deg West; northern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1814,South America - SAD69 / UTM 21S,South America - Brazil - between 60 and 54 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1815,South America - SAD69 / UTM 22N,South America - 54deg West to 48deg West; northern hemisphere. Brazil - offshore - Amazon cone.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1816,South America - SAD69 / UTM 22S,South America - Brazil - between 54 and 48 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1817,South America - SAD69 / UTM 23S,South America - between 48 and 42 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1818,South America - SAD69 / UTM 24S,South America - Brazil - between 42 and 36 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1819,South America - SAD69 / UTM 25S,South America - between 36 and 30 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1820,Falkland Islands - W of 60 deg W,Falkland Islands (Malvinas) - west of 60 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1821,Falkland Islands - E of 60 deg W,Falkland Islands (Malvinas) - east of 60 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1822,Namibia - offshore,Namibia - offshore.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+1823,South America - SIRGAS / UTM 17N,Between 84 and 78deg West; northern hemisphere. Ecuador - north of equator. Colombia.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1824,South America - SIRGAS / UTM 17S,Between 84 and 78deg West; southern hemisphere.  Chile. Colombia. Ecuador. Peru.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1825,South America - SIRGAS / UTM 18N,Between 78 and 72deg West; northern hemisphere. Colombia. Ecuador. Venezuela.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1826,South America - SIRGAS / UTM 18S,Between 78 and 72deg West; southern hemisphere. Argentina. Brazil. Chile. Colombia. Ecuador. Peru.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1827,South America - SIRGAS / UTM 19N,Between 72 and 66deg West; northern hemisphere. Brazil. Colombia. Venezuela.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1828,South America - SIRGAS / UTM 19S,Between 72 and 66deg West; southern hemisphere. Argentina. Bolivia. Brazil. Chile. Colombia. Peru.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1829,South America - SIRGAS / UTM 20N,Between 66 and 60deg West; northern hemisphere. Brazil. Guyana. Venezuela,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1830,South America - SIRGAS / UTM 20S,Between 66 and 60deg West; southern hemisphere. Argentina. Bolivia. Brazil. Falkland Islands (Malvinas). Paraguay.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1831,South America - SIRGAS / UTM 21N,Between 60 and 54deg West; northern hemisphere.  Brazil. French Guiana. Guyana.  Suriname.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1832,South America - SIRGAS / UTM 21S,Between 60 and 54deg West; southern hemisphere. Argentina. Bolivia. Brazil. Falkland Islands (Malvinas). Paraguay. Uruguay.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1833,South America - SIRGAS / UTM 22N,Between 54 and 48deg West; northern hemisphere. Brazil.  French Guiana.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1834,South America - SIRGAS / UTM 22S,Between 54 and 48deg West; southern hemisphere. Brazil.  Uruguay.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1835,South America - SIRGAS / UTM 23S,Between 48 and 42deg West; southern hemisphere. Brazil.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1836,South America - SIRGAS / UTM 24S,Between 42 and 36deg West; southern hemisphere. Brazil,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1837,South America - SIRGAS / UTM 25S,Between 36 and 30deg West; southern hemisphere. Brazil.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1838,Namibia - W of 12 deg E,Namibia - west of 12 deg East.,,,,,EPSG,EPSG,1997-06-16 00:00:00,,0
+1839,Namibia - 12 to 14 deg E,Namibia - between 12 and 14 deg East.,,,,,EPSG,EPSG,1997-06-16 00:00:00,,0
+1840,Namibia - 14 to 16 deg E,Namibia - between 14 and 16 deg East.,,,,,EPSG,EPSG,1997-06-16 00:00:00,,0
+1841,Namibia - 16 to 18 deg E,Namibia - between 16 and 18 deg East.,,,,,EPSG,EPSG,1997-06-16 00:00:00,,0
+1842,Namibia - 18 to 20 deg E,Namibia - between 18 and 20 deg East.,,,,,EPSG,EPSG,1997-06-16 00:00:00,,0
+1843,Namibia - 20 to 22 deg E,Namibia - between 20 and 22 deg East.,,,,,EPSG,EPSG,1997-06-16 00:00:00,,0
+1844,Namibia - 22 to 24 deg E,Namibia - between 22 and 24 deg East.,,,,,EPSG,EPSG,1997-06-16 00:00:00,,0
+1845,Namibia - E of 24 deg E,Namibia - east of 24 deg East.,,,,,EPSG,EPSG,1997-06-16 00:00:00,,0
+1846,Sudan - south - W of 30 deg E,Sudan south - west of 30 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1847,Sudan - south - E of 30 deg E,Sudan south - east of 30 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1848,Madagascar - offshore - W of 48 deg E,Madagascar - offshore west of 48 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1849,Madagascar - offshore - E of 48 deg E,Madagascar - offshore east of 48 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1850,UAE - Abu Dhabi - W of 54 deg E,United Arab Emirates (UAE) - Abu Dhabi west of 54 deg East.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1851,Malaysia - East Malaysia,Malaysia - East Malaysia (Sabah; Sarawak).,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+1852,Asia - Brunei and East Malaysia - UTM zone 49,Brunei - offshore; Malaysia - East Malaysia (Sarawak).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1853,Asia - Brunei and East Malaysia - UTM zone 50,Brunei - offshore; Malaysia - East Malaysia (Sabah).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1854,Japan - zone I,Japan - Kyushu west of approximately 130 deg East - Nagasaki-ken; islands of Kagoshima-ken between 27 and 32 deg N and between 128 deg 18 min and 130 deg E (between 128 deg 18 min and 30 deg 13 min E for Amami islands).,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1855,Japan - zone II,Japan - Kyushu east of approximately 130 deg East - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinate System zone I).,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1856,Japan - zone III,Japan - Honshu west of approximately 133 deg 15 min East - Yamaguchi-ken; Shimane-ken; Hiroshima-ken.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1857,Japan - zone IV,Japan - Shikoku - Kagawa-ken; Ehime-ken; Tokushima-ken; Kochi-ken.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1858,Japan - zone V,Japan - Honshu between approximately 133 deg 15 min and 135 deg 10 min East - Hyogo-ken; Tottori-ken; Okayama-ken.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1859,Japan - zone VI,Japan - Honshu between approximately 135 deg 10 min and 136 deg 45 min East - Kyoto-fu; Osaka-fu; Fukui-ken; Shiga-ken; Mie-ken; Nara-ken; Wakayama-ken.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1860,Japan - zone VII,Japan - Honshu between approximately 136 deg 15 min and 137 deg 45 min East - Ishikawa-ken; Toyama-ken; Gifu-ken; Aichi-ken.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1861,Japan - zone VIII,Japan - Honshu between approximately 137 deg 45 min and 139 deg East - Niigata-ken; Nagano-ken; Yamanashi-ken; Shizuoka-ken.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1862,Japan - zone IX,"Japan - Honshu - Tokyo-to. (Excludes offshore island areas of Tokyo-to covered by Japan Plane Rectangular Coordinate System zones XIV, XVIII and XIX).",,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1863,Japan - zone X,Japan - Honshu north of 38 deg North approximately - Aomori-ken; Akita-ken; Yamagata-ken; Iwate-ken; Miyagi-ken.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1864,Japan - zone XI,Japan - Hokkaido west of approximately 141 deg  East  - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1865,Japan - zone XII,Japan - Hokkaido between approximately 141 and 143 deg min East - Sapporo city; Asahikawa city; Wakkanai city; Rumoi city; Bibai city; Yubari city; Iwamizawa city; Tomakomai city; Muroran city; Shibetsu city; Nayoro city; Ashibetsu city; Akabira city; Mikasa city; Takikawa city; Sunagawa city; Ebetsu city; Chitose city; Utashinai city; Fukagawa city; Monbetsu city; Furano city; Noboribetsu city; Eniwa city; Ishikari-shicyo; Monbetsu-gun of Abashiri-shicyo; Kamikawa- [...]
+1866,Japan - zone XIII,Japan - Hokkaido east of approximately 143 deg East  - Kitami city; Obihiro city; Kushiro city; Abashiri city; Nemuro city; Nemuro-shicyo; Kushiro-shicyo; Abashiri-shicyo (except Monbetsu-gun); Tokachi-shicyo.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1867,Japan - zone XIV,Japan - Tokyo-to south of 28 deg North & between 140 deg 30 min & 143 deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1868,Japan - zone XV,Japan - Okinawa-ken between 126 and 130 deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1869,Japan - zone XVI,Japan - Okinawa-ken west of 126 deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1870,Japan - zone XVII,Japan - Okinawa-ken east of 130 deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1871,Japan - zone XVIII,Japan - Tokyo-to south of 28 deg North and west of 140 deg 30 min East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1872,Japan - zone XIX,Japan - Tokyo-to south of 28 deg North & east of 143 deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+1873,6-degree TM - N hemisphere CM 177 deg W,Between 180 deg and 174 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1874,6-degree TM - S hemisphere CM 177 deg W,Between 180 deg and 174 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1875,6-degree TM - N hemisphere CM 171 deg W,Between 174 and 168 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1876,6-degree TM - S hemisphere CM 171 deg W,Between 174 and 168 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1877,6-degree TM - N hemisphere CM 165 deg W,Between 168 and 162 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1878,6-degree TM - S hemisphere CM 165 deg W,Between 168 and 162 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1879,6-degree TM - N hemisphere CM 159 deg W,Between 162 and 156 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1880,6-degree TM - S hemisphere CM 159 deg W,Between 162 and 156 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1881,6-degree TM - N hemisphere CM 153 deg W,Between 156 and 150 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1882,6-degree TM - S hemisphere CM 153 deg W,Between 156 and 150 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1883,6-degree TM - N hemisphere CM 147 deg W,Between 150 and 144 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1884,6-degree TM - S hemisphere CM 147 deg W,Between 150 and 144 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1885,6-degree TM - N hemisphere CM 141 deg W,Between 144 and 138 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1886,6-degree TM - S hemisphere CM 141 deg W,Between 144 and 138 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1887,6-degree TM - N hemisphere CM 135 deg W,Between 138 and 132 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1888,6-degree TM - S hemisphere CM 135 deg W,Between 138 and 132 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1889,6-degree TM - N hemisphere CM 129 deg W,Between 132 and 126 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1890,6-degree TM - S hemisphere CM 129 deg W,Between 132 and 126 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1891,6-degree TM - N hemisphere CM 123 deg W,Between 126 and 120 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1892,6-degree TM - S hemisphere CM 123 deg W,Between 126 and 120 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1893,6-degree TM - N hemisphere CM 117 deg W,Between 120 and 114 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1894,6-degree TM - S hemisphere CM 117 deg W,Between 120 and 114 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1895,6-degree TM - N hemisphere CM 111 deg W,Between 114 and 108 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1896,6-degree TM - S hemisphere CM 111 deg W,Between 114 and 108 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1897,6-degree TM - N hemisphere CM 105 deg W,Between 108 and 102 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1898,6-degree TM - S hemisphere CM 105 deg W,Between 108 and 102 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1899,6-degree TM - N hemisphere CM 99 deg W,Between 102 and 96 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1900,6-degree TM - S hemisphere CM 99 deg W,Between 102 and 96 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1901,6-degree TM - N hemisphere CM 93 deg W,Between 96 and 90 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1902,6-degree TM - S hemisphere CM 93 deg W,Between 96 and 90 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1903,6-degree TM - N hemisphere CM 87 deg W,Between 90 and 84 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1904,6-degree TM - S hemisphere CM 87 deg W,Between 90 and 84 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1905,6-degree TM - N hemisphere CM 81 deg W,Between 84 and 78 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1906,6-degree TM - S hemisphere CM 81 deg W,Between 84 and 78 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1907,6-degree TM - N hemisphere CM 75 deg W,Between 78 and 72 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1908,6-degree TM - S hemisphere CM 75 deg W,Between 78 and 72 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1909,6-degree TM - N hemisphere CM 69 deg W,Between 72 and 66 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1910,6-degree TM - S hemisphere CM 69 deg W,Between 72 and 66 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1911,6-degree TM - N hemisphere CM 63 deg W,Between 66 and 60 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1912,6-degree TM - S hemisphere CM 63 deg W,Between 66 and 60 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1913,6-degree TM - N hemisphere CM 57 deg W,Between 60 and 54 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1914,6-degree TM - S hemisphere CM 57 deg W,Between 60 and 54 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1915,6-degree TM - N hemisphere CM 51 deg W,Between 54 and 48 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1916,6-degree TM - S hemisphere CM 51 deg W,Between 54 and 48 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1917,6-degree TM - N hemisphere CM 45 deg W,Between 48 and 42 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1918,6-degree TM - S hemisphere CM 45 deg W,Between 48 and 42 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1919,6-degree TM - N hemisphere CM 39 deg W,Between 42 and 36 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1920,6-degree TM - S hemisphere CM 39 deg W,Between 42 and 36 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1921,6-degree TM - N hemisphere CM 33 deg W,Between 36 and 30 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1922,6-degree TM - S hemisphere CM 33 deg W,Between 36 and 30 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1923,6-degree TM - N hemisphere CM 27 deg W,Between 30 and 24 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1924,6-degree TM - S hemisphere CM 27 deg W,Between 30 and 24 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1925,6-degree TM - N hemisphere CM 21 deg W,Between 24 and 18 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1926,6-degree TM - S hemisphere CM 21 deg W,Between 24 and 18 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1927,6-degree TM - N hemisphere CM 15 deg W,Between 18 and 12 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1928,6-degree TM - S hemisphere CM 15 deg W,Between 18 and 12 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1929,6-degree TM - N hemisphere CM 9 deg W,Between 12 and 6 deg West; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1930,6-degree TM - S hemisphere CM 9 deg W,Between 12 and 6 deg West; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1931,6-degree TM - N hemisphere CM 3 deg W,Between 6 deg West and 0 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1932,6-degree TM - S hemisphere CM 3 deg W,Between 6 deg West and 0 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1933,6-degree TM - N hemisphere CM 3 deg E,Between 0 and 6 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1934,6-degree TM - S hemisphere CM 3 deg E,Between 0 and 6 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1935,6-degree TM - N hemisphere CM 9 deg E,Between 6 and 12 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1936,6-degree TM - S hemisphere CM 9 deg E,Between 6 and 12 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1937,6-degree TM - N hemisphere CM 15 deg E,Between 12 and 18 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1938,6-degree TM - S hemisphere CM 15 deg E,Between 12 and 18 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1939,6-degree TM - N hemisphere CM 21 deg E,Between 18 and 24 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1940,6-degree TM - S hemisphere CM 21 deg E,Between 18 and 24 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1941,6-degree TM - N hemisphere CM 27 deg E,Between 24 and 30 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1942,6-degree TM - S hemisphere CM 27 deg E,Between 24 and 30 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1943,6-degree TM - N hemisphere CM 33 deg E,Between 30 and 36 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1944,6-degree TM - S hemisphere CM 33 deg E,Between 30 and 36 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1945,6-degree TM - N hemisphere CM 39 deg E,Between 36 and 42 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1946,6-degree TM - S hemisphere CM 39 deg E,Between 36 and 42 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1947,6-degree TM - N hemisphere CM 45 deg E,Between 42 and 48 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1948,6-degree TM - S hemisphere CM 45 deg E,Between 42 and 48 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1949,6-degree TM - N hemisphere CM 51 deg E,Between 48 and 54 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1950,6-degree TM - S hemisphere CM 51 deg E,Between 48 and 54 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1951,6-degree TM - N hemisphere CM 57 deg E,Between 54 and 60 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1952,6-degree TM - S hemisphere CM 57 deg E,Between 54 and 60 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1953,6-degree TM - N hemisphere CM 63 deg E,Between 60 and 66 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1954,6-degree TM - S hemisphere CM 63 deg E,Between 60 and 66 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1955,6-degree TM - N hemisphere CM 69 deg E,Between 66 and 72 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1956,6-degree TM - S hemisphere CM 69 deg E,Between 66 and 72 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1957,6-degree TM - N hemisphere CM 75 deg E,Between 72 and 78 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1958,6-degree TM - S hemisphere CM 75 deg E,Between 72 and 78 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1959,6-degree TM - N hemisphere CM 81 deg E,Between 78 and 84 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1960,6-degree TM - S hemisphere CM 81 deg E,Between 78 and 84 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1961,6-degree TM - N hemisphere CM 87 deg E,Between 84 and 90 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1962,6-degree TM - S hemisphere CM 87 deg E,Between 84 and 90 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1963,6-degree TM - N hemisphere CM 93 deg E,Between 90 and 96 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1964,6-degree TM - S hemisphere CM 93 deg E,Between 90 and 96 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1965,6-degree TM - N hemisphere CM 99 deg E,Between 96 and 102eg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1966,6-degree TM - S hemisphere CM 99 deg E,Between 96 and 102eg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1967,6-degree TM - N hemisphere CM 105 deg E,Between 102 and 108 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1968,6-degree TM - S hemisphere CM 105 deg E,Between 102 and 108 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1969,6-degree TM - N hemisphere CM 111 deg E,Between 108 and 114 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1970,6-degree TM - S hemisphere CM 111 deg E,Between 108 and 114 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1971,6-degree TM - N hemisphere CM 117 deg E,Between 114 and 120 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1972,6-degree TM - S hemisphere CM 117 deg E,Between 114 and 120 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1973,6-degree TM - N hemisphere CM 123 deg E,Between 120 and 126 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1974,6-degree TM - S hemisphere CM 123 deg E,Between 120 and 126 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1975,6-degree TM - N hemisphere CM 129 deg E,Between 126 and 132 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1976,6-degree TM - S hemisphere CM 129 deg E,Between 126 and 132 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1977,6-degree TM - N hemisphere CM 135 deg E,Between 132 and 138 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1978,6-degree TM - S hemisphere CM 135 deg E,Between 132 and 138 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1979,6-degree TM - N hemisphere CM 141 deg E,Between 138 and 144 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1980,6-degree TM - S hemisphere CM 141 deg E,Between 138 and 144 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1981,6-degree TM - N hemisphere CM 147 deg E,Between 144 and 150 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1982,6-degree TM - S hemisphere CM 147 deg E,Between 144 and 150 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1983,6-degree TM - N hemisphere CM 153 deg E,Between 150 and 156 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1984,6-degree TM - S hemisphere CM 153 deg E,Between 150 and 156 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1985,6-degree TM - N hemisphere CM 159 deg E,Between 156 and 162 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1986,6-degree TM - S hemisphere CM 159 deg E,Between 156 and 162 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1987,6-degree TM - N hemisphere CM 165 deg E,Between 162 and 168 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1988,6-degree TM - S hemisphere CM 165 deg E,Between 162 and 168 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1989,6-degree TM - N hemisphere CM 171 deg E,Between 168 and 174 deg East; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1990,6-degree TM - S hemisphere CM 171 deg E,Between 168 and 174 deg East; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1991,6-degree TM - N hemisphere CM 177 deg E,Between 174 and 180 deg; northern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1992,6-degree TM - S hemisphere CM 177 deg E,Between 174 and 180 deg; southern hemisphere.,,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+1993,WGS72BE / UTM zone 48N,Between 102 and 108 deg East; northern hemisphere.  Vietnam - offshore.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1994,WGS72BE / UTM zone 49N,Between 108 and 114 deg East; northern hemisphere. Vietnam - offshore.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1995,WGS72BE / UTM zone 49S,Between 108 and 114 deg East; southern hemisphere.  Indonesia - offshore.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+1996,UPS - north,Northern hemisphere polar area.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1997,UPS - south,Southern hemisphere polar area.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+1998,UTM north,Northern hemisphere between equator and 84 deg North.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+1999,UTM south,Southern hemisphere between equator and 80 deg South.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2000,WGS84 / UTM zone 1N,Between 180 deg and 174 deg West; northern hemisphere; Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2001,WGS84 / UTM zone 1S,Between 180 deg and 174 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2002,WGS84 / UTM zone 2N,Between 174 and 168 deg West; northern hemisphere. Russian Federation; United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2003,WGS84 / UTM zone 2S,Between 174 and 168 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2004,WGS84 / UTM zone 3N,Between 168 and 162 deg West; northern hemisphere. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2005,WGS84 / UTM zone 3S,Between 168 and 162 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2006,WGS84 / UTM zone 4N,Between 162 and 156 deg West; northern hemisphere. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2007,WGS84 / UTM zone 4S,Between 162 and 156 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2008,WGS84 / UTM zone 5N,Between 156 and 150 deg West; northern hemisphere. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2009,WGS84 / UTM zone 5S,Between 156 and 150 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2010,WGS84 / UTM zone 6N,Between 150 and 144 deg West; northern hemisphere. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2011,WGS84 / UTM zone 6S,Between 150 and 144 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2012,WGS84 / UTM zone 7N,Between 144 and 138 deg West; northern hemisphere. Canada - British Columbia (BC); Yukon. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2013,WGS84 / UTM zone 7S,Between 144 and 138 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2014,WGS84 / UTM zone 8N,Between 138 and 132 deg West; northern hemisphere. Canada - British Columbia (BC); North West Territiories; Yukon. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2015,WGS84 / UTM zone 8S,Between 138 and 132 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2016,WGS84 / UTM zone 9N,Between 132 and 126 deg West; northern hemisphere. Canada - British Columbia (BC); North West Territories; Yukon. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2017,WGS84 / UTM zone 9S,Between 132 and 126 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2018,WGS84 / UTM zone 10N,Between 126 and 120 deg West; northern hemisphere. Canada - British Columbia (BC); North West Territories; Nunavut; Yukon. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2019,WGS84 / UTM zone 10S,Between 126 and 120 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2020,WGS84 / UTM zone 11N,Between 120 and 114 deg West; northern hemisphere. Canada - Alberta; British Columbia (BC); North West Territories; Nunavut. Mexico. United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2021,WGS84 / UTM zone 11S,Between 120 and 114 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2022,WGS84 / UTM zone 12N,Between 114 and 108 deg West; northern hemisphere. Canada - Alberta; North West Territories; Nunavut; Saskatchewan.  Mexico.  United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2023,WGS84 / UTM zone 12S,Between 114 and 108 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2024,WGS84 / UTM zone 13N,Between 108 and 102 deg West; northern hemisphere. Canada - North West Territories; Nunavut; Saskatchewan.  Mexico.  United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2025,WGS84 / UTM zone 13S,Between 108 and 102 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2026,WGS84 / UTM zone 14N,Between 102 and 96 deg West; northern hemisphere. Canada - Manitoba; Nunavut; Saskatchewan.  Mexico.  United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2027,WGS84 / UTM zone 14S,Between 102 and 96 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2028,WGS84 / UTM zone 15N,Between 96 and 90 deg West; northern hemisphere. Canada - Manitoba; Nunavut; Ontario.  Guatemala.  Mexico.  United States (USA) - Gulf of Mexico (GoM).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2029,WGS84 / UTM zone 15S,Between 96 and 90 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2030,WGS84 / UTM zone 16N,Between 90 and 84 deg West; northern hemisphere. Belize. Canada - Manitoba; Nunavut; Ontario.  Costa Rica. Cuba. El Salvador. Guatemala. Honduras. Mexico. Nicaragua. Puerto Rico. United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2031,WGS84 / UTM zone 16S,Between 90 and 84 deg West; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2032,WGS84 / UTM zone 17N,Between 84 and 78 deg West; northern hemisphere. Bahamas. Ecuador - north of equator. Canada - Nunavut; Ontario; Quebec.  Cayman Islands.  Colombia. Costa Rica. Jamaica. Nicaragua. Panama. Puerto Rico. United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2033,WGS84 / UTM zone 17S,Between 84 and 78 deg West; southern hemisphere. Ecuador. Peru.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2034,WGS84 / UTM zone 18N,Between 78 and 72 deg West; northern hemisphere. Bahamas. Canada - Nunavut; Ontario; Quebec. Colombia. Cuba. Ecuador. Greenland. Haiti. Jamica. Panama. Turks and Caicos Islands. United States (USA). Venezuela.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2035,WGS84 / UTM zone 18S,Between 78 and 72 deg West; southern hemisphere. Argentina. Brazil. Chile. Colombia. Ecuador. Peru.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2036,WGS84 / UTM zone 19N,Between 72 and 66 deg West; northern hemisphere. Aruba. Bahamas. Brazil. Canada - New Brunswick (NB); Newfoundland; Nunavut; Nova Scotia (NS); Quebec. Colombia. Dominican Republic. Greenland. Netherlands Antilles. Puerto Rico. Turks and Caicos Islands. United States. Venezuela.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2037,WGS84 / UTM zone 19S,Between 72 and 66 deg West; southern hemisphere. Argentina. Bolivia. Brazil. Chile. Colombia. Peru.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2038,WGS84 / UTM zone 20N,Between 66 and 60 deg West; northern hemisphere. Anguilla. Antigua & Barbuda. Bermuda. Brazil. Canada - New Brunswick (NB); Newfoundland; North west Territories; Nova Scotia (NS); Prince Edward Island; Quebec. Dominica. Greenland. Grenada. Guadeloupe. Guyana. Martinique. Montserrat. Saint Kitts and Nevis. Saint Lucia. Saint Vncent and the Grenadines. Trinidad and Tobago. Venezuela. Virgin islands.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2039,WGS84 / UTM zone 20S,Between 66 and 60 deg West; southern hemisphere. Argentina. Bolivia. Brazil. Falkland Islands (Malvinas). Paraguay.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2086,WGS84 / UTM zone 44N,Between 78 and 84 deg East; northern hemisphere. China. India. Kazakstan. Kyrgyzstan. Nepal. Russian Federation. Sri Lanka.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2087,WGS84 / UTM zone 44S,Between 78 and 84 deg East; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2088,WGS84 / UTM zone 45N,Between 84 and 90 deg East; northern hemisphere. Bangladesh. Bhutan. China. India. Kazakstan. Mongolia. Nepal. Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2089,WGS84 / UTM zone 45S,Between 84 and 90 deg East; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2090,WGS84 / UTM zone 46N,Between 90 and 96 deg East; northern hemisphere. Bangladesh. Bhutan. China. Indonesia. Mongolia. Myanmar (Burma). Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2091,WGS84 / UTM zone 46S,Between 90 and 96 deg East; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2092,WGS84 / UTM zone 47N,Between 96 and 102 deg East; northern hemisphere. China. Indonesia. Laos. Malaysia - West Malaysia. Mongolia. Myanmar (Burma). Russian Federation. Thailand.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2093,WGS84 / UTM zone 47S,Between 96 and 102 deg East; southern hemisphere. Indonesia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2094,WGS84 / UTM zone 48N,Between 102 and 108 deg East; northern hemisphere. Cambodia. China. Indonesia. Laos. Malaysia - West Malaysia. Mongolia. Russian Federation. Singapore. Thailand. Vietnam.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2095,WGS84 / UTM zone 48S,Between 102 and 108 deg East; southern hemisphere. Indonesia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2096,WGS84 / UTM zone 49N,Between 108 and 114 deg East; northern hemisphere. China. Hong Kong. Indonesia. Macau. Malaysia - East Malaysia - Sarawak. Mongolia. Russian Federation. Vietnam.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2097,WGS84 / UTM zone 49S,Between 108 and 114 deg East; southern hemisphere. Australia. Indonesia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2098,WGS84 / UTM zone 50N,Between 114 and 120 deg East; northern hemisphere. Brunei. China. Hong Kong. Indonesia. Malaysia - East Malaysia - Sarawak. Mongolia. Philippines. Russian Federation. Taiwan.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2099,WGS84 / UTM zone 50S,Between 114 and 120 deg East; southern hemisphere. Australia. Indonesia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2100,WGS84 / UTM zone 51N,Between 120 and 126 deg East; northern hemisphere. China. Indonesia. Japan. North Korea. Philippines. Russian Federation.  South Korea. Taiwan.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2101,WGS84 / UTM zone 51S,Between 120 and 126 deg East; southern hemisphere. Australia. East Timor. Indonesia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2102,WGS84 / UTM zone 52N,Between 126 and 132 deg East; northern hemisphere. China. Indonesia. Japan. North Korea. Russian Federation. South Korea.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2103,WGS84 / UTM zone 52S,Between 126 and 132 deg East; southern hemisphere. Australia. East Timor. Indonesia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2104,WGS84 / UTM zone 53N,Between 132 and 138 deg East; northern hemisphere. China. Japan. Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2105,WGS84 / UTM zone 53S,Between 132 and 138 deg East; southern hemisphere. Australia.  Indonesia.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2106,WGS84 / UTM zone 54N,Between 138 and 144 deg East; northern hemisphere. Japan. Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2107,WGS84 / UTM zone 54S,Between 138 and 144 deg East; southern hemisphere. Australia. Indonesia. Papua New Guinea.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2108,WGS84 / UTM zone 55N,Between 144 and 150 deg East; northern hemisphere. Japan. Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2109,WGS84 / UTM zone 55S,Between 144 and 150 deg East; southern hemisphere. Australia. Papua New Guinea.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2110,WGS84 / UTM zone 56N,Between 150 and 156 deg East; northern hemisphere. Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2111,WGS84 / UTM zone 56S,Between 150 and 156 deg East; southern hemisphere. Australia. Papua New Guinea.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2112,WGS84 / UTM zone 57N,Between 156 and 162 deg East; northern hemisphere. Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2113,WGS84 / UTM zone 57S,Between 156 and 162 deg East; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2114,WGS84 / UTM zone 58N,Between 162 and 168 deg East; northern hemisphere. Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2115,WGS84 / UTM zone 58S,Between 162 and 168 deg East; southern hemisphere.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2116,WGS84 / UTM zone 59N,Between 168 and 174 deg East; northern hemisphere. Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2117,WGS84 / UTM zone 59S,Between 168 and 174 deg East; southern hemisphere. New Zealand.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2118,WGS84 / UTM zone 60N,Between 174 and 180 deg East; northern hemisphere. Russian Federation.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2119,WGS84 / UTM zone 60S,Between 174 and 180 deg East; southern hemisphere. New Zealand.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2120,Guatemala - N of 15 deg 50 min N,Guatemala - north of 15 deg 50 min North.,,,,,EPSG,EPSG,1999-08-16 00:00:00,,0
+2121,Guatemala - S of 15 deg 50 min N,Guatemala - south of 15 deg 50 min North.,,,,,EPSG,EPSG,2000-01-06 00:00:00,,0
+2122,Europe - ETRS89 / UTM 28,Europe - between 18 and 12 deg West - United Kingdom (UKCS) offshore.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2123,Europe - ETRS89 / UTM 29,Europe - between 12 and 6 deg West - United Kingdom (UKCS) offshore.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2124,Europe - ETRS89 / UTM 30,Europe - between 6 and 0 deg West.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2125,Europe - ETRS89 / UTM 31,Europe - between 0 and 6 deg East - Norway.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2126,Europe - ETRS89 / UTM 32,Europe - between 6 and 12deg East - Norway.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2127,Europe - ETRS89 / UTM 33,Europe - between 12 and 18deg East - Germany - Brandenburg; Norway.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2128,Europe - ETRS89 / UTM 34,Europe - between 18 and 24deg East - Norway.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2129,Europe - ETRS89 / UTM 35,Europe - between 24 and 30deg East - Norway.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2130,Europe - ETRS89 / UTM 36,Europe - between 30 and 36deg East.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2131,Europe - ETRS89 / UTM 37,Europe - between 36 and 42deg East.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2132,Europe - ETRS89 / UTM 38,Europe - between 42 and 48deg East.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2133,North America - UTM zone 3,North America - between 168 and 162 deg West. United States (USA) - Alaska.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2134,North America - UTM zone 4,North America - between 162 and 156 deg West. United States (USA) - Alaska.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2135,North America - UTM zone 5,North America - between 156 and 150 deg West. United States (USA) - Alaska.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2136,North America - UTM zone 6,North America - between 150 and 144 deg West. United States (USA) - Alaska.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2137,North America - UTM zone 7,North America - between 144 and 138 deg West. Canada - British Columbia (BC); Yukon. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2138,North America - UTM zone 8,North America - between 138 and 132 deg West. Canada - British Columbia (BC); North West Territiories; Yukon. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2139,North America - UTM zone 9,North America - between 132 and 126 deg West. Canada - British Columbia (BC); North West Territories; Yukon. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2140,North America - UTM zone 10,North America - between 130 and 120 deg West. Canada - British Columbia (BC); North West Territories; Nunavut; Yukon. United States (USA) - Alaska (AK).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2141,North America - UTM zone 11,North America - between 120 and 114 deg West. Canada - Alberta; British Columbia (BC); North West Territories; Nunavut. Mexico. United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2142,North America - UTM zone 12,North America - between 114 and 108 deg West. Canada - Alberta; North West Territories; Nunavut; Saskatchewan.  Mexico.  United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2143,North America - UTM zone 13,North America - between 108 and 102 deg West. Canada - North West Territories; Nunavut; Saskatchewan.  Mexico.  United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2144,North America - UTM zone 14,North America - between 102 and 96 deg West. Canada - Manitoba; Nunavut; Saskatchewan.  Mexico.  United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2145,North America - UTM zone 15,North America - between 96 and 90 deg West. Canada - Manitoba; Nunavut; Ontario.  Guatemala.  Mexico.  United States (USA) - Gulf of Mexico (GoM).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2146,North America - UTM zone 16,North America - between 90 and 84 deg West.  Belize. Canada - Manitoba; Nunavut; Ontario.  Costa Rica. Cuba. El Salvador. Guatemala. Honduras. Mexico. Nicaragua. United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2147,North America - UTM zone 17,North America - between 84 and 78 deg West. Canada - Nunavut; Ontario; Quebec.  Mexico.  United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2148,North America - UTM zone 18,North America - between 78 and 72 deg West. Canada - Nunavut; Ontario; Quebec. United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2149,North America - UTM zone 19,North America - between 72 and 66 deg West. Canada - New Brunswick (NB); Newfoundland; Nunavut; Nova Scotia (NS); Quebec. United States (USA).,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2150,North America - UTM zone 20,North America - between 66 and 60 deg West. Canada - New Brunswick (NB); Newfoundland; North west Territories; Nova Scotia (NS); Prince Edward Island; Quebec. United States (USA) offshore Atlantic,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2151,Canada - UTM zone 21,North America - between 60 and 54 deg West. Canada - Newfoundland; Quebec.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2152,Canada - UTM zone 22,North America - between 54 and 48 deg West. Canada - Newfoundland.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2153,Canada - UTM zone 23,North America - Canada offshore Atlantic - between 48 and 42 deg West.,,,,,EPSG,EPSG,1995-06-02 00:00:00,,0
+2154,USA - Alabama - SPCS - E,United States (USA) - Alabama east of approximately 86d 37m West - counties Barbour; Bullock; Calhoun; Chambers; Cherokee; Clay; Cleburne; Coffee; Coosa; Covington; Crenshaw; Dale; De Kalb; Elmore; Etowah; Geneva; Henry; Houston; Jackson; Lee; Macon; Madison; Marshall; Montgomery; Pike; Randolph; Russell; St.Clair; Talladega; Tallapoosa.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2155,USA - Alabama - SPCS - W,United States (USA) - Alabama west of approximately 86d 37m West - counties Autauga; Baldwin; Bibb; Blount; Butler; Chilton; Choctaw; Clarke; Colbert; Conecuh; Cullman; Dallas; Escambia; Fayette; Franklin; Greene; Hale; Jefferson; Lamar; Lauderdale; Lawrence; Limestone; Lowndes; Marengo; Marion; Mobile; Monroe; Morgan; Perry; Pickens; Shelby; Sumter; Tuscaloosa; Walker; Washington; Wilcox; Winston.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2156,USA - Alaska - Panhandle,United States (USA) - Alaska - east of 141 deg West; i.e. Panhandle.,,,,,EPSG,EPSG,1996-09-12 00:00:00,,0
+2157,USA - Alaska - Aleutian Islands,United States (USA) - Alaska - Aleutian Islands.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2158,USA - Alaska - 144 to 141 deg W,United States (USA) - Alaska - 144 to 141 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2159,USA - Alaska - 148 to 144 deg W,United States (USA) - Alaska - 148 to 144 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2160,USA - Alaska - 152 to 148 deg W,United States (USA) - Alaska - 152 to 148 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2161,USA - Alaska - 156 to 152 deg W,United States (USA) - Alaska - 156 to 152 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2162,USA - Alaska - 160 to 156 deg W,United States (USA) - Alaska - 160 to 156 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2163,USA - Alaska - 164 to 160 deg W,United States (USA) - Alaska - 164 to 160 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2164,USA - Alaska - N of 54.5 deg N; 168 to 164 deg W,United States (USA) - Alaska - north of 54d 30m North and between 168 to 164 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2165,USA - Alaska - N of 54.5 deg N; W of 168 deg W,United States (USA) - Alaska - north of 54d 30m North and west of 168 deg West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2166,USA - Arizona - SPCS - central,United States (USA) - Arizona between approximately 110d 45m and 113d 20m West - counties Coconino; Maricopa; Pima; Pinal; Santa Cruz; Yavapai.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2167,USA - Arizona - SPCS - E,United States (USA) - Arizona east of approximately 110d 45m West - counties Apache; Cochise; Gila; Graham; Greenlee; Navajo.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2168,USA - Arizona - SPCS - W,United States (USA) - Arizona west of approximately 113d 20m West - counties La Paz; Mohave; Yuma.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2169,USA - Arkansas - SPCS - N,United States (USA) - Arkansas north of approximately 34d 50m North - counties Baxter; Benton; Boone; Carroll; Clay; Cleburne; Conway; Craighead; Crawford; Crittenden; Cross; Faulkner; Franklin; Fulton; Greene; Independence; Izard; Jackson; Johnson; Lawrence; Logan; Madison; Marion; Mississippi; Newton; Perry; Poinsett; Pope; Randolph; Scott; Searcy; Sebastian; Sharp; St. Francis; Stone; Van Buren; Washington; White; Woodruff; Yell.,,,,,EPSG,EPSG,1999-04-22 [...]
+2170,USA - Arkansas - SPCS - S,United States (USA) - Arkansas south of approximately 34d 50m North - counties Arkansas; Ashley; Bradley; Calhoun; Chicot; Clark; Cleveland; Columbia; Dallas; Desha; Drew; Garland; Grant; Hempstead; Hot Spring; Howard; Jefferson; Lafayette; Lee; Lincoln; Little River; Lonoke; Miller; Monroe; Montgomery; Nevada; Ouachita; Phillips; Pike; Polk; Prairie; Pulaski; Saline; Sevier; Union.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2171,USA - GoM OCS - W of 96 deg W,United States (USA) - Gulf of Mexico outer continental shelf (GoM OCS) west of approximately 96 deg West - protraction areas Corpus Christi; Port Isabel.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2172,USA - GoM OCS - 96 to 90 deg W,United States (USA) - Gulf of Mexico outer continental shelf (GoM OCS) between approximately 96 deg and 90 deg West - protraction areas East Breaks (EB); Alaminos Canyon (AC); Garden Banks (GB); Keathley Canyon (KC); Ewing Bank (EW); Green Canyon (GC); Walker Ridge (WR).,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2173,USA - GoM OCS - 90 to 84 deg W,United States (USA) - Gulf of Mexico outer continental shelf (GoM OCS) between approximately 90 deg and 84 deg West - protraction areas Mobile (MO); Viosca Knoll (VK); Mississippi Canyon (MC); Atwater Valley (AT); Lund; Pensacola; Destin Dome (DD); De Soto Canyon; Lloyd; Henderson; Apalachicola; Florida Middle Ground; The Elbow; Vernon Basin; Howell Hook; Rankin.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2174,USA - GoM OCS - E of 84 deg W,United States (USA) - Gulf of Mexico outer continental shelf (GoM OCS) east of approximately 84 deg West - protraction areas Gainesville; Tarpon Springs; St. Petersburg; Charlotte Harbor; Pulley Ridge; Dry Tortugas; Miami; Key West.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2175,USA - California - SPCS - 1,United States (USA) - California north of approximately 40 deg North - counties Del Norte; Humboldt; Lassen; Modoc; Plumas; Shasta; Siskiyou; Tehama; Trinity.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2176,USA - California - SPCS - 2,United States (USA) - California between approximately 40 deg & 38d 15m North - counties Alpine; Amador; Butte; Colusa; El Dorado; Glenn; Lake; Mendocino; Napa; Nevada; Placer; Sacramento; Sierra; Solano; Sonoma; Sutter; Yolo; Yuba.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2177,USA - California - SPCS - 3,United States (USA) - California between approximately 38d 15m & 37d North - counties Alameda; Calaveras; Contra Costa; Madera; Marin; Mariposa; Merced; Mono; San Francisco; San Joaquin; San Mateo; Santa Clara; Santa Cruz; Stanislaus; Tuolumne.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2178,USA - California - SPCS - 4,United States (USA) - California between approximately 37d & 35d 30m North - counties Fresno; Inyo; Kings; Monterey; San Benito; Tulare.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2179,USA - California - SPCS27 - 5,United States (USA) - California between approximately 35d 50m & 34d North excluding LA - counties Kern; San Bernardino; San Luis Obispo; Santa Barbara; Ventura.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2180,USA - California - SPCS - 6,United States (USA) - California south of approximately 38d 30m North - counties Imperial; Orange; Riverside; San Diego.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2181,USA - California - SPCS27 - 7,United States (USA) - California - Los Angeles county.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2182,USA - California - SPCS83 - 5,United States (USA) - California between approximately 35d 50m & 34d North - counties Kern; Los Angeles; San Bernardino; San Luis Obispo; Santa Barbara; Ventura.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2183,USA - Colorado - SPCS - C,United States (USA) - Colorado between approximately 39d 50m & 38d 30m North - counties Arapahoe; Chaffee; Cheyenne; Clear Creek; Delta; Denver; Douglas; Eagle; El Paso; Elbert; Fremont; Garfield; Gunnison; Jefferson; Kit Carson; Lake; Lincoln; Mesa; Park; Pitkin; Summit; Teller.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2184,USA - Colorado - SPCS - N,United States (USA) - Colorado north of approximately 39d 50m North - counties Adams; Boulder; Gilpin; Grand; Jackson; Larimer; Logan; Moffat; Morgan; Phillips; Rio Blanco; Routt; Sedgwick; Washington; Weld; Yuma.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2185,USA - Colorado - SPCS - S,United States (USA) - Colorado south of approximately 38d 30m North - counties Alamosa; Archuleta; Baca; Bent; Conejos; Costilla; Crowley; Custer; Dolores; Hinsdale; Huerfano; Kiowa; La Plata; Las Animas; Mineral; Montezuma; Montrose; Otero; Ouray; Prowers; Pueblo; Rio Grande; Saguache; San Juan; San Miguel.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2186,USA - Florida - SPCS - E,United States (USA) - Florida east of approximately 81d 45m West - counties of Brevard; Broward; Clay; Collier; Dade; Duval; Flagler; Glades; Hendry; Highlands; Indian River; Lake; Martin; Monroe; Nassau; Okeechobee; Orange; Osceola; Palm Beach; Putnam; Seminole; St. Johns; St. Lucie; Volusia.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2187,USA - Florida - SPCS - N,United States (USA) - Florida north of approximately 29d 30m North & west of approximately 82d West - counties of Alachua; Baker; Bay; Bradford; Calhoun; Columbia; Dixie; Escambia; Franklin; Gadsden; Gilchrist; Gulf; Hamilton; Holmes; Jackson; Jefferson; Lafayette; Leon; Liberty; Madison; Okaloosa; Santa Rosa; Suwannee; Taylor; Union; Wakulla; Walton; Washington.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2188,USA - Florida - SPCS - W,United States (USA) - Florida west of approximately 81d 45m West & south of approximately 29d 30m North - counties of Charlotte; Citrus; De Soto; Hardee; Hernando; Hillsborough; Lee; Levy; Manatee; Marion; Pasco; Pinellas; Polk; Sarasota; Sumter.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2189,USA - Georgia - SPCS - E,United States (USA) - Georgia east of approximately 83d 15m West - counties of Appling; Atkinson; Bacon; Baldwin; Brantley; Bryan; Bulloch; Burke; Camden; Candler; Charlton; Chatham; Clinch; Coffee; Columbia; Dodge; Echols; Effingham; Elbert; Emanuel; Evans; Franklin; Glascock; Glynn; Greene; Hancock; Hart; Jeff Davis; Jefferson; Jenkins; Johnson; Lanier; Laurens; Liberty; Lincoln; Long; Madison; McDuffie; McIntosh; Montgomery; Oglethorpe; Pierce; Richmond;  [...]
+2190,USA - Georgia - SPCS - W,United States (USA) - Georgia west of approximately 83d 15m West - counties of Baker; Banks; Barrow; Bartow; Ben Hill; Berrien; Bibb; Bleckley; Brooks; Butts; Calhoun; Carroll; Catoosa; Chattahoochee; Chattooga; Cherokee; Clarke; Clay; Clayton; Cobb; Colquitt; Cook; Coweta; Crawford; Crisp; Dade; Dawson; De Kalb; Decatur; Dooly; Dougherty; Douglas; Early; Fannin; Fayette; Floyd; Forsyth; Fulton; Gilmer; Gordon; Grady; Gwinnett; Habersham; Hall; Haralson; Har [...]
+2191,USA - Idaho - SPCS - central,United States (USA) - Idaho between approximately 113d & 115d West - counties of Blaine; Butte; Camas; Cassia; Custer; Gooding; Jerome; Lemhi; Lincoln; Minidoka; Twin Falls.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2192,USA - Idaho - SPCS - E,United States (USA) - Idaho east of approximately 113d West - counties of Bannock; Bear Lake; Bingham; Bonneville; Caribou; Clark; Franklin; Fremont; Jefferson; Madison; Oneida; Power; Teton.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2193,USA - Idaho - SPCS - W,United States (USA) - Idaho - west of approximately 115d West - counties of Ada; Adams; Benewah; Boise; Bonner; Boundary; Canyon; Clearwater; Elmore; Gem; Idaho; Kootenai; Latah; Lewis; Nez Perce; Owyhee; Payette; Shoshone; Valley; Washington.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2194,USA - Illinois - SPCS - E,United States (USA) - Illinois east of approximately 89d 05m West - counties of Boone; Champaign; Clark; Clay; Coles; Cook; Crawford; Cumberland; De Kalb; De Witt; Douglas; Du Page; Edgar; Edwards; Effingham; Fayette; Ford; Franklin; Gallatin; Grundy; Hamilton; Hardin; Iroquois; Jasper; Jefferson; Johnson; Kane; Kankakee; Kendall; La Salle; Lake; Lawrence; Livingston; Macon; Marion; Massac; McHenry; McLean; Moultrie; Piatt; Pope; Richland; Saline; Shelby; V [...]
+2195,USA - Illinois - SPCS - W,United States (USA) - Illinois west of approximately 89d 05m West - counties of Adams; Alexander; Bond; Brown; Bureau; Calhoun; Carroll; Cass; Christian; Clinton; Fulton; Greene; Hancock; Henderson; Henry; Jackson; Jersey; Jo Daviess; Knox; Lee; Logan; Macoupin; Madison; Marshall; Mason; McDonough; Menard; Mercer; Monroe; Montgomery; Morgan; Ogle; Peoria; Perry; Pike; Pulaski; Putnam; Randolph; Rock Island; Sangamon; Schuyler; Scott; St. Clair; Stark; Steph [...]
+2196,USA - Indiana - SPCS - E,United States (USA) - Indiana east of approximately 86d 25m West - counties of Adams; Allen; Bartholomew; Blackford; Brown; Cass; Clark; De Kalb; Dearborn; Decatur; Delaware; Elkhart; Fayette; Floyd; Franklin; Fulton; Grant; Hamilton; Hancock; Harrison; Henry; Howard; Huntington; Jackson; Jay; Jefferson; Jennings; Johnson; Kosciusko; Lagrange; Madison; Marion; Marshall; Miami; Noble; Ohio; Randolph; Ripley; Rush; Scott; Shelby; St. Joseph; Steuben; Switzerla [...]
+2197,USA - Indiana - SPCS - W,United States (USA) - Indiana west of approximately 86d 25m West - counties of Benton; Boone; Carroll; Clay; Clinton; Crawford; Daviess; Dubois; Fountain; Gibson; Greene; Hendricks; Jasper; Knox; La Porte; Lake; Lawrence; Martin; Monroe; Montgomery; Morgan; Newton; Orange; Owen; Parke; Perry; Pike; Porter; Posey; Pulaski; Putnam; Spencer; Starke; Sullivan; Tippecanoe; Vanderburgh; Vermillion; Vigo; Warren; Warrick; White.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2198,USA - Iowa - SPCS - N,United States (USA) - Iowa north of approximately 42deg North - counties of Allamakee; Benton; Black Hawk; Boone; Bremer; Buchanan; Buena Vista; Butler; Calhoun; Carroll; Cerro Gordo; Cherokee; Chickasaw; Clay; Clayton; Crawford; Delaware; Dickinson; Dubuque; Emmet; Fayette; Floyd; Franklin; Greene; Grundy; Hamilton; Hancock; Hardin; Howard; Humboldt; Ida; Jackson; Jones; Kossuth; Linn; Lyon; Marshall; Mitchell; Monona; O'Brien; Osceola; Palo Alto; Plymouth; Po [...]
+2199,USA - Iowa - SPCS - S,United States (USA) - Iowa south of approximately 42deg North - counties of Adair; Adams; Appanoose; Audubon; Cass; Cedar; Clarke; Clinton; Dallas; Davis; Decatur; Des Moines; Fremont; Guthrie; Harrison; Henry; Iowa; Jasper; Jefferson; Johnson; Keokuk; Lee; Louisa; Lucas; Madison; Mahaska; Marion; Mills; Monroe; Montgomery; Muscatine; Page; Polk; Pottawattamie; Poweshiek; Ringgold; Scott; Shelby; Taylor; Union; Van Buren; Wapello; Warren; Washington; Wayne.,,,, [...]
+2200,USA - Kansas - SPCS - N,United States (USA) - Kansas north of approximately 38d 45m North - counties of Atchison; Brown; Cheyenne; Clay; Cloud; Decatur; Dickinson; Doniphan; Douglas; Ellis; Ellsworth; Geary; Gove; Graham; Jackson; Jefferson; Jewell; Johnson; Leavenworth; Lincoln; Logan; Marshall; Mitchell; Morris; Nemaha; Norton; Osborne; Ottawa; Phillips; Pottawatomie; Rawlins; Republic; Riley; Rooks; Russell; Saline; Shawnee; Sheridan; Sherman; Smith; Thomas; Trego; Wabaunsee; Wal [...]
+2201,USA - Kansas - SPCS - S,United States (USA) - Kansas south of approximately 38d 45m North - counties of Allen; Anderson; Barber; Barton; Bourbon; Butler; Chase; Chautauqua; Cherokee; Clark; Coffey; Comanche; Cowley; Crawford; Edwards; Elk; Finney; Ford; Franklin; Grant; Gray; Greeley; Greenwood; Hamilton; Harper; Harvey; Haskell; Hodgeman; Kearny; Kingman; Kiowa; Labette; Lane; Linn; Lyon; Marion; McPherson; Meade; Miami; Montgomery; Morton; Neosho; Ness; Osage; Pawnee; Pratt; Reno; [...]
+2202,USA - Kentucky - SPCS - N,United States (USA) - Kentucky north of approximately 37d 55m North - counties of Anderson; Bath; Boone; Bourbon; Boyd; Bracken; Bullitt; Campbell; Carroll; Carter; Clark; Elliott; Fayette; Fleming; Franklin; Gallatin; Grant; Greenup; Harrison; Henry; Jefferson; Jessamine; Kenton; Lawrence; Lewis; Mason; Menifee; Montgomery; Morgan; Nicholas; Oldham; Owen; Pendleton; Robertson; Rowan; Scott; Shelby; Spencer; Trimble; Woodford.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2203,USA - Kentucky - SPCS - S,United States (USA) - Kentucky south of approximately 37d 55m North - counties of Adair; Allen; Ballard; Barren; Bell; Boyle; Breathitt; Breckinridge; Butler; Caldwell; Calloway; Carlisle; Casey; Christian; Clay; Clinton; Crittenden; Cumberland; Daviess; Edmonson; Estill; Floyd; Fulton; Garrard; Graves; Grayson; Green; Hancock; Hardin; Harlan; Hart; Henderson; Hickman; Hopkins; Jackson; Johnson; Knott; Knox; Larue; Laurel; Lee; Leslie; Letcher; Lincoln; Liv [...]
+2204,USA - Louisiana - SPCS - N,United States (USA) - Louisiana north of approximately 30d 55m North - counties of Avoyelles; Bienville; Bossier; Caddo; Caldwell; Catahoula; Claiborne; Concordia; De Soto; East Carroll; Franklin; Grant; Jackson; La Salle; Lincoln; Madison; Morehouse; Natchitoches; Ouachita; Rapides; Red River; Richland; Sabine; Tensas; Union; Vernon; Webster; West Carroll; Winn.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2205,USA - Louisiana - SPCS27 - S,United States (USA) - Louisiana south of approximately 30d 55m North - counties of Acadia; Allen; Ascension; Assumption; Beauregard; Calcasieu; Cameron; East Baton Rouge; East Feliciana; Evangeline; Iberia; Iberville; Jefferson; Jefferson Davis; Lafayette; LaFourche; Livingston; Orleans; Plaquemines; Pointe Coupee; St. Bernard; St. Charles; St. Helena; St. James; St. John the Baptist; St. Landry; St. Martin; St. Mary; St. Tammany; Tangipahoa; Terrebonne; [...]
+2206,USA - Maine - SPCS - E,United States (USA) - Maine east of approximately 69d 30m West - counties of Aroostook; Hancock; Knox; Penobscot; Piscataquis; Waldo; Washington.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2207,USA - Maine - SPCS - W,United States (USA) - Maine west of approximately 69d 30m West - counties of Androscoggin; Cumberland; Franklin; Kennebec; Lincoln; Oxford; Sagadahoc; Somerset; York.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2208,USA - Massachusetts - SPCS - islands,United States (USA) - Massachusetts offshore - counties of Dukes; Nantucket.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2209,USA - Massachusetts - SPCS - mainland,United States (USA) - Massachusetts onshore - counties of Barnstable; Berkshire; Bristol; Essex; Franklin; Hampden; Hampshire; Middlesex; Norfolk; Plymouth; Suffolk; Worcester.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2210,USA - Montana - SPCS27 - central,United States (USA) - Montana between approximately 47d 50m & 46d 40m North - counties of Cascade; Dawson; Fergus; Garfield; Judith Basin; Lake; Lewis and Clark; McCone; Meagher; Mineral; Missoula; Petroleum; Powell; Prairie; Richland; Sanders; Wibaux.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2211,USA - Montana - SPCS27 - N,United States (USA) - Montana north of approximately 47d 50m North - counties of Blaine; Chouteau; Daniels; Flathead; Glacier; Hill; Liberty; Lincoln; Phillips; Pondera; Roosevelt; Sheridan; Teton; Toole; Valley.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2212,USA - Montana - SPCS27 - S,United States (USA) - Montana south of approximately 46d 40m North - counties of Beaverhead; Big Horn; Broadwater; Carbon; Carter; Custer; Deer Lodge; Fallon; Gallatin; Golden Valley; Granite; Jefferson; Madison; Musselshell; Park; Powder River; Ravalli; Rosebud; Silver Bow; Stillwater; Sweet Grass; Treasure; Wheatland; Yellowstone.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2213,USA - Minnesota - SPCS - central,United States (USA) - Minnesota between approximately 47d 10m & 45d 30m North - counties of Aitkin; Becker; Benton; Carlton; Cass; Chisago; Clay; Crow Wing; Douglas; Grant; Hubbard; Isanti; Kanabec; Mille Lacs; Morrison; Otter Tail; Pine; Pope; Stearns; Stevens; Todd; Traverse; Wadena; Wilkin.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2214,USA - Minnesota - SPCS - N,United States (USA) - Minnesota north of approximately 47d 10m North - counties of Beltrami; Clearwater; Cook; Itasca; Kittson; Koochiching; Lake; Lake of the Woods; Mahnomen; Marshall; Norman; Pennington; Polk; Red Lake; Roseau; St. Louis.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2215,USA - Minnesota - SPCS - S,United States (USA) - Minnesota south of approximately 45d 30m North - counties of Anoka; Big Stone; Blue Earth; Brown; Carver; Chippewa; Cottonwood; Dakota; Dodge; Faribault; Fillmore; Freeborn; Goodhue; Hennepin; Houston; Jackson; Kandiyohi; Lac Qui Parle; Le Sueur; Lincoln; Lyon; Martin; McLeod; Meeker; Mower; Murray; Nicollet; Nobles; Olmsted; Pipestone; Ramsey; Redwood; Renville; Rice; Rock; Scott; Sherburne; Sibley; Steele; Swift; Wabasha; Waseca; Wa [...]
+2216,USA - Mississippi - SPCS - E,United States (USA) - Mississippi east of approximately 89d 40m West - counties of Alcorn; Attala; Benton; Calhoun; Chickasaw; Choctaw; Clarke; Clay; Covington; Forrest; George; Greene; Hancock; Harrison; Itawamba; Jackson; Jasper; Jones; Kemper; Lafayette; Lamar; Lauderdale; Leake; Lee; Lowndes; Marshall; Monroe; Neshoba; Newton; Noxubee; Oktibbeha; Pearl River; Perry; Pontotoc; Prentiss; Scott; Smith; Stone; Tippah; Tishomingo; Union; Wayne; Webster; W [...]
+2217,USA - Mississippi - SPCS - W,United States (USA) - Mississippi west of approximately 89d 40m West - counties of Adams; Amite; Bolivar; Carroll; Claiborne; Coahoma; Copiah; De Soto; Franklin; Grenada; Hinds; Holmes; Humphreys; Issaquena; Jefferson; Jefferson Davis; Lawrence; Leflore; Lincoln; Madison; Marion; Montgomery; Panola; Pike; Quitman; Rankin; Sharkey; Simpson; Sunflower; Tallahatchie; Tate; Tunica; Walthall; Warren; Washington; Wilkinson; Yalobusha; Yazoo.,,,,,EPSG,EPSG,2001 [...]
+2218,USA - Missouri - SPCS - central,United States (USA) - Missouri between approximately 91d 45m & 93d 35m West - counties of Adair; Audrain; Benton; Boone; Callaway; Camden; Carroll; Chariton; Christian; Cole; Cooper; Dallas; Douglas; Greene; Grundy; Hickory; Howard; Howell; Knox; Laclede; Linn; Livingston; Macon; Maries; Mercer; Miller; Moniteau; Monroe; Morgan; Osage; Ozark; Pettis; Phelps; Polk; Pulaski; Putnam; Randolph; Saline; Schuyler; Scotland; Shelby; Stone; Sullivan; Taney; T [...]
+2219,USA - Missouri - SPCS - E,United States (USA) - Missouri east of approximately 91d 45m West - counties of Bollinger; Butler; Cape Girardeau; Carter; Clark; Crawford; Dent; Dunklin; Franklin; Gasconade; Iron; Jefferson; Lewis; Lincoln; Madison; Marion; Mississippi; Montgomery; New Madrid; Oregon; Pemiscot; Perry; Pike; Ralls; Reynolds; Ripley; Scott; Shannon; St. Charles; St. Francois; St. Louis; Ste. Genevieve; Stoddard; Warren; Washington; Wayne.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2220,USA - Missouri - SPCS - W,United States (USA) - Missouri west of approximately 93d 35m West - counties of Andrew; Atchison; Barry; Barton; Bates; Buchanan; Caldwell; Cass; Cedar; Clay; Clinton; Dade; Daviess; De Kalb; Gentry; Harrison; Henry; Holt; Jackson; Jasper; Johnson; Lafayette; Lawrence; McDonald; Newton; Nodaway; Platte; Ray; St. Clair; Vernon; Worth.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2221,USA - Nebraska - SPCS27 - N,United States (USA) - Nebraska - counties of Antelope; Blaine; Box Butte; Boyd; Brown; Burt; Cedar; Cherry; Cuming; Dakota; Dawes; Dixon; Garfield; Grant; Holt; Hooker; Keya Paha; Knox; Loup; Madison; Pierce; Rock; Sheridan; Sioux; Stanton; Thomas; Thurston; Wayne; Wheeler.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2222,USA - Nebraska - SPCS27 - S,United States (USA) - Nebraska - counties of Adams; Arthur; Banner; Boone; Buffalo; Butler; Cass; Chase; Cheyenne; Clay; Colfax; Custer; Dawson; Deuel; Dodge; Douglas; Dundy; Fillmore; Franklin; Frontier; Furnas; Gage; Garden; Gosper; Greeley; Hall; Hamilton; Harlan; Hayes; Hitchcock; Howard; Jefferson; Johnson; Kearney; Keith; Kimball; Lancaster; Lincoln; Logan; McPherson; Merrick; Morrill; Nance; Nemaha; Nuckolls; Otoe; Pawnee; Perkins; Phelps; Platte;  [...]
+2223,USA - Nevada - SPCS - central,United States (USA) - Nevada between approximately 117d 15m and 116d West - counties of Lander; Nye.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2224,USA - Nevada - SPCS - E,United States (USA) - Nevada east of approximately 116d  West - counties of Clark; Elko; Eureka; Lincoln; White Pine.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2225,USA - Nevada - SPCS - W,United States (USA) - Nevada west of approximately 117d 15m West - counties of Churchill; Douglas; Esmeralda; Humboldt; Lyon; Mineral; Pershing; Storey; Washoe.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2226,Canada - Newfoundland - E of 54.5 deg W,Canada - Newfoundland - east of 54 deg 30 min West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+2227,Canada - Newfoundland - 57.5 to 54.5 deg W,Canada - Newfoundland and Labrador between 57 deg 30 min and 54 de 30 min West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+2228,USA - New Mexico - SPCS - E,United States (USA) - New Mexico east of approximately 105d West - counties of Chaves; Colfax; Curry; De Baca; Eddy; Guadalupe; Harding; Lea; Mora; Quay; Roosevelt; San Miguel; Union.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2229,USA - New Mexico - SPCS27 - central,United States (USA) - New Mexico between approximately 105d & 107d 15m West - counties of Bernalillo; Dona Ana; Lincoln; Los Alamos; Otero; Rio Arriba; Sandoval; Santa Fe; Socorro; Taos; Torrance.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2230,USA - New Mexico - SPCS27 - W,United States (USA) - New Mexico west of approximately 107d 15m West - counties of Catron; Cibola; Grant; Hidalgo; Luna; McKinley; San Juan; Sierra; Valencia.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2231,USA - New Mexico - SPCS83 - central,United States (USA) - New Mexico between approximately 105d & 107d 15m West - counties of Bernalillo; Dona Ana; Lincoln; Los Alamos; Otero; Rio Arriba; Sandoval; Santa Fe; Socorro; Taos; Torrance; Valencia.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2232,USA - New Mexico - SPCS83 - W,United States (USA) - New Mexico west of approximately 107d 15m West - counties of Catron; Cibola; Grant; Hidalgo; Luna; McKinley; San Juan; Sierra.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2233,USA - New York - SPCS - central,United States (USA) - New York between approximately 75d 15m & 77d 30m West - counties of Broome; Cayuga; Chemung; Chenango; Cortland; Jefferson; Lewis; Madison; Oneida; Onondaga; Ontario; Oswego; Schuyler; Seneca; Steuben; Tioga; Tompkins; Wayne; Yates.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2234,USA - New York - SPCS - E,United States (USA) - New York mainland east of approximately 75d 15m West - counties of Albany; Clinton; Columbia; Delaware; Dutchess; Essex; Franklin; Fulton; Greene; Hamilton; Herkimer; Montgomery; Orange; Otsego; Putnam; Rensselaer; Rockland; Saratoga; Schenectady; Schoharie; St. Lawrence; Sullivan; Ulster; Warren; Washington; Westchester.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2235,USA - New York - SPCS - Long island,United States (USA) - New York - counties of Bronx; Kings; Nassau; New York; Queens; Richmond; Suffolk.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2236,USA - New York - SPCS - W,United States (USA) - New York west of approximately 77d 30m West - counties of Allegany; Cattaraugus; Chautauqua; Erie; Genesee; Livingston; Monroe; Niagara; Orleans; Wyoming.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2237,USA - North Dakota - SPCS - N,United States (USA) - North Dakota north of approximately 47d 25m North - counties of Benson; Bottineau; Burke; Cavalier; Divide; Eddy; Foster; Grand Forks; Griggs; McHenry; McKenzie; McLean; Mountrial; Nelson; Pembina; Pierce; Ramsey; Renville; Rolette; Sheridan; Steele; Towner; Traill; Walsh; Ward; Wells; Williams.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2238,USA - North Dakota - SPCS - S,United States (USA) - North Dakota south of approximately 47d 25m North - counties of Adams; Barnes; Billings; Bowman; Burleigh; Cass; Dickey; Dunn; Emmons; Golden Valley; Grant; Hettinger; Kidder; La Moure; Logan; McIntosh; Mercer; Morton; Oliver; Ransom; Richland; Sargent; Sioux; Slope; Stark; Stutsman.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2239,USA - Ohio - SPCS - N,United States (USA) - Ohio north of approximately 40d 15m North - counties of Allen;Ashland; Ashtabula; Auglaize; Carroll; Columbiana; Coshocton; Crawford; Cuyahoga; Defiance; Delaware; Erie; Fulton; Geauga; Hancock; Hardin; Harrison; Henry; Holmes; Huron; Jefferson; Knox; Lake; Logan; Lorain; Lucas; Mahoning; Marion; Medina; Mercer; Morrow; Ottawa; Paulding; Portage; Putnam; Richland; Sandusky; Seneca; Shelby; Stark; Summit; Trumbull; Tuscarawas; Union; Van We [...]
+2240,USA - Ohio - SPCS - S,United States (USA) - Ohio south of approximately 40d 15m North - counties of Adams; Athens; Belmont; Brown; Butler; Champaign; Clark; Clermont; Clinton; Darke; Fairfield; Fayette; Franklin; Gallia; Greene; Guernsey; Hamilton; Highland; Hocking; Jackson; Lawrence; Licking; Madison; Meigs; Miami; Monroe; Montgomery; Morgan; Muskingum; Noble; Perry; Pickaway; Pike; Preble; Ross; Scioto; Vinton; Warren; Washington.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2241,USA - Oklahoma - SPCS - N,United States (USA) - Oklahoma north of approximately 35d 20m North - counties of Adair; Alfalfa; Beaver; Blaine; Canadian; Cherokee; Cimarron; Craig; Creek; Custer; Delaware; Dewey; Ellis; Garfield; Grant; Harper; Kay; Kingfisher; Lincoln; Logan; Major; Mayes; Muskogee; Noble; Nowata; Okfuskee; Oklahoma; Okmulgee; Osage; Ottawa; Pawnee; Payne; Roger Mills; Rogers; Sequoyah; Texas; Tulsa; Wagoner; Washington; Woods; Woodward.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2242,USA - Oklahoma - SPCS - S,United States (USA) - Oklahoma south of approximately 35d 20m North - counties of Atoka; Beckham; Bryan; Caddo; Carter; Choctaw; Cleveland; Coal; Comanche; Cotton; Garvin; Grady; Greer; Harmon; Haskell; Hughes; Jackson; Jefferson; Johnston; Kiowa; Latimer; Le Flore; Love; Marshall; McClain; McCurtain; McIntosh; Murray; Pittsburg; Pontotoc; Pottawatomie; Pushmataha; Seminole; Stephens; Tillman; Washita.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2243,USA - Oregon - SPCS - N,United States (USA) - Oregon north of approximately 44d 15m North - counties of Baker; Benton; Clackamas; Clatsop; Columbia; Gilliam; Grant; Hood River; Jefferson; Lincoln; Linn; Marion; Morrow; Multnomah; Polk; Sherman; Tillamook; Umatilla; Union; Wallowa; Wasco; Washington; Wheeler; Yamhill.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2244,USA - Oregon - SPCS - S,United States (USA) - Oregon south of approximately 44d 15m North - counties of Coos; Crook; Curry; Deschutes; Douglas; Harney; Jackson; Josephine; Klamath; Lake; Lane; Malheur.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2245,USA - Pennsylvania - SPCS - N,United States (USA) - Pennsylvania north of approximately 40d 50m North - counties of Bradford; Cameron; Carbon; Centre; Clarion; Clearfield; Clinton; Columbia; Crawford; Elk; Erie; Forest; Jefferson; Lackawanna; Luzerne; Lycoming; McKean; Mercer; Monroe; Montour; Northumberland; Pike; Potter; Sullivan; Susquehanna; Tioga; Union; Venango; Warren; Wayne; Wyoming.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2246,USA - Pennsylvania - SPCS - S,United States (USA) - Pennsylvania south of approximately 40d 50m North - counties of Adams; Allegheny; Armstrong; Beaver; Bedford; Berks; Blair; Bucks; Butler; Cambria; Chester; Cumberland; Dauphin; Delaware; Fayette; Franklin; Fulton; Greene; Huntingdon; Indiana; Juniata; Lancaster; Lawrence; Lebanon; Lehigh; Mifflin; Montgomery; Northampton; Perry; Philadelphia; Schuylkill; Snyder; Somerset; Washington; Westmoreland; York.,,,,,EPSG,EPSG,2001-11-06 00 [...]
+2247,USA - South Carolina  - SPCS27 - N,United States (USA) - South Carolina - counties of Abbeville; Anderson; Calhoun; Cherokee; Chester; Chesterfield; Darlington; Dillon; Edgefield; Fairfield; Florence; Greenville; Greenwood; Horry; Kershaw; Lancaster; Laurens; Lee; Lexington; Marion; Marlboro; McCormick; Newberry; Oconee; Pickens; Richland; Saluda; Spartanburg; Sumter; Union; York.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2248,USA - South Carolina  - SPCS27 - S,United States (USA) - South Carolina - counties of Aiken; Allendale; Bamberg; Barnwell; Beaufort; Berkeley; Charleston; Clarendon; Colleton; Dorchester; Georgetown; Hampton; Jasper; Orangeburg; Williamsburg.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2249,USA - South Dakota - SPCS - N,United States (USA) - South Dakota north of approximately 44d 20m North - counties of Beadle; Brookings; Brown; Butte; Campbell; Clark; Codington; Corson; Day; Deuel; Dewey; Edmunds; Faulk; Grant; Hamlin; Hand; Harding; Hyde; Kingsbury; Lawrence; Marshall; McPherson; Meade; Perkins; Potter; Roberts; Spink; Sully; Walworth; Ziebach.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2250,USA - South Dakota - SPCS - S,United States (USA) - South Dakota south of approximately 44d 20m North - counties of Aurora; Bennett; Bon Homme; Brule; Buffalo; Charles Mix; Clay; Custer; Davison; Douglas; Fall River; Gregory; Haakon; Hanson; Hughes; Hutchinson; Jackson; Jerauld; Jones; Lake; Lincoln; Lyman; McCook; Mellette; Miner; Minnehaha; Moody; Pennington; Sanborn; Shannon; Stanley; Todd; Tripp; Turner; Union; Yankton.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2251,Caribbean - Puerto Rico and the US Virgin Islands,Puerto Rico and Virgin Islands (US).,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2252,USA - Texas - SPCS - central,United States (USA) - Texas between approximately 32deg & 30d 10m North - counties of Anderson; Angelina; Bastrop; Bell; Blanco; Bosque; Brazos; Brown; Burleson; Burnet; Cherokee; Coke; Coleman; Comanche; Concho; Coryell; Crane; Crockett; Culberson; Ector; El Paso; Falls; Freestone; Gillespie; Glasscock; Grimes; Hamilton; Hardin; Houston; Hudspeth; Irion; Jasper; Jeff Davis; Kimble; Lampasas; Lee; Leon; Liberty; Limestone; Llano; Loving; Madison; Mason;  [...]
+2253,USA - Texas - SPCS - N,United States (USA) - Texas north of approximately 34d 20m North - counties of: Armstrong; Briscoe; Carson; Castro; Childress; Collingsworth; Dallam; Deaf Smith; Donley; Gray; Hall; Hansford; Hartley; Hemphill; Hutchinson; Lipscomb; Moore; Ochiltree; Oldham; Parmer; Potter; Randall; Roberts; Sherman; Swisher; Wheeler.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2254,USA - Texas - SPCS - N central,United States (USA) - Texas between approximately 34d 20m & 32deg North - counties of: Andrews; Archer; Bailey; Baylor; Borden; Bowie; Callahan; Camp; Cass; Clay; Cochran; Collin; Cooke; Cottle; Crosby; Dallas; Dawson; Delta; Denton; Dickens; Eastland; Ellis; Erath; Fannin; Fisher; Floyd; Foard; Franklin; Gaines; Garza; Grayson; Gregg; Hale; Hardeman; Harrison; Haskell; Henderson; Hill; Hockley; Hood; Hopkins; Howard; Hunt; Jack; Johnson; Jones; Kaufma [...]
+2255,USA - Texas - SPCS27 - S,United States (USA) - Texas south of approximately 28d 05m North - counties of Brooks; Cameron; Duval; Hidalgo; Jim Hogg; Jim Wells; Kenedy; Kleberg; Nueces; San Patricio; Starr; Webb; Willacy; Zapata.  Gulf of Mexico outer continental shelf (GoM OCS) protraction areas: South Padre Island; North Padre Island; Mustang Island.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2256,USA - Texas - SPCS27 - S central,United States (USA) - Texas between approximately 30d 10m & 28d 05m North - counties of Aransas; Atascosa; Austin; Bandera; Bee; Bexar; Brazoria; Brewster; Caldwell; Calhoun; Chambers; Colorado; Comal; De Witt; Dimmit; Edwards; Fayette; Fort Bend; Frio; Galveston; Goliad; Gonzales; Guadalupe; Harris; Hays; Jackson; Jefferson; Karnes; Kendall; Kerr; Kinney; La Salle; Lavaca; Live Oak; Matagorda; Maverick; McMullen; Medina; Presidio; Real; Refugio; Ter [...]
+2257,USA - Utah - SPCS - central,United States (USA) - Utah between approximately 40d 50m & 38d 30m North - counties of Carbon; Duchesne; Emery; Grand; Juab; Millard; Salt Lake; Sanpete; Sevier; Tooele; Uintah; Utah; Wasatch.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2258,USA - Utah - SPCS - N,United States (USA) - Utah north of approximately 40d 50m North - counties of Box Elder; Cache; Daggett; Davis; Morgan; Rich; Summit; Weber.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2259,USA - Utah - SPCS - S,United States (USA) - Utah south of approximately 38d 30m North - counties of Beaver; Garfield; Iron; Kane; Piute; San Juan; Washington; Wayne.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2260,USA - Virginia - SPCS - N,United States (USA) - Virginia north of approximately 38d 05m North - counties of Arlington; Augusta; Bath; Caroline; Clarke; Culpeper; Fairfax; Fauquier; Frederick; Greene; Highland; King George; Loudoun; Madison; Orange; Page; Prince William; Rappahannock; Rockingham; Shenandoah; Spotsylvania; Stafford; Warren; Westmoreland.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2261,USA - Virginia - SPCS - S,United States (USA) - Virginia south of approximately 38d 05m North - counties of Accomack; Albemarle; Alleghany; Amelia; Amherst; Appomattox; Bedford; Bland; Botetourt; Bristol; Brunswick; Buchanan; Buckingham; Campbell; Carroll; Charles City; Charlotte; Chesapeake; Chesterfield; Colonial Heights; Craig; Cumberland; Dickenson; Dinwiddie; Essex; Floyd; Fluvanna; Franklin; Giles; Gloucester; Goochland; Grayson; Greensville; Halifax; Hampton; Hanover; Henrico [...]
+2262,USA - Washington - SPCS27 - N,United States (USA) - Washington north of approximately 47d 30m North - counties of Chelan; Clallam; Douglas; Ferry; Island; Jefferson; King; Kitsap; Lincoln; Okanogan; Pend Oreille; San Juan; Skagit; Snohomish; Spokane; Stevens; Whatcom.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2263,USA - Washington - SPCS27 - S,United States (USA) - Washington south of approximately 47d 30m North - counties of Adams; Asotin; Benton; Clark; Columbia; Cowlitz; Franklin; Garfield; Grant; Grays Harbor; Kittitas; Klickitat; Lewis; Mason; Pacific; Pierce; Skamania; Thurston; Wahkiakum; Walla Walla; Whitman; Yakima.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2264,USA - West Virginia - SPCS - N,United States (USA) - West Virginia north of approximately 39deg North - counties of Barbour; Berkeley; Brooke; Doddridge; Grant; Hampshire; Hancock; Hardy; Harrison; Jefferson; Marion; Marshall; Mineral; Monongalia; Morgan; Ohio; Pleasants; Preston; Ritchie; Taylor; Tucker; Tyler; Wetzel; Wirt; Wood.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2265,USA - West Virginia - SPCS - S,United States (USA) - West Virginia south of approximately 39deg North - counties of Boone; Braxton; Cabell; Calhoun; Clay; Fayette; Gilmer; Greenbrier; Jackson; Kanawha; Lewis; Lincoln; Logan; Mason; McDowell; Mercer; Mingo; Monroe; Nicholas; Pendleton; Pocahontas; Putnam; Raleigh; Randolph; Roane; Summers; Upshur; Wayne; Webster; Wyoming.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2266,USA - Wisconsin - SPCS - central,United States (USA) - Wisconsin between approximately 45d 35m & 44d 15m North - counties of Barron; Brown; Buffalo; Chippewa; Clark; Door; Dunn; Eau Claire; Jackson; Kewaunee; Langlade; Lincoln; Marathon; Marinette; Menominee; Oconto; Outagamie; Pepin; Pierce; Polk; Portage; Rusk; Shawano; St. Croix; Taylor; Trempealeau; Waupaca; Wood.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2267,USA - Wisconsin - SPCS - N,United States (USA) - Wisconsin north of approximately 45d 35m North - counties of Ashland; Bayfield; Burnett; Douglas; Florence; Forest; Iron; Oneida; Price; Sawyer; Vilas; Washburn.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2268,USA - Wisconsin - SPCS - S,United States (USA) - Wisconsin south of approximately 44d 15m North - counties of Adams; Calumet; Columbia; Crawford; Dane; Dodge; Fond Du Lac; Grant; Green; Green Lake; Iowa; Jefferson; Juneau; Kenosha; La Crosse; Lafayette; Manitowoc; Marquette; Milwaukee; Monroe; Ozaukee; Racine; Richland; Rock; Sauk; Sheboygan; Vernon; Walworth; Washington; Waukesha; Waushara; Winnebago.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2269,USA - Wyoming - SPCS - E,United States (USA) - Wyoming east of approximately 106d West - counties of Albany; Campbell; Converse; Crook; Goshen; Laramie; Niobrara; Platte; Weston.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2270,USA - Wyoming - SPCS - E central,United States (USA) - Wyoming between approximately 106d & 108d 10m West - counties of Big Horn; Carbon; Johnson; Natrona; Sheridan; Washakie.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2271,USA - Wyoming - SPCS - W,United States (USA) - Wyoming west of approximately 109d 40m West - counties of Lincoln; Sublette; Teton; Uinta.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2272,USA - Wyoming - SPCS - W central,United States (USA) - Wyoming between approximately 108d 10m & 109d 40m West - counties of Fremont; Hot Springs; Park; Sweetwater.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2273,USA - Washington - SPCS83 - N,United States (USA) - Washington north of approximately 47d 30m North - counties of Chelan; Clallam; Douglas; Ferry; Grant north of approximately 47d30m; Island; Jefferson; King; Kitsap; Lincoln; Okanogan; Pend Oreille; San Juan; Skagit; Snohomish; Spokane; Stevens; Whatcom.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2274,USA - Washington - SPCS83 - S,United States (USA) - Washington south of approximately 47d 30m North - counties of Adams; Asotin; Benton; Clark; Columbia; Cowlitz; Franklin; Garfield; Grant south of approximately 47d30m; Grays Harbor; Kittitas; Klickitat; Lewis; Mason; Pacific; Pierce; Skamania; Thurston; Wahkiakum; Walla Walla; Whitman; Yakima.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2275,Canada - Newfoundland - 60.5 to 57.5 deg W,Canada - Newfoundland and Labrador between 60 deg and 57 deg 30 min West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+2276,Canada - Quebec and Newfoundland - 63 to 60 deg W,Canada - Quebec and Newfoundland (Labrador) between 63 deg and 60 deg West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+2277,Canada - Quebec and Newfoundland - 66 to 63 deg W,Canada - Quebec and Newfoundland (Labrador) between 66 deg and 63 deg West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+2278,Canada - Quebec and Newfoundland - 69 to 66 deg W,Canada - Quebec and Newfoundland (Labrador) between 69 deg and  66 deg West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+2279,Canada - Quebec and Ontario - 75 to 72 deg W,Canada - Quebec between 75 deg and 72 deg West.; Canada - Ontario - east of 75 deg West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+2280,Canada - Quebec and Ontario - 78 to 75 deg W,Canada - Quebec and Ontario - between 78 deg and 75 deg West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+2281,Canada - Quebec and Ontario - MTM zone 10,Canada - Quebec west of 78 deg West; Canada - Ontario - between 79 deg 30 min and 78 deg W in area to north of 47 deg N; between 80 deg 15 min and 78 deg W in area between 46 deg and 47 deg N; between 81 deg and 78 deg W in area south of 46 deg N.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+2282,Cote d'Ivoire (Ivory Coast) - Abidjan area,C�te d'Ivoire (Ivory Coast) - Abidjan area.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+2283,Australia - Australian Capital Territory (ACT),Australia - Australian Capital Territory (ACT).,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2284,Australia - Northern Territory (NT),Australia - Northern Territory (NT).,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2285,Australia - Victoria,Australia - Victoria.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2286,Australia - New South Wales (NSW and Victoria,Australia - New South Wales (NSW) and Victoria.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2287,Australia - SE Australia (ACT NSW VIC),"Australia - Australian Capital Territory (ACT), New South Wales (NSW), Victoria.",,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2288,American Samoa - Tutuila and Aunu'u islands,American Samoa - Tutuila and Aunu'u islands.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2289,"American Samoa - Ofu, Olesega and Ta'u islands","American Samoa - Ofu, Olesega and Ta'u islands.",,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2290,Canada - Quebec and Newfoundland - MTM zone 3,Canada - Newfoundland and Labrador between 60 deg and 57 deg 30 min West; Canada - Quebec between 60 deg and 57 deg West.,,,,,EPSG,EPSG,1997-11-13 00:00:00,,0
+2291,Australasia - Australia and PNG - 150 to 156 deg E,Australia - between 150 and 156 deg East.  Papua New Guinea east of 150 deg East.,,,,,EPSG,EPSG,1995-12-02 00:00:00,,0
+2292,Myanmar (Burma) - 15 to 21 deg N,Myanmar (Burma) - between 15 and 21 deg North.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+2293,Myanmar (Burma) - S of 15 deg N,Myanmar (Burma) - south of 15 deg North.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+2294,Asia - Middle East - Iraq zone,Islamic Republic of Iran - south of 36 deg North. Iraq. Kuwait.,,,,,EPSG,EPSG,1996-04-12 00:00:00,,0
+2295,Caribbean - Windward and Leeward Islands,Windward Islands - Dominica  Grenada  Saint Lucia  Saint Vincent;  Leeward Islands - Anguilla   Antigua (excluding Barbuda)  Montserrat   Saint Kitts and Nevis; Barbados.,,,,,EPSG,EPSG,1999-04-22 00:00:00,,0
+2296,Cote d'Ivoire (Ivory Coast) - offshore.,C�te d'Ivoire (Ivory Coast) - offshore.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2297,USA - California - N of 38 deg N,United States (USA) - California north of 38 deg North.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2298,USA - California - S of 38 deg N,United States (USA) - California south of 38 deg North,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2299,3-degree TM - N hemisphere CM 3 deg E,"Between 1 deg 30 min and 4 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2300,3-degree TM - N hemisphere CM 6 deg E,"Between 4 deg 30 min and 7 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2301,3-degree TM - N hemisphere CM 9 deg E,"Between 7 deg 30 min and 10 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2302,3-degree TM - N hemisphere CM 12 deg E,"Between 10 deg 30 min and 13 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2303,3-degree TM - N hemisphere CM 15 deg E,"Between 13 deg 30 min and 16 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2304,3-degree TM - N hemisphere CM 18 deg E,"Between 16 deg 30 min and 19 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2305,3-degree TM - N hemisphere CM 21 deg E,"Between 19 deg 30 min and 22 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2306,3-degree TM - N hemisphere CM 24 deg E,"Between 22 deg 30 min and 25 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2307,Brazil - Campos; Espirito Santo and Santos basins,Brazil - Campos; Espirito Santo and Santos basins.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2308,Brazil - Tucano basin north,Brazil - Tucano basin north.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2309,Brazil - Tucano basin central,Brazil - Tucano basin central.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2310,Brazil - Tucano basin south,Brazil - Tucano basin south.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2311,Africa - Kenya and Tanzania,Kenya; Tanzania.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2312,"Africa - Botswana, Lesotho, Malawi, Swaziland, Zaire, Zambia, Zimbabwe",Botswana; Lesotho; Malawi; Swaziland; Zaire; Zambia; Zimbabwe.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2313,Canada - Nova Scotia,Canada - Nova Scotia.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2314,Asia - Caspian FSU states,Azerbaijan; Kazakstan; Russian Federation; Turkmenistan - Caspian Sea,,,,,EPSG,EPSG,1999-09-07 00:00:00,,0
+2315,Colombia - Cusiana,Colombia - Casanare province BP Cusiana/Cupiagua field areas.  Also used by Total in Rivera and Gatanas blocks.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2316,Angola - offshore block 5,Angola - offshore block 5.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+2317,Angola - offshore block 2,Angola - offshore block 2.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+2318,Angola - offshore block 3,Angola - offshore block 3.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+2319,Angola - offshore block 7,Angola - offshore block 7.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+2320,Angola - offshore blocks 7 8 24 + WGC spec,Angola - offshore blocks 7 and 8.  Also used rounded to integer metre in offshore block 24 and for GSI/HGS/Western Geophysical speculative seismic data throughout offshore Angola.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2321,Angola - offshore blocks 1 and 16,Angola - offshore blocks 1 and 16.,,,,,EPSG,EPSG,1998-12-14 00:00:00,,0
+2322,Angola - offshore blocks 3  7  15 and 17.,"Angola - offshore blocks 3, 7,15 and 17.",,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+2323,Angola - offshore blocks 1 16 and 18.,"Angola - offshore blocks 1, 16 and 18.",,,,,EPSG,EPSG,1998-12-14 00:00:00,,0
+2324,Angola - offshore blocks 2  3 17 and 31-33.,"Angola - offshore blocks 2,  3, 17 and 31-33.",,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+2325,Argentina - Neuquen province Chos Malal area,Argentina - Neuquen province - Chos Malal area.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2326,Germany - former west Germany,Germany - former west Germany.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2327,Syria - Al Whaleed area,Syrian Arab Republic - Al Whaleed area,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2328,Syria - Shaddadeh area,Syrian Arab Republic - Shaddadeh area (36d N 41d E),,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2329,Syria - Deir area,Syrian Arab Republic - Deir area (35d 22m N 40d 06m E),,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2330,Europe - North Sea,Denmark - North Sea;  Germany - North Sea;  Netherlands - offshore;  Norway - North Sea south of 62 deg N; United Kingdom (UKCS) - North Sea south of 62 deg N.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2331,Norway - offshore N of 65 deg N,Norway - offshore north of 65 deg North.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2332,Norway - offshore N of 65 deg N;  Svalbard; Jan Mayen,Norway - offshore north of 65 deg N;  Svalbard and Jan Mayen Islands.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2333,Norway - offshore 62 to 65 deg N and W of 5 deg E,Norway - offshore between 62 and 65 deg North and west of 5 deg East.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2334,Norway - North Sea - offshore S of 62 deg N.,Norway - North Sea - offshore south of 62 deg North.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2335,Spain - Balearic Islands,Spain - Balearic Islands.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2336,Spain - mainland except northwest,Spain - mainland except northwest (north of 41 deg 30m N and west of 4 deg 30 min W).,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2337,Spain - northwest,Spain - northwest (north of 41 deg 30m N and west of 4 deg 30 min W).,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2338,Europe - Portugal and Spain,Portugal; Spain.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2339,Italy - Sardinia,Italy - Sardinia.,,,,,EPSG,EPSG,1997-04-11 00:00:00,,0
+2340,Italy - Sicily,Italy - Sicily.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2341,Egypt - Gulf of Suez,Egypt - Gulf of Suez.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2342,Europe - common offshore,Denmark - offshore. United Kingdom - UKCS offshore east of 6 deg West.,,,,,EPSG,EPSG,1998-06-30 00:00:00,,0
+2343,Europe - British Isles,Ireland; United Kingdom (UK).,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2344,Europe - Finland and Norway,Finland; Norway.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2345,Asia - Middle East - Iraq; Israel; Jordan; Lebanon; Kuwait; Saudi Arabia; Syria.,Iraq; Israel; Jordan; Lebanon; Kuwait; Saudi Arabia; Syria.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2346,WGS72BE to WGS84,World.  Vietnam - offshore.,,,,,EPSG,EPSG,1996-12-12 00:00:00,,0
+2347,Algeria - N of 31.5 deg North,Algeria - north of 35g (31 deg 30 min) North.,,,,,EPSG,EPSG,1998-03-12 00:00:00,,0
+2348,Brunei - offshore,Brunei Darussalam - offshore.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2349,Brunei - onshore,Brunei Darussalam - onshore.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2350,Mozambique - A,Mozambique - Maputo province and southern part of Gaza province; i.e. south of approximately 24 deg S.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2351,Mozambique - B,Mozambique - provinces of Gaza; Inhambane and southern parts of Sofala and Manhica; i.e. between approximately 24 and 20 deg South.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2352,Mozambique - C,Mozambique - provinces of Sofala north of Beira corridor; Manhica; Tete and Zambezia; i.e. between approximately 20 and 16 deg South.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2353,Mozambique - D,Mozambique - provinces of Nampula; Niassa; Cabo Delgado; i.e. north of approximately 16 deg S.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2354,Indonesia - Kalimantan,Indonesia - Kalimantan.,,,,,EPSG,EPSG,1998-03-12 00:00:00,,0
+2355,Falkland Islands - East Falkland Island,Falkland Islands (Malvinas) - East Falkland Island.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2356,Ecuador - Galapagos,Ecuador - Baltra; Galapagos.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2357,Argentina - Tierra del Fuego,Argentina - Tierra del Fuego,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2358,Thailand - Bongkot field,Thailand - Bongkot field.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2359,Vietnam - near 16 deg N,Vietnam - near 16 deg North.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2360,Vietnam - Con Son Island,Vietnam - Con Son Island.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2361,Myanmar (Burma) - Moattama area,Myanmar (Burma) - Moattama area.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2362,Iran - Kangan district,Islamic Republic of Iran - Kangan district.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+2363,Venezuela - east,Venezuela - east - Delta Amacuro; Anzoategui; Bolivar; Monagas; Sucre states.,,,,,EPSG,EPSG,1999-11-05 00:00:00,,0
+2364,Philippines - excluding Mindanao,Philippines (excluding Mindanao).,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2365,Philippines - Mindanao,Philippines - Mindanao.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2366,Spain - mainland,Spain - mainland.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2367,Spain - mainland NE,Spain - mainland north of the parallel of 42 deg N from the Atlantic Ocean to 42 deg N  4 deg W of Greenwich and then a line from 42 deg N  4 deg W of Greenwich through 40 deg N 0 deg E of Greenwich.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2368,Spain - mainland SW,Spain - mainland south of the parallel of 42 deg N from the Atlantic Ocean to 42 deg N  4 deg W of Greenwich and then a line from 42 deg N  4 deg W of Greenwich through 40 deg N 0 deg E of Greenwich.,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2369,Seychelles - Mahe Island,Seychelles - Mahe Island.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2370,Europe - Boznia and Herzegovina; Croatia; Serbia; Slovenia.,Boznia and Herzegovina; Croatia; Serbia; Slovenia.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2371,Nigeria - south,Nigeria - south.,,,,,EPSG,EPSG,2001-08-28 00:00:00,,0
+2372,Italy - mainland,Italy - mainland.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2373,USA - Alaska including EEZ.,United States (USA) - Alaska including EEZ.,,,,,EPSG,EPSG,2001-08-28 00:00:00,,0
+2374,USA - conus including EEZ.,United States (USA) - lower 48 states including EEZ - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; Sout [...]
+2375,Canada - Saskatchewan,Canada - Saskatchewan.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2376,Canada - Alberta,Canada - Alberta,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2377,USA - Delaware and Maryland,United States (USA) - Delaware and Maryland.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2378,"USA - New England - south (CT, MA, NH, RI, VT)",United States (USA) - Connecticut; Massachusetts; New Hampshire; Rhode Island; Vermont.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2379,USA - Texas E of 100 deg W,United States (USA) - Texas east of 100 deg West.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2380,USA - Texas W of 100 deg W,United States (USA) - Texas west of 100 deg West.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2381,USA - Oregon and Washington.,United States (USA) - Oregon and Washington.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2382,USA - Idaho and Montana - E of 113 deg W,United States (USA) - Idaho and Montana - east of 113 deg West.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2383,USA - Idaho and Montana - W of 113 deg W,United States (USA) - Idaho and Montana - west of 113 deg West.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2384,Canada - Alberta and British Columbia.,Canada - Alberta; British Columbia.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2385,Panama - Canal Zone,Panama - Canal Zone.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2386,Greenland - Hayes Peninsula,Greenland - Hayes Peninsula.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2387,USA - Alaska - Aleutian Islands east of 180 deg,United States (USA) - Alaska - Aleutian Islands east of 180 deg.,,,,,EPSG,EPSG,1997-04-11 00:00:00,,0
+2388,USA - Alaska - Aleutian Islands west of 180 deg,United States (USA) - Alaska - Aleutian Islands west of 180 deg.,,,,,EPSG,EPSG,1997-04-11 00:00:00,,0
+2389,USA - conus east of Mississippi River,United States (USA) - CONUS east of Mississippi River including Louisiana; Missouri; Minnesota.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2390,USA - conus west of Mississippi River,United States (USA) - CONUS west of Mississippi River.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2391,Oman - Masirah Island,Oman - Masirah Island.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2392,UAE - Abu al Bu Khoosh,United Arab Emirates (UAE) - Abu Dhabi - Abu al Bu Khoosh,,,,,EPSG,EPSG,2000-03-07 00:00:00,,0
+2393,Algeria - Hassi Messaoud,Algeria - Hassi Messaoud.,,,,,EPSG,EPSG,2000-06-23 00:00:00,,0
+2394,UK - Great Britain and UKCS,United Kingdom (UKCS) - Great Britain (GB) - England; Scotland; Wales; - North Sea.,,,,,EPSG,EPSG,1998-11-11 00:00:00,,0
+2395,UK - England,United Kingdom (UK) - England.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2396,UK - England; Wales; Isle of Man,United Kingdom (UK) - England; Wales; Isle of Man.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2397,UK - Scotland,United Kingdom (UK) - Scotland (including Shetland Islands).,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2398,UK - Wales,United Kingdom (UK) - Wales.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2399,South America - Bolivia; Chile; Colombia;  Ecuador; Guyana; Peru; Venezuela.,Bolivia; Chile; Colombia;  Ecuador; Guyana; Peru; Venezuela.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2400,Bolivia - Madidi,Bolivia - Madidi.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2401,Bolivia - Block 20,Bolivia - Block 20.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2402,Chile - north,Chile - north (near 19 deg South).,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2403,Chile - south,Chile - south (near 43 deg South).,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2404,Oman - block 4,Oman - block 4.,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2405,Kazakstan - Caspian Sea,Kazakstan - Caspian Sea.,,,,,EPSG,EPSG,2000-02-02 00:00:00,,0
+2406,Qatar - offshore,Qatar - offshore.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2407,Greenland - south,Greenland (South).,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2408,Japan - Okinawa,Japan - Okinawa.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2409,Asia - Japan and South Korea,Japan; South Korea; Okinawa.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2410,Canada - NWT; Nunavut; Saskatchewan,Canada - Northwest Territories; Nunavut; Saskatchewan.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2411,Asia - India and Nepal,India; Nepal.,,,,,EPSG,EPSG,1999-10-20 00:00:00,,0
+2412,USA - Alaska excluding Aleutian Islands,United States (USA) - Alaska (Excluding Aleutian Islands).,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2413,Bahamas (Except San Salvador Island).,Bahamas (Except San Salvador Island).,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2414,Bahamas (San Salvador Island).,Bahamas (San Salvador Island).,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2415,Canada - Manitoba and Ontario,Canada - Manitoba; Ontario.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2416,Canada - New Brunswick; Newfoundland; Nova Scotia; Quebec,Canada - New Brunswick; Newfoundland; Nova Scotia; Quebec.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2417,Canada - Yukon,Canada - Yukon.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2418,Caribbean - central,Antigua; Barbados; Barbuda; Caicos Islands; Cuba; Dominican Republic; Grand Cayman; Jamaica; Turks and Caicos Islands.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2419,Central America -,Belize; Costa Rica; El Salvador; Guatemala; Honduras; Nicaragua.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2420,Europe - west,Austria; Belgium; Denmark; Faroe Islands; Finland; France; Germany (west); Gibraltar; Greece; Italy; Luxembourg; Netherlands; Norway; Portugal; Spain; Sweden; Switzerland.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,0
+2421,Europe - west central,Austria; Denmark; France; Germany (west); Netherlands; Switzerland.,,,,,EPSG,EPSG,1996-10-18 00:00:00,,0
+2424,USA - HARN,American Samoa; Puerto Rico and the Virgin Islands; United States (USA) - Alabama; Alaska; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Hawaii; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island;  [...]
+2425,Japan - 45d 20m to 46d N; 141d to 142d E.,Japan - 45deg 20min to 46deg North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2426,Japan - 45d 20m to 46d N; 142d to 143d E.,Japan - 45deg 20min to 46deg North; 142deg to 143deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2427,Japan - 44deg 40min to 45deg 20min N; 141deg to 142deg E.,Japan - 44deg 40min to 45deg 20min North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2428,Japan - 44deg 40min to 45deg 20min N; 142deg to 143deg E.,Japan - 44deg 40min to 45deg 20min North; 142deg to 143deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2429,Japan - 44deg to 44deg 40min N; 141deg to 142deg E.,Japan - 44deg to 44deg 40min North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2430,Japan - 44deg to 44deg 40min N; 142deg to 143deg E.,Japan - 44deg to 44deg 40min North; 142deg to 143deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2431,Japan - 44deg to 44deg 40min N; 143deg to 144deg E.,Japan - 44deg to 44deg 40min North; 143deg to 144deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2432,Japan - 44deg to 44deg 40min N; 144deg to 145deg E.,Japan - 44deg to 44deg 40min North; 144deg to 145deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2433,Japan - 43deg 20min to 44deg N; 141deg to 142deg E.,Japan - 43deg 20min to 44deg North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2434,Japan - 43deg 20min to 44deg N; 142deg to 143deg E.,Japan - 43deg 20min to 44deg North; 142deg to 143deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2435,Japan - 43deg 20min to 44deg N; 143deg to 144deg E.,Japan - 43deg 20min to 44deg North; 143deg to 144deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2436,Japan - 43deg 20min to 44deg N; 144deg to 145deg E.,Japan - 43deg 20min to 44deg North; 144deg to 145deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2437,Japan - 43deg 20min to 44deg N; 145deg to 146deg E.,Japan - 43deg 20min to 44deg North; 145deg to 146deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2438,Japan - 42deg 40min to 43deg 20min N; 140deg to 141deg E.,Japan - 42deg 40min to 43deg 20min North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2439,Japan - 42deg 40min to 43deg 20min N; 141deg to 142deg E.,Japan - 42deg 40min to 43deg 20min North; 141deg to 142deg East.,,,,,EPSG,EPSG,1999-11-12 00:00:00,,0
+2440,Japan - 42deg 40min to 43deg 20min N; 142deg to 143deg E.,Japan - 42deg 40min to 43deg 20min North; 142deg to 143deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2441,Japan - 42deg 40min to 43deg 20min N; 143deg to 144deg E.,Japan - 42deg 40min to 43deg 20min North; 143deg to 144deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2442,Japan - 42deg 40min to 43deg 20min N; 144deg to 145deg E.,Japan - 42deg 40min to 43deg 20min North; 144deg to 145deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2443,Japan - 42deg 40min to 43deg 20min N; 145deg to 146deg E.,Japan - 42deg 40min to 43deg 20min North; 145deg to 146deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2444,Japan - 42deg to 42deg 40min N; 139deg to 140deg E.,Japan - 42deg to 42deg 40min North; 139deg to 140deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2445,Japan - 42deg to 42deg 40min N; 140deg to 141deg E.,Japan - 42deg to 42deg 40min North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2446,Japan - 42deg to 42deg 40min N; 141deg to 142deg E.,Japan - 42deg to 42deg 40min North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2447,Japan - 42deg to 42deg 40min N; 142deg to 143deg E.,Japan - 42deg to 42deg 40min North; 142deg to 143deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2448,Japan - 42deg to 42deg 40min N; 143deg to 144deg E.,Japan - 42deg to 42deg 40min North; 143deg to 144deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2449,Japan - 41deg 20min to 42deg N; 140deg to 141deg E.,Japan - 41deg 20min to 42deg North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2450,Japan - 41deg 20min to 42deg N; 141deg to 142deg E.,Japan - 41deg 20min to 42deg North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2451,Japan - 40deg 40min to 41deg 20min N; 140deg to 141deg E.,Japan - 40deg 40min to 41deg 20min North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2452,Japan - 40deg 40min to 41deg 20min N; 141deg to 142deg E.,Japan - 40deg 40min to 41deg 20min North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2453,Japan - 40deg to 40deg 40min N; 139deg to 140deg E.,Japan - 40deg to 40deg 40min North; 139deg to 140deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2454,Japan - 40deg to 40deg 40min N; 140deg to 141deg E.,Japan - 40deg to 40deg 40min North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2455,Japan - 40deg to 40deg 40min N; 141deg to 142deg E.,Japan - 40deg to 40deg 40min North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2456,Japan - 39deg 20min to 40deg N; 139deg to 140deg E.,Japan - 39deg 20min to 40deg North; 139deg to 140deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2457,Japan - 39deg 20min to 40deg N; 140deg to 141deg E.,Japan - 39deg 20min to 40deg North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2458,Japan - 39deg 20min to 40deg N; 141deg to 142deg E.,Japan - 39deg 20min to 40deg North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2459,Japan - 38deg 40min to 39deg 20min N; 139deg to 140deg E.,Japan - 38deg 40min to 39deg 20min North; 139deg to 140deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2460,Japan - 38deg 40min to 39deg 20min N; 140deg to 141deg E.,Japan - 38deg 40min to 39deg 20min North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2461,Japan - 38deg 40min to 39deg 20min N; 141deg to 142deg E.,Japan - 38deg 40min to 39deg 20min North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2462,Japan - 38deg to 38deg 40min N; 139deg to 140deg E.,Japan - 38deg to 38deg 40min North; 139deg to 140deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2463,Japan - 38deg to 38deg 40min N; 140deg to 141deg E.,Japan - 38deg to 38deg 40min North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2464,Japan - 38deg to 38deg 40min N; 141deg to 142deg E.,Japan - 38deg to 38deg 40min North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2465,Japan - 37deg 20min to 38deg N; 136deg to 137deg E.,Japan - 37deg 20min to 38deg North; 136deg to 137deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2466,Japan - 37deg 20min to 38deg N; 137deg to 138deg E.,Japan - 37deg 20min to 38deg North; 137deg to 138deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2467,Japan - 37deg 20min to 38deg N; 138deg to 139deg E.,Japan - 37deg 20min to 38deg North; 138deg to 139deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2468,Japan - 37deg 20min to 38deg N; 139deg to 140deg E.,Japan - 37deg 20min to 38deg North; 139deg to 140deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2469,Japan - 37deg 20min to 38deg N; 140deg to 141deg E.,Japan - 37deg 20min to 38deg North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2470,Japan - 37deg 20min to 38deg N; 141deg to 142deg E.,Japan - 37deg 20min to 38deg North; 141deg to 142deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2471,Japan - 36deg 40min to 37deg 20min N; 136deg to 137deg E.,Japan - 36deg 40min to 37deg 20min North; 136deg to 137deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2472,Japan - 36deg 40min to 37deg 20min N; 137deg to 138deg E.,Japan - 36deg 40min to 37deg 20min North; 137deg to 138deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2473,Japan - 36deg 40min to 37deg 20min N; 138deg to 139deg E.,Japan - 36deg 40min to 37deg 20min North; 138deg to 139deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2474,Japan - 36deg 40min to 37deg 20min N; 139deg to 140deg E.,Japan - 36deg 40min to 37deg 20min North; 139deg to 140deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2475,Japan - 36deg 40min to 37deg 20min N; 140deg to 141deg E.,Japan - 36deg 40min to 37deg 20min North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2476,Japan - 36deg to 37deg 40min N; 136deg to 137deg E.,Japan - 36deg to 36deg 40min North; 136deg to 137deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2477,Japan - 36deg to 37deg 40min N; 137deg to 138deg E.,Japan - 36deg to 36deg 40min North; 137deg to 138deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2478,Japan - 36deg to 37deg 40min N; 138deg to 139deg E.,Japan - 36deg to 36deg 40min North; 138deg to 139deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2479,Japan - 36deg to 37deg 40min N; 139deg to 140deg E.,Japan - 36deg to 36deg 40min North; 139deg to 140deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2480,Japan - 36deg to 37deg 40min N; 140deg to 141deg E.,Japan - 36deg to 36deg 40min North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2481,Japan - 35deg 20min to 36deg N; 132deg to 133deg E.,Japan - 35deg 20min to 36deg North; 132deg to 133deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2482,Japan - 35deg 20min to 36deg N; 133deg to 134deg E.,Japan - 35deg 20min to 36deg North; 133deg to 134deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2483,Japan - 35deg 20min to 36deg N; 134deg to 135deg E.,Japan - 35deg 20min to 36deg North; 134deg to 135deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2484,Japan - 35deg 20min to 36deg N; 135deg to 136deg E.,Japan - 35deg 20min to 36deg North; 135deg to 136deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2485,Japan - 35deg 20min to 36deg N; 136deg to 137deg E.,Japan - 35deg 20min to 36deg North; 136deg to 137deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2486,Japan - 35deg 20min to 36deg N; 137deg to 138deg E.,Japan - 35deg 20min to 36deg North; 137deg to 138deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2487,Japan - 35deg 20min to 36deg N; 138deg to 139deg E.,Japan - 35deg 20min to 36deg North; 138deg to 139deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2488,Japan - 35deg 20min to 36deg N; 139deg to 140deg E.,Japan - 35deg 20min to 36deg North; 139deg to 140deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2489,Japan - 35deg 20min to 36deg N; 140deg to 141deg E.,Japan - 35deg 20min to 36deg North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2490,Japan - 34deg 40min to 35deg 20min N; 132deg to 133deg E.,Japan - 34deg 40min to 35deg 20min North; 132deg to 133deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2491,Japan - 34deg 40min to 35deg 20min N; 133deg to 134deg E.,Japan - 34deg 40min to 35deg 20min North; 133deg to 134deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2492,Japan - 34deg 40min to 35deg 20min N; 134deg to 135deg E.,Japan - 34deg 40min to 35deg 20min North; 134deg to 135deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2493,Japan - 34deg 40min to 35deg 20min N; 135deg to 136deg E.,Japan - 34deg 40min to 35deg 20min North; 135deg to 136deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2494,Japan - 34deg 40min to 35deg 20min N; 136deg to 137deg E.,Japan - 34deg 40min to 35deg 20min North; 136deg to 137deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2495,Japan - 34deg 40min to 35deg 20min N; 137deg to 138deg E.,Japan - 34deg 40min to 35deg 20min North; 137deg to 138deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2496,Japan - 34deg 40min to 35deg 20min N; 138deg to 139deg E.,Japan - 34deg 40min to 35deg 20min North; 138deg to 139deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2497,Japan - 34deg 40min to 35deg 20min N; 139deg to 140deg E.,Japan - 34deg 40min to 35deg 20min North; 139deg to 140deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2498,Japan - 34deg 40min to 35deg 20min N; 140deg to 141deg E.,Japan - 34deg 40min to 35deg 20min North; 140deg to 141deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2499,Japan - 34deg to 34deg 40min N; 130deg to 131deg E.,Japan - 34deg to 34deg 40min North; 130deg to 131deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2500,Japan - 34deg to 34deg 40min N; 131deg to 132deg E.,Japan - 34deg to 34deg 40min North; 131deg to 132deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2501,Japan - 34deg to 34deg 40min N; 132deg to 133deg E.,Japan - 34deg to 34deg 40min North; 132deg to 133deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2502,Japan - 34deg to 34deg 40min N; 133deg to 134deg E.,Japan - 34deg to 34deg 40min North; 133deg to 134deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2503,Japan - 34deg to 34deg 40min N; 134deg to 135deg E.,Japan - 34deg to 34deg 40min North; 134deg to 135deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2504,Japan - 34deg to 34deg 40min N; 135deg to 136deg E.,Japan - 34deg to 34deg 40min North; 135deg to 136deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2505,Japan - 34deg to 34deg 40min N; 136deg to 137deg E.,Japan - 34deg to 34deg 40min North; 136deg to 137deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2506,Japan - 34deg to 34deg 40min N; 137deg to 138deg E.,Japan - 34deg to 34deg 40min North; 137deg to 138deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2507,Japan - 34deg to 34deg 40min N; 138deg to 139deg E.,Japan - 34deg to 34deg 40min North; 138deg to 139deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2508,Japan - 33deg 20min to 34deg N; 129deg to 130deg E.,Japan - 33deg 20min to 34deg North; 129deg to 130deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2509,Japan - 33deg 20min to 34deg N; 130deg to 131deg E.,Japan - 33deg 20min to 34deg North; 130deg to 131deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2510,Japan - 33deg 20min to 34deg N; 131deg to 132deg E.,Japan - 33deg 20min to 34deg North; 131deg to 132deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2511,Japan - 33deg 20min to 34deg N; 132deg to 133deg E.,Japan - 33deg 20min to 34deg North; 132deg to 133deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2512,Japan - 33deg 20min to 34deg N; 133deg to 134deg E.,Japan - 33deg 20min to 34deg North; 133deg to 134deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2513,Japan - 33deg 20min to 34deg N; 134deg to 135deg E.,Japan - 33deg 20min to 34deg North; 134deg to 135deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2514,Japan - 33deg 20min to 34deg N; 135deg to 136deg E.,Japan - 33deg 20min to 34deg North; 135deg to 136deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2515,Japan - 33deg 20min to 34deg N; 136deg to 137deg E.,Japan - 33deg 20min to 34deg North; 136deg to 137deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2516,Japan - 32deg 40min to 33deg 20min N; 129deg to 130deg E.,Japan - 32deg 40min to 33deg 20min North; 129deg to 130deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2517,Japan - 32deg 40min to 33deg 20min N; 130deg to 131deg E.,Japan - 32deg 40min to 33deg 20min North; 130deg to 131deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2518,Japan - 32deg 40min to 33deg 20min N; 131deg to 132deg E.,Japan - 32deg 40min to 33deg 20min North; 131deg to 132deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2519,Japan - 32deg 40min to 33deg 20min N; 132deg to 133deg E.,Japan - 32deg 40min to 33deg 20min North; 132deg to 133deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2520,Japan - 32deg 40min to 33deg 20min N; 133deg to 134deg E.,Japan - 32deg 40min to 33deg 20min North; 133deg to 134deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2521,Japan - 32deg 40min to 33deg 20min N; 134deg to 135deg E.,Japan - 32deg 40min to 33deg 20min North; 134deg to 135deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2522,Japan - 32deg to 32deg 40min N; 130deg to 131deg E.,Japan - 32deg to 32deg 40min North; 130deg to 131deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2523,Japan - 32deg to 32deg 40min N; 131deg to 132deg E.,Japan - 32deg to 32deg 40min North; 131deg to 132deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2524,Japan - 31deg 20min to 32deg N; 130deg to 131deg E.,Japan - 31deg 20min to 32deg North; 130deg to 131deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2525,Japan - 31deg 20min to 32deg N; 131deg to 132deg E.,Japan - 31deg 20min to 32deg North; 131deg to 132deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2526,Japan - 30deg 40min to 31deg 20min N; 130deg to 131deg E.,Japan - 30deg 40min to 31deg 20min North; 130deg to 131deg East.,,,,,EPSG,EPSG,1998-12-12 00:00:00,,0
+2527,USA - Texas - SPCS83 - S central,United States (USA) - Texas between approximately 30d 10m & 28d 05m North - counties of Aransas; Atascosa; Austin; Bandera; Bee; Bexar; Brazoria; Brewster; Caldwell; Calhoun; Chambers; Colorado; Comal; De Witt; Dimmit; Edwards; Fayette; Fort Bend; Frio; Galveston; Goliad; Gonzales; Guadalupe; Harris; Hays; Jackson; Jefferson; Karnes; Kendall; Kerr; Kinney; La Salle; Lavaca; Live Oak; Matagorda; Maverick; McMullen; Medina; Presidio; Real; Refugio; Ter [...]
+2528,USA - Texas - SPCS83 - S,United States (USA) - Texas south of approximately 28d 05m North - counties of Brooks; Cameron; Duval; Hidalgo; Jim Hogg; Jim Wells; Kenedy; Kleberg; Nueces; San Patricio; Starr; Webb; Willacy; Zapata.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2529,USA - Louisiana - SPCS83 - S,United States (USA) - Louisiana south of approximately 30d 55m North - counties of Acadia; Allen; Ascension; Assumption; Beauregard; Calcasieu; Cameron; East Baton Rouge; East Feliciana; Evangeline; Iberia; Iberville; Jefferson; Jefferson Davis; Lafayette; LaFourche; Livingston; Orleans; Plaquemines; Pointe Coupee; St. Bernard; St. Charles; St. Helena; St. James; St. John the Baptist; St. Landry; St. Martin; St. Mary; St. Tammany; Tangipahoa; Terrebonne; [...]
+2530,UK - Northern Ireland,United Kingdom (UK) - Northern Ireland (Ulster).,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2531,Denmark - Jutland and Fuen,Denmark - Jutland and Fuen.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2532,Denmark - Zealand and Lolland,Denmark - Zealand and Lolland.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2533,Denmark - Bornholm,Denmark - Bornholm.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2534,3-degree TM - N hemisphere CM 27 deg E,"Between 25 deg 30 min and 28 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2535,3-degree TM - N hemisphere CM 30 deg E,"Between 28 deg 30 min and 31 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2536,3-degree TM - N hemisphere CM 33 deg E,"Between 31 deg 30 min and 34 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2537,3-degree TM - N hemisphere CM 36 deg E,"Between 34 deg 30 min and 37 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2538,3-degree TM - N hemisphere CM 39 deg E,"Between 37 deg 30 min and 40 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2539,3-degree TM - N hemisphere CM 42 deg E,"Between 40 deg 30 min and 43 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2540,3-degree TM - N hemisphere CM 45 deg E,"Between 43 deg 30 min and 46 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2541,Germany - former west Germany N,Germany - former west Germany north of 52deg 20min N.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2542,Germany - former west Germany C,Germany - former west Germany between 50deg 20min and 52deg 20min N.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2543,Germany - former west Germany S,Germany - former west Germany south of 50deg 20min N.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2544,Germany - Thuringen,Germany - Thuringen.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2545,Germany - Sachsen,Germany - Sachsen.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2546,Romania - offshore,Romania - offshore.,,,,,EPSG,EPSG,2001-11-06 00:00:00,,0
+2547,Yugoslavia - Montenegro,Yugoslavia - Montenegro.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2548,Africa - AOF W of 10deg W,French West Africa west of 10deg West.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2549,Africa - AOF 10 to 3.5deg W,French West Africa between 10deg and 3deg 30min West.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2550,Africa - AOF 3.5deg W to 4deg E,French West Africa between 3deg 30min West and 4deg East.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2551,Africa - AOF 4 to 9deg E,French West Africa between 4deg and 9deg East.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2552,Africa - AEF 9 to 14deg E,French Equatorial Africa between 9deg and 14deg East.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2553,Africa - AEF 14 to 21deg E,French Equatorial Africa between 14deg and 21deg East.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2554,Africa - AEF east of 21deg E,French Equatorial Africa east of 21deg East.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2555,Cameroon - coastal area,Cameroon - coastal area.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2556,Greenland - north of 81 deg N,Greenland - north of 81 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2557,Greenland - east - 78 to 81 deg N,Greenland - east of 44 deg West and between 78 deg and 81 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2558,Greenland - east - 75 to 78 deg N,Greenland - east of 42 deg West and between 75 deg and 78 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2559,Greenland - east - 72 to 75 deg N,Greenland - east of 38 deg West and between 72 deg and 75 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2560,Greenland - east - 69 to 72 deg N,Greenland - east of 38 deg West and between 69 deg and 72 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2561,Greenland - east - 66 to 69 deg N,Greenland - east of 42 deg West and between 66 deg and 69 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2562,Greenland - east - 63 to 66 deg N,Greenland - east of 46 deg West and between 63 deg and 66 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2563,Greenland - west - 78 to 81 deg N,Greenland - west of 44 deg West and between 78 deg and 81 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2564,Greenland - west - 75 to 78 deg N,Greenland - west of 44 deg West and between 75 deg and 78 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2565,Greenland - west - 72 to 75 deg N,Greenland - west of 38 deg West and between 72 deg and 75 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2566,Greenland - west - 69 to 72 deg N,Greenland - west of 38 deg West and between 69 deg and 72 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2567,Greenland - west - 66 to 69 deg N,Greenland - west of 42 deg West and between 66 deg and 69 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2568,Greenland - west - 63 to 66 deg N,Greenland - west of 46 deg West and between 63 deg and 66 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2569,Greenland - south of 63 deg N,Greenland - south of 63 deg North.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2570,Greenland - Scoresbysund area,Greenland - Scoresbysund area.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2571,Greenland - Ammassalik area,Greenland - Ammassalik area.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2572,Greenland - E of 48d W,Greenland east of 48 deg West.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2573,Greenland - W of 48d W,Greenland west of 48 deg West.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2574,Congo - coastal area and offshore,Congo - coastal area and offshore.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2575,Australia - all states,Australia - Australian Capital Territory (ACT); New South Wales (NSW); Northern Territories (NT); Queensland (Qld); South Australia (SA); Tasmania (Tas); Western Australia (WA); Victoria (Vic).,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2576,Australia - AGD84,"Australia - Queensland (Qld), South Australia (SA), Western Australia (WA).",,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2577,Indonesia - Java Sea - ONWJ,Indonesia - Java Sea - offshore northwest Java.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2588,Indonesia - Java Sea - E,Indonesia - eastern Java Sea.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2589,Indonesia - Irian Jaya - Tangguh,Indonesia - Irian Jaya - Tangguh.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2590,Cameroon - Garoua area,Cameroon - Garoua area.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2591,Cameroon - N'Djamena area,Cameroon - N'Djamena area.,,,,,EPSG,EPSG,2002-01-18 00:00:00,,0
+2592,Azerbaijan - offshore and Sangachal,Azerbaijan - offshore and Sangachal terminal.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2593,Asia - Azerbaijan and Georgia,Azerbaijan and Georgia,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2594,Azerbaijan - coastal area Baku to Astara,Azerbaijan - coastal area Baku to Astara.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2595,Egypt - Western Desert,Egypt - Western Desert.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2596,Argentina - Tierra del Fuego - offshore W of 66W,Argentina - Tierra del Fuego offshore west of 66 deg West.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2597,Argentina - Tierra del Fuego - offshore E of 66W,Argentina - Tierra del Fuego offshore east of 66 deg West.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2598,Algeria - District 3,Algeria - District 3 (In Salah).,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2599,Algeria - In Amenas,Algeria - In Amenas block.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2600,Algeria - Hassi Bir Reikaz,Algeria - Hassi Bir Reikaz.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,0
+2601,Norway - offshore N of 62 deg N;  Svalbard; Jan Mayen,Norway - offshore north of 62 deg N;  Svalbard and Jan Mayen Islands.,,,,,EPSG,EPSG,2001-08-15 00:00:00,,0
+2602,"Palestine Territory, Occupied","Palestine Territory, Occupied.",PS,PSE,275,,ISO 3166 Maintenance Agency.  ftp://ftp.fu-berlin.de/pub/doc/iso,EPSG,2002-06-22 00:00:00,,0
+2603,Asia - Middle East - Israel and Palestine Territory,Asia - Middle East - Israel and Palestine Territory.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2604,3-degree TM - N hemisphere CM 48 deg E,"Between 46 deg 30 min and 49 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2605,3-degree TM - N hemisphere CM 51 deg E,"Between 49 deg 30 min and 52 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2606,3-degree TM - N hemisphere CM 54 deg E,"Between 52 deg 30 min and 55 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2607,3-degree TM - N hemisphere CM 57 deg E,"Between 55 deg 30 min and 58 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2608,3-degree TM - N hemisphere CM 60 deg E,"Between 58 deg 30 min and 61 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2609,3-degree TM - N hemisphere CM 63 deg E,"Between 61 deg 30 min and 64 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2610,3-degree TM - N hemisphere CM 66 deg E,"Between 64 deg 30 min and 67 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2611,3-degree TM - N hemisphere CM 69 deg E,"Between 67 deg 30 min and 70 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2612,3-degree TM - N hemisphere CM 72 deg E,"Between 70 deg 30 min and 73 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2613,3-degree TM - N hemisphere CM 75 deg E,"Between 73 deg 30 min and 76 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2614,3-degree TM - N hemisphere CM 78 deg E,"Between 76 deg 30 min and 79 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2615,3-degree TM - N hemisphere CM 81 deg E,"Between 79 deg 30 min and 82 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2616,3-degree TM - N hemisphere CM 84 deg E,"Between 82 deg 30 min and 85 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2617,3-degree TM - N hemisphere CM 87 deg E,"Between 85 deg 30 min and 88 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2618,3-degree TM - N hemisphere CM 90 deg E,"Between 88 deg 30 min and 91 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2619,3-degree TM - N hemisphere CM 93 deg E,"Between 91 deg 30 min and 94 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2620,3-degree TM - N hemisphere CM 96 deg E,"Between 94 deg 30 min and 97 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2621,3-degree TM - N hemisphere CM 99 deg E,"Between 97 deg 30 min and 100 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2622,3-degree TM - N hemisphere CM 102 deg E,"Between 100 deg 30 min and 103 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2623,3-degree TM - N hemisphere CM 105 deg E,"Between 103 deg 30 min and 106 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2624,3-degree TM - N hemisphere CM 108 deg E,"Between 106 deg 30 min and 109 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2625,3-degree TM - N hemisphere CM 111 deg E,"Between 109 deg 30 min and 112 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2626,3-degree TM - N hemisphere CM 114 deg E,"Between 112 deg 30 min and 115 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2627,3-degree TM - N hemisphere CM 117 deg E,"Between 115 deg 30 min and 118 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2628,3-degree TM - N hemisphere CM 120 deg E,"Between 118 deg 30 min and 121 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2629,3-degree TM - N hemisphere CM 123 deg E,"Between 121 deg 30 min and 124 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2630,3-degree TM - N hemisphere CM 126 deg E,"Between 124 deg 30 min and 127 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2631,3-degree TM - N hemisphere CM 129 deg E,"Between 127 deg 30 min and 130 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2632,3-degree TM - N hemisphere CM 132 deg E,"Between 130 deg 30 min and 133 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2633,3-degree TM - N hemisphere CM 135 deg E,"Between 133 deg 30 min and 136 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2634,3-degree TM - N hemisphere CM 138 deg E,"Between 136 deg 30 min and 139 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2635,3-degree TM - N hemisphere CM 141 deg E,"Between 139 deg 30 min and 142 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2636,3-degree TM - N hemisphere CM 144 deg E,"Between 142 deg 30 min and 145 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2637,3-degree TM - N hemisphere CM 147 deg E,"Between 145 deg 30 min and 148 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2638,3-degree TM - N hemisphere CM 150 deg E,"Between 148 deg 30 min and 151 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2639,3-degree TM - N hemisphere CM 153 deg E,"Between 151 deg 30 min and 154 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2640,3-degree TM - N hemisphere CM 156 deg E,"Between 154 deg 30 min and 157 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2641,3-degree TM - N hemisphere CM 159 deg E,"Between 157 deg 30 min and 160 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2642,3-degree TM - N hemisphere CM 162 deg E,"Between 160 deg 30 min and 163 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2643,3-degree TM - N hemisphere CM 165 deg E,"Between 163 deg 30 min and 166 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2644,3-degree TM - N hemisphere CM 168 deg E,"Between 166 deg 30 min and 169 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2645,3-degree TM - N hemisphere CM 171 deg E,"Between 169 deg 30 min and 172 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2646,3-degree TM - N hemisphere CM 174 deg E,"Between 172 deg 30 min and 175 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2647,3-degree TM - N hemisphere CM 177 deg E,"Between 175 deg 30 min and 178 deg 30 min East, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2648,3-degree TM - N hemisphere CM 180 deg,"Between 178 deg 30 min East and 178 deg 30 min West, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2649,3-degree TM - N hemisphere CM 177 deg W,"Between 178 deg 30 min and 175 deg 30 min West, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2650,3-degree TM - N hemisphere CM 174 deg W,"Between 175 deg 30 min and 172 deg 30 min West, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2651,3-degree TM - N hemisphere CM 171 deg W,"Between 172 deg 30 min and 169 deg 30 min West, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2652,3-degree TM - N hemisphere CM 168 deg W,"Between 169 deg 30 min and 166 deg 30 min West, northern hemisphere.",,,,,EPSG,EPSG,2002-06-22 00:00:00,2002.341,0
+2653,Europe - 3deg GK CM 21 deg E,Russian Federation and Ukraine - between 19 deg 30 min and 22 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2654,Europe - 3deg GK CM 24 deg E,"Belarus, Russian Federation and Ukraine - between 22 deg 30 min and 25 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2655,Europe - 3deg GK CM 27 deg E,"Belarus, Moldova, Russian Federation and Ukraine - between 25 deg 30 min and 28 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2656,Europe - 3deg GK CM 30 deg E,"Belarus, Moldova, Russian Federation and Ukraine - between 28 deg 30 min and 31 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2657,Europe - 3deg GK CM 33 deg E,"Belarus, Russian Federation and Ukraine - between 31 deg 30 min and 34 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2658,Europe - 3deg GK CM 36 deg E,Russian Federation and Ukraine - between 34 deg 30 min and 37 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2659,Europe - 3deg GK CM 39 deg E,"Georgia, Russian Federation  and Ukraine - between 37 deg 30 min and 40 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2660,Europe - 3deg GK CM 42 deg E,"Georgia, Russian Federation - between 40 deg 30 min and 43 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2661,Europe - 3deg GK CM 45 deg E,"Armenia, Azerbaijan, Georgia and Russian Federation - between 43 deg 30 min and 46 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2662,Europe - 3deg GK CM 48 deg E,"Azerbaijan, Georgia and Russian Federation - between 46 deg 30 min and 49 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2663,Europe - 3deg GK CM 51 deg E,"Azerbaijan, Georgia and Russian Federation - between 49 deg 30 min and 52 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2664,Asia - 3deg GK CM 54 deg E,"Kazakstan, Russian Federation and Turkmenistan - between 52 deg 30 min and 55 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2665,Asia - 3deg GK CM 57 deg E,"Kazakstan, Russian Federation and Turkmenistan - between 55 deg 30 min and 58 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2666,Asia - 3deg GK CM 60 deg E,"Kazakstan, Russian Federation, Turkmenistan and Uzbekistan - between 58 deg 30 min and 61 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2667,Asia - 3deg GK CM 63 deg E,"Kazakstan, Russian Federation, Turkmenistan and Uzbekistan - between 61 deg 30 min and 64 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2668,Asia - 3deg GK CM 66 deg E,"Kazakstan, Russian Federation, Turkmenistan and Uzbekistan - between 64 deg 30 min and 67 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2669,Asia - 3deg GK CM 69 deg E,"Kazakstan, Kyrgyzstan, Russian Federation, Tajikistan and Uzbekistan - between 67 deg 30 min and 70 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2670,Asia - 3deg GK CM 72 deg E,"Kazakstan, Kyrgyzstan, Russian Federation, Tajikistan and Uzbekistan - between 70 deg 30 min and 73 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2671,Asia - 3deg GK CM 75 deg E,"Kazakstan, Kyrgyzstan, Russian Federation and Tajikistan - between 73 deg 30 min and 76 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2672,Asia - 3deg GK CM 78 deg E,"Kazakstan, Kyrgyzstan and Russian Federation - between 76 deg 30 min and 79 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2673,Asia - 3deg GK CM 81 deg E,"Kazakstan, Kyrgyzstan and Russian Federation - between 79 deg 30 min and 82 deg 30 min East.",,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2674,Asia - 3deg GK CM 84 deg E,Kazakstan and Russian Federation - between 82 deg 30 min and 85 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2675,Asia - 3deg GK CM 87 deg E,Kazakstan and Russian Federation - between 85 deg 30 min and 88 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2676,Russia - 88.5 to 91.5 deg E,Russian Federation - between 88 deg 30 min and 91 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2677,Russia - 91.5 to 94.5 deg E,Russian Federation - between 91 deg 30 min and 94 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2678,Russia - 94.5 to 97.5 deg E,Russian Federation - between 94 deg 30 min and 97 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2679,Russia - 97.5 to 100.5 deg E,Russian Federation - between 97 deg 30 min and 100 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2680,Russia - 100.5 to 103.5 deg E,Russian Federation - between 100 deg 30 min and 103 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2681,Russia - 103.5 to 106.5 deg E,Russian Federation - between 103 deg 30 min and 106 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2682,Russia - 106.5 to 109.5 deg E,Russian Federation - between 106 deg 30 min and 109 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2683,Russia - 109.5 to 112.5 deg E,Russian Federation - between 109 deg 30 min and 112 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2684,Russia - 112.5 to 115.5 deg E,Russian Federation - between 112 deg 30 min and 115 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2685,Russia - 115.5 to 118.5 deg E,Russian Federation - between 115 deg 30 min and 118 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2686,Russia - 118.5 to 121.5 deg E,Russian Federation - between 118 deg 30 min and 121 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2687,Russia - 121.5 to 124.5 deg E,Russian Federation - between 121 deg 30 min and 124 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2688,Russia - 124.5 to 127.5 deg E,Russian Federation - between 124 deg 30 min and 127 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2689,Russia - 127.5 to 130.5 deg E,Russian Federation - between 127 deg 30 min and 130 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2690,Russia - 130.5 to 133.5 deg E,Russian Federation - between 130 deg 30 min and 133 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2691,Russia - 133.5 to 136.5 deg E,Russian Federation - between 133 deg 30 min and 136 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2692,Russia - 136.5 to 139.5 deg E,Russian Federation - between 136 deg 30 min and 139 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2693,Russia - 139.5 to 142.5 deg E,Russian Federation - between 139 deg 30 min and 142 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2694,Russia - 142.5 to 145.5 deg E,Russian Federation - between 142 deg 30 min and 145 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2695,Russia - 145.5 to 148.5 deg E,Russian Federation - between 145 deg 30 min and 148 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2696,Russia - 148.5 to 151.5 deg E,Russian Federation - between 148 deg 30 min and 151 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2697,Russia - 151.5 to 154.5 deg E,Russian Federation - between 151 deg 30 min and 154 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2698,Russia - 154.5 to 157.5 deg E,Russian Federation - between 154 deg 30 min and 157 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2699,Russia - 157.5 to 160.5 deg E,Russian Federation - between 157 deg 30 min and 160 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2700,Russia - 160.5 to 163.5 deg E,Russian Federation - between 160 deg 30 min and 163 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2701,Russia - 163.5 to 166.5 deg E,Russian Federation - between 163 deg 30 min and 166 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2702,Russia - 166.5 to 170.5 deg E,Russian Federation - between 166 deg 30 min and 169 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2703,Russia - 169.5 to 172.5 deg E,Russian Federation - between 169 deg 30 min and 172 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2704,Russia - 172.5 to 175.5 deg E,Russian Federation - between 172 deg 30 min and 175 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2705,Russia - 175.5 to 178.5 deg E,Russian Federation - between 175 deg 30 min and 178 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2706,Russia - 178.5E to 178.5 deg W,Russian Federation - between 178 deg 30 min East and 178 deg 30 min West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2707,Russia - 178.5 to 175.5 deg W,Russian Federation - between 178 deg 30 min and 175 deg 30 min West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2708,Russia - 175.5 to 172.5 deg W,Russian Federation - between 175 deg 30 min and 172 deg 30 min West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2709,Russia - 172.5 to 169.5 deg W,Russian Federation - between 172 deg 30 min and 169 deg 30 min West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2710,Russia - 169.5 to 166.5 deg W,Russian Federation - between 169 deg 30 min and 166 deg 30 min West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2711,China - 73.5 to 76.5 deg E,China - between 73 deg 30 min and 76 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2712,China - 76.5 to 79.5 deg E,China - between 76 deg 30 min and 79 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2713,China - 79.5 to 82.5 deg E,China - between 79 deg 30 min and 82 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2714,China - 82.5 to 85.5 deg E,China - between 82 deg 30 min and 85 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2715,China - 85.5 to 88.5 deg E,China - between 85 deg 30 min and 88 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2716,China - 88.5 to 91.5 deg E,China - between 88 deg 30 min and 91 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2717,China - 91.5 to 94.5 deg E,China - between 91 deg 30 min and 94 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2718,China - 94.5 to 97.5 deg E,China - between 94 deg 30 min and 97 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2719,China - 97.5 to 100.5 deg E,China - between 97 deg 30 min and 100 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2720,China - 100.5 to 103.5 deg E,China - between 100 deg 30 min and 103 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2721,China - 103.5 to 106.5 deg E,China - between 103 deg 30 min and 106 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2722,China - 106.5 to 109.5 deg E,China - between 106 deg 30 min and 109 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2723,China - 109.5 to 112.5 deg E,China - between 109 deg 30 min and 112 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2724,China - 112.5 to 115.5 deg E,China - between 112 deg 30 min and 115 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2725,China - 115.5 to 118.5 deg E,China - between 115 deg 30 min and 118 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2726,China - 118.5 to 121.5 deg E,China - between 118 deg 30 min and 121 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2727,China - 121.5 to 124.5 deg E,China - between 121 deg 30 min and 124 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2728,China - 124.5 to 127.5 deg E,China - between 124 deg 30 min and 127 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2729,China - 127.5 to 130.5 deg E,China - between 127 deg 30 min and 130 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2730,China - 130.5 to 133.5 deg E,China - between 130 deg 30 min and 133 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2731,China - 133.5 to 136.5 deg E,China - between 133 deg 30 min and 136 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2732,6-degree TM - CM 81 deg W,Between 84 and 78 deg West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2733,6-degree TM - CM 75 deg W,Between 78 and 72 deg West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2734,6-degree TM - CM 69 deg W,Between 72 and 66 deg West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2735,6-degree TM - CM 63 deg W,Between 66 and 60 deg West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2736,6-degree TM - CM 57 deg W,Between 60 and 54 deg West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2737,6-degree TM - CM 51 deg W,Between 54 and 48 deg West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2738,6-degree TM - CM 45 deg W,Between 48 and 42 deg West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2739,6-degree TM - CM 39 deg W,Between 42 and 36 deg West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2740,6-degree TM - CM 33 deg W,Between 36 and 30 deg West.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2741,6-degree TM - CM 9 deg E,Between 6 and 12 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2742,6-degree TM - CM 15 deg E,Between 12 and 18 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2743,6-degree TM - CM 21 deg E,Between 18 and 24 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2744,6-degree TM - CM 27 deg E,Between 24 and 30 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2745,6-degree TM - CM 33 deg E,Between 30 and 36 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2746,6-degree TM - CM 39 deg E,Between 36 and 42 deg East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2747,Russia - 19.5 to 22.5 deg E,Russian Federation - between 19 deg 30 min and 22 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2748,Russia - 22.5 to 25.5 deg E,Russian Federation - between 22 deg 30 min and 25 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2749,Russia - 25.5 to 28.5 deg E,Russian Federation - between 25 deg 30 min and 28 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2750,Russia - 28.5 to 31.5 deg E,Russian Federation - between 28 deg 30 min and 31 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2751,Russia - 31.5 to 34.5 deg E,Russian Federation - between 31 deg 30 min and 34 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2752,Russia - 34.5 to 37.5 deg E,Russian Federation - between 34 deg 30 min and 37 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2753,Russia - 37.5 to 40.5 deg E,Russian Federation - between 37 deg 30 min and 40 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2754,Russia - 40.5 to 43.5 deg E,Russian Federation - between 40 deg 30 min and 43 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2755,Russia - 43.5 to 46.5 deg E,Russian Federation - between 43 deg 30 min and 46 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2756,Russia - 46.5 to 49.5 deg E,Russian Federation - between 46 deg 30 min and 49 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2757,Russia - 49.5 to 52.5 deg E,Russian Federation - between 49 deg 30 min and 52 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2758,Russia - 52.5 to 55.5 deg E,Russian Federation - between 52 deg 30 min and 55 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2759,Russia - 55.5 to 58.5 deg E,Russian Federation - between 55 deg 30 min and 58 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2760,Russia - 58.5 to 61.5 deg E,Russian Federation - between 58 deg 30 min and 61 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2761,Russia - 61.5 to 64.5 deg E,Russian Federation - between 61 deg 30 min and 64 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2762,Russia - 64.5 to 67.5 deg E,Russian Federation - between 64 deg 30 min and 67 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2763,Russia - 67.5 to 70.5 deg E,Russian Federation - between 67 deg 30 min and 70 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2764,Russia - 70.5 to 73.5 deg E,Russian Federation - between 70 deg 30 min and 73 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2765,Russia - 73.5 to 76.5 deg E,Russian Federation - between 73 deg 30 min and 76 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2766,Russia - 76.5 to 79.5 deg E,Russian Federation - between 76 deg 30 min and 79 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2767,Russia - 79.5 to 82.5 deg E,Russian Federation - between 79 deg 30 min and 82 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2768,Russia - 82.5 to 85.5 deg E,Russian Federation - between 82 deg 30 min and 85 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2769,Russia - 85.5 to 88.5 deg E,Russian Federation - between 85 deg 30 min and 88 deg 30 min East.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2770,Indonesia - Kalimantan NE,Indonesia - northeast Kalimantan.,,,,,EPSG,EPSG,2002-06-22 00:00:00,,0
+2771,Niger - SE,Niger - south east,,,,,EPSG,EPSG,2002-06-28 00:00:00,,0
+2772,Asia - CS63 zone A1,Armenia and Georgia west of 43deg 02min E.,,,,,EPSG,EPSG,2002-06-28 00:00:00,,0
+2773,Asia - CS63 zone A2,Armenia and Georgia between 43 deg 02min and 46 deg 02 min E; Azerbaijan west of 46 deg 02 min E.,,,,,EPSG,EPSG,2002-06-28 00:00:00,,0
+2774,Asia - CS63 zone A3,Armenia and Georgia east of 46 deg 02 min E; Azerbaijan between 46 deg 02min and 49 deg 02 min E.,,,,,EPSG,EPSG,2002-06-28 00:00:00,,0
+2775,Asia - CS63 zone A4,Azerbaijan east of 49 deg 02 min E.,,,,,EPSG,EPSG,2002-06-28 00:00:00,,0
+2776,Asia - CS63 zone K2,Kazakstan between 49 deg 16 min and 52 deg 16 min E.,,,,,EPSG,EPSG,2002-06-28 00:00:00,,0
+2777,Asia - CS63 zone K3,Kazakstan between 52 deg 16 min and 55 deg 16 min E.,,,,,EPSG,EPSG,2002-06-28 00:00:00,,0
+2778,Asia - CS63 zone K4,Kazakstan between 55 deg 16 min and 58 deg 16 min E.,,,,,EPSG,EPSG,2002-06-28 00:00:00,,0
+2779,Portugal - Selvagens,Portugal - Selvagens island (Madeira group).,,,,,EPSG,EPSG,2001-06-05 00:00:00,,0
+2780,Malaysia - East Malaysia - offshore,Malaysia - East Malaysia (Sabah; Sarawak) - offshore.,,,,,EPSG,EPSG,2002-07-13 00:00:00,,0
+2781,Iran - Kharg Island,Islamic Republic of Iran - Kharg Island.,,,,,EPSG,EPSG,2002-07-13 00:00:00,,0
+2782,Iran - Lavan Island and Balal field,Islamic Republic of Iran - Lavan Island and Balal field.,,,,,EPSG,EPSG,2002-07-13 00:00:00,,0
+2783,Iran - South Pars block 2,Islamic Republic of Iran - South Pars field blocks 2 and 3.,,,,,EPSG,EPSG,2002-07-13 00:00:00,,0
+2784,Canada - CSRS,Canada - Alberta; New Brunswick; Nova Scotia; Saskatchewan; Prince Edward Island; and Quebec.,,,,,EPSG,EPSG,2002-07-13 00:00:00,,0
+2785,Libya - Murzuq,Libyan Arab Jamahiriya - Murzuq field,,,,,EPSG,EPSG,2002-07-16 00:00:00,,0
+2786,Libya - Mabruk,Libyan Arab Jamahiriya - Mabruk field,,,,,EPSG,EPSG,2002-07-16 00:00:00,,0
diff --git a/src/tiff/csv/codes.csv b/src/tiff/csv/codes.csv
new file mode 100644
index 0000000..ba81c3c
--- /dev/null
+++ b/src/tiff/csv/codes.csv
@@ -0,0 +1,84 @@
+"RECORD_ID","TABLE_NAME","TABLE_CONTENTS","CODE_MINIMUM","CODE_MAXIMUM","ALLOCATED_LOW","ALLOCATED_HIGH","REMARKS"
+0.01,Note: EPSG codes reserved range.,,0,32767,,,EPSG reserved code range 0-32766.  Users should allocated codes outside of this range.
+1.0,Alias,Aliases for data in all tables.,1,,1,2020,Autonumbered. Code range also used in other tables.
+2.0,Area,Area of use,1024,32767,1024,2784,Allocated sequentially - codes have no meaning. Code range also used in other tables.
+3.0,Change,Change records,,,,,Allocated sequentially with calendar year.
+4.0,Codes,EPSG codes,,,,,(This table)
+5.0,Coordinate Axis,Coordinate system attributes,,,,,No codes allocated - intersection table using dual key codes of related tables.
+6.0,Coordinate Axis Name,Coordinate system axis names,9900,9999,9901,9928,Allocated sequentially - codes have no meaning.
+7.0,Coordinate Reference System,Coordinate Reference System data,,,,,
+7.1,Coordinate Reference System,      Geographic coordinate reference systems,,,,,
+7.11,Coordinate Reference System,            geogCRS unspecified datum,4000,4099,4001,4047,
+7.12,Coordinate Reference System,            geogCRS non-WGS systems (1),4120,4139,4120,4139,Form ProjCRS 20yy to 39yy.  Range full.
+7.13,Coordinate Reference System,            geogCRS non-WGS systems (2),4140,4199,4140,4199,Added sequentially - codes have no meaning. Range full.
+7.14,Coordinate Reference System,            geogCRS non-WGS systems (3),4200,4319,4200,4319,Form ProjCRS 200yy to 319yy.  Range full.
+7.15,Coordinate Reference System,            geogCRS non-WGS systems (4),4600,4799,4600,4617,Added sequentially - codes have no meaning.
+7.16,Coordinate Reference System,            geogCRS NAD systems overflow,4320,4321,4320,4321,Form ProjCRS 320yy to 321yy.  Range full.
+7.17,Coordinate Reference System,            geogCRS WGS systems,4322,4327,4322,4327,Form ProjCRS 322yy to 327yy.  Range full.
+7.18,Coordinate Reference System,            geogCRS non-Greenwich prime meridian equivalent,4800,4899,4801,4820,Form ProjCRS 20yy to 39yy and 200yy to 319yy as in 6.12 and 6.14.
+7.19,Coordinate Reference System,            geogCRS no Greenwich prime meridian,4900,4999,4901,4904,
+7.3,Coordinate Reference System,      Projected coordinate reference systems,,,,,
+7.31,Coordinate Reference System,            projCRS (1a),2000,3999,2000,3992,Historically allocated from geogCRS 4120-4139. Now being infilled sequentially.
+7.32,Coordinate Reference System,            projCRS (1b),2000,3999,2000,2963,Now being allocated sequentially around codes previously allocated from geogCRS 4120-4139.
+7.35,Coordinate Reference System,            projCRS (2),20000,32766,20004,32766,Historically allocated from geogCRS 4200-4327. Will be infilled sequentially after range 2000-3999 full.
+7.4,Coordinate Reference System,      Vertical coordinate reference systems,,,,,
+7.41,Coordinate Reference System,            using ellipsoidal datum,,,,,Deleted in v3.2
+7.42,Coordinate Reference System,            using geoidal datum,5600,5799,5701,5739,
+7.5,Coordinate Reference System,      Engineering coordinate reference systems,5800,5999,5800,5816,
+7.6,Coordinate Reference System,      Compound coordinate reference systems,7400,7999,7401,7413,
+8.0,Coordinate System,Coordinate System descriptions,,,,,
+8.1,Coordinate System,    Cartesian coordinate systems used in geocentric CRSs,6500,6500,6500,6500,
+8.2,Coordinate System,    Cartesian coordinate systems used in projected CRSs,4400,4599,4400,4532,
+8.3,Coordinate System,    Cartesian coordinate systems used only in Engineering CRSs,6501,6599,,,
+8.4,Coordinate System,    Ellipsoidal and spherical coordinate systems,6400,6449,6401,6404,
+8.5,Coordinate System,    Gravity-related coordinate systems,6450,6499,6497,6499,
+9.0,Coordinate_Operation,Coordinate Operations,,,,,
+9.1,Coordinate_Operation,      Map Projections (Coordinate Conversions),,,,,Codes between 10000 and 19999.
+9.11,Coordinate_Operation,             US State Plane,10000,15999,10001,15917,non-continuous allocation due to semi-heirarchical coding by State.
+9.12,Coordinate_Operation,             global zoned systems,16000,16399,160,163,last two digits indicate zone number
+9.13,Coordinate_Operation,             TM (pseudo UTM) systems NE hem.,16400,16580,16400,16506,systems in the N and E hemispheres.  Digits indicate longitude of origin.
+9.14,Coordinate_Operation,             TM (pseudo UTM) systems SE hem.,16600,16780,16611,16732,systems in the S and E hemispheres.  Digits indicate longitude of origin.
+9.15,Coordinate_Operation,             TM (pseudo UTM) systems SW hem.,16800,16980,,,systems in the S and W hemispheres.  Digits indicate longitude of origin.
+9.16,Coordinate_Operation,             TM (pseudo UTM) systems NW hem.,17000,17180,17001,17054,systems in the N and W hemispheres.  Digits indicate longitude of origin.
+9.17,Coordinate_Operation,             large zoned systems,17200,17999,173,179,last two digits usually indicate zone number
+9.18,Coordinate_Operation,             small zoned systems,18000,18999,1801,1844,last digit indicates zone number
+9.19,Coordinate_Operation,             individual zones,19000,19999,19000,19979,
+9.3,Coordinate_Operation,      Coordinate Transformations,,,,,
+9.31,Coordinate_Operation,             Single-step geodetic transformations,1024,1099,1025,1038,
+9.32,Coordinate_Operation,             Single-step geodetic transformations,1100,1099,1025,1864,
+9.34,Coordinate_Operation,             Concatenated geodetic transformations,8000,8999,8046,8635,
+9.37,Coordinate_Operation,             Vertical offset data,5400,5599,5400,5405,
+10.0,Coordinate_Operation Method,Coordinate Operation methods and required parameter names,,,,,
+10.1,Coordinate_Operation Method,    transformation methods,9600,9699,9601,9636,
+10.2,Coordinate_Operation Method,    reserved for operation methods,9700,9799,,,
+10.3,Coordinate_Operation Method,    conversion (map projection) methods,9800,9899,9801,9828,
+11.0,Coordinate_Operation Parameter,Coordinate Operation parameter names and descriptions,8600,8899,,,
+11.1,Coordinate_Operation Parameter,    Parameters used in transformations,8600,8699,8601,8667,
+11.2,Coordinate_Operation Parameter,    reserved for operation parameters,8700,8799,,,
+11.3,Coordinate_Operation Parameter,    Parameters used in conversions,8880,8899,8801,8831,
+12.0,Coordinate_Operation Parameter Usage,Links parameters with operation methods,,,,,No codes allocated - intersection table using dual key codes of related tables.
+13.0,Coordinate_Operation Parameter Value,Values of transformation and conversion parameters,,,,,No codes allocated - intersection table using triple key codes of related tables.
+14.0,Coordinate_Operation Path,Concatenated transformation steps,,,,,No codes allocated - intersection table using dual key codes of related tables.
+15.1,Datum,Geodetic Datum data,,,,,
+15.11,Datum,    unspecified datum,6000,6099,6001,6047,Form GeogCRS 4000 to 4099.
+15.12,Datum,    WGS systems,6322,6327,6322,6327,Form GeogCRS 4322 to 4327.  Range full.
+15.13,Datum,    NAD systems overflow,6320,6321,6320,6321,Form GeogCRS 4320 to 4321.  Range full.
+15.14,Datum,    non-WGS systems (1),6120,6139,6120,6139,Form GeogCRS 4120 to 4139.  Range full.
+15.15,Datum,    non-WGS systems (2),6140,6199,6140,6199,Form GeogCRS 4140 to 4199.  Range full.
+15.16,Datum,    non-WGS systems (3),6200,6319,6200,6319,Form GeogCRS 4200 to 4319.  Range full.
+15.17,Datum,    non-WGS systems (4),6600,6799,6600,6617,Form GeogCRS 4600 to 4799.
+15.18,Datum,    non-Greenwich prime meridian equivalent,6800,6899,6801,6820,Form GeogCRS 4800 to 4899.
+15.19,Datum,    no Greenwich prime meridian,6900,6999,6901,6904,Form GeogCRS 4900 to 4999.
+15.3,Datum,Vertical datum data,,,,,
+15.31,Datum,    ellipsoidal datum,,,,,Deleted in v3.2
+15.32,Datum,    geoidal datum,5000,5199,5100,5137,
+15.4,Datum,Engineering Datum data,9300,9599,9300,9313,
+16.0,Deprecation,Deprecated records reasons and replacement trail,1,,2,426,Autonumbered. Code range also used in other tables.
+17.0,Ellipsoid,Ellipsoid data,7000,7299,7001,7049,
+18.0,Naming System,Naming System names,7300,7399,7300,7311,
+19.0,Prime Meridian,Prime Meridian data,8900,8999,8901,8913,
+20.0,Unit of Measure,,,,,,
+20.1,Unit of Measure,Angle unit data,9100,9199,9101,9115,
+20.2,Unit of Measure,Length unit data,9000,9099,9001,9094,
+20.3,Unit of Measure,Scale unit data,9200,9299,9201,9211,
+21.0,Version History,,,,,,
diff --git a/src/tiff/csv/compd_cs.c b/src/tiff/csv/compd_cs.c
new file mode 100644
index 0000000..7c525a5
--- /dev/null
+++ b/src/tiff/csv/compd_cs.c
@@ -0,0 +1,12 @@
+#include "defs.h"
+datafile_rows_t compd_cs_row_1[] = {"COMPOUNDCS_CODE","COMPOUNDCS_EPSG_NAME","COMPOUNDCS_EPSG_ABBR","COMPOUNDCS_USER_NAME","DESCRIPTION","AREA_OF_USE","HORIZCS_CODE","VERTCS_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t compd_cs_row_2[] = {"7400","NTF (Paris) + NGF IGN69","","","","France - mainland.","4807","5720","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t compd_cs_row_3[] = {"7401","NTF (Paris) / France II + NGF Lallemand","NTF / France II + Lalle","","","France - mainland.","27582","5719","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t compd_cs_row_4[] = {"7402","NTF (Paris) / France II + NGF IGN69","NTF / France II + IGN69","","","France - mainland.","27582","5720","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t compd_cs_row_5[] = {"7403","NTF (Paris) / France III + NGF IGN69","NTF / France III + IGN69","","","France south of 50.5 grads (45 deg 27 min) North.","27583","5720","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t compd_cs_row_6[] = {"7404","RT90 + RH70","","","","Sweden.","4124","5718","1997-11-13 00:00:00","National Land Survey of Sweden","EPSG","When combined with geoid model RN92 forms geographic 3D coordinate system RR92.","",NULL};
+datafile_rows_t compd_cs_row_7[] = {"7405","OSGB36 / British National Grid + ODN","GB National Grid + ODN","","","United Kingdom (UK) - Great Britain.","27700","5701","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t compd_cs_row_8[] = {"7406","NAD27 + NGVD29","","","","United States (USA).","4267","5702","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t compd_cs_row_9[] = {"7407","NAD27 / Texas North + NGVD29","NAD27 / TX_N + NGVD29","","","United States (USA) - Texas.","32037","5702","1997-11-13 00:00:00","","EPSG","","",NULL};
+
+datafile_rows_t *compd_cs_rows[] = {compd_cs_row_1,compd_cs_row_2,compd_cs_row_3,compd_cs_row_4,compd_cs_row_5,compd_cs_row_6,compd_cs_row_7,compd_cs_row_8,compd_cs_row_9,NULL};
diff --git a/src/tiff/csv/compd_cs.csv b/src/tiff/csv/compd_cs.csv
new file mode 100644
index 0000000..ff9e0a2
--- /dev/null
+++ b/src/tiff/csv/compd_cs.csv
@@ -0,0 +1,9 @@
+"COMPOUNDCS_CODE","COMPOUNDCS_EPSG_NAME","COMPOUNDCS_EPSG_ABBR","COMPOUNDCS_USER_NAME","DESCRIPTION","AREA_OF_USE","HORIZCS_CODE","VERTCS_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+7400,NTF (Paris) + NGF IGN69,,,,France - mainland.,4807,5720,1997-11-13 00:00:00,,EPSG,,
+7401,NTF (Paris) / France II + NGF Lallemand,NTF / France II + Lalle,,,France - mainland.,27582,5719,1997-11-13 00:00:00,,EPSG,,
+7402,NTF (Paris) / France II + NGF IGN69,NTF / France II + IGN69,,,France - mainland.,27582,5720,1997-11-13 00:00:00,,EPSG,,
+7403,NTF (Paris) / France III + NGF IGN69,NTF / France III + IGN69,,,France south of 50.5 grads (45 deg 27 min) North.,27583,5720,1997-11-13 00:00:00,,EPSG,,
+7404,RT90 + RH70,,,,Sweden.,4124,5718,1997-11-13 00:00:00,National Land Survey of Sweden,EPSG,When combined with geoid model RN92 forms geographic 3D coordinate system RR92.,
+7405,OSGB36 / British National Grid + ODN,GB National Grid + ODN,,,United Kingdom (UK) - Great Britain.,27700,5701,1997-11-13 00:00:00,,EPSG,,
+7406,NAD27 + NGVD29,,,,United States (USA).,4267,5702,1997-11-13 00:00:00,,EPSG,,
+7407,NAD27 / Texas North + NGVD29,NAD27 / TX_N + NGVD29,,,United States (USA) - Texas.,32037,5702,1997-11-13 00:00:00,,EPSG,,
diff --git a/src/tiff/csv/coordinate_axis.csv b/src/tiff/csv/coordinate_axis.csv
new file mode 100644
index 0000000..f54287a
--- /dev/null
+++ b/src/tiff/csv/coordinate_axis.csv
@@ -0,0 +1,75 @@
+"COORD_SYS_CODE","COORD_AXIS_NAME_CODE","COORD_AXIS_ORIENTATION","COORD_AXIS_ABBREVIATION","UOM_CODE","ORDER"
+4400,9906,east,E,9001,1
+4400,9907,north,N,9001,2
+4401,9906,east,E,9062,1
+4401,9907,north,N,9062,2
+4402,9906,east,E,9042,1
+4402,9907,north,N,9042,2
+4403,9906,east,E,9005,1
+4403,9907,north,N,9005,2
+4404,9906,east,E,9094,1
+4404,9907,north,N,9094,2
+4405,9906,east,E,9041,1
+4405,9907,north,N,9041,2
+4406,9906,east,X,9036,1
+4406,9907,north,Y,9036,2
+4407,9906,east,E,9039,1
+4407,9907,north,N,9039,2
+4408,9906,east,E,9084,1
+4408,9907,north,N,9084,2
+4409,9906,east,E,9040,1
+4409,9907,north,N,9040,2
+4495,9906,east,X,9002,1
+4495,9907,north,Y,9002,2
+4496,9906,east,E(X),9001,1
+4496,9907,north,N(Y),9001,2
+4497,9906,east,X,9003,1
+4497,9907,north,Y,9003,2
+4498,9906,east,Y,9001,1
+4498,9907,north,X,9001,2
+4499,9906,east,X,9001,1
+4499,9907,north,Y,9001,2
+4500,9906,east,E,9001,2
+4500,9907,north,N,9001,1
+4501,9907,north,N,9001,1
+4501,9908,west,E,9001,2
+4530,9906,east,Y,9001,2
+4530,9907,north,X,9001,1
+4531,9906,east,y,9001,2
+4531,9907,north,x,9001,1
+4532,9906,east,X,9001,2
+4532,9907,north,Y,9001,1
+6401,9901,north,Lat,9108,1
+6401,9902,east,Long,9108,2
+6401,9903,up,h,9001,3
+6402,9901,north,Lat,9108,1
+6402,9902,east,Long,9108,2
+6403,9901,north,Lat,9105,1
+6403,9902,east,Long,9105,2
+6404,9926,north,lat,9102,1
+6404,9927,east,long,9102,2
+6404,9928,up,R,9001,3
+6497,9904,up,H,9003,1
+6498,9905,down,D,9001,1
+6499,9904,up,H,9001,1
+6500,9910,Geocentre > equator/PM,X,9001,1
+6500,9911,Geocentre > equator/90dE,Y,9001,2
+6500,9912,Geocentre > north pole,Z,9001,3
+6501,9908,west,Y,9001,2
+6501,9909,south,X,9001,1
+6502,9908,west,Y,9031,1
+6502,9909,south,X,9031,2
+6503,9908,west,Y,9001,1
+6503,9909,south,X,9001,2
+6504,9918,north-east,e,9001,2
+6504,9919,north-west,n,9001,1
+6505,9913,north-west,n,9001,1
+6505,9914,north-east,e,9001,2
+6506,9913,east-south-east,I,9205,1
+6506,9914,north-north-east,J,9204,2
+6507,9913,north,X,9001,1
+6507,9914,west,Y,9001,2
+6508,9920,east south east,I,9208,2
+6508,9921,north north east,J,9209,1
+6509,9908,west,M,9001,2
+6509,9909,south,P,9001,1
diff --git a/src/tiff/csv/coordinate_axis_name.csv b/src/tiff/csv/coordinate_axis_name.csv
new file mode 100644
index 0000000..0fe5d24
--- /dev/null
+++ b/src/tiff/csv/coordinate_axis_name.csv
@@ -0,0 +1,29 @@
+"COORD_AXIS_NAME_CODE","COORD_AXIS_NAME","DESCRIPTION","REMARKS","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","DEPRECATED"
+9901,Geodetic latitude,"Angle from the equatorial plane to the perpendicular to the ellipsoid through a given point, northwards usually treated as positive.",Used in geographic 2D and geographic 3D coordinate systems.,EPSG,EPSG,2000-03-07 00:00:00,,0
+9902,Geodetic longitude,"Angle from the prime meridian plane to the meridian plane passing through the given point, eastwards usually treated as positive.",Used in geographic 2D and geographic 3D coordinate systems.,EPSG,EPSG,2000-03-07 00:00:00,,0
+9903,Ellipsoidal height,Distance of a point from the ellipsoid measured along the perpendicular from the ellipsoid to this point.  Positive if upwards or outside of the ellipsoid.,"Used only as part of a geographic 3D coordinate system, never on its own.",EPSG based on ISO 19111,EPSG,2000-03-07 00:00:00,,0
+9904,Gravity-related height,"Height influenced by the Earth's gravity field.  In particular, orthometric height or normal height which are both approximations of the distance of a point above sea level. Positive upwards.",Used in a 1D vertical coordinate system.,"ISO 19111 ""Geographical Information - Spatial Referencing by Coordinates"".",EPSG,2000-03-07 00:00:00,,0
+9905,Gravity-related depth,"Depth influenced by the Earth's gravity field, positive downwards.","Similar to gravity-related height, but with the positive increments in the opposite direction.",EPSG,EPSG,2000-03-07 00:00:00,,0
+9906,Easting,East pointing axis used in 2D projected coordinate systems.,,EPSG,EPSG,2000-03-07 00:00:00,,0
+9907,Northing,North pointing axis used in 2D projected coordinate systems.,,EPSG,EPSG,2000-03-07 00:00:00,,0
+9908,Westing,West pointing axis used in 2D projected coordinate systems (e.g. south oriented transverse Mercator),,EPSG,EPSG,2000-03-07 00:00:00,,0
+9909,Southing,South pointing axis used in 2D projected coordinate systems (e.g. south oriented transverse Mercator),,EPSG,EPSG,2000-03-07 00:00:00,,0
+9910,Geocentric X,"First axis of a right-handed earth centered 3D cartesian coordinate system; lies in the zero-longitude plane, such that a vector pointing in the direction of the positive X will have a longitude of zero.",,EPSG,EPSG,2000-03-07 00:00:00,,0
+9911,Geocentric Y,"Second axis of a right-handed earth centered 3D cartesian coordinate system; perpendicular to the zero-longitude plane, pointing eastward",,EPSG,EPSG,2000-03-07 00:00:00,,0
+9912,Geocentric Z,"Third axis of a right-handed earth centered 3D coordinate system; perpendicular to both X and Y, such that it completes a right-handed coordinate system, the Z-axis is approximately parallel to the earth's rotation axis, positive towards the north pole.",,EPSG,EPSG,2000-03-07 00:00:00,,0
+9913,First local axis,First axis of any local coordinate system.,First and second local coordinate axes are assumed to be horizontal and may be supplemented by 'local height' or 'local depth' to form a local 3D coordinate system.,EPSG,EPSG,2000-03-07 00:00:00,,0
+9914,Second local axis,Second axis of any local coordinate system.,,EPSG,EPSG,2000-03-07 00:00:00,,0
+9915,Third local axis,Third axis of any local coordinate system.,"If the local coordinate system is 3-dimensional, then the first and second local coordinate axes shall be horizontal and the third axis vertical.",EPSG,EPSG,2000-06-22 00:00:00,,0
+9916,Local height,"Height influenced by the Earth's gravity field, positive upwards.",Differs from gravity-related height in having an origin offset from sea level.,EPSG,EPSG,2000-03-07 00:00:00,,0
+9917,Local depth,"Depth influenced by the Earth's gravity field, positive downwards.","Similar to local height, but with the positive increments in the opposite direction.",EPSG,EPSG,2000-03-07 00:00:00,,0
+9918,Plant East,An axis of a local engineering grid 2D or 3D coordinate system.  Plant East is 90 degrees clockwise from the Plant North axis when viewed from above the plane containing the two axes.,Not necessarily orientated to geographical east.,EPSG,EPSG,2000-06-23 00:00:00,,0
+9919,Plant North,An axis of a local engineering grid 2D or 3D coordinate system.  Plant North is 90 degrees counter-clockwise from the Plant East axis when viewed from above the plane containing the two axes.,Not necessarily orientated to geographical north.,EPSG,EPSG,2000-06-23 00:00:00,,0
+9920,Bin grid I,First axis of seismic bin grid;  positive I is 90 degrees clockwise from positive J-axis when viewed from above the plane containing the two axes.,,EPSG,EPSG,2000-03-07 00:00:00,,0
+9921,Bin grid J,Second axis of seismic bin grid;  positive J is 90 degrees counter-clockwise from positive I-axis when viewed from above the plane containing the two axes.,,EPSG,EPSG,2000-03-07 00:00:00,,0
+9922,Inline,First axis of a seismic bingrid.,"Inline is an ambiguous term, varying by usage.",EPSG,EPSG,2000-03-07 00:00:00,,0
+9923,Crossline,Second axis of a seismic bingrid.,"Crossline is an ambiguous term, varying by usage.",EPSG,EPSG,2000-03-07 00:00:00,,0
+9924,Platform East,An axis of an offshore platform engineering grid 2D or 3D coordinate system.  Platform East is 90 degrees clockwise from the Platform North axis when viewed from above the plane containing the two axes.,Not necessarily orientated to geographical east.,EPSG,EPSG,2000-06-23 00:00:00,,0
+9925,Platform North,An axis of an offshore platform engineering grid 2D or 3D coordinate system.  Platform North is 90 degrees counter-clockwise from the Platform East axis when viewed from above the plane containing the two axes.,Not necessarily orientated to geographical east.,EPSG,EPSG,2000-06-23 00:00:00,,0
+9926,Spherical latitude,"Angle from the equatorial plane to the geocentric point vector, northwards usually treated as positive.",,Open GIS Consortium,EPSG,2002-02-12 00:00:00,,0
+9927,Spherical longitude,"Angle from the prime meridian plane to the meridian plane passing through a point, eastwards usually treated as positive.",,Open GIS Consortium,EPSG,2002-02-12 00:00:00,,0
+9928,Geocentric radius,The distance from the (geocentric) coordinate system origin to a point. The third axis of a spherical coordinate system.,Used to avoid the singularity when the two angles in a 3D polar coordinate system lie in the same plane.,Open GIS Consortium,EPSG,2002-02-12 00:00:00,,0
diff --git a/src/tiff/csv/coordinate_operation.csv b/src/tiff/csv/coordinate_operation.csv
new file mode 100644
index 0000000..7e53fc0
--- /dev/null
+++ b/src/tiff/csv/coordinate_operation.csv
@@ -0,0 +1,2020 @@
+"COORD_OP_CODE","COORD_OP_NAME","COORD_OP_TYPE","SOURCE_CRS_CODE","TARGET_CRS_CODE","COORD_TFM_VERSION","COORD_OP_VARIANT","AREA_OF_USE_CODE","COORD_OP_SCOPE","COORD_OP_METHOD_CODE","UOM_CODE_SOURCE_OFFSETS","UOM_CODE_TARGET_OFFSETS","REMARKS","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","SHOW_OPERATION","DEPRECATED"
+1025,ED50 to ED87 (1),transformation,4230,4231,5Nat-NSea-90,1,2330,?,9630,9102,9102,Latitude differences from ED50 to ED87 in decimal degrees given by coefficients A0 through A14 where m=(latitude - 55) degrees and n=longitude in decimal degrees.  Longitude differences given through coefficients B0 through B14.,Norwegian Mapping Authority publication 1990:1,EPSG,2002-06-22 00:00:00,99.74  2000.55 2002.40,1,0
+1026,Madrid 1870 (Madrid) to ED50 (1),transformation,4903,4230,IGB-Esp,1,2366,?,9617,,,It is preferable to use whichever of either Madrid 1870 (Madrid) to ED50 (2) (code 1002) or Madrid 1870 (Madrid) to ED50 (3) (code 1003) is applicable to the area.,Institut de Geomatica; Barcelona,EPSG,2000-03-07 00:00:00,99.82  99.74,1,0
+1027,Madrid 1870 (Madrid) to ED50 (2),transformation,4903,4230,IGB-Esp N,2,2367,?,9617,,,Use in preference to Madrid 1870 (Madrid) to ED50 (1) (code 1001).,Institut de Geomatica; Barcelona,EPSG,2000-03-07 00:00:00,99.82  99.74,1,0
+1028,Madrid 1870 (Madrid) to ED50 (3),transformation,4903,4230,IGB-Esp S,3,2368,?,9617,,,Use in preference to Madrid 1870 (Madrid) to ED50 (1) (code 1001).,Institut de Geomatica; Barcelona,EPSG,2000-03-07 00:00:00,99.82  99.74,1,0
+1029,Amersfoort / RD New to ED50 / UTM zone 31N (1),transformation,28992,23031,NCG-Nld,1,1172,?,9632,9001,9001,For reverse transformation see ED50 / UTM 31N to Amersfoort / RD New (1) (code 1030).,"Nederlandse Commissie voor Geodesie publication 30; ""Globale en Lokale Geodetische Systemen""; G. Strang van Hees.",EPSG,2000-03-07 00:00:00,,1,0
+1030,ED50 / UTM zone 31N to Amersfoort / RD New (1),transformation,23031,28992,NCG-Nld,1,1172,?,9632,9001,9001,For reverse transformation see Amersfoort / RD New to ED50 / UTM zone 31 (1) (code 1029).,"Nederlandse Commissie voor Geodesie publication 30; ""Globale en Lokale Geodetische Systemen""; G. Strang van Hees.",EPSG,2000-03-07 00:00:00,,1,0
+1031,Amersfoort / RD New to ED50 / UTM zone 31N (2),transformation,28992,23031,NAM-Nld,2,1172,Oil exploration.,9632,9001,9001,Used by NAM.  For reverse transformation see ED50 / UTM zone 31N to Amersfoort / RD New (2) (code 1032).,Shell / NAM,EPSG,2000-03-07 00:00:00,,1,0
+1032,ED50 / UTM zone 31N to Amersfoort / RD New (2),transformation,23031,28992,NAM-Nld,2,1172,Oil exploration.,9632,9001,9001,Used by NAM.  For reverse transformation see Amersfoort / RD New to ED50 / UTM zone 31 (2) (code 1031).,Shell / NAM,EPSG,2000-03-07 00:00:00,,1,0
+1033,Belge 72 / Lambert to ED50 / UTM zone 31N (1),transformation,31300,23031,NCG-Bel,1,1044,?,9631,9001,9001,For reverse transformation see ED50 / UTM 31N to Belge 72 / Lambert (code 1034).,"Nederlandse Commissie voor Geodesie publication 30; ""Globale en Lokale Geodetische Systemen""; G. Strang van Hees.",EPSG,2000-03-07 00:00:00,,1,0
+1034,ED50 / UTM zone 31N to Belge 72 / Lambert (1),transformation,23031,31300,NCG-Bel,1,1044,?,9631,9001,9001,For reverse transformation see Belge 72 / Lambert to ED50 / UTM 31N (code 1033).,"Nederlandse Commissie voor Geodesie publication 30; ""Globale en Lokale Geodetische Systemen""; G. Strang van Hees.",EPSG,2000-03-07 00:00:00,,1,0
+1035,Astra Minas to Campo Inchauspe / Argentina 2,transformation,5800,22192,IHS-Arg ComRiv,1,1265,Oil exploration.,9621,,,,IHS Energy,EPSG,2000-06-23 00:00:00,,1,0
+1036,OSGB 1936 / British National Grid to ETRS89 (1),transformation,27700,4258,OSGB-Gbr,1,1264,Accuracy 0.2m at 67% confidence level.,9633,,,May be taken as approximate transformation OSGB 1936 / British National Grid to WGS 84 - see code 1681.,http://www.gps.gov.uk/gpssurveying.asp,EPSG,2000-10-19 00:00:00,,1,0
+1037,Amersfoort / RD New to ED50 / TM 5 NE (1),transformation,28992,23095,NAM-Nld,1,1630,Oil exploration.,9632,9001,9001,Used by NAM.  For reverse transformation see ED50 / TM 5 NE to Amersfoort / RD New (1) (code 1038).,Shell / NAM,EPSG,2002-07-13 00:00:00,,1,0
+1038,ED50 / TM 5 NE to Amersfoort / RD New (1),transformation,23095,28992,NAM-Nld,2,1630,Oil exploration.,9632,9001,9001,Used by NAM.  For reverse transformation see Amersfoort / RD New to ED50 / TM 5 NE (1) (code 1037).,Shell / NAM,EPSG,2002-07-13 00:00:00,,1,0
+1100,Adindan to WGS 84 (1),transformation,4201,4326,DMA-Eth Sud,1,1271,For military purposes only. Accuracy 5m in each axis.,9603,,,Derived at 22 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1101,Adindan to WGS 84 (2),transformation,4201,4326,DMA-Bfa,2,1057,For military purposes.  Accuracy 25m in each axis.,9603,,,"Derived at 1 station connected to the Adindan network through the 1968-69 12th parallel traverse. Note: Adindan datum is used in Ethiopia and Sudan, not Burkino Faso.",U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,2002-06-22 00:00:00,2002.38,1,0
+1102,Adindan to WGS 84 (3),transformation,4201,4326,DMA-Cmr,3,1060,For military purposes.  Accuracy 25m in each axis.,9603,,,"Derived at 1 station connected to the Adindan network through the 1968-69 12th parallel traverse. Note: Adindan datum is used in Ethiopia and Sudan, not Cameroon.",U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,2002-06-22 00:00:00,2002.38,1,0
+1103,Adindan to WGS 84 (4),transformation,4201,4326,DMA-Eth,4,1091,For military purposes.  Accuracy 3m in each axis.,9603,,,Derived at 8 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1104,Adindan to WGS 84 (5),transformation,4201,4326,DMA-Mli,5,1153,For military purposes.  Accuracy 25m in each axis.,9603,,,"Derived at 1 station connected to the Adindan network through the 1968-69 12th parallel traverse. Note: Adindan datum is used in Ethiopia and Sudan, not Mali.",U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,2002-06-22 00:00:00,2002.38,1,0
+1105,Adindan to WGS 84 (6),transformation,4201,4326,DMA-Sen,6,1207,For military purposes.  Accuracy 25m in each axis.,9603,,,"Derived at 2 stations connected to the Adindan network through the 1968-69 12th parallel traverse. Note: Adindan datum is used in Ethiopia and Sudan, not Senegal.",U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,2002-06-22 00:00:00,2002.38,1,0
+1106,Adindan to WGS 84 (7),transformation,4201,4326,DMA-Sud,7,1221,"For military purposes.  Accuracy 3m, 5m and 3m in X, Y and Z axes.",9603,,,Derived at 14 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1107,Afgooye to WGS 84 (1),transformation,4205,4326,DMA-Som,1,1214,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1108,AGD66 to WGS 84 (1),transformation,4202,4326,DMA-Aus,1,1036,For military purposes only.  Accuracy 3m in each axis.,9603,,,Derived at 105 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1109,AGD84 to WGS 84 (1),transformation,4203,4326,DMA-Aus,1,1036,For military purposes only.  Accuracy 2m in each axis.,9603,,,Derived at 90 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1110,Ain el Abd to WGS 84 (1),transformation,4204,4326,DMA-Bhr,1,1040,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1997-04-11 00:00:00,97.06,1,0
+1111,Ain el Abd to WGS 84 (2),transformation,4204,4326,DMA-Sau,2,1206,For military purposes.  Accuracy 10m in each axis.,9603,,,Derived at 9 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1112,Amersfoort to WGS 84 (1),transformation,4289,4326,NCG-Nld 93,1,1172,?,9606,,,Superseded by Amersfoort to ETRS89 (2) (code 1751) and Amersfoort to WGS 84 (2) (code 1672).,Nederlandse Commissie voor Geodesie publication 30; 1993.,EPSG,1997-04-11 00:00:00,97.07,1,0
+1113,Arc 1950 to WGS 84 (1),transformation,4209,4326,DMA-mean,1,2312,"For military purposes only.  Accuracy 20m, 33m and 20m in X, Y and Z axes.",9603,,,Derived at 41 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1114,Arc 1950 to WGS 84 (2),transformation,4209,4326,DMA-Bwa,2,1051,"For military purposes.  Accuracy 3m, 5m and 3m in X, Y and Z axes.",9603,,,Derived at 9 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1115,Arc 1950 to WGS 84 (3),transformation,4209,4326,DMA-Bdi,3,1058,For military purposes.  Accuracy 20m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1116,Arc 1950 to WGS 84 (4),transformation,4209,4326,DMA-Lso,4,1141,"For military purposes.  Accuracy 3m, 3m and 8m in X, Y and Z axes.",9603,,,Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1117,Arc 1950 to WGS 84 (5),transformation,4209,4326,DMA-Mwi,5,1150,"For military purposes.  Accuracy 9m, 24m and 8m in X, Y and Z axes.",9603,,,Derived at 6 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1118,Arc 1950 to WGS 84 (6),transformation,4209,4326,DMA-Swz,6,1224,For military purposes.  Accuracy 15m in each axis.,9603,,,Derived at 4 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1119,Arc 1950 to WGS 84 (7),transformation,4209,4326,DMA-Cod,7,1259,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1120,Arc 1950 to WGS 84 (8),transformation,4209,4326,DMA-Zmb,8,1260,"For military purposes.  Accuracy 21m, 21m and 27m in X, Y and Z axes.",9603,,,Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1121,Arc 1950 to WGS 84 (9),transformation,4209,4326,DMA-Zwe,9,1261,"For military purposes.  Accuracy 5m, 8m and 11m in X, Y and Z axes.",9603,,,Derived at 10 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1122,Arc 1960 to WGS 84 (1),transformation,4210,4326,DMA-Ken Tza,1,2311,For military purposes only.  Accuracy 20m in each axis.,9603,,,Derived at 25 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1123,Batavia to WGS 84 (1),transformation,4211,4326,DMA-Idn Sumatra,1,1355,For military purposes.  Accuracy 3m in each axis.,9603,,,Note: The area of use cited for this transformation (Sumatra) is not consistent with the area of use (Java) for the Batavia (Genuk) coordinate system. Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1124,Bermuda 1957 to WGS 84 (1),transformation,4216,4326,DMA-Bmu,1,1047,For military purposes.  Accuracy 20m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1125,Bogota 1975 to WGS 84 (1),transformation,4218,4326,DMA-Col,1,1070,"For military purposes.  Accuracy 6m, 5m and 6m in X, Y and Z axes.",9603,,,Derived in 1987 at 7 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1126,Bukit Rimpah to WGS 84 (1),transformation,4219,4326,DMA-Idn BBI,1,1287,For military purposes.,9603,,,Accuracy estimates unavailable.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,2002-06-22 00:00:00,2002.151,1,0
+1127,Campo Inchauspe to WGS 84 (1),transformation,4221,4326,DMA-Arg,1,1033,For military purposes.  Accuracy 5m in each axis.,9603,,,Derived at 20 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1128,Cape to WGS 84 (1),transformation,4222,4326,DMA-Zaf,1,1215,"For military purposes.  Accuracy 3m, 6m and 6m in X, Y and Z axes.",9603,,,Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1129,Cape to WGS 84 (2),transformation,4222,4326,DSLI-Zaf,2,1215,?,9603,,,Parameter values are from Cape to Hartebeesthoek94 (1) (code 1504) assuming that Hartebeesthoek94 and WGS 84 are equivalent within the accuracy of the transformation.,"Private Communication, Directorate of Surveys and Land Information, Cape Town.",EPSG,1996-10-18 00:00:00,,1,0
+1130,Carthage to WGS 84 (1),transformation,4223,4326,DMA-Tun,1,1236,"For military purposes.  Accuracy 6m, 9m and 8m in X, Y and Z axes.",9603,,,Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1131,Chua to WGS 84 (1),transformation,4224,4326,DMA-Pry,1,1188,"For military purposes.  Accuracy 6m, 9m and 5m in X, Y and Z axes.",9603,,,Derived at 6 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1132,Corrego Alegre to WGS 84 (1),transformation,4225,4326,DMA-Bra,1,1053,"For military purposes.  Accuracy 5m, 3m and 5m in X, Y and Z axes.",9603,,,Derived at 17 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1133,ED50 to WGS 84 (1),transformation,4230,4326,DMA-mean,1,2420,"For military purposes only.  Accuracy 3m, 8m and 5m in X, Y and Z axes.",9603,,,Derived at 85 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,97.02,1,0
+1134,ED50 to WGS 84 (2),transformation,4230,4326,DMA-cenEur,2,2421,For military purposes only.  Accuracy 3m each axis.,9603,,,Derived at 52 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1135,ED50 to WGS 84 (3),transformation,4230,4326,DMA-midEast,3,2345,For military purposes only.,9603,,,Accuracy estimate not available.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1136,ED50 to WGS 84 (4),transformation,4230,4326,DMA-Cyp,4,1078,For military purposes only.  Accuracy 15m in each axis.,9603,,,Derived at 4 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1137,ED50 to WGS 84 (5),transformation,4230,4326,DMA-Egy,5,1086,"For military purposes.  Accuracy 6m, 8m and 8m in X, Y and Z axes.",9603,,,Derived at 14 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1138,ED50 to WGS 84 (6),transformation,4230,4326,DMA-Irl Gbr,6,2343,For military purposes only.  Accuracy 3m in each axis.,9603,,,Derived at 40 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1139,ED50 to WGS 84 (7),transformation,4230,4326,DMA-Fin Nor,7,2344,"For military purposes.  Accuracy 3m, 5m and 3m in X, Y and Z axes.",9603,,,Derived at 20 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1140,ED50 to WGS 84 (8),transformation,4230,4326,DMA-Grc,8,1106,For military purposes only.  Accuracy 25m in each axis.,9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1141,ED50(ED77) to WGS 84 (2),transformation,4154,4326,DMA-Irn,2,1123,"For military purposes.  Accuracy 9m, 12m and 11m in X, Y and Z axes.",9603,,,Given by DMA as from ED50.  EPSG interpret that as ED50(ED77) in Iran. Derived at 27 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,2000-03-07 00:00:00,2000.06,1,0
+1142,ED50 to WGS 84 (10),transformation,4230,4326,DMA-Ita Sard,10,2339,For military purposes only.  Accuracy 25m in each axis.,9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1143,ED50 to WGS 84 (11),transformation,4230,4326,DMA-Ita Sic,11,2340,For military purposes only.  Accuracy 20m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1144,ED50 to WGS 84 (12),transformation,4230,4326,DMA-Mlt,12,1154,For military purposes only.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1145,ED50 to WGS 84 (13),transformation,4230,4326,DMA-Prt Esp,13,2338,"For military purposes only.  Accuracy 5m, 6m and 3m in X, Y and Z axes.",9603,,,Derived at 18 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1146,ED87 to WGS 84 (1),transformation,4231,4326,5Nat-NSea-90,1,2330,?,9606,,,,"Norwegian Mapping Authority publication 1990:1 and note of 13-Feb-1991 ""Om Transformasjon mellom Geodetiske Datum i Norge""",EPSG,1997-04-11 00:00:00,97.03  97.04,1,0
+1147,ED50 to ED87 (2),transformation,4230,4231,NMA-Nor N65,2,2331,Geodetic purposes.,9606,,,,"Norwegian Mapping Authority note of 13-Feb-1991 ""Om Transformasjon mellom Geodetiske Datum i Norge""",EPSG,1997-04-11 00:00:00,97.04,1,0
+1148,Egypt 1907 to WGS 84 (1),transformation,4229,4326,DMA-Egy,1,1086,"For military purposes.  Accuracy 3m, 6m and 8m in X, Y and Z axes.",9603,,,Derived at 14 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1149,ETRS89 to WGS 84 (1),transformation,4258,4326,EPSG-eur,1,2420,ETRS89 is a realisation of WGS 84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.,9603,,,,EPSG,EPSG,2000-10-19 00:00:00,97.24  2000.72,1,0
+1150,GDA94 to WGS 84 (1),transformation,4283,4326,EPSG-Aus,1,1036,GDA94 is a realisation of WGS 84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.,9603,,,,EPSG,EPSG,1996-10-18 00:00:00,,1,0
+1151,NZGD49 to WGS 84 (1),transformation,4272,4326,DMA-Nzl,1,1175,"For military purposes only.  Accuracy 5m, 3m and 5m in X, Y and Z axes.",9603,,,Derived at 14 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1152,Hu Tzu Shan to WGS 84 (1),transformation,4236,4326,DMA-Twn,1,1228,For military purposes.  Accuracy 15m in each axis.,9603,,,Derived at 4 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1153,Indian 1954 to WGS 84 (1),transformation,4239,4326,DMA-Tha,1,1231,"For military purposes.  Accuracy 15m, 6m and 12m in X, Y and Z axes.",9603,,,Derived at 11 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1997-04-11 00:00:00,97.06,1,0
+1154,Indian 1975 to WGS 84 (1),transformation,4240,4326,DMA-Tha,1,1231,"For military purposes.  Accuracy 3m, 2m and 3m in X, Y and Z axes.",9603,,,Derived at 62 stations.,U.S. Defense Mapping Agency  TR8350.2 second edition September 1991,EPSG,1996-10-18 00:00:00,,1,0
+1155,Kalianpur 1937 to WGS 84 (1),transformation,4144,4326,DMA-Bgd,1,1041,"For military purposes.  Accuracy 10m, 8m and 12m in X, Y and Z axes.",9603,,,Derived at 6 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1999-10-20 00:00:00,97.235,1,0
+1156,Kalianpur 1975 to WGS 84 (1),transformation,4146,4326,DMA-Ind Npl,1,2411,"For military purposes.  Accuracy 12m, 10m and 15m in X, Y and Z axes.",9603,,,Care!  DMA ellipsoid is inconsistent with EPSG ellipsoid - transformation parameter values may not be appropriate. Derived at 7 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1999-10-20 00:00:00,97.235,1,0
+1157,Kandawala to WGS 84 (1),transformation,4244,4326,DMA-Lka,1,1218,For military purposes.  Accuracy 20m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1158,Kertau to WGS 84 (1),transformation,4245,4326,DMA-Mys Sgp,1,1309,"For military purposes.  Accuracy 10m, 8m and 6m in X, Y and Z axes.",9603,,,Derived at 6 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1159,Leigon to WGS 84 (1),transformation,4250,4326,DMA-Gha,1,1104,"For military purposes.  Accuracy 2m, 3m and 2m in X, Y and Z axes.",9603,,,Derived at 8 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1160,Liberia 1964 to WGS 84 (1),transformation,4251,4326,DMA-Lbr,1,1142,For military purposes only.  Accuracy 15m in each axis.,9603,,,Derived at 4 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1161,Luzon 1911 to WGS 84 (1),transformation,4253,4326,DMA-Phl N,1,2364,"For military purposes.  Accuracy 8m, 11m and 9m in X, Y and Z axes.",9603,,,Derived at 6 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1162,Luzon 1911 to WGS 84 (2),transformation,4253,4326,DMA-Phl Min,2,2365,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1163,M'poraloko to WGS 84 (1),transformation,4266,4326,DMA-Gab,1,1100,For military purposes only.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1164,Mahe 1971 to WGS 84 (1),transformation,4256,4326,DMA-Syc,1,2369,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1165,Massawa to WGS 84 (1),transformation,4262,4326,DMA-Eth,1,1089,For military purposes only.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1166,Merchich to WGS 84 (1),transformation,4261,4326,DMA-Mar,1,1166,"For military purposes.  Accuracy 5m, 3m and 3m in X, Y and Z axes.",9603,,,Derived at 9 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1167,Minna to WGS 84 (1),transformation,4263,4326,DMA-Cmr,1,1060,For military purposes only.  Accuracy 25m in each axis.,9603,,,"Derived at 2 stations.  Note: Minna is used in Nigeria, not Cameroon.",U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1168,Minna to WGS 84 (2),transformation,4263,4326,DMA-Nga,2,1178,"For military purposes.  Accuracy 3m, 6m and 5m in X, Y and Z axes.",9603,,,Derived at 6 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1169,Monte Mario to WGS 84 (1),transformation,4265,4326,DMA-Ita Sar,1,2339,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1170,NAD27 to WGS 84 (1),transformation,4267,4326,DMA-Carib,1,2418,"For military purposes.  Accuracy 3m, 9m and 12m in X, Y and Z axes.",9603,,,Derived at 15 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1171,NAD27 to WGS 84 (2),transformation,4267,4326,DMA-Cen Am,2,2419,"For military purposes only.  Accuracy 8m, 3m and 5m in X, Y and Z axes.",9603,,,Derived at 19 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1172,NAD27 to WGS 84 (3),transformation,4267,4326,DMA-Can,3,1061,"For military purposes only.  Accuracy 15m, 11m and 6m in X, Y and Z axes.",9603,,,Derived at 112 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1173,NAD27 to WGS 84 (4),transformation,4267,4326,DMA-Conus,4,1323,"For military purposes only.  Accuracy 5m, 5m and 6m in X, Y and Z axes.",9603,,,Derived at 405 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1174,NAD27 to WGS 84 (5),transformation,4267,4326,DMA-ConusE,5,2389,"For military purposes only.  Accuracy 5m, 5m and 8m in X, Y and Z axes.",9603,,,Derived at 129 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1175,NAD27 to WGS 84 (6),transformation,4267,4326,DMA-ConusW,6,2390,"For military purposes only.  Accuracy 5m, 3m and 3m in X, Y and Z axes.",9603,,,Derived at 276 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1176,NAD27 to WGS 84 (7),transformation,4267,4326,DMA-USA AK,7,2412,"For military purposes only.  Accuracy 5m, 9m and 5m in X, Y and Z axes.",9603,,,Derived at 47 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1177,NAD27 to WGS 84 (8),transformation,4267,4326,DMA-Bha xSalv,8,2413,"For military purposes.  Accuracy 5m, 3m and 5m in X, Y and Z axes.",9603,,,Derived at 11 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1178,NAD27 to WGS 84 (9),transformation,4267,4326,DMA-Bha Salv,9,2414,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1179,NAD27 to WGS 84 (10),transformation,4267,4326,DMA-Can AB BC,10,2384,"For military purposes only.  Accuracy 8m, 8m and 6m in X, Y and Z axes.",9603,,,Derived at 25 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1180,NAD27 to WGS 84 (11),transformation,4267,4326,DMA-Can MN ON,11,2415,"For military purposes only.  Accuracy 9m, 5m and 5m in X, Y and Z axes.",9603,,,Derived at 25 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1181,NAD27 to WGS 84 (12),transformation,4267,4326,DMA-Can E,12,2416,"For military purposes only.  Accuracy 6m, 6m and 3m in X, Y and Z axes.",9603,,,Derived at 37 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1182,NAD27 to WGS 84 (13),transformation,4267,4326,DMA-Can NWT,13,2410,"For military purposes only.  Accuracy 5m, 5m and 3m in X, Y and Z axes.",9603,,,Derived at 17 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1183,NAD27 to WGS 84 (14),transformation,4267,4326,DMA-Can Yuk,14,2417,"For military purposes only.  Accuracy 5m, 8m and 3m in X, Y and Z axes.",9603,,,Derived at 8 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1184,NAD27 to WGS 84 (15),transformation,4267,4326,DMA-Pan,15,2385,For military purposes.  Accuracy 20m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1185,NAD27 to WGS 84 (16),transformation,4267,4326,DMA-Cuba,16,1077,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1186,NAD27 to WGS 84 (17),transformation,4267,4326,DMA-Grl,17,2386,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1187,NAD27 to WGS 84 (18),transformation,4267,4326,DMA-Mex,18,1160,"For military purposes only.  Accuracy 8m, 6m and 6m in X, Y and Z axes.",9603,,,Derived at 22 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1188,NAD83 to WGS 84 (1),transformation,4269,4326,DMA-N Am,1,1325,Accuracy 2m in each axis.,9603,,,Derived at 312 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,97.06,1,0
+1189,Nahrwan 1967 to WGS 84 (1),transformation,4270,4326,DMA-Omn Mas,1,2391,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1190,Nahrwan 1967 to WGS 84 (2),transformation,4270,4326,DMA-Sau,2,1206,For military purposes.  Accuracy 20m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1191,Nahrwan 1967 to WGS 84 (3),transformation,4270,4326,DMA-UAE,3,1243,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1192,Naparima 1972 to WGS 84 (1),transformation,4271,4326,DMA-Tto,1,1235,For military purposes only.,9603,,,CAUTION: EPSG believes that these parameter values include a blunder and that if NIMA transformation parameters are to be used the 1987 version (EPSG code 1307) be used.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1998-06-30 00:00:00,98.102,1,0
+1193,NTF to WGS 84 (1),transformation,4275,4326,IGN-Fra,1,1096,For applications to an accuracy of 2 metres.,9603,,,,IGN technical report RT/G 14; January 1988.,EPSG,1996-10-18 00:00:00,,1,0
+1195,OSGB 1936 to WGS 84 (1),transformation,4277,4326,DMA-Gbr,1,1264,"For military purposes only.  Accuracy 10m, 10m and 15m in X, Y and Z axes.",9603,,,Derived at 38 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1196,OSGB 1936 to WGS 84 (2),transformation,4277,4326,DMA-Gbr Eng,2,2395,"For military purposes only.  Accuracy 5m, 5m and 6m in X, Y and Z axes.",9603,,,Derived at 24 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1197,OSGB 1936 to WGS 84 (3),transformation,4277,4326,DMA-Gbr E&W,3,2396,"For military purposes only.  Accuracy 10m, 10m and 15m in X, Y and Z axes.",9603,,,Derived at 25 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1198,OSGB 1936 to WGS 84 (4),transformation,4277,4326,DMA-Gbr Sco,4,2397,For military purposes only.  Accuracy 10m in each axis.,9603,,,Derived at 13 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1199,OSGB 1936 to WGS 84 (5),transformation,4277,4326,DMA-Gbr Wal,5,2398,For military purposes only.  Accuracy 20m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1200,Pointe Noire to WGS 84 (1),transformation,4282,4326,DMA-Cog,1,1072,For military purposes only.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1201,PSAD56 to WGS 84 (1),transformation,4248,4326,DMA-mean,1,2399,"For military purposes only.  Accuracy 17m, 27m and 27m in X, Y and Z axes.",9603,,,Derived at 63 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1202,PSAD56 to WGS 84 (2),transformation,4248,4326,DMA-Bol,2,1049,"For military purposes only.  Accuracy 5m, 11m and 14m in X, Y and Z axes.",9603,,,Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1203,PSAD56 to WGS 84 (3),transformation,4248,4326,DMA-Chl N,3,2402,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1204,PSAD56 to WGS 84 (4),transformation,4248,4326,DMA-Chl S,4,2403,For military purposes.  Accuracy 20m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1205,PSAD56 to WGS 84 (5),transformation,4248,4326,DMA-Col,5,1070,For military purposes.  Accuracy 15m in each axis.,9603,,,Derived at 4 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1206,PSAD56 to WGS 84 (6),transformation,4248,4326,DMA-Ecu,6,1085,"For military purposes.  Accuracy 3m, 5m and 3m in X, Y and Z axes.",9603,,,Derived at 11 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1207,PSAD56 to WGS 84 (7),transformation,4248,4326,DMA-Guy,7,1114,"For military purposes.  Accuracy 6m, 14m and 5m in X, Y and Z axes.",9603,,,Derived at 9 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1208,PSAD56 to WGS 84 (8),transformation,4248,4326,DMA-Per,8,1189,"For military purposes only.  Accuracy 6m, 8m and 12m in X, Y and Z axes.",9603,,,Derived at 6 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1209,PSAD56 to WGS 84 (9),transformation,4248,4326,DMA-Ven,9,1251,"For military purposes only.  Accuracy 9m, 14m and 15m in X, Y and Z axes.",9603,,,Derived at 24 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1211,Qornoq to WGS 84 (1),transformation,4287,4326,DMA-Grl S,1,2407,"For military purposes.  Accuracy 25m, 25m and 32m in X, Y and Z axes.",9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,1
+1212,SAD69 to WGS 84 (1),transformation,4291,4326,DMA-mean,1,1341,"For military purposes only.  Accuracy 15m, 6m and 9m in X, Y and Z axes.",9603,,,Derived at 84 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1213,SAD69 to WGS 84 (2),transformation,4291,4326,DMA-Arg,2,1033,For military purposes only.  Accuracy 5m in each axis.,9603,,,Derived at 10 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1214,SAD69 to WGS 84 (3),transformation,4291,4326,DMA-Bol,3,1049,For military purposes.  Accuracy 15m in each axis.,9603,,,Derived at 4 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1215,SAD69 to WGS 84 (4),transformation,4291,4326,DMA-Bra,4,1053,"For military purposes only.  Accuracy 3m, 5m and 5m in X, Y and Z axes.",9603,,,Derived at 22 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1216,SAD69 to WGS 84 (5),transformation,4291,4326,DMA-Chile,5,1066,"For military purposes only.  Accuracy 15m, 8m and 11m in X, Y and Z axes.",9603,,,Derived at 9 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1217,SAD69 to WGS 84 (6),transformation,4291,4326,DMA-Col,6,1070,"For military purposes only.  Accuracy 6m, 6m and 5m in X, Y and Z axes.",9603,,,Derived at 7 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1218,SAD69 to WGS 84 (7),transformation,4291,4326,DMA-Ecu,7,1085,For military purposes.  Accuracy 3m in each axis.,9603,,,Derived at 11 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1219,SAD69 to WGS 84 (8),transformation,4291,4326,DMA-Ecu Gal,8,2356,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1220,SAD69 to WGS 84 (9),transformation,4291,4326,DMA-Guy,9,1114,"For military purposes only.  Accuracy 9m, 5m and 5m in X, Y and Z axes.",9603,,,Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1221,SAD69 to WGS 84 (10),transformation,4291,4326,DMA-Pgy,10,1188,For military purposes.  Accuracy 15m in each axis.,9603,,,Derived at 4 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1222,SAD69 to WGS 84 (11),transformation,4291,4326,DMA-Peru,11,1189,For military purposes.  Accuracy 5m in each axis.,9603,,,Derived at 6 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1223,SAD69 to WGS 84 (12),transformation,4291,4326,DMA-Tto,12,1235,For military purposes only.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1224,SAD69 to WGS 84 (13),transformation,4291,4326,DMA-Ven,13,1251,"For military purposes only.  Accuracy 3m, 6m and 3m in X, Y and Z axes.",9603,,,Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1225,Sapper Hill 1943 to WGS 84 (1),transformation,4292,4326,DMA-Flk E,1,2355,For military purposes.  Accuracy 1m in each axis.,9603,,,Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1226,Schwarzeck to WGS 84 (1),transformation,4293,4326,DMA-Nam,1,1169,For military purposes only.  Accuracy 20m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1227,Tananarive to WGS 84 (1),transformation,4297,4326,DMA-Mdg,1,1149,For military purposes.,9603,,,Accuracy estimate not available.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1228,Timbalai 1948 to WGS 84 (1),transformation,4298,4326,DMA-Borneo,1,1362,"For military purposes.  Accuracy 10m, 10m and 12m in X, Y and Z axes.",9603,,,Derived at 8 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1229,TM65 to WGS 84 (1),transformation,4299,4326,DMA-Ire,1,1305,For military purposes only.  Accuracy 3m in each axis.,9603,,,Derived at 7 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1230,Tokyo to WGS 84 (1),transformation,4301,4326,DMA-Jpn Kor,1,2409,"For military purposes only.  Accuracy 20m, 5m and 20m in X, Y and Z axes.",9603,,,Derived at 31 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,97.06,1,0
+1231,Tokyo to WGS 84 (2),transformation,4301,4326,DMA-Jpn,2,1129,"For military purposes only.  Accuracy 8m, 5m and 8m in X, Y and Z axes.",9603,,,Derived at 16 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1232,Tokyo to WGS 84 (3),transformation,4301,4326,DMA-Kor,3,1135,For military purposes only.  Accuracy 2m in each axis.,9603,,,Derived at 29 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,97.06,1,0
+1233,Tokyo to WGS 84 (4),transformation,4301,4326,DMA-Jpn Ok,4,2408,"For military purposes only.  Accuracy 20m, 5m and 20m in X, Y and Z axes.",9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1996-10-18 00:00:00,,1,0
+1234,Yacare to WGS 84 (1),transformation,4309,4326,DMA-Ury,1,1247,For military purposes.,9603,,,Accuracy estimate not available.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1235,Zanderij to WGS 84 (1),transformation,4311,4326,DMA-Sur,1,1222,"For military purposes.  Accuracy 5m, 5m and 8m in X, Y and Z axes.",9603,,,Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1996-10-18 00:00:00,,1,0
+1236,AGD84 to WGS 84 (2),transformation,4203,4326,Auslig-Aus old,2,1036,Preliminary estimate - now superseded.,9607,,,"""Higgins parameters"". Superseded by AGD84 to GDA94 (2) (code 1280) and AGD84 to WGS 84 (7) (code 1669).",Australian Surveying and Land Information Group - www.auslig.gov.au/geodesy,EPSG,1997-11-13 00:00:00,,1,0
+1237,WGS 72 to WGS 84 (1),transformation,4322,4326,DMA1,1,1262,For scientific purposes.,9606,,,,,EPSG,1996-12-12 00:00:00,,1,0
+1238,WGS 72 to WGS 84 (2),transformation,4322,4326,DMA2,2,1262,For scientific purposes.,9606,,,,,EPSG,1996-12-12 00:00:00,,1,0
+1239,WGS 72BE to WGS 72 (1),transformation,4324,4322,DMA,1,1262,Geodesy.,9606,,,,,EPSG,1996-12-12 00:00:00,,1,0
+1240,WGS 72BE to WGS 84 (1),transformation,4324,4326,DMA,1,2346,Geodesy.,9606,,,,,EPSG,1996-12-12 00:00:00,,1,0
+1241,NAD27 to NAD83 (1),transformation,4267,4269,NGS-Usa Conus,1,2374,"Accuracy at 67% confidence level is 0.15m onshore, 5m nearshore and undetermined farther offshore.",9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,2000-03-07 00:00:00,98.201  98.53  2000.14,1,0
+1243,NAD27 to NAD83 (2),transformation,4267,4269,NGS-Usa AK,2,2373,"Accuracy at 67% confidence level is 0.5m onshore, 5m nearshore and undetermined farther offshore.",9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,2000-03-07 00:00:00,98.201  98.53  2000.14,1,0
+1245,ED50 to WGS 84 (16),transformation,4230,4326,DMA-Tun,16,1236,For military purposes only.  Accuracy 25m in each axis.,9603,,,Derived at 4 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1998-04-16 00:00:00,98.11,1,0
+1246,Herat North to WGS 84 (1),transformation,4255,4326,DMA-Afg,1,1024,For military purposes only.,9603,,,No accuracy estimate available.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1997-04-11 00:00:00,,1,0
+1247,Kalianpur 1962 to WGS 84 (1),transformation,4145,4326,DMA-Pak,1,1184,For military purposes.,9603,,,Care!  DMA ellipsoid is inconsistent with EPSG ellipsoid - transformation parameter values may not be appropriate.  No accuracy estimate available.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1999-10-20 00:00:00,97.235,1,0
+1248,ID74 to WGS 84 (1),transformation,4238,4326,DMA-Idn,1,1122,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,2002-06-22 00:00:00,2002.151,1,0
+1249,NAD27 to WGS 84 (21),transformation,4267,4326,DMA-AK AluE,21,2387,"For military purposes only.  Accuracy 6m, 8m and 10m in X, Y and Z axes.",9603,,,Derived at 6 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1997-04-11 00:00:00,,1,0
+1250,NAD27 to WGS 84 (22),transformation,4267,4326,DMA-AK AluW,22,2388,For military purposes.  Accuracy 10m in each axis.,9603,,,Derived at 5 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1997-04-11 00:00:00,,1,0
+1251,NAD83 to WGS 84 (2),transformation,4269,4326,DMA-AK Alu,2,2157,"For military purposes only.  Accuracy 5m, 2m and 5m in X, Y and Z axes.",9603,,,Derived at 42 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1997-04-11 00:00:00,,1,0
+1252,NAD83 to WGS 84 (3),transformation,4269,4326,DMA-USA Hi,3,1334,For military purposes only.  Accuracy 2m in each axis.,9603,,,Derived at 6 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1997-04-11 00:00:00,,1,0
+1253,Nord Sahara 1959 to WGS 84 (1),transformation,4307,4326,DMA-Alg,1,1026,For military purposes only.  Accuracy 25m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1997-04-11 00:00:00,,1,0
+1254,Pulkovo 1942 to WGS 84 (1),transformation,4284,4326,DMA-Rus,1,1198,For military purposes.,9603,,,Accuracy estimate not available.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1997-04-11 00:00:00,,1,0
+1255,Nord Sahara 1959 to WGS 84 (2),transformation,4307,4326,DMA-Dza N,2,1365,For military purposes only.  Accuracy 25m in each axis.,9603,,,CAUTION:  Source CRS described by DMA as from Voirol 1960. EPSG believes that the data used in the derivation of these parameters contains a blunder.  We recommend using transformation North Sahara 1959 to WGS84 (1) (code 1253). Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,2000-06-23 00:00:00,98.15  2000 [...]
+1256,Fahud to WGS 84 (1),transformation,4232,4326,DMA-Omn,1,1183,"For military purposes.  Accuracy 3m, 3m and 9m in X, Y and Z axes.",9603,,,"Derived at 7 stations. Source CRS  in information source is called ""Oman"".",U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1997-04-11 00:00:00,,1,0
+1258,Bogota 1975 (Bogota) to Bogota 1975 (Greenwich),transformation,4802,4218,IGAC-Col,1,1070,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,99.79,1,1
+1259,Lisbon (Lisbon) to Lisbon (Greenwich),transformation,4803,4207,IGC-Prt,1,1294,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,99.79,1,1
+1260,Makassar (Jakarta) to Makassar,transformation,4804,4257,EPSG-Idn Sulawesi,1,1316,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,99.79,1,0
+1261,MGI (Ferro) to MGI (Greenwich),transformation,4805,4312,BEV-Aut balk,1,1166,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,99.79,1,1
+1262,Monte Mario (Rome) to Monte Mario,transformation,4806,4265,EPSG-Ita,1,1127,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,98.37  99.79,1,0
+1263,Padang (Jakarta) to Padang (Greenwich),transformation,4808,4280,EPSG-Idn Sumatra,1,1355,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,99.79,1,1
+1264,Belge 1950 (Brussels) to Belge 1950,transformation,4809,4215,IGN-Bel,1,1347,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,99.79,1,0
+1265,Tananarive (Paris) to Tananarive,transformation,4810,4297,EPSG-Mdg,1,1149,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,99.79,1,0
+1266,Voirol 1875 (Paris) to Voirol 1875,transformation,4811,4304,IGN-Dza,1,2347,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,99.79,1,0
+1268,Batavia (Jakarta) to Batavia (Greenwich),transformation,4813,4211,EPSG-Idn Java,1,1285,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,99.79,1,1
+1269,RT38 (Stockholm) to RT38 (Greenwich),transformation,4814,4308,NLS-Swe,1,1225,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-11-12 00:00:00,99.79,1,1
+1270,Greek (Athens) to Greek (Greenwich),transformation,4815,4120,NTU-Grc,1,1106,Change of prime meridian.,9601,,,,Topography Department; National Technical University of Athens.,EPSG,1999-11-12 00:00:00,99.79,1,1
+1271,Schwarzeck to WGS 84 (2),transformation,4293,4326,SLI-Nam,2,1169,?,9603,,,Beware!   Schwarzeck CRS uses German legal metres.  Example:  Schwarzeck Lat 19d 35m 46.952s S Long 20d 41m 50.649s E; X=5623409.40 Y=2124618.00 Z=-2125847.62 GLM; X=5623485.86 Y=2124646.89 Z=-2125876.53 m; WGS84 X=5624101.50 Y=2124748.97 Z=2126132.34 m.,Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,1997-11-13 00:00:00,97.48,1,0
+1272,GGRS87 to WGS 84 (1),transformation,4121,4326,Hel-Grc,1,1106,?,9603,,,,Geodesy Department; Public Petroleum Corporation of Greece.,EPSG,1997-06-16 00:00:00,,1,0
+1273,HD72 to ETRS89 (1),transformation,4237,4258,ELTE-Hun,1,1119,?,9607,,,May be taken as approximate transformation HD72 to WGS 84 - see code 1677.,http://lazarus.elte.hu/gb/geodez/geod5.htm,EPSG,1997-11-13 00:00:00,97.47,1,1
+1274,Pulkovo 1942 to LKS94(ETRS89) (1),transformation,4284,4126,HNIT-Ltu,1,1145,?,9607,,,May be taken as approximate transformation Pulkovo 1942 to WGS 84 - see code 1679.,HNIT-BALTIC GeoInfoServisas.,EPSG,1998-03-12 00:00:00,,1,0
+1275,ED50 to WGS 84 (17),transformation,4230,4326,IGN-Fra,17,1096,For applications to an accuracy of 2 metres.,9603,,,,IGN technical report 14 (January 1988).,EPSG,1998-04-16 00:00:00,98.11,1,0
+1276,NTF to ED50 (1),transformation,4275,4230,IGN-Fra,1,1096,For applications to an accuracy of 2 metres.,9603,,,,IGN technical report 7 (October 1981).,EPSG,1997-11-13 00:00:00,,1,0
+1277,NTF to WGS 72 (1),transformation,4275,4322,IGN-Fra,1,1096,For applications to an accuracy of 2 metres.,9603,,,,IGN technical report 7 (October 1981).,EPSG,1997-11-13 00:00:00,,1,0
+1278,AGD66 to GDA94 (1),transformation,4202,4283,Auslig-Aus 5m,1,1036,5m accuracy.,9603,,,Parameter values are given to greater precision but no better accuracy at http://www.dehaa.sa.gov.au/res_inform/sicom/where/geobas14.html  For higher accuracy requirements see various regional transformations.,GDA Technical Manual. http://www.anzlic.org.au/icsm/gdatm/molodens.htm,EPSG,1997-11-13 00:00:00,,1,0
+1279,AGD84 to GDA94 (1),transformation,4203,4283,Auslig-Aus 5m,1,1036,5m accuracy.,9603,,,Parameter values are given to greater precision but no better accuracy at http://www.dehaa.sa.gov.au/res_inform/sicom/where/geobas14.html,GDA Technical Manual. http://www.anzlic.org.au/icsm/gdatm/molodens.htm,EPSG,1997-11-13 00:00:00,,1,0
+1280,AGD84 to GDA94 (2),transformation,4203,4283,Auslig-Aus 1m,2,1036,1m accuracy.,9607,,,Supersedes AGD84 to WGS 84 (2) (code 1236).  May be taken as approximate transformation AGD84 to WGS 84 - see code 1669.,GDA Technical Manual. http://www.anzlic.org.au/icsm/gdatm/simil.htm,EPSG,1997-11-13 00:00:00,,1,0
+1282,Samboja to WGS 84 (1),transformation,4125,4326,TOT-Idn Mah,1,1328,Oil exploration.,9603,,,Datum shift derived through ITRF93.,Total Indonesia.,EPSG,2000-03-07 00:00:00,2000.23,1,1
+1283,LKS94(ETRS89) to WGS 84 (1),transformation,4126,4326,HNIT-Ltu,1,1145,LKS94 is a realisation of WGS 84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.,9603,,,,HNIT-BALTIC GeoInfoServisas.,EPSG,1998-03-12 00:00:00,98.13,1,0
+1284,Arc 1960 to WGS 84 (2),transformation,4210,4326,NIMA-Ken,2,1132,"For military purposes.  Accuracy 4m, 3m and 3m in X, Y and Z axes.",9603,,,Derived at 24 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-03-12 00:00:00,,1,0
+1285,Arc 1960 to WGS 84 (3),transformation,4210,4326,NIMA-Tza,3,1230,"For military purposes.  Accuracy 6m, 9m and 10m in X, Y and Z axes.",9603,,,Derived at 12 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-03-12 00:00:00,,1,0
+1286,Segora to WGS 84 (1),transformation,4294,4326,NIMA-Idn Kal,1,2354,For military purposes.,9603,,,Accuracy estimate not available.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-03-12 00:00:00,,1,1
+1287,Pulkovo 1942 to WGS 84 (3),transformation,4284,4326,NIMA-Hun,3,1119,For military purposes.  Accuracy 2m in each axis.,9603,,,Derived at 5 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-04-16 00:00:00,98.11,1,0
+1288,Pulkovo 1942 to WGS 84 (4),transformation,4284,4326,NIMA-Pol,4,1192,"For military purposes only.  Accuracy 4m, 2m and 4m in X, Y and Z axes.",9603,,,Derived at 11 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-04-16 00:00:00,98.11,1,0
+1289,Pulkovo 1942 to WGS 84 (5),transformation,4284,4326,NIMA-Cze,5,1079,"For military purposes only.  Accuracy 3m, 3m and 2m in X, Y and Z axes.",9603,,,Derived at 6 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-04-16 00:00:00,98.11,1,0
+1290,Pulkovo 1942 to WGS 84 (6),transformation,4284,4326,NIMA-Lva,6,1139,For military purposes.  Accuracy 2m in each axis.,9603,,,Derived at 5 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-04-16 00:00:00,98.11,1,0
+1291,Pulkovo 1942 to WGS 84 (7),transformation,4284,4326,NIMA-Kaz,7,1131,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 2 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-04-16 00:00:00,98.11,1,0
+1292,Pulkovo 1942 to WGS 84 (8),transformation,4284,4326,NIMA-Alb,8,1025,For military purposes.  Accuracy 3m in each axis.,9603,,,Derived at 7 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-04-16 00:00:00,98.11,1,0
+1293,Pulkovo 1942 to WGS 84 (9),transformation,4284,4326,NIMA-Rom,9,1197,"For military purposes.  Accuracy 3m, 5m and 3m in X, Y and Z axes.",9603,,,Derived at 4 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-04-16 00:00:00,98.11,1,0
+1294,Voirol 1875 to WGS 84 (1),transformation,4304,4326,NIMA-Dza N,1,2347,For military purposes.,9603,,,Accuracy estimate not available.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,1998-03-12 00:00:00,,1,0
+1296,Trinidad 1903 to WGS 84 (1),transformation,4302,4326,Amoco-Tto Trin,1,1339,Oil exploration.,9603,,,Derived in 1989 by ONI for Amoco.,Trinidad Ministry of Energy and Energy Industries.,EPSG,1998-11-11 00:00:00,98.38,1,0
+1297,Tete to Moznet (1),transformation,4127,4130,DNGC-Moz,1,1167,Residuals as high as 30 metres.,9607,,,Mean of 32 stations. To reduce the size of the residuals; four regional parameter sets (see codes 1298-1301) were developed. May be taken as approximate transformation Moznet to WGS 84 - see code 1683.,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+1298,Tete to Moznet (2),transformation,4127,4130,DNGC-Moz A,2,2350,Residuals are generally under 1 metre.,9607,,,Mean of 9 stations. May be taken as approximate transformation Moznet to WGS 84 - see code 1684.,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+1299,Tete to Moznet (3),transformation,4127,4130,DNGC-Moz B,3,2351,Residuals are generally under 4 metres.,9607,,,Mean of 6 stations. May be taken as approximate transformation Moznet to WGS 84 - see code 1685.,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+1300,Tete to Moznet (4),transformation,4127,4130,DNGC-Moz C,4,2352,Residuals are generally under 3 metres.,9607,,,Mean of 11 stations. May be taken as approximate transformation Moznet to WGS 84 - see code 1686.,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+1301,Tete to Moznet (5),transformation,4127,4130,DNGC-Moz D,5,2353,Residuals are 5-10 metres.,9607,,,Mean of 7 stations. May be taken as approximate transformation Moznet to WGS 84 - see code 1687.,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+1302,Moznet to WGS 84 (1),transformation,4130,4326,EPSG-Moz,1,1167,For many purposes Moznet can be considered to be coincident with WGS 84. Accuracy better than 1 metre.,9607,,,,EPSG,EPSG,1998-04-16 00:00:00,,1,0
+1303,Pulkovo 1942 to WGS 84 (10),transformation,4284,4326,KCS-Kaz Cas,10,2405,Residuals under 2 m.,9606,,,Mean of 13 stations along entire Kazak coastline.,KazakCaspiShelf consortium.,EPSG,2000-02-02 00:00:00,2000.05,1,0
+1304,Indian 1975 to WGS 84 (2),transformation,4240,4326,NIMA-Tha,2,1231,"For military purposes.  Accuracy 3m, 2m and 3m in X, Y and Z axes.",9603,,,Derived at 62 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-04-16 00:00:00,,1,0
+1305,Tokyo to WGS 84 (5),transformation,4301,4326,NIMA-Kor,5,1135,For military purposes.,9603,,,Derived at 29 stations.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-04-16 00:00:00,,1,0
+1306,MGI to WGS 84 (1),transformation,4312,4326,NIMA-balk,1,2370,For military purposes only.,9603,,,Accuracy estimate not available.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,1998-04-16 00:00:00,,1,0
+1307,Naparima 1972 to WGS 84 (3),transformation,4271,4326,NIMA-Tto Tob,3,1322,For military purposes only.  Accuracy 15m in each axis.,9603,,,(1) See remarks for tfm code 1192.  (2) Naparima 1972 is an extension to Tobago of the Napaima 1955 geographic CRS of Trindad.  In Trinidad this transformation may also be considered to use Napaima 1955 (code 4158) as its source CRS: see tfm code 1556.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,1998-04-16 00:00:00,,1,0
+1308,NAD83 to WGS 84 (4),transformation,4269,4326,NGS-Usa ITRF94,4,1323,Historical record only - superseded - see remarks.,9607,,,Strictly between NAD83 and ITRF94(1996.0).  Superseded by NAD83 to WGS 84 (5) (code 1515).,US National Geodetic Survey  http://www.ngs.noaa.gov/CORS/Derivation.html,EPSG,1999-04-22 00:00:00,99.12  99.38,1,0
+1309,DHDN to ETRS89 (1),transformation,4314,4258,IfAG-Deu W,1,2326,For applications with an accuracy at 5 m level.,9607,,,Mean of 69 stations. May be taken as approximate transformation DHDN to WGS 84 - see code 1673. Also given by EuroGeographics at http://crs.ifag.de/ as a Position Vector transformation with changed values for rotations.,Institute for Cartography and Geodesy; Leipzig.,EPSG,2000-10-19 00:00:00,2000.72,1,0
+1310,Pulkovo 1942 to ETRS89 (1),transformation,4284,4258,IfAG-Deu E,1,1343,Residuals under 2 m.,9607,,,Mean of 20 stations.,Institute for Cartography and Geodesy; Leipzig.,EPSG,2000-10-19 00:00:00,2000.72,1,1
+1311,ED50 to WGS 84 (Common Offshore),transformation,4230,4326,UKOOA-CO,18,2342,Recommended transformation for UKCS petroleum purposes.,9606,,,Based on ED50 to WGS72 (precise ephemeris) 6-nations agreement of 1981 to which precise to broadcast and broadcast to WGS 84 transformations have been concatenated.,The Hydrographic Journal; vol 52 page 50.,EPSG,1998-06-30 00:00:00,98.27,1,0
+1312,NAD27 to NAD83 (3),transformation,4267,4269,GC-Can NT1,3,1061,Historic record only - now superseded - see remarks.,9614,,,Uses NTv1 method.  Superseded in Quebec by code 1462 and elsewhere in 1997 by NTv2 (transformation code 1313).  Input expects longitudes to be positive west; EPSG GeogCRS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.,Geomatics Canada - Geodetic Survey Division.,EPSG,2000-03-07 00:00:00,98.57  2000.14,1,0
+1313,NAD27 to NAD83 (4),transformation,4267,4269,GC-Can NT2,4,1061,Accuracy 1-2 metres.,9615,,,Uses NTv2 data files.  Supersedes  NTv1 (transformation code 1312) except in Quebec.  Input expects longitudes to be positive west; EPSG GeogCRS NAD27 (code 4267) and (code 4269) have longitudes positive east.,http://www.geod.nrcan.gc.ca/products/html-public/GSDapps/English/NTv2_Fact_Sheet.html,EPSG,2000-03-07 00:00:00,98.57  2000.14,1,0
+1314,OSGB 1936 to WGS 84 (Petroleum),transformation,4277,4326,UKOOA-Pet,6,2394,Oil exploration. Accuracy better than 4m and generally better than 2m.,9606,,,For a more accurate transformation see OSGB 1936 / British National Grid to ETRS89 (1) (code 1036): contact the Ordnance Survey of Great Britain (http://www.gps.gov.uk/gpssurveying.asp) for details.,UK Offshore Operators Association. Also at EuroGeographics at http://crs.ifag.de,EPSG,1998-11-11 00:00:00,,1,0
+1315,OSGB 1936 to ED50 (UKOOA),transformation,4277,4230,UKOOA-UKCS,1,2394,For oil exploration. Accuracy better than 4m and generally better than 2m.,9606,,,This transformation is concatenated from OSGB36 to WGS 84 (Petroleum) (code 1314) minus ED50 to WGS 84 (Common Offshore) (code 1311).,UK Offshore Operators Association.,EPSG,1998-11-11 00:00:00,,1,0
+1316,Manoca to WGS 84 (1),transformation,4260,4326,SCS-Cmr,1,1060,?,9603,,,,Stolt Comex Seaway and Geoid for Elf.,EPSG,1998-11-11 00:00:00,,1,1
+1317,Camacupa to WGS 72BE (1),transformation,4220,4324,GSI-Ago,1,1604,Oil exploration.,9603,,,Derived by Geophysical Services Inc. in 1979 from mean of Transit results at 7 stations.,EPSG,EPSG,1998-11-11 00:00:00,,1,0
+1318,Camacupa to WGS 84 (1),transformation,4220,4326,CON-Ago B5,1,2316,Used for oil exploration by Conoco.,9603,,,,EPSG,EPSG,1998-11-11 00:00:00,,1,0
+1319,Camacupa to WGS 84 (2),transformation,4220,4326,TEX-Ago B2,2,2317,Used for oil exploration by Texaco.,9603,,,,EPSG,EPSG,1998-11-11 00:00:00,,1,0
+1320,Camacupa to WGS 84 (3),transformation,4220,4326,SHL-Ago old,3,2321,Used by Shell prior to 1994.,9606,,,Superseded by Camacupa to WGS 84 (9).,EPSG,EPSG,1998-12-14 00:00:00,98.56,1,0
+1321,Camacupa to WGS 84 (4),transformation,4220,4326,GSI-Ago,4,2320,Used for oil exploration.,9603,,,"Derived as mean of 123 Transit passes at station Cabo Ledo NE base in November 1990. Used by Elf for block 7 up to December 1992 then superseded by Camacupa to WGS 84 (7). Used by Total in block 8, ExxonMobil block 24, Western Geophysical for spec. data.",EPSG,EPSG,2000-03-07 00:00:00,2000.16,1,0
+1322,Camacupa to WGS 84 (5),transformation,4220,4326,ELF-Ago B3 old,5,2318,Used for oil exploration by Elf for block 3 up to December 1992 then Superseded by Camacupa to WGS 84 (7).,9603,,,Derived at station Djeno during coordination of platform PAL F2 in February 1992.,EPSG,EPSG,1998-11-11 00:00:00,,1,0
+1323,Camacupa to WGS 84 (6),transformation,4220,4326,ELF-Ago B7 old,6,2319,Used for oil exploration by Elf for 1993 block 7 shallow water survey.,9603,,,Derived at Luanda observatory December 1992.,EPSG,EPSG,1998-11-11 00:00:00,,1,0
+1324,Camacupa to WGS 84 (7),transformation,4220,4326,ELF-Ago B15,7,2322,"Used for oil exploration by Elf for blocks 3, 7 and 17 between December 1992 and 1994 then Superseded by Camacupa to WGS 84 (10).  Used by Exxon for block 15 since 1993.",9603,,,Derived at platform PAL F2 in December 1992.,EPSG,EPSG,1998-11-11 00:00:00,,1,0
+1325,Camacupa to WGS 84 (8),transformation,4220,4326,ELF-Ago B2 old,8,2317,Used for oil exploration by Total for block 2 between December 1992 and 1994 then Superseded by Camacupa to WGS 84 (10).,9603,,,Derived at platform PAL F2 in December 1992.,EPSG,EPSG,1998-11-11 00:00:00,,1,0
+1326,Camacupa to WGS 84 (9),transformation,4220,4326,SHL-Ago B16,9,2323,Used by Shell since 1994.,9606,,,Supersedes Camacupa to WGS 84 (3).,EPSG,EPSG,1998-12-14 00:00:00,98.56,1,0
+1327,Camacupa to WGS 84 (10),transformation,4220,4326,ELF-Ago N,10,2324,Used for oil exploration by Elf in blocks 3 and 17 since 1994.  Used by Total in block 2 since 1994. Adopted by BP-Amoco Elf and Exxon for blocks 31-33.,9603,,,Derived at platform PAL F2 in 1994 by Topnav using Doris.,EPSG,EPSG,1998-11-11 00:00:00,,1,0
+1328,Malongo 1987 to Mhast (1),transformation,4259,4264,CHV-Ago Cab,1,1317,Used for oil exploration.,9603,,,Malongo 1987 is an offshore extension of Mhast adopted by Chevron in 1987.,EPSG,EPSG,1998-11-11 00:00:00,,1,0
+1329,Mhast to WGS 84 (1),transformation,4264,4326,CHV-Ago Cab,1,1317,"Used for oil exploration by Chevron until superseded in 1990 by trf Malongo 1987 to WGS 84 (2), code 1557.",9603,,,"Superseded in 1990 by trf Malongo 1987 to WGS 84 (2), code 1557.  Malongo 1987 is an offshore extension of the Mhast cooordinate system.",Chevron.,EPSG,1998-11-11 00:00:00,,1,0
+1330,Malongo 1987 to WGS 84 (1),transformation,4259,4326,CHV-Ago Cab89,1,1317,"Used for oil exploration by Chevron until superseded in 1990 by trf Malongo 1987 to WGS 84 (2), code 1557.",9603,,,Derived at Station Y in 1989 via WGS72.,Chevron.,EPSG,1998-11-11 00:00:00,,1,0
+1331,EST92 to ETRS89 (1),transformation,4133,4258,UT-Est,1,1090,?,9607,,,,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,2000-10-19 00:00:00,2000.72,1,0
+1332,Pulkovo 1942 to EST92 (1),transformation,4284,4133,UT-Est,1,1090,?,9607,,,,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,1998-12-14 00:00:00,,1,0
+1333,EST92 to WGS 84 (1),transformation,4133,4326,UT-Est,1,1090,?,9607,,,,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,1998-12-14 00:00:00,,1,0
+1334,Pulkovo 1942 to WGS 84 (12),transformation,4284,4326,UT-Est,12,1090,?,9607,,,,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,1998-12-14 00:00:00,,1,0
+1335,Tokyo to WGS 84 (6),transformation,4301,4326,GSI-Jpn 452141,6,2425,For medium accuracy.,9618,,,,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,1998-12-12 00:00:00,,1,1
+1336,Tokyo to WGS 84 (7),transformation,4301,4326,GSI-Jpn 452142,7,2426,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1337,Tokyo to WGS 84 (8),transformation,4301,4326,GSI-Jpn 444141,8,2427,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1338,Tokyo to WGS 84 (9),transformation,4301,4326,GSI-Jpn 444142,9,2428,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1339,Tokyo to WGS 84 (10),transformation,4301,4326,GSI-Jpn 440141,10,2429,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1340,Tokyo to WGS 84 (11),transformation,4301,4326,GSI-Jpn 440142,11,2430,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1341,Tokyo to WGS 84 (12),transformation,4301,4326,GSI-Jpn 440143,12,2431,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1342,Tokyo to WGS 84 (13),transformation,4301,4326,GSI-Jpn 440144,13,2432,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1343,Tokyo to WGS 84 (14),transformation,4301,4326,GSI-Jpn 432141,14,2433,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1344,Tokyo to WGS 84 (15),transformation,4301,4326,GSI-Jpn 432142,15,2434,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1345,Tokyo to WGS 84 (16),transformation,4301,4326,GSI-Jpn 432143,16,2435,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1346,Tokyo to WGS 84 (17),transformation,4301,4326,GSI-Jpn 432144,17,2436,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1347,Tokyo to WGS 84 (18),transformation,4301,4326,GSI-Jpn 432145,18,2437,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1348,Tokyo to WGS 84 (19),transformation,4301,4326,GSI-Jpn 424140,19,2438,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1349,Tokyo to WGS 84 (20),transformation,4301,4326,GSI-Jpn 424141,20,2439,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,99.77 2002.08,1,0
+1350,Tokyo to WGS 84 (21),transformation,4301,4326,GSI-Jpn 424142,21,2440,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1351,Tokyo to WGS 84 (22),transformation,4301,4326,GSI-Jpn 424143,22,2441,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1352,Tokyo to WGS 84 (23),transformation,4301,4326,GSI-Jpn 424144,23,2442,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1353,Tokyo to WGS 84 (24),transformation,4301,4326,GSI-Jpn 424145,24,2443,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1354,Tokyo to WGS 84 (25),transformation,4301,4326,GSI-Jpn 420139,25,2444,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1355,Tokyo to WGS 84 (26),transformation,4301,4326,GSI-Jpn 420140,26,2445,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1356,Tokyo to WGS 84 (27),transformation,4301,4326,GSI-Jpn 420141,27,2446,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1357,Tokyo to WGS 84 (28),transformation,4301,4326,GSI-Jpn 420142,28,2447,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1358,Tokyo to WGS 84 (29),transformation,4301,4326,GSI-Jpn 420143,29,2448,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1359,Tokyo to WGS 84 (30),transformation,4301,4326,GSI-Jpn 412140,30,2449,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1360,Tokyo to WGS 84 (31),transformation,4301,4326,GSI-Jpn 412141,31,2450,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1361,Tokyo to WGS 84 (32),transformation,4301,4326,GSI-Jpn 404140,32,2451,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1362,Tokyo to WGS 84 (33),transformation,4301,4326,GSI-Jpn 404141,33,2452,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1363,Tokyo to WGS 84 (34),transformation,4301,4326,GSI-Jpn 400139,34,2453,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1364,Tokyo to WGS 84 (35),transformation,4301,4326,GSI-Jpn 400140,35,2454,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1365,Tokyo to WGS 84 (36),transformation,4301,4326,GSI-Jpn 400141,36,2455,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1366,Tokyo to WGS 84 (37),transformation,4301,4326,GSI-Jpn 392139,37,2456,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1367,Tokyo to WGS 84 (38),transformation,4301,4326,GSI-Jpn 392140,38,2457,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1368,Tokyo to WGS 84 (39),transformation,4301,4326,GSI-Jpn 392141,39,2458,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1369,Tokyo to WGS 84 (40),transformation,4301,4326,GSI-Jpn 384139,40,2459,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1370,Tokyo to WGS 84 (41),transformation,4301,4326,GSI-Jpn 384140,41,2460,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1371,Tokyo to WGS 84 (42),transformation,4301,4326,GSI-Jpn 384141,42,2461,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1372,Tokyo to WGS 84 (43),transformation,4301,4326,GSI-Jpn 380139,43,2462,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1373,Tokyo to WGS 84 (44),transformation,4301,4326,GSI-Jpn 380140,44,2463,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1374,Tokyo to WGS 84 (45),transformation,4301,4326,GSI-Jpn 380141,45,2464,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1375,Tokyo to WGS 84 (46),transformation,4301,4326,GSI-Jpn 372136,46,2465,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1376,Tokyo to WGS 84 (47),transformation,4301,4326,GSI-Jpn 372137,47,2466,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1377,Tokyo to WGS 84 (48),transformation,4301,4326,GSI-Jpn 372138,48,2467,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1378,Tokyo to WGS 84 (49),transformation,4301,4326,GSI-Jpn 372139,49,2468,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1379,Tokyo to WGS 84 (50),transformation,4301,4326,GSI-Jpn 372140,50,2469,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1380,Tokyo to WGS 84 (51),transformation,4301,4326,GSI-Jpn 372141,51,2470,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1381,Tokyo to WGS 84 (52),transformation,4301,4326,GSI-Jpn 364136,52,2471,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1382,Tokyo to WGS 84 (53),transformation,4301,4326,GSI-Jpn 364137,53,2472,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1383,Tokyo to WGS 84 (54),transformation,4301,4326,GSI-Jpn 364138,54,2473,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1384,Tokyo to WGS 84 (55),transformation,4301,4326,GSI-Jpn 364139,55,2474,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1385,Tokyo to WGS 84 (56),transformation,4301,4326,GSI-Jpn 364140,56,2475,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1386,Tokyo to WGS 84 (57),transformation,4301,4326,GSI-Jpn 360136,57,2476,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1387,Tokyo to WGS 84 (58),transformation,4301,4326,GSI-Jpn 360137,58,2477,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1388,Tokyo to WGS 84 (59),transformation,4301,4326,GSI-Jpn 360138,59,2478,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1389,Tokyo to WGS 84 (60),transformation,4301,4326,GSI-Jpn 360139,60,2479,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1390,Tokyo to WGS 84 (61),transformation,4301,4326,GSI-Jpn 360140,61,2480,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1391,Tokyo to WGS 84 (62),transformation,4301,4326,GSI-Jpn 352132,62,2481,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1392,Tokyo to WGS 84 (63),transformation,4301,4326,GSI-Jpn 352133,63,2482,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1393,Tokyo to WGS 84 (64),transformation,4301,4326,GSI-Jpn 352134,64,2483,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1394,Tokyo to WGS 84 (65),transformation,4301,4326,GSI-Jpn 352135,65,2484,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1395,Tokyo to WGS 84 (66),transformation,4301,4326,GSI-Jpn 352136,66,2485,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1396,Tokyo to WGS 84 (67),transformation,4301,4326,GSI-Jpn 352137,67,2486,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1397,Tokyo to WGS 84 (68),transformation,4301,4326,GSI-Jpn 352138,68,2487,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1398,Tokyo to WGS 84 (69),transformation,4301,4326,GSI-Jpn 352139,69,2488,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1399,Tokyo to WGS 84 (70),transformation,4301,4326,GSI-Jpn 352140,70,2489,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1400,Tokyo to WGS 84 (71),transformation,4301,4326,GSI-Jpn 344132,71,2490,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1401,Tokyo to WGS 84 (72),transformation,4301,4326,GSI-Jpn 344133,72,2491,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1402,Tokyo to WGS 84 (73),transformation,4301,4326,GSI-Jpn 344134,73,2492,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1403,Tokyo to WGS 84 (74),transformation,4301,4326,GSI-Jpn 344135,74,2493,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1404,Tokyo to WGS 84 (75),transformation,4301,4326,GSI-Jpn 344136,75,2494,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1405,Tokyo to WGS 84 (76),transformation,4301,4326,GSI-Jpn 344137,76,2495,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1406,Tokyo to WGS 84 (77),transformation,4301,4326,GSI-Jpn 344138,77,2496,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1407,Tokyo to WGS 84 (78),transformation,4301,4326,GSI-Jpn 344139,78,2497,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1408,Tokyo to WGS 84 (79),transformation,4301,4326,GSI-Jpn 344140,79,2498,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1409,Tokyo to WGS 84 (80),transformation,4301,4326,GSI-Jpn 340130,80,2499,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1410,Tokyo to WGS 84 (81),transformation,4301,4326,GSI-Jpn 340131,81,2500,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1411,Tokyo to WGS 84 (82),transformation,4301,4326,GSI-Jpn 340132,82,2501,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1412,Tokyo to WGS 84 (83),transformation,4301,4326,GSI-Jpn 340133,83,2502,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1413,Tokyo to WGS 84 (84),transformation,4301,4326,GSI-Jpn 340134,84,2503,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1414,Tokyo to WGS 84 (85),transformation,4301,4326,GSI-Jpn 340135,85,2504,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1415,Tokyo to WGS 84 (86),transformation,4301,4326,GSI-Jpn 340136,86,2505,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1416,Tokyo to WGS 84 (87),transformation,4301,4326,GSI-Jpn 340137,87,2506,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1417,Tokyo to WGS 84 (88),transformation,4301,4326,GSI-Jpn 340138,88,2507,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1418,Tokyo to WGS 84 (89),transformation,4301,4326,GSI-Jpn 332129,89,2508,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1419,Tokyo to WGS 84 (90),transformation,4301,4326,GSI-Jpn 332130,90,2509,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1420,Tokyo to WGS 84 (91),transformation,4301,4326,GSI-Jpn 332131,91,2510,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1421,Tokyo to WGS 84 (92),transformation,4301,4326,GSI-Jpn 332132,92,2511,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1422,Tokyo to WGS 84 (93),transformation,4301,4326,GSI-Jpn 332133,93,2512,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1423,Tokyo to WGS 84 (94),transformation,4301,4326,GSI-Jpn 332134,94,2513,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1424,Tokyo to WGS 84 (95),transformation,4301,4326,GSI-Jpn 332135,95,2514,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1425,Tokyo to WGS 84 (96),transformation,4301,4326,GSI-Jpn 332136,96,2515,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1426,Tokyo to WGS 84 (97),transformation,4301,4326,GSI-Jpn 324129,97,2516,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1427,Tokyo to WGS 84 (98),transformation,4301,4326,GSI-Jpn 324130,98,2517,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1428,Tokyo to WGS 84 (99),transformation,4301,4326,GSI-Jpn 324131,99,2518,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1429,Tokyo to WGS 84 (100),transformation,4301,4326,GSI-Jpn 324132,100,2519,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1430,Tokyo to WGS 84 (101),transformation,4301,4326,GSI-Jpn 324133,101,2520,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1431,Tokyo to WGS 84 (102),transformation,4301,4326,GSI-Jpn 324134,102,2521,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1432,Tokyo to WGS 84 (103),transformation,4301,4326,GSI-Jpn 320130,103,2522,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1433,Tokyo to WGS 84 (104),transformation,4301,4326,GSI-Jpn 320131,104,2523,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1434,Tokyo to WGS 84 (105),transformation,4301,4326,GSI-Jpn 320132,105,2524,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1435,Tokyo to WGS 84 (106),transformation,4301,4326,GSI-Jpn 312130,106,2525,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1436,Tokyo to WGS 84 (107),transformation,4301,4326,GSI-Jpn 312131,107,2526,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,2002.08,1,0
+1437,RT90 to ETRS89 (1),transformation,4124,4258,NLS-Swe,1,1225,Accuracy 0.5m.,9607,,,This transformation is actually between ETRS89 and RR92.  RR92 is a geographic 3D coordinate system where the horizontal component is RT90. Also at EuroGeographics; http:/crs.ifag.de/ with change of rotation convention (transformation method). Derived at,National Land Survey of Sweden.,EPSG,2000-10-19 00:00:00,99.11  2000.72,1,0
+1438,Fahud to WGS 84 (2),transformation,4232,4326,PDO-Omn,2,1183,Oil exploration.,9606,,,,Petroleum Development Oman,EPSG,1999-04-22 00:00:00,,1,0
+1439,PSD93 to WGS 84 (1),transformation,4134,4326,PDO-Omn 97,1,1183,Oil exploration. Residuals 0.5m at 67% probability level.,9606,,,Superseded PSD93 to WGS 84 (2) (code 8581) in 1997.,Petroleum Development Oman,EPSG,2001-06-05 00:00:00,2000.28,1,0
+1440,ED50 to WGS 84 (19),transformation,4230,4326,HEL-Grc,19,1106,Used in oil industry.,9603,,,,Geodesy Department; Hellenic Petroleum s.a.,EPSG,1999-04-22 00:00:00,,1,0
+1441,Antigua 1943 to WGS 84 (1),transformation,4601,4326,DOS-Atg Ant,1,1273,?,9603,,,,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+1442,Dominica 1945 to WGS 84 (1),transformation,4602,4326,DOS-Dma,1,1082,?,9603,,,,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+1443,Grenada 1953 to WGS 84 (1),transformation,4603,4326,DOS-Grd,1,1108,?,9603,,,,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+1444,Montserrat 1958 to WGS 84 (1),transformation,4604,4326,DOS-Msr,1,1165,?,9603,,,,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+1445,St. Kitts 1955 to WGS 84 (1),transformation,4605,4326,DOS-Kna,1,1200,?,9603,,,,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+1446,St. Lucia 1955 to WGS 84 (1),transformation,4606,4326,DOS-Lca,1,1201,?,9603,,,,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+1447,Anguilla 1957 to WGS 84 (1),transformation,4600,4326,DOS-Aia,1,1030,?,9619,,,,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+1450,ED50 to WGS 84 (20),transformation,4230,4326,NMA-Nor 6265W,20,2333,Oil exploration before 1997/2001.,9620,,,Valid 1991-1997. Superseded in 1997 by ED50 to WGS 84 (22) (code 1590) and in 2001 by ED50 to WGS 84 (23) (code 1612).,"Norwegian Mapping Authority note of 13-Feb-1991 ""Om Transformasjon mellom Geodetiske Datum i Norge"".",EPSG,2000-03-07 00:00:00,2000.14,1,0
+1451,NAD27(CGQ77) to NAD83 (1),transformation,4609,4269,SGQ-Can QC NT1,1,1368,Historic record only - now superseded - see remarks.,9614,,,Superseded by NAD27(CGQ77) to NAD83 (2) (code 1575).  Uses NT method which expects longitudes positive west; EPSG GeogCRSs CGQ77 (code 4609) and NAD83 (code 4269) have longitudes positive east.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,2000-03-07 00:00:00,2000.14,1,0
+1454,Old Hawaiian to NAD83 (1),transformation,4135,4269,NGS-Usa HI,1,1334,Accuracy at 67% confidence level is 0.2m.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs Old Hawaiian (code 4135) and NAD83 (code 4269) have longitudes positive east.  NADCON data converts from Old Hawaiian Datum to but makes the transformation appear to be from NAD27.,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,2000-03-07 00:00:00,2000.14,1,0
+1455,St. Lawrence Island to NAD83 (1),transformation,4136,4269,NGS-Usa AK StL,1,1332,Accuracy 0.5m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs St. Lawrence (code 4136) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from St. Lawrence Datum to but makes the transformation appear to be from NAD27.,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,2000-03-07 00:00:00,2000.14,1,0
+1456,St. Paul Island to NAD83 (1),transformation,4137,4269,NGS-Usa AK StP,1,1333,Accuracy 0.5m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs St. Paul (code 4137) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from St. Paul Datum to but makes the transformation appear to be from NAD27.,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,2000-03-07 00:00:00,2000.14,1,0
+1457,St. George Island to NAD83 (1),transformation,4138,4269,NGS-Usa AK StG,1,1331,Accuracy 0.5m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs St. George (code 4138) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from St. George Datum to but makes the transformation appear to be from NAD27.,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,2000-03-07 00:00:00,2000.14,1,0
+1458,AGD66 to GDA94 (2),transformation,4202,4283,Auslig-ACT 1m,2,2283,Recommended for mid-accuracy use in A.C.T.  1m accuracy.,9607,,,For higher accuracy requirements see AGD66 to GDA94 (10) (code 1596).  May be taken as approximate transformation AGD66 to WGS 84 - see code 1665.,GDA Technical Manual. http://www.anzlic.org.au/icsm/gdatm/regional.htm,EPSG,1999-05-25 00:00:00,,1,0
+1459,AGD66 to GDA94 (3),transformation,4202,4283,Auslig-Tas 1m old,3,1282,1m accuracy.,9607,,,Superseded in 2000 by AGD66 to GDA94 (8) (code 1594). Differences are sub-metre.,GDA Technical Manual version Dec 1998. http://www.anzlic.org.au/icsm/gdatm/regional.htm,EPSG,1999-05-25 00:00:00,2000.68,1,0
+1460,AGD66 to GDA94 (4),transformation,4202,4283,Auslig-NSW Vic 1m,4,2286,Recommended for mid-accuracy use in NSW and Victoria.  1m accuracy.,9607,,,For higher accuracy requirements see AGD66 to GDA94 (10) (code 1596).  May be taken as approximate transformation AGD66 to WGS 84 - see code 1666.,GDA Technical Manual. http://www.anzlic.org.au/icsm/gdatm/regional.htm,EPSG,1999-05-25 00:00:00,,1,0
+1461,Puerto Rico to NAD83 (1),transformation,4139,4269,NGS-PRVI,1,1335,Accuracy 0.05m at 67% confidence level.,9613,,,,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,2000-03-07 00:00:00,2000.14,1,0
+1462,NAD27 to NAD83 (5),transformation,4267,4269,SGQ-Can QC NT1,5,1368,Historic record only - now superseded - see remarks.,9614,,,Densification for Quebec of code 1312. Superseded by NAD27 to NAD83 (6) (code 1573).  Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,2000-03-07 00:00:00,2000.14,1,0
+1463,NAD27(76) to NAD83 (1),transformation,4608,4269,SGQ-Can Ont,1,1367,?,9615,,,Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD27(76) (code 4608) and NAD83 (code 4269) have longitudes positive east. May be taken as approximate transformation NAD27(76) to WGS 84 - see code 1690.,Geodetic Survey of Canada   http://www.geod.emr.ca/html-public/GSDapps/English/NTv2_Fact_Sheet.html,EPSG,2000-03-07 00:00:00,2000.14,1,0
+1464,AGD66 to GDA94 (5),transformation,4202,4283,OSG-Aus Vic old,5,2285,0.1m accuracy.,9615,,,Superseded by AGD66 to GDA94 (10) (code 1596) and then by AGD66 to GDA94 (11) (code 1803).  Input expects longitudes to be positive west; EPSG GeogCRS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.,http://www.osg.vic.gov.au/tools.htm,EPSG,2000-03-07 00:00:00,99.67  2000.14  2000.68,1,0
+1466,NGO 1948 (Oslo) to NGO1948 (Greenwich),transformation,4817,4273,NGO-Nor,1,1352,Change of prime meridian.,9601,,,,"J. Danielsen; ""Transformasjoner ved Norges Geografiske Oppm�ling""; Kart Og Plan nr 1; 1982.",EPSG,1999-11-12 00:00:00,99.79,1,1
+1467,NTF (Paris) to NTF (Greenwich) (1),transformation,4807,4275,IGN-Fra,1,1096,Change of prime meridian.,9601,,,,IGN Paris.,EPSG,1999-11-12 00:00:00,99.63  99.79,1,1
+1468,NTF (Paris) to NTF (Greenwich) (2),transformation,4807,4275,RGS,2,1096,Change of prime meridian.,9601,,,EPSG prefers value from IGN Paris (code 1467).,Royal Geographic Society; London,EPSG,1999-11-12 00:00:00,99.63  99.79,1,1
+1469,Locodjo 1965 to WGS 84 (1),transformation,4142,4326,IGN-Civ,1,2282,?,9603,,,,IGN Paris,EPSG,1999-10-20 00:00:00,,1,0
+1470,Abidjan 1987 to WGS 84 (1),transformation,4143,4326,IGN-Civ,1,2282,?,9603,,,,IGN Paris,EPSG,1999-10-20 00:00:00,,1,0
+1471,MGI to WGS 84 (2),transformation,4312,4326,BEV-Aut,1,1037,For applications to an accuracy of 1.5 metres.,9606,,,,Bundesamt f�r Eich- und Vermessungswesen,EPSG,1999-10-20 00:00:00,,1,1
+1472,ATS77 to NAD83(CSRS98) (1),transformation,4122,4140,GIC-Can NB,1,1447,?,9615,,,Introduced in 1999. Can be taken as an approximate transformation ATS77 to WGS 84 - see code 1688.,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,2000-10-19 00:00:00,2000.14  2000.66,1,1
+1473,NAD83(CSRS98) to WGS 84 (1),transformation,4140,4326,EPSG-Can,1,1336,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,9603,,,For many purposes NAD83(CSRS98) can be considered to be coincident with WGS 84.,EPSG,EPSG,1999-10-20 00:00:00,,1,1
+1474,NAD83 to NAD83(HARN) (1),transformation,4269,4152,NGS-Usa AL,1,1372,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.  May be taken as approximate transformation NAD83-WGS 84 - see code 1717.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1475,NAD83 to NAD83(HARN) (2),transformation,4269,4152,NGS-Usa AZ,2,1373,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1728.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1476,NAD83 to NAD83(HARN) (3),transformation,4269,4152,NGS-Usa CA n,3,2297,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1739.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1477,NAD83 to NAD83(HARN) (4),transformation,4269,4152,NGS-Usa CA s,4,2298,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1750.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1478,NAD83 to NAD83(HARN) (5),transformation,4269,4152,NGS-Usa CO,5,1376,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1712.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1479,NAD83 to NAD83(HARN) (6),transformation,4269,4152,NGS-Usa GA,6,1380,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1713.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1480,NAD83 to NAD83(HARN) (7),transformation,4269,4152,NGS-Usa FL,7,1379,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1714.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1481,NAD83 to NAD83(HARN) (8),transformation,4269,4152,NGS-Usa ID MT e,8,2382,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.  May be taken as approximate transformation NAD83-WGS 84 - see code 1715.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1482,NAD83 to NAD83(HARN) (9),transformation,4269,4152,NGS-Usa ID MT w,9,2383,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1716.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1483,NAD83 to NAD83(HARN) (10),transformation,4269,4152,NGS-Usa KY,10,1386,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1718.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1484,NAD83 to NAD83(HARN) (11),transformation,4269,4152,NGS-Usa LA,11,1387,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1719.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1485,NAD83 to NAD83(HARN) (12),transformation,4269,4152,NGS-Usa DE MD,12,2377,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1720.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1486,NAD83 to NAD83(HARN) (13),transformation,4269,4152,NGS-Usa ME,13,1388,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1721.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1487,NAD83 to NAD83(HARN) (14),transformation,4269,4152,NGS-Usa MI,14,1391,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1722.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1488,NAD83 to NAD83(HARN) (15),transformation,4269,4152,NGS-Usa MS,15,1393,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1723.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1489,NAD83 to NAD83(HARN) (16),transformation,4269,4152,NGS-Usa NE,16,1396,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1724.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1490,NAD83 to NAD83(HARN) (17),transformation,4269,4152,NGS-Usa NewEng,17,2378,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1725.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1491,NAD83 to NAD83(HARN) (18),transformation,4269,4152,NGS-Usa NM,18,1400,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1726.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1492,NAD83 to NAD83(HARN) (19),transformation,4269,4152,NGS-Usa NY,19,1401,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1727.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1493,NAD83 to NAD83(HARN) (20),transformation,4269,4152,NGS-Usa ND,20,1403,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1729.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1494,NAD83 to NAD83(HARN) (21),transformation,4269,4152,NGS-Usa OK,21,1405,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1730.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1495,NAD83 to NAD83(HARN) (22),transformation,4269,4152,NGS-PRVI,22,1335,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1731.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1496,NAD83 to NAD83(HARN) (23),transformation,4269,4152,NGS-Usa SD,23,1410,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1732.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1497,NAD83 to NAD83(HARN) (24),transformation,4269,4152,NGS-Usa TN,24,1411,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1733.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1498,NAD83 to NAD83(HARN) (25),transformation,4269,4152,NGS-Usa TX e,25,2379,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1734.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1499,NAD83 to NAD83(HARN) (26),transformation,4269,4152,NGS-Usa TX w,26,2380,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1735.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1500,NAD83 to NAD83(HARN) (27),transformation,4269,4152,NGS-Usa VA,27,1415,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1736.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1501,NAD83 to NAD83(HARN) (28),transformation,4269,4152,NGS-Usa OR WA,28,2381,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1737.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1502,NAD83 to NAD83(HARN) (29),transformation,4269,4152,NGS-Usa WI,29,1418,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1738.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1503,NAD83 to NAD83(HARN) (30),transformation,4269,4152,NGS-Usa WY,30,1419,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1740.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-03-07 00:00:00,99.931  2000.14,1,0
+1504,Cape to Hartebeesthoek94 (1),transformation,4222,4148,DSM-Zaf,1,1215,?,9603,,,Also used to transform Cape to WGS 84 - see code 1129.,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-01-06 00:00:00,99.96,1,0
+1505,Hartebeesthoek94 to WGS 84 (1),transformation,4148,4326,EPSG-Zaf,1,1215,For many purposes Hartebeesthoek94 datum can be considered to be coincident with WGS 84.,9603,,,,EPSG,EPSG,2000-01-06 00:00:00,99.96,1,0
+1506,AGD66 to GDA94 (6),transformation,4202,4283,OSG-Tas 0.1m,6,1282,0.1m accuracy.,9615,,,Superseded by AGD66 to GDA94 (11) (code 1803). Input expects longitudes to be positive west; EPSG GeogCRS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.,http://www.delm.tas.gov.au/osg/Geodetic_transform.htm,EPSG,2000-03-07 00:00:00,2000.14,1,0
+1507,AGD66 to GDA94 (7),transformation,4202,4283,Auslig-NT 0.1m,7,2284,0.1m accuracy.,9615,,,Superseded by AGD66 to GDA94 (11) (code 1803). Input expects longitudes to be positive west; EPSG GeogCRS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.,GDA Technical Manual. http://www.anzlic.org.au/icsm/gdatm/chapter7.htm#high,EPSG,2000-03-07 00:00:00,2000.14,1,0
+1508,CH1903 to WGS 84 (1),transformation,4149,4326,BfL-CH 1,1,1286,?,9607,,,Implemented in Bundesamt f�r Landestopographie programme GRANIT.,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,1999-10-20 00:00:00,,1,1
+1509,CH1903+ to CHTRF95 (1),transformation,4150,4151,BfL-CH,1,1286,For applications to an accuracy of 0.1 metres.,9603,,,This transformation is also given as CH1903+ to ETRS89 (1) (code 1647). CHTRF95 is a realisation of ETRS89. May be taken as approximate transformation CH1903+ to WGS 84 - see code 1676.,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,1999-10-20 00:00:00,,1,0
+1510,CH1903 to WGS 84 (2),transformation,4149,4326,BfL-CH 2,2,1286,Accuracy 1.5 metres.,9603,,,These parameters are strictly between CH1903+ and CHTRF95 but are used from CH1903 as an approximation which is within the accuracy of the distortions in the CH1903 network.,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,1999-10-20 00:00:00,,1,1
+1511,CHTRF95 to WGS 84 (1),transformation,4151,4326,EPSG-CH,1,1286,For many purposes CHTRF95 can be considered to be coincident with WGS 84.,9603,,,,EPSG,EPSG,1999-10-20 00:00:00,,1,0
+1512,Rassadiran to WGS 84 (1),transformation,4153,4326,TOT-Irn Taheri,1,1338,Oil industry engineering survey. Used only for terminal site.,9603,,,Derived in 1998 at Assaluyeh (Taheri refinery) by Geoid for Total. Used for South Pars phases 2 and 3.,Total-Fina,EPSG,1999-10-20 00:00:00,,1,0
+1513,FD58 to WGS 84 (1),transformation,4132,4326,TOT-Irn Kangan,1,2362,Oil exploration.,9603,,,Derived in 1998 in Kangan district by Geoid for Total. Used for South Pars phases 2 and 3.,Total-Fina,EPSG,1999-10-20 00:00:00,,1,0
+1514,ED50(ED77) to WGS 84 (1),transformation,4154,4326,NCCI-Irn,1,1123,?,9606,,,"Used for South Pars phases 6, 7 and 8.",National Cartographic Centre of Iran,EPSG,1999-10-20 00:00:00,,1,0
+1515,NAD83 to WGS 84 (5),transformation,4269,4326,NGS-Usa ITRF96,5,1323,Geodesy.,9607,,,Strictly between NAD83 and ITRF96(1997.0).  Supersedes NAD83 to WGS 84 (4) (code 1308)., http://www.ngs.noaa.gov/CORS/Derivation.html,EPSG,1999-11-05 00:00:00,,1,0
+1516,La Canoa to WGS 84 (1),transformation,4247,4326,LAG-Ven E,1,2363,Parameter values estimated accuracy: � 2.0m;  � 2.7m;  � 1.3m respectively.,9603,,,Also used for PSAD56 to WGS 84 transformations.,"Lagoven; Gonzalez Losano y Rodriguez; ""Determination de los Parametros de Transformacion para el Oriente del Pais""; VII Venezuelan Geophysical Congress; September 1994.",EPSG,1999-11-05 00:00:00,,1,0
+1517,Conakry 1905 to WGS 84 (1),transformation,4315,4326,IGN-Gin,1,1112,?,9603,,,,IGN Paris,EPSG,1999-12-09 00:00:00,,1,0
+1518,Dabola 1981 to WGS 84 (1),transformation,4155,4326,IGN-Gin,1,1112,?,9603,,,,IGN Paris,EPSG,1999-12-09 00:00:00,,1,0
+1519,Bern 1898 (Bern) to CH1903 (Greenwich),transformation,4801,4149,BfL-CH,1,1286,Change of prime meridian.,9601,,,,EPSG,EPSG,1999-12-09 00:00:00,,1,1
+1520,NAD83 to NAD83(HARN) (31),transformation,4269,4152,NGS-Usa HI,31,1334,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1741.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+1521,NAD83 to NAD83(HARN) (32),transformation,4269,4152,NGS-Usa IN,32,1383,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1742.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,2000-01-06 00:00:00,,1,0
+1522,NAD83 to NAD83(HARN) (33),transformation,4269,4152,NGS-Usa KS,33,1385,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1743.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+1523,NAD83 to NAD83(HARN) (34),transformation,4269,4152,NGS-Usa NV,34,1397,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1744.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+1524,NAD83 to NAD83(HARN) (35),transformation,4269,4152,NGS-Usa OH,35,1404,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1745.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+1525,NAD83 to NAD83(HARN) (36),transformation,4269,4152,NGS-Usa UT,36,1413,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1746.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+1526,NAD83 to NAD83(HARN) (37),transformation,4269,4152,NGS-Usa WV,37,1417,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1747.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+1527,Campo Inchauspe to WGS 84 (2),transformation,4221,4326,TOT-Arg Neu,2,2325,Oil exploration.,9603,,,Derived through ties at 2 stations (Cerro Colorado and Chihuido Sur) to 4 IGS stations,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+1528,Chos Malal 1914 to Campo Inchauspe (1),transformation,4160,4221,TOT-Arg Neu,1,2325,Oil exploration. Accuracy 10 metres.,9603,,,Derived through common coordinates at 5 stations.,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+1529,Hito XVIII to WGS 84 (1),transformation,4254,4326,TOT-Arg TdF,1,2357,Oil exploration.,9606,,,,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+1530,NAD27 to WGS 84 (30),transformation,4267,4326,ICH-Cub,30,1077,?,9603,,,,Institut Cubano di Hidrografia (ICH),EPSG,2000-03-07 00:00:00,,1,0
+1531,Nahrwan 1967 to WGS 84 (4),transformation,4270,4326,TOT-UAE Abk,4,2392,Oil exploration.,9603,,,,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+1532,M'poraloko to WGS 84 (2),transformation,4266,4326,Elf-Gab94,2,1100,Oil exploration.,9603,,,Derived as mean of Doris determinations at 3 stations in Port Gentil area.,TotalFinaElf,EPSG,2000-03-07 00:00:00,,1,0
+1533,Kalianpur 1937 to WGS 84 (2),transformation,4144,4326,TOT-Mmr Moat,2,2361,Oil exploration.,9603,,,,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+1534,Minna to WGS 84 (3),transformation,4263,4326,SHL-Nig S,3,2371,Oil exploration.,9606,,,,Shell Petroleum Development Company,EPSG,2000-03-07 00:00:00,,1,1
+1536,Nahrwan 1967 to WGS 84 (5),transformation,4270,4326,B&R-Qat off,5,1346,Oil exploration.,9603,,,Derived by Brown & Root in 1992 for Qatar General Petroleum Corporation North Field development. Adopted by QGPC for all offshore Qatar.,Qatar General Petroleum Corporation and Total-Fina,EPSG,2000-03-07 00:00:00,2000.53,1,0
+1537,Indian 1975 to WGS 84 (3),transformation,4240,4326,Fug-Tha,3,2358,Oil exploration.,9603,,,Derived in 1995 at point RTSD181.,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+1538,Carthage to WGS 84 (2),transformation,4223,4326,Elf-Tun,2,1489,Oil exploration.,9603,,,Derived at station Chaffar January 1995.,Total / Elf,EPSG,2000-03-07 00:00:00,,1,0
+1539,South Yemen to Yemen NGN96 (1),transformation,4164,4163,IGN-Yem South,1,1340,?,9603,,,,IGN Paris,EPSG,2000-03-07 00:00:00,,1,0
+1540,Yemen NGN96 to WGS 84 (1),transformation,4163,4326,IGN-Yem,1,1257,Accuracy better than 1 metre.,9603,,,,IGN Paris,EPSG,2000-03-07 00:00:00,,1,0
+1541,Indian 1960 to WGS 72BE (1),transformation,4131,4324,PV-Vnm,1,1495,Oil exploration.,9603,,,Derived in Vung Tau area by Technical Navigation for Deminex in 1978.,PetroVietnam,EPSG,2000-03-07 00:00:00,,1,0
+1542,Indian 1960 to WGS 84 (2),transformation,4131,4326,DMA-Vnm 16N,2,2359,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,2000-03-07 00:00:00,,1,0
+1543,Indian 1960 to WGS 84 (3),transformation,4131,4326,DMA-Vnm ConSon,3,2360,For military purposes.  Accuracy 25m in each axis.,9603,,,Derived at 1 station.,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,2000-03-07 00:00:00,,1,0
+1544,Hanoi 1972 to WGS 84 (1),transformation,4147,4326,BP-Vnm,1,1494,Oil exploration.,9603,,,Derived in Vung Tau area.,BP Amoco,EPSG,2000-03-07 00:00:00,,1,0
+1545,Egypt 1907 to WGS 72 (1),transformation,4229,4322,MCE-Egy,1,1086,?,9603,,,,UK Mapping and Charting Establishment,EPSG,2000-03-07 00:00:00,,1,0
+1546,Egypt 1907 to WGS 84 (3),transformation,4229,4326,Racal-Egy GoS,3,2341,Used for oil exploration by GUPCO.,9603,,,,Maridive,EPSG,2000-03-07 00:00:00,,1,0
+1547,Bissau to WGS 84 (1),transformation,4165,4326,DMA-Gnb,1,1113,For military purposes only.  Accuracy 25m in each axis.,9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 second edition September 1991,EPSG,2000-03-07 00:00:00,,1,0
+1548,SAD69 to WGS 84 (14),transformation,4291,4326,IGBE-Bra,14,1053,Medium and small scale mapping.,9603,,,Derived by Brazilean Institute of Geography and Statistics (IGBE) in 1989. Used by ANP.,Agencia Nacional do Petroleo (ANP).,EPSG,2000-03-07 00:00:00,,1,0
+1549,Aratu to WGS 84 (1),transformation,4208,4326,PB-Bra Camp,1,2307,Oil exploration.,9603,,,,Petrobras.,EPSG,2000-03-07 00:00:00,,1,0
+1550,Aratu to WGS 84 (2),transformation,4208,4326,PB-Bra TucN,2,2308,Oil exploration.,9603,,,,Petrobras.,EPSG,2000-03-07 00:00:00,,1,0
+1551,Aratu to WGS 84 (3),transformation,4208,4326,PB-Bra TucC,3,2309,Oil exploration.,9603,,,,Petrobras.,EPSG,2000-03-07 00:00:00,,1,0
+1552,Aratu to WGS 84 (4),transformation,4208,4326,PB-Bra TucS,4,2310,Oil exploration.,9603,,,,Petrobras.,EPSG,2000-03-07 00:00:00,,1,0
+1553,NAD83 to NAD83(HARN) (38),transformation,4269,4152,NGS-Usa IL,38,1382,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1748.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+1554,NAD83 to NAD83(HARN) (39),transformation,4269,4152,NGS-Usa NJ,39,1399,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1749.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+1555,Naparima 1955 to WGS 84 (2),transformation,4158,4326,Amoco-Tto Trin,2,1339,Oil exploration.,9603,,,Derived in 1989 by ONI for Amoco.,Trinidad Ministry of Energy and Energy Industries.,EPSG,2000-03-07 00:00:00,2000.351,1,0
+1556,Naparima 1955 to WGS 84 (3),transformation,4158,4326,NIMA-Tto Trin,3,1339,For military purposes.,9603,,,Described by NIMA as Naparima 1972 to WGS 84.  In Trinidad the source CRS is better known as Napaima 1955. EPSG has duplicated the tfm using the alternative source CRSs.  See also tfm code 1307.,EPSG after U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,2000-03-07 00:00:00,2000.351,1,0
+1557,Malongo 1987 to WGS 84 (2),transformation,4259,4326,CHV-Ago Cab90,2,1317,Used for oil exploration by Chevron since 1990.,9603,,,Supersedes trf code 1330.  Derived at station Y.,Chevron.,EPSG,2000-05-08 00:00:00,,1,0
+1558,Korean 1995 to WGS 84 (1),transformation,4166,4326,NIMA-Kor,1,1135,For military purposes. Accuracy better than 1 metre.,9603,,,Derived at 5 stations.,NIMA TR8350.2  ftp://164.214.2.65/pub/gg/tr8350.2/changes.pdf,EPSG,2000-06-10 00:00:00,,1,0
+1559,AGD84 to GDA94 (3),transformation,4203,4283,DOLA-Aus WA 0.1m old,3,1280,0.1m accuracy.,9615,,,Superseded by AGD84 to GDA94 (4) (code 1593) (binary file format error) and then by AGD84 to GDA94 (5) (code 1804). Input expects longitudes to be positive west; EPSG GeogCRS AGD84 (code 4203) and GDA94 (code 4283) both have longitudes positive east.,http://www.dola.wa.gov.au/lotl/survey_geodesy/gda1994/download.html,EPSG,2000-06-10 00:00:00,2000.68,1,1
+1560,Nord Sahara 1959 to WGS 72BE (1),transformation,4307,4324,CGG-Alg HM,1,2393,Oil exploration.,9603,,,Derived at IGN monument CFP19 using Transit.,Various oil company sources.,EPSG,2000-06-23 00:00:00,,1,0
+1561,Qatar 1974 to WGS 84 (1),transformation,4285,4326,DMA-Qat,1,1195,For military purposes only.  Accuracy 20m in each axis.,9603,,,Derived at 3 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,2000-10-19 00:00:00,,1,0
+1562,Qatar 1974 to WGS 84 (2),transformation,4285,4326,B&R-Qat off,2,2406,Oil exploration.,9603,,,Derived by Brown & Root in 1992 for Qatar General Petroleum Corporation.,Qatar General Petroleum Corporation and Total-Fina,EPSG,2000-10-19 00:00:00,,1,0
+1563,Qatar 1974 to WGS 84 (3),transformation,4285,4326,CGIS-Qat,3,1346,Oil exploration.,9603,,,Derived by Qatar Centre for GIS.  See Qatar 1974 to WGS 84 (2) (code 1562) for transformation used by QGPC for offshore petroleum industry.,Qatar Centre for GIS,EPSG,2000-10-19 00:00:00,,1,0
+1564,NZGD49 to WGS 84 (2),transformation,4272,4326,OSG-Nzl 4m,2,1175,Transformation accuracy about 4 metres.,9607,,,These parameter values are taken from NZGD49 to NZGD2000 (4) (code 1701) and assume that NZGD2000 and WGS 84 are coincident to within the accuracy of the transformation. For improved accuracy use NZGD49 to WGS 84 (4) (code 1670).,Land Information New Zealand Office of Surveyor General policy statement 97/3.,EPSG,2000-10-19 00:00:00,,1,0
+1565,NZGD2000 to WGS 84 (1),transformation,4167,4326,OSG-Nzl,1,1175,Assumes NZGD2000 is coincident to WGS 84 to the 1m accuracy level.,9603,,,,http://www.linz.govt.nz/services/surveysystem/osgpublications/nzgd2000_trans.html,EPSG,2000-10-19 00:00:00,,1,0
+1566,NZGD49 to NZGD2000 (1),transformation,4272,4167,OSG-Nzl 5m,1,1175,5m accuracy.,9603,,,For better accuracy use  NZGD49 to NZGD2000 (4) (code 1701) or NZGD49 to NZGD2000 (3) (code 1568).,http://www.linz.govt.nz/services/surveysystem/osgpublications/nzgd2000_trans.html,EPSG,2000-10-19 00:00:00,,1,0
+1567,NZGD49 to NZGD2000 (2),transformation,4272,4167,OSG-Nzl 4m,2,1175,4m accuracy.,9607,,,4m accuracy.  For better accuracy use NZGD49 to NZGD2000 (3) (code 1568),http://www.linz.govt.nz/services/surveysystem/osgpublications/nzgd2000_trans.html,EPSG,2000-10-19 00:00:00,,1,1
+1568,NZGD49 to NZGD2000 (3),transformation,4272,4167,OSG-Nzl 1m,3,1175,0.2m accuracy.,9615,,,These same parameter values may be used to transform to WGS 84 - see NZGD49 to WGS 84 (4) (code 1670).,http://www.linz.govt.nz/services/surveysystem/osgpublications/nzgd2000_trans.html,EPSG,2000-10-19 00:00:00,,1,0
+1569,Accra to WGS 84 (1),transformation,4168,4326,MCE-Gha,1,1104,Military survey,9603,,,Derived at 3 common points.,Ordnance Survey International,EPSG,2000-10-19 00:00:00,,1,0
+1570,Accra to WGS 72BE (1),transformation,4168,4324,GSI-Gha,1,1505,Oil exploration.,9603,,,Derived be single point Transit observation at several locations.,Various oil industry sources,EPSG,2000-10-19 00:00:00,,1,0
+1571,Amersfoort to ETRS89 (1),transformation,4258,4326,NCG-Nld 2000,1,1172,Accuracy 0.5m,9607,,,"Dutch sources also quote an equivalent transformation with parameter values dX=+593.032 dY=+26.000 dZ=+478.741m, rX rY rZ and dS as this tfm. These values belong to a different transformation method and cannot be used with the Coordinate Frame method.",http://rdnap.kadaster.nl/rd/index.html  Also Nederlandse Commissie voor Geodesie publication 30; 3rd edition 1997.  Also with change of method [...]
+1572,NAD83 to NAD83(CSRS98) (1),transformation,4269,4140,SGQ-Can QC,1,1368,Accuracy 1-2 metres.,9615,,,Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(CSRS98) (code 4140) have longitudes positive east. Can be taken as an approximate transformation NAD83 to WGS 84 - see code 1696.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,2000-10-19 00:00:00,,1,1
+1573,NAD27 to NAD83 (6),transformation,4267,4269,SGQ-Can QC NT2,6,1368,Accuracy 1-2 metres.,9615,,,Supersedes NAD27 to NAD83 (5) (code 1462).  Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,2000-10-19 00:00:00,,1,0
+1574,NAD27 to NAD83(CSRS98) (1),transformation,4267,4140,SGQ-Can QC,1,1368,Accuracy 1-2 metres.,9615,,,Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD27 (code 4267) and NAD83(CSRS98) (code 4140) have longitudes positive east. Can be taken as an approximate transformation NAD27 to WGS 84 - see code 1692.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,2000-10-19 00:00:00,,1,1
+1575,NAD27(CGQ77) to NAD83 (2),transformation,4609,4269,SGQ-Can QC NT2,2,1368,Accuracy 1-2 metres.,9615,,,Supersedes NAD27(CGQ77) to NAD83 (1) (code 1451).  Uses NT method which expects longitudes positive west; EPSG GeogCRSs CGQ77 and NAD83 (codes 4609 and 4269) have longitudes positive east. Can be taken as approx transformation to WGS 84 - see code 1691.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,2000-10-19 00:00:00,,1,0
+1576,NAD27(CGQ77) to NAD83(CSRS98) (1),transformation,4609,4140,SGQ-Can QC,1,1368,Accuracy 1-2 metres.,9615,,,Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD27(CGQ77) (code 4609) and NAD83(CSRS98) (code 4140) have longitudes positive east. Can be taken as an approximate transformation NAD27(CGQ77) to WGS 84 - see code 1691.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,2000-10-19 00:00:00,,1,1
+1577,American Samoa 1962 to WGS 84 (1),transformation,4169,4326,NIMA-Asm,1,1027,For military purposes. One sigma uncertainty is 25m in each axis.,9603,,,Transformation based on observations at 2 stations in 1993.,NIMA TR8350.2 revision of January 2000.,EPSG,2000-10-19 00:00:00,,1,0
+1578,American Samoa 1962 to NAD83(HARN) (1),transformation,4169,4152,NGS-Asm W,1,2288,Geodetic survey. No accuracy stated.,9613,,,NADCON method which expects longitudes positive west; EPSG GeogCRSs American Samoa 1962 and NAD83(HARN) (codes 4169 and 4159) have longitudes positive east.  NADCON expects latitudes in northern hemisphere and values must be made positive prior to input.,ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon/samoa_readme.txt,EPSG,2000-10-19 00:00:00,,1,0
+1579,American Samoa 1962 to NAD83(HARN) (2),transformation,4169,4152,NGS-Asm E,2,2289,Geodetic survey. No accuracy stated.,9613,,,NADCON method which expects longitudes positive west; EPSG GeogCRSs American Samoa 1962 and NAD83(HARN) (codes 4169 and 4159) have longitudes positive east.  NADCON expects latitudes in northern hemisphere and values must be made positive prior to input.,ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon/samoa_readme.txt,EPSG,2000-10-19 00:00:00,,1,0
+1580,NAD83(HARN) to WGS 84 (1),transformation,4152,4326,EPSG-Usa,1,2424,Approximation at the +/- 1m level assuming that NAD83(HARN) is equivalent to WGS 84.,9603,,,For many purposes NAD83(HARN) can be considered to be coincident with WGS 84.,EPSG,EPSG,2000-10-19 00:00:00,,1,0
+1581,SIRGAS to WGS 84 (1),transformation,4170,4326,NIMA-S America,1,1341,For military purposes.,9603,,,,NIMA TR8350.2 revision of January 2000.,EPSG,2000-10-19 00:00:00,2001.33,1,0
+1582,PSAD56 to WGS 84 (10),transformation,4248,4326,TOT-Bol  Mad,10,2400,Oil exploration.,9603,,,Derived May 1995 by Geoid for Total.  OSU91A geoid model used.,TotalFinaElf,EPSG,2000-10-19 00:00:00,,1,0
+1583,PSAD56 to WGS 84 (11),transformation,4248,4326,TOT-Bol  B20,11,2401,Oil exploration.,9603,,,Derived July 1997 by Geoid from data recorded by UGA for Total.  OSU91A geoid model used.,Total-Fina,EPSG,2000-10-19 00:00:00,,1,0
+1584,Deir ez Zor to WGS 72BE (1),transformation,4227,4324,GECO-Syr,1,2329,Oil exploration.,9603,,,Derived by Transit at station 254 Deir.,Elf,EPSG,2000-10-19 00:00:00,,1,0
+1585,Deir ez Zor to WGS 84 (2),transformation,4227,4326,IGN-Syr,2,1227,?,9603,,,,IGN Paris,EPSG,2000-10-19 00:00:00,,1,0
+1586,Deir ez Zor to WGS 84 (3),transformation,4227,4326,SHL-Syr Whal,3,2327,Oil exploration.,9606,,,Derived in 1995.,Elf,EPSG,2000-10-19 00:00:00,,1,0
+1587,Deir ez Zor to WGS 84 (4),transformation,4227,4326,ELF-Syr Shad,4,2328,Oil exploration.,9603,,,Derived at four stations by Topnav in 1997.,Elf,EPSG,2000-10-19 00:00:00,,1,0
+1588,ED50 to ETRS89 (1),transformation,4230,4258,NMA-Nor N65 1997,1,2332,Accuracy 1m.,9606,,,Included in Statens Kartverk programme wsktrans from 1997. The same parameter values were adopted for ED50 to WGS84 (variant 23) transformation offshore Norway north of 62N from April 2001 - see code 1612.,Statens Kartverk.,EPSG,2001-06-05 00:00:00,2001.06,1,0
+1589,ED50 to ETRS89 (3),transformation,4230,4258,NMA-Nor 6265W,3,2333,Accuracy 2m.,9620,,,Included in Statens Kartverk programme wsktrans from 1997. See ED50 to WGS84 (23) (code 1612) for a simpler transformation accurate to better than 4m.,Statens Kartverk,EPSG,2000-10-19 00:00:00,,1,0
+1590,ED50 to WGS 84 (22),transformation,4230,4326,NMA-Nor 6265W 1997,22,2333,Oil exploration before 2001.,9620,,,Included in Statens Kartverk programme wsktrans between 1997 (v3.1) and 2001 (v4.0). Superseded ED50 to WGS 84 (20) (code 1450) in 1997. Superseded by ED50 to WGS 84 (23) (code 1612) in April 2001.,Statens Kartverk.,EPSG,2000-10-19 00:00:00,,1,0
+1591,RGF93 to ETRS89 (1),transformation,4171,4258,IGN-Fra,1,1096,RGF93 is a regional realisation of ETRS89.,9603,,,May be taken as approximate transformation RGF93 to WGS 84 - see code 1671.,TotalFinaElf,EPSG,2000-10-10 00:00:00,,1,0
+1592,Timbalai 1948 to WGS 84 (2),transformation,4298,4326,BSP-Brn,2,2348,Offshore oil exploration.,9603,,,These parameters produce a coordinate difference of 10m horizontally and 50m vertically compared to Timbalai 1948 to WGS 84 (3) (code 1615).,Brunei Shell Petroleum,EPSG,2002-10-19 00:00:00,,1,0
+1593,AGD84 to GDA94 (4),transformation,4203,4283,DOLA-Aus WA 0.1m,4,1280,0.1m accuracy.,9615,,,Replaced AGD84 to GDA94 (3) (code 1559) but then superseded by AGD84 to GDA94 (5) (code 1804). Input expects longitudes to be positive west; EPSG GeogCRS AGD84 (code 4203) and GDA94 (code 4283) both have longitudes positive east.,http://www.dola.wa.gov.au/lotl/survey_geodesy/gda1994/download.html,EPSG,2000-10-19 00:00:00,,1,0
+1594,AGD66 to GDA94 (8),transformation,4202,4283,OSG-Tas 1m,8,1282,Recommended for mid-accuracy use in Tasmania.  1m accuracy.,9607,,,Supersedes AGD66 to GDA94 (3) (code 1459) from August 2000.  For higher accuracy requirements see AGD66 to GDA94 (6) (code 1506).  May be taken as approximate transformation AGD66 to WGS 84 - see code 1667.,GDA Technical Manual (August 2000 revision) and http://www.delm.tas.gov.au/osg/Geodetic_transform.htm,EPSG,2000-10-19 00:00:00,,1,0
+1595,AGD66 to GDA94 (9),transformation,4202,4283,Auslig-NT 1m,9,2284,Recommended for mid-accuracy use in Northern Territory. 1m accuracy.,9607,,,For higher accuracy requirements see AGD66 to GDA94 (7) (code 1507).  May be taken as approximate transformation AGD66 to WGS 84 - see code 1668.,GDA Technical Manual. http://www.anzlic.org.au/icsm/gdatm/regional.htm,EPSG,2000-10-19 00:00:00,,1,0
+1596,AGD66 to GDA94 (10),transformation,4202,4283,OSG-Aus SE 0.1m,10,2287,0.1m accuracy.,9615,,,In Victoria supersedes AGD66 to GDA94 (5) (code 1464). Superseded by AGD66 to GDA94 (11) (code 1803).  Input expects longitudes to be positive west; EPSG GeogCRS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.,http://www.osg.vic.gov.au/tools.htm,EPSG,2000-10-19 00:00:00,,1,0
+1597,Bogota 1975 to WGS 84 (2),transformation,4218,4326,BP-Col CusCup,2,2315,Oil exploration.,9603,,,Derived in 1995 by WGC at first order stations Recreo and Mena via multi-day ties to 4 IGS stations. Residuals under 20cm.,Various industry sources,EPSG,2000-10-19 00:00:00,,1,0
+1598,POSGAR to WGS 84 (1),transformation,4172,4326,EPSG-Arg,1,1033,?,9603,,,,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+1599,ATS77 to NAD83(CSRS98) (2),transformation,4122,4140,PEI DOT-Can PEI,2,1533,?,9615,,,Can be taken as an approximate transformation ATS77 to WGS 84 - see code 1689.,PEI Department of Transportation & Public Works,EPSG,2000-10-19 00:00:00,,1,1
+1600,NAD27 to NAD83(CSRS98) (2),transformation,4267,4140,SK PMC-Can SK,2,2375,Accuracy 1-2 metres.,9615,,,Can be taken as an approximate transformation NAD27 to WGS 84 - see code 1703.,Dir Geodetic Surveys; SaskGeomatics Div.; Saskatchewan Property Management Company.,EPSG,2000-10-19 00:00:00,,1,1
+1601,NAD83 to NAD83(CSRS98) (2),transformation,4269,4140,SK PMC-Can SK,2,2375,Accuracy 1-2 metres.,9615,,,Can be taken as an approximate transformation NAD83 to WGS 84 - see code 1697.,Dir Geodetic Surveys; SaskGeomatics Div.; Saskatchewan Property Management Company.,EPSG,2000-10-19 00:00:00,,1,1
+1602,NAD83 to NAD83(CSRS98) (3),transformation,4267,4140,AB Env-Can AB,2,2376,Accuracy 1-2 metres.,9615,,,"This gridded difference file  AB_CSRS.DAC will need to be renamed to AB_CSRS.gsb to run in some software suites.  Formats identical, but AB file is provincial fit only.",Geodetic Control Section; Land and Forest Svc; Alberta Environment; http://www.gov.ab.ca/env/land/dos/ or email to geoff.banham at gov.ab.ca,EPSG,2000-10-19 00:00:00,,1,1
+1603,NAD27 to ATS77 (1),transformation,4267,4122,SNB-Can NB,1,1447,?,9634,,,For reverse transformation see ATS77 to NAD27 (1) (code 1606),Survey of New Brunswick,EPSG,2000-10-19 00:00:00,,1,0
+1604,NAD27 to ATS77 (2),transformation,4267,4122,SNB-Can PEI,2,1533,?,9634,,,For reverse transformation see ATS77 to NAD27 (2) (code 1607),Survey of New Brunswick,EPSG,2000-10-19 00:00:00,,1,0
+1605,NAD27 to ATS77 (3),transformation,4267,4122,SNB-Can NS,3,2313,?,9634,,,For reverse transformation see ATS77 to NAD27 (3) (code 1608),Survey of New Brunswick,EPSG,2000-10-19 00:00:00,,1,0
+1606,ATS77 to NAD27 (1),transformation,4122,4267,SNB-Can NB,1,1447,?,9634,,,For reverse transformation see NAD27 to ATS77 (1) (code 1603),Survey of New Brunswick,EPSG,2000-10-19 00:00:00,,1,0
+1607,ATS77 to NAD27 (2),transformation,4122,4267,SNB-Can NS,2,2313,?,9634,,,For reverse transformation see NAD27 to ATS77 (2) (code 1604),Survey of New Brunswick,EPSG,2000-10-19 00:00:00,,1,0
+1608,ATS77 to NAD27 (3),transformation,4122,4267,SNB-Can PEI,3,1533,?,9634,,,For reverse transformation see NAD27 to ATS77 (3) (code 1605),Survey of New Brunswick,EPSG,2000-10-19 00:00:00,,1,0
+1609,BD72 to WGS 84 (1),transformation,4313,4326,IGN-Bel 7,1,1044,For applications to an accuracy of 1 metre.,9607,,,,IGN Brussels www.ngi.be/FR/FR2-1-5-1.shtm,EPSG,2000-10-19 00:00:00,,1,0
+1610,BD72 to WGS 84 (2),transformation,4313,4326,IGN-Bel 3,2,1044,For applications to an accuracy of 5 metres.,9603,,,,IGN Brussels www.ngi.be/FR/FR2-1-5-1.shtm,EPSG,2000-10-19 00:00:00,,1,0
+1611,IRENET95 to ETRS89 (1),transformation,4173,4258,OSI-Ire,1,1305,?,9603,,,May be taken as approximate transformation IRENET95 to WGS 84 - see code 1678.,Ordnance Survey of Ireland,EPSG,2000-10-19 00:00:00,,1,0
+1612,ED50 to WGS 84 (23),transformation,4230,4326,EPSG-Nor N62 2001,23,2601,Oil industry offshore.,9606,,,"Parameter values are taken from ED50 to ETRS89 (1), code 1588. Adopted for ED50 to WGS84 transformations offshore Norway north of 62N from April 2001 when it superseded code 1590. Included in Statens Kartverk programme wsktrans from v4.0.",EPSG Guidance Note #10,EPSG,2001-06-05 00:00:00,,1,0
+1613,ED50 to WGS 84 (24),transformation,4230,4326,EPSG-Nor S62 2001,24,2334,Approximation to 1 metre for oil industry use.,9606,,,"Approximation to 1 metre of concatenated transformation ED50 to WGS 84 (14), code 8046. 8046 remains the transformation promulgated by Statens Kartverk but 1613 recommended by EPSG for practical oil industry usage.",EPSG Guidance Note #10,EPSG,2001-06-05 00:00:00,,1,0
+1614,Sierra Leone 1968 to WGS 84 (1),transformation,4175,4326,NIMA-Sle,1,1209,Accuracy +/- 15m in each axis.,9603,,,Determined at 8 stations. Info. source has the source CRS as Sierra Leone 1960.  Sierra Leone 1968 is a readjustment of the 1960 network: coordinates changed by less than 3 metres.,"NIMA TR8350.2 revision 3, 1997.",EPSG,2001-06-05 00:00:00,,1,0
+1615,Timbalai 1948 to WGS 84 (3),transformation,4298,4326,SD-Brn,3,2349,Topographic and engineering survey onshore.,9603,,,These parameters produce a coordinate difference of 10m horizontally and 50m vertically compared to Timbalai 1948 to WGS 84 (2) (code 1592).,Brunei Survey Department,EPSG,2001-06-05 00:00:00,,1,0
+1616,PSD93 to WGS 72 (1),transformation,4134,4322,PDO-Omn 93,1,1183,Oil exploration. Residuals 1.2m at 67% probability level.,9606,,,,Petroleum Development Oman,EPSG,2001-06-05 00:00:00,,1,0
+1617,PSD93 to WGS 84 (3),transformation,4134,4326,Tot-Omn 95,3,2404,Oil exploration.,9606,,,Accuracy better than 0.5m in block 4.,TotalFinaElf,EPSG,2001-06-05 00:00:00,,1,0
+1618,MGI to WGS 84 (3),transformation,4312,4326,BEV-Aut,3,1037,For applications to an accuracy of 1.5 metres.,9606,,,Same transformation parameters but to lesser precision used for MGI to ETRS89 (1) (code 1619).,Bundesamt f�r Eich- und Vermessungswesen via EuroGeographics http://crs.ifag.de,EPSG,2001-06-05 00:00:00,,1,0
+1619,MGI to ETRS89 (1),transformation,4312,4258,BEV-Aut,1,1037,For applications to an accuracy of 1.5 metres.,9606,,,Same transformation parameters but to greater precision used for MGI to WGS 84 (3) (code 1618).,Bundesamt f�r Eich- und Vermessungswesen via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1620,MGI to ETRS89 (2),transformation,4312,4258,DGU-Hrv,2,1076,For applications to an accuracy of 1 metre.,9606,,,May be taken as approximate transformation MGI to WGS 84 - see code 1621.,Drzavna Geodetska Uprava via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1621,MGI to WGS 84 (4),transformation,4312,4326,EPSG-Hrv,4,1076,For applications to an accuracy of 1 metre.,9606,,,Parameter values from MGI to ETRS89 (2) (code 1620). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1622,S-JTSK to ETRS89 (1),transformation,4156,4258,CUZK-Cze,1,1079,For applications to an accuracy of 1 metre.,9606,,,May be taken as approximate transformation S-JTSK to WGS 84 - see code 1623.,Cesky Urad Zememericky a Katastraln via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1623,S-JTSK to WGS 84 (1),transformation,4156,4326,EPSG-Cze,1,1079,For applications to an accuracy of 1 metre.,9606,,,Parameter values from S-JTSK to ETRS89 (1) (code 1622). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1624,S-JTSK to ETRS89 (2),transformation,4156,4258,UGKK-Svk,2,1211,For applications to an accuracy of 1 metre.,9606,,,May be taken as approximate transformation S-JTSK to WGS 84 - see code 1625.,"Urad Geodezie, Kartografie a Katastra via EuroGeographics; http://crs.ifag.de/",EPSG,2001-06-05 00:00:00,,1,0
+1625,S-JTSK to WGS 84 (2),transformation,4156,4326,EPSG-Svk,2,1211,For applications to an accuracy of 1 metre.,9606,,,Parameter values from S-JTSK to ETRS89 (2) (code 1624). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1626,ED50 to ETRS89 (4),transformation,4230,4258,KMS-Dnk,4,1080,For applications to an accuracy of 1 metre.,9606,,,May be taken as approximate transformation ED50 to WGS 84 - see code 1627.,Kort & Matrikelstyrelsen via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1627,ED50 to WGS 84 (25),transformation,4230,4326,EPSG-Dnk,25,1080,For applications to an accuracy of 1 metre.,9606,,,Parameter values from ED50 to ETRS89 (4) (code 1626). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1628,ED50 to ETRS89 (5),transformation,4230,4258,DGC-Gib,5,1105,For applications to an accuracy of 1 metre.,9603,,,May be taken as approximate transformation ED50 to WGS 84 - see code 1629.,UK Defence Geographic and Imagery Intelligence Agency via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1629,ED50 to WGS 84 (26),transformation,4230,4326,EPSG-Gib,26,1105,For applications to an accuracy of 1 metre.,9603,,,Parameter values from ED50 to ETRS89 (5) (code 1628). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1630,ED50 to ETRS89 (6),transformation,4230,4258,IGN-Esp Bal,6,2335,For applications to an accuracy of 1.5 metres.,9606,,,May be taken as approximate transformation ED50 to WGS 84 - see code 1631.,Centro Nacional de Informacion Geografica via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1631,ED50 to WGS 84 (27),transformation,4230,4326,EPSG-Esp Bal,27,2335,For applications to an accuracy of 1.5 metres.,9606,,,Parameter values from ED50 to ETRS89 (6) (code 1630). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1632,ED50 to ETRS89 (7),transformation,4230,4258,IGN-Esp,7,2336,For applications to an accuracy of 1.5 metres.,9606,,,May be taken as approximate transformation ED50 to WGS 84 - see code 1633.,Centro Nacional de Informacion Geografica via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1633,ED50 to WGS 84 (28),transformation,4230,4326,EPSG-Esp,28,2336,For applications to an accuracy of 1.5 metres.,9606,,,Parameter values from ED50 to ETRS89 (7) (code 1632). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1634,ED50 to ETRS89 (8),transformation,4230,4258,IGN-Esp NW,8,2337,For applications to an accuracy of 1.5 metres.,9606,,,May be taken as approximate transformation ED50 to WGS 84 - see code 1635.,Centro Nacional de Informacion Geografica via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1635,ED50 to WGS 84 (29),transformation,4230,4326,EPSG-Esp NW,29,2337,For applications to an accuracy of 1.5 metres.,9606,,,Parameter values from ED50 to ETRS89 (8) (code 1634). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1638,KKJ to ETRS89 (1),transformation,4123,4258,NLS-Fin,1,1095,For applications to an accuracy of 1 to 2 metres.,9606,,,May be taken as approximate transformation KKJ to WGS 84 - see code 1639.,National Land Survey of Finland via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1639,KKJ to WGS 84 (1),transformation,4123,4326,EPSG-Fin,1,1095,For applications to an accuracy of 1 to 2 metres.,9606,,,Parameter values from KKJ to ETRS89 (1) (code 1638). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1640,TM65 to ETRS89 (1),transformation,4299,4258,OSI-Ire,1,1305,For applications to an accuracy of 1 metre.,9606,,,May be taken as approximate transformation TM65 to WGS 84 - see code 1641.,Ordnance Survey Ireland via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1641,TM65 to WGS 84 (2),transformation,4299,4326,EPSG-Ire,2,1305,For applications to an accuracy of 1 metre.,9606,,,Parameter values from TM65 to ETRS89 (1) (code 1640). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1642,Luxembourg 1930 to ETRS89 (1),transformation,4181,4258,ACT-Lux,1,1146,For applications to an accuracy of 1 metre.,9606,,,May be taken as approximate transformation Luxembourg 1930 to WGS 84 - see code 1643.,Administration du Cadastre et de la Topographie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1643,Luxembourg 1930 to WGS 84 (1),transformation,4181,4326,EPSG-Lux,1,1146,For applications to an accuracy of 1 metre.,9606,,,Parameter values from Luxembourg 1930 to ETRS89 (1) (code 1642). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1644,Pulkovo 1942(58) to ETRS89 (1),transformation,4179,4258,GUGK-Pol,1,1192,For applications to an accuracy of 1 metre.,9606,,,May be taken as approximate transformation Pulkovo 1942(58) to WGS 84 - see code 1645.,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1645,Pulkovo 1942(58) to WGS 84 (1),transformation,4179,4326,EPSG-Pol,1,1192,For applications to an accuracy of 1 metre.,9606,,,Parameter values from Pulkovo 1942(58) to ETRS89 (1) (code 1644). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1646,CH1903 to ETRS89 (1),transformation,4149,4258,BfL-Che,1,1286,Accuracy 1.5 metres.,9603,,,These parameters are strictly from CH1903+ to CHTRF95 or ETRS89 but are used as from CH1903 as an approximation which is within the accuracy of the distortions in the CH1903 network. They are given to full precision as CH1903 to WGS 84 (1) (code 1510).,Bundesamt f�r Landestopographie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1647,CH1903+ to ETRS89 (1),transformation,4150,4258,BfL-Che,1,1286,For applications to an accuracy of 0.1 metres.,9603,,,This transformation is also given as CH1903+ to CHTRF95 (1) (code 1509). CHTRF95 is a local realisation of ETRS89.,Bundesamt f�r Landestopographie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1648,EST97 to ETRS89 (1),transformation,4180,4258,NLB-Est,1,1090,EST97 is a realisation of ETRS89.,9603,,,May be taken as approximate transformation EST97 to WGS 84 - see code 1649.,Estonian National Land Board via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1649,EST97 to WGS 84 (1),transformation,4180,4326,EPSG-Est,1,1090,For applications to an accuracy of 1 metre.,9603,,,Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1650,ED50 to ETRS89 (10),transformation,4230,4258,IGN-Fra,10,1096,For applications to an accuracy of 2 metres.,9603,,,These same parameter values are used to transform to WGS 84. See ED50 to WGS 84 (17) (code 1275).,Institut Geographique National via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1651,NTF to ETRS89 (1),transformation,4275,4258,IGN-Fra,1,1096,For applications to an accuracy of 2 metres.,9603,,,These same parameter values are used to transform to WGS 84. See NTF to WGS 84 (1) (code 1193).,Institut Geographique National via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1652,BD72 to ETRS89 (1),transformation,4313,4258,IGN-Bel,1,1044,For applications to an accuracy of 1 metre.,9606,,,May be taken as approximate transformation BD72 to WGS 84 - see code 1609.,Institut Geographique National via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1653,NGO 1948 to ETRS89 (1),transformation,4273,4258,SKV-Nor,1,1352,For applications to an accuracy of 3 metres.,9606,,,May be taken as approximate transformation NGO 1948 to WGS 84 - see code 1654.,Statens Kartverk via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1654,NGO 1948 to WGS 84 (1),transformation,4273,4326,EPSG-Nor,1,1352,For applications to an accuracy of 3 metres.,9606,,,Parameter values from NGO 1948 to ETRS89 (1) (code 1653). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1655,Lisbon to ETRS89 (1),transformation,4207,4258,ICC-Prt 2000,1,1294,For applications to an accuracy of 3 metres.,9606,,,Derived in 2000 at 8 stations.  Superseded by 2001 derivation (code 1790).,Instituto Portugues de Cartografia e Cadastro via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1656,Lisbon to WGS 84 (1),transformation,4207,4258,EPSG-Prt 2000,1,1294,For applications to an accuracy of 3 metres.,9606,,,Parameter values from Lisbon to ETRS89 (1) (code 1655). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,1
+1657,Datum 73 to ETRS89 (1),transformation,4274,4258,ICC-Prt 2000,1,1294,For applications to an accuracy of 2 metres.,9606,,,Derived in 2000 at 8 stations.  Superseded by 2001 derivation (code 1792).,Instituto Portugues de Cartografia e Cadastro via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1658,Datum 73 to WGS 84 (1),transformation,4274,4258,EPSG-Prt 2000,1,1294,For applications to an accuracy of 2 metres.,9606,,,Parameter values from Datum 73 to ETRS89 (1) (code 1657). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,1
+1659,Monte Mario to ETRS89 (1),transformation,4265,4258,IGM-Ita main,1,2372,Accuracy: 4 metres,9606,,,May be taken as approximate transformation Monte Mario to WGS 84 - see code 1660.,Istituto Geografico Militare Italiano via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1660,Monte Mario to WGS 84 (4),transformation,4265,4326,EPSG-Ita main,4,2372,Accuracy: 4 metres,9606,,,Parameter values from Monte Mario to ETRS89 (1) (code 1659). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1661,Monte Mario to ETRS89 (2),transformation,4265,4258,IGM-Ita Sar,2,2339,Accuracy: 4 metres,9606,,,May be taken as approximate transformation Monte Mario to WGS 84 - see code 1662.,Istituto Geografico Militare Italiano via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1662,Monte Mario to WGS 84 (2),transformation,4265,4326,EPSG-Ita Sar,2,2339,Accuracy: 4 metres,9606,,,Parameter values from Monte Mario to ETRS89 (2) (code 1661). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1663,Monte Mario to ETRS89 (3),transformation,4265,4258,IGM-Ita Sic,3,2340,Accuracy: 4 metres,9606,,,May be taken as approximate transformation Monte Mario to WGS 84 - see code 1664.,Istituto Geografico Militare Italiano via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+1664,Monte Mario to WGS 84 (3),transformation,4265,4326,EPSG-Ita Sic,3,2340,Accuracy: 4 metres,9606,,,Parameter values from Monte Mario to ETRS89 (3) (code 1663). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+1665,AGD66 to WGS 84 (12),transformation,4202,4326,EPSG-ACT 1m,12,2283,Recommended for mid-accuracy use in A.C.T.  1m accuracy.,9607,,,Parameter values from AGD66 to GDA94 (2) (code 1458). Assumes GDA94 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1666,AGD66 to WGS 84 (13),transformation,4202,4326,EPSG-NSW Vic 1m,13,2286,Recommended for mid-accuracy use in NSW and Victoria.  1m accuracy.,9607,,,Parameter values from AGD66 to GDA94 (4) (code 1460). Assumes GDA94 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1667,AGD66 to WGS 84 (14),transformation,4202,4326,EPSG-Tas 1m,14,1282,Recommended for mid-accuracy use in Tasmania.  1m accuracy.,9607,,,Parameter values from AGD66 to GDA94 (8) (code 1594). Assumes GDA94 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1668,AGD66 to WGS 84 (15),transformation,4202,4326,EPSG-NT 1m,15,2284,Recommended for mid-accuracy use in Northern Territory. 1m accuracy.,9607,,,Parameter values from AGD66 to GDA94 (9) (code 1595). Assumes GDA94 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1669,AGD84 to WGS 84 (7),transformation,4203,4326,EPSG-Aus 1m,7,1036,1m accuracy.,9607,,,Parameter values from AGD84 to GDA94 (2) (code 1280). Assumes GDA94 and WGS 84 can be considered the same to within the accuracy of the transformation. Supersedes AGD84 to WGS 84 (2) (code 1236).,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1670,NZGD49 to WGS 84 (3),transformation,4272,4326,EPSG-Nzl 1m,3,1175,Accuracy about 1m.,9615,,,Parameter file is from NZGD49 to NZGD2000 (3) (code 1568) and assumes  WGS 84 is coincident with NZGD2000 to the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1671,RGF93 to WGS 84 (1),transformation,4171,4326,EPSG-Fra,1,1096,Approximation at the +/- 1m level.,9603,,,Parameter values from RGF93 to ETRS89 (1) (code 1591) assuming that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1672,Amersfoort to WGS 84 (2),transformation,4289,4326,EPSG-Nld,2,1275,Approximation at the +/- 1m level.,9607,,,Parameter values from Amersfoort to ETRS89 (2) (code 1751) assuming that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation. Supersedes Amersfoort to WGS 84 (1) (code 1112).,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1673,DHDN to WGS 84 (1),transformation,4314,4326,EPSG-Deu W,1,2326,For applications with an accuracy at 5 m level.,9607,,,Parameter values from DHDN to ETRS89 (1) (code 1309) assuming that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1674,Pulkovo 1942(83) to ETRS89 (1),transformation,4178,4258,IfAG-Deu E,1,1343,Residuals under 2 m.,9607,,,Mean of 20 stations. May be taken as approximate transformation to WGS 84 - see code 1675. Also given by EuroGeographics at http://crs.ifag.de/ as a Position Vector transformation with changed values for rotations. Superseded in 2001 by code 1775.,Institute for Cartography and Geodesy; Leipzig.,EPSG,2001-08-15 00:00:00,,1,0
+1675,Pulkovo 1942(83) to WGS 84 (1),transformation,4178,4326,EPSG-Deu E,1,1343,Residuals under 2 m.,9607,,,Parameter values from Pulkovo 1942(83) to ETRS89 (1) (code 1674) assuming that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1676,CH1903+ to WGS 84 (1),transformation,4150,4326,BfL-CH,1,1286,Approximation at the +/- 1m level.,9603,,,Parameter values are from CH1903+ to CHTRF95 (1) (code 1509) assuming that CHTRF95 is equivalent to WGS 84. That transformation is also given as CH1903+ to ETRS89 (1) (code 1647). CHTRF95 is a realisation of ETRS89.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1677,HD72 to WGS 84 (1),transformation,4237,4326,EPSG-Hun,1,1119,Approximation at the +/- 1m level.,9607,,,Parameter values taken from HD72 to ETRS89 (1) (code 1273) assuming that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,1
+1678,IRENET95 to WGS 84 (1),transformation,4173,4326,EPSG-Ire,1,1305,Approximation at the +/- 1m level.,9603,,,Assumes that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1679,Pulkovo 1942 to WGS 84 (2),transformation,4284,4326,EPSG-Ltu,2,1145,Approximation at the +/- 1m level.,9607,,,Parameter values taken from Pulkovo 1942 to LKS94(ETRS89) (1) (code 1274) assuming that LKS94(ETRS89) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1680,RT90 to WGS 84 (1),transformation,4124,4326,EPSG-Swe,1,1225,Approximation at the +/- 1m level.,9607,,,Parameter values from RT90 to ETRS89 (1) (code 1437) assuming that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1681,OSGB 1936 / British National Grid to WGS 84 (1),transformation,27700,4326,EPSG-Gbr,1,1264,Accuracy about 0.5m.,9633,,,Parameter values taken from OSGB 1936 / British National Grid to ETRS89 (1) (code 1036) assuming that ETRS89 is coincident with WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1682,South Yemen to WGS 84 (1),transformation,4164,4326,EPSG-Yem South,1,1340,Approximation at the +/- 1m level.,9603,,,Parameter values taken from South Yemen to Yemen NGN96 (1) (code 1539) assuming that NGN96 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1683,Tete to WGS 84 (1),transformation,4127,4326,EPSG-Moz,1,1167,Residuals as high as 30 metres.,9607,,,Parameter values taken from Tete to Moznet (1) (code 1297) assuming that Moznet is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1684,Tete to WGS 84 (2),transformation,4127,4326,EPSG-Moz A,2,2350,Residuals are generally under 1 metre.,9607,,,Parameter values taken from Tete to Moznet (2) (code 1298) assuming that Moznet is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1685,Tete to WGS 84 (3),transformation,4127,4326,EPSG-Moz B,3,2351,Residuals are generally under 4 metres.,9607,,,Parameter values taken from Tete to Moznet (3) (code 1299) assuming that Moznet is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1686,Tete to WGS 84 (4),transformation,4127,4326,EPSG-Moz C,4,2352,Residuals are generally under 3 metres.,9607,,,Parameter values taken from Tete to Moznet (4) (code 1300) assuming that Moznet is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1687,Tete to WGS 84 (5),transformation,4127,4326,EPSG-Moz D,5,2353,Residuals are 5-10 metres.,9607,,,Parameter values taken from Tete to Moznet (5) (code 1301) assuming that Moznet is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1688,ATS77 to WGS 84 (1),transformation,4122,4326,EPSG-Can NB,1,1447,Approximation at the +/- 1m level.,9615,,,Parameter file is from ATS77 to NAD83(CSRS) (1) (code 1841) assuming that NAD83(CSRS) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1689,ATS77 to WGS 84 (2),transformation,4122,4326,EPSG-Can PEI,2,1533,Approximation at the +/- 1m level.,9615,,,Parameter file is from ATS77 to NAD83(CSRS) (2) (code 1846) assuming that NAD83(CSRS) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1690,NAD27(76) to WGS 84 (1),transformation,4608,4326,EPSG-Can On,1,1367,Approximation at the +/- 1m level.,9615,,,Parameter file is from NAD27(76) to NAD83 (1) (code 1463) assuming that NAD83 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1691,NAD27(CGQ77) to WGS 84 (3),transformation,4609,4326,EPSG-Can Qc NT2,3,1368,Approximation at the +/- 1m level.,9615,,,Parameter file is from NAD27(CGQ77) to NAD83(CSRS) (1) (code 1845) assuming that NAD83(CSRS98) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1692,NAD27 to WGS 84 (34),transformation,4267,4326,EPSG-Can QC,34,1368,Approximation at the +/- 1m level.,9615,,,Parameter file is from NAD27 to NAD83(CSRS) (1) (code 1844) assuming that NAD83(CSRS) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1693,NAD27 to WGS 84 (33),transformation,4267,4326,EPSG-Can,33,1061,Approximation at the +/- 1m level.,9615,,,Parameter file is from NAD27 to NAD83 (4) (code 1313) assuming that NAD83 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1694,American Samoa 1962 to WGS 84 (2),transformation,4169,4326,EPSG-Asm W,2,2288,Accuracy 1m.,9613,,,"Parameter files are from American Samoa 1962 to NAD83(HARN) (1) (code 1578), but for many purposes NAD83(HARN) can be considered to be coincident with WGS 84 within the accuracy of the transformation.",EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1695,American Samoa 1962 to WGS 84 (3),transformation,4169,4326,EPSG-Asm E,3,2289,Accuracy 1m.,9613,,,"Parameter files are from American Samoa 1962 to NAD83(HARN) (2) (code 1579), but for many purposes NAD83(HARN) can be considered to be coincident with WGS 84 within the accuracy of the transformation.",EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1696,NAD83 to WGS 84 (6),transformation,4269,4326,EPSG-Can QC,6,1368,Approximation at the +/- 1m level.,9615,,,Parameter file is from NAD83 to NAD83(CSRS) (1) (code 1843) assuming that NAD83(CSRS) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1697,NAD83 to WGS 84 (7),transformation,4269,4326,EPSG-Can SK,7,2375,Approximation at the +/- 1m level.,9615,,,Parameter file is from NAD83 to NAD83(CSRS8) (2) (code 1848) assuming that NAD83(CSRS) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1698,St. George Island to WGS 84 (1),transformation,4138,4326,EPSG-Usa AK StG,1,1331,Approximation at the +/- 1 to 2m level.,9613,,,Parameter files are from St. George Island to NAD83 (1) (code 1457) assuming that NAD83 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1699,St. Lawrence Island to WGS 84 (1),transformation,4136,4326,EPSG-Usa AK StL,1,1332,Approximation at the +/- 1 to 2m level.,9613,,,Parameter files are from St. Lawrence Island to NAD83 (1) (code 1455) assuming that NAD83 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1700,St. Paul Island to WGS 84 (1),transformation,4137,4326,EPSG-Usa AK StP,1,1333,Approximation at the +/- 1 to 2m level.,9613,,,Parameter files are from St. Paul Island to NAD83 (1) (code 1456) assuming that NAD83 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1701,NZGD49 to NZGD2000 (2),transformation,4272,4167,OSG-Nzl 4m,2,1175,4m accuracy.,9607,,,For better accuracy use NZGD49 to NZGD2000 (3) (code 1568).,http://www.linz.govt.nz/services/surveysystem/osgpublications/nzgd2000_trans.html,EPSG,2001-08-28 00:00:00,,1,0
+1702,NAD83 to WGS 84 (8),transformation,4269,4326,EPSG-Can AB,8,2376,Approximation at the +/- 1m level.,9615,,,Parameter file is from NAD83 to NAD83(CSRS) (3) (code 1849) assuming that NAD83(CSRS) is equivalent to WGS 84 within the accuracy of the transformation. This file  AB_CSRS.DAC will need to be renamed to AB_CSRS.gsb to run in some sodtware.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1703,NAD27 to WGS 84 (32),transformation,4267,4326,EPSG-Can SK,32,2375,Approximation at the +/- 1m level.,9615,,,Parameter file is from NAD27 to NAD83(CSRS98) (1) (code 1600) assuming that NAD83(CSRS98) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1704,NAD83 to NAD83(HARN) (40),transformation,4269,4152,NGS-Usa AR,40,1374,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1708.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2001-08-15 00:00:00,,1,0
+1705,NAD83 to NAD83(HARN) (41),transformation,4269,4152,NGS-Usa IA,41,1384,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.  May be taken as approximate transformation NAD83-WGS 84 - see code 1709.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2001-08-15 00:00:00,,1,0
+1706,NAD83 to NAD83(HARN) (42),transformation,4269,4152,NGS-Usa MN,42,1392,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.   May be taken as approximate transformation NAD83-WGS 84 - see code 1710.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2001-08-15 00:00:00,,1,0
+1707,NAD83 to NAD83(HARN) (43),transformation,4269,4152,NGS-Usa MO,43,1394,Geodetic survey. Accuracy 0.05m at 67% confidence level.,9613,,,Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(HARN) (code 4152) have longitudes positive east.  May be taken as approximate transformation NAD83-WGS 84 - see code 1711.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2001-08-15 00:00:00,,1,0
+1708,NAD83 to WGS 84 (12),transformation,4269,4326,EPSG-USA Ar,12,1374,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (40) (code 1704) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1709,NAD83 to WGS 84 (13),transformation,4269,4326,EPSG-Usa IA,13,1384,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (41) (code 1705) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1710,NAD83 to WGS 84 (14),transformation,4269,4326,EPSG-Usa MN,14,1392,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (42) (code 1706) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1711,NAD83 to WGS 84 (15),transformation,4269,4326,EPSG-Usa MO,15,1394,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (43) (code 1707) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1712,NAD83 to WGS 84 (16),transformation,4269,4326,EPSG-Usa CO,16,1376,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (5) (code 1478) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1713,NAD83 to WGS 84 (17),transformation,4269,4326,EPSG-Usa GA,17,1380,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (6) (code 1479) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1714,NAD83 to WGS 84 (18),transformation,4269,4326,EPSG-Usa FL,18,1379,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (7) (code 1480) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1715,NAD83 to WGS 84 (19),transformation,4269,4326,EPSG-Usa ID MT e,19,2382,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (8) (code 1481) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1716,NAD83 to WGS 84 (20),transformation,4269,4326,EPSG-Usa ID MT w,20,2383,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (9) (code 1482) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1717,NAD83 to WGS 84 (21),transformation,4269,4326,EPSG-Usa AL,21,1372,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (1) (code 1474) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1718,NAD83 to WGS 84 (22),transformation,4269,4326,EPSG-Usa KY,22,1386,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (10) (code 1483) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1719,NAD83 to WGS 84 (23),transformation,4269,4326,EPSG-Usa LA,23,1387,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (11) (code 1484) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1720,NAD83 to WGS 84 (24),transformation,4269,4326,EPSG-Usa DE MD,24,2377,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (12) (code 1485) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1721,NAD83 to WGS 84 (25),transformation,4269,4326,EPSG-Usa ME,25,1388,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (13) (code 1486) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1722,NAD83 to WGS 84 (26),transformation,4269,4326,EPSG-Usa MI,26,1391,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (14) (code 1487) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1723,NAD83 to WGS 84 (27),transformation,4269,4326,EPSG-Usa MS,27,1393,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (15) (code 1488) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1724,NAD83 to WGS 84 (28),transformation,4269,4326,EPSG-Usa NE,28,1396,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (16) (code 1489) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1725,NAD83 to WGS 84 (29),transformation,4269,4326,EPSG-Usa NewEng,29,2378,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (17) (code 1490) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1726,NAD83 to WGS 84 (30),transformation,4269,4326,EPSG-Usa NM,30,1400,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (18) (code 1491) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1727,NAD83 to WGS 84 (31),transformation,4269,4326,EPSG-Usa NY,31,1401,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (19) (code 1492) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1728,NAD83 to WGS 84 (32),transformation,4269,4326,EPSG-Usa AZ,32,1373,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (2) (code 1475) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1729,NAD83 to WGS 84 (33),transformation,4269,4326,EPSG-Usa ND,33,1403,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (20) (code 1493) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1730,NAD83 to WGS 84 (34),transformation,4269,4326,EPSG-Usa OK,34,1405,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (21) (code 1494) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1731,NAD83 to WGS 84 (35),transformation,4269,4326,EPSG-PRVI,35,1335,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (22) (code 1495) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1732,NAD83 to WGS 84 (36),transformation,4269,4326,EPSG-Usa SD,36,1410,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (23) (code 1496) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1733,NAD83 to WGS 84 (37),transformation,4269,4326,EPSG-Usa TN,37,1411,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (24) (code 1497) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1734,NAD83 to WGS 84 (38),transformation,4269,4326,EPSG-Usa TX e,38,2379,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (25) (code 1498) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1735,NAD83 to WGS 84 (39),transformation,4269,4326,EPSG-Usa TX w,39,2380,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (26) (code 1499) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1736,NAD83 to WGS 84 (40),transformation,4269,4326,EPSG-Usa VA,40,1415,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (27) (code 1500) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1737,NAD83 to WGS 84 (41),transformation,4269,4326,EPSG-Usa OR WA,41,2381,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (28) (code 1501) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1738,NAD83 to WGS 84 (42),transformation,4269,4326,EPSG-Usa WI,42,1418,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (29) (code 1502) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1739,NAD83 to WGS 84 (43),transformation,4269,4326,EPSG-Usa CA n,43,2297,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (3) (code 1476) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1740,NAD83 to WGS 84 (44),transformation,4269,4326,EPSG-Usa WY,44,1419,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (30) (code 1503) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1741,NAD83 to WGS 84 (45),transformation,4269,4326,EPSG-Usa HI,45,1334,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (31) (code 1520) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1742,NAD83 to WGS 84 (46),transformation,4269,4326,EPSG-Usa IN,46,1383,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (32) (code 1521) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1743,NAD83 to WGS 84 (47),transformation,4269,4326,EPSG-Usa KS,47,1385,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (33) (code 1522) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1744,NAD83 to WGS 84 (48),transformation,4269,4326,EPSG-Usa NV,48,1397,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (34) (code 1523) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1745,NAD83 to WGS 84 (49),transformation,4269,4326,EPSG-Usa OH,49,1404,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (35) (code 1524) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1746,NAD83 to WGS 84 (50),transformation,4269,4326,EPSG-Usa UT,50,1413,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (36) (code 1525) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1747,NAD83 to WGS 84 (51),transformation,4269,4326,EPSG-Usa WV,51,1417,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (37) (code 1526) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1748,NAD83 to WGS 84 (52),transformation,4269,4326,EPSG-Usa IL,52,1382,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (38) (code 1553) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1749,NAD83 to WGS 84 (53),transformation,4269,4326,EPSG-Usa NJ,53,1399,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (39) (code 1554) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1750,NAD83 to WGS 84 (54),transformation,4269,4326,EPSG-Usa CA s,54,2298,Approximation at the +/- 1m level.,9613,,,Parameter files are from NAD83 to NAD83(HARN) (4) (code 1477) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+1751,Amersfoort to ETRS89 (1),transformation,4289,4258,NCG-Nld 2000,1,1172,Accuracy 0.5m,9607,,,"Dutch sources also quote an equivalent transformation with parameter values dX=+593.032 dY=+26.000 dZ=+478.741m, rX rY rZ and dS as this tfm. These values belong to a different transformation method and cannot be used with the Coordinate Frame method.",http://rdnap.kadaster.nl/rd/index.html  Also Nederlandse Commissie voor Geodesie publication 30; 3rd edition 1997.  Also with change of method [...]
+1752,NAD83 to NAD83(CSRS98) (3),transformation,4269,4140,AB Env-Can AB,3,2376,?,9615,,,"This gridded difference file  AB_CSRS.DAC will need to be renamed to AB_CSRS.gsb to run in some software suites.  Formats identical, but AB file is provincial fit only.  Can be taken as an approximate transformation NAD83 to WGS 84 - see code 1702.",Geodetic Control Section; Land and Forest Svc; Alberta Environment; http://www.gov.ab.ca/env/land/dos/ or email to geoff.banham at gov.ab.ca,EPSG,2000-10-19  [...]
+1753,CH1903 to WGS 84 (1),transformation,4149,4326,BfL-CH 1,1,1286,?,9607,,,Implemented in Bundesamt f�r Landestopographie programme GRANIT.,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,2001-08-28 00:00:00,,1,0
+1754,Minna to WGS 84 (3),transformation,4263,4326,SHL-Nga S,3,2371,Oil exploration.,9606,,,"Used by Shell SPDC throughout southern Nigeria onshore, delta and shallow offshore from 1994; adopted by Total for offshore OPL246.",Shell Petroleum Development Company,EPSG,2002-03-15 00:00:00,2001.38  2002.29,1,0
+1755,Bogota 1975 (Bogota) to Bogota 1975,transformation,4802,4218,IGAC-Col,1,1070,Change of prime meridian.,9601,,,,EPSG,EPSG,2001-10-04 00:00:00,2001.39,1,0
+1756,Lisbon (Lisbon) to Lisbon,transformation,4803,4207,IGC-Prt,1,1294,Change of prime meridian.,9601,,,,EPSG,EPSG,2001-10-04 00:00:00,2001.39,1,0
+1757,MGI (Ferro) to MGI,transformation,4805,4312,BEV-Aut balk,1,1166,Change of prime meridian.,9601,,,,EPSG,EPSG,2001-10-04 00:00:00,2001.39,1,0
+1758,Padang (Jakarta) to Padang,transformation,4808,4280,EPSG-Idn Sumatra,1,1355,Change of prime meridian.,9601,,,,EPSG,EPSG,2001-10-04 00:00:00,2001.39,1,0
+1759,Batavia (Jakarta) to Batavia,transformation,4813,4211,EPSG-Idn Java,1,1285,Change of prime meridian.,9601,,,,EPSG,EPSG,2001-10-04 00:00:00,2001.39,1,0
+1760,RT38 (Stockholm) to RT38,transformation,4814,4308,NLS-Swe,1,1225,Change of prime meridian.,9601,,,,EPSG,EPSG,2001-10-04 00:00:00,2001.39,1,0
+1761,Greek (Athens) to Greek,transformation,4815,4120,NTU-Grc,1,1106,Change of prime meridian.,9601,,,,Topography Department; National Technical University of Athens.,EPSG,2001-10-04 00:00:00,2001.39,1,0
+1762,NGO 1948 (Oslo) to NGO1948,transformation,4817,4273,NGO-Nor,1,1352,Change of prime meridian.,9601,,,,"J. Danielsen; ""Transformasjoner ved Norges Geografiske Oppm�ling""; Kart Og Plan nr 1; 1982.",EPSG,2001-10-04 00:00:00,2001.39,1,0
+1763,NTF (Paris) to NTF (1),transformation,4807,4275,IGN-Fra,1,1096,Change of prime meridian.,9601,,,,IGN Paris.,EPSG,2001-10-04 00:00:00,2001.39,1,0
+1764,NTF (Paris) to NTF (2),transformation,4807,4275,RGS,2,1096,Change of prime meridian.,9601,,,EPSG prefers value from IGN Paris (code 1467).,Royal Geographic Society; London,EPSG,2001-10-04 00:00:00,2001.39,1,0
+1765,Bern 1898 (Bern) to CH1903,transformation,4801,4149,BfL-CH,1,1286,Change of prime meridian.,9601,,,,EPSG,EPSG,2001-10-04 00:00:00,2001.39,1,0
+1766,CH1903 to WGS 84 (2),transformation,4149,4326,BfL-CH 2,2,1286,Accuracy 1.5 metres.,9603,,,These parameters are strictly between CH1903+ and CHTRF95 (code 1509) or ETRS89 (code 1647) but are used given to lesser precision from CH1903 to WGS 84 as an approximation which is within the accuracy of the distortions in the CH1903 network.,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,200 [...]
+1767,REGVEN to SIRGAS (1),transformation,4189,4170,CN-Ven,1,1251,Accuracy 2 centimetres.,9603,,,,Instituto Geografia de Venezuela Simon Bolivar,EPSG,2001-11-06 00:00:00,,1,0
+1768,REGVEN to WGS 84 (1),transformation,4189,4326,EPSG-Ven,1,1251,Approximation at the +/- 1m level.,9603,,,,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+1769,PSAD56 to REGVEN (1),transformation,4248,4189,IGSB-Ven,1,1251,?,9636,,,,Instituto Geografia de Venezuela Simon Bolivar,EPSG,2001-11-06 00:00:00,,1,0
+1770,PSAD56 to WGS84 (1),transformation,4248,4326,EPSG-Ven,1,1251,Approximation at the +/- 1m level.,9636,,,Parameter vales are from PSAD56 to REGVEN (1) (code 1769) assuming that REGVEN is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+1771,La Canoa to REGVEN (1),transformation,4247,4189,IGSB-Ven,1,1251,?,9636,,,,Instituto Geografia de Venezuela Simon Bolivar,EPSG,2001-11-06 00:00:00,,1,0
+1772,La Canoa to WGS84 (1),transformation,4247,4326,EPSG-Ven,1,1251,Approximation at the +/- 1m level.,9636,,,Parameter vales are from La Canoa to REGVEN (1) (code 1771) assuming that REGVEN is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+1773,POSGAR 98 to WGS 84 (1),transformation,4190,4326,EPSG-Arg,1,1033,Approximation at the +/- 1m level.,9603,,,,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+1774,POSGAR 98 to SIRGAS (1),transformation,4190,4170,IGM-Arg,1,1033,POSGAR 98 is a densification of SIRGAS.,9603,,,,ISBN 85-240-0647-1. Sistema de Refer�ncia Geoc�ntrico para a Am�rica do Sul: Relat�rio Final. IGBE Rio de Janeiro 1997.,EPSG,2001-11-06 00:00:00,,1,0
+1775,Pulkovo 1942(83) to ETRS89 (2),transformation,4178,4258,IfAG-Deu E 0.1m,2,1343,For applications with an accuracy at 0.1m level,9606,,,Derived at 35 points of the German GPS Network DREF. From 2001 supersedes Pulkovo 1942(83) to ETRS89 (1) (code 1674).,Institute for Cartography and Geodesy; Leipzig via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+1776,DHDN to ETRS89 (2),transformation,4314,4258,IfAG-Deu W 3m,2,2326,For applications with an accuracy at 3 m level,9606,,,Mean of 109 stations. May be taken as approximate transformation DHDN to WGS 84 - see code 1777.,Institute for Cartography and Geodesy; Leipzig via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+1777,DHDN to WGS 84 (2),transformation,4314,4326,EPSG-Deu W 3m,2,2326,For applications with an accuracy at 3 m level,9606,,,Parameter values from DHDN to ETRS89 (2) (code 1776) assuming that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+1778,DHDN to ETRS89 (3),transformation,4314,4258,IfAG-Deu W-S,3,2543,For applications with an accuracy at 0.1m level,9606,,,Derived at 10 points of the German GPS Network DREF.,Institute for Cartography and Geodesy; Leipzig via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+1779,DHDN to ETRS89 (4),transformation,4314,4258,IfAG-Deu W-cen,4,2542,For applications with an accuracy at 0.1m level,9606,,,Derived at 27 points of the German GPS Network DREF.,Institute for Cartography and Geodesy; Leipzig via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+1780,DHDN to ETRS89 (5),transformation,4314,4258,IfAG-Deu W-N,5,2541,For applications with an accuracy at 0.1m level,9606,,,Derived at 21 points of the German GPS Network DREF.,Institute for Cartography and Geodesy; Leipzig via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+1781,DHDN to ETRS89 (6),transformation,4314,4258,IfAG-Deu Thur,6,2544,For applications with an accuracy at 0.1m level,9606,,,Derived at 10 points of the German GPS Network DREF.,Institute for Cartography and Geodesy; Leipzig via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+1782,DHDN to ETRS89 (7),transformation,4314,4258,IfAG-Deu Sach,7,2545,For applications with an accuracy at 0.1m level,9606,,,Derived at 35 points of the German GPS Network DREF.,Institute for Cartography and Geodesy; Leipzig via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+1783,ED50 to ETRS89 (9),transformation,4230,4258,HGK-Tur,9,1237,For applications to an accuracy of 2 metres.,9606,,,May be taken as approximate transformation ED50 to WGS 84 - see code 1784.,General Command of Mapping via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+1784,ED50 to WGS 84 (30),transformation,4230,4326,EPSG-Tur,30,1237,For applications to an accuracy of 2 metres.,9606,,,Parameter values from ED50 to ETRS89 (9) (code 1783). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+1785,MGI to ETRS89 (3),transformation,4312,4258,GURS-Svn,3,1212,For applications to an accuracy of 1 metre.,9606,,,May be taken as approximate transformation MGI to WGS 84 - see code 1786.,Geodetska Uprava Republike Slovenij via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+1786,MGI to WGS 84 (5),transformation,4312,4326,EPSG-Svn,5,1212,For applications to an accuracy of 1 metre.,9606,,,Parameter values from MGI to ETRS89 (3) (code 1785). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+1787,RT90 to ETRS89 (2),transformation,4124,4258,NLS-Swe 2001,2,1225,Accuracy 0.1m.,9607,,,Derived at 165 points. Supersedes RT90 to ETRS89 (1) (code 1437). May be taken as approximate transformation RT90 to WGS 84 - see code 1787.,National Land Survey of Sweden (http://www.lm.se/geodesi/refsys/eng/refsys-eng.htm) via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+1788,RT90 to WGS 84 (2),transformation,4124,4326,EPSG-Swe 2001,2,1225,Approximation at the +/- 1m level.,9607,,,Parameter values from RT90 to ETRS89 (1) (code 1787) assuming that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+1789,Dealui Piscului 1933 to WGS 84 (1),transformation,4316,4326,NAMR-Rom,1,1197,?,9603,,,,Petromar and NAMR,EPSG,2001-11-06 00:00:00,,1,0
+1790,Lisbon to ETRS89 (2),transformation,4207,4258,ICC-Prt 2001,2,1294,For applications to an accuracy of 2 metres.,9606,,,Derived in 2001.  Supersedes Lisbon to ETRS89 (1) (code 1655). May be taken as approximate transformation Lisbon to WGS 84 - see code 1791.,Instituto Portugues de Cartografia e Cadastro via EuroGeographics; http://crs.ifag.de/,EPSG,2002-01-18 00:00:00,,1,0
+1791,Lisbon to WGS 84 (2),transformation,4207,4258,EPSG-Prt 2001,2,1294,For applications to an accuracy of 2 metres.,9606,,,Parameter values from Lisbon to ETRS89 (2) (code 1790). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2002-01-18 00:00:00,,1,0
+1792,Datum 73 to ETRS89 (2),transformation,4274,4258,ICC-Prt 2001,2,1294,For applications to an accuracy of 1 metre.,9606,,,Derived in 2001.  Supersedes Datum 73 to ETRS89 (1) (code 1657).  May be taken as approximate transformation Datum 73 to WGS 84 - see code 1793.,Instituto Portugues de Cartografia e Cadastro via EuroGeographics; http://crs.ifag.de/,EPSG,2002-01-18 00:00:00,,1,0
+1793,Datum 73 to WGS 84 (2),transformation,4274,4258,EPSG-Prt 2001,2,1294,For applications to an accuracy of 1 metre.,9606,,,Parameter values from Datum 73 to ETRS89 (2) (code 1792). Assumes ETRS89 and WGS 84 can be considered the same to within the accuracy of the transformation.,EPSG,EPSG,2002-01-18 00:00:00,,1,0
+1794,MGI to WGS 84 (6),transformation,4312,4326,JPet-Yug,6,2547,Oil industry,9603,,,For more accurate transformation see MGI to WGS 84 (7) (code 1795).,Jugopetrol,EPSG,2002-01-18 00:00:00,,1,0
+1795,MGI to WGS 84 (7),transformation,4312,4326,JPET-Yug MB,7,2547,Oil industry,9636,,,,Jugopetrol,EPSG,2002-01-18 00:00:00,,1,0
+1796,Manoca 1962 to WGS 84 (1),transformation,4193,4326,ELF94-Cmr,1,2555,Oil industry,9603,,,"Derived at two points, checked at a third by Stolt Comex Seaway and Geoid for Elf.",TotalFinaElf,EPSG,2002-01-18 00:00:00,,1,0
+1797,Qornoq 1927 to WGS 84 (1),transformation,4194,4326,DMA-Grl S,1,2407,"For military purposes.  Accuracy 25m, 25m and 32m in X, Y and Z axes.",9603,,,Derived at 2 stations.,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,2002-01-18 00:00:00,,1,0
+1798,Qornoq 1927 to WGS 84 (2),transformation,4194,4326,KMS-Grl,2,1107,Topographic mapping.,9606,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+1799,Scoresbysund 1952 to WGS 84 (1),transformation,4195,4326,KMS-Grl Scosd,1,2570,Topographic mapping.,9606,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+1800,Ammassalik 1958 to WGS 84 (1),transformation,4196,4326,KMS-Grl Ammlk,1,2571,Topographic mapping.,9606,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+1801,Pointe Noire to WGS 84 (2),transformation,4282,4326,CGG94-Cog,2,2574,?,9603,,,Derived in 1994 by CGG/Topnav using DORIS system on various stations along the coastline.,TotalFinaElf,EPSG,2002-02-08 00:00:00,,1,0
+1802,Pointe Noire to WGS 84 (3),transformation,4282,4326,ELF95-Cog,3,2574,Used by Elf since May 1995 for all offshore Congo operations.,9606,,,Derived by Geoid for Elf in May 1995 using GPS and IGS data by tying 4 geodetic points to ITRF93 epoch 1995.4.,TotalFinaElf,EPSG,2002-02-08 00:00:00,,1,0
+1803,AGD66 to GDA94 (11),transformation,4202,4283,ICSM-Aus 0.1m,11,2575,0.1m accuracy.,9615,,,"Supersedes AGD66 to GDA94 variants 6, 7 and 10 (codes 1506 1507 1596). Variant 10 (1596) superseded #5 (1464). Input expects longitudes to be positive west; EPSG GeogCRS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.",GDA Technical Manual.  http://www.anzlic.org.au/icsm/gdatm/chapter7.htm,EPSG,2002-01-18 00:00:00,,1,0
+1804,AGD84 to GDA94 (5),transformation,4203,4283,Auslig-Aus 0.1m,5,2576,0.1m accuracy.,9615,,,Supersedes AGD84 to GDA94 (4) (code 1593) which itself replaced variant 3 (code1159).  Input expects longitudes to be positive west; EPSG GeogCRS AGD84 (code 4203) and GDA94 (code 4283) both have longitudes positive east.,GDA Technical Manual.  http://www.anzlic.org.au/icsm/gdatm/chapter7.htm,EPSG,2002-01-18 00:00:00,,1,0
+1805,Garoua to WGS 72BE (1),transformation,4197,4324,ELF-Cmr,1,2590,Oil industry exploration.,9603,,,Derived in 1981 by Decca Survey France for Elf Serepca.,TotalFinaElf,EPSG,2002-02-12 00:00:00,,1,0
+1806,Kousseri to WGS 72BE (1),transformation,4198,4324,ELF-Cmr,1,2591,Oil industry expoloration.,9603,,,Derived in 1981 by Decca Survey France for Elf Serepca.,TotalFinaElf,EPSG,2002-02-12 00:00:00,,1,0
+1807,Pulkovo 1942 to WGS 84 (13),transformation,4284,4326,BP-Aze Aioc95,13,1038,Oil industry operations by AIOC prior to 1997.,9606,,,"Derived via WGS72 values taken from SOCAR Magnavox 1502 manual. Used by AIOC 1995-1997 then superseded by the AIOC97 values (tfm code 1808).
+Do not confuse with AIOC95 vertical datum as used in southern Caspian Sea and at Sangachal terminal by AIOC.",BP,EPSG,2002-02-12 00:00:00,,1,0
+1808,Pulkovo 1942 to WGS 84 (14),transformation,4284,4326,BP-Aze Aioc97,14,2593,Oil industry operations.,9606,,,"Mean of 3 stations in western Georgia, 4 stations in eastern Georgia and 4 stations in eastern Azerbaijan.  Derived for use on AIOC early oil western export pipeline, but adopted for all AIOC work superseding the 1995 AIOC transformation (code 1807).",BP,EPSG,2002-02-12 00:00:00,,1,0
+1809,Pulkovo 1942 to WGS 84 (15),transformation,4284,4326,TFE-Aze97,15,2594,Oil industry operations.,9606,,,Parameter values calculated by Elf Exp[loration and Production based on geodetic survey carried out by Azerbaijan State Committee for Geodesy and Cartography.,TotalFinaElf,EPSG,2002-02-12 00:00:00,,1,0
+1810,ED50 to WGS 84 (31),transformation,4230,4326,wgc72-Egy,31,2595,Oil industry exploration and production operations.,9606,,,Derived via concatenation through WGS72.  The ED50 to WGS72 step is the Sepplin 1974 value for all Europe.,Western Geophysical,EPSG,2002-02-12 00:00:00,,1,0
+1811,PSAD56 to WGS 84 (12),transformation,4248,4326,PB-Braz N,12,1754,Oil industry exploration.,9603,,,Used by Petrobras for shelf operations.,Petrobras,EPSG,2002-02-12 00:00:00,,1,0
+1812,Indian 1975 to WGS 84 (4),transformation,4240,4326,Auslig-Tha,4,1231,Cadastral survey.,9606,,,,Auslig via GPS World.,EPSG,2002-02-12 00:00:00,,1,0
+1813,Batavia to WGS 84 (2),transformation,4211,4326,ARCO-Idn ONWJ,2,2577,Oil industry operations.,9603,,,,Arco geodetic database,EPSG,2002-02-12 00:00:00,,1,0
+1814,Batavia to WGS 84 (3),transformation,4211,4326,KOM-Idn EJGP,3,2588,Oil industry operations.,9603,,,Used by PT Komaritim for Nippon Steel during East Java Gas Pipeline construction.,PT Komaritim report S808/91.,EPSG,2002-02-12 00:00:00,,1,0
+1815,Nord Sahara 1959 to WGS 84 (4),transformation,4307,4326,BP-Alg D3,4,2598,Oil industry operations.,9606,,,Used by BP in District 3 and In Salah Gas.,BP,EPSG,2002-02-12 00:00:00,,1,0
+1816,Nord Sahara 1959 to WGS 84 (5),transformation,4307,4326,BPA-Alg InAm,5,2599,Oil industry operations.,9603,,,Derived at astro station central to concession.  Significant and varying differences (>100m) at 4 neighbouring astro stations.,BP,EPSG,2002-02-12 00:00:00,,1,0
+1817,Nord Sahara 1959 to WGS 84 (6),transformation,4307,4326,ARCO-Alg HBR,6,2600,Oil industry operations.,9603,,,Derived at astro station Guerrara.,Arco geodetic database,EPSG,2002-02-12 00:00:00,,1,0
+1818,Minna to WGS 84 (4),transformation,4263,4326,RSL-Nga,4,1717,Oil industry operations.,9606,,,Concatenated via WGS 72BE. Adopted by Statoil.,Racal Survey Nigeria,EPSG,2002-02-12 00:00:00,,1,0
+1819,Minna to WGS 84 (5),transformation,4263,4326,SPD-Nga S,5,2371,Oil industry operations.,9606,,,Used by Shell in southern Nigeria and Total in OPL246.,TotalFinaElf,EPSG,2002-02-12 00:00:00,,1,1
+1820,Minna to WGS 84 (6),transformation,4263,4326,CON89-Nga,6,1717,Oil industry operations.,9603,,,Derived by Nortech at station L40 Minna using NNPC 1989 GPS network tied to 4 ADOS stations. Used by Conoco in OPLs 219-220 to cm precision and ExxonMobil in OPL 209 to dm precision..,TotalFinaElf,EPSG,2002-07-16 00:00:00,2002.29,1,0
+1821,Minna to WGS 84 (7),transformation,4263,4326,ELF94-Nga,7,1717,Oil industry operations.,9603,,,"Derived by Elf Petroleum Nigeria in 1994 at 3 stations (M101 onshore, offshore platforms XSW06 and XSV39) and used in OMLs 99-102 and OPLs 222-223.",TotalFinaElf,EPSG,2002-07-16 00:00:00,2002.29,1,0
+1822,Minna to WGS 84 (8),transformation,4263,4326,SHL-Nga OPL W,8,1717,Oil industry exploration and production.,9603,,,"Used by Shell SNEPCO for OPLs 209-213 and 316. Derived during 1990 Niger Delta control survey at 4 stations (XSU27, 30 31 and 35).",Shell Nigeria Exploration and Production Company,EPSG,2002-03-15 00:00:00,,1,0
+1823,Minna to WGS 84 (9),transformation,4263,4326,SHL-Nga OPL S,9,1717,Oil industry exploration and production.,9603,,,"Used by Shell SNEPCO for OPLs 217-223. Derived during 1990 Niger Delta control survey at 4 stations (XSU38, 41, 44 and 45).",Shell Nigeria Exploration and Production Company,EPSG,2002-03-15 00:00:00,,1,0
+1824,Minna to WGS 84 (10),transformation,4263,4326,SHL-Nga Gongola,10,2371,Oil industry exploration and production.,9603,,,Used by Shell SNEPCO for Gongola basin.,Shell International Exploration and Production,EPSG,2002-03-15 00:00:00,,1,0
+1825,Hong Kong 1980 to WGS 84 (1),transformation,4611,4326,LSD-HKG 2002,1,1118,Accuracy to 1m level.,9606,,,Published 1st March 2002.,"Geodetic Survey Section, Survey and Mapping Office, Lands Department, Hong Kong. http://www.info.gov.hk/landsd/mapping/tindex.htm",EPSG,2002-06-22 00:00:00,,1,0
+1826,JGD2000 to WGS 84 (1),transformation,4612,4326,EPSG-Jpn,1,1129,Approximation at the +/- 1m level.,9603,,,,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+1827,Tokyo to WGS 84 (6),transformation,4301,4326,GSI-Jpn 452141,6,2425,For medium accuracy.,9618,,,,http://vldb.gsi.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,2002-06-22 00:00:00,,1,0
+1828,Yoff to WGS 72 (1),transformation,4310,4322,DMA-SEN,1,1207,Military survey.,9603,,,,DMA,EPSG,2002-06-22 00:00:00,,1,0
+1829,HD72 to ETRS89 (1),transformation,4237,4258,FOMI-Hun,1,1119,Accuracy at decimetre level throughout Hungary.,9607,,,May be taken as approximate transformation HD72 to WGS 84 - see code 1830.,Institute of Geodetic Survey and Remote Sensing (FOMI) reflected at http://lazarus.elte.hu/gb/geodez/geod5.htm,EPSG,2002-06-22 00:00:00,,1,0
+1830,HD72 to WGS 84 (1),transformation,4237,4326,EPSG-Hun,1,1119,Approximation at the +/- 1m level assuming that ETRS89 is equivalent to WGS 84.,9607,,,Parameter values taken from HD72 to ETRS89 (1) (code 1829) assuming that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+1831,HD72 to WGS 84 (2),transformation,4237,4326,ELTE-Hun,2,1119,Accuracy better than 1m in all three dimensions throughout Hungary.,9603,,,Derived at fundamental point Szolohegy and tested at 99 stations throughout Hungary.,"Timar, Molnar and Pasztor; Eotvos University, in Geodezia es Kartografia 54(1) pp11-16.  www.fomi.hu/internet/magyar/szaklap/geodkart.htm",EPSG,2002-06-22 00:00:00,,1,0
+1832,ID74 to WGS 84 (2),transformation,4238,4326,Rac91-Idn,2,1122,For oil industry purposes.,9606,,,Derived via coordinates of 2 Pulse8 stations. Use of D74 to WGS 84 (3) (code 1833) is recommended.,Racal Survey,EPSG,2002-06-22 00:00:00,,1,0
+1833,ID74 to WGS 84 (3),transformation,4238,4326,Bak-Idn,3,1122,"Standard deviations of translations are 1.3, 1.1 and 3.6m, of rotations 0.11, 0.06 and 0.04 sec and ppm 0.18.",9607,,,Derived at 38 stations.,Bakosurtanal.,EPSG,2002-06-22 00:00:00,,1,0
+1834,Segara to WGS 84 (1),transformation,4294,4326,NIMA-Idn Kal,1,2354,For military purposes.,9603,,,Accuracy estimate not available.,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,2002-06-22 00:00:00,,1,0
+1835,Segara to WGS 84 (2),transformation,4294,4326,Shl-Idn Kal E,2,1360,Oil exploration.,9603,,,,Shell,EPSG,2002-06-22 00:00:00,,1,0
+1836,Segara to WGS 84 (3),transformation,4294,4326,Shl-Idn Kal NE,3,2770,Oil exploration.,9603,,,,Shell,EPSG,2002-06-22 00:00:00,,1,0
+1837,Makassar to WGS 84 (1),transformation,4257,4326,Shl-Idn Sul SW,1,1316,Oil exploration.,9603,,,,Shell,EPSG,2002-06-22 00:00:00,,1,0
+1838,Segara to WGS 84 (4),transformation,4613,4326,TOT-Idn Mah,4,1328,Oil exploration.,9603,,,Datum shift derived through ITRF93.,Total Indonesia.,EPSG,2002-06-22 00:00:00,,1,0
+1839,Beduaram to WGS 72BE (1),transformation,4213,4324,ELF-Ner SE,1,2771,Oil exploration.,9603,,,,TotalFinaElf,EPSG,2002-06-28 00:00:00,,1,0
+1840,QND95 to WGS 84 (1),transformation,4614,4326,CGIS-Qat,1,1346,Parameter values are defined and therefore exact.,9606,,,"Transformation defines QND95. May be approximated to 1m throughout Qatar by geocentric translation transformation with dX=-127.78098m, dY=-283.37477m, dZ=+21.24081m.",Qatar Centre for Geographic Information.,EPSG,2002-06-28 00:00:00,,1,0
+1841,ATS77 to NAD83(CSRS) (1),transformation,4122,4617,GIC-Can NB,1,1447,Accuracy 1-2 metres.,9615,,,Introduced in 1999. Can be taken as an approximate transformation ATS77 to WGS 84 - see code 1688.,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,2002-07-13 00:00:00,,1,0
+1842,NAD83(CSRS) to WGS 84 (1),transformation,4617,4326,EPSG-Can,1,1336,Approximation at the +/- 1m level assuming that NAD83(CSRS) is equivalent to WGS 84.,9603,,,For many purposes NAD83(CSRS) can be considered to be coincident with WGS 84.,EPSG,EPSG,2002-07-13 00:00:00,,1,0
+1843,NAD83 to NAD83(CSRS) (1),transformation,4269,4617,SGQ-Can QC,1,1368,Accuracy 1-2 metres.,9615,,,Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD83 (code 4269) and NAD83(CSRS) (code 4617) have longitudes positive east. Can be taken as an approximate transformation NAD83 to WGS 84 - see code 1696.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,2002-07-13 00:00:00,,1,0
+1844,NAD27 to NAD83(CSRS) (1),transformation,4267,4617,SGQ-Can QC,1,1368,Accuracy 1-2 metres.,9615,,,Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD27 (code 4267) and NAD83(CSRS) (code 4617) have longitudes positive east. Can be taken as an approximate transformation NAD27 to WGS 84 - see code 1692.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,2002-07-13 00:00:00,,1,0
+1845,NAD27(CGQ77) to NAD83(CSRS) (1),transformation,4609,4617,SGQ-Can QC,1,1368,Accuracy 1-2 metres.,9615,,,Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD27(CGQ77) (code 4609) and NAD83(CSRS) (code 4617) have longitudes positive east. Can be taken as an approximate transformation NAD27(CGQ77) to WGS 84 - see code 1691.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,2002-07-13 00:00:00,,1,0
+1846,ATS77 to NAD83(CSRS) (2),transformation,4122,4617,PEI DOT-Can PEI,2,1533,Accuracy 1-2 metres.,9615,,,Can be taken as an approximate transformation ATS77 to WGS 84 - see code 1689.,PEI Department of Transportation & Public Works,EPSG,2002-07-13 00:00:00,,1,0
+1847,NAD27 to NAD83(CSRS) (2),transformation,4267,4617,SK PMC-Can SK,2,2375,Accuracy 1-2 metres.,9615,,,Can be taken as an approximate transformation NAD27 to WGS 84 - see code 1703.,Dir Geodetic Surveys; SaskGeomatics Div.; Saskatchewan Property Management Company.,EPSG,2002-07-13 00:00:00,,1,0
+1848,NAD83 to NAD83(CSRS) (2),transformation,4269,4617,SK PMC-Can SK,2,2375,Accuracy 1-2 metres.,9615,,,Can be taken as an approximate transformation NAD83 to WGS 84 - see code 1697.,Dir Geodetic Surveys; SaskGeomatics Div.; Saskatchewan Property Management Company.,EPSG,2002-07-13 00:00:00,,1,0
+1849,NAD83 to NAD83(CSRS) (3),transformation,4269,4617,AB Env-Can AB,3,2376,Accuracy 1-2 metres.,9615,,,"This gridded difference file  AB_CSRS.DAC will need to be renamed to AB_CSRS.gsb to run in some software suites.  Formats identical, but AB file is provincial fit only.  Can be taken as an approximate transformation NAD83 to WGS 84 - see code 1702.",Geodetic Control Section; Land and Forest Svc; Alberta Environment; http://www.gov.ab.ca/env/land/dos/ or email to geoff.banham at gov.ab.ca [...]
+1850,ATS77 to NAD83(CSRS) (3),transformation,4122,4617,NSGC-Can NS,2,2313,Accuracy 1-2 metres.,9615,,,Can be taken as an approximate transformation ATS77 to WGS 84 - see code 1851.,Nova Scotia Geomatics Centre -   Contact aflemmin at linux1.nsgc.gov.ns.ca or telephone 902-667-6409,EPSG,2002-07-13 00:00:00,,1,0
+1851,ATS77 to WGS 84 (3),transformation,4122,4326,EPSG-Can NS,2,2313,Approximation at the +/- 1m level.,9615,,,Parameter file is from ATS77 to NAD83(CSRS) (3) (code 1850) assuming that NAD83(CSRS) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2002-07-13 00:00:00,,1,0
+1852,Timbalai 1948 to WGS 84 (4),transformation,4298,4326,SSB-Mys E,4,2780,Oil exploration.,9606,,,Derived by Racal Survey for SSB at 24 coastal stations (including Timbalai fundamental point and 6 other primary triangulation stations) between in Sabah (Kudat southwards) and Sarawak (Sibu northwards).,Sarawak Shell Berhard,EPSG,2002-07-13 00:00:00,,1,0
+1854,FD58 to WGS 84 (2),transformation,4132,4326,TFE-Irn Lavan,2,2782,Oil Exploration,9603,,,Derived by Geoid for Elf in 1999.  EGM96 geoid used.,TotalFinaElf,EPSG,2002-07-13 00:00:00,,1,0
+1855,FD58 to WGS 84 (3),transformation,4132,4326,TFE-Irn Kharg,3,2781,Oil Exploration,9603,,,Derived by Geoid for Elf in 1999.  EGM96 geoid used.,TotalFinaElf,EPSG,2002-07-13 00:00:00,,1,0
+1856,ED50(ED77) to WGS 84 (3),transformation,4154,4326,TFE-Irn SPars,3,2783,Oil Exploration,9603,,,Derived in Kangan district by Geoid for Total in 1998.  Used for South Pars phases 2 and 3.,TotalFinaElf,EPSG,2002-07-13 00:00:00,,1,0
+1857,ED50(ED77) to WGS 84 (4),transformation,4154,4326,TFE-Irn Lavan,4,2782,Oil Exploration,9603,,,Derived in 1999 on Lavan island by Geoid for Elf.,TotalFinaElf,EPSG,2002-07-13 00:00:00,,1,0
+1858,ED50(ED77) to WGS 84 (5),transformation,4154,4326,TFE-Irn Kharg,5,2781,Oil Exploration,9603,,,Derived by Geoid for Elf in 1999.  EGM96 geoid used.,TotalFinaElf,EPSG,2002-07-13 00:00:00,,1,0
+1859,ELD79 to WGS 84 (1),transformation,4159,4326,REP-Lby MZQ,1,2785,Oil Exploration,9603,,,Used by Repsol. Reliability of connection to ELD79 questionned.,Oil industry sources.,EPSG,2002-07-16 00:00:00,,1,0
+1860,ELD79 to WGS 84 (2),transformation,4159,4326,TFE-Lby MZQ,2,2785,Oil Exploration. 3-dimensional SD at 11 points is 0.5m.,9603,,,Derived December 2001 by NAGECO. Connected to ITRF via Remsa 2000 data. Used by TotalFinaElf.,TotalFinaElf,EPSG,2002-07-16 00:00:00,,1,0
+1861,ELD79 to WGS 84 (3),transformation,4159,4326,TFE-Lby MBK94,3,2786,Oil Exploration,9603,,,Derived by GEOID in 1994 from Transit satellite data. Used by TotalFinaElf.,TotalFinaElf,EPSG,2002-07-16 00:00:00,,1,0
+1862,ELD79 to WGS 84 (4),transformation,4159,4326,TFE-Lby MBK00,4,2786,Oil Exploration,9606,,,Derived by Geoid in 2000 from ITRF connection by NAGECO for TotalFinaElf. For historic compatibility TFE use the 1994 tfm ELD79 to WGS 84 (3) (code 1861).,TotalFinaElf,EPSG,2002-07-16 00:00:00,,1,0
+1863,ELD79 to WGS 84 (5),transformation,4159,4326,GMRA-Lby,5,2786,Engineering survey and oil exploration,9607,,,Derived for the Great Man-made River Authority (GMRA). Used by Saga in Mabruk blocks A and B.,Norsk Hydro,EPSG,2002-07-16 00:00:00,,1,0
+5400,Baltic to Caspian,transformation,5705,5706,Caspian Sea,1,2314,Vertical datum change for hydrographic charting.,9616,,,Baltic datum is 28m above Caspian datum.,,EPSG,1999-09-07 00:00:00,97.61,1,0
+5401,Belfast to Malin Head,transformation,5732,5731,OSNI-Gbr NI,1,1305,Vertical datum change for large scale topographic mapping and engineering survey.,9616,,,Belfast datum is 37mm above Malin Head datum.,,EPSG,2001-11-06 00:00:00,,1,0
+5402,Baltic to AIOC95,transformation,5705,5734,AIOC95-Aze,1,2592,Vertical datum change for engineering surveying.,9616,,,Baltic datum is 26.3m above AIOC95 datum.,BP,EPSG,2002-02-12 00:00:00,,1,0
+5403,AIOC95 to Caspian,transformation,5734,5706,AIOC95-Aze,1,2592,Vertical datum change for hydrographic charting.,9616,,,AIOC95 datum is 1.7m above Caspian datum.,BP,EPSG,2002-02-12 00:00:00,,1,0
+5404,Baltic to Black Sea,transformation,5705,5735,Black Sea,1,1102,Vertical datum change.,9616,,,Baltic datum is 0.4m above Black Sea datum.,BP,EPSG,2002-02-12 00:00:00,,1,0
+5405,Hong Kong Principal height to Hong Kong Chart depth,transformation,5738,5739,SMO-HK,1,1118,Vertical datum change for hydrographic charting.,9616,,,HKPD is 0.146m above chart datum.,"Survey and Mapping Office, Lands Department. Http://www.info.gov.hk/landsd/mapping/tindex.htm",EPSG,2002-06-22 00:00:00,,1,0
+8046,ED50 to WGS 84 (14),concatenated operation,4230,4326,5Nat-NSea90,14,2330,Primarily oil industry usage.,,,,"1990 agreement between Denmark, Germany, Great Britain, Netherlands and Norway.  Supersedes 1981 6-nations agreement between ED50 and WGS72 or WGS72BE. Only actively used offshore Norway but see ED50 to WGS 84 (24) (code 1613) for simpler transformation.","Norwegian Mapping Authority publication 1990:1 ""The transformation between ED50 and WGS84 for exploration purposes in the  [...]
+8047,ED50 to WGS 84 (15),concatenated operation,4230,4326,NMA-Nor N65 1991,15,2331,Oil exploration before 2001.,,,,"Superseded by codes 8569 and 1612 in 1997 and 2001.
+The concatenation of transformations 1147 and 1146 gives the following position vector tfm: dX=-84.491  dY=-100.559  dZ=-114.209 metres rX= -2.4006  rY=-0.5367  rZ=-2.3742 microradians  dS=+0.2947 ppm.","Statenskartverk note of January 1991 ""Om transformasjon mellom geodetiske datum i Norge"".",EPSG,1996-10-18 00:00:00,,1,0
+8094,NTF (Paris) to WGS 84 (1),concatenated operation,4807,4326,EPSG-Fra,1,1096,?,,,,,EPSG,EPSG,1996-10-18 00:00:00,,1,0
+8174,Bogota 1975 (Bogota) to WGS 84 (1),concatenated operation,4802,4326,DMA-Col,1,1070,"For military purposes.  Accuracy 6m, 5m and 6m in X, Y and Z axes.",,,,,EPSG,EPSG,1997-04-11 00:00:00,,1,0
+8175,Monte Mario (Rome) to WGS 84 (1),concatenated operation,4806,4326,EPSG-Ita,1,2339,For military purposes.  Accuracy 25m in each axis.,,,,,EPSG,EPSG,1997-04-11 00:00:00,,1,0
+8176,Tananarive (Paris) to WGS 84 (1),concatenated operation,4810,4326,EPSG-Mdg,1,1149,For military purposes.  Accuracy not available.,,,,,EPSG,EPSG,1997-04-11 00:00:00,,1,0
+8178,Batavia (Jakarta) to WGS 84 (1),concatenated operation,4813,4326,EPSG-Idn Sumatra,1,1355,For military purposes.  Accuracy 3m in each axis.,,,,,EPSG,EPSG,1997-04-11 00:00:00,,1,0
+8183,HD72 to WGS 84 (1),concatenated operation,4237,4326,EPSG-Hun,1,1119,Approximation at the +/- 1m level assuming that ETRS89 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that ETRF89 is equivalent to WGS 84.,EPSG,EPSG,1997-07-22 00:00:00,,1,1
+8186,NTF (Paris) to ED50 (1),concatenated operation,4807,4230,EPSG-Fra,1,1096,?,,,,,EPSG,EPSG,1997-11-13 00:00:00,,1,0
+8188,NTF (Paris) to WGS 72 (1),concatenated operation,4807,4322,EPSG-Fra,1,1096,?,,,,,EPSG,EPSG,1997-11-13 00:00:00,,1,0
+8190,AGD66 to WGS 84 (2),concatenated operation,4202,4326,EPSG-Aus 5m,2,1036,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.  0.1m accuracy.,EPSG,EPSG,1998-12-16 00:00:00,98.50,1,1
+8192,AGD84 to WGS 84 (3),concatenated operation,4203,4326,EPSG-Aus 5m,3,1036,5m accuracy. Approximation assuming that GDA94 is equivalent to WGS 84.,,,,Approximation assuming that GDA94 is equivalent to WGS 84.,EPSG,EPSG,1998-12-16 00:00:00,98.50,1,1
+8194,AGD84 to WGS 84 (4),concatenated operation,4203,4326,EPSG-Aus 1m,4,1036,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,EPSG,EPSG,1998-12-16 00:00:00,98.50,1,1
+8195,RT90 to WGS 84 (1),concatenated operation,4124,4326,EPSG-Swe,1,1225,Approximation at the +/- 1m level assuming that ETRS89 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that ETRF89 is equivalent to WGS 84.,EPSG,EPSG,1999-04-22 00:00:00,99.11,1,1
+8199,Pulkovo 1942 to WGS 84 (2),concatenated operation,4284,4326,EPSG-Ltu,2,1145,Approximation at the +/- 1m level assuming that LKS94(ETRS89) is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that LKS94(ETRS89) is equivalent to WGS 84.,EPSG,EPSG,1998-03-12 00:00:00,,1,1
+8211,Voirol 1875 (Paris) to WGS 84 (1),concatenated operation,4811,4326,EPSG-Dza N,1,2347,Oil exploration.,,,,,EPSG,EPSG,1998-03-12 00:00:00,,1,0
+8215,Tete to WGS 84 (1),concatenated operation,4127,4326,EPSG-Moz,1,1167,Approximation at the +/- 1m level assuming that Moznet is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that Moznet is equivalent to WGS 84.,EPSG,EPSG,1998-04-16 00:00:00,,1,1
+8217,Tete to WGS 84 (2),concatenated operation,4127,4326,EPSG-Moz A,2,2350,Approximation at the +/- 1m level assuming that Moznet is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that Moznet is equivalent to WGS 84.,EPSG,EPSG,1998-04-16 00:00:00,,1,1
+8219,Tete to WGS 84 (3),concatenated operation,4127,4326,EPSG-Moz B,3,2351,Approximation at the +/- 1m level assuming that Moznet is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that Moznet is equivalent to WGS 84.,EPSG,EPSG,1998-04-16 00:00:00,,1,1
+8221,Tete to WGS 84 (4),concatenated operation,4127,4326,EPSG-Moz C,4,2352,Approximation at the +/- 1m level assuming that Moznet is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that Moznet is equivalent to WGS 84.,EPSG,EPSG,1998-04-16 00:00:00,,1,1
+8223,Tete to WGS 84 (5),concatenated operation,4127,4326,EPSG-Moz D,5,2353,Approximation at the +/- 1m level assuming that Moznet is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that Moznet is equivalent to WGS 84.,EPSG,EPSG,1998-04-16 00:00:00,,1,1
+8234,DHDN to WGS 84 (1),concatenated operation,4314,4326,EPSG-Deu W,1,2326,Approximation at the +/- 1m level assuming that ETRS89 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that ETRF89 is equivalent to WGS 84.,EPSG,EPSG,1998-06-30 00:00:00,,1,1
+8236,Pulkovo 1942 to WGS 84 (11),concatenated operation,4284,4326,EPSG-Deu E,11,1343,Approximation at the +/- 1m level assuming that ETRF89 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that ETRF89 is equivalent to WGS 84.,EPSG,EPSG,1998-06-30 00:00:00,,1,1
+8241,Madrid 1870 (Madrid) to WGS 84 (1),concatenated operation,4903,4326,EPSG-Esp,1,1217,?,,,,,See individual transformations.,EPSG,1998-11-11 00:00:00,,1,0
+8243,NAD27 to WGS 84 (25),concatenated operation,4267,4326,EPSG-Can old,25,1061,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.  Superseded by NAD27 to WGS 84 (27) (code 8404) in Quebec and NAD27 to WGS 84 (26) (code 8245) elsewhere in Canada.,EPSG,EPSG,1998-11-11 00:00:00,,1,1
+8245,NAD27 to WGS 84 (26),concatenated operation,4267,4326,EPSG-Can,26,1061,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,EPSG,EPSG,1998-11-11 00:00:00,,1,1
+8263,MGI (Ferro) to WGS 84 (1),concatenated operation,4805,4326,DMA-balk,1,2370,For military purposes only.,,,,Accuracy estimate is not available.,EPSG,EPSG,1998-12-12 00:00:00,,1,0
+8386,Old Hawaiian to WGS 84 (1),concatenated operation,4135,4326,EPSG-Usa Hi,1,1334,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8388,St. Lawrence Island to WGS 84 (1),concatenated operation,4136,4326,EPSG-Usa AK StL,1,1332,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8390,St. Paul Island to WGS 84 (1),concatenated operation,4137,4326,EPSG-Usa AK StP,1,1333,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8392,St. George Island to WGS 84 (1),concatenated operation,4138,4326,EPSG-Usa AK StG,1,1331,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8394,NAD27(CGQ77) to WGS 84 (1),concatenated operation,4609,4326,EPSG-Can Qc NT1,1,1368,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.  Superseded by NAD27(CGQ77) to WGS 84 (2) (code 8564).,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8396,AGD66 to WGS 84 (3),concatenated operation,4202,4326,EPSG-Aus ACT 1m,3,2283,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.  Superseded by AGD66 to WGS 84 (11) (code 8581).,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8398,AGD66 to WGS 84 (4),concatenated operation,4202,4326,EPSG-Aus Tas 1m,4,1282,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.  Superseded by AGD66 to WGS 84 (9) (code 8576).,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8400,AGD66 to WGS 84 (5),concatenated operation,4202,4326,EPSG-Aus NSW Vic 1m,5,2286,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8402,Puerto Rico to WGS 84 (1),concatenated operation,4139,4326,EPSG-PRVI,1,1335,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8404,NAD27 to WGS 84 (27),concatenated operation,4267,4326,EPSG-Can QC,27,1368,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.  Superseded by NAD27 to WGS 84 (31) (code 8565).,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8406,NAD27(76) to WGS 84 (1),concatenated operation,4608,4326,EPSG-Can On,1,1367,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83 is equivalent to WGS 84.,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8408,AGD66 to WGS 84 (6),concatenated operation,4202,4326,EPSG-Aus Vic 0.1m,6,2285,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.   Superseded by AGD66 to WGS 84 (11) (code 8578).,EPSG,EPSG,1999-05-24 00:00:00,,1,1
+8418,ATS77 to WGS 84 (1),concatenated operation,4122,4326,EPSG-Can NB,1,1447,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,EPSG,EPSG,1999-10-20 00:00:00,,1,1
+8419,ATS77 to WGS 84 (2),concatenated operation,4122,4326,EPSG-Can PEI,2,1533,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8420,NAD27 to WGS 84 (32),concatenated operation,4267,4326,SK PMC-Can SK,32,2375,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,,,,,Dir Geodetic Surveys; SaskGeomatics Div.; Saskatchewan Property Management Company.,EPSG,2000-10-19 00:00:00,,1,1
+8421,NAD83 to WGS 84 (7),concatenated operation,4269,4326,SK PMC-Can SK,7,2375,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,,,,,Dir Geodetic Surveys; SaskGeomatics Div.; Saskatchewan Property Management Company.,EPSG,2000-10-19 00:00:00,,1,1
+8422,NAD83 to WGS 84 (8),concatenated operation,4269,4326,Alb Env-Can AB,8,2376,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,,,,"The gridded difference file  AB_CSRS.DAC in STEP 1 will need to be renamed to AB_CSRS.gsb to run in some software suites.  Formats identical, but AB file is provincial fit only.",Geodetic Control Section; Land and Forest Svc; Alberta Environment; http://www.gov.ab.ca/env/land/dos/ or email to geoff.banham at gov.ab.ca,EPSG [...]
+8453,AGD66 to WGS 84 (7),concatenated operation,4202,4326,EPSG-Aus Tas 0.1m,7,1282,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,EPSG,EPSG,1999-10-20 00:00:00,,1,1
+8454,AGD66 to WGS 84 (8),concatenated operation,4202,4326,EPSG-Aus NT 0.1m,8,2284,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,EPSG,EPSG,1999-10-20 00:00:00,,1,1
+8457,CH1903+ to WGS 84 (1),concatenated operation,4150,4326,EPSG-CH,1,1286,Approximation at the +/- 1m level assuming that CHTRF95 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that CHTRF95 is equivalent to WGS 84.,EPSG,EPSG,1999-10-20 00:00:00,,1,1
+8460,NAD27 to NAD83(HARN) (1),concatenated operation,4267,4152,NGS-Usa AL,1,1372,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8590.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8461,NAD27 to NAD83(HARN) (2),concatenated operation,4267,4152,NGS-Usa AZ,2,1373,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8591.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8462,NAD27 to NAD83(HARN) (3),concatenated operation,4267,4152,NGS-Usa CA n,3,2297,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8593.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8463,NAD27 to NAD83(HARN) (4),concatenated operation,4267,4152,NGS-Usa CA s,4,2298,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8594.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8464,NAD27 to NAD83(HARN) (5),concatenated operation,4267,4152,NGS-Usa CO,5,1376,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8595.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8465,NAD27 to NAD83(HARN) (6),concatenated operation,4267,4152,NGS-Usa GA,6,1380,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8597.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8466,NAD27 to NAD83(HARN) (7),concatenated operation,4267,4152,NGS-Usa FL,7,1379,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8596.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8467,NAD27 to NAD83(HARN) (8),concatenated operation,4267,4152,NGS-Usa ID MT e,8,2382,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8611.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8468,NAD27 to NAD83(HARN) (9),concatenated operation,4267,4152,NGS-Usa ID MT w,9,2383,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8612.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8469,NAD27 to NAD83(HARN) (10),concatenated operation,4267,4152,NGS-Usa KY,10,1386,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8602.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8470,NAD27 to NAD83(HARN) (11),concatenated operation,4267,4152,NGS-Usa LA,11,1387,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8603.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8471,NAD27 to NAD83(HARN) (12),concatenated operation,4267,4152,NGS-Usa DE MD,12,2377,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8605.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8472,NAD27 to NAD83(HARN) (13),concatenated operation,4267,4152,NGS-Usa ME,13,1388,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8604.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8473,NAD27 to NAD83(HARN) (14),concatenated operation,4267,4152,NGS-Usa MI,14,1391,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8607.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8474,NAD27 to NAD83(HARN) (15),concatenated operation,4267,4152,NGS-Usa MS,15,1393,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8609.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8475,NAD27 to NAD83(HARN) (16),concatenated operation,4267,4152,NGS-Usa NE,16,1396,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8613.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8476,NAD27 to NAD83(HARN) (17),concatenated operation,4267,4152,NGS-Usa NewEng,17,2378,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8606.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8477,NAD27 to NAD83(HARN) (18),concatenated operation,4267,4152,NGS-Usa NM,18,1400,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8616.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8478,NAD27 to NAD83(HARN) (19),concatenated operation,4267,4152,NGS-Usa NY,19,1401,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8617.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8479,NAD27 to NAD83(HARN) (20),concatenated operation,4267,4152,NGS-Usa ND,20,1403,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8618.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8480,NAD27 to NAD83(HARN) (21),concatenated operation,4267,4152,NGS-Usa OK,21,1405,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8620.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8481,Puerto Rico to NAD83(HARN) (1),concatenated operation,4139,4152,NGS-PRVI,1,1335,Accuracy 0.1m at 67% confidence level.,,,,May be taken as approximate transformation Puerto Rico to WGS 84 - see code 8583.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8482,NAD27 to NAD83(HARN) (22),concatenated operation,4267,4152,NGS-Usa SD,22,1410,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8622.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8483,NAD27 to NAD83(HARN) (23),concatenated operation,4267,4152,NGS-Usa TN,23,1411,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8623.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8484,NAD27 to NAD83(HARN) (24),concatenated operation,4267,4152,NGS-Usa TX e,24,2379,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8624.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8485,NAD27 to NAD83(HARN) (25),concatenated operation,4267,4152,NGS-Usa TX w,25,2380,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8625.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8486,NAD27 to NAD83(HARN) (26),concatenated operation,4267,4152,NGS-Usa VA,26,1415,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8627.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8487,NAD27 to NAD83(HARN) (27),concatenated operation,4267,4152,NGS-Usa OR WA,27,2381,"Accuracy at 67% confidence level is 0.2m onshore, 5m nearshore and undetermined farther offshore.",,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8621.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8488,NAD27 to NAD83(HARN) (28),concatenated operation,4267,4152,NGS-Usa WI,28,1418,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8629.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8489,NAD27 to NAD83(HARN) (29),concatenated operation,4267,4152,NGS-Usa WY,29,1419,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8630.,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,1999-10-20 00:00:00,,1,0
+8496,NAD27 to WGS 84 (28),concatenated operation,4267,4326,NGS-Usa conus,28,2374,Geodetic survey.,,,,,Both transformations from US National Geodetic Survey.,EPSG,1999-10-20 00:00:00,,1,0
+8497,NAD27 to WGS 84 (29),concatenated operation,4267,4326,NGS-Usa AK,29,2373,Geodetic survey.,,,,,Both transformations from US National Geodetic Survey.,EPSG,1999-10-20 00:00:00,,1,1
+8508,Old Hawaiian to NAD83(HARN) (1),concatenated operation,4135,4152,NGS-Usa HI,1,1334,Assumes NAD83 is coincident with NAD83(HARN). Accuracy about 1m.,,,,"Uses NADCON method which expects longitudes positive west; EPSG GeogCRSs Old Hawaiian (code 4135), NAD83 (code 4269) and NAD83(HARN) have longitudes positive east.  May be taken as approximate transformation Old Hawaiin to WGS 84 - see code 8582.",US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00 [...]
+8509,NAD27 to NAD83(HARN) (30),concatenated operation,4267,4152,NGS-Usa IN,30,1383,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8599.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+8510,NAD27 to NAD83(HARN) (31),concatenated operation,4267,4152,NGS-Usa KS,31,1385,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8601.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+8511,NAD27 to NAD83(HARN) (32),concatenated operation,4267,4152,NGS-Usa NV,32,1397,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8614.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+8512,NAD27 to NAD83(HARN) (33),concatenated operation,4267,4152,NGS-Usa OH,33,1404,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8619.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+8513,NAD27 to NAD83(HARN) (34),concatenated operation,4267,4152,NGS-Usa UT,34,1413,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8626.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+8514,NAD27 to NAD83(HARN) (35),concatenated operation,4267,4152,NGS-Usa WV,35,1417,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8628.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+8517,Chos Malal 1914 to WGS 84 (1),concatenated operation,4160,4326,TOT-Arg Neu,1,2325,Oil exploration,,,,May be implemented using a single step geocentric translations of dx=+5.5m dY=+176.7m dZ=+141.4m.,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+8530,South Yemen to WGS 84 (1),concatenated operation,4164,4326,IGN-Yem South,1,1340,Approximation at the +/- 1m level assuming that NGN96 is equivalent to WGS 84.,,,,May be implemented as a single transformation using geocentric translations transformation method with parameter values dX=-76m dY=-138m dZ=+67m.,IGN Paris,EPSG,2000-03-07 00:00:00,,1,1
+8532,Indian 1960 to WGS 84 (1),concatenated operation,4131,4326,PV-Vnm,1,1495,Oil exploration.,,,,May be implemented as a single transformation using position vector 7-parameter geocentric transformation method with parameter values dX=+199m dY=+931m dZ=+318.9m rX=rY=0 sec rZ=+0.814 sec dS=-0.38 ppm.,Various oil company sources.,EPSG,2000-03-07 00:00:00,,1,0
+8537,Egypt 1907 to WGS 84 (2),concatenated operation,4229,4326,MCE-Egy,2,1086,Oil exploration.,,,,Used by Shell.  May be implemented as a single transformation using position vector 7-parameter geocentric transformation method with parameter values dX=-121.8m dY=+98.1m dZ=-10.7m rX=rY=0 sec rZ=+0.554 sec dS=+0.2263 ppm.,Maridive,EPSG,2000-03-07 00:00:00,,1,0
+8553,NAD27 to NAD83(HARN) (36),concatenated operation,4267,4152,NGS-Usa IL,36,1382,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8598.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+8554,NAD27 to NAD83(HARN) (37),concatenated operation,4267,4152,NGS-Usa NJ,37,1399,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8615.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2000-01-06 00:00:00,,1,0
+8560,AGD84 to WGS 84 (5),concatenated operation,4203,4326,EPSG-Aus WA,5,1280,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.  Superseded by AGD84 to WGS 84 (6) (code 8579).,EPSG,EPSG,2000-06-10 00:00:00,,1,1
+8562,Nord Sahara 1959 to WGS 84 (3),concatenated operation,4307,4326,CGG-Alg HM,3,2393,Oil exploration.,,,,Derived at IGN monument CFP19 using Transit.  Can be implemented as a single 7-param Position Vector transformation with parameter values of dX=-156m dY=-87.2m dZ=+287.8m; rX=rY=0 rZ=+0.814sec; dS=-0.38ppm.,,EPSG,2000-06-23 00:00:00,,1,0
+8563,NZGD49 to WGS 84 (3),concatenated operation,4272,4326,OSG-Nzl 1m,3,1175,Assumes WGS 84 is coincident with NZGD2000. Accuracy about 1m.,,,,Assumes WGS 84 is coincident with NZGD2000. Accuracy about 1m.,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8564,NAD27(CGQ77) to WGS 84 (2),concatenated operation,4609,4326,EPSG-Can Qc NT2,2,1368,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8565,NAD27 to WGS 84 (31),concatenated operation,4267,4326,EPSG-Can Que,31,1368,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8566,NAD83 to WGS 84 (6),concatenated operation,4269,4326,EPSG-Can Qc,6,1368,Approximation at the +/- 1m level assuming that NAD83(CSRS98) is equivalent to WGS 84.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8567,OSGB36 / National Grid to WGS 84 (1),concatenated operation,27700,4326,EPSG-Gbr,1,1264,Assumes ETRS89 is coincident with WGS 84.  Accuracy about 0.5m.,,,,Assumes ETRF89 is coincident with WGS 84.  Accuracy about 0.5m.,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8568,Deir ez Zor to WGS 84 (1),concatenated operation,4227,4326,EPSG-Syr,1,2329,Oil exploration,,,,"Can be implemented as a position vector tfm with param. values dX=-174.6  dY=-3.1 dZ=238.1m; rX=rY=0 rZ=0.814""; dS=-0.38 ppm.",EPSG,EPSG,2000-10-19 00:00:00,,1,0
+8569,ED50 to WGS 84 (21),concatenated operation,4230,4326,EPSG-Nor N65 1997,21,2332,Oil exploration before 1997/2001.,,,,Included in Statens Kartverk programme wsktrans between 1997 (v3.1) and 2001 (v4.0). Superseded by ED50 to WGS 84 (23) (code 1612) in April 2001.,EPSG guidance note #10.,EPSG,2000-10-19 00:00:00,2001.224,1,0
+8570,ED50 to ETRS89 (2),concatenated operation,4230,4258,5Nat-NSea98,2,2330,Offshore.,,,,Taken from ED50 to WGS 84 (14) (code 8046). In 1998 agreed that within the accuracy of that transformation WGS 84 equates to ETRS89 and the transformation would relate ED50 to ETRS89.,Statens Kartverk.,EPSG,2001-06-05 00:00:00,2000.72  2001.06,1,0
+8571,Accra to WGS 84 (2),concatenated operation,4168,4326,EPSG-Gha,2,1505,Oil industry.,,,,"Can be implemented as a position vector tfm with param. values dX=-171.16 dY=17.29 dZ=325.21m; rX=rY=0 rZ=0.814""; dS=-0.38 ppm. Found in use within oil industry erroneously concatenated as dX=-171.16 dY=17.29 dZ=327.81m; rX=rY0 rZ=0.554"" dS=0.2263 ppm.",EPSG,EPSG,2000-10-19 00:00:00,,1,0
+8572,Amersfoort to WGS 84 (2),concatenated operation,4289,4326,EPSG-Nld,2,1275,Approximation at the +/- 1m level assuming that ETRS89 is equivalent to WGS 84.,,,,Parameter values for step 1 from Amersfoort to ETRS89 (2) (code 1751). Step 2 assumes that ETRS89 is equivalent to WGS 84 within the accuracy of the transformation. Supersedes Amersfoort to WGS 84 (1) (code 1112).,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8573,RGF93 to WGS 84 (1),concatenated operation,4171,4326,EPSG-Fra,1,1096,Approximation at the +/- 1m level assuming that ETRS89 is equivalent to WGS 84.,,,,,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8574,American Samoa 1962 to WGS 84 (2),concatenated operation,4169,4326,EPSG-Asm,2,2288,"Transformation actually to NAD83(HARN), but for many purposes NAD83(HARN) can be considered to be coincident with WGS 84.",,,,"Transformation actually to NAD83(HARN), but for many purposes NAD83(HARNS) can be considered to be coincident with WGS 84.",EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8575,American Samoa 1962 to WGS 84 (3),concatenated operation,4169,4326,EPSG-Asm,3,2289,"Transformation actually to NAD83(HARN), but for many purposes NAD83(HARN) can be considered to be coincident with WGS 84.",,,,"Transformation actually to NAD83(HARN), but for many purposes NAD83(HARNS) can be considered to be coincident with WGS 84.",EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8576,AGD66 to WGS 84 (9),concatenated operation,4202,4326,EPSG-Aus Tas 1m,9,1282,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.  Supersedes AGD66 to WGS 84 (4) (code 8398).,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8577,AGD66 to WGS 84 (10),concatenated operation,4202,4326,EPSG-Aus NT,10,2284,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8578,AGD66 to WGS 84 (11),concatenated operation,4202,4326,EPSG-Aus,11,2287,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.   Supersedes AGD66 to WGS 84 (3) (code 8396) and AGD66 to WGS 84 (6) (code 8408).,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8579,AGD84 to WGS 84 (6),concatenated operation,4203,4326,EPSG-Aus WA,6,1280,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that GDA94 is equivalent to WGS 84.  Supersedes AGD84 to WGS 84 (5) (code 8560).,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8580,IRENET95 to WGS 84 (1),concatenated operation,4173,4326,OSI-Ire,1,1305,Approximation at the +/- 1m level assuming that ETRS89 is equivalent to WGS 84.,,,,Approximation at the +/- 1m level assuming that ETRS89 is equivalent to WGS 84.,EPSG,EPSG,2000-10-19 00:00:00,,1,1
+8581,PSD93 to WGS 84 (2),concatenated operation,4134,4326,PDO-Omn 93,2,1183,Oil exploration.,,,,"Superseded by PSD93 to WGS 84 (1) (code 1439) in 1997. Can be implemented as a position vector tfm with parameter values dX= -182.046 dY= -225.604 dZ=+173.384m rX= -0.616 rY= -1.655 rZ=+8.378"" dS=16.8673ppm.",Petroleum Development Oman,EPSG,2001-06-05 00:00:00,,1,0
+8582,Old Hawaiian to WGS 84 (2),concatenated operation,4135,4326,EPSG-Usa Hi,2,1334,Approximation at the +/- 1m level.,,,,Transformation steps are from Old Hawaiian to NAD83(HARN) (1) (code 8508) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8583,Puerto Rico to WGS 84 (2),concatenated operation,4139,4326,EPSG-PRVI,2,1335,Approximation at the +/- 1m level.,,,,Transformation steps are from Puerto Rico to NAD83(HARN) (1) (code 8481) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2002-01-18 00:00:00,2002.02,1,0
+8584,NAD27 to NAD83(CSRS98) (3),concatenated operation,4267,4140,EPSG-Can AB,3,2376,Accuracy 1-2 metres.,,,,Can be taken as an approximate transformation NAD27 to WGS 84 - see code 8585.,EPSG,EPSG,2001-08-15 00:00:00,,1,1
+8585,NAD27 to WGS 84 (36),concatenated operation,4267,4326,EPSG-Can AB,36,2376,Approximation at the +/- 1m level.,,,,Steps based on concatenated transformation NAD27 to NAD83(CSRS) (3) (code 8635) assuming that NAD83(CSRS) is equivalent to WGS 84.,EPSG,EPSG,2002-07-13 00:00:00,2002.41,1,0
+8586,NAD27 to NAD83(HARN) (38),concatenated operation,4267,4152,NGS-Usa AR,38,1374,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8592.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2001-08-15 00:00:00,,1,0
+8587,NAD27 to NAD83(HARN) (39),concatenated operation,4267,4152,NGS-Usa IA,39,1384,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8600.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2001-08-15 00:00:00,,1,0
+8588,NAD27 to NAD83(HARN) (40),concatenated operation,4267,4152,NGS-Usa MN,40,1392,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8608.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2001-08-15 00:00:00,,1,0
+8589,NAD27 to NAD83(HARN) (41),concatenated operation,4267,4152,NGS-Usa MO,41,1394,Accuracy at 67% confidence level is 0.2m.,,,,May be taken as approximate transformation NAD27 to WGS 84 - see code 8610.,US Coast & Geodetic Survey  ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon,EPSG,2001-08-15 00:00:00,,1,0
+8590,NAD27 to WGS 84 (37),concatenated operation,4267,4152,EPSG-Usa AL,37,1372,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (1) (code 8460) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8591,NAD27 to WGS 84 (38),concatenated operation,4267,4326,EPSG-Usa AZ,38,1373,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (2) (code 8461) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8592,NAD27 to WGS 84 (39),concatenated operation,4267,4326,EPSG-Usa AR,39,1374,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (38) (code 8586) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8593,NAD27 to WGS 84 (40),concatenated operation,4267,4326,EPSG-Usa CA n,40,2297,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (3) (code 8462) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8594,NAD27 to WGS 84 (41),concatenated operation,4267,4326,EPSG-Usa CA s,41,2298,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (4) (code 8463) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8595,NAD27 to WGS 84 (42),concatenated operation,4267,4326,EPSG-Usa CO,42,1376,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (5) (code 8464) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8596,NAD27 to WGS 84 (43),concatenated operation,4267,4326,EPSG-Usa FL,43,1379,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (7) (code 8466) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8597,NAD27 to WGS 84 (44),concatenated operation,4267,4326,EPSG-Usa GA,44,1380,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (6) (code 8465) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8598,NAD27 to WGS 84 (45),concatenated operation,4267,4326,EPSG-Usa IL,45,1382,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (36) (code 8553) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8599,NAD27 to WGS 84 (46),concatenated operation,4267,4326,EPSG-Usa IN,46,1383,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (30) (code 8509) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8600,NAD27 to WGS 84 (47),concatenated operation,4267,4326,EPSG-Usa IA,47,1384,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (39) (code 8587) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8601,NAD27 to WGS 84 (48),concatenated operation,4267,4326,EPSG-Usa KS,48,1385,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (31) (code 8510) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8602,NAD27 to WGS 84 (49),concatenated operation,4267,4326,EPSG-Usa KY,49,1386,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (10) (code 8469) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8603,NAD27 to WGS 84 (50),concatenated operation,4267,4326,EPSG-Usa LA,50,1387,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (11) (code 8470) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8604,NAD27 to WGS 84 (51),concatenated operation,4267,4326,EPSG-Usa ME,51,1388,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (13) (code 8472) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8605,NAD27 to WGS 84 (52),concatenated operation,4267,4326,EPSG-Usa DE MD,52,2377,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (12) (code 8471) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8606,NAD27 to WGS 84 (53),concatenated operation,4267,4326,EPSG-Usa NewEng,53,2378,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (17) (code 8476) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8607,NAD27 to WGS 84 (54),concatenated operation,4267,4326,EPSG-Usa MI,54,1391,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (14) (code 8473) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8608,NAD27 to WGS 84 (55),concatenated operation,4267,4326,EPSG-Usa MN,55,1392,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (40) (code 8588) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8609,NAD27 to WGS 84 (56),concatenated operation,4267,4326,EPSG-Usa MS,56,1393,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (15) (code 8474) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8610,NAD27 to WGS 84 (57),concatenated operation,4267,4326,EPSG-Usa MO,57,1394,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (41) (code 8589) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8611,NAD27 to WGS 84 (58),concatenated operation,4267,4326,EPSG-Usa ID MT e,58,2382,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (8) (code 8467) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8612,NAD27 to WGS 84 (59),concatenated operation,4267,4326,EPSG-Usa ID MT w,59,2383,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (9) (code 8468) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8613,NAD27 to WGS 84 (60),concatenated operation,4267,4326,EPSG-Usa NE,60,1396,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (16) (code 8475) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8614,NAD27 to WGS 84 (61),concatenated operation,4267,4326,EPSG-Usa NV,61,1397,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (32) (code 8511) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8615,NAD27 to WGS 84 (62),concatenated operation,4267,4326,EPSG-Usa NJ,62,1399,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (37) (code 8554) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8616,NAD27 to WGS 84 (63),concatenated operation,4267,4326,EPSG-Usa NM,63,1400,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (18) (code 8477) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8617,NAD27 to WGS 84 (64),concatenated operation,4267,4326,EPSG-Usa NY,64,1401,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (19) (code 8478) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8618,NAD27 to WGS 84 (65),concatenated operation,4267,4326,EPSG-Usa ND,65,1403,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (20) (code 8479) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8619,NAD27 to WGS 84 (66),concatenated operation,4267,4326,EPSG-Usa OH,66,1404,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (33) (code 8512) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8620,NAD27 to WGS 84 (67),concatenated operation,4267,4326,EPSG-Usa OK,67,1405,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (21) (code 8480) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8621,NAD27 to WGS 84 (68),concatenated operation,4267,4326,EPSG-Usa OR WA,68,2381,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (27) (code 8487) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8622,NAD27 to WGS 84 (69),concatenated operation,4267,4326,EPSG-Usa SD,69,1410,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (22) (code 8482) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8623,NAD27 to WGS 84 (70),concatenated operation,4267,4326,EPSG-Usa TN,70,1411,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (23) (code 8483) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8624,NAD27 to WGS 84 (71),concatenated operation,4267,4326,EPSG-Usa TX e,71,2379,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (24) (code 8484) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8625,NAD27 to WGS 84 (72),concatenated operation,4267,4326,EPSG-Usa TX w,72,2380,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (25) (code 8485) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8626,NAD27 to WGS 84 (73),concatenated operation,4267,4326,EPSG-Usa UT,73,1413,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (34) (code 8513) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8627,NAD27 to WGS 84 (74),concatenated operation,4267,4326,EPSG-Usa VA,74,1415,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (26) (code 8486) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8628,NAD27 to WGS 84 (75),concatenated operation,4267,4326,EPSG-Usa WV,75,1417,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (35) (code 8514) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8629,NAD27 to WGS 84 (76),concatenated operation,4267,4326,EPSG-Usa WI,76,1418,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (28) (code 8488) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8630,NAD27 to WGS 84 (77),concatenated operation,4267,4326,EPSG-Usa WY,77,1419,Approximation at the +/- 1m level.,,,,Transformation steps are from NAD27 to NAD83(HARN) (29) (code 8489) assuming that NAD83(HARN) is equivalent to WGS 84 within the accuracy of the transformation.,EPSG,EPSG,2001-08-15 00:00:00,,1,0
+8631,Garoua to WGS 84 (1),concatenated operation,4197,4326,EPSG-Cmr,1,2590,Oil industry.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,1,0
+8632,Kousseri to WGS 84 (1),concatenated operation,4198,4326,EPSG-Cmr,1,2591,Oil industry.,,,,,EPSG,EPSG,2002-02-12 00:00:00,,1,0
+8633,Yoff to WGS 84 (1),concatenated operation,4310,4326,EPSG-SEN,1,1207,Military purposes.,,,,"Derived via WGS72. Can be used as a single positon vector transformation with parameter vaues of dX = -37 m, dY = +157 m, dZ = +89.5 m, rX = rY = 0 sec, RZ = 0.554 sec, dS = 0.219 ppm",TotalFinaElf,EPSG,2002-06-22 00:00:00,,1,0
+8634,Beduaram to WGS 84 (1),concatenated operation,4213,4326,ELF-Ner SE,1,2771,Oil exploration.,,,,"Derived via WGS72BE. Can be used as a single positon vector transformation with parameter vaues of dX = -101 m, dY = -111 m, dZ = +188.9 m, rX = rY = 0 sec, RZ = 0.814 sec, dS = -0.38 ppm",TotalFinaElf,EPSG,2002-06-28 00:00:00,,1,0
+8635,NAD27 to NAD83(CSRS) (3),concatenated operation,4267,4617,EPSG-Can AB,3,2376,Accuracy 1-2 metres.,,,,Can be taken as an approximate transformation NAD27 to WGS 84 - see code 8585.,EPSG,EPSG,2002-07-13 00:00:00,,1,0
+10101,Alabama CS27 East zone,conversion,,,,,2154,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+10102,Alabama CS27 West zone,conversion,,,,,2155,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+10131,SPCS83 Alabama East zone (meters),conversion,,,,,2154,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+10132,SPCS83 Alabama West zone (meters),conversion,,,,,2155,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+10201,Arizona Coordinate System East zone,conversion,,,,,2167,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+10202,Arizona Coordinate System Central zone,conversion,,,,,2166,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+10203,Arizona Coordinate System West zone,conversion,,,,,2168,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+10231,SPCS83 Arizona East zone (meters),conversion,,,,,2167,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines origin in International feet.  FE = 700000ft.  See code 15304 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.093  2001.03,1,0
+10232,SPCS83 Arizona Central zone (meters),conversion,,,,,2166,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines origin in International feet.  FE = 700000ft.  See code 15305 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+10233,SPCS83 Arizona West zone (meters),conversion,,,,,2168,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines origin in International feet.  FE = 700000ft.  See code 15306 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.093  2001.03,1,0
+10301,Arkansas CS27 North,conversion,,,,,2169,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10302,Arkansas CS27 South,conversion,,,,,2170,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10331,SPCS83 Arkansas North zone (meters),conversion,,,,,2169,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10332,SPCS83 Arkansas South zone (meters),conversion,,,,,2170,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10401,California CS27 zone I,conversion,,,,,2175,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10402,California CS27 zone II,conversion,,,,,2176,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10403,California CS27 zone III,conversion,,,,,2177,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10404,California CS27 zone IV,conversion,,,,,2178,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10405,California CS27 zone V,conversion,,,,,2179,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10406,California CS27 zone VI,conversion,,,,,2180,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10407,California CS27 zone VII,conversion,,,,,2181,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10431,SPCS83 California zone 1 (meters),conversion,,,,,2175,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15307 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10432,SPCS83 California zone 2 (meters),conversion,,,,,2176,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15308 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10433,SPCS83 California zone 3 (meters),conversion,,,,,2177,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15309 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10434,SPCS83 California zone 4 (meters),conversion,,,,,2178,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15310 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10435,SPCS83 California zone 5 (meters),conversion,,,,,2182,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15311 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10436,SPCS83 California zone 6 (meters),conversion,,,,,2180,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15312 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10501,Colorado CS27 North zone,conversion,,,,,2184,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10502,Colorado CS27 Central zone,conversion,,,,,2183,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10503,Colorado CS27 South zone,conversion,,,,,2185,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10531,SPCS83 Colorado North zone (meters),conversion,,,,,2184,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15313 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10532,SPCS83 Colorado Central zone (meters),conversion,,,,,2183,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15314 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10533,SPCS83 Colorado South zone (meters),conversion,,,,,2185,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15315 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+10600,Connecticut CS27,conversion,,,,,1377,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  99.28  2000.094,1,0
+10630,SPCS83 Connecticut zone (meters),conversion,,,,,1377,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15316 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2000.094  2001.03,1,0
+10700,Delaware CS27,conversion,,,,,1378,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+10730,SPCS83 Delaware zone (meters),conversion,,,,,1378,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15317 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.094  2001.03,1,0
+10901,Florida CS27 East zone,conversion,,,,,2186,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+10902,Florida CS27 West zone,conversion,,,,,2188,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+10903,Florida CS27 North zone,conversion,,,,,2187,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+10931,SPCS83 Florida East zone (meters),conversion,,,,,2186,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15318 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+10932,SPCS83 Florida West zone (meters),conversion,,,,,2188,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15319 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+10933,SPCS83 Florida North zone (meters),conversion,,,,,2187,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15320 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+11001,Georgia CS27 East zone,conversion,,,,,2189,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11002,Georgia CS27 West zone,conversion,,,,,2190,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11031,SPCS83 Georgia East zone (meters),conversion,,,,,2189,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15321 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11032,SPCS83 Georgia West zone (meters),conversion,,,,,2190,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15322 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11101,Idaho CS27 East zone,conversion,,,,,2192,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11102,Idaho CS27 Central zone,conversion,,,,,2191,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11103,Idaho CS27 West zone,conversion,,,,,2193,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11131,SPCS83 Idaho East zone (meters),conversion,,,,,2192,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15323 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11132,SPCS83 Idaho Central zone (meters),conversion,,,,,2191,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15324 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11133,SPCS83 Idaho West zone (meters),conversion,,,,,2193,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15325 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11201,Illinois CS27 East zone,conversion,,,,,2194,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11202,Illinois CS27 West zone,conversion,,,,,2195,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11231,SPCS83 Illinois East zone (meters),conversion,,,,,2194,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11232,SPCS83 Illinois West zone (meters),conversion,,,,,2195,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11301,Indiana CS27 East zone,conversion,,,,,2196,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11302,Indiana CS27 West zone,conversion,,,,,2197,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11331,SPCS83 Indiana East zone (meters),conversion,,,,,2196,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15326 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11332,SPCS83 Indiana West zone (meters),conversion,,,,,2197,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15327 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11401,Iowa CS27 North zone,conversion,,,,,2198,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+11402,Iowa CS27 South zone,conversion,,,,,2199,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+11431,SPCS83 Iowa North zone (meters),conversion,,,,,2198,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+11432,SPCS83 Iowa South zone (meters),conversion,,,,,2199,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+11501,Kansas CS27 North zone,conversion,,,,,2200,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+11502,Kansas CS27 South zone,conversion,,,,,2201,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+11531,SPCS83 Kansas North zone (meters),conversion,,,,,2200,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+11532,SPCS83 Kansas South zone (meters),conversion,,,,,2201,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+11601,Kentucky CS27 North zone,conversion,,,,,2202,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+11602,Kentucky CS27 South zone,conversion,,,,,2203,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+11631,Kentucky CS83 North zone,conversion,,,,,2202,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28,1,1
+11632,SPCS83 Kentucky South zone (meters),conversion,,,,,2203,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15329 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+11701,Louisiana CS27 North zone,conversion,,,,,2204,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+11702,Louisiana CS27 South zone,conversion,,,,,2205,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+11731,SPCS83 Louisiana North zone (meters),conversion,,,,,2204,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+11732,SPCS83 Louisiana South zone (meters),conversion,,,,,2529,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+11801,Maine CS27 East zone,conversion,,,,,2206,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11802,Maine CS27 West zone,conversion,,,,,2207,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+11831,SPCS83 Maine East zone (meters),conversion,,,,,2206,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11832,SPCS83 Maine West zone (meters),conversion,,,,,2207,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+11900,Maryland CS27,conversion,,,,,1389,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  99.28  2000.094,1,0
+11930,SPCS83 Maryland zone (meters),conversion,,,,,1389,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15330 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2000.094  2001.03,1,0
+12001,Massachusetts CS27 Mainland zone,conversion,,,,,2209,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+12002,Massachusetts CS27 Island zone,conversion,,,,,2208,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+12031,SPCS83 Massachusetts Mainland zone (meters),conversion,,,,,2209,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15331 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28  2001.03,1,0
+12032,SPCS83 Massachusetts Island zone (meters),conversion,,,,,2208,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15332 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+12101,Michigan State Plane East zone,conversion,,,,,1720,Obsolete.,9807,,,Superseded by north central and south zones.,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  98.22  2000.092,1,0
+12102,Michigan State Plane Old Central zone,conversion,,,,,1721,Obsolete.,9807,,,Superseded by north central and south zones.,USGS Professional Paper #1395,EPSG,1998-11-11 00:00:00,95.30  96.29  98.22,1,0
+12103,Michigan State Plane West zone,conversion,,,,,1722,Obsolete.,9807,,,Superseded by north central and south zones.,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  98.22  2000.092,1,0
+12111,Michigan CS27 North zone,conversion,,,,,1723,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.28  96.29  98.22  99.28,1,0
+12112,Michigan CS27 Central zone,conversion,,,,,1724,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.28  96.29  98.22  99.28,1,0
+12113,Michigan CS27 South zone,conversion,,,,,1725,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.28  96.29  98.22  99.28,1,0
+12141,SPCS83 Michigan North zone (meters),conversion,,,,,1723,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15333 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+12142,SPCS83 Michigan Central zone (meters),conversion,,,,,1724,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15334 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+12143,SPCS83 Michigan South zone (meters),conversion,,,,,1725,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15335 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+12201,Minnesota CS27 North zone,conversion,,,,,2214,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+12202,Minnesota CS27 Central zone,conversion,,,,,2213,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+12203,Minnesota CS27 South zone,conversion,,,,,2215,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+12231,SPCS83 Minnesota North zone (meters),conversion,,,,,2214,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+12232,SPCS83 Minnesota Central zone (meters),conversion,,,,,2213,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+12233,SPCS83 Minnesota South zone (meters),conversion,,,,,2215,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+12301,Mississippi CS27 East zone,conversion,,,,,2216,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+12302,Mississippi CS27 West zone,conversion,,,,,2217,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+12331,SPCS83 Mississippi East zone (meters),conversion,,,,,2216,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15336 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+12332,SPCS83 Mississippi West zone (meters),conversion,,,,,2217,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15337 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+12401,Missouri CS27 East zone,conversion,,,,,2219,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.18  95.30  96.29  2000.092,1,0
+12402,Missouri CS27 Central zone,conversion,,,,,2218,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+12403,Missouri CS27 West zone,conversion,,,,,2220,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+12431,SPCS83 Missouri East zone (meters),conversion,,,,,2219,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+12432,SPCS83 Missouri Central zone (meters),conversion,,,,,2218,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+12433,SPCS83 Missouri West zone (meters),conversion,,,,,2220,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+12501,Montana CS27 North zone,conversion,,,,,2211,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+12502,Montana CS27 Central zone,conversion,,,,,2210,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+12503,Montana CS27 South zone,conversion,,,,,2212,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+12530,SPCS83 Montana zone (meters),conversion,,,,,1395,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15338 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2000.094  2001.03,1,0
+12601,Nebraska CS27 North zone,conversion,,,,,2221,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+12602,Nebraska CS27 South zone,conversion,,,,,2222,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+12630,SPCS83 Nebraska zone (meters),conversion,,,,,1396,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2000.094  2001.03,1,0
+12701,Nevada CS27 East zone,conversion,,,,,2224,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+12702,Nevada CS27 Central zone,conversion,,,,,2223,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.093,1,0
+12703,Nevada CS27 West zone,conversion,,,,,2225,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+12731,SPCS83 Nevada East zone (meters),conversion,,,,,2224,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+12732,SPCS83 Nevada Central zone (meters),conversion,,,,,2223,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+12733,SPCS83 Nevada West zone (meters),conversion,,,,,2225,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+12800,New Hampshire CS27,conversion,,,,,1398,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+12830,SPCS83 New Hampshire zone (meters),conversion,,,,,1398,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.094  2001.03,1,0
+12900,New Jersey CS27,conversion,,,,,1399,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.094,1,0
+12930,SPCS83 New Jersey zone (meters),conversion,,,,,1399,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.094  2001.03,1,0
+13001,New Mexico CS27 East zone,conversion,,,,,2228,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+13002,New Mexico CS27 Central zone,conversion,,,,,2229,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+13003,New Mexico CS27 West zone,conversion,,,,,2230,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+13031,SPCS83 New Mexico East zone (meters),conversion,,,,,2228,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15339 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+13032,SPCS83 New Mexico Central zone (meters),conversion,,,,,2231,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15340 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+13033,SPCS83 New Mexico West zone (meters),conversion,,,,,2232,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15341 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+13101,New York CS27 East zone,conversion,,,,,2234,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.18  95.30  96.29  2000.092,1,0
+13102,New York CS27 Central zone,conversion,,,,,2233,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+13103,New York CS27 West zone,conversion,,,,,2236,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+13104,New York CS27 Long Island zone,conversion,,,,,2235,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13131,SPCS83 New York East zone (meters),conversion,,,,,2234,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15342 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+13132,SPCS83 New York Central zone (meters),conversion,,,,,2233,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15343 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+13133,SPCS83 New York West zone (meters),conversion,,,,,2236,Used for large and medium scale topographic mapping and engineering survey.,9807,,,See code 15344 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+13134,SPCS83 New York Long Island zone (meters),conversion,,,,,2235,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15345 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13200,North Carolina CS27,conversion,,,,,1402,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  99.28  2000.094,1,0
+13230,SPCS83 North Carolina zone (meters),conversion,,,,,1402,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15346 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2000.094  2001.03,1,0
+13301,North Dakota CS27 North zone,conversion,,,,,2237,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13302,North Dakota CS27 South zone,conversion,,,,,2238,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13331,SPCS83 North Dakota North zone (meters),conversion,,,,,2237,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15347 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13332,SPCS83 North Dakota South zone (meters),conversion,,,,,2238,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15348 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13401,Ohio CS27 North zone,conversion,,,,,2239,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13402,Ohio CS27 South zone,conversion,,,,,2240,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13431,SPCS83 Ohio North zone (meters),conversion,,,,,2239,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13432,SPCS83 Ohio South zone (meters),conversion,,,,,2240,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13501,Oklahoma CS27 North zone,conversion,,,,,2241,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13502,Oklahoma CS27 South zone,conversion,,,,,2242,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13531,SPCS83 Oklahoma North zone (meters),conversion,,,,,2241,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15349 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13532,SPCS83 Oklahoma South zone (meters),conversion,,,,,2242,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15350 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13601,Oregon CS27 North zone,conversion,,,,,2243,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13602,Oregon CS27 South zone,conversion,,,,,2244,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13631,SPCS83 Oregon North zone (meters),conversion,,,,,2243,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15351 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13632,SPCS83 Oregon South zone (meters),conversion,,,,,2244,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15352 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13701,Pennsylvania CS27 North zone,conversion,,,,,2245,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13702,Pennsylvania CS27 South zone,conversion,,,,,2246,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13731,SPCS83 Pennsylvania North zone (meters),conversion,,,,,2245,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15353 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13732,SPCS83 Pennsylvania South zone (meters),conversion,,,,,2246,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15354 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+13800,Rhode Island CS27,conversion,,,,,1408,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.094,1,0
+13830,SPCS83 Rhode Island zone (meters),conversion,,,,,1408,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.094  2001.03,1,0
+13901,South Carolina CS27 North zone,conversion,,,,,2247,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13902,South Carolina CS27 South zone,conversion,,,,,2248,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+13930,SPCS83 South Carolina zone (meters),conversion,,,,,1409,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15355 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2000.094  2001.03,1,0
+14001,South Dakota CS27 North zone,conversion,,,,,2249,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14002,South Dakota CS27 South zone,conversion,,,,,2250,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14031,SPCS83 South Dakota North zone (meters),conversion,,,,,2249,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14032,SPCS83 South Dakota South zone (meters),conversion,,,,,2250,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14100,Tennessee CS27,conversion,,,,,1411,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  99.28  2000.094,1,1
+14130,SPCS83 Tennessee zone (meters),conversion,,,,,1411,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15356 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2000.094  2001.03,1,0
+14201,Texas CS27 North zone,conversion,,,,,2253,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14202,Texas CS27 North Central zone,conversion,,,,,2254,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14203,Texas CS27 Central zone,conversion,,,,,2252,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14204,Texas CS27 South Central zone,conversion,,,,,2256,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14205,Texas CS27 South zone,conversion,,,,,2255,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14231,SPCS83 Texas North zone (meters),conversion,,,,,2253,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15357 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14232,SPCS83 Texas North Central zone (meters),conversion,,,,,2254,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15358 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14233,SPCS83 Texas Central zone (meters),conversion,,,,,2252,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15359 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14234,SPCS83 Texas South Central zone (meters),conversion,,,,,2527,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15360 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14235,SPCS83 Texas South zone (meters),conversion,,,,,2528,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15361 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14301,Utah CS27 North zone,conversion,,,,,2258,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14302,Utah CS27 Central zone,conversion,,,,,2257,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14303,Utah CS27 South zone,conversion,,,,,2259,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14331,SPCS83 Utah North zone (meters),conversion,,,,,2258,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15362 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14332,SPCS83 Utah Central zone (meters),conversion,,,,,2257,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15363 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14333,SPCS83 Utah South zone (meters),conversion,,,,,2259,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15364 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14400,Vermont CS27,conversion,,,,,1414,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.094,1,0
+14430,SPCS83 Vermont zone (meters),conversion,,,,,1414,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.094  2001.03,1,0
+14501,Virginia CS27 North zone,conversion,,,,,2260,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14502,Virginia CS27 South zone,conversion,,,,,2261,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14531,SPCS83 Virginia North zone (meters),conversion,,,,,2260,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15365 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14532,SPCS83 Virginia South zone (meters),conversion,,,,,2261,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15366 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14601,Washington CS27 North zone,conversion,,,,,2262,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14602,Washington CS27 South zone,conversion,,,,,2263,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14631,SPCS83 Washington North zone (meters),conversion,,,,,2273,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15367 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14632,SPCS83 Washington South zone (meters),conversion,,,,,2274,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15368 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14701,West Virginia CS27 North zone,conversion,,,,,2264,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14702,West Virginia CS27 South zone,conversion,,,,,2265,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14731,SPCS83 West Virginia North zone (meters),conversion,,,,,2264,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14732,SPCS83 West Virginia South zone (meters),conversion,,,,,2265,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14801,Wisconsin CS27 North zone,conversion,,,,,2267,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14802,Wisconsin CS27 Central zone,conversion,,,,,2266,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14803,Wisconsin CS27 South zone,conversion,,,,,2268,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+14831,SPCS83 Wisconsin North zone (meters),conversion,,,,,2267,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15369 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14832,SPCS83 Wisconsin Central zone (meters),conversion,,,,,2266,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15370 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14833,SPCS83 Wisconsin South zone (meters),conversion,,,,,2268,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15371 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+14901,Wyoming CS27 East zone,conversion,,,,,2269,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+14902,Wyoming CS27 East Central zone,conversion,,,,,2270,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+14903,Wyoming CS27 West Central zone,conversion,,,,,2272,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+14904,Wyoming CS27 West zone,conversion,,,,,2271,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  2000.092,1,0
+14931,SPCS83 Wyoming East zone (meters),conversion,,,,,2269,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.092  2001.03,1,0
+14932,SPCS83 Wyoming East Central zone (meters),conversion,,,,,2270,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.092  2001.03,1,0
+14933,SPCS83 Wyoming West Central zone (meters),conversion,,,,,2272,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.092  2001.03,1,0
+14934,SPCS83 Wyoming West zone (meters),conversion,,,,,2271,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2000.092  2001.03,1,0
+15001,Alaska CS27 zone 1,conversion,,,,,2156,Used for large and medium scale topographic mapping and engineering survey.,9812,,,"If using Oblique Mercator method (code 9815), Ec=2685642.82 ftUS, Nc=1887198.47 ftUS.",USGS Professional Paper #1395,EPSG,1997-04-11 00:00:00,96.29  97.08,1,0
+15002,Alaska CS27 zone 2,conversion,,,,,2158,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15003,Alaska CS27 zone 3,conversion,,,,,2159,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15004,Alaska CS27 zone 4,conversion,,,,,2160,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15005,Alaska CS27 zone 5,conversion,,,,,2161,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15006,Alaska CS27 zone 6,conversion,,,,,2162,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15007,Alaska CS27 zone 7,conversion,,,,,2163,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15008,Alaska CS27 zone 8,conversion,,,,,2164,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15009,Alaska CS27 zone 9,conversion,,,,,2165,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15010,Alaska CS27 zone 10,conversion,,,,,2157,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+15031,SPCS83 Alaska zone 1 (meters),conversion,,,,,2156,Used for large and medium scale topographic mapping and engineering survey.,9812,,,"If using Oblique Mercator method (code 9815), Ec=818585.57 m, Nc=575219.25 m.",NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,96.29  2001.03,1,0
+15032,SPCS83 Alaska zone 2 (meters),conversion,,,,,2158,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15033,SPCS83 Alaska zone 3 (meters),conversion,,,,,2159,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15034,SPCS83 Alaska zone 4 (meters),conversion,,,,,2160,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15035,SPCS83 Alaska zone 5 (meters),conversion,,,,,2161,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15036,SPCS83 Alaska zone 6 (meters),conversion,,,,,2162,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15037,SPCS83 Alaska zone 7 (meters),conversion,,,,,2163,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15038,SPCS83 Alaska zone 8 (meters),conversion,,,,,2164,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15039,SPCS83 Alaska zone 9 (meters),conversion,,,,,2165,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15040,SPCS83 Alaska zone 10 (meters),conversion,,,,,2157,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+15101,Hawaii CS27 zone 1,conversion,,,,,1546,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15102,Hawaii CS27 zone 2,conversion,,,,,1547,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15103,Hawaii CS27 zone 3,conversion,,,,,1548,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15104,Hawaii CS27 zone 4,conversion,,,,,1549,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15105,Hawaii CS27 zone 5,conversion,,,,,1550,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,USGS Professional Paper #1395,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+15131,SPCS83 Hawaii zone 1 (meters),conversion,,,,,1546,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15132,SPCS83 Hawaii zone 2 (meters),conversion,,,,,1547,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15133,SPCS83 Hawaii zone 3 (meters),conversion,,,,,1548,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15134,SPCS83 Hawaii zone 4 (meters),conversion,,,,,1549,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15135,SPCS83 Hawaii zone 5 (meters),conversion,,,,,1550,Used for large and medium scale topographic mapping and engineering survey.,9807,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  2001.03,1,0
+15201,Puerto Rico CS27,conversion,,,,,1194,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  99.28  2000.094,1,0
+15202,St. Croix CS27,conversion,,,,,1254,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,2000-03-07 00:00:00,95.30  96.29  99.28  2000.094,1,0
+15230,SPCS83 Puerto Rico & Virgin Islands zone (meters),conversion,,,,,2251,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,NOAA manual NOS NGS 5,EPSG,2001-11-06 00:00:00,95.30  96.29  99.28  2001.03,1,0
+15300,American Samoa Lambert,conversion,,,,,1027,Used for large and medium scale topographic mapping and engineering survey.,9801,,,Per Snyder: Map Projections - a Working Manual:  At origin x=500000 ft; y=o but radius to latitude of origin = -82000000 feet.  US National Geodetic Survey confirms use of zero for False Northing.,US National Geodetic Survey (NGS),EPSG,2000-10-19 00:00:00,,1,1
+15301,American Samoa Lambert,conversion,,,,,1027,Used for large and medium scale topographic mapping and engineering survey.,9801,,,Per Snyder: Map Projections - a Working Manual:  At origin x=500000 ft; y=o but radius to latitude of origin = -82000000 feet.  US National Geodetic Survey confirms use of zero for False Northing.,US National Geodetic Survey (NGS),EPSG,2001-08-28 00:00:00,,1,0
+15302,Tennessee CS27,conversion,,,,,1411,Used for large and medium scale topographic mapping and engineering survey.,9802,,,,USGS Professional Paper #1395,EPSG,2001-10-04 00:00:00,2001.45,1,0
+15303,SPCS83 Kentucky North zone (meters),conversion,,,,,2202,Used for large and medium scale topographic mapping and engineering survey.,9802,,,See code 15328 for equivalent non-metric definition.,NOAA manual NOS NGS 5,EPSG,2001-10-04 00:00:00,2001.03  2001.45,1,0
+15304,SPCS83 Arizona East zone (International feet),conversion,,,,,2167,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 10231.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15305,SPCS83 Arizona Central zone (International feet),conversion,,,,,2166,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 10232.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15306,SPCS83 Arizona West zone (International feet),conversion,,,,,2168,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 10233.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15307,SPCS83 California zone 1 (US Survey feet),conversion,,,,,2175,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10431.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15308,SPCS83 California zone 2 (US Survey feet),conversion,,,,,2176,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10432.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15309,SPCS83 California zone 3 (US Survey feet),conversion,,,,,2177,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10433.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15310,SPCS83 California zone 4 (US Survey feet),conversion,,,,,2178,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10434.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15311,SPCS83 California zone 5 (US Survey feet),conversion,,,,,2182,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10435.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15312,SPCS83 California zone 6 (US Survey feet),conversion,,,,,2180,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10436.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15313,SPCS83 Colorado North zone (US Survey feet),conversion,,,,,2184,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10531.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15314,SPCS83 Colorado Central zone (US Survey feet),conversion,,,,,2183,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10532.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15315,SPCS83 Colorado South zone (US Survey feet),conversion,,,,,2185,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10533.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15316,SPCS83 Connecticut zone (US Survey feet),conversion,,,,,1377,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10630.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15317,SPCS83 Delaware zone (US Survey feet),conversion,,,,,1378,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10730.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15318,SPCS83 Florida East zone (US Survey feet),conversion,,,,,2186,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10931.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15319,SPCS83 Florida West zone (US Survey feet),conversion,,,,,2188,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10932.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15320,SPCS83 Florida North zone (US Survey feet),conversion,,,,,2187,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10933.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15321,SPCS83 Georgia East zone (US Survey feet),conversion,,,,,2189,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 11031.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15322,SPCS83 Georgia West zone (US Survey feet),conversion,,,,,2190,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 10031.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15323,SPCS83 Idaho East zone (US Survey feet),conversion,,,,,2192,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 11131.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15324,SPCS83 Idaho Central zone (US Survey feet),conversion,,,,,2191,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 11132.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15325,SPCS83 Idaho West zone (US Survey feet),conversion,,,,,2193,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 11133.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15326,SPCS83 Indiana East zone (US Survey feet),conversion,,,,,2196,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 11331.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15327,SPCS83 Indiana West zone (US Survey feet),conversion,,,,,2197,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 11332.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15328,SPCS83 Kentucky North zone (US Survey feet),conversion,,,,,2202,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 15303.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15329,SPCS83 Kentucky South zone (US Survey feet),conversion,,,,,2203,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 11632.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15330,SPCS83 Maryland zone (US Survey feet),conversion,,,,,1389,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 11930.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15331,SPCS83 Massachusetts Mainland zone (US Survey feet),conversion,,,,,2209,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 12031.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15332,SPCS83 Massachusetts Island zone (US Survey feet),conversion,,,,,2208,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 12032.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15333,SPCS83 Michigan North zone (International feet),conversion,,,,,1723,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 12141.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15334,SPCS83 Michigan Central zone (International feet),conversion,,,,,1724,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 12142.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15335,SPCS83 Michigan South zone (International feet),conversion,,,,,1725,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 12143.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15336,SPCS83 Mississippi East zone (US Survey feet),conversion,,,,,2216,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 12331.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15337,SPCS83 Mississippi West zone (US Survey feet),conversion,,,,,2217,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 12332.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15338,SPCS83 Montana zone (International feet),conversion,,,,,1395,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 12530.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15339,SPCS83 New Mexico East zone (US Survey feet),conversion,,,,,2228,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13031.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15340,SPCS83 New Mexico Central zone (US Survey feet),conversion,,,,,2231,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13032.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15341,SPCS83 New Mexico West zone (US Survey feet),conversion,,,,,2232,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13033.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15342,SPCS83 New York East zone (US Survey feet),conversion,,,,,2234,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13131.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15343,SPCS83 New York Central zone (US Survey feet),conversion,,,,,2233,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13132.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15344,SPCS83 New York West zone (US Survey feet),conversion,,,,,2236,Used for large and medium scale topographic mapping and engineering survey.,9807,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13133.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15345,SPCS83 New York Long Island zone (US Survey feet),conversion,,,,,2235,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13134.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15346,SPCS83 North Carolina zone (US Survey feet),conversion,,,,,1402,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13230.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15347,SPCS83 North Dakota North zone (International feet),conversion,,,,,2237,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 13331.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15348,SPCS83 North Dakota South zone (International feet),conversion,,,,,2238,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 13332.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15349,SPCS83 Oklahoma North zone (US Survey feet),conversion,,,,,2241,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13531.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15350,SPCS83 Oklahoma South zone (US Survey feet),conversion,,,,,2242,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13532.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15351,SPCS83 Oregon North zone (International feet),conversion,,,,,2243,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 13631.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15352,SPCS83 Oregon South zone (International feet),conversion,,,,,2244,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 13632.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15353,SPCS83 Pennsylvania North zone (US Survey feet),conversion,,,,,2245,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13731.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15354,SPCS83 Pennsylvania South zone (US Survey feet),conversion,,,,,2246,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 13732.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15355,SPCS83 South Carolina zone (International feet),conversion,,,,,1409,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 13930.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15356,SPCS83 Tennessee zone (US Survey feet),conversion,,,,,1411,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14130.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15357,SPCS83 Texas North zone (US Survey feet),conversion,,,,,2253,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14231.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15358,SPCS83 Texas North Central zone (US Survey feet),conversion,,,,,2254,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14232.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15359,SPCS83 Texas Central zone (US Survey feet),conversion,,,,,2252,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14233.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15360,SPCS83 Texas South Central zone (US Survey feet),conversion,,,,,2527,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14234.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15361,SPCS83 Texas South zone (US Survey feet),conversion,,,,,2528,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14235.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15362,SPCS83 Utah North zone (International feet),conversion,,,,,2258,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 14331.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15363,SPCS83 Utah Central zone (International feet),conversion,,,,,2257,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 14333.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15364,SPCS83 Utah South zone (International feet),conversion,,,,,2259,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as International feet (note: not US Survey feet). For equivalent metric Federal definition see code 14334.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15365,SPCS83 Virginia North zone (US Survey feet),conversion,,,,,2260,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14531.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15366,SPCS83 Virginia South zone (US Survey feet),conversion,,,,,2261,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14532.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15367,SPCS83 Washington North zone (US Survey feet),conversion,,,,,2273,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14631.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15368,SPCS83 Washington South zone (US Survey feet),conversion,,,,,2274,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14632.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15369,SPCS83 Wisconsin North zone (US Survey feet),conversion,,,,,2267,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14831.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15370,SPCS83 Wisconsin Central zone (US Survey feet),conversion,,,,,2266,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14832.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15371,SPCS83 Wisconsin South zone (US Survey feet),conversion,,,,,2268,Used for large and medium scale topographic mapping and engineering survey.,9802,,,State law defines grid unit as US Survey feet. For equivalent metric Federal definition see code 14833.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+15914,BLM zone 14N (US survey feet),conversion,,,,,2171,US survey foot form of UTM zone 14N,9807,,,"Sometimes locally referred to as ""UTM zone 14"".",Minerals Management Service offshore protraction diagrams.,EPSG,2002-02-12 00:00:00,95.30  96.29  2002.12,1,0
+15915,BLM zone 15N (US survey feet),conversion,,,,,2172,US survey foot form of UTM zone 15N,9807,,,"Sometimes locally referred to as ""UTM zone 15"".",Minerals Management Service offshore protraction diagrams.,EPSG,2002-02-12 00:00:00,95.30  96.29  2002.12,1,0
+15916,BLM zone 16N (US survey feet),conversion,,,,,2173,US survey foot form of UTM zone 16N,9807,,,"Sometimes locally referred to as ""UTM zone 16"".",Minerals Management Service offshore protraction diagrams.,EPSG,2002-02-12 00:00:00,95.30  96.29  2002.12,1,0
+15917,BLM zone 17N (US survey feet),conversion,,,,,2174,US survey foot form of UTM zone 17N,9807,,,"Sometimes locally referred to as ""UTM zone 17"".",Minerals Management Service offshore protraction diagrams.,EPSG,2002-02-12 00:00:00,95.30  96.29  2002.12,1,0
+16000,UTM grid system (northern hemisphere),conversion,,,,,1998,For strict use within zone boundaries,9824,,,Use UTM zone xx N (codes 16001-16060) for use outwith zone boundary or when easting is not prefixed by zone number.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+16001,UTM zone 1N,conversion,,,,,1873,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16002,UTM zone 2N,conversion,,,,,1875,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16003,UTM zone 3N,conversion,,,,,1877,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16004,UTM zone 4N,conversion,,,,,1879,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16005,UTM zone 5N,conversion,,,,,1881,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16006,UTM zone 6N,conversion,,,,,1883,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16007,UTM zone 7N,conversion,,,,,1885,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16008,UTM zone 8N,conversion,,,,,1887,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16009,UTM zone 9N,conversion,,,,,1889,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16010,UTM zone 10N,conversion,,,,,1891,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16011,UTM zone 11N,conversion,,,,,1893,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16012,UTM zone 12N,conversion,,,,,1895,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16013,UTM zone 13N,conversion,,,,,1897,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16014,UTM zone 14N,conversion,,,,,1899,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16015,UTM zone 15N,conversion,,,,,1901,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16016,UTM zone 16N,conversion,,,,,1903,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16017,UTM zone 17N,conversion,,,,,1905,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16018,UTM zone 18N,conversion,,,,,1907,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16019,UTM zone 19N,conversion,,,,,1909,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16020,UTM zone 20N,conversion,,,,,1911,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16021,UTM zone 21N,conversion,,,,,1913,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16022,UTM zone 22N,conversion,,,,,1915,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16023,UTM zone 23N,conversion,,,,,1917,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16024,UTM zone 24N,conversion,,,,,1919,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16025,UTM zone 25N,conversion,,,,,1921,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16026,UTM zone 26N,conversion,,,,,1923,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16027,UTM zone 27N,conversion,,,,,1925,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16028,UTM zone 28N,conversion,,,,,1927,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16029,UTM zone 29N,conversion,,,,,1929,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16030,UTM zone 30N,conversion,,,,,1931,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16031,UTM zone 31N,conversion,,,,,1933,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16032,UTM zone 32N,conversion,,,,,1935,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16033,UTM zone 33N,conversion,,,,,1937,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16034,UTM zone 34N,conversion,,,,,1939,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16035,UTM zone 35N,conversion,,,,,1941,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16036,UTM zone 36N,conversion,,,,,1943,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16037,UTM zone 37N,conversion,,,,,1945,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16038,UTM zone 38N,conversion,,,,,1947,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16039,UTM zone 39N,conversion,,,,,1949,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16040,UTM zone 40N,conversion,,,,,1951,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16041,UTM zone 41N,conversion,,,,,1953,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16042,UTM zone 42N,conversion,,,,,1955,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16043,UTM zone 43N,conversion,,,,,1957,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16044,UTM zone 44N,conversion,,,,,1959,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16045,UTM zone 45N,conversion,,,,,1961,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16046,UTM zone 46N,conversion,,,,,1963,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16047,UTM zone 47N,conversion,,,,,1965,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16048,UTM zone 48N,conversion,,,,,1967,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16049,UTM zone 49N,conversion,,,,,1969,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16050,UTM zone 50N,conversion,,,,,1971,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16051,UTM zone 51N,conversion,,,,,1973,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16052,UTM zone 52N,conversion,,,,,1975,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16053,UTM zone 53N,conversion,,,,,1977,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16054,UTM zone 54N,conversion,,,,,1979,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16055,UTM zone 55N,conversion,,,,,1981,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16056,UTM zone 56N,conversion,,,,,1983,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16057,UTM zone 57N,conversion,,,,,1985,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16058,UTM zone 58N,conversion,,,,,1987,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16059,UTM zone 59N,conversion,,,,,1989,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16060,UTM zone 60N,conversion,,,,,1991,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16061,Universal Polar Stereographic North,conversion,,,,,1996,Large and medium scale topographic mapping and engineering survey.,9810,,,,,EPSG,2000-03-07 00:00:00,97.18  2000.094,1,0
+16070,3-degree Gauss-Kruger zone 40,conversion,,,,,2628,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 120E (code 16170). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16071,3-degree Gauss-Kruger zone 41,conversion,,,,,2629,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 123E (code 16171). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16072,3-degree Gauss-Kruger zone 42,conversion,,,,,2630,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 126E (code 16172). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16073,3-degree Gauss-Kruger zone 43,conversion,,,,,2631,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 129E (code 16173). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16074,3-degree Gauss-Kruger zone 44,conversion,,,,,2632,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 132E (code 16174). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16075,3-degree Gauss-Kruger zone 45,conversion,,,,,2633,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 135E (code 16175). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16076,3-degree Gauss-Kruger zone 46,conversion,,,,,2634,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 138E (code 16176). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16077,3-degree Gauss-Kruger zone 47,conversion,,,,,2635,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 141E (code 16177). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16078,3-degree Gauss-Kruger zone 48,conversion,,,,,2636,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 144E (code 16178). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16079,3-degree Gauss-Kruger zone 49,conversion,,,,,2637,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 147E (code 16179). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16080,3-degree Gauss-Kruger zone 50,conversion,,,,,2638,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 150E (code 16180). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16081,3-degree Gauss-Kruger zone 51,conversion,,,,,2639,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 153E (code 16181). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16082,3-degree Gauss-Kruger zone 52,conversion,,,,,2640,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 156E (code 16182). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16083,3-degree Gauss-Kruger zone 53,conversion,,,,,2641,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 159E (code 16183). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16084,3-degree Gauss-Kruger zone 54,conversion,,,,,2642,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 162E (code 16184). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16085,3-degree Gauss-Kruger zone 55,conversion,,,,,2643,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 165E (code 16185). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16086,3-degree Gauss-Kruger zone 56,conversion,,,,,2644,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 168E (code 16186). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16087,3-degree Gauss-Kruger zone 57,conversion,,,,,2645,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 171E (code 16187). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16088,3-degree Gauss-Kruger zone 58,conversion,,,,,2646,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 174E (code 16188). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16089,3-degree Gauss-Kruger zone 59,conversion,,,,,2647,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 177E (code 16189). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16090,3-degree Gauss-Kruger zone 60,conversion,,,,,2648,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 180 (code 16190). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16091,3-degree Gauss-Kruger zone 61,conversion,,,,,2649,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 177W (code 16191). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16092,3-degree Gauss-Kruger zone 62,conversion,,,,,2650,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 174W (code 16192). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16093,3-degree Gauss-Kruger zone 63,conversion,,,,,2651,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 171W (code 16193). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16094,3-degree Gauss-Kruger zone 64,conversion,,,,,2652,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 168W (code 16194). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16100,UTM grid system (southern hemisphere),conversion,,,,,1999,For strict use within zone boundaries,9824,,,Use UTM zone xx S (codes 16101-16160) for use outwith zone boundary or when easting is not prefixed by zone number.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+16101,UTM zone 1S,conversion,,,,,1874,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16102,UTM zone 2S,conversion,,,,,1876,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16103,UTM zone 3S,conversion,,,,,1878,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16104,UTM zone 4S,conversion,,,,,1880,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16105,UTM zone 5S,conversion,,,,,1882,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16106,UTM zone 6S,conversion,,,,,1884,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16107,UTM zone 7S,conversion,,,,,1886,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16108,UTM zone 8S,conversion,,,,,1888,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16109,UTM zone 9S,conversion,,,,,1890,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16110,UTM zone 10S,conversion,,,,,1892,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16111,UTM zone 11S,conversion,,,,,1894,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16112,UTM zone 12S,conversion,,,,,1896,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16113,UTM zone 13S,conversion,,,,,1898,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16114,UTM zone 14S,conversion,,,,,1900,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16115,UTM zone 15S,conversion,,,,,1902,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16116,UTM zone 16S,conversion,,,,,1904,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16117,UTM zone 17S,conversion,,,,,1906,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16118,UTM zone 18S,conversion,,,,,1908,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16119,UTM zone 19S,conversion,,,,,1910,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16120,UTM zone 20S,conversion,,,,,1912,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16121,UTM zone 21S,conversion,,,,,1914,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16122,UTM zone 22S,conversion,,,,,1916,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16123,UTM zone 23S,conversion,,,,,1918,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16124,UTM zone 24S,conversion,,,,,1920,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16125,UTM zone 25S,conversion,,,,,1922,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16126,UTM zone 26S,conversion,,,,,1924,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16127,UTM zone 27S,conversion,,,,,1926,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16128,UTM zone 28S,conversion,,,,,1928,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16129,UTM zone 29S,conversion,,,,,1930,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16130,UTM zone 30S,conversion,,,,,1932,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16131,UTM zone 31S,conversion,,,,,1934,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16132,UTM zone 32S,conversion,,,,,1936,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16133,UTM zone 33S,conversion,,,,,1938,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16134,UTM zone 34S,conversion,,,,,1940,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16135,UTM zone 35S,conversion,,,,,1942,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16136,UTM zone 36S,conversion,,,,,1944,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16137,UTM zone 37S,conversion,,,,,1946,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16138,UTM zone 38S,conversion,,,,,1948,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16139,UTM zone 39S,conversion,,,,,1950,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16140,UTM zone 40S,conversion,,,,,1952,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16141,UTM zone 41S,conversion,,,,,1954,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16142,UTM zone 42S,conversion,,,,,1956,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16143,UTM zone 43S,conversion,,,,,1958,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16144,UTM zone 44S,conversion,,,,,1960,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16145,UTM zone 45S,conversion,,,,,1962,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16146,UTM zone 46S,conversion,,,,,1964,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16147,UTM zone 47S,conversion,,,,,1966,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16148,UTM zone 48S,conversion,,,,,1968,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16149,UTM zone 49S,conversion,,,,,1970,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16150,UTM zone 50S,conversion,,,,,1972,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16151,UTM zone 51S,conversion,,,,,1974,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16152,UTM zone 52S,conversion,,,,,1976,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16153,UTM zone 53S,conversion,,,,,1978,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16154,UTM zone 54S,conversion,,,,,1980,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16155,UTM zone 55S,conversion,,,,,1982,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16156,UTM zone 56S,conversion,,,,,1984,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16157,UTM zone 57S,conversion,,,,,1986,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16158,UTM zone 58S,conversion,,,,,1988,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16159,UTM zone 59S,conversion,,,,,1990,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16160,UTM zone 60S,conversion,,,,,1992,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.28,1,0
+16161,Universal Polar Stereographic South,conversion,,,,,1997,Large and medium scale topographic mapping and engineering survey.,9810,,,,,EPSG,2000-03-07 00:00:00,97.18  2000.094,1,0
+16170,3-degree Gauss-Kruger CM 120E,conversion,,,,,2628,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 40N (code 16070) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16171,3-degree Gauss-Kruger CM 123E,conversion,,,,,2629,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 41N (code 16071) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16172,3-degree Gauss-Kruger CM 126E,conversion,,,,,2630,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 42N (code 16072) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16173,3-degree Gauss-Kruger CM 129E,conversion,,,,,2631,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 43N (code 16073) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16174,3-degree Gauss-Kruger CM 132E,conversion,,,,,2632,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 44N (code 16074) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16175,3-degree Gauss-Kruger CM 135E,conversion,,,,,2633,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 45N (code 16075) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16176,3-degree Gauss-Kruger CM 138E,conversion,,,,,2634,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 46N (code 16076) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16177,3-degree Gauss-Kruger CM 141E,conversion,,,,,2635,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 47N (code 16077) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16178,3-degree Gauss-Kruger CM 144E,conversion,,,,,2636,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 48N (code 16078) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16179,3-degree Gauss-Kruger CM 147E,conversion,,,,,2637,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 49N (code 16079) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16180,3-degree Gauss-Kruger CM 150E,conversion,,,,,2638,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 50N (code 16080) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16181,3-degree Gauss-Kruger CM 153E,conversion,,,,,2639,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 51N (code 16081) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16182,3-degree Gauss-Kruger CM 156E,conversion,,,,,2640,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 52N (code 16082) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16183,3-degree Gauss-Kruger CM 159E,conversion,,,,,2641,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 53N (code 16083) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16184,3-degree Gauss-Kruger CM 162E,conversion,,,,,2642,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 54N (code 16084) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16185,3-degree Gauss-Kruger CM 165E,conversion,,,,,2643,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 55N (code 16085) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16186,3-degree Gauss-Kruger CM 168E,conversion,,,,,2644,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 56N (code 16086) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16187,3-degree Gauss-Kruger CM 171E,conversion,,,,,2645,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 57N (code 16087) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16188,3-degree Gauss-Kruger CM 174E,conversion,,,,,2646,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 58N (code 16088) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16189,3-degree Gauss-Kruger CM 177E,conversion,,,,,2647,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 59N (code 16089) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16190,3-degree Gauss-Kruger CM 180,conversion,,,,,2648,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 60N (code 16090) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16191,3-degree Gauss-Kruger CM 177W,conversion,,,,,2649,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 61N (code 16091) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16192,3-degree Gauss-Kruger CM 174W,conversion,,,,,2650,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 62N (code 16092) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16193,3-degree Gauss-Kruger CM 171W,conversion,,,,,2651,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 63N (code 16093) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16194,3-degree Gauss-Kruger CM 168W,conversion,,,,,2652,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 64N (code 16094) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16201,6-degree Gauss-Kruger zone 1,conversion,,,,,1933,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 3E (code 16301). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16202,6-degree Gauss-Kruger zone 2,conversion,,,,,2741,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 9E (code 16302). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16203,6-degree Gauss-Kruger zone 3,conversion,,,,,2742,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 15E (code 16303). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16204,6-degree Gauss-Kruger zone 4,conversion,,,,,2743,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 21E (code 16304). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16205,6-degree Gauss-Kruger zone 5,conversion,,,,,2744,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 27E (code 16305). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16206,6-degree Gauss-Kruger zone 6,conversion,,,,,2745,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 33E (code 16306). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16207,6-degree Gauss-Kruger zone 7,conversion,,,,,2746,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 39E (code 16307). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16208,6-degree Gauss-Kruger zone 8,conversion,,,,,1947,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 45E (code 16308). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16209,6-degree Gauss-Kruger zone 9,conversion,,,,,1949,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 51E (code 16309). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16210,6-degree Gauss-Kruger zone 10,conversion,,,,,1951,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 57E (code 16310). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16211,6-degree Gauss-Kruger zone 11,conversion,,,,,1953,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 63E (code 16311). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16212,6-degree Gauss-Kruger zone 12,conversion,,,,,1955,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 69E (code 16312). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16213,6-degree Gauss-Kruger zone 13,conversion,,,,,1957,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 75E (code 16313). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16214,6-degree Gauss-Kruger zone 14,conversion,,,,,1959,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 81E (code 16314). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16215,6-degree Gauss-Kruger zone 15,conversion,,,,,1961,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 87E (code 16315). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16216,6-degree Gauss-Kruger zone 16,conversion,,,,,1963,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 93E (code 16316). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16217,6-degree Gauss-Kruger zone 17,conversion,,,,,1965,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 99E (code 16317). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16218,6-degree Gauss-Kruger zone 18,conversion,,,,,1967,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 105E (code 16318). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16219,6-degree Gauss-Kruger zone 19,conversion,,,,,1969,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 111E (code 16319). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16220,6-degree Gauss-Kruger zone 20,conversion,,,,,1971,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 117E (code 16320). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16221,6-degree Gauss-Kruger zone 21,conversion,,,,,1973,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 123E (code 16321). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16222,6-degree Gauss-Kruger zone 22,conversion,,,,,1975,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 129E (code 16322). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16223,6-degree Gauss-Kruger zone 23,conversion,,,,,1977,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 135E (code 16323). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16224,6-degree Gauss-Kruger zone 24,conversion,,,,,1979,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 141E (code 16324). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16225,6-degree Gauss-Kruger zone 25,conversion,,,,,1981,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 147E (code 16325). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16226,6-degree Gauss-Kruger zone 26,conversion,,,,,1983,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 153E (code 16326). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16227,6-degree Gauss-Kruger zone 27,conversion,,,,,1985,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 159E (code 16327). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16228,6-degree Gauss-Kruger zone 28,conversion,,,,,1987,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 165E (code 16328). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16229,6-degree Gauss-Kruger zone 29,conversion,,,,,1989,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 171E (code 16329). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16230,6-degree Gauss-Kruger zone 30,conversion,,,,,1991,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 177E (code 16330). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16231,6-degree Gauss-Kruger zone 31,conversion,,,,,1873,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 177W (code 16331). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16232,6-degree Gauss-Kruger zone 32,conversion,,,,,1875,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 171W (code 16332). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16233,6-degree Gauss-Kruger zone 33,conversion,,,,,1877,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 165W (code 16333). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16234,6-degree Gauss-Kruger zone 34,conversion,,,,,1879,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 159W (code 16334). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16235,6-degree Gauss-Kruger zone 35,conversion,,,,,1881,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 153W (code 16335). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16236,6-degree Gauss-Kruger zone 36,conversion,,,,,1883,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 147W (code 16336). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16237,6-degree Gauss-Kruger zone 37,conversion,,,,,1885,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 141W (code 16337). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16238,6-degree Gauss-Kruger zone 38,conversion,,,,,1887,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 135W (code 16338). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16239,6-degree Gauss-Kruger zone 39,conversion,,,,,1889,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 129W (code 16339). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16240,6-degree Gauss-Kruger zone 40,conversion,,,,,1891,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 123W (code 16340). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16241,6-degree Gauss-Kruger zone 41,conversion,,,,,1893,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 117W (code 16341). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16242,6-degree Gauss-Kruger zone 42,conversion,,,,,1895,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 111W (code 16342). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16243,6-degree Gauss-Kruger zone 43,conversion,,,,,1897,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 105W (code 16343). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16244,6-degree Gauss-Kruger zone 44,conversion,,,,,1899,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 99W (code 16344). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16245,6-degree Gauss-Kruger zone 45,conversion,,,,,1901,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 93W (code 16345). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16246,6-degree Gauss-Kruger zone 46,conversion,,,,,1903,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 87W (code 16346). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16247,6-degree Gauss-Kruger zone 47,conversion,,,,,2732,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 81W (code 16347). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16248,6-degree Gauss-Kruger zone 48,conversion,,,,,2733,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 75W (code 16348). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16249,6-degree Gauss-Kruger zone 49,conversion,,,,,2734,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 69W (code 16349). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16250,6-degree Gauss-Kruger zone 50,conversion,,,,,2735,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 63W (code 16350). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16251,6-degree Gauss-Kruger zone 51,conversion,,,,,2736,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 57W (code 16351). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16252,6-degree Gauss-Kruger zone 52,conversion,,,,,2737,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 51W (code 16352). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16253,6-degree Gauss-Kruger zone 53,conversion,,,,,2738,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 45W (code 16353). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16254,6-degree Gauss-Kruger zone 54,conversion,,,,,2739,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 39W (code 16354). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16255,6-degree Gauss-Kruger zone 55,conversion,,,,,1921,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 33W (code 16355). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16256,6-degree Gauss-Kruger zone 56,conversion,,,,,1923,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 27W (code 16356). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16257,6-degree Gauss-Kruger zone 57,conversion,,,,,1925,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 21W (code 16357). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16258,6-degree Gauss-Kruger zone 58,conversion,,,,,1927,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 15W (code 16358). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16259,6-degree Gauss-Kruger zone 59,conversion,,,,,1929,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 9W (code 16359). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16260,6-degree Gauss-Kruger zone 60,conversion,,,,,1931,Medium scale topographic mapping.,9807,,,Also found with zone truncated from false easting: see 6-degree Gauss-Kruger cm 3W (code 16360). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16261,3-degree Gauss-Kruger zone 1,conversion,,,,,2299,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 3E (code 16361). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16262,3-degree Gauss-Kruger zone 2,conversion,,,,,2300,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 6E (code 16362). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16263,3-degree Gauss-Kruger zone 3,conversion,,,,,2301,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 9E (code 16363). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16264,3-degree Gauss-Kruger zone 4,conversion,,,,,2302,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 12E (code 16364). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16265,3-degree Gauss-Kruger zone 5,conversion,,,,,2303,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 15E (code 16365). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16266,3-degree Gauss-Kruger zone 6,conversion,,,,,2304,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 18E (code 16366). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16267,3-degree Gauss-Kruger zone 7,conversion,,,,,2305,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 21E (code 16367). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16268,3-degree Gauss-Kruger zone 8,conversion,,,,,2306,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 24E (code 16368). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16269,3-degree Gauss-Kruger zone 9,conversion,,,,,2534,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 27E (code 16369). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16270,3-degree Gauss-Kruger zone 10,conversion,,,,,2535,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 30E (code 16370). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16271,3-degree Gauss-Kruger zone 11,conversion,,,,,2536,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 33E (code 16371). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16272,3-degree Gauss-Kruger zone 12,conversion,,,,,2537,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 36E (code 16372). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16273,3-degree Gauss-Kruger zone 13,conversion,,,,,2538,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 39E (code 16373). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16274,3-degree Gauss-Kruger zone 14,conversion,,,,,2539,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 42E (code 16374). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16275,3-degree Gauss-Kruger zone 15,conversion,,,,,2540,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 45E (code 16375). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16276,3-degree Gauss-Kruger zone 16,conversion,,,,,2604,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 48E (code 16376). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16277,3-degree Gauss-Kruger zone 17,conversion,,,,,2605,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 51E (code 16377). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16278,3-degree Gauss-Kruger zone 18,conversion,,,,,2606,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 54E (code 16378). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16279,3-degree Gauss-Kruger zone 19,conversion,,,,,2607,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 57E (code 16379). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16280,3-degree Gauss-Kruger zone 20,conversion,,,,,2608,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 60E (code 16380). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16281,3-degree Gauss-Kruger zone 21,conversion,,,,,2609,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 63E (code 16381). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16282,3-degree Gauss-Kruger zone 22,conversion,,,,,2610,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 66E (code 16382). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16283,3-degree Gauss-Kruger zone 23,conversion,,,,,2611,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 69E (code 16383). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16284,3-degree Gauss-Kruger zone 24,conversion,,,,,2612,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 72E (code 16384). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16285,3-degree Gauss-Kruger zone 25,conversion,,,,,2613,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 75E (code 16385). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16286,3-degree Gauss-Kruger zone 26,conversion,,,,,2614,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 78E (code 16386). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16287,3-degree Gauss-Kruger zone 27,conversion,,,,,2615,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 81E (code 16387). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16288,3-degree Gauss-Kruger zone 28,conversion,,,,,2616,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 84E (code 16388). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16289,3-degree Gauss-Kruger zone 29,conversion,,,,,2617,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 87E (code 16389). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16290,3-degree Gauss-Kruger zone 30,conversion,,,,,2618,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 90E (code 16390). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16291,3-degree Gauss-Kruger zone 31,conversion,,,,,2619,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 93E (code 16391). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16292,3-degree Gauss-Kruger zone 32,conversion,,,,,2620,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 96E (code 16392). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16293,3-degree Gauss-Kruger zone 33,conversion,,,,,2621,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 99E (code 16393). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16294,3-degree Gauss-Kruger zone 34,conversion,,,,,2622,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 102E (code 16394). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16295,3-degree Gauss-Kruger zone 35,conversion,,,,,2623,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 105E (code 16395). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16296,3-degree Gauss-Kruger zone 36,conversion,,,,,2624,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 108E (code 16396). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16297,3-degree Gauss-Kruger zone 37,conversion,,,,,2625,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 111E (code 16397). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16298,3-degree Gauss-Kruger zone 38,conversion,,,,,2626,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 114E (code 16398). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16299,3-degree Gauss-Kruger zone 39,conversion,,,,,2627,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,Also found with zone truncated from false easting: see 3-degree Gauss-Kruger cm 117E (code 16399). Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16301,6-degree Gauss-Kruger CM 3E,conversion,,,,,1933,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 1N (code 16201) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16302,6-degree Gauss-Kruger CM 9E,conversion,,,,,1935,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 2N (code 16202) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16303,6-degree Gauss-Kruger CM 15E,conversion,,,,,1937,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 3N (code 16203) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16304,6-degree Gauss-Kruger CM 21E,conversion,,,,,1939,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 4N (code 16204) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16305,6-degree Gauss-Kruger CM 27E,conversion,,,,,1941,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 5N (code 16205) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16306,6-degree Gauss-Kruger CM 33E,conversion,,,,,1943,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 6N (code 16206) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16307,6-degree Gauss-Kruger CM 39E,conversion,,,,,1945,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 7N (code 16207) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16308,6-degree Gauss-Kruger CM 45E,conversion,,,,,1947,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 8N (code 16208) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16309,6-degree Gauss-Kruger CM 51E,conversion,,,,,1949,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 9N (code 16209) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16310,6-degree Gauss-Kruger CM 57E,conversion,,,,,1951,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 10N (code 16210) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16311,6-degree Gauss-Kruger CM 63E,conversion,,,,,1953,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 11N (code 16211) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16312,6-degree Gauss-Kruger CM 69E,conversion,,,,,1955,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 12N (code 16212) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16313,6-degree Gauss-Kruger CM 75E,conversion,,,,,1957,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 13N (code 16213) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16314,6-degree Gauss-Kruger CM 81E,conversion,,,,,1959,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 14N (code 16214) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16315,6-degree Gauss-Kruger CM 87E,conversion,,,,,1961,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 15N (code 16215) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16316,6-degree Gauss-Kruger CM 93E,conversion,,,,,1963,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 16N (code 16216) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16317,6-degree Gauss-Kruger CM 99E,conversion,,,,,1965,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 17N (code 16217) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16318,6-degree Gauss-Kruger CM 105E,conversion,,,,,1967,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 18N (code 16218) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16319,6-degree Gauss-Kruger CM 111E,conversion,,,,,1969,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 19N (code 16219) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16320,6-degree Gauss-Kruger CM 117E,conversion,,,,,1971,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 20N (code 16220) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16321,6-degree Gauss-Kruger CM 123E,conversion,,,,,1973,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 21N (code 16221) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16322,6-degree Gauss-Kruger CM 129E,conversion,,,,,1975,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 22N (code 16222) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16323,6-degree Gauss-Kruger CM 135E,conversion,,,,,1977,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 23N (code 16223) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16324,6-degree Gauss-Kruger CM 141E,conversion,,,,,1979,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 24N (code 16224) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16325,6-degree Gauss-Kruger CM 147E,conversion,,,,,1981,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 25N (code 16225) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16326,6-degree Gauss-Kruger CM 153E,conversion,,,,,1983,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 26N (code 16226) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16327,6-degree Gauss-Kruger CM 159E,conversion,,,,,1985,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 27N (code 16227) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16328,6-degree Gauss-Kruger CM 165E,conversion,,,,,1987,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 28N (code 16228) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16329,6-degree Gauss-Kruger CM 171E,conversion,,,,,1989,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 29N (code 16229) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16330,6-degree Gauss-Kruger CM 177E,conversion,,,,,1991,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 30N (code 16230) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16331,6-degree Gauss-Kruger CM 177W,conversion,,,,,1873,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 31N (code 16231) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16332,6-degree Gauss-Kruger CM 171W,conversion,,,,,1875,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 32N (code 16232) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,95.28 2002.36,1,0
+16333,6-degree Gauss-Kruger CM 165W,conversion,,,,,1877,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 33N (code 16233) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16334,6-degree Gauss-Kruger CM 159W,conversion,,,,,1879,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 34N (code 16234) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16335,6-degree Gauss-Kruger CM 153W,conversion,,,,,1881,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 35N (code 16235) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16336,6-degree Gauss-Kruger CM 147W,conversion,,,,,1883,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 36N (code 16236) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16337,6-degree Gauss-Kruger CM 141W,conversion,,,,,1885,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 37N (code 16237) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16338,6-degree Gauss-Kruger CM 135W,conversion,,,,,1887,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 38N (code 16238) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16339,6-degree Gauss-Kruger CM 129W,conversion,,,,,1889,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 39N (code 16239) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16340,6-degree Gauss-Kruger CM 123W,conversion,,,,,1891,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 40N (code 16240) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16341,6-degree Gauss-Kruger CM 117W,conversion,,,,,1893,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 41N (code 16241) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16342,6-degree Gauss-Kruger CM 111W,conversion,,,,,1895,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 42N (code 16242) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16343,6-degree Gauss-Kruger CM 105W,conversion,,,,,1897,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 43N (code 16243) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16344,6-degree Gauss-Kruger CM 99W,conversion,,,,,1899,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 44N (code 16244) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16345,6-degree Gauss-Kruger CM 93W,conversion,,,,,1901,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 45N (code 16245) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16346,6-degree Gauss-Kruger CM 87W,conversion,,,,,1903,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 46N (code 16246) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16347,6-degree Gauss-Kruger CM 81W,conversion,,,,,1905,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 47N (code 16247) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16348,6-degree Gauss-Kruger CM 75W,conversion,,,,,1907,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 48N (code 16248) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16349,6-degree Gauss-Kruger CM 69W,conversion,,,,,1909,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 49N (code 16249) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16350,6-degree Gauss-Kruger CM 63W,conversion,,,,,1911,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 50N (code 16250) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16351,6-degree Gauss-Kruger CM 57W,conversion,,,,,1913,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 51N (code 16251) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16352,6-degree Gauss-Kruger CM 51W,conversion,,,,,1915,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 52N (code 16252) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16353,6-degree Gauss-Kruger CM 45W,conversion,,,,,1917,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 53N (code 16253) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16354,6-degree Gauss-Kruger CM 39W,conversion,,,,,1919,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 54N (code 16254) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16355,6-degree Gauss-Kruger CM 33W,conversion,,,,,1921,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 55N (code 16255) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16356,6-degree Gauss-Kruger CM 27W,conversion,,,,,1923,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 56N (code 16256) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16357,6-degree Gauss-Kruger CM 21W,conversion,,,,,1925,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 57N (code 16257) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16358,6-degree Gauss-Kruger CM 15W,conversion,,,,,1927,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 58N (code 16258) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16359,6-degree Gauss-Kruger CM 9W,conversion,,,,,1929,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 59N (code 16259) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16360,6-degree Gauss-Kruger CM 3W,conversion,,,,,1931,Medium scale topographic mapping.,9807,,,6-degree Gauss-Kruger zone 60N (code 16260) without zone prefix to FE. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16361,3-degree Gauss-Kruger CM 3E,conversion,,,,,2299,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 1N (code 16261) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16362,3-degree Gauss-Kruger CM 6E,conversion,,,,,2300,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 2N (code 16262) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16363,3-degree Gauss-Kruger CM 9E,conversion,,,,,2301,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 3N (code 16263) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16364,3-degree Gauss-Kruger CM 12E,conversion,,,,,2302,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 4N (code 16264) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16365,3-degree Gauss-Kruger CM 15E,conversion,,,,,2303,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 5N (code 16265) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16366,3-degree Gauss-Kruger CM 18E,conversion,,,,,2304,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 6N (code 16266) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16367,3-degree Gauss-Kruger CM 21E,conversion,,,,,2305,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 7N (code 16267) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16368,3-degree Gauss-Kruger CM 24E,conversion,,,,,2306,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 8N (code 16268) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+16369,3-degree Gauss-Kruger CM 27E,conversion,,,,,2534,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 9N (code 16269) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16370,3-degree Gauss-Kruger CM 30E,conversion,,,,,2535,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 10N (code 16270) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16371,3-degree Gauss-Kruger CM 33E,conversion,,,,,2536,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 11N (code 16271) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16372,3-degree Gauss-Kruger CM 36E,conversion,,,,,2537,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 12N (code 16272) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16373,3-degree Gauss-Kruger CM 39E,conversion,,,,,2538,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 13N (code 16273) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16374,3-degree Gauss-Kruger CM 42E,conversion,,,,,2539,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 14N (code 16274) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16375,3-degree Gauss-Kruger CM 45E,conversion,,,,,2540,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 15N (code 16275) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16376,3-degree Gauss-Kruger CM 48E,conversion,,,,,2604,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 16N (code 16276) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16377,3-degree Gauss-Kruger CM 51E,conversion,,,,,2605,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 17N (code 16277) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16378,3-degree Gauss-Kruger CM 54E,conversion,,,,,2606,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 18N (code 16278) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16379,3-degree Gauss-Kruger CM 57E,conversion,,,,,2607,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 19N (code 16279) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16380,3-degree Gauss-Kruger CM 60E,conversion,,,,,2608,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 20N (code 16280) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16381,3-degree Gauss-Kruger CM 63E,conversion,,,,,2609,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 21N (code 16281) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16382,3-degree Gauss-Kruger CM 66E,conversion,,,,,2610,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 22N (code 16282) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16383,3-degree Gauss-Kruger CM 69E,conversion,,,,,2611,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 23N (code 16283) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16384,3-degree Gauss-Kruger CM 72E,conversion,,,,,2612,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 24N (code 16284) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16385,3-degree Gauss-Kruger CM 75E,conversion,,,,,2613,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 25N (code 16285) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16386,3-degree Gauss-Kruger CM 78E,conversion,,,,,2614,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 26N (code 16286) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16387,3-degree Gauss-Kruger CM 81E,conversion,,,,,2615,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 27N (code 16287) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16388,3-degree Gauss-Kruger CM 84E,conversion,,,,,2616,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 28N (code 16288) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16389,3-degree Gauss-Kruger CM 87E,conversion,,,,,2617,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 29N (code 16289) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16390,3-degree Gauss-Kruger CM 90E,conversion,,,,,2618,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 30N (code 16290) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16391,3-degree Gauss-Kruger CM 93E,conversion,,,,,2619,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 31N (code 16291) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16392,3-degree Gauss-Kruger CM 96E,conversion,,,,,2620,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 32N (code 16292) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16393,3-degree Gauss-Kruger CM 99E,conversion,,,,,2621,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 33N (code 16293) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16394,3-degree Gauss-Kruger CM 102E,conversion,,,,,2622,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 34N (code 16294) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16395,3-degree Gauss-Kruger CM 105E,conversion,,,,,2623,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 35N (code 16295) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16396,3-degree Gauss-Kruger CM 108E,conversion,,,,,2624,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 36N (code 16296) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16397,3-degree Gauss-Kruger CM 111E,conversion,,,,,2625,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 37N (code 16297) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16398,3-degree Gauss-Kruger CM 114E,conversion,,,,,2626,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 38N (code 16298) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16399,3-degree Gauss-Kruger CM 117E,conversion,,,,,2627,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,3-degree Gauss-Kruger zone 39N (code 16299) without zone prefix to false easting value. Original transformation by Gauss-Kruger formula.,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+16400,TM 0 N,conversion,,,,,1629,Oil exploration.,9807,,,,Shell UK,EPSG,1998-11-11 00:00:00,,1,0
+16405,TM 5 NE,conversion,,,,,1630,Oil exploration.,9807,,,,NAM,EPSG,1998-11-11 00:00:00,,1,0
+16406,TM 6 NE,conversion,,,,,1717,Oil exploration.,9807,,,Used by ExxonMobil for deepwater blocks offshore Nigeria.,ExxonMobil,EPSG,2002-02-12 00:00:00,,1,0
+16411,TM 11 NE,conversion,,,,,1489,Oil exploration.,9807,,,,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+16412,TM 12 NE,conversion,,,,,1143,Oil exploration.,9807,,,,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+16413,TM 13 NE,conversion,,,,,2771,Oil exploration.,9807,,,,TotalFinaElf,EPSG,2002-06-28 00:00:00,,1,0
+16430,TM 30 NE,conversion,,,,,2546,Oil exploration.,9807,,,,TotalFinaElf,EPSG,2001-11-06 00:00:00,,1,0
+16506,TM 106 NE,conversion,,,,,1495,Oil exploration.,9807,,,,PetroVietnam,EPSG,2000-03-07 00:00:00,,1,0
+16586,GK 106 NE,conversion,,,,,1494,Oil exploration.,9807,,,,BP Amoco,EPSG,2000-03-07 00:00:00,,1,0
+16611,TM 11.30 SE,conversion,,,,,1605,Oil exploration.,9807,,,,Esso Angola,EPSG,1998-11-11 00:00:00,,1,0
+16612,TM 12 SE,conversion,,,,,1604,Oil exploration.,9807,,,,Shell Angola,EPSG,1998-11-11 00:00:00,,1,0
+16636,TM 36 SE,conversion,,,,,1726,Oil exploration.,9807,,,,BP Mozambique,EPSG,1998-11-11 00:00:00,,1,0
+16709,TM 109 SE,conversion,,,,,2577,Oil exploration.,9807,,,Used by Arco and BP for ONWJ.,BP,EPSG,2002-02-12 00:00:00,,1,0
+16716,TM 116 SE,conversion,,,,,2588,Oil exploration.,9807,,,Used by BP for Terang-Sirasun.,BP,EPSG,2002-02-12 00:00:00,,1,0
+16732,TM 132 SE,conversion,,,,,2589,Oil exploration.,9807,,,Used for Tangguh developments.,BP,EPSG,2002-02-12 00:00:00,,1,0
+17001,TM 1 NW,conversion,,,,,1505,Oil exploration.,9807,,,,Various industry sources,EPSG,2000-10-19 00:00:00,,1,0
+17005,TM 5 NW,conversion,,,,,2296,Oil exploration.,9807,,,,Various oil industry sources,EPSG,2001-06-05 00:00:00,,1,0
+17054,TM 54 NW,conversion,,,,,1727,Oil exploration.,9807,,,,Shell,EPSG,2000-06-10 00:00:00,,1,0
+17348,Map Grid of Australia zone 48,conversion,,,,,1556,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17349,Map Grid of Australia zone 49,conversion,,,,,1557,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17350,Map Grid of Australia zone 50,conversion,,,,,1558,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17351,Map Grid of Australia zone 51,conversion,,,,,1559,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17352,Map Grid of Australia zone 52,conversion,,,,,1560,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17353,Map Grid of Australia zone 53,conversion,,,,,1561,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17354,Map Grid of Australia zone 54,conversion,,,,,1562,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17355,Map Grid of Australia zone 55,conversion,,,,,1563,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17356,Map Grid of Australia zone 56,conversion,,,,,1564,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17357,Map Grid of Australia zone 57,conversion,,,,,1565,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17358,Map Grid of Australia zone 58,conversion,,,,,1566,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17448,Australian Map Grid zone 48,conversion,,,,,1556,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17449,Australian Map Grid zone 49,conversion,,,,,1557,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17450,Australian Map Grid zone 50,conversion,,,,,1558,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17451,Australian Map Grid zone 51,conversion,,,,,1559,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17452,Australian Map Grid zone 52,conversion,,,,,1560,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17453,Australian Map Grid zone 53,conversion,,,,,1561,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17454,Australian Map Grid zone 54,conversion,,,,,1567,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17455,Australian Map Grid zone 55,conversion,,,,,1568,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17456,Australian Map Grid zone 56,conversion,,,,,2291,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17457,Australian Map Grid zone 57,conversion,,,,,1565,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17458,Australian Map Grid zone 58,conversion,,,,,1566,Large and medium scale topographic mapping and engineering survey.,9807,,,Grid convergence uses opposite sign convention to UTM,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+17515,South African Survey Grid zone 15,conversion,,,,,1454,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+17517,South African Survey Grid zone 17,conversion,,,,,1455,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+17519,South African Survey Grid zone 19,conversion,,,,,1456,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+17521,South African Survey Grid zone 21,conversion,,,,,1457,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+17523,South African Survey Grid zone 23,conversion,,,,,1458,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+17525,South African Survey Grid zone 25,conversion,,,,,1459,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+17527,South African Survey Grid zone 27,conversion,,,,,1460,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+17529,South African Survey Grid zone 29,conversion,,,,,1461,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+17531,South African Survey Grid zone 31,conversion,,,,,1462,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+17533,South African Survey Grid zone 33,conversion,,,,,1463,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+17611,South West African Survey Grid zone 11,conversion,,,,,1838,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,1997-06-16 00:00:00,95.30  96.29  97.16,1,0
+17613,South West African Survey Grid zone 13,conversion,,,,,1839,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,1997-06-16 00:00:00,95.30  96.29  97.16,1,0
+17615,South West African Survey Grid zone 15,conversion,,,,,1840,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,1997-06-16 00:00:00,95.30  96.29  97.16,1,0
+17617,South West African Survey Grid zone 17,conversion,,,,,1841,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,1997-06-16 00:00:00,95.30  96.29  97.16,1,0
+17619,South West African Survey Grid zone 19,conversion,,,,,1842,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,1997-06-16 00:00:00,95.30  96.29  97.16,1,0
+17621,South West African Survey Grid zone 21,conversion,,,,,1843,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,1997-06-16 00:00:00,95.30  96.29  97.16,1,0
+17623,South West African Survey Grid zone 23,conversion,,,,,1844,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,1997-06-16 00:00:00,95.30  96.29  97.16,1,0
+17625,South West African Survey Grid zone 25,conversion,,,,,1845,"Large and medium scale topographic mapping, cadastral and engineering survey.",9808,,,"Transformation method sometimes described as ""Gauss conform"".",Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,1997-06-16 00:00:00,95.30  96.29  97.16,1,0
+17700,MTM Quebec zone 2,conversion,,,,,1420,Large and medium scale topographic mapping and engineering survey.,9807,,,,Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,1997-11-13 00:00:00,,1,0
+17701,MTM zone 1,conversion,,,,,2226,Large and medium scale topographic mapping and engineering survey.,9807,,,,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+17702,MTM Newfoundland zone 2,conversion,,,,,2227,Large and medium scale topographic mapping and engineering survey.,9807,,,,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+17703,MTM zone 3,conversion,,,,,2290,Large and medium scale topographic mapping and engineering survey.,9807,,,,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+17704,MTM zone 4,conversion,,,,,2276,Large and medium scale topographic mapping and engineering survey.,9807,,,,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+17705,MTM zone 5,conversion,,,,,2277,Large and medium scale topographic mapping and engineering survey.,9807,,,,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+17706,MTM zone 6,conversion,,,,,2278,Large and medium scale topographic mapping and engineering survey.,9807,,,,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+17707,MTM zone 7,conversion,,,,,1425,Large and medium scale topographic mapping and engineering survey.,9807,,,,Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,1997-11-13 00:00:00,,1,0
+17708,MTM zone 8,conversion,,,,,2279,Large and medium scale topographic mapping and engineering survey.,9807,,,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+17709,MTM zone 9,conversion,,,,,2280,Large and medium scale topographic mapping and engineering survey.,9807,,,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+17710,MTM zone 10,conversion,,,,,2281,Large and medium scale topographic mapping and engineering survey.,9807,,,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+17711,MTM zone 11,conversion,,,,,1432,Large and medium scale topographic mapping and engineering survey.,9807,,,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+17712,MTM zone 12,conversion,,,,,1433,Large and medium scale topographic mapping and engineering survey.,9807,,,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+17713,MTM zone 13,conversion,,,,,1434,Large and medium scale topographic mapping and engineering survey.,9807,,,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+17714,MTM zone 14,conversion,,,,,1435,Large and medium scale topographic mapping and engineering survey.,9807,,,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+17715,MTM zone 15,conversion,,,,,1436,Large and medium scale topographic mapping and engineering survey.,9807,,,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+17716,MTM zone 16,conversion,,,,,1437,Large and medium scale topographic mapping and engineering survey.,9807,,,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+17717,MTM zone 17,conversion,,,,,1438,Large and medium scale topographic mapping and engineering survey.,9807,,,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+17794,MTM Nova Scotia zone 4,conversion,,,,,1534,Large and medium scale topographic mapping and engineering survey.,9807,,,,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,1999-05-24 00:00:00,99.042,1,0
+17795,MTM Nova Scotia zone 5,conversion,,,,,1535,Large and medium scale topographic mapping and engineering survey.,9807,,,,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,1999-05-24 00:00:00,99.042,1,0
+17801,Japan Plane Rectangular CS zone I,conversion,,,,,1854,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17802,Japan Plane Rectangular CS zone II,conversion,,,,,1855,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17803,Japan Plane Rectangular CS zone III,conversion,,,,,1856,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17804,Japan Plane Rectangular CS zone IV,conversion,,,,,1857,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17805,Japan Plane Rectangular CS zone V,conversion,,,,,1858,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17806,Japan Plane Rectangular CS zone VI,conversion,,,,,1859,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17807,Japan Plane Rectangular CS zone VII,conversion,,,,,1860,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17808,Japan Plane Rectangular CS zone VIII,conversion,,,,,1861,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17809,Japan Plane Rectangular CS zone IX,conversion,,,,,1862,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17810,Japan Plane Rectangular CS zone X,conversion,,,,,1863,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17811,Japan Plane Rectangular CS zone XI,conversion,,,,,1864,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17812,Japan Plane Rectangular CS zone XII,conversion,,,,,1865,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17813,Japan Plane Rectangular CS zone XIII,conversion,,,,,1866,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+17814,Japan Plane Rectangular CS zone XIV,conversion,,,,,1867,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,2002.08,1,0
+17815,Japan Plane Rectangular CS zone XV,conversion,,,,,1868,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,2002.08,1,0
+17816,Japan Plane Rectangular CS zone XVI,conversion,,,,,1869,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,2002.08,1,0
+17817,Japan Plane Rectangular CS zone XVII,conversion,,,,,1870,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,2002.08,1,0
+17818,Japan Plane Rectangular CS zone XVIII,conversion,,,,,1871,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,2002.08,1,0
+17819,Japan Plane Rectangular CS zone XIX,conversion,,,,,1872,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,Original transformation by Gauss-Kruger formula.,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,2002.08,1,0
+17901,Mount Eden Circuit,conversion,,,,,1500,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Mount Eden Circuit 2000 (code 17931) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17902,Bay of Plenty Circuit,conversion,,,,,1500,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Bay of Plenty Circuit 2000 (code 17932) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17903,Poverty Bay Circuit,conversion,,,,,1500,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Poverty Bay Circuit 2000 (code 17933) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17904,Hawkes Bay Circuit,conversion,,,,,1500,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Hawkes Bay Circuit 2000 (code 17934) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17905,Taranaki Circuit,conversion,,,,,1500,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Taranaki Circuit 2000 (code 17935) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17906,Tuhirangi Circuit,conversion,,,,,1500,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Tuhirangi Circuit 2000 (code 17936) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17907,Wanganui Circuit,conversion,,,,,1500,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Wanganui Circuit 2000 (code 17937) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17908,Wairarapa Circuit,conversion,,,,,1500,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Wairarapa Circuit 2000 (code 17938) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17909,Wellington Circuit,conversion,,,,,1500,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Wellington Circuit 2000 (code 17939) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17910,Collingwood Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Collingwood Circuit 2000 (code 17940) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17911,Nelson Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Nelson Circuit 2000 (code 17941) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17912,Karamea Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Karamea Circuit 2000 (code 17942) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17913,Buller Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Buller Circuit 2000 (code 17943) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17914,Grey Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Grey Circuit 2000 (code 17944) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17915,Amuri Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Amuri Circuit 2000 (code 17945) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17916,Marlborough Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Marlborough Circuit 2000 (code 17946) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17917,Hokitika Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Hokitika Circuit 2000 (code 17947) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17918,Okarito Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Okarito Circuit 2000 (code 17948) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17919,Jacksons Bay Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Jacksons Bay Circuit 2000 (code 17949) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17920,Mount Pleasant Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Mount Pleasant Circuit 2000 (code 17950) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17921,Gawler Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Gawler Circuit 2000 (code 17951) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17922,Timaru Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Timaru Circuit 2000 (code 17952) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17923,Lindis Peak Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Lindis Peak Circuit 2000 (code 17953) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17924,Mount Nicholas Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Mount Nicholas Circuit 2000 (code 17954) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17925,Mount York Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Mount York Circuit 2000 (code 17955) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17926,Observation Point Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Observation Point Circuit 2000 (code 17956) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17927,North Taieri Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by North Taieri Circuit 2000 (code 17957) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17928,Bluff Circuit,conversion,,,,,1501,Cadastral surveying.,9807,,,Superseded Imperial measure circuit in 1972.  Superseded by Bluff Circuit 2000 (code 17958) from March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17931,Mount Eden Circuit 2000,conversion,,,,,1500,Cadastral surveying.,9807,,,Supersedes Mount Eden Circuit (code 17901) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17932,Bay of Plenty Circuit 2000,conversion,,,,,1500,Cadastral surveying.,9807,,,Supersedes Bay of Plenty Circuit (code 17902) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17933,Poverty Bay Circuit 2000,conversion,,,,,1500,Cadastral surveying.,9807,,,Supersedes Poverty Bay Circuit (code 17903) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17934,Hawkes Bay Circuit 2000,conversion,,,,,1500,Cadastral surveying.,9807,,,Supersedes Hawkes Bay Circuit (code 17904) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17935,Taranaki Circuit 2000,conversion,,,,,1500,Cadastral surveying.,9807,,,Supersedes Taranaki Circuit (code 17905) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17936,Tuhirangi Circuit 2000,conversion,,,,,1500,Cadastral surveying.,9807,,,Supersedes Tuhirangi Circuit (code 17906) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17937,Wanganui Circuit 2000,conversion,,,,,1500,Cadastral surveying.,9807,,,Supersedes Wanganui Circuit (code 17907) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17938,Wairarapa Circuit 2000,conversion,,,,,1500,Cadastral surveying.,9807,,,Supersedes Wairarapa Circuit (code 17908) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17939,Wellington Circuit 2000,conversion,,,,,1500,Cadastral surveying.,9807,,,Supersedes Wellington Circuit (code 17909) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17940,Collingwood Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Collingwood Circuit (code 17910) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17941,Nelson Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Nelson Circuit (code 17911) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17942,Karamea Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Karamea Circuit (code 17912) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17943,Buller Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Buller Circuit (code 17913) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17944,Grey Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Grey Circuit (code 17914) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17945,Amuri Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Amuri Circuit (code 17915) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17946,Marlborough Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Marlborough Circuit (code 17916) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17947,Hokitika Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Hokitika Circuit (code 17917) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17948,Okarito Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Okarito Circuit (code 17918) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17949,Jacksons Bay Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Jacksons Bay Circuit (code 17919) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17950,Mount Pleasant Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Mount Pleasant Circuit (code 17920) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17951,Gawler Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Gawler Circuit (code 17921) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17952,Timaru Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Timaru Circuit (code 17922) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17953,Lindis Peak Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Lindis Peak Circuit (code 17923) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17954,Mount Nicholas Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Mount Nicholas Circuit (code 17924) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17955,Mount York Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Mount York Circuit (code 17925) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17956,Observation Point Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Observation Point Circuit (code 17926) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17957,North Taieri Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes North Taieri Circuit (code 17927) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+17958,Bluff Circuit 2000,conversion,,,,,1501,Cadastral surveying.,9807,,,Supersedes Bluff Circuit (code 17928) after 1st March 2000.,Land Information New Zealand OSG Technical Report 8; April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+18011,Nord Algerie (ancienne),conversion,,,,,1728,Large and medium scale topographic mapping and engineering survey.,9801,,,Used with Voirol 1875 datum - now superseded.,,EPSG,1996-09-12 00:00:00,,1,0
+18012,Sud Algerie (ancienne),conversion,,,,,1729,Large and medium scale topographic mapping and engineering survey.,9801,,,Used with Voirol 1875 datum - now superseded.,,EPSG,1996-09-12 00:00:00,,1,0
+18021,Nord Algerie,conversion,,,,,1728,Large and medium scale topographic mapping and engineering survey.,9801,,,Use with Nord Sahara 1959 datum.,,EPSG,1996-09-12 00:00:00,,1,0
+18022,Sud Algerie,conversion,,,,,1729,Large and medium scale topographic mapping and engineering survey.,9801,,,Use with Nord Sahara 1959 datum.,,EPSG,1996-09-12 00:00:00,,1,0
+18031,Argentina zone 1,conversion,,,,,1608,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Kruger formula,,EPSG,2002-06-22 00:00:00,95.30 2002.36,1,0
+18032,Argentina zone 2,conversion,,,,,1609,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Kruger formula,,EPSG,2002-06-22 00:00:00,95.30 2002.36,1,0
+18033,Argentina zone 3,conversion,,,,,1610,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Kruger formula,,EPSG,2002-06-22 00:00:00,95.30 2002.36,1,0
+18034,Argentina zone 4,conversion,,,,,1611,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Kruger formula,,EPSG,2002-06-22 00:00:00,95.30 2002.36,1,0
+18035,Argentina zone 5,conversion,,,,,1612,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Kruger formula,,EPSG,2002-06-22 00:00:00,95.30 2002.36,1,0
+18036,Argentina zone 6,conversion,,,,,1613,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Kruger formula,,EPSG,2002-06-22 00:00:00,95.30 2002.36,1,0
+18037,Argentina zone 7,conversion,,,,,1614,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Kruger formula,,EPSG,2002-06-22 00:00:00,95.30 2002.36,1,0
+18041,Austria West Zone,conversion,,,,,1706,Large and medium scale topographic mapping and engineering survey.,9807,,,Superseded by M28 (EPSG code 18044).,,EPSG,1997-04-11 00:00:00,95.30  96.29  97.01  98.48,1,0
+18042,Austria Central Zone,conversion,,,,,1707,Large and medium scale topographic mapping and engineering survey.,9807,,,Superseded by M31 (EPSG code 18045).,,EPSG,1997-04-11 00:00:00,95.30  96.29  97.01  98.48,1,0
+18043,Austria East Zone,conversion,,,,,1708,Large and medium scale topographic mapping and engineering survey.,9807,,,Superseded by M34 (EPSG code 18046).,,EPSG,1997-04-11 00:00:00,95.30  96.29  97.01  98.48,1,0
+18044,Austria M28,conversion,,,,,1706,Large and medium scale topographic mapping and engineering survey.,9807,,,Supersedes Austria West zone (EPSG code 18041).,Bundesamt f�r Eich- und Vermessungswesen,EPSG,1999-10-20 00:00:00,,1,0
+18045,Austria M31,conversion,,,,,1707,Large and medium scale topographic mapping and engineering survey.,9807,,,Supersedes Austria Central zone (EPSG code 18042).,Bundesamt f�r Eich- und Vermessungswesen,EPSG,1999-10-20 00:00:00,,1,0
+18046,Austria M34,conversion,,,,,1708,Large and medium scale topographic mapping and engineering survey.,9807,,,Supersedes Austria East zone (EPSG code 18043).,Bundesamt f�r Eich- und Vermessungswesen,EPSG,1999-10-20 00:00:00,,1,0
+18051,Colombia West zone,conversion,,,,,1598,Large and medium scale topographic mapping and engineering survey.,9807,,,"Original transformation by Gauss-Kruger formula.  Zone name sometimes referred to as ""6 west"".",,EPSG,1997-04-11 00:00:00,95.30  96.29  97.11,1,0
+18052,Colombia Bogota zone,conversion,,,,,1599,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Kruger formula,,EPSG,1997-04-11 00:00:00,95.30  96.29  97.11,1,0
+18053,Colombia East Central zone,conversion,,,,,1600,Large and medium scale topographic mapping and engineering survey.,9807,,,"Original transformation by Gauss-Kruger formula.  Zone name sometimes referred to as ""3 east"".",,EPSG,1997-04-11 00:00:00,95.30  96.29  97.11,1,0
+18054,Colombia East zone,conversion,,,,,1601,Large and medium scale topographic mapping and engineering survey.,9807,,,"Original transformation by Gauss-Kruger formula.  Zone name sometimes referred to as ""6 east"".",,EPSG,1997-04-11 00:00:00,95.30  96.29  97.11,1,0
+18061,Cuba Norte,conversion,,,,,1487,Large and medium scale topographic mapping and engineering survey.,9801,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+18062,Cuba Sur,conversion,,,,,1488,Large and medium scale topographic mapping and engineering survey.,9801,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+18071,Egypt Blue Belt,conversion,,,,,1642,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,2002-07-16 00:00:00,2002.49,1,0
+18072,Egypt Red Belt,conversion,,,,,1643,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30,1,0
+18073,Egypt Purple Belt,conversion,,,,,1644,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30,1,0
+18074,Egypt Extended Purple Belt,conversion,,,,,1645,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30,1,0
+18081,Lambert zone I,conversion,,,,,1731,Large and medium scale topographic mapping and engineering survey.,9801,,,Introduced 1972. Supersedes Lambert Nord France (code 18091).,IGN Paris.,EPSG,2001-11-06 00:00:00,95.26  2001.54,1,0
+18082,Lambert zone II,conversion,,,,,1734,Large and medium scale topographic mapping and engineering survey.,9801,,,Introduced 1972. Supersedes Lambert Centre France (code 18092).,IGN Paris.,EPSG,2001-11-06 00:00:00,95.26  2001.54,1,0
+18083,Lambert zone III,conversion,,,,,1733,Large and medium scale topographic mapping and engineering survey.,9801,,,Introduced 1972. Supersedes Lambert Sud France (code 18093).,IGN Paris.,EPSG,2001-11-06 00:00:00,95.26  2001.54,1,0
+18084,Lambert zone IV,conversion,,,,,1327,Large and medium scale topographic mapping and engineering survey.,9801,,,Introduced 1972. Supersedes Lambert Corse (code 18094).,IGN Paris.,EPSG,2001-11-06 00:00:00,2001.54,1,0
+18085,Lambert-93,conversion,,,,,1326,Large and medium scale topographic mapping and engineering survey.,9802,,,,IGN - Paris,EPSG,2000-10-19 00:00:00,,1,0
+18086,France EuroLambert,conversion,,,,,1326,Medium scale topographic and statistical mapping.,9801,,,This is Lambert zone II (code 18082) parameters converted from grads/Paris to degrees/Greenwich for use with ED50.,IGN Paris via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18091,Lambert Nord France,conversion,,,,,1731,Large and medium scale topographic mapping and engineering survey.,9801,,,Superseded in 1972 by Lambert zone I (code 18081).,IGN Paris.,EPSG,2001-11-06 00:00:00,95.26  2001.54,1,0
+18092,Lambert Centre France,conversion,,,,,1734,Large and medium scale topographic mapping and engineering survey.,9801,,,Superseded in 1972 by Lambert zone II (code 18082).,IGN Paris.,EPSG,2001-11-06 00:00:00,95.26  2001.54,1,0
+18093,Lambert Sud France,conversion,,,,,1733,Large and medium scale topographic mapping and engineering survey.,9801,,,Superseded in 1972 by Lambert zone III (code 18083).,IGN Paris.,EPSG,2001-11-06 00:00:00,95.26  2001.54,1,0
+18094,Lambert Corse,conversion,,,,,1327,Large and medium scale topographic mapping and engineering survey.,9801,,,Superseded in 1972 by Lambert zone IV (code 18084).,IGN Paris.,EPSG,2001-11-06 00:00:00,2001.54,1,0
+18110,India zone 0,conversion,,,,,1668,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,US Army Map Service projection tables; 1943.,EPSG,1999-10-20 00:00:00,95.30  96.01  96.02  96.29  97.23,1,0
+18111,India zone I,conversion,,,,,1669,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,US Army Map Service projection tables; 1943.,EPSG,1999-10-20 00:00:00,95.30  96.02  96.29  97.23,1,0
+18112,India zone IIa,conversion,,,,,1670,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,US Army Map Service projection tables; 1943.,EPSG,1999-10-20 00:00:00,95.28  96.02  97.23,1,0
+18113,India zone IIb,conversion,,,,,1671,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,US Army Map Service projection tables; 1943.,EPSG,2000-03-07 00:00:00,95.28  96.02  97.23  2000.094,1,0
+18114,India zone IIIa,conversion,,,,,1672,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,US Army Map Service projection tables; 1943.,EPSG,2000-03-07 00:00:00,95.28  96.02  97.23  2000.094,1,0
+18115,India zone IIIb,conversion,,,,,2292,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,US Army Map Service projection tables; 1943.,EPSG,1999-10-20 00:00:00,95.28  96.02  97.23,1,0
+18116,India zone IVa,conversion,,,,,1673,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,US Army Map Service projection tables; 1943.,EPSG,2000-03-07 00:00:00,95.28  96.02  97.23  2000.094,1,0
+18117,India zone IVb,conversion,,,,,2293,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,US Army Map Service projection tables; 1943.,EPSG,1999-10-20 00:00:00,95.28  96.02  97.23,1,0
+18121,Italy zone 1,conversion,,,,,1718,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Boaga formula,,EPSG,1995-12-02 00:00:00,,1,0
+18122,Italy zone 2,conversion,,,,,1719,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Boaga formula,,EPSG,1995-12-02 00:00:00,,1,0
+18131,Nord Maroc,conversion,,,,,1703,Large and medium scale topographic mapping and engineering survey.,9801,,,A projection with the same parameter values used the Lambert Conic Near-Conformal method (EPSG code 9817) prior to 1953.,IGN Paris.,EPSG,1996-09-12 00:00:00,99.203,1,0
+18132,Sud Maroc,conversion,,,,,1704,Large and medium scale topographic mapping and engineering survey.,9801,,,A projection with the same parameter values used the Lambert Conic Near-Conformal method (EPSG code 9817) prior to 1953.,IGN Paris.,EPSG,1996-09-12 00:00:00,99.203,1,0
+18133,Sahara,conversion,,,,,1705,Large and medium scale topographic mapping and engineering survey.,9801,,,Created in 1977 to cover Sahara Marocain (ex Spanish Sahara),IGN Paris.,EPSG,1996-09-12 00:00:00,,1,0
+18141,New Zealand North Island National Grid,conversion,,,,,1500,Large and medium scale topographic mapping and engineering survey.,9807,,,Superseded by New Zealand Map Grid (code 19917).  Used for topographic mapping.,,EPSG,1999-10-20 00:00:00,95.30  96.29  97.231,1,0
+18142,New Zealand South Island National Grid,conversion,,,,,1501,Large and medium scale topographic mapping and engineering survey.,9807,,,Superseded by New Zealand Map Grid (code 19917).  Used for topographic mapping.,,EPSG,1999-10-20 00:00:00,95.30  96.29  97.231,1,0
+18151,Nigeria West Belt,conversion,,,,,1715,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+18152,Nigeria Mid Belt,conversion,,,,,1714,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+18153,Nigeria East Belt,conversion,,,,,1713,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+18161,Peru west zone,conversion,,,,,1753,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+18162,Peru central zone,conversion,,,,,1752,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+18163,Peru east zone,conversion,,,,,1751,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+18171,Philippines zone I,conversion,,,,,1698,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,2000-03-07 00:00:00,95.30 2000.93,1,0
+18172,Philippines zone II,conversion,,,,,1699,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,2000-03-07 00:00:00,95.30 2000.93,1,0
+18173,Philippines zone III,conversion,,,,,1700,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,2000-03-07 00:00:00,95.30 2000.93,1,0
+18174,Philippines zone IV,conversion,,,,,1701,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,2000-03-07 00:00:00,95.30 2000.93,1,0
+18175,Philippines zone V,conversion,,,,,1702,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,2000-03-07 00:00:00,95.30 2000.93,1,0
+18181,Nord Tunisie,conversion,,,,,1619,Large and medium scale topographic mapping and engineering survey.,9801,,,,,EPSG,1996-09-12 00:00:00,95.30,1,0
+18182,Sud Tunisie,conversion,,,,,1620,Large and medium scale topographic mapping and engineering survey.,9801,,,,,EPSG,1996-09-12 00:00:00,,1,0
+18191,Finland zone 1,conversion,,,,,1536,Large and medium scale topographic mapping and engineering survey.,9807,,,,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,1,0
+18192,Finland zone 2,conversion,,,,,1537,Large and medium scale topographic mapping and engineering survey.,9807,,,,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,1,0
+18193,Finland Uniform Coordinate System,conversion,,,,,1095,Large and medium scale topographic mapping and engineering survey.,9807,,,Used by Uniform Coordinate System over all country and also by zone 3 of Basic Coordinate System at larger scales.,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,1,0
+18194,Finland zone 4,conversion,,,,,1539,Large and medium scale topographic mapping and engineering survey.,9807,,,,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,1,0
+18201,Palestine Grid,conversion,,,,,1356,Large and medium scale topographic mapping and engineering survey.,9806,,,Also encountered as a Transverse Mercator projection with scale factor of 1.  The difference in conversion caused by the change of formula does not exceed 2m within Israel.  Within the State of Israel superseded by the Israeli CS Grid (EPSG code 18203).,,EPSG,1999-04-22 00:00:00,,1,0
+18202,Palestine Belt,conversion,,,,,1356,Large and medium scale topographic mapping and engineering survey.,9807,,,"Originally constructed as the Palestine Grid - EPSG code 18201. Adopted by the US Army Map Service as ""Palestine Belt"" with change of projection method and false northing (FN). Sometimes seen with unchanged FN of 126867.909.",,EPSG,1999-04-22 00:00:00,,1,0
+18203,Israeli CS,conversion,,,,,2603,Large and medium scale topographic mapping and engineering survey.,9806,,,,Survey of Israel   ftp://ftp.rd.soi.gov.il/doc,EPSG,2002-06-22 00:00:00,2002.34,1,0
+18204,Israeli TM,conversion,,,,,2603,Large and medium scale topographic mapping and engineering survey.,9807,,,Designed to approximate Israeli CRS grid in north-central Israel.,Survey of Israel   ftp://ftp.rd.soi.gov.il/doc,EPSG,2002-06-22 00:00:00,2002.34,1,0
+18211,Guatemala Norte,conversion,,,,,2120,Large and medium scale topographic mapping and engineering survey.,9801,,,,,EPSG,1999-08-16 00:00:00,,1,0
+18212,Guatemala Sur,conversion,,,,,2121,Large and medium scale topographic mapping and engineering survey.,9801,,,,,EPSG,2000-01-06 00:00:00,99.95,1,0
+18221,NGO zone I,conversion,,,,,1741,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,,"J. Danielsen; ""Transformasjoner ved Norges Geografiske Oppm�ling""; Kart Og Plan nr 1; 1982.",EPSG,1999-10-20 00:00:00,,1,0
+18222,NGO zone II,conversion,,,,,1742,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,,"J. Danielsen; ""Transformasjoner ved Norges Geografiske Oppm�ling""; Kart Og Plan nr 1; 1982.",EPSG,1999-10-20 00:00:00,,1,0
+18223,NGO zone III,conversion,,,,,1743,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,,"J. Danielsen; ""Transformasjoner ved Norges Geografiske Oppm�ling""; Kart Og Plan nr 1; 1982.",EPSG,1999-10-20 00:00:00,,1,0
+18224,NGO zone IV,conversion,,,,,1744,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,,"J. Danielsen; ""Transformasjoner ved Norges Geografiske Oppm�ling""; Kart Og Plan nr 1; 1982.",EPSG,1999-10-20 00:00:00,,1,0
+18225,NGO zone V,conversion,,,,,1745,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,,"J. Danielsen; ""Transformasjoner ved Norges Geografiske Oppm�ling""; Kart Og Plan nr 1; 1982.",EPSG,1999-10-20 00:00:00,,1,0
+18226,NGO zone VI,conversion,,,,,1746,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,,"J. Danielsen; ""Transformasjoner ved Norges Geografiske Oppm�ling""; Kart Og Plan nr 1; 1982.",EPSG,1999-10-20 00:00:00,,1,0
+18227,NGO zone VII,conversion,,,,,1747,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,,"J. Danielsen; ""Transformasjoner ved Norges Geografiske Oppm�ling""; Kart Og Plan nr 1; 1982.",EPSG,1999-10-20 00:00:00,,1,0
+18228,NGO zone VIII,conversion,,,,,1748,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,,"J. Danielsen; ""Transformasjoner ved Norges Geografiske Oppm�ling""; Kart Og Plan nr 1; 1982.",EPSG,1999-10-20 00:00:00,,1,0
+18231,India zone I (1975 metres),conversion,,,,,1676,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,,EPSG,2000-04-23 00:00:00,2000.39,1,0
+18232,India zone IIa (1975 metres),conversion,,,,,1677,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,,EPSG,2000-04-23 00:00:00,2000.39,1,0
+18233,India zone IIIa (1975 metres),conversion,,,,,1672,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,,EPSG,2000-04-23 00:00:00,2000.39,1,0
+18234,India zone IVa (1975 metres),conversion,,,,,1673,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,,EPSG,2000-04-23 00:00:00,2000.39,1,0
+18235,India zone IIb (1975 metres),conversion,,,,,1678,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,,EPSG,2000-04-23 00:00:00,2000.39,1,0
+18236,India zone I (1962 metres),conversion,,,,,1685,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,,EPSG,1999-10-20 00:00:00,,1,0
+18237,India zone IIa (1962 metres),conversion,,,,,1686,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,,EPSG,1999-10-20 00:00:00,,1,0
+18238,India zone IIb (1937 metres),conversion,,,,,1041,Large and medium scale topographic mapping and engineering survey.,9801,,,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,,EPSG,2000-04-23 00:00:00,2000.39,1,0
+18240,Libya zone 5,conversion,,,,,1470,Large and medium scale topographic mapping and engineering survey.,9807,,,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+18241,Libya zone 6,conversion,,,,,1471,Large and medium scale topographic mapping and engineering survey.,9807,,,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+18242,Libya zone 7,conversion,,,,,1472,Large and medium scale topographic mapping and engineering survey.,9807,,,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+18243,Libya zone 8,conversion,,,,,1473,Large and medium scale topographic mapping and engineering survey.,9807,,,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+18244,Libya zone 9,conversion,,,,,1474,Large and medium scale topographic mapping and engineering survey.,9807,,,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+18245,Libya zone 10,conversion,,,,,1475,Large and medium scale topographic mapping and engineering survey.,9807,,,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+18246,Libya zone 11,conversion,,,,,1476,Large and medium scale topographic mapping and engineering survey.,9807,,,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+18247,Libya zone 12,conversion,,,,,1477,Large and medium scale topographic mapping and engineering survey.,9807,,,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+18248,Libya zone 13,conversion,,,,,1478,Large and medium scale topographic mapping and engineering survey.,9807,,,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+18251,Korea East Belt,conversion,,,,,1496,Large and medium scale topographic mapping and engineering survey.,9807,,,,Clifford J. Mugnier; Photogrammertric Engineering and Remote Sensing,EPSG,2000-03-07 00:00:00,,1,0
+18252,Korea Central Belt,conversion,,,,,1497,Large and medium scale topographic mapping and engineering survey.,9807,,,,Clifford J. Mugnier; Photogrammertric Engineering and Remote Sensing,EPSG,2000-03-07 00:00:00,,1,0
+18253,Korea West Belt,conversion,,,,,1498,Large and medium scale topographic mapping and engineering survey.,9807,,,,Clifford J. Mugnier; Photogrammertric Engineering and Remote Sensing,EPSG,2000-03-07 00:00:00,,1,0
+18260,Maracaibo Grid (M1),conversion,,,,,1319,Oil exploration.,9801,,,Grid coordinates are (0 0) at Maracaibo Cathedral.,Various oil company sources.,EPSG,2000-03-07 00:00:00,,1,0
+18261,Maracaibo Grid,conversion,,,,,1319,Oil exploration.,9801,,,Grid coordinates are (200000 200000) at Maracaibo Cathedral.,Various oil company sources.,EPSG,2000-03-07 00:00:00,,1,0
+18262,Maracaibo Grid (M3),conversion,,,,,1319,Oil exploration.,9801,,,Grid coordinates are (500000 500000) at Maracaibo Cathedral.,Various oil company sources.,EPSG,2000-03-07 00:00:00,,1,0
+18263,Maracaibo La Rosa Grid,conversion,,,,,1319,Oil exploration.,9801,,,Grid coordinates are (-17044E 29545N) at Maracaibo Cathedral.,Various oil company sources.,EPSG,2000-06-23 00:00:00,,1,0
+18275,Balkans zone 5,conversion,,,,,1709,Large and medium scale topographic mapping and engineering survey.,9807,,,,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+18276,Balkans zone 6,conversion,,,,,1710,Large and medium scale topographic mapping and engineering survey.,9807,,,,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+18277,Balkans zone 7,conversion,,,,,1711,Large and medium scale topographic mapping and engineering survey.,9807,,,,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+18278,Balkans zone 8,conversion,,,,,1712,Large and medium scale topographic mapping and engineering survey.,9807,,,,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+18281,Poland zone I,conversion,,,,,1515,"Civilian topographic mapping, cadastral and engineering survey.",9809,,,,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18282,Poland zone II,conversion,,,,,1516,"Civilian topographic mapping, cadastral and engineering survey.",9809,,,,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18283,Poland zone III,conversion,,,,,1517,"Civilian topographic mapping, cadastral and engineering survey.",9809,,,,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18284,Poland zone IV,conversion,,,,,1518,"Civilian topographic mapping, cadastral and engineering survey.",9809,,,,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18285,Poland zone V,conversion,,,,,1519,"Civilian topographic mapping, cadastral and engineering survey.",9807,,,,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18300,Poland CS92,conversion,,,,,1192,"Mapping at scales of 1:10,000 and smaller",9807,,,See Poland CS2000 zones (codes 18305-08) for cadastral survey and mapping at larger scales.,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18305,Poland CS2000 zone 5,conversion,,,,,1520,"Topographic mapping at scales of 1:5,000 and larger, cadastral and engineering survey.",9807,,,"See Poland CS92 (code 18300) for mapping at 1:10,000 and smaller scales.",Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18306,Poland CS2000 zone 6,conversion,,,,,1521,"Topographic mapping at scales of 1:5,000 and larger, cadastral and engineering survey.",9807,,,"See Poland CS92 (code 18300) for mapping at 1:10,000 and smaller scales.",Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18307,Poland CS2000 zone 7,conversion,,,,,1522,"Topographic mapping at scales of 1:5,000 and larger, cadastral and engineering survey.",9807,,,"See Poland CS92 (code 18300) for mapping at 1:10,000 and smaller scales.",Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18308,Poland CS2000 zone 8,conversion,,,,,1523,"Topographic mapping at scales of 1:5,000 and larger, cadastral and engineering survey.",9807,,,"See Poland CS92 (code 18300) for mapping at 1:10,000 and smaller scales.",Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+18401,Kp2000 Jylland og Fyn,conversion,,,,,2531,"Topographic mapping at scales of 1:5,000 and larger, cadastral and engineering survey.",9807,,,"See UTM zone 32N (code 16032) for mapping at 1:10,000 and smaller scales.",Kort og Matrikelstyrelsen,EPSG,2001-11-06 00:00:00,,1,0
+18402,Kp2000 Sjaelland,conversion,,,,,2532,"Topographic mapping at scales of 1:5,000 and larger, cadastral and engineering survey.",9807,,,"See UTM zone 32N (code 16032) for mapping at 1:10,000 and smaller scales.",Kort og Matrikelstyrelsen,EPSG,2001-11-06 00:00:00,,1,0
+18403,Kp2000 Bornholm,conversion,,,,,2533,"Topographic mapping at scales of 1:5,000 and larger, cadastral and engineering survey.",9807,,,"See UTM zone 33N (code 16033) for mapping at 1:10,000 and smaller scales.",Kort og Matrikelstyrelsen,EPSG,2001-11-06 00:00:00,,1,0
+18411,French West Africa Senegal zone,conversion,,,,,2548,Small scale topographic mapping.,9807,,,Superseded in 1950 by UTM.,TotatFinaElf,EPSG,2002-01-18 00:00:00,,1,0
+18412,French West Africa Ivory Coast zone,conversion,,,,,2549,Small scale topographic mapping.,9807,,,Superseded in 1950 by UTM.,TotatFinaElf,EPSG,2002-01-18 00:00:00,,1,0
+18413,French West Africa Dahomey zone,conversion,,,,,2550,Small scale topographic mapping.,9807,,,Superseded in 1950 by UTM.,TotatFinaElf,EPSG,2002-01-18 00:00:00,,1,0
+18414,French West Africa Niger zone,conversion,,,,,2551,Small scale topographic mapping.,9807,,,Superseded in 1950 by UTM.,TotatFinaElf,EPSG,2002-01-18 00:00:00,,1,0
+18415,French Equatorial Africa west zone,conversion,,,,,2552,Small scale topographic mapping.,9807,,,Superseded in 1950 by UTM.,TotatFinaElf,EPSG,2002-01-18 00:00:00,,1,0
+18416,French Equatorial Africa central zone,conversion,,,,,2553,Small scale topographic mapping.,9807,,,Superseded in 1950 by UTM.,TotatFinaElf,EPSG,2002-01-18 00:00:00,,1,0
+18417,French Equatorial Africa east zone,conversion,,,,,2554,Small scale topographic mapping.,9807,,,Superseded in 1950 by UTM.,TotatFinaElf,EPSG,2002-01-18 00:00:00,,1,0
+18421,Greenland zone 1 east,conversion,,,,,2556,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18422,Greenland zone 2 east,conversion,,,,,2557,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18423,Greenland zone 3 east,conversion,,,,,2558,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18424,Greenland zone 4 east,conversion,,,,,2559,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18425,Greenland zone 5 east,conversion,,,,,2560,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18426,Greenland zone 6 east,conversion,,,,,2561,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18427,Greenland zone 7 east,conversion,,,,,2562,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18428,Greenland zone 8 east,conversion,,,,,2569,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18432,Greenland zone 2 west,conversion,,,,,2563,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18433,Greenland zone 3 west,conversion,,,,,2564,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18434,Greenland zone 4 west,conversion,,,,,2565,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18435,Greenland zone 5 west,conversion,,,,,2566,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18436,Greenland zone 6 west,conversion,,,,,2567,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18437,Greenland zone 7 west,conversion,,,,,2568,Topographic mapping,9826,,,,"Kort og Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+18441,CS63 zone A1,conversion,,,,,2772,Large scale topographic mapping and engineering survey.,9807,,,,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+18442,CS63 zone A2,conversion,,,,,2773,Large scale topographic mapping and engineering survey.,9807,,,,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+18443,CS63 zone A3,conversion,,,,,2774,Large scale topographic mapping and engineering survey.,9807,,,,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+18444,CS63 zone A4,conversion,,,,,2775,Large scale topographic mapping and engineering survey.,9807,,,,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+18446,CS63 zone K2,conversion,,,,,2776,Large scale topographic mapping and engineering survey.,9807,,,,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+18447,CS63 zone K3,conversion,,,,,2777,Large scale topographic mapping and engineering survey.,9807,,,,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+18448,CS63 zone K4,conversion,,,,,2778,Large scale topographic mapping and engineering survey.,9807,,,,KazGeodezia,EPSG,2002-06-28 00:00:00,,1,0
+19900,Bahrain State Grid,conversion,,,,,1040,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30,1,0
+19901,Belge Lambert 50,conversion,,,,,1347,Large and medium scale topographic mapping and engineering survey.,9802,,,"If software cannot handle latitude of false origin of 90 deg N, use latitude of false origin = 50.5 sexagesimal degrees with northing at false origin = 131983.890 m.","""Systemes de reference et formules de transformation en usage en Belgique""; IGN Brussels",EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+19902,Belge Lambert 72,conversion,,,,,1347,Large and medium scale topographic mapping and engineering survey.,9803,,,"Rotation from Belge Lambert 50 to Belge Lambert 72 is +29.2985sec. An equivalent using the conventional Lambert Conic Conformal (2SP) method (Belgian Lambert 72, code 19961) was introduced in 2000.","""Systemes de reference et formules de transformation en usage en Belgique""; IGN Brussels",EPSG,1999-04-22 00:00:00,95.30  96.29  99.28,1,0
+19903,Nord de Guerre,conversion,,,,,1369,Obsolete.,9801,,,,,EPSG,1996-09-12 00:00:00,,1,0
+19904,Ghana Metre Grid,conversion,,,,,1104,Large and medium scale topographic mapping and engineering survey.,9807,,,Supersedes Ghana National Grid (code 19959) from 1978.  British foot (Sears 1922) used to convert projection defining parameters.,Ordnance Survey International,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+19905,Netherlands East Indies Equatorial Zone,conversion,,,,,1122,Large and medium scale topographic mapping and engineering survey.,9804,,,,US Army Map Service projection tables; 1943.,EPSG,1995-12-02 00:00:00,95.30,1,0
+19906,Iraq zone,conversion,,,,,2294,Large and medium scale topographic mapping and engineering survey.,9801,,,,US Army Map Service projection tables; 1943.,EPSG,1996-04-12 00:00:00,95.30  96.29,1,0
+19907,Iraq National Grid,conversion,,,,,1124,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+19908,Irish National Grid,conversion,,,,,1305,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,1
+19909,Jamaica (Old Grid),conversion,,,,,1128,Large and medium scale topographic mapping and engineering survey.,9801,,,Superseded by Jamaica (New Grid).,,EPSG,1995-12-02 00:00:00,95.28,1,0
+19910,Jamaica National Grid,conversion,,,,,1128,Large and medium scale topographic mapping and engineering survey.,9801,,,Supersedes Jamaica (Old Grid).,,EPSG,1995-12-02 00:00:00,95.28,1,0
+19911,Laborde Grid,conversion,,,,,1149,Large and medium scale topographic mapping and engineering survey.,9815,,,Can also use transformation method 9813.,,EPSG,1997-11-13 00:00:00,97.613,1,0
+19913,RD Old,conversion,,,,,1275,Large and medium scale topographic mapping and engineering survey.,9809,,,,Nederlandse Commissie voor Geodesie publication 30.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+19914,RD New,conversion,,,,,1275,Large and medium scale topographic mapping and engineering survey.,9809,,,,Nederlandse Commissie voor Geodesie publication 30.,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+19915,Aden Zone,conversion,,,,,1257,Large and medium scale topographic mapping and engineering survey.,9801,,,,US Army Map Service projection tables; 1943.,EPSG,1995-12-02 00:00:00,95.28,1,0
+19916,British National Grid,conversion,,,,,1264,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30,1,0
+19917,New Zealand Map Grid,conversion,,,,,1175,Large and medium scale topographic mapping and engineering survey.,9811,,,Supersedes North and South Island National Grids (codes 18141-2).  Used for topographic mapping.,Dept. of Lands and Surveys Technical Circular 1973/32; 23 Nov 1973.,EPSG,1995-12-02 00:00:00,95.28,1,0
+19919,Qatar National Grid,conversion,,,,,1195,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+19920,Singapore Grid,conversion,,,,,1210,Large and medium scale topographic mapping and engineering survey.,9806,,,,,EPSG,1995-12-02 00:00:00,95.30  96.29,1,0
+19921,Spain,conversion,,,,,1217,Large and medium scale topographic mapping and engineering survey.,9801,,,Superseded by UTM,,EPSG,1995-12-02 00:00:00,95.28,1,0
+19922,Swiss New Grid,conversion,,,,,1286,Large and medium scale topographic mapping and engineering survey.,9815,,,,"""Die Projektionen der schweizerischen Plan- und Kartenwerke""; J. Bolliger 1967",EPSG,1997-11-13 00:00:00,95.30  96.29  97.27  97.612  97.62,1,0
+19923,Swiss Old Grid,conversion,,,,,1286,Large and medium scale topographic mapping and engineering survey.,9815,,,Superseded by LV03 (19922).,"""Die Projektionen der schweizerischen Plan- und Kartenwerke""; J. Bolliger 1967",EPSG,1997-11-13 00:00:00,95.30  96.29  97.612  97.62,1,0
+19924,Tobago Grid,conversion,,,,,1322,Large and medium scale topographic mapping and engineering survey.,9806,,,,,EPSG,1999-10-20 00:00:00,95.30  96.29  97.231,1,0
+19925,Trinidad Grid,conversion,,,,,1339,Large and medium scale topographic mapping and engineering survey.,9806,,,,,EPSG,1999-10-20 00:00:00,95.30  96.29  97.231,1,0
+19926,Stereo 70,conversion,,,,,1197,Large and medium scale topographic mapping and engineering survey.,9809,,,Supersedes Stereo 33 (code 19927).,,EPSG,1996-04-12 00:00:00,,1,0
+19927,Stereo 33,conversion,,,,,1197,Large and medium scale topographic mapping and engineering survey.,9809,,,Superseded by Stereo 70 (code 19926),,EPSG,1996-04-12 00:00:00,96.29,1,0
+19928,Kuwait TM,conversion,,,,,1310,Large and medium scale topographic mapping and engineering survey.,9807,,,,,EPSG,1996-04-12 00:00:00,,1,0
+19929,Swedish National Projection,conversion,,,,,1225,"Large and medium scale topographic mapping, cadastral and engineering survey.",9807,,,"Used since 1938 superseding 6 old zones.  Longitude of natural origin is 2.5 gon west of Stockholm prime meridian; transformation is also known as ""2.5 gon West of old Stockholm observatory"".",Lantmateriet of Sweden; private communication.,EPSG,1997-11-13 00:00:00,96.29  97.39,1,0
+19930,Greek Grid,conversion,,,,,1106,Large and medium scale topographic mapping and engineering survey.,9807,,,Created for use with GGRS87.,Geodesy Department; Public Petroleum Corporation of Greece.,EPSG,1997-06-16 00:00:00,,1,0
+19931,Egyseges Orszagos Vetuleti,conversion,,,,,1119,Large and medium scale topographic mapping and engineering survey.,9815,,,EOV = Uniform National Projection,http://lazarus.elte.hu/gb/geodez/geod2.htm,EPSG,1997-07-22 00:00:00,,1,0
+19933,Prince Edward Island Stereographic (ATS77),conversion,,,,,1533,Large and medium scale topographic mapping and engineering survey.,9809,,,In use from 1979.  To be phased out in late 1990's.,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,1997-11-13 00:00:00,,1,0
+19934,Lithuania 1994,conversion,,,,,1145,Large and medium scale topographic mapping and engineering survey.,9807,,,,HNIT-BALTIC GeoInfoServisas,EPSG,1998-03-12 00:00:00,,1,0
+19935,Rectified Skew Orthomorphic Malaya Grid,conversion,,,,,1690,Large and medium scale topographic mapping and engineering survey.,9812,,,"If using Oblique Mercator method (code 9815), Ec=23505.515 chSe, Nc=21992.646 chSe.",UK Directorate of Overseas Surveys paper,EPSG,1999-10-20 00:00:00,97.231,1,0
+19936,Portuguese National Grid,conversion,,,,,1294,Large and medium scale topographic mapping and engineering survey for military purposes.,9807,,,Original transformation by Gauss-Kruger formula.,Instituto Portugues de Cartografia e Cadastro,EPSG,1998-11-11 00:00:00,95.30  96.29  98.42,1,0
+19937,Tunisia Mining Grid,conversion,,,,,1618,Minerals licencing,9816,,,Origin: Djebel Kebar,Mining decree of 1st January 1953,EPSG,1999-11-15 00:00:00,99.81,1,0
+19938,Estonian National Grid,conversion,,,,,1090,Large and medium scale topographic mapping and engineering survey.,9802,,,Coordinates at the projection origin match those of TM Baltic 93.,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,1999-04-22 00:00:00,99.28,1,0
+19939,TM Baltic 93,conversion,,,,,1646,Large and medium scale topographic mapping and engineering survey.,9807,,,,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,1998-12-14 00:00:00,,1,0
+19940,Levant Zone,conversion,,,,,1623,Large and medium scale topographic mapping and engineering survey.,9817,,,Superseded by projection using full Lambert formula  (EPSG code 19948) from 1973.,US Army Map Service projection tables; 1943.,EPSG,1999-04-22 00:00:00,,1,0
+19941,Brazil Polyconic,conversion,,,,,1053,Small scale mapping,9818,,,,PetroBras,EPSG,1999-10-20 00:00:00,99.55,1,0
+19942,British West Indies Grid,conversion,,,,,2295,Large and medium scale topographic mapping and engineering survey.,9807,,,,"UK Royal Engineers projection tables P10/25, 1943.",EPSG,1999-04-22 00:00:00,,1,0
+19943,Barbados National Grid,conversion,,,,,1042,Large and medium scale topographic mapping and engineering survey.,9807,,,Superseded British West Indies Grid (19942) after 1983.,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+19944,Quebec Lambert Projection,conversion,,,,,1368,Medium and small scale mapping,9802,,,,Service de la Cartographie; Minist�re des Ressources Naturelles; Quebec,EPSG,1999-10-22 00:00:00,,1,0
+19945,New Brunswick Stereographic (ATS77),conversion,,,,,1447,Large and medium scale topographic mapping and engineering survey.,9809,,,In use from 1979.  To be phased out in late 1990's.,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,1999-10-20 00:00:00,99.61,1,0
+19946,New Brunswick Stereographic (NAD83),conversion,,,,,1447,Large and medium scale topographic mapping and engineering survey.,9809,,,In use from 1999.,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,1999-10-20 00:00:00,,1,0
+19947,Austria Lambert,conversion,,,,,1037,Medium and small scale mapping,9802,,,,Bundesamt f�r Eich- und Vermessungswesen,EPSG,2000-01-07 00:00:00,99.94,1,0
+19948,Syria Lambert,conversion,,,,,1623,Large and medium scale topographic mapping and engineering survey.,9801,,,Superseded Levant zone using same parameters but truncated near-conformal method (code 19940) from 1973.,IGN Paris,EPSG,1999-10-20 00:00:00,,1,0
+19949,Levant Stereographic,conversion,,,,,1623,Large and medium scale topographic mapping and engineering survey.,9809,,,Used  prior to World War II for cadastral and large scale topographic mapping.,IGN Paris,EPSG,1999-10-20 00:00:00,,1,0
+19950,Landesvermessung 1995,conversion,,,,,1286,Large and medium scale topographic mapping and engineering survey.,9815,,,,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,1999-10-20 00:00:00,,1,0
+19951,Nakhl e Taqi Oblique Mercator,conversion,,,,,1338,Large and medium scale topographic mapping and engineering survey.,9815,,,Used only for terminal site.,Total-Fina,EPSG,1999-10-20 00:00:00,,1,0
+19952,Krovak,conversion,,,,,1306,Large and medium scale topographic mapping and engineering survey.,9819,,,,Research Institute for Geodesy Topography and Cartography (VUGTK); Prague.,EPSG,2000-03-07 00:00:00,,1,0
+19953,Qatar Grid,conversion,,,,,1346,Large and medium scale topographic mapping and engineering survey.,9806,,,,Maersk Oil and Gas,EPSG,2000-03-07 00:00:00,,1,0
+19954,Suriname Old TM,conversion,,,,,1222,Large and medium scale topographic mapping and engineering survey.,9807,,,Introduced in 1975.  Superseded by Suriname TM in 1979.,Shell International,EPSG,2000-06-10 00:00:00,,1,0
+19955,Suriname TM,conversion,,,,,1222,Large and medium scale topographic mapping and engineering survey.,9807,,,Superseded Suriname Old TM in 1979 (scale factor changed).,Shell International,EPSG,2000-06-10 00:00:00,,1,0
+19956,Rectified Skew Orthomorphic Borneo Grid (chains),conversion,,,,,1362,Large and medium scale topographic mapping and engineering survey.,9815,,,See 19957 and 19958 for feet and metres versions. If using Hotine Oblique Mercator method (code 9812) FE = FN = 0 chSe.  Being superseded by metric version (code 19958).,Directorate of Colonial Surveys projection tables 1954 revision.,EPSG,2002-07-13 00:00:00,2002.47,1,0
+19957,Rectified Skew Orthomorphic Borneo Grid (feet),conversion,,,,,1851,Large and medium scale topographic mapping and engineering survey.,9815,,,See 19956 and 19958 for chains and metres versions. If using Hotine Oblique Mercator method (code 9812) FE = FN = 0 ftSe.   Being superseded by metric version (code 19958).,EPSG unit conversion of Directorate of Colonial Surveys projection tables 1954 revision.,EPSG,2002-07-13 00:00:00,2002.47,1,0
+19958,Rectified Skew Orthomorphic Borneo Grid (metres),conversion,,,,,1362,Large and medium scale topographic mapping and engineering survey.,9815,,,See 19956 and 19957 for chains and feet versions.  Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  If using Hotine Oblique Mercator method (code 9812) FE = FN = 0 m.,EPSG unit conversion of Directorate of Colonial Surveys projection tables 1954 revision.,EPSG,2000-10-19 00:00:00,,1,0
+19959,Ghana National Grid,conversion,,,,,1104,Large and medium scale topographic mapping and engineering survey.,9807,,,Superseded by Ghana metric grid (code 19904).,Ordnance Survey International,EPSG,2000-10-19 00:00:00,,1,0
+19960,Prince Edward Isl. Stereographic (NAD83),conversion,,,,,1533,Large and medium scale topographic mapping and engineering survey.,9809,,,False Easting and False Northing changed from values used with ATS77  (which were FE=700000m; FN=400000m) to these new values when used with NAD83 (CSRS).   New values are FE=400000m; FN=800000m; adopted in 2000.,PEI Department of Transportation & Public Works; Mr. Serge Bernard,EPSG,2000-10-19 00:00:00,,1,0
+19961,Belgian Lambert 72,conversion,,,,,1347,Large and medium scale topographic mapping and engineering survey.,9802,,,"Introduced in 2000. Equivalent to Belge Lambert 72 (code 19902).  
+If software cannot handle latitude of false origin of 90 deg N, use latitude of false origin = 50� 47' 57.704"" with northing at false origin = 165 372.956 m.",IGN Brussels www.ngi.be/FR/FR2-1-5-1.shtm and EuroGeographics; http://crs.ifag.de/,EPSG,2000-10-19 00:00:00,,1,0
+19962,Irish Transverse Mercator,conversion,,,,,1305,Large and medium scale topographic mapping and engineering survey.,9807,,,,Ordnance Survey of Ireland,EPSG,2000-10-19 00:00:00,,1,0
+19963,Sierra Leone New Colony Grid,conversion,,,,,1342,Topographic mapping and engineering survey.,9807,,,Supersedes the Sierra Leone Colony Grid. New grid is 422.3 ft west and 112.1 ft south of old grid.,Ordnance Survey International,EPSG,2001-06-05 00:00:00,,1,0
+19964,New War Office Sierra Leone Grid,conversion,,,,,1342,Topographic mapping and engineering survey.,9807,,,Supersedes the War Office Sierra Leone Grid. New grid is 422.3 ft west and 112.1 ft south of old grid.,Ordnance Survey International,EPSG,2001-06-05 00:00:00,,1,0
+19965,US National Atlas Equal Area,conversion,,,,,1245,Statistical mapping,9821,,,,"United States Geological Survey, Western Geographic Science Center.",EPSG,2001-06-05 00:00:00,,1,0
+19966,Luxembourg Gauss,conversion,,,,,1146,Large and medium scale topographic mapping and engineering survey.,9807,,,,Administration du Cadastre et de la Topographie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+19967,Slovenia Grid,conversion,,,,,1212,Large and medium scale topographic mapping and engineering survey.,9807,,,,Geodetska Uprava Republike Slovenije via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+19968,Plate Carree,conversion,,,,,1262,Graticule coordinates in rectangular Cartesian form.,9823,,,Origin at intersection of equator and prime meridian.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+19969,Portuguese Grid,conversion,,,,,1294,Large and medium scale topographic mapping and engineering survey.,9807,,,Original transformation by Gauss-Kruger formula.,Instituto Portugues de Cartografia e Cadastro via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+19971,New Zealand Transverse Mercator,conversion,,,,,1175,Large and medium scale topographic mapping and engineering survey.,9807,,,,Land Information New Zealand,EPSG,2001-08-28 00:00:00,,1,0
+19972,Irish Grid,conversion,,,,,1305,Large and medium scale topographic mapping and engineering survey.,9807,,,Defined as part of the 1965 and 1975 mapping adustments in which the scale factor was introduced as a best fit to retain existing grid coordinates.,Ordnance Survey of Ireland.,EPSG,2001-11-06 00:00:00,,1,0
+19973,Irish National Grid,conversion,,,,,2530,Large and medium scale topographic mapping and engineering survey.,9807,,,Used only with the 1952 geodetic adjustment. Superseded by the 1975 Mapping Adjustment: see code 19972.,Ordnance Survey of Northern Ireland.,EPSG,2001-11-06 00:00:00,,1,0
+19974,Modified Portuguese Grid,conversion,,,,,1294,Large and medium scale topographic mapping and engineering survey.,9807,,,Applied to Datum 73. Grid position at origin is coincident with the unmodified grid applied to Lisbon datum.,Instituto Portugues de Cartografia e Cadastro via EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+19975,Trinidad Grid (Clarke's feet),conversion,,,,,1339,Oil industry exploration and production.,9806,,,"Foot version of EPSG code 19925. Not an official system, but used by some US-based organisations including Amoco Trinidad.",BP,EPSG,2002-02-12 00:00:00,,1,0
+19976,ICN Regional,conversion,,,,,1251,Small scale topographic and geological mapping.,9802,,,,Institute Cartografica Nacional,EPSG,2002-02-12 00:00:00,,1,0
+19977,Aramco Lambert,conversion,,,,,1206,Oil industry exploration and production.,9802,,,Used by Saudi Aramco when area of interest crosses UTM zone boundary. Adopted by partners for Core Venture 1 (South Ghawar) area.,Saudi Aramco,EPSG,2002-02-12 00:00:00,,1,0
+19978,Hong Kong 1980 Grid,conversion,,,,,1118,"Large scale topographic mapping, cadastral and engineering survey.",9807,,,"Grid origin is Partiridge Hill triangulation station (old trig ""2"").","Survey and Mapping Office, Lands Department. Http://www.info.gov.hk/landsd/mapping/tindex.htm",EPSG,2002-06-22 00:00:00,,1,0
+19979,Portugal Bonne,conversion,,,,,1294,"1:50,000 topographic mapping.",9828,,,,"Instituto Portugues de Cartografia e Cadastro, http://www.ipcc.pt/portuguese/produtos/cartografia/50m.html",EPSG,2002-07-13 00:00:00,,1,0
diff --git a/src/tiff/csv/coordinate_operation_method.csv b/src/tiff/csv/coordinate_operation_method.csv
new file mode 100644
index 0000000..066de77
--- /dev/null
+++ b/src/tiff/csv/coordinate_operation_method.csv
@@ -0,0 +1,1513 @@
+"COORD_OP_METHOD_CODE","COORD_OP_METHOD_NAME","REVERSE_OP","FORMULA","EXAMPLE","REMARKS","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","DEPRECATED"
+9601,Longitude rotation,1,Target_longitude = Source_longitude + longitude_offset.,,This transformation allows calculation of the longitude of a point in the target system by adding the parameter value to the longitude value of the point in the source system.,EPSG guidance note #7.,EPSG,1999-11-12 00:00:00,99.79,0
+9602,Geographic/geocentric conversions,1,"Latitude, P, and Longitude, L, in terms of Geographic Coordinate Reference System A may 
+be expressed in terms of a geocentric (earth centred) Cartesian coordinate reference system X, Y, Z 
+with the Z axis corresponding with the Polar axis positive northwards, the X axis through 
+the intersection of the Greenwich meridian and equator, and the Y axis through the 
+intersection of the equator with longitude 90 degrees E. If the prime meridian for geogCRS A is not 
+Greewich, longitudes must first be transformed to their Greenwich equivalent. If the earth's 
+spheroidal semi major axis is a, semi minor axis  b, and inverse flattening 1/f,  then
+
+   XA=   (nu + hA) cos P cos L
+   YA=   (nu + hA) cos P sin L
+   ZA=  ((1 - e^2) nu + hA) sin P
+
+where nu is the prime vertical radius of curvature at latitude P and is equal to 
+   nu = a /(1 - e^2*sin^2(P))^0.5,
+   P and L are respectively the latitude and longitude (related to Greenwich) of the point 
+   h is height above the ellipsoid, (topographic height plus geoidal height), and
+   e is the eccentricity of the ellipsoid where e^2 = (a^2 -b^2)/a^2 = 2f -f^2
+                                                                                                                                                 
+Cartesian coordinates in geocentric coordinate reference system B may be used to derive geographical coordinates in terms of geographic coordinate reference system B by:
+   P   =  arctan (ZB + e^2* nu*sin P) / (XB^2 + YB^2)^0.5 by iteration
+   L   = arctan YB/XB
+   hB  =  XB sec L sec P  - nu
+
+where LB is relative to Greenwich. If the geographic system has a non Greenwich prime 
+meridian, the Greenwich value of the local prime meridian should be applied to longitude.
+
+(Note that h is the height above the ellipsoid. This is the height value which is 
+delivered by Transit and GPS satellite observations but is not the topographic 
+height value which is normally used for national mapping and levelling operations. 
+The topographic height is usually the height above mean sea level or an alternative 
+level reference for the country. If one starts with a topographic height,  it will be 
+necessary to convert it to an ellipsoid height before using the above transformation 
+formulas. h = N + H, where N is the geoid height above the ellipsoid at the point 
+and is sometimes negative, and H is the height of the point above the geoid. The 
+height above the geoid is often taken to be that above mean sea level, perhaps with 
+a constant correction applied. Geoid heights of points above the nationally used 
+ellipsoid may not be readily available. For the WGS84 ellipsoid the value of N, 
+representing the height of the geoid relative to the ellipsoid, can vary between 
+values of -100m in the Sri Lanka area to +60m in the North Atlantic.)","Consider a North Sea point with coordinates derived by GPS satellite in the WGS 84 geographical coordinate system with coordinates of:
+
+           latitude    53 deg 48 min 33.82 sec N, 
+           longitude 02 deg 07 min 46.38 sec E, 
+    and ellipsoidal height 73.0m, 
+
+whose coordinates are required in terms of the ED50 geographical coordinate system which takes the International 1924 ellipsoid. The three parameter datum shift from WGS 84 to ED50 for this North Sea area is given as dX = +84.87m, dY = +96.49m, dZ = +116.95m. 
+
+The WGS 84 geographical coordinates convert to the following geocentric values using the above formulas for X, Y, Z:
+
+   XA = 3771 793.97m
+   YA =   140 253.34m
+   ZA = 5124 304.35m
+
+Applying the quoted datum shifts to these, we obtain new geocentric values now related to ED50:
+
+   XB = 3771 878.84m
+   YB =   140 349.83m
+   ZB = 5124 421.30m
+
+These convert to ED50 values on the International 1924 ellipsoid as:
+           latitude    53 deg 48 min 36.565 sec N, 
+           longitude 02 deg 07 min 51.477 sec E, 
+    and ellipsoidal height 28.02 m, 
+
+Note that the derived height is referred to the International 1924 ellipsoidal surface and will need a further correction for the height of the geoid at this point in order to relate it to Mean Sea Level.","This is a parameter-less conversion.   It is often concatenated in applications with the 3- or 7-parameter transformations 9603, 9606 and 9607 to form a geographic to geographic transformation.","EPSG guidance note #7 from ""Transformation from spatial to geographical coordinates""; B [...]
+9603,Geocentric translations,1,Xt = Xs + dX;  Yt = Ys + dY;  Zt = Zs + dZ,"Given a three parameter datum shift from WGS 84 to ED50 for this North Sea area is given as 
+dX = +84.87m, dY = +96.49m, dZ = +116.95m. 
+
+The WGS84 geographical coordinates convert to the following WGS 84 geocentric values using 
+the above formulas for X, Y, Z:
+
+   XA = 3771 793.97m
+   YA =   140 253.34m
+   ZA = 5124 304.35m
+
+Applying the given datum shifts to these, we obtain new geocentric values now related 
+to ED50:
+
+   XB = 3771 878.84m
+   YB =   140 349.83m
+   ZB = 5124 421.30m",This transformation allows calculation of coordinates in the target system by adding the parameter value to the corresponding coordinate values of the point in the source system.,EPSG guidance note #7.,EPSG,1996-09-18 00:00:00,,0
+9604,Molodenski,1,See information source.,See information source.,,,EPSG,1996-09-18 00:00:00,,0
+9605,Abridged Molodenski,1,"As an alternative to the computation of the new latitude, longitude and height above ellipsoid in discrete steps through geocentric coordinates, the changes in these geographic coordinates may be derived directly by formulas derived by Molodenski. Abridged versions of these formulas, which are quite satisfactory for three parameter transformations, are as follows:
+
+Dlat "" = [(-dX*sin(lat)*cos(lon)) - (dY*sin(lat)*sin(lon)) + (dZ*cos(lat)) + (((a*Df) + (f*Da))*sin(2*lat))] / (rho * sin(1""))
+
+Dlon "" = (-dX*sin(lon) + dY*cos(lon)) / ((nu*cos(lat)) * sin(1""))
+
+Dh = (dX*cos(lat)*cos(lon)) + (dY*cos(lat)*sin(lon)) + (dZ*sin(lat)) + ((a*Df + f*Da)*(sin(lat)^2)) - Da
+
+where the dX, dY and dZ terms are as before, and rho and nu are the meridian and prime vertical radii of curvature at the given latitude (lat) on the first ellipsoid, Da is the difference in the semi-major axes (a1 - a2) of the first and second ellipsoids and Df  is the difference in the flattening of the two ellipsoids.
+
+The formulas for Dlat and Dlon indicate changes in latitude and longitude in arc-seconds.",See information source.,"This transformation is a truncated Taylor series expansion of a transformation between two geographic coordinate systems, modelled as a set of geocentric translations.",EPSG guidance note #7.,EPSG,1999-04-22 00:00:00,99.01,0
+9606,Position Vector 7-param. transformation,1,"Transformation of coordinates from one geographic coordinate reference system into another (also known as a ""datum transformation"") is usually carried out as an implicit concatenation of three transformations:
+[geographical to geocentric >> geocentric to geocentric >> geocentric to geographic]
+
+The middle part of the concatenated transformation, from geocentric to geocentric, is usually described as a simplified 7-parameter Helmert transformation, expressed in matrix form with 7 parameters, in what is known as the ""Bursa-Wolf"" formula:
+
+   (Xt)             (  1       -Rz    +Ry)      (Xs)     (dX)
+   (Yt)  =  M *  ( +Rz      1      -Rx)  *  (Ys)  + (dY)
+   (Zt)              ( -Ry   +Rx       1 )      (Zs)      (dZ)
+
+The parameters are commonly referred to defining the transformation ""from source coordinate reference system to target coordinate reference system"", whereby (Xs, Ys, Zs) are the coordinates of the point in the source geocentric coordinate reference system and (Xt, Yt, Zt) are the coordinates of the point in the target geocentric coordinate reference system.  But that does not define the parameters uniquely; neither is the definition of the parameters implied in the formula, as is often [...]
+
+(dX, dY, dZ)   :Translation vector, to be added to the point's position vector in the source coordinate reference system in order to transform from source system to target system; also: the coordinates of the origin of the source coordinate reference system in the target coordinate reference system.
+
+(Rx, Ry, Rz)   :Rotations to be applied to the point's vector.  The sign convention is such that a positive rotation about an axis is defined as a clockwise rotation of the position vector when viewed from the origin of the Cartesian coordinate reference system in the positive direction of that axis; e.g. a positive rotation about the Z-axis only from source system to target system will result in a larger longitude value for the point in the target system.  Although rotation angles may b [...]
+
+M                  :The scale correction to be made to the position vector in the source coordinate reference system in order to obtain the correct scale in the target coordinate reference system. M = (1 + dS*10^-6), where dS is the scale correction expressed in parts per million. 
+
+<<<<<This text continues in the description of the Coordinate Frame Rotation formula>>>>>","Input point: 
+Coordinate reference system: WGS 72 (geographic 3D)
+  Latitude =   55 deg 00 min 00 sec 
+  Longitude =  4 deg 00 min 00 sec 
+  Ellipsoidal height =  0 m
+
+This transforms to Cartesian geocentric coords:
+    X = 3 657 660.66 (m)  
+    Y =    255 768.55 (m)
+    Z = 5 201 382.11 (m)
+
+Transformation parameters WGS 72 to WGS 84:
+   dX (m) = 0.000 
+   dY (m) = 0.000 
+   dZ (m) = +4.5
+   RX ("") = 0.000 
+   RY ("") = 0.000
+   RZ ("") = +0.554
+   Scale (ppm) = +0.219
+
+Application of the 7 parameter Position Vector Transformation results in WGS 84 coordinates of:
+   X = 3 657 660.78 (m)
+   Y =    255 778.43 (m)
+   Z = 5 201 387.75 (m)
+
+This converts into:
+   Latitude =   55 deg 00 min 00.090 sec
+   Longitude =  4 deg 00 min 00.554 sec
+   Ellipsoidal height =  +3.22 m
+on the WGS 84 geographic 3D coordinate reference system.",Note the analogy with the Coordinate Frame Rotation (code 9607) but beware of the differences!  The Position Vector convention is used by IAG and recommended by ISO 19111.,EPSG guidance note #7.,EPSG,1996-09-18 00:00:00,98.16,0
+9607,Coordinate Frame rotation,1,"<<<<<This text is continued from the description of the Position Vector Transformation formula>>>>>
+
+Although being common practice particularly in the European E&P industry, the Position Vector Transformation sign convention is not universally accepted.  A variation on this formula is also used, particularly in the USA E&P industry.  That formula is based on the same definition of translation and scale parameters, but a different definition of the rotation parameters.  The associated convention is known as the ""Coordinate Frame Rotation"" convention (EPSG coordinate operation method c [...]
+The formula is:
+
+   (X�)             (  1      +Rz      -Ry)     (X)      (dX)
+   (Y�)  =  M *  ( -Rz       1      +Rx)  * (Y)  +  (dY)
+   (Z�)              ( +Ry   -Rx        1 )     (Z)       (dZ)
+
+and the parameters are defined as:
+
+(dX, dY, dZ)   : Translation vector, to be added to the point's position vector in the source coordinate reference system in order to transform from source coordinate reference system to target coordinate reference system; also: the coordinates of the origin of source coordinate reference system in the target frame.
+
+(Rx, Ry, Rz)   : Rotations to be applied to the coordinate reference frame.  The sign convention is such that a positive rotation of the frame about an axis is defined as a clockwise rotation of the coordinate reference frame when viewed from the origin of the Cartesian coordinate reference system in the positive direction of that axis, that is a positive rotation about the Z-axis only from source coordinate reference system to target coordinate reference system will result in a smaller  [...]
+
+M                  : The scale factor to be applied to the position vector in the source coordinate reference system  in order to obtain the correct scale of the target coordinate reference system. M = (1+dS*10^-6), where dS is the scale correction expressed in parts per million.
+
+In the absence of rotations the two formulas are identical; the difference is solely in the rotations. The name of the second method reflects this.
+
+Note that the same rotation that is defined as positive in the first method is consequently negative in the second and vice versa.  It is therefore crucial that the convention underlying the definition of the rotation parameters is clearly understood and is communicated when exchanging datum transformation parameters, so that the parameters may be associated with the correct coordinate transformation method (algorithm).","The same example as for the Position Vector Transformation (coordi [...]
+
+Transformation parameters Coordinate Frame Rotation convention:
+dX (m) = 0.000 
+dY (m) = 0.000 
+dZ (m) = +4.5 
+RX ("") = 0.000
+RY ("") = 0.000
+RZ ("") = -0.554
+Scale (ppm) = +0.219
+
+Please note that only the rotation has changed sign as compared to the Position Vector Transformation.",Note the analogy with the Position Vector transformation (code 9606) but beware of the differences!  The Position Vector convention is used by IAG and recommended by ISO 19111.,EPSG guidance note #7.,EPSG,1996-09-18 00:00:00,,0
+9613,NADCON,1,See information source.,,Geodetic transformation operating on geographic coordinate differences by bi-linear interpolation.  Input expects longitudes to be positive west.,US Coast and geodetic Survey - http://www.ngs.noaa.gov,EPSG,1996-09-18 00:00:00,,0
+9614,NTv1,1,See information source.,,Geodetic transformation operating on geographic coordinate differences by bi-linear interpolation.  Superseded in 1997 by NTv2 (transformation method code 9615).   Input expects longitudes to be positive west.,Geomatics Canada - Geodetic Survey Division.,EPSG,1997-11-13 00:00:00,,0
+9615,NTv2,1,See information source.,,Geodetic transformation operating on geographic coordinate differences by bi-linear interpolation.  Supersedes  NTv1 (transformation method code 9614).  Input expects longitudes to be positive west.,http://www.geod.nrcan.gc.ca/products/html-public/GSDapps/English/NTv2_Fact_Sheet.html,EPSG,1997-11-13 00:00:00,,0
+9616,Vertical Offset,1,"Xt = [(Xs * Us) + (A * Ua)] * (m / Ut)
+
+where 
+Xt = value in the target vertical coordinate reference system.
+
+Xs = value in the source vertical coordinate reference system; 
+
+A is the value of the origin of the target system in the source system.
+
+m is unit direction multiplier (m=1 if both systems are height or both are depth; m = �1 if one system is height and the other system is depth; the value of m is implied through the vertical coordinate reference system type attribute).
+
+Us Ut and Ua are unit conversion ratios to metres for the source and target systems and the offset value A respectively.",,This transformation allows calculation of height (or depth) in the target system by adding the parameter value to the height (or depth)-value of the point in the source system.,EPSG guidance note #7.,EPSG,1999-11-12 00:00:00,99.79,0
+9617,Madrid to ED50,0,"The polynomial expressions are:
+
+      dLat seconds = A0 + (A1*lat) + (A2*lon) + (A3*H)
+      dLon seconds = B00 + B0 + (B1*lat) + (B2*lon) + (B3*H)
+
+where latitude lat and longitude lon are in decimal degrees referred to the Madrid 1870 (Madrid) geographic coordinate reference system and H is gravity-related height in metres.  B00 is the longitude (in seconds) of the Madrid meridian measured from the Greenwich meridian; it is the value to be applied to a longitude relative to the Madrid meridian to transform it to a longitude relative to the Greenwich meridan.
+
+The results of these expressions are applied through the formulae:
+Lat(ED50) = Lat(M1870(M))  + dLat
+and Lon(ED50) = Lon(M1870(M))  + dLon.","Input point coordinate system: Madrid 1870 (Madrid) (geographic 3D)
+   Latitude    =  42 deg 38 min 52.77 sec N 
+                    = 42.647992 degrees
+   Longitude  =    3 deg 39 min 34.57 sec E of Madrid
+                     = +3.659603 degrees from the Madrid meridian.
+   Height        =  0 m
+
+For the north zone transformation:
+A1 = 11.328779
+A2 = -0.1674
+A3 = -0.03852
+A4 = 0.0000379
+B0 = -13276.58
+B1 = 2.5079425
+B2 = 0.8352
+B3 = -0.00864
+B4 = -0.0000038
+
+dLat = +4.05 seconds
+
+Then ED50 latitude = 42 deg 38 min 52.77 sec N + 4.05sec
+                               = 42 deg 38 min 56.82 sec N
+
+
+dLon = -13270.54 seconds  = -3 deg 41 min 10.54 sec
+
+Then ED50 longitude = 3 deg 39 min 34.57 sec E - 3 deg 41 min 10.54 sec
+                                  = 0 deg 01 min 35.97 sec W of Greenwich.",,"EPSG guidance note #7, after Institut de Geomatica; Barcelona.",EPSG,2000-03-07 00:00:00,99.284  99.82  99.64,0
+9618,Geographical and Height Offsets,1,"Lat_T = Lat_S + latitude_offset 
+Lon_T = Lon_S + longitude_offset 
+EllipsoidHeight_T = GravityHeight_S + gravity-related_to_ellipsoid_height_offset.",,This transformation allows calculation of coordinates in the target system by adding the parameter value to the coordinate values of the point in the source system.,EPSG guidance note #7.,EPSG,1999-11-12 00:00:00,99.79,0
+9619,Geographical Offsets,1,"Lat_T = Lat_S + latitude_offset 
+Lon_T = Lon_S + longitude_offset.",,This transformation allows calculation of coordinates in the target system by adding the parameter value to the coordinate values of the point in the source system.,EPSG guidance note #7.,EPSG,1999-11-12 00:00:00,99.79,0
+9620,Norway Offshore Interpolation,0,See information source.,,,"Norwegian Mapping Authority note of 13-Feb-1991 ""Om Transformasjon mellom Geodetiske Datum i Norge"".",EPSG,1999-04-22 00:00:00,,0
+9621,Similarity transformation,0,"The similarity transformation in algebraic form is:
+
+XT = XT0  + XS. dS. cos q  + YS. dS . sin q
+YT = YT0  � XS. dS. sin q  + YS. dS . cos q
+
+where:
+XT0 , YT0    =   the coordinates of the origin point of the source coordinate reference system expressed in the target coordinate reference system;
+1+dS           =  the length of one unit in the source coordinate reference system expressed in units of the target coordinate reference system;
+q                  = the angle about which the axes of the source coordinate reference system need to be rotated to coincide with the axes of the target coordinate reference system, counter-clockwise being positive. Alternatively, the bearing of the source coordinate reference system Y-axis measured relative to target coordinate reference system north.
+
+The similarity transformation can also be described as a special case of the parametric affine transformation where coefficients A1 = B2  and  A2 =  - B1.
+
+Reversibility
+In contrast with the affine transformation, the similarity transformation parameters are reversible, but only on the condition that the scale difference between the two coordinate systems is small (order of several parts per million).  Then dS is the deviation from unity of the ratio of the units of measure of the two coordinate reference systems. In these cases the reverse transformation would require a scale correction of 1/(1+dS) * (1-dS).  This enables usage of the same scale and rot [...]
+Target coordinate system:	Campo Inchauspe / Argentina 2 (projected 2D system)
+
+Note that for the Astra Minas Grid the coordinate axes are:
+X  (positive axis oriented north)
+Y  (positive axis oriented west)
+and coordinates are quoted in that order.
+
+whereas for Campo Inchauspe / Argentina 2 the axes are:
+X (positive axis oriented north)
+Y (positive axis oriented east)
+and coordinates are quoted in that order.
+
+Thus the Astra Minas grid X and Y axes map to the Campo Inchauspe / Argentina 2 Y and X-axes respectively.  With respect to the symbols in the formulas,
+XS  = Astra Minas X
+YS  = Astra Minas Y
+XT  = Campo Inchauspe / Argentina 2 Y
+YT  = Campo Inchauspe / Argentina 2 X
+
+Parameters of the similarity transformation:
+XT0	=	2610200.48 metre
+YT0	=	4905282.73 metre
+*	= 271o 05� 30�  = 271.0916667 degrees
+k	= 0  whence (1+k)=1.0
+
+Forward calculation for Astra Minas point :  X (north) =10000 m, Y (west) =50000 m. 
+
+XS  = Astra Minas X = 10000
+YS  = Astra Minas Y = 50000
+
+Gauss-Kruger zone 2 Easting (Y) = XT = XT0  + XS. dS. cos q  + YS. dS . sin q
+					  = 2610200.48 + (50000 * 1.0 * cos(271.0916667deg)) 
+						+ (10000 * 1.0 * sin(271.0916667deg))
+					  = 2601154.90 m.
+
+Gauss-Kruger zone 2 Northing (X) =YT = YT0  � XS. dS. sin q  + YS. dS . cos q
+				    = 4905282.73 - (50000*1.0* sin(271.0916667deg))
+					+ (10000 * 1.0 * cos(271.0916667deg))
+						    = 4955464.17 m.",Defined for two-dimensional coordinate systems.,EPSG guidance note #7.,EPSG,2000-10-19 00:00:00,2000.83,0
+9622,Affine orthogonal geometric transformation,0,"XT = XT0   +   XS .  k . dSX . cos q   +   YS .  k .  dSY  . sin q
+YT = YT0   �   XS .  k .  dSX . sin q    +   YS .  k .  dSY  . cos q
+
+where:
+
+XT0 ,YT0  = the coordinates of the origin point of the source coordinate reference system, expressed in the target coordinate reference system;
+dSX , dSY  = the length of one unit of the source  axis, expressed in units of the target axis, for the X axes and the Y- axes respectively;
+k = point scale factor of the target coordinate reference system in a chosen reference point;
+q  = the angle through which the source coordinate reference system axes must be rotated to coincide with the target coordinate refderence system axes (counter-clockwise is positive). Alternatively, the bearing (clockwise positive) of the source coordinate reference system Y-axis measured relative to target coordinate reference system north.","Source coordinate system: imaginary 3D seismic acquisition bin grid.  The two axes are orthogonal, but the unit on the I-axis is 25 metres, whilst [...]
+The target projected coordinate system is WGS 84 / UTM Zone 31N and the origin of the bin grid (centre of bin 0,0) is defined at E = 456781.0, N = 5836723.0.  The projected coordinate system point scale factor at the bin grid origin is 0.99984.
+The map grid bearing of the I and J axes are 110* and 20* respectively.  Thus the angle through which both the positive I and J axes need to be rotated to coincide with the positive Easting axis and Northing axis respectively is +20 degrees.
+
+Hence: 
+XT0 ,	=    456 781.0 m
+YT0	= 5 836 723.0 m
+dSX 	= 25
+dSY	= 12.5
+k 	= 0.99984
+q	= +20 degrees
+
+Forward calculation for centre of bin with coordinates: I = 300, J = 247:
+
+XT = Easting   = XT0   +   XS . k . dSX . cos q   +   YS . k . dSY  . sin q    = 464 855.62 m.
+
+YT = Northing = YT0   �   XS . k . dSX . sin q    +   YS . k . dSY  . cos q  = 5 837 055.90 m
+
+Reverse calculation for this point:
+XS = [( XT  � XT0) . cos qY  �  (YT � YT0) . sin qY ] / [k . dSX  . cos (qX � qY)] = 230 bins
+
+YS = [(XT   � XT0) . sin qX   +  (YT � YT0) . cos qX ] / [k . dSY . cos (qX � qY)]  = 162 bins",,EPSG guidance note #7.,EPSG,2000-06-10 00:00:00,,0
+9623,Affine general geometric transformation,0,"The geometric representation of the general affine transformation:
+XT = XT0   +  XS . k . dSX  . cos qX   +  YS . k . dSY  . sin qY
+YT = YT0  �  XS . k . dSX   . sin qX   +  YS . k. dSY  . cos qY 
+where:
+
+XT0 ,YT0  = the coordinates of the origin point of the source coordinate reference system, expressed in the target coordinate reference system;
+dSX , dSY  = the length of one unit of the source axis, expressed in units of the target axis, for the first and second source and target axis pairs respectively;
+qX , qY   = the angles about which the source coordinate reference system axes XS and YS must be rotated to coincide with the target coordinate reference system axes XT and YT respectively (counter-clockwise being positive).
+k = point scale factor of the target coordinate reference system in a chosen reference point;
+ 
+Comparing the algebraic representation with the parameters of the parameteric form (code 9624) it can be seen that the parametric and geometric forms of the affine transformation are related as follows:
+A0  =  XT0
+A1  = k . dSX . cos qX  
+A2  = k . dSY . sin qY
+B0  =  YT0
+B1  =   � k . dSX . sin qX
+B2  =   k . dSY . cos qY
+
+Reversibility
+The parameters for an affine transformation cannot be used for the reverse transformation.  However, the reverse transformation is another affine transformation using the same formulas but with different parameters.  The reverse parameter values can be calculated from from the formulae provided above and applying those to same algorithm.  Alternatively the reverse transformation can be described by a different formula, as shown below, using the same parameters as the forward transformation:
+
+XS = [( XT  � XT0) . cos qY  �  (YT � YT0) . sin qY ] / [k . dSX  . cos (qX � qY)]
+YS = [(XT   � XT0) . sin qX   +  (YT � YT0) . cos qX ] / [k . dSY . cos (qX � qY)]",,,EPSG guidance note #7.,EPSG,2000-06-10 00:00:00,,0
+9624,Affine general parametric transformation,0,"XT   =  A0  +  A1. XS  +  A2.YS
+YT   =  B0  +  B1. XS  +  B2.YS
+where
+XT , YT  are the coordinates of a point P in the target coordinate reference system;
+XS , YS   are the coordinates of P in the source coordinate reference system.
+
+Reversibility
+The parameter values for an affine transformation cannot be used for the reverse transformation.  However, the reverse transformation is another affine transformation using the same formulas but with different parameter values.  The reverse parameter values, indicated by a prime (�), can be calculated from those of the forward transformation as follows:
+
+D    = A1 . B2   �   A2 . B1
+A0� = (A2 . B0   �   B2 . A0) / D
+B0� = (B1 . A0   �   A1 . B0) / D
+A1� = +B2 / D
+A2� = � A2 / D
+B1� = � B1 / D
+B2� = +A1 / D",,,EPSG guidance note #7,EPSG,2000-06-10 00:00:00,,0
+9625,General polynomial (2nd-order),0,"The simplest of all polynomials is the general polynomial function. In order to avoid problems of numerical instability this type of polynomial should be used after reducing the input parameters, usually coordinate offsets U and V relative to a central evaluation point, to �manageable� numbers, between �10 and +10 at most.
+
+U = XS - XS0 in defined units (which may not be those of the coordinate reference system),
+V = YS - YS0
+
+Then (XT - XT0) = (XS - XS0) + dX
+         (YT - YT0) = (YS - YS0) + dY 
+or
+XT  = XS - XS0 + XT0 + dX
+YT  = YS - YS0 + YT0 + dY
+
+where
+XT , YT   are coordinates in the target coordinate reference system,
+XS , YS  are coordinates in the source coordinate reference system,
+XS0 , YS0 are coordinates of the evaluation point in the source coordinate reference system,
+XT0 , YT0  are coordinates of the evaluation point in the target coordinate reference system.
+
+and where
+dX = A0 + A1.U + A2.V + A3.U2 + A4.U.V + A5.V2
+dY = B0 + B1.U + B2.V +B3.U2 +B4.U.V +B5.V2",,,EPSG guidance note #7.,EPSG,2000-03-07 00:00:00,,0
+9626,General polynomial (3rd-order),0,"The simplest of all polynomials is the general polynomial function. In order to avoid problems of numerical instability this type of polynomial should be used after reducing the input parameters, usually coordinate offsets U and V relative to a central evaluation point, to �manageable� numbers, between �10 and +10 at most.
+
+U = XS - XS0 in defined units (which may not be those of the coordinate reference system),
+V = YS - YS0
+
+Then (XT - XT0) = (XS - XS0) + dX
+         (YT - YT0) = (YS - YS0) + dY 
+or
+XT  = XS - XS0 + XT0 + dX
+YT  = YS - YS0 + YT0 + dY
+
+where
+XT , YT   are coordinates in the target coordinate reference system,
+XS , YS  are coordinates in the source coordinate reference system,
+XS0 , YS0 are coordinates of the evaluation point in the source coordinate reference system,
+XT0 , YT0  are coordinates of the evaluation point in the target coordinate reference system.
+
+and where
+dX = A0 + A1.U + A2.V + A3.U2 + A4.U.V + A5.V2 + A6.U3 + A7.U2.V + A8.U.V2 + A9.V3
+dY = B0 + B1.U + B2.V +B3.U2 +B4.U.V +B5.V2 + B6.U3 +B7.U2.V +B8.U.V2 +B9.V3",,,EPSG guidance note #7.,EPSG,2000-03-07 00:00:00,,0
+9627,General polynomial (4th-order),0,"The simplest of all polynomials is the general polynomial function. In order to avoid problems of numerical instability this type of polynomial should be used after reducing the input parameters, usually coordinate offsets U and V relative to a central evaluation point, to �manageable� numbers, between �10 and +10 at most.
+
+U = XS - XS0 in defined units (which may not be those of the coordinate reference system),
+V = YS - YS0
+
+Then (XT - XT0) = (XS - XS0) + dX
+         (YT - YT0) = (YS - YS0) + dY 
+or
+XT  = XS - XS0 + XT0 + dX
+YT  = YS - YS0 + YT0 + dY
+
+where
+XT , YT   are coordinates in the target coordinate reference system,
+XS , YS  are coordinates in the source coordinate reference system,
+XS0 , YS0 are coordinates of the evaluation point in the source coordinate reference system,
+XT0 , YT0  are coordinates of the evaluation point in the target coordinate reference system.
+
+and where
+dX = A0 + A1.U + A2.V + A3.U2 + A4.U.V + A5.V2 + A6.U3 + A7.U2.V + A8.U.V2 + A9.V3 + A10.U4 + A11.U3.V + A12.U2.V2 + A13.U.V3 + A14.V4
+
+dY = B0 + B1.U + B2.V +B3.U2 +B4.U.V +B5.V2 + B6.U3 +B7.U2.V +B8.U.V2 +B9.V3 + B10.U4 + B11.U3.V + B12.U2.V2 + B13.U.V3 + B14.V4",,,EPSG guidance note #7.,EPSG,2000-03-07 00:00:00,,0
+9628,Reversible polynomial (2nd-order),1,See EPSG Guidance Note 7.,,Reversibility is subject to constraints.  See Guidance Note 7 for clarification.,EPSG guidance note #7.,EPSG,2000-03-07 00:00:00,99.64,0
+9629,Reversible polynomial (3rd-order),1,See EPSG Guidance Note 7.,,Reversibility is subject to constraints.  See Guidance Note 7 for clarification.,EPSG guidance note #7.,EPSG,2000-03-07 00:00:00,99.64,0
+9630,Reversible polynomial (4th-order),1,See EPSG Guidance Note 7.,"For geodetic transformation ED50 to ED87 (1)
+
+Offset unit:  degree
+Ordinate 1 of evaluation point X0  =   55� 00' 00.000""N  = +55 degrees
+Ordinate 2 of evaluation point Y0  =     0� 00' 00.000""E   =   +0 degrees
+
+Parameters:
+A0 = -5.56098E-06   A1 = -1.55391E-06   ...   A14 = -4.01383E-09
+B0 = +1.48944E-05   B2 = +2.68191E-05  ...   B14 = +7.62236E-09
+
+Forward calculation for: 
+ED50 Latitude     = Xs =52* 30�30""N   =     +52.508333333 degrees
+ED50 Longitude  = Ys =  2*E=      +2.0 degrees   
+
+U = XS - X0 =  * ED50 - X0  = 52.508333333 - 55.0 = -2.491666667 degrees
+V = YS - Y0 =  * ED50 - Y0   = 2.0 - 0.0 = 2.0 degrees
+
+dX = A0 + A1.U + ... + A14.V4
+      = -5.56098E-06 + (-1.55391E-06 * -2.491666667) + ... + (-4.01383E-09 * 2.0^4)
+      = -3.12958E-06 degrees
+
+dY = B0 + B1.U + ... + B14.V4
+      = +1.48944E-05 + (2.68191E-05 * -2.491666667) + ... + (7.62236E-09 * 2.0^4)
+      = +9.80126E-06 degrees
+
+Then  ED87 Latitude  =   XT = XS + dX
+                                  =  52.508333333 - 3.12958E-06   degrees
+                                  = 52* 30� 29.9887"" N
+
+ED87 Longitude  =   YT = YS + dY
+                           = 2* 00� 00.0353"" E
+
+
+Reverse calculation for transformation ED50 to ED87 (1).
+The transformation method for the ED50 to ED87 (1) transformation, 4th-order reversible polynomial, is reversible. The same formulas may be applied for the reverse calculation, but coefficients A0 through A14 and B0 through B14 are applied with reversal of their signs. Sign reversal is not applied to the coordinates of the evaluation point. Thus:
+Ordinate 1 of evaluation point X0  =   55� 00' 00.000""N  = +55 degrees
+Ordinate 2 of evaluation point Y0  =     0� 00' 00.000""E   =   +0 degrees
+A0  = +5.56098E-06   A1 = +1.55391E-06   ...   A14 = +4.01383E-09
+B0  = -1.48944E-05    B1 = -2.68191E-05    ...   B14 = -7.62236E-09
+
+Reverse calculation for: 
+ED87 Latitude     = XS = 52� 30�29.9887""N   =     +52.5083301944 degrees
+ED87 Longitude  = YS =   2� 00� 00.0353"" E   =     +2.0000098055 degrees   
+
+U = 52.5083301944 - 55.0 = -2.4916698056 degrees
+V = 2.0000098055 - 0.0 = 2.0000098055 degrees
+
+dX = A0 + A1.U + ... + A14.V4
+      = +5.56098E-06 + (1.55391E-06 * -2.491666667) + ... + (4.01383E-09 * 2.0000098055^4)
+      = +3.12957E-06 degrees
+
+dY = B0 + B1.U + ... + B14.V4
+      = -1.48944E-05 + (-2.68191E-05 * -2.491666667) + ... + (-7.62236E-09 * 2.0000098055^4)
+      = -9.80124E-06 degrees
+
+Then ED50 Latitude  =   XT = XS + dX
+                                 = 52.5083301944 + 3.12957E-06   degrees
+                                 = 52� 30� 30.000"" N
+
+ED50 Longitude  =   YT = YS + dY
+                           = 2� 00� 00.000"" E",Reversibility is subject to constraints.  See Guidance Note 7 for clarification.,EPSG guidance note #7.,EPSG,2000-03-07 00:00:00,99.64,0
+9631,Complex polynomial (3rd-order),0,"The relationship between two projected coordinate reference systems may be approximated more elegantly by a single polynomial regression formula written in terms of complex numbers. The advantage is that the dependence between the �A� and �B� coefficients (for U and V) is taken into account in the formula, resulting in fewer coefficients for the same order polynomial. A third-order polynomial in complex numbers is used in Belgium.  A fourth-order po [...]
+
+(dX + i. dY) = (A1 + i. A2).(U + i.V) + (A3 + i. A4).(U + i.V)^2 + (A5 + i. A6).(U + i.V)^3 
+
+where U = (XS - XS0).10-5
+and     V = (YS - YS0).10-5
+
+Then
+XT  = XS - XS0 + XT0 + dX
+YT  = YS - YS0 + YT0 + dY
+
+where
+XT , YT      are coordinates in the target coordinate reference system,
+XS , YS      are coordinates in the source coordinate reference system,
+XS0 , YS0   are coordinates of the evaluation point in the source coordinate reference system,
+XT0 , YT0   are coordinates of the evaluation point in the target coordinate reference system.
+
+Note that the zero order coefficients of the general polynomial, A0 and B0, have apparently disappeared.  In reality they are absorbed by the different coordinates of the source and of the target evaluation point, which in this case, are numerically very different because of the use of two different projected coordinate reference systems for source and target.
+
+The transformation parameter values (the coefficients) are not reversible.  For the reverse transformation a different set of parameter values are required, used within the same formulas as the forward direction","For transformation Belge Lambert 72 to ED50 / UTM zone 31N,
+
+Eo1 = 0
+No1 = 0
+Eo2 = 449681.702
+No2 = 5460505.326
+A1 = -71.3747
+A2 = 1858.8407
+A3 = -5.4504
+A4 = -16.9681
+A5 = 4.0783
+A6 = 0.2193
+
+For source coordinate system E1=200000  N1=100000, then
+E2 = 647737.377  N2 = 5564124.227.",Coordinate pairs treated as complex numbers.  This exploits the correlation between the polynomial coefficients and leads to a smaller number of coefficients than the regular 3rd-order polynomial.,EPSG guidance note #7.,EPSG,2000-03-07 00:00:00,,0
+9632,Complex polynomial (4th-order),0,"The relationship between two projected coordinate reference systems may be approximated more elegantly by a single polynomial regression formula written in terms of complex numbers. The advantage is that the dependence between the �A� and �B� coefficients (for U and V) is taken into account in the formula, resulting in fewer coefficients for the same order polynomial. A third-order polynomial in complex numbers is used in Belgium.  A fourth-order po [...]
+
+(dX + i. dY) = (A1 + i. A2).(U + i.V) + (A3 + i. A4).(U + i.V)^2 + (A5 + i. A6).(U + i.V)^3 + (A7 + i.A8).(U + i.V)^4
+
+where U = (XS - XS0).10-5
+and     V = (YS - YS0).10-5
+
+Then
+XT  = XS - XS0 + XT0 + dX
+YT  = YS - YS0 + YT0 + dY
+
+where
+XT , YT      are coordinates in the target coordinate reference system,
+XS , YS      are coordinates in the source coordinate reference system,
+XS0 , YS0   are coordinates of the evaluation point in the source coordinate reference system,
+XT0 , YT0   are coordinates of the evaluation point in the target coordinate reference system.
+
+Note that the zero order coefficients of the general polynomial, A0 and B0, have apparently disappeared.  In reality they are absorbed by the different coordinates of the source and of the target evaluation point, which in this case, are numerically very different because of the use of two different projected coordinate reference systems for source and target.
+
+The transformation parameter values (the coefficients) are not reversible.  For the reverse transformation a different set of parameter values are required, used within the same formulas as the forward direction.","For transformation RD / Netherlands New to ED50 / UTM zone 31N,
+
+Eo1 = 155000
+No1 = 463000
+Eo2 = 663395.607
+No2 = 5781194.380
+A1 = -51.681
+A2 = 3290.525
+A3 = 20.172
+A4 = 1.133
+A5 = 2.075
+A6 = 0.251
+A7 = 0.075
+A8 = -0.012
+
+For source coordinate system E1=200000  N1=500000, then
+E2 =707155.557  N2 = 5819663.128.",Coordinate pairs treated as complex numbers.  This exploits the correlation between the polynomial coefficients and leads to a smaller number of coefficients than the regular 4th-order polynomial.,EPSG guidance note #7.,EPSG,2000-03-07 00:00:00,,0
+9633,Ordnance Survey National Transformation,1,See information source.,See information source.,Geodetic transformation between ETRS89 (or WGS 84) and OSGB36 / National Grid.  Uses ETRS89 / National Grid as an intermediate coordinate system for bi-linear interpolation of gridded grid coordinate differences.,http://www.gps.gov.uk/gpssurveying.asp,EPSG,2000-10-19 00:00:00,,0
+9634,Maritime Provinces polynomial interpolation,0,"The transformation makes use of a residual file for each Canadian maritime province.  The process of residual interpolation accounts for local variations in the coordinate system and provides a transformation accuracy of +/- 5 cm.
+
+By using a second residual file, the transformation may be reversed.  Only one residual file is in use by the method during any given execution.",,This transformation is an executable module within the application NBGeocalc.  It is an adaptation of the ESTPM program developed by Geodetic Survey of Canada.,Survey of New Brunswick,EPSG,2000-10-19 00:00:00,,0
+9635,Geographic3D to Geographic2D+GravityRelatedHeight,1,"This is a complex, multi-step transformation, involving the application of a geoid height difference interpolated at a point in a ""geoid model"". The geoid model should be available as a regular grid of latitude and longitude with the height of the geoid above the ellipsoid at each grid node. Only the height is affected by this transformation; the geodetic latitude and longitude are not.
+
+The transformation involves the following sequence of steps:
+�  Selection of a subset of the geoid file covering the extent of the points to be transformed.
+�  If the geoid file is not based on the source or target CRS, it needs to be transformed first. This involves transformation of the chosen subset of the geoid file from its orignal Geographic 3D CRS to the Geographic 3D CRS that is the source or the target of this transformation.
+�  Calculation of the height of the geoid above the ellipsoid (""geoid undulation"") at the relevant point(s). This is achieved through a bi-linear interpolation of the geoid undulation, using the latitude and longitude to locate the point in the sub-grid.  This step results in the height of the geoid above the ellipsoid (N) of the Geographic 3D CRS, whether source or target.
+�  At each point, the application of the calculated geoid undulation to the height to be transformed.
+
+H=h-N for Geographic3D to Geographic2D+GravityRelatedHeight
+
+h=H+N for Geographic2D+GravityRelatedHeight to Geographic3D
+
+where h = the ellipsoidal height (height above the ellipsoid in a geographic 3D CRS)
+and H = the Gravity-Related Height component of the compound CRS.",,"Transformation from a Geographic 3D CRS to a Compound CRS consisting of a Geographic 2D CRS and a Vertical CRS, or vice versa. The Geographic 3D and the Geographic 2D CRS must be based on the same Geodetic Datum.",,EPSG,2001-06-05 00:00:00,,0
+9636,Molodenski-Badekas transformation,1,"To eliminate high correlation between the translations and rotations in the derivation of parameter values for the Helmert transformation methods (coordinate operation metghod codes 9606 and 9607), instead of the rotations being derived about the geocentric coordinate reference system origin they may be derived at a location within the points used in the determination. Three additional parameters, the coordinates of the rotation point, are then r [...]
+
+   (Xt)             (  1       +Rz    -Ry)      (Xs - Xp)      (Xp)       (dX)
+   (Yt)  =  M *  ( -Rz      1      +Rx)  *  (Ys - Yp)  +  (Yp)  +  (dY)
+   (Zt)              ( +Ry   -Rx       1 )      (Zs - Zp)      (Zp)       (dZ)
+
+and the parameters are defined as:
+
+(dX, dY, dZ)   : Translation vector, to be added to the point's position vector in the source coordinate system in order to transform from source coordinate reference system to target coordinate reference system; also: the coordinates of the origin of source coordinate reference system in the target frame.
+
+(Rx, Ry, Rz)   : Rotations to be applied to the coordinate reference frame.  The sign convention is such that a positive rotation of the frame about an axis is defined as a clockwise rotation of the coordinate reference frame when viewed from the origin of the Cartesian coordinate system in the positive direction of that axis, that is a positive rotation about the Z-axis only from source coordinate reference system to target coordinate reference system will result in a smaller longitude  [...]
+
+(Xp, Yp, Zp)   : Coordinates of the point about which the coordinate reference frame is rotated, given in the source Cartesian coordinate reference system. 
+
+M                  : The scale factor to be applied to the position vector in the source coordinate reference system  in order to obtain the correct scale of the target coordinate reference system. M = (1+dS*10^-6), where dS is the scale correction expressed in parts per million.
+
+Reversibility.
+The Molodensky-Badekas transformation in a strict mathematical sense is not reversible, i.e. in principle the same parameter values cannot be used to execute the reverse transformation. This is because the evaluation point coordinates are in the forward direction source coordinate reference system and the rotations have been derived about this point. They should not be applied about the point having the same coordinate values in the target coordinate reference system, as is required for  [...]
+9801,Lambert Conic Conformal (1SP),1,"To derive the projected Easting and Northing coordinates of a point with geographical coordinates (lat,lon) the formulas for the one standard parallel case are:
+
+E = FE + r sin(theta)
+N = FN + r0 - r cos(theta)
+where
+n = sin lat0
+r = a F t^n k0     for r0, and r
+m = cos(lat)/(1 - e^2 sin^2(lat))^0.5     for m0, lat0, and m2, lat2 where lat1 and lat2 are the latitudes of the standard parallels.
+t  = tan(pi/4 - lat/2)/[(1 - e sin(lat))/(1 + e sin(lat))]^(e/2)   for t0 and t using lat0 and lat respectively.
+F = m0/(n  t1^n)
+theta = n(lon - lon0)
+
+The reverse formulas to derive the latitude and longitude of a point from its Easting and Northing values are:
+
+lat = pi/2 - 2arctan{t'[(1 - esin(lat))/(1 + esin(lat))]^(e/2)}
+lon = theta'/n +lon0
+where
+theta' = arctan[(E - FE)/{r0 -(N - FN)}]
+r' = +/-[(E - FE)^2 + {r0 - (N - FN)}^2]^0.5
+t' = (r'/(a k0 F))^(1/n)
+and n, F, and rF are derived as for the forward calculation.","For Projected Coordinate System JAD69 / Jamaica National Grid
+
+Parameters:
+Ellipsoid:  Clarke 1866, a = 6378206.400 m., 1/f = 294.97870
+                                   then  e = 0.08227185 and e^2 = 0.00676866
+
+Latitude Natural Origin         18 deg 00 min 00 sec N  =  0.31415927 rad
+Longitude Natural Origin     77 deg 00 min 00 sec W = -1.34390352 rad
+Scale factor at origin            1.000000
+False Eastings  FE               250000.00 m
+False Northings FN              150000.00 m
+
+Forward calculation for: 
+Latitude:     17 deg 55 min 55.80 sec N  =  0.31297535 rad
+Longitude:  76 deg 56 min 37.26 sec W = -1.34292061 rad
+first gives
+m0    =  0.95136402        t0 =  0.72806411
+F       =  3.39591092        n  =  0.30901699
+r        =  19643955.26     r0  =  19636447.86
+theta =  0.00030374        t   =  0.728965259
+
+Then Easting E   =     255966.58 m
+         Northing N =      142493.51 m
+
+Reverse calculation for the same easting and northing first gives
+
+theta' =  0.000303736
+t'        =  0.728965259
+m0     =  0.95136402
+r'        =  19643955.26
+
+Then Latitude     = 17 deg 55 min 55.800 sec N
+         Longitude  = 76 deg 56 min 37.260 sec W",,EPSG guidance note #7.,EPSG,2001-06-05 00:00:00,2001.08,0
+9802,Lambert Conic Conformal (2SP),1,"To derive the projected Easting and Northing coordinates of a point with geographical coordinates (lat,lon) the formulas for the one standard parallel case are:
+
+E = EF + r sin(theta)
+N = NF + rF - r cos(theta)
+where
+m = cos(lat)/(1 - e^2 sin^2(lat))^0.5     for m1, lat1, and m2, lat2 where lat1 and lat2 are the latitudes of the standard parallels.
+t  = tan(pi/4 - lat/2)/[(1 - e sin(lat))/(1 + e sin(lat))]^(e/2)   for t1, t2, tF and t using lat1, lat2, latF and lat respectively.
+n = (loge(m1) - loge(m2))/(loge(t1) - loge(t2))
+F = m1/(n  t1^n)
+r =  a F t^n         for rF and r, where rF is the radius of the parallel of latitude of the false origin.
+theta = n(lon - lon0)
+
+The reverse formulas to derive the latitude and longitude of a point from its Easting and Northing values are:
+
+lat = pi/2 - 2arctan{t'[(1 - esin(lat))/(1 + esin(lat))]^(e/2)}
+lon = theta'/n +lon0
+where
+r' = +/-[(E - EF)^2 + {rF - (N - NF)}^2]^0.5 , taking the sign of n
+t' = (r'/(aF))^(1/n)
+theta' = arctan [(E- EF)/(rF - (N- NF))]
+and n, F, and rF are derived as for the forward calculation.","For Projected Coordinate System NAD27 / Texas South Central
+
+Parameters:
+Ellipsoid  Clarke 1866, a = 6378206.400 metres = 20925832.16 US survey feet
+                                   1/f = 294.97870
+then e = 0.08227185 and e^2 = 0.00676866
+
+First Standard Parallel          28o23'00""N  =   0.49538262 rad
+Second Standard Parallel    30o17'00""N  =   0.52854388 rad
+Latitude False Origin            27o50'00""N  =   0.48578331 rad
+Longitude False Origin         99o00'00""W = -1.72787596 rad
+Easting at false origin           2000000.00  US survey feet
+Northing at false origin          0.00  US survey feet
+
+Forward calculation for: 
+Latitude       28o30'00.00""N  =  0.49741884 rad
+Longitude    96o00'00.00""W = -1.67551608 rad
+
+first gives :
+m1    = 0.88046050      m2 = 0.86428642
+t        = 0.59686306      tF  = 0.60475101
+t1      = 0.59823957      t2 = 0.57602212
+n       = 0.48991263       F = 2.31154807
+r        = 37565039.86    rF = 37807441.20
+theta = 0.02565177
+
+Then Easting E =      2963503.91 US survey feet
+         Northing N =      254759.80 US survey feet
+
+Reverse calculation for same easting and northing first gives:
+theta' = 0.025651765     r' = 37565039.86
+t'        = 0.59686306
+
+Then Latitude     	= 28o30'00.000""N
+         Longitude   = 96o00'00.000""W",,EPSG guidance note #7.,EPSG,2001-06-05 00:00:00,99.281  2001.08,0
+9803,Lambert Conic Conformal (2SP Belgium),1,"For the Lambert Conic Conformal (2 SP Belgium), the formulas for the regular two standard parallel case (coordinate operation method code 9802) are used except for: 
+
+Easting, E = EF + r sin (theta - alpha)
+Northing, N = NF + rF - r cos (theta - alpha)
+
+and for the reverse formulas
+lon = ((theta' + alpha)/n) +lon0
+where alpha = 29.2985 seconds.","For Projected Coordinate System Belge 1972 / Belge Lambert 72
+
+Parameters:
+Ellipsoid  International 1924,  a = 6378388 metres
+                                              1/f = 297
+then e = 0.08199189 and e^2 = 0.006722670
+
+First Standard Parallel        49o50'00""N       =   0.86975574 rad
+Second Standard Parallel  51o10'00""N       =   0.89302680 rad
+Latitude False Origin          90o00'00""N       =   1.57079633 rad
+Longitude False Origin         4o21'24.983""E = 0.07604294 rad
+Easting at false origin EF        150000.01  metres
+Northing at false origin NF    5400088.44  metres
+
+Forward calculation for: 
+Latitude        50o40'46.461""N  =  0.88452540 rad
+Longitude       5o48'26.533""E   = 0.10135773 rad
+
+first gives :
+m1     = 0.64628304         m2 = 0.62834001
+t        = 0.59686306          tF  = 0.00000000
+t1      = 0.36750382           t2 = 0.35433583
+n       = 0.77164219            F = 1.81329763
+r        = 37565039.86         rF = 0.00
+alpha =	0.00014204     theta = 0.01953396
+
+Then Easting E  =      251763.20 metres
+         Northing N =      153034.13 metres
+
+Reverse calculation for same easting and northing first gives:
+theta' = 0.01939192      r' = 548041.03
+t' = 0.35913403
+Then Latitude   =    50o40'46.461""N
+         Longitude =     5o48'26.533""E",In 2000 this modification was replaced through use of the regular Lambert Conic Conformal (2SP) method [9802] with appropriately modified parameter values.,EPSG guidance note #7.,EPSG,1999-04-22 00:00:00,99.281,0
+9804,Mercator (1SP),1,"The formulas to derive projected Easting and Northing coordinates are:
+
+E = FE + a*k0(lon - lon0)              
+N = FN + a*k0* ln{tan(pi/4 + lat/2)[(1 - esin(lat))/(1 + esin(lat))]^e/2} where symbols are as listed above and logarithms are natural.
+
+The reverse formulas to derive latitude and longitude from E and N values are:
+
+lat = chi + (esq/2 + 5e^4/24 + e^6/12 + 13e^8/360) sin(2chi) 
++ (7e^4/48 + 29e^6/240 + 811e^8/11520) sin(4chi)
++ (7e^6/120 +  81e^8/1120) sin(6chi)  + (4279e^8/161280) sin(8chi)
+
+where chi = pi/2 - 2 arctan t
+t = B^((FN-N)/(a*k0)) 
+B = base of the natural logarithm, 2.7182818...
+and  for the 2 SP Case, k0 is calculated as for the forward transformation above.
+lon  =  ((E - FE)/(a*k0))  + lon0","For Projected Coordinate System Makassar / NEIEZ
+
+Parameters:
+Ellipsoid   Bessel 1841  a = 6377397.155 m   1/f = 299.15281
+then e = 0.08169683
+
+Latitude Natural Origin         00o00'00""N  = 0.0000000 rad
+Longitude Natural Origin    110o00'00""E  = 1.91986218 rad
+Scale factor ko                  0.997
+False Eastings FE              3900000.00 m
+False Northings FN              900000.00 m
+
+Forward calculation for: 
+Latitude            3o00'00.00""S   = -0.05235988 rad
+Longitude     120o00'00.00""E   =  2.09439510 rad
+gives
+Easting  E   =      5009726.58 m
+Northing N  =        569150.82 m
+
+Reverse calculation for same easting and northing first gives :
+t    = 1.0534121
+chi = -0.0520110
+
+Then Latitude     =   3o00'00.000""S
+         Longitude  = 120o00'00.000""E",,EPSG guidance note #7.,EPSG,2001-06-05 00:00:00,2001.08,0
+9805,Mercator (2SP),1,"The formulas to derive projected Easting and Northing coordinates are:
+
+For the two standard parallel case, k0 is first calculated from
+
+k0 = cos(latSP1)/(1 - e^2*sin^2(latSP1))^0.5 
+ 
+where latSP1 is the absolute value of the first standard parallel (i.e. positive).  
+
+Then, for both one and two standard parallel cases, 
+
+E = FE + a*k0(lon - lon0)              
+N = FN + a*k0* ln{tan(pi/4 + lat/2)[(1 - esin(lat))(1 + esin(lat))]^e/2} where symbols are as listed above and logarithms are natural.
+
+The reverse formulas to derive latitude and longitude from E and N values are:
+
+lat = chi + (esq/2 + 5e^4/24 + e^6/12 + 13e^8/360) sin(2chi) 
++ (7e^4/48 + 29e^6/240 + 811e^8/11520) sin(4chi)
++ (7e^6/120 +  81e^8/1120) sin(6chi)  + (4279e^8/161280) sin(8chi)
+
+where chi = pi/2 - 2 arctan t
+t = B^((FN-N)/a*k0) 
+B = base of the natural logarithm, 2.7182818...
+and  for the 2 SP Case, k0 is calculated as for the forward transformation above.
+lon  =  ((E - FE)/a*k0)  + lon0","For Projected Coordinate System Pulkovo 1942 / Mercator Caspian Sea
+
+Parameters:
+Ellipsoid  Krassowski 1940   a = 6378245.00m   1/f = 298.300
+then e = 0.08181333 and e^2 = 0.00669342
+
+Latitude first SP                             42o00'00""N = 0.73303829 rad
+Longitude Natural Origin                51o00'00""E = 0.89011792 rad
+False Eastings FE                          0.00 m
+False Northings (at equator) FN     0.00 m
+  
+then natural origin at latitude of 0oN has scale factor k0=  0.74426089
+
+Forward calculation for: 
+Latitude        53o00'00.00""N = 0.9250245 rad
+Longitude     53o00'00.00""E  = 0.9250245 rad
+
+gives Easting E   =     165704.29 m 
+          Northing N =   5171848.07 m
+
+Reverse calculation for same easting and northing first gives :
+t = 0.33639129    chi = 0.92179596
+
+Then Latitude     =  53o00'00.000""N
+          Longitude  =  53o00'00.000""E",,EPSG guidance note #7.,EPSG,1996-09-18 00:00:00,,0
+9806,Cassini-Soldner,1,"The formulas to derive projected Easting and Northing coordinates are:
+
+Easting E = FE + nu[A - TA^3/6 -(8 - T + 8C)TA^5/120]
+
+Northing N = FN + M - M0 + nu*tan(lat)*[A^2/2 + (5 - T + 6C)A^4/24]
+
+where A = (lon - lon0)cos(lat)
+T = tan^2(lat)
+C = e2 cos2*/(1 - e2)        nu = a /(1 - esq*sin^2(lat))^0.5 
+and M, the distance along the meridian from equator to latitude lat, is given by
+M = a[1 - e^2/4 - 3e^4/64 - 5e^6/256 -....)*lat - (3e^2/8 + 3e^4/32 + 45e^6/1024 +....)sin(2*lat) + (15e^4/256 + 45e^6/1024 +.....)sin(4*lat) - (35e^6/3072 + ....)sin(6*lat) + .....]
+with lat in radians.
+
+M0 is the value of M calculated for the latitude of the chosen origin. This may not necessarily be chosen as the equator.
+
+To compute latitude and longitude from Easting and Northing the reverse formulas are:
+lat = lat1 - (nu1tan(lat1)/rho1)[D2/2 - (1 + 3*T1)D^4/24]
+lon =  lon0 + [D - T1*D^3/3 + (1 + 3*T1)T1*D^5/15]/cos(lat1)
+
+where lat1 is the latitude of the point on the central meridian which has the same Northing as the point whose coordinates are sought, and is found from:
+lat1 = mu1 + (3*e1/2 - 27*e1^3/32 +.....)sin(2*mu1) + (21*e1^2/16 - 55*e1^4/32 + ....)sin(4*mu1)+ (151*e1^3/96 +.....)sin(6*mu1) + (1097*e1^4/512 - ....)sin(8*mu1) + ......
+where
+e1 = [1- (1 - esq)^0.5]/[1 + (1 - esq)^0.5]
+mu1 = M1/[a(1 - esq/4 - 3e^4/64 - 5e^6/256 - ....)]
+M1 = M0 + (N - FN)
+T1 = tan^2(lat1)
+D = (E - FE)/nu1","For Projected Coordinate System Trinidad 1903 / Trinidad Grid 
+Parameters:
+Ellipsoid   Clarke 1858     a = 20926348 ft    = 31706587.88 links
+                                        b = 20855233 ft
+
+then 1/f = 294.97870 and e^2 = 0.00676866
+
+Latitude Natural Origin       10o26'30""N  =  0.182241463 rad
+Longitude Natural Origin    61o20'00""W = -1.07046861 rad
+False Eastings FE              430000.00 links
+False Northings FN            325000.00 links
+
+Forward calculation for: 
+Latitude       10o00'00.00"" N = 0.17453293 rad
+Longitude    62o00'00.00""W = -1.08210414 rad
+
+A = -0.01145876      C = 0.00662550
+T = 0.03109120      M = 5496860.24    nu = 31709831.92     M0 = 5739691.12
+
+Then Easting E    =  66644.94 links
+          Northing N =  82536.22 links
+
+Reverse calculation for same easting and northing first gives :
+e1    =   0.00170207       D  =     -0.01145875
+T1   = 0.03109544         M1 =      5497227.34
+nu1  = 31709832.34       mu1 =    0.17367306
+phi1 = 0.17454458         rho1 =    31501122.40
+
+
+Then Latitude     = 10o00'00.000""N
+         Longitude  =  62o00'00.000""W",,EPSG guidance note #7.,EPSG,1996-09-18 00:00:00,,0
+9807,Transverse Mercator,1,"The formulas to derive the projected Easting and Northing coordinates are in the form of a series as follows:
+
+Easting, E =  FE + k0*nu[A + (1 - T + C)A^3/6 + (5 - 18T + T^2 + 72C - 58e'sq)A^5/120]	
+
+Northing, N =  FN + k0{M - M0 + nu*tan(lat)[A^2/2 + (5 - T + 9C + 4C^2)A^4/24 + (61 - 58T + T^2 + 600C - 330e'sq)A^6/720]} 
+where T = tan^2(lat)                nu = a /(1 - esq*sin^2(lat))^0.5
+C = esq*cos^2(lat)/(1 - esq)
+A = (lon - lon0)cos(lat), with lon and lon0 in radians.
+M = a[(1 - esq/4 - 3e^4/64 - 5e^6/256 -....)lat - (3esq/8 + 3e^4/32 + 45e^6/1024+....)sin(2*lat) + (15e^4/256 + 45e^6/1024 +.....)sin(4*lat) - (35e^6/3072 + ....)sin(6*lat) + .....]
+with lat in radians and M0 for lat0, the latitude of the origin, derived in the same way.
+
+The reverse formulas to convert Easting and Northing projected coordinates to latitude and longitude are:
+
+lat = lat1 - (nu1*tan(lat1)/rho1)[D^2/2 - (5 + 3*T1 + 10*C1 - 4*C1^2 - 9*e'^2)D^4/24 + (61 + 90*T1 + 298*C1 + 45*T1^2 - 252*e'^2 - 3*C1^2)D^6/720]
+lon = lon0 + [D - (1 + 2*T1 + C1)D^3/6 + (5 - 2*C1 + 28*T1 - 3*C1^2 + 8*e'^2 + 24*T1^2)D^5/120] / cos(lat1)
+where lat1 may be found as for the Cassini projection from:
+
+lat1 = mu1 + ((3*e1)/2 - 27*e1^3/32 +.....)sin(2*lat1) + (21*e1^2/16 -55*e1^4/32 + ....)sin(4*lat1)+ (151*e1^3/96 +.....)sin(6*lat1) + (1097*e1^4/512 - ....)sin(8*lat1) + ......
+and where  nu1 = a /(1 - esq*sin^2(lat1))^0.5                                     rho1 = a(1 - esq)/(1 - esq*sin^2(lat1))^1.5
+e1 = [1- (1 - esq)^0.5]/[1 + (1 - esq)^0.5]
+mu1 = M1/[a(1 - esq/4 - 3e^4/64 - 5e^6/256 - ....)]
+M1 = M0 + (N - FN)/k0
+T1 = tan^2(lat1)
+C1 = e'^2*cos^2(lat1)
+D = (E - FE)/(nu1*k0), with nu1 = nu for lat1
+
+For areas south of the equator the value of latitude lat will be negative and the formulas above, to compute the E and N,  will automatically result in the correct values. Note that the false northings of the origin, if the equator, will need to be large to avoid negative northings and for the UTM projection is in fact 10,000,000m. Alternatively, as in the case of Argentina's Transverse Mercator (Gauss-Kruger) zones, the origin is at the south pole with a northings of zero. However each  [...]
+different zones having the same eastings, every point in the country, irrespective of its projection zone, will have a unique set of projected system coordinates. Strict application of the above formulas, with south latitudes negative, will result in the derivation of the correct Eastings and Northings. 
+
+Similarly, in applying the reverse formulas to determine a latitude south of the equator, a negative sign for lat results from a negative lat1 which in turn results from a negative M1.","For Projected Coordinate System OSGB 1936 / British National Grid
+
+Parameters:
+Ellipsoid  Airy 1830  a = 6377563.396 m  1/f = 299.32496
+then e'^2 = 0.00671534 and e^2 = 0.00667054
+
+Latitude Natural Origin         49o00'00""N   = 0.85521133 rad
+Longitude Natural Origin        2o00'00""W  = -0.03490659 rad
+Scale factor ko                     0.9996013                                                                                              False Eastings FE                 400000.00 m
+False Northings FN              -100000.00 m
+
+Forward calculation for: 
+Latitude       50o30'00.00""N  = 0.88139127 rad
+Longitude    00o30'00.00""E  = 0.00872665 rad
+A  = 0.02775415       C = 0.00271699
+T =  1.47160434       M = 5596050.46
+M0 = 5429228.60     nu  = 6390266.03
+
+Then Easting E =        577274.99 m
+          Northing N =       69740.50 m
+
+Reverse calculations for same easting and northing first gives :
+e1 =    0.00167322      mu1 = 0.87939562
+M1 = 5599036.80        nu1 = 6390275.88
+phi1  = 0.88185987      D = 0.02775243
+rho1 =6372980.21       C1 =  0.00271391
+T1 = 1.47441726
+
+Then Latitude       = 50o30'00.000""N
+         Longitude    = 00o30'00.000""E",,EPSG guidance note #7.,EPSG,1996-09-18 00:00:00,,0
+9808,Transverse Mercator (South Orientated),1,"For the mapping of southern Africa a south oriented Transverse Mercator projection is used. Here the coordinate axes are called Westings and Southings and increment to the West and South from the origin respectively.  The standard Transverse Mercator formulas (coordinate operation method code 9807) need to be modified to cope with this arrangement with
+
+Westing, W = FE - k0 nu[A + (1 - T + C)A^3/6 + (5 - 18*T + T^2 + 72*C - 58*e'^2)A^5/120]
+
+Southing, S = FN - k0{M - M0 + nu*tan(lat)*[A^2/2 + (5 - T + 9*C + 4*C^2)A^4/24 + (61 - 58*T + T^2 + 600*C - 330*e'^2)A^6/720]}
+
+In these formulas the terms FE and FN retain their definition, i.e. in the Transverse Mercator (South Orientated) method they increase the Westing and Southing value at the natural origin. In this method they are effectively false westing (FW) and false southing (FS) respectively.
+
+For the reverse formulas, those for the standard Transverse Mercator above apply, with the exception that:
+
+M1 = M0 - (S - FN)/k0
+and D = -(W - FE)/(nu1*k0), with nu1 = nu for lat1",,,EPSG guidance note #7.,EPSG,2002-07-31 00:00:00,2002.51,0
+9809,Oblique Stereographic,1,"Given the geodetic origin of the projection at the tangent point (lat0, lon0), the parameters defining the conformal sphere are:
+
+R= sqrt( rho0 * nu0)
+n=  sqrt{1+[(e2*cos^4(lat0))/(1-e2)}
+c=  [(n+sin(lat0)) (1-sin(chi0))]/[(n-sin(lat0)) (1+sin(chi0))]
+
+where:	sin(chi0) = (w1-1)/(w1+1)
+w1 = (S1.(S2)^e)^n
+S1 = (1+sin(lat0))/(1-sin(lat0))
+S2 = (1-e sin(lat0))/(1+e sin(lat0))
+
+The conformal latitude and longitude (chi0,lambda0) of the origin are then computed from :
+
+chi0 = asin[(w2-1)/(w2+1)]
+
+where S1 and S2 are as above and  w2 = c (S1(S2)^e)^n
+ 
+lambda0  = lon0
+
+For any point with geodetic coordinates (lat, lon) the equivalent conformal latitude and longitude (chi, lambda) are computed from 
+lambda = n(lon-lambda0) + lambda0
+chi = asin[(w-1)/(w+1)]
+
+where w = c (Ss (Sb)^e)^n
+Sa = (1+sin(lat))/(1-sin(lat))
+Sb = (1-e.sin(lat))/(1+e.sin(lat))
+ 
+Then B = [1+sin(chi) sin(chi0) + cos(chi) cos(chi0) cos(lambda-lambda0)]
+
+N = FN + 2 R k0 [sin(chi) cos(chi0) - cos(chi) sin(chi0) cos(lambda-lambda0)] / B
+
+E = FE + 2 R k0 cos(chi) sin(lambda-lambda0) / B
+
+
+The reverse formulae to compute the geodetic coordinates from the grid coordinates involves computing the conformal values, then the isometric latitude and finally the geodetic values.
+
+The parameters of the conformal sphere and conformal latitude and longitude at the origin are computed as above. Then for any point with Stereographic grid coordinates (E,N) :
+
+chi = chi0 + 2 atan[{(N-FN)-(E-FE) tan (j/2)} / (2 R k0)]
+
+lambda = j + 2 i + lambda0
+
+where g = 2 R k0 tan(pi/4 - chi0/2)
+h = 4 R k0 tan(chi0) + g
+i = atan[(E-FE) / {h+(N-FN)}]
+j = atan[(E-FE) / (g-(N-FN)] - i
+
+Geodetic longitude lon = (lambda-lambda0 ) / n +  lambda0
+
+Isometric latitude psi = 0.5 ln [(1+ sin(chi)) / { c (1-  sin(chi))}] / n
+
+First approximation lat1 = 2 atan(e^psi)  - pi/2  where e=base of natural logarithms.
+
+psii = isometric latitude at lati
+
+where psii= ln[{tan(lati/2 + pi/4}  {(1-e sin(lati))/(1+e sin(lati))}^(e/2)]
+ 
+Then iterate lat(i+1) = lati - ( psii - psi ) cos(lati) (1 -e^2 sin^2(lati)) / (1 - e^2)
+
+until the change in lat is sufficiently small.
+
+For Oblique Stereographic projections centred on points in the southern hemisphere,  the signs of E, N, lon0, lon,  must be reversed to be used in the equations and lat will be negative anyway as a southerly latitude.
+
+An alternative approach is given by Snyder, where, instead of defining a single conformal sphere at the origin point, the conformal latitude at each point on the ellipsoid is computed.  The conformal longitude is then always equivalent to the geodetic longitude.  This approach is a valid alternative to the above, but gives slightly different results away from the origin point. It is therefore considered by EPSG to be a different coordinate operation method to that described above.","For  [...]
+
+Parameters:
+Ellipsoid   Bessel 1841    a = 6377397.155 m    1/f = 299.15281
+then e = 0.08169683
+
+Latitude Natural Origin      52o09'22.178""N  = 0.910296727 rad
+Longitude Natural Origin     5o23'15.500""E  =  0.094032038 rad
+Scale factor k0                 0.9999079
+False Eastings FE             155000.00 m
+False Northings FN           463000.00 m
+
+Forward calculation for: 
+
+Latitude    53oN = 0.925024504 rad
+Longitude   6oE = 0.104719755 rad
+
+first gives the conformal sphere constants:
+
+rho0 = 6374588.71    nu0 = 6390710.613
+R = 6382644.571    n = 1.000475857    c  = 1.007576465
+
+where S1 = 8.509582274  S2 = 0.878790173  w1 = 8.428769183
+sin chi0 = 0.787883237
+
+w   = 8.492629457   chi0 = 0.909684757      D0 = d0 
+
+for the point  chi  = 0.924394997    D = 0.104724841
+
+hence B = 1.999870665    N = 557057.739    E = 196105.283
+
+reverse calculation for the same Easting and Northing first gives:
+
+g = 4379954.188    h = 37197327.96   i = 0.001102255   j = 0.008488122
+
+then  D = 0.10472467  Longitude = 0.104719584 rad =  6 deg E
+
+chi  = 0.924394767    psi = 1.089495123
+phi1 = 0.921804948       psi1 = 1.084170164
+phi2 = 0.925031162       psi2 = 1.089506925
+phi3 = 0.925024504       psi3 = 1.089495505
+phi4 = 0.925024504
+
+Then Latitude      = 53o00'00.000""N
+          Longitude   =   6o00'00.000""E","This is not the same as the projection method of the same name in USGS Professional Paper no. 1395, ""Map Projections - A Working Manual"" by John P. Snyder.",EPSG guidance note #7.,EPSG,1999-11-15 00:00:00,99.811,0
+9810,Polar Stereographic,1,"For the forward transformation from latitude and longitude,
+
+E = FE + rho sin(lon - lon0)
+N = FN - rho cos(lon - lon0)
+where
+rho = 2 a ko t /{[((1+e)^(1+e)) ((1-e)^(1-e))]^0.5}
+t = tan (pi/4 - lat/2) / [(1-esin(lat) ) / (1 + e sin(lat))]^(e/2)
+
+For the reverse transformation,
+
+lat = chi+ (e^2/2 + 5e^4/24 + e^6/12 + 13e^8/360) sin(2 chi) 
++ (7e^4/48 + 29e^6/240 + 811e^8/11520) sin(4 chi)
++ (7e^6/120 +  81e^8/1120) sin(6 chi)  + (4279e^8/161280) sin(8 chi)
+
+lon = lon0+ arctan [(E-FE) / (FN-N)]
+
+where chi  = pi/2 - 2 arctan t
+t   =  rho [((1+e)^(1+e)) ((1-e)^(1-e))]^0.5} / 2 a ko
+rho = [(E-FE)^2  + (N - FN)^2]^0.5",,,"US Geological Survey Professional Paper 1395; ""Map Projections - A Working Manual"";  J. Snyder",EPSG,1996-09-18 00:00:00,,0
+9811,New Zealand Map Grid,1,b,,,New Zealand Department of Lands technical circular 1973/32,EPSG,1996-09-18 00:00:00,,0
+9812,Hotine Oblique Mercator,1,"The following constants for the projection may be calculated :
+
+B = (1 + esq * cos^4(latc) / (1 - esq ))^0.5
+A = a * B * kc *(1 - esq )^0.5 / ( 1 - esq * sin^2(latc))
+t0 = tan(pi/4 - latc/2) / ((1 - e*sin(latc)) / (1 + e*sin(latc)))^(e/2)
+D = B (1 - esq)^0.5  / (cos(latc) * ( 1 - esq*sin^2(latc))^0.5)
+if D < 1 to avoid problems with computation of F make D^2  = 1 
+F = D + (D^2 - 1)^0.5  * SIGN(latc)
+H = F* t0*B
+G = (F - 1/F) / 2
+gamma0 = asin(sin(alphac) / D)
+lon0 = lonc - (asin(G*tan(gamma0))) / B
+
+Then compute the (uc , vc) co-ordinates for the centre point (fc , lc).
+vc =0
+
+In general: uc = (A / B) atan((Dsq - 1)^0.5 / cos (alphac) ) * SIGN(latc)
+but for the special cases where alphac = 90 degrees then 
+uc = A*(lonc - lon0)  
+
+ 
+Forward case: To compute (E,N) from a given (lat,lon) :
+
+t = tan(pi/4 - lat/2) / ((1 - e sin (lat)) / (1 + e sin (lat)))^(e/2)
+Q = H / t^B
+S = (Q - 1 / Q) / 2
+T = (Q + 1 / Q) / 2
+V = sin(B (lon - lon0))
+U = (- V cos(gamma0) + S sin(gamma0)) / T
+v = A ln((1 - U) / (1 + U)) / 2 B
+u = A atan((S cos(gamma0) + V sin(gamma0)) / cos(B (lon - lon0 ))) / B
+
+The rectified skew co-ordinates are then derived from:
+E = v cos(gammac) + u sin(gammac) + FE
+N = u cos(gammac) - v sin(gammac) + FN
+
+Reverse case: Compute (lat,lon)  from a given (E,N)  :
+
+v� = (E - FE) cos(gammac) - (N - FN) sin(gammac)
+u� = (N - FN) cos(gammac) + (E - FE) sin(gammac)
+
+Q� = e- (B v �/ A)  where e is the base of natural logarithms.
+S' = (Q� - 1 / Q�) / 2
+T� = (Q� + 1 / Q�) / 2
+V� = sin (B u� / A)
+U� = (V� cos(gammac) + S� sin(gammac)) / T�
+t� = (H / ((1 + U�) / (1 - U�))^0.5)^(1 / B)
+
+chi = pi / 2 - 2 atan(t�)
+
+lat = chi + sin(2chi).( e^2 / 2 + 5*e^4 / 24 + e^6 / 12 + 13*e^8 / 360) +  sin(4*chi).( 7*e^4 /48 + 29*e^6 / 240 + 811*e8 / 11520) +  sin(6chi).( 7*e^6 / 120 + 81*e8 / 1120) +  sin(8chi).(4279 e^8 / 161280)
+
+lon=  lon0  - atan ((S� cos(gammac) - V� sin(gammac)) / cos(B*u� / A)) / B","For Projected Coordinate System  Timbalai 1948 / R.S.O. Borneo (m)
+
+Parameters:
+Ellipsoid:  Everest 1830 (1967 Definition)
+a = 6377298.556 metres 1/f = 300.8017
+then e = 0.081472981and e2 = 0.006637847
+
+Latitude Projection Centre fc = 4o00'00""N = 0.069813170 rad
+Longitude Projection Centre lc = 115o00'00""E = 2.007128640 rad
+Azimuth of central line ac = 53o18'56.9537"" = 0.930536611 rad
+Rectified to skew gc= 53o07'48.3685"" = 0.927295218 rad
+Scale factor ko= 0.99984
+False Eastings FE = 0.00 m
+False Northings FN = 0.00 m
+
+Forward calculation for: 
+Latitude lat = 5o23'14.1129""N = 0.094025313 rad
+Longitude lon = 115o48'19.8196""E = 2.021187362 rad
+
+B = 1.003303209            F = 1.072121256
+A =6376278.686            H = 1.000002991
+to = 0.932946976          g0 = 0.927295218
+D = 1.002425787           lon0 = 1.914373469
+D2 =1.004857458
+uc =738096.09              vc =0.00
+
+t =0.910700729             Q =1.098398182
+S =0.093990763            T = 1.004407419
+V =0.106961709            U = 0.010967247
+v =-69702.787                u =901334.257
+
+Then Easting E =      679245.73 m
+        Northing N =     596562.78 m
+
+Reverse calculations for same easting and northing first gives :
+v� =   -69702.787              u� =901334.257
+Q� = 1.011028053
+S�  = 0.010967907          T� = 1.000060146
+V� = 0.141349378           U� = 0.093578324
+t� = 0.910700729             c = 0.093404829
+
+Then Latitude = 5o23'14.113""N
+         Longitude = 115o48'19.820""E",,EPSG guidance note #7.,EPSG,1999-11-15 00:00:00,97.62  99.811,0
+9813,Laborde Oblique Mercator,1,See information source.,See information source.,Can be accomodated by Oblique Mercator method (code 9815).,"""La nouvelle projection du Service Geographique de Madagascar""; J. Laborde; 1928",EPSG,1996-09-18 00:00:00,97.613,0
+9814,Swiss Oblique Cylindrical,1,See information source.,See information source.,Can be accomodated by Oblique Mercator method (code 9815).,"""Die projecktionen der Schweizerischen Plan und Kartenwerke""; J Bollinger; 1967",EPSG,1996-09-18 00:00:00,97.612,0
+9815,Oblique Mercator,1,"The following constants for the projection may be calculated :
+
+B = (1 + e^2 * cos^4(latc) / (1 - e^2 ))^0.5
+A = a * B * kc *(1 - e^2 )^0.5 / ( 1 - e^2 * sin^2(latc))
+t0 = tan(pi/4 - latc/2) / ((1 - e*sin(latc)) / (1 + e*sin(latc)))^(e/2)
+D = B (1 - e^2)^0.5  / (cos(latc) * ( 1 - e^2*sin^2(latc))^0.5)
+if D < 1 to avoid problems with computation of F make D^2  = 1 
+F = D + (D^2 - 1)^0.5  * SIGN(latc)
+H = F* t0*B
+G = (F - 1/F) / 2
+gamma0 = asin(sin(alphac) / D)
+lon0 = lonc - (asin(G*tan(gamma0))) / B
+vc =0
+In general: uc = (A / B) atan((Dsq - 1)^0.5 / cos (alphac) ) * SIGN(latc)
+but for the special cases where alphac = 90 degrees (e.g. Hungary, Switzerland) then 
+uc = A*(lonc - lon0)  
+
+ 
+Forward case: To compute (E,N) from a given (lat,lon) :
+
+t = tan(pi/4 - lat/2) / ((1 - e sin (lat)) / (1 + e sin (lat)))^(e/2)
+Q = H / t^B
+S = (Q - 1 / Q) / 2
+T = (Q + 1 / Q) / 2
+V = sin(B (lon - lon0))
+U = (- V cos(gamma0) + S sin(gamma0)) / T
+v = A ln((1 - U) / (1 + U)) / 2 B
+u = (A atan((S cos(gamma0) + V sin(gamma0)) / cos(B (lon - lon0 ))) / B) - (uc . SIGN(lon - lonc))
+
+The rectified skew co-ordinates are then derived from:
+E = v cos(gammac) + u sin(gammac) + Ec
+N = u cos(gammac) - v sin(gammac) + Nc
+
+Reverse case: Compute (lat,lon)  from a given (E,N)  :
+
+v� = (E - Ec) cos(gammac) - (N - Nc) sin(gammac)
+u� = (N - Nc) cos(gammac) + (E - Ec) sin(gammac) + uc
+
+Q� = e- (B v �/ A)  where e is the base of natural logarithms.
+S' = (Q� - 1 / Q�) / 2
+T� = (Q� + 1 / Q�) / 2
+V� = sin (B u� / A)
+U� = (V� cos(gammac) + S� sin(gammac)) / T�
+t� = (H / ((1 + U�) / (1 - U�))^0.5)^(1 / B)
+
+chi = pi / 2 - 2 atan(t�)
+
+lat = chi + sin(2chi).( e^2 / 2 + 5*e^4 / 24 + e^6 / 12 + 13*e^8 / 360) +  sin(4*chi).( 7*e^4 /48 + 29*e^6 / 240 + 811*e8 / 11520) +  sin(6chi).( 7*e^6 / 120 + 81*e8 / 1120) +  sin(8chi).(4279 e^8 / 161280)
+
+lon=  lon0  - atan ((S� cos(gammac) - V� sin(gammac)) / cos(B*u� / A)) / B","For Projected Coordinate System  Timbalai 1948 / R.S.O. Borneo (m)
+
+Parameters:
+Ellipsoid:  Everest 1830 (1967 Definition)
+a = 6377298.556 metres 1/f = 300.8017
+then e = 0.081472981and e2 = 0.006637847
+
+Latitude Projection Centre fc = 4o00'00""N = 0.069813170 rad
+Longitude Projection Centre lc = 115o00'00""E = 2.007128640 rad
+Azimuth of central line ac = 53o18'56.9537"" = 0.930536611 rad
+Rectified to skew gc= 53o07'48.3685"" = 0.927295218 rad
+Scale factor ko= 0.99984
+Easting at projection centre Ec = 590476.87 m
+Northing at projection centre Nc = 442857.65 m
+
+Forward calculation for: 
+Latitude lat = 5o23'14.1129""N = 0.094025313 rad
+Longitude lon = 115o48'19.8196""E = 2.021187362 rad
+
+B = 1.003303209            F = 1.072121256
+A =6376278.686            H = 1.000002991
+to = 0.932946976          g0 = 0.927295218
+D = 1.002425787           lon0 = 1.914373469
+D2 =1.004857458
+uc =738096.09              vc =0.00
+
+t =0.910700729             Q =1.098398182
+S =0.093990763            T = 1.004407419
+V =0.106961709            U = 0.010967247
+v =-69702.787                u =163238.163
+
+Then Easting E =      679245.73 m
+        Northing N =     596562.78 m
+
+Reverse calculations for same easting and northing first gives :
+v� =   -69702.787              u� =901334.257
+Q� = 1.011028053
+S�  = 0.010967907          T� = 1.000060146
+V� = 0.141349378           U� = 0.093578324
+t� = 0.910700729             c = 0.093404829
+
+Then Latitude = 5o23'14.113""N
+         Longitude = 115o48'19.820""E",,EPSG guidance note #7.,EPSG,1999-11-15 00:00:00,99.811,0
+9816,Tunisia Mining Grid,1,"This grid is used as the basis for mineral leasing in Tunsia.  Lease areas are approximately 2 x 2 km or 400 hectares.  The corners of these blocks are defined through a six figure grid reference where the first three digits are an easting in kilometres and the last three digits are a northing.  The latitudes and longitudes for block corners at 2 km intervals are tabulated in a mining decree dated 1st January 1953.  From this tabulation in which geographical c [...]
+a)  the minimum easting is 94 km, on which the longitude is 5.68989 grads east of Paris.
+b)  the maximum easting is 490 km, on which the longitude is 10.51515 grads east of Paris.
+c)  each 2 km grid easting interval equals 0.02437 grads.
+d)  the minimum northing is 40 km, on which the latitude is 33.39 grads.
+e)  the maximum northing is 860 km, on which the latitude is 41.6039 grads.
+f)  between 40 km N and 360 km N, each 2 km grid northing interval equals 0.02004 grads.
+g)  between 360 km N and 860 km N, each 2 km grid northing interval equals 0.02003 grads.
+
+Formulae are:
+
+Grads from Paris
+
+Lat (grads) = 36.5964 + [(N - 360) * A] 
+where N is in kilometres and A = 0.010015 if N > 360, else A = 0.01002.
+
+LonParis (grads) = 7.83445 + [(E - 270) * 0.012185], where E is in kilometres.
+
+The reverse formulae are:
+
+E (km) = 270 + [(LonParis - 7.83445) / 0.012185] where LonParis is in grads.
+
+N (km) = 360 + [(Lat - 36.5964) / B] 
+where Lat is in grads and B = 0.010015  if  lat>36.5964, else B = 0.01002.
+
+Degrees from Greenwich.
+
+Modern practice in Tunisia is to quote latitude and longitude in degrees with longitudes referenced to the Greenwich meridian.  The formulae required in addition to the above are:
+
+Lat (degrees) =  (Latg * 0.9) where Latg is in grads.
+LonGreenwich (degrees) = [(LonParis + 2.5969213) * 0.9] where LonParis is in grads.
+
+
+Lat (grads) =  (Latd / 0.9) where Latd is in decimal degrees.
+LonParis (grads) = [(LonGreenwich / 0.9) - 2.5969213)] where LonGreenwich is in decimal degrees.","For grid location 302598,
+Latitude = 36.5964 + [(598 - 360) * A].  As N > 360, A = 0.010015.
+Latitude = 38.97997 grads = 35.08197 degrees.
+
+Longitude  = 7.83445 + [(E - 270) * 0.012185, where E = 302.
+Longitude  = 8.22437 grads east of Paris = 9.73916 degrees east of Greenwich.",,EPSG guidance note #7.,EPSG,2000-03-07 00:00:00,99.811  2000.08,0
+9817,Lambert Conic Near-Conformal,1,"To compute the Lambert Conic Near-Conformal the following formulae are used;
+
+E = FE + r sin(theta)
+N = FN + M + r sin(theta) tan(theta/2) using the natural origin rather than the false origin.
+
+Compute constants for the ellipse:
+
+n = (a-b)/(a+b)  
+A� = a [ 1- n + 5 (n^2 - n^3 ) / 4 + 81 ( n^4 - n^5 ) / 64]*pi /180 
+B� = 3 a [ n - n^2 + 7 ( n^3 - n^4 ) / 8 + 55 n^5 / 64] / 2
+C� = 15 a [ n^2 -n^3 + 3 ( n^4 - n^5 ) / 4 ] / 16
+D� = 35 a [ n^3 - n^4 + 11 n^5 / 16 ] / 48
+E� = 315 a [ n^4 - n^5 ] / 512
+
+Then compute the meridional arc from the equator to the parallel.
+s0 = A� lat0 - B� sin(2 lat0) + C� sin(4 lat0) - D� sin(6 lat0) + E� sin(8 lat0) where lat0 in the first term is in degrees
+s0 = A� lat - B� sin(2 lat) + C� sin(4 lat) - D� sin(6 lat) + E� sin(8 lat) where lat0 in the first term is in degrees
+m = s - s0
+A = 1 / (6 rho0 nu0) 
+M = ko ( m + A m^3.  This is the term that is truncated to the third order.
+Ms = M per second of arc = M / ((lat - lat0) * 3600)
+
+theta = (lon - lon0) sin(lat0)
+ro = ko nu0 / tan(lat0)
+r = ro - M
+
+The reverse formulas for lat and lon  from E and N with r0 and Ms as above:
+
+lat  = M�/ (Ms * 3600) + lat0   where lat0 and lat are in degrees
+lon  =  lon0 + theta� / sin(lat0)  where lont0 and lon are in radians
+
+where
+E� = E - FE              N� = N - FN
+theta� = arctan [E� / (r0 - N�)]
+r� = E� / sin(theta�) 
+M� = r0 - r'","For Projected Coordinate System: Deir ez Zor / Levant Zone
+
+Parameters:
+Ellipsoid  Clarke 1880 (IGN)  a = 6378249.2 m  1/f = 293.46602
+then b = 6356515.000    n = 0.001706682563
+
+Latitude Natural Origin  = 34o 39'00"" N = 0.604756586 rad
+Longitude Natural Origin = 37o 21'00"" E=  0.651880476 rad
+Scale factor at origin ko = 0.99962560
+False Eastings FE  = 300000.00 m
+False Northings FN  = 300000.00 m
+
+Forward calculation for: 
+Latitude of 37d 31' 17.625"" N = 0.654874806 rad
+Longitude of 34d 08' 11.291"" E = 0.595793792 rad
+first gives
+A = 4.1067494 * 10e-15      A�=111131.8633
+B�= 16300.64407     C�= 17.38751     D�= 0.02308      E�= 0.000033
+so = 3835482.233    s  = 4154101.458     m = 318619.225
+M = 318632.72         Ms = 30.82262319
+q = -0.03188875       ro = 9235264.405     r = 8916631.685
+
+Then Easting E =   15707.96 m (c.f. E =   15708.00 using full formulae)
+         Northing N =      623165.96 m (c.f. N = 623167.20 using full formulae)
+
+Reverse calculation for the same easting and northing first gives
+
+q' = -0.03188875
+r�  =  8916631.685
+M�= 318632.72 
+
+Latitude =      0.654874806 rad = 37d 31' 17.625"" N
+Longitude = 0.595793792 rad =  34d 08' 11.291"" E",The Lambert Near-Conformal projection is derived from the Lambert Conformal Conic projection by truncating the series expansion of the projection formulae.,EPSG guidance note #7.,EPSG,1999-11-15 00:00:00,99.811,0
+9818,American Polyconic,1,See information source.,,See information source for formula and example.,"US Geological Survey Professional Paper 1395; ""Map Projections - A Working Manual"";  J. Snyder",EPSG,1999-10-20 00:00:00,99.55,0
+9819,Krovak Oblique Conic Conformal,1,"From the defining parameters the following constants for the projection may be calculated :
+
+B=((1 + e^2 cos^4(latC)) / (1 - e^2 ))^0.5
+A=a (1 - e^2 )^0.5 / ( 1 - e^2 sin^2 (latC))
+gamma0=asin(sin (latC) / B)
+t0 =tan(pi / 4 + gamma0 / 2) . ((1 + e sin(latC)) / (1 - e sin (latC)))^(e.B/2) / tan(pi / 4 + latC/ 2)^B
+n = sin lat1
+r0=kc  A / tan (lat1)
+
+To derive the projected Southing and Westing coordinates of a point with geographical coordinates (lat, lon) the formulas for the oblique conic conformal are:
+
+Southing:    X  = Ec + r cos theta
+Westing:     Y = Nc + r sin theta
+ 
+where
+
+U=2 (atan ( k tan^B (lat/2 + pi / 4 ) ((1 + e sin (lat)) / (1 - e sin (lat)))^(e.B/2 )) - pi / 4)
+V=B (lonc -  lon)
+S=asin ( cos (alphaC) sin ( U ) + sin (alphaC) cos (U) cos (V) )
+D=asin ( cos ( U ) sin ( V ) / cos ( S ) )
+theta=n D
+r=r0 tan(pi / 4 + gamma0/ 2) / tan^n ( S/2 + pi / 4 )
+
+The reverse formulas to derive the latitude and longitude of a point from its Southing and Westing values are:
+
+latj = 2*(atan(k^(-1/B) tan^(1/B) ( U�/2 + pi / 4 ) ((1 + e sin ( lat j-1) / (1 - e sin ( latj-1))^(e/2) ) - pi / 4) 
+where j = 1,2 and the latitude is found by iteration.
+lon = lonc - V' / B
+where
+r' =[(X - Ec)^2 + (Y - Nc)^2]^(1/2)  
+theta'=arctan [(X- Ec)/(Y- Nc)]
+D'=theta' / sin ( lat1)
+S'=2*(atan((r0 / r )^(1/n) tan(pi / 4 + lat0/ 2)) - pi / 4)
+U'=asin ( cos (alphaC) sin ( S' ) - sin (alphaC) cos (S') cos (D') )
+V'=asin ( cos (S') sin (D') / cos (U'))","For Projected Coordinate Reference System: S-JTSK (Ferro) / Krovak
+
+N.B. Krovak projection uses Ferro as the prime meridian. This has a longitude with reference to Greenwich of 17 deg 40 min West. To apply the formulae the defining longitudes must be corrected to the Greenwich meridian.
+
+Parameters:
+Ellipsoid  Bessel 1841   a = 6377397.155m  1/f = 299.15281
+    then    e = 0.081696831        e2 = 0.006674372
+
+Latitude of projection centre = 49o 30'00"" N =  0.604756586 rad
+Longitude of Origin = 42o 30'00"" East of Ferro
+Longitude of Ferro is 17o 40'00"" West of Greenwich
+Longitude of Origin = 24o 50'00"" East of Greenwich = 0.433423431   rad
+Latitude of pseudo standard parallel = 78o 30'00"" N
+Azimuth of centre line = 30o 17' 17.303""
+Scale factor on pseudo Standard Parallel (ko) = 0.99990
+Easting at projection centre (Ec) = 0.00 m
+Northing  at projection centre = 0.00 m
+
+Projection constants:
+B=1.000597498
+A=6380703.61
+*gamma0=0.863239103
+t0=1.003419164
+n= 0.979924705
+r0=1298039.005
+
+Forward calculation for: 
+Latitude = 50o 12' 32.4416"" N = 0.876312566 rad
+Longitude = 16o 50' 59.1790"" E = 0.294083999 rad
+
+Gives
+
+U=0.875596949
+V=0.139422687
+S=1.386275049
+D=0.506554623
+theta=0.496385389
+r0=1194731.014
+
+Then Southing X =  1050538.643 m
+         Westing  Y =    568990.997 m
+
+Reverse calculation for the same Southing and Westing gives
+
+r' =1194731.014
+theta' =0.496385389
+D'=0.506554623
+S'=1.386275049
+U'=0.875596949
+V'=0.139422687
+lat(iteration 1)=0.876310601 
+lat(iteration 2)=0.876312560
+lat(iteration3)=0.876312566
+
+Latitude = 0.876312566 rad = 50o 12' 32.4416"" N
+Longitude = 0.595793792 rad = 16o 50' 59.1790"" E",,Research Institute for Geodesy Topography and Cartography (VUGTK); Prague.,EPSG,2000-03-07 00:00:00,,0
+9820,Lambert Azimuthal Equal Area,1,See information source or EPSG Guidance Note 7.,See information source.,This is the ellipsoidal form of the projection.,"USGS Professional Paper 1395, ""Map Projections - A Working Manual"" by John P. Snyder.",EPSG,2001-06-05 00:00:00,,0
+9821,Lambert Azimuthal Equal Area (Spherical),1,See information source.,See information source.,This is the spherical form of the projection.  See coordinate operation method Lambert Azimuthal Equal Area (code 9820) for ellipsoidal form.  Differences of several tens of metres result from comparison of the two methods.,"USGS Professional Paper 1395, ""Map Projections - A Working Manual"" by John P. Snyder.",EPSG,2001-06-05 00:00:00,,0
+9822,Albers Equal Area,1,See information source or EPSG Guidance Note 7.,See Information Source.,,"USGS Professional Paper 1395, ""Map Projections - A Working Manual"" by John P. Snyder.",EPSG,2001-06-05 00:00:00,,0
+9823,Equidistant Cylindrical,1,"This method has one of the simplest formulas available. If the latitude of natural origin (*O) is at the equator the method is also known as Plate Carr�e. It is not used for rigorous topographic mapping because its distortion characteristics are unsuitable. Formulas are included to distinguish this map projection method from an approach sometimes mistakenly called by the same name and used for simple computer display of geographic coordinates � see Pseudo  [...]
+
+For the forward calculation:
+
+X =  R . (lon - lonO) . cos(latO)
+Y =  R .  lat
+
+where R = [a^2 * (1 �  e^2)]^0.5
+and lat and lon are expressed in radians.
+
+For the reverse calculation:
+
+lat = Y / R  
+lon = lonO + (X / R cos(latO))
+
+where R is as for the forward method.",See information source.,"If the latitude of natural origin is at the equator, also known as Plate Carr�e. See also Pseudo Plate Carree, method code 9825.","US Geological Survey Professional Paper 1395; ""Map Projections - A Working Manual"";  J. Snyder.",EPSG,2001-11-06 00:00:00,,0
+9824,Transverse Mercator Zoned Grid System,1,"The standard Transverse Mercator formulas (coordinate operation method 9807) are modified as follows:
+
+Zone number, Z, = int((Long + LongI + W) / W)  with Long,  LongI and W in degrees. 
+where (LongI) is the Initial Longitude of the zoned grid system
+and W is the width of each zone of the zoned grid system.
+If Long < 0, Long = (Long + 360) degrees.
+
+Then,
+   Long0  = [Z * W] � [LongI + (W/2)]
+
+For the forward calculation,
+   Easting, E =  Z*10^6 + FE + k0.nu[A + (1 - T + C)A^3/6 + (5 - 18T + T^2 + 72C - 58e'^2)A^5/120]
+   
+and in the reverse calculation for longitude, 
+   D = (E � [FE + Z*10^6])/(nu1.k0)",,If locations fall outwith the fixed zones the general Transverse Mercator method (code 9807) must be used for each zone.,EPSG Guidance Note #7.,EPSG,2001-06-05 00:00:00,,0
+9825,Pseudo Plate Carree,1,"X = Lon
+Y = Lat
+
+Lat = Y
+Lon = X",,"Used only for depiction of graticule (latitude/longitude) coordinates on a computer display. The axes units are decimal degrees and of variable scale. The origin is at Lat = 0, Long = 0. See Equidistant Cylindrical, code 9823, for proper Plate Carr�e.",EPSG,EPSG,2001-11-06 00:00:00,,0
+9826,Lambert Conic Conformal (West Orientated),1,"In older mapping of Denmark and Greenland the Lambert Conic Conformal is used with axes positive north and west. To derive the projected Westing and Northing coordinates of a point with geographical coordinates (Lat, Lon) the formulas are as for the standard Lambert Conic Conformal (1SP) case (coordinate operation method code 9801) except for:
+
+W =  FE � r.sin(theta)
+
+In this formula the term FE retains its definition, i.e. in the Lambert Conic Conformal (West Orientated) method it increases the Westing value at the natural origin. In this method it is effectively false westing (FW).
+
+The reverse formulas to derive the latitude and longitude of a point from its Westing and Northing values are as for the standard Lambert Conic Conformal (1SP) case except for:
+
+theta' = arctan[(FE � W)/{r0 � (N � FN)}]
+r' = +/-[(FE � W)^2 + {r0 � (N � FN)}^2]^0.5",,,EPSG guidance note #7.,EPSG,2002-01-16 00:00:00,,0
+9827,Bonne,1,See information source or EPSG Guidance Note 7.,See information source.,,"US Geological Survey Professional Paper 1395, ""Map Projections - A Working Manual"" by John P Snyder.",EPSG,2002-07-13 00:00:00,,0
+9828,Bonne (South Orientated),1,See EPSG Guidance Note 7.,,,EPSG Guidance Note number 7.,EPSG,2002-07-13 00:00:00,,0
diff --git a/src/tiff/csv/coordinate_operation_parameter.csv b/src/tiff/csv/coordinate_operation_parameter.csv
new file mode 100644
index 0000000..f1d0880
--- /dev/null
+++ b/src/tiff/csv/coordinate_operation_parameter.csv
@@ -0,0 +1,99 @@
+"PARAMETER_CODE","PARAMETER_NAME","DESCRIPTION","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","DEPRECATED"
+8601,Latitude offset,The difference between the latitude values of a point in the target and source coordinate reference systems.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8602,Longitude offset,The difference between the longitude values of a point in the target and source coordinate reference systems.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8603,Vertical Offset,The difference between the height or depth values of a point in the target and source coordinate reference systems.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8604,Geoid undulation,"The height of the geoid above a specified ellipsoid.  Indicated by symbol N.  Usually interpolated within a geoid model.
+N = h - H, where h is the height above the ellipsoid and H is the gravity-related height.",EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8605,X-axis translation,The difference between the X values of a point in the target and source coordinate reference systems.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8606,Y-axis translation,The difference between the Y values of a point in the target and source coordinate reference systems.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8607,Z-axis translation,The difference between the Z values of a point in the target and source coordinate reference systems.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8608,X-axis rotation,"The angular difference between the Y and Z axes directions of target and source coordinate reference systems. This is a rotation about the X axis as viewed from the origin looking along that axis. The particular method defines which direction is positive, and what is being rotated (point or axis).",EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8609,Y-axis rotation,"The angular difference between the X and Z axes directions of target and source coordinate reference systems. This is a rotation about theY axis as viewed from the origin looking along that axis. The particular method defines which direction is positive, and what is being rotated (point or axis).",EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8610,Z-axis rotation,"The angular difference between the X and Y axes directions of target and source coordinate reference systems. This is a rotation about the Z axis as viewed from the origin looking along that axis. The particular method defines which direction is positive, and what is being rotated (point or axis).",EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8611,Scale difference,"The scale difference increased by unity equals the ratio of an the length of an arbitrary distance between two points in target and source coordinate reference systems.  This is usually averaged for the intersection area of the two coordinate reference systems. 
+
+If a distance of 100 km in the source coordinate reference system translates into a distance of 100.001 km in the target coordinate reference system, the scale difference is 1 ppm (the ratio being 1.000001).",EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8612,Scale factor for source coordinate reference system first axis,"The unit of measure of the source coordinate reference system first axis, expressed in the unit of measure of the target coordinate reference system.",EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8613,Scale factor for source coordinate reference system second axis,"The unit of measure of the source coordinate reference system second axis, expressed in the unit of measure of the target coordinate reference system",EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8614,Rotation angle of source coordinate reference system axes,"Angle (counter-clockwise positive) through which both of the source coordinate reference system axes need to rotated to coincide with the corresponding target coordinate reference system axes.  
+
+Alternatively, the bearing (clockwise positive) of the source coordinate reference system YS-axis measured relative to target coordinate reference system north.",EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8615,Rotation angle of source coordinate reference system first axis,Angle (counter-clockwise positive) through which the source coordinate reference system's first axis needs to rotated to coincide with the corresponding axis of the target coordinate reference system.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8616,Rotation angle of source coordinate reference system second axis,Angle (counter-clockwise positive) through which the source coordinate reference system's second axis needs to rotated to coincide with the corresponding axis of the target coordinate reference system.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8617,Ordinate 1 of evaluation point,The value of the first ordinate value of the evaluation point.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8618,Ordinate 2 of evaluation point,The value of the second ordinate of the evaluation point.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8619,Ordinate 1 of evaluation point in source CRS,The value of the first ordinate of the evaluation point expressed in the source coordinate reference system.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8620,Ordinate 2 of evaluation point in source CRS,The value of the second ordinate of the evaluation point expressed in the source coordinate reference system.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8621,Ordinate 1 of evaluation point in target CRS,The value of the first ordinate of the evaluation point expressed in the target coordinate reference system.  In the case of an affine transformation the evaluation point is the origin of the source coordinate reference system.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8622,Ordinate 2 of evaluation point in target CRS,The value of the second ordinate of the evaluation point expressed in the target coordinate reference system.  In the case of an affine transformation the evaluation point is the origin of the source coordinate reference system.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8623,A0,Coefficient used in affine (general parametric) and polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8624,A1,Coefficient used in affine (general parametric) and polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8625,A2,Coefficient used in affine (general parametric) and polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8626,A3,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8627,A4,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8628,A5,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8629,A6,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8630,A7,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8631,A8,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8632,A9,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8633,A10,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8634,A11,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8635,A12,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8636,A13,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8637,A14,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8638,B00,Coefficient used only in the Madrid to ED50 polynomial transformation method.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8639,B0,Coefficient used in affine (general parametric) and polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8640,B1,Coefficient used in affine (general parametric) and polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8641,B2,Coefficient used in affine (general parametric) and polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8642,B3,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8643,B4,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8644,B5,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8645,B6,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8646,B7,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8647,B8,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8648,B9,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8649,B10,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8650,B11,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8651,B12,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8652,B13,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8653,B14,Coefficient used in polynomial transformations.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8654,Semi-major axis length difference,The difference between the semi-major axis values of the ellipsoids used in the target and source coordinate reference systems.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8655,Flattening difference,"The difference between the flattening values of the ellipsoids used in the target and source coordinate reference systems. 
+
+flattening  = 1 / (inverse_flattening).",EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8656,Latitude and longitude difference file,The name of the [path and] file containing latitude and longitude differences.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8657,Latitude difference file,The name of the [path and] file containing latitude differences.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8658,Longitude difference file,The name of the [path and] file containing longitude differences.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8659,Geod. tfm. code for northern boundary,The EPSG code for the geodetic transformation applied at the northern boundary of the interpolation area.  Applies to Norwegian offshore interpolation method.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8660,Geod. tfm. code for southern boundary,The EPSG code for the geodetic transformation applied at the southern boundary of the interpolation area.  Applies to Norwegian offshore interpolation method.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8661,Geod. tfm. name for northern boundary,The EPSG name for the geodetic transformation applied at the northern boundary of the interpolation area.  Applies to Norwegian offshore interpolation method.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8662,Geod. tfm. name for southern boundary,The EPSG name for the geodetic transformation applied at the southern boundary of the interpolation area.  Applies to Norwegian offshore interpolation method.,EPSG guidance note number 7.,EPSG,2000-06-23 00:00:00,,0
+8663,Point scale factor,The point scale factor in a selected point of the target coordinate reference system. to be used as representative figure of the scale of the target coordinate reference system in a the area to which a coordinate transformation is defined.,EPSG guidance note number 7 (June 2000 Revision),EPSG,2000-06-29 00:00:00,,0
+8664,Easting and northing difference file,The name of the [path and] file containing easting and northing differences.,Ordnance Survey of Great Britain,EPSG,2000-10-19 00:00:00,,0
+8665,Maritime Province residual file,Coordinate differences at control points,Survey of New Brunswick,EPSG,2000-10-19 00:00:00,,0
+8666,Geoid model file,The name of the [path and] file containing geoid heights.,EPSG,EPSG,2001-06-05 00:00:00,,0
+8667,Ordinate 3 of evaluation point,The value of the third ordinate of the evaluation point.,EPSG guidance note number 7.,EPSG,2001-11-06 00:00:00,,0
+8801,Latitude of natural origin,"The latitude of the point from which the values of both the geographical coordinates on the ellipsoid and the grid coordinates on the projection are deemed to increment or decrement for computational purposes. Alternatively it may be considered as the latitude of the point which in the absence of application of false coordinates has grid coordinates of (0,0).",EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8802,Longitude of natural origin,"The longitude of the point from which the values of both the geographical coordinates on the ellipsoid and the grid coordinates on the projection are deemed to increment or decrement for computational purposes. Alternatively it may be considered as the longitude of the point which in the absence of application of false coordinates has grid coordinates of (0,0).  Sometimes known as ""central meridian (CM)"".",EPSG guidance note number 7.,EPSG,2002-06-22 0 [...]
+8805,Scale factor at natural origin,"The factor by which the map grid is reduced or enlarged during the projection process, defined by its value at the natural origin.",EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8806,False easting,"Since the natural origin may be at or near the centre of the projection and under normal coordinate circumstances would thus give rise to negative coordinates over parts of the mapped area, this origin is usually given false coordinates which are large enough to avoid this inconvenience. The False Easting, FE, is the value assigned to the abscissa (east or west) axis of the projection grid at the natural origin.",EPSG guidance note number 7.,EPSG,2002-07-31 00:00:00,2 [...]
+8807,False northing,"Since the natural origin may be at or near the centre of the projection and under normal coordinate circumstances would thus give rise to negative coordinates over parts of the mapped area, this origin is usually given false coordinates which are large enough to avoid this inconvenience. The False Northing, FN, is the value assigned to the ordinate (north or south) axis of the projection grid at the natural origin.",EPSG guidance note number 7.,EPSG,2002-07-31 00:00: [...]
+8811,Latitude of projection centre,"For an oblique projection, this is the latitude of the point at which the azimuth of the central line is defined.",EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8812,Longitude of projection centre,"For an oblique projection, this is the longitude of the point at which the azimuth of the central line is defined.",EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8813,Azimuth of initial line,"The azimuthal direction (north zero, east of north being positive) of the great circle which is the centre line of an oblique projection. The azimuth is given at the projection center.",EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8814,Angle from Rectified to Skew Grid,The angle at the natural origin of an oblique projection through which the natural coordinate reference system is rotated to make the projection north axis parallel with true north.,EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8815,Scale factor on initial line,"The factor by which the map grid is reduced or enlarged during the projection process, defined by its value at the projection center.",EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8816,Easting at projection centre,The easting value assigned to the projection centre.,EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8817,Northing at projection centre,The northing value assigned to the projection centre.,EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8818,Latitude of pseudo standard parallel,"Latitude of the parallel on which the conic or cylindrical projection is based.  This latitude is not geographic, but is defined on the conformal sphere AFTER its rotation to obtain the oblique aspect of the projection",EPSG guidance note number 7,EPSG,2000-03-07 00:00:00,,0
+8819,Scale factor on pseudo standard parallel,"The factor by which the map grid is reduced or enlarged during the projection process, defined by its value at the pseudo-standard parallel.",EPSG guidance note number 7.,EPSG,2000-03-07 00:00:00,,0
+8821,Latitude of false origin,The latitude of the point which is not the natural origin and at which grid coordinate values false easting and false northing are defined.,EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8822,Longitude of false origin,The longitude of the point which is not the natural origin and at which grid coordinate values false easting and false northing are defined.,EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8823,Latitude of 1st standard parallel,"For a conic projection with two standard parallels, this is the latitude of intersection of the cone with the ellipsoid that is nearest the pole.  Scale is true along this parallel.",EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8824,Latitude of 2nd standard parallel,"For a conic projection with two standard parallels, this is the latitude of intersection of the cone with the ellipsoid that is furthest from the pole.  Scale is true along this parallel.",EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8826,Easting at false origin,The easting value assigned to the false origin.,EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8827,Northing at false origin,The northing value assigned to the false origin.,EPSG guidance note number 7.,EPSG,1999-09-09 00:00:00,,0
+8828,Spherical latitude of origin,The latitude of the point from which the values of both the geographical coordinates on the sphere and the grid coordinates on a spherical projection are deemed to increment or decrement for computational purposes.,EPSG guidance note number 7.,EPSG,2001-06-05 00:00:00,,0
+8829,Spherical longitude of origin,The longitude of the point from which the values of both the geographical coordinates on the sphere and the grid coordinates on a spherical projection are deemed to increment or decrement for computational purposes.,EPSG guidance note number 7.,EPSG,2001-06-05 00:00:00,,0
+8830,Initial longitude,The longitude of the western limit of the first zone of a Transverse Mercator zoned grid system.,EPSG,EPSG,2001-06-05 00:00:00,,0
+8831,Zone width,The longitude width of a zone of a Transverse Mercator zoned grid system.,EPSG,EPSG,2001-06-05 00:00:00,,0
diff --git a/src/tiff/csv/coordinate_operation_parameter_value.csv b/src/tiff/csv/coordinate_operation_parameter_value.csv
new file mode 100644
index 0000000..d3e43b3
--- /dev/null
+++ b/src/tiff/csv/coordinate_operation_parameter_value.csv
@@ -0,0 +1,8406 @@
+"COORD_OP_CODE","COORD_OP_METHOD_CODE","PARAMETER_CODE","PARAMETER_VALUE","PARAM_VALUE_FILE_REF","UOM_CODE"
+1025,9630,8617,55.0,,9102
+1025,9630,8618,0.0,,9102
+1025,9630,8623,-0.00000556098,,9203
+1025,9630,8624,-0.00000155391,,9203
+1025,9630,8625,-0.00000040262,,9203
+1025,9630,8626,-0.000000509693,,9203
+1025,9630,8627,-0.000000819775,,9203
+1025,9630,8628,-0.000000247592,,9203
+1025,9630,8629,0.000000136682,,9203
+1025,9630,8630,0.000000186198,,9203
+1025,9630,8631,0.00000012335,,9203
+1025,9630,8632,0.0000000568797,,9203
+1025,9630,8633,-0.00000000232217,,9203
+1025,9630,8634,-0.00000000769931,,9203
+1025,9630,8635,-0.00000000786953,,9203
+1025,9630,8636,-0.00000000612216,,9203
+1025,9630,8637,-0.00000000401382,,9203
+1025,9630,8639,0.0000148944,,9203
+1025,9630,8640,0.00000268191,,9203
+1025,9630,8641,0.0000024529,,9203
+1025,9630,8642,0.0000002944,,9203
+1025,9630,8643,0.0000015226,,9203
+1025,9630,8644,0.000000910592,,9203
+1025,9630,8645,-0.000000382241,,9203
+1025,9630,8646,-0.000000851732,,9203
+1025,9630,8647,-0.000000566713,,9203
+1025,9630,8648,-0.000000185188,,9203
+1025,9630,8649,0.0000000284312,,9203
+1025,9630,8650,0.0000000684853,,9203
+1025,9630,8651,0.0000000500828,,9203
+1025,9630,8652,0.0000000415937,,9203
+1025,9630,8653,0.00000000762236,,9203
+1026,9617,8623,8.4386918,,9203
+1026,9617,8624,-0.0972,,9203
+1026,9617,8625,-0.03672,,9203
+1026,9617,8626,0.0000406,,9203
+1026,9617,8638,-13276.58,,9203
+1026,9617,8639,2.6620443,,9203
+1026,9617,8640,0.07992,,9203
+1026,9617,8641,-0.0036,,9203
+1026,9617,8642,-0.0000109,,9203
+1027,9617,8623,11.328779,,9203
+1027,9617,8624,-0.1674,,9203
+1027,9617,8625,-0.03852,,9203
+1027,9617,8626,0.0000379,,9203
+1027,9617,8638,-13276.58,,9203
+1027,9617,8639,2.5079425,,9203
+1027,9617,8640,0.08352,,9203
+1027,9617,8641,-0.00864,,9203
+1027,9617,8642,-0.0000038,,9203
+1028,9617,8623,6.2280987,,9203
+1028,9617,8624,-0.03924,,9203
+1028,9617,8625,-0.03276,,9203
+1028,9617,8626,0.0000284,,9203
+1028,9617,8638,-13276.58,,9104
+1028,9617,8639,2.9368989,,9203
+1028,9617,8640,0.07272,,9203
+1028,9617,8641,0.00216,,9203
+1028,9617,8642,-0.0000179,,9203
+1029,9632,8619,155000.0,,9001
+1029,9632,8620,463000.0,,9001
+1029,9632,8621,663395.607,,9001
+1029,9632,8622,5781194.38,,9001
+1029,9632,8624,-51.681,,9203
+1029,9632,8625,3290.525,,9203
+1029,9632,8626,20.172,,9203
+1029,9632,8627,1.133,,9203
+1029,9632,8628,2.075,,9203
+1029,9632,8629,0.251,,9203
+1029,9632,8630,0.075,,9203
+1029,9632,8631,-0.012,,9203
+1030,9632,8619,663395.607,,9001
+1030,9632,8620,5781194.38,,9001
+1030,9632,8621,155000.0,,9001
+1030,9632,8622,463000.0,,9001
+1030,9632,8624,56.619,,9203
+1030,9632,8625,3290.362,,9203
+1030,9632,8626,20.184,,9203
+1030,9632,8627,-0.861,,9203
+1030,9632,8628,2.082,,9203
+1030,9632,8629,-0.023,,9203
+1030,9632,8630,0.07,,9203
+1030,9632,8631,-0.025,,9203
+1031,9632,8619,155000.0,,9001
+1031,9632,8620,463000.0,,9001
+1031,9632,8621,663395.563,,9001
+1031,9632,8622,5781194.442,,9001
+1031,9632,8624,-51.718,,9203
+1031,9632,8625,3290.521,,9203
+1031,9632,8626,20.154,,9203
+1031,9632,8627,1.152,,9203
+1031,9632,8628,2.061,,9203
+1031,9632,8629,0.238,,9203
+1031,9632,8630,0.058,,9203
+1031,9632,8631,-0.013,,9203
+1032,9632,8619,663395.563,,9001
+1032,9632,8620,5781194.442,,9001
+1032,9632,8621,155000.0,,9001
+1032,9632,8622,463000.0,,9001
+1032,9632,8624,99943.4175,,9203
+1032,9632,8625,-3290.3612,,9203
+1032,9632,8626,-20.1673,,9203
+1032,9632,8627,0.8387,,9203
+1032,9632,8628,-2.0651,,9203
+1032,9632,8629,0.0334,,9203
+1032,9632,8630,-0.0523,,9203
+1032,9632,8631,0.23,,9203
+1033,9631,8619,0.0,,9001
+1033,9631,8620,0.0,,9001
+1033,9631,8621,449681.702,,9001
+1033,9631,8622,5460505.326,,9001
+1033,9631,8624,-71.3747,,9203
+1033,9631,8625,1858.8407,,9203
+1033,9631,8626,-5.4504,,9203
+1033,9631,8627,-16.9681,,9203
+1033,9631,8628,4.0783,,9203
+1033,9631,8629,0.2193,,9203
+1034,9631,8619,500000.0,,9001
+1034,9631,8620,5500000.0,,9001
+1034,9631,8621,448933.793,,9001
+1034,9631,8622,5461423.984,,9001
+1034,9631,8624,28.7827,,9203
+1034,9631,8625,-1843.8236,,9203
+1034,9631,8626,0.0864,,9203
+1034,9631,8627,11.9065,,9203
+1034,9631,8628,-4.0793,,9203
+1034,9631,8629,0.0809,,9203
+1035,9621,8611,0.0,,9202
+1035,9621,8614,271.053,,9110
+1035,9621,8621,2610200.48,,9001
+1035,9621,8622,4905282.73,,9001
+1036,9633,8664,,ostn97.txt,
+1037,9632,8619,155000.0,,9001
+1037,9632,8620,463000.0,,9001
+1037,9632,8621,526577.124,,9001
+1037,9632,8622,5778575.474,,9001
+1037,9632,8624,99969.1014,,9203
+1037,9632,8625,533.6385,,9203
+1037,9632,8626,3.3943,,9203
+1037,9632,8627,-0.1391,,9203
+1037,9632,8628,2.0658,,9203
+1037,9632,8629,0.0677,,9203
+1037,9632,8630,0.0561,,9203
+1037,9632,8631,-0.0148,,9203
+1038,9632,8619,526577.124,,9001
+1038,9632,8620,5778575.474,,9001
+1038,9632,8621,155000.0,,9001
+1038,9632,8622,463000.0,,9001
+1038,9632,8624,100028.0577,,9203
+1038,9632,8625,-533.9532,,9203
+1038,9632,8626,-3.3943,,9203
+1038,9632,8627,0.1935,,9203
+1038,9632,8628,-2.0687,,9203
+1038,9632,8629,-0.0235,,9203
+1038,9632,8630,-0.0554,,9203
+1038,9632,8631,0.0167,,9203
+1100,9603,8605,-166.0,,9001
+1100,9603,8606,-15.0,,9001
+1100,9603,8607,204.0,,9001
+1101,9603,8605,-118.0,,9001
+1101,9603,8606,-14.0,,9001
+1101,9603,8607,218.0,,9001
+1102,9603,8605,-134.0,,9001
+1102,9603,8606,-2.0,,9001
+1102,9603,8607,210.0,,9001
+1103,9603,8605,-165.0,,9001
+1103,9603,8606,-11.0,,9001
+1103,9603,8607,206.0,,9001
+1104,9603,8605,-123.0,,9001
+1104,9603,8606,-20.0,,9001
+1104,9603,8607,220.0,,9001
+1105,9603,8605,-128.0,,9001
+1105,9603,8606,-18.0,,9001
+1105,9603,8607,224.0,,9001
+1106,9603,8605,-161.0,,9001
+1106,9603,8606,-14.0,,9001
+1106,9603,8607,205.0,,9001
+1107,9603,8605,-43.0,,9001
+1107,9603,8606,-163.0,,9001
+1107,9603,8607,45.0,,9001
+1108,9603,8605,-133.0,,9001
+1108,9603,8606,-48.0,,9001
+1108,9603,8607,148.0,,9001
+1109,9603,8605,-134.0,,9001
+1109,9603,8606,-48.0,,9001
+1109,9603,8607,149.0,,9001
+1110,9603,8605,-150.0,,9001
+1110,9603,8606,-250.0,,9001
+1110,9603,8607,-1.0,,9001
+1111,9603,8605,-143.0,,9001
+1111,9603,8606,-236.0,,9001
+1111,9603,8607,7.0,,9001
+1112,9606,8605,593.16,,9001
+1112,9606,8606,26.15,,9001
+1112,9606,8607,478.54,,9001
+1112,9606,8608,-6.3239,,9109
+1112,9606,8609,-0.5008,,9109
+1112,9606,8610,-5.5487,,9109
+1112,9606,8611,4.0775,,9202
+1113,9603,8605,-143.0,,9001
+1113,9603,8606,-90.0,,9001
+1113,9603,8607,-294.0,,9001
+1114,9603,8605,-138.0,,9001
+1114,9603,8606,-105.0,,9001
+1114,9603,8607,-289.0,,9001
+1115,9603,8605,-153.0,,9001
+1115,9603,8606,-5.0,,9001
+1115,9603,8607,-292.0,,9001
+1116,9603,8605,-125.0,,9001
+1116,9603,8606,-108.0,,9001
+1116,9603,8607,-295.0,,9001
+1117,9603,8605,-161.0,,9001
+1117,9603,8606,-73.0,,9001
+1117,9603,8607,-317.0,,9001
+1118,9603,8605,-134.0,,9001
+1118,9603,8606,-105.0,,9001
+1118,9603,8607,-295.0,,9001
+1119,9603,8605,-169.0,,9001
+1119,9603,8606,-19.0,,9001
+1119,9603,8607,-278.0,,9001
+1120,9603,8605,-147.0,,9001
+1120,9603,8606,-74.0,,9001
+1120,9603,8607,-283.0,,9001
+1121,9603,8605,-142.0,,9001
+1121,9603,8606,-96.0,,9001
+1121,9603,8607,-293.0,,9001
+1122,9603,8605,-160.0,,9001
+1122,9603,8606,-6.0,,9001
+1122,9603,8607,-302.0,,9001
+1123,9603,8605,-377.0,,9001
+1123,9603,8606,681.0,,9001
+1123,9603,8607,-50.0,,9001
+1124,9603,8605,-73.0,,9001
+1124,9603,8606,213.0,,9001
+1124,9603,8607,296.0,,9001
+1125,9603,8605,307.0,,9001
+1125,9603,8606,304.0,,9001
+1125,9603,8607,-318.0,,9001
+1126,9603,8605,-384.0,,9001
+1126,9603,8606,664.0,,9001
+1126,9603,8607,-48.0,,9001
+1127,9603,8605,-148.0,,9001
+1127,9603,8606,136.0,,9001
+1127,9603,8607,90.0,,9001
+1128,9603,8605,-136.0,,9001
+1128,9603,8606,-108.0,,9001
+1128,9603,8607,-292.0,,9001
+1129,9603,8605,-134.73,,9001
+1129,9603,8606,-110.92,,9001
+1129,9603,8607,-292.66,,9001
+1130,9603,8605,-263.0,,9001
+1130,9603,8606,6.0,,9001
+1130,9603,8607,431.0,,9001
+1131,9603,8605,-134.0,,9001
+1131,9603,8606,229.0,,9001
+1131,9603,8607,-29.0,,9001
+1132,9603,8605,-206.0,,9001
+1132,9603,8606,172.0,,9001
+1132,9603,8607,-6.0,,9001
+1133,9603,8605,-87.0,,9001
+1133,9603,8606,-98.0,,9001
+1133,9603,8607,-121.0,,9001
+1134,9603,8605,-87.0,,9001
+1134,9603,8606,-96.0,,9001
+1134,9603,8607,-120.0,,9001
+1135,9603,8605,-103.0,,9001
+1135,9603,8606,-106.0,,9001
+1135,9603,8607,-141.0,,9001
+1136,9603,8605,-104.0,,9001
+1136,9603,8606,-101.0,,9001
+1136,9603,8607,-140.0,,9001
+1137,9603,8605,-130.0,,9001
+1137,9603,8606,-117.0,,9001
+1137,9603,8607,-151.0,,9001
+1138,9603,8605,-86.0,,9001
+1138,9603,8606,-96.0,,9001
+1138,9603,8607,-120.0,,9001
+1139,9603,8605,-87.0,,9001
+1139,9603,8606,-95.0,,9001
+1139,9603,8607,-120.0,,9001
+1140,9603,8605,-84.0,,9001
+1140,9603,8606,-95.0,,9001
+1140,9603,8607,-130.0,,9001
+1141,9603,8605,-117.0,,9001
+1141,9603,8606,-132.0,,9001
+1141,9603,8607,-164.0,,9001
+1142,9603,8605,-97.0,,9001
+1142,9603,8606,-103.0,,9001
+1142,9603,8607,-120.0,,9001
+1143,9603,8605,-97.0,,9001
+1143,9603,8606,-88.0,,9001
+1143,9603,8607,-135.0,,9001
+1144,9603,8605,-107.0,,9001
+1144,9603,8606,-88.0,,9001
+1144,9603,8607,-149.0,,9001
+1145,9603,8605,-84.0,,9001
+1145,9603,8606,-107.0,,9001
+1145,9603,8607,-120.0,,9001
+1146,9606,8605,-82.981,,9001
+1146,9606,8606,-99.719,,9001
+1146,9606,8607,-110.709,,9001
+1146,9606,8608,-0.5076,,9109
+1146,9606,8609,0.1503,,9109
+1146,9606,8610,0.3898,,9109
+1146,9606,8611,-0.3143,,9202
+1147,9606,8605,-1.51,,9001
+1147,9606,8606,-0.84,,9001
+1147,9606,8607,-3.5,,9001
+1147,9606,8608,-1.893,,9109
+1147,9606,8609,-0.687,,9109
+1147,9606,8610,-2.764,,9109
+1147,9606,8611,0.609,,9202
+1148,9603,8605,-130.0,,9001
+1148,9603,8606,110.0,,9001
+1148,9603,8607,-13.0,,9001
+1149,9603,8605,0.0,,9001
+1149,9603,8606,0.0,,9001
+1149,9603,8607,0.0,,9001
+1150,9603,8605,0.0,,9001
+1150,9603,8606,0.0,,9001
+1150,9603,8607,0.0,,9001
+1151,9603,8605,84.0,,9001
+1151,9603,8606,-22.0,,9001
+1151,9603,8607,209.0,,9001
+1152,9603,8605,-637.0,,9001
+1152,9603,8606,-549.0,,9001
+1152,9603,8607,-203.0,,9001
+1153,9603,8605,217.0,,9001
+1153,9603,8606,823.0,,9001
+1153,9603,8607,299.0,,9001
+1154,9603,8605,209.0,,9001
+1154,9603,8606,818.0,,9001
+1154,9603,8607,290.0,,9001
+1155,9603,8605,282.0,,9001
+1155,9603,8606,726.0,,9001
+1155,9603,8607,254.0,,9001
+1156,9603,8605,295.0,,9001
+1156,9603,8606,736.0,,9001
+1156,9603,8607,257.0,,9001
+1157,9603,8605,-97.0,,9001
+1157,9603,8606,787.0,,9001
+1157,9603,8607,86.0,,9001
+1158,9603,8605,-11.0,,9001
+1158,9603,8606,851.0,,9001
+1158,9603,8607,5.0,,9001
+1159,9603,8605,-130.0,,9001
+1159,9603,8606,29.0,,9001
+1159,9603,8607,364.0,,9001
+1160,9603,8605,-90.0,,9001
+1160,9603,8606,40.0,,9001
+1160,9603,8607,88.0,,9001
+1161,9603,8605,-133.0,,9001
+1161,9603,8606,-77.0,,9001
+1161,9603,8607,-51.0,,9001
+1162,9603,8605,-133.0,,9001
+1162,9603,8606,-79.0,,9001
+1162,9603,8607,-72.0,,9001
+1163,9603,8605,-74.0,,9001
+1163,9603,8606,-130.0,,9001
+1163,9603,8607,42.0,,9001
+1164,9603,8605,41.0,,9001
+1164,9603,8606,-220.0,,9001
+1164,9603,8607,-134.0,,9001
+1165,9603,8605,639.0,,9001
+1165,9603,8606,405.0,,9001
+1165,9603,8607,60.0,,9001
+1166,9603,8605,31.0,,9001
+1166,9603,8606,146.0,,9001
+1166,9603,8607,47.0,,9001
+1167,9603,8605,-81.0,,9001
+1167,9603,8606,-84.0,,9001
+1167,9603,8607,115.0,,9001
+1168,9603,8605,-92.0,,9001
+1168,9603,8606,-93.0,,9001
+1168,9603,8607,122.0,,9001
+1169,9603,8605,-225.0,,9001
+1169,9603,8606,-65.0,,9001
+1169,9603,8607,9.0,,9001
+1170,9603,8605,-3.0,,9001
+1170,9603,8606,142.0,,9001
+1170,9603,8607,183.0,,9001
+1171,9603,8605,0.0,,9001
+1171,9603,8606,125.0,,9001
+1171,9603,8607,194.0,,9001
+1172,9603,8605,-10.0,,9001
+1172,9603,8606,158.0,,9001
+1172,9603,8607,187.0,,9001
+1173,9603,8605,-8.0,,9001
+1173,9603,8606,160.0,,9001
+1173,9603,8607,176.0,,9001
+1174,9603,8605,-9.0,,9001
+1174,9603,8606,161.0,,9001
+1174,9603,8607,179.0,,9001
+1175,9603,8605,-8.0,,9001
+1175,9603,8606,159.0,,9001
+1175,9603,8607,175.0,,9001
+1176,9603,8605,-5.0,,9001
+1176,9603,8606,135.0,,9001
+1176,9603,8607,172.0,,9001
+1177,9603,8605,-4.0,,9001
+1177,9603,8606,154.0,,9001
+1177,9603,8607,178.0,,9001
+1178,9603,8605,1.0,,9001
+1178,9603,8606,140.0,,9001
+1178,9603,8607,165.0,,9001
+1179,9603,8605,-7.0,,9001
+1179,9603,8606,162.0,,9001
+1179,9603,8607,188.0,,9001
+1180,9603,8605,-9.0,,9001
+1180,9603,8606,157.0,,9001
+1180,9603,8607,184.0,,9001
+1181,9603,8605,-22.0,,9001
+1181,9603,8606,160.0,,9001
+1181,9603,8607,190.0,,9001
+1182,9603,8605,4.0,,9001
+1182,9603,8606,159.0,,9001
+1182,9603,8607,188.0,,9001
+1183,9603,8605,-7.0,,9001
+1183,9603,8606,139.0,,9001
+1183,9603,8607,181.0,,9001
+1184,9603,8605,0.0,,9001
+1184,9603,8606,125.0,,9001
+1184,9603,8607,201.0,,9001
+1185,9603,8605,-9.0,,9001
+1185,9603,8606,152.0,,9001
+1185,9603,8607,178.0,,9001
+1186,9603,8605,11.0,,9001
+1186,9603,8606,114.0,,9001
+1186,9603,8607,195.0,,9001
+1187,9603,8605,-12.0,,9001
+1187,9603,8606,130.0,,9001
+1187,9603,8607,190.0,,9001
+1188,9603,8605,0.0,,9001
+1188,9603,8606,0.0,,9001
+1188,9603,8607,0.0,,9001
+1189,9603,8605,-247.0,,9001
+1189,9603,8606,-148.0,,9001
+1189,9603,8607,369.0,,9001
+1190,9603,8605,-243.0,,9001
+1190,9603,8606,-192.0,,9001
+1190,9603,8607,477.0,,9001
+1191,9603,8605,-249.0,,9001
+1191,9603,8606,-156.0,,9001
+1191,9603,8607,381.0,,9001
+1192,9603,8605,-10.0,,9001
+1192,9603,8606,375.0,,9001
+1192,9603,8607,165.0,,9001
+1193,9603,8605,-168.0,,9001
+1193,9603,8606,-60.0,,9001
+1193,9603,8607,320.0,,9001
+1195,9603,8605,375.0,,9001
+1195,9603,8606,-111.0,,9001
+1195,9603,8607,431.0,,9001
+1196,9603,8605,371.0,,9001
+1196,9603,8606,-112.0,,9001
+1196,9603,8607,434.0,,9001
+1197,9603,8605,371.0,,9001
+1197,9603,8606,-111.0,,9001
+1197,9603,8607,434.0,,9001
+1198,9603,8605,384.0,,9001
+1198,9603,8606,-111.0,,9001
+1198,9603,8607,425.0,,9001
+1199,9603,8605,370.0,,9001
+1199,9603,8606,-108.0,,9001
+1199,9603,8607,434.0,,9001
+1200,9603,8605,-148.0,,9001
+1200,9603,8606,51.0,,9001
+1200,9603,8607,-291.0,,9001
+1201,9603,8605,-288.0,,9001
+1201,9603,8606,175.0,,9001
+1201,9603,8607,-376.0,,9001
+1202,9603,8605,-270.0,,9001
+1202,9603,8606,188.0,,9001
+1202,9603,8607,-388.0,,9001
+1203,9603,8605,-270.0,,9001
+1203,9603,8606,183.0,,9001
+1203,9603,8607,-390.0,,9001
+1204,9603,8605,-305.0,,9001
+1204,9603,8606,243.0,,9001
+1204,9603,8607,-442.0,,9001
+1205,9603,8605,-282.0,,9001
+1205,9603,8606,169.0,,9001
+1205,9603,8607,-371.0,,9001
+1206,9603,8605,-278.0,,9001
+1206,9603,8606,171.0,,9001
+1206,9603,8607,-367.0,,9001
+1207,9603,8605,-298.0,,9001
+1207,9603,8606,159.0,,9001
+1207,9603,8607,-369.0,,9001
+1208,9603,8605,-279.0,,9001
+1208,9603,8606,175.0,,9001
+1208,9603,8607,-379.0,,9001
+1209,9603,8605,-295.0,,9001
+1209,9603,8606,173.0,,9001
+1209,9603,8607,-371.0,,9001
+1211,9603,8605,164.0,,9001
+1211,9603,8606,138.0,,9001
+1211,9603,8607,-189.0,,9001
+1212,9603,8605,-57.0,,9001
+1212,9603,8606,1.0,,9001
+1212,9603,8607,-41.0,,9001
+1213,9603,8605,-62.0,,9001
+1213,9603,8606,-1.0,,9001
+1213,9603,8607,-37.0,,9001
+1214,9603,8605,-61.0,,9001
+1214,9603,8606,2.0,,9001
+1214,9603,8607,-48.0,,9001
+1215,9603,8605,-60.0,,9001
+1215,9603,8606,-2.0,,9001
+1215,9603,8607,-41.0,,9001
+1216,9603,8605,-75.0,,9001
+1216,9603,8606,-1.0,,9001
+1216,9603,8607,-44.0,,9001
+1217,9603,8605,-44.0,,9001
+1217,9603,8606,6.0,,9001
+1217,9603,8607,-36.0,,9001
+1218,9603,8605,-48.0,,9001
+1218,9603,8606,3.0,,9001
+1218,9603,8607,-44.0,,9001
+1219,9603,8605,-47.0,,9001
+1219,9603,8606,26.0,,9001
+1219,9603,8607,-42.0,,9001
+1220,9603,8605,-53.0,,9001
+1220,9603,8606,3.0,,9001
+1220,9603,8607,-47.0,,9001
+1221,9603,8605,-61.0,,9001
+1221,9603,8606,2.0,,9001
+1221,9603,8607,-33.0,,9001
+1222,9603,8605,-58.0,,9001
+1222,9603,8606,0.0,,9001
+1222,9603,8607,-44.0,,9001
+1223,9603,8605,-45.0,,9001
+1223,9603,8606,12.0,,9001
+1223,9603,8607,-33.0,,9001
+1224,9603,8605,-45.0,,9001
+1224,9603,8606,8.0,,9001
+1224,9603,8607,-33.0,,9001
+1225,9603,8605,-355.0,,9001
+1225,9603,8606,21.0,,9001
+1225,9603,8607,72.0,,9001
+1226,9603,8605,616.0,,9001
+1226,9603,8606,97.0,,9001
+1226,9603,8607,-251.0,,9001
+1227,9603,8605,-189.0,,9001
+1227,9603,8606,-242.0,,9001
+1227,9603,8607,-91.0,,9001
+1228,9603,8605,-679.0,,9001
+1228,9603,8606,669.0,,9001
+1228,9603,8607,-48.0,,9001
+1229,9603,8605,506.0,,9001
+1229,9603,8606,-122.0,,9001
+1229,9603,8607,611.0,,9001
+1230,9603,8605,-148.0,,9001
+1230,9603,8606,507.0,,9001
+1230,9603,8607,685.0,,9001
+1231,9603,8605,-148.0,,9001
+1231,9603,8606,507.0,,9001
+1231,9603,8607,685.0,,9001
+1232,9603,8605,-146.0,,9001
+1232,9603,8606,507.0,,9001
+1232,9603,8607,687.0,,9001
+1233,9603,8605,-158.0,,9001
+1233,9603,8606,507.0,,9001
+1233,9603,8607,676.0,,9001
+1234,9603,8605,-155.0,,9001
+1234,9603,8606,171.0,,9001
+1234,9603,8607,37.0,,9001
+1235,9603,8605,-265.0,,9001
+1235,9603,8606,120.0,,9001
+1235,9603,8607,-358.0,,9001
+1236,9607,8605,-116.0,,9001
+1236,9607,8606,-50.47,,9001
+1236,9607,8607,141.69,,9001
+1236,9607,8608,-0.23,,9104
+1236,9607,8609,-0.39,,9104
+1236,9607,8610,-0.344,,9104
+1236,9607,8611,0.0983,,9202
+1237,9606,8605,0.0,,9001
+1237,9606,8606,0.0,,9001
+1237,9606,8607,4.5,,9001
+1237,9606,8608,0.0,,9104
+1237,9606,8609,0.0,,9104
+1237,9606,8610,0.554,,9104
+1237,9606,8611,0.2263,,9202
+1238,9606,8605,0.0,,9001
+1238,9606,8606,0.0,,9001
+1238,9606,8607,4.5,,9001
+1238,9606,8608,0.0,,9104
+1238,9606,8609,0.0,,9104
+1238,9606,8610,0.554,,9104
+1238,9606,8611,0.219,,9202
+1239,9606,8605,0.0,,9001
+1239,9606,8606,0.0,,9001
+1239,9606,8607,-2.6,,9001
+1239,9606,8608,0.0,,9104
+1239,9606,8609,0.0,,9104
+1239,9606,8610,0.26,,9104
+1239,9606,8611,-0.6063,,9202
+1240,9606,8605,0.0,,9001
+1240,9606,8606,0.0,,9001
+1240,9606,8607,1.9,,9001
+1240,9606,8608,0.0,,9104
+1240,9606,8609,0.0,,9104
+1240,9606,8610,0.814,,9104
+1240,9606,8611,-0.38,,9202
+1241,9613,8657,,conus.las,
+1241,9613,8658,,conus.los,
+1243,9613,8657,,alaska.las,
+1243,9613,8658,,alaska.los,
+1245,9603,8605,-112.0,,9001
+1245,9603,8606,-77.0,,9001
+1245,9603,8607,-145.0,,9001
+1246,9603,8605,-333.0,,9001
+1246,9603,8606,-222.0,,9001
+1246,9603,8607,114.0,,9001
+1247,9603,8605,283.0,,9001
+1247,9603,8606,682.0,,9001
+1247,9603,8607,231.0,,9001
+1248,9603,8605,-24.0,,9001
+1248,9603,8606,-15.0,,9001
+1248,9603,8607,5.0,,9001
+1249,9603,8605,-2.0,,9001
+1249,9603,8606,152.0,,9001
+1249,9603,8607,149.0,,9001
+1250,9603,8605,2.0,,9001
+1250,9603,8606,204.0,,9001
+1250,9603,8607,105.0,,9001
+1251,9603,8605,-2.0,,9001
+1251,9603,8606,0.0,,9001
+1251,9603,8607,4.0,,9001
+1252,9603,8605,1.0,,9001
+1252,9603,8606,1.0,,9001
+1252,9603,8607,-1.0,,9001
+1253,9603,8605,-186.0,,9001
+1253,9603,8606,-93.0,,9001
+1253,9603,8607,310.0,,9001
+1254,9603,8605,28.0,,9001
+1254,9603,8606,-130.0,,9001
+1254,9603,8607,-95.0,,9001
+1255,9603,8605,-123.0,,9001
+1255,9603,8606,-206.0,,9001
+1255,9603,8607,219.0,,9001
+1256,9603,8605,-346.0,,9001
+1256,9603,8606,-1.0,,9001
+1256,9603,8607,224.0,,9001
+1258,9601,8602,-74.04513,,9110
+1259,9601,8602,-9.0754862,,9110
+1260,9601,8602,106.482779,,9110
+1261,9601,8602,-17.4,,9110
+1262,9601,8602,12.27084,,9110
+1263,9601,8602,106.482779,,9110
+1264,9601,8602,4.220471,,9110
+1265,9601,8602,2.5969213,,9105
+1266,9601,8602,2.5969213,,9105
+1268,9601,8602,106.482779,,9110
+1269,9601,8602,18.03298,,9110
+1270,9601,8602,23.4258815,,9110
+1271,9603,8605,615.64,,9001
+1271,9603,8606,102.08,,9001
+1271,9603,8607,-255.81,,9001
+1272,9603,8605,-199.87,,9001
+1272,9603,8606,74.79,,9001
+1272,9603,8607,246.62,,9001
+1273,9607,8605,-56.0,,9001
+1273,9607,8606,75.77,,9001
+1273,9607,8607,15.31,,9001
+1273,9607,8608,-0.37,,9104
+1273,9607,8609,-0.2,,9104
+1273,9607,8610,-0.21,,9104
+1273,9607,8611,-1.01,,9202
+1274,9607,8605,-40.595,,9001
+1274,9607,8606,-18.55,,9001
+1274,9607,8607,-69.339,,9001
+1274,9607,8608,-2.508,,9104
+1274,9607,8609,-1.832,,9104
+1274,9607,8610,2.611,,9104
+1274,9607,8611,-4.299,,9202
+1275,9603,8605,-84.0,,9001
+1275,9603,8606,-97.0,,9001
+1275,9603,8607,-117.0,,9001
+1276,9603,8605,-84.0,,9001
+1276,9603,8606,37.0,,9001
+1276,9603,8607,437.0,,9001
+1277,9603,8605,-168.0,,9001
+1277,9603,8606,-72.0,,9001
+1277,9603,8607,314.0,,9001
+1278,9603,8605,-127.8,,9001
+1278,9603,8606,-52.3,,9001
+1278,9603,8607,152.9,,9001
+1279,9603,8605,-128.5,,9001
+1279,9603,8606,-53.0,,9001
+1279,9603,8607,153.4,,9001
+1280,9607,8605,-117.763,,9001
+1280,9607,8606,-51.51,,9001
+1280,9607,8607,139.061,,9001
+1280,9607,8608,-0.292,,9104
+1280,9607,8609,-0.443,,9104
+1280,9607,8610,-0.277,,9104
+1280,9607,8611,-0.191,,9202
+1282,9603,8605,-404.78,,9001
+1282,9603,8606,685.68,,9001
+1282,9603,8607,45.47,,9001
+1283,9603,8605,0.0,,9001
+1283,9603,8606,0.0,,9001
+1283,9603,8607,0.0,,9001
+1284,9603,8605,-157.0,,9001
+1284,9603,8606,-2.0,,9001
+1284,9603,8607,-299.0,,9001
+1285,9603,8605,-175.0,,9001
+1285,9603,8606,-23.0,,9001
+1285,9603,8607,-303.0,,9001
+1286,9603,8605,-403.0,,9001
+1286,9603,8606,684.0,,9001
+1286,9603,8607,41.0,,9001
+1287,9603,8605,28.0,,9001
+1287,9603,8606,-121.0,,9001
+1287,9603,8607,-77.0,,9001
+1288,9603,8605,23.0,,9001
+1288,9603,8606,-124.0,,9001
+1288,9603,8607,-82.0,,9001
+1289,9603,8605,26.0,,9001
+1289,9603,8606,-121.0,,9001
+1289,9603,8607,-78.0,,9001
+1290,9603,8605,24.0,,9001
+1290,9603,8606,-124.0,,9001
+1290,9603,8607,-82.0,,9001
+1291,9603,8605,15.0,,9001
+1291,9603,8606,-130.0,,9001
+1291,9603,8607,-84.0,,9001
+1292,9603,8605,24.0,,9001
+1292,9603,8606,-130.0,,9001
+1292,9603,8607,-92.0,,9001
+1293,9603,8605,28.0,,9001
+1293,9603,8606,-121.0,,9001
+1293,9603,8607,-77.0,,9001
+1294,9603,8605,-73.0,,9001
+1294,9603,8606,-247.0,,9001
+1294,9603,8607,227.0,,9001
+1296,9603,8605,-61.702,,9001
+1296,9603,8606,284.488,,9001
+1296,9603,8607,472.052,,9001
+1297,9607,8605,-115.064,,9001
+1297,9607,8606,-87.39,,9001
+1297,9607,8607,-101.716,,9001
+1297,9607,8608,0.058,,9104
+1297,9607,8609,-4.001,,9104
+1297,9607,8610,2.062,,9104
+1297,9607,8611,9.366,,9202
+1298,9607,8605,-82.875,,9001
+1298,9607,8606,-57.097,,9001
+1298,9607,8607,-156.768,,9001
+1298,9607,8608,2.158,,9104
+1298,9607,8609,-1.524,,9104
+1298,9607,8610,0.982,,9104
+1298,9607,8611,-0.359,,9202
+1299,9607,8605,-138.527,,9001
+1299,9607,8606,-91.999,,9001
+1299,9607,8607,-114.591,,9001
+1299,9607,8608,0.14,,9104
+1299,9607,8609,-3.363,,9104
+1299,9607,8610,2.217,,9104
+1299,9607,8611,11.748,,9202
+1300,9607,8605,-73.472,,9001
+1300,9607,8606,-51.66,,9001
+1300,9607,8607,-112.482,,9001
+1300,9607,8608,-0.953,,9104
+1300,9607,8609,-4.6,,9104
+1300,9607,8610,2.368,,9104
+1300,9607,8611,0.586,,9202
+1301,9607,8605,219.315,,9001
+1301,9607,8606,168.975,,9001
+1301,9607,8607,-166.145,,9001
+1301,9607,8608,-0.198,,9104
+1301,9607,8609,-5.926,,9104
+1301,9607,8610,2.356,,9104
+1301,9607,8611,-57.104,,9202
+1302,9607,8605,0.0,,9001
+1302,9607,8606,0.0,,9001
+1302,9607,8607,0.0,,9001
+1302,9607,8608,0.0,,9104
+1302,9607,8609,0.0,,9104
+1302,9607,8610,0.0,,9104
+1302,9607,8611,0.0,,9202
+1303,9606,8605,43.822,,9001
+1303,9606,8606,-108.842,,9001
+1303,9606,8607,-119.585,,9001
+1303,9606,8608,1.455,,9104
+1303,9606,8609,-0.761,,9104
+1303,9606,8610,0.737,,9104
+1303,9606,8611,0.549,,9202
+1304,9603,8605,210.0,,9001
+1304,9603,8606,814.0,,9001
+1304,9603,8607,289.0,,9001
+1305,9603,8605,-147.0,,9001
+1305,9603,8606,506.0,,9001
+1305,9603,8607,687.0,,9001
+1306,9603,8605,682.0,,9001
+1306,9603,8606,-203.0,,9001
+1306,9603,8607,480.0,,9001
+1307,9603,8605,-2.0,,9001
+1307,9603,8606,374.0,,9001
+1307,9603,8607,172.0,,9001
+1308,9607,8605,-0.9738,,9001
+1308,9607,8606,1.9453,,9001
+1308,9607,8607,0.5486,,9001
+1308,9607,8608,-0.00000013357,,9101
+1308,9607,8609,-0.00000004872,,9101
+1308,9607,8610,-0.00000005507,,9101
+1308,9607,8611,0.0,,9202
+1309,9607,8605,582.0,,9001
+1309,9607,8606,105.0,,9001
+1309,9607,8607,414.0,,9001
+1309,9607,8608,-1.04,,9104
+1309,9607,8609,-0.35,,9104
+1309,9607,8610,3.08,,9104
+1309,9607,8611,8.3,,9202
+1310,9607,8605,24.0,,9001
+1310,9607,8606,-123.0,,9001
+1310,9607,8607,-94.0,,9001
+1310,9607,8608,-0.02,,9104
+1310,9607,8609,0.25,,9104
+1310,9607,8610,0.13,,9104
+1310,9607,8611,1.1,,9202
+1311,9606,8605,-89.5,,9001
+1311,9606,8606,-93.8,,9001
+1311,9606,8607,-123.1,,9001
+1311,9606,8608,0.0,,9104
+1311,9606,8609,0.0,,9104
+1311,9606,8610,-0.156,,9104
+1311,9606,8611,1.2,,9202
+1312,9614,8656,,NTv1_0.gsb,
+1313,9615,8656,,NTv2_0.gsb,
+1314,9606,8605,446.448,,9001
+1314,9606,8606,-125.157,,9001
+1314,9606,8607,542.06,,9001
+1314,9606,8608,0.15,,9104
+1314,9606,8609,0.247,,9104
+1314,9606,8610,0.842,,9104
+1314,9606,8611,-20.489,,9202
+1315,9606,8605,535.948,,9001
+1315,9606,8606,-31.357,,9001
+1315,9606,8607,665.16,,9001
+1315,9606,8608,0.15,,9104
+1315,9606,8609,0.247,,9104
+1315,9606,8610,0.998,,9104
+1315,9606,8611,-21.689,,9202
+1316,9603,8605,-70.9,,9001
+1316,9603,8606,-151.8,,9001
+1316,9603,8607,-41.4,,9001
+1317,9603,8605,-37.2,,9001
+1317,9603,8606,-370.6,,9001
+1317,9603,8607,-228.5,,9001
+1318,9603,8605,-42.01,,9001
+1318,9603,8606,-332.21,,9001
+1318,9603,8607,-229.75,,9001
+1319,9603,8605,-40.0,,9001
+1319,9603,8606,-354.0,,9001
+1319,9603,8607,-224.0,,9001
+1320,9606,8605,-37.2,,9001
+1320,9606,8606,-370.6,,9001
+1320,9606,8607,-224.0,,9001
+1320,9606,8608,0.0,,9104
+1320,9606,8609,0.0,,9104
+1320,9606,8610,0.554,,9104
+1320,9606,8611,0.219,,9202
+1321,9603,8605,-41.8,,9001
+1321,9603,8606,-342.2,,9001
+1321,9603,8607,-228.2,,9001
+1322,9603,8605,-55.5,,9001
+1322,9603,8606,-348.0,,9001
+1322,9603,8607,-229.2,,9001
+1323,9603,8605,-43.0,,9001
+1323,9603,8606,-337.0,,9001
+1323,9603,8607,-233.0,,9001
+1324,9603,8605,-48.0,,9001
+1324,9603,8606,-345.0,,9001
+1324,9603,8607,-231.0,,9001
+1325,9603,8605,-48.6,,9001
+1325,9603,8606,-345.1,,9001
+1325,9603,8607,-230.8,,9001
+1326,9606,8605,-41.057,,9001
+1326,9606,8606,-374.564,,9001
+1326,9606,8607,-226.287,,9001
+1326,9606,8608,0.0,,9104
+1326,9606,8609,0.0,,9104
+1326,9606,8610,0.554,,9104
+1326,9606,8611,0.219,,9202
+1327,9603,8605,-50.9,,9001
+1327,9603,8606,-347.6,,9001
+1327,9603,8607,-231.0,,9001
+1328,9603,8605,0.0,,9001
+1328,9603,8606,0.0,,9001
+1328,9603,8607,0.0,,9001
+1329,9603,8605,-252.95,,9001
+1329,9603,8606,-4.11,,9001
+1329,9603,8607,-96.38,,9001
+1330,9603,8605,-252.95,,9001
+1330,9603,8606,-4.11,,9001
+1330,9603,8607,-96.38,,9001
+1331,9607,8605,0.0,,9001
+1331,9607,8606,0.0,,9001
+1331,9607,8607,0.0,,9001
+1331,9607,8608,0.0,,9104
+1331,9607,8609,0.0,,9104
+1331,9607,8610,0.0,,9104
+1331,9607,8611,0.0,,9202
+1332,9607,8605,21.53219,,9001
+1332,9607,8606,-97.00027,,9001
+1332,9607,8607,-60.74046,,9001
+1332,9607,8608,-0.99548,,9104
+1332,9607,8609,-0.58147,,9104
+1332,9607,8610,-0.2418,,9104
+1332,9607,8611,-4.5981,,9202
+1333,9607,8605,0.055,,9001
+1333,9607,8606,-0.541,,9001
+1333,9607,8607,-0.185,,9001
+1333,9607,8608,-0.0183,,9104
+1333,9607,8609,0.0003,,9104
+1333,9607,8610,0.007,,9104
+1333,9607,8611,-0.014,,9202
+1334,9607,8605,21.58719,,9001
+1334,9607,8606,-97.54127,,9001
+1334,9607,8607,-60.92546,,9001
+1334,9607,8608,-1.01378,,9104
+1334,9607,8609,-0.58117,,9104
+1334,9607,8610,-0.2348,,9104
+1334,9607,8611,-4.6121,,9202
+1335,9618,8601,7.92,,9108
+1335,9618,8602,-13.88,,9104
+1335,9618,8604,26.1,,9001
+1336,9618,8601,7.94,,9104
+1336,9618,8602,-13.97,,9104
+1336,9618,8604,26.9,,9001
+1337,9618,8601,8.1,,9104
+1337,9618,8602,-13.81,,9104
+1337,9618,8604,27.2,,9001
+1338,9618,8601,8.15,,9104
+1338,9618,8602,-13.95,,9104
+1338,9618,8604,28.4,,9001
+1339,9618,8601,8.37,,9104
+1339,9618,8602,-13.65,,9104
+1339,9618,8604,29.0,,9001
+1340,9618,8601,8.44,,9104
+1340,9618,8602,-13.87,,9104
+1340,9618,8604,30.9,,9001
+1341,9618,8601,8.61,,9104
+1341,9618,8602,-14.08,,9104
+1341,9618,8604,30.7,,9001
+1342,9618,8601,8.73,,9104
+1342,9618,8602,-14.3,,9104
+1342,9618,8604,30.9,,9001
+1343,9618,8601,8.63,,9104
+1343,9618,8602,-13.49,,9104
+1343,9618,8604,30.9,,9001
+1344,9618,8601,8.71,,9104
+1344,9618,8602,-13.73,,9104
+1344,9618,8604,31.6,,9001
+1345,9618,8601,8.84,,9104
+1345,9618,8602,-14.03,,9104
+1345,9618,8604,31.2,,9001
+1346,9618,8601,8.98,,9104
+1346,9618,8602,-14.33,,9104
+1346,9618,8604,32.5,,9001
+1347,9618,8601,9.1,,9104
+1347,9618,8602,-14.56,,9104
+1347,9618,8604,32.6,,9001
+1348,9618,8601,8.79,,9104
+1348,9618,8602,-13.0,,9104
+1348,9618,8604,33.3,,9001
+1349,9618,8601,8.84,,9104
+1349,9618,8602,-13.31,,9104
+1349,9618,8604,31.4,,9001
+1350,9618,8601,8.98,,9104
+1350,9618,8602,-13.59,,9104
+1350,9618,8604,30.9,,9001
+1351,9618,8601,9.1,,9104
+1351,9618,8602,-13.91,,9104
+1351,9618,8604,29.3,,9001
+1352,9618,8601,9.17,,9104
+1352,9618,8602,-14.27,,9104
+1352,9618,8604,31.3,,9001
+1353,9618,8601,9.23,,9104
+1353,9618,8602,-14.52,,9104
+1353,9618,8604,31.4,,9001
+1354,9618,8601,8.9,,9104
+1354,9618,8602,-12.68,,9104
+1354,9618,8604,34.4,,9001
+1355,9618,8601,8.99,,9104
+1355,9618,8602,-12.8,,9104
+1355,9618,8604,34.2,,9001
+1356,9618,8601,9.0,,9104
+1356,9618,8602,-13.07,,9104
+1356,9618,8604,31.7,,9001
+1357,9618,8601,9.21,,9104
+1357,9618,8602,-13.51,,9104
+1357,9618,8604,27.5,,9001
+1358,9618,8601,9.33,,9104
+1358,9618,8602,-13.66,,9104
+1358,9618,8604,23.8,,9001
+1359,9618,8601,9.25,,9104
+1359,9618,8602,-12.72,,9104
+1359,9618,8604,34.2,,9001
+1360,9618,8601,9.39,,9104
+1360,9618,8602,-12.91,,9104
+1360,9618,8604,31.8,,9001
+1361,9618,8601,9.55,,9104
+1361,9618,8602,-12.63,,9104
+1361,9618,8604,35.6,,9001
+1362,9618,8601,9.62,,9104
+1362,9618,8602,-12.82,,9104
+1362,9618,8604,34.7,,9001
+1363,9618,8601,9.81,,9104
+1363,9618,8602,-12.29,,9104
+1363,9618,8604,36.6,,9001
+1364,9618,8601,9.81,,9104
+1364,9618,8602,-12.45,,9104
+1364,9618,8604,37.5,,9001
+1365,9618,8601,9.92,,9104
+1365,9618,8602,-12.79,,9104
+1365,9618,8604,38.3,,9001
+1366,9618,8601,9.91,,9104
+1366,9618,8602,-12.21,,9104
+1366,9618,8604,36.6,,9001
+1367,9618,8601,10.08,,9104
+1367,9618,8602,-12.35,,9104
+1367,9618,8604,39.0,,9001
+1368,9618,8601,10.19,,9104
+1368,9618,8602,-12.74,,9104
+1368,9618,8604,40.3,,9001
+1369,9618,8601,10.29,,9104
+1369,9618,8602,-12.13,,9104
+1369,9618,8604,38.5,,9001
+1370,9618,8601,10.33,,9104
+1370,9618,8602,-12.27,,9104
+1370,9618,8604,40.1,,9001
+1371,9618,8601,10.45,,9104
+1371,9618,8602,-12.61,,9104
+1371,9618,8604,41.7,,9001
+1372,9618,8601,10.54,,9104
+1372,9618,8602,-11.96,,9104
+1372,9618,8604,39.1,,9001
+1373,9618,8601,10.65,,9104
+1373,9618,8602,-12.27,,9104
+1373,9618,8604,41.7,,9001
+1374,9618,8601,10.67,,9104
+1374,9618,8602,-12.5,,9104
+1374,9618,8604,41.1,,9001
+1375,9618,8601,10.67,,9104
+1375,9618,8602,-10.86,,9104
+1375,9618,8604,38.5,,9001
+1376,9618,8601,10.68,,9104
+1376,9618,8602,-10.97,,9104
+1376,9618,8604,36.0,,9001
+1377,9618,8601,10.8,,9104
+1377,9618,8602,-11.53,,9104
+1377,9618,8604,39.7,,9001
+1378,9618,8601,10.8,,9104
+1378,9618,8602,-11.73,,9104
+1378,9618,8604,40.9,,9001
+1379,9618,8601,10.92,,9104
+1379,9618,8602,-12.16,,9104
+1379,9618,8604,42.3,,9001
+1380,9618,8601,11.0,,9104
+1380,9618,8602,-12.25,,9104
+1380,9618,8604,41.2,,9001
+1381,9618,8601,10.83,,9104
+1381,9618,8602,-10.77,,9104
+1381,9618,8604,36.2,,9001
+1382,9618,8601,10.95,,9104
+1382,9618,8602,-11.0,,9104
+1382,9618,8604,38.7,,9001
+1383,9618,8601,10.97,,9104
+1383,9618,8602,-11.34,,9104
+1383,9618,8604,40.8,,9001
+1384,9618,8601,11.04,,9104
+1384,9618,8602,-11.69,,9104
+1384,9618,8604,43.3,,9001
+1385,9618,8601,11.17,,9104
+1385,9618,8602,-12.05,,9104
+1385,9618,8604,42.6,,9001
+1386,9618,8601,11.11,,9104
+1386,9618,8602,-10.59,,9104
+1386,9618,8604,37.3,,9001
+1387,9618,8601,11.16,,9104
+1387,9618,8602,-10.97,,9104
+1387,9618,8604,40.3,,9001
+1388,9618,8601,11.29,,9104
+1388,9618,8602,-11.23,,9104
+1388,9618,8604,42.4,,9001
+1389,9618,8601,11.36,,9104
+1389,9618,8602,-11.59,,9104
+1389,9618,8604,42.5,,9001
+1390,9618,8601,11.44,,9104
+1390,9618,8602,-11.88,,9104
+1390,9618,8604,40.3,,9001
+1391,9618,8601,11.27,,9104
+1391,9618,8602,-9.31,,9104
+1391,9618,8604,30.9,,9001
+1392,9618,8601,11.33,,9104
+1392,9618,8602,-9.52,,9104
+1392,9618,8604,33.8,,9001
+1393,9618,8601,11.38,,9104
+1393,9618,8602,-9.86,,9104
+1393,9618,8604,34.9,,9001
+1394,9618,8601,11.41,,9104
+1394,9618,8602,-10.14,,9104
+1394,9618,8604,35.7,,9001
+1395,9618,8601,11.39,,9104
+1395,9618,8602,-10.52,,9104
+1395,9618,8604,37.5,,9001
+1396,9618,8601,11.49,,9104
+1396,9618,8602,-10.83,,9104
+1396,9618,8604,39.3,,9001
+1397,9618,8601,11.58,,9104
+1397,9618,8602,-11.21,,9104
+1397,9618,8604,41.7,,9001
+1398,9618,8601,11.65,,9104
+1398,9618,8602,-11.53,,9104
+1398,9618,8604,38.5,,9001
+1399,9618,8601,11.72,,9104
+1399,9618,8602,-11.8,,9104
+1399,9618,8604,34.5,,9001
+1400,9618,8601,11.44,,9104
+1400,9618,8602,-9.21,,9104
+1400,9618,8604,32.7,,9001
+1401,9618,8601,11.47,,9104
+1401,9618,8602,-9.52,,9104
+1401,9618,8604,35.2,,9001
+1402,9618,8601,11.55,,9104
+1402,9618,8602,-9.8,,9104
+1402,9618,8604,35.4,,9001
+1403,9618,8601,11.61,,9104
+1403,9618,8602,-10.12,,9104
+1403,9618,8604,35.9,,9001
+1404,9618,8601,11.66,,9104
+1404,9618,8602,-10.47,,9104
+1404,9618,8604,37.0,,9001
+1405,9618,8601,11.78,,9104
+1405,9618,8602,-10.79,,9104
+1405,9618,8604,39.8,,9001
+1406,9618,8601,11.85,,9104
+1406,9618,8602,-11.13,,9104
+1406,9618,8604,39.9,,9001
+1407,9618,8601,11.9,,9104
+1407,9618,8602,-11.47,,9104
+1407,9618,8604,36.9,,9001
+1408,9618,8601,11.91,,9104
+1408,9618,8602,-11.69,,9104
+1408,9618,8604,33.7,,9001
+1409,9618,8601,11.65,,9104
+1409,9618,8602,-8.59,,9104
+1409,9618,8604,29.7,,9001
+1410,9618,8601,11.68,,9104
+1410,9618,8602,-8.8,,9104
+1410,9618,8604,30.5,,9001
+1411,9618,8601,11.73,,9104
+1411,9618,8602,-9.04,,9104
+1411,9618,8604,30.9,,9001
+1412,9618,8601,11.72,,9104
+1412,9618,8602,-9.48,,9104
+1412,9618,8604,35.1,,9001
+1413,9618,8601,11.81,,9104
+1413,9618,8602,9.74,,9104
+1413,9618,8604,35.8,,9001
+1414,9618,8601,11.88,,9104
+1414,9618,8602,-10.1,,9104
+1414,9618,8604,37.1,,9001
+1415,9618,8601,11.91,,9104
+1415,9618,8602,-10.35,,9104
+1415,9618,8604,37.9,,9001
+1416,9618,8601,11.9,,9104
+1416,9618,8602,-10.7,,9104
+1416,9618,8604,39.3,,9001
+1417,9618,8601,12.02,,9104
+1417,9618,8602,-11.09,,9104
+1417,9618,8604,38.2,,9001
+1418,9618,8601,11.87,,9104
+1418,9618,8602,-8.23,,9104
+1418,9618,8604,29.7,,9001
+1419,9618,8601,11.84,,9104
+1419,9618,8602,-8.44,,9104
+1419,9618,8604,30.6,,9001
+1420,9618,8601,11.94,,9104
+1420,9618,8602,-8.71,,9104
+1420,9618,8604,30.2,,9001
+1421,9618,8601,11.99,,9104
+1421,9618,8602,-9.02,,9104
+1421,9618,8604,30.9,,9001
+1422,9618,8601,12.05,,9104
+1422,9618,8602,-9.36,,9104
+1422,9618,8604,35.0,,9001
+1423,9618,8601,12.1,,9104
+1423,9618,8602,-9.64,,9104
+1423,9618,8604,35.5,,9001
+1424,9618,8601,12.1,,9104
+1424,9618,8602,-10.08,,9104
+1424,9618,8604,37.3,,9001
+1425,9618,8601,12.07,,9104
+1425,9618,8602,-10.25,,9104
+1425,9618,8604,37.3,,9001
+1426,9618,8601,12.0,,9104
+1426,9618,8602,-8.15,,9104
+1426,9618,8604,32.1,,9001
+1427,9618,8601,12.06,,9104
+1427,9618,8602,-8.38,,9104
+1427,9618,8604,31.0,,9001
+1428,9618,8601,12.17,,9104
+1428,9618,8602,-8.69,,9104
+1428,9618,8604,30.3,,9001
+1429,9618,8601,12.23,,9104
+1429,9618,8602,-8.99,,9104
+1429,9618,8604,31.7,,9001
+1430,9618,8601,12.21,,9104
+1430,9618,8602,-9.21,,9104
+1430,9618,8604,34.3,,9001
+1431,9618,8601,12.28,,9104
+1431,9618,8602,-9.6,,9104
+1431,9618,8604,33.3,,9001
+1432,9618,8601,12.28,,9104
+1432,9618,8602,-8.25,,9104
+1432,9618,8604,31.0,,9001
+1433,9618,8601,12.37,,9104
+1433,9618,8602,-8.55,,9104
+1433,9618,8604,29.1,,9001
+1434,9618,8601,12.53,,9104
+1434,9618,8602,-8.21,,9104
+1434,9618,8604,31.0,,9001
+1435,9618,8601,12.57,,9104
+1435,9618,8602,-8.4,,9104
+1435,9618,8604,28.4,,9001
+1436,9618,8601,12.71,,9104
+1436,9618,8602,-8.17,,9104
+1436,9618,8604,29.9,,9001
+1437,9607,8605,419.3836,,9001
+1437,9607,8606,99.3335,,9001
+1437,9607,8607,591.3451,,9001
+1437,9607,8608,-0.850389,,9104
+1437,9607,8609,-1.817277,,9104
+1437,9607,8610,7.862238,,9104
+1437,9607,8611,-0.99496,,9202
+1438,9606,8605,-333.102,,9001
+1438,9606,8606,-11.02,,9001
+1438,9606,8607,230.69,,9001
+1438,9606,8608,0.0,,9104
+1438,9606,8609,0.0,,9104
+1438,9606,8610,0.554,,9104
+1438,9606,8611,0.219,,9202
+1439,9606,8605,-180.624,,9001
+1439,9606,8606,-225.516,,9001
+1439,9606,8607,173.919,,9001
+1439,9606,8608,-0.81,,9104
+1439,9606,8609,-1.898,,9104
+1439,9606,8610,8.336,,9104
+1439,9606,8611,16.71006,,9202
+1440,9603,8605,-86.0,,9001
+1440,9603,8606,-92.2,,9001
+1440,9603,8607,-127.5,,9001
+1441,9603,8605,-255.0,,9001
+1441,9603,8606,-15.0,,9001
+1441,9603,8607,71.0,,9001
+1442,9603,8605,725.0,,9001
+1442,9603,8606,685.0,,9001
+1442,9603,8607,536.0,,9001
+1443,9603,8605,72.0,,9001
+1443,9603,8606,213.7,,9001
+1443,9603,8607,93.0,,9001
+1444,9603,8605,174.0,,9001
+1444,9603,8606,359.0,,9001
+1444,9603,8607,365.0,,9001
+1445,9603,8605,9.0,,9001
+1445,9603,8606,183.0,,9001
+1445,9603,8607,236.0,,9001
+1446,9603,8605,-149.0,,9001
+1446,9603,8606,128.0,,9001
+1446,9603,8607,296.0,,9001
+1447,9619,8601,-18.0,,9104
+1447,9619,8602,4.4,,9104
+1450,9620,8659,8047.0,,
+1450,9620,8660,8046.0,,
+1450,9620,8661,,ED50 to WGS 84 (15),
+1450,9620,8662,,ED50 to WGS 84 (14),
+1451,9614,8656,,PQV4.DAC,
+1454,9613,8657,,hawaii.las,
+1454,9613,8658,,hawaii.los,
+1455,9613,8657,,stlrnc.las,
+1455,9613,8658,,stlrnc.los,
+1456,9613,8657,,stpaul.las,
+1456,9613,8658,,stpaul.los,
+1457,9613,8657,,stgeorge.las,
+1457,9613,8658,,stgeorge.los,
+1458,9607,8605,-129.193,,9001
+1458,9607,8606,-41.212,,9001
+1458,9607,8607,130.73,,9001
+1458,9607,8608,-0.246,,9104
+1458,9607,8609,-0.374,,9104
+1458,9607,8610,-0.329,,9104
+1458,9607,8611,-2.955,,9202
+1459,9607,8605,-120.695,,9001
+1459,9607,8606,-62.73,,9001
+1459,9607,8607,165.46,,9001
+1459,9607,8608,-0.109,,9104
+1459,9607,8609,0.141,,9104
+1459,9607,8610,0.116,,9104
+1459,9607,8611,2.733,,9202
+1460,9607,8605,-119.353,,9001
+1460,9607,8606,-48.301,,9001
+1460,9607,8607,139.484,,9001
+1460,9607,8608,-0.415,,9104
+1460,9607,8609,-0.26,,9104
+1460,9607,8610,-0.437,,9104
+1460,9607,8611,-0.613,,9202
+1461,9613,8657,,prvi.las,
+1461,9613,8658,,prvi.los,
+1462,9614,8656,,GS2783v1.QUE,
+1463,9615,8656,,May76v20.gsb,
+1464,9615,8656,,vic_0799.gsb,
+1466,9601,8602,10.43225,,9110
+1467,9601,8602,2.5969213,,9105
+1468,9601,8602,2.201395,,9110
+1469,9603,8605,-125.0,,9001
+1469,9603,8606,53.0,,9001
+1469,9603,8607,467.0,,9001
+1470,9603,8605,-124.76,,9001
+1470,9603,8606,53.0,,9001
+1470,9603,8607,466.79,,9001
+1471,9606,8605,-577.326,,9001
+1471,9606,8606,-90.129,,9001
+1471,9606,8607,-463.919,,9001
+1471,9606,8608,-15.8537,,9113
+1471,9606,8609,-4.55,,9113
+1471,9606,8610,-16.3489,,9113
+1471,9606,8611,-2.4232,,9201
+1472,9615,8656,,NB7783v2.gsb,
+1473,9603,8605,0.0,,9001
+1473,9603,8606,0.0,,9001
+1473,9603,8607,0.0,,9001
+1474,9613,8657,,alhpgn.las,
+1474,9613,8658,,alhpgn.los,
+1475,9613,8657,,azhpgn.las,
+1475,9613,8658,,azhpgn.los,
+1476,9613,8657,,cnhpgn.las,
+1476,9613,8658,,cnhpgn.los,
+1477,9613,8657,,cshpgn.las,
+1477,9613,8658,,cshpgn.los,
+1478,9613,8657,,cohpgn.las,
+1478,9613,8658,,cohpgn.los,
+1479,9613,8657,,gahpgn.las,
+1479,9613,8658,,gahpgn.los,
+1480,9613,8657,,flhpgn.las,
+1480,9613,8658,,flhpgn.los,
+1481,9613,8657,,emhpgn.las,
+1481,9613,8658,,emhpgn.los,
+1482,9613,8657,,wmhpgn.las,
+1482,9613,8658,,wmhpgn.los,
+1483,9613,8657,,kyhpgn.las,
+1483,9613,8658,,kyhpgn.los,
+1484,9613,8657,,lahpgn.las,
+1484,9613,8658,,lahpgn.los,
+1485,9613,8657,,mdhpgn.las,
+1485,9613,8658,,mdhpgn.los,
+1486,9613,8657,,mehpgn.las,
+1486,9613,8658,,mehpgn.los,
+1487,9613,8657,,mihpgn.las,
+1487,9613,8658,,mihpgn.los,
+1488,9613,8657,,mshpgn.las,
+1488,9613,8658,,mshpgn.los,
+1489,9613,8657,,nbhpgn.las,
+1489,9613,8658,,nbhpgn.los,
+1490,9613,8657,,nehpgn.las,
+1490,9613,8658,,nehpgn.los,
+1491,9613,8657,,nmhpgn.las,
+1491,9613,8658,,nmhpgn.los,
+1492,9613,8657,,nyhpgn.las,
+1492,9613,8658,,nyhpgn.los,
+1493,9613,8657,,ndhpgn.las,
+1493,9613,8658,,ndhpgn.los,
+1494,9613,8657,,okhpgn.las,
+1494,9613,8658,,okhpgn.los,
+1495,9613,8657,,pvhpgn.las,
+1495,9613,8658,,pvhpgn.los,
+1496,9613,8657,,sdhpgn.las,
+1496,9613,8658,,sdhpgn.los,
+1497,9613,8657,,tnhpgn.las,
+1497,9613,8658,,tnhpgn.los,
+1498,9613,8657,,ethpgn.las,
+1498,9613,8658,,ethpgn.los,
+1499,9613,8657,,wthpgn.las,
+1499,9613,8658,,wthpgn.los,
+1500,9613,8657,,vahpgn.las,
+1500,9613,8658,,vahpgn.los,
+1501,9613,8657,,wohpgn.las,
+1501,9613,8658,,wohpgn.los,
+1502,9613,8657,,wihpgn.las,
+1502,9613,8658,,wihpgn.los,
+1503,9613,8657,,wyhpgn.las,
+1503,9613,8658,,wyhpgn.los,
+1504,9603,8605,-134.73,,9001
+1504,9603,8606,-110.92,,9001
+1504,9603,8607,-292.66,,9001
+1505,9603,8605,0.0,,9001
+1505,9603,8606,0.0,,9001
+1505,9603,8607,0.0,,9001
+1506,9615,8656,,tas_1098.gsb,
+1507,9615,8656,,nt_0599.gsb,
+1508,9607,8605,660.077,,9001
+1508,9607,8606,13.551,,9001
+1508,9607,8607,369.344,,9001
+1508,9607,8608,2.484,,9113
+1508,9607,8609,1.783,,9113
+1508,9607,8610,2.939,,9113
+1508,9607,8611,5.66,,9201
+1509,9603,8605,674.374,,9001
+1509,9603,8606,15.056,,9001
+1509,9603,8607,405.346,,9001
+1510,9603,8605,674.374,,9001
+1510,9603,8606,15.056,,9001
+1510,9603,8607,405.346,,9001
+1511,9603,8605,0.0,,9001
+1511,9603,8606,0.0,,9001
+1511,9603,8607,0.0,,9001
+1512,9603,8605,-133.63,,9001
+1512,9603,8606,-157.5,,9001
+1512,9603,8607,-158.62,,9001
+1513,9603,8605,-241.54,,9001
+1513,9603,8606,-163.64,,9001
+1513,9603,8607,396.06,,9001
+1514,9606,8605,-110.33,,9001
+1514,9606,8606,-97.73,,9001
+1514,9606,8607,-119.85,,9001
+1514,9606,8608,0.3423,,9104
+1514,9606,8609,1.1634,,9104
+1514,9606,8610,0.2715,,9104
+1514,9606,8611,0.063,,9202
+1515,9607,8605,-0.991,,9001
+1515,9607,8606,1.9072,,9001
+1515,9607,8607,0.5129,,9001
+1515,9607,8608,-0.000000125033,,9101
+1515,9607,8609,-0.000000046785,,9101
+1515,9607,8610,-0.000000056529,,9101
+1515,9607,8611,0.0,,9202
+1516,9603,8605,-273.5,,9001
+1516,9603,8606,110.6,,9001
+1516,9603,8607,-357.9,,9001
+1517,9603,8605,-23.0,,9001
+1517,9603,8606,259.0,,9001
+1517,9603,8607,-9.0,,9001
+1518,9603,8605,-83.0,,9001
+1518,9603,8606,37.0,,9001
+1518,9603,8607,124.0,,9001
+1519,9601,8602,7.26225,,9110
+1520,9613,8657,,hihpgn.las,
+1520,9613,8658,,hihpgn.los,
+1521,9613,8657,,inhpgn.las,
+1521,9613,8658,,inhpgn.los,
+1522,9613,8657,,kshpgn.las,
+1522,9613,8658,,kshpgn.los,
+1523,9613,8657,,nvhpgn.las,
+1523,9613,8658,,nvhpgn.los,
+1524,9613,8657,,ohhpgn.las,
+1524,9613,8658,,ohhpgn.los,
+1525,9613,8657,,uthpgn.las,
+1525,9613,8658,,uthpgn.los,
+1526,9613,8657,,wvhpgn.las,
+1526,9613,8658,,wvhpgn.los,
+1527,9603,8605,-154.5,,9001
+1527,9603,8606,150.7,,9001
+1527,9603,8607,100.4,,9001
+1528,9603,8605,160.0,,9001
+1528,9603,8606,26.0,,9001
+1528,9603,8607,41.0,,9001
+1529,9606,8605,18.38,,9001
+1529,9606,8606,192.45,,9001
+1529,9606,8607,96.82,,9001
+1529,9606,8608,0.056,,9104
+1529,9606,8609,-0.142,,9104
+1529,9606,8610,-0.2,,9104
+1529,9606,8611,-0.0013,,9202
+1530,9603,8605,-4.2,,9001
+1530,9603,8606,135.4,,9001
+1530,9603,8607,181.9,,9001
+1531,9603,8605,-245.0,,9001
+1531,9603,8606,-153.9,,9001
+1531,9603,8607,382.8,,9001
+1532,9603,8605,-80.7,,9001
+1532,9603,8606,-132.5,,9001
+1532,9603,8607,41.1,,9001
+1533,9603,8605,214.0,,9001
+1533,9603,8606,804.0,,9001
+1533,9603,8607,268.0,,9001
+1534,9606,8605,-111.92,,9001
+1534,9606,8606,-87.85,,9001
+1534,9606,8607,114.5,,9001
+1534,9606,8608,1.875,,9104
+1534,9606,8609,0.202,,9104
+1534,9606,8610,0.219,,9104
+1534,9606,8611,0.032,,9201
+1536,9603,8605,-250.2,,9001
+1536,9603,8606,-153.09,,9001
+1536,9603,8607,391.7,,9001
+1537,9603,8605,204.64,,9001
+1537,9603,8606,834.74,,9001
+1537,9603,8607,293.8,,9001
+1538,9603,8605,-260.1,,9001
+1538,9603,8606,5.5,,9001
+1538,9603,8607,432.2,,9001
+1539,9603,8605,-76.0,,9001
+1539,9603,8606,-138.0,,9001
+1539,9603,8607,67.0,,9001
+1540,9603,8605,0.0,,9001
+1540,9603,8606,0.0,,9001
+1540,9603,8607,0.0,,9001
+1541,9603,8605,199.0,,9001
+1541,9603,8606,931.0,,9001
+1541,9603,8607,317.0,,9001
+1542,9603,8605,198.0,,9001
+1542,9603,8606,881.0,,9001
+1542,9603,8607,317.0,,9001
+1543,9603,8605,182.0,,9001
+1543,9603,8606,915.0,,9001
+1543,9603,8607,344.0,,9001
+1544,9603,8605,-17.51,,9001
+1544,9603,8606,-108.32,,9001
+1544,9603,8607,-62.39,,9001
+1545,9603,8605,-121.8,,9001
+1545,9603,8606,98.1,,9001
+1545,9603,8607,-15.2,,9001
+1546,9603,8605,-146.21,,9001
+1546,9603,8606,112.63,,9001
+1546,9603,8607,4.05,,9001
+1547,9603,8605,-173.0,,9001
+1547,9603,8606,253.0,,9001
+1547,9603,8607,27.0,,9001
+1548,9603,8605,-66.87,,9001
+1548,9603,8606,4.37,,9001
+1548,9603,8607,-38.52,,9001
+1549,9603,8605,-158.0,,9001
+1549,9603,8606,315.0,,9001
+1549,9603,8607,-148.0,,9001
+1550,9603,8605,-139.62,,9001
+1550,9603,8606,290.53,,9001
+1550,9603,8607,-150.29,,9001
+1551,9603,8605,-141.15,,9001
+1551,9603,8606,293.44,,9001
+1551,9603,8607,-150.56,,9001
+1552,9603,8605,-142.48,,9001
+1552,9603,8606,296.03,,9001
+1552,9603,8607,-149.74,,9001
+1553,9613,8657,,ilhpgn.las,
+1553,9613,8658,,ilhpgn.los,
+1554,9613,8657,,njhpgn.las,
+1554,9613,8658,,njhpgn.los,
+1555,9603,8605,-0.465,,9001
+1555,9603,8606,372.095,,9001
+1555,9603,8607,171.736,,9001
+1556,9603,8605,-2.0,,9001
+1556,9603,8606,374.0,,9001
+1556,9603,8607,172.0,,9001
+1557,9603,8605,-254.1,,9001
+1557,9603,8606,-5.4,,9001
+1557,9603,8607,-100.3,,9001
+1558,9603,8605,0.0,,9001
+1558,9603,8606,0.0,,9001
+1558,9603,8607,0.0,,9001
+1559,9615,8656,,wa_0400.gsb,
+1560,9603,8605,-156.5,,9001
+1560,9603,8606,-87.2,,9001
+1560,9603,8607,285.9,,9001
+1561,9603,8605,-128.0,,9001
+1561,9603,8606,-283.0,,9001
+1561,9603,8607,22.0,,9001
+1562,9603,8605,-128.16,,9001
+1562,9603,8606,-282.42,,9001
+1562,9603,8607,21.93,,9001
+1563,9603,8605,-128.033,,9001
+1563,9603,8606,-283.697,,9001
+1563,9603,8607,21.052,,9001
+1564,9607,8605,59.47,,9001
+1564,9607,8606,-5.04,,9001
+1564,9607,8607,187.44,,9001
+1564,9607,8608,-0.47,,9104
+1564,9607,8609,0.1,,9104
+1564,9607,8610,-1.024,,9104
+1564,9607,8611,-4.5993,,9202
+1565,9603,8605,0.0,,9001
+1565,9603,8606,0.0,,9001
+1565,9603,8607,0.0,,9001
+1566,9603,8605,54.4,,9001
+1566,9603,8606,-20.1,,9001
+1566,9603,8607,183.1,,9001
+1567,9607,8605,59.47,,9001
+1567,9607,8606,-5.04,,9001
+1567,9607,8607,187.44,,9001
+1567,9607,8608,-0.47,,9104
+1567,9607,8609,0.1,,9104
+1567,9607,8610,1.024,,9104
+1567,9607,8611,-4.5993,,9202
+1568,9615,8656,,nzgd2kgrid0005.gsb,
+1569,9603,8605,-199.0,,9001
+1569,9603,8606,32.0,,9001
+1569,9603,8607,322.0,,9001
+1570,9603,8605,-171.16,,9001
+1570,9603,8606,17.29,,9001
+1570,9603,8607,323.31,,9001
+1571,9607,8605,565.04,,9001
+1571,9607,8606,49.91,,9001
+1571,9607,8607,465.84,,9001
+1571,9607,8608,1.9848,,9109
+1571,9607,8609,-1.7439,,9109
+1571,9607,8610,9.0587,,9109
+1571,9607,8611,4.0772,,9202
+1572,9615,8656,,NAD83-98.gsb,
+1573,9615,8656,,QUE27-83.gsb,
+1574,9615,8656,,QUE27-98.gsb,
+1575,9615,8656,,CGQ77-83.gsb,
+1576,9615,8656,,CGQ77-98.gsb,
+1577,9603,8605,-115.0,,9001
+1577,9603,8606,118.0,,9001
+1577,9603,8607,426.0,,9001
+1578,9613,8657,,wshpgn.las,
+1578,9613,8658,,wshpgn.los,
+1579,9613,8657,,eshpgn.las,
+1579,9613,8658,,eshpgn.los,
+1580,9603,8605,0.0,,9001
+1580,9603,8606,0.0,,9001
+1580,9603,8607,0.0,,9001
+1581,9603,8605,0.0,,9001
+1581,9603,8606,0.0,,9001
+1581,9603,8607,0.0,,9001
+1582,9603,8605,-259.73,,9001
+1582,9603,8606,173.12,,9001
+1582,9603,8607,-398.27,,9001
+1583,9603,8605,-307.7,,9001
+1583,9603,8606,265.3,,9001
+1583,9603,8607,-363.5,,9001
+1584,9603,8605,-174.6,,9001
+1584,9603,8606,-3.1,,9001
+1584,9603,8607,236.2,,9001
+1585,9603,8605,-177.5,,9001
+1585,9603,8606,14.1,,9001
+1585,9603,8607,237.6,,9001
+1586,9606,8605,-175.09,,9001
+1586,9606,8606,1.218,,9001
+1586,9606,8607,238.831,,9001
+1586,9606,8608,-0.047,,9104
+1586,9606,8609,0.019,,9104
+1586,9606,8610,0.808,,9104
+1586,9606,8611,0.1698,,9202
+1587,9603,8605,-191.77,,9001
+1587,9603,8606,15.01,,9001
+1587,9603,8607,235.07,,9001
+1588,9606,8605,-116.641,,9001
+1588,9606,8606,-56.931,,9001
+1588,9606,8607,-110.559,,9001
+1588,9606,8608,4.327,,9109
+1588,9606,8609,4.464,,9109
+1588,9606,8610,-4.444,,9109
+1588,9606,8611,-3.52,,9202
+1589,9620,8659,1588.0,,
+1589,9620,8660,8570.0,,
+1589,9620,8661,,ED50 to ETRF89 (1),
+1589,9620,8662,,ED50 to ETRF89 (2),
+1590,9620,8659,8569.0,,
+1590,9620,8660,8046.0,,
+1590,9620,8661,,ED50 to WGS 84 (21),
+1590,9620,8662,,ED50 to WGS 84 (14),
+1591,9603,8605,0.0,,9001
+1591,9603,8606,0.0,,9001
+1591,9603,8607,0.0,,9001
+1592,9603,8605,-678.0,,9001
+1592,9603,8606,670.0,,9001
+1592,9603,8607,-48.0,,9001
+1593,9615,8656,,wa_0700.gsb,
+1594,9607,8605,-120.271,,9001
+1594,9607,8606,-64.543,,9001
+1594,9607,8607,161.632,,9001
+1594,9607,8608,-0.217,,9104
+1594,9607,8609,0.067,,9104
+1594,9607,8610,0.129,,9104
+1594,9607,8611,2.499,,9202
+1595,9607,8605,-124.133,,9001
+1595,9607,8606,-42.003,,9001
+1595,9607,8607,137.4,,9001
+1595,9607,8608,0.008,,9104
+1595,9607,8609,-0.557,,9104
+1595,9607,8610,-0.178,,9104
+1595,9607,8611,-1.854,,9202
+1596,9615,8656,,SEAust_21_06_00.gsb,
+1597,9603,8605,304.5,,9001
+1597,9603,8606,306.5,,9001
+1597,9603,8607,-318.1,,9001
+1598,9603,8605,0.0,,9001
+1598,9603,8606,0.0,,9001
+1598,9603,8607,0.0,,9001
+1599,9615,8656,,PE7783V2.gsb,
+1600,9615,8656,,SK27-98.gsb,
+1601,9615,8656,,SK83-98.gsb,
+1602,9615,8656,,AB_CSRS.DAC,
+1603,9634,8665,,TRNB2777.DAT,
+1604,9634,8665,,TRNS2777.DAT,
+1605,9634,8665,,TRPE2777.DAT,
+1606,9634,8665,,TRNB2777.DAT,
+1607,9634,8665,,TRNS2777.DAT,
+1608,9634,8665,,TRPE2777.DAT,
+1609,9607,8605,-99.059,,9001
+1609,9607,8606,53.322,,9001
+1609,9607,8607,-112.486,,9001
+1609,9607,8608,-0.419,,9104
+1609,9607,8609,0.83,,9104
+1609,9607,8610,-1.885,,9104
+1609,9607,8611,0.999999,,9201
+1610,9603,8605,-125.8,,9001
+1610,9603,8606,79.9,,9001
+1610,9603,8607,-100.5,,9001
+1611,9603,8605,0.0,,9001
+1611,9603,8606,0.0,,9001
+1611,9603,8607,0.0,,9001
+1612,9606,8605,-116.641,,9001
+1612,9606,8606,-56.931,,9001
+1612,9606,8607,-110.559,,9001
+1612,9606,8608,0.893,,9104
+1612,9606,8609,0.921,,9104
+1612,9606,8610,-0.917,,9104
+1612,9606,8611,-3.52,,9202
+1613,9606,8605,-90.365,,9001
+1613,9606,8606,-101.13,,9001
+1613,9606,8607,-123.384,,9001
+1613,9606,8608,0.333,,9104
+1613,9606,8609,0.077,,9104
+1613,9606,8610,0.894,,9104
+1613,9606,8611,1.994,,9202
+1614,9603,8605,-88.0,,9001
+1614,9603,8606,4.0,,9001
+1614,9603,8607,101.0,,9001
+1615,9603,8605,-726.282,,9001
+1615,9603,8606,703.611,,9001
+1615,9603,8607,-48.999,,9001
+1616,9606,8605,-182.046,,9001
+1616,9606,8606,-225.604,,9001
+1616,9606,8607,168.884,,9001
+1616,9606,8608,-0.616,,9104
+1616,9606,8609,-1.655,,9104
+1616,9606,8610,7.824,,9104
+1616,9606,8611,16.641,,9202
+1617,9606,8605,-191.808,,9001
+1617,9606,8606,-250.512,,9001
+1617,9606,8607,167.861,,9001
+1617,9606,8608,-0.792,,9104
+1617,9606,8609,-1.653,,9104
+1617,9606,8610,8.558,,9104
+1617,9606,8611,20.703,,9202
+1618,9606,8605,577.326,,9001
+1618,9606,8606,90.129,,9001
+1618,9606,8607,463.919,,9001
+1618,9606,8608,5.137,,9104
+1618,9606,8609,1.474,,9104
+1618,9606,8610,5.297,,9104
+1618,9606,8611,2.4232,,9202
+1619,9606,8605,577.3,,9001
+1619,9606,8606,90.1,,9001
+1619,9606,8607,463.9,,9001
+1619,9606,8608,5.137,,9104
+1619,9606,8609,1.474,,9104
+1619,9606,8610,5.297,,9104
+1619,9606,8611,2.42,,9202
+1620,9606,8605,551.7,,9001
+1620,9606,8606,162.9,,9001
+1620,9606,8607,467.9,,9001
+1620,9606,8608,6.04,,9104
+1620,9606,8609,1.96,,9104
+1620,9606,8610,-11.38,,9104
+1620,9606,8611,-4.82,,9202
+1621,9606,8605,551.7,,9001
+1621,9606,8606,162.9,,9001
+1621,9606,8607,467.9,,9001
+1621,9606,8608,6.04,,9104
+1621,9606,8609,1.96,,9104
+1621,9606,8610,-11.38,,9104
+1621,9606,8611,-4.82,,9202
+1622,9606,8605,570.8,,9001
+1622,9606,8606,85.7,,9001
+1622,9606,8607,462.8,,9001
+1622,9606,8608,4.998,,9104
+1622,9606,8609,1.587,,9104
+1622,9606,8610,5.261,,9104
+1622,9606,8611,3.56,,9202
+1623,9606,8605,570.8,,9001
+1623,9606,8606,85.7,,9001
+1623,9606,8607,462.8,,9001
+1623,9606,8608,4.998,,9104
+1623,9606,8609,1.587,,9104
+1623,9606,8610,5.261,,9104
+1623,9606,8611,3.56,,9202
+1624,9606,8605,559.0,,9001
+1624,9606,8606,68.7,,9001
+1624,9606,8607,451.5,,9001
+1624,9606,8608,7.92,,9104
+1624,9606,8609,4.073,,9104
+1624,9606,8610,4.251,,9104
+1624,9606,8611,5.71,,9202
+1625,9606,8605,559.0,,9001
+1625,9606,8606,68.7,,9001
+1625,9606,8607,451.5,,9001
+1625,9606,8608,7.92,,9104
+1625,9606,8609,4.073,,9104
+1625,9606,8610,4.251,,9104
+1625,9606,8611,5.71,,9202
+1626,9606,8605,-81.1,,9001
+1626,9606,8606,-89.4,,9001
+1626,9606,8607,-115.8,,9001
+1626,9606,8608,0.485,,9104
+1626,9606,8609,0.024,,9104
+1626,9606,8610,0.413,,9104
+1626,9606,8611,-0.54,,9202
+1627,9606,8605,-81.1,,9001
+1627,9606,8606,-89.4,,9001
+1627,9606,8607,-115.8,,9001
+1627,9606,8608,0.485,,9104
+1627,9606,8609,0.024,,9104
+1627,9606,8610,0.413,,9104
+1627,9606,8611,-0.54,,9202
+1628,9603,8605,-116.8,,9001
+1628,9603,8606,-106.4,,9001
+1628,9603,8607,-154.4,,9001
+1629,9603,8605,-116.8,,9001
+1629,9603,8606,-106.4,,9001
+1629,9603,8607,-154.4,,9001
+1630,9606,8605,-181.5,,9001
+1630,9606,8606,-90.3,,9001
+1630,9606,8607,-187.2,,9001
+1630,9606,8608,0.144,,9104
+1630,9606,8609,0.492,,9104
+1630,9606,8610,-0.394,,9104
+1630,9606,8611,17.57,,9202
+1631,9606,8605,-181.5,,9001
+1631,9606,8606,-90.3,,9001
+1631,9606,8607,-187.2,,9001
+1631,9606,8608,0.144,,9104
+1631,9606,8609,0.492,,9104
+1631,9606,8610,-0.394,,9104
+1631,9606,8611,17.57,,9202
+1632,9606,8605,-131.0,,9001
+1632,9606,8606,-100.3,,9001
+1632,9606,8607,-163.4,,9001
+1632,9606,8608,-1.244,,9104
+1632,9606,8609,-0.02,,9104
+1632,9606,8610,-1.144,,9104
+1632,9606,8611,9.39,,9202
+1633,9606,8605,-131.0,,9001
+1633,9606,8606,-100.3,,9001
+1633,9606,8607,-163.4,,9001
+1633,9606,8608,-1.244,,9104
+1633,9606,8609,-0.02,,9104
+1633,9606,8610,-1.144,,9104
+1633,9606,8611,9.39,,9202
+1634,9606,8605,-178.4,,9001
+1634,9606,8606,-83.2,,9001
+1634,9606,8607,-221.3,,9001
+1634,9606,8608,0.54,,9104
+1634,9606,8609,-0.532,,9104
+1634,9606,8610,-0.126,,9104
+1634,9606,8611,21.2,,9202
+1635,9606,8605,-178.4,,9001
+1635,9606,8606,-83.2,,9001
+1635,9606,8607,-221.3,,9001
+1635,9606,8608,0.54,,9104
+1635,9606,8609,-0.532,,9104
+1635,9606,8610,-0.126,,9104
+1635,9606,8611,21.2,,9202
+1638,9606,8605,-90.7,,9001
+1638,9606,8606,-106.1,,9001
+1638,9606,8607,-119.2,,9001
+1638,9606,8608,4.09,,9104
+1638,9606,8609,0.218,,9104
+1638,9606,8610,-1.05,,9104
+1638,9606,8611,1.37,,9202
+1639,9606,8605,-90.7,,9001
+1639,9606,8606,-106.1,,9001
+1639,9606,8607,-119.2,,9001
+1639,9606,8608,4.09,,9104
+1639,9606,8609,0.218,,9104
+1639,9606,8610,-1.05,,9104
+1639,9606,8611,1.37,,9202
+1640,9606,8605,482.5,,9001
+1640,9606,8606,-130.6,,9001
+1640,9606,8607,564.6,,9001
+1640,9606,8608,-1.042,,9104
+1640,9606,8609,-0.214,,9104
+1640,9606,8610,-0.631,,9104
+1640,9606,8611,8.15,,9202
+1641,9606,8605,482.5,,9001
+1641,9606,8606,-130.6,,9001
+1641,9606,8607,564.6,,9001
+1641,9606,8608,-1.042,,9104
+1641,9606,8609,-0.214,,9104
+1641,9606,8610,-0.631,,9104
+1641,9606,8611,8.15,,9202
+1642,9606,8605,-193.0,,9001
+1642,9606,8606,13.7,,9001
+1642,9606,8607,-39.3,,9001
+1642,9606,8608,-0.41,,9104
+1642,9606,8609,-2.933,,9104
+1642,9606,8610,2.688,,9104
+1642,9606,8611,0.43,,9202
+1643,9606,8605,-193.0,,9001
+1643,9606,8606,13.7,,9001
+1643,9606,8607,-39.3,,9001
+1643,9606,8608,-0.41,,9104
+1643,9606,8609,-2.933,,9104
+1643,9606,8610,2.688,,9104
+1643,9606,8611,0.43,,9202
+1644,9606,8605,33.4,,9001
+1644,9606,8606,-146.6,,9001
+1644,9606,8607,-76.3,,9001
+1644,9606,8608,-0.359,,9104
+1644,9606,8609,-0.053,,9104
+1644,9606,8610,0.844,,9104
+1644,9606,8611,-0.84,,9202
+1645,9606,8605,33.4,,9001
+1645,9606,8606,-146.6,,9001
+1645,9606,8607,-76.3,,9001
+1645,9606,8608,-0.359,,9104
+1645,9606,8609,-0.053,,9104
+1645,9606,8610,0.844,,9104
+1645,9606,8611,-0.84,,9202
+1646,9603,8605,674.4,,9001
+1646,9603,8606,15.1,,9001
+1646,9603,8607,405.3,,9001
+1647,9603,8605,674.374,,9001
+1647,9603,8606,15.056,,9001
+1647,9603,8607,405.346,,9001
+1648,9603,8605,0.0,,9001
+1648,9603,8606,0.0,,9001
+1648,9603,8607,0.0,,9001
+1649,9603,8605,0.0,,9001
+1649,9603,8606,0.0,,9001
+1649,9603,8607,0.0,,9001
+1650,9603,8605,-84.0,,9001
+1650,9603,8606,-97.0,,9001
+1650,9603,8607,-117.0,,9001
+1651,9603,8605,-168.0,,9001
+1651,9603,8606,-60.0,,9001
+1651,9603,8607,320.0,,9001
+1652,9606,8605,-99.1,,9001
+1652,9606,8606,53.3,,9001
+1652,9606,8607,-112.5,,9001
+1652,9606,8608,0.419,,9104
+1652,9606,8609,-0.83,,9104
+1652,9606,8610,1.885,,9104
+1652,9606,8611,-1.0,,9202
+1653,9606,8605,278.3,,9001
+1653,9606,8606,93.0,,9001
+1653,9606,8607,474.5,,9001
+1653,9606,8608,7.889,,9104
+1653,9606,8609,0.05,,9104
+1653,9606,8610,-6.61,,9104
+1653,9606,8611,6.21,,9202
+1654,9606,8605,278.3,,9001
+1654,9606,8606,93.0,,9001
+1654,9606,8607,474.5,,9001
+1654,9606,8608,7.889,,9104
+1654,9606,8609,0.05,,9104
+1654,9606,8610,-6.61,,9104
+1654,9606,8611,6.21,,9202
+1655,9606,8605,-280.9,,9001
+1655,9606,8606,-89.8,,9001
+1655,9606,8607,130.2,,9001
+1655,9606,8608,-1.721,,9104
+1655,9606,8609,0.355,,9104
+1655,9606,8610,-0.371,,9104
+1655,9606,8611,-5.92,,9202
+1656,9606,8605,-280.9,,9001
+1656,9606,8606,-89.8,,9001
+1656,9606,8607,130.2,,9001
+1656,9606,8608,-1.721,,9104
+1656,9606,8609,0.355,,9104
+1656,9606,8610,-0.371,,9104
+1656,9606,8611,-5.92,,9202
+1657,9606,8605,-238.2,,9001
+1657,9606,8606,85.2,,9001
+1657,9606,8607,29.9,,9001
+1657,9606,8608,0.166,,9104
+1657,9606,8609,0.046,,9104
+1657,9606,8610,1.248,,9104
+1657,9606,8611,2.03,,9202
+1658,9606,8605,-238.2,,9001
+1658,9606,8606,85.2,,9001
+1658,9606,8607,29.9,,9001
+1658,9606,8608,0.166,,9104
+1658,9606,8609,0.046,,9104
+1658,9606,8610,1.248,,9104
+1658,9606,8611,2.03,,9202
+1659,9606,8605,-104.1,,9001
+1659,9606,8606,-49.1,,9001
+1659,9606,8607,-9.9,,9001
+1659,9606,8608,0.971,,9104
+1659,9606,8609,-2.917,,9104
+1659,9606,8610,0.714,,9104
+1659,9606,8611,-11.68,,9202
+1660,9606,8605,-104.1,,9001
+1660,9606,8606,-49.1,,9001
+1660,9606,8607,-9.9,,9001
+1660,9606,8608,0.971,,9104
+1660,9606,8609,-2.917,,9104
+1660,9606,8610,0.714,,9104
+1660,9606,8611,-11.68,,9202
+1661,9606,8605,-168.6,,9001
+1661,9606,8606,-34.0,,9001
+1661,9606,8607,38.6,,9001
+1661,9606,8608,-0.374,,9104
+1661,9606,8609,-0.679,,9104
+1661,9606,8610,-1.379,,9104
+1661,9606,8611,-9.48,,9202
+1662,9606,8605,-168.6,,9001
+1662,9606,8606,-34.0,,9001
+1662,9606,8607,38.6,,9001
+1662,9606,8608,-0.374,,9104
+1662,9606,8609,-0.679,,9104
+1662,9606,8610,-1.379,,9104
+1662,9606,8611,-9.48,,9202
+1663,9606,8605,-50.2,,9001
+1663,9606,8606,-50.4,,9001
+1663,9606,8607,84.8,,9001
+1663,9606,8608,-0.69,,9104
+1663,9606,8609,-2.012,,9104
+1663,9606,8610,0.459,,9104
+1663,9606,8611,-28.08,,9202
+1664,9606,8605,-50.2,,9001
+1664,9606,8606,-50.4,,9001
+1664,9606,8607,84.8,,9001
+1664,9606,8608,-0.69,,9104
+1664,9606,8609,-2.012,,9104
+1664,9606,8610,0.459,,9104
+1664,9606,8611,-28.08,,9202
+1665,9607,8605,-129.193,,9001
+1665,9607,8606,-41.212,,9001
+1665,9607,8607,130.73,,9001
+1665,9607,8608,-0.246,,9104
+1665,9607,8609,-0.374,,9104
+1665,9607,8610,-0.329,,9104
+1665,9607,8611,-2.955,,9202
+1666,9607,8605,-119.353,,9001
+1666,9607,8606,-48.301,,9001
+1666,9607,8607,139.484,,9001
+1666,9607,8608,-0.415,,9104
+1666,9607,8609,-0.26,,9104
+1666,9607,8610,-0.437,,9104
+1666,9607,8611,-0.613,,9202
+1667,9607,8605,-120.271,,9001
+1667,9607,8606,-64.543,,9001
+1667,9607,8607,161.632,,9001
+1667,9607,8608,-0.217,,9104
+1667,9607,8609,0.067,,9104
+1667,9607,8610,0.129,,9104
+1667,9607,8611,2.499,,9202
+1668,9607,8605,-124.133,,9001
+1668,9607,8606,-42.003,,9001
+1668,9607,8607,137.4,,9001
+1668,9607,8608,0.008,,9104
+1668,9607,8609,-0.557,,9104
+1668,9607,8610,-0.178,,9104
+1668,9607,8611,-1.854,,9202
+1669,9607,8605,-117.763,,9001
+1669,9607,8606,-51.51,,9001
+1669,9607,8607,139.061,,9001
+1669,9607,8608,-0.292,,9104
+1669,9607,8609,-0.443,,9104
+1669,9607,8610,-0.277,,9104
+1669,9607,8611,-0.191,,9202
+1670,9615,8656,,nzgd2kgrid0005.gsb,
+1671,9603,8605,0.0,,9001
+1671,9603,8606,0.0,,9001
+1671,9603,8607,0.0,,9001
+1672,9607,8605,565.04,,9001
+1672,9607,8606,49.91,,9001
+1672,9607,8607,465.84,,9001
+1672,9607,8608,1.9848,,9109
+1672,9607,8609,-1.7439,,9109
+1672,9607,8610,9.0587,,9109
+1672,9607,8611,4.0772,,9202
+1673,9607,8605,582.0,,9001
+1673,9607,8606,105.0,,9001
+1673,9607,8607,414.0,,9001
+1673,9607,8608,-1.04,,9104
+1673,9607,8609,-0.35,,9104
+1673,9607,8610,3.08,,9104
+1673,9607,8611,8.3,,9202
+1674,9607,8605,24.0,,9001
+1674,9607,8606,-123.0,,9001
+1674,9607,8607,-94.0,,9001
+1674,9607,8608,-0.02,,9104
+1674,9607,8609,0.25,,9104
+1674,9607,8610,0.13,,9104
+1674,9607,8611,1.1,,9202
+1675,9607,8605,24.0,,9001
+1675,9607,8606,-123.0,,9001
+1675,9607,8607,-94.0,,9001
+1675,9607,8608,-0.02,,9104
+1675,9607,8609,0.25,,9104
+1675,9607,8610,0.13,,9104
+1675,9607,8611,1.1,,9202
+1676,9603,8605,674.374,,9001
+1676,9603,8606,15.056,,9001
+1676,9603,8607,405.346,,9001
+1677,9607,8605,56.0,,9001
+1677,9607,8606,75.77,,9001
+1677,9607,8607,15.31,,9001
+1677,9607,8608,-0.37,,9104
+1677,9607,8609,-0.2,,9104
+1677,9607,8610,-0.21,,9104
+1677,9607,8611,-1.01,,9202
+1678,9603,8605,0.0,,9001
+1678,9603,8606,0.0,,9001
+1678,9603,8607,0.0,,9001
+1679,9607,8605,-40.595,,9001
+1679,9607,8606,-18.55,,9001
+1679,9607,8607,-69.339,,9001
+1679,9607,8608,-2.508,,9104
+1679,9607,8609,-1.832,,9104
+1679,9607,8610,2.611,,9104
+1679,9607,8611,-4.299,,9202
+1680,9607,8605,419.3836,,9001
+1680,9607,8606,99.3335,,9001
+1680,9607,8607,591.3451,,9001
+1680,9607,8608,-0.850389,,9104
+1680,9607,8609,-1.817277,,9104
+1680,9607,8610,7.862238,,9104
+1680,9607,8611,-0.99496,,9202
+1681,9633,8664,,ostn97.txt,
+1682,9603,8605,-76.0,,9001
+1682,9603,8606,-138.0,,9001
+1682,9603,8607,67.0,,9001
+1683,9607,8605,-115.064,,9001
+1683,9607,8606,-87.39,,9001
+1683,9607,8607,-101.716,,9001
+1683,9607,8608,0.058,,9104
+1683,9607,8609,-4.001,,9104
+1683,9607,8610,2.062,,9104
+1683,9607,8611,9.366,,9202
+1684,9607,8605,-82.875,,9001
+1684,9607,8606,-57.097,,9001
+1684,9607,8607,-156.768,,9001
+1684,9607,8608,2.158,,9104
+1684,9607,8609,-1.524,,9104
+1684,9607,8610,0.982,,9104
+1684,9607,8611,-0.359,,9202
+1685,9607,8605,-138.527,,9001
+1685,9607,8606,-91.999,,9001
+1685,9607,8607,-114.591,,9001
+1685,9607,8608,0.14,,9104
+1685,9607,8609,-3.363,,9104
+1685,9607,8610,2.217,,9104
+1685,9607,8611,11.748,,9202
+1686,9607,8605,-73.472,,9001
+1686,9607,8606,-51.66,,9001
+1686,9607,8607,-112.482,,9001
+1686,9607,8608,-0.953,,9104
+1686,9607,8609,-4.6,,9104
+1686,9607,8610,2.368,,9104
+1686,9607,8611,0.586,,9202
+1687,9607,8605,219.315,,9001
+1687,9607,8606,168.975,,9001
+1687,9607,8607,-166.145,,9001
+1687,9607,8608,-0.198,,9104
+1687,9607,8609,-5.926,,9104
+1687,9607,8610,2.356,,9104
+1687,9607,8611,-57.104,,9202
+1688,9615,8656,,NB7783v2.gsb,
+1689,9615,8656,,PE7783V2.gsb,
+1690,9615,8656,,May76v20.gsb,
+1691,9615,8656,,CGQ77-98.gsb,
+1692,9615,8656,,QUE27-98.gsb,
+1693,9615,8656,,NTv2_0.gsb,
+1694,9613,8657,,wshpgn.las,
+1694,9613,8658,,wshpgn.los,
+1695,9613,8657,,eshpgn.las,
+1695,9613,8658,,eshpgn.los,
+1696,9615,8656,,NAD83-98.gsb,
+1697,9615,8656,,SK83-98.gsb,
+1698,9613,8657,,stgeorge.las,
+1698,9613,8658,,stgeorge.los,
+1699,9613,8657,,stlrnc.las,
+1699,9613,8658,,stlrnc.los,
+1700,9613,8657,,stpaul.las,
+1700,9613,8658,,stpaul.los,
+1701,9607,8605,59.47,,9001
+1701,9607,8606,-5.04,,9001
+1701,9607,8607,187.44,,9001
+1701,9607,8608,-0.47,,9104
+1701,9607,8609,0.1,,9104
+1701,9607,8610,-1.024,,9104
+1701,9607,8611,-4.5993,,9202
+1702,9615,8656,,AB_CSRS.DAC,
+1703,9615,8656,,SK27-98.gsb,
+1704,9613,8657,,arhpgn.las,
+1704,9613,8658,,arhpgn.los,
+1705,9613,8657,,iahpgn.las,
+1705,9613,8658,,iahpgn.los,
+1706,9613,8657,,mnhpgn.las,
+1706,9613,8658,,mnhpgn.los,
+1707,9613,8657,,mohpgn.las,
+1707,9613,8658,,mohpgn.los,
+1708,9613,8657,,arhpgn.las,
+1708,9613,8658,,arhpgn.los,
+1709,9613,8657,,iahpgn.las,
+1709,9613,8658,,iahpgn.los,
+1710,9613,8657,,mnhpgn.las,
+1710,9613,8658,,mnhpgn.los,
+1711,9613,8657,,mohpgn.las,
+1711,9613,8658,,mohpgn.los,
+1712,9613,8657,,cohpgn.las,
+1712,9613,8658,,cohpgn.los,
+1713,9613,8657,,gahpgn.las,
+1713,9613,8658,,gahpgn.los,
+1714,9613,8657,,flhpgn.las,
+1714,9613,8658,,flhpgn.los,
+1715,9613,8657,,emhpgn.las,
+1715,9613,8658,,emhpgn.los,
+1716,9613,8657,,wmhpgn.las,
+1716,9613,8658,,wmhpgn.los,
+1717,9613,8657,,alhpgn.las,
+1717,9613,8658,,alhpgn.los,
+1718,9613,8657,,kyhpgn.las,
+1718,9613,8658,,kyhpgn.los,
+1719,9613,8657,,lahpgn.las,
+1719,9613,8658,,lahpgn.los,
+1720,9613,8657,,mdhpgn.las,
+1720,9613,8658,,mdhpgn.los,
+1721,9613,8657,,mehpgn.las,
+1721,9613,8658,,mehpgn.los,
+1722,9613,8657,,mihpgn.las,
+1722,9613,8658,,mihpgn.los,
+1723,9613,8657,,mshpgn.las,
+1723,9613,8658,,mshpgn.los,
+1724,9613,8657,,nbhpgn.las,
+1724,9613,8658,,nbhpgn.los,
+1725,9613,8657,,nehpgn.las,
+1725,9613,8658,,nehpgn.los,
+1726,9613,8657,,nmhpgn.las,
+1726,9613,8658,,nmhpgn.los,
+1727,9613,8657,,nyhpgn.las,
+1727,9613,8658,,nyhpgn.los,
+1728,9613,8657,,azhpgn.las,
+1728,9613,8658,,azhpgn.los,
+1729,9613,8657,,ndhpgn.las,
+1729,9613,8658,,ndhpgn.los,
+1730,9613,8657,,okhpgn.las,
+1730,9613,8658,,okhpgn.los,
+1731,9613,8657,,pvhpgn.las,
+1731,9613,8658,,pvhpgn.los,
+1732,9613,8657,,sdhpgn.las,
+1732,9613,8658,,sdhpgn.los,
+1733,9613,8657,,tnhpgn.las,
+1733,9613,8658,,tnhpgn.los,
+1734,9613,8657,,ethpgn.las,
+1734,9613,8658,,ethpgn.los,
+1735,9613,8657,,wthpgn.las,
+1735,9613,8658,,wthpgn.los,
+1736,9613,8657,,vahpgn.las,
+1736,9613,8658,,vahpgn.los,
+1737,9613,8657,,wohpgn.las,
+1737,9613,8658,,wohpgn.los,
+1738,9613,8657,,wihpgn.las,
+1738,9613,8658,,wihpgn.los,
+1739,9613,8657,,cnhpgn.las,
+1739,9613,8658,,cnhpgn.los,
+1740,9613,8657,,wyhpgn.las,
+1740,9613,8658,,wyhpgn.los,
+1741,9613,8657,,hihpgn.las,
+1741,9613,8658,,hihpgn.los,
+1742,9613,8657,,inhpgn.las,
+1742,9613,8658,,inhpgn.los,
+1743,9613,8657,,kshpgn.las,
+1743,9613,8658,,kshpgn.los,
+1744,9613,8657,,nvhpgn.las,
+1744,9613,8658,,nvhpgn.los,
+1745,9613,8657,,ohhpgn.las,
+1745,9613,8658,,ohhpgn.los,
+1746,9613,8657,,uthpgn.las,
+1746,9613,8658,,uthpgn.los,
+1747,9613,8657,,wvhpgn.las,
+1747,9613,8658,,wvhpgn.los,
+1748,9613,8657,,ilhpgn.las,
+1748,9613,8658,,ilhpgn.los,
+1749,9613,8657,,njhpgn.las,
+1749,9613,8658,,njhpgn.los,
+1750,9613,8657,,cshpgn.las,
+1750,9613,8658,,cshpgn.los,
+1751,9607,8605,565.04,,9001
+1751,9607,8606,49.91,,9001
+1751,9607,8607,465.84,,9001
+1751,9607,8608,1.9848,,9109
+1751,9607,8609,-1.7439,,9109
+1751,9607,8610,9.0587,,9109
+1751,9607,8611,4.0772,,9202
+1752,9615,8656,,AB_CSRS.DAC,
+1753,9607,8605,660.077,,9001
+1753,9607,8606,13.551,,9001
+1753,9607,8607,369.344,,9001
+1753,9607,8608,2.484,,9113
+1753,9607,8609,1.783,,9113
+1753,9607,8610,2.939,,9113
+1753,9607,8611,5.66,,9202
+1754,9606,8605,-111.92,,9001
+1754,9606,8606,-87.85,,9001
+1754,9606,8607,114.5,,9001
+1754,9606,8608,1.875,,9104
+1754,9606,8609,0.202,,9104
+1754,9606,8610,0.219,,9104
+1754,9606,8611,0.032,,9202
+1755,9601,8602,-74.04513,,9110
+1756,9601,8602,-9.0754862,,9110
+1757,9601,8602,-17.4,,9110
+1758,9601,8602,106.482779,,9110
+1759,9601,8602,106.482779,,9110
+1760,9601,8602,18.03298,,9110
+1761,9601,8602,23.4258815,,9110
+1762,9601,8602,10.43225,,9110
+1763,9601,8602,2.5969213,,9105
+1764,9601,8602,2.201395,,9110
+1765,9601,8602,7.26225,,9110
+1766,9603,8605,674.4,,9001
+1766,9603,8606,15.1,,9001
+1766,9603,8607,405.3,,9001
+1767,9603,8605,0.0,,9001
+1767,9603,8606,0.0,,9001
+1767,9603,8607,0.0,,9001
+1768,9603,8605,0.0,,9001
+1768,9603,8606,0.0,,9001
+1768,9603,8607,0.0,,9001
+1769,9636,8605,-270.933,,9001
+1769,9636,8606,115.599,,9001
+1769,9636,8607,-360.226,,9001
+1769,9636,8608,-5.266,,9104
+1769,9636,8609,-1.238,,9104
+1769,9636,8610,2.381,,9104
+1769,9636,8611,-5.109,,9202
+1769,9636,8617,2464351.59,,9001
+1769,9636,8618,-5783466.61,,9001
+1769,9636,8667,974809.81,,9001
+1770,9636,8605,-270.933,,9001
+1770,9636,8606,115.599,,9001
+1770,9636,8607,-360.226,,9001
+1770,9636,8608,-5.266,,9104
+1770,9636,8609,-1.238,,9104
+1770,9636,8610,2.381,,9104
+1770,9636,8611,-5.109,,9202
+1770,9636,8617,2464351.59,,9001
+1770,9636,8618,-5783466.61,,9001
+1770,9636,8667,974809.81,,9001
+1771,9636,8605,-270.933,,9001
+1771,9636,8606,115.599,,9001
+1771,9636,8607,-360.226,,9001
+1771,9636,8608,-5.266,,9104
+1771,9636,8609,-1.238,,9104
+1771,9636,8610,2.381,,9104
+1771,9636,8611,-5.109,,9202
+1771,9636,8617,2464351.59,,9001
+1771,9636,8618,-5783466.61,,9001
+1771,9636,8667,974809.81,,9001
+1772,9636,8605,-270.933,,9001
+1772,9636,8606,115.599,,9001
+1772,9636,8607,-360.226,,9001
+1772,9636,8608,-5.266,,9104
+1772,9636,8609,-1.238,,9104
+1772,9636,8610,2.381,,9104
+1772,9636,8611,-5.109,,9202
+1772,9636,8617,2464351.59,,9001
+1772,9636,8618,-5783466.61,,9001
+1772,9636,8667,974809.81,,9001
+1773,9603,8605,0.0,,9001
+1773,9603,8606,0.0,,9001
+1773,9603,8607,0.0,,9001
+1774,9603,8605,0.0,,9001
+1774,9603,8606,0.0,,9001
+1774,9603,8607,0.0,,9001
+1775,9606,8605,24.9,,9001
+1775,9606,8606,-126.4,,9001
+1775,9606,8607,-93.2,,9001
+1775,9606,8608,-0.063,,9104
+1775,9606,8609,-0.247,,9104
+1775,9606,8610,-0.041,,9104
+1775,9606,8611,1.01,,9202
+1776,9606,8605,598.1,,9001
+1776,9606,8606,73.7,,9001
+1776,9606,8607,418.2,,9001
+1776,9606,8608,0.202,,9104
+1776,9606,8609,0.045,,9104
+1776,9606,8610,-2.455,,9104
+1776,9606,8611,6.7,,9202
+1777,9606,8605,598.1,,9001
+1777,9606,8606,73.7,,9001
+1777,9606,8607,418.2,,9001
+1777,9606,8608,0.202,,9104
+1777,9606,8609,0.045,,9104
+1777,9606,8610,-2.455,,9104
+1777,9606,8611,6.7,,9202
+1778,9606,8605,597.1,,9001
+1778,9606,8606,71.4,,9001
+1778,9606,8607,412.1,,9001
+1778,9606,8608,0.894,,9104
+1778,9606,8609,0.068,,9104
+1778,9606,8610,-1.563,,9104
+1778,9606,8611,7.58,,9202
+1779,9606,8605,584.8,,9001
+1779,9606,8606,67.0,,9001
+1779,9606,8607,400.3,,9001
+1779,9606,8608,0.105,,9104
+1779,9606,8609,0.013,,9104
+1779,9606,8610,-2.378,,9104
+1779,9606,8611,10.29,,9202
+1780,9606,8605,590.5,,9001
+1780,9606,8606,69.5,,9001
+1780,9606,8607,411.6,,9001
+1780,9606,8608,-0.796,,9104
+1780,9606,8609,-0.052,,9104
+1780,9606,8610,-3.601,,9104
+1780,9606,8611,8.3,,9202
+1781,9606,8605,599.4,,9001
+1781,9606,8606,72.4,,9001
+1781,9606,8607,419.2,,9001
+1781,9606,8608,-0.062,,9104
+1781,9606,8609,-0.022,,9104
+1781,9606,8610,-2.723,,9104
+1781,9606,8611,6.46,,9202
+1782,9606,8605,612.4,,9001
+1782,9606,8606,77.0,,9001
+1782,9606,8607,440.2,,9001
+1782,9606,8608,-0.054,,9104
+1782,9606,8609,0.057,,9104
+1782,9606,8610,-2.797,,9104
+1782,9606,8611,2.55,,9202
+1783,9606,8605,-84.1,,9001
+1783,9606,8606,-101.8,,9001
+1783,9606,8607,-129.7,,9001
+1783,9606,8608,0.0,,9104
+1783,9606,8609,0.0,,9104
+1783,9606,8610,0.468,,9104
+1783,9606,8611,1.05,,9202
+1784,9606,8605,-84.1,,9001
+1784,9606,8606,-101.8,,9001
+1784,9606,8607,-129.7,,9001
+1784,9606,8608,0.0,,9104
+1784,9606,8609,0.0,,9104
+1784,9606,8610,0.468,,9104
+1784,9606,8611,1.05,,9202
+1785,9606,8605,426.9,,9001
+1785,9606,8606,142.6,,9001
+1785,9606,8607,460.1,,9001
+1785,9606,8608,4.91,,9104
+1785,9606,8609,4.49,,9104
+1785,9606,8610,-12.42,,9104
+1785,9606,8611,17.1,,9202
+1786,9606,8605,426.9,,9001
+1786,9606,8606,142.6,,9001
+1786,9606,8607,460.1,,9001
+1786,9606,8608,4.91,,9104
+1786,9606,8609,4.49,,9104
+1786,9606,8610,-12.42,,9104
+1786,9606,8611,17.1,,9202
+1787,9607,8605,414.1,,9001
+1787,9607,8606,41.3,,9001
+1787,9607,8607,603.1,,9001
+1787,9607,8608,-0.855,,9104
+1787,9607,8609,2.141,,9104
+1787,9607,8610,-7.023,,9104
+1787,9607,8611,0.0,,9202
+1788,9607,8605,414.1,,9001
+1788,9607,8606,41.3,,9001
+1788,9607,8607,603.1,,9001
+1788,9607,8608,-0.855,,9104
+1788,9607,8609,2.141,,9104
+1788,9607,8610,-7.023,,9104
+1788,9607,8611,0.0,,9202
+1789,9603,8605,103.25,,9001
+1789,9603,8606,-100.4,,9001
+1789,9603,8607,-307.19,,9001
+1790,9606,8605,-282.1,,9001
+1790,9606,8606,-72.2,,9001
+1790,9606,8607,120.0,,9001
+1790,9606,8608,-1.592,,9104
+1790,9606,8609,0.145,,9104
+1790,9606,8610,-0.89,,9104
+1790,9606,8611,-4.46,,9202
+1791,9606,8605,-282.1,,9001
+1791,9606,8606,-72.2,,9001
+1791,9606,8607,120.0,,9001
+1791,9606,8608,-1.592,,9104
+1791,9606,8609,0.145,,9104
+1791,9606,8610,-0.89,,9104
+1791,9606,8611,-4.46,,9202
+1792,9606,8605,-231.0,,9001
+1792,9606,8606,102.6,,9001
+1792,9606,8607,29.8,,9001
+1792,9606,8608,0.615,,9104
+1792,9606,8609,-0.198,,9104
+1792,9606,8610,0.881,,9104
+1792,9606,8611,1.79,,9202
+1793,9606,8605,-231.0,,9001
+1793,9606,8606,102.6,,9001
+1793,9606,8607,29.8,,9001
+1793,9606,8608,0.615,,9104
+1793,9606,8609,-0.198,,9104
+1793,9606,8610,0.881,,9104
+1793,9606,8611,1.79,,9202
+1794,9603,8605,695.5,,9001
+1794,9603,8606,-216.6,,9001
+1794,9603,8607,491.1,,9001
+1795,9636,8605,408.0895,,9001
+1795,9636,8606,-288.9616,,9001
+1795,9636,8607,791.5498,,9001
+1795,9636,8608,-4.078662,,9104
+1795,9636,8609,0.022669,,9104
+1795,9636,8610,9.825424,,9104
+1795,9636,8611,94.060626,,9202
+1795,9636,8617,4444943.0248,,9001
+1795,9636,8618,1518098.4827,,9001
+1795,9636,8667,4302370.0765,,9001
+1796,9603,8605,-70.9,,9001
+1796,9603,8606,-151.8,,9001
+1796,9603,8607,-41.4,,9001
+1797,9603,8605,164.0,,9001
+1797,9603,8606,138.0,,9001
+1797,9603,8607,-189.0,,9001
+1798,9606,8605,163.511,,9001
+1798,9606,8606,127.533,,9001
+1798,9606,8607,-159.789,,9001
+1798,9606,8608,0.0,,9104
+1798,9606,8609,0.0,,9104
+1798,9606,8610,0.814,,9104
+1798,9606,8611,-0.6,,9202
+1799,9606,8605,105.0,,9001
+1799,9606,8606,326.0,,9001
+1799,9606,8607,-102.5,,9001
+1799,9606,8608,0.0,,9104
+1799,9606,8609,0.0,,9104
+1799,9606,8610,0.814,,9104
+1799,9606,8611,-0.6,,9202
+1800,9606,8605,-45.0,,9001
+1800,9606,8606,417.0,,9001
+1800,9606,8607,-3.5,,9001
+1800,9606,8608,0.0,,9104
+1800,9606,8609,0.0,,9104
+1800,9606,8610,0.814,,9104
+1800,9606,8611,-0.6,,9202
+1801,9603,8605,-145.0,,9001
+1801,9603,8606,52.7,,9001
+1801,9603,8607,-291.6,,9001
+1802,9606,8605,-178.3,,9001
+1802,9606,8606,-316.7,,9001
+1802,9606,8607,-131.5,,9001
+1802,9606,8608,5.278,,9104
+1802,9606,8609,6.077,,9104
+1802,9606,8610,10.979,,9104
+1802,9606,8611,19.166,,9202
+1803,9615,8656,,A66 National (13.09.01).gsb,
+1804,9615,8656,,National 84 (02.07.01).gsb,
+1805,9603,8605,-56.1,,9001
+1805,9603,8606,-167.8,,9001
+1805,9603,8607,13.1,,9001
+1806,9603,8605,-104.4,,9001
+1806,9603,8606,-136.6,,9001
+1806,9603,8607,201.2,,9001
+1807,9606,8605,27.0,,9001
+1807,9606,8606,-135.0,,9001
+1807,9606,8607,-84.5,,9001
+1807,9606,8608,0.0,,9104
+1807,9606,8609,0.0,,9104
+1807,9606,8610,0.554,,9104
+1807,9606,8611,0.2263,,9202
+1808,9606,8605,686.1,,9001
+1808,9606,8606,-123.5,,9001
+1808,9606,8607,-574.4,,9001
+1808,9606,8608,8.045,,9104
+1808,9606,8609,-23.366,,9104
+1808,9606,8610,10.791,,9104
+1808,9606,8611,-2.926,,9202
+1809,9606,8605,926.4,,9001
+1809,9606,8606,-715.9,,9001
+1809,9606,8607,-186.4,,9001
+1809,9606,8608,-10.364,,9104
+1809,9606,8609,-20.78,,9104
+1809,9606,8610,26.452,,9104
+1809,9606,8611,-7.224,,9202
+1810,9606,8605,-84.0,,9001
+1810,9606,8606,-103.0,,9001
+1810,9606,8607,-122.5,,9001
+1810,9606,8608,0.0,,9104
+1810,9606,8609,0.0,,9104
+1810,9606,8610,0.554,,9104
+1810,9606,8611,0.2263,,9202
+1811,9603,8605,-291.87,,9001
+1811,9603,8606,106.37,,9001
+1811,9603,8607,-364.52,,9001
+1812,9606,8605,293.0,,9001
+1812,9606,8606,836.0,,9001
+1812,9606,8607,318.0,,9001
+1812,9606,8608,0.5,,9104
+1812,9606,8609,1.6,,9104
+1812,9606,8610,-2.8,,9104
+1812,9606,8611,2.1,,9202
+1813,9603,8605,-378.873,,9001
+1813,9603,8606,676.002,,9001
+1813,9603,8607,-46.255,,9001
+1814,9603,8605,-377.7,,9001
+1814,9603,8606,675.1,,9001
+1814,9603,8607,-52.2,,9001
+1815,9606,8605,-152.9,,9001
+1815,9606,8606,43.8,,9001
+1815,9606,8607,358.3,,9001
+1815,9606,8608,2.714,,9104
+1815,9606,8609,1.386,,9104
+1815,9606,8610,-2.788,,9104
+1815,9606,8611,-6.743,,9202
+1816,9603,8605,-95.7,,9001
+1816,9603,8606,10.2,,9001
+1816,9603,8607,158.9,,9001
+1817,9603,8605,-165.914,,9001
+1817,9603,8606,-70.607,,9001
+1817,9603,8607,305.009,,9001
+1818,9606,8605,-89.0,,9001
+1818,9606,8606,-112.0,,9001
+1818,9606,8607,125.9,,9001
+1818,9606,8608,0.0,,9104
+1818,9606,8609,0.0,,9104
+1818,9606,8610,0.814,,9104
+1818,9606,8611,-0.38,,9202
+1819,9606,8605,-111.92,,9001
+1819,9606,8606,-87.85,,9001
+1819,9606,8607,114.5,,9001
+1819,9606,8608,1.875,,9104
+1819,9606,8609,0.202,,9104
+1819,9606,8610,0.219,,9104
+1819,9606,8611,0.032,,9202
+1820,9603,8605,-93.2,,9001
+1820,9603,8606,-93.31,,9001
+1820,9603,8607,121.156,,9001
+1821,9603,8605,-88.98,,9001
+1821,9603,8606,-83.23,,9001
+1821,9603,8607,113.55,,9001
+1822,9603,8605,-92.726,,9001
+1822,9603,8606,-90.304,,9001
+1822,9603,8607,115.735,,9001
+1823,9603,8605,-93.134,,9001
+1823,9603,8606,-86.647,,9001
+1823,9603,8607,114.196,,9001
+1824,9603,8605,-93.0,,9001
+1824,9603,8606,-94.0,,9001
+1824,9603,8607,124.0,,9001
+1825,9606,8605,-162.619,,9001
+1825,9606,8606,-276.959,,9001
+1825,9606,8607,-161.764,,9001
+1825,9606,8608,0.067753,,9104
+1825,9606,8609,-2.243649,,9104
+1825,9606,8610,-1.158827,,9104
+1825,9606,8611,-1.094246,,9202
+1826,9603,8605,0.0,,9001
+1826,9603,8606,0.0,,9001
+1826,9603,8607,0.0,,9001
+1827,9618,8601,7.92,,9104
+1827,9618,8602,-13.88,,9104
+1827,9618,8604,26.1,,9001
+1828,9603,8605,-37.0,,9001
+1828,9603,8606,157.0,,9001
+1828,9603,8607,85.0,,9001
+1829,9607,8605,56.0,,9001
+1829,9607,8606,-75.77,,9001
+1829,9607,8607,-15.31,,9001
+1829,9607,8608,0.37,,9104
+1829,9607,8609,0.2,,9104
+1829,9607,8610,0.21,,9104
+1829,9607,8611,1.01,,9202
+1830,9607,8605,56.0,,9001
+1830,9607,8606,-75.77,,9001
+1830,9607,8607,-15.31,,9001
+1830,9607,8608,0.37,,9104
+1830,9607,8609,0.2,,9104
+1830,9607,8610,0.21,,9104
+1830,9607,8611,1.01,,9202
+1831,9603,8605,57.01,,9001
+1831,9603,8606,-69.97,,9001
+1831,9603,8607,-9.29,,9001
+1832,9606,8605,2.691,,9001
+1832,9606,8606,-14.757,,9001
+1832,9606,8607,4.724,,9001
+1832,9606,8608,0.0,,9104
+1832,9606,8609,0.0,,9104
+1832,9606,8610,0.774,,9104
+1832,9606,8611,-0.6,,9202
+1833,9607,8605,-1.977,,9001
+1833,9607,8606,-13.06,,9001
+1833,9607,8607,-9.993,,9001
+1833,9607,8608,-0.364,,9104
+1833,9607,8609,-0.254,,9104
+1833,9607,8610,-0.689,,9104
+1833,9607,8611,-1.037,,9202
+1834,9603,8605,-403.0,,9001
+1834,9603,8606,684.0,,9001
+1834,9603,8607,41.0,,9001
+1835,9603,8605,-387.06,,9001
+1835,9603,8606,636.53,,9001
+1835,9603,8607,46.29,,9001
+1836,9603,8605,-403.4,,9001
+1836,9603,8606,681.12,,9001
+1836,9603,8607,46.56,,9001
+1837,9603,8605,-587.8,,9001
+1837,9603,8606,519.75,,9001
+1837,9603,8607,145.76,,9001
+1838,9603,8605,-404.78,,9001
+1838,9603,8606,685.68,,9001
+1838,9603,8607,45.47,,9001
+1839,9603,8605,-101.0,,9001
+1839,9603,8606,-111.0,,9001
+1839,9603,8607,187.0,,9001
+1840,9606,8605,-119.4248,,9001
+1840,9606,8606,-303.65872,,9001
+1840,9606,8607,-11.00061,,9001
+1840,9606,8608,1.164298,,9104
+1840,9606,8609,0.174458,,9104
+1840,9606,8610,1.096259,,9104
+1840,9606,8611,3.657065,,9202
+1841,9615,8656,,NB7783v2.gsb,
+1842,9603,8605,0.0,,9001
+1842,9603,8606,0.0,,9001
+1842,9603,8607,0.0,,9001
+1843,9615,8656,,NAD83-98.gsb,
+1844,9615,8656,,QUE27-98.gsb,
+1845,9615,8656,,CGQ77-98.gsb,
+1846,9615,8656,,PE7783V2.gsb,
+1847,9615,8656,,SK27-98.gsb,
+1848,9615,8656,,SK83-98.gsb,
+1849,9615,8656,,AB_CSRS.DAC,
+1850,9615,8656,,NS778301.gsb,
+1851,9615,8656,,NS778301.gsb,
+1852,9606,8605,-533.4,,9001
+1852,9606,8606,669.2,,9001
+1852,9606,8607,-52.5,,9001
+1852,9606,8608,0.0,,9104
+1852,9606,8609,0.0,,9104
+1852,9606,8610,4.28,,9104
+1852,9606,8611,9.4,,9202
+1854,9603,8605,-239.1,,9001
+1854,9603,8606,-170.02,,9001
+1854,9603,8607,397.5,,9001
+1855,9603,8605,-244.72,,9001
+1855,9603,8606,-162.773,,9001
+1855,9603,8607,400.75,,9001
+1856,9603,8605,-122.89,,9001
+1856,9603,8606,-159.08,,9001
+1856,9603,8607,-168.74,,9001
+1857,9603,8605,-84.78,,9001
+1857,9603,8606,-107.55,,9001
+1857,9603,8607,-137.25,,9001
+1858,9603,8605,-123.92,,9001
+1858,9603,8606,-155.515,,9001
+1858,9603,8607,-157.721,,9001
+1859,9603,8605,-69.06,,9001
+1859,9603,8606,-90.71,,9001
+1859,9603,8607,-142.56,,9001
+1860,9603,8605,-113.997,,9001
+1860,9603,8606,-97.076,,9001
+1860,9603,8607,-152.312,,9001
+1861,9603,8605,-114.5,,9001
+1861,9603,8606,-96.1,,9001
+1861,9603,8607,-151.9,,9001
+1862,9606,8605,-194.513,,9001
+1862,9606,8606,-63.978,,9001
+1862,9606,8607,-25.759,,9001
+1862,9606,8608,-3.4027,,9104
+1862,9606,8609,3.756,,9104
+1862,9606,8610,-3.352,,9104
+1862,9606,8611,-0.9175,,9202
+1863,9607,8605,-389.691,,9001
+1863,9607,8606,64.502,,9001
+1863,9607,8607,210.209,,9001
+1863,9607,8608,-0.086,,9104
+1863,9607,8609,-14.314,,9104
+1863,9607,8610,6.39,,9104
+1863,9607,8611,0.9264,,9202
+5400,9616,8603,-28.0,,9001
+5401,9616,8603,-0.037,,9001
+5402,9616,8603,-26.3,,9001
+5403,9616,8603,-1.7,,9001
+5404,9616,8603,-0.4,,9001
+5405,9616,8603,0.146,,9001
+10101,9807,8801,30.3,,9110
+10101,9807,8802,-85.5,,9110
+10101,9807,8805,0.99996,,9201
+10101,9807,8806,500000.0,,9003
+10101,9807,8807,0.0,,9003
+10102,9807,8801,30.0,,9110
+10102,9807,8802,-87.3,,9110
+10102,9807,8805,0.999933333,,9201
+10102,9807,8806,500000.0,,9003
+10102,9807,8807,0.0,,9003
+10131,9807,8801,30.3,,9110
+10131,9807,8802,-85.5,,9110
+10131,9807,8805,0.99996,,9201
+10131,9807,8806,200000.0,,9001
+10131,9807,8807,0.0,,9001
+10132,9807,8801,30.0,,9110
+10132,9807,8802,-87.3,,9110
+10132,9807,8805,0.999933333,,9201
+10132,9807,8806,600000.0,,9001
+10132,9807,8807,0.0,,9001
+10201,9807,8801,31.0,,9110
+10201,9807,8802,-110.1,,9110
+10201,9807,8805,0.9999,,9201
+10201,9807,8806,500000.0,,9003
+10201,9807,8807,0.0,,9003
+10202,9807,8801,31.0,,9110
+10202,9807,8802,-111.55,,9110
+10202,9807,8805,0.9999,,9201
+10202,9807,8806,500000.0,,9003
+10202,9807,8807,0.0,,9003
+10203,9807,8801,31.0,,9110
+10203,9807,8802,-113.45,,9110
+10203,9807,8805,0.999933333,,9201
+10203,9807,8806,500000.0,,9003
+10203,9807,8807,0.0,,9003
+10231,9807,8801,31.0,,9110
+10231,9807,8802,-110.1,,9110
+10231,9807,8805,0.9999,,9201
+10231,9807,8806,213360.0,,9001
+10231,9807,8807,0.0,,9001
+10232,9807,8801,31.0,,9110
+10232,9807,8802,-111.55,,9110
+10232,9807,8805,0.9999,,9201
+10232,9807,8806,213360.0,,9001
+10232,9807,8807,0.0,,9001
+10233,9807,8801,31.0,,9110
+10233,9807,8802,-113.45,,9110
+10233,9807,8805,0.999933333,,9201
+10233,9807,8806,213360.0,,9001
+10233,9807,8807,0.0,,9001
+10301,9802,8821,34.2,,9110
+10301,9802,8822,-92.0,,9110
+10301,9802,8823,36.14,,9110
+10301,9802,8824,34.56,,9110
+10301,9802,8826,2000000.0,,9003
+10301,9802,8827,0.0,,9003
+10302,9802,8821,32.4,,9110
+10302,9802,8822,-92.0,,9110
+10302,9802,8823,34.46,,9110
+10302,9802,8824,33.18,,9110
+10302,9802,8826,2000000.0,,9003
+10302,9802,8827,0.0,,9003
+10331,9802,8821,34.2,,9110
+10331,9802,8822,-92.0,,9110
+10331,9802,8823,36.14,,9110
+10331,9802,8824,34.56,,9110
+10331,9802,8826,400000.0,,9001
+10331,9802,8827,0.0,,9001
+10332,9802,8821,32.4,,9110
+10332,9802,8822,-92.0,,9110
+10332,9802,8823,34.46,,9110
+10332,9802,8824,33.18,,9110
+10332,9802,8826,400000.0,,9001
+10332,9802,8827,400000.0,,9001
+10401,9802,8821,39.2,,9110
+10401,9802,8822,-122.0,,9110
+10401,9802,8823,41.4,,9110
+10401,9802,8824,40.0,,9110
+10401,9802,8826,2000000.0,,9003
+10401,9802,8827,0.0,,9003
+10402,9802,8821,37.4,,9110
+10402,9802,8822,-122.0,,9110
+10402,9802,8823,39.5,,9110
+10402,9802,8824,38.2,,9110
+10402,9802,8826,2000000.0,,9003
+10402,9802,8827,0.0,,9003
+10403,9802,8821,36.3,,9110
+10403,9802,8822,-120.3,,9110
+10403,9802,8823,38.26,,9110
+10403,9802,8824,37.04,,9110
+10403,9802,8826,2000000.0,,9003
+10403,9802,8827,0.0,,9003
+10404,9802,8821,35.2,,9110
+10404,9802,8822,-119.0,,9110
+10404,9802,8823,37.15,,9110
+10404,9802,8824,36.0,,9110
+10404,9802,8826,2000000.0,,9003
+10404,9802,8827,0.0,,9003
+10405,9802,8821,33.3,,9110
+10405,9802,8822,-118.0,,9110
+10405,9802,8823,35.28,,9110
+10405,9802,8824,34.02,,9110
+10405,9802,8826,2000000.0,,9003
+10405,9802,8827,0.0,,9003
+10406,9802,8821,32.1,,9110
+10406,9802,8822,-116.15,,9110
+10406,9802,8823,33.53,,9110
+10406,9802,8824,32.47,,9110
+10406,9802,8826,2000000.0,,9003
+10406,9802,8827,0.0,,9003
+10407,9802,8821,34.08,,9110
+10407,9802,8822,-118.2,,9110
+10407,9802,8823,34.25,,9110
+10407,9802,8824,33.52,,9110
+10407,9802,8826,4186692.58,,9003
+10407,9802,8827,416926.74,,9003
+10431,9802,8821,39.2,,9110
+10431,9802,8822,-122.0,,9110
+10431,9802,8823,41.4,,9110
+10431,9802,8824,40.0,,9110
+10431,9802,8826,2000000.0,,9001
+10431,9802,8827,500000.0,,9001
+10432,9802,8821,37.4,,9110
+10432,9802,8822,-122.0,,9110
+10432,9802,8823,39.5,,9110
+10432,9802,8824,38.2,,9110
+10432,9802,8826,2000000.0,,9001
+10432,9802,8827,500000.0,,9001
+10433,9802,8821,36.3,,9110
+10433,9802,8822,-120.3,,9110
+10433,9802,8823,38.26,,9110
+10433,9802,8824,37.04,,9110
+10433,9802,8826,2000000.0,,9001
+10433,9802,8827,500000.0,,9001
+10434,9802,8821,35.2,,9110
+10434,9802,8822,-119.0,,9110
+10434,9802,8823,37.15,,9110
+10434,9802,8824,36.0,,9110
+10434,9802,8826,2000000.0,,9001
+10434,9802,8827,500000.0,,9001
+10435,9802,8821,33.3,,9110
+10435,9802,8822,-118.0,,9110
+10435,9802,8823,35.28,,9110
+10435,9802,8824,34.02,,9110
+10435,9802,8826,2000000.0,,9001
+10435,9802,8827,500000.0,,9001
+10436,9802,8821,32.1,,9110
+10436,9802,8822,-116.15,,9110
+10436,9802,8823,33.53,,9110
+10436,9802,8824,32.47,,9110
+10436,9802,8826,2000000.0,,9001
+10436,9802,8827,500000.0,,9001
+10501,9802,8821,39.2,,9110
+10501,9802,8822,-105.3,,9110
+10501,9802,8823,39.43,,9110
+10501,9802,8824,40.47,,9110
+10501,9802,8826,2000000.0,,9003
+10501,9802,8827,0.0,,9003
+10502,9802,8821,37.5,,9110
+10502,9802,8822,-105.3,,9110
+10502,9802,8823,39.45,,9110
+10502,9802,8824,38.27,,9110
+10502,9802,8826,2000000.0,,9003
+10502,9802,8827,0.0,,9003
+10503,9802,8821,36.4,,9110
+10503,9802,8822,-105.3,,9110
+10503,9802,8823,38.26,,9110
+10503,9802,8824,37.14,,9110
+10503,9802,8826,2000000.0,,9003
+10503,9802,8827,0.0,,9003
+10531,9802,8821,39.2,,9110
+10531,9802,8822,-105.3,,9110
+10531,9802,8823,40.47,,9110
+10531,9802,8824,39.43,,9110
+10531,9802,8826,914401.8289,,9001
+10531,9802,8827,304800.6096,,9001
+10532,9802,8821,37.5,,9110
+10532,9802,8822,-105.3,,9110
+10532,9802,8823,39.45,,9110
+10532,9802,8824,38.27,,9110
+10532,9802,8826,914401.8289,,9001
+10532,9802,8827,304800.6096,,9001
+10533,9802,8821,36.4,,9110
+10533,9802,8822,-105.3,,9110
+10533,9802,8823,38.26,,9110
+10533,9802,8824,37.14,,9110
+10533,9802,8826,914401.8289,,9001
+10533,9802,8827,304800.6096,,9001
+10600,9802,8821,40.5,,9110
+10600,9802,8822,-72.45,,9110
+10600,9802,8823,41.52,,9110
+10600,9802,8824,41.12,,9110
+10600,9802,8826,600000.0,,9003
+10600,9802,8827,0.0,,9003
+10630,9802,8821,40.5,,9110
+10630,9802,8822,-72.45,,9110
+10630,9802,8823,41.52,,9110
+10630,9802,8824,41.12,,9110
+10630,9802,8826,304800.6096,,9001
+10630,9802,8827,152400.3048,,9001
+10700,9807,8801,38.0,,9110
+10700,9807,8802,-75.25,,9110
+10700,9807,8805,0.999995,,9201
+10700,9807,8806,500000.0,,9003
+10700,9807,8807,0.0,,9003
+10730,9807,8801,38.0,,9110
+10730,9807,8802,-75.25,,9110
+10730,9807,8805,0.999995,,9201
+10730,9807,8806,200000.0,,9001
+10730,9807,8807,0.0,,9001
+10901,9807,8801,24.2,,9110
+10901,9807,8802,-81.0,,9110
+10901,9807,8805,0.999941177,,9201
+10901,9807,8806,500000.0,,9003
+10901,9807,8807,0.0,,9003
+10902,9807,8801,24.2,,9110
+10902,9807,8802,-82.0,,9110
+10902,9807,8805,0.999941177,,9201
+10902,9807,8806,500000.0,,9003
+10902,9807,8807,0.0,,9003
+10903,9802,8821,29.0,,9110
+10903,9802,8822,-84.3,,9110
+10903,9802,8823,30.45,,9110
+10903,9802,8824,29.35,,9110
+10903,9802,8826,2000000.0,,9003
+10903,9802,8827,0.0,,9003
+10931,9807,8801,24.2,,9110
+10931,9807,8802,-81.0,,9110
+10931,9807,8805,0.999941177,,9201
+10931,9807,8806,200000.0,,9001
+10931,9807,8807,0.0,,9001
+10932,9807,8801,24.2,,9110
+10932,9807,8802,-82.0,,9110
+10932,9807,8805,0.999941177,,9201
+10932,9807,8806,200000.0,,9001
+10932,9807,8807,0.0,,9001
+10933,9802,8821,29.0,,9110
+10933,9802,8822,-84.3,,9110
+10933,9802,8823,30.45,,9110
+10933,9802,8824,29.35,,9110
+10933,9802,8826,600000.0,,9001
+10933,9802,8827,0.0,,9001
+11001,9807,8801,30.0,,9110
+11001,9807,8802,-82.1,,9110
+11001,9807,8805,0.9999,,9201
+11001,9807,8806,500000.0,,9003
+11001,9807,8807,0.0,,9003
+11002,9807,8801,30.0,,9110
+11002,9807,8802,-84.1,,9110
+11002,9807,8805,0.9999,,9201
+11002,9807,8806,500000.0,,9003
+11002,9807,8807,0.0,,9003
+11031,9807,8801,30.0,,9110
+11031,9807,8802,-82.1,,9110
+11031,9807,8805,0.9999,,9201
+11031,9807,8806,200000.0,,9001
+11031,9807,8807,0.0,,9001
+11032,9807,8801,30.0,,9110
+11032,9807,8802,-84.1,,9110
+11032,9807,8805,0.9999,,9201
+11032,9807,8806,700000.0,,9001
+11032,9807,8807,0.0,,9001
+11101,9807,8801,41.4,,9110
+11101,9807,8802,-112.1,,9110
+11101,9807,8805,0.999947368,,9201
+11101,9807,8806,500000.0,,9003
+11101,9807,8807,0.0,,9003
+11102,9807,8801,41.4,,9110
+11102,9807,8802,-114.0,,9110
+11102,9807,8805,0.999947368,,9201
+11102,9807,8806,500000.0,,9003
+11102,9807,8807,0.0,,9003
+11103,9807,8801,41.4,,9110
+11103,9807,8802,-115.45,,9110
+11103,9807,8805,0.999933333,,9201
+11103,9807,8806,500000.0,,9003
+11103,9807,8807,0.0,,9003
+11131,9807,8801,41.4,,9110
+11131,9807,8802,-112.1,,9110
+11131,9807,8805,0.999947368,,9201
+11131,9807,8806,200000.0,,9001
+11131,9807,8807,0.0,,9001
+11132,9807,8801,41.4,,9110
+11132,9807,8802,-114.0,,9110
+11132,9807,8805,0.999947368,,9201
+11132,9807,8806,500000.0,,9001
+11132,9807,8807,0.0,,9001
+11133,9807,8801,41.4,,9110
+11133,9807,8802,-115.45,,9110
+11133,9807,8805,0.999933333,,9201
+11133,9807,8806,800000.0,,9001
+11133,9807,8807,0.0,,9001
+11201,9807,8801,36.4,,9110
+11201,9807,8802,-88.2,,9110
+11201,9807,8805,0.999975,,9201
+11201,9807,8806,500000.0,,9003
+11201,9807,8807,0.0,,9003
+11202,9807,8801,36.4,,9110
+11202,9807,8802,-90.1,,9110
+11202,9807,8805,0.999941177,,9201
+11202,9807,8806,500000.0,,9003
+11202,9807,8807,0.0,,9003
+11231,9807,8801,36.4,,9110
+11231,9807,8802,-88.2,,9110
+11231,9807,8805,0.999975,,9201
+11231,9807,8806,300000.0,,9001
+11231,9807,8807,0.0,,9001
+11232,9807,8801,36.4,,9110
+11232,9807,8802,-90.1,,9110
+11232,9807,8805,0.999941177,,9201
+11232,9807,8806,700000.0,,9001
+11232,9807,8807,0.0,,9001
+11301,9807,8801,37.3,,9110
+11301,9807,8802,-85.4,,9110
+11301,9807,8805,0.999966667,,9201
+11301,9807,8806,500000.0,,9003
+11301,9807,8807,0.0,,9003
+11302,9807,8801,37.3,,9110
+11302,9807,8802,-87.05,,9110
+11302,9807,8805,0.999966667,,9201
+11302,9807,8806,500000.0,,9003
+11302,9807,8807,0.0,,9003
+11331,9807,8801,37.3,,9110
+11331,9807,8802,-85.4,,9110
+11331,9807,8805,0.999966667,,9201
+11331,9807,8806,100000.0,,9001
+11331,9807,8807,250000.0,,9001
+11332,9807,8801,37.3,,9110
+11332,9807,8802,-87.05,,9110
+11332,9807,8805,0.999966667,,9201
+11332,9807,8806,900000.0,,9001
+11332,9807,8807,250000.0,,9001
+11401,9802,8821,41.3,,9110
+11401,9802,8822,-93.3,,9110
+11401,9802,8823,43.16,,9110
+11401,9802,8824,42.04,,9110
+11401,9802,8826,2000000.0,,9003
+11401,9802,8827,0.0,,9003
+11402,9802,8821,40.0,,9110
+11402,9802,8822,-93.3,,9110
+11402,9802,8823,41.47,,9110
+11402,9802,8824,40.37,,9110
+11402,9802,8826,2000000.0,,9003
+11402,9802,8827,0.0,,9003
+11431,9802,8821,41.3,,9110
+11431,9802,8822,-93.3,,9110
+11431,9802,8823,43.16,,9110
+11431,9802,8824,42.04,,9110
+11431,9802,8826,1500000.0,,9001
+11431,9802,8827,1000000.0,,9001
+11432,9802,8821,40.0,,9110
+11432,9802,8822,-93.3,,9110
+11432,9802,8823,41.47,,9110
+11432,9802,8824,40.37,,9110
+11432,9802,8826,500000.0,,9001
+11432,9802,8827,0.0,,9001
+11501,9802,8821,38.2,,9110
+11501,9802,8822,-98.0,,9110
+11501,9802,8823,39.47,,9110
+11501,9802,8824,38.43,,9110
+11501,9802,8826,2000000.0,,9003
+11501,9802,8827,0.0,,9003
+11502,9802,8821,36.4,,9110
+11502,9802,8822,-98.3,,9110
+11502,9802,8823,38.34,,9110
+11502,9802,8824,37.16,,9110
+11502,9802,8826,2000000.0,,9003
+11502,9802,8827,0.0,,9003
+11531,9802,8821,38.2,,9110
+11531,9802,8822,-98.0,,9110
+11531,9802,8823,39.47,,9110
+11531,9802,8824,38.43,,9110
+11531,9802,8826,400000.0,,9001
+11531,9802,8827,0.0,,9001
+11532,9802,8821,36.4,,9110
+11532,9802,8822,-98.3,,9110
+11532,9802,8823,38.34,,9110
+11532,9802,8824,37.16,,9110
+11532,9802,8826,400000.0,,9001
+11532,9802,8827,400000.0,,9001
+11601,9802,8821,37.3,,9110
+11601,9802,8822,-84.15,,9110
+11601,9802,8823,37.58,,9110
+11601,9802,8824,38.58,,9110
+11601,9802,8826,2000000.0,,9003
+11601,9802,8827,0.0,,9003
+11602,9802,8821,36.2,,9110
+11602,9802,8822,-85.45,,9110
+11602,9802,8823,36.44,,9110
+11602,9802,8824,37.56,,9110
+11602,9802,8826,2000000.0,,9003
+11602,9802,8827,0.0,,9003
+11631,9802,8821,37.3,,9110
+11631,9802,8822,-84.15,,9110
+11631,9802,8823,37.58,,9110
+11631,9802,8824,37.58,,9110
+11631,9802,8826,500000.0,,9001
+11631,9802,8827,0.0,,9001
+11632,9802,8821,36.2,,9110
+11632,9802,8822,-85.45,,9110
+11632,9802,8823,37.56,,9110
+11632,9802,8824,36.44,,9110
+11632,9802,8826,500000.0,,9001
+11632,9802,8827,500000.0,,9001
+11701,9802,8821,30.4,,9110
+11701,9802,8822,-92.3,,9110
+11701,9802,8823,31.1,,9110
+11701,9802,8824,32.4,,9110
+11701,9802,8826,2000000.0,,9003
+11701,9802,8827,0.0,,9003
+11702,9802,8821,28.4,,9110
+11702,9802,8822,-91.2,,9110
+11702,9802,8823,29.18,,9110
+11702,9802,8824,30.42,,9110
+11702,9802,8826,2000000.0,,9003
+11702,9802,8827,0.0,,9003
+11731,9802,8821,30.3,,9110
+11731,9802,8822,-92.3,,9110
+11731,9802,8823,32.4,,9110
+11731,9802,8824,31.1,,9110
+11731,9802,8826,1000000.0,,9001
+11731,9802,8827,0.0,,9001
+11732,9802,8821,28.3,,9110
+11732,9802,8822,-91.2,,9110
+11732,9802,8823,30.42,,9110
+11732,9802,8824,29.18,,9110
+11732,9802,8826,1000000.0,,9001
+11732,9802,8827,0.0,,9001
+11801,9807,8801,43.5,,9110
+11801,9807,8802,-68.3,,9110
+11801,9807,8805,0.9999,,9201
+11801,9807,8806,500000.0,,9003
+11801,9807,8807,0.0,,9003
+11802,9807,8801,42.5,,9110
+11802,9807,8802,-70.1,,9110
+11802,9807,8805,0.999966667,,9201
+11802,9807,8806,500000.0,,9003
+11802,9807,8807,0.0,,9003
+11831,9807,8801,43.4,,9110
+11831,9807,8802,-68.3,,9110
+11831,9807,8805,0.9999,,9201
+11831,9807,8806,300000.0,,9001
+11831,9807,8807,0.0,,9001
+11832,9807,8801,42.5,,9110
+11832,9807,8802,-70.1,,9110
+11832,9807,8805,0.999966667,,9201
+11832,9807,8806,900000.0,,9001
+11832,9807,8807,0.0,,9001
+11900,9802,8821,37.5,,9110
+11900,9802,8822,-77.0,,9110
+11900,9802,8823,38.18,,9110
+11900,9802,8824,39.27,,9110
+11900,9802,8826,800000.0,,9003
+11900,9802,8827,0.0,,9003
+11930,9802,8821,37.4,,9110
+11930,9802,8822,-77.0,,9110
+11930,9802,8823,39.27,,9110
+11930,9802,8824,38.18,,9110
+11930,9802,8826,400000.0,,9001
+11930,9802,8827,0.0,,9001
+12001,9802,8821,41.0,,9110
+12001,9802,8822,-71.3,,9110
+12001,9802,8823,41.43,,9110
+12001,9802,8824,42.41,,9110
+12001,9802,8826,600000.0,,9003
+12001,9802,8827,0.0,,9003
+12002,9802,8821,41.0,,9110
+12002,9802,8822,-70.3,,9110
+12002,9802,8823,41.17,,9110
+12002,9802,8824,41.29,,9110
+12002,9802,8826,200000.0,,9003
+12002,9802,8827,0.0,,9003
+12031,9802,8821,41.0,,9110
+12031,9802,8822,-71.3,,9110
+12031,9802,8823,42.41,,9110
+12031,9802,8824,41.43,,9110
+12031,9802,8826,200000.0,,9001
+12031,9802,8827,750000.0,,9001
+12032,9802,8821,41.0,,9110
+12032,9802,8822,-70.3,,9110
+12032,9802,8823,41.29,,9110
+12032,9802,8824,41.17,,9110
+12032,9802,8826,500000.0,,9001
+12032,9802,8827,0.0,,9001
+12101,9807,8801,41.3,,9110
+12101,9807,8802,-83.4,,9110
+12101,9807,8805,0.999942857,,9201
+12101,9807,8806,500000.0,,9003
+12101,9807,8807,0.0,,9003
+12102,9807,8801,41.3,,9110
+12102,9807,8802,-85.45,,9110
+12102,9807,8805,0.999909091,,9201
+12102,9807,8806,500000.0,,9003
+12102,9807,8807,0.0,,9003
+12103,9807,8801,41.3,,9110
+12103,9807,8802,-88.45,,9110
+12103,9807,8805,0.999909091,,9201
+12103,9807,8806,500000.0,,9003
+12103,9807,8807,0.0,,9003
+12111,9802,8821,44.47,,9110
+12111,9802,8822,-87.0,,9110
+12111,9802,8823,45.29,,9110
+12111,9802,8824,47.05,,9110
+12111,9802,8826,2000000.0,,9003
+12111,9802,8827,0.0,,9003
+12112,9802,8821,43.19,,9110
+12112,9802,8822,-84.2,,9110
+12112,9802,8823,44.11,,9110
+12112,9802,8824,45.42,,9110
+12112,9802,8826,2000000.0,,9003
+12112,9802,8827,0.0,,9003
+12113,9802,8821,41.3,,9110
+12113,9802,8822,-84.2,,9110
+12113,9802,8823,42.06,,9110
+12113,9802,8824,43.4,,9110
+12113,9802,8826,2000000.0,,9003
+12113,9802,8827,0.0,,9003
+12141,9802,8821,44.47,,9110
+12141,9802,8822,-87.0,,9110
+12141,9802,8823,47.05,,9110
+12141,9802,8824,45.29,,9110
+12141,9802,8826,8000000.0,,9001
+12141,9802,8827,0.0,,9001
+12142,9802,8821,43.19,,9110
+12142,9802,8822,-84.22,,9110
+12142,9802,8823,45.42,,9110
+12142,9802,8824,44.11,,9110
+12142,9802,8826,6000000.0,,9001
+12142,9802,8827,0.0,,9001
+12143,9802,8821,41.3,,9110
+12143,9802,8822,-84.22,,9110
+12143,9802,8823,43.4,,9110
+12143,9802,8824,42.06,,9110
+12143,9802,8826,4000000.0,,9001
+12143,9802,8827,0.0,,9001
+12201,9802,8821,46.3,,9110
+12201,9802,8822,-93.06,,9110
+12201,9802,8823,47.02,,9110
+12201,9802,8824,48.38,,9110
+12201,9802,8826,2000000.0,,9003
+12201,9802,8827,0.0,,9003
+12202,9802,8821,45.0,,9110
+12202,9802,8822,-94.15,,9110
+12202,9802,8823,45.37,,9110
+12202,9802,8824,47.03,,9110
+12202,9802,8826,2000000.0,,9003
+12202,9802,8827,0.0,,9003
+12203,9802,8821,43.0,,9110
+12203,9802,8822,-94.0,,9110
+12203,9802,8823,43.47,,9110
+12203,9802,8824,45.13,,9110
+12203,9802,8826,2000000.0,,9003
+12203,9802,8827,0.0,,9003
+12231,9802,8821,46.3,,9110
+12231,9802,8822,-93.06,,9110
+12231,9802,8823,48.38,,9110
+12231,9802,8824,47.02,,9110
+12231,9802,8826,800000.0,,9001
+12231,9802,8827,100000.0,,9001
+12232,9802,8821,45.0,,9110
+12232,9802,8822,-94.15,,9110
+12232,9802,8823,47.03,,9110
+12232,9802,8824,45.37,,9110
+12232,9802,8826,800000.0,,9001
+12232,9802,8827,100000.0,,9001
+12233,9802,8821,43.0,,9110
+12233,9802,8822,-94.0,,9110
+12233,9802,8823,45.13,,9110
+12233,9802,8824,43.47,,9110
+12233,9802,8826,800000.0,,9001
+12233,9802,8827,100000.0,,9001
+12301,9807,8801,29.4,,9110
+12301,9807,8802,-88.5,,9110
+12301,9807,8805,0.99996,,9201
+12301,9807,8806,500000.0,,9003
+12301,9807,8807,0.0,,9003
+12302,9807,8801,30.3,,9110
+12302,9807,8802,-90.2,,9110
+12302,9807,8805,0.999941177,,9201
+12302,9807,8806,500000.0,,9003
+12302,9807,8807,0.0,,9003
+12331,9807,8801,29.3,,9110
+12331,9807,8802,-88.5,,9110
+12331,9807,8805,0.99995,,9201
+12331,9807,8806,300000.0,,9001
+12331,9807,8807,0.0,,9001
+12332,9807,8801,29.3,,9110
+12332,9807,8802,-90.2,,9110
+12332,9807,8805,0.99995,,9201
+12332,9807,8806,700000.0,,9001
+12332,9807,8807,0.0,,9001
+12401,9807,8801,35.5,,9110
+12401,9807,8802,-90.3,,9110
+12401,9807,8805,0.999933333,,9201
+12401,9807,8806,500000.0,,9003
+12401,9807,8807,0.0,,9003
+12402,9807,8801,35.5,,9110
+12402,9807,8802,-92.3,,9110
+12402,9807,8805,0.999933333,,9201
+12402,9807,8806,500000.0,,9003
+12402,9807,8807,0.0,,9003
+12403,9807,8801,36.1,,9110
+12403,9807,8802,-94.3,,9110
+12403,9807,8805,0.999941177,,9201
+12403,9807,8806,500000.0,,9003
+12403,9807,8807,0.0,,9003
+12431,9807,8801,35.5,,9110
+12431,9807,8802,-90.3,,9110
+12431,9807,8805,0.999933333,,9201
+12431,9807,8806,250000.0,,9001
+12431,9807,8807,0.0,,9001
+12432,9807,8801,35.5,,9110
+12432,9807,8802,-92.3,,9110
+12432,9807,8805,0.999933333,,9201
+12432,9807,8806,500000.0,,9001
+12432,9807,8807,0.0,,9001
+12433,9807,8801,36.1,,9110
+12433,9807,8802,-94.3,,9110
+12433,9807,8805,0.999941177,,9201
+12433,9807,8806,850000.0,,9001
+12433,9807,8807,0.0,,9001
+12501,9802,8821,47.0,,9110
+12501,9802,8822,-109.3,,9110
+12501,9802,8823,48.43,,9110
+12501,9802,8824,47.51,,9110
+12501,9802,8826,2000000.0,,9003
+12501,9802,8827,0.0,,9003
+12502,9802,8821,45.5,,9110
+12502,9802,8822,-109.3,,9110
+12502,9802,8823,47.53,,9110
+12502,9802,8824,46.27,,9110
+12502,9802,8826,2000000.0,,9003
+12502,9802,8827,0.0,,9003
+12503,9802,8821,44.0,,9110
+12503,9802,8822,-109.3,,9110
+12503,9802,8823,46.24,,9110
+12503,9802,8824,44.52,,9110
+12503,9802,8826,2000000.0,,9003
+12503,9802,8827,0.0,,9003
+12530,9802,8821,44.15,,9110
+12530,9802,8822,-109.3,,9110
+12530,9802,8823,49.0,,9110
+12530,9802,8824,45.0,,9110
+12530,9802,8826,600000.0,,9001
+12530,9802,8827,0.0,,9001
+12601,9802,8821,41.2,,9110
+12601,9802,8822,-100.0,,9110
+12601,9802,8823,41.51,,9110
+12601,9802,8824,42.49,,9110
+12601,9802,8826,2000000.0,,9003
+12601,9802,8827,0.0,,9003
+12602,9802,8821,39.4,,9110
+12602,9802,8822,-99.3,,9110
+12602,9802,8823,40.17,,9110
+12602,9802,8824,41.43,,9110
+12602,9802,8826,2000000.0,,9003
+12602,9802,8827,0.0,,9003
+12630,9802,8821,39.5,,9110
+12630,9802,8822,-100.0,,9110
+12630,9802,8823,43.0,,9110
+12630,9802,8824,40.0,,9110
+12630,9802,8826,500000.0,,9001
+12630,9802,8827,0.0,,9001
+12701,9807,8801,34.45,,9110
+12701,9807,8802,-115.35,,9110
+12701,9807,8805,0.9999,,9201
+12701,9807,8806,500000.0,,9003
+12701,9807,8807,0.0,,9003
+12702,9807,8801,34.45,,9110
+12702,9807,8802,-116.4,,9110
+12702,9807,8805,0.9999,,9201
+12702,9807,8806,500000.0,,9003
+12702,9807,8807,0.0,,9003
+12703,9807,8801,34.45,,9110
+12703,9807,8802,-118.35,,9110
+12703,9807,8805,0.9999,,9201
+12703,9807,8806,500000.0,,9003
+12703,9807,8807,0.0,,9003
+12731,9807,8801,34.45,,9110
+12731,9807,8802,-115.35,,9110
+12731,9807,8805,0.9999,,9201
+12731,9807,8806,200000.0,,9001
+12731,9807,8807,8000000.0,,9001
+12732,9807,8801,34.45,,9110
+12732,9807,8802,-116.4,,9110
+12732,9807,8805,0.9999,,9201
+12732,9807,8806,500000.0,,9001
+12732,9807,8807,6000000.0,,9001
+12733,9807,8801,34.45,,9110
+12733,9807,8802,-118.35,,9110
+12733,9807,8805,0.9999,,9201
+12733,9807,8806,800000.0,,9001
+12733,9807,8807,4000000.0,,9001
+12800,9807,8801,42.3,,9110
+12800,9807,8802,-71.4,,9110
+12800,9807,8805,0.999966667,,9201
+12800,9807,8806,500000.0,,9003
+12800,9807,8807,0.0,,9003
+12830,9807,8801,42.3,,9110
+12830,9807,8802,-71.4,,9110
+12830,9807,8805,0.999966667,,9201
+12830,9807,8806,300000.0,,9001
+12830,9807,8807,0.0,,9001
+12900,9807,8801,38.5,,9110
+12900,9807,8802,-74.4,,9110
+12900,9807,8805,0.999975,,9201
+12900,9807,8806,2000000.0,,9003
+12900,9807,8807,0.0,,9003
+12930,9807,8801,38.5,,9110
+12930,9807,8802,-74.3,,9110
+12930,9807,8805,0.9999,,9201
+12930,9807,8806,150000.0,,9001
+12930,9807,8807,0.0,,9001
+13001,9807,8801,31.0,,9110
+13001,9807,8802,-104.2,,9110
+13001,9807,8805,0.999909091,,9201
+13001,9807,8806,500000.0,,9003
+13001,9807,8807,0.0,,9003
+13002,9807,8801,31.0,,9110
+13002,9807,8802,-106.15,,9110
+13002,9807,8805,0.9999,,9201
+13002,9807,8806,500000.0,,9003
+13002,9807,8807,0.0,,9003
+13003,9807,8801,31.0,,9110
+13003,9807,8802,-107.5,,9110
+13003,9807,8805,0.999916667,,9201
+13003,9807,8806,500000.0,,9003
+13003,9807,8807,0.0,,9003
+13031,9807,8801,31.0,,9110
+13031,9807,8802,-104.2,,9110
+13031,9807,8805,0.999909091,,9201
+13031,9807,8806,165000.0,,9001
+13031,9807,8807,0.0,,9001
+13032,9807,8801,31.0,,9110
+13032,9807,8802,-106.15,,9110
+13032,9807,8805,0.9999,,9201
+13032,9807,8806,500000.0,,9001
+13032,9807,8807,0.0,,9001
+13033,9807,8801,31.0,,9110
+13033,9807,8802,-107.5,,9110
+13033,9807,8805,0.999916667,,9201
+13033,9807,8806,830000.0,,9001
+13033,9807,8807,0.0,,9001
+13101,9807,8801,40.0,,9110
+13101,9807,8802,-74.2,,9110
+13101,9807,8805,0.999966667,,9201
+13101,9807,8806,500000.0,,9003
+13101,9807,8807,0.0,,9003
+13102,9807,8801,40.0,,9110
+13102,9807,8802,-76.35,,9110
+13102,9807,8805,0.9999375,,9201
+13102,9807,8806,500000.0,,9003
+13102,9807,8807,0.0,,9003
+13103,9807,8801,40.0,,9110
+13103,9807,8802,-78.35,,9110
+13103,9807,8805,0.9999375,,9201
+13103,9807,8806,500000.0,,9003
+13103,9807,8807,0.0,,9003
+13104,9802,8821,40.3,,9110
+13104,9802,8822,-74.0,,9110
+13104,9802,8823,41.02,,9110
+13104,9802,8824,40.4,,9110
+13104,9802,8826,1000000.0,,9003
+13104,9802,8827,0.0,,9003
+13131,9807,8801,38.5,,9110
+13131,9807,8802,-74.3,,9110
+13131,9807,8805,0.9999,,9201
+13131,9807,8806,150000.0,,9001
+13131,9807,8807,0.0,,9001
+13132,9807,8801,40.0,,9110
+13132,9807,8802,-76.35,,9110
+13132,9807,8805,0.9999375,,9201
+13132,9807,8806,250000.0,,9001
+13132,9807,8807,0.0,,9001
+13133,9807,8801,40.0,,9110
+13133,9807,8802,-78.35,,9110
+13133,9807,8805,0.9999375,,9201
+13133,9807,8806,350000.0,,9001
+13133,9807,8807,0.0,,9001
+13134,9802,8821,40.1,,9110
+13134,9802,8822,-74.0,,9110
+13134,9802,8823,41.02,,9110
+13134,9802,8824,40.4,,9110
+13134,9802,8826,300000.0,,9001
+13134,9802,8827,0.0,,9001
+13200,9802,8821,33.45,,9110
+13200,9802,8822,-79.0,,9110
+13200,9802,8823,34.2,,9110
+13200,9802,8824,36.1,,9110
+13200,9802,8826,2000000.0,,9003
+13200,9802,8827,0.0,,9003
+13230,9802,8821,33.45,,9110
+13230,9802,8822,-79.0,,9110
+13230,9802,8823,36.1,,9110
+13230,9802,8824,34.2,,9110
+13230,9802,8826,609601.22,,9001
+13230,9802,8827,0.0,,9001
+13301,9802,8821,47.0,,9110
+13301,9802,8822,-100.3,,9110
+13301,9802,8823,47.26,,9110
+13301,9802,8824,48.44,,9110
+13301,9802,8826,2000000.0,,9003
+13301,9802,8827,0.0,,9003
+13302,9802,8821,45.4,,9110
+13302,9802,8822,-100.3,,9110
+13302,9802,8823,46.11,,9110
+13302,9802,8824,47.29,,9110
+13302,9802,8826,2000000.0,,9003
+13302,9802,8827,0.0,,9003
+13331,9802,8821,47.0,,9110
+13331,9802,8822,-100.3,,9110
+13331,9802,8823,48.44,,9110
+13331,9802,8824,47.26,,9110
+13331,9802,8826,600000.0,,9001
+13331,9802,8827,0.0,,9001
+13332,9802,8821,45.4,,9110
+13332,9802,8822,-100.3,,9110
+13332,9802,8823,47.29,,9110
+13332,9802,8824,46.11,,9110
+13332,9802,8826,600000.0,,9001
+13332,9802,8827,0.0,,9001
+13401,9802,8821,39.4,,9110
+13401,9802,8822,-82.3,,9110
+13401,9802,8823,40.26,,9110
+13401,9802,8824,41.42,,9110
+13401,9802,8826,2000000.0,,9003
+13401,9802,8827,0.0,,9003
+13402,9802,8821,38.0,,9110
+13402,9802,8822,-82.3,,9110
+13402,9802,8823,38.44,,9110
+13402,9802,8824,40.02,,9110
+13402,9802,8826,2000000.0,,9003
+13402,9802,8827,0.0,,9003
+13431,9802,8821,39.4,,9110
+13431,9802,8822,-82.3,,9110
+13431,9802,8823,41.42,,9110
+13431,9802,8824,40.26,,9110
+13431,9802,8826,600000.0,,9001
+13431,9802,8827,0.0,,9001
+13432,9802,8821,38.0,,9110
+13432,9802,8822,-82.3,,9110
+13432,9802,8823,40.02,,9110
+13432,9802,8824,38.44,,9110
+13432,9802,8826,600000.0,,9001
+13432,9802,8827,0.0,,9001
+13501,9802,8821,35.0,,9110
+13501,9802,8822,-98.0,,9110
+13501,9802,8823,35.34,,9110
+13501,9802,8824,36.46,,9110
+13501,9802,8826,2000000.0,,9003
+13501,9802,8827,0.0,,9003
+13502,9802,8821,33.2,,9110
+13502,9802,8822,-98.0,,9110
+13502,9802,8823,33.56,,9110
+13502,9802,8824,35.14,,9110
+13502,9802,8826,2000000.0,,9003
+13502,9802,8827,0.0,,9003
+13531,9802,8821,35.0,,9110
+13531,9802,8822,-98.0,,9110
+13531,9802,8823,36.46,,9110
+13531,9802,8824,35.34,,9110
+13531,9802,8826,600000.0,,9001
+13531,9802,8827,0.0,,9001
+13532,9802,8821,33.2,,9110
+13532,9802,8822,-98.0,,9110
+13532,9802,8823,35.14,,9110
+13532,9802,8824,33.56,,9110
+13532,9802,8826,600000.0,,9001
+13532,9802,8827,0.0,,9001
+13601,9802,8821,43.4,,9110
+13601,9802,8822,-120.3,,9110
+13601,9802,8823,44.2,,9110
+13601,9802,8824,46.0,,9110
+13601,9802,8826,2000000.0,,9003
+13601,9802,8827,0.0,,9003
+13602,9802,8821,41.4,,9110
+13602,9802,8822,-120.3,,9110
+13602,9802,8823,42.2,,9110
+13602,9802,8824,44.0,,9110
+13602,9802,8826,2000000.0,,9003
+13602,9802,8827,0.0,,9003
+13631,9802,8821,43.4,,9110
+13631,9802,8822,-120.3,,9110
+13631,9802,8823,46.0,,9110
+13631,9802,8824,44.2,,9110
+13631,9802,8826,2500000.0,,9001
+13631,9802,8827,0.0,,9001
+13632,9802,8821,41.4,,9110
+13632,9802,8822,-120.3,,9110
+13632,9802,8823,44.0,,9110
+13632,9802,8824,42.2,,9110
+13632,9802,8826,1500000.0,,9001
+13632,9802,8827,0.0,,9001
+13701,9802,8821,40.1,,9110
+13701,9802,8822,-77.45,,9110
+13701,9802,8823,40.53,,9110
+13701,9802,8824,41.57,,9110
+13701,9802,8826,2000000.0,,9003
+13701,9802,8827,0.0,,9003
+13702,9802,8821,39.2,,9110
+13702,9802,8822,-77.45,,9110
+13702,9802,8823,39.56,,9110
+13702,9802,8824,40.48,,9110
+13702,9802,8826,2000000.0,,9003
+13702,9802,8827,0.0,,9003
+13731,9802,8821,40.1,,9110
+13731,9802,8822,-77.45,,9110
+13731,9802,8823,41.57,,9110
+13731,9802,8824,40.53,,9110
+13731,9802,8826,600000.0,,9001
+13731,9802,8827,0.0,,9001
+13732,9802,8821,39.2,,9110
+13732,9802,8822,-77.45,,9110
+13732,9802,8823,40.58,,9110
+13732,9802,8824,39.56,,9110
+13732,9802,8826,600000.0,,9001
+13732,9802,8827,0.0,,9001
+13800,9807,8801,41.05,,9110
+13800,9807,8802,-71.3,,9110
+13800,9807,8805,0.9999938,,9201
+13800,9807,8806,500000.0,,9003
+13800,9807,8807,0.0,,9003
+13830,9807,8801,41.05,,9110
+13830,9807,8802,-71.3,,9110
+13830,9807,8805,0.99999375,,9201
+13830,9807,8806,100000.0,,9001
+13830,9807,8807,0.0,,9001
+13901,9802,8821,33.0,,9110
+13901,9802,8822,-81.0,,9110
+13901,9802,8823,33.46,,9110
+13901,9802,8824,34.58,,9110
+13901,9802,8826,2000000.0,,9003
+13901,9802,8827,0.0,,9003
+13902,9802,8821,31.5,,9110
+13902,9802,8822,-81.0,,9110
+13902,9802,8823,32.2,,9110
+13902,9802,8824,33.4,,9110
+13902,9802,8826,2000000.0,,9003
+13902,9802,8827,0.0,,9003
+13930,9802,8821,31.5,,9110
+13930,9802,8822,-81.0,,9110
+13930,9802,8823,34.5,,9110
+13930,9802,8824,32.3,,9110
+13930,9802,8826,609600.0,,9001
+13930,9802,8827,0.0,,9001
+14001,9802,8821,43.5,,9110
+14001,9802,8822,-100.0,,9110
+14001,9802,8823,44.25,,9110
+14001,9802,8824,45.41,,9110
+14001,9802,8826,2000000.0,,9003
+14001,9802,8827,0.0,,9003
+14002,9802,8821,42.2,,9110
+14002,9802,8822,-100.2,,9110
+14002,9802,8823,42.5,,9110
+14002,9802,8824,44.24,,9110
+14002,9802,8826,2000000.0,,9003
+14002,9802,8827,0.0,,9003
+14031,9802,8821,43.5,,9110
+14031,9802,8822,-100.0,,9110
+14031,9802,8823,45.41,,9110
+14031,9802,8824,44.25,,9110
+14031,9802,8826,600000.0,,9001
+14031,9802,8827,0.0,,9001
+14032,9802,8821,42.2,,9110
+14032,9802,8822,-100.2,,9110
+14032,9802,8823,44.24,,9110
+14032,9802,8824,42.5,,9110
+14032,9802,8826,600000.0,,9001
+14032,9802,8827,0.0,,9001
+14100,9802,8821,34.4,,9110
+14100,9802,8822,-86.0,,9110
+14100,9802,8823,35.15,,9110
+14100,9802,8824,36.25,,9110
+14100,9802,8826,100000.0,,9003
+14100,9802,8827,0.0,,9003
+14130,9802,8821,34.2,,9110
+14130,9802,8822,-86.0,,9110
+14130,9802,8823,36.25,,9110
+14130,9802,8824,35.15,,9110
+14130,9802,8826,600000.0,,9001
+14130,9802,8827,0.0,,9001
+14201,9802,8821,34.0,,9110
+14201,9802,8822,-101.3,,9110
+14201,9802,8823,34.39,,9110
+14201,9802,8824,36.11,,9110
+14201,9802,8826,2000000.0,,9003
+14201,9802,8827,0.0,,9003
+14202,9802,8821,31.4,,9110
+14202,9802,8822,-97.3,,9110
+14202,9802,8823,32.08,,9110
+14202,9802,8824,33.58,,9110
+14202,9802,8826,2000000.0,,9003
+14202,9802,8827,0.0,,9003
+14203,9802,8821,29.4,,9110
+14203,9802,8822,-100.2,,9110
+14203,9802,8823,30.07,,9110
+14203,9802,8824,31.53,,9110
+14203,9802,8826,2000000.0,,9003
+14203,9802,8827,0.0,,9003
+14204,9802,8821,27.5,,9110
+14204,9802,8822,-99.0,,9110
+14204,9802,8823,28.23,,9110
+14204,9802,8824,30.17,,9110
+14204,9802,8826,2000000.0,,9003
+14204,9802,8827,0.0,,9003
+14205,9802,8821,25.4,,9110
+14205,9802,8822,-98.3,,9110
+14205,9802,8823,26.1,,9110
+14205,9802,8824,27.5,,9110
+14205,9802,8826,2000000.0,,9003
+14205,9802,8827,0.0,,9003
+14231,9802,8821,34.0,,9110
+14231,9802,8822,-101.3,,9110
+14231,9802,8823,36.11,,9110
+14231,9802,8824,34.39,,9110
+14231,9802,8826,200000.0,,9001
+14231,9802,8827,1000000.0,,9001
+14232,9802,8821,31.4,,9110
+14232,9802,8822,-98.3,,9110
+14232,9802,8823,33.58,,9110
+14232,9802,8824,32.08,,9110
+14232,9802,8826,600000.0,,9001
+14232,9802,8827,2000000.0,,9001
+14233,9802,8821,29.4,,9110
+14233,9802,8822,-100.2,,9110
+14233,9802,8823,31.53,,9110
+14233,9802,8824,30.07,,9110
+14233,9802,8826,700000.0,,9001
+14233,9802,8827,3000000.0,,9001
+14234,9802,8821,27.5,,9110
+14234,9802,8822,-99.0,,9110
+14234,9802,8823,30.17,,9110
+14234,9802,8824,28.23,,9110
+14234,9802,8826,600000.0,,9001
+14234,9802,8827,4000000.0,,9001
+14235,9802,8821,25.4,,9110
+14235,9802,8822,-98.3,,9110
+14235,9802,8823,27.5,,9110
+14235,9802,8824,26.1,,9110
+14235,9802,8826,300000.0,,9001
+14235,9802,8827,5000000.0,,9001
+14301,9802,8821,40.2,,9110
+14301,9802,8822,-111.3,,9110
+14301,9802,8823,40.43,,9110
+14301,9802,8824,41.47,,9110
+14301,9802,8826,2000000.0,,9003
+14301,9802,8827,0.0,,9003
+14302,9802,8821,38.2,,9110
+14302,9802,8822,-111.3,,9110
+14302,9802,8823,39.01,,9110
+14302,9802,8824,40.39,,9110
+14302,9802,8826,2000000.0,,9003
+14302,9802,8827,0.0,,9003
+14303,9802,8821,36.4,,9110
+14303,9802,8822,-111.3,,9110
+14303,9802,8823,37.13,,9110
+14303,9802,8824,38.21,,9110
+14303,9802,8826,2000000.0,,9003
+14303,9802,8827,0.0,,9003
+14331,9802,8821,40.2,,9110
+14331,9802,8822,-111.3,,9110
+14331,9802,8823,41.47,,9110
+14331,9802,8824,40.43,,9110
+14331,9802,8826,500000.0,,9001
+14331,9802,8827,1000000.0,,9001
+14332,9802,8821,38.2,,9110
+14332,9802,8822,-111.3,,9110
+14332,9802,8823,40.39,,9110
+14332,9802,8824,39.01,,9110
+14332,9802,8826,500000.0,,9001
+14332,9802,8827,2000000.0,,9001
+14333,9802,8821,36.4,,9110
+14333,9802,8822,-111.3,,9110
+14333,9802,8823,38.21,,9110
+14333,9802,8824,37.13,,9110
+14333,9802,8826,500000.0,,9001
+14333,9802,8827,3000000.0,,9001
+14400,9807,8801,42.3,,9110
+14400,9807,8802,-72.3,,9110
+14400,9807,8805,0.999964286,,9201
+14400,9807,8806,500000.0,,9003
+14400,9807,8807,0.0,,9003
+14430,9807,8801,42.3,,9110
+14430,9807,8802,-72.3,,9110
+14430,9807,8805,0.999964286,,9201
+14430,9807,8806,500000.0,,9001
+14430,9807,8807,0.0,,9001
+14501,9802,8821,37.4,,9110
+14501,9802,8822,-78.3,,9110
+14501,9802,8823,38.02,,9110
+14501,9802,8824,39.12,,9110
+14501,9802,8826,2000000.0,,9003
+14501,9802,8827,0.0,,9003
+14502,9802,8821,36.2,,9110
+14502,9802,8822,-78.3,,9110
+14502,9802,8823,36.46,,9110
+14502,9802,8824,37.58,,9110
+14502,9802,8826,2000000.0,,9003
+14502,9802,8827,0.0,,9003
+14531,9802,8821,37.4,,9110
+14531,9802,8822,-78.3,,9110
+14531,9802,8823,39.12,,9110
+14531,9802,8824,38.02,,9110
+14531,9802,8826,3500000.0,,9001
+14531,9802,8827,2000000.0,,9001
+14532,9802,8821,36.2,,9110
+14532,9802,8822,-78.3,,9110
+14532,9802,8823,37.58,,9110
+14532,9802,8824,36.46,,9110
+14532,9802,8826,3500000.0,,9001
+14532,9802,8827,1000000.0,,9001
+14601,9802,8821,47.0,,9110
+14601,9802,8822,-120.5,,9110
+14601,9802,8823,47.3,,9110
+14601,9802,8824,48.44,,9110
+14601,9802,8826,2000000.0,,9003
+14601,9802,8827,0.0,,9003
+14602,9802,8821,45.2,,9110
+14602,9802,8822,-120.3,,9110
+14602,9802,8823,45.5,,9110
+14602,9802,8824,47.2,,9110
+14602,9802,8826,2000000.0,,9003
+14602,9802,8827,0.0,,9003
+14631,9802,8821,47.0,,9110
+14631,9802,8822,-120.5,,9110
+14631,9802,8823,48.44,,9110
+14631,9802,8824,47.3,,9110
+14631,9802,8826,500000.0,,9001
+14631,9802,8827,0.0,,9001
+14632,9802,8821,45.2,,9110
+14632,9802,8822,-120.3,,9110
+14632,9802,8823,47.2,,9110
+14632,9802,8824,45.5,,9110
+14632,9802,8826,500000.0,,9001
+14632,9802,8827,0.0,,9001
+14701,9802,8821,38.3,,9110
+14701,9802,8822,-79.3,,9110
+14701,9802,8823,39.0,,9110
+14701,9802,8824,40.15,,9110
+14701,9802,8826,2000000.0,,9003
+14701,9802,8827,0.0,,9003
+14702,9802,8821,37.0,,9110
+14702,9802,8822,-81.0,,9110
+14702,9802,8823,37.29,,9110
+14702,9802,8824,38.53,,9110
+14702,9802,8826,2000000.0,,9003
+14702,9802,8827,0.0,,9003
+14731,9802,8821,38.3,,9110
+14731,9802,8822,-79.3,,9110
+14731,9802,8823,40.15,,9110
+14731,9802,8824,39.0,,9110
+14731,9802,8826,600000.0,,9001
+14731,9802,8827,0.0,,9001
+14732,9802,8821,37.0,,9110
+14732,9802,8822,-81.0,,9110
+14732,9802,8823,38.53,,9110
+14732,9802,8824,37.29,,9110
+14732,9802,8826,600000.0,,9001
+14732,9802,8827,0.0,,9001
+14801,9802,8821,45.1,,9110
+14801,9802,8822,-90.0,,9110
+14801,9802,8823,45.34,,9110
+14801,9802,8824,46.46,,9110
+14801,9802,8826,2000000.0,,9003
+14801,9802,8827,0.0,,9003
+14802,9802,8821,43.5,,9110
+14802,9802,8822,-90.0,,9110
+14802,9802,8823,44.15,,9110
+14802,9802,8824,45.3,,9110
+14802,9802,8826,2000000.0,,9003
+14802,9802,8827,0.0,,9003
+14803,9802,8821,42.0,,9110
+14803,9802,8822,-90.0,,9110
+14803,9802,8823,42.44,,9110
+14803,9802,8824,44.04,,9110
+14803,9802,8826,2000000.0,,9003
+14803,9802,8827,0.0,,9003
+14831,9802,8821,45.1,,9110
+14831,9802,8822,-90.0,,9110
+14831,9802,8823,46.46,,9110
+14831,9802,8824,45.34,,9110
+14831,9802,8826,600000.0,,9001
+14831,9802,8827,0.0,,9001
+14832,9802,8821,43.5,,9110
+14832,9802,8822,-90.0,,9110
+14832,9802,8823,45.3,,9110
+14832,9802,8824,44.15,,9110
+14832,9802,8826,600000.0,,9001
+14832,9802,8827,0.0,,9001
+14833,9802,8821,42.0,,9110
+14833,9802,8822,-90.0,,9110
+14833,9802,8823,44.04,,9110
+14833,9802,8824,42.44,,9110
+14833,9802,8826,600000.0,,9001
+14833,9802,8827,0.0,,9001
+14901,9807,8801,40.4,,9110
+14901,9807,8802,-105.1,,9110
+14901,9807,8805,0.999941177,,9201
+14901,9807,8806,500000.0,,9003
+14901,9807,8807,0.0,,9003
+14902,9807,8801,40.4,,9110
+14902,9807,8802,-107.2,,9110
+14902,9807,8805,0.999941177,,9201
+14902,9807,8806,500000.0,,9003
+14902,9807,8807,0.0,,9003
+14903,9807,8801,40.4,,9110
+14903,9807,8802,-108.45,,9110
+14903,9807,8805,0.999941177,,9201
+14903,9807,8806,500000.0,,9003
+14903,9807,8807,0.0,,9003
+14904,9807,8801,40.4,,9110
+14904,9807,8802,-110.05,,9110
+14904,9807,8805,0.999941177,,9201
+14904,9807,8806,500000.0,,9003
+14904,9807,8807,0.0,,9003
+14931,9807,8801,40.3,,9110
+14931,9807,8802,-105.1,,9110
+14931,9807,8805,0.9999375,,9201
+14931,9807,8806,200000.0,,9001
+14931,9807,8807,0.0,,9001
+14932,9807,8801,40.3,,9110
+14932,9807,8802,-107.2,,9110
+14932,9807,8805,0.9999375,,9201
+14932,9807,8806,400000.0,,9001
+14932,9807,8807,100000.0,,9001
+14933,9807,8801,40.3,,9110
+14933,9807,8802,-108.45,,9110
+14933,9807,8805,0.9999375,,9201
+14933,9807,8806,600000.0,,9001
+14933,9807,8807,0.0,,9001
+14934,9807,8801,40.3,,9110
+14934,9807,8802,-110.05,,9110
+14934,9807,8805,0.9999375,,9201
+14934,9807,8806,800000.0,,9001
+14934,9807,8807,100000.0,,9001
+15001,9812,8806,16404166.67,,9003
+15001,9812,8807,-16404166.67,,9003
+15001,9812,8811,57.0,,9110
+15001,9812,8812,-133.4,,9110
+15001,9812,8813,323.07483685,,9110
+15001,9812,8814,323.07483685,,9110
+15001,9812,8815,0.9999,,9201
+15002,9807,8801,54.0,,9102
+15002,9807,8802,-142.0,,9102
+15002,9807,8805,0.9999,,9201
+15002,9807,8806,500000.0,,9003
+15002,9807,8807,0.0,,9003
+15003,9807,8801,54.0,,9102
+15003,9807,8802,-146.0,,9102
+15003,9807,8805,0.9999,,9201
+15003,9807,8806,500000.0,,9003
+15003,9807,8807,0.0,,9003
+15004,9807,8801,54.0,,9102
+15004,9807,8802,-150.0,,9102
+15004,9807,8805,0.9999,,9201
+15004,9807,8806,500000.0,,9003
+15004,9807,8807,0.0,,9003
+15005,9807,8801,54.0,,9102
+15005,9807,8802,-154.0,,9102
+15005,9807,8805,0.9999,,9201
+15005,9807,8806,500000.0,,9003
+15005,9807,8807,0.0,,9003
+15006,9807,8801,54.0,,9102
+15006,9807,8802,-158.0,,9102
+15006,9807,8805,0.9999,,9201
+15006,9807,8806,500000.0,,9003
+15006,9807,8807,0.0,,9003
+15007,9807,8801,54.0,,9102
+15007,9807,8802,-162.0,,9102
+15007,9807,8805,0.9999,,9201
+15007,9807,8806,700000.0,,9003
+15007,9807,8807,0.0,,9003
+15008,9807,8801,54.0,,9102
+15008,9807,8802,-166.0,,9102
+15008,9807,8805,0.9999,,9201
+15008,9807,8806,500000.0,,9003
+15008,9807,8807,0.0,,9003
+15009,9807,8801,54.0,,9102
+15009,9807,8802,-170.0,,9102
+15009,9807,8805,0.9999,,9201
+15009,9807,8806,600000.0,,9003
+15009,9807,8807,0.0,,9003
+15010,9802,8821,51.0,,9110
+15010,9802,8822,-176.0,,9110
+15010,9802,8823,53.5,,9110
+15010,9802,8824,51.5,,9110
+15010,9802,8826,3000000.0,,9003
+15010,9802,8827,0.0,,9003
+15031,9812,8806,5000000.0,,9001
+15031,9812,8807,-5000000.0,,9001
+15031,9812,8811,57.0,,9110
+15031,9812,8812,-133.4,,9110
+15031,9812,8813,323.07483685,,9110
+15031,9812,8814,323.07483685,,9110
+15031,9812,8815,0.9999,,9201
+15032,9807,8801,54.0,,9102
+15032,9807,8802,-142.0,,9102
+15032,9807,8805,0.9999,,9201
+15032,9807,8806,500000.0,,9001
+15032,9807,8807,0.0,,9001
+15033,9807,8801,54.0,,9102
+15033,9807,8802,-146.0,,9102
+15033,9807,8805,0.9999,,9201
+15033,9807,8806,500000.0,,9001
+15033,9807,8807,0.0,,9001
+15034,9807,8801,54.0,,9102
+15034,9807,8802,-150.0,,9102
+15034,9807,8805,0.9999,,9201
+15034,9807,8806,500000.0,,9001
+15034,9807,8807,0.0,,9001
+15035,9807,8801,54.0,,9102
+15035,9807,8802,-154.0,,9102
+15035,9807,8805,0.9999,,9201
+15035,9807,8806,500000.0,,9001
+15035,9807,8807,0.0,,9001
+15036,9807,8801,54.0,,9102
+15036,9807,8802,-158.0,,9102
+15036,9807,8805,0.9999,,9201
+15036,9807,8806,500000.0,,9001
+15036,9807,8807,0.0,,9001
+15037,9807,8801,54.0,,9102
+15037,9807,8802,-162.0,,9102
+15037,9807,8805,0.9999,,9201
+15037,9807,8806,500000.0,,9001
+15037,9807,8807,0.0,,9001
+15038,9807,8801,54.0,,9102
+15038,9807,8802,-166.0,,9102
+15038,9807,8805,0.9999,,9201
+15038,9807,8806,500000.0,,9001
+15038,9807,8807,0.0,,9001
+15039,9807,8801,54.0,,9102
+15039,9807,8802,-170.0,,9102
+15039,9807,8805,0.9999,,9201
+15039,9807,8806,500000.0,,9001
+15039,9807,8807,0.0,,9001
+15040,9802,8821,51.0,,9110
+15040,9802,8822,-176.0,,9110
+15040,9802,8823,53.5,,9110
+15040,9802,8824,51.5,,9110
+15040,9802,8826,1000000.0,,9001
+15040,9802,8827,0.0,,9001
+15101,9807,8801,18.5,,9110
+15101,9807,8802,-155.3,,9110
+15101,9807,8805,0.999966667,,9201
+15101,9807,8806,500000.0,,9003
+15101,9807,8807,0.0,,9003
+15102,9807,8801,20.2,,9110
+15102,9807,8802,-156.4,,9110
+15102,9807,8805,0.999966667,,9201
+15102,9807,8806,500000.0,,9003
+15102,9807,8807,0.0,,9003
+15103,9807,8801,21.1,,9110
+15103,9807,8802,-158.0,,9110
+15103,9807,8805,0.99999,,9201
+15103,9807,8806,500000.0,,9003
+15103,9807,8807,0.0,,9003
+15104,9807,8801,21.5,,9110
+15104,9807,8802,-159.3,,9110
+15104,9807,8805,0.99999,,9201
+15104,9807,8806,500000.0,,9003
+15104,9807,8807,0.0,,9003
+15105,9807,8801,21.4,,9110
+15105,9807,8802,-160.1,,9110
+15105,9807,8805,1.0,,9201
+15105,9807,8806,500000.0,,9003
+15105,9807,8807,0.0,,9003
+15131,9807,8801,18.5,,9110
+15131,9807,8802,-155.3,,9110
+15131,9807,8805,0.999966667,,9201
+15131,9807,8806,500000.0,,9001
+15131,9807,8807,0.0,,9001
+15132,9807,8801,20.2,,9110
+15132,9807,8802,-156.4,,9110
+15132,9807,8805,0.999966667,,9201
+15132,9807,8806,500000.0,,9001
+15132,9807,8807,0.0,,9001
+15133,9807,8801,21.1,,9110
+15133,9807,8802,-158.0,,9110
+15133,9807,8805,0.99999,,9201
+15133,9807,8806,500000.0,,9001
+15133,9807,8807,0.0,,9001
+15134,9807,8801,21.5,,9110
+15134,9807,8802,-159.3,,9110
+15134,9807,8805,0.99999,,9201
+15134,9807,8806,500000.0,,9001
+15134,9807,8807,0.0,,9001
+15135,9807,8801,21.4,,9110
+15135,9807,8802,-160.1,,9110
+15135,9807,8805,1.0,,9201
+15135,9807,8806,500000.0,,9001
+15135,9807,8807,0.0,,9001
+15201,9802,8821,17.5,,9110
+15201,9802,8822,-66.26,,9110
+15201,9802,8823,18.26,,9110
+15201,9802,8824,18.02,,9110
+15201,9802,8826,500000.0,,9003
+15201,9802,8827,0.0,,9003
+15202,9802,8821,17.5,,9110
+15202,9802,8822,-66.26,,9110
+15202,9802,8823,18.26,,9110
+15202,9802,8824,18.02,,9110
+15202,9802,8826,500000.0,,9003
+15202,9802,8827,100000.0,,9003
+15230,9802,8821,17.5,,9110
+15230,9802,8822,-66.26,,9110
+15230,9802,8823,18.26,,9110
+15230,9802,8824,18.02,,9110
+15230,9802,8826,200000.0,,9001
+15230,9802,8827,200000.0,,9001
+15300,9801,8801,-14.16,,9110
+15300,9801,8802,170.0,,9110
+15300,9801,8805,1.0,,9201
+15300,9801,8806,500000.0,,9003
+15300,9801,8807,0.0,,9003
+15301,9801,8801,-14.16,,9110
+15301,9801,8802,-170.0,,9110
+15301,9801,8805,1.0,,9201
+15301,9801,8806,500000.0,,9003
+15301,9801,8807,0.0,,9003
+15302,9802,8821,34.4,,9110
+15302,9802,8822,-86.0,,9110
+15302,9802,8823,35.15,,9110
+15302,9802,8824,36.25,,9110
+15302,9802,8826,2000000.0,,9003
+15302,9802,8827,100000.0,,9003
+15303,9802,8821,37.3,,9110
+15303,9802,8822,-84.15,,9110
+15303,9802,8823,37.58,,9110
+15303,9802,8824,38.58,,9110
+15303,9802,8826,500000.0,,9001
+15303,9802,8827,0.0,,9001
+15304,9807,8801,31.0,,9110
+15304,9807,8802,-110.1,,9110
+15304,9807,8805,0.9999,,9201
+15304,9807,8806,700000.0,,9002
+15304,9807,8807,0.0,,9002
+15305,9807,8801,31.0,,9110
+15305,9807,8802,-111.55,,9110
+15305,9807,8805,0.9999,,9201
+15305,9807,8806,700000.0,,9002
+15305,9807,8807,0.0,,9002
+15306,9807,8801,31.0,,9110
+15306,9807,8802,-113.45,,9110
+15306,9807,8805,0.999933333,,9201
+15306,9807,8806,700000.0,,9002
+15306,9807,8807,0.0,,9002
+15307,9802,8821,39.2,,9110
+15307,9802,8822,-122.0,,9110
+15307,9802,8823,41.4,,9110
+15307,9802,8824,40.0,,9110
+15307,9802,8826,6561666.667,,9003
+15307,9802,8827,1640416.667,,9003
+15308,9802,8821,37.4,,9110
+15308,9802,8822,-122.0,,9110
+15308,9802,8823,39.5,,9110
+15308,9802,8824,38.2,,9110
+15308,9802,8826,6561666.667,,9003
+15308,9802,8827,1640416.667,,9003
+15309,9802,8821,36.3,,9110
+15309,9802,8822,-120.3,,9110
+15309,9802,8823,38.26,,9110
+15309,9802,8824,37.04,,9110
+15309,9802,8826,6561666.667,,9003
+15309,9802,8827,1640416.667,,9003
+15310,9802,8821,35.2,,9110
+15310,9802,8822,-119.0,,9110
+15310,9802,8823,37.15,,9110
+15310,9802,8824,36.0,,9110
+15310,9802,8826,6561666.667,,9003
+15310,9802,8827,1640416.667,,9003
+15311,9802,8821,33.3,,9110
+15311,9802,8822,-118.0,,9110
+15311,9802,8823,35.28,,9110
+15311,9802,8824,34.02,,9110
+15311,9802,8826,6561666.667,,9003
+15311,9802,8827,1640416.667,,9003
+15312,9802,8821,32.1,,9110
+15312,9802,8822,-116.15,,9110
+15312,9802,8823,33.53,,9110
+15312,9802,8824,32.47,,9110
+15312,9802,8826,6561666.667,,9003
+15312,9802,8827,1640416.667,,9003
+15313,9802,8821,39.2,,9110
+15313,9802,8822,-105.3,,9110
+15313,9802,8823,40.47,,9110
+15313,9802,8824,39.43,,9110
+15313,9802,8826,3000000.0,,9003
+15313,9802,8827,1000000.0,,9003
+15314,9802,8821,37.5,,9110
+15314,9802,8822,-105.3,,9110
+15314,9802,8823,39.45,,9110
+15314,9802,8824,38.27,,9110
+15314,9802,8826,3000000.0,,9003
+15314,9802,8827,1000000.0,,9003
+15315,9802,8821,36.4,,9110
+15315,9802,8822,-105.3,,9110
+15315,9802,8823,38.26,,9110
+15315,9802,8824,37.14,,9110
+15315,9802,8826,3000000.0,,9003
+15315,9802,8827,1000000.0,,9003
+15316,9802,8821,40.5,,9110
+15316,9802,8822,-72.45,,9110
+15316,9802,8823,41.52,,9110
+15316,9802,8824,41.12,,9110
+15316,9802,8826,1000000.0,,9003
+15316,9802,8827,500000.0,,9003
+15317,9807,8801,38.0,,9110
+15317,9807,8802,-75.25,,9110
+15317,9807,8805,0.999995,,9201
+15317,9807,8806,656166.667,,9003
+15317,9807,8807,0.0,,9003
+15318,9807,8801,24.2,,9110
+15318,9807,8802,-81.0,,9110
+15318,9807,8805,0.999941177,,9201
+15318,9807,8806,656166.667,,9003
+15318,9807,8807,0.0,,9003
+15319,9807,8801,24.2,,9110
+15319,9807,8802,-82.0,,9110
+15319,9807,8805,0.999941177,,9201
+15319,9807,8806,656166.667,,9003
+15319,9807,8807,0.0,,9003
+15320,9802,8821,29.0,,9110
+15320,9802,8822,-84.3,,9110
+15320,9802,8823,30.45,,9110
+15320,9802,8824,29.35,,9110
+15320,9802,8826,1968500.0,,9003
+15320,9802,8827,0.0,,9003
+15321,9807,8801,30.0,,9110
+15321,9807,8802,-82.1,,9110
+15321,9807,8805,0.9999,,9201
+15321,9807,8806,656166.667,,9003
+15321,9807,8807,0.0,,9003
+15322,9807,8801,30.0,,9110
+15322,9807,8802,-84.1,,9110
+15322,9807,8805,0.9999,,9201
+15322,9807,8806,2296583.333,,9003
+15322,9807,8807,0.0,,9003
+15323,9807,8801,41.4,,9110
+15323,9807,8802,-112.1,,9110
+15323,9807,8805,0.999947368,,9201
+15323,9807,8806,656166.667,,9003
+15323,9807,8807,0.0,,9003
+15324,9807,8801,41.4,,9110
+15324,9807,8802,-114.0,,9110
+15324,9807,8805,0.999947368,,9201
+15324,9807,8806,1640416.667,,9003
+15324,9807,8807,0.0,,9003
+15325,9807,8801,41.4,,9110
+15325,9807,8802,-115.45,,9110
+15325,9807,8805,0.999933333,,9201
+15325,9807,8806,2624666.667,,9003
+15325,9807,8807,0.0,,9003
+15326,9807,8801,37.3,,9110
+15326,9807,8802,-85.4,,9110
+15326,9807,8805,0.999966667,,9201
+15326,9807,8806,328083.333,,9003
+15326,9807,8807,818125.0,,9003
+15327,9807,8801,37.3,,9110
+15327,9807,8802,-87.05,,9110
+15327,9807,8805,0.999966667,,9201
+15327,9807,8806,2952750.0,,9003
+15327,9807,8807,818125.0,,9003
+15328,9802,8821,37.3,,9110
+15328,9802,8822,-84.15,,9110
+15328,9802,8823,37.58,,9110
+15328,9802,8824,38.58,,9110
+15328,9802,8826,1640416.667,,9003
+15328,9802,8827,0.0,,9003
+15329,9802,8821,36.2,,9110
+15329,9802,8822,-85.45,,9110
+15329,9802,8823,37.56,,9110
+15329,9802,8824,36.44,,9110
+15329,9802,8826,1640416.667,,9003
+15329,9802,8827,1640416.667,,9003
+15330,9802,8821,37.4,,9110
+15330,9802,8822,-77.0,,9110
+15330,9802,8823,39.27,,9110
+15330,9802,8824,38.18,,9110
+15330,9802,8826,1312333.333,,9003
+15330,9802,8827,0.0,,9003
+15331,9802,8821,41.0,,9110
+15331,9802,8822,-71.3,,9110
+15331,9802,8823,42.41,,9110
+15331,9802,8824,41.43,,9110
+15331,9802,8826,656166.667,,9003
+15331,9802,8827,2460625.0,,9003
+15332,9802,8821,41.0,,9110
+15332,9802,8822,-70.3,,9110
+15332,9802,8823,41.29,,9110
+15332,9802,8824,41.17,,9110
+15332,9802,8826,1640416.667,,9003
+15332,9802,8827,0.0,,9003
+15333,9802,8821,44.47,,9110
+15333,9802,8822,-87.0,,9110
+15333,9802,8823,47.05,,9110
+15333,9802,8824,45.29,,9110
+15333,9802,8826,26246719.16,,9002
+15333,9802,8827,0.0,,9002
+15334,9802,8821,43.19,,9110
+15334,9802,8822,-84.22,,9110
+15334,9802,8823,45.42,,9110
+15334,9802,8824,44.11,,9110
+15334,9802,8826,19685039.37,,9002
+15334,9802,8827,0.0,,9002
+15335,9802,8821,41.3,,9110
+15335,9802,8822,-84.22,,9110
+15335,9802,8823,43.4,,9110
+15335,9802,8824,42.06,,9110
+15335,9802,8826,13123359.58,,9002
+15335,9802,8827,0.0,,9002
+15336,9807,8801,29.3,,9110
+15336,9807,8802,-88.5,,9110
+15336,9807,8805,0.99995,,9201
+15336,9807,8806,984250.0,,9003
+15336,9807,8807,0.0,,9003
+15337,9807,8801,29.3,,9110
+15337,9807,8802,-90.2,,9110
+15337,9807,8805,0.99995,,9201
+15337,9807,8806,2296583.333,,9003
+15337,9807,8807,0.0,,9003
+15338,9802,8821,44.15,,9110
+15338,9802,8822,-109.3,,9110
+15338,9802,8823,49.0,,9110
+15338,9802,8824,45.0,,9110
+15338,9802,8826,1968503.937,,9002
+15338,9802,8827,0.0,,9002
+15339,9807,8801,31.0,,9110
+15339,9807,8802,-104.2,,9110
+15339,9807,8805,0.999909091,,9201
+15339,9807,8806,541337.5,,9003
+15339,9807,8807,0.0,,9003
+15340,9807,8801,31.0,,9110
+15340,9807,8802,-106.15,,9110
+15340,9807,8805,0.9999,,9201
+15340,9807,8806,1640416.667,,9003
+15340,9807,8807,0.0,,9003
+15341,9807,8801,31.0,,9110
+15341,9807,8802,-107.5,,9110
+15341,9807,8805,0.999916667,,9201
+15341,9807,8806,2723091.667,,9003
+15341,9807,8807,0.0,,9003
+15342,9807,8801,38.5,,9110
+15342,9807,8802,-74.3,,9110
+15342,9807,8805,0.9999,,9201
+15342,9807,8806,492125.0,,9003
+15342,9807,8807,0.0,,9003
+15343,9807,8801,40.0,,9110
+15343,9807,8802,-76.35,,9110
+15343,9807,8805,0.9999375,,9201
+15343,9807,8806,820208.333,,9003
+15343,9807,8807,0.0,,9003
+15344,9807,8801,40.0,,9110
+15344,9807,8802,-78.35,,9110
+15344,9807,8805,0.9999375,,9201
+15344,9807,8806,1148291.667,,9003
+15344,9807,8807,0.0,,9003
+15345,9802,8821,40.1,,9110
+15345,9802,8822,-74.0,,9110
+15345,9802,8823,41.02,,9110
+15345,9802,8824,40.4,,9110
+15345,9802,8826,984250.0,,9003
+15345,9802,8827,0.0,,9003
+15346,9802,8821,33.45,,9110
+15346,9802,8822,-79.0,,9110
+15346,9802,8823,36.1,,9110
+15346,9802,8824,34.2,,9110
+15346,9802,8826,2000000.0,,9003
+15346,9802,8827,0.0,,9003
+15347,9802,8821,47.0,,9110
+15347,9802,8822,-100.3,,9110
+15347,9802,8823,48.44,,9110
+15347,9802,8824,47.26,,9110
+15347,9802,8826,1968503.937,,9002
+15347,9802,8827,0.0,,9002
+15348,9802,8821,45.4,,9110
+15348,9802,8822,-100.3,,9110
+15348,9802,8823,47.29,,9110
+15348,9802,8824,46.11,,9110
+15348,9802,8826,1968503.937,,9002
+15348,9802,8827,0.0,,9002
+15349,9802,8821,35.0,,9110
+15349,9802,8822,-98.0,,9110
+15349,9802,8823,36.46,,9110
+15349,9802,8824,35.34,,9110
+15349,9802,8826,1968500.0,,9003
+15349,9802,8827,0.0,,9003
+15350,9802,8821,33.2,,9110
+15350,9802,8822,-98.0,,9110
+15350,9802,8823,35.14,,9110
+15350,9802,8824,33.56,,9110
+15350,9802,8826,1968500.0,,9003
+15350,9802,8827,0.0,,9003
+15351,9802,8821,43.4,,9110
+15351,9802,8822,-120.3,,9110
+15351,9802,8823,46.0,,9110
+15351,9802,8824,44.2,,9110
+15351,9802,8826,8202099.738,,9002
+15351,9802,8827,0.0,,9002
+15352,9802,8821,41.4,,9110
+15352,9802,8822,-120.3,,9110
+15352,9802,8823,44.0,,9110
+15352,9802,8824,42.2,,9110
+15352,9802,8826,4921259.843,,9002
+15352,9802,8827,0.0,,9002
+15353,9802,8821,40.1,,9110
+15353,9802,8822,-77.45,,9110
+15353,9802,8823,41.57,,9110
+15353,9802,8824,40.53,,9110
+15353,9802,8826,1968500.0,,9003
+15353,9802,8827,0.0,,9003
+15354,9802,8821,39.2,,9110
+15354,9802,8822,-77.45,,9110
+15354,9802,8823,40.58,,9110
+15354,9802,8824,39.56,,9110
+15354,9802,8826,1968500.0,,9003
+15354,9802,8827,0.0,,9003
+15355,9802,8821,31.5,,9110
+15355,9802,8822,-81.0,,9110
+15355,9802,8823,34.5,,9110
+15355,9802,8824,32.3,,9110
+15355,9802,8826,2000000.0,,9002
+15355,9802,8827,0.0,,9002
+15356,9802,8821,34.2,,9110
+15356,9802,8822,-86.0,,9110
+15356,9802,8823,36.25,,9110
+15356,9802,8824,35.15,,9110
+15356,9802,8826,1968500.0,,9003
+15356,9802,8827,0.0,,9003
+15357,9802,8821,34.0,,9110
+15357,9802,8822,-101.3,,9110
+15357,9802,8823,36.11,,9110
+15357,9802,8824,34.39,,9110
+15357,9802,8826,656166.667,,9003
+15357,9802,8827,3280833.333,,9003
+15358,9802,8821,31.4,,9110
+15358,9802,8822,-98.3,,9110
+15358,9802,8823,33.58,,9110
+15358,9802,8824,32.08,,9110
+15358,9802,8826,1968500.0,,9003
+15358,9802,8827,6561666.667,,9003
+15359,9802,8821,29.4,,9110
+15359,9802,8822,-100.2,,9110
+15359,9802,8823,31.53,,9110
+15359,9802,8824,30.07,,9110
+15359,9802,8826,2296583.333,,9003
+15359,9802,8827,9842500.0,,9003
+15360,9802,8821,27.5,,9110
+15360,9802,8822,-99.0,,9110
+15360,9802,8823,30.17,,9110
+15360,9802,8824,28.23,,9110
+15360,9802,8826,1968500.0,,9003
+15360,9802,8827,13123333.333,,9003
+15361,9802,8821,25.4,,9110
+15361,9802,8822,-98.3,,9110
+15361,9802,8823,27.5,,9110
+15361,9802,8824,26.1,,9110
+15361,9802,8826,984250.0,,9003
+15361,9802,8827,16404166.667,,9003
+15362,9802,8821,40.2,,9110
+15362,9802,8822,-111.3,,9110
+15362,9802,8823,41.47,,9110
+15362,9802,8824,40.43,,9110
+15362,9802,8826,1640419.948,,9002
+15362,9802,8827,3280839.895,,9002
+15363,9802,8821,38.2,,9110
+15363,9802,8822,-111.3,,9110
+15363,9802,8823,40.39,,9110
+15363,9802,8824,39.01,,9110
+15363,9802,8826,1640419.948,,9002
+15363,9802,8827,6561679.79,,9002
+15364,9802,8821,36.4,,9110
+15364,9802,8822,-111.3,,9110
+15364,9802,8823,38.21,,9110
+15364,9802,8824,37.13,,9110
+15364,9802,8826,1640419.948,,9002
+15364,9802,8827,9842519.685,,9002
+15365,9802,8821,37.4,,9110
+15365,9802,8822,-78.3,,9110
+15365,9802,8823,39.12,,9110
+15365,9802,8824,38.02,,9110
+15365,9802,8826,11482916.667,,9003
+15365,9802,8827,6561666.667,,9003
+15366,9802,8821,36.2,,9110
+15366,9802,8822,-78.3,,9110
+15366,9802,8823,37.58,,9110
+15366,9802,8824,36.46,,9110
+15366,9802,8826,11482916.667,,9003
+15366,9802,8827,3280833.333,,9003
+15367,9802,8821,47.0,,9110
+15367,9802,8822,-120.5,,9110
+15367,9802,8823,48.44,,9110
+15367,9802,8824,47.3,,9110
+15367,9802,8826,1640416.667,,9003
+15367,9802,8827,0.0,,9003
+15368,9802,8821,45.2,,9110
+15368,9802,8822,-120.3,,9110
+15368,9802,8823,47.2,,9110
+15368,9802,8824,45.5,,9110
+15368,9802,8826,1640416.667,,9003
+15368,9802,8827,0.0,,9003
+15369,9802,8821,45.1,,9110
+15369,9802,8822,-90.0,,9110
+15369,9802,8823,46.46,,9110
+15369,9802,8824,45.34,,9110
+15369,9802,8826,1968500.0,,9003
+15369,9802,8827,0.0,,9003
+15370,9802,8821,43.5,,9110
+15370,9802,8822,-90.0,,9110
+15370,9802,8823,45.3,,9110
+15370,9802,8824,44.15,,9110
+15370,9802,8826,1968500.0,,9003
+15370,9802,8827,0.0,,9003
+15371,9802,8821,42.0,,9110
+15371,9802,8822,-90.0,,9110
+15371,9802,8823,44.04,,9110
+15371,9802,8824,42.44,,9110
+15371,9802,8826,1968500.0,,9003
+15371,9802,8827,0.0,,9003
+15914,9807,8801,0.0,,9102
+15914,9807,8802,-99.0,,9102
+15914,9807,8805,0.9996,,9201
+15914,9807,8806,1640416.67,,9003
+15914,9807,8807,0.0,,9003
+15915,9807,8801,0.0,,9102
+15915,9807,8802,-93.0,,9102
+15915,9807,8805,0.9996,,9201
+15915,9807,8806,1640416.67,,9003
+15915,9807,8807,0.0,,9003
+15916,9807,8801,0.0,,9102
+15916,9807,8802,-87.0,,9102
+15916,9807,8805,0.9996,,9201
+15916,9807,8806,1640416.67,,9003
+15916,9807,8807,0.0,,9003
+15917,9807,8801,0.0,,9102
+15917,9807,8802,-81.0,,9102
+15917,9807,8805,0.9996,,9201
+15917,9807,8806,1640416.67,,9003
+15917,9807,8807,0.0,,9003
+16000,9824,8801,0.0,,9102
+16000,9824,8805,0.9996,,9201
+16000,9824,8806,500000.0,,9001
+16000,9824,8807,0.0,,9001
+16000,9824,8830,-180.0,,9102
+16000,9824,8831,6.0,,9102
+16001,9807,8801,0.0,,9102
+16001,9807,8802,-177.0,,9102
+16001,9807,8805,0.9996,,9201
+16001,9807,8806,500000.0,,9001
+16001,9807,8807,0.0,,9001
+16002,9807,8801,0.0,,9102
+16002,9807,8802,-171.0,,9102
+16002,9807,8805,0.9996,,9201
+16002,9807,8806,500000.0,,9001
+16002,9807,8807,0.0,,9001
+16003,9807,8801,0.0,,9102
+16003,9807,8802,-165.0,,9102
+16003,9807,8805,0.9996,,9201
+16003,9807,8806,500000.0,,9001
+16003,9807,8807,0.0,,9001
+16004,9807,8801,0.0,,9102
+16004,9807,8802,-159.0,,9102
+16004,9807,8805,0.9996,,9201
+16004,9807,8806,500000.0,,9001
+16004,9807,8807,0.0,,9001
+16005,9807,8801,0.0,,9102
+16005,9807,8802,-153.0,,9102
+16005,9807,8805,0.9996,,9201
+16005,9807,8806,500000.0,,9001
+16005,9807,8807,0.0,,9001
+16006,9807,8801,0.0,,9102
+16006,9807,8802,-147.0,,9102
+16006,9807,8805,0.9996,,9201
+16006,9807,8806,500000.0,,9001
+16006,9807,8807,0.0,,9001
+16007,9807,8801,0.0,,9102
+16007,9807,8802,-141.0,,9102
+16007,9807,8805,0.9996,,9201
+16007,9807,8806,500000.0,,9001
+16007,9807,8807,0.0,,9001
+16008,9807,8801,0.0,,9102
+16008,9807,8802,-135.0,,9102
+16008,9807,8805,0.9996,,9201
+16008,9807,8806,500000.0,,9001
+16008,9807,8807,0.0,,9001
+16009,9807,8801,0.0,,9102
+16009,9807,8802,-129.0,,9102
+16009,9807,8805,0.9996,,9201
+16009,9807,8806,500000.0,,9001
+16009,9807,8807,0.0,,9001
+16010,9807,8801,0.0,,9102
+16010,9807,8802,-123.0,,9102
+16010,9807,8805,0.9996,,9201
+16010,9807,8806,500000.0,,9001
+16010,9807,8807,0.0,,9001
+16011,9807,8801,0.0,,9102
+16011,9807,8802,-117.0,,9102
+16011,9807,8805,0.9996,,9201
+16011,9807,8806,500000.0,,9001
+16011,9807,8807,0.0,,9001
+16012,9807,8801,0.0,,9102
+16012,9807,8802,-111.0,,9102
+16012,9807,8805,0.9996,,9201
+16012,9807,8806,500000.0,,9001
+16012,9807,8807,0.0,,9001
+16013,9807,8801,0.0,,9102
+16013,9807,8802,-105.0,,9102
+16013,9807,8805,0.9996,,9201
+16013,9807,8806,500000.0,,9001
+16013,9807,8807,0.0,,9001
+16014,9807,8801,0.0,,9102
+16014,9807,8802,-99.0,,9102
+16014,9807,8805,0.9996,,9201
+16014,9807,8806,500000.0,,9001
+16014,9807,8807,0.0,,9001
+16015,9807,8801,0.0,,9102
+16015,9807,8802,-93.0,,9102
+16015,9807,8805,0.9996,,9201
+16015,9807,8806,500000.0,,9001
+16015,9807,8807,0.0,,9001
+16016,9807,8801,0.0,,9102
+16016,9807,8802,-87.0,,9102
+16016,9807,8805,0.9996,,9201
+16016,9807,8806,500000.0,,9001
+16016,9807,8807,0.0,,9001
+16017,9807,8801,0.0,,9102
+16017,9807,8802,-81.0,,9102
+16017,9807,8805,0.9996,,9201
+16017,9807,8806,500000.0,,9001
+16017,9807,8807,0.0,,9001
+16018,9807,8801,0.0,,9102
+16018,9807,8802,-75.0,,9102
+16018,9807,8805,0.9996,,9201
+16018,9807,8806,500000.0,,9001
+16018,9807,8807,0.0,,9001
+16019,9807,8801,0.0,,9102
+16019,9807,8802,-69.0,,9102
+16019,9807,8805,0.9996,,9201
+16019,9807,8806,500000.0,,9001
+16019,9807,8807,0.0,,9001
+16020,9807,8801,0.0,,9102
+16020,9807,8802,-63.0,,9102
+16020,9807,8805,0.9996,,9201
+16020,9807,8806,500000.0,,9001
+16020,9807,8807,0.0,,9001
+16021,9807,8801,0.0,,9102
+16021,9807,8802,-57.0,,9102
+16021,9807,8805,0.9996,,9201
+16021,9807,8806,500000.0,,9001
+16021,9807,8807,0.0,,9001
+16022,9807,8801,0.0,,9102
+16022,9807,8802,-51.0,,9102
+16022,9807,8805,0.9996,,9201
+16022,9807,8806,500000.0,,9001
+16022,9807,8807,0.0,,9001
+16023,9807,8801,0.0,,9102
+16023,9807,8802,-45.0,,9102
+16023,9807,8805,0.9996,,9201
+16023,9807,8806,500000.0,,9001
+16023,9807,8807,0.0,,9001
+16024,9807,8801,0.0,,9102
+16024,9807,8802,-39.0,,9102
+16024,9807,8805,0.9996,,9201
+16024,9807,8806,500000.0,,9001
+16024,9807,8807,0.0,,9001
+16025,9807,8801,0.0,,9102
+16025,9807,8802,-33.0,,9102
+16025,9807,8805,0.9996,,9201
+16025,9807,8806,500000.0,,9001
+16025,9807,8807,0.0,,9001
+16026,9807,8801,0.0,,9102
+16026,9807,8802,-27.0,,9102
+16026,9807,8805,0.9996,,9201
+16026,9807,8806,500000.0,,9001
+16026,9807,8807,0.0,,9001
+16027,9807,8801,0.0,,9102
+16027,9807,8802,-21.0,,9102
+16027,9807,8805,0.9996,,9201
+16027,9807,8806,500000.0,,9001
+16027,9807,8807,0.0,,9001
+16028,9807,8801,0.0,,9102
+16028,9807,8802,-15.0,,9102
+16028,9807,8805,0.9996,,9201
+16028,9807,8806,500000.0,,9001
+16028,9807,8807,0.0,,9001
+16029,9807,8801,0.0,,9102
+16029,9807,8802,-9.0,,9102
+16029,9807,8805,0.9996,,9201
+16029,9807,8806,500000.0,,9001
+16029,9807,8807,0.0,,9001
+16030,9807,8801,0.0,,9102
+16030,9807,8802,-3.0,,9102
+16030,9807,8805,0.9996,,9201
+16030,9807,8806,500000.0,,9001
+16030,9807,8807,0.0,,9001
+16031,9807,8801,0.0,,9102
+16031,9807,8802,3.0,,9102
+16031,9807,8805,0.9996,,9201
+16031,9807,8806,500000.0,,9001
+16031,9807,8807,0.0,,9001
+16032,9807,8801,0.0,,9102
+16032,9807,8802,9.0,,9102
+16032,9807,8805,0.9996,,9201
+16032,9807,8806,500000.0,,9001
+16032,9807,8807,0.0,,9001
+16033,9807,8801,0.0,,9102
+16033,9807,8802,15.0,,9102
+16033,9807,8805,0.9996,,9201
+16033,9807,8806,500000.0,,9001
+16033,9807,8807,0.0,,9001
+16034,9807,8801,0.0,,9102
+16034,9807,8802,21.0,,9102
+16034,9807,8805,0.9996,,9201
+16034,9807,8806,500000.0,,9001
+16034,9807,8807,0.0,,9001
+16035,9807,8801,0.0,,9102
+16035,9807,8802,27.0,,9102
+16035,9807,8805,0.9996,,9201
+16035,9807,8806,500000.0,,9001
+16035,9807,8807,0.0,,9001
+16036,9807,8801,0.0,,9102
+16036,9807,8802,33.0,,9102
+16036,9807,8805,0.9996,,9201
+16036,9807,8806,500000.0,,9001
+16036,9807,8807,0.0,,9001
+16037,9807,8801,0.0,,9102
+16037,9807,8802,39.0,,9102
+16037,9807,8805,0.9996,,9201
+16037,9807,8806,500000.0,,9001
+16037,9807,8807,0.0,,9001
+16038,9807,8801,0.0,,9102
+16038,9807,8802,45.0,,9102
+16038,9807,8805,0.9996,,9201
+16038,9807,8806,500000.0,,9001
+16038,9807,8807,0.0,,9001
+16039,9807,8801,0.0,,9102
+16039,9807,8802,51.0,,9102
+16039,9807,8805,0.9996,,9201
+16039,9807,8806,500000.0,,9001
+16039,9807,8807,0.0,,9001
+16040,9807,8801,0.0,,9102
+16040,9807,8802,57.0,,9102
+16040,9807,8805,0.9996,,9201
+16040,9807,8806,500000.0,,9001
+16040,9807,8807,0.0,,9001
+16041,9807,8801,0.0,,9102
+16041,9807,8802,63.0,,9102
+16041,9807,8805,0.9996,,9201
+16041,9807,8806,500000.0,,9001
+16041,9807,8807,0.0,,9001
+16042,9807,8801,0.0,,9102
+16042,9807,8802,69.0,,9102
+16042,9807,8805,0.9996,,9201
+16042,9807,8806,500000.0,,9001
+16042,9807,8807,0.0,,9001
+16043,9807,8801,0.0,,9102
+16043,9807,8802,75.0,,9102
+16043,9807,8805,0.9996,,9201
+16043,9807,8806,500000.0,,9001
+16043,9807,8807,0.0,,9001
+16044,9807,8801,0.0,,9102
+16044,9807,8802,81.0,,9102
+16044,9807,8805,0.9996,,9201
+16044,9807,8806,500000.0,,9001
+16044,9807,8807,0.0,,9001
+16045,9807,8801,0.0,,9102
+16045,9807,8802,87.0,,9102
+16045,9807,8805,0.9996,,9201
+16045,9807,8806,500000.0,,9001
+16045,9807,8807,0.0,,9001
+16046,9807,8801,0.0,,9102
+16046,9807,8802,93.0,,9102
+16046,9807,8805,0.9996,,9201
+16046,9807,8806,500000.0,,9001
+16046,9807,8807,0.0,,9001
+16047,9807,8801,0.0,,9102
+16047,9807,8802,99.0,,9102
+16047,9807,8805,0.9996,,9201
+16047,9807,8806,500000.0,,9001
+16047,9807,8807,0.0,,9001
+16048,9807,8801,0.0,,9102
+16048,9807,8802,105.0,,9102
+16048,9807,8805,0.9996,,9201
+16048,9807,8806,500000.0,,9001
+16048,9807,8807,0.0,,9001
+16049,9807,8801,0.0,,9102
+16049,9807,8802,111.0,,9102
+16049,9807,8805,0.9996,,9201
+16049,9807,8806,500000.0,,9001
+16049,9807,8807,0.0,,9001
+16050,9807,8801,0.0,,9102
+16050,9807,8802,117.0,,9102
+16050,9807,8805,0.9996,,9201
+16050,9807,8806,500000.0,,9001
+16050,9807,8807,0.0,,9001
+16051,9807,8801,0.0,,9102
+16051,9807,8802,123.0,,9102
+16051,9807,8805,0.9996,,9201
+16051,9807,8806,500000.0,,9001
+16051,9807,8807,0.0,,9001
+16052,9807,8801,0.0,,9102
+16052,9807,8802,129.0,,9102
+16052,9807,8805,0.9996,,9201
+16052,9807,8806,500000.0,,9001
+16052,9807,8807,0.0,,9001
+16053,9807,8801,0.0,,9102
+16053,9807,8802,135.0,,9102
+16053,9807,8805,0.9996,,9201
+16053,9807,8806,500000.0,,9001
+16053,9807,8807,0.0,,9001
+16054,9807,8801,0.0,,9102
+16054,9807,8802,141.0,,9102
+16054,9807,8805,0.9996,,9201
+16054,9807,8806,500000.0,,9001
+16054,9807,8807,0.0,,9001
+16055,9807,8801,0.0,,9102
+16055,9807,8802,147.0,,9102
+16055,9807,8805,0.9996,,9201
+16055,9807,8806,500000.0,,9001
+16055,9807,8807,0.0,,9001
+16056,9807,8801,0.0,,9102
+16056,9807,8802,153.0,,9102
+16056,9807,8805,0.9996,,9201
+16056,9807,8806,500000.0,,9001
+16056,9807,8807,0.0,,9001
+16057,9807,8801,0.0,,9102
+16057,9807,8802,159.0,,9102
+16057,9807,8805,0.9996,,9201
+16057,9807,8806,500000.0,,9001
+16057,9807,8807,0.0,,9001
+16058,9807,8801,0.0,,9102
+16058,9807,8802,165.0,,9102
+16058,9807,8805,0.9996,,9201
+16058,9807,8806,500000.0,,9001
+16058,9807,8807,0.0,,9001
+16059,9807,8801,0.0,,9102
+16059,9807,8802,171.0,,9102
+16059,9807,8805,0.9996,,9201
+16059,9807,8806,500000.0,,9001
+16059,9807,8807,0.0,,9001
+16060,9807,8801,0.0,,9102
+16060,9807,8802,177.0,,9102
+16060,9807,8805,0.9996,,9201
+16060,9807,8806,500000.0,,9001
+16060,9807,8807,0.0,,9001
+16061,9810,8801,90.0,,9102
+16061,9810,8802,0.0,,9102
+16061,9810,8805,0.994,,9201
+16061,9810,8806,2000000.0,,9001
+16061,9810,8807,2000000.0,,9001
+16070,9807,8801,0.0,,9102
+16070,9807,8802,120.0,,9102
+16070,9807,8805,1.0,,9201
+16070,9807,8806,40500000.0,,9001
+16070,9807,8807,0.0,,9001
+16071,9807,8801,0.0,,9102
+16071,9807,8802,123.0,,9102
+16071,9807,8805,1.0,,9201
+16071,9807,8806,41500000.0,,9001
+16071,9807,8807,0.0,,9001
+16072,9807,8801,0.0,,9102
+16072,9807,8802,126.0,,9102
+16072,9807,8805,1.0,,9201
+16072,9807,8806,42500000.0,,9001
+16072,9807,8807,0.0,,9001
+16073,9807,8801,0.0,,9102
+16073,9807,8802,129.0,,9102
+16073,9807,8805,1.0,,9201
+16073,9807,8806,43500000.0,,9001
+16073,9807,8807,0.0,,9001
+16074,9807,8801,0.0,,9102
+16074,9807,8802,132.0,,9102
+16074,9807,8805,1.0,,9201
+16074,9807,8806,44500000.0,,9001
+16074,9807,8807,0.0,,9001
+16075,9807,8801,0.0,,9102
+16075,9807,8802,135.0,,9102
+16075,9807,8805,1.0,,9201
+16075,9807,8806,45500000.0,,9001
+16075,9807,8807,0.0,,9001
+16076,9807,8801,0.0,,9102
+16076,9807,8802,138.0,,9102
+16076,9807,8805,1.0,,9201
+16076,9807,8806,46500000.0,,9001
+16076,9807,8807,0.0,,9001
+16077,9807,8801,0.0,,9102
+16077,9807,8802,141.0,,9102
+16077,9807,8805,1.0,,9201
+16077,9807,8806,47500000.0,,9001
+16077,9807,8807,0.0,,9001
+16078,9807,8801,0.0,,9102
+16078,9807,8802,144.0,,9102
+16078,9807,8805,1.0,,9201
+16078,9807,8806,48500000.0,,9001
+16078,9807,8807,0.0,,9001
+16079,9807,8801,0.0,,9102
+16079,9807,8802,147.0,,9102
+16079,9807,8805,1.0,,9201
+16079,9807,8806,49500000.0,,9001
+16079,9807,8807,0.0,,9001
+16080,9807,8801,0.0,,9102
+16080,9807,8802,150.0,,9102
+16080,9807,8805,1.0,,9201
+16080,9807,8806,50500000.0,,9001
+16080,9807,8807,0.0,,9001
+16081,9807,8801,0.0,,9102
+16081,9807,8802,153.0,,9102
+16081,9807,8805,1.0,,9201
+16081,9807,8806,51500000.0,,9001
+16081,9807,8807,0.0,,9001
+16082,9807,8801,0.0,,9102
+16082,9807,8802,156.0,,9102
+16082,9807,8805,1.0,,9201
+16082,9807,8806,52500000.0,,9001
+16082,9807,8807,0.0,,9001
+16083,9807,8801,0.0,,9102
+16083,9807,8802,159.0,,9102
+16083,9807,8805,1.0,,9201
+16083,9807,8806,53500000.0,,9001
+16083,9807,8807,0.0,,9001
+16084,9807,8801,0.0,,9102
+16084,9807,8802,162.0,,9102
+16084,9807,8805,1.0,,9201
+16084,9807,8806,54500000.0,,9001
+16084,9807,8807,0.0,,9001
+16085,9807,8801,0.0,,9102
+16085,9807,8802,165.0,,9102
+16085,9807,8805,1.0,,9201
+16085,9807,8806,55500000.0,,9001
+16085,9807,8807,0.0,,9001
+16086,9807,8801,0.0,,9102
+16086,9807,8802,168.0,,9102
+16086,9807,8805,1.0,,9201
+16086,9807,8806,56500000.0,,9001
+16086,9807,8807,0.0,,9001
+16087,9807,8801,0.0,,9102
+16087,9807,8802,171.0,,9102
+16087,9807,8805,1.0,,9201
+16087,9807,8806,57500000.0,,9001
+16087,9807,8807,0.0,,9001
+16088,9807,8801,0.0,,9102
+16088,9807,8802,174.0,,9102
+16088,9807,8805,1.0,,9201
+16088,9807,8806,58500000.0,,9001
+16088,9807,8807,0.0,,9001
+16089,9807,8801,0.0,,9102
+16089,9807,8802,177.0,,9102
+16089,9807,8805,1.0,,9201
+16089,9807,8806,59500000.0,,9001
+16089,9807,8807,0.0,,9001
+16090,9807,8801,0.0,,9102
+16090,9807,8802,180.0,,9102
+16090,9807,8805,1.0,,9201
+16090,9807,8806,60000000.0,,9001
+16090,9807,8807,0.0,,9001
+16091,9807,8801,0.0,,9102
+16091,9807,8802,-177.0,,9102
+16091,9807,8805,1.0,,9201
+16091,9807,8806,61500000.0,,9001
+16091,9807,8807,0.0,,9001
+16092,9807,8801,0.0,,9102
+16092,9807,8802,-174.0,,9102
+16092,9807,8805,1.0,,9201
+16092,9807,8806,62500000.0,,9001
+16092,9807,8807,0.0,,9001
+16093,9807,8801,0.0,,9102
+16093,9807,8802,-171.0,,9102
+16093,9807,8805,1.0,,9201
+16093,9807,8806,63500000.0,,9001
+16093,9807,8807,0.0,,9001
+16094,9807,8801,0.0,,9102
+16094,9807,8802,-168.0,,9102
+16094,9807,8805,1.0,,9201
+16094,9807,8806,64500000.0,,9001
+16094,9807,8807,0.0,,9001
+16100,9824,8801,0.0,,9102
+16100,9824,8805,0.9996,,9201
+16100,9824,8806,500000.0,,9001
+16100,9824,8807,10000000.0,,9001
+16100,9824,8830,-180.0,,9102
+16100,9824,8831,6.0,,9102
+16101,9807,8801,0.0,,9102
+16101,9807,8802,-177.0,,9102
+16101,9807,8805,0.9996,,9201
+16101,9807,8806,500000.0,,9001
+16101,9807,8807,10000000.0,,9001
+16102,9807,8801,0.0,,9102
+16102,9807,8802,-171.0,,9102
+16102,9807,8805,0.9996,,9201
+16102,9807,8806,500000.0,,9001
+16102,9807,8807,10000000.0,,9001
+16103,9807,8801,0.0,,9102
+16103,9807,8802,-165.0,,9102
+16103,9807,8805,0.9996,,9201
+16103,9807,8806,500000.0,,9001
+16103,9807,8807,10000000.0,,9001
+16104,9807,8801,0.0,,9102
+16104,9807,8802,-159.0,,9102
+16104,9807,8805,0.9996,,9201
+16104,9807,8806,500000.0,,9001
+16104,9807,8807,10000000.0,,9001
+16105,9807,8801,0.0,,9102
+16105,9807,8802,-153.0,,9102
+16105,9807,8805,0.9996,,9201
+16105,9807,8806,500000.0,,9001
+16105,9807,8807,10000000.0,,9001
+16106,9807,8801,0.0,,9102
+16106,9807,8802,-147.0,,9102
+16106,9807,8805,0.9996,,9201
+16106,9807,8806,500000.0,,9001
+16106,9807,8807,10000000.0,,9001
+16107,9807,8801,0.0,,9102
+16107,9807,8802,-141.0,,9102
+16107,9807,8805,0.9996,,9201
+16107,9807,8806,500000.0,,9001
+16107,9807,8807,10000000.0,,9001
+16108,9807,8801,0.0,,9102
+16108,9807,8802,-135.0,,9102
+16108,9807,8805,0.9996,,9201
+16108,9807,8806,500000.0,,9001
+16108,9807,8807,10000000.0,,9001
+16109,9807,8801,0.0,,9102
+16109,9807,8802,-129.0,,9102
+16109,9807,8805,0.9996,,9201
+16109,9807,8806,500000.0,,9001
+16109,9807,8807,10000000.0,,9001
+16110,9807,8801,0.0,,9102
+16110,9807,8802,-123.0,,9102
+16110,9807,8805,0.9996,,9201
+16110,9807,8806,500000.0,,9001
+16110,9807,8807,10000000.0,,9001
+16111,9807,8801,0.0,,9102
+16111,9807,8802,-117.0,,9102
+16111,9807,8805,0.9996,,9201
+16111,9807,8806,500000.0,,9001
+16111,9807,8807,10000000.0,,9001
+16112,9807,8801,0.0,,9102
+16112,9807,8802,-111.0,,9102
+16112,9807,8805,0.9996,,9201
+16112,9807,8806,500000.0,,9001
+16112,9807,8807,10000000.0,,9001
+16113,9807,8801,0.0,,9102
+16113,9807,8802,-105.0,,9102
+16113,9807,8805,0.9996,,9201
+16113,9807,8806,500000.0,,9001
+16113,9807,8807,10000000.0,,9001
+16114,9807,8801,0.0,,9102
+16114,9807,8802,-99.0,,9102
+16114,9807,8805,0.9996,,9201
+16114,9807,8806,500000.0,,9001
+16114,9807,8807,10000000.0,,9001
+16115,9807,8801,0.0,,9102
+16115,9807,8802,-93.0,,9102
+16115,9807,8805,0.9996,,9201
+16115,9807,8806,500000.0,,9001
+16115,9807,8807,10000000.0,,9001
+16116,9807,8801,0.0,,9102
+16116,9807,8802,-87.0,,9102
+16116,9807,8805,0.9996,,9201
+16116,9807,8806,500000.0,,9001
+16116,9807,8807,10000000.0,,9001
+16117,9807,8801,0.0,,9102
+16117,9807,8802,-81.0,,9102
+16117,9807,8805,0.9996,,9201
+16117,9807,8806,500000.0,,9001
+16117,9807,8807,10000000.0,,9001
+16118,9807,8801,0.0,,9102
+16118,9807,8802,-75.0,,9102
+16118,9807,8805,0.9996,,9201
+16118,9807,8806,500000.0,,9001
+16118,9807,8807,10000000.0,,9001
+16119,9807,8801,0.0,,9102
+16119,9807,8802,-69.0,,9102
+16119,9807,8805,0.9996,,9201
+16119,9807,8806,500000.0,,9001
+16119,9807,8807,10000000.0,,9001
+16120,9807,8801,0.0,,9102
+16120,9807,8802,-63.0,,9102
+16120,9807,8805,0.9996,,9201
+16120,9807,8806,500000.0,,9001
+16120,9807,8807,10000000.0,,9001
+16121,9807,8801,0.0,,9102
+16121,9807,8802,-57.0,,9102
+16121,9807,8805,0.9996,,9201
+16121,9807,8806,500000.0,,9001
+16121,9807,8807,10000000.0,,9001
+16122,9807,8801,0.0,,9102
+16122,9807,8802,-51.0,,9102
+16122,9807,8805,0.9996,,9201
+16122,9807,8806,500000.0,,9001
+16122,9807,8807,10000000.0,,9001
+16123,9807,8801,0.0,,9102
+16123,9807,8802,-45.0,,9102
+16123,9807,8805,0.9996,,9201
+16123,9807,8806,500000.0,,9001
+16123,9807,8807,10000000.0,,9001
+16124,9807,8801,0.0,,9102
+16124,9807,8802,-39.0,,9102
+16124,9807,8805,0.9996,,9201
+16124,9807,8806,500000.0,,9001
+16124,9807,8807,10000000.0,,9001
+16125,9807,8801,0.0,,9102
+16125,9807,8802,-33.0,,9102
+16125,9807,8805,0.9996,,9201
+16125,9807,8806,500000.0,,9001
+16125,9807,8807,10000000.0,,9001
+16126,9807,8801,0.0,,9102
+16126,9807,8802,-27.0,,9102
+16126,9807,8805,0.9996,,9201
+16126,9807,8806,500000.0,,9001
+16126,9807,8807,10000000.0,,9001
+16127,9807,8801,0.0,,9102
+16127,9807,8802,-21.0,,9102
+16127,9807,8805,0.9996,,9201
+16127,9807,8806,500000.0,,9001
+16127,9807,8807,10000000.0,,9001
+16128,9807,8801,0.0,,9102
+16128,9807,8802,-15.0,,9102
+16128,9807,8805,0.9996,,9201
+16128,9807,8806,500000.0,,9001
+16128,9807,8807,10000000.0,,9001
+16129,9807,8801,0.0,,9102
+16129,9807,8802,-9.0,,9102
+16129,9807,8805,0.9996,,9201
+16129,9807,8806,500000.0,,9001
+16129,9807,8807,10000000.0,,9001
+16130,9807,8801,0.0,,9102
+16130,9807,8802,-3.0,,9102
+16130,9807,8805,0.9996,,9201
+16130,9807,8806,500000.0,,9001
+16130,9807,8807,10000000.0,,9001
+16131,9807,8801,0.0,,9102
+16131,9807,8802,3.0,,9102
+16131,9807,8805,0.9996,,9201
+16131,9807,8806,500000.0,,9001
+16131,9807,8807,10000000.0,,9001
+16132,9807,8801,0.0,,9102
+16132,9807,8802,9.0,,9102
+16132,9807,8805,0.9996,,9201
+16132,9807,8806,500000.0,,9001
+16132,9807,8807,10000000.0,,9001
+16133,9807,8801,0.0,,9102
+16133,9807,8802,15.0,,9102
+16133,9807,8805,0.9996,,9201
+16133,9807,8806,500000.0,,9001
+16133,9807,8807,10000000.0,,9001
+16134,9807,8801,0.0,,9102
+16134,9807,8802,21.0,,9102
+16134,9807,8805,0.9996,,9201
+16134,9807,8806,500000.0,,9001
+16134,9807,8807,10000000.0,,9001
+16135,9807,8801,0.0,,9102
+16135,9807,8802,27.0,,9102
+16135,9807,8805,0.9996,,9201
+16135,9807,8806,500000.0,,9001
+16135,9807,8807,10000000.0,,9001
+16136,9807,8801,0.0,,9102
+16136,9807,8802,33.0,,9102
+16136,9807,8805,0.9996,,9201
+16136,9807,8806,500000.0,,9001
+16136,9807,8807,10000000.0,,9001
+16137,9807,8801,0.0,,9102
+16137,9807,8802,39.0,,9102
+16137,9807,8805,0.9996,,9201
+16137,9807,8806,500000.0,,9001
+16137,9807,8807,10000000.0,,9001
+16138,9807,8801,0.0,,9102
+16138,9807,8802,45.0,,9102
+16138,9807,8805,0.9996,,9201
+16138,9807,8806,500000.0,,9001
+16138,9807,8807,10000000.0,,9001
+16139,9807,8801,0.0,,9102
+16139,9807,8802,51.0,,9102
+16139,9807,8805,0.9996,,9201
+16139,9807,8806,500000.0,,9001
+16139,9807,8807,10000000.0,,9001
+16140,9807,8801,0.0,,9102
+16140,9807,8802,57.0,,9102
+16140,9807,8805,0.9996,,9201
+16140,9807,8806,500000.0,,9001
+16140,9807,8807,10000000.0,,9001
+16141,9807,8801,0.0,,9102
+16141,9807,8802,63.0,,9102
+16141,9807,8805,0.9996,,9201
+16141,9807,8806,500000.0,,9001
+16141,9807,8807,10000000.0,,9001
+16142,9807,8801,0.0,,9102
+16142,9807,8802,69.0,,9102
+16142,9807,8805,0.9996,,9201
+16142,9807,8806,500000.0,,9001
+16142,9807,8807,10000000.0,,9001
+16143,9807,8801,0.0,,9102
+16143,9807,8802,75.0,,9102
+16143,9807,8805,0.9996,,9201
+16143,9807,8806,500000.0,,9001
+16143,9807,8807,10000000.0,,9001
+16144,9807,8801,0.0,,9102
+16144,9807,8802,81.0,,9102
+16144,9807,8805,0.9996,,9201
+16144,9807,8806,500000.0,,9001
+16144,9807,8807,10000000.0,,9001
+16145,9807,8801,0.0,,9102
+16145,9807,8802,87.0,,9102
+16145,9807,8805,0.9996,,9201
+16145,9807,8806,500000.0,,9001
+16145,9807,8807,10000000.0,,9001
+16146,9807,8801,0.0,,9102
+16146,9807,8802,93.0,,9102
+16146,9807,8805,0.9996,,9201
+16146,9807,8806,500000.0,,9001
+16146,9807,8807,10000000.0,,9001
+16147,9807,8801,0.0,,9102
+16147,9807,8802,99.0,,9102
+16147,9807,8805,0.9996,,9201
+16147,9807,8806,500000.0,,9001
+16147,9807,8807,10000000.0,,9001
+16148,9807,8801,0.0,,9102
+16148,9807,8802,105.0,,9102
+16148,9807,8805,0.9996,,9201
+16148,9807,8806,500000.0,,9001
+16148,9807,8807,10000000.0,,9001
+16149,9807,8801,0.0,,9102
+16149,9807,8802,111.0,,9102
+16149,9807,8805,0.9996,,9201
+16149,9807,8806,500000.0,,9001
+16149,9807,8807,10000000.0,,9001
+16150,9807,8801,0.0,,9102
+16150,9807,8802,117.0,,9102
+16150,9807,8805,0.9996,,9201
+16150,9807,8806,500000.0,,9001
+16150,9807,8807,10000000.0,,9001
+16151,9807,8801,0.0,,9102
+16151,9807,8802,123.0,,9102
+16151,9807,8805,0.9996,,9201
+16151,9807,8806,500000.0,,9001
+16151,9807,8807,10000000.0,,9001
+16152,9807,8801,0.0,,9102
+16152,9807,8802,129.0,,9102
+16152,9807,8805,0.9996,,9201
+16152,9807,8806,500000.0,,9001
+16152,9807,8807,10000000.0,,9001
+16153,9807,8801,0.0,,9102
+16153,9807,8802,135.0,,9102
+16153,9807,8805,0.9996,,9201
+16153,9807,8806,500000.0,,9001
+16153,9807,8807,10000000.0,,9001
+16154,9807,8801,0.0,,9102
+16154,9807,8802,141.0,,9102
+16154,9807,8805,0.9996,,9201
+16154,9807,8806,500000.0,,9001
+16154,9807,8807,10000000.0,,9001
+16155,9807,8801,0.0,,9102
+16155,9807,8802,147.0,,9102
+16155,9807,8805,0.9996,,9201
+16155,9807,8806,500000.0,,9001
+16155,9807,8807,10000000.0,,9001
+16156,9807,8801,0.0,,9102
+16156,9807,8802,153.0,,9102
+16156,9807,8805,0.9996,,9201
+16156,9807,8806,500000.0,,9001
+16156,9807,8807,10000000.0,,9001
+16157,9807,8801,0.0,,9102
+16157,9807,8802,159.0,,9102
+16157,9807,8805,0.9996,,9201
+16157,9807,8806,500000.0,,9001
+16157,9807,8807,10000000.0,,9001
+16158,9807,8801,0.0,,9102
+16158,9807,8802,165.0,,9102
+16158,9807,8805,0.9996,,9201
+16158,9807,8806,500000.0,,9001
+16158,9807,8807,10000000.0,,9001
+16159,9807,8801,0.0,,9102
+16159,9807,8802,171.0,,9102
+16159,9807,8805,0.9996,,9201
+16159,9807,8806,500000.0,,9001
+16159,9807,8807,10000000.0,,9001
+16160,9807,8801,0.0,,9102
+16160,9807,8802,177.0,,9102
+16160,9807,8805,0.9996,,9201
+16160,9807,8806,500000.0,,9001
+16160,9807,8807,10000000.0,,9001
+16161,9810,8801,-90.0,,9102
+16161,9810,8802,0.0,,9102
+16161,9810,8805,0.994,,9201
+16161,9810,8806,2000000.0,,9001
+16161,9810,8807,2000000.0,,9001
+16170,9807,8801,0.0,,9102
+16170,9807,8802,120.0,,9102
+16170,9807,8805,1.0,,9201
+16170,9807,8806,500000.0,,9001
+16170,9807,8807,0.0,,9001
+16171,9807,8801,0.0,,9102
+16171,9807,8802,123.0,,9102
+16171,9807,8805,1.0,,9201
+16171,9807,8806,500000.0,,9001
+16171,9807,8807,0.0,,9001
+16172,9807,8801,0.0,,9102
+16172,9807,8802,126.0,,9102
+16172,9807,8805,1.0,,9201
+16172,9807,8806,500000.0,,9001
+16172,9807,8807,0.0,,9001
+16173,9807,8801,0.0,,9102
+16173,9807,8802,129.0,,9102
+16173,9807,8805,1.0,,9201
+16173,9807,8806,500000.0,,9001
+16173,9807,8807,0.0,,9001
+16174,9807,8801,0.0,,9102
+16174,9807,8802,132.0,,9102
+16174,9807,8805,1.0,,9201
+16174,9807,8806,500000.0,,9001
+16174,9807,8807,0.0,,9001
+16175,9807,8801,0.0,,9102
+16175,9807,8802,135.0,,9102
+16175,9807,8805,1.0,,9201
+16175,9807,8806,500000.0,,9001
+16175,9807,8807,0.0,,9001
+16176,9807,8801,0.0,,9102
+16176,9807,8802,138.0,,9102
+16176,9807,8805,1.0,,9201
+16176,9807,8806,500000.0,,9001
+16176,9807,8807,0.0,,9001
+16177,9807,8801,0.0,,9102
+16177,9807,8802,141.0,,9102
+16177,9807,8805,1.0,,9201
+16177,9807,8806,500000.0,,9001
+16177,9807,8807,0.0,,9001
+16178,9807,8801,0.0,,9102
+16178,9807,8802,144.0,,9102
+16178,9807,8805,1.0,,9201
+16178,9807,8806,500000.0,,9001
+16178,9807,8807,0.0,,9001
+16179,9807,8801,0.0,,9102
+16179,9807,8802,147.0,,9102
+16179,9807,8805,1.0,,9201
+16179,9807,8806,500000.0,,9001
+16179,9807,8807,0.0,,9001
+16180,9807,8801,0.0,,9102
+16180,9807,8802,150.0,,9102
+16180,9807,8805,1.0,,9201
+16180,9807,8806,500000.0,,9001
+16180,9807,8807,0.0,,9001
+16181,9807,8801,0.0,,9102
+16181,9807,8802,153.0,,9102
+16181,9807,8805,1.0,,9201
+16181,9807,8806,500000.0,,9001
+16181,9807,8807,0.0,,9001
+16182,9807,8801,0.0,,9102
+16182,9807,8802,156.0,,9102
+16182,9807,8805,1.0,,9201
+16182,9807,8806,500000.0,,9001
+16182,9807,8807,0.0,,9001
+16183,9807,8801,0.0,,9102
+16183,9807,8802,159.0,,9102
+16183,9807,8805,1.0,,9201
+16183,9807,8806,500000.0,,9001
+16183,9807,8807,0.0,,9001
+16184,9807,8801,0.0,,9102
+16184,9807,8802,162.0,,9102
+16184,9807,8805,1.0,,9201
+16184,9807,8806,500000.0,,9001
+16184,9807,8807,0.0,,9001
+16185,9807,8801,0.0,,9102
+16185,9807,8802,165.0,,9102
+16185,9807,8805,1.0,,9201
+16185,9807,8806,500000.0,,9001
+16185,9807,8807,0.0,,9001
+16186,9807,8801,0.0,,9102
+16186,9807,8802,168.0,,9102
+16186,9807,8805,1.0,,9201
+16186,9807,8806,500000.0,,9001
+16186,9807,8807,0.0,,9001
+16187,9807,8801,0.0,,9102
+16187,9807,8802,171.0,,9102
+16187,9807,8805,1.0,,9201
+16187,9807,8806,500000.0,,9001
+16187,9807,8807,0.0,,9001
+16188,9807,8801,0.0,,9102
+16188,9807,8802,174.0,,9102
+16188,9807,8805,1.0,,9201
+16188,9807,8806,500000.0,,9001
+16188,9807,8807,0.0,,9001
+16189,9807,8801,0.0,,9102
+16189,9807,8802,177.0,,9102
+16189,9807,8805,1.0,,9201
+16189,9807,8806,500000.0,,9001
+16189,9807,8807,0.0,,9001
+16190,9807,8801,0.0,,9102
+16190,9807,8802,180.0,,9102
+16190,9807,8805,1.0,,9201
+16190,9807,8806,500000.0,,9001
+16190,9807,8807,0.0,,9001
+16191,9807,8801,0.0,,9102
+16191,9807,8802,-177.0,,9102
+16191,9807,8805,1.0,,9201
+16191,9807,8806,500000.0,,9001
+16191,9807,8807,0.0,,9001
+16192,9807,8801,0.0,,9102
+16192,9807,8802,-174.0,,9102
+16192,9807,8805,1.0,,9201
+16192,9807,8806,500000.0,,9001
+16192,9807,8807,0.0,,9001
+16193,9807,8801,0.0,,9102
+16193,9807,8802,-171.0,,9102
+16193,9807,8805,1.0,,9201
+16193,9807,8806,500000.0,,9001
+16193,9807,8807,0.0,,9001
+16194,9807,8801,0.0,,9102
+16194,9807,8802,-168.0,,9102
+16194,9807,8805,1.0,,9201
+16194,9807,8806,500000.0,,9001
+16194,9807,8807,0.0,,9001
+16201,9807,8801,0.0,,9102
+16201,9807,8802,3.0,,9102
+16201,9807,8805,1.0,,9201
+16201,9807,8806,1500000.0,,9001
+16201,9807,8807,0.0,,9001
+16202,9807,8801,0.0,,9102
+16202,9807,8802,9.0,,9102
+16202,9807,8805,1.0,,9201
+16202,9807,8806,2500000.0,,9001
+16202,9807,8807,0.0,,9001
+16203,9807,8801,0.0,,9102
+16203,9807,8802,15.0,,9102
+16203,9807,8805,1.0,,9201
+16203,9807,8806,3500000.0,,9001
+16203,9807,8807,0.0,,9001
+16204,9807,8801,0.0,,9102
+16204,9807,8802,21.0,,9102
+16204,9807,8805,1.0,,9201
+16204,9807,8806,4500000.0,,9001
+16204,9807,8807,0.0,,9001
+16205,9807,8801,0.0,,9102
+16205,9807,8802,27.0,,9102
+16205,9807,8805,1.0,,9201
+16205,9807,8806,5500000.0,,9001
+16205,9807,8807,0.0,,9001
+16206,9807,8801,0.0,,9102
+16206,9807,8802,33.0,,9102
+16206,9807,8805,1.0,,9201
+16206,9807,8806,6500000.0,,9001
+16206,9807,8807,0.0,,9001
+16207,9807,8801,0.0,,9102
+16207,9807,8802,39.0,,9102
+16207,9807,8805,1.0,,9201
+16207,9807,8806,7500000.0,,9001
+16207,9807,8807,0.0,,9001
+16208,9807,8801,0.0,,9102
+16208,9807,8802,45.0,,9102
+16208,9807,8805,1.0,,9201
+16208,9807,8806,8500000.0,,9001
+16208,9807,8807,0.0,,9001
+16209,9807,8801,0.0,,9102
+16209,9807,8802,51.0,,9102
+16209,9807,8805,1.0,,9201
+16209,9807,8806,9500000.0,,9001
+16209,9807,8807,0.0,,9001
+16210,9807,8801,0.0,,9102
+16210,9807,8802,57.0,,9102
+16210,9807,8805,1.0,,9201
+16210,9807,8806,10500000.0,,9001
+16210,9807,8807,0.0,,9001
+16211,9807,8801,0.0,,9102
+16211,9807,8802,63.0,,9102
+16211,9807,8805,1.0,,9201
+16211,9807,8806,11500000.0,,9001
+16211,9807,8807,0.0,,9001
+16212,9807,8801,0.0,,9102
+16212,9807,8802,69.0,,9102
+16212,9807,8805,1.0,,9201
+16212,9807,8806,12500000.0,,9001
+16212,9807,8807,0.0,,9001
+16213,9807,8801,0.0,,9102
+16213,9807,8802,75.0,,9102
+16213,9807,8805,1.0,,9201
+16213,9807,8806,13500000.0,,9001
+16213,9807,8807,0.0,,9001
+16214,9807,8801,0.0,,9102
+16214,9807,8802,81.0,,9102
+16214,9807,8805,1.0,,9201
+16214,9807,8806,14500000.0,,9001
+16214,9807,8807,0.0,,9001
+16215,9807,8801,0.0,,9102
+16215,9807,8802,87.0,,9102
+16215,9807,8805,1.0,,9201
+16215,9807,8806,15500000.0,,9001
+16215,9807,8807,0.0,,9001
+16216,9807,8801,0.0,,9102
+16216,9807,8802,93.0,,9102
+16216,9807,8805,1.0,,9201
+16216,9807,8806,16500000.0,,9001
+16216,9807,8807,0.0,,9001
+16217,9807,8801,0.0,,9102
+16217,9807,8802,99.0,,9102
+16217,9807,8805,1.0,,9201
+16217,9807,8806,17500000.0,,9001
+16217,9807,8807,0.0,,9001
+16218,9807,8801,0.0,,9102
+16218,9807,8802,105.0,,9102
+16218,9807,8805,1.0,,9201
+16218,9807,8806,18500000.0,,9001
+16218,9807,8807,0.0,,9001
+16219,9807,8801,0.0,,9102
+16219,9807,8802,111.0,,9102
+16219,9807,8805,1.0,,9201
+16219,9807,8806,19500000.0,,9001
+16219,9807,8807,0.0,,9001
+16220,9807,8801,0.0,,9102
+16220,9807,8802,117.0,,9102
+16220,9807,8805,1.0,,9201
+16220,9807,8806,20500000.0,,9001
+16220,9807,8807,0.0,,9001
+16221,9807,8801,0.0,,9102
+16221,9807,8802,123.0,,9102
+16221,9807,8805,1.0,,9201
+16221,9807,8806,21500000.0,,9001
+16221,9807,8807,0.0,,9001
+16222,9807,8801,0.0,,9102
+16222,9807,8802,129.0,,9102
+16222,9807,8805,1.0,,9201
+16222,9807,8806,22500000.0,,9001
+16222,9807,8807,0.0,,9001
+16223,9807,8801,0.0,,9102
+16223,9807,8802,135.0,,9102
+16223,9807,8805,1.0,,9201
+16223,9807,8806,23500000.0,,9001
+16223,9807,8807,0.0,,9001
+16224,9807,8801,0.0,,9102
+16224,9807,8802,141.0,,9102
+16224,9807,8805,1.0,,9201
+16224,9807,8806,24500000.0,,9001
+16224,9807,8807,0.0,,9001
+16225,9807,8801,0.0,,9102
+16225,9807,8802,147.0,,9102
+16225,9807,8805,1.0,,9201
+16225,9807,8806,25500000.0,,9001
+16225,9807,8807,0.0,,9001
+16226,9807,8801,0.0,,9102
+16226,9807,8802,153.0,,9102
+16226,9807,8805,1.0,,9201
+16226,9807,8806,26500000.0,,9001
+16226,9807,8807,0.0,,9001
+16227,9807,8801,0.0,,9102
+16227,9807,8802,159.0,,9102
+16227,9807,8805,1.0,,9201
+16227,9807,8806,27500000.0,,9001
+16227,9807,8807,0.0,,9001
+16228,9807,8801,0.0,,9102
+16228,9807,8802,165.0,,9102
+16228,9807,8805,1.0,,9201
+16228,9807,8806,28500000.0,,9001
+16228,9807,8807,0.0,,9001
+16229,9807,8801,0.0,,9102
+16229,9807,8802,171.0,,9102
+16229,9807,8805,1.0,,9201
+16229,9807,8806,29500000.0,,9001
+16229,9807,8807,0.0,,9001
+16230,9807,8801,0.0,,9102
+16230,9807,8802,177.0,,9102
+16230,9807,8805,1.0,,9201
+16230,9807,8806,30500000.0,,9001
+16230,9807,8807,0.0,,9001
+16231,9807,8801,0.0,,9102
+16231,9807,8802,-177.0,,9102
+16231,9807,8805,1.0,,9201
+16231,9807,8806,31500000.0,,9001
+16231,9807,8807,0.0,,9001
+16232,9807,8801,0.0,,9102
+16232,9807,8802,-171.0,,9102
+16232,9807,8805,1.0,,9201
+16232,9807,8806,32500000.0,,9001
+16232,9807,8807,0.0,,9001
+16233,9807,8801,0.0,,9102
+16233,9807,8802,-165.0,,9102
+16233,9807,8805,1.0,,9201
+16233,9807,8806,33500000.0,,9001
+16233,9807,8807,0.0,,9001
+16234,9807,8801,0.0,,9102
+16234,9807,8802,-159.0,,9102
+16234,9807,8805,1.0,,9201
+16234,9807,8806,34500000.0,,9001
+16234,9807,8807,0.0,,9001
+16235,9807,8801,0.0,,9102
+16235,9807,8802,-153.0,,9102
+16235,9807,8805,1.0,,9201
+16235,9807,8806,35500000.0,,9001
+16235,9807,8807,0.0,,9001
+16236,9807,8801,0.0,,9102
+16236,9807,8802,-147.0,,9102
+16236,9807,8805,1.0,,9201
+16236,9807,8806,36500000.0,,9001
+16236,9807,8807,0.0,,9001
+16237,9807,8801,0.0,,9102
+16237,9807,8802,-141.0,,9102
+16237,9807,8805,1.0,,9201
+16237,9807,8806,37500000.0,,9001
+16237,9807,8807,0.0,,9001
+16238,9807,8801,0.0,,9102
+16238,9807,8802,-135.0,,9102
+16238,9807,8805,1.0,,9201
+16238,9807,8806,38500000.0,,9001
+16238,9807,8807,0.0,,9001
+16239,9807,8801,0.0,,9102
+16239,9807,8802,-129.0,,9102
+16239,9807,8805,1.0,,9201
+16239,9807,8806,39500000.0,,9001
+16239,9807,8807,0.0,,9001
+16240,9807,8801,0.0,,9102
+16240,9807,8802,-123.0,,9102
+16240,9807,8805,1.0,,9201
+16240,9807,8806,40500000.0,,9001
+16240,9807,8807,0.0,,9001
+16241,9807,8801,0.0,,9102
+16241,9807,8802,-117.0,,9102
+16241,9807,8805,1.0,,9201
+16241,9807,8806,41500000.0,,9001
+16241,9807,8807,0.0,,9001
+16242,9807,8801,0.0,,9102
+16242,9807,8802,-111.0,,9102
+16242,9807,8805,1.0,,9201
+16242,9807,8806,42500000.0,,9001
+16242,9807,8807,0.0,,9001
+16243,9807,8801,0.0,,9102
+16243,9807,8802,-105.0,,9102
+16243,9807,8805,1.0,,9201
+16243,9807,8806,43500000.0,,9001
+16243,9807,8807,0.0,,9001
+16244,9807,8801,0.0,,9102
+16244,9807,8802,-99.0,,9102
+16244,9807,8805,1.0,,9201
+16244,9807,8806,44500000.0,,9001
+16244,9807,8807,0.0,,9001
+16245,9807,8801,0.0,,9102
+16245,9807,8802,-93.0,,9102
+16245,9807,8805,1.0,,9201
+16245,9807,8806,45500000.0,,9001
+16245,9807,8807,0.0,,9001
+16246,9807,8801,0.0,,9102
+16246,9807,8802,-87.0,,9102
+16246,9807,8805,1.0,,9201
+16246,9807,8806,46500000.0,,9001
+16246,9807,8807,0.0,,9001
+16247,9807,8801,0.0,,9102
+16247,9807,8802,-81.0,,9102
+16247,9807,8805,1.0,,9201
+16247,9807,8806,47500000.0,,9001
+16247,9807,8807,0.0,,9001
+16248,9807,8801,0.0,,9102
+16248,9807,8802,-75.0,,9102
+16248,9807,8805,1.0,,9201
+16248,9807,8806,48500000.0,,9001
+16248,9807,8807,0.0,,9001
+16249,9807,8801,0.0,,9102
+16249,9807,8802,-69.0,,9102
+16249,9807,8805,1.0,,9201
+16249,9807,8806,49500000.0,,9001
+16249,9807,8807,0.0,,9001
+16250,9807,8801,0.0,,9102
+16250,9807,8802,-63.0,,9102
+16250,9807,8805,1.0,,9201
+16250,9807,8806,50500000.0,,9001
+16250,9807,8807,0.0,,9001
+16251,9807,8801,0.0,,9102
+16251,9807,8802,-57.0,,9102
+16251,9807,8805,1.0,,9201
+16251,9807,8806,51500000.0,,9001
+16251,9807,8807,0.0,,9001
+16252,9807,8801,0.0,,9102
+16252,9807,8802,-51.0,,9102
+16252,9807,8805,1.0,,9201
+16252,9807,8806,52500000.0,,9001
+16252,9807,8807,0.0,,9001
+16253,9807,8801,0.0,,9102
+16253,9807,8802,-45.0,,9102
+16253,9807,8805,1.0,,9201
+16253,9807,8806,53500000.0,,9001
+16253,9807,8807,0.0,,9001
+16254,9807,8801,0.0,,9102
+16254,9807,8802,-39.0,,9102
+16254,9807,8805,1.0,,9201
+16254,9807,8806,54500000.0,,9001
+16254,9807,8807,0.0,,9001
+16255,9807,8801,0.0,,9102
+16255,9807,8802,-33.0,,9102
+16255,9807,8805,1.0,,9201
+16255,9807,8806,55500000.0,,9001
+16255,9807,8807,0.0,,9001
+16256,9807,8801,0.0,,9102
+16256,9807,8802,-27.0,,9102
+16256,9807,8805,1.0,,9201
+16256,9807,8806,56500000.0,,9001
+16256,9807,8807,0.0,,9001
+16257,9807,8801,0.0,,9102
+16257,9807,8802,-21.0,,9102
+16257,9807,8805,1.0,,9201
+16257,9807,8806,57500000.0,,9001
+16257,9807,8807,0.0,,9001
+16258,9807,8801,0.0,,9102
+16258,9807,8802,-15.0,,9102
+16258,9807,8805,1.0,,9201
+16258,9807,8806,58500000.0,,9001
+16258,9807,8807,0.0,,9001
+16259,9807,8801,0.0,,9102
+16259,9807,8802,-9.0,,9102
+16259,9807,8805,1.0,,9201
+16259,9807,8806,59500000.0,,9001
+16259,9807,8807,0.0,,9001
+16260,9807,8801,0.0,,9102
+16260,9807,8802,-3.0,,9102
+16260,9807,8805,1.0,,9201
+16260,9807,8806,60500000.0,,9001
+16260,9807,8807,0.0,,9001
+16261,9807,8801,0.0,,9102
+16261,9807,8802,3.0,,9102
+16261,9807,8805,1.0,,9201
+16261,9807,8806,1500000.0,,9001
+16261,9807,8807,0.0,,9001
+16262,9807,8801,0.0,,9102
+16262,9807,8802,6.0,,9102
+16262,9807,8805,1.0,,9201
+16262,9807,8806,2500000.0,,9001
+16262,9807,8807,0.0,,9001
+16263,9807,8801,0.0,,9102
+16263,9807,8802,9.0,,9102
+16263,9807,8805,1.0,,9201
+16263,9807,8806,3500000.0,,9001
+16263,9807,8807,0.0,,9001
+16264,9807,8801,0.0,,9102
+16264,9807,8802,12.0,,9102
+16264,9807,8805,1.0,,9201
+16264,9807,8806,4500000.0,,9001
+16264,9807,8807,0.0,,9001
+16265,9807,8801,0.0,,9102
+16265,9807,8802,15.0,,9102
+16265,9807,8805,1.0,,9201
+16265,9807,8806,5500000.0,,9001
+16265,9807,8807,0.0,,9001
+16266,9807,8801,0.0,,9102
+16266,9807,8802,18.0,,9102
+16266,9807,8805,1.0,,9201
+16266,9807,8806,6500000.0,,9001
+16266,9807,8807,0.0,,9001
+16267,9807,8801,0.0,,9102
+16267,9807,8802,21.0,,9102
+16267,9807,8805,1.0,,9201
+16267,9807,8806,7500000.0,,9001
+16267,9807,8807,0.0,,9001
+16268,9807,8801,0.0,,9102
+16268,9807,8802,24.0,,9102
+16268,9807,8805,1.0,,9201
+16268,9807,8806,8500000.0,,9001
+16268,9807,8807,0.0,,9001
+16269,9807,8801,0.0,,9102
+16269,9807,8802,27.0,,9102
+16269,9807,8805,1.0,,9201
+16269,9807,8806,9500000.0,,9001
+16269,9807,8807,0.0,,9001
+16270,9807,8801,0.0,,9102
+16270,9807,8802,30.0,,9102
+16270,9807,8805,1.0,,9201
+16270,9807,8806,10500000.0,,9001
+16270,9807,8807,0.0,,9001
+16271,9807,8801,0.0,,9102
+16271,9807,8802,33.0,,9102
+16271,9807,8805,1.0,,9201
+16271,9807,8806,11500000.0,,9001
+16271,9807,8807,0.0,,9001
+16272,9807,8801,0.0,,9102
+16272,9807,8802,36.0,,9102
+16272,9807,8805,1.0,,9201
+16272,9807,8806,12500000.0,,9001
+16272,9807,8807,0.0,,9001
+16273,9807,8801,0.0,,9102
+16273,9807,8802,39.0,,9102
+16273,9807,8805,1.0,,9201
+16273,9807,8806,13500000.0,,9001
+16273,9807,8807,0.0,,9001
+16274,9807,8801,0.0,,9102
+16274,9807,8802,42.0,,9102
+16274,9807,8805,1.0,,9201
+16274,9807,8806,14500000.0,,9001
+16274,9807,8807,0.0,,9001
+16275,9807,8801,0.0,,9102
+16275,9807,8802,45.0,,9102
+16275,9807,8805,1.0,,9201
+16275,9807,8806,15500000.0,,9001
+16275,9807,8807,0.0,,9001
+16276,9807,8801,0.0,,9102
+16276,9807,8802,48.0,,9102
+16276,9807,8805,1.0,,9201
+16276,9807,8806,16500000.0,,9001
+16276,9807,8807,0.0,,9001
+16277,9807,8801,0.0,,9102
+16277,9807,8802,51.0,,9102
+16277,9807,8805,1.0,,9201
+16277,9807,8806,17500000.0,,9001
+16277,9807,8807,0.0,,9001
+16278,9807,8801,0.0,,9102
+16278,9807,8802,54.0,,9102
+16278,9807,8805,1.0,,9201
+16278,9807,8806,18500000.0,,9001
+16278,9807,8807,0.0,,9001
+16279,9807,8801,0.0,,9102
+16279,9807,8802,57.0,,9102
+16279,9807,8805,1.0,,9201
+16279,9807,8806,19500000.0,,9001
+16279,9807,8807,0.0,,9001
+16280,9807,8801,0.0,,9102
+16280,9807,8802,60.0,,9102
+16280,9807,8805,1.0,,9201
+16280,9807,8806,20500000.0,,9001
+16280,9807,8807,0.0,,9001
+16281,9807,8801,0.0,,9102
+16281,9807,8802,63.0,,9102
+16281,9807,8805,1.0,,9201
+16281,9807,8806,21500000.0,,9001
+16281,9807,8807,0.0,,9001
+16282,9807,8801,0.0,,9102
+16282,9807,8802,66.0,,9102
+16282,9807,8805,1.0,,9201
+16282,9807,8806,22500000.0,,9001
+16282,9807,8807,0.0,,9001
+16283,9807,8801,0.0,,9102
+16283,9807,8802,69.0,,9102
+16283,9807,8805,1.0,,9201
+16283,9807,8806,23500000.0,,9001
+16283,9807,8807,0.0,,9001
+16284,9807,8801,0.0,,9102
+16284,9807,8802,72.0,,9102
+16284,9807,8805,1.0,,9201
+16284,9807,8806,24500000.0,,9001
+16284,9807,8807,0.0,,9001
+16285,9807,8801,0.0,,9102
+16285,9807,8802,75.0,,9102
+16285,9807,8805,1.0,,9201
+16285,9807,8806,25500000.0,,9001
+16285,9807,8807,0.0,,9001
+16286,9807,8801,0.0,,9102
+16286,9807,8802,78.0,,9102
+16286,9807,8805,1.0,,9201
+16286,9807,8806,26500000.0,,9001
+16286,9807,8807,0.0,,9001
+16287,9807,8801,0.0,,9102
+16287,9807,8802,81.0,,9102
+16287,9807,8805,1.0,,9201
+16287,9807,8806,27500000.0,,9001
+16287,9807,8807,0.0,,9001
+16288,9807,8801,0.0,,9102
+16288,9807,8802,84.0,,9102
+16288,9807,8805,1.0,,9201
+16288,9807,8806,28500000.0,,9001
+16288,9807,8807,0.0,,9001
+16289,9807,8801,0.0,,9102
+16289,9807,8802,87.0,,9102
+16289,9807,8805,1.0,,9201
+16289,9807,8806,29500000.0,,9001
+16289,9807,8807,0.0,,9001
+16290,9807,8801,0.0,,9102
+16290,9807,8802,90.0,,9102
+16290,9807,8805,1.0,,9201
+16290,9807,8806,30500000.0,,9001
+16290,9807,8807,0.0,,9001
+16291,9807,8801,0.0,,9102
+16291,9807,8802,93.0,,9102
+16291,9807,8805,1.0,,9201
+16291,9807,8806,31500000.0,,9001
+16291,9807,8807,0.0,,9001
+16292,9807,8801,0.0,,9102
+16292,9807,8802,96.0,,9102
+16292,9807,8805,1.0,,9201
+16292,9807,8806,32500000.0,,9001
+16292,9807,8807,0.0,,9001
+16293,9807,8801,0.0,,9102
+16293,9807,8802,99.0,,9102
+16293,9807,8805,1.0,,9201
+16293,9807,8806,33500000.0,,9001
+16293,9807,8807,0.0,,9001
+16294,9807,8801,0.0,,9102
+16294,9807,8802,102.0,,9102
+16294,9807,8805,1.0,,9201
+16294,9807,8806,34500000.0,,9001
+16294,9807,8807,0.0,,9001
+16295,9807,8801,0.0,,9102
+16295,9807,8802,105.0,,9102
+16295,9807,8805,1.0,,9201
+16295,9807,8806,35500000.0,,9001
+16295,9807,8807,0.0,,9001
+16296,9807,8801,0.0,,9102
+16296,9807,8802,108.0,,9102
+16296,9807,8805,1.0,,9201
+16296,9807,8806,36500000.0,,9001
+16296,9807,8807,0.0,,9001
+16297,9807,8801,0.0,,9102
+16297,9807,8802,111.0,,9102
+16297,9807,8805,1.0,,9201
+16297,9807,8806,37500000.0,,9001
+16297,9807,8807,0.0,,9001
+16298,9807,8801,0.0,,9102
+16298,9807,8802,114.0,,9102
+16298,9807,8805,1.0,,9201
+16298,9807,8806,38500000.0,,9001
+16298,9807,8807,0.0,,9001
+16299,9807,8801,0.0,,9102
+16299,9807,8802,117.0,,9102
+16299,9807,8805,1.0,,9201
+16299,9807,8806,39500000.0,,9001
+16299,9807,8807,0.0,,9001
+16301,9807,8801,0.0,,9102
+16301,9807,8802,3.0,,9102
+16301,9807,8805,1.0,,9201
+16301,9807,8806,500000.0,,9001
+16301,9807,8807,0.0,,9001
+16302,9807,8801,0.0,,9102
+16302,9807,8802,9.0,,9102
+16302,9807,8805,1.0,,9201
+16302,9807,8806,500000.0,,9001
+16302,9807,8807,0.0,,9001
+16303,9807,8801,0.0,,9102
+16303,9807,8802,15.0,,9102
+16303,9807,8805,1.0,,9201
+16303,9807,8806,500000.0,,9001
+16303,9807,8807,0.0,,9001
+16304,9807,8801,0.0,,9102
+16304,9807,8802,21.0,,9102
+16304,9807,8805,1.0,,9201
+16304,9807,8806,500000.0,,9001
+16304,9807,8807,0.0,,9001
+16305,9807,8801,0.0,,9102
+16305,9807,8802,27.0,,9102
+16305,9807,8805,1.0,,9201
+16305,9807,8806,500000.0,,9001
+16305,9807,8807,0.0,,9001
+16306,9807,8801,0.0,,9102
+16306,9807,8802,33.0,,9102
+16306,9807,8805,1.0,,9201
+16306,9807,8806,500000.0,,9001
+16306,9807,8807,0.0,,9001
+16307,9807,8801,0.0,,9102
+16307,9807,8802,39.0,,9102
+16307,9807,8805,1.0,,9201
+16307,9807,8806,500000.0,,9001
+16307,9807,8807,0.0,,9001
+16308,9807,8801,0.0,,9102
+16308,9807,8802,45.0,,9102
+16308,9807,8805,1.0,,9201
+16308,9807,8806,500000.0,,9001
+16308,9807,8807,0.0,,9001
+16309,9807,8801,0.0,,9102
+16309,9807,8802,51.0,,9102
+16309,9807,8805,1.0,,9201
+16309,9807,8806,500000.0,,9001
+16309,9807,8807,0.0,,9001
+16310,9807,8801,0.0,,9102
+16310,9807,8802,57.0,,9102
+16310,9807,8805,1.0,,9201
+16310,9807,8806,500000.0,,9001
+16310,9807,8807,0.0,,9001
+16311,9807,8801,0.0,,9102
+16311,9807,8802,63.0,,9102
+16311,9807,8805,1.0,,9201
+16311,9807,8806,500000.0,,9001
+16311,9807,8807,0.0,,9001
+16312,9807,8801,0.0,,9102
+16312,9807,8802,69.0,,9102
+16312,9807,8805,1.0,,9201
+16312,9807,8806,500000.0,,9001
+16312,9807,8807,0.0,,9001
+16313,9807,8801,0.0,,9102
+16313,9807,8802,75.0,,9102
+16313,9807,8805,1.0,,9201
+16313,9807,8806,500000.0,,9001
+16313,9807,8807,0.0,,9001
+16314,9807,8801,0.0,,9102
+16314,9807,8802,81.0,,9102
+16314,9807,8805,1.0,,9201
+16314,9807,8806,500000.0,,9001
+16314,9807,8807,0.0,,9001
+16315,9807,8801,0.0,,9102
+16315,9807,8802,87.0,,9102
+16315,9807,8805,1.0,,9201
+16315,9807,8806,500000.0,,9001
+16315,9807,8807,0.0,,9001
+16316,9807,8801,0.0,,9102
+16316,9807,8802,93.0,,9102
+16316,9807,8805,1.0,,9201
+16316,9807,8806,500000.0,,9001
+16316,9807,8807,0.0,,9001
+16317,9807,8801,0.0,,9102
+16317,9807,8802,99.0,,9102
+16317,9807,8805,1.0,,9201
+16317,9807,8806,500000.0,,9001
+16317,9807,8807,0.0,,9001
+16318,9807,8801,0.0,,9102
+16318,9807,8802,105.0,,9102
+16318,9807,8805,1.0,,9201
+16318,9807,8806,500000.0,,9001
+16318,9807,8807,0.0,,9001
+16319,9807,8801,0.0,,9102
+16319,9807,8802,111.0,,9102
+16319,9807,8805,1.0,,9201
+16319,9807,8806,500000.0,,9001
+16319,9807,8807,0.0,,9001
+16320,9807,8801,0.0,,9102
+16320,9807,8802,117.0,,9102
+16320,9807,8805,1.0,,9201
+16320,9807,8806,500000.0,,9001
+16320,9807,8807,0.0,,9001
+16321,9807,8801,0.0,,9102
+16321,9807,8802,123.0,,9102
+16321,9807,8805,1.0,,9201
+16321,9807,8806,500000.0,,9001
+16321,9807,8807,0.0,,9001
+16322,9807,8801,0.0,,9102
+16322,9807,8802,129.0,,9102
+16322,9807,8805,1.0,,9201
+16322,9807,8806,500000.0,,9001
+16322,9807,8807,0.0,,9001
+16323,9807,8801,0.0,,9102
+16323,9807,8802,135.0,,9102
+16323,9807,8805,1.0,,9201
+16323,9807,8806,500000.0,,9001
+16323,9807,8807,0.0,,9001
+16324,9807,8801,0.0,,9102
+16324,9807,8802,141.0,,9102
+16324,9807,8805,1.0,,9201
+16324,9807,8806,500000.0,,9001
+16324,9807,8807,0.0,,9001
+16325,9807,8801,0.0,,9102
+16325,9807,8802,147.0,,9102
+16325,9807,8805,1.0,,9201
+16325,9807,8806,500000.0,,9001
+16325,9807,8807,0.0,,9001
+16326,9807,8801,0.0,,9102
+16326,9807,8802,153.0,,9102
+16326,9807,8805,1.0,,9201
+16326,9807,8806,500000.0,,9001
+16326,9807,8807,0.0,,9001
+16327,9807,8801,0.0,,9102
+16327,9807,8802,159.0,,9102
+16327,9807,8805,1.0,,9201
+16327,9807,8806,500000.0,,9001
+16327,9807,8807,0.0,,9001
+16328,9807,8801,0.0,,9102
+16328,9807,8802,165.0,,9102
+16328,9807,8805,1.0,,9201
+16328,9807,8806,500000.0,,9001
+16328,9807,8807,0.0,,9001
+16329,9807,8801,0.0,,9102
+16329,9807,8802,171.0,,9102
+16329,9807,8805,1.0,,9201
+16329,9807,8806,500000.0,,9001
+16329,9807,8807,0.0,,9001
+16330,9807,8801,0.0,,9102
+16330,9807,8802,177.0,,9102
+16330,9807,8805,1.0,,9201
+16330,9807,8806,500000.0,,9001
+16330,9807,8807,0.0,,9001
+16331,9807,8801,0.0,,9102
+16331,9807,8802,-177.0,,9102
+16331,9807,8805,1.0,,9201
+16331,9807,8806,500000.0,,9001
+16331,9807,8807,0.0,,9001
+16332,9807,8801,0.0,,9102
+16332,9807,8802,-171.0,,9102
+16332,9807,8805,1.0,,9201
+16332,9807,8806,500000.0,,9001
+16332,9807,8807,0.0,,9001
+16333,9807,8801,0.0,,9102
+16333,9807,8802,-165.0,,9102
+16333,9807,8805,1.0,,9201
+16333,9807,8806,500000.0,,9001
+16333,9807,8807,0.0,,9001
+16334,9807,8801,0.0,,9102
+16334,9807,8802,-159.0,,9102
+16334,9807,8805,1.0,,9201
+16334,9807,8806,500000.0,,9001
+16334,9807,8807,0.0,,9001
+16335,9807,8801,0.0,,9102
+16335,9807,8802,-153.0,,9102
+16335,9807,8805,1.0,,9201
+16335,9807,8806,500000.0,,9001
+16335,9807,8807,0.0,,9001
+16336,9807,8801,0.0,,9102
+16336,9807,8802,-147.0,,9102
+16336,9807,8805,1.0,,9201
+16336,9807,8806,500000.0,,9001
+16336,9807,8807,0.0,,9001
+16337,9807,8801,0.0,,9102
+16337,9807,8802,-141.0,,9102
+16337,9807,8805,1.0,,9201
+16337,9807,8806,500000.0,,9001
+16337,9807,8807,0.0,,9001
+16338,9807,8801,0.0,,9102
+16338,9807,8802,-135.0,,9102
+16338,9807,8805,1.0,,9201
+16338,9807,8806,500000.0,,9001
+16338,9807,8807,0.0,,9001
+16339,9807,8801,0.0,,9102
+16339,9807,8802,-129.0,,9102
+16339,9807,8805,1.0,,9201
+16339,9807,8806,500000.0,,9001
+16339,9807,8807,0.0,,9001
+16340,9807,8801,0.0,,9102
+16340,9807,8802,-123.0,,9102
+16340,9807,8805,1.0,,9201
+16340,9807,8806,500000.0,,9001
+16340,9807,8807,0.0,,9001
+16341,9807,8801,0.0,,9102
+16341,9807,8802,-117.0,,9102
+16341,9807,8805,1.0,,9201
+16341,9807,8806,500000.0,,9001
+16341,9807,8807,0.0,,9001
+16342,9807,8801,0.0,,9102
+16342,9807,8802,-111.0,,9102
+16342,9807,8805,1.0,,9201
+16342,9807,8806,500000.0,,9001
+16342,9807,8807,0.0,,9001
+16343,9807,8801,0.0,,9102
+16343,9807,8802,-105.0,,9102
+16343,9807,8805,1.0,,9201
+16343,9807,8806,500000.0,,9001
+16343,9807,8807,0.0,,9001
+16344,9807,8801,0.0,,9102
+16344,9807,8802,-99.0,,9102
+16344,9807,8805,1.0,,9201
+16344,9807,8806,500000.0,,9001
+16344,9807,8807,0.0,,9001
+16345,9807,8801,0.0,,9102
+16345,9807,8802,-93.0,,9102
+16345,9807,8805,1.0,,9201
+16345,9807,8806,500000.0,,9001
+16345,9807,8807,0.0,,9001
+16346,9807,8801,0.0,,9102
+16346,9807,8802,-87.0,,9102
+16346,9807,8805,1.0,,9201
+16346,9807,8806,500000.0,,9001
+16346,9807,8807,0.0,,9001
+16347,9807,8801,0.0,,9102
+16347,9807,8802,-81.0,,9102
+16347,9807,8805,1.0,,9201
+16347,9807,8806,500000.0,,9001
+16347,9807,8807,0.0,,9001
+16348,9807,8801,0.0,,9102
+16348,9807,8802,-75.0,,9102
+16348,9807,8805,1.0,,9201
+16348,9807,8806,500000.0,,9001
+16348,9807,8807,0.0,,9001
+16349,9807,8801,0.0,,9102
+16349,9807,8802,-69.0,,9102
+16349,9807,8805,1.0,,9201
+16349,9807,8806,500000.0,,9001
+16349,9807,8807,0.0,,9001
+16350,9807,8801,0.0,,9102
+16350,9807,8802,-63.0,,9102
+16350,9807,8805,1.0,,9201
+16350,9807,8806,500000.0,,9001
+16350,9807,8807,0.0,,9001
+16351,9807,8801,0.0,,9102
+16351,9807,8802,-57.0,,9102
+16351,9807,8805,1.0,,9201
+16351,9807,8806,500000.0,,9001
+16351,9807,8807,0.0,,9001
+16352,9807,8801,0.0,,9102
+16352,9807,8802,-51.0,,9102
+16352,9807,8805,1.0,,9201
+16352,9807,8806,500000.0,,9001
+16352,9807,8807,0.0,,9001
+16353,9807,8801,0.0,,9102
+16353,9807,8802,-45.0,,9102
+16353,9807,8805,1.0,,9201
+16353,9807,8806,500000.0,,9001
+16353,9807,8807,0.0,,9001
+16354,9807,8801,0.0,,9102
+16354,9807,8802,-39.0,,9102
+16354,9807,8805,1.0,,9201
+16354,9807,8806,500000.0,,9001
+16354,9807,8807,0.0,,9001
+16355,9807,8801,0.0,,9102
+16355,9807,8802,-33.0,,9102
+16355,9807,8805,1.0,,9201
+16355,9807,8806,500000.0,,9001
+16355,9807,8807,0.0,,9001
+16356,9807,8801,0.0,,9102
+16356,9807,8802,-27.0,,9102
+16356,9807,8805,1.0,,9201
+16356,9807,8806,500000.0,,9001
+16356,9807,8807,0.0,,9001
+16357,9807,8801,0.0,,9102
+16357,9807,8802,-21.0,,9102
+16357,9807,8805,1.0,,9201
+16357,9807,8806,500000.0,,9001
+16357,9807,8807,0.0,,9001
+16358,9807,8801,0.0,,9102
+16358,9807,8802,-15.0,,9102
+16358,9807,8805,1.0,,9201
+16358,9807,8806,500000.0,,9001
+16358,9807,8807,0.0,,9001
+16359,9807,8801,0.0,,9102
+16359,9807,8802,-9.0,,9102
+16359,9807,8805,1.0,,9201
+16359,9807,8806,500000.0,,9001
+16359,9807,8807,0.0,,9001
+16360,9807,8801,0.0,,9102
+16360,9807,8802,-3.0,,9102
+16360,9807,8805,1.0,,9201
+16360,9807,8806,500000.0,,9001
+16360,9807,8807,0.0,,9001
+16361,9807,8801,0.0,,9102
+16361,9807,8802,3.0,,9102
+16361,9807,8805,1.0,,9201
+16361,9807,8806,500000.0,,9001
+16361,9807,8807,0.0,,9001
+16362,9807,8801,0.0,,9102
+16362,9807,8802,6.0,,9102
+16362,9807,8805,1.0,,9201
+16362,9807,8806,500000.0,,9001
+16362,9807,8807,0.0,,9001
+16363,9807,8801,0.0,,9102
+16363,9807,8802,9.0,,9102
+16363,9807,8805,1.0,,9201
+16363,9807,8806,500000.0,,9001
+16363,9807,8807,0.0,,9001
+16364,9807,8801,0.0,,9102
+16364,9807,8802,12.0,,9102
+16364,9807,8805,1.0,,9201
+16364,9807,8806,500000.0,,9001
+16364,9807,8807,0.0,,9001
+16365,9807,8801,0.0,,9102
+16365,9807,8802,15.0,,9102
+16365,9807,8805,1.0,,9201
+16365,9807,8806,500000.0,,9001
+16365,9807,8807,0.0,,9001
+16366,9807,8801,0.0,,9102
+16366,9807,8802,18.0,,9102
+16366,9807,8805,1.0,,9201
+16366,9807,8806,500000.0,,9001
+16366,9807,8807,0.0,,9001
+16367,9807,8801,0.0,,9102
+16367,9807,8802,21.0,,9102
+16367,9807,8805,1.0,,9201
+16367,9807,8806,500000.0,,9001
+16367,9807,8807,0.0,,9001
+16368,9807,8801,0.0,,9102
+16368,9807,8802,24.0,,9102
+16368,9807,8805,1.0,,9201
+16368,9807,8806,500000.0,,9001
+16368,9807,8807,0.0,,9001
+16369,9807,8801,0.0,,9102
+16369,9807,8802,27.0,,9102
+16369,9807,8805,1.0,,9201
+16369,9807,8806,500000.0,,9001
+16369,9807,8807,0.0,,9001
+16370,9807,8801,0.0,,9102
+16370,9807,8802,30.0,,9102
+16370,9807,8805,1.0,,9201
+16370,9807,8806,500000.0,,9001
+16370,9807,8807,0.0,,9001
+16371,9807,8801,0.0,,9102
+16371,9807,8802,33.0,,9102
+16371,9807,8805,1.0,,9201
+16371,9807,8806,500000.0,,9001
+16371,9807,8807,0.0,,9001
+16372,9807,8801,0.0,,9102
+16372,9807,8802,36.0,,9102
+16372,9807,8805,1.0,,9201
+16372,9807,8806,500000.0,,9001
+16372,9807,8807,0.0,,9001
+16373,9807,8801,0.0,,9102
+16373,9807,8802,39.0,,9102
+16373,9807,8805,1.0,,9201
+16373,9807,8806,500000.0,,9001
+16373,9807,8807,0.0,,9001
+16374,9807,8801,0.0,,9102
+16374,9807,8802,42.0,,9102
+16374,9807,8805,1.0,,9201
+16374,9807,8806,500000.0,,9001
+16374,9807,8807,0.0,,9001
+16375,9807,8801,0.0,,9102
+16375,9807,8802,45.0,,9102
+16375,9807,8805,1.0,,9201
+16375,9807,8806,500000.0,,9001
+16375,9807,8807,0.0,,9001
+16376,9807,8801,0.0,,9102
+16376,9807,8802,48.0,,9102
+16376,9807,8805,1.0,,9001
+16376,9807,8806,500000.0,,9001
+16376,9807,8807,0.0,,9201
+16377,9807,8801,0.0,,9102
+16377,9807,8802,51.0,,9102
+16377,9807,8805,1.0,,9201
+16377,9807,8806,500000.0,,9001
+16377,9807,8807,0.0,,9001
+16378,9807,8801,0.0,,9102
+16378,9807,8802,54.0,,9102
+16378,9807,8805,1.0,,9201
+16378,9807,8806,500000.0,,9001
+16378,9807,8807,0.0,,9001
+16379,9807,8801,0.0,,9102
+16379,9807,8802,57.0,,9102
+16379,9807,8805,1.0,,9201
+16379,9807,8806,500000.0,,9001
+16379,9807,8807,0.0,,9001
+16380,9807,8801,0.0,,9102
+16380,9807,8802,60.0,,9102
+16380,9807,8805,1.0,,9201
+16380,9807,8806,500000.0,,9001
+16380,9807,8807,0.0,,9001
+16381,9807,8801,0.0,,9102
+16381,9807,8802,63.0,,9102
+16381,9807,8805,1.0,,9201
+16381,9807,8806,500000.0,,9001
+16381,9807,8807,0.0,,9001
+16382,9807,8801,0.0,,9102
+16382,9807,8802,66.0,,9102
+16382,9807,8805,1.0,,9201
+16382,9807,8806,500000.0,,9001
+16382,9807,8807,0.0,,9001
+16383,9807,8801,0.0,,9102
+16383,9807,8802,69.0,,9102
+16383,9807,8805,1.0,,9201
+16383,9807,8806,500000.0,,9001
+16383,9807,8807,0.0,,9001
+16384,9807,8801,0.0,,9102
+16384,9807,8802,72.0,,9102
+16384,9807,8805,1.0,,9201
+16384,9807,8806,500000.0,,9001
+16384,9807,8807,0.0,,9001
+16385,9807,8801,0.0,,9102
+16385,9807,8802,75.0,,9102
+16385,9807,8805,1.0,,9201
+16385,9807,8806,500000.0,,9001
+16385,9807,8807,0.0,,9001
+16386,9807,8801,0.0,,9102
+16386,9807,8802,78.0,,9102
+16386,9807,8805,1.0,,9201
+16386,9807,8806,500000.0,,9001
+16386,9807,8807,0.0,,9001
+16387,9807,8801,0.0,,9102
+16387,9807,8802,81.0,,9102
+16387,9807,8805,1.0,,9201
+16387,9807,8806,500000.0,,9001
+16387,9807,8807,0.0,,9001
+16388,9807,8801,0.0,,9102
+16388,9807,8802,84.0,,9102
+16388,9807,8805,1.0,,9201
+16388,9807,8806,500000.0,,9001
+16388,9807,8807,0.0,,9001
+16389,9807,8801,0.0,,9102
+16389,9807,8802,87.0,,9102
+16389,9807,8805,1.0,,9201
+16389,9807,8806,500000.0,,9001
+16389,9807,8807,0.0,,9001
+16390,9807,8801,0.0,,9102
+16390,9807,8802,90.0,,9102
+16390,9807,8805,1.0,,9201
+16390,9807,8806,500000.0,,9001
+16390,9807,8807,0.0,,9001
+16391,9807,8801,0.0,,9102
+16391,9807,8802,93.0,,9102
+16391,9807,8805,1.0,,9201
+16391,9807,8806,500000.0,,9001
+16391,9807,8807,0.0,,9001
+16392,9807,8801,0.0,,9102
+16392,9807,8802,96.0,,9102
+16392,9807,8805,1.0,,9201
+16392,9807,8806,500000.0,,9001
+16392,9807,8807,0.0,,9001
+16393,9807,8801,0.0,,9102
+16393,9807,8802,99.0,,9102
+16393,9807,8805,1.0,,9201
+16393,9807,8806,500000.0,,9001
+16393,9807,8807,0.0,,9001
+16394,9807,8801,0.0,,9102
+16394,9807,8802,102.0,,9102
+16394,9807,8805,1.0,,9201
+16394,9807,8806,500000.0,,9001
+16394,9807,8807,0.0,,9001
+16395,9807,8801,0.0,,9102
+16395,9807,8802,105.0,,9102
+16395,9807,8805,1.0,,9201
+16395,9807,8806,500000.0,,9001
+16395,9807,8807,0.0,,9001
+16396,9807,8801,0.0,,9102
+16396,9807,8802,108.0,,9102
+16396,9807,8805,1.0,,9201
+16396,9807,8806,500000.0,,9001
+16396,9807,8807,0.0,,9001
+16397,9807,8801,0.0,,9102
+16397,9807,8802,111.0,,9102
+16397,9807,8805,1.0,,9201
+16397,9807,8806,500000.0,,9001
+16397,9807,8807,0.0,,9001
+16398,9807,8801,0.0,,9102
+16398,9807,8802,114.0,,9102
+16398,9807,8805,1.0,,9201
+16398,9807,8806,500000.0,,9001
+16398,9807,8807,0.0,,9001
+16399,9807,8801,0.0,,9102
+16399,9807,8802,117.0,,9102
+16399,9807,8805,1.0,,9201
+16399,9807,8806,500000.0,,9001
+16399,9807,8807,0.0,,9001
+16400,9807,8801,0.0,,9102
+16400,9807,8802,0.0,,9102
+16400,9807,8805,0.9996,,9201
+16400,9807,8806,500000.0,,9001
+16400,9807,8807,0.0,,9001
+16405,9807,8801,0.0,,9102
+16405,9807,8802,5.0,,9102
+16405,9807,8805,0.9996,,9201
+16405,9807,8806,500000.0,,9001
+16405,9807,8807,0.0,,9001
+16406,9807,8801,0.0,,9102
+16406,9807,8802,6.0,,9102
+16406,9807,8805,0.9996,,9201
+16406,9807,8806,500000.0,,9001
+16406,9807,8807,0.0,,9001
+16411,9807,8801,0.0,,9102
+16411,9807,8802,11.0,,9102
+16411,9807,8805,0.9996,,9201
+16411,9807,8806,500000.0,,9001
+16411,9807,8807,0.0,,9001
+16412,9807,8801,0.0,,9102
+16412,9807,8802,12.0,,9102
+16412,9807,8805,0.9996,,9201
+16412,9807,8806,500000.0,,9001
+16412,9807,8807,0.0,,9001
+16413,9807,8801,0.0,,9102
+16413,9807,8802,13.0,,9102
+16413,9807,8805,0.9996,,9201
+16413,9807,8806,500000.0,,9001
+16413,9807,8807,0.0,,9001
+16430,9807,8801,0.0,,9102
+16430,9807,8802,30.0,,9102
+16430,9807,8805,0.9996,,9201
+16430,9807,8806,500000.0,,9001
+16430,9807,8807,0.0,,9001
+16506,9807,8801,0.0,,9102
+16506,9807,8802,106.0,,9102
+16506,9807,8805,0.9996,,9201
+16506,9807,8806,500000.0,,9001
+16506,9807,8807,0.0,,9001
+16586,9807,8801,0.0,,9102
+16586,9807,8802,106.0,,9102
+16586,9807,8805,1.0,,9201
+16586,9807,8806,500000.0,,9001
+16586,9807,8807,0.0,,9001
+16611,9807,8801,0.0,,9110
+16611,9807,8802,11.3,,9110
+16611,9807,8805,0.9996,,9201
+16611,9807,8806,500000.0,,9001
+16611,9807,8807,10000000.0,,9001
+16612,9807,8801,0.0,,9102
+16612,9807,8802,12.0,,9102
+16612,9807,8805,0.9996,,9201
+16612,9807,8806,500000.0,,9001
+16612,9807,8807,10000000.0,,9001
+16636,9807,8801,0.0,,9102
+16636,9807,8802,36.0,,9102
+16636,9807,8805,0.9996,,9201
+16636,9807,8806,500000.0,,9001
+16636,9807,8807,10000000.0,,9001
+16709,9807,8801,0.0,,9102
+16709,9807,8802,109.0,,9102
+16709,9807,8805,0.9996,,9201
+16709,9807,8806,500000.0,,9001
+16709,9807,8807,10000000.0,,9001
+16716,9807,8801,0.0,,9102
+16716,9807,8802,116.0,,9102
+16716,9807,8805,0.9996,,9201
+16716,9807,8806,500000.0,,9001
+16716,9807,8807,10000000.0,,9001
+16732,9807,8801,0.0,,9102
+16732,9807,8802,132.0,,9102
+16732,9807,8805,0.9996,,9201
+16732,9807,8806,500000.0,,9001
+16732,9807,8807,10000000.0,,9001
+17001,9807,8801,0.0,,9102
+17001,9807,8802,-1.0,,9102
+17001,9807,8805,0.9996,,9201
+17001,9807,8806,500000.0,,9001
+17001,9807,8807,0.0,,9001
+17005,9807,8801,0.0,,9102
+17005,9807,8802,-5.0,,9102
+17005,9807,8805,0.9996,,9201
+17005,9807,8806,500000.0,,9001
+17005,9807,8807,0.0,,9001
+17054,9807,8801,0.0,,9102
+17054,9807,8802,-54.0,,9102
+17054,9807,8805,0.9996,,9201
+17054,9807,8806,500000.0,,9001
+17054,9807,8807,0.0,,9001
+17348,9807,8801,0.0,,9102
+17348,9807,8802,105.0,,9102
+17348,9807,8805,0.9996,,9201
+17348,9807,8806,500000.0,,9001
+17348,9807,8807,10000000.0,,9001
+17349,9807,8801,0.0,,9102
+17349,9807,8802,111.0,,9102
+17349,9807,8805,0.9996,,9201
+17349,9807,8806,500000.0,,9001
+17349,9807,8807,10000000.0,,9001
+17350,9807,8801,0.0,,9102
+17350,9807,8802,117.0,,9102
+17350,9807,8805,0.9996,,9201
+17350,9807,8806,500000.0,,9001
+17350,9807,8807,10000000.0,,9001
+17351,9807,8801,0.0,,9102
+17351,9807,8802,123.0,,9102
+17351,9807,8805,0.9996,,9201
+17351,9807,8806,500000.0,,9001
+17351,9807,8807,10000000.0,,9001
+17352,9807,8801,0.0,,9102
+17352,9807,8802,129.0,,9102
+17352,9807,8805,0.9996,,9201
+17352,9807,8806,500000.0,,9001
+17352,9807,8807,10000000.0,,9001
+17353,9807,8801,0.0,,9102
+17353,9807,8802,135.0,,9102
+17353,9807,8805,0.9996,,9201
+17353,9807,8806,500000.0,,9001
+17353,9807,8807,10000000.0,,9001
+17354,9807,8801,0.0,,9102
+17354,9807,8802,141.0,,9102
+17354,9807,8805,0.9996,,9201
+17354,9807,8806,500000.0,,9001
+17354,9807,8807,10000000.0,,9001
+17355,9807,8801,0.0,,9102
+17355,9807,8802,147.0,,9102
+17355,9807,8805,0.9996,,9201
+17355,9807,8806,500000.0,,9001
+17355,9807,8807,10000000.0,,9001
+17356,9807,8801,0.0,,9102
+17356,9807,8802,153.0,,9102
+17356,9807,8805,0.9996,,9201
+17356,9807,8806,500000.0,,9001
+17356,9807,8807,10000000.0,,9001
+17357,9807,8801,0.0,,9102
+17357,9807,8802,159.0,,9102
+17357,9807,8805,0.9996,,9201
+17357,9807,8806,500000.0,,9001
+17357,9807,8807,10000000.0,,9001
+17358,9807,8801,0.0,,9102
+17358,9807,8802,165.0,,9102
+17358,9807,8805,0.9996,,9201
+17358,9807,8806,500000.0,,9001
+17358,9807,8807,10000000.0,,9001
+17448,9807,8801,0.0,,9102
+17448,9807,8802,105.0,,9102
+17448,9807,8805,0.9996,,9201
+17448,9807,8806,500000.0,,9001
+17448,9807,8807,10000000.0,,9001
+17449,9807,8801,0.0,,9102
+17449,9807,8802,111.0,,9102
+17449,9807,8805,0.9996,,9201
+17449,9807,8806,500000.0,,9001
+17449,9807,8807,10000000.0,,9001
+17450,9807,8801,0.0,,9102
+17450,9807,8802,117.0,,9102
+17450,9807,8805,0.9996,,9201
+17450,9807,8806,500000.0,,9001
+17450,9807,8807,10000000.0,,9001
+17451,9807,8801,0.0,,9102
+17451,9807,8802,123.0,,9102
+17451,9807,8805,0.9996,,9201
+17451,9807,8806,500000.0,,9001
+17451,9807,8807,10000000.0,,9001
+17452,9807,8801,0.0,,9102
+17452,9807,8802,129.0,,9102
+17452,9807,8805,0.9996,,9201
+17452,9807,8806,500000.0,,9001
+17452,9807,8807,10000000.0,,9001
+17453,9807,8801,0.0,,9102
+17453,9807,8802,135.0,,9102
+17453,9807,8805,0.9996,,9201
+17453,9807,8806,500000.0,,9001
+17453,9807,8807,10000000.0,,9001
+17454,9807,8801,0.0,,9102
+17454,9807,8802,141.0,,9102
+17454,9807,8805,0.9996,,9201
+17454,9807,8806,500000.0,,9001
+17454,9807,8807,10000000.0,,9001
+17455,9807,8801,0.0,,9102
+17455,9807,8802,147.0,,9102
+17455,9807,8805,0.9996,,9201
+17455,9807,8806,500000.0,,9001
+17455,9807,8807,10000000.0,,9001
+17456,9807,8801,0.0,,9102
+17456,9807,8802,153.0,,9102
+17456,9807,8805,0.9996,,9201
+17456,9807,8806,500000.0,,9001
+17456,9807,8807,10000000.0,,9001
+17457,9807,8801,0.0,,9102
+17457,9807,8802,159.0,,9102
+17457,9807,8805,0.9996,,9201
+17457,9807,8806,500000.0,,9001
+17457,9807,8807,10000000.0,,9001
+17458,9807,8801,0.0,,9102
+17458,9807,8802,165.0,,9102
+17458,9807,8805,0.9996,,9201
+17458,9807,8806,500000.0,,9001
+17458,9807,8807,10000000.0,,9001
+17515,9808,8801,0.0,,9102
+17515,9808,8802,15.0,,9102
+17515,9808,8805,1.0,,9201
+17515,9808,8806,0.0,,9001
+17515,9808,8807,0.0,,9001
+17517,9808,8801,0.0,,9102
+17517,9808,8802,17.0,,9102
+17517,9808,8805,1.0,,9201
+17517,9808,8806,0.0,,9001
+17517,9808,8807,0.0,,9001
+17519,9808,8801,0.0,,9102
+17519,9808,8802,19.0,,9102
+17519,9808,8805,1.0,,9201
+17519,9808,8806,0.0,,9001
+17519,9808,8807,0.0,,9001
+17521,9808,8801,0.0,,9102
+17521,9808,8802,21.0,,9102
+17521,9808,8805,1.0,,9201
+17521,9808,8806,0.0,,9001
+17521,9808,8807,0.0,,9001
+17523,9808,8801,0.0,,9102
+17523,9808,8802,23.0,,9102
+17523,9808,8805,1.0,,9201
+17523,9808,8806,0.0,,9001
+17523,9808,8807,0.0,,9001
+17525,9808,8801,0.0,,9102
+17525,9808,8802,25.0,,9102
+17525,9808,8805,1.0,,9201
+17525,9808,8806,0.0,,9001
+17525,9808,8807,0.0,,9001
+17527,9808,8801,0.0,,9102
+17527,9808,8802,27.0,,9102
+17527,9808,8805,1.0,,9201
+17527,9808,8806,0.0,,9001
+17527,9808,8807,0.0,,9001
+17529,9808,8801,0.0,,9102
+17529,9808,8802,29.0,,9102
+17529,9808,8805,1.0,,9201
+17529,9808,8806,0.0,,9001
+17529,9808,8807,0.0,,9001
+17531,9808,8801,0.0,,9102
+17531,9808,8802,31.0,,9102
+17531,9808,8805,1.0,,9201
+17531,9808,8806,0.0,,9001
+17531,9808,8807,0.0,,9001
+17533,9808,8801,0.0,,9102
+17533,9808,8802,33.0,,9102
+17533,9808,8805,1.0,,9201
+17533,9808,8806,0.0,,9001
+17533,9808,8807,0.0,,9001
+17611,9808,8801,-22.0,,9102
+17611,9808,8802,11.0,,9102
+17611,9808,8805,1.0,,9201
+17611,9808,8806,0.0,,9031
+17611,9808,8807,0.0,,9031
+17613,9808,8801,-22.0,,9102
+17613,9808,8802,13.0,,9102
+17613,9808,8805,1.0,,9201
+17613,9808,8806,0.0,,9031
+17613,9808,8807,0.0,,9031
+17615,9808,8801,-22.0,,9102
+17615,9808,8802,15.0,,9102
+17615,9808,8805,1.0,,9201
+17615,9808,8806,0.0,,9031
+17615,9808,8807,0.0,,9031
+17617,9808,8801,-22.0,,9102
+17617,9808,8802,17.0,,9102
+17617,9808,8805,1.0,,9201
+17617,9808,8806,0.0,,9031
+17617,9808,8807,0.0,,9031
+17619,9808,8801,-22.0,,9102
+17619,9808,8802,19.0,,9102
+17619,9808,8805,1.0,,9201
+17619,9808,8806,0.0,,9031
+17619,9808,8807,0.0,,9031
+17621,9808,8801,-22.0,,9102
+17621,9808,8802,21.0,,9102
+17621,9808,8805,1.0,,9201
+17621,9808,8806,0.0,,9031
+17621,9808,8807,0.0,,9031
+17623,9808,8801,-22.0,,9102
+17623,9808,8802,23.0,,9102
+17623,9808,8805,1.0,,9201
+17623,9808,8806,0.0,,9031
+17623,9808,8807,0.0,,9031
+17625,9808,8801,-22.0,,9102
+17625,9808,8802,25.0,,9102
+17625,9808,8805,1.0,,9201
+17625,9808,8806,0.0,,9031
+17625,9808,8807,0.0,,9031
+17700,9807,8801,0.0,,9110
+17700,9807,8802,-55.3,,9110
+17700,9807,8805,0.9999,,9201
+17700,9807,8806,304800.0,,9001
+17700,9807,8807,0.0,,9001
+17701,9807,8801,0.0,,9102
+17701,9807,8802,-53.0,,9102
+17701,9807,8805,0.9999,,9201
+17701,9807,8806,304800.0,,9001
+17701,9807,8807,0.0,,9001
+17702,9807,8801,0.0,,9102
+17702,9807,8802,-56.0,,9102
+17702,9807,8805,0.9999,,9201
+17702,9807,8806,304800.0,,9001
+17702,9807,8807,0.0,,9001
+17703,9807,8801,0.0,,9110
+17703,9807,8802,-58.3,,9110
+17703,9807,8805,0.9999,,9201
+17703,9807,8806,304800.0,,9001
+17703,9807,8807,0.0,,9001
+17704,9807,8801,0.0,,9110
+17704,9807,8802,-61.3,,9110
+17704,9807,8805,0.9999,,9201
+17704,9807,8806,304800.0,,9001
+17704,9807,8807,0.0,,9001
+17705,9807,8801,0.0,,9110
+17705,9807,8802,-64.3,,9110
+17705,9807,8805,0.9999,,9201
+17705,9807,8806,304800.0,,9001
+17705,9807,8807,0.0,,9001
+17706,9807,8801,0.0,,9110
+17706,9807,8802,-67.3,,9110
+17706,9807,8805,0.9999,,9201
+17706,9807,8806,304800.0,,9001
+17706,9807,8807,0.0,,9001
+17707,9807,8801,0.0,,9110
+17707,9807,8802,-70.3,,9110
+17707,9807,8805,0.9999,,9201
+17707,9807,8806,304800.0,,9001
+17707,9807,8807,0.0,,9001
+17708,9807,8801,0.0,,9110
+17708,9807,8802,-73.3,,9110
+17708,9807,8805,0.9999,,9201
+17708,9807,8806,304800.0,,9001
+17708,9807,8807,0.0,,9001
+17709,9807,8801,0.0,,9110
+17709,9807,8802,-76.3,,9110
+17709,9807,8805,0.9999,,9201
+17709,9807,8806,304800.0,,9001
+17709,9807,8807,0.0,,9001
+17710,9807,8801,0.0,,9110
+17710,9807,8802,-79.3,,9110
+17710,9807,8805,0.9999,,9201
+17710,9807,8806,304800.0,,9001
+17710,9807,8807,0.0,,9001
+17711,9807,8801,0.0,,9110
+17711,9807,8802,-82.3,,9110
+17711,9807,8805,0.9999,,9201
+17711,9807,8806,304800.0,,9001
+17711,9807,8807,0.0,,9001
+17712,9807,8801,0.0,,9102
+17712,9807,8802,-81.0,,9102
+17712,9807,8805,0.9999,,9201
+17712,9807,8806,304800.0,,9001
+17712,9807,8807,0.0,,9001
+17713,9807,8801,0.0,,9102
+17713,9807,8802,-84.0,,9102
+17713,9807,8805,0.9999,,9201
+17713,9807,8806,304800.0,,9001
+17713,9807,8807,0.0,,9001
+17714,9807,8801,0.0,,9102
+17714,9807,8802,-87.0,,9102
+17714,9807,8805,0.9999,,9201
+17714,9807,8806,304800.0,,9001
+17714,9807,8807,0.0,,9001
+17715,9807,8801,0.0,,9102
+17715,9807,8802,-90.0,,9102
+17715,9807,8805,0.9999,,9201
+17715,9807,8806,304800.0,,9001
+17715,9807,8807,0.0,,9001
+17716,9807,8801,0.0,,9102
+17716,9807,8802,-93.0,,9102
+17716,9807,8805,0.9999,,9201
+17716,9807,8806,304800.0,,9001
+17716,9807,8807,0.0,,9001
+17717,9807,8801,0.0,,9102
+17717,9807,8802,-96.0,,9102
+17717,9807,8805,0.9999,,9201
+17717,9807,8806,304800.0,,9001
+17717,9807,8807,0.0,,9001
+17794,9807,8801,0.0,,9110
+17794,9807,8802,-61.3,,9110
+17794,9807,8805,0.9999,,9201
+17794,9807,8806,4500000.0,,9001
+17794,9807,8807,0.0,,9001
+17795,9807,8801,0.0,,9110
+17795,9807,8802,-64.3,,9110
+17795,9807,8805,0.9999,,9201
+17795,9807,8806,5500000.0,,9001
+17795,9807,8807,0.0,,9001
+17801,9807,8801,33.0,,9110
+17801,9807,8802,129.3,,9110
+17801,9807,8805,0.9999,,9201
+17801,9807,8806,0.0,,9001
+17801,9807,8807,0.0,,9001
+17802,9807,8801,33.0,,9110
+17802,9807,8802,131.0,,9110
+17802,9807,8805,0.9999,,9201
+17802,9807,8806,0.0,,9001
+17802,9807,8807,0.0,,9001
+17803,9807,8801,36.0,,9110
+17803,9807,8802,132.1,,9110
+17803,9807,8805,0.9999,,9201
+17803,9807,8806,0.0,,9001
+17803,9807,8807,0.0,,9001
+17804,9807,8801,33.0,,9110
+17804,9807,8802,133.3,,9110
+17804,9807,8805,0.9999,,9201
+17804,9807,8806,0.0,,9001
+17804,9807,8807,0.0,,9001
+17805,9807,8801,36.0,,9110
+17805,9807,8802,134.2,,9110
+17805,9807,8805,0.9999,,9201
+17805,9807,8806,0.0,,9001
+17805,9807,8807,0.0,,9001
+17806,9807,8801,36.0,,9110
+17806,9807,8802,136.0,,9110
+17806,9807,8805,0.9999,,9201
+17806,9807,8806,0.0,,9001
+17806,9807,8807,0.0,,9001
+17807,9807,8801,36.0,,9110
+17807,9807,8802,137.1,,9110
+17807,9807,8805,0.9999,,9201
+17807,9807,8806,0.0,,9001
+17807,9807,8807,0.0,,9001
+17808,9807,8801,36.0,,9110
+17808,9807,8802,138.3,,9110
+17808,9807,8805,0.9999,,9201
+17808,9807,8806,0.0,,9001
+17808,9807,8807,0.0,,9001
+17809,9807,8801,36.0,,9110
+17809,9807,8802,139.5,,9110
+17809,9807,8805,0.9999,,9201
+17809,9807,8806,0.0,,9001
+17809,9807,8807,0.0,,9001
+17810,9807,8801,40.0,,9110
+17810,9807,8802,140.5,,9110
+17810,9807,8805,0.9999,,9201
+17810,9807,8806,0.0,,9001
+17810,9807,8807,0.0,,9001
+17811,9807,8801,44.0,,9110
+17811,9807,8802,140.15,,9110
+17811,9807,8805,0.9999,,9201
+17811,9807,8806,0.0,,9001
+17811,9807,8807,0.0,,9001
+17812,9807,8801,44.0,,9110
+17812,9807,8802,142.15,,9110
+17812,9807,8805,0.9999,,9201
+17812,9807,8806,0.0,,9001
+17812,9807,8807,0.0,,9001
+17813,9807,8801,44.0,,9110
+17813,9807,8802,144.15,,9110
+17813,9807,8805,0.9999,,9201
+17813,9807,8806,0.0,,9001
+17813,9807,8807,0.0,,9001
+17814,9807,8801,26.0,,9110
+17814,9807,8802,142.0,,9110
+17814,9807,8805,0.9999,,9201
+17814,9807,8806,0.0,,9001
+17814,9807,8807,0.0,,9001
+17815,9807,8801,26.0,,9110
+17815,9807,8802,127.3,,9110
+17815,9807,8805,0.9999,,9201
+17815,9807,8806,0.0,,9001
+17815,9807,8807,0.0,,9001
+17816,9807,8801,26.0,,9110
+17816,9807,8802,124.0,,9110
+17816,9807,8805,0.9999,,9201
+17816,9807,8806,0.0,,9001
+17816,9807,8807,0.0,,9001
+17817,9807,8801,26.0,,9110
+17817,9807,8802,131.0,,9110
+17817,9807,8805,0.9999,,9201
+17817,9807,8806,0.0,,9001
+17817,9807,8807,0.0,,9001
+17818,9807,8801,20.0,,9110
+17818,9807,8802,136.0,,9110
+17818,9807,8805,0.9999,,9201
+17818,9807,8806,0.0,,9001
+17818,9807,8807,0.0,,9001
+17819,9807,8801,26.0,,9110
+17819,9807,8802,154.0,,9110
+17819,9807,8805,0.9999,,9201
+17819,9807,8806,0.0,,9001
+17819,9807,8807,0.0,,9001
+17901,9807,8801,-36.5247515,,9110
+17901,9807,8802,174.45516217,,9110
+17901,9807,8805,0.9999,,9201
+17901,9807,8806,300000.0,,9001
+17901,9807,8807,700000.0,,9001
+17902,9807,8801,-37.45404993,,9110
+17902,9807,8802,176.27583101,,9110
+17902,9807,8805,1.0,,9201
+17902,9807,8806,300000.0,,9001
+17902,9807,8807,700000.0,,9001
+17903,9807,8801,-38.372893,,9110
+17903,9807,8802,177.53082906,,9110
+17903,9807,8805,1.0,,9201
+17903,9807,8806,300000.0,,9001
+17903,9807,8807,700000.0,,9001
+17904,9807,8801,-39.39033455,,9110
+17904,9807,8802,176.40252499,,9110
+17904,9807,8805,1.0,,9201
+17904,9807,8806,300000.0,,9001
+17904,9807,8807,700000.0,,9001
+17905,9807,8801,-39.08087299,,9110
+17905,9807,8802,174.13408423,,9110
+17905,9807,8805,1.0,,9201
+17905,9807,8806,300000.0,,9001
+17905,9807,8807,700000.0,,9001
+17906,9807,8801,-39.30448934,,9110
+17906,9807,8802,175.38241325,,9110
+17906,9807,8805,1.0,,9201
+17906,9807,8806,300000.0,,9001
+17906,9807,8807,700000.0,,9001
+17907,9807,8801,-40.14310097,,9110
+17907,9807,8802,175.29171586,,9110
+17907,9807,8805,1.0,,9201
+17907,9807,8806,300000.0,,9001
+17907,9807,8807,700000.0,,9001
+17908,9807,8801,-40.55319175,,9110
+17908,9807,8802,175.38504588,,9110
+17908,9807,8805,1.0,,9201
+17908,9807,8806,300000.0,,9001
+17908,9807,8807,700000.0,,9001
+17909,9807,8801,-41.18047507,,9110
+17909,9807,8802,174.46358432,,9110
+17909,9807,8805,1.0,,9201
+17909,9807,8806,300000.0,,9001
+17909,9807,8807,700000.0,,9001
+17910,9807,8801,-40.42531326,,9110
+17910,9807,8802,172.40193674,,9110
+17910,9807,8805,1.0,,9201
+17910,9807,8806,300000.0,,9001
+17910,9807,8807,700000.0,,9001
+17911,9807,8801,-41.1628361,,9110
+17911,9807,8802,173.17575405,,9110
+17911,9807,8805,1.0,,9201
+17911,9807,8806,300000.0,,9001
+17911,9807,8807,700000.0,,9001
+17912,9807,8801,-41.17236815,,9110
+17912,9807,8802,172.06325015,,9110
+17912,9807,8805,1.0,,9201
+17912,9807,8806,300000.0,,9001
+17912,9807,8807,700000.0,,9001
+17913,9807,8801,-41.48388903,,9110
+17913,9807,8802,171.34525362,,9110
+17913,9807,8805,1.0,,9201
+17913,9807,8806,300000.0,,9001
+17913,9807,8807,700000.0,,9001
+17914,9807,8801,-42.20012994,,9110
+17914,9807,8802,171.32591767,,9110
+17914,9807,8805,1.0,,9201
+17914,9807,8806,300000.0,,9001
+17914,9807,8807,700000.0,,9001
+17915,9807,8801,-42.41208197,,9110
+17915,9807,8802,173.00364802,,9110
+17915,9807,8805,1.0,,9201
+17915,9807,8806,300000.0,,9001
+17915,9807,8807,700000.0,,9001
+17916,9807,8801,-41.3240152,,9110
+17916,9807,8802,173.48074668,,9110
+17916,9807,8805,1.0,,9201
+17916,9807,8806,300000.0,,9001
+17916,9807,8807,700000.0,,9001
+17917,9807,8801,-42.53107605,,9110
+17917,9807,8802,170.58479766,,9110
+17917,9807,8805,1.0,,9201
+17917,9807,8806,300000.0,,9001
+17917,9807,8807,700000.0,,9001
+17918,9807,8801,-43.06364613,,9110
+17918,9807,8802,170.1539333,,9110
+17918,9807,8805,1.0,,9201
+17918,9807,8806,300000.0,,9001
+17918,9807,8807,700000.0,,9001
+17919,9807,8801,-43.58400904,,9110
+17919,9807,8802,168.36225612,,9110
+17919,9807,8805,1.0,,9201
+17919,9807,8806,300000.0,,9001
+17919,9807,8807,700000.0,,9001
+17920,9807,8801,-43.35262953,,9110
+17920,9807,8802,172.43378969,,9110
+17920,9807,8805,1.0,,9201
+17920,9807,8806,300000.0,,9001
+17920,9807,8807,700000.0,,9001
+17921,9807,8801,-43.44553616,,9110
+17921,9807,8802,171.21386945,,9110
+17921,9807,8805,1.0,,9201
+17921,9807,8806,300000.0,,9001
+17921,9807,8807,700000.0,,9001
+17922,9807,8801,-44.24079933,,9110
+17922,9807,8802,171.0326103,,9110
+17922,9807,8805,1.0,,9201
+17922,9807,8806,300000.0,,9001
+17922,9807,8807,700000.0,,9001
+17923,9807,8801,-44.44069647,,9110
+17923,9807,8802,169.28039183,,9110
+17923,9807,8805,1.0,,9201
+17923,9807,8806,300000.0,,9001
+17923,9807,8807,700000.0,,9001
+17924,9807,8801,-45.07584493,,9110
+17924,9807,8802,168.23551083,,9110
+17924,9807,8805,1.0,,9201
+17924,9807,8806,300000.0,,9001
+17924,9807,8807,700000.0,,9001
+17925,9807,8801,-45.33494142,,9110
+17925,9807,8802,167.44199024,,9110
+17925,9807,8805,1.0,,9201
+17925,9807,8806,300000.0,,9001
+17925,9807,8807,700000.0,,9001
+17926,9807,8801,-45.48583078,,9110
+17926,9807,8802,170.37429426,,9110
+17926,9807,8805,1.0,,9201
+17926,9807,8806,300000.0,,9001
+17926,9807,8807,700000.0,,9001
+17927,9807,8801,-45.51414481,,9110
+17927,9807,8802,170.16573208,,9110
+17927,9807,8805,0.99996,,9201
+17927,9807,8806,300000.0,,9001
+17927,9807,8807,700000.0,,9001
+17928,9807,8801,-46.36000346,,9110
+17928,9807,8802,168.20343392,,9110
+17928,9807,8805,1.0,,9201
+17928,9807,8806,300002.66,,9001
+17928,9807,8807,699999.58,,9001
+17931,9807,8801,-36.5247,,9110
+17931,9807,8802,174.4551,,9110
+17931,9807,8805,0.9999,,9201
+17931,9807,8806,400000.0,,9001
+17931,9807,8807,800000.0,,9001
+17932,9807,8801,-37.454,,9110
+17932,9807,8802,176.2758,,9110
+17932,9807,8805,1.0,,9201
+17932,9807,8806,400000.0,,9001
+17932,9807,8807,800000.0,,9001
+17933,9807,8801,-38.3728,,9110
+17933,9807,8802,177.5308,,9110
+17933,9807,8805,1.0,,9201
+17933,9807,8806,400000.0,,9001
+17933,9807,8807,800000.0,,9001
+17934,9807,8801,-39.3903,,9110
+17934,9807,8802,176.4025,,9110
+17934,9807,8805,1.0,,9201
+17934,9807,8806,400000.0,,9001
+17934,9807,8807,800000.0,,9001
+17935,9807,8801,-39.0808,,9110
+17935,9807,8802,174.134,,9110
+17935,9807,8805,1.0,,9201
+17935,9807,8806,400000.0,,9001
+17935,9807,8807,800000.0,,9001
+17936,9807,8801,-39.3044,,9110
+17936,9807,8802,175.3824,,9110
+17936,9807,8805,1.0,,9201
+17936,9807,8806,400000.0,,9001
+17936,9807,8807,800000.0,,9001
+17937,9807,8801,-40.1431,,9110
+17937,9807,8802,175.2917,,9110
+17937,9807,8805,1.0,,9201
+17937,9807,8806,400000.0,,9001
+17937,9807,8807,800000.0,,9001
+17938,9807,8801,-40.5531,,9110
+17938,9807,8802,175.385,,9110
+17938,9807,8805,1.0,,9201
+17938,9807,8806,400000.0,,9001
+17938,9807,8807,800000.0,,9001
+17939,9807,8801,-41.1804,,9110
+17939,9807,8802,174.4635,,9110
+17939,9807,8805,1.0,,9201
+17939,9807,8806,400000.0,,9001
+17939,9807,8807,800000.0,,9001
+17940,9807,8801,-40.4253,,9110
+17940,9807,8802,172.4019,,9110
+17940,9807,8805,1.0,,9201
+17940,9807,8806,400000.0,,9001
+17940,9807,8807,800000.0,,9001
+17941,9807,8801,-41.1628,,9110
+17941,9807,8802,173.1757,,9110
+17941,9807,8805,1.0,,9201
+17941,9807,8806,400000.0,,9001
+17941,9807,8807,800000.0,,9001
+17942,9807,8801,-41.1723,,9110
+17942,9807,8802,172.0632,,9110
+17942,9807,8805,1.0,,9201
+17942,9807,8806,400000.0,,9001
+17942,9807,8807,800000.0,,9001
+17943,9807,8801,-41.4838,,9110
+17943,9807,8802,171.3452,,9110
+17943,9807,8805,1.0,,9201
+17943,9807,8806,400000.0,,9001
+17943,9807,8807,800000.0,,9001
+17944,9807,8801,-42.2001,,9110
+17944,9807,8802,171.3259,,9110
+17944,9807,8805,1.0,,9201
+17944,9807,8806,400000.0,,9001
+17944,9807,8807,800000.0,,9001
+17945,9807,8801,-42.412,,9110
+17945,9807,8802,173.0036,,9110
+17945,9807,8805,1.0,,9201
+17945,9807,8806,400000.0,,9001
+17945,9807,8807,800000.0,,9001
+17946,9807,8801,-41.324,,9110
+17946,9807,8802,173.4807,,9110
+17946,9807,8805,1.0,,9201
+17946,9807,8806,400000.0,,9001
+17946,9807,8807,800000.0,,9001
+17947,9807,8801,-42.531,,9110
+17947,9807,8802,170.5847,,9110
+17947,9807,8805,1.0,,9201
+17947,9807,8806,400000.0,,9001
+17947,9807,8807,800000.0,,9001
+17948,9807,8801,-43.0636,,9110
+17948,9807,8802,170.1539,,9110
+17948,9807,8805,1.0,,9201
+17948,9807,8806,400000.0,,9001
+17948,9807,8807,800000.0,,9001
+17949,9807,8801,-43.584,,9110
+17949,9807,8802,168.3622,,9110
+17949,9807,8805,1.0,,9201
+17949,9807,8806,400000.0,,9001
+17949,9807,8807,800000.0,,9001
+17950,9807,8801,-43.3526,,9110
+17950,9807,8802,172.4337,,9110
+17950,9807,8805,1.0,,9201
+17950,9807,8806,400000.0,,9001
+17950,9807,8807,800000.0,,9001
+17951,9807,8801,-43.4455,,9110
+17951,9807,8802,171.2138,,9110
+17951,9807,8805,1.0,,9201
+17951,9807,8806,400000.0,,9001
+17951,9807,8807,800000.0,,9001
+17952,9807,8801,-44.2407,,9110
+17952,9807,8802,171.0326,,9110
+17952,9807,8805,1.0,,9201
+17952,9807,8806,400000.0,,9001
+17952,9807,8807,800000.0,,9001
+17953,9807,8801,-44.4406,,9110
+17953,9807,8802,169.2803,,9110
+17953,9807,8805,1.0,,9201
+17953,9807,8806,400000.0,,9001
+17953,9807,8807,800000.0,,9001
+17954,9807,8801,-45.0758,,9110
+17954,9807,8802,168.2355,,9110
+17954,9807,8805,1.0,,9201
+17954,9807,8806,400000.0,,9001
+17954,9807,8807,800000.0,,9001
+17955,9807,8801,-45.3349,,9110
+17955,9807,8802,167.4419,,9110
+17955,9807,8805,1.0,,9201
+17955,9807,8806,400000.0,,9001
+17955,9807,8807,800000.0,,9001
+17956,9807,8801,-45.4858,,9110
+17956,9807,8802,170.3742,,9110
+17956,9807,8805,1.0,,9201
+17956,9807,8806,400000.0,,9001
+17956,9807,8807,800000.0,,9001
+17957,9807,8801,-45.5141,,9110
+17957,9807,8802,170.1657,,9110
+17957,9807,8805,0.99996,,9201
+17957,9807,8806,400000.0,,9001
+17957,9807,8807,800000.0,,9001
+17958,9807,8801,-46.36,,9110
+17958,9807,8802,168.2034,,9110
+17958,9807,8805,1.0,,9201
+17958,9807,8806,400000.0,,9001
+17958,9807,8807,800000.0,,9001
+18011,9801,8801,40.0,,9105
+18011,9801,8802,3.0,,9105
+18011,9801,8805,0.999625544,,9201
+18011,9801,8806,500000.0,,9001
+18011,9801,8807,300000.0,,9001
+18012,9801,8801,37.0,,9105
+18012,9801,8802,3.0,,9105
+18012,9801,8805,0.999625769,,9201
+18012,9801,8806,500000.0,,9001
+18012,9801,8807,300000.0,,9001
+18021,9801,8801,40.0,,9105
+18021,9801,8802,3.0,,9105
+18021,9801,8805,0.999625544,,9201
+18021,9801,8806,500135.0,,9001
+18021,9801,8807,300090.0,,9001
+18022,9801,8801,37.0,,9105
+18022,9801,8802,3.0,,9105
+18022,9801,8805,0.999625769,,9201
+18022,9801,8806,500135.0,,9001
+18022,9801,8807,300090.0,,9001
+18031,9807,8801,-90.0,,9102
+18031,9807,8802,-72.0,,9102
+18031,9807,8805,1.0,,9201
+18031,9807,8806,1500000.0,,9001
+18031,9807,8807,0.0,,9001
+18032,9807,8801,-90.0,,9102
+18032,9807,8802,-69.0,,9102
+18032,9807,8805,1.0,,9201
+18032,9807,8806,2500000.0,,9001
+18032,9807,8807,0.0,,9001
+18033,9807,8801,-90.0,,9102
+18033,9807,8802,-66.0,,9102
+18033,9807,8805,1.0,,9201
+18033,9807,8806,3500000.0,,9001
+18033,9807,8807,0.0,,9001
+18034,9807,8801,-90.0,,9102
+18034,9807,8802,-63.0,,9102
+18034,9807,8805,1.0,,9201
+18034,9807,8806,4500000.0,,9001
+18034,9807,8807,0.0,,9001
+18035,9807,8801,-90.0,,9102
+18035,9807,8802,-60.0,,9102
+18035,9807,8805,1.0,,9201
+18035,9807,8806,5500000.0,,9001
+18035,9807,8807,0.0,,9001
+18036,9807,8801,-90.0,,9102
+18036,9807,8802,-57.0,,9102
+18036,9807,8805,1.0,,9201
+18036,9807,8806,6500000.0,,9001
+18036,9807,8807,0.0,,9001
+18037,9807,8801,-90.0,,9102
+18037,9807,8802,-54.0,,9102
+18037,9807,8805,1.0,,9201
+18037,9807,8806,7500000.0,,9001
+18037,9807,8807,0.0,,9001
+18041,9807,8801,0.0,,9102
+18041,9807,8802,28.0,,9102
+18041,9807,8805,1.0,,9201
+18041,9807,8806,0.0,,9001
+18041,9807,8807,0.0,,9001
+18042,9807,8801,0.0,,9102
+18042,9807,8802,31.0,,9102
+18042,9807,8805,1.0,,9201
+18042,9807,8806,0.0,,9001
+18042,9807,8807,0.0,,9001
+18043,9807,8801,0.0,,9102
+18043,9807,8802,34.0,,9102
+18043,9807,8805,1.0,,9201
+18043,9807,8806,0.0,,9001
+18043,9807,8807,0.0,,9001
+18044,9807,8801,0.0,,9110
+18044,9807,8802,10.2,,9110
+18044,9807,8805,1.0,,9201
+18044,9807,8806,150000.0,,9001
+18044,9807,8807,0.0,,9001
+18045,9807,8801,0.0,,9110
+18045,9807,8802,13.2,,9110
+18045,9807,8805,1.0,,9201
+18045,9807,8806,450000.0,,9001
+18045,9807,8807,0.0,,9001
+18046,9807,8801,0.0,,9110
+18046,9807,8802,16.2,,9110
+18046,9807,8805,1.0,,9201
+18046,9807,8806,750000.0,,9001
+18046,9807,8807,0.0,,9001
+18051,9807,8801,4.355657,,9110
+18051,9807,8802,-77.04513,,9110
+18051,9807,8805,1.0,,9201
+18051,9807,8806,1000000.0,,9001
+18051,9807,8807,1000000.0,,9001
+18052,9807,8801,4.355657,,9110
+18052,9807,8802,-74.04513,,9110
+18052,9807,8805,1.0,,9201
+18052,9807,8806,1000000.0,,9001
+18052,9807,8807,1000000.0,,9001
+18053,9807,8801,4.355657,,9110
+18053,9807,8802,-71.04513,,9110
+18053,9807,8805,1.0,,9201
+18053,9807,8806,1000000.0,,9001
+18053,9807,8807,1000000.0,,9001
+18054,9807,8801,4.355657,,9110
+18054,9807,8802,-68.04513,,9110
+18054,9807,8805,1.0,,9201
+18054,9807,8806,1000000.0,,9001
+18054,9807,8807,1000000.0,,9001
+18061,9801,8801,22.21,,9110
+18061,9801,8802,-81.0,,9110
+18061,9801,8805,0.99993602,,9201
+18061,9801,8806,500000.0,,9001
+18061,9801,8807,280296.016,,9001
+18062,9801,8801,20.43,,9110
+18062,9801,8802,-76.5,,9110
+18062,9801,8805,0.99994848,,9201
+18062,9801,8806,500000.0,,9001
+18062,9801,8807,229126.939,,9001
+18071,9807,8801,30.0,,9102
+18071,9807,8802,35.0,,9102
+18071,9807,8805,1.0,,9201
+18071,9807,8806,300000.0,,9001
+18071,9807,8807,1100000.0,,9001
+18072,9807,8801,30.0,,9102
+18072,9807,8802,31.0,,9102
+18072,9807,8805,1.0,,9201
+18072,9807,8806,615000.0,,9001
+18072,9807,8807,810000.0,,9001
+18073,9807,8801,30.0,,9102
+18073,9807,8802,27.0,,9102
+18073,9807,8805,1.0,,9201
+18073,9807,8806,700000.0,,9001
+18073,9807,8807,200000.0,,9001
+18074,9807,8801,30.0,,9102
+18074,9807,8802,27.0,,9102
+18074,9807,8805,1.0,,9201
+18074,9807,8806,700000.0,,9001
+18074,9807,8807,1200000.0,,9001
+18081,9801,8801,55.0,,9105
+18081,9801,8802,0.0,,9105
+18081,9801,8805,0.999877341,,9201
+18081,9801,8806,600000.0,,9001
+18081,9801,8807,1200000.0,,9001
+18082,9801,8801,52.0,,9105
+18082,9801,8802,0.0,,9105
+18082,9801,8805,0.99987742,,9201
+18082,9801,8806,600000.0,,9001
+18082,9801,8807,2200000.0,,9001
+18083,9801,8801,49.0,,9105
+18083,9801,8802,0.0,,9105
+18083,9801,8805,0.999877499,,9201
+18083,9801,8806,600000.0,,9001
+18083,9801,8807,3200000.0,,9001
+18084,9801,8801,46.85,,9105
+18084,9801,8802,0.0,,9105
+18084,9801,8805,0.99994471,,9201
+18084,9801,8806,234.358,,9001
+18084,9801,8807,4185861.369,,9001
+18085,9802,8821,46.3,,9110
+18085,9802,8822,3.0,,9110
+18085,9802,8823,49.0,,9110
+18085,9802,8824,44.0,,9110
+18085,9802,8826,700000.0,,9001
+18085,9802,8827,6600000.0,,9001
+18086,9801,8801,46.48,,9110
+18086,9801,8802,2.2014025,,9110
+18086,9801,8805,0.99987742,,9201
+18086,9801,8806,600000.0,,9001
+18086,9801,8807,2200000.0,,9001
+18091,9801,8801,55.0,,9105
+18091,9801,8802,0.0,,9105
+18091,9801,8805,0.999877341,,9201
+18091,9801,8806,600000.0,,9001
+18091,9801,8807,200000.0,,9001
+18092,9801,8801,52.0,,9105
+18092,9801,8802,0.0,,9105
+18092,9801,8805,0.99987742,,9201
+18092,9801,8806,600000.0,,9001
+18092,9801,8807,200000.0,,9001
+18093,9801,8801,49.0,,9105
+18093,9801,8802,0.0,,9105
+18093,9801,8805,0.999877499,,9201
+18093,9801,8806,600000.0,,9001
+18093,9801,8807,200000.0,,9001
+18094,9801,8801,46.85,,9105
+18094,9801,8802,0.0,,9105
+18094,9801,8805,0.99994471,,9201
+18094,9801,8806,234.358,,9001
+18094,9801,8807,185861.369,,9001
+18110,9801,8801,39.3,,9110
+18110,9801,8802,68.0,,9110
+18110,9801,8805,0.99846154,,9201
+18110,9801,8806,2355500.0,,9084
+18110,9801,8807,2590000.0,,9084
+18111,9801,8801,32.3,,9110
+18111,9801,8802,68.0,,9110
+18111,9801,8805,0.99878641,,9201
+18111,9801,8806,3000000.0,,9084
+18111,9801,8807,1000000.0,,9084
+18112,9801,8801,26.0,,9102
+18112,9801,8802,74.0,,9102
+18112,9801,8805,0.99878641,,9201
+18112,9801,8806,3000000.0,,9084
+18112,9801,8807,1000000.0,,9084
+18113,9801,8801,26.0,,9102
+18113,9801,8802,90.0,,9102
+18113,9801,8805,0.99878641,,9201
+18113,9801,8806,3000000.0,,9084
+18113,9801,8807,1000000.0,,9084
+18114,9801,8801,19.0,,9102
+18114,9801,8802,80.0,,9102
+18114,9801,8805,0.99878641,,9201
+18114,9801,8806,3000000.0,,9084
+18114,9801,8807,1000000.0,,9084
+18115,9801,8801,19.0,,9102
+18115,9801,8802,100.0,,9102
+18115,9801,8805,0.99878641,,9201
+18115,9801,8806,3000000.0,,9084
+18115,9801,8807,1000000.0,,9084
+18116,9801,8801,12.0,,9102
+18116,9801,8802,80.0,,9102
+18116,9801,8805,0.99878641,,9201
+18116,9801,8806,3000000.0,,9084
+18116,9801,8807,1000000.0,,9084
+18117,9801,8801,12.0,,9102
+18117,9801,8802,100.0,,9102
+18117,9801,8805,0.99878641,,9201
+18117,9801,8806,3000000.0,,9084
+18117,9801,8807,1000000.0,,9084
+18121,9807,8801,0.0,,9102
+18121,9807,8802,9.0,,9102
+18121,9807,8805,0.9996,,9201
+18121,9807,8806,1500000.0,,9001
+18121,9807,8807,0.0,,9001
+18122,9807,8801,0.0,,9102
+18122,9807,8802,15.0,,9102
+18122,9807,8805,0.9996,,9201
+18122,9807,8806,2520000.0,,9001
+18122,9807,8807,0.0,,9001
+18131,9801,8801,37.0,,9105
+18131,9801,8802,-6.0,,9105
+18131,9801,8805,0.999625769,,9201
+18131,9801,8806,500000.0,,9001
+18131,9801,8807,300000.0,,9001
+18132,9801,8801,33.0,,9105
+18132,9801,8802,-6.0,,9105
+18132,9801,8805,0.999615596,,9201
+18132,9801,8806,500000.0,,9001
+18132,9801,8807,300000.0,,9001
+18133,9801,8801,29.0,,9105
+18133,9801,8802,-6.0,,9105
+18133,9801,8805,0.9996,,9201
+18133,9801,8806,1200000.0,,9001
+18133,9801,8807,400000.0,,9001
+18141,9807,8801,-39.0,,9110
+18141,9807,8802,175.3,,9110
+18141,9807,8805,1.0,,9201
+18141,9807,8806,300000.0,,9040
+18141,9807,8807,400000.0,,9040
+18142,9807,8801,-44.0,,9110
+18142,9807,8802,171.3,,9110
+18142,9807,8805,1.0,,9201
+18142,9807,8806,500000.0,,9040
+18142,9807,8807,500000.0,,9040
+18151,9807,8801,4.0,,9110
+18151,9807,8802,4.3,,9110
+18151,9807,8805,0.99975,,9201
+18151,9807,8806,230738.26,,9001
+18151,9807,8807,0.0,,9001
+18152,9807,8801,4.0,,9110
+18152,9807,8802,8.3,,9110
+18152,9807,8805,0.99975,,9201
+18152,9807,8806,670553.98,,9001
+18152,9807,8807,0.0,,9001
+18153,9807,8801,4.0,,9110
+18153,9807,8802,12.3,,9110
+18153,9807,8805,0.99975,,9201
+18153,9807,8806,1110369.7,,9001
+18153,9807,8807,0.0,,9001
+18161,9807,8801,-6.0,,9110
+18161,9807,8802,-80.3,,9110
+18161,9807,8805,0.99983008,,9201
+18161,9807,8806,222000.0,,9001
+18161,9807,8807,1426834.743,,9001
+18162,9807,8801,-9.3,,9110
+18162,9807,8802,-76.0,,9110
+18162,9807,8805,0.99932994,,9201
+18162,9807,8806,720000.0,,9001
+18162,9807,8807,1039979.159,,9001
+18163,9807,8801,-9.3,,9110
+18163,9807,8802,-70.3,,9110
+18163,9807,8805,0.99952992,,9201
+18163,9807,8806,1324000.0,,9001
+18163,9807,8807,1040084.558,,9001
+18171,9807,8801,0.0,,9102
+18171,9807,8802,117.0,,9102
+18171,9807,8805,0.99995,,9201
+18171,9807,8806,500000.0,,9001
+18171,9807,8807,0.0,,9001
+18172,9807,8801,0.0,,9102
+18172,9807,8802,119.0,,9102
+18172,9807,8805,0.99995,,9201
+18172,9807,8806,500000.0,,9001
+18172,9807,8807,0.0,,9001
+18173,9807,8801,0.0,,9102
+18173,9807,8802,121.0,,9102
+18173,9807,8805,0.99995,,9201
+18173,9807,8806,500000.0,,9001
+18173,9807,8807,0.0,,9001
+18174,9807,8801,0.0,,9102
+18174,9807,8802,123.0,,9102
+18174,9807,8805,0.99995,,9201
+18174,9807,8806,500000.0,,9001
+18174,9807,8807,0.0,,9001
+18175,9807,8801,0.0,,9102
+18175,9807,8802,125.0,,9102
+18175,9807,8805,0.99995,,9201
+18175,9807,8806,500000.0,,9001
+18175,9807,8807,0.0,,9001
+18181,9801,8801,40.0,,9105
+18181,9801,8802,11.0,,9105
+18181,9801,8805,0.999625544,,9201
+18181,9801,8806,500000.0,,9001
+18181,9801,8807,300000.0,,9001
+18182,9801,8801,37.0,,9105
+18182,9801,8802,11.0,,9105
+18182,9801,8805,0.999625769,,9201
+18182,9801,8806,500000.0,,9001
+18182,9801,8807,300000.0,,9001
+18191,9807,8801,0.0,,9102
+18191,9807,8802,21.0,,9102
+18191,9807,8805,1.0,,9201
+18191,9807,8806,1500000.0,,9001
+18191,9807,8807,0.0,,9001
+18192,9807,8801,0.0,,9102
+18192,9807,8802,24.0,,9102
+18192,9807,8805,1.0,,9201
+18192,9807,8806,2500000.0,,9001
+18192,9807,8807,0.0,,9001
+18193,9807,8801,0.0,,9102
+18193,9807,8802,27.0,,9102
+18193,9807,8805,1.0,,9201
+18193,9807,8806,3500000.0,,9001
+18193,9807,8807,0.0,,9001
+18194,9807,8801,0.0,,9102
+18194,9807,8802,30.0,,9102
+18194,9807,8805,1.0,,9201
+18194,9807,8806,4500000.0,,9001
+18194,9807,8807,0.0,,9001
+18201,9806,8801,31.4402749,,9110
+18201,9806,8802,35.124349,,9110
+18201,9806,8806,170251.555,,9001
+18201,9806,8807,126867.909,,9001
+18202,9807,8801,31.4402749,,9110
+18202,9807,8802,35.124349,,9110
+18202,9807,8805,1.0,,9201
+18202,9807,8806,170251.555,,9001
+18202,9807,8807,1126867.909,,9001
+18203,9806,8801,31.4402749,,9110
+18203,9806,8802,35.124349,,9110
+18203,9806,8806,170251.555,,9001
+18203,9806,8807,1126867.909,,9001
+18204,9807,8801,31.4403817,,9110
+18204,9807,8802,35.1216261,,9110
+18204,9807,8805,1.0000067,,9201
+18204,9807,8806,219529.584,,9001
+18204,9807,8807,626907.39,,9001
+18211,9801,8801,16.49,,9110
+18211,9801,8802,-90.2,,9110
+18211,9801,8805,0.99992226,,9201
+18211,9801,8806,500000.0,,9001
+18211,9801,8807,292209.579,,9001
+18212,9801,8801,14.54,,9110
+18212,9801,8802,-90.2,,9110
+18212,9801,8805,0.99989906,,9201
+18212,9801,8806,500000.0,,9001
+18212,9801,8807,325992.681,,9001
+18221,9807,8801,58.0,,9110
+18221,9807,8802,-4.4,,9110
+18221,9807,8805,1.0,,9201
+18221,9807,8806,0.0,,9001
+18221,9807,8807,0.0,,9001
+18222,9807,8801,58.0,,9110
+18222,9807,8802,-2.2,,9110
+18222,9807,8805,1.0,,9201
+18222,9807,8806,0.0,,9001
+18222,9807,8807,0.0,,9001
+18223,9807,8801,58.0,,9110
+18223,9807,8802,0.0,,9110
+18223,9807,8805,1.0,,9201
+18223,9807,8806,0.0,,9001
+18223,9807,8807,0.0,,9001
+18224,9807,8801,58.0,,9110
+18224,9807,8802,2.3,,9110
+18224,9807,8805,1.0,,9201
+18224,9807,8806,0.0,,9001
+18224,9807,8807,0.0,,9001
+18225,9807,8801,58.0,,9110
+18225,9807,8802,6.1,,9110
+18225,9807,8805,1.0,,9201
+18225,9807,8806,0.0,,9001
+18225,9807,8807,0.0,,9001
+18226,9807,8801,58.0,,9110
+18226,9807,8802,10.1,,9110
+18226,9807,8805,1.0,,9201
+18226,9807,8806,0.0,,9001
+18226,9807,8807,0.0,,9001
+18227,9807,8801,58.0,,9110
+18227,9807,8802,14.1,,9110
+18227,9807,8805,1.0,,9201
+18227,9807,8806,0.0,,9001
+18227,9807,8807,0.0,,9001
+18228,9807,8801,58.0,,9110
+18228,9807,8802,18.2,,9110
+18228,9807,8805,1.0,,9201
+18228,9807,8806,0.0,,9001
+18228,9807,8807,0.0,,9001
+18231,9801,8801,32.3,,9110
+18231,9801,8802,68.0,,9110
+18231,9801,8805,0.99878641,,9201
+18231,9801,8806,2743195.5,,9001
+18231,9801,8807,914398.5,,9001
+18232,9801,8801,26.0,,9102
+18232,9801,8802,74.0,,9102
+18232,9801,8805,0.99878641,,9201
+18232,9801,8806,2743195.5,,9001
+18232,9801,8807,914398.5,,9001
+18233,9801,8801,19.0,,9102
+18233,9801,8802,80.0,,9102
+18233,9801,8805,0.99878641,,9201
+18233,9801,8806,2743195.5,,9001
+18233,9801,8807,914398.5,,9001
+18234,9801,8801,12.0,,9102
+18234,9801,8802,80.0,,9102
+18234,9801,8805,0.99878641,,9201
+18234,9801,8806,2743195.5,,9001
+18234,9801,8807,914398.5,,9001
+18235,9801,8801,26.0,,9102
+18235,9801,8802,90.0,,9102
+18235,9801,8805,0.99878641,,9201
+18235,9801,8806,2743195.5,,9001
+18235,9801,8807,914398.5,,9001
+18236,9801,8801,32.3,,9110
+18236,9801,8802,68.0,,9110
+18236,9801,8805,0.99878641,,9201
+18236,9801,8806,2743196.4,,9001
+18236,9801,8807,914398.8,,9001
+18237,9801,8801,26.0,,9102
+18237,9801,8802,74.0,,9102
+18237,9801,8805,0.99878641,,9201
+18237,9801,8806,2743196.4,,9001
+18237,9801,8807,914398.8,,9001
+18238,9801,8801,26.0,,9102
+18238,9801,8802,90.0,,9102
+18238,9801,8805,0.99878641,,9201
+18238,9801,8806,2743185.69,,9001
+18238,9801,8807,914395.23,,9001
+18240,9807,8801,0.0,,9102
+18240,9807,8802,9.0,,9102
+18240,9807,8805,0.9999,,9201
+18240,9807,8806,200000.0,,9001
+18240,9807,8807,0.0,,9001
+18241,9807,8801,0.0,,9102
+18241,9807,8802,11.0,,9102
+18241,9807,8805,0.9999,,9201
+18241,9807,8806,200000.0,,9001
+18241,9807,8807,0.0,,9001
+18242,9807,8801,0.0,,9102
+18242,9807,8802,13.0,,9102
+18242,9807,8805,0.9999,,9201
+18242,9807,8806,200000.0,,9001
+18242,9807,8807,0.0,,9001
+18243,9807,8801,0.0,,9102
+18243,9807,8802,15.0,,9102
+18243,9807,8805,0.9999,,9201
+18243,9807,8806,200000.0,,9001
+18243,9807,8807,0.0,,9001
+18244,9807,8801,0.0,,9102
+18244,9807,8802,17.0,,9102
+18244,9807,8805,0.9999,,9201
+18244,9807,8806,200000.0,,9001
+18244,9807,8807,0.0,,9001
+18245,9807,8801,0.0,,9102
+18245,9807,8802,19.0,,9102
+18245,9807,8805,0.9999,,9201
+18245,9807,8806,200000.0,,9001
+18245,9807,8807,0.0,,9001
+18246,9807,8801,0.0,,9102
+18246,9807,8802,21.0,,9102
+18246,9807,8805,0.9999,,9201
+18246,9807,8806,200000.0,,9001
+18246,9807,8807,0.0,,9001
+18247,9807,8801,0.0,,9102
+18247,9807,8802,23.0,,9102
+18247,9807,8805,0.9999,,9201
+18247,9807,8806,200000.0,,9001
+18247,9807,8807,0.0,,9001
+18248,9807,8801,0.0,,9102
+18248,9807,8802,25.0,,9102
+18248,9807,8805,0.9999,,9201
+18248,9807,8806,200000.0,,9001
+18248,9807,8807,0.0,,9001
+18251,9807,8801,38.0,,9102
+18251,9807,8802,129.0,,9102
+18251,9807,8805,1.0,,9201
+18251,9807,8806,200000.0,,9001
+18251,9807,8807,500000.0,,9001
+18252,9807,8801,38.0,,9102
+18252,9807,8802,127.0,,9102
+18252,9807,8805,1.0,,9201
+18252,9807,8806,200000.0,,9001
+18252,9807,8807,500000.0,,9001
+18253,9807,8801,38.0,,9102
+18253,9807,8802,125.0,,9102
+18253,9807,8805,1.0,,9201
+18253,9807,8806,200000.0,,9001
+18253,9807,8807,500000.0,,9001
+18260,9801,8801,10.1,,9110
+18260,9801,8802,-71.3620224,,9110
+18260,9801,8805,1.0,,9201
+18260,9801,8806,0.0,,9001
+18260,9801,8807,-52684.972,,9001
+18261,9801,8801,10.1,,9110
+18261,9801,8802,-71.3620224,,9110
+18261,9801,8805,1.0,,9201
+18261,9801,8806,200000.0,,9001
+18261,9801,8807,147315.028,,9001
+18262,9801,8801,10.1,,9110
+18262,9801,8802,-71.3620224,,9110
+18262,9801,8805,1.0,,9201
+18262,9801,8806,500000.0,,9001
+18262,9801,8807,447315.028,,9001
+18263,9801,8801,10.1,,9110
+18263,9801,8802,-71.3620224,,9110
+18263,9801,8805,1.0,,9201
+18263,9801,8806,-17044.0,,9001
+18263,9801,8807,-23139.97,,9001
+18275,9807,8801,0.0,,9102
+18275,9807,8802,15.0,,9102
+18275,9807,8805,0.9999,,9201
+18275,9807,8806,5500000.0,,9001
+18275,9807,8807,0.0,,9001
+18276,9807,8801,0.0,,9102
+18276,9807,8802,18.0,,9102
+18276,9807,8805,0.9999,,9201
+18276,9807,8806,6500000.0,,9001
+18276,9807,8807,0.0,,9001
+18277,9807,8801,0.0,,9102
+18277,9807,8802,21.0,,9102
+18277,9807,8805,0.9999,,9201
+18277,9807,8806,7500000.0,,9001
+18277,9807,8807,0.0,,9001
+18278,9807,8801,0.0,,9102
+18278,9807,8802,24.0,,9102
+18278,9807,8805,0.9999,,9201
+18278,9807,8806,8500000.0,,9001
+18278,9807,8807,0.0,,9001
+18281,9809,8801,50.373,,9110
+18281,9809,8802,21.05,,9110
+18281,9809,8805,0.9998,,9201
+18281,9809,8806,4637000.0,,9001
+18281,9809,8807,5647000.0,,9001
+18282,9809,8801,53.0007,,9110
+18282,9809,8802,21.301,,9110
+18282,9809,8805,0.9998,,9201
+18282,9809,8806,4603000.0,,9001
+18282,9809,8807,5806000.0,,9001
+18283,9809,8801,53.35,,9110
+18283,9809,8802,17.003,,9110
+18283,9809,8805,0.9998,,9201
+18283,9809,8806,3501000.0,,9001
+18283,9809,8807,5999000.0,,9001
+18284,9809,8801,51.4015,,9110
+18284,9809,8802,16.402,,9110
+18284,9809,8805,0.9998,,9201
+18284,9809,8806,3703000.0,,9001
+18284,9809,8807,5627000.0,,9001
+18285,9807,8801,0.0,,9110
+18285,9807,8802,18.573,,9110
+18285,9807,8805,0.999983,,9201
+18285,9807,8806,237000.0,,9001
+18285,9807,8807,-4700000.0,,9001
+18300,9807,8801,0.0,,9102
+18300,9807,8802,19.0,,9102
+18300,9807,8805,0.9993,,9201
+18300,9807,8806,500000.0,,9001
+18300,9807,8807,-5300000.0,,9001
+18305,9807,8801,0.0,,9102
+18305,9807,8802,15.0,,9102
+18305,9807,8805,0.999923,,9201
+18305,9807,8806,5500000.0,,9001
+18305,9807,8807,0.0,,9001
+18306,9807,8801,0.0,,9102
+18306,9807,8802,18.0,,9102
+18306,9807,8805,0.999923,,9201
+18306,9807,8806,6500000.0,,9001
+18306,9807,8807,0.0,,9001
+18307,9807,8801,0.0,,9102
+18307,9807,8802,21.0,,9102
+18307,9807,8805,0.999923,,9201
+18307,9807,8806,7500000.0,,9001
+18307,9807,8807,0.0,,9001
+18308,9807,8801,0.0,,9102
+18308,9807,8802,24.0,,9102
+18308,9807,8805,0.999923,,9201
+18308,9807,8806,8500000.0,,9001
+18308,9807,8807,0.0,,9001
+18401,9807,8801,0.0,,9110
+18401,9807,8802,9.3,,9110
+18401,9807,8805,0.99995,,9201
+18401,9807,8806,200000.0,,9001
+18401,9807,8807,0.0,,9001
+18402,9807,8801,0.0,,9102
+18402,9807,8802,12.0,,9102
+18402,9807,8805,0.99995,,9201
+18402,9807,8806,500000.0,,9001
+18402,9807,8807,0.0,,9001
+18403,9807,8801,0.0,,9102
+18403,9807,8802,15.0,,9102
+18403,9807,8805,1.0,,9201
+18403,9807,8806,900000.0,,9001
+18403,9807,8807,0.0,,9001
+18411,9807,8801,0.0,,9110
+18411,9807,8802,-13.3,,9110
+18411,9807,8805,0.999,,9201
+18411,9807,8806,1000000.0,,9001
+18411,9807,8807,1000000.0,,9001
+18412,9807,8801,0.0,,9110
+18412,9807,8802,-6.3,,9110
+18412,9807,8805,0.999,,9201
+18412,9807,8806,1000000.0,,9001
+18412,9807,8807,1000000.0,,9001
+18413,9807,8801,0.0,,9110
+18413,9807,8802,0.3,,9110
+18413,9807,8805,0.999,,9201
+18413,9807,8806,1000000.0,,9001
+18413,9807,8807,1000000.0,,9001
+18414,9807,8801,0.0,,9110
+18414,9807,8802,7.3,,9110
+18414,9807,8805,0.999,,9201
+18414,9807,8806,1000000.0,,9001
+18414,9807,8807,1000000.0,,9001
+18415,9807,8801,0.0,,9110
+18415,9807,8802,10.3,,9110
+18415,9807,8805,0.999,,9201
+18415,9807,8806,1000000.0,,9001
+18415,9807,8807,1000000.0,,9001
+18416,9807,8801,0.0,,9110
+18416,9807,8802,17.4,,9110
+18416,9807,8805,0.999,,9201
+18416,9807,8806,1000000.0,,9001
+18416,9807,8807,1000000.0,,9001
+18417,9807,8801,0.0,,9110
+18417,9807,8802,24.3,,9110
+18417,9807,8805,0.999,,9201
+18417,9807,8806,1000000.0,,9001
+18417,9807,8807,1000000.0,,9001
+18421,9826,8801,82.3,,9110
+18421,9826,8802,-40.0,,9110
+18421,9826,8805,1.0,,9201
+18421,9826,8806,0.0,,9001
+18421,9826,8807,0.0,,9001
+18422,9826,8801,79.3,,9110
+18422,9826,8802,-24.0,,9110
+18422,9826,8805,1.0,,9201
+18422,9826,8806,0.0,,9001
+18422,9826,8807,0.0,,9001
+18423,9826,8801,76.3,,9110
+18423,9826,8802,-20.0,,9110
+18423,9826,8805,1.0,,9201
+18423,9826,8806,0.0,,9001
+18423,9826,8807,0.0,,9001
+18424,9826,8801,73.3,,9110
+18424,9826,8802,-24.0,,9110
+18424,9826,8805,1.0,,9201
+18424,9826,8806,0.0,,9001
+18424,9826,8807,0.0,,9001
+18425,9826,8801,70.3,,9110
+18425,9826,8802,-24.0,,9110
+18425,9826,8805,1.0,,9201
+18425,9826,8806,0.0,,9001
+18425,9826,8807,0.0,,9001
+18426,9826,8801,67.3,,9110
+18426,9826,8802,-32.0,,9110
+18426,9826,8805,1.0,,9201
+18426,9826,8806,0.0,,9001
+18426,9826,8807,0.0,,9001
+18427,9826,8801,64.3,,9110
+18427,9826,8802,-40.0,,9110
+18427,9826,8805,1.0,,9201
+18427,9826,8806,0.0,,9001
+18427,9826,8807,0.0,,9001
+18428,9826,8801,61.3,,9110
+18428,9826,8802,-48.0,,9110
+18428,9826,8805,1.0,,9201
+18428,9826,8806,0.0,,9001
+18428,9826,8807,0.0,,9001
+18432,9826,8801,79.3,,9110
+18432,9826,8802,-64.0,,9110
+18432,9826,8805,1.0,,9201
+18432,9826,8806,0.0,,9001
+18432,9826,8807,0.0,,9001
+18433,9826,8801,76.3,,9110
+18433,9826,8802,-64.0,,9110
+18433,9826,8805,1.0,,9201
+18433,9826,8806,0.0,,9001
+18433,9826,8807,0.0,,9001
+18434,9826,8801,73.3,,9110
+18434,9826,8802,-52.0,,9110
+18434,9826,8805,1.0,,9201
+18434,9826,8806,0.0,,9001
+18434,9826,8807,0.0,,9001
+18435,9826,8801,70.3,,9110
+18435,9826,8802,-52.0,,9110
+18435,9826,8805,1.0,,9201
+18435,9826,8806,0.0,,9001
+18435,9826,8807,0.0,,9001
+18436,9826,8801,67.3,,9110
+18436,9826,8802,-52.0,,9110
+18436,9826,8805,1.0,,9201
+18436,9826,8806,0.0,,9001
+18436,9826,8807,0.0,,9001
+18437,9826,8801,64.3,,9110
+18437,9826,8802,-52.0,,9110
+18437,9826,8805,1.0,,9201
+18437,9826,8806,0.0,,9001
+18437,9826,8807,0.0,,9001
+18441,9807,8801,0.07,,9110
+18441,9807,8802,41.32,,9110
+18441,9807,8805,1.0,,9003
+18441,9807,8806,1300000.0,,9001
+18441,9807,8807,0.0,,9001
+18442,9807,8801,0.07,,9110
+18442,9807,8802,44.32,,9110
+18442,9807,8805,1.0,,9003
+18442,9807,8806,2300000.0,,9001
+18442,9807,8807,0.0,,9001
+18443,9807,8801,0.07,,9110
+18443,9807,8802,47.32,,9110
+18443,9807,8805,1.0,,9201
+18443,9807,8806,3300000.0,,9001
+18443,9807,8807,0.0,,9001
+18444,9807,8801,0.07,,9110
+18444,9807,8802,50.32,,9110
+18444,9807,8805,1.0,,9201
+18444,9807,8806,4300000.0,,9001
+18444,9807,8807,0.0,,9001
+18446,9807,8801,0.08,,9110
+18446,9807,8802,50.46,,9110
+18446,9807,8805,1.0,,9201
+18446,9807,8806,2300000.0,,9001
+18446,9807,8807,0.0,,9001
+18447,9807,8801,0.08,,9110
+18447,9807,8802,53.46,,9110
+18447,9807,8805,1.0,,9201
+18447,9807,8806,3300000.0,,9001
+18447,9807,8807,0.0,,9001
+18448,9807,8801,0.08,,9110
+18448,9807,8802,56.46,,9110
+18448,9807,8805,1.0,,9201
+18448,9807,8806,4300000.0,,9001
+18448,9807,8807,0.0,,9001
+19900,9807,8801,0.0,,9102
+19900,9807,8802,51.0,,9102
+19900,9807,8805,0.9996,,9201
+19900,9807,8806,500000.0,,9001
+19900,9807,8807,0.0,,9001
+19901,9802,8821,90.0,,9110
+19901,9802,8822,0.0,,9110
+19901,9802,8823,49.5,,9110
+19901,9802,8824,51.1,,9110
+19901,9802,8826,150000.0,,9001
+19901,9802,8827,5400000.0,,9001
+19902,9803,8821,90.0,,9110
+19902,9803,8822,4.2124983,,9110
+19902,9803,8823,49.5,,9110
+19902,9803,8824,51.1,,9110
+19902,9803,8826,150000.01256,,9001
+19902,9803,8827,5400088.4378,,9001
+19903,9801,8801,55.0,,9105
+19903,9801,8802,6.0,,9105
+19903,9801,8805,0.99950908,,9201
+19903,9801,8806,500000.0,,9001
+19903,9801,8807,300000.0,,9001
+19904,9807,8801,4.4,,9110
+19904,9807,8802,-1.0,,9110
+19904,9807,8805,0.99975,,9201
+19904,9807,8806,274319.51,,9001
+19904,9807,8807,0.0,,9001
+19905,9804,8801,0.0,,9102
+19905,9804,8802,110.0,,9102
+19905,9804,8805,0.997,,9201
+19905,9804,8806,3900000.0,,9001
+19905,9804,8807,900000.0,,9001
+19906,9801,8801,32.3,,9110
+19906,9801,8802,45.0,,9110
+19906,9801,8805,0.9987864078,,9201
+19906,9801,8806,1500000.0,,9001
+19906,9801,8807,1166200.0,,9001
+19907,9807,8801,29.0134566,,9110
+19907,9807,8802,46.3,,9110
+19907,9807,8805,0.9994,,9201
+19907,9807,8806,800000.0,,9001
+19907,9807,8807,0.0,,9001
+19908,9807,8801,53.3,,9110
+19908,9807,8802,-8.0,,9110
+19908,9807,8805,1.000035,,9201
+19908,9807,8806,200000.0,,9001
+19908,9807,8807,250000.0,,9001
+19909,9801,8801,18.0,,9102
+19909,9801,8802,-77.0,,9102
+19909,9801,8805,1.0,,9201
+19909,9801,8806,550000.0,,9005
+19909,9801,8807,400000.0,,9005
+19910,9801,8801,18.0,,9102
+19910,9801,8802,-77.0,,9102
+19910,9801,8805,1.0,,9201
+19910,9801,8806,250000.0,,9001
+19910,9801,8807,150000.0,,9001
+19911,9815,8811,-21.0,,9105
+19911,9815,8812,49.0,,9105
+19911,9815,8813,21.0,,9105
+19911,9815,8814,21.0,,9105
+19911,9815,8815,0.9995,,9201
+19911,9815,8816,400000.0,,9001
+19911,9815,8817,800000.0,,9001
+19913,9809,8801,52.0922178,,9110
+19913,9809,8802,5.23155,,9110
+19913,9809,8805,0.9999079,,9201
+19913,9809,8806,0.0,,9001
+19913,9809,8807,0.0,,9001
+19914,9809,8801,52.0922178,,9110
+19914,9809,8802,5.23155,,9110
+19914,9809,8805,0.9999079,,9201
+19914,9809,8806,155000.0,,9001
+19914,9809,8807,463000.0,,9001
+19915,9801,8801,15.0,,9102
+19915,9801,8802,45.0,,9102
+19915,9801,8805,0.999365678,,9201
+19915,9801,8806,1500000.0,,9001
+19915,9801,8807,1000000.0,,9001
+19916,9807,8801,49.0,,9102
+19916,9807,8802,-2.0,,9102
+19916,9807,8805,0.999601272,,9201
+19916,9807,8806,400000.0,,9001
+19916,9807,8807,-100000.0,,9001
+19917,9811,8801,-41.0,,9102
+19917,9811,8802,173.0,,9102
+19917,9811,8806,2510000.0,,9001
+19917,9811,8807,6023150.0,,9001
+19919,9807,8801,24.27,,9110
+19919,9807,8802,51.13,,9110
+19919,9807,8805,0.99999,,9201
+19919,9807,8806,200000.0,,9001
+19919,9807,8807,300000.0,,9001
+19920,9806,8801,1.1715528,,9110
+19920,9806,8802,103.5110808,,9110
+19920,9806,8806,30000.0,,9001
+19920,9806,8807,30000.0,,9001
+19921,9801,8801,40.0,,9102
+19921,9801,8802,0.0,,9102
+19921,9801,8805,0.9988085293,,9201
+19921,9801,8806,600000.0,,9001
+19921,9801,8807,600000.0,,9001
+19922,9815,8811,46.570866,,9110
+19922,9815,8812,7.26225,,9110
+19922,9815,8813,90.0,,9110
+19922,9815,8814,90.0,,9110
+19922,9815,8815,1.0,,9201
+19922,9815,8816,600000.0,,9001
+19922,9815,8817,200000.0,,9001
+19923,9815,8811,46.570866,,9110
+19923,9815,8812,0.0,,9110
+19923,9815,8813,90.0,,9110
+19923,9815,8814,90.0,,9110
+19923,9815,8815,1.0,,9201
+19923,9815,8816,0.0,,9001
+19923,9815,8817,0.0,,9001
+19924,9806,8801,11.1507843,,9110
+19924,9806,8802,-60.4109632,,9110
+19924,9806,8806,187500.0,,9039
+19924,9806,8807,180000.0,,9039
+19925,9806,8801,10.263,,9110
+19925,9806,8802,-61.2,,9110
+19925,9806,8806,430000.0,,9039
+19925,9806,8807,325000.0,,9039
+19926,9809,8801,46.0,,9102
+19926,9809,8802,25.0,,9102
+19926,9809,8805,0.99975,,9201
+19926,9809,8806,500000.0,,9001
+19926,9809,8807,500000.0,,9001
+19927,9809,8801,45.54,,9110
+19927,9809,8802,25.23328772,,9110
+19927,9809,8805,0.9996667,,9201
+19927,9809,8806,500000.0,,9001
+19927,9809,8807,500000.0,,9001
+19928,9807,8801,0.0,,9102
+19928,9807,8802,48.0,,9102
+19928,9807,8805,0.9996,,9201
+19928,9807,8806,500000.0,,9001
+19928,9807,8807,0.0,,9001
+19929,9807,8801,0.0,,9110
+19929,9807,8802,15.48298,,9110
+19929,9807,8805,1.0,,9201
+19929,9807,8806,1500000.0,,9001
+19929,9807,8807,0.0,,9001
+19930,9807,8801,0.0,,9102
+19930,9807,8802,24.0,,9102
+19930,9807,8805,0.9996,,9201
+19930,9807,8806,500000.0,,9001
+19930,9807,8807,0.0,,9001
+19931,9815,8811,47.08398174,,9110
+19931,9815,8812,19.02548584,,9110
+19931,9815,8813,90.0,,9110
+19931,9815,8814,90.0,,9110
+19931,9815,8815,0.99993,,9201
+19931,9815,8816,650000.0,,9001
+19931,9815,8817,200000.0,,9001
+19933,9809,8801,47.15,,9110
+19933,9809,8802,-63.0,,9110
+19933,9809,8805,0.999912,,9201
+19933,9809,8806,700000.0,,9001
+19933,9809,8807,400000.0,,9001
+19934,9807,8801,0.0,,9102
+19934,9807,8802,24.0,,9102
+19934,9807,8805,0.9998,,9201
+19934,9807,8806,500000.0,,9001
+19934,9807,8807,0.0,,9001
+19935,9812,8806,40000.0,,9062
+19935,9812,8807,0.0,,9062
+19935,9812,8811,4.0,,9110
+19935,9812,8812,102.15,,9110
+19935,9812,8813,323.01328458,,9110
+19935,9812,8814,323.07483685,,9110
+19935,9812,8815,0.99984,,9201
+19936,9807,8801,39.4,,9110
+19936,9807,8802,1.0,,9110
+19936,9807,8805,1.0,,9201
+19936,9807,8806,200000.0,,9001
+19936,9807,8807,300000.0,,9001
+19937,9816,8821,38.81973,,9105
+19937,9816,8822,7.83445,,9105
+19937,9816,8826,270.0,,9036
+19937,9816,8827,582.0,,9036
+19938,9802,8821,57.310319415,,9110
+19938,9802,8822,24.0,,9110
+19938,9802,8823,59.2,,9110
+19938,9802,8824,58.0,,9110
+19938,9802,8826,500000.0,,9001
+19938,9802,8827,6375000.0,,9001
+19939,9807,8801,0.0,,9102
+19939,9807,8802,24.0,,9102
+19939,9807,8805,0.9996,,9201
+19939,9807,8806,500000.0,,9001
+19939,9807,8807,0.0,,9001
+19940,9817,8801,34.39,,9110
+19940,9817,8802,37.21,,9110
+19940,9817,8805,0.9996256,,9201
+19940,9817,8806,300000.0,,9001
+19940,9817,8807,300000.0,,9001
+19941,9818,8801,0.0,,9102
+19941,9818,8802,-54.0,,9102
+19941,9818,8806,5000000.0,,9001
+19941,9818,8807,10000000.0,,9001
+19942,9807,8801,0.0,,9102
+19942,9807,8802,-62.0,,9102
+19942,9807,8805,0.9995,,9201
+19942,9807,8806,400000.0,,9001
+19942,9807,8807,0.0,,9001
+19943,9807,8801,13.1035,,9110
+19943,9807,8802,-59.3335,,9110
+19943,9807,8805,0.9999986,,9201
+19943,9807,8806,30000.0,,9001
+19943,9807,8807,75000.0,,9001
+19944,9802,8821,44.0,,9110
+19944,9802,8822,-68.3,,9110
+19944,9802,8823,60.0,,9110
+19944,9802,8824,46.0,,9110
+19944,9802,8826,0.0,,9001
+19944,9802,8827,0.0,,9001
+19945,9809,8801,46.3,,9110
+19945,9809,8802,-66.3,,9110
+19945,9809,8805,0.999912,,9201
+19945,9809,8806,300000.0,,9001
+19945,9809,8807,800000.0,,9001
+19946,9809,8801,46.3,,9110
+19946,9809,8802,-66.3,,9110
+19946,9809,8805,0.999912,,9201
+19946,9809,8806,2500000.0,,9001
+19946,9809,8807,7500000.0,,9001
+19947,9802,8821,47.3,,9110
+19947,9802,8822,13.2,,9110
+19947,9802,8823,49.0,,9110
+19947,9802,8824,46.0,,9110
+19947,9802,8826,400000.0,,9001
+19947,9802,8827,400000.0,,9001
+19948,9801,8801,34.39,,9110
+19948,9801,8802,37.21,,9110
+19948,9801,8805,0.9996256,,9201
+19948,9801,8806,300000.0,,9001
+19948,9801,8807,300000.0,,9001
+19949,9809,8801,38.0,,9105
+19949,9809,8802,43.5,,9105
+19949,9809,8805,0.9995341,,9201
+19949,9809,8806,0.0,,9001
+19949,9809,8807,0.0,,9001
+19950,9815,8811,46.570866,,9110
+19950,9815,8812,7.26225,,9110
+19950,9815,8813,90.0,,9110
+19950,9815,8814,90.0,,9110
+19950,9815,8815,1.0,,9201
+19950,9815,8816,2600000.0,,9001
+19950,9815,8817,1200000.0,,9001
+19951,9815,8811,27.31077837,,9110
+19951,9815,8812,52.3612741,,9110
+19951,9815,8813,0.34179803,,9110
+19951,9815,8814,0.34179803,,9110
+19951,9815,8815,0.999895934,,9201
+19951,9815,8816,658377.437,,9001
+19951,9815,8817,3044969.194,,9001
+19952,9819,8811,49.3,,9110
+19952,9819,8812,42.3,,9110
+19952,9819,8813,30.1717303,,9110
+19952,9819,8816,0.0,,9001
+19952,9819,8817,0.0,,9001
+19952,9819,8818,78.3,,9110
+19952,9819,8819,0.9999,,9201
+19953,9806,8801,25.22565,,9110
+19953,9806,8802,50.4541,,9110
+19953,9806,8806,100000.0,,9001
+19953,9806,8807,100000.0,,9001
+19954,9807,8801,0.0,,9110
+19954,9807,8802,-55.41,,9110
+19954,9807,8805,0.9996,,9201
+19954,9807,8806,500000.0,,9001
+19954,9807,8807,0.0,,9001
+19955,9807,8801,0.0,,9110
+19955,9807,8802,-55.41,,9110
+19955,9807,8805,0.9999,,9201
+19955,9807,8806,500000.0,,9001
+19955,9807,8807,0.0,,9001
+19956,9815,8811,4.0,,9110
+19956,9815,8812,115.0,,9110
+19956,9815,8813,53.18569537,,9110
+19956,9815,8814,53.07483685,,9110
+19956,9815,8815,0.99984,,9201
+19956,9815,8816,29352.4763,,9042
+19956,9815,8817,22014.3572,,9042
+19957,9815,8811,4.0,,9110
+19957,9815,8812,115.0,,9110
+19957,9815,8813,53.18569537,,9110
+19957,9815,8814,53.07483685,,9110
+19957,9815,8815,0.99984,,9201
+19957,9815,8816,1937263.44,,9041
+19957,9815,8817,1452947.58,,9041
+19958,9815,8811,4.0,,9110
+19958,9815,8812,115.0,,9110
+19958,9815,8813,53.18569537,,9110
+19958,9815,8814,53.07483685,,9110
+19958,9815,8815,0.99984,,9201
+19958,9815,8816,590476.87,,9001
+19958,9815,8817,442857.65,,9001
+19959,9807,8801,4.4,,9110
+19959,9807,8802,-1.0,,9110
+19959,9807,8805,0.99975,,9201
+19959,9807,8806,900000.0,,9094
+19959,9807,8807,0.0,,9094
+19960,9809,8801,47.15,,9110
+19960,9809,8802,-63.0,,9110
+19960,9809,8805,0.999912,,9201
+19960,9809,8806,400000.0,,9001
+19960,9809,8807,800000.0,,9001
+19961,9802,8821,90.0,,9110
+19961,9802,8822,4.2202952,,9110
+19961,9802,8823,51.100000204,,9110
+19961,9802,8824,49.500000204,,9110
+19961,9802,8826,150000.013,,9001
+19961,9802,8827,5400088.438,,9001
+19962,9807,8801,53.3,,9110
+19962,9807,8802,-8.0,,9110
+19962,9807,8805,0.99982,,9201
+19962,9807,8806,600000.0,,9001
+19962,9807,8807,750000.0,,9001
+19963,9807,8801,6.4,,9110
+19963,9807,8802,-12.0,,9110
+19963,9807,8805,1.0,,9201
+19963,9807,8806,500000.0,,9094
+19963,9807,8807,0.0,,9094
+19964,9807,8801,6.4,,9110
+19964,9807,8802,-12.0,,9110
+19964,9807,8805,1.0,,9201
+19964,9807,8806,800000.0,,9094
+19964,9807,8807,600000.0,,9094
+19965,9821,8806,0.0,,9001
+19965,9821,8807,0.0,,9001
+19965,9821,8828,45.0,,9102
+19965,9821,8829,-100.0,,9102
+19966,9807,8801,49.5,,9110
+19966,9807,8802,6.1,,9110
+19966,9807,8805,1.0,,9201
+19966,9807,8806,80000.0,,9001
+19966,9807,8807,100000.0,,9001
+19967,9807,8801,0.0,,9110
+19967,9807,8802,15.0,,9110
+19967,9807,8805,0.9999,,9201
+19967,9807,8806,500000.0,,9001
+19967,9807,8807,0.0,,9001
+19968,9823,8801,0.0,,9102
+19968,9823,8802,0.0,,9102
+19969,9807,8801,39.4,,9110
+19969,9807,8802,1.0,,9110
+19969,9807,8805,1.0,,9201
+19969,9807,8806,0.0,,9001
+19969,9807,8807,0.0,,9001
+19971,9807,8801,0.0,,9102
+19971,9807,8802,173.0,,9102
+19971,9807,8805,0.9996,,9201
+19971,9807,8806,1600000.0,,9001
+19971,9807,8807,10000000.0,,9001
+19972,9807,8801,53.3,,9110
+19972,9807,8802,-8.0,,9110
+19972,9807,8805,1.000035,,9201
+19972,9807,8806,200000.0,,9001
+19972,9807,8807,250000.0,,9001
+19973,9807,8801,53.3,,9110
+19973,9807,8802,-8.0,,9110
+19973,9807,8805,1.0,,9201
+19973,9807,8806,200000.0,,9001
+19973,9807,8807,250000.0,,9001
+19974,9807,8801,39.4,,9110
+19974,9807,8802,-8.0754862,,9110
+19974,9807,8805,1.0,,9201
+19974,9807,8806,180.598,,9001
+19974,9807,8807,-86.99,,9001
+19975,9806,8801,10.263,,9110
+19975,9806,8802,-61.2,,9110
+19975,9806,8806,283800.0,,9005
+19975,9806,8807,214500.0,,9005
+19976,9802,8821,6.0,,9102
+19976,9802,8822,-66.0,,9102
+19976,9802,8823,9.0,,9102
+19976,9802,8824,3.0,,9102
+19976,9802,8826,1000000.0,,9001
+19976,9802,8827,1000000.0,,9001
+19977,9802,8821,25.0522236,,9110
+19977,9802,8822,48.0,,9102
+19977,9802,8823,17.0,,9102
+19977,9802,8824,33.0,,9102
+19977,9802,8826,0.0,,9001
+19977,9802,8827,0.0,,9001
+19978,9807,8801,22.184368,,9110
+19978,9807,8802,114.10428,,9110
+19978,9807,8805,1.0,,9201
+19978,9807,8806,836694.05,,9001
+19978,9807,8807,819069.8,,9001
+19979,9828,8801,39.4,,9110
+19979,9828,8802,1.0,,9110
+19979,9828,8806,0.0,,9001
+19979,9828,8807,0.0,,9001
diff --git a/src/tiff/csv/coordinate_operation_path.csv b/src/tiff/csv/coordinate_operation_path.csv
new file mode 100644
index 0000000..89d46e4
--- /dev/null
+++ b/src/tiff/csv/coordinate_operation_path.csv
@@ -0,0 +1,336 @@
+"CONCAT_OPERATION_CODE","SINGLE_OPERATION_CODE","OP_PATH_STEP"
+8046,1025,1
+8046,1146,2
+8047,1146,2
+8047,1147,1
+8094,1193,2
+8094,1763,1
+8174,1125,2
+8174,1755,1
+8175,1169,2
+8175,1262,1
+8176,1227,2
+8176,1265,1
+8178,1123,2
+8178,1759,1
+8183,1149,2
+8183,1273,1
+8186,1276,2
+8186,1763,1
+8188,1277,2
+8188,1763,1
+8190,1150,2
+8190,1278,1
+8192,1150,2
+8192,1279,1
+8194,1150,2
+8194,1280,1
+8195,1149,2
+8195,1437,1
+8199,1274,1
+8199,1283,2
+8211,1266,1
+8211,1294,2
+8215,1297,1
+8215,1302,2
+8217,1298,1
+8217,1302,2
+8219,1299,1
+8219,1302,2
+8221,1300,1
+8221,1302,2
+8223,1301,1
+8223,1302,2
+8234,1149,2
+8234,1309,1
+8236,1149,2
+8236,1310,1
+8241,1026,1
+8241,1145,2
+8243,1188,2
+8243,1312,1
+8245,1188,2
+8245,1313,1
+8263,1306,2
+8263,1757,1
+8386,1188,2
+8386,1454,1
+8388,1188,2
+8388,1455,1
+8390,1188,2
+8390,1456,1
+8392,1188,2
+8392,1457,1
+8394,1188,2
+8394,1451,1
+8396,1150,2
+8396,1458,1
+8398,1150,2
+8398,1459,1
+8400,1150,2
+8400,1460,1
+8402,1188,2
+8402,1461,1
+8404,1188,2
+8404,1462,1
+8406,1188,2
+8406,1463,1
+8408,1150,2
+8408,1464,1
+8418,1472,1
+8418,1473,2
+8419,1473,2
+8419,1599,1
+8420,1473,2
+8420,1600,1
+8421,1473,2
+8421,1601,1
+8422,1473,2
+8422,1602,1
+8453,1150,2
+8453,1506,1
+8454,1150,2
+8454,1507,1
+8457,1509,1
+8457,1511,2
+8460,1241,1
+8460,1474,2
+8461,1241,1
+8461,1475,2
+8462,1241,1
+8462,1476,2
+8463,1241,1
+8463,1477,2
+8464,1241,1
+8464,1478,2
+8465,1241,1
+8465,1479,2
+8466,1241,1
+8466,1480,2
+8467,1241,1
+8467,1481,2
+8468,1241,1
+8468,1482,2
+8469,1241,1
+8469,1483,2
+8470,1241,1
+8470,1484,2
+8471,1241,1
+8471,1485,2
+8472,1241,1
+8472,1486,2
+8473,1241,1
+8473,1487,2
+8474,1241,1
+8474,1488,2
+8475,1241,1
+8475,1489,2
+8476,1241,1
+8476,1490,2
+8477,1241,1
+8477,1491,2
+8478,1241,1
+8478,1492,2
+8479,1241,1
+8479,1493,2
+8480,1241,1
+8480,1494,2
+8481,1241,1
+8481,1495,2
+8482,1496,2
+8482,1747,1
+8483,1241,1
+8483,1497,2
+8484,1241,1
+8484,1498,2
+8485,1241,1
+8485,1499,2
+8486,1241,1
+8486,1500,2
+8487,1241,1
+8487,1501,2
+8488,1241,1
+8488,1502,2
+8489,1241,1
+8489,1503,2
+8496,1241,1
+8496,1515,2
+8497,1243,1
+8497,1515,2
+8508,1454,1
+8508,1520,2
+8509,1241,1
+8509,1521,2
+8510,1241,1
+8510,1522,2
+8511,1241,1
+8511,1523,2
+8512,1241,1
+8512,1524,2
+8513,1241,1
+8513,1525,2
+8514,1241,1
+8514,1526,2
+8517,1527,2
+8517,1528,1
+8530,1539,1
+8530,1540,2
+8532,1240,2
+8532,1541,1
+8537,1237,2
+8537,1545,1
+8553,1241,1
+8553,1553,2
+8554,1241,1
+8554,1554,2
+8560,1150,2
+8560,1559,1
+8562,1240,2
+8562,1560,1
+8563,1565,2
+8563,1568,1
+8564,1473,2
+8564,1576,1
+8565,1188,2
+8565,1574,1
+8566,1188,2
+8566,1572,1
+8567,1036,1
+8567,1149,2
+8568,1240,2
+8568,1584,1
+8569,1149,2
+8569,1588,1
+8570,1025,1
+8570,1146,2
+8570,1149,3
+8571,1240,2
+8571,1570,1
+8572,1149,2
+8572,1571,1
+8573,1149,2
+8573,1591,1
+8574,1578,1
+8574,1580,2
+8575,1579,1
+8575,1580,2
+8576,1150,2
+8576,1594,1
+8577,1150,2
+8577,1595,1
+8578,1150,2
+8578,1596,1
+8579,1150,2
+8579,1593,1
+8580,1149,2
+8580,1611,1
+8581,1237,2
+8581,1616,1
+8582,1454,1
+8582,1741,2
+8583,1461,1
+8583,1731,2
+8584,1313,1
+8584,1752,2
+8585,1313,1
+8585,1702,2
+8586,1241,1
+8586,1704,2
+8587,1241,1
+8587,1705,2
+8588,1241,1
+8588,1706,2
+8589,1241,1
+8589,1707,2
+8590,1241,1
+8590,1717,2
+8591,1241,1
+8591,1728,2
+8592,1241,1
+8592,1708,2
+8593,1241,1
+8593,1739,2
+8594,1241,1
+8594,1750,2
+8595,1241,1
+8595,1712,2
+8596,1241,1
+8596,1714,2
+8597,1241,1
+8597,1713,2
+8598,1241,1
+8598,1748,2
+8599,1241,1
+8599,1742,2
+8600,1241,1
+8600,1709,2
+8601,1241,1
+8601,1743,2
+8602,1241,1
+8602,1718,2
+8603,1241,1
+8603,1719,2
+8604,1241,1
+8604,1721,2
+8605,1241,1
+8605,1720,2
+8606,1241,1
+8606,1725,2
+8607,1241,1
+8607,1722,2
+8608,1241,1
+8608,1710,2
+8609,1241,1
+8609,1723,2
+8610,1241,1
+8610,1711,2
+8611,1241,1
+8611,1715,2
+8612,1241,1
+8612,1716,2
+8613,1241,1
+8613,1724,2
+8614,1241,1
+8614,1744,2
+8615,1241,1
+8615,1749,2
+8616,1241,1
+8616,1726,2
+8617,1241,1
+8617,1727,2
+8618,1241,1
+8618,1729,2
+8619,1241,1
+8619,1745,2
+8620,1241,1
+8620,1730,2
+8621,1241,1
+8621,1737,2
+8622,1241,1
+8622,1732,2
+8623,1241,1
+8623,1733,2
+8624,1241,1
+8624,1734,2
+8625,1241,1
+8625,1735,2
+8626,1241,1
+8626,1746,2
+8627,1241,1
+8627,1736,2
+8628,1241,1
+8628,1747,2
+8629,1241,1
+8629,1738,2
+8630,1241,1
+8630,1740,2
+8631,1240,2
+8631,1805,1
+8632,1240,2
+8632,1806,1
+8633,1238,2
+8633,1828,1
+8634,1240,2
+8634,1839,1
+8635,1313,1
+8635,1849,2
diff --git a/src/tiff/csv/coordinate_reference_system.csv b/src/tiff/csv/coordinate_reference_system.csv
new file mode 100644
index 0000000..0318fb6
--- /dev/null
+++ b/src/tiff/csv/coordinate_reference_system.csv
@@ -0,0 +1,2609 @@
+"COORD_REF_SYS_CODE","COORD_REF_SYS_NAME","AREA_OF_USE_CODE","COORD_REF_SYS_KIND","COORD_SYS_CODE","DATUM_CODE","SOURCE_GEOGCRS_CODE","PROJECTION_CONV_CODE","CMPD_HORIZCRS_CODE","CMPD_VERTCRS_CODE","CRS_SCOPE","REMARKS","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","SHOW_CRS","DEPRECATED"
+2100,GGRS87 / Greek Grid,1106,projected,4400,,4121,19930,,,Large and medium scale topographic mapping and engineering survey.,Oil industry uses ED50 / UTM zone 34N and ED50 / UTM zone 35N.,Geodesy Department; Public Petroleum Corporation of Greece.,EPSG,1997-06-16 00:00:00,,1,0
+2101,Lake / Maracaibo Grid M1,1319,projected,4499,,4249,18260,,,Oil exploration.,Grid coordinates are (0 0) at Maracaibo Cathedral (10deg 38min 34.678sec N; 71deg 36min 20.224sec W; Lake datum).   Used by Creole; MGO and Sun.,Various oil company sources.,EPSG,2000-06-10 00:00:00,,1,0
+2102,Lake / Maracaibo Grid,1319,projected,4499,,4249,18261,,,Oil exploration.,Grid coordinates are (200000 200000) at Maracaibo Cathedral (10deg 38min 34.678sec N; 71deg 36min 20.224sec W; Lake datum).  Used for Lake triangulation coordinate listing.,Various oil company sources.,EPSG,2000-06-10 00:00:00,,1,0
+2103,Lake / Maracaibo Grid M3,1319,projected,4499,,4249,18262,,,Oil exploration.,Grid coordinates are (500000 500000) at Maracaibo Cathedral (10deg 38min 34.678sec N; 71deg 36min 20.224sec W; Lake datum).  Used by Varco.,Various oil company sources.,EPSG,2000-06-10 00:00:00,,1,0
+2104,Lake / Maracaibo La Rosa Grid,1499,projected,4499,,4249,18263,,,Oil exploration.,"Grid coordinates are (X=-17044 Y=29545) at Maracaibo Cathedral (10deg 38min 34.678sec N; 71deg 36min 20.224sec W; Lake datum).
+Do not confuse with the La Rosa grid used in the Cabinas area (code 5810).",Various oil company sources.,EPSG,2000-06-23 00:00:00,,1,0
+2105,NZGD2000 / Mount Eden Circuit 2000,1500,projected,4500,,4167,17931,,,Cadastral surveys.,Superseded NZGD49 / Mount Eden Circuit 2000 (code 27205) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2106,NZGD2000 / Bay of Plenty Circuit 2000,1500,projected,4500,,4167,17932,,,Cadastral surveys.,Superseded NZGD49 / Bay of Plenty Circuit 2000 (code 27206) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2107,NZGD2000 / Poverty Bay Circuit 2000,1500,projected,4500,,4167,17933,,,Cadastral surveys.,Superseded NZGD49 / Poverty Bay 2000 (code 27207) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2108,NZGD2000 / Hawkes Bay Circuit 2000,1500,projected,4500,,4167,17934,,,Cadastral surveys.,Superseded NZGD49 / Hawkes Bay Circuit 2000 (code 27208) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2109,NZGD2000 / Taranaki Circuit 2000,1500,projected,4500,,4167,17935,,,Cadastral surveys.,Superseded NZGD49 / Taranaki Circuit 2000 (code 27209) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2110,NZGD2000 / Tuhirangi Circuit 2000,1500,projected,4500,,4167,17936,,,Cadastral surveys.,Superseded NZGD49 / Tuhirangi Circuit 2000 (code 27210) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2111,NZGD2000 / Wanganui Circuit 2000,1500,projected,4500,,4167,17937,,,Cadastral surveys.,Superseded NZGD49 / Wanganui Circuit 2000 (code 27211) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2112,NZGD2000 / Wairarapa Circuit 2000,1500,projected,4500,,4167,17938,,,Cadastral surveys.,Superseded NZGD49 / Wairarapa Circuit 2000 (code 27212) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2113,NZGD2000 / Wellington Circuit 2000,1500,projected,4500,,4167,17939,,,Cadastral surveys.,Superseded NZGD49 / Wellington Circuit 2000 (code 27213) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2114,NZGD2000 / Collingwood Circuit 2000,1501,projected,4500,,4167,17940,,,Cadastral surveys.,Superseded NZGD49 / Collingwood Circuit 2000 (code 27214) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2115,NZGD2000 / Nelson Circuit 2000,1501,projected,4500,,4167,17941,,,Cadastral surveys.,Superseded NZGD49 / Nelson Circuit 2000 (code 27215) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2116,NZGD2000 / Karamea Circuit 2000,1501,projected,4500,,4167,17942,,,Cadastral surveys.,Superseded NZGD49 / Karamea Circuit 2000 (code 27216) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2117,NZGD2000 / Buller Circuit 2000,1501,projected,4500,,4167,17943,,,Cadastral surveys.,Superseded NZGD49 / Buller Circuit 2000 (code 27217) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2118,NZGD2000 / Grey Circuit 2000,1501,projected,4500,,4167,17944,,,Cadastral surveys.,Superseded NZGD49 / Grey Circuit 2000 (code 27218) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2119,NZGD2000 / Amuri Circuit 2000,1501,projected,4500,,4167,17945,,,Cadastral surveys.,Superseded NZGD49 / Amuri Circuit 2000 (code 27219) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2120,NZGD2000 / Marlborough Circuit 2000,1501,projected,4500,,4167,17946,,,Cadastral surveys.,Superseded NZGD49 / Marlborough Circuit 2000 (code 27220) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2121,NZGD2000 / Hokitika Circuit 2000,1501,projected,4500,,4167,17947,,,Cadastral surveys.,Superseded NZGD49 / Hokitika Circuit 2000 (code 27221) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2122,NZGD2000 / Okarito Circuit 2000,1501,projected,4500,,4167,17948,,,Cadastral surveys.,Superseded NZGD49 / Okarito Circuit 2000 (code 27222) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2123,NZGD2000 / Jacksons Bay Circuit 2000,1501,projected,4500,,4167,17949,,,Cadastral surveys.,Superseded NZGD49 / Jacksons Bay Circuit 2000 (code 27223) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2124,NZGD2000 / Mount Pleasant Circuit 2000,1501,projected,4500,,4167,17950,,,Cadastral surveys.,Superseded NZGD49 / Mount Pleasant Circuit 2000 (code 27224) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2125,NZGD2000 / Gawler Circuit 2000,1501,projected,4500,,4167,17951,,,Cadastral surveys.,Superseded NZGD49 / Gawler Circuit 2000 (code 27225) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2126,NZGD2000 / Timaru Circuit 2000,1501,projected,4500,,4167,17952,,,Cadastral surveys.,Superseded NZGD49 / Timaru Circuit 2000 (code 27226) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2127,NZGD2000 / Lindis Peak Circuit 2000,1501,projected,4500,,4167,17953,,,Cadastral surveys.,Superseded NZGD49 / Lindis Peak Circuit 2000 (code 27227) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2128,NZGD2000 / Mount Nicholas Circuit 2000,1501,projected,4500,,4167,17954,,,Cadastral surveys.,Superseded NZGD49 / Mount Nicholas Circuit 2000 (code 27228) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2129,NZGD2000 / Mount York Circuit 2000,1501,projected,4500,,4167,17955,,,Cadastral surveys.,Superseded NZGD49 / Mount York Circuit 2000 (code 27229) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2130,NZGD2000 / Observation Point Circuit 2000,1501,projected,4500,,4167,17956,,,Cadastral surveys.,Superseded NZGD49 / Observation Point Circuit 2000 (code 27230) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2131,NZGD2000 / North Taieri Circuit 2000,1501,projected,4500,,4167,17957,,,Cadastral surveys.,Superseded NZGD49 / North Taieri Circuit 2000 (code 27231) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2132,NZGD2000 / Bluff Circuit 2000,1501,projected,4500,,4167,17958,,,Cadastral surveys.,Superseded NZGD49 / Bluff Circuit 2000 (code 27232) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+2133,NZGD2000 / UTM zone 58S,1502,projected,4400,,4167,16158,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NZGD49 / UTM zone 58S (code 27258) from March 2000.,,EPSG,2000-10-19 00:00:00,,1,0
+2134,NZGD2000 / UTM zone 59S,1503,projected,4400,,4167,16159,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NZGD49 / UTM zone 59S (code 27259) from March 2000.,,EPSG,2000-10-19 00:00:00,,1,0
+2135,NZGD2000 / UTM zone 60S,1504,projected,4400,,4167,16160,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NZGD49 / UTM zone 60S (code 27260) from March 2000.,,EPSG,2000-10-19 00:00:00,,1,0
+2136,Accra / Ghana National Grid,1104,projected,4404,,4168,19959,,,Large and medium scale topographic mapping and engineering survey.,"Ellipsoid semi-major axis (a)=20926201 Gold Coast feet.  ProjCRS sometimes found in metric form: 1 Gold Coast foot = 0.3047997101815 m.
+Superseded by Leigon / Ghana Metric Grid from 1978.",Ordnance Survey International,EPSG,2000-10-19 00:00:00,,1,0
+2137,Accra / TM 1 NW,1505,projected,4400,,4168,17001,,,Oil exploration.,,Various oil industry sources,EPSG,2000-10-19 00:00:00,,1,0
+2138,NAD27(CGQ77) / Quebec Lambert,1368,projected,4499,,4609,19944,,,Medium and small scale mapping.,Superseded NAD27 / Quebec Lambert (code 32098) in 1977.,Service de la Cartographie; Minist�re des Ressources Naturelles; Quebec,EPSG,2000-10-19 00:00:00,,1,0
+2139,NAD83(CSRS98) / SCoPQ zone 2,1420,projected,4499,,4140,17700,,,Large and medium scale topographic mapping and engineering survey.,,Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2000-10-19 00:00:00,,1,1
+2140,NAD83(CSRS98) / MTM zone 3,1421,projected,4496,,4140,17703,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 3"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2000-10-19 00:00:00,,1,1
+2141,NAD83(CSRS98) / MTM zone 4,1422,projected,4496,,4140,17704,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 4"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2000-10-19 00:00:00,,1,1
+2142,NAD83(CSRS98) / MTM zone 5,1423,projected,4496,,4140,17705,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 5"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2000-10-19 00:00:00,,1,1
+2143,NAD83(CSRS98) / MTM zone 6,1424,projected,4496,,4140,17706,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 6"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2000-10-19 00:00:00,,1,1
+2144,NAD83(CSRS98) / MTM zone 7,1425,projected,4496,,4140,17707,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 7"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2000-10-19 00:00:00,,1,1
+2145,NAD83(CSRS98) / MTM zone 8,1426,projected,4496,,4140,17708,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 8"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2000-10-19 00:00:00,,1,1
+2146,NAD83(CSRS98) / MTM zone 9,1427,projected,4496,,4140,17709,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 9"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2000-10-19 00:00:00,,1,1
+2147,NAD83(CSRS98) / MTM zone 10,1428,projected,4496,,4140,17710,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 10"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2000-10-19 00:00:00,,1,1
+2148,NAD83(CSRS98) / UTM zone 21N,1446,projected,4400,,4140,16021,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2000-10-19 00:00:00,,1,1
+2149,NAD83(CSRS98) / UTM zone 18N,1443,projected,4400,,4140,16018,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2000-10-19 00:00:00,,1,1
+2150,NAD83(CSRS98) / UTM zone 17N,1428,projected,4400,,4140,16017,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2000-10-19 00:00:00,,1,1
+2151,NAD83(CSRS98) / UTM zone 13N,1506,projected,4400,,4140,16013,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2000-10-19 00:00:00,,1,1
+2152,NAD83(CSRS98) / UTM zone 12N,1507,projected,4400,,4140,16012,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2000-10-19 00:00:00,,1,1
+2153,NAD83(CSRS98) / UTM zone 11N,1508,projected,4400,,4140,16011,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2000-10-19 00:00:00,,1,1
+2154,RGF93 / Lambert-93,1326,projected,4499,,4171,18085,,,Large and medium scale topographic mapping and engineering survey.,,IGN - Paris,EPSG,2000-10-19 00:00:00,,1,0
+2155,American Samoa 1962 / American Samoa Lambert,1027,projected,4497,,4169,15300,,,Large and medium scale topographic mapping and engineering survey.,Superseded by projCRS 2156 as of mid-2000.,US National Geodetic Survey (NGS)  http://www.ngs.noaa.gov/,EPSG,2000-10-19 00:00:00,,1,1
+2156,NAD83(HARN) / UTM zone 59S,1027,projected,4400,,4152,16159,,,Large and medium scale topographic mapping and engineering survey.,Supersedes projCRS 2155; effective in 2000.    Deprecated due to error in projection and replaced by code 2195.,US National Geodetic Survey (NGS)  http://www.ngs.noaa.gov/,EPSG,2000-10-19 00:00:00,,1,1
+2157,IRENET95 / Irish Transverse Mercator,1305,projected,4400,,4173,19962,,,Large and medium scale topographic mapping and engineering survey.,Supersedes TM75 / Irish Grid (code 29903) from 1/1/2001.,Ordnance Survey of Ireland,EPSG,2000-10-19 00:00:00,,1,0
+2158,IRENET95 / UTM zone 29N,1305,projected,4400,,4173,16029,,,Large and medium scale topographic mapping and engineering survey.,,Ordnance Survey of Ireland,EPSG,2000-10-19 00:00:00,,1,0
+2159,Sierra Leone 1924 / New Colony Grid,1342,projected,4404,,4174,19963,,,Topographic mapping and engineering survey.,Supersedes the Sierra Leone 1924 / Colony Grid. New grid is 422.3 ft west and 112.1 ft south of old grid.  Ellipsoid semi-major axis (a)=20926201 Gold Coast feet; 1 Gold Coast foot = 0.3047997101815 m.,Ordnance Survey International,EPSG,2001-06-05 00:00:00,,1,0
+2160,Sierra Leone 1924 / New War Office Grid,1342,projected,4404,,4174,19964,,,Topographic mapping,Supersedes the Sierra Leone War Office Grid. New grid is 422.3 ft west and 112.1 ft south of old grid. Ellipsoid semi-major axis (a)=20926201 Gold Coast feet; 1 Gold Coast foot = 0.3047997101815 m.,Ordnance Survey International,EPSG,2001-06-05 00:00:00,,1,0
+2161,Sierra Leone 1968 / UTM zone 28N,1509,projected,4400,,4175,16028,,,Topographic mapping and engineering survey.,Supersedes Sierra Leone 1960 / UTM zone 28N.  The 1968 readjustment coordinates are within 3m of the 1960 provisional adjustment.,Ordnance Survey International,EPSG,2001-06-05 00:00:00,,1,0
+2162,Sierra Leone 1968 / UTM zone 29N,1510,projected,4400,,4175,16029,,,Topographic mapping and engineering survey.,Supersedes Sierra Leone 1960 / UTM zone 29N.  The 1968 readjustment coordinates are within 3m of the 1960 provisional adjustment.,Ordnance Survey International,EPSG,2001-06-05 00:00:00,,1,0
+2163,US National Atlas Equal Area,1245,projected,4499,,4047,19965,,,For small scale (1:1million and smaller) statistical mapping.,Uses spherical projection formulae.  USGS describe geogCRS as NAD83 but this would require ellipsoidal projection formulae.,"United States Geological Survey, Western Geographic Science Center",EPSG,2001-06-05 00:00:00,,1,0
+2164,Locodjo 1965 / TM 5 NW,2296,projected,4400,,4142,17005,,,Oil industry use.,,Various oil industry sources,EPSG,2001-06-05 00:00:00,,1,0
+2165,Abidjan 1987 / TM 5 NW,2296,projected,4400,,4143,17005,,,Oil Industry,,Various oil industry sources,EPSG,2001-06-05 00:00:00,,1,0
+2166,Pulkovo 1942(83) / Gauss Kruger zone 3,1512,projected,4530,,4178,16263,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.",In Thuringen superseded by DHDN / Gauss Kruger zone 3.,EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,1
+2167,Pulkovo 1942(83) / Gauss Kruger zone 4,1513,projected,4530,,4178,16264,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.","In Brandenburg superseded by ETRS89 / UTM zone 33N. 
+In Sachsen and Thuringen superseded by DHDN / Gauss Kruger zone 4.",Bundesamt f�r Kartographie und Geod�sie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,1
+2168,Pulkovo 1942(83) / Gauss Kruger zone 5,1512,projected,4530,,4178,16265,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.","In Brandenburg superseded by ETRS89 / UTM zone 33N. 
+In Sachsen superseded by DHDN / Gauss Kruger zone 5.",Bundesamt f�r Kartographie und Geod�sie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,1
+2169,Luxembourg 1930 / Gauss,1146,projected,4530,,4181,19966,,,Large and medium scale topographic mapping and engineering survey.,,Administration du Cadastre et de la Topographie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2170,MGI / Slovenia Grid,1212,projected,4530,,4312,19967,,,Large and medium scale topographic mapping and engineering survey.,Truncated form of MGI / Balkans zone 5 (code 31275).,,EPSG,2001-06-05 00:00:00,,1,0
+2171,Pulkovo 1942(58) / Poland zone I,1515,projected,4530,,4179,18281,,,Large and medium scale topographic mapping and engineering survey.,To be phased out after 2009. Superseded by ETRS89 / Poland CS2000 zones 7 and 8 (codes 2178-79).,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2172,Pulkovo 1942(58) / Poland zone II,1516,projected,4530,,4179,18282,,,Large and medium scale topographic mapping and engineering survey.,To be phased out after 2009. Superseded by ETRS89 / Poland CS2000 zones 7 and 8 (codes 2178-79).,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2173,Pulkovo 1942(58) / Poland zone III,1517,projected,4530,,4179,18283,,,Large and medium scale topographic mapping and engineering survey.,To be phased out after 2009. Superseded by ETRS89 / Poland CS2000 zones 5 and 6 (codes 2176-77).,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2174,Pulkovo 1942(58) / Poland zone IV,1518,projected,4530,,4179,18284,,,Large and medium scale topographic mapping and engineering survey.,To be phased out after 2009. Superseded by ETRS89 / Poland CS2000 zones 5 and 6 (codes 2176-77).,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2175,Pulkovo 1942(58) / Poland zone V,1519,projected,4530,,4179,18285,,,Large and medium scale topographic mapping and engineering survey.,To be phased out after 2009. Superseded by ETRS89 / Poland CS2000 zone 6 (code 2177).,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2176,ETRS89 / Poland CS2000 zone 5,1520,projected,4531,,4258,18305,,,"Large (1:5,000 and greater) scale topographic mapping and cadastral survey.",See ETRS89 / Poland CS92 (code 2170) for smaller scale mapping.,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2177,ETRS89 / Poland CS2000 zone 6,1521,projected,4531,,4258,18306,,,"Large (1:5,000 and greater) scale topographic mapping and cadastral survey.",See ETRS89 / Poland CS92 (code 2170) for smaller scale mapping.,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2178,ETRS89 / Poland CS2000 zone 7,1522,projected,4531,,4258,18307,,,"Large (1:5,000 and greater) scale topographic mapping and cadastral survey.",See ETRS89 / Poland CS92 (code 2170) for smaller scale mapping.,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2179,ETRS89 / Poland CS2000 zone 8,1523,projected,4531,,4258,18308,,,"Large (1:5,000 and greater) scale topographic mapping and cadastral survey.",See ETRS89 / Poland CS92 (code 2170) for smaller scale mapping.,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2180,ETRS89 / Poland CS92,1192,projected,4531,,4258,18300,,,"Medium and small scale topographic mapping (1:10,000 and smaller).",See ETRS89 / Poland CS2000 zones 5- 8 (codes 2176-79) for large scale purposes.,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2188,Azores Occidental 1939 / UTM zone 25N,1344,projected,4400,,4182,16025,,,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2189,Azores Central 1948 / UTM zone 26N,1301,projected,4400,,4183,16026,,,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2190,Azores Oriental 1940 / UTM zone 26N,1345,projected,4400,,4184,16026,,,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2191,Madeira 1936 / UTM zone 28N,1314,projected,4400,,4185,16028,,,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,1
+2192,ED50 / France EuroLambert,1326,projected,4499,,4230,18086,,,Medium scale topographic and statistical mapping.,,IGN Paris via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+2193,NZGD2000 / New Zealand Transverse Mercator,1175,projected,4500,,4167,19971,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NZGD49 / New Zealand Map Grid (code 27200) from July 2001.,Shell Todd Oil Services.,EPSG,2001-08-28 00:00:00,,1,0
+2194,American Samoa 1962 / American Samoa Lambert,1027,projected,4497,,4169,15301,,,Large and medium scale topographic mapping and engineering survey.,Superseded by projCRS 2156 as of mid-2000.,US National Geodetic Survey (NGS)  http://www.ngs.noaa.gov/,EPSG,2001-08-28 00:00:00,,1,0
+2195,NAD83(HARN) / UTM zone 2S,1027,projected,4400,,4152,16102,,,Large and medium scale topographic mapping and engineering survey.,Supersedes projCRS 2194; effective in 2000,US National Geodetic Survey (NGS)  http://www.ngs.noaa.gov/,EPSG,2001-08-28 00:00:00,,1,0
+2196,ETRS89 / Kp2000 Jutland,2531,projected,4400,,4258,18401,,,"Large and scale topographic mapping, cadastral and engineering survey.  Note: for medium scale topographic mapping ETRS89 / UTM zone 32N (code 25832) is used.",Supersedes System 34 Jutland zone.,Kort & Matrikelstyrelsen,EPSG,2001-11-06 00:00:00,,1,0
+2197,ETRS89 / Kp2000 Zealand,2532,projected,4400,,4258,18402,,,"Large and scale topographic mapping, cadastral and engineering survey.  Note: for medium scale topographic mapping ETRS89 / UTM zone 32N (code 25832) is used.",Supersedes System 34 Zealand zone.,Kort & Matrikelstyrelsen,EPSG,2001-11-06 00:00:00,,1,0
+2198,ETRS89 / Kp2000 Bornholm,2533,projected,4400,,4258,18403,,,"Large and scale topographic mapping, cadastral and engineering survey.  Note: for medium scale topographic mapping ETRS89 / UTM zone 33N (code 25833) is used.",Supersedes System 45.,Kort & Matrikelstyrelsen,EPSG,2001-11-06 00:00:00,,1,0
+2199,Albanian 1987 / Gauss Kruger zone 4,1025,projected,4530,,4191,16204,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.",,EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,1
+2200,ATS77 / New Brunswick Stereographic (ATS77),1447,projected,4500,,4122,19945,,,Large and medium scale topographic mapping and engineering survey.,In use from 1979.  To be phased out in late 1990's.,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,1999-10-20 00:00:00,99.61,1,0
+2201,REGVEN / UTM zone 18N,1693,projected,4400,,4189,16018,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2001-11-06 00:00:00,,1,0
+2000,Anguilla 1957 / British West Indies Grid,1030,projected,4400,,4600,19942,,,Large and medium scale topographic mapping and engineering survey.,,Ordnance Survey of Great Britain,EPSG,2000-03-07 00:00:00,99.74,1,0
+2001,Antigua 1943 / British West Indies Grid,1273,projected,4400,,4601,19942,,,Large and medium scale topographic mapping and engineering survey.,,Ordnance Survey of Great Britain,EPSG,2000-03-07 00:00:00,99.74,1,0
+2002,Dominica 1945 / British West Indies Grid,1082,projected,4400,,4602,19942,,,Large and medium scale topographic mapping and engineering survey.,,Ordnance Survey of Great Britain,EPSG,2000-03-07 00:00:00,99.74,1,0
+2003,Grenada 1953 / British West Indies Grid,1551,projected,4400,,4603,19942,,,Large and medium scale topographic mapping and engineering survey.,,Ordnance Survey of Great Britain,EPSG,2000-03-07 00:00:00,99.74,1,0
+2004,Montserrat 58 / British West Indies Grid,1165,projected,4400,,4604,19942,,,Large and medium scale topographic mapping and engineering survey.,,Ordnance Survey of Great Britain,EPSG,2000-03-07 00:00:00,99.74,1,0
+2005,St Kitts 1955 / British West Indies Grid,1200,projected,4400,,4605,19942,,,Large and medium scale topographic mapping and engineering survey.,,Ordnance Survey of Great Britain,EPSG,2000-03-07 00:00:00,99.74,1,0
+2006,St Lucia 1955 / British West Indies Grid,1201,projected,4400,,4606,19942,,,Large and medium scale topographic mapping and engineering survey.,,Ordnance Survey of Great Britain,EPSG,2000-03-07 00:00:00,99.74,1,0
+2007,St Vincent 45 / British West Indies Grid,1202,projected,4400,,4607,19942,,,Large and medium scale topographic mapping and engineering survey.,,Ordnance Survey of Great Britain,EPSG,2000-03-07 00:00:00,99.74,1,0
+2008,NAD27(CGQ77) / SCoPQ zone 2,1420,projected,4499,,4609,17700,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2009,NAD27(CGQ77) / SCoPQ zone 3,1421,projected,4499,,4609,17703,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2010,NAD27(CGQ77) / SCoPQ zone 4,1422,projected,4499,,4609,17704,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2011,NAD27(CGQ77) / SCoPQ zone 5,1423,projected,4499,,4609,17705,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2012,NAD27(CGQ77) / SCoPQ zone 6,1424,projected,4499,,4609,17706,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2013,NAD27(CGQ77) / SCoPQ zone 7,1425,projected,4499,,4609,17707,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2014,NAD27(CGQ77) / SCoPQ zone 8,1426,projected,4499,,4609,17708,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2015,NAD27(CGQ77) / SCoPQ zone 9,1427,projected,4499,,4609,17709,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2016,NAD27(CGQ77) / SCoPQ zone 10,1428,projected,4499,,4609,17710,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2017,NAD27(76) / MTM zone 8,1429,projected,4499,,4608,17708,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2018,NAD27(76) / MTM zone 9,1430,projected,4499,,4608,17709,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2019,NAD27(76) / MTM zone 10,1431,projected,4499,,4608,17710,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2020,NAD27(76) / MTM zone 11,1432,projected,4400,,4608,17711,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2021,NAD27(76) / MTM zone 12,1433,projected,4400,,4608,17712,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2022,NAD27(76) / MTM zone 13,1434,projected,4400,,4608,17713,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2023,NAD27(76) / MTM zone 14,1435,projected,4400,,4608,17714,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2024,NAD27(76) / MTM zone 15,1436,projected,4400,,4608,17715,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2025,NAD27(76) / MTM zone 16,1437,projected,4400,,4608,17716,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2026,NAD27(76) / MTM zone 17,1438,projected,4400,,4608,17717,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,2000-03-07 00:00:00,99.74,1,0
+2027,NAD27(76) / UTM zone 15N,1439,projected,4400,,4608,16015,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NAD27 / UTM zone 15N (code 26715).,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2028,NAD27(76) / UTM zone 16N,1440,projected,4400,,4608,16016,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NAD27 / UTM zone 16N (code 26716).,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2029,NAD27(76) / UTM zone 17N,1441,projected,4400,,4608,16017,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NAD27 / UTM zone 17N (code 26717).,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2030,NAD27(76) / UTM zone 18N,1442,projected,4400,,4608,16018,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NAD27 / UTM zone 18N (code 26718).,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2031,NAD27(CGQ77) / UTM zone 17N,1428,projected,4400,,4609,16017,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NAD27 / UTM zone 17N (code 26717).,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2032,NAD27(CGQ77) / UTM zone 18N,1443,projected,4400,,4609,16018,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NAD27 / UTM zone 18N (code 26718).,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2033,NAD27(CGQ77) / UTM zone 19N,1444,projected,4400,,4609,16019,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NAD27 / UTM zone 19N (code 26719).,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2034,NAD27(CGQ77) / UTM zone 20N,1445,projected,4400,,4609,16020,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NAD27 / UTM zone 20N (code 26720).,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2035,NAD27(CGQ77) / UTM zone 21N,1446,projected,4400,,4609,16021,,,Large and medium scale topographic mapping and engineering survey.,Supersedes NAD27 / UTM zone 21N (code 26721).,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2036,NAD83(CSRS98) / New Brunswick Stereo,1447,projected,4500,,4140,19946,,,Large and medium scale topographic mapping and engineering survey.,In use from 1999.,Service New Brunswick Land and Information Standards Manual,EPSG,2000-03-07 00:00:00,99.74  99.90,1,1
+2037,NAD83(CSRS98) / UTM zone 19N,1448,projected,4400,,4140,16019,,,Large and medium scale topographic mapping and engineering survey.,In use from 1999.,Service New Brunswick Land and Information Standards Manual,EPSG,2000-03-07 00:00:00,99.74  99.90,1,1
+2038,NAD83(CSRS98) / UTM zone 20N,1449,projected,4400,,4140,16020,,,Large and medium scale topographic mapping and engineering survey.,In use from 1999.,Service New Brunswick Land and Information Standards Manual,EPSG,2000-03-07 00:00:00,99.74  99.90,1,1
+2039,Israel / Israeli TM Grid,2603,projected,4400,,4141,18204,,,Large and medium scale topographic mapping and engineering survey.,Supersedes Israeli CS Grid (EPSG code 28193).,Survey of Israel.,EPSG,2002-06-22 00:00:00,99.74  2002.34,1,0
+2040,Locodjo 1965 / UTM zone 30N,1450,projected,4400,,4142,16030,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Abidjan 87 / UTM 30N (EPSG code 2041).,IGN Paris,EPSG,2000-03-07 00:00:00,99.74,1,0
+2041,Abidjan 1987 / UTM zone 30N,1450,projected,4400,,4143,16030,,,Large and medium scale topographic mapping and engineering survey.,Supersedes Locodjo 65 / UTM 30N (EPSG code 2040).,IGN Paris,EPSG,2000-03-07 00:00:00,99.74,1,0
+2042,Locodjo 1965 / UTM zone 29N,1451,projected,4400,,4142,16029,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Abidjan 87 / UTM 29N (EPSG code 2043).,IGN Paris,EPSG,2000-03-07 00:00:00,99.74,1,0
+2043,Abidjan 1987 / UTM zone 29N,1451,projected,4400,,4143,16029,,,Large and medium scale topographic mapping and engineering survey.,Supersedes Locodjo 65 / UTM 29N (EPSG code 2042).,IGN Paris,EPSG,2000-03-07 00:00:00,99.74,1,0
+2044,Hanoi 1972 / Gauss-Kruger zone 18,1452,projected,4530,,4147,16218,,,Large and medium scale topographic mapping and engineering survey.,Replaces use of Indian 1960 / UTM zone 48 after 1988.,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2045,Hanoi 1972 / Gauss-Kruger zone 19,1453,projected,4530,,4147,16219,,,Large and medium scale topographic mapping and engineering survey.,Replaces use of Indian 1960 / UTM zone 49 after 1988.,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2046,Hartebeesthoek94 / Lo15,1454,projected,6503,,4148,17515,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-03-07 00:00:00,99.74  99.96  99.98  2000.04,1,0
+2047,Hartebeesthoek94 / Lo17,1455,projected,6503,,4148,17517,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-03-07 00:00:00,99.74  99.96  99.98  2000.04,1,0
+2048,Hartebeesthoek94 / Lo19,1456,projected,6503,,4148,17519,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-03-07 00:00:00,99.74  99.96  99.98  2000.04,1,0
+2049,Hartebeesthoek94 / Lo21,1457,projected,6503,,4148,17521,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-03-07 00:00:00,99.74  99.96  99.98  2000.04,1,0
+2050,Hartebeesthoek94 / Lo23,1458,projected,6503,,4148,17523,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-03-07 00:00:00,99.74  99.96  99.98  2000.04,1,0
+2051,Hartebeesthoek94 / Lo25,1459,projected,6503,,4148,17525,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-03-07 00:00:00,99.74  99.96  99.98  2000.04,1,0
+2052,Hartebeesthoek94 / Lo27,1460,projected,6503,,4148,17527,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-03-07 00:00:00,99.74  99.96  99.98  2000.04,1,0
+2053,Hartebeesthoek94 / Lo29,1461,projected,6503,,4148,17529,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-03-07 00:00:00,99.74  99.96  99.98  2000.04,1,0
+2054,Hartebeesthoek94 / Lo31,1462,projected,6503,,4148,17531,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-03-07 00:00:00,99.74  99.96  99.98  2000.04,1,0
+2055,Hartebeesthoek94 / Lo33,1463,projected,6503,,4148,17533,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-03-07 00:00:00,99.74  99.96  99.98  2000.04,1,0
+2056,CH1903+ / LV95,1286,projected,4498,,4150,19950,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes CH1903/LV03 (code 21781).,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2057,Rassadiran / Nakhl e Taqi,1338,projected,4400,,4153,19951,,,Engineering survey for terminal site only.,,Total-Fina,EPSG,2000-03-07 00:00:00,99.74,1,0
+2058,ED50(ED77) / UTM zone 38N,1464,projected,4400,,4154,16038,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2059,ED50(ED77) / UTM zone 39N,1465,projected,4400,,4154,16039,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2060,ED50(ED77) / UTM zone 40N,1466,projected,4400,,4154,16040,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2061,ED50(ED77) / UTM zone 41N,1467,projected,4400,,4154,16041,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2062,Madrid 1870 (Madrid) / Spain,1217,projected,4499,,4903,19921,,,Large and medium scale topographic mapping and engineering survey.,Superseded by ED50 / UTM after 1966.,,EPSG,2000-03-07 00:00:00,99.74,1,0
+2063,Dabola 1981 / UTM zone 28N,1468,projected,4400,,4315,16028,,,Large and medium scale topographic mapping and engineering survey.,Supersedes Conakry 1905 / UTM zone 28 (EPSG code 31528).,,EPSG,1999-12-09 00:00:00,,1,0
+2064,Dabola 1981 / UTM zone 29N,1469,projected,4400,,4315,16029,,,Large and medium scale topographic mapping and engineering survey.,Supersedes Conakry 1905 / UTM zone 29 (EPSG code 31529).,,EPSG,1999-12-09 00:00:00,,1,0
+2065,S-JTSK (Ferro) / Krovak,1306,projected,6501,,4818,19952,,,Large and medium scale topographic mapping and engineering survey.,,Research Institute for Geodesy Topography and Cartography (VUGTK); Prague.,EPSG,2000-03-07 00:00:00,,1,0
+2066,Mount Dillon / Tobago Grid,1322,projected,4407,,4157,19924,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,,1,0
+2067,Naparima 1955 / UTM zone 20N,1339,projected,4400,,4158,16020,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,,1,0
+2068,ELD79 / Libya zone 5,1470,projected,4499,,4159,18240,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2069,ELD79 / Libya zone 6,1471,projected,4499,,4159,18241,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2070,ELD79 / Libya zone 7,1472,projected,4499,,4159,18242,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2071,ELD79 / Libya zone 8,1473,projected,4499,,4159,18243,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2072,ELD79 / Libya zone 9,1474,projected,4499,,4159,18244,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2073,ELD79 / Libya zone 10,1475,projected,4499,,4159,18245,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2074,ELD79 / Libya zone 11,1476,projected,4499,,4159,18246,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2075,ELD79 / Libya zone 12,1477,projected,4499,,4159,18247,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2076,ELD79 / Libya zone 13,1478,projected,4499,,4159,18248,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2077,ELD79 / UTM zone 32N,1479,projected,4400,,4159,16032,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2078,ELD79 / UTM zone 33N,1480,projected,4400,,4159,16033,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2079,ELD79 / UTM zone 34N,1481,projected,4400,,4159,16034,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2080,ELD79 / UTM zone 35N,1478,projected,4400,,4159,16035,,,Large and medium scale topographic mapping and engineering survey.,,Brown and Root,EPSG,2000-03-07 00:00:00,,1,0
+2081,Chos Malal 1914 / Argentina zone 2,1483,projected,4530,,4160,18032,,,Oil exploration.,,Various oil industry records,EPSG,2002-06-22 00:00:00,2002.36,1,0
+2082,Pampa del Castillo / Argentina zone 2,1484,projected,4530,,4161,18032,,,Oil exploration.,,Various oil industry records,EPSG,2002-06-22 00:00:00,2002.36,1,0
+2083,Hito XVIII 1963 / Argentina zone 2,1485,projected,4530,,4254,18032,,,Large and medium scale topographic mapping and engineering survey.,,Total-Fina,EPSG,2002-06-22 00:00:00,2002.36,1,0
+2084,Hito XVIII 1963 / UTM zone 19S,1486,projected,4400,,4254,16119,,,Large and medium scale topographic mapping and engineering survey.,,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+2085,NAD27 / Cuba Norte,1487,projected,4532,,4267,18061,,,Large and medium scale topographic mapping and engineering survey.,,Institut Cubano di Hidrografia (ICH),EPSG,2000-03-07 00:00:00,,1,0
+2086,NAD27 / Cuba Sur,1488,projected,4532,,4267,18062,,,Large and medium scale topographic mapping and engineering survey.,,Institut Cubano di Hidrografia (ICH),EPSG,2000-03-07 00:00:00,,1,0
+2087,ELD79 / TM 12 NE,1482,projected,4400,,4159,16412,,,Oil exploration.,,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+2088,Carthage / TM 11 NE,1489,projected,4400,,4223,16411,,,Oil exploration by Total.,,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+2089,Yemen NGN96 / UTM zone 38N,1490,projected,4400,,4163,16038,,,Large and medium scale topographic mapping and engineering survey.,,IGN Paris,EPSG,2000-03-07 00:00:00,,1,0
+2090,Yemen NGN96 / UTM zone 39N,1491,projected,4400,,4163,16039,,,Large and medium scale topographic mapping and engineering survey.,,IGN Paris,EPSG,2000-03-07 00:00:00,,1,0
+2091,South Yemen / Gauss Kruger zone 8,1492,projected,4530,,4164,16208,,,Large and medium scale topographic mapping and engineering survey.,,IGN Paris,EPSG,2000-03-07 00:00:00,,1,1
+2092,South Yemen / Gauss Kruger zone 9,1493,projected,4530,,4164,16209,,,Large and medium scale topographic mapping and engineering survey.,,IGN Paris,EPSG,2000-03-07 00:00:00,,1,1
+2093,Hanoi 1972 / GK 106 NE,1494,projected,4530,,4147,16586,,,Used for cadastral and large scale topographic mapping.,,BP Amoco,EPSG,2000-03-07 00:00:00,,1,0
+2094,WGS 72BE / TM 106 NE,1495,projected,4400,,4324,16506,,,Oil exploration by Total for blocks 10 and 11-1.,,Total-Fina,EPSG,2000-03-07 00:00:00,,1,0
+2095,Bissau / UTM zone 28N,1113,projected,4400,,4165,16028,,,Large and medium scale topographic mapping and engineering survey.,,US National Imagery and Mapping Agency TR8350.2.,EPSG,2000-03-07 00:00:00,,1,0
+2096,Korean 1985 / Korea East Belt,1496,projected,4530,,4162,18251,,,Large and medium scale topographic mapping and engineering survey.,,Clifford J. Mugnier; in Photogrammetric Engineering & Remote Sensing November 1999. http://www.asprs.org/resources.html,EPSG,2000-03-07 00:00:00,2001.28,1,0
+2097,Korean 1985 / Korea Central Belt,1497,projected,4530,,4162,18252,,,Large and medium scale topographic mapping and engineering survey.,,Clifford J. Mugnier; in Photogrammetric Engineering & Remote Sensing November 1999. http://www.asprs.org/resources.html,EPSG,2000-03-07 00:00:00,2001.28,1,0
+2098,Korean 1985 / Korea West Belt,1498,projected,4530,,4162,18253,,,Large and medium scale topographic mapping and engineering survey.,,Clifford J. Mugnier; in Photogrammetric Engineering & Remote Sensing November 1999. http://www.asprs.org/resources.html,EPSG,2000-03-07 00:00:00,2001.28,1,0
+2099,Qatar 1948 / Qatar Grid,1346,projected,4400,,4286,19953,,,Large and medium scale topographic mapping and engineering survey.,Also known as Qatar Plane Coordinate or QPC system.  Superseded by Qatar National Grid (code 28600).,,EPSG,2000-03-07 00:00:00,,1,0
+2202,REGVEN / UTM zone 19N,1694,projected,4400,,4189,16019,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2001-11-06 00:00:00,,1,0
+2203,REGVEN / UTM zone 20N,1695,projected,4400,,4189,16020,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2001-11-06 00:00:00,,1,0
+2204,NAD27 / Tennessee,1411,projected,4497,,4267,15302,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2001-11-06 00:00:00,2001.45,1,0
+2205,NAD83 / Kentucky North,2202,projected,4499,,4269,15303,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2246 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2001-11-06 00:00:00,2001.45,1,0
+2206,ED50 / 3-degree Gauss-Kruger zone 9,1524,projected,4530,,4230,16269,,,Large scale topographic mapping and cadastral survey.,Also found with truncated false easting - see ED50 / TM27 (code 2319).,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+2207,ED50 / 3-degree Gauss-Kruger zone 10,1525,projected,4530,,4230,16270,,,Large scale topographic mapping and cadastral survey.,Also found with truncated false easting - see ED50 / TM30 (code 2320).,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+2208,ED50 / 3-degree Gauss-Kruger zone 11,1526,projected,4530,,4230,16271,,,Large scale topographic mapping and cadastral survey.,Also found with truncated false easting - see ED50 / TM33 (code 2321).,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+2209,ED50 / 3-degree Gauss-Kruger zone 12,1527,projected,4530,,4230,16272,,,Large scale topographic mapping and cadastral survey.,Also found with truncated false easting - see ED50 / TM36 (code 2322).,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+2210,ED50 / 3-degree Gauss-Kruger zone 13,1528,projected,4530,,4230,16273,,,Large scale topographic mapping and cadastral survey.,Also found with truncated false easting - see ED50 / TM39 (code 2323).,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+2211,ED50 / 3-degree Gauss-Kruger zone 14,1529,projected,4530,,4230,16274,,,Large scale topographic mapping and cadastral survey.,Also found with truncated false easting - see ED50 / TM42 (code 2324).,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+2212,ED50 / 3-degree Gauss-Kruger zone 15,1530,projected,4530,,4230,16275,,,Large scale topographic mapping and cadastral survey.,Also found with truncated false easting - see ED50 / TM45 (code 2325).,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+2213,ETRS89 / TM 30 NE,2546,projected,4400,,4258,16430,,,Oil industry usage.,,,EPSG,2001-11-06 00:00:00,,1,0
+2214,Douala 1948 / AOF west,1060,projected,4400,,4192,18415,,,Medium and small scale topographic mapping and engineering survey.,Superseded by Manoca 1962 / UTM zone 32N (code 2215).,,EPSG,2002-01-18 00:00:00,,1,0
+2215,Manoca 1962 / UTM zone 32N,1060,projected,4400,,4193,16032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-01-18 00:00:00,,1,0
+2216,Qornoq 1927 / UTM zone 22N,2573,projected,4400,,4194,16022,,,Topographic mapping.,,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-18 00:00:00,,1,0
+2217,Qornoq 1927 / UTM zone 23N,2572,projected,4400,,4194,16023,,,Topographic mapping.,,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-18 00:00:00,,1,0
+2218,Scoresbysund 1952 / Greenland zone 5 east,2560,projected,4501,,4195,18425,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2219,ATS77 / UTM zone 19N,1531,projected,4400,,4122,16019,,,Large and medium scale topographic mapping and engineering survey.,In use from 1979.  To be phased out in late 1990's.,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,1997-07-22 00:00:00,,1,0
+2220,ATS77 / UTM zone 20N,1532,projected,4400,,4122,16020,,,Large and medium scale topographic mapping and engineering survey.,In use from 1979.  To be phased out in late 1990's.,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,1997-07-22 00:00:00,,1,0
+2221,Scoresbysund 1952 / Greenland zone 6 east,2561,projected,4501,,4195,18426,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2222,NAD83 / Arizona East (ft),2167,projected,4495,,4269,15304,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26948. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2223,NAD83 / Arizona Central (ft),2166,projected,4495,,4269,15305,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26949. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2224,NAD83 / Arizona West (ft),2168,projected,4495,,4269,15306,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26950. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2225,NAD83 / California zone 1 (ftUS),2175,projected,4497,,4269,15307,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26941. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2226,NAD83 / California zone 2 (ftUS),2176,projected,4497,,4269,15308,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26942. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2227,NAD83 / California zone 3 (ftUS),2177,projected,4497,,4269,15309,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26943. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2228,NAD83 / California zone 4 (ftUS),2178,projected,4497,,4269,15310,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26944. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2229,NAD83 / California zone 5 (ftUS),2182,projected,4497,,4269,15311,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26945. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2230,NAD83 / California zone 6 (ftUS),2180,projected,4497,,4269,15312,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26946. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2231,NAD83 / Colorado North (ftUS),2184,projected,4497,,4269,15313,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26953. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2232,NAD83 / Colorado Central (ftUS),2183,projected,4497,,4269,15314,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26954. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2233,NAD83 / Colorado South (ftUS),2185,projected,4497,,4269,15315,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26955. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2234,NAD83 / Connecticut (ftUS),1377,projected,4497,,4269,15316,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26956. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2235,NAD83 / Delaware (ftUS),1378,projected,4497,,4269,15317,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26957. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2236,NAD83 / Florida East (ftUS),2186,projected,4497,,4269,15318,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26958. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2237,NAD83 / Florida West (ftUS),2188,projected,4497,,4269,15319,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26959. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2238,NAD83 / Florida North (ftUS),2187,projected,4497,,4269,15320,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26960. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2239,NAD83 / Georgia East (ftUS),2189,projected,4497,,4269,15321,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26966. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2240,NAD83 / Georgia West (ftUS),2190,projected,4497,,4269,15322,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26967. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2241,NAD83 / Idaho East (ftUS),2192,projected,4497,,4269,15323,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26968. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2242,NAD83 / Idaho Central (ftUS),2191,projected,4497,,4269,15324,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26969. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2243,NAD83 / Idaho West (ftUS),2193,projected,4497,,4269,15325,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26970. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2244,NAD83 / Indiana East (ftUS),2196,projected,4497,,4269,15326,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26973. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2245,NAD83 / Indiana West (ftUS),2197,projected,4497,,4269,15327,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26974. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2246,NAD83 / Kentucky North (ftUS),2202,projected,4497,,4269,15328,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 2205. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2247,NAD83 / Kentucky South (ftUS),2203,projected,4497,,4269,15329,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26980. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2248,NAD83 / Maryland (ftUS),1389,projected,4497,,4269,15330,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26985. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2249,NAD83 / Massachusetts Mainland (ftUS),2209,projected,4497,,4269,15331,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26986. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2250,NAD83 / Massachusetts Island (ftUS),2208,projected,4497,,4269,15332,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26987. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2251,NAD83 / Michigan North (ft),1723,projected,4495,,4269,15333,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26988. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2252,NAD83 / Michigan Central (ft),1724,projected,4495,,4269,15334,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26989. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2253,NAD83 / Michigan South (ft),1725,projected,4495,,4269,15335,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26990. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2254,NAD83 / Mississippi East (ftUS),2216,projected,4497,,4269,15336,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26994. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2255,NAD83 / Mississippi West (ftUS),2217,projected,4497,,4269,15337,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 26995. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2256,NAD83 / Montana (ft),1395,projected,4495,,4269,15338,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32100. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2257,NAD83 / New Mexico East (ftUS),2228,projected,4497,,4269,15339,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32112. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2258,NAD83 / New Mexico Central (ftUS),2231,projected,4497,,4269,15340,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32113. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2259,NAD83 / New Mexico West (ftUS),2232,projected,4497,,4269,15341,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32114. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2260,NAD83 / New York East (ftUS),2234,projected,4497,,4269,15342,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32115. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2261,NAD83 / New York Central (ftUS),2233,projected,4497,,4269,15343,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32116. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2262,NAD83 / New York West (ftUS),2236,projected,4497,,4269,15344,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32117. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2263,NAD83 / New York Long Island (ftUS),2235,projected,4497,,4269,15345,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32118. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2264,NAD83 / North Carolina (ftUS),1402,projected,4497,,4269,15346,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32119.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2265,NAD83 / North Dakota North (ft),2237,projected,4495,,4269,15347,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32120. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2266,NAD83 / North Dakota South (ft),2238,projected,4495,,4269,15348,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32121. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2267,NAD83 / Oklahoma North (ftUS),2241,projected,4497,,4269,15349,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32124. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2268,NAD83 / Oklahoma South (ftUS),2242,projected,4497,,4269,15350,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32125. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2269,NAD83 / Oregon North (ft),2243,projected,4495,,4269,15351,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32126. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2270,NAD83 / Oregon South (ft),2244,projected,4495,,4269,15352,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32127. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2271,NAD83 / Pennsylvania North (ftUS),2245,projected,4497,,4269,15353,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32128.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2272,NAD83 / Pennsylvania South (ftUS),2246,projected,4497,,4269,15354,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32129.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2273,NAD83 / South Carolina (ft),1409,projected,4495,,4269,15355,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32133.,National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2274,NAD83 / Tennessee (ftUS),1411,projected,4497,,4269,15356,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32136. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2275,NAD83 / Texas North (ftUS),2253,projected,4497,,4269,15357,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32137. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2276,NAD83 / Texas North Central (ftUS),2254,projected,4497,,4269,15358,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32138. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2277,NAD83 / Texas Central (ftUS),2252,projected,4497,,4269,15359,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32139. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2278,NAD83 / Texas South Central (ftUS),2527,projected,4497,,4269,15360,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32140. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2279,NAD83 / Texas South (ftUS),2528,projected,4497,,4269,15361,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32141. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2280,NAD83 / Utah North (ft),2258,projected,4495,,4269,15362,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32142. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2281,NAD83 / Utah Central (ft),2257,projected,4495,,4269,15363,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32143. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2282,NAD83 / Utah South (ft),2259,projected,4495,,4269,15364,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32144. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2283,NAD83 / Virginia North (ftUS),2260,projected,4497,,4269,15365,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32146. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2284,NAD83 / Virginia South (ftUS),2261,projected,4497,,4269,15366,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32147. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2285,NAD83 / Washington North (ftUS),2273,projected,4497,,4269,15367,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32148. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2286,NAD83 / Washington South (ftUS),2274,projected,4497,,4269,15368,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32149. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2287,NAD83 / Wisconsin North (ftUS),2267,projected,4497,,4269,15369,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32152. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2288,NAD83 / Wisconsin Central (ftUS),2266,projected,4497,,4269,15370,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32153. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2289,NAD83 / Wisconsin South (ftUS),2268,projected,4497,,4269,15371,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  Federal definition is metric - see code 32154. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",National Geodetic Survey  http://www.ngs.noaa.gov/INFO/Policy/st_plane.html,EPSG,2001-11-06 00:00:00,,1,0
+2290,ATS77 / Prince Edward Isl. Stereographic (ATS77),1533,projected,4496,,4122,19933,,,Large and medium scale topographic mapping and engineering survey.,In use from 1979.  To be phased out in late 1990's.,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,1997-11-13 00:00:00,,1,0
+2291,NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83),1533,projected,4496,,4122,19960,,,Large and medium scale topographic mapping and engineering survey.,Deprecated due to error in source geogCRS.,PEI Department of Transportation & Public Works,EPSG,2000-10-19 00:00:00,,1,1
+2292,NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83),1533,projected,4496,,4140,19960,,,Large and medium scale topographic mapping and engineering survey.,,PEI Department of Transportation & Public Works,EPSG,2001-08-28 00:00:00,,1,1
+2294,ATS77 / MTM Nova Scotia zone 4,1534,projected,4400,,4122,17794,,,Large and medium scale topographic mapping and engineering survey.,In use from 1979.  To be phased out in late 1990's.,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,1997-11-13 00:00:00,,1,0
+2295,ATS77 / MTM Nova Scotia zone 5,1535,projected,4400,,4122,17795,,,Large and medium scale topographic mapping and engineering survey.,In use from 1979.  To be phased out in late 1990's.,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,1997-11-13 00:00:00,,1,0
+2296,Ammassalik 1958 / Greenland zone 7 east,2562,projected,4501,,4196,18427,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2297,Qornoq 1927 / Greenland zone 1 east,2556,projected,4501,,4194,18421,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2298,Qornoq 1927 / Greenland zone 2 east,2557,projected,4501,,4194,18422,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2299,Qornoq 1927 / Greenland zone 2 west,2563,projected,4501,,4194,18432,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2300,Qornoq 1927 / Greenland zone 3 east,2558,projected,4501,,4194,18423,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2301,Qornoq 1927 / Greenland zone 3 west,2564,projected,4501,,4194,18433,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2302,Qornoq 1927 / Greenland zone 4 east,2559,projected,4501,,4194,18424,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2303,Qornoq 1927 / Greenland zone 4 west,2565,projected,4501,,4194,18434,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2304,Qornoq 1927 / Greenland zone 5 west,2566,projected,4501,,4194,18435,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2305,Qornoq 1927 / Greenland zone 6 west,2567,projected,4501,,4194,18436,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2306,Qornoq 1927 / Greenland zone 7 west,2568,projected,4501,,4194,18437,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2307,Qornoq 1927 / Greenland zone 8 east,2569,projected,4501,,4194,18428,,,Topographic mapping.,Coordinate system second axis has abbreviation E but is positive to the west.,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-26 00:00:00,,1,0
+2308,Batavia / TM 109 SE,2577,projected,4400,,4211,16709,,,Used by Arco and BP for ONWJ.,,BP Indonesia.,EPSG,2002-02-12 00:00:00,,1,0
+2309,WGS 84 / TM 116 SE,2588,projected,4400,,4326,16716,,,Used by BP for Terang-Sirasun.,,BP Indonesia.,EPSG,2002-06-22 00:00:00,2002.151,1,0
+2310,WGS 84 / TM 132 SE,2589,projected,4400,,4326,16732,,,Used for hydrocarbons exploration and development.,,BP Indonesia.,EPSG,2002-06-22 00:00:00,2002.151,1,0
+2311,WGS 84 / TM 6 NE,1717,projected,4400,,4326,16406,,,Used for oil exploration by ExxonMobil.,,ExxonMobil.,EPSG,2002-02-12 00:00:00,,1,0
+2312,Garoua / UTM zone 33N,2590,projected,4400,,4197,16033,,,Large and medium scale topographic mapping and engineering survey.,,TotalFinaElf,EPSG,2002-02-12 00:00:00,,1,0
+2313,Kousseri / UTM zone 33N,2591,projected,4400,,4198,16033,,,Large and medium scale topographic mapping and engineering survey.,,TotalFinaElf,EPSG,2002-02-12 00:00:00,,1,0
+2314,Trinidad 1903 / Trinidad Grid (ftCla),1322,projected,4403,,4302,19975,,,Oil industry exploration and production.,Foot version of Trinidad 1903 / Trinidad Grid (code 30200) used by some US-based companies including Amoco Trinidad.,BP,EPSG,2002-02-12 00:00:00,,1,0
+2315,Campo Inchauspe / UTM zone 19S,2596,projected,4400,,4221,16119,,,Oil industry exploration.,,TotalFinaElf,EPSG,2002-02-12 00:00:00,,1,0
+2316,Campo Inchauspe / UTM zone 20S,2597,projected,4400,,4221,16120,,,Oil industry exploration.,,TotalFinaElf,EPSG,2002-02-12 00:00:00,,1,0
+2317,PSAD56 / ICN Regional,1251,projected,4499,,4248,19976,,,Small scale topographic and geological mapping.,,Institute Cartografica Nacional,EPSG,2002-02-12 00:00:00,,1,0
+2318,Ain el Abd / Aramco Lambert,1206,projected,4400,,4204,19977,,,Oil industry exploration and production.,Used by Saudi Aramco when area of interest crosses UTM zone boundary. Adopted by partners for Core Venture 1 (South Ghawar) area.,Saudi Aramco,EPSG,2002-02-12 00:00:00,,1,0
+2319,ED50 / TM27,1524,projected,4530,,4230,16369,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with zone number prefix to false easting - see ED50 / 3-degree Gauss-Kruger zone 9 (code 2206).,General Command of Mapping via EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2320,ED50 / TM30,1525,projected,4530,,4230,16370,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with zone number prefix to false easting - see ED50 / 3-degree Gauss-Kruger zone 10 (code 2207).,General Command of Mapping via EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2321,ED50 / TM33,1526,projected,4530,,4230,16371,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with zone number prefix to false easting - see ED50 / 3-degree Gauss-Kruger zone 11 (code 2208).,General Command of Mapping via EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2322,ED50 / TM36,1527,projected,4530,,4230,16372,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with zone number prefix to false easting - see ED50 / 3-degree Gauss-Kruger zone 12 (code 2209).,General Command of Mapping via EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2323,ED50 / TM39,1528,projected,4530,,4230,16373,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with zone number prefix to false easting - see ED50 / 3-degree Gauss-Kruger zone 13 (code 2210).,General Command of Mapping via EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2324,ED50 / TM42,1529,projected,4530,,4230,16374,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with zone number prefix to false easting - see ED50 / 3-degree Gauss-Kruger zone 14 (code 2211).,General Command of Mapping via EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2325,ED50 / TM45,1530,projected,4530,,4230,16375,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with zone number prefix to false easting - see ED50 / 3-degree Gauss-Kruger zone 15 (code 2212).,General Command of Mapping via EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2326,Hong Kong 1980 Grid System,1118,projected,4500,,4611,19978,,,"Large scale topographic mapping, cadastral and engineering survey.",Supersedes Hong Kong 1963 Grid system and its 1976 metric variant.,"Survey and Mapping Office, Lands Department. Http://www.info.gov.hk/landsd/mapping/tindex.htm",EPSG,2002-06-22 00:00:00,,1,0
+2327,Xian 1980 / Gauss-Kruger zone 13,1587,projected,4530,,4610,16213,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 75E (code 2338).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2328,Xian 1980 / Gauss-Kruger zone 14,1588,projected,4530,,4610,16214,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 81E (code 2339).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2329,Xian 1980 / Gauss-Kruger zone 15,1589,projected,4530,,4610,16215,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 87E (code 2340).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2330,Xian 1980 / Gauss-Kruger zone 16,1590,projected,4530,,4610,16216,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 93E (code 2341).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2331,Xian 1980 / Gauss-Kruger zone 17,1591,projected,4530,,4610,16217,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 99E (code 2342).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2332,Xian 1980 / Gauss-Kruger zone 18,1592,projected,4530,,4610,16218,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 105E (code 2343).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2333,Xian 1980 / Gauss-Kruger zone 19,1593,projected,4530,,4610,16219,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 111E (code 2344).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2334,Xian 1980 / Gauss-Kruger zone 20,1594,projected,4530,,4610,16220,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 117E (code 2345).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2335,Xian 1980 / Gauss-Kruger zone 21,1595,projected,4530,,4610,16221,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 123E (code 2346).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2336,Xian 1980 / Gauss-Kruger zone 22,1596,projected,4530,,4610,16222,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 129E (code 2347).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2337,Xian 1980 / Gauss-Kruger zone 23,1597,projected,4530,,4610,16223,,,Medium scale topographic mapping.,Also found with truncated false easting - see Xian 1980 / [6-degree] Gauss-Kruger CM 135E (code 2348).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2338,Xian 1980 / Gauss-Kruger CM 75E,1587,projected,4530,,4610,16313,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 13 (code 2327).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2339,Xian 1980 / Gauss-Kruger CM 81E,1588,projected,4530,,4610,16314,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 14 (code 2328).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2340,Xian 1980 / Gauss-Kruger CM 87E,1589,projected,4530,,4610,16315,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 15 (code 2329).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2341,Xian 1980 / Gauss-Kruger CM 93E,1590,projected,4530,,4610,16316,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 16 (code 2330).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2342,Xian 1980 / Gauss-Kruger CM 99E,1591,projected,4530,,4610,16317,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 17 (code 2331).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2343,Xian 1980 / Gauss-Kruger CM 105E,1592,projected,4530,,4610,16318,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 18 (code 2332).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2344,Xian 1980 / Gauss-Kruger CM 111E,1593,projected,4530,,4610,16319,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 19 (code 2333).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2345,Xian 1980 / Gauss-Kruger CM 117E,1594,projected,4530,,4610,16320,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 20 (code 2334).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2346,Xian 1980 / Gauss-Kruger CM 123E,1595,projected,4530,,4610,16321,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 21 (code 2335).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2347,Xian 1980 / Gauss-Kruger CM 129E,1596,projected,4530,,4610,16322,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 22 (code 2336).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2348,Xian 1980 / Gauss-Kruger CM 135E,1597,projected,4530,,4610,16323,,,Medium scale topographic mapping.,Truncated form of Xian 1980 / [6-degree] Gauss-Kruger zone 23 (code 2337).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2349,Xian 1980 / 3-degree Gauss-Kruger zone 25,2711,projected,4530,,4610,16285,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 75E (code 2370).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2350,Xian 1980 / 3-degree Gauss-Kruger zone 26,2712,projected,4530,,4610,16286,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 78E (code 2371).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2351,Xian 1980 / 3-degree Gauss-Kruger zone 27,2713,projected,4530,,4610,16287,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 81E (code 2372).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2352,Xian 1980 / 3-degree Gauss-Kruger zone 28,2714,projected,4530,,4610,16288,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 84E (code 2373).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2353,Xian 1980 / 3-degree Gauss-Kruger zone 29,2715,projected,4530,,4610,16289,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 87E (code 2374).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2354,Xian 1980 / 3-degree Gauss-Kruger zone 30,2716,projected,4530,,4610,16290,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 90E (code 2375).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2355,Xian 1980 / 3-degree Gauss-Kruger zone 31,2717,projected,4530,,4610,16291,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 93E (code 2376).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2356,Xian 1980 / 3-degree Gauss-Kruger zone 32,2718,projected,4530,,4610,16292,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 96E (code 2377).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2357,Xian 1980 / 3-degree Gauss-Kruger zone 33,2719,projected,4530,,4610,16293,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 99E (code 2378).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2358,Xian 1980 / 3-degree Gauss-Kruger zone 34,2720,projected,4530,,4610,16294,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 102E (code 2379).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2359,Xian 1980 / 3-degree Gauss-Kruger zone 35,2721,projected,4530,,4610,16295,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 105E (code 2380).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2360,Xian 1980 / 3-degree Gauss-Kruger zone 36,2722,projected,4530,,4610,16296,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 108E (code 2381).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2361,Xian 1980 / 3-degree Gauss-Kruger zone 37,2723,projected,4530,,4610,16297,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 111E (code 2382).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2362,Xian 1980 / 3-degree Gauss-Kruger zone 38,2724,projected,4530,,4610,16298,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 114E (code 2383).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2363,Xian 1980 / 3-degree Gauss-Kruger zone 39,2725,projected,4530,,4610,16299,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 117E (code 2384).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2364,Xian 1980 / 3-degree Gauss-Kruger zone 40,2726,projected,4530,,4610,16070,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 123E (code 2385).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2365,Xian 1980 / 3-degree Gauss-Kruger zone 41,2727,projected,4530,,4610,16071,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 126E (code 2386).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2366,Xian 1980 / 3-degree Gauss-Kruger zone 42,2728,projected,4530,,4610,16072,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 126E (code 2387).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2367,Xian 1980 / 3-degree Gauss-Kruger zone 43,2729,projected,4530,,4610,16073,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 129E (code 2388).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2368,Xian 1980 / 3-degree Gauss-Kruger zone 44,2730,projected,4530,,4610,16074,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 132E (code 2389).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2369,Xian 1980 / 3-degree Gauss-Kruger zone 45,2731,projected,4530,,4610,16075,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Xian 1980 / 3-degree Gauss-Kruger CM 135E (code 2390).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2370,Xian 1980 / 3-degree Gauss-Kruger CM 75E,2711,projected,4530,,4610,16385,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 25 (code 2349).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2371,Xian 1980 / 3-degree Gauss-Kruger CM 78E,2712,projected,4530,,4610,16386,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 26 (code 2350).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2372,Xian 1980 / 3-degree Gauss-Kruger CM 81E,2713,projected,4530,,4610,16387,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 27 (code 2351).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2373,Xian 1980 / 3-degree Gauss-Kruger CM 84E,2714,projected,4530,,4610,16388,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 28 (code 2352).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2374,Xian 1980 / 3-degree Gauss-Kruger CM 87E,2715,projected,4530,,4610,16389,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 29 (code 2353).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2375,Xian 1980 / 3-degree Gauss-Kruger CM 90E,2716,projected,4530,,4610,16390,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 30 (code 2354).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2376,Xian 1980 / 3-degree Gauss-Kruger CM 93E,2717,projected,4530,,4610,16391,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 31 (code 2355).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2377,Xian 1980 / 3-degree Gauss-Kruger CM 96E,2718,projected,4530,,4610,16392,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 32 (code 2356).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2378,Xian 1980 / 3-degree Gauss-Kruger CM 99E,2719,projected,4530,,4610,16393,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 33 (code 2357).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2379,Xian 1980 / 3-degree Gauss-Kruger CM 102E,2720,projected,4530,,4610,16394,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 34 (code 2358).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2380,Xian 1980 / 3-degree Gauss-Kruger CM 105E,2721,projected,4530,,4610,16395,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 35 (code 2359).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2381,Xian 1980 / 3-degree Gauss-Kruger CM 108E,2722,projected,4530,,4610,16396,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 36 (code 2360).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2382,Xian 1980 / 3-degree Gauss-Kruger CM 111E,2723,projected,4530,,4610,16397,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 37 (code 2361).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2383,Xian 1980 / 3-degree Gauss-Kruger CM 114E,2724,projected,4530,,4610,16398,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 38 (code 2362).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2384,Xian 1980 / 3-degree Gauss-Kruger CM 117E,2725,projected,4530,,4610,16399,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 39 (code 2363).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2385,Xian 1980 / 3-degree Gauss-Kruger CM 120E,2726,projected,4530,,4610,16170,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 40 (code 2364).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2386,Xian 1980 / 3-degree Gauss-Kruger CM 123E,2727,projected,4530,,4610,16171,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 41 (code 2365).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2387,Xian 1980 / 3-degree Gauss-Kruger CM 126E,2728,projected,4530,,4610,16172,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 42 (code 2366).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2388,Xian 1980 / 3-degree Gauss-Kruger CM 129E,2729,projected,4530,,4610,16173,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 43 (code 2367).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2389,Xian 1980 / 3-degree Gauss-Kruger CM 132E,2730,projected,4530,,4610,16174,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 44 (code 2368).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2390,Xian 1980 / 3-degree Gauss-Kruger CM 135E,2731,projected,4530,,4610,16175,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Xian 1980 / 3-degree Gauss-Kruger zone 45 (code 2369).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2391,KKJ / Finland zone 1,1536,projected,4530,,4123,18191,,,Large and medium scale topographic mapping and engineering survey.,,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,1,0
+2392,KKJ / Finland zone 2,1537,projected,4530,,4123,18192,,,Large and medium scale topographic mapping and engineering survey.,,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,1,0
+2393,KKJ / Finland Uniform Coordinate System,1538,projected,4530,,4123,18193,,,Large and medium scale topographic mapping and engineering survey.,Known as Uniform Coordinate System when used over all country and also as Basic Coordinate System zone 3 at larger scales.,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,1,0
+2394,KKJ / Finland zone 4,1539,projected,4530,,4123,18194,,,Large and medium scale topographic mapping and engineering survey.,,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,1,0
+2395,South Yemen / Gauss-Kruger zone 8,1492,projected,4530,,4164,16208,,,Large and medium scale topographic mapping and engineering survey.,,IGN Paris,EPSG,2002-06-22 00:00:00,,1,0
+2396,South Yemen / Gauss-Kruger zone 9,1493,projected,4530,,4164,16209,,,Large and medium scale topographic mapping and engineering survey.,,IGN Paris,EPSG,2002-06-22 00:00:00,,1,0
+2397,Pulkovo 1942(83) / Gauss-Kruger zone 3,1512,projected,4530,,4178,16263,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.",In Thuringen superseded by DHDN / Gauss Kruger zone 3.,EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2398,Pulkovo 1942(83) / Gauss-Kruger zone 4,1513,projected,4530,,4178,16264,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.","In Brandenburg superseded by ETRS89 / UTM zone 33N. 
+In Sachsen and Thuringen superseded by DHDN / Gauss Kruger zone 4.",Bundesamt f�r Kartographie und Geod�sie via EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2399,Pulkovo 1942(83) / Gauss-Kruger zone 5,1512,projected,4530,,4178,16265,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.","In Brandenburg superseded by ETRS89 / UTM zone 33N. 
+In Sachsen superseded by DHDN / Gauss Kruger zone 5.",Bundesamt f�r Kartographie und Geod�sie via EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2400,RT90 2.5 gon W,1225,projected,4530,,4124,19929,,,Large and medium scale topographic mapping and engineering survey.,,National Land Survey of Sweden,EPSG,1997-11-13 00:00:00,,1,0
+2401,Beijing 1954 / 3-degree Gauss-Kruger zone 25,2711,projected,4530,,4214,16285,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 75E (code 2422). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 25 (code 2349).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2402,Beijing 1954 / 3-degree Gauss-Kruger zone 26,2712,projected,4530,,4214,16286,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 78E (code 2423). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 26 (code 2350).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2403,Beijing 1954 / 3-degree Gauss-Kruger zone 27,2713,projected,4530,,4214,16287,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 81E (code 2424). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 27 (code 2351).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2404,Beijing 1954 / 3-degree Gauss-Kruger zone 28,2714,projected,4530,,4214,16288,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 84E (code 2425). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 28 (code 2352).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2405,Beijing 1954 / 3-degree Gauss-Kruger zone 29,2715,projected,4530,,4214,16289,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 87E (code 2426). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 29 (code 2353).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2406,Beijing 1954 / 3-degree Gauss-Kruger zone 30,2716,projected,4530,,4214,16290,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 90E (code 2427). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 30 (code 2354).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2407,Beijing 1954 / 3-degree Gauss-Kruger zone 31,2717,projected,4530,,4214,16291,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 93E (code 2428). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 31 (code 2355).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2408,Beijing 1954 / 3-degree Gauss-Kruger zone 32,2718,projected,4530,,4214,16292,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 96E (code 2429). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 32 (code 2356).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2409,Beijing 1954 / 3-degree Gauss-Kruger zone 33,2719,projected,4530,,4214,16293,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 99E (code 2430). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 33 (code 2357).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2410,Beijing 1954 / 3-degree Gauss-Kruger zone 34,2720,projected,4530,,4214,16294,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 102E (code 2431). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 34 (code 2358).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2411,Beijing 1954 / 3-degree Gauss-Kruger zone 35,2721,projected,4530,,4214,16295,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 105E (code 2432). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 35 (code 2359).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2412,Beijing 1954 / 3-degree Gauss-Kruger zone 36,2722,projected,4530,,4214,16296,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 108E (code 2433). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 36 (code 2360).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2413,Beijing 1954 / 3-degree Gauss-Kruger zone 37,2723,projected,4530,,4214,16297,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 111E (code 2434). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 37 (code 2361).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2414,Beijing 1954 / 3-degree Gauss-Kruger zone 38,2724,projected,4530,,4214,16298,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 114E (code 2435). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 38 (code 2362).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2415,Beijing 1954 / 3-degree Gauss-Kruger zone 39,2725,projected,4530,,4214,16299,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 117E (code 2436). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 39 (code 2363).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2416,Beijing 1954 / 3-degree Gauss-Kruger zone 40,2726,projected,4530,,4214,16070,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 120E (code 2437). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 40 (code 2364).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2417,Beijing 1954 / 3-degree Gauss-Kruger zone 41,2727,projected,4530,,4214,16071,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 123E (code 2438). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 41 (code 2365).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2418,Beijing 1954 / 3-degree Gauss-Kruger zone 42,2728,projected,4530,,4214,16072,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 126E (code 2439). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 42 (code 2366).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2419,Beijing 1954 / 3-degree Gauss-Kruger zone 43,2729,projected,4530,,4214,16073,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 129E (code 2440). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 43 (code 2367).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2420,Beijing 1954 / 3-degree Gauss-Kruger zone 44,2730,projected,4530,,4214,16074,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 132E (code 2441). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 44 (code 2368).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2421,Beijing 1954 / 3-degree Gauss-Kruger zone 45,2731,projected,4530,,4214,16075,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Beijing 1954 / 3-degree Gauss-Kruger CM 135E (code 2442). Superseded by Xian 1980 / 3-degree Gauss-Kruger zone 45 (code 2369).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2422,Beijing 1954 / 3-degree Gauss-Kruger CM 75E,2711,projected,4530,,4214,16385,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 25 (code 2401). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 75E (code 2370).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2423,Beijing 1954 / 3-degree Gauss-Kruger CM 78E,2712,projected,4530,,4214,16386,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 26 (code 2402). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 78E (code 2371).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2424,Beijing 1954 / 3-degree Gauss-Kruger CM 81E,2713,projected,4530,,4214,16387,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 27 (code 2403). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 81E (code 2372).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2425,Beijing 1954 / 3-degree Gauss-Kruger CM 84E,2714,projected,4530,,4214,16388,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 28 (code 2404). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 84E (code 2373).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2426,Beijing 1954 / 3-degree Gauss-Kruger CM 87E,2715,projected,4530,,4214,16389,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 29 (code 2405). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 87E (code 2374).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2427,Beijing 1954 / 3-degree Gauss-Kruger CM 90E,2716,projected,4530,,4214,16390,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 30 (code 2406). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 90E (code 2375).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2428,Beijing 1954 / 3-degree Gauss-Kruger CM 93E,2717,projected,4530,,4214,16391,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 31 (code 2407). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 93E (code 2376).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2429,Beijing 1954 / 3-degree Gauss-Kruger CM 96E,2718,projected,4530,,4214,16392,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 32 (code 2408). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 96E (code 2377).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2430,Beijing 1954 / 3-degree Gauss-Kruger CM 99E,2719,projected,4530,,4214,16393,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 33 (code 2409). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 99E (code 2378).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2431,Beijing 1954 / 3-degree Gauss-Kruger CM 102E,2720,projected,4530,,4214,16394,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 45 (code 2421). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 102E (code 2379).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2432,Beijing 1954 / 3-degree Gauss-Kruger CM 105E,2721,projected,4530,,4214,16395,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 35 (code 2411). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 105E (code 2380).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2433,Beijing 1954 / 3-degree Gauss-Kruger CM 108E,2722,projected,4530,,4214,16396,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 36 (code 2412). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 108E (code 2381).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2434,Beijing 1954 / 3-degree Gauss-Kruger CM 111E,2723,projected,4530,,4214,16397,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 37 (code 2413). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 111E (code 2382).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2435,Beijing 1954 / 3-degree Gauss-Kruger CM 114E,2724,projected,4530,,4214,16398,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 38 (code 2414). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 114E (code 2383).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2436,Beijing 1954 / 3-degree Gauss-Kruger CM 117E,2725,projected,4530,,4214,16399,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 39 (code 2415). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 117E (code 2384).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2437,Beijing 1954 / 3-degree Gauss-Kruger CM 120E,2726,projected,4530,,4214,16170,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 40 (code 2416). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 120E (code 2385).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2438,Beijing 1954 / 3-degree Gauss-Kruger CM 123E,2727,projected,4530,,4214,16171,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 41 (code 2417). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 123E (code 2386).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2439,Beijing 1954 / 3-degree Gauss-Kruger CM 126E,2728,projected,4530,,4214,16172,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 42 (code 2418). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 126E (code 2387).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2440,Beijing 1954 / 3-degree Gauss-Kruger CM 129E,2729,projected,4530,,4214,16173,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 43 (code 2419). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 129E (code 2388).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2441,Beijing 1954 / 3-degree Gauss-Kruger CM 132E,2730,projected,4530,,4214,16174,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 44 (code 2420). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 132E (code 2389).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2442,Beijing 1954 / 3-degree Gauss-Kruger CM 135E,2731,projected,4530,,4214,16175,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Beijing 1954 / 3-degree Gauss-Kruger zone 45 (code 2421). Superseded by Xian 1980 / 3-degree Gauss-Kruger CM 135E (code 2390).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2443,JGD2000 / Japan Plane Rectangular CS I,1854,projected,4530,,4612,17801,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS I (code 30161).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2444,JGD2000 / Japan Plane Rectangular CS II,1855,projected,4530,,4612,17802,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS II (code 30162).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2445,JGD2000 / Japan Plane Rectangular CS III,1856,projected,4530,,4612,17803,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS III (code 30163).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2446,JGD2000 / Japan Plane Rectangular CS IV,1857,projected,4530,,4612,17804,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS IV (code 30164).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2447,JGD2000 / Japan Plane Rectangular CS V,1858,projected,4530,,4612,17805,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS V (code 30165).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2448,JGD2000 / Japan Plane Rectangular CS VI,1859,projected,4530,,4612,17806,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS VI (code 30166).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2449,JGD2000 / Japan Plane Rectangular CS VII,1860,projected,4530,,4612,17807,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS VII (code 30167).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2450,JGD2000 / Japan Plane Rectangular CS VIII,1861,projected,4530,,4612,17808,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS VIII (code 30168).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2451,JGD2000 / Japan Plane Rectangular CS IX,1862,projected,4530,,4612,17809,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS IX (code 30169).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2452,JGD2000 / Japan Plane Rectangular CS X,1863,projected,4530,,4612,17810,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS X (code 30170).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2453,JGD2000 / Japan Plane Rectangular CS XI,1864,projected,4530,,4612,17811,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS XI (code 30171).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2454,JGD2000 / Japan Plane Rectangular CS XII,1865,projected,4530,,4612,17812,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS XII (code 30172).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2455,JGD2000 / Japan Plane Rectangular CS XIII,1866,projected,4530,,4612,17813,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS XIII (code 30173).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2456,JGD2000 / Japan Plane Rectangular CS XIV,1867,projected,4530,,4612,17814,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS XIV (code 30174).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2457,JGD2000 / Japan Plane Rectangular CS XV,1868,projected,4530,,4612,17815,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS XV (code 30175).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2458,JGD2000 / Japan Plane Rectangular CS XVI,1869,projected,4530,,4612,17816,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS XVI (code 30176).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2459,JGD2000 / Japan Plane Rectangular CS XVII,1870,projected,4530,,4612,17817,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS XVII (code 30177).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2460,JGD2000 / Japan Plane Rectangular CS XVIII,1871,projected,4530,,4612,17818,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS XVIII (code 30178).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2461,JGD2000 / Japan Plane Rectangular CS XIX,1872,projected,4530,,4612,17819,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Tokyo / Japan Plane Rectangular CS XIX (code 30179).,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,,1,0
+2462,Albanian 1987 / Gauss-Kruger zone 4,1025,projected,4530,,4191,16204,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.",,EuroGeographics; http://crs.ifag.de/,EPSG,2002-06-22 00:00:00,,1,0
+2463,Pulkovo 1995 / Gauss-Kruger CM 21E,1763,projected,4530,,4200,16304,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 4 (code 20004).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,0
+2464,Pulkovo 1995 / Gauss-Kruger CM 27E,1764,projected,4530,,4200,16305,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 5 (code 20005).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2465,Pulkovo 1995 / Gauss-Kruger CM 33E,1765,projected,4530,,4200,16306,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 6 (code 20006).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2466,Pulkovo 1995 / Gauss-Kruger CM 39E,1766,projected,4530,,4200,16307,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 7 (code 20007).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2467,Pulkovo 1995 / Gauss-Kruger CM 45E,1767,projected,4530,,4200,16308,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 8 (code 20008).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2468,Pulkovo 1995 / Gauss-Kruger CM 51E,1768,projected,4530,,4200,16309,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 9 (code 20009).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2469,Pulkovo 1995 / Gauss-Kruger CM 57E,1769,projected,4530,,4200,16310,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 10 (code 20010).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2470,Pulkovo 1995 / Gauss-Kruger CM 63E,1770,projected,4530,,4200,16311,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 11 (code 20011).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2471,Pulkovo 1995 / Gauss-Kruger CM 69E,1771,projected,4530,,4200,16312,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 12 (code 20012).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2472,Pulkovo 1995 / Gauss-Kruger CM 75E,1772,projected,4530,,4200,16313,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 13 (code 20013).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2473,Pulkovo 1995 / Gauss-Kruger CM 81E,1773,projected,4530,,4200,16314,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 14 (code 20014).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2474,Pulkovo 1995 / Gauss-Kruger CM 87E,1774,projected,4530,,4200,16315,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 15 (code 20015).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2475,Pulkovo 1995 / Gauss-Kruger CM 93E,1775,projected,4530,,4200,16316,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 16 (code 20016).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2476,Pulkovo 1995 / Gauss-Kruger CM 99E,1776,projected,4530,,4200,16317,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 17 (code 20017).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2477,Pulkovo 1995 / Gauss-Kruger CM 105E,1777,projected,4530,,4200,16318,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 18 (code 20018).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2478,Pulkovo 1995 / Gauss-Kruger CM 111E,1778,projected,4530,,4200,16319,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 19 (code 20019).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2479,Pulkovo 1995 / Gauss-Kruger CM 117E,1779,projected,4530,,4200,16320,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 20 (code 20020).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2480,Pulkovo 1995 / Gauss-Kruger CM 123E,1780,projected,4530,,4200,16321,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 21 (code 20021).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2481,Pulkovo 1995 / Gauss-Kruger CM 129E,1781,projected,4530,,4200,16322,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 22 (code 20022).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2482,Pulkovo 1995 / Gauss-Kruger CM 135E,1782,projected,4530,,4200,16323,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 23 (code 20023).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2483,Pulkovo 1995 / Gauss-Kruger CM 141E,1783,projected,4530,,4200,16324,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 24 (code 20024).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2484,Pulkovo 1995 / Gauss-Kruger CM 147E,1784,projected,4530,,4200,16325,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 25 (code 20025).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2485,Pulkovo 1995 / Gauss-Kruger CM 153E,1785,projected,4530,,4200,16326,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 26 (code 20026).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2486,Pulkovo 1995 / Gauss-Kruger CM 159E,1786,projected,4530,,4200,16327,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 27 (code 20027).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2487,Pulkovo 1995 / Gauss-Kruger CM 165E,1787,projected,4530,,4200,16328,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 28 (code 20028).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2488,Pulkovo 1995 / Gauss-Kruger CM 171E,1788,projected,4530,,4200,16329,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 29 (code 20029).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2489,Pulkovo 1995 / Gauss-Kruger CM 177E,1789,projected,4530,,4200,16330,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 30 (code 20030).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2490,Pulkovo 1995 / Gauss-Kruger CM 177W,1790,projected,4530,,4200,16331,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 31 (code 20031).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2491,Pulkovo 1995 / Gauss-Kruger CM 171W,1791,projected,4530,,4200,16332,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1995 / Gauss-Kruger zone 32 (code 20032).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,,1,0
+2492,Pulkovo 1942 / Gauss-Kruger CM 9E,1805,projected,4530,,4284,16302,,,Military mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 2 (code 28402).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2493,Pulkovo 1942 / Gauss-Kruger CM 15E,1792,projected,4530,,4284,16303,,,Military mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 3 (code 28403).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2494,Pulkovo 1942 / Gauss-Kruger CM 21E,1793,projected,4530,,4284,16304,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 4 (code 28404).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2495,Pulkovo 1942 / Gauss-Kruger CM 27E,1794,projected,4530,,4284,16305,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 5 (code 28405).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2496,Pulkovo 1942 / Gauss-Kruger CM 33E,1795,projected,4530,,4284,16306,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 6 (code 28406).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2497,Pulkovo 1942 / Gauss-Kruger CM 39E,1796,projected,4530,,4284,16307,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 7 (code 28407).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2498,Pulkovo 1942 / Gauss-Kruger CM 45E,1797,projected,4530,,4284,16308,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 8 (code 28408).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2499,Pulkovo 1942 / Gauss-Kruger CM 51E,1798,projected,4530,,4284,16309,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 9 (code 28409).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2500,Pulkovo 1942 / Gauss-Kruger CM 57E,1799,projected,4530,,4284,16310,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 10 (code 28410).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2501,Pulkovo 1942 / Gauss-Kruger CM 63E,1800,projected,4530,,4284,16311,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 11 (code 28411).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2502,Pulkovo 1942 / Gauss-Kruger CM 69E,1801,projected,4530,,4284,16312,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 12 (code 28412).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2503,Pulkovo 1942 / Gauss-Kruger CM 75E,1802,projected,4530,,4284,16313,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 13 (code 28413).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2504,Pulkovo 1942 / Gauss-Kruger CM 81E,1803,projected,4530,,4284,16314,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 14 (code 28414).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2505,Pulkovo 1942 / Gauss-Kruger CM 87E,1804,projected,4530,,4284,16315,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 15 (code 28415).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2506,Pulkovo 1942 / Gauss-Kruger CM 93E,1775,projected,4530,,4284,16316,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 16 (code 28416).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2507,Pulkovo 1942 / Gauss-Kruger CM 99E,1776,projected,4530,,4284,16317,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 17 (code 28417).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2508,Pulkovo 1942 / Gauss-Kruger CM 105E,1777,projected,4530,,4284,16318,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 18 (code 28418).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2509,Pulkovo 1942 / Gauss-Kruger CM 111E,1778,projected,4530,,4284,16319,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 19 (code 28419).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2510,Pulkovo 1942 / Gauss-Kruger CM 117E,1779,projected,4530,,4284,16320,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 20 (code 28420).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2511,Pulkovo 1942 / Gauss-Kruger CM 123E,1780,projected,4530,,4284,16321,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 21 (code 28421).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2512,Pulkovo 1942 / Gauss-Kruger CM 129E,1781,projected,4530,,4284,16322,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 22 (code 28422).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2513,Pulkovo 1942 / Gauss-Kruger CM 135E,1782,projected,4530,,4284,16323,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 23 (code 28423).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2514,Pulkovo 1942 / Gauss-Kruger CM 141E,1783,projected,4530,,4284,16324,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 24 (code 28424).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2515,Pulkovo 1942 / Gauss-Kruger CM 147E,1784,projected,4530,,4284,16325,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 25 (code 28425).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2516,Pulkovo 1942 / Gauss-Kruger CM 153E,1785,projected,4530,,4284,16326,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 26 (code 28426).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2517,Pulkovo 1942 / Gauss-Kruger CM 159E,1786,projected,4530,,4284,16327,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 27 (code 28427).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2518,Pulkovo 1942 / Gauss-Kruger CM 165E,1787,projected,4530,,4284,16328,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 28 (code 28428).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2519,Pulkovo 1942 / Gauss-Kruger CM 171E,1788,projected,4530,,4284,16329,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 29 (code 28429).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2520,Pulkovo 1942 / Gauss-Kruger CM 177E,1789,projected,4530,,4284,16330,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 30 (code 28430).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2521,Pulkovo 1942 / Gauss-Kruger CM 177W,1790,projected,4530,,4284,16331,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 31 (code 28431).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2522,Pulkovo 1942 / Gauss-Kruger CM 171W,1791,projected,4530,,4284,16332,,,Medium scale topographic mapping.,Truncated form of Pulkovo 1942 / Gauss-Kruger zone 32 (code 28432).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2523,Pulkovo 1942 / 3-degree Gauss-Kruger zone 7,2653,projected,4530,,4284,16267,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E (code 2582).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2524,Pulkovo 1942 / 3-degree Gauss-Kruger zone 8,2654,projected,4530,,4284,16268,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E (code 2583).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2525,Pulkovo 1942 / 3-degree Gauss-Kruger zone 9,2655,projected,4530,,4284,16269,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E (code 2584).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2526,Pulkovo 1942 / 3-degree Gauss-Kruger zone 10,2656,projected,4530,,4284,16270,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E (code 2585).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2527,Pulkovo 1942 / 3-degree Gauss-Kruger zone 11,2657,projected,4530,,4284,16271,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E (code 2586).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2528,Pulkovo 1942 / 3-degree Gauss-Kruger zone 12,2658,projected,4530,,4284,16272,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E (code 2587).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2529,Pulkovo 1942 / 3-degree Gauss-Kruger zone 13,2659,projected,4530,,4284,16273,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E (code 2588).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2530,Pulkovo 1942 / 3-degree Gauss-Kruger zone 14,2660,projected,4530,,4284,16274,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E (code 2589).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2531,Pulkovo 1942 / 3-degree Gauss-Kruger zone 15,2661,projected,4530,,4284,16275,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E (code 2590).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2532,Pulkovo 1942 / 3-degree Gauss-Kruger zone 16,2662,projected,4530,,4284,16276,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E (code 2591).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2533,Pulkovo 1942 / 3-degree Gauss-Kruger zone 17,2663,projected,4530,,4284,16277,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E (code 2592).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2534,Pulkovo 1942 / 3-degree Gauss-Kruger zone 18,2664,projected,4530,,4284,16278,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E (code 2593).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2535,Pulkovo 1942 / 3-degree Gauss-Kruger zone 19,2665,projected,4530,,4284,16279,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E (code 2594).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2536,Pulkovo 1942 / 3-degree Gauss-Kruger zone 20,2666,projected,4530,,4284,16280,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E (code 2595).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2537,Pulkovo 1942 / 3-degree Gauss-Kruger zone 21,2667,projected,4530,,4284,16281,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E (code 2596).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2538,Pulkovo 1942 / 3-degree Gauss-Kruger zone 22,2668,projected,4530,,4284,16282,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E (code 2597).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2539,Pulkovo 1942 / 3-degree Gauss-Kruger zone 23,2669,projected,4530,,4284,16283,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E (code 2598).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2540,Pulkovo 1942 / 3-degree Gauss-Kruger zone 24,2670,projected,4530,,4284,16284,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E (code 2599).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2541,Pulkovo 1942 / 3-degree Gauss-Kruger zone 25,2671,projected,4530,,4284,16285,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E (code 2601).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2542,Pulkovo 1942 / 3-degree Gauss-Kruger zone 26,2672,projected,4530,,4284,16286,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E (code 2602).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2543,Pulkovo 1942 / 3-degree Gauss-Kruger zone 27,2673,projected,4530,,4284,16287,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E (code 2603).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2544,Pulkovo 1942 / 3-degree Gauss-Kruger zone 28,2674,projected,4530,,4284,16288,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E (code 2604).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2545,Pulkovo 1942 / 3-degree Gauss-Kruger zone 29,2675,projected,4530,,4284,16289,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E (code 2605).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2546,Pulkovo 1942 / 3-degree Gauss-Kruger zone 30,2676,projected,4530,,4284,16290,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E (code 2606).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2547,Pulkovo 1942 / 3-degree Gauss-Kruger zone 31,2677,projected,4530,,4284,16291,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E (code 2607).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2548,Pulkovo 1942 / 3-degree Gauss-Kruger zone 32,2678,projected,4530,,4284,16292,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E (code 2608).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2549,Pulkovo 1942 / 3-degree Gauss-Kruger zone 33,2679,projected,4530,,4284,16293,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E (code 2609).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2550,Samboja / UTM zone 50S,1328,projected,4400,,4125,16150,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,1
+2551,Pulkovo 1942 / 3-degree Gauss-Kruger zone 34,2680,projected,4530,,4284,16294,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E (code 2610).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2552,Pulkovo 1942 / 3-degree Gauss-Kruger zone 35,2681,projected,4530,,4284,16295,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E (code 2611).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2553,Pulkovo 1942 / 3-degree Gauss-Kruger zone 36,2682,projected,4530,,4284,16296,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E (code 2612).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2554,Pulkovo 1942 / 3-degree Gauss-Kruger zone 37,2683,projected,4530,,4284,16297,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E (code 2613).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2555,Pulkovo 1942 / 3-degree Gauss-Kruger zone 38,2684,projected,4530,,4284,16298,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E (code 2614).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2556,Pulkovo 1942 / 3-degree Gauss-Kruger zone 39,2685,projected,4530,,4284,16299,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E (code 2615).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2557,Pulkovo 1942 / 3-degree Gauss-Kruger zone 40,2686,projected,4530,,4284,16070,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E (code 2616).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2558,Pulkovo 1942 / 3-degree Gauss-Kruger zone 41,2687,projected,4530,,4284,16071,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E (code 2617).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2559,Pulkovo 1942 / 3-degree Gauss-Kruger zone 42,2688,projected,4530,,4284,16072,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E (code 2618).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2560,Pulkovo 1942 / 3-degree Gauss-Kruger zone 43,2689,projected,4530,,4284,16073,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E (code 2619).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2561,Pulkovo 1942 / 3-degree Gauss-Kruger zone 44,2690,projected,4530,,4284,16074,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E (code 2620).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2562,Pulkovo 1942 / 3-degree Gauss-Kruger zone 45,2691,projected,4530,,4284,16075,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E (code 2621).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2563,Pulkovo 1942 / 3-degree Gauss-Kruger zone 46,2692,projected,4530,,4284,16076,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E (code 2622).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2564,Pulkovo 1942 / 3-degree Gauss-Kruger zone 47,2693,projected,4530,,4284,16077,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E (code 2623).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2565,Pulkovo 1942 / 3-degree Gauss-Kruger zone 48,2694,projected,4530,,4284,16078,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E (code 2624).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2566,Pulkovo 1942 / 3-degree Gauss-Kruger zone 49,2695,projected,4530,,4284,16079,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E (code 2625).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2567,Pulkovo 1942 / 3-degree Gauss-Kruger zone 50,2696,projected,4530,,4284,16080,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E (code 2626).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2568,Pulkovo 1942 / 3-degree Gauss-Kruger zone 51,2697,projected,4530,,4284,16081,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E (code 2627).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2569,Pulkovo 1942 / 3-degree Gauss-Kruger zone 52,2698,projected,4530,,4284,16082,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E (code 2628).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2570,Pulkovo 1942 / 3-degree Gauss-Kruger zone 53,2699,projected,4530,,4284,16083,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E (code 2629).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2571,Pulkovo 1942 / 3-degree Gauss-Kruger zone 54,2700,projected,4530,,4284,16084,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E (code 2630).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2572,Pulkovo 1942 / 3-degree Gauss-Kruger zone 55,2701,projected,4530,,4284,16085,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E (code 2631).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2573,Pulkovo 1942 / 3-degree Gauss-Kruger zone 56,2702,projected,4530,,4284,16086,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E (code 2632).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2574,Pulkovo 1942 / 3-degree Gauss-Kruger zone 57,2703,projected,4530,,4284,16087,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E (code 2633).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2575,Pulkovo 1942 / 3-degree Gauss-Kruger zone 58,2704,projected,4530,,4284,16088,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E (code 2634).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2576,Pulkovo 1942 / 3-degree Gauss-Kruger zone 59,2705,projected,4530,,4284,16089,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E (code 2635).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2577,Pulkovo 1942 / 3-degree Gauss-Kruger zone 60,2706,projected,4530,,4284,16090,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E (code 2636).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2578,Pulkovo 1942 / 3-degree Gauss-Kruger zone 61,2707,projected,4530,,4284,16091,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W (code 2637).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2579,Pulkovo 1942 / 3-degree Gauss-Kruger zone 62,2708,projected,4530,,4284,16092,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W (code 2638).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2580,Pulkovo 1942 / 3-degree Gauss-Kruger zone 63,2709,projected,4530,,4284,16093,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W (code 2639).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2581,Pulkovo 1942 / 3-degree Gauss-Kruger zone 64,2710,projected,4530,,4284,16094,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W (code 2640).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2582,Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E,2747,projected,4530,,4284,16367,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 7 (code 2523).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2583,Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E,2654,projected,4530,,4284,16368,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 8 (code 2524).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2584,Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E,2655,projected,4530,,4284,16369,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 9 (code 2525).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2585,Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E,2656,projected,4530,,4284,16370,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 10 (code 2526).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2586,Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E,2657,projected,4530,,4284,16371,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 11 (code 2527).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2587,Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E,2658,projected,4530,,4284,16372,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 12 (code 2528).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2588,Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E,2659,projected,4530,,4284,16373,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 13 (code 2529).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2589,Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E,2660,projected,4530,,4284,16374,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 14 (code 2530).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2590,Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E,2661,projected,4530,,4284,16375,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 15 (code 2531).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2591,Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E,2662,projected,4530,,4284,16376,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 16 (code 2532).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2592,Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E,2663,projected,4530,,4284,16377,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 17 (code 2533).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2593,Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E,2664,projected,4530,,4284,16378,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 18 (code 2534).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2594,Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E,2665,projected,4530,,4284,16379,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 19 (code 2535).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2595,Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E,2666,projected,4530,,4284,16380,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 20 (code 2536).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2596,Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E,2667,projected,4530,,4284,16381,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 21 (code 2537).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2597,Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E,2668,projected,4530,,4284,16382,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 22 (code 2538).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2598,Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E,2669,projected,4530,,4284,16383,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 23 (code 2539).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2599,Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E,2670,projected,4530,,4284,16384,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 24 (code 2540).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2600,Lietuvos Koordinoei Sistema 1994,1145,projected,4530,,4126,19934,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1998-03-12 00:00:00,,1,0
+2601,Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E,2671,projected,4530,,4284,16385,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 25 (code 2541).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2602,Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E,2672,projected,4530,,4284,16386,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 26 (code 2542).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2603,Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E,2673,projected,4530,,4284,16387,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 27 (code 2543).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2604,Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E,2674,projected,4530,,4284,16388,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 28 (code 2544).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2605,Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E,2675,projected,4530,,4284,16389,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 29 (code 2545).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2606,Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E,2676,projected,4530,,4284,16390,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 30 (code 2546).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2607,Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E,2677,projected,4530,,4284,16391,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 31 (code 2547).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2608,Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E,2678,projected,4530,,4284,16392,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 32 (code 2548).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2609,Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E,2679,projected,4530,,4284,16393,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 33 (code 2549).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2610,Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E,2680,projected,4530,,4284,16394,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 34 (code 2551).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2611,Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E,2681,projected,4530,,4284,16395,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 35 (code 2552).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2612,Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E,2682,projected,4530,,4284,16396,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 36 (code 2553).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2613,Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E,2683,projected,4530,,4284,16397,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 37 (code 2554).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2614,Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E,2684,projected,4530,,4284,16398,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 38 (code 2555).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2615,Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E,2685,projected,4530,,4284,16399,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 39 (code 2556).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2616,Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E,2686,projected,4530,,4284,16170,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 40 (code 2557).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2617,Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E,2687,projected,4530,,4284,16171,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 41 (code 2558).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2618,Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E,2688,projected,4530,,4284,16172,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 42 (code 2559).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2619,Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E,2689,projected,4530,,4284,16173,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 43 (code 2560).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2620,Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E,2690,projected,4530,,4284,16174,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 44 (code 2561).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2621,Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E,2691,projected,4530,,4284,16175,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 45 (code 2562).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2622,Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E,2692,projected,4530,,4284,16176,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 46 (code 2563).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2623,Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E,2693,projected,4530,,4284,16177,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 47 (code 2564).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2624,Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E,2694,projected,4530,,4284,16178,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 48 (code 2565).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2625,Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E,2695,projected,4530,,4284,16179,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 49 (code 2566).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2626,Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E,2696,projected,4530,,4284,16180,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 50 (code 2567).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2627,Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E,2697,projected,4530,,4284,16181,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 51 (code 2568).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2628,Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E,2698,projected,4530,,4284,16182,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 52 (code 2569).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2629,Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E,2699,projected,4530,,4284,16183,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 53 (code 2570).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2630,Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E,2700,projected,4530,,4284,16184,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 54 (code 2571).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2631,Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E,2701,projected,4530,,4284,16185,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 55 (code 2572).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2632,Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E,2702,projected,4530,,4284,16186,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 56 (code 2573).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2633,Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E,2703,projected,4530,,4284,16187,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 57 (code 2574).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2634,Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E,2704,projected,4530,,4284,16188,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 58 (code 2575).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2635,Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E,2705,projected,4530,,4284,16189,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 59 (code 2576).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2636,Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E,2706,projected,4530,,4284,16190,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 60 (code 2577).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2637,Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W,2707,projected,4530,,4284,16191,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 61 (code 2578).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2638,Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W,2708,projected,4530,,4284,16192,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 62 (code 2579).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2639,Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W,2709,projected,4530,,4284,16193,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 63 (code 2580).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2640,Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W,2710,projected,4530,,4284,16194,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1942 / 3-degree Gauss-Kruger zone 64 (code 2581).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2641,Pulkovo 1995 / 3-degree Gauss-Kruger zone 7,2747,projected,4530,,4284,16267,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E (code 2699).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2642,Pulkovo 1995 / 3-degree Gauss-Kruger zone 8,2748,projected,4530,,4284,16268,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E (code 2700).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2643,Pulkovo 1995 / 3-degree Gauss-Kruger zone 9,2749,projected,4530,,4284,16269,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E (code 2701).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2644,Pulkovo 1995 / 3-degree Gauss-Kruger zone 10,2750,projected,4530,,4284,16270,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E (code 2702).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2645,Pulkovo 1995 / 3-degree Gauss-Kruger zone 11,2751,projected,4530,,4284,16271,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E (code 2703).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2646,Pulkovo 1995 / 3-degree Gauss-Kruger zone 12,2752,projected,4530,,4284,16272,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E (code 2704).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2647,Pulkovo 1995 / 3-degree Gauss-Kruger zone 13,2753,projected,4530,,4284,16273,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E (code 2705).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2648,Pulkovo 1995 / 3-degree Gauss-Kruger zone 14,2754,projected,4530,,4284,16274,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E (code 2706).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2649,Pulkovo 1995 / 3-degree Gauss-Kruger zone 15,2755,projected,4530,,4284,16275,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E (code 2707).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2650,Pulkovo 1995 / 3-degree Gauss-Kruger zone 16,2756,projected,4530,,4284,16276,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E (code 2708).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2651,Pulkovo 1995 / 3-degree Gauss-Kruger zone 17,2757,projected,4530,,4284,16277,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E (code 2709).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2652,Pulkovo 1995 / 3-degree Gauss-Kruger zone 18,2758,projected,4530,,4284,16278,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E (code 2710).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2653,Pulkovo 1995 / 3-degree Gauss-Kruger zone 19,2759,projected,4530,,4284,16279,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E (code 2711).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2654,Pulkovo 1995 / 3-degree Gauss-Kruger zone 20,2760,projected,4530,,4284,16280,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E (code 2712).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2655,Pulkovo 1995 / 3-degree Gauss-Kruger zone 21,2761,projected,4530,,4284,16281,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E (code 2713).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2656,Pulkovo 1995 / 3-degree Gauss-Kruger zone 22,2762,projected,4530,,4284,16282,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E (code 2714).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2657,Pulkovo 1995 / 3-degree Gauss-Kruger zone 23,2763,projected,4530,,4284,16283,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E (code 2715).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2658,Pulkovo 1995 / 3-degree Gauss-Kruger zone 24,2764,projected,4530,,4284,16284,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E (code 2716).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2659,Pulkovo 1995 / 3-degree Gauss-Kruger zone 25,2765,projected,4530,,4284,16285,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E (code 2717).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2660,Pulkovo 1995 / 3-degree Gauss-Kruger zone 26,2766,projected,4530,,4284,16286,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E (code 2718).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2661,Pulkovo 1995 / 3-degree Gauss-Kruger zone 27,2767,projected,4530,,4284,16287,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E (code 2719).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2662,Pulkovo 1995 / 3-degree Gauss-Kruger zone 28,2768,projected,4530,,4284,16288,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E (code 2720).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2663,Pulkovo 1995 / 3-degree Gauss-Kruger zone 29,2769,projected,4530,,4284,16289,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E (code 2721).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2664,Pulkovo 1995 / 3-degree Gauss-Kruger zone 30,2676,projected,4530,,4284,16290,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E (code 2722).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2665,Pulkovo 1995 / 3-degree Gauss-Kruger zone 31,2677,projected,4530,,4284,16291,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E (code 2723).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2666,Pulkovo 1995 / 3-degree Gauss-Kruger zone 32,2678,projected,4530,,4284,16292,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E (code 2724).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2667,Pulkovo 1995 / 3-degree Gauss-Kruger zone 33,2679,projected,4530,,4284,16293,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E (code 2725).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2668,Pulkovo 1995 / 3-degree Gauss-Kruger zone 34,2680,projected,4530,,4284,16294,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E (code 2726).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2669,Pulkovo 1995 / 3-degree Gauss-Kruger zone 35,2681,projected,4530,,4284,16295,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E (code 2727).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2670,Pulkovo 1995 / 3-degree Gauss-Kruger zone 36,2682,projected,4530,,4284,16296,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E (code 2728).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2671,Pulkovo 1995 / 3-degree Gauss-Kruger zone 37,2683,projected,4530,,4284,16297,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E (code 2729).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2672,Pulkovo 1995 / 3-degree Gauss-Kruger zone 38,2684,projected,4530,,4284,16298,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E (code 2730).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2673,Pulkovo 1995 / 3-degree Gauss-Kruger zone 39,2685,projected,4530,,4284,16299,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E (code 2731).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2674,Pulkovo 1995 / 3-degree Gauss-Kruger zone 40,2686,projected,4530,,4284,16070,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E (code 2732).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2675,Pulkovo 1995 / 3-degree Gauss-Kruger zone 41,2687,projected,4530,,4284,16071,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E (code 2733).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2676,Pulkovo 1995 / 3-degree Gauss-Kruger zone 42,2688,projected,4530,,4284,16072,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E (code 2734).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2677,Pulkovo 1995 / 3-degree Gauss-Kruger zone 43,2689,projected,4530,,4284,16073,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E (code 2735).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2678,Pulkovo 1995 / 3-degree Gauss-Kruger zone 44,2690,projected,4530,,4284,16074,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E (code 2738).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2679,Pulkovo 1995 / 3-degree Gauss-Kruger zone 45,2691,projected,4530,,4284,16075,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E (code 2739).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2680,Pulkovo 1995 / 3-degree Gauss-Kruger zone 46,2692,projected,4530,,4284,16076,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E (code 2740).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2681,Pulkovo 1995 / 3-degree Gauss-Kruger zone 47,2693,projected,4530,,4284,16077,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E (code 2741).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2682,Pulkovo 1995 / 3-degree Gauss-Kruger zone 48,2694,projected,4530,,4284,16078,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E (code 2742).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2683,Pulkovo 1995 / 3-degree Gauss-Kruger zone 49,2695,projected,4530,,4284,16079,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E (code 2743).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2684,Pulkovo 1995 / 3-degree Gauss-Kruger zone 50,2696,projected,4530,,4284,16080,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E (code 2744).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2685,Pulkovo 1995 / 3-degree Gauss-Kruger zone 51,2697,projected,4530,,4284,16081,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E (code 2745).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2686,Pulkovo 1995 / 3-degree Gauss-Kruger zone 52,2698,projected,4530,,4284,16082,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E (code 2746).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2687,Pulkovo 1995 / 3-degree Gauss-Kruger zone 53,2699,projected,4530,,4284,16083,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E (code 2747).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2688,Pulkovo 1995 / 3-degree Gauss-Kruger zone 54,2700,projected,4530,,4284,16084,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E (code 2748).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2689,Pulkovo 1995 / 3-degree Gauss-Kruger zone 55,2701,projected,4530,,4284,16085,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E (code 2749).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2690,Pulkovo 1995 / 3-degree Gauss-Kruger zone 56,2702,projected,4530,,4284,16086,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E (code 2750).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2691,Pulkovo 1995 / 3-degree Gauss-Kruger zone 57,2703,projected,4530,,4284,16087,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E (code 2751).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2692,Pulkovo 1995 / 3-degree Gauss-Kruger zone 58,2704,projected,4530,,4284,16088,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E (code 2752).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2693,Pulkovo 1995 / 3-degree Gauss-Kruger zone 59,2705,projected,4530,,4284,16089,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E (code 2753).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2694,Pulkovo 1995 / 3-degree Gauss-Kruger zone 60,2706,projected,4530,,4284,16090,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E (code 2754).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2695,Pulkovo 1995 / 3-degree Gauss-Kruger zone 61,2707,projected,4530,,4284,16091,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W (code 2755).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2696,Pulkovo 1995 / 3-degree Gauss-Kruger zone 62,2708,projected,4530,,4284,16092,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W (code 2756).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2697,Pulkovo 1995 / 3-degree Gauss-Kruger zone 63,2709,projected,4530,,4284,16093,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W (code 2757).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2698,Pulkovo 1995 / 3-degree Gauss-Kruger zone 64,2710,projected,4530,,4284,16094,,,"Large scale topographic mapping, cadastral and engineering survey.",Also found with truncated false easting - see Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W (code 2758).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2699,Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E,2747,projected,4530,,4284,16367,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 7 (code 2641).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2700,Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E,2654,projected,4530,,4284,16368,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 8 (code 2642).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2701,Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E,2655,projected,4530,,4284,16369,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 9 (code 2643).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2702,Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E,2656,projected,4530,,4284,16370,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 10 (code 2644).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2703,Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E,2657,projected,4530,,4284,16371,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 11 (code 2645).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2704,Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E,2658,projected,4530,,4284,16372,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 12 (code 2646).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2705,Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E,2659,projected,4530,,4284,16373,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 13 (code 2647).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2706,Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E,2660,projected,4530,,4284,16374,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 14 (code 2648).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2707,Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E,2661,projected,4530,,4284,16375,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 15 (code 2649).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2708,Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E,2662,projected,4530,,4284,16376,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 16 (code 2650).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2709,Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E,2663,projected,4530,,4284,16377,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 17 (code 2651).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2710,Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E,2664,projected,4530,,4284,16378,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 18 (code 2652).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2711,Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E,2665,projected,4530,,4284,16379,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 19 (code 2653).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2712,Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E,2666,projected,4530,,4284,16380,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 20 (code 2654).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2713,Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E,2667,projected,4530,,4284,16381,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 21 (code 2655).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2714,Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E,2668,projected,4530,,4284,16382,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 22 (code 2656).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2715,Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E,2669,projected,4530,,4284,16383,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 23 (code 2657).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2716,Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E,2670,projected,4530,,4284,16384,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 24 (code 2658).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2717,Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E,2671,projected,4530,,4284,16385,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 25 (code 2659).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2718,Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E,2672,projected,4530,,4284,16386,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 26 (code 2660).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2719,Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E,2673,projected,4530,,4284,16387,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 27 (code 2661).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2720,Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E,2674,projected,4530,,4284,16388,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 28 (code 2662).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2721,Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E,2675,projected,4530,,4284,16389,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 29 (code 2663).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2722,Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E,2676,projected,4530,,4284,16390,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 30 (code 2664).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2723,Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E,2677,projected,4530,,4284,16391,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 31 (code 2665).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2724,Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E,2678,projected,4530,,4284,16392,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 32 (code 2666).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2725,Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E,2679,projected,4530,,4284,16393,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 33 (code 2667).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2726,Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E,2680,projected,4530,,4284,16394,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 34 (code 2668).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2727,Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E,2681,projected,4530,,4284,16395,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 35 (code 2669).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2728,Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E,2682,projected,4530,,4284,16396,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 36 (code 2670).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2729,Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E,2683,projected,4530,,4284,16397,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 37 (code 2671).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2730,Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E,2684,projected,4530,,4284,16398,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 38 (code 2672).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2731,Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E,2685,projected,4530,,4284,16399,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 39 (code 2673).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2732,Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E,2686,projected,4530,,4284,16170,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 40 (code 2674).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2733,Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E,2687,projected,4530,,4284,16171,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 41 (code 2675).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2734,Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E,2688,projected,4530,,4284,16172,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 42 (code 2676).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2735,Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E,2689,projected,4530,,4284,16173,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 43 (code 2677).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2736,Tete / UTM zone 36S,1540,projected,4400,,4127,16136,,,Large and medium scale topographic mapping and engineering survey.,,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+2737,Tete / UTM zone 37S,1541,projected,4400,,4127,16137,,,Large and medium scale topographic mapping and engineering survey.,,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+2738,Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E,2690,projected,4530,,4284,16174,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 44 (code 2678).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2739,Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E,2691,projected,4530,,4284,16175,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 45 (code 2679).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2740,Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E,2692,projected,4530,,4284,16176,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 46 (code 2680).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2741,Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E,2693,projected,4530,,4284,16177,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 47 (code 2681).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2742,Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E,2694,projected,4530,,4284,16178,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 48 (code 2682).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2743,Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E,2695,projected,4530,,4284,16179,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 49 (code 2683).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2744,Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E,2696,projected,4530,,4284,16180,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 50 (code 2684).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2745,Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E,2697,projected,4530,,4284,16181,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 51 (code 2685).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2746,Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E,2698,projected,4530,,4284,16182,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 52 (code 2686).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2747,Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E,2699,projected,4530,,4284,16183,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 53 (code 2687).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2748,Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E,2700,projected,4530,,4284,16184,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 54 (code 2688).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2749,Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E,2701,projected,4530,,4284,16185,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 55 (code 2689).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2750,Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E,2702,projected,4530,,4284,16186,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 56 (code 2690).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2751,Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E,2703,projected,4530,,4284,16187,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 57 (code 2691).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2752,Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E,2704,projected,4530,,4284,16188,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 58 (code 2692).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2753,Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E,2705,projected,4530,,4284,16189,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 59 (code 2693).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2754,Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E,2706,projected,4530,,4284,16190,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 60 (code 2694).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2755,Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W,2707,projected,4530,,4284,16191,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 61 (code 2695).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2756,Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W,2708,projected,4530,,4284,16192,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 62 (code 2696).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2757,Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W,2709,projected,4530,,4284,16193,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 63 (code 2697).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2758,Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W,2710,projected,4530,,4284,16194,,,"Large scale topographic mapping, cadastral and engineering survey.",Truncated form of Pulkovo 1995 / 3-degree Gauss-Kruger zone 64 (code 2698).,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2759,NAD83(HARN) / Alabama East,2154,projected,4499,,4152,10131,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2760,NAD83(HARN) / Alabama West,2155,projected,4499,,4152,10132,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2761,NAD83(HARN) / Arizona East,2167,projected,4499,,4152,10231,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2222 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2762,NAD83(HARN) / Arizona Central,2166,projected,4499,,4152,10232,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2223 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2763,NAD83(HARN) / Arizona West,2168,projected,4499,,4152,10233,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2224 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2764,NAD83(HARN) / Arkansas North,2169,projected,4499,,4152,10331,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2765,NAD83(HARN) / Arkansas South,2170,projected,4499,,4152,10332,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2766,NAD83(HARN) / California zone 1,2175,projected,4499,,4152,10431,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2225 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2767,NAD83(HARN) / California zone 2,2176,projected,4499,,4152,10432,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2226 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2768,NAD83(HARN) / California zone 3,2177,projected,4499,,4152,10433,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2227 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2769,NAD83(HARN) / California zone 4,2178,projected,4499,,4152,10434,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2228 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2770,NAD83(HARN) / California zone 5,2182,projected,4499,,4152,10435,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2229 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2771,NAD83(HARN) / California zone 6,2180,projected,4499,,4152,10436,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2230 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2772,NAD83(HARN) / Colorado North,2184,projected,4499,,4152,10531,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2231 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2773,NAD83(HARN) / Colorado Central,2183,projected,4499,,4152,10532,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2232 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2774,NAD83(HARN) / Colorado South,2185,projected,4499,,4152,10533,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2233 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2775,NAD83(HARN) / Connecticut,1377,projected,4499,,4152,10630,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2234 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2776,NAD83(HARN) / Delaware,1378,projected,4499,,4152,10730,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2235 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2777,NAD83(HARN) / Florida East,2186,projected,4499,,4152,10931,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2236 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2778,NAD83(HARN) / Florida West,2188,projected,4499,,4152,10932,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2237 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2779,NAD83(HARN) / Florida North,2187,projected,4499,,4152,10933,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2238 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2780,NAD83(HARN) / Georgia East,2189,projected,4499,,4152,11031,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2239 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2781,NAD83(HARN) / Georgia West,2190,projected,4499,,4152,11032,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2240 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2782,NAD83(HARN) / Hawaii zone 1,1546,projected,4499,,4152,15131,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2783,NAD83(HARN) / Hawaii zone 2,1547,projected,4499,,4152,15132,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2784,NAD83(HARN) / Hawaii zone 3,1548,projected,4499,,4152,15133,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2785,NAD83(HARN) / Hawaii zone 4,1549,projected,4499,,4152,15134,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2786,NAD83(HARN) / Hawaii zone 5,1550,projected,4499,,4152,15135,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2787,NAD83(HARN) / Idaho East,2192,projected,4499,,4152,11131,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2241 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2788,NAD83(HARN) / Idaho Central,2191,projected,4499,,4152,11132,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2242 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2789,NAD83(HARN) / Idaho West,2193,projected,4499,,4152,11133,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2243 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2790,NAD83(HARN) / Illinois East,2194,projected,4499,,4152,11231,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2791,NAD83(HARN) / Illinois West,2195,projected,4499,,4152,11232,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2792,NAD83(HARN) / Indiana East,2196,projected,4499,,4152,11331,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2244 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2793,NAD83(HARN) / Indiana West,2197,projected,4499,,4152,11332,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2245 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2794,NAD83(HARN) / Iowa North,2198,projected,4499,,4152,11431,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2795,NAD83(HARN) / Iowa South,2199,projected,4499,,4152,11432,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2796,NAD83(HARN) / Kansas North,2200,projected,4499,,4152,11531,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2797,NAD83(HARN) / Kansas South,2201,projected,4499,,4152,11532,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2798,NAD83(HARN) / Kentucky North,2202,projected,4499,,4152,15303,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2246 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2799,NAD83(HARN) / Kentucky South,2203,projected,4499,,4152,11632,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2247 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2800,NAD83(HARN) / Louisiana North,2204,projected,4499,,4152,11731,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2801,NAD83(HARN) / Louisiana South,2529,projected,4499,,4152,11732,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2802,NAD83(HARN) / Maine East,2206,projected,4499,,4152,11831,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2803,NAD83(HARN) / Maine West,2207,projected,4499,,4152,11832,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2804,NAD83(HARN) / Maryland,1389,projected,4499,,4152,11930,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2248 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2805,NAD83(HARN) / Massachusetts Mainland,2209,projected,4499,,4152,12031,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2249 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2806,NAD83(HARN) / Massachusetts Island,2208,projected,4499,,4152,12032,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2250 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2807,NAD83(HARN) / Michigan North,1723,projected,4499,,4152,12141,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2251 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2808,NAD83(HARN) / Michigan Central,1724,projected,4499,,4152,12142,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2252 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2809,NAD83(HARN) / Michigan South,1725,projected,4499,,4152,12143,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2253 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2810,NAD83(HARN) / Minnesota North,2214,projected,4499,,4152,12231,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2811,NAD83(HARN) / Minnesota Central,2213,projected,4499,,4152,12232,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2812,NAD83(HARN) / Minnesota South,2215,projected,4499,,4152,12233,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2813,NAD83(HARN) / Mississippi East,2216,projected,4499,,4152,12331,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2254 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2814,NAD83(HARN) / Mississippi West,2217,projected,4499,,4152,12332,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2255 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2815,NAD83(HARN) / Missouri East,2219,projected,4499,,4152,12431,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2816,NAD83(HARN) / Missouri Central,2218,projected,4499,,4152,12432,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2817,NAD83(HARN) / Missouri West,2220,projected,4499,,4152,12433,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2818,NAD83(HARN) / Montana,1395,projected,4499,,4152,12530,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2256 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2819,NAD83(HARN) / Nebraska,1396,projected,4499,,4152,12630,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2820,NAD83(HARN) / Nevada East,2224,projected,4499,,4152,12731,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2821,NAD83(HARN) / Nevada Central,2223,projected,4499,,4152,12732,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2822,NAD83(HARN) / Nevada West,2225,projected,4499,,4152,12733,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2823,NAD83(HARN) / New Hampshire,1398,projected,4499,,4152,12830,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2824,NAD83(HARN) / New Jersey,1399,projected,4499,,4152,12930,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2825,NAD83(HARN) / New Mexico East,2228,projected,4499,,4152,13031,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2257 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2826,NAD83(HARN) / New Mexico Central,2231,projected,4499,,4152,13032,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2258 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2827,NAD83(HARN) / New Mexico West,2232,projected,4499,,4152,13033,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2259 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2828,NAD83(HARN) / New York East,2234,projected,4499,,4152,13131,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2260 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2829,NAD83(HARN) / New York Central,2233,projected,4499,,4152,13132,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2261 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2830,NAD83(HARN) / New York West,2236,projected,4499,,4152,13133,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2263 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2831,NAD83(HARN) / New York Long Island,2235,projected,4499,,4152,13134,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2264 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2832,NAD83(HARN) / North Dakota North,2237,projected,4499,,4152,13331,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2265 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2833,NAD83(HARN) / North Dakota South,2238,projected,4499,,4152,13332,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2266 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2834,NAD83(HARN) / Ohio North,2239,projected,4499,,4152,13431,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2835,NAD83(HARN) / Ohio South,2240,projected,4499,,4152,13432,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2836,NAD83(HARN) / Oklahoma North,2241,projected,4499,,4152,13531,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2267 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2837,NAD83(HARN) / Oklahoma South,2242,projected,4499,,4152,13532,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2268 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2838,NAD83(HARN) / Oregon North,2243,projected,4499,,4152,13631,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2269 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2839,NAD83(HARN) / Oregon South,2244,projected,4499,,4152,13632,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2270 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2840,NAD83(HARN) / Rhode Island,1408,projected,4499,,4152,13830,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2841,NAD83(HARN) / South Dakota North,2249,projected,4499,,4152,14031,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2842,NAD83(HARN) / South Dakota South,2250,projected,4499,,4152,14032,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2843,NAD83(HARN) / Tennessee,1411,projected,4499,,4152,14130,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2274 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2844,NAD83(HARN) / Texas North,2253,projected,4499,,4152,14231,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2275 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2845,NAD83(HARN) / Texas North Central,2254,projected,4499,,4152,14232,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2276 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2846,NAD83(HARN) / Texas Central,2252,projected,4499,,4152,14233,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2277 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2847,NAD83(HARN) / Texas South Central,2527,projected,4499,,4152,14234,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2278 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2848,NAD83(HARN) / Texas South,2528,projected,4499,,4152,14235,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2279 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2849,NAD83(HARN) / Utah North,2258,projected,4499,,4152,14331,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2280 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2850,NAD83(HARN) / Utah Central,2257,projected,4499,,4152,14332,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2281 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2851,NAD83(HARN) / Utah South,2259,projected,4499,,4152,14333,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2282 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2852,NAD83(HARN) / Vermont,1414,projected,4499,,4152,14430,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2853,NAD83(HARN) / Virginia North,2260,projected,4499,,4152,14531,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2283 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2854,NAD83(HARN) / Virginia South,2261,projected,4499,,4152,14532,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2284 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2855,NAD83(HARN) / Washington North,2273,projected,4499,,4152,14631,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2285 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2856,NAD83(HARN) / Washington South,2274,projected,4499,,4152,14632,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2286 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2857,NAD83(HARN) / West Virginia North,2264,projected,4499,,4152,14731,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2858,NAD83(HARN) / West Virginia South,2265,projected,4499,,4152,14732,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2859,NAD83(HARN) / Wisconsin North,2267,projected,4499,,4152,14831,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2287 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2860,NAD83(HARN) / Wisconsin Central,2266,projected,4499,,4152,14832,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2288 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2861,NAD83(HARN) / Wisconsin South,2268,projected,4499,,4152,14833,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2289 for equivalent non-metric definition.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2862,NAD83(HARN) / Wyoming East,2269,projected,4499,,4152,14931,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2863,NAD83(HARN) / Wyoming East Central,2270,projected,4499,,4152,14932,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2864,NAD83(HARN) / Wyoming West Central,2272,projected,4499,,4152,14933,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2865,NAD83(HARN) / Wyoming West,2271,projected,4499,,4152,14934,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2866,NAD83(HARN) / Puerto Rico & Virgin Is.,2251,projected,4499,,4152,15230,,,Large and medium scale topographic mapping and engineering survey.,,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2867,NAD83(HARN) / Arizona East (ft),2167,projected,4495,,4152,15304,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26948.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2868,NAD83(HARN) / Arizona Central (ft),2166,projected,4495,,4152,15305,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26949.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2869,NAD83(HARN) / Arizona West (ft),2168,projected,4495,,4152,15306,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26950.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2870,NAD83(HARN) / California zone 1 (ftUS),2175,projected,4497,,4152,15307,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26941.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2871,NAD83(HARN) / California zone 2 (ftUS),2176,projected,4497,,4152,15308,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26942.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2872,NAD83(HARN) / California zone 3 (ftUS),2177,projected,4497,,4152,15309,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26943.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2873,NAD83(HARN) / California zone 4 (ftUS),2178,projected,4497,,4152,15310,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26944.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2874,NAD83(HARN) / California zone 5 (ftUS),2182,projected,4497,,4152,15311,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26945.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2875,NAD83(HARN) / California zone 6 (ftUS),2180,projected,4497,,4152,15312,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26946.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2876,NAD83(HARN) / Colorado North (ftUS),2184,projected,4497,,4152,15313,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26953.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2877,NAD83(HARN) / Colorado Central (ftUS),2183,projected,4497,,4152,15314,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26954.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2878,NAD83(HARN) / Colorado South (ftUS),2185,projected,4497,,4152,15315,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26955.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2879,NAD83(HARN) / Connecticut (ftUS),1377,projected,4497,,4152,15316,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26956.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2880,NAD83(HARN) / Delaware (ftUS),1378,projected,4497,,4152,15317,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26957.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2881,NAD83(HARN) / Florida East (ftUS),2186,projected,4497,,4152,15318,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26958.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2882,NAD83(HARN) / Florida West (ftUS),2188,projected,4497,,4152,15319,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26959.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2883,NAD83(HARN) / Florida North (ftUS),2187,projected,4497,,4152,15320,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26960.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2884,NAD83(HARN) / Georgia East (ftUS),2189,projected,4497,,4152,15321,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26966.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2885,NAD83(HARN) / Georgia West (ftUS),2190,projected,4497,,4152,15322,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26967.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2886,NAD83(HARN) / Idaho East (ftUS),2192,projected,4497,,4152,15323,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26968.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2887,NAD83(HARN) / Idaho Central (ftUS),2191,projected,4497,,4152,15324,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26969.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2888,NAD83(HARN) / Idaho West (ftUS),2193,projected,4497,,4152,15325,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26970.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2889,NAD83(HARN) / Indiana East (ftUS),2196,projected,4497,,4152,15326,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26973.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2890,NAD83(HARN) / Indiana West (ftUS),2197,projected,4497,,4152,15327,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26974.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2891,NAD83(HARN) / Kentucky North (ftUS),2202,projected,4497,,4152,15328,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26979.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2892,NAD83(HARN) / Kentucky South (ftUS),2203,projected,4497,,4152,15329,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26980.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2893,NAD83(HARN) / Maryland (ftUS),1389,projected,4497,,4152,15330,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26985.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2894,NAD83(HARN) / Massachusetts Mainland (ftUS),2209,projected,4497,,4152,15331,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26986.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2895,NAD83(HARN) / Massachusetts Island (ftUS),2208,projected,4497,,4152,15332,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26987.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2896,NAD83(HARN) / Michigan North (ft),1723,projected,4495,,4152,15333,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26988.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2897,NAD83(HARN) / Michigan Central (ft),1724,projected,4495,,4152,15334,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26989.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2898,NAD83(HARN) / Michigan South (ft),1725,projected,4495,,4152,15335,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 26990.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2899,NAD83(HARN) / Mississippi East (ftUS),2216,projected,4497,,4152,15336,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26994.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2900,NAD83(HARN) / Mississippi West (ftUS),2217,projected,4497,,4152,15337,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 26995.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2901,NAD83(HARN) / Montana (ft),1395,projected,4495,,4152,15338,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32100.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2902,NAD83(HARN) / New Mexico East (ftUS),2228,projected,4497,,4152,15339,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32112.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2903,NAD83(HARN) / New Mexico Central (ftUS),2231,projected,4497,,4152,15340,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32113.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2904,NAD83(HARN) / New Mexico West (ftUS),2232,projected,4497,,4152,15341,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32114.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2905,NAD83(HARN) / New York East (ftUS),2234,projected,4497,,4152,15342,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32115.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2906,NAD83(HARN) / New York Central (ftUS),2233,projected,4497,,4152,15343,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32116.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2907,NAD83(HARN) / New York West (ftUS),2236,projected,4497,,4152,15344,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32117.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2908,NAD83(HARN) / New York Long Island (ftUS),2235,projected,4497,,4152,15345,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32118.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2909,NAD83(HARN) / North Dakota North (ft),2237,projected,4495,,4152,15347,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32120.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2910,NAD83(HARN) / North Dakota South (ft),2238,projected,4495,,4152,15348,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32121.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2911,NAD83(HARN) / Oklahoma North (ftUS),2241,projected,4497,,4152,15349,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32124.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2912,NAD83(HARN) / Oklahoma South (ftUS),2242,projected,4497,,4152,15350,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32125.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2913,NAD83(HARN) / Oregon North (ft),2243,projected,4495,,4152,15351,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32126.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2914,NAD83(HARN) / Oregon South (ft),2244,projected,4495,,4152,15352,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32127.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2915,NAD83(HARN) / Tennessee (ftUS),1411,projected,4497,,4152,15356,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32136.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2916,NAD83(HARN) / Texas North (ftUS),2253,projected,4497,,4152,15357,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32137.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2917,NAD83(HARN) / Texas North Central (ftUS),2254,projected,4497,,4152,15358,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32138.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2918,NAD83(HARN) / Texas Central (ftUS),2252,projected,4497,,4152,15359,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32139.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2919,NAD83(HARN) / Texas South Central (ftUS),2527,projected,4497,,4152,15360,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32140.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2920,NAD83(HARN) / Texas South (ftUS),2528,projected,4497,,4152,15361,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32141.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2921,NAD83(HARN) / Utah North (ft),2258,projected,4495,,4152,15362,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32142.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2922,NAD83(HARN) / Utah Central (ft),2257,projected,4495,,4152,15363,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32143.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2923,NAD83(HARN) / Utah South (ft),2259,projected,4495,,4152,15364,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  Federal definition is metric - see code 32144.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2924,NAD83(HARN) / Virginia North (ftUS),2260,projected,4497,,4152,15365,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32146.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2925,NAD83(HARN) / Virginia South (ftUS),2261,projected,4497,,4152,15366,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32147.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2926,NAD83(HARN) / Washington North (ftUS),2273,projected,4497,,4152,15367,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32148.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2927,NAD83(HARN) / Washington South (ftUS),2274,projected,4497,,4152,15368,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32149.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2928,NAD83(HARN) / Wisconsin North (ftUS),2267,projected,4497,,4152,15369,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32152.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2929,NAD83(HARN) / Wisconsin Central (ftUS),2266,projected,4497,,4152,15370,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32153.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2930,NAD83(HARN) / Wisconsin South (ftUS),2268,projected,4497,,4152,15371,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  Federal definition is metric - see code 32154.,National Geodetic Survey,EPSG,2002-06-22 00:00:00,,1,0
+2931,Beduaram / TM 13 NE,2771,projected,4497,,4213,16413,,,Oil exploration.,Used by Elf in 1986.,TotalFinaElf,EPSG,2002-06-28 00:00:00,,1,0
+2932,QND95 / Qatar National Grid,1346,projected,4400,,4614,19919,,,Large and medium scale topographic mapping and engineering survey.,,Qatar Centre for Geographic Information.,EPSG,2002-06-28 00:00:00,,1,0
+2933,Segara / UTM zone 50S,1328,projected,4400,,4613,16150,,,Large and medium scale topographic mapping and engineering survey.,,TotalFinaElf,EPSG,2002-06-22 00:00:00,,1,0
+2934,Segara (Jakarta) / NEIEZ,1360,projected,4499,,4820,19905,,,Large and medium scale topographic mapping and engineering survey.,,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+2935,Pulkovo 1942 / CS63 zone A1,2772,projected,4530,,4284,18441,,,"Large scale topographic mapping, cadastral and engineering survey.",,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+2936,Pulkovo 1942 / CS63 zone A2,2773,projected,4530,,4284,18442,,,"Large scale topographic mapping, cadastral and engineering survey.",,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+2937,Pulkovo 1942 / CS63 zone A3,2774,projected,4530,,4284,18443,,,"Large scale topographic mapping, cadastral and engineering survey.",,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+2938,Pulkovo 1942 / CS63 zone A4,2775,projected,4530,,4284,18444,,,"Large scale topographic mapping, cadastral and engineering survey.",,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+2939,Pulkovo 1942 / CS63 zone K2,2776,projected,4530,,4284,18446,,,"Large scale topographic mapping, cadastral and engineering survey.",,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+2940,Pulkovo 1942 / CS63 zone K3,2777,projected,4530,,4284,18447,,,"Large scale topographic mapping, cadastral and engineering survey.",,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+2941,Pulkovo 1942 / CS63 zone K4,2778,projected,4530,,4284,18448,,,"Large scale topographic mapping, cadastral and engineering survey.",,EPSG,EPSG,2002-06-28 00:00:00,,1,0
+2942,Porto Santo / UTM zone 28N,1314,projected,4400,,4615,16028,,,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon; http://www.ipcc.pt,EPSG,2002-07-13 00:00:00,,1,0
+2943,Selvagem Grande / UTM zone 28N,2779,projected,4400,,4616,16028,,,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon; http://www.ipcc.pt,EPSG,2002-07-13 00:00:00,,1,0
+2944,NAD83(CSRS) / SCoPQ zone 2,1420,projected,4499,,4617,17700,,,Large and medium scale topographic mapping and engineering survey.,,Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2002-07-13 00:00:00,,1,0
+2945,NAD83(CSRS) / MTM zone 3,1421,projected,4496,,4617,17703,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 3"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2002-07-13 00:00:00,,1,0
+2946,NAD83(CSRS) / MTM zone 4,1422,projected,4496,,4617,17704,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 4"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2002-07-13 00:00:00,,1,0
+2947,NAD83(CSRS) / MTM zone 5,1423,projected,4496,,4617,17705,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 5"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2002-07-13 00:00:00,,1,0
+2948,NAD83(CSRS) / MTM zone 6,1424,projected,4496,,4617,17706,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 6"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2002-07-13 00:00:00,,1,0
+2949,NAD83(CSRS) / MTM zone 7,1425,projected,4496,,4617,17707,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 7"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2002-07-13 00:00:00,,1,0
+2950,NAD83(CSRS) / MTM zone 8,1426,projected,4496,,4617,17708,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 8"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2002-07-13 00:00:00,,1,0
+2951,NAD83(CSRS) / MTM zone 9,1427,projected,4496,,4617,17709,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 9"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2002-07-13 00:00:00,,1,0
+2952,NAD83(CSRS) / MTM zone 10,1428,projected,4496,,4617,17710,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83(CSRS98) / SCoPQ zone 10"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,2002-07-13 00:00:00,,1,0
+2953,NAD83(CSRS) / New Brunswick Stereo,1447,projected,4500,,4617,19946,,,Large and medium scale topographic mapping and engineering survey.,In use from 1999.,Service New Brunswick Land and Information Standards Manual,EPSG,2002-07-13 00:00:00,,1,0
+2954,NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83),1533,projected,4496,,4617,19960,,,Large and medium scale topographic mapping and engineering survey.,,PEI Department of Transportation & Public Works,EPSG,2002-07-13 00:00:00,,1,0
+2955,NAD83(CSRS) / UTM zone 11N,1508,projected,4400,,4617,16011,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2002-07-13 00:00:00,,1,0
+2956,NAD83(CSRS) / UTM zone 12N,1507,projected,4400,,4617,16012,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2002-07-13 00:00:00,,1,0
+2957,NAD83(CSRS) / UTM zone 13N,1506,projected,4400,,4617,16013,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2002-07-13 00:00:00,,1,0
+2958,NAD83(CSRS) / UTM zone 17N,1428,projected,4400,,4617,16017,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2002-07-13 00:00:00,,1,0
+2959,NAD83(CSRS) / UTM zone 18N,1443,projected,4400,,4617,16018,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2002-07-13 00:00:00,,1,0
+2960,NAD83(CSRS) / UTM zone 19N,1448,projected,4400,,4617,16019,,,Large and medium scale topographic mapping and engineering survey.,In use from 1999.,Service New Brunswick Land and Information Standards Manual,EPSG,2002-07-13 00:00:00,,1,0
+2961,NAD83(CSRS) / UTM zone 20N,1449,projected,4400,,4617,16020,,,Large and medium scale topographic mapping and engineering survey.,In use from 1999.,Service New Brunswick Land and Information Standards Manual,EPSG,2002-07-13 00:00:00,,1,0
+2962,NAD83(CSRS) / UTM zone 21N,1446,projected,4400,,4617,16021,,,Large and medium scale topographic mapping and engineering survey.,In use from 2000.,Geomatics Canada.,EPSG,2002-07-13 00:00:00,,1,0
+2963,Lisbon 1890 (Lisbon) / Portugal Bonne,1294,projected,6509,,4904,19979,,,Medium scale topographic mapping.,,Instituto Geografico e Cadastral Lisbon; http://www.ipcc.pt/portuguese/produtos/cartografia/50m.html,EPSG,2002-07-13 00:00:00,,1,0
+3036,Moznet / UTM zone 36S,1540,projected,4400,,4130,16136,,,Large and medium scale topographic mapping and engineering survey.,,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+3037,Moznet / UTM zone 37S,1541,projected,4400,,4130,16137,,,Large and medium scale topographic mapping and engineering survey.,,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+3148,Indian 1960 / UTM zone 48N,1542,projected,4400,,4131,16048,,,Large and medium scale topographic mapping and engineering survey.,In Vietnam superseded by Hanoi 72 / Gauss zone 18 from 1988 onwards.,,EPSG,1998-11-11 00:00:00,,1,0
+3149,Indian 1960 / UTM zone 49N,1453,projected,4400,,4131,16049,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Hanoi 72 / Gauss zone 18 from 1988 onwards.,,EPSG,1998-11-11 00:00:00,,1,0
+3176,Indian 1960 / TM 106 NE,1495,projected,4400,,4131,16506,,,Used by Petrovietnam for offshore block 15.,,Petrovietnam,EPSG,1998-11-11 00:00:00,,1,0
+3200,FD58 / Iraq zone,1300,projected,4400,,4132,19906,,,Large and medium scale topographic mapping and engineering survey.,,IOEPC records.,EPSG,1998-11-11 00:00:00,,1,0
+3300,Estonian Coordinate System of 1992,1090,projected,4530,,4133,19938,,,Used for 1:20000 and larger scale mapping.,Superseded by Estonian Coordinate System of 1997 (code 3301).,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,1998-12-14 00:00:00,,1,0
+3301,Estonian Coordinate System of 1997,1090,projected,4530,,4180,19938,,,Used for 1:20000 and larger scale mapping.,Supersedes Estonian Coordinate System of 1992 (code 3300).,Estonian National Land Board via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+3439,PSD93 / UTM zone 39N,1544,projected,4400,,4134,16039,,,Oil exploration and production.,Supersedes Fahud / UTM zone 39N projCS (code 23239). Maximum differences to Fahud adjustment are 20 metres.,Petroleum Development Oman,EPSG,1999-04-22 00:00:00,,1,0
+3440,PSD93 / UTM zone 40N,1545,projected,4400,,4134,16040,,,Oil exploration and production.,Supersedes Fahud / UTM zone 40N projCS (code 23240). Maximum differences to Fahud adjustment are 20 metres.,Petroleum Development Oman,EPSG,1999-04-22 00:00:00,,1,0
+3561,Old Hawaiian / Hawaii zone 1,1546,projected,4497,,4135,15101,,,Large and medium scale topographic mapping and engineering survey.,Sometimes erroneously referred to as NAD27 / Hawaii zone 1.,,EPSG,1999-05-24 00:00:00,99.322,1,0
+3562,Old Hawaiian / Hawaii zone 2,1547,projected,4497,,4135,15102,,,Large and medium scale topographic mapping and engineering survey.,Sometimes erroneously referred to as NAD27 / Hawaii zone 2.,,EPSG,1999-05-24 00:00:00,99.322,1,0
+3563,Old Hawaiian / Hawaii zone 3,1548,projected,4497,,4135,15103,,,Large and medium scale topographic mapping and engineering survey.,Sometimes erroneously referred to as NAD27 / Hawaii zone 3.,,EPSG,1999-05-24 00:00:00,99.322,1,0
+3564,Old Hawaiian / Hawaii zone 4,1549,projected,4497,,4135,15104,,,Large and medium scale topographic mapping and engineering survey.,Sometimes erroneously referred to as NAD27 / Hawaii zone 4.,,EPSG,1999-05-24 00:00:00,99.322,1,0
+3565,Old Hawaiian / Hawaii zone 5,1550,projected,4497,,4135,15105,,,Large and medium scale topographic mapping and engineering survey.,Sometimes erroneously referred to as NAD27 / Hawaii zone 5.,,EPSG,1999-05-24 00:00:00,99.322,1,0
+3920,Puerto Rico / UTM zone 20N,1253,projected,4400,,4139,16020,,,Large and medium scale topographic mapping and engineering survey.,NAD27 / UTM zone 20 N (code 26720) used for military purposes.,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+3991,Puerto Rico State Plane CS of 1927,1194,projected,4497,,4139,15201,,,Large and medium scale topographic mapping and engineering survey.,Sometimes erroneously referred to as NAD27 / Puerto Rico State Plane CS.,US National Geodetic Survey,EPSG,1999-05-24 00:00:00,99.323,1,0
+3992,Puerto Rico / St. Croix,1254,projected,4497,,4139,15202,,,Large and medium scale topographic mapping and engineering survey.,Sometimes erroneously referred to as NAD27 / St. Croix State Plane CS.,US National Geodetic Survey,EPSG,1999-05-24 00:00:00,99.323,1,0
+4001,Unknown datum based upon the Airy 1830 ellipsoid,1263,geographic 2D,6402,6001,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4002,Unknown datum based upon the Airy Modified 1849 ellipsoid,1263,geographic 2D,6402,6002,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4003,Unknown datum based upon the Australian National Spheroid,1263,geographic 2D,6402,6003,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4004,Unknown datum based upon the Bessel 1841 ellipsoid,1263,geographic 2D,6402,6004,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4005,Unknown datum based upon the Bessel Modified ellipsoid,1263,geographic 2D,6402,6005,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4006,Unknown datum based upon the Bessel Namibia ellipsoid,1263,geographic 2D,6402,6006,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4007,Unknown datum based upon the Clarke 1858 ellipsoid,1263,geographic 2D,6402,6007,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4008,Unknown datum based upon the Clarke 1866 ellipsoid,1263,geographic 2D,6402,6008,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4009,Unknown datum based upon the Clarke 1866 Michigan ellipsoid,1263,geographic 2D,6402,6009,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4010,Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid,1263,geographic 2D,6402,6010,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4011,Unknown datum based upon the Clarke 1880 (IGN) ellipsoid,1263,geographic 2D,6402,6011,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4012,Unknown datum based upon the Clarke 1880 (RGS) ellipsoid,1263,geographic 2D,6402,6012,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4013,Unknown datum based upon the Clarke 1880 (Arc) ellipsoid,1263,geographic 2D,6402,6013,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4014,Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid,1263,geographic 2D,6402,6014,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4015,Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid,1263,geographic 2D,6402,6015,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4016,Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid,1263,geographic 2D,6402,6016,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4018,Unknown datum based upon the Everest 1830 Modified ellipsoid,1263,geographic 2D,6402,6018,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4019,Unknown datum based upon the GRS 1980 ellipsoid,1263,geographic 2D,6402,6019,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4020,Unknown datum based upon the Helmert 1906 ellipsoid,1263,geographic 2D,6402,6020,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4021,Unknown datum based upon the Indonesian National Spheroid,1263,geographic 2D,6402,6021,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4022,Unknown datum based upon the International 1924 ellipsoid,1263,geographic 2D,6402,6022,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4024,Unknown datum based upon the Krassowsky 1940 ellipsoid,1263,geographic 2D,6402,6024,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4025,Unknown datum based upon the NWL 9D ellipsoid,1263,geographic 2D,6402,6025,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4027,Unknown datum based upon the Plessis 1817 ellipsoid,1263,geographic 2D,6402,6027,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4028,Unknown datum based upon the Struve 1860 ellipsoid,1263,geographic 2D,6402,6028,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4029,Unknown datum based upon the War Office ellipsoid,1263,geographic 2D,6402,6029,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4030,Unknown datum based upon the WGS 84 ellipsoid,1263,geographic 2D,6402,6030,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4031,Unknown datum based upon the GEM 10C ellipsoid,1263,geographic 2D,6402,6031,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4032,Unknown datum based upon the OSU86F ellipsoid,1263,geographic 2D,6402,6032,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4033,Unknown datum based upon the OSU91A ellipsoid,1263,geographic 2D,6402,6033,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4034,Unknown datum based upon the Clarke 1880 ellipsoid,1263,geographic 2D,6402,6034,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,0
+4035,Unknown datum based upon the Authalic Sphere,1263,geographic 2D,6402,6035,,,,,Not recommended.,Deprecated. Use code 4047.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0,1
+4036,Unknown datum based upon the GRS 1967 ellipsoid,1263,geographic 2D,6402,6036,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0,0
+4041,Unknown datum based upon the Average Terrestrial System 1977 ellipsoid,1263,geographic 2D,6402,6041,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0,0
+4042,Unknown datum based upon the Everest (1830 Definition) ellipsoid,1263,geographic 2D,6402,6042,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0,0
+4043,Unknown datum based upon the WGS 72 ellipsoid,1263,geographic 2D,6402,6043,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0,0
+4044,Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid,1263,geographic 2D,6402,6044,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0,0
+4045,Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid,1263,geographic 2D,6402,6045,,,,,Not recommended.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0,0
+4047,Unspecified based upon the GRS 1980 Authalic Sphere,1263,geographic 2D,6402,6047,,,,,Small scale statistical mapping.,Use only in cases where geodetic datum is unknown.,EPSG,EPSG,2001-06-05 00:00:00,,0,0
+4120,Greek,1106,geographic 2D,6402,6120,,,,,Geodetic survey.,,Topography Department; National Technical University of Greece.,EPSG,1997-06-16 00:00:00,,1,0
+4121,GGRS87,1106,geographic 2D,6402,6121,,,,,Geodetic survey.,,Geodesy Department; Public Petroleum Corporation of Greece.,EPSG,1997-06-16 00:00:00,,1,0
+4122,ATS77,1283,geographic 2D,6402,6122,,,,,Geodetic survey.,In use from 1979.  To be phased out in late 1990's.,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,1997-07-22 00:00:00,,1,0
+4123,KKJ,1095,geographic 2D,6402,6123,,,,,Geodetic survey.,,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,1,0
+4124,RT90,1225,geographic 2D,6402,6124,,,,,Geodetic survey.,,National Land Survey of Sweden,EPSG,1997-11-13 00:00:00,,1,0
+4125,Samboja,1328,geographic 2D,6402,6125,,,,,Geodetic survey.,,,EPSG,1997-11-13 00:00:00,,1,1
+4126,LKS94 (ETRS89),1145,geographic 2D,6402,6126,,,,,Geodetic survey.,,,EPSG,1998-03-13 00:00:00,,1,0
+4127,Tete,1167,geographic 2D,6402,6127,,,,,Geodetic survey.,,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+4128,Madzansua,1315,geographic 2D,6402,6128,,,,,Geodetic survey.,Superseded by values transformed to Tete geogCS (code 4127).,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+4129,Observatario,1329,geographic 2D,6402,6129,,,,,Geodetic survey.,Superseded by values transformed to Tete geogCS (code 4127).,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+4130,Moznet,1167,geographic 2D,6402,6130,,,,,Geodetic survey.,,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+4131,Indian 1960,1302,geographic 2D,6402,6131,,,,,Geodetic survey.,,,EPSG,1998-11-11 00:00:00,,1,0
+4132,FD58,1300,geographic 2D,6402,6132,,,,,Geodetic survey.,,IOEPC records.,EPSG,1998-11-11 00:00:00,,1,0
+4133,EST92,1090,geographic 2D,6402,6133,,,,,Geodetic survey.,Superseded by EST97 (code 4180).,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,1998-12-14 00:00:00,,1,0
+4134,PDO Survey Datum 1993,1183,geographic 2D,6402,6134,,,,,Geodetic survey.,Supersedes Fahud geogCS (code 4232). Maximum differences to Fahud adjustment are 20 metres.,Petroleum Development Oman,EPSG,1999-04-22 00:00:00,,1,0
+4135,Old Hawaiian,1334,geographic 2D,6402,6135,,,,,Geodetic survey.,Note: this coordinate system includes longitudes which are POSITIVE EAST.,,EPSG,1999-05-24 00:00:00,,1,0
+4136,St. Lawrence Island,1332,geographic 2D,6402,6136,,,,,Geodetic survey.,Note: this coordinate system includes longitudes which are POSITIVE EAST.,,EPSG,1999-05-24 00:00:00,,1,0
+4137,St. Paul Island,1333,geographic 2D,6402,6137,,,,,Geodetic survey.,Note: this coordinate system includes longitudes which are POSITIVE EAST.,,EPSG,1999-05-24 00:00:00,,1,0
+4138,St. George Island,1331,geographic 2D,6402,6138,,,,,Geodetic survey.,Note: this coordinate system includes longitudes which are POSITIVE EAST.,,EPSG,1999-05-24 00:00:00,,1,0
+4139,Puerto Rico,1335,geographic 2D,6402,6139,,,,,Geodetic surveying for civilian purposes.,NAD27 (code 4267) used for military purposes.  Note: this coordinate system includes longitudes which are POSITIVE EAST.,,EPSG,1999-05-24 00:00:00,,1,0
+4140,NAD83(CSRS98),1336,geographic 2D,6402,6140,,,,,Geodetic survey.,In New Brunswick superseded ATS77 from 1999.,Service New Brunswick Land and Information Standards Manual,EPSG,2000-10-19 00:00:00,99.90,1,1
+4141,Israel,2603,geographic 2D,6402,6141,,,,,Geodetic survey.,Supersedes Palestine 1923.,Survey of Israel,EPSG,2002-06-22 00:00:00,2002.34,1,0
+4142,Locodjo 1965,1075,geographic 2D,6402,6142,,,,,Geodetic survey.,Superseded by Abidjan 1987 (EPSG code 4143).,IGN Paris,EPSG,1999-10-20 00:00:00,,1,0
+4143,Abidjan 1987,1075,geographic 2D,6402,6143,,,,,Geodetic survey.,Supersedes Locodjo 1965 (EPSG code 4142).,IGN Paris,EPSG,2001-06-05 00:00:00,2001.11,1,0
+4144,Kalianpur 1937,1308,geographic 2D,6402,6144,,,,,Geodetic survey.,Adopts 1937 metric conversion of 0.30479841 metres per Indian foot.,"G. Bomford; ""The Re-adjustment of the Indian Triangulation""; Survey of India Professional Paper 28; 1939.",EPSG,1999-10-20 00:00:00,,1,0
+4145,Kalianpur 1962,1184,geographic 2D,6402,6145,,,,,Geodetic survey.,Adopts 1962 metric conversion of 0.3047996 metres per Indian foot.,,EPSG,1999-10-20 00:00:00,,1,0
+4146,Kalianpur 1975,1121,geographic 2D,6402,6146,,,,,Geodetic survey.,Adopts 1975 metric conversion of 0.3047995 metres per Indian foot.,,EPSG,1999-10-20 00:00:00,,1,0
+4147,Hanoi 1972,1252,geographic 2D,6402,6147,,,,,Geodetic survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+4148,Hartebeesthoek94,1215,geographic 2D,6402,6148,,,,,Geodetic survey.,Supersedes Cape (code 4222) from 1999.,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-01-06 00:00:00,99.96  2000.04,1,0
+4149,CH1903,1286,geographic 2D,6402,6149,,,,,Geodetic survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+4150,CH1903+,1286,geographic 2D,6402,6150,,,,,Geodetic survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+4151,CHTRF95,1286,geographic 2D,6402,6151,,,,,Geodetic survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+4152,NAD83(HARN),1337,geographic 2D,6402,6152,,,,,Geodetic survey.,,National Geodetic Survey,EPSG,1999-10-20 00:00:00,,1,0
+4153,Rassadiran,1338,geographic 2D,6402,6153,,,,,Geodetic survey.,,Total-Fina,EPSG,1999-10-20 00:00:00,,1,0
+4154,ED50(ED77),1123,geographic 2D,6402,6154,,,,,Geodetic survey.,,National Cartographic Centre of Iran,EPSG,1999-10-20 00:00:00,,1,0
+4155,Dabola 1981,1112,geographic 2D,6402,6155,,,,,Geodetic survey.,Supersedes Conakry 1905 (EPSG code 4315).,IGN Paris,EPSG,1999-12-09 00:00:00,,1,0
+4156,S-JTSK,1306,geographic 2D,6402,6156,,,,,Geodetic survey.,"S-JTSK is the Uniform Trigonometric Cadastral Network.  It is a modification of the Austrian MGI geogCRS, code 4312.",Research Institute for Geodesy Topography and Cartography (VUGTK); Prague.,EPSG,2001-08-28 00:00:00,2001.26,1,0
+4157,Mount Dillon,1322,geographic 2D,6402,6157,,,,,Geodetic survey.,,University of the West Indies Geodetic Services.,EPSG,2000-03-07 00:00:00,,1,0
+4158,Naparima 1955,1339,geographic 2D,6402,6158,,,,,Geodetic survey.,Naparima 1972 is an extension of the Naparima 1955 network of Trinidad to include Tobago.,Ordnance Survey International.,EPSG,2000-03-07 00:00:00,,1,0
+4159,ELD79,1143,geographic 2D,6402,6159,,,,,Geodetic survey.,,Various oil company records.,EPSG,2000-03-07 00:00:00,,1,0
+4160,Chos Malal 1914,1292,geographic 2D,6402,6160,,,,,Geodetic survey.,Superseded by Campo Inchauspe (geogCS code 4221).,Various oil company records.,EPSG,2000-03-07 00:00:00,,1,0
+4161,Pampa del Castillo,1265,geographic 2D,6402,6161,,,,,Geodetic surveying within the oil industry.,Superseded by Campo Inchauspe (geogCS code 4221).,Various oil company records.,EPSG,2000-03-07 00:00:00,,1,0
+4162,Korean 1985,1135,geographic 2D,6402,6162,,,,,Geodetic survey.,Supersedes use of Tokyo datum.,Clifford J. Mugnier; in Photogrammetric Engineering & Remote Sensing November 1999. http://www.asprs.org/resources.html,EPSG,2000-03-07 00:00:00,2001.28,1,0
+4163,Yemen NGN96,1257,geographic 2D,6402,6163,,,,,Geodetic survey.,,IGN Paris,EPSG,2000-03-07 00:00:00,,1,0
+4164,South Yemen,1340,geographic 2D,6402,6164,,,,,Geodetic survey.,,IGN Paris,EPSG,2000-03-07 00:00:00,,1,0
+4165,Bissau,1113,geographic 2D,6402,6165,,,,,Geodetic survey.,,NIMA,EPSG,2000-03-07 00:00:00,,1,0
+4166,Korean 1995,1135,geographic 2D,6402,6166,,,,,Geodetic survey.,,NIMA TR8350.2  ftp://164.214.2.65/pub/gg/tr8350.2/changes.pdf,EPSG,2000-05-08 00:00:00,,1,0
+4167,NZGD2000,1175,geographic 2D,6402,6167,,,,,Geodetic survey.,Supersedes NZGD49 (code 4272) from March 2000.,Land Information New Zealand.,EPSG,2000-10-19 00:00:00,,1,0
+4168,Accra,1104,geographic 2D,6402,6168,,,,,Geodetic survey.,"Ellipsoid semi-major axis (a)=20926201 exactly Gold Coast feet. 
+Superseded by Leigon (code 4250) in 1978.",Ordnance Survey International,EPSG,2000-10-19 00:00:00,,1,0
+4169,American Samoa 1962,1027,geographic 2D,6402,6169,,,,,Geodetic survey.,,NIMA TR8350.2 revision of January 2000 and ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon/samoa_readme.txt,EPSG,2000-10-19 00:00:00,,1,0
+4170,SIRGAS,1341,geographic 2D,6402,6170,,,,,Geodetic survey.,,NIMA TR8350.2 revision of January 2000.,EPSG,2000-10-19 00:00:00,2001.33,1,0
+4171,RGF93,1096,geographic 2D,6402,6171,,,,,Geodetic survey.,,TotalFinaElf,EPSG,2000-10-19 00:00:00,,1,0
+4172,POSGAR,1033,geographic 2D,6402,6172,,,,,Geodetic survey.,"A geodetic network of 127 high accuracy surved points that define the National Geodetic System (Sistema Geod�sico Nacional), adopted by IGM in May 1997",http://www.igm.gov.ar/posgar.html,EPSG,2000-10-19 00:00:00,2001.051,1,1
+4173,IRENET95,1305,geographic 2D,6402,6173,,,,,Geodetic survey.,,Ordnance Survey of Ireland,EPSG,2000-10-19 00:00:00,,1,0
+4174,Sierra Leone 1924,1342,geographic 2D,6402,6174,,,,,Geodetic survey.,Ellipsoid semi-major axis (a)=20926201 exactly Gold Coast feet; 1 Gold Coast foot = 0.3047997101815 m.,Ordnance Survey International,EPSG,2001-06-05 00:00:00,,1,0
+4175,Sierra Leone 1968,1209,geographic 2D,6402,6175,,,,,Geodetic survey.,Supersedes Sierra Leone 1960.  The 1968 readjustment coordinates are within 3m of the 1960 provisional adjustment.,Ordnance Survey International.,EPSG,2001-06-05 00:00:00,,1,0
+4176,Australian Antarctic,1278,geographic 2D,6402,6176,,,,,Geodetic survey.,,Standards Australia,ISO 19127,2001-06-05 00:00:00,,1,0
+4178,Pulkovo 1942(83),1343,geographic 2D,6402,6178,,,,,Geodetic survey.,"In Brandenburg superseded by ETRS89. 
+In Sachsen and Thuringen superseded by DHDN.",Bundesamt f�r Kartographie und Geod�sie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+4179,Pulkovo 1942(58),1192,geographic 2D,6402,6179,,,,,Geodetic survey.,,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+4180,EST97,1090,geographic 2D,6402,6180,,,,,Geodetic survey.,Supersedes EST92 (code 4133).,Estonian National Land Board via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+4181,Luxembourg 1930,1146,geographic 2D,6402,6181,,,,,Geodetic survey,,Administration du Cadastre et de la Topographie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+4182,Azores Occidental 1939,1344,geographic 2D,6402,6182,,,,,Geodetic survey.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+4183,Azores Central 1948,1301,geographic 2D,6402,6183,,,,,Geodetic survey.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+4184,Azores Oriental 1940,1345,geographic 2D,6402,6184,,,,,Geodetic survey.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+4185,Madeira 1936,1314,geographic 2D,6402,6185,,,,,Geodetic survey.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,1
+4188,OSNI 1952,2530,geographic 2D,6402,6188,,,,,Geodesy and topographic mapping.,Superseded by 1975 Mapping Adjustment.  See code 4300.,Ordnance Survey of Northern Ireland.,EPSG,2001-11-06 00:00:00,,0,0
+4189,REGVEN,1251,geographic 2D,6402,6189,,,,,Geodetic survey.,Densification in Venezuela of SIRGAS.,Servicio Autonomo de Geografia y Cartografia Nacional.,EPSG,2001-11-06 00:00:00,,1,0
+4190,POSGAR 98,1033,geographic 2D,6402,6190,,,,,Geodetic survey.,A geodetic network of 127 high accuracy surved points that define the National Geodetic System (Sistema Geod�sico Nacional). Densification of SIRGAS 1995.,http://www.igm.gov.ar/posgar.html,EPSG,2001-11-06 00:00:00,,1,0
+4191,Albanian 1987,1025,geographic 2D,6402,6191,,,,,Geodetic survey.,,EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,1,0
+4192,Douala 1948,1060,geographic 2D,6402,6192,,,,,Geodetic survey.,Superseded by Manoca 1962 (code 4193).,TotalFinaElf,EPSG,2002-01-18 00:00:00,,1,0
+4193,Manoca 1962,1060,geographic 2D,6402,6193,,,,,Geodetic survey.,Supersedes Doula 1948 (code 4192). The intent of the Bukuva 1953 conference was to adopt the Clarke 1880 (RGN) ellipsoid (code 7012) but in practice this datum has used the IGN version.,TotalFinaElf,EPSG,2002-01-18 00:00:00,,1,0
+4194,Qornoq 1927,1107,geographic 2D,6402,6194,,,,,Geodetic survey.,,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-18 00:00:00,,1,0
+4195,Scoresbysund 1952,2570,geographic 2D,6402,6195,,,,,Geodetic survey.,,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-18 00:00:00,,1,0
+4196,Ammassalik 1958,2571,geographic 2D,6402,6196,,,,,Geodetic survey.,,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-18 00:00:00,,1,0
+4197,Garoua,2590,geographic 2D,6402,6197,,,,,Geodetic survey.,The intent of the Bukuva 1953 conference was to adopt the Clarke 1880 (RGN) ellipsoid (code 7012) but in practice this datum has used the IGN version.,TotalFinaElf,EPSG,2002-02-12 00:00:00,,1,0
+4198,Kousseri,2591,geographic 2D,6402,6198,,,,,Geodetic survey.,,TotalFinaElf,EPSG,2002-02-12 00:00:00,,1,0
+4199,Egypt 1930,1086,geographic 2D,6402,6199,,,,,Scientific purposes only.,"Note that Egypt 1930 uses the International 1924 ellipsoid, unlike the Egypt 1907 CRS (code 4229) which uses the Helmert ellipsoid. Oil industry references to the Egypt 1930 name and the Helmert ellipsoid probably mean Egypt 1907.",,EPSG,2002-02-12 00:00:00,,1,0
+4200,Pulkovo 1995,1198,geographic 2D,6402,6200,,,,,Geodetic survey.,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,0
+4201,Adindan,1271,geographic 2D,6402,6201,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4202,AGD66,1279,geographic 2D,6402,6202,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4203,AGD84,1036,geographic 2D,6402,6203,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4204,Ain el Abd,1272,geographic 2D,6402,6204,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4205,Afgooye,1214,geographic 2D,6402,6205,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4206,Agadez,1177,geographic 2D,6402,6206,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4207,Lisbon,1294,geographic 2D,6402,6207,,,,,Geodetic survey.,Supersedes Lisbon 1890 system which used Bessel 1841 ellipsoid. Superseded by Datum 73 (code 4274).,Instituto Geografico e Cadastral; Lisbon,EPSG,1995-06-02 00:00:00,2001.551,1,0
+4208,Aratu,1274,geographic 2D,6402,6208,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4209,Arc 1950,1276,geographic 2D,6402,6209,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4210,Arc 1960,1277,geographic 2D,6402,6210,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4211,Batavia,1285,geographic 2D,6402,6211,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4212,Barbados 1938,1042,geographic 2D,6402,6212,,,,,Geodetic survey.,,,EPSG,1999-04-22 00:00:00,99.171,1,0
+4213,Beduaram,2771,geographic 2D,6402,6213,,,,,Geodetic survey.,,,EPSG,2002-06-28 00:00:00,2002.43,1,0
+4214,Beijing 1954,1067,geographic 2D,6402,6214,,,,,Geodetic survey.,Superseded by Xian 1980 (code 4610).,,EPSG,1995-06-02 00:00:00,,1,0
+4215,Belge 1950,1347,geographic 2D,6402,6215,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4216,Bermuda 1957,1047,geographic 2D,6402,6216,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4218,Bogota 1975,1070,geographic 2D,6402,6218,,,,,Geodetic survey.,"Supersedes earlier 3 adjustments of 1951, 1944 and 1941.","IGAC special publication no. 1, ""Geodesia"" 4th edition, 1975.",EPSG,2000-10-19 00:00:00,2000.20,1,0
+4219,Bukit Rimpah,1287,geographic 2D,6402,6219,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4220,Camacupa,1288,geographic 2D,6402,6220,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4221,Campo Inchauspe,1033,geographic 2D,6402,6221,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4222,Cape,1290,geographic 2D,6402,6222,,,,,Geodetic survey.,Superseded by Hartbeesthoek94 from 1999.,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,1995-06-02 00:00:00,2000.04,1,0
+4223,Carthage,1236,geographic 2D,6402,6223,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4224,Chua,1053,geographic 2D,6402,6224,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4225,Corrego Alegre,1293,geographic 2D,6402,6225,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4226,Cote d'Ivoire,1075,geographic 2D,6402,6226,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,1
+4227,Deir ez Zor,1623,geographic 2D,6402,6227,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4228,Douala,1060,geographic 2D,6402,6228,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,1
+4229,Egypt 1907,1086,geographic 2D,6402,6229,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4230,ED50,1296,geographic 2D,6402,6230,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4231,ED87,1297,geographic 2D,6402,6231,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4232,Fahud,1183,geographic 2D,6402,6232,,,,,Geodetic survey.,Since 1993 superseded by PSD93 geogCS (code 4134). Maximum differences to Fahud adjustment are 20 metres.,,EPSG,1995-06-02 00:00:00,,1,0
+4233,Gandajika 1970,1152,geographic 2D,6402,6233,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4234,Garoua,1060,geographic 2D,6402,6234,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,1
+4235,Guyane Francaise,1097,geographic 2D,6402,6235,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4236,Hu Tzu Shan,1228,geographic 2D,6402,6236,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4237,HD72,1119,geographic 2D,6402,6237,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4238,ID74,1122,geographic 2D,6402,6238,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4239,Indian 1954,1304,geographic 2D,6402,6239,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4240,Indian 1975,1231,geographic 2D,6402,6240,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4241,Jamaica 1875,1128,geographic 2D,6402,6241,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4242,JAD69,1128,geographic 2D,6402,6242,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4243,Kalianpur 1880,1307,geographic 2D,6402,6243,,,,,Geodetic survey.,,"G. Bomford; ""The Re-adjustment of the Indian Triangulation""; Survey of India Professional Paper 28; 1939.",EPSG,1999-10-20 00:00:00,97.23,1,0
+4244,Kandawala,1218,geographic 2D,6402,6244,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4245,Kertau,1309,geographic 2D,6402,6245,,,,,Geodetic survey.,Adopts metric conversion of 39.370113 inches per metre.,,EPSG,1995-06-02 00:00:00,,1,0
+4246,KOC,1136,geographic 2D,6402,6246,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4247,La Canoa,1251,geographic 2D,6402,6247,,,,,Geodetic survey.,PSAD56 uses same origin.,,EPSG,1995-06-02 00:00:00,,1,0
+4248,PSAD56,1348,geographic 2D,6402,6248,,,,,Geodetic survey.,Origin is same as La Canoa.  In Venezuela known as La Canoa.,,EPSG,1995-06-02 00:00:00,,1,0
+4249,Lake,1312,geographic 2D,6402,6249,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4250,Leigon,1104,geographic 2D,6402,6250,,,,,Geodetic survey.,Superseded Accra (code 4168) from 1978.,Ordnance Survey International,EPSG,1995-06-02 00:00:00,,1,0
+4251,Liberia 1964,1142,geographic 2D,6402,6251,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4252,Lome,1232,geographic 2D,6402,6252,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4253,Luzon 1911,1190,geographic 2D,6402,6253,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4254,Hito XVIII 1963,1303,geographic 2D,6402,6254,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4255,Herat North,1024,geographic 2D,6402,6255,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4256,Mahe 1971,1208,geographic 2D,6402,6256,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4257,Makassar,1316,geographic 2D,6402,6257,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4258,ETRS89,1298,geographic 2D,6402,6258,,,,,Geodetic survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,Norwegian Geodetic Institute geodetic publication 1990:1,EPSG,2000-10-19 00:00:00,97.11  99.11 2000.72,1,0
+4259,Malongo 1987,1317,geographic 2D,6402,6259,,,,,Geodetic survey.,Offshore extension of Mhast GeogCS (4264) using Transit translocation from Station Y at Malongo base camp.,Chevron Petroleum Technology,EPSG,1995-06-02 00:00:00,,1,0
+4260,Manoca,1060,geographic 2D,6402,6260,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,2002.01,1,1
+4261,Merchich,1166,geographic 2D,6402,6261,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4262,Massawa,1089,geographic 2D,6402,6262,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4263,Minna,1178,geographic 2D,6402,6263,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4264,Mhast,1318,geographic 2D,6402,6264,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4265,Monte Mario,1127,geographic 2D,6402,6265,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4266,M'poraloko,1100,geographic 2D,6402,6266,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4267,NAD27,1349,geographic 2D,6402,6267,,,,,Geodetic survey.,Note: this coordinate system includes longitudes which are POSITIVE EAST.  Superseded by NAD27(76) (code 4608) in Ontario and CGQ77 (code 4609) in Quebec.,,EPSG,1995-06-02 00:00:00,99.04,1,0
+4268,NAD27 Michigan,1391,geographic 2D,6402,6268,,,,,Geodetic survey.,Ellipsoid taken to be 800ft above geoid. Note: this coordinate system includes longitudes which are POSITIVE EAST.,,EPSG,1996-12-12 00:00:00,96.28,1,0
+4269,NAD83,1350,geographic 2D,6402,6269,,,,,Geodetic survey.,Note: this coordinate system includes longitudes which are POSITIVE EAST.,,EPSG,1995-06-02 00:00:00,,1,0
+4270,Nahrwan 1967,1351,geographic 2D,6402,6270,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4271,Naparima 1972,1322,geographic 2D,6402,6271,,,,,Geodetic survey.,Naparima 1972 is an extension of the Naparima 1955 network of Trinidad to include Tobago.,Ordnance Survey International.,EPSG,1995-06-02 00:00:00,,1,0
+4272,NZGD49,1175,geographic 2D,6402,6272,,,,,Geodetic survey.,Superseded by NZGD49 in March 2000.,New Zealand Department of Lands and Surveys Technical Report No. 1; 1978.,EPSG,2000-10-19 00:00:00,2000.702,1,0
+4273,NGO 1948,1352,geographic 2D,6402,6273,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4274,Datum 73,1294,geographic 2D,6402,6274,,,,,Geodetic survey.,,Instituto Geografico e Cadastral; Lisbon,EPSG,1995-06-02 00:00:00,,1,0
+4275,NTF,1353,geographic 2D,6402,6275,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4276,NSWC 9Z-2,1262,geographic 2D,6402,6276,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4277,OSGB 1936,1264,geographic 2D,6402,6277,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4278,OSGB70,1264,geographic 2D,6402,6278,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4279,OS(SN)80,1354,geographic 2D,6402,6279,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4280,Padang,1355,geographic 2D,6402,6280,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4281,Palestine 1923,1356,geographic 2D,6402,6281,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4282,Pointe Noire,1072,geographic 2D,6402,6282,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,2002.05,1,0
+4283,GDA94,1036,geographic 2D,6402,6283,,,,,Geodetic survey.,,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-06-02 00:00:00,,1,0
+4284,Pulkovo 1942,1357,geographic 2D,6402,6284,,,,,Geodetic survey.,For Germany see Pulkovo 1942(83); for Poland see Pulkovo 1942(58).,,EPSG,1995-06-02 00:00:00,,1,0
+4285,Qatar 1974,1346,geographic 2D,6402,6285,,,,,Geodetic survey.,,Qatar Centre for Geographic Information.,EPSG,2000-03-07 00:00:00,2000.29  (2001.27),1,0
+4286,Qatar 1948,1346,geographic 2D,6402,6286,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4287,Qornoq,1107,geographic 2D,6402,6287,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,1
+4288,Loma Quintana,1313,geographic 2D,6402,6288,,,,,Geodetic survey.,Superseded by La Canoa (code 4247).,,EPSG,1995-06-02 00:00:00,,1,0
+4289,Amersfoort,1275,geographic 2D,6402,6289,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4291,SAD69,1358,geographic 2D,6402,6291,,,,,Geodetic survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.251.  Error introduced if not using the truncated precision is 0 to 31mm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+4292,Sapper Hill 1943,1092,geographic 2D,6402,6292,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4293,Schwarzeck,1169,geographic 2D,6402,6293,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4294,Segora,1359,geographic 2D,6402,6294,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,1
+4295,Serindung,1360,geographic 2D,6402,6295,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4296,Sudan,1361,geographic 2D,6402,6296,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4297,Tananarive,1149,geographic 2D,6402,6297,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4298,Timbalai 1948,1362,geographic 2D,6402,6298,,,,,Geodetic survey.,Adopts metric conversion of 39.370147 inches per metre.,,EPSG,1995-06-02 00:00:00,,1,0
+4299,TM65,1125,geographic 2D,6402,6299,,,,,Basis for topographic mapping in Republic of Ireland between 1965 and 1975; for scientific purposes only in Northern Ireland.,Superseded by 1975 Mapping Adjustment. See code 4300.,,EPSG,1995-06-02 00:00:00,,1,0
+4300,TM75,1305,geographic 2D,6402,6300,,,,,Basis for topographic mapping.,,,EPSG,1995-06-02 00:00:00,,1,0
+4301,Tokyo,1364,geographic 2D,6402,6301,,,,,Geodetic survey.,Superseded by JGD2000 (code 4612) from April 2002.,Geographic Survey Institute; Japan; Bulletin 40 (March 1994).  Also http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,2002.08,1,0
+4302,Trinidad 1903,1322,geographic 2D,6402,6302,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4303,TC(1948),1363,geographic 2D,6402,6303,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4304,Voirol 1875,1365,geographic 2D,6402,6304,,,,,Geodetic survey.,,IGN Paris,EPSG,1995-06-02 00:00:00,,1,0
+4306,Bern 1938,1286,geographic 2D,6402,6306,,,,,Used for the geographic coordinates overprinted on topographic maps constructed on the CH1903 / LV03 projected CS (code 21781).,,,EPSG,1995-06-02 00:00:00,,1,0
+4307,Nord Sahara 1959,1366,geographic 2D,6402,6307,,,,,Geodetic survey.,Sometimes incorrectly referred to as Voirol Unifie 1960. Voirol Unifie 1960 is NOT a GeogCRS:  it is two projected coordinate reference systems based on  Nord Sahara 1959.  See codes 30791 and 30792.,"""Le System Geodesique Nord-Sahara""; IGN Paris",EPSG,2002-08-29 00:00:00,2000.47  2002.56,1,0
+4308,RT38,1225,geographic 2D,6402,6308,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,97.09,1,0
+4309,Yacare,1247,geographic 2D,6402,6309,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4310,Yoff,1207,geographic 2D,6402,6310,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4311,Zanderij,1222,geographic 2D,6402,6311,,,,,Geodetic survey.,Introduced in 1975.,Shell International,EPSG,1995-06-02 00:00:00,,1,0
+4312,MGI,1321,geographic 2D,6402,6312,,,,,Geodetic survey.,,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,1995-06-02 00:00:00,,1,0
+4313,Belge 1972,1347,geographic 2D,6402,6313,,,,,Geodetic survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+4314,DHDN,1295,geographic 2D,6402,6314,,,,,Geodetic survey.,,EPSG,EPSG,1995-06-02 00:00:00,,1,0
+4315,Conakry 1905,1112,geographic 2D,6402,6315,,,,,Geodetic survey.,Superseded by Dabola 1981 (EPSG code 4155).,IGN Paris,EPSG,1995-06-02 00:00:00,,1,0
+4316,Dealul Piscului 1933,1197,geographic 2D,6402,6316,,,,,Geodetic survey.,Superseded by 1970 system (geogCS code 4317).,,EPSG,1996-04-12 00:00:00,,1,0
+4317,Dealul Piscului 1970,1197,geographic 2D,6402,6317,,,,,Geodetic survey.,Supersedes 1933 system (geogCS code 4316).,,EPSG,1996-04-12 00:00:00,,1,0
+4318,NGN,1136,geographic 2D,6402,6318,,,,,Geodetic survey.,,,EPSG,1996-04-12 00:00:00,,1,0
+4319,KUDAMS,1310,geographic 2D,6402,6319,,,,,Geodetic survey.,,,EPSG,1996-04-12 00:00:00,,1,0
+4322,WGS 72,1262,geographic 2D,6402,6322,,,,,Geodetic survey.,Superseded by WGS 84.,,EPSG,1995-06-02 00:00:00,,1,0
+4324,WGS 72BE,1262,geographic 2D,6402,6324,,,,,Geodetic survey.,Broadcast ephemeris. Superseded by WGS 84.,,EPSG,1995-06-02 00:00:00,,1,0
+4326,WGS 84,1262,geographic 2D,6402,6326,,,,,Used by the GPS satellite navigation system and for NATO military geodetic surveying.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+4327,WGS 84 (geographic 3D),1262,geographic 3D,6401,6326,,,,,Used by the GPS satellite navigation system.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+4328,WGS 84 (geocentric),1262,geocentric,6500,6326,,,,,Used by the GPS satellite navigation system.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+4600,Anguilla 1957,1030,geographic 2D,6402,6600,,,,,Geodetic survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+4601,Antigua 1943,1273,geographic 2D,6402,6601,,,,,Geodetic survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+4602,Dominica 1945,1082,geographic 2D,6402,6602,,,,,Geodetic survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+4603,Grenada 1953,1551,geographic 2D,6402,6603,,,,,Geodetic survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+4604,Montserrat 1958,1165,geographic 2D,6402,6604,,,,,Geodetic survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+4605,St. Kitts 1955,1200,geographic 2D,6402,6605,,,,,Geodetic survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+4606,St. Lucia 1955,1201,geographic 2D,6402,6606,,,,,Geodetic survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+4607,St. Vincent 1945,1202,geographic 2D,6402,6607,,,,,Geodetic survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+4608,NAD27(76),1367,geographic 2D,6402,6608,,,,,Geodetic survey.,Note: this coordinate system includes longitudes which are POSITIVE EAST.,,EPSG,1999-05-12 00:00:00,,1,0
+4609,NAD27(CGQ77),1368,geographic 2D,6402,6609,,,,,Geodetic survey.,Note: this coordinate system includes longitudes which are POSITIVE EAST.,,EPSG,1999-05-12 00:00:00,,1,0
+4610,Xian 1980,1067,geographic 2D,6402,6610,,,,,Geodesy.,Supersedes Beijing 1954 (code 4214).,,EPSG,2002-02-12 00:00:00,,1,0
+4611,Hong Kong 1980,1118,geographic 2D,6402,6611,,,,,Geodetic and engineering surveying.,Supersedes Hong Kong 1963.,"Survey and Mapping Office, Lands Department. Http://www.info.gov.hk/landsd/mapping/tindex.htm",EPSG,2002-06-22 00:00:00,,1,0
+4612,JGD2000,1129,geographic 2D,6402,6612,,,,,Geodesy.,Supersedes Tokyo (code 4301) from April 2002.,Japanese Survey Federation.,EPSG,2002-04-25 00:00:00,,1,0
+4613,Segara,1360,geographic 2D,6402,6613,,,,,Geodetic survey.,,EPSG,EPSG,2002-06-22 00:00:00,,1,0
+4614,QND95,1346,geographic 2D,6402,6614,,,,,Geodetic survey.,,Qatar Centre for Geographic Information.,EPSG,2002-06-28 00:00:00,,1,0
+4615,Porto Santo,1314,geographic 2D,6402,6615,,,,,Geodetic survey.,,Instituto Geografico e Cadastral Lisbon; http://www.ipcc.pt,EPSG,2002-07-13 00:00:00,,1,0
+4616,Selvagem Grande,2779,geographic 2D,6402,6616,,,,,Geodetic survey.,,Instituto Geografico e Cadastral Lisbon; http://www.ipcc.pt,EPSG,2002-07-13 00:00:00,,1,0
+4617,NAD83(CSRS),1336,geographic 2D,6402,6140,,,,,Geodetic survey.,In New Brunswick superseded ATS77 from 1999.,Service New Brunswick Land and Information Standards Manual,EPSG,2002-07-13 00:00:00,,1,0
+4801,Bern 1898 (Bern),1286,geographic 2D,6402,6801,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4802,Bogota 1975 (Bogota),1070,geographic 2D,6402,6802,,,,,Geodetic survey.,"Supersedes earlier 3 adjustments of 1951, 1944 and 1941.","IGAC special publication no. 1, ""Geodesia"" 4th edition, 1975.",EPSG,2000-10-19 00:00:00,2000.07 2000.20,1,0
+4803,Lisbon (Lisbon),1294,geographic 2D,6402,6803,,,,,Geodetic survey.,Supersedes Lisbon 1890 system which used Bessel 1841 ellipsoid.  Superseded by Datum 73 (code 4274).,Instituto Geografico e Cadastral; Lisbon,EPSG,2000-03-07 00:00:00,97.12  2000.07  2001.551,1,0
+4804,Makassar (Jakarta),1316,geographic 2D,6402,6804,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4805,MGI (Ferro),1321,geographic 2D,6402,6805,,,,,Geodetic survey.,,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4806,Monte Mario (Rome),1127,geographic 2D,6402,6806,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4807,NTF (Paris),1353,geographic 2D,6403,6807,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4808,Padang (Jakarta),1355,geographic 2D,6402,6808,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4809,Belge 1950 (Brussels),1347,geographic 2D,6402,6809,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4810,Tananarive (Paris),1149,geographic 2D,6403,6810,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4811,Voirol 1875 (Paris),1365,geographic 2D,6403,6811,,,,,Geodetic survey.,Superseded by Nord Sahara 1959 (Paris) (code 4812).,IGN Paris,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4813,Batavia (Jakarta),1285,geographic 2D,6402,6813,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4814,RT38 (Stockholm),1225,geographic 2D,6402,6814,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4815,Greek (Athens),1106,geographic 2D,6402,6815,,,,,Geodetic survey.,,Topography Department; National Technical University of Greece.,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4816,Carthage (Paris),1236,geographic 2D,6403,6816,,,,,Geodetic survey.,Superseded by Greenwich-based Carthage geogCS.,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4817,NGO 1948 (Oslo),1352,geographic 2D,6402,6817,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4818,S-JTSK (Ferro),1306,geographic 2D,6402,6818,,,,,Geodetic survey.,"S-JTSK(Ferro) is the Uniform Trigonometric Cadastral Network.  It is a modification of  the Austrian MGI (Ferro) geogCS, code 4805.",Research Institute for Geodesy Topography and Cartography (VUGTK); Prague.,EPSG,2000-03-07 00:00:00,,1,0
+4819,Nord Sahara 1959 (Paris),1366,geographic 2D,6403,6819,,,,,Geodetic survey.,,"""Le System Geodesique Nord-Sahara""; IGN Paris",EPSG,2000-10-19 00:00:00,2000.74,1,0
+4820,Segara (Jakarta),1285,geographic 2D,6402,6820,,,,,Geodetic survey.,,,EPSG,2002-06-22 00:00:00,,1,0
+4901,ATF (Paris),1326,geographic 2D,6403,6901,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4902,NDG (Paris),1369,geographic 2D,6403,6902,,,,,Geodetic survey.,,,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4903,Madrid 1870 (Madrid),1217,geographic 2D,6402,6903,,,,,Geodetic survey.,,Institut de Geomatica; Barcelona.,EPSG,2000-03-07 00:00:00,2000.07,1,0
+4904,Lisbon 1890 (Lisbon),1294,geographic 2D,6402,6904,,,,,Geodetic survey.,Superseded by Lisbon 1937 system which uses International 1924 ellipsoid.,Instituto Geografico e Cadastral; Lisbon,EPSG,2002-07-13 00:00:00,,1,0
+5701,Newlyn,1264,vertical,6499,5101,,,,,Geodetic and engineering surveying.,,,EPSG,1995-06-02 00:00:00,,1,0
+5702,National Geodetic Vertical Datum of 1929,1323,vertical,6497,5102,,,,,Geodetic and engineering surveying.,,,EPSG,1996-10-18 00:00:00,,1,0
+5703,North American Vertical Datum of 1988,1730,vertical,6499,5103,,,,,Geodetic and engineering surveying.,,,EPSG,1996-10-18 00:00:00,,1,0
+5704,Yellow Sea,1067,vertical,6499,5104,,,,,Geodetic and engineering surveying.,,,EPSG,1995-06-02 00:00:00,,1,1
+5705,Baltic,1284,vertical,6499,5105,,,,,Geodetic and engineering surveying.,,,EPSG,1996-09-12 00:00:00,,1,0
+5706,Caspian,1291,vertical,6498,5106,,,,,Used for Soviet Union nautical charting of the Caspian Sea.,Capsian Sea water levels are now offset appreciably from this datum.,,EPSG,1996-09-12 00:00:00,,1,0
+5709,Normaal Amsterdams Peil,1275,vertical,6499,5109,,,,,Geodetic and engineering surveying.,,Nederlandse Commissie voor Geodesie publication 30; 1993,EPSG,2000-03-07 00:00:00,2000.10,1,0
+5710,Oostende,1347,vertical,6499,5110,,,,,Geodetic and engineering surveying.,,Nederlandse Commissie voor Geodesie publication 30; 1993,EPSG,1996-09-12 00:00:00,,1,0
+5711,Australian Height Datum,1281,vertical,6499,5111,,,,,Geodetic and engineering surveying.,,http://www.auslig.gov.au/geodesy,EPSG,1996-09-12 00:00:00,,1,0
+5712,Australian Height Datum (Tasmania),1282,vertical,6499,5112,,,,,Geodetic and engineering surveying.,,,EPSG,1996-09-12 00:00:00,,1,0
+5713,Canadian Vertical Datum of 1928,1289,vertical,6499,5114,,,,,Geodetic and engineering surveying.,,,EPSG,1996-12-12 00:00:00,,1,0
+5714,mean sea level height,1262,vertical,6499,5100,,,,,Used for hydrographic surveying.,Approximates geoid.  Not specific to any location or epoch.,,EPSG,1996-04-12 00:00:00,,1,0
+5715,mean sea level depth,1262,vertical,6498,5100,,,,,Used for hydrographic surveying.,Approximates geoid.  Not specific to any location or epoch.,,EPSG,1996-10-18 00:00:00,,1,0
+5716,Piraeus,1106,vertical,6499,5115,,,,,Geodetic and engineering surveying.,,Geodesy Department; Public Petroleum Corporation of Greece.,EPSG,1997-06-16 00:00:00,,1,0
+5717,N60,1095,vertical,6499,5116,,,,,Geodetic and engineering surveying.,In use since 1968.,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,1,0
+5718,RH70,1225,vertical,6499,5117,,,,,Geodetic and engineering surveying.,,National and Survey of Sweden,EPSG,1997-11-13 00:00:00,,1,0
+5719,NGF Lallemand,1326,vertical,6499,5118,,,,,Geodetic and engineering surveying.,Generally but not entirely superseded by NGF IGN69 (code 5720).,"Conseil National de l'Information Geographique groupe de travail ""Reseaux de Nivellement"" recommendations v5.1 April 1994",EPSG,1997-11-13 00:00:00,,1,0
+5720,NGF IGN69,1326,vertical,6499,5119,,,,,Geodetic and engineering surveying.,,"Conseil National de l'Information Geographique groupe de travail ""Reseaux de Nivellement"" recommendations v5.1 April 1994",EPSG,1997-11-13 00:00:00,,1,0
+5721,NGF IGN78,1327,vertical,6499,5120,,,,,Geodetic and engineering surveying.,,"Conseil National de l'Information Geographique groupe de travail ""Reseaux de Nivellement"" recommendations v5.1 April 1994",EPSG,1997-11-13 00:00:00,,1,0
+5722,Maputo,1167,vertical,6499,5121,,,,,Geodetic and engineering surveying.,,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,1,0
+5723,Japanese Standard Levelling Datum,1129,vertical,6499,5122,,,,,Geodetic and engineering surveying.,,Ministry of Construction; Japan.  http://vldb.gsi-mc.jp/sokuchi/datum/image/heichoku2.gif,EPSG,2002-06-22 00:00:00,2002.08,1,0
+5724,PDO Height Datum 1993,1183,vertical,6499,5123,,,,,Geodetic and engineering surveying.,Supersedes Fahud vertical datum (code 5725) from 1993.,Petroleum Development Oman,EPSG,1999-04-22 00:00:00,,1,0
+5725,Fahud Height Datum 1993,1183,vertical,6499,5124,,,,,Geodetic and engineering surveying.,Superseded by PHD93 (code 5724)  from 1993.,Petroleum Development Oman,EPSG,1999-04-22 00:00:00,,1,0
+5726,Ha Tien 1960,1302,vertical,6499,5125,,,,,Geodetic and engineering surveying.,In Vietnam superseded by Hon Dau from 1992.,,EPSG,1999-10-20 00:00:00,,1,0
+5727,Hon Dau 1992,1252,vertical,6499,5126,,,,,Geodetic and engineering surveying.,In Vietnam supersedes Ha Tien from 1992.,,EPSG,1999-10-20 00:00:00,,1,0
+5728,Landesnivellement 1902,1286,vertical,6499,5127,,,,,Geodetic and engineering surveying.,To be superseded by LHN95 (code 5729).,Bundesamt f�r Landestopographie,EPSG,1999-10-20 00:00:00,,1,0
+5729,Landeshohennetz 1995,1286,vertical,6499,5128,,,,,Geodetic and engineering surveying.,To supersede LN02 (code 5728).,Bundesamt f�r Landestopographie,EPSG,1999-10-20 00:00:00,,1,0
+5730,European Vertical Reference System 2000,1298,vertical,6499,5129,,,,,For pan-European products and services.,,IAG subcommission for Europe,EPSG,2000-10-19 00:00:00,,1,0
+5731,Malin Head,1305,vertical,6499,5130,,,,,Topographic mapping at all scales in Republic and medium and small scales in Northern Ireland.,Belfast (code 5732) used for large scale topographic mapping in Northern Ireland.,Ordnance Survey of Ireland.,EPSG,2001-11-06 00:00:00,,1,0
+5732,Belfast,2530,vertical,6499,5131,,,,,Large scale topographic mapping.,Malin Head (code 5731) used for medium and small scale topographic mapping.,Ordnance Survey of Northern Ireland.,EPSG,2001-11-06 00:00:00,,1,0
+5733,Dansk Normal Nul,1080,vertical,6499,5132,,,,,Topographic mapping and engineering survey.,,Kort & Matrikelstyrelsen,EPSG,2001-11-06 00:00:00,,1,0
+5734,AIOC95 depths,2592,vertical,6498,5133,,,,,Used by AIOC and BP for all offshore Azerbaijan activities and also as a height system for engineering survey at Sangachal terminal.,AIOC95 datum is 1.7m above Caspian datum and 26.3m below Baltic datum.,BP,EPSG,2002-02-12 00:00:00,,1,0
+5735,Black Sea,1102,vertical,6499,5134,,,,,Hydrographic surveying and since breakup of Former Soviet Union also topographic mapping.,Black Sea datum is 0.4m below Baltic datum.,BP,EPSG,2002-02-12 00:00:00,,1,0
+5736,Yellow Sea 1956,1067,vertical,6499,5104,,,,,Geodetic and engineering surveying.,Superseded by Yellow Sea 1985 (code 5737).,Guangdong Province Land Resource Information Centre,EPSG,2002-06-22 00:00:00,,1,0
+5737,Yellow Sea 1985,1067,vertical,6499,5137,,,,,Geodetic and engineering surveying.,Supersedes Yellow Sea 1956 (code 5736).,Guangdong Province Land Resource Information Centre,EPSG,2002-06-22 00:00:00,,1,0
+5738,Hong Kong Principal Datum,1118,vertical,6499,5135,,,,,"Geodetic, topographic and engineering surveying.",,"Survey and Mapping Office, Lands Department. Http://www.info.gov.hk/landsd/mapping/tindex.htm",EPSG,2002-06-22 00:00:00,,1,0
+5739,Hong Kong Chart Datum,1118,vertical,6498,5136,,,,,Hydrographic charting.,Chart datum is 0.15 metres below Hong Kong Principal Datum (CRS code 5738) and 1.38m below MSL at Quarry Bay.,"Survey and Mapping Office, Lands Department. Http://www.info.gov.hk/landsd/mapping/tindex.htm",EPSG,2002-06-22 00:00:00,,1,0
+5800,Astra Minas Grid,1265,engineering,6507,9300,,,,,Oil exploration.,,,EPSG,2000-03-07 00:00:00,,1,0
+5801,Barcelona Grid B1,1266,engineering,4500,9301,,,,,Oil exploration by MGO and Talon.,Centre of the gateway of San Cristobal chuch; Plaza Boyaca; Barcelona.  500000E 300000 N at 10deg 08min 06sec N  64deg 41min 17sec W.,Ministry of Mines standards manual of 1974.,EPSG,2000-03-07 00:00:00,,1,0
+5802,Barcelona Grid B2,1266,engineering,4500,9301,,,,,Oil exploration by Phillips; Mobil; Texas; Mercedes; Varco.,Centre of the gateway of San Cristobal chuch; Plaza Boyaca; Barcelona.  500000E 300000 N at 10deg 08min 06sec N  64deg 41min 07.5sec W.,Ministry of Mines standards manual of 1974.,EPSG,2000-03-07 00:00:00,,1,0
+5803,Maturin Grid,1320,engineering,4500,9302,,,,,Oil exploration by MGO and Talon.,Centre of the gateway of San Cristobal chuch; Plaza Boyaca; Barcelona.  500000E 300000 N at 10deg 08min 06sec N  64deg 41min 17sec W.,Ministry of Mines standards manual of 1974.,EPSG,2000-03-07 00:00:00,,1,0
+5804,EPSG seismic bin grid example A,1263,engineering,6508,9312,,,,,Example only - fictitious.,"Bin grid I=J=1 at WGS 84 / UTM zone 31N 456781E 5836723N.
+Bin grid orientation = 20 degrees grid.  Bin width I=25m, J=12.5m.  Bin increment I=1, J=1.  Scale factor at origin 0.99984",UKOOA P6/98 seismic bin grid guideline.,EPSG,2000-06-23 00:00:00,,1,0
+5805,EPSG seismic bin grid example B,1263,engineering,6506,9312,,,,,Example only - fictitious.,,,EPSG,2000-06-23 00:00:00,,1,0
+5806,EPSG local engineering grid example A,1263,engineering,6505,9313,,,,,Example only - fictitious.,"Coordinates are 0,0 at conductor slot A1.",EPSG,EPSG,2000-06-23 00:00:00,,1,0
+5807,EPSG local engineering grid example B,1263,engineering,6504,9313,,,,,Example only - fictitious.,"Shows alternative use of coordinate axis name.
+
+Coordinates are 0,0 at conductor slot A1.",EPSG,EPSG,2000-06-23 00:00:00,,1,0
+5808,Maracaibo Cross Grid M4,1319,engineering,4500,9303,,,,,Oil exploration by Chevron and CVP.,Grid coordinates 200000N 200000E at Cruz Canada Morillo in Maracaibo.  The cross is ascribed coordinates of 10deg 38min 22sec N; 71deg 37min 18sec W.,Ministry of Mines standards manual of 1974.,EPSG,2000-06-23 00:00:00,,1,0
+5809,Maracaibo Cross Grid M5,1319,engineering,4500,9303,,,,,Oil exploration by Texas.,Grid coordinates 200000N 200000E at Cruz Canada Morillo in Maracaibo.  The cross is ascribed coordinates of 10deg 38min 32.3sec N; 71deg 37min 12.1sec W.,Ministry of Mines standards manual of 1974.,EPSG,2000-06-23 00:00:00,,1,0
+5810,La Rosa Grid,1311,engineering,4500,9304,,,,,Oil exploration.,Grid coordinates (0 0) at the monument in La Rosa (10deg 22min 40.417sec N 71deg 26min 59.488sec W; Loma Qunitana datum).  Origin possibly at Cerro Penal (71deg 12min 58sec W) where grid north aligned to true north.  See Lake / Maracaibo La Rosa grid.,Ministry of Mines standards manual of 1974.,EPSG,2000-06-23 00:00:00,,1,0
+5811,Mene Grande,1270,engineering,4500,9305,,,,,Oil exploration by Shell.,Grid coordinates (0 0) at the monument in Santa Barabara; Mene Grande.  The monument is ascribed coordinates of 9deg 52min 25.488sec N; 70deg 54min 35.310sec W.,Ministry of Mines standards manual of 1974.,EPSG,2000-06-23 00:00:00,,1,0
+5812,El Cubo,1269,engineering,4500,9306,,,,,Oil exploration by Shell.,Grid coordinates (0 0) at El Cubo (8deg 44min 17.258sec N; 72deg 30min 09.01sec W).,Ministry of Mines standards manual of 1974.,EPSG,2000-06-23 00:00:00,,1,0
+5813,Dabajuro,1268,engineering,4500,9307,,,,,Oil exploration by Chevron Creole and Texas.,Grid coordinates 200000N 200000E at the centre of the tower of the church at Dabajuro.  The tower is ascribed coordinates of 11deg 01min 19sec N; 70deg 40min 40sec W.,Ministry of Mines standards manual of 1974.,EPSG,2000-06-23 00:00:00,,1,0
+5814,Tucupita,1370,engineering,4500,9308,,,,,Oil exploration by Creole and Texas.,Grid coordinates 200000N 200000E at centre of the Bolivar plaza in Tucupita.  The plaza is ascribed coordinates of 9deg 03min 32sec N; 62deg 03min 07.6sec W.,Ministry of Mines standards manual of 1974.,EPSG,2000-06-23 00:00:00,,1,0
+5815,Santa Maria de Ipire,1371,engineering,4500,9310,,,,,Oil exploration by Creole  Phillips and Varco.,Grid coordinates 200000N 200000E at concrete monument PR-1 in the Bolivar plaza in Santa Maria de Ipire.  The monument is ascribed coordinates of 8deg 40min 06sec N; 65deg 19min 09sec W.,Ministry of Mines standards manual of 1974.,EPSG,2000-06-23 00:00:00,,1,0
+5816,Barinas west base,1267,engineering,4500,9311,,,,,Oil exploration by Sinclair.,Grid coordinates 200000N 200000E at the west base monument in Barinas.,Ministry of Mines standards manual of 1974.,EPSG,2000-06-23 00:00:00,,1,0
+7400,NTF (Paris) + NGF IGN69,1326,compound,,,,,4807,5720,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+7401,NTF (Paris) / France II + NGF Lallemand,1326,compound,,,,,27582,5719,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,1
+7402,NTF (Paris) / France II + NGF IGN69,1326,compound,,,,,27582,5720,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,1
+7403,NTF (Paris) / France III + NGF IGN69,1733,compound,,,,,27583,5720,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,1
+7404,RT90 + RH70,1225,compound,,,,,4124,5718,Large and medium scale topographic mapping and engineering survey.,When combined with geoid model RN92 forms geographic 3D coordinate system RR92.,National Land Survey of Sweden,EPSG,1997-11-13 00:00:00,,1,0
+7405,OSGB36 / British National Grid + ODN,1264,compound,,,,,27700,5701,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+7406,NAD27 + NGVD29,1323,compound,,,,,4267,5702,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+7407,NAD27 / Texas North + NGVD29,2253,compound,,,,,32037,5702,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+7408,RD/NAP,1275,compound,,,,,4289,5709,Large and medium scale topographic mapping and engineering survey.,,http://rdnap.kadaster.nl/rd/index.html,EPSG,2000-10-19 00:00:00,,1,0
+7409,ETRS89 + EVRS2000,1298,compound,,,,,4258,5730,For pan-European products and services.,,IAG subcommission for Europe,EPSG,2000-10-19 00:00:00,,1,0
+7410,PSHD93,1183,compound,,,,,4134,5724,Oil exploration.,,Petroleum Development Oman,EPSG,2001-06-05 00:00:00,,1,0
+7411,NTF (Paris) / Lambert zone II + NGF Lallemand,1326,compound,,,,,27572,5719,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2001-11-06 00:00:00,,1,0
+7412,NTF (Paris) / Lambert zone II + NGF IGN69,1326,compound,,,,,27572,5719,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2001-11-06 00:00:00,,1,0
+7413,NTF (Paris) / Lambert zone III + NGF IGN69,1733,compound,,,,,27573,5719,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2001-11-06 00:00:00,,1,0
+20004,Pulkovo 1995 / Gauss-Kruger zone 4,1763,projected,4530,,4200,16204,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 21E (code 2463).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20005,Pulkovo 1995 / Gauss-Kruger zone 5,1764,projected,4530,,4200,16205,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 27E (code 2464).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20006,Pulkovo 1995 / Gauss-Kruger zone 6,1765,projected,4530,,4200,16206,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 33E (code 2465).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20007,Pulkovo 1995 / Gauss-Kruger zone 7,1766,projected,4530,,4200,16207,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 39E (code 2466).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20008,Pulkovo 1995 / Gauss-Kruger zone 8,1767,projected,4530,,4200,16208,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 45E (code 2467).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20009,Pulkovo 1995 / Gauss-Kruger zone 9,1768,projected,4530,,4200,16209,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 51E (code 2468).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20010,Pulkovo 1995 / Gauss-Kruger zone 10,1769,projected,4530,,4200,16210,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 57E (code 2469).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20011,Pulkovo 1995 / Gauss-Kruger zone 11,1770,projected,4530,,4200,16211,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 63E (code 2470).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20012,Pulkovo 1995 / Gauss-Kruger zone 12,1771,projected,4530,,4200,16212,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 69E (code 2471).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20013,Pulkovo 1995 / Gauss-Kruger zone 13,1772,projected,4530,,4200,16213,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 75E (code 2472).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20014,Pulkovo 1995 / Gauss-Kruger zone 14,1773,projected,4530,,4200,16214,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 81E (code 2473).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20015,Pulkovo 1995 / Gauss-Kruger zone 15,1774,projected,4530,,4200,16215,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 87E (code 2474).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20016,Pulkovo 1995 / Gauss-Kruger zone 16,1775,projected,4530,,4200,16216,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 93E (code 2475).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20017,Pulkovo 1995 / Gauss-Kruger zone 17,1776,projected,4530,,4200,16217,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 99E (code 2476).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20018,Pulkovo 1995 / Gauss-Kruger zone 18,1777,projected,4530,,4200,16218,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 105E (code 2477).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20019,Pulkovo 1995 / Gauss-Kruger zone 19,1778,projected,4530,,4200,16219,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 111E (code 2478).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20020,Pulkovo 1995 / Gauss-Kruger zone 20,1779,projected,4530,,4200,16220,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 117E (code 2479).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20021,Pulkovo 1995 / Gauss-Kruger zone 21,1780,projected,4530,,4200,16221,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 123E (code 2480).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20022,Pulkovo 1995 / Gauss-Kruger zone 22,1781,projected,4530,,4200,16222,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 129E (code 2481).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20023,Pulkovo 1995 / Gauss-Kruger zone 23,1782,projected,4530,,4200,16223,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 135E (code 2482).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20024,Pulkovo 1995 / Gauss-Kruger zone 24,1783,projected,4530,,4200,16224,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 141E (code 2483).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20025,Pulkovo 1995 / Gauss-Kruger zone 25,1784,projected,4530,,4200,16225,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 147E (code 2484).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20026,Pulkovo 1995 / Gauss-Kruger zone 26,1785,projected,4530,,4200,16226,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 153E (code 2485).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20027,Pulkovo 1995 / Gauss-Kruger zone 27,1786,projected,4530,,4200,16227,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 159E (code 2486).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20028,Pulkovo 1995 / Gauss-Kruger zone 28,1787,projected,4530,,4200,16228,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 165E (code 2487).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20029,Pulkovo 1995 / Gauss-Kruger zone 29,1788,projected,4530,,4200,16229,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 171E (code 2488).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20030,Pulkovo 1995 / Gauss-Kruger zone 30,1789,projected,4530,,4200,16230,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 177E (code 2489).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20031,Pulkovo 1995 / Gauss-Kruger zone 31,1790,projected,4530,,4200,16231,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 177W (code 2490).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20032,Pulkovo 1995 / Gauss-Kruger zone 32,1791,projected,4530,,4200,16232,,,Medium scale topographic mapping.,Also found with truncated false easting - see Pulkovo 1995 / Gauss-Kruger CM 171W (code 2491).,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,2002-06-22 00:00:00,2002.36,1,0
+20064,Pulkovo 1995 / Gauss-Kruger 4N,1763,projected,4530,,4200,16304,,,Truncated form of Gauss-Kruger zone 4,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20065,Pulkovo 1995 / Gauss-Kruger 5N,1764,projected,4530,,4200,16305,,,Truncated form of Gauss-Kruger zone 5,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20066,Pulkovo 1995 / Gauss-Kruger 6N,1765,projected,4530,,4200,16306,,,Truncated form of Gauss-Kruger zone 6,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20067,Pulkovo 1995 / Gauss-Kruger 7N,1766,projected,4530,,4200,16307,,,Truncated form of Gauss-Kruger zone 7,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20068,Pulkovo 1995 / Gauss-Kruger 8N,1767,projected,4530,,4200,16308,,,Truncated form of Gauss-Kruger zone 8,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20069,Pulkovo 1995 / Gauss-Kruger 9N,1768,projected,4530,,4200,16309,,,Truncated form of Gauss-Kruger zone 9,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20070,Pulkovo 1995 / Gauss-Kruger 10N,1769,projected,4530,,4200,16310,,,Truncated form of Gauss-Kruger zone 10,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20071,Pulkovo 1995 / Gauss-Kruger 11N,1770,projected,4530,,4200,16311,,,Truncated form of Gauss-Kruger zone 11,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20072,Pulkovo 1995 / Gauss-Kruger 12N,1771,projected,4530,,4200,16312,,,Truncated form of Gauss-Kruger zone 12,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20073,Pulkovo 1995 / Gauss-Kruger 13N,1772,projected,4530,,4200,16313,,,Truncated form of Gauss-Kruger zone 13,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20074,Pulkovo 1995 / Gauss-Kruger 14N,1773,projected,4530,,4200,16314,,,Truncated form of Gauss-Kruger zone 14,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20075,Pulkovo 1995 / Gauss-Kruger 15N,1774,projected,4530,,4200,16315,,,Truncated form of Gauss-Kruger zone 15,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20076,Pulkovo 1995 / Gauss-Kruger 16N,1775,projected,4530,,4200,16316,,,Truncated form of Gauss-Kruger zone 16,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20077,Pulkovo 1995 / Gauss-Kruger 17N,1776,projected,4530,,4200,16317,,,Truncated form of Gauss-Kruger zone 17,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20078,Pulkovo 1995 / Gauss-Kruger 18N,1777,projected,4530,,4200,16318,,,Truncated form of Gauss-Kruger zone 18,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20079,Pulkovo 1995 / Gauss-Kruger 19N,1778,projected,4530,,4200,16319,,,Truncated form of Gauss-Kruger zone 19,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20080,Pulkovo 1995 / Gauss-Kruger 20N,1779,projected,4530,,4200,16320,,,Truncated form of Gauss-Kruger zone 20,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20081,Pulkovo 1995 / Gauss-Kruger 21N,1780,projected,4530,,4200,16321,,,Truncated form of Gauss-Kruger zone 21,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20082,Pulkovo 1995 / Gauss-Kruger 22N,1781,projected,4530,,4200,16322,,,Truncated form of Gauss-Kruger zone 22,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20083,Pulkovo 1995 / Gauss-Kruger 23N,1782,projected,4530,,4200,16323,,,Truncated form of Gauss-Kruger zone 23,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20084,Pulkovo 1995 / Gauss-Kruger 24N,1783,projected,4530,,4200,16324,,,Truncated form of Gauss-Kruger zone 24,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20085,Pulkovo 1995 / Gauss-Kruger 25N,1784,projected,4530,,4200,16325,,,Truncated form of Gauss-Kruger zone 25,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20086,Pulkovo 1995 / Gauss-Kruger 26N,1785,projected,4530,,4200,16326,,,Truncated form of Gauss-Kruger zone 26,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20087,Pulkovo 1995 / Gauss-Kruger 27N,1786,projected,4530,,4200,16327,,,Truncated form of Gauss-Kruger zone 27,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20088,Pulkovo 1995 / Gauss-Kruger 28N,1787,projected,4530,,4200,16328,,,Truncated form of Gauss-Kruger zone 28,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20089,Pulkovo 1995 / Gauss-Kruger 29N,1788,projected,4530,,4200,16329,,,Truncated form of Gauss-Kruger zone 29,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20090,Pulkovo 1995 / Gauss-Kruger 30N,1789,projected,4530,,4200,16330,,,Truncated form of Gauss-Kruger zone 30,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20091,Pulkovo 1995 / Gauss-Kruger 31N,1790,projected,4530,,4200,16331,,,Truncated form of Gauss-Kruger zone 31,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20092,Pulkovo 1995 / Gauss-Kruger 32N,1791,projected,4530,,4200,16332,,,Truncated form of Gauss-Kruger zone 32,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,1,1
+20137,Adindan / UTM zone 37N,1552,projected,4400,,4201,16037,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20138,Adindan / UTM zone 38N,1553,projected,4400,,4201,16038,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20248,AGD66 / AMG zone 48,1556,projected,4400,,4202,17448,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20249,AGD66 / AMG zone 49,1557,projected,4400,,4202,17449,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20250,AGD66 / AMG zone 50,1558,projected,4400,,4202,17450,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20251,AGD66 / AMG zone 51,1559,projected,4400,,4202,17451,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20252,AGD66 / AMG zone 52,1560,projected,4400,,4202,17452,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20253,AGD66 / AMG zone 53,1561,projected,4400,,4202,17453,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20254,AGD66 / AMG zone 54,1567,projected,4400,,4202,17454,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20255,AGD66 / AMG zone 55,1568,projected,4400,,4202,17455,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20256,AGD66 / AMG zone 56,1564,projected,4400,,4202,17456,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20257,AGD66 / AMG zone 57,1565,projected,4400,,4202,17457,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20258,AGD66 / AMG zone 58,1566,projected,4400,,4202,17458,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20348,AGD84 / AMG zone 48,1556,projected,4400,,4203,17448,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20349,AGD84 / AMG zone 49,1557,projected,4400,,4203,17449,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20350,AGD84 / AMG zone 50,1558,projected,4400,,4203,17450,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20351,AGD84 / AMG zone 51,1559,projected,4400,,4203,17451,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20352,AGD84 / AMG zone 52,1560,projected,4400,,4203,17452,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20353,AGD84 / AMG zone 53,1561,projected,4400,,4203,17453,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20354,AGD84 / AMG zone 54,1562,projected,4400,,4203,17454,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20355,AGD84 / AMG zone 55,1563,projected,4400,,4203,17455,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20356,AGD84 / AMG zone 56,1564,projected,4400,,4203,17456,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20357,AGD84 / AMG zone 57,1565,projected,4400,,4203,17457,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20358,AGD84 / AMG zone 58,1566,projected,4400,,4203,17458,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20437,Ain el Abd / UTM zone 37N,1569,projected,4400,,4204,16037,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,97.59,1,0
+20438,Ain el Abd / UTM zone 38N,1571,projected,4400,,4204,16038,,,"Large and medium scale topographic mapping and engineering survey. In Kuwait Oil production (but not exploration - see KOC Lambert, code 24600).","Known in Kuwait as ""KOC UTM"". Used by KOC for engineering but not explorartion (see KOC Lambert, code 24600).",,EPSG,1997-11-13 00:00:00,97.59,1,0
+20439,Ain el Abd / UTM zone 39N,1570,projected,4400,,4204,16039,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,97.59,1,0
+20499,Ain el Abd / Bahrain Grid,1040,projected,4400,,4204,19900,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20538,Afgooye / UTM zone 38N,1554,projected,4400,,4205,16038,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20539,Afgooye / UTM zone 39N,1555,projected,4400,,4205,16039,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+20790,Lisbon (Lisbon)/Portuguese National Grid,1294,projected,4499,,4803,19936,,,Large and medium scale topographic mapping and engineering survey for military purposes.,,Instituto Geografico e Cadastral; Lisbon,EPSG,1998-11-11 00:00:00,98.42  2000.551,1,0
+20791,Lisbon (Lisbon)/Portuguese Grid,1294,projected,4499,,4803,19969,,,Large and medium scale topographic mapping and engineering survey.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+20822,Aratu / UTM zone 22S,1572,projected,4400,,4208,16122,,,Oil exploration and production.,,,EPSG,1995-07-21 00:00:00,95.191,1,0
+20823,Aratu / UTM zone 23S,1573,projected,4400,,4208,16123,,,Oil exploration and production.,,,EPSG,1995-07-21 00:00:00,95.191,1,0
+20824,Aratu / UTM zone 24S,1574,projected,4400,,4208,16124,,,Oil exploration and production.,,,EPSG,1995-07-21 00:00:00,95.191,1,0
+20934,Arc 1950 / UTM zone 34S,1575,projected,4400,,4209,16134,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+20935,Arc 1950 / UTM zone 35S,1576,projected,4400,,4209,16135,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+20936,Arc 1950 / UTM zone 36S,1577,projected,4400,,4209,16136,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+21035,Arc 1960 / UTM zone 35S,1579,projected,4400,,4210,16135,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+21036,Arc 1960 / UTM zone 36S,1581,projected,4400,,4210,16136,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+21037,Arc 1960 / UTM zone 37S,1583,projected,4400,,4210,16137,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+21095,Arc 1960 / UTM zone 35N,1578,projected,4400,,4210,16035,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+21096,Arc 1960 / UTM zone 36N,1580,projected,4400,,4210,16036,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+21097,Arc 1960 / UTM zone 37N,1582,projected,4400,,4210,16037,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,,1,0
+21100,Batavia (Jakarta) / NEIEZ,1285,projected,4499,,4813,19905,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+21148,Batavia / UTM zone 48S,1584,projected,4400,,4211,16148,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+21149,Batavia / UTM zone 49S,1586,projected,4400,,4211,16149,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+21150,Batavia / UTM zone 50S,1585,projected,4400,,4211,16150,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+21291,Barbados 1938 / British West Indies Grid,1042,projected,4400,,4212,19942,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by Barbados National Grid (code 21292) from 1983.,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+21292,Barbados 1938 / Barbados National Grid,1042,projected,4400,,4212,19943,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes Barbados 1938 / BWI Grid (code 21291) from 1983.,Ordnance Survey of Great Britain,EPSG,1999-04-22 00:00:00,,1,0
+21413,Beijing 1954 / Gauss-Kruger zone 13,1587,projected,4530,,4214,16213,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 75E (code 24153). Superseded by Xian 1980 / Gauss-Kruger zone 13 (code 2327).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21414,Beijing 1954 / Gauss-Kruger zone 14,1588,projected,4530,,4214,16214,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 81E (code 24154). Superseded by Xian 1980 / Gauss-Kruger zone 14 (code 2328).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21415,Beijing 1954 / Gauss-Kruger zone 15,1589,projected,4530,,4214,16215,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 87E (code 24155). Superseded by Xian 1980 / Gauss-Kruger zone 15 (code 2329).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21416,Beijing 1954 / Gauss-Kruger zone 16,1590,projected,4530,,4214,16216,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 93E (code 24156). Superseded by Xian 1980 / Gauss-Kruger zone 16 (code 2330).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21417,Beijing 1954 / Gauss-Kruger zone 17,1591,projected,4530,,4214,16217,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 99E (code 24157). Superseded by Xian 1980 / Gauss-Kruger zone 17 (code 2331).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21418,Beijing 1954 / Gauss-Kruger zone 18,1592,projected,4530,,4214,16218,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 105E (code 24158). Superseded by Xian 1980 / Gauss-Kruger zone 18 (code 2332).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21419,Beijing 1954 / Gauss-Kruger zone 19,1593,projected,4530,,4214,16219,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 111E (code 24159). Superseded by Xian 1980 / Gauss-Kruger zone 19 (code 2333).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21420,Beijing 1954 / Gauss-Kruger zone 20,1594,projected,4530,,4214,16220,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 117E (code 24160). Superseded by Xian 1980 / Gauss-Kruger zone 20 (code 2334).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21421,Beijing 1954 / Gauss-Kruger zone 21,1595,projected,4530,,4214,16221,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 123E (code 24161). Superseded by Xian 1980 / Gauss-Kruger zone 21 (code 2335).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21422,Beijing 1954 / Gauss-Kruger zone 22,1596,projected,4530,,4214,16222,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 129E (code 24162). Superseded by Xian 1980 / Gauss-Kruger zone 22 (code 2336).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21423,Beijing 1954 / Gauss-Kruger zone 23,1597,projected,4530,,4214,16223,,,Medium scale topographic mapping.,Also found with truncated false easting - see Beijing 1954 / Gauss-Kruger CM 135E (code 24163). Superseded by Xian 1980 / Gauss-Kruger zone 23 (code 2337).,,EPSG,2002-06-22 00:00:00,2002.16,1,0
+21453,Beijing 1954 / Gauss-Kruger CM 75E,1587,projected,4530,,4214,16313,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 13 (code 21413). Superseded by Xian 1980 / Gauss-Kruger CM 75E (code 2338).,,EPSG,2002-06-22 00:00:00,,1,0
+21454,Beijing 1954 / Gauss-Kruger CM 81E,1588,projected,4530,,4214,16314,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 14 (code 21414). Superseded by Xian 1980 / Gauss-Kruger CM 81E (code 2339).,,EPSG,2002-06-22 00:00:00,,1,0
+21455,Beijing 1954 / Gauss-Kruger CM 87E,1589,projected,4530,,4214,16315,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 15 (code 21415). Superseded by Xian 1980 / Gauss-Kruger CM 87E (code 2340).,,EPSG,2002-06-22 00:00:00,,1,0
+21456,Beijing 1954 / Gauss-Kruger CM 93E,1590,projected,4530,,4214,16316,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 16 (code 21416). Superseded by Xian 1980 / Gauss-Kruger CM 93E (code 2341).,,EPSG,2002-06-22 00:00:00,,1,0
+21457,Beijing 1954 / Gauss-Kruger CM 99E,1591,projected,4530,,4214,16317,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 17 (code 21417). Superseded by Xian 1980 / Gauss-Kruger CM 99E (code 2342).,,EPSG,2002-06-22 00:00:00,,1,0
+21458,Beijing 1954 / Gauss-Kruger CM 105E,1592,projected,4530,,4214,16318,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 18 (code 21418). Superseded by Xian 1980 / Gauss-Kruger CM 105E (code 2343).,,EPSG,2002-06-22 00:00:00,,1,0
+21459,Beijing 1954 / Gauss-Kruger CM 111E,1593,projected,4530,,4214,16319,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 19 (code 21419). Superseded by Xian 1980 / Gauss-Kruger CM 111E (code 2344).,,EPSG,2002-06-22 00:00:00,,1,0
+21460,Beijing 1954 / Gauss-Kruger CM 117E,1594,projected,4530,,4214,16320,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 20 (code 21420). Superseded by Xian 1980 / Gauss-Kruger CM 117E (code 2345).,,EPSG,2002-06-22 00:00:00,,1,0
+21461,Beijing 1954 / Gauss-Kruger CM 123E,1595,projected,4530,,4214,16321,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 21 (code 21421). Superseded by Xian 1980 / Gauss-Kruger CM 123E (code 2346).,,EPSG,2002-06-22 00:00:00,,1,0
+21462,Beijing 1954 / Gauss-Kruger CM 129E,1596,projected,4530,,4214,16322,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 22 (code 21422). Superseded by Xian 1980 / Gauss-Kruger CM 129E (code 2347).,,EPSG,2002-06-22 00:00:00,,1,0
+21463,Beijing 1954 / Gauss-Kruger CM 135E,1597,projected,4530,,4214,16323,,,Medium scale topographic mapping.,Truncated form of Beijing 1954 / Gauss-Kruger zone 33 (code 21423). Superseded by Xian 1980 / Gauss-Kruger CM 135E (code 2348).,,EPSG,2002-06-22 00:00:00,,1,0
+21473,Beijing 1954 / Gauss-Kruger 13N,1587,projected,4530,,4214,16313,,,Truncated form of Gauss-Kruger zone 13,,,EPSG,1995-06-02 00:00:00,,1,1
+21474,Beijing 1954 / Gauss-Kruger 14N,1588,projected,4530,,4214,16314,,,Truncated form of Gauss-Kruger zone 14,,,EPSG,1995-06-02 00:00:00,,1,1
+21475,Beijing 1954 / Gauss-Kruger 15N,1589,projected,4530,,4214,16315,,,Truncated form of Gauss-Kruger zone 15,,,EPSG,1995-06-02 00:00:00,,1,1
+21476,Beijing 1954 / Gauss-Kruger 16N,1590,projected,4530,,4214,16316,,,Truncated form of Gauss-Kruger zone 16,,,EPSG,1995-06-02 00:00:00,,1,1
+21477,Beijing 1954 / Gauss-Kruger 17N,1591,projected,4530,,4214,16317,,,Truncated form of Gauss-Kruger zone 17,,,EPSG,1995-06-02 00:00:00,,1,1
+21478,Beijing 1954 / Gauss-Kruger 18N,1592,projected,4530,,4214,16318,,,Truncated form of Gauss-Kruger zone 18,,,EPSG,1995-06-02 00:00:00,,1,1
+21479,Beijing 1954 / Gauss-Kruger 19N,1593,projected,4530,,4214,16319,,,Truncated form of Gauss-Kruger zone 19,,,EPSG,1995-06-02 00:00:00,,1,1
+21480,Beijing 1954 / Gauss-Kruger 20N,1594,projected,4530,,4214,16320,,,Truncated form of Gauss-Kruger zone 20,,,EPSG,1995-06-02 00:00:00,,1,1
+21481,Beijing 1954 / Gauss-Kruger 21N,1595,projected,4530,,4214,16321,,,Truncated form of Gauss-Kruger zone 21,,,EPSG,1995-06-02 00:00:00,,1,1
+21482,Beijing 1954 / Gauss-Kruger 22N,1596,projected,4530,,4214,16322,,,Truncated form of Gauss-Kruger zone 22,,,EPSG,1995-06-02 00:00:00,,1,1
+21483,Beijing 1954 / Gauss-Kruger 23N,1597,projected,4530,,4214,16323,,,Truncated form of Gauss-Kruger zone 23,,,EPSG,1995-06-02 00:00:00,,1,1
+21500,Belge 1950 (Brussels) / Belge Lambert 50,1347,projected,4499,,4809,19901,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Belge 1972 / Belge Lambert 72 (code 31300) and Belge 1972 / Belgian Lambert 72 (code 31370).,,EPSG,1997-04-11 00:00:00,97.13,1,0
+21780,Bern 1898 (Bern) / LV03C,1286,projected,4498,,4801,19923,,,Large and medium scale topographic mapping and engineering survey.,Superseded by CH1903 / LV03 (code 21781).,,EPSG,1997-06-30 00:00:00,97.27  97.62,1,0
+21781,CH1903 / LV03,1286,projected,4498,,4149,19922,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes LV03C (code 21780).  Superseded by CH1903+/LV95 (code 2056).,,EPSG,1999-10-20 00:00:00,2001.29,1,0
+21817,Bogota 1975 / UTM zone 17N,1602,projected,4400,,4218,16017,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,2000.20,1,0
+21818,Bogota 1975 / UTM zone 18N,1603,projected,4400,,4218,16018,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,2000.20,1,0
+21891,Bogota 1975 / Colombia West zone,1598,projected,4499,,4218,18051,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,97.11  97.57 2000.20,1,0
+21892,Bogota 1975 / Colombia Bogota zone,1599,projected,4499,,4218,18052,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,97.11  97.57 2000.20,1,0
+21893,Bogota 1975 / Colombia East Central zone,1600,projected,4499,,4218,18053,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,97.11  97.57 2000.20,1,0
+21894,Bogota 1975 / Colombia East,1601,projected,4499,,4218,18054,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,97.11  97.57 2000.20,1,0
+22032,Camacupa / UTM zone 32S,1606,projected,4400,,4220,16132,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,97.58,1,0
+22033,Camacupa / UTM zone 33S,1607,projected,4400,,4220,16133,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-11-13 00:00:00,97.58,1,0
+22091,Camacupa / TM 11.30 SE,1605,projected,4400,,4220,16611,,,Oil exploration by Esso Angola offshore blocks 15 and 24.,,Esso Angola,EPSG,1998-11-11 00:00:00,,1,0
+22092,Camacupa / TM 12 SE,1604,projected,4400,,4220,16612,,,"Oil exploration by Shell Angola for offshore blocks 1 and 16  and by BP Amoco, Elf and Esso for offshore blocks 31-33.",,Shell Angola,EPSG,1998-11-11 00:00:00,,1,0
+22191,Campo Inchauspe / Argentina 1,1608,projected,4530,,4221,18031,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,97.72 2002.36,1,0
+22192,Campo Inchauspe / Argentina 2,1609,projected,4530,,4221,18032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,97.72 2002.36,1,0
+22193,Campo Inchauspe / Argentina 3,1610,projected,4530,,4221,18033,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,97.72 2002.36,1,0
+22194,Campo Inchauspe / Argentina 4,1611,projected,4530,,4221,18034,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,97.72 2002.36,1,0
+22195,Campo Inchauspe / Argentina 5,1612,projected,4530,,4221,18035,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,97.72 2002.36,1,0
+22196,Campo Inchauspe / Argentina 6,1613,projected,4530,,4221,18036,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,97.72 2002.36,1,0
+22197,Campo Inchauspe / Argentina 7,1614,projected,4530,,4221,18037,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,97.72 2002.36,1,0
+22234,Cape / UTM zone 34S,1615,projected,4400,,4222,16134,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-12-08 00:00:00,,1,0
+22235,Cape / UTM zone 35S,1617,projected,4400,,4222,16135,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-12-08 00:00:00,,1,0
+22236,Cape / UTM zone 36S,1616,projected,4400,,4222,16136,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-12-08 00:00:00,,1,0
+22275,South African Coordinate System zone 15,1454,projected,6503,,4222,17515,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,2000-03-07 00:00:00,99.98  2000.04,1,0
+22277,South African Coordinate System zone 17,1455,projected,6503,,4222,17517,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,2000-03-07 00:00:00,99.98  2000.04,1,0
+22279,South African Coordinate System zone 19,1456,projected,6503,,4222,17519,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,2000-03-07 00:00:00,99.98  2000.04,1,0
+22281,South African Coordinate System zone 21,1457,projected,6503,,4222,17521,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,2000-03-07 00:00:00,99.98  2000.04,1,0
+22283,South African Coordinate System zone 23,1458,projected,6503,,4222,17523,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,2000-03-07 00:00:00,99.98  2000.04,1,0
+22285,South African Coordinate System zone 25,1459,projected,6503,,4222,17525,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,2000-03-07 00:00:00,99.98  2000.04,1,0
+22287,South African Coordinate System zone 27,1460,projected,6503,,4222,17527,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,2000-03-07 00:00:00,99.98  2000.04,1,0
+22289,South African Coordinate System zone 29,1461,projected,6503,,4222,17529,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,2000-03-07 00:00:00,99.98  2000.04,1,0
+22291,South African Coordinate System zone 31,1462,projected,6503,,4222,17531,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,2000-03-07 00:00:00,99.98  2000.04,1,0
+22293,South African Coordinate System zone 33,1463,projected,6503,,4222,17533,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,"Directorate of Surveys and Mapping, Mowbray, South Africa.",EPSG,2000-03-07 00:00:00,99.98  2000.04,1,0
+22300,Carthage (Paris) / Tunisia Mining Grid,1618,projected,4406,,4816,19937,,,Large and medium scale topographic mapping and engineering survey.,CAUTION: Carthage datum did not exist when the 1953 decree was issued and an inference is that grid should be applied to the Voirol 1875 geogCS.  Common practice assumes that the current Tunisian geodetic datum of Carthage applies.,,EPSG,1998-11-11 00:00:00,,1,0
+22332,Carthage / UTM zone 32N,1489,projected,4400,,4223,16032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+22391,Carthage / Nord Tunisie,1619,projected,4499,,4223,18181,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+22392,Carthage / Sud Tunisie,1620,projected,4499,,4223,18182,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+22523,Corrego Alegre / UTM zone 23S,1621,projected,4400,,4225,16123,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+22524,Corrego Alegre / UTM zone 24S,1622,projected,4400,,4225,16124,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+22700,Deir ez Zor / Levant Zone,1623,projected,4499,,4227,19940,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Deir ez Zor / Syria Lambert (EPSG code 22770) from 1973.,,EPSG,1999-04-22 00:00:00,,1,0
+22770,Deir ez Zor / Syria Lambert,1623,projected,4499,,4227,19948,,,Large and medium scale topographic mapping and engineering survey.,Supersedes Deir ez Zor / Levant zone (EPSG code 22700) from 1973.,,EPSG,1999-10-20 00:00:00,,1,0
+22780,Deir ez Zor / Levant Stereographic,1623,projected,4499,,4227,19949,,,Used  prior to World War II for cadastral and large scale topographic mapping.,,,EPSG,2000-10-19 00:00:00,,1,0
+22832,Douala / UTM zone 32N,1060,projected,4400,,4228,16032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,1
+22991,Egypt 1907 / Blue Belt,1642,projected,4400,,4229,18071,,,Military topographic mapping.  Oil industry usually uses Egypt 1907 / Red Belt rather than this projected CRS.,Also known as Egypt 1907 / Green Belt.,,EPSG,2002-07-16 00:00:00,2002.49,1,0
+22992,Egypt 1907 / Red Belt,1643,projected,4400,,4229,18072,,,Large and medium scale topographic mapping and engineering survey.,See also Egypt 1907 / Blue Belt for non oil industry usage in Sinai peninsula.,,EPSG,1995-06-02 00:00:00,,1,0
+22993,Egypt 1907 / Purple Belt,1644,projected,4400,,4229,18073,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+22994,Egypt 1907 / Extended Purple Belt,1645,projected,4400,,4229,18074,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23028,ED50 / UTM zone 28N,1631,projected,4400,,4230,16028,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23029,ED50 / UTM zone 29N,1632,projected,4400,,4230,16029,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23030,ED50 / UTM zone 30N,1633,projected,4400,,4230,16030,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23031,ED50 / UTM zone 31N,1634,projected,4400,,4230,16031,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23032,ED50 / UTM zone 32N,1635,projected,4400,,4230,16032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23033,ED50 / UTM zone 33N,1636,projected,4400,,4230,16033,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23034,ED50 / UTM zone 34N,1637,projected,4400,,4230,16034,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23035,ED50 / UTM zone 35N,1638,projected,4400,,4230,16035,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23036,ED50 / UTM zone 36N,1639,projected,4400,,4230,16036,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23037,ED50 / UTM zone 37N,1640,projected,4400,,4230,16037,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23038,ED50 / UTM zone 38N,1641,projected,4400,,4230,16038,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23090,ED50 / TM 0 N,1629,projected,4400,,4230,16400,,,Used by Shell UK for UKCS North Sea oil exploration and production.,,Shell UK,EPSG,1998-11-11 00:00:00,,1,0
+23095,ED50 / TM 5 NE,1630,projected,4400,,4230,16405,,,Used by NAM for Dutch Sector of the North Sea oil exploration and production.,,NAM,EPSG,1998-11-11 00:00:00,,1,0
+23239,Fahud / UTM zone 39N,1544,projected,4400,,4232,16039,,,Large and medium scale topographic mapping and engineering survey.,Since 1993 superseded by PSD93 / UTM zone 39N projCS (code 3439). Maximum differences to Fahud adjustment are 20 metres.,,EPSG,1995-06-02 00:00:00,,1,0
+23240,Fahud / UTM zone 40N,1545,projected,4400,,4232,16040,,,Large and medium scale topographic mapping and engineering survey.,Since 1993 superseded by PSD93 / UTM zone 40N projCS (code 3440). Maximum differences to Fahud adjustment are 20 metres.,,EPSG,1995-06-02 00:00:00,,1,0
+23433,Garoua / UTM zone 33N,1060,projected,4400,,4234,16033,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,1
+23700,HD72 / EOV,1119,projected,4498,,4237,19931,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1997-07-22 00:00:00,,1,0
+23846,ID74 / UTM zone 46N,1647,projected,4400,,4238,16046,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-08-08 00:00:00,95.193  95.20,1,0
+23847,ID74 / UTM zone 47N,1649,projected,4400,,4238,16047,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23848,ID74 / UTM zone 48N,1651,projected,4400,,4238,16048,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23849,ID74 / UTM zone 49N,1653,projected,4400,,4238,16049,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23850,ID74 / UTM zone 50N,1655,projected,4400,,4238,16050,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23851,ID74 / UTM zone 51N,1657,projected,4400,,4238,16051,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23852,ID74 / UTM zone 52N,1659,projected,4400,,4238,16052,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23853,ID74 / UTM zone 53N,1661,projected,4400,,4238,16053,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23886,ID74 / UTM zone 46S,1648,projected,4400,,4238,16146,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-08-08 00:00:00,95.193  95.20,1,0
+23887,ID74 / UTM zone 47S,1650,projected,4400,,4238,16147,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23888,ID74 / UTM zone 48S,1652,projected,4400,,4238,16148,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23889,ID74 / UTM zone 49S,1654,projected,4400,,4238,16149,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23890,ID74 / UTM zone 50S,1656,projected,4400,,4238,16150,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23891,ID74 / UTM zone 51S,1658,projected,4400,,4238,16151,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23892,ID74 / UTM zone 52S,1660,projected,4400,,4238,16152,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23893,ID74 / UTM zone 53S,1662,projected,4400,,4238,16153,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23894,ID74 / UTM zone 54S,1663,projected,4400,,4238,16154,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.193,1,0
+23946,Indian 1954 / UTM zone 46N,1664,projected,4400,,4239,16046,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1998-06-13 00:00:00,,1,0
+23947,Indian 1954 / UTM zone 47N,1665,projected,4400,,4239,16047,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+23948,Indian 1954 / UTM zone 48N,1666,projected,4400,,4239,16048,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24047,Indian 1975 / UTM zone 47N,1667,projected,4400,,4240,16047,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24048,Indian 1975 / UTM zone 48N,1666,projected,4400,,4240,16048,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24100,Jamaica 1875 / Jamaica (Old Grid),1128,projected,4403,,4241,19909,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by 24200 (JAD69 / Jamaica National Grid).,,EPSG,1995-06-02 00:00:00,,1,0
+24200,JAD69 / Jamaica National Grid,1128,projected,4400,,4242,19910,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Supersedes 24100 (JAD69 / Jamaica National Grid).,,EPSG,1995-06-02 00:00:00,,1,0
+24305,Kalianpur 1937 / UTM zone 45N,1674,projected,4400,,4144,16045,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24306,Kalianpur 1937 / UTM zone 46N,1675,projected,4400,,4144,16046,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24311,Kalianpur 1962 / UTM zone 41N,1687,projected,4400,,4145,16041,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24312,Kalianpur 1962 / UTM zone 42N,1688,projected,4400,,4145,16042,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24313,Kalianpur 1962 / UTM zone 43N,1689,projected,4400,,4145,16043,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24342,Kalianpur 1975 / UTM zone 42N,1679,projected,4400,,4146,16042,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24343,Kalianpur 1975 / UTM zone 43N,1680,projected,4400,,4146,16043,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24344,Kalianpur 1975 / UTM zone 44N,1681,projected,4400,,4146,16044,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24345,Kalianpur 1975 / UTM zone 45N,1682,projected,4400,,4146,16045,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24346,Kalianpur 1975 / UTM zone 46N,1683,projected,4400,,4146,16046,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24347,Kalianpur 1975 / UTM zone 47N,1684,projected,4400,,4146,16047,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,,1,0
+24370,Kalianpur 1880 / India zone 0,1668,projected,4408,,4243,18110,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24371,Kalianpur 1880 / India zone I,1669,projected,4408,,4243,18111,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24372,Kalianpur 1880 / India zone IIa,1670,projected,4408,,4243,18112,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24373,Kalianpur 1880 / India zone III,1672,projected,4408,,4243,18114,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24374,Kalianpur 1880 / India zone IV,1673,projected,4408,,4243,18116,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24375,Kalianpur 1937 / India zone IIb,1041,projected,4400,,4144,18238,,,Large and medium scale topographic mapping and engineering survey.,Used by Bangladesh since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and Benoit's 1895 British inch-metre ratio of 39.370115 rounded as Ind ft = 0.30479841m exactly.,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24376,Kalianpur 1962 / India zone I,1685,projected,4400,,4145,18236,,,Large and medium scale topographic mapping and engineering survey.,Used by Pakistan since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded by G.Bomford with slight error as Ind ft = 0.3048996m exactly.,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24377,Kalianpur 1962 / India zone IIa,1686,projected,4400,,4145,18237,,,Large and medium scale topographic mapping and engineering survey.,Used by Pakistan since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded by G.Bomford with slight error as Ind ft = 0.3048996m exactly.,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24378,Kalianpur 1975 / India zone I,1676,projected,4400,,4146,18231,,,Large and medium scale topographic mapping and engineering survey.,Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24379,Kalianpur 1975 / India zone IIa,1677,projected,4400,,4146,18232,,,Large and medium scale topographic mapping and engineering survey.,Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24380,Kalianpur 1975 / India zone IIb,1678,projected,4400,,4146,18235,,,Large and medium scale topographic mapping and engineering survey.,Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24381,Kalianpur 1975 / India zone III,1672,projected,4400,,4146,18233,,,Large and medium scale topographic mapping and engineering survey.,Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24382,Kalianpur 1880 / India zone IIb,1671,projected,4408,,4243,18113,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24383,Kalianpur 1975 / India zone IV,1673,projected,4400,,4146,18234,,,Large and medium scale topographic mapping and engineering survey.,Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.,,EPSG,1999-10-20 00:00:00,97.23,1,0
+24500,Kertau / Singapore Grid,1210,projected,4400,,4245,19920,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24547,Kertau / UTM zone 47N,1691,projected,4400,,4245,16047,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24548,Kertau / UTM zone 48N,1692,projected,4400,,4245,16048,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-07-21 00:00:00,95.192,1,0
+24571,Kertau / R.S.O. Malaya (ch),1690,projected,4401,,4245,19935,,,Large and medium scale topographic mapping and engineering survey.,Adopts metric conversion of 39.370113 inches per metre.,,EPSG,1999-10-20 00:00:00,97.231,1,0
+24600,KOC Lambert,1136,projected,4400,,4246,19906,,,"Oil industry exploration (but not production - see Ain el Abd / UTM zone 38N, code 20438).","Used by KOC for exploration but not engineering (see Ain el Abd / UTM zone 38N, code 24600).",,EPSG,1996-04-12 00:00:00,,1,0
+24718,La Canoa / UTM zone 18N,1693,projected,4400,,4247,16018,,,Large and medium scale topographic mapping and engineering survey.,Sometimes referred to as PSAD56 / UTM zone 18N.,,EPSG,1999-10-20 00:00:00,,1,0
+24719,La Canoa / UTM zone 19N,1694,projected,4400,,4247,16019,,,Large and medium scale topographic mapping and engineering survey.,Sometimes referred to as PSAD56 / UTM zone 19N.,,EPSG,1999-10-20 00:00:00,,1,0
+24720,La Canoa / UTM zone 20N,1695,projected,4400,,4247,16020,,,Large and medium scale topographic mapping and engineering survey.,Sometimes referred to as PSAD56 / UTM zone 20N.,,EPSG,1995-06-02 00:00:00,,1,0
+24818,PSAD56 / UTM zone 18N,1756,projected,4400,,4248,16018,,,Large and medium scale topographic mapping and engineering survey.,In Venezuela also known as La Canoa / UTM zone 18N.,,EPSG,1995-06-02 00:00:00,,1,0
+24819,PSAD56 / UTM zone 19N,1758,projected,4400,,4248,16019,,,Large and medium scale topographic mapping and engineering survey.,In Venezuela also known as La Canoa / UTM zone 19N.,,EPSG,1995-06-02 00:00:00,,1,0
+24820,PSAD56 / UTM zone 20N,1760,projected,4400,,4248,16020,,,Large and medium scale topographic mapping and engineering survey.,In Venezuela also known as La Canoa / UTM zone 20N.,,EPSG,1995-06-02 00:00:00,,1,0
+24821,PSAD56 / UTM zone 21N,1762,projected,4400,,4248,16021,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24877,PSAD56 / UTM zone 17S,1755,projected,4400,,4248,16117,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24878,PSAD56 / UTM zone 18S,1757,projected,4400,,4248,16118,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24879,PSAD56 / UTM zone 19S,1759,projected,4400,,4248,16119,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24880,PSAD56 / UTM zone 20S,1761,projected,4400,,4248,16120,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24882,PSAD56 / UTM zone 22S,1754,projected,4400,,4248,16122,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+24891,PSAD56 / Peru west zone,1753,projected,4499,,4248,18161,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24892,PSAD56 / Peru central zone,1752,projected,4499,,4248,18162,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+24893,PSAD56 / Peru east zone,1751,projected,4499,,4248,18163,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+25000,Leigon / Ghana Metre Grid,1104,projected,4400,,4250,19904,,,Large and medium scale topographic mapping and engineering survey.,Superseded Accra / Ghana National Grid (code 2136) in 1978.,,EPSG,1995-06-02 00:00:00,,1,0
+25231,Lome / UTM zone 31N,1232,projected,4400,,4252,16031,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+25391,Luzon 1911 / Philippines zone I,1698,projected,4499,,4253,18171,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+25392,Luzon 1911 / Philippines zone II,1699,projected,4499,,4253,18172,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+25393,Luzon 1911 / Philippines zone III,1700,projected,4499,,4253,18173,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+25394,Luzon 1911 / Philippines zone IV,1701,projected,4499,,4253,18174,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+25395,Luzon 1911 / Philippines zone V,1702,projected,4499,,4253,18175,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+25700,Makassar (Jakarta) / NEIEZ,1316,projected,4499,,4804,19905,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+25828,ETRS89 / UTM zone 28N,2122,projected,4400,,4258,16028,,,Large and medium scale topographic mapping and engineering survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25829,ETRS89 / UTM zone 29N,2123,projected,4400,,4258,16029,,,Large and medium scale topographic mapping and engineering survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25830,ETRS89 / UTM zone 30N,2124,projected,4400,,4258,16030,,,Large and medium scale topographic mapping and engineering survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25831,ETRS89 / UTM zone 31N,2125,projected,4400,,4258,16031,,,Large and medium scale topographic mapping and engineering survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25832,ETRS89 / UTM zone 32N,2126,projected,4400,,4258,16032,,,Large and medium scale topographic mapping and engineering survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25833,ETRS89 / UTM zone 33N,2127,projected,4400,,4258,16033,,,Large and medium scale topographic mapping and engineering survey.,Used for all state of Brandenburg including those areas west of 12 deg E.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25834,ETRS89 / UTM zone 34N,2128,projected,4400,,4258,16034,,,Large and medium scale topographic mapping and engineering survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25835,ETRS89 / UTM zone 35N,2129,projected,4400,,4258,16035,,,Large and medium scale topographic mapping and engineering survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25836,ETRS89 / UTM zone 36N,2130,projected,4400,,4258,16036,,,Large and medium scale topographic mapping and engineering survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25837,ETRS89 / UTM zone 37N,2131,projected,4400,,4258,16037,,,Large and medium scale topographic mapping and engineering survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25838,ETRS89 / UTM zone 38N,2132,projected,4400,,4258,16038,,,Large and medium scale topographic mapping and engineering survey.,The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used as synonyms.,,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25884,ETRS89 / TM Baltic93,1646,projected,4530,,4258,19939,,,Large and medium scale topographic mapping and engineering survey.,Used as a common coordinate system for the Baltic states and for medium and small scale mapping in Estonia since 1993.,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,2000-10-19 00:00:00,99.11 2000.72,1,0
+25932,Malongo 1987 / UTM zone 32S,1317,projected,4400,,4259,16132,,,Oil exploration,,,EPSG,1995-06-02 00:00:00,,1,0
+26191,Merchich / Nord Maroc,1703,projected,4499,,4261,18131,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26192,Merchich / Sud Maroc,1704,projected,4499,,4261,18132,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26193,Merchich / Sahara,1705,projected,4499,,4261,18133,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26237,Massawa / UTM zone 37N,1089,projected,4400,,4262,16037,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26331,Minna / UTM zone 31N,1716,projected,4400,,4263,16031,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26332,Minna / UTM zone 32N,1717,projected,4400,,4263,16032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26391,Minna / Nigeria West Belt,1715,projected,4400,,4263,18151,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26392,Minna / Nigeria Mid Belt,1714,projected,4400,,4263,18152,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26393,Minna / Nigeria East Belt,1713,projected,4400,,4263,18153,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26432,Mhast / UTM zone 32S,1318,projected,4400,,4264,16132,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26591,Monte Mario (Rome) / Italy zone 1,1718,projected,4499,,4806,18121,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26592,Monte Mario (Rome) / Italy zone 2,1719,projected,4499,,4806,18122,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26632,M'poraloko / UTM zone 32N,1696,projected,4400,,4266,16032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26692,M'poraloko / UTM zone 32S,1697,projected,4400,,4266,16132,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26703,NAD27 / UTM zone 3N,2133,projected,4400,,4267,16003,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26704,NAD27 / UTM zone 4N,2134,projected,4400,,4267,16004,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26705,NAD27 / UTM zone 5N,2135,projected,4400,,4267,16005,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26706,NAD27 / UTM zone 6N,2136,projected,4400,,4267,16006,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26707,NAD27 / UTM zone 7N,2137,projected,4400,,4267,16007,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26708,NAD27 / UTM zone 8N,2138,projected,4400,,4267,16008,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26709,NAD27 / UTM zone 9N,2139,projected,4400,,4267,16009,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26710,NAD27 / UTM zone 10N,2140,projected,4400,,4267,16010,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26711,NAD27 / UTM zone 11N,2141,projected,4400,,4267,16011,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26712,NAD27 / UTM zone 12N,2142,projected,4400,,4267,16012,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26713,NAD27 / UTM zone 13N,2143,projected,4400,,4267,16013,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26714,NAD27 / UTM zone 14N,2144,projected,4400,,4267,16014,,,Large and medium scale topographic mapping and engineering survey.,See NAD27 / BLM 14N (feet) (code 32064) for non-metric equivalent used in US Gulf of Mexico.,,EPSG,1995-06-02 00:00:00,,1,0
+26715,NAD27 / UTM zone 15N,2145,projected,4400,,4267,16015,,,Large and medium scale topographic mapping and engineering survey.,In Ontario superseded by NAD27(76) / UTM zone 15N (code 2027). See NAD27 / BLM 15N (feet) (code 32065) for non-metric equivalent used in US Gulf of Mexico.,,EPSG,1995-06-02 00:00:00,,1,0
+26716,NAD27 / UTM zone 16N,2146,projected,4400,,4267,16016,,,Large and medium scale topographic mapping and engineering survey.,In Ontario superseded by NAD27(76) / UTM zone 16N (code 2028). See NAD27 / BLM 16N (feet) (code 32066) for non-metric equivalent used in US Gulf of Mexico.,,EPSG,1995-06-02 00:00:00,,1,0
+26717,NAD27 / UTM zone 17N,2147,projected,4400,,4267,16017,,,Large and medium scale topographic mapping and engineering survey.,In Ontario superseded by NAD27(76) / UTM zone 17N (code 2029).  In Quebec superseded by NAD27(CGQ77) / UTM zone 17N (code 2031). See NAD27 / BLM 17N (feet) (code 32067) for non-metric equivalent used in US Gulf of Mexico.,,EPSG,1995-06-02 00:00:00,,1,0
+26718,NAD27 / UTM zone 18N,2148,projected,4400,,4267,16018,,,Large and medium scale topographic mapping and engineering survey.,In Ontario superseded by NAD27(76) / UTM zone 18N (code 2030).  In Quebec superseded by NAD27(CGQ77) / UTM zone 18N (code 2032).,,EPSG,1995-06-02 00:00:00,,1,0
+26719,NAD27 / UTM zone 19N,2149,projected,4400,,4267,16019,,,Large and medium scale topographic mapping and engineering survey.,In Quebec superseded by NAD27(CGQ77) / UTM zone 19N (code 2033).,,EPSG,1995-06-02 00:00:00,,1,0
+26720,NAD27 / UTM zone 20N,2150,projected,4400,,4267,16020,,,Large and medium scale topographic mapping and engineering survey.,In Quebec superseded by NAD27(CGQ77) / UTM zone 20N (code 2034).,,EPSG,1995-06-02 00:00:00,,1,0
+26721,NAD27 / UTM zone 21N,2151,projected,4400,,4267,16021,,,Large and medium scale topographic mapping and engineering survey.,In Quebec superseded by NAD27(CGQ77) / UTM zone 21N (code 2035).,,EPSG,1995-06-02 00:00:00,,1,0
+26722,NAD27 / UTM zone 22N,2152,projected,4400,,4267,16022,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26729,NAD27 / Alabama East,2154,projected,4497,,4267,10101,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26730,NAD27 / Alabama West,2155,projected,4497,,4267,10102,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26731,NAD27 / Alaska zone 1,2156,projected,4497,,4267,15001,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26732,NAD27 / Alaska zone 2,2158,projected,4497,,4267,15002,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26733,NAD27 / Alaska zone 3,2159,projected,4497,,4267,15003,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26734,NAD27 / Alaska zone 4,2160,projected,4497,,4267,15004,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26735,NAD27 / Alaska zone 5,2161,projected,4497,,4267,15005,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26736,NAD27 / Alaska zone 6,2162,projected,4497,,4267,15006,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26737,NAD27 / Alaska zone 7,2163,projected,4497,,4267,15007,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26738,NAD27 / Alaska zone 8,2164,projected,4497,,4267,15008,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26739,NAD27 / Alaska zone 9,2165,projected,4497,,4267,15009,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26740,NAD27 / Alaska zone 10,2157,projected,4497,,4267,15010,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26741,NAD27 / California zone I,2175,projected,4497,,4267,10401,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26742,NAD27 / California zone II,2176,projected,4497,,4267,10402,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26743,NAD27 / California zone III,2177,projected,4497,,4267,10403,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26744,NAD27 / California zone IV,2178,projected,4497,,4267,10404,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26745,NAD27 / California zone V,2179,projected,4497,,4267,10405,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26746,NAD27 / California zone VI,2180,projected,4497,,4267,10406,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26747,NAD27 / California zone VII,2181,projected,4497,,4267,10407,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26748,NAD27 / Arizona East,2167,projected,4497,,4267,10201,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,95.25  2000.091,1,0
+26749,NAD27 / Arizona Central,2166,projected,4497,,4267,10202,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-08-22 00:00:00,95.25,1,0
+26750,NAD27 / Arizona West,2168,projected,4497,,4267,10203,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,95.25  2000.091,1,0
+26751,NAD27 / Arkansas North,2169,projected,4497,,4267,10301,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26752,NAD27 / Arkansas South,2170,projected,4497,,4267,10302,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26753,NAD27 / Colorado North,2184,projected,4497,,4267,10501,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26754,NAD27 / Colorado Central,2183,projected,4497,,4267,10502,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26755,NAD27 / Colorado South,2185,projected,4497,,4267,10503,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26756,NAD27 / Connecticut,1377,projected,4497,,4267,10600,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26757,NAD27 / Delaware,1378,projected,4497,,4267,10700,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26758,NAD27 / Florida East,2186,projected,4497,,4267,10901,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26759,NAD27 / Florida West,2188,projected,4497,,4267,10902,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26760,NAD27 / Florida North,2187,projected,4497,,4267,10903,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26766,NAD27 / Georgia East,2189,projected,4497,,4267,11001,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26767,NAD27 / Georgia West,2190,projected,4497,,4267,11002,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26768,NAD27 / Idaho East,2192,projected,4497,,4267,11101,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26769,NAD27 / Idaho Central,2191,projected,4497,,4267,11102,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26770,NAD27 / Idaho West,2193,projected,4497,,4267,11103,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26771,NAD27 / Illinois East,2194,projected,4497,,4267,11201,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26772,NAD27 / Illinois West,2195,projected,4497,,4267,11202,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26773,NAD27 / Indiana East,2196,projected,4497,,4267,11301,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26774,NAD27 / Indiana West,2197,projected,4497,,4267,11302,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26775,NAD27 / Iowa North,2198,projected,4497,,4267,11401,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26776,NAD27 / Iowa South,2199,projected,4497,,4267,11402,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26777,NAD27 / Kansas North,2200,projected,4497,,4267,11501,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26778,NAD27 / Kansas South,2201,projected,4497,,4267,11502,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26779,NAD27 / Kentucky North,2202,projected,4497,,4267,11601,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26780,NAD27 / Kentucky South,2203,projected,4497,,4267,11602,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26781,NAD27 / Louisiana North,2204,projected,4497,,4267,11701,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26782,NAD27 / Louisiana South,2205,projected,4497,,4267,11702,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26783,NAD27 / Maine East,2206,projected,4497,,4267,11801,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26784,NAD27 / Maine West,2207,projected,4497,,4267,11802,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26785,NAD27 / Maryland,1389,projected,4497,,4267,11900,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26786,NAD27 / Massachusetts Mainland,2209,projected,4497,,4267,12001,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26787,NAD27 / Massachusetts Island,2208,projected,4497,,4267,12002,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26791,NAD27 / Minnesota North,2214,projected,4497,,4267,12201,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26792,NAD27 / Minnesota Central,2213,projected,4497,,4267,12202,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26793,NAD27 / Minnesota South,2215,projected,4497,,4267,12203,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26794,NAD27 / Mississippi East,2216,projected,4497,,4267,12301,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26795,NAD27 / Mississippi West,2217,projected,4497,,4267,12302,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26796,NAD27 / Missouri East,2219,projected,4497,,4267,12401,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26797,NAD27 / Missouri Central,2218,projected,4497,,4267,12402,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26798,NAD27 / Missouri West,2220,projected,4497,,4267,12403,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26801,NAD Michigan / Michigan East,1720,projected,4497,,4268,12101,,,Large and medium scale topographic mapping and engineering survey.,Superseded by 26811 26812 and 26813.,,EPSG,1998-11-11 00:00:00,95.25  97.19  98.22  2000.091,1,0
+26802,NAD Michigan / Michigan Old Central,1721,projected,4497,,4268,12102,,,Large and medium scale topographic mapping and engineering survey.,Superseded by 26811 26812 and 26813.,,EPSG,1998-11-11 00:00:00,95.25  97.19  98.22,1,0
+26803,NAD Michigan / Michigan West,1722,projected,4497,,4268,12103,,,Large and medium scale topographic mapping and engineering survey.,Superseded by 26811 26812 and 26813.,,EPSG,1998-11-11 00:00:00,95.25  97.19  98.22  2000.091,1,0
+26811,NAD Michigan / Michigan North,1723,projected,4497,,4268,12111,,,Large and medium scale topographic mapping and engineering survey.,Supersedes 26801 26802 and 26803.,,EPSG,1998-11-11 00:00:00,96.28  98.22,1,0
+26812,NAD Michigan / Michigan Central,1724,projected,4497,,4268,12112,,,Large and medium scale topographic mapping and engineering survey.,Supersedes 26801 26802 and 26803.,,EPSG,1998-11-11 00:00:00,96.28  97.19  98.22,1,0
+26813,NAD Michigan / Michigan South,1725,projected,4497,,4268,12113,,,Large and medium scale topographic mapping and engineering survey.,Supersedes 26801 26802 and 26803.,,EPSG,1998-11-11 00:00:00,96.28  97.19  98.22,1,0
+26903,NAD83 / UTM zone 3N,2133,projected,4400,,4269,16003,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26904,NAD83 / UTM zone 4N,2134,projected,4400,,4269,16004,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26905,NAD83 / UTM zone 5N,2135,projected,4400,,4269,16005,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26906,NAD83 / UTM zone 6N,2136,projected,4400,,4269,16006,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26907,NAD83 / UTM zone 7N,2137,projected,4400,,4269,16007,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26908,NAD83 / UTM zone 8N,2138,projected,4400,,4269,16008,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26909,NAD83 / UTM zone 9N,2139,projected,4400,,4269,16009,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26910,NAD83 / UTM zone 10N,2140,projected,4400,,4269,16010,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26911,NAD83 / UTM zone 11N,2141,projected,4400,,4269,16011,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26912,NAD83 / UTM zone 12N,2142,projected,4400,,4269,16012,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26913,NAD83 / UTM zone 13N,2143,projected,4400,,4269,16013,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26914,NAD83 / UTM zone 14N,2144,projected,4400,,4269,16014,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26915,NAD83 / UTM zone 15N,2145,projected,4400,,4269,16015,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26916,NAD83 / UTM zone 16N,2146,projected,4400,,4269,16016,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26917,NAD83 / UTM zone 17N,2147,projected,4400,,4269,16017,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26918,NAD83 / UTM zone 18N,2148,projected,4400,,4269,16018,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26919,NAD83 / UTM zone 19N,2149,projected,4400,,4269,16019,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26920,NAD83 / UTM zone 20N,2150,projected,4400,,4269,16020,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26921,NAD83 / UTM zone 21N,2151,projected,4400,,4269,16021,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26922,NAD83 / UTM zone 22N,2152,projected,4400,,4269,16022,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26923,NAD83 / UTM zone 23N,2153,projected,4400,,4269,16023,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26929,NAD83 / Alabama East,2154,projected,4499,,4269,10131,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26930,NAD83 / Alabama West,2155,projected,4499,,4269,10132,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26931,NAD83 / Alaska zone 1,2156,projected,4499,,4269,15031,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26932,NAD83 / Alaska zone 2,2158,projected,4499,,4269,15032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26933,NAD83 / Alaska zone 3,2159,projected,4499,,4269,15033,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26934,NAD83 / Alaska zone 4,2160,projected,4499,,4269,15034,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26935,NAD83 / Alaska zone 5,2161,projected,4499,,4269,15035,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26936,NAD83 / Alaska zone 6,2162,projected,4499,,4269,15036,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26937,NAD83 / Alaska zone 7,2163,projected,4499,,4269,15037,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26938,NAD83 / Alaska zone 8,2164,projected,4499,,4269,15038,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26939,NAD83 / Alaska zone 9,2165,projected,4499,,4269,15039,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26940,NAD83 / Alaska zone 10,2157,projected,4499,,4269,15040,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+26941,NAD83 / California zone 1,2175,projected,4499,,4269,10431,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2225 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26942,NAD83 / California zone 2,2176,projected,4499,,4269,10432,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2226 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26943,NAD83 / California zone 3,2177,projected,4499,,4269,10433,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2227 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26944,NAD83 / California zone 4,2178,projected,4499,,4269,10434,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2228 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26945,NAD83 / California zone 5,2182,projected,4499,,4269,10435,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2229 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26946,NAD83 / California zone 6,2180,projected,4499,,4269,10436,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2230 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26948,NAD83 / Arizona East,2167,projected,4499,,4269,10231,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2222 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26949,NAD83 / Arizona Central,2166,projected,4499,,4269,10232,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2223 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26950,NAD83 / Arizona West,2168,projected,4499,,4269,10233,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2224 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26951,NAD83 / Arkansas North,2169,projected,4499,,4269,10331,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26952,NAD83 / Arkansas South,2170,projected,4499,,4269,10332,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26953,NAD83 / Colorado North,2184,projected,4499,,4269,10531,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2231 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26954,NAD83 / Colorado Central,2183,projected,4499,,4269,10532,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2232 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26955,NAD83 / Colorado South,2185,projected,4499,,4269,10533,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2233 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26956,NAD83 / Connecticut,1377,projected,4499,,4269,10630,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2234 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26957,NAD83 / Delaware,1378,projected,4499,,4269,10730,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2235 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26958,NAD83 / Florida East,2186,projected,4499,,4269,10931,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2236 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26959,NAD83 / Florida West,2188,projected,4499,,4269,10932,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2237 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26960,NAD83 / Florida North,2187,projected,4499,,4269,10933,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2238 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26961,NAD83 / Hawaii zone 1,1546,projected,4499,,4269,15131,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26962,NAD83 / Hawaii zone 2,1547,projected,4499,,4269,15132,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26963,NAD83 / Hawaii zone 3,1548,projected,4499,,4269,15133,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26964,NAD83 / Hawaii zone 4,1549,projected,4499,,4269,15134,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26965,NAD83 / Hawaii zone 5,1550,projected,4499,,4269,15135,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26966,NAD83 / Georgia East,2189,projected,4499,,4269,11031,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2239 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26967,NAD83 / Georgia West,2190,projected,4499,,4269,11032,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2240 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26968,NAD83 / Idaho East,2192,projected,4499,,4269,11131,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2241 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26969,NAD83 / Idaho Central,2191,projected,4499,,4269,11132,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2242 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26970,NAD83 / Idaho West,2193,projected,4499,,4269,11133,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2243 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26971,NAD83 / Illinois East,2194,projected,4499,,4269,11231,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26972,NAD83 / Illinois West,2195,projected,4499,,4269,11232,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26973,NAD83 / Indiana East,2196,projected,4499,,4269,11331,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2244 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26974,NAD83 / Indiana West,2197,projected,4499,,4269,11332,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2245 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26975,NAD83 / Iowa North,2198,projected,4499,,4269,11431,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26976,NAD83 / Iowa South,2199,projected,4499,,4269,11432,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26977,NAD83 / Kansas North,2200,projected,4499,,4269,11531,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26978,NAD83 / Kansas South,2201,projected,4499,,4269,11532,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26979,NAD83 / Kentucky North,2202,projected,4499,,4269,11631,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,1
+26980,NAD83 / Kentucky South,2203,projected,4499,,4269,11632,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2247 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26981,NAD83 / Louisiana North,2204,projected,4499,,4269,11731,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26982,NAD83 / Louisiana South,2529,projected,4499,,4269,11732,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26983,NAD83 / Maine East,2206,projected,4499,,4269,11831,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26984,NAD83 / Maine West,2207,projected,4499,,4269,11832,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26985,NAD83 / Maryland,1389,projected,4499,,4269,11930,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2248 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26986,NAD83 / Massachusetts Mainland,2209,projected,4499,,4269,12031,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2249 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26987,NAD83 / Massachusetts Island,2208,projected,4499,,4269,12032,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2250 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26988,NAD83 / Michigan North,1723,projected,4499,,4269,12141,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2251 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26989,NAD83 / Michigan Central,1724,projected,4499,,4269,12142,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2252 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26990,NAD83 / Michigan South,1725,projected,4499,,4269,12143,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2253 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26991,NAD83 / Minnesota North,2214,projected,4499,,4269,12231,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26992,NAD83 / Minnesota Central,2213,projected,4499,,4269,12232,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26993,NAD83 / Minnesota South,2215,projected,4499,,4269,12233,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26994,NAD83 / Mississippi East,2216,projected,4499,,4269,12331,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2254 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26995,NAD83 / Mississippi West,2217,projected,4499,,4269,12332,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2255 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26996,NAD83 / Missouri East,2219,projected,4499,,4269,12431,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+26997,NAD83 / Missouri Central,2218,projected,4499,,4269,12432,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+26998,NAD83 / Missouri West,2220,projected,4499,,4269,12433,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+27038,Nahrwan 1967 / UTM zone 38N,1739,projected,4400,,4270,16038,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-04-12 00:00:00,,1,0
+27039,Nahrwan 1967 / UTM zone 39N,1749,projected,4400,,4270,16039,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-04-12 00:00:00,96.12,1,0
+27040,Nahrwan 1967 / UTM zone 40N,1750,projected,4400,,4270,16040,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+27120,Naparima 1972 / UTM zone 20N,1322,projected,4400,,4271,16020,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.351,1,0
+27200,NZGD49 / New Zealand Map Grid,1175,projected,4400,,4272,19917,,,Large and medium scale topographic mapping and engineering survey.,Supersedes 27291 (NZGD49 / North Island Grid) and 27292 (NZGD49 / South Island Grid) from 1972.,,EPSG,2000-10-19 00:00:00,2000.702,1,0
+27205,NZGD49 / Mount Eden Circuit,1501,projected,4500,,4272,17901,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Mount Eden Circuit 2000 (code 2105) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27206,NZGD49 / Bay of Plenty Circuit,1500,projected,4500,,4272,17902,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Bay of Plenty Circuit 2000 (code 2106) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27207,NZGD49 / Poverty Bay Circuit,1500,projected,4500,,4272,17903,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Poverty Bay Circuit 2000 (code 2107) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27208,NZGD49 / Hawkes Bay Circuit,1500,projected,4500,,4272,17904,,,Cadastral survey.,Superseded Hawkes Bay 1931 datum with Imperial measure version of projection in 1972.  Superseded by NZGD2000 / Hawkes Bay Circuit 2000 (code 2108) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27209,NZGD49 / Taranaki Circuit,1500,projected,4500,,4272,17905,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Taranaki Circuit 2000 (code 2109) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27210,NZGD49 / Tuhirangi Circuit,1500,projected,4500,,4272,17906,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Tuhirangi Circuit 2000 (code 2110) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27211,NZGD49 / Wanganui Circuit,1500,projected,4500,,4272,17907,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Wanganui Circuit 2000 (code 2111) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27212,NZGD49 / Wairarapa Circuit,1500,projected,4500,,4272,17908,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Wairarapa Circuit 2000 (code 2112) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27213,NZGD49 / Wellington Circuit,1500,projected,4500,,4272,17909,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Wellington Circuit 2000 (code 2113) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27214,NZGD49 / Collingwood Circuit,1501,projected,4500,,4272,17910,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Collingwood Circuit 2000 (code 2114) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27215,NZGD49 / Nelson Circuit,1501,projected,4500,,4272,17911,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Nelson Circuit 2000 (code 2115) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27216,NZGD49 / Karamea Circuit,1501,projected,4500,,4272,17912,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Karamea Circuit 2000 (code 2116) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27217,NZGD49 / Buller Circuit,1501,projected,4500,,4272,17913,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Buller Circuit 2000 (code 2117) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27218,NZGD49 / Grey Circuit,1501,projected,4500,,4272,17914,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Grey Circuit 2000 (code 2118) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27219,NZGD49 / Amuri Circuit,1501,projected,4500,,4272,17915,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Amuri Circuit 2000 (code 2119) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27220,NZGD49 / Marlborough Circuit,1501,projected,4500,,4272,17916,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Marlborough Circuit 2000 (code 2120) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27221,NZGD49 / Hokitika Circuit,1501,projected,4500,,4272,17917,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Hokitika Circuit 2000 (code 2121) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27222,NZGD49 / Okarito Circuit,1501,projected,4500,,4272,17918,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Okarito Circuit 2000 (code 2122) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27223,NZGD49 / Jacksons Bay Circuit,1501,projected,4500,,4272,17919,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Jacksons Bay Circuit 2000 (code 2123) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27224,NZGD49 / Mount Pleasant Circuit,1501,projected,4500,,4272,17920,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Mount Pleasant Circuit 2000 (code 2124) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27225,NZGD49 / Gawler Circuit,1501,projected,4500,,4272,17921,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Gawler Circuit 2000 (code 2125) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27226,NZGD49 / Timaru Circuit,1501,projected,4500,,4272,17922,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Timaru Circuit 2000 (code 2126) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27227,NZGD49 / Lindis Peak Circuit,1501,projected,4500,,4272,17923,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Lindis Peak Circuit 2000 (code 2127) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27228,NZGD49 / Mount Nicholas Circuit,1501,projected,4500,,4272,17924,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Mount Nicholas Circuit 2000 (code 2128) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27229,NZGD49 / Mount York Circuit,1501,projected,4500,,4272,17925,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Mount York Circuit 2000 (code 2129) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27230,NZGD49 / Observation Point Circuit,1501,projected,4500,,4272,17926,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Observation Point Circuit 2000 (code 2130) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27231,NZGD49 / North Taieri Circuit,1501,projected,4500,,4272,17927,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / North Taieri Circuit 2000 (code 2131) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27232,NZGD49 / Bluff Circuit,1501,projected,4500,,4272,17928,,,Cadastral survey.,Superseded Imperial measure version in 1972.  Superseded by NZGD2000 / Bluff Circuit 2000 (code 2132) from March 2000.,Land Information New Zealand OSG Technical Report 8; 16 April 1999.,EPSG,2000-10-19 00:00:00,,1,0
+27258,NZGD49 / UTM zone 58S,1502,projected,4400,,4272,16158,,,Oil exploration.,Superseded by NZGD2000 / UTM zone 58S (code 2133) from March 2000.,,EPSG,2000-10-19 00:00:00,,1,0
+27259,NZGD49 / UTM zone 59S,1503,projected,4400,,4272,16159,,,Oil exploration.,Superseded by NZGD2000 / UTM zone 59S (code 2134) from March 2000.,,EPSG,2000-10-19 00:00:00,,1,0
+27260,NZGD49 / UTM zone 60S,1504,projected,4400,,4272,16160,,,Oil exploration.,Superseded by NZGD2000 / UTM zone 60S (code 2135) from March 2000.,,EPSG,2000-10-19 00:00:00,,1,0
+27291,NZGD49 / North Island Grid,1500,projected,4409,,4272,18141,,,Large and medium scale topographic mapping and engineering survey.,Sears 1922 British foot-metre conversion factor applied to ellipsoid.  Superseded by 27200 (GD49 / New Zealand Map Grid) in 1972.,,EPSG,2000-10-19 00:00:00,97.231 2000.702,1,0
+27292,NZGD49 / South Island Grid,1501,projected,4409,,4272,18142,,,Large and medium scale topographic mapping and engineering survey.,Sears 1922 British foot-metre conversion factor applied to ellipsoid.  Superseded by 27200 (GD49 / New Zealand Map Grid) in 1972.,,EPSG,2000-10-19 00:00:00,97.231 2000.702,1,0
+27391,NGO 1948 (Oslo) / NGO zone I,1741,projected,4531,,4817,18221,,,Large (>1:50000) scale mapping and cadastral work.,To be phased out and replaced by ETRF89 / UTM zone 32N.,,EPSG,1999-10-20 00:00:00,,1,0
+27392,NGO 1948 (Oslo) / NGO zone II,1742,projected,4531,,4817,18222,,,Large (>1:50000) scale mapping and cadastral work.,To be phased out and replaced by ETRF89 / UTM zone 32N.,,EPSG,1999-10-20 00:00:00,,1,0
+27393,NGO 1948 (Oslo) / NGO zone III,1743,projected,4531,,4817,18223,,,Large (>1:50000) scale mapping and cadastral work.,To be phased out and replaced by ETRF89 / UTM zone 32N.,,EPSG,1999-10-20 00:00:00,,1,0
+27394,NGO 1948 (Oslo) / NGO zone IV,1744,projected,4531,,4817,18224,,,Large (>1:50000) scale mapping and cadastral work.,To be phased out and replaced by ETRF89 / UTM zone 32N and ETRF89 / UTM zone 33N.,,EPSG,1999-10-20 00:00:00,,1,0
+27395,NGO 1948 (Oslo) / NGO zone V,1745,projected,4531,,4817,18225,,,Large (>1:50000) scale mapping and cadastral work.,To be phased out and replaced by ETRF89 / UTM zone 33N and ETRF89 / UTM zone 34N.,,EPSG,1999-10-20 00:00:00,,1,0
+27396,NGO 1948 (Oslo) / NGO zone VI,1746,projected,4531,,4817,18226,,,Large (>1:50000) scale mapping and cadastral work.,To be phased out and replaced by ETRF89 / UTM zone 34N.,,EPSG,1999-10-20 00:00:00,,1,0
+27397,NGO 1948 (Oslo) / NGO zone VII,1747,projected,4531,,4817,18227,,,Large (>1:50000) scale mapping and cadastral work.,To be phased out and replaced by ETRF89 / UTM zone 34N and ETRF89 / UTM zone 35N.,,EPSG,1999-10-20 00:00:00,,1,0
+27398,NGO 1948 (Oslo) / NGO zone VIII,1748,projected,4531,,4817,18228,,,Large (>1:50000) scale mapping and cadastral work.,To be phased out and replaced by ETRF89 / UTM zone 35N.,,EPSG,1999-10-20 00:00:00,,1,0
+27429,Datum 73 / UTM zone 29N,1294,projected,4400,,4274,16029,,,Large and medium scale topographic mapping and engineering survey.,,Instituto Geografico e Cadastral; Lisbon,EPSG,1995-06-02 00:00:00,,1,0
+27492,Datum 73 / Modified Portuguese Grid,1294,projected,4530,,4274,19974,,,Large and medium scale topographic mapping and engineering survey.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+27500,ATF (Paris) / Nord de Guerre,1369,projected,4499,,4901,19903,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+27561,NTF (Paris) / Lambert Nord France,1731,projected,4499,,4807,18091,,,Large and medium scale topographic mapping and engineering survey.,Superseded by NTF (Paris) / France zone I (code 27571) from 1972.,,EPSG,2001-11-06 00:00:00,,1,0
+27562,NTF (Paris) / Lambert Centre France,1732,projected,4499,,4807,18092,,,Large and medium scale topographic mapping and engineering survey.,Superseded by NTF (Paris) / France zone II (code 27572) from 1972.,,EPSG,2001-11-06 00:00:00,,1,0
+27563,NTF (Paris) / Lambert Sud France,1733,projected,4499,,4807,18093,,,Large and medium scale topographic mapping and engineering survey.,Superseded by NTF (Paris) / France zone III (code 27573) from 1972.,,EPSG,2001-11-06 00:00:00,,1,0
+27564,NTF (Paris) / Lambert Corse,1327,projected,4499,,4807,18094,,,Large and medium scale topographic mapping and engineering survey.,Superseded by NTF (Paris) / France zone IV (code 27574) from 1972.,,EPSG,2001-11-06 00:00:00,,1,0
+27571,NTF (Paris) / Lambert zone I,1731,projected,4499,,4807,18081,,,Large and medium scale topographic mapping and engineering survey.,Introduced 1972. Supersedes NTF (Paris) / Lambert Nord France (code 27561).,,EPSG,2001-11-06 00:00:00,,1,0
+27572,NTF (Paris) / Lambert zone II,1734,projected,4499,,4807,18082,,,Large and medium scale topographic mapping and engineering survey.,Introduced 1972. Supersedes NTF (Paris) / Lambert Centre France (code 27562).,,EPSG,2001-11-06 00:00:00,,1,0
+27573,NTF (Paris) / Lambert zone III,1733,projected,4499,,4807,18083,,,Large and medium scale topographic mapping and engineering survey.,Introduced 1972. Supersedes NTF (Paris) / Lambert Sud France (code 27563).,,EPSG,2001-11-06 00:00:00,,1,0
+27574,NTF (Paris) / Lambert zone IV,1327,projected,4499,,4807,18084,,,Large and medium scale topographic mapping and engineering survey.,Introduced 1972. Supersedes NTF (Paris) / Lambert Corse (code 27564).,,EPSG,2001-11-06 00:00:00,,1,0
+27581,NTF (Paris) / France I,1731,projected,4499,,4807,18081,,,Large and medium scale topographic mapping and engineering survey.,Introduced 1972. Supersedes NTF / Nord France (code 27591).,,EPSG,1996-04-12 00:00:00,95.26,1,1
+27582,NTF (Paris) / France II,1734,projected,4499,,4807,18082,,,Large and medium scale topographic mapping and engineering survey.,Introduced 1972. Supersedes NTF / Centre France (code 27592).,,EPSG,1996-04-12 00:00:00,95.26,1,1
+27583,NTF (Paris) / France III,1733,projected,4499,,4807,18083,,,Large and medium scale topographic mapping and engineering survey.,Introduced 1972. Supersedes NTF / Sud France (code 27593).,,EPSG,1996-04-12 00:00:00,95.26,1,1
+27584,NTF (Paris) / France IV,1327,projected,4499,,4807,18084,,,Large and medium scale topographic mapping and engineering survey.,Introduced 1972. Supersedes NTF / Corse (code 27594).,,EPSG,1996-04-12 00:00:00,,1,1
+27591,NTF (Paris) / Nord France,1731,projected,4499,,4807,18091,,,Large and medium scale topographic mapping and engineering survey.,Superseded by NTF / France I (code 27581) from 1972.,,EPSG,1996-04-12 00:00:00,95.26,1,1
+27592,NTF (Paris) / Centre France,1732,projected,4499,,4807,18092,,,Large and medium scale topographic mapping and engineering survey.,Superseded by NTF / France II (code 27582) from 1972.,,EPSG,1996-04-12 00:00:00,95.26,1,1
+27593,NTF (Paris) / Sud France,1733,projected,4499,,4807,18093,,,Large and medium scale topographic mapping and engineering survey.,Superseded by NTF / France III (code 27583) from 1972.,,EPSG,1996-04-12 00:00:00,95.26,1,1
+27594,NTF (Paris) / Corse,1327,projected,4499,,4807,18094,,,Large and medium scale topographic mapping and engineering survey.,Superseded by NTF / France IV (code 27584) from 1972.,,EPSG,1996-04-12 00:00:00,,1,1
+27700,OSGB 1936 / British National Grid,1264,projected,4400,,4277,19916,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28191,Palestine 1923 / Palestine Grid,1356,projected,4400,,4281,18201,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+28192,Palestine 1923 / Palestine Belt,1356,projected,4400,,4281,18202,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-04-22 00:00:00,,1,0
+28193,Palestine 1923 / Israeli CS Grid,2603,projected,4400,,4281,18203,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Israeli TM Grid (EPSG code 2039).,Survey of Israel.,EPSG,2002-06-22 00:00:00,2002.34,1,0
+28232,Pointe Noire / UTM zone 32S,1072,projected,4400,,4282,16132,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,2002.05,1,0
+28348,GDA94 / MGA zone 48,1556,projected,4400,,4283,17348,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28349,GDA94 / MGA zone 49,1557,projected,4400,,4283,17349,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28350,GDA94 / MGA zone 50,1558,projected,4400,,4283,17350,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28351,GDA94 / MGA zone 51,1559,projected,4400,,4283,17351,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28352,GDA94 / MGA zone 52,1560,projected,4400,,4283,17352,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28353,GDA94 / MGA zone 53,1561,projected,4400,,4283,17353,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28354,GDA94 / MGA zone 54,1562,projected,4400,,4283,17354,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28355,GDA94 / MGA zone 55,1563,projected,4400,,4283,17355,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28356,GDA94 / MGA zone 56,1564,projected,4400,,4283,17356,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28357,GDA94 / MGA zone 57,1565,projected,4400,,4283,17357,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28358,GDA94 / MGA zone 58,1566,projected,4400,,4283,17358,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+28402,Pulkovo 1942 / Gauss-Kruger zone 2,1805,projected,4530,,4284,16202,,,Military mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 9E (code 2492).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28403,Pulkovo 1942 / Gauss-Kruger zone 3,1792,projected,4530,,4284,16203,,,Military mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 15E (code 2493).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28404,Pulkovo 1942 / Gauss-Kruger zone 4,1793,projected,4530,,4284,16204,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 21E (code 2494).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28405,Pulkovo 1942 / Gauss-Kruger zone 5,1794,projected,4530,,4284,16205,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 27E (code 2495).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28406,Pulkovo 1942 / Gauss-Kruger zone 6,1795,projected,4530,,4284,16206,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 33E (code 2496).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28407,Pulkovo 1942 / Gauss-Kruger zone 7,1796,projected,4530,,4284,16207,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 39E (code 2497).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28408,Pulkovo 1942 / Gauss-Kruger zone 8,1797,projected,4530,,4284,16208,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 45E (code 2498).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28409,Pulkovo 1942 / Gauss-Kruger zone 9,1798,projected,4530,,4284,16209,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 51E (code 2499).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28410,Pulkovo 1942 / Gauss-Kruger zone 10,1799,projected,4530,,4284,16210,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 57E (code 2500).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28411,Pulkovo 1942 / Gauss-Kruger zone 11,1800,projected,4530,,4284,16211,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 63E (code 2501).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28412,Pulkovo 1942 / Gauss-Kruger zone 12,1801,projected,4530,,4284,16212,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 69E (code 2502).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28413,Pulkovo 1942 / Gauss-Kruger zone 13,1802,projected,4530,,4284,16213,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 75E (code 2503).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28414,Pulkovo 1942 / Gauss-Kruger zone 14,1803,projected,4530,,4284,16214,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 81E (code 2504).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28415,Pulkovo 1942 / Gauss-Kruger zone 15,1804,projected,4530,,4284,16215,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 87E (code 2505).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28416,Pulkovo 1942 / Gauss-Kruger zone 16,1775,projected,4530,,4284,16216,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 93E (code 2506).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28417,Pulkovo 1942 / Gauss-Kruger zone 17,1776,projected,4530,,4284,16217,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 99E (code 2507).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28418,Pulkovo 1942 / Gauss-Kruger zone 18,1777,projected,4530,,4284,16218,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 105E (code 2508).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28419,Pulkovo 1942 / Gauss-Kruger zone 19,1778,projected,4530,,4284,16219,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 111E (code 2509).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28420,Pulkovo 1942 / Gauss-Kruger zone 20,1779,projected,4530,,4284,16220,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 117E (code 2510).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28421,Pulkovo 1942 / Gauss-Kruger zone 21,1780,projected,4530,,4284,16221,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 123E (code 2511).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28422,Pulkovo 1942 / Gauss-Kruger zone 22,1781,projected,4530,,4284,16222,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 129E (code 2512).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28423,Pulkovo 1942 / Gauss-Kruger zone 23,1782,projected,4530,,4284,16223,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 135E (code 2513).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28424,Pulkovo 1942 / Gauss-Kruger zone 24,1783,projected,4530,,4284,16224,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 141E (code 2514).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28425,Pulkovo 1942 / Gauss-Kruger zone 25,1784,projected,4530,,4284,16225,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 147E (code 2515).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28426,Pulkovo 1942 / Gauss-Kruger zone 26,1785,projected,4530,,4284,16226,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 153E (code 2516).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28427,Pulkovo 1942 / Gauss-Kruger zone 27,1786,projected,4530,,4284,16227,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 159E (code 2517).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28428,Pulkovo 1942 / Gauss-Kruger zone 28,1787,projected,4530,,4284,16228,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 165E (code 2518).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28429,Pulkovo 1942 / Gauss-Kruger zone 29,1788,projected,4530,,4284,16229,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 171E (code 2519).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28430,Pulkovo 1942 / Gauss-Kruger zone 30,1789,projected,4530,,4284,16230,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 177E (code 2520).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28431,Pulkovo 1942 / Gauss-Kruger zone 31,1790,projected,4530,,4284,16231,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 177W (code 2521).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28432,Pulkovo 1942 / Gauss-Kruger zone 32,1791,projected,4530,,4284,16232,,,Medium scale topographic mapping.,Also found with truncated fase easting - see Pulkovo 1942 / Gauss-Kruger CM 171W (code 2522).,EPSG,EPSG,2002-06-22 00:00:00,2002.36,1,0
+28462,Pulkovo 1942 / Gauss-Kruger 2N,1805,projected,4530,,4284,16302,,,Truncated form of Gauss-Kruger zone 2,,,EPSG,1998-06-30 00:00:00,,1,1
+28463,Pulkovo 1942 / Gauss-Kruger 3N,1792,projected,4530,,4284,16303,,,Military mapping.,Truncated form of Gauss-Kruger zone 3,,EPSG,1998-06-30 00:00:00,,1,1
+28464,Pulkovo 1942 / Gauss-Kruger 4N,1793,projected,4530,,4284,16304,,,Military mapping.,,,EPSG,1995-06-02 00:00:00,,1,1
+28465,Pulkovo 1942 / Gauss-Kruger 5N,1794,projected,4530,,4284,16305,,,Truncated form of Gauss-Kruger zone 5,,,EPSG,1995-06-02 00:00:00,,1,1
+28466,Pulkovo 1942 / Gauss-Kruger 6N,1795,projected,4530,,4284,16306,,,Truncated form of Gauss-Kruger zone 6,,,EPSG,1995-06-02 00:00:00,,1,1
+28467,Pulkovo 1942 / Gauss-Kruger 7N,1796,projected,4530,,4284,16307,,,Truncated form of Gauss-Kruger zone 7,,,EPSG,1995-06-02 00:00:00,,1,1
+28468,Pulkovo 1942 / Gauss-Kruger 8N,1797,projected,4530,,4284,16308,,,Truncated form of Gauss-Kruger zone 8,,,EPSG,1995-06-02 00:00:00,,1,1
+28469,Pulkovo 1942 / Gauss-Kruger 9N,1798,projected,4530,,4284,16309,,,Truncated form of Gauss-Kruger zone 9,,,EPSG,1995-06-02 00:00:00,,1,1
+28470,Pulkovo 1942 / Gauss-Kruger 10N,1799,projected,4530,,4284,16310,,,Truncated form of Gauss-Kruger zone 10,,,EPSG,1995-06-02 00:00:00,,1,1
+28471,Pulkovo 1942 / Gauss-Kruger 11N,1800,projected,4530,,4284,16311,,,Truncated form of Gauss-Kruger zone 11,,,EPSG,1995-06-02 00:00:00,,1,1
+28472,Pulkovo 1942 / Gauss-Kruger 12N,1801,projected,4530,,4284,16312,,,Truncated form of Gauss-Kruger zone 12,,,EPSG,1995-06-02 00:00:00,,1,1
+28473,Pulkovo 1942 / Gauss-Kruger 13N,1802,projected,4530,,4284,16313,,,Truncated form of Gauss-Kruger zone 13,,,EPSG,1995-06-02 00:00:00,,1,1
+28474,Pulkovo 1942 / Gauss-Kruger 14N,1803,projected,4530,,4284,16314,,,Truncated form of Gauss-Kruger zone 14,,,EPSG,1995-06-02 00:00:00,,1,1
+28475,Pulkovo 1942 / Gauss-Kruger 15N,1804,projected,4530,,4284,16315,,,Truncated form of Gauss-Kruger zone 15,,,EPSG,1995-06-02 00:00:00,,1,1
+28476,Pulkovo 1942 / Gauss-Kruger 16N,1775,projected,4530,,4284,16316,,,Truncated form of Gauss-Kruger zone 16,,,EPSG,1995-06-02 00:00:00,,1,1
+28477,Pulkovo 1942 / Gauss-Kruger 17N,1776,projected,4530,,4284,16317,,,Truncated form of Gauss-Kruger zone 17,,,EPSG,1995-06-02 00:00:00,,1,1
+28478,Pulkovo 1942 / Gauss-Kruger 18N,1777,projected,4530,,4284,16318,,,Truncated form of Gauss-Kruger zone 18,,,EPSG,1995-06-02 00:00:00,,1,1
+28479,Pulkovo 1942 / Gauss-Kruger 19N,1778,projected,4530,,4284,16319,,,Truncated form of Gauss-Kruger zone 19,,,EPSG,1995-06-02 00:00:00,,1,1
+28480,Pulkovo 1942 / Gauss-Kruger 20N,1779,projected,4530,,4284,16320,,,Truncated form of Gauss-Kruger zone 20,,,EPSG,1995-06-02 00:00:00,,1,1
+28481,Pulkovo 1942 / Gauss-Kruger 21N,1780,projected,4530,,4284,16321,,,Truncated form of Gauss-Kruger zone 21,,,EPSG,1995-06-02 00:00:00,,1,1
+28482,Pulkovo 1942 / Gauss-Kruger 22N,1781,projected,4530,,4284,16322,,,Truncated form of Gauss-Kruger zone 22,,,EPSG,1995-06-02 00:00:00,,1,1
+28483,Pulkovo 1942 / Gauss-Kruger 23N,1782,projected,4530,,4284,16323,,,Truncated form of Gauss-Kruger zone 23,,,EPSG,1995-06-02 00:00:00,,1,1
+28484,Pulkovo 1942 / Gauss-Kruger 24N,1783,projected,4530,,4284,16324,,,Truncated form of Gauss-Kruger zone 24,,,EPSG,1995-06-02 00:00:00,,1,1
+28485,Pulkovo 1942 / Gauss-Kruger 25N,1784,projected,4530,,4284,16325,,,Truncated form of Gauss-Kruger zone 25,,,EPSG,1995-06-02 00:00:00,,1,1
+28486,Pulkovo 1942 / Gauss-Kruger 26N,1785,projected,4530,,4284,16326,,,Truncated form of Gauss-Kruger zone 26,,,EPSG,1995-06-02 00:00:00,,1,1
+28487,Pulkovo 1942 / Gauss-Kruger 27N,1786,projected,4530,,4284,16327,,,Truncated form of Gauss-Kruger zone 27,,,EPSG,1995-06-02 00:00:00,,1,1
+28488,Pulkovo 1942 / Gauss-Kruger 28N,1787,projected,4530,,4284,16328,,,Truncated form of Gauss-Kruger zone 28,,,EPSG,1995-06-02 00:00:00,,1,1
+28489,Pulkovo 1942 / Gauss-Kruger 29N,1788,projected,4530,,4284,16329,,,Truncated form of Gauss-Kruger zone 29,,,EPSG,1995-06-02 00:00:00,,1,1
+28490,Pulkovo 1942 / Gauss-Kruger 30N,1789,projected,4530,,4284,16330,,,Truncated form of Gauss-Kruger zone 30,,,EPSG,1995-06-02 00:00:00,,1,1
+28491,Pulkovo 1942 / Gauss-Kruger 31N,1790,projected,4530,,4284,16331,,,Truncated form of Gauss-Kruger zone 31,,,EPSG,1995-06-02 00:00:00,,1,1
+28492,Pulkovo 1942 / Gauss-Kruger 32N,1791,projected,4530,,4284,16332,,,Truncated form of Gauss-Kruger zone 32,,,EPSG,1995-06-02 00:00:00,,1,1
+28600,Qatar 1974 / Qatar National Grid,1346,projected,4400,,4285,19919,,,Large and medium scale topographic mapping and engineering survey.,,Qatar Centre for Geographic Information.,EPSG,2000-03-07 00:00:00,2000.29,1,0
+28991,Amersfoort / RD Old,1275,projected,4499,,4289,19913,,,Large and medium scale topographic mapping and engineering survey.,Superseded by 28992 (Amersfoort / RD New).,,EPSG,2000-03-07 00:00:00,2000.37,1,0
+28992,Amersfoort / RD New,1275,projected,4499,,4289,19914,,,Large and medium scale topographic mapping and engineering survey.,Supersedes 28991 (Amersfoort / RD Old).,,EPSG,2000-03-07 00:00:00,2000.37,1,0
+29100,SAD69 / Brazil Polyconic,1053,projected,4499,,4291,19941,,,Small scale mapping.,,PetroBras,EPSG,1999-04-22 00:00:00,,1,0
+29118,SAD69 / UTM zone 18N,1807,projected,4400,,4291,16018,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.251.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29119,SAD69 / UTM zone 19N,1809,projected,4400,,4291,16019,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29120,SAD69 / UTM zone 20N,1811,projected,4400,,4291,16020,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29121,SAD69 / UTM zone 21N,1813,projected,4400,,4291,16021,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29122,SAD69 / UTM zone 22N,1815,projected,4400,,4291,16022,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29177,SAD69 / UTM zone 17S,1806,projected,4400,,4291,16117,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29178,SAD69 / UTM zone 18S,1808,projected,4400,,4291,16118,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29179,SAD69 / UTM zone 19S,1810,projected,4400,,4291,16119,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29180,SAD69 / UTM zone 20S,1812,projected,4400,,4291,16120,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29181,SAD69 / UTM zone 21S,1814,projected,4400,,4291,16121,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29182,SAD69 / UTM zone 22S,1816,projected,4400,,4291,16122,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29183,SAD69 / UTM zone 23S,1817,projected,4400,,4291,16123,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29184,SAD69 / UTM zone 24S,1818,projected,4400,,4291,16124,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29185,SAD69 / UTM zone 25S,1819,projected,4400,,4291,16125,,,Large and medium scale topographic mapping and engineering survey.,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,,EPSG,1995-06-02 00:00:00,97.252,1,0
+29220,Sapper Hill 1943 / UTM zone 20S,1820,projected,4400,,4292,16120,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+29221,Sapper Hill 1943 / UTM zone 21S,1821,projected,4400,,4292,16121,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+29333,Schwarzeck / UTM zone 33S,1822,projected,4400,,4293,16133,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-04-12 00:00:00,,1,0
+29371,South West African Coord. System zone 11,1838,projected,6502,,4293,17611,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,,EPSG,2000-03-07 00:00:00,97.16  99.98,1,0
+29373,South West African Coord. System zone 13,1839,projected,6502,,4293,17613,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,,EPSG,2000-03-07 00:00:00,97.16  99.98,1,0
+29375,South West African Coord. System zone 15,1840,projected,6502,,4293,17615,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,,EPSG,2000-03-07 00:00:00,97.16  99.98,1,0
+29377,South West African Coord. System zone 17,1841,projected,6502,,4293,17617,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,,EPSG,2000-03-07 00:00:00,97.16  99.98,1,0
+29379,South West African Coord. System zone 19,1842,projected,6502,,4293,17619,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,,EPSG,2000-03-07 00:00:00,97.16  99.98,1,0
+29381,South West African Coord. System zone 21,1843,projected,6502,,4293,17621,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,,EPSG,2000-03-07 00:00:00,97.16  99.98,1,0
+29383,South West African Coord. System zone 23,1844,projected,6502,,4293,17623,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,,EPSG,2000-03-07 00:00:00,97.16  99.98,1,0
+29385,South West African Coord. System zone 25,1845,projected,6502,,4293,17625,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",,,EPSG,2000-03-07 00:00:00,97.16  99.98,1,0
+29635,Sudan / UTM zone 35N,1846,projected,4400,,4296,16035,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+29636,Sudan / UTM zone 36N,1847,projected,4400,,4296,16036,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+29700,Tananarive (Paris) / Laborde Grid,1149,projected,4499,,4810,19911,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+29738,Tananarive / UTM zone 38S,1848,projected,4400,,4297,16138,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+29739,Tananarive / UTM zone 39S,1849,projected,4400,,4297,16139,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+29849,Timbalai 1948 / UTM zone 49N,1852,projected,4400,,4298,16049,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+29850,Timbalai 1948 / UTM zone 50N,1853,projected,4400,,4298,16050,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+29871,Timbalai 1948 / R.S.O. Borneo (ch),1362,projected,4402,,4298,19956,,,Large and medium scale topographic mapping and engineering survey.,Adopts metric conversion of 39.370147 inches per metre. Being superseded by metric version (code 29873).,,EPSG,2002-07-13 00:00:00,97.231  2000.60  2002.47,1,0
+29872,Timbalai 1948 / R.S.O. Borneo (ft),1851,projected,4405,,4298,19957,,,Large and medium scale topographic mapping and engineering survey.,Original projection definition in chains.  1 chain = 66 feet.  Adopts Sears 1922 metric conversion of 39.370147 inches per metre.  Being superseded by metric version (code 29873).,,EPSG,2002-07-13 00:00:00,97.231  2000.60  2002.47,1,0
+29873,Timbalai 1948 / R.S.O. Borneo (m),1362,projected,4400,,4298,19958,,,Large and medium scale topographic mapping and engineering survey.,Original projection definition in chains.  1 chain = 66 feet=792 inches.  Adopts Sears 1922 metric conversion of 39.370147 inches per metre.,,EPSG,2000-10-19 00:00:00,2000.60,1,0
+29900,TM65 / Irish National Grid,1305,projected,4400,,4299,19908,,,Large and medium scale topographic mapping and engineering survey.,Superseded by IRENET95 / Irish Transverse Mercator (code 2157) from 1/1/2001.  Deprecated due to change of name - see 29902.,Ordnance Survey of Ireland,EPSG,1995-06-02 00:00:00,,1,1
+29901,OSNI 1952 / Irish National Grid,2530,projected,4400,,4188,19973,,,Large and medium scale topographic mapping and engineering survey.,Not used in Republic of Ireland.  Superseded in 1975 by TM75 / Irish Grid (code 29903).,Ordnance Survey of Northern Ireland.,EPSG,2001-11-06 00:00:00,,1,0
+29902,TM65 / Irish Grid,1125,projected,4400,,4299,19972,,,Large and medium scale topographic mapping and engineering survey.,Not used in Northern Ireland.  Superseded by TM75 / Irish Grid (code 29903) in 1975.,Ordnance Survey of Ireland.,EPSG,2001-11-06 00:00:00,,1,0
+29903,TM75 / Irish Grid,1305,projected,4400,,4300,19972,,,Large and medium scale topographic mapping and engineering survey.,Supersedes both OSNI 1952 / Irish National Grid (code 29901) and TM65 / Irish Grid (code 29902) from 1975.  Superseded by IRENET95 / Irish Transverse Mercator (code 2157) from 1/1/2001.,Ordnance Survey of Ireland,EPSG,2001-11-06 00:00:00,,1,0
+30161,Tokyo / Japan Plane Rectangular CS I,1854,projected,4530,,4301,17801,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS I (code 2443) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+30162,Tokyo / Japan Plane Rectangular CS II,1855,projected,4530,,4301,17802,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS II (code 2444) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+30163,Tokyo / Japan Plane Rectangular CS III,1856,projected,4530,,4301,17803,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS III (code 2445) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+30164,Tokyo / Japan Plane Rectangular CS IV,1857,projected,4530,,4301,17804,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS IV (code 2446) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+30165,Tokyo / Japan Plane Rectangular CS V,1858,projected,4530,,4301,17805,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS V (code 2447) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08 2002.081,1,0
+30166,Tokyo / Japan Plane Rectangular CS VI,1859,projected,4530,,4301,17806,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS VI (code 2448) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08 2002.081,1,0
+30167,Tokyo / Japan Plane Rectangular CS VII,1860,projected,4530,,4301,17807,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS VII (code 2449) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08 2002.081,1,0
+30168,Tokyo / Japan Plane Rectangular CS VIII,1861,projected,4530,,4301,17808,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS VIII (code 2450) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08 2002.081,1,0
+30169,Tokyo / Japan Plane Rectangular CS IX,1862,projected,4530,,4301,17809,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS IX (code 2451) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08 2002.081,1,0
+30170,Tokyo / Japan Plane Rectangular CS X,1863,projected,4530,,4301,17810,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS X (code 2452) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+30171,Tokyo / Japan Plane Rectangular CS XI,1864,projected,4530,,4301,17811,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS XI (code 2453) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+30172,Tokyo / Japan Plane Rectangular CS XII,1865,projected,4530,,4301,17812,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS XII (code 2454) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+30173,Tokyo / Japan Plane Rectangular CS XIII,1866,projected,4530,,4301,17813,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS XIII (code 2455) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08,1,0
+30174,Tokyo / Japan Plane Rectangular CS XIV,1867,projected,4530,,4301,17814,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low. Superseded by JGD2000 / Japan Plane Rectangular CS XIV (code 2456) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,2002.08,1,0
+30175,Tokyo / Japan Plane Rectangular CS XV,1868,projected,4530,,4301,17815,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS XV (code 2457) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08 2002.081,1,0
+30176,Tokyo / Japan Plane Rectangular CS XVI,1869,projected,4530,,4301,17816,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Superseded by JGD2000 / Japan Plane Rectangular CS XVI (code 2458) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,2002.08,1,0
+30177,Tokyo / Japan Plane Rectangular CS XVII,1870,projected,4530,,4301,17817,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low. Superseded by JGD2000 / Japan Plane Rectangular CS XVII (code 2459) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08 2002.081,1,0
+30178,Tokyo / Japan Plane Rectangular CS XVIII,1871,projected,4530,,4301,17818,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low. Superseded by JGD2000 / Japan Plane Rectangular CS XVIII (code 2460) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08 2002.081,1,0
+30179,Tokyo / Japan Plane Rectangular CS XIX,1872,projected,4530,,4301,17819,,,"Large and medium scale topographic mapping, cadastral and engineering survey.",Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low. Superseded by JGD2000 / Japan Plane Rectangular CS XIX (code 2461) from April 2002.,Geographic Survey Institute; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,99.97 2002.08 2002.081,1,0
+30200,Trinidad 1903 / Trinidad Grid,1322,projected,4407,,4302,19925,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,97.231,1,0
+30339,TC(1948) / UTM zone 39N,1850,projected,4400,,4303,16039,,,Oil exploration.,,,EPSG,1995-06-02 00:00:00,,1,0
+30340,TC(1948) / UTM zone 40N,1750,projected,4400,,4303,16040,,,Oil exploration.,,,EPSG,1995-06-02 00:00:00,,1,0
+30491,Voirol 1875 / Nord Algerie (ancienne),1728,projected,4499,,4304,18011,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Nord Sahara 1959 / Voirol Unifie Nord (code 30791).,,EPSG,1995-06-02 00:00:00,,1,0
+30492,Voirol 1875 / Sud Algerie (ancienne),1729,projected,4499,,4304,18012,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Nord Sahara 1959 / Voirol Unifie Nord (code 30792).,,EPSG,1995-06-02 00:00:00,,1,0
+30729,Nord Sahara 1959 / UTM zone 29N,1735,projected,4400,,4307,16029,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-04-12 00:00:00,,1,0
+30730,Nord Sahara 1959 / UTM zone 30N,1736,projected,4400,,4307,16030,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-04-12 00:00:00,,1,0
+30731,Nord Sahara 1959 / UTM zone 31N,1737,projected,4400,,4307,16031,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-04-12 00:00:00,,1,0
+30732,Nord Sahara 1959 / UTM zone 32N,1738,projected,4400,,4307,16032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-04-12 00:00:00,,1,0
+30791,Nord Sahara 1959 / Voirol Unifie Nord,1728,projected,4499,,4307,18021,,,Large and medium scale topographic mapping and engineering survey.,Supersedes Voirol 1875 / Nord Algeria ancienne (code 30491).  Grid coordinates on average across Algeria are unchanged although local differences reach 30 metres; geographic coordinate equivalents do change.,"""Le System Geodesique Nord-Sahara""; IGN Paris",EPSG,2002-08-29 00:00:00,2002.56,1,0
+30792,Nord Sahara 1959 / Voirol Unifie Sud,1729,projected,4499,,4307,18022,,,Large and medium scale topographic mapping and engineering survey.,Supersedes Voirol 1875 / Sud Algeria ancienne (code 30492).  Grid coordinates on average across Algeria are unchanged although local differences reach 30 metres; geographic coordinate equivalents do change.,"""Le System Geodesique Nord-Sahara""; IGN Paris",EPSG,2002-08-29 00:00:00,2002.56,1,0
+30800,RT38 2.5 gon W,1225,projected,4530,,4308,19929,,,Large and medium scale topographic mapping and engineering survey.,,National Land Survey of Sweden,EPSG,1997-11-13 00:00:00,97.14  97.39,1,0
+31028,Yoff / UTM zone 28N,1207,projected,4400,,4310,16028,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+31121,Zanderij / UTM zone 21N,1222,projected,4400,,4311,16021,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+31154,Zanderij / TM 54 NW,1727,projected,4400,,4311,17054,,,Large and medium scale topographic mapping and engineering survey.,,Shell International,EPSG,2000-06-10 00:00:00,,1,0
+31170,Zanderij / Suriname Old TM,1222,projected,4400,,4311,19954,,,Large and medium scale topographic mapping and engineering survey.,Introduced in 1975.  Superseded by Zanderij / Suriname TM in 1979.,Shell International,EPSG,2000-06-10 00:00:00,,1,0
+31171,Zanderij / Suriname TM,1222,projected,4400,,4311,19955,,,Large and medium scale topographic mapping and engineering survey.,Superseded Zanderij / Suriname Old TM in 1979.,Shell International,EPSG,2000-06-10 00:00:00,,1,0
+31265,MGI / 3-degree Gauss zone 5,1709,projected,4499,,4312,16265,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,,1,1
+31266,MGI / 3-degree Gauss zone 6,1710,projected,4499,,4312,16266,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,,1,1
+31267,MGI / 3-degree Gauss zone 7,1711,projected,4499,,4312,16267,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,,1,1
+31268,MGI / 3-degree Gauss zone 8,1712,projected,4499,,4312,16268,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,,1,1
+31275,MGI / Balkans zone 5,1709,projected,4530,,4312,18275,,,Large and medium scale topographic mapping and engineering survey.,In Slovenia the truncated form MGI / Slovenia Grid (code 2169) is preferred.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+31276,MGI / Balkans zone 6,1710,projected,4530,,4312,18276,,,Large and medium scale topographic mapping and engineering survey.,,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+31277,MGI / Balkans zone 7,1711,projected,4530,,4312,18277,,,Large and medium scale topographic mapping and engineering survey.,,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+31278,MGI / Balkans zone 8,1712,projected,4530,,4312,18277,,,Large and medium scale topographic mapping and engineering survey.,,EPSG,EPSG,2001-06-05 00:00:00,,1,1
+31279,MGI / Balkans zone 8,1712,projected,4530,,4312,18278,,,Large and medium scale topographic mapping and engineering survey.,,EPSG,EPSG,2001-08-28 00:00:00,,1,0
+31281,MGI (Ferro) / Austria West Zone,1706,projected,4530,,4805,18041,,,Large and medium scale topographic mapping and engineering survey.,Superseded by MGI / M28 (EPSG code 31284) based on Greenwich meridian.,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,2001-06-05 00:00:00,,1,0
+31282,MGI (Ferro) / Austria Central Zone,1708,projected,4530,,4805,18042,,,Large and medium scale topographic mapping and engineering survey.,Superseded by MGI / M31 (EPSG code 31285) based on Greenwich meridian.,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,2001-06-05 00:00:00,,1,0
+31283,MGI (Ferro) / Austria East Zone,1707,projected,4530,,4805,18043,,,Large and medium scale topographic mapping and engineering survey.,Superseded by MGI / M34 (EPSG code 31286) based on Greenwich meridian.,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,2001-06-05 00:00:00,,1,0
+31284,MGI / M28,1706,projected,4530,,4312,18044,,,Large and medium scale topographic mapping and engineering survey.,Supersedes MGI (Ferro) / Austria West zone (EPSG code 31281).,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,2001-06-05 00:00:00,,1,0
+31285,MGI / M31,1707,projected,4530,,4312,18045,,,Large and medium scale topographic mapping and engineering survey.,Supersedes MGI (Ferro) / Austria Central zone (EPSG code 31282).,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,2001-06-05 00:00:00,,1,0
+31286,MGI / M34,1708,projected,4530,,4312,18046,,,Large and medium scale topographic mapping and engineering survey.,Supersedes MGI (Ferro) / Austria East zone (EPSG code 31283).,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,2001-06-05 00:00:00,,1,0
+31287,MGI / Austria Lambert,1037,projected,4530,,4312,19947,,,Medium and small scale mapping.,,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,2001-06-05 00:00:00,,1,0
+31291,MGI (Ferro) / Austria West Zone,1706,projected,4499,,4805,18041,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,97.01,1,1
+31292,MGI (Ferro) / Austria Central Zone,1708,projected,4499,,4805,18042,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,97.01,1,1
+31293,MGI (Ferro) / Austria East Zone,1707,projected,4499,,4805,18043,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,97.01,1,1
+31294,MGI / M28,1706,projected,4499,,4312,18044,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,97.01,1,1
+31295,MGI / M31,1707,projected,4499,,4312,18045,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,97.01,1,1
+31296,MGI / M34,1708,projected,4499,,4312,18046,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-10-20 00:00:00,97.01,1,1
+31297,MGI / Austria Lambert,1037,projected,4499,,4312,19947,,,Medium and small scale mapping.,,,EPSG,1999-10-20 00:00:00,97.01,1,1
+31300,Belge 1972 / Belge Lambert 72,1347,projected,4499,,4313,19902,,,Large and medium scale topographic mapping and engineering survey.,Supersedes 21500 (Belge 1950 / Belge Lambert 50).  An alternative - Belge 1972 / Belgian Lambert 72 (code 31370) - was introduced in 2000 to use the standard Lambert Conic Conformal (2SP) projection method (code 9802).  EPSG recommends this alternative.,IGN Brussels.,EPSG,1995-06-02 00:00:00,,1,0
+31370,Belge 1972 / Belgian Lambert 72,1347,projected,4499,,4313,19961,,,Large and medium scale topographic mapping and engineering survey.,"Introduced in 2000 as an alternative to CRS code 31300 to avoid the special projection method LCC (2SP Belgium) (code 9803). If software cannot handle latitude of origin 90�N, use latitude of origin = 50� 47' 57.704""N with Nf = 165372.956 m.",IGN Brussels www.ngi.be/html-files/french/0038.html,EPSG,2000-10-19 00:00:00,,1,0
+31461,DHDN / 3-degree Gauss zone 1,1628,projected,4499,,4314,16261,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.101,1,1
+31462,DHDN / 3-degree Gauss zone 2,1624,projected,4499,,4314,16262,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.101,1,1
+31463,DHDN / 3-degree Gauss zone 3,1625,projected,4499,,4314,16263,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.101,1,1
+31464,DHDN / 3-degree Gauss zone 4,1626,projected,4499,,4314,16264,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.101,1,1
+31465,DHDN / 3-degree Gauss zone 5,1627,projected,4499,,4314,16265,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.101,1,1
+31466,DHDN / Gauss-Kruger zone 2,1624,projected,4530,,4314,16262,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.",Zone width 3 degrees.,Bundesamt f�r Kartographie und Geod�sie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+31467,DHDN / Gauss-Kruger zone 3,1625,projected,4530,,4314,16263,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.",Zone width 3 degrees.,Bundesamt f�r Kartographie und Geod�sie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+31468,DHDN / Gauss-Kruger zone 4,1626,projected,4530,,4314,16264,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.",Zone width 3 degrees.,Bundesamt f�r Kartographie und Geod�sie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+31469,DHDN / Gauss-Kruger zone 5,1627,projected,4530,,4314,16265,,,"Large and medium scale topographic mapping and engineering survey, cadastral survey.",Zone width 3 degrees.,Bundesamt f�r Kartographie und Geod�sie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1,0
+31528,Conakry 1905 / UTM zone 28N,1468,projected,4400,,4315,16028,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Dabola 1981 / UTM zone 28 (EPSG code 2063).,,EPSG,1999-12-09 00:00:00,,1,0
+31529,Conakry 1905 / UTM zone 29N,1469,projected,4400,,4315,16029,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Dabola 1981 / UTM zone 29 (EPSG code 2064).,,EPSG,1999-12-09 00:00:00,,1,0
+31600,Dealul Piscului 1933/ Stereo 33,1197,projected,4499,,4316,19927,,,Large and medium scale topographic mapping and engineering survey.,Superseded by Stereo 70 system (ProjCS code 31700).,,EPSG,1996-04-12 00:00:00,,1,0
+31700,Dealul Piscului 1970/ Stereo 70,1197,projected,4530,,4317,19926,,,Large and medium scale topographic mapping and engineering survey.,Supersedes Stereo 33 system.,,EPSG,1996-04-12 00:00:00,,1,0
+31838,NGN / UTM zone 38N,1739,projected,4400,,4318,16038,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-04-12 00:00:00,,1,0
+31839,NGN / UTM zone 39N,1740,projected,4400,,4318,16039,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-04-12 00:00:00,,1,0
+31900,KUDAMS / KTM,1310,projected,4400,,4319,19928,,,Large scale engineering and utility mapping.,,,EPSG,1996-04-12 00:00:00,,1,0
+31986,SIRGAS / UTM zone 17N,1823,projected,4400,,4170,16017,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31987,SIRGAS / UTM zone 18N,1825,projected,4400,,4170,16018,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31988,SIRGAS / UTM zone 19N,1827,projected,4400,,4170,16019,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31989,SIRGAS / UTM zone 20N,1829,projected,4400,,4170,16020,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31990,SIRGAS / UTM zone 21N,1831,projected,4400,,4170,16021,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31991,SIRGAS / UTM zone 22N,1833,projected,4400,,4170,16022,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31992,SIRGAS / UTM zone 17S,1824,projected,4400,,4170,16117,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31993,SIRGAS / UTM zone 18S,1826,projected,4400,,4170,16118,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31994,SIRGAS / UTM zone 19S,1828,projected,4400,,4170,16119,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31995,SIRGAS / UTM zone 20S,1830,projected,4400,,4170,16120,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31996,SIRGAS / UTM zone 21S,1832,projected,4400,,4170,16121,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31997,SIRGAS / UTM zone 22S,1834,projected,4400,,4170,16122,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31998,SIRGAS / UTM zone 23S,1835,projected,4400,,4170,16123,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+31999,SIRGAS / UTM zone 24S,1836,projected,4400,,4170,16124,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+32000,SIRGAS / UTM zone 25S,1837,projected,4400,,4170,16125,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-10-19 00:00:00,,1,0
+32001,NAD27 / Montana North,2211,projected,4497,,4267,12501,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32002,NAD27 / Montana Central,2210,projected,4497,,4267,12502,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32003,NAD27 / Montana South,2212,projected,4497,,4267,12503,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32005,NAD27 / Nebraska North,2221,projected,4497,,4267,12601,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32006,NAD27 / Nebraska South,2222,projected,4497,,4267,12602,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32007,NAD27 / Nevada East,2224,projected,4497,,4267,12701,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32008,NAD27 / Nevada Central,2223,projected,4497,,4267,12702,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32009,NAD27 / Nevada West,2225,projected,4497,,4267,12703,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32010,NAD27 / New Hampshire,1398,projected,4497,,4267,12800,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32011,NAD27 / New Jersey,1399,projected,4497,,4267,12900,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32012,NAD27 / New Mexico East,2228,projected,4497,,4267,13001,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32013,NAD27 / New Mexico Central,2229,projected,4497,,4267,13002,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32014,NAD27 / New Mexico West,2230,projected,4497,,4267,13003,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32015,NAD27 / New York East,2234,projected,4497,,4267,13101,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32016,NAD27 / New York Central,2233,projected,4497,,4267,13102,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32017,NAD27 / New York West,2236,projected,4497,,4267,13103,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32018,NAD27 / New York Long Island,2235,projected,4497,,4267,13104,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32019,NAD27 / North Carolina,1402,projected,4497,,4267,13200,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32020,NAD27 / North Dakota North,2237,projected,4497,,4267,13301,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32021,NAD27 / North Dakota South,2238,projected,4497,,4267,13302,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32022,NAD27 / Ohio North,2239,projected,4497,,4267,13401,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32023,NAD27 / Ohio South,2240,projected,4497,,4267,13402,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32024,NAD27 / Oklahoma North,2241,projected,4497,,4267,13501,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32025,NAD27 / Oklahoma South,2242,projected,4497,,4267,13502,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32026,NAD27 / Oregon North,2243,projected,4497,,4267,13601,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32027,NAD27 / Oregon South,2244,projected,4497,,4267,13602,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32028,NAD27 / Pennsylvania North,2245,projected,4497,,4267,13701,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32029,NAD27 / Pennsylvania South,2246,projected,4497,,4267,13702,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32030,NAD27 / Rhode Island,1408,projected,4497,,4267,13800,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32031,NAD27 / South Carolina North,2247,projected,4497,,4267,13901,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32033,NAD27 / South Carolina South,2248,projected,4497,,4267,13902,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32034,NAD27 / South Dakota North,2249,projected,4497,,4267,14001,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32035,NAD27 / South Dakota South,2250,projected,4497,,4267,14002,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32036,NAD27 / Tennessee,1411,projected,4497,,4267,14100,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,1
+32037,NAD27 / Texas North,2253,projected,4497,,4267,14201,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32038,NAD27 / Texas North Central,2254,projected,4497,,4267,14202,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32039,NAD27 / Texas Central,2252,projected,4497,,4267,14203,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32040,NAD27 / Texas South Central,2256,projected,4497,,4267,14204,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32041,NAD27 / Texas South,2255,projected,4497,,4267,14205,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32042,NAD27 / Utah North,2258,projected,4497,,4267,14301,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32043,NAD27 / Utah Central,2257,projected,4497,,4267,14302,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32044,NAD27 / Utah South,2259,projected,4497,,4267,14303,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32045,NAD27 / Vermont,1414,projected,4497,,4267,14400,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32046,NAD27 / Virginia North,2260,projected,4497,,4267,14501,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32047,NAD27 / Virginia South,2261,projected,4497,,4267,14502,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32048,NAD27 / Washington North,2262,projected,4497,,4267,14601,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32049,NAD27 / Washington South,2263,projected,4497,,4267,14602,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32050,NAD27 / West Virginia North,2264,projected,4497,,4267,14701,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32051,NAD27 / West Virginia South,2265,projected,4497,,4267,14702,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32052,NAD27 / Wisconsin North,2267,projected,4497,,4267,14801,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32053,NAD27 / Wisconsin Central,2266,projected,4497,,4267,14802,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32054,NAD27 / Wisconsin South,2268,projected,4497,,4267,14803,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32055,NAD27 / Wyoming East,2269,projected,4497,,4267,14901,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32056,NAD27 / Wyoming East Central,2270,projected,4497,,4267,14902,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32057,NAD27 / Wyoming West Central,2272,projected,4497,,4267,14903,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32058,NAD27 / Wyoming West,2271,projected,4497,,4267,14904,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32061,NAD27 / Guatemala Norte,2120,projected,4499,,4267,18211,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1999-08-18 00:00:00,,1,0
+32062,NAD27 / Guatemala Sur,2121,projected,4499,,4267,18212,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-01-06 00:00:00,99.95,1,0
+32064,NAD27 / BLM 14N (ftUS),2171,projected,4497,,4267,15914,,,"Minerals (including oil) management, exploration and production.",,EPSG,EPSG,2002-02-12 00:00:00,,1,0
+32065,NAD27 / BLM 15N (ftUS),2171,projected,4497,,4267,15915,,,"Minerals (including oil) management, exploration and production.",,EPSG,EPSG,2002-02-12 00:00:00,,1,0
+32066,NAD27 / BLM 16N (ftUS),2171,projected,4497,,4267,15916,,,"Minerals (including oil) management, exploration and production.",,EPSG,EPSG,2002-02-12 00:00:00,,1,0
+32067,NAD27 / BLM 17N (ftUS),2171,projected,4497,,4267,15917,,,"Minerals (including oil) management, exploration and production.",,EPSG,EPSG,2002-02-12 00:00:00,,1,0
+32074,NAD27 / BLM 14N (feet),2171,projected,4497,,4267,15914,,,"Minerals (including oil) management, exploration and production.",,,EPSG,1996-04-12 00:00:00,96.03,1,1
+32075,NAD27 / BLM 15N (feet),2172,projected,4497,,4267,15915,,,"Minerals (including oil) management, exploration and production.",,,EPSG,1996-04-12 00:00:00,96.03,1,1
+32076,NAD27 / BLM 16N (feet),2173,projected,4497,,4267,15916,,,"Minerals (including oil) management, exploration and production.",,,EPSG,1996-04-12 00:00:00,95.27  96.03,1,1
+32077,NAD27 / BLM 17N (feet),2174,projected,4497,,4267,15917,,,"Minerals (including oil) management, exploration and production.",,,EPSG,1996-04-12 00:00:00,96.03,1,1
+32081,NAD27 / MTM zone 1,2226,projected,4400,,4267,17701,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32082,NAD27 / MTM zone 2,2227,projected,4400,,4267,17702,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32083,NAD27 / MTM zone 3,2275,projected,4400,,4267,17703,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32084,NAD27 / MTM zone 4,2276,projected,4400,,4267,17704,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32085,NAD27 / MTM zone 5,2277,projected,4400,,4267,17705,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32086,NAD27 / MTM zone 6,2278,projected,4400,,4267,17706,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32098,NAD27 / Quebec Lambert,1368,projected,4499,,4267,19944,,,Large and medium scale topographic mapping and engineering survey.,Superseded by NAD27(CGQ77) / Quebec Lambert (code 2137) in 1977.,Service de la Cartographie; Minist�re des Ressources Naturelles; Quebec,EPSG,2000-10-19 00:00:00,,1,0
+32100,NAD83 / Montana,1395,projected,4499,,4269,12530,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2256 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32104,NAD83 / Nebraska,1396,projected,4499,,4269,12630,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32107,NAD83 / Nevada East,2224,projected,4499,,4269,12731,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32108,NAD83 / Nevada Central,2223,projected,4499,,4269,12732,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32109,NAD83 / Nevada West,2225,projected,4499,,4269,12733,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32110,NAD83 / New Hampshire,1398,projected,4499,,4269,12830,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32111,NAD83 / New Jersey,1399,projected,4499,,4269,12930,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32112,NAD83 / New Mexico East,2228,projected,4499,,4269,13031,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2257 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32113,NAD83 / New Mexico Central,2231,projected,4499,,4269,13032,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2258 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32114,NAD83 / New Mexico West,2232,projected,4499,,4269,13033,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2259 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32115,NAD83 / New York East,2234,projected,4499,,4269,13131,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2260 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32116,NAD83 / New York Central,2233,projected,4499,,4269,13132,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2261 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32117,NAD83 / New York West,2236,projected,4499,,4269,13133,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2263 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32118,NAD83 / New York Long Island,2235,projected,4499,,4269,13134,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2264 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32119,NAD83 / North Carolina,1402,projected,4499,,4269,13230,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2264 for equivalent non-metric definition.,,EPSG,2000-03-07 00:00:00,98.30  2000.091,1,0
+32120,NAD83 / North Dakota North,2237,projected,4499,,4269,13331,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2265 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32121,NAD83 / North Dakota South,2238,projected,4499,,4269,13332,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2266 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32122,NAD83 / Ohio North,2239,projected,4499,,4269,13431,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32123,NAD83 / Ohio South,2240,projected,4499,,4269,13432,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32124,NAD83 / Oklahoma North,2241,projected,4499,,4269,13531,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2267 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32125,NAD83 / Oklahoma South,2242,projected,4499,,4269,13532,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2268 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32126,NAD83 / Oregon North,2243,projected,4499,,4269,13631,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2269 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32127,NAD83 / Oregon South,2244,projected,4499,,4269,13632,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2270 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32128,NAD83 / Pennsylvania North,2245,projected,4499,,4269,13731,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2271 for equivalent non-metric definition.,,EPSG,1995-06-02 00:00:00,,1,0
+32129,NAD83 / Pennsylvania South,2246,projected,4499,,4269,13732,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in US survey feet.  See code 2272 for equivalent non-metric definition.,,EPSG,1995-06-02 00:00:00,,1,0
+32130,NAD83 / Rhode Island,1408,projected,4499,,4269,13830,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32133,NAD83 / South Carolina,1409,projected,4499,,4269,13930,,,Large and medium scale topographic mapping and engineering survey.,State law defines system in International feet (note: not US survey feet).  See code 2273 for equivalent non-metric definition.,,EPSG,1995-06-02 00:00:00,,1,0
+32134,NAD83 / South Dakota North,2249,projected,4499,,4269,14031,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32135,NAD83 / South Dakota South,2250,projected,4499,,4269,14032,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32136,NAD83 / Tennessee,1411,projected,4499,,4269,14130,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2274 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32137,NAD83 / Texas North,2253,projected,4499,,4269,14231,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2275 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32138,NAD83 / Texas North Central,2254,projected,4499,,4269,14232,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2276 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32139,NAD83 / Texas Central,2252,projected,4499,,4269,14233,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2277 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32140,NAD83 / Texas South Central,2527,projected,4499,,4269,14234,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2278 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32141,NAD83 / Texas South,2528,projected,4499,,4269,14235,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2279 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32142,NAD83 / Utah North,2258,projected,4499,,4269,14331,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2280 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32143,NAD83 / Utah Central,2257,projected,4499,,4269,14332,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2281 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32144,NAD83 / Utah South,2259,projected,4499,,4269,14333,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in International feet (note: not US survey feet).  See code 2282 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32145,NAD83 / Vermont,1414,projected,4499,,4269,14430,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32146,NAD83 / Virginia North,2260,projected,4499,,4269,14531,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2283 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32147,NAD83 / Virginia South,2261,projected,4499,,4269,14532,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2284 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32148,NAD83 / Washington North,2273,projected,4499,,4269,14631,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2285 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32149,NAD83 / Washington South,2274,projected,4499,,4269,14632,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2286 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32150,NAD83 / West Virginia North,2264,projected,4499,,4269,14731,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32151,NAD83 / West Virginia South,2265,projected,4499,,4269,14732,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32152,NAD83 / Wisconsin North,2267,projected,4499,,4269,14831,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2287 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32153,NAD83 / Wisconsin Central,2266,projected,4499,,4269,14832,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2288 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32154,NAD83 / Wisconsin South,2268,projected,4499,,4269,14833,,,Large and medium scale topographic mapping and engineering survey.,"State law defines system in US survey feet.  See code 2289 for equivalent non-metric definition. For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32155,NAD83 / Wyoming East,2269,projected,4499,,4269,14931,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32156,NAD83 / Wyoming East Central,2270,projected,4499,,4269,14932,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32157,NAD83 / Wyoming West Central,2272,projected,4499,,4269,14933,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32158,NAD83 / Wyoming West,2271,projected,4499,,4269,14934,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,2000-03-07 00:00:00,2000.091,1,0
+32161,NAD83 / Puerto Rico & Virgin Is.,2251,projected,4499,,4269,15230,,,Large and medium scale topographic mapping and engineering survey.,"For applications with an accuracy of better than 1m, superseded by NAD83(HARN) / SPCS.",,EPSG,1995-06-02 00:00:00,,1,0
+32180,NAD83 / SCoPQ zone 2,1420,projected,4499,,4269,17700,,,Large and medium scale topographic mapping and engineering survey.,,Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,1997-11-13 00:00:00,,1,0
+32181,NAD83 / MTM zone 1,2226,projected,4496,,4269,17701,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32182,NAD83 / MTM zone 2,2227,projected,4496,,4269,17702,,,Large and medium scale topographic mapping and engineering survey.,,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32183,NAD83 / MTM zone 3,2275,projected,4496,,4269,17703,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83 / SCoPQ zone 3"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32184,NAD83 / MTM zone 4,2276,projected,4496,,4269,17704,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83 / SCoPQ zone 4"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32185,NAD83 / MTM zone 5,2277,projected,4496,,4269,17705,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83 / SCoPQ zone 5"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32186,NAD83 / MTM zone 6,2278,projected,4496,,4269,17706,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83 / SCoPQ zone 6"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,1997-11-13 00:00:00,,1,0
+32187,NAD83 / MTM zone 7,1425,projected,4496,,4269,17707,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83 / SCoPQ zone 7"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,1997-11-13 00:00:00,,1,0
+32188,NAD83 / MTM zone 8,2279,projected,4496,,4269,17708,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83 / SCoPQ zone 8"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+32189,NAD83 / MTM zone 9,2280,projected,4496,,4269,17709,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83 / SCoPQ zone 9"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+32190,NAD83 / MTM zone 10,2281,projected,4496,,4269,17710,,,Large and medium scale topographic mapping and engineering survey.,"Known in Quebec as ""NAD83 / SCoPQ zone 10"" with axis 1 and 2 abbreviations of ""X"" and ""Y"" respectively.",Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+32191,NAD83 / MTM zone 11,1432,projected,4400,,4269,17711,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+32192,NAD83 / MTM zone 12,1433,projected,4400,,4269,17712,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+32193,NAD83 / MTM zone 13,1434,projected,4400,,4269,17713,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+32194,NAD83 / MTM zone 14,1435,projected,4400,,4269,17714,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+32195,NAD83 / MTM zone 15,1436,projected,4400,,4269,17715,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+32196,NAD83 / MTM zone 16,1437,projected,4400,,4269,17716,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+32197,NAD83 / MTM zone 17,1438,projected,4400,,4269,17717,,,Large and medium scale topographic mapping and engineering survey.,,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,1997-11-13 00:00:00,,1,0
+32198,NAD83 / Quebec Lambert,1368,projected,4499,,4269,19944,,,Large and medium scale topographic mapping and engineering survey.,,Service de la Cartographie; Minist�re des Ressources Naturelles; Quebec,EPSG,1999-10-20 00:00:00,,1,0
+32201,WGS 72 / UTM zone 1N,1873,projected,4400,,4322,16001,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32202,WGS 72 / UTM zone 2N,1875,projected,4400,,4322,16002,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32203,WGS 72 / UTM zone 3N,1877,projected,4400,,4322,16003,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32204,WGS 72 / UTM zone 4N,1879,projected,4400,,4322,16004,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32205,WGS 72 / UTM zone 5N,1881,projected,4400,,4322,16005,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32206,WGS 72 / UTM zone 6N,1883,projected,4400,,4322,16006,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32207,WGS 72 / UTM zone 7N,1885,projected,4400,,4322,16007,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32208,WGS 72 / UTM zone 8N,1887,projected,4400,,4322,16008,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32209,WGS 72 / UTM zone 9N,1889,projected,4400,,4322,16009,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32210,WGS 72 / UTM zone 10N,1891,projected,4400,,4322,16010,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32211,WGS 72 / UTM zone 11N,1893,projected,4400,,4322,16011,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32212,WGS 72 / UTM zone 12N,1895,projected,4400,,4322,16012,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32213,WGS 72 / UTM zone 13N,1897,projected,4400,,4322,16013,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32214,WGS 72 / UTM zone 14N,1899,projected,4400,,4322,16014,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32215,WGS 72 / UTM zone 15N,1901,projected,4400,,4322,16015,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32216,WGS 72 / UTM zone 16N,1903,projected,4400,,4322,16016,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32217,WGS 72 / UTM zone 17N,1905,projected,4400,,4322,16017,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32218,WGS 72 / UTM zone 18N,1907,projected,4400,,4322,16018,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32219,WGS 72 / UTM zone 19N,1909,projected,4400,,4322,16019,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32220,WGS 72 / UTM zone 20N,1911,projected,4400,,4322,16020,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32221,WGS 72 / UTM zone 21N,1913,projected,4400,,4322,16021,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32222,WGS 72 / UTM zone 22N,1915,projected,4400,,4322,16022,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32223,WGS 72 / UTM zone 23N,1917,projected,4400,,4322,16023,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32224,WGS 72 / UTM zone 24N,1919,projected,4400,,4322,16024,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32225,WGS 72 / UTM zone 25N,1921,projected,4400,,4322,16025,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32226,WGS 72 / UTM zone 26N,1923,projected,4400,,4322,16026,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32227,WGS 72 / UTM zone 27N,1925,projected,4400,,4322,16027,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32228,WGS 72 / UTM zone 28N,1927,projected,4400,,4322,16028,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32229,WGS 72 / UTM zone 29N,1929,projected,4400,,4322,16029,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32230,WGS 72 / UTM zone 30N,1931,projected,4400,,4322,16030,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32231,WGS 72 / UTM zone 31N,1933,projected,4400,,4322,16031,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32232,WGS 72 / UTM zone 32N,1935,projected,4400,,4322,16032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32233,WGS 72 / UTM zone 33N,1937,projected,4400,,4322,16033,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32234,WGS 72 / UTM zone 34N,1939,projected,4400,,4322,16034,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32235,WGS 72 / UTM zone 35N,1941,projected,4400,,4322,16035,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32236,WGS 72 / UTM zone 36N,1943,projected,4400,,4322,16036,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32237,WGS 72 / UTM zone 37N,1945,projected,4400,,4322,16037,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32238,WGS 72 / UTM zone 38N,1947,projected,4400,,4322,16038,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32239,WGS 72 / UTM zone 39N,1949,projected,4400,,4322,16039,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32240,WGS 72 / UTM zone 40N,1951,projected,4400,,4322,16040,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32241,WGS 72 / UTM zone 41N,1953,projected,4400,,4322,16041,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32242,WGS 72 / UTM zone 42N,1955,projected,4400,,4322,16042,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32243,WGS 72 / UTM zone 43N,1957,projected,4400,,4322,16043,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32244,WGS 72 / UTM zone 44N,1959,projected,4400,,4322,16044,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32245,WGS 72 / UTM zone 45N,1961,projected,4400,,4322,16045,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32246,WGS 72 / UTM zone 46N,1963,projected,4400,,4322,16046,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32247,WGS 72 / UTM zone 47N,1965,projected,4400,,4322,16047,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32248,WGS 72 / UTM zone 48N,1967,projected,4400,,4322,16048,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32249,WGS 72 / UTM zone 49N,1969,projected,4400,,4322,16049,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32250,WGS 72 / UTM zone 50N,1971,projected,4400,,4322,16050,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32251,WGS 72 / UTM zone 51N,1973,projected,4400,,4322,16051,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32252,WGS 72 / UTM zone 52N,1975,projected,4400,,4322,16052,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32253,WGS 72 / UTM zone 53N,1977,projected,4400,,4322,16053,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32254,WGS 72 / UTM zone 54N,1979,projected,4400,,4322,16054,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32255,WGS 72 / UTM zone 55N,1981,projected,4400,,4322,16055,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32256,WGS 72 / UTM zone 56N,1983,projected,4400,,4322,16056,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32257,WGS 72 / UTM zone 57N,1985,projected,4400,,4322,16057,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32258,WGS 72 / UTM zone 58N,1987,projected,4400,,4322,16058,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32259,WGS 72 / UTM zone 59N,1989,projected,4400,,4322,16059,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32260,WGS 72 / UTM zone 60N,1991,projected,4400,,4322,16060,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32301,WGS 72 / UTM zone 1S,1874,projected,4400,,4322,16101,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32302,WGS 72 / UTM zone 2S,1876,projected,4400,,4322,16102,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32303,WGS 72 / UTM zone 3S,1878,projected,4400,,4322,16103,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32304,WGS 72 / UTM zone 4S,1880,projected,4400,,4322,16104,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32305,WGS 72 / UTM zone 5S,1882,projected,4400,,4322,16105,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32306,WGS 72 / UTM zone 6S,1884,projected,4400,,4322,16106,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32307,WGS 72 / UTM zone 7S,1886,projected,4400,,4322,16107,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32308,WGS 72 / UTM zone 8S,1888,projected,4400,,4322,16108,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32309,WGS 72 / UTM zone 9S,1890,projected,4400,,4322,16109,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32310,WGS 72 / UTM zone 10S,1892,projected,4400,,4322,16110,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32311,WGS 72 / UTM zone 11S,1894,projected,4400,,4322,16111,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32312,WGS 72 / UTM zone 12S,1896,projected,4400,,4322,16112,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32313,WGS 72 / UTM zone 13S,1898,projected,4400,,4322,16113,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32314,WGS 72 / UTM zone 14S,1900,projected,4400,,4322,16114,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32315,WGS 72 / UTM zone 15S,1902,projected,4400,,4322,16115,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32316,WGS 72 / UTM zone 16S,1904,projected,4400,,4322,16116,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32317,WGS 72 / UTM zone 17S,1906,projected,4400,,4322,16117,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32318,WGS 72 / UTM zone 18S,1908,projected,4400,,4322,16118,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32319,WGS 72 / UTM zone 19S,1910,projected,4400,,4322,16119,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32320,WGS 72 / UTM zone 20S,1912,projected,4400,,4322,16120,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32321,WGS 72 / UTM zone 21S,1914,projected,4400,,4322,16121,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32322,WGS 72 / UTM zone 22S,1916,projected,4400,,4322,16122,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32323,WGS 72 / UTM zone 23S,1918,projected,4400,,4322,16123,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32324,WGS 72 / UTM zone 24S,1920,projected,4400,,4322,16124,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32325,WGS 72 / UTM zone 25S,1922,projected,4400,,4322,16125,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32326,WGS 72 / UTM zone 26S,1924,projected,4400,,4322,16126,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32327,WGS 72 / UTM zone 27S,1926,projected,4400,,4322,16127,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32328,WGS 72 / UTM zone 28S,1928,projected,4400,,4322,16128,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32329,WGS 72 / UTM zone 29S,1930,projected,4400,,4322,16129,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32330,WGS 72 / UTM zone 30S,1932,projected,4400,,4322,16130,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32331,WGS 72 / UTM zone 31S,1934,projected,4400,,4322,16131,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32332,WGS 72 / UTM zone 32S,1936,projected,4400,,4322,16132,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32333,WGS 72 / UTM zone 33S,1938,projected,4400,,4322,16133,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32334,WGS 72 / UTM zone 34S,1940,projected,4400,,4322,16134,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32335,WGS 72 / UTM zone 35S,1942,projected,4400,,4322,16135,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32336,WGS 72 / UTM zone 36S,1944,projected,4400,,4322,16136,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32337,WGS 72 / UTM zone 37S,1946,projected,4400,,4322,16137,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32338,WGS 72 / UTM zone 38S,1948,projected,4400,,4322,16138,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32339,WGS 72 / UTM zone 39S,1950,projected,4400,,4322,16139,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32340,WGS 72 / UTM zone 40S,1952,projected,4400,,4322,16140,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32341,WGS 72 / UTM zone 41S,1954,projected,4400,,4322,16141,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32342,WGS 72 / UTM zone 42S,1956,projected,4400,,4322,16142,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32343,WGS 72 / UTM zone 43S,1958,projected,4400,,4322,16143,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32344,WGS 72 / UTM zone 44S,1960,projected,4400,,4322,16144,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32345,WGS 72 / UTM zone 45S,1962,projected,4400,,4322,16145,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32346,WGS 72 / UTM zone 46S,1964,projected,4400,,4322,16146,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32347,WGS 72 / UTM zone 47S,1966,projected,4400,,4322,16147,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32348,WGS 72 / UTM zone 48S,1968,projected,4400,,4322,16148,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32349,WGS 72 / UTM zone 49S,1970,projected,4400,,4322,16149,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32350,WGS 72 / UTM zone 50S,1972,projected,4400,,4322,16150,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32351,WGS 72 / UTM zone 51S,1974,projected,4400,,4322,16151,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32352,WGS 72 / UTM zone 52S,1976,projected,4400,,4322,16152,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32353,WGS 72 / UTM zone 53S,1978,projected,4400,,4322,16153,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32354,WGS 72 / UTM zone 54S,1980,projected,4400,,4322,16154,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32355,WGS 72 / UTM zone 55S,1982,projected,4400,,4322,16155,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32356,WGS 72 / UTM zone 56S,1984,projected,4400,,4322,16156,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32357,WGS 72 / UTM zone 57S,1986,projected,4400,,4322,16157,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32358,WGS 72 / UTM zone 58S,1988,projected,4400,,4322,16158,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32359,WGS 72 / UTM zone 59S,1990,projected,4400,,4322,16159,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32360,WGS 72 / UTM zone 60S,1992,projected,4400,,4322,16160,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32401,WGS 72BE / UTM zone 1N,1873,projected,4400,,4324,16001,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32402,WGS 72BE / UTM zone 2N,1876,projected,4400,,4324,16002,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32403,WGS 72BE / UTM zone 3N,1877,projected,4400,,4324,16003,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32404,WGS 72BE / UTM zone 4N,1879,projected,4400,,4324,16004,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32405,WGS 72BE / UTM zone 5N,1881,projected,4400,,4324,16005,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32406,WGS 72BE / UTM zone 6N,1883,projected,4400,,4324,16006,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32407,WGS 72BE / UTM zone 7N,1885,projected,4400,,4324,16007,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32408,WGS 72BE / UTM zone 8N,1887,projected,4400,,4324,16008,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32409,WGS 72BE / UTM zone 9N,1889,projected,4400,,4324,16009,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32410,WGS 72BE / UTM zone 10N,1891,projected,4400,,4324,16010,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32411,WGS 72BE / UTM zone 11N,1893,projected,4400,,4324,16011,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32412,WGS 72BE / UTM zone 12N,1895,projected,4400,,4324,16012,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32413,WGS 72BE / UTM zone 13N,1897,projected,4400,,4324,16013,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32414,WGS 72BE / UTM zone 14N,1899,projected,4400,,4324,16014,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32415,WGS 72BE / UTM zone 15N,1901,projected,4400,,4324,16015,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32416,WGS 72BE / UTM zone 16N,1903,projected,4400,,4324,16016,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32417,WGS 72BE / UTM zone 17N,1905,projected,4400,,4324,16017,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32418,WGS 72BE / UTM zone 18N,1907,projected,4400,,4324,16018,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32419,WGS 72BE / UTM zone 19N,1909,projected,4400,,4324,16019,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32420,WGS 72BE / UTM zone 20N,1911,projected,4400,,4324,16020,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32421,WGS 72BE / UTM zone 21N,1913,projected,4400,,4324,16021,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32422,WGS 72BE / UTM zone 22N,1915,projected,4400,,4324,16022,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32423,WGS 72BE / UTM zone 23N,1917,projected,4400,,4324,16023,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32424,WGS 72BE / UTM zone 24N,1919,projected,4400,,4324,16024,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32425,WGS 72BE / UTM zone 25N,1921,projected,4400,,4324,16025,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32426,WGS 72BE / UTM zone 26N,1923,projected,4400,,4324,16026,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32427,WGS 72BE / UTM zone 27N,1925,projected,4400,,4324,16027,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32428,WGS 72BE / UTM zone 28N,1927,projected,4400,,4324,16028,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32429,WGS 72BE / UTM zone 29N,1929,projected,4400,,4324,16029,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32430,WGS 72BE / UTM zone 30N,1931,projected,4400,,4324,16030,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32431,WGS 72BE / UTM zone 31N,1933,projected,4400,,4324,16031,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32432,WGS 72BE / UTM zone 32N,1935,projected,4400,,4324,16032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32433,WGS 72BE / UTM zone 33N,1937,projected,4400,,4324,16033,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32434,WGS 72BE / UTM zone 34N,1939,projected,4400,,4324,16034,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32435,WGS 72BE / UTM zone 35N,1941,projected,4400,,4324,16035,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32436,WGS 72BE / UTM zone 36N,1943,projected,4400,,4324,16036,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32437,WGS 72BE / UTM zone 37N,1945,projected,4400,,4324,16037,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32438,WGS 72BE / UTM zone 38N,1947,projected,4400,,4324,16038,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32439,WGS 72BE / UTM zone 39N,1949,projected,4400,,4324,16039,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32440,WGS 72BE / UTM zone 40N,1951,projected,4400,,4324,16040,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32441,WGS 72BE / UTM zone 41N,1953,projected,4400,,4324,16041,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32442,WGS 72BE / UTM zone 42N,1955,projected,4400,,4324,16042,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32443,WGS 72BE / UTM zone 43N,1957,projected,4400,,4324,16043,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32444,WGS 72BE / UTM zone 44N,1959,projected,4400,,4324,16044,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32445,WGS 72BE / UTM zone 45N,1961,projected,4400,,4324,16045,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32446,WGS 72BE / UTM zone 46N,1963,projected,4400,,4324,16046,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32447,WGS 72BE / UTM zone 47N,1965,projected,4400,,4324,16047,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32448,WGS 72BE / UTM zone 48N,1993,projected,4400,,4324,16048,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32449,WGS 72BE / UTM zone 49N,1994,projected,4400,,4324,16049,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32450,WGS 72BE / UTM zone 50N,1971,projected,4400,,4324,16050,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32451,WGS 72BE / UTM zone 51N,1973,projected,4400,,4324,16051,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32452,WGS 72BE / UTM zone 52N,1975,projected,4400,,4324,16052,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32453,WGS 72BE / UTM zone 53N,1977,projected,4400,,4324,16053,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32454,WGS 72BE / UTM zone 54N,1979,projected,4400,,4324,16054,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32455,WGS 72BE / UTM zone 55N,1981,projected,4400,,4324,16055,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32456,WGS 72BE / UTM zone 56N,1983,projected,4400,,4324,16056,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32457,WGS 72BE / UTM zone 57N,1985,projected,4400,,4324,16057,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32458,WGS 72BE / UTM zone 58N,1987,projected,4400,,4324,16058,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32459,WGS 72BE / UTM zone 59N,1989,projected,4400,,4324,16059,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32460,WGS 72BE / UTM zone 60N,1991,projected,4400,,4324,16060,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32501,WGS 72BE / UTM zone 1S,1874,projected,4400,,4324,16101,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32502,WGS 72BE / UTM zone 2S,1876,projected,4400,,4324,16102,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32503,WGS 72BE / UTM zone 3S,1878,projected,4400,,4324,16103,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32504,WGS 72BE / UTM zone 4S,1880,projected,4400,,4324,16104,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32505,WGS 72BE / UTM zone 5S,1882,projected,4400,,4324,16105,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32506,WGS 72BE / UTM zone 6S,1884,projected,4400,,4324,16106,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32507,WGS 72BE / UTM zone 7S,1886,projected,4400,,4324,16107,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32508,WGS 72BE / UTM zone 8S,1888,projected,4400,,4324,16108,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32509,WGS 72BE / UTM zone 9S,1890,projected,4400,,4324,16109,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32510,WGS 72BE / UTM zone 10S,1892,projected,4400,,4324,16110,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32511,WGS 72BE / UTM zone 11S,1894,projected,4400,,4324,16111,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32512,WGS 72BE / UTM zone 12S,1896,projected,4400,,4324,16112,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32513,WGS 72BE / UTM zone 13S,1898,projected,4400,,4324,16113,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32514,WGS 72BE / UTM zone 14S,1900,projected,4400,,4324,16114,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32515,WGS 72BE / UTM zone 15S,1902,projected,4400,,4324,16115,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32516,WGS 72BE / UTM zone 16S,1904,projected,4400,,4324,16116,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32517,WGS 72BE / UTM zone 17S,1906,projected,4400,,4324,16117,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32518,WGS 72BE / UTM zone 18S,1908,projected,4400,,4324,16118,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32519,WGS 72BE / UTM zone 19S,1910,projected,4400,,4324,16119,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32520,WGS 72BE / UTM zone 20S,1912,projected,4400,,4324,16120,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32521,WGS 72BE / UTM zone 21S,1914,projected,4400,,4324,16121,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32522,WGS 72BE / UTM zone 22S,1916,projected,4400,,4324,16122,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32523,WGS 72BE / UTM zone 23S,1918,projected,4400,,4324,16123,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32524,WGS 72BE / UTM zone 24S,1920,projected,4400,,4324,16124,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32525,WGS 72BE / UTM zone 25S,1922,projected,4400,,4324,16125,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32526,WGS 72BE / UTM zone 26S,1924,projected,4400,,4324,16126,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32527,WGS 72BE / UTM zone 27S,1926,projected,4400,,4324,16127,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32528,WGS 72BE / UTM zone 28S,1928,projected,4400,,4324,16128,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32529,WGS 72BE / UTM zone 29S,1930,projected,4400,,4324,16129,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32530,WGS 72BE / UTM zone 30S,1932,projected,4400,,4324,16130,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32531,WGS 72BE / UTM zone 31S,1934,projected,4400,,4324,16131,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32532,WGS 72BE / UTM zone 32S,1936,projected,4400,,4324,16132,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32533,WGS 72BE / UTM zone 33S,1938,projected,4400,,4324,16133,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32534,WGS 72BE / UTM zone 34S,1940,projected,4400,,4324,16134,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32535,WGS 72BE / UTM zone 35S,1942,projected,4400,,4324,16135,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32536,WGS 72BE / UTM zone 36S,1944,projected,4400,,4324,16136,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32537,WGS 72BE / UTM zone 37S,1946,projected,4400,,4324,16137,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32538,WGS 72BE / UTM zone 38S,1948,projected,4400,,4324,16138,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32539,WGS 72BE / UTM zone 39S,1950,projected,4400,,4324,16139,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32540,WGS 72BE / UTM zone 40S,1952,projected,4400,,4324,16140,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32541,WGS 72BE / UTM zone 41S,1954,projected,4400,,4324,16141,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32542,WGS 72BE / UTM zone 42S,1956,projected,4400,,4324,16142,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32543,WGS 72BE / UTM zone 43S,1958,projected,4400,,4324,16143,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32544,WGS 72BE / UTM zone 44S,1960,projected,4400,,4324,16144,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32545,WGS 72BE / UTM zone 45S,1962,projected,4400,,4324,16145,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32546,WGS 72BE / UTM zone 46S,1964,projected,4400,,4324,16146,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32547,WGS 72BE / UTM zone 47S,1966,projected,4400,,4324,16147,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32548,WGS 72BE / UTM zone 48S,1968,projected,4400,,4324,16148,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32549,WGS 72BE / UTM zone 49S,1995,projected,4400,,4324,16149,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32550,WGS 72BE / UTM zone 50S,1972,projected,4400,,4324,16150,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32551,WGS 72BE / UTM zone 51S,1974,projected,4400,,4324,16151,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32552,WGS 72BE / UTM zone 52S,1976,projected,4400,,4324,16152,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32553,WGS 72BE / UTM zone 53S,1978,projected,4400,,4324,16153,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32554,WGS 72BE / UTM zone 54S,1980,projected,4400,,4324,16154,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32555,WGS 72BE / UTM zone 55S,1982,projected,4400,,4324,16155,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32556,WGS 72BE / UTM zone 56S,1984,projected,4400,,4324,16156,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32557,WGS 72BE / UTM zone 57S,1986,projected,4400,,4324,16157,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32558,WGS 72BE / UTM zone 58S,1988,projected,4400,,4324,16158,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32559,WGS 72BE / UTM zone 59S,1990,projected,4400,,4324,16159,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32560,WGS 72BE / UTM zone 60S,1992,projected,4400,,4324,16160,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32600,WGS 84 / UTM grid system (northern hemisphere),1998,projected,4400,,4326,16000,,,For strict use within zone boundaries,Use WGS 84 / UTM zone xx N (codes 32601-32660) for use outwith zone boundary or when easting is not prefixed by zone number.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+32601,WGS 84 / UTM zone 1N,2000,projected,4400,,4326,16001,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32602,WGS 84 / UTM zone 2N,2002,projected,4400,,4326,16002,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32603,WGS 84 / UTM zone 3N,2004,projected,4400,,4326,16003,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32604,WGS 84 / UTM zone 4N,2006,projected,4400,,4326,16004,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32605,WGS 84 / UTM zone 5N,2008,projected,4400,,4326,16005,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32606,WGS 84 / UTM zone 6N,2010,projected,4400,,4326,16006,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32607,WGS 84 / UTM zone 7N,2012,projected,4400,,4326,16007,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32608,WGS 84 / UTM zone 8N,2014,projected,4400,,4326,16008,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32609,WGS 84 / UTM zone 9N,2016,projected,4400,,4326,16009,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32610,WGS 84 / UTM zone 10N,2018,projected,4400,,4326,16010,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32611,WGS 84 / UTM zone 11N,2020,projected,4400,,4326,16011,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32612,WGS 84 / UTM zone 12N,2022,projected,4400,,4326,16012,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32613,WGS 84 / UTM zone 13N,2024,projected,4400,,4326,16013,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32614,WGS 84 / UTM zone 14N,2026,projected,4400,,4326,16014,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32615,WGS 84 / UTM zone 15N,2028,projected,4400,,4326,16015,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32616,WGS 84 / UTM zone 16N,2030,projected,4400,,4326,16016,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32617,WGS 84 / UTM zone 17N,2032,projected,4400,,4326,16017,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32618,WGS 84 / UTM zone 18N,2034,projected,4400,,4326,16018,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32619,WGS 84 / UTM zone 19N,2036,projected,4400,,4326,16019,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32620,WGS 84 / UTM zone 20N,2038,projected,4400,,4326,16020,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32621,WGS 84 / UTM zone 21N,2040,projected,4400,,4326,16021,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32622,WGS 84 / UTM zone 22N,2042,projected,4400,,4326,16022,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32623,WGS 84 / UTM zone 23N,2044,projected,4400,,4326,16023,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32624,WGS 84 / UTM zone 24N,2046,projected,4400,,4326,16024,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32625,WGS 84 / UTM zone 25N,2048,projected,4400,,4326,16025,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32626,WGS 84 / UTM zone 26N,2050,projected,4400,,4326,16026,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32627,WGS 84 / UTM zone 27N,2052,projected,4400,,4326,16027,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32628,WGS 84 / UTM zone 28N,2054,projected,4400,,4326,16028,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32629,WGS 84 / UTM zone 29N,2056,projected,4400,,4326,16029,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32630,WGS 84 / UTM zone 30N,2058,projected,4400,,4326,16030,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32631,WGS 84 / UTM zone 31N,2060,projected,4400,,4326,16031,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32632,WGS 84 / UTM zone 32N,2062,projected,4400,,4326,16032,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32633,WGS 84 / UTM zone 33N,2064,projected,4400,,4326,16033,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32634,WGS 84 / UTM zone 34N,2066,projected,4400,,4326,16034,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32635,WGS 84 / UTM zone 35N,2068,projected,4400,,4326,16035,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32636,WGS 84 / UTM zone 36N,2070,projected,4400,,4326,16036,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32637,WGS 84 / UTM zone 37N,2072,projected,4400,,4326,16037,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32638,WGS 84 / UTM zone 38N,2074,projected,4400,,4326,16038,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32639,WGS 84 / UTM zone 39N,2076,projected,4400,,4326,16039,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32640,WGS 84 / UTM zone 40N,2078,projected,4400,,4326,16040,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32641,WGS 84 / UTM zone 41N,2080,projected,4400,,4326,16041,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32642,WGS 84 / UTM zone 42N,2082,projected,4400,,4326,16042,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32643,WGS 84 / UTM zone 43N,2084,projected,4400,,4326,16043,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32644,WGS 84 / UTM zone 44N,2086,projected,4400,,4326,16044,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32645,WGS 84 / UTM zone 45N,2088,projected,4400,,4326,16045,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32646,WGS 84 / UTM zone 46N,2090,projected,4400,,4326,16046,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32647,WGS 84 / UTM zone 47N,2092,projected,4400,,4326,16047,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32648,WGS 84 / UTM zone 48N,2094,projected,4400,,4326,16048,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32649,WGS 84 / UTM zone 49N,2096,projected,4400,,4326,16049,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32650,WGS 84 / UTM zone 50N,2098,projected,4400,,4326,16050,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32651,WGS 84 / UTM zone 51N,2100,projected,4400,,4326,16051,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32652,WGS 84 / UTM zone 52N,2102,projected,4400,,4326,16052,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32653,WGS 84 / UTM zone 53N,2104,projected,4400,,4326,16053,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32654,WGS 84 / UTM zone 54N,2106,projected,4400,,4326,16054,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32655,WGS 84 / UTM zone 55N,2108,projected,4400,,4326,16055,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32656,WGS 84 / UTM zone 56N,2110,projected,4400,,4326,16056,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32657,WGS 84 / UTM zone 57N,2112,projected,4400,,4326,16057,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32658,WGS 84 / UTM zone 58N,2114,projected,4400,,4326,16058,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32659,WGS 84 / UTM zone 59N,2116,projected,4400,,4326,16059,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32660,WGS 84 / UTM zone 60N,2118,projected,4400,,4326,16060,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32661,WGS 84 / UPS North,1996,projected,4400,,4326,16061,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-09-12 00:00:00,,1,0
+32662,WGS 84 / Plate Carree,1262,projected,4499,,4326,19968,,,Graticule coordinates expressed in simple Cartesian form.,Origin is at intersection of equator and Greenwich meridian. Note: this is not the same as plotting unrectified graticule coordinates on a computer display using the so-called pseudo Plate Carr�e method: here the grid units are metres.,EPSG,EPSG,2001-11-06 00:00:00,,1,0
+32700,WGS 84 / UTM grid system (southern hemisphere),1999,projected,4400,,4326,16100,,,For strict use within zone boundaries,Use WGS 84 / UTM zone xx S (codes 32701-32760) for use outwith zone boundary or when easting is not prefixed by zone number.,EPSG,EPSG,2001-06-05 00:00:00,,1,0
+32701,WGS 84 / UTM zone 1S,2001,projected,4400,,4326,16101,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32702,WGS 84 / UTM zone 2S,2003,projected,4400,,4326,16102,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32703,WGS 84 / UTM zone 3S,2005,projected,4400,,4326,16103,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32704,WGS 84 / UTM zone 4S,2007,projected,4400,,4326,16104,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32705,WGS 84 / UTM zone 5S,2009,projected,4400,,4326,16105,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32706,WGS 84 / UTM zone 6S,2011,projected,4400,,4326,16106,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32707,WGS 84 / UTM zone 7S,2013,projected,4400,,4326,16107,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32708,WGS 84 / UTM zone 8S,2015,projected,4400,,4326,16108,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32709,WGS 84 / UTM zone 9S,2017,projected,4400,,4326,16109,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32710,WGS 84 / UTM zone 10S,2019,projected,4400,,4326,16110,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32711,WGS 84 / UTM zone 11S,2021,projected,4400,,4326,16111,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32712,WGS 84 / UTM zone 12S,2023,projected,4400,,4326,16112,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32713,WGS 84 / UTM zone 13S,2025,projected,4400,,4326,16113,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32714,WGS 84 / UTM zone 14S,2027,projected,4400,,4326,16114,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32715,WGS 84 / UTM zone 15S,2029,projected,4400,,4326,16115,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32716,WGS 84 / UTM zone 16S,2031,projected,4400,,4326,16116,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32717,WGS 84 / UTM zone 17S,2033,projected,4400,,4326,16117,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32718,WGS 84 / UTM zone 18S,2035,projected,4400,,4326,16118,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32719,WGS 84 / UTM zone 19S,2037,projected,4400,,4326,16119,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32720,WGS 84 / UTM zone 20S,2039,projected,4400,,4326,16120,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32721,WGS 84 / UTM zone 21S,2041,projected,4400,,4326,16121,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32722,WGS 84 / UTM zone 22S,2043,projected,4400,,4326,16122,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32723,WGS 84 / UTM zone 23S,2045,projected,4400,,4326,16123,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32724,WGS 84 / UTM zone 24S,2047,projected,4400,,4326,16124,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32725,WGS 84 / UTM zone 25S,2049,projected,4400,,4326,16125,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32726,WGS 84 / UTM zone 26S,2051,projected,4400,,4326,16126,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32727,WGS 84 / UTM zone 27S,2053,projected,4400,,4326,16127,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32728,WGS 84 / UTM zone 28S,2055,projected,4400,,4326,16128,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32729,WGS 84 / UTM zone 29S,2057,projected,4400,,4326,16129,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32730,WGS 84 / UTM zone 30S,2059,projected,4400,,4326,16130,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32731,WGS 84 / UTM zone 31S,2061,projected,4400,,4326,16131,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32732,WGS 84 / UTM zone 32S,2063,projected,4400,,4326,16132,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32733,WGS 84 / UTM zone 33S,2065,projected,4400,,4326,16133,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32734,WGS 84 / UTM zone 34S,2067,projected,4400,,4326,16134,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32735,WGS 84 / UTM zone 35S,2069,projected,4400,,4326,16135,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32736,WGS 84 / UTM zone 36S,2071,projected,4400,,4326,16136,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32737,WGS 84 / UTM zone 37S,2073,projected,4400,,4326,16137,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32738,WGS 84 / UTM zone 38S,2075,projected,4400,,4326,16138,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32739,WGS 84 / UTM zone 39S,2077,projected,4400,,4326,16139,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32740,WGS 84 / UTM zone 40S,2079,projected,4400,,4326,16140,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32741,WGS 84 / UTM zone 41S,2081,projected,4400,,4326,16141,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32742,WGS 84 / UTM zone 42S,2083,projected,4400,,4326,16142,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32743,WGS 84 / UTM zone 43S,2085,projected,4400,,4326,16143,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32744,WGS 84 / UTM zone 44S,2087,projected,4400,,4326,16144,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32745,WGS 84 / UTM zone 45S,2089,projected,4400,,4326,16145,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32746,WGS 84 / UTM zone 46S,2091,projected,4400,,4326,16146,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32747,WGS 84 / UTM zone 47S,2093,projected,4400,,4326,16147,,,Large and medium scale topographic mapping and engineering survey.Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32748,WGS 84 / UTM zone 48S,2095,projected,4400,,4326,16148,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32749,WGS 84 / UTM zone 49S,2097,projected,4400,,4326,16149,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32750,WGS 84 / UTM zone 50S,2099,projected,4400,,4326,16150,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32751,WGS 84 / UTM zone 51S,2101,projected,4400,,4326,16151,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32752,WGS 84 / UTM zone 52S,2103,projected,4400,,4326,16152,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32753,WGS 84 / UTM zone 53S,2105,projected,4400,,4326,16153,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32754,WGS 84 / UTM zone 54S,2107,projected,4400,,4326,16154,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,2002-06-22 00:00:00,2002.151,1,0
+32755,WGS 84 / UTM zone 55S,2109,projected,4400,,4326,16155,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32756,WGS 84 / UTM zone 56S,2111,projected,4400,,4326,16156,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32757,WGS 84 / UTM zone 57S,2113,projected,4400,,4326,16157,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32758,WGS 84 / UTM zone 58S,2115,projected,4400,,4326,16158,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32759,WGS 84 / UTM zone 59S,2117,projected,4400,,4326,16159,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32760,WGS 84 / UTM zone 60S,2119,projected,4400,,4326,16160,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1995-06-02 00:00:00,,1,0
+32761,WGS 84 / UPS South,1997,projected,4400,,4326,16161,,,Large and medium scale topographic mapping and engineering survey.,,,EPSG,1996-09-12 00:00:00,,1,0
+32766,WGS 84 / TM 36 SE,1726,projected,4400,,4326,16636,,,Used for oil exploration by BP Mozambique for Offshore Zambezi block oil exploration.,,BP Mozambique.,EPSG,1998-11-11 00:00:00,,1,0
diff --git a/src/tiff/csv/coordinate_system.csv b/src/tiff/csv/coordinate_system.csv
new file mode 100644
index 0000000..cb73572
--- /dev/null
+++ b/src/tiff/csv/coordinate_system.csv
@@ -0,0 +1,38 @@
+"COORD_SYS_CODE","COORD_SYS_NAME","COORD_SYS_TYPE","DIMENSION","REMARKS","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","DEPRECATED"
+4400,"Cartesian 2D CS.  Axes: easting, northing (E,N). Orientations: east, north.  UoM: m.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4401,"Cartesian 2D CS.  Axes: easting, northing (E,N). Orientations: east, north.  UoM: chBnB.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4402,"Cartesian 2D CS.  Axes: easting, northing (E,N). Orientations: east, north.  UoM: chSe.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4403,"Cartesian 2D CS.  Axes: easting, northing (E,N). Orientations: east, north.  UoM: ftCla.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4404,"Cartesian 2D CS.  Axes: easting, northing (E,N). Orientations: east, north.  UoM: ftGC.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4405,"Cartesian 2D CS.  Axes: easting, northing (E,N). Orientations: east, north.  UoM: ftSe.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4406,"Cartesian 2D CS.  Axes: easting, northing (E,N). Orientations: east, north.  UoM: km.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4407,"Cartesian 2D CS.  Axes: easting, northing (E,N). Orientations: east, north.  UoM: lkCla.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4408,"Cartesian 2D CS.  Axes: easting, northing (E,N). Orientations: east, north.  UoM: ydInd.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4409,"Cartesian 2D CS.  Axes: easting, northing (E,N). Orientations: east, north.  UoM: ydSe.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4495,"Cartesian 2D CS.  Axes: easting, northing (X,Y). Orientations: east, north.  UoM: ft.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-11-06 00:00:00,,0
+4496,"Cartesian 2D CS.  Axes: easting, northing [E(X),N(Y)]. Orientations: east, north.  UoM: m.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4497,"Cartesian 2D CS.  Axes: easting, northing (X,Y). Orientations: east, north.  UoM: ftUS.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4498,"Cartesian 2D CS.  Axes: easting, northing (Y,X). Orientations: east, north.  UoM: m.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4499,"Cartesian 2D CS.  Axes: easting, northing (X,Y). Orientations: east, north.  UoM: m.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4500,"Cartesian 2D CS.  Axes: northing, easting (N,E). Orientations: north, east.  UoM: m.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4501,"Cartesian 2D CS.  Axes: northing, westing (N,E). Orientations: north, west.  UoM: m.",Cartesian,2,Used in Danish projected coordinate reference systems. Note that second axis has abbreviation E but is positive west.,EPSG,EPSG,2002-01-26 00:00:00,,0
+4530,"Cartesian 2D CS.  Axes: northing, easting (X,Y). Orientations: north, east.  UoM: m.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4531,"Cartesian 2D CS.  Axes: northing, easting (x,y). Orientations: north, east.  UoM: m.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+4532,"Cartesian 2D CS.  Axes: northing, easting (Y,X). Orientations: north, east.  UoM: m.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+6401,"Ellipsoidal 3D CS. Axes: latitude, longitude, ellipsoidal height. Orientations: east, north, up.  UoM: DMSH,metres.",ellipsoidal,3,Used in geographic 3D coordinate reference systems.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6402,"Ellipsoidal 2D CS. Axes: latitude, longitude. Orientations: east, north.  UoM: DMSH.",ellipsoidal,2,Used in geographic 2D coordinate reference systems.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6403,"Ellipsoidal 2D CS. Axes: latitude, longitude. Orientations: east, north.  UoM: grads.",ellipsoidal,2,Used in geographic 2D coordinate reference systems.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6404,"Spherical 3D CS. Axes: latitude, longitude, radius. Orientations: north, east, up.  UoM: degrees, degrees, metres.",spherical,3,Used in geocentric 3D coordinate reference systems.,Open GIS Consortium,EPSG,2002-06-22 00:00:00,2002.30,0
+6497,Gravity-related CS. Axis: height (H). Orientation: up.  UoM: ftUS.,gravity-related,1,Used in vertical coordinate reference systems.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6498,Gravity-related CS. Axis: depth (D). Orientation: down.  UoM: m.,gravity-related,1,Used in vertical coordinate reference systems.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6499,Gravity-related CS. Axis: height (H). Orientation: up.  UoM: m.,gravity-related,1,Used in vertical coordinate reference systems.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6500,"Earth centred, earth fixed, righthanded 3D coordinate system, consisting of 3 orthogonal axes with X and Y axes in the equatorial plane,  positive Z-axis parallel to mean earth rotation axis and pointing towards North Pole. UoM: m.",Cartesian,3,"Cartesian 3D CS, used in geocentric coordinate reference systems.",EPSG,EPSG,2001-01-19 00:00:00,,0
+6501,"Cartesian 2D CS.  Axes: southing, westing (X,Y). Orientations: south, west.  UoM: m.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+6502,"Cartesian 2D CS.  Axes: westing, southing (Y,X). Orientations: west, south.  UoM: GLM.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+6503,"Cartesian 2D CS.  Axes: westing, southing (Y,X). Orientations: west, south.  UoM: m.",Cartesian,2,Used in projected and engineering coordinate reference systems.,EPSG,EPSG,2001-04-29 00:00:00,,0
+6504,"Cartesian 2D CS.  Axes: plant N, Plant E (n,e). Orientations: northwest, northeast.  UoM: m.",Cartesian,2,Used in engineering coordinate reference systems.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6505,"Cartesian 2D CS.  Axes: 1st local axis, 2nd local axis (n,e). Orientations: northwest, northeast.  UoM: m.",Cartesian,2,Used in engineering coordinate reference systems.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6506,"Cartesian 2D CS.  Axes: 1st local axis, 2nd local axis (I,J). Orientations: ese/nne.  UoM: 165 x 330 ftUS.",Cartesian,2,Used in engineering coordinate reference systems for seismic bin grids.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6507,"Cartesian 2D CS.  Axes: 1st local axis, 2nd local axis (X,Y). Orientations: north, west.  UoM: m.",Cartesian,2,Used in engineering coordinate reference systems.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6508,"Cartesian 2D CS.  Axes: bin grid J, bin grid I (J,I). Orientations: nne/ese.  UoM: 12.5 x 25m.",Cartesian,2,Used in engineering coordinate reference systems for seismic bin grids.,EPSG,EPSG,2001-01-19 00:00:00,,0
+6509,"Cartesian 2D CS.  Axes: southing, westing (P,M). Orientations: south, west.  UoM: m.",Cartesian,2,Used in old projected coordinate reference systems in Portugal.,EPSG,EPSG,2002-07-13 00:00:00,,0
diff --git a/src/tiff/csv/datum.csv b/src/tiff/csv/datum.csv
new file mode 100644
index 0000000..3f0f49a
--- /dev/null
+++ b/src/tiff/csv/datum.csv
@@ -0,0 +1,332 @@
+"DATUM_CODE","DATUM_NAME","DATUM_TYPE","ORIGIN_DESCRIPTION","REALIZATION_EPOCH","ELLIPSOID_CODE","PRIME_MERIDIAN_CODE","AREA_OF_USE_CODE","DATUM_SCOPE","REMARKS","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","DEPRECATED"
+5100,Mean Sea Level,vertical,,,,,1262,Hydrography.,"msl has geographic and temporal components.  Users are advised to not use this generic vertical datum but to define specific instances of msl based on knowledge of these components; for instance ""msl at xxx during 19yy"".",,EPSG,1996-04-12 00:00:00,,0
+5101,Ordnance Datum Newlyn,vertical,,,,,1264,"Topographic mapping, geodesy.",,,EPSG,1996-10-18 00:00:00,,0
+5102,National Geodetic Vertical Datum 1929,vertical,26 tide gauges in the US and Canada.,1929,,,1323,"Topographic mapping, geodesy.",,,EPSG,1996-09-12 00:00:00,,0
+5103,North American Vertical Datum 1988,vertical,"Father's Point, Rimouski, Quebec.",1988,,,1325,"Topographic mapping, geodesy.",,,EPSG,1996-09-12 00:00:00,,0
+5104,Yellow Sea 1956,vertical,2 years tide readings at Qingdao.,1956,,,1067,"Topographic mapping, geodesy.",Superseded by Yellow Sea 1985 datum.,,EPSG,2002-06-22 00:00:00,2002.16,0
+5105,Baltic Sea,vertical,Average water level at Kronshtadt,,,,1284,"Topographic mapping, geodesy.",,,EPSG,1996-09-12 00:00:00,,0
+5106,Caspian Sea,vertical,Defined as -28.0m Baltic datum,,,,1291,Hydrography.,,,EPSG,1996-09-12 00:00:00,,0
+5107,Nivellement general de la France,vertical,Mean sea level at Marseille,,,,1326,"Topographic mapping, geodesy.",The CNIG states that NGF is a general term applying to all vertical network readjustments of France and recommends more specific terminology. See codes 5118-5120.,"Conseil National de l'Information Geographique groupe de travail ""Reseaux de Nivellement"" recommendations v5.1 April 1994.",EPSG,1996-09-12 00:00:00,,1
+5109,Normaal Amsterdams Peil,vertical,,,,,1172,"Topographic mapping, geodesy, hydrography.",,Nederlandse Commissie voor Geodesie publication 30; 1993,EPSG,1996-09-12 00:00:00,,0
+5110,Oostende,vertical,Mean low water during 1958,1958,,,1044,"Topographic mapping, geodesy.",,Nederlandse Commissie voor Geodesie publication 30; 1993,EPSG,1996-09-12 00:00:00,,0
+5111,Australian Height Datum,vertical,MSL 1966-68 at 30 gauges around coast.,1968,,,1281,"Topographic mapping, geodesy.",,http://www.auslig.gov.au/geodesy,EPSG,1996-09-12 00:00:00,,0
+5112,Australian Height Datum (Tasmania),vertical,MSL 1972 at Hobart and Burnie.,1972,,,1282,"Topographic mapping, geodesy.",,,EPSG,1996-09-12 00:00:00,,0
+5113,Sea Level,vertical,,,,,1262,Hydrography.,An unspecified local vertical datum not recommended for use.,,EPSG,1996-09-12 00:00:00,,0
+5114,Canadian Vertical Datum of 1928,vertical,,1928,,,1289,"Topographic mapping, geodesy.",,,EPSG,1996-12-12 00:00:00,,0
+5115,Piraeus Harbour 1986,vertical,MSL determined during 1986.,1986,,,1106,"Topographic mapping, geodesy.",,Geodesy Department; Public Pertoleum Corporation of Greece,EPSG,1997-06-16 00:00:00,,0
+5116,Helsinki 1960,vertical,MSL at Helsinki during 1960.,1960,,,1095,"Topographic mapping, geodesy.",,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,0
+5117,Rikets hoghtsystem 1970,vertical,,1970,,,1225,"Topographic mapping, geodesy.",,National Land Survey of Sweden,EPSG,1997-11-13 00:00:00,,0
+5118,Nivellement general de la France - Lalle,vertical,Mean sea level at Marseille.,,,,1326,"Geodesy, topographic mapping, engineering survey.",,"Conseil National de l'Information Geographique groupe de travail ""Reseaux de Nivellement"" recommendations v5.1 April 1994.",EPSG,1997-11-13 00:00:00,2001.47,0
+5119,Nivellement general de la France - IGN69,vertical,Mean sea level at Marseille.,1969,,,1326,"Geodesy, topographic mapping, engineering survey.",,"Conseil National de l'Information Geographique groupe de travail ""Reseaux de Nivellement"" recommendations v5.1 April 1994.",EPSG,1997-11-13 00:00:00,2001.47,0
+5120,Nivellement general de la France - IGN78,vertical,,1978,,,1327,"Geodesy, topographic mapping, engineering survey.",,"Conseil National de l'Information Geographique groupe de travail ""Reseaux de Nivellement"" recommendations v5.1 April 1994.",EPSG,1997-11-13 00:00:00,2001.47,0
+5121,Maputo,vertical,Mean sea level at Maputo.,,,,1167,Topographic mapping.,,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,0
+5122,Japanese Standard Levelling Datum 1949,vertical,24.4140 metres above mean sea level Tokyo Bay.,1949,,,1129,"Topographic mapping, geodesy.",,Ministry of Construction; Japan.  http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,2002.08,0
+5123,PDO Height Datum 1993,vertical,,1993,,,1183,Oil industry mapping.,Misclosure between Muscat and Salalah less than .5 meters with differences from of up to 5 meters from old Fahud Datum.  The PHD93 adjustment was initially known as the Spine.  Supercedes Fahud Vertical Datum (Code 5124) from 1993.,Petroleum Development Oman,EPSG,1999-04-22 00:00:00,,0
+5124,Fahud Height Datum,vertical,,,,,1183,Oil industry mapping.,Superceded by PHD93 Datum (Code 5123) in 1993.  Based on reciprocal trigonometric heighting based on single MSL determination at Mina Al Fahal.,Petroleum Development Oman,EPSG,1999-04-22 00:00:00,,0
+5125,Ha Tien 1960,vertical,,1960,,,1302,"Topographic mapping, geodesy.",In Vietnam replaced by Hon Dau in 1992.,,EPSG,1999-10-20 00:00:00,,0
+5126,Hon Dau 1992,vertical,,1992,,,1252,"Topographic mapping, geodesy.",Supersedes Ha Tien in Vietnam.,,EPSG,1999-10-20 00:00:00,,0
+5127,Landesnivellement 1902,vertical,Origin at Repere Pierre du Niton (RPN) 373.6 metres above msl derived at Marseille.,1902,,,1286,"Topographic mapping, geodesy.",,Bundesamt f�r Landestopographie,EPSG,1999-10-20 00:00:00,,0
+5128,Landeshohennetz 1995,vertical,Origin at Repere Pierre du Niton (RPN) 373.6 metres above msl derived at Marseille.,1995,,,1286,"Geodesy, cadastre, topographic mapping, engineering survey.",,Bundesamt f�r Landestopographie,EPSG,1999-10-20 00:00:00,,0
+5129,European Vertical Reference Frame 2000,vertical,Geopotential number at Normaal Amsterdams Peil is zero.,2000,,,1299,Geodesy.,Realised by geopotential numbers and normal heights of the United European Levelling Network.,,EPSG,2000-10-19 00:00:00,,0
+5130,Malin Head,vertical,Mean sea level between January 1960 and December 1969.,1970,,,1305,Topographic mapping,,Ordnance Survey Ireland,EPSG,2001-11-06 00:00:00,,0
+5131,Belfast,vertical,"Mean sea level between 1951 and 1956 at Clarendon Dock, Belfast.",1957,,,2530,Large scale topographic mapping,,Ordnance Survey Northern Ireland,EPSG,2001-11-06 00:00:00,,0
+5132,Dansk Normal Nul,vertical,,,,,1080,Topographic mapping and engineering survey,,Kort & Matrikelstyrelsen,EPSG,2001-11-06 00:00:00,,0
+5133,AIOC 1995,vertical,Average level of Caspian Sea at the Oil Rocks tide gauge June-September 1995.,1995,,,2592,Oil industry mapping.,AIOC 1995 datum is 1.7m above Caspian datum and 26.3m below Baltic datum.,BP,EPSG,2002-02-12 00:00:00,,0
+5134,Black Sea,vertical,,,,,1102,Hydrographic surveying and since break-up of Former Soviet Union also topographic mapping.,Black Sea datum is 0.4m below Baltic datum.,BP,EPSG,2002-02-12 00:00:00,,0
+5135,Hong Kong Principal Datum,vertical,"1.23m below the mean of 19 years (1965-83) observations of tide levels at North Point, Victoria Harbour.",1980,,,1118,"Geodesy, engineering survey, cadastre.",,"Survey and Mapping Office, Lands Department. Http://www.info.gov.hk/landsd/mapping/tindex.htm",EPSG,2002-06-22 00:00:00,,0
+5136,Hong Kong Chart Datum,vertical,Approximates to Lowest Astronomic Tide level (LAT).,,,,1118,Hydrographic survey and charting.,Chart datum is 0.15 metres below Hong Kong Principal Datum (code 5135) and 1.38m below MSL at Quarry Bay.,"Survey and Mapping Office, Lands Department. Http://www.info.gov.hk/landsd/mapping/tindex.htm",EPSG,2002-06-22 00:00:00,,0
+5137,Yellow Sea 1985,vertical,20 years tide readings at Qingdao.,1985,,,1067,"Topographic mapping, geodesy.",Supersedes Yellow Sea 1956 datum.,Guangdong Province Land Resource Information Centre,EPSG,2002-06-22 00:00:00,,0
+6001,Not specified (based on Airy 1830 ellipsoid),geodetic,,,7001,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6002,Not specified (based on Airy Modified 1849 ellipsoid),geodetic,,,7002,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6003,Not specified (based on Australian National Spheroid),geodetic,,,7003,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6004,Not specified (based on Bessel 1841 ellipsoid),geodetic,,,7004,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6005,Not specified (based on Bessel Modified ellipsoid),geodetic,,,7005,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6006,Not specified (based on Bessel Namibia ellipsoid),geodetic,,,7046,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2001-01-21 00:00:00,96.08  2000.42  2001.15,0
+6007,Not specified (based on Clarke 1858 ellipsoid),geodetic,,,7007,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6008,Not specified (based on Clarke 1866 ellipsoid),geodetic,,,7008,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6009,Not specified (based on Clarke 1866 Michigan ellipsoid),geodetic,,,7009,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6010,Not specified (based on Clarke 1880 (Benoit) ellipsoid),geodetic,,,7010,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6011,Not specified (based on Clarke 1880 (IGN) ellipsoid),geodetic,,,7011,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6012,Not specified (based on Clarke 1880 (RGS) ellipsoid),geodetic,,,7012,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6013,Not specified (based on Clarke 1880 (Arc) ellipsoid),geodetic,,,7013,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6014,Not specified (based on Clarke 1880 (SGA 1922) ellipsoid),geodetic,,,7014,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6015,Not specified (based on Everest 1830 (1937 Adjustment) ellipsoid),geodetic,,,7015,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6016,Not specified (based on Everest 1830 (1967 Definition) ellipsoid),geodetic,,,7016,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6018,Not specified (based on Everest 1830 Modified ellipsoid),geodetic,,,7018,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6019,Not specified (based on GRS 1980 ellipsoid),geodetic,,,7019,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6020,Not specified (based on Helmert 1906 ellipsoid),geodetic,,,7020,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6021,Not specified (based on Indonesian National Spheroid),geodetic,,,7021,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6022,Not specified (based on International 1924 ellipsoid),geodetic,,,7022,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6024,Not specified (based on Krassowsky 1940 ellipsoid),geodetic,,,7024,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6025,Not specified (based on NWL 9D ellipsoid),geodetic,,,7025,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6027,Not specified (based on Plessis 1817 ellipsoid),geodetic,,,7027,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6028,Not specified (based on Struve 1860 ellipsoid),geodetic,,,7028,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6029,Not specified (based on War Office ellipsoid),geodetic,,,7029,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6030,Not specified (based on WGS 84 ellipsoid),geodetic,,,7030,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6031,Not specified (based on GEM 10C ellipsoid),geodetic,,,7031,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6032,Not specified (based on OSU86F ellipsoid),geodetic,,,7032,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6033,Not specified (based on OSU91A ellipsoid),geodetic,,,7033,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6034,Not specified (based on Clarke 1880 ellipsoid),geodetic,,,7034,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,96.08  2000.42,0
+6035,Not specified (based on Authalic Sphere),geodetic,,,7035,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown. Deprecated and superseded by 6047.,EPSG,EPSG,2001-06-05 00:00:00,96.08  2000.42,1
+6036,Not specified (based on GRS 1967 ellipsoid),geodetic,,,7036,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0
+6041,Not specified (based on Average Terrestrial System 1977 ellipsoid),geodetic,,,7041,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0
+6042,Not specified (based on Everest (1830 Definition) ellipsoid),geodetic,,,7042,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0
+6043,Not specified (based on WGS 72 ellipsoid),geodetic,,,7043,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0
+6044,Not specified (based on Everest 1830 (1962 Definition) ellipsoid),geodetic,,,7044,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0
+6045,Not specified (based on Everest 1830 (1975 Definition) ellipsoid),geodetic,,,7045,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2000-05-03 00:00:00,2000.42,0
+6047,Not specified (based on GRS 1980 Authalic Sphere),geodetic,,,7047,8901,1263,Not a valid datum.,Included for coordinate reference systems where datum is unknown.,EPSG,EPSG,2001-06-25 00:00:00,2001.19,0
+6120,Greek,geodetic,Fundamental point: Athens Observatory; latitude 37 deg 58 min 20.132 sec N; longitude 23 deg 42 min 58.815 sec E of Greenwich,,7004,8901,1106,Topographic mapping.,See geodetic datum alias 6404.  Used as basis of topographic mapping based on Hatt projection.,Topography Department; National Technical University of Athens,EPSG,1997-06-16 00:00:00,,0
+6121,Greek Geodetic Reference System 1987,geodetic,Fundamental point: Dionysos; latitude 38 deg 04 min 33.8 sec N; longitude 23 deg 55 min 51.0 sec E of Greenwich; geoid height 7.0 m.,1987,7019,8901,1106,Topographic mapping.,Superseded (old) Greek datum.  Oil industry work based on ED50.,L. Portokalakis; Public Petroleum Corporation of Greece,EPSG,1997-06-16 00:00:00,,0
+6122,Average Terrestrial System 1977,geodetic,,1977,7041,8901,1283,Topographic mapping.,In use from 1979.  To be phased out in late 1990's.,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,1997-07-02 00:00:00,,0
+6123,Kartasto Koordinaati Jarjestelma 1966,geodetic,Adjustment with fundamental point SF31 based on ED50 transformed to best fit the older VVJ adjustment.,1966,7022,8901,1095,"Geodesy, cadastre, topographic mapping, engineering survey.",Adopted in 1970.,www.nls.fi/maa/papers/kkj.html,EPSG,1997-07-22 00:00:00,,0
+6124,Rikets koordinatsystem 1990,geodetic,,1982,7004,8901,1225,"Geodesy, cadastre, topographic mapping, engineering survey.",Supersedes RT38 adjustment (datum code 6308),National Land Survey of Sweden,EPSG,1997-11-13 00:00:00,,0
+6125,Samboja,geodetic,Original origin station P2 Exc now destroyed.  Extensions recomputed using Toran station T9 as origin.,,7004,8901,1328,Topographic mapping.,,Total Indonesia.,EPSG,1997-11-13 00:00:00,,1
+6126,Lithuania 1994 (ETRS89),geodetic,Densification from 4  ETRS89 points.,1994,7019,8901,1145,"Topographic mapping, geodesy.",Densification of ETRS89 during the 1992 Baltic campaign.,HNIT-Baltic GeoInfoServisas,EPSG,1998-03-12 00:00:00,,0
+6127,Tete,geodetic,Fundamental point: Tete.,,7008,8901,1167,Topographic mapping.,,Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,0
+6128,Madzansua,geodetic,Fundamental point: Madzansua.,,7008,8901,1315,Topographic mapping.,Superseded by transformation to Tete datum (datum code 6127).,Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,0
+6129,Observatario,geodetic,Fundamental point: Maputo observatory.,,7008,8901,1329,Topographic mapping.,Superseded by transformation to Tete datum (datum code 6127).,Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,0
+6130,Moznet (ITRF94),geodetic,ITRF 1994 epoch 20,,7030,8901,1167,Topographic mapping.,,Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,1998-04-16 00:00:00,,0
+6131,Indian 1960,geodetic,,,7015,8901,1302,Topographic mapping.,DMA adjustment of IndoChina part of the Indian 1954 network to better fit local geoid.  Also known as Indian (DMA Reduced).,,EPSG,1998-11-11 00:00:00,,0
+6132,Final Datum 1958,geodetic,Fundamental point: Maniyur.  Latitude: 31 deg 23 min 59.19 sec N; Longitude: 48 deg 32 min 31.38 sec E (of Greenwich).,,7012,8901,1300,Oil industry mapping.,Network included in Nahrwan 1967 adjustment.,IOEPC records,EPSG,1998-11-11 00:00:00,,0
+6133,Estonia 1992,geodetic,Densification from 4  ETRS89 points.,1992,7019,8901,1090,"Topographic mapping, geodesy.",Based on ETRS89 as established during the 1992 Baltic campaign. Superseded by Estonia 1997 adjustment (code 6180).,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,1998-12-14 00:00:00,,0
+6134,PDO Survey Datum 1993,geodetic,Adjustment best fitted to Fahud network.,1993,7012,8901,1183,Oil industry mapping.,Supersedes Fahud datum (code 6232). Maximum differences to Fahud adjustment are 20 metres.,Petroleum Development Oman,EPSG,1999-04-22 00:00:00,,0
+6135,Old Hawaiian,geodetic,Fundamental Point: Oahu West Base Astro.  Latitude: 21 deg 18 min 13.89 sec N; longitude 157 deg 50 min 55.79 sec W (of Greenwich),,7008,8901,1334,Topographic mapping.,Hawaiian Islands were never on NAD27 but rather on Old Hawaiian Datum.  NADCON conversion program provides transformation from Old Hawaiian Datum to NAD83 (original 1986 realization) but making the transformation appear to user as if from NAD27.,http://www.ngs.noaa.gov/ (NADCON readme file) and t [...]
+6136,St. Lawrence Island,geodetic,,,7008,8901,1332,Topographic mapping.,Many Alaskan islands were never on NAD27 but rather on independent datums.  NADCON conversion program provides transformation from St. Lawrence Island Datum to NAD83 (original 1986 realization) - making the transformation appear to user as if from NAD27.,http://www.ngs.noaa.gov/ (NADCON readme file),EPSG,1999-05-24 00:00:00,,0
+6137,St. Paul Island,geodetic,,,7008,8901,1333,Topographic mapping.,Many Alaskan islands were never on NAD27 but rather on independent datums.  NADCON conversion program provides transformation from St. Paul Island Datum to NAD83 (original 1986 realization) - making the transformation appear to user as if from NAD27.,http://www.ngs.noaa.gov/ (NADCON readme file),EPSG,1999-05-24 00:00:00,,0
+6138,St. George Island,geodetic,,,7008,8901,1331,Topographic mapping.,Many Alaskan islands were never on NAD27 but rather on independent datums.  NADCON conversion program provides transformation from St. George Island Datum to NAD83 (original 1986 realization) - making the transformation appear to user as if from NAD27.,http://www.ngs.noaa.gov/ (NADCON readme file),EPSG,1999-05-24 00:00:00,,0
+6139,Puerto Rico,geodetic,,,7008,8901,1335,Topographic mapping.,NADCON conversion program provides transformation from Puerto Rico Datum to NAD83 (original 1986 realization) but making the transformation appear to user as if from NAD27.,Ordnance Survey of Great Britain and http://www.ngs.noaa.gov/ (NADCON readme file).,EPSG,1999-05-24 00:00:00,,0
+6140,NAD83 Canadian Spatial Reference System,geodetic,,1998,7019,8901,1336,Geodesy.,Supersedes ATS77 from 1999 in New Brunswick.,Service New Brunswick Land and Information Standards Manual,EPSG,1999-10-20 00:00:00,,0
+6141,Israel,geodetic,Fundamental Point:  Latitude: 31 deg 44 min 03.817 sec N; Longitude: 35 deg 12 min 16.261 sec E (of Greenwich).,,7019,8901,2603,Topographic mapping.,,Survey of Israel.,EPSG,2002-06-22 00:00:00,2002.34,0
+6142,Locodjo 1965,geodetic,Fundamental Point: T5 Banco. Latitude: 5 deg 18 min 50.5 sec N; Longitude: 4 deg 02 min 05.1 sec W (of Greenwich).,1965,7012,8901,1075,Topographic mapping.,,IGN Paris.,EPSG,1999-10-20 00:00:00,,0
+6143,Abidjan 1987,geodetic,Fundamental Point: Abidjan I. Latitude: 5 deg 18 min 51.01 sec N; Longitude: 4 deg 02 min 06.04 sec W (of Greenwich).,1987,7012,8901,1075,Topographic mapping.,,IGN Paris.,EPSG,1999-10-20 00:00:00,,0
+6144,Kalianpur 1937,geodetic,Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).,1937,7015,8901,1308,Topographic mapping.,Supersedes 1880 adjustment except for topographic mapping.  Superseded in Pakistan by 1962 metrication conversion and in India by 1975 metrication conversion.,"G. Bomford; ""The Re-adjustment of the Indian Triangulation""; Survey of India Professional Paper 28; 1939.",EPSG,1999-10-20 00:00:00,,0
+6145,Kalianpur 1962,geodetic,Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).,1962,7044,8901,1184,Topographic mapping.,1937 adjustment rescaled by ratio metric conversions of Indian foot (1937) to Indian foot (1962).,,EPSG,1999-10-20 00:00:00,,0
+6146,Kalianpur 1975,geodetic,Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).,1975,7045,8901,1121,Topographic mapping.,1937 adjustment rescaled by ratio metric conversions of Indian foot (1937) to Indian foot (1975).,,EPSG,1999-10-20 00:00:00,,0
+6147,Hanoi 1972,geodetic,,1972,7024,8901,1252,"Geodesy, cadastre, topographic mapping, engineering survey.",,PetroVietnam,EPSG,1999-10-20 00:00:00,,0
+6148,Hartebeesthoek94,geodetic,Coincident with ITRF91 (1994.0) at Hartebeesthoek astronomical observatory near Pretoria.,1994,7030,8901,1215,"Geodesy, cadastre, topographic mapping, engineering survey.",Supersedes Cape datum (code 6222).,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,2000-01-06 00:00:00,99.96,0
+6149,CH1903,geodetic,Fundamental Point: Old Bern observatory. Latitude: 46 deg 57 min  8.660 sec N; Longitude: 7 deg 26 min 22.500 sec E (of Greenwich).,1903,7004,8901,1286,Topographic mapping.,,Bundesamt f�r Landestopographie,EPSG,1999-10-20 00:00:00,,0
+6150,CH1903+,geodetic,Fundamental Point: Zimmerwald observatory.,,7004,8901,1286,"Geodesy, topographic mapping.",,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,2001-11-06 00:00:00,2001.52,0
+6151,Swiss Terrestrial Reference Frame 1995,geodetic,ETRF89 at 1993.0,1995,7019,8901,1286,"Geodesy, cadastre, topographic mapping, engineering survey.",,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,1999-10-20 00:00:00,,0
+6152,NAD83 (High Accuracy Regional Network),geodetic,,,7019,8901,1337,Geodesy.,,National Geodetic Survey,EPSG,1999-10-20 00:00:00,,0
+6153,Rassadiran,geodetic,Fundamental Point: Total1. Latitude: 27 deg 31 min 07.784 sec N; Longitude: 52 deg 36 min 12.741 sec E (of Greenwich).,,7022,8901,1338,Oil industry mapping.,,Total-Fina,EPSG,1999-11-20 00:00:00,,0
+6154,European Datum 1950(1977),geodetic,Extension of ED50 over Iran.,1977,7022,8901,1123,Topographic mapping.,Sometimes referred to as ED50-ED77.,National Cartographic Centre of Iran,EPSG,1999-11-20 00:00:00,,0
+6155,Dabola 1981,geodetic,,1981,7011,8901,1112,Topographic mapping.,,IGN Paris,EPSG,1999-12-09 00:00:00,,0
+6156,Jednotne Trigonometricke Site Katastralni,geodetic,"Modification of Austrian MGI datum, code 6312.",,7004,8901,1306,"Geodesy, cadastre, topographic mapping, engineering survey.",S-JTSK = System of the Unified Trigonometrical Cadastral Network.,Research Institute for Geodesy Topography and Cartography (VUGTK); Prague.,EPSG,2001-11-06 00:00:00,2001.26  2001.51,0
+6157,Mount Dillon,geodetic,Fundamental Point: Mount Dillon triangulation station. Latitude: 11 deg  15 min 07.843 sec N; Longitude: 60 deg 41 min 09.632 sec W (of Greenwich).,,7007,8901,1322,Topographic mapping.,,University of the West Indies Geodetic Services.,EPSG,2000-03-07 00:00:00,,0
+6158,Naparima 1955,geodetic,Fundamental Point: Naparima. Latitude: 10 deg 16 min 44.860 sec N; Longitude: 61 deg 27 min 34.620 sec W (of Greenwich).,1955,7022,8901,1339,Topographic mapping.,Naparima 1972 is an extension of the Naparima 1955 network of Trinidad to include Tobago.,Ordnance Survey International.,EPSG,2000-03-07 00:00:00,,0
+6159,European Libyan Datum 1979,geodetic,,1979,7022,8901,1143,Topographic mapping.,,Brown and Root,EPSG,2000-03-07 00:00:00,,0
+6160,Chos Malal 1914,geodetic,Chos Malal police station.,1914,7022,8901,1292,Oil industry mapping.,Also known as Quini-Huao.  Superseded by Campo Inchauspe (code 6221).,Various oil company records.,EPSG,2000-03-07 00:00:00,,0
+6161,Pampa del Castillo,geodetic,,,7022,8901,1265,Oil industry mapping.,Used in Comodoro Rivadavia area.  Superseded by Campo Inchauspe (code 6221).,Various oil company records.,EPSG,2000-03-07 00:00:00,,0
+6162,Korean Datum 1985,geodetic,Fundamental point: Suwon; latitude 37 deg 16 min 31.9034 sec N; longitude 127 deg 03 min 05.1451 sec E of Greenwich.,1985,7004,8901,1135,Topographic mapping.,,Clifford J. Mugnier; in Photogrammetric Engineering & Remote Sensing November 1999. http://www.asprs.org/resources.html,EPSG,2000-03-07 00:00:00,2001.28,0
+6163,Yemen National Geodetic Network 1996,geodetic,Sana'a IGN reference marker,1996,7030,8901,1257,Topographic mapping.,,IGN Paris,EPSG,2000-03-07 00:00:00,,0
+6164,South Yemen,geodetic,,,7024,8901,1340,Topographic mapping.,,IGN Paris,EPSG,2000-03-07 00:00:00,,0
+6165,Bissau,geodetic,,,7022,8901,1113,Topographic mapping.,,NIMA TR8350.2,EPSG,2000-03-07 00:00:00,,0
+6166,Korean Datum 1995,geodetic,,1995,7030,8901,1135,Topographic mapping.,,NIMA TR8350.2  ftp://164.214.2.65/pub/gg/tr8350.2/changes.pdf,EPSG,2000-05-08 00:00:00,,0
+6167,New Zealand Geodetic Datum 2000,geodetic,Based on ITRF96 epoch 2000.0,2000,7019,8901,1175,"Geodesy, cadastre, topographic mapping, engineering survey.",,Land Information New Zealand.,EPSG,2000-10-19 00:00:00,,0
+6168,Accra,geodetic,Fundamental Point: GCS Station 547. Latitude: 5 deg 23 min 43.3 sec N; Longitude: 0 deg 11 min 52.3 sec W (of Greenwich).,,7029,8901,1104,Topographic mapping.,Superseded in 1978 by Leigon datum (code 6250).,Ordnance Survey International,EPSG,2000-10-12 00:00:00,,0
+6169,American Samoa 1962,geodetic,,1962,7008,8901,1027,Topographic mapping.,,NIMA TR8350.2 revision of January 2000,EPSG,2000-10-19 00:00:00,,0
+6170,Sistema de Referencia Geocentrico para America del Sur,geodetic,ITRF94 epoch 1995.42.,1995,7019,8901,1342,Geodesy.,Realised by a frame of 58 stations observed in 1995 and adjusted in the ITRF94.,NIMA TR8350.2 revision of January 2000.,EPSG,2000-10-19 00:00:00,,0
+6171,Reseau Geodesique Francais 1993,geodetic,Coincident with ETRS89,1993,7019,8901,1096,Geodesy.,,TotalFinaElf,EPSG,2001-11-06 00:00:00,2001.51,0
+6172,Posiciones Geodesicas Argentinas,geodetic,,1994,7019,8901,1033,"Topographic mapping, geodesy.","Una red geod�sica de 127 puntos materializados
+en el terreno que definen el Sistema Geod�sico Nacional.  [A geodetic network of 127 points defining the National Geodetic System.] Superseded by POSGAR98 (code 6190).",http://www.igm.gov.ar/posgar.html,EPSG,2000-10-19 00:00:00,,1
+6173,IRENET95,geodetic,ETRS89 stations in Ireland,1995,7019,8901,1305,Geodesy.,Densification of ETRS89,Ordnance Survey of Ireland,EPSG,2000-10-19 00:00:00,,0
+6174,Sierra Leone Colony 1924,geodetic,Fundamental Point: Kortright. Latitude: 8 deg 28 min 44.4 sec N; Longitude: 13 deg 13 min 03.81 sec W (of Greenwich).,1924,7029,8901,1342,"Topographic mapping, engineering survey.",,Ordnance Survey International.,EPSG,2001-06-05 00:00:00,,0
+6175,Sierra Leone 1968,geodetic,Fundamental Point: SLX2 Astro. Latitude: 8 deg 27 min 17.567 sec N; Longitude: 12 deg 49 min 40.186 sec W (of Greenwich).,1968,7012,8901,1209,"Topographic mapping, engineering survey.",Extension and readjustment with additional observations of 1960 network.  Coordinates of 1960 stations change by less than 3 metres.,Ordnance Survey International.,EPSG,2001-06-05 00:00:00,,0
+6176,Australian Antarctic Datum 1998,geodetic,,1998,7019,8901,1278,Topographic mapping.,,Standards Australia,ISO 19127,2001-06-05 00:00:00,,0
+6178,Pulkovo 1942/83,geodetic,Fundamental Point: Pulkovo observatory. Latitude: 59 deg 46 min 18.550 sec N; Longitude: 30 deg 19 min 42.090 sec E (of Greenwich).,1983,7024,8901,1343,"Geodesy, cadastre, topographic mapping, engineering survey.",International adjustment of Uniforrm Astro-Geodetic Network of countries of central and eastern Europe.,Bundesamt f�r Kartographie und Geod�sie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,0
+6179,Pulkovo 1942/58,geodetic,Fundamental Point: Pulkovo observatory. Latitude: 59 deg 46 min 18.550 sec N; Longitude: 30 deg 19 min 42.090 sec E (of Greenwich).,1958,7024,8901,1192,"Geodesy, cadastre, topographic mapping, engineering survey.",,Glowny Urzad Geodezji i Kartografii via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,0
+6180,Estonia 1997,geodetic,Densification of ETRS89 during EUREF-ESTONIA97 campaign through transformation from ITRF96 epoch 1997.56.,1997,7019,8901,1090,"Geodesy, cadastre, topographic mapping, engineering survey.",Supersedes Estonia 1992 adjustment (code 6133).,Estonian National Land Board via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,0
+6181,Luxembourg 1930,geodetic,Northern station of Habay-la-Neuve baseline in Belgium.,1930,7022,8901,1146,"Geodesy, cadastre, topographic mapping, engineering survey.",,Administration du Cadastre et de la Topographie via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,0
+6182,Azores Occidental Islands 1939,geodetic,Fundamental Point: Observatario Meteorologico Flores.,1939,7022,8901,1344,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,0
+6183,Azores Central Islands 1948,geodetic,Fundamental Point: Graciosa west base.,1948,7022,8901,1301,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2002-07-13 00:00:00,2002.25,0
+6184,Azores Oriental Islands 1940,geodetic,Fundamental Point: Forte de S�o Bras.,1940,7022,8901,1345,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,0
+6185,Madeira 1936,geodetic,Fundamental Point: Madeira SE Base.,1936,7022,8901,1314,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon via EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,1
+6188,OSNI 1952,geodetic,Position fixed to the coordinates from the 19th century Principle Triangulation of station Divis. Scale and orientation controlled by position of Principle Triangulation stations Knocklayd and Trostan.,1952,7001,8901,2530,Geodesy and topographic mapping.,Superseded by 1975 Mapping Adjustment.,Ordnance Survey of Northern Ireland.,EPSG,2001-11-06 00:00:00,,0
+6189,Red Geodesica Venezolana,geodetic,Realised by a frame of 67 stations observed in 1995 as a densification of the SIRGAS campaign and adjusted in the ITRF94.,2000,7019,8901,1251,Geodesy.,,Servicio Autonomo de Geografia y Cartografia Nacional.,EPSG,2001-06-11 00:00:00,,0
+6190,Posiciones Geodesicas Argentinas 1998,geodetic,Densification of SIRGAS 1995; ITRF94 epoch 1995.42.,1998,7019,8901,1033,"Topographic mapping, geodesy.",Una red geod�sica de 127 puntos materializados en el terreno que definen el Sistema Geod�sico Nacional.  [A geodetic network of 127 points defining the National Geodetic System.] Supersedes the 1994 POSGAR adjustment (code 6172).,http://www.igm.gov.ar/posgar.html,EPSG,2001-11-06 00:00:00,,0
+6191,Albanian 1987,geodetic,,1987,7024,8901,1025,"Geodesy, cadastre, topographic mapping, engineering survey.",,EuroGeographics; http://crs.ifag.de/,EPSG,2001-11-06 00:00:00,,0
+6192,Douala 1948,geodetic,"South pillar of Doula base; 4deg 00min 40.64sec N, 9deg 42min 30.41sec E",1948,7022,8901,1060,Topographic mapping.,Superseded  by Manoca 1962 datum (code 6193).,TotalFinaElf,EPSG,2002-01-18 00:00:00,,0
+6193,Manoca 1962,geodetic,"Reservoir centre at the  Manoca tower (""tube Suel""), 3deg 51min 49.896sec N, 9deg 36min 49.347sec E.",1962,7011,8901,1060,Topographic mapping.,The intent of the Bukavu 1953 conference was to adopt the Clarke 1880 (RGN) ellipsoid (code 7012) but in practice this datum has used the IGN version.  Supersedes Douala 1948 (code 6192).,TotalFinaElf,EPSG,2002-01-18 00:00:00,,0
+6194,Qornoq 1927,geodetic,,1927,7022,8901,1107,Topographic mapping.,,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-18 00:00:00,,0
+6195,Scoresbysund 1952,geodetic,,1952,7022,8901,2570,Topographic mapping.,,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-18 00:00:00,,0
+6196,Ammassalik 1958,geodetic,,1958,7022,8901,2571,Topographic mapping.,,"Kort & Matrikelstyrelsen, Copenhagen.",EPSG,2002-01-18 00:00:00,,0
+6197,Garoua,geodetic,IGN astronomical station and benchmark no. 16 at Tongo; 8deg 55min 08.74sec N  13deg 30min 43.19sec E.,,7012,8901,2590,Topographic mapping.,,TotalFinaElf,EPSG,2002-02-12 00:00:00,,0
+6198,Kousseri,geodetic,IGN astronomical station Dabanga; 11deg 55min 05.9sec N  14deg 38min 40.8sec E.,,7012,8901,2591,Topographic mapping.,,TotalFinaElf,EPSG,2002-02-12 00:00:00,,0
+6199,Egypt 1930,geodetic,Fundamental Point: Station F1. Latitude: 30 deg 01 min 42.86 sec N; Longitude: 31 deg 16 min 37.05 sec E (of Greenwich).,1930,7022,8901,1086,Used for scientific purposes only.,"Note that Egypt 1930 uses the International 1924 ellipsoid, unlike the Egypt 1907 datum (code 6229) which uses the Helmert ellipsoid. Oil industry references to the Egypt 1930 datum name and the Helmert ellipsoid probably mean Egypt 1907 datum.",,EPSG,2002-02-12 00:00:00,,0
+6200,Pulkovo 1995,geodetic,Fundamental Point: Pulkovo observatory. Latitude: 59 deg 46 min 15.359 sec N; Longitude: 30 deg 19 min 28.318 sec E (of Greenwich).,1995,7024,8901,1198,Scientific adjustment.,,"""Main Terms of Reference for the State Geodetic Network""; Federal Geodetic Service of Russia; 1994",EPSG,1996-09-12 00:00:00,,0
+6201,Adindan,geodetic,Fundamental Point: Station 15; Adindan. Latitude: 22 deg 10 min  7.110 sec N; Longitude: 31 deg 29 min 21.608 sec E (of Greenwich).,,7012,8901,1271,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6202,Australian Geodetic Datum 1966,geodetic,Fundamental Point: Johnson Memorial. Latitude: 25 deg 56 min 54.551 sec S; Longitude: 133 deg 12 min 30.077 sec E (of Greenwich).,1966,7003,8901,1279,Topographic mapping.,,Australian Map Grid Technical Manual. National Mapping Council of Australia Technical Publication 7; 1972.,EPSG,1995-06-02 00:00:00,,0
+6203,Australian Geodetic Datum 1984,geodetic,,1984,7003,8901,1280,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6204,Ain el Abd 1970,geodetic,Fundamental Point: Ain El Abd.  Latitude: 28 deg  14 min 06.171 sec N; Longitude: 48 deg 16 min 20.906 sec E (of Greenwich).,1970,7022,8901,1272,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6205,Afgooye,geodetic,,,7024,8901,1214,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6206,Agadez,geodetic,,,7011,8901,1177,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6207,Lisbon 1937,geodetic,Fundamental Point: Castelo Sao Jorge; Lisbon. Latitude: 38 deg 42 min 43.631 sec N; Longitude: 9 deg 07 min 54.862 sec W (of Greenwich).,1937,7022,8901,1294,Topographic mapping.,Supersedes Lisbon 1890 adjustment (which used Bessel 1841 ellipsoid).,Instituto Geografico e Cadastral; Lisbon,EPSG,1995-06-02 00:00:00,2001.551,0
+6208,Aratu,geodetic,,,7022,8901,1274,Oil industry geodetic purposes.,,,EPSG,1995-06-02 00:00:00,,0
+6209,Arc 1950,geodetic,Fundamental Point: Buffelsfontein. Latitude: 33 deg 59 min 32.000 sec S; Longitude: 25 deg 30 min 44.622 sec E (of Greenwich).,1950,7013,8901,1276,"Topographic mapping, geodesy.",,,EPSG,1995-06-02 00:00:00,,0
+6210,Arc 1960,geodetic,Fundamental Point: Buffelsfontein. Latitude: 33 deg 59 min 32.000 sec S; Longitude: 25 deg 30 min 44.622 sec E (of Greenwich).,1960,7012,8901,1277,"Topographic mapping, geodesy.",,,EPSG,1995-06-02 00:00:00,,0
+6211,Batavia,geodetic,Fundamental Point: Longitude at Batavia Astro. Station. Latitude: 6 deg  7 min 39.520 sec S; Longitude: 106 deg 48 min 27.790 sec E (of Greenwich). Latitude and azimuth at Genuk.,,7004,8901,1285,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6212,Barbados 1938,geodetic,Fundamental point: HMS Challenger astro station M1; latitude 13 deg 04 min 32.53 sec N; longitude 59 deg 36 min 29.34 sec W (of Greenwich).,1938,7012,8901,1042,Topographic mapping.,,Ordnance Survey of Great Britain.,EPSG,1999-04-22 00:00:00,99.171,0
+6213,Beduaram,geodetic,,,7011,8901,1177,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6214,Beijing 1954,geodetic,,1954,7024,8901,1067,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6215,Reseau National Belge 1950,geodetic,Fundamental Point: Lommel (tower). Latitude: 51 deg 13 min 47.334 sec N; Longitude: 0 deg 56 min 44.773 sec E (of Brussels).,1950,7022,8901,1347,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6216,Bermuda 1957,geodetic,,1957,7008,8901,1047,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6218,Bogota 1975,geodetic,Fundamental Point: Bogota observatory. Latitude: 4 deg 35 min 56.570 sec N; Longitude: 74 deg  4 min 51.300 sec W (of Greenwich).,1975,7022,8901,1070,Topographic mapping.,Supersedes 1951 adjustment.,"Instituto Geografico Agustin Caduzzi (IGAC) special publication no. 1, 4th edition (1975) ""Geodesia: Resultados Definitvos de Parte de las Redes Geodesicas Establecidas en el Pais"".",EPSG,2000-10-19 00:00:00,2000.20,0
+6219,Bukit Rimpah,geodetic,2deg 00min 40.16sec S  105deg 51min 39.76sec E (of Greenwich).,,7004,8901,1287,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6220,Camacupa,geodetic,,,7012,8901,1288,Coastal hydrography.,,,EPSG,1995-06-02 00:00:00,,0
+6221,Campo Inchauspe,geodetic,Fundamental Point: Campo Inchauspe. Latitude: 35 deg 58 min 17.000 sec S; Longitude: 62 deg 10 min 12.000 sec W (of Greenwich).,,7022,8901,1033,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6222,Cape,geodetic,Fundamental Point: Buffelsfontein. Latitude: 33 deg 59 min 32.000 sec S; Longitude: 25 deg 30 min 44.622 sec E (of Greenwich).,,7013,8901,1290,"Geodesy, cadastre, topographic mapping, engineering survey.",,"Private Communication, Directorate of Surveys and Land Information, Cape Town.",EPSG,1996-10-18 00:00:00,96.25  99.69,0
+6223,Carthage,geodetic,,,7011,8901,1236,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6224,Chua,geodetic,Fundamental Point: Chua. Latitude: 19 deg 45 min 41.160 sec S; Longitude: 48 deg  6 min  7.560 sec W (of Greenwich).,,7022,8901,1053,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6225,Corrego Alegre,geodetic,Fundamental Point: Corrego Alegre. Latitude: 19 deg 50 min 15.140 sec S; Longitude: 48 deg 57 min 42.750 sec W (of Greenwich).,,7022,8901,1293,"Topographic mapping, geodesy.",,,EPSG,1995-06-02 00:00:00,,0
+6226,Cote d'Ivoire,geodetic,,,7011,8901,1075,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,2001.11,1
+6227,Deir ez Zor,geodetic,Fundamental Point: Trig. 254 Deir. Latitude: 35 deg 21 min 49.975 sec N; Longitude: 40 deg  5 min 46.770 sec E (of Greenwich).,,7011,8901,1623,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6228,Douala,geodetic,,,7011,8901,1060,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,1
+6229,Egypt 1907,geodetic,Fundamental Point: Station F1. Latitude: 30 deg 01 min 42.86 sec N; Longitude: 31 deg 16 min 33.60 sec E (of Greenwich).,1907,7020,8901,1086,"Geodesy, cadastre, topographic mapping, engineering survey.",,,EPSG,1995-06-02 00:00:00,,0
+6230,European Datum 1950,geodetic,Fundamental Point: Potsdam (Helmert Tower). Latitude: 52 deg 22 min 51.4456 sec N; Longitude: 13 deg  3 min 58.9283 sec E (of Greenwich).,1950,7022,8901,1296,"Topographic mapping, geodesy.",,,EPSG,1995-06-02 00:00:00,,0
+6231,European Datum 1987,geodetic,,1987,7022,8901,2420,Scientific network.,,,EPSG,1995-06-02 00:00:00,,0
+6232,Fahud,geodetic,Fundamental Point: Station NO68-024 Fahud. Latitude: 22 deg 17 min 31.182 sec N; Longitude: 56 deg 29 min 18.820 sec E (of Greenwich).,,7012,8901,1183,Oil industry mapping.,Superseded by PSD93 (code 6134).,Petroleum Development Oman.,EPSG,1995-06-02 00:00:00,,0
+6233,Gandajika 1970,geodetic,,1970,7022,8901,1152,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6234,Garoua,geodetic,,,7011,8901,1060,Topographic mapping.,The intent of the Bukavu 1953 conference was to adopt the Clarke 1880 (RGN) ellipsoid (code 7012) but in practice this datum has used the IGN version.,,EPSG,1995-06-02 00:00:00,,1
+6235,Guyane Francaise,geodetic,,,7022,8901,1097,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6236,Hu Tzu Shan,geodetic,,,7022,8901,1228,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6237,Hungarian Datum 1972,geodetic,"Fundamental Point: Szolohegy. Latitude: 47 deg 17 min 32,6156 sec N; Longitude 19 deg 36 min 09.9865 sec E; geoid height 6.56m.",1972,7036,8901,1119,Topographic mapping.,,http://lazarus.elte.hu/gb/geodez/geod3.htm,EPSG,1996-10-18 00:00:00,96.09,0
+6238,Indonesian Datum 1974,geodetic,"Fundamental Point: Padang. Latitude: 0 deg 56 min 38.414 sec S; Longitude: 100 deg 22 min  8.804 sec E (of Greenwich). Ellipsoidal height 3.190m, gravity-related height 14.0m above mean sea level.",1974,7021,8901,1122,Topographic mapping.,,Bakosurtanal 1979 paper by Jacob Rais.,EPSG,2002-06-22 00:00:00,2002.151,0
+6239,Indian 1954,geodetic,Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).,1954,7015,8901,1304,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6240,Indian 1975,geodetic,Fundamental Point: Khau Sakaerang,1975,7015,8901,1231,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6241,Jamaica 1875,geodetic,Fundamental Point: Fort Charles Flagstaff. Latitude: 17 deg 55 min 55.800 sec N; Longitude: 76 deg 56 min 37.260 sec W (of Greenwich).,1875,7034,8901,1128,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6242,Jamaica 1969,geodetic,Fundamental Point: Fort Charles Flagstaff. Latitude: 17 deg 55 min 55.800 sec N; Longitude: 76 deg 56 min 37.260 sec W (of Greenwich).,1969,7008,8901,1128,"Geodesy, cadastre, topographic mapping, engineering survey.",,,EPSG,1995-06-02 00:00:00,,0
+6243,Kalianpur 1880,geodetic,Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).,1880,7042,8901,1307,Topographic mapping.,Includes 1916 extrension into Burma (Myanmar).  Superseded by 1937 adjustment.,"G. Bomford; ""The Re-adjustment of the Indian Triangulation""; Survey of India Professional Paper 28; 1939.",EPSG,1999-10-20 00:00:00,97.23,0
+6244,Kandawala,geodetic,,,7015,8901,1218,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6245,Kertau,geodetic,Fundamental Point: Kertau. Latitude: 3 deg 27 min 50.710 sec N; Longitude: 102 deg 37 min 24.550 sec E (of Greenwich).,,7018,8901,1309,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6246,Kuwait Oil Company,geodetic,,,7012,8901,1136,Oil industry mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6247,La Canoa,geodetic,Fundamental Point: La Canoa. Latitude: 8 deg 34 min 17.170 sec N; Longitude: 63 deg 51 min 34.880 sec W (of Greenwich).,,7022,8901,1251,"Geodesy, topographic mapping, engineering survey.",Origin also adopted for PSAD56.,,EPSG,1995-06-02 00:00:00,,0
+6248,Provisional South American Datum 1956,geodetic,Fundamental Point: La Canoa. Latitude: 8 deg 34 min 17.170 sec N; Longitude: 63 deg 51 min 34.880 sec W (of Greenwich).,1956,7022,8901,1348,Topographic mapping.,Same origin as La Canoa datum.,,EPSG,1995-06-02 00:00:00,,0
+6249,Lake,geodetic,Fundamental Point: Maracaibo Cathedral. Latitude: 10 deg 38 min 34.678 sec N; Longitude: 71 deg 36 min 20.224 sec W (of Greenwich).,,7022,8901,1312,Oil industry mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6250,Leigon,geodetic,"Fundamental Point: GCS Station 121, Leigon. Latitude: 5 deg 38 min 52.27 sec N; Longitude: 0 deg 11 min 46.08 sec W (of Greenwich).",,7012,8901,1104,Topographic mapping.,Superseded Accra datum (code 6168) from 1978.  Coordinates at Leigon fundamental point defined as Accra datum values for that point.,Ordnance Survey International,EPSG,1995-06-02 00:00:00,,0
+6251,Liberia 1964,geodetic,,1964,7012,8901,1142,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6252,Lome,geodetic,,,7011,8901,1232,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6253,Luzon 1911,geodetic,Fundamental Point: Balacan. Latitude: 13 deg 33 min 41.000 sec N; Longitude: 121 deg 52 min  03.000 sec E (of Greenwich).,1911,7008,8901,1190,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6254,Hito XVIII 1963,geodetic,Chile-Argentina boundary survey.,1963,7022,8901,1303,Geodesy.,Used in Tierra del Fuego.,Various oil company records.,EPSG,1995-06-02 00:00:00,,0
+6255,Herat North,geodetic,,,7022,8901,1024,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6256,Mahe 1971,geodetic,Fundamental Point: Mahe,1971,7012,8901,1208,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6257,Makassar,geodetic,Fundamental Point: Moncongloe,,7004,8901,1316,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6258,European Terrestrial Reference System 1989,geodetic,,1989,7019,8901,1298,Geodesy.,"Coincides with WGS84 at the one metre level.
+The distinction in usage between ETRF89 and ETRS89 is confused: although in principle conceptually different in practice both are used for the realisation.",,EPSG,2000-10-19 00:00:00,97.11  97.55  99.111 2000.72,0
+6259,Malongo 1987,geodetic,Fundamental Point: Station Y at Malongo base camp. Latitude: 5 deg 23 min 34.327 sec S; Longitude: 12 deg 12 min  02.393 sec E (of Greenwich).,1987,7022,8901,1317,Oil industry mapping.,Offshore extension of Mhast datum (6264) using Transit translocation.,Chevron Petroleum Technology.,EPSG,1995-06-02 00:00:00,,0
+6260,Manoca,geodetic,,,7012,8901,1060,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,1
+6261,Merchich,geodetic,"Fundamental Point: Merchich. Latitude: 33� 26' 59.672"" N; Longitude: 7� 33' 27.295""  W (of Greenwich).",1922,7011,8901,1166,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6262,Massawa,geodetic,,,7004,8901,1089,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6263,Minna,geodetic,Fundamental Point: Minna base station L40. Latitude: 9 deg 38 min  09.000 sec N; Longitude: 6 deg 30 min 59.000 sec E (of Greenwich).,,7012,8901,1178,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6264,Mhast,geodetic,,,7022,8901,1318,Coastal hydrography.,,,EPSG,1995-06-02 00:00:00,,0
+6265,Monte Mario,geodetic,Fundamental Point: Monte Mario. Latitude: 41 deg 55 min 25.510 sec N; Longitude: 0 deg  00 min  00.000 sec E (of Rome).,,7022,8901,1127,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6266,M'poraloko,geodetic,,,7011,8901,1100,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6267,North American Datum 1927,geodetic,Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).,1927,7008,8901,1349,Topographic mapping.,Superseded by North American Datum 1983 (NAD83),,EPSG,1995-06-02 00:00:00,,0
+6268,NAD Michigan,geodetic,Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).,,7009,8901,1391,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6269,North American Datum 1983,geodetic,Origin at geocentre.,1986,7019,8901,1350,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6270,Nahrwan 1967,geodetic,Fundamental point: Nahrwan south base.  Latitude: 33 deg 19 min 10.87 sec N; Longitude: 44 deg 43 min 25.54 sec E (of Greenwich).,1967,7012,8901,1351,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6271,Naparima 1972,geodetic,Fundamental Point: Naparima. Latitude: 10 deg 16 min 44.860 sec N; Longitude: 61 deg 27 min 34.620 sec W (of Greenwich).,1972,7022,8901,1322,Topographic mapping.,Naparima 1972 is an extension of the Naparima 1955 network of Trinidad to include Tobago.,Ordnance Survey International.,EPSG,1995-06-02 00:00:00,,0
+6272,New Zealand Geodetic Datum 1949,geodetic,Fundamental Point: Papatahi. Latitude: 41 deg 19 min  8.900 sec S; Longitude: 175 deg  02 min 51.000 sec E (of Greenwich).,1949,7022,8901,1175,"Geodesy, cadastre, topographic mapping, engineering survey.",,,EPSG,2000-10-19 00:00:00,2000.702,0
+6273,NGO 1948,geodetic,,1948,7005,8901,1352,"Geodesy, cadastre, topographic mapping, engineering survey.",,,EPSG,1995-06-02 00:00:00,,0
+6274,Datum 73,geodetic,"Fundamental Point:  TF4, Melrica. Latitude: 39 deg 41 min 37.30 sec N; Longitude: 8 deg 07 min 53.31 sec W (of Greenwich).",1964,7022,8901,1294,Topographic mapping.,,Instituto Geografico e Cadastral; Lisbon,EPSG,1995-06-02 00:00:00,,0
+6275,Nouvelle Triangulation Francaise,geodetic,Fundamental Point: Pantheon. Latitude: 48 deg 50 min 46.52 sec N; Longitude: 2 deg 20 min 48.67 sec E (of Greenwich).,1898,7011,8901,1353,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6276,NSWC 9Z-2,geodetic,,,7025,8901,1262,Satellite navigation.,Transit precise ephemeris before 1991.,,EPSG,1995-06-02 00:00:00,,0
+6277,OSGB 1936,geodetic,Fundamental Point: Herstmonceux. Latitude: 50 deg 51 min 55.271 sec N; Longitude: 0 deg 20 min 45.882 sec E (of Greenwich).,1936,7001,8901,1264,Topographic mapping.Topographic mapping.Topographic mapping.Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6278,OSGB 1970 (SN),geodetic,Fundamental Point: Herstmonceux. Latitude: 50 deg 51 min 55.271 sec N; Longitude: 0 deg 20 min 45.882 sec E (of Greenwich).,1970,7001,8901,1354,Scientific network.,,,EPSG,1995-06-02 00:00:00,,0
+6279,OS (SN) 1980,geodetic,Fundamental Point: Herstmonceux. Latitude: 50 deg 51 min 55.271 sec N; Longitude: 0 deg 20 min 45.882 sec E (of Greenwich).,1980,7001,8901,1354,Scientific network.,,,EPSG,1995-06-02 00:00:00,,0
+6280,Padang 1884,geodetic,Fundamental Point: Padang,1884,7004,8901,1355,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6281,Palestine 1923,geodetic,Fundamental Point: Point 82'M  Jerusalem. Latitude: 31 deg 44 min  2.749 sec N; Longitude: 35 deg 12 min 43.490 sec E (of Greenwich).,1923,7010,8901,1356,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6282,Congo 1960 Pointe Noire,geodetic,Fundamental Point: Point Noire Astro. Latitude: 4 deg 47 min  0.100 sec S; Longitude: 11 deg 51 min  1.550 sec E (of Greenwich).,1960,7011,8901,1072,Topographic mapping.,,,EPSG,2002-01-18 00:00:00,2002.05,0
+6283,Geocentric Datum of Australia 1994,geodetic,,1994,7019,8901,1036,"Topographic mapping, geodesy.",Coincident with WGS84 to within 1 metre.,Australian Surveying and Land Information Group Internet WWW page.,EPSG,1995-06-02 00:00:00,,0
+6284,Pulkovo 1942,geodetic,Fundamental Point: Pulkovo observatory. Latitude: 59 deg 46 min 18.550 sec N; Longitude: 30 deg 19 min 42.090 sec E (of Greenwich).,1942,7024,8901,1357,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6285,Qatar 1974,geodetic,Fundamental Point: Station G3,1974,7022,8901,1346,Topographic mapping.,,,EPSG,2001-08-28 00:00:00,2001.27,0
+6286,Qatar 1948,geodetic,Fundamental Point: Sokey 0 M. Latitude: 25 deg 22 min 56.500 sec N; Longitude: 50 deg 45 min 41.000 sec E (of Greenwich).,1948,7020,8901,1346,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6287,Qornoq,geodetic,,1927,7022,8901,1107,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,1
+6288,Loma Quintana,geodetic,Fundamental Point: Loma Quintana,,7022,8901,1313,Topographic mapping.,Superseded by La Canoa (code 6247).,,EPSG,1995-06-02 00:00:00,,0
+6289,Amersfoort,geodetic,Fundamental Point: Amersfoort. Latitude: 52 deg  09 min 22.178 sec N; Longitude: 5 deg 23 min 15.478 sec E (of Greenwich).,,7004,8901,1275,"Geodesy, cadastre, topographic mapping, engineering survey.",,,EPSG,2000-10-19 00:00:00,2000.56,0
+6291,South American Datum 1969,geodetic,,1969,7036,8901,1358,Topographic mapping.,SAD69 uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision is 0 to 31mm.,,EPSG,1996-10-18 00:00:00,96.09  97.252,0
+6292,Sapper Hill 1943,geodetic,,1943,7022,8901,1092,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6293,Schwarzeck,geodetic,,,7046,8901,1169,Topographic mapping.,,"Private Communication, Directorate of Surveys and Land Information, Cape Town.",EPSG,2001-01-21 00:00:00,2001.15,0
+6294,Segora,geodetic,,,7004,8901,1359,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,1
+6295,Serindung,geodetic,,,7004,8901,1360,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6296,Sudan,geodetic,,,7011,8901,1361,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6297,Tananarive 1925,geodetic,Fundamental Point: Tananarive observatory. Latitude: 18 deg 55 min  2.100 sec S; Longitude: 45 deg 12 min 52.800 sec E (of Greenwich).,2025,7022,8901,1149,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6298,Timbalai 1948,geodetic,Fundamental Point: Timbalai. Latitude: 5 deg 17 min  3.548 sec N; Longitude: 115 deg 10 min 56.409 sec E (of Greenwich).,1948,7016,8901,1362,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6299,TM65,geodetic,Adjusted to best mean fit 12 stations of the OSNI 1952 primary adjustment to within 0.5m.,1965,7002,8901,1305,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6300,TM75,geodetic,Adjusted to best mean fit 9 stations of the OSNI 1952 primary adjustment in Northern Ireland plus the 1965 values of 3 stations in the Republic of Ireland.,1975,7002,8901,1305,"Geodesy, topographic mapping and engineering survey.",,,EPSG,1995-06-02 00:00:00,,0
+6301,Tokyo,geodetic,Fundamental Point: Nikon-Keido-Genten. Latitude: 35 deg 39 min 17.5148 sec N; Longitude: 139 deg 44 min 40.5020 sec E (of Greenwich).,,7004,8901,1364,"Geodesy, cadastre, topographic mapping, engineering survey.",Superseded by Japanese Geodetic Datum 2000 (code 6611).,Geographic Survey Institute; Japan; Bulletin 40 (March 1994).  Also http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html,EPSG,2002-06-22 00:00:00,98.46  2002.08,0
+6302,Trinidad 1903,geodetic,Harbour Master's Flagstaff; Port of Spain.,1903,7007,8901,1339,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6303,Trucial Coast 1948,geodetic,Fundamental Point: TC1. Latitude: 25 deg 23 min 50.190 sec N; Longitude: 55 deg 26 min 43.950 sec E (of Greenwich).,1948,7020,8901,1363,Oil industry mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6304,Voirol 1875,geodetic,Fundamental Point: Voirol. Latitude: 40.835864 grads N; Longitude: 0.788735 grads E of Paris.,1875,7011,8901,1365,Topographic mapping.,,IGN Paris,EPSG,1995-06-02 00:00:00,,0
+6306,Bern 1938,geodetic,Fundamental Point: Old Bern observatory. Latitude: 46 deg 57 min  7.890 sec N; Longitude: 7 deg 26 min 22.335 sec E (of Greenwich).,1938,7004,8901,1286,Topographic mapping.,This redetermination of the coordinates of fundamental point is used for scientific purposes and as the graticule overprinted on topographic maps constructed on the CH1903 / LV03 projected CS (code 21781).,"""Die Projektionen der schweizerischen Plan- und Kartenwerke""; J. Bolliger 1967",EPSG,1 [...]
+6307,Nord Sahara 1959,geodetic,,1959,7012,8901,1366,Topographic mapping.,Sometimes incorrectly referred to as Voirol Unifie 1960. Voirol Unifie 1960 is NOT a datum:  it is two projected coordinate systems based on  Nord Sahara 1959.  See coordinate system codes 30791 and 30792.,"""Le System Geodesique Nord-Sahara""; IGN Paris",EPSG,1999-10-20 00:00:00,99.62,0
+6308,Stockholm 1938,geodetic,Fundamental Point: Stockholm observatory,1938,7004,8901,1225,"Geodesy, cadastre, topographic mapping, engineering survey.",Superseded by RT90 adjustment (datum code 6124),,EPSG,1996-04-12 00:00:00,,0
+6309,Yacare,geodetic,,,7022,8901,1247,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6310,Yoff,geodetic,,,7011,8901,1207,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6311,Zanderij,geodetic,,,7022,8901,1222,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6312,Militar-Geographische Institut,geodetic,Fundamental Point: Hermannskogel. Latitude: 48 deg 16 min 15.29 sec N; Longitude: 16 deg 17 min 41.06 sec E (of Greenwich).,1901,7004,8901,1321,Topographic mapping.,Croatia is planning to define a new modern datum to supersede HR1901 (info from EuroGeographics; http://crs.ifag.de/).,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,1995-06-02 00:00:00,,0
+6313,Reseau National Belge 1972,geodetic,Fundamental Point: Uccle observatory. Latitude: 50 deg 47 min 57.704 sec N; Longitude: 4 deg 21 min 24.983 sec E (of Greenwich).,1972,7022,8901,1347,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6314,Deutsches Hauptdreiecksnetz,geodetic,Fundamental Point: Rauenberg. Latitude: 52 deg 27 min 12.021 sec N; Longitude: 13 deg 22 min 04.928 sec E (of Greenwich).,,7004,8901,1295,"Geodesy, cadastre, topographic mapping, engineering survey.",Deprecated because name misspelt.,,EPSG,2001-11-06 00:00:00,2001.511,0
+6315,Conakry 1905,geodetic,Fundamental Point: Conakry. Latitude: 10.573766g N; Longitude: 17.833682g W (of Paris).,1905,7011,8901,1112,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6316,Dealul Piscului 1933,geodetic,Fundamental point: latitude 44 deg 24 min 33.9606 sec N; longitude 26 deg 06 min 44.8772 sec E (of Greenwich).,1933,7022,8901,1197,Topographic mapping.,Superseded by 1970 adjustment (datum code 6317),Institute for Geodesy Photogrametry and Land Management,EPSG,1996-04-12 00:00:00,,0
+6317,Dealul Piscului 1970,geodetic,Fundamental point: latitude 44 deg 24 min 23.7709 sec N; longitude 26deg 06 min 44.1265 sec E (of Greenwich).,1970,7024,8901,1197,Topographic mapping.,Supersedes 1933 adjustment (datum code 6316),Institute for Geodesy Photogrametry and Land Management,EPSG,1996-04-12 00:00:00,,0
+6318,National Geodetic Network,geodetic,,,7030,8901,1136,Geodesy.,,,EPSG,1996-04-12 00:00:00,,0
+6319,Kuwait Utility,geodetic,,,7019,8901,1310,"Cadastre, engineering survey.",,,EPSG,1996-04-12 00:00:00,,0
+6322,World Geodetic System 1972,geodetic,,1972,7043,8901,1262,Satellite navigation.,Used by GPS before 1987. For Transit satellite positioning see also WGS 72BE. Datum code 6323 reserved for southern hemisphere ProjCS's.,,EPSG,1999-04-22 00:00:00,99.03,0
+6324,WGS 72 Transit Broadcast Ephemeris,geodetic,,1972,7043,8901,1262,Satellite navigation.,Alleged datum for use with Transit broadcast ephemeris prior to 1989. Relationship to WGS 72 has changed over time.  Datum code 6325 reserved for southern hemisphere ProjCS's.,,EPSG,1999-04-22 00:00:00,99.03,0
+6326,World Geodetic System 1984,geodetic,Origin at geocentre.,1984,7030,8901,1262,Satellite navigation.,Datum code 6327 reserved for southern hemisphere ProjCS's,,EPSG,2002-06-22 00:00:00,2002.151,0
+6600,Anguilla 1957,geodetic,Fundamental point: station A4.,1957,7012,8901,1030,Topographic mapping.,,Ordnance Survey of Great Britain.,EPSG,1999-04-22 00:00:00,,0
+6601,Antigua 1943,geodetic,Fundamental point: station A14.,1943,7012,8901,1273,Topographic mapping.,,Ordnance Survey of Great Britain.,EPSG,1999-04-22 00:00:00,,0
+6602,Dominica 1945,geodetic,Fundamental point: station M12.,1945,7012,8901,1082,Topographic mapping.,,Ordnance Survey of Great Britain.,EPSG,1999-04-22 00:00:00,,0
+6603,Grenada 1953,geodetic,Fundamental point: station GS8.,1953,7012,8901,1551,Topographic mapping.,,Ordnance Survey of Great Britain.,EPSG,1999-04-22 00:00:00,,0
+6604,Montserrat 1958,geodetic,Fundamental point: station M36.,1958,7012,8901,1165,Topographic mapping.,,Ordnance Survey of Great Britain.,EPSG,1999-04-22 00:00:00,,0
+6605,St. Kitts 1955,geodetic,Fundamental point: station K12.,1955,7012,8901,1200,Topographic mapping.,,Ordnance Survey of Great Britain.,EPSG,1999-04-22 00:00:00,,0
+6606,St. Lucia 1955,geodetic,Fundamental point: station DCS3.,1955,7012,8901,1201,Topographic mapping.,,Ordnance Survey of Great Britain.,EPSG,1999-04-22 00:00:00,,0
+6607,St. Vincent 1945,geodetic,Fundamental point: station V1.,1945,7012,8901,1202,Topographic mapping.,,Ordnance Survey of Great Britain.,EPSG,1999-04-22 00:00:00,,0
+6608,North American Datum 1927 (1976),geodetic,Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).,1976,7008,8901,1367,"Geodesy, cadastre, topographic mapping, engineering survey.",NAD27(76) used in Ontario for all maps at scale 1/20 000 and larger; elsewhere in Canada for selected purposes.,Geodetic Survey of Canada.,EPSG,1999-05-12 00:00:00,,0
+6609,North American Datum 1927 (CGQ77),geodetic,Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).,1977,7008,8901,1368,"Geodesy, cadastre, topographic mapping, engineering survey.",NAD27 (CGQ77) used in Quebec for all maps at scale 1/20 000 and larger; generally for maps issued by the Quebec cartography office whose reference system is CGQ77.,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,1 [...]
+6610,Xian 1980,geodetic,,1980,7049,8901,1067,"Geodesy, topographic and engineering survey.",,BP,EPSG,2002-02-12 00:00:00,,0
+6611,Hong Kong 1980,geodetic,"Trig ""Zero"", 38.4 feet south along the transit circle of the Kowloon Observatory. Latitude 22deg 18min 12.82sec North, longitude 114deg 10min 18.75sec East.",1980,7022,8901,1118,"Geodesy, topgraphic and engineering survey, cadastre.",Supersedes Hong Kong 1963 datum and 1973 metric adjustment.,"Survey and Mapping Office, Lands Department. http://www.info.gov.hk/landsd/mapping/tindex.htm",EPSG,2002-06-22 00:00:00,,0
+6612,Japanese Geodetic Datum 2000,geodetic,ITRF94,2000,7019,8901,1129,"Geodesy, topographic and engineering survey.",Instigated under amendment to the Japanese Surveying Law with effect from April 2002. Supersedes Tokyo datum (code 6301).,Japanese Survey Federation.,EPSG,2002-06-22 00:00:00,,0
+6613,Gunung Segara,geodetic,Station P5 (Gunung Segara) 0deg 32min 12.83sec S  117deg 08min 48.47sec E (of Greenwich).,,7004,8901,1360,Topographic mapping.,,TotalFinaElf.,EPSG,2002-06-22 00:00:00,,0
+6614,Qatar National Datum 1995,geodetic,Defined by transformation from WGS 84 - see coordinate operation code 1840.,1995,7022,8901,1346,Topographic mapping.,,Qatar Centre for Geographic Information.,EPSG,2002-06-28 00:00:00,,0
+6615,Porto Santo,geodetic,,1936,7022,8901,1314,Topographic mapping.,For Selvagens island see Selvagem Grande (code 6616).,Instituto Geografico e Cadastral Lisbon http://www.ipcc.pt,EPSG,2002-07-13 00:00:00,,0
+6616,Selvagem Grande,geodetic,,,7022,8901,2779,Topographic mapping.,,Instituto Geografico e Cadastral Lisbon http://www.ipcc.pt,EPSG,2002-07-13 00:00:00,,0
+6801,CH1903 (Bern),geodetic,Fundamental Point: Bern observatory. Latitude: 46 deg 57 min  8.660 sec N; Longitude: 0,1903,7004,8907,1286,Topographic mapping.,,Bundesamt f�r Landestopographie,EPSG,1999-10-20 00:00:00,,0
+6802,Bogota 1975 (Bogota),geodetic,Fundamental Point: Bogota observatory. Latitude: 4 deg 35 min 56.570 sec N; Longitude: 0,1975,7022,8904,1070,Topographic mapping.,,,EPSG,2000-10-19 00:00:00,2000.20,0
+6803,Lisbon 1937 (Lisbon),geodetic,Fundamental Point: Castelo Sao Jorge; Lisbon. Latitude: 38 deg 42 min 43.631 sec N; Longitude: 0,1937,7022,8902,1294,Topographic mapping.,Supersedes Lisbon 1890 adjustment (which used Bessel 1841 ellipsoid).,Instituto Geografico e Cadastral; Lisbon,EPSG,1995-06-02 00:00:00,2001.551,0
+6804,Makassar (Jakarta),geodetic,Fundamental Point: Moncongloe,,7004,8908,1316,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6805,Militar-Geographische Institut (Ferro),geodetic,Fundamental Point: Hermannskogel. Latitude: 48 deg 16 min 15.29 sec N; Longitude: 33 deg 57 min 41.06 sec E of Ferro.,1901,7004,8909,1321,Topographic mapping.,,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,1995-06-02 00:00:00,,0
+6806,Monte Mario (Rome),geodetic,Fundamental Point: Monte Mario. Latitude: 41 deg 55 min 25.510 sec N; Longitude: 0 deg  00 min  00.000 sec E (of Rome).,,7022,8906,1127,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6807,Nouvelle Triangulation Francaise (Paris),geodetic,Fundamental Point: Pantheon,,7011,8903,1353,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6808,Padang 1884 (Jakarta),geodetic,Fundamental Point: Padang,1884,7004,8908,1355,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6809,Reseau National Belge 1950 (Brussels),geodetic,Fundamental Point: Lommel (tower). Latitude: 51 deg 13 min 47.334 sec N; Longitude: 0 deg 56 min 44.773 sec E (of Brussels).,1950,7022,8910,1347,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6810,Tananarive 1925 (Paris),geodetic,Fundamental Point: Tananarive observatory. Latitude: 18 deg 55 min  2.100 sec S; Longitude: 0,1925,7022,8903,1149,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6811,Voirol 1875 (Paris),geodetic,Fundamental Point: Voirol. Latitude: 40.835864 grads N; Longitude: 0.788735 grads E of Paris.,1875,7011,8903,1365,Topographic mapping.,,IGN Paris,EPSG,1995-06-02 00:00:00,,0
+6813,Batavia (Jakarta),geodetic,Fundamental Point: Longitude at Batavia Astro. Station. Latitude: 6 deg  7 min 39.520 sec S; Longitude: 106 deg 48 min 27.790 sec E (of Greenwich). Latitude and azimuth at Genuk.,,7004,8908,1285,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6814,Stockholm 1938 (Stockholm),geodetic,Fundamental Point: Stockholm observatory,1938,7004,8911,1225,"Geodesy, cadastre, topographic mapping, engineering survey.",Superseded by RT90 adjustment (datum code 6124),,EPSG,1996-04-12 00:00:00,,0
+6815,Greek (Athens),geodetic,Fundamental point: Athens Observatory; latitude 37 deg 58 min 20.132 sec N; longitude 0 deg E of Athens.,,7004,8912,1106,Topographic mapping.,See geodetic datum alias 6404.  Used as basis of topographic mapping based on Hatt projection.,Topography Department; National Technical University of Athens,EPSG,1997-06-16 00:00:00,,0
+6816,Carthage (Paris),geodetic,,,7011,8903,1236,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6817,NGO 1948 (Oslo),geodetic,,1948,7005,8913,1352,"Geodesy, cadastre, topographic mapping, engineering survey.",,,EPSG,1995-06-02 00:00:00,,0
+6818,S-JTSK (Ferro),geodetic,Modification of Austrian MGI (Ferro) datum.,1920,7004,8909,1306,"Geodesy, cadastre, topographic mapping, engineering survey.",,Research Institute for Geodesy Topography and Cartography (VUGTK); Prague.,EPSG,2001-08-28 00:00:00,2001.26,0
+6819,Nord Sahara 1959 (Paris),geodetic,,1959,7012,8903,1366,Topographic mapping.,Conformal transformation from adjustment in ED50 terms.,"""Le System Geodesique Nord-Sahara""; IGN Paris",EPSG,2000-06-23 00:00:00,,0
+6820,Gunung Segara (Jakarta),geodetic,Station P5 (Gunung Segara) 0deg 32min 12.83sec S  117deg 08min 48.47sec E of Greenwich (8deg 20min 20.68sec E of Jakarta).,,7004,8908,1360,Topographic mapping.,,,EPSG,2002-06-22 00:00:00,,0
+6901,Ancienne Triangulation Francaise (Paris),geodetic,,,7027,8903,1326,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6902,Nord de Guerre (Paris),geodetic,,,7027,8903,1369,Topographic mapping.,,,EPSG,1995-06-02 00:00:00,,0
+6903,Madrid 1870 (Madrid),geodetic,Fundamental point: Madrid observatory.,1870,7028,8905,1217,Topographic mapping.,,Institut de Geomatica; Barcelona,EPSG,1998-11-11 00:00:00,,0
+6904,Lisbon 1890 (Lisbon),geodetic,Fundamental Point: Castelo Sao Jorge; Lisbon. Latitude: 38 deg 42 min 43.631 sec N; Longitude: 0,1937,7004,8902,1294,Topographic mapping.,Superseded by Lisbon 1937 adjustment (which uses International 1924 ellipsoid).,Instituto Geografico e Cadastral; Lisbon. http://www.ipcc.pt,EPSG,2002-07-13 00:00:00,,0
+9300,Astra Minas,engineering,Origin at 45 deg 59 min 54.79 sec S; 67 deg 34 min 38.94 sec W.,,,,1265,Oil industry mapping.,,,EPSG,2000-03-07 00:00:00,,0
+9301,Barcelona,engineering,Centre of the gateway of San Cristobal chuch; Plaza Boyaca; Barcelona.,,,,1266,Oil industry mapping.,Coordinates variously given as 10deg 08min 06sec N  64deg 41min 17sec W and 10deg 08min 06sec N  64deg 41min 07.5sec W.  It is not clear whether there should be two local datums.,"Ministry of Mines standards manual, 1974.",EPSG,2000-03-07 00:00:00,,0
+9302,Maturin,engineering,Concrete post PR-1 in Plaza Bolivar; Maturin.  9deg 44min 55sec N  63deg 10min 40sec W.,,,,1320,Oil industry mapping.,,"Ministry of Mines standards manual, 1974.",EPSG,2000-06-10 00:00:00,,0
+9303,Maracaibo Cross,engineering,Cruz Canada Morillo in Maracaibo; 10deg 38min 32.328sec N  71deg 37min 12.12sec W  Loma Quintana datum.,,,,1319,Oil industry mapping.,,"Ministry of Mines standards manual, 1974.",EPSG,2000-06-10 00:00:00,,0
+9304,La Rosa,engineering,Monument in La Rosa; 10deg 22min 40.417sec N  71deg 26min 59.488sec W  Loma Quintana datum.,,,,1311,Oil industry mapping.,,"Ministry of Mines standards manual, 1974.",EPSG,2000-06-10 00:00:00,,0
+9305,Mene Grande,engineering,Monument in Santa Barbara; Mene Grande.  9deg 52min 25.488sec N  70deg 54min 35.310sec W.,,,,1270,Oil industry mapping.,,"Ministry of Mines standards manual, 1974.",EPSG,2000-06-10 00:00:00,,0
+9306,El Cubo,engineering,8deg 44min 17.258sec N  72deg 30min 09.01sec W.,,,,1269,Oil industry mapping.,,"Ministry of Mines standards manual, 1974.",EPSG,2000-06-10 00:00:00,,0
+9307,Dabajuro,engineering,Church tower at Dabajuro; 11deg 01min 19sec N  70deg 40min 40sec W.,,,,1268,Oil industry mapping.,,"Ministry of Mines standards manual, 1974.",EPSG,2000-06-10 00:00:00,,0
+9308,Tucupita,engineering,Centre of Plaza Bolivar; Tucupita; 9deg 03min 32sec N  62deg 03min 07.6sec W.,,,,1370,Oil industry mapping.,,"Ministry of Mines standards manual, 1974.",EPSG,2000-06-10 00:00:00,,0
+9309,El Mene,engineering,10deg 04min 49.1sec N  71deg 02min 10sec W.,,,,1270,Oil industry mapping.,,"Ministry of Mines standards manual, 1974.",EPSG,2000-06-10 00:00:00,,0
+9310,Santa Maria de Ipire,engineering,Concrete post PR-1 in Plaza Bolivar; Santa Maria de Ipire; 8deg 40min 06sec N  65deg 19min 09sec W.,,,,1371,Oil industry mapping.,,"Ministry of Mines standards manual, 1974.",EPSG,2000-06-10 00:00:00,,0
+9311,Barinas west base,engineering,Concrete pillar,,,,1267,Oil industry mapping.,,"Ministry of Mines standards manual, 1974.",EPSG,2000-06-10 00:00:00,,0
+9312,EPSG example  X,engineering,Bin grid I=J=1 at WGS 84 / UTM zone 31N 456781E 5836723N.,,,,1263,Example only.,"Bin grid orientation = 20 degrees grid.  Bin width I=25m, J=12.5m.  Bin increment I=1, J=1.  Scale factor at origin 0.99984.
+
+Example only!",UKOOA P6/98 documentation,EPSG,2000-06-23 00:00:00,,0
+9313,EPSG example Platform Y,engineering,Conductor slot A1,,,,1263,Example only.,Example only,EPSG,EPSG,2000-06-23 00:00:00,,0
diff --git a/src/tiff/csv/deprecation.csv b/src/tiff/csv/deprecation.csv
new file mode 100644
index 0000000..6e131ca
--- /dev/null
+++ b/src/tiff/csv/deprecation.csv
@@ -0,0 +1,276 @@
+"DEPRECATION_ID","DEPRECATION_DATE","CHANGE_ID","OBJECT_TABLE_NAME","OBJECT_CODE","REPLACED_BY","DEPRECATION_REASON"
+2,2001-08-15 00:00:00,2001.223,Coordinate_Operation,8563,1670,Replaced concatenated tfm with zero step by single tfm.
+3,2001-08-15 00:00:00,2001.222,Coordinate_Operation,8457,1676,Replaced concatenated tfm with zero step by single tfm.
+4,2001-08-15 00:00:00,2001.222,Coordinate_Operation,8236,1675,Replaced concatenated tfm with zero step by single tfm.
+5,2001-08-15 00:00:00,2001.222,Coordinate_Operation,8183,1677,Replaced concatenated tfm with zero step by single tfm.
+6,2001-08-15 00:00:00,2001.222,Coordinate_Operation,8195,1680,Replaced concatenated tfm with zero step by single tfm.
+7,2001-08-15 00:00:00,2001.222,Coordinate_Operation,8199,1679,Replaced concatenated tfm with zero step by single tfm.
+8,2001-08-15 00:00:00,2001.222,Coordinate_Operation,8234,1673,Replaced concatenated tfm with zero step by single tfm.
+9,2001-08-15 00:00:00,2001.222,Coordinate_Operation,8567,1681,Replaced concatenated tfm with zero step by single tfm.
+10,2001-08-15 00:00:00,2001.222,Coordinate_Operation,8572,1672,Replaced concatenated tfm with zero step by single tfm.
+11,2001-08-15 00:00:00,2001.222,Coordinate_Operation,8573,1671,Replaced concatenated tfm with zero step by single tfm.
+12,2001-08-15 00:00:00,2001.222,Coordinate_Operation,8580,1678,Replaced concatenated tfm with zero step by single tfm.
+13,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8396,1665,Replaced concatenated tfm with zero step by single tfm.
+14,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8400,1666,Replaced concatenated tfm with zero step by single tfm.
+15,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8576,1667,Replaced concatenated tfm with zero step by single tfm.
+16,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8577,1668,Replaced concatenated tfm with zero step by single tfm.
+17,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8194,1669,Replaced concatenated tfm with zero step by single tfm.
+18,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8190,1665,Replaced concatenated tfms with zero step by single tfm with 1m accuracy.
+19,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8192,1669,Replaced concatenated tfm with zero step by single tfm with 1m accuracy.
+20,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8398,1667,Replaced concatenated tfm with zero step by single tfm with 1m accuracy.
+21,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8408,1666,Replaced concatenated tfm with zero step by single tfm with 1m accuracy.
+22,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8453,1667,Replaced concatenated tfm with zero step by single tfm with 1m accuracy.
+23,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8454,1668,Replaced concatenated tfm with zero step by single tfm with 1m accuracy.
+24,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8560,1669,Replaced concatenated tfm with zero step by single tfm with 1m accuracy.
+25,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8578,1665,Replaced concatenated tfm with zero step by single tfms with 1m accuracy.
+26,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8579,1669,Replaced concatenated tfm with zero step by single tfm with 1m accuracy.
+27,2001-10-04 00:00:00,2001.121,Coordinate_Operation,1510,1766,NMA has reduced precision with which it quotes parameter values for this tfm.
+28,2001-10-04 00:00:00,2001.45,Coordinate_Operation,14100,15302,Error in parameter values for easting and northing at grid origin.
+29,2001-10-04 00:00:00,2001.45,Coordinate_Operation,11631,15303,Error in parameter value for latitude of 2nd standard parallel.
+30,2001-08-28 00:00:00,2001.37,Coordinate_Operation,1508,1753,Incorrect unit assigned to scale difference parameter value.
+32,2001-06-05 00:00:00,2001.07,Ellipsoid,7035,7047,"Changed from general ""Sphere"" to specific ""GRS 1980 Authalic Sphere""."
+33,2001-06-25 00:00:00,2001.19,Ellipsoid,7047,7048,Incorrect radius (semi-major and semi-minor axes).
+34,2001-06-21 00:00:00,2001.07,Datum,6035,6047,"Name changed to reflect use of specific ""GRS 1980 Authalic Sphere"" rather than general ""Sphere""."
+35,1997-11-13 00:00:00,97.372,Datum,5107,5118,Replace this general name to specific.
+38,,2001.181,Datum,6314,6177,Correction to name spelling.
+39,2001-08-28 00:00:00,2001.32,Coordinate Reference System,2156,2195,ProjCRS 2156 invalid as linked to projection in wrong hemisphere and has wrong name.
+40,2001-08-28 00:00:00,2001.32,Coordinate_Operation,15300,15301,Longitude of natural origin has incorrect value (wrong hemisphere).
+41,2001-08-28 00:00:00,2001.3,Coordinate Reference System,2291,2292,Source geogCRS code is in error.
+42,2001-06-05 00:00:00,2001.07,Coordinate Reference System,4035,4047,"Changed from general ""Sphere"" to specific ""GRS 1980 Authalic Sphere""."
+43,2001-08-28 00:00:00,2001.47,Datum,6226,6142,Does not exist except as an alias of 6142 and 6143.
+44,2001-06-05 00:00:00,2001.11,Coordinate Reference System,4226,4142,Does not exist except as an alias of 4142 and 4143.
+45,2001-06-05 00:00:00,2001.181,Coordinate Reference System,31461,,ProjCRS zone not used.
+46,2001-06-05 00:00:00,2001.181,Coordinate Reference System,31462,31466,ProjCRS related to inappropriate coordinate system resulting in incorrect axes and name.
+47,2001-06-05 00:00:00,2001.181,Coordinate Reference System,31463,31467,ProjCRS related to inappropriate coordinate system resulting in incorrect axes and name.
+48,2001-06-05 00:00:00,2001.181,Coordinate Reference System,31464,31468,ProjCRS related to inappropriate coordinate system resulting in incorrect axes and name.
+49,2001-06-05 00:00:00,2001.181,Coordinate Reference System,31465,31469,ProjCRS related to inappropriate coordinate system resulting in incorrect axes and name.
+50,2001-06-05 00:00:00,2001.18,Coordinate Reference System,31265,31275,ProjCRS related to inappropriate projection (coordinate operation) and CS resulting in incorrect scale factor and axes order and abbreviation.
+51,2001-06-05 00:00:00,2001.18,Coordinate Reference System,31266,31276,ProjCRS related to inappropriate projection (coordinate operation) and CS resulting in incorrect scale factor and axes order and abbreviation.
+52,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8564,1691,Replaced concatenated tfm with zero step by single tfm.
+53,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8404,1692,Replaced concatenated tfm with zero step by single tfm.
+54,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8565,1692,Replaced concatenated tfm with zero step by single tfm.
+55,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8243,1693,Replaced concatenated tfm with zero step by single tfm.
+56,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8245,1693,Replaced concatenated tfm with zero step by single tfm.
+57,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8574,1694,Replaced concatenated tfm with zero step by single tfm.
+58,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8575,1695,Replaced concatenated tfm with zero step by single tfm.
+59,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8566,1696,Replaced concatenated tfm with zero step by single tfm.
+60,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8421,1697,Replaced concatenated tfm with zero step by single tfm.
+61,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8388,1698,Replaced concatenated tfm with zero step by single tfm.
+62,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8390,1699,Replaced concatenated tfm with zero step by single tfm.
+63,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8392,1700,Replaced concatenated tfm with zero step by single tfm.
+64,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8422,1702,Replaced concatenated tfm with zero step by single tfm.
+65,2001-08-15 00:00:00,2001.226,Coordinate_Operation,8215,1683,Replaced concatenated tfm with zero step by single tfm.
+66,2001-08-15 00:00:00,2001.226,Coordinate_Operation,8217,1684,Replaced concatenated tfm with zero step by single tfm.
+67,2001-08-15 00:00:00,2001.226,Coordinate_Operation,8219,1685,Replaced concatenated tfm with zero step by single tfm.
+68,2001-08-15 00:00:00,2001.226,Coordinate_Operation,8221,1686,Replaced concatenated tfm with zero step by single tfm.
+69,2001-08-15 00:00:00,2001.226,Coordinate_Operation,8223,1687,Replaced concatenated tfm with zero step by single tfm.
+70,2001-08-15 00:00:00,2001.225,Coordinate_Operation,8530,1682,Replaced concatenated tfm with zero step by single tfm.
+71,2001-06-05 00:00:00,2001.18,Coordinate Reference System,31267,31277,ProjCRS related to inappropriate projection (coordinate operation) and CS resulting in incorrect scale factor and axes order and abbreviation.
+72,2001-06-05 00:00:00,2001.18,Coordinate Reference System,31268,31278,ProjCRS related to inappropriate projection (coordinate operation) and CS resulting in incorrect scale factor and axes order and abbreviation.
+73,2001-08-28 00:00:00,2001.31,Coordinate Reference System,31278,31279,ProjCRS related to incorrect projection.
+74,2001-06-05 00:00:00,2001.182,Coordinate Reference System,31291,31281,ProjCRS related to inappropriate coordinate system resulting in incorrect axes.
+75,2001-06-05 00:00:00,2001.182,Coordinate Reference System,31292,31282,ProjCRS related to inappropriate coordinate system resulting in incorrect axes.
+76,2001-06-05 00:00:00,2001.182,Coordinate Reference System,31293,31283,ProjCRS related to inappropriate coordinate system resulting in incorrect axes.
+77,2001-06-05 00:00:00,2001.182,Coordinate Reference System,31294,31284,ProjCRS related to inappropriate coordinate system resulting in incorrect axes.
+78,2001-06-05 00:00:00,2001.182,Coordinate Reference System,31295,31285,ProjCRS related to inappropriate coordinate system resulting in incorrect axes.
+79,2001-06-05 00:00:00,2001.182,Coordinate Reference System,31296,31286,ProjCRS related to inappropriate coordinate system resulting in incorrect axes.
+80,2001-06-05 00:00:00,2001.182,Coordinate Reference System,31297,31287,ProjCRS related to inappropriate coordinate system resulting in incorrect axes.
+81,2001-06-05 00:00:00,2001.183,Coordinate_Operation,1471,1618,Error in signs of all transformation parameter values and for scale factor also incorrect units.
+82,2001-08-15 00:00:00,2001.122,Coordinate_Operation,1310,1674,Change of source CRS.
+83,2001-08-28 00:00:00,2001.4,Coordinate_Operation,8497,,Invalid concatenation: area of use of steps 1 and 2 do not overlap.
+84,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1258,1755,Correction to name.
+85,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1259,1756,Correction to name.
+86,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1261,1757,Correction to name.
+87,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1263,1758,Correction to name.
+88,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1268,1759,Correction to name.
+89,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1269,1760,Correction to name.
+90,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1270,1761,Correction to name.
+91,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1466,1762,Correction to name.
+92,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1467,1763,Correction to name.
+93,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1468,1764,Correction to name.
+94,2001-10-04 00:00:00,2001.39,Coordinate_Operation,1519,1765,Correction to name.
+95,2001-08-28 00:00:00,2001.38,Coordinate_Operation,1534,1754,Incorrect unit assigned to scale difference parameter value.
+96,2001-08-28 00:00:00,2001.35,Coordinate_Operation,1602,1752,Incorrect source geogCRS code assigned.
+97,2001-08-28 00:00:00,2001.34,Coordinate_Operation,1571,1751,Incorrect source and target geogCRS codes assigned.
+98,2001-08-28 00:00:00,2001.23,Coordinate_Operation,1567,1701,Incorrect parameter value for z-axis rotation.
+99,2001-08-15 00:00:00,2001.228,Coordinate_Operation,8386,8582,Changed second step from zero to HARN.
+100,2001-08-15 00:00:00,2001.228,Coordinate_Operation,8402,8583,Changed second step from zero to HARN.
+101,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8418,1688,Replaced concatenated tfm with zero step by single tfm.
+102,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8419,1689,Replaced concatenated tfm with zero step by single tfm.
+103,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8406,1690,Replaced concatenated tfm with zero step by single tfm.
+104,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8394,1691,Replaced concatenated tfm with zero step by single tfm.
+105,2001-11-06 00:00:00,2001.48,Coordinate_Operation,19908,19972,Change name.
+106,2001-08-28 00:00:00,2001.48,Coordinate Reference System,29900,29902,Change name.
+107,2001-06-05 00:00:00,2001.181,Area,1628,,Invalid area - country does not extend into this longitude range..
+108,2001-08-15 00:00:00,2001.227,Coordinate_Operation,8420,1703,Replaced concatenated tfm with zero step by single tfm.
+109,2001-08-28 00:00:00,2001.32,Coordinate Reference System,2155,2194,Dependent upon deprecated coordinate operation 15300.
+112,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8190,1666,Replaced concatenated tfms with zero step by single tfm with 1m accuracy.
+117,1997-11-13 00:00:00,97.372,Datum,5107,5120,Replace this general name to specific.
+135,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8190,1667,Replaced concatenated tfms with zero step by single tfm with 1m accuracy.
+142,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8578,1666,Replaced concatenated tfm with zero step by single tfms with 1m accuracy.
+160,2001-08-28 00:00:00,2001.47,Datum,6226,6143,Does not exist except as an alias of 6142 and 6143.
+161,2001-06-05 00:00:00,2001.11,Coordinate Reference System,4226,4143,Does not exist except as an alias of 4142 and 4143.
+229,2001-08-15 00:00:00,2001.221,Coordinate_Operation,8190,1668,Replaced concatenated tfms with zero step by single tfm with 1m accuracy.
+233,1997-11-13 00:00:00,97.372,Datum,5107,5119,Replace this general name to specific.
+237,2001-11-06 00:00:00,2001.53,Datum,6172,6190,Original name POSGAR is ambiguous given 1994 and 1998 adjustments.
+240,2001-11-06 00:00:00,2001.53,Coordinate Reference System,4172,4190,Original name POSGAR is ambiguous given 1994 and 1998 adjustments.
+242,2001-11-06 00:00:00,2001.53,Coordinate_Operation,1598,1773,Dependent upon deprecated source CRS 4172.
+244,2001-11-06 00:00:00,2001.54,Coordinate Reference System,27581,27571,Changed projCRS name.
+245,2001-11-06 00:00:00,2001.54,Coordinate Reference System,27582,27572,Changed projCRS name.
+246,2001-11-06 00:00:00,2001.54,Coordinate Reference System,27583,27573,Changed projCRS name.
+247,2001-11-06 00:00:00,2001.54,Coordinate Reference System,27584,27574,Changed projCRS name.
+248,2001-11-06 00:00:00,2001.54,Coordinate Reference System,27591,27561,Changed projCRS name.
+249,2001-11-06 00:00:00,2001.54,Coordinate Reference System,27592,27562,Changed projCRS name.
+250,2001-11-06 00:00:00,2001.54,Coordinate Reference System,27593,27563,Changed projCRS name.
+251,2001-11-06 00:00:00,2001.54,Coordinate Reference System,27594,27564,Changed projCRS name.
+260,2001-11-06 00:00:00,2001.54,Coordinate Reference System,7401,7411,Dependent projCRS name changed.
+261,2001-11-06 00:00:00,2001.54,Coordinate Reference System,7402,7412,Dependent projCRS name changed.
+262,2001-11-06 00:00:00,2001.54,Coordinate Reference System,7403,7413,Dependent projCRS name changed.
+266,2001-01-21 00:00:00,2001.15,Ellipsoid,7006,7046,Change of axis unit from International metre to German Legal Metre to reflect local usage.
+268,2001-11-06 00:00:00,2001.45,Coordinate Reference System,32036,2204,Dependent map projection 11631 in error.
+270,2001-11-06 00:00:00,2001.45,Coordinate Reference System,26979,2205,Dependent map projection 14100 in error.
+272,2002-01-18 00:00:00,2001.03,Coordinate_Operation,1656,,EPSG copy of ITRF transformation superseded by tfm code 1791.
+273,2002-01-18 00:00:00,2001.03,Coordinate_Operation,1658,,EPSG copy of ITRF transformation superseded by tfm code 1793.
+274,2002-01-18 00:00:00,2002.01,Datum,6228,6192,Incorrect ellipsoid attached.
+276,2002-01-18 00:00:00,2002.01,Datum,6260,6193,Incorrect ellipsoid attached.
+278,2002-01-18 00:00:00,2002.01,Coordinate Reference System,4228,4192,Dependent datum 6228 in error.
+280,2002-01-18 00:00:00,2002.01,Coordinate Reference System,4260,4193,Dependent datum 6260 in error.
+282,2002-01-18 00:00:00,2002.01,Coordinate Reference System,22832,2214,Dependent geogCRS 4228 deprecated due to datum error.
+285,2002-01-18 00:00:00,2001.17,Datum,6287,6194,Change of name.
+287,2002-01-18 00:00:00,2001.17,Coordinate Reference System,4287,4194,Change of name (adjustment date added).
+288,2002-01-18 00:00:00,2001.17,Coordinate_Operation,1211,1797,Dependent source CRS name changed.
+289,2002-02-12 00:00:00,2002.06,Coordinate_Operation,1559,1593,8-bit binary grid file format inconsistent with NTv2 16-bit format.
+290,2002-02-12 00:00:00,2002.01,Datum,6234,6197,Incorrect ellipsoid attached.
+291,2002-02-12 00:00:00,2002.21,Coordinate Reference System,32074,32064,Change name to include unit abbreviation per US State Plane CRSs.
+294,2002-02-12 00:00:00,2002.21,Coordinate Reference System,32075,32065,Change name to include unit abbreviation per US State Plane CRSs.
+295,2002-02-12 00:00:00,2002.21,Coordinate Reference System,32076,32066,Change name to include unit abbreviation per US State Plane CRSs.
+296,2002-02-12 00:00:00,2002.21,Coordinate Reference System,32077,32067,Change name to include unit abbreviation per US State Plane CRSs.
+297,2002-03-15 00:00:00,2002.29,Coordinate_Operation,1819,1754,Duplication of data already given in transformation 1754.
+298,2002-06-22 00:00:00,2002.16,Coordinate Reference System,5704,5736,Change of name following readjustment.
+299,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21473,21453,Change of CRS name to indicate longitude of origin.
+300,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21474,21454,Change of CRS name to indicate longitude of origin.
+301,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21475,21455,Change of CRS name to indicate longitude of origin.
+302,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21476,21456,Change of CRS name to indicate longitude of origin.
+303,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21477,21457,Change of CRS name to indicate longitude of origin.
+304,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21478,21458,Change of CRS name to indicate longitude of origin.
+305,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21479,21459,Change of CRS name to indicate longitude of origin.
+306,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21480,21460,Change of CRS name to indicate longitude of origin.
+307,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21481,21461,Change of CRS name to indicate longitude of origin.
+308,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21482,21462,Change of CRS name to indicate longitude of origin.
+309,2002-06-22 00:00:00,2002.16,Coordinate Reference System,21483,21463,Change of CRS name to indicate longitude of origin.
+311,2002-06-22 00:00:00,2002.36,Coordinate Reference System,2199,2462,Added hyphen to Gauss-Kruger in CRS name.
+312,2002-06-22 00:00:00,2002.36,Coordinate Reference System,2166,2397,Added hyphen to Gauss-Kruger in CRS name.
+313,2002-06-22 00:00:00,2002.36,Coordinate Reference System,2167,2398,Added hyphen to Gauss-Kruger in CRS name.
+314,2002-06-22 00:00:00,2002.36,Coordinate Reference System,2168,2399,Added hyphen to Gauss-Kruger in CRS name.
+315,2002-06-22 00:00:00,2002.36,Coordinate Reference System,2091,2395,Added hyphen to Gauss-Kruger in CRS name.
+316,2002-06-22 00:00:00,2002.36,Coordinate Reference System,2092,2396,Added hyphen to Gauss-Kruger in CRS name.
+317,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20092,2491,Change of CRS name to indicate longitude of origin.
+318,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20091,2490,Change of CRS name to indicate longitude of origin.
+319,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20090,2489,Change of CRS name to indicate longitude of origin.
+320,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20089,2488,Change of CRS name to indicate longitude of origin.
+321,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20088,2487,Change of CRS name to indicate longitude of origin.
+322,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20087,2486,Change of CRS name to indicate longitude of origin.
+323,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20086,2485,Change of CRS name to indicate longitude of origin.
+324,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20085,2484,Change of CRS name to indicate longitude of origin.
+325,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20084,2483,Change of CRS name to indicate longitude of origin.
+326,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20083,2482,Change of CRS name to indicate longitude of origin.
+327,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20082,2481,Change of CRS name to indicate longitude of origin.
+328,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20081,2480,Change of CRS name to indicate longitude of origin.
+329,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20080,2479,Change of CRS name to indicate longitude of origin.
+330,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20079,2478,Change of CRS name to indicate longitude of origin.
+331,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20078,2477,Change of CRS name to indicate longitude of origin.
+332,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20077,2476,Change of CRS name to indicate longitude of origin.
+333,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20076,2475,Change of CRS name to indicate longitude of origin.
+334,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20075,2474,Change of CRS name to indicate longitude of origin.
+335,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20074,2473,Change of CRS name to indicate longitude of origin.
+336,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20073,2472,Change of CRS name to indicate longitude of origin.
+337,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20072,2471,Change of CRS name to indicate longitude of origin.
+338,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20071,2470,Change of CRS name to indicate longitude of origin.
+339,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20070,2469,Change of CRS name to indicate longitude of origin.
+340,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20069,2468,Change of CRS name to indicate longitude of origin.
+341,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20068,2467,Change of CRS name to indicate longitude of origin.
+342,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20067,2466,Change of CRS name to indicate longitude of origin.
+343,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20066,2465,Change of CRS name to indicate longitude of origin.
+344,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20065,2464,Change of CRS name to indicate longitude of origin.
+345,2002-06-22 00:00:00,2002.36,Coordinate Reference System,20064,2463,Change of CRS name to indicate longitude of origin.
+346,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28462,2492,Change of CRS name to indicate longitude of origin.
+347,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28463,2493,Change of CRS name to indicate longitude of origin.
+348,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28464,2494,Change of CRS name to indicate longitude of origin.
+349,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28465,2495,Change of CRS name to indicate longitude of origin.
+350,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28466,2496,Change of CRS name to indicate longitude of origin.
+351,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28467,2497,Change of CRS name to indicate longitude of origin.
+352,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28468,2498,Change of CRS name to indicate longitude of origin.
+353,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28469,2499,Change of CRS name to indicate longitude of origin.
+354,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28470,2500,Change of CRS name to indicate longitude of origin.
+355,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28471,2501,Change of CRS name to indicate longitude of origin.
+356,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28472,2502,Change of CRS name to indicate longitude of origin.
+357,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28473,2503,Change of CRS name to indicate longitude of origin.
+358,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28474,2504,Change of CRS name to indicate longitude of origin.
+359,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28475,2505,Change of CRS name to indicate longitude of origin.
+360,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28476,2506,Change of CRS name to indicate longitude of origin.
+361,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28477,2507,Change of CRS name to indicate longitude of origin.
+362,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28478,2508,Change of CRS name to indicate longitude of origin.
+363,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28479,2509,Change of CRS name to indicate longitude of origin.
+364,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28480,2510,Change of CRS name to indicate longitude of origin.
+365,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28481,2511,Change of CRS name to indicate longitude of origin.
+366,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28482,2512,Change of CRS name to indicate longitude of origin.
+367,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28483,2513,Change of CRS name to indicate longitude of origin.
+368,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28484,2514,Change of CRS name to indicate longitude of origin.
+369,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28485,2515,Change of CRS name to indicate longitude of origin.
+370,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28486,2516,Change of CRS name to indicate longitude of origin.
+371,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28487,2517,Change of CRS name to indicate longitude of origin.
+372,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28488,2518,Change of CRS name to indicate longitude of origin.
+373,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28489,2519,Change of CRS name to indicate longitude of origin.
+374,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28490,2520,Change of CRS name to indicate longitude of origin.
+375,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28491,2521,Change of CRS name to indicate longitude of origin.
+376,2002-06-22 00:00:00,2002.36,Coordinate Reference System,28492,2522,Change of CRS name to indicate longitude of origin.
+377,2002-06-22 00:00:00,2002.32,Coordinate_Operation,1316,1796,Change of source CRS name.
+378,2002-06-22 00:00:00,2002.4,Coordinate_Operation,1335,1827,Incorrect unit for latitude offset.
+379,2002-06-22 00:00:00,2002.37,Coordinate_Operation,1273,1829,Incorrect sign of transformation parameter values for direction of transformation.
+380,2002-06-22 00:00:00,2002.37,Coordinate_Operation,1677,1830,Error in in sign of dX relative to source transformation 1273. Incorrect sign of transformation parameter values (other than dX) for direction of transformation.
+381,2002-06-22 00:00:00,2002.151,Datum,6294,6613,Change of spelling of name.
+382,2002-06-22 00:00:00,2002.151,Coordinate Reference System,4294,4613,Change of spelling of name.
+383,2002-06-22 00:00:00,2002.151,Coordinate_Operation,1286,1834,Change of spelling of name of source CRS.
+384,2002-06-22 00:00:00,2002.151,Datum,6125,6613,Not a self-standing datum but an extension of the Segara datum.
+385,2002-06-22 00:00:00,2002.151,Coordinate Reference System,4125,4613,Samboja is not a separate geogCRS but an extension of the Segara CRS.
+386,2002-06-22 00:00:00,2002.151,Coordinate_Operation,1282,1838,Change of name of source CRS
+387,2002-06-22 00:00:00,2002.151,Coordinate Reference System,2550,2933,Change name of source geogCRS.
+388,2002-07-13 00:00:00,2002.25,Datum,6185,6615,Information from Portugal suggests EuroGeographics information is incomplete.
+389,2002-07-13 00:00:00,2002.25,Datum,6185,6616,Information from Portugal suggests EuroGeographics information is incomplete.
+390,2002-07-13 00:00:00,2002.25,Coordinate Reference System,4185,4615,Information from Portugal suggests EuroGeographics information is incomplete.
+391,2002-07-13 00:00:00,2002.25,Coordinate Reference System,4185,4616,Information from Portugal suggests EuroGeographics information is incomplete.
+392,2002-07-13 00:00:00,2002.25,Coordinate Reference System,2191,2942,Information from Portugal suggests EuroGeographics information is incomplete.
+393,2002-07-13 00:00:00,2002.25,Coordinate Reference System,2191,2943,Information from Portugal suggests EuroGeographics information is incomplete.
+394,2002-07-13 00:00:00,2002.41,Coordinate_Operation,1473,1842,Change of Source CRS name
+395,2002-07-13 00:00:00,2002.41,Coordinate_Operation,1472,1841,Change in Target CRS name.
+396,2002-07-13 00:00:00,2002.41,Coordinate_Operation,1599,1846,Change in Target CRS name.
+397,2002-07-13 00:00:00,2002.41,Coordinate_Operation,1574,1844,Change in Target CRS name.
+398,2002-07-13 00:00:00,2002.41,Coordinate_Operation,1600,1847,Change in Target CRS name.
+399,2002-07-13 00:00:00,2002.41,Coordinate_Operation,8584,8635,Change in Target CRS name.
+400,2002-07-13 00:00:00,2002.41,Coordinate_Operation,1576,1845,Change in Target CRS name.
+401,2002-07-13 00:00:00,2002.41,Coordinate_Operation,1572,1843,Change in Target CRS name.
+402,2002-07-13 00:00:00,2002.41,Coordinate_Operation,1601,1848,Change in Target CRS name.
+403,2002-07-13 00:00:00,2002.41,Coordinate_Operation,1752,1849,Change in Target CRS name.
+404,2002-07-13 00:00:00,2002.41,Coordinate Reference System,4140,4617,Change of CRS name to accord with revised Geomatics Canada practice.
+405,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2147,2952,Change of geogCRS name to accord with revised Geomatics Canada practice.
+406,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2140,2945,Change of geogCRS name to accord with revised Geomatics Canada practice.
+407,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2141,2946,Change of geogCRS name to accord with revised Geomatics Canada practice.
+408,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2142,2947,Change of geogCRS name to accord with revised Geomatics Canada practice.
+409,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2143,2948,Change of geogCRS name to accord with revised Geomatics Canada practice.
+410,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2144,2949,Change of geogCRS name to accord with revised Geomatics Canada practice.
+411,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2145,2950,Change of geogCRS name to accord with revised Geomatics Canada practice.
+412,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2146,2951,Change of geogCRS name to accord with revised Geomatics Canada practice.
+413,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2036,2953,Change of geogCRS name to accord with revised Geomatics Canada practice.
+414,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2292,2954,Change of geogCRS name to accord with revised Geomatics Canada practice.
+415,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2139,2944,Change of geogCRS name to accord with revised Geomatics Canada practice.
+416,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2153,2955,Change of geogCRS name to accord with revised Geomatics Canada practice.
+417,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2152,2956,Change of geogCRS name to accord with revised Geomatics Canada practice.
+418,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2151,2957,Change of geogCRS name to accord with revised Geomatics Canada practice.
+419,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2150,2958,Change of geogCRS name to accord with revised Geomatics Canada practice.
+420,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2149,2959,Change of geogCRS name to accord with revised Geomatics Canada practice.
+421,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2037,2960,Change of geogCRS name to accord with revised Geomatics Canada practice.
+422,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2038,2961,Change of geogCRS name to accord with revised Geomatics Canada practice.
+423,2002-07-13 00:00:00,2002.41,Coordinate Reference System,2148,2962,Change of geogCRS name to accord with revised Geomatics Canada practice.
+424,2002-02-12 00:00:00,2002.01,Coordinate Reference System,4234,4197,Dependent datum 6228 deprecated due to ellipsoid error.
+425,2002-02-12 00:00:00,2002.01,Coordinate Reference System,23433,2312,Dependent geogCRS 4234 deprecated due to ellipsoid error.
+426,2002-07-13 00:00:00,2002.41,Area,1336,2784,Expansion of area of use.
diff --git a/src/tiff/csv/ellips_alias.c b/src/tiff/csv/ellips_alias.c
new file mode 100644
index 0000000..67dca2f
--- /dev/null
+++ b/src/tiff/csv/ellips_alias.c
@@ -0,0 +1,10 @@
+#include "defs.h"
+datafile_rows_t ellips_alias_row_1[] = {"ELLIPSOID_ALIAS_CODE","ELLIPSOID_ALIAS_NAME","ELLIPSOID_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t ellips_alias_row_2[] = {"7023","International 1967","7036","1996-10-18 00:00:00","","EPSG","Adopted by IUGG 1967 Lucerne. Inverse flattening defined to 2 d.p.  More usually known as GRS 1967 to avoid confusion with the International 1924 figure.","96.09",NULL};
+datafile_rows_t ellips_alias_row_3[] = {"7026","NWL 10D","7043","1999-04-22 00:00:00","","EPSG","Used by Transit Broadcast Ephemeris before 1989. Also referred to as WGS72 spheroid.","99.03",NULL};
+datafile_rows_t ellips_alias_row_4[] = {"7037","Clarke Modified 1880","7012","1996-10-18 00:00:00","","EPSG","The Clarke 1880 (RGS) figure is one of several modifications to the original definition.  The name Clarke Modified is usually taken to be the RGS modification.","",NULL};
+datafile_rows_t ellips_alias_row_5[] = {"7038","International 1979","7019","1996-10-18 00:00:00","","EPSG","Adopted by IUGG 1979 Canberra as the Geodetic Reference Spheroid of 1980 (GRS 1980).","",NULL};
+datafile_rows_t ellips_alias_row_6[] = {"7039","Hayford 1909","7022","1996-10-18 00:00:00","\"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" by Georg Strasser","EPSG","Described as a=6378388 m. and b=6356909 m. from which 1/f derived to be 296.95926...   The figure was adopted as the International ellipsoid in 1924 but with 1/f taken as 297 exactly from which b is derved as 6356911.946 m.","",NULL};
+datafile_rows_t ellips_alias_row_7[] = {"7040","WGS84","7030","1996-10-18 00:00:00","","EPSG","","",NULL};
+
+datafile_rows_t *ellips_alias_rows[] = {ellips_alias_row_1,ellips_alias_row_2,ellips_alias_row_3,ellips_alias_row_4,ellips_alias_row_5,ellips_alias_row_6,ellips_alias_row_7,NULL};
diff --git a/src/tiff/csv/ellips_alias.csv b/src/tiff/csv/ellips_alias.csv
new file mode 100644
index 0000000..82fab08
--- /dev/null
+++ b/src/tiff/csv/ellips_alias.csv
@@ -0,0 +1,7 @@
+"ELLIPSOID_ALIAS_CODE","ELLIPSOID_ALIAS_NAME","ELLIPSOID_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+7023,International 1967,7036,1996-10-18 00:00:00,,EPSG,Adopted by IUGG 1967 Lucerne. Inverse flattening defined to 2 d.p.  More usually known as GRS 1967 to avoid confusion with the International 1924 figure.,96.09
+7026,NWL 10D,7043,1999-04-22 00:00:00,,EPSG,Used by Transit Broadcast Ephemeris before 1989. Also referred to as WGS72 spheroid.,99.03
+7037,Clarke Modified 1880,7012,1996-10-18 00:00:00,,EPSG,The Clarke 1880 (RGS) figure is one of several modifications to the original definition.  The name Clarke Modified is usually taken to be the RGS modification.,
+7038,International 1979,7019,1996-10-18 00:00:00,,EPSG,Adopted by IUGG 1979 Canberra as the Geodetic Reference Spheroid of 1980 (GRS 1980).,
+7039,Hayford 1909,7022,1996-10-18 00:00:00,"\"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" by Georg Strasser",EPSG,Described as a=6378388 m. and b=6356909 m. from which 1/f derived to be 296.95926...   The figure was adopted as the International ellipsoid in 1924 but with 1/f taken as 297 exactly from which b is derved as 6356911.946 m.,
+7040,WGS84,7030,1996-10-18 00:00:00,,EPSG,,
diff --git a/src/tiff/csv/ellipsoid.c b/src/tiff/csv/ellipsoid.c
new file mode 100644
index 0000000..0700f4b
--- /dev/null
+++ b/src/tiff/csv/ellipsoid.c
@@ -0,0 +1,42 @@
+#include "defs.h"
+datafile_rows_t ellipsoid_row_1[] = {"ELLIPSOID_CODE","ELLIPSOID_EPSG_NAME","ELLIPSOID_USER_NAME","SEMI_MAJOR_AXIS","UOM_LENGTH_CODE","INV_FLATTENING","SEMI_MINOR_AXIS","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t ellipsoid_row_2[] = {"7001","Airy 1830","","6377563.396","9001","299.3249646","","1995-06-02 00:00:00","Ordnance Survey of Great Britain.","EPSG","Original definition is a=20923713 and b=20853810 feet of 1796.   For the 1936 retriangulation OSGB defines the relationship of feet of 1796 to the International metre through log(1.48401603) exactly [=0.3048007491...]. 1/f is given to 7 decimal places.","98.321  98.34",NULL};
+datafile_rows_t ellipsoid_row_3[] = {"7002","Airy Modified 1849","","6377340.189","9001","299.3249646","","1995-06-02 00:00:00","","EPSG","OSGB Airy 1830 figure rescaled by 1.000035 to best fit the primary triangulation of Ireland.","98.321",NULL};
+datafile_rows_t ellipsoid_row_4[] = {"7003","Australian National Spheroid","","6378160.0","9001","298.25","","1995-06-02 00:00:00","\"Australian Map Grid Technical Manual\"; National Mapping Council of Australia Special Publication #7; 1972","EPSG","Based on the GRS 1967 figure but with 1/f taken to 2 decimal places exactly.","",NULL};
+datafile_rows_t ellipsoid_row_5[] = {"7004","Bessel 1841","","6377397.155","9001","299.1528128","","1999-04-22 00:00:00","US Army Map Service Technical Manual; 1943.","EPSG","Original Bessel definition is a=3272077.14 and b=3261139.33 toise. This used a weighted mean of values from several authors but did not account for differences in the length of the various toise: the \"Bessel toise\" is therefore of uncertain length.","98.321  98.34",NULL};
+datafile_rows_t ellipsoid_row_6[] = {"7005","Bessel Modified","","6377492.018","9001","299.1528128","","1999-04-22 00:00:00","","EPSG","Used in Norway and also in Sweden with a 1mm increase in semi-major axis.","98.321",NULL};
+datafile_rows_t ellipsoid_row_7[] = {"7006","Bessel Namibia","","6377483.865","9001","299.1528128","","1999-04-22 00:00:00","","EPSG","a = 6377397.155 German legal metres. This is the same value as the Bessel 1841 figure (code 7004) but in different units.  Used in Namibia.","97.16",NULL};
+datafile_rows_t ellipsoid_row_8[] = {"7007","Clarke 1858","","20926348.0","9005","","20855233.0","1995-06-02 00:00:00","\"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" by Georg Strasser.","EPSG","Clarke's 1858/II solution. Derived parameters: a = 6378293.645m using his 1865 ratio of 0.304797265 feet per metre; 1/f = 294.26068�  In historic usage in Australia 1/f taken to two decimal places (294.26 exactly); elsewhere a and b used to derive 1/f.","99.70",NULL};
+datafile_rows_t ellipsoid_row_9[] = {"7008","Clarke 1866","","6378206.4","9001","","6356583.8","1995-06-02 00:00:00","US Army Map Service Technical Manual No. 7; 1943.","EPSG","Original definition a=20926062 and b=20855121 (British) feet. Uses Clarke's 1865 inch-metre ratio of 39.370432 to obtain metres. (Metric value then converted to US survey feet for use in the United States using 39.37 exactly giving a=20925832.16 ft US).","98.34",NULL};
+datafile_rows_t ellipsoid_row_10[] = {"7009","Clarke 1866 Michigan","","20926631.531","9003","","20855688.674","1995-06-02 00:00:00","USGS Professional Paper #1395.","EPSG","Used for Michigan NAD27 State Plane zones.  Radius = ellipsoid radius + 800 feet; this approximates the average elevation of the state.   Derived parameter: 1/f = 294.97870","98.22",NULL};
+datafile_rows_t ellipsoid_row_11[] = {"7010","Clarke 1880 (Benoit)","","6378300.789","9001","","6356566.435","1995-06-02 00:00:00","","EPSG","Adopts Clarke's values for a and b.  Uses Benoit's 1895 ratio of 0.9143992 metres per yard to convert to metres.","",NULL};
+datafile_rows_t ellipsoid_row_12[] = {"7011","Clarke 1880 (IGN)","","6378249.2","9001","","6356515.0","1998-04-16 00:00:00","","EPSG","Adopts Clarke's values for a and b using his 1865 ratio of 39.370432 inches per metre to convert axes to metres.","98.12",NULL};
+datafile_rows_t ellipsoid_row_13[] = {"7012","Clarke 1880 (RGS)","","6378249.145","9001","293.465","","1995-06-02 00:00:00","Empire Survey Review #32; 1939.","EPSG","Adopts Clarke's values for a and 1/f.  Adopts his 1865 ratio of 39.370432 inches per metre to convert semi-major axis to metres. Also known as Clarke Modified 1880.","",NULL};
+datafile_rows_t ellipsoid_row_14[] = {"7013","Clarke 1880 (Arc)","","6378249.145","9001","293.4663077","","1999-04-22 00:00:00","","EPSG","Adopts Clarke's value for a with derived 1/f.  Uses his 1865 ratio of 39.370432 inch per metre to convert semi-major axis to metres.","",NULL};
+datafile_rows_t ellipsoid_row_15[] = {"7014","Clarke 1880 (SGA 1922)","","6378249.2","9001","293.46598","","1995-06-02 00:00:00","","EPSG","Used in Old French Triangulation (ATF).   Uses Clarke's 1865 inch-metre ratio of 39.370432 to convert axes to metres.","",NULL};
+datafile_rows_t ellipsoid_row_16[] = {"7015","Everest 1830 (1937 Adjustment)","","6377276.345","9001","300.8017","","1996-10-18 00:00:00","Survey of India professional paper #28; 1939","EPSG","Used for the 1937 readjustment of Indian triangulation.  Clarke's 1865 Indian-British foot ratio (0.99999566) and Benoit's 1898 British inch-metre ratio (39.370113) rounded as 0.30479841 exactly and applied to Everest's 1830 definition taken as a and 1/f","96.20",NULL};
+datafile_rows_t ellipsoid_row_17[] = {"7016","Everest 1830 (1967 Definition)","","6377298.556","9001","300.8017","","1995-06-02 00:00:00","","EPSG","Adopted 1967 for use in East Malaysia.  Applies Sears 1922 inch-metre ratio of 39.370147 to Everest 1830 original definition of a and 1/f but with a taken to be in British rather than Indian feet.","",NULL};
+datafile_rows_t ellipsoid_row_18[] = {"7018","Everest 1830 Modified","","6377304.063","9001","300.8017","","1995-06-02 00:00:00","","EPSG","Adopted 1967 for use in West Malaysia.  Applies Benoit 1898 inch-metre ratio of 39.370113 to Everest 1830 original definition of a and 1/f but with a taken to be in British rather than Indian feet.","",NULL};
+datafile_rows_t ellipsoid_row_19[] = {"7019","GRS 1980","","6378137.0","9001","298.257222101","","1998-11-11 00:00:00","\"Geodetic Reference System 1980\" by H. Moritz; Bulletin Geodesique","EPSG","Adopted by IUGG 1979 Canberra.  Inverse flattening is derived from geocentric gravitational constant GM = 3986005e8 m*m*m/s/s; dynamic form factor J2 = 108263e8 and Earth's angular velocity = 7292115e-11 rad/s.","98.11  98.32",NULL};
+datafile_rows_t ellipsoid_row_20[] = {"7020","Helmert 1906","","6378200.0","9001","298.3","","1995-06-02 00:00:00","\"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" by Georg Strasser","EPSG","Helmert 1906/III solution.","",NULL};
+datafile_rows_t ellipsoid_row_21[] = {"7021","Indonesian National Spheroid","","6378160.0","9001","298.247","","1995-06-02 00:00:00","Rais paper.","EPSG","Based on the GRS 1967 figure but with 1/f taken to 3 decimal places exactly.","",NULL};
+datafile_rows_t ellipsoid_row_22[] = {"7022","International 1924","","6378388.0","9001","297.0","","1995-06-02 00:00:00","","EPSG","Adopted by IUGG 1924 in Madrid. Based on Hayford 1909/1910 figures.","",NULL};
+datafile_rows_t ellipsoid_row_23[] = {"7024","Krassowsky 1940","","6378245.0","9001","298.3","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t ellipsoid_row_24[] = {"7025","NWL 9D","","6378145.0","9001","298.25","","1995-06-02 00:00:00","","EPSG","Used by Transit Precise Ephemeris between October 1971 and January 1987.","",NULL};
+datafile_rows_t ellipsoid_row_25[] = {"7027","Plessis 1817","","6376523.0","9001","308.64","","1995-06-02 00:00:00","IGN Paris \"Constants d'Ellipsoides\" February 1972.","EPSG","Rescaling of Delambre 1810 figure (a=6376985 m) to make meridional arc from equator to pole equal to 10000000 metres exactly. (Ref: Strasser).","",NULL};
+datafile_rows_t ellipsoid_row_26[] = {"7028","Struve 1860","","6378298.3","9001","294.73","","1998-11-11 00:00:00","\"Geodesia y Cartografia Matematica\" by Fernando Martin Asin; ISBN 84-398-0248-X.","EPSG","Original definition of semi-major axis given as 3272539 toise.  In \"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" , Strasser suggests a conversion factor of 1.94903631 which gives a=6378297.337 metres.","98.07  98.34",NULL};
+datafile_rows_t ellipsoid_row_27[] = {"7029","War Office","","6378300.583","9001","296.0","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t ellipsoid_row_28[] = {"7030","WGS 84","","6378137.0","9001","298.257223563","","1998-11-11 00:00:00","DMA Technical Manual 8350.2-B","EPSG","Inverse flattening derived from four defining parameters (semi-major axis; C20 = -484.16685*10e-6; earth's angular velocity w = 7292115e11 rad/sec; gravitational constant GM = 3986005e8 m*m*m/s/s).","98.32",NULL};
+datafile_rows_t ellipsoid_row_29[] = {"7031","GEM 10C","","6378137.0","9001","298.257223563","","1995-06-02 00:00:00","","EPSG","Used for  GEM 10C Gravity Potential Model.","98.32",NULL};
+datafile_rows_t ellipsoid_row_30[] = {"7032","OSU86F","","6378136.2","9001","298.257223563","","1995-06-02 00:00:00","","EPSG","Used for OSU86 gravity potential (geoidal) model.","98.32",NULL};
+datafile_rows_t ellipsoid_row_31[] = {"7033","OSU91A","","6378136.3","9001","298.257223563","","1995-06-02 00:00:00","","EPSG","Used for OSU91 gravity potential (geoidal) model.","98.32",NULL};
+datafile_rows_t ellipsoid_row_32[] = {"7034","Clarke 1880","","20926202.0","9005","293.465","20854895.0","1995-06-02 00:00:00","\"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" by Georg Strasser.","EPSG","Clarke gave a and b and also 1/f=293.465 (to 3 decimal places).  1/f derived from a and b = 293.4663077�","",NULL};
+datafile_rows_t ellipsoid_row_33[] = {"7035","Sphere","","6371000.0","9001","","6371000.0","1995-06-02 00:00:00","","EPSG","Authalic sphere.  1/f is infinite.","",NULL};
+datafile_rows_t ellipsoid_row_34[] = {"7036","GRS 1967","","6378160.0","9001","298.247167427","","1998-11-11 00:00:00","\"Geodetic Reference System 1967\"; International Association of Geodesy special publication number 3; August 1971.","EPSG","Adopted by IUGG 1967 Lucerne.  Inverse flattening given is derived from geocentric gravitational constant (GM)= 398603e9 m*m*m/s/s; dynamic form factor (J2) = 0.0010827 and Earth's angular velocity w = 7.2921151467e-5 rad/s.","96.09  97.252  98.32 [...]
+datafile_rows_t ellipsoid_row_35[] = {"7041","Average Terrestrial System 1977","","6378135.0","9001","298.257","","1997-07-22 00:00:00","New Brunswick Geographic Information Corporation land and water information standards manual","EPSG","","98.321",NULL};
+datafile_rows_t ellipsoid_row_36[] = {"7042","Everest (1830 Definition)","","20922931.8","9080","300.8017","20853374.58","1999-10-20 00:00:00","\"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" by Georg Strasser","EPSG","Everest gave a and b to 2 decimal places and also 1/f=300.8017 (to 4 decimal places).","97.23",NULL};
+datafile_rows_t ellipsoid_row_37[] = {"7043","WGS 72","","6378135.0","9001","298.26","","1999-04-22 00:00:00","","EPSG","","99.03",NULL};
+datafile_rows_t ellipsoid_row_38[] = {"7044","Everest 1830 (1962 Definition)","","6377301.243","9001","300.8017255","","1999-10-20 00:00:00","","EPSG","Used by Pakistan since metrication.  Clarke's 1865 Indian foot-British foot ratio (0.99999566) and his 1865 British inch-metre ratio (39.369971) rounded with slight error as 1 Ind ft = 0.3047995m exactly and applied to Everest's 1830 definition of a & b.","",NULL};
+datafile_rows_t ellipsoid_row_39[] = {"7045","Everest 1830 (1975 Definition)","","6377299.151","9001","300.8017255","","1999-10-20 00:00:00","","EPSG","Used by India since metrication.  Clarke's 1865 Indian foot-British foot ratio (0.99999566) and his 1865 British inch-metre ratio (39.369971) rounded as 1 Ind ft = 0.3047995m exactly applied to Everest's 1830 original definition taken as a and b.","",NULL};
+
+datafile_rows_t *ellipsoid_rows[] = {ellipsoid_row_1,ellipsoid_row_2,ellipsoid_row_3,ellipsoid_row_4,ellipsoid_row_5,ellipsoid_row_6,ellipsoid_row_7,ellipsoid_row_8,ellipsoid_row_9,ellipsoid_row_10,ellipsoid_row_11,ellipsoid_row_12,ellipsoid_row_13,ellipsoid_row_14,ellipsoid_row_15,ellipsoid_row_16,ellipsoid_row_17,ellipsoid_row_18,ellipsoid_row_19,ellipsoid_row_20,ellipsoid_row_21,ellipsoid_row_22,ellipsoid_row_23,ellipsoid_row_24,ellipsoid_row_25,ellipsoid_row_26,ellipsoid_row_27,ellip [...]
diff --git a/src/tiff/csv/ellipsoid.csv b/src/tiff/csv/ellipsoid.csv
new file mode 100644
index 0000000..ac6477b
--- /dev/null
+++ b/src/tiff/csv/ellipsoid.csv
@@ -0,0 +1,39 @@
+"ELLIPSOID_CODE","ELLIPSOID_EPSG_NAME","ELLIPSOID_USER_NAME","SEMI_MAJOR_AXIS","UOM_LENGTH_CODE","INV_FLATTENING","SEMI_MINOR_AXIS","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+7001,Airy 1830,,6377563.396,9001,299.3249646,,1995-06-02 00:00:00,Ordnance Survey of Great Britain.,EPSG,Original definition is a=20923713 and b=20853810 feet of 1796.   For the 1936 retriangulation OSGB defines the relationship of feet of 1796 to the International metre through log(1.48401603) exactly [=0.3048007491...]. 1/f is given to 7 decimal places.,98.321  98.34
+7002,Airy Modified 1849,,6377340.189,9001,299.3249646,,1995-06-02 00:00:00,,EPSG,OSGB Airy 1830 figure rescaled by 1.000035 to best fit the primary triangulation of Ireland.,98.321
+7003,Australian National Spheroid,,6378160.0,9001,298.25,,1995-06-02 00:00:00,"\"Australian Map Grid Technical Manual\"; National Mapping Council of Australia Special Publication #7; 1972",EPSG,Based on the GRS 1967 figure but with 1/f taken to 2 decimal places exactly.,
+7004,Bessel 1841,,6377397.155,9001,299.1528128,,1999-04-22 00:00:00,US Army Map Service Technical Manual; 1943.,EPSG,"Original Bessel definition is a=3272077.14 and b=3261139.33 toise. This used a weighted mean of values from several authors but did not account for differences in the length of the various toise: the \"Bessel toise\" is therefore of uncertain length.",98.321  98.34
+7005,Bessel Modified,,6377492.018,9001,299.1528128,,1999-04-22 00:00:00,,EPSG,Used in Norway and also in Sweden with a 1mm increase in semi-major axis.,98.321
+7006,Bessel Namibia,,6377483.865,9001,299.1528128,,1999-04-22 00:00:00,,EPSG,a = 6377397.155 German legal metres. This is the same value as the Bessel 1841 figure (code 7004) but in different units.  Used in Namibia.,97.16
+7007,Clarke 1858,,20926348.0,9005,,20855233.0,1995-06-02 00:00:00,"\"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" by Georg Strasser.",EPSG,Clarke's 1858/II solution. Derived parameters: a = 6378293.645m using his 1865 ratio of 0.304797265 feet per metre; 1/f = 294.26068�  In historic usage in Australia 1/f taken to two decimal places (294.26 exactly); elsewhere a and b used to derive 1/f.,99.70
+7008,Clarke 1866,,6378206.4,9001,,6356583.8,1995-06-02 00:00:00,US Army Map Service Technical Manual No. 7; 1943.,EPSG,Original definition a=20926062 and b=20855121 (British) feet. Uses Clarke's 1865 inch-metre ratio of 39.370432 to obtain metres. (Metric value then converted to US survey feet for use in the United States using 39.37 exactly giving a=20925832.16 ft US).,98.34
+7009,Clarke 1866 Michigan,,20926631.531,9003,,20855688.674,1995-06-02 00:00:00,USGS Professional Paper #1395.,EPSG,Used for Michigan NAD27 State Plane zones.  Radius = ellipsoid radius + 800 feet; this approximates the average elevation of the state.   Derived parameter: 1/f = 294.97870,98.22
+7010,Clarke 1880 (Benoit),,6378300.789,9001,,6356566.435,1995-06-02 00:00:00,,EPSG,Adopts Clarke's values for a and b.  Uses Benoit's 1895 ratio of 0.9143992 metres per yard to convert to metres.,
+7011,Clarke 1880 (IGN),,6378249.2,9001,,6356515.0,1998-04-16 00:00:00,,EPSG,Adopts Clarke's values for a and b using his 1865 ratio of 39.370432 inches per metre to convert axes to metres.,98.12
+7012,Clarke 1880 (RGS),,6378249.145,9001,293.465,,1995-06-02 00:00:00,Empire Survey Review #32; 1939.,EPSG,Adopts Clarke's values for a and 1/f.  Adopts his 1865 ratio of 39.370432 inches per metre to convert semi-major axis to metres. Also known as Clarke Modified 1880.,
+7013,Clarke 1880 (Arc),,6378249.145,9001,293.4663077,,1999-04-22 00:00:00,,EPSG,Adopts Clarke's value for a with derived 1/f.  Uses his 1865 ratio of 39.370432 inch per metre to convert semi-major axis to metres.,
+7014,Clarke 1880 (SGA 1922),,6378249.2,9001,293.46598,,1995-06-02 00:00:00,,EPSG,Used in Old French Triangulation (ATF).   Uses Clarke's 1865 inch-metre ratio of 39.370432 to convert axes to metres.,
+7015,Everest 1830 (1937 Adjustment),,6377276.345,9001,300.8017,,1996-10-18 00:00:00,Survey of India professional paper #28; 1939,EPSG,Used for the 1937 readjustment of Indian triangulation.  Clarke's 1865 Indian-British foot ratio (0.99999566) and Benoit's 1898 British inch-metre ratio (39.370113) rounded as 0.30479841 exactly and applied to Everest's 1830 definition taken as a and 1/f,96.20
+7016,Everest 1830 (1967 Definition),,6377298.556,9001,300.8017,,1995-06-02 00:00:00,,EPSG,Adopted 1967 for use in East Malaysia.  Applies Sears 1922 inch-metre ratio of 39.370147 to Everest 1830 original definition of a and 1/f but with a taken to be in British rather than Indian feet.,
+7018,Everest 1830 Modified,,6377304.063,9001,300.8017,,1995-06-02 00:00:00,,EPSG,Adopted 1967 for use in West Malaysia.  Applies Benoit 1898 inch-metre ratio of 39.370113 to Everest 1830 original definition of a and 1/f but with a taken to be in British rather than Indian feet.,
+7019,GRS 1980,,6378137.0,9001,298.257222101,,1998-11-11 00:00:00,"\"Geodetic Reference System 1980\" by H. Moritz; Bulletin Geodesique",EPSG,Adopted by IUGG 1979 Canberra.  Inverse flattening is derived from geocentric gravitational constant GM = 3986005e8 m*m*m/s/s; dynamic form factor J2 = 108263e8 and Earth's angular velocity = 7292115e-11 rad/s.,98.11  98.32
+7020,Helmert 1906,,6378200.0,9001,298.3,,1995-06-02 00:00:00,"\"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" by Georg Strasser",EPSG,Helmert 1906/III solution.,
+7021,Indonesian National Spheroid,,6378160.0,9001,298.247,,1995-06-02 00:00:00,Rais paper.,EPSG,Based on the GRS 1967 figure but with 1/f taken to 3 decimal places exactly.,
+7022,International 1924,,6378388.0,9001,297.0,,1995-06-02 00:00:00,,EPSG,Adopted by IUGG 1924 in Madrid. Based on Hayford 1909/1910 figures.,
+7024,Krassowsky 1940,,6378245.0,9001,298.3,,1995-06-02 00:00:00,,EPSG,,
+7025,NWL 9D,,6378145.0,9001,298.25,,1995-06-02 00:00:00,,EPSG,Used by Transit Precise Ephemeris between October 1971 and January 1987.,
+7027,Plessis 1817,,6376523.0,9001,308.64,,1995-06-02 00:00:00,"IGN Paris \"Constants d'Ellipsoides\" February 1972.",EPSG,Rescaling of Delambre 1810 figure (a=6376985 m) to make meridional arc from equator to pole equal to 10000000 metres exactly. (Ref: Strasser).,
+7028,Struve 1860,,6378298.3,9001,294.73,,1998-11-11 00:00:00,"\"Geodesia y Cartografia Matematica\" by Fernando Martin Asin; ISBN 84-398-0248-X.",EPSG,"Original definition of semi-major axis given as 3272539 toise.  In \"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" , Strasser suggests a conversion factor of 1.94903631 which gives a=6378297.337 metres.",98.07  98.34
+7029,War Office,,6378300.583,9001,296.0,,1995-06-02 00:00:00,,EPSG,,
+7030,WGS 84,,6378137.0,9001,298.257223563,,1998-11-11 00:00:00,DMA Technical Manual 8350.2-B,EPSG,Inverse flattening derived from four defining parameters (semi-major axis; C20 = -484.16685*10e-6; earth's angular velocity w = 7292115e11 rad/sec; gravitational constant GM = 3986005e8 m*m*m/s/s).,98.32
+7031,GEM 10C,,6378137.0,9001,298.257223563,,1995-06-02 00:00:00,,EPSG,Used for  GEM 10C Gravity Potential Model.,98.32
+7032,OSU86F,,6378136.2,9001,298.257223563,,1995-06-02 00:00:00,,EPSG,Used for OSU86 gravity potential (geoidal) model.,98.32
+7033,OSU91A,,6378136.3,9001,298.257223563,,1995-06-02 00:00:00,,EPSG,Used for OSU91 gravity potential (geoidal) model.,98.32
+7034,Clarke 1880,,20926202.0,9005,293.465,20854895.0,1995-06-02 00:00:00,"\"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" by Georg Strasser.",EPSG,Clarke gave a and b and also 1/f=293.465 (to 3 decimal places).  1/f derived from a and b = 293.4663077�,
+7035,Sphere,,6371000.0,9001,,6371000.0,1995-06-02 00:00:00,,EPSG,Authalic sphere.  1/f is infinite.,
+7036,GRS 1967,,6378160.0,9001,298.247167427,,1998-11-11 00:00:00,"\"Geodetic Reference System 1967\"; International Association of Geodesy special publication number 3; August 1971.",EPSG,Adopted by IUGG 1967 Lucerne.  Inverse flattening given is derived from geocentric gravitational constant (GM)= 398603e9 m*m*m/s/s; dynamic form factor (J2) = 0.0010827 and Earth's angular velocity w = 7.2921151467e-5 rad/s.,96.09  97.252  98.32
+7041,Average Terrestrial System 1977,,6378135.0,9001,298.257,,1997-07-22 00:00:00,New Brunswick Geographic Information Corporation land and water information standards manual,EPSG,,98.321
+7042,Everest (1830 Definition),,20922931.8,9080,300.8017,20853374.58,1999-10-20 00:00:00,"\"Ellipsoidisch Parameter der Erdfigur (1800-1950)\" by Georg Strasser",EPSG,Everest gave a and b to 2 decimal places and also 1/f=300.8017 (to 4 decimal places).,97.23
+7043,WGS 72,,6378135.0,9001,298.26,,1999-04-22 00:00:00,,EPSG,,99.03
+7044,Everest 1830 (1962 Definition),,6377301.243,9001,300.8017255,,1999-10-20 00:00:00,,EPSG,Used by Pakistan since metrication.  Clarke's 1865 Indian foot-British foot ratio (0.99999566) and his 1865 British inch-metre ratio (39.369971) rounded with slight error as 1 Ind ft = 0.3047995m exactly and applied to Everest's 1830 definition of a & b.,
+7045,Everest 1830 (1975 Definition),,6377299.151,9001,300.8017255,,1999-10-20 00:00:00,,EPSG,Used by India since metrication.  Clarke's 1865 Indian foot-British foot ratio (0.99999566) and his 1865 British inch-metre ratio (39.369971) rounded as 1 Ind ft = 0.3047995m exactly applied to Everest's 1830 original definition taken as a and b.,
diff --git a/src/tiff/csv/gcs.csv b/src/tiff/csv/gcs.csv
new file mode 100644
index 0000000..986eedb
--- /dev/null
+++ b/src/tiff/csv/gcs.csv
@@ -0,0 +1,278 @@
+"COORD_REF_SYS_CODE","COORD_REF_SYS_NAME","DATUM_CODE","DATUM_NAME","GREENWICH_DATUM","UOM_CODE","ELLIPSOID_CODE","PRIME_MERIDIAN_CODE","COORD_OP_METHOD_CODE","DX","DY","DZ","RX","RY","RZ","DS"
+4001,Unknown datum based upon the Airy 1830 ellipsoid,6001,"Not specified (based on Airy 1830 ellipsoid)",6001,9108,7001,8901,,,,,,,,
+4002,Unknown datum based upon the Airy Modified 1849 ellipsoid,6002,"Not specified (based on Airy Modified 1849 ellipsoid)",6002,9108,7002,8901,,,,,,,,
+4003,Unknown datum based upon the Australian National Spheroid,6003,"Not specified (based on Australian National Spheroid)",6003,9108,7003,8901,,,,,,,,
+4004,Unknown datum based upon the Bessel 1841 ellipsoid,6004,"Not specified (based on Bessel 1841 ellipsoid)",6004,9108,7004,8901,,,,,,,,
+4005,Unknown datum based upon the Bessel Modified ellipsoid,6005,"Not specified (based on Bessel Modified ellipsoid)",6005,9108,7005,8901,,,,,,,,
+4006,Unknown datum based upon the Bessel Namibia ellipsoid,6006,"Not specified (based on Bessel Namibia ellipsoid)",6006,9108,7046,8901,,,,,,,,
+4007,Unknown datum based upon the Clarke 1858 ellipsoid,6007,"Not specified (based on Clarke 1858 ellipsoid)",6007,9108,7007,8901,,,,,,,,
+4008,Unknown datum based upon the Clarke 1866 ellipsoid,6008,"Not specified (based on Clarke 1866 ellipsoid)",6008,9108,7008,8901,,,,,,,,
+4009,Unknown datum based upon the Clarke 1866 Michigan ellipsoid,6009,"Not specified (based on Clarke 1866 Michigan ellipsoid)",6009,9108,7009,8901,,,,,,,,
+4010,"Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid",6010,"Not specified (based on Clarke 1880 (Benoit) ellipsoid)",6010,9108,7010,8901,,,,,,,,
+4011,"Unknown datum based upon the Clarke 1880 (IGN) ellipsoid",6011,"Not specified (based on Clarke 1880 (IGN) ellipsoid)",6011,9108,7011,8901,,,,,,,,
+4012,"Unknown datum based upon the Clarke 1880 (RGS) ellipsoid",6012,"Not specified (based on Clarke 1880 (RGS) ellipsoid)",6012,9108,7012,8901,,,,,,,,
+4013,"Unknown datum based upon the Clarke 1880 (Arc) ellipsoid",6013,"Not specified (based on Clarke 1880 (Arc) ellipsoid)",6013,9108,7013,8901,,,,,,,,
+4014,"Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid",6014,"Not specified (based on Clarke 1880 (SGA 1922) ellipsoid)",6014,9108,7014,8901,,,,,,,,
+4015,"Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid",6015,"Not specified (based on Everest 1830 (1937 Adjustment) ellipsoid)",6015,9108,7015,8901,,,,,,,,
+4016,"Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid",6016,"Not specified (based on Everest 1830 (1967 Definition) ellipsoid)",6016,9108,7016,8901,,,,,,,,
+4018,Unknown datum based upon the Everest 1830 Modified ellipsoid,6018,"Not specified (based on Everest 1830 Modified ellipsoid)",6018,9108,7018,8901,,,,,,,,
+4019,Unknown datum based upon the GRS 1980 ellipsoid,6019,"Not specified (based on GRS 1980 ellipsoid)",6019,9108,7019,8901,,,,,,,,
+4020,Unknown datum based upon the Helmert 1906 ellipsoid,6020,"Not specified (based on Helmert 1906 ellipsoid)",6020,9108,7020,8901,,,,,,,,
+4021,Unknown datum based upon the Indonesian National Spheroid,6021,"Not specified (based on Indonesian National Spheroid)",6021,9108,7021,8901,,,,,,,,
+4022,Unknown datum based upon the International 1924 ellipsoid,6022,"Not specified (based on International 1924 ellipsoid)",6022,9108,7022,8901,,,,,,,,
+4024,Unknown datum based upon the Krassowsky 1940 ellipsoid,6024,"Not specified (based on Krassowsky 1940 ellipsoid)",6024,9108,7024,8901,,,,,,,,
+4025,Unknown datum based upon the NWL 9D ellipsoid,6025,"Not specified (based on NWL 9D ellipsoid)",6025,9108,7025,8901,,,,,,,,
+4027,Unknown datum based upon the Plessis 1817 ellipsoid,6027,"Not specified (based on Plessis 1817 ellipsoid)",6027,9108,7027,8901,,,,,,,,
+4028,Unknown datum based upon the Struve 1860 ellipsoid,6028,"Not specified (based on Struve 1860 ellipsoid)",6028,9108,7028,8901,,,,,,,,
+4029,Unknown datum based upon the War Office ellipsoid,6029,"Not specified (based on War Office ellipsoid)",6029,9108,7029,8901,,,,,,,,
+4030,Unknown datum based upon the WGS 84 ellipsoid,6030,"Not specified (based on WGS 84 ellipsoid)",6030,9108,7030,8901,,,,,,,,
+4031,Unknown datum based upon the GEM 10C ellipsoid,6031,"Not specified (based on GEM 10C ellipsoid)",6031,9108,7031,8901,,,,,,,,
+4032,Unknown datum based upon the OSU86F ellipsoid,6032,"Not specified (based on OSU86F ellipsoid)",6032,9108,7032,8901,,,,,,,,
+4033,Unknown datum based upon the OSU91A ellipsoid,6033,"Not specified (based on OSU91A ellipsoid)",6033,9108,7033,8901,,,,,,,,
+4034,Unknown datum based upon the Clarke 1880 ellipsoid,6034,"Not specified (based on Clarke 1880 ellipsoid)",6034,9108,7034,8901,,,,,,,,
+4035,Unknown datum based upon the Authalic Sphere,6035,"Not specified (based on Authalic Sphere)",6035,9108,7035,8901,,,,,,,,
+4036,Unknown datum based upon the GRS 1967 ellipsoid,6036,"Not specified (based on GRS 1967 ellipsoid)",6036,9108,7036,8901,,,,,,,,
+4041,Unknown datum based upon the Average Terrestrial System 1977 ellipsoid,6041,"Not specified (based on Average Terrestrial System 1977 ellipsoid)",6041,9108,7041,8901,,,,,,,,
+4042,"Unknown datum based upon the Everest (1830 Definition) ellipsoid",6042,"Not specified (based on Everest (1830 Definition) ellipsoid)",6042,9108,7042,8901,,,,,,,,
+4043,Unknown datum based upon the WGS 72 ellipsoid,6043,"Not specified (based on WGS 72 ellipsoid)",6043,9108,7043,8901,,,,,,,,
+4044,"Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid",6044,"Not specified (based on Everest 1830 (1962 Definition) ellipsoid)",6044,9108,7044,8901,,,,,,,,
+4045,"Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid",6045,"Not specified (based on Everest 1830 (1975 Definition) ellipsoid)",6045,9108,7045,8901,,,,,,,,
+4047,Unspecified based upon the GRS 1980 Authalic Sphere,6047,"Not specified (based on GRS 1980 Authalic Sphere)",6047,9108,7047,8901,,,,,,,,
+4120,Greek,6120,Greek,6120,9108,7004,8901,,,,,,,,
+4121,GGRS87,6121,Greek Geodetic Reference System 1987,6121,9108,7019,8901,9603,-199.87,74.79,246.62,,,,
+4122,ATS77,6122,Average Terrestrial System 1977,6122,9108,7041,8901,,,,,,,,
+4123,KKJ,6123,Kartasto Koordinaati Jarjestelma 1966,6123,9108,7022,8901,9606,-90.7,-106.1,-119.2,4.09,0.218,-1.05,1.37
+4124,RT90,6124,Rikets koordinatsystem 1990,6124,9108,7004,8901,,,,,,,,
+4125,Samboja,6125,Samboja,6125,9108,7004,8901,9603,-404.78,685.68,45.47,,,,
+4126,"LKS94 (ETRS89)",6126,"Lithuania 1994 (ETRS89)",6126,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4127,Tete,6127,Tete,6127,9108,7008,8901,,,,,,,,
+4128,Madzansua,6128,Madzansua,6128,9108,7008,8901,,,,,,,,
+4129,Observatario,6129,Observatario,6129,9108,7008,8901,,,,,,,,
+4130,Moznet,6130,"Moznet (ITRF94)",6130,9108,7030,8901,9607,0.0,0.0,0.0,0.0,0.0,0.0,0.0
+4131,Indian 1960,6131,Indian 1960,6131,9108,7015,8901,,,,,,,,
+4132,FD58,6132,Final Datum 1958,6132,9108,7012,8901,,,,,,,,
+4133,EST92,6133,Estonia 1992,6133,9108,7019,8901,9607,0.055,-0.541,-0.185,-0.0183,0.0003,0.007,-0.014
+4134,PDO Survey Datum 1993,6134,PDO Survey Datum 1993,6134,9108,7012,8901,,,,,,,,
+4135,Old Hawaiian,6135,Old Hawaiian,6135,9108,7008,8901,,,,,,,,
+4136,St. Lawrence Island,6136,St. Lawrence Island,6136,9108,7008,8901,,,,,,,,
+4137,St. Paul Island,6137,St. Paul Island,6137,9108,7008,8901,,,,,,,,
+4138,St. George Island,6138,St. George Island,6138,9108,7008,8901,,,,,,,,
+4139,Puerto Rico,6139,Puerto Rico,6139,9108,7008,8901,,,,,,,,
+4140,"NAD83(CSRS98)",6140,NAD83 Canadian Spatial Reference System,6140,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4141,Israel,6141,Israel,6141,9108,7019,8901,,,,,,,,
+4142,Locodjo 1965,6142,Locodjo 1965,6142,9108,7012,8901,9603,-125.0,53.0,467.0,,,,
+4143,Abidjan 1987,6143,Abidjan 1987,6143,9108,7012,8901,9603,-124.76,53.0,466.79,,,,
+4144,Kalianpur 1937,6144,Kalianpur 1937,6144,9108,7015,8901,,,,,,,,
+4145,Kalianpur 1962,6145,Kalianpur 1962,6145,9108,7044,8901,9603,283.0,682.0,231.0,,,,
+4146,Kalianpur 1975,6146,Kalianpur 1975,6146,9108,7045,8901,9603,295.0,736.0,257.0,,,,
+4147,Hanoi 1972,6147,Hanoi 1972,6147,9108,7024,8901,9603,-17.51,-108.32,-62.39,,,,
+4148,Hartebeesthoek94,6148,Hartebeesthoek94,6148,9108,7030,8901,9603,0.0,0.0,0.0,,,,
+4149,CH1903,6149,CH1903,6149,9108,7004,8901,,,,,,,,
+4150,"CH1903+",6150,"CH1903+",6150,9108,7004,8901,9603,674.374,15.056,405.346,,,,
+4151,CHTRF95,6151,Swiss Terrestrial Reference Frame 1995,6151,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4152,"NAD83(HARN)",6152,"NAD83 (High Accuracy Regional Network)",6152,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4153,Rassadiran,6153,Rassadiran,6153,9108,7022,8901,9603,-133.63,-157.5,-158.62,,,,
+4154,"ED50(ED77)",6154,"European Datum 1950(1977)",6154,9108,7022,8901,,,,,,,,
+4155,Dabola 1981,6155,Dabola 1981,6155,9108,7011,8901,9603,-83.0,37.0,124.0,,,,
+4156,S-JTSK,6156,Jednotne Trigonometricke Site Katastralni,6156,9108,7004,8901,,,,,,,,
+4157,Mount Dillon,6157,Mount Dillon,6157,9108,7007,8901,,,,,,,,
+4158,Naparima 1955,6158,Naparima 1955,6158,9108,7022,8901,,,,,,,,
+4159,ELD79,6159,European Libyan Datum 1979,6159,9108,7022,8901,,,,,,,,
+4160,Chos Malal 1914,6160,Chos Malal 1914,6160,9108,7022,8901,,,,,,,,
+4161,Pampa del Castillo,6161,Pampa del Castillo,6161,9108,7022,8901,,,,,,,,
+4162,Korean 1985,6162,Korean Datum 1985,6162,9108,7004,8901,,,,,,,,
+4163,Yemen NGN96,6163,Yemen National Geodetic Network 1996,6163,9108,7030,8901,9603,0.0,0.0,0.0,,,,
+4164,South Yemen,6164,South Yemen,6164,9108,7024,8901,9603,-76.0,-138.0,67.0,,,,
+4165,Bissau,6165,Bissau,6165,9108,7022,8901,9603,-173.0,253.0,27.0,,,,
+4166,Korean 1995,6166,Korean Datum 1995,6166,9108,7030,8901,9603,0.0,0.0,0.0,,,,
+4167,NZGD2000,6167,New Zealand Geodetic Datum 2000,6167,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4168,Accra,6168,Accra,6168,9108,7029,8901,9603,-199.0,32.0,322.0,,,,
+4169,American Samoa 1962,6169,American Samoa 1962,6169,9108,7008,8901,9603,-115.0,118.0,426.0,,,,
+4170,SIRGAS,6170,Sistema de Referencia Geocentrico para America del Sur,6170,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4171,RGF93,6171,Reseau Geodesique Francais 1993,6171,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4172,POSGAR,6172,Posiciones Geodesicas Argentinas,6172,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4173,IRENET95,6173,IRENET95,6173,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4174,Sierra Leone 1924,6174,Sierra Leone Colony 1924,6174,9108,7029,8901,,,,,,,,
+4175,Sierra Leone 1968,6175,Sierra Leone 1968,6175,9108,7012,8901,9603,-88.0,4.0,101.0,,,,
+4176,Australian Antarctic,6176,Australian Antarctic Datum 1998,6176,9108,7019,8901,,,,,,,,
+4178,"Pulkovo 1942(83)",6178,"Pulkovo 1942/83",6178,9108,7024,8901,9607,24.0,-123.0,-94.0,-0.02,0.25,0.13,1.1
+4179,"Pulkovo 1942(58)",6179,"Pulkovo 1942/58",6179,9108,7024,8901,9606,33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84
+4180,EST97,6180,Estonia 1997,6180,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4181,Luxembourg 1930,6181,Luxembourg 1930,6181,9108,7022,8901,9606,-193.0,13.7,-39.3,-0.41,-2.933,2.688,0.43
+4182,Azores Occidental 1939,6182,Azores Occidental Islands 1939,6182,9108,7022,8901,,,,,,,,
+4183,Azores Central 1948,6183,Azores Central Islands 1948,6183,9108,7022,8901,,,,,,,,
+4184,Azores Oriental 1940,6184,Azores Oriental Islands 1940,6184,9108,7022,8901,,,,,,,,
+4185,Madeira 1936,6185,Madeira 1936,6185,9108,7022,8901,,,,,,,,
+4188,OSNI 1952,6188,OSNI 1952,6188,9108,7001,8901,,,,,,,,
+4189,REGVEN,6189,Red Geodesica Venezolana,6189,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4190,POSGAR 98,6190,Posiciones Geodesicas Argentinas 1998,6190,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4191,Albanian 1987,6191,Albanian 1987,6191,9108,7024,8901,,,,,,,,
+4192,Douala 1948,6192,Douala 1948,6192,9108,7022,8901,,,,,,,,
+4193,Manoca 1962,6193,Manoca 1962,6193,9108,7011,8901,9603,-70.9,-151.8,-41.4,,,,
+4194,Qornoq 1927,6194,Qornoq 1927,6194,9108,7022,8901,,,,,,,,
+4195,Scoresbysund 1952,6195,Scoresbysund 1952,6195,9108,7022,8901,9606,105.0,326.0,-102.5,0.0,0.0,0.814,-0.6
+4196,Ammassalik 1958,6196,Ammassalik 1958,6196,9108,7022,8901,9606,-45.0,417.0,-3.5,0.0,0.0,0.814,-0.6
+4197,Garoua,6197,Garoua,6197,9108,7012,8901,,,,,,,,
+4198,Kousseri,6198,Kousseri,6198,9108,7012,8901,,,,,,,,
+4199,Egypt 1930,6199,Egypt 1930,6199,9108,7022,8901,,,,,,,,
+4200,Pulkovo 1995,6200,Pulkovo 1995,6200,9108,7024,8901,,,,,,,,
+4201,Adindan,6201,Adindan,6201,9108,7012,8901,,,,,,,,
+4202,AGD66,6202,Australian Geodetic Datum 1966,6202,9108,7003,8901,,,,,,,,
+4203,AGD84,6203,Australian Geodetic Datum 1984,6203,9108,7003,8901,,,,,,,,
+4204,Ain el Abd,6204,Ain el Abd 1970,6204,9108,7022,8901,,,,,,,,
+4205,Afgooye,6205,Afgooye,6205,9108,7024,8901,9603,-43.0,-163.0,45.0,,,,
+4206,Agadez,6206,Agadez,6206,9108,7011,8901,,,,,,,,
+4207,Lisbon,6207,Lisbon 1937,6207,9108,7022,8901,,,,,,,,
+4208,Aratu,6208,Aratu,6208,9108,7022,8901,,,,,,,,
+4209,Arc 1950,6209,Arc 1950,6209,9108,7013,8901,,,,,,,,
+4210,Arc 1960,6210,Arc 1960,6210,9108,7012,8901,,,,,,,,
+4211,Batavia,6211,Batavia,6211,9108,7004,8901,,,,,,,,
+4212,Barbados 1938,6212,Barbados 1938,6212,9108,7012,8901,,,,,,,,
+4213,Beduaram,6213,Beduaram,6213,9108,7011,8901,,,,,,,,
+4214,Beijing 1954,6214,Beijing 1954,6214,9108,7024,8901,,,,,,,,
+4215,Belge 1950,6215,Reseau National Belge 1950,6215,9108,7022,8901,,,,,,,,
+4216,Bermuda 1957,6216,Bermuda 1957,6216,9108,7008,8901,9603,-73.0,213.0,296.0,,,,
+4218,Bogota 1975,6218,Bogota 1975,6218,9108,7022,8901,,,,,,,,
+4219,Bukit Rimpah,6219,Bukit Rimpah,6219,9108,7004,8901,9603,-384.0,664.0,-48.0,,,,
+4220,Camacupa,6220,Camacupa,6220,9108,7012,8901,,,,,,,,
+4221,Campo Inchauspe,6221,Campo Inchauspe,6221,9108,7022,8901,,,,,,,,
+4222,Cape,6222,Cape,6222,9108,7013,8901,,,,,,,,
+4223,Carthage,6223,Carthage,6223,9108,7011,8901,,,,,,,,
+4224,Chua,6224,Chua,6224,9108,7022,8901,9603,-134.0,229.0,-29.0,,,,
+4225,Corrego Alegre,6225,Corrego Alegre,6225,9108,7022,8901,9603,-206.0,172.0,-6.0,,,,
+4226,"Cote d'Ivoire",6226,"Cote d'Ivoire",6226,9108,7011,8901,,,,,,,,
+4227,Deir ez Zor,6227,Deir ez Zor,6227,9108,7011,8901,,,,,,,,
+4228,Douala,6228,Douala,6228,9108,7011,8901,,,,,,,,
+4229,Egypt 1907,6229,Egypt 1907,6229,9108,7020,8901,,,,,,,,
+4230,ED50,6230,European Datum 1950,6230,9108,7022,8901,,,,,,,,
+4231,ED87,6231,European Datum 1987,6231,9108,7022,8901,9606,-82.981,-99.719,-110.709,-0.5076,0.1503,0.3898,-0.3143
+4232,Fahud,6232,Fahud,6232,9108,7012,8901,,,,,,,,
+4233,Gandajika 1970,6233,Gandajika 1970,6233,9108,7022,8901,,,,,,,,
+4234,Garoua,6234,Garoua,6234,9108,7011,8901,,,,,,,,
+4235,Guyane Francaise,6235,Guyane Francaise,6235,9108,7022,8901,,,,,,,,
+4236,Hu Tzu Shan,6236,Hu Tzu Shan,6236,9108,7022,8901,9603,-637.0,-549.0,-203.0,,,,
+4237,HD72,6237,Hungarian Datum 1972,6237,9108,7036,8901,,,,,,,,
+4238,ID74,6238,Indonesian Datum 1974,6238,9108,7021,8901,,,,,,,,
+4239,Indian 1954,6239,Indian 1954,6239,9108,7015,8901,9603,217.0,823.0,299.0,,,,
+4240,Indian 1975,6240,Indian 1975,6240,9108,7015,8901,,,,,,,,
+4241,Jamaica 1875,6241,Jamaica 1875,6241,9108,7034,8901,,,,,,,,
+4242,JAD69,6242,Jamaica 1969,6242,9108,7008,8901,,,,,,,,
+4243,Kalianpur 1880,6243,Kalianpur 1880,6243,9108,7042,8901,,,,,,,,
+4244,Kandawala,6244,Kandawala,6244,9108,7015,8901,9603,-97.0,787.0,86.0,,,,
+4245,Kertau,6245,Kertau,6245,9108,7018,8901,9603,-11.0,851.0,5.0,,,,
+4246,KOC,6246,Kuwait Oil Company,6246,9108,7012,8901,,,,,,,,
+4247,La Canoa,6247,La Canoa,6247,9108,7022,8901,9603,-273.5,110.6,-357.9,,,,
+4248,PSAD56,6248,Provisional South American Datum 1956,6248,9108,7022,8901,,,,,,,,
+4249,Lake,6249,Lake,6249,9108,7022,8901,,,,,,,,
+4250,Leigon,6250,Leigon,6250,9108,7012,8901,9603,-130.0,29.0,364.0,,,,
+4251,Liberia 1964,6251,Liberia 1964,6251,9108,7012,8901,9603,-90.0,40.0,88.0,,,,
+4252,Lome,6252,Lome,6252,9108,7011,8901,,,,,,,,
+4253,Luzon 1911,6253,Luzon 1911,6253,9108,7008,8901,,,,,,,,
+4254,Hito XVIII 1963,6254,Hito XVIII 1963,6254,9108,7022,8901,9606,18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013
+4255,Herat North,6255,Herat North,6255,9108,7022,8901,9603,-333.0,-222.0,114.0,,,,
+4256,Mahe 1971,6256,Mahe 1971,6256,9108,7012,8901,9603,41.0,-220.0,-134.0,,,,
+4257,Makassar,6257,Makassar,6257,9108,7004,8901,9603,-587.8,519.75,145.76,,,,
+4258,ETRS89,6258,European Terrestrial Reference System 1989,6258,9108,7019,8901,,,,,,,,
+4259,Malongo 1987,6259,Malongo 1987,6259,9108,7022,8901,,,,,,,,
+4260,Manoca,6260,Manoca,6260,9108,7012,8901,9603,-70.9,-151.8,-41.4,,,,
+4261,Merchich,6261,Merchich,6261,9108,7011,8901,9603,31.0,146.0,47.0,,,,
+4262,Massawa,6262,Massawa,6262,9108,7004,8901,9603,639.0,405.0,60.0,,,,
+4263,Minna,6263,Minna,6263,9108,7012,8901,,,,,,,,
+4264,Mhast,6264,Mhast,6264,9108,7022,8901,9603,-252.95,-4.11,-96.38,,,,
+4265,Monte Mario,6265,Monte Mario,6265,9108,7022,8901,,,,,,,,
+4266,"M'poraloko",6266,"M'poraloko",6266,9108,7011,8901,,,,,,,,
+4267,NAD27,6267,North American Datum 1927,6267,9108,7008,8901,,,,,,,,
+4268,NAD27 Michigan,6268,NAD Michigan,6268,9108,7009,8901,,,,,,,,
+4269,NAD83,6269,North American Datum 1983,6269,9108,7019,8901,,,,,,,,
+4270,Nahrwan 1967,6270,Nahrwan 1967,6270,9108,7012,8901,,,,,,,,
+4271,Naparima 1972,6271,Naparima 1972,6271,9108,7022,8901,,,,,,,,
+4272,NZGD49,6272,New Zealand Geodetic Datum 1949,6272,9108,7022,8901,,,,,,,,
+4273,NGO 1948,6273,NGO 1948,6273,9108,7005,8901,9606,278.3,93.0,474.5,7.889,0.05,-6.61,6.21
+4274,Datum 73,6274,Datum 73,6274,9108,7022,8901,,,,,,,,
+4275,NTF,6275,Nouvelle Triangulation Francaise,6275,9108,7011,8901,9603,-168.0,-60.0,320.0,,,,
+4276,NSWC 9Z-2,6276,NSWC 9Z-2,6276,9108,7025,8901,,,,,,,,
+4277,OSGB 1936,6277,OSGB 1936,6277,9108,7001,8901,,,,,,,,
+4278,OSGB70,6278,"OSGB 1970 (SN)",6278,9108,7001,8901,,,,,,,,
+4279,"OS(SN)80",6279,"OS (SN) 1980",6279,9108,7001,8901,,,,,,,,
+4280,Padang,6280,Padang 1884,6280,9108,7004,8901,,,,,,,,
+4281,Palestine 1923,6281,Palestine 1923,6281,9108,7010,8901,,,,,,,,
+4282,Pointe Noire,6282,Congo 1960 Pointe Noire,6282,9108,7011,8901,,,,,,,,
+4283,GDA94,6283,Geocentric Datum of Australia 1994,6283,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4284,Pulkovo 1942,6284,Pulkovo 1942,6284,9108,7024,8901,,,,,,,,
+4285,Qatar 1974,6285,Qatar 1974,6285,9108,7022,8901,,,,,,,,
+4286,Qatar 1948,6286,Qatar 1948,6286,9108,7020,8901,,,,,,,,
+4287,Qornoq,6287,Qornoq,6287,9108,7022,8901,9603,164.0,138.0,-189.0,,,,
+4288,Loma Quintana,6288,Loma Quintana,6288,9108,7022,8901,,,,,,,,
+4289,Amersfoort,6289,Amersfoort,6289,9108,7004,8901,,,,,,,,
+4291,SAD69,6291,South American Datum 1969,6291,9108,7036,8901,,,,,,,,
+4292,Sapper Hill 1943,6292,Sapper Hill 1943,6292,9108,7022,8901,9603,-355.0,21.0,72.0,,,,
+4293,Schwarzeck,6293,Schwarzeck,6293,9108,7046,8901,,,,,,,,
+4294,Segora,6294,Segora,6294,9108,7004,8901,,,,,,,,
+4295,Serindung,6295,Serindung,6295,9108,7004,8901,,,,,,,,
+4296,Sudan,6296,Sudan,6296,9108,7011,8901,,,,,,,,
+4297,Tananarive,6297,Tananarive 1925,6297,9108,7022,8901,9603,-189.0,-242.0,-91.0,,,,
+4298,Timbalai 1948,6298,Timbalai 1948,6298,9108,7016,8901,,,,,,,,
+4299,TM65,6299,TM65,6299,9108,7002,8901,,,,,,,,
+4300,TM75,6300,TM75,6300,9108,7002,8901,,,,,,,,
+4301,Tokyo,6301,Tokyo,6301,9108,7004,8901,,,,,,,,
+4302,Trinidad 1903,6302,Trinidad 1903,6302,9108,7007,8901,9603,-61.702,284.488,472.052,,,,
+4303,"TC(1948)",6303,Trucial Coast 1948,6303,9108,7020,8901,,,,,,,,
+4304,Voirol 1875,6304,Voirol 1875,6304,9108,7011,8901,9603,-73.0,-247.0,227.0,,,,
+4306,Bern 1938,6306,Bern 1938,6306,9108,7004,8901,,,,,,,,
+4307,Nord Sahara 1959,6307,Nord Sahara 1959,6307,9108,7012,8901,,,,,,,,
+4308,RT38,6308,Stockholm 1938,6308,9108,7004,8901,,,,,,,,
+4309,Yacare,6309,Yacare,6309,9108,7022,8901,9603,-155.0,171.0,37.0,,,,
+4310,Yoff,6310,Yoff,6310,9108,7011,8901,,,,,,,,
+4311,Zanderij,6311,Zanderij,6311,9108,7022,8901,9603,-265.0,120.0,-358.0,,,,
+4312,MGI,6312,Militar-Geographische Institut,6312,9108,7004,8901,,,,,,,,
+4313,Belge 1972,6313,Reseau National Belge 1972,6313,9108,7022,8901,,,,,,,,
+4314,DHDN,6314,Deutsches Hauptdreiecksnetz,6314,9108,7004,8901,,,,,,,,
+4315,Conakry 1905,6315,Conakry 1905,6315,9108,7011,8901,9603,-23.0,259.0,-9.0,,,,
+4316,Dealul Piscului 1933,6316,Dealul Piscului 1933,6316,9108,7022,8901,9603,103.25,-100.4,-307.19,,,,
+4317,Dealul Piscului 1970,6317,Dealul Piscului 1970,6317,9108,7024,8901,,,,,,,,
+4318,NGN,6318,National Geodetic Network,6318,9108,7030,8901,,,,,,,,
+4319,KUDAMS,6319,Kuwait Utility,6319,9108,7019,8901,,,,,,,,
+4322,WGS 72,6322,World Geodetic System 1972,6322,9108,7043,8901,,,,,,,,
+4324,WGS 72BE,6324,WGS 72 Transit Broadcast Ephemeris,6324,9108,7043,8901,9606,0.0,0.0,1.9,0.0,0.0,0.814,-0.38
+4326,WGS 84,6326,World Geodetic System 1984,6326,9108,7030,8901,,,,,,,,
+4600,Anguilla 1957,6600,Anguilla 1957,6600,9108,7012,8901,,,,,,,,
+4601,Antigua 1943,6601,Antigua 1943,6601,9108,7012,8901,9603,-255.0,-15.0,71.0,,,,
+4602,Dominica 1945,6602,Dominica 1945,6602,9108,7012,8901,9603,725.0,685.0,536.0,,,,
+4603,Grenada 1953,6603,Grenada 1953,6603,9108,7012,8901,9603,72.0,213.7,93.0,,,,
+4604,Montserrat 1958,6604,Montserrat 1958,6604,9108,7012,8901,9603,174.0,359.0,365.0,,,,
+4605,St. Kitts 1955,6605,St. Kitts 1955,6605,9108,7012,8901,9603,9.0,183.0,236.0,,,,
+4606,St. Lucia 1955,6606,St. Lucia 1955,6606,9108,7012,8901,9603,-149.0,128.0,296.0,,,,
+4607,St. Vincent 1945,6607,St. Vincent 1945,6607,9108,7012,8901,,,,,,,,
+4608,"NAD27(76)",6608,"North American Datum 1927 (1976)",6608,9108,7008,8901,,,,,,,,
+4609,"NAD27(CGQ77)",6609,"North American Datum 1927 (CGQ77)",6609,9108,7008,8901,,,,,,,,
+4610,Xian 1980,6610,Xian 1980,6610,9108,7049,8901,,,,,,,,
+4611,Hong Kong 1980,6611,Hong Kong 1980,6611,9108,7022,8901,9606,-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246
+4612,JGD2000,6612,Japanese Geodetic Datum 2000,6612,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4613,Segara,6613,Gunung Segara,6613,9108,7004,8901,9603,-404.78,685.68,45.47,,,,
+4614,QND95,6614,Qatar National Datum 1995,6614,9108,7022,8901,9606,-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065
+4615,Porto Santo,6615,Porto Santo,6615,9108,7022,8901,,,,,,,,
+4616,Selvagem Grande,6616,Selvagem Grande,6616,9108,7022,8901,,,,,,,,
+4617,"NAD83(CSRS)",6140,NAD83 Canadian Spatial Reference System,6140,9108,7019,8901,9603,0.0,0.0,0.0,,,,
+4801,"Bern 1898 (Bern)",6801,"CH1903 (Bern)",6149,9108,7004,8907,,,,,,,,
+4802,"Bogota 1975 (Bogota)",6802,"Bogota 1975 (Bogota)",6218,9108,7022,8904,,,,,,,,
+4803,"Lisbon (Lisbon)",6803,"Lisbon 1937 (Lisbon)",6207,9108,7022,8902,,,,,,,,
+4804,"Makassar (Jakarta)",6804,"Makassar (Jakarta)",6257,9108,7004,8908,9603,-587.8,519.75,145.76,,,,
+4805,"MGI (Ferro)",6805,"Militar-Geographische Institut (Ferro)",6312,9108,7004,8909,,,,,,,,
+4806,"Monte Mario (Rome)",6806,"Monte Mario (Rome)",6265,9108,7022,8906,,,,,,,,
+4807,"NTF (Paris)",6807,"Nouvelle Triangulation Francaise (Paris)",6275,9105,7011,8903,9603,-168.0,-60.0,320.0,,,,
+4808,"Padang (Jakarta)",6808,"Padang 1884 (Jakarta)",6280,9108,7004,8908,,,,,,,,
+4809,"Belge 1950 (Brussels)",6809,"Reseau National Belge 1950 (Brussels)",6215,9108,7022,8910,,,,,,,,
+4810,"Tananarive (Paris)",6810,"Tananarive 1925 (Paris)",6297,9105,7022,8903,9603,-189.0,-242.0,-91.0,,,,
+4811,"Voirol 1875 (Paris)",6811,"Voirol 1875 (Paris)",6304,9105,7011,8903,9603,-73.0,-247.0,227.0,,,,
+4813,"Batavia (Jakarta)",6813,"Batavia (Jakarta)",6211,9108,7004,8908,,,,,,,,
+4814,"RT38 (Stockholm)",6814,"Stockholm 1938 (Stockholm)",6308,9108,7004,8911,,,,,,,,
+4815,"Greek (Athens)",6815,"Greek (Athens)",6120,9108,7004,8912,,,,,,,,
+4816,"Carthage (Paris)",6816,"Carthage (Paris)",6816,9105,7011,8903,,,,,,,,
+4817,"NGO 1948 (Oslo)",6817,"NGO 1948 (Oslo)",6273,9108,7005,8913,9606,278.3,93.0,474.5,7.889,0.05,-6.61,6.21
+4818,"S-JTSK (Ferro)",6818,"S-JTSK (Ferro)",6818,9108,7004,8909,,,,,,,,
+4819,"Nord Sahara 1959 (Paris)",6819,"Nord Sahara 1959 (Paris)",6819,9105,7012,8903,,,,,,,,
+4820,"Segara (Jakarta)",6820,"Gunung Segara (Jakarta)",6820,9108,7004,8908,,,,,,,,
+4901,"ATF (Paris)",6901,"Ancienne Triangulation Francaise (Paris)",6901,9105,7027,8903,,,,,,,,
+4902,"NDG (Paris)",6902,"Nord de Guerre (Paris)",6902,9105,7027,8903,,,,,,,,
+4903,"Madrid 1870 (Madrid)",6903,"Madrid 1870 (Madrid)",6903,9108,7028,8905,,,,,,,,
+4904,"Lisbon 1890 (Lisbon)",6904,"Lisbon 1890 (Lisbon)",6904,9108,7004,8902,,,,,,,,
diff --git a/src/tiff/csv/gdatum_alias.c b/src/tiff/csv/gdatum_alias.c
new file mode 100644
index 0000000..acfd5d0
--- /dev/null
+++ b/src/tiff/csv/gdatum_alias.c
@@ -0,0 +1,11 @@
+#include "defs.h"
+datafile_rows_t gdatum_alias_row_1[] = {"GEOD_DATUM_ALIAS_CODE","GEOD_DATUM_ALIAS_NAME","GEOD_DATUM_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t gdatum_alias_row_2[] = {"6400","ETRS89","6258","1999-04-22 00:00:00","","EPSG","Coincides with WGS84 at the one metre level.","99.111",NULL};
+datafile_rows_t gdatum_alias_row_3[] = {"6401","South Africa","6222","1996-10-18 00:00:00","Private Communication, Directorate of Surveys and Land Information, Cape Town.","EPSG","","",NULL};
+datafile_rows_t gdatum_alias_row_4[] = {"6402","Genuk","6211","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t gdatum_alias_row_5[] = {"6403","NAD83 (1986)","6269","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t gdatum_alias_row_6[] = {"6404","Old Greek","6120","1997-06-16 00:00:00","Topographic Department; National Technical University of Greece.","EPSG","Adjective \"Old\" applied since introduction of GGRS87 (code 6121)","",NULL};
+datafile_rows_t gdatum_alias_row_7[] = {"6405","Rikets koordinatsystem 1938","6308","1997-11-13 00:00:00","National Land Survey of Sweden","EPSG","","",NULL};
+datafile_rows_t gdatum_alias_row_8[] = {"6406","Samboja P2 exc T9","6125","1997-11-13 00:00:00","Total Indonesia","EPSG","","",NULL};
+
+datafile_rows_t *gdatum_alias_rows[] = {gdatum_alias_row_1,gdatum_alias_row_2,gdatum_alias_row_3,gdatum_alias_row_4,gdatum_alias_row_5,gdatum_alias_row_6,gdatum_alias_row_7,gdatum_alias_row_8,NULL};
diff --git a/src/tiff/csv/gdatum_alias.csv b/src/tiff/csv/gdatum_alias.csv
new file mode 100644
index 0000000..894d9f6
--- /dev/null
+++ b/src/tiff/csv/gdatum_alias.csv
@@ -0,0 +1,8 @@
+"GEOD_DATUM_ALIAS_CODE","GEOD_DATUM_ALIAS_NAME","GEOD_DATUM_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+6400,ETRS89,6258,1999-04-22 00:00:00,,EPSG,Coincides with WGS84 at the one metre level.,99.111
+6401,South Africa,6222,1996-10-18 00:00:00,"Private Communication, Directorate of Surveys and Land Information, Cape Town.",EPSG,,
+6402,Genuk,6211,1996-10-18 00:00:00,,EPSG,,
+6403,NAD83 (1986),6269,1996-12-12 00:00:00,,EPSG,,
+6404,Old Greek,6120,1997-06-16 00:00:00,Topographic Department; National Technical University of Greece.,EPSG,"Adjective \"Old\" applied since introduction of GGRS87 (code 6121)",
+6405,Rikets koordinatsystem 1938,6308,1997-11-13 00:00:00,National Land Survey of Sweden,EPSG,,
+6406,Samboja P2 exc T9,6125,1997-11-13 00:00:00,Total Indonesia,EPSG,,
diff --git a/src/tiff/csv/geod_datum.c b/src/tiff/csv/geod_datum.c
new file mode 100644
index 0000000..7ed25c5
--- /dev/null
+++ b/src/tiff/csv/geod_datum.c
@@ -0,0 +1,213 @@
+#include "defs.h"
+datafile_rows_t geod_datum_row_1[] = {"GEOD_DATUM_CODE","GEOD_DAT_EPSG_NAME","GEOD_DAT_EPSG_ABBR","GEOD_DAT_USER_NAME","ORIGIN_DESCRIPTION","ELLIPSOID_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t geod_datum_row_2[] = {"6001","Not specified (based on ellipsoid 7001)","","","","7001","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_3[] = {"6002","Not specified (based on ellipsoid 7002)","","","","7002","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_4[] = {"6003","Not specified (based on ellipsoid 7003)","","","","7003","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_5[] = {"6004","Not specified (based on ellipsoid 7004)","","","","7004","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_6[] = {"6005","Not specified (based on ellipsoid 7005)","","","","7005","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_7[] = {"6006","Not specified (based on ellipsoid 7006)","","","","7006","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_8[] = {"6007","Not specified (based on ellipsoid 7007)","","","","7007","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_9[] = {"6008","Not specified (based on ellipsoid 7008)","","","","7008","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_10[] = {"6009","Not specified (based on ellipsoid 7009)","","","","7009","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_11[] = {"6010","Not specified (based on ellipsoid 7010)","","","","7010","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_12[] = {"6011","Not specified (based on ellipsoid 7011)","","","","7011","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_13[] = {"6012","Not specified (based on ellipsoid 7012)","","","","7012","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_14[] = {"6013","Not specified (based on ellipsoid 7013)","","","","7013","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_15[] = {"6014","Not specified (based on ellipsoid 7014)","","","","7014","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_16[] = {"6015","Not specified (based on ellipsoid 7015)","","","","7015","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_17[] = {"6016","Not specified (based on ellipsoid 7016)","","","","7016","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_18[] = {"6017","Not specified (based on ellipsoid 7017)","","","","7044","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_19[] = {"6018","Not specified (based on ellipsoid 7018)","","","","7018","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_20[] = {"6019","Not specified (based on ellipsoid 7019)","","","","7019","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_21[] = {"6020","Not specified (based on ellipsoid 7020)","","","","7020","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_22[] = {"6021","Not specified (based on ellipsoid 7021)","","","","7021","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_23[] = {"6022","Not specified (based on ellipsoid 7022)","","","","7022","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_24[] = {"6024","Not specified (based on ellipsoid 7024)","","","","7024","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_25[] = {"6025","Not specified (based on ellipsoid 7025)","","","","7025","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_26[] = {"6027","Not specified (based on ellipsoid 7027)","","","","7027","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_27[] = {"6028","Not specified (based on ellipsoid 7028)","","","","7028","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_28[] = {"6029","Not specified (based on ellipsoid 7029)","","","","7029","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_29[] = {"6030","Not specified (based on ellipsoid 7030)","","","","7030","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_30[] = {"6031","Not specified (based on ellipsoid 7031)","","","","7031","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_31[] = {"6032","Not specified (based on ellipsoid 7032)","","","","7032","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_32[] = {"6033","Not specified (based on ellipsoid 7033)","","","","7033","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_33[] = {"6034","Not specified (based on ellipsoid 7034)","","","","7034","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_34[] = {"6035","Not specified (based on ellipsoid 7035)","","","","7035","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","96.08",NULL};
+datafile_rows_t geod_datum_row_35[] = {"6036","Not specified (based on ellipsoid 7036)","","","","7036","1996-09-12 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","",NULL};
+datafile_rows_t geod_datum_row_36[] = {"6041","Not specified (based on ellipsoid 7041)","","","","7041","1999-10-20 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","",NULL};
+datafile_rows_t geod_datum_row_37[] = {"6042","Not specified (based on ellipsoid 7042)","","","","7042","1999-10-20 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","",NULL};
+datafile_rows_t geod_datum_row_38[] = {"6043","Not specified (based on ellipsoid 7043)","","","","7043","1999-10-20 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","",NULL};
+datafile_rows_t geod_datum_row_39[] = {"6044","Not specified (based on ellipsoid 7044)","","","","7044","1999-10-20 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","",NULL};
+datafile_rows_t geod_datum_row_40[] = {"6045","Not specified (based on ellipsoid 7045)","","","","7045","1999-10-20 00:00:00","","EPSG","Not a valid datum.  Included for coordinate systems where datum is unknown.","",NULL};
+datafile_rows_t geod_datum_row_41[] = {"6120","Greek","","","Fundamental point: Athens Observatory; latitude 37 deg 58 min 20.132 sec N; longitude 23 deg 42 min 58.815 sec E of Greenwich","7004","1997-06-16 00:00:00","Topography Department; National Technical University of Athens","EPSG","See geodetic datum alias 6404.  Used as basis of topographic mapping based on Hatt projection.","",NULL};
+datafile_rows_t geod_datum_row_42[] = {"6121","Greek Geodetic Reference System 1987","GGRS87","","Fundamental point: Dionysos; latitude 38 deg 04 min 33.8 sec N; longitude 23 deg 55 min 51.0 sec E of Greenwich; geoid height 7.0 m.","7019","1997-06-16 00:00:00","L. Portokalakis; Public Petroleum Corporation of Greece","EPSG","Superseded (old) Greek datum.  Oil industry work based on ED50.","",NULL};
+datafile_rows_t geod_datum_row_43[] = {"6122","Average Terrestrial System 1977","ATS77","","","7041","1997-07-02 00:00:00","New Brunswick Geographic Information Corporation land and water information standards manual.","EPSG","In use from 1979.  To be phased out in late 1990's.","",NULL};
+datafile_rows_t geod_datum_row_44[] = {"6123","Kartastokoordinaattijarjestelma","KKJ","","Adjustment with fundamental point based on ED50 transformed to best fit the older VVJ adjustment.","7022","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","Adopted in 1970.","",NULL};
+datafile_rows_t geod_datum_row_45[] = {"6124","Rikets koordinatsystem 1990","RT90","","","7004","1997-11-13 00:00:00","National Land Survey of Sweden","EPSG","Supersedes RT38 adjustment (datum code 6308)","",NULL};
+datafile_rows_t geod_datum_row_46[] = {"6125","Samboja","","","Original origin station P2 Exc now destroyed.  Extensions recomputed using Toran station T9 as origin.","7004","1997-11-13 00:00:00","Total Indonesia.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_47[] = {"6126","Lithuania 1994 (ETRS89)","LKS94 (ETRS89)","","Densification from 4  ETRF89 points.","7019","1998-03-12 00:00:00","HNIT-Baltic GeoInfoServisas","EPSG","Densification of ETRS89 during the 1992 Baltic campaign.","",NULL};
+datafile_rows_t geod_datum_row_48[] = {"6127","Tete","","","Fundamental point: Tete.","7008","1998-04-16 00:00:00","Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_49[] = {"6128","Madzansua","","","Fundamental point: Madzansua.","7008","1998-04-16 00:00:00","Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","Superseded by transformation to Tete datum (datum code 6127).","",NULL};
+datafile_rows_t geod_datum_row_50[] = {"6129","Observatario","","","Fundamental point: Maputo observatory.","7008","1998-04-16 00:00:00","Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","Superseded by transformation to Tete datum (datum code 6127).","",NULL};
+datafile_rows_t geod_datum_row_51[] = {"6130","Moznet (ITRF94)","Moznet","","ITRF 1994 epoch 20","7030","1998-04-16 00:00:00","Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_52[] = {"6131","Indian 1960","","","","7015","1998-11-11 00:00:00","","EPSG","DMA adjustment of IndoChina part of the Indian 1954 network to better fit local geoid.  Also known as Indian (DMA Reduced).","",NULL};
+datafile_rows_t geod_datum_row_53[] = {"6132","Final Datum 1958","FD58","","Fundamental point: Maniyur.  Latitude: 31 deg 23 min 59.19 sec N; Longitude: 48 deg 32 min 31.38 sec E (of Greenwich).","7012","1998-11-11 00:00:00","IOEPC records","EPSG","Network included in Nahrwan 1967 adjustment.","",NULL};
+datafile_rows_t geod_datum_row_54[] = {"6133","Estonia 1992","EST92","","Densification from 4  ETRS89 points.","7019","1998-12-14 00:00:00","http://www.geo.ut.ee/~raivo/estcoord.html","EPSG","Based on ETRS89 as established during the 1992 Baltic campaign.","",NULL};
+datafile_rows_t geod_datum_row_55[] = {"6134","PDO Survey Datum 1993","PSD93","","Adjustment best fitted to Fahud network.","7012","1999-04-22 00:00:00","Petroleum Development Oman","EPSG","Supersedes Fahud datum (code 6232). Maximum differences to Fahud adjustment are 20 metres.","",NULL};
+datafile_rows_t geod_datum_row_56[] = {"6135","Old Hawaiian","","","Fundamental Point: Oahu West Base Astro.  Latitude: 21 deg 18 min 13.89 sec N; longitude 157 deg 50 min 55.79 sec W (of Greenwich)","7008","1999-05-24 00:00:00","http://www.ngs.noaa.gov/ (NADCON readme file) and the NIMA publication http://164.214.2.59/publications/guides/Datum_Pamphlet/datum.html","EPSG","Hawaiian Islands were never on NAD27 but rather on Old Hawaiian Datum.  NADCON conversion program provides transform [...]
+datafile_rows_t geod_datum_row_57[] = {"6136","St. Lawrence Island","","","","7008","1999-05-24 00:00:00","http://www.ngs.noaa.gov/ (NADCON readme file)","EPSG","Many Alaskan islands were never on NAD27 but rather on independent datums.  NADCON conversion program provides transformation from St. Lawrence Island Datum to NAD83 (original 1986 realization) - making the transformation appear to user as if from NAD27.","",NULL};
+datafile_rows_t geod_datum_row_58[] = {"6137","St. Paul Island","","","","7008","1999-05-24 00:00:00","http://www.ngs.noaa.gov/ (NADCON readme file)","EPSG","Many Alaskan islands were never on NAD27 but rather on independent datums.  NADCON conversion program provides transformation from St. Paul Island Datum to NAD83 (original 1986 realization) - making the transformation appear to user as if from NAD27.","",NULL};
+datafile_rows_t geod_datum_row_59[] = {"6138","St. George Island","","","","7008","1999-05-24 00:00:00","http://www.ngs.noaa.gov/ (NADCON readme file)","EPSG","Many Alaskan islands were never on NAD27 but rather on independent datums.  NADCON conversion program provides transformation from St. George Island Datum to NAD83 (original 1986 realization) - making the transformation appear to user as if from NAD27.","",NULL};
+datafile_rows_t geod_datum_row_60[] = {"6139","Puerto Rico","","","","7008","1999-05-24 00:00:00","Ordnance Survey of Great Britain and http://www.ngs.noaa.gov/ (NADCON readme file).","EPSG","NADCON conversion program provides transformation from Puerto Rico Datum to NAD83 (original 1986 realization) but making the transformation appear to user as if from NAD27.","",NULL};
+datafile_rows_t geod_datum_row_61[] = {"6140","NAD83 Canadian Spatial Reference System","NAD83(CSRS98)","","","7019","1999-10-20 00:00:00","Service New Brunswick Land and Information Standards Manual","EPSG","Supersedes ATS77 from 1999 in New Brunswick.","",NULL};
+datafile_rows_t geod_datum_row_62[] = {"6141","Israel","","","Fundamental Point:  Latitude: 31 deg 44 min 03.817 sec N; Longitude: 35 deg 12 min 16.261 sec E (of Greenwich).","7019","1999-10-20 00:00:00","Survey of Israel.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_63[] = {"6142","Locodjo 1965","","","Fundamental Point: T5 Banco. Latitude: 5 deg 18 min 50.5 sec N; Longitude: 4 deg 02 min 05.1 sec W (of Greenwich).","7012","1999-10-20 00:00:00","IGN Paris.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_64[] = {"6143","Abidjan 1987","","","Fundamental Point: Abidjan I. Latitude: 5 deg 18 min 51.01 sec N; Longitude: 4 deg 02 min 06.04 sec W (of Greenwich).","7012","1999-10-20 00:00:00","IGN Paris.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_65[] = {"6144","Kalianpur 1937","","","Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).","7015","1999-10-20 00:00:00","G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.","EPSG","Supercedes 1880 adjustment except for topographic mapping.  Superseded in Pakistan by 1962 metrication conversion and in India by 1975 metrication conv [...]
+datafile_rows_t geod_datum_row_66[] = {"6145","Kalianpur 1962","","","Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).","7044","1999-10-20 00:00:00","","EPSG","1937 adjustment rescaled by ratio metric conversions of Indian foot (1937) to Indian foot (1962).","",NULL};
+datafile_rows_t geod_datum_row_67[] = {"6146","Kalianpur 1975","","","Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).","7045","1999-10-20 00:00:00","","EPSG","1937 adjustment rescaled by ratio metric conversions of Indian foot (1937) to Indian foot (1975).","",NULL};
+datafile_rows_t geod_datum_row_68[] = {"6147","Hanoi 1972","","","","7024","1999-10-20 00:00:00","PetroVietnam","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_69[] = {"6148","Hartbeesthoek94","","","Coincident with ITRF91 (1994.0) at Hartbeesthoek astronomical observatory near Pretoria.","7030","1999-10-22 00:00:00","Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm","EPSG","Supersedes Cape datum (code 6222).","",NULL};
+datafile_rows_t geod_datum_row_70[] = {"6149","CH1903","","","Fundamental Point: Old Bern observatory. Latitude: 46 deg 57 min  8.660 sec N; Longitude: 7 deg 26 min 22.500 sec E (of Greenwich).","7004","1999-10-20 00:00:00","Bundesamt f�r Landestopographie","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_71[] = {"6150","CH1903+","","","Fundamental Point: Old Bern observatory. Latitude: 46 deg 57 min  8.660 sec N; Longitude: 7 deg 26 min 22.500 sec E (of Greenwich).","7004","1999-10-20 00:00:00","Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_72[] = {"6151","Swiss Terrestrial Reference Frame 1995","CHTRF95","","ETRF89 at 1993.0","7019","1999-10-20 00:00:00","Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_73[] = {"6152","NAD83 (High Accuracy Regional Network)","NAD83(HARN)","","","7019","1999-10-20 00:00:00","National Geodetic Survey","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_74[] = {"6153","Rassadiran","","","Fundamental point: Total 1","7022","1999-11-20 00:00:00","Total-Fina","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_75[] = {"6154","ED50(ED77)","","","Extension of ED50 over Iran","7022","1999-11-20 00:00:00","National Cartographic Centre of Iran","EPSG","Sometimes referred to as ED50-ED77","",NULL};
+datafile_rows_t geod_datum_row_76[] = {"6200","Pulkovo 1995","","","Fundamental Point: Pulkovo observatory. Latitude: 59 deg 46 min 15.359 sec N; Longitude: 30 deg 19 min 28.318 sec E (of Greenwich).","7024","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_77[] = {"6201","Adindan","","","Fundamental Point: Station 15; Adindan. Latitude: 22 deg 10 min  7.110 sec N; Longitude: 31 deg 29 min 21.608 sec E (of Greenwich).","7012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_78[] = {"6202","Australian Geodetic Datum 1966","AGD66","","Fundamental Point: Johnson Memorial. Latitude: 25 deg 56 min 54.551 sec S; Longitude: 133 deg 12 min 30.077 sec E (of Greenwich).","7003","1995-06-02 00:00:00","Australian Map Grid Technical Manual. National Mapping Council of Australia Technical Publication 7; 1972.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_79[] = {"6203","Australian Geodetic Datum 1984","AGD84","","","7003","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_80[] = {"6204","Ain el Abd 1970","Ain el Abd","","Fundamental Point: Ain El Abd.  Latitude: 28 deg  14 min 06.171 sec N; Longitude: 48 deg 16 min 20.906 sec E (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_81[] = {"6205","Afgooye","","","","7024","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_82[] = {"6206","Agadez","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_83[] = {"6207","Lisbon","","","Fundamental Point: Castelo Sao Jorge; Lisbon. Latitude: 38 deg 42 min 43.631 sec N; Longitude: 9 deg 07 min 54.862 sec W (of Greenwich).","7022","1995-06-02 00:00:00","Instituto Geografico e Cadastral; Lisbon","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_84[] = {"6208","Aratu","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_85[] = {"6209","Arc 1950","","","Fundamental Point: Buffelsfontein. Latitude: 33 deg 59 min 32.000 sec S; Longitude: 25 deg 30 min 44.622 sec E (of Greenwich).","7013","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_86[] = {"6210","Arc 1960","","","Fundamental Point: Buffelsfontein. Latitude: 33 deg 59 min 32.000 sec S; Longitude: 25 deg 30 min 44.622 sec E (of Greenwich).","7012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_87[] = {"6211","Batavia","","","Fundamental Point: Batavia Astro. Station. Latitude: 6 deg  7 min 39.520 sec S; Longitude: 106 deg 48 min 27.790 sec E (of Greenwich).","7004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_88[] = {"6212","Barbados 1938","","","Fundamental point: HMS Challenger astro station M1; latitude 13 deg 04 min 32.53 sec N; longitude 59 deg 36 min 29.34 sec W (of Greenwich).","7012","1999-04-22 00:00:00","Ordnance Survey of Great Britain.","EPSG","","99.171",NULL};
+datafile_rows_t geod_datum_row_89[] = {"6213","Beduaram","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_90[] = {"6214","Beijing 1954","","","","7024","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_91[] = {"6215","Reseau National Belge 1950","Belge 1950","","Fundamental Point: Lommel (tower). Latitude: 51 deg 13 min 47.334 sec N; Longitude: 0 deg 56 min 44.773 sec E (of Brussels).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_92[] = {"6216","Bermuda 1957","","","","7008","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_93[] = {"6218","Bogota","","","Fundamental Point: Bogota observatory. Latitude: 4 deg 35 min 56.570 sec N; Longitude: 74 deg  4 min 51.300 sec W (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_94[] = {"6219","Bukit Rimpah","","","","7004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_95[] = {"6220","Camacupa","","","","7012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_96[] = {"6221","Campo Inchauspe","","","Fundamental Point: Campo Inchauspe. Latitude: 35 deg 58 min 17.000 sec S; Longitude: 62 deg 10 min 12.000 sec W (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_97[] = {"6222","Cape","","","Fundamental Point: Buffelsfontein. Latitude: 33 deg 59 min 32.000 sec S; Longitude: 25 deg 30 min 44.622 sec E (of Greenwich).","7013","1996-10-18 00:00:00","Private Communication, Directorate of Surveys and Land Information, Cape Town.","EPSG","","96.25  99.69",NULL};
+datafile_rows_t geod_datum_row_98[] = {"6223","Carthage","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_99[] = {"6224","Chua","","","Fundamental Point: Chua. Latitude: 19 deg 45 min 41.160 sec S; Longitude: 48 deg  6 min  7.560 sec W (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_100[] = {"6225","Corrego Alegre","","","Fundamental Point: Corrego Alegre. Latitude: 19 deg 50 min 15.140 sec S; Longitude: 48 deg 57 min 42.750 sec W (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_101[] = {"6226","Cote d'Ivoire","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_102[] = {"6227","Deir ez Zor","","","Fundamental Point: Trig. 254 Deir. Latitude: 35 deg 21 min 49.975 sec N; Longitude: 40 deg  5 min 46.770 sec E (of Greenwich).","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_103[] = {"6228","Douala","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_104[] = {"6229","Egypt 1907","","","Fundamental Point: Station F1. Latitude: 30 deg  1 min 42.860 sec N; Longitude: 31 deg 16 min 33.600 sec E (of Greenwich).","7020","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_105[] = {"6230","European Datum 1950","ED50","","Fundamental Point: Potsdam (Helmert Tower). Latitude: 52 deg 22 min 51.450 sec N; Longitude: 13 deg  3 min 58.740 sec E (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_106[] = {"6231","European Datum 1987","ED87","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_107[] = {"6232","Fahud","","","Fundamental Point: Station NO68-024 Fahud. Latitude: 22 deg 17 min 31.182 sec N; Longitude: 56 deg 29 min 18.820 sec E (of Greenwich).","7012","1995-06-02 00:00:00","Petroleum Development Oman.","EPSG","Superseded by PSD93 (code 6134).","",NULL};
+datafile_rows_t geod_datum_row_108[] = {"6233","Gandajika 1970","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_109[] = {"6234","Garoua","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_110[] = {"6235","Guyane Francaise","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_111[] = {"6236","Hu Tzu Shan","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_112[] = {"6237","Hungarian Datum 1972","HD72","","Fundamental Point: Szolohegy. Latitude: 47 deg 17 min 32,6156 sec N; Longitude 19 deg 36 min 09.9865 sec E; geoid height 6.56m.","7036","1996-10-18 00:00:00","http://lazarus.elte.hu/gb/geodez/geod3.htm","EPSG","","96.09",NULL};
+datafile_rows_t geod_datum_row_113[] = {"6238","Indonesian Datum 1974","ID74","","Fundamental Point: Padang. Latitude: 0 deg 56 min 38.414 sec S; Longitude: 100 deg 22 min  8.804 sec E (of Greenwich).","7021","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_114[] = {"6239","Indian 1954","","","Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).","7015","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_115[] = {"6240","Indian 1975","","","Fundamental Point: Khau Sakaerang","7015","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_116[] = {"6241","Jamaica 1875","","","Fundamental Point: Fort Charles Flagstaff. Latitude: 17 deg 55 min 55.800 sec N; Longitude: 76 deg 56 min 37.260 sec W (of Greenwich).","7034","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_117[] = {"6242","Jamaica 1969","JAD69","","Fundamental Point: Fort Charles Flagstaff. Latitude: 17 deg 55 min 55.800 sec N; Longitude: 76 deg 56 min 37.260 sec W (of Greenwich).","7008","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_118[] = {"6243","Kalianpur 1880","","","Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).","7042","1999-10-20 00:00:00","G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.","EPSG","Includes 1916 extrension into Burma (Myanmar).  Superseded by 1937 adjustment.","97.23",NULL};
+datafile_rows_t geod_datum_row_119[] = {"6244","Kandawala","","","","7015","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_120[] = {"6245","Kertau","","","Fundamental Point: Kertau. Latitude: 3 deg 27 min 50.710 sec N; Longitude: 102 deg 37 min 24.550 sec E (of Greenwich).","7018","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_121[] = {"6246","Kuwait Oil Company","KOC","","","7012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_122[] = {"6247","La Canoa","","","Fundamental Point: La Canoa. Latitude: 8 deg 34 min 17.170 sec N; Longitude: 63 deg 51 min 34.880 sec W (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","Origin also adopted for PSAD56.","",NULL};
+datafile_rows_t geod_datum_row_123[] = {"6248","Provisional South American Datum 1956","PSAD56","","Fundamental Point: La Canoa. Latitude: 8 deg 34 min 17.170 sec N; Longitude: 63 deg 51 min 34.880 sec W (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","Same origin as La Canoa datum.","",NULL};
+datafile_rows_t geod_datum_row_124[] = {"6249","Lake","","","Fundamental Point: Maracaibo Cathedral. Latitude: 10 deg 38 min 34.678 sec N; Longitude: 71 deg 36 min 20.224 sec W (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_125[] = {"6250","Leigon","","","Fundamental Point: GCS Station 121. Latitude: 5 deg 38 min 52.270 sec N; Longitude: 0 deg 11 min 46.080 sec W (of Greenwich).","7012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_126[] = {"6251","Liberia 1964","","","","7012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_127[] = {"6252","Lome","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_128[] = {"6253","Luzon 1911","","","Fundamental Point: Balacan. Latitude: 13 deg 33 min 41.000 sec N; Longitude: 121 deg 52 min  03.000 sec E (of Greenwich).","7008","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_129[] = {"6254","Hito XVIII 1963","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_130[] = {"6255","Herat North","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_131[] = {"6256","Mahe 1971","","","Fundamental Point: Mahe","7012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_132[] = {"6257","Makassar","","","Fundamental Point: Moncongloe","7004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_133[] = {"6258","European Terrestrial Reference Frame 89","ETRF89","","","7019","1999-04-22 00:00:00","","EPSG","Coincides with WGS84 at the one metre level.","97.11  97.55  99.111",NULL};
+datafile_rows_t geod_datum_row_134[] = {"6259","Malongo 1987","","","Fundamental Point: Station Y at Malongo base camp. Latitude: 5 deg 23 min 34.327 sec S; Longitude: 12 deg 12 min  02.393 sec E (of Greenwich).","7022","1995-06-02 00:00:00","Chevron Petroleum Technology.","EPSG","Offshore extension of Mhast datum (6264) using Transit translocation.","",NULL};
+datafile_rows_t geod_datum_row_135[] = {"6260","Manoca","","","","7012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_136[] = {"6261","Merchich","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_137[] = {"6262","Massawa","","","","7004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_138[] = {"6263","Minna","","","Fundamental Point: Minna base station L40. Latitude: 9 deg 38 min  09.000 sec N; Longitude: 6 deg 30 min 59.000 sec E (of Greenwich).","7012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_139[] = {"6264","Mhast","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_140[] = {"6265","Monte Mario","","","Fundamental Point: Monte Mario. Latitude: 41 deg 55 min 25.510 sec N; Longitude: 0 deg  00 min  00.000 sec E (of Rome).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_141[] = {"6266","M'poraloko","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_142[] = {"6267","North American Datum 1927","NAD27","","Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).","7008","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_143[] = {"6268","NAD Michigan","","","Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).","7009","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_144[] = {"6269","North American Datum 1983","NAD83","","Origin at geocentre.","7019","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_145[] = {"6270","Nahrwan 1967","","","Fundamental point: Nahrwan south base.  Latitude: 33 deg 19 min 10.87 sec N; Longitude: 44 deg 43 min 25.54 sec E (of Greenwich).","7012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_146[] = {"6271","Naparima 1972","","","Fundamental Point: Naparima. Latitude: 10 deg 16 min 44.860 sec N; Longitude: 61 deg 27 min 34.620 sec W (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_147[] = {"6272","New Zealand Geodetic Datum 1949","GD49","","Fundamental Point: Papatahi. Latitude: 41 deg 19 min  8.900 sec S; Longitude: 175 deg  02 min 51.000 sec E (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_148[] = {"6273","NGO 1948","","","","7005","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_149[] = {"6274","Datum 73","","","Fundamental Point:  Latitude: 39 deg 41 min 37.30 sec N; Longitude: 8 deg 07 min 53.31 sec W (of Greenwich).","7022","1995-06-02 00:00:00","Instituto Geografico e Cadastral; Lisbon","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_150[] = {"6275","Nouvelle Triangulation Francaise","NTF","","Fundamental Point: Pantheon","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_151[] = {"6276","NSWC 9Z-2","","","","7025","1995-06-02 00:00:00","","EPSG","Transit precise ephemeris before 1991.","",NULL};
+datafile_rows_t geod_datum_row_152[] = {"6277","OSGB 1936","","","Fundamental Point: Herstmonceux. Latitude: 50 deg 51 min 55.271 sec N; Longitude: 0 deg 20 min 45.882 sec E (of Greenwich).","7001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_153[] = {"6278","OSGB 1970 (SN)","OSGB70","","Fundamental Point: Herstmonceux. Latitude: 50 deg 51 min 55.271 sec N; Longitude: 0 deg 20 min 45.882 sec E (of Greenwich).","7001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_154[] = {"6279","OS (SN) 1980","OS(SN)80","","Fundamental Point: Herstmonceux. Latitude: 50 deg 51 min 55.271 sec N; Longitude: 0 deg 20 min 45.882 sec E (of Greenwich).","7001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_155[] = {"6280","Padang 1884","Padang","","Fundamental Point: Padang","7004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_156[] = {"6281","Palestine 1923","","","Fundamental Point: Point 82'M  Jerusalem. Latitude: 31 deg 44 min  2.749 sec N; Longitude: 35 deg 12 min 43.490 sec E (of Greenwich).","7010","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_157[] = {"6282","Pointe Noire","","","Fundamental Point: Point Noire Astro. Latitude: 4 deg 47 min  0.100 sec S; Longitude: 11 deg 51 min  1.550 sec E (of Greenwich).","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_158[] = {"6283","Geocentric Datum of Australia 1994","GDA94","","","7019","1995-06-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Coincident with WGS84 to within 1 metre.","",NULL};
+datafile_rows_t geod_datum_row_159[] = {"6284","Pulkovo 1942","","","Fundamental Point: Pulkovo observatory. Latitude: 59 deg 46 min 18.550 sec N; Longitude: 30 deg 19 min 42.090 sec E (of Greenwich).","7024","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_160[] = {"6285","Qatar","","","Fundamental Point: Station G3","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_161[] = {"6286","Qatar 1948","","","Fundamental Point: Sokey 0 M. Latitude: 25 deg 22 min 56.500 sec N; Longitude: 50 deg 45 min 41.000 sec E (of Greenwich).","7020","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_162[] = {"6287","Qornoq","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_163[] = {"6288","Loma Quintana","","","Fundamental Point: Loma Quintana","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_164[] = {"6289","Amersfoort","","","Fundamental Point: Amersfoort. Latitude: 52 deg  09 min 22.178 sec N; Longitude: 5 deg 23 min 15.478 sec E (of Greenwich).","7004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_165[] = {"6291","South American Datum 1969","SAD69","","","7036","1996-10-18 00:00:00","","EPSG","SAD69 uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision is 0 to 31mm.","96.09  97.252",NULL};
+datafile_rows_t geod_datum_row_166[] = {"6292","Sapper Hill 1943","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_167[] = {"6293","Schwarzeck","","","","7006","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_168[] = {"6294","Segora","","","","7004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_169[] = {"6295","Serindung","","","","7004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_170[] = {"6296","Sudan","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_171[] = {"6297","Tananarive 1925","Tananarive","","Fundamental Point: Tananarive observatory. Latitude: 18 deg 55 min  2.100 sec S; Longitude: 45 deg 12 min 52.800 sec E (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_172[] = {"6298","Timbalai 1948","","","Fundamental Point: Timbalai. Latitude: 5 deg 17 min  3.548 sec N; Longitude: 115 deg 10 min 56.409 sec E (of Greenwich).","7016","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_173[] = {"6299","TM65","","","","7002","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_174[] = {"6300","TM75","","","","7002","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_175[] = {"6301","Tokyo","","","Fundamental Point: Nikon-Keido-Genten. Latitude: 35 deg 39 min 17.5148 sec N; Longitude: 139 deg 44 min 40.5020 sec E (of Greenwich).","7004","1995-06-02 00:00:00","Geographic Survey Institute; Japan; Bulletin 40 (March 1994).  Also http://vldb.gsi-mc.go.jp/sokuchi/datum/tokyodatum.html","EPSG","","98.46",NULL};
+datafile_rows_t geod_datum_row_176[] = {"6302","Trinidad 1903","","","","7007","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_177[] = {"6303","Trucial Coast 1948","TC(1948)","","Fundamental Point: TC1. Latitude: 25 deg 23 min 50.190 sec N; Longitude: 55 deg 26 min 43.950 sec E (of Greenwich).","7020","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_178[] = {"6304","Voirol 1875","","","Fundamental Point: Voirol. Latitude: 40.835864 grads N; Longitude: 0.788735 grads E of Paris.","7011","1995-06-02 00:00:00","IGN Paris","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_179[] = {"6305","Voirol Unifie 1960","Voirol Unifie","","","7012","1999-10-20 00:00:00","\"Le System Geodesique Nord-Sahara\"; IGN Paris","EPSG","Conformal transformation from ED50. Used only with Lambert Algeria zones: in other cases use Nord Sahara 1959 geodetic datum.","99.62",NULL};
+datafile_rows_t geod_datum_row_180[] = {"6306","Bern 1938","","","Fundamental Point: Old Bern observatory. Latitude: 46 deg 57 min  7.890 sec N; Longitude: 7 deg 26 min 22.335 sec E (of Greenwich).","7004","1995-06-02 00:00:00","\"Die Projektionen der schweizerischen Plan- und Kartenwerke\"; J. Bolliger 1967","EPSG","This redetermination of the coordinates of fundamental point is used for scientific purposes and as the graticule overprinted on topographic maps constructed on the CH1903 / [...]
+datafile_rows_t geod_datum_row_181[] = {"6307","Nord Sahara 1959","","","","7012","1999-10-20 00:00:00","\"Le System Geodesique Nord-Sahara\"; IGN Paris","EPSG","Conformal transformation from ED50.","99.62",NULL};
+datafile_rows_t geod_datum_row_182[] = {"6308","Stockholm 1938","RT38","","Fundamental Point: Stockholm observatory","7004","1996-04-12 00:00:00","","EPSG","Superseded by RT90 adjustment (datum code 6124)","",NULL};
+datafile_rows_t geod_datum_row_183[] = {"6309","Yacare","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_184[] = {"6310","Yoff","","","","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_185[] = {"6311","Zanderij","","","","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_186[] = {"6312","Militar-Geographische Institut","MGI","","Fundamental Point: Hermannskogel. Latitude: 48 deg 16 min 15.29 sec N; Longitude: 16 deg 17 min 41.06 sec E (of Greenwich).","7004","1995-06-02 00:00:00","Bundesamt fur Eich- und Vermessungswesen; Wien","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_187[] = {"6313","Reseau National Belge 1972","Belge 1972","","Fundamental Point: Uccle observatory. Latitude: 50 deg 47 min 57.704 sec N; Longitude: 4 deg 21 min 24.983 sec E (of Greenwich).","7022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_188[] = {"6314","Deutsche Hauptdreiecksnetz","DHDN","","Fundamental Point: Potsdam. Latitude: 52 deg 22 min 53.954 sec N; Longitude: 13 deg 04 min 01.153 sec E (of Greenwich).","7004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_189[] = {"6315","Conakry 1905","","","Fundamental Point: Conakry. Latitude: 10.573766g N; Longitude: 17.833682g W (of Paris).","7011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_190[] = {"6316","Dealul Piscului 1933","","","Fundamental point: latitude 44 deg 24 min 33.9606 sec N; longitude 26 deg 06 min 44.8772 sec E (of Greenwich).","7022","1996-04-12 00:00:00","Institute for Geodesy Photogrametry and Land Management","EPSG","Superseded by 1970 adjustment (datum code 6317)","",NULL};
+datafile_rows_t geod_datum_row_191[] = {"6317","Dealul Piscului 1970","","","Fundamental point: latitude 44 deg 24 min 23.7709 sec N; longitude 26deg 06 min 44.1265 sec E (of Greenwich).","7024","1996-04-12 00:00:00","Institute for Geodesy Photogrametry and Land Management","EPSG","Supersedes 1933 adjustment (datum code 6316)","",NULL};
+datafile_rows_t geod_datum_row_192[] = {"6318","National Geodetic Network","NGN","","","7030","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_193[] = {"6319","Kuwait Utility","KUDAMS","","","7019","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_194[] = {"6322","World Geodetic System 1972","WGS 72","","","7043","1999-04-22 00:00:00","","EPSG","Used by GPS before 1987. For Transit satellite positioning see also WGS 72BE.                                                                                                                  \
+Datum code 6323 reserved for southern hemisphere ProjCS's.","99.03",NULL};
+datafile_rows_t geod_datum_row_195[] = {"6324","WGS 72 Transit Broadcast Ephemeris","WGS 72BE","","","7043","1999-04-22 00:00:00","","EPSG","Alleged datum for use with Transit broadcast ephemeris prior to 1989. Relationship to WGS 72 has changed over time.  Datum code 6325 reserved for southern hemisphere ProjCS's.","99.03",NULL};
+datafile_rows_t geod_datum_row_196[] = {"6326","World Geodetic System 1984","WGS 84","","Origin at geocentre.","7030","1995-06-02 00:00:00","","EPSG","Datum code 6327 reserved for southern hemisphere ProjCS's","",NULL};
+datafile_rows_t geod_datum_row_197[] = {"6600","Anguilla 1957","","","Fundamental point: station A4.","7012","1999-04-22 00:00:00","Ordnance Survey of Great Britain.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_198[] = {"6601","Antigua 1943","","","Fundamental point: station A14.","7012","1999-04-22 00:00:00","Ordnance Survey of Great Britain.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_199[] = {"6602","Dominica 1945","","","Fundamental point: station M12.","7012","1999-04-22 00:00:00","Ordnance Survey of Great Britain.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_200[] = {"6603","Grenada 1953","","","Fundamental point: station GS8.","7012","1999-04-22 00:00:00","Ordnance Survey of Great Britain.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_201[] = {"6604","Montserrat 1958","","","Fundamental point: station M36.","7012","1999-04-22 00:00:00","Ordnance Survey of Great Britain.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_202[] = {"6605","St. Kitts 1955","","","Fundamental point: station K12.","7012","1999-04-22 00:00:00","Ordnance Survey of Great Britain.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_203[] = {"6606","St. Lucia 1955","","","Fundamental point: station DCS3.","7012","1999-04-22 00:00:00","Ordnance Survey of Great Britain.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_204[] = {"6607","St. Vincent 1945","","","Fundamental point: station V1.","7012","1999-04-22 00:00:00","Ordnance Survey of Great Britain.","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_205[] = {"6608","North American Datum 1927 (1976)","NAD27(76)","","Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).","7008","1999-05-12 00:00:00","Geodetic Survey of Canada.","EPSG","NAD27(76) used in Ontario for all maps at scale 1/20 000 and larger; elsewhere in Canada for selected purposes.","",NULL};
+datafile_rows_t geod_datum_row_206[] = {"6609","North American Datum 1927 (CGQ77)","CGQ77","","Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).","7008","1999-05-12 00:00:00","Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca","EPSG","NAD27 (CGQ77) used in Quebec for all maps at scale 1/20 000 and larger; generally for maps issued by the Quebec cartography office whose reference system is CGQ77.", [...]
+datafile_rows_t geod_datum_row_207[] = {"6901","Ancienne Triangulation Francaise","ATF","","","7027","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_208[] = {"6902","Nord de Guerre","NDG","","","7027","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_datum_row_209[] = {"6903","Madrid 1870","","","Fundamental point: Madrid observatory.","7028","1998-11-11 00:00:00","Institut de Geomatica; Barcelona","EPSG","","",NULL};
+
+datafile_rows_t *geod_datum_rows[] = {geod_datum_row_1,geod_datum_row_2,geod_datum_row_3,geod_datum_row_4,geod_datum_row_5,geod_datum_row_6,geod_datum_row_7,geod_datum_row_8,geod_datum_row_9,geod_datum_row_10,geod_datum_row_11,geod_datum_row_12,geod_datum_row_13,geod_datum_row_14,geod_datum_row_15,geod_datum_row_16,geod_datum_row_17,geod_datum_row_18,geod_datum_row_19,geod_datum_row_20,geod_datum_row_21,geod_datum_row_22,geod_datum_row_23,geod_datum_row_24,geod_datum_row_25,geod_datum_ro [...]
diff --git a/src/tiff/csv/geod_datum.csv b/src/tiff/csv/geod_datum.csv
new file mode 100644
index 0000000..7d5ed98
--- /dev/null
+++ b/src/tiff/csv/geod_datum.csv
@@ -0,0 +1,210 @@
+"GEOD_DATUM_CODE","GEOD_DAT_EPSG_NAME","GEOD_DAT_EPSG_ABBR","GEOD_DAT_USER_NAME","ORIGIN_DESCRIPTION","ELLIPSOID_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+6001,Not specified (based on ellipsoid 7001),,,,7001,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6002,Not specified (based on ellipsoid 7002),,,,7002,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6003,Not specified (based on ellipsoid 7003),,,,7003,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6004,Not specified (based on ellipsoid 7004),,,,7004,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6005,Not specified (based on ellipsoid 7005),,,,7005,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6006,Not specified (based on ellipsoid 7006),,,,7006,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6007,Not specified (based on ellipsoid 7007),,,,7007,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6008,Not specified (based on ellipsoid 7008),,,,7008,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6009,Not specified (based on ellipsoid 7009),,,,7009,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6010,Not specified (based on ellipsoid 7010),,,,7010,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6011,Not specified (based on ellipsoid 7011),,,,7011,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6012,Not specified (based on ellipsoid 7012),,,,7012,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6013,Not specified (based on ellipsoid 7013),,,,7013,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6014,Not specified (based on ellipsoid 7014),,,,7014,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6015,Not specified (based on ellipsoid 7015),,,,7015,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6016,Not specified (based on ellipsoid 7016),,,,7016,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6017,Not specified (based on ellipsoid 7017),,,,7044,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6018,Not specified (based on ellipsoid 7018),,,,7018,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6019,Not specified (based on ellipsoid 7019),,,,7019,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6020,Not specified (based on ellipsoid 7020),,,,7020,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6021,Not specified (based on ellipsoid 7021),,,,7021,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6022,Not specified (based on ellipsoid 7022),,,,7022,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6024,Not specified (based on ellipsoid 7024),,,,7024,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6025,Not specified (based on ellipsoid 7025),,,,7025,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6027,Not specified (based on ellipsoid 7027),,,,7027,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6028,Not specified (based on ellipsoid 7028),,,,7028,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6029,Not specified (based on ellipsoid 7029),,,,7029,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6030,Not specified (based on ellipsoid 7030),,,,7030,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6031,Not specified (based on ellipsoid 7031),,,,7031,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6032,Not specified (based on ellipsoid 7032),,,,7032,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6033,Not specified (based on ellipsoid 7033),,,,7033,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6034,Not specified (based on ellipsoid 7034),,,,7034,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6035,Not specified (based on ellipsoid 7035),,,,7035,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,96.08
+6036,Not specified (based on ellipsoid 7036),,,,7036,1996-09-12 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,
+6041,Not specified (based on ellipsoid 7041),,,,7041,1999-10-20 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,
+6042,Not specified (based on ellipsoid 7042),,,,7042,1999-10-20 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,
+6043,Not specified (based on ellipsoid 7043),,,,7043,1999-10-20 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,
+6044,Not specified (based on ellipsoid 7044),,,,7044,1999-10-20 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,
+6045,Not specified (based on ellipsoid 7045),,,,7045,1999-10-20 00:00:00,,EPSG,Not a valid datum.  Included for coordinate systems where datum is unknown.,
+6120,Greek,,,Fundamental point: Athens Observatory; latitude 37 deg 58 min 20.132 sec N; longitude 23 deg 42 min 58.815 sec E of Greenwich,7004,1997-06-16 00:00:00,Topography Department; National Technical University of Athens,EPSG,See geodetic datum alias 6404.  Used as basis of topographic mapping based on Hatt projection.,
+6121,Greek Geodetic Reference System 1987,GGRS87,,Fundamental point: Dionysos; latitude 38 deg 04 min 33.8 sec N; longitude 23 deg 55 min 51.0 sec E of Greenwich; geoid height 7.0 m.,7019,1997-06-16 00:00:00,L. Portokalakis; Public Petroleum Corporation of Greece,EPSG,Superseded (old) Greek datum.  Oil industry work based on ED50.,
+6122,Average Terrestrial System 1977,ATS77,,,7041,1997-07-02 00:00:00,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,In use from 1979.  To be phased out in late 1990's.,
+6123,Kartastokoordinaattijarjestelma,KKJ,,Adjustment with fundamental point based on ED50 transformed to best fit the older VVJ adjustment.,7022,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,Adopted in 1970.,
+6124,Rikets koordinatsystem 1990,RT90,,,7004,1997-11-13 00:00:00,National Land Survey of Sweden,EPSG,Supersedes RT38 adjustment (datum code 6308),
+6125,Samboja,,,Original origin station P2 Exc now destroyed.  Extensions recomputed using Toran station T9 as origin.,7004,1997-11-13 00:00:00,Total Indonesia.,EPSG,,
+6126,Lithuania 1994 (ETRS89),LKS94 (ETRS89),,Densification from 4  ETRF89 points.,7019,1998-03-12 00:00:00,HNIT-Baltic GeoInfoServisas,EPSG,Densification of ETRS89 during the 1992 Baltic campaign.,
+6127,Tete,,,Fundamental point: Tete.,7008,1998-04-16 00:00:00,Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,,
+6128,Madzansua,,,Fundamental point: Madzansua.,7008,1998-04-16 00:00:00,Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,Superseded by transformation to Tete datum (datum code 6127).,
+6129,Observatario,,,Fundamental point: Maputo observatory.,7008,1998-04-16 00:00:00,Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,Superseded by transformation to Tete datum (datum code 6127).,
+6130,Moznet (ITRF94),Moznet,,ITRF 1994 epoch 20,7030,1998-04-16 00:00:00,Mozambique Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,,
+6131,Indian 1960,,,,7015,1998-11-11 00:00:00,,EPSG,DMA adjustment of IndoChina part of the Indian 1954 network to better fit local geoid.  Also known as Indian (DMA Reduced).,
+6132,Final Datum 1958,FD58,,Fundamental point: Maniyur.  Latitude: 31 deg 23 min 59.19 sec N; Longitude: 48 deg 32 min 31.38 sec E (of Greenwich).,7012,1998-11-11 00:00:00,IOEPC records,EPSG,Network included in Nahrwan 1967 adjustment.,
+6133,Estonia 1992,EST92,,Densification from 4  ETRS89 points.,7019,1998-12-14 00:00:00,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,Based on ETRS89 as established during the 1992 Baltic campaign.,
+6134,PDO Survey Datum 1993,PSD93,,Adjustment best fitted to Fahud network.,7012,1999-04-22 00:00:00,Petroleum Development Oman,EPSG,Supersedes Fahud datum (code 6232). Maximum differences to Fahud adjustment are 20 metres.,
+6135,Old Hawaiian,,,Fundamental Point: Oahu West Base Astro.  Latitude: 21 deg 18 min 13.89 sec N; longitude 157 deg 50 min 55.79 sec W (of Greenwich),7008,1999-05-24 00:00:00,http://www.ngs.noaa.gov/ (NADCON readme file) and the NIMA publication http://164.214.2.59/publications/guides/Datum_Pamphlet/datum.html,EPSG,Hawaiian Islands were never on NAD27 but rather on Old Hawaiian Datum.  NADCON conversion program provides transformation from Old Hawaiian Datum to NAD83 (original 1986 real [...]
+6136,St. Lawrence Island,,,,7008,1999-05-24 00:00:00,http://www.ngs.noaa.gov/ (NADCON readme file),EPSG,Many Alaskan islands were never on NAD27 but rather on independent datums.  NADCON conversion program provides transformation from St. Lawrence Island Datum to NAD83 (original 1986 realization) - making the transformation appear to user as if from NAD27.,
+6137,St. Paul Island,,,,7008,1999-05-24 00:00:00,http://www.ngs.noaa.gov/ (NADCON readme file),EPSG,Many Alaskan islands were never on NAD27 but rather on independent datums.  NADCON conversion program provides transformation from St. Paul Island Datum to NAD83 (original 1986 realization) - making the transformation appear to user as if from NAD27.,
+6138,St. George Island,,,,7008,1999-05-24 00:00:00,http://www.ngs.noaa.gov/ (NADCON readme file),EPSG,Many Alaskan islands were never on NAD27 but rather on independent datums.  NADCON conversion program provides transformation from St. George Island Datum to NAD83 (original 1986 realization) - making the transformation appear to user as if from NAD27.,
+6139,Puerto Rico,,,,7008,1999-05-24 00:00:00,Ordnance Survey of Great Britain and http://www.ngs.noaa.gov/ (NADCON readme file).,EPSG,NADCON conversion program provides transformation from Puerto Rico Datum to NAD83 (original 1986 realization) but making the transformation appear to user as if from NAD27.,
+6140,NAD83 Canadian Spatial Reference System,NAD83(CSRS98),,,7019,1999-10-20 00:00:00,Service New Brunswick Land and Information Standards Manual,EPSG,Supersedes ATS77 from 1999 in New Brunswick.,
+6141,Israel,,,Fundamental Point:  Latitude: 31 deg 44 min 03.817 sec N; Longitude: 35 deg 12 min 16.261 sec E (of Greenwich).,7019,1999-10-20 00:00:00,Survey of Israel.,EPSG,,
+6142,Locodjo 1965,,,Fundamental Point: T5 Banco. Latitude: 5 deg 18 min 50.5 sec N; Longitude: 4 deg 02 min 05.1 sec W (of Greenwich).,7012,1999-10-20 00:00:00,IGN Paris.,EPSG,,
+6143,Abidjan 1987,,,Fundamental Point: Abidjan I. Latitude: 5 deg 18 min 51.01 sec N; Longitude: 4 deg 02 min 06.04 sec W (of Greenwich).,7012,1999-10-20 00:00:00,IGN Paris.,EPSG,,
+6144,Kalianpur 1937,,,Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).,7015,1999-10-20 00:00:00,"G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.",EPSG,Supercedes 1880 adjustment except for topographic mapping.  Superseded in Pakistan by 1962 metrication conversion and in India by 1975 metrication conversion.,
+6145,Kalianpur 1962,,,Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).,7044,1999-10-20 00:00:00,,EPSG,1937 adjustment rescaled by ratio metric conversions of Indian foot (1937) to Indian foot (1962).,
+6146,Kalianpur 1975,,,Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).,7045,1999-10-20 00:00:00,,EPSG,1937 adjustment rescaled by ratio metric conversions of Indian foot (1937) to Indian foot (1975).,
+6147,Hanoi 1972,,,,7024,1999-10-20 00:00:00,PetroVietnam,EPSG,,
+6148,Hartbeesthoek94,,,Coincident with ITRF91 (1994.0) at Hartbeesthoek astronomical observatory near Pretoria.,7030,1999-10-22 00:00:00,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,Supersedes Cape datum (code 6222).,
+6149,CH1903,,,Fundamental Point: Old Bern observatory. Latitude: 46 deg 57 min  8.660 sec N; Longitude: 7 deg 26 min 22.500 sec E (of Greenwich).,7004,1999-10-20 00:00:00,Bundesamt f�r Landestopographie,EPSG,,
+6150,CH1903+,,,Fundamental Point: Old Bern observatory. Latitude: 46 deg 57 min  8.660 sec N; Longitude: 7 deg 26 min 22.500 sec E (of Greenwich).,7004,1999-10-20 00:00:00,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,,
+6151,Swiss Terrestrial Reference Frame 1995,CHTRF95,,ETRF89 at 1993.0,7019,1999-10-20 00:00:00,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,,
+6152,NAD83 (High Accuracy Regional Network),NAD83(HARN),,,7019,1999-10-20 00:00:00,National Geodetic Survey,EPSG,,
+6153,Rassadiran,,,Fundamental point: Total 1,7022,1999-11-20 00:00:00,Total-Fina,EPSG,,
+6154,ED50(ED77),,,Extension of ED50 over Iran,7022,1999-11-20 00:00:00,National Cartographic Centre of Iran,EPSG,Sometimes referred to as ED50-ED77,
+6200,Pulkovo 1995,,,Fundamental Point: Pulkovo observatory. Latitude: 59 deg 46 min 15.359 sec N; Longitude: 30 deg 19 min 28.318 sec E (of Greenwich).,7024,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+6201,Adindan,,,Fundamental Point: Station 15; Adindan. Latitude: 22 deg 10 min  7.110 sec N; Longitude: 31 deg 29 min 21.608 sec E (of Greenwich).,7012,1995-06-02 00:00:00,,EPSG,,
+6202,Australian Geodetic Datum 1966,AGD66,,Fundamental Point: Johnson Memorial. Latitude: 25 deg 56 min 54.551 sec S; Longitude: 133 deg 12 min 30.077 sec E (of Greenwich).,7003,1995-06-02 00:00:00,Australian Map Grid Technical Manual. National Mapping Council of Australia Technical Publication 7; 1972.,EPSG,,
+6203,Australian Geodetic Datum 1984,AGD84,,,7003,1995-06-02 00:00:00,,EPSG,,
+6204,Ain el Abd 1970,Ain el Abd,,Fundamental Point: Ain El Abd.  Latitude: 28 deg  14 min 06.171 sec N; Longitude: 48 deg 16 min 20.906 sec E (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6205,Afgooye,,,,7024,1995-06-02 00:00:00,,EPSG,,
+6206,Agadez,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6207,Lisbon,,,Fundamental Point: Castelo Sao Jorge; Lisbon. Latitude: 38 deg 42 min 43.631 sec N; Longitude: 9 deg 07 min 54.862 sec W (of Greenwich).,7022,1995-06-02 00:00:00,Instituto Geografico e Cadastral; Lisbon,EPSG,,
+6208,Aratu,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6209,Arc 1950,,,Fundamental Point: Buffelsfontein. Latitude: 33 deg 59 min 32.000 sec S; Longitude: 25 deg 30 min 44.622 sec E (of Greenwich).,7013,1995-06-02 00:00:00,,EPSG,,
+6210,Arc 1960,,,Fundamental Point: Buffelsfontein. Latitude: 33 deg 59 min 32.000 sec S; Longitude: 25 deg 30 min 44.622 sec E (of Greenwich).,7012,1995-06-02 00:00:00,,EPSG,,
+6211,Batavia,,,Fundamental Point: Batavia Astro. Station. Latitude: 6 deg  7 min 39.520 sec S; Longitude: 106 deg 48 min 27.790 sec E (of Greenwich).,7004,1995-06-02 00:00:00,,EPSG,,
+6212,Barbados 1938,,,Fundamental point: HMS Challenger astro station M1; latitude 13 deg 04 min 32.53 sec N; longitude 59 deg 36 min 29.34 sec W (of Greenwich).,7012,1999-04-22 00:00:00,Ordnance Survey of Great Britain.,EPSG,,99.171
+6213,Beduaram,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6214,Beijing 1954,,,,7024,1995-06-02 00:00:00,,EPSG,,
+6215,Reseau National Belge 1950,Belge 1950,,Fundamental Point: Lommel (tower). Latitude: 51 deg 13 min 47.334 sec N; Longitude: 0 deg 56 min 44.773 sec E (of Brussels).,7022,1995-06-02 00:00:00,,EPSG,,
+6216,Bermuda 1957,,,,7008,1995-06-02 00:00:00,,EPSG,,
+6218,Bogota,,,Fundamental Point: Bogota observatory. Latitude: 4 deg 35 min 56.570 sec N; Longitude: 74 deg  4 min 51.300 sec W (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6219,Bukit Rimpah,,,,7004,1995-06-02 00:00:00,,EPSG,,
+6220,Camacupa,,,,7012,1995-06-02 00:00:00,,EPSG,,
+6221,Campo Inchauspe,,,Fundamental Point: Campo Inchauspe. Latitude: 35 deg 58 min 17.000 sec S; Longitude: 62 deg 10 min 12.000 sec W (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6222,Cape,,,Fundamental Point: Buffelsfontein. Latitude: 33 deg 59 min 32.000 sec S; Longitude: 25 deg 30 min 44.622 sec E (of Greenwich).,7013,1996-10-18 00:00:00,"Private Communication, Directorate of Surveys and Land Information, Cape Town.",EPSG,,96.25  99.69
+6223,Carthage,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6224,Chua,,,Fundamental Point: Chua. Latitude: 19 deg 45 min 41.160 sec S; Longitude: 48 deg  6 min  7.560 sec W (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6225,Corrego Alegre,,,Fundamental Point: Corrego Alegre. Latitude: 19 deg 50 min 15.140 sec S; Longitude: 48 deg 57 min 42.750 sec W (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6226,Cote d'Ivoire,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6227,Deir ez Zor,,,Fundamental Point: Trig. 254 Deir. Latitude: 35 deg 21 min 49.975 sec N; Longitude: 40 deg  5 min 46.770 sec E (of Greenwich).,7011,1995-06-02 00:00:00,,EPSG,,
+6228,Douala,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6229,Egypt 1907,,,Fundamental Point: Station F1. Latitude: 30 deg  1 min 42.860 sec N; Longitude: 31 deg 16 min 33.600 sec E (of Greenwich).,7020,1995-06-02 00:00:00,,EPSG,,
+6230,European Datum 1950,ED50,,Fundamental Point: Potsdam (Helmert Tower). Latitude: 52 deg 22 min 51.450 sec N; Longitude: 13 deg  3 min 58.740 sec E (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6231,European Datum 1987,ED87,,,7022,1995-06-02 00:00:00,,EPSG,,
+6232,Fahud,,,Fundamental Point: Station NO68-024 Fahud. Latitude: 22 deg 17 min 31.182 sec N; Longitude: 56 deg 29 min 18.820 sec E (of Greenwich).,7012,1995-06-02 00:00:00,Petroleum Development Oman.,EPSG,Superseded by PSD93 (code 6134).,
+6233,Gandajika 1970,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6234,Garoua,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6235,Guyane Francaise,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6236,Hu Tzu Shan,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6237,Hungarian Datum 1972,HD72,,"Fundamental Point: Szolohegy. Latitude: 47 deg 17 min 32,6156 sec N; Longitude 19 deg 36 min 09.9865 sec E; geoid height 6.56m.",7036,1996-10-18 00:00:00,http://lazarus.elte.hu/gb/geodez/geod3.htm,EPSG,,96.09
+6238,Indonesian Datum 1974,ID74,,Fundamental Point: Padang. Latitude: 0 deg 56 min 38.414 sec S; Longitude: 100 deg 22 min  8.804 sec E (of Greenwich).,7021,1995-06-02 00:00:00,,EPSG,,
+6239,Indian 1954,,,Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).,7015,1995-06-02 00:00:00,,EPSG,,
+6240,Indian 1975,,,Fundamental Point: Khau Sakaerang,7015,1995-06-02 00:00:00,,EPSG,,
+6241,Jamaica 1875,,,Fundamental Point: Fort Charles Flagstaff. Latitude: 17 deg 55 min 55.800 sec N; Longitude: 76 deg 56 min 37.260 sec W (of Greenwich).,7034,1995-06-02 00:00:00,,EPSG,,
+6242,Jamaica 1969,JAD69,,Fundamental Point: Fort Charles Flagstaff. Latitude: 17 deg 55 min 55.800 sec N; Longitude: 76 deg 56 min 37.260 sec W (of Greenwich).,7008,1995-06-02 00:00:00,,EPSG,,
+6243,Kalianpur 1880,,,Fundamental Point: Kalianpur. Latitude: 24 deg  07 min 11.260 sec N; Longitude: 77 deg 39 min 17.570 sec E (of Greenwich).,7042,1999-10-20 00:00:00,"G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.",EPSG,Includes 1916 extrension into Burma (Myanmar).  Superseded by 1937 adjustment.,97.23
+6244,Kandawala,,,,7015,1995-06-02 00:00:00,,EPSG,,
+6245,Kertau,,,Fundamental Point: Kertau. Latitude: 3 deg 27 min 50.710 sec N; Longitude: 102 deg 37 min 24.550 sec E (of Greenwich).,7018,1995-06-02 00:00:00,,EPSG,,
+6246,Kuwait Oil Company,KOC,,,7012,1995-06-02 00:00:00,,EPSG,,
+6247,La Canoa,,,Fundamental Point: La Canoa. Latitude: 8 deg 34 min 17.170 sec N; Longitude: 63 deg 51 min 34.880 sec W (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,Origin also adopted for PSAD56.,
+6248,Provisional South American Datum 1956,PSAD56,,Fundamental Point: La Canoa. Latitude: 8 deg 34 min 17.170 sec N; Longitude: 63 deg 51 min 34.880 sec W (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,Same origin as La Canoa datum.,
+6249,Lake,,,Fundamental Point: Maracaibo Cathedral. Latitude: 10 deg 38 min 34.678 sec N; Longitude: 71 deg 36 min 20.224 sec W (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6250,Leigon,,,Fundamental Point: GCS Station 121. Latitude: 5 deg 38 min 52.270 sec N; Longitude: 0 deg 11 min 46.080 sec W (of Greenwich).,7012,1995-06-02 00:00:00,,EPSG,,
+6251,Liberia 1964,,,,7012,1995-06-02 00:00:00,,EPSG,,
+6252,Lome,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6253,Luzon 1911,,,Fundamental Point: Balacan. Latitude: 13 deg 33 min 41.000 sec N; Longitude: 121 deg 52 min  03.000 sec E (of Greenwich).,7008,1995-06-02 00:00:00,,EPSG,,
+6254,Hito XVIII 1963,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6255,Herat North,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6256,Mahe 1971,,,Fundamental Point: Mahe,7012,1995-06-02 00:00:00,,EPSG,,
+6257,Makassar,,,Fundamental Point: Moncongloe,7004,1995-06-02 00:00:00,,EPSG,,
+6258,European Terrestrial Reference Frame 89,ETRF89,,,7019,1999-04-22 00:00:00,,EPSG,Coincides with WGS84 at the one metre level.,97.11  97.55  99.111
+6259,Malongo 1987,,,Fundamental Point: Station Y at Malongo base camp. Latitude: 5 deg 23 min 34.327 sec S; Longitude: 12 deg 12 min  02.393 sec E (of Greenwich).,7022,1995-06-02 00:00:00,Chevron Petroleum Technology.,EPSG,Offshore extension of Mhast datum (6264) using Transit translocation.,
+6260,Manoca,,,,7012,1995-06-02 00:00:00,,EPSG,,
+6261,Merchich,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6262,Massawa,,,,7004,1995-06-02 00:00:00,,EPSG,,
+6263,Minna,,,Fundamental Point: Minna base station L40. Latitude: 9 deg 38 min  09.000 sec N; Longitude: 6 deg 30 min 59.000 sec E (of Greenwich).,7012,1995-06-02 00:00:00,,EPSG,,
+6264,Mhast,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6265,Monte Mario,,,Fundamental Point: Monte Mario. Latitude: 41 deg 55 min 25.510 sec N; Longitude: 0 deg  00 min  00.000 sec E (of Rome).,7022,1995-06-02 00:00:00,,EPSG,,
+6266,M'poraloko,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6267,North American Datum 1927,NAD27,,Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).,7008,1995-06-02 00:00:00,,EPSG,,
+6268,NAD Michigan,,,Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).,7009,1995-06-02 00:00:00,,EPSG,,
+6269,North American Datum 1983,NAD83,,Origin at geocentre.,7019,1995-06-02 00:00:00,,EPSG,,
+6270,Nahrwan 1967,,,Fundamental point: Nahrwan south base.  Latitude: 33 deg 19 min 10.87 sec N; Longitude: 44 deg 43 min 25.54 sec E (of Greenwich).,7012,1995-06-02 00:00:00,,EPSG,,
+6271,Naparima 1972,,,Fundamental Point: Naparima. Latitude: 10 deg 16 min 44.860 sec N; Longitude: 61 deg 27 min 34.620 sec W (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6272,New Zealand Geodetic Datum 1949,GD49,,Fundamental Point: Papatahi. Latitude: 41 deg 19 min  8.900 sec S; Longitude: 175 deg  02 min 51.000 sec E (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6273,NGO 1948,,,,7005,1995-06-02 00:00:00,,EPSG,,
+6274,Datum 73,,,Fundamental Point:  Latitude: 39 deg 41 min 37.30 sec N; Longitude: 8 deg 07 min 53.31 sec W (of Greenwich).,7022,1995-06-02 00:00:00,Instituto Geografico e Cadastral; Lisbon,EPSG,,
+6275,Nouvelle Triangulation Francaise,NTF,,Fundamental Point: Pantheon,7011,1995-06-02 00:00:00,,EPSG,,
+6276,NSWC 9Z-2,,,,7025,1995-06-02 00:00:00,,EPSG,Transit precise ephemeris before 1991.,
+6277,OSGB 1936,,,Fundamental Point: Herstmonceux. Latitude: 50 deg 51 min 55.271 sec N; Longitude: 0 deg 20 min 45.882 sec E (of Greenwich).,7001,1995-06-02 00:00:00,,EPSG,,
+6278,OSGB 1970 (SN),OSGB70,,Fundamental Point: Herstmonceux. Latitude: 50 deg 51 min 55.271 sec N; Longitude: 0 deg 20 min 45.882 sec E (of Greenwich).,7001,1995-06-02 00:00:00,,EPSG,,
+6279,OS (SN) 1980,OS(SN)80,,Fundamental Point: Herstmonceux. Latitude: 50 deg 51 min 55.271 sec N; Longitude: 0 deg 20 min 45.882 sec E (of Greenwich).,7001,1995-06-02 00:00:00,,EPSG,,
+6280,Padang 1884,Padang,,Fundamental Point: Padang,7004,1995-06-02 00:00:00,,EPSG,,
+6281,Palestine 1923,,,Fundamental Point: Point 82'M  Jerusalem. Latitude: 31 deg 44 min  2.749 sec N; Longitude: 35 deg 12 min 43.490 sec E (of Greenwich).,7010,1995-06-02 00:00:00,,EPSG,,
+6282,Pointe Noire,,,Fundamental Point: Point Noire Astro. Latitude: 4 deg 47 min  0.100 sec S; Longitude: 11 deg 51 min  1.550 sec E (of Greenwich).,7011,1995-06-02 00:00:00,,EPSG,,
+6283,Geocentric Datum of Australia 1994,GDA94,,,7019,1995-06-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Coincident with WGS84 to within 1 metre.,
+6284,Pulkovo 1942,,,Fundamental Point: Pulkovo observatory. Latitude: 59 deg 46 min 18.550 sec N; Longitude: 30 deg 19 min 42.090 sec E (of Greenwich).,7024,1995-06-02 00:00:00,,EPSG,,
+6285,Qatar,,,Fundamental Point: Station G3,7022,1995-06-02 00:00:00,,EPSG,,
+6286,Qatar 1948,,,Fundamental Point: Sokey 0 M. Latitude: 25 deg 22 min 56.500 sec N; Longitude: 50 deg 45 min 41.000 sec E (of Greenwich).,7020,1995-06-02 00:00:00,,EPSG,,
+6287,Qornoq,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6288,Loma Quintana,,,Fundamental Point: Loma Quintana,7022,1995-06-02 00:00:00,,EPSG,,
+6289,Amersfoort,,,Fundamental Point: Amersfoort. Latitude: 52 deg  09 min 22.178 sec N; Longitude: 5 deg 23 min 15.478 sec E (of Greenwich).,7004,1995-06-02 00:00:00,,EPSG,,
+6291,South American Datum 1969,SAD69,,,7036,1996-10-18 00:00:00,,EPSG,SAD69 uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision is 0 to 31mm.,96.09  97.252
+6292,Sapper Hill 1943,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6293,Schwarzeck,,,,7006,1995-06-02 00:00:00,,EPSG,,
+6294,Segora,,,,7004,1995-06-02 00:00:00,,EPSG,,
+6295,Serindung,,,,7004,1995-06-02 00:00:00,,EPSG,,
+6296,Sudan,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6297,Tananarive 1925,Tananarive,,Fundamental Point: Tananarive observatory. Latitude: 18 deg 55 min  2.100 sec S; Longitude: 45 deg 12 min 52.800 sec E (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6298,Timbalai 1948,,,Fundamental Point: Timbalai. Latitude: 5 deg 17 min  3.548 sec N; Longitude: 115 deg 10 min 56.409 sec E (of Greenwich).,7016,1995-06-02 00:00:00,,EPSG,,
+6299,TM65,,,,7002,1995-06-02 00:00:00,,EPSG,,
+6300,TM75,,,,7002,1995-06-02 00:00:00,,EPSG,,
+6301,Tokyo,,,Fundamental Point: Nikon-Keido-Genten. Latitude: 35 deg 39 min 17.5148 sec N; Longitude: 139 deg 44 min 40.5020 sec E (of Greenwich).,7004,1995-06-02 00:00:00,Geographic Survey Institute; Japan; Bulletin 40 (March 1994).  Also http://vldb.gsi-mc.go.jp/sokuchi/datum/tokyodatum.html,EPSG,,98.46
+6302,Trinidad 1903,,,,7007,1995-06-02 00:00:00,,EPSG,,
+6303,Trucial Coast 1948,TC(1948),,Fundamental Point: TC1. Latitude: 25 deg 23 min 50.190 sec N; Longitude: 55 deg 26 min 43.950 sec E (of Greenwich).,7020,1995-06-02 00:00:00,,EPSG,,
+6304,Voirol 1875,,,Fundamental Point: Voirol. Latitude: 40.835864 grads N; Longitude: 0.788735 grads E of Paris.,7011,1995-06-02 00:00:00,IGN Paris,EPSG,,
+6305,Voirol Unifie 1960,Voirol Unifie,,,7012,1999-10-20 00:00:00,"\"Le System Geodesique Nord-Sahara\"; IGN Paris",EPSG,Conformal transformation from ED50. Used only with Lambert Algeria zones: in other cases use Nord Sahara 1959 geodetic datum.,99.62
+6306,Bern 1938,,,Fundamental Point: Old Bern observatory. Latitude: 46 deg 57 min  7.890 sec N; Longitude: 7 deg 26 min 22.335 sec E (of Greenwich).,7004,1995-06-02 00:00:00,"\"Die Projektionen der schweizerischen Plan- und Kartenwerke\"; J. Bolliger 1967",EPSG,This redetermination of the coordinates of fundamental point is used for scientific purposes and as the graticule overprinted on topographic maps constructed on the CH1903 / LV03 projected CS (code 21781).,
+6307,Nord Sahara 1959,,,,7012,1999-10-20 00:00:00,"\"Le System Geodesique Nord-Sahara\"; IGN Paris",EPSG,Conformal transformation from ED50.,99.62
+6308,Stockholm 1938,RT38,,Fundamental Point: Stockholm observatory,7004,1996-04-12 00:00:00,,EPSG,Superseded by RT90 adjustment (datum code 6124),
+6309,Yacare,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6310,Yoff,,,,7011,1995-06-02 00:00:00,,EPSG,,
+6311,Zanderij,,,,7022,1995-06-02 00:00:00,,EPSG,,
+6312,Militar-Geographische Institut,MGI,,Fundamental Point: Hermannskogel. Latitude: 48 deg 16 min 15.29 sec N; Longitude: 16 deg 17 min 41.06 sec E (of Greenwich).,7004,1995-06-02 00:00:00,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,,
+6313,Reseau National Belge 1972,Belge 1972,,Fundamental Point: Uccle observatory. Latitude: 50 deg 47 min 57.704 sec N; Longitude: 4 deg 21 min 24.983 sec E (of Greenwich).,7022,1995-06-02 00:00:00,,EPSG,,
+6314,Deutsche Hauptdreiecksnetz,DHDN,,Fundamental Point: Potsdam. Latitude: 52 deg 22 min 53.954 sec N; Longitude: 13 deg 04 min 01.153 sec E (of Greenwich).,7004,1995-06-02 00:00:00,,EPSG,,
+6315,Conakry 1905,,,Fundamental Point: Conakry. Latitude: 10.573766g N; Longitude: 17.833682g W (of Paris).,7011,1995-06-02 00:00:00,,EPSG,,
+6316,Dealul Piscului 1933,,,Fundamental point: latitude 44 deg 24 min 33.9606 sec N; longitude 26 deg 06 min 44.8772 sec E (of Greenwich).,7022,1996-04-12 00:00:00,Institute for Geodesy Photogrametry and Land Management,EPSG,Superseded by 1970 adjustment (datum code 6317),
+6317,Dealul Piscului 1970,,,Fundamental point: latitude 44 deg 24 min 23.7709 sec N; longitude 26deg 06 min 44.1265 sec E (of Greenwich).,7024,1996-04-12 00:00:00,Institute for Geodesy Photogrametry and Land Management,EPSG,Supersedes 1933 adjustment (datum code 6316),
+6318,National Geodetic Network,NGN,,,7030,1996-04-12 00:00:00,,EPSG,,
+6319,Kuwait Utility,KUDAMS,,,7019,1996-04-12 00:00:00,,EPSG,,
+6322,World Geodetic System 1972,WGS 72,,,7043,1999-04-22 00:00:00,,EPSG,"Used by GPS before 1987. For Transit satellite positioning see also WGS 72BE.                                                                                                                  \
+Datum code 6323 reserved for southern hemisphere ProjCS's.",99.03
+6324,WGS 72 Transit Broadcast Ephemeris,WGS 72BE,,,7043,1999-04-22 00:00:00,,EPSG,Alleged datum for use with Transit broadcast ephemeris prior to 1989. Relationship to WGS 72 has changed over time.  Datum code 6325 reserved for southern hemisphere ProjCS's.,99.03
+6326,World Geodetic System 1984,WGS 84,,Origin at geocentre.,7030,1995-06-02 00:00:00,,EPSG,Datum code 6327 reserved for southern hemisphere ProjCS's,
+6600,Anguilla 1957,,,Fundamental point: station A4.,7012,1999-04-22 00:00:00,Ordnance Survey of Great Britain.,EPSG,,
+6601,Antigua 1943,,,Fundamental point: station A14.,7012,1999-04-22 00:00:00,Ordnance Survey of Great Britain.,EPSG,,
+6602,Dominica 1945,,,Fundamental point: station M12.,7012,1999-04-22 00:00:00,Ordnance Survey of Great Britain.,EPSG,,
+6603,Grenada 1953,,,Fundamental point: station GS8.,7012,1999-04-22 00:00:00,Ordnance Survey of Great Britain.,EPSG,,
+6604,Montserrat 1958,,,Fundamental point: station M36.,7012,1999-04-22 00:00:00,Ordnance Survey of Great Britain.,EPSG,,
+6605,St. Kitts 1955,,,Fundamental point: station K12.,7012,1999-04-22 00:00:00,Ordnance Survey of Great Britain.,EPSG,,
+6606,St. Lucia 1955,,,Fundamental point: station DCS3.,7012,1999-04-22 00:00:00,Ordnance Survey of Great Britain.,EPSG,,
+6607,St. Vincent 1945,,,Fundamental point: station V1.,7012,1999-04-22 00:00:00,Ordnance Survey of Great Britain.,EPSG,,
+6608,North American Datum 1927 (1976),NAD27(76),,Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).,7008,1999-05-12 00:00:00,Geodetic Survey of Canada.,EPSG,NAD27(76) used in Ontario for all maps at scale 1/20 000 and larger; elsewhere in Canada for selected purposes.,
+6609,North American Datum 1927 (CGQ77),CGQ77,,Fundamental Point: Meade's Ranch. Latitude: 39 deg 13 min 26.686 sec N; Longitude: 98 deg 32 min 30.506 sec W (of Greenwich).,7008,1999-05-12 00:00:00,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,NAD27 (CGQ77) used in Quebec for all maps at scale 1/20 000 and larger; generally for maps issued by the Quebec cartography office whose reference system is CGQ77.,
+6901,Ancienne Triangulation Francaise,ATF,,,7027,1995-06-02 00:00:00,,EPSG,,
+6902,Nord de Guerre,NDG,,,7027,1995-06-02 00:00:00,,EPSG,,
+6903,Madrid 1870,,,Fundamental point: Madrid observatory.,7028,1998-11-11 00:00:00,Institut de Geomatica; Barcelona,EPSG,,
diff --git a/src/tiff/csv/geod_trf.c b/src/tiff/csv/geod_trf.c
new file mode 100644
index 0000000..1c90d1f
--- /dev/null
+++ b/src/tiff/csv/geod_trf.c
@@ -0,0 +1,492 @@
+#include "defs.h"
+datafile_rows_t geod_trf_row_1[] = {"GEOD_TRF_CODE","GEOD_TRF_EPSG_NAME","GEOD_TRF_USER_NAME","DESCRIPTION","SOURCE_HORIZCS_CODE","TARGET_HORIZCS_CODE","COORD_TRF_VARIANT","CONCAT_TRF_AREA_OF_USE","COORD_TRF_PATH_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","CONCAT_TRF_REMARKS","CHANGE_ID",NULL};
+datafile_rows_t geod_trf_row_2[] = {"8000","Adindan to WGS 84 (1)","","DMA-Eth Sud","4201","4326","1","","8400","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_3[] = {"8001","Adindan to WGS 84 (2)","","DMA-Bfa","4201","4326","2","","8401","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_4[] = {"8002","Adindan to WGS 84 (3)","","DMA-Cmr","4201","4326","3","","8402","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_5[] = {"8003","Adindan to WGS 84 (4)","","DMA-Eth","4201","4326","4","","8403","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_6[] = {"8004","Adindan to WGS 84 (5)","","DMA-Mli","4201","4326","5","","8404","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_7[] = {"8005","Adindan to WGS 84 (6)","","DMA-Sen","4201","4326","6","","8405","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_8[] = {"8006","Adindan to WGS 84 (7)","","DMA-Sud","4201","4326","7","","8406","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_9[] = {"8007","Afgooye to WGS 84 (1)","","DMA-Som","4205","4326","1","","8407","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_10[] = {"8008","AGD66 to WGS 84 (1)","","DMA-Aus","4202","4326","1","","8408","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_11[] = {"8009","AGD84 to WGS 84 (1)","","DMA-Aus","4203","4326","1","","8409","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_12[] = {"8010","Ain el Abd to WGS 84 (1)","","DMA-Bhr","4204","4326","1","","8410","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_13[] = {"8011","Ain el Abd to WGS 84 (2)","","DMA-Sau","4204","4326","2","","8411","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_14[] = {"8012","Amersfoort to WGS 84 (1)","","NCG-Nld","4289","4326","1","","8412","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_15[] = {"8013","Arc 1950 to WGS 84 (1)","","DMA-mean","4209","4326","1","","8413","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_16[] = {"8014","Arc 1950 to WGS 84 (2)","","DMA-Bwa","4209","4326","2","","8414","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_17[] = {"8015","Arc 1950 to WGS 84 (3)","","DMA-Bdi","4209","4326","3","","8415","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_18[] = {"8016","Arc 1950 to WGS 84 (4)","","DMA-Lso","4209","4326","4","","8416","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_19[] = {"8017","Arc 1950 to WGS 84 (5)","","DMA-Mwi","4209","4326","5","","8417","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_20[] = {"8018","Arc 1950 to WGS 84 (6)","","DMA-Swz","4209","4326","6","","8418","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_21[] = {"8019","Arc 1950 to WGS 84 (7)","","DMA-Cod","4209","4326","7","","8419","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_22[] = {"8020","Arc 1950 to WGS 84 (8)","","DMA-Zmb","4209","4326","8","","8420","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_23[] = {"8021","Arc 1950 to WGS 84 (9)","","DMA-Zwe","4209","4326","9","","8421","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_24[] = {"8022","Arc 1960 to WGS 84 (1)","","DMA-Ken Tza","4210","4326","1","","8422","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_25[] = {"8023","Batavia to WGS 84 (1)","","DMA-Idn Sumatra","4211","4326","1","","8423","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_26[] = {"8024","Bermuda 1957 to WGS 84 (1)","","DMA-Bmu","4216","4326","1","","8424","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_27[] = {"8025","Bogota to WGS 84 (1)","","DMA-Col","4218","4326","1","","8425","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_28[] = {"8026","Bukit Rimpah to WGS 84 (1)","","DMA-Idn Beli","4219","4326","1","","8426","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_29[] = {"8027","Campo Inchauspe to WGS 84 (1)","","DMA-Arg","4221","4326","1","","8427","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_30[] = {"8028","Cape to WGS 84 (1)","","DMA-Zaf","4222","4326","1","","8428","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_31[] = {"8029","Cape to WGS 84 (2)","","DSLI-Zaf","4222","4326","2","","8429","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_32[] = {"8030","Carthage to WGS 84 (1)","","DMA-Tun","4223","4326","1","","8430","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_33[] = {"8031","Chua to WGS 84 (1)","","DMA-Pry","4224","4326","1","","8431","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_34[] = {"8032","Corrego Alegre to WGS 84 (1)","","DMA-Bra","4225","4326","1","","8432","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_35[] = {"8033","ED50 to WGS 84 (1)","","DMA-mean","4230","4326","1","","8433","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_36[] = {"8034","ED50 to WGS 84 (2)","","DMA-cenEur","4230","4326","2","","8434","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_37[] = {"8035","ED50 to WGS 84 (3)","","DMA-midEast","4230","4326","3","","8435","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_38[] = {"8036","ED50 to WGS 84 (4)","","DMA-Cyp","4230","4326","4","","8436","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_39[] = {"8037","ED50 to WGS 84 (5)","","DMA-Egy","4230","4326","5","","8437","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_40[] = {"8038","ED50 to WGS 84 (6)","","DMA-Irl Gbr","4230","4326","6","","8438","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_41[] = {"8039","ED50 to WGS 84 (7)","","DMA-Fin Nor","4230","4326","7","","8439","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_42[] = {"8040","ED50 to WGS 84 (8)","","DMA-Grc","4230","4326","8","","8440","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_43[] = {"8041","ED50 to WGS 84 (9)","","DMA-Irn","4230","4326","9","","8441","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_44[] = {"8042","ED50 to WGS 84 (10)","","DMA-Ita Sard","4230","4326","10","","8442","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_45[] = {"8043","ED50 to WGS 84 (11)","","DMA-Ita Sic","4230","4326","11","","8443","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_46[] = {"8044","ED50 to WGS 84 (12)","","DMA-Mlt","4230","4326","12","","8444","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_47[] = {"8045","ED50 to WGS 84 (13)","","DMA-Prt Esp","4230","4326","13","","8445","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_48[] = {"8046","ED50 to WGS 84 (14)","","6Nat-NSea","4230","4326","14","Denmark - North Sea;  Germany - North Sea;  Netherlands - offshore;  Norway - North Sea south of 62 deg N; United Kingdom (UKCS) - North Sea south of 62 deg N.","8446","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_49[] = {"8047","ED50 to WGS 84 (15)","","NMA-Nor N65","4230","4326","15","Norway - offshore north of 65 deg N.","8447","1996-10-18 00:00:00","","EPSG","The concatenation of transformations 1147 and 1146 gives the following position vector tfm: dX=-84.491  dY=-100.559  dZ=-114.209 metres rX= -2.4006  rY=-0.5367  rZ=-2.3742 microradians  dS=+0.2947 ppm.","",NULL};
+datafile_rows_t geod_trf_row_50[] = {"8048","Egypt 1907 to WGS 84 (1)","","DMA-Egy","4229","4326","1","","8448","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_51[] = {"8049","ETRF89 to WGS 84 (1)","","EPSG-eur","4258","4326","1","","8449","1997-06-19 00:00:00","","EPSG","","97.24",NULL};
+datafile_rows_t geod_trf_row_52[] = {"8050","GDA94 to WGS 84 (1)","","EPSG-Aus","4283","4326","1","","8450","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_53[] = {"8051","GD49 to WGS 84 (1)","","DMA-Nzl","4272","4326","1","","8451","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_54[] = {"8052","Hu Tzu Shan to WGS 84 (1)","","DMA-Twn","4236","4326","1","","8452","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_55[] = {"8053","Indian 1954 to WGS 84 (1)","","DMA-Tha","4239","4326","1","","8453","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_56[] = {"8054","Indian 1975 to WGS 84 (1)","","DMA-Tha","4240","4326","1","","8454","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_57[] = {"8055","Kalianpur 1937 to WGS 84 (1)","","DMA-Bgd","4144","4326","1","","8455","1999-10-20 00:00:00","","EPSG","","97.235",NULL};
+datafile_rows_t geod_trf_row_58[] = {"8056","Kalianpur 1975 to WGS 84 (1)","","DMA-Ind Npl","4146","4326","1","","8456","1999-10-20 00:00:00","","EPSG","","97.235",NULL};
+datafile_rows_t geod_trf_row_59[] = {"8057","Kandawala to WGS 84 (1)","","DMA-Lka","4244","4326","1","","8457","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_60[] = {"8058","Kertau to WGS 84 (1)","","DMA-Mys Sgp","4245","4326","1","","8458","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_61[] = {"8059","Leigon to WGS 84 (1)","","DMA-Gha","4250","4326","1","","8459","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_62[] = {"8060","Liberia 1964 to WGS 84 (1)","","DMA-Lbr","4251","4326","1","","8460","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_63[] = {"8061","Luzon 1911 to WGS 84 (1)","","DMA-Phl N","4253","4326","1","","8461","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_64[] = {"8062","Luzon 1911 to WGS 84 (2)","","DMA-Phl Min","4253","4326","2","","8462","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_65[] = {"8063","M'poraloko to WGS 84 (1)","","DMA-Gab","4266","4326","1","","8463","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_66[] = {"8064","Mahe 1971 to WGS 84 (1)","","DMA-Syc","4256","4326","1","","8464","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_67[] = {"8065","Massawa to WGS 84 (1)","","DMA-Eth","4262","4326","1","","8465","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_68[] = {"8066","Merchich to WGS 84 (1)","","DMA-Mar","4261","4326","1","","8466","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_69[] = {"8067","Minna to WGS 84 (1)","","DMA-Cmr","4263","4326","1","","8467","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_70[] = {"8068","Minna to WGS 84 (2)","","DMA-Nga","4263","4326","2","","8468","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_71[] = {"8069","Monte Mario to WGS 84 (1)","","DMA-Ita Sar","4265","4326","1","","8469","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_72[] = {"8070","NAD27 to WGS 84 (1)","","DMA-Carib","4267","4326","1","","8470","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_73[] = {"8071","NAD27 to WGS 84 (2)","","DMA-Cen Am","4267","4326","2","","8471","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_74[] = {"8072","NAD27 to WGS 84 (3)","","DMA-Can","4267","4326","3","","8472","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_75[] = {"8073","NAD27 to WGS 84 (4)","","DMA-Conus","4267","4326","4","","8473","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_76[] = {"8074","NAD27 to WGS 84 (5)","","DMA-ConusE","4267","4326","5","","8474","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_77[] = {"8075","NAD27 to WGS 84 (6)","","DMA-ConusW","4267","4326","6","","8475","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_78[] = {"8076","NAD27 to WGS 84 (7)","","DMA-USA AK","4267","4326","7","","8476","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_79[] = {"8077","NAD27 to WGS 84 (8)","","DMA-Bha xSalv","4267","4326","8","","8477","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_80[] = {"8078","NAD27 to WGS 84 (9)","","DMA-Bha Salv","4267","4326","9","","8478","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_81[] = {"8079","NAD27 to WGS 84 (10)","","DMA-Can AB BC","4267","4326","10","","8479","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_82[] = {"8080","NAD27 to WGS 84 (11)","","DMA-Can MN ON","4267","4326","11","","8480","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_83[] = {"8081","NAD27 to WGS 84 (12)","","DMA-Can E","4267","4326","12","","8481","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_84[] = {"8082","NAD27 to WGS 84 (13)","","DMA-Can NWT","4267","4326","13","","8482","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_85[] = {"8083","NAD27 to WGS 84 (14)","","DMA-Can Yuk","4267","4326","14","","8483","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_86[] = {"8084","NAD27 to WGS 84 (15)","","DMA-Pan","4267","4326","15","","8484","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_87[] = {"8085","NAD27 to WGS 84 (16)","","DMA-Cuba","4267","4326","16","","8485","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_88[] = {"8086","NAD27 to WGS 84 (17)","","DMA-Grl","4267","4326","17","","8486","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_89[] = {"8087","NAD27 to WGS 84 (18)","","DMA-Mex","4267","4326","18","","8487","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_90[] = {"8088","NAD83 to WGS 84 (1)","","DMA-N Am","4269","4326","1","","8488","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_91[] = {"8089","Nahrwan 1967 to WGS 84 (1)","","DMA-Omn Mas","4270","4326","1","","8489","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_92[] = {"8090","Nahrwan 1967 to WGS 84 (2)","","DMA-Sau","4270","4326","2","","8490","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_93[] = {"8091","Nahrwan 1967 to WGS 84 (3)","","DMA-UAE","4270","4326","3","","8491","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_94[] = {"8092","Naparima 1972 to WGS 84 (1)","","DMA-Tto","4271","4326","1","","8492","1998-06-30 00:00:00","","EPSG","","98.102",NULL};
+datafile_rows_t geod_trf_row_95[] = {"8093","NTF to WGS 84 (1)","","IGN-Fra","4275","4326","1","","8493","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_96[] = {"8094","NTF (Paris) to WGS 84 (1)","","EPSG-Fra","4807","4326","1","France..","8494","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_97[] = {"8095","OSGB 1936 to WGS 84 (1)","","DMA-Gbr","4277","4326","1","","8495","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_98[] = {"8096","OSGB 1936 to WGS 84 (2)","","DMA-Gbr Eng","4277","4326","2","","8496","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_99[] = {"8097","OSGB 1936 to WGS 84 (3)","","DMA-Gbr E&W","4277","4326","3","","8497","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_100[] = {"8098","OSGB 1936 to WGS 84 (4)","","DMA-Gbr Sco","4277","4326","4","","8498","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_101[] = {"8099","OSGB 1936 to WGS 84 (5)","","DMA-Gbr Wal","4277","4326","5","","8499","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_102[] = {"8100","Pointe Noire to WGS 84 (1)","","DMA-Cog","4282","4326","1","","8500","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_103[] = {"8101","PSAD56 to WGS 84 (1)","","DMA-mean","4248","4326","1","","8501","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_104[] = {"8102","PSAD56 to WGS 84 (2)","","DMA-Bol","4248","4326","2","","8502","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_105[] = {"8103","PSAD56 to WGS 84 (3)","","DMA-Chl N","4248","4326","3","","8503","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_106[] = {"8104","PSAD56 to WGS 84 (4)","","DMA Chl S","4248","4326","4","","8504","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_107[] = {"8105","PSAD56 to WGS 84 (5)","","DMA-Col","4248","4326","5","","8505","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_108[] = {"8106","PSAD56 to WGS 84 (6)","","DMA-Ecu","4248","4326","6","","8506","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_109[] = {"8107","PSAD56 to WGS 84 (7)","","DMA-Guy","4248","4326","7","","8507","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_110[] = {"8108","PSAD56 to WGS 84 (8)","","DMA-Per","4248","4326","8","","8508","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_111[] = {"8109","PSAD56 to WGS 84 (9)","","DMA-Ven","4248","4326","9","","8509","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_112[] = {"8110","Qatar to WGS 84 (1)","","DMA-Qat","4285","4326","1","","8510","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_113[] = {"8111","Qornoq to WGS 84 (1)","","DMA-Grl S","4287","4326","1","","8511","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_114[] = {"8112","SAD69 to WGS 84 (1)","","DMA-mean","4291","4326","1","","8512","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_115[] = {"8113","SAD69 to WGS 84 (2)","","DMA-Arg","4291","4326","2","","8513","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_116[] = {"8114","SAD69 to WGS 84 (3)","","DMA-Bol","4291","4326","3","","8514","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_117[] = {"8115","SAD69 to WGS 84 (4)","","DMA-Bra","4291","4326","4","","8515","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_118[] = {"8116","SAD69 to WGS 84 (5)","","DMA-Chile","4291","4326","5","","8516","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_119[] = {"8117","SAD69 to WGS 84 (6)","","DMA-Col","4291","4326","6","","8517","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_120[] = {"8118","SAD69 to WGS 84 (7)","","DMA-Ecu","4291","4326","7","","8518","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_121[] = {"8119","SAD69 to WGS 84 (8)","","DMA-Ecu Gal","4291","4326","8","","8519","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_122[] = {"8120","SAD69 to WGS 84 (9)","","DMA-Guyana","4291","4326","9","","8520","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_123[] = {"8121","SAD69 to WGS 84 (10)","","DMA-Pgy","4291","4326","10","","8521","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_124[] = {"8122","SAD69 to WGS 84 (11)","","DMA-Peru","4291","4326","11","","8522","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_125[] = {"8123","SAD69 to WGS 84 (12)","","DMA-Tto","4291","4326","12","","8523","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_126[] = {"8124","SAD69 to WGS 84 (13)","","DMA-Ven","4291","4326","13","","8524","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_127[] = {"8125","Sapper Hill 1943 to WGS 84 (1)","","DMA-Flk E","4292","4326","1","","8525","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_128[] = {"8126","Schwarzeck to WGS 84 (1)","","DMA-Nam","4293","4326","1","","8526","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_129[] = {"8127","Tananarive to WGS 84 (1)","","DMA-Mdg","4297","4326","1","","8527","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_130[] = {"8128","Timbalai 1948 to WGS 84 (1)","","DMA-Borneo","4298","4326","1","","8528","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_131[] = {"8129","TM65 to WGS 84 (1)","","DMA-Ire","4299","4326","1","","8529","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_132[] = {"8130","Tokyo to WGS 84 (1)","","DMA-Jpn Kor","4301","4326","1","","8530","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_133[] = {"8131","Tokyo to WGS 84 (2)","","DMA-Jpn","4301","4326","2","","8531","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_134[] = {"8132","Tokyo to WGS 84 (3)","","DMA-Kor","4301","4326","3","","8532","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_135[] = {"8133","Tokyo to WGS 84 (4)","","DMA-Jpn Ok","4301","4326","4","","8533","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_136[] = {"8134","Yacare to WGS 84 (1)","","DMA-Ury","4309","4326","1","","8534","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_137[] = {"8135","Zanderij to WGS 84 (1)","","DMA-Sur","4311","4326","1","","8535","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_138[] = {"8136","ED50 to ED87 (1)","","6Nat-NSea","4230","4231","1","","8536","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_139[] = {"8137","ED87 to WGS 84 (1)","","6Nat-NSea","4231","4326","1","","8537","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_140[] = {"8138","ED50 to ED87 (2)","","NMA-Nor N65","4230","4231","2","","8538","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_141[] = {"8139","AGD84 to WGS 84 (2)","","Auslig-Aus old","4203","4326","2","","8539","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_142[] = {"8140","WGS 72 to WGS 84 (1)","","DMA","4322","4326","1","","8540","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_143[] = {"8141","WGS 72 to WGS 84 (2)","","","4322","4326","2","","8541","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_144[] = {"8142","WGS 72BE to WGS 72 (1)","","","4324","4322","1","","8542","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_145[] = {"8143","WGS 72BE to WGS 84 (1)","","","4324","4326","1","","8543","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_146[] = {"8144","NAD27 to NAD83 (1)","","NGS-Conus","4267","4269","1","","8544","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_147[] = {"8146","NAD27 to NAD83 (2)","","NGS-Usa AK","4267","4269","2","","8546","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_148[] = {"8148","ED50 to WGS 84 (16)","","DMA-Tun","4230","4326","16","","8548","1997-06-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_149[] = {"8149","Herat North to WGS 84 (1)","","DMA-Afg","4255","4326","1","","8549","1997-06-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_150[] = {"8150","Kalianpur 1962 to WGS 84 (1)","","DMA-Pak","4145","4326","1","","8550","1999-10-20 00:00:00","","EPSG","","97.235",NULL};
+datafile_rows_t geod_trf_row_151[] = {"8151","ID74 to WGS 84 (1)","","DMA-Idn","4238","4326","1","","8551","1997-06-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_152[] = {"8152","NAD27 to WGS 84 (21)","","DMA-AK AluE","4267","4326","21","","8552","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_153[] = {"8153","NAD27 to WGS 84 (22)","","DMA-AK AluW","4267","4326","22","","8553","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_154[] = {"8154","NAD83 to WGS 84 (2)","","DMA-AK Alu","4269","4326","2","","8554","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_155[] = {"8155","NAD83 to WGS 84 (3)","","DMA-USA Hi","4269","4326","3","","8555","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_156[] = {"8156","Nord Sahara 1959 to WGS 84 (1)","","DMA-Alg","4307","4326","1","","8556","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_157[] = {"8157","Pulkovo 1942 to WGS 84 (1)","","DMA-Rus","4284","4326","1","","8557","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_158[] = {"8158","Voirol Unifie to WGS 84 (1)","","DMA-Alg N","4305","4326","1","","8558","1997-04-11 00:00:00","","EPSG","","98.15",NULL};
+datafile_rows_t geod_trf_row_159[] = {"8159","Fahud to WGS 84 (1)","","DMA-Omn","4232","4326","1","","8559","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_160[] = {"8160","NTF (Paris) to NTF (1)","","IGN-Fra","4807","4275","1","","8560","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_161[] = {"8161","Bern 1898 (Bern) to Bern 1898 (1)","","BfL-CH","4801","4217","1","","8561","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_162[] = {"8162","Bogota (Bogota) to Bogota (1)","","IGAC-Col","4802","4218","1","","8562","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_163[] = {"8163","Lisbon (Lisbon) to Lisbon (1)","","IGC-Prt","4803","4207","1","","8564","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_164[] = {"8164","Makassar (Jakarta) to Makassar (1)","","EPSG-Idn Sulawesi","4804","4257","1","","8565","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_165[] = {"8165","MGI (Ferro) to MGI (1)","","BEV-Aut balk","4805","4312","1","","8566","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_166[] = {"8166","Monte Mario (Rome) to Monte Mario (1)","","EPSG-Ita","4806","4265","1","","8567","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_167[] = {"8167","Padang (Jakarta) to Padang (1)","","EPSG-Idn Sumatra","4808","4280","1","","8569","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_168[] = {"8168","Belge 1950 (Brussels) to Belge 1950 (1)","","IGN-Bel","4809","4215","1","","8570","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_169[] = {"8169","Tananarive (Paris) to Tananarive (1)","","EPSG-Mdg","4810","4297","1","","8571","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_170[] = {"8170","Voirol 1875 (Paris) to Voirol 1875 (1)","","IGN-Dza","4811","4304","1","","8573","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_171[] = {"8171","Voirol Unifie (Paris) to Voirol Unifie(1","","IGN-Dza","4812","4305","1","","8574","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_172[] = {"8172","Batavia (Jakarta) to Batavia (1)","","EPSG-Idn Java","4813","4211","1","","8576","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_173[] = {"8173","RT38 (Stockholm) to RT38 (1)","","NLS-Swe","4814","4308","1","","8578","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_174[] = {"8174","Bogota (Bogota) to WGS 84 (1)","","EPSG-Col","4802","4326","1","Colombia.","8563","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_175[] = {"8175","Monte Mario (Rome) to WGS 84 (1)","","EPSG-Ita","4806","4326","1","Italy (Sardinia).","8568","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_176[] = {"8176","Tananarive (Paris) to WGS 84 (1)","","EPSG-Mdg","4810","4326","1","Madagascar.","8572","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_177[] = {"8177","Voirol Unifie (Paris) to WGS 84 (1)","","EPSG-Dza N","4812","4326","1","Algeria - north of 35g (31 deg 30 min) North","8575","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_178[] = {"8178","Batavia (Jakarta) to WGS 84 (1)","","EPSG-Idn Sumatra","4813","4326","1","Indonesia (Sumatra).","8577","1997-04-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_179[] = {"8179","Greek (Athens) to Greek (1)","","NTU-Grc","4815","4120","1","","8579","1998-12-14 00:00:00","","EPSG","","98.52",NULL};
+datafile_rows_t geod_trf_row_180[] = {"8180","Schwarzeck to WGS 84 (2)","","SLI-Nam","4293","4326","2","","8580","1998-11-19 00:00:00","","EPSG","","98.46",NULL};
+datafile_rows_t geod_trf_row_181[] = {"8181","GGRS87 to WGS 84 (1)","","Hel-Grc","4121","4326","1","","8581","1997-06-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_182[] = {"8182","HD72 to ETRF89 (1)","","ELTE-Hun","4237","4258","1","","8582","1997-11-13 00:00:00","","EPSG","","97.47",NULL};
+datafile_rows_t geod_trf_row_183[] = {"8183","HD72 to WGS 84 (1)","","EPSG-Hun","4237","4326","1","Hungary.","8583","1997-07-22 00:00:00","","EPSG","For many purposes ETRF89 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_184[] = {"8184","ED50 to WGS 84 (17)","","IGN-Fra","4230","4326","17","","8584","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_185[] = {"8185","NTF to ED50 (1)","","IGN-Fra","4275","4230","1","","8585","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_186[] = {"8186","NTF (Paris) to ED50 (1)","","EPSG-Fra","4807","4230","1","France","8586","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_187[] = {"8187","NTF to WGS 72 (1)","","IGN-Fra","4275","4322","1","","8587","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_188[] = {"8188","NTF (Paris) to WGS 72 (1)","","EPSG-Fra","4807","4322","1","France.","8588","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_189[] = {"8189","AGD66 to GDA94 (1)","","Auslig-Aus 5m","4202","4283","1","","8589","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_190[] = {"8190","AGD66 to WGS 84 (2)","","EPSG-Aus 5m","4202","4326","2","Australia..","8590","1998-12-16 00:00:00","","EPSG","For many purposes GDA94 can be assumed to be coincident with WGS 84.","98.50",NULL};
+datafile_rows_t geod_trf_row_191[] = {"8191","AGD84 to GDA94 (1)","","Auslig-Aus 5m","4203","4283","1","","8591","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_192[] = {"8192","AGD84 to WGS 84 (3)","","EPSG-Aus 5m","4203","4326","3","Australia","8592","1998-12-16 00:00:00","","EPSG","For many purposes GDA94 can be assumed to be coincident with WGS 84.","98.50",NULL};
+datafile_rows_t geod_trf_row_193[] = {"8193","AGD84 to GDA94 (2)","","Auslig-Aus 1m","4203","4283","2","","8593","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_194[] = {"8194","AGD84 to WGS 84 (4)","","EPSG-Aus 1m","4203","4326","4","Australia.","8594","1998-12-16 00:00:00","","EPSG","For many purposes GDA94 can be assumed to be coincident with WGS 84.","98.50",NULL};
+datafile_rows_t geod_trf_row_195[] = {"8195","RT90 to WGS 84 (1)","","EPSG-Swe","4124","4326","1","Sweden.","8595","1999-04-22 00:00:00","","EPSG","For many purposes ETRF89 can be assumed to be coincident with WGS 84.","99.11",NULL};
+datafile_rows_t geod_trf_row_196[] = {"8196","Samboja to WGS 84 (1)","","TOT-Idn Mah","4125","4326","1","","8596","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_197[] = {"8197","Pulkovo 1942 to LKS94 (1)","","HNIT-Ltu","4284","4126","1","","8597","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_198[] = {"8198","LKS94 to WGS 84 (1)","","HNIT-Ltu","4126","4326","1","","8598","1998-04-16 00:00:00","","EPSG","For many purposes LKS94 can be assumed to be coincident with WGS 84.","98.13",NULL};
+datafile_rows_t geod_trf_row_199[] = {"8199","Pulkovo 1942 to WGS 84 (2)","","EPSG-Ltu","4284","4326","2","Lithuania.","8609","1998-03-12 00:00:00","","EPSG","For many purposes LKS94 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_200[] = {"8200","Pulkovo 1942 to WGS 84 (3)","","NIMA-Hun","4284","4326","3","","8602","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_201[] = {"8201","Pulkovo 1942 to WGS 84 (4)","","NIMA-Pol","4284","4326","4","","8603","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_202[] = {"8202","Pulkovo 1942 to WGS 84 (5)","","NIMA-Cze","4284","4326","5","","8604","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_203[] = {"8203","Pulkovo 1942 to WGS 84 (6)","","NIMA-Lva","4284","4326","6","","8605","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_204[] = {"8204","Pulkovo 1942 to WGS 84 (7)","","NIMA-Kaz","4284","4326","7","","8606","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_205[] = {"8205","Pulkovo 1942 to WGS 84 (8)","","NIMA-Alb","4284","4326","8","","8607","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_206[] = {"8206","Pulkovo 1942 to WGS 84 (9)","","NIMA-Rom","4284","4326","9","","8608","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_207[] = {"8207","Arc 1960 to WGS 84 (2)","","NIMA-Ken","4210","4326","2","","8599","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_208[] = {"8208","Arc 1960 to WGS 84 (3)","","NIMA-Tza","4210","4326","3","","8600","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_209[] = {"8209","Segora to WGS 84 (1)","","NIMA-Idn Kal","4294","4326","1","","8601","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_210[] = {"8210","Voirol 1875 to WGS 84 (1)","","NIMA-Dza N","4304","4326","1","","8610","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_211[] = {"8211","Voirol 1875 (Paris) to WGS 84 (1)","","EPSG-Dza N","4811","4326","1","Algeria - north of 35g (31 deg 30 min) North.","8611","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_212[] = {"8212","Naparima 1972 to WGS 84 (2)","","MEEI-Tto","4271","4326","2","","8612","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_213[] = {"8213","Trinidad 1903 to WGS 84 (1)","","MEEI-Trin","4302","4326","1","","8613","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_214[] = {"8214","Tete to Moznet (1)","","DNGC-Moz","4127","4130","1","","8614","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_215[] = {"8215","Tete to WGS 84 (1)","","EPSG-Moz","4127","4326","1","Mozambique - average for whole country.","8615","1998-04-16 00:00:00","","EPSG","For many purposes Moznet can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_216[] = {"8216","Tete to Moznet (2)","","DNGC-Moz A","4127","4130","2","","8616","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_217[] = {"8217","Tete to WGS 84 (2)","","EPSG-Moz A","4127","4326","2","Mozambique - Maputo province and southern part of Gaza province; i.e. south of approximately 24 deg S.","8617","1998-04-16 00:00:00","","EPSG","For many purposes Moznet can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_218[] = {"8218","Tete to Moznet (3)","","DNGC-Moz B","4127","4130","3","","8618","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_219[] = {"8219","Tete to WGS 84 (3)","","EPSG-Moz B","4127","4326","3","Mozambique - provinces of Gaza; Inhambane and southern parts of Sofala and Manhica; i.e. between approximately 24 and 20 deg South.","8619","1998-04-16 00:00:00","","EPSG","For many purposes Moznet can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_220[] = {"8220","Tete to Moznet (4)","","DNGC-Moz C","4127","4130","4","","8620","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_221[] = {"8221","Tete to WGS 84 (4)","","EPSG-Moz C","4127","4326","4","Mozambique - provinces of Sofala north of Beira corridor; Manhica; Tete and Zambezia; i.e. between approximately 20 and 16 deg South.","8621","1998-04-16 00:00:00","","EPSG","For many purposes Moznet can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_222[] = {"8222","Tete to Moznet (5)","","DNGC-Moz D","4127","4130","5","","8622","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_223[] = {"8223","Tete to WGS 84 (5)","","EPSG-Moz D","4127","4326","5","Mozambique - provinces of Nampula; Niassa; Cabo Delgado; i.e. north of approximately 16 deg S.","8623","1998-04-16 00:00:00","","EPSG","For many purposes Moznet can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_224[] = {"8224","Moznet to WGS 84 (1)","","EPSG-Moz","4130","4326","1","","8624","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_225[] = {"8225","Pulkovo 1942 to WGS 84 (10)","","KCS-Kaz Cas","4284","4326","10","","8625","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_226[] = {"8226","Indian 1975 to WGS 84 (2)","","NIMA-Tha","4240","4326","2","","8626","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_227[] = {"8227","Tokyo to WGS 84 (5)","","NIMA-Kor","4301","4326","5","","8627","1998-11-19 00:00:00","","EPSG","","98.46",NULL};
+datafile_rows_t geod_trf_row_228[] = {"8228","MGI to WGS 84 (1)","","NIMA-balk","4312","4326","1","","8628","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_229[] = {"8229","Naparima 1972 to WGS 84 (3)","","NIMA-Tto","4271","4326","3","","8629","1998-04-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_230[] = {"8233","DHDN to ETRF89 (1)","","IfAG-Deu W","4314","4258","1","","8633","1998-06-30 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_231[] = {"8234","DHDN to WGS 84 (1)","","EPSG-Deu W","4314","4326","1","Germany - former west Germany.","8634","1998-06-30 00:00:00","EPSG","EPSG","For many purposes ETRF89 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_232[] = {"8235","Pulkovo 1942 to ETRF89 (1)","","IfAG-Deu E","4284","4258","1","","8635","1998-06-30 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_233[] = {"8236","Pulkovo 1942 to WGS 84 (11)","","EPSG-Deu E","4284","4326","11","Germany - former east Germany - Brandenburg; Mecklenburg-Vorpommern; Sachsen-Anhalt.","8636","1998-06-30 00:00:00","","EPSG","For many purposes ETRF89 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_234[] = {"8237","ED50 to WGS 84 (Common Offshore)","","UKOOA-CO","4230","4326","18","","8637","1998-06-30 00:00:00","","EPSG","","98.27",NULL};
+datafile_rows_t geod_trf_row_235[] = {"8238","Madrid 1870 (Madrid) to ED50 (1)","","IGB-Esp","4903","4230","1","","8638","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_236[] = {"8239","Madrid 1870 (Madrid) to ED50 (2)","","IGB-Esp N","4903","4230","2","","8639","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_237[] = {"8240","Madrid 1870 (Madrid) to ED50 (3)","","IGB-Esp S","4903","4230","3","","8640","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_238[] = {"8241","Madrid 1870 (Madrid) to WGS 84 (1)","","EPSG-Esp","4903","4326","1","Spain.","8641","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_239[] = {"8242","NAD27 to NAD83 (3)","","GC-Can NT1","4267","4269","3","","8642","1998-11-11 00:00:00","","EPSG","","98.57",NULL};
+datafile_rows_t geod_trf_row_240[] = {"8243","NAD27 to WGS 84 (25)","","EPSG-Can old","4267","4326","25","Canada","8643","1998-11-11 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_241[] = {"8244","NAD27 to NAD83 (4)","","GC-Can","4267","4269","4","","8644","1998-11-11 00:00:00","","EPSG","","98.57",NULL};
+datafile_rows_t geod_trf_row_242[] = {"8245","NAD27 to WGS 84 (26)","","EPSG-Can","4267","4326","26","Canada.","8645","1998-11-11 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_243[] = {"8246","OSGB 1936 to WGS 84 (Petroleum)","","UKOOA-Pet","4277","4326","6","","8646","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_244[] = {"8247","OSGB 1936 to ED50 (UKOOA)","","UKOOA-UKCS","4277","4230","1","","8647","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_245[] = {"8248","Manoca to WGS 84 (1)","","SCS-Cmr","4260","4326","1","","8648","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_246[] = {"8249","Camacupa to WGS 72BE (1)","","GSI-Ago","4220","4324","1","","8649","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_247[] = {"8250","Camacupa to WGS 84 (1)","","CON-Ago B5","4220","4326","1","","8650","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_248[] = {"8251","Camacupa to WGS 84 (2)","","TEX-Ago B2","4220","4326","2","","8651","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_249[] = {"8252","Camacupa to WGS 84 (3)","","SHL-Ago old","4220","4326","3","","8652","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_250[] = {"8253","Camacupa to WGS 84 (4)","","GSI-Ago","4220","4326","4","","8653","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_251[] = {"8254","Camacupa to WGS 84 (5)","","ELF-Ago B3 old","4220","4326","5","","8654","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_252[] = {"8255","Camacupa to WGS 84 (6)","","ELF-Ago B7 old","4220","4326","6","","8655","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_253[] = {"8256","Camacupa to WGS 84 (7)","","ELF-Ago B15","4220","4326","7","","8656","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_254[] = {"8257","Camacupa to WGS 84 (8)","","ELF-Ago B2 old","4220","4326","8","","8657","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_255[] = {"8258","Camacupa to WGS 84 (9)","","SHL-Ago B16","4220","4326","9","","8658","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_256[] = {"8259","Camacupa to WGS 84 (10)","","ELF-Ago N","4220","4326","10","","8659","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_257[] = {"8260","Malongo 1987 to Mhast (1)","","CHV-Ago Cab","4259","4264","1","","8660","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_258[] = {"8261","Mhast to WGS 84 (1)","","CHV-Ago Cab","4264","4326","1","","8661","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_259[] = {"8262","Malongo 1987 to WGS 84 (1)","","CHV-Ago Cab","4259","4326","1","","8662","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_260[] = {"8263","MGI (Ferro) to WGS 84 (1)","","DMA-balk","4805","4326","1","MEAN FOR Boznia and Herzegovina; Croatia; Serbia; Slovenia.","8663","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_261[] = {"8264","EST92 to ETRF89 (1)","","UT-Est","4133","4258","1","","8664","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_262[] = {"8265","Pulkovo 1942 to EST92 (1)","","UT-Est","4284","4133","1","","8665","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_263[] = {"8266","EST92 to WGS 84 (1)","","UT-Est","4133","4326","1","","8666","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_264[] = {"8267","Pulkovo 1942 to WGS 84 (12)","","UT-Est","4284","4326","12","","8667","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_265[] = {"8268","Tokyo to WGS 84 (6)","","GSI-Jpn 452141","4301","4326","6","","8668","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_266[] = {"8269","Tokyo to WGS 84 (7)","","GSI-Jpn 452142","4301","4326","7","","8669","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_267[] = {"8270","Tokyo to WGS 84 (8)","","GSI-Jpn 444141","4301","4326","8","","8670","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_268[] = {"8271","Tokyo to WGS 84 (9)","","GSI-Jpn 444142","4301","4326","9","","8671","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_269[] = {"8272","Tokyo to WGS 84 (10)","","GSI-Jpn 440141","4301","4326","10","","8672","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_270[] = {"8273","Tokyo to WGS 84 (11)","","GSI-Jpn 440142","4301","4326","11","","8673","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_271[] = {"8274","Tokyo to WGS 84 (12)","","GSI-Jpn 440143","4301","4326","12","","8674","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_272[] = {"8275","Tokyo to WGS 84 (13)","","GSI-Jpn 440144","4301","4326","13","","8675","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_273[] = {"8276","Tokyo to WGS 84 (14)","","GSI-Jpn 432141","4301","4326","14","","8676","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_274[] = {"8277","Tokyo to WGS 84 (15)","","GSI-Jpn 432142","4301","4326","15","","8677","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_275[] = {"8278","Tokyo to WGS 84 (16)","","GSI-Jpn 432143","4301","4326","16","","8678","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_276[] = {"8279","Tokyo to WGS 84 (17)","","GSI-Jpn 432144","4301","4326","17","","8679","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_277[] = {"8280","Tokyo to WGS 84 (18)","","GSI-Jpn 432145","4301","4326","18","","8680","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_278[] = {"8281","Tokyo to WGS 84 (19)","","GSI-Jpn 424140","4301","4326","19","","8681","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_279[] = {"8282","Tokyo to WGS 84 (20)","","GSI-Jpn 424141","4301","4326","20","","8682","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_280[] = {"8283","Tokyo to WGS 84 (21)","","GSI-Jpn 424142","4301","4326","21","","8683","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_281[] = {"8284","Tokyo to WGS 84 (22)","","GSI-Jpn 424143","4301","4326","22","","8684","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_282[] = {"8285","Tokyo to WGS 84 (23)","","GSI-Jpn 424144","4301","4326","23","","8685","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_283[] = {"8286","Tokyo to WGS 84 (24)","","GSI-Jpn 424145","4301","4326","24","","8686","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_284[] = {"8287","Tokyo to WGS 84 (25)","","GSI-Jpn 420139","4301","4326","25","","8687","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_285[] = {"8288","Tokyo to WGS 84 (26)","","GSI-Jpn 420140","4301","4326","26","","8688","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_286[] = {"8289","Tokyo to WGS 84 (27)","","GSI-Jpn","4301","4326","27","","8689","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_287[] = {"8290","Tokyo to WGS 84 (28)","","GSI-Jpn","4301","4326","28","","8690","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_288[] = {"8291","Tokyo to WGS 84 (29)","","GSI-Jpn","4301","4326","29","","8691","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_289[] = {"8292","Tokyo to WGS 84 (30)","","GSI-Jpn","4301","4326","30","","8692","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_290[] = {"8293","Tokyo to WGS 84 (31)","","GSI-Jpn","4301","4326","31","","8693","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_291[] = {"8294","Tokyo to WGS 84 (32)","","GSI-Jpn","4301","4326","32","","8694","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_292[] = {"8295","Tokyo to WGS 84 (33)","","GSI-Jpn","4301","4326","33","","8695","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_293[] = {"8296","Tokyo to WGS 84 (34)","","GSI-Jpn","4301","4326","34","","8696","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_294[] = {"8297","Tokyo to WGS 84 (35)","","GSI-Jpn","4301","4326","35","","8697","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_295[] = {"8298","Tokyo to WGS 84 (36)","","GSI-Jpn","4301","4326","36","","8698","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_296[] = {"8299","Tokyo to WGS 84 (37)","","GSI-Jpn","4301","4326","37","","8699","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_297[] = {"8300","Tokyo to WGS 84 (38)","","GSI-Jpn","4301","4326","38","","8700","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_298[] = {"8301","Tokyo to WGS 84 (39)","","GSI-Jpn","4301","4326","39","","8701","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_299[] = {"8302","Tokyo to WGS 84 (40)","","GSI-Jpn","4301","4326","40","","8702","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_300[] = {"8303","Tokyo to WGS 84 (41)","","GSI-Jpn","4301","4326","41","","8703","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_301[] = {"8304","Tokyo to WGS 84 (42)","","GSI-Jpn","4301","4326","42","","8704","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_302[] = {"8305","Tokyo to WGS 84 (43)","","GSI-Jpn","4301","4326","43","","8705","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_303[] = {"8306","Tokyo to WGS 84 (44)","","GSI-Jpn","4301","4326","44","","8706","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_304[] = {"8307","Tokyo to WGS 84 (45)","","GSI-Jpn","4301","4326","45","","8707","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_305[] = {"8308","Tokyo to WGS 84 (46)","","GSI-Jpn","4301","4326","46","","8708","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_306[] = {"8309","Tokyo to WGS 84 (47)","","GSI-Jpn","4301","4326","47","","8709","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_307[] = {"8310","Tokyo to WGS 84 (48)","","GSI-Jpn","4301","4326","48","","8710","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_308[] = {"8311","Tokyo to WGS 84 (49)","","GSI-Jpn","4301","4326","49","","8711","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_309[] = {"8312","Tokyo to WGS 84 (50)","","GSI-Jpn","4301","4326","50","","8712","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_310[] = {"8313","Tokyo to WGS 84 (51)","","GSI-Jpn","4301","4326","51","","8713","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_311[] = {"8314","Tokyo to WGS 84 (52)","","GSI-Jpn","4301","4326","52","","8714","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_312[] = {"8315","Tokyo to WGS 84 (53)","","GSI-Jpn","4301","4326","53","","8715","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_313[] = {"8316","Tokyo to WGS 84 (54)","","GSI-Jpn","4301","4326","54","","8716","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_314[] = {"8317","Tokyo to WGS 84 (55)","","GSI-Jpn","4301","4326","55","","8717","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_315[] = {"8318","Tokyo to WGS 84 (56)","","GSI-Jpn","4301","4326","56","","8718","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_316[] = {"8319","Tokyo to WGS 84 (57)","","GSI-Jpn","4301","4326","57","","8719","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_317[] = {"8320","Tokyo to WGS 84 (58)","","GSI-Jpn","4301","4326","58","","8720","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_318[] = {"8321","Tokyo to WGS 84 (59)","","GSI-Jpn","4301","4326","59","","8721","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_319[] = {"8322","Tokyo to WGS 84 (60)","","GSI-Jpn","4301","4326","60","","8722","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_320[] = {"8323","Tokyo to WGS 84 (61)","","GSI-Jpn","4301","4326","61","","8723","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_321[] = {"8324","Tokyo to WGS 84 (62)","","GSI-Jpn","4301","4326","62","","8724","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_322[] = {"8325","Tokyo to WGS 84 (63)","","GSI-Jpn","4301","4326","63","","8725","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_323[] = {"8326","Tokyo to WGS 84 (64)","","GSI-Jpn","4301","4326","64","","8726","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_324[] = {"8327","Tokyo to WGS 84 (65)","","GSI-Jpn","4301","4326","65","","8727","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_325[] = {"8328","Tokyo to WGS 84 (66)","","GSI-Jpn","4301","4326","66","","8728","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_326[] = {"8329","Tokyo to WGS 84 (67)","","GSI-Jpn","4301","4326","67","","8729","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_327[] = {"8330","Tokyo to WGS 84 (68)","","GSI-Jpn","4301","4326","68","","8730","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_328[] = {"8331","Tokyo to WGS 84 (69)","","GSI-Jpn","4301","4326","69","","8731","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_329[] = {"8332","Tokyo to WGS 84 (70)","","GSI-Jpn","4301","4326","70","","8732","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_330[] = {"8333","Tokyo to WGS 84 (71)","","GSI-Jpn","4301","4326","71","","8733","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_331[] = {"8334","Tokyo to WGS 84 (72)","","GSI-Jpn","4301","4326","72","","8734","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_332[] = {"8335","Tokyo to WGS 84 (73)","","GSI-Jpn","4301","4326","73","","8735","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_333[] = {"8336","Tokyo to WGS 84 (74)","","GSI-Jpn","4301","4326","74","","8736","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_334[] = {"8337","Tokyo to WGS 84 (75)","","GSI-Jpn","4301","4326","75","","8737","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_335[] = {"8338","Tokyo to WGS 84 (76)","","GSI-Jpn","4301","4326","76","","8738","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_336[] = {"8339","Tokyo to WGS 84 (77)","","GSI-Jpn","4301","4326","77","","8739","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_337[] = {"8340","Tokyo to WGS 84 (78)","","GSI-Jpn","4301","4326","78","","8740","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_338[] = {"8341","Tokyo to WGS 84 (79)","","GSI-Jpn","4301","4326","79","","8741","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_339[] = {"8342","Tokyo to WGS 84 (80)","","GSI-Jpn","4301","4326","80","","8742","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_340[] = {"8343","Tokyo to WGS 84 (81)","","GSI-Jpn","4301","4326","81","","8743","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_341[] = {"8344","Tokyo to WGS 84 (82)","","GSI-Jpn","4301","4326","82","","8744","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_342[] = {"8345","Tokyo to WGS 84 (83)","","GSI-Jpn","4301","4326","83","","8745","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_343[] = {"8346","Tokyo to WGS 84 (84)","","GSI-Jpn","4301","4326","84","","8746","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_344[] = {"8347","Tokyo to WGS 84 (85)","","GSI-Jpn","4301","4326","85","","8747","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_345[] = {"8348","Tokyo to WGS 84 (86)","","GSI-Jpn","4301","4326","86","","8748","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_346[] = {"8349","Tokyo to WGS 84 (87)","","GSI-Jpn","4301","4326","87","","8749","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_347[] = {"8350","Tokyo to WGS 84 (88)","","GSI-Jpn","4301","4326","88","","8750","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_348[] = {"8351","Tokyo to WGS 84 (89)","","GSI-Jpn","4301","4326","89","","8751","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_349[] = {"8352","Tokyo to WGS 84 (90)","","GSI-Jpn","4301","4326","90","","8752","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_350[] = {"8353","Tokyo to WGS 84 (91)","","GSI-Jpn","4301","4326","91","","8753","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_351[] = {"8354","Tokyo to WGS 84 (92)","","GSI-Jpn","4301","4326","92","","8754","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_352[] = {"8355","Tokyo to WGS 84 (93)","","GSI-Jpn","4301","4326","93","","8755","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_353[] = {"8356","Tokyo to WGS 84 (94)","","GSI-Jpn","4301","4326","94","","8756","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_354[] = {"8357","Tokyo to WGS 84 (95)","","GSI-Jpn","4301","4326","95","","8757","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_355[] = {"8358","Tokyo to WGS 84 (96)","","GSI-Jpn","4301","4326","96","","8758","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_356[] = {"8359","Tokyo to WGS 84 (97)","","GSI-Jpn","4301","4326","97","","8759","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_357[] = {"8360","Tokyo to WGS 84 (98)","","GSI-Jpn","4301","4326","98","","8760","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_358[] = {"8361","Tokyo to WGS 84 (99)","","GSI-Jpn","4301","4326","99","","8761","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_359[] = {"8362","Tokyo to WGS 84 (100)","","GSI-Jpn 324132","4301","4326","100","","8762","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_360[] = {"8363","Tokyo to WGS 84 (101)","","GSI-Jpn 324133","4301","4326","101","","8763","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_361[] = {"8364","Tokyo to WGS 84 (102)","","GSI-Jpn 324134","4301","4326","102","","8764","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_362[] = {"8365","Tokyo to WGS 84 (103)","","GSI-Jpn 320130","4301","4326","103","","8765","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_363[] = {"8366","Tokyo to WGS 84 (104)","","GSI-Jpn 320131","4301","4326","104","","8766","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_364[] = {"8367","Tokyo to WGS 84 (105)","","GSI-Jpn 320132","4301","4326","105","","8767","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_365[] = {"8368","Tokyo to WGS 84 (106)","","GSI-Jpn 312130","4301","4326","106","","8768","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_366[] = {"8369","Tokyo to WGS 84 (107)","","GSI-Jpn 312131","4301","4326","107","","8769","1998-12-14 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_367[] = {"8370","Fahud to WGS 84 (2)","","PDO-Omn","4232","4326","2","","8770","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_368[] = {"8371","PSD93 to WGS 84 (1)","","PDO-Omn","4134","4326","1","","8771","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_369[] = {"8372","ED50 to WGS 84 (19)","","HEL-Grc","4230","4326","19","","8772","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_370[] = {"8373","Antigua 1943 to WGS 84 (1)","","DOS-Atg Ant","4601","4326","1","","8773","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_371[] = {"8374","Dominica 1945 to WGS 84 (1)","","DOS-Dma","4602","4326","1","","8774","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_372[] = {"8375","Grenada 1953 to WGS 84 (1)","","DOS-Grd","4603","4326","1","","8775","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_373[] = {"8376","Montserrat 1958 to WGS 84 (1)","","DOS-Msr","4604","4326","1","","8776","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_374[] = {"8377","St. Kitts 1955 to WGS 84 (1)","","DOS-Kna","4605","4326","1","","8777","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_375[] = {"8378","St. Lucia 1955 to WGS 84 (1)","","DOS-Lca","4606","4326","1","","8778","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_376[] = {"8379","Anguilla 1957 to WGS 84 (1)","","DOS-Aia","4600","4326","1","","8779","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_377[] = {"8380","RT90 to ETRF89 (1)","","NLS-Swe","4124","4258","1","","8780","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_378[] = {"8384","ED50 to WGS 84 (20)","","NMA-Nor 6265W","4230","4326","20","","8784","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_379[] = {"8385","Old Hawaiian to NAD83 (1)","","NGS-Usa Hi","4135","4269","1","","8785","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_380[] = {"8386","Old Hawaiian to WGS 84 (1)","","EPSG-US Hi","4135","4326","1","United States - Hawaii","8786","1999-05-24 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_381[] = {"8387","St. Lawrence Island to NAD83 (1)","","NGS-Usa AK StL","4136","4269","1","","8787","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_382[] = {"8388","St. Lawrence Island to WGS 84 (1)","","EPSG-US StL","4136","4326","1","United States - Alaska - St. Lawrence Island.","8788","1999-05-24 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_383[] = {"8389","St. Paul Island to NAD83 (1)","","NGS-Usa AK StP","4137","4269","1","","8789","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_384[] = {"8390","St. Paul Island to WGS 84 (1)","","EPSG-US StP","4137","4326","1","United States - Alaska - St. Paul Island.","8790","1999-05-24 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_385[] = {"8391","St. George Island to NAD83 (1)","","NGS-Usa AK StG","4138","4269","1","","8791","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_386[] = {"8392","St. George Island to WGS 84 (1)","","EPSG-USA StG","4138","4326","1","United States - Alaska - St. George Island.","8792","1999-05-24 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_387[] = {"8393","NAD27(CGQ77)  to NAD83 (1)","","SGQ-Can QC","4609","4269","1","","8793","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_388[] = {"8394","NAD27(CGQ77) to WGS 84 (1)","","EPSG-Can Qc","4609","4326","1","Canada - Quebec","8794","1999-05-24 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_389[] = {"8395","AGD66 to GDA94 (2)","","Auslig-ACT 1m","4202","4283","2","","8795","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_390[] = {"8396","AGD66 to WGS 84 (3)","","EPSG-Aus ACT 1m","4202","4326","3","Australia - ACT.","8796","1999-05-24 00:00:00","","EPSG","For many purposes GDA94 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_391[] = {"8397","AGD66 to GDA94 (3)","","Auslig-Tas 1m","4202","4283","3","","8797","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_392[] = {"8398","AGD66 to WGS 84 (4)","","EPSG-Aus Tas 1m","4202","4326","4","Australia - Tasmania.","8798","1999-05-24 00:00:00","","EPSG","For many purposes GDA94 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_393[] = {"8399","AGD66 to GDA94 (4)","","Auslig-NSW Vic","4202","4283","4","","8799","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_394[] = {"8400","AGD66 to WGS 84 (5)","","EPSG-Aus NSW Vic 1m","4202","4326","5","Australia - New South Wales (NSW) and Victoria.","8800","1999-05-24 00:00:00","","EPSG","For many purposes GDA94 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_395[] = {"8401","Puerto Rico to NAD83 (1)","","NGS-PRVI","4139","4269","1","","8801","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_396[] = {"8402","Puerto Rico to WGS 84 (1)","","EPSG-PRVI","4139","4326","1","Puerto Rico; Virgin Islands (U.S.); Virgin Islands (British).","8802","1999-05-24 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_397[] = {"8403","NAD27 to NAD83 (5)","","SGQ-Can QC","4267","4269","5","","8803","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_398[] = {"8404","NAD27 to WGS 84 (27)","","EPSG-Can QC","4267","4326","27","Canada - Quebec","8804","1999-05-24 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_399[] = {"8405","NAD27(76) to NAD83 (1)","","SGQ-Can Ont","4608","4269","1","","8805","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_400[] = {"8406","NAD27(76) to WGS 84 (1)","","EPSG-Can On","4608","4326","1","Canada - Ontario","8806","1999-05-24 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_401[] = {"8407","AGD66 to GDA94 (5)","","OSG-Aus Vic","4202","4283","5","","8807","1999-05-24 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_402[] = {"8408","AGD66 to WGS 84 (6)","","EPSG-Aus Vic 0.1m","4202","4326","6","Australia - Victoria","8808","1999-05-24 00:00:00","","EPSG","For many purposes GDA94 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_403[] = {"8411","NGO 1948 (Oslo) to NGO 1948 (1)","","NGO-Nor","4817","4273","1","","8811","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_404[] = {"8412","NTF (Paris) to NTF (2)","","RGS","4807","4275","2","","8812","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_405[] = {"8413","Locodjo 1965 to WGS 84 (1)","","IGN-Civ","4142","4326","1","","8813","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_406[] = {"8414","Abidjan 1987 to WGS 84 (1)","","IGN-Civ","4143","4326","1","","8814","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_407[] = {"8415","MGI to WGS 84 (2)","","BEV-Aut","4312","4326","1","","8815","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_408[] = {"8416","ATS 77 to NAD83(CSRS98) (1)","","GIC-Can NB","4122","4140","1","","8816","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_409[] = {"8417","NAD83(CSRS98) to WGS 84 (1)","","EPSG-Can","4140","4326","1","","8817","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_410[] = {"8418","ATS 77 to WGS 84 (1)","","EPSG-Can NB","4122","4326","1","Canada - New Brunswick","8818","1999-10-20 00:00:00","EPSG","EPSG","For many purposes NAD83(CSRS) can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_411[] = {"8419","NAD83 to NAD83(HARN) (1)","","NGS-Usa AL","4269","4152","1","","8819","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_412[] = {"8420","NAD83 to NAD83(HARN) (2)","","NGS-Usa AZ","4269","4152","2","","8820","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_413[] = {"8421","NAD83 to NAD83(HARN) (3)","","NGS-Usa CA n","4269","4152","3","","8821","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_414[] = {"8422","NAD83 to NAD83(HARN) (4)","","NGS-Usa CA s","4269","4152","4","","8822","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_415[] = {"8423","NAD83 to NAD83(HARN) (5)","","NGS-Usa CO","4269","4152","5","","8823","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_416[] = {"8424","NAD83 to NAD83(HARN) (6)","","NGS-Usa GA","4269","4152","6","","8824","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_417[] = {"8425","NAD83 to NAD83(HARN) (7)","","NGS-Usa FL","4269","4152","7","","8825","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_418[] = {"8426","NAD83 to NAD83(HARN) (8)","","NGS-Usa ID MT e","4269","4152","8","","8826","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_419[] = {"8427","NAD83 to NAD83(HARN) (9)","","NGS-Usa ID MT w","4269","4152","9","","8827","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_420[] = {"8428","NAD83 to NAD83(HARN) (10)","","NGS-Usa KY","4269","4152","10","","8828","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_421[] = {"8429","NAD83 to NAD83(HARN) (11)","","NGS-Usa LA","4269","4152","11","","8829","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_422[] = {"8430","NAD83 to NAD83(HARN) (12)","","NGS-Usa DE MD","4269","4152","12","","8830","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_423[] = {"8431","NAD83 to NAD83(HARN) (13)","","NGS-Usa ME","4269","4152","13","","8831","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_424[] = {"8432","NAD83 to NAD83(HARN) (14)","","NGS-Usa MI","4269","4152","14","","8832","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_425[] = {"8433","NAD83 to NAD83(HARN) (15)","","NGS-Usa MS","4269","4152","15","","8833","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_426[] = {"8434","NAD83 to NAD83(HARN) (16)","","NGS-Usa NE","4269","4152","16","","8834","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_427[] = {"8435","NAD83 to NAD83(HARN) (17)","","NGS-US NewEng","4269","4152","17","","8835","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_428[] = {"8436","NAD83 to NAD83(HARN) (18)","","NGS-Usa NM","4269","4152","18","","8836","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_429[] = {"8437","NAD83 to NAD83(HARN) (19)","","NGS-Usa NY","4269","4152","19","","8837","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_430[] = {"8438","NAD83 to NAD83(HARN) (20)","","NGS-Usa ND","4269","4152","20","","8838","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_431[] = {"8439","NAD83 to NAD83(HARN) (21)","","NGS-Usa OK","4269","4152","21","","8839","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_432[] = {"8440","NAD83 to NAD83(HARN) (22)","","NGS-PRVI","4269","4152","22","","8840","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_433[] = {"8441","NAD83 to NAD83(HARN) (23)","","NGS-Usa SD","4269","4152","23","","8841","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_434[] = {"8442","NAD83 to NAD83(HARN) (24)","","NGS-Usa TN","4269","4152","24","","8842","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_435[] = {"8443","NAD83 to NAD83(HARN) (25)","","NGS-Usa TX e","4269","4152","25","","8843","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_436[] = {"8444","NAD83 to NAD83(HARN) (26)","","NGS-Usa TX w","4269","4152","26","","8844","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_437[] = {"8445","NAD83 to NAD83(HARN) (27)","","NGS-Usa VA","4269","4152","27","","8845","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_438[] = {"8446","NAD83 to NAD83(HARN) (28)","","NGS-Usa OR WA","4269","4152","28","","8846","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_439[] = {"8447","NAD83 to NAD83(HARN) (29)","","NGS-Usa WI","4269","4152","29","","8847","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_440[] = {"8448","NAD83 to NAD83(HARN) (30)","","NGS-Usa WY","4269","4152","30","","8848","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_441[] = {"8449","Cape to Hartbeesthoek94 (1)","","DSM-Zaf","4222","4148","1","","8849","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_442[] = {"8450","Hartbeesthoek94 to WGS 84 (1)","","EPSG-Zaf","4148","4326","1","","8850","1999-10-20 00:00:00","","EPSG","For many purposes Hartbeesthoek94 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_443[] = {"8451","AGD66 to GDA94 (6)","","Auslig-Tas","4202","4283","6","","8851","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_444[] = {"8452","AGD66 to GDA94 (7)","","Auslig-NT","4202","4283","7","","8852","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_445[] = {"8453","AGD66 to WGS 84 (7)","","EPSG-Aus Tas 0.1m","4202","4326","7","Australia - Tasmania.","8853","1999-10-20 00:00:00","","EPSG","For many purposes GDA94 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_446[] = {"8454","AGD66 to WGS 84 (8)","","EPSG-Aus NT 0.1m","4202","4326","8","Australia - Northern Territory.","8854","1999-10-20 00:00:00","","EPSG","For many purposes GDA94 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_447[] = {"8455","CH1903 to WGS 84 (1)","","BfL-CH 1","4149","4326","1","","8855","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_448[] = {"8456","CH1903+ to CHTRF95 (1)","","BfL-CH","4150","4151","1","","8856","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_449[] = {"8457","CH1903+ to WGS 84 (1)","","EPSG-CH","4150","4326","1","Liechtenstein;  Switzerland.","8857","1999-10-20 00:00:00","EPSG","EPSG","For many purposes CHTRF95 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_450[] = {"8458","CH1903 to WGS 84 (2)","","BfL-CH 2","4149","4326","2","","8858","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_451[] = {"8459","CHTRF95 to WGS 84 (1)","","EPSG-CH","4151","4326","1","","8859","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_452[] = {"8460","NAD27 to NAD83(HARN) (1)","","NGS-Usa AL","4267","4152","1","United States (USA) - Alabama.","8860","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_453[] = {"8461","NAD27 to NAD83(HARN) (2)","","NGS-Usa AZ","4267","4152","2","United States (USA) - Arizona.","8861","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_454[] = {"8462","NAD27 to NAD83(HARN) (3)","","NGS-Usa CA n","4267","4152","3","United States (USA) - California north of 38 deg N.","8862","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_455[] = {"8463","NAD27 to NAD83(HARN) (4)","","NGS-Usa CA s","4267","4152","4","United States (USA) - California south of 38 deg N.","8863","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_456[] = {"8464","NAD27 to NAD83(HARN) (5)","","NGS-Usa CO","4267","4152","5","United States (USA) - Colorado.","8864","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_457[] = {"8465","NAD27 to NAD83(HARN) (6)","","NGS-Usa GA","4267","4152","6","United States (USA) - Georgia.","8865","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_458[] = {"8466","NAD27 to NAD83(HARN) (7)","","NGS-Usa FL","4267","4152","7","United States (USA) - Florida.","8866","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_459[] = {"8467","NAD27 to NAD83(HARN) (8)","","NGS-Usa ID MT e","4267","4152","8","United States (USA) - Idaho and Montana - east of 113 deg W.","8867","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_460[] = {"8468","NAD27 to NAD83(HARN) (9)","","NGS-Usa ID MT w","4267","4152","9","United States (USA) - Idaho and Montana - west of 113 deg W.","8868","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_461[] = {"8469","NAD27 to NAD83(HARN) (10)","","NGS-Usa KY","4267","4152","10","United States (USA) - Kentucky.","8869","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_462[] = {"8470","NAD27 to NAD83(HARN) (11)","","NGS-Usa LA","4267","4152","11","United States (USA) - Louisiana.","8870","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_463[] = {"8471","NAD27 to NAD83(HARN) (12)","","NGS-Usa DE MD","4267","4152","12","United States (USA) - Delaware and Maryland.","8871","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_464[] = {"8472","NAD27 to NAD83(HARN) (13)","","NGS-Usa ME","4267","4152","13","United States (USA) - Maine.","8872","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_465[] = {"8473","NAD27 to NAD83(HARN) (14)","","NGS-Usa MI","4267","4152","14","United States (USA) - Michigan.","8873","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_466[] = {"8474","NAD27 to NAD83(HARN) (15)","","NGS-Usa MS","4267","4152","15","United States (USA) - Mississippi.","8874","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_467[] = {"8475","NAD27 to NAD83(HARN) (16)","","NGS-Usa NE","4267","4152","16","United States (USA) - Nebraska.","8875","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_468[] = {"8476","NAD27 to NAD83(HARN) (17)","","NGS-US NewEng","4267","4152","18","United States (USA) - Connecticut; Massachusetts; New Hampshire; Rhode Island; Vermont.","8876","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_469[] = {"8477","NAD27 to NAD83(HARN) (18)","","NGS-Usa NM","4267","4152","18","United States (USA) - New Mexico.","8877","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_470[] = {"8478","NAD27 to NAD83(HARN) (19)","","NGS-Usa NY","4267","4152","19","United States (USA) - New York.","8878","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_471[] = {"8479","NAD27 to NAD83(HARN) (20)","","NGS-Usa ND","4267","4152","20","United States (USA) - North Dakota.","8879","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_472[] = {"8480","NAD27 to NAD83(HARN) (21)","","NGS-Usa OK","4267","4152","21","United States (USA) - Oklahoma.","8880","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_473[] = {"8481","Puerto Rico to NAD83(HARN) (1)","","NGS-PRVI","4139","4152","1","United States (USA) - Puerto Rico and the Virgin Islands.","8881","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_474[] = {"8482","NAD27 to NAD83(HARN) (22)","","NGS-Usa SD","4267","4152","22","United States (USA) - South Dakota.","8882","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_475[] = {"8483","NAD27 to NAD83(HARN) (23)","","NGS-Usa TN","4267","4152","23","United States (USA) - Tennessee","8883","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_476[] = {"8484","NAD27 to NAD83(HARN) (24)","","NGS-Usa TX e","4267","4152","24","United States (USA) - Texas east of 100deg West.","8884","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_477[] = {"8485","NAD27 to NAD83(HARN) (25)","","NGS-Usa TX w","4267","4152","25","United States (USA) - Texas west of 100deg West.","8885","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_478[] = {"8486","NAD27 to NAD83(HARN) (26)","","NGS-Usa VA","4267","4152","26","United States (USA) - Virginia.","8886","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_479[] = {"8487","NAD27 to NAD83(HARN) (27)","","NGS-Usa OR WA","4267","4152","27","United States (USA) - Oregan; Washington.","8887","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_480[] = {"8488","NAD27 to NAD83(HARN) (28)","","NGS-Usa WI","4267","4152","28","United States (USA) - Wisconsin.","8888","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_481[] = {"8489","NAD27 to NAD83(HARN) (29)","","NGS-Usa WY","4267","4152","29","United States (USA) - Wyoming.","8889","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_482[] = {"8490","Rassadiran to WGS 84 (1)","","TOT-Taheri","4153","4326","1","Iran - Taheri refinery site.","8890","1999-10-20 00:00:00","Total-Fina","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_483[] = {"8491","FD58 to WGS 84 (1)","","TOT-Kangan","4132","4326","1","Iran - Kangan district","8891","1999-10-20 00:00:00","Total-Fina","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_484[] = {"8492","ED50(ED77) to WGS 84 (1)","","NCCI-Irn","4154","4326","1","Iran","8892","1999-10-20 00:00:00","National Cartographic Centre of Iran","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_485[] = {"8493","NAD83 to WGS 84 (4)","","NGS-Usa","4269","4326","4","United States (USA).","8893","1999-11-05 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_486[] = {"8494","NAD83 to WGS 84 (5)","","NGS-Usa","4269","4326","5","United States (USA).","8894","1999-11-05 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_487[] = {"8495","La Canoa to WGS 84 (1)","","LAG-Ven E","4247","4326","1","","8895","1999-11-05 00:00:00","","EPSG","","",NULL};
+datafile_rows_t geod_trf_row_488[] = {"8496","NAD27 to WGS 84 (28)","","NGS-Usa conus","4267","4326","28","United States (USA) - lower 48 states including EEZ.","8896","1999-10-20 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+datafile_rows_t geod_trf_row_489[] = {"8497","NAD27 to WGS 84 (29)","","NGS-Usa AK","4267","4326","29","United States (USA) - Alaska including EEZ.","8897","1999-10-20 00:00:00","","EPSG","For many purposes NAD83 can be assumed to be coincident with WGS 84.","",NULL};
+
+datafile_rows_t *geod_trf_rows[] = {geod_trf_row_1,geod_trf_row_2,geod_trf_row_3,geod_trf_row_4,geod_trf_row_5,geod_trf_row_6,geod_trf_row_7,geod_trf_row_8,geod_trf_row_9,geod_trf_row_10,geod_trf_row_11,geod_trf_row_12,geod_trf_row_13,geod_trf_row_14,geod_trf_row_15,geod_trf_row_16,geod_trf_row_17,geod_trf_row_18,geod_trf_row_19,geod_trf_row_20,geod_trf_row_21,geod_trf_row_22,geod_trf_row_23,geod_trf_row_24,geod_trf_row_25,geod_trf_row_26,geod_trf_row_27,geod_trf_row_28,geod_trf_row_29,g [...]
diff --git a/src/tiff/csv/geod_trf.csv b/src/tiff/csv/geod_trf.csv
new file mode 100644
index 0000000..c54365a
--- /dev/null
+++ b/src/tiff/csv/geod_trf.csv
@@ -0,0 +1,489 @@
+"GEOD_TRF_CODE","GEOD_TRF_EPSG_NAME","GEOD_TRF_USER_NAME","DESCRIPTION","SOURCE_HORIZCS_CODE","TARGET_HORIZCS_CODE","COORD_TRF_VARIANT","CONCAT_TRF_AREA_OF_USE","COORD_TRF_PATH_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","CONCAT_TRF_REMARKS","CHANGE_ID"
+8000,Adindan to WGS 84 (1),,DMA-Eth Sud,4201,4326,1,,8400,1996-10-18 00:00:00,,EPSG,,
+8001,Adindan to WGS 84 (2),,DMA-Bfa,4201,4326,2,,8401,1996-10-18 00:00:00,,EPSG,,
+8002,Adindan to WGS 84 (3),,DMA-Cmr,4201,4326,3,,8402,1996-10-18 00:00:00,,EPSG,,
+8003,Adindan to WGS 84 (4),,DMA-Eth,4201,4326,4,,8403,1996-10-18 00:00:00,,EPSG,,
+8004,Adindan to WGS 84 (5),,DMA-Mli,4201,4326,5,,8404,1996-10-18 00:00:00,,EPSG,,
+8005,Adindan to WGS 84 (6),,DMA-Sen,4201,4326,6,,8405,1996-10-18 00:00:00,,EPSG,,
+8006,Adindan to WGS 84 (7),,DMA-Sud,4201,4326,7,,8406,1996-10-18 00:00:00,,EPSG,,
+8007,Afgooye to WGS 84 (1),,DMA-Som,4205,4326,1,,8407,1996-10-18 00:00:00,,EPSG,,
+8008,AGD66 to WGS 84 (1),,DMA-Aus,4202,4326,1,,8408,1996-10-18 00:00:00,,EPSG,,
+8009,AGD84 to WGS 84 (1),,DMA-Aus,4203,4326,1,,8409,1996-10-18 00:00:00,,EPSG,,
+8010,Ain el Abd to WGS 84 (1),,DMA-Bhr,4204,4326,1,,8410,1996-10-18 00:00:00,,EPSG,,
+8011,Ain el Abd to WGS 84 (2),,DMA-Sau,4204,4326,2,,8411,1996-10-18 00:00:00,,EPSG,,
+8012,Amersfoort to WGS 84 (1),,NCG-Nld,4289,4326,1,,8412,1996-10-18 00:00:00,,EPSG,,
+8013,Arc 1950 to WGS 84 (1),,DMA-mean,4209,4326,1,,8413,1996-10-18 00:00:00,,EPSG,,
+8014,Arc 1950 to WGS 84 (2),,DMA-Bwa,4209,4326,2,,8414,1996-10-18 00:00:00,,EPSG,,
+8015,Arc 1950 to WGS 84 (3),,DMA-Bdi,4209,4326,3,,8415,1996-10-18 00:00:00,,EPSG,,
+8016,Arc 1950 to WGS 84 (4),,DMA-Lso,4209,4326,4,,8416,1996-10-18 00:00:00,,EPSG,,
+8017,Arc 1950 to WGS 84 (5),,DMA-Mwi,4209,4326,5,,8417,1996-10-18 00:00:00,,EPSG,,
+8018,Arc 1950 to WGS 84 (6),,DMA-Swz,4209,4326,6,,8418,1996-10-18 00:00:00,,EPSG,,
+8019,Arc 1950 to WGS 84 (7),,DMA-Cod,4209,4326,7,,8419,1996-10-18 00:00:00,,EPSG,,
+8020,Arc 1950 to WGS 84 (8),,DMA-Zmb,4209,4326,8,,8420,1996-10-18 00:00:00,,EPSG,,
+8021,Arc 1950 to WGS 84 (9),,DMA-Zwe,4209,4326,9,,8421,1996-10-18 00:00:00,,EPSG,,
+8022,Arc 1960 to WGS 84 (1),,DMA-Ken Tza,4210,4326,1,,8422,1996-10-18 00:00:00,,EPSG,,
+8023,Batavia to WGS 84 (1),,DMA-Idn Sumatra,4211,4326,1,,8423,1996-10-18 00:00:00,,EPSG,,
+8024,Bermuda 1957 to WGS 84 (1),,DMA-Bmu,4216,4326,1,,8424,1996-10-18 00:00:00,,EPSG,,
+8025,Bogota to WGS 84 (1),,DMA-Col,4218,4326,1,,8425,1996-10-18 00:00:00,,EPSG,,
+8026,Bukit Rimpah to WGS 84 (1),,DMA-Idn Beli,4219,4326,1,,8426,1996-10-18 00:00:00,,EPSG,,
+8027,Campo Inchauspe to WGS 84 (1),,DMA-Arg,4221,4326,1,,8427,1996-10-18 00:00:00,,EPSG,,
+8028,Cape to WGS 84 (1),,DMA-Zaf,4222,4326,1,,8428,1996-10-18 00:00:00,,EPSG,,
+8029,Cape to WGS 84 (2),,DSLI-Zaf,4222,4326,2,,8429,1996-10-18 00:00:00,,EPSG,,
+8030,Carthage to WGS 84 (1),,DMA-Tun,4223,4326,1,,8430,1996-10-18 00:00:00,,EPSG,,
+8031,Chua to WGS 84 (1),,DMA-Pry,4224,4326,1,,8431,1996-10-18 00:00:00,,EPSG,,
+8032,Corrego Alegre to WGS 84 (1),,DMA-Bra,4225,4326,1,,8432,1996-10-18 00:00:00,,EPSG,,
+8033,ED50 to WGS 84 (1),,DMA-mean,4230,4326,1,,8433,1996-10-18 00:00:00,,EPSG,,
+8034,ED50 to WGS 84 (2),,DMA-cenEur,4230,4326,2,,8434,1996-10-18 00:00:00,,EPSG,,
+8035,ED50 to WGS 84 (3),,DMA-midEast,4230,4326,3,,8435,1996-10-18 00:00:00,,EPSG,,
+8036,ED50 to WGS 84 (4),,DMA-Cyp,4230,4326,4,,8436,1996-10-18 00:00:00,,EPSG,,
+8037,ED50 to WGS 84 (5),,DMA-Egy,4230,4326,5,,8437,1996-10-18 00:00:00,,EPSG,,
+8038,ED50 to WGS 84 (6),,DMA-Irl Gbr,4230,4326,6,,8438,1996-10-18 00:00:00,,EPSG,,
+8039,ED50 to WGS 84 (7),,DMA-Fin Nor,4230,4326,7,,8439,1996-10-18 00:00:00,,EPSG,,
+8040,ED50 to WGS 84 (8),,DMA-Grc,4230,4326,8,,8440,1996-10-18 00:00:00,,EPSG,,
+8041,ED50 to WGS 84 (9),,DMA-Irn,4230,4326,9,,8441,1996-10-18 00:00:00,,EPSG,,
+8042,ED50 to WGS 84 (10),,DMA-Ita Sard,4230,4326,10,,8442,1996-10-18 00:00:00,,EPSG,,
+8043,ED50 to WGS 84 (11),,DMA-Ita Sic,4230,4326,11,,8443,1996-10-18 00:00:00,,EPSG,,
+8044,ED50 to WGS 84 (12),,DMA-Mlt,4230,4326,12,,8444,1996-10-18 00:00:00,,EPSG,,
+8045,ED50 to WGS 84 (13),,DMA-Prt Esp,4230,4326,13,,8445,1996-10-18 00:00:00,,EPSG,,
+8046,ED50 to WGS 84 (14),,6Nat-NSea,4230,4326,14,Denmark - North Sea;  Germany - North Sea;  Netherlands - offshore;  Norway - North Sea south of 62 deg N; United Kingdom (UKCS) - North Sea south of 62 deg N.,8446,1996-10-18 00:00:00,,EPSG,,
+8047,ED50 to WGS 84 (15),,NMA-Nor N65,4230,4326,15,Norway - offshore north of 65 deg N.,8447,1996-10-18 00:00:00,,EPSG,The concatenation of transformations 1147 and 1146 gives the following position vector tfm: dX=-84.491  dY=-100.559  dZ=-114.209 metres rX= -2.4006  rY=-0.5367  rZ=-2.3742 microradians  dS=+0.2947 ppm.,
+8048,Egypt 1907 to WGS 84 (1),,DMA-Egy,4229,4326,1,,8448,1996-10-18 00:00:00,,EPSG,,
+8049,ETRF89 to WGS 84 (1),,EPSG-eur,4258,4326,1,,8449,1997-06-19 00:00:00,,EPSG,,97.24
+8050,GDA94 to WGS 84 (1),,EPSG-Aus,4283,4326,1,,8450,1996-10-18 00:00:00,,EPSG,,
+8051,GD49 to WGS 84 (1),,DMA-Nzl,4272,4326,1,,8451,1996-10-18 00:00:00,,EPSG,,
+8052,Hu Tzu Shan to WGS 84 (1),,DMA-Twn,4236,4326,1,,8452,1996-10-18 00:00:00,,EPSG,,
+8053,Indian 1954 to WGS 84 (1),,DMA-Tha,4239,4326,1,,8453,1996-10-18 00:00:00,,EPSG,,
+8054,Indian 1975 to WGS 84 (1),,DMA-Tha,4240,4326,1,,8454,1996-10-18 00:00:00,,EPSG,,
+8055,Kalianpur 1937 to WGS 84 (1),,DMA-Bgd,4144,4326,1,,8455,1999-10-20 00:00:00,,EPSG,,97.235
+8056,Kalianpur 1975 to WGS 84 (1),,DMA-Ind Npl,4146,4326,1,,8456,1999-10-20 00:00:00,,EPSG,,97.235
+8057,Kandawala to WGS 84 (1),,DMA-Lka,4244,4326,1,,8457,1996-10-18 00:00:00,,EPSG,,
+8058,Kertau to WGS 84 (1),,DMA-Mys Sgp,4245,4326,1,,8458,1996-10-18 00:00:00,,EPSG,,
+8059,Leigon to WGS 84 (1),,DMA-Gha,4250,4326,1,,8459,1996-10-18 00:00:00,,EPSG,,
+8060,Liberia 1964 to WGS 84 (1),,DMA-Lbr,4251,4326,1,,8460,1996-10-18 00:00:00,,EPSG,,
+8061,Luzon 1911 to WGS 84 (1),,DMA-Phl N,4253,4326,1,,8461,1996-10-18 00:00:00,,EPSG,,
+8062,Luzon 1911 to WGS 84 (2),,DMA-Phl Min,4253,4326,2,,8462,1996-10-18 00:00:00,,EPSG,,
+8063,M'poraloko to WGS 84 (1),,DMA-Gab,4266,4326,1,,8463,1996-10-18 00:00:00,,EPSG,,
+8064,Mahe 1971 to WGS 84 (1),,DMA-Syc,4256,4326,1,,8464,1996-10-18 00:00:00,,EPSG,,
+8065,Massawa to WGS 84 (1),,DMA-Eth,4262,4326,1,,8465,1996-10-18 00:00:00,,EPSG,,
+8066,Merchich to WGS 84 (1),,DMA-Mar,4261,4326,1,,8466,1996-10-18 00:00:00,,EPSG,,
+8067,Minna to WGS 84 (1),,DMA-Cmr,4263,4326,1,,8467,1996-10-18 00:00:00,,EPSG,,
+8068,Minna to WGS 84 (2),,DMA-Nga,4263,4326,2,,8468,1996-10-18 00:00:00,,EPSG,,
+8069,Monte Mario to WGS 84 (1),,DMA-Ita Sar,4265,4326,1,,8469,1996-10-18 00:00:00,,EPSG,,
+8070,NAD27 to WGS 84 (1),,DMA-Carib,4267,4326,1,,8470,1996-10-18 00:00:00,,EPSG,,
+8071,NAD27 to WGS 84 (2),,DMA-Cen Am,4267,4326,2,,8471,1996-10-18 00:00:00,,EPSG,,
+8072,NAD27 to WGS 84 (3),,DMA-Can,4267,4326,3,,8472,1996-10-18 00:00:00,,EPSG,,
+8073,NAD27 to WGS 84 (4),,DMA-Conus,4267,4326,4,,8473,1996-10-18 00:00:00,,EPSG,,
+8074,NAD27 to WGS 84 (5),,DMA-ConusE,4267,4326,5,,8474,1996-10-18 00:00:00,,EPSG,,
+8075,NAD27 to WGS 84 (6),,DMA-ConusW,4267,4326,6,,8475,1996-10-18 00:00:00,,EPSG,,
+8076,NAD27 to WGS 84 (7),,DMA-USA AK,4267,4326,7,,8476,1996-10-18 00:00:00,,EPSG,,
+8077,NAD27 to WGS 84 (8),,DMA-Bha xSalv,4267,4326,8,,8477,1996-10-18 00:00:00,,EPSG,,
+8078,NAD27 to WGS 84 (9),,DMA-Bha Salv,4267,4326,9,,8478,1996-10-18 00:00:00,,EPSG,,
+8079,NAD27 to WGS 84 (10),,DMA-Can AB BC,4267,4326,10,,8479,1996-10-18 00:00:00,,EPSG,,
+8080,NAD27 to WGS 84 (11),,DMA-Can MN ON,4267,4326,11,,8480,1996-10-18 00:00:00,,EPSG,,
+8081,NAD27 to WGS 84 (12),,DMA-Can E,4267,4326,12,,8481,1996-10-18 00:00:00,,EPSG,,
+8082,NAD27 to WGS 84 (13),,DMA-Can NWT,4267,4326,13,,8482,1996-10-18 00:00:00,,EPSG,,
+8083,NAD27 to WGS 84 (14),,DMA-Can Yuk,4267,4326,14,,8483,1996-10-18 00:00:00,,EPSG,,
+8084,NAD27 to WGS 84 (15),,DMA-Pan,4267,4326,15,,8484,1996-10-18 00:00:00,,EPSG,,
+8085,NAD27 to WGS 84 (16),,DMA-Cuba,4267,4326,16,,8485,1996-10-18 00:00:00,,EPSG,,
+8086,NAD27 to WGS 84 (17),,DMA-Grl,4267,4326,17,,8486,1996-10-18 00:00:00,,EPSG,,
+8087,NAD27 to WGS 84 (18),,DMA-Mex,4267,4326,18,,8487,1996-10-18 00:00:00,,EPSG,,
+8088,NAD83 to WGS 84 (1),,DMA-N Am,4269,4326,1,,8488,1996-10-18 00:00:00,,EPSG,,
+8089,Nahrwan 1967 to WGS 84 (1),,DMA-Omn Mas,4270,4326,1,,8489,1996-10-18 00:00:00,,EPSG,,
+8090,Nahrwan 1967 to WGS 84 (2),,DMA-Sau,4270,4326,2,,8490,1996-10-18 00:00:00,,EPSG,,
+8091,Nahrwan 1967 to WGS 84 (3),,DMA-UAE,4270,4326,3,,8491,1996-10-18 00:00:00,,EPSG,,
+8092,Naparima 1972 to WGS 84 (1),,DMA-Tto,4271,4326,1,,8492,1998-06-30 00:00:00,,EPSG,,98.102
+8093,NTF to WGS 84 (1),,IGN-Fra,4275,4326,1,,8493,1996-10-18 00:00:00,,EPSG,,
+8094,NTF (Paris) to WGS 84 (1),,EPSG-Fra,4807,4326,1,France..,8494,1996-10-18 00:00:00,,EPSG,,
+8095,OSGB 1936 to WGS 84 (1),,DMA-Gbr,4277,4326,1,,8495,1996-10-18 00:00:00,,EPSG,,
+8096,OSGB 1936 to WGS 84 (2),,DMA-Gbr Eng,4277,4326,2,,8496,1996-10-18 00:00:00,,EPSG,,
+8097,OSGB 1936 to WGS 84 (3),,DMA-Gbr E&W,4277,4326,3,,8497,1996-10-18 00:00:00,,EPSG,,
+8098,OSGB 1936 to WGS 84 (4),,DMA-Gbr Sco,4277,4326,4,,8498,1996-10-18 00:00:00,,EPSG,,
+8099,OSGB 1936 to WGS 84 (5),,DMA-Gbr Wal,4277,4326,5,,8499,1996-10-18 00:00:00,,EPSG,,
+8100,Pointe Noire to WGS 84 (1),,DMA-Cog,4282,4326,1,,8500,1996-10-18 00:00:00,,EPSG,,
+8101,PSAD56 to WGS 84 (1),,DMA-mean,4248,4326,1,,8501,1996-10-18 00:00:00,,EPSG,,
+8102,PSAD56 to WGS 84 (2),,DMA-Bol,4248,4326,2,,8502,1996-10-18 00:00:00,,EPSG,,
+8103,PSAD56 to WGS 84 (3),,DMA-Chl N,4248,4326,3,,8503,1996-10-18 00:00:00,,EPSG,,
+8104,PSAD56 to WGS 84 (4),,DMA Chl S,4248,4326,4,,8504,1996-10-18 00:00:00,,EPSG,,
+8105,PSAD56 to WGS 84 (5),,DMA-Col,4248,4326,5,,8505,1996-10-18 00:00:00,,EPSG,,
+8106,PSAD56 to WGS 84 (6),,DMA-Ecu,4248,4326,6,,8506,1996-10-18 00:00:00,,EPSG,,
+8107,PSAD56 to WGS 84 (7),,DMA-Guy,4248,4326,7,,8507,1996-10-18 00:00:00,,EPSG,,
+8108,PSAD56 to WGS 84 (8),,DMA-Per,4248,4326,8,,8508,1996-10-18 00:00:00,,EPSG,,
+8109,PSAD56 to WGS 84 (9),,DMA-Ven,4248,4326,9,,8509,1996-10-18 00:00:00,,EPSG,,
+8110,Qatar to WGS 84 (1),,DMA-Qat,4285,4326,1,,8510,1996-10-18 00:00:00,,EPSG,,
+8111,Qornoq to WGS 84 (1),,DMA-Grl S,4287,4326,1,,8511,1996-10-18 00:00:00,,EPSG,,
+8112,SAD69 to WGS 84 (1),,DMA-mean,4291,4326,1,,8512,1996-10-18 00:00:00,,EPSG,,
+8113,SAD69 to WGS 84 (2),,DMA-Arg,4291,4326,2,,8513,1996-10-18 00:00:00,,EPSG,,
+8114,SAD69 to WGS 84 (3),,DMA-Bol,4291,4326,3,,8514,1996-10-18 00:00:00,,EPSG,,
+8115,SAD69 to WGS 84 (4),,DMA-Bra,4291,4326,4,,8515,1996-10-18 00:00:00,,EPSG,,
+8116,SAD69 to WGS 84 (5),,DMA-Chile,4291,4326,5,,8516,1996-10-18 00:00:00,,EPSG,,
+8117,SAD69 to WGS 84 (6),,DMA-Col,4291,4326,6,,8517,1996-10-18 00:00:00,,EPSG,,
+8118,SAD69 to WGS 84 (7),,DMA-Ecu,4291,4326,7,,8518,1996-10-18 00:00:00,,EPSG,,
+8119,SAD69 to WGS 84 (8),,DMA-Ecu Gal,4291,4326,8,,8519,1996-10-18 00:00:00,,EPSG,,
+8120,SAD69 to WGS 84 (9),,DMA-Guyana,4291,4326,9,,8520,1996-10-18 00:00:00,,EPSG,,
+8121,SAD69 to WGS 84 (10),,DMA-Pgy,4291,4326,10,,8521,1996-10-18 00:00:00,,EPSG,,
+8122,SAD69 to WGS 84 (11),,DMA-Peru,4291,4326,11,,8522,1996-10-18 00:00:00,,EPSG,,
+8123,SAD69 to WGS 84 (12),,DMA-Tto,4291,4326,12,,8523,1996-10-18 00:00:00,,EPSG,,
+8124,SAD69 to WGS 84 (13),,DMA-Ven,4291,4326,13,,8524,1996-10-18 00:00:00,,EPSG,,
+8125,Sapper Hill 1943 to WGS 84 (1),,DMA-Flk E,4292,4326,1,,8525,1996-10-18 00:00:00,,EPSG,,
+8126,Schwarzeck to WGS 84 (1),,DMA-Nam,4293,4326,1,,8526,1996-10-18 00:00:00,,EPSG,,
+8127,Tananarive to WGS 84 (1),,DMA-Mdg,4297,4326,1,,8527,1996-10-18 00:00:00,,EPSG,,
+8128,Timbalai 1948 to WGS 84 (1),,DMA-Borneo,4298,4326,1,,8528,1996-10-18 00:00:00,,EPSG,,
+8129,TM65 to WGS 84 (1),,DMA-Ire,4299,4326,1,,8529,1996-10-18 00:00:00,,EPSG,,
+8130,Tokyo to WGS 84 (1),,DMA-Jpn Kor,4301,4326,1,,8530,1996-10-18 00:00:00,,EPSG,,
+8131,Tokyo to WGS 84 (2),,DMA-Jpn,4301,4326,2,,8531,1996-10-18 00:00:00,,EPSG,,
+8132,Tokyo to WGS 84 (3),,DMA-Kor,4301,4326,3,,8532,1996-10-18 00:00:00,,EPSG,,
+8133,Tokyo to WGS 84 (4),,DMA-Jpn Ok,4301,4326,4,,8533,1996-10-18 00:00:00,,EPSG,,
+8134,Yacare to WGS 84 (1),,DMA-Ury,4309,4326,1,,8534,1996-10-18 00:00:00,,EPSG,,
+8135,Zanderij to WGS 84 (1),,DMA-Sur,4311,4326,1,,8535,1996-10-18 00:00:00,,EPSG,,
+8136,ED50 to ED87 (1),,6Nat-NSea,4230,4231,1,,8536,1996-10-18 00:00:00,,EPSG,,
+8137,ED87 to WGS 84 (1),,6Nat-NSea,4231,4326,1,,8537,1996-10-18 00:00:00,,EPSG,,
+8138,ED50 to ED87 (2),,NMA-Nor N65,4230,4231,2,,8538,1996-10-18 00:00:00,,EPSG,,
+8139,AGD84 to WGS 84 (2),,Auslig-Aus old,4203,4326,2,,8539,1996-12-12 00:00:00,,EPSG,,
+8140,WGS 72 to WGS 84 (1),,DMA,4322,4326,1,,8540,1996-12-12 00:00:00,,EPSG,,
+8141,WGS 72 to WGS 84 (2),,,4322,4326,2,,8541,1996-12-12 00:00:00,,EPSG,,
+8142,WGS 72BE to WGS 72 (1),,,4324,4322,1,,8542,1996-12-12 00:00:00,,EPSG,,
+8143,WGS 72BE to WGS 84 (1),,,4324,4326,1,,8543,1996-12-12 00:00:00,,EPSG,,
+8144,NAD27 to NAD83 (1),,NGS-Conus,4267,4269,1,,8544,1996-12-12 00:00:00,,EPSG,,
+8146,NAD27 to NAD83 (2),,NGS-Usa AK,4267,4269,2,,8546,1996-12-12 00:00:00,,EPSG,,
+8148,ED50 to WGS 84 (16),,DMA-Tun,4230,4326,16,,8548,1997-06-12 00:00:00,,EPSG,,
+8149,Herat North to WGS 84 (1),,DMA-Afg,4255,4326,1,,8549,1997-06-12 00:00:00,,EPSG,,
+8150,Kalianpur 1962 to WGS 84 (1),,DMA-Pak,4145,4326,1,,8550,1999-10-20 00:00:00,,EPSG,,97.235
+8151,ID74 to WGS 84 (1),,DMA-Idn,4238,4326,1,,8551,1997-06-12 00:00:00,,EPSG,,
+8152,NAD27 to WGS 84 (21),,DMA-AK AluE,4267,4326,21,,8552,1997-04-11 00:00:00,,EPSG,,
+8153,NAD27 to WGS 84 (22),,DMA-AK AluW,4267,4326,22,,8553,1997-04-11 00:00:00,,EPSG,,
+8154,NAD83 to WGS 84 (2),,DMA-AK Alu,4269,4326,2,,8554,1997-04-11 00:00:00,,EPSG,,
+8155,NAD83 to WGS 84 (3),,DMA-USA Hi,4269,4326,3,,8555,1997-04-11 00:00:00,,EPSG,,
+8156,Nord Sahara 1959 to WGS 84 (1),,DMA-Alg,4307,4326,1,,8556,1997-04-11 00:00:00,,EPSG,,
+8157,Pulkovo 1942 to WGS 84 (1),,DMA-Rus,4284,4326,1,,8557,1997-04-11 00:00:00,,EPSG,,
+8158,Voirol Unifie to WGS 84 (1),,DMA-Alg N,4305,4326,1,,8558,1997-04-11 00:00:00,,EPSG,,98.15
+8159,Fahud to WGS 84 (1),,DMA-Omn,4232,4326,1,,8559,1997-04-11 00:00:00,,EPSG,,
+8160,NTF (Paris) to NTF (1),,IGN-Fra,4807,4275,1,,8560,1997-04-11 00:00:00,,EPSG,,
+8161,Bern 1898 (Bern) to Bern 1898 (1),,BfL-CH,4801,4217,1,,8561,1997-04-11 00:00:00,,EPSG,,
+8162,Bogota (Bogota) to Bogota (1),,IGAC-Col,4802,4218,1,,8562,1997-04-11 00:00:00,,EPSG,,
+8163,Lisbon (Lisbon) to Lisbon (1),,IGC-Prt,4803,4207,1,,8564,1997-04-11 00:00:00,,EPSG,,
+8164,Makassar (Jakarta) to Makassar (1),,EPSG-Idn Sulawesi,4804,4257,1,,8565,1997-04-11 00:00:00,,EPSG,,
+8165,MGI (Ferro) to MGI (1),,BEV-Aut balk,4805,4312,1,,8566,1997-04-11 00:00:00,,EPSG,,
+8166,Monte Mario (Rome) to Monte Mario (1),,EPSG-Ita,4806,4265,1,,8567,1997-04-11 00:00:00,,EPSG,,
+8167,Padang (Jakarta) to Padang (1),,EPSG-Idn Sumatra,4808,4280,1,,8569,1997-04-11 00:00:00,,EPSG,,
+8168,Belge 1950 (Brussels) to Belge 1950 (1),,IGN-Bel,4809,4215,1,,8570,1997-04-11 00:00:00,,EPSG,,
+8169,Tananarive (Paris) to Tananarive (1),,EPSG-Mdg,4810,4297,1,,8571,1997-04-11 00:00:00,,EPSG,,
+8170,Voirol 1875 (Paris) to Voirol 1875 (1),,IGN-Dza,4811,4304,1,,8573,1997-04-11 00:00:00,,EPSG,,
+8171,Voirol Unifie (Paris) to Voirol Unifie(1,,IGN-Dza,4812,4305,1,,8574,1997-04-11 00:00:00,,EPSG,,
+8172,Batavia (Jakarta) to Batavia (1),,EPSG-Idn Java,4813,4211,1,,8576,1997-04-11 00:00:00,,EPSG,,
+8173,RT38 (Stockholm) to RT38 (1),,NLS-Swe,4814,4308,1,,8578,1997-04-11 00:00:00,,EPSG,,
+8174,Bogota (Bogota) to WGS 84 (1),,EPSG-Col,4802,4326,1,Colombia.,8563,1997-04-11 00:00:00,,EPSG,,
+8175,Monte Mario (Rome) to WGS 84 (1),,EPSG-Ita,4806,4326,1,Italy (Sardinia).,8568,1997-04-11 00:00:00,,EPSG,,
+8176,Tananarive (Paris) to WGS 84 (1),,EPSG-Mdg,4810,4326,1,Madagascar.,8572,1997-04-11 00:00:00,,EPSG,,
+8177,Voirol Unifie (Paris) to WGS 84 (1),,EPSG-Dza N,4812,4326,1,Algeria - north of 35g (31 deg 30 min) North,8575,1997-04-11 00:00:00,,EPSG,,
+8178,Batavia (Jakarta) to WGS 84 (1),,EPSG-Idn Sumatra,4813,4326,1,Indonesia (Sumatra).,8577,1997-04-11 00:00:00,,EPSG,,
+8179,Greek (Athens) to Greek (1),,NTU-Grc,4815,4120,1,,8579,1998-12-14 00:00:00,,EPSG,,98.52
+8180,Schwarzeck to WGS 84 (2),,SLI-Nam,4293,4326,2,,8580,1998-11-19 00:00:00,,EPSG,,98.46
+8181,GGRS87 to WGS 84 (1),,Hel-Grc,4121,4326,1,,8581,1997-06-16 00:00:00,,EPSG,,
+8182,HD72 to ETRF89 (1),,ELTE-Hun,4237,4258,1,,8582,1997-11-13 00:00:00,,EPSG,,97.47
+8183,HD72 to WGS 84 (1),,EPSG-Hun,4237,4326,1,Hungary.,8583,1997-07-22 00:00:00,,EPSG,For many purposes ETRF89 can be assumed to be coincident with WGS 84.,
+8184,ED50 to WGS 84 (17),,IGN-Fra,4230,4326,17,,8584,1997-11-13 00:00:00,,EPSG,,
+8185,NTF to ED50 (1),,IGN-Fra,4275,4230,1,,8585,1997-11-13 00:00:00,,EPSG,,
+8186,NTF (Paris) to ED50 (1),,EPSG-Fra,4807,4230,1,France,8586,1997-11-13 00:00:00,,EPSG,,
+8187,NTF to WGS 72 (1),,IGN-Fra,4275,4322,1,,8587,1997-11-13 00:00:00,,EPSG,,
+8188,NTF (Paris) to WGS 72 (1),,EPSG-Fra,4807,4322,1,France.,8588,1997-11-13 00:00:00,,EPSG,,
+8189,AGD66 to GDA94 (1),,Auslig-Aus 5m,4202,4283,1,,8589,1997-11-13 00:00:00,,EPSG,,
+8190,AGD66 to WGS 84 (2),,EPSG-Aus 5m,4202,4326,2,Australia..,8590,1998-12-16 00:00:00,,EPSG,For many purposes GDA94 can be assumed to be coincident with WGS 84.,98.50
+8191,AGD84 to GDA94 (1),,Auslig-Aus 5m,4203,4283,1,,8591,1997-11-13 00:00:00,,EPSG,,
+8192,AGD84 to WGS 84 (3),,EPSG-Aus 5m,4203,4326,3,Australia,8592,1998-12-16 00:00:00,,EPSG,For many purposes GDA94 can be assumed to be coincident with WGS 84.,98.50
+8193,AGD84 to GDA94 (2),,Auslig-Aus 1m,4203,4283,2,,8593,1997-11-13 00:00:00,,EPSG,,
+8194,AGD84 to WGS 84 (4),,EPSG-Aus 1m,4203,4326,4,Australia.,8594,1998-12-16 00:00:00,,EPSG,For many purposes GDA94 can be assumed to be coincident with WGS 84.,98.50
+8195,RT90 to WGS 84 (1),,EPSG-Swe,4124,4326,1,Sweden.,8595,1999-04-22 00:00:00,,EPSG,For many purposes ETRF89 can be assumed to be coincident with WGS 84.,99.11
+8196,Samboja to WGS 84 (1),,TOT-Idn Mah,4125,4326,1,,8596,1997-11-13 00:00:00,,EPSG,,
+8197,Pulkovo 1942 to LKS94 (1),,HNIT-Ltu,4284,4126,1,,8597,1998-03-12 00:00:00,,EPSG,,
+8198,LKS94 to WGS 84 (1),,HNIT-Ltu,4126,4326,1,,8598,1998-04-16 00:00:00,,EPSG,For many purposes LKS94 can be assumed to be coincident with WGS 84.,98.13
+8199,Pulkovo 1942 to WGS 84 (2),,EPSG-Ltu,4284,4326,2,Lithuania.,8609,1998-03-12 00:00:00,,EPSG,For many purposes LKS94 can be assumed to be coincident with WGS 84.,
+8200,Pulkovo 1942 to WGS 84 (3),,NIMA-Hun,4284,4326,3,,8602,1998-03-12 00:00:00,,EPSG,,
+8201,Pulkovo 1942 to WGS 84 (4),,NIMA-Pol,4284,4326,4,,8603,1998-03-12 00:00:00,,EPSG,,
+8202,Pulkovo 1942 to WGS 84 (5),,NIMA-Cze,4284,4326,5,,8604,1998-03-12 00:00:00,,EPSG,,
+8203,Pulkovo 1942 to WGS 84 (6),,NIMA-Lva,4284,4326,6,,8605,1998-03-12 00:00:00,,EPSG,,
+8204,Pulkovo 1942 to WGS 84 (7),,NIMA-Kaz,4284,4326,7,,8606,1998-03-12 00:00:00,,EPSG,,
+8205,Pulkovo 1942 to WGS 84 (8),,NIMA-Alb,4284,4326,8,,8607,1998-03-12 00:00:00,,EPSG,,
+8206,Pulkovo 1942 to WGS 84 (9),,NIMA-Rom,4284,4326,9,,8608,1998-03-12 00:00:00,,EPSG,,
+8207,Arc 1960 to WGS 84 (2),,NIMA-Ken,4210,4326,2,,8599,1998-03-12 00:00:00,,EPSG,,
+8208,Arc 1960 to WGS 84 (3),,NIMA-Tza,4210,4326,3,,8600,1998-03-12 00:00:00,,EPSG,,
+8209,Segora to WGS 84 (1),,NIMA-Idn Kal,4294,4326,1,,8601,1998-03-12 00:00:00,,EPSG,,
+8210,Voirol 1875 to WGS 84 (1),,NIMA-Dza N,4304,4326,1,,8610,1998-03-12 00:00:00,,EPSG,,
+8211,Voirol 1875 (Paris) to WGS 84 (1),,EPSG-Dza N,4811,4326,1,Algeria - north of 35g (31 deg 30 min) North.,8611,1998-03-12 00:00:00,,EPSG,,
+8212,Naparima 1972 to WGS 84 (2),,MEEI-Tto,4271,4326,2,,8612,1998-04-16 00:00:00,,EPSG,,
+8213,Trinidad 1903 to WGS 84 (1),,MEEI-Trin,4302,4326,1,,8613,1998-04-16 00:00:00,,EPSG,,
+8214,Tete to Moznet (1),,DNGC-Moz,4127,4130,1,,8614,1998-04-16 00:00:00,,EPSG,,
+8215,Tete to WGS 84 (1),,EPSG-Moz,4127,4326,1,Mozambique - average for whole country.,8615,1998-04-16 00:00:00,,EPSG,For many purposes Moznet can be assumed to be coincident with WGS 84.,
+8216,Tete to Moznet (2),,DNGC-Moz A,4127,4130,2,,8616,1998-04-16 00:00:00,,EPSG,,
+8217,Tete to WGS 84 (2),,EPSG-Moz A,4127,4326,2,Mozambique - Maputo province and southern part of Gaza province; i.e. south of approximately 24 deg S.,8617,1998-04-16 00:00:00,,EPSG,For many purposes Moznet can be assumed to be coincident with WGS 84.,
+8218,Tete to Moznet (3),,DNGC-Moz B,4127,4130,3,,8618,1998-04-16 00:00:00,,EPSG,,
+8219,Tete to WGS 84 (3),,EPSG-Moz B,4127,4326,3,Mozambique - provinces of Gaza; Inhambane and southern parts of Sofala and Manhica; i.e. between approximately 24 and 20 deg South.,8619,1998-04-16 00:00:00,,EPSG,For many purposes Moznet can be assumed to be coincident with WGS 84.,
+8220,Tete to Moznet (4),,DNGC-Moz C,4127,4130,4,,8620,1998-04-16 00:00:00,,EPSG,,
+8221,Tete to WGS 84 (4),,EPSG-Moz C,4127,4326,4,Mozambique - provinces of Sofala north of Beira corridor; Manhica; Tete and Zambezia; i.e. between approximately 20 and 16 deg South.,8621,1998-04-16 00:00:00,,EPSG,For many purposes Moznet can be assumed to be coincident with WGS 84.,
+8222,Tete to Moznet (5),,DNGC-Moz D,4127,4130,5,,8622,1998-04-16 00:00:00,,EPSG,,
+8223,Tete to WGS 84 (5),,EPSG-Moz D,4127,4326,5,Mozambique - provinces of Nampula; Niassa; Cabo Delgado; i.e. north of approximately 16 deg S.,8623,1998-04-16 00:00:00,,EPSG,For many purposes Moznet can be assumed to be coincident with WGS 84.,
+8224,Moznet to WGS 84 (1),,EPSG-Moz,4130,4326,1,,8624,1998-04-16 00:00:00,,EPSG,,
+8225,Pulkovo 1942 to WGS 84 (10),,KCS-Kaz Cas,4284,4326,10,,8625,1998-04-16 00:00:00,,EPSG,,
+8226,Indian 1975 to WGS 84 (2),,NIMA-Tha,4240,4326,2,,8626,1998-04-16 00:00:00,,EPSG,,
+8227,Tokyo to WGS 84 (5),,NIMA-Kor,4301,4326,5,,8627,1998-11-19 00:00:00,,EPSG,,98.46
+8228,MGI to WGS 84 (1),,NIMA-balk,4312,4326,1,,8628,1998-04-16 00:00:00,,EPSG,,
+8229,Naparima 1972 to WGS 84 (3),,NIMA-Tto,4271,4326,3,,8629,1998-04-16 00:00:00,,EPSG,,
+8233,DHDN to ETRF89 (1),,IfAG-Deu W,4314,4258,1,,8633,1998-06-30 00:00:00,,EPSG,,
+8234,DHDN to WGS 84 (1),,EPSG-Deu W,4314,4326,1,Germany - former west Germany.,8634,1998-06-30 00:00:00,EPSG,EPSG,For many purposes ETRF89 can be assumed to be coincident with WGS 84.,
+8235,Pulkovo 1942 to ETRF89 (1),,IfAG-Deu E,4284,4258,1,,8635,1998-06-30 00:00:00,,EPSG,,
+8236,Pulkovo 1942 to WGS 84 (11),,EPSG-Deu E,4284,4326,11,Germany - former east Germany - Brandenburg; Mecklenburg-Vorpommern; Sachsen-Anhalt.,8636,1998-06-30 00:00:00,,EPSG,For many purposes ETRF89 can be assumed to be coincident with WGS 84.,
+8237,ED50 to WGS 84 (Common Offshore),,UKOOA-CO,4230,4326,18,,8637,1998-06-30 00:00:00,,EPSG,,98.27
+8238,Madrid 1870 (Madrid) to ED50 (1),,IGB-Esp,4903,4230,1,,8638,1998-11-11 00:00:00,,EPSG,,
+8239,Madrid 1870 (Madrid) to ED50 (2),,IGB-Esp N,4903,4230,2,,8639,1998-11-11 00:00:00,,EPSG,,
+8240,Madrid 1870 (Madrid) to ED50 (3),,IGB-Esp S,4903,4230,3,,8640,1998-11-11 00:00:00,,EPSG,,
+8241,Madrid 1870 (Madrid) to WGS 84 (1),,EPSG-Esp,4903,4326,1,Spain.,8641,1998-11-11 00:00:00,,EPSG,,
+8242,NAD27 to NAD83 (3),,GC-Can NT1,4267,4269,3,,8642,1998-11-11 00:00:00,,EPSG,,98.57
+8243,NAD27 to WGS 84 (25),,EPSG-Can old,4267,4326,25,Canada,8643,1998-11-11 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8244,NAD27 to NAD83 (4),,GC-Can,4267,4269,4,,8644,1998-11-11 00:00:00,,EPSG,,98.57
+8245,NAD27 to WGS 84 (26),,EPSG-Can,4267,4326,26,Canada.,8645,1998-11-11 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8246,OSGB 1936 to WGS 84 (Petroleum),,UKOOA-Pet,4277,4326,6,,8646,1998-11-11 00:00:00,,EPSG,,
+8247,OSGB 1936 to ED50 (UKOOA),,UKOOA-UKCS,4277,4230,1,,8647,1998-11-11 00:00:00,,EPSG,,
+8248,Manoca to WGS 84 (1),,SCS-Cmr,4260,4326,1,,8648,1998-11-11 00:00:00,,EPSG,,
+8249,Camacupa to WGS 72BE (1),,GSI-Ago,4220,4324,1,,8649,1998-11-11 00:00:00,,EPSG,,
+8250,Camacupa to WGS 84 (1),,CON-Ago B5,4220,4326,1,,8650,1998-11-11 00:00:00,,EPSG,,
+8251,Camacupa to WGS 84 (2),,TEX-Ago B2,4220,4326,2,,8651,1998-11-11 00:00:00,,EPSG,,
+8252,Camacupa to WGS 84 (3),,SHL-Ago old,4220,4326,3,,8652,1998-11-11 00:00:00,,EPSG,,
+8253,Camacupa to WGS 84 (4),,GSI-Ago,4220,4326,4,,8653,1998-11-11 00:00:00,,EPSG,,
+8254,Camacupa to WGS 84 (5),,ELF-Ago B3 old,4220,4326,5,,8654,1998-11-11 00:00:00,,EPSG,,
+8255,Camacupa to WGS 84 (6),,ELF-Ago B7 old,4220,4326,6,,8655,1998-11-11 00:00:00,,EPSG,,
+8256,Camacupa to WGS 84 (7),,ELF-Ago B15,4220,4326,7,,8656,1998-11-11 00:00:00,,EPSG,,
+8257,Camacupa to WGS 84 (8),,ELF-Ago B2 old,4220,4326,8,,8657,1998-11-11 00:00:00,,EPSG,,
+8258,Camacupa to WGS 84 (9),,SHL-Ago B16,4220,4326,9,,8658,1998-11-11 00:00:00,,EPSG,,
+8259,Camacupa to WGS 84 (10),,ELF-Ago N,4220,4326,10,,8659,1998-11-11 00:00:00,,EPSG,,
+8260,Malongo 1987 to Mhast (1),,CHV-Ago Cab,4259,4264,1,,8660,1998-11-11 00:00:00,,EPSG,,
+8261,Mhast to WGS 84 (1),,CHV-Ago Cab,4264,4326,1,,8661,1998-11-11 00:00:00,,EPSG,,
+8262,Malongo 1987 to WGS 84 (1),,CHV-Ago Cab,4259,4326,1,,8662,1998-11-11 00:00:00,,EPSG,,
+8263,MGI (Ferro) to WGS 84 (1),,DMA-balk,4805,4326,1,MEAN FOR Boznia and Herzegovina; Croatia; Serbia; Slovenia.,8663,1998-12-14 00:00:00,,EPSG,,
+8264,EST92 to ETRF89 (1),,UT-Est,4133,4258,1,,8664,1998-12-14 00:00:00,,EPSG,,
+8265,Pulkovo 1942 to EST92 (1),,UT-Est,4284,4133,1,,8665,1998-12-14 00:00:00,,EPSG,,
+8266,EST92 to WGS 84 (1),,UT-Est,4133,4326,1,,8666,1998-12-14 00:00:00,,EPSG,,
+8267,Pulkovo 1942 to WGS 84 (12),,UT-Est,4284,4326,12,,8667,1998-12-14 00:00:00,,EPSG,,
+8268,Tokyo to WGS 84 (6),,GSI-Jpn 452141,4301,4326,6,,8668,1998-12-14 00:00:00,,EPSG,,
+8269,Tokyo to WGS 84 (7),,GSI-Jpn 452142,4301,4326,7,,8669,1998-12-14 00:00:00,,EPSG,,
+8270,Tokyo to WGS 84 (8),,GSI-Jpn 444141,4301,4326,8,,8670,1998-12-14 00:00:00,,EPSG,,
+8271,Tokyo to WGS 84 (9),,GSI-Jpn 444142,4301,4326,9,,8671,1998-12-14 00:00:00,,EPSG,,
+8272,Tokyo to WGS 84 (10),,GSI-Jpn 440141,4301,4326,10,,8672,1998-12-14 00:00:00,,EPSG,,
+8273,Tokyo to WGS 84 (11),,GSI-Jpn 440142,4301,4326,11,,8673,1998-12-14 00:00:00,,EPSG,,
+8274,Tokyo to WGS 84 (12),,GSI-Jpn 440143,4301,4326,12,,8674,1998-12-14 00:00:00,,EPSG,,
+8275,Tokyo to WGS 84 (13),,GSI-Jpn 440144,4301,4326,13,,8675,1998-12-14 00:00:00,,EPSG,,
+8276,Tokyo to WGS 84 (14),,GSI-Jpn 432141,4301,4326,14,,8676,1998-12-14 00:00:00,,EPSG,,
+8277,Tokyo to WGS 84 (15),,GSI-Jpn 432142,4301,4326,15,,8677,1998-12-14 00:00:00,,EPSG,,
+8278,Tokyo to WGS 84 (16),,GSI-Jpn 432143,4301,4326,16,,8678,1998-12-14 00:00:00,,EPSG,,
+8279,Tokyo to WGS 84 (17),,GSI-Jpn 432144,4301,4326,17,,8679,1998-12-14 00:00:00,,EPSG,,
+8280,Tokyo to WGS 84 (18),,GSI-Jpn 432145,4301,4326,18,,8680,1998-12-14 00:00:00,,EPSG,,
+8281,Tokyo to WGS 84 (19),,GSI-Jpn 424140,4301,4326,19,,8681,1998-12-14 00:00:00,,EPSG,,
+8282,Tokyo to WGS 84 (20),,GSI-Jpn 424141,4301,4326,20,,8682,1998-12-14 00:00:00,,EPSG,,
+8283,Tokyo to WGS 84 (21),,GSI-Jpn 424142,4301,4326,21,,8683,1998-12-14 00:00:00,,EPSG,,
+8284,Tokyo to WGS 84 (22),,GSI-Jpn 424143,4301,4326,22,,8684,1998-12-14 00:00:00,,EPSG,,
+8285,Tokyo to WGS 84 (23),,GSI-Jpn 424144,4301,4326,23,,8685,1998-12-14 00:00:00,,EPSG,,
+8286,Tokyo to WGS 84 (24),,GSI-Jpn 424145,4301,4326,24,,8686,1998-12-14 00:00:00,,EPSG,,
+8287,Tokyo to WGS 84 (25),,GSI-Jpn 420139,4301,4326,25,,8687,1998-12-14 00:00:00,,EPSG,,
+8288,Tokyo to WGS 84 (26),,GSI-Jpn 420140,4301,4326,26,,8688,1998-12-14 00:00:00,,EPSG,,
+8289,Tokyo to WGS 84 (27),,GSI-Jpn,4301,4326,27,,8689,1998-12-14 00:00:00,,EPSG,,
+8290,Tokyo to WGS 84 (28),,GSI-Jpn,4301,4326,28,,8690,1998-12-14 00:00:00,,EPSG,,
+8291,Tokyo to WGS 84 (29),,GSI-Jpn,4301,4326,29,,8691,1998-12-14 00:00:00,,EPSG,,
+8292,Tokyo to WGS 84 (30),,GSI-Jpn,4301,4326,30,,8692,1998-12-14 00:00:00,,EPSG,,
+8293,Tokyo to WGS 84 (31),,GSI-Jpn,4301,4326,31,,8693,1998-12-14 00:00:00,,EPSG,,
+8294,Tokyo to WGS 84 (32),,GSI-Jpn,4301,4326,32,,8694,1998-12-14 00:00:00,,EPSG,,
+8295,Tokyo to WGS 84 (33),,GSI-Jpn,4301,4326,33,,8695,1998-12-14 00:00:00,,EPSG,,
+8296,Tokyo to WGS 84 (34),,GSI-Jpn,4301,4326,34,,8696,1998-12-14 00:00:00,,EPSG,,
+8297,Tokyo to WGS 84 (35),,GSI-Jpn,4301,4326,35,,8697,1998-12-14 00:00:00,,EPSG,,
+8298,Tokyo to WGS 84 (36),,GSI-Jpn,4301,4326,36,,8698,1998-12-14 00:00:00,,EPSG,,
+8299,Tokyo to WGS 84 (37),,GSI-Jpn,4301,4326,37,,8699,1998-12-14 00:00:00,,EPSG,,
+8300,Tokyo to WGS 84 (38),,GSI-Jpn,4301,4326,38,,8700,1998-12-14 00:00:00,,EPSG,,
+8301,Tokyo to WGS 84 (39),,GSI-Jpn,4301,4326,39,,8701,1998-12-14 00:00:00,,EPSG,,
+8302,Tokyo to WGS 84 (40),,GSI-Jpn,4301,4326,40,,8702,1998-12-14 00:00:00,,EPSG,,
+8303,Tokyo to WGS 84 (41),,GSI-Jpn,4301,4326,41,,8703,1998-12-14 00:00:00,,EPSG,,
+8304,Tokyo to WGS 84 (42),,GSI-Jpn,4301,4326,42,,8704,1998-12-14 00:00:00,,EPSG,,
+8305,Tokyo to WGS 84 (43),,GSI-Jpn,4301,4326,43,,8705,1998-12-14 00:00:00,,EPSG,,
+8306,Tokyo to WGS 84 (44),,GSI-Jpn,4301,4326,44,,8706,1998-12-14 00:00:00,,EPSG,,
+8307,Tokyo to WGS 84 (45),,GSI-Jpn,4301,4326,45,,8707,1998-12-14 00:00:00,,EPSG,,
+8308,Tokyo to WGS 84 (46),,GSI-Jpn,4301,4326,46,,8708,1998-12-14 00:00:00,,EPSG,,
+8309,Tokyo to WGS 84 (47),,GSI-Jpn,4301,4326,47,,8709,1998-12-14 00:00:00,,EPSG,,
+8310,Tokyo to WGS 84 (48),,GSI-Jpn,4301,4326,48,,8710,1998-12-14 00:00:00,,EPSG,,
+8311,Tokyo to WGS 84 (49),,GSI-Jpn,4301,4326,49,,8711,1998-12-14 00:00:00,,EPSG,,
+8312,Tokyo to WGS 84 (50),,GSI-Jpn,4301,4326,50,,8712,1998-12-14 00:00:00,,EPSG,,
+8313,Tokyo to WGS 84 (51),,GSI-Jpn,4301,4326,51,,8713,1998-12-14 00:00:00,,EPSG,,
+8314,Tokyo to WGS 84 (52),,GSI-Jpn,4301,4326,52,,8714,1998-12-14 00:00:00,,EPSG,,
+8315,Tokyo to WGS 84 (53),,GSI-Jpn,4301,4326,53,,8715,1998-12-14 00:00:00,,EPSG,,
+8316,Tokyo to WGS 84 (54),,GSI-Jpn,4301,4326,54,,8716,1998-12-14 00:00:00,,EPSG,,
+8317,Tokyo to WGS 84 (55),,GSI-Jpn,4301,4326,55,,8717,1998-12-14 00:00:00,,EPSG,,
+8318,Tokyo to WGS 84 (56),,GSI-Jpn,4301,4326,56,,8718,1998-12-14 00:00:00,,EPSG,,
+8319,Tokyo to WGS 84 (57),,GSI-Jpn,4301,4326,57,,8719,1998-12-14 00:00:00,,EPSG,,
+8320,Tokyo to WGS 84 (58),,GSI-Jpn,4301,4326,58,,8720,1998-12-14 00:00:00,,EPSG,,
+8321,Tokyo to WGS 84 (59),,GSI-Jpn,4301,4326,59,,8721,1998-12-14 00:00:00,,EPSG,,
+8322,Tokyo to WGS 84 (60),,GSI-Jpn,4301,4326,60,,8722,1998-12-14 00:00:00,,EPSG,,
+8323,Tokyo to WGS 84 (61),,GSI-Jpn,4301,4326,61,,8723,1998-12-14 00:00:00,,EPSG,,
+8324,Tokyo to WGS 84 (62),,GSI-Jpn,4301,4326,62,,8724,1998-12-14 00:00:00,,EPSG,,
+8325,Tokyo to WGS 84 (63),,GSI-Jpn,4301,4326,63,,8725,1998-12-14 00:00:00,,EPSG,,
+8326,Tokyo to WGS 84 (64),,GSI-Jpn,4301,4326,64,,8726,1998-12-14 00:00:00,,EPSG,,
+8327,Tokyo to WGS 84 (65),,GSI-Jpn,4301,4326,65,,8727,1998-12-14 00:00:00,,EPSG,,
+8328,Tokyo to WGS 84 (66),,GSI-Jpn,4301,4326,66,,8728,1998-12-14 00:00:00,,EPSG,,
+8329,Tokyo to WGS 84 (67),,GSI-Jpn,4301,4326,67,,8729,1998-12-14 00:00:00,,EPSG,,
+8330,Tokyo to WGS 84 (68),,GSI-Jpn,4301,4326,68,,8730,1998-12-14 00:00:00,,EPSG,,
+8331,Tokyo to WGS 84 (69),,GSI-Jpn,4301,4326,69,,8731,1998-12-14 00:00:00,,EPSG,,
+8332,Tokyo to WGS 84 (70),,GSI-Jpn,4301,4326,70,,8732,1998-12-14 00:00:00,,EPSG,,
+8333,Tokyo to WGS 84 (71),,GSI-Jpn,4301,4326,71,,8733,1998-12-14 00:00:00,,EPSG,,
+8334,Tokyo to WGS 84 (72),,GSI-Jpn,4301,4326,72,,8734,1998-12-14 00:00:00,,EPSG,,
+8335,Tokyo to WGS 84 (73),,GSI-Jpn,4301,4326,73,,8735,1998-12-14 00:00:00,,EPSG,,
+8336,Tokyo to WGS 84 (74),,GSI-Jpn,4301,4326,74,,8736,1998-12-14 00:00:00,,EPSG,,
+8337,Tokyo to WGS 84 (75),,GSI-Jpn,4301,4326,75,,8737,1998-12-14 00:00:00,,EPSG,,
+8338,Tokyo to WGS 84 (76),,GSI-Jpn,4301,4326,76,,8738,1998-12-14 00:00:00,,EPSG,,
+8339,Tokyo to WGS 84 (77),,GSI-Jpn,4301,4326,77,,8739,1998-12-14 00:00:00,,EPSG,,
+8340,Tokyo to WGS 84 (78),,GSI-Jpn,4301,4326,78,,8740,1998-12-14 00:00:00,,EPSG,,
+8341,Tokyo to WGS 84 (79),,GSI-Jpn,4301,4326,79,,8741,1998-12-14 00:00:00,,EPSG,,
+8342,Tokyo to WGS 84 (80),,GSI-Jpn,4301,4326,80,,8742,1998-12-14 00:00:00,,EPSG,,
+8343,Tokyo to WGS 84 (81),,GSI-Jpn,4301,4326,81,,8743,1998-12-14 00:00:00,,EPSG,,
+8344,Tokyo to WGS 84 (82),,GSI-Jpn,4301,4326,82,,8744,1998-12-14 00:00:00,,EPSG,,
+8345,Tokyo to WGS 84 (83),,GSI-Jpn,4301,4326,83,,8745,1998-12-14 00:00:00,,EPSG,,
+8346,Tokyo to WGS 84 (84),,GSI-Jpn,4301,4326,84,,8746,1998-12-14 00:00:00,,EPSG,,
+8347,Tokyo to WGS 84 (85),,GSI-Jpn,4301,4326,85,,8747,1998-12-14 00:00:00,,EPSG,,
+8348,Tokyo to WGS 84 (86),,GSI-Jpn,4301,4326,86,,8748,1998-12-14 00:00:00,,EPSG,,
+8349,Tokyo to WGS 84 (87),,GSI-Jpn,4301,4326,87,,8749,1998-12-14 00:00:00,,EPSG,,
+8350,Tokyo to WGS 84 (88),,GSI-Jpn,4301,4326,88,,8750,1998-12-14 00:00:00,,EPSG,,
+8351,Tokyo to WGS 84 (89),,GSI-Jpn,4301,4326,89,,8751,1998-12-14 00:00:00,,EPSG,,
+8352,Tokyo to WGS 84 (90),,GSI-Jpn,4301,4326,90,,8752,1998-12-14 00:00:00,,EPSG,,
+8353,Tokyo to WGS 84 (91),,GSI-Jpn,4301,4326,91,,8753,1998-12-14 00:00:00,,EPSG,,
+8354,Tokyo to WGS 84 (92),,GSI-Jpn,4301,4326,92,,8754,1998-12-14 00:00:00,,EPSG,,
+8355,Tokyo to WGS 84 (93),,GSI-Jpn,4301,4326,93,,8755,1998-12-14 00:00:00,,EPSG,,
+8356,Tokyo to WGS 84 (94),,GSI-Jpn,4301,4326,94,,8756,1998-12-14 00:00:00,,EPSG,,
+8357,Tokyo to WGS 84 (95),,GSI-Jpn,4301,4326,95,,8757,1998-12-14 00:00:00,,EPSG,,
+8358,Tokyo to WGS 84 (96),,GSI-Jpn,4301,4326,96,,8758,1998-12-14 00:00:00,,EPSG,,
+8359,Tokyo to WGS 84 (97),,GSI-Jpn,4301,4326,97,,8759,1998-12-14 00:00:00,,EPSG,,
+8360,Tokyo to WGS 84 (98),,GSI-Jpn,4301,4326,98,,8760,1998-12-14 00:00:00,,EPSG,,
+8361,Tokyo to WGS 84 (99),,GSI-Jpn,4301,4326,99,,8761,1998-12-14 00:00:00,,EPSG,,
+8362,Tokyo to WGS 84 (100),,GSI-Jpn 324132,4301,4326,100,,8762,1998-12-14 00:00:00,,EPSG,,
+8363,Tokyo to WGS 84 (101),,GSI-Jpn 324133,4301,4326,101,,8763,1998-12-14 00:00:00,,EPSG,,
+8364,Tokyo to WGS 84 (102),,GSI-Jpn 324134,4301,4326,102,,8764,1998-12-14 00:00:00,,EPSG,,
+8365,Tokyo to WGS 84 (103),,GSI-Jpn 320130,4301,4326,103,,8765,1998-12-14 00:00:00,,EPSG,,
+8366,Tokyo to WGS 84 (104),,GSI-Jpn 320131,4301,4326,104,,8766,1998-12-14 00:00:00,,EPSG,,
+8367,Tokyo to WGS 84 (105),,GSI-Jpn 320132,4301,4326,105,,8767,1998-12-14 00:00:00,,EPSG,,
+8368,Tokyo to WGS 84 (106),,GSI-Jpn 312130,4301,4326,106,,8768,1998-12-14 00:00:00,,EPSG,,
+8369,Tokyo to WGS 84 (107),,GSI-Jpn 312131,4301,4326,107,,8769,1998-12-14 00:00:00,,EPSG,,
+8370,Fahud to WGS 84 (2),,PDO-Omn,4232,4326,2,,8770,1999-04-22 00:00:00,,EPSG,,
+8371,PSD93 to WGS 84 (1),,PDO-Omn,4134,4326,1,,8771,1999-04-22 00:00:00,,EPSG,,
+8372,ED50 to WGS 84 (19),,HEL-Grc,4230,4326,19,,8772,1999-04-22 00:00:00,,EPSG,,
+8373,Antigua 1943 to WGS 84 (1),,DOS-Atg Ant,4601,4326,1,,8773,1999-04-22 00:00:00,,EPSG,,
+8374,Dominica 1945 to WGS 84 (1),,DOS-Dma,4602,4326,1,,8774,1999-04-22 00:00:00,,EPSG,,
+8375,Grenada 1953 to WGS 84 (1),,DOS-Grd,4603,4326,1,,8775,1999-04-22 00:00:00,,EPSG,,
+8376,Montserrat 1958 to WGS 84 (1),,DOS-Msr,4604,4326,1,,8776,1999-04-22 00:00:00,,EPSG,,
+8377,St. Kitts 1955 to WGS 84 (1),,DOS-Kna,4605,4326,1,,8777,1999-04-22 00:00:00,,EPSG,,
+8378,St. Lucia 1955 to WGS 84 (1),,DOS-Lca,4606,4326,1,,8778,1999-04-22 00:00:00,,EPSG,,
+8379,Anguilla 1957 to WGS 84 (1),,DOS-Aia,4600,4326,1,,8779,1999-04-22 00:00:00,,EPSG,,
+8380,RT90 to ETRF89 (1),,NLS-Swe,4124,4258,1,,8780,1999-04-22 00:00:00,,EPSG,,
+8384,ED50 to WGS 84 (20),,NMA-Nor 6265W,4230,4326,20,,8784,1999-04-22 00:00:00,,EPSG,,
+8385,Old Hawaiian to NAD83 (1),,NGS-Usa Hi,4135,4269,1,,8785,1999-05-24 00:00:00,,EPSG,,
+8386,Old Hawaiian to WGS 84 (1),,EPSG-US Hi,4135,4326,1,United States - Hawaii,8786,1999-05-24 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8387,St. Lawrence Island to NAD83 (1),,NGS-Usa AK StL,4136,4269,1,,8787,1999-05-24 00:00:00,,EPSG,,
+8388,St. Lawrence Island to WGS 84 (1),,EPSG-US StL,4136,4326,1,United States - Alaska - St. Lawrence Island.,8788,1999-05-24 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8389,St. Paul Island to NAD83 (1),,NGS-Usa AK StP,4137,4269,1,,8789,1999-05-24 00:00:00,,EPSG,,
+8390,St. Paul Island to WGS 84 (1),,EPSG-US StP,4137,4326,1,United States - Alaska - St. Paul Island.,8790,1999-05-24 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8391,St. George Island to NAD83 (1),,NGS-Usa AK StG,4138,4269,1,,8791,1999-05-24 00:00:00,,EPSG,,
+8392,St. George Island to WGS 84 (1),,EPSG-USA StG,4138,4326,1,United States - Alaska - St. George Island.,8792,1999-05-24 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8393,NAD27(CGQ77)  to NAD83 (1),,SGQ-Can QC,4609,4269,1,,8793,1999-05-24 00:00:00,,EPSG,,
+8394,NAD27(CGQ77) to WGS 84 (1),,EPSG-Can Qc,4609,4326,1,Canada - Quebec,8794,1999-05-24 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8395,AGD66 to GDA94 (2),,Auslig-ACT 1m,4202,4283,2,,8795,1999-05-24 00:00:00,,EPSG,,
+8396,AGD66 to WGS 84 (3),,EPSG-Aus ACT 1m,4202,4326,3,Australia - ACT.,8796,1999-05-24 00:00:00,,EPSG,For many purposes GDA94 can be assumed to be coincident with WGS 84.,
+8397,AGD66 to GDA94 (3),,Auslig-Tas 1m,4202,4283,3,,8797,1999-05-24 00:00:00,,EPSG,,
+8398,AGD66 to WGS 84 (4),,EPSG-Aus Tas 1m,4202,4326,4,Australia - Tasmania.,8798,1999-05-24 00:00:00,,EPSG,For many purposes GDA94 can be assumed to be coincident with WGS 84.,
+8399,AGD66 to GDA94 (4),,Auslig-NSW Vic,4202,4283,4,,8799,1999-05-24 00:00:00,,EPSG,,
+8400,AGD66 to WGS 84 (5),,EPSG-Aus NSW Vic 1m,4202,4326,5,Australia - New South Wales (NSW) and Victoria.,8800,1999-05-24 00:00:00,,EPSG,For many purposes GDA94 can be assumed to be coincident with WGS 84.,
+8401,Puerto Rico to NAD83 (1),,NGS-PRVI,4139,4269,1,,8801,1999-05-24 00:00:00,,EPSG,,
+8402,Puerto Rico to WGS 84 (1),,EPSG-PRVI,4139,4326,1,Puerto Rico; Virgin Islands (U.S.); Virgin Islands (British).,8802,1999-05-24 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8403,NAD27 to NAD83 (5),,SGQ-Can QC,4267,4269,5,,8803,1999-05-24 00:00:00,,EPSG,,
+8404,NAD27 to WGS 84 (27),,EPSG-Can QC,4267,4326,27,Canada - Quebec,8804,1999-05-24 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8405,NAD27(76) to NAD83 (1),,SGQ-Can Ont,4608,4269,1,,8805,1999-05-24 00:00:00,,EPSG,,
+8406,NAD27(76) to WGS 84 (1),,EPSG-Can On,4608,4326,1,Canada - Ontario,8806,1999-05-24 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8407,AGD66 to GDA94 (5),,OSG-Aus Vic,4202,4283,5,,8807,1999-05-24 00:00:00,,EPSG,,
+8408,AGD66 to WGS 84 (6),,EPSG-Aus Vic 0.1m,4202,4326,6,Australia - Victoria,8808,1999-05-24 00:00:00,,EPSG,For many purposes GDA94 can be assumed to be coincident with WGS 84.,
+8411,NGO 1948 (Oslo) to NGO 1948 (1),,NGO-Nor,4817,4273,1,,8811,1999-10-20 00:00:00,,EPSG,,
+8412,NTF (Paris) to NTF (2),,RGS,4807,4275,2,,8812,1999-10-20 00:00:00,,EPSG,,
+8413,Locodjo 1965 to WGS 84 (1),,IGN-Civ,4142,4326,1,,8813,1999-10-20 00:00:00,,EPSG,,
+8414,Abidjan 1987 to WGS 84 (1),,IGN-Civ,4143,4326,1,,8814,1999-10-20 00:00:00,,EPSG,,
+8415,MGI to WGS 84 (2),,BEV-Aut,4312,4326,1,,8815,1999-10-20 00:00:00,,EPSG,,
+8416,ATS 77 to NAD83(CSRS98) (1),,GIC-Can NB,4122,4140,1,,8816,1999-10-20 00:00:00,,EPSG,,
+8417,NAD83(CSRS98) to WGS 84 (1),,EPSG-Can,4140,4326,1,,8817,1999-10-20 00:00:00,,EPSG,,
+8418,ATS 77 to WGS 84 (1),,EPSG-Can NB,4122,4326,1,Canada - New Brunswick,8818,1999-10-20 00:00:00,EPSG,EPSG,For many purposes NAD83(CSRS) can be assumed to be coincident with WGS 84.,
+8419,NAD83 to NAD83(HARN) (1),,NGS-Usa AL,4269,4152,1,,8819,1999-10-20 00:00:00,,EPSG,,
+8420,NAD83 to NAD83(HARN) (2),,NGS-Usa AZ,4269,4152,2,,8820,1999-10-20 00:00:00,,EPSG,,
+8421,NAD83 to NAD83(HARN) (3),,NGS-Usa CA n,4269,4152,3,,8821,1999-10-20 00:00:00,,EPSG,,
+8422,NAD83 to NAD83(HARN) (4),,NGS-Usa CA s,4269,4152,4,,8822,1999-10-20 00:00:00,,EPSG,,
+8423,NAD83 to NAD83(HARN) (5),,NGS-Usa CO,4269,4152,5,,8823,1999-10-20 00:00:00,,EPSG,,
+8424,NAD83 to NAD83(HARN) (6),,NGS-Usa GA,4269,4152,6,,8824,1999-10-20 00:00:00,,EPSG,,
+8425,NAD83 to NAD83(HARN) (7),,NGS-Usa FL,4269,4152,7,,8825,1999-10-20 00:00:00,,EPSG,,
+8426,NAD83 to NAD83(HARN) (8),,NGS-Usa ID MT e,4269,4152,8,,8826,1999-10-20 00:00:00,,EPSG,,
+8427,NAD83 to NAD83(HARN) (9),,NGS-Usa ID MT w,4269,4152,9,,8827,1999-10-20 00:00:00,,EPSG,,
+8428,NAD83 to NAD83(HARN) (10),,NGS-Usa KY,4269,4152,10,,8828,1999-10-20 00:00:00,,EPSG,,
+8429,NAD83 to NAD83(HARN) (11),,NGS-Usa LA,4269,4152,11,,8829,1999-10-20 00:00:00,,EPSG,,
+8430,NAD83 to NAD83(HARN) (12),,NGS-Usa DE MD,4269,4152,12,,8830,1999-10-20 00:00:00,,EPSG,,
+8431,NAD83 to NAD83(HARN) (13),,NGS-Usa ME,4269,4152,13,,8831,1999-10-20 00:00:00,,EPSG,,
+8432,NAD83 to NAD83(HARN) (14),,NGS-Usa MI,4269,4152,14,,8832,1999-10-20 00:00:00,,EPSG,,
+8433,NAD83 to NAD83(HARN) (15),,NGS-Usa MS,4269,4152,15,,8833,1999-10-20 00:00:00,,EPSG,,
+8434,NAD83 to NAD83(HARN) (16),,NGS-Usa NE,4269,4152,16,,8834,1999-10-20 00:00:00,,EPSG,,
+8435,NAD83 to NAD83(HARN) (17),,NGS-US NewEng,4269,4152,17,,8835,1999-10-20 00:00:00,,EPSG,,
+8436,NAD83 to NAD83(HARN) (18),,NGS-Usa NM,4269,4152,18,,8836,1999-10-20 00:00:00,,EPSG,,
+8437,NAD83 to NAD83(HARN) (19),,NGS-Usa NY,4269,4152,19,,8837,1999-10-20 00:00:00,,EPSG,,
+8438,NAD83 to NAD83(HARN) (20),,NGS-Usa ND,4269,4152,20,,8838,1999-10-20 00:00:00,,EPSG,,
+8439,NAD83 to NAD83(HARN) (21),,NGS-Usa OK,4269,4152,21,,8839,1999-10-20 00:00:00,,EPSG,,
+8440,NAD83 to NAD83(HARN) (22),,NGS-PRVI,4269,4152,22,,8840,1999-10-20 00:00:00,,EPSG,,
+8441,NAD83 to NAD83(HARN) (23),,NGS-Usa SD,4269,4152,23,,8841,1999-10-20 00:00:00,,EPSG,,
+8442,NAD83 to NAD83(HARN) (24),,NGS-Usa TN,4269,4152,24,,8842,1999-10-20 00:00:00,,EPSG,,
+8443,NAD83 to NAD83(HARN) (25),,NGS-Usa TX e,4269,4152,25,,8843,1999-10-20 00:00:00,,EPSG,,
+8444,NAD83 to NAD83(HARN) (26),,NGS-Usa TX w,4269,4152,26,,8844,1999-10-20 00:00:00,,EPSG,,
+8445,NAD83 to NAD83(HARN) (27),,NGS-Usa VA,4269,4152,27,,8845,1999-10-20 00:00:00,,EPSG,,
+8446,NAD83 to NAD83(HARN) (28),,NGS-Usa OR WA,4269,4152,28,,8846,1999-10-20 00:00:00,,EPSG,,
+8447,NAD83 to NAD83(HARN) (29),,NGS-Usa WI,4269,4152,29,,8847,1999-10-20 00:00:00,,EPSG,,
+8448,NAD83 to NAD83(HARN) (30),,NGS-Usa WY,4269,4152,30,,8848,1999-10-20 00:00:00,,EPSG,,
+8449,Cape to Hartbeesthoek94 (1),,DSM-Zaf,4222,4148,1,,8849,1999-10-20 00:00:00,,EPSG,,
+8450,Hartbeesthoek94 to WGS 84 (1),,EPSG-Zaf,4148,4326,1,,8850,1999-10-20 00:00:00,,EPSG,For many purposes Hartbeesthoek94 can be assumed to be coincident with WGS 84.,
+8451,AGD66 to GDA94 (6),,Auslig-Tas,4202,4283,6,,8851,1999-10-20 00:00:00,,EPSG,,
+8452,AGD66 to GDA94 (7),,Auslig-NT,4202,4283,7,,8852,1999-10-20 00:00:00,,EPSG,,
+8453,AGD66 to WGS 84 (7),,EPSG-Aus Tas 0.1m,4202,4326,7,Australia - Tasmania.,8853,1999-10-20 00:00:00,,EPSG,For many purposes GDA94 can be assumed to be coincident with WGS 84.,
+8454,AGD66 to WGS 84 (8),,EPSG-Aus NT 0.1m,4202,4326,8,Australia - Northern Territory.,8854,1999-10-20 00:00:00,,EPSG,For many purposes GDA94 can be assumed to be coincident with WGS 84.,
+8455,CH1903 to WGS 84 (1),,BfL-CH 1,4149,4326,1,,8855,1999-10-20 00:00:00,,EPSG,,
+8456,CH1903+ to CHTRF95 (1),,BfL-CH,4150,4151,1,,8856,1999-10-20 00:00:00,,EPSG,,
+8457,CH1903+ to WGS 84 (1),,EPSG-CH,4150,4326,1,Liechtenstein;  Switzerland.,8857,1999-10-20 00:00:00,EPSG,EPSG,For many purposes CHTRF95 can be assumed to be coincident with WGS 84.,
+8458,CH1903 to WGS 84 (2),,BfL-CH 2,4149,4326,2,,8858,1999-10-20 00:00:00,,EPSG,,
+8459,CHTRF95 to WGS 84 (1),,EPSG-CH,4151,4326,1,,8859,1999-10-20 00:00:00,,EPSG,,
+8460,NAD27 to NAD83(HARN) (1),,NGS-Usa AL,4267,4152,1,United States (USA) - Alabama.,8860,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8461,NAD27 to NAD83(HARN) (2),,NGS-Usa AZ,4267,4152,2,United States (USA) - Arizona.,8861,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8462,NAD27 to NAD83(HARN) (3),,NGS-Usa CA n,4267,4152,3,United States (USA) - California north of 38 deg N.,8862,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8463,NAD27 to NAD83(HARN) (4),,NGS-Usa CA s,4267,4152,4,United States (USA) - California south of 38 deg N.,8863,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8464,NAD27 to NAD83(HARN) (5),,NGS-Usa CO,4267,4152,5,United States (USA) - Colorado.,8864,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8465,NAD27 to NAD83(HARN) (6),,NGS-Usa GA,4267,4152,6,United States (USA) - Georgia.,8865,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8466,NAD27 to NAD83(HARN) (7),,NGS-Usa FL,4267,4152,7,United States (USA) - Florida.,8866,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8467,NAD27 to NAD83(HARN) (8),,NGS-Usa ID MT e,4267,4152,8,United States (USA) - Idaho and Montana - east of 113 deg W.,8867,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8468,NAD27 to NAD83(HARN) (9),,NGS-Usa ID MT w,4267,4152,9,United States (USA) - Idaho and Montana - west of 113 deg W.,8868,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8469,NAD27 to NAD83(HARN) (10),,NGS-Usa KY,4267,4152,10,United States (USA) - Kentucky.,8869,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8470,NAD27 to NAD83(HARN) (11),,NGS-Usa LA,4267,4152,11,United States (USA) - Louisiana.,8870,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8471,NAD27 to NAD83(HARN) (12),,NGS-Usa DE MD,4267,4152,12,United States (USA) - Delaware and Maryland.,8871,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8472,NAD27 to NAD83(HARN) (13),,NGS-Usa ME,4267,4152,13,United States (USA) - Maine.,8872,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8473,NAD27 to NAD83(HARN) (14),,NGS-Usa MI,4267,4152,14,United States (USA) - Michigan.,8873,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8474,NAD27 to NAD83(HARN) (15),,NGS-Usa MS,4267,4152,15,United States (USA) - Mississippi.,8874,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8475,NAD27 to NAD83(HARN) (16),,NGS-Usa NE,4267,4152,16,United States (USA) - Nebraska.,8875,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8476,NAD27 to NAD83(HARN) (17),,NGS-US NewEng,4267,4152,18,United States (USA) - Connecticut; Massachusetts; New Hampshire; Rhode Island; Vermont.,8876,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8477,NAD27 to NAD83(HARN) (18),,NGS-Usa NM,4267,4152,18,United States (USA) - New Mexico.,8877,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8478,NAD27 to NAD83(HARN) (19),,NGS-Usa NY,4267,4152,19,United States (USA) - New York.,8878,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8479,NAD27 to NAD83(HARN) (20),,NGS-Usa ND,4267,4152,20,United States (USA) - North Dakota.,8879,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8480,NAD27 to NAD83(HARN) (21),,NGS-Usa OK,4267,4152,21,United States (USA) - Oklahoma.,8880,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8481,Puerto Rico to NAD83(HARN) (1),,NGS-PRVI,4139,4152,1,United States (USA) - Puerto Rico and the Virgin Islands.,8881,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8482,NAD27 to NAD83(HARN) (22),,NGS-Usa SD,4267,4152,22,United States (USA) - South Dakota.,8882,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8483,NAD27 to NAD83(HARN) (23),,NGS-Usa TN,4267,4152,23,United States (USA) - Tennessee,8883,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8484,NAD27 to NAD83(HARN) (24),,NGS-Usa TX e,4267,4152,24,United States (USA) - Texas east of 100deg West.,8884,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8485,NAD27 to NAD83(HARN) (25),,NGS-Usa TX w,4267,4152,25,United States (USA) - Texas west of 100deg West.,8885,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8486,NAD27 to NAD83(HARN) (26),,NGS-Usa VA,4267,4152,26,United States (USA) - Virginia.,8886,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8487,NAD27 to NAD83(HARN) (27),,NGS-Usa OR WA,4267,4152,27,United States (USA) - Oregan; Washington.,8887,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8488,NAD27 to NAD83(HARN) (28),,NGS-Usa WI,4267,4152,28,United States (USA) - Wisconsin.,8888,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8489,NAD27 to NAD83(HARN) (29),,NGS-Usa WY,4267,4152,29,United States (USA) - Wyoming.,8889,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,,
+8490,Rassadiran to WGS 84 (1),,TOT-Taheri,4153,4326,1,Iran - Taheri refinery site.,8890,1999-10-20 00:00:00,Total-Fina,EPSG,,
+8491,FD58 to WGS 84 (1),,TOT-Kangan,4132,4326,1,Iran - Kangan district,8891,1999-10-20 00:00:00,Total-Fina,EPSG,,
+8492,ED50(ED77) to WGS 84 (1),,NCCI-Irn,4154,4326,1,Iran,8892,1999-10-20 00:00:00,National Cartographic Centre of Iran,EPSG,,
+8493,NAD83 to WGS 84 (4),,NGS-Usa,4269,4326,4,United States (USA).,8893,1999-11-05 00:00:00,,EPSG,,
+8494,NAD83 to WGS 84 (5),,NGS-Usa,4269,4326,5,United States (USA).,8894,1999-11-05 00:00:00,,EPSG,,
+8495,La Canoa to WGS 84 (1),,LAG-Ven E,4247,4326,1,,8895,1999-11-05 00:00:00,,EPSG,,
+8496,NAD27 to WGS 84 (28),,NGS-Usa conus,4267,4326,28,United States (USA) - lower 48 states including EEZ.,8896,1999-10-20 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
+8497,NAD27 to WGS 84 (29),,NGS-Usa AK,4267,4326,29,United States (USA) - Alaska including EEZ.,8897,1999-10-20 00:00:00,,EPSG,For many purposes NAD83 can be assumed to be coincident with WGS 84.,
diff --git a/src/tiff/csv/horiz_cs.c b/src/tiff/csv/horiz_cs.c
new file mode 100644
index 0000000..4cd5c80
--- /dev/null
+++ b/src/tiff/csv/horiz_cs.c
@@ -0,0 +1,1496 @@
+#include "defs.h"
+datafile_rows_t horiz_cs_row_1[] = {"HORIZCS_CODE","HORIZCS_EPSG_NAME","HORIZCS_EPSG_ABBR","HORIZCS_USER_NAME","DESCRIPTION","AREA_OF_USE","COORD_SYS_TYPE","GEOD_DATUM_CODE","PRIME_MERIDIAN_CODE","ORIENT_POSITIVE_AXIS_1","ORIENT_POSITIVE_AXIS_2","COORD_SYS_AXIS_1_ABBR","COORD_SYS_AXIS_2_ABBR","UOM_LENGTH_CODE","UOM_ANGLE_CODE","SOURCE_GEOGCS_CODE","PROJECTION_TRF_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t horiz_cs_row_2[] = {"200","Anguilla 1957 / British West Indies Grid","Anguilla 1957 / BWI Grid","","","Anguilla","projected 2D","","","East","North","E","N","9001","","4600","19942","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_3[] = {"201","Antigua 1943 / British West Indies Grid","Antigua 1943 / BWI Grid","","","Antigua and Barbuda - Antigua","projected 2D","","","East","North","E","N","9001","","4601","19942","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_4[] = {"202","Dominica 1945 / British West Indies Grid","Dominica 1945 / BWI Grid","","","Dominica","projected 2D","","","East","North","E","N","9001","","4602","19942","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_5[] = {"203","Grenada 1953 / British West Indies Grid","Grenada 1953 / BWI Grid","","","Grenada (including Grenada Grenadines)","projected 2D","","","East","North","E","N","9001","","4603","19942","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_6[] = {"204","Montserrat 58 / British West Indies Grid","Montserrat 58 / BWI Grid","","","Montserrat","projected 2D","","","East","North","E","N","9001","","4604","19942","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_7[] = {"205","St Kitts 1955 / British West Indies Grid","St Kitts 1955 / BWI Grid","","","Saint Kitts and Nevis","projected 2D","","","East","North","E","N","9001","","4605","19942","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_8[] = {"206","St Lucia 1955 / British West Indies Grid","St Lucia 1955 / BWI Grid","","","Saint Lucia","projected 2D","","","East","North","E","N","9001","","4606","19942","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_9[] = {"207","St Vincent 45 / British West Indies Grid","St Vincent 45 / BWI Grid","","","Saint Vincent and the Grenadines","projected 2D","","","East","North","E","N","9001","","4607","19942","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_10[] = {"208","NAD27(CGQ77) / SCoPQ zone 2","CGQ77 / SCoPQ zone 2","","","Canada - Quebec - east of 57 deg East.","projected 2D","","","East","North","X","Y","9001","","4609","17700","1999-07-24 00:00:00","Geodetic Service of Quebec; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_11[] = {"209","NAD27(CGQ77) / SCoPQ zone 3","CGQ77 / SCoPQ zone 3","","","Canada - Quebec between 60 deg and 57 deg West.","projected 2D","","","East","North","X","Y","9001","","4609","17703","1999-07-24 00:00:00","Geodetic Service of Quebec; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_12[] = {"210","NAD27(CGQ77) / SCoPQ zone 4","CGQ77 / SCoPQ zone 4","","","Canada - Quebec between 63 deg and 60 deg West.","projected 2D","","","East","North","X","Y","9001","","4609","17704","1999-07-24 00:00:00","Geodetic Service of Quebec; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_13[] = {"211","NAD27(CGQ77) / SCoPQ zone 5","CGQ77 / SCoPQ zone 5","","","Canada - Quebec between 66 deg and 63 deg West.","projected 2D","","","East","North","X","Y","9001","","4609","17705","1999-07-24 00:00:00","Geodetic Service of Quebec; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_14[] = {"212","NAD27(CGQ77) / SCoPQ zone 6","CGQ77 / SCoPQ zone 6","","","Canada - Quebec between 69 deg and  66 deg West.","projected 2D","","","East","North","X","Y","9001","","4609","17706","1999-07-24 00:00:00","Geodetic Service of Quebec; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_15[] = {"213","NAD27(CGQ77) / SCoPQ zone 7","CGQ77 / SCoPQ zone 7","","","Canada - Quebec between 72 deg and 69 deg West.","projected 2D","","","East","North","X","Y","9001","","4609","17707","1999-07-24 00:00:00","Geodetic Service of Quebec; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_16[] = {"214","NAD27(CGQ77) / SCoPQ zone 8","CGQ77 / SCoPQ zone 8","","","Canada - Quebec between 75 deg and 72 deg West.","projected 2D","","","East","North","X","Y","9001","","4609","17708","1999-07-24 00:00:00","Geodetic Service of Quebec; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_17[] = {"215","NAD27(CGQ77) / SCoPQ zone 9","CGQ77 / SCoPQ zone 9","","","Canada - Quebec between 78 deg and 75 deg West.","projected 2D","","","East","North","X","Y","9001","","4609","17709","1999-07-24 00:00:00","Geodetic Service of Quebec; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_18[] = {"216","NAD27(CGQ77) / SCoPQ zone 10","CGQ77 / SCoPQ zone 10","","","Canada - Quebec west of 78 deg West.","projected 2D","","","East","North","X","Y","9001","","4609","17710","1999-07-24 00:00:00","Geodetic Service of Quebec; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_19[] = {"217","NAD27(76) / MTM zone 8","","","","Canada - Ontario - east of 75 deg West.","projected 2D","","","East","North","X","Y","9001","","4608","17708","1999-07-24 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_20[] = {"218","NAD27(76) / MTM zone 9","","","","Canada - Ontario - between 78 deg and 75 deg West.","projected 2D","","","East","North","X","Y","9001","","4608","17709","1999-07-24 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_21[] = {"219","NAD27(76) / MTM zone 10","","","","Canada - Ontario - between 79 deg 30 min and 78 deg W in area to north of 47 deg N; between 80 deg 15 min and 78 deg W in area between 46 deg and 47 deg N; between 81 deg and 78 deg W in area south of 46 deg N.","projected 2D","","","East","North","X","Y","9001","","4608","17710","1999-07-24 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_22[] = {"220","NAD27(76) / MTM zone 11","","","","Canada - Ontario - south of 46 deg N and west of 81 deg West.","projected 2D","","","East","North","E","N","9001","","4608","17711","1999-07-24 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_23[] = {"221","NAD27(76) / MTM zone 12","","","","Canada - Ontario - between 82 deg 30 min and 79 deg 30 min W in area to north of 47 deg N; between 82 deg 30 min and 80 deg 15 min W in area between 46 deg and 47 deg N; between 82 deg 30 min and 79 deg 30 min W in area north of 47 deg N.","projected 2D","","","East","North","E","N","9001","","4608","17712","1999-07-24 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_24[] = {"222","NAD27(76) / MTM zone 13","","","","Canada - Ontario - between 85 deg 30 min and 82 deg 30 min West and north of 46 deg North.","projected 2D","","","East","North","E","N","9001","","4608","17713","1999-07-24 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_25[] = {"223","NAD27(76) / MTM zone 14","","","","Canada - Ontario - between 88 deg 30 min and 85 deg 30 min West.","projected 2D","","","East","North","E","N","9001","","4608","17714","1999-07-24 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_26[] = {"224","NAD27(76) / MTM zone 15","","","","Canada - Ontario - between 91 deg 30 min and 88 deg 30 min West.","projected 2D","","","East","North","E","N","9001","","4608","17715","1999-07-24 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_27[] = {"225","NAD27(76) / MTM zone 16","","","","Canada - Ontario - between 94 deg 30 min and 91 deg 30 min West.","projected 2D","","","East","North","E","N","9001","","4608","17716","1999-07-24 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_28[] = {"226","NAD27(76) / MTM zone 17","","","","Canada - Ontario - west of 94 deg 30 min West.","projected 2D","","","East","North","E","N","9001","","4608","17717","1999-07-24 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_29[] = {"227","NAD27(76) / UTM zone 15N","","","","Canada - Ontario - 96deg West  to 90deg West.","projected 2D","","","East","North","E","N","9001","","4608","16015","1999-07-24 00:00:00","","EPSG","Supersedes NAD27 / UTM zone 15N (code 26715).","",NULL};
+datafile_rows_t horiz_cs_row_30[] = {"228","NAD27(76) / UTM zone 16N","","","","Canada - Ontario - 90deg West  to 84deg West.","projected 2D","","","East","North","E","N","9001","","4608","16016","1999-07-24 00:00:00","","EPSG","Supersedes NAD27 / UTM zone 16N (code 26716).","",NULL};
+datafile_rows_t horiz_cs_row_31[] = {"229","NAD27(76) / UTM zone 17N","","","","Canada - Ontario - 84deg West  to 78deg West.","projected 2D","","","East","North","E","N","9001","","4608","16017","1999-07-24 00:00:00","","EPSG","Supersedes NAD27 / UTM zone 17N (code 26717).","",NULL};
+datafile_rows_t horiz_cs_row_32[] = {"230","NAD27(76) / UTM zone 18N","","","","Canada - Ontario - east of 78 deg West.","projected 2D","","","East","North","E","N","9001","","4608","16018","1999-07-24 00:00:00","","EPSG","Supersedes NAD27 / UTM zone 18N (code 26718).","",NULL};
+datafile_rows_t horiz_cs_row_33[] = {"231","NAD27(CGQ77) / UTM zone 17N","CGQ77 / UTM zone 17N","","","Canada - Quebec - west of 78 deg West.","projected 2D","","","East","North","E","N","9001","","4609","16017","1999-07-24 00:00:00","","EPSG","Supersedes NAD27 / UTM zone 17N (code 26717).","",NULL};
+datafile_rows_t horiz_cs_row_34[] = {"232","NAD27(CGQ77) / UTM zone 18N","CGQ77 / UTM zone 18N","","","Canada - Quebec -78deg West  to 72deg West.","projected 2D","","","East","North","E","N","9001","","4609","16018","1999-07-24 00:00:00","","EPSG","Supersedes NAD27 / UTM zone 18N (code 26718).","",NULL};
+datafile_rows_t horiz_cs_row_35[] = {"233","NAD27(CGQ77) / UTM zone 19N","CGQ77 / UTM zone 19N","","","Canada - Quebec - 72deg West  to 66deg West.","projected 2D","","","East","North","E","N","9001","","4609","16019","1999-07-24 00:00:00","","EPSG","Supersedes NAD27 / UTM zone 19N (code 26719).","",NULL};
+datafile_rows_t horiz_cs_row_36[] = {"234","NAD27(CGQ77) / UTM zone 20N","CGQ77 / UTM zone 20N","","","Canada - Quebec - 66deg West  to 60deg West.","projected 2D","","","East","North","E","N","9001","","4609","16020","1999-07-24 00:00:00","","EPSG","Supersedes NAD27 / UTM zone 20N (code 26720).","",NULL};
+datafile_rows_t horiz_cs_row_37[] = {"235","NAD27(CGQ77) / UTM zone 21N","CGQ77 / UTM zone 21N","","","Canada - Quebec - east of 60deg West.","projected 2D","","","East","North","E","N","9001","","4609","16021","1999-07-24 00:00:00","","EPSG","Supersedes NAD27 / UTM zone 21N (code 26721).","",NULL};
+datafile_rows_t horiz_cs_row_38[] = {"236","NAD83(CSRS98) / New Brunswick Stereo","NAD83(98) / NB Stereo","","","Canada - New Brunswick","projected 2D","","","North","East","N","E","9001","","4140","19946","1999-10-20 00:00:00","Service New Brunswick Land and Information Standards Manual","EPSG","In use from 1999.","",NULL};
+datafile_rows_t horiz_cs_row_39[] = {"237","NAD83(CSRS98) / UTM zone 19N","NAD83(98) / UTM 19N","","","Canada - New Brunswick west of 66 deg West.","projected 2D","","","East","North","E","N","9001","","4140","16019","1999-10-20 00:00:00","Service New Brunswick Land and Information Standards Manual","EPSG","In use from 1999.","",NULL};
+datafile_rows_t horiz_cs_row_40[] = {"238","NAD83(CSRS98) / UTM zone 20N","NAD83(98) / UTM 20N","","","Canada - New Brunswick east of 66 deg West.","projected 2D","","","East","North","E","N","9001","","4140","16020","1999-10-20 00:00:00","Service New Brunswick Land and Information Standards Manual","EPSG","In use from 1999.","",NULL};
+datafile_rows_t horiz_cs_row_41[] = {"239","Israel / Israeli TM Grid","Israeli TM Grid","","","Israel.","projected 2D","","","East","North","E","N","9001","","4141","18204","1999-10-20 00:00:00","Survey of Israel.","EPSG","Supercedes Israeli CS Grid (EPSG code 28193).","",NULL};
+datafile_rows_t horiz_cs_row_42[] = {"240","Locodjo 1965 / UTM zone 30N","Locodjo 65 / UTM 30N","","","Cote D'Ivoire (Ivory Coast) east of 6 deg West.","projected 2D","","","East","North","E","N","9001","","4142","16030","1999-10-20 00:00:00","IGN Paris","EPSG","Superseded by Abidjan 87 / UTM 30N (EPSG code 241).","",NULL};
+datafile_rows_t horiz_cs_row_43[] = {"241","Abidjan 1987 / UTM zone 30N","Abidjan 87 / UTM 30N","","","Cote D'Ivoire (Ivory Coast) east of 6 deg West.","projected 2D","","","East","North","E","N","9001","","4143","16030","1999-10-20 00:00:00","IGN Paris","EPSG","Supersedes Locodjo 65 / UTM 30N (EPSG code 240).","",NULL};
+datafile_rows_t horiz_cs_row_44[] = {"242","Locodjo 1965 / UTM zone 29N","Locodjo 65 / UTM 29N","","","Cote D'Ivoire (Ivory Coast) west of 6 deg West.","projected 2D","","","East","North","E","N","9001","","4142","16029","1999-10-20 00:00:00","IGN Paris","EPSG","Superseded by Abidjan 87 / UTM 29N (EPSG code 243).","",NULL};
+datafile_rows_t horiz_cs_row_45[] = {"243","Abidjan 1987 / UTM zone 29N","Abidjan 87 / UTM 29N","","","Cote D'Ivoire (Ivory Coast) west of 6 deg West.","projected 2D","","","East","North","E","N","9001","","4143","16029","1999-10-20 00:00:00","IGN Paris","EPSG","Supersedes Locodjo 65 / UTM 29N (EPSG code 242).","",NULL};
+datafile_rows_t horiz_cs_row_46[] = {"244","Hanoi 1972 / Gauss-Kruger zone 18","Hanoi 72 / Gauss zone 18","","","Vietnam - west of 108 deg East.","projected 2D","","","North","East","X","Y","9001","","4147","16218","1999-10-20 00:00:00","","EPSG","Replaces use of Indian 1960 / UTM zone 48 after 1988.","",NULL};
+datafile_rows_t horiz_cs_row_47[] = {"245","Hanoi 1972 / Gauss-Kruger zone 19","Hanoi 72 / Gauss zone 19","","","Vietnam - east of 108 deg East.","projected 2D","","","North","East","X","Y","9001","","4147","16219","1999-10-20 00:00:00","","EPSG","Replaces use of Indian 1960 / UTM zone 48 after 1988.","",NULL};
+datafile_rows_t horiz_cs_row_48[] = {"246","Hartbeesthoek94 / Lo15","New S African CS zone 15","","","South Africa - Walvis Bay.","projected 2D","","","West","South","W","S","9001","","4148","17515","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_49[] = {"247","Hartbeesthoek94 / Lo17","New S African CS zone 17","","","South Africa - west of 18 deg East.","projected 2D","","","West","South","W","S","9001","","4148","17517","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_50[] = {"248","Hartbeesthoek94 / Lo19","New S African CS zone 19","","","South Africa - 18 to 20 deg East.","projected 2D","","","West","South","W","S","9001","","4148","17519","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_51[] = {"249","Hartbeesthoek94 / Lo21","New S African CS zone 21","","","South Africa - 20 to 22 deg East.","projected 2D","","","West","South","W","S","9001","","4148","17521","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_52[] = {"250","Hartbeesthoek94 / Lo23","New S African CS zone 23","","","South Africa - 22 to 24 deg East.","projected 2D","","","West","South","W","S","9001","","4148","17523","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_53[] = {"251","Hartbeesthoek94 / Lo25","New S African CS zone 25","","","Lestho  - west of 26 deg East; South Africa - 24 to 26 deg East.","projected 2D","","","West","South","W","S","9001","","4148","17525","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_54[] = {"252","Hartbeesthoek94 / Lo27","New S African CS zone 27","","","Lestho  - east of 26 deg East;  South Africa - 26 to 28 deg East.","projected 2D","","","West","South","W","S","9001","","4148","17527","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_55[] = {"253","Hartbeesthoek94 / Lo29","New S African CS zone 29","","","South Africa - 28 to 30 deg East.","projected 2D","","","West","South","W","S","9001","","4148","17529","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_56[] = {"254","Hartbeesthoek94 / Lo31","New S African CS zone 31","","","South Africa - 30 to 32 deg East;  Swaziland.","projected 2D","","","West","South","W","S","9001","","4148","17533","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_57[] = {"255","Hartbeesthoek94 / Lo33","New S African CS zone 33","","","South Africa - east of 32 deg East.","projected 2D","","","West","South","W","S","9001","","4148","17533","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_58[] = {"256","CH1903+ / LV95","LV95","","","Liechtenstein; Switzerland.","projected 2D","","","East","North","Y","X","9001","","4150","19950","1999-10-20 00:00:00","","EPSG","Supersedes CH1903/LV03 (code 21781).","",NULL};
+datafile_rows_t horiz_cs_row_59[] = {"257","Rassadiran / Nakhl e Taqi","","","","Iran - Taheri refinery site only.","projected 2D","","","East","North","E","N","9001","","4153","19951","1999-10-20 00:00:00","Total-Fina","EPSG","Used for terminal site only.","",NULL};
+datafile_rows_t horiz_cs_row_60[] = {"258","ED50(ED77) / UTM zone 38N","","","","Iran - west of 48deg East.","projected 2D","","","East","North","E","N","9001","","4154","16038","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_61[] = {"259","ED50(ED77) / UTM zone 39N","","","","Iran - 48deg to 54 deg East.","projected 2D","","","East","North","E","N","9001","","4154","16039","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_62[] = {"260","ED50(ED77) / UTM zone 40N","","","","Iran - 54deg to 60 deg East.","projected 2D","","","East","North","E","N","9001","","4154","16040","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_63[] = {"261","ED50(ED77) / UTM zone 41N","","","","Iran - east of 60deg East.","projected 2D","","","East","North","E","N","9001","","4154","16041","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_64[] = {"300","Madrid 1870 (Madrid) / Spain","","","","Spain","projected 2D","","","East","North","X","Y","9001","","4903","19921","1998-11-11 00:00:00","","EPSG","Superseded by ED50 / UTM after 1966.","",NULL};
+datafile_rows_t horiz_cs_row_65[] = {"2100","GGRS87 / Greek Grid","","","","Greece","projected 2D","","","East","North","E","N","9001","","4121","19930","1997-06-16 00:00:00","Geodesy Department; Public Petroleum Corporation of Greece.","EPSG","Oil industry uses ED50 / UTM zone 34N and ED50 / UTM zone 35N.","",NULL};
+datafile_rows_t horiz_cs_row_66[] = {"2200","ATS77 / New Brunswick Stereographic","ATS77 / NB Stereographic","","","Canada - New Brunswick","projected 2D","","","North","East","N","E","9001","","4122","19945","1999-10-20 00:00:00","New Brunswick Geographic Information Corporation land and water information standards manual.","EPSG","In use from 1979.  To be phased out in late 1990's.","99.61",NULL};
+datafile_rows_t horiz_cs_row_67[] = {"2219","ATS77 / UTM zone 19N","","","","Canada - New Brunswick - west of 66 deg W.","projected 2D","","","East","North","E","N","9001","","4122","16019","1997-07-22 00:00:00","New Brunswick Geographic Information Corporation land and water information standards manual.","EPSG","In use from 1979.  To be phased out in late 1990's.","",NULL};
+datafile_rows_t horiz_cs_row_68[] = {"2220","ATS77 / UTM zone 20N","","","","Canada - New Brunswick - east of 66 deg W.; Canada - Nova Scotia; Canada - Prince Edward Island.","projected 2D","","","East","North","E","N","9001","","4122","16020","1997-07-22 00:00:00","New Brunswick Geographic Information Corporation land and water information standards manual.","EPSG","In use from 1979.  To be phased out in late 1990's.","",NULL};
+datafile_rows_t horiz_cs_row_69[] = {"2290","ATS77 / Prince Edward Isl. Stereographic","ATS77 / PEI Stereo","","","Canada - Prince Edward Island","projected 2D","","","East","North","E(X)","N(Y)","9001","","4122","19933","1997-11-13 00:00:00","Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.","EPSG","In use from 1979.  To be phased out in late 1990's.","",NULL};
+datafile_rows_t horiz_cs_row_70[] = {"2294","ATS77 / MTM Nova Scotia zone 4","ATS77 / MTM NS zone 4","","","Canada - Nova Scotia - east of 63 deg West.","projected 2D","","","East","North","E","N","9001","","4122","17794","1997-11-13 00:00:00","Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.","EPSG","In use from 1979.  To be phased out in late 1990's.","",NULL};
+datafile_rows_t horiz_cs_row_71[] = {"2295","ATS77 / MTM Nova Scotia zone 5","ATS77 / MTM NS zone 5","","","Canada - Nova Scotia - west of 63 deg West.","projected 2D","","","East","North","E","N","9001","","4122","17795","1997-11-13 00:00:00","Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.","EPSG","In use from 1979.  To be phased out in late 1990's.","",NULL};
+datafile_rows_t horiz_cs_row_72[] = {"2391","KKJ / Finland zone 1","","","","Finland - west of 22deg 30min E.","projected 2D","","","North","East","X","Y","9001","","4123","18191","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_73[] = {"2392","KKJ / Finland zone 2","","","","Finland - 22deg 30 min to 25deg 30min E.","projected 2D","","","North","East","X","Y","9001","","4123","18192","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_74[] = {"2393","KKJ / Finland Uniform Coordinate System","KKJ / Finland zone 3","","","Finland; Finland - 25 deg 30min E to 28deg 30min E.","projected 2D","","","North","East","X","Y","9001","","4123","18193","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","Known as Uniform Coordinate System when used over all country and also as Basic Coordinate System zone 3 at larger scales.","",NULL};
+datafile_rows_t horiz_cs_row_75[] = {"2394","KKJ / Finland zone 4","","","","Finland - east of 28deg 30 min E.","projected 2D","","","North","East","X","Y","9001","","4123","18194","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_76[] = {"2400","RT90 2.5 gon W","","","","Sweden","projected 2D","","","North","East","X","Y","9001","","4124","19929","1997-11-13 00:00:00","National Land Survey of Sweden","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_77[] = {"2550","Samboja / UTM zone 50S","","","","Indonesia - east Kalimantan - Mahakam delta area.","projected 2D","","","East","North","E","N","9001","","4125","16150","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_78[] = {"2600","Lietuvos Koordinoei Sistema 1994","LKS94","","","Lithuania","projected 2D","","","North","East","X","Y","9001","","4126","19934","1998-03-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_79[] = {"2736","Tete / UTM zone 36S","","","","Mozambique - west of 36 deg E.","projected 2D","","","East","North","E","N","9001","","4127","16136","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_80[] = {"2737","Tete / UTM zone 37S","","","","Mozambique - east of 36 deg E","projected 2D","","","East","North","E","N","9001","","4127","16137","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_81[] = {"3036","Moznet / UTM zone 36S","","","","Mozambique - west of 36 deg E.","projected 2D","","","East","North","E","N","9001","","4130","16136","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_82[] = {"3037","Moznet / UTM zone 37S","","","","Mozambique - east of 36 deg E","projected 2D","","","East","North","E","N","9001","","4130","16137","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_83[] = {"3148","Indian 1960 / UTM zone 48N","","","","Cambodia; Vietnam west of 108deg East.","projected 2D","","","East","North","E","N","9001","","4131","16048","1998-11-11 00:00:00","","EPSG","In Vietnam superseded by Hanoi 72 / Gauss zone 18 from 1988 onwards.","",NULL};
+datafile_rows_t horiz_cs_row_84[] = {"3149","Indian 1960 / UTM zone 49N","","","","Vietnam east of 108deg East.","projected 2D","","","East","North","E","N","9001","","4131","16049","1998-11-11 00:00:00","","EPSG","Superseded by Hanoi 72 / Gauss zone 18 from 1988 onwards.","",NULL};
+datafile_rows_t horiz_cs_row_85[] = {"3176","Indian 1960 / TM 106 NE","","","","Vietnam - offshore.","projected 2D","","","East","North","E","N","9001","","4131","16506","1998-11-11 00:00:00","Petrovietnam","EPSG","Used by Petrovietnam for offshore block 15.","",NULL};
+datafile_rows_t horiz_cs_row_86[] = {"3200","FD58 / Iraq zone","","","","Iran - Gulf coast and Arwaz areas.","projected 2D","","","East","North","E","N","9001","","4132","19906","1998-11-11 00:00:00","IOEPC records.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_87[] = {"3300","Estonian Coordinate System of 1992","","","","Estonia.","projected 2D","","","North","East","X","Y","9001","","4133","19938","1998-12-14 00:00:00","http://www.geo.ut.ee/~raivo/estcoord.html","EPSG","Used for 1:20000 and larger scale mapping.","",NULL};
+datafile_rows_t horiz_cs_row_88[] = {"3439","PSD93 / UTM zone 39N","","","","Oman - west of 54 deg East.","projected 2D","","","East","North","E","N","9001","","4134","16039","1999-04-22 00:00:00","Petroleum Development Oman","EPSG","Supersedes Fahud / UTM zone 39N projCS (code 23239). Maximum differences to Fahud adjustment are 20 metres.","",NULL};
+datafile_rows_t horiz_cs_row_89[] = {"3440","PSD93 / UTM zone 40N","","","","Oman - east of 54 deg East.","projected 2D","","","East","North","E","N","9001","","4134","16040","1999-04-22 00:00:00","Petroleum Development Oman","EPSG","Supersedes Fahud / UTM zone 40N projCS (code 23240). Maximum differences to Fahud adjustment are 20 metres.","",NULL};
+datafile_rows_t horiz_cs_row_90[] = {"3561","Old Hawaiian / Hawaii zone 1","Old Hawaiian / SP zone 1","","","United States (USA) - Hawaii - island of Hawaii.","projected 2D","","","East","North","X","Y","9003","","4135","15101","1999-05-24 00:00:00","","EPSG","Sometimes erroneously referred to as NAD27 / Hawaii zone 1.","99.322",NULL};
+datafile_rows_t horiz_cs_row_91[] = {"3562","Old Hawaiian / Hawaii zone 2","Old Hawaiian / SP zone 2","","","United States (USA) - Hawaii - Maui; Kahoolawe; Lanai; Molokai.","projected 2D","","","East","North","X","Y","9003","","4135","15102","1999-05-24 00:00:00","","EPSG","Sometimes erroneously referred to as NAD27 / Hawaii zone 2.","99.322",NULL};
+datafile_rows_t horiz_cs_row_92[] = {"3563","Old Hawaiian / Hawaii zone 3","Old Hawaiian / SP zone 3","","","United States (USA) - Hawaii - Oahu.","projected 2D","","","East","North","X","Y","9003","","4135","15103","1999-05-24 00:00:00","","EPSG","Sometimes erroneously referred to as NAD27 / Hawaii zone 3.","99.322",NULL};
+datafile_rows_t horiz_cs_row_93[] = {"3564","Old Hawaiian / Hawaii zone 4","Old Hawaiian / SP zone 4","","","United States (USA) - Hawaii - Kauai.","projected 2D","","","East","North","X","Y","9003","","4135","15104","1999-05-24 00:00:00","","EPSG","Sometimes erroneously referred to as NAD27 / Hawaii zone 4.","99.322",NULL};
+datafile_rows_t horiz_cs_row_94[] = {"3565","Old Hawaiian / Hawaii zone 5","Old Hawaiian / SP zone 5","","","United States (USA) - Hawaii - Niihau.","projected 2D","","","East","North","X","Y","9003","","4135","15105","1999-05-24 00:00:00","","EPSG","Sometimes erroneously referred to as NAD27 / Hawaii zone 5.","99.322",NULL};
+datafile_rows_t horiz_cs_row_95[] = {"3920","Puerto Rico / UTM zone 20N","","","","British Virgin Islands (civilian).","projected 2D","","","East","North","E","N","9001","","4139","16020","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","NAD27 / UTM zone 20 N (code 26720) used for military purposes.","",NULL};
+datafile_rows_t horiz_cs_row_96[] = {"3991","Puerto Rico State Plane CS of 1927","Puerto Rico SPCS 27","","","Puerto Rico.","projected 2D","","","East","North","X","Y","9003","","4139","15201","1999-05-24 00:00:00","","EPSG","Sometimes erroneously referred to as NAD27 / Puerto Rico State Plane CS.","99.323",NULL};
+datafile_rows_t horiz_cs_row_97[] = {"3992","Puerto Rico / St. Croix","","","","US Virgin Islands (U.S.).","projected 2D","","","East","North","X","Y","9003","","4139","15202","1999-05-24 00:00:00","","EPSG","Sometimes erroneously referred to as NAD27 / St. Croix State Plane CS.","99.323",NULL};
+datafile_rows_t horiz_cs_row_98[] = {"4001","Unknown datum based upon ellipsoid 7001","","","","","geographic 2D","6001","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_99[] = {"4002","Unknown datum based upon ellipsoid 7002","","","","","geographic 2D","6002","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_100[] = {"4003","Unknown datum based upon ellipsoid 7003","","","","","geographic 2D","6003","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_101[] = {"4004","Unknown datum based upon ellipsoid 7004","","","","","geographic 2D","6004","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_102[] = {"4005","Unknown datum based upon ellipsoid 7005","","","","","geographic 2D","6005","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_103[] = {"4006","Unknown datum based upon ellipsoid 7006","","","","","geographic 2D","6006","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_104[] = {"4007","Unknown datum based upon ellipsoid 7007","","","","","geographic 2D","6007","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_105[] = {"4008","Unknown datum based upon ellipsoid 7008","","","","","geographic 2D","6008","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_106[] = {"4009","Unknown datum based upon ellipsoid 7009","","","","","geographic 2D","6009","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_107[] = {"4010","Unknown datum based upon ellipsoid 7010","","","","","geographic 2D","6010","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_108[] = {"4011","Unknown datum based upon ellipsoid 7011","","","","","geographic 2D","6011","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_109[] = {"4012","Unknown datum based upon ellipsoid 7012","","","","","geographic 2D","6012","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_110[] = {"4013","Unknown datum based upon ellipsoid 7013","","","","","geographic 2D","6013","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_111[] = {"4014","Unknown datum based upon ellipsoid 7014","","","","","geographic 2D","6014","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_112[] = {"4015","Unknown datum based upon ellipsoid 7015","","","","","geographic 2D","6015","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_113[] = {"4016","Unknown datum based upon ellipsoid 7016","","","","","geographic 2D","6016","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_114[] = {"4017","Unknown datum based upon ellipsoid 7017","","","","","geographic 2D","6017","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_115[] = {"4018","Unknown datum based upon ellipsoid 7018","","","","","geographic 2D","6018","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_116[] = {"4019","Unknown datum based upon ellipsoid 7019","","","","","geographic 2D","6019","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_117[] = {"4020","Unknown datum based upon ellipsoid 7020","","","","","geographic 2D","6020","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_118[] = {"4021","Unknown datum based upon ellipsoid 7021","","","","","geographic 2D","6021","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_119[] = {"4022","Unknown datum based upon ellipsoid 7022","","","","","geographic 2D","6022","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_120[] = {"4024","Unknown datum based upon ellipsoid 7024","","","","","geographic 2D","6024","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_121[] = {"4025","Unknown datum based upon ellipsoid 7025","","","","","geographic 2D","6025","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_122[] = {"4027","Unknown datum based upon ellipsoid 7027","","","","","geographic 2D","6027","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_123[] = {"4028","Unknown datum based upon ellipsoid 7028","","","","","geographic 2D","6028","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_124[] = {"4029","Unknown datum based upon ellipsoid 7029","","","","","geographic 2D","6029","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_125[] = {"4030","Unknown datum based upon ellipsoid 7030","","","","","geographic 2D","6030","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_126[] = {"4031","Unknown datum based upon ellipsoid 7031","","","","","geographic 2D","6031","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_127[] = {"4032","Unknown datum based upon ellipsoid 7032","","","","","geographic 2D","6032","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_128[] = {"4033","Unknown datum based upon ellipsoid 7033","","","","","geographic 2D","6033","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_129[] = {"4034","Unknown datum based upon ellipsoid 7034","","","","","geographic 2D","6034","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_130[] = {"4035","Unknown datum based upon ellipsoid 7035","","","","","geographic 2D","6035","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","96.08",NULL};
+datafile_rows_t horiz_cs_row_131[] = {"4036","Unknown datum based upon ellipsoid 7036","","","","","geographic 2D","6036","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","",NULL};
+datafile_rows_t horiz_cs_row_132[] = {"4041","Unknown datum based upon ellipsoid 7041","","","","","geographic 2D","6041","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","",NULL};
+datafile_rows_t horiz_cs_row_133[] = {"4042","Unknown datum based upon ellipsoid 7042","","","","","geographic 2D","6042","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","",NULL};
+datafile_rows_t horiz_cs_row_134[] = {"4043","Unknown datum based upon ellipsoid 7043","","","","","geographic 2D","6043","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","",NULL};
+datafile_rows_t horiz_cs_row_135[] = {"4044","Unknown datum based upon ellipsoid 7044","","","","","geographic 2D","6044","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","",NULL};
+datafile_rows_t horiz_cs_row_136[] = {"4045","Unknown datum based upon ellipsoid 7045","","","","","geographic 2D","6045","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","Not recommended.  Use only in cases where geodetic datum unknown.","",NULL};
+datafile_rows_t horiz_cs_row_137[] = {"4120","Greek","","","","Greece","geographic 2D","6120","8901","North","East","Lat","Long","","9108","","","1997-06-16 00:00:00","Topography Department; National Technical University of Greece.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_138[] = {"4121","GGRS87","","","","Greece","geographic 2D","6121","8901","North","East","Lat","Long","","9108","","","1997-06-16 00:00:00","Geodesy Department; Public Petroleum Corporation of Greece.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_139[] = {"4122","ATS77","","","","Canada - New Brunswick; Canada - Nova Scotia - onshore; Canada - Prince Edward Island.","geographic 2D","6122","8901","North","East","Lat","Long","","9108","","","1997-07-22 00:00:00","New Brunswick Geographic Information Corporation land and water information standards manual.","EPSG","In use from 1979.  To be phased out in late 1990's.","",NULL};
+datafile_rows_t horiz_cs_row_140[] = {"4123","KKJ","","","","Finland","geographic 2D","6123","8901","North","East","Lat","Long","","9108","","","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_141[] = {"4124","RT90","","","","Sweden","geographic 2D","6124","8901","North","East","Lat","Long","","9108","","","1997-11-13 00:00:00","National Land Survey of Sweden","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_142[] = {"4125","Samboja","","","","Indonesia - east Kalimantan - Mahakam delta area.","geographic 2D","6125","8901","North","East","Lat","Long","","9108","","","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_143[] = {"4126","LKS94 (ETRS89)","","","","Lithuania","geographic 2D","6126","8901","North","East","Lat","Long","","9108","","","1998-03-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_144[] = {"4127","Tete","","","","Mozambique","geographic 2D","6127","8901","North","East","Lat","Long","","9108","","","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_145[] = {"4128","Madzansua","","","","Mozambique - west","geographic 2D","6128","8901","North","East","Lat","Long","","9108","","","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","Superseded by values transformed to Tete geogCS (code 4127).","",NULL};
+datafile_rows_t horiz_cs_row_146[] = {"4129","Observatario","","","","Mozambique - south","geographic 2D","6129","8901","North","East","Lat","Long","","9108","","","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","Superseded by values transformed to Tete geogCS (code 4127).","",NULL};
+datafile_rows_t horiz_cs_row_147[] = {"4130","Moznet","","","","Mozambique","geographic 2D","6130","8901","North","East","Lat","Long","","9108","","","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_148[] = {"4131","Indian 1960","","","","Cambodia; Vietnam","geographic 2D","6131","8901","North","East","Lat","Long","","9108","","","1998-11-11 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_149[] = {"4132","FD58","","","","Iran - Gulf coast and Arwaz areas.","geographic 2D","6132","8901","North","East","Lat","Long","","9108","","","1998-11-11 00:00:00","IOEPC records.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_150[] = {"4133","EST92","","","","Estonia","geographic 2D","6133","8901","North","East","Lat","Long","","9108","","","1998-12-14 00:00:00","http://www.geo.ut.ee/~raivo/estcoord.html","EPSG","Densification of ETRS89 as established during 1992 Baltic campaign.","",NULL};
+datafile_rows_t horiz_cs_row_151[] = {"4134","PDO Survey Datum 1993","PSD93","","","Oman","geographic 2D","6134","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","Petroleum Development Oman","EPSG","Supersedes Fahud geogCS (code 4232). Maximum differences to Fahud adjustment are 20 metres.","",NULL};
+datafile_rows_t horiz_cs_row_152[] = {"4135","Old Hawaiian","","","","United States (USA) - Hawaii","geographic 2D","6135","8901","North","East","Lat","Long","","9108","","","1999-05-24 00:00:00","","EPSG","Note: this coordinate system includes longitudes which are POSITIVE EAST.","",NULL};
+datafile_rows_t horiz_cs_row_153[] = {"4136","St. Lawrence Island","","","","United States (USA) - Alaska - St. Lawrence Island","geographic 2D","6136","8901","North","East","Lat","Long","","9108","","","1999-05-24 00:00:00","","EPSG","Note: this coordinate system includes longitudes which are POSITIVE EAST.","",NULL};
+datafile_rows_t horiz_cs_row_154[] = {"4137","St. Paul Island","","","","United States (USA) - Alaska - St. Paul Island","geographic 2D","6137","8901","North","East","Lat","Long","","9108","","","1999-05-24 00:00:00","","EPSG","Note: this coordinate system includes longitudes which are POSITIVE EAST.","",NULL};
+datafile_rows_t horiz_cs_row_155[] = {"4138","St. George Island","","","","United States (USA) - Alaska - St. George Island","geographic 2D","6138","8901","North","East","Lat","Long","","9108","","","1999-05-24 00:00:00","","EPSG","Note: this coordinate system includes longitudes which are POSITIVE EAST.","",NULL};
+datafile_rows_t horiz_cs_row_156[] = {"4139","Puerto Rico","","","","Puerto Rico; Virgin Islands (British); Virgin Islands (U.S.).","geographic 2D","6139","8901","North","East","Lat","Long","","9108","","","1999-05-24 00:00:00","","EPSG","Used for civilian purposes.  NAD27 (code 4267) used for military purposes.  Note: this coordinate system includes longitudes which are POSITIVE EAST.","",NULL};
+datafile_rows_t horiz_cs_row_157[] = {"4140","NAD83(CSRS98)","","","","Canada - New Brunswick","geographic 2D","6140","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","Service New Brunswick Land and Information Standards Manual","EPSG","Supersedes ATS77 from 1999 in New Brunswick.","",NULL};
+datafile_rows_t horiz_cs_row_158[] = {"4141","Israel","","","","Israel.","geographic 2D","6141","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","Survey of Israel","EPSG","Supersedes Palestine 1923 in Israel.","",NULL};
+datafile_rows_t horiz_cs_row_159[] = {"4142","Locodjo 1965","","","","Cote D'Ivoire (Ivory Coast).","geographic 2D","6142","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","IGN Paris","EPSG","Superseded by Abidjan 1987 (EPSG code 4143).","",NULL};
+datafile_rows_t horiz_cs_row_160[] = {"4143","Abidjan 1987","","","","Cote D'Ivoire (Ivory Coast).","geographic 2D","6143","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","IGN Paris","EPSG","Supersedes Locodjo 1967 (EPSG code 4142).","",NULL};
+datafile_rows_t horiz_cs_row_161[] = {"4144","Kalianpur 1937","","","","Bangladesh; India; Pakistan","geographic 2D","6144","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.","EPSG","Adopts 1937 metric conversion of 0.30479841 metres per Indian foot.","",NULL};
+datafile_rows_t horiz_cs_row_162[] = {"4145","Kalianpur 1962","","","","Pakistan","geographic 2D","6145","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","Adopts 1962 metric conversion of 0.3047996 metres per Indian foot.","",NULL};
+datafile_rows_t horiz_cs_row_163[] = {"4146","Kalianpur 1975","","","","India","geographic 2D","6146","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","Adopts 1975 metric conversion of 0.3047995 metres per Indian foot.","",NULL};
+datafile_rows_t horiz_cs_row_164[] = {"4147","Hanoi 1972","","","","Vietnam","geographic 2D","6147","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_165[] = {"4148","Hartbeesthoek94","","","","South Africa.","geographic 2D","6148","8901","North","East","Lat","Long","","9108","","","1999-10-22 00:00:00","","EPSG","Supercedes Cape (code 4222) from 1999.","",NULL};
+datafile_rows_t horiz_cs_row_166[] = {"4149","CH1903","","","","Liechtenstein; Switzerland","geographic 2D","6149","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_167[] = {"4150","CH1903+","","","","Liechtenstein; Switzerland","geographic 2D","6150","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_168[] = {"4151","CHTRF95","","","","Liechtenstein; Switzerland","geographic 2D","6151","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_169[] = {"4152","NAD83(HARN)","","","","United States (US)","geographic 2D","6152","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","National Geodetic Survey","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_170[] = {"4153","Rassadiran","","","","Iran - Taheri refinery site only.","geographic 2D","6153","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","Used only for onshore terminal site.","",NULL};
+datafile_rows_t horiz_cs_row_171[] = {"4154","ED50(ED77)","","","","Iran","geographic 2D","6154","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_172[] = {"4200","Pulkovo 1995","","","","Russia","geographic 2D","6200","8901","North","East","Lat","Long","","9108","","","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_173[] = {"4201","Adindan","","","","Ethiopia; Sudan","geographic 2D","6201","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_174[] = {"4202","AGD66","","","","Australia; Papua New Guinea","geographic 2D","6202","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_175[] = {"4203","AGD84","","","","Australia","geographic 2D","6203","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_176[] = {"4204","Ain el Abd","","","","Kuwait; Saudi Arabia","geographic 2D","6204","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_177[] = {"4205","Afgooye","","","","Somalia","geographic 2D","6205","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_178[] = {"4206","Agadez","","","","Niger","geographic 2D","6206","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_179[] = {"4207","Lisbon","","","","Portugal - onshore","geographic 2D","6207","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","Instituto Geografico e Cadastral; Lisbon","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_180[] = {"4208","Aratu","","","","Brazil - coastal areas south of 2 deg 55 min S.","geographic 2D","6208","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_181[] = {"4209","Arc 1950","","","","Botswana; Malawi; Zambia; Zimbabwe.","geographic 2D","6209","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_182[] = {"4210","Arc 1960","","","","Kenya; Tanzania; Uganda.","geographic 2D","6210","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_183[] = {"4211","Batavia","","","","Indonesia - Java","geographic 2D","6211","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_184[] = {"4212","Barbados 1938","","","","Barbados","geographic 2D","6212","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","","EPSG","","99.171",NULL};
+datafile_rows_t horiz_cs_row_185[] = {"4213","Beduaram","","","","Niger","geographic 2D","6213","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_186[] = {"4214","Beijing 1954","","","","China","geographic 2D","6214","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_187[] = {"4215","Belge 1950","","","","Belgium - onshore","geographic 2D","6215","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_188[] = {"4216","Bermuda 1957","","","","Bermuda","geographic 2D","6216","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_189[] = {"4218","Bogota","","","","Colombia","geographic 2D","6218","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_190[] = {"4219","Bukit Rimpah","","","","Indonesia - Banga & Belitung Islands","geographic 2D","6219","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_191[] = {"4220","Camacupa","","","","Angola","geographic 2D","6220","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_192[] = {"4221","Campo Inchauspe","","","","Argentina","geographic 2D","6221","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_193[] = {"4222","Cape","","","","Botswana; South Africa.","geographic 2D","6222","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","Superceded by Hartbeesthoek94 from 1999.","",NULL};
+datafile_rows_t horiz_cs_row_194[] = {"4223","Carthage","","","","Tunisia","geographic 2D","6223","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_195[] = {"4224","Chua","","","","Brazil","geographic 2D","6224","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_196[] = {"4225","Corrego Alegre","","","","Brazil - NE coastal area between 45 deg W and 40 deg W.","geographic 2D","6225","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_197[] = {"4226","Cote d'Ivoire","","","","Cote d'Ivoire","geographic 2D","6226","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_198[] = {"4227","Deir ez Zor","","","","Syrian Arab Republic","geographic 2D","6227","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_199[] = {"4228","Douala","","","","Cameroon","geographic 2D","6228","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_200[] = {"4229","Egypt 1907","","","","Egypt","geographic 2D","6229","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_201[] = {"4230","ED50","","","","Europe - west - Spain; France offshore; United Kingdom UKCS offshore; Netherlands offshore; Germany offshore North Sea; Denmark; Norway; Turkey.","geographic 2D","6230","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_202[] = {"4231","ED87","","","","Europe - west.","geographic 2D","6231","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_203[] = {"4232","Fahud","","","","Oman","geographic 2D","6232","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","Since 1993 superseded by PSD93 geogCS (code 4134). Maximum differences to Fahud adjustment are 20 metres.","",NULL};
+datafile_rows_t horiz_cs_row_204[] = {"4233","Gandajika 1970","","","","Maldives","geographic 2D","6233","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_205[] = {"4234","Garoua","","","","Cameroon","geographic 2D","6234","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_206[] = {"4235","Guyane Francaise","","","","French Guyana","geographic 2D","6235","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_207[] = {"4236","Hu Tzu Shan","","","","Taiwan","geographic 2D","6236","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_208[] = {"4237","HD72","","","","Hungary","geographic 2D","6237","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_209[] = {"4238","ID74","","","","Indonesia","geographic 2D","6238","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_210[] = {"4239","Indian 1954","","","","Myanmar (Burma); Thailand","geographic 2D","6239","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_211[] = {"4240","Indian 1975","","","","Thailand","geographic 2D","6240","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_212[] = {"4241","Jamaica 1875","","","","Jamaica","geographic 2D","6241","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_213[] = {"4242","JAD69","","","","Jamaica","geographic 2D","6242","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_214[] = {"4243","Kalianpur 1880","","","","Bangladesh; India; Myanmar (Burma); Pakistan","geographic 2D","6243","8901","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.","EPSG","","97.23",NULL};
+datafile_rows_t horiz_cs_row_215[] = {"4244","Kandawala","","","","Sri Lanka","geographic 2D","6244","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_216[] = {"4245","Kertau","","","","Malaysia - West Malaysia; Singapore","geographic 2D","6245","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","Adopts metric conversion of 39.370113 inches per metre.","",NULL};
+datafile_rows_t horiz_cs_row_217[] = {"4246","KOC","","","","Kuwait","geographic 2D","6246","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_218[] = {"4247","La Canoa","","","","Venezuela","geographic 2D","6247","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","PSAD56 uses same origin.","",NULL};
+datafile_rows_t horiz_cs_row_219[] = {"4248","PSAD56","","","","Bolivia; Ecuador; Peru; [Venezuela]","geographic 2D","6248","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","Origin is same as La Canoa.  In Venezuela known as La Canoa.","",NULL};
+datafile_rows_t horiz_cs_row_220[] = {"4249","Lake","","","","Venezuela - Lake Maracaibo area","geographic 2D","6249","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_221[] = {"4250","Leigon","","","","Ghana","geographic 2D","6250","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_222[] = {"4251","Liberia 1964","","","","Liberia","geographic 2D","6251","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_223[] = {"4252","Lome","","","","Togo","geographic 2D","6252","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_224[] = {"4253","Luzon 1911","","","","Philippines","geographic 2D","6253","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_225[] = {"4254","Hito XVIII 1963","","","","Chile - Tierra del Fuego","geographic 2D","6254","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_226[] = {"4255","Herat North","","","","Afghanistan","geographic 2D","6255","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_227[] = {"4256","Mahe 1971","","","","Seychelles","geographic 2D","6256","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_228[] = {"4257","Makassar","","","","Indonesia - south west Sulawesi","geographic 2D","6257","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_229[] = {"4258","ETRF89","","","","Europe - Hungary; Norway; Sweden; United Kingdom (UKCS) offshore.","geographic 2D","6258","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","Norwegian Geodetic Institute geodetic publication 1990:1","EPSG","","97.11  99.11",NULL};
+datafile_rows_t horiz_cs_row_230[] = {"4259","Malongo 1987","","","","Angola - Cabinda offshore","geographic 2D","6259","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","Chevron Petroleum Technology","EPSG","Offshore extension of Mhast GeogCS (4264) using Transit translocation from Station Y at Malongo base camp.","",NULL};
+datafile_rows_t horiz_cs_row_231[] = {"4260","Manoca","","","","Cameroon","geographic 2D","6260","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_232[] = {"4261","Merchich","","","","Morocco","geographic 2D","6261","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_233[] = {"4262","Massawa","","","","Eritrea","geographic 2D","6262","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_234[] = {"4263","Minna","","","","Nigeria","geographic 2D","6263","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_235[] = {"4264","Mhast","","","","Angola - Cabinda","geographic 2D","6264","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_236[] = {"4265","Monte Mario","","","","Italy","geographic 2D","6265","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_237[] = {"4266","M'poraloko","","","","Gabon","geographic 2D","6266","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_238[] = {"4267","NAD27","","","","North and central America - Canada; Mexico; United States (USA).","geographic 2D","6267","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","Note: this coordinate system includes longitudes which are POSITIVE EAST.  Superseded by NAD27(76) (code 4608) in Ontario and CGQ77 (code 4609) in Quebec.","99.04",NULL};
+datafile_rows_t horiz_cs_row_239[] = {"4268","NAD27 Michigan","NAD Michigan","","","United States (USA) - Michigan","geographic 2D","6268","8901","North","East","Lat","Long","","9108","","","1996-12-12 00:00:00","","EPSG","Ellipsoid taken to be 800ft above geoid. Note: this coordinate system includes longitudes which are POSITIVE EAST.","96.28",NULL};
+datafile_rows_t horiz_cs_row_240[] = {"4269","NAD83","","","","Canada: Greenland; Mexico; United States (USA)","geographic 2D","6269","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","Note: this coordinate system includes longitudes which are POSITIVE EAST.","",NULL};
+datafile_rows_t horiz_cs_row_241[] = {"4270","Nahrwan 1967","","","","Arabian Gulf; Kuwait; United Arab Emirates (UAE) - Abu Dhabi; Dubai; Sharjah; Ajman; Fujairah; Ras Al Kaimah; Umm Al Qaiwain.","geographic 2D","6270","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_242[] = {"4271","Naparima 1972","","","","Trinidad and Tobago","geographic 2D","6271","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_243[] = {"4272","GD49","","","","New Zealand","geographic 2D","6272","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_244[] = {"4273","NGO 1948","","","","Norway - onshore","geographic 2D","6273","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_245[] = {"4274","Datum 73","","","","Portugal - onshore","geographic 2D","6274","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","Instituto Geografico e Cadastral; Lisbon","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_246[] = {"4275","NTF","","","","France - onshore","geographic 2D","6275","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_247[] = {"4276","NSWC 9Z-2","","","","World","geographic 2D","6276","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_248[] = {"4277","OSGB 1936","","","","United Kingdom (UK) - Great Britain - England  Scotland  Wales - onshore; Isle of Man.","geographic 2D","6277","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_249[] = {"4278","OSGB70","","","","United Kingdom (UK) - Great Britain - England  Scotland  wales - onshore","geographic 2D","6278","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_250[] = {"4279","OS(SN)80","","","","Ireland - onshore; United Kingdom (UK) - England  Scotland  Wales  Northern Ireland - onshore E","geographic 2D","6279","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_251[] = {"4280","Padang","","","","Indonesia - Sumatra","geographic 2D","6280","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_252[] = {"4281","Palestine 1923","","","","Israel; Jordan; Lebanon","geographic 2D","6281","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_253[] = {"4282","Pointe Noire","","","","Congo","geographic 2D","6282","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_254[] = {"4283","GDA94","","","","Australia","geographic 2D","6283","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_255[] = {"4284","Pulkovo 1942","","","","Armenia; Azerbaijan; Belarus; Estonia; Georgia; Kazakstan; Kirgistan; Latvia; Lithuania; Moldova; Russia; Tadzhikstan; Turkmenistan; Ukraine; Uzbekistan; Germany (former DDR); Czech Republic; Hungary; Poland; Romania; Latvia; Lithuania; Estonia; Albania","geographic 2D","6284","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_256[] = {"4285","Qatar","","","","Qatar - onshore","geographic 2D","6285","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_257[] = {"4286","Qatar 1948","","","","Qatar - onshore","geographic 2D","6286","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_258[] = {"4287","Qornoq","","","","Greenland","geographic 2D","6287","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_259[] = {"4288","Loma Quintana","","","","Venezuela - north","geographic 2D","6288","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_260[] = {"4289","Amersfoort","","","","Netherlands - onshore","geographic 2D","6289","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_261[] = {"4291","SAD69","","","","South America - Brazil","geographic 2D","6291","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.251.  Error introduced if not using the truncated precision is 0 to 31mm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_262[] = {"4292","Sapper Hill 1943","","","","Falkland Islands","geographic 2D","6292","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_263[] = {"4293","Schwarzeck","","","","Namibia","geographic 2D","6293","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_264[] = {"4294","Segora","","","","Indonesia - southeast Kalimantan","geographic 2D","6294","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_265[] = {"4295","Serindung","","","","Indonesia - east Kalimantan","geographic 2D","6295","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_266[] = {"4296","Sudan","","","","Sudan - south","geographic 2D","6296","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_267[] = {"4297","Tananarive","","","","Madagascar","geographic 2D","6297","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_268[] = {"4298","Timbalai 1948","","","","Brunei; Malaysia - East Malaysia (Sabah; Sarawak).","geographic 2D","6298","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","Adopts metric conversion of 39.370147 inches per metre.","",NULL};
+datafile_rows_t horiz_cs_row_269[] = {"4299","TM65","","","","Ireland - onshore; United Kingdom (UK) - Northern Ireland (Ulster) onshore","geographic 2D","6299","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_270[] = {"4300","TM75","","","","Ireland - onshore; United Kingdom (UK) - Northern Ireland (Ulster) onshore","geographic 2D","6300","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_271[] = {"4301","Tokyo","","","","Japan; North Korea; South Korea","geographic 2D","6301","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_272[] = {"4302","Trinidad 1903","","","","Trinidad and Tobago - Trinidad","geographic 2D","6302","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_273[] = {"4303","TC(1948)","","","","United Arab Emirates (UAE) - Abu Dhabi; Dubai","geographic 2D","6303","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_274[] = {"4304","Voirol 1875","","","","Algeria - north of 32 deg N","geographic 2D","6304","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","IGN Paris","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_275[] = {"4305","Voirol Unifie","","","","Algeria - north of 32 deg N","geographic 2D","6305","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","\"Le System Geodesique Nord-Sahara\"; IGN Paris","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_276[] = {"4306","Bern 1938","","","","Liechtenstein; Switzerland","geographic 2D","6306","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","Used for the geographic coordinates overprinted on topographic maps constructed on the CH1903 / LV03 projected CS (code 21781).","",NULL};
+datafile_rows_t horiz_cs_row_277[] = {"4307","Nord Sahara 1959","","","","Algeria; Morocco; Tunisia","geographic 2D","6307","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","\"Le System Geodesique Nord-Sahara\"; IGN Paris","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_278[] = {"4308","RT38","","","","Sweden","geographic 2D","6308","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","97.09",NULL};
+datafile_rows_t horiz_cs_row_279[] = {"4309","Yacare","","","","Uruguay","geographic 2D","6309","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_280[] = {"4310","Yoff","","","","Senegal","geographic 2D","6310","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_281[] = {"4311","Zanderij","","","","Suriname","geographic 2D","6311","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_282[] = {"4312","MGI","","","","Austria; Yugoslavia","geographic 2D","6312","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","Bundesamt fur Eich- und Vermessungswesen; Wien","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_283[] = {"4313","Belge 1972","","","","Belgium - onshore","geographic 2D","6313","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_284[] = {"4314","DHDN","","","","Germany - onshore","geographic 2D","6314","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_285[] = {"4315","Conakry 1905","","","","Guinea","geographic 2D","6315","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_286[] = {"4316","Dealul Piscului 1933","","","","Romania","geographic 2D","6316","8901","North","East","Lat","Long","","9108","","","1996-04-12 00:00:00","","EPSG","Superseded by 1970 system (geogCS code 4317).","",NULL};
+datafile_rows_t horiz_cs_row_287[] = {"4317","Dealul Piscului 1970","","","","Romania","geographic 2D","6317","8901","North","East","Lat","Long","","9108","","","1996-04-12 00:00:00","","EPSG","Supersedes 1933 system (geogCS code 4316).","",NULL};
+datafile_rows_t horiz_cs_row_288[] = {"4318","NGN","","","","Kuwait","geographic 2D","6318","8901","North","East","Lat","Long","","9108","","","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_289[] = {"4319","KUDAMS","","","","Kuwait - Kuwait City","geographic 2D","6319","8901","North","East","Lat","Long","","9108","","","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_290[] = {"4322","WGS 72","","","","World","geographic 2D","6322","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","GeogCS code 4323 reserved for use with  ProjCS's.","",NULL};
+datafile_rows_t horiz_cs_row_291[] = {"4324","WGS 72BE","","","","World","geographic 2D","6324","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","GeogCS code 4325 reserved for use with  ProjCS's.","",NULL};
+datafile_rows_t horiz_cs_row_292[] = {"4326","WGS 84","","","","World","geographic 2D","6326","8901","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","GeogCS code 4327 reserved for use with  ProjCS's.","",NULL};
+datafile_rows_t horiz_cs_row_293[] = {"4600","Anguilla 1957","","","","Anguilla","geographic 2D","6600","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_294[] = {"4601","Antigua 1943","","","","Antigua and Barbuda - Antigua","geographic 2D","6601","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_295[] = {"4602","Dominica 1945","","","","Dominica","geographic 2D","6602","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_296[] = {"4603","Grenada 1953","","","","Grenada (including Grenada Grenadines)","geographic 2D","6603","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_297[] = {"4604","Montserrat 1958","","","","Montserrat","geographic 2D","6604","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_298[] = {"4605","St. Kitts 1955","","","","Saint Kitts and Nevis","geographic 2D","6605","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_299[] = {"4606","St. Lucia 1955","","","","Saint Lucia","geographic 2D","6606","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_300[] = {"4607","St. Vincent 1945","","","","Saint Vincent and the Grenadines","geographic 2D","6607","8901","North","East","Lat","Long","","9108","","","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_301[] = {"4608","NAD27(76)","","","","Canada - Ontario","geographic 2D","6608","8901","North","East","Lat","Long","","9108","","","1999-05-12 00:00:00","","EPSG","Note: this coordinate system includes longitudes which are POSITIVE EAST.","",NULL};
+datafile_rows_t horiz_cs_row_302[] = {"4609","NAD27(CGQ77)","CGQ77","","","Canada - Quebec","geographic 2D","6609","8901","North","East","Lat","Long","","9108","","","1999-05-12 00:00:00","","EPSG","Note: this coordinate system includes longitudes which are POSITIVE EAST.","",NULL};
+datafile_rows_t horiz_cs_row_303[] = {"4801","Bern 1898 (Bern)","","","","Liechtenstein; Switzerland","geographic 2D","6149","8907","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_304[] = {"4802","Bogota (Bogota)","","","","Colombia","geographic 2D","6218","8904","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_305[] = {"4803","Lisbon (Lisbon)","","","","Portugal - onshore","geographic 2D","6207","8902","North","East","Lat","Long","","9108","","","1997-04-11 00:00:00","Instituto Geografico e Cadastral; Lisbon","EPSG","","97.12",NULL};
+datafile_rows_t horiz_cs_row_306[] = {"4804","Makassar (Jakarta)","","","","Indonesia - south west Sulawesi","geographic 2D","6257","8908","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_307[] = {"4805","MGI (Ferro)","","","","Austria; Yugoslavia","geographic 2D","6312","8909","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","Bundesamt fur Eich- und Vermessungswesen; Wien","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_308[] = {"4806","Monte Mario (Rome)","","","","Italy","geographic 2D","6265","8906","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_309[] = {"4807","NTF (Paris)","","","","France - onshore","geographic 2D","6275","8903","North","East","Lat","Long","","9105","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_310[] = {"4808","Padang (Jakarta)","","","","Indonesia - Sumatra","geographic 2D","6280","8908","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_311[] = {"4809","Belge 1950 (Brussels)","","","","Belgium - onshore","geographic 2D","6215","8910","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_312[] = {"4810","Tananarive (Paris)","","","","Madagascar","geographic 2D","6297","8903","North","East","Lat","Long","","9105","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_313[] = {"4811","Voirol 1875 (Paris)","","","","Algeria - north of 32 deg N","geographic 2D","6304","8903","North","East","Lat","Long","","9105","","","1995-06-02 00:00:00","IGN Paris","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_314[] = {"4812","Voirol Unifie (Paris)","","","","Algeria - north of 32 deg N","geographic 2D","6305","8903","North","East","Lat","Long","","9105","","","1995-06-02 00:00:00","\"Le System Geodesique Nord-Sahara\"; IGN Paris","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_315[] = {"4813","Batavia (Jakarta)","","","","Indonesia - Java","geographic 2D","6211","8908","North","East","Lat","Long","","9108","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_316[] = {"4814","RT38 (Stockholm)","","","","Sweden","geographic 2D","6308","8911","North","East","Lat","Long","","9108","","","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_317[] = {"4815","Greek (Athens)","","","","Greece","geographic 2D","6120","8912","North","East","Lat","Long","","9108","","","1997-06-16 00:00:00","Topography Department; National Technical University of Greece.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_318[] = {"4816","Carthage (Paris)","","","","Tunisia","geographic 2D","6223","8903","North","East","Lat","Long","","9105","","","1998-11-11 00:00:00","","EPSG","Superseded by Greenwich-based Carthage geogCS.","",NULL};
+datafile_rows_t horiz_cs_row_319[] = {"4817","NGO 1948 (Oslo)","","","","Norway - onshore","geographic 2D","6273","8913","North","East","Lat","Long","","9108","","","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_320[] = {"4901","ATF (Paris)","","","","France","geographic 2D","6901","8903","North","East","Lat","Long","","9105","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_321[] = {"4902","NDG (Paris)","","","","France - Alsace","geographic 2D","6902","8903","North","East","Lat","Long","","9105","","","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_322[] = {"4903","Madrid 1870 (Madrid)","","","","Spain","geographic 2D","6903","8905","North","East","Lat","Long","","9108","","","1998-11-11 00:00:00","Institut de Geomatica; Barcelona.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_323[] = {"20004","Pulkovo 1995 / Gauss-Kruger zone 4","1995 Coord. Sys. zone 4","","","Russia - west of 24 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16204","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_324[] = {"20005","Pulkovo 1995 / Gauss-Kruger zone 5","1995 Coord. Sys. zone 5","","","Russia - 24 deg to 30 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16205","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_325[] = {"20006","Pulkovo 1995 / Gauss-Kruger zone 6","1995 Coord. Sys. zone 6","","","Russia - 30 deg to 36 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16206","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_326[] = {"20007","Pulkovo 1995 / Gauss-Kruger zone 7","1995 Coord. Sys. zone 7","","","Russia - 36 deg to 42 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16207","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_327[] = {"20008","Pulkovo 1995 / Gauss-Kruger zone 8","1995 Coord. Sys. zone 8","","","Russia - 42 deg to 48 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16208","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_328[] = {"20009","Pulkovo 1995 / Gauss-Kruger zone 9","1995 Coord. Sys. zone 9","","","Russia - 48 deg to 54 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16209","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_329[] = {"20010","Pulkovo 1995 / Gauss-Kruger zone 10","1995 Coord. Sys. zone 10","","","Russia - 54 deg  to 60 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16210","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_330[] = {"20011","Pulkovo 1995 / Gauss-Kruger zone 11","1995 Coord. Sys. zone 11","","","Russia - 60 deg to 66 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16211","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_331[] = {"20012","Pulkovo 1995 / Gauss-Kruger zone 12","1995 Coord. Sys. zone 12","","","Russia - 66 deg to 72 deg East .","projected 2D","","","North","East","X","Y","9001","","4200","16212","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_332[] = {"20013","Pulkovo 1995 / Gauss-Kruger zone 13","1995 Coord. Sys. zone 13","","","Russia - 72 deg to 78 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16213","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_333[] = {"20014","Pulkovo 1995 / Gauss-Kruger zone 14","1995 Coord. Sys. zone 14","","","Russia - 78 deg to 84 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16214","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_334[] = {"20015","Pulkovo 1995 / Gauss-Kruger zone 15","1995 Coord. Sys. zone 15","","","Russia - 84 deg to 90 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16215","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_335[] = {"20016","Pulkovo 1995 / Gauss-Kruger zone 16","1995 Coord. Sys. zone 16","","","Russia - 90 deg to 96 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16216","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_336[] = {"20017","Pulkovo 1995 / Gauss-Kruger zone 17","1995 Coord. Sys. zone 17","","","Russia - 96 deg to 102deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16217","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_337[] = {"20018","Pulkovo 1995 / Gauss-Kruger zone 18","1995 Coord. Sys. zone 18","","","Russia - 102 deg to 108 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16218","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_338[] = {"20019","Pulkovo 1995 / Gauss-Kruger zone 19","1995 Coord. Sys. zone 19","","","Russia - 108 deg to 114 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16219","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_339[] = {"20020","Pulkovo 1995 / Gauss-Kruger zone 20","1995 Coord. Sys. zone 20","","","Russia - 114 deg to 120 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16220","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_340[] = {"20021","Pulkovo 1995 / Gauss-Kruger zone 21","1995 Coord. Sys. zone 21","","","Russia - 120 deg to 126 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16221","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_341[] = {"20022","Pulkovo 1995 / Gauss-Kruger zone 22","1995 Coord. Sys. zone 22","","","Russia - 126 deg to 132 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16222","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_342[] = {"20023","Pulkovo 1995 / Gauss-Kruger zone 23","1995 Coord. Sys. zone 23","","","Russia - 132 deg to 138 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16223","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_343[] = {"20024","Pulkovo 1995 / Gauss-Kruger zone 24","1995 Coord. Sys. zone 24","","","Russia - 138 deg to 144 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16224","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_344[] = {"20025","Pulkovo 1995 / Gauss-Kruger zone 25","1995 Coord. Sys. zone 25","","","Russia - 144 deg to 150 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16225","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_345[] = {"20026","Pulkovo 1995 / Gauss-Kruger zone 26","1995 Coord. Sys. zone 26","","","Russia - 150 deg to 156 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16226","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_346[] = {"20027","Pulkovo 1995 / Gauss-Kruger zone 27","1995 Coord. Sys. zone 27","","","Russia - 156 deg to 162 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16227","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_347[] = {"20028","Pulkovo 1995 / Gauss-Kruger zone 28","1995 Coord. Sys. zone 28","","","Russia - 162 deg to 168 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16228","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_348[] = {"20029","Pulkovo 1995 / Gauss-Kruger zone 29","1995 Coord. Sys. zone 29","","","Russia - 168 deg to 174 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16229","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_349[] = {"20030","Pulkovo 1995 / Gauss-Kruger zone 30","1995 Coord. Sys. zone 30","","","Russia - 174 deg East to 180 deg.","projected 2D","","","North","East","X","Y","9001","","4200","16230","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_350[] = {"20031","Pulkovo 1995 / Gauss-Kruger zone 31","1995 Coord. Sys. zone 31","","","Russia - 180 deg to 174 deg West.","projected 2D","","","North","East","X","Y","9001","","4200","16231","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_351[] = {"20032","Pulkovo 1995 / Gauss-Kruger zone 32","1995 Coord. Sys. zone 32","","","Russia - east of 174 deg West.","projected 2D","","","North","East","X","Y","9001","","4200","16232","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_352[] = {"20064","Pulkovo 1995 / Gauss-Kruger 4N","Pulkovo 1995 / Gauss 4N","","","Russia - west of 24 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16304","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_353[] = {"20065","Pulkovo 1995 / Gauss-Kruger 5N","Pulkovo 1995 / Gauss 5N","","","Russia - 24 deg to 30 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16305","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_354[] = {"20066","Pulkovo 1995 / Gauss-Kruger 6N","Pulkovo 1995 / Gauss 6N","","","Russia - 30 deg to 36 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16306","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_355[] = {"20067","Pulkovo 1995 / Gauss-Kruger 7N","Pulkovo 1995 / Gauss 7N","","","Russia - 36 deg to 42 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16307","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_356[] = {"20068","Pulkovo 1995 / Gauss-Kruger 8N","Pulkovo 1995 / Gauss 8N","","","Russia - 42 deg to 48 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16308","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_357[] = {"20069","Pulkovo 1995 / Gauss-Kruger 9N","Pulkovo 1995 / Gauss 9N","","","Russia - 48 deg to 54 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16309","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_358[] = {"20070","Pulkovo 1995 / Gauss-Kruger 10N","Pulkovo 1995 / Gauss 10N","","","Russia - 54 deg  to 60 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16310","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_359[] = {"20071","Pulkovo 1995 / Gauss-Kruger 11N","Pulkovo 1995 / Gauss 11N","","","Russia - 60 deg to 66 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16311","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_360[] = {"20072","Pulkovo 1995 / Gauss-Kruger 12N","Pulkovo 1995 / Gauss 12N","","","Russia - 66 deg to 72 deg East .","projected 2D","","","North","East","X","Y","9001","","4200","16312","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_361[] = {"20073","Pulkovo 1995 / Gauss-Kruger 13N","Pulkovo 1995 / Gauss 13N","","","Russia - 72 deg to 78 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16313","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_362[] = {"20074","Pulkovo 1995 / Gauss-Kruger 14N","Pulkovo 1995 / Gauss 14N","","","Russia - 78 deg to 84 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16314","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_363[] = {"20075","Pulkovo 1995 / Gauss-Kruger 15N","Pulkovo 1995 / Gauss 15N","","","Russia - 84 deg to 90 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16315","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_364[] = {"20076","Pulkovo 1995 / Gauss-Kruger 16N","Pulkovo 1995 / Gauss 16N","","","Russia - 90 deg to 96 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16316","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_365[] = {"20077","Pulkovo 1995 / Gauss-Kruger 17N","Pulkovo 1995 / Gauss 17N","","","Russia - 96 deg to 102deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16317","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_366[] = {"20078","Pulkovo 1995 / Gauss-Kruger 18N","Pulkovo 1995 / Gauss 18N","","","Russia - 102 deg to 108 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16318","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_367[] = {"20079","Pulkovo 1995 / Gauss-Kruger 19N","Pulkovo 1995 / Gauss 19N","","","Russia - 108 deg to 114 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16319","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_368[] = {"20080","Pulkovo 1995 / Gauss-Kruger 20N","Pulkovo 1995 / Gauss 20N","","","Russia - 114 deg to 120 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16320","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_369[] = {"20081","Pulkovo 1995 / Gauss-Kruger 21N","Pulkovo 1995 / Gauss 21N","","","Russia - 120 deg to 126 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16321","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_370[] = {"20082","Pulkovo 1995 / Gauss-Kruger 22N","Pulkovo 1995 / Gauss 22N","","","Russia - 126 deg to 132 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16322","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_371[] = {"20083","Pulkovo 1995 / Gauss-Kruger 23N","Pulkovo 1995 / Gauss 23N","","","Russia - 132 deg to 138 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16323","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_372[] = {"20084","Pulkovo 1995 / Gauss-Kruger 24N","Pulkovo 1995 / Gauss 24N","","","Russia - 138 deg to 144 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16324","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_373[] = {"20085","Pulkovo 1995 / Gauss-Kruger 25N","Pulkovo 1995 / Gauss 25N","","","Russia - 144 deg to 150 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16325","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_374[] = {"20086","Pulkovo 1995 / Gauss-Kruger 26N","Pulkovo 1995 / Gauss 26N","","","Russia - 150 deg to 156 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16326","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_375[] = {"20087","Pulkovo 1995 / Gauss-Kruger 27N","Pulkovo 1995 / Gauss 27N","","","Russia - 156 deg to 162 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16327","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_376[] = {"20088","Pulkovo 1995 / Gauss-Kruger 28N","Pulkovo 1995 / Gauss 28N","","","Russia - 162 deg to 168 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16328","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_377[] = {"20089","Pulkovo 1995 / Gauss-Kruger 29N","Pulkovo 1995 / Gauss 29N","","","Russia - 168 deg to 174 deg East.","projected 2D","","","North","East","X","Y","9001","","4200","16329","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_378[] = {"20090","Pulkovo 1995 / Gauss-Kruger 30N","Pulkovo 1995 / Gauss 30N","","","Russia - 174 deg East to 180 deg.","projected 2D","","","North","East","X","Y","9001","","4200","16330","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_379[] = {"20091","Pulkovo 1995 / Gauss-Kruger 31N","Pulkovo 1995 / Gauss 31N","","","Russia - 180 deg to 174 deg West.","projected 2D","","","North","East","X","Y","9001","","4200","16331","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_380[] = {"20092","Pulkovo 1995 / Gauss-Kruger 32N","Pulkovo 1995 / Gauss 32N","","","Russia - east of 174 deg West.","projected 2D","","","North","East","X","Y","9001","","4200","16332","1996-09-12 00:00:00","\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_381[] = {"20137","Adindan / UTM zone 37N","","","","Ethiopia - west of 42 degrees East.  Sudan - west of 42 degrees East.","projected 2D","","","East","North","E","N","9001","","4201","16037","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_382[] = {"20138","Adindan / UTM zone 38N","","","","Ethiopia - east of 42 degrees East.  Sudan - east of 42 degrees East.","projected 2D","","","East","North","E","N","9001","","4201","16038","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_383[] = {"20248","AGD66 / AMG zone 48","","","","Australia - 102deg East to 108deg East.","projected 2D","","","East","North","E","N","9001","","4202","17448","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_384[] = {"20249","AGD66 / AMG zone 49","","","","Australia - 108deg East to 114deg East.","projected 2D","","","East","North","E","N","9001","","4202","17449","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_385[] = {"20250","AGD66 / AMG zone 50","","","","Australia - 114deg East to 120deg East.","projected 2D","","","East","North","E","N","9001","","4202","17450","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_386[] = {"20251","AGD66 / AMG zone 51","","","","Australia - 120deg East to 126deg East.","projected 2D","","","East","North","E","N","9001","","4202","17451","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_387[] = {"20252","AGD66 / AMG zone 52","","","","Australia - 126deg East to 132deg East.","projected 2D","","","East","North","E","N","9001","","4202","17452","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_388[] = {"20253","AGD66 / AMG zone 53","","","","Australia - 132deg East to 138deg East.","projected 2D","","","East","North","E","N","9001","","4202","17453","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_389[] = {"20254","AGD66 / AMG zone 54","","","","Australia - 138deg East to 144deg East.  Papua New Guinea - west of 144deg East.","projected 2D","","","East","North","E","N","9001","","4202","17454","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_390[] = {"20255","AGD66 / AMG zone 55","","","","Australia - 144deg East to 150deg East.  Papua New Guinea - 144deg East to 150deg East.","projected 2D","","","East","North","E","N","9001","","4202","17455","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_391[] = {"20256","AGD66 / AMG zone 56","","","","Australia - 150deg East to 156deg East.","projected 2D","","","East","North","E","N","9001","","4202","17456","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_392[] = {"20257","AGD66 / AMG zone 57","","","","Australia - 156deg East to 162deg East.","projected 2D","","","East","North","E","N","9001","","4202","17457","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_393[] = {"20258","AGD66 / AMG zone 58","","","","Australia - 162deg East to 168deg East.","projected 2D","","","East","North","E","N","9001","","4202","17458","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_394[] = {"20348","AGD84 / AMG zone 48","","","","Australia - 102deg East to 108deg East.","projected 2D","","","East","North","E","N","9001","","4203","17448","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_395[] = {"20349","AGD84 / AMG zone 49","","","","Australia - 108deg East to 114deg East.","projected 2D","","","East","North","E","N","9001","","4203","17449","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_396[] = {"20350","AGD84 / AMG zone 50","","","","Australia - 114deg East to 120deg East.","projected 2D","","","East","North","E","N","9001","","4203","17450","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_397[] = {"20351","AGD84 / AMG zone 51","","","","Australia - 120deg East to 126deg East.","projected 2D","","","East","North","E","N","9001","","4203","17451","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_398[] = {"20352","AGD84 / AMG zone 52","","","","Australia - 126deg East to 132deg East.","projected 2D","","","East","North","E","N","9001","","4203","17452","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_399[] = {"20353","AGD84 / AMG zone 53","","","","Australia - 132deg East to 138deg East.","projected 2D","","","East","North","E","N","9001","","4203","17453","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_400[] = {"20354","AGD84 / AMG zone 54","","","","Australia - 138deg East to 144deg East.  Papua - New Guinea west of 144deg East.","projected 2D","","","East","North","E","N","9001","","4203","17454","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_401[] = {"20355","AGD84 / AMG zone 55","","","","Australia - 144deg East to 150deg East.  Papua New Guinea - 144deg East to 150deg East.","projected 2D","","","East","North","E","N","9001","","4203","17455","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_402[] = {"20356","AGD84 / AMG zone 56","","","","Australia - 150deg East to 156deg East.","projected 2D","","","East","North","E","N","9001","","4203","17456","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_403[] = {"20357","AGD84 / AMG zone 57","","","","Australia - 156deg East to 162deg East.","projected 2D","","","East","North","E","N","9001","","4203","17457","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_404[] = {"20358","AGD84 / AMG zone 58","","","","Australia - 162deg East to 168deg East.","projected 2D","","","East","North","E","N","9001","","4203","17458","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_405[] = {"20437","Ain el Abd / UTM zone 37N","Ain el Abd / UTM 37N","","","Saudi Arabia - west of 42 degrees East.","projected 2D","","","East","North","E","N","9001","","4204","16037","1997-11-13 00:00:00","","EPSG","","97.59",NULL};
+datafile_rows_t horiz_cs_row_406[] = {"20438","Ain el Abd / UTM zone 38N","Ain el Abd / UTM 38N","","","Kuwait.  Saudi Arabia - between 42 degrees and 48 degrees East.","projected 2D","","","East","North","E","N","9001","","4204","16038","1997-11-13 00:00:00","","EPSG","Known in Kuwait as \"KOC UTM\".","97.59",NULL};
+datafile_rows_t horiz_cs_row_407[] = {"20439","Ain el Abd / UTM zone 39N","Ain el Abd / UTM 39N","","","Saudi Arabia - east of 48 degrees East.","projected 2D","","","East","North","E","N","9001","","4204","16039","1997-11-13 00:00:00","","EPSG","","97.59",NULL};
+datafile_rows_t horiz_cs_row_408[] = {"20499","Ain el Abd / Bahrain Grid","","","","Bahrain.","projected 2D","","","East","North","E","N","9001","","4204","19900","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_409[] = {"20538","Afgooye / UTM zone 38N","","","","Somalia - west of 48 degrees East.","projected 2D","","","East","North","E","N","9001","","4205","16038","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_410[] = {"20539","Afgooye / UTM zone 39N","","","","Somalia - east of 48 degrees East.","projected 2D","","","East","North","E","N","9001","","4205","16039","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_411[] = {"20790","Lisbon (Lisbon)/Portuguese National Grid","Lisbon / Portuguese Grid","","","Portugal - onshore.","projected 2D","","","East","North","X","Y","9001","","4803","19936","1998-11-11 00:00:00","","EPSG","","98.42",NULL};
+datafile_rows_t horiz_cs_row_412[] = {"20822","Aratu / UTM zone 22S","","","","Brazil - coastal areas south of 2 deg 55 min South and west of 48 deg West.","projected 2D","","","East","North","E","N","9001","","4208","16122","1995-07-21 00:00:00","","EPSG","","95.191",NULL};
+datafile_rows_t horiz_cs_row_413[] = {"20823","Aratu / UTM zone 23S","","","","Brazil - coastal areas south of 2 deg 55 min South and between 48 and 42 deg West; offshore Santos basin.","projected 2D","","","East","North","E","N","9001","","4208","16123","1995-07-21 00:00:00","","EPSG","","95.191",NULL};
+datafile_rows_t horiz_cs_row_414[] = {"20824","Aratu / UTM zone 24S","","","","Brazil - coastal areas south of 2 deg 55 min South and east of 42 deg West; offshore Campos basin.","projected 2D","","","East","North","E","N","9001","","4208","16124","1995-07-21 00:00:00","","EPSG","","95.191",NULL};
+datafile_rows_t horiz_cs_row_415[] = {"20934","Arc 1950 / UTM zone 34S","","","","Botswana & Zambia - west of 24 deg East.","projected 2D","","","East","North","E","N","9001","","4209","16134","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_416[] = {"20935","Arc 1950 / UTM zone 35S","","","","Botswana - east of 24 deg East; Zambia - 24 to 30 deg East; Zimbabwe west of 30 deg East .","projected 2D","","","East","North","E","N","9001","","4209","16135","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_417[] = {"20936","Arc 1950 / UTM zone 36S","","","","Malawi; Zambia & Zimbabwe - east of 30 deg East.","projected 2D","","","East","North","E","N","9001","","4209","16136","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_418[] = {"21035","Arc 1960 / UTM zone 35S","","","","Tanzania - west of 30 deg East; Uganda south of equator and west of 30 deg East.","projected 2D","","","East","North","E","N","9001","","4210","16135","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_419[] = {"21036","Arc 1960 / UTM zone 36S","","","","Kenya - south of equator and west of 36 deg East; Tanzania - 30 to 36 deg East; Uganda south of equator and east of 30 deg East.","projected 2D","","","East","North","E","N","9001","","4210","16136","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_420[] = {"21037","Arc 1960 / UTM zone 37S","","","","Kenya - south of equator and east of 36 deg East; Tanzania - east of 36 deg East.","projected 2D","","","East","North","E","N","9001","","4210","16137","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_421[] = {"21095","Arc 1960 / UTM zone 35N","","","","Uganda north of equator and west of 30 deg East.","projected 2D","","","East","North","E","N","9001","","4210","16035","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_422[] = {"21096","Arc 1960 / UTM zone 36N","","","","Kenya - north of equator and west of 36 deg East; Uganda north of equator and east of 30 deg East.","projected 2D","","","East","North","E","N","9001","","4210","16036","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_423[] = {"21097","Arc 1960 / UTM zone 37N","","","","Kenya - north of equator and east of 36 deg East.","projected 2D","","","East","North","E","N","9001","","4210","16037","1997-11-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_424[] = {"21100","Batavia (Jakarta) / NEIEZ","Batavia / NEIEZ","","","Indonesia - Java.","projected 2D","","","East","North","X","Y","9001","","4813","19905","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_425[] = {"21148","Batavia / UTM zone 48S","","","","Indonesia - Java west of 108 deg East.","projected 2D","","","East","North","E","N","9001","","4211","16148","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_426[] = {"21149","Batavia / UTM zone 49S","","","","Indonesia - Java between 108 and 114 deg East.","projected 2D","","","East","North","E","N","9001","","4211","16149","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_427[] = {"21150","Batavia / UTM zone 50S","","","","Indonesia - Java east of 114 deg East.","projected 2D","","","East","North","E","N","9001","","4211","16150","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_428[] = {"21291","Barbados 1938 / British West Indies Grid","Barbados 1938 / BWI Grid","","","Barbados","projected 2D","","","East","North","E","N","9001","","4212","19942","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","Superseded by Barbados National Grid (code 21292) from 1983.","",NULL};
+datafile_rows_t horiz_cs_row_429[] = {"21292","Barbados 1938 / Barbados National Grid","Barbados NationaI Grid","","","Barbados","projected 2D","","","East","North","E","N","9001","","4212","19943","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","Supersedes Barbados 1938 / BWI Grid (code 21291) from 1983.","",NULL};
+datafile_rows_t horiz_cs_row_430[] = {"21413","Beijing 1954 / Gauss-Kruger zone 13","Beijing / Gauss zone 13","","","China - west of 78 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16213","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_431[] = {"21414","Beijing 1954 / Gauss-Kruger zone 14","Beijing / Gauss zone 14","","","China - 78 deg East  to 84 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16214","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_432[] = {"21415","Beijing 1954 / Gauss-Kruger zone 15","Beijing / Gauss zone 15","","","China - 84 deg East  to 90 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16215","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_433[] = {"21416","Beijing 1954 / Gauss-Kruger zone 16","Beijing / Gauss zone 16","","","China - 90 deg East  to 96 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16216","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_434[] = {"21417","Beijing 1954 / Gauss-Kruger zone 17","Beijing / Gauss zone 17","","","China - 96 deg East  to 102eg E","projected 2D","","","North","East","X","Y","9001","","4214","16217","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_435[] = {"21418","Beijing 1954 / Gauss-Kruger zone 18","Beijing / Gauss zone 18","","","China - 102 deg East  to 108 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16218","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_436[] = {"21419","Beijing 1954 / Gauss-Kruger zone 19","Beijing / Gauss zone 19","","","China - 108 deg East  to 114 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16219","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_437[] = {"21420","Beijing 1954 / Gauss-Kruger zone 20","Beijing / Gauss zone 20","","","China - 114 deg East  to 120 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16220","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_438[] = {"21421","Beijing 1954 / Gauss-Kruger zone 21","Beijing / Gauss zone 21","","","China - 120 deg East  to 126 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16221","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_439[] = {"21422","Beijing 1954 / Gauss-Kruger zone 22","Beijing / Gauss zone 22","","","China - 126 deg East  to 132 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16222","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_440[] = {"21423","Beijing 1954 / Gauss-Kruger zone 23","Beijing / Gauss zone 23","","","China - east of 132 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16223","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_441[] = {"21473","Beijing 1954 / Gauss-Kruger 13N","Beijing / Gauss 13N","","","China - west of 78 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16313","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_442[] = {"21474","Beijing 1954 / Gauss-Kruger 14N","Beijing / Gauss 14N","","","China - 78 deg East  to 84 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16314","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_443[] = {"21475","Beijing 1954 / Gauss-Kruger 15N","Beijing / Gauss 15N","","","China - 84 deg East  to 90 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16315","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_444[] = {"21476","Beijing 1954 / Gauss-Kruger 16N","Beijing / Gauss 16N","","","China - 90 deg East  to 96 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16316","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_445[] = {"21477","Beijing 1954 / Gauss-Kruger 17N","Beijing / Gauss 17N","","","China - 96 deg East  to 102eg E","projected 2D","","","North","East","X","Y","9001","","4214","16317","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_446[] = {"21478","Beijing 1954 / Gauss-Kruger 18N","Beijing / Gauss 18N","","","China - 102 deg East  to 108 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16318","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_447[] = {"21479","Beijing 1954 / Gauss-Kruger 19N","Beijing / Gauss 19N","","","China - 108 deg East  to 114 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16319","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_448[] = {"21480","Beijing 1954 / Gauss-Kruger 20N","Beijing / Gauss 20N","","","China - 114 deg East  to 120 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16320","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_449[] = {"21481","Beijing 1954 / Gauss-Kruger 21N","Beijing / Gauss 21N","","","China - 120 deg East  to 126 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16321","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_450[] = {"21482","Beijing 1954 / Gauss-Kruger 22N","Beijing / Gauss 22N","","","China - 126 deg East  to 132 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16322","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_451[] = {"21483","Beijing 1954 / Gauss-Kruger 23N","Beijing / Gauss 23N","","","China - east of 132 deg East.","projected 2D","","","North","East","X","Y","9001","","4214","16323","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_452[] = {"21500","Belge 1950 (Brussels) / Belge Lambert 50","Belge Lambert 50","","","Belgium - onshore.","projected 2D","","","East","North","X","Y","9001","","4809","19901","1997-04-11 00:00:00","","EPSG","Superseded by 31300 (Belge 1972 / Belge Lambert 72).","97.13",NULL};
+datafile_rows_t horiz_cs_row_453[] = {"21780","Bern 1898 (Bern) / LV03C","LV03C","","","Liechtenstein.  Switzerland.","projected 2D","","","East","North","Y","X","9001","","4801","19923","1997-06-30 00:00:00","","EPSG","Superseded by CH1903 / LV03 (code 21781).","97.27  97.62",NULL};
+datafile_rows_t horiz_cs_row_454[] = {"21781","CH1903 / LV03","LV03","","","Liechtenstein; Switzerland.","projected 2D","","","East","North","Y","X","9001","","4149","19922","1999-10-20 00:00:00","","EPSG","Supersedes LV03C (code 21780).  Superseded by CH1903+/LV95 (code 256).","",NULL};
+datafile_rows_t horiz_cs_row_455[] = {"21817","Bogota / UTM zone 17N","","","","Colombia - offshore west of 78 deg W of Greenwich.","projected 2D","","","East","North","E","N","9001","","4218","16017","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_456[] = {"21818","Bogota / UTM zone 18N","","","","Colombia - offshore east of 78 deg W of Greenwich.","projected 2D","","","East","North","E","N","9001","","4218","16018","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_457[] = {"21891","Bogota / Colombia West zone","Bogota / Colombia 3W","","","Colombia - west of 1 deg 30 min W of Bogota (75d 34m 51.30s W of Greenwich).","projected 2D","","","East","North","X","Y","9001","","4218","18051","1997-11-13 00:00:00","","EPSG","","97.11  97.57",NULL};
+datafile_rows_t horiz_cs_row_458[] = {"21892","Bogota / Colombia Bogota zone","Bogota / Colombia Bogota","","","Colombia - 1 deg 30 min W to 1 deg 30 min E of Bogota (75d 35m W to 72d 35m W of Greenwich).","projected 2D","","","East","North","X","Y","9001","","4218","18052","1997-11-13 00:00:00","","EPSG","","97.11  97.57",NULL};
+datafile_rows_t horiz_cs_row_459[] = {"21893","Bogota / Colombia East Central zone","Bogota / Colombia 3E","","","Colombia - 1 deg 30 min to 4 deg 30 min E of Bogota (72d 35m to 69d 34m W of Greenwich).","projected 2D","","","East","North","X","Y","9001","","4218","18053","1997-11-13 00:00:00","","EPSG","","97.11  97.57",NULL};
+datafile_rows_t horiz_cs_row_460[] = {"21894","Bogota / Colombia East","Bogota / Colombia 6E","","","Colombia - east of 4 deg 30 min E of Bogota (69d 34m 51.3s W of Greenwich).","projected 2D","","","East","North","X","Y","9001","","4218","18054","1997-11-13 00:00:00","","EPSG","","97.11  97.57",NULL};
+datafile_rows_t horiz_cs_row_461[] = {"22032","Camacupa / UTM zone 32S","","","","Angola - west of 12 deg East.","projected 2D","","","East","North","E","N","9001","","4220","16132","1997-11-13 00:00:00","","EPSG","","97.58",NULL};
+datafile_rows_t horiz_cs_row_462[] = {"22033","Camacupa / UTM zone 33S","","","","Angola - east of 12 deg East.","projected 2D","","","East","North","E","N","9001","","4220","16133","1997-11-13 00:00:00","","EPSG","","97.58",NULL};
+datafile_rows_t horiz_cs_row_463[] = {"22091","Camacupa / TM 11.30 SE","","","","Angola - offshore.","projected 2D","","","East","North","E","N","9001","","4220","16611","1998-11-11 00:00:00","Esso Angola","EPSG","Used by Esso Angola for offshore blocks 15 and 24.","",NULL};
+datafile_rows_t horiz_cs_row_464[] = {"22092","Camacupa / TM 12 SE","","","","Angola - offshore.","projected 2D","","","East","North","E","N","9001","","4220","16612","1998-11-11 00:00:00","Shell Angola","EPSG","Used by Shell Angola for offshore blocks 1 and 16.  Used by BP Amoco, Elf and Esso for offshore blocks 31-33.","",NULL};
+datafile_rows_t horiz_cs_row_465[] = {"22191","Campo Inchauspe / Argentina 1","C Inchauspe /Argentina 1","","","Argentina - west of 70 deg 30 min West.","projected 2D","","","North","East","X","Y","9001","","4221","18031","1999-11-15 00:00:00","","EPSG","","97.72",NULL};
+datafile_rows_t horiz_cs_row_466[] = {"22192","Campo Inchauspe / Argentina 2","C Inchauspe /Argentina 2","","","Argentina - between 70 deg 30 min and 67 deg 30 min West.","projected 2D","","","North","East","X","Y","9001","","4221","18032","1999-11-15 00:00:00","","EPSG","","97.72",NULL};
+datafile_rows_t horiz_cs_row_467[] = {"22193","Campo Inchauspe / Argentina 3","C Inchauspe /Argentina 3","","","Argentina - between 67 deg 30 min and 64 deg 30 min West.","projected 2D","","","North","East","X","Y","9001","","4221","18033","1999-11-15 00:00:00","","EPSG","","97.72",NULL};
+datafile_rows_t horiz_cs_row_468[] = {"22194","Campo Inchauspe / Argentina 4","C Inchauspe /Argentina 4","","","Argentina - between 64 deg 30 min and 61 deg 30 min West.","projected 2D","","","North","East","X","Y","9001","","4221","18034","1999-11-15 00:00:00","","EPSG","","97.72",NULL};
+datafile_rows_t horiz_cs_row_469[] = {"22195","Campo Inchauspe / Argentina 5","C Inchauspe /Argentina 5","","","Argentina - between 61 deg 30 min and 58 deg 30 min West.","projected 2D","","","North","East","X","Y","9001","","4221","18035","1999-11-15 00:00:00","","EPSG","","97.72",NULL};
+datafile_rows_t horiz_cs_row_470[] = {"22196","Campo Inchauspe / Argentina 6","C Inchauspe /Argentina 6","","","Argentina - between 58 deg 30 min and 55 deg 30 min West.","projected 2D","","","North","East","X","Y","9001","","4221","18036","1999-11-15 00:00:00","","EPSG","","97.72",NULL};
+datafile_rows_t horiz_cs_row_471[] = {"22197","Campo Inchauspe / Argentina 7","C Inchauspe /Argentina 7","","","Argentina - east of 55 deg 30 min West.","projected 2D","","","North","East","X","Y","9001","","4221","18037","1999-11-15 00:00:00","","EPSG","","97.72",NULL};
+datafile_rows_t horiz_cs_row_472[] = {"22234","Cape / UTM zone 34S","","","","Botswana - west of 21deg East.","projected 2D","","","East","North","E","N","9001","","4222","16134","1995-12-08 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_473[] = {"22235","Cape / UTM zone 35S","","","","Botswana - east of 27deg East.","projected 2D","","","East","North","E","N","9001","","4222","16135","1995-12-08 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_474[] = {"22236","Cape / UTM zone 36S","","","","Botswana - between 21 and 27deg East.","projected 2D","","","East","North","E","N","9001","","4222","16136","1995-12-08 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_475[] = {"22275","South African Coordinate System zone 15","South African CS zone 15","","","South Africa - Walvis Bay.","projected 2D","","","West","South","W","S","9001","","4222","17515","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_476[] = {"22277","South African Coordinate System zone 17","South African CS zone 17","","","South Africa - west of 18 deg East.","projected 2D","","","West","South","W","S","9001","","4222","17517","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_477[] = {"22279","South African Coordinate System zone 19","South African CS zone 19","","","South Africa - 18 to 20 deg East.","projected 2D","","","West","South","W","S","9001","","4222","17519","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_478[] = {"22281","South African Coordinate System zone 21","South African CS zone 21","","","South Africa - 20 to 22 deg East.","projected 2D","","","West","South","W","S","9001","","4222","17521","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_479[] = {"22283","South African Coordinate System zone 23","South African CS zone 23","","","South Africa - 22 to 24 deg East.","projected 2D","","","West","South","W","S","9001","","4222","17523","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_480[] = {"22285","South African Coordinate System zone 25","South African CS zone 25","","","Lestho  - west of 26 deg East; South Africa - 24 to 26 deg East.","projected 2D","","","West","South","W","S","9001","","4222","17525","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_481[] = {"22287","South African Coordinate System zone 27","South African CS zone 27","","","Lestho  - east of 26 deg East;  South Africa - 26 to 28 deg East.","projected 2D","","","West","South","W","S","9001","","4222","17527","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_482[] = {"22289","South African Coordinate System zone 29","South African CS zone 29","","","South Africa - 28 to 30 deg East.","projected 2D","","","West","South","W","S","9001","","4222","17529","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_483[] = {"22291","South African Coordinate System zone 31","South African CS zone 31","","","South Africa - 30 to 32 deg East;  Swaziland.","projected 2D","","","West","South","W","S","9001","","4222","17531","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_484[] = {"22293","South African Coordinate System zone 33","South African CS zone 33","","","South Africa - east of 32 deg East.","projected 2D","","","West","South","W","S","9001","","4222","17533","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_485[] = {"22300","Carthage (Paris) / Tunisia Mining Grid","Tunisia Mining Grid","","","Tunisia - onshore.","projected 2D","","","East","North","X","Y","9036","","4816","19937","1998-11-11 00:00:00","","EPSG","CAUTION: Carthage datum did not exist when the 1953 decree was issued and an inference is that grid should be applied to the Voirol 1875 geogCS.  Common practice assumes that the current Tunisian geodetic datum of Carthage applies.","",NULL};
+datafile_rows_t horiz_cs_row_486[] = {"22332","Carthage / UTM zone 32N","","","","Tunisia - offshore.","projected 2D","","","East","North","X","Y","9001","","4223","16032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_487[] = {"22391","Carthage / Nord Tunisie","","","","Tunisia - north of 38.5 grads (34 deg 39 min) North.","projected 2D","","","East","North","X","Y","9001","","4223","18181","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_488[] = {"22392","Carthage / Sud Tunisie","","","","Tunisia - south of 38.5 grads (34 deg 39 min) North.","projected 2D","","","East","North","X","Y","9001","","4223","18182","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_489[] = {"22523","Corrego Alegre / UTM zone 23S","Corrego Alegre / UTM 23S","","","Brazil - NE coastal area between 45 deg W and 42 deg W.","projected 2D","","","East","North","E","N","9001","","4225","16123","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_490[] = {"22524","Corrego Alegre / UTM zone 24S","Corrego Alegre / UTM 24S","","","Brazil - NE coastal area between 42 deg W and 40 deg W.","projected 2D","","","East","North","E","N","9001","","4225","16124","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_491[] = {"22700","Deir ez Zor / Levant Zone","","","","Syrian Arab Republic west of 39 deg E.","projected 2D","","","East","North","X","Y","9001","","4227","19940","1999-04-22 00:00:00","","EPSG","Superseded by Deir ez Zor / Syria Lambert (EPSG code 22770) from 1973.","",NULL};
+datafile_rows_t horiz_cs_row_492[] = {"22770","Deir ez Zor / Syria Lambert","","","","Syrian Arab Republic","projected 2D","","","East","North","X","Y","9001","","4227","19948","1999-10-20 00:00:00","","EPSG","Supersedes Deir ez Zor / Levant zone (EPSG code 22700) from 1973.","",NULL};
+datafile_rows_t horiz_cs_row_493[] = {"22832","Douala / UTM zone 32N","","","","Cameroon.","projected 2D","","","East","North","E","N","9001","","4228","16032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_494[] = {"22991","Egypt 1907 / Blue Belt","","","","Egypt  - Sinai peninsula.","projected 2D","","","East","North","E","N","9001","","4229","18071","1999-04-22 00:00:00","","EPSG","Also known as Egypt 1907 / Green Belt.    Oil industry usually uses Egypt 1907 / Red Belt rather than this projected CS.","",NULL};
+datafile_rows_t horiz_cs_row_495[] = {"22992","Egypt 1907 / Red Belt","","","","Egypt  - east of 29 deg East.","projected 2D","","","East","North","E","N","9001","","4229","18072","1995-06-02 00:00:00","","EPSG","See also Egypt 1907 / Blue Belt for non oil industry usage in Sinai peninsula.","",NULL};
+datafile_rows_t horiz_cs_row_496[] = {"22993","Egypt 1907 / Purple Belt","","","","Egypt -  west of 29 deg E; north of approx 28 deg 11 min North.","projected 2D","","","East","North","E","N","9001","","4229","18073","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_497[] = {"22994","Egypt 1907 / Extended Purple Belt","Egypt 1907 / Ext. Purple","","","Egypt  - west of 29 deg E; south of approx 28 deg 11 min North.","projected 2D","","","East","North","E","N","9001","","4229","18074","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_498[] = {"23028","ED50 / UTM zone 28N","","","","Europe - 18deg West to 12deg West - Ireland offshore; United Kingdom (UKCS) offshore.","projected 2D","","","East","North","E","N","9001","","4230","16028","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_499[] = {"23029","ED50 / UTM zone 29N","","","","Europe - 12deg West to 6deg West - Portugal; Spain; Ireland offshore; United Kingdom (UKCS) offshore.","projected 2D","","","East","North","E","N","9001","","4230","16029","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_500[] = {"23030","ED50 / UTM zone 30N","","","","Europe - 6deg West to 0deg - Spain; France offshore; Ireland offshore; United Kingdom - UKCS offshore - North Sea west of 0 deg East).","projected 2D","","","East","North","E","N","9001","","4230","16030","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_501[] = {"23031","ED50 / UTM zone 31N","","","","Europe - 0deg to 6deg East - Denmark (North Sea); Germany offshore; Netherlands offshore; Norway; United Kingdom (UKCS) offshore.","projected 2D","","","East","North","E","N","9001","","4230","16031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_502[] = {"23032","ED50 / UTM zone 32N","","","","Europe - 6deg East  to 12deg East - Denmark; Germany offshore; Netherlands offshore; Norway.","projected 2D","","","East","North","E","N","9001","","4230","16032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_503[] = {"23033","ED50 / UTM zone 33N","","","","Europe - 12deg East  to 18deg East - Denmark including Bornholm; Norway.","projected 2D","","","East","North","E","N","9001","","4230","16033","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_504[] = {"23034","ED50 / UTM zone 34N","","","","Europe - 18deg East  to 24deg East - Greece; Norway.","projected 2D","","","East","North","E","N","9001","","4230","16034","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_505[] = {"23035","ED50 / UTM zone 35N","","","","Europe - 24deg East  to 30deg East - Greece; Norway; Turkey.","projected 2D","","","East","North","E","N","9001","","4230","16035","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_506[] = {"23036","ED50 / UTM zone 36N","","","","Europe - 30deg East  to 36deg East - Turkey.","projected 2D","","","East","North","E","N","9001","","4230","16036","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_507[] = {"23037","ED50 / UTM zone 37N","","","","Europe - 36deg East  to 42deg East - Turkey.","projected 2D","","","East","North","E","N","9001","","4230","16037","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_508[] = {"23038","ED50 / UTM zone 38N","","","","Europe - 42deg East  to 48deg East - Turkey.","projected 2D","","","East","North","E","N","9001","","4230","16038","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_509[] = {"23090","ED50 / TM 0 N","","","","United Kingdom (UKCS) - offshore North Sea.","projected 2D","","","East","North","E","N","9001","","4230","16400","1998-11-11 00:00:00","Shell UK","EPSG","Used by Shell UK for North Sea","",NULL};
+datafile_rows_t horiz_cs_row_510[] = {"23095","ED50 / TM 5 NE","","","","Netherlands - offshore North Sea.","projected 2D","","","East","North","E","N","9001","","4230","16405","1998-11-11 00:00:00","NAM","EPSG","Used by NAM","",NULL};
+datafile_rows_t horiz_cs_row_511[] = {"23239","Fahud / UTM zone 39N","","","","Oman - west of 54 deg East.","projected 2D","","","East","North","E","N","9001","","4232","16039","1995-06-02 00:00:00","","EPSG","Since 1993 superseded by PSD93 / UTM zone 39N projCS (code 3439). Maximum differences to Fahud adjustment are 20 metres.","",NULL};
+datafile_rows_t horiz_cs_row_512[] = {"23240","Fahud / UTM zone 40N","","","","Oman - east of 54 deg East.","projected 2D","","","East","North","E","N","9001","","4232","16040","1995-06-02 00:00:00","","EPSG","Since 1993 superseded by PSD93 / UTM zone 40N projCS (code 3440). Maximum differences to Fahud adjustment are 20 metres.","",NULL};
+datafile_rows_t horiz_cs_row_513[] = {"23433","Garoua / UTM zone 33N","","","","Cameroon.","projected 2D","","","East","North","E","N","9001","","4234","16033","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_514[] = {"23700","HD72 / EOV","","","","Hungary","projected 2D","","","East","North","Y","X","9001","","4237","19931","1997-07-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_515[] = {"23846","ID74 / UTM zone 46N","","","","Indonesia - north of equator and west of 96 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16046","1995-08-08 00:00:00","","EPSG","","95.193  95.20",NULL};
+datafile_rows_t horiz_cs_row_516[] = {"23847","ID74 / UTM zone 47N","","","","Indonesia - north of equator and between 96 deg and 102 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16047","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_517[] = {"23848","ID74 / UTM zone 48N","","","","Indonesia - north of equator and between 102 deg and 108 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16048","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_518[] = {"23849","ID74 / UTM zone 49N","","","","Indonesia - north of equator and between 108 deg and 114 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16049","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_519[] = {"23850","ID74 / UTM zone 50N","","","","Indonesia - north of equator and between 114 deg and 120 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16050","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_520[] = {"23851","ID74 / UTM zone 51N","","","","Indonesia - north of equator and between 120 deg and 126 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16051","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_521[] = {"23852","ID74 / UTM zone 52N","","","","Indonesia - north of equator and between 126 deg and 132 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16052","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_522[] = {"23853","ID74 / UTM zone 53N","","","","Indonesia - north of equator and east of 132 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16053","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_523[] = {"23886","ID74 / UTM zone 46S","","","","Indonesia - south of equator and west of 96 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16146","1995-08-08 00:00:00","","EPSG","","95.193  95.20",NULL};
+datafile_rows_t horiz_cs_row_524[] = {"23887","ID74 / UTM zone 47S","","","","Indonesia - south of equator and between 96 deg and 102 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16147","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_525[] = {"23888","ID74 / UTM zone 48S","","","","Indonesia - south of equator and between 102 deg and 108 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16148","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_526[] = {"23889","ID74 / UTM zone 49S","","","","Indonesia - south of equator and between 108 deg and 114 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16149","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_527[] = {"23890","ID74 / UTM zone 50S","","","","Indonesia - south of equator and between 114 deg and 120 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16150","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_528[] = {"23891","ID74 / UTM zone 51S","","","","Indonesia - south of equator and between 120 deg and 126 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16151","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_529[] = {"23892","ID74 / UTM zone 52S","","","","Indonesia - south of equator and between 126 deg and 132 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16152","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_530[] = {"23893","ID74 / UTM zone 53S","","","","Indonesia - south of equator and between 132 deg and 138 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16153","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_531[] = {"23894","ID74 / UTM zone 54S","","","","Indonesia - south of equator and east of 138 deg East.","projected 2D","","","East","North","E","N","9001","","4238","16154","1995-07-21 00:00:00","","EPSG","","95.193",NULL};
+datafile_rows_t horiz_cs_row_532[] = {"23946","Indian 1954 / UTM zone 46N","Indian 1954 / UTM 46N","","","Myanmar (Burma) - west of 96 deg East.","projected 2D","","","East","North","E","N","9001","","4239","16046","1998-06-13 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_533[] = {"23947","Indian 1954 / UTM zone 47N","Indian 1954 / UTM 47N","","","Myanmar (Burma) - east of 96 deg East; Thailand - west of 102 deg East.","projected 2D","","","East","North","E","N","9001","","4239","16047","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_534[] = {"23948","Indian 1954 / UTM zone 48N","Indian 1954 / UTM 48N","","","Thailand - east of 102 deg East.","projected 2D","","","East","North","E","N","9001","","4239","16048","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_535[] = {"24047","Indian 1975 / UTM zone 47N","Indian 1975 / UTM 47N","","","Thailand - west of 102 deg East.","projected 2D","","","East","North","E","N","9001","","4240","16047","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_536[] = {"24048","Indian 1975 / UTM zone 48N","Indian 1975 / UTM 48N","","","Thailand - east of 102 deg East.","projected 2D","","","East","North","E","N","9001","","4240","16048","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_537[] = {"24100","Jamaica 1875 / Jamaica (Old Grid)","Jamaica 1875 / Old Grid","","","Jamaica.","projected 2D","","","East","North","E","N","9005","","4241","19909","1995-06-02 00:00:00","","EPSG","Superseded by 24200 (JAD69 / Jamaica National Grid).","",NULL};
+datafile_rows_t horiz_cs_row_538[] = {"24200","JAD69 / Jamaica National Grid","JAD69 / Jamaica Grid","","","Jamaica.","projected 2D","","","East","North","E","N","9001","","4242","19910","1995-06-02 00:00:00","","EPSG","Supersedes 24100 (JAD69 / Jamaica National Grid).","",NULL};
+datafile_rows_t horiz_cs_row_539[] = {"24305","Kalianpur 1937 / UTM zone 45N","Kalianpur 37 / UTM 45N","","","Bangladesh - west of 90deg East.","projected 2D","","","East","North","E","N","9001","","4144","16045","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_540[] = {"24306","Kalianpur 1937 / UTM zone 46N","Kalianpur 37 / UTM 46N","","","Bangladesh - east of 90deg East.","projected 2D","","","East","North","E","N","9001","","4144","16046","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_541[] = {"24311","Kalianpur 1962 / UTM zone 41N","Kalianpur 62 / UTM 41N","","","Pakistan - west of 66deg East.","projected 2D","","","East","North","E","N","9001","","4145","16041","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_542[] = {"24312","Kalianpur 1962 / UTM zone 42N","Kalianpur 62 / UTM 42N","","","Pakistan - between 66 and 72deg East.","projected 2D","","","East","North","E","N","9001","","4145","16042","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_543[] = {"24313","Kalianpur 1962 / UTM zone 43N","Kalianpur 62 / UTM 43N","","","Pakistan - east of 72deg East.","projected 2D","","","East","North","E","N","9001","","4145","16043","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_544[] = {"24342","Kalianpur 1975 / UTM zone 42N","Kalianpur 75 / UTM 42N","","","India - west of 72deg East.","projected 2D","","","East","North","E","N","9001","","4146","16042","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_545[] = {"24343","Kalianpur 1975 / UTM zone 43N","Kalianpur 75 / UTM 43N","","","India - between 72 and 78deg East.","projected 2D","","","East","North","E","N","9001","","4146","16043","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_546[] = {"24344","Kalianpur 1975 / UTM zone 44N","Kalianpur 75 / UTM 44N","","","India - between 78 and 84deg East.","projected 2D","","","East","North","E","N","9001","","4146","16044","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_547[] = {"24345","Kalianpur 1975 / UTM zone 45N","Kalianpur 75 / UTM 45N","","","India - between 84 and 90deg East.","projected 2D","","","East","North","E","N","9001","","4146","16045","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_548[] = {"24346","Kalianpur 1975 / UTM zone 46N","Kalianpur 75 / UTM 46N","","","India - between 90 and 96deg East.","projected 2D","","","East","North","E","N","9001","","4146","16046","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_549[] = {"24347","Kalianpur 1975 / UTM zone 47N","Kalianpur 75 / UTM 47N","","","India - east of 96deg East.","projected 2D","","","East","North","E","N","9001","","4146","16047","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_550[] = {"24370","Kalianpur 1880 / India zone 0","Kalianpur / India 0","","","Pakistan north of 35 deg 35 min North.","projected 2D","","","East","North","E","N","9084","","4243","18110","1999-10-20 00:00:00","","EPSG","","97.23",NULL};
+datafile_rows_t horiz_cs_row_551[] = {"24371","Kalianpur 1880 / India zone I","Kalianpur / India I","","","India north of 28 deg North; Pakistan 28 deg to 35 deg 35 min North.","projected 2D","","","East","North","E","N","9084","","4243","18111","1999-10-20 00:00:00","","EPSG","","97.23",NULL};
+datafile_rows_t horiz_cs_row_552[] = {"24372","Kalianpur 1880 / India zone IIa","Kalianpur / India IIa","","","India - between 21 deg and 28 deg North and  west of 82 deg East; Pakistan - south of 28 deg North.","projected 2D","","","East","North","E","N","9084","","4243","18112","1999-10-20 00:00:00","","EPSG","","97.23",NULL};
+datafile_rows_t horiz_cs_row_553[] = {"24373","Kalianpur 1880 / India zone III","Kalianpur / India III","","","India - between 15 deg and 21 deg North.","projected 2D","","","East","North","E","N","9084","","4243","18114","1999-10-20 00:00:00","","EPSG","","97.23",NULL};
+datafile_rows_t horiz_cs_row_554[] = {"24374","Kalianpur 1880 / India zone IV","Kalianpur / India IV","","","India - south of 15 deg North.","projected 2D","","","East","North","E","N","9084","","4243","18116","1999-10-20 00:00:00","","EPSG","","97.23",NULL};
+datafile_rows_t horiz_cs_row_555[] = {"24375","Kalianpur 1937 / India zone IIb","Kalianpur 37 / India IIb","","","Bangladesh.","projected 2D","","","East","North","E","N","9001","","4144","18238","1999-10-20 00:00:00","","EPSG","Used by Bangladesh since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and Benoit's 1895 British inch-metre ratio of 39.370115 rounded as Ind ft = 0.30479841m exactly.","97.23",NULL};
+datafile_rows_t horiz_cs_row_556[] = {"24376","Kalianpur 1962 / India zone I","Kalianpur 62 / India I","","","Pakistan - north of 28deg North.","projected 2D","","","East","North","E","N","9001","","4145","18236","1999-10-20 00:00:00","","EPSG","Used by Pakistan since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded by G.Bomford with slight error as Ind ft = 0.3048996m exac [...]
+datafile_rows_t horiz_cs_row_557[] = {"24377","Kalianpur 1962 / India zone IIa","Kalianpur 62 / India IIa","","","Pakistan - south of 28deg North.","projected 2D","","","East","North","E","N","9001","","4145","18237","1999-10-20 00:00:00","","EPSG","Used by Pakistan since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded by G.Bomford with slight error as Ind ft = 0.3048996m  [...]
+datafile_rows_t horiz_cs_row_558[] = {"24378","Kalianpur 1975 / India zone I","Kalianpur 75 / India I","","","India - north of 28deg North and west of 82deg East.","projected 2D","","","East","North","E","N","9001","","4146","18231","1999-10-20 00:00:00","","EPSG","Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.","97.23 [...]
+datafile_rows_t horiz_cs_row_559[] = {"24379","Kalianpur 1975 / India zone IIa","Kalianpur 75 / India IIa","","","India - between 28deg and 21deg North and west of 82deg East.","projected 2D","","","East","North","E","N","9001","","4146","18232","1999-10-20 00:00:00","","EPSG","Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exa [...]
+datafile_rows_t horiz_cs_row_560[] = {"24380","Kalianpur 1975 / India zone IIb","Kalianpur 75 / India IIb","","","India - north of 21deg North and east of 82deg East.","projected 2D","","","East","North","E","N","9001","","4146","18235","1999-10-20 00:00:00","","EPSG","Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.","9 [...]
+datafile_rows_t horiz_cs_row_561[] = {"24381","Kalianpur 1975 / India zone III","Kalianpur 75 / India III","","","India - between 21deg and 15deg North.","projected 2D","","","East","North","E","N","9001","","4146","18233","1999-10-20 00:00:00","","EPSG","Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.","97.23",NULL};
+datafile_rows_t horiz_cs_row_562[] = {"24382","Kalianpur 1880 / India zone IIb","Kalianpur / India IIb","","","Bangladesh; India - north of 22 deg North and east of 82 deg East; Myanmar (Burma) - north of 22 deg North.","projected 2D","","","East","North","E","N","9084","","4243","18113","1999-10-20 00:00:00","","EPSG","","97.23",NULL};
+datafile_rows_t horiz_cs_row_563[] = {"24383","Kalianpur 1975 / India zone IV","Kalianpur 75 / India IV","","","India - south of 21deg North.","projected 2D","","","East","North","E","N","9001","","4146","18234","1999-10-20 00:00:00","","EPSG","Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.","97.23",NULL};
+datafile_rows_t horiz_cs_row_564[] = {"24500","Kertau / Singapore Grid","","","","Singapore.","projected 2D","","","East","North","E","N","9001","","4245","19920","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_565[] = {"24547","Kertau / UTM zone 47N","","","","Malaysia - West Malaysia west of 102 deg East.","projected 2D","","","East","North","E","N","9001","","4245","16047","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_566[] = {"24548","Kertau / UTM zone 48N","","","","Malaysia - West Malaysia east of 102 deg East.","projected 2D","","","East","North","E","N","9001","","4245","16048","1995-07-21 00:00:00","","EPSG","","95.192",NULL};
+datafile_rows_t horiz_cs_row_567[] = {"24571","Kertau / R.S.O. Malaya (ch)","","","","Malaysia - West Malaysia","projected 2D","","","East","North","E","N","9062","","4245","19935","1999-10-20 00:00:00","","EPSG","Adopts metric conversion of 39.370113 inches per metre.","97.231",NULL};
+datafile_rows_t horiz_cs_row_568[] = {"24600","KOC Lambert","","","","Kuwait.","projected 2D","","","East","North","E","N","9001","","4246","19906","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_569[] = {"24718","La Canoa / UTM zone 18N","","","","Venezuela - west of 72 deg West.","projected 2D","","","East","North","E","N","9001","","4247","16018","1999-10-20 00:00:00","","EPSG","Sometimes referred to as PSAD56 / UTM zone 18N.","",NULL};
+datafile_rows_t horiz_cs_row_570[] = {"24719","La Canoa / UTM zone 19N","","","","Venezuela - between 72 and 66 deg West.","projected 2D","","","East","North","E","N","9001","","4247","16019","1999-10-20 00:00:00","","EPSG","Sometimes referred to as PSAD56 / UTM zone 19N.","",NULL};
+datafile_rows_t horiz_cs_row_571[] = {"24720","La Canoa / UTM zone 20N","","","","Venezuela - east of 66 deg West.","projected 2D","","","East","North","E","N","9001","","4247","16020","1995-06-02 00:00:00","","EPSG","Sometimes referred to as PSAD56 / UTM zone 20N.","",NULL};
+datafile_rows_t horiz_cs_row_572[] = {"24818","PSAD56 / UTM zone 18N","","","","South America (Ecuador;  [Venezuela]) 78deg West to 72deg West.","projected 2D","","","East","North","E","N","9001","","4248","16018","1995-06-02 00:00:00","","EPSG","In Venezuela also known as La Canoa / UTM zone 18N.","",NULL};
+datafile_rows_t horiz_cs_row_573[] = {"24819","PSAD56 / UTM zone 19N","","","","South America (Netherlands Antilles; [Venezuela]) 72deg West  to 66deg West.","projected 2D","","","East","North","E","N","9001","","4248","16019","1995-06-02 00:00:00","","EPSG","In Venezuela also known as La Canoa / UTM zone 19N.","",NULL};
+datafile_rows_t horiz_cs_row_574[] = {"24820","PSAD56 / UTM zone 20N","","","","South America (Guyana; [Venezuela]) 66deg West  to 60deg West.","projected 2D","","","East","North","E","N","9001","","4248","16020","1995-06-02 00:00:00","","EPSG","In Venezuela also known as La Canoa / UTM zone 20N.","",NULL};
+datafile_rows_t horiz_cs_row_575[] = {"24821","PSAD56 / UTM zone 21N","","","","South America (Guyana; Suriname) 60deg West  to 54deg West.","projected 2D","","","East","North","E","N","9001","","4248","16021","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_576[] = {"24877","PSAD56 / UTM zone 17S","","","","South America (Chile; Ecuador; Peru) 84deg West  to 78deg West.","projected 2D","","","East","North","E","N","9001","","4248","16117","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_577[] = {"24878","PSAD56 / UTM zone 18S","","","","South America (Chile; Ecuador; Peru) 78deg West  to 72deg West.","projected 2D","","","East","North","E","N","9001","","4248","16118","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_578[] = {"24879","PSAD56 / UTM zone 19S","","","","South America (Bolivia; Chile; Peru) 72deg West  to 66deg West.","projected 2D","","","East","North","E","N","9001","","4248","16119","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_579[] = {"24880","PSAD56 / UTM zone 20S","","","","South America (Bolivia) 66deg West  to 60deg West.","projected 2D","","","East","North","E","N","9001","","4248","16120","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_580[] = {"24882","PSAD56 / UTM zone 22S","","","","Brazil - offshore Amazon Cone","projected 2D","","","East","North","E","N","9001","","4248","16122","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_581[] = {"24891","PSAD56 / Peru west zone","","","","Peru west of 79 deg West.","projected 2D","","","East","North","X","Y","9001","","4248","18161","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_582[] = {"24892","PSAD56 / Peru central zone","PSAD56 / Peru central","","","Peru 79 to 73 deg West.","projected 2D","","","East","North","X","Y","9001","","4248","18162","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_583[] = {"24893","PSAD56 / Peru east zone","","","","Peru east of 73 deg West.","projected 2D","","","East","North","X","Y","9001","","4248","18163","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_584[] = {"25000","Leigon / Ghana Metre Grid","Leigon / Ghana Grid","","","Ghana.","projected 2D","","","East","North","E","N","9001","","4250","19904","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_585[] = {"25231","Lome / UTM zone 31N","","","","Togo.","projected 2D","","","East","North","E","N","9001","","4252","16031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_586[] = {"25391","Luzon 1911 / Philippines zone I","Luzon / Philippines I","","","Philippines - west of 118 deg East.","projected 2D","","","East","North","X","Y","9001","","4253","18171","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_587[] = {"25392","Luzon 1911 / Philippines zone II","Luzon / Philippines II","","","Philippines - Palawan; Calamian Islands.","projected 2D","","","East","North","X","Y","9001","","4253","18172","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_588[] = {"25393","Luzon 1911 / Philippines zone III","Luzon / Philippines III","","","Philippines - Luzon (except SE part;); Mindoro.","projected 2D","","","East","North","X","Y","9001","","4253","18173","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_589[] = {"25394","Luzon 1911 / Philippines zone IV","Luzon / Philippines IV","","","Philippines - SE Luzon; Tablas; Masbate; Panay; Cebu; Negros; west Mindanao.","projected 2D","","","East","North","X","Y","9001","","4253","18174","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_590[] = {"25395","Luzon 1911 / Philippines zone V","Luzon / Philippines V","","","Philippines - east Mindanao; Bohol; Samar.","projected 2D","","","East","North","X","Y","9001","","4253","18175","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_591[] = {"25700","Makassar (Jakarta) / NEIEZ","Makassar / NEIEZ","","","Indonesia - south west Sulawesi.","projected 2D","","","East","North","X","Y","9001","","4804","19905","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_592[] = {"25828","ETRF89 / UTM zone 28N","","","","Europe - 18deg West to 12deg West - United Kingdom (UKCS) offshore.","projected 2D","","","East","North","E","N","9001","","4258","16028","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_593[] = {"25829","ETRF89 / UTM zone 29N","","","","Europe - 12deg West to 6deg West - United Kingdom (UKCS) offshore.","projected 2D","","","East","North","E","N","9001","","4258","16029","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_594[] = {"25830","ETRF89 / UTM zone 30N","","","","Europe - 6deg West to 0deg.","projected 2D","","","East","North","E","N","9001","","4258","16030","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_595[] = {"25831","ETRF89 / UTM zone 31N","","","","Europe - 0deg to 6deg East - Norway.","projected 2D","","","East","North","E","N","9001","","4258","16031","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_596[] = {"25832","ETRF89 / UTM zone 32N","","","","Europe - 6deg East  to 12deg East - Norway.","projected 2D","","","East","North","E","N","9001","","4258","16032","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_597[] = {"25833","ETRF89 / UTM zone 33N","","","","Europe - 12deg East  to 18deg East - Norway.","projected 2D","","","East","North","E","N","9001","","4258","16033","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_598[] = {"25834","ETRF89 / UTM zone 34N","","","","Europe - 18deg East  to 24deg East - Norway.","projected 2D","","","East","North","E","N","9001","","4258","16034","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_599[] = {"25835","ETRF89 / UTM zone 35N","","","","Europe - 24deg East  to 30deg East - Norway.","projected 2D","","","East","North","E","N","9001","","4258","16035","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_600[] = {"25836","ETRF89 / UTM zone 36N","","","","Europe - 30deg East  to 36deg East.","projected 2D","","","East","North","E","N","9001","","4258","16036","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_601[] = {"25837","ETRF89 / UTM zone 37N","","","","Europe - 36deg East  to 42deg East.","projected 2D","","","East","North","E","N","9001","","4258","16037","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_602[] = {"25838","ETRF89 / UTM zone 38N","","","","Europe - 42deg East  to 48deg East.","projected 2D","","","East","North","E","N","9001","","4258","16038","1999-04-22 00:00:00","","EPSG","","99.11",NULL};
+datafile_rows_t horiz_cs_row_603[] = {"25884","ETRF89 / TM Baltic93","","","","Estonia;  Latvia;  Lithuania.","projected 2D","","","North","East","X","Y","9001","","4258","19939","1999-04-22 00:00:00","http://www.geo.ut.ee/~raivo/estcoord.html","EPSG","Used as a common coordinate system for the Baltic states and for medium and small scale mapping in Estonia since 1993.","99.11",NULL};
+datafile_rows_t horiz_cs_row_604[] = {"25932","Malongo 1987 / UTM zone 32S","Malongo 1987 / UTM 32S","","","Angola - Cabinda.","projected 2D","","","East","North","E","N","9001","","4259","16132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_605[] = {"26191","Merchich / Nord Maroc","","","","Morocco north of 35 grads (31 deg 30 min) North.","projected 2D","","","East","North","X","Y","9001","","4261","18131","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_606[] = {"26192","Merchich / Sud Maroc","","","","Morocco 31grads to 35grads  (27 deg 54 min to 31 deg 30 min) North.","projected 2D","","","East","North","X","Y","9001","","4261","18132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_607[] = {"26193","Merchich / Sahara","","","","Morocco south of 31grads  (27 deg 54 min) North.","projected 2D","","","East","North","X","Y","9001","","4261","18133","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_608[] = {"26237","Massawa / UTM zone 37N","","","","Eritrea.","projected 2D","","","East","North","E","N","9001","","4262","16037","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_609[] = {"26331","Minna / UTM zone 31N","","","","Nigeria - offshore beyond continental shelf west of 6 deg East.","projected 2D","","","East","North","E","N","9001","","4263","16031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_610[] = {"26332","Minna / UTM zone 32N","","","","Nigeria - offshore beyond continental shelf.","projected 2D","","","East","North","E","N","9001","","4263","16032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_611[] = {"26391","Minna / Nigeria West Belt","Minna / Nigeria West","","","Nigeria west of 6 deg 30 min East.","projected 2D","","","East","North","E","N","9001","","4263","18151","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_612[] = {"26392","Minna / Nigeria Mid Belt","","","","Nigeria between 6 deg 30 min and 10 deg 30 min East.","projected 2D","","","East","North","E","N","9001","","4263","18152","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_613[] = {"26393","Minna / Nigeria East Belt","Minna / Nigeria East","","","Nigeria east of 10 deg 30 min East.","projected 2D","","","East","North","E","N","9001","","4263","18153","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_614[] = {"26432","Mhast / UTM zone 32S","","","","Angola - Cabinda.","projected 2D","","","East","North","E","N","9001","","4264","16132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_615[] = {"26591","Monte Mario (Rome) / Italy zone 1","Monte Mario / Italy 1","","","Italy west of 12 deg East.","projected 2D","","","East","North","X","Y","9001","","4806","18121","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_616[] = {"26592","Monte Mario (Rome) / Italy zone 2","Monte Mario / Italy 2","","","Italy east of 12 deg East.","projected 2D","","","East","North","X","Y","9001","","4806","18122","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_617[] = {"26632","M'poraloko / UTM zone 32N","M'poraloko / UTM 32N","","","Gabon - north of equator.","projected 2D","","","East","North","E","N","9001","","4266","16032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_618[] = {"26692","M'poraloko / UTM zone 32S","M'poraloko / UTM 32S","","","Gabon - south of equator.","projected 2D","","","East","North","E","N","9001","","4266","16132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_619[] = {"26703","NAD27 / UTM zone 3N","","","","North America - United States (USA) - Alaska - 168deg West  to 162deg West.","projected 2D","","","East","North","E","N","9001","","4267","16003","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_620[] = {"26704","NAD27 / UTM zone 4N","","","","North America - United States (USA) - Alaska - 162deg West  to 156deg West.","projected 2D","","","East","North","E","N","9001","","4267","16004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_621[] = {"26705","NAD27 / UTM zone 5N","","","","North America - United States (USA) - Alaska - 156deg West  to 150deg West.","projected 2D","","","East","North","E","N","9001","","4267","16005","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_622[] = {"26706","NAD27 / UTM zone 6N","","","","North America - United States (USA) - Alaska - 150deg West  to 144deg West.","projected 2D","","","East","North","E","N","9001","","4267","16006","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_623[] = {"26707","NAD27 / UTM zone 7N","","","","North America - Canada; United States (USA) - Alaska - 144deg West  to 138deg West.","projected 2D","","","East","North","E","N","9001","","4267","16007","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_624[] = {"26708","NAD27 / UTM zone 8N","","","","North America - Canada; United States (USA) - 138deg West  to 132deg West.","projected 2D","","","East","North","E","N","9001","","4267","16008","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_625[] = {"26709","NAD27 / UTM zone 9N","","","","North America - Canada; United States (USA) - 132deg West  to 126deg West.","projected 2D","","","East","North","E","N","9001","","4267","16009","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_626[] = {"26710","NAD27 / UTM zone 10N","","","","North America - Canada; United States (USA) - 130deg West  to 120deg West.","projected 2D","","","East","North","E","N","9001","","4267","16010","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_627[] = {"26711","NAD27 / UTM zone 11N","","","","North America - Canada; Mexico; United States (USA) - 120deg West  to 114deg West.","projected 2D","","","East","North","E","N","9001","","4267","16011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_628[] = {"26712","NAD27 / UTM zone 12N","","","","North America - Canada; Mexico; United States (USA) - 114deg West  to 108deg West.","projected 2D","","","East","North","E","N","9001","","4267","16012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_629[] = {"26713","NAD27 / UTM zone 13N","","","","North America - Canada; Mexico; United States (USA) - 108deg West  to 102deg West.","projected 2D","","","East","North","E","N","9001","","4267","16013","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_630[] = {"26714","NAD27 / UTM zone 14N","","","","North America - Canada; Mexico; United States (USA) - 102deg West  to 96deg West.","projected 2D","","","East","North","E","N","9001","","4267","16014","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_631[] = {"26715","NAD27 / UTM zone 15N","","","","North America - Canada; Mexico; United States (USA) - 96deg West  to 90deg West.","projected 2D","","","East","North","E","N","9001","","4267","16015","1995-06-02 00:00:00","","EPSG","In Ontario superseded by NAD27(76) / UTM zone 15N (code 227).","",NULL};
+datafile_rows_t horiz_cs_row_632[] = {"26716","NAD27 / UTM zone 16N","","","","North America - Canada; Mexico; United States (USA) - 90deg West  to 84deg West.","projected 2D","","","East","North","E","N","9001","","4267","16016","1995-06-02 00:00:00","","EPSG","In Ontario superseded by NAD27(76) / UTM zone 16N (code 228).","",NULL};
+datafile_rows_t horiz_cs_row_633[] = {"26717","NAD27 / UTM zone 17N","","","","North America - Canada; Mexico; United States (USA) - 84deg West  to 78deg West.","projected 2D","","","East","North","E","N","9001","","4267","16017","1995-06-02 00:00:00","","EPSG","In Ontario superseded by NAD27(76) / UTM zone 17N (code 229).  In Quebec superseded by NAD27(CGQ77) / UTM zone 17N (code 231).","",NULL};
+datafile_rows_t horiz_cs_row_634[] = {"26718","NAD27 / UTM zone 18N","","","","North America - Canada; United States (USA) - 78deg West  to 72deg West.","projected 2D","","","East","North","E","N","9001","","4267","16018","1995-06-02 00:00:00","","EPSG","In Ontario superseded by NAD27(76) / UTM zone 18N (code 230).  In Quebec superseded by NAD27(CGQ77) / UTM zone 18N (code 232).","",NULL};
+datafile_rows_t horiz_cs_row_635[] = {"26719","NAD27 / UTM zone 19N","","","","North America - Canada; United States (USA) - 72deg West  to 66deg West.","projected 2D","","","East","North","E","N","9001","","4267","16019","1995-06-02 00:00:00","","EPSG","In Quebec superseded by NAD27(CGQ77) / UTM zone 19N (code 233).","",NULL};
+datafile_rows_t horiz_cs_row_636[] = {"26720","NAD27 / UTM zone 20N","","","","North America - Antigua and Barbuda - Barbuda.  British Virgin Islands (military).  Canada; United States (USA) offshore Atlantic - 66deg West  to 60deg West.","projected 2D","","","East","North","E","N","9001","","4267","16020","1995-06-02 00:00:00","","EPSG","In Quebec superseded by NAD27(CGQ77) / UTM zone 20N (code 234).","",NULL};
+datafile_rows_t horiz_cs_row_637[] = {"26721","NAD27 / UTM zone 21N","","","","North America - Canada - 60deg West  to 54deg West.","projected 2D","","","East","North","E","N","9001","","4267","16021","1995-06-02 00:00:00","","EPSG","In Quebec superseded by NAD27(CGQ77) / UTM zone 21N (code 235).","",NULL};
+datafile_rows_t horiz_cs_row_638[] = {"26722","NAD27 / UTM zone 22N","","","","North America - Canada - 54deg West  to 48deg West.","projected 2D","","","East","North","E","N","9001","","4267","16022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_639[] = {"26729","NAD27 / Alabama East","","","","United States (USA) - Alabama - AL_E - counties east of approx 86d 37m West - Barbour; Bullock; Calhoun; Chambers; Cherokee; Clay; Cleburne; Coffee; Coosa; Covington; Crenshaw; Dale; De Kalb; Elmore; Etowah; Geneva; Henry; Houston; Jackson; Lee; Macon; Mad","projected 2D","","","East","North","X","Y","9003","","4267","10101","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_640[] = {"26730","NAD27 / Alabama West","","","","United States (USA) - Alabama - AL_W - counties west of approx 86d 37m West - Autauga; Baldwin; Bibb; Blount; Butler; Chilton; Choctaw; Clarke; Colbert; Conecuh; Cullman; Dallas; Escambia; Fayette; Franklin; Greene; Hale; Jefferson; Lamar; Lauderdale; Lawr","projected 2D","","","East","North","X","Y","9003","","4267","10102","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_641[] = {"26731","NAD27 / Alaska zone 1","","","","United States - Alaska - Panhandle.","projected 2D","","","East","North","X","Y","9003","","4267","15001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_642[] = {"26732","NAD27 / Alaska zone 2","","","","United States - Alaska - 141deg to 144deg West.","projected 2D","","","East","North","X","Y","9003","","4267","15002","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_643[] = {"26733","NAD27 / Alaska zone 3","","","","United States - Alaska - 144deg to 148deg West.","projected 2D","","","East","North","X","Y","9003","","4267","15003","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_644[] = {"26734","NAD27 / Alaska zone 4","","","","United States - Alaska - 148deg to 152deg West.","projected 2D","","","East","North","X","Y","9003","","4267","15004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_645[] = {"26735","NAD27 / Alaska zone 5","","","","United States - Alaska - 152deg to 156deg West.","projected 2D","","","East","North","X","Y","9003","","4267","15005","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_646[] = {"26736","NAD27 / Alaska zone 6","","","","United States - Alaska - 156deg to 160deg West.","projected 2D","","","East","North","X","Y","9003","","4267","15006","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_647[] = {"26737","NAD27 / Alaska zone 7","","","","United States - Alaska - 160deg to 164deg West.","projected 2D","","","East","North","X","Y","9003","","4267","15007","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_648[] = {"26738","NAD27 / Alaska zone 8","","","","United States - Alaska - 164deg to 168deg West; north of 54d 30m North.","projected 2D","","","East","North","X","Y","9003","","4267","15008","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_649[] = {"26739","NAD27 / Alaska zone 9","","","","United States - Alaska - West of 168deg West and north of 54d 30m North.","projected 2D","","","East","North","X","Y","9003","","4267","15009","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_650[] = {"26740","NAD27 / Alaska zone 10","","","","United States - Alaska - Aleutian Islands.","projected 2D","","","East","North","X","Y","9003","","4267","15010","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_651[] = {"26741","NAD27 / California zone I","NAD27 / California I","","","United States (USA) - California - CA_1 - counties north of approx 40 deg North - Del Norte; Humboldt; Lassen; Modoc; Plumas; Shasta; Siskiyou; Tehama; Trinity","projected 2D","","","East","North","X","Y","9003","","4267","10401","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_652[] = {"26742","NAD27 / California zone II","NAD27 / California II","","","United States (USA) - California - CA_2 - counties between approx 40 deg & 38d 15m North - Alpine; Amador; Butte; Colusa; El Dorado; Glenn; Lake; Mendocino; Napa; Nevada; Placer; Sacramento; Sierra; Solano; Sonoma; Sutter; Yolo; Yuba","projected 2D","","","East","North","X","Y","9003","","4267","10402","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_653[] = {"26743","NAD27 / California zone III","NAD27 / California III","","","United States (USA) - California - CA_3 - counties between approx 38d 15m & 37d North - Alameda; Calaveras; Contra Costa; Madera; Marin; Mariposa; Merced; Mono; San Francisco; San Joaquin; San Mateo; Santa Clara; Santa Cruz; Stanislaus; Tuolumne","projected 2D","","","East","North","X","Y","9003","","4267","10403","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_654[] = {"26744","NAD27 / California zone IV","NAD27 / California IV","","","United States (USA) - California - CA_4 - counties between approx 37d & 35d 30m North - Fresno; Inyo; Kings; Monterey; San Benito; Tulare","projected 2D","","","East","North","X","Y","9003","","4267","10404","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_655[] = {"26745","NAD27 / California zone V","NAD27 / California V","","","United States (USA) - California - CA_5 - counties between approx 35d 50m & 34d North - Kern; San Bernardino; San Luis Obispo; Santa Barbara; Ventura","projected 2D","","","East","North","X","Y","9003","","4267","10405","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_656[] = {"26746","NAD27 / California zone VI","NAD27 / California VI","","","United States (USA) - California - CA_6 - counties south of approx 38d 30m North - Imperial; Orange; Riverside; San Diego","projected 2D","","","East","North","X","Y","9003","","4267","10406","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_657[] = {"26747","NAD27 / California zone VII","NAD27 / California VII","","","United States - California - Los Angeles.","projected 2D","","","East","North","X","Y","9003","","4267","10407","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_658[] = {"26748","NAD27 / Arizona East","","","","United States (USA) - Arizona - AZ_E - counties east of approx 110d 45m West - Apache; Cochise; Gila; Graham; Greenlee; Navajo","projected 2D","","","East","North","X","Y","9003","","4267","10201","1995-08-22 00:00:00","","EPSG","","95.25",NULL};
+datafile_rows_t horiz_cs_row_659[] = {"26749","NAD27 / Arizona Central","","","","United States (USA) - Arizona - AZ_C - counties between approx 110d 45m and 113d 20m West - Coconino; Maricopa; Pima; Pinal; Santa Cruz; Yavapai","projected 2D","","","East","North","X","Y","9003","","4267","10202","1995-08-22 00:00:00","","EPSG","","95.25",NULL};
+datafile_rows_t horiz_cs_row_660[] = {"26750","NAD27 / Arizona West","","","","United States (USA) - Arizona - AZ_W - counties west of approx 113d 20m West - La Paz; Mohave; Yuma","projected 2D","","","East","North","X","Y","9003","","4267","10203","1995-08-22 00:00:00","","EPSG","","95.25",NULL};
+datafile_rows_t horiz_cs_row_661[] = {"26751","NAD27 / Arkansas North","","","","United States (USA) - Arkansas - AR_N - counties north of approx 34d 50m North - Baxter; Benton; Boone; Carroll; Clay; Cleburne; Conway; Craighead; Crawford; Crittenden; Cross; Faulkner; Franklin; Fulton; Greene; Independence; Izard; Jackson; Johnson; Lawr","projected 2D","","","East","North","X","Y","9003","","4267","10301","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_662[] = {"26752","NAD27 / Arkansas South","","","","United States (USA) - Arkansas - AR_S - counties south of approx 34d 50m North - Arkansas; Ashley; Bradley; Calhoun; Chicot; Clark; Cleveland; Columbia; Dallas; Desha; Drew; Garland; Grant; Hempstead; Hot Spring; Howard; Jefferson; Lafayette; Lee; Lincoln;","projected 2D","","","East","North","X","Y","9003","","4267","10302","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_663[] = {"26753","NAD27 / Colorado North","","","","United States (USA) - Colorado - CO_N - counties north of approx 39d 50m North - Adams; Boulder; Gilpin; Grand; Jackson; Larimer; Logan; Moffat; Morgan; Phillips; Rio Blanco; Routt; Sedgwick; Washington; Weld; Yuma","projected 2D","","","East","North","X","Y","9003","","4267","10501","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_664[] = {"26754","NAD27 / Colorado Central","","","","United States (USA) - Colorado - CO_C - counties between approx 39d 50m & 38d 30m North - Arapahoe; Chaffee; Cheyenne; Clear Creek; Delta; Denver; Douglas; Eagle; El Paso; Elbert; Fremont; Garfield; Gunnison; Jefferson; Kit Carson; Lake; Lincoln; Mesa; Par","projected 2D","","","East","North","X","Y","9003","","4267","10502","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_665[] = {"26755","NAD27 / Colorado South","","","","United States (USA) - Colorado - CO_S - counties south of approx 38d 30m North - Alamosa; Archuleta; Baca; Bent; Conejos; Costilla; Crowley; Custer; Dolores; Hinsdale; Huerfano; Kiowa; La Plata; Las Animas; Mineral; Montezuma; Montrose; Otero; Ouray; Prowe","projected 2D","","","East","North","X","Y","9003","","4267","10503","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_666[] = {"26756","NAD27 / Connecticut","","","","United States (USA) - Connecticut - CT - counties of Fairfield; Hartford; Litchfield; Middlesex; New Haven; New London; Tolland; Windham","projected 2D","","","East","North","X","Y","9003","","4267","10600","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_667[] = {"26757","NAD27 / Delaware","","","","United States (USA) - Delaware - DE - counties of Kent; New Castle; Sussex","projected 2D","","","East","North","X","Y","9003","","4267","10700","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_668[] = {"26758","NAD27 / Florida East","","","","United States (USA) - Florida - FL_E - counties of Brevard; Broward; Clay; Collier; Dade; Duval; Flagler; Glades; Hendry; Highlands; Indian River; Lake; Martin; Monroe; Nassau; Okeechobee; Orange; Osceola; Palm Beach; Putnam; Seminole; St. Johns; St. Lucie","projected 2D","","","East","North","X","Y","9003","","4267","10901","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_669[] = {"26759","NAD27 / Florida West","","","","United States (USA) - Florida - FL_W - counties of Charlotte; Citrus; De Soto; Hardee; Hernando; Hillsborough; Lee; Levy; Manatee; Marion; Pasco; Pinellas; Polk; Sarasota; Sumter","projected 2D","","","East","North","X","Y","9003","","4267","10902","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_670[] = {"26760","NAD27 / Florida North","","","","United States (USA) - Florida - FL_N - counties of Alachua; Baker; Bay; Bradford; Calhoun; Columbia; Dixie; Escambia; Escambia; Franklin; Gadsden; Gilchrist; Gulf; Hamilton; Holmes; Jackson; Jefferson; Lafayette; Leon; Liberty; Madison; Okaloosa; Santa Ros","projected 2D","","","East","North","X","Y","9003","","4267","10903","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_671[] = {"26766","NAD27 / Georgia East","","","","United States (USA) - Georgia - GA_E - counties of Appling; Atkinson; Bacon; Baldwin; Brantley; Bryan; Bulloch; Burke; Camden; Candler; Charlton; Chatham; Clinch; Coffee; Columbia; Dodge; Echols; Effingham; Elbert; Emanuel; Evans; Franklin; Glascock; Glynn","projected 2D","","","East","North","X","Y","9003","","4267","11001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_672[] = {"26767","NAD27 / Georgia West","","","","United States (USA) - Georgia - GA_W - counties of Baker; Banks; Barrow; Bartow; Ben Hill; Berrien; Bibb; Bleckley; Brooks; Butts; Calhoun; Carroll; Catoosa; Chattahoochee; Chattooga; Cherokee; Clarke; Clay; Clayton; Cobb; Colquitt; Cook; Coweta; Crawford;","projected 2D","","","East","North","X","Y","9003","","4267","11002","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_673[] = {"26768","NAD27 / Idaho East","","","","United States (USA) - Idaho - ID_E - counties of Bannock; Bear Lake; Bingham; Bonneville; Caribou; Clark; Franklin; Fremont; Jefferson; Madison; Oneida; Power; Teton","projected 2D","","","East","North","X","Y","9003","","4267","11101","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_674[] = {"26769","NAD27 / Idaho Central","","","","United States (USA) - daho - ID_C - counties of Blaine; Butte; Camas; Cassia; Custer; Gooding; Jerome; Lemhi; Lincoln; Minidoka; Twin Falls","projected 2D","","","East","North","X","Y","9003","","4267","11102","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_675[] = {"26770","NAD27 / Idaho West","","","","United States (USA) - Idaho - ID_W - counties of Ada; Adams; Benewah; Boise; Bonner; Boundary; Canyon; Clearwater; Elmore; Gem; Idaho; Kootenai; Latah; Lewis; Nez Perce; Owyhee; Payette; Shoshone; Valley; Washington","projected 2D","","","East","North","X","Y","9003","","4267","11103","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_676[] = {"26771","NAD27 / Illinois East","","","","United States (USA) - Illinois - IL_E - counties of Boone; Champaign; Clark; Clay; Coles; Cook; Crawford; Cumberland; De Kalb; De Witt; Douglas; Du Page; Edgar; Edwards; Effingham; Fayette; Ford; Franklin; Gallatin; Grundy; Hamilton; Hardin; Iroquois; Jasp","projected 2D","","","East","North","X","Y","9003","","4267","11201","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_677[] = {"26772","NAD27 / Illinois West","","","","United States (USA) - Illinois - IL_W - counties of Adams; Alexander; Bond; Brown; Bureau; Calhoun; Carroll; Cass; Christian; Clinton; Fulton; Greene; Hancock; Henderson; Henry; Jackson; Jersey; Jo Daviess; Knox; Lee; Logan; Macoupin; Madison; Marshall; Ma","projected 2D","","","East","North","X","Y","9003","","4267","11202","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_678[] = {"26773","NAD27 / Indiana East","","","","United States (USA) - Indiana - IN_E - counties of Adams; Allen; Bartholomew; Blackford; Brown; Cass; Clark; De Kalb; Dearborn; Decatur; Delaware; Elkhart; Fayette; Floyd; Franklin; Fulton; Grant; Hamilton; Hancock; Harrison; Henry; Howard; Huntington; Jac","projected 2D","","","East","North","X","Y","9003","","4267","11301","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_679[] = {"26774","NAD27 / Indiana West","","","","United States (USA) - Indiana - IN_W - counties of Benton; Boone; Carroll; Clay; Clinton; Crawford; Daviess; Dubois; Fountain; Gibson; Greene; Hendricks; Jasper; Knox; La Porte; Lake; Lawrence; Martin; Monroe; Montgomery; Morgan; Newton; Orange; Owen; Park","projected 2D","","","East","North","X","Y","9003","","4267","11302","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_680[] = {"26775","NAD27 / Iowa North","","","","United States (USA) - Iowa - IA_N - counties of Allamakee; Benton; Black Hawk; Boone; Bremer; Buchanan; Buena Vista; Butler; Calhoun; Carroll; Cerro Gordo; Cherokee; Chickasaw; Clay; Clayton; Crawford; Delaware; Dickinson; Dubuque; Emmet; Fayette; Floyd; F","projected 2D","","","East","North","X","Y","9003","","4267","11401","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_681[] = {"26776","NAD27 / Iowa South","","","","United States (USA) - Iowa - IA_S - counties of Adair; Adams; Appanoose; Audubon; Cass; Cedar; Clarke; Clinton; Dallas; Davis; Decatur; Des Moines; Fremont; Guthrie; Harrison; Henry; Iowa; Jasper; Jefferson; Johnson; Keokuk; Lee; Louisa; Lucas; Madison; Ma","projected 2D","","","East","North","X","Y","9003","","4267","11402","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_682[] = {"26777","NAD27 / Kansas North","","","","United States (USA) - Kansas - KS_N - counties of Atchison; Brown; Cheyenne; Clay; Cloud; Decatur; Dickinson; Doniphan; Douglas; Ellis; Ellsworth; Geary; Gove; Graham; Jackson; Jefferson; Jewell; Johnson; Leavenworth; Lincoln; Logan; Marshall; Mitchell; Mo","projected 2D","","","East","North","X","Y","9003","","4267","11501","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_683[] = {"26778","NAD27 / Kansas South","","","","United States (USA) - Kansas - KS_S - counties of Allen; Anderson; Barber; Barton; Bourbon; Butler; Chase; Chautauqua; Cherokee; Clark; Coffey; Comanche; Cowley; Crawford; Edwards; Elk; Finney; Ford; Franklin; Grant; Gray; Greeley; Greenwood; Hamilton; Har","projected 2D","","","East","North","X","Y","9003","","4267","11502","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_684[] = {"26779","NAD27 / Kentucky North","","","","United States (USA) - Kentucky - KY_N - counties of Anderson; Bath; Boone; Bourbon; Boyd; Bracken; Bullitt; Campbell; Carroll; Carter; Clark; Elliott; Fayette; Fleming; Franklin; Gallatin; Grant; Greenup; Harrison; Henry; Jefferson; Jessamine; Kenton; Lawr","projected 2D","","","East","North","X","Y","9003","","4267","11601","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_685[] = {"26780","NAD27 / Kentucky South","","","","United States (USA) - Kentucky - KY_S - counties of Adair; Allen; Ballard; Barren; Bell; Boyle; Breathitt; Breckinridge; Butler; Caldwell; Calloway; Carlisle; Casey; Christian; Clay; Clinton; Crittenden; Cumberland; Daviess; Edmonson; Estill; Floyd; Fulton","projected 2D","","","East","North","X","Y","9003","","4267","11602","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_686[] = {"26781","NAD27 / Louisiana North","","","","United States (USA) - Louisiana - LA_N - counties of Avoyelles; Bienville; Bossier; Caddo; Caldwell; Catahoula; Claiborne; Concordia; De Soto; East Carroll; Franklin; Grant; Jackson; La Salle; Lincoln; Madison; Morehouse; Natchitoches; Ouachita; Rapides; R","projected 2D","","","East","North","X","Y","9003","","4267","11701","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_687[] = {"26782","NAD27 / Louisiana South","","","","United States (USA) - Louisiana - LA_S - counties of Acadia; Allen; Ascension; Assumption; Beauregard; Calcasieu; Cameron; East Baton Rouge; East Feliciana; Evangeline; Iberia; Iberville; Jefferson; Jefferson Davis; Lafayette; LaFourche; Livingston; Orlean","projected 2D","","","East","North","X","Y","9003","","4267","11702","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_688[] = {"26783","NAD27 / Maine East","","","","United States (USA) - Maine - ME_E - counties of Aroostook; Hancock; Knox; Penobscot; Piscataquis; Waldo; Washington","projected 2D","","","East","North","X","Y","9003","","4267","11801","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_689[] = {"26784","NAD27 / Maine West","","","","United States (USA) - Maine - ME_W - counties of Androscoggin; Cumberland; Franklin; Kennebec; Lincoln; Oxford; Sagadahoc; Somerset; York","projected 2D","","","East","North","X","Y","9003","","4267","11802","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_690[] = {"26785","NAD27 / Maryland","","","","United States (USA) - Maryland -MD - counties of Allegany; Anne Arundel; Baltimore; Calvert; Caroline; Carroll; Cecil; Charles; Dorchester; Frederick; Garrett; Harford; Howard; Kent; Montgomery; Prince Georges; Queen Annes; Somerset; St. Marys; Talbot; Was","projected 2D","","","East","North","X","Y","9003","","4267","11900","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_691[] = {"26786","NAD27 / Massachusetts Mainland","NAD27 / Massachusetts","","","United States (USA) - Massachusetts - MA_M - counties of Barnstable; Berkshire; Bristol; Essex; Franklin; Hampden; Hampshire; Middlesex; Norfolk; Plymouth; Suffolk; Worcester","projected 2D","","","East","North","X","Y","9003","","4267","12001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_692[] = {"26787","NAD27 / Massachusetts Island","NAD27 / Massachusetts Is","","","United States (USA) - Massachusetts - MA_I - counties of Dukes; Nantucket","projected 2D","","","East","North","X","Y","9003","","4267","12002","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_693[] = {"26791","NAD27 / Minnesota North","","","","United States (USA) - Minnesota - MN_N - counties of Beltrami; Clearwater; Cook; Itasca; Kittson; Koochiching; Lake; Lake of the Woods; Mahnomen; Marshall; Norman; Pennington; Polk; Red Lake; Roseau; St. Louis","projected 2D","","","East","North","X","Y","9003","","4267","12201","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_694[] = {"26792","NAD27 / Minnesota Central","NAD27 / Minnesota Cent.","","","United States (USA) - Minnesota - MN_C - counties of Aitkin; Becker; Benton; Carlton; Cass; Chisago; Clay; Crow Wing; Douglas; Grant; Hubbard; Isanti; Kanabec; Mille Lacs; Morrison; Otter Tail; Pine; Pope; Stearns; Stevens; Todd; Traverse; Wadena; Wilkin","projected 2D","","","East","North","X","Y","9003","","4267","12202","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_695[] = {"26793","NAD27 / Minnesota South","","","","United States (USA) - Minnesota - MN_S - counties of Anoka; Big Stone; Blue Earth; Brown; Carver; Chippewa; Cottonwood; Dakota; Dodge; Faribault; Fillmore; Freeborn; Goodhue; Hennepin; Houston; Jackson; Kandiyohi; Lac Qui Parle; Le Sueur; Lincoln; Lyon; Ma","projected 2D","","","East","North","X","Y","9003","","4267","12203","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_696[] = {"26794","NAD27 / Mississippi East","","","","United States (USA) - Mississippi - MS_E - counties of Alcorn; Attala; Benton; Calhoun; Chickasaw; Choctaw; Clarke; Clay; Covington; Forrest; George; Greene; Hancock; Harrison; Itawamba; Jackson; Jasper; Jones; Kemper; Lafayette; Lamar; Lauderdale; Leake; ","projected 2D","","","East","North","X","Y","9003","","4267","12301","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_697[] = {"26795","NAD27 / Mississippi West","","","","United States (USA) - Mississippi - MS_W - counties of Adams; Amite; Bolivar; Carroll; Claiborne; Coahoma; Copiah; De Soto; Franklin; Grenada; Hinds; Holmes; Humphreys; Issaquena; Jefferson; Jefferson Davis; Lawrence; Leflore; Lincoln; Madison; Marion; Mon","projected 2D","","","East","North","X","Y","9003","","4267","12302","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_698[] = {"26796","NAD27 / Missouri East","","","","United States (USA) - Missouri - MO_E - counties of Bollinger; Butler; Cape Girardeau; Carter; Clark; Crawford; Dent; Dunklin; Franklin; Gasconade; Iron; Jefferson; Lewis; Lincoln; Madison; Marion; Mississippi; Montgomery; New Madrid; Oregon; Pemiscot; Per","projected 2D","","","East","North","X","Y","9003","","4267","12401","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_699[] = {"26797","NAD27 / Missouri Central","","","","United States (USA) - Missouri - MO_C - counties of Adair; Audrain; Benton; Boone; Callaway; Camden; Carroll; Chariton; Christian; Cole; Cooper; Dallas; Douglas; Greene; Grundy; Hickory; Howard; Howell; Knox; Laclede; Linn; Livingston; Macon; Maries; Merce","projected 2D","","","East","North","X","Y","9003","","4267","12402","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_700[] = {"26798","NAD27 / Missouri West","","","","United States (USA) - Missouri - MO_W - counties of Andrew; Atchison; Barry; Barton; Bates; Buchanan; Caldwell; Cass; Cedar; Clay; Clinton; Dade; Daviess; De Kalb; Gentry; Harrison; Henry; Holt; Jackson; Jasper; Johnson; Lafayette; Lawrence; McDonald; Newt","projected 2D","","","East","North","X","Y","9003","","4267","12403","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_701[] = {"26801","NAD Michigan / Michigan East","NAD27 / Michigan East","","","United States (USA) - Michigan - MI_E - counties of Alcona; Alpena; Arenac; Bay; Cheboygan; Clinton; Crawford; Genesee; Gladwin; Gratiot; Hillsdale; Huron; Ingham; Iosco; Jackson; Lapeer; Lenawee; Livingston; Macomb; Midland; Monroe; Montmorency; Oakland; ","projected 2D","","","East","North","X","Y","9003","","4268","12101","1998-11-11 00:00:00","","EPSG","Superseded by 26811 2681 [...]
+datafile_rows_t horiz_cs_row_702[] = {"26802","NAD Michigan / Michigan Old Central","NAD27 / Michigan Old Cen","","","United States (USA) - Michigan - MI_C - counties of Allegan; Antrim; Barry; Benzie; Berrien; Branch; Calhoun; Cass; Charlevoix; Clare; Eaton; Emmet; Grand Traverse; Ionia; Isabella; Kalamazoo; Kalkaska; Kent; Lake; Leelanau; Manistee; Mason; Mecosta; Missa","projected 2D","","","East","North","X","Y","9003","","4268","12102","1998-11-11 00:00:00","","EPSG","Superseded by  [...]
+datafile_rows_t horiz_cs_row_703[] = {"26803","NAD Michigan / Michigan West","NAD27 / Michigan West","","","United States (USA) - Michigan - MI_W - counties of Alger; Baraga; Chippewa; Delta; Dickinson; Gogebic; Houghton; Iron; Keweenaw; Luce; Mackinac; Marquette; Menominee; Ontonagon; Schoolcraft","projected 2D","","","East","North","X","Y","9003","","4268","12103","1998-11-11 00:00:00","","EPSG","Superseded by 26811 26812 and 26813.","95.25  97.19  98.22",NULL};
+datafile_rows_t horiz_cs_row_704[] = {"26811","NAD Michigan / Michigan North","NAD27 / Michigan North","","","United States (USA) - Michigan - MI_N - counties of Alger; Baraga; Chippewa; Delta; Dickinson; Gogebic; Houghton; Iron; Keweenaw; Luce; Mackinac; Marquette; Menominee; Ontonagon; Schoolcraft","projected 2D","","","East","North","X","Y","9003","","4268","12111","1998-11-11 00:00:00","","EPSG","Supersedes 26801 26802 and 26803.","96.28  98.22",NULL};
+datafile_rows_t horiz_cs_row_705[] = {"26812","NAD Michigan / Michigan Central","NAD27 / Michigan Central","","","United States (USA) - Michigan - MI_C - counties of Alcona; Alpena; Antrim; Arenac; Benzie; Charlevoix; Cheboygan; Clare; Crawford; Emmet; Gladwin; Grand Traverse; Iosco; Kalkaska; Lake; Leelanau; Manistee; Mason; Missaukee; Montmorency; Ogemaw; Osceola; O","projected 2D","","","East","North","X","Y","9003","","4268","12112","1998-11-11 00:00:00","","EPSG","Supersedes 26801 2 [...]
+datafile_rows_t horiz_cs_row_706[] = {"26813","NAD Michigan / Michigan South","NAD27 / Michigan South","","","United States (USA) - Michigan - MI_S - counties of Allegan; Barry; Bay; Berrien; Branch; Calhoun; Cass; Clinton; Eaton; Genesee; Gratiot; Hillsdale; Huron; Ingham; Ionia; Isabella; Jackson; Kalamazoo; Kent; Lapeer; Lenawee; Livingston; Macomb; Mecosta; Mi","projected 2D","","","East","North","X","Y","9003","","4268","12113","1998-11-11 00:00:00","","EPSG","Supersedes 26801 26802 [...]
+datafile_rows_t horiz_cs_row_707[] = {"26903","NAD83 / UTM zone 3N","","","","North America - United States (USA) - Alaska - 168deg West  to 162deg West.","projected 2D","","","East","North","E","N","9001","","4269","16003","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_708[] = {"26904","NAD83 / UTM zone 4N","","","","North America - United States (USA) - Alaska - 162deg West  to 156deg West.","projected 2D","","","East","North","E","N","9001","","4269","16004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_709[] = {"26905","NAD83 / UTM zone 5N","","","","North America - United States (USA) - Alaska - 156deg West  to 150deg West.","projected 2D","","","East","North","E","N","9001","","4269","16005","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_710[] = {"26906","NAD83 / UTM zone 6N","","","","North America - United States (USA) - Alaska - 150deg West  to 144deg West.","projected 2D","","","East","North","E","N","9001","","4269","16006","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_711[] = {"26907","NAD83 / UTM zone 7N","","","","North America - Canada; United States (USA) - Alaska - 144deg West  to 138deg West.","projected 2D","","","East","North","E","N","9001","","4269","16007","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_712[] = {"26908","NAD83 / UTM zone 8N","","","","North America - Canada; United States (USA) - 138deg West  to 132deg West.","projected 2D","","","East","North","E","N","9001","","4269","16008","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_713[] = {"26909","NAD83 / UTM zone 9N","","","","North America - Canada; United States (USA) - 132deg West  to 126deg West.","projected 2D","","","East","North","E","N","9001","","4269","16009","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_714[] = {"26910","NAD83 / UTM zone 10N","","","","North America - Canada; United States (USA) - 130deg West  to 120deg West.","projected 2D","","","East","North","E","N","9001","","4269","16010","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_715[] = {"26911","NAD83 / UTM zone 11N","","","","North America - Canada; Mexico; United States (USA) - 120deg West  to 114deg West.","projected 2D","","","East","North","E","N","9001","","4269","16011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_716[] = {"26912","NAD83 / UTM zone 12N","","","","North America - Canada; Mexico; United States (USA) - 114deg West  to 108deg West.","projected 2D","","","East","North","E","N","9001","","4269","16012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_717[] = {"26913","NAD83 / UTM zone 13N","","","","North America - Canada; Mexico; United States (USA) - 108deg West  to 102deg West.","projected 2D","","","East","North","E","N","9001","","4269","16013","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_718[] = {"26914","NAD83 / UTM zone 14N","","","","North America - Canada; Mexico; United States (USA) - 102deg West  to 96deg West.","projected 2D","","","East","North","E","N","9001","","4269","16014","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_719[] = {"26915","NAD83 / UTM zone 15N","","","","North America - Canada; Mexico; United States (USA) - 96deg West  to 90deg West.","projected 2D","","","East","North","E","N","9001","","4269","16015","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_720[] = {"26916","NAD83 / UTM zone 16N","","","","North America - Canada; Mexico; United States (USA) - 90deg West  to 84deg West.","projected 2D","","","East","North","E","N","9001","","4269","16016","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_721[] = {"26917","NAD83 / UTM zone 17N","","","","North America - Canada; Mexico; United States (USA) - 84deg West  to 78deg West.","projected 2D","","","East","North","E","N","9001","","4269","16017","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_722[] = {"26918","NAD83 / UTM zone 18N","","","","North America - Canada; United States (USA) - 78deg West  to 72deg West.","projected 2D","","","East","North","E","N","9001","","4269","16018","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_723[] = {"26919","NAD83 / UTM zone 19N","","","","North America - Canada; United States (USA) - 72deg West  to 66deg West.","projected 2D","","","East","North","E","N","9001","","4269","16019","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_724[] = {"26920","NAD83 / UTM zone 20N","","","","North America - Canada; United States (USA) offshore Atlantic - 66deg West  to 60deg West.","projected 2D","","","East","North","E","N","9001","","4269","16020","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_725[] = {"26921","NAD83 / UTM zone 21N","","","","North America - Canada - 60deg West  to 54deg West.","projected 2D","","","East","North","E","N","9001","","4269","16021","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_726[] = {"26922","NAD83 / UTM zone 22N","","","","North America - Canada - Newfoundland - 54deg West  to 48deg West.","projected 2D","","","East","North","E","N","9001","","4269","16022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_727[] = {"26923","NAD83 / UTM zone 23N","","","","North America - Canada offshore Atlantic - 48deg West  to 42deg West.","projected 2D","","","East","North","E","N","9001","","4269","16023","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_728[] = {"26929","NAD83 / Alabama East","","","","United States (USA) - Alabama - AL_E - counties east of approx 86d 37m West - Barbour; Bullock; Calhoun; Chambers; Cherokee; Clay; Cleburne; Coffee; Coosa; Covington; Crenshaw; Dale; De Kalb; Elmore; Etowah; Geneva; Henry; Houston; Jackson; Lee; Macon; Mad","projected 2D","","","East","North","X","Y","9001","","4269","10131","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_729[] = {"26930","NAD83 / Alabama West","","","","United States (USA) - Alabama - AL_W - counties west of approx 86d 37m West - Autauga; Baldwin; Bibb; Blount; Butler; Chilton; Choctaw; Clarke; Colbert; Conecuh; Cullman; Dallas; Escambia; Fayette; Franklin; Greene; Hale; Jefferson; Lamar; Lauderdale; Lawr","projected 2D","","","East","North","X","Y","9001","","4269","10132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_730[] = {"26931","NAD83 / Alaska zone 1","","","","United States - Alaska - Panhandle.","projected 2D","","","East","North","X","Y","9001","","4269","15031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_731[] = {"26932","NAD83 / Alaska zone 2","","","","United States - Alaska - 141deg to 144deg West.","projected 2D","","","East","North","X","Y","9001","","4269","15032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_732[] = {"26933","NAD83 / Alaska zone 3","","","","United States - Alaska - 144deg to 148deg West.","projected 2D","","","East","North","X","Y","9001","","4269","15033","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_733[] = {"26934","NAD83 / Alaska zone 4","","","","United States - Alaska - 148deg to 152deg West.","projected 2D","","","East","North","X","Y","9001","","4269","15034","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_734[] = {"26935","NAD83 / Alaska zone 5","","","","United States - Alaska - 152deg to 156deg West.","projected 2D","","","East","North","X","Y","9001","","4269","15035","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_735[] = {"26936","NAD83 / Alaska zone 6","","","","United States - Alaska - 156deg to 160deg West.","projected 2D","","","East","North","X","Y","9001","","4269","15036","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_736[] = {"26937","NAD83 / Alaska zone 7","","","","United States - Alaska - 160deg to 164deg West.","projected 2D","","","East","North","X","Y","9001","","4269","15037","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_737[] = {"26938","NAD83 / Alaska zone 8","","","","United States - Alaska - 164deg to 168deg West north of 54d 30m North.","projected 2D","","","East","North","X","Y","9001","","4269","15038","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_738[] = {"26939","NAD83 / Alaska zone 9","","","","United States - Alaska - west of 168deg West and north of 54d 30m North.","projected 2D","","","East","North","X","Y","9001","","4269","15039","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_739[] = {"26940","NAD83 / Alaska zone 10","","","","United States - Alaska - Aleutian Islands.","projected 2D","","","East","North","X","Y","9001","","4269","15040","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_740[] = {"26941","NAD83 / California zone 1","NAD83 / California 1","","","United States (USA) - California - CA_1 - counties north of approx 40 deg North - Del Norte; Humboldt; Lassen; Modoc; Plumas; Shasta; Siskiyou; Tehama; Trinity","projected 2D","","","East","North","X","Y","9001","","4269","10431","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_741[] = {"26942","NAD83 / California zone 2","NAD83 / California 2","","","United States (USA) - California - CA_2 - counties between approx 40 deg & 38d 15m North - Alpine; Amador; Butte; Colusa; El Dorado; Glenn; Lake; Mendocino; Napa; Nevada; Placer; Sacramento; Sierra; Solano; Sonoma; Sutter; Yolo; Yuba","projected 2D","","","East","North","X","Y","9001","","4269","10432","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_742[] = {"26943","NAD83 / California zone 3","NAD83 / California 3","","","United States (USA) - California - CA_3 - counties between approx 38d 15m & 37d North - Alameda; Calaveras; Contra Costa; Madera; Marin; Mariposa; Merced; Mono; San Francisco; San Joaquin; San Mateo; Santa Clara; Santa Cruz; Stanislaus; Tuolumne","projected 2D","","","East","North","X","Y","9001","","4269","10433","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_743[] = {"26944","NAD83 / California zone 4","NAD83 / California 4","","","United States (USA) - California - CA_4 - counties between approx 37d & 35d 30m North - Fresno; Inyo; Kings; Monterey; San Benito; Tulare","projected 2D","","","East","North","X","Y","9001","","4269","10434","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_744[] = {"26945","NAD83 / California zone 5","NAD83 / California 5","","","United States (USA) - California - CA_5 - counties between approx 35d 50m & 34d North - Kern; Los Angeles; San Bernardino; San Luis Obispo; Santa Barbara; Ventura","projected 2D","","","East","North","X","Y","9001","","4269","10435","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_745[] = {"26946","NAD83 / California zone 6","NAD83 / California 6","","","United States (USA) - California - CA_6 - counties south of approx 38d 30m North - Imperial; Orange; Riverside; San Diego","projected 2D","","","East","North","X","Y","9001","","4269","10436","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_746[] = {"26948","NAD83 / Arizona  East","","","","United States (USA) - Arizona - AZ_E - counties east of approx 110d 45m West - Apache; Cochise; Gila; Graham; Greenlee; Navajo","projected 2D","","","East","North","X","Y","9001","","4269","10231","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_747[] = {"26949","NAD83 / Arizona Central","","","","United States (USA) - Arizona - AZ_C - counties between approx 110d 45m and 113d 20m West - Coconino; Maricopa; Pima; Pinal; Santa Cruz; Yavapai","projected 2D","","","East","North","X","Y","9001","","4269","10232","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_748[] = {"26950","NAD83 / Arizona West","","","","United States (USA) - Arizona - AZ_W - counties west of approx 113d 20m West - La Paz; Mohave; Yuma","projected 2D","","","East","North","X","Y","9001","","4269","10233","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_749[] = {"26951","NAD83 / Arkansas North","","","","United States (USA) - Arkansas - AR_N - counties north of approx 34d 50m North - Baxter; Benton; Boone; Carroll; Clay; Cleburne; Conway; Craighead; Crawford; Crittenden; Cross; Faulkner; Franklin; Fulton; Greene; Independence; Izard; Jackson; Johnson; Lawr","projected 2D","","","East","North","X","Y","9001","","4269","10331","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_750[] = {"26952","NAD83 / Arkansas South","","","","United States (USA) - Arkansas - AR_S - counties south of approx 34d 50m North - Arkansas; Ashley; Bradley; Calhoun; Chicot; Clark; Cleveland; Columbia; Dallas; Desha; Drew; Garland; Grant; Hempstead; Hot Spring; Howard; Jefferson; Lafayette; Lee; Lincoln;","projected 2D","","","East","North","X","Y","9001","","4269","10332","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_751[] = {"26953","NAD83 / Colorado North","","","","United States (USA) - Colorado - CO_N - counties north of approx 39d 50m North - Adams; Boulder; Gilpin; Grand; Jackson; Larimer; Logan; Moffat; Morgan; Phillips; Rio Blanco; Routt; Sedgwick; Washington; Weld; Yuma","projected 2D","","","East","North","X","Y","9001","","4269","10531","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_752[] = {"26954","NAD83 / Colorado Central","","","","United States (USA) - Colorado - CO_C - counties between approx 39d 50m & 38d 30m North - Arapahoe; Chaffee; Cheyenne; Clear Creek; Delta; Denver; Douglas; Eagle; El Paso; Elbert; Fremont; Garfield; Gunnison; Jefferson; Kit Carson; Lake; Lincoln; Mesa; Par","projected 2D","","","East","North","X","Y","9001","","4269","10532","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_753[] = {"26955","NAD83 / Colorado South","","","","United States (USA) - Colorado - CO_S - counties south of approx 38d 30m North - Alamosa; Archuleta; Baca; Bent; Conejos; Costilla; Crowley; Custer; Dolores; Hinsdale; Huerfano; Kiowa; La Plata; Las Animas; Mineral; Montezuma; Montrose; Otero; Ouray; Prowe","projected 2D","","","East","North","X","Y","9001","","4269","10533","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_754[] = {"26956","NAD83 / Connecticut","","","","United States (USA) - Connecticut - CT - counties of Fairfield; Hartford; Litchfield; Middlesex; New Haven; New London; Tolland; Windham","projected 2D","","","East","North","X","Y","9001","","4269","10630","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_755[] = {"26957","NAD83 / Delaware","","","","United States (USA) - Delaware - DE - counties of Kent; New Castle; Sussex","projected 2D","","","East","North","X","Y","9001","","4269","10730","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_756[] = {"26958","NAD83 / Florida  East","","","","United States (USA) - Florida - FL_E - counties of Brevard; Broward; Clay; Collier; Dade; Duval; Flagler; Glades; Hendry; Highlands; Indian River; Lake; Martin; Monroe; Nassau; Okeechobee; Orange; Osceola; Palm Beach; Putnam; Seminole; St. Johns; St. Lucie","projected 2D","","","East","North","X","Y","9001","","4269","10931","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_757[] = {"26959","NAD83 / Florida  West","","","","United States (USA) - Florida - FL_W - counties of Charlotte; Citrus; De Soto; Hardee; Hernando; Hillsborough; Lee; Levy; Manatee; Marion; Pasco; Pinellas; Polk; Sarasota; Sumter","projected 2D","","","East","North","X","Y","9001","","4269","10932","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_758[] = {"26960","NAD83 / Florida North","","","","United States (USA) - Florida - FL_N - counties of Alachua; Baker; Bay; Bradford; Calhoun; Columbia; Dixie; Escambia; Escambia; Franklin; Gadsden; Gilchrist; Gulf; Hamilton; Holmes; Jackson; Jefferson; Lafayette; Leon; Liberty; Madison; Okaloosa; Santa Ros","projected 2D","","","East","North","X","Y","9001","","4269","10933","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_759[] = {"26961","NAD83 / Hawaii  zone 1","","","","United States - Hawaii - island of Hawaii.","projected 2D","","","East","North","X","Y","9001","","4269","15131","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_760[] = {"26962","NAD83 / Hawaii  zone 2","","","","United States - Hawaii - Maui; Kahoolawe; Lanai; Molokai.","projected 2D","","","East","North","X","Y","9001","","4269","15132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_761[] = {"26963","NAD83 / Hawaii  zone 3","","","","United States - Hawaii - Oahu.","projected 2D","","","East","North","X","Y","9001","","4269","15133","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_762[] = {"26964","NAD83 / Hawaii  zone 4","","","","United States - Hawaii - Kauai.","projected 2D","","","East","North","X","Y","9001","","4269","15134","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_763[] = {"26965","NAD83 / Hawaii  zone 5","","","","United States - Hawaii - Niihau.","projected 2D","","","East","North","X","Y","9001","","4269","15135","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_764[] = {"26966","NAD83 / Georgia  East","","","","United States (USA) - Georgia - GA_E - counties of Appling; Atkinson; Bacon; Baldwin; Brantley; Bryan; Bulloch; Burke; Camden; Candler; Charlton; Chatham; Clinch; Coffee; Columbia; Dodge; Echols; Effingham; Elbert; Emanuel; Evans; Franklin; Glascock; Glynn","projected 2D","","","East","North","X","Y","9001","","4269","11031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_765[] = {"26967","NAD83 / Georgia West","","","","United States (USA) - Georgia - GA_W - counties of Baker; Banks; Barrow; Bartow; Ben Hill; Berrien; Bibb; Bleckley; Brooks; Butts; Calhoun; Carroll; Catoosa; Chattahoochee; Chattooga; Cherokee; Clarke; Clay; Clayton; Cobb; Colquitt; Cook; Coweta; Crawford;","projected 2D","","","East","North","X","Y","9001","","4269","11032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_766[] = {"26968","NAD83 / Idaho  East","","","","United States (USA) - Idaho - ID_E - counties of Bannock; Bear Lake; Bingham; Bonneville; Caribou; Clark; Franklin; Fremont; Jefferson; Madison; Oneida; Power; Teton","projected 2D","","","East","North","X","Y","9001","","4269","11131","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_767[] = {"26969","NAD83 / Idaho  Central","","","","United States (USA) - Idaho - ID_C - counties of Blaine; Butte; Camas; Cassia; Custer; Gooding; Jerome; Lemhi; Lincoln; Minidoka; Twin Falls","projected 2D","","","East","North","X","Y","9001","","4269","11132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_768[] = {"26970","NAD83 / Idaho  West","","","","United States (USA) - Idaho - ID_W - counties of Ada; Adams; Benewah; Boise; Bonner; Boundary; Canyon; Clearwater; Elmore; Gem; Idaho; Kootenai; Latah; Lewis; Nez Perce; Owyhee; Payette; Shoshone; Valley; Washington","projected 2D","","","East","North","X","Y","9001","","4269","11133","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_769[] = {"26971","NAD83 / Illinois  East","","","","United States (USA) - Illinois - IL_E - counties of Boone; Champaign; Clark; Clay; Coles; Cook; Crawford; Cumberland; De Kalb; De Witt; Douglas; Du Page; Edgar; Edwards; Effingham; Fayette; Ford; Franklin; Gallatin; Grundy; Hamilton; Hardin; Iroquois; Jasp","projected 2D","","","East","North","X","Y","9001","","4269","11231","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_770[] = {"26972","NAD83 / Illinois  West","","","","United States (USA) - Illinois - IL_W - counties of Adams; Alexander; Bond; Brown; Bureau; Calhoun; Carroll; Cass; Christian; Clinton; Fulton; Greene; Hancock; Henderson; Henry; Jackson; Jersey; Jo Daviess; Knox; Lee; Logan; Macoupin; Madison; Marshall; Ma","projected 2D","","","East","North","X","Y","9001","","4269","11232","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_771[] = {"26973","NAD83 / Indiana  East","","","","United States (USA) - Indiana - IN_E - counties of Adams; Allen; Bartholomew; Blackford; Brown; Cass; Clark; De Kalb; Dearborn; Decatur; Delaware; Elkhart; Fayette; Floyd; Franklin; Fulton; Grant; Hamilton; Hancock; Harrison; Henry; Howard; Huntington; Jac","projected 2D","","","East","North","X","Y","9001","","4269","11331","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_772[] = {"26974","NAD83 / Indiana  West","","","","United States (USA) - Indiana - IN_W - counties of Benton; Boone; Carroll; Clay; Clinton; Crawford; Daviess; Dubois; Fountain; Gibson; Greene; Hendricks; Jasper; Knox; La Porte; Lake; Lawrence; Martin; Monroe; Montgomery; Morgan; Newton; Orange; Owen; Park","projected 2D","","","East","North","X","Y","9001","","4269","11332","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_773[] = {"26975","NAD83 / Iowa North","","","","United States (USA) - Iowa - IA_N - counties of Allamakee; Benton; Black Hawk; Boone; Bremer; Buchanan; Buena Vista; Butler; Calhoun; Carroll; Cerro Gordo; Cherokee; Chickasaw; Clay; Clayton; Crawford; Delaware; Dickinson; Dubuque; Emmet; Fayette; Floyd; F","projected 2D","","","East","North","X","Y","9001","","4269","11431","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_774[] = {"26976","NAD83 / Iowa South","","","","United States (USA) - Iowa - IA_S - counties of Adair; Adams; Appanoose; Audubon; Cass; Cedar; Clarke; Clinton; Dallas; Davis; Decatur; Des Moines; Fremont; Guthrie; Harrison; Henry; Iowa; Jasper; Jefferson; Johnson; Keokuk; Lee; Louisa; Lucas; Madison; Ma","projected 2D","","","East","North","X","Y","9001","","4269","11432","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_775[] = {"26977","NAD83 / Kansas North","","","","United States (USA) - Kansas - KS_N - counties of Atchison; Brown; Cheyenne; Clay; Cloud; Decatur; Dickinson; Doniphan; Douglas; Ellis; Ellsworth; Geary; Gove; Graham; Jackson; Jefferson; Jewell; Johnson; Leavenworth; Lincoln; Logan; Marshall; Mitchell; Mo","projected 2D","","","East","North","X","Y","9001","","4269","11531","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_776[] = {"26978","NAD83 / Kansas South","","","","United States (USA) - Kansas - KS_S - counties of Allen; Anderson; Barber; Barton; Bourbon; Butler; Chase; Chautauqua; Cherokee; Clark; Coffey; Comanche; Cowley; Crawford; Edwards; Elk; Finney; Ford; Franklin; Grant; Gray; Greeley; Greenwood; Hamilton; Har","projected 2D","","","East","North","X","Y","9001","","4269","11532","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_777[] = {"26979","NAD83 / Kentucky North","","","","United States (USA) - Kentucky - KY_N - counties of Anderson; Bath; Boone; Bourbon; Boyd; Bracken; Bullitt; Campbell; Carroll; Carter; Clark; Elliott; Fayette; Fleming; Franklin; Gallatin; Grant; Greenup; Harrison; Henry; Jefferson; Jessamine; Kenton; Lawr","projected 2D","","","East","North","X","Y","9001","","4269","11631","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_778[] = {"26980","NAD83 / Kentucky South","","","","United States (USA) - Kentucky - KY_S - counties of Adair; Allen; Ballard; Barren; Bell; Boyle; Breathitt; Breckinridge; Butler; Caldwell; Calloway; Carlisle; Casey; Christian; Clay; Clinton; Crittenden; Cumberland; Daviess; Edmonson; Estill; Floyd; Fulton","projected 2D","","","East","North","X","Y","9001","","4269","11632","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_779[] = {"26981","NAD83 / Louisiana North","","","","United States (USA) - Louisiana - LA_N - counties of Avoyelles; Bienville; Bossier; Caddo; Caldwell; Catahoula; Claiborne; Concordia; De Soto; East Carroll; Franklin; Grant; Jackson; La Salle; Lincoln; Madison; Morehouse; Natchitoches; Ouachita; Rapides; R","projected 2D","","","East","North","X","Y","9001","","4269","11731","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_780[] = {"26982","NAD83 / Louisiana South","","","","United States (USA) - Louisiana - LA_S - counties of Acadia; Allen; Ascension; Assumption; Beauregard; Calcasieu; Cameron; East Baton Rouge; East Feliciana; Evangeline; Iberia; Iberville; Jefferson; Jefferson Davis; Lafayette; LaFourche; Livingston; Orlean","projected 2D","","","East","North","X","Y","9001","","4269","11732","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_781[] = {"26983","NAD83 / Maine  East","","","","United States (USA) - Maine - ME_E - counties of Aroostook; Hancock; Knox; Penobscot; Piscataquis; Waldo; Washington","projected 2D","","","East","North","X","Y","9001","","4269","11831","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_782[] = {"26984","NAD83 / Maine  West","","","","United States (USA) - Maine - ME_W - counties of Androscoggin; Cumberland; Franklin; Kennebec; Lincoln; Oxford; Sagadahoc; Somerset; York","projected 2D","","","East","North","X","Y","9001","","4269","11832","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_783[] = {"26985","NAD83 / Maryland","","","","United States (USA) - Maryland -MD - counties of Allegany; Anne Arundel; Baltimore; Calvert; Caroline; Carroll; Cecil; Charles; Dorchester; Frederick; Garrett; Harford; Howard; Kent; Montgomery; Prince Georges; Queen Annes; Somerset; St. Marys; Talbot; Was","projected 2D","","","East","North","X","Y","9001","","4269","11930","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_784[] = {"26986","NAD83 / Massachusetts Mainland","NAD83 / Massachusetts","","","United States (USA) - Massachusetts - MA_M - counties of Barnstable; Berkshire; Bristol; Essex; Franklin; Hampden; Hampshire; Middlesex; Norfolk; Plymouth; Suffolk; Worcester","projected 2D","","","East","North","X","Y","9001","","4269","12031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_785[] = {"26987","NAD83 / Massachusetts Island","NAD83 / Massachusetts Is","","","United States (USA) - Massachusetts - MA_I - counties of Dukes; Nantucket","projected 2D","","","East","North","X","Y","9001","","4269","12032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_786[] = {"26988","NAD83 / Michigan North","","","","United States (USA) - Michigan - MI_N - counties of Alger; Baraga; Chippewa; Delta; Dickinson; Gogebic; Houghton; Iron; Keweenaw; Luce; Mackinac; Marquette; Menominee; Ontonagon; Schoolcraft","projected 2D","","","East","North","X","Y","9001","","4269","12141","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_787[] = {"26989","NAD83 / Michigan Central","","","","United States (USA) - Michigan - MI_C - counties of Alcona; Alpena; Antrim; Arenac; Benzie; Charlevoix; Cheboygan; Clare; Crawford; Emmet; Gladwin; Grand Traverse; Iosco; Kalkaska; Lake; Leelanau; Manistee; Mason; Missaukee; Montmorency; Ogemaw; Osceola; O","projected 2D","","","East","North","X","Y","9001","","4269","12142","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_788[] = {"26990","NAD83 / Michigan South","","","","United States (USA) - Michigan - MI_S - counties of Allegan; Barry; Bay; Berrien; Branch; Calhoun; Cass; Clinton; Eaton; Genesee; Gratiot; Hillsdale; Huron; Ingham; Ionia; Isabella; Jackson; Kalamazoo; Kent; Lapeer; Lenawee; Livingston; Macomb; Mecosta; Mi","projected 2D","","","East","North","X","Y","9001","","4269","12143","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_789[] = {"26991","NAD83 / Minnesota North","","","","United States (USA) - Minnesota - MN_N - counties of Beltrami; Clearwater; Cook; Itasca; Kittson; Koochiching; Lake; Lake of the Woods; Mahnomen; Marshall; Norman; Pennington; Polk; Red Lake; Roseau; St. Louis","projected 2D","","","East","North","X","Y","9001","","4269","12231","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_790[] = {"26992","NAD83 / Minnesota Central","NAD83 / Minnesota Cent.","","","United States (USA) - Minnesota - MN_C - counties of Aitkin; Becker; Benton; Carlton; Cass; Chisago; Clay; Crow Wing; Douglas; Grant; Hubbard; Isanti; Kanabec; Mille Lacs; Morrison; Otter Tail; Pine; Pope; Stearns; Stevens; Todd; Traverse; Wadena; Wilkin","projected 2D","","","East","North","X","Y","9001","","4269","12232","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_791[] = {"26993","NAD83 / Minnesota South","","","","United States (USA) - Minnesota - MN_S - counties of Anoka; Big Stone; Blue Earth; Brown; Carver; Chippewa; Cottonwood; Dakota; Dodge; Faribault; Fillmore; Freeborn; Goodhue; Hennepin; Houston; Jackson; Kandiyohi; Lac Qui Parle; Le Sueur; Lincoln; Lyon; Ma","projected 2D","","","East","North","X","Y","9001","","4269","12233","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_792[] = {"26994","NAD83 / Mississippi East","","","","United States (USA) - Mississippi - MS_E - counties of Alcorn; Attala; Benton; Calhoun; Chickasaw; Choctaw; Clarke; Clay; Covington; Forrest; George; Greene; Hancock; Harrison; Itawamba; Jackson; Jasper; Jones; Kemper; Lafayette; Lamar; Lauderdale; Leake; ","projected 2D","","","East","North","X","Y","9001","","4269","12331","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_793[] = {"26995","NAD83 / Mississippi West","","","","United States (USA) - Mississippi - MS_W - counties of Adams; Amite; Bolivar; Carroll; Claiborne; Coahoma; Copiah; De Soto; Franklin; Grenada; Hinds; Holmes; Humphreys; Issaquena; Jefferson; Jefferson Davis; Lawrence; Leflore; Lincoln; Madison; Marion; Mon","projected 2D","","","East","North","X","Y","9001","","4269","12332","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_794[] = {"26996","NAD83 / Missouri  East","","","","United States (USA) - Missouri - MO_E - counties of Bollinger; Butler; Cape Girardeau; Carter; Clark; Crawford; Dent; Dunklin; Franklin; Gasconade; Iron; Jefferson; Lewis; Lincoln; Madison; Marion; Mississippi; Montgomery; New Madrid; Oregon; Pemiscot; Per","projected 2D","","","East","North","X","Y","9001","","4269","12431","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_795[] = {"26997","NAD83 / Missouri Central","","","","United States (USA) - Missouri - MO_C - counties of Adair; Audrain; Benton; Boone; Callaway; Camden; Carroll; Chariton; Christian; Cole; Cooper; Dallas; Douglas; Greene; Grundy; Hickory; Howard; Howell; Knox; Laclede; Linn; Livingston; Macon; Maries; Merce","projected 2D","","","East","North","X","Y","9001","","4269","12432","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_796[] = {"26998","NAD83 / Missouri  West","","","","United States (USA) - Missouri - MO_W - counties of Andrew; Atchison; Barry; Barton; Bates; Buchanan; Caldwell; Cass; Cedar; Clay; Clinton; Dade; Daviess; De Kalb; Gentry; Harrison; Henry; Holt; Jackson; Jasper; Johnson; Lafayette; Lawrence; McDonald; Newt","projected 2D","","","East","North","X","Y","9001","","4269","12433","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_797[] = {"27038","Nahrwan 1967 / UTM zone 38N","Nahrwan 1967 / UTM 38N","","","Kuwait west of 48 deg East.","projected 2D","","","East","North","E","N","9001","","4270","16038","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_798[] = {"27039","Nahrwan 1967 / UTM zone 39N","Nahrwan 1967 / UTM 39N","","","Kuwait east of 48 deg East.  United Arab Emirates (UAE) - Abu Dhabi - west of 54 deg East.","projected 2D","","","East","North","E","N","9001","","4270","16039","1996-04-12 00:00:00","","EPSG","","96.12",NULL};
+datafile_rows_t horiz_cs_row_799[] = {"27040","Nahrwan 1967 / UTM zone 40N","Nahrwan 1967 / UTM 40N","","","United Arab Emirates (UAE) - Abu Dhabi east of 54 deg East; Dubai; Sharjah; Ajman; Fujairah; Ras Al Kaimah; Umm Al Qaiwain.","projected 2D","","","East","North","E","N","9001","","4270","16040","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_800[] = {"27120","Naparima 1972 / UTM zone 20N","Naparima / UTM 20N","","","Trinidad and Tobago.","projected 2D","","","East","North","E","N","9001","","4271","16020","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_801[] = {"27200","GD49 / New Zealand Map Grid","GD49 / NZ Map Grid","","","New Zealand.","projected 2D","","","East","North","E","N","9001","","4272","19917","1995-06-02 00:00:00","","EPSG","Supersedes 27291 (GD49 / North Island Grid) and 27292 (GD49 / South Island Grid).","",NULL};
+datafile_rows_t horiz_cs_row_802[] = {"27291","GD49 / North Island Grid","","","","New Zealand - North Island.","projected 2D","","","East","North","E","N","9040","","4272","18141","1999-10-20 00:00:00","","EPSG","Sears 1922 British foot-metre conversion factor applied to ellipsoid.  Superseded by 27200 (GD49 / New Zealand Map Grid).","97.231",NULL};
+datafile_rows_t horiz_cs_row_803[] = {"27292","GD49 / South Island Grid","","","","New Zealand - South Island.","projected 2D","","","East","North","E","N","9040","","4272","18142","1999-10-20 00:00:00","","EPSG","Sears 1922 British foot-metre conversion factor applied to ellipsoid.  Superseded by 27200 (GD49 / New Zealand Map Grid).","97.231",NULL};
+datafile_rows_t horiz_cs_row_804[] = {"27391","NGO 1948 (Oslo) / NGO zone I","NGO 1948 / I","","","Norway - west of 3deg 30min W of Oslo (7deg 13min 20.5sec E of Greenwich).","projected 2D","","","North","East","x","y","9001","","4817","18221","1999-10-20 00:00:00","","EPSG","Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 32N.","",NULL};
+datafile_rows_t horiz_cs_row_805[] = {"27392","NGO 1948 (Oslo) / NGO zone II","NGO 1948 / II","","","Norway - between 3deg 30min W and 1deg 10min W of Oslo (7deg 13min 20.5sec E  and 9deg 33min 20.5sec E of Greenwich).","projected 2D","","","North","East","x","y","9001","","4817","18222","1999-10-20 00:00:00","","EPSG","Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 32N.","",NULL};
+datafile_rows_t horiz_cs_row_806[] = {"27393","NGO 1948 (Oslo) / NGO zone III","NGO 1948 / III","","","Norway - between 1deg 10min W and 1deg 15min E of Oslo (9deg 33min 20.5sec E and 11deg 58min 20.5sec E of Greenwich).","projected 2D","","","North","East","x","y","9001","","4817","18223","1999-10-20 00:00:00","","EPSG","Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 32N.","",NULL};
+datafile_rows_t horiz_cs_row_807[] = {"27394","NGO 1948 (Oslo) / NGO zone IV","NGO 1948 / IV","","","Norway - between 1deg 15min E and 4deg 20min E of Oslo (11deg 58min 20.5sec E and 15deg 03min 20.5sec E of Greenwich).","projected 2D","","","North","East","x","y","9001","","4817","18224","1999-10-20 00:00:00","","EPSG","Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 32N and ETRF89 / UTM zone 33N.","",NULL};
+datafile_rows_t horiz_cs_row_808[] = {"27395","NGO 1948 (Oslo) / NGO zone V","NGO 1948 / V","","","Norway - between 4deg 20min E and 8deg 10min E of Oslo (15deg 03min 20.5sec E and 18deg 53min 20.5sec E of Greenwich).","projected 2D","","","North","East","x","y","9001","","4817","18225","1999-10-20 00:00:00","","EPSG","Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 33N and ETRF89 / UTM zone 34N.","",NULL};
+datafile_rows_t horiz_cs_row_809[] = {"27396","NGO 1948 (Oslo) / NGO zone VI","NGO 1948 / VI","","","Norway - between 8deg 10min E and 12deg 10min E of Oslo (18deg 53min 20.5sec E and 22deg 53min 20.5sec E of Greenwich).","projected 2D","","","North","East","x","y","9001","","4817","18226","1999-10-20 00:00:00","","EPSG","Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 34N.","",NULL};
+datafile_rows_t horiz_cs_row_810[] = {"27397","NGO 1948 (Oslo) / NGO zone VII","NGO 1948 / VII","","","Norway - between 12deg 10min E and 16deg 15min E of Oslo (22deg 53min 20.5sec E and 26deg 58min 20.5sec E of Greenwich).","projected 2D","","","North","East","x","y","9001","","4817","18227","1999-10-20 00:00:00","","EPSG","Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 34N and ETRF89 / UTM zone 35N.","",NULL};
+datafile_rows_t horiz_cs_row_811[] = {"27398","NGO 1948 (Oslo) / NGO zone VIII","NGO 1948 / VIII","","","Norway - east of 16deg 15min E of Oslo (26deg 58min 20.5sec E of Greenwich).","projected 2D","","","North","East","x","y","9001","","4817","18228","1999-10-20 00:00:00","","EPSG","Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 35N.","",NULL};
+datafile_rows_t horiz_cs_row_812[] = {"27429","Datum 73 / UTM zone 29N","","","","Portugal - onshore.","projected 2D","","","East","North","E","N","9001","","4274","16029","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_813[] = {"27500","ATF (Paris) / Nord de Guerre","ATF / Nord de Guerre","","","France - Alsace.","projected 2D","","","East","North","X","Y","9001","","4901","19903","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_814[] = {"27581","NTF (Paris) / France I","NTF / France I","","","France north of 53.5 grads (48 deg 09 min) North.","projected 2D","","","East","North","X","Y","9001","","4807","18081","1996-04-12 00:00:00","","EPSG","Introduced 1972. Supersedes NTF / Nord France (code 27591).","95.26",NULL};
+datafile_rows_t horiz_cs_row_815[] = {"27582","NTF (Paris) / France II","NTF / France II","","","France 50.5 to 53.5 grads (45 deg 27 min to 48 deg 09 min) North. Also used over all mainlanf France.","projected 2D","","","East","North","X","Y","9001","","4807","18082","1996-04-12 00:00:00","","EPSG","Introduced 1972. Supersedes NTF / Centre France (code 27592).","95.26",NULL};
+datafile_rows_t horiz_cs_row_816[] = {"27583","NTF (Paris) / France III","NTF / France III","","","France south of 50.5 grads (45 deg 27 min) North.","projected 2D","","","East","North","X","Y","9001","","4807","18083","1996-04-12 00:00:00","","EPSG","Introduced 1972. Supersedes NTF / Sud France (code 27593).","95.26",NULL};
+datafile_rows_t horiz_cs_row_817[] = {"27584","NTF (Paris) / France IV","NTF / France IV","","","France - Corsica","projected 2D","","","East","North","X","Y","9001","","4807","18084","1996-04-12 00:00:00","","EPSG","Introduced 1972. Supersedes NTF / Corse (code 27594).","",NULL};
+datafile_rows_t horiz_cs_row_818[] = {"27591","NTF (Paris) / Nord France","NTF / Nord France","","","France north of 53.5 grads (48 deg 09 min) North.","projected 2D","","","East","North","X","Y","9001","","4807","18091","1996-04-12 00:00:00","","EPSG","Superseded by NTF / France I (code 27581) from 1972.","95.26",NULL};
+datafile_rows_t horiz_cs_row_819[] = {"27592","NTF (Paris) / Centre France","NTF / Centre France","","","France 50.5 to 53.5 grads (45 deg 27 min to 48 deg 09 min) North.","projected 2D","","","East","North","X","Y","9001","","4807","18092","1996-04-12 00:00:00","","EPSG","Superseded by NTF / France II (code 27582) from 1972.","95.26",NULL};
+datafile_rows_t horiz_cs_row_820[] = {"27593","NTF (Paris) / Sud France","NTF / Sud France","","","France south of 50.5 grads (45 deg 27 min) North.","projected 2D","","","East","North","X","Y","9001","","4807","18093","1996-04-12 00:00:00","","EPSG","Superseded by NTF / France III (code 27583) from 1972.","95.26",NULL};
+datafile_rows_t horiz_cs_row_821[] = {"27594","NTF (Paris) / Corse","NTF / Corse","","","France - Corsica","projected 2D","","","East","North","X","Y","9001","","4807","18094","1996-04-12 00:00:00","","EPSG","Superseded by NTF / France IV (code 27584) from 1972.","",NULL};
+datafile_rows_t horiz_cs_row_822[] = {"27700","OSGB 1936 / British National Grid","British National Grid","","","United Kingdom (UK) - onshore England; Scotland; Wales; Isle of Man.","projected 2D","","","East","North","E","N","9001","","4277","19916","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_823[] = {"28191","Palestine 1923 / Palestine Grid","Palestine Grid","","","Israel; Jordan","projected 2D","","","East","North","E","N","9001","","4281","18201","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_824[] = {"28192","Palestine 1923 / Palestine Belt","Palestine Belt","","","Israel; Jordan","projected 2D","","","East","North","E","N","9001","","4281","18202","1999-04-22 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_825[] = {"28193","Palestine 1923 / Israeli CS Grid","Israeli CS Grid","","","Israel.","projected 2D","","","East","North","E","N","9001","","4281","18203","1999-10-20 00:00:00","Survey of Israel.","EPSG","Superceded by Israeli TM Grid (EPSG code 239).","",NULL};
+datafile_rows_t horiz_cs_row_826[] = {"28232","Pointe Noire / UTM zone 32S","Point Noire / UTM 32S","","","Congo.","projected 2D","","","East","North","E","N","9001","","4282","16132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_827[] = {"28348","GDA94 / MGA zone 48","","","","Australia - 102deg East  to 108deg East.","projected 2D","","","East","North","E","N","9001","","4283","17348","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_828[] = {"28349","GDA94 / MGA zone 49","","","","Australia - 108deg East  to 114deg East.","projected 2D","","","East","North","E","N","9001","","4283","17349","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_829[] = {"28350","GDA94 / MGA zone 50","","","","Australia - 114deg East  to 120deg East.","projected 2D","","","East","North","E","N","9001","","4283","17350","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_830[] = {"28351","GDA94 / MGA zone 51","","","","Australia - 120deg East  to 126deg East.","projected 2D","","","East","North","E","N","9001","","4283","17351","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_831[] = {"28352","GDA94 / MGA zone 52","","","","Australia - 126deg East  to 132deg East.","projected 2D","","","East","North","E","N","9001","","4283","17352","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_832[] = {"28353","GDA94 / MGA zone 53","","","","Australia - 132deg East  to 138deg East.","projected 2D","","","East","North","E","N","9001","","4283","17353","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_833[] = {"28354","GDA94 / MGA zone 54","","","","Australia - 138deg East  to 144deg East.","projected 2D","","","East","North","E","N","9001","","4283","17354","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_834[] = {"28355","GDA94 / MGA zone 55","","","","Australia - 144deg East  to 150deg East.","projected 2D","","","East","North","E","N","9001","","4283","17355","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_835[] = {"28356","GDA94 / MGA zone 56","","","","Australia - 150deg East  to 156deg East.","projected 2D","","","East","North","E","N","9001","","4283","17356","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_836[] = {"28357","GDA94 / MGA zone 57","","","","Australia - 156deg East  to 162deg East.","projected 2D","","","East","North","E","N","9001","","4283","17357","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_837[] = {"28358","GDA94 / MGA zone 58","","","","Australia - 162deg East  to 168deg East.","projected 2D","","","East","North","E","N","9001","","4283","17358","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_838[] = {"28402","Pulkovo 1942 / Gauss-Kruger zone 2","1942 Coord. Sys. zone 2","","","Czech Republic and Germany (former DDR) - west of 12 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16202","1998-06-30 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_839[] = {"28403","Pulkovo 1942 / Gauss-Kruger zone 3","1942 Coord. Sys. zone 3","","","Czech Republic and Germany ( former DDR) - east of 12 deg East; Poland and Slovakia - west of 18 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16203","1998-06-30 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_840[] = {"28404","Pulkovo 1942 / Gauss-Kruger zone 4","1942 Coord. Sys. zone 4","","","Estonia; Latvia; Lithuania; Russia; Ukraine; - west of 24 deg East; Poland - east of 24 deg East; Slovakia east of 18 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16204","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_841[] = {"28405","Pulkovo 1942 / Gauss-Kruger zone 5","1942 Coord. Sys. zone 5","","","Belarus - west of 30 deg East;  Estonia; Latvia & Lithuania - east of 24 deg East;  Moldova;  Russia &  Ukraine - 24 deg to 30 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16205","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_842[] = {"28406","Pulkovo 1942 / Gauss-Kruger zone 6","1942 Coord. Sys. zone 6","","","Belarus - east of 30 deg East;  Russia  &  Ukraine  - 30 deg to 36 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16206","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_843[] = {"28407","Pulkovo 1942 / Gauss-Kruger zone 7","1942 Coord. Sys. zone 7","","","Georgia - west of 36 deg East;  Russia  - 36 deg to 42 deg East;  Ukraine - east of 36 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16207","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_844[] = {"28408","Pulkovo 1942 / Gauss-Kruger zone 8","1942 Coord. Sys. zone 8","","","Armenia  Azerbaijan - west of 48 deg East;  Georgia - east of 42 deg East;  Russia - 42 deg to 48 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16208","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_845[] = {"28409","Pulkovo 1942 / Gauss-Kruger zone 9","1942 Coord. Sys. zone 9","","","Azerbaijan - east of 48 deg East;  Kazakstan - west of 54 deg East;  Russia - 48 deg to 54 deg East;  Turkmenistan - west of 54 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16209","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_846[] = {"28410","Pulkovo 1942 / Gauss-Kruger zone 10","1942 Coord. Sys. zone 10","","","Kazakstan;  Russia;  Turkmenistan  - 54 deg  to 60 deg East; Uzbekistan - west of 60 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16210","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_847[] = {"28411","Pulkovo 1942 / Gauss-Kruger zone 11","1942 Coord. Sys. zone 11","","","Kazakstan;  Russia;  Uzbekistan - 60 deg to 66 deg East;  Turkmenistan - east of 60 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16211","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_848[] = {"28412","Pulkovo 1942 / Gauss-Kruger zone 12","1942 Coord. Sys. zone 12","","","Kazakstan &  Russia - 66 deg to 72 deg East;  Kirgistan & Tadzhikstan - west of 72 deg East;  Uzbekistan - east of 66 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16212","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_849[] = {"28413","Pulkovo 1942 / Gauss-Kruger zone 13","1942 Coord. Sys. zone 13","","","Kazakstan;  Kirgizstan;  Russia - 72 deg to 78 deg East;  Tadzhikstan - east of 72 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16213","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_850[] = {"28414","Pulkovo 1942 / Gauss-Kruger zone 14","1942 Coord. Sys. zone 14","","","Kazakstan &  Russia - 78 deg to 84 deg East; Kirgizstan - east of 78 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16214","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_851[] = {"28415","Pulkovo 1942 / Gauss-Kruger zone 15","1942 Coord. Sys. zone 15","","","Kazakstan - east of 84 deg East;  Russia - 84 deg to 90 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16215","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_852[] = {"28416","Pulkovo 1942 / Gauss-Kruger zone 16","1942 Coord. Sys. zone 16","","","Russia - 90 deg to 96 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16216","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_853[] = {"28417","Pulkovo 1942 / Gauss-Kruger zone 17","1942 Coord. Sys. zone 17","","","Russia - 96 deg to 102deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16217","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_854[] = {"28418","Pulkovo 1942 / Gauss-Kruger zone 18","1942 Coord. Sys. zone 18","","","Russia - 102 deg to 108 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16218","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_855[] = {"28419","Pulkovo 1942 / Gauss-Kruger zone 19","1942 Coord. Sys. zone 19","","","Russia - 108 deg to 114 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16219","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_856[] = {"28420","Pulkovo 1942 / Gauss-Kruger zone 20","1942 Coord. Sys. zone 20","","","Russia - 114 deg to 120 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16220","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_857[] = {"28421","Pulkovo 1942 / Gauss-Kruger zone 21","1942 Coord. Sys. zone 21","","","Russia - 120 deg to 126 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16221","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_858[] = {"28422","Pulkovo 1942 / Gauss-Kruger zone 22","1942 Coord. Sys. zone 22","","","Russia - 126 deg to 132 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16222","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_859[] = {"28423","Pulkovo 1942 / Gauss-Kruger zone 23","1942 Coord. Sys. zone 23","","","Russia - 132 deg to 138 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16223","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_860[] = {"28424","Pulkovo 1942 / Gauss-Kruger zone 24","1942 Coord. Sys. zone 24","","","Russia - 138 deg to 144 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16224","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_861[] = {"28425","Pulkovo 1942 / Gauss-Kruger zone 25","1942 Coord. Sys. zone 25","","","Russia - 144 deg to 150 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16225","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_862[] = {"28426","Pulkovo 1942 / Gauss-Kruger zone 26","1942 Coord. Sys. zone 26","","","Russia - 150 deg to 156 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16226","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_863[] = {"28427","Pulkovo 1942 / Gauss-Kruger zone 27","1942 Coord. Sys. zone 27","","","Russia - 156 deg to 162 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16227","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_864[] = {"28428","Pulkovo 1942 / Gauss-Kruger zone 28","1942 Coord. Sys. zone 28","","","Russia - 162 deg to 168 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16228","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_865[] = {"28429","Pulkovo 1942 / Gauss-Kruger zone 29","1942 Coord. Sys. zone 29","","","Russia - 168 deg to 174 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16229","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_866[] = {"28430","Pulkovo 1942 / Gauss-Kruger zone 30","1942 Coord. Sys. zone 30","","","Russia - 174 deg East to 180 deg.","projected 2D","","","North","East","X","Y","9001","","4284","16230","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_867[] = {"28431","Pulkovo 1942 / Gauss-Kruger zone 31","1942 Coord. Sys. zone 31","","","Russia - 180 deg to 174 deg West.","projected 2D","","","North","East","X","Y","9001","","4284","16231","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_868[] = {"28432","Pulkovo 1942 / Gauss-Kruger zone 32","1942 Coord. Sys. zone 32","","","Russia - east of 174 deg West.","projected 2D","","","North","East","X","Y","9001","","4284","16232","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_869[] = {"28462","Pulkovo 1942 / Gauss-Kruger 2N","Pulkovo / Gauss 2N","","","Czech Republic and Germany (former DDR) - west of 12 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16302","1998-06-30 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_870[] = {"28463","Pulkovo 1942 / Gauss-Kruger 3N","Pulkovo / Gauss 3N","","","Czech Republic and Germany ( former DDR) - east of 12 deg East; Poland and Slovakia - west of 18 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16303","1998-06-30 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_871[] = {"28464","Pulkovo 1942 / Gauss-Kruger 4N","Pulkovo / Gauss 4N","","","Estonia; Latvia; Lithuania; Russia; Ukraine; - west of 24 deg East; Poland - east of 24 deg East; Slovakia east of 18 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16304","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_872[] = {"28465","Pulkovo 1942 / Gauss-Kruger 5N","Pulkovo / Gauss 5N","","","Belarus - west of 30 deg East;  Estonia; Latvia & Lithuania - east of 24 deg East;  Moldova;  Russia &  Ukraine - 24 deg to 30 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16305","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_873[] = {"28466","Pulkovo 1942 / Gauss-Kruger 6N","Pulkovo / Gauss 6N","","","Belarus - east of 30 deg East;  Russia  &  Ukraine  - 30 deg to 36 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16306","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_874[] = {"28467","Pulkovo 1942 / Gauss-Kruger 7N","Pulkovo / Gauss 7N","","","Georgia - west of 36 deg East;  Russia  - 36 deg to 42 deg East;  Ukraine - east of 36 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16307","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_875[] = {"28468","Pulkovo 1942 / Gauss-Kruger 8N","Pulkovo / Gauss 8N","","","Armenia - west of 48 deg East;  Azerbaijan - west of 48 deg East;  Georgia - east of 42 deg East;  Russia - 42 deg to 48 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16308","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_876[] = {"28469","Pulkovo 1942 / Gauss-Kruger 9N","Pulkovo / Gauss 9N","","","Azerbaijan - east of 48 deg East;  Kazakstan - west of 54 deg East;  Russia - 48 deg to 54 deg East;  Turkmenistan - west of 54 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16309","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_877[] = {"28470","Pulkovo 1942 / Gauss-Kruger 10N","Pulkovo / Gauss 10N","","","Kazakstan;  Russia;  Turkmenistan  - 54 deg  to 60 deg East;  Uzbekistan - west of 60 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16310","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_878[] = {"28471","Pulkovo 1942 / Gauss-Kruger 11N","Pulkovo / Gauss 11N","","","Kazakstan;  Russia;  Uzbekistan - 60 deg to 66 deg East;  Turkmenistan - east of 60 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16311","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_879[] = {"28472","Pulkovo 1942 / Gauss-Kruger 12N","Pulkovo / Gauss 12N","","","Kazakstan &  Russia - 66 deg to 72 deg East;  Kirgistan & Tadzhikstan - west of 72 deg East;  Uzbekistan - east of 66 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16312","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_880[] = {"28473","Pulkovo 1942 / Gauss-Kruger 13N","Pulkovo / Gauss 13N","","","Kazakstan;  Kirgizstan;  Russia - 72 deg to 78 deg East;  Tadzhikstan - east of 72 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16313","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_881[] = {"28474","Pulkovo 1942 / Gauss-Kruger 14N","Pulkovo / Gauss 14N","","","Kazakstan &  Russia - 78 deg to 84 deg East;  Kirgizstan - east of 78 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16314","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_882[] = {"28475","Pulkovo 1942 / Gauss-Kruger 15N","Pulkovo / Gauss 15N","","","Kazakstan - east of 84 deg East;  Russia - 84 deg to 90 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16315","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_883[] = {"28476","Pulkovo 1942 / Gauss-Kruger 16N","Pulkovo / Gauss 16N","","","Russia - 90 deg to 96 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16316","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_884[] = {"28477","Pulkovo 1942 / Gauss-Kruger 17N","Pulkovo / Gauss 17N","","","Russia - 96 deg to 102deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16317","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_885[] = {"28478","Pulkovo 1942 / Gauss-Kruger 18N","Pulkovo / Gauss 18N","","","Russia - 102 deg to 108 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16318","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_886[] = {"28479","Pulkovo 1942 / Gauss-Kruger 19N","Pulkovo / Gauss 19N","","","Russia - 108 deg to 114 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16319","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_887[] = {"28480","Pulkovo 1942 / Gauss-Kruger 20N","Pulkovo / Gauss 20N","","","Russia - 114 deg to 120 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16320","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_888[] = {"28481","Pulkovo 1942 / Gauss-Kruger 21N","Pulkovo / Gauss 21N","","","Russia - 120 deg to 126 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16321","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_889[] = {"28482","Pulkovo 1942 / Gauss-Kruger 22N","Pulkovo / Gauss 22N","","","Russia - 126 deg to 132 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16322","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_890[] = {"28483","Pulkovo 1942 / Gauss-Kruger 23N","Pulkovo / Gauss 23N","","","Russia - 132 deg to 138 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16323","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_891[] = {"28484","Pulkovo 1942 / Gauss-Kruger 24N","Pulkovo / Gauss 24N","","","Russia - 138 deg to 144 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16324","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_892[] = {"28485","Pulkovo 1942 / Gauss-Kruger 25N","Pulkovo / Gauss 25N","","","Russia - 144 deg to 150 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16325","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_893[] = {"28486","Pulkovo 1942 / Gauss-Kruger 26N","Pulkovo / Gauss 26N","","","Russia - 150 deg to 156 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16326","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_894[] = {"28487","Pulkovo 1942 / Gauss-Kruger 27N","Pulkovo / Gauss 27N","","","Russia - 156 deg to 162 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16327","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_895[] = {"28488","Pulkovo 1942 / Gauss-Kruger 28N","Pulkovo / Gauss 28N","","","Russia - 162 deg to 168 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16328","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_896[] = {"28489","Pulkovo 1942 / Gauss-Kruger 29N","Pulkovo / Gauss 29N","","","Russia - 168 deg to 174 deg East.","projected 2D","","","North","East","X","Y","9001","","4284","16329","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_897[] = {"28490","Pulkovo 1942 / Gauss-Kruger 30N","Pulkovo / Gauss 30N","","","Russia - 174 deg East to 180 deg.","projected 2D","","","North","East","X","Y","9001","","4284","16330","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_898[] = {"28491","Pulkovo 1942 / Gauss-Kruger 31N","Pulkovo / Gauss 31N","","","Russia - 180 deg to 174 deg West.","projected 2D","","","North","East","X","Y","9001","","4284","16331","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_899[] = {"28492","Pulkovo 1942 / Gauss-Kruger 32N","Pulkovo / Gauss 32N","","","Russia - east of 174 deg West.","projected 2D","","","North","East","X","Y","9001","","4284","16332","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_900[] = {"28600","Qatar / Qatar National Grid","Qatar National Grid","","","Qatar - onshore.","projected 2D","","","East","North","E","N","9001","","4286","19919","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_901[] = {"28991","RD / Netherlands Old","","","","Netherlands - onshore.","projected 2D","","","East","North","X","Y","9001","","4289","19913","1995-06-02 00:00:00","","EPSG","Superseded by 28992 (RD / Netherlands New).","",NULL};
+datafile_rows_t horiz_cs_row_902[] = {"28992","RD / Netherlands New","","","","Netherlands - onshore.","projected 2D","","","East","North","X","Y","9001","","4289","19914","1995-06-02 00:00:00","","EPSG","Supersedes 28991 (RD / Netherlands Old).","",NULL};
+datafile_rows_t horiz_cs_row_903[] = {"29100","SAD69 / Brazil Polyconic","","","","Brazil","projected 2D","","","East","North","X","Y","9001","","4291","19941","1999-04-22 00:00:00","PetroBras","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_904[] = {"29118","SAD69 / UTM zone 18N","","","","South America - 78deg West to 72deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16018","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.251.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_905[] = {"29119","SAD69 / UTM zone 19N","","","","South America - 72deg West to 66deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16019","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_906[] = {"29120","SAD69 / UTM zone 20N","","","","South America - 66deg West to 60deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16020","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_907[] = {"29121","SAD69 / UTM zone 21N","","","","South America - 60deg West to 54deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16021","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_908[] = {"29122","SAD69 / UTM zone 22N","","","","South America - 54deg West to 48deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16022","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_909[] = {"29177","SAD69 / UTM zone 17S","","","","South America - 84deg West to 78deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16117","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_910[] = {"29178","SAD69 / UTM zone 18S","","","","South America - Brazil - 78deg West to 72deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16118","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_911[] = {"29179","SAD69 / UTM zone 19S","","","","South America - Brazil - 72deg West to 66deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16119","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_912[] = {"29180","SAD69 / UTM zone 20S","","","","South America - Brazil - 66deg West to 60deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16120","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_913[] = {"29181","SAD69 / UTM zone 21S","","","","South America - Brazil - 60deg West to 54deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16121","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_914[] = {"29182","SAD69 / UTM zone 22S","","","","South America - Brazil - 54deg West to 48deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4291","16122","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_915[] = {"29183","SAD69 / UTM zone 23S","","","","South America - 48deg West to 42deg West.","projected 2D","","","East","North","E","N","9001","","4291","16123","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_916[] = {"29184","SAD69 / UTM zone 24S","","","","South America - Brazil - 42deg West to 36deg West.","projected 2D","","","East","North","E","N","9001","","4291","16124","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_917[] = {"29185","SAD69 / UTM zone 25S","","","","South America - 36deg West to 30deg West.","projected 2D","","","East","North","E","N","9001","","4291","16125","1995-06-02 00:00:00","","EPSG","Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.","97.252",NULL};
+datafile_rows_t horiz_cs_row_918[] = {"29220","Sapper Hill 1943 / UTM zone 20S","Sapper Hill / UTM 20S","","","Falkland Islands - west of 60 deg West.","projected 2D","","","East","North","E","N","9001","","4292","16120","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_919[] = {"29221","Sapper Hill 1943 / UTM zone 21S","Sapper Hill / UTM 21S","","","Falkland Islands - east of 60 deg West.","projected 2D","","","East","North","E","N","9001","","4292","16121","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_920[] = {"29333","Schwarzeck / UTM zone 33S","Schwarzeck / UTM 33S","","","Namibia - offshore.","projected 2D","","","East","North","E","N","9001","","4293","16133","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_921[] = {"29371","South West African Coord. System zone 11","SW African CS zone 11","","","Namibia - west of 12 deg East.","projected 2D","","","West","South","W","S","9031","","4293","17611","1997-06-16 00:00:00","","EPSG","","97.16",NULL};
+datafile_rows_t horiz_cs_row_922[] = {"29373","South West African Coord. System zone 13","SW African CS zone 13","","","Namibia - 12 to 14 deg East.","projected 2D","","","West","South","W","S","9031","","4293","17613","1997-06-16 00:00:00","","EPSG","","97.16",NULL};
+datafile_rows_t horiz_cs_row_923[] = {"29375","South West African Coord. System zone 15","SW African CS zone 15","","","Namibia - 14 to 16 deg East.","projected 2D","","","West","South","W","S","9031","","4293","17615","1997-06-16 00:00:00","","EPSG","","97.16",NULL};
+datafile_rows_t horiz_cs_row_924[] = {"29377","South West African Coord. System zone 17","SW African CS zone 17","","","Namibia - 16 to 18 deg East.","projected 2D","","","West","South","W","S","9031","","4293","17617","1997-06-16 00:00:00","","EPSG","","97.16",NULL};
+datafile_rows_t horiz_cs_row_925[] = {"29379","South West African Coord. System zone 19","SW African CS zone 19","","","Namibia - 18 to 20 deg East.","projected 2D","","","West","South","W","S","9031","","4293","17619","1997-06-16 00:00:00","","EPSG","","97.16",NULL};
+datafile_rows_t horiz_cs_row_926[] = {"29381","South West African Coord. System zone 21","SW African CS zone 21","","","Namibia - 20 to 22 deg East.","projected 2D","","","West","South","W","S","9031","","4293","17621","1997-06-16 00:00:00","","EPSG","","97.16",NULL};
+datafile_rows_t horiz_cs_row_927[] = {"29383","South West African Coord. System zone 23","SW African CS zone 23","","","Namibia - 22 to 24 deg East.","projected 2D","","","West","South","W","S","9031","","4293","17623","1997-06-16 00:00:00","","EPSG","","97.16",NULL};
+datafile_rows_t horiz_cs_row_928[] = {"29385","South West African Coord. System zone 25","SW African CS zone 25","","","Namibia - east of 24 deg East.","projected 2D","","","West","South","W","S","9031","","4293","17625","1997-06-16 00:00:00","","EPSG","","97.16",NULL};
+datafile_rows_t horiz_cs_row_929[] = {"29635","Sudan / UTM zone 35N","","","","Sudan - south - west of 30 deg East.","projected 2D","","","East","North","E","N","9001","","4296","16035","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_930[] = {"29636","Sudan / UTM zone 36N","","","","Sudan - south - east of 30 deg East.","projected 2D","","","East","North","E","N","9001","","4296","16036","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_931[] = {"29700","Tananarive (Paris) / Laborde Grid","Tananarive  / Laborde","","","Madagascar.","projected 2D","","","East","North","X","Y","9001","","4810","19911","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_932[] = {"29738","Tananarive / UTM zone 38S","Tananarive / UTM 38S","","","Madagascar - offshore west of 48 deg East.","projected 2D","","","East","North","E","N","9001","","4297","16138","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_933[] = {"29739","Tananarive / UTM zone 39S","Tananarive / UTM 39S","","","Madagascar - offshore east of 48 deg East.","projected 2D","","","East","North","E","N","9001","","4297","16139","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_934[] = {"29849","Timbalai 1948 / UTM zone 49N","Timbalai 1948 / UTM 49N","","","Brunei - offshore; Malaysia - East Malaysia (Sarawak).","projected 2D","","","East","North","E","N","9001","","4298","16049","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_935[] = {"29850","Timbalai 1948 / UTM zone 50N","Timbalai 1948 / UTM 50N","","","Brunei - offshore; Malaysia - East Malaysia (Sabah).","projected 2D","","","East","North","E","N","9001","","4298","16050","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_936[] = {"29871","Timbalai 1948 / R.S.O. Borneo (ch)","Timbalai  / Borneo (ch)","","","Malaysia - East Malaysia (Sabah; Sarawak).","projected 2D","","","East","North","E","N","9042","","4298","19912","1999-10-20 00:00:00","","EPSG","Adopts metric conversion of 39.370147 inches per metre.","97.231",NULL};
+datafile_rows_t horiz_cs_row_937[] = {"29872","Timbalai 1948 / R.S.O. Borneo (ft)","Timbalai  / Borneo (ft)","","","Brunei; Malaysia - East Malaysia (Sabah; Sarawak).","projected 2D","","","East","North","E","N","9041","","4298","19912","1999-10-20 00:00:00","","EPSG","Original projection definition in chains.  1 chain = 66 feet=792 inches.  Adopts metric conversion of 39.370147 inches per metre.","97.231",NULL};
+datafile_rows_t horiz_cs_row_938[] = {"29873","Timbalai 1948 / R.S.O. Borneo (m)","Timbalai  / Borneo (m)","","","Brunei.","projected 2D","","","East","North","E","N","9001","","4298","19912","1997-07-22 00:00:00","","EPSG","Original projection definition in chains.  1 chain = 66 feet=792 inches.  Adopts metric conversion of 39.370147 inches per metre.","",NULL};
+datafile_rows_t horiz_cs_row_939[] = {"29900","TM65 / Irish National Grid","TM65 / Irish Nat Grid","","","Ireland - onshore; United Kingdom (UK) - Northern Ireland (Ulster) onshore","projected 2D","","","East","North","E","N","9001","","4299","19908","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_940[] = {"30161","Tokyo / Japan Plane Rectangular CS I","Tokyo / Japan zone I","","","Japan - Kyushu - Nagasaki-ken; islands of Kagoshima-ken between 27 and 32 deg N and between 128 deg 18 min and 130 deg E (between 128 deg 18 min and 30 deg 13 min E for Amami islands).","projected 2D","","","North","East","X","Y","9001","","4301","17801","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_941[] = {"30162","Tokyo / Japan Plane Rectangular CS II","Tokyo / Japan zone II","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","projected 2D","","","North","East","X","Y","9001","","4301","17802","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_942[] = {"30163","Tokyo / Japan Plane Rectangular CS III","Tokyo / Japan zone III","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","projected 2D","","","North","East","X","Y","9001","","4301","17803","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_943[] = {"30164","Tokyo / Japan Plane Rectangular CS IV","Tokyo / Japan zone IV","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","projected 2D","","","North","East","X","Y","9001","","4301","17804","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_944[] = {"30165","Tokyo / Japan Plane Rectangular CS V","Tokyo / Japan zone V","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","projected 2D","","","North","East","X","Y","9001","","4301","17805","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_945[] = {"30166","Tokyo / Japan Plane Rectangular CS VI","Tokyo / Japan zone VI","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","projected 2D","","","North","East","X","Y","9001","","4301","17806","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_946[] = {"30167","Tokyo / Japan Plane Rectangular CS VII","Tokyo / Japan zone VII","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","projected 2D","","","North","East","X","Y","9001","","4301","17807","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_947[] = {"30168","Tokyo / Japan Plane Rectangular CS VIII","Tokyo / Japan zone VIII","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","projected 2D","","","North","East","X","Y","9001","","4301","17808","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_948[] = {"30169","Tokyo / Japan Plane Rectangular CS IX","Tokyo / Japan zone IX","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","projected 2D","","","North","East","X","Y","9001","","4301","17809","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_949[] = {"30170","Tokyo / Japan Plane Rectangular CS X","Tokyo / Japan zone X","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","projected 2D","","","North","East","X","Y","9001","","4301","17810","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_950[] = {"30171","Tokyo / Japan Plane Rectangular CS XI","Tokyo / Japan zone XI","","","Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.","projected 2D","","","North","East","X","Y","9001","","4301","17811","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_951[] = {"30172","Tokyo / Japan Plane Rectangular CS XII","Tokyo / Japan zone XII","","","Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.","projected 2D","","","North","East","X","Y","9001","","4301","17812","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_952[] = {"30173","Tokyo / Japan Plane Rectangular CS XIII","Tokyo / Japan zone XIII","","","Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.","projected 2D","","","North","East","X","Y","9001","","4301","17813","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_953[] = {"30174","Tokyo / Japan Plane Rectangular CS XIV","Tokyo / Japan zone XIV","","","Japan - Tokyo-to south of 28 deg N & between 140 deg 30 min & 143 deg E.","projected 2D","","","North","East","X","Y","9001","","4301","17814","1998-12-12 00:00:00","","EPSG","Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low.","",NULL};
+datafile_rows_t horiz_cs_row_954[] = {"30175","Tokyo / Japan Plane Rectangular CS XV","Tokyo / Japan zone XV","","","Japan - Okinawa-ken between 126 deg &130 deg E.","projected 2D","","","North","East","X","Y","9001","","4301","17815","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_955[] = {"30176","Tokyo / Japan Plane Rectangular CS XVI","Tokyo / Japan zone XVI","","","Japan - Okinawa-ken west of 126 deg E.","projected 2D","","","North","East","X","Y","9001","","4301","17816","1998-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_956[] = {"30177","Tokyo / Japan Plane Rectangular CS XVII","Tokyo / Japan zone XVII","","","Japan - Okinawa-ken east of 130 deg E.","projected 2D","","","North","East","X","Y","9001","","4301","17817","1998-12-12 00:00:00","","EPSG","Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low.","",NULL};
+datafile_rows_t horiz_cs_row_957[] = {"30178","Tokyo / Japan Plane Rectangular CS XVIII","Tokyo / Japan zone XVIII","","","Japan - Tokyo-to south of 28 N & west of 140 deg 30 min E.","projected 2D","","","North","East","X","Y","9001","","4301","17818","1998-12-12 00:00:00","","EPSG","Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low.","",NULL};
+datafile_rows_t horiz_cs_row_958[] = {"30179","Tokyo / Japan Plane Rectangular CS XIX","Tokyo / Japan zone XIX","","","Japan - Tokyo-to south of 28 N & east of 143 deg E.","projected 2D","","","North","East","X","Y","9001","","4301","17819","1998-12-12 00:00:00","","EPSG","Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low.","",NULL};
+datafile_rows_t horiz_cs_row_959[] = {"30200","Trinidad 1903 / Trinidad Grid","Trinidad 1903 / Trinidad","","","Trinidad and Tobago - Trinidad","projected 2D","","","East","North","E","N","9039","","4302","19925","1999-10-20 00:00:00","","EPSG","","97.231",NULL};
+datafile_rows_t horiz_cs_row_960[] = {"30339","TC(1948) / UTM zone 39N","","","","United Arab Emirates (UAE) - Abu Dhabi west of 54 deg East.","projected 2D","","","East","North","E","N","9001","","4303","16039","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_961[] = {"30340","TC(1948) / UTM zone 40N","","","","United Arab Emirates (UAE) - Abu Dhabi east of 54 deg East; Dubai.","projected 2D","","","East","North","E","N","9001","","4303","16040","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_962[] = {"30491","Voirol 1875 / Nord Algerie (ancienne)","Voirol /N Algerie ancien","","","Algeria - north of 38.5 grads (34 deg 39 min) North.","projected 2D","","","East","North","X","Y","9001","","4304","18011","1995-06-02 00:00:00","","EPSG","Superseded by 30591 (Voirol Unifie / Algeria Nord).","",NULL};
+datafile_rows_t horiz_cs_row_963[] = {"30492","Voirol 1875 / Sud Algerie (ancienne)","Voirol /S Algerie ancien","","","Algeria - 35 grads to 38.5 grads (31 deg 30 min to 34 deg 39 min) North.","projected 2D","","","East","North","X","Y","9001","","4304","18012","1995-06-02 00:00:00","","EPSG","Superseded by 30592 (Voirol Unifie / Algeria Sud).","",NULL};
+datafile_rows_t horiz_cs_row_964[] = {"30591","Voirol Unifie / Nord Algerie","Voirol Unifie /N Algerie","","","Algeria - north of 38.5 grads (34 deg 39 min) North.","projected 2D","","","East","North","X","Y","9001","","4305","18021","1995-06-02 00:00:00","","EPSG","Supersedes 30491 (Voirol 1875 / Nord Algeria ancienne).","",NULL};
+datafile_rows_t horiz_cs_row_965[] = {"30592","Voirol Unifie / Sud Algerie","Voirol Unifie /S Algerie","","","Algeria - 35 grads to 38.5 grads (31 deg 30 min to 34 deg 39 min) North.","projected 2D","","","East","North","X","Y","9001","","4305","18022","1995-06-02 00:00:00","","EPSG","Supersedes 30492 (Voirol 1875 / Sud Algeria ancienne).","",NULL};
+datafile_rows_t horiz_cs_row_966[] = {"30729","Nord Sahara 1959 / UTM zone 29N","Nord Sahara / UTM 29N","","","Algeria west of 6 deg West (of Greenwich).","projected 2D","","","East","North","E","N","9001","","4307","16029","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_967[] = {"30730","Nord Sahara 1959 / UTM zone 30N","Nord Sahara / UTM 30N","","","Algeria 6 deg West to 0 deg East (of Greenwich).","projected 2D","","","East","North","E","N","9001","","4307","16030","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_968[] = {"30731","Nord Sahara 1959 / UTM zone 31N","Nord Sahara / UTM 31N","","","Algeria 0 deg to 6 deg East (of Greenwich).","projected 2D","","","East","North","E","N","9001","","4307","16031","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_969[] = {"30732","Nord Sahara 1959 / UTM zone 32N","Nord Sahara / UTM 32N","","","Algeria east of 6 deg East (of Greenwich).","projected 2D","","","East","North","E","N","9001","","4307","16032","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_970[] = {"30800","RT38 2.5 gon W","","","","Sweden","projected 2D","","","North","East","X","Y","9001","","4308","19929","1997-11-13 00:00:00","National Land Survey of Sweden","EPSG","","97.14  97.39",NULL};
+datafile_rows_t horiz_cs_row_971[] = {"31028","Yoff / UTM zone 28N","","","","Senegal.","projected 2D","","","East","North","E","N","9001","","4310","16028","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_972[] = {"31121","Zanderij / UTM zone 21N","","","","Suriname.","projected 2D","","","East","North","E","N","9001","","4311","16021","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_973[] = {"31291","MGI (Ferro) / Austria West Zone","MGI / Austria West","","","Austria west of 11deg 50min East of Greenwich (29 deg 30 min East of Ferro).","projected 2D","","","East","North","X","Y","9001","","4805","18041","1995-06-02 00:00:00","","EPSG","Superceded by MGI / M34 (EPSG code 31296).","97.01",NULL};
+datafile_rows_t horiz_cs_row_974[] = {"31292","MGI (Ferro) / Austria Central Zone","MGI / Austria Central","","","Austria between 11deg 50min and 14deg 50min East of Greenwich (29 deg 30 min and 32 deg 30 min East of Ferro).","projected 2D","","","East","North","X","Y","9001","","4805","18042","1995-06-02 00:00:00","","EPSG","Superceded by MGI / M31 (EPSG code 31295).","97.01",NULL};
+datafile_rows_t horiz_cs_row_975[] = {"31293","MGI (Ferro) / Austria East Zone","MGI / Austria East","","","Austria east of 14deg 50min East of Greenwich (32 deg 30 min East of Ferro).","projected 2D","","","East","North","X","Y","9001","","4805","18043","1995-06-02 00:00:00","","EPSG","Superceded by MGI / M28 (EPSG code 31294).","97.01",NULL};
+datafile_rows_t horiz_cs_row_976[] = {"31294","MGI / M28","","","","Austria west of 11deg 50min East of Greenwich (29 deg 30 min East of Ferro).","projected 2D","","","East","North","X","Y","9001","","4312","18044","1999-10-20 00:00:00","","EPSG","Supercedes MGI (Ferro) / Austria East zone (EPSG code 31293).","",NULL};
+datafile_rows_t horiz_cs_row_977[] = {"31295","MGI / M31","","","","Austria between 11deg 50min and 14deg 50min East of Greenwich (29 deg 30 min and 32 deg 30 min East of Ferro).","projected 2D","","","East","North","X","Y","9001","","4312","18045","1999-10-20 00:00:00","","EPSG","Supercedes MGI (Ferro) / Austria Central zone (EPSG code 31292).","",NULL};
+datafile_rows_t horiz_cs_row_978[] = {"31296","MGI / M34","","","","Austria east of 14deg 50min East of Greenwich (32 deg 30 min East of Ferro).","projected 2D","","","East","North","X","Y","9001","","4312","18046","1999-10-20 00:00:00","","EPSG","Supercedes MGI (Ferro) / Austria West zone (EPSG code 31291).","",NULL};
+datafile_rows_t horiz_cs_row_979[] = {"31297","MGI / Austria Lambert","","","","Austria","projected 2D","","","East","North","X","Y","9001","","4312","19947","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_980[] = {"31300","Belge 1972 / Belge Lambert 72","Belge Lambert 72","","","Belgium - onshore.","projected 2D","","","East","North","X","Y","9001","","4313","19902","1995-06-02 00:00:00","","EPSG","Supersedes 21500 (Belge 1950 / Belge Lambert 50).","",NULL};
+datafile_rows_t horiz_cs_row_981[] = {"31491","DHDN / Germany zone 1","","","","Germany - onshore west of 4 deg 30 min East.","projected 2D","","","East","North","X","Y","9001","","4314","18101","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_982[] = {"31492","DHDN / Germany zone 2","","","","Germany - onshore between 4 deg 30 min and 7 deg 30 min East.","projected 2D","","","East","North","X","Y","9001","","4314","18102","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_983[] = {"31493","DHDN / Germany zone 3","","","","Germany - onshore between 7 deg 30 min and 10 deg 30 min East.","projected 2D","","","East","North","X","Y","9001","","4314","18103","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_984[] = {"31494","DHDN / Germany zone 4","","","","Germany - onshore between 10 deg 30 min and 13 deg 30 min East.","projected 2D","","","East","North","X","Y","9001","","4314","18104","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_985[] = {"31495","DHDN / Germany zone 5","","","","Germany - onshore between 13 deg 30 min and 16 deg 30 min East.","projected 2D","","","East","North","X","Y","9001","","4314","18105","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_986[] = {"31600","Dealul Piscului 1933/ Stereo 33","Stereo 33","","","Romania.","projected 2D","","","East","North","X","Y","9001","","4316","19927","1996-04-12 00:00:00","","EPSG","Superseded by Stereo 70 system (ProjCS code 31700).","",NULL};
+datafile_rows_t horiz_cs_row_987[] = {"31700","Dealul Piscului 1970/ Stereo 70","Stereo 70","","","Romania.","projected 2D","","","North","East","X","Y","9001","","4317","19926","1996-04-12 00:00:00","","EPSG","Supersedes Stereo 33 system.","",NULL};
+datafile_rows_t horiz_cs_row_988[] = {"31838","NGN / UTM zone 38N","","","","Kuwait west of 48deg East.","projected 2D","","","East","North","E","N","9001","","4318","16038","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_989[] = {"31839","NGN / UTM zone 39N","","","","Kuwait east of 48deg East.","projected 2D","","","East","North","E","N","9001","","4318","16039","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_990[] = {"31900","KUDAMS / KTM","","","","Kuwait - Kuwait City.","projected 2D","","","East","North","E","N","9001","","4319","19928","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_991[] = {"32001","NAD27 / Montana North","","","","United States (USA) - Montana - MT_N - counties of Blaine; Chouteau; Daniels; Flathead; Glacier; Hill; Liberty; Lincoln; Phillips; Pondera; Roosevelt; Sheridan; Teton; Toole; Valley","projected 2D","","","East","North","X","Y","9003","","4267","12501","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_992[] = {"32002","NAD27 / Montana Central","","","","United States (USA) - Montana - MT_C - counties of Cascade; Dawson; Fergus; Garfield; Judith Basin; Lake; Lewis and Clark; McCone; Meagher; Mineral; Missoula; Petroleum; Powell; Prairie; Richland; Sanders; Wibaux","projected 2D","","","East","North","X","Y","9003","","4267","12502","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_993[] = {"32003","NAD27 / Montana South","","","","United States (USA) - Montana - MT_S - counties of Beaverhead; Big Horn; Broadwater; Carbon; Carter; Custer; Deer Lodge; Fallon; Gallatin; Golden Valley; Granite; Jefferson; Madison; Musselshell; Park; Powder River; Ravalli; Rosebud; Silver Bow; Stillwater","projected 2D","","","East","North","X","Y","9003","","4267","12503","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_994[] = {"32005","NAD27 / Nebraska North","","","","United States (USA) - Nebraska - NE_N - counties of Antelope; Blaine; Box Butte; Boyd; Brown; Burt; Cedar; Cherry; Cuming; Dakota; Dawes; Dixon; Garfield; Grant; Holt; Hooker; Keya Paha; Knox; Loup; Madison; Pierce; Rock; Sheridan; Sioux; Stanton; Thomas; ","projected 2D","","","East","North","X","Y","9003","","4267","12601","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_995[] = {"32006","NAD27 / Nebraska South","","","","United States (USA) - Nebraska - NE_S - counties of Adams; Arthur; Banner; Boone; Buffalo; Butler; Cass; Chase; Cheyenne; Clay; Colfax; Custer; Dawson; Deuel; Dodge; Douglas; Dundy; Fillmore; Franklin; Frontier; Furnas; Gage; Garden; Gosper; Greeley; Hall;","projected 2D","","","East","North","X","Y","9003","","4267","12602","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_996[] = {"32007","NAD27 / Nevada East","","","","United States (USA) - Nevada - NV_E - counties of Clark; Elko; Eureka; Lincoln; White Pine","projected 2D","","","East","North","X","Y","9003","","4267","12701","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_997[] = {"32008","NAD27 / Nevada Central","","","","United States (USA) - Nevada - NV_C - counties of Lander; Nye","projected 2D","","","East","North","X","Y","9003","","4267","12702","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_998[] = {"32009","NAD27 / Nevada West","","","","United States (USA) - Nevada - NV_W - counties of Churchill; Douglas; Esmeralda; Humboldt; Lyon; Mineral; Pershing; Storey; Washoe","projected 2D","","","East","North","X","Y","9003","","4267","12703","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_999[] = {"32010","NAD27 / New Hampshire","","","","United States (USA) - New Hampshire - NH - counties of Belknap; Carroll; Cheshire; Coos; Grafton; Hillsborough; Merrimack; Rockingham; Strafford; Sullivan","projected 2D","","","East","North","X","Y","9003","","4267","12800","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1000[] = {"32011","NAD27 / New Jersey","","","","United States (USA) - New Jersey - NJ - counties of Atlantic; Bergen; Burlington; Camden; Cape May; Cumberland; Essex; Gloucester; Hudson; Hunterdon; Mercer; Middlesex; Monmouth; Morris; Ocean; Passaic; Salem; Somerset; Sussex; Union; Warren","projected 2D","","","East","North","X","Y","9003","","4267","12900","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1001[] = {"32012","NAD27 / New Mexico East","","","","United States (USA) - New Mexico - NM_E - counties of Chaves; Colfax; Curry; De Baca; Eddy; Guadalupe; Harding; Lea; Mora; Quay; Roosevelt; San Miguel; Union","projected 2D","","","East","North","X","Y","9003","","4267","13001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1002[] = {"32013","NAD27 / New Mexico Central","NAD27 / New Mexico Cent.","","","United States (USA) - New Mexico - NM_C - counties of Bernalillo; Dona Ana; Lincoln; Los Alamos; Otero; Rio Arriba; Sandoval; Santa Fe; Socorro; Taos; Torrance","projected 2D","","","East","North","X","Y","9003","","4267","13002","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1003[] = {"32014","NAD27 / New Mexico West","","","","United States (USA) - New Mexico - NM_W - counties of Catron; Cibola; Grant; Hidalgo; Luna; McKinley; San Juan; Sierra; Valencia","projected 2D","","","East","North","X","Y","9003","","4267","13003","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1004[] = {"32015","NAD27 / New York East","","","","United States (USA) - New York - NY_E - counties of Albany; Clinton; Columbia; Delaware; Dutchess; Essex; Franklin; Fulton; Greene; Hamilton; Herkimer; Montgomery; Orange; Otsego; Putnam; Rensselaer; Rockland; Saratoga; Schenectady; Schoharie; St. Lawrence","projected 2D","","","East","North","X","Y","9003","","4267","13101","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1005[] = {"32016","NAD27 / New York Central","","","","United States (USA) - New York - NY_C - counties of Broome; Cayuga; Chemung; Chenango; Cortland; Jefferson; Lewis; Madison; Oneida; Onondaga; Ontario; Oswego; Schuyler; Seneca; Steuben; Tioga; Tompkins; Wayne; Yates","projected 2D","","","East","North","X","Y","9003","","4267","13102","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1006[] = {"32017","NAD27 / New York West","","","","United States (USA) - New York - NY_W - counties of Allegany; Cattaraugus; Chautauqua; Erie; Genesee; Livingston; Monroe; Niagara; Orleans; Wyoming","projected 2D","","","East","North","X","Y","9003","","4267","13103","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1007[] = {"32018","NAD27 / New York Long Island","NAD27 / New York Long Is","","","United States (USA) - New York - NY_LI - counties of Bronx; Kings; Nassau; New York; Queens; Richmond; Suffolk","projected 2D","","","East","North","X","Y","9003","","4267","13104","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1008[] = {"32019","NAD27 / North Carolina","","","","United States (USA) - North Carolina - NC - counties of Alamance; Alexander; Alleghany; Anson; Ashe; Avery; Beaufort; Bertie; Bladen; Brunswick; Buncombe; Burke; Cabarrus; Caldwell; Camden; Carteret; Caswell; Catawba; Chatham; Cherokee; Chowan; Clay; Cleve","projected 2D","","","East","North","X","Y","9003","","4267","13200","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1009[] = {"32020","NAD27 / North Dakota North","NAD27 / North Dakota N","","","United States (USA) - North Dakota - ND_N - counties of Benson; Bottineau; Burke; Cavalier; Divide; Eddy; Foster; Grand Forks; Griggs; McHenry; McKenzie; McLean; Mountrial; Nelson; Pembina; Pierce; Ramsey; Renville; Rolette; Sheridan; Steele; Towner; Trail","projected 2D","","","East","North","X","Y","9003","","4267","13301","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1010[] = {"32021","NAD27 / North Dakota South","NAD27 / North Dakota S","","","United States (USA) - North Dakota - ND_S - counties of Adams; Barnes; Billings; Bowman; Burleigh; Cass; Dickey; Dunn; Emmons; Golden Valley; Grant; Hettinger; Kidder; La Moure; Logan; McIntosh; Mercer; Morton; Oliver; Ransom; Richland; Sargent; Sioux; Slo","projected 2D","","","East","North","X","Y","9003","","4267","13302","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1011[] = {"32022","NAD27 / Ohio North","","","","United States (USA) - Ohio - OH_N - counties of Allen;Ashland; Ashtabula; Auglaize; Carroll; Columbiana; Coshocton; Crawford; Cuyahoga; Defiance; Delaware; Erie; Fulton; Geauga; Hancock; Hardin; Harrison; Henry; Holmes; Huron; Jefferson; Knox; Lake; Logan;","projected 2D","","","East","North","X","Y","9003","","4267","13401","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1012[] = {"32023","NAD27 / Ohio South","","","","United States (USA) - Ohio - OH_S - counties of Adams; Athens; Belmont; Brown; Butler; Champaign; Clark; Clermont; Clinton; Darke; Fairfield; Fayette; Franklin; Gallia; Greene; Guernsey; Hamilton; Highland; Hocking; Jackson; Lawrence; Licking; Madison; Mei","projected 2D","","","East","North","X","Y","9003","","4267","13402","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1013[] = {"32024","NAD27 / Oklahoma North","","","","United States (USA) - Oklahoma - OK_N - counties of Adair; Alfalfa; Beaver; Blaine; Canadian; Cherokee; Cimarron; Craig; Creek; Custer; Delaware; Dewey; Ellis; Garfield; Grant; Harper; Kay; Kingfisher; Lincoln; Logan; Major; Mayes; Muskogee; Noble; Nowata;","projected 2D","","","East","North","X","Y","9003","","4267","13501","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1014[] = {"32025","NAD27 / Oklahoma South","","","","United States (USA) - Oklahoma - OK_S - counties of Atoka; Beckham; Bryan; Caddo; Carter; Choctaw; Cleveland; Coal; Comanche; Cotton; Garvin; Grady; Greer; Harmon; Haskell; Hughes; Jackson; Jefferson; Johnston; Kiowa; Latimer; Le Flore; Love; Marshall; McC","projected 2D","","","East","North","X","Y","9003","","4267","13502","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1015[] = {"32026","NAD27 / Oregon North","","","","United States (USA) - Oregon - OR_N - counties of Baker; Benton; Clackamas; Clatsop; Columbia; Gilliam; Grant; Hood River; Jefferson; Lincoln; Linn; Marion; Morrow; Multnomah; Polk; Sherman; Tillamook; Umatilla; Union; Wallowa; Wasco; Washington; Wheeler; ","projected 2D","","","East","North","X","Y","9003","","4267","13601","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1016[] = {"32027","NAD27 / Oregon South","","","","United States (USA) - Oregon - OR_S - counties of Coos; Crook; Curry; Deschutes; Douglas; Harney; Jackson; Josephine; Klamath; Lake; Lane; Malheur","projected 2D","","","East","North","X","Y","9003","","4267","13602","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1017[] = {"32028","NAD27 / Pennsylvania North","NAD27 / Pennsylvania N","","","United States (USA) - Pennsylvania - PA_N - counties of Bradford; Cameron; Carbon; Centre; Clarion; Clearfield; Clinton; Columbia; Crawford; Elk; Erie; Forest; Jefferson; Lackawanna; Luzerne; Lycoming; McKean; Mercer; Monroe; Montour; Northumberland; Pike;","projected 2D","","","East","North","X","Y","9003","","4267","13701","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1018[] = {"32029","NAD27 / Pennsylvania South","NAD27 / Pennsylvania S","","","United States (USA) - Pennsylvania - PA_S - counties of Adams; Allegheny; Armstrong; Beaver; Bedford; Berks; Blair; Bucks; Butler; Cambria; Chester; Cumberland; Dauphin; Delaware; Fayette; Franklin; Fulton; Greene; Huntingdon; Indiana; Juniata; Lancaster; ","projected 2D","","","East","North","X","Y","9003","","4267","13702","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1019[] = {"32030","NAD27 / Rhode Island","","","","United States (USA) - Rhode Island - RI - counties of Bristol; Kent; Newport; Providence; Washington","projected 2D","","","East","North","X","Y","9003","","4267","13800","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1020[] = {"32031","NAD27 / South Carolina North","NAD27 / South Carolina N","","","United States (USA) - South Carolina - SC_N - counties of Abbeville; Anderson; Calhoun; Cherokee; Chester; Chesterfield; Darlington; Dillon; Edgefield; Fairfield; Florence; Greenville; Greenwood; Horry; Kershaw; Lancaster; Laurens; Lee; Lexington; Marion; ","projected 2D","","","East","North","X","Y","9003","","4267","13901","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1021[] = {"32033","NAD27 / South Carolina South","NAD27 / South Carolina S","","","United States (USA) - South Carolina - SC_S - counties of Aiken; Allendale; Bamberg; Barnwell; Beaufort; Berkeley; Charleston; Clarendon; Colleton; Dorchester; Georgetown; Hampton; Jasper; Orangeburg; Williamsburg","projected 2D","","","East","North","X","Y","9003","","4267","13902","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1022[] = {"32034","NAD27 / South Dakota North","NAD27 / South Dakota N","","","United States (USA) - South Dakota - SD_N - counties of Beadle; Brookings; Brown; Butte; Campbell; Clark; Codington; Corson; Day; Deuel; Dewey; Edmunds; Faulk; Grant; Hamlin; Hand; Harding; Hyde; Kingsbury; Lawrence; Marshall; McPherson; Meade; Perkins; Po","projected 2D","","","East","North","X","Y","9003","","4267","14001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1023[] = {"32035","NAD27 / South Dakota South","NAD27 / South Dakota S","","","United States (USA) - South Dakota - SD_S - counties of Aurora; Bennett; Bon Homme; Brule; Buffalo; Charles Mix; Clay; Custer; Davison; Douglas; Fall River; Gregory; Haakon; Hanson; Hughes; Hutchinson; Jackson; Jerauld; Jones; Lake; Lincoln; Lyman; McCook;","projected 2D","","","East","North","X","Y","9003","","4267","14002","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1024[] = {"32036","NAD27 / Tennessee","","","","United States (USA) - Tennessee - TN - counties of Anderson; Bedford; Benton; Bledsoe; Blount; Bradley; Campbell; Cannon; Carroll; Carter; Cheatham; Chester; Claiborne; Clay; Cocke; Coffee; Crockett; Cumberland; Davidson; De Kalb; Decatur; Dickson; Dyer; F","projected 2D","","","East","North","X","Y","9003","","4267","14100","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1025[] = {"32037","NAD27 / Texas North","","","","United States (USA) - Texas -TX_N - counties of: Armstrong; Briscoe; Carson; Castro; Childress; Collingsworth; Dallam; Deaf Smith; Donley; Gray; Hall; Hansford; Hartley; Hemphill; Hutchinson; Lipscomb; Moore; Ochiltree; Oldham; Parmer; Potter; Randall; Rob","projected 2D","","","East","North","X","Y","9003","","4267","14201","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1026[] = {"32038","NAD27 / Texas North Central","NAD27 / Texas North Cen.","","","United States (USA) - Texas -TX_NC - counties of: Andrews; Archer; Bailey; Baylor; Borden; Bowie; Callahan; Camp; Cass; Clay; Cochran; Collin; Cooke; Cottle; Crosby; Dallas; Dawson; Delta; Denton; Dickens; Eastland; Ellis; Erath; Fannin; Fisher; Floyd; Foa","projected 2D","","","East","North","X","Y","9003","","4267","14202","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1027[] = {"32039","NAD27 / Texas Central","","","","United States (USA) - Texas -TX_C - counties of Anderson; Angelina; Bastrop; Bell; Blanco; Bosque; Brazos; Brown; Burleson; Burnet; Cherokee; Coke; Coleman; Comanche; Concho; Coryell; Crane; Crockett; Culberson; Ector; El Paso; Falls; Freestone; Gillespie;","projected 2D","","","East","North","X","Y","9003","","4267","14203","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1028[] = {"32040","NAD27 / Texas South Central","NAD27 / Texas South Cen.","","","United States (USA) - Texas -TX_SC - counties of Aransas; Atascosa; Austin; Bandera; Bee; Bexar; Brazoria; Brewster; Caldwell; Calhoun; Chambers; Colorado; Comal; De Witt; Dimmit; Edwards; Fayette; Fort Bend; Frio; Galveston; Goliad; Gonzales; Guadalupe; H","projected 2D","","","East","North","X","Y","9003","","4267","14204","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1029[] = {"32041","NAD27 / Texas South","","","","United States (USA) - Texas -TX_S - counties of Brooks; Cameron; Duval; Hidalgo; Jim Hogg; Jim Wells; Kenedy; Kleberg; Nueces; San Patricio; Starr; Webb; Willacy; Zapata;  - Gulf of Mexico outer continental shelf (OCS) protraction areas: South Padre Island","projected 2D","","","East","North","X","Y","9003","","4267","14205","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1030[] = {"32042","NAD27 / Utah North","","","","United States (USA) - Utah - UT_N - counties of Box Elder; Cache; Daggett; Davis; Morgan; Rich; Summit; Weber","projected 2D","","","East","North","X","Y","9003","","4267","14301","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1031[] = {"32043","NAD27 / Utah Central","","","","United States (USA) - Utah - UT_C - counties of Carbon; Duchesne; Emery; Grand; Juab; Millard; Salt Lake; Sanpete; Sevier; Tooele; Uintah; Utah; Wasatch","projected 2D","","","East","North","X","Y","9003","","4267","14302","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1032[] = {"32044","NAD27 / Utah South","","","","United States (USA) - Utah - UT_S - counties of Beaver; Garfield; Iron; Kane; Piute; San Juan; Washington; Wayne","projected 2D","","","East","North","X","Y","9003","","4267","14303","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1033[] = {"32045","NAD27 / Vermont","","","","United States (USA) - Vermont - VT - counties of Addison; Bennington; Caledonia; Chittenden; Essex; Franklin; Grand Isle; Lamoille; Orange; Orleans; Rutland; Washington; Windham; Windsor","projected 2D","","","East","North","X","Y","9003","","4267","14400","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1034[] = {"32046","NAD27 / Virginia North","","","","United States (USA) - Virginia - VA_N - counties of Arlington; Augusta; Bath; Caroline; Clarke; Culpeper; Fairfax; Fauquier; Frederick; Greene; Highland; King George; Loudoun; Madison; Orange; Page; Prince William; Rappahannock; Rockingham; Shenandoah; Spo","projected 2D","","","East","North","X","Y","9003","","4267","14501","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1035[] = {"32047","NAD27 / Virginia South","","","","United States (USA) - Virginia - VA_S - counties of Accomack; Albemarle; Alleghany; Amelia; Amherst; Appomattox; Bedford; Bland; Botetourt; Bristol; Brunswick; Buchanan; Buckingham; Campbell; Carroll; Charles City; Charlotte; Chesapeake; Chesterfield; Colo","projected 2D","","","East","North","X","Y","9003","","4267","14502","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1036[] = {"32048","NAD27 / Washington North","","","","United States (USA) - Washington - WA_N - counties of Chelan; Clallam; Douglas; Ferry; Island; Jefferson; King; Kitsap; Lincoln; Okanogan; Pend Oreille; San Juan; Skagit; Snohomish; Spokane; Stevens; Whatcom","projected 2D","","","East","North","X","Y","9003","","4267","14601","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1037[] = {"32049","NAD27 / Washington South","","","","United States (USA) - Washington - WA_S - counties of Adams; Asotin; Benton; Clark; Columbia; Cowlitz; Franklin; Garfield; Grant; Grays Harbor; Kittitas; Klickitat; Lewis; Mason; Pacific; Pierce; Skamania; Thurston; Wahkiakum; Walla Walla; Whitman; Yakima","projected 2D","","","East","North","X","Y","9003","","4267","14602","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1038[] = {"32050","NAD27 / West Virginia North","NAD27 / West Virginia N","","","United States (USA) - West Virginia - WV_N - counties of Barbour; Berkeley; Brooke; Doddridge; Grant; Hampshire; Hancock; Hardy; Harrison; Jefferson; Marion; Marshall; Mineral; Monongalia; Morgan; Ohio; Pleasants; Preston; Ritchie; Taylor; Tucker; Tyler; W","projected 2D","","","East","North","X","Y","9003","","4267","14701","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1039[] = {"32051","NAD27 / West Virginia South","NAD27 / West Virginia S","","","United States (USA) - West Virginia - WV_S - counties of Boone; Braxton; Cabell; Calhoun; Clay; Fayette; Gilmer; Greenbrier; Jackson; Kanawha; Lewis; Lincoln; Logan; Mason; McDowell; Mercer; Mingo; Monroe; Nicholas; Pendleton; Pocahontas; Putnam; Raleigh; ","projected 2D","","","East","North","X","Y","9003","","4267","14702","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1040[] = {"32052","NAD27 / Wisconsin North","","","","United States (USA) - Wisconsin - WI_N - counties of Ashland; Bayfield; Burnett; Douglas; Florence; Forest; Iron; Oneida; Price; Sawyer; Vilas; Washburn","projected 2D","","","East","North","X","Y","9003","","4267","14801","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1041[] = {"32053","NAD27 / Wisconsin Central","NAD27 / Wisconsin Cen.","","","United States (USA) - Wisconsin - WI_C - counties of Barron; Brown; Buffalo; Chippewa; Clark; Door; Dunn; Eau Claire; Jackson; Kewaunee; Langlade; Lincoln; Marathon; Marinette; Menominee; Oconto; Outagamie; Pepin; Pierce; Polk; Portage; Rusk; Shawano; St. ","projected 2D","","","East","North","X","Y","9003","","4267","14802","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1042[] = {"32054","NAD27 / Wisconsin South","","","","United States (USA) - Wisconsin - WI_S - counties of Adams; Calumet; Columbia; Crawford; Dane; Dodge; Fond Du Lac; Grant; Green; Green Lake; Iowa; Jefferson; Juneau; Kenosha; La Crosse; Lafayette; Manitowoc; Marquette; Milwaukee; Monroe; Ozaukee; Racine; R","projected 2D","","","East","North","X","Y","9003","","4267","14803","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1043[] = {"32055","NAD27 / Wyoming East","","","","United States (USA) - Wyoming - WY_E - counties of Albany; Campbell; Converse; Crook; Goshen; Laramie; Niobrara; Platte; Weston","projected 2D","","","East","North","X","Y","9003","","4267","14901","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1044[] = {"32056","NAD27 / Wyoming East Central","NAD27 / Wyoming E. Cen.","","","United States (USA) - Wyoming - WY_EC - counties of Big Horn; Carbon; Johnson; Natrona; Sheridan; Washakie","projected 2D","","","East","North","X","Y","9003","","4267","14902","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1045[] = {"32057","NAD27 / Wyoming West Central","NAD27 / Wyoming W. Cen.","","","United States (USA) - Wyoming - WY_WC - counties of Fremont; Hot Springs; Park; Sweetwater","projected 2D","","","East","North","X","Y","9003","","4267","14903","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1046[] = {"32058","NAD27 / Wyoming West","","","","United States (USA) - Wyoming - WY_W - counties of Lincoln; Sublette; Teton; Uinta","projected 2D","","","East","North","X","Y","9003","","4267","14904","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1047[] = {"32061","NAD27 / Guatemala Norte","","","","Guatemala - north of 15 deg 50 min North.","projected 2D","","","East","North","X","Y","9001","","4267","18211","1999-08-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1048[] = {"32062","NAD27 / Guatemala Sud","","","","Guatemala - south of 15 deg 50 min North.","projected 2D","","","East","North","X","Y","9001","","4267","18212","1999-08-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1049[] = {"32074","NAD27 / BLM 14N (feet)","","","","United States - Gulf of Mexico - west of approximately 96 deg West - outer continental shelf (OCS) protraction areas Corpus Christi; Port Isabel.","projected 2D","","","East","North","X","Y","9003","","4267","15914","1996-04-12 00:00:00","","EPSG","","96.03",NULL};
+datafile_rows_t horiz_cs_row_1050[] = {"32075","NAD27 / BLM 15N (feet)","","","","United States - Gulf of Mexico - 96 deg to 90 deg West - outer continental shelf (OCS) protraction areas East Breaks (EB); Alaminos Canyon (AC); Garden Banks (GB); Keathley Canyon (KC); Ewing Bank (EW); Green Canyon (GC); Walker Ridge (WR).","projected 2D","","","East","North","X","Y","9003","","4267","15915","1996-04-12 00:00:00","","EPSG","","96.03",NULL};
+datafile_rows_t horiz_cs_row_1051[] = {"32076","NAD27 / BLM 16N (feet)","","","","United States - Gulf of Mexico - 90 deg to 84 deg West - outer continental shelf (OCS) protraction areas Mobile (MO); Viosca Knoll (VK); Mississippi Canyon (MC); Atwater Valley (AT); Lund; Pensacola; Destin Dome (DD); De Soto Canyon; Lloyd; Henderson; Apal","projected 2D","","","East","North","X","Y","9003","","4267","15916","1996-04-12 00:00:00","","EPSG","","95.27  96.03",NULL};
+datafile_rows_t horiz_cs_row_1052[] = {"32077","NAD27 / BLM 17N (feet)","","","","United States - Gulf of Mexico - east of 84 deg West - outer continental shelf (OCS) protraction areas Gainesville; Tarpon Springs; St. Petersburg; Charlotte Harbor; Pulley Ridge; Dry Tortugas; Miami; Key West.","projected 2D","","","East","North","X","Y","9003","","4267","15917","1996-04-12 00:00:00","","EPSG","","96.03",NULL};
+datafile_rows_t horiz_cs_row_1053[] = {"32081","NAD27 / MTM zone 1","","","","Canada - Newfoundland - east of 54 deg 30 min West.","projected 2D","","","East","North","E","N","9001","","4267","17701","1997-11-13 00:00:00","Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1054[] = {"32082","NAD27 / MTM zone 2","","","","Canada - Newfoundland and Labrador between 57 deg 30 min and 54 de 30 min West.","projected 2D","","","East","North","E","N","9001","","4267","17702","1997-11-13 00:00:00","Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1055[] = {"32083","NAD27 / MTM zone 3","","","","Canada - Newfoundland and Labrador between 60 deg and 57 deg 30 min West.","projected 2D","","","East","North","E","N","9001","","4267","17703","1997-11-13 00:00:00","Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1056[] = {"32084","NAD27 / MTM zone 4","","","","Canada - Newfoundland (Labrador) between 63 deg and 60 deg West.","projected 2D","","","East","North","E","N","9001","","4267","17704","1997-11-13 00:00:00","Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1057[] = {"32085","NAD27 / MTM zone 5","","","","Canada - Newfoundland (Labrador) between 66 deg and 63 deg West.","projected 2D","","","East","North","E","N","9001","","4267","17705","1997-11-13 00:00:00","Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1058[] = {"32086","NAD27 / MTM zone 6","","","","Canada - Newfoundland (Labrador) between 69 deg and  66 deg West.","projected 2D","","","East","North","E","N","9001","","4267","17706","1997-11-13 00:00:00","Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1059[] = {"32100","NAD83 / Montana","","","","United States (USA) - Montana - MT - counties of Beaverhead; Big Horn; Blaine; Broadwater; Carbon; Carter; Cascade; Chouteau; Custer; Daniels; Dawson; Deer Lodge; Fallon; Fergus; Flathead; Gallatin; Garfield; Glacier; Golden Valley; Granite; Hill; Jefferso","projected 2D","","","East","North","X","Y","9001","","4269","12530","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1060[] = {"32104","NAD83 / Nebraska","","","","United States (USA) - Nebraska - NE - counties of Adams; Antelope; Arthur; Banner; Blaine; Boone; Box Butte; Boyd; Brown; Buffalo; Burt; Butler; Cass; Cedar; Chase; Cherry; Cheyenne; Clay; Colfax; Cuming; Custer; Dakota; Dawes; Dawson; Deuel; Dixon; Dodge;","projected 2D","","","East","North","X","Y","9001","","4269","12630","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1061[] = {"32107","NAD83 / Nevada  East","","","","United States (USA) - Nevada - NV_E - counties of Clark; Elko; Eureka; Lincoln; White Pine","projected 2D","","","East","North","X","Y","9001","","4269","12731","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1062[] = {"32108","NAD83 / Nevada Central","","","","United States (USA) - Nevada - NV_C - counties of Lander; Nye","projected 2D","","","East","North","X","Y","9001","","4269","12732","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1063[] = {"32109","NAD83 / Nevada West","","","","United States (USA) - Nevada - NV_W - counties of Churchill; Douglas; Esmeralda; Humboldt; Lyon; Mineral; Pershing; Storey; Washoe","projected 2D","","","East","North","X","Y","9001","","4269","12733","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1064[] = {"32110","NAD83 / New Hampshire","","","","United States (USA) - New Hampshire - NH - counties of Belknap; Carroll; Cheshire; Coos; Grafton; Hillsborough; Merrimack; Rockingham; Strafford; Sullivan","projected 2D","","","East","North","X","Y","9001","","4269","12830","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1065[] = {"32111","NAD83 / New Jersey","","","","United States (USA) - New Jersey - NJ - counties of Atlantic; Bergen; Burlington; Camden; Cape May; Cumberland; Essex; Gloucester; Hudson; Hunterdon; Mercer; Middlesex; Monmouth; Morris; Ocean; Passaic; Salem; Somerset; Sussex; Union; Warren","projected 2D","","","East","North","X","Y","9001","","4269","12930","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1066[] = {"32112","NAD83 / New Mexico East","","","","United States (USA) - New Mexico - NM_E - counties of Chaves; Colfax; Curry; De Baca; Eddy; Guadalupe; Harding; Lea; Mora; Quay; Roosevelt; San Miguel; Union","projected 2D","","","East","North","X","Y","9001","","4269","13031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1067[] = {"32113","NAD83 / New Mexico Central","NAD83 / New Mexico Cent.","","","United States (USA) - New Mexico - NM_C - counties of Bernalillo; Dona Ana; Lincoln; Los Alamos; Otero; Rio Arriba; Sandoval; Santa Fe; Socorro; Taos; Torrance; Valencia","projected 2D","","","East","North","X","Y","9001","","4269","13032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1068[] = {"32114","NAD83 / New Mexico West","","","","United States (USA) - New Mexico - NM_W - counties of Catron; Cibola; Grant; Hidalgo; Luna; McKinley; San Juan; Sierra","projected 2D","","","East","North","X","Y","9001","","4269","13033","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1069[] = {"32115","NAD83 / New York  East","","","","United States (USA) - New York - NY_E - counties of Albany; Clinton; Columbia; Delaware; Dutchess; Essex; Franklin; Fulton; Greene; Hamilton; Herkimer; Montgomery; Orange; Otsego; Putnam; Rensselaer; Rockland; Saratoga; Schenectady; Schoharie; St. Lawrence","projected 2D","","","East","North","X","Y","9001","","4269","13131","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1070[] = {"32116","NAD83 / New York Central","","","","United States (USA) - New York - NY_C - counties of Broome; Cayuga; Chemung; Chenango; Cortland; Jefferson; Lewis; Madison; Oneida; Onondaga; Ontario; Oswego; Schuyler; Seneca; Steuben; Tioga; Tompkins; Wayne; Yates","projected 2D","","","East","North","X","Y","9001","","4269","13132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1071[] = {"32117","NAD83 / New York  West","","","","United States (USA) - New York - NY_W - counties of Allegany; Cattaraugus; Chautauqua; Erie; Genesee; Livingston; Monroe; Niagara; Orleans; Wyoming","projected 2D","","","East","North","X","Y","9001","","4269","13133","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1072[] = {"32118","NAD83 / New York Long Island","NAD83 / New York Long Is","","","United States (USA) - New York - NY_LI - counties of Bronx; Kings; Nassau; New York; Queens; Richmond; Suffolk","projected 2D","","","East","North","X","Y","9001","","4269","13134","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1073[] = {"32119","NAD83 / North Carolina","","","","United States (USA) - North Carolina - NC - counties of Alamance; Alexander; Alleghany; Anson; Ashe; Avery; Beaufort; Bertie; Bladen; Brunswick; Buncombe; Burke; Cabarrus; Caldwell; Camden; Carteret; Caswell; Catawba; Chatham; Cherokee; Chowan; Clay; Cleve","projected 2D","","","East","North","X","Y","9001","","4269","13230","1998-11-11 00:00:00","","EPSG","","98.30",NULL};
+datafile_rows_t horiz_cs_row_1074[] = {"32120","NAD83 / North Dakota North","NAD83 / North Dakota N","","","United States (USA) - North Dakota - ND_N - counties of Benson; Bottineau; Burke; Cavalier; Divide; Eddy; Foster; Grand Forks; Griggs; McHenry; McKenzie; McLean; Mountrial; Nelson; Pembina; Pierce; Ramsey; Renville; Rolette; Sheridan; Steele; Towner; Trail","projected 2D","","","East","North","X","Y","9001","","4269","13331","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1075[] = {"32121","NAD83 / North Dakota South","NAD83 / North Dakota S","","","United States (USA) - North Dakota - ND_S - counties of Adams; Barnes; Billings; Bowman; Burleigh; Cass; Dickey; Dunn; Emmons; Golden Valley; Grant; Hettinger; Kidder; La Moure; Logan; McIntosh; Mercer; Morton; Oliver; Ransom; Richland; Sargent; Sioux; Slo","projected 2D","","","East","North","X","Y","9001","","4269","13332","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1076[] = {"32122","NAD83 / Ohio North","","","","United States (USA) - Ohio - OH_N - counties of Allen;Ashland; Ashtabula; Auglaize; Carroll; Columbiana; Coshocton; Crawford; Cuyahoga; Defiance; Delaware; Erie; Fulton; Geauga; Hancock; Hardin; Harrison; Henry; Holmes; Huron; Jefferson; Knox; Lake; Logan;","projected 2D","","","East","North","X","Y","9001","","4269","13431","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1077[] = {"32123","NAD83 / Ohio South","","","","United States (USA) - Ohio - OH_S - counties of Adams; Athens; Belmont; Brown; Butler; Champaign; Clark; Clermont; Clinton; Darke; Fairfield; Fayette; Franklin; Gallia; Greene; Guernsey; Hamilton; Highland; Hocking; Jackson; Lawrence; Licking; Madison; Mei","projected 2D","","","East","North","X","Y","9001","","4269","13432","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1078[] = {"32124","NAD83 / Oklahoma North","","","","United States (USA) - Oklahoma - OK_N - counties of Adair; Alfalfa; Beaver; Blaine; Canadian; Cherokee; Cimarron; Craig; Creek; Custer; Delaware; Dewey; Ellis; Garfield; Grant; Harper; Kay; Kingfisher; Lincoln; Logan; Major; Mayes; Muskogee; Noble; Nowata;","projected 2D","","","East","North","X","Y","9001","","4269","13531","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1079[] = {"32125","NAD83 / Oklahoma South","","","","United States (USA) - Oklahoma - OK_S - counties of Atoka; Beckham; Bryan; Caddo; Carter; Choctaw; Cleveland; Coal; Comanche; Cotton; Garvin; Grady; Greer; Harmon; Haskell; Hughes; Jackson; Jefferson; Johnston; Kiowa; Latimer; Le Flore; Love; Marshall; McC","projected 2D","","","East","North","X","Y","9001","","4269","13532","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1080[] = {"32126","NAD83 / Oregon North","","","","United States (USA) - Oregon - OR_N - counties of Baker; Benton; Clackamas; Clatsop; Columbia; Gilliam; Grant; Hood River; Jefferson; Lincoln; Linn; Marion; Morrow; Multnomah; Polk; Sherman; Tillamook; Umatilla; Union; Wallowa; Wasco; Washington; Wheeler; ","projected 2D","","","East","North","X","Y","9001","","4269","13631","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1081[] = {"32127","NAD83 / Oregon South","","","","United States (USA) - Oregon - OR_S - counties of Coos; Crook; Curry; Deschutes; Douglas; Harney; Jackson; Josephine; Klamath; Lake; Lane; Malheur","projected 2D","","","East","North","X","Y","9001","","4269","13632","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1082[] = {"32128","NAD83 / Pennsylvania North","NAD83 / Pennsylvania N","","","United States (USA) - Pennsylvania - PA_N - counties of Bradford; Cameron; Carbon; Centre; Clarion; Clearfield; Clinton; Columbia; Crawford; Elk; Erie; Forest; Jefferson; Lackawanna; Luzerne; Lycoming; McKean; Mercer; Monroe; Montour; Northumberland; Pike;","projected 2D","","","East","North","X","Y","9001","","4269","13731","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1083[] = {"32129","NAD83 / Pennsylvania South","NAD83 / Pennsylvania S","","","United States (USA) - Pennsylvania - PA_S - counties of Adams; Allegheny; Armstrong; Beaver; Bedford; Berks; Blair; Bucks; Butler; Cambria; Chester; Cumberland; Dauphin; Delaware; Fayette; Franklin; Fulton; Greene; Huntingdon; Indiana; Juniata; Lancaster; ","projected 2D","","","East","North","X","Y","9001","","4269","13732","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1084[] = {"32130","NAD83 / Rhode Island","","","","United States (USA) - Rhode Island - RI - counties of Bristol; Kent; Newport; Providence; Washington","projected 2D","","","East","North","X","Y","9001","","4269","13830","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1085[] = {"32133","NAD83 / South Carolina","","","","United States (USA) - South Carolina - SC - counties of Abbeville; Aiken; Allendale; Anderson; Bamberg; Barnwell; Beaufort; Berkeley; Calhoun; Charleston; Cherokee; Chester; Chesterfield; Clarendon; Colleton; Darlington; Dillon; Dorchester; Edgefield; Fair","projected 2D","","","East","North","X","Y","9001","","4269","13930","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1086[] = {"32134","NAD83 / South Dakota North","NAD83 / South Dakota N","","","United States (USA) - South Dakota - SD_N - counties of Beadle; Brookings; Brown; Butte; Campbell; Clark; Codington; Corson; Day; Deuel; Dewey; Edmunds; Faulk; Grant; Hamlin; Hand; Harding; Hyde; Kingsbury; Lawrence; Marshall; McPherson; Meade; Perkins; Po","projected 2D","","","East","North","X","Y","9001","","4269","14031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1087[] = {"32135","NAD83 / South Dakota South","NAD83 / South Dakota S","","","United States (USA) - South Dakota - SD_S - counties of Aurora; Bennett; Bon Homme; Brule; Buffalo; Charles Mix; Clay; Custer; Davison; Douglas; Fall River; Gregory; Haakon; Hanson; Hughes; Hutchinson; Jackson; Jerauld; Jones; Lake; Lincoln; Lyman; McCook;","projected 2D","","","East","North","X","Y","9001","","4269","14032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1088[] = {"32136","NAD83 / Tennessee","","","","United States (USA) - Tennessee - TN - counties of Anderson; Bedford; Benton; Bledsoe; Blount; Bradley; Campbell; Cannon; Carroll; Carter; Cheatham; Chester; Claiborne; Clay; Cocke; Coffee; Crockett; Cumberland; Davidson; De Kalb; Decatur; Dickson; Dyer; F","projected 2D","","","East","North","X","Y","9001","","4269","14130","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1089[] = {"32137","NAD83 / Texas North","","","","United States (USA) - Texas -TX_N - counties of: Armstrong; Briscoe; Carson; Castro; Childress; Collingsworth; Dallam; Deaf Smith; Donley; Gray; Hall; Hansford; Hartley; Hemphill; Hutchinson; Lipscomb; Moore; Ochiltree; Oldham; Parmer; Potter; Randall; Rob","projected 2D","","","East","North","X","Y","9001","","4269","14231","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1090[] = {"32138","NAD83 / Texas North Central","NAD83 / Texas North Cen.","","","United States (USA) - Texas -TX_NC - counties of: Andrews; Archer; Bailey; Baylor; Borden; Bowie; Callahan; Camp; Cass; Clay; Cochran; Collin; Cooke; Cottle; Crosby; Dallas; Dawson; Delta; Denton; Dickens; Eastland; Ellis; Erath; Fannin; Fisher; Floyd; Foa","projected 2D","","","East","North","X","Y","9001","","4269","14232","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1091[] = {"32139","NAD83 / Texas Central","","","","United States (USA) - Texas -TX_C - counties of Anderson; Angelina; Bastrop; Bell; Blanco; Bosque; Brazos; Brown; Burleson; Burnet; Cherokee; Coke; Coleman; Comanche; Concho; Coryell; Crane; Crockett; Culberson; Ector; El Paso; Falls; Freestone; Gillespie;","projected 2D","","","East","North","X","Y","9001","","4269","14233","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1092[] = {"32140","NAD83 / Texas South Central","NAD83 / Texas South Cen.","","","United States (USA) - Texas -TX_SC - counties of Aransas; Atascosa; Austin; Bandera; Bee; Bexar; Brazoria; Brewster; Caldwell; Calhoun; Chambers; Colorado; Comal; De Witt; Dimmit; Edwards; Fayette; Fort Bend; Frio; Galveston; Goliad; Gonzales; Guadalupe; H","projected 2D","","","East","North","X","Y","9001","","4269","14234","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1093[] = {"32141","NAD83 / Texas South","","","","United States (USA) - Texas -TX_S - counties of Brooks; Cameron; Duval; Hidalgo; Jim Hogg; Jim Wells; Kenedy; Kleberg; Nueces; San Patricio; Starr; Webb; Willacy; Zapata","projected 2D","","","East","North","X","Y","9001","","4269","14235","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1094[] = {"32142","NAD83 / Utah North","","","","United States (USA) - Utah - UT_N - counties of Box Elder; Cache; Daggett; Davis; Morgan; Rich; Summit; Weber","projected 2D","","","East","North","X","Y","9001","","4269","14331","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1095[] = {"32143","NAD83 / Utah Central","","","","United States (USA) - Utah - UT_C - counties of Carbon; Duchesne; Emery; Grand; Juab; Millard; Salt Lake; Sanpete; Sevier; Tooele; Uintah; Utah; Wasatch","projected 2D","","","East","North","X","Y","9001","","4269","14332","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1096[] = {"32144","NAD83 / Utah South","","","","United States (USA) - Utah - UT_S - counties of Beaver; Garfield; Iron; Kane; Piute; San Juan; Washington; Wayne","projected 2D","","","East","North","X","Y","9001","","4269","14333","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1097[] = {"32145","NAD83 / Vermont","","","","United States (USA) - Vermont - VT - counties of Addison; Bennington; Caledonia; Chittenden; Essex; Franklin; Grand Isle; Lamoille; Orange; Orleans; Rutland; Washington; Windham; Windsor","projected 2D","","","East","North","X","Y","9001","","4269","14430","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1098[] = {"32146","NAD83 / Virginia North","","","","United States (USA) - Virginia - VA_N - counties of Arlington; Augusta; Bath; Caroline; Clarke; Culpeper; Fairfax; Fauquier; Frederick; Greene; Highland; King George; Loudoun; Madison; Orange; Page; Prince William; Rappahannock; Rockingham; Shenandoah; Spo","projected 2D","","","East","North","X","Y","9001","","4269","14531","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1099[] = {"32147","NAD83 / Virginia South","","","","United States (USA) - Virginia - VA_S - counties of Accomack; Albemarle; Alleghany; Amelia; Amherst; Appomattox; Bedford; Bland; Botetourt; Bristol; Brunswick; Buchanan; Buckingham; Campbell; Carroll; Charles City; Charlotte; Chesapeake; Chesterfield; Colo","projected 2D","","","East","North","X","Y","9001","","4269","14532","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1100[] = {"32148","NAD83 / Washington North","","","","United States (USA) - Washington - WA_N - counties of Chelan; Clallam; Douglas; Ferry; Grant north of approx. 47d30m; Island; Jefferson; King; Kitsap; Lincoln; Okanogan; Pend Oreille; San Juan; Skagit; Snohomish; Spokane; Stevens; Whatcom","projected 2D","","","East","North","X","Y","9001","","4269","14631","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1101[] = {"32149","NAD83 / Washington South","","","","United States (USA) - Washington - WA_S - counties of Adams; Asotin; Benton; Clark; Columbia; Cowlitz; Franklin; Garfield; Grant south of approx. 47d30m; Grays Harbor; Kittitas; Klickitat; Lewis; Mason; Pacific; Pierce; Skamania; Thurston; Wahkiakum; Walla","projected 2D","","","East","North","X","Y","9001","","4269","14632","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1102[] = {"32150","NAD83 / West Virginia North","NAD83 / West Virginia N","","","United States (USA) - West Virginia - WV_N - counties of Barbour; Berkeley; Brooke; Doddridge; Grant; Hampshire; Hancock; Hardy; Harrison; Jefferson; Marion; Marshall; Mineral; Monongalia; Morgan; Ohio; Pleasants; Preston; Ritchie; Taylor; Tucker; Tyler; W","projected 2D","","","East","North","X","Y","9001","","4269","14731","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1103[] = {"32151","NAD83 / West Virginia South","NAD83 / West Virginia S","","","United States (USA) - West Virginia - WV_S - counties of Boone; Braxton; Cabell; Calhoun; Clay; Fayette; Gilmer; Greenbrier; Jackson; Kanawha; Lewis; Lincoln; Logan; Mason; McDowell; Mercer; Mingo; Monroe; Nicholas; Pendleton; Pocahontas; Putnam; Raleigh; ","projected 2D","","","East","North","X","Y","9001","","4269","14732","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1104[] = {"32152","NAD83 / Wisconsin North","","","","United States (USA) - Wisconsin - WI_N - counties of Ashland; Bayfield; Burnett; Douglas; Florence; Forest; Iron; Oneida; Price; Sawyer; Vilas; Washburn","projected 2D","","","East","North","X","Y","9001","","4269","14831","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1105[] = {"32153","NAD83 / Wisconsin Central","NAD83 / Wisconsin Cen.","","","United States (USA) - Wisconsin - WI_C - counties of Barron; Brown; Buffalo; Chippewa; Clark; Door; Dunn; Eau Claire; Jackson; Kewaunee; Langlade; Lincoln; Marathon; Marinette; Menominee; Oconto; Outagamie; Pepin; Pierce; Polk; Portage; Rusk; Shawano; St. ","projected 2D","","","East","North","X","Y","9001","","4269","14832","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1106[] = {"32154","NAD83 / Wisconsin South","","","","United States (USA) - Wisconsin - WI_S - counties of Adams; Calumet; Columbia; Crawford; Dane; Dodge; Fond Du Lac; Grant; Green; Green Lake; Iowa; Jefferson; Juneau; Kenosha; La Crosse; Lafayette; Manitowoc; Marquette; Milwaukee; Monroe; Ozaukee; Racine; R","projected 2D","","","East","North","X","Y","9001","","4269","14833","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1107[] = {"32155","NAD83 / Wyoming East","","","","United States (USA) - Wyoming - WY_E - counties of Albany; Campbell; Converse; Crook; Goshen; Laramie; Niobrara; Platte; Weston","projected 2D","","","East","North","X","Y","9001","","4269","14931","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1108[] = {"32156","NAD83 / Wyoming East Central","NAD83 / Wyoming E. Cen.","","","United States (USA) - Wyoming - WY_EC - counties of Big Horn; Carbon; Johnson; Natrona; Sheridan; Washakie","projected 2D","","","East","North","X","Y","9001","","4269","14932","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1109[] = {"32157","NAD83 / Wyoming West Central","NAD83 / Wyoming W. Cen.","","","United States (USA) - Wyoming - WY_WC - counties of Fremont; Hot Springs; Park; Sweetwater","projected 2D","","","East","North","X","Y","9001","","4269","14933","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1110[] = {"32158","NAD83 / Wyoming West","","","","United States (USA) - Wyoming - WY_W - counties of Lincoln; Sublette; Teton; Uinta","projected 2D","","","East","North","X","Y","9001","","4269","14934","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1111[] = {"32161","NAD83 / Puerto Rico & Virgin Is.","","","","Puerto Rico and U.S. Virgin Islands.","projected 2D","","","East","North","X","Y","9001","","4269","15230","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1112[] = {"32180","NAD83 / SCoPQ zone 2","","","","Canada - Quebec - east of 57 deg East.","projected 2D","","","East","North","X","Y","9001","","4269","17700","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1113[] = {"32181","NAD83 / MTM zone 1","","","","Canada - Newfoundland - east of 54 deg 30 min West.","projected 2D","","","East","North","E(X)","N(Y)","9001","","4269","17701","1997-11-13 00:00:00","Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1114[] = {"32182","NAD83 / MTM zone 2","","","","Canada - Newfoundland and Labrador between 57 deg 30 min and 54 de 30 min West.","projected 2D","","","East","North","E(X)","N(Y)","9001","","4269","17702","1997-11-13 00:00:00","Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1115[] = {"32183","NAD83 / MTM zone 3","","","","Canada - Newfoundland and Labrador between 60 deg and 57 deg 30 min West; Canada - Quebec between 60 deg and 57 deg West.","projected 2D","","","East","North","E(X)","N(Y)","9001","","4269","17703","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","Known in Quebec as \"NAD83 / [...]
+datafile_rows_t horiz_cs_row_1116[] = {"32184","NAD83 / MTM zone 4","","","","Canada - Quebec and Newfoundland (Labrador) between 63 deg and 60 deg West.","projected 2D","","","East","North","E(X)","N(Y)","9001","","4269","17704","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","Known in Quebec as \"NAD83 / SCoPQ zone 4\" with axis 1 and 2 abbreviation [...]
+datafile_rows_t horiz_cs_row_1117[] = {"32185","NAD83 / MTM zone 5","","","","Canada - Quebec and Newfoundland (Labrador) between 66 deg and 63 deg West.","projected 2D","","","East","North","E(X)","N(Y)","9001","","4269","17705","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","Known in Quebec as \"NAD83 / SCoPQ zone 5\" with axis 1 and 2 abbreviation [...]
+datafile_rows_t horiz_cs_row_1118[] = {"32186","NAD83 / MTM zone 6","","","","Canada - Quebec and Newfoundland (Labrador) between 69 deg and  66 deg West.","projected 2D","","","East","North","E(X)","N(Y)","9001","","4269","17706","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","Known in Quebec as \"NAD83 / SCoPQ zone 6\" with axis 1 and 2 abbreviatio [...]
+datafile_rows_t horiz_cs_row_1119[] = {"32187","NAD83 / MTM zone 7","","","","Canada - Quebec between 72 deg and 69 deg West.","projected 2D","","","East","North","E(X)","N(Y)","9001","","4269","17707","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources.","EPSG","Known in Quebec as \"NAD83 / SCoPQ zone 7\" with axis 1 and 2 abbreviations of \"X\" and \"Y\" respectively.","",NULL};
+datafile_rows_t horiz_cs_row_1120[] = {"32188","NAD83 / MTM zone 8","","","","Canada - Quebec between 75 deg and 72 deg West.; Canada - Ontario - east of 75 deg West.","projected 2D","","","East","North","E(X)","N(Y)","9001","","4269","17708","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","Known in Quebec as \"NAD83 / SCoPQ zone 8\" with axis 1 and 2 abbreviations of \"X\" and \"Y\" respectively.","",NULL};
+datafile_rows_t horiz_cs_row_1121[] = {"32189","NAD83 / MTM zone 9","","","","Canada - Quebec and Ontario - between 78 deg and 75 deg West.","projected 2D","","","East","North","E(X)","N(Y)","9001","","4269","17709","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","Known in Quebec as \"NAD83 / SCoPQ zone 9\" with axis 1 and 2 abbreviations of \"X\" and \"Y\" respectively.","",NULL};
+datafile_rows_t horiz_cs_row_1122[] = {"32190","NAD83 / MTM zone 10","","","","Canada - Quebec west of 78 deg West; Canada - Ontario - between 79 deg 30 min and 78 deg W in area to north of 47 deg N; between 80 deg 15 min and 78 deg W in area between 46 deg and 47 deg N; between 81 deg and 78 deg W in area south of 46 deg N.","projected 2D","","","East","North","E(X)","N(Y)","9001","","4269","17710","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.", [...]
+datafile_rows_t horiz_cs_row_1123[] = {"32191","NAD83 / MTM zone 11","","","","Canada - Ontario - south of 46 deg N and west of 81 deg West.","projected 2D","","","East","North","E","N","9001","","4269","17711","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1124[] = {"32192","NAD83 / MTM zone 12","","","","Canada - Ontario - between 82 deg 30 min and 79 deg 30 min W in area to north of 47 deg N; between 82 deg 30 min and 80 deg 15 min W in area between 46 deg and 47 deg N; between 82 deg 30 min and 79 deg 30 min W in area north of 47 deg N.","projected 2D","","","East","North","E","N","9001","","4269","17712","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1125[] = {"32193","NAD83 / MTM zone 13","","","","Canada - Ontario - between 85 deg 30 min and 82 deg 30 min West and north of 46 deg North.","projected 2D","","","East","North","E","N","9001","","4269","17713","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1126[] = {"32194","NAD83 / MTM zone 14","","","","Canada - Ontario - between 88 deg 30 min and 85 deg 30 min West.","projected 2D","","","East","North","E","N","9001","","4269","17714","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1127[] = {"32195","NAD83 / MTM zone 15","","","","Canada - Ontario - between 91 deg 30 min and 88 deg 30 min West.","projected 2D","","","East","North","E","N","9001","","4269","17715","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1128[] = {"32196","NAD83 / MTM zone 16","","","","Canada - Ontario - between 94 deg 30 min and 91 deg 30 min West.","projected 2D","","","East","North","E","N","9001","","4269","17716","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1129[] = {"32197","NAD83 / MTM zone 17","","","","Canada - Ontario - west of 94 deg 30 min West.","projected 2D","","","East","North","E","N","9001","","4269","17717","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1130[] = {"32198","NAD83 / Quebec Lambert","","","","Canada - Quebec","projected 2D","","","East","North","X","Y","9001","","4269","19944","1999-10-20 00:00:00","Service de la Cartographie; Minist�re des Ressources Naturelles; Quebec","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1131[] = {"32201","WGS 72 / UTM zone 1N","","","","180deg to 174deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1132[] = {"32202","WGS 72 / UTM zone 2N","","","","174deg West to 168deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16002","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1133[] = {"32203","WGS 72 / UTM zone 3N","","","","168deg West to 162deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16003","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1134[] = {"32204","WGS 72 / UTM zone 4N","","","","162deg West to 156deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1135[] = {"32205","WGS 72 / UTM zone 5N","","","","156deg West to 150deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16005","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1136[] = {"32206","WGS 72 / UTM zone 6N","","","","150deg West to 144deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16006","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1137[] = {"32207","WGS 72 / UTM zone 7N","","","","144deg West to 138deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16007","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1138[] = {"32208","WGS 72 / UTM zone 8N","","","","138deg West to 132deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16008","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1139[] = {"32209","WGS 72 / UTM zone 9N","","","","132deg West to 126deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16009","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1140[] = {"32210","WGS 72 / UTM zone 10N","","","","130deg West to 120deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16010","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1141[] = {"32211","WGS 72 / UTM zone 11N","","","","120deg West to 114deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1142[] = {"32212","WGS 72 / UTM zone 12N","","","","114deg West to 108deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1143[] = {"32213","WGS 72 / UTM zone 13N","","","","108deg West to 102deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16013","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1144[] = {"32214","WGS 72 / UTM zone 14N","","","","102deg West to 96deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16014","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1145[] = {"32215","WGS 72 / UTM zone 15N","","","","96deg West to 90deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16015","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1146[] = {"32216","WGS 72 / UTM zone 16N","","","","90deg West to 84deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16016","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1147[] = {"32217","WGS 72 / UTM zone 17N","","","","84deg West to 78deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16017","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1148[] = {"32218","WGS 72 / UTM zone 18N","","","","78deg West to 72deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16018","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1149[] = {"32219","WGS 72 / UTM zone 19N","","","","72deg West to 66deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16019","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1150[] = {"32220","WGS 72 / UTM zone 20N","","","","66deg West to 60deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16020","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1151[] = {"32221","WGS 72 / UTM zone 21N","","","","60deg West to 54deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16021","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1152[] = {"32222","WGS 72 / UTM zone 22N","","","","54deg West to 48deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1153[] = {"32223","WGS 72 / UTM zone 23N","","","","48deg West to 42deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16023","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1154[] = {"32224","WGS 72 / UTM zone 24N","","","","42deg West to 36deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16024","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1155[] = {"32225","WGS 72 / UTM zone 25N","","","","36deg West to 30deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16025","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1156[] = {"32226","WGS 72 / UTM zone 26N","","","","30deg West to 24deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16026","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1157[] = {"32227","WGS 72 / UTM zone 27N","","","","24deg West to 18deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16027","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1158[] = {"32228","WGS 72 / UTM zone 28N","","","","18deg West to 12deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16028","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1159[] = {"32229","WGS 72 / UTM zone 29N","","","","12deg West to 6deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16029","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1160[] = {"32230","WGS 72 / UTM zone 30N","","","","6deg West to 0deg; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16030","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1161[] = {"32231","WGS 72 / UTM zone 31N","","","","0deg to 6deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1162[] = {"32232","WGS 72 / UTM zone 32N","","","","6deg East to 12deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1163[] = {"32233","WGS 72 / UTM zone 33N","","","","12deg East to 18deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16033","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1164[] = {"32234","WGS 72 / UTM zone 34N","","","","18deg East to 24deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16034","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1165[] = {"32235","WGS 72 / UTM zone 35N","","","","24deg East to 30deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16035","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1166[] = {"32236","WGS 72 / UTM zone 36N","","","","30deg East to 36deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16036","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1167[] = {"32237","WGS 72 / UTM zone 37N","","","","36deg East to 42deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16037","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1168[] = {"32238","WGS 72 / UTM zone 38N","","","","42deg East to 48deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16038","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1169[] = {"32239","WGS 72 / UTM zone 39N","","","","48deg East to 54deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16039","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1170[] = {"32240","WGS 72 / UTM zone 40N","","","","54deg East to 60deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16040","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1171[] = {"32241","WGS 72 / UTM zone 41N","","","","60deg East to 66deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16041","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1172[] = {"32242","WGS 72 / UTM zone 42N","","","","66deg East to 72deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16042","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1173[] = {"32243","WGS 72 / UTM zone 43N","","","","72deg East to 78deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16043","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1174[] = {"32244","WGS 72 / UTM zone 44N","","","","78deg East to 84deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16044","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1175[] = {"32245","WGS 72 / UTM zone 45N","","","","84deg East to 90deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16045","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1176[] = {"32246","WGS 72 / UTM zone 46N","","","","90deg East to 96deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16046","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1177[] = {"32247","WGS 72 / UTM zone 47N","","","","96deg East to 102eg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16047","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1178[] = {"32248","WGS 72 / UTM zone 48N","","","","102deg East to 108deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16048","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1179[] = {"32249","WGS 72 / UTM zone 49N","","","","108deg East to 114deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16049","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1180[] = {"32250","WGS 72 / UTM zone 50N","","","","114deg East to 120deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16050","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1181[] = {"32251","WGS 72 / UTM zone 51N","","","","120deg East to 126deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16051","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1182[] = {"32252","WGS 72 / UTM zone 52N","","","","126deg East to 132deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16052","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1183[] = {"32253","WGS 72 / UTM zone 53N","","","","132deg East to 138deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16053","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1184[] = {"32254","WGS 72 / UTM zone 54N","","","","138deg East to 144deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16054","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1185[] = {"32255","WGS 72 / UTM zone 55N","","","","144deg East to 150deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16055","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1186[] = {"32256","WGS 72 / UTM zone 56N","","","","150deg East to 156deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16056","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1187[] = {"32257","WGS 72 / UTM zone 57N","","","","156deg East to 162deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16057","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1188[] = {"32258","WGS 72 / UTM zone 58N","","","","162deg East to 168deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16058","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1189[] = {"32259","WGS 72 / UTM zone 59N","","","","168deg East to 174deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16059","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1190[] = {"32260","WGS 72 / UTM zone 60N","","","","174deg East to 180deg; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16060","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1191[] = {"32301","WGS 72 / UTM zone 1S","","","","180deg to 174deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16101","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1192[] = {"32302","WGS 72 / UTM zone 2S","","","","174deg West to 168deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16102","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1193[] = {"32303","WGS 72 / UTM zone 3S","","","","168deg West to 162deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16103","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1194[] = {"32304","WGS 72 / UTM zone 4S","","","","162deg West to 156deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16104","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1195[] = {"32305","WGS 72 / UTM zone 5S","","","","156deg West to 150deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16105","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1196[] = {"32306","WGS 72 / UTM zone 6S","","","","150deg West to 144deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16106","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1197[] = {"32307","WGS 72 / UTM zone 7S","","","","144deg West to 138deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16107","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1198[] = {"32308","WGS 72 / UTM zone 8S","","","","138deg West to 132deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16108","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1199[] = {"32309","WGS 72 / UTM zone 9S","","","","132deg West to 126deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16109","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1200[] = {"32310","WGS 72 / UTM zone 10S","","","","130deg West to 120deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16110","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1201[] = {"32311","WGS 72 / UTM zone 11S","","","","120deg West to 114deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16111","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1202[] = {"32312","WGS 72 / UTM zone 12S","","","","114deg West to 108deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16112","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1203[] = {"32313","WGS 72 / UTM zone 13S","","","","108deg West to 102deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16113","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1204[] = {"32314","WGS 72 / UTM zone 14S","","","","102deg West to 96deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16114","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1205[] = {"32315","WGS 72 / UTM zone 15S","","","","96deg West to 90deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16115","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1206[] = {"32316","WGS 72 / UTM zone 16S","","","","90deg West to 84deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16116","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1207[] = {"32317","WGS 72 / UTM zone 17S","","","","84deg West to 78deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16117","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1208[] = {"32318","WGS 72 / UTM zone 18S","","","","78deg West to 72deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16118","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1209[] = {"32319","WGS 72 / UTM zone 19S","","","","72deg West to 66deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16119","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1210[] = {"32320","WGS 72 / UTM zone 20S","","","","66deg West to 60deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16120","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1211[] = {"32321","WGS 72 / UTM zone 21S","","","","60deg West to 54deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16121","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1212[] = {"32322","WGS 72 / UTM zone 22S","","","","54deg West to 48deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16122","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1213[] = {"32323","WGS 72 / UTM zone 23S","","","","48deg West to 42deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16123","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1214[] = {"32324","WGS 72 / UTM zone 24S","","","","42deg West to 36deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16124","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1215[] = {"32325","WGS 72 / UTM zone 25S","","","","36deg West to 30deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16125","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1216[] = {"32326","WGS 72 / UTM zone 26S","","","","30deg West to 24deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16126","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1217[] = {"32327","WGS 72 / UTM zone 27S","","","","24deg West to 18deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16127","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1218[] = {"32328","WGS 72 / UTM zone 28S","","","","18deg West to 12deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16128","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1219[] = {"32329","WGS 72 / UTM zone 29S","","","","12deg West to 6deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16129","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1220[] = {"32330","WGS 72 / UTM zone 30S","","","","6deg West to 0deg; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16130","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1221[] = {"32331","WGS 72 / UTM zone 31S","","","","0deg to 6deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16131","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1222[] = {"32332","WGS 72 / UTM zone 32S","","","","6deg East to 12deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1223[] = {"32333","WGS 72 / UTM zone 33S","","","","12deg East to 18deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16133","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1224[] = {"32334","WGS 72 / UTM zone 34S","","","","18deg East to 24deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16134","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1225[] = {"32335","WGS 72 / UTM zone 35S","","","","24deg East to 30deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16135","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1226[] = {"32336","WGS 72 / UTM zone 36S","","","","30deg East to 36deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16136","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1227[] = {"32337","WGS 72 / UTM zone 37S","","","","36deg East to 42deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16137","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1228[] = {"32338","WGS 72 / UTM zone 38S","","","","42deg East to 48deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16138","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1229[] = {"32339","WGS 72 / UTM zone 39S","","","","48deg East to 54deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16139","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1230[] = {"32340","WGS 72 / UTM zone 40S","","","","54deg East to 60deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16140","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1231[] = {"32341","WGS 72 / UTM zone 41S","","","","60deg East to 66deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16141","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1232[] = {"32342","WGS 72 / UTM zone 42S","","","","66deg East to 72deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16142","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1233[] = {"32343","WGS 72 / UTM zone 43S","","","","72deg East to 78deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16143","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1234[] = {"32344","WGS 72 / UTM zone 44S","","","","78deg East to 84deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16144","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1235[] = {"32345","WGS 72 / UTM zone 45S","","","","84deg East to 90deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16145","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1236[] = {"32346","WGS 72 / UTM zone 46S","","","","90deg East to 96deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16146","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1237[] = {"32347","WGS 72 / UTM zone 47S","","","","96deg East to 102eg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16147","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1238[] = {"32348","WGS 72 / UTM zone 48S","","","","102deg East to 108deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16148","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1239[] = {"32349","WGS 72 / UTM zone 49S","","","","108deg East to 114deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16149","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1240[] = {"32350","WGS 72 / UTM zone 50S","","","","114deg East to 120deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16150","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1241[] = {"32351","WGS 72 / UTM zone 51S","","","","120deg East to 126deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16151","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1242[] = {"32352","WGS 72 / UTM zone 52S","","","","126deg East to 132deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16152","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1243[] = {"32353","WGS 72 / UTM zone 53S","","","","132deg East to 138deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16153","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1244[] = {"32354","WGS 72 / UTM zone 54S","","","","138deg East to 144deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16154","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1245[] = {"32355","WGS 72 / UTM zone 55S","","","","144deg East to 150deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16155","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1246[] = {"32356","WGS 72 / UTM zone 56S","","","","150deg East to 156deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16156","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1247[] = {"32357","WGS 72 / UTM zone 57S","","","","156deg East to 162deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16157","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1248[] = {"32358","WGS 72 / UTM zone 58S","","","","162deg East to 168deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16158","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1249[] = {"32359","WGS 72 / UTM zone 59S","","","","168deg East to 174deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16159","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1250[] = {"32360","WGS 72 / UTM zone 60S","","","","174deg East to 180deg; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4322","16160","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1251[] = {"32401","WGS 72BE / UTM zone 1N","","","","180deg to 174deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1252[] = {"32402","WGS 72BE / UTM zone 2N","","","","174deg West to 168deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16002","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1253[] = {"32403","WGS 72BE / UTM zone 3N","","","","168deg West to 162deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16003","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1254[] = {"32404","WGS 72BE / UTM zone 4N","","","","162deg West to 156deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1255[] = {"32405","WGS 72BE / UTM zone 5N","","","","156deg West to 150deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16005","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1256[] = {"32406","WGS 72BE / UTM zone 6N","","","","150deg West to 144deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16006","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1257[] = {"32407","WGS 72BE / UTM zone 7N","","","","144deg West to 138deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16007","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1258[] = {"32408","WGS 72BE / UTM zone 8N","","","","138deg West to 132deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16008","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1259[] = {"32409","WGS 72BE / UTM zone 9N","","","","132deg West to 126deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16009","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1260[] = {"32410","WGS 72BE / UTM zone 10N","","","","130deg West to 120deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16010","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1261[] = {"32411","WGS 72BE / UTM zone 11N","","","","120deg West to 114deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1262[] = {"32412","WGS 72BE / UTM zone 12N","","","","114deg West to 108deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1263[] = {"32413","WGS 72BE / UTM zone 13N","","","","108deg West to 102deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16013","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1264[] = {"32414","WGS 72BE / UTM zone 14N","","","","102deg West to 96deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16014","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1265[] = {"32415","WGS 72BE / UTM zone 15N","","","","96deg West to 90deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16015","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1266[] = {"32416","WGS 72BE / UTM zone 16N","","","","90deg West to 84deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16016","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1267[] = {"32417","WGS 72BE / UTM zone 17N","","","","84deg West to 78deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16017","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1268[] = {"32418","WGS 72BE / UTM zone 18N","","","","78deg West to 72deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16018","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1269[] = {"32419","WGS 72BE / UTM zone 19N","","","","72deg West to 66deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16019","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1270[] = {"32420","WGS 72BE / UTM zone 20N","","","","66deg West to 60deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16020","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1271[] = {"32421","WGS 72BE / UTM zone 21N","","","","60deg West to 54deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16021","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1272[] = {"32422","WGS 72BE / UTM zone 22N","","","","54deg West to 48deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1273[] = {"32423","WGS 72BE / UTM zone 23N","","","","48deg West to 42deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16023","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1274[] = {"32424","WGS 72BE / UTM zone 24N","","","","42deg West to 36deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16024","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1275[] = {"32425","WGS 72BE / UTM zone 25N","","","","36deg West to 30deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16025","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1276[] = {"32426","WGS 72BE / UTM zone 26N","","","","30deg West to 24deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16026","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1277[] = {"32427","WGS 72BE / UTM zone 27N","","","","24deg West to 18deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16027","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1278[] = {"32428","WGS 72BE / UTM zone 28N","","","","18deg West to 12deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16028","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1279[] = {"32429","WGS 72BE / UTM zone 29N","","","","12deg West to 6deg West; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16029","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1280[] = {"32430","WGS 72BE / UTM zone 30N","","","","6deg West to 0deg; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16030","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1281[] = {"32431","WGS 72BE / UTM zone 31N","","","","0deg to 6deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1282[] = {"32432","WGS 72BE / UTM zone 32N","","","","6deg East to 12deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1283[] = {"32433","WGS 72BE / UTM zone 33N","","","","12deg East to 18deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16033","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1284[] = {"32434","WGS 72BE / UTM zone 34N","","","","18deg East to 24deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16034","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1285[] = {"32435","WGS 72BE / UTM zone 35N","","","","24deg East to 30deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16035","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1286[] = {"32436","WGS 72BE / UTM zone 36N","","","","30deg East to 36deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16036","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1287[] = {"32437","WGS 72BE / UTM zone 37N","","","","36deg East to 42deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16037","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1288[] = {"32438","WGS 72BE / UTM zone 38N","","","","42deg East to 48deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16038","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1289[] = {"32439","WGS 72BE / UTM zone 39N","","","","48deg East to 54deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16039","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1290[] = {"32440","WGS 72BE / UTM zone 40N","","","","54deg East to 60deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16040","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1291[] = {"32441","WGS 72BE / UTM zone 41N","","","","60deg East to 66deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16041","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1292[] = {"32442","WGS 72BE / UTM zone 42N","","","","66deg East to 72deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16042","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1293[] = {"32443","WGS 72BE / UTM zone 43N","","","","72deg East to 78deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16043","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1294[] = {"32444","WGS 72BE / UTM zone 44N","","","","78deg East to 84deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16044","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1295[] = {"32445","WGS 72BE / UTM zone 45N","","","","84deg East to 90deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16045","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1296[] = {"32446","WGS 72BE / UTM zone 46N","","","","90deg East to 96deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16046","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1297[] = {"32447","WGS 72BE / UTM zone 47N","","","","96deg East to 102eg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16047","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1298[] = {"32448","WGS 72BE / UTM zone 48N","","","","102deg East to 108deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16048","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1299[] = {"32449","WGS 72BE / UTM zone 49N","","","","108deg East to 114deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16049","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1300[] = {"32450","WGS 72BE / UTM zone 50N","","","","114deg East to 120deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16050","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1301[] = {"32451","WGS 72BE / UTM zone 51N","","","","120deg East to 126deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16051","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1302[] = {"32452","WGS 72BE / UTM zone 52N","","","","126deg East to 132deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16052","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1303[] = {"32453","WGS 72BE / UTM zone 53N","","","","132deg East to 138deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16053","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1304[] = {"32454","WGS 72BE / UTM zone 54N","","","","138deg East to 144deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16054","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1305[] = {"32455","WGS 72BE / UTM zone 55N","","","","144deg East to 150deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16055","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1306[] = {"32456","WGS 72BE / UTM zone 56N","","","","150deg East to 156deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16056","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1307[] = {"32457","WGS 72BE / UTM zone 57N","","","","156deg East to 162deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16057","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1308[] = {"32458","WGS 72BE / UTM zone 58N","","","","162deg East to 168deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16058","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1309[] = {"32459","WGS 72BE / UTM zone 59N","","","","168deg East to 174deg East; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16059","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1310[] = {"32460","WGS 72BE / UTM zone 60N","","","","174deg East to 180deg; northern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16060","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1311[] = {"32501","WGS 72BE / UTM zone 1S","","","","180deg to 174deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16101","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1312[] = {"32502","WGS 72BE / UTM zone 2S","","","","174deg West to 168deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16102","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1313[] = {"32503","WGS 72BE / UTM zone 3S","","","","168deg West to 162deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16103","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1314[] = {"32504","WGS 72BE / UTM zone 4S","","","","162deg West to 156deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16104","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1315[] = {"32505","WGS 72BE / UTM zone 5S","","","","156deg West to 150deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16105","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1316[] = {"32506","WGS 72BE / UTM zone 6S","","","","150deg West to 144deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16106","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1317[] = {"32507","WGS 72BE / UTM zone 7S","","","","144deg West to 138deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16107","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1318[] = {"32508","WGS 72BE / UTM zone 8S","","","","138deg West to 132deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16108","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1319[] = {"32509","WGS 72BE / UTM zone 9S","","","","132deg West to 126deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16109","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1320[] = {"32510","WGS 72BE / UTM zone 10S","","","","130deg West to 120deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16110","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1321[] = {"32511","WGS 72BE / UTM zone 11S","","","","120deg West to 114deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16111","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1322[] = {"32512","WGS 72BE / UTM zone 12S","","","","114deg West to 108deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16112","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1323[] = {"32513","WGS 72BE / UTM zone 13S","","","","108deg West to 102deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16113","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1324[] = {"32514","WGS 72BE / UTM zone 14S","","","","102deg West to 96deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16114","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1325[] = {"32515","WGS 72BE / UTM zone 15S","","","","96deg West to 90deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16115","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1326[] = {"32516","WGS 72BE / UTM zone 16S","","","","90deg West to 84deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16116","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1327[] = {"32517","WGS 72BE / UTM zone 17S","","","","84deg West to 78deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16117","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1328[] = {"32518","WGS 72BE / UTM zone 18S","","","","78deg West to 72deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16118","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1329[] = {"32519","WGS 72BE / UTM zone 19S","","","","72deg West to 66deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16119","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1330[] = {"32520","WGS 72BE / UTM zone 20S","","","","66deg West to 60deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16120","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1331[] = {"32521","WGS 72BE / UTM zone 21S","","","","60deg West to 54deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16121","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1332[] = {"32522","WGS 72BE / UTM zone 22S","","","","54deg West to 48deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16122","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1333[] = {"32523","WGS 72BE / UTM zone 23S","","","","48deg West to 42deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16123","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1334[] = {"32524","WGS 72BE / UTM zone 24S","","","","42deg West to 36deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16124","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1335[] = {"32525","WGS 72BE / UTM zone 25S","","","","36deg West to 30deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16125","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1336[] = {"32526","WGS 72BE / UTM zone 26S","","","","30deg West to 24deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16126","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1337[] = {"32527","WGS 72BE / UTM zone 27S","","","","24deg West to 18deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16127","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1338[] = {"32528","WGS 72BE / UTM zone 28S","","","","18deg West to 12deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16128","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1339[] = {"32529","WGS 72BE / UTM zone 29S","","","","12deg West to 6deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16129","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1340[] = {"32530","WGS 72BE / UTM zone 30S","","","","6deg West to 0deg; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16130","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1341[] = {"32531","WGS 72BE / UTM zone 31S","","","","0deg to 6deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16131","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1342[] = {"32532","WGS 72BE / UTM zone 32S","","","","6deg East to 12deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1343[] = {"32533","WGS 72BE / UTM zone 33S","","","","12deg East to 18deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16133","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1344[] = {"32534","WGS 72BE / UTM zone 34S","","","","18deg East to 24deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16134","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1345[] = {"32535","WGS 72BE / UTM zone 35S","","","","24deg East to 30deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16135","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1346[] = {"32536","WGS 72BE / UTM zone 36S","","","","30deg East to 36deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16136","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1347[] = {"32537","WGS 72BE / UTM zone 37S","","","","36deg East to 42deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16137","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1348[] = {"32538","WGS 72BE / UTM zone 38S","","","","42deg East to 48deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16138","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1349[] = {"32539","WGS 72BE / UTM zone 39S","","","","48deg East to 54deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16139","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1350[] = {"32540","WGS 72BE / UTM zone 40S","","","","54deg East to 60deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16140","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1351[] = {"32541","WGS 72BE / UTM zone 41S","","","","60deg East to 66deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16141","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1352[] = {"32542","WGS 72BE / UTM zone 42S","","","","66deg East to 72deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16142","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1353[] = {"32543","WGS 72BE / UTM zone 43S","","","","72deg East to 78deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16143","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1354[] = {"32544","WGS 72BE / UTM zone 44S","","","","78deg East to 84deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16144","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1355[] = {"32545","WGS 72BE / UTM zone 45S","","","","84deg East to 90deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16145","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1356[] = {"32546","WGS 72BE / UTM zone 46S","","","","90deg East to 96deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16146","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1357[] = {"32547","WGS 72BE / UTM zone 47S","","","","96deg East to 102eg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16147","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1358[] = {"32548","WGS 72BE / UTM zone 48S","","","","102deg East to 108deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16148","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1359[] = {"32549","WGS 72BE / UTM zone 49S","","","","108deg East to 114deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16149","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1360[] = {"32550","WGS 72BE / UTM zone 50S","","","","114deg East to 120deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16150","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1361[] = {"32551","WGS 72BE / UTM zone 51S","","","","120deg East to 126deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16151","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1362[] = {"32552","WGS 72BE / UTM zone 52S","","","","126deg East to 132deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16152","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1363[] = {"32553","WGS 72BE / UTM zone 53S","","","","132deg East to 138deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16153","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1364[] = {"32554","WGS 72BE / UTM zone 54S","","","","138deg East to 144deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16154","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1365[] = {"32555","WGS 72BE / UTM zone 55S","","","","144deg East to 150deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16155","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1366[] = {"32556","WGS 72BE / UTM zone 56S","","","","150deg East to 156deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16156","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1367[] = {"32557","WGS 72BE / UTM zone 57S","","","","156deg East to 162deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16157","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1368[] = {"32558","WGS 72BE / UTM zone 58S","","","","162deg East to 168deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16158","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1369[] = {"32559","WGS 72BE / UTM zone 59S","","","","168deg East to 174deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16159","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1370[] = {"32560","WGS 72BE / UTM zone 60S","","","","174deg East to 180deg; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4324","16160","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1371[] = {"32601","WGS 84 / UTM zone 1N","","","","180deg to 174deg West; northern hemisphere; Russia.","projected 2D","","","East","North","E","N","9001","","4326","16001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1372[] = {"32602","WGS 84 / UTM zone 2N","","","","174deg West to 168deg West; northern hemisphere. Russia; United States (USA) - Alaska (AK).","projected 2D","","","East","North","E","N","9001","","4326","16002","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1373[] = {"32603","WGS 84 / UTM zone 3N","","","","168deg West to 162deg West; northern hemisphere. United States (USA) - Alaska (AK).","projected 2D","","","East","North","E","N","9001","","4326","16003","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1374[] = {"32604","WGS 84 / UTM zone 4N","","","","162deg West to 156deg West; northern hemisphere. United States (USA) - Alaska (AK).","projected 2D","","","East","North","E","N","9001","","4326","16004","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1375[] = {"32605","WGS 84 / UTM zone 5N","","","","156deg West to 150deg West; northern hemisphere. United States (USA) - Alaska (AK).","projected 2D","","","East","North","E","N","9001","","4326","16005","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1376[] = {"32606","WGS 84 / UTM zone 6N","","","","150deg West to 144deg West; northern hemisphere. United States (USA) - Alaska (AK).","projected 2D","","","East","North","E","N","9001","","4326","16006","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1377[] = {"32607","WGS 84 / UTM zone 7N","","","","144deg West to 138deg West; northern hemisphere. Canada - British Columbia (BC); Yukon. United States (USA) - Alaska (AK).","projected 2D","","","East","North","E","N","9001","","4326","16007","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1378[] = {"32608","WGS 84 / UTM zone 8N","","","","138deg West to 132deg West; northern hemisphere. Canada - British Columbia (BC); North West Territiories; Yukon. United States (USA) - Alaska (AK).","projected 2D","","","East","North","E","N","9001","","4326","16008","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1379[] = {"32609","WGS 84 / UTM zone 9N","","","","132deg West to 126deg West; northern hemisphere. Canada - British Columbia (BC); North West Territories; Yukon. United States (USA) - Alaska (AK).","projected 2D","","","East","North","E","N","9001","","4326","16009","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1380[] = {"32610","WGS 84 / UTM zone 10N","","","","130deg West to 120deg West; northern hemisphere. Canada - British Columbia (BC); North West Territories; Nunavut; Yukon. United States (USA) - Alaska (AK).","projected 2D","","","East","North","E","N","9001","","4326","16010","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1381[] = {"32611","WGS 84 / UTM zone 11N","","","","120deg West to 114deg West; northern hemisphere. Canada - Alberta; British Columbia (BC); North West Territories; Nunavut. Mexico. United States (USA).","projected 2D","","","East","North","E","N","9001","","4326","16011","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1382[] = {"32612","WGS 84 / UTM zone 12N","","","","114deg West to 108deg West; northern hemisphere. Canada - Alberta; North West Territories; Nunavut; Saskatchewan.  Mexico.  United States (USA).","projected 2D","","","East","North","E","N","9001","","4326","16012","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1383[] = {"32613","WGS 84 / UTM zone 13N","","","","108deg West to 102deg West; northern hemisphere. Canada - North West Territories; Nunavut; Saskatchewan.  Mexico.  United States (USA).","projected 2D","","","East","North","E","N","9001","","4326","16013","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1384[] = {"32614","WGS 84 / UTM zone 14N","","","","102deg West to 96deg West; northern hemisphere. Canada - Manitoba; Nunavut; Saskatchewan.  Mexico.  United States (USA).","projected 2D","","","East","North","E","N","9001","","4326","16014","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1385[] = {"32615","WGS 84 / UTM zone 15N","","","","96deg West to 90deg West; northern hemisphere. Canada - Manitoba; Nunavut; Ontario.  Guatemala.  Mexico.  United States (USA) - Gulf of Mexico (GoM).","projected 2D","","","East","North","E","N","9001","","4326","16015","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1386[] = {"32616","WGS 84 / UTM zone 16N","","","","90deg West to 84deg West; northern hemisphere. Belize. Canada - Manitoba; Nunavut; Ontario.  Costa Rica. Cuba. El Salvador. Guatemala. Honduras. Mexico. Nicaragua. Puerto Rico. United States (USA).","projected 2D","","","East","North","E","N","9001","","4326","16016","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1387[] = {"32617","WGS 84 / UTM zone 17N","","","","84deg West to 78deg West; northern hemisphere. Bahamas. Ecuador - north of equator. Canada - Nunavut; Ontario; Quebec.  Cayman Islands.  Colombia. Costa Rica. Jamaica. Nicaragua. Panama. Puerto Rico. United States (USA).","projected 2D","","","East","North","E","N","9001","","4326","16017","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1388[] = {"32618","WGS 84 / UTM zone 18N","","","","78deg West to 72deg West; northern hemisphere. Bahamas. Canada - Nunavut; Ontario; Quebec. Colombia. Cuba. Ecuador. Greenland. Haiti. Jamica. Panama. Turks and Caicos Islands. United States (USA). Venezuela.","projected 2D","","","East","North","E","N","9001","","4326","16018","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1389[] = {"32619","WGS 84 / UTM zone 19N","","","","72deg West to 66deg West; northern hemisphere. Aruba. Bahamas. Brazil. Canada - New Brunswick (NB); Newfoundland; Nunavut; Nova Scotia (NS); Quebec. Colombia. Dominican Republic. Greenland. Netherlands Antilles. Puerto Rico. Turks and Caicos Islands. Unite","projected 2D","","","East","North","E","N","9001","","4326","16019","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1390[] = {"32620","WGS 84 / UTM zone 20N","","","","66deg West to 60deg West; northern hemisphere. Anguilla. Antigua & Barbuda. Bermuda. Brazil. Canada - New Brunswick (NB); Newfoundland; North west Territories; Nova Scotia (NS); Prince Edward Island; Quebec. Dominica. Greenland. Grenada. Guadeloupe. Guyana","projected 2D","","","East","North","E","N","9001","","4326","16020","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1391[] = {"32621","WGS 84 / UTM zone 21N","","","","60deg West to 54deg West; northern hemisphere. Barbados. Brazil. Canada - Newfoundland; Quebec. French Guiana. Greenland. Guyana. St. Pierre and Miquelon. Suriname.","projected 2D","","","East","North","E","N","9001","","4326","16021","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1392[] = {"32622","WGS 84 / UTM zone 22N","","","","54deg West to 48deg West; northern hemisphere. Brazil. Canada - Newfoundland. French Guiana. Greenland.","projected 2D","","","East","North","E","N","9001","","4326","16022","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1393[] = {"32623","WGS 84 / UTM zone 23N","","","","48deg West to 42deg West; northern hemisphere. Greenland.","projected 2D","","","East","North","E","N","9001","","4326","16023","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1394[] = {"32624","WGS 84 / UTM zone 24N","","","","42deg West to 36deg West; northern hemisphere. Greenland.","projected 2D","","","East","North","E","N","9001","","4326","16024","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1395[] = {"32625","WGS 84 / UTM zone 25N","","","","36deg West to 30deg West; northern hemisphere. Greenland.","projected 2D","","","East","North","E","N","9001","","4326","16025","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1396[] = {"32626","WGS 84 / UTM zone 26N","","","","30deg West to 24deg West; northern hemisphere. Greenland. Iceland.","projected 2D","","","East","North","E","N","9001","","4326","16026","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1397[] = {"32627","WGS 84 / UTM zone 27N","","","","24deg West to 18deg West; northern hemisphere. Greenland. Iceland.","projected 2D","","","East","North","E","N","9001","","4326","16027","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1398[] = {"32628","WGS 84 / UTM zone 28N","","","","18deg West to 12deg West; northern hemisphere. Gambia. Greenland. Guinea. Guinea-Bissau. Iceland. Ireland - offshore Porcupine Basin. Mauritania. Morocco. Senegal. Sierra Leone. Western Sahara.","projected 2D","","","East","North","E","N","9001","","4326","16028","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1399[] = {"32629","WGS 84 / UTM zone 29N","","","","12deg West to 6deg West; northern hemisphere. Algeria. Cote D'Ivoire (Ivory Coast). Faroe Islands. Guinea. Ireland. Mali. Mauritania. Morocco. Portugal. Sierra Leone. Spain. United Kingdom (UK). Western Sahara.","projected 2D","","","East","North","E","N","9001","","4326","16029","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1400[] = {"32630","WGS 84 / UTM zone 30N","","","","6deg West to 0deg; northern hemisphere. Algeria. Burkino Faso. Cote' Ivoire (Ivory Coast). Faroe Islands - offshore. France. Ghana. Gibraltar. Ireland - offshore Irish Sea. Mali. Mauritania. Morocco. Spain. United Kingdom (UK).","projected 2D","","","East","North","E","N","9001","","4326","16030","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1401[] = {"32631","WGS 84 / UTM zone 31N","","","","0deg to 6deg East; northern hemisphere. Algeria. Andorra. Benin. Bukino Faso. Denmark - North Sea. France. Germany - North Sea. Ghana. Luxembourg. Mali. Netherlands. Niger. Nigeria. Norway. Spain. Togo. United Kingdom (UK) - North Sea.","projected 2D","","","East","North","E","N","9001","","4326","16031","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1402[] = {"32632","WGS 84 / UTM zone 32N","","","","6deg East to 12deg East; northern hemisphere. Algeria. Austria. Cameroon. Denmark. Equatorial Guinea. France. Gabon. Germany. Italy. Libya. Liechtenstein. Monaco. Netherlands. Niger. Nigeria. Norway. Sao Tome and Principe. Svalbard and Jan Mayen Islands. S","projected 2D","","","East","North","E","N","9001","","4326","16032","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1403[] = {"32633","WGS 84 / UTM zone 33N","","","","12deg East to 18deg East; northern hemisphere. Austria. Bosnia and Herzegowina. Cmeroon. Central African Republic. Chad. Congo. Croatia. Czech Republic. Democratic Republic of the Congo (Zaire). Gabon. Germany. Hungary. Italy. Libya. Malta. Niger. Nigeria.","projected 2D","","","East","North","E","N","9001","","4326","16033","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1404[] = {"32634","WGS 84 / UTM zone 34N","","","","18deg East to 24deg East; northern hemisphere. Albania. Belarus. Bosnia and Herzegowina. Bulgaria. Central African Republic. Chad. Croatia. Democratic Republic of the Congo (Zaire). Estonia. Finland. FYR Macedonia. Greece. Hungary. Italy. Latvia. Libya. Li","projected 2D","","","East","North","E","N","9001","","4326","16034","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1405[] = {"32635","WGS 84 / UTM zone 35N","","","","24deg East to 30deg East; northern hemisphere. Belarus. Bulgaria. Central African Republic. Democratic Republic of the Congo (Zaire). Egypt. Estonia. Finland. Greece. Latvia. Lesotho. Libya. Lithuania. Moldova. Norway. Romania. Russia. Sudan. Svalbard. Tur","projected 2D","","","East","North","E","N","9001","","4326","16035","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1406[] = {"32636","WGS 84 / UTM zone 36N","","","","30deg East to 36deg East; northern hemisphere. Belarus. Cyprus. Egypt. Ethiopia. Finland. Israel. Jordan. Kenya. Lebanon. Norway. Russia. Saudi Arabia. Sudan. Syria. Turkey. Uganda. Ukraine.","projected 2D","","","East","North","E","N","9001","","4326","16036","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1407[] = {"32637","WGS 84 / UTM zone 37N","","","","36deg East to 42deg East; northern hemisphere. Djibouti. Egypt. Eritrea. Ethiopia. Georgia. Iraq. Jordan. Kenya. Lebanon. Russia. Saudi Arabia. Somalia. Sudan. Syria. Turkey. Ukraine.","projected 2D","","","East","North","E","N","9001","","4326","16037","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1408[] = {"32638","WGS 84 / UTM zone 38N","","","","42deg East to 48deg East; northern hemisphere. Armenia. Azerbaijan. Djibouti. Eritrea. Ethiopia. Georgia. Iran. Iraq. Kazakhstan. Kuwait. Russia. Saudi Arabia. Somalia. Turkey. Yemen.","projected 2D","","","East","North","E","N","9001","","4326","16038","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1409[] = {"32639","WGS 84 / UTM zone 39N","","","","48deg East to 54deg East; northern hemisphere. Azerbaijan. Bahrain. Iran. Kazakhstan. Kuwait. Oman. Qatar. Russia. Saudi Arabia. Somalia. Turkmenistan. United Arab Emirates. Yemen.","projected 2D","","","East","North","E","N","9001","","4326","16039","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1410[] = {"32640","WGS 84 / UTM zone 40N","","","","54deg East to 60deg East; northern hemisphere. Iran. Kazakhstan. Oman. Russia. Saudi Arabia. Turkmenistan. United Arab Emirates. Uzbekistan.","projected 2D","","","East","North","E","N","9001","","4326","16040","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1411[] = {"32641","WGS 84 / UTM zone 41N","","","","60deg East to 66deg East; northern hemisphere. Afghanistan. Iran. Kazakhstan. Pakistan. Russia. Turkmenistan.  Uzbekistan.","projected 2D","","","East","North","E","N","9001","","4326","16041","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1412[] = {"32642","WGS 84 / UTM zone 42N","","","","66deg East to 72deg East; northern hemisphere. Afghanistan. India. Kazakhstan. Kyrgyzstan. Pakistan. Russia. Tajikistan. Uzbekistan.","projected 2D","","","East","North","E","N","9001","","4326","16042","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1413[] = {"32643","WGS 84 / UTM zone 43N","","","","72deg East to 78deg East; northern hemisphere. China. India. Kazakhstan. Kyrgyzstan. Maldives. Pakistan. Russia. Tajikistan.","projected 2D","","","East","North","E","N","9001","","4326","16043","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1414[] = {"32644","WGS 84 / UTM zone 44N","","","","78deg East to 84deg East; northern hemisphere. China. India. Kazakhstan. Kyrgyzstan. Nepal. Russia. Sri Lanka.","projected 2D","","","East","North","E","N","9001","","4326","16044","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1415[] = {"32645","WGS 84 / UTM zone 45N","","","","84deg East to 90deg East; northern hemisphere. Bangladesh. Bhutan. China. India. Kazakhstan. Mongolia. Nepal. Russia.","projected 2D","","","East","North","E","N","9001","","4326","16045","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1416[] = {"32646","WGS 84 / UTM zone 46N","","","","90deg East to 96deg East; northern hemisphere. Bangladesh. Bhutan. China. Indonesia. Mongolia. Myanmar (Burma). Russia.","projected 2D","","","East","North","E","N","9001","","4326","16046","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1417[] = {"32647","WGS 84 / UTM zone 47N","","","","96deg East to 102eg East; northern hemisphere. China. Indonesia. Laos. Malaysia - West Malaysia. Mongolia. Myanmar (Burma). Russia. Thailand.","projected 2D","","","East","North","E","N","9001","","4326","16047","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1418[] = {"32648","WGS 84 / UTM zone 48N","","","","102deg East to 108deg East; northern hemisphere. Cambodia. China. Indonesia. Laos. Malaysia - West Malaysia. Mongolia. Russia. Singapore. Thailand. Vietnam.","projected 2D","","","East","North","E","N","9001","","4326","16048","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1419[] = {"32649","WGS 84 / UTM zone 49N","","","","108deg East to 114deg East; northern hemisphere. China. Hong Kong. Indonesia. Macau. Malaysia - East Malaysia - Sarawak. Mongolia. Russia. Vietnam.","projected 2D","","","East","North","E","N","9001","","4326","16049","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1420[] = {"32650","WGS 84 / UTM zone 50N","","","","114deg East to 120deg East; northern hemisphere. Brunei. China. Indonesia. Malaysia - East Malaysia - Sarawak. Mongolia. Philippines. Russia. Taiwan.","projected 2D","","","East","North","E","N","9001","","4326","16050","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1421[] = {"32651","WGS 84 / UTM zone 51N","","","","120deg East to 126deg East; northern hemisphere. China. Indonesia. Japan. North Korea. Philippines. Russia.  South Korea. Taiwan.","projected 2D","","","East","North","E","N","9001","","4326","16051","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1422[] = {"32652","WGS 84 / UTM zone 52N","","","","126deg East to 132deg East; northern hemisphere. China. Indonesia. Japan. North Korea. Russia. South Korea.","projected 2D","","","East","North","E","N","9001","","4326","16052","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1423[] = {"32653","WGS 84 / UTM zone 53N","","","","132deg East to 138deg East; northern hemisphere. China. Japan. Russia.","projected 2D","","","East","North","E","N","9001","","4326","16053","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1424[] = {"32654","WGS 84 / UTM zone 54N","","","","138deg East to 144deg East; northern hemisphere. Japan. Russia.","projected 2D","","","East","North","E","N","9001","","4326","16054","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1425[] = {"32655","WGS 84 / UTM zone 55N","","","","144deg East to 150deg East; northern hemisphere. Japan. Russia.","projected 2D","","","East","North","E","N","9001","","4326","16055","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1426[] = {"32656","WGS 84 / UTM zone 56N","","","","150deg East to 156deg East; northern hemisphere. Russia.","projected 2D","","","East","North","E","N","9001","","4326","16056","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1427[] = {"32657","WGS 84 / UTM zone 57N","","","","156deg East to 162deg East; northern hemisphere. Russia.","projected 2D","","","East","North","E","N","9001","","4326","16057","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1428[] = {"32658","WGS 84 / UTM zone 58N","","","","162deg East to 168deg East; northern hemisphere. Russia.","projected 2D","","","East","North","E","N","9001","","4326","16058","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1429[] = {"32659","WGS 84 / UTM zone 59N","","","","168deg East to 174deg East; northern hemisphere. Russia.","projected 2D","","","East","North","E","N","9001","","4326","16059","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1430[] = {"32660","WGS 84 / UTM zone 60N","","","","174deg East to 180deg; northern hemisphere. Russia.","projected 2D","","","East","North","E","N","9001","","4326","16060","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1431[] = {"32661","WGS 84 / UPS North","","","","Polar areas north of 84 deg N.","projected 2D","","","East","North","E","N","9001","","4326","16061","1996-09-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1432[] = {"32701","WGS 84 / UTM zone 1S","","","","180deg to 174deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16101","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1433[] = {"32702","WGS 84 / UTM zone 2S","","","","174deg West to 168deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16102","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1434[] = {"32703","WGS 84 / UTM zone 3S","","","","168deg West to 162deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16103","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1435[] = {"32704","WGS 84 / UTM zone 4S","","","","162deg West to 156deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16104","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1436[] = {"32705","WGS 84 / UTM zone 5S","","","","156deg West to 150deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16105","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1437[] = {"32706","WGS 84 / UTM zone 6S","","","","150deg West to 144deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16106","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1438[] = {"32707","WGS 84 / UTM zone 7S","","","","144deg West to 138deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16107","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1439[] = {"32708","WGS 84 / UTM zone 8S","","","","138deg West to 132deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16108","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1440[] = {"32709","WGS 84 / UTM zone 9S","","","","132deg West to 126deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16109","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1441[] = {"32710","WGS 84 / UTM zone 10S","","","","130deg West to 120deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16110","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1442[] = {"32711","WGS 84 / UTM zone 11S","","","","120deg West to 114deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16111","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1443[] = {"32712","WGS 84 / UTM zone 12S","","","","114deg West to 108deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16112","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1444[] = {"32713","WGS 84 / UTM zone 13S","","","","108deg West to 102deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16113","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1445[] = {"32714","WGS 84 / UTM zone 14S","","","","102deg West to 96deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16114","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1446[] = {"32715","WGS 84 / UTM zone 15S","","","","96deg West to 90deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16115","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1447[] = {"32716","WGS 84 / UTM zone 16S","","","","90deg West to 84deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16116","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1448[] = {"32717","WGS 84 / UTM zone 17S","","","","84deg West to 78deg West; southern hemisphere. Ecuador. Peru.","projected 2D","","","East","North","E","N","9001","","4326","16117","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1449[] = {"32718","WGS 84 / UTM zone 18S","","","","78deg West to 72deg West; southern hemisphere. Argentina. Brazil. Chile. Colombia. Ecuador. Peru.","projected 2D","","","East","North","E","N","9001","","4326","16118","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1450[] = {"32719","WGS 84 / UTM zone 19S","","","","72deg West to 66deg West; southern hemisphere. Argentina. Bolivia. Brazil. Chile. Colombia. Peru.","projected 2D","","","East","North","E","N","9001","","4326","16119","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1451[] = {"32720","WGS 84 / UTM zone 20S","","","","66deg West to 60deg West; southern hemisphere. Argentina. Bolivia. Brazil. Falkland Islands (Malvinas). Paraguay.","projected 2D","","","East","North","E","N","9001","","4326","16120","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1452[] = {"32721","WGS 84 / UTM zone 21S","","","","60deg West to 54deg West; southern hemisphere. Argentina. Bolivia. Brazil. Falkland Islands (Malvinas). Paraguay. Uruguay.","projected 2D","","","East","North","E","N","9001","","4326","16121","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1453[] = {"32722","WGS 84 / UTM zone 22S","","","","54deg West to 48deg West; southern hemisphere. Brazil.  Uruguay.","projected 2D","","","East","North","E","N","9001","","4326","16122","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1454[] = {"32723","WGS 84 / UTM zone 23S","","","","48deg West to 42deg West; southern hemisphere. Brazil.","projected 2D","","","East","North","E","N","9001","","4326","16123","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1455[] = {"32724","WGS 84 / UTM zone 24S","","","","42deg West to 36deg West; southern hemisphere. Brazil. South Georgia and the South Sandwich Islands.","projected 2D","","","East","North","E","N","9001","","4326","16124","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1456[] = {"32725","WGS 84 / UTM zone 25S","","","","36deg West to 30deg West; southern hemisphere. Brazil.","projected 2D","","","East","North","E","N","9001","","4326","16125","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1457[] = {"32726","WGS 84 / UTM zone 26S","","","","30deg West to 24deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16126","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1458[] = {"32727","WGS 84 / UTM zone 27S","","","","24deg West to 18deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16127","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1459[] = {"32728","WGS 84 / UTM zone 28S","","","","18deg West to 12deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16128","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1460[] = {"32729","WGS 84 / UTM zone 29S","","","","12deg West to 6deg West; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16129","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1461[] = {"32730","WGS 84 / UTM zone 30S","","","","6deg West to 0deg; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16130","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1462[] = {"32731","WGS 84 / UTM zone 31S","","","","0deg to 6deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16131","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1463[] = {"32732","WGS 84 / UTM zone 32S","","","","6deg East to 12deg East; southern hemisphere. Angola. Congo. Gabon. Namibia.","projected 2D","","","East","North","E","N","9001","","4326","16132","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1464[] = {"32733","WGS 84 / UTM zone 33S","","","","12deg East to 18deg East; southern hemisphere. Angola. Congo. Democratic Republic of the Congo (Zaire). Gabon. Namibia. South Africa.","projected 2D","","","East","North","E","N","9001","","4326","16133","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1465[] = {"32734","WGS 84 / UTM zone 34S","","","","18deg East to 24deg East; southern hemisphere. Angola. Botswana. Democratic Republic of the Congo (Zaire). Namibia. South Africa. Zambia.","projected 2D","","","East","North","E","N","9001","","4326","16134","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1466[] = {"32735","WGS 84 / UTM zone 35S","","","","24deg East to 30deg East; southern hemisphere. Botswana. Burundi. Democratic Republic of the Congo (Zaire). Rwanda. South Africa. Tanzania. Uganda. Zambia. Zimbabwe.","projected 2D","","","East","North","E","N","9001","","4326","16135","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1467[] = {"32736","WGS 84 / UTM zone 36S","","","","30deg East to 36deg East; southern hemisphere. Burundi. Kenya. Malawi. Mozambique. Rwanda. South Africa. Swaziland. Tanzania. Uganda. Zambia. Zimbabwe.","projected 2D","","","East","North","E","N","9001","","4326","16136","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1468[] = {"32737","WGS 84 / UTM zone 37S","","","","36deg East to 42deg East; southern hemisphere. Kenya. Mozambique. Tanzania.","projected 2D","","","East","North","E","N","9001","","4326","16137","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1469[] = {"32738","WGS 84 / UTM zone 38S","","","","42deg East to 48deg East; southern hemisphere. Madagascar.","projected 2D","","","East","North","E","N","9001","","4326","16138","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1470[] = {"32739","WGS 84 / UTM zone 39S","","","","48deg East to 54deg East; southern hemisphere. Madagascar.","projected 2D","","","East","North","E","N","9001","","4326","16139","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1471[] = {"32740","WGS 84 / UTM zone 40S","","","","54deg East to 60deg East; southern hemisphere. Seychelles.","projected 2D","","","East","North","E","N","9001","","4326","16140","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1472[] = {"32741","WGS 84 / UTM zone 41S","","","","60deg East to 66deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16141","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1473[] = {"32742","WGS 84 / UTM zone 42S","","","","66deg East to 72deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16142","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1474[] = {"32743","WGS 84 / UTM zone 43S","","","","72deg East to 78deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16143","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1475[] = {"32744","WGS 84 / UTM zone 44S","","","","78deg East to 84deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16144","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1476[] = {"32745","WGS 84 / UTM zone 45S","","","","84deg East to 90deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16145","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1477[] = {"32746","WGS 84 / UTM zone 46S","","","","90deg East to 96deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16146","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1478[] = {"32747","WGS 84 / UTM zone 47S","","","","96deg East to 102eg East; southern hemisphere. Indonesia.","projected 2D","","","East","North","E","N","9001","","4326","16147","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1479[] = {"32748","WGS 84 / UTM zone 48S","","","","102deg East to 108deg East; southern hemisphere. Indonesia.","projected 2D","","","East","North","E","N","9001","","4326","16148","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1480[] = {"32749","WGS 84 / UTM zone 49S","","","","108deg East to 114deg East; southern hemisphere. Australia. Indonesia.","projected 2D","","","East","North","E","N","9001","","4326","16149","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1481[] = {"32750","WGS 84 / UTM zone 50S","","","","114deg East to 120deg East; southern hemisphere. Australia. Indonesia.","projected 2D","","","East","North","E","N","9001","","4326","16150","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1482[] = {"32751","WGS 84 / UTM zone 51S","","","","120deg East to 126deg East; southern hemisphere. Australia. East Timor. Indonesia.","projected 2D","","","East","North","E","N","9001","","4326","16151","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1483[] = {"32752","WGS 84 / UTM zone 52S","","","","126deg East to 132deg East; southern hemisphere. Australia. East Timor. Indonesia.","projected 2D","","","East","North","E","N","9001","","4326","16152","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1484[] = {"32753","WGS 84 / UTM zone 53S","","","","132deg East to 138deg East; southern hemisphere. Australia.  Indonesia.","projected 2D","","","East","North","E","N","9001","","4326","16153","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1485[] = {"32754","WGS 84 / UTM zone 54S","","","","138deg East to 144deg East; southern hemisphere. Australia. Indonesia. Papua New Guinea.","projected 2D","","","East","North","E","N","9001","","4326","16154","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1486[] = {"32755","WGS 84 / UTM zone 55S","","","","144deg East to 150deg East; southern hemisphere. Australia. Papua New Guinea.","projected 2D","","","East","North","E","N","9001","","4326","16155","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1487[] = {"32756","WGS 84 / UTM zone 56S","","","","150deg East to 156deg East; southern hemisphere. Australia. Papua New Guinea.","projected 2D","","","East","North","E","N","9001","","4326","16156","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1488[] = {"32757","WGS 84 / UTM zone 57S","","","","156deg East to 162deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16157","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1489[] = {"32758","WGS 84 / UTM zone 58S","","","","162deg East to 168deg East; southern hemisphere.","projected 2D","","","East","North","E","N","9001","","4326","16158","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1490[] = {"32759","WGS 84 / UTM zone 59S","","","","168deg East to 174deg East; southern hemisphere. New Zealand.","projected 2D","","","East","North","E","N","9001","","4326","16159","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1491[] = {"32760","WGS 84 / UTM zone 60S","","","","174deg East to 180deg; southern hemisphere. New Zealand.","projected 2D","","","East","North","E","N","9001","","4326","16160","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1492[] = {"32761","WGS 84 / UPS South","","","","Polar areas south of 80 deg S.","projected 2D","","","East","North","E","N","9001","","4326","16161","1996-09-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t horiz_cs_row_1493[] = {"32766","WGS 84 / TM 36 SE","","","","Mozambique - offshore.","projected 2D","","","East","North","E","N","9001","","4326","16636","1998-11-11 00:00:00","BP Mozambique","EPSG","Used by BP Mozambique for Offshore Zambezi block.","",NULL};
+
+datafile_rows_t *horiz_cs_rows[] = {horiz_cs_row_1,horiz_cs_row_2,horiz_cs_row_3,horiz_cs_row_4,horiz_cs_row_5,horiz_cs_row_6,horiz_cs_row_7,horiz_cs_row_8,horiz_cs_row_9,horiz_cs_row_10,horiz_cs_row_11,horiz_cs_row_12,horiz_cs_row_13,horiz_cs_row_14,horiz_cs_row_15,horiz_cs_row_16,horiz_cs_row_17,horiz_cs_row_18,horiz_cs_row_19,horiz_cs_row_20,horiz_cs_row_21,horiz_cs_row_22,horiz_cs_row_23,horiz_cs_row_24,horiz_cs_row_25,horiz_cs_row_26,horiz_cs_row_27,horiz_cs_row_28,horiz_cs_row_29,h [...]
diff --git a/src/tiff/csv/horiz_cs.csv b/src/tiff/csv/horiz_cs.csv
new file mode 100644
index 0000000..351d34c
--- /dev/null
+++ b/src/tiff/csv/horiz_cs.csv
@@ -0,0 +1,1493 @@
+"HORIZCS_CODE","HORIZCS_EPSG_NAME","HORIZCS_EPSG_ABBR","HORIZCS_USER_NAME","DESCRIPTION","AREA_OF_USE","COORD_SYS_TYPE","GEOD_DATUM_CODE","PRIME_MERIDIAN_CODE","ORIENT_POSITIVE_AXIS_1","ORIENT_POSITIVE_AXIS_2","COORD_SYS_AXIS_1_ABBR","COORD_SYS_AXIS_2_ABBR","UOM_LENGTH_CODE","UOM_ANGLE_CODE","SOURCE_GEOGCS_CODE","PROJECTION_TRF_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+200,Anguilla 1957 / British West Indies Grid,Anguilla 1957 / BWI Grid,,,Anguilla,projected 2D,,,East,North,E,N,9001,,4600,19942,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+201,Antigua 1943 / British West Indies Grid,Antigua 1943 / BWI Grid,,,Antigua and Barbuda - Antigua,projected 2D,,,East,North,E,N,9001,,4601,19942,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+202,Dominica 1945 / British West Indies Grid,Dominica 1945 / BWI Grid,,,Dominica,projected 2D,,,East,North,E,N,9001,,4602,19942,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+203,Grenada 1953 / British West Indies Grid,Grenada 1953 / BWI Grid,,,Grenada (including Grenada Grenadines),projected 2D,,,East,North,E,N,9001,,4603,19942,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+204,Montserrat 58 / British West Indies Grid,Montserrat 58 / BWI Grid,,,Montserrat,projected 2D,,,East,North,E,N,9001,,4604,19942,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+205,St Kitts 1955 / British West Indies Grid,St Kitts 1955 / BWI Grid,,,Saint Kitts and Nevis,projected 2D,,,East,North,E,N,9001,,4605,19942,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+206,St Lucia 1955 / British West Indies Grid,St Lucia 1955 / BWI Grid,,,Saint Lucia,projected 2D,,,East,North,E,N,9001,,4606,19942,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+207,St Vincent 45 / British West Indies Grid,St Vincent 45 / BWI Grid,,,Saint Vincent and the Grenadines,projected 2D,,,East,North,E,N,9001,,4607,19942,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+208,NAD27(CGQ77) / SCoPQ zone 2,CGQ77 / SCoPQ zone 2,,,Canada - Quebec - east of 57 deg East.,projected 2D,,,East,North,X,Y,9001,,4609,17700,1999-07-24 00:00:00,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,,
+209,NAD27(CGQ77) / SCoPQ zone 3,CGQ77 / SCoPQ zone 3,,,Canada - Quebec between 60 deg and 57 deg West.,projected 2D,,,East,North,X,Y,9001,,4609,17703,1999-07-24 00:00:00,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,,
+210,NAD27(CGQ77) / SCoPQ zone 4,CGQ77 / SCoPQ zone 4,,,Canada - Quebec between 63 deg and 60 deg West.,projected 2D,,,East,North,X,Y,9001,,4609,17704,1999-07-24 00:00:00,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,,
+211,NAD27(CGQ77) / SCoPQ zone 5,CGQ77 / SCoPQ zone 5,,,Canada - Quebec between 66 deg and 63 deg West.,projected 2D,,,East,North,X,Y,9001,,4609,17705,1999-07-24 00:00:00,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,,
+212,NAD27(CGQ77) / SCoPQ zone 6,CGQ77 / SCoPQ zone 6,,,Canada - Quebec between 69 deg and  66 deg West.,projected 2D,,,East,North,X,Y,9001,,4609,17706,1999-07-24 00:00:00,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,,
+213,NAD27(CGQ77) / SCoPQ zone 7,CGQ77 / SCoPQ zone 7,,,Canada - Quebec between 72 deg and 69 deg West.,projected 2D,,,East,North,X,Y,9001,,4609,17707,1999-07-24 00:00:00,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,,
+214,NAD27(CGQ77) / SCoPQ zone 8,CGQ77 / SCoPQ zone 8,,,Canada - Quebec between 75 deg and 72 deg West.,projected 2D,,,East,North,X,Y,9001,,4609,17708,1999-07-24 00:00:00,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,,
+215,NAD27(CGQ77) / SCoPQ zone 9,CGQ77 / SCoPQ zone 9,,,Canada - Quebec between 78 deg and 75 deg West.,projected 2D,,,East,North,X,Y,9001,,4609,17709,1999-07-24 00:00:00,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,,
+216,NAD27(CGQ77) / SCoPQ zone 10,CGQ77 / SCoPQ zone 10,,,Canada - Quebec west of 78 deg West.,projected 2D,,,East,North,X,Y,9001,,4609,17710,1999-07-24 00:00:00,Geodetic Service of Quebec; Quebec Ministry of Natural Resources.,EPSG,,
+217,NAD27(76) / MTM zone 8,,,,Canada - Ontario - east of 75 deg West.,projected 2D,,,East,North,X,Y,9001,,4608,17708,1999-07-24 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+218,NAD27(76) / MTM zone 9,,,,Canada - Ontario - between 78 deg and 75 deg West.,projected 2D,,,East,North,X,Y,9001,,4608,17709,1999-07-24 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+219,NAD27(76) / MTM zone 10,,,,Canada - Ontario - between 79 deg 30 min and 78 deg W in area to north of 47 deg N; between 80 deg 15 min and 78 deg W in area between 46 deg and 47 deg N; between 81 deg and 78 deg W in area south of 46 deg N.,projected 2D,,,East,North,X,Y,9001,,4608,17710,1999-07-24 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+220,NAD27(76) / MTM zone 11,,,,Canada - Ontario - south of 46 deg N and west of 81 deg West.,projected 2D,,,East,North,E,N,9001,,4608,17711,1999-07-24 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+221,NAD27(76) / MTM zone 12,,,,Canada - Ontario - between 82 deg 30 min and 79 deg 30 min W in area to north of 47 deg N; between 82 deg 30 min and 80 deg 15 min W in area between 46 deg and 47 deg N; between 82 deg 30 min and 79 deg 30 min W in area north of 47 deg N.,projected 2D,,,East,North,E,N,9001,,4608,17712,1999-07-24 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+222,NAD27(76) / MTM zone 13,,,,Canada - Ontario - between 85 deg 30 min and 82 deg 30 min West and north of 46 deg North.,projected 2D,,,East,North,E,N,9001,,4608,17713,1999-07-24 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+223,NAD27(76) / MTM zone 14,,,,Canada - Ontario - between 88 deg 30 min and 85 deg 30 min West.,projected 2D,,,East,North,E,N,9001,,4608,17714,1999-07-24 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+224,NAD27(76) / MTM zone 15,,,,Canada - Ontario - between 91 deg 30 min and 88 deg 30 min West.,projected 2D,,,East,North,E,N,9001,,4608,17715,1999-07-24 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+225,NAD27(76) / MTM zone 16,,,,Canada - Ontario - between 94 deg 30 min and 91 deg 30 min West.,projected 2D,,,East,North,E,N,9001,,4608,17716,1999-07-24 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+226,NAD27(76) / MTM zone 17,,,,Canada - Ontario - west of 94 deg 30 min West.,projected 2D,,,East,North,E,N,9001,,4608,17717,1999-07-24 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+227,NAD27(76) / UTM zone 15N,,,,Canada - Ontario - 96deg West  to 90deg West.,projected 2D,,,East,North,E,N,9001,,4608,16015,1999-07-24 00:00:00,,EPSG,Supersedes NAD27 / UTM zone 15N (code 26715).,
+228,NAD27(76) / UTM zone 16N,,,,Canada - Ontario - 90deg West  to 84deg West.,projected 2D,,,East,North,E,N,9001,,4608,16016,1999-07-24 00:00:00,,EPSG,Supersedes NAD27 / UTM zone 16N (code 26716).,
+229,NAD27(76) / UTM zone 17N,,,,Canada - Ontario - 84deg West  to 78deg West.,projected 2D,,,East,North,E,N,9001,,4608,16017,1999-07-24 00:00:00,,EPSG,Supersedes NAD27 / UTM zone 17N (code 26717).,
+230,NAD27(76) / UTM zone 18N,,,,Canada - Ontario - east of 78 deg West.,projected 2D,,,East,North,E,N,9001,,4608,16018,1999-07-24 00:00:00,,EPSG,Supersedes NAD27 / UTM zone 18N (code 26718).,
+231,NAD27(CGQ77) / UTM zone 17N,CGQ77 / UTM zone 17N,,,Canada - Quebec - west of 78 deg West.,projected 2D,,,East,North,E,N,9001,,4609,16017,1999-07-24 00:00:00,,EPSG,Supersedes NAD27 / UTM zone 17N (code 26717).,
+232,NAD27(CGQ77) / UTM zone 18N,CGQ77 / UTM zone 18N,,,Canada - Quebec -78deg West  to 72deg West.,projected 2D,,,East,North,E,N,9001,,4609,16018,1999-07-24 00:00:00,,EPSG,Supersedes NAD27 / UTM zone 18N (code 26718).,
+233,NAD27(CGQ77) / UTM zone 19N,CGQ77 / UTM zone 19N,,,Canada - Quebec - 72deg West  to 66deg West.,projected 2D,,,East,North,E,N,9001,,4609,16019,1999-07-24 00:00:00,,EPSG,Supersedes NAD27 / UTM zone 19N (code 26719).,
+234,NAD27(CGQ77) / UTM zone 20N,CGQ77 / UTM zone 20N,,,Canada - Quebec - 66deg West  to 60deg West.,projected 2D,,,East,North,E,N,9001,,4609,16020,1999-07-24 00:00:00,,EPSG,Supersedes NAD27 / UTM zone 20N (code 26720).,
+235,NAD27(CGQ77) / UTM zone 21N,CGQ77 / UTM zone 21N,,,Canada - Quebec - east of 60deg West.,projected 2D,,,East,North,E,N,9001,,4609,16021,1999-07-24 00:00:00,,EPSG,Supersedes NAD27 / UTM zone 21N (code 26721).,
+236,NAD83(CSRS98) / New Brunswick Stereo,NAD83(98) / NB Stereo,,,Canada - New Brunswick,projected 2D,,,North,East,N,E,9001,,4140,19946,1999-10-20 00:00:00,Service New Brunswick Land and Information Standards Manual,EPSG,In use from 1999.,
+237,NAD83(CSRS98) / UTM zone 19N,NAD83(98) / UTM 19N,,,Canada - New Brunswick west of 66 deg West.,projected 2D,,,East,North,E,N,9001,,4140,16019,1999-10-20 00:00:00,Service New Brunswick Land and Information Standards Manual,EPSG,In use from 1999.,
+238,NAD83(CSRS98) / UTM zone 20N,NAD83(98) / UTM 20N,,,Canada - New Brunswick east of 66 deg West.,projected 2D,,,East,North,E,N,9001,,4140,16020,1999-10-20 00:00:00,Service New Brunswick Land and Information Standards Manual,EPSG,In use from 1999.,
+239,Israel / Israeli TM Grid,Israeli TM Grid,,,Israel.,projected 2D,,,East,North,E,N,9001,,4141,18204,1999-10-20 00:00:00,Survey of Israel.,EPSG,Supercedes Israeli CS Grid (EPSG code 28193).,
+240,Locodjo 1965 / UTM zone 30N,Locodjo 65 / UTM 30N,,,Cote D'Ivoire (Ivory Coast) east of 6 deg West.,projected 2D,,,East,North,E,N,9001,,4142,16030,1999-10-20 00:00:00,IGN Paris,EPSG,Superseded by Abidjan 87 / UTM 30N (EPSG code 241).,
+241,Abidjan 1987 / UTM zone 30N,Abidjan 87 / UTM 30N,,,Cote D'Ivoire (Ivory Coast) east of 6 deg West.,projected 2D,,,East,North,E,N,9001,,4143,16030,1999-10-20 00:00:00,IGN Paris,EPSG,Supersedes Locodjo 65 / UTM 30N (EPSG code 240).,
+242,Locodjo 1965 / UTM zone 29N,Locodjo 65 / UTM 29N,,,Cote D'Ivoire (Ivory Coast) west of 6 deg West.,projected 2D,,,East,North,E,N,9001,,4142,16029,1999-10-20 00:00:00,IGN Paris,EPSG,Superseded by Abidjan 87 / UTM 29N (EPSG code 243).,
+243,Abidjan 1987 / UTM zone 29N,Abidjan 87 / UTM 29N,,,Cote D'Ivoire (Ivory Coast) west of 6 deg West.,projected 2D,,,East,North,E,N,9001,,4143,16029,1999-10-20 00:00:00,IGN Paris,EPSG,Supersedes Locodjo 65 / UTM 29N (EPSG code 242).,
+244,Hanoi 1972 / Gauss-Kruger zone 18,Hanoi 72 / Gauss zone 18,,,Vietnam - west of 108 deg East.,projected 2D,,,North,East,X,Y,9001,,4147,16218,1999-10-20 00:00:00,,EPSG,Replaces use of Indian 1960 / UTM zone 48 after 1988.,
+245,Hanoi 1972 / Gauss-Kruger zone 19,Hanoi 72 / Gauss zone 19,,,Vietnam - east of 108 deg East.,projected 2D,,,North,East,X,Y,9001,,4147,16219,1999-10-20 00:00:00,,EPSG,Replaces use of Indian 1960 / UTM zone 48 after 1988.,
+246,Hartbeesthoek94 / Lo15,New S African CS zone 15,,,South Africa - Walvis Bay.,projected 2D,,,West,South,W,S,9001,,4148,17515,1999-10-20 00:00:00,,EPSG,,
+247,Hartbeesthoek94 / Lo17,New S African CS zone 17,,,South Africa - west of 18 deg East.,projected 2D,,,West,South,W,S,9001,,4148,17517,1999-10-20 00:00:00,,EPSG,,
+248,Hartbeesthoek94 / Lo19,New S African CS zone 19,,,South Africa - 18 to 20 deg East.,projected 2D,,,West,South,W,S,9001,,4148,17519,1999-10-20 00:00:00,,EPSG,,
+249,Hartbeesthoek94 / Lo21,New S African CS zone 21,,,South Africa - 20 to 22 deg East.,projected 2D,,,West,South,W,S,9001,,4148,17521,1999-10-20 00:00:00,,EPSG,,
+250,Hartbeesthoek94 / Lo23,New S African CS zone 23,,,South Africa - 22 to 24 deg East.,projected 2D,,,West,South,W,S,9001,,4148,17523,1999-10-20 00:00:00,,EPSG,,
+251,Hartbeesthoek94 / Lo25,New S African CS zone 25,,,Lestho  - west of 26 deg East; South Africa - 24 to 26 deg East.,projected 2D,,,West,South,W,S,9001,,4148,17525,1999-10-20 00:00:00,,EPSG,,
+252,Hartbeesthoek94 / Lo27,New S African CS zone 27,,,Lestho  - east of 26 deg East;  South Africa - 26 to 28 deg East.,projected 2D,,,West,South,W,S,9001,,4148,17527,1999-10-20 00:00:00,,EPSG,,
+253,Hartbeesthoek94 / Lo29,New S African CS zone 29,,,South Africa - 28 to 30 deg East.,projected 2D,,,West,South,W,S,9001,,4148,17529,1999-10-20 00:00:00,,EPSG,,
+254,Hartbeesthoek94 / Lo31,New S African CS zone 31,,,South Africa - 30 to 32 deg East;  Swaziland.,projected 2D,,,West,South,W,S,9001,,4148,17533,1999-10-20 00:00:00,,EPSG,,
+255,Hartbeesthoek94 / Lo33,New S African CS zone 33,,,South Africa - east of 32 deg East.,projected 2D,,,West,South,W,S,9001,,4148,17533,1999-10-20 00:00:00,,EPSG,,
+256,CH1903+ / LV95,LV95,,,Liechtenstein; Switzerland.,projected 2D,,,East,North,Y,X,9001,,4150,19950,1999-10-20 00:00:00,,EPSG,Supersedes CH1903/LV03 (code 21781).,
+257,Rassadiran / Nakhl e Taqi,,,,Iran - Taheri refinery site only.,projected 2D,,,East,North,E,N,9001,,4153,19951,1999-10-20 00:00:00,Total-Fina,EPSG,Used for terminal site only.,
+258,ED50(ED77) / UTM zone 38N,,,,Iran - west of 48deg East.,projected 2D,,,East,North,E,N,9001,,4154,16038,1999-10-20 00:00:00,,EPSG,,
+259,ED50(ED77) / UTM zone 39N,,,,Iran - 48deg to 54 deg East.,projected 2D,,,East,North,E,N,9001,,4154,16039,1999-10-20 00:00:00,,EPSG,,
+260,ED50(ED77) / UTM zone 40N,,,,Iran - 54deg to 60 deg East.,projected 2D,,,East,North,E,N,9001,,4154,16040,1999-10-20 00:00:00,,EPSG,,
+261,ED50(ED77) / UTM zone 41N,,,,Iran - east of 60deg East.,projected 2D,,,East,North,E,N,9001,,4154,16041,1999-10-20 00:00:00,,EPSG,,
+300,Madrid 1870 (Madrid) / Spain,,,,Spain,projected 2D,,,East,North,X,Y,9001,,4903,19921,1998-11-11 00:00:00,,EPSG,Superseded by ED50 / UTM after 1966.,
+2100,GGRS87 / Greek Grid,,,,Greece,projected 2D,,,East,North,E,N,9001,,4121,19930,1997-06-16 00:00:00,Geodesy Department; Public Petroleum Corporation of Greece.,EPSG,Oil industry uses ED50 / UTM zone 34N and ED50 / UTM zone 35N.,
+2200,ATS77 / New Brunswick Stereographic,ATS77 / NB Stereographic,,,Canada - New Brunswick,projected 2D,,,North,East,N,E,9001,,4122,19945,1999-10-20 00:00:00,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,In use from 1979.  To be phased out in late 1990's.,99.61
+2219,ATS77 / UTM zone 19N,,,,Canada - New Brunswick - west of 66 deg W.,projected 2D,,,East,North,E,N,9001,,4122,16019,1997-07-22 00:00:00,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,In use from 1979.  To be phased out in late 1990's.,
+2220,ATS77 / UTM zone 20N,,,,Canada - New Brunswick - east of 66 deg W.; Canada - Nova Scotia; Canada - Prince Edward Island.,projected 2D,,,East,North,E,N,9001,,4122,16020,1997-07-22 00:00:00,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,In use from 1979.  To be phased out in late 1990's.,
+2290,ATS77 / Prince Edward Isl. Stereographic,ATS77 / PEI Stereo,,,Canada - Prince Edward Island,projected 2D,,,East,North,E(X),N(Y),9001,,4122,19933,1997-11-13 00:00:00,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,In use from 1979.  To be phased out in late 1990's.,
+2294,ATS77 / MTM Nova Scotia zone 4,ATS77 / MTM NS zone 4,,,Canada - Nova Scotia - east of 63 deg West.,projected 2D,,,East,North,E,N,9001,,4122,17794,1997-11-13 00:00:00,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,In use from 1979.  To be phased out in late 1990's.,
+2295,ATS77 / MTM Nova Scotia zone 5,ATS77 / MTM NS zone 5,,,Canada - Nova Scotia - west of 63 deg West.,projected 2D,,,East,North,E,N,9001,,4122,17795,1997-11-13 00:00:00,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,In use from 1979.  To be phased out in late 1990's.,
+2391,KKJ / Finland zone 1,,,,Finland - west of 22deg 30min E.,projected 2D,,,North,East,X,Y,9001,,4123,18191,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,,
+2392,KKJ / Finland zone 2,,,,Finland - 22deg 30 min to 25deg 30min E.,projected 2D,,,North,East,X,Y,9001,,4123,18192,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,,
+2393,KKJ / Finland Uniform Coordinate System,KKJ / Finland zone 3,,,Finland; Finland - 25 deg 30min E to 28deg 30min E.,projected 2D,,,North,East,X,Y,9001,,4123,18193,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,Known as Uniform Coordinate System when used over all country and also as Basic Coordinate System zone 3 at larger scales.,
+2394,KKJ / Finland zone 4,,,,Finland - east of 28deg 30 min E.,projected 2D,,,North,East,X,Y,9001,,4123,18194,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,,
+2400,RT90 2.5 gon W,,,,Sweden,projected 2D,,,North,East,X,Y,9001,,4124,19929,1997-11-13 00:00:00,National Land Survey of Sweden,EPSG,,
+2550,Samboja / UTM zone 50S,,,,Indonesia - east Kalimantan - Mahakam delta area.,projected 2D,,,East,North,E,N,9001,,4125,16150,1997-11-13 00:00:00,,EPSG,,
+2600,Lietuvos Koordinoei Sistema 1994,LKS94,,,Lithuania,projected 2D,,,North,East,X,Y,9001,,4126,19934,1998-03-12 00:00:00,,EPSG,,
+2736,Tete / UTM zone 36S,,,,Mozambique - west of 36 deg E.,projected 2D,,,East,North,E,N,9001,,4127,16136,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,,
+2737,Tete / UTM zone 37S,,,,Mozambique - east of 36 deg E,projected 2D,,,East,North,E,N,9001,,4127,16137,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,,
+3036,Moznet / UTM zone 36S,,,,Mozambique - west of 36 deg E.,projected 2D,,,East,North,E,N,9001,,4130,16136,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,,
+3037,Moznet / UTM zone 37S,,,,Mozambique - east of 36 deg E,projected 2D,,,East,North,E,N,9001,,4130,16137,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,,
+3148,Indian 1960 / UTM zone 48N,,,,Cambodia; Vietnam west of 108deg East.,projected 2D,,,East,North,E,N,9001,,4131,16048,1998-11-11 00:00:00,,EPSG,In Vietnam superseded by Hanoi 72 / Gauss zone 18 from 1988 onwards.,
+3149,Indian 1960 / UTM zone 49N,,,,Vietnam east of 108deg East.,projected 2D,,,East,North,E,N,9001,,4131,16049,1998-11-11 00:00:00,,EPSG,Superseded by Hanoi 72 / Gauss zone 18 from 1988 onwards.,
+3176,Indian 1960 / TM 106 NE,,,,Vietnam - offshore.,projected 2D,,,East,North,E,N,9001,,4131,16506,1998-11-11 00:00:00,Petrovietnam,EPSG,Used by Petrovietnam for offshore block 15.,
+3200,FD58 / Iraq zone,,,,Iran - Gulf coast and Arwaz areas.,projected 2D,,,East,North,E,N,9001,,4132,19906,1998-11-11 00:00:00,IOEPC records.,EPSG,,
+3300,Estonian Coordinate System of 1992,,,,Estonia.,projected 2D,,,North,East,X,Y,9001,,4133,19938,1998-12-14 00:00:00,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,Used for 1:20000 and larger scale mapping.,
+3439,PSD93 / UTM zone 39N,,,,Oman - west of 54 deg East.,projected 2D,,,East,North,E,N,9001,,4134,16039,1999-04-22 00:00:00,Petroleum Development Oman,EPSG,Supersedes Fahud / UTM zone 39N projCS (code 23239). Maximum differences to Fahud adjustment are 20 metres.,
+3440,PSD93 / UTM zone 40N,,,,Oman - east of 54 deg East.,projected 2D,,,East,North,E,N,9001,,4134,16040,1999-04-22 00:00:00,Petroleum Development Oman,EPSG,Supersedes Fahud / UTM zone 40N projCS (code 23240). Maximum differences to Fahud adjustment are 20 metres.,
+3561,Old Hawaiian / Hawaii zone 1,Old Hawaiian / SP zone 1,,,United States (USA) - Hawaii - island of Hawaii.,projected 2D,,,East,North,X,Y,9003,,4135,15101,1999-05-24 00:00:00,,EPSG,Sometimes erroneously referred to as NAD27 / Hawaii zone 1.,99.322
+3562,Old Hawaiian / Hawaii zone 2,Old Hawaiian / SP zone 2,,,United States (USA) - Hawaii - Maui; Kahoolawe; Lanai; Molokai.,projected 2D,,,East,North,X,Y,9003,,4135,15102,1999-05-24 00:00:00,,EPSG,Sometimes erroneously referred to as NAD27 / Hawaii zone 2.,99.322
+3563,Old Hawaiian / Hawaii zone 3,Old Hawaiian / SP zone 3,,,United States (USA) - Hawaii - Oahu.,projected 2D,,,East,North,X,Y,9003,,4135,15103,1999-05-24 00:00:00,,EPSG,Sometimes erroneously referred to as NAD27 / Hawaii zone 3.,99.322
+3564,Old Hawaiian / Hawaii zone 4,Old Hawaiian / SP zone 4,,,United States (USA) - Hawaii - Kauai.,projected 2D,,,East,North,X,Y,9003,,4135,15104,1999-05-24 00:00:00,,EPSG,Sometimes erroneously referred to as NAD27 / Hawaii zone 4.,99.322
+3565,Old Hawaiian / Hawaii zone 5,Old Hawaiian / SP zone 5,,,United States (USA) - Hawaii - Niihau.,projected 2D,,,East,North,X,Y,9003,,4135,15105,1999-05-24 00:00:00,,EPSG,Sometimes erroneously referred to as NAD27 / Hawaii zone 5.,99.322
+3920,Puerto Rico / UTM zone 20N,,,,British Virgin Islands (civilian).,projected 2D,,,East,North,E,N,9001,,4139,16020,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,NAD27 / UTM zone 20 N (code 26720) used for military purposes.,
+3991,Puerto Rico State Plane CS of 1927,Puerto Rico SPCS 27,,,Puerto Rico.,projected 2D,,,East,North,X,Y,9003,,4139,15201,1999-05-24 00:00:00,,EPSG,Sometimes erroneously referred to as NAD27 / Puerto Rico State Plane CS.,99.323
+3992,Puerto Rico / St. Croix,,,,US Virgin Islands (U.S.).,projected 2D,,,East,North,X,Y,9003,,4139,15202,1999-05-24 00:00:00,,EPSG,Sometimes erroneously referred to as NAD27 / St. Croix State Plane CS.,99.323
+4001,Unknown datum based upon ellipsoid 7001,,,,,geographic 2D,6001,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4002,Unknown datum based upon ellipsoid 7002,,,,,geographic 2D,6002,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4003,Unknown datum based upon ellipsoid 7003,,,,,geographic 2D,6003,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4004,Unknown datum based upon ellipsoid 7004,,,,,geographic 2D,6004,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4005,Unknown datum based upon ellipsoid 7005,,,,,geographic 2D,6005,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4006,Unknown datum based upon ellipsoid 7006,,,,,geographic 2D,6006,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4007,Unknown datum based upon ellipsoid 7007,,,,,geographic 2D,6007,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4008,Unknown datum based upon ellipsoid 7008,,,,,geographic 2D,6008,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4009,Unknown datum based upon ellipsoid 7009,,,,,geographic 2D,6009,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4010,Unknown datum based upon ellipsoid 7010,,,,,geographic 2D,6010,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4011,Unknown datum based upon ellipsoid 7011,,,,,geographic 2D,6011,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4012,Unknown datum based upon ellipsoid 7012,,,,,geographic 2D,6012,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4013,Unknown datum based upon ellipsoid 7013,,,,,geographic 2D,6013,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4014,Unknown datum based upon ellipsoid 7014,,,,,geographic 2D,6014,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4015,Unknown datum based upon ellipsoid 7015,,,,,geographic 2D,6015,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4016,Unknown datum based upon ellipsoid 7016,,,,,geographic 2D,6016,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4017,Unknown datum based upon ellipsoid 7017,,,,,geographic 2D,6017,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4018,Unknown datum based upon ellipsoid 7018,,,,,geographic 2D,6018,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4019,Unknown datum based upon ellipsoid 7019,,,,,geographic 2D,6019,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4020,Unknown datum based upon ellipsoid 7020,,,,,geographic 2D,6020,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4021,Unknown datum based upon ellipsoid 7021,,,,,geographic 2D,6021,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4022,Unknown datum based upon ellipsoid 7022,,,,,geographic 2D,6022,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4024,Unknown datum based upon ellipsoid 7024,,,,,geographic 2D,6024,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4025,Unknown datum based upon ellipsoid 7025,,,,,geographic 2D,6025,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4027,Unknown datum based upon ellipsoid 7027,,,,,geographic 2D,6027,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4028,Unknown datum based upon ellipsoid 7028,,,,,geographic 2D,6028,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4029,Unknown datum based upon ellipsoid 7029,,,,,geographic 2D,6029,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4030,Unknown datum based upon ellipsoid 7030,,,,,geographic 2D,6030,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4031,Unknown datum based upon ellipsoid 7031,,,,,geographic 2D,6031,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4032,Unknown datum based upon ellipsoid 7032,,,,,geographic 2D,6032,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4033,Unknown datum based upon ellipsoid 7033,,,,,geographic 2D,6033,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4034,Unknown datum based upon ellipsoid 7034,,,,,geographic 2D,6034,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4035,Unknown datum based upon ellipsoid 7035,,,,,geographic 2D,6035,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,96.08
+4036,Unknown datum based upon ellipsoid 7036,,,,,geographic 2D,6036,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,
+4041,Unknown datum based upon ellipsoid 7041,,,,,geographic 2D,6041,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,
+4042,Unknown datum based upon ellipsoid 7042,,,,,geographic 2D,6042,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,
+4043,Unknown datum based upon ellipsoid 7043,,,,,geographic 2D,6043,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,
+4044,Unknown datum based upon ellipsoid 7044,,,,,geographic 2D,6044,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,
+4045,Unknown datum based upon ellipsoid 7045,,,,,geographic 2D,6045,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,Not recommended.  Use only in cases where geodetic datum unknown.,
+4120,Greek,,,,Greece,geographic 2D,6120,8901,North,East,Lat,Long,,9108,,,1997-06-16 00:00:00,Topography Department; National Technical University of Greece.,EPSG,,
+4121,GGRS87,,,,Greece,geographic 2D,6121,8901,North,East,Lat,Long,,9108,,,1997-06-16 00:00:00,Geodesy Department; Public Petroleum Corporation of Greece.,EPSG,,
+4122,ATS77,,,,Canada - New Brunswick; Canada - Nova Scotia - onshore; Canada - Prince Edward Island.,geographic 2D,6122,8901,North,East,Lat,Long,,9108,,,1997-07-22 00:00:00,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,In use from 1979.  To be phased out in late 1990's.,
+4123,KKJ,,,,Finland,geographic 2D,6123,8901,North,East,Lat,Long,,9108,,,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,,
+4124,RT90,,,,Sweden,geographic 2D,6124,8901,North,East,Lat,Long,,9108,,,1997-11-13 00:00:00,National Land Survey of Sweden,EPSG,,
+4125,Samboja,,,,Indonesia - east Kalimantan - Mahakam delta area.,geographic 2D,6125,8901,North,East,Lat,Long,,9108,,,1997-11-13 00:00:00,,EPSG,,
+4126,LKS94 (ETRS89),,,,Lithuania,geographic 2D,6126,8901,North,East,Lat,Long,,9108,,,1998-03-13 00:00:00,,EPSG,,
+4127,Tete,,,,Mozambique,geographic 2D,6127,8901,North,East,Lat,Long,,9108,,,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,,
+4128,Madzansua,,,,Mozambique - west,geographic 2D,6128,8901,North,East,Lat,Long,,9108,,,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,Superseded by values transformed to Tete geogCS (code 4127).,
+4129,Observatario,,,,Mozambique - south,geographic 2D,6129,8901,North,East,Lat,Long,,9108,,,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,Superseded by values transformed to Tete geogCS (code 4127).,
+4130,Moznet,,,,Mozambique,geographic 2D,6130,8901,North,East,Lat,Long,,9108,,,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,,
+4131,Indian 1960,,,,Cambodia; Vietnam,geographic 2D,6131,8901,North,East,Lat,Long,,9108,,,1998-11-11 00:00:00,,EPSG,,
+4132,FD58,,,,Iran - Gulf coast and Arwaz areas.,geographic 2D,6132,8901,North,East,Lat,Long,,9108,,,1998-11-11 00:00:00,IOEPC records.,EPSG,,
+4133,EST92,,,,Estonia,geographic 2D,6133,8901,North,East,Lat,Long,,9108,,,1998-12-14 00:00:00,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,Densification of ETRS89 as established during 1992 Baltic campaign.,
+4134,PDO Survey Datum 1993,PSD93,,,Oman,geographic 2D,6134,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,Petroleum Development Oman,EPSG,Supersedes Fahud geogCS (code 4232). Maximum differences to Fahud adjustment are 20 metres.,
+4135,Old Hawaiian,,,,United States (USA) - Hawaii,geographic 2D,6135,8901,North,East,Lat,Long,,9108,,,1999-05-24 00:00:00,,EPSG,Note: this coordinate system includes longitudes which are POSITIVE EAST.,
+4136,St. Lawrence Island,,,,United States (USA) - Alaska - St. Lawrence Island,geographic 2D,6136,8901,North,East,Lat,Long,,9108,,,1999-05-24 00:00:00,,EPSG,Note: this coordinate system includes longitudes which are POSITIVE EAST.,
+4137,St. Paul Island,,,,United States (USA) - Alaska - St. Paul Island,geographic 2D,6137,8901,North,East,Lat,Long,,9108,,,1999-05-24 00:00:00,,EPSG,Note: this coordinate system includes longitudes which are POSITIVE EAST.,
+4138,St. George Island,,,,United States (USA) - Alaska - St. George Island,geographic 2D,6138,8901,North,East,Lat,Long,,9108,,,1999-05-24 00:00:00,,EPSG,Note: this coordinate system includes longitudes which are POSITIVE EAST.,
+4139,Puerto Rico,,,,Puerto Rico; Virgin Islands (British); Virgin Islands (U.S.).,geographic 2D,6139,8901,North,East,Lat,Long,,9108,,,1999-05-24 00:00:00,,EPSG,Used for civilian purposes.  NAD27 (code 4267) used for military purposes.  Note: this coordinate system includes longitudes which are POSITIVE EAST.,
+4140,NAD83(CSRS98),,,,Canada - New Brunswick,geographic 2D,6140,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,Service New Brunswick Land and Information Standards Manual,EPSG,Supersedes ATS77 from 1999 in New Brunswick.,
+4141,Israel,,,,Israel.,geographic 2D,6141,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,Survey of Israel,EPSG,Supersedes Palestine 1923 in Israel.,
+4142,Locodjo 1965,,,,Cote D'Ivoire (Ivory Coast).,geographic 2D,6142,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,IGN Paris,EPSG,Superseded by Abidjan 1987 (EPSG code 4143).,
+4143,Abidjan 1987,,,,Cote D'Ivoire (Ivory Coast).,geographic 2D,6143,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,IGN Paris,EPSG,Supersedes Locodjo 1967 (EPSG code 4142).,
+4144,Kalianpur 1937,,,,Bangladesh; India; Pakistan,geographic 2D,6144,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,"G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.",EPSG,Adopts 1937 metric conversion of 0.30479841 metres per Indian foot.,
+4145,Kalianpur 1962,,,,Pakistan,geographic 2D,6145,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,Adopts 1962 metric conversion of 0.3047996 metres per Indian foot.,
+4146,Kalianpur 1975,,,,India,geographic 2D,6146,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,Adopts 1975 metric conversion of 0.3047995 metres per Indian foot.,
+4147,Hanoi 1972,,,,Vietnam,geographic 2D,6147,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,,
+4148,Hartbeesthoek94,,,,South Africa.,geographic 2D,6148,8901,North,East,Lat,Long,,9108,,,1999-10-22 00:00:00,,EPSG,Supercedes Cape (code 4222) from 1999.,
+4149,CH1903,,,,Liechtenstein; Switzerland,geographic 2D,6149,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,,
+4150,CH1903+,,,,Liechtenstein; Switzerland,geographic 2D,6150,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,,
+4151,CHTRF95,,,,Liechtenstein; Switzerland,geographic 2D,6151,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,,
+4152,NAD83(HARN),,,,United States (US),geographic 2D,6152,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,National Geodetic Survey,EPSG,,
+4153,Rassadiran,,,,Iran - Taheri refinery site only.,geographic 2D,6153,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,Used only for onshore terminal site.,
+4154,ED50(ED77),,,,Iran,geographic 2D,6154,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,,
+4200,Pulkovo 1995,,,,Russia,geographic 2D,6200,8901,North,East,Lat,Long,,9108,,,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+4201,Adindan,,,,Ethiopia; Sudan,geographic 2D,6201,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4202,AGD66,,,,Australia; Papua New Guinea,geographic 2D,6202,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4203,AGD84,,,,Australia,geographic 2D,6203,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4204,Ain el Abd,,,,Kuwait; Saudi Arabia,geographic 2D,6204,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4205,Afgooye,,,,Somalia,geographic 2D,6205,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4206,Agadez,,,,Niger,geographic 2D,6206,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4207,Lisbon,,,,Portugal - onshore,geographic 2D,6207,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,Instituto Geografico e Cadastral; Lisbon,EPSG,,
+4208,Aratu,,,,Brazil - coastal areas south of 2 deg 55 min S.,geographic 2D,6208,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4209,Arc 1950,,,,Botswana; Malawi; Zambia; Zimbabwe.,geographic 2D,6209,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4210,Arc 1960,,,,Kenya; Tanzania; Uganda.,geographic 2D,6210,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4211,Batavia,,,,Indonesia - Java,geographic 2D,6211,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4212,Barbados 1938,,,,Barbados,geographic 2D,6212,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,,EPSG,,99.171
+4213,Beduaram,,,,Niger,geographic 2D,6213,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4214,Beijing 1954,,,,China,geographic 2D,6214,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4215,Belge 1950,,,,Belgium - onshore,geographic 2D,6215,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4216,Bermuda 1957,,,,Bermuda,geographic 2D,6216,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4218,Bogota,,,,Colombia,geographic 2D,6218,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4219,Bukit Rimpah,,,,Indonesia - Banga & Belitung Islands,geographic 2D,6219,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4220,Camacupa,,,,Angola,geographic 2D,6220,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4221,Campo Inchauspe,,,,Argentina,geographic 2D,6221,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4222,Cape,,,,Botswana; South Africa.,geographic 2D,6222,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,Superceded by Hartbeesthoek94 from 1999.,
+4223,Carthage,,,,Tunisia,geographic 2D,6223,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4224,Chua,,,,Brazil,geographic 2D,6224,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4225,Corrego Alegre,,,,Brazil - NE coastal area between 45 deg W and 40 deg W.,geographic 2D,6225,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4226,Cote d'Ivoire,,,,Cote d'Ivoire,geographic 2D,6226,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4227,Deir ez Zor,,,,Syrian Arab Republic,geographic 2D,6227,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4228,Douala,,,,Cameroon,geographic 2D,6228,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4229,Egypt 1907,,,,Egypt,geographic 2D,6229,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4230,ED50,,,,Europe - west - Spain; France offshore; United Kingdom UKCS offshore; Netherlands offshore; Germany offshore North Sea; Denmark; Norway; Turkey.,geographic 2D,6230,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4231,ED87,,,,Europe - west.,geographic 2D,6231,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4232,Fahud,,,,Oman,geographic 2D,6232,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,Since 1993 superseded by PSD93 geogCS (code 4134). Maximum differences to Fahud adjustment are 20 metres.,
+4233,Gandajika 1970,,,,Maldives,geographic 2D,6233,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4234,Garoua,,,,Cameroon,geographic 2D,6234,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4235,Guyane Francaise,,,,French Guyana,geographic 2D,6235,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4236,Hu Tzu Shan,,,,Taiwan,geographic 2D,6236,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4237,HD72,,,,Hungary,geographic 2D,6237,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4238,ID74,,,,Indonesia,geographic 2D,6238,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4239,Indian 1954,,,,Myanmar (Burma); Thailand,geographic 2D,6239,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4240,Indian 1975,,,,Thailand,geographic 2D,6240,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4241,Jamaica 1875,,,,Jamaica,geographic 2D,6241,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4242,JAD69,,,,Jamaica,geographic 2D,6242,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4243,Kalianpur 1880,,,,Bangladesh; India; Myanmar (Burma); Pakistan,geographic 2D,6243,8901,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,"G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.",EPSG,,97.23
+4244,Kandawala,,,,Sri Lanka,geographic 2D,6244,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4245,Kertau,,,,Malaysia - West Malaysia; Singapore,geographic 2D,6245,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,Adopts metric conversion of 39.370113 inches per metre.,
+4246,KOC,,,,Kuwait,geographic 2D,6246,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4247,La Canoa,,,,Venezuela,geographic 2D,6247,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,PSAD56 uses same origin.,
+4248,PSAD56,,,,Bolivia; Ecuador; Peru; [Venezuela],geographic 2D,6248,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,Origin is same as La Canoa.  In Venezuela known as La Canoa.,
+4249,Lake,,,,Venezuela - Lake Maracaibo area,geographic 2D,6249,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4250,Leigon,,,,Ghana,geographic 2D,6250,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4251,Liberia 1964,,,,Liberia,geographic 2D,6251,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4252,Lome,,,,Togo,geographic 2D,6252,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4253,Luzon 1911,,,,Philippines,geographic 2D,6253,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4254,Hito XVIII 1963,,,,Chile - Tierra del Fuego,geographic 2D,6254,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4255,Herat North,,,,Afghanistan,geographic 2D,6255,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4256,Mahe 1971,,,,Seychelles,geographic 2D,6256,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4257,Makassar,,,,Indonesia - south west Sulawesi,geographic 2D,6257,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4258,ETRF89,,,,Europe - Hungary; Norway; Sweden; United Kingdom (UKCS) offshore.,geographic 2D,6258,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,Norwegian Geodetic Institute geodetic publication 1990:1,EPSG,,97.11  99.11
+4259,Malongo 1987,,,,Angola - Cabinda offshore,geographic 2D,6259,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,Chevron Petroleum Technology,EPSG,Offshore extension of Mhast GeogCS (4264) using Transit translocation from Station Y at Malongo base camp.,
+4260,Manoca,,,,Cameroon,geographic 2D,6260,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4261,Merchich,,,,Morocco,geographic 2D,6261,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4262,Massawa,,,,Eritrea,geographic 2D,6262,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4263,Minna,,,,Nigeria,geographic 2D,6263,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4264,Mhast,,,,Angola - Cabinda,geographic 2D,6264,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4265,Monte Mario,,,,Italy,geographic 2D,6265,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4266,M'poraloko,,,,Gabon,geographic 2D,6266,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4267,NAD27,,,,North and central America - Canada; Mexico; United States (USA).,geographic 2D,6267,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,Note: this coordinate system includes longitudes which are POSITIVE EAST.  Superseded by NAD27(76) (code 4608) in Ontario and CGQ77 (code 4609) in Quebec.,99.04
+4268,NAD27 Michigan,NAD Michigan,,,United States (USA) - Michigan,geographic 2D,6268,8901,North,East,Lat,Long,,9108,,,1996-12-12 00:00:00,,EPSG,Ellipsoid taken to be 800ft above geoid. Note: this coordinate system includes longitudes which are POSITIVE EAST.,96.28
+4269,NAD83,,,,Canada: Greenland; Mexico; United States (USA),geographic 2D,6269,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,Note: this coordinate system includes longitudes which are POSITIVE EAST.,
+4270,Nahrwan 1967,,,,Arabian Gulf; Kuwait; United Arab Emirates (UAE) - Abu Dhabi; Dubai; Sharjah; Ajman; Fujairah; Ras Al Kaimah; Umm Al Qaiwain.,geographic 2D,6270,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4271,Naparima 1972,,,,Trinidad and Tobago,geographic 2D,6271,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4272,GD49,,,,New Zealand,geographic 2D,6272,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4273,NGO 1948,,,,Norway - onshore,geographic 2D,6273,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4274,Datum 73,,,,Portugal - onshore,geographic 2D,6274,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,Instituto Geografico e Cadastral; Lisbon,EPSG,,
+4275,NTF,,,,France - onshore,geographic 2D,6275,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4276,NSWC 9Z-2,,,,World,geographic 2D,6276,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4277,OSGB 1936,,,,United Kingdom (UK) - Great Britain - England  Scotland  Wales - onshore; Isle of Man.,geographic 2D,6277,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4278,OSGB70,,,,United Kingdom (UK) - Great Britain - England  Scotland  wales - onshore,geographic 2D,6278,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4279,OS(SN)80,,,,Ireland - onshore; United Kingdom (UK) - England  Scotland  Wales  Northern Ireland - onshore E,geographic 2D,6279,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4280,Padang,,,,Indonesia - Sumatra,geographic 2D,6280,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4281,Palestine 1923,,,,Israel; Jordan; Lebanon,geographic 2D,6281,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4282,Pointe Noire,,,,Congo,geographic 2D,6282,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4283,GDA94,,,,Australia,geographic 2D,6283,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,,
+4284,Pulkovo 1942,,,,Armenia; Azerbaijan; Belarus; Estonia; Georgia; Kazakstan; Kirgistan; Latvia; Lithuania; Moldova; Russia; Tadzhikstan; Turkmenistan; Ukraine; Uzbekistan; Germany (former DDR); Czech Republic; Hungary; Poland; Romania; Latvia; Lithuania; Estonia; Albania,geographic 2D,6284,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4285,Qatar,,,,Qatar - onshore,geographic 2D,6285,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4286,Qatar 1948,,,,Qatar - onshore,geographic 2D,6286,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4287,Qornoq,,,,Greenland,geographic 2D,6287,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4288,Loma Quintana,,,,Venezuela - north,geographic 2D,6288,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4289,Amersfoort,,,,Netherlands - onshore,geographic 2D,6289,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4291,SAD69,,,,South America - Brazil,geographic 2D,6291,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.251.  Error introduced if not using the truncated precision is 0 to 31mm.,97.252
+4292,Sapper Hill 1943,,,,Falkland Islands,geographic 2D,6292,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4293,Schwarzeck,,,,Namibia,geographic 2D,6293,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4294,Segora,,,,Indonesia - southeast Kalimantan,geographic 2D,6294,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4295,Serindung,,,,Indonesia - east Kalimantan,geographic 2D,6295,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4296,Sudan,,,,Sudan - south,geographic 2D,6296,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4297,Tananarive,,,,Madagascar,geographic 2D,6297,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4298,Timbalai 1948,,,,Brunei; Malaysia - East Malaysia (Sabah; Sarawak).,geographic 2D,6298,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,Adopts metric conversion of 39.370147 inches per metre.,
+4299,TM65,,,,Ireland - onshore; United Kingdom (UK) - Northern Ireland (Ulster) onshore,geographic 2D,6299,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4300,TM75,,,,Ireland - onshore; United Kingdom (UK) - Northern Ireland (Ulster) onshore,geographic 2D,6300,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4301,Tokyo,,,,Japan; North Korea; South Korea,geographic 2D,6301,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4302,Trinidad 1903,,,,Trinidad and Tobago - Trinidad,geographic 2D,6302,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4303,TC(1948),,,,United Arab Emirates (UAE) - Abu Dhabi; Dubai,geographic 2D,6303,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4304,Voirol 1875,,,,Algeria - north of 32 deg N,geographic 2D,6304,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,IGN Paris,EPSG,,
+4305,Voirol Unifie,,,,Algeria - north of 32 deg N,geographic 2D,6305,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,"\"Le System Geodesique Nord-Sahara\"; IGN Paris",EPSG,,
+4306,Bern 1938,,,,Liechtenstein; Switzerland,geographic 2D,6306,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,Used for the geographic coordinates overprinted on topographic maps constructed on the CH1903 / LV03 projected CS (code 21781).,
+4307,Nord Sahara 1959,,,,Algeria; Morocco; Tunisia,geographic 2D,6307,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,"\"Le System Geodesique Nord-Sahara\"; IGN Paris",EPSG,,
+4308,RT38,,,,Sweden,geographic 2D,6308,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,97.09
+4309,Yacare,,,,Uruguay,geographic 2D,6309,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4310,Yoff,,,,Senegal,geographic 2D,6310,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4311,Zanderij,,,,Suriname,geographic 2D,6311,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4312,MGI,,,,Austria; Yugoslavia,geographic 2D,6312,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,,
+4313,Belge 1972,,,,Belgium - onshore,geographic 2D,6313,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4314,DHDN,,,,Germany - onshore,geographic 2D,6314,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4315,Conakry 1905,,,,Guinea,geographic 2D,6315,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4316,Dealul Piscului 1933,,,,Romania,geographic 2D,6316,8901,North,East,Lat,Long,,9108,,,1996-04-12 00:00:00,,EPSG,Superseded by 1970 system (geogCS code 4317).,
+4317,Dealul Piscului 1970,,,,Romania,geographic 2D,6317,8901,North,East,Lat,Long,,9108,,,1996-04-12 00:00:00,,EPSG,Supersedes 1933 system (geogCS code 4316).,
+4318,NGN,,,,Kuwait,geographic 2D,6318,8901,North,East,Lat,Long,,9108,,,1996-04-12 00:00:00,,EPSG,,
+4319,KUDAMS,,,,Kuwait - Kuwait City,geographic 2D,6319,8901,North,East,Lat,Long,,9108,,,1996-04-12 00:00:00,,EPSG,,
+4322,WGS 72,,,,World,geographic 2D,6322,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,GeogCS code 4323 reserved for use with  ProjCS's.,
+4324,WGS 72BE,,,,World,geographic 2D,6324,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,GeogCS code 4325 reserved for use with  ProjCS's.,
+4326,WGS 84,,,,World,geographic 2D,6326,8901,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,GeogCS code 4327 reserved for use with  ProjCS's.,
+4600,Anguilla 1957,,,,Anguilla,geographic 2D,6600,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,,EPSG,,
+4601,Antigua 1943,,,,Antigua and Barbuda - Antigua,geographic 2D,6601,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,,EPSG,,
+4602,Dominica 1945,,,,Dominica,geographic 2D,6602,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,,EPSG,,
+4603,Grenada 1953,,,,Grenada (including Grenada Grenadines),geographic 2D,6603,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,,EPSG,,
+4604,Montserrat 1958,,,,Montserrat,geographic 2D,6604,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,,EPSG,,
+4605,St. Kitts 1955,,,,Saint Kitts and Nevis,geographic 2D,6605,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,,EPSG,,
+4606,St. Lucia 1955,,,,Saint Lucia,geographic 2D,6606,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,,EPSG,,
+4607,St. Vincent 1945,,,,Saint Vincent and the Grenadines,geographic 2D,6607,8901,North,East,Lat,Long,,9108,,,1999-04-22 00:00:00,,EPSG,,
+4608,NAD27(76),,,,Canada - Ontario,geographic 2D,6608,8901,North,East,Lat,Long,,9108,,,1999-05-12 00:00:00,,EPSG,Note: this coordinate system includes longitudes which are POSITIVE EAST.,
+4609,NAD27(CGQ77),CGQ77,,,Canada - Quebec,geographic 2D,6609,8901,North,East,Lat,Long,,9108,,,1999-05-12 00:00:00,,EPSG,Note: this coordinate system includes longitudes which are POSITIVE EAST.,
+4801,Bern 1898 (Bern),,,,Liechtenstein; Switzerland,geographic 2D,6149,8907,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4802,Bogota (Bogota),,,,Colombia,geographic 2D,6218,8904,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4803,Lisbon (Lisbon),,,,Portugal - onshore,geographic 2D,6207,8902,North,East,Lat,Long,,9108,,,1997-04-11 00:00:00,Instituto Geografico e Cadastral; Lisbon,EPSG,,97.12
+4804,Makassar (Jakarta),,,,Indonesia - south west Sulawesi,geographic 2D,6257,8908,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4805,MGI (Ferro),,,,Austria; Yugoslavia,geographic 2D,6312,8909,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,Bundesamt fur Eich- und Vermessungswesen; Wien,EPSG,,
+4806,Monte Mario (Rome),,,,Italy,geographic 2D,6265,8906,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4807,NTF (Paris),,,,France - onshore,geographic 2D,6275,8903,North,East,Lat,Long,,9105,,,1995-06-02 00:00:00,,EPSG,,
+4808,Padang (Jakarta),,,,Indonesia - Sumatra,geographic 2D,6280,8908,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4809,Belge 1950 (Brussels),,,,Belgium - onshore,geographic 2D,6215,8910,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4810,Tananarive (Paris),,,,Madagascar,geographic 2D,6297,8903,North,East,Lat,Long,,9105,,,1995-06-02 00:00:00,,EPSG,,
+4811,Voirol 1875 (Paris),,,,Algeria - north of 32 deg N,geographic 2D,6304,8903,North,East,Lat,Long,,9105,,,1995-06-02 00:00:00,IGN Paris,EPSG,,
+4812,Voirol Unifie (Paris),,,,Algeria - north of 32 deg N,geographic 2D,6305,8903,North,East,Lat,Long,,9105,,,1995-06-02 00:00:00,"\"Le System Geodesique Nord-Sahara\"; IGN Paris",EPSG,,
+4813,Batavia (Jakarta),,,,Indonesia - Java,geographic 2D,6211,8908,North,East,Lat,Long,,9108,,,1995-06-02 00:00:00,,EPSG,,
+4814,RT38 (Stockholm),,,,Sweden,geographic 2D,6308,8911,North,East,Lat,Long,,9108,,,1996-04-12 00:00:00,,EPSG,,
+4815,Greek (Athens),,,,Greece,geographic 2D,6120,8912,North,East,Lat,Long,,9108,,,1997-06-16 00:00:00,Topography Department; National Technical University of Greece.,EPSG,,
+4816,Carthage (Paris),,,,Tunisia,geographic 2D,6223,8903,North,East,Lat,Long,,9105,,,1998-11-11 00:00:00,,EPSG,Superseded by Greenwich-based Carthage geogCS.,
+4817,NGO 1948 (Oslo),,,,Norway - onshore,geographic 2D,6273,8913,North,East,Lat,Long,,9108,,,1999-10-20 00:00:00,,EPSG,,
+4901,ATF (Paris),,,,France,geographic 2D,6901,8903,North,East,Lat,Long,,9105,,,1995-06-02 00:00:00,,EPSG,,
+4902,NDG (Paris),,,,France - Alsace,geographic 2D,6902,8903,North,East,Lat,Long,,9105,,,1995-06-02 00:00:00,,EPSG,,
+4903,Madrid 1870 (Madrid),,,,Spain,geographic 2D,6903,8905,North,East,Lat,Long,,9108,,,1998-11-11 00:00:00,Institut de Geomatica; Barcelona.,EPSG,,
+20004,Pulkovo 1995 / Gauss-Kruger zone 4,1995 Coord. Sys. zone 4,,,Russia - west of 24 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16204,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20005,Pulkovo 1995 / Gauss-Kruger zone 5,1995 Coord. Sys. zone 5,,,Russia - 24 deg to 30 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16205,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20006,Pulkovo 1995 / Gauss-Kruger zone 6,1995 Coord. Sys. zone 6,,,Russia - 30 deg to 36 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16206,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20007,Pulkovo 1995 / Gauss-Kruger zone 7,1995 Coord. Sys. zone 7,,,Russia - 36 deg to 42 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16207,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20008,Pulkovo 1995 / Gauss-Kruger zone 8,1995 Coord. Sys. zone 8,,,Russia - 42 deg to 48 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16208,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20009,Pulkovo 1995 / Gauss-Kruger zone 9,1995 Coord. Sys. zone 9,,,Russia - 48 deg to 54 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16209,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20010,Pulkovo 1995 / Gauss-Kruger zone 10,1995 Coord. Sys. zone 10,,,Russia - 54 deg  to 60 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16210,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20011,Pulkovo 1995 / Gauss-Kruger zone 11,1995 Coord. Sys. zone 11,,,Russia - 60 deg to 66 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16211,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20012,Pulkovo 1995 / Gauss-Kruger zone 12,1995 Coord. Sys. zone 12,,,Russia - 66 deg to 72 deg East .,projected 2D,,,North,East,X,Y,9001,,4200,16212,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20013,Pulkovo 1995 / Gauss-Kruger zone 13,1995 Coord. Sys. zone 13,,,Russia - 72 deg to 78 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16213,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20014,Pulkovo 1995 / Gauss-Kruger zone 14,1995 Coord. Sys. zone 14,,,Russia - 78 deg to 84 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16214,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20015,Pulkovo 1995 / Gauss-Kruger zone 15,1995 Coord. Sys. zone 15,,,Russia - 84 deg to 90 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16215,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20016,Pulkovo 1995 / Gauss-Kruger zone 16,1995 Coord. Sys. zone 16,,,Russia - 90 deg to 96 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16216,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20017,Pulkovo 1995 / Gauss-Kruger zone 17,1995 Coord. Sys. zone 17,,,Russia - 96 deg to 102deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16217,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20018,Pulkovo 1995 / Gauss-Kruger zone 18,1995 Coord. Sys. zone 18,,,Russia - 102 deg to 108 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16218,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20019,Pulkovo 1995 / Gauss-Kruger zone 19,1995 Coord. Sys. zone 19,,,Russia - 108 deg to 114 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16219,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20020,Pulkovo 1995 / Gauss-Kruger zone 20,1995 Coord. Sys. zone 20,,,Russia - 114 deg to 120 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16220,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20021,Pulkovo 1995 / Gauss-Kruger zone 21,1995 Coord. Sys. zone 21,,,Russia - 120 deg to 126 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16221,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20022,Pulkovo 1995 / Gauss-Kruger zone 22,1995 Coord. Sys. zone 22,,,Russia - 126 deg to 132 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16222,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20023,Pulkovo 1995 / Gauss-Kruger zone 23,1995 Coord. Sys. zone 23,,,Russia - 132 deg to 138 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16223,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20024,Pulkovo 1995 / Gauss-Kruger zone 24,1995 Coord. Sys. zone 24,,,Russia - 138 deg to 144 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16224,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20025,Pulkovo 1995 / Gauss-Kruger zone 25,1995 Coord. Sys. zone 25,,,Russia - 144 deg to 150 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16225,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20026,Pulkovo 1995 / Gauss-Kruger zone 26,1995 Coord. Sys. zone 26,,,Russia - 150 deg to 156 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16226,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20027,Pulkovo 1995 / Gauss-Kruger zone 27,1995 Coord. Sys. zone 27,,,Russia - 156 deg to 162 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16227,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20028,Pulkovo 1995 / Gauss-Kruger zone 28,1995 Coord. Sys. zone 28,,,Russia - 162 deg to 168 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16228,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20029,Pulkovo 1995 / Gauss-Kruger zone 29,1995 Coord. Sys. zone 29,,,Russia - 168 deg to 174 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16229,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20030,Pulkovo 1995 / Gauss-Kruger zone 30,1995 Coord. Sys. zone 30,,,Russia - 174 deg East to 180 deg.,projected 2D,,,North,East,X,Y,9001,,4200,16230,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20031,Pulkovo 1995 / Gauss-Kruger zone 31,1995 Coord. Sys. zone 31,,,Russia - 180 deg to 174 deg West.,projected 2D,,,North,East,X,Y,9001,,4200,16231,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20032,Pulkovo 1995 / Gauss-Kruger zone 32,1995 Coord. Sys. zone 32,,,Russia - east of 174 deg West.,projected 2D,,,North,East,X,Y,9001,,4200,16232,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20064,Pulkovo 1995 / Gauss-Kruger 4N,Pulkovo 1995 / Gauss 4N,,,Russia - west of 24 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16304,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20065,Pulkovo 1995 / Gauss-Kruger 5N,Pulkovo 1995 / Gauss 5N,,,Russia - 24 deg to 30 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16305,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20066,Pulkovo 1995 / Gauss-Kruger 6N,Pulkovo 1995 / Gauss 6N,,,Russia - 30 deg to 36 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16306,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20067,Pulkovo 1995 / Gauss-Kruger 7N,Pulkovo 1995 / Gauss 7N,,,Russia - 36 deg to 42 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16307,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20068,Pulkovo 1995 / Gauss-Kruger 8N,Pulkovo 1995 / Gauss 8N,,,Russia - 42 deg to 48 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16308,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20069,Pulkovo 1995 / Gauss-Kruger 9N,Pulkovo 1995 / Gauss 9N,,,Russia - 48 deg to 54 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16309,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20070,Pulkovo 1995 / Gauss-Kruger 10N,Pulkovo 1995 / Gauss 10N,,,Russia - 54 deg  to 60 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16310,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20071,Pulkovo 1995 / Gauss-Kruger 11N,Pulkovo 1995 / Gauss 11N,,,Russia - 60 deg to 66 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16311,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20072,Pulkovo 1995 / Gauss-Kruger 12N,Pulkovo 1995 / Gauss 12N,,,Russia - 66 deg to 72 deg East .,projected 2D,,,North,East,X,Y,9001,,4200,16312,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20073,Pulkovo 1995 / Gauss-Kruger 13N,Pulkovo 1995 / Gauss 13N,,,Russia - 72 deg to 78 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16313,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20074,Pulkovo 1995 / Gauss-Kruger 14N,Pulkovo 1995 / Gauss 14N,,,Russia - 78 deg to 84 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16314,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20075,Pulkovo 1995 / Gauss-Kruger 15N,Pulkovo 1995 / Gauss 15N,,,Russia - 84 deg to 90 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16315,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20076,Pulkovo 1995 / Gauss-Kruger 16N,Pulkovo 1995 / Gauss 16N,,,Russia - 90 deg to 96 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16316,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20077,Pulkovo 1995 / Gauss-Kruger 17N,Pulkovo 1995 / Gauss 17N,,,Russia - 96 deg to 102deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16317,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20078,Pulkovo 1995 / Gauss-Kruger 18N,Pulkovo 1995 / Gauss 18N,,,Russia - 102 deg to 108 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16318,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20079,Pulkovo 1995 / Gauss-Kruger 19N,Pulkovo 1995 / Gauss 19N,,,Russia - 108 deg to 114 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16319,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20080,Pulkovo 1995 / Gauss-Kruger 20N,Pulkovo 1995 / Gauss 20N,,,Russia - 114 deg to 120 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16320,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20081,Pulkovo 1995 / Gauss-Kruger 21N,Pulkovo 1995 / Gauss 21N,,,Russia - 120 deg to 126 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16321,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20082,Pulkovo 1995 / Gauss-Kruger 22N,Pulkovo 1995 / Gauss 22N,,,Russia - 126 deg to 132 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16322,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20083,Pulkovo 1995 / Gauss-Kruger 23N,Pulkovo 1995 / Gauss 23N,,,Russia - 132 deg to 138 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16323,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20084,Pulkovo 1995 / Gauss-Kruger 24N,Pulkovo 1995 / Gauss 24N,,,Russia - 138 deg to 144 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16324,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20085,Pulkovo 1995 / Gauss-Kruger 25N,Pulkovo 1995 / Gauss 25N,,,Russia - 144 deg to 150 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16325,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20086,Pulkovo 1995 / Gauss-Kruger 26N,Pulkovo 1995 / Gauss 26N,,,Russia - 150 deg to 156 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16326,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20087,Pulkovo 1995 / Gauss-Kruger 27N,Pulkovo 1995 / Gauss 27N,,,Russia - 156 deg to 162 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16327,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20088,Pulkovo 1995 / Gauss-Kruger 28N,Pulkovo 1995 / Gauss 28N,,,Russia - 162 deg to 168 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16328,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20089,Pulkovo 1995 / Gauss-Kruger 29N,Pulkovo 1995 / Gauss 29N,,,Russia - 168 deg to 174 deg East.,projected 2D,,,North,East,X,Y,9001,,4200,16329,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20090,Pulkovo 1995 / Gauss-Kruger 30N,Pulkovo 1995 / Gauss 30N,,,Russia - 174 deg East to 180 deg.,projected 2D,,,North,East,X,Y,9001,,4200,16330,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20091,Pulkovo 1995 / Gauss-Kruger 31N,Pulkovo 1995 / Gauss 31N,,,Russia - 180 deg to 174 deg West.,projected 2D,,,North,East,X,Y,9001,,4200,16331,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20092,Pulkovo 1995 / Gauss-Kruger 32N,Pulkovo 1995 / Gauss 32N,,,Russia - east of 174 deg West.,projected 2D,,,North,East,X,Y,9001,,4200,16332,1996-09-12 00:00:00,"\"Main Terms of Reference for the State Geodetic Network\"; Federal Geodetic Service of Russia; 1994",EPSG,,
+20137,Adindan / UTM zone 37N,,,,Ethiopia - west of 42 degrees East.  Sudan - west of 42 degrees East.,projected 2D,,,East,North,E,N,9001,,4201,16037,1995-06-02 00:00:00,,EPSG,,
+20138,Adindan / UTM zone 38N,,,,Ethiopia - east of 42 degrees East.  Sudan - east of 42 degrees East.,projected 2D,,,East,North,E,N,9001,,4201,16038,1995-06-02 00:00:00,,EPSG,,
+20248,AGD66 / AMG zone 48,,,,Australia - 102deg East to 108deg East.,projected 2D,,,East,North,E,N,9001,,4202,17448,1995-06-02 00:00:00,,EPSG,,
+20249,AGD66 / AMG zone 49,,,,Australia - 108deg East to 114deg East.,projected 2D,,,East,North,E,N,9001,,4202,17449,1995-06-02 00:00:00,,EPSG,,
+20250,AGD66 / AMG zone 50,,,,Australia - 114deg East to 120deg East.,projected 2D,,,East,North,E,N,9001,,4202,17450,1995-06-02 00:00:00,,EPSG,,
+20251,AGD66 / AMG zone 51,,,,Australia - 120deg East to 126deg East.,projected 2D,,,East,North,E,N,9001,,4202,17451,1995-06-02 00:00:00,,EPSG,,
+20252,AGD66 / AMG zone 52,,,,Australia - 126deg East to 132deg East.,projected 2D,,,East,North,E,N,9001,,4202,17452,1995-06-02 00:00:00,,EPSG,,
+20253,AGD66 / AMG zone 53,,,,Australia - 132deg East to 138deg East.,projected 2D,,,East,North,E,N,9001,,4202,17453,1995-06-02 00:00:00,,EPSG,,
+20254,AGD66 / AMG zone 54,,,,Australia - 138deg East to 144deg East.  Papua New Guinea - west of 144deg East.,projected 2D,,,East,North,E,N,9001,,4202,17454,1995-06-02 00:00:00,,EPSG,,
+20255,AGD66 / AMG zone 55,,,,Australia - 144deg East to 150deg East.  Papua New Guinea - 144deg East to 150deg East.,projected 2D,,,East,North,E,N,9001,,4202,17455,1995-06-02 00:00:00,,EPSG,,
+20256,AGD66 / AMG zone 56,,,,Australia - 150deg East to 156deg East.,projected 2D,,,East,North,E,N,9001,,4202,17456,1995-06-02 00:00:00,,EPSG,,
+20257,AGD66 / AMG zone 57,,,,Australia - 156deg East to 162deg East.,projected 2D,,,East,North,E,N,9001,,4202,17457,1995-06-02 00:00:00,,EPSG,,
+20258,AGD66 / AMG zone 58,,,,Australia - 162deg East to 168deg East.,projected 2D,,,East,North,E,N,9001,,4202,17458,1995-06-02 00:00:00,,EPSG,,
+20348,AGD84 / AMG zone 48,,,,Australia - 102deg East to 108deg East.,projected 2D,,,East,North,E,N,9001,,4203,17448,1995-06-02 00:00:00,,EPSG,,
+20349,AGD84 / AMG zone 49,,,,Australia - 108deg East to 114deg East.,projected 2D,,,East,North,E,N,9001,,4203,17449,1995-06-02 00:00:00,,EPSG,,
+20350,AGD84 / AMG zone 50,,,,Australia - 114deg East to 120deg East.,projected 2D,,,East,North,E,N,9001,,4203,17450,1995-06-02 00:00:00,,EPSG,,
+20351,AGD84 / AMG zone 51,,,,Australia - 120deg East to 126deg East.,projected 2D,,,East,North,E,N,9001,,4203,17451,1995-06-02 00:00:00,,EPSG,,
+20352,AGD84 / AMG zone 52,,,,Australia - 126deg East to 132deg East.,projected 2D,,,East,North,E,N,9001,,4203,17452,1995-06-02 00:00:00,,EPSG,,
+20353,AGD84 / AMG zone 53,,,,Australia - 132deg East to 138deg East.,projected 2D,,,East,North,E,N,9001,,4203,17453,1995-06-02 00:00:00,,EPSG,,
+20354,AGD84 / AMG zone 54,,,,Australia - 138deg East to 144deg East.  Papua - New Guinea west of 144deg East.,projected 2D,,,East,North,E,N,9001,,4203,17454,1995-06-02 00:00:00,,EPSG,,
+20355,AGD84 / AMG zone 55,,,,Australia - 144deg East to 150deg East.  Papua New Guinea - 144deg East to 150deg East.,projected 2D,,,East,North,E,N,9001,,4203,17455,1995-06-02 00:00:00,,EPSG,,
+20356,AGD84 / AMG zone 56,,,,Australia - 150deg East to 156deg East.,projected 2D,,,East,North,E,N,9001,,4203,17456,1995-06-02 00:00:00,,EPSG,,
+20357,AGD84 / AMG zone 57,,,,Australia - 156deg East to 162deg East.,projected 2D,,,East,North,E,N,9001,,4203,17457,1995-06-02 00:00:00,,EPSG,,
+20358,AGD84 / AMG zone 58,,,,Australia - 162deg East to 168deg East.,projected 2D,,,East,North,E,N,9001,,4203,17458,1995-06-02 00:00:00,,EPSG,,
+20437,Ain el Abd / UTM zone 37N,Ain el Abd / UTM 37N,,,Saudi Arabia - west of 42 degrees East.,projected 2D,,,East,North,E,N,9001,,4204,16037,1997-11-13 00:00:00,,EPSG,,97.59
+20438,Ain el Abd / UTM zone 38N,Ain el Abd / UTM 38N,,,Kuwait.  Saudi Arabia - between 42 degrees and 48 degrees East.,projected 2D,,,East,North,E,N,9001,,4204,16038,1997-11-13 00:00:00,,EPSG,"Known in Kuwait as \"KOC UTM\".",97.59
+20439,Ain el Abd / UTM zone 39N,Ain el Abd / UTM 39N,,,Saudi Arabia - east of 48 degrees East.,projected 2D,,,East,North,E,N,9001,,4204,16039,1997-11-13 00:00:00,,EPSG,,97.59
+20499,Ain el Abd / Bahrain Grid,,,,Bahrain.,projected 2D,,,East,North,E,N,9001,,4204,19900,1995-06-02 00:00:00,,EPSG,,
+20538,Afgooye / UTM zone 38N,,,,Somalia - west of 48 degrees East.,projected 2D,,,East,North,E,N,9001,,4205,16038,1995-06-02 00:00:00,,EPSG,,
+20539,Afgooye / UTM zone 39N,,,,Somalia - east of 48 degrees East.,projected 2D,,,East,North,E,N,9001,,4205,16039,1995-06-02 00:00:00,,EPSG,,
+20790,Lisbon (Lisbon)/Portuguese National Grid,Lisbon / Portuguese Grid,,,Portugal - onshore.,projected 2D,,,East,North,X,Y,9001,,4803,19936,1998-11-11 00:00:00,,EPSG,,98.42
+20822,Aratu / UTM zone 22S,,,,Brazil - coastal areas south of 2 deg 55 min South and west of 48 deg West.,projected 2D,,,East,North,E,N,9001,,4208,16122,1995-07-21 00:00:00,,EPSG,,95.191
+20823,Aratu / UTM zone 23S,,,,Brazil - coastal areas south of 2 deg 55 min South and between 48 and 42 deg West; offshore Santos basin.,projected 2D,,,East,North,E,N,9001,,4208,16123,1995-07-21 00:00:00,,EPSG,,95.191
+20824,Aratu / UTM zone 24S,,,,Brazil - coastal areas south of 2 deg 55 min South and east of 42 deg West; offshore Campos basin.,projected 2D,,,East,North,E,N,9001,,4208,16124,1995-07-21 00:00:00,,EPSG,,95.191
+20934,Arc 1950 / UTM zone 34S,,,,Botswana & Zambia - west of 24 deg East.,projected 2D,,,East,North,E,N,9001,,4209,16134,1997-11-13 00:00:00,,EPSG,,
+20935,Arc 1950 / UTM zone 35S,,,,Botswana - east of 24 deg East; Zambia - 24 to 30 deg East; Zimbabwe west of 30 deg East .,projected 2D,,,East,North,E,N,9001,,4209,16135,1997-11-13 00:00:00,,EPSG,,
+20936,Arc 1950 / UTM zone 36S,,,,Malawi; Zambia & Zimbabwe - east of 30 deg East.,projected 2D,,,East,North,E,N,9001,,4209,16136,1997-11-13 00:00:00,,EPSG,,
+21035,Arc 1960 / UTM zone 35S,,,,Tanzania - west of 30 deg East; Uganda south of equator and west of 30 deg East.,projected 2D,,,East,North,E,N,9001,,4210,16135,1997-11-13 00:00:00,,EPSG,,
+21036,Arc 1960 / UTM zone 36S,,,,Kenya - south of equator and west of 36 deg East; Tanzania - 30 to 36 deg East; Uganda south of equator and east of 30 deg East.,projected 2D,,,East,North,E,N,9001,,4210,16136,1997-11-13 00:00:00,,EPSG,,
+21037,Arc 1960 / UTM zone 37S,,,,Kenya - south of equator and east of 36 deg East; Tanzania - east of 36 deg East.,projected 2D,,,East,North,E,N,9001,,4210,16137,1997-11-13 00:00:00,,EPSG,,
+21095,Arc 1960 / UTM zone 35N,,,,Uganda north of equator and west of 30 deg East.,projected 2D,,,East,North,E,N,9001,,4210,16035,1997-11-13 00:00:00,,EPSG,,
+21096,Arc 1960 / UTM zone 36N,,,,Kenya - north of equator and west of 36 deg East; Uganda north of equator and east of 30 deg East.,projected 2D,,,East,North,E,N,9001,,4210,16036,1997-11-13 00:00:00,,EPSG,,
+21097,Arc 1960 / UTM zone 37N,,,,Kenya - north of equator and east of 36 deg East.,projected 2D,,,East,North,E,N,9001,,4210,16037,1997-11-13 00:00:00,,EPSG,,
+21100,Batavia (Jakarta) / NEIEZ,Batavia / NEIEZ,,,Indonesia - Java.,projected 2D,,,East,North,X,Y,9001,,4813,19905,1995-06-02 00:00:00,,EPSG,,
+21148,Batavia / UTM zone 48S,,,,Indonesia - Java west of 108 deg East.,projected 2D,,,East,North,E,N,9001,,4211,16148,1995-06-02 00:00:00,,EPSG,,
+21149,Batavia / UTM zone 49S,,,,Indonesia - Java between 108 and 114 deg East.,projected 2D,,,East,North,E,N,9001,,4211,16149,1995-06-02 00:00:00,,EPSG,,
+21150,Batavia / UTM zone 50S,,,,Indonesia - Java east of 114 deg East.,projected 2D,,,East,North,E,N,9001,,4211,16150,1995-06-02 00:00:00,,EPSG,,
+21291,Barbados 1938 / British West Indies Grid,Barbados 1938 / BWI Grid,,,Barbados,projected 2D,,,East,North,E,N,9001,,4212,19942,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,Superseded by Barbados National Grid (code 21292) from 1983.,
+21292,Barbados 1938 / Barbados National Grid,Barbados NationaI Grid,,,Barbados,projected 2D,,,East,North,E,N,9001,,4212,19943,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,Supersedes Barbados 1938 / BWI Grid (code 21291) from 1983.,
+21413,Beijing 1954 / Gauss-Kruger zone 13,Beijing / Gauss zone 13,,,China - west of 78 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16213,1995-06-02 00:00:00,,EPSG,,
+21414,Beijing 1954 / Gauss-Kruger zone 14,Beijing / Gauss zone 14,,,China - 78 deg East  to 84 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16214,1995-06-02 00:00:00,,EPSG,,
+21415,Beijing 1954 / Gauss-Kruger zone 15,Beijing / Gauss zone 15,,,China - 84 deg East  to 90 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16215,1995-06-02 00:00:00,,EPSG,,
+21416,Beijing 1954 / Gauss-Kruger zone 16,Beijing / Gauss zone 16,,,China - 90 deg East  to 96 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16216,1995-06-02 00:00:00,,EPSG,,
+21417,Beijing 1954 / Gauss-Kruger zone 17,Beijing / Gauss zone 17,,,China - 96 deg East  to 102eg E,projected 2D,,,North,East,X,Y,9001,,4214,16217,1995-06-02 00:00:00,,EPSG,,
+21418,Beijing 1954 / Gauss-Kruger zone 18,Beijing / Gauss zone 18,,,China - 102 deg East  to 108 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16218,1995-06-02 00:00:00,,EPSG,,
+21419,Beijing 1954 / Gauss-Kruger zone 19,Beijing / Gauss zone 19,,,China - 108 deg East  to 114 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16219,1995-06-02 00:00:00,,EPSG,,
+21420,Beijing 1954 / Gauss-Kruger zone 20,Beijing / Gauss zone 20,,,China - 114 deg East  to 120 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16220,1995-06-02 00:00:00,,EPSG,,
+21421,Beijing 1954 / Gauss-Kruger zone 21,Beijing / Gauss zone 21,,,China - 120 deg East  to 126 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16221,1995-06-02 00:00:00,,EPSG,,
+21422,Beijing 1954 / Gauss-Kruger zone 22,Beijing / Gauss zone 22,,,China - 126 deg East  to 132 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16222,1995-06-02 00:00:00,,EPSG,,
+21423,Beijing 1954 / Gauss-Kruger zone 23,Beijing / Gauss zone 23,,,China - east of 132 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16223,1995-06-02 00:00:00,,EPSG,,
+21473,Beijing 1954 / Gauss-Kruger 13N,Beijing / Gauss 13N,,,China - west of 78 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16313,1995-06-02 00:00:00,,EPSG,,
+21474,Beijing 1954 / Gauss-Kruger 14N,Beijing / Gauss 14N,,,China - 78 deg East  to 84 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16314,1995-06-02 00:00:00,,EPSG,,
+21475,Beijing 1954 / Gauss-Kruger 15N,Beijing / Gauss 15N,,,China - 84 deg East  to 90 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16315,1995-06-02 00:00:00,,EPSG,,
+21476,Beijing 1954 / Gauss-Kruger 16N,Beijing / Gauss 16N,,,China - 90 deg East  to 96 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16316,1995-06-02 00:00:00,,EPSG,,
+21477,Beijing 1954 / Gauss-Kruger 17N,Beijing / Gauss 17N,,,China - 96 deg East  to 102eg E,projected 2D,,,North,East,X,Y,9001,,4214,16317,1995-06-02 00:00:00,,EPSG,,
+21478,Beijing 1954 / Gauss-Kruger 18N,Beijing / Gauss 18N,,,China - 102 deg East  to 108 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16318,1995-06-02 00:00:00,,EPSG,,
+21479,Beijing 1954 / Gauss-Kruger 19N,Beijing / Gauss 19N,,,China - 108 deg East  to 114 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16319,1995-06-02 00:00:00,,EPSG,,
+21480,Beijing 1954 / Gauss-Kruger 20N,Beijing / Gauss 20N,,,China - 114 deg East  to 120 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16320,1995-06-02 00:00:00,,EPSG,,
+21481,Beijing 1954 / Gauss-Kruger 21N,Beijing / Gauss 21N,,,China - 120 deg East  to 126 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16321,1995-06-02 00:00:00,,EPSG,,
+21482,Beijing 1954 / Gauss-Kruger 22N,Beijing / Gauss 22N,,,China - 126 deg East  to 132 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16322,1995-06-02 00:00:00,,EPSG,,
+21483,Beijing 1954 / Gauss-Kruger 23N,Beijing / Gauss 23N,,,China - east of 132 deg East.,projected 2D,,,North,East,X,Y,9001,,4214,16323,1995-06-02 00:00:00,,EPSG,,
+21500,Belge 1950 (Brussels) / Belge Lambert 50,Belge Lambert 50,,,Belgium - onshore.,projected 2D,,,East,North,X,Y,9001,,4809,19901,1997-04-11 00:00:00,,EPSG,Superseded by 31300 (Belge 1972 / Belge Lambert 72).,97.13
+21780,Bern 1898 (Bern) / LV03C,LV03C,,,Liechtenstein.  Switzerland.,projected 2D,,,East,North,Y,X,9001,,4801,19923,1997-06-30 00:00:00,,EPSG,Superseded by CH1903 / LV03 (code 21781).,97.27  97.62
+21781,CH1903 / LV03,LV03,,,Liechtenstein; Switzerland.,projected 2D,,,East,North,Y,X,9001,,4149,19922,1999-10-20 00:00:00,,EPSG,Supersedes LV03C (code 21780).  Superseded by CH1903+/LV95 (code 256).,
+21817,Bogota / UTM zone 17N,,,,Colombia - offshore west of 78 deg W of Greenwich.,projected 2D,,,East,North,E,N,9001,,4218,16017,1995-06-02 00:00:00,,EPSG,,
+21818,Bogota / UTM zone 18N,,,,Colombia - offshore east of 78 deg W of Greenwich.,projected 2D,,,East,North,E,N,9001,,4218,16018,1995-06-02 00:00:00,,EPSG,,
+21891,Bogota / Colombia West zone,Bogota / Colombia 3W,,,Colombia - west of 1 deg 30 min W of Bogota (75d 34m 51.30s W of Greenwich).,projected 2D,,,East,North,X,Y,9001,,4218,18051,1997-11-13 00:00:00,,EPSG,,97.11  97.57
+21892,Bogota / Colombia Bogota zone,Bogota / Colombia Bogota,,,Colombia - 1 deg 30 min W to 1 deg 30 min E of Bogota (75d 35m W to 72d 35m W of Greenwich).,projected 2D,,,East,North,X,Y,9001,,4218,18052,1997-11-13 00:00:00,,EPSG,,97.11  97.57
+21893,Bogota / Colombia East Central zone,Bogota / Colombia 3E,,,Colombia - 1 deg 30 min to 4 deg 30 min E of Bogota (72d 35m to 69d 34m W of Greenwich).,projected 2D,,,East,North,X,Y,9001,,4218,18053,1997-11-13 00:00:00,,EPSG,,97.11  97.57
+21894,Bogota / Colombia East,Bogota / Colombia 6E,,,Colombia - east of 4 deg 30 min E of Bogota (69d 34m 51.3s W of Greenwich).,projected 2D,,,East,North,X,Y,9001,,4218,18054,1997-11-13 00:00:00,,EPSG,,97.11  97.57
+22032,Camacupa / UTM zone 32S,,,,Angola - west of 12 deg East.,projected 2D,,,East,North,E,N,9001,,4220,16132,1997-11-13 00:00:00,,EPSG,,97.58
+22033,Camacupa / UTM zone 33S,,,,Angola - east of 12 deg East.,projected 2D,,,East,North,E,N,9001,,4220,16133,1997-11-13 00:00:00,,EPSG,,97.58
+22091,Camacupa / TM 11.30 SE,,,,Angola - offshore.,projected 2D,,,East,North,E,N,9001,,4220,16611,1998-11-11 00:00:00,Esso Angola,EPSG,Used by Esso Angola for offshore blocks 15 and 24.,
+22092,Camacupa / TM 12 SE,,,,Angola - offshore.,projected 2D,,,East,North,E,N,9001,,4220,16612,1998-11-11 00:00:00,Shell Angola,EPSG,"Used by Shell Angola for offshore blocks 1 and 16.  Used by BP Amoco, Elf and Esso for offshore blocks 31-33.",
+22191,Campo Inchauspe / Argentina 1,C Inchauspe /Argentina 1,,,Argentina - west of 70 deg 30 min West.,projected 2D,,,North,East,X,Y,9001,,4221,18031,1999-11-15 00:00:00,,EPSG,,97.72
+22192,Campo Inchauspe / Argentina 2,C Inchauspe /Argentina 2,,,Argentina - between 70 deg 30 min and 67 deg 30 min West.,projected 2D,,,North,East,X,Y,9001,,4221,18032,1999-11-15 00:00:00,,EPSG,,97.72
+22193,Campo Inchauspe / Argentina 3,C Inchauspe /Argentina 3,,,Argentina - between 67 deg 30 min and 64 deg 30 min West.,projected 2D,,,North,East,X,Y,9001,,4221,18033,1999-11-15 00:00:00,,EPSG,,97.72
+22194,Campo Inchauspe / Argentina 4,C Inchauspe /Argentina 4,,,Argentina - between 64 deg 30 min and 61 deg 30 min West.,projected 2D,,,North,East,X,Y,9001,,4221,18034,1999-11-15 00:00:00,,EPSG,,97.72
+22195,Campo Inchauspe / Argentina 5,C Inchauspe /Argentina 5,,,Argentina - between 61 deg 30 min and 58 deg 30 min West.,projected 2D,,,North,East,X,Y,9001,,4221,18035,1999-11-15 00:00:00,,EPSG,,97.72
+22196,Campo Inchauspe / Argentina 6,C Inchauspe /Argentina 6,,,Argentina - between 58 deg 30 min and 55 deg 30 min West.,projected 2D,,,North,East,X,Y,9001,,4221,18036,1999-11-15 00:00:00,,EPSG,,97.72
+22197,Campo Inchauspe / Argentina 7,C Inchauspe /Argentina 7,,,Argentina - east of 55 deg 30 min West.,projected 2D,,,North,East,X,Y,9001,,4221,18037,1999-11-15 00:00:00,,EPSG,,97.72
+22234,Cape / UTM zone 34S,,,,Botswana - west of 21deg East.,projected 2D,,,East,North,E,N,9001,,4222,16134,1995-12-08 00:00:00,,EPSG,,
+22235,Cape / UTM zone 35S,,,,Botswana - east of 27deg East.,projected 2D,,,East,North,E,N,9001,,4222,16135,1995-12-08 00:00:00,,EPSG,,
+22236,Cape / UTM zone 36S,,,,Botswana - between 21 and 27deg East.,projected 2D,,,East,North,E,N,9001,,4222,16136,1995-12-08 00:00:00,,EPSG,,
+22275,South African Coordinate System zone 15,South African CS zone 15,,,South Africa - Walvis Bay.,projected 2D,,,West,South,W,S,9001,,4222,17515,1996-04-12 00:00:00,,EPSG,,
+22277,South African Coordinate System zone 17,South African CS zone 17,,,South Africa - west of 18 deg East.,projected 2D,,,West,South,W,S,9001,,4222,17517,1996-04-12 00:00:00,,EPSG,,
+22279,South African Coordinate System zone 19,South African CS zone 19,,,South Africa - 18 to 20 deg East.,projected 2D,,,West,South,W,S,9001,,4222,17519,1996-04-12 00:00:00,,EPSG,,
+22281,South African Coordinate System zone 21,South African CS zone 21,,,South Africa - 20 to 22 deg East.,projected 2D,,,West,South,W,S,9001,,4222,17521,1996-04-12 00:00:00,,EPSG,,
+22283,South African Coordinate System zone 23,South African CS zone 23,,,South Africa - 22 to 24 deg East.,projected 2D,,,West,South,W,S,9001,,4222,17523,1996-04-12 00:00:00,,EPSG,,
+22285,South African Coordinate System zone 25,South African CS zone 25,,,Lestho  - west of 26 deg East; South Africa - 24 to 26 deg East.,projected 2D,,,West,South,W,S,9001,,4222,17525,1996-04-12 00:00:00,,EPSG,,
+22287,South African Coordinate System zone 27,South African CS zone 27,,,Lestho  - east of 26 deg East;  South Africa - 26 to 28 deg East.,projected 2D,,,West,South,W,S,9001,,4222,17527,1996-04-12 00:00:00,,EPSG,,
+22289,South African Coordinate System zone 29,South African CS zone 29,,,South Africa - 28 to 30 deg East.,projected 2D,,,West,South,W,S,9001,,4222,17529,1996-04-12 00:00:00,,EPSG,,
+22291,South African Coordinate System zone 31,South African CS zone 31,,,South Africa - 30 to 32 deg East;  Swaziland.,projected 2D,,,West,South,W,S,9001,,4222,17531,1996-04-12 00:00:00,,EPSG,,
+22293,South African Coordinate System zone 33,South African CS zone 33,,,South Africa - east of 32 deg East.,projected 2D,,,West,South,W,S,9001,,4222,17533,1996-04-12 00:00:00,,EPSG,,
+22300,Carthage (Paris) / Tunisia Mining Grid,Tunisia Mining Grid,,,Tunisia - onshore.,projected 2D,,,East,North,X,Y,9036,,4816,19937,1998-11-11 00:00:00,,EPSG,CAUTION: Carthage datum did not exist when the 1953 decree was issued and an inference is that grid should be applied to the Voirol 1875 geogCS.  Common practice assumes that the current Tunisian geodetic datum of Carthage applies.,
+22332,Carthage / UTM zone 32N,,,,Tunisia - offshore.,projected 2D,,,East,North,X,Y,9001,,4223,16032,1995-06-02 00:00:00,,EPSG,,
+22391,Carthage / Nord Tunisie,,,,Tunisia - north of 38.5 grads (34 deg 39 min) North.,projected 2D,,,East,North,X,Y,9001,,4223,18181,1995-06-02 00:00:00,,EPSG,,
+22392,Carthage / Sud Tunisie,,,,Tunisia - south of 38.5 grads (34 deg 39 min) North.,projected 2D,,,East,North,X,Y,9001,,4223,18182,1995-06-02 00:00:00,,EPSG,,
+22523,Corrego Alegre / UTM zone 23S,Corrego Alegre / UTM 23S,,,Brazil - NE coastal area between 45 deg W and 42 deg W.,projected 2D,,,East,North,E,N,9001,,4225,16123,1995-06-02 00:00:00,,EPSG,,
+22524,Corrego Alegre / UTM zone 24S,Corrego Alegre / UTM 24S,,,Brazil - NE coastal area between 42 deg W and 40 deg W.,projected 2D,,,East,North,E,N,9001,,4225,16124,1995-06-02 00:00:00,,EPSG,,
+22700,Deir ez Zor / Levant Zone,,,,Syrian Arab Republic west of 39 deg E.,projected 2D,,,East,North,X,Y,9001,,4227,19940,1999-04-22 00:00:00,,EPSG,Superseded by Deir ez Zor / Syria Lambert (EPSG code 22770) from 1973.,
+22770,Deir ez Zor / Syria Lambert,,,,Syrian Arab Republic,projected 2D,,,East,North,X,Y,9001,,4227,19948,1999-10-20 00:00:00,,EPSG,Supersedes Deir ez Zor / Levant zone (EPSG code 22700) from 1973.,
+22832,Douala / UTM zone 32N,,,,Cameroon.,projected 2D,,,East,North,E,N,9001,,4228,16032,1995-06-02 00:00:00,,EPSG,,
+22991,Egypt 1907 / Blue Belt,,,,Egypt  - Sinai peninsula.,projected 2D,,,East,North,E,N,9001,,4229,18071,1999-04-22 00:00:00,,EPSG,Also known as Egypt 1907 / Green Belt.    Oil industry usually uses Egypt 1907 / Red Belt rather than this projected CS.,
+22992,Egypt 1907 / Red Belt,,,,Egypt  - east of 29 deg East.,projected 2D,,,East,North,E,N,9001,,4229,18072,1995-06-02 00:00:00,,EPSG,See also Egypt 1907 / Blue Belt for non oil industry usage in Sinai peninsula.,
+22993,Egypt 1907 / Purple Belt,,,,Egypt -  west of 29 deg E; north of approx 28 deg 11 min North.,projected 2D,,,East,North,E,N,9001,,4229,18073,1995-06-02 00:00:00,,EPSG,,
+22994,Egypt 1907 / Extended Purple Belt,Egypt 1907 / Ext. Purple,,,Egypt  - west of 29 deg E; south of approx 28 deg 11 min North.,projected 2D,,,East,North,E,N,9001,,4229,18074,1995-06-02 00:00:00,,EPSG,,
+23028,ED50 / UTM zone 28N,,,,Europe - 18deg West to 12deg West - Ireland offshore; United Kingdom (UKCS) offshore.,projected 2D,,,East,North,E,N,9001,,4230,16028,1995-06-02 00:00:00,,EPSG,,
+23029,ED50 / UTM zone 29N,,,,Europe - 12deg West to 6deg West - Portugal; Spain; Ireland offshore; United Kingdom (UKCS) offshore.,projected 2D,,,East,North,E,N,9001,,4230,16029,1995-06-02 00:00:00,,EPSG,,
+23030,ED50 / UTM zone 30N,,,,Europe - 6deg West to 0deg - Spain; France offshore; Ireland offshore; United Kingdom - UKCS offshore - North Sea west of 0 deg East).,projected 2D,,,East,North,E,N,9001,,4230,16030,1995-06-02 00:00:00,,EPSG,,
+23031,ED50 / UTM zone 31N,,,,Europe - 0deg to 6deg East - Denmark (North Sea); Germany offshore; Netherlands offshore; Norway; United Kingdom (UKCS) offshore.,projected 2D,,,East,North,E,N,9001,,4230,16031,1995-06-02 00:00:00,,EPSG,,
+23032,ED50 / UTM zone 32N,,,,Europe - 6deg East  to 12deg East - Denmark; Germany offshore; Netherlands offshore; Norway.,projected 2D,,,East,North,E,N,9001,,4230,16032,1995-06-02 00:00:00,,EPSG,,
+23033,ED50 / UTM zone 33N,,,,Europe - 12deg East  to 18deg East - Denmark including Bornholm; Norway.,projected 2D,,,East,North,E,N,9001,,4230,16033,1995-06-02 00:00:00,,EPSG,,
+23034,ED50 / UTM zone 34N,,,,Europe - 18deg East  to 24deg East - Greece; Norway.,projected 2D,,,East,North,E,N,9001,,4230,16034,1995-06-02 00:00:00,,EPSG,,
+23035,ED50 / UTM zone 35N,,,,Europe - 24deg East  to 30deg East - Greece; Norway; Turkey.,projected 2D,,,East,North,E,N,9001,,4230,16035,1995-06-02 00:00:00,,EPSG,,
+23036,ED50 / UTM zone 36N,,,,Europe - 30deg East  to 36deg East - Turkey.,projected 2D,,,East,North,E,N,9001,,4230,16036,1995-06-02 00:00:00,,EPSG,,
+23037,ED50 / UTM zone 37N,,,,Europe - 36deg East  to 42deg East - Turkey.,projected 2D,,,East,North,E,N,9001,,4230,16037,1995-06-02 00:00:00,,EPSG,,
+23038,ED50 / UTM zone 38N,,,,Europe - 42deg East  to 48deg East - Turkey.,projected 2D,,,East,North,E,N,9001,,4230,16038,1995-06-02 00:00:00,,EPSG,,
+23090,ED50 / TM 0 N,,,,United Kingdom (UKCS) - offshore North Sea.,projected 2D,,,East,North,E,N,9001,,4230,16400,1998-11-11 00:00:00,Shell UK,EPSG,Used by Shell UK for North Sea,
+23095,ED50 / TM 5 NE,,,,Netherlands - offshore North Sea.,projected 2D,,,East,North,E,N,9001,,4230,16405,1998-11-11 00:00:00,NAM,EPSG,Used by NAM,
+23239,Fahud / UTM zone 39N,,,,Oman - west of 54 deg East.,projected 2D,,,East,North,E,N,9001,,4232,16039,1995-06-02 00:00:00,,EPSG,Since 1993 superseded by PSD93 / UTM zone 39N projCS (code 3439). Maximum differences to Fahud adjustment are 20 metres.,
+23240,Fahud / UTM zone 40N,,,,Oman - east of 54 deg East.,projected 2D,,,East,North,E,N,9001,,4232,16040,1995-06-02 00:00:00,,EPSG,Since 1993 superseded by PSD93 / UTM zone 40N projCS (code 3440). Maximum differences to Fahud adjustment are 20 metres.,
+23433,Garoua / UTM zone 33N,,,,Cameroon.,projected 2D,,,East,North,E,N,9001,,4234,16033,1995-06-02 00:00:00,,EPSG,,
+23700,HD72 / EOV,,,,Hungary,projected 2D,,,East,North,Y,X,9001,,4237,19931,1997-07-22 00:00:00,,EPSG,,
+23846,ID74 / UTM zone 46N,,,,Indonesia - north of equator and west of 96 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16046,1995-08-08 00:00:00,,EPSG,,95.193  95.20
+23847,ID74 / UTM zone 47N,,,,Indonesia - north of equator and between 96 deg and 102 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16047,1995-07-21 00:00:00,,EPSG,,95.193
+23848,ID74 / UTM zone 48N,,,,Indonesia - north of equator and between 102 deg and 108 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16048,1995-07-21 00:00:00,,EPSG,,95.193
+23849,ID74 / UTM zone 49N,,,,Indonesia - north of equator and between 108 deg and 114 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16049,1995-07-21 00:00:00,,EPSG,,95.193
+23850,ID74 / UTM zone 50N,,,,Indonesia - north of equator and between 114 deg and 120 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16050,1995-07-21 00:00:00,,EPSG,,95.193
+23851,ID74 / UTM zone 51N,,,,Indonesia - north of equator and between 120 deg and 126 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16051,1995-07-21 00:00:00,,EPSG,,95.193
+23852,ID74 / UTM zone 52N,,,,Indonesia - north of equator and between 126 deg and 132 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16052,1995-07-21 00:00:00,,EPSG,,95.193
+23853,ID74 / UTM zone 53N,,,,Indonesia - north of equator and east of 132 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16053,1995-07-21 00:00:00,,EPSG,,95.193
+23886,ID74 / UTM zone 46S,,,,Indonesia - south of equator and west of 96 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16146,1995-08-08 00:00:00,,EPSG,,95.193  95.20
+23887,ID74 / UTM zone 47S,,,,Indonesia - south of equator and between 96 deg and 102 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16147,1995-07-21 00:00:00,,EPSG,,95.193
+23888,ID74 / UTM zone 48S,,,,Indonesia - south of equator and between 102 deg and 108 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16148,1995-07-21 00:00:00,,EPSG,,95.193
+23889,ID74 / UTM zone 49S,,,,Indonesia - south of equator and between 108 deg and 114 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16149,1995-07-21 00:00:00,,EPSG,,95.193
+23890,ID74 / UTM zone 50S,,,,Indonesia - south of equator and between 114 deg and 120 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16150,1995-07-21 00:00:00,,EPSG,,95.193
+23891,ID74 / UTM zone 51S,,,,Indonesia - south of equator and between 120 deg and 126 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16151,1995-07-21 00:00:00,,EPSG,,95.193
+23892,ID74 / UTM zone 52S,,,,Indonesia - south of equator and between 126 deg and 132 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16152,1995-07-21 00:00:00,,EPSG,,95.193
+23893,ID74 / UTM zone 53S,,,,Indonesia - south of equator and between 132 deg and 138 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16153,1995-07-21 00:00:00,,EPSG,,95.193
+23894,ID74 / UTM zone 54S,,,,Indonesia - south of equator and east of 138 deg East.,projected 2D,,,East,North,E,N,9001,,4238,16154,1995-07-21 00:00:00,,EPSG,,95.193
+23946,Indian 1954 / UTM zone 46N,Indian 1954 / UTM 46N,,,Myanmar (Burma) - west of 96 deg East.,projected 2D,,,East,North,E,N,9001,,4239,16046,1998-06-13 00:00:00,,EPSG,,
+23947,Indian 1954 / UTM zone 47N,Indian 1954 / UTM 47N,,,Myanmar (Burma) - east of 96 deg East; Thailand - west of 102 deg East.,projected 2D,,,East,North,E,N,9001,,4239,16047,1995-06-02 00:00:00,,EPSG,,
+23948,Indian 1954 / UTM zone 48N,Indian 1954 / UTM 48N,,,Thailand - east of 102 deg East.,projected 2D,,,East,North,E,N,9001,,4239,16048,1995-06-02 00:00:00,,EPSG,,
+24047,Indian 1975 / UTM zone 47N,Indian 1975 / UTM 47N,,,Thailand - west of 102 deg East.,projected 2D,,,East,North,E,N,9001,,4240,16047,1995-06-02 00:00:00,,EPSG,,
+24048,Indian 1975 / UTM zone 48N,Indian 1975 / UTM 48N,,,Thailand - east of 102 deg East.,projected 2D,,,East,North,E,N,9001,,4240,16048,1995-06-02 00:00:00,,EPSG,,
+24100,Jamaica 1875 / Jamaica (Old Grid),Jamaica 1875 / Old Grid,,,Jamaica.,projected 2D,,,East,North,E,N,9005,,4241,19909,1995-06-02 00:00:00,,EPSG,Superseded by 24200 (JAD69 / Jamaica National Grid).,
+24200,JAD69 / Jamaica National Grid,JAD69 / Jamaica Grid,,,Jamaica.,projected 2D,,,East,North,E,N,9001,,4242,19910,1995-06-02 00:00:00,,EPSG,Supersedes 24100 (JAD69 / Jamaica National Grid).,
+24305,Kalianpur 1937 / UTM zone 45N,Kalianpur 37 / UTM 45N,,,Bangladesh - west of 90deg East.,projected 2D,,,East,North,E,N,9001,,4144,16045,1999-10-20 00:00:00,,EPSG,,
+24306,Kalianpur 1937 / UTM zone 46N,Kalianpur 37 / UTM 46N,,,Bangladesh - east of 90deg East.,projected 2D,,,East,North,E,N,9001,,4144,16046,1999-10-20 00:00:00,,EPSG,,
+24311,Kalianpur 1962 / UTM zone 41N,Kalianpur 62 / UTM 41N,,,Pakistan - west of 66deg East.,projected 2D,,,East,North,E,N,9001,,4145,16041,1999-10-20 00:00:00,,EPSG,,
+24312,Kalianpur 1962 / UTM zone 42N,Kalianpur 62 / UTM 42N,,,Pakistan - between 66 and 72deg East.,projected 2D,,,East,North,E,N,9001,,4145,16042,1999-10-20 00:00:00,,EPSG,,
+24313,Kalianpur 1962 / UTM zone 43N,Kalianpur 62 / UTM 43N,,,Pakistan - east of 72deg East.,projected 2D,,,East,North,E,N,9001,,4145,16043,1999-10-20 00:00:00,,EPSG,,
+24342,Kalianpur 1975 / UTM zone 42N,Kalianpur 75 / UTM 42N,,,India - west of 72deg East.,projected 2D,,,East,North,E,N,9001,,4146,16042,1999-10-20 00:00:00,,EPSG,,
+24343,Kalianpur 1975 / UTM zone 43N,Kalianpur 75 / UTM 43N,,,India - between 72 and 78deg East.,projected 2D,,,East,North,E,N,9001,,4146,16043,1999-10-20 00:00:00,,EPSG,,
+24344,Kalianpur 1975 / UTM zone 44N,Kalianpur 75 / UTM 44N,,,India - between 78 and 84deg East.,projected 2D,,,East,North,E,N,9001,,4146,16044,1999-10-20 00:00:00,,EPSG,,
+24345,Kalianpur 1975 / UTM zone 45N,Kalianpur 75 / UTM 45N,,,India - between 84 and 90deg East.,projected 2D,,,East,North,E,N,9001,,4146,16045,1999-10-20 00:00:00,,EPSG,,
+24346,Kalianpur 1975 / UTM zone 46N,Kalianpur 75 / UTM 46N,,,India - between 90 and 96deg East.,projected 2D,,,East,North,E,N,9001,,4146,16046,1999-10-20 00:00:00,,EPSG,,
+24347,Kalianpur 1975 / UTM zone 47N,Kalianpur 75 / UTM 47N,,,India - east of 96deg East.,projected 2D,,,East,North,E,N,9001,,4146,16047,1999-10-20 00:00:00,,EPSG,,
+24370,Kalianpur 1880 / India zone 0,Kalianpur / India 0,,,Pakistan north of 35 deg 35 min North.,projected 2D,,,East,North,E,N,9084,,4243,18110,1999-10-20 00:00:00,,EPSG,,97.23
+24371,Kalianpur 1880 / India zone I,Kalianpur / India I,,,India north of 28 deg North; Pakistan 28 deg to 35 deg 35 min North.,projected 2D,,,East,North,E,N,9084,,4243,18111,1999-10-20 00:00:00,,EPSG,,97.23
+24372,Kalianpur 1880 / India zone IIa,Kalianpur / India IIa,,,India - between 21 deg and 28 deg North and  west of 82 deg East; Pakistan - south of 28 deg North.,projected 2D,,,East,North,E,N,9084,,4243,18112,1999-10-20 00:00:00,,EPSG,,97.23
+24373,Kalianpur 1880 / India zone III,Kalianpur / India III,,,India - between 15 deg and 21 deg North.,projected 2D,,,East,North,E,N,9084,,4243,18114,1999-10-20 00:00:00,,EPSG,,97.23
+24374,Kalianpur 1880 / India zone IV,Kalianpur / India IV,,,India - south of 15 deg North.,projected 2D,,,East,North,E,N,9084,,4243,18116,1999-10-20 00:00:00,,EPSG,,97.23
+24375,Kalianpur 1937 / India zone IIb,Kalianpur 37 / India IIb,,,Bangladesh.,projected 2D,,,East,North,E,N,9001,,4144,18238,1999-10-20 00:00:00,,EPSG,Used by Bangladesh since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and Benoit's 1895 British inch-metre ratio of 39.370115 rounded as Ind ft = 0.30479841m exactly.,97.23
+24376,Kalianpur 1962 / India zone I,Kalianpur 62 / India I,,,Pakistan - north of 28deg North.,projected 2D,,,East,North,E,N,9001,,4145,18236,1999-10-20 00:00:00,,EPSG,Used by Pakistan since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded by G.Bomford with slight error as Ind ft = 0.3048996m exactly.,97.23
+24377,Kalianpur 1962 / India zone IIa,Kalianpur 62 / India IIa,,,Pakistan - south of 28deg North.,projected 2D,,,East,North,E,N,9001,,4145,18237,1999-10-20 00:00:00,,EPSG,Used by Pakistan since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded by G.Bomford with slight error as Ind ft = 0.3048996m exactly.,97.23
+24378,Kalianpur 1975 / India zone I,Kalianpur 75 / India I,,,India - north of 28deg North and west of 82deg East.,projected 2D,,,East,North,E,N,9001,,4146,18231,1999-10-20 00:00:00,,EPSG,Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.,97.23
+24379,Kalianpur 1975 / India zone IIa,Kalianpur 75 / India IIa,,,India - between 28deg and 21deg North and west of 82deg East.,projected 2D,,,East,North,E,N,9001,,4146,18232,1999-10-20 00:00:00,,EPSG,Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.,97.23
+24380,Kalianpur 1975 / India zone IIb,Kalianpur 75 / India IIb,,,India - north of 21deg North and east of 82deg East.,projected 2D,,,East,North,E,N,9001,,4146,18235,1999-10-20 00:00:00,,EPSG,Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.,97.23
+24381,Kalianpur 1975 / India zone III,Kalianpur 75 / India III,,,India - between 21deg and 15deg North.,projected 2D,,,East,North,E,N,9001,,4146,18233,1999-10-20 00:00:00,,EPSG,Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.,97.23
+24382,Kalianpur 1880 / India zone IIb,Kalianpur / India IIb,,,Bangladesh; India - north of 22 deg North and east of 82 deg East; Myanmar (Burma) - north of 22 deg North.,projected 2D,,,East,North,E,N,9084,,4243,18113,1999-10-20 00:00:00,,EPSG,,97.23
+24383,Kalianpur 1975 / India zone IV,Kalianpur 75 / India IV,,,India - south of 21deg North.,projected 2D,,,East,North,E,N,9001,,4146,18234,1999-10-20 00:00:00,,EPSG,Used by India since metrication.  Metric conversion applies A.R.Clarke's Indian foot-British foot ratio of 0.99999566 and J.S.Clark's 1865 British inch-metre ratio of 39.369971 rounded as 1 Ind ft = 0.3048995m exactly.,97.23
+24500,Kertau / Singapore Grid,,,,Singapore.,projected 2D,,,East,North,E,N,9001,,4245,19920,1995-06-02 00:00:00,,EPSG,,
+24547,Kertau / UTM zone 47N,,,,Malaysia - West Malaysia west of 102 deg East.,projected 2D,,,East,North,E,N,9001,,4245,16047,1995-06-02 00:00:00,,EPSG,,
+24548,Kertau / UTM zone 48N,,,,Malaysia - West Malaysia east of 102 deg East.,projected 2D,,,East,North,E,N,9001,,4245,16048,1995-07-21 00:00:00,,EPSG,,95.192
+24571,Kertau / R.S.O. Malaya (ch),,,,Malaysia - West Malaysia,projected 2D,,,East,North,E,N,9062,,4245,19935,1999-10-20 00:00:00,,EPSG,Adopts metric conversion of 39.370113 inches per metre.,97.231
+24600,KOC Lambert,,,,Kuwait.,projected 2D,,,East,North,E,N,9001,,4246,19906,1996-04-12 00:00:00,,EPSG,,
+24718,La Canoa / UTM zone 18N,,,,Venezuela - west of 72 deg West.,projected 2D,,,East,North,E,N,9001,,4247,16018,1999-10-20 00:00:00,,EPSG,Sometimes referred to as PSAD56 / UTM zone 18N.,
+24719,La Canoa / UTM zone 19N,,,,Venezuela - between 72 and 66 deg West.,projected 2D,,,East,North,E,N,9001,,4247,16019,1999-10-20 00:00:00,,EPSG,Sometimes referred to as PSAD56 / UTM zone 19N.,
+24720,La Canoa / UTM zone 20N,,,,Venezuela - east of 66 deg West.,projected 2D,,,East,North,E,N,9001,,4247,16020,1995-06-02 00:00:00,,EPSG,Sometimes referred to as PSAD56 / UTM zone 20N.,
+24818,PSAD56 / UTM zone 18N,,,,South America (Ecuador;  [Venezuela]) 78deg West to 72deg West.,projected 2D,,,East,North,E,N,9001,,4248,16018,1995-06-02 00:00:00,,EPSG,In Venezuela also known as La Canoa / UTM zone 18N.,
+24819,PSAD56 / UTM zone 19N,,,,South America (Netherlands Antilles; [Venezuela]) 72deg West  to 66deg West.,projected 2D,,,East,North,E,N,9001,,4248,16019,1995-06-02 00:00:00,,EPSG,In Venezuela also known as La Canoa / UTM zone 19N.,
+24820,PSAD56 / UTM zone 20N,,,,South America (Guyana; [Venezuela]) 66deg West  to 60deg West.,projected 2D,,,East,North,E,N,9001,,4248,16020,1995-06-02 00:00:00,,EPSG,In Venezuela also known as La Canoa / UTM zone 20N.,
+24821,PSAD56 / UTM zone 21N,,,,South America (Guyana; Suriname) 60deg West  to 54deg West.,projected 2D,,,East,North,E,N,9001,,4248,16021,1995-06-02 00:00:00,,EPSG,,
+24877,PSAD56 / UTM zone 17S,,,,South America (Chile; Ecuador; Peru) 84deg West  to 78deg West.,projected 2D,,,East,North,E,N,9001,,4248,16117,1995-06-02 00:00:00,,EPSG,,
+24878,PSAD56 / UTM zone 18S,,,,South America (Chile; Ecuador; Peru) 78deg West  to 72deg West.,projected 2D,,,East,North,E,N,9001,,4248,16118,1995-06-02 00:00:00,,EPSG,,
+24879,PSAD56 / UTM zone 19S,,,,South America (Bolivia; Chile; Peru) 72deg West  to 66deg West.,projected 2D,,,East,North,E,N,9001,,4248,16119,1995-06-02 00:00:00,,EPSG,,
+24880,PSAD56 / UTM zone 20S,,,,South America (Bolivia) 66deg West  to 60deg West.,projected 2D,,,East,North,E,N,9001,,4248,16120,1995-06-02 00:00:00,,EPSG,,
+24882,PSAD56 / UTM zone 22S,,,,Brazil - offshore Amazon Cone,projected 2D,,,East,North,E,N,9001,,4248,16122,1999-04-22 00:00:00,,EPSG,,
+24891,PSAD56 / Peru west zone,,,,Peru west of 79 deg West.,projected 2D,,,East,North,X,Y,9001,,4248,18161,1995-06-02 00:00:00,,EPSG,,
+24892,PSAD56 / Peru central zone,PSAD56 / Peru central,,,Peru 79 to 73 deg West.,projected 2D,,,East,North,X,Y,9001,,4248,18162,1995-06-02 00:00:00,,EPSG,,
+24893,PSAD56 / Peru east zone,,,,Peru east of 73 deg West.,projected 2D,,,East,North,X,Y,9001,,4248,18163,1995-06-02 00:00:00,,EPSG,,
+25000,Leigon / Ghana Metre Grid,Leigon / Ghana Grid,,,Ghana.,projected 2D,,,East,North,E,N,9001,,4250,19904,1995-06-02 00:00:00,,EPSG,,
+25231,Lome / UTM zone 31N,,,,Togo.,projected 2D,,,East,North,E,N,9001,,4252,16031,1995-06-02 00:00:00,,EPSG,,
+25391,Luzon 1911 / Philippines zone I,Luzon / Philippines I,,,Philippines - west of 118 deg East.,projected 2D,,,East,North,X,Y,9001,,4253,18171,1995-06-02 00:00:00,,EPSG,,
+25392,Luzon 1911 / Philippines zone II,Luzon / Philippines II,,,Philippines - Palawan; Calamian Islands.,projected 2D,,,East,North,X,Y,9001,,4253,18172,1995-06-02 00:00:00,,EPSG,,
+25393,Luzon 1911 / Philippines zone III,Luzon / Philippines III,,,Philippines - Luzon (except SE part;); Mindoro.,projected 2D,,,East,North,X,Y,9001,,4253,18173,1995-06-02 00:00:00,,EPSG,,
+25394,Luzon 1911 / Philippines zone IV,Luzon / Philippines IV,,,Philippines - SE Luzon; Tablas; Masbate; Panay; Cebu; Negros; west Mindanao.,projected 2D,,,East,North,X,Y,9001,,4253,18174,1995-06-02 00:00:00,,EPSG,,
+25395,Luzon 1911 / Philippines zone V,Luzon / Philippines V,,,Philippines - east Mindanao; Bohol; Samar.,projected 2D,,,East,North,X,Y,9001,,4253,18175,1995-06-02 00:00:00,,EPSG,,
+25700,Makassar (Jakarta) / NEIEZ,Makassar / NEIEZ,,,Indonesia - south west Sulawesi.,projected 2D,,,East,North,X,Y,9001,,4804,19905,1995-06-02 00:00:00,,EPSG,,
+25828,ETRF89 / UTM zone 28N,,,,Europe - 18deg West to 12deg West - United Kingdom (UKCS) offshore.,projected 2D,,,East,North,E,N,9001,,4258,16028,1999-04-22 00:00:00,,EPSG,,99.11
+25829,ETRF89 / UTM zone 29N,,,,Europe - 12deg West to 6deg West - United Kingdom (UKCS) offshore.,projected 2D,,,East,North,E,N,9001,,4258,16029,1999-04-22 00:00:00,,EPSG,,99.11
+25830,ETRF89 / UTM zone 30N,,,,Europe - 6deg West to 0deg.,projected 2D,,,East,North,E,N,9001,,4258,16030,1999-04-22 00:00:00,,EPSG,,99.11
+25831,ETRF89 / UTM zone 31N,,,,Europe - 0deg to 6deg East - Norway.,projected 2D,,,East,North,E,N,9001,,4258,16031,1999-04-22 00:00:00,,EPSG,,99.11
+25832,ETRF89 / UTM zone 32N,,,,Europe - 6deg East  to 12deg East - Norway.,projected 2D,,,East,North,E,N,9001,,4258,16032,1999-04-22 00:00:00,,EPSG,,99.11
+25833,ETRF89 / UTM zone 33N,,,,Europe - 12deg East  to 18deg East - Norway.,projected 2D,,,East,North,E,N,9001,,4258,16033,1999-04-22 00:00:00,,EPSG,,99.11
+25834,ETRF89 / UTM zone 34N,,,,Europe - 18deg East  to 24deg East - Norway.,projected 2D,,,East,North,E,N,9001,,4258,16034,1999-04-22 00:00:00,,EPSG,,99.11
+25835,ETRF89 / UTM zone 35N,,,,Europe - 24deg East  to 30deg East - Norway.,projected 2D,,,East,North,E,N,9001,,4258,16035,1999-04-22 00:00:00,,EPSG,,99.11
+25836,ETRF89 / UTM zone 36N,,,,Europe - 30deg East  to 36deg East.,projected 2D,,,East,North,E,N,9001,,4258,16036,1999-04-22 00:00:00,,EPSG,,99.11
+25837,ETRF89 / UTM zone 37N,,,,Europe - 36deg East  to 42deg East.,projected 2D,,,East,North,E,N,9001,,4258,16037,1999-04-22 00:00:00,,EPSG,,99.11
+25838,ETRF89 / UTM zone 38N,,,,Europe - 42deg East  to 48deg East.,projected 2D,,,East,North,E,N,9001,,4258,16038,1999-04-22 00:00:00,,EPSG,,99.11
+25884,ETRF89 / TM Baltic93,,,,Estonia;  Latvia;  Lithuania.,projected 2D,,,North,East,X,Y,9001,,4258,19939,1999-04-22 00:00:00,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,Used as a common coordinate system for the Baltic states and for medium and small scale mapping in Estonia since 1993.,99.11
+25932,Malongo 1987 / UTM zone 32S,Malongo 1987 / UTM 32S,,,Angola - Cabinda.,projected 2D,,,East,North,E,N,9001,,4259,16132,1995-06-02 00:00:00,,EPSG,,
+26191,Merchich / Nord Maroc,,,,Morocco north of 35 grads (31 deg 30 min) North.,projected 2D,,,East,North,X,Y,9001,,4261,18131,1995-06-02 00:00:00,,EPSG,,
+26192,Merchich / Sud Maroc,,,,Morocco 31grads to 35grads  (27 deg 54 min to 31 deg 30 min) North.,projected 2D,,,East,North,X,Y,9001,,4261,18132,1995-06-02 00:00:00,,EPSG,,
+26193,Merchich / Sahara,,,,Morocco south of 31grads  (27 deg 54 min) North.,projected 2D,,,East,North,X,Y,9001,,4261,18133,1995-06-02 00:00:00,,EPSG,,
+26237,Massawa / UTM zone 37N,,,,Eritrea.,projected 2D,,,East,North,E,N,9001,,4262,16037,1995-06-02 00:00:00,,EPSG,,
+26331,Minna / UTM zone 31N,,,,Nigeria - offshore beyond continental shelf west of 6 deg East.,projected 2D,,,East,North,E,N,9001,,4263,16031,1995-06-02 00:00:00,,EPSG,,
+26332,Minna / UTM zone 32N,,,,Nigeria - offshore beyond continental shelf.,projected 2D,,,East,North,E,N,9001,,4263,16032,1995-06-02 00:00:00,,EPSG,,
+26391,Minna / Nigeria West Belt,Minna / Nigeria West,,,Nigeria west of 6 deg 30 min East.,projected 2D,,,East,North,E,N,9001,,4263,18151,1995-06-02 00:00:00,,EPSG,,
+26392,Minna / Nigeria Mid Belt,,,,Nigeria between 6 deg 30 min and 10 deg 30 min East.,projected 2D,,,East,North,E,N,9001,,4263,18152,1995-06-02 00:00:00,,EPSG,,
+26393,Minna / Nigeria East Belt,Minna / Nigeria East,,,Nigeria east of 10 deg 30 min East.,projected 2D,,,East,North,E,N,9001,,4263,18153,1995-06-02 00:00:00,,EPSG,,
+26432,Mhast / UTM zone 32S,,,,Angola - Cabinda.,projected 2D,,,East,North,E,N,9001,,4264,16132,1995-06-02 00:00:00,,EPSG,,
+26591,Monte Mario (Rome) / Italy zone 1,Monte Mario / Italy 1,,,Italy west of 12 deg East.,projected 2D,,,East,North,X,Y,9001,,4806,18121,1995-06-02 00:00:00,,EPSG,,
+26592,Monte Mario (Rome) / Italy zone 2,Monte Mario / Italy 2,,,Italy east of 12 deg East.,projected 2D,,,East,North,X,Y,9001,,4806,18122,1995-06-02 00:00:00,,EPSG,,
+26632,M'poraloko / UTM zone 32N,M'poraloko / UTM 32N,,,Gabon - north of equator.,projected 2D,,,East,North,E,N,9001,,4266,16032,1995-06-02 00:00:00,,EPSG,,
+26692,M'poraloko / UTM zone 32S,M'poraloko / UTM 32S,,,Gabon - south of equator.,projected 2D,,,East,North,E,N,9001,,4266,16132,1995-06-02 00:00:00,,EPSG,,
+26703,NAD27 / UTM zone 3N,,,,North America - United States (USA) - Alaska - 168deg West  to 162deg West.,projected 2D,,,East,North,E,N,9001,,4267,16003,1995-06-02 00:00:00,,EPSG,,
+26704,NAD27 / UTM zone 4N,,,,North America - United States (USA) - Alaska - 162deg West  to 156deg West.,projected 2D,,,East,North,E,N,9001,,4267,16004,1995-06-02 00:00:00,,EPSG,,
+26705,NAD27 / UTM zone 5N,,,,North America - United States (USA) - Alaska - 156deg West  to 150deg West.,projected 2D,,,East,North,E,N,9001,,4267,16005,1995-06-02 00:00:00,,EPSG,,
+26706,NAD27 / UTM zone 6N,,,,North America - United States (USA) - Alaska - 150deg West  to 144deg West.,projected 2D,,,East,North,E,N,9001,,4267,16006,1995-06-02 00:00:00,,EPSG,,
+26707,NAD27 / UTM zone 7N,,,,North America - Canada; United States (USA) - Alaska - 144deg West  to 138deg West.,projected 2D,,,East,North,E,N,9001,,4267,16007,1995-06-02 00:00:00,,EPSG,,
+26708,NAD27 / UTM zone 8N,,,,North America - Canada; United States (USA) - 138deg West  to 132deg West.,projected 2D,,,East,North,E,N,9001,,4267,16008,1995-06-02 00:00:00,,EPSG,,
+26709,NAD27 / UTM zone 9N,,,,North America - Canada; United States (USA) - 132deg West  to 126deg West.,projected 2D,,,East,North,E,N,9001,,4267,16009,1995-06-02 00:00:00,,EPSG,,
+26710,NAD27 / UTM zone 10N,,,,North America - Canada; United States (USA) - 130deg West  to 120deg West.,projected 2D,,,East,North,E,N,9001,,4267,16010,1995-06-02 00:00:00,,EPSG,,
+26711,NAD27 / UTM zone 11N,,,,North America - Canada; Mexico; United States (USA) - 120deg West  to 114deg West.,projected 2D,,,East,North,E,N,9001,,4267,16011,1995-06-02 00:00:00,,EPSG,,
+26712,NAD27 / UTM zone 12N,,,,North America - Canada; Mexico; United States (USA) - 114deg West  to 108deg West.,projected 2D,,,East,North,E,N,9001,,4267,16012,1995-06-02 00:00:00,,EPSG,,
+26713,NAD27 / UTM zone 13N,,,,North America - Canada; Mexico; United States (USA) - 108deg West  to 102deg West.,projected 2D,,,East,North,E,N,9001,,4267,16013,1995-06-02 00:00:00,,EPSG,,
+26714,NAD27 / UTM zone 14N,,,,North America - Canada; Mexico; United States (USA) - 102deg West  to 96deg West.,projected 2D,,,East,North,E,N,9001,,4267,16014,1995-06-02 00:00:00,,EPSG,,
+26715,NAD27 / UTM zone 15N,,,,North America - Canada; Mexico; United States (USA) - 96deg West  to 90deg West.,projected 2D,,,East,North,E,N,9001,,4267,16015,1995-06-02 00:00:00,,EPSG,In Ontario superseded by NAD27(76) / UTM zone 15N (code 227).,
+26716,NAD27 / UTM zone 16N,,,,North America - Canada; Mexico; United States (USA) - 90deg West  to 84deg West.,projected 2D,,,East,North,E,N,9001,,4267,16016,1995-06-02 00:00:00,,EPSG,In Ontario superseded by NAD27(76) / UTM zone 16N (code 228).,
+26717,NAD27 / UTM zone 17N,,,,North America - Canada; Mexico; United States (USA) - 84deg West  to 78deg West.,projected 2D,,,East,North,E,N,9001,,4267,16017,1995-06-02 00:00:00,,EPSG,In Ontario superseded by NAD27(76) / UTM zone 17N (code 229).  In Quebec superseded by NAD27(CGQ77) / UTM zone 17N (code 231).,
+26718,NAD27 / UTM zone 18N,,,,North America - Canada; United States (USA) - 78deg West  to 72deg West.,projected 2D,,,East,North,E,N,9001,,4267,16018,1995-06-02 00:00:00,,EPSG,In Ontario superseded by NAD27(76) / UTM zone 18N (code 230).  In Quebec superseded by NAD27(CGQ77) / UTM zone 18N (code 232).,
+26719,NAD27 / UTM zone 19N,,,,North America - Canada; United States (USA) - 72deg West  to 66deg West.,projected 2D,,,East,North,E,N,9001,,4267,16019,1995-06-02 00:00:00,,EPSG,In Quebec superseded by NAD27(CGQ77) / UTM zone 19N (code 233).,
+26720,NAD27 / UTM zone 20N,,,,North America - Antigua and Barbuda - Barbuda.  British Virgin Islands (military).  Canada; United States (USA) offshore Atlantic - 66deg West  to 60deg West.,projected 2D,,,East,North,E,N,9001,,4267,16020,1995-06-02 00:00:00,,EPSG,In Quebec superseded by NAD27(CGQ77) / UTM zone 20N (code 234).,
+26721,NAD27 / UTM zone 21N,,,,North America - Canada - 60deg West  to 54deg West.,projected 2D,,,East,North,E,N,9001,,4267,16021,1995-06-02 00:00:00,,EPSG,In Quebec superseded by NAD27(CGQ77) / UTM zone 21N (code 235).,
+26722,NAD27 / UTM zone 22N,,,,North America - Canada - 54deg West  to 48deg West.,projected 2D,,,East,North,E,N,9001,,4267,16022,1995-06-02 00:00:00,,EPSG,,
+26729,NAD27 / Alabama East,,,,United States (USA) - Alabama - AL_E - counties east of approx 86d 37m West - Barbour; Bullock; Calhoun; Chambers; Cherokee; Clay; Cleburne; Coffee; Coosa; Covington; Crenshaw; Dale; De Kalb; Elmore; Etowah; Geneva; Henry; Houston; Jackson; Lee; Macon; Madison; Marshall; Montgomery; Pike; Randolph; Russell; St.Clair; Talladega; Tallapoosa,projected 2D,,,East,North,X,Y,9003,,4267,10101,1995-06-02 00:00:00,,EPSG,,
+26730,NAD27 / Alabama West,,,,United States (USA) - Alabama - AL_W - counties west of approx 86d 37m West - Autauga; Baldwin; Bibb; Blount; Butler; Chilton; Choctaw; Clarke; Colbert; Conecuh; Cullman; Dallas; Escambia; Fayette; Franklin; Greene; Hale; Jefferson; Lamar; Lauderdale; Lawrence; Limestone; Lowndes; Marengo; Marion; Mobile; Monroe; Morgan; Perry; Pickens; Shelby; Sumter; Tuscaloosa; Walker; Washington; Wilcox; Winston,projected 2D,,,East,North,X,Y,9003,,4267,10102,1995-06-02 0 [...]
+26731,NAD27 / Alaska zone 1,,,,United States - Alaska - Panhandle.,projected 2D,,,East,North,X,Y,9003,,4267,15001,1995-06-02 00:00:00,,EPSG,,
+26732,NAD27 / Alaska zone 2,,,,United States - Alaska - 141deg to 144deg West.,projected 2D,,,East,North,X,Y,9003,,4267,15002,1995-06-02 00:00:00,,EPSG,,
+26733,NAD27 / Alaska zone 3,,,,United States - Alaska - 144deg to 148deg West.,projected 2D,,,East,North,X,Y,9003,,4267,15003,1995-06-02 00:00:00,,EPSG,,
+26734,NAD27 / Alaska zone 4,,,,United States - Alaska - 148deg to 152deg West.,projected 2D,,,East,North,X,Y,9003,,4267,15004,1995-06-02 00:00:00,,EPSG,,
+26735,NAD27 / Alaska zone 5,,,,United States - Alaska - 152deg to 156deg West.,projected 2D,,,East,North,X,Y,9003,,4267,15005,1995-06-02 00:00:00,,EPSG,,
+26736,NAD27 / Alaska zone 6,,,,United States - Alaska - 156deg to 160deg West.,projected 2D,,,East,North,X,Y,9003,,4267,15006,1995-06-02 00:00:00,,EPSG,,
+26737,NAD27 / Alaska zone 7,,,,United States - Alaska - 160deg to 164deg West.,projected 2D,,,East,North,X,Y,9003,,4267,15007,1995-06-02 00:00:00,,EPSG,,
+26738,NAD27 / Alaska zone 8,,,,United States - Alaska - 164deg to 168deg West; north of 54d 30m North.,projected 2D,,,East,North,X,Y,9003,,4267,15008,1995-06-02 00:00:00,,EPSG,,
+26739,NAD27 / Alaska zone 9,,,,United States - Alaska - West of 168deg West and north of 54d 30m North.,projected 2D,,,East,North,X,Y,9003,,4267,15009,1995-06-02 00:00:00,,EPSG,,
+26740,NAD27 / Alaska zone 10,,,,United States - Alaska - Aleutian Islands.,projected 2D,,,East,North,X,Y,9003,,4267,15010,1995-06-02 00:00:00,,EPSG,,
+26741,NAD27 / California zone I,NAD27 / California I,,,United States (USA) - California - CA_1 - counties north of approx 40 deg North - Del Norte; Humboldt; Lassen; Modoc; Plumas; Shasta; Siskiyou; Tehama; Trinity,projected 2D,,,East,North,X,Y,9003,,4267,10401,1995-06-02 00:00:00,,EPSG,,
+26742,NAD27 / California zone II,NAD27 / California II,,,United States (USA) - California - CA_2 - counties between approx 40 deg & 38d 15m North - Alpine; Amador; Butte; Colusa; El Dorado; Glenn; Lake; Mendocino; Napa; Nevada; Placer; Sacramento; Sierra; Solano; Sonoma; Sutter; Yolo; Yuba,projected 2D,,,East,North,X,Y,9003,,4267,10402,1995-06-02 00:00:00,,EPSG,,
+26743,NAD27 / California zone III,NAD27 / California III,,,United States (USA) - California - CA_3 - counties between approx 38d 15m & 37d North - Alameda; Calaveras; Contra Costa; Madera; Marin; Mariposa; Merced; Mono; San Francisco; San Joaquin; San Mateo; Santa Clara; Santa Cruz; Stanislaus; Tuolumne,projected 2D,,,East,North,X,Y,9003,,4267,10403,1995-06-02 00:00:00,,EPSG,,
+26744,NAD27 / California zone IV,NAD27 / California IV,,,United States (USA) - California - CA_4 - counties between approx 37d & 35d 30m North - Fresno; Inyo; Kings; Monterey; San Benito; Tulare,projected 2D,,,East,North,X,Y,9003,,4267,10404,1995-06-02 00:00:00,,EPSG,,
+26745,NAD27 / California zone V,NAD27 / California V,,,United States (USA) - California - CA_5 - counties between approx 35d 50m & 34d North - Kern; San Bernardino; San Luis Obispo; Santa Barbara; Ventura,projected 2D,,,East,North,X,Y,9003,,4267,10405,1995-06-02 00:00:00,,EPSG,,
+26746,NAD27 / California zone VI,NAD27 / California VI,,,United States (USA) - California - CA_6 - counties south of approx 38d 30m North - Imperial; Orange; Riverside; San Diego,projected 2D,,,East,North,X,Y,9003,,4267,10406,1995-06-02 00:00:00,,EPSG,,
+26747,NAD27 / California zone VII,NAD27 / California VII,,,United States - California - Los Angeles.,projected 2D,,,East,North,X,Y,9003,,4267,10407,1995-06-02 00:00:00,,EPSG,,
+26748,NAD27 / Arizona East,,,,United States (USA) - Arizona - AZ_E - counties east of approx 110d 45m West - Apache; Cochise; Gila; Graham; Greenlee; Navajo,projected 2D,,,East,North,X,Y,9003,,4267,10201,1995-08-22 00:00:00,,EPSG,,95.25
+26749,NAD27 / Arizona Central,,,,United States (USA) - Arizona - AZ_C - counties between approx 110d 45m and 113d 20m West - Coconino; Maricopa; Pima; Pinal; Santa Cruz; Yavapai,projected 2D,,,East,North,X,Y,9003,,4267,10202,1995-08-22 00:00:00,,EPSG,,95.25
+26750,NAD27 / Arizona West,,,,United States (USA) - Arizona - AZ_W - counties west of approx 113d 20m West - La Paz; Mohave; Yuma,projected 2D,,,East,North,X,Y,9003,,4267,10203,1995-08-22 00:00:00,,EPSG,,95.25
+26751,NAD27 / Arkansas North,,,,United States (USA) - Arkansas - AR_N - counties north of approx 34d 50m North - Baxter; Benton; Boone; Carroll; Clay; Cleburne; Conway; Craighead; Crawford; Crittenden; Cross; Faulkner; Franklin; Fulton; Greene; Independence; Izard; Jackson; Johnson; Lawrence; Logan; Madison; Marion; Mississippi; Newton; Perry; Poinsett; Pope; Randolph; Scott; Searcy; Sebastian; Sharp; St. Francis; Stone; Van Buren; Washington; White; Woodruff; Yell,projected 2D,,,East,No [...]
+26752,NAD27 / Arkansas South,,,,United States (USA) - Arkansas - AR_S - counties south of approx 34d 50m North - Arkansas; Ashley; Bradley; Calhoun; Chicot; Clark; Cleveland; Columbia; Dallas; Desha; Drew; Garland; Grant; Hempstead; Hot Spring; Howard; Jefferson; Lafayette; Lee; Lincoln; Little River; Lonoke; Miller; Monroe; Montgomery; Nevada; Ouachita; Phillips; Pike; Polk; Prairie; Pulaski; Saline; Sevier; Union,projected 2D,,,East,North,X,Y,9003,,4267,10302,1995-06-02 00:00:00,,EPSG,,
+26753,NAD27 / Colorado North,,,,United States (USA) - Colorado - CO_N - counties north of approx 39d 50m North - Adams; Boulder; Gilpin; Grand; Jackson; Larimer; Logan; Moffat; Morgan; Phillips; Rio Blanco; Routt; Sedgwick; Washington; Weld; Yuma,projected 2D,,,East,North,X,Y,9003,,4267,10501,1995-06-02 00:00:00,,EPSG,,
+26754,NAD27 / Colorado Central,,,,United States (USA) - Colorado - CO_C - counties between approx 39d 50m & 38d 30m North - Arapahoe; Chaffee; Cheyenne; Clear Creek; Delta; Denver; Douglas; Eagle; El Paso; Elbert; Fremont; Garfield; Gunnison; Jefferson; Kit Carson; Lake; Lincoln; Mesa; Park; Pitkin; Summit; Teller,projected 2D,,,East,North,X,Y,9003,,4267,10502,1995-06-02 00:00:00,,EPSG,,
+26755,NAD27 / Colorado South,,,,United States (USA) - Colorado - CO_S - counties south of approx 38d 30m North - Alamosa; Archuleta; Baca; Bent; Conejos; Costilla; Crowley; Custer; Dolores; Hinsdale; Huerfano; Kiowa; La Plata; Las Animas; Mineral; Montezuma; Montrose; Otero; Ouray; Prowers; Pueblo; Rio Grande; Saguache; San Juan; San Miguel,projected 2D,,,East,North,X,Y,9003,,4267,10503,1995-06-02 00:00:00,,EPSG,,
+26756,NAD27 / Connecticut,,,,United States (USA) - Connecticut - CT - counties of Fairfield; Hartford; Litchfield; Middlesex; New Haven; New London; Tolland; Windham,projected 2D,,,East,North,X,Y,9003,,4267,10600,1995-06-02 00:00:00,,EPSG,,
+26757,NAD27 / Delaware,,,,United States (USA) - Delaware - DE - counties of Kent; New Castle; Sussex,projected 2D,,,East,North,X,Y,9003,,4267,10700,1995-06-02 00:00:00,,EPSG,,
+26758,NAD27 / Florida East,,,,United States (USA) - Florida - FL_E - counties of Brevard; Broward; Clay; Collier; Dade; Duval; Flagler; Glades; Hendry; Highlands; Indian River; Lake; Martin; Monroe; Nassau; Okeechobee; Orange; Osceola; Palm Beach; Putnam; Seminole; St. Johns; St. Lucie; Volusia,projected 2D,,,East,North,X,Y,9003,,4267,10901,1995-06-02 00:00:00,,EPSG,,
+26759,NAD27 / Florida West,,,,United States (USA) - Florida - FL_W - counties of Charlotte; Citrus; De Soto; Hardee; Hernando; Hillsborough; Lee; Levy; Manatee; Marion; Pasco; Pinellas; Polk; Sarasota; Sumter,projected 2D,,,East,North,X,Y,9003,,4267,10902,1995-06-02 00:00:00,,EPSG,,
+26760,NAD27 / Florida North,,,,United States (USA) - Florida - FL_N - counties of Alachua; Baker; Bay; Bradford; Calhoun; Columbia; Dixie; Escambia; Escambia; Franklin; Gadsden; Gilchrist; Gulf; Hamilton; Holmes; Jackson; Jefferson; Lafayette; Leon; Liberty; Madison; Okaloosa; Santa Rosa; Suwannee; Taylor; Union; Wakulla; Walton; Washington,projected 2D,,,East,North,X,Y,9003,,4267,10903,1995-06-02 00:00:00,,EPSG,,
+26766,NAD27 / Georgia East,,,,United States (USA) - Georgia - GA_E - counties of Appling; Atkinson; Bacon; Baldwin; Brantley; Bryan; Bulloch; Burke; Camden; Candler; Charlton; Chatham; Clinch; Coffee; Columbia; Dodge; Echols; Effingham; Elbert; Emanuel; Evans; Franklin; Glascock; Glynn; Greene; Hancock; Hart; Jeff Davis; Jefferson; Jenkins; Johnson; Lanier; Laurens; Liberty; Lincoln; Long; Madison; McDuffie; McIntosh; Montgomery; Oglethorpe; Pierce; Richmond; Screven; Stephens; Taliaferr [...]
+26767,NAD27 / Georgia West,,,,United States (USA) - Georgia - GA_W - counties of Baker; Banks; Barrow; Bartow; Ben Hill; Berrien; Bibb; Bleckley; Brooks; Butts; Calhoun; Carroll; Catoosa; Chattahoochee; Chattooga; Cherokee; Clarke; Clay; Clayton; Cobb; Colquitt; Cook; Coweta; Crawford; Crisp; Dade; Dawson; De Kalb; Decatur; Dooly; Dougherty; Douglas; Early; Fannin; Fayette; Floyd; Forsyth; Fulton; Gilmer; Gordon; Grady; Gwinnett; Habersham; Hall; Haralson; Harris; Heard; Henry; Houston;  [...]
+26768,NAD27 / Idaho East,,,,United States (USA) - Idaho - ID_E - counties of Bannock; Bear Lake; Bingham; Bonneville; Caribou; Clark; Franklin; Fremont; Jefferson; Madison; Oneida; Power; Teton,projected 2D,,,East,North,X,Y,9003,,4267,11101,1995-06-02 00:00:00,,EPSG,,
+26769,NAD27 / Idaho Central,,,,United States (USA) - daho - ID_C - counties of Blaine; Butte; Camas; Cassia; Custer; Gooding; Jerome; Lemhi; Lincoln; Minidoka; Twin Falls,projected 2D,,,East,North,X,Y,9003,,4267,11102,1995-06-02 00:00:00,,EPSG,,
+26770,NAD27 / Idaho West,,,,United States (USA) - Idaho - ID_W - counties of Ada; Adams; Benewah; Boise; Bonner; Boundary; Canyon; Clearwater; Elmore; Gem; Idaho; Kootenai; Latah; Lewis; Nez Perce; Owyhee; Payette; Shoshone; Valley; Washington,projected 2D,,,East,North,X,Y,9003,,4267,11103,1995-06-02 00:00:00,,EPSG,,
+26771,NAD27 / Illinois East,,,,United States (USA) - Illinois - IL_E - counties of Boone; Champaign; Clark; Clay; Coles; Cook; Crawford; Cumberland; De Kalb; De Witt; Douglas; Du Page; Edgar; Edwards; Effingham; Fayette; Ford; Franklin; Gallatin; Grundy; Hamilton; Hardin; Iroquois; Jasper; Jefferson; Johnson; Kane; Kankakee; Kendall; La Salle; Lake; Lawrence; Livingston; Macon; Marion; Massac; McHenry; McLean; Moultrie; Piatt; Pope; Richland; Saline; Shelby; Vermilion; Wabash; Wayne; Whi [...]
+26772,NAD27 / Illinois West,,,,United States (USA) - Illinois - IL_W - counties of Adams; Alexander; Bond; Brown; Bureau; Calhoun; Carroll; Cass; Christian; Clinton; Fulton; Greene; Hancock; Henderson; Henry; Jackson; Jersey; Jo Daviess; Knox; Lee; Logan; Macoupin; Madison; Marshall; Mason; McDonough; Menard; Mercer; Monroe; Montgomery; Morgan; Ogle; Peoria; Perry; Pike; Pulaski; Putnam; Randolph; Rock Island; Sangamon; Schuyler; Scott; St. Clair; Stark; Stephenson; Tazewell; Union; Warr [...]
+26773,NAD27 / Indiana East,,,,United States (USA) - Indiana - IN_E - counties of Adams; Allen; Bartholomew; Blackford; Brown; Cass; Clark; De Kalb; Dearborn; Decatur; Delaware; Elkhart; Fayette; Floyd; Franklin; Fulton; Grant; Hamilton; Hancock; Harrison; Henry; Howard; Huntington; Jackson; Jay; Jefferson; Jennings; Johnson; Kosciusko; Lagrange; Madison; Marion; Marshall; Miami; Noble; Ohio; Randolph; Ripley; Rush; Scott; Shelby; St. Joseph; Steuben; Switzerland; Tipton; Union; Wabash; W [...]
+26774,NAD27 / Indiana West,,,,United States (USA) - Indiana - IN_W - counties of Benton; Boone; Carroll; Clay; Clinton; Crawford; Daviess; Dubois; Fountain; Gibson; Greene; Hendricks; Jasper; Knox; La Porte; Lake; Lawrence; Martin; Monroe; Montgomery; Morgan; Newton; Orange; Owen; Parke; Perry; Pike; Porter; Posey; Pulaski; Putnam; Spencer; Starke; Sullivan; Tippecanoe; Vanderburgh; Vermillion; Vigo; Warren; Warrick; White,projected 2D,,,East,North,X,Y,9003,,4267,11302,1995-06-02 00:00:0 [...]
+26775,NAD27 / Iowa North,,,,United States (USA) - Iowa - IA_N - counties of Allamakee; Benton; Black Hawk; Boone; Bremer; Buchanan; Buena Vista; Butler; Calhoun; Carroll; Cerro Gordo; Cherokee; Chickasaw; Clay; Clayton; Crawford; Delaware; Dickinson; Dubuque; Emmet; Fayette; Floyd; Franklin; Greene; Grundy; Hamilton; Hancock; Hardin; Howard; Humboldt; Ida; Jackson; Jones; Kossuth; Linn; Lyon; Marshall; Mitchell; Monona; O'Brien; Osceola; Palo Alto; Plymouth; Pocahontas; Sac; Sioux; Story [...]
+26776,NAD27 / Iowa South,,,,United States (USA) - Iowa - IA_S - counties of Adair; Adams; Appanoose; Audubon; Cass; Cedar; Clarke; Clinton; Dallas; Davis; Decatur; Des Moines; Fremont; Guthrie; Harrison; Henry; Iowa; Jasper; Jefferson; Johnson; Keokuk; Lee; Louisa; Lucas; Madison; Mahaska; Marion; Mills; Monroe; Montgomery; Muscatine; Page; Polk; Pottawattamie; Poweshiek; Ringgold; Scott; Shelby; Taylor; Union; Van Buren; Wapello; Warren; Washington; Wayne,projected 2D,,,East,North,X,Y,9 [...]
+26777,NAD27 / Kansas North,,,,United States (USA) - Kansas - KS_N - counties of Atchison; Brown; Cheyenne; Clay; Cloud; Decatur; Dickinson; Doniphan; Douglas; Ellis; Ellsworth; Geary; Gove; Graham; Jackson; Jefferson; Jewell; Johnson; Leavenworth; Lincoln; Logan; Marshall; Mitchell; Morris; Nemaha; Norton; Osborne; Ottawa; Phillips; Pottawatomie; Rawlins; Republic; Riley; Rooks; Russell; Saline; Shawnee; Sheridan; Sherman; Smith; Thomas; Trego; Wabaunsee; Wallace; Washington; Wyandotte,p [...]
+26778,NAD27 / Kansas South,,,,United States (USA) - Kansas - KS_S - counties of Allen; Anderson; Barber; Barton; Bourbon; Butler; Chase; Chautauqua; Cherokee; Clark; Coffey; Comanche; Cowley; Crawford; Edwards; Elk; Finney; Ford; Franklin; Grant; Gray; Greeley; Greenwood; Hamilton; Harper; Harvey; Haskell; Hodgeman; Kearny; Kingman; Kiowa; Labette; Lane; Linn; Lyon; Marion; McPherson; Meade; Miami; Montgomery; Morton; Neosho; Ness; Osage; Pawnee; Pratt; Reno; Rice; Rush; Scott; Sedgwick; [...]
+26779,NAD27 / Kentucky North,,,,United States (USA) - Kentucky - KY_N - counties of Anderson; Bath; Boone; Bourbon; Boyd; Bracken; Bullitt; Campbell; Carroll; Carter; Clark; Elliott; Fayette; Fleming; Franklin; Gallatin; Grant; Greenup; Harrison; Henry; Jefferson; Jessamine; Kenton; Lawrence; Lewis; Mason; Menifee; Montgomery; Morgan; Nicholas; Oldham; Owen; Pendleton; Robertson; Rowan; Scott; Shelby; Spencer; Trimble; Woodford,projected 2D,,,East,North,X,Y,9003,,4267,11601,1995-06-02 00 [...]
+26780,NAD27 / Kentucky South,,,,United States (USA) - Kentucky - KY_S - counties of Adair; Allen; Ballard; Barren; Bell; Boyle; Breathitt; Breckinridge; Butler; Caldwell; Calloway; Carlisle; Casey; Christian; Clay; Clinton; Crittenden; Cumberland; Daviess; Edmonson; Estill; Floyd; Fulton; Garrard; Graves; Grayson; Green; Hancock; Hardin; Harlan; Hart; Henderson; Hickman; Hopkins; Jackson; Johnson; Knott; Knox; Larue; Laurel; Lee; Leslie; Letcher; Lincoln; Livingston; Logan; Lyon; Madison [...]
+26781,NAD27 / Louisiana North,,,,United States (USA) - Louisiana - LA_N - counties of Avoyelles; Bienville; Bossier; Caddo; Caldwell; Catahoula; Claiborne; Concordia; De Soto; East Carroll; Franklin; Grant; Jackson; La Salle; Lincoln; Madison; Morehouse; Natchitoches; Ouachita; Rapides; Red River; Richland; Sabine; Tensas; Union; Vernon; Webster; West Carroll; Winn,projected 2D,,,East,North,X,Y,9003,,4267,11701,1995-06-02 00:00:00,,EPSG,,
+26782,NAD27 / Louisiana South,,,,United States (USA) - Louisiana - LA_S - counties of Acadia; Allen; Ascension; Assumption; Beauregard; Calcasieu; Cameron; East Baton Rouge; East Feliciana; Evangeline; Iberia; Iberville; Jefferson; Jefferson Davis; Lafayette; LaFourche; Livingston; Orleans; Plaquemines; Pointe Coupee; St. Bernard; St. Charles; St. Helena; St. James; St. John the Baptist; St. Landry; St. Martin; St. Mary; St. Tammany; Tangipahoa; Terrebonne; Vermilion; Washington; West Ba [...]
+26783,NAD27 / Maine East,,,,United States (USA) - Maine - ME_E - counties of Aroostook; Hancock; Knox; Penobscot; Piscataquis; Waldo; Washington,projected 2D,,,East,North,X,Y,9003,,4267,11801,1995-06-02 00:00:00,,EPSG,,
+26784,NAD27 / Maine West,,,,United States (USA) - Maine - ME_W - counties of Androscoggin; Cumberland; Franklin; Kennebec; Lincoln; Oxford; Sagadahoc; Somerset; York,projected 2D,,,East,North,X,Y,9003,,4267,11802,1995-06-02 00:00:00,,EPSG,,
+26785,NAD27 / Maryland,,,,United States (USA) - Maryland -MD - counties of Allegany; Anne Arundel; Baltimore; Calvert; Caroline; Carroll; Cecil; Charles; Dorchester; Frederick; Garrett; Harford; Howard; Kent; Montgomery; Prince Georges; Queen Annes; Somerset; St. Marys; Talbot; Washington; Wicomico; Worcester,projected 2D,,,East,North,X,Y,9003,,4267,11900,1995-06-02 00:00:00,,EPSG,,
+26786,NAD27 / Massachusetts Mainland,NAD27 / Massachusetts,,,United States (USA) - Massachusetts - MA_M - counties of Barnstable; Berkshire; Bristol; Essex; Franklin; Hampden; Hampshire; Middlesex; Norfolk; Plymouth; Suffolk; Worcester,projected 2D,,,East,North,X,Y,9003,,4267,12001,1995-06-02 00:00:00,,EPSG,,
+26787,NAD27 / Massachusetts Island,NAD27 / Massachusetts Is,,,United States (USA) - Massachusetts - MA_I - counties of Dukes; Nantucket,projected 2D,,,East,North,X,Y,9003,,4267,12002,1995-06-02 00:00:00,,EPSG,,
+26791,NAD27 / Minnesota North,,,,United States (USA) - Minnesota - MN_N - counties of Beltrami; Clearwater; Cook; Itasca; Kittson; Koochiching; Lake; Lake of the Woods; Mahnomen; Marshall; Norman; Pennington; Polk; Red Lake; Roseau; St. Louis,projected 2D,,,East,North,X,Y,9003,,4267,12201,1995-06-02 00:00:00,,EPSG,,
+26792,NAD27 / Minnesota Central,NAD27 / Minnesota Cent.,,,United States (USA) - Minnesota - MN_C - counties of Aitkin; Becker; Benton; Carlton; Cass; Chisago; Clay; Crow Wing; Douglas; Grant; Hubbard; Isanti; Kanabec; Mille Lacs; Morrison; Otter Tail; Pine; Pope; Stearns; Stevens; Todd; Traverse; Wadena; Wilkin,projected 2D,,,East,North,X,Y,9003,,4267,12202,1995-06-02 00:00:00,,EPSG,,
+26793,NAD27 / Minnesota South,,,,United States (USA) - Minnesota - MN_S - counties of Anoka; Big Stone; Blue Earth; Brown; Carver; Chippewa; Cottonwood; Dakota; Dodge; Faribault; Fillmore; Freeborn; Goodhue; Hennepin; Houston; Jackson; Kandiyohi; Lac Qui Parle; Le Sueur; Lincoln; Lyon; Martin; McLeod; Meeker; Mower; Murray; Nicollet; Nobles; Olmsted; Pipestone; Ramsey; Redwood; Renville; Rice; Rock; Scott; Sherburne; Sibley; Steele; Swift; Wabasha; Waseca; Washington; Watonwan; Winona; W [...]
+26794,NAD27 / Mississippi East,,,,United States (USA) - Mississippi - MS_E - counties of Alcorn; Attala; Benton; Calhoun; Chickasaw; Choctaw; Clarke; Clay; Covington; Forrest; George; Greene; Hancock; Harrison; Itawamba; Jackson; Jasper; Jones; Kemper; Lafayette; Lamar; Lauderdale; Leake; Lee; Lowndes; Marshall; Monroe; Neshoba; Newton; Noxubee; Oktibbeha; Pearl River; Perry; Pontotoc; Prentiss; Scott; Smith; Stone; Tippah; Tishomingo; Union; Wayne; Webster; Winston,projected 2D,,,East,N [...]
+26795,NAD27 / Mississippi West,,,,United States (USA) - Mississippi - MS_W - counties of Adams; Amite; Bolivar; Carroll; Claiborne; Coahoma; Copiah; De Soto; Franklin; Grenada; Hinds; Holmes; Humphreys; Issaquena; Jefferson; Jefferson Davis; Lawrence; Leflore; Lincoln; Madison; Marion; Montgomery; Panola; Pike; Quitman; Rankin; Sharkey; Simpson; Sunflower; Tallahatchie; Tate; Tunica; Walthall; Warren; Washington; Wilkinson; Yalobusha; Yazoo,projected 2D,,,East,North,X,Y,9003,,4267,12302, [...]
+26796,NAD27 / Missouri East,,,,United States (USA) - Missouri - MO_E - counties of Bollinger; Butler; Cape Girardeau; Carter; Clark; Crawford; Dent; Dunklin; Franklin; Gasconade; Iron; Jefferson; Lewis; Lincoln; Madison; Marion; Mississippi; Montgomery; New Madrid; Oregon; Pemiscot; Perry; Pike; Ralls; Reynolds; Ripley; Scott; Shannon; St. Charles; St. Francois; St. Louis; Ste. Genevieve; Stoddard; Warren; Washington; Wayne,projected 2D,,,East,North,X,Y,9003,,4267,12401,1995-06-02 00:00: [...]
+26797,NAD27 / Missouri Central,,,,United States (USA) - Missouri - MO_C - counties of Adair; Audrain; Benton; Boone; Callaway; Camden; Carroll; Chariton; Christian; Cole; Cooper; Dallas; Douglas; Greene; Grundy; Hickory; Howard; Howell; Knox; Laclede; Linn; Livingston; Macon; Maries; Mercer; Miller; Moniteau; Monroe; Morgan; Osage; Ozark; Pettis; Phelps; Polk; Pulaski; Putnam; Randolph; Saline; Schuyler; Scotland; Shelby; Stone; Sullivan; Taney; Texas; Webster; Wright,projected 2D,,,East [...]
+26798,NAD27 / Missouri West,,,,United States (USA) - Missouri - MO_W - counties of Andrew; Atchison; Barry; Barton; Bates; Buchanan; Caldwell; Cass; Cedar; Clay; Clinton; Dade; Daviess; De Kalb; Gentry; Harrison; Henry; Holt; Jackson; Jasper; Johnson; Lafayette; Lawrence; McDonald; Newton; Nodaway; Platte; Ray; St. Clair; Vernon; Worth,projected 2D,,,East,North,X,Y,9003,,4267,12403,1995-06-02 00:00:00,,EPSG,,
+26801,NAD Michigan / Michigan East,NAD27 / Michigan East,,,United States (USA) - Michigan - MI_E - counties of Alcona; Alpena; Arenac; Bay; Cheboygan; Clinton; Crawford; Genesee; Gladwin; Gratiot; Hillsdale; Huron; Ingham; Iosco; Jackson; Lapeer; Lenawee; Livingston; Macomb; Midland; Monroe; Montmorency; Oakland; Ogemaw; Oscoda; Otsego; Presque Isle; Roscommon; Saginaw; Sanilac; Shiawassee; St. Clair; Tuscola; Washtenaw; Wayne,projected 2D,,,East,North,X,Y,9003,,4268,12101,1998-11-11 00: [...]
+26802,NAD Michigan / Michigan Old Central,NAD27 / Michigan Old Cen,,,United States (USA) - Michigan - MI_C - counties of Allegan; Antrim; Barry; Benzie; Berrien; Branch; Calhoun; Cass; Charlevoix; Clare; Eaton; Emmet; Grand Traverse; Ionia; Isabella; Kalamazoo; Kalkaska; Kent; Lake; Leelanau; Manistee; Mason; Mecosta; Missaukee; Montcalm; Muskegon; Newaygo; Oceana; Osceola; Ottawa; St. Joseph; Van Buren; Wexford,projected 2D,,,East,North,X,Y,9003,,4268,12102,1998-11-11 00:00:00,,EPSG,Sup [...]
+26803,NAD Michigan / Michigan West,NAD27 / Michigan West,,,United States (USA) - Michigan - MI_W - counties of Alger; Baraga; Chippewa; Delta; Dickinson; Gogebic; Houghton; Iron; Keweenaw; Luce; Mackinac; Marquette; Menominee; Ontonagon; Schoolcraft,projected 2D,,,East,North,X,Y,9003,,4268,12103,1998-11-11 00:00:00,,EPSG,Superseded by 26811 26812 and 26813.,95.25  97.19  98.22
+26811,NAD Michigan / Michigan North,NAD27 / Michigan North,,,United States (USA) - Michigan - MI_N - counties of Alger; Baraga; Chippewa; Delta; Dickinson; Gogebic; Houghton; Iron; Keweenaw; Luce; Mackinac; Marquette; Menominee; Ontonagon; Schoolcraft,projected 2D,,,East,North,X,Y,9003,,4268,12111,1998-11-11 00:00:00,,EPSG,Supersedes 26801 26802 and 26803.,96.28  98.22
+26812,NAD Michigan / Michigan Central,NAD27 / Michigan Central,,,United States (USA) - Michigan - MI_C - counties of Alcona; Alpena; Antrim; Arenac; Benzie; Charlevoix; Cheboygan; Clare; Crawford; Emmet; Gladwin; Grand Traverse; Iosco; Kalkaska; Lake; Leelanau; Manistee; Mason; Missaukee; Montmorency; Ogemaw; Osceola; Oscoda; Otsego; Presque Isle; Roscommon; Wexford,projected 2D,,,East,North,X,Y,9003,,4268,12112,1998-11-11 00:00:00,,EPSG,Supersedes 26801 26802 and 26803.,96.28  97.19  98.22
+26813,NAD Michigan / Michigan South,NAD27 / Michigan South,,,United States (USA) - Michigan - MI_S - counties of Allegan; Barry; Bay; Berrien; Branch; Calhoun; Cass; Clinton; Eaton; Genesee; Gratiot; Hillsdale; Huron; Ingham; Ionia; Isabella; Jackson; Kalamazoo; Kent; Lapeer; Lenawee; Livingston; Macomb; Mecosta; Midland; Monroe; Montcalm; Muskegon; Newaygo; Oakland; Oceana; Ottawa; Saginaw; Sanilac; Shiawassee; St. Clair; St. Joseph; Tuscola; Van Buren; Washtenaw; Wayne,projected 2D,,,E [...]
+26903,NAD83 / UTM zone 3N,,,,North America - United States (USA) - Alaska - 168deg West  to 162deg West.,projected 2D,,,East,North,E,N,9001,,4269,16003,1995-06-02 00:00:00,,EPSG,,
+26904,NAD83 / UTM zone 4N,,,,North America - United States (USA) - Alaska - 162deg West  to 156deg West.,projected 2D,,,East,North,E,N,9001,,4269,16004,1995-06-02 00:00:00,,EPSG,,
+26905,NAD83 / UTM zone 5N,,,,North America - United States (USA) - Alaska - 156deg West  to 150deg West.,projected 2D,,,East,North,E,N,9001,,4269,16005,1995-06-02 00:00:00,,EPSG,,
+26906,NAD83 / UTM zone 6N,,,,North America - United States (USA) - Alaska - 150deg West  to 144deg West.,projected 2D,,,East,North,E,N,9001,,4269,16006,1995-06-02 00:00:00,,EPSG,,
+26907,NAD83 / UTM zone 7N,,,,North America - Canada; United States (USA) - Alaska - 144deg West  to 138deg West.,projected 2D,,,East,North,E,N,9001,,4269,16007,1995-06-02 00:00:00,,EPSG,,
+26908,NAD83 / UTM zone 8N,,,,North America - Canada; United States (USA) - 138deg West  to 132deg West.,projected 2D,,,East,North,E,N,9001,,4269,16008,1995-06-02 00:00:00,,EPSG,,
+26909,NAD83 / UTM zone 9N,,,,North America - Canada; United States (USA) - 132deg West  to 126deg West.,projected 2D,,,East,North,E,N,9001,,4269,16009,1995-06-02 00:00:00,,EPSG,,
+26910,NAD83 / UTM zone 10N,,,,North America - Canada; United States (USA) - 130deg West  to 120deg West.,projected 2D,,,East,North,E,N,9001,,4269,16010,1995-06-02 00:00:00,,EPSG,,
+26911,NAD83 / UTM zone 11N,,,,North America - Canada; Mexico; United States (USA) - 120deg West  to 114deg West.,projected 2D,,,East,North,E,N,9001,,4269,16011,1995-06-02 00:00:00,,EPSG,,
+26912,NAD83 / UTM zone 12N,,,,North America - Canada; Mexico; United States (USA) - 114deg West  to 108deg West.,projected 2D,,,East,North,E,N,9001,,4269,16012,1995-06-02 00:00:00,,EPSG,,
+26913,NAD83 / UTM zone 13N,,,,North America - Canada; Mexico; United States (USA) - 108deg West  to 102deg West.,projected 2D,,,East,North,E,N,9001,,4269,16013,1995-06-02 00:00:00,,EPSG,,
+26914,NAD83 / UTM zone 14N,,,,North America - Canada; Mexico; United States (USA) - 102deg West  to 96deg West.,projected 2D,,,East,North,E,N,9001,,4269,16014,1995-06-02 00:00:00,,EPSG,,
+26915,NAD83 / UTM zone 15N,,,,North America - Canada; Mexico; United States (USA) - 96deg West  to 90deg West.,projected 2D,,,East,North,E,N,9001,,4269,16015,1995-06-02 00:00:00,,EPSG,,
+26916,NAD83 / UTM zone 16N,,,,North America - Canada; Mexico; United States (USA) - 90deg West  to 84deg West.,projected 2D,,,East,North,E,N,9001,,4269,16016,1995-06-02 00:00:00,,EPSG,,
+26917,NAD83 / UTM zone 17N,,,,North America - Canada; Mexico; United States (USA) - 84deg West  to 78deg West.,projected 2D,,,East,North,E,N,9001,,4269,16017,1995-06-02 00:00:00,,EPSG,,
+26918,NAD83 / UTM zone 18N,,,,North America - Canada; United States (USA) - 78deg West  to 72deg West.,projected 2D,,,East,North,E,N,9001,,4269,16018,1995-06-02 00:00:00,,EPSG,,
+26919,NAD83 / UTM zone 19N,,,,North America - Canada; United States (USA) - 72deg West  to 66deg West.,projected 2D,,,East,North,E,N,9001,,4269,16019,1995-06-02 00:00:00,,EPSG,,
+26920,NAD83 / UTM zone 20N,,,,North America - Canada; United States (USA) offshore Atlantic - 66deg West  to 60deg West.,projected 2D,,,East,North,E,N,9001,,4269,16020,1995-06-02 00:00:00,,EPSG,,
+26921,NAD83 / UTM zone 21N,,,,North America - Canada - 60deg West  to 54deg West.,projected 2D,,,East,North,E,N,9001,,4269,16021,1995-06-02 00:00:00,,EPSG,,
+26922,NAD83 / UTM zone 22N,,,,North America - Canada - Newfoundland - 54deg West  to 48deg West.,projected 2D,,,East,North,E,N,9001,,4269,16022,1995-06-02 00:00:00,,EPSG,,
+26923,NAD83 / UTM zone 23N,,,,North America - Canada offshore Atlantic - 48deg West  to 42deg West.,projected 2D,,,East,North,E,N,9001,,4269,16023,1995-06-02 00:00:00,,EPSG,,
+26929,NAD83 / Alabama East,,,,United States (USA) - Alabama - AL_E - counties east of approx 86d 37m West - Barbour; Bullock; Calhoun; Chambers; Cherokee; Clay; Cleburne; Coffee; Coosa; Covington; Crenshaw; Dale; De Kalb; Elmore; Etowah; Geneva; Henry; Houston; Jackson; Lee; Macon; Madison; Marshall; Montgomery; Pike; Randolph; Russell; St.Clair; Talladega; Tallapoosa,projected 2D,,,East,North,X,Y,9001,,4269,10131,1995-06-02 00:00:00,,EPSG,,
+26930,NAD83 / Alabama West,,,,United States (USA) - Alabama - AL_W - counties west of approx 86d 37m West - Autauga; Baldwin; Bibb; Blount; Butler; Chilton; Choctaw; Clarke; Colbert; Conecuh; Cullman; Dallas; Escambia; Fayette; Franklin; Greene; Hale; Jefferson; Lamar; Lauderdale; Lawrence; Limestone; Lowndes; Marengo; Marion; Mobile; Monroe; Morgan; Perry; Pickens; Shelby; Sumter; Tuscaloosa; Walker; Washington; Wilcox; Winston,projected 2D,,,East,North,X,Y,9001,,4269,10132,1995-06-02 0 [...]
+26931,NAD83 / Alaska zone 1,,,,United States - Alaska - Panhandle.,projected 2D,,,East,North,X,Y,9001,,4269,15031,1995-06-02 00:00:00,,EPSG,,
+26932,NAD83 / Alaska zone 2,,,,United States - Alaska - 141deg to 144deg West.,projected 2D,,,East,North,X,Y,9001,,4269,15032,1995-06-02 00:00:00,,EPSG,,
+26933,NAD83 / Alaska zone 3,,,,United States - Alaska - 144deg to 148deg West.,projected 2D,,,East,North,X,Y,9001,,4269,15033,1995-06-02 00:00:00,,EPSG,,
+26934,NAD83 / Alaska zone 4,,,,United States - Alaska - 148deg to 152deg West.,projected 2D,,,East,North,X,Y,9001,,4269,15034,1995-06-02 00:00:00,,EPSG,,
+26935,NAD83 / Alaska zone 5,,,,United States - Alaska - 152deg to 156deg West.,projected 2D,,,East,North,X,Y,9001,,4269,15035,1995-06-02 00:00:00,,EPSG,,
+26936,NAD83 / Alaska zone 6,,,,United States - Alaska - 156deg to 160deg West.,projected 2D,,,East,North,X,Y,9001,,4269,15036,1995-06-02 00:00:00,,EPSG,,
+26937,NAD83 / Alaska zone 7,,,,United States - Alaska - 160deg to 164deg West.,projected 2D,,,East,North,X,Y,9001,,4269,15037,1995-06-02 00:00:00,,EPSG,,
+26938,NAD83 / Alaska zone 8,,,,United States - Alaska - 164deg to 168deg West north of 54d 30m North.,projected 2D,,,East,North,X,Y,9001,,4269,15038,1995-06-02 00:00:00,,EPSG,,
+26939,NAD83 / Alaska zone 9,,,,United States - Alaska - west of 168deg West and north of 54d 30m North.,projected 2D,,,East,North,X,Y,9001,,4269,15039,1995-06-02 00:00:00,,EPSG,,
+26940,NAD83 / Alaska zone 10,,,,United States - Alaska - Aleutian Islands.,projected 2D,,,East,North,X,Y,9001,,4269,15040,1995-06-02 00:00:00,,EPSG,,
+26941,NAD83 / California zone 1,NAD83 / California 1,,,United States (USA) - California - CA_1 - counties north of approx 40 deg North - Del Norte; Humboldt; Lassen; Modoc; Plumas; Shasta; Siskiyou; Tehama; Trinity,projected 2D,,,East,North,X,Y,9001,,4269,10431,1995-06-02 00:00:00,,EPSG,,
+26942,NAD83 / California zone 2,NAD83 / California 2,,,United States (USA) - California - CA_2 - counties between approx 40 deg & 38d 15m North - Alpine; Amador; Butte; Colusa; El Dorado; Glenn; Lake; Mendocino; Napa; Nevada; Placer; Sacramento; Sierra; Solano; Sonoma; Sutter; Yolo; Yuba,projected 2D,,,East,North,X,Y,9001,,4269,10432,1995-06-02 00:00:00,,EPSG,,
+26943,NAD83 / California zone 3,NAD83 / California 3,,,United States (USA) - California - CA_3 - counties between approx 38d 15m & 37d North - Alameda; Calaveras; Contra Costa; Madera; Marin; Mariposa; Merced; Mono; San Francisco; San Joaquin; San Mateo; Santa Clara; Santa Cruz; Stanislaus; Tuolumne,projected 2D,,,East,North,X,Y,9001,,4269,10433,1995-06-02 00:00:00,,EPSG,,
+26944,NAD83 / California zone 4,NAD83 / California 4,,,United States (USA) - California - CA_4 - counties between approx 37d & 35d 30m North - Fresno; Inyo; Kings; Monterey; San Benito; Tulare,projected 2D,,,East,North,X,Y,9001,,4269,10434,1995-06-02 00:00:00,,EPSG,,
+26945,NAD83 / California zone 5,NAD83 / California 5,,,United States (USA) - California - CA_5 - counties between approx 35d 50m & 34d North - Kern; Los Angeles; San Bernardino; San Luis Obispo; Santa Barbara; Ventura,projected 2D,,,East,North,X,Y,9001,,4269,10435,1995-06-02 00:00:00,,EPSG,,
+26946,NAD83 / California zone 6,NAD83 / California 6,,,United States (USA) - California - CA_6 - counties south of approx 38d 30m North - Imperial; Orange; Riverside; San Diego,projected 2D,,,East,North,X,Y,9001,,4269,10436,1995-06-02 00:00:00,,EPSG,,
+26948,NAD83 / Arizona  East,,,,United States (USA) - Arizona - AZ_E - counties east of approx 110d 45m West - Apache; Cochise; Gila; Graham; Greenlee; Navajo,projected 2D,,,East,North,X,Y,9001,,4269,10231,1995-06-02 00:00:00,,EPSG,,
+26949,NAD83 / Arizona Central,,,,United States (USA) - Arizona - AZ_C - counties between approx 110d 45m and 113d 20m West - Coconino; Maricopa; Pima; Pinal; Santa Cruz; Yavapai,projected 2D,,,East,North,X,Y,9001,,4269,10232,1995-06-02 00:00:00,,EPSG,,
+26950,NAD83 / Arizona West,,,,United States (USA) - Arizona - AZ_W - counties west of approx 113d 20m West - La Paz; Mohave; Yuma,projected 2D,,,East,North,X,Y,9001,,4269,10233,1995-06-02 00:00:00,,EPSG,,
+26951,NAD83 / Arkansas North,,,,United States (USA) - Arkansas - AR_N - counties north of approx 34d 50m North - Baxter; Benton; Boone; Carroll; Clay; Cleburne; Conway; Craighead; Crawford; Crittenden; Cross; Faulkner; Franklin; Fulton; Greene; Independence; Izard; Jackson; Johnson; Lawrence; Logan; Madison; Marion; Mississippi; Newton; Perry; Poinsett; Pope; Randolph; Scott; Searcy; Sebastian; Sharp; St. Francis; Stone; Van Buren; Washington; White; Woodruff; Yell,projected 2D,,,East,No [...]
+26952,NAD83 / Arkansas South,,,,United States (USA) - Arkansas - AR_S - counties south of approx 34d 50m North - Arkansas; Ashley; Bradley; Calhoun; Chicot; Clark; Cleveland; Columbia; Dallas; Desha; Drew; Garland; Grant; Hempstead; Hot Spring; Howard; Jefferson; Lafayette; Lee; Lincoln; Little River; Lonoke; Miller; Monroe; Montgomery; Nevada; Ouachita; Phillips; Pike; Polk; Prairie; Pulaski; Saline; Sevier; Union,projected 2D,,,East,North,X,Y,9001,,4269,10332,1995-06-02 00:00:00,,EPSG,,
+26953,NAD83 / Colorado North,,,,United States (USA) - Colorado - CO_N - counties north of approx 39d 50m North - Adams; Boulder; Gilpin; Grand; Jackson; Larimer; Logan; Moffat; Morgan; Phillips; Rio Blanco; Routt; Sedgwick; Washington; Weld; Yuma,projected 2D,,,East,North,X,Y,9001,,4269,10531,1995-06-02 00:00:00,,EPSG,,
+26954,NAD83 / Colorado Central,,,,United States (USA) - Colorado - CO_C - counties between approx 39d 50m & 38d 30m North - Arapahoe; Chaffee; Cheyenne; Clear Creek; Delta; Denver; Douglas; Eagle; El Paso; Elbert; Fremont; Garfield; Gunnison; Jefferson; Kit Carson; Lake; Lincoln; Mesa; Park; Pitkin; Summit; Teller,projected 2D,,,East,North,X,Y,9001,,4269,10532,1995-06-02 00:00:00,,EPSG,,
+26955,NAD83 / Colorado South,,,,United States (USA) - Colorado - CO_S - counties south of approx 38d 30m North - Alamosa; Archuleta; Baca; Bent; Conejos; Costilla; Crowley; Custer; Dolores; Hinsdale; Huerfano; Kiowa; La Plata; Las Animas; Mineral; Montezuma; Montrose; Otero; Ouray; Prowers; Pueblo; Rio Grande; Saguache; San Juan; San Miguel,projected 2D,,,East,North,X,Y,9001,,4269,10533,1995-06-02 00:00:00,,EPSG,,
+26956,NAD83 / Connecticut,,,,United States (USA) - Connecticut - CT - counties of Fairfield; Hartford; Litchfield; Middlesex; New Haven; New London; Tolland; Windham,projected 2D,,,East,North,X,Y,9001,,4269,10630,1995-06-02 00:00:00,,EPSG,,
+26957,NAD83 / Delaware,,,,United States (USA) - Delaware - DE - counties of Kent; New Castle; Sussex,projected 2D,,,East,North,X,Y,9001,,4269,10730,1995-06-02 00:00:00,,EPSG,,
+26958,NAD83 / Florida  East,,,,United States (USA) - Florida - FL_E - counties of Brevard; Broward; Clay; Collier; Dade; Duval; Flagler; Glades; Hendry; Highlands; Indian River; Lake; Martin; Monroe; Nassau; Okeechobee; Orange; Osceola; Palm Beach; Putnam; Seminole; St. Johns; St. Lucie; Volusia,projected 2D,,,East,North,X,Y,9001,,4269,10931,1995-06-02 00:00:00,,EPSG,,
+26959,NAD83 / Florida  West,,,,United States (USA) - Florida - FL_W - counties of Charlotte; Citrus; De Soto; Hardee; Hernando; Hillsborough; Lee; Levy; Manatee; Marion; Pasco; Pinellas; Polk; Sarasota; Sumter,projected 2D,,,East,North,X,Y,9001,,4269,10932,1995-06-02 00:00:00,,EPSG,,
+26960,NAD83 / Florida North,,,,United States (USA) - Florida - FL_N - counties of Alachua; Baker; Bay; Bradford; Calhoun; Columbia; Dixie; Escambia; Escambia; Franklin; Gadsden; Gilchrist; Gulf; Hamilton; Holmes; Jackson; Jefferson; Lafayette; Leon; Liberty; Madison; Okaloosa; Santa Rosa; Suwannee; Taylor; Union; Wakulla; Walton; Washington,projected 2D,,,East,North,X,Y,9001,,4269,10933,1995-06-02 00:00:00,,EPSG,,
+26961,NAD83 / Hawaii  zone 1,,,,United States - Hawaii - island of Hawaii.,projected 2D,,,East,North,X,Y,9001,,4269,15131,1995-06-02 00:00:00,,EPSG,,
+26962,NAD83 / Hawaii  zone 2,,,,United States - Hawaii - Maui; Kahoolawe; Lanai; Molokai.,projected 2D,,,East,North,X,Y,9001,,4269,15132,1995-06-02 00:00:00,,EPSG,,
+26963,NAD83 / Hawaii  zone 3,,,,United States - Hawaii - Oahu.,projected 2D,,,East,North,X,Y,9001,,4269,15133,1995-06-02 00:00:00,,EPSG,,
+26964,NAD83 / Hawaii  zone 4,,,,United States - Hawaii - Kauai.,projected 2D,,,East,North,X,Y,9001,,4269,15134,1995-06-02 00:00:00,,EPSG,,
+26965,NAD83 / Hawaii  zone 5,,,,United States - Hawaii - Niihau.,projected 2D,,,East,North,X,Y,9001,,4269,15135,1995-06-02 00:00:00,,EPSG,,
+26966,NAD83 / Georgia  East,,,,United States (USA) - Georgia - GA_E - counties of Appling; Atkinson; Bacon; Baldwin; Brantley; Bryan; Bulloch; Burke; Camden; Candler; Charlton; Chatham; Clinch; Coffee; Columbia; Dodge; Echols; Effingham; Elbert; Emanuel; Evans; Franklin; Glascock; Glynn; Greene; Hancock; Hart; Jeff Davis; Jefferson; Jenkins; Johnson; Lanier; Laurens; Liberty; Lincoln; Long; Madison; McDuffie; McIntosh; Montgomery; Oglethorpe; Pierce; Richmond; Screven; Stephens; Taliafer [...]
+26967,NAD83 / Georgia West,,,,United States (USA) - Georgia - GA_W - counties of Baker; Banks; Barrow; Bartow; Ben Hill; Berrien; Bibb; Bleckley; Brooks; Butts; Calhoun; Carroll; Catoosa; Chattahoochee; Chattooga; Cherokee; Clarke; Clay; Clayton; Cobb; Colquitt; Cook; Coweta; Crawford; Crisp; Dade; Dawson; De Kalb; Decatur; Dooly; Dougherty; Douglas; Early; Fannin; Fayette; Floyd; Forsyth; Fulton; Gilmer; Gordon; Grady; Gwinnett; Habersham; Hall; Haralson; Harris; Heard; Henry; Houston;  [...]
+26968,NAD83 / Idaho  East,,,,United States (USA) - Idaho - ID_E - counties of Bannock; Bear Lake; Bingham; Bonneville; Caribou; Clark; Franklin; Fremont; Jefferson; Madison; Oneida; Power; Teton,projected 2D,,,East,North,X,Y,9001,,4269,11131,1995-06-02 00:00:00,,EPSG,,
+26969,NAD83 / Idaho  Central,,,,United States (USA) - Idaho - ID_C - counties of Blaine; Butte; Camas; Cassia; Custer; Gooding; Jerome; Lemhi; Lincoln; Minidoka; Twin Falls,projected 2D,,,East,North,X,Y,9001,,4269,11132,1995-06-02 00:00:00,,EPSG,,
+26970,NAD83 / Idaho  West,,,,United States (USA) - Idaho - ID_W - counties of Ada; Adams; Benewah; Boise; Bonner; Boundary; Canyon; Clearwater; Elmore; Gem; Idaho; Kootenai; Latah; Lewis; Nez Perce; Owyhee; Payette; Shoshone; Valley; Washington,projected 2D,,,East,North,X,Y,9001,,4269,11133,1995-06-02 00:00:00,,EPSG,,
+26971,NAD83 / Illinois  East,,,,United States (USA) - Illinois - IL_E - counties of Boone; Champaign; Clark; Clay; Coles; Cook; Crawford; Cumberland; De Kalb; De Witt; Douglas; Du Page; Edgar; Edwards; Effingham; Fayette; Ford; Franklin; Gallatin; Grundy; Hamilton; Hardin; Iroquois; Jasper; Jefferson; Johnson; Kane; Kankakee; Kendall; La Salle; Lake; Lawrence; Livingston; Macon; Marion; Massac; McHenry; McLean; Moultrie; Piatt; Pope; Richland; Saline; Shelby; Vermilion; Wabash; Wayne; Wh [...]
+26972,NAD83 / Illinois  West,,,,United States (USA) - Illinois - IL_W - counties of Adams; Alexander; Bond; Brown; Bureau; Calhoun; Carroll; Cass; Christian; Clinton; Fulton; Greene; Hancock; Henderson; Henry; Jackson; Jersey; Jo Daviess; Knox; Lee; Logan; Macoupin; Madison; Marshall; Mason; McDonough; Menard; Mercer; Monroe; Montgomery; Morgan; Ogle; Peoria; Perry; Pike; Pulaski; Putnam; Randolph; Rock Island; Sangamon; Schuyler; Scott; St. Clair; Stark; Stephenson; Tazewell; Union; War [...]
+26973,NAD83 / Indiana  East,,,,United States (USA) - Indiana - IN_E - counties of Adams; Allen; Bartholomew; Blackford; Brown; Cass; Clark; De Kalb; Dearborn; Decatur; Delaware; Elkhart; Fayette; Floyd; Franklin; Fulton; Grant; Hamilton; Hancock; Harrison; Henry; Howard; Huntington; Jackson; Jay; Jefferson; Jennings; Johnson; Kosciusko; Lagrange; Madison; Marion; Marshall; Miami; Noble; Ohio; Randolph; Ripley; Rush; Scott; Shelby; St. Joseph; Steuben; Switzerland; Tipton; Union; Wabash;  [...]
+26974,NAD83 / Indiana  West,,,,United States (USA) - Indiana - IN_W - counties of Benton; Boone; Carroll; Clay; Clinton; Crawford; Daviess; Dubois; Fountain; Gibson; Greene; Hendricks; Jasper; Knox; La Porte; Lake; Lawrence; Martin; Monroe; Montgomery; Morgan; Newton; Orange; Owen; Parke; Perry; Pike; Porter; Posey; Pulaski; Putnam; Spencer; Starke; Sullivan; Tippecanoe; Vanderburgh; Vermillion; Vigo; Warren; Warrick; White,projected 2D,,,East,North,X,Y,9001,,4269,11332,1995-06-02 00:00: [...]
+26975,NAD83 / Iowa North,,,,United States (USA) - Iowa - IA_N - counties of Allamakee; Benton; Black Hawk; Boone; Bremer; Buchanan; Buena Vista; Butler; Calhoun; Carroll; Cerro Gordo; Cherokee; Chickasaw; Clay; Clayton; Crawford; Delaware; Dickinson; Dubuque; Emmet; Fayette; Floyd; Franklin; Greene; Grundy; Hamilton; Hancock; Hardin; Howard; Humboldt; Ida; Jackson; Jones; Kossuth; Linn; Lyon; Marshall; Mitchell; Monona; O'Brien; Osceola; Palo Alto; Plymouth; Pocahontas; Sac; Sioux; Story [...]
+26976,NAD83 / Iowa South,,,,United States (USA) - Iowa - IA_S - counties of Adair; Adams; Appanoose; Audubon; Cass; Cedar; Clarke; Clinton; Dallas; Davis; Decatur; Des Moines; Fremont; Guthrie; Harrison; Henry; Iowa; Jasper; Jefferson; Johnson; Keokuk; Lee; Louisa; Lucas; Madison; Mahaska; Marion; Mills; Monroe; Montgomery; Muscatine; Page; Polk; Pottawattamie; Poweshiek; Ringgold; Scott; Shelby; Taylor; Union; Van Buren; Wapello; Warren; Washington; Wayne,projected 2D,,,East,North,X,Y,9 [...]
+26977,NAD83 / Kansas North,,,,United States (USA) - Kansas - KS_N - counties of Atchison; Brown; Cheyenne; Clay; Cloud; Decatur; Dickinson; Doniphan; Douglas; Ellis; Ellsworth; Geary; Gove; Graham; Jackson; Jefferson; Jewell; Johnson; Leavenworth; Lincoln; Logan; Marshall; Mitchell; Morris; Nemaha; Norton; Osborne; Ottawa; Phillips; Pottawatomie; Rawlins; Republic; Riley; Rooks; Russell; Saline; Shawnee; Sheridan; Sherman; Smith; Thomas; Trego; Wabaunsee; Wallace; Washington; Wyandotte,p [...]
+26978,NAD83 / Kansas South,,,,United States (USA) - Kansas - KS_S - counties of Allen; Anderson; Barber; Barton; Bourbon; Butler; Chase; Chautauqua; Cherokee; Clark; Coffey; Comanche; Cowley; Crawford; Edwards; Elk; Finney; Ford; Franklin; Grant; Gray; Greeley; Greenwood; Hamilton; Harper; Harvey; Haskell; Hodgeman; Kearny; Kingman; Kiowa; Labette; Lane; Linn; Lyon; Marion; McPherson; Meade; Miami; Montgomery; Morton; Neosho; Ness; Osage; Pawnee; Pratt; Reno; Rice; Rush; Scott; Sedgwick; [...]
+26979,NAD83 / Kentucky North,,,,United States (USA) - Kentucky - KY_N - counties of Anderson; Bath; Boone; Bourbon; Boyd; Bracken; Bullitt; Campbell; Carroll; Carter; Clark; Elliott; Fayette; Fleming; Franklin; Gallatin; Grant; Greenup; Harrison; Henry; Jefferson; Jessamine; Kenton; Lawrence; Lewis; Mason; Menifee; Montgomery; Morgan; Nicholas; Oldham; Owen; Pendleton; Robertson; Rowan; Scott; Shelby; Spencer; Trimble; Woodford,projected 2D,,,East,North,X,Y,9001,,4269,11631,1995-06-02 00 [...]
+26980,NAD83 / Kentucky South,,,,United States (USA) - Kentucky - KY_S - counties of Adair; Allen; Ballard; Barren; Bell; Boyle; Breathitt; Breckinridge; Butler; Caldwell; Calloway; Carlisle; Casey; Christian; Clay; Clinton; Crittenden; Cumberland; Daviess; Edmonson; Estill; Floyd; Fulton; Garrard; Graves; Grayson; Green; Hancock; Hardin; Harlan; Hart; Henderson; Hickman; Hopkins; Jackson; Johnson; Knott; Knox; Larue; Laurel; Lee; Leslie; Letcher; Lincoln; Livingston; Logan; Lyon; Madison [...]
+26981,NAD83 / Louisiana North,,,,United States (USA) - Louisiana - LA_N - counties of Avoyelles; Bienville; Bossier; Caddo; Caldwell; Catahoula; Claiborne; Concordia; De Soto; East Carroll; Franklin; Grant; Jackson; La Salle; Lincoln; Madison; Morehouse; Natchitoches; Ouachita; Rapides; Red River; Richland; Sabine; Tensas; Union; Vernon; Webster; West Carroll; Winn,projected 2D,,,East,North,X,Y,9001,,4269,11731,1995-06-02 00:00:00,,EPSG,,
+26982,NAD83 / Louisiana South,,,,United States (USA) - Louisiana - LA_S - counties of Acadia; Allen; Ascension; Assumption; Beauregard; Calcasieu; Cameron; East Baton Rouge; East Feliciana; Evangeline; Iberia; Iberville; Jefferson; Jefferson Davis; Lafayette; LaFourche; Livingston; Orleans; Plaquemines; Pointe Coupee; St. Bernard; St. Charles; St. Helena; St. James; St. John the Baptist; St. Landry; St. Martin; St. Mary; St. Tammany; Tangipahoa; Terrebonne; Vermilion; Washington; West Ba [...]
+26983,NAD83 / Maine  East,,,,United States (USA) - Maine - ME_E - counties of Aroostook; Hancock; Knox; Penobscot; Piscataquis; Waldo; Washington,projected 2D,,,East,North,X,Y,9001,,4269,11831,1995-06-02 00:00:00,,EPSG,,
+26984,NAD83 / Maine  West,,,,United States (USA) - Maine - ME_W - counties of Androscoggin; Cumberland; Franklin; Kennebec; Lincoln; Oxford; Sagadahoc; Somerset; York,projected 2D,,,East,North,X,Y,9001,,4269,11832,1995-06-02 00:00:00,,EPSG,,
+26985,NAD83 / Maryland,,,,United States (USA) - Maryland -MD - counties of Allegany; Anne Arundel; Baltimore; Calvert; Caroline; Carroll; Cecil; Charles; Dorchester; Frederick; Garrett; Harford; Howard; Kent; Montgomery; Prince Georges; Queen Annes; Somerset; St. Marys; Talbot; Washington; Wicomico; Worcester,projected 2D,,,East,North,X,Y,9001,,4269,11930,1995-06-02 00:00:00,,EPSG,,
+26986,NAD83 / Massachusetts Mainland,NAD83 / Massachusetts,,,United States (USA) - Massachusetts - MA_M - counties of Barnstable; Berkshire; Bristol; Essex; Franklin; Hampden; Hampshire; Middlesex; Norfolk; Plymouth; Suffolk; Worcester,projected 2D,,,East,North,X,Y,9001,,4269,12031,1995-06-02 00:00:00,,EPSG,,
+26987,NAD83 / Massachusetts Island,NAD83 / Massachusetts Is,,,United States (USA) - Massachusetts - MA_I - counties of Dukes; Nantucket,projected 2D,,,East,North,X,Y,9001,,4269,12032,1995-06-02 00:00:00,,EPSG,,
+26988,NAD83 / Michigan North,,,,United States (USA) - Michigan - MI_N - counties of Alger; Baraga; Chippewa; Delta; Dickinson; Gogebic; Houghton; Iron; Keweenaw; Luce; Mackinac; Marquette; Menominee; Ontonagon; Schoolcraft,projected 2D,,,East,North,X,Y,9001,,4269,12141,1995-06-02 00:00:00,,EPSG,,
+26989,NAD83 / Michigan Central,,,,United States (USA) - Michigan - MI_C - counties of Alcona; Alpena; Antrim; Arenac; Benzie; Charlevoix; Cheboygan; Clare; Crawford; Emmet; Gladwin; Grand Traverse; Iosco; Kalkaska; Lake; Leelanau; Manistee; Mason; Missaukee; Montmorency; Ogemaw; Osceola; Oscoda; Otsego; Presque Isle; Roscommon; Wexford,projected 2D,,,East,North,X,Y,9001,,4269,12142,1995-06-02 00:00:00,,EPSG,,
+26990,NAD83 / Michigan South,,,,United States (USA) - Michigan - MI_S - counties of Allegan; Barry; Bay; Berrien; Branch; Calhoun; Cass; Clinton; Eaton; Genesee; Gratiot; Hillsdale; Huron; Ingham; Ionia; Isabella; Jackson; Kalamazoo; Kent; Lapeer; Lenawee; Livingston; Macomb; Mecosta; Midland; Monroe; Montcalm; Muskegon; Newaygo; Oakland; Oceana; Ottawa; Saginaw; Sanilac; Shiawassee; St. Clair; St. Joseph; Tuscola; Van Buren; Washtenaw; Wayne,projected 2D,,,East,North,X,Y,9001,,4269,1214 [...]
+26991,NAD83 / Minnesota North,,,,United States (USA) - Minnesota - MN_N - counties of Beltrami; Clearwater; Cook; Itasca; Kittson; Koochiching; Lake; Lake of the Woods; Mahnomen; Marshall; Norman; Pennington; Polk; Red Lake; Roseau; St. Louis,projected 2D,,,East,North,X,Y,9001,,4269,12231,1995-06-02 00:00:00,,EPSG,,
+26992,NAD83 / Minnesota Central,NAD83 / Minnesota Cent.,,,United States (USA) - Minnesota - MN_C - counties of Aitkin; Becker; Benton; Carlton; Cass; Chisago; Clay; Crow Wing; Douglas; Grant; Hubbard; Isanti; Kanabec; Mille Lacs; Morrison; Otter Tail; Pine; Pope; Stearns; Stevens; Todd; Traverse; Wadena; Wilkin,projected 2D,,,East,North,X,Y,9001,,4269,12232,1995-06-02 00:00:00,,EPSG,,
+26993,NAD83 / Minnesota South,,,,United States (USA) - Minnesota - MN_S - counties of Anoka; Big Stone; Blue Earth; Brown; Carver; Chippewa; Cottonwood; Dakota; Dodge; Faribault; Fillmore; Freeborn; Goodhue; Hennepin; Houston; Jackson; Kandiyohi; Lac Qui Parle; Le Sueur; Lincoln; Lyon; Martin; McLeod; Meeker; Mower; Murray; Nicollet; Nobles; Olmsted; Pipestone; Ramsey; Redwood; Renville; Rice; Rock; Scott; Sherburne; Sibley; Steele; Swift; Wabasha; Waseca; Washington; Watonwan; Winona; W [...]
+26994,NAD83 / Mississippi East,,,,United States (USA) - Mississippi - MS_E - counties of Alcorn; Attala; Benton; Calhoun; Chickasaw; Choctaw; Clarke; Clay; Covington; Forrest; George; Greene; Hancock; Harrison; Itawamba; Jackson; Jasper; Jones; Kemper; Lafayette; Lamar; Lauderdale; Leake; Lee; Lowndes; Marshall; Monroe; Neshoba; Newton; Noxubee; Oktibbeha; Pearl River; Perry; Pontotoc; Prentiss; Scott; Smith; Stone; Tippah; Tishomingo; Union; Wayne; Webster; Winston,projected 2D,,,East,N [...]
+26995,NAD83 / Mississippi West,,,,United States (USA) - Mississippi - MS_W - counties of Adams; Amite; Bolivar; Carroll; Claiborne; Coahoma; Copiah; De Soto; Franklin; Grenada; Hinds; Holmes; Humphreys; Issaquena; Jefferson; Jefferson Davis; Lawrence; Leflore; Lincoln; Madison; Marion; Montgomery; Panola; Pike; Quitman; Rankin; Sharkey; Simpson; Sunflower; Tallahatchie; Tate; Tunica; Walthall; Warren; Washington; Wilkinson; Yalobusha; Yazoo,projected 2D,,,East,North,X,Y,9001,,4269,12332, [...]
+26996,NAD83 / Missouri  East,,,,United States (USA) - Missouri - MO_E - counties of Bollinger; Butler; Cape Girardeau; Carter; Clark; Crawford; Dent; Dunklin; Franklin; Gasconade; Iron; Jefferson; Lewis; Lincoln; Madison; Marion; Mississippi; Montgomery; New Madrid; Oregon; Pemiscot; Perry; Pike; Ralls; Reynolds; Ripley; Scott; Shannon; St. Charles; St. Francois; St. Louis; Ste. Genevieve; Stoddard; Warren; Washington; Wayne,projected 2D,,,East,North,X,Y,9001,,4269,12431,1995-06-02 00:00 [...]
+26997,NAD83 / Missouri Central,,,,United States (USA) - Missouri - MO_C - counties of Adair; Audrain; Benton; Boone; Callaway; Camden; Carroll; Chariton; Christian; Cole; Cooper; Dallas; Douglas; Greene; Grundy; Hickory; Howard; Howell; Knox; Laclede; Linn; Livingston; Macon; Maries; Mercer; Miller; Moniteau; Monroe; Morgan; Osage; Ozark; Pettis; Phelps; Polk; Pulaski; Putnam; Randolph; Saline; Schuyler; Scotland; Shelby; Stone; Sullivan; Taney; Texas; Webster; Wright,projected 2D,,,East [...]
+26998,NAD83 / Missouri  West,,,,United States (USA) - Missouri - MO_W - counties of Andrew; Atchison; Barry; Barton; Bates; Buchanan; Caldwell; Cass; Cedar; Clay; Clinton; Dade; Daviess; De Kalb; Gentry; Harrison; Henry; Holt; Jackson; Jasper; Johnson; Lafayette; Lawrence; McDonald; Newton; Nodaway; Platte; Ray; St. Clair; Vernon; Worth,projected 2D,,,East,North,X,Y,9001,,4269,12433,1995-06-02 00:00:00,,EPSG,,
+27038,Nahrwan 1967 / UTM zone 38N,Nahrwan 1967 / UTM 38N,,,Kuwait west of 48 deg East.,projected 2D,,,East,North,E,N,9001,,4270,16038,1996-04-12 00:00:00,,EPSG,,
+27039,Nahrwan 1967 / UTM zone 39N,Nahrwan 1967 / UTM 39N,,,Kuwait east of 48 deg East.  United Arab Emirates (UAE) - Abu Dhabi - west of 54 deg East.,projected 2D,,,East,North,E,N,9001,,4270,16039,1996-04-12 00:00:00,,EPSG,,96.12
+27040,Nahrwan 1967 / UTM zone 40N,Nahrwan 1967 / UTM 40N,,,United Arab Emirates (UAE) - Abu Dhabi east of 54 deg East; Dubai; Sharjah; Ajman; Fujairah; Ras Al Kaimah; Umm Al Qaiwain.,projected 2D,,,East,North,E,N,9001,,4270,16040,1995-06-02 00:00:00,,EPSG,,
+27120,Naparima 1972 / UTM zone 20N,Naparima / UTM 20N,,,Trinidad and Tobago.,projected 2D,,,East,North,E,N,9001,,4271,16020,1995-06-02 00:00:00,,EPSG,,
+27200,GD49 / New Zealand Map Grid,GD49 / NZ Map Grid,,,New Zealand.,projected 2D,,,East,North,E,N,9001,,4272,19917,1995-06-02 00:00:00,,EPSG,Supersedes 27291 (GD49 / North Island Grid) and 27292 (GD49 / South Island Grid).,
+27291,GD49 / North Island Grid,,,,New Zealand - North Island.,projected 2D,,,East,North,E,N,9040,,4272,18141,1999-10-20 00:00:00,,EPSG,Sears 1922 British foot-metre conversion factor applied to ellipsoid.  Superseded by 27200 (GD49 / New Zealand Map Grid).,97.231
+27292,GD49 / South Island Grid,,,,New Zealand - South Island.,projected 2D,,,East,North,E,N,9040,,4272,18142,1999-10-20 00:00:00,,EPSG,Sears 1922 British foot-metre conversion factor applied to ellipsoid.  Superseded by 27200 (GD49 / New Zealand Map Grid).,97.231
+27391,NGO 1948 (Oslo) / NGO zone I,NGO 1948 / I,,,Norway - west of 3deg 30min W of Oslo (7deg 13min 20.5sec E of Greenwich).,projected 2D,,,North,East,x,y,9001,,4817,18221,1999-10-20 00:00:00,,EPSG,Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 32N.,
+27392,NGO 1948 (Oslo) / NGO zone II,NGO 1948 / II,,,Norway - between 3deg 30min W and 1deg 10min W of Oslo (7deg 13min 20.5sec E  and 9deg 33min 20.5sec E of Greenwich).,projected 2D,,,North,East,x,y,9001,,4817,18222,1999-10-20 00:00:00,,EPSG,Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 32N.,
+27393,NGO 1948 (Oslo) / NGO zone III,NGO 1948 / III,,,Norway - between 1deg 10min W and 1deg 15min E of Oslo (9deg 33min 20.5sec E and 11deg 58min 20.5sec E of Greenwich).,projected 2D,,,North,East,x,y,9001,,4817,18223,1999-10-20 00:00:00,,EPSG,Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 32N.,
+27394,NGO 1948 (Oslo) / NGO zone IV,NGO 1948 / IV,,,Norway - between 1deg 15min E and 4deg 20min E of Oslo (11deg 58min 20.5sec E and 15deg 03min 20.5sec E of Greenwich).,projected 2D,,,North,East,x,y,9001,,4817,18224,1999-10-20 00:00:00,,EPSG,Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 32N and ETRF89 / UTM zone 33N.,
+27395,NGO 1948 (Oslo) / NGO zone V,NGO 1948 / V,,,Norway - between 4deg 20min E and 8deg 10min E of Oslo (15deg 03min 20.5sec E and 18deg 53min 20.5sec E of Greenwich).,projected 2D,,,North,East,x,y,9001,,4817,18225,1999-10-20 00:00:00,,EPSG,Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 33N and ETRF89 / UTM zone 34N.,
+27396,NGO 1948 (Oslo) / NGO zone VI,NGO 1948 / VI,,,Norway - between 8deg 10min E and 12deg 10min E of Oslo (18deg 53min 20.5sec E and 22deg 53min 20.5sec E of Greenwich).,projected 2D,,,North,East,x,y,9001,,4817,18226,1999-10-20 00:00:00,,EPSG,Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 34N.,
+27397,NGO 1948 (Oslo) / NGO zone VII,NGO 1948 / VII,,,Norway - between 12deg 10min E and 16deg 15min E of Oslo (22deg 53min 20.5sec E and 26deg 58min 20.5sec E of Greenwich).,projected 2D,,,North,East,x,y,9001,,4817,18227,1999-10-20 00:00:00,,EPSG,Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 34N and ETRF89 / UTM zone 35N.,
+27398,NGO 1948 (Oslo) / NGO zone VIII,NGO 1948 / VIII,,,Norway - east of 16deg 15min E of Oslo (26deg 58min 20.5sec E of Greenwich).,projected 2D,,,North,East,x,y,9001,,4817,18228,1999-10-20 00:00:00,,EPSG,Used for large (>1:50000) scale mapping and cadastral work.  To be phased out and replaced by ETRF89 / UTM zone 35N.,
+27429,Datum 73 / UTM zone 29N,,,,Portugal - onshore.,projected 2D,,,East,North,E,N,9001,,4274,16029,1995-06-02 00:00:00,,EPSG,,
+27500,ATF (Paris) / Nord de Guerre,ATF / Nord de Guerre,,,France - Alsace.,projected 2D,,,East,North,X,Y,9001,,4901,19903,1995-06-02 00:00:00,,EPSG,,
+27581,NTF (Paris) / France I,NTF / France I,,,France north of 53.5 grads (48 deg 09 min) North.,projected 2D,,,East,North,X,Y,9001,,4807,18081,1996-04-12 00:00:00,,EPSG,Introduced 1972. Supersedes NTF / Nord France (code 27591).,95.26
+27582,NTF (Paris) / France II,NTF / France II,,,France 50.5 to 53.5 grads (45 deg 27 min to 48 deg 09 min) North. Also used over all mainlanf France.,projected 2D,,,East,North,X,Y,9001,,4807,18082,1996-04-12 00:00:00,,EPSG,Introduced 1972. Supersedes NTF / Centre France (code 27592).,95.26
+27583,NTF (Paris) / France III,NTF / France III,,,France south of 50.5 grads (45 deg 27 min) North.,projected 2D,,,East,North,X,Y,9001,,4807,18083,1996-04-12 00:00:00,,EPSG,Introduced 1972. Supersedes NTF / Sud France (code 27593).,95.26
+27584,NTF (Paris) / France IV,NTF / France IV,,,France - Corsica,projected 2D,,,East,North,X,Y,9001,,4807,18084,1996-04-12 00:00:00,,EPSG,Introduced 1972. Supersedes NTF / Corse (code 27594).,
+27591,NTF (Paris) / Nord France,NTF / Nord France,,,France north of 53.5 grads (48 deg 09 min) North.,projected 2D,,,East,North,X,Y,9001,,4807,18091,1996-04-12 00:00:00,,EPSG,Superseded by NTF / France I (code 27581) from 1972.,95.26
+27592,NTF (Paris) / Centre France,NTF / Centre France,,,France 50.5 to 53.5 grads (45 deg 27 min to 48 deg 09 min) North.,projected 2D,,,East,North,X,Y,9001,,4807,18092,1996-04-12 00:00:00,,EPSG,Superseded by NTF / France II (code 27582) from 1972.,95.26
+27593,NTF (Paris) / Sud France,NTF / Sud France,,,France south of 50.5 grads (45 deg 27 min) North.,projected 2D,,,East,North,X,Y,9001,,4807,18093,1996-04-12 00:00:00,,EPSG,Superseded by NTF / France III (code 27583) from 1972.,95.26
+27594,NTF (Paris) / Corse,NTF / Corse,,,France - Corsica,projected 2D,,,East,North,X,Y,9001,,4807,18094,1996-04-12 00:00:00,,EPSG,Superseded by NTF / France IV (code 27584) from 1972.,
+27700,OSGB 1936 / British National Grid,British National Grid,,,United Kingdom (UK) - onshore England; Scotland; Wales; Isle of Man.,projected 2D,,,East,North,E,N,9001,,4277,19916,1995-06-02 00:00:00,,EPSG,,
+28191,Palestine 1923 / Palestine Grid,Palestine Grid,,,Israel; Jordan,projected 2D,,,East,North,E,N,9001,,4281,18201,1999-04-22 00:00:00,,EPSG,,
+28192,Palestine 1923 / Palestine Belt,Palestine Belt,,,Israel; Jordan,projected 2D,,,East,North,E,N,9001,,4281,18202,1999-04-22 00:00:00,,EPSG,,
+28193,Palestine 1923 / Israeli CS Grid,Israeli CS Grid,,,Israel.,projected 2D,,,East,North,E,N,9001,,4281,18203,1999-10-20 00:00:00,Survey of Israel.,EPSG,Superceded by Israeli TM Grid (EPSG code 239).,
+28232,Pointe Noire / UTM zone 32S,Point Noire / UTM 32S,,,Congo.,projected 2D,,,East,North,E,N,9001,,4282,16132,1995-06-02 00:00:00,,EPSG,,
+28348,GDA94 / MGA zone 48,,,,Australia - 102deg East  to 108deg East.,projected 2D,,,East,North,E,N,9001,,4283,17348,1995-06-02 00:00:00,,EPSG,,
+28349,GDA94 / MGA zone 49,,,,Australia - 108deg East  to 114deg East.,projected 2D,,,East,North,E,N,9001,,4283,17349,1995-06-02 00:00:00,,EPSG,,
+28350,GDA94 / MGA zone 50,,,,Australia - 114deg East  to 120deg East.,projected 2D,,,East,North,E,N,9001,,4283,17350,1995-06-02 00:00:00,,EPSG,,
+28351,GDA94 / MGA zone 51,,,,Australia - 120deg East  to 126deg East.,projected 2D,,,East,North,E,N,9001,,4283,17351,1995-06-02 00:00:00,,EPSG,,
+28352,GDA94 / MGA zone 52,,,,Australia - 126deg East  to 132deg East.,projected 2D,,,East,North,E,N,9001,,4283,17352,1995-06-02 00:00:00,,EPSG,,
+28353,GDA94 / MGA zone 53,,,,Australia - 132deg East  to 138deg East.,projected 2D,,,East,North,E,N,9001,,4283,17353,1995-06-02 00:00:00,,EPSG,,
+28354,GDA94 / MGA zone 54,,,,Australia - 138deg East  to 144deg East.,projected 2D,,,East,North,E,N,9001,,4283,17354,1995-06-02 00:00:00,,EPSG,,
+28355,GDA94 / MGA zone 55,,,,Australia - 144deg East  to 150deg East.,projected 2D,,,East,North,E,N,9001,,4283,17355,1995-06-02 00:00:00,,EPSG,,
+28356,GDA94 / MGA zone 56,,,,Australia - 150deg East  to 156deg East.,projected 2D,,,East,North,E,N,9001,,4283,17356,1995-06-02 00:00:00,,EPSG,,
+28357,GDA94 / MGA zone 57,,,,Australia - 156deg East  to 162deg East.,projected 2D,,,East,North,E,N,9001,,4283,17357,1995-06-02 00:00:00,,EPSG,,
+28358,GDA94 / MGA zone 58,,,,Australia - 162deg East  to 168deg East.,projected 2D,,,East,North,E,N,9001,,4283,17358,1995-06-02 00:00:00,,EPSG,,
+28402,Pulkovo 1942 / Gauss-Kruger zone 2,1942 Coord. Sys. zone 2,,,Czech Republic and Germany (former DDR) - west of 12 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16202,1998-06-30 00:00:00,,EPSG,,
+28403,Pulkovo 1942 / Gauss-Kruger zone 3,1942 Coord. Sys. zone 3,,,Czech Republic and Germany ( former DDR) - east of 12 deg East; Poland and Slovakia - west of 18 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16203,1998-06-30 00:00:00,,EPSG,,
+28404,Pulkovo 1942 / Gauss-Kruger zone 4,1942 Coord. Sys. zone 4,,,Estonia; Latvia; Lithuania; Russia; Ukraine; - west of 24 deg East; Poland - east of 24 deg East; Slovakia east of 18 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16204,1995-06-02 00:00:00,,EPSG,,
+28405,Pulkovo 1942 / Gauss-Kruger zone 5,1942 Coord. Sys. zone 5,,,Belarus - west of 30 deg East;  Estonia; Latvia & Lithuania - east of 24 deg East;  Moldova;  Russia &  Ukraine - 24 deg to 30 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16205,1995-06-02 00:00:00,,EPSG,,
+28406,Pulkovo 1942 / Gauss-Kruger zone 6,1942 Coord. Sys. zone 6,,,Belarus - east of 30 deg East;  Russia  &  Ukraine  - 30 deg to 36 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16206,1995-06-02 00:00:00,,EPSG,,
+28407,Pulkovo 1942 / Gauss-Kruger zone 7,1942 Coord. Sys. zone 7,,,Georgia - west of 36 deg East;  Russia  - 36 deg to 42 deg East;  Ukraine - east of 36 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16207,1995-06-02 00:00:00,,EPSG,,
+28408,Pulkovo 1942 / Gauss-Kruger zone 8,1942 Coord. Sys. zone 8,,,Armenia  Azerbaijan - west of 48 deg East;  Georgia - east of 42 deg East;  Russia - 42 deg to 48 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16208,1995-06-02 00:00:00,,EPSG,,
+28409,Pulkovo 1942 / Gauss-Kruger zone 9,1942 Coord. Sys. zone 9,,,Azerbaijan - east of 48 deg East;  Kazakstan - west of 54 deg East;  Russia - 48 deg to 54 deg East;  Turkmenistan - west of 54 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16209,1995-06-02 00:00:00,,EPSG,,
+28410,Pulkovo 1942 / Gauss-Kruger zone 10,1942 Coord. Sys. zone 10,,,Kazakstan;  Russia;  Turkmenistan  - 54 deg  to 60 deg East; Uzbekistan - west of 60 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16210,1995-06-02 00:00:00,,EPSG,,
+28411,Pulkovo 1942 / Gauss-Kruger zone 11,1942 Coord. Sys. zone 11,,,Kazakstan;  Russia;  Uzbekistan - 60 deg to 66 deg East;  Turkmenistan - east of 60 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16211,1995-06-02 00:00:00,,EPSG,,
+28412,Pulkovo 1942 / Gauss-Kruger zone 12,1942 Coord. Sys. zone 12,,,Kazakstan &  Russia - 66 deg to 72 deg East;  Kirgistan & Tadzhikstan - west of 72 deg East;  Uzbekistan - east of 66 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16212,1995-06-02 00:00:00,,EPSG,,
+28413,Pulkovo 1942 / Gauss-Kruger zone 13,1942 Coord. Sys. zone 13,,,Kazakstan;  Kirgizstan;  Russia - 72 deg to 78 deg East;  Tadzhikstan - east of 72 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16213,1995-06-02 00:00:00,,EPSG,,
+28414,Pulkovo 1942 / Gauss-Kruger zone 14,1942 Coord. Sys. zone 14,,,Kazakstan &  Russia - 78 deg to 84 deg East; Kirgizstan - east of 78 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16214,1995-06-02 00:00:00,,EPSG,,
+28415,Pulkovo 1942 / Gauss-Kruger zone 15,1942 Coord. Sys. zone 15,,,Kazakstan - east of 84 deg East;  Russia - 84 deg to 90 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16215,1995-06-02 00:00:00,,EPSG,,
+28416,Pulkovo 1942 / Gauss-Kruger zone 16,1942 Coord. Sys. zone 16,,,Russia - 90 deg to 96 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16216,1995-06-02 00:00:00,,EPSG,,
+28417,Pulkovo 1942 / Gauss-Kruger zone 17,1942 Coord. Sys. zone 17,,,Russia - 96 deg to 102deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16217,1995-06-02 00:00:00,,EPSG,,
+28418,Pulkovo 1942 / Gauss-Kruger zone 18,1942 Coord. Sys. zone 18,,,Russia - 102 deg to 108 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16218,1995-06-02 00:00:00,,EPSG,,
+28419,Pulkovo 1942 / Gauss-Kruger zone 19,1942 Coord. Sys. zone 19,,,Russia - 108 deg to 114 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16219,1995-06-02 00:00:00,,EPSG,,
+28420,Pulkovo 1942 / Gauss-Kruger zone 20,1942 Coord. Sys. zone 20,,,Russia - 114 deg to 120 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16220,1995-06-02 00:00:00,,EPSG,,
+28421,Pulkovo 1942 / Gauss-Kruger zone 21,1942 Coord. Sys. zone 21,,,Russia - 120 deg to 126 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16221,1995-06-02 00:00:00,,EPSG,,
+28422,Pulkovo 1942 / Gauss-Kruger zone 22,1942 Coord. Sys. zone 22,,,Russia - 126 deg to 132 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16222,1995-06-02 00:00:00,,EPSG,,
+28423,Pulkovo 1942 / Gauss-Kruger zone 23,1942 Coord. Sys. zone 23,,,Russia - 132 deg to 138 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16223,1995-06-02 00:00:00,,EPSG,,
+28424,Pulkovo 1942 / Gauss-Kruger zone 24,1942 Coord. Sys. zone 24,,,Russia - 138 deg to 144 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16224,1995-06-02 00:00:00,,EPSG,,
+28425,Pulkovo 1942 / Gauss-Kruger zone 25,1942 Coord. Sys. zone 25,,,Russia - 144 deg to 150 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16225,1995-06-02 00:00:00,,EPSG,,
+28426,Pulkovo 1942 / Gauss-Kruger zone 26,1942 Coord. Sys. zone 26,,,Russia - 150 deg to 156 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16226,1995-06-02 00:00:00,,EPSG,,
+28427,Pulkovo 1942 / Gauss-Kruger zone 27,1942 Coord. Sys. zone 27,,,Russia - 156 deg to 162 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16227,1995-06-02 00:00:00,,EPSG,,
+28428,Pulkovo 1942 / Gauss-Kruger zone 28,1942 Coord. Sys. zone 28,,,Russia - 162 deg to 168 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16228,1995-06-02 00:00:00,,EPSG,,
+28429,Pulkovo 1942 / Gauss-Kruger zone 29,1942 Coord. Sys. zone 29,,,Russia - 168 deg to 174 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16229,1995-06-02 00:00:00,,EPSG,,
+28430,Pulkovo 1942 / Gauss-Kruger zone 30,1942 Coord. Sys. zone 30,,,Russia - 174 deg East to 180 deg.,projected 2D,,,North,East,X,Y,9001,,4284,16230,1995-06-02 00:00:00,,EPSG,,
+28431,Pulkovo 1942 / Gauss-Kruger zone 31,1942 Coord. Sys. zone 31,,,Russia - 180 deg to 174 deg West.,projected 2D,,,North,East,X,Y,9001,,4284,16231,1995-06-02 00:00:00,,EPSG,,
+28432,Pulkovo 1942 / Gauss-Kruger zone 32,1942 Coord. Sys. zone 32,,,Russia - east of 174 deg West.,projected 2D,,,North,East,X,Y,9001,,4284,16232,1995-06-02 00:00:00,,EPSG,,
+28462,Pulkovo 1942 / Gauss-Kruger 2N,Pulkovo / Gauss 2N,,,Czech Republic and Germany (former DDR) - west of 12 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16302,1998-06-30 00:00:00,,EPSG,,
+28463,Pulkovo 1942 / Gauss-Kruger 3N,Pulkovo / Gauss 3N,,,Czech Republic and Germany ( former DDR) - east of 12 deg East; Poland and Slovakia - west of 18 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16303,1998-06-30 00:00:00,,EPSG,,
+28464,Pulkovo 1942 / Gauss-Kruger 4N,Pulkovo / Gauss 4N,,,Estonia; Latvia; Lithuania; Russia; Ukraine; - west of 24 deg East; Poland - east of 24 deg East; Slovakia east of 18 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16304,1995-06-02 00:00:00,,EPSG,,
+28465,Pulkovo 1942 / Gauss-Kruger 5N,Pulkovo / Gauss 5N,,,Belarus - west of 30 deg East;  Estonia; Latvia & Lithuania - east of 24 deg East;  Moldova;  Russia &  Ukraine - 24 deg to 30 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16305,1995-06-02 00:00:00,,EPSG,,
+28466,Pulkovo 1942 / Gauss-Kruger 6N,Pulkovo / Gauss 6N,,,Belarus - east of 30 deg East;  Russia  &  Ukraine  - 30 deg to 36 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16306,1995-06-02 00:00:00,,EPSG,,
+28467,Pulkovo 1942 / Gauss-Kruger 7N,Pulkovo / Gauss 7N,,,Georgia - west of 36 deg East;  Russia  - 36 deg to 42 deg East;  Ukraine - east of 36 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16307,1995-06-02 00:00:00,,EPSG,,
+28468,Pulkovo 1942 / Gauss-Kruger 8N,Pulkovo / Gauss 8N,,,Armenia - west of 48 deg East;  Azerbaijan - west of 48 deg East;  Georgia - east of 42 deg East;  Russia - 42 deg to 48 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16308,1995-06-02 00:00:00,,EPSG,,
+28469,Pulkovo 1942 / Gauss-Kruger 9N,Pulkovo / Gauss 9N,,,Azerbaijan - east of 48 deg East;  Kazakstan - west of 54 deg East;  Russia - 48 deg to 54 deg East;  Turkmenistan - west of 54 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16309,1995-06-02 00:00:00,,EPSG,,
+28470,Pulkovo 1942 / Gauss-Kruger 10N,Pulkovo / Gauss 10N,,,Kazakstan;  Russia;  Turkmenistan  - 54 deg  to 60 deg East;  Uzbekistan - west of 60 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16310,1995-06-02 00:00:00,,EPSG,,
+28471,Pulkovo 1942 / Gauss-Kruger 11N,Pulkovo / Gauss 11N,,,Kazakstan;  Russia;  Uzbekistan - 60 deg to 66 deg East;  Turkmenistan - east of 60 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16311,1995-06-02 00:00:00,,EPSG,,
+28472,Pulkovo 1942 / Gauss-Kruger 12N,Pulkovo / Gauss 12N,,,Kazakstan &  Russia - 66 deg to 72 deg East;  Kirgistan & Tadzhikstan - west of 72 deg East;  Uzbekistan - east of 66 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16312,1995-06-02 00:00:00,,EPSG,,
+28473,Pulkovo 1942 / Gauss-Kruger 13N,Pulkovo / Gauss 13N,,,Kazakstan;  Kirgizstan;  Russia - 72 deg to 78 deg East;  Tadzhikstan - east of 72 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16313,1995-06-02 00:00:00,,EPSG,,
+28474,Pulkovo 1942 / Gauss-Kruger 14N,Pulkovo / Gauss 14N,,,Kazakstan &  Russia - 78 deg to 84 deg East;  Kirgizstan - east of 78 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16314,1995-06-02 00:00:00,,EPSG,,
+28475,Pulkovo 1942 / Gauss-Kruger 15N,Pulkovo / Gauss 15N,,,Kazakstan - east of 84 deg East;  Russia - 84 deg to 90 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16315,1995-06-02 00:00:00,,EPSG,,
+28476,Pulkovo 1942 / Gauss-Kruger 16N,Pulkovo / Gauss 16N,,,Russia - 90 deg to 96 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16316,1995-06-02 00:00:00,,EPSG,,
+28477,Pulkovo 1942 / Gauss-Kruger 17N,Pulkovo / Gauss 17N,,,Russia - 96 deg to 102deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16317,1995-06-02 00:00:00,,EPSG,,
+28478,Pulkovo 1942 / Gauss-Kruger 18N,Pulkovo / Gauss 18N,,,Russia - 102 deg to 108 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16318,1995-06-02 00:00:00,,EPSG,,
+28479,Pulkovo 1942 / Gauss-Kruger 19N,Pulkovo / Gauss 19N,,,Russia - 108 deg to 114 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16319,1995-06-02 00:00:00,,EPSG,,
+28480,Pulkovo 1942 / Gauss-Kruger 20N,Pulkovo / Gauss 20N,,,Russia - 114 deg to 120 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16320,1995-06-02 00:00:00,,EPSG,,
+28481,Pulkovo 1942 / Gauss-Kruger 21N,Pulkovo / Gauss 21N,,,Russia - 120 deg to 126 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16321,1995-06-02 00:00:00,,EPSG,,
+28482,Pulkovo 1942 / Gauss-Kruger 22N,Pulkovo / Gauss 22N,,,Russia - 126 deg to 132 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16322,1995-06-02 00:00:00,,EPSG,,
+28483,Pulkovo 1942 / Gauss-Kruger 23N,Pulkovo / Gauss 23N,,,Russia - 132 deg to 138 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16323,1995-06-02 00:00:00,,EPSG,,
+28484,Pulkovo 1942 / Gauss-Kruger 24N,Pulkovo / Gauss 24N,,,Russia - 138 deg to 144 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16324,1995-06-02 00:00:00,,EPSG,,
+28485,Pulkovo 1942 / Gauss-Kruger 25N,Pulkovo / Gauss 25N,,,Russia - 144 deg to 150 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16325,1995-06-02 00:00:00,,EPSG,,
+28486,Pulkovo 1942 / Gauss-Kruger 26N,Pulkovo / Gauss 26N,,,Russia - 150 deg to 156 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16326,1995-06-02 00:00:00,,EPSG,,
+28487,Pulkovo 1942 / Gauss-Kruger 27N,Pulkovo / Gauss 27N,,,Russia - 156 deg to 162 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16327,1995-06-02 00:00:00,,EPSG,,
+28488,Pulkovo 1942 / Gauss-Kruger 28N,Pulkovo / Gauss 28N,,,Russia - 162 deg to 168 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16328,1995-06-02 00:00:00,,EPSG,,
+28489,Pulkovo 1942 / Gauss-Kruger 29N,Pulkovo / Gauss 29N,,,Russia - 168 deg to 174 deg East.,projected 2D,,,North,East,X,Y,9001,,4284,16329,1995-06-02 00:00:00,,EPSG,,
+28490,Pulkovo 1942 / Gauss-Kruger 30N,Pulkovo / Gauss 30N,,,Russia - 174 deg East to 180 deg.,projected 2D,,,North,East,X,Y,9001,,4284,16330,1995-06-02 00:00:00,,EPSG,,
+28491,Pulkovo 1942 / Gauss-Kruger 31N,Pulkovo / Gauss 31N,,,Russia - 180 deg to 174 deg West.,projected 2D,,,North,East,X,Y,9001,,4284,16331,1995-06-02 00:00:00,,EPSG,,
+28492,Pulkovo 1942 / Gauss-Kruger 32N,Pulkovo / Gauss 32N,,,Russia - east of 174 deg West.,projected 2D,,,North,East,X,Y,9001,,4284,16332,1995-06-02 00:00:00,,EPSG,,
+28600,Qatar / Qatar National Grid,Qatar National Grid,,,Qatar - onshore.,projected 2D,,,East,North,E,N,9001,,4286,19919,1995-06-02 00:00:00,,EPSG,,
+28991,RD / Netherlands Old,,,,Netherlands - onshore.,projected 2D,,,East,North,X,Y,9001,,4289,19913,1995-06-02 00:00:00,,EPSG,Superseded by 28992 (RD / Netherlands New).,
+28992,RD / Netherlands New,,,,Netherlands - onshore.,projected 2D,,,East,North,X,Y,9001,,4289,19914,1995-06-02 00:00:00,,EPSG,Supersedes 28991 (RD / Netherlands Old).,
+29100,SAD69 / Brazil Polyconic,,,,Brazil,projected 2D,,,East,North,X,Y,9001,,4291,19941,1999-04-22 00:00:00,PetroBras,EPSG,,
+29118,SAD69 / UTM zone 18N,,,,South America - 78deg West to 72deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16018,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.251.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29119,SAD69 / UTM zone 19N,,,,South America - 72deg West to 66deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16019,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29120,SAD69 / UTM zone 20N,,,,South America - 66deg West to 60deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16020,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29121,SAD69 / UTM zone 21N,,,,South America - 60deg West to 54deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16021,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29122,SAD69 / UTM zone 22N,,,,South America - 54deg West to 48deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16022,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29177,SAD69 / UTM zone 17S,,,,South America - 84deg West to 78deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16117,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29178,SAD69 / UTM zone 18S,,,,South America - Brazil - 78deg West to 72deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16118,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29179,SAD69 / UTM zone 19S,,,,South America - Brazil - 72deg West to 66deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16119,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29180,SAD69 / UTM zone 20S,,,,South America - Brazil - 66deg West to 60deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16120,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29181,SAD69 / UTM zone 21S,,,,South America - Brazil - 60deg West to 54deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16121,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29182,SAD69 / UTM zone 22S,,,,South America - Brazil - 54deg West to 48deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4291,16122,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29183,SAD69 / UTM zone 23S,,,,South America - 48deg West to 42deg West.,projected 2D,,,East,North,E,N,9001,,4291,16123,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29184,SAD69 / UTM zone 24S,,,,South America - Brazil - 42deg West to 36deg West.,projected 2D,,,East,North,E,N,9001,,4291,16124,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29185,SAD69 / UTM zone 25S,,,,South America - 36deg West to 30deg West.,projected 2D,,,East,North,E,N,9001,,4291,16125,1995-06-02 00:00:00,,EPSG,Uses GRS67 ellipsoid with 1/f to exactly 2 decimal places.  Precision of ellipsoid entry increased from 2 to 5 dp with change id 97.252.  Error introduced if not using the truncated precision will not exceed 5 cm.,97.252
+29220,Sapper Hill 1943 / UTM zone 20S,Sapper Hill / UTM 20S,,,Falkland Islands - west of 60 deg West.,projected 2D,,,East,North,E,N,9001,,4292,16120,1995-06-02 00:00:00,,EPSG,,
+29221,Sapper Hill 1943 / UTM zone 21S,Sapper Hill / UTM 21S,,,Falkland Islands - east of 60 deg West.,projected 2D,,,East,North,E,N,9001,,4292,16121,1995-06-02 00:00:00,,EPSG,,
+29333,Schwarzeck / UTM zone 33S,Schwarzeck / UTM 33S,,,Namibia - offshore.,projected 2D,,,East,North,E,N,9001,,4293,16133,1996-04-12 00:00:00,,EPSG,,
+29371,South West African Coord. System zone 11,SW African CS zone 11,,,Namibia - west of 12 deg East.,projected 2D,,,West,South,W,S,9031,,4293,17611,1997-06-16 00:00:00,,EPSG,,97.16
+29373,South West African Coord. System zone 13,SW African CS zone 13,,,Namibia - 12 to 14 deg East.,projected 2D,,,West,South,W,S,9031,,4293,17613,1997-06-16 00:00:00,,EPSG,,97.16
+29375,South West African Coord. System zone 15,SW African CS zone 15,,,Namibia - 14 to 16 deg East.,projected 2D,,,West,South,W,S,9031,,4293,17615,1997-06-16 00:00:00,,EPSG,,97.16
+29377,South West African Coord. System zone 17,SW African CS zone 17,,,Namibia - 16 to 18 deg East.,projected 2D,,,West,South,W,S,9031,,4293,17617,1997-06-16 00:00:00,,EPSG,,97.16
+29379,South West African Coord. System zone 19,SW African CS zone 19,,,Namibia - 18 to 20 deg East.,projected 2D,,,West,South,W,S,9031,,4293,17619,1997-06-16 00:00:00,,EPSG,,97.16
+29381,South West African Coord. System zone 21,SW African CS zone 21,,,Namibia - 20 to 22 deg East.,projected 2D,,,West,South,W,S,9031,,4293,17621,1997-06-16 00:00:00,,EPSG,,97.16
+29383,South West African Coord. System zone 23,SW African CS zone 23,,,Namibia - 22 to 24 deg East.,projected 2D,,,West,South,W,S,9031,,4293,17623,1997-06-16 00:00:00,,EPSG,,97.16
+29385,South West African Coord. System zone 25,SW African CS zone 25,,,Namibia - east of 24 deg East.,projected 2D,,,West,South,W,S,9031,,4293,17625,1997-06-16 00:00:00,,EPSG,,97.16
+29635,Sudan / UTM zone 35N,,,,Sudan - south - west of 30 deg East.,projected 2D,,,East,North,E,N,9001,,4296,16035,1995-06-02 00:00:00,,EPSG,,
+29636,Sudan / UTM zone 36N,,,,Sudan - south - east of 30 deg East.,projected 2D,,,East,North,E,N,9001,,4296,16036,1995-06-02 00:00:00,,EPSG,,
+29700,Tananarive (Paris) / Laborde Grid,Tananarive  / Laborde,,,Madagascar.,projected 2D,,,East,North,X,Y,9001,,4810,19911,1995-06-02 00:00:00,,EPSG,,
+29738,Tananarive / UTM zone 38S,Tananarive / UTM 38S,,,Madagascar - offshore west of 48 deg East.,projected 2D,,,East,North,E,N,9001,,4297,16138,1995-06-02 00:00:00,,EPSG,,
+29739,Tananarive / UTM zone 39S,Tananarive / UTM 39S,,,Madagascar - offshore east of 48 deg East.,projected 2D,,,East,North,E,N,9001,,4297,16139,1995-06-02 00:00:00,,EPSG,,
+29849,Timbalai 1948 / UTM zone 49N,Timbalai 1948 / UTM 49N,,,Brunei - offshore; Malaysia - East Malaysia (Sarawak).,projected 2D,,,East,North,E,N,9001,,4298,16049,1995-06-02 00:00:00,,EPSG,,
+29850,Timbalai 1948 / UTM zone 50N,Timbalai 1948 / UTM 50N,,,Brunei - offshore; Malaysia - East Malaysia (Sabah).,projected 2D,,,East,North,E,N,9001,,4298,16050,1995-06-02 00:00:00,,EPSG,,
+29871,Timbalai 1948 / R.S.O. Borneo (ch),Timbalai  / Borneo (ch),,,Malaysia - East Malaysia (Sabah; Sarawak).,projected 2D,,,East,North,E,N,9042,,4298,19912,1999-10-20 00:00:00,,EPSG,Adopts metric conversion of 39.370147 inches per metre.,97.231
+29872,Timbalai 1948 / R.S.O. Borneo (ft),Timbalai  / Borneo (ft),,,Brunei; Malaysia - East Malaysia (Sabah; Sarawak).,projected 2D,,,East,North,E,N,9041,,4298,19912,1999-10-20 00:00:00,,EPSG,Original projection definition in chains.  1 chain = 66 feet=792 inches.  Adopts metric conversion of 39.370147 inches per metre.,97.231
+29873,Timbalai 1948 / R.S.O. Borneo (m),Timbalai  / Borneo (m),,,Brunei.,projected 2D,,,East,North,E,N,9001,,4298,19912,1997-07-22 00:00:00,,EPSG,Original projection definition in chains.  1 chain = 66 feet=792 inches.  Adopts metric conversion of 39.370147 inches per metre.,
+29900,TM65 / Irish National Grid,TM65 / Irish Nat Grid,,,Ireland - onshore; United Kingdom (UK) - Northern Ireland (Ulster) onshore,projected 2D,,,East,North,E,N,9001,,4299,19908,1995-06-02 00:00:00,,EPSG,,
+30161,Tokyo / Japan Plane Rectangular CS I,Tokyo / Japan zone I,,,Japan - Kyushu - Nagasaki-ken; islands of Kagoshima-ken between 27 and 32 deg N and between 128 deg 18 min and 130 deg E (between 128 deg 18 min and 30 deg 13 min E for Amami islands).,projected 2D,,,North,East,X,Y,9001,,4301,17801,1998-12-12 00:00:00,,EPSG,,
+30162,Tokyo / Japan Plane Rectangular CS II,Tokyo / Japan zone II,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,projected 2D,,,North,East,X,Y,9001,,4301,17802,1998-12-12 00:00:00,,EPSG,,
+30163,Tokyo / Japan Plane Rectangular CS III,Tokyo / Japan zone III,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,projected 2D,,,North,East,X,Y,9001,,4301,17803,1998-12-12 00:00:00,,EPSG,,
+30164,Tokyo / Japan Plane Rectangular CS IV,Tokyo / Japan zone IV,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,projected 2D,,,North,East,X,Y,9001,,4301,17804,1998-12-12 00:00:00,,EPSG,,
+30165,Tokyo / Japan Plane Rectangular CS V,Tokyo / Japan zone V,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,projected 2D,,,North,East,X,Y,9001,,4301,17805,1998-12-12 00:00:00,,EPSG,,
+30166,Tokyo / Japan Plane Rectangular CS VI,Tokyo / Japan zone VI,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,projected 2D,,,North,East,X,Y,9001,,4301,17806,1998-12-12 00:00:00,,EPSG,,
+30167,Tokyo / Japan Plane Rectangular CS VII,Tokyo / Japan zone VII,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,projected 2D,,,North,East,X,Y,9001,,4301,17807,1998-12-12 00:00:00,,EPSG,,
+30168,Tokyo / Japan Plane Rectangular CS VIII,Tokyo / Japan zone VIII,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,projected 2D,,,North,East,X,Y,9001,,4301,17808,1998-12-12 00:00:00,,EPSG,,
+30169,Tokyo / Japan Plane Rectangular CS IX,Tokyo / Japan zone IX,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,projected 2D,,,North,East,X,Y,9001,,4301,17809,1998-12-12 00:00:00,,EPSG,,
+30170,Tokyo / Japan Plane Rectangular CS X,Tokyo / Japan zone X,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,projected 2D,,,North,East,X,Y,9001,,4301,17810,1998-12-12 00:00:00,,EPSG,,
+30171,Tokyo / Japan Plane Rectangular CS XI,Tokyo / Japan zone XI,,,Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.,projected 2D,,,North,East,X,Y,9001,,4301,17811,1998-12-12 00:00:00,,EPSG,,
+30172,Tokyo / Japan Plane Rectangular CS XII,Tokyo / Japan zone XII,,,Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.,projected 2D,,,North,East,X,Y,9001,,4301,17812,1998-12-12 00:00:00,,EPSG,,
+30173,Tokyo / Japan Plane Rectangular CS XIII,Tokyo / Japan zone XIII,,,Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.,projected 2D,,,North,East,X,Y,9001,,4301,17813,1998-12-12 00:00:00,,EPSG,,
+30174,Tokyo / Japan Plane Rectangular CS XIV,Tokyo / Japan zone XIV,,,Japan - Tokyo-to south of 28 deg N & between 140 deg 30 min & 143 deg E.,projected 2D,,,North,East,X,Y,9001,,4301,17814,1998-12-12 00:00:00,,EPSG,Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low.,
+30175,Tokyo / Japan Plane Rectangular CS XV,Tokyo / Japan zone XV,,,Japan - Okinawa-ken between 126 deg &130 deg E.,projected 2D,,,North,East,X,Y,9001,,4301,17815,1998-12-12 00:00:00,,EPSG,,
+30176,Tokyo / Japan Plane Rectangular CS XVI,Tokyo / Japan zone XVI,,,Japan - Okinawa-ken west of 126 deg E.,projected 2D,,,North,East,X,Y,9001,,4301,17816,1998-12-12 00:00:00,,EPSG,,
+30177,Tokyo / Japan Plane Rectangular CS XVII,Tokyo / Japan zone XVII,,,Japan - Okinawa-ken east of 130 deg E.,projected 2D,,,North,East,X,Y,9001,,4301,17817,1998-12-12 00:00:00,,EPSG,Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low.,
+30178,Tokyo / Japan Plane Rectangular CS XVIII,Tokyo / Japan zone XVIII,,,Japan - Tokyo-to south of 28 N & west of 140 deg 30 min E.,projected 2D,,,North,East,X,Y,9001,,4301,17818,1998-12-12 00:00:00,,EPSG,Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low.,
+30179,Tokyo / Japan Plane Rectangular CS XIX,Tokyo / Japan zone XIX,,,Japan - Tokyo-to south of 28 N & east of 143 deg E.,projected 2D,,,North,East,X,Y,9001,,4301,17819,1998-12-12 00:00:00,,EPSG,Although legally defined as Tokyo datum the accuracy of the geodetic connection to mainland Japan is low.,
+30200,Trinidad 1903 / Trinidad Grid,Trinidad 1903 / Trinidad,,,Trinidad and Tobago - Trinidad,projected 2D,,,East,North,E,N,9039,,4302,19925,1999-10-20 00:00:00,,EPSG,,97.231
+30339,TC(1948) / UTM zone 39N,,,,United Arab Emirates (UAE) - Abu Dhabi west of 54 deg East.,projected 2D,,,East,North,E,N,9001,,4303,16039,1995-06-02 00:00:00,,EPSG,,
+30340,TC(1948) / UTM zone 40N,,,,United Arab Emirates (UAE) - Abu Dhabi east of 54 deg East; Dubai.,projected 2D,,,East,North,E,N,9001,,4303,16040,1995-06-02 00:00:00,,EPSG,,
+30491,Voirol 1875 / Nord Algerie (ancienne),Voirol /N Algerie ancien,,,Algeria - north of 38.5 grads (34 deg 39 min) North.,projected 2D,,,East,North,X,Y,9001,,4304,18011,1995-06-02 00:00:00,,EPSG,Superseded by 30591 (Voirol Unifie / Algeria Nord).,
+30492,Voirol 1875 / Sud Algerie (ancienne),Voirol /S Algerie ancien,,,Algeria - 35 grads to 38.5 grads (31 deg 30 min to 34 deg 39 min) North.,projected 2D,,,East,North,X,Y,9001,,4304,18012,1995-06-02 00:00:00,,EPSG,Superseded by 30592 (Voirol Unifie / Algeria Sud).,
+30591,Voirol Unifie / Nord Algerie,Voirol Unifie /N Algerie,,,Algeria - north of 38.5 grads (34 deg 39 min) North.,projected 2D,,,East,North,X,Y,9001,,4305,18021,1995-06-02 00:00:00,,EPSG,Supersedes 30491 (Voirol 1875 / Nord Algeria ancienne).,
+30592,Voirol Unifie / Sud Algerie,Voirol Unifie /S Algerie,,,Algeria - 35 grads to 38.5 grads (31 deg 30 min to 34 deg 39 min) North.,projected 2D,,,East,North,X,Y,9001,,4305,18022,1995-06-02 00:00:00,,EPSG,Supersedes 30492 (Voirol 1875 / Sud Algeria ancienne).,
+30729,Nord Sahara 1959 / UTM zone 29N,Nord Sahara / UTM 29N,,,Algeria west of 6 deg West (of Greenwich).,projected 2D,,,East,North,E,N,9001,,4307,16029,1996-04-12 00:00:00,,EPSG,,
+30730,Nord Sahara 1959 / UTM zone 30N,Nord Sahara / UTM 30N,,,Algeria 6 deg West to 0 deg East (of Greenwich).,projected 2D,,,East,North,E,N,9001,,4307,16030,1996-04-12 00:00:00,,EPSG,,
+30731,Nord Sahara 1959 / UTM zone 31N,Nord Sahara / UTM 31N,,,Algeria 0 deg to 6 deg East (of Greenwich).,projected 2D,,,East,North,E,N,9001,,4307,16031,1996-04-12 00:00:00,,EPSG,,
+30732,Nord Sahara 1959 / UTM zone 32N,Nord Sahara / UTM 32N,,,Algeria east of 6 deg East (of Greenwich).,projected 2D,,,East,North,E,N,9001,,4307,16032,1996-04-12 00:00:00,,EPSG,,
+30800,RT38 2.5 gon W,,,,Sweden,projected 2D,,,North,East,X,Y,9001,,4308,19929,1997-11-13 00:00:00,National Land Survey of Sweden,EPSG,,97.14  97.39
+31028,Yoff / UTM zone 28N,,,,Senegal.,projected 2D,,,East,North,E,N,9001,,4310,16028,1995-06-02 00:00:00,,EPSG,,
+31121,Zanderij / UTM zone 21N,,,,Suriname.,projected 2D,,,East,North,E,N,9001,,4311,16021,1995-06-02 00:00:00,,EPSG,,
+31291,MGI (Ferro) / Austria West Zone,MGI / Austria West,,,Austria west of 11deg 50min East of Greenwich (29 deg 30 min East of Ferro).,projected 2D,,,East,North,X,Y,9001,,4805,18041,1995-06-02 00:00:00,,EPSG,Superceded by MGI / M34 (EPSG code 31296).,97.01
+31292,MGI (Ferro) / Austria Central Zone,MGI / Austria Central,,,Austria between 11deg 50min and 14deg 50min East of Greenwich (29 deg 30 min and 32 deg 30 min East of Ferro).,projected 2D,,,East,North,X,Y,9001,,4805,18042,1995-06-02 00:00:00,,EPSG,Superceded by MGI / M31 (EPSG code 31295).,97.01
+31293,MGI (Ferro) / Austria East Zone,MGI / Austria East,,,Austria east of 14deg 50min East of Greenwich (32 deg 30 min East of Ferro).,projected 2D,,,East,North,X,Y,9001,,4805,18043,1995-06-02 00:00:00,,EPSG,Superceded by MGI / M28 (EPSG code 31294).,97.01
+31294,MGI / M28,,,,Austria west of 11deg 50min East of Greenwich (29 deg 30 min East of Ferro).,projected 2D,,,East,North,X,Y,9001,,4312,18044,1999-10-20 00:00:00,,EPSG,Supercedes MGI (Ferro) / Austria East zone (EPSG code 31293).,
+31295,MGI / M31,,,,Austria between 11deg 50min and 14deg 50min East of Greenwich (29 deg 30 min and 32 deg 30 min East of Ferro).,projected 2D,,,East,North,X,Y,9001,,4312,18045,1999-10-20 00:00:00,,EPSG,Supercedes MGI (Ferro) / Austria Central zone (EPSG code 31292).,
+31296,MGI / M34,,,,Austria east of 14deg 50min East of Greenwich (32 deg 30 min East of Ferro).,projected 2D,,,East,North,X,Y,9001,,4312,18046,1999-10-20 00:00:00,,EPSG,Supercedes MGI (Ferro) / Austria West zone (EPSG code 31291).,
+31297,MGI / Austria Lambert,,,,Austria,projected 2D,,,East,North,X,Y,9001,,4312,19947,1999-10-20 00:00:00,,EPSG,,
+31300,Belge 1972 / Belge Lambert 72,Belge Lambert 72,,,Belgium - onshore.,projected 2D,,,East,North,X,Y,9001,,4313,19902,1995-06-02 00:00:00,,EPSG,Supersedes 21500 (Belge 1950 / Belge Lambert 50).,
+31491,DHDN / Germany zone 1,,,,Germany - onshore west of 4 deg 30 min East.,projected 2D,,,East,North,X,Y,9001,,4314,18101,1995-06-02 00:00:00,,EPSG,,
+31492,DHDN / Germany zone 2,,,,Germany - onshore between 4 deg 30 min and 7 deg 30 min East.,projected 2D,,,East,North,X,Y,9001,,4314,18102,1995-06-02 00:00:00,,EPSG,,
+31493,DHDN / Germany zone 3,,,,Germany - onshore between 7 deg 30 min and 10 deg 30 min East.,projected 2D,,,East,North,X,Y,9001,,4314,18103,1995-06-02 00:00:00,,EPSG,,
+31494,DHDN / Germany zone 4,,,,Germany - onshore between 10 deg 30 min and 13 deg 30 min East.,projected 2D,,,East,North,X,Y,9001,,4314,18104,1995-06-02 00:00:00,,EPSG,,
+31495,DHDN / Germany zone 5,,,,Germany - onshore between 13 deg 30 min and 16 deg 30 min East.,projected 2D,,,East,North,X,Y,9001,,4314,18105,1995-06-02 00:00:00,,EPSG,,
+31600,Dealul Piscului 1933/ Stereo 33,Stereo 33,,,Romania.,projected 2D,,,East,North,X,Y,9001,,4316,19927,1996-04-12 00:00:00,,EPSG,Superseded by Stereo 70 system (ProjCS code 31700).,
+31700,Dealul Piscului 1970/ Stereo 70,Stereo 70,,,Romania.,projected 2D,,,North,East,X,Y,9001,,4317,19926,1996-04-12 00:00:00,,EPSG,Supersedes Stereo 33 system.,
+31838,NGN / UTM zone 38N,,,,Kuwait west of 48deg East.,projected 2D,,,East,North,E,N,9001,,4318,16038,1996-04-12 00:00:00,,EPSG,,
+31839,NGN / UTM zone 39N,,,,Kuwait east of 48deg East.,projected 2D,,,East,North,E,N,9001,,4318,16039,1996-04-12 00:00:00,,EPSG,,
+31900,KUDAMS / KTM,,,,Kuwait - Kuwait City.,projected 2D,,,East,North,E,N,9001,,4319,19928,1996-04-12 00:00:00,,EPSG,,
+32001,NAD27 / Montana North,,,,United States (USA) - Montana - MT_N - counties of Blaine; Chouteau; Daniels; Flathead; Glacier; Hill; Liberty; Lincoln; Phillips; Pondera; Roosevelt; Sheridan; Teton; Toole; Valley,projected 2D,,,East,North,X,Y,9003,,4267,12501,1995-06-02 00:00:00,,EPSG,,
+32002,NAD27 / Montana Central,,,,United States (USA) - Montana - MT_C - counties of Cascade; Dawson; Fergus; Garfield; Judith Basin; Lake; Lewis and Clark; McCone; Meagher; Mineral; Missoula; Petroleum; Powell; Prairie; Richland; Sanders; Wibaux,projected 2D,,,East,North,X,Y,9003,,4267,12502,1995-06-02 00:00:00,,EPSG,,
+32003,NAD27 / Montana South,,,,United States (USA) - Montana - MT_S - counties of Beaverhead; Big Horn; Broadwater; Carbon; Carter; Custer; Deer Lodge; Fallon; Gallatin; Golden Valley; Granite; Jefferson; Madison; Musselshell; Park; Powder River; Ravalli; Rosebud; Silver Bow; Stillwater; Sweet Grass; Treasure; Wheatland; Yellowstone,projected 2D,,,East,North,X,Y,9003,,4267,12503,1995-06-02 00:00:00,,EPSG,,
+32005,NAD27 / Nebraska North,,,,United States (USA) - Nebraska - NE_N - counties of Antelope; Blaine; Box Butte; Boyd; Brown; Burt; Cedar; Cherry; Cuming; Dakota; Dawes; Dixon; Garfield; Grant; Holt; Hooker; Keya Paha; Knox; Loup; Madison; Pierce; Rock; Sheridan; Sioux; Stanton; Thomas; Thurston; Wayne; Wheeler,projected 2D,,,East,North,X,Y,9003,,4267,12601,1995-06-02 00:00:00,,EPSG,,
+32006,NAD27 / Nebraska South,,,,United States (USA) - Nebraska - NE_S - counties of Adams; Arthur; Banner; Boone; Buffalo; Butler; Cass; Chase; Cheyenne; Clay; Colfax; Custer; Dawson; Deuel; Dodge; Douglas; Dundy; Fillmore; Franklin; Frontier; Furnas; Gage; Garden; Gosper; Greeley; Hall; Hamilton; Harlan; Hayes; Hitchcock; Howard; Jefferson; Johnson; Kearney; Keith; Kimball; Lancaster; Lincoln; Logan; McPherson; Merrick; Morrill; Nance; Nemaha; Nuckolls; Otoe; Pawnee; Perkins; Phelps; Pl [...]
+32007,NAD27 / Nevada East,,,,United States (USA) - Nevada - NV_E - counties of Clark; Elko; Eureka; Lincoln; White Pine,projected 2D,,,East,North,X,Y,9003,,4267,12701,1995-06-02 00:00:00,,EPSG,,
+32008,NAD27 / Nevada Central,,,,United States (USA) - Nevada - NV_C - counties of Lander; Nye,projected 2D,,,East,North,X,Y,9003,,4267,12702,1995-06-02 00:00:00,,EPSG,,
+32009,NAD27 / Nevada West,,,,United States (USA) - Nevada - NV_W - counties of Churchill; Douglas; Esmeralda; Humboldt; Lyon; Mineral; Pershing; Storey; Washoe,projected 2D,,,East,North,X,Y,9003,,4267,12703,1995-06-02 00:00:00,,EPSG,,
+32010,NAD27 / New Hampshire,,,,United States (USA) - New Hampshire - NH - counties of Belknap; Carroll; Cheshire; Coos; Grafton; Hillsborough; Merrimack; Rockingham; Strafford; Sullivan,projected 2D,,,East,North,X,Y,9003,,4267,12800,1995-06-02 00:00:00,,EPSG,,
+32011,NAD27 / New Jersey,,,,United States (USA) - New Jersey - NJ - counties of Atlantic; Bergen; Burlington; Camden; Cape May; Cumberland; Essex; Gloucester; Hudson; Hunterdon; Mercer; Middlesex; Monmouth; Morris; Ocean; Passaic; Salem; Somerset; Sussex; Union; Warren,projected 2D,,,East,North,X,Y,9003,,4267,12900,1995-06-02 00:00:00,,EPSG,,
+32012,NAD27 / New Mexico East,,,,United States (USA) - New Mexico - NM_E - counties of Chaves; Colfax; Curry; De Baca; Eddy; Guadalupe; Harding; Lea; Mora; Quay; Roosevelt; San Miguel; Union,projected 2D,,,East,North,X,Y,9003,,4267,13001,1995-06-02 00:00:00,,EPSG,,
+32013,NAD27 / New Mexico Central,NAD27 / New Mexico Cent.,,,United States (USA) - New Mexico - NM_C - counties of Bernalillo; Dona Ana; Lincoln; Los Alamos; Otero; Rio Arriba; Sandoval; Santa Fe; Socorro; Taos; Torrance,projected 2D,,,East,North,X,Y,9003,,4267,13002,1995-06-02 00:00:00,,EPSG,,
+32014,NAD27 / New Mexico West,,,,United States (USA) - New Mexico - NM_W - counties of Catron; Cibola; Grant; Hidalgo; Luna; McKinley; San Juan; Sierra; Valencia,projected 2D,,,East,North,X,Y,9003,,4267,13003,1995-06-02 00:00:00,,EPSG,,
+32015,NAD27 / New York East,,,,United States (USA) - New York - NY_E - counties of Albany; Clinton; Columbia; Delaware; Dutchess; Essex; Franklin; Fulton; Greene; Hamilton; Herkimer; Montgomery; Orange; Otsego; Putnam; Rensselaer; Rockland; Saratoga; Schenectady; Schoharie; St. Lawrence; Sullivan; Ulster; Warren; Washington; Westchester,projected 2D,,,East,North,X,Y,9003,,4267,13101,1995-06-02 00:00:00,,EPSG,,
+32016,NAD27 / New York Central,,,,United States (USA) - New York - NY_C - counties of Broome; Cayuga; Chemung; Chenango; Cortland; Jefferson; Lewis; Madison; Oneida; Onondaga; Ontario; Oswego; Schuyler; Seneca; Steuben; Tioga; Tompkins; Wayne; Yates,projected 2D,,,East,North,X,Y,9003,,4267,13102,1995-06-02 00:00:00,,EPSG,,
+32017,NAD27 / New York West,,,,United States (USA) - New York - NY_W - counties of Allegany; Cattaraugus; Chautauqua; Erie; Genesee; Livingston; Monroe; Niagara; Orleans; Wyoming,projected 2D,,,East,North,X,Y,9003,,4267,13103,1995-06-02 00:00:00,,EPSG,,
+32018,NAD27 / New York Long Island,NAD27 / New York Long Is,,,United States (USA) - New York - NY_LI - counties of Bronx; Kings; Nassau; New York; Queens; Richmond; Suffolk,projected 2D,,,East,North,X,Y,9003,,4267,13104,1995-06-02 00:00:00,,EPSG,,
+32019,NAD27 / North Carolina,,,,United States (USA) - North Carolina - NC - counties of Alamance; Alexander; Alleghany; Anson; Ashe; Avery; Beaufort; Bertie; Bladen; Brunswick; Buncombe; Burke; Cabarrus; Caldwell; Camden; Carteret; Caswell; Catawba; Chatham; Cherokee; Chowan; Clay; Cleveland; Columbus; Craven; Cumberland; Currituck; Dare; Davidson; Davie; Duplin; Durham; Edgecombe; Forsyth; Franklin; Gaston; Gates; Graham; Granville; Greene; Guilford; Halifax; Harnett; Haywood; Henderson [...]
+32020,NAD27 / North Dakota North,NAD27 / North Dakota N,,,United States (USA) - North Dakota - ND_N - counties of Benson; Bottineau; Burke; Cavalier; Divide; Eddy; Foster; Grand Forks; Griggs; McHenry; McKenzie; McLean; Mountrial; Nelson; Pembina; Pierce; Ramsey; Renville; Rolette; Sheridan; Steele; Towner; Traill; Walsh; Ward; Wells; Williams,projected 2D,,,East,North,X,Y,9003,,4267,13301,1995-06-02 00:00:00,,EPSG,,
+32021,NAD27 / North Dakota South,NAD27 / North Dakota S,,,United States (USA) - North Dakota - ND_S - counties of Adams; Barnes; Billings; Bowman; Burleigh; Cass; Dickey; Dunn; Emmons; Golden Valley; Grant; Hettinger; Kidder; La Moure; Logan; McIntosh; Mercer; Morton; Oliver; Ransom; Richland; Sargent; Sioux; Slope; Stark; Stutsman,projected 2D,,,East,North,X,Y,9003,,4267,13302,1995-06-02 00:00:00,,EPSG,,
+32022,NAD27 / Ohio North,,,,United States (USA) - Ohio - OH_N - counties of Allen;Ashland; Ashtabula; Auglaize; Carroll; Columbiana; Coshocton; Crawford; Cuyahoga; Defiance; Delaware; Erie; Fulton; Geauga; Hancock; Hardin; Harrison; Henry; Holmes; Huron; Jefferson; Knox; Lake; Logan; Lorain; Lucas; Mahoning; Marion; Medina; Mercer; Morrow; Ottawa; Paulding; Portage; Putnam; Richland; Sandusky; Seneca; Shelby; Stark; Summit; Trumbull; Tuscarawas; Union; Van Wert; Wayne; Williams; Wood; Wy [...]
+32023,NAD27 / Ohio South,,,,United States (USA) - Ohio - OH_S - counties of Adams; Athens; Belmont; Brown; Butler; Champaign; Clark; Clermont; Clinton; Darke; Fairfield; Fayette; Franklin; Gallia; Greene; Guernsey; Hamilton; Highland; Hocking; Jackson; Lawrence; Licking; Madison; Meigs; Miami; Monroe; Montgomery; Morgan; Muskingum; Noble; Perry; Pickaway; Pike; Preble; Ross; Scioto; Vinton; Warren; Washington,projected 2D,,,East,North,X,Y,9003,,4267,13402,1995-06-02 00:00:00,,EPSG,,
+32024,NAD27 / Oklahoma North,,,,United States (USA) - Oklahoma - OK_N - counties of Adair; Alfalfa; Beaver; Blaine; Canadian; Cherokee; Cimarron; Craig; Creek; Custer; Delaware; Dewey; Ellis; Garfield; Grant; Harper; Kay; Kingfisher; Lincoln; Logan; Major; Mayes; Muskogee; Noble; Nowata; Okfuskee; Oklahoma; Okmulgee; Osage; Ottawa; Pawnee; Payne; Roger Mills; Rogers; Sequoyah; Texas; Tulsa; Wagoner; Washington; Woods; Woodward,projected 2D,,,East,North,X,Y,9003,,4267,13501,1995-06-02 00: [...]
+32025,NAD27 / Oklahoma South,,,,United States (USA) - Oklahoma - OK_S - counties of Atoka; Beckham; Bryan; Caddo; Carter; Choctaw; Cleveland; Coal; Comanche; Cotton; Garvin; Grady; Greer; Harmon; Haskell; Hughes; Jackson; Jefferson; Johnston; Kiowa; Latimer; Le Flore; Love; Marshall; McClain; McCurtain; McIntosh; Murray; Pittsburg; Pontotoc; Pottawatomie; Pushmataha; Seminole; Stephens; Tillman; Washita,projected 2D,,,East,North,X,Y,9003,,4267,13502,1995-06-02 00:00:00,,EPSG,,
+32026,NAD27 / Oregon North,,,,United States (USA) - Oregon - OR_N - counties of Baker; Benton; Clackamas; Clatsop; Columbia; Gilliam; Grant; Hood River; Jefferson; Lincoln; Linn; Marion; Morrow; Multnomah; Polk; Sherman; Tillamook; Umatilla; Union; Wallowa; Wasco; Washington; Wheeler; Yamhill,projected 2D,,,East,North,X,Y,9003,,4267,13601,1995-06-02 00:00:00,,EPSG,,
+32027,NAD27 / Oregon South,,,,United States (USA) - Oregon - OR_S - counties of Coos; Crook; Curry; Deschutes; Douglas; Harney; Jackson; Josephine; Klamath; Lake; Lane; Malheur,projected 2D,,,East,North,X,Y,9003,,4267,13602,1995-06-02 00:00:00,,EPSG,,
+32028,NAD27 / Pennsylvania North,NAD27 / Pennsylvania N,,,United States (USA) - Pennsylvania - PA_N - counties of Bradford; Cameron; Carbon; Centre; Clarion; Clearfield; Clinton; Columbia; Crawford; Elk; Erie; Forest; Jefferson; Lackawanna; Luzerne; Lycoming; McKean; Mercer; Monroe; Montour; Northumberland; Pike; Potter; Sullivan; Susquehanna; Tioga; Union; Venango; Warren; Wayne; Wyoming,projected 2D,,,East,North,X,Y,9003,,4267,13701,1995-06-02 00:00:00,,EPSG,,
+32029,NAD27 / Pennsylvania South,NAD27 / Pennsylvania S,,,United States (USA) - Pennsylvania - PA_S - counties of Adams; Allegheny; Armstrong; Beaver; Bedford; Berks; Blair; Bucks; Butler; Cambria; Chester; Cumberland; Dauphin; Delaware; Fayette; Franklin; Fulton; Greene; Huntingdon; Indiana; Juniata; Lancaster; Lawrence; Lebanon; Lehigh; Mifflin; Montgomery; Northampton; Perry; Philadelphia; Schuylkill; Snyder; Somerset; Washington; Westmoreland; York,projected 2D,,,East,North,X,Y,9003, [...]
+32030,NAD27 / Rhode Island,,,,United States (USA) - Rhode Island - RI - counties of Bristol; Kent; Newport; Providence; Washington,projected 2D,,,East,North,X,Y,9003,,4267,13800,1995-06-02 00:00:00,,EPSG,,
+32031,NAD27 / South Carolina North,NAD27 / South Carolina N,,,United States (USA) - South Carolina - SC_N - counties of Abbeville; Anderson; Calhoun; Cherokee; Chester; Chesterfield; Darlington; Dillon; Edgefield; Fairfield; Florence; Greenville; Greenwood; Horry; Kershaw; Lancaster; Laurens; Lee; Lexington; Marion; Marlboro; McCormick; Newberry; Oconee; Pickens; Richland; Saluda; Spartanburg; Sumter; Union; York,projected 2D,,,East,North,X,Y,9003,,4267,13901,1995-06-02 00:00:00,,EPSG,,
+32033,NAD27 / South Carolina South,NAD27 / South Carolina S,,,United States (USA) - South Carolina - SC_S - counties of Aiken; Allendale; Bamberg; Barnwell; Beaufort; Berkeley; Charleston; Clarendon; Colleton; Dorchester; Georgetown; Hampton; Jasper; Orangeburg; Williamsburg,projected 2D,,,East,North,X,Y,9003,,4267,13902,1995-06-02 00:00:00,,EPSG,,
+32034,NAD27 / South Dakota North,NAD27 / South Dakota N,,,United States (USA) - South Dakota - SD_N - counties of Beadle; Brookings; Brown; Butte; Campbell; Clark; Codington; Corson; Day; Deuel; Dewey; Edmunds; Faulk; Grant; Hamlin; Hand; Harding; Hyde; Kingsbury; Lawrence; Marshall; McPherson; Meade; Perkins; Potter; Roberts; Spink; Sully; Walworth; Ziebach,projected 2D,,,East,North,X,Y,9003,,4267,14001,1995-06-02 00:00:00,,EPSG,,
+32035,NAD27 / South Dakota South,NAD27 / South Dakota S,,,United States (USA) - South Dakota - SD_S - counties of Aurora; Bennett; Bon Homme; Brule; Buffalo; Charles Mix; Clay; Custer; Davison; Douglas; Fall River; Gregory; Haakon; Hanson; Hughes; Hutchinson; Jackson; Jerauld; Jones; Lake; Lincoln; Lyman; McCook; Mellette; Miner; Minnehaha; Moody; Pennington; Sanborn; Shannon; Stanley; Todd; Tripp; Turner; Union; Yankton,projected 2D,,,East,North,X,Y,9003,,4267,14002,1995-06-02 00:00:00, [...]
+32036,NAD27 / Tennessee,,,,United States (USA) - Tennessee - TN - counties of Anderson; Bedford; Benton; Bledsoe; Blount; Bradley; Campbell; Cannon; Carroll; Carter; Cheatham; Chester; Claiborne; Clay; Cocke; Coffee; Crockett; Cumberland; Davidson; De Kalb; Decatur; Dickson; Dyer; Fayette; Fentress; Franklin; Gibson; Giles; Grainger; Greene; Grundy; Hamblen; Hamilton; Hancock; Hardeman; Hardin; Hawkins; Haywood; Henderson; Henry; Hickman; Houston; Humphreys; Jackson; Jefferson; Johnson;  [...]
+32037,NAD27 / Texas North,,,,United States (USA) - Texas -TX_N - counties of: Armstrong; Briscoe; Carson; Castro; Childress; Collingsworth; Dallam; Deaf Smith; Donley; Gray; Hall; Hansford; Hartley; Hemphill; Hutchinson; Lipscomb; Moore; Ochiltree; Oldham; Parmer; Potter; Randall; Roberts; Sherman; Swisher; Wheeler,projected 2D,,,East,North,X,Y,9003,,4267,14201,1995-06-02 00:00:00,,EPSG,,
+32038,NAD27 / Texas North Central,NAD27 / Texas North Cen.,,,United States (USA) - Texas -TX_NC - counties of: Andrews; Archer; Bailey; Baylor; Borden; Bowie; Callahan; Camp; Cass; Clay; Cochran; Collin; Cooke; Cottle; Crosby; Dallas; Dawson; Delta; Denton; Dickens; Eastland; Ellis; Erath; Fannin; Fisher; Floyd; Foard; Franklin; Gaines; Garza; Grayson,projected 2D,,,East,North,X,Y,9003,,4267,14202,1995-06-02 00:00:00,,EPSG,,
+32039,NAD27 / Texas Central,,,,United States (USA) - Texas -TX_C - counties of Anderson; Angelina; Bastrop; Bell; Blanco; Bosque; Brazos; Brown; Burleson; Burnet; Cherokee; Coke; Coleman; Comanche; Concho; Coryell; Crane; Crockett; Culberson; Ector; El Paso; Falls; Freestone; Gillespie; Glasscock; Grimes; Hamilton; Hardin; Houston; Hudspeth; Irion; Jasper; Jeff Davis; Kimble; Lampasas; Lee; Leon; Liberty; Limestone; Llano; Loving; Madison; Mason; McCulloch; McLennan; Menard; Midland; Mil [...]
+32040,NAD27 / Texas South Central,NAD27 / Texas South Cen.,,,United States (USA) - Texas -TX_SC - counties of Aransas; Atascosa; Austin; Bandera; Bee; Bexar; Brazoria; Brewster; Caldwell; Calhoun; Chambers; Colorado; Comal; De Witt; Dimmit; Edwards; Fayette; Fort Bend; Frio; Galveston; Goliad; Gonzales; Guadalupe; Harris; Hays; Jackson; Jefferson; Karnes; Kendall; Kerr; Kinney; La Salle; Lavaca; Live Oak; Matagorda; Maverick; McMullen; Medina; Presidio; Real; Refugio; Terrell; Uvalde; Va [...]
+32041,NAD27 / Texas South,,,,United States (USA) - Texas -TX_S - counties of Brooks; Cameron; Duval; Hidalgo; Jim Hogg; Jim Wells; Kenedy; Kleberg; Nueces; San Patricio; Starr; Webb; Willacy; Zapata;  - Gulf of Mexico outer continental shelf (OCS) protraction areas: South Padre Island; North Padre Island; Mustang Island.,projected 2D,,,East,North,X,Y,9003,,4267,14205,1995-06-02 00:00:00,,EPSG,,
+32042,NAD27 / Utah North,,,,United States (USA) - Utah - UT_N - counties of Box Elder; Cache; Daggett; Davis; Morgan; Rich; Summit; Weber,projected 2D,,,East,North,X,Y,9003,,4267,14301,1995-06-02 00:00:00,,EPSG,,
+32043,NAD27 / Utah Central,,,,United States (USA) - Utah - UT_C - counties of Carbon; Duchesne; Emery; Grand; Juab; Millard; Salt Lake; Sanpete; Sevier; Tooele; Uintah; Utah; Wasatch,projected 2D,,,East,North,X,Y,9003,,4267,14302,1995-06-02 00:00:00,,EPSG,,
+32044,NAD27 / Utah South,,,,United States (USA) - Utah - UT_S - counties of Beaver; Garfield; Iron; Kane; Piute; San Juan; Washington; Wayne,projected 2D,,,East,North,X,Y,9003,,4267,14303,1995-06-02 00:00:00,,EPSG,,
+32045,NAD27 / Vermont,,,,United States (USA) - Vermont - VT - counties of Addison; Bennington; Caledonia; Chittenden; Essex; Franklin; Grand Isle; Lamoille; Orange; Orleans; Rutland; Washington; Windham; Windsor,projected 2D,,,East,North,X,Y,9003,,4267,14400,1995-06-02 00:00:00,,EPSG,,
+32046,NAD27 / Virginia North,,,,United States (USA) - Virginia - VA_N - counties of Arlington; Augusta; Bath; Caroline; Clarke; Culpeper; Fairfax; Fauquier; Frederick; Greene; Highland; King George; Loudoun; Madison; Orange; Page; Prince William; Rappahannock; Rockingham; Shenandoah; Spotsylvania; Stafford; Warren; Westmoreland,projected 2D,,,East,North,X,Y,9003,,4267,14501,1995-06-02 00:00:00,,EPSG,,
+32047,NAD27 / Virginia South,,,,United States (USA) - Virginia - VA_S - counties of Accomack; Albemarle; Alleghany; Amelia; Amherst; Appomattox; Bedford; Bland; Botetourt; Bristol; Brunswick; Buchanan; Buckingham; Campbell; Carroll; Charles City; Charlotte; Chesapeake; Chesterfield; Colonial Heights; Craig; Cumberland; Dickenson; Dinwiddie; Essex; Floyd; Fluvanna; Franklin; Giles; Gloucester; Goochland; Grayson; Greensville; Halifax; Hampton; Hanover; Henrico; Henry; Isle of Wight; James [...]
+32048,NAD27 / Washington North,,,,United States (USA) - Washington - WA_N - counties of Chelan; Clallam; Douglas; Ferry; Island; Jefferson; King; Kitsap; Lincoln; Okanogan; Pend Oreille; San Juan; Skagit; Snohomish; Spokane; Stevens; Whatcom,projected 2D,,,East,North,X,Y,9003,,4267,14601,1995-06-02 00:00:00,,EPSG,,
+32049,NAD27 / Washington South,,,,United States (USA) - Washington - WA_S - counties of Adams; Asotin; Benton; Clark; Columbia; Cowlitz; Franklin; Garfield; Grant; Grays Harbor; Kittitas; Klickitat; Lewis; Mason; Pacific; Pierce; Skamania; Thurston; Wahkiakum; Walla Walla; Whitman; Yakima,projected 2D,,,East,North,X,Y,9003,,4267,14602,1995-06-02 00:00:00,,EPSG,,
+32050,NAD27 / West Virginia North,NAD27 / West Virginia N,,,United States (USA) - West Virginia - WV_N - counties of Barbour; Berkeley; Brooke; Doddridge; Grant; Hampshire; Hancock; Hardy; Harrison; Jefferson; Marion; Marshall; Mineral; Monongalia; Morgan; Ohio; Pleasants; Preston; Ritchie; Taylor; Tucker; Tyler; Wetzel; Wirt; Wood,projected 2D,,,East,North,X,Y,9003,,4267,14701,1995-06-02 00:00:00,,EPSG,,
+32051,NAD27 / West Virginia South,NAD27 / West Virginia S,,,United States (USA) - West Virginia - WV_S - counties of Boone; Braxton; Cabell; Calhoun; Clay; Fayette; Gilmer; Greenbrier; Jackson; Kanawha; Lewis; Lincoln; Logan; Mason; McDowell; Mercer; Mingo; Monroe; Nicholas; Pendleton; Pocahontas; Putnam; Raleigh; Randolph; Roane; Summers; Upshur; Wayne; Webster; Wyoming,projected 2D,,,East,North,X,Y,9003,,4267,14702,1995-06-02 00:00:00,,EPSG,,
+32052,NAD27 / Wisconsin North,,,,United States (USA) - Wisconsin - WI_N - counties of Ashland; Bayfield; Burnett; Douglas; Florence; Forest; Iron; Oneida; Price; Sawyer; Vilas; Washburn,projected 2D,,,East,North,X,Y,9003,,4267,14801,1995-06-02 00:00:00,,EPSG,,
+32053,NAD27 / Wisconsin Central,NAD27 / Wisconsin Cen.,,,United States (USA) - Wisconsin - WI_C - counties of Barron; Brown; Buffalo; Chippewa; Clark; Door; Dunn; Eau Claire; Jackson; Kewaunee; Langlade; Lincoln; Marathon; Marinette; Menominee; Oconto; Outagamie; Pepin; Pierce; Polk; Portage; Rusk; Shawano; St. Croix; Taylor; Trempealeau; Waupaca; Wood,projected 2D,,,East,North,X,Y,9003,,4267,14802,1995-06-02 00:00:00,,EPSG,,
+32054,NAD27 / Wisconsin South,,,,United States (USA) - Wisconsin - WI_S - counties of Adams; Calumet; Columbia; Crawford; Dane; Dodge; Fond Du Lac; Grant; Green; Green Lake; Iowa; Jefferson; Juneau; Kenosha; La Crosse; Lafayette; Manitowoc; Marquette; Milwaukee; Monroe; Ozaukee; Racine; Richland; Rock; Sauk; Sheboygan; Vernon; Walworth; Washington; Waukesha; Waushara; Winnebago,projected 2D,,,East,North,X,Y,9003,,4267,14803,1995-06-02 00:00:00,,EPSG,,
+32055,NAD27 / Wyoming East,,,,United States (USA) - Wyoming - WY_E - counties of Albany; Campbell; Converse; Crook; Goshen; Laramie; Niobrara; Platte; Weston,projected 2D,,,East,North,X,Y,9003,,4267,14901,1995-06-02 00:00:00,,EPSG,,
+32056,NAD27 / Wyoming East Central,NAD27 / Wyoming E. Cen.,,,United States (USA) - Wyoming - WY_EC - counties of Big Horn; Carbon; Johnson; Natrona; Sheridan; Washakie,projected 2D,,,East,North,X,Y,9003,,4267,14902,1995-06-02 00:00:00,,EPSG,,
+32057,NAD27 / Wyoming West Central,NAD27 / Wyoming W. Cen.,,,United States (USA) - Wyoming - WY_WC - counties of Fremont; Hot Springs; Park; Sweetwater,projected 2D,,,East,North,X,Y,9003,,4267,14903,1995-06-02 00:00:00,,EPSG,,
+32058,NAD27 / Wyoming West,,,,United States (USA) - Wyoming - WY_W - counties of Lincoln; Sublette; Teton; Uinta,projected 2D,,,East,North,X,Y,9003,,4267,14904,1995-06-02 00:00:00,,EPSG,,
+32061,NAD27 / Guatemala Norte,,,,Guatemala - north of 15 deg 50 min North.,projected 2D,,,East,North,X,Y,9001,,4267,18211,1999-08-18 00:00:00,,EPSG,,
+32062,NAD27 / Guatemala Sud,,,,Guatemala - south of 15 deg 50 min North.,projected 2D,,,East,North,X,Y,9001,,4267,18212,1999-08-18 00:00:00,,EPSG,,
+32074,NAD27 / BLM 14N (feet),,,,United States - Gulf of Mexico - west of approximately 96 deg West - outer continental shelf (OCS) protraction areas Corpus Christi; Port Isabel.,projected 2D,,,East,North,X,Y,9003,,4267,15914,1996-04-12 00:00:00,,EPSG,,96.03
+32075,NAD27 / BLM 15N (feet),,,,United States - Gulf of Mexico - 96 deg to 90 deg West - outer continental shelf (OCS) protraction areas East Breaks (EB); Alaminos Canyon (AC); Garden Banks (GB); Keathley Canyon (KC); Ewing Bank (EW); Green Canyon (GC); Walker Ridge (WR).,projected 2D,,,East,North,X,Y,9003,,4267,15915,1996-04-12 00:00:00,,EPSG,,96.03
+32076,NAD27 / BLM 16N (feet),,,,United States - Gulf of Mexico - 90 deg to 84 deg West - outer continental shelf (OCS) protraction areas Mobile (MO); Viosca Knoll (VK); Mississippi Canyon (MC); Atwater Valley (AT); Lund; Pensacola; Destin Dome (DD); De Soto Canyon; Lloyd; Henderson; Apalachicola; Florida Middle Ground; The Elbow; Vernon Basin; Howell Hook.,projected 2D,,,East,North,X,Y,9003,,4267,15916,1996-04-12 00:00:00,,EPSG,,95.27  96.03
+32077,NAD27 / BLM 17N (feet),,,,United States - Gulf of Mexico - east of 84 deg West - outer continental shelf (OCS) protraction areas Gainesville; Tarpon Springs; St. Petersburg; Charlotte Harbor; Pulley Ridge; Dry Tortugas; Miami; Key West.,projected 2D,,,East,North,X,Y,9003,,4267,15917,1996-04-12 00:00:00,,EPSG,,96.03
+32081,NAD27 / MTM zone 1,,,,Canada - Newfoundland - east of 54 deg 30 min West.,projected 2D,,,East,North,E,N,9001,,4267,17701,1997-11-13 00:00:00,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+32082,NAD27 / MTM zone 2,,,,Canada - Newfoundland and Labrador between 57 deg 30 min and 54 de 30 min West.,projected 2D,,,East,North,E,N,9001,,4267,17702,1997-11-13 00:00:00,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+32083,NAD27 / MTM zone 3,,,,Canada - Newfoundland and Labrador between 60 deg and 57 deg 30 min West.,projected 2D,,,East,North,E,N,9001,,4267,17703,1997-11-13 00:00:00,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+32084,NAD27 / MTM zone 4,,,,Canada - Newfoundland (Labrador) between 63 deg and 60 deg West.,projected 2D,,,East,North,E,N,9001,,4267,17704,1997-11-13 00:00:00,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+32085,NAD27 / MTM zone 5,,,,Canada - Newfoundland (Labrador) between 66 deg and 63 deg West.,projected 2D,,,East,North,E,N,9001,,4267,17705,1997-11-13 00:00:00,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+32086,NAD27 / MTM zone 6,,,,Canada - Newfoundland (Labrador) between 69 deg and  66 deg West.,projected 2D,,,East,North,E,N,9001,,4267,17706,1997-11-13 00:00:00,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+32100,NAD83 / Montana,,,,United States (USA) - Montana - MT - counties of Beaverhead; Big Horn; Blaine; Broadwater; Carbon; Carter; Cascade; Chouteau; Custer; Daniels; Dawson; Deer Lodge; Fallon; Fergus; Flathead; Gallatin; Garfield; Glacier; Golden Valley; Granite; Hill; Jefferson; Judith Basin; Lake; Lewis and Clark; Liberty; Lincoln; Madison; McCone; Meagher; Mineral; Missoula; Musselshell; Park; Petroleum; Phillips; Pondera; Powder River; Powell; Prairie; Ravalli; Richland; Roosevelt [...]
+32104,NAD83 / Nebraska,,,,United States (USA) - Nebraska - NE - counties of Adams; Antelope; Arthur; Banner; Blaine; Boone; Box Butte; Boyd; Brown; Buffalo; Burt; Butler; Cass; Cedar; Chase; Cherry; Cheyenne; Clay; Colfax; Cuming; Custer; Dakota; Dawes; Dawson; Deuel; Dixon; Dodge; Douglas; Dundy; Fillmore; Franklin; Frontier; Furnas; Gage; Garden; Garfield; Gosper; Grant; Greeley; Hall; Hamilton; Harlan; Hayes; Hitchcock; Holt; Hooker; Howard; Jefferson; Johnson; Kearney; Keith; Keya Pa [...]
+32107,NAD83 / Nevada  East,,,,United States (USA) - Nevada - NV_E - counties of Clark; Elko; Eureka; Lincoln; White Pine,projected 2D,,,East,North,X,Y,9001,,4269,12731,1995-06-02 00:00:00,,EPSG,,
+32108,NAD83 / Nevada Central,,,,United States (USA) - Nevada - NV_C - counties of Lander; Nye,projected 2D,,,East,North,X,Y,9001,,4269,12732,1995-06-02 00:00:00,,EPSG,,
+32109,NAD83 / Nevada West,,,,United States (USA) - Nevada - NV_W - counties of Churchill; Douglas; Esmeralda; Humboldt; Lyon; Mineral; Pershing; Storey; Washoe,projected 2D,,,East,North,X,Y,9001,,4269,12733,1995-06-02 00:00:00,,EPSG,,
+32110,NAD83 / New Hampshire,,,,United States (USA) - New Hampshire - NH - counties of Belknap; Carroll; Cheshire; Coos; Grafton; Hillsborough; Merrimack; Rockingham; Strafford; Sullivan,projected 2D,,,East,North,X,Y,9001,,4269,12830,1995-06-02 00:00:00,,EPSG,,
+32111,NAD83 / New Jersey,,,,United States (USA) - New Jersey - NJ - counties of Atlantic; Bergen; Burlington; Camden; Cape May; Cumberland; Essex; Gloucester; Hudson; Hunterdon; Mercer; Middlesex; Monmouth; Morris; Ocean; Passaic; Salem; Somerset; Sussex; Union; Warren,projected 2D,,,East,North,X,Y,9001,,4269,12930,1995-06-02 00:00:00,,EPSG,,
+32112,NAD83 / New Mexico East,,,,United States (USA) - New Mexico - NM_E - counties of Chaves; Colfax; Curry; De Baca; Eddy; Guadalupe; Harding; Lea; Mora; Quay; Roosevelt; San Miguel; Union,projected 2D,,,East,North,X,Y,9001,,4269,13031,1995-06-02 00:00:00,,EPSG,,
+32113,NAD83 / New Mexico Central,NAD83 / New Mexico Cent.,,,United States (USA) - New Mexico - NM_C - counties of Bernalillo; Dona Ana; Lincoln; Los Alamos; Otero; Rio Arriba; Sandoval; Santa Fe; Socorro; Taos; Torrance; Valencia,projected 2D,,,East,North,X,Y,9001,,4269,13032,1995-06-02 00:00:00,,EPSG,,
+32114,NAD83 / New Mexico West,,,,United States (USA) - New Mexico - NM_W - counties of Catron; Cibola; Grant; Hidalgo; Luna; McKinley; San Juan; Sierra,projected 2D,,,East,North,X,Y,9001,,4269,13033,1995-06-02 00:00:00,,EPSG,,
+32115,NAD83 / New York  East,,,,United States (USA) - New York - NY_E - counties of Albany; Clinton; Columbia; Delaware; Dutchess; Essex; Franklin; Fulton; Greene; Hamilton; Herkimer; Montgomery; Orange; Otsego; Putnam; Rensselaer; Rockland; Saratoga; Schenectady; Schoharie; St. Lawrence; Sullivan; Ulster; Warren; Washington; Westchester,projected 2D,,,East,North,X,Y,9001,,4269,13131,1995-06-02 00:00:00,,EPSG,,
+32116,NAD83 / New York Central,,,,United States (USA) - New York - NY_C - counties of Broome; Cayuga; Chemung; Chenango; Cortland; Jefferson; Lewis; Madison; Oneida; Onondaga; Ontario; Oswego; Schuyler; Seneca; Steuben; Tioga; Tompkins; Wayne; Yates,projected 2D,,,East,North,X,Y,9001,,4269,13132,1995-06-02 00:00:00,,EPSG,,
+32117,NAD83 / New York  West,,,,United States (USA) - New York - NY_W - counties of Allegany; Cattaraugus; Chautauqua; Erie; Genesee; Livingston; Monroe; Niagara; Orleans; Wyoming,projected 2D,,,East,North,X,Y,9001,,4269,13133,1995-06-02 00:00:00,,EPSG,,
+32118,NAD83 / New York Long Island,NAD83 / New York Long Is,,,United States (USA) - New York - NY_LI - counties of Bronx; Kings; Nassau; New York; Queens; Richmond; Suffolk,projected 2D,,,East,North,X,Y,9001,,4269,13134,1995-06-02 00:00:00,,EPSG,,
+32119,NAD83 / North Carolina,,,,United States (USA) - North Carolina - NC - counties of Alamance; Alexander; Alleghany; Anson; Ashe; Avery; Beaufort; Bertie; Bladen; Brunswick; Buncombe; Burke; Cabarrus; Caldwell; Camden; Carteret; Caswell; Catawba; Chatham; Cherokee; Chowan; Clay; Cleveland; Columbus; Craven; Cumberland; Currituck; Dare; Davidson; Davie; Duplin; Durham; Edgecombe; Forsyth; Franklin; Gaston; Gates; Graham; Granville; Greene; Guilford; Halifax; Harnett; Haywood; Henderson [...]
+32120,NAD83 / North Dakota North,NAD83 / North Dakota N,,,United States (USA) - North Dakota - ND_N - counties of Benson; Bottineau; Burke; Cavalier; Divide; Eddy; Foster; Grand Forks; Griggs; McHenry; McKenzie; McLean; Mountrial; Nelson; Pembina; Pierce; Ramsey; Renville; Rolette; Sheridan; Steele; Towner; Traill; Walsh; Ward; Wells; Williams,projected 2D,,,East,North,X,Y,9001,,4269,13331,1995-06-02 00:00:00,,EPSG,,
+32121,NAD83 / North Dakota South,NAD83 / North Dakota S,,,United States (USA) - North Dakota - ND_S - counties of Adams; Barnes; Billings; Bowman; Burleigh; Cass; Dickey; Dunn; Emmons; Golden Valley; Grant; Hettinger; Kidder; La Moure; Logan; McIntosh; Mercer; Morton; Oliver; Ransom; Richland; Sargent; Sioux; Slope; Stark; Stutsman,projected 2D,,,East,North,X,Y,9001,,4269,13332,1995-06-02 00:00:00,,EPSG,,
+32122,NAD83 / Ohio North,,,,United States (USA) - Ohio - OH_N - counties of Allen;Ashland; Ashtabula; Auglaize; Carroll; Columbiana; Coshocton; Crawford; Cuyahoga; Defiance; Delaware; Erie; Fulton; Geauga; Hancock; Hardin; Harrison; Henry; Holmes; Huron; Jefferson; Knox; Lake; Logan; Lorain; Lucas; Mahoning; Marion; Medina; Mercer; Morrow; Ottawa; Paulding; Portage; Putnam; Richland; Sandusky; Seneca; Shelby; Stark; Summit; Trumbull; Tuscarawas; Union; Van Wert; Wayne; Williams; Wood; Wy [...]
+32123,NAD83 / Ohio South,,,,United States (USA) - Ohio - OH_S - counties of Adams; Athens; Belmont; Brown; Butler; Champaign; Clark; Clermont; Clinton; Darke; Fairfield; Fayette; Franklin; Gallia; Greene; Guernsey; Hamilton; Highland; Hocking; Jackson; Lawrence; Licking; Madison; Meigs; Miami; Monroe; Montgomery; Morgan; Muskingum; Noble; Perry; Pickaway; Pike; Preble; Ross; Scioto; Vinton; Warren; Washington,projected 2D,,,East,North,X,Y,9001,,4269,13432,1995-06-02 00:00:00,,EPSG,,
+32124,NAD83 / Oklahoma North,,,,United States (USA) - Oklahoma - OK_N - counties of Adair; Alfalfa; Beaver; Blaine; Canadian; Cherokee; Cimarron; Craig; Creek; Custer; Delaware; Dewey; Ellis; Garfield; Grant; Harper; Kay; Kingfisher; Lincoln; Logan; Major; Mayes; Muskogee; Noble; Nowata; Okfuskee; Oklahoma; Okmulgee; Osage; Ottawa; Pawnee; Payne; Roger Mills; Rogers; Sequoyah; Texas; Tulsa; Wagoner; Washington; Woods; Woodward,projected 2D,,,East,North,X,Y,9001,,4269,13531,1995-06-02 00: [...]
+32125,NAD83 / Oklahoma South,,,,United States (USA) - Oklahoma - OK_S - counties of Atoka; Beckham; Bryan; Caddo; Carter; Choctaw; Cleveland; Coal; Comanche; Cotton; Garvin; Grady; Greer; Harmon; Haskell; Hughes; Jackson; Jefferson; Johnston; Kiowa; Latimer; Le Flore; Love; Marshall; McClain; McCurtain; McIntosh; Murray; Pittsburg; Pontotoc; Pottawatomie; Pushmataha; Seminole; Stephens; Tillman; Washita,projected 2D,,,East,North,X,Y,9001,,4269,13532,1995-06-02 00:00:00,,EPSG,,
+32126,NAD83 / Oregon North,,,,United States (USA) - Oregon - OR_N - counties of Baker; Benton; Clackamas; Clatsop; Columbia; Gilliam; Grant; Hood River; Jefferson; Lincoln; Linn; Marion; Morrow; Multnomah; Polk; Sherman; Tillamook; Umatilla; Union; Wallowa; Wasco; Washington; Wheeler; Yamhill,projected 2D,,,East,North,X,Y,9001,,4269,13631,1995-06-02 00:00:00,,EPSG,,
+32127,NAD83 / Oregon South,,,,United States (USA) - Oregon - OR_S - counties of Coos; Crook; Curry; Deschutes; Douglas; Harney; Jackson; Josephine; Klamath; Lake; Lane; Malheur,projected 2D,,,East,North,X,Y,9001,,4269,13632,1995-06-02 00:00:00,,EPSG,,
+32128,NAD83 / Pennsylvania North,NAD83 / Pennsylvania N,,,United States (USA) - Pennsylvania - PA_N - counties of Bradford; Cameron; Carbon; Centre; Clarion; Clearfield; Clinton; Columbia; Crawford; Elk; Erie; Forest; Jefferson; Lackawanna; Luzerne; Lycoming; McKean; Mercer; Monroe; Montour; Northumberland; Pike; Potter; Sullivan; Susquehanna; Tioga; Union; Venango; Warren; Wayne; Wyoming,projected 2D,,,East,North,X,Y,9001,,4269,13731,1995-06-02 00:00:00,,EPSG,,
+32129,NAD83 / Pennsylvania South,NAD83 / Pennsylvania S,,,United States (USA) - Pennsylvania - PA_S - counties of Adams; Allegheny; Armstrong; Beaver; Bedford; Berks; Blair; Bucks; Butler; Cambria; Chester; Cumberland; Dauphin; Delaware; Fayette; Franklin; Fulton; Greene; Huntingdon; Indiana; Juniata; Lancaster; Lawrence; Lebanon; Lehigh; Mifflin; Montgomery; Northampton; Perry; Philadelphia; Schuylkill; Snyder; Somerset; Washington; Westmoreland; York,projected 2D,,,East,North,X,Y,9001, [...]
+32130,NAD83 / Rhode Island,,,,United States (USA) - Rhode Island - RI - counties of Bristol; Kent; Newport; Providence; Washington,projected 2D,,,East,North,X,Y,9001,,4269,13830,1995-06-02 00:00:00,,EPSG,,
+32133,NAD83 / South Carolina,,,,United States (USA) - South Carolina - SC - counties of Abbeville; Aiken; Allendale; Anderson; Bamberg; Barnwell; Beaufort; Berkeley; Calhoun; Charleston; Cherokee; Chester; Chesterfield; Clarendon; Colleton; Darlington; Dillon; Dorchester; Edgefield; Fairfield; Florence; Georgetown; Greenville; Greenwood; Hampton; Horry; Jasper; Kershaw; Lancaster; Laurens; Lee; Lexington; Marion; Marlboro; McCormick; Newberry; Oconee; Orangeburg; Pickens; Richland; Salud [...]
+32134,NAD83 / South Dakota North,NAD83 / South Dakota N,,,United States (USA) - South Dakota - SD_N - counties of Beadle; Brookings; Brown; Butte; Campbell; Clark; Codington; Corson; Day; Deuel; Dewey; Edmunds; Faulk; Grant; Hamlin; Hand; Harding; Hyde; Kingsbury; Lawrence; Marshall; McPherson; Meade; Perkins; Potter; Roberts; Spink; Sully; Walworth; Ziebach,projected 2D,,,East,North,X,Y,9001,,4269,14031,1995-06-02 00:00:00,,EPSG,,
+32135,NAD83 / South Dakota South,NAD83 / South Dakota S,,,United States (USA) - South Dakota - SD_S - counties of Aurora; Bennett; Bon Homme; Brule; Buffalo; Charles Mix; Clay; Custer; Davison; Douglas; Fall River; Gregory; Haakon; Hanson; Hughes; Hutchinson; Jackson; Jerauld; Jones; Lake; Lincoln; Lyman; McCook; Mellette; Miner; Minnehaha; Moody; Pennington; Sanborn; Shannon; Stanley; Todd; Tripp; Turner; Union; Yankton,projected 2D,,,East,North,X,Y,9001,,4269,14032,1995-06-02 00:00:00, [...]
+32136,NAD83 / Tennessee,,,,United States (USA) - Tennessee - TN - counties of Anderson; Bedford; Benton; Bledsoe; Blount; Bradley; Campbell; Cannon; Carroll; Carter; Cheatham; Chester; Claiborne; Clay; Cocke; Coffee; Crockett; Cumberland; Davidson; De Kalb; Decatur; Dickson; Dyer; Fayette; Fentress; Franklin; Gibson; Giles; Grainger; Greene; Grundy; Hamblen; Hamilton; Hancock; Hardeman; Hardin; Hawkins; Haywood; Henderson; Henry; Hickman; Houston; Humphreys; Jackson; Jefferson; Johnson;  [...]
+32137,NAD83 / Texas North,,,,United States (USA) - Texas -TX_N - counties of: Armstrong; Briscoe; Carson; Castro; Childress; Collingsworth; Dallam; Deaf Smith; Donley; Gray; Hall; Hansford; Hartley; Hemphill; Hutchinson; Lipscomb; Moore; Ochiltree; Oldham; Parmer; Potter; Randall; Roberts; Sherman; Swisher; Wheeler,projected 2D,,,East,North,X,Y,9001,,4269,14231,1995-06-02 00:00:00,,EPSG,,
+32138,NAD83 / Texas North Central,NAD83 / Texas North Cen.,,,United States (USA) - Texas -TX_NC - counties of: Andrews; Archer; Bailey; Baylor; Borden; Bowie; Callahan; Camp; Cass; Clay; Cochran; Collin; Cooke; Cottle; Crosby; Dallas; Dawson; Delta; Denton; Dickens; Eastland; Ellis; Erath; Fannin; Fisher; Floyd; Foard; Franklin; Gaines; Garza; Grayson,projected 2D,,,East,North,X,Y,9001,,4269,14232,1995-06-02 00:00:00,,EPSG,,
+32139,NAD83 / Texas Central,,,,United States (USA) - Texas -TX_C - counties of Anderson; Angelina; Bastrop; Bell; Blanco; Bosque; Brazos; Brown; Burleson; Burnet; Cherokee; Coke; Coleman; Comanche; Concho; Coryell; Crane; Crockett; Culberson; Ector; El Paso; Falls; Freestone; Gillespie; Glasscock; Grimes; Hamilton; Hardin; Houston; Hudspeth; Irion; Jasper; Jeff Davis; Kimble; Lampasas; Lee; Leon; Liberty; Limestone; Llano; Loving; Madison; Mason; McCulloch; McLennan; Menard; Midland; Mil [...]
+32140,NAD83 / Texas South Central,NAD83 / Texas South Cen.,,,United States (USA) - Texas -TX_SC - counties of Aransas; Atascosa; Austin; Bandera; Bee; Bexar; Brazoria; Brewster; Caldwell; Calhoun; Chambers; Colorado; Comal; De Witt; Dimmit; Edwards; Fayette; Fort Bend; Frio; Galveston; Goliad; Gonzales; Guadalupe; Harris; Hays; Jackson; Jefferson; Karnes; Kendall; Kerr; Kinney; La Salle; Lavaca; Live Oak; Matagorda; Maverick; McMullen; Medina; Presidio; Real; Refugio; Terrell; Uvalde; Va [...]
+32141,NAD83 / Texas South,,,,United States (USA) - Texas -TX_S - counties of Brooks; Cameron; Duval; Hidalgo; Jim Hogg; Jim Wells; Kenedy; Kleberg; Nueces; San Patricio; Starr; Webb; Willacy; Zapata,projected 2D,,,East,North,X,Y,9001,,4269,14235,1995-06-02 00:00:00,,EPSG,,
+32142,NAD83 / Utah North,,,,United States (USA) - Utah - UT_N - counties of Box Elder; Cache; Daggett; Davis; Morgan; Rich; Summit; Weber,projected 2D,,,East,North,X,Y,9001,,4269,14331,1995-06-02 00:00:00,,EPSG,,
+32143,NAD83 / Utah Central,,,,United States (USA) - Utah - UT_C - counties of Carbon; Duchesne; Emery; Grand; Juab; Millard; Salt Lake; Sanpete; Sevier; Tooele; Uintah; Utah; Wasatch,projected 2D,,,East,North,X,Y,9001,,4269,14332,1995-06-02 00:00:00,,EPSG,,
+32144,NAD83 / Utah South,,,,United States (USA) - Utah - UT_S - counties of Beaver; Garfield; Iron; Kane; Piute; San Juan; Washington; Wayne,projected 2D,,,East,North,X,Y,9001,,4269,14333,1995-06-02 00:00:00,,EPSG,,
+32145,NAD83 / Vermont,,,,United States (USA) - Vermont - VT - counties of Addison; Bennington; Caledonia; Chittenden; Essex; Franklin; Grand Isle; Lamoille; Orange; Orleans; Rutland; Washington; Windham; Windsor,projected 2D,,,East,North,X,Y,9001,,4269,14430,1995-06-02 00:00:00,,EPSG,,
+32146,NAD83 / Virginia North,,,,United States (USA) - Virginia - VA_N - counties of Arlington; Augusta; Bath; Caroline; Clarke; Culpeper; Fairfax; Fauquier; Frederick; Greene; Highland; King George; Loudoun; Madison; Orange; Page; Prince William; Rappahannock; Rockingham; Shenandoah; Spotsylvania; Stafford; Warren; Westmoreland,projected 2D,,,East,North,X,Y,9001,,4269,14531,1995-06-02 00:00:00,,EPSG,,
+32147,NAD83 / Virginia South,,,,United States (USA) - Virginia - VA_S - counties of Accomack; Albemarle; Alleghany; Amelia; Amherst; Appomattox; Bedford; Bland; Botetourt; Bristol; Brunswick; Buchanan; Buckingham; Campbell; Carroll; Charles City; Charlotte; Chesapeake; Chesterfield; Colonial Heights; Craig; Cumberland; Dickenson; Dinwiddie; Essex; Floyd; Fluvanna; Franklin; Giles; Gloucester; Goochland; Grayson; Greensville; Halifax; Hampton; Hanover; Henrico; Henry; Isle of Wight; James [...]
+32148,NAD83 / Washington North,,,,United States (USA) - Washington - WA_N - counties of Chelan; Clallam; Douglas; Ferry; Grant north of approx. 47d30m; Island; Jefferson; King; Kitsap; Lincoln; Okanogan; Pend Oreille; San Juan; Skagit; Snohomish; Spokane; Stevens; Whatcom,projected 2D,,,East,North,X,Y,9001,,4269,14631,1995-06-02 00:00:00,,EPSG,,
+32149,NAD83 / Washington South,,,,United States (USA) - Washington - WA_S - counties of Adams; Asotin; Benton; Clark; Columbia; Cowlitz; Franklin; Garfield; Grant south of approx. 47d30m; Grays Harbor; Kittitas; Klickitat; Lewis; Mason; Pacific; Pierce; Skamania; Thurston; Wahkiakum; Walla Walla; Whitman; Yakima,projected 2D,,,East,North,X,Y,9001,,4269,14632,1995-06-02 00:00:00,,EPSG,,
+32150,NAD83 / West Virginia North,NAD83 / West Virginia N,,,United States (USA) - West Virginia - WV_N - counties of Barbour; Berkeley; Brooke; Doddridge; Grant; Hampshire; Hancock; Hardy; Harrison; Jefferson; Marion; Marshall; Mineral; Monongalia; Morgan; Ohio; Pleasants; Preston; Ritchie; Taylor; Tucker; Tyler; Wetzel; Wirt; Wood,projected 2D,,,East,North,X,Y,9001,,4269,14731,1995-06-02 00:00:00,,EPSG,,
+32151,NAD83 / West Virginia South,NAD83 / West Virginia S,,,United States (USA) - West Virginia - WV_S - counties of Boone; Braxton; Cabell; Calhoun; Clay; Fayette; Gilmer; Greenbrier; Jackson; Kanawha; Lewis; Lincoln; Logan; Mason; McDowell; Mercer; Mingo; Monroe; Nicholas; Pendleton; Pocahontas; Putnam; Raleigh; Randolph; Roane; Summers; Upshur; Wayne; Webster; Wyoming,projected 2D,,,East,North,X,Y,9001,,4269,14732,1995-06-02 00:00:00,,EPSG,,
+32152,NAD83 / Wisconsin North,,,,United States (USA) - Wisconsin - WI_N - counties of Ashland; Bayfield; Burnett; Douglas; Florence; Forest; Iron; Oneida; Price; Sawyer; Vilas; Washburn,projected 2D,,,East,North,X,Y,9001,,4269,14831,1995-06-02 00:00:00,,EPSG,,
+32153,NAD83 / Wisconsin Central,NAD83 / Wisconsin Cen.,,,United States (USA) - Wisconsin - WI_C - counties of Barron; Brown; Buffalo; Chippewa; Clark; Door; Dunn; Eau Claire; Jackson; Kewaunee; Langlade; Lincoln; Marathon; Marinette; Menominee; Oconto; Outagamie; Pepin; Pierce; Polk; Portage; Rusk; Shawano; St. Croix; Taylor; Trempealeau; Waupaca; Wood,projected 2D,,,East,North,X,Y,9001,,4269,14832,1995-06-02 00:00:00,,EPSG,,
+32154,NAD83 / Wisconsin South,,,,United States (USA) - Wisconsin - WI_S - counties of Adams; Calumet; Columbia; Crawford; Dane; Dodge; Fond Du Lac; Grant; Green; Green Lake; Iowa; Jefferson; Juneau; Kenosha; La Crosse; Lafayette; Manitowoc; Marquette; Milwaukee; Monroe; Ozaukee; Racine; Richland; Rock; Sauk; Sheboygan; Vernon; Walworth; Washington; Waukesha; Waushara; Winnebago,projected 2D,,,East,North,X,Y,9001,,4269,14833,1995-06-02 00:00:00,,EPSG,,
+32155,NAD83 / Wyoming East,,,,United States (USA) - Wyoming - WY_E - counties of Albany; Campbell; Converse; Crook; Goshen; Laramie; Niobrara; Platte; Weston,projected 2D,,,East,North,X,Y,9001,,4269,14931,1995-06-02 00:00:00,,EPSG,,
+32156,NAD83 / Wyoming East Central,NAD83 / Wyoming E. Cen.,,,United States (USA) - Wyoming - WY_EC - counties of Big Horn; Carbon; Johnson; Natrona; Sheridan; Washakie,projected 2D,,,East,North,X,Y,9001,,4269,14932,1995-06-02 00:00:00,,EPSG,,
+32157,NAD83 / Wyoming West Central,NAD83 / Wyoming W. Cen.,,,United States (USA) - Wyoming - WY_WC - counties of Fremont; Hot Springs; Park; Sweetwater,projected 2D,,,East,North,X,Y,9001,,4269,14933,1995-06-02 00:00:00,,EPSG,,
+32158,NAD83 / Wyoming West,,,,United States (USA) - Wyoming - WY_W - counties of Lincoln; Sublette; Teton; Uinta,projected 2D,,,East,North,X,Y,9001,,4269,14934,1995-06-02 00:00:00,,EPSG,,
+32161,NAD83 / Puerto Rico & Virgin Is.,,,,Puerto Rico and U.S. Virgin Islands.,projected 2D,,,East,North,X,Y,9001,,4269,15230,1995-06-02 00:00:00,,EPSG,,
+32180,NAD83 / SCoPQ zone 2,,,,Canada - Quebec - east of 57 deg East.,projected 2D,,,East,North,X,Y,9001,,4269,17700,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,,
+32181,NAD83 / MTM zone 1,,,,Canada - Newfoundland - east of 54 deg 30 min West.,projected 2D,,,East,North,E(X),N(Y),9001,,4269,17701,1997-11-13 00:00:00,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+32182,NAD83 / MTM zone 2,,,,Canada - Newfoundland and Labrador between 57 deg 30 min and 54 de 30 min West.,projected 2D,,,East,North,E(X),N(Y),9001,,4269,17702,1997-11-13 00:00:00,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+32183,NAD83 / MTM zone 3,,,,Canada - Newfoundland and Labrador between 60 deg and 57 deg 30 min West; Canada - Quebec between 60 deg and 57 deg West.,projected 2D,,,East,North,E(X),N(Y),9001,,4269,17703,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,"Known in Quebec as \"NAD83 / SCoPQ zone 3\" with axis 1 and 2 abbreviations of \"X\" and \"Y\" respectively.",
+32184,NAD83 / MTM zone 4,,,,Canada - Quebec and Newfoundland (Labrador) between 63 deg and 60 deg West.,projected 2D,,,East,North,E(X),N(Y),9001,,4269,17704,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,"Known in Quebec as \"NAD83 / SCoPQ zone 4\" with axis 1 and 2 abbreviations of \"X\" and \"Y\" respectively.",
+32185,NAD83 / MTM zone 5,,,,Canada - Quebec and Newfoundland (Labrador) between 66 deg and 63 deg West.,projected 2D,,,East,North,E(X),N(Y),9001,,4269,17705,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,"Known in Quebec as \"NAD83 / SCoPQ zone 5\" with axis 1 and 2 abbreviations of \"X\" and \"Y\" respectively.",
+32186,NAD83 / MTM zone 6,,,,Canada - Quebec and Newfoundland (Labrador) between 69 deg and  66 deg West.,projected 2D,,,East,North,E(X),N(Y),9001,,4269,17706,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,"Known in Quebec as \"NAD83 / SCoPQ zone 6\" with axis 1 and 2 abbreviations of \"X\" and \"Y\" respectively.",
+32187,NAD83 / MTM zone 7,,,,Canada - Quebec between 72 deg and 69 deg West.,projected 2D,,,East,North,E(X),N(Y),9001,,4269,17707,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,"Known in Quebec as \"NAD83 / SCoPQ zone 7\" with axis 1 and 2 abbreviations of \"X\" and \"Y\" respectively.",
+32188,NAD83 / MTM zone 8,,,,Canada - Quebec between 75 deg and 72 deg West.; Canada - Ontario - east of 75 deg West.,projected 2D,,,East,North,E(X),N(Y),9001,,4269,17708,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,"Known in Quebec as \"NAD83 / SCoPQ zone 8\" with axis 1 and 2 abbreviations of \"X\" and \"Y\" respectively.",
+32189,NAD83 / MTM zone 9,,,,Canada - Quebec and Ontario - between 78 deg and 75 deg West.,projected 2D,,,East,North,E(X),N(Y),9001,,4269,17709,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,"Known in Quebec as \"NAD83 / SCoPQ zone 9\" with axis 1 and 2 abbreviations of \"X\" and \"Y\" respectively.",
+32190,NAD83 / MTM zone 10,,,,Canada - Quebec west of 78 deg West; Canada - Ontario - between 79 deg 30 min and 78 deg W in area to north of 47 deg N; between 80 deg 15 min and 78 deg W in area between 46 deg and 47 deg N; between 81 deg and 78 deg W in area south of 46 deg N.,projected 2D,,,East,North,E(X),N(Y),9001,,4269,17710,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,"Known in Quebec as \"NAD83 / SCoPQ zone 10\" with axis 1 and 2 abbrevia [...]
+32191,NAD83 / MTM zone 11,,,,Canada - Ontario - south of 46 deg N and west of 81 deg West.,projected 2D,,,East,North,E,N,9001,,4269,17711,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+32192,NAD83 / MTM zone 12,,,,Canada - Ontario - between 82 deg 30 min and 79 deg 30 min W in area to north of 47 deg N; between 82 deg 30 min and 80 deg 15 min W in area between 46 deg and 47 deg N; between 82 deg 30 min and 79 deg 30 min W in area north of 47 deg N.,projected 2D,,,East,North,E,N,9001,,4269,17712,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+32193,NAD83 / MTM zone 13,,,,Canada - Ontario - between 85 deg 30 min and 82 deg 30 min West and north of 46 deg North.,projected 2D,,,East,North,E,N,9001,,4269,17713,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+32194,NAD83 / MTM zone 14,,,,Canada - Ontario - between 88 deg 30 min and 85 deg 30 min West.,projected 2D,,,East,North,E,N,9001,,4269,17714,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+32195,NAD83 / MTM zone 15,,,,Canada - Ontario - between 91 deg 30 min and 88 deg 30 min West.,projected 2D,,,East,North,E,N,9001,,4269,17715,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+32196,NAD83 / MTM zone 16,,,,Canada - Ontario - between 94 deg 30 min and 91 deg 30 min West.,projected 2D,,,East,North,E,N,9001,,4269,17716,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+32197,NAD83 / MTM zone 17,,,,Canada - Ontario - west of 94 deg 30 min West.,projected 2D,,,East,North,E,N,9001,,4269,17717,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+32198,NAD83 / Quebec Lambert,,,,Canada - Quebec,projected 2D,,,East,North,X,Y,9001,,4269,19944,1999-10-20 00:00:00,Service de la Cartographie; Minist�re des Ressources Naturelles; Quebec,EPSG,,
+32201,WGS 72 / UTM zone 1N,,,,180deg to 174deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16001,1995-06-02 00:00:00,,EPSG,,
+32202,WGS 72 / UTM zone 2N,,,,174deg West to 168deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16002,1995-06-02 00:00:00,,EPSG,,
+32203,WGS 72 / UTM zone 3N,,,,168deg West to 162deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16003,1995-06-02 00:00:00,,EPSG,,
+32204,WGS 72 / UTM zone 4N,,,,162deg West to 156deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16004,1995-06-02 00:00:00,,EPSG,,
+32205,WGS 72 / UTM zone 5N,,,,156deg West to 150deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16005,1995-06-02 00:00:00,,EPSG,,
+32206,WGS 72 / UTM zone 6N,,,,150deg West to 144deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16006,1995-06-02 00:00:00,,EPSG,,
+32207,WGS 72 / UTM zone 7N,,,,144deg West to 138deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16007,1995-06-02 00:00:00,,EPSG,,
+32208,WGS 72 / UTM zone 8N,,,,138deg West to 132deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16008,1995-06-02 00:00:00,,EPSG,,
+32209,WGS 72 / UTM zone 9N,,,,132deg West to 126deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16009,1995-06-02 00:00:00,,EPSG,,
+32210,WGS 72 / UTM zone 10N,,,,130deg West to 120deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16010,1995-06-02 00:00:00,,EPSG,,
+32211,WGS 72 / UTM zone 11N,,,,120deg West to 114deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16011,1995-06-02 00:00:00,,EPSG,,
+32212,WGS 72 / UTM zone 12N,,,,114deg West to 108deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16012,1995-06-02 00:00:00,,EPSG,,
+32213,WGS 72 / UTM zone 13N,,,,108deg West to 102deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16013,1995-06-02 00:00:00,,EPSG,,
+32214,WGS 72 / UTM zone 14N,,,,102deg West to 96deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16014,1995-06-02 00:00:00,,EPSG,,
+32215,WGS 72 / UTM zone 15N,,,,96deg West to 90deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16015,1995-06-02 00:00:00,,EPSG,,
+32216,WGS 72 / UTM zone 16N,,,,90deg West to 84deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16016,1995-06-02 00:00:00,,EPSG,,
+32217,WGS 72 / UTM zone 17N,,,,84deg West to 78deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16017,1995-06-02 00:00:00,,EPSG,,
+32218,WGS 72 / UTM zone 18N,,,,78deg West to 72deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16018,1995-06-02 00:00:00,,EPSG,,
+32219,WGS 72 / UTM zone 19N,,,,72deg West to 66deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16019,1995-06-02 00:00:00,,EPSG,,
+32220,WGS 72 / UTM zone 20N,,,,66deg West to 60deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16020,1995-06-02 00:00:00,,EPSG,,
+32221,WGS 72 / UTM zone 21N,,,,60deg West to 54deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16021,1995-06-02 00:00:00,,EPSG,,
+32222,WGS 72 / UTM zone 22N,,,,54deg West to 48deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16022,1995-06-02 00:00:00,,EPSG,,
+32223,WGS 72 / UTM zone 23N,,,,48deg West to 42deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16023,1995-06-02 00:00:00,,EPSG,,
+32224,WGS 72 / UTM zone 24N,,,,42deg West to 36deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16024,1995-06-02 00:00:00,,EPSG,,
+32225,WGS 72 / UTM zone 25N,,,,36deg West to 30deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16025,1995-06-02 00:00:00,,EPSG,,
+32226,WGS 72 / UTM zone 26N,,,,30deg West to 24deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16026,1995-06-02 00:00:00,,EPSG,,
+32227,WGS 72 / UTM zone 27N,,,,24deg West to 18deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16027,1995-06-02 00:00:00,,EPSG,,
+32228,WGS 72 / UTM zone 28N,,,,18deg West to 12deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16028,1995-06-02 00:00:00,,EPSG,,
+32229,WGS 72 / UTM zone 29N,,,,12deg West to 6deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16029,1995-06-02 00:00:00,,EPSG,,
+32230,WGS 72 / UTM zone 30N,,,,6deg West to 0deg; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16030,1995-06-02 00:00:00,,EPSG,,
+32231,WGS 72 / UTM zone 31N,,,,0deg to 6deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16031,1995-06-02 00:00:00,,EPSG,,
+32232,WGS 72 / UTM zone 32N,,,,6deg East to 12deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16032,1995-06-02 00:00:00,,EPSG,,
+32233,WGS 72 / UTM zone 33N,,,,12deg East to 18deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16033,1995-06-02 00:00:00,,EPSG,,
+32234,WGS 72 / UTM zone 34N,,,,18deg East to 24deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16034,1995-06-02 00:00:00,,EPSG,,
+32235,WGS 72 / UTM zone 35N,,,,24deg East to 30deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16035,1995-06-02 00:00:00,,EPSG,,
+32236,WGS 72 / UTM zone 36N,,,,30deg East to 36deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16036,1995-06-02 00:00:00,,EPSG,,
+32237,WGS 72 / UTM zone 37N,,,,36deg East to 42deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16037,1995-06-02 00:00:00,,EPSG,,
+32238,WGS 72 / UTM zone 38N,,,,42deg East to 48deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16038,1995-06-02 00:00:00,,EPSG,,
+32239,WGS 72 / UTM zone 39N,,,,48deg East to 54deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16039,1995-06-02 00:00:00,,EPSG,,
+32240,WGS 72 / UTM zone 40N,,,,54deg East to 60deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16040,1995-06-02 00:00:00,,EPSG,,
+32241,WGS 72 / UTM zone 41N,,,,60deg East to 66deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16041,1995-06-02 00:00:00,,EPSG,,
+32242,WGS 72 / UTM zone 42N,,,,66deg East to 72deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16042,1995-06-02 00:00:00,,EPSG,,
+32243,WGS 72 / UTM zone 43N,,,,72deg East to 78deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16043,1995-06-02 00:00:00,,EPSG,,
+32244,WGS 72 / UTM zone 44N,,,,78deg East to 84deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16044,1995-06-02 00:00:00,,EPSG,,
+32245,WGS 72 / UTM zone 45N,,,,84deg East to 90deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16045,1995-06-02 00:00:00,,EPSG,,
+32246,WGS 72 / UTM zone 46N,,,,90deg East to 96deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16046,1995-06-02 00:00:00,,EPSG,,
+32247,WGS 72 / UTM zone 47N,,,,96deg East to 102eg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16047,1995-06-02 00:00:00,,EPSG,,
+32248,WGS 72 / UTM zone 48N,,,,102deg East to 108deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16048,1995-06-02 00:00:00,,EPSG,,
+32249,WGS 72 / UTM zone 49N,,,,108deg East to 114deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16049,1995-06-02 00:00:00,,EPSG,,
+32250,WGS 72 / UTM zone 50N,,,,114deg East to 120deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16050,1995-06-02 00:00:00,,EPSG,,
+32251,WGS 72 / UTM zone 51N,,,,120deg East to 126deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16051,1995-06-02 00:00:00,,EPSG,,
+32252,WGS 72 / UTM zone 52N,,,,126deg East to 132deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16052,1995-06-02 00:00:00,,EPSG,,
+32253,WGS 72 / UTM zone 53N,,,,132deg East to 138deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16053,1995-06-02 00:00:00,,EPSG,,
+32254,WGS 72 / UTM zone 54N,,,,138deg East to 144deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16054,1995-06-02 00:00:00,,EPSG,,
+32255,WGS 72 / UTM zone 55N,,,,144deg East to 150deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16055,1995-06-02 00:00:00,,EPSG,,
+32256,WGS 72 / UTM zone 56N,,,,150deg East to 156deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16056,1995-06-02 00:00:00,,EPSG,,
+32257,WGS 72 / UTM zone 57N,,,,156deg East to 162deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16057,1995-06-02 00:00:00,,EPSG,,
+32258,WGS 72 / UTM zone 58N,,,,162deg East to 168deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16058,1995-06-02 00:00:00,,EPSG,,
+32259,WGS 72 / UTM zone 59N,,,,168deg East to 174deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16059,1995-06-02 00:00:00,,EPSG,,
+32260,WGS 72 / UTM zone 60N,,,,174deg East to 180deg; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16060,1995-06-02 00:00:00,,EPSG,,
+32301,WGS 72 / UTM zone 1S,,,,180deg to 174deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16101,1995-06-02 00:00:00,,EPSG,,
+32302,WGS 72 / UTM zone 2S,,,,174deg West to 168deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16102,1995-06-02 00:00:00,,EPSG,,
+32303,WGS 72 / UTM zone 3S,,,,168deg West to 162deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16103,1995-06-02 00:00:00,,EPSG,,
+32304,WGS 72 / UTM zone 4S,,,,162deg West to 156deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16104,1995-06-02 00:00:00,,EPSG,,
+32305,WGS 72 / UTM zone 5S,,,,156deg West to 150deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16105,1995-06-02 00:00:00,,EPSG,,
+32306,WGS 72 / UTM zone 6S,,,,150deg West to 144deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16106,1995-06-02 00:00:00,,EPSG,,
+32307,WGS 72 / UTM zone 7S,,,,144deg West to 138deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16107,1995-06-02 00:00:00,,EPSG,,
+32308,WGS 72 / UTM zone 8S,,,,138deg West to 132deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16108,1995-06-02 00:00:00,,EPSG,,
+32309,WGS 72 / UTM zone 9S,,,,132deg West to 126deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16109,1995-06-02 00:00:00,,EPSG,,
+32310,WGS 72 / UTM zone 10S,,,,130deg West to 120deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16110,1995-06-02 00:00:00,,EPSG,,
+32311,WGS 72 / UTM zone 11S,,,,120deg West to 114deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16111,1995-06-02 00:00:00,,EPSG,,
+32312,WGS 72 / UTM zone 12S,,,,114deg West to 108deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16112,1995-06-02 00:00:00,,EPSG,,
+32313,WGS 72 / UTM zone 13S,,,,108deg West to 102deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16113,1995-06-02 00:00:00,,EPSG,,
+32314,WGS 72 / UTM zone 14S,,,,102deg West to 96deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16114,1995-06-02 00:00:00,,EPSG,,
+32315,WGS 72 / UTM zone 15S,,,,96deg West to 90deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16115,1995-06-02 00:00:00,,EPSG,,
+32316,WGS 72 / UTM zone 16S,,,,90deg West to 84deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16116,1995-06-02 00:00:00,,EPSG,,
+32317,WGS 72 / UTM zone 17S,,,,84deg West to 78deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16117,1995-06-02 00:00:00,,EPSG,,
+32318,WGS 72 / UTM zone 18S,,,,78deg West to 72deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16118,1995-06-02 00:00:00,,EPSG,,
+32319,WGS 72 / UTM zone 19S,,,,72deg West to 66deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16119,1995-06-02 00:00:00,,EPSG,,
+32320,WGS 72 / UTM zone 20S,,,,66deg West to 60deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16120,1995-06-02 00:00:00,,EPSG,,
+32321,WGS 72 / UTM zone 21S,,,,60deg West to 54deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16121,1995-06-02 00:00:00,,EPSG,,
+32322,WGS 72 / UTM zone 22S,,,,54deg West to 48deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16122,1995-06-02 00:00:00,,EPSG,,
+32323,WGS 72 / UTM zone 23S,,,,48deg West to 42deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16123,1995-06-02 00:00:00,,EPSG,,
+32324,WGS 72 / UTM zone 24S,,,,42deg West to 36deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16124,1995-06-02 00:00:00,,EPSG,,
+32325,WGS 72 / UTM zone 25S,,,,36deg West to 30deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16125,1995-06-02 00:00:00,,EPSG,,
+32326,WGS 72 / UTM zone 26S,,,,30deg West to 24deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16126,1995-06-02 00:00:00,,EPSG,,
+32327,WGS 72 / UTM zone 27S,,,,24deg West to 18deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16127,1995-06-02 00:00:00,,EPSG,,
+32328,WGS 72 / UTM zone 28S,,,,18deg West to 12deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16128,1995-06-02 00:00:00,,EPSG,,
+32329,WGS 72 / UTM zone 29S,,,,12deg West to 6deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16129,1995-06-02 00:00:00,,EPSG,,
+32330,WGS 72 / UTM zone 30S,,,,6deg West to 0deg; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16130,1995-06-02 00:00:00,,EPSG,,
+32331,WGS 72 / UTM zone 31S,,,,0deg to 6deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16131,1995-06-02 00:00:00,,EPSG,,
+32332,WGS 72 / UTM zone 32S,,,,6deg East to 12deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16132,1995-06-02 00:00:00,,EPSG,,
+32333,WGS 72 / UTM zone 33S,,,,12deg East to 18deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16133,1995-06-02 00:00:00,,EPSG,,
+32334,WGS 72 / UTM zone 34S,,,,18deg East to 24deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16134,1995-06-02 00:00:00,,EPSG,,
+32335,WGS 72 / UTM zone 35S,,,,24deg East to 30deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16135,1995-06-02 00:00:00,,EPSG,,
+32336,WGS 72 / UTM zone 36S,,,,30deg East to 36deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16136,1995-06-02 00:00:00,,EPSG,,
+32337,WGS 72 / UTM zone 37S,,,,36deg East to 42deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16137,1995-06-02 00:00:00,,EPSG,,
+32338,WGS 72 / UTM zone 38S,,,,42deg East to 48deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16138,1995-06-02 00:00:00,,EPSG,,
+32339,WGS 72 / UTM zone 39S,,,,48deg East to 54deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16139,1995-06-02 00:00:00,,EPSG,,
+32340,WGS 72 / UTM zone 40S,,,,54deg East to 60deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16140,1995-06-02 00:00:00,,EPSG,,
+32341,WGS 72 / UTM zone 41S,,,,60deg East to 66deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16141,1995-06-02 00:00:00,,EPSG,,
+32342,WGS 72 / UTM zone 42S,,,,66deg East to 72deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16142,1995-06-02 00:00:00,,EPSG,,
+32343,WGS 72 / UTM zone 43S,,,,72deg East to 78deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16143,1995-06-02 00:00:00,,EPSG,,
+32344,WGS 72 / UTM zone 44S,,,,78deg East to 84deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16144,1995-06-02 00:00:00,,EPSG,,
+32345,WGS 72 / UTM zone 45S,,,,84deg East to 90deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16145,1995-06-02 00:00:00,,EPSG,,
+32346,WGS 72 / UTM zone 46S,,,,90deg East to 96deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16146,1995-06-02 00:00:00,,EPSG,,
+32347,WGS 72 / UTM zone 47S,,,,96deg East to 102eg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16147,1995-06-02 00:00:00,,EPSG,,
+32348,WGS 72 / UTM zone 48S,,,,102deg East to 108deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16148,1995-06-02 00:00:00,,EPSG,,
+32349,WGS 72 / UTM zone 49S,,,,108deg East to 114deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16149,1995-06-02 00:00:00,,EPSG,,
+32350,WGS 72 / UTM zone 50S,,,,114deg East to 120deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16150,1995-06-02 00:00:00,,EPSG,,
+32351,WGS 72 / UTM zone 51S,,,,120deg East to 126deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16151,1995-06-02 00:00:00,,EPSG,,
+32352,WGS 72 / UTM zone 52S,,,,126deg East to 132deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16152,1995-06-02 00:00:00,,EPSG,,
+32353,WGS 72 / UTM zone 53S,,,,132deg East to 138deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16153,1995-06-02 00:00:00,,EPSG,,
+32354,WGS 72 / UTM zone 54S,,,,138deg East to 144deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16154,1995-06-02 00:00:00,,EPSG,,
+32355,WGS 72 / UTM zone 55S,,,,144deg East to 150deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16155,1995-06-02 00:00:00,,EPSG,,
+32356,WGS 72 / UTM zone 56S,,,,150deg East to 156deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16156,1995-06-02 00:00:00,,EPSG,,
+32357,WGS 72 / UTM zone 57S,,,,156deg East to 162deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16157,1995-06-02 00:00:00,,EPSG,,
+32358,WGS 72 / UTM zone 58S,,,,162deg East to 168deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16158,1995-06-02 00:00:00,,EPSG,,
+32359,WGS 72 / UTM zone 59S,,,,168deg East to 174deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16159,1995-06-02 00:00:00,,EPSG,,
+32360,WGS 72 / UTM zone 60S,,,,174deg East to 180deg; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4322,16160,1995-06-02 00:00:00,,EPSG,,
+32401,WGS 72BE / UTM zone 1N,,,,180deg to 174deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16001,1995-06-02 00:00:00,,EPSG,,
+32402,WGS 72BE / UTM zone 2N,,,,174deg West to 168deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16002,1995-06-02 00:00:00,,EPSG,,
+32403,WGS 72BE / UTM zone 3N,,,,168deg West to 162deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16003,1995-06-02 00:00:00,,EPSG,,
+32404,WGS 72BE / UTM zone 4N,,,,162deg West to 156deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16004,1995-06-02 00:00:00,,EPSG,,
+32405,WGS 72BE / UTM zone 5N,,,,156deg West to 150deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16005,1995-06-02 00:00:00,,EPSG,,
+32406,WGS 72BE / UTM zone 6N,,,,150deg West to 144deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16006,1995-06-02 00:00:00,,EPSG,,
+32407,WGS 72BE / UTM zone 7N,,,,144deg West to 138deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16007,1995-06-02 00:00:00,,EPSG,,
+32408,WGS 72BE / UTM zone 8N,,,,138deg West to 132deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16008,1995-06-02 00:00:00,,EPSG,,
+32409,WGS 72BE / UTM zone 9N,,,,132deg West to 126deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16009,1995-06-02 00:00:00,,EPSG,,
+32410,WGS 72BE / UTM zone 10N,,,,130deg West to 120deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16010,1995-06-02 00:00:00,,EPSG,,
+32411,WGS 72BE / UTM zone 11N,,,,120deg West to 114deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16011,1995-06-02 00:00:00,,EPSG,,
+32412,WGS 72BE / UTM zone 12N,,,,114deg West to 108deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16012,1995-06-02 00:00:00,,EPSG,,
+32413,WGS 72BE / UTM zone 13N,,,,108deg West to 102deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16013,1995-06-02 00:00:00,,EPSG,,
+32414,WGS 72BE / UTM zone 14N,,,,102deg West to 96deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16014,1995-06-02 00:00:00,,EPSG,,
+32415,WGS 72BE / UTM zone 15N,,,,96deg West to 90deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16015,1995-06-02 00:00:00,,EPSG,,
+32416,WGS 72BE / UTM zone 16N,,,,90deg West to 84deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16016,1995-06-02 00:00:00,,EPSG,,
+32417,WGS 72BE / UTM zone 17N,,,,84deg West to 78deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16017,1995-06-02 00:00:00,,EPSG,,
+32418,WGS 72BE / UTM zone 18N,,,,78deg West to 72deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16018,1995-06-02 00:00:00,,EPSG,,
+32419,WGS 72BE / UTM zone 19N,,,,72deg West to 66deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16019,1995-06-02 00:00:00,,EPSG,,
+32420,WGS 72BE / UTM zone 20N,,,,66deg West to 60deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16020,1995-06-02 00:00:00,,EPSG,,
+32421,WGS 72BE / UTM zone 21N,,,,60deg West to 54deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16021,1995-06-02 00:00:00,,EPSG,,
+32422,WGS 72BE / UTM zone 22N,,,,54deg West to 48deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16022,1995-06-02 00:00:00,,EPSG,,
+32423,WGS 72BE / UTM zone 23N,,,,48deg West to 42deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16023,1995-06-02 00:00:00,,EPSG,,
+32424,WGS 72BE / UTM zone 24N,,,,42deg West to 36deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16024,1995-06-02 00:00:00,,EPSG,,
+32425,WGS 72BE / UTM zone 25N,,,,36deg West to 30deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16025,1995-06-02 00:00:00,,EPSG,,
+32426,WGS 72BE / UTM zone 26N,,,,30deg West to 24deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16026,1995-06-02 00:00:00,,EPSG,,
+32427,WGS 72BE / UTM zone 27N,,,,24deg West to 18deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16027,1995-06-02 00:00:00,,EPSG,,
+32428,WGS 72BE / UTM zone 28N,,,,18deg West to 12deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16028,1995-06-02 00:00:00,,EPSG,,
+32429,WGS 72BE / UTM zone 29N,,,,12deg West to 6deg West; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16029,1995-06-02 00:00:00,,EPSG,,
+32430,WGS 72BE / UTM zone 30N,,,,6deg West to 0deg; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16030,1995-06-02 00:00:00,,EPSG,,
+32431,WGS 72BE / UTM zone 31N,,,,0deg to 6deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16031,1995-06-02 00:00:00,,EPSG,,
+32432,WGS 72BE / UTM zone 32N,,,,6deg East to 12deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16032,1995-06-02 00:00:00,,EPSG,,
+32433,WGS 72BE / UTM zone 33N,,,,12deg East to 18deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16033,1995-06-02 00:00:00,,EPSG,,
+32434,WGS 72BE / UTM zone 34N,,,,18deg East to 24deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16034,1995-06-02 00:00:00,,EPSG,,
+32435,WGS 72BE / UTM zone 35N,,,,24deg East to 30deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16035,1995-06-02 00:00:00,,EPSG,,
+32436,WGS 72BE / UTM zone 36N,,,,30deg East to 36deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16036,1995-06-02 00:00:00,,EPSG,,
+32437,WGS 72BE / UTM zone 37N,,,,36deg East to 42deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16037,1995-06-02 00:00:00,,EPSG,,
+32438,WGS 72BE / UTM zone 38N,,,,42deg East to 48deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16038,1995-06-02 00:00:00,,EPSG,,
+32439,WGS 72BE / UTM zone 39N,,,,48deg East to 54deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16039,1995-06-02 00:00:00,,EPSG,,
+32440,WGS 72BE / UTM zone 40N,,,,54deg East to 60deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16040,1995-06-02 00:00:00,,EPSG,,
+32441,WGS 72BE / UTM zone 41N,,,,60deg East to 66deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16041,1995-06-02 00:00:00,,EPSG,,
+32442,WGS 72BE / UTM zone 42N,,,,66deg East to 72deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16042,1995-06-02 00:00:00,,EPSG,,
+32443,WGS 72BE / UTM zone 43N,,,,72deg East to 78deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16043,1995-06-02 00:00:00,,EPSG,,
+32444,WGS 72BE / UTM zone 44N,,,,78deg East to 84deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16044,1995-06-02 00:00:00,,EPSG,,
+32445,WGS 72BE / UTM zone 45N,,,,84deg East to 90deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16045,1995-06-02 00:00:00,,EPSG,,
+32446,WGS 72BE / UTM zone 46N,,,,90deg East to 96deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16046,1995-06-02 00:00:00,,EPSG,,
+32447,WGS 72BE / UTM zone 47N,,,,96deg East to 102eg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16047,1995-06-02 00:00:00,,EPSG,,
+32448,WGS 72BE / UTM zone 48N,,,,102deg East to 108deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16048,1995-06-02 00:00:00,,EPSG,,
+32449,WGS 72BE / UTM zone 49N,,,,108deg East to 114deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16049,1995-06-02 00:00:00,,EPSG,,
+32450,WGS 72BE / UTM zone 50N,,,,114deg East to 120deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16050,1995-06-02 00:00:00,,EPSG,,
+32451,WGS 72BE / UTM zone 51N,,,,120deg East to 126deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16051,1995-06-02 00:00:00,,EPSG,,
+32452,WGS 72BE / UTM zone 52N,,,,126deg East to 132deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16052,1995-06-02 00:00:00,,EPSG,,
+32453,WGS 72BE / UTM zone 53N,,,,132deg East to 138deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16053,1995-06-02 00:00:00,,EPSG,,
+32454,WGS 72BE / UTM zone 54N,,,,138deg East to 144deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16054,1995-06-02 00:00:00,,EPSG,,
+32455,WGS 72BE / UTM zone 55N,,,,144deg East to 150deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16055,1995-06-02 00:00:00,,EPSG,,
+32456,WGS 72BE / UTM zone 56N,,,,150deg East to 156deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16056,1995-06-02 00:00:00,,EPSG,,
+32457,WGS 72BE / UTM zone 57N,,,,156deg East to 162deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16057,1995-06-02 00:00:00,,EPSG,,
+32458,WGS 72BE / UTM zone 58N,,,,162deg East to 168deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16058,1995-06-02 00:00:00,,EPSG,,
+32459,WGS 72BE / UTM zone 59N,,,,168deg East to 174deg East; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16059,1995-06-02 00:00:00,,EPSG,,
+32460,WGS 72BE / UTM zone 60N,,,,174deg East to 180deg; northern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16060,1995-06-02 00:00:00,,EPSG,,
+32501,WGS 72BE / UTM zone 1S,,,,180deg to 174deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16101,1995-06-02 00:00:00,,EPSG,,
+32502,WGS 72BE / UTM zone 2S,,,,174deg West to 168deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16102,1995-06-02 00:00:00,,EPSG,,
+32503,WGS 72BE / UTM zone 3S,,,,168deg West to 162deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16103,1995-06-02 00:00:00,,EPSG,,
+32504,WGS 72BE / UTM zone 4S,,,,162deg West to 156deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16104,1995-06-02 00:00:00,,EPSG,,
+32505,WGS 72BE / UTM zone 5S,,,,156deg West to 150deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16105,1995-06-02 00:00:00,,EPSG,,
+32506,WGS 72BE / UTM zone 6S,,,,150deg West to 144deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16106,1995-06-02 00:00:00,,EPSG,,
+32507,WGS 72BE / UTM zone 7S,,,,144deg West to 138deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16107,1995-06-02 00:00:00,,EPSG,,
+32508,WGS 72BE / UTM zone 8S,,,,138deg West to 132deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16108,1995-06-02 00:00:00,,EPSG,,
+32509,WGS 72BE / UTM zone 9S,,,,132deg West to 126deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16109,1995-06-02 00:00:00,,EPSG,,
+32510,WGS 72BE / UTM zone 10S,,,,130deg West to 120deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16110,1995-06-02 00:00:00,,EPSG,,
+32511,WGS 72BE / UTM zone 11S,,,,120deg West to 114deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16111,1995-06-02 00:00:00,,EPSG,,
+32512,WGS 72BE / UTM zone 12S,,,,114deg West to 108deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16112,1995-06-02 00:00:00,,EPSG,,
+32513,WGS 72BE / UTM zone 13S,,,,108deg West to 102deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16113,1995-06-02 00:00:00,,EPSG,,
+32514,WGS 72BE / UTM zone 14S,,,,102deg West to 96deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16114,1995-06-02 00:00:00,,EPSG,,
+32515,WGS 72BE / UTM zone 15S,,,,96deg West to 90deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16115,1995-06-02 00:00:00,,EPSG,,
+32516,WGS 72BE / UTM zone 16S,,,,90deg West to 84deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16116,1995-06-02 00:00:00,,EPSG,,
+32517,WGS 72BE / UTM zone 17S,,,,84deg West to 78deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16117,1995-06-02 00:00:00,,EPSG,,
+32518,WGS 72BE / UTM zone 18S,,,,78deg West to 72deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16118,1995-06-02 00:00:00,,EPSG,,
+32519,WGS 72BE / UTM zone 19S,,,,72deg West to 66deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16119,1995-06-02 00:00:00,,EPSG,,
+32520,WGS 72BE / UTM zone 20S,,,,66deg West to 60deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16120,1995-06-02 00:00:00,,EPSG,,
+32521,WGS 72BE / UTM zone 21S,,,,60deg West to 54deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16121,1995-06-02 00:00:00,,EPSG,,
+32522,WGS 72BE / UTM zone 22S,,,,54deg West to 48deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16122,1995-06-02 00:00:00,,EPSG,,
+32523,WGS 72BE / UTM zone 23S,,,,48deg West to 42deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16123,1995-06-02 00:00:00,,EPSG,,
+32524,WGS 72BE / UTM zone 24S,,,,42deg West to 36deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16124,1995-06-02 00:00:00,,EPSG,,
+32525,WGS 72BE / UTM zone 25S,,,,36deg West to 30deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16125,1995-06-02 00:00:00,,EPSG,,
+32526,WGS 72BE / UTM zone 26S,,,,30deg West to 24deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16126,1995-06-02 00:00:00,,EPSG,,
+32527,WGS 72BE / UTM zone 27S,,,,24deg West to 18deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16127,1995-06-02 00:00:00,,EPSG,,
+32528,WGS 72BE / UTM zone 28S,,,,18deg West to 12deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16128,1995-06-02 00:00:00,,EPSG,,
+32529,WGS 72BE / UTM zone 29S,,,,12deg West to 6deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16129,1995-06-02 00:00:00,,EPSG,,
+32530,WGS 72BE / UTM zone 30S,,,,6deg West to 0deg; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16130,1995-06-02 00:00:00,,EPSG,,
+32531,WGS 72BE / UTM zone 31S,,,,0deg to 6deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16131,1995-06-02 00:00:00,,EPSG,,
+32532,WGS 72BE / UTM zone 32S,,,,6deg East to 12deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16132,1995-06-02 00:00:00,,EPSG,,
+32533,WGS 72BE / UTM zone 33S,,,,12deg East to 18deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16133,1995-06-02 00:00:00,,EPSG,,
+32534,WGS 72BE / UTM zone 34S,,,,18deg East to 24deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16134,1995-06-02 00:00:00,,EPSG,,
+32535,WGS 72BE / UTM zone 35S,,,,24deg East to 30deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16135,1995-06-02 00:00:00,,EPSG,,
+32536,WGS 72BE / UTM zone 36S,,,,30deg East to 36deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16136,1995-06-02 00:00:00,,EPSG,,
+32537,WGS 72BE / UTM zone 37S,,,,36deg East to 42deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16137,1995-06-02 00:00:00,,EPSG,,
+32538,WGS 72BE / UTM zone 38S,,,,42deg East to 48deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16138,1995-06-02 00:00:00,,EPSG,,
+32539,WGS 72BE / UTM zone 39S,,,,48deg East to 54deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16139,1995-06-02 00:00:00,,EPSG,,
+32540,WGS 72BE / UTM zone 40S,,,,54deg East to 60deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16140,1995-06-02 00:00:00,,EPSG,,
+32541,WGS 72BE / UTM zone 41S,,,,60deg East to 66deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16141,1995-06-02 00:00:00,,EPSG,,
+32542,WGS 72BE / UTM zone 42S,,,,66deg East to 72deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16142,1995-06-02 00:00:00,,EPSG,,
+32543,WGS 72BE / UTM zone 43S,,,,72deg East to 78deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16143,1995-06-02 00:00:00,,EPSG,,
+32544,WGS 72BE / UTM zone 44S,,,,78deg East to 84deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16144,1995-06-02 00:00:00,,EPSG,,
+32545,WGS 72BE / UTM zone 45S,,,,84deg East to 90deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16145,1995-06-02 00:00:00,,EPSG,,
+32546,WGS 72BE / UTM zone 46S,,,,90deg East to 96deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16146,1995-06-02 00:00:00,,EPSG,,
+32547,WGS 72BE / UTM zone 47S,,,,96deg East to 102eg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16147,1995-06-02 00:00:00,,EPSG,,
+32548,WGS 72BE / UTM zone 48S,,,,102deg East to 108deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16148,1995-06-02 00:00:00,,EPSG,,
+32549,WGS 72BE / UTM zone 49S,,,,108deg East to 114deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16149,1995-06-02 00:00:00,,EPSG,,
+32550,WGS 72BE / UTM zone 50S,,,,114deg East to 120deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16150,1995-06-02 00:00:00,,EPSG,,
+32551,WGS 72BE / UTM zone 51S,,,,120deg East to 126deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16151,1995-06-02 00:00:00,,EPSG,,
+32552,WGS 72BE / UTM zone 52S,,,,126deg East to 132deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16152,1995-06-02 00:00:00,,EPSG,,
+32553,WGS 72BE / UTM zone 53S,,,,132deg East to 138deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16153,1995-06-02 00:00:00,,EPSG,,
+32554,WGS 72BE / UTM zone 54S,,,,138deg East to 144deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16154,1995-06-02 00:00:00,,EPSG,,
+32555,WGS 72BE / UTM zone 55S,,,,144deg East to 150deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16155,1995-06-02 00:00:00,,EPSG,,
+32556,WGS 72BE / UTM zone 56S,,,,150deg East to 156deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16156,1995-06-02 00:00:00,,EPSG,,
+32557,WGS 72BE / UTM zone 57S,,,,156deg East to 162deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16157,1995-06-02 00:00:00,,EPSG,,
+32558,WGS 72BE / UTM zone 58S,,,,162deg East to 168deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16158,1995-06-02 00:00:00,,EPSG,,
+32559,WGS 72BE / UTM zone 59S,,,,168deg East to 174deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16159,1995-06-02 00:00:00,,EPSG,,
+32560,WGS 72BE / UTM zone 60S,,,,174deg East to 180deg; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4324,16160,1995-06-02 00:00:00,,EPSG,,
+32601,WGS 84 / UTM zone 1N,,,,180deg to 174deg West; northern hemisphere; Russia.,projected 2D,,,East,North,E,N,9001,,4326,16001,1995-06-02 00:00:00,,EPSG,,
+32602,WGS 84 / UTM zone 2N,,,,174deg West to 168deg West; northern hemisphere. Russia; United States (USA) - Alaska (AK).,projected 2D,,,East,North,E,N,9001,,4326,16002,1995-06-02 00:00:00,,EPSG,,
+32603,WGS 84 / UTM zone 3N,,,,168deg West to 162deg West; northern hemisphere. United States (USA) - Alaska (AK).,projected 2D,,,East,North,E,N,9001,,4326,16003,1995-06-02 00:00:00,,EPSG,,
+32604,WGS 84 / UTM zone 4N,,,,162deg West to 156deg West; northern hemisphere. United States (USA) - Alaska (AK).,projected 2D,,,East,North,E,N,9001,,4326,16004,1995-06-02 00:00:00,,EPSG,,
+32605,WGS 84 / UTM zone 5N,,,,156deg West to 150deg West; northern hemisphere. United States (USA) - Alaska (AK).,projected 2D,,,East,North,E,N,9001,,4326,16005,1995-06-02 00:00:00,,EPSG,,
+32606,WGS 84 / UTM zone 6N,,,,150deg West to 144deg West; northern hemisphere. United States (USA) - Alaska (AK).,projected 2D,,,East,North,E,N,9001,,4326,16006,1995-06-02 00:00:00,,EPSG,,
+32607,WGS 84 / UTM zone 7N,,,,144deg West to 138deg West; northern hemisphere. Canada - British Columbia (BC); Yukon. United States (USA) - Alaska (AK).,projected 2D,,,East,North,E,N,9001,,4326,16007,1995-06-02 00:00:00,,EPSG,,
+32608,WGS 84 / UTM zone 8N,,,,138deg West to 132deg West; northern hemisphere. Canada - British Columbia (BC); North West Territiories; Yukon. United States (USA) - Alaska (AK).,projected 2D,,,East,North,E,N,9001,,4326,16008,1995-06-02 00:00:00,,EPSG,,
+32609,WGS 84 / UTM zone 9N,,,,132deg West to 126deg West; northern hemisphere. Canada - British Columbia (BC); North West Territories; Yukon. United States (USA) - Alaska (AK).,projected 2D,,,East,North,E,N,9001,,4326,16009,1995-06-02 00:00:00,,EPSG,,
+32610,WGS 84 / UTM zone 10N,,,,130deg West to 120deg West; northern hemisphere. Canada - British Columbia (BC); North West Territories; Nunavut; Yukon. United States (USA) - Alaska (AK).,projected 2D,,,East,North,E,N,9001,,4326,16010,1995-06-02 00:00:00,,EPSG,,
+32611,WGS 84 / UTM zone 11N,,,,120deg West to 114deg West; northern hemisphere. Canada - Alberta; British Columbia (BC); North West Territories; Nunavut. Mexico. United States (USA).,projected 2D,,,East,North,E,N,9001,,4326,16011,1995-06-02 00:00:00,,EPSG,,
+32612,WGS 84 / UTM zone 12N,,,,114deg West to 108deg West; northern hemisphere. Canada - Alberta; North West Territories; Nunavut; Saskatchewan.  Mexico.  United States (USA).,projected 2D,,,East,North,E,N,9001,,4326,16012,1995-06-02 00:00:00,,EPSG,,
+32613,WGS 84 / UTM zone 13N,,,,108deg West to 102deg West; northern hemisphere. Canada - North West Territories; Nunavut; Saskatchewan.  Mexico.  United States (USA).,projected 2D,,,East,North,E,N,9001,,4326,16013,1995-06-02 00:00:00,,EPSG,,
+32614,WGS 84 / UTM zone 14N,,,,102deg West to 96deg West; northern hemisphere. Canada - Manitoba; Nunavut; Saskatchewan.  Mexico.  United States (USA).,projected 2D,,,East,North,E,N,9001,,4326,16014,1995-06-02 00:00:00,,EPSG,,
+32615,WGS 84 / UTM zone 15N,,,,96deg West to 90deg West; northern hemisphere. Canada - Manitoba; Nunavut; Ontario.  Guatemala.  Mexico.  United States (USA) - Gulf of Mexico (GoM).,projected 2D,,,East,North,E,N,9001,,4326,16015,1995-06-02 00:00:00,,EPSG,,
+32616,WGS 84 / UTM zone 16N,,,,90deg West to 84deg West; northern hemisphere. Belize. Canada - Manitoba; Nunavut; Ontario.  Costa Rica. Cuba. El Salvador. Guatemala. Honduras. Mexico. Nicaragua. Puerto Rico. United States (USA).,projected 2D,,,East,North,E,N,9001,,4326,16016,1995-06-02 00:00:00,,EPSG,,
+32617,WGS 84 / UTM zone 17N,,,,84deg West to 78deg West; northern hemisphere. Bahamas. Ecuador - north of equator. Canada - Nunavut; Ontario; Quebec.  Cayman Islands.  Colombia. Costa Rica. Jamaica. Nicaragua. Panama. Puerto Rico. United States (USA).,projected 2D,,,East,North,E,N,9001,,4326,16017,1995-06-02 00:00:00,,EPSG,,
+32618,WGS 84 / UTM zone 18N,,,,78deg West to 72deg West; northern hemisphere. Bahamas. Canada - Nunavut; Ontario; Quebec. Colombia. Cuba. Ecuador. Greenland. Haiti. Jamica. Panama. Turks and Caicos Islands. United States (USA). Venezuela.,projected 2D,,,East,North,E,N,9001,,4326,16018,1995-06-02 00:00:00,,EPSG,,
+32619,WGS 84 / UTM zone 19N,,,,72deg West to 66deg West; northern hemisphere. Aruba. Bahamas. Brazil. Canada - New Brunswick (NB); Newfoundland; Nunavut; Nova Scotia (NS); Quebec. Colombia. Dominican Republic. Greenland. Netherlands Antilles. Puerto Rico. Turks and Caicos Islands. United States. Venezuela.,projected 2D,,,East,North,E,N,9001,,4326,16019,1995-06-02 00:00:00,,EPSG,,
+32620,WGS 84 / UTM zone 20N,,,,66deg West to 60deg West; northern hemisphere. Anguilla. Antigua & Barbuda. Bermuda. Brazil. Canada - New Brunswick (NB); Newfoundland; North west Territories; Nova Scotia (NS); Prince Edward Island; Quebec. Dominica. Greenland. Grenada. Guadeloupe. Guyana. Martinique. Montserrat. Saint Kitts and Nevis. Saint Lucia. Saint Vncent and the Grenadines. Trinidad and Tobago. Venezuela. Virgin islands.,projected 2D,,,East,North,E,N,9001,,4326,16020,1995-06-02 00:0 [...]
+32621,WGS 84 / UTM zone 21N,,,,60deg West to 54deg West; northern hemisphere. Barbados. Brazil. Canada - Newfoundland; Quebec. French Guiana. Greenland. Guyana. St. Pierre and Miquelon. Suriname.,projected 2D,,,East,North,E,N,9001,,4326,16021,1995-06-02 00:00:00,,EPSG,,
+32622,WGS 84 / UTM zone 22N,,,,54deg West to 48deg West; northern hemisphere. Brazil. Canada - Newfoundland. French Guiana. Greenland.,projected 2D,,,East,North,E,N,9001,,4326,16022,1995-06-02 00:00:00,,EPSG,,
+32623,WGS 84 / UTM zone 23N,,,,48deg West to 42deg West; northern hemisphere. Greenland.,projected 2D,,,East,North,E,N,9001,,4326,16023,1995-06-02 00:00:00,,EPSG,,
+32624,WGS 84 / UTM zone 24N,,,,42deg West to 36deg West; northern hemisphere. Greenland.,projected 2D,,,East,North,E,N,9001,,4326,16024,1995-06-02 00:00:00,,EPSG,,
+32625,WGS 84 / UTM zone 25N,,,,36deg West to 30deg West; northern hemisphere. Greenland.,projected 2D,,,East,North,E,N,9001,,4326,16025,1995-06-02 00:00:00,,EPSG,,
+32626,WGS 84 / UTM zone 26N,,,,30deg West to 24deg West; northern hemisphere. Greenland. Iceland.,projected 2D,,,East,North,E,N,9001,,4326,16026,1995-06-02 00:00:00,,EPSG,,
+32627,WGS 84 / UTM zone 27N,,,,24deg West to 18deg West; northern hemisphere. Greenland. Iceland.,projected 2D,,,East,North,E,N,9001,,4326,16027,1995-06-02 00:00:00,,EPSG,,
+32628,WGS 84 / UTM zone 28N,,,,18deg West to 12deg West; northern hemisphere. Gambia. Greenland. Guinea. Guinea-Bissau. Iceland. Ireland - offshore Porcupine Basin. Mauritania. Morocco. Senegal. Sierra Leone. Western Sahara.,projected 2D,,,East,North,E,N,9001,,4326,16028,1995-06-02 00:00:00,,EPSG,,
+32629,WGS 84 / UTM zone 29N,,,,12deg West to 6deg West; northern hemisphere. Algeria. Cote D'Ivoire (Ivory Coast). Faroe Islands. Guinea. Ireland. Mali. Mauritania. Morocco. Portugal. Sierra Leone. Spain. United Kingdom (UK). Western Sahara.,projected 2D,,,East,North,E,N,9001,,4326,16029,1995-06-02 00:00:00,,EPSG,,
+32630,WGS 84 / UTM zone 30N,,,,6deg West to 0deg; northern hemisphere. Algeria. Burkino Faso. Cote' Ivoire (Ivory Coast). Faroe Islands - offshore. France. Ghana. Gibraltar. Ireland - offshore Irish Sea. Mali. Mauritania. Morocco. Spain. United Kingdom (UK).,projected 2D,,,East,North,E,N,9001,,4326,16030,1995-06-02 00:00:00,,EPSG,,
+32631,WGS 84 / UTM zone 31N,,,,0deg to 6deg East; northern hemisphere. Algeria. Andorra. Benin. Bukino Faso. Denmark - North Sea. France. Germany - North Sea. Ghana. Luxembourg. Mali. Netherlands. Niger. Nigeria. Norway. Spain. Togo. United Kingdom (UK) - North Sea.,projected 2D,,,East,North,E,N,9001,,4326,16031,1995-06-02 00:00:00,,EPSG,,
+32632,WGS 84 / UTM zone 32N,,,,6deg East to 12deg East; northern hemisphere. Algeria. Austria. Cameroon. Denmark. Equatorial Guinea. France. Gabon. Germany. Italy. Libya. Liechtenstein. Monaco. Netherlands. Niger. Nigeria. Norway. Sao Tome and Principe. Svalbard and Jan Mayen Islands. Sweden. Switzerland. Tunisia. Vatican City State.,projected 2D,,,East,North,E,N,9001,,4326,16032,1995-06-02 00:00:00,,EPSG,,
+32633,WGS 84 / UTM zone 33N,,,,12deg East to 18deg East; northern hemisphere. Austria. Bosnia and Herzegowina. Cmeroon. Central African Republic. Chad. Congo. Croatia. Czech Republic. Democratic Republic of the Congo (Zaire). Gabon. Germany. Hungary. Italy. Libya. Malta. Niger. Nigeria. Norway. Poland. San Marino. Slovakia. Slovenia. Svalbard and Jan Mayen Islands. Sweden.,projected 2D,,,East,North,E,N,9001,,4326,16033,1995-06-02 00:00:00,,EPSG,,
+32634,WGS 84 / UTM zone 34N,,,,18deg East to 24deg East; northern hemisphere. Albania. Belarus. Bosnia and Herzegowina. Bulgaria. Central African Republic. Chad. Croatia. Democratic Republic of the Congo (Zaire). Estonia. Finland. FYR Macedonia. Greece. Hungary. Italy. Latvia. Libya. Lithuania. Norway. Poland. Romania. Russia. Slovakia. Sudan. Svalbard. Sweden. Ukraine. Yugoslavia.,projected 2D,,,East,North,E,N,9001,,4326,16034,1995-06-02 00:00:00,,EPSG,,
+32635,WGS 84 / UTM zone 35N,,,,24deg East to 30deg East; northern hemisphere. Belarus. Bulgaria. Central African Republic. Democratic Republic of the Congo (Zaire). Egypt. Estonia. Finland. Greece. Latvia. Lesotho. Libya. Lithuania. Moldova. Norway. Romania. Russia. Sudan. Svalbard. Turkey. Uganda. Ukraine.,projected 2D,,,East,North,E,N,9001,,4326,16035,1995-06-02 00:00:00,,EPSG,,
+32636,WGS 84 / UTM zone 36N,,,,30deg East to 36deg East; northern hemisphere. Belarus. Cyprus. Egypt. Ethiopia. Finland. Israel. Jordan. Kenya. Lebanon. Norway. Russia. Saudi Arabia. Sudan. Syria. Turkey. Uganda. Ukraine.,projected 2D,,,East,North,E,N,9001,,4326,16036,1995-06-02 00:00:00,,EPSG,,
+32637,WGS 84 / UTM zone 37N,,,,36deg East to 42deg East; northern hemisphere. Djibouti. Egypt. Eritrea. Ethiopia. Georgia. Iraq. Jordan. Kenya. Lebanon. Russia. Saudi Arabia. Somalia. Sudan. Syria. Turkey. Ukraine.,projected 2D,,,East,North,E,N,9001,,4326,16037,1995-06-02 00:00:00,,EPSG,,
+32638,WGS 84 / UTM zone 38N,,,,42deg East to 48deg East; northern hemisphere. Armenia. Azerbaijan. Djibouti. Eritrea. Ethiopia. Georgia. Iran. Iraq. Kazakhstan. Kuwait. Russia. Saudi Arabia. Somalia. Turkey. Yemen.,projected 2D,,,East,North,E,N,9001,,4326,16038,1995-06-02 00:00:00,,EPSG,,
+32639,WGS 84 / UTM zone 39N,,,,48deg East to 54deg East; northern hemisphere. Azerbaijan. Bahrain. Iran. Kazakhstan. Kuwait. Oman. Qatar. Russia. Saudi Arabia. Somalia. Turkmenistan. United Arab Emirates. Yemen.,projected 2D,,,East,North,E,N,9001,,4326,16039,1995-06-02 00:00:00,,EPSG,,
+32640,WGS 84 / UTM zone 40N,,,,54deg East to 60deg East; northern hemisphere. Iran. Kazakhstan. Oman. Russia. Saudi Arabia. Turkmenistan. United Arab Emirates. Uzbekistan.,projected 2D,,,East,North,E,N,9001,,4326,16040,1995-06-02 00:00:00,,EPSG,,
+32641,WGS 84 / UTM zone 41N,,,,60deg East to 66deg East; northern hemisphere. Afghanistan. Iran. Kazakhstan. Pakistan. Russia. Turkmenistan.  Uzbekistan.,projected 2D,,,East,North,E,N,9001,,4326,16041,1995-06-02 00:00:00,,EPSG,,
+32642,WGS 84 / UTM zone 42N,,,,66deg East to 72deg East; northern hemisphere. Afghanistan. India. Kazakhstan. Kyrgyzstan. Pakistan. Russia. Tajikistan. Uzbekistan.,projected 2D,,,East,North,E,N,9001,,4326,16042,1995-06-02 00:00:00,,EPSG,,
+32643,WGS 84 / UTM zone 43N,,,,72deg East to 78deg East; northern hemisphere. China. India. Kazakhstan. Kyrgyzstan. Maldives. Pakistan. Russia. Tajikistan.,projected 2D,,,East,North,E,N,9001,,4326,16043,1995-06-02 00:00:00,,EPSG,,
+32644,WGS 84 / UTM zone 44N,,,,78deg East to 84deg East; northern hemisphere. China. India. Kazakhstan. Kyrgyzstan. Nepal. Russia. Sri Lanka.,projected 2D,,,East,North,E,N,9001,,4326,16044,1995-06-02 00:00:00,,EPSG,,
+32645,WGS 84 / UTM zone 45N,,,,84deg East to 90deg East; northern hemisphere. Bangladesh. Bhutan. China. India. Kazakhstan. Mongolia. Nepal. Russia.,projected 2D,,,East,North,E,N,9001,,4326,16045,1995-06-02 00:00:00,,EPSG,,
+32646,WGS 84 / UTM zone 46N,,,,90deg East to 96deg East; northern hemisphere. Bangladesh. Bhutan. China. Indonesia. Mongolia. Myanmar (Burma). Russia.,projected 2D,,,East,North,E,N,9001,,4326,16046,1995-06-02 00:00:00,,EPSG,,
+32647,WGS 84 / UTM zone 47N,,,,96deg East to 102eg East; northern hemisphere. China. Indonesia. Laos. Malaysia - West Malaysia. Mongolia. Myanmar (Burma). Russia. Thailand.,projected 2D,,,East,North,E,N,9001,,4326,16047,1995-06-02 00:00:00,,EPSG,,
+32648,WGS 84 / UTM zone 48N,,,,102deg East to 108deg East; northern hemisphere. Cambodia. China. Indonesia. Laos. Malaysia - West Malaysia. Mongolia. Russia. Singapore. Thailand. Vietnam.,projected 2D,,,East,North,E,N,9001,,4326,16048,1995-06-02 00:00:00,,EPSG,,
+32649,WGS 84 / UTM zone 49N,,,,108deg East to 114deg East; northern hemisphere. China. Hong Kong. Indonesia. Macau. Malaysia - East Malaysia - Sarawak. Mongolia. Russia. Vietnam.,projected 2D,,,East,North,E,N,9001,,4326,16049,1995-06-02 00:00:00,,EPSG,,
+32650,WGS 84 / UTM zone 50N,,,,114deg East to 120deg East; northern hemisphere. Brunei. China. Indonesia. Malaysia - East Malaysia - Sarawak. Mongolia. Philippines. Russia. Taiwan.,projected 2D,,,East,North,E,N,9001,,4326,16050,1995-06-02 00:00:00,,EPSG,,
+32651,WGS 84 / UTM zone 51N,,,,120deg East to 126deg East; northern hemisphere. China. Indonesia. Japan. North Korea. Philippines. Russia.  South Korea. Taiwan.,projected 2D,,,East,North,E,N,9001,,4326,16051,1995-06-02 00:00:00,,EPSG,,
+32652,WGS 84 / UTM zone 52N,,,,126deg East to 132deg East; northern hemisphere. China. Indonesia. Japan. North Korea. Russia. South Korea.,projected 2D,,,East,North,E,N,9001,,4326,16052,1995-06-02 00:00:00,,EPSG,,
+32653,WGS 84 / UTM zone 53N,,,,132deg East to 138deg East; northern hemisphere. China. Japan. Russia.,projected 2D,,,East,North,E,N,9001,,4326,16053,1995-06-02 00:00:00,,EPSG,,
+32654,WGS 84 / UTM zone 54N,,,,138deg East to 144deg East; northern hemisphere. Japan. Russia.,projected 2D,,,East,North,E,N,9001,,4326,16054,1995-06-02 00:00:00,,EPSG,,
+32655,WGS 84 / UTM zone 55N,,,,144deg East to 150deg East; northern hemisphere. Japan. Russia.,projected 2D,,,East,North,E,N,9001,,4326,16055,1995-06-02 00:00:00,,EPSG,,
+32656,WGS 84 / UTM zone 56N,,,,150deg East to 156deg East; northern hemisphere. Russia.,projected 2D,,,East,North,E,N,9001,,4326,16056,1995-06-02 00:00:00,,EPSG,,
+32657,WGS 84 / UTM zone 57N,,,,156deg East to 162deg East; northern hemisphere. Russia.,projected 2D,,,East,North,E,N,9001,,4326,16057,1995-06-02 00:00:00,,EPSG,,
+32658,WGS 84 / UTM zone 58N,,,,162deg East to 168deg East; northern hemisphere. Russia.,projected 2D,,,East,North,E,N,9001,,4326,16058,1995-06-02 00:00:00,,EPSG,,
+32659,WGS 84 / UTM zone 59N,,,,168deg East to 174deg East; northern hemisphere. Russia.,projected 2D,,,East,North,E,N,9001,,4326,16059,1995-06-02 00:00:00,,EPSG,,
+32660,WGS 84 / UTM zone 60N,,,,174deg East to 180deg; northern hemisphere. Russia.,projected 2D,,,East,North,E,N,9001,,4326,16060,1995-06-02 00:00:00,,EPSG,,
+32661,WGS 84 / UPS North,,,,Polar areas north of 84 deg N.,projected 2D,,,East,North,E,N,9001,,4326,16061,1996-09-12 00:00:00,,EPSG,,
+32701,WGS 84 / UTM zone 1S,,,,180deg to 174deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16101,1995-06-02 00:00:00,,EPSG,,
+32702,WGS 84 / UTM zone 2S,,,,174deg West to 168deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16102,1995-06-02 00:00:00,,EPSG,,
+32703,WGS 84 / UTM zone 3S,,,,168deg West to 162deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16103,1995-06-02 00:00:00,,EPSG,,
+32704,WGS 84 / UTM zone 4S,,,,162deg West to 156deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16104,1995-06-02 00:00:00,,EPSG,,
+32705,WGS 84 / UTM zone 5S,,,,156deg West to 150deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16105,1995-06-02 00:00:00,,EPSG,,
+32706,WGS 84 / UTM zone 6S,,,,150deg West to 144deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16106,1995-06-02 00:00:00,,EPSG,,
+32707,WGS 84 / UTM zone 7S,,,,144deg West to 138deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16107,1995-06-02 00:00:00,,EPSG,,
+32708,WGS 84 / UTM zone 8S,,,,138deg West to 132deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16108,1995-06-02 00:00:00,,EPSG,,
+32709,WGS 84 / UTM zone 9S,,,,132deg West to 126deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16109,1995-06-02 00:00:00,,EPSG,,
+32710,WGS 84 / UTM zone 10S,,,,130deg West to 120deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16110,1995-06-02 00:00:00,,EPSG,,
+32711,WGS 84 / UTM zone 11S,,,,120deg West to 114deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16111,1995-06-02 00:00:00,,EPSG,,
+32712,WGS 84 / UTM zone 12S,,,,114deg West to 108deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16112,1995-06-02 00:00:00,,EPSG,,
+32713,WGS 84 / UTM zone 13S,,,,108deg West to 102deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16113,1995-06-02 00:00:00,,EPSG,,
+32714,WGS 84 / UTM zone 14S,,,,102deg West to 96deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16114,1995-06-02 00:00:00,,EPSG,,
+32715,WGS 84 / UTM zone 15S,,,,96deg West to 90deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16115,1995-06-02 00:00:00,,EPSG,,
+32716,WGS 84 / UTM zone 16S,,,,90deg West to 84deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16116,1995-06-02 00:00:00,,EPSG,,
+32717,WGS 84 / UTM zone 17S,,,,84deg West to 78deg West; southern hemisphere. Ecuador. Peru.,projected 2D,,,East,North,E,N,9001,,4326,16117,1995-06-02 00:00:00,,EPSG,,
+32718,WGS 84 / UTM zone 18S,,,,78deg West to 72deg West; southern hemisphere. Argentina. Brazil. Chile. Colombia. Ecuador. Peru.,projected 2D,,,East,North,E,N,9001,,4326,16118,1995-06-02 00:00:00,,EPSG,,
+32719,WGS 84 / UTM zone 19S,,,,72deg West to 66deg West; southern hemisphere. Argentina. Bolivia. Brazil. Chile. Colombia. Peru.,projected 2D,,,East,North,E,N,9001,,4326,16119,1995-06-02 00:00:00,,EPSG,,
+32720,WGS 84 / UTM zone 20S,,,,66deg West to 60deg West; southern hemisphere. Argentina. Bolivia. Brazil. Falkland Islands (Malvinas). Paraguay.,projected 2D,,,East,North,E,N,9001,,4326,16120,1995-06-02 00:00:00,,EPSG,,
+32721,WGS 84 / UTM zone 21S,,,,60deg West to 54deg West; southern hemisphere. Argentina. Bolivia. Brazil. Falkland Islands (Malvinas). Paraguay. Uruguay.,projected 2D,,,East,North,E,N,9001,,4326,16121,1995-06-02 00:00:00,,EPSG,,
+32722,WGS 84 / UTM zone 22S,,,,54deg West to 48deg West; southern hemisphere. Brazil.  Uruguay.,projected 2D,,,East,North,E,N,9001,,4326,16122,1995-06-02 00:00:00,,EPSG,,
+32723,WGS 84 / UTM zone 23S,,,,48deg West to 42deg West; southern hemisphere. Brazil.,projected 2D,,,East,North,E,N,9001,,4326,16123,1995-06-02 00:00:00,,EPSG,,
+32724,WGS 84 / UTM zone 24S,,,,42deg West to 36deg West; southern hemisphere. Brazil. South Georgia and the South Sandwich Islands.,projected 2D,,,East,North,E,N,9001,,4326,16124,1995-06-02 00:00:00,,EPSG,,
+32725,WGS 84 / UTM zone 25S,,,,36deg West to 30deg West; southern hemisphere. Brazil.,projected 2D,,,East,North,E,N,9001,,4326,16125,1995-06-02 00:00:00,,EPSG,,
+32726,WGS 84 / UTM zone 26S,,,,30deg West to 24deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16126,1995-06-02 00:00:00,,EPSG,,
+32727,WGS 84 / UTM zone 27S,,,,24deg West to 18deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16127,1995-06-02 00:00:00,,EPSG,,
+32728,WGS 84 / UTM zone 28S,,,,18deg West to 12deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16128,1995-06-02 00:00:00,,EPSG,,
+32729,WGS 84 / UTM zone 29S,,,,12deg West to 6deg West; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16129,1995-06-02 00:00:00,,EPSG,,
+32730,WGS 84 / UTM zone 30S,,,,6deg West to 0deg; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16130,1995-06-02 00:00:00,,EPSG,,
+32731,WGS 84 / UTM zone 31S,,,,0deg to 6deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16131,1995-06-02 00:00:00,,EPSG,,
+32732,WGS 84 / UTM zone 32S,,,,6deg East to 12deg East; southern hemisphere. Angola. Congo. Gabon. Namibia.,projected 2D,,,East,North,E,N,9001,,4326,16132,1995-06-02 00:00:00,,EPSG,,
+32733,WGS 84 / UTM zone 33S,,,,12deg East to 18deg East; southern hemisphere. Angola. Congo. Democratic Republic of the Congo (Zaire). Gabon. Namibia. South Africa.,projected 2D,,,East,North,E,N,9001,,4326,16133,1995-06-02 00:00:00,,EPSG,,
+32734,WGS 84 / UTM zone 34S,,,,18deg East to 24deg East; southern hemisphere. Angola. Botswana. Democratic Republic of the Congo (Zaire). Namibia. South Africa. Zambia.,projected 2D,,,East,North,E,N,9001,,4326,16134,1995-06-02 00:00:00,,EPSG,,
+32735,WGS 84 / UTM zone 35S,,,,24deg East to 30deg East; southern hemisphere. Botswana. Burundi. Democratic Republic of the Congo (Zaire). Rwanda. South Africa. Tanzania. Uganda. Zambia. Zimbabwe.,projected 2D,,,East,North,E,N,9001,,4326,16135,1995-06-02 00:00:00,,EPSG,,
+32736,WGS 84 / UTM zone 36S,,,,30deg East to 36deg East; southern hemisphere. Burundi. Kenya. Malawi. Mozambique. Rwanda. South Africa. Swaziland. Tanzania. Uganda. Zambia. Zimbabwe.,projected 2D,,,East,North,E,N,9001,,4326,16136,1995-06-02 00:00:00,,EPSG,,
+32737,WGS 84 / UTM zone 37S,,,,36deg East to 42deg East; southern hemisphere. Kenya. Mozambique. Tanzania.,projected 2D,,,East,North,E,N,9001,,4326,16137,1995-06-02 00:00:00,,EPSG,,
+32738,WGS 84 / UTM zone 38S,,,,42deg East to 48deg East; southern hemisphere. Madagascar.,projected 2D,,,East,North,E,N,9001,,4326,16138,1995-06-02 00:00:00,,EPSG,,
+32739,WGS 84 / UTM zone 39S,,,,48deg East to 54deg East; southern hemisphere. Madagascar.,projected 2D,,,East,North,E,N,9001,,4326,16139,1995-06-02 00:00:00,,EPSG,,
+32740,WGS 84 / UTM zone 40S,,,,54deg East to 60deg East; southern hemisphere. Seychelles.,projected 2D,,,East,North,E,N,9001,,4326,16140,1995-06-02 00:00:00,,EPSG,,
+32741,WGS 84 / UTM zone 41S,,,,60deg East to 66deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16141,1995-06-02 00:00:00,,EPSG,,
+32742,WGS 84 / UTM zone 42S,,,,66deg East to 72deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16142,1995-06-02 00:00:00,,EPSG,,
+32743,WGS 84 / UTM zone 43S,,,,72deg East to 78deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16143,1995-06-02 00:00:00,,EPSG,,
+32744,WGS 84 / UTM zone 44S,,,,78deg East to 84deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16144,1995-06-02 00:00:00,,EPSG,,
+32745,WGS 84 / UTM zone 45S,,,,84deg East to 90deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16145,1995-06-02 00:00:00,,EPSG,,
+32746,WGS 84 / UTM zone 46S,,,,90deg East to 96deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16146,1995-06-02 00:00:00,,EPSG,,
+32747,WGS 84 / UTM zone 47S,,,,96deg East to 102eg East; southern hemisphere. Indonesia.,projected 2D,,,East,North,E,N,9001,,4326,16147,1995-06-02 00:00:00,,EPSG,,
+32748,WGS 84 / UTM zone 48S,,,,102deg East to 108deg East; southern hemisphere. Indonesia.,projected 2D,,,East,North,E,N,9001,,4326,16148,1995-06-02 00:00:00,,EPSG,,
+32749,WGS 84 / UTM zone 49S,,,,108deg East to 114deg East; southern hemisphere. Australia. Indonesia.,projected 2D,,,East,North,E,N,9001,,4326,16149,1995-06-02 00:00:00,,EPSG,,
+32750,WGS 84 / UTM zone 50S,,,,114deg East to 120deg East; southern hemisphere. Australia. Indonesia.,projected 2D,,,East,North,E,N,9001,,4326,16150,1995-06-02 00:00:00,,EPSG,,
+32751,WGS 84 / UTM zone 51S,,,,120deg East to 126deg East; southern hemisphere. Australia. East Timor. Indonesia.,projected 2D,,,East,North,E,N,9001,,4326,16151,1995-06-02 00:00:00,,EPSG,,
+32752,WGS 84 / UTM zone 52S,,,,126deg East to 132deg East; southern hemisphere. Australia. East Timor. Indonesia.,projected 2D,,,East,North,E,N,9001,,4326,16152,1995-06-02 00:00:00,,EPSG,,
+32753,WGS 84 / UTM zone 53S,,,,132deg East to 138deg East; southern hemisphere. Australia.  Indonesia.,projected 2D,,,East,North,E,N,9001,,4326,16153,1995-06-02 00:00:00,,EPSG,,
+32754,WGS 84 / UTM zone 54S,,,,138deg East to 144deg East; southern hemisphere. Australia. Indonesia. Papua New Guinea.,projected 2D,,,East,North,E,N,9001,,4326,16154,1995-06-02 00:00:00,,EPSG,,
+32755,WGS 84 / UTM zone 55S,,,,144deg East to 150deg East; southern hemisphere. Australia. Papua New Guinea.,projected 2D,,,East,North,E,N,9001,,4326,16155,1995-06-02 00:00:00,,EPSG,,
+32756,WGS 84 / UTM zone 56S,,,,150deg East to 156deg East; southern hemisphere. Australia. Papua New Guinea.,projected 2D,,,East,North,E,N,9001,,4326,16156,1995-06-02 00:00:00,,EPSG,,
+32757,WGS 84 / UTM zone 57S,,,,156deg East to 162deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16157,1995-06-02 00:00:00,,EPSG,,
+32758,WGS 84 / UTM zone 58S,,,,162deg East to 168deg East; southern hemisphere.,projected 2D,,,East,North,E,N,9001,,4326,16158,1995-06-02 00:00:00,,EPSG,,
+32759,WGS 84 / UTM zone 59S,,,,168deg East to 174deg East; southern hemisphere. New Zealand.,projected 2D,,,East,North,E,N,9001,,4326,16159,1995-06-02 00:00:00,,EPSG,,
+32760,WGS 84 / UTM zone 60S,,,,174deg East to 180deg; southern hemisphere. New Zealand.,projected 2D,,,East,North,E,N,9001,,4326,16160,1995-06-02 00:00:00,,EPSG,,
+32761,WGS 84 / UPS South,,,,Polar areas south of 80 deg S.,projected 2D,,,East,North,E,N,9001,,4326,16161,1996-09-12 00:00:00,,EPSG,,
+32766,WGS 84 / TM 36 SE,,,,Mozambique - offshore.,projected 2D,,,East,North,E,N,9001,,4326,16636,1998-11-11 00:00:00,BP Mozambique,EPSG,Used by BP Mozambique for Offshore Zambezi block.,
diff --git a/src/tiff/csv/naming_system.csv b/src/tiff/csv/naming_system.csv
new file mode 100644
index 0000000..6210a16
--- /dev/null
+++ b/src/tiff/csv/naming_system.csv
@@ -0,0 +1,13 @@
+"NAMING_SYSTEM_CODE","NAMING_SYSTEM_NAME","REMARKS","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","DEPRECATED"
+7300,EPSG alternative spelling,An alternative spelling of the EPSG name; assigned by EPSG.,EPSG,EPSG,2000-05-07 00:00:00,,0
+7301,EPSG alias,An alternative name assigned by EPSG.,EPSG,EPSG,2000-05-07 00:00:00,,0
+7302,EPSG abbreviation,An abbreviation assigned by EPSG.,EPSG,EPSG,2000-05-07 00:00:00,,0
+7303,User name,An alternative name assigned by user; not populated by EPSG.,(User to insert),EPSG,2000-05-07 00:00:00,,0
+7304,User alias,A secondary alternative name assigned by user; not populated by EPSG.,(User to insert),EPSG,2000-05-07 00:00:00,,0
+7305,User abbreviation,An abbreviation assigned by user; not populated by EPSG.,(User to insert),EPSG,2000-05-07 00:00:00,,0
+7306,POSC acronym,An abbreviation assigned by the Petrotechnical Open Software Corporation (POSC).,POSC,EPSG,2000-05-07 00:00:00,,0
+7307,EuroGeographics Identifier,A unique identifier used in the compilation of European national mapping agency data by EuroGeographics.,EuroGeographics; http://crs.ifag.de/,EPSG,2001-06-05 00:00:00,,0
+7308,Croatia alternative identifier,,EPSG,EPSG,2001-06-05 00:00:00,,0
+7309,Slovenia alternative identifier,,EPSG,EPSG,2001-06-05 00:00:00,,0
+7310,Germany alternative identifier,An alternative name used by the BfK.,EPSG,EPSG,2001-06-05 00:00:00,,0
+7311,Indonesian alternative identifier,An alternative name used by Bakosurtanal.,EPSG,EPSG,2002-06-22 00:00:00,,0
diff --git a/src/tiff/csv/p_meridian.c b/src/tiff/csv/p_meridian.c
new file mode 100644
index 0000000..b6100fe
--- /dev/null
+++ b/src/tiff/csv/p_meridian.c
@@ -0,0 +1,17 @@
+#include "defs.h"
+datafile_rows_t p_meridian_row_1[] = {"PRIME_MERIDIAN_CODE","PRIME_MERID_EPSG_NAME","PRIME_MERID_USER_NAME","GREENWICH_LONGITUDE","UOM_ANGLE_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t p_meridian_row_2[] = {"8901","Greenwich","","0.0","9110","1995-06-02 00:00:00","","EPSG","","96.29",NULL};
+datafile_rows_t p_meridian_row_3[] = {"8902","Lisbon","","-9.0754862","9110","1995-06-02 00:00:00","Instituto Geografico e Cadastral; Lisbon","EPSG","","96.29",NULL};
+datafile_rows_t p_meridian_row_4[] = {"8903","Paris","","2.5969213","9105","1995-06-02 00:00:00","Institut Geographique National (IGN); Paris","EPSG","Value adopted by IGN (Paris) in 1936. Equivalent to 2 deg 20min 14.025sec. Preferred by EPSG to earlier value of 2deg 20min 13.95sec (2.596898 grads) used by RGS London.","",NULL};
+datafile_rows_t p_meridian_row_5[] = {"8904","Bogota","","-74.04513","9110","1995-06-02 00:00:00","Instituto Geografico \"Augustin Cadazzi\" (IGAC); Bogota","EPSG","","96.29",NULL};
+datafile_rows_t p_meridian_row_6[] = {"8905","Madrid","","-3.411658","9110","1995-06-02 00:00:00","","EPSG","","96.29",NULL};
+datafile_rows_t p_meridian_row_7[] = {"8906","Rome","","12.27084","9110","1995-06-02 00:00:00","","EPSG","","96.29",NULL};
+datafile_rows_t p_meridian_row_8[] = {"8907","Bern","","7.26225","9110","1995-06-02 00:00:00","Bundesamt f�r Landestopographie","EPSG","1895 value.  Newer value of 7 deg 26 min 22.335 sec E determined in 1938.","96.29",NULL};
+datafile_rows_t p_meridian_row_9[] = {"8908","Jakarta","","106.482779","9110","1995-06-02 00:00:00","","EPSG","","96.29",NULL};
+datafile_rows_t p_meridian_row_10[] = {"8909","Ferro","","-17.4","9110","1995-06-02 00:00:00","","EPSG","Used in Austria and former Czechoslovakia.","96.29",NULL};
+datafile_rows_t p_meridian_row_11[] = {"8910","Brussels","","4.220471","9110","1995-06-02 00:00:00","","EPSG","","96.29",NULL};
+datafile_rows_t p_meridian_row_12[] = {"8911","Stockholm","","18.03298","9110","1995-06-02 00:00:00","","EPSG","","96.29",NULL};
+datafile_rows_t p_meridian_row_13[] = {"8912","Athens","","23.4258815","9110","1997-06-16 00:00:00","Topography Department; National Technical University of Athens.","EPSG","Used in Greece for older mapping based on Hatt projection.","",NULL};
+datafile_rows_t p_meridian_row_14[] = {"8913","Oslo","","10.43225","9110","1999-10-20 00:00:00","Statens kartverk - Geodesi dividsion","EPSG","Formerly known as Kristiana and Christiana.","",NULL};
+
+datafile_rows_t *p_meridian_rows[] = {p_meridian_row_1,p_meridian_row_2,p_meridian_row_3,p_meridian_row_4,p_meridian_row_5,p_meridian_row_6,p_meridian_row_7,p_meridian_row_8,p_meridian_row_9,p_meridian_row_10,p_meridian_row_11,p_meridian_row_12,p_meridian_row_13,p_meridian_row_14,NULL};
diff --git a/src/tiff/csv/p_meridian.csv b/src/tiff/csv/p_meridian.csv
new file mode 100644
index 0000000..bb33ab5
--- /dev/null
+++ b/src/tiff/csv/p_meridian.csv
@@ -0,0 +1,14 @@
+"PRIME_MERIDIAN_CODE","PRIME_MERID_EPSG_NAME","PRIME_MERID_USER_NAME","GREENWICH_LONGITUDE","UOM_ANGLE_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+8901,Greenwich,,0.0,9110,1995-06-02 00:00:00,,EPSG,,96.29
+8902,Lisbon,,-9.0754862,9110,1995-06-02 00:00:00,Instituto Geografico e Cadastral; Lisbon,EPSG,,96.29
+8903,Paris,,2.5969213,9105,1995-06-02 00:00:00,Institut Geographique National (IGN); Paris,EPSG,Value adopted by IGN (Paris) in 1936. Equivalent to 2 deg 20min 14.025sec. Preferred by EPSG to earlier value of 2deg 20min 13.95sec (2.596898 grads) used by RGS London.,
+8904,Bogota,,-74.04513,9110,1995-06-02 00:00:00,"Instituto Geografico \"Augustin Cadazzi\" (IGAC); Bogota",EPSG,,96.29
+8905,Madrid,,-3.411658,9110,1995-06-02 00:00:00,,EPSG,,96.29
+8906,Rome,,12.27084,9110,1995-06-02 00:00:00,,EPSG,,96.29
+8907,Bern,,7.26225,9110,1995-06-02 00:00:00,Bundesamt f�r Landestopographie,EPSG,1895 value.  Newer value of 7 deg 26 min 22.335 sec E determined in 1938.,96.29
+8908,Jakarta,,106.482779,9110,1995-06-02 00:00:00,,EPSG,,96.29
+8909,Ferro,,-17.4,9110,1995-06-02 00:00:00,,EPSG,Used in Austria and former Czechoslovakia.,96.29
+8910,Brussels,,4.220471,9110,1995-06-02 00:00:00,,EPSG,,96.29
+8911,Stockholm,,18.03298,9110,1995-06-02 00:00:00,,EPSG,,96.29
+8912,Athens,,23.4258815,9110,1997-06-16 00:00:00,Topography Department; National Technical University of Athens.,EPSG,Used in Greece for older mapping based on Hatt projection.,
+8913,Oslo,,10.43225,9110,1999-10-20 00:00:00,Statens kartverk - Geodesi dividsion,EPSG,Formerly known as Kristiana and Christiana.,
diff --git a/src/tiff/csv/pcs.csv b/src/tiff/csv/pcs.csv
new file mode 100644
index 0000000..eb34563
--- /dev/null
+++ b/src/tiff/csv/pcs.csv
@@ -0,0 +1,2251 @@
+"COORD_REF_SYS_CODE","COORD_REF_SYS_NAME","UOM_CODE","SOURCE_GEOGCRS_CODE","COORD_OP_CODE","COORD_OP_METHOD_CODE","PARAMETER_CODE_1","PARAMETER_VALUE_1","PARAMETER_UOM_1","PARAMETER_CODE_2","PARAMETER_VALUE_2","PARAMETER_UOM_2","PARAMETER_CODE_3","PARAMETER_VALUE_3","PARAMETER_UOM_3","PARAMETER_CODE_4","PARAMETER_VALUE_4","PARAMETER_UOM_4","PARAMETER_CODE_5","PARAMETER_VALUE_5","PARAMETER_UOM_5","PARAMETER_CODE_6","PARAMETER_VALUE_6","PARAMETER_UOM_6","PARAMETER_CODE_7","PARAMETER_VALUE_ [...]
+2000,"Anguilla 1957 / British West Indies Grid",9001,4600,19942,9807,8801,0.0,9102,8802,-62.0,9102,8805,0.9995,9201,8806,400000.0,9001,8807,0.0,9001,,,,,,
+2001,"Antigua 1943 / British West Indies Grid",9001,4601,19942,9807,8801,0.0,9102,8802,-62.0,9102,8805,0.9995,9201,8806,400000.0,9001,8807,0.0,9001,,,,,,
+2002,"Dominica 1945 / British West Indies Grid",9001,4602,19942,9807,8801,0.0,9102,8802,-62.0,9102,8805,0.9995,9201,8806,400000.0,9001,8807,0.0,9001,,,,,,
+2003,"Grenada 1953 / British West Indies Grid",9001,4603,19942,9807,8801,0.0,9102,8802,-62.0,9102,8805,0.9995,9201,8806,400000.0,9001,8807,0.0,9001,,,,,,
+2004,"Montserrat 58 / British West Indies Grid",9001,4604,19942,9807,8801,0.0,9102,8802,-62.0,9102,8805,0.9995,9201,8806,400000.0,9001,8807,0.0,9001,,,,,,
+2005,"St Kitts 1955 / British West Indies Grid",9001,4605,19942,9807,8801,0.0,9102,8802,-62.0,9102,8805,0.9995,9201,8806,400000.0,9001,8807,0.0,9001,,,,,,
+2006,"St Lucia 1955 / British West Indies Grid",9001,4606,19942,9807,8801,0.0,9102,8802,-62.0,9102,8805,0.9995,9201,8806,400000.0,9001,8807,0.0,9001,,,,,,
+2007,"St Vincent 45 / British West Indies Grid",9001,4607,19942,9807,8801,0.0,9102,8802,-62.0,9102,8805,0.9995,9201,8806,400000.0,9001,8807,0.0,9001,,,,,,
+2008,"NAD27(CGQ77) / SCoPQ zone 2",9001,4609,17700,9807,8801,0.0,9110,8802,-55.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2009,"NAD27(CGQ77) / SCoPQ zone 3",9001,4609,17703,9807,8801,0.0,9110,8802,-58.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2010,"NAD27(CGQ77) / SCoPQ zone 4",9001,4609,17704,9807,8801,0.0,9110,8802,-61.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2011,"NAD27(CGQ77) / SCoPQ zone 5",9001,4609,17705,9807,8801,0.0,9110,8802,-64.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2012,"NAD27(CGQ77) / SCoPQ zone 6",9001,4609,17706,9807,8801,0.0,9110,8802,-67.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2013,"NAD27(CGQ77) / SCoPQ zone 7",9001,4609,17707,9807,8801,0.0,9110,8802,-70.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2014,"NAD27(CGQ77) / SCoPQ zone 8",9001,4609,17708,9807,8801,0.0,9110,8802,-73.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2015,"NAD27(CGQ77) / SCoPQ zone 9",9001,4609,17709,9807,8801,0.0,9110,8802,-76.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2016,"NAD27(CGQ77) / SCoPQ zone 10",9001,4609,17710,9807,8801,0.0,9110,8802,-79.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2017,"NAD27(76) / MTM zone 8",9001,4608,17708,9807,8801,0.0,9110,8802,-73.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2018,"NAD27(76) / MTM zone 9",9001,4608,17709,9807,8801,0.0,9110,8802,-76.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2019,"NAD27(76) / MTM zone 10",9001,4608,17710,9807,8801,0.0,9110,8802,-79.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2020,"NAD27(76) / MTM zone 11",9001,4608,17711,9807,8801,0.0,9110,8802,-82.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2021,"NAD27(76) / MTM zone 12",9001,4608,17712,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2022,"NAD27(76) / MTM zone 13",9001,4608,17713,9807,8801,0.0,9102,8802,-84.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2023,"NAD27(76) / MTM zone 14",9001,4608,17714,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2024,"NAD27(76) / MTM zone 15",9001,4608,17715,9807,8801,0.0,9102,8802,-90.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2025,"NAD27(76) / MTM zone 16",9001,4608,17716,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2026,"NAD27(76) / MTM zone 17",9001,4608,17717,9807,8801,0.0,9102,8802,-96.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2027,"NAD27(76) / UTM zone 15N",9001,4608,16015,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2028,"NAD27(76) / UTM zone 16N",9001,4608,16016,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2029,"NAD27(76) / UTM zone 17N",9001,4608,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2030,"NAD27(76) / UTM zone 18N",9001,4608,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2031,"NAD27(CGQ77) / UTM zone 17N",9001,4609,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2032,"NAD27(CGQ77) / UTM zone 18N",9001,4609,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2033,"NAD27(CGQ77) / UTM zone 19N",9001,4609,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2034,"NAD27(CGQ77) / UTM zone 20N",9001,4609,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2035,"NAD27(CGQ77) / UTM zone 21N",9001,4609,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2036,"NAD83(CSRS98) / New Brunswick Stereo",9001,4140,19946,9809,8801,46.3,9110,8802,-66.3,9110,8805,0.999912,9201,8806,2500000.0,9001,8807,7500000.0,9001,,,,,,
+2037,"NAD83(CSRS98) / UTM zone 19N",9001,4140,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2038,"NAD83(CSRS98) / UTM zone 20N",9001,4140,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2039,"Israel / Israeli TM Grid",9001,4141,18204,9807,8801,31.4403817,9110,8802,35.1216261,9110,8805,1.0000067,9201,8806,219529.584,9001,8807,626907.39,9001,,,,,,
+2040,"Locodjo 1965 / UTM zone 30N",9001,4142,16030,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2041,"Abidjan 1987 / UTM zone 30N",9001,4143,16030,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2042,"Locodjo 1965 / UTM zone 29N",9001,4142,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2043,"Abidjan 1987 / UTM zone 29N",9001,4143,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2044,"Hanoi 1972 / Gauss-Kruger zone 18",9001,4147,16218,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,18500000.0,9001,8807,0.0,9001,,,,,,
+2045,"Hanoi 1972 / Gauss-Kruger zone 19",9001,4147,16219,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,19500000.0,9001,8807,0.0,9001,,,,,,
+2046,"Hartebeesthoek94 / Lo15",9001,4148,17515,9808,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2047,"Hartebeesthoek94 / Lo17",9001,4148,17517,9808,8801,0.0,9102,8802,17.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2048,"Hartebeesthoek94 / Lo19",9001,4148,17519,9808,8801,0.0,9102,8802,19.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2049,"Hartebeesthoek94 / Lo21",9001,4148,17521,9808,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2050,"Hartebeesthoek94 / Lo23",9001,4148,17523,9808,8801,0.0,9102,8802,23.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2051,"Hartebeesthoek94 / Lo25",9001,4148,17525,9808,8801,0.0,9102,8802,25.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2052,"Hartebeesthoek94 / Lo27",9001,4148,17527,9808,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2053,"Hartebeesthoek94 / Lo29",9001,4148,17529,9808,8801,0.0,9102,8802,29.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2054,"Hartebeesthoek94 / Lo31",9001,4148,17531,9808,8801,0.0,9102,8802,31.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2055,"Hartebeesthoek94 / Lo33",9001,4148,17533,9808,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2056,"CH1903+ / LV95",9001,4150,19950,9815,8811,46.570866,9110,8812,7.26225,9110,8813,90.0,9110,8814,90.0,9110,8815,1.0,9201,8816,2600000.0,9001,8817,1200000.0,9001
+2057,"Rassadiran / Nakhl e Taqi",9001,4153,19951,9815,8811,27.31077837,9110,8812,52.3612741,9110,8813,0.34179803,9110,8814,0.34179803,9110,8815,0.999895934,9201,8816,658377.437,9001,8817,3044969.194,9001
+2058,"ED50(ED77) / UTM zone 38N",9001,4154,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2059,"ED50(ED77) / UTM zone 39N",9001,4154,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2060,"ED50(ED77) / UTM zone 40N",9001,4154,16040,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2061,"ED50(ED77) / UTM zone 41N",9001,4154,16041,9807,8801,0.0,9102,8802,63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2062,"Madrid 1870 (Madrid) / Spain",9001,4903,19921,9801,8801,40.0,9102,8802,0.0,9102,8805,0.9988085293,9201,8806,600000.0,9001,8807,600000.0,9001,,,,,,
+2063,"Dabola 1981 / UTM zone 28N",9001,4315,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2064,"Dabola 1981 / UTM zone 29N",9001,4315,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2065,"S-JTSK (Ferro) / Krovak",9001,4818,19952,9819,8811,49.3,9110,8812,42.3,9110,8813,30.1717303,9110,8816,0.0,9001,8817,0.0,9001,8818,78.3,9110,8819,0.9999,9201
+2066,"Mount Dillon / Tobago Grid",9039,4157,19924,9806,8801,11.1507843,9110,8802,-60.4109632,9110,8806,187500.0,9039,8807,180000.0,9039,,,,,,,,,
+2067,"Naparima 1955 / UTM zone 20N",9001,4158,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2068,"ELD79 / Libya zone 5",9001,4159,18240,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2069,"ELD79 / Libya zone 6",9001,4159,18241,9807,8801,0.0,9102,8802,11.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2070,"ELD79 / Libya zone 7",9001,4159,18242,9807,8801,0.0,9102,8802,13.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2071,"ELD79 / Libya zone 8",9001,4159,18243,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2072,"ELD79 / Libya zone 9",9001,4159,18244,9807,8801,0.0,9102,8802,17.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2073,"ELD79 / Libya zone 10",9001,4159,18245,9807,8801,0.0,9102,8802,19.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2074,"ELD79 / Libya zone 11",9001,4159,18246,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2075,"ELD79 / Libya zone 12",9001,4159,18247,9807,8801,0.0,9102,8802,23.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2076,"ELD79 / Libya zone 13",9001,4159,18248,9807,8801,0.0,9102,8802,25.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2077,"ELD79 / UTM zone 32N",9001,4159,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2078,"ELD79 / UTM zone 33N",9001,4159,16033,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2079,"ELD79 / UTM zone 34N",9001,4159,16034,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2080,"ELD79 / UTM zone 35N",9001,4159,16035,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2081,"Chos Malal 1914 / Argentina zone 2",9001,4160,18032,9807,8801,-90.0,9102,8802,-69.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+2082,"Pampa del Castillo / Argentina zone 2",9001,4161,18032,9807,8801,-90.0,9102,8802,-69.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+2083,"Hito XVIII 1963 / Argentina zone 2",9001,4254,18032,9807,8801,-90.0,9102,8802,-69.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+2084,"Hito XVIII 1963 / UTM zone 19S",9001,4254,16119,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2085,"NAD27 / Cuba Norte",9001,4267,18061,9801,8801,22.21,9110,8802,-81.0,9110,8805,0.99993602,9201,8806,500000.0,9001,8807,280296.016,9001,,,,,,
+2086,"NAD27 / Cuba Sur",9001,4267,18062,9801,8801,20.43,9110,8802,-76.5,9110,8805,0.99994848,9201,8806,500000.0,9001,8807,229126.939,9001,,,,,,
+2087,"ELD79 / TM 12 NE",9001,4159,16412,9807,8801,0.0,9102,8802,12.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2088,"Carthage / TM 11 NE",9001,4223,16411,9807,8801,0.0,9102,8802,11.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2089,"Yemen NGN96 / UTM zone 38N",9001,4163,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2090,"Yemen NGN96 / UTM zone 39N",9001,4163,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2091,"South Yemen / Gauss Kruger zone 8",9001,4164,16208,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+2092,"South Yemen / Gauss Kruger zone 9",9001,4164,16209,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,9500000.0,9001,8807,0.0,9001,,,,,,
+2093,"Hanoi 1972 / GK 106 NE",9001,4147,16586,9807,8801,0.0,9102,8802,106.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2094,"WGS 72BE / TM 106 NE",9001,4324,16506,9807,8801,0.0,9102,8802,106.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2095,"Bissau / UTM zone 28N",9001,4165,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2096,"Korean 1985 / Korea East Belt",9001,4162,18251,9807,8801,38.0,9102,8802,129.0,9102,8805,1.0,9201,8806,200000.0,9001,8807,500000.0,9001,,,,,,
+2097,"Korean 1985 / Korea Central Belt",9001,4162,18252,9807,8801,38.0,9102,8802,127.0,9102,8805,1.0,9201,8806,200000.0,9001,8807,500000.0,9001,,,,,,
+2098,"Korean 1985 / Korea West Belt",9001,4162,18253,9807,8801,38.0,9102,8802,125.0,9102,8805,1.0,9201,8806,200000.0,9001,8807,500000.0,9001,,,,,,
+2099,"Qatar 1948 / Qatar Grid",9001,4286,19953,9806,8801,25.22565,9110,8802,50.4541,9110,8806,100000.0,9001,8807,100000.0,9001,,,,,,,,,
+2100,"GGRS87 / Greek Grid",9001,4121,19930,9807,8801,0.0,9102,8802,24.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2101,"Lake / Maracaibo Grid M1",9001,4249,18260,9801,8801,10.1,9110,8802,-71.3620224,9110,8805,1.0,9201,8806,0.0,9001,8807,-52684.972,9001,,,,,,
+2102,"Lake / Maracaibo Grid",9001,4249,18261,9801,8801,10.1,9110,8802,-71.3620224,9110,8805,1.0,9201,8806,200000.0,9001,8807,147315.028,9001,,,,,,
+2103,"Lake / Maracaibo Grid M3",9001,4249,18262,9801,8801,10.1,9110,8802,-71.3620224,9110,8805,1.0,9201,8806,500000.0,9001,8807,447315.028,9001,,,,,,
+2104,"Lake / Maracaibo La Rosa Grid",9001,4249,18263,9801,8801,10.1,9110,8802,-71.3620224,9110,8805,1.0,9201,8806,-17044.0,9001,8807,-23139.97,9001,,,,,,
+2105,"NZGD2000 / Mount Eden Circuit 2000",9001,4167,17931,9807,8801,-36.5247,9110,8802,174.4551,9110,8805,0.9999,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2106,"NZGD2000 / Bay of Plenty Circuit 2000",9001,4167,17932,9807,8801,-37.454,9110,8802,176.2758,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2107,"NZGD2000 / Poverty Bay Circuit 2000",9001,4167,17933,9807,8801,-38.3728,9110,8802,177.5308,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2108,"NZGD2000 / Hawkes Bay Circuit 2000",9001,4167,17934,9807,8801,-39.3903,9110,8802,176.4025,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2109,"NZGD2000 / Taranaki Circuit 2000",9001,4167,17935,9807,8801,-39.0808,9110,8802,174.134,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2110,"NZGD2000 / Tuhirangi Circuit 2000",9001,4167,17936,9807,8801,-39.3044,9110,8802,175.3824,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2111,"NZGD2000 / Wanganui Circuit 2000",9001,4167,17937,9807,8801,-40.1431,9110,8802,175.2917,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2112,"NZGD2000 / Wairarapa Circuit 2000",9001,4167,17938,9807,8801,-40.5531,9110,8802,175.385,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2113,"NZGD2000 / Wellington Circuit 2000",9001,4167,17939,9807,8801,-41.1804,9110,8802,174.4635,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2114,"NZGD2000 / Collingwood Circuit 2000",9001,4167,17940,9807,8801,-40.4253,9110,8802,172.4019,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2115,"NZGD2000 / Nelson Circuit 2000",9001,4167,17941,9807,8801,-41.1628,9110,8802,173.1757,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2116,"NZGD2000 / Karamea Circuit 2000",9001,4167,17942,9807,8801,-41.1723,9110,8802,172.0632,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2117,"NZGD2000 / Buller Circuit 2000",9001,4167,17943,9807,8801,-41.4838,9110,8802,171.3452,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2118,"NZGD2000 / Grey Circuit 2000",9001,4167,17944,9807,8801,-42.2001,9110,8802,171.3259,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2119,"NZGD2000 / Amuri Circuit 2000",9001,4167,17945,9807,8801,-42.412,9110,8802,173.0036,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2120,"NZGD2000 / Marlborough Circuit 2000",9001,4167,17946,9807,8801,-41.324,9110,8802,173.4807,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2121,"NZGD2000 / Hokitika Circuit 2000",9001,4167,17947,9807,8801,-42.531,9110,8802,170.5847,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2122,"NZGD2000 / Okarito Circuit 2000",9001,4167,17948,9807,8801,-43.0636,9110,8802,170.1539,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2123,"NZGD2000 / Jacksons Bay Circuit 2000",9001,4167,17949,9807,8801,-43.584,9110,8802,168.3622,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2124,"NZGD2000 / Mount Pleasant Circuit 2000",9001,4167,17950,9807,8801,-43.3526,9110,8802,172.4337,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2125,"NZGD2000 / Gawler Circuit 2000",9001,4167,17951,9807,8801,-43.4455,9110,8802,171.2138,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2126,"NZGD2000 / Timaru Circuit 2000",9001,4167,17952,9807,8801,-44.2407,9110,8802,171.0326,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2127,"NZGD2000 / Lindis Peak Circuit 2000",9001,4167,17953,9807,8801,-44.4406,9110,8802,169.2803,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2128,"NZGD2000 / Mount Nicholas Circuit 2000",9001,4167,17954,9807,8801,-45.0758,9110,8802,168.2355,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2129,"NZGD2000 / Mount York Circuit 2000",9001,4167,17955,9807,8801,-45.3349,9110,8802,167.4419,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2130,"NZGD2000 / Observation Point Circuit 2000",9001,4167,17956,9807,8801,-45.4858,9110,8802,170.3742,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2131,"NZGD2000 / North Taieri Circuit 2000",9001,4167,17957,9807,8801,-45.5141,9110,8802,170.1657,9110,8805,0.99996,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2132,"NZGD2000 / Bluff Circuit 2000",9001,4167,17958,9807,8801,-46.36,9110,8802,168.2034,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2133,"NZGD2000 / UTM zone 58S",9001,4167,16158,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2134,"NZGD2000 / UTM zone 59S",9001,4167,16159,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2135,"NZGD2000 / UTM zone 60S",9001,4167,16160,9807,8801,0.0,9102,8802,177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2136,"Accra / Ghana National Grid",9094,4168,19959,9807,8801,4.4,9110,8802,-1.0,9110,8805,0.99975,9201,8806,900000.0,9094,8807,0.0,9094,,,,,,
+2137,"Accra / TM 1 NW",9001,4168,17001,9807,8801,0.0,9102,8802,-1.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2138,"NAD27(CGQ77) / Quebec Lambert",9001,4609,19944,9802,8821,44.0,9110,8822,-68.3,9110,8823,60.0,9110,8824,46.0,9110,8826,0.0,9001,8827,0.0,9001,,,
+2139,"NAD83(CSRS98) / SCoPQ zone 2",9001,4140,17700,9807,8801,0.0,9110,8802,-55.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2140,"NAD83(CSRS98) / MTM zone 3",9001,4140,17703,9807,8801,0.0,9110,8802,-58.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2141,"NAD83(CSRS98) / MTM zone 4",9001,4140,17704,9807,8801,0.0,9110,8802,-61.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2142,"NAD83(CSRS98) / MTM zone 5",9001,4140,17705,9807,8801,0.0,9110,8802,-64.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2143,"NAD83(CSRS98) / MTM zone 6",9001,4140,17706,9807,8801,0.0,9110,8802,-67.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2144,"NAD83(CSRS98) / MTM zone 7",9001,4140,17707,9807,8801,0.0,9110,8802,-70.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2145,"NAD83(CSRS98) / MTM zone 8",9001,4140,17708,9807,8801,0.0,9110,8802,-73.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2146,"NAD83(CSRS98) / MTM zone 9",9001,4140,17709,9807,8801,0.0,9110,8802,-76.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2147,"NAD83(CSRS98) / MTM zone 10",9001,4140,17710,9807,8801,0.0,9110,8802,-79.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2148,"NAD83(CSRS98) / UTM zone 21N",9001,4140,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2149,"NAD83(CSRS98) / UTM zone 18N",9001,4140,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2150,"NAD83(CSRS98) / UTM zone 17N",9001,4140,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2151,"NAD83(CSRS98) / UTM zone 13N",9001,4140,16013,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2152,"NAD83(CSRS98) / UTM zone 12N",9001,4140,16012,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2153,"NAD83(CSRS98) / UTM zone 11N",9001,4140,16011,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2154,"RGF93 / Lambert-93",9001,4171,18085,9802,8821,46.3,9110,8822,3.0,9110,8823,49.0,9110,8824,44.0,9110,8826,700000.0,9001,8827,6600000.0,9001,,,
+2155,"American Samoa 1962 / American Samoa Lambert",9003,4169,15300,9801,8801,-14.16,9110,8802,170.0,9110,8805,1.0,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+2156,"NAD83(HARN) / UTM zone 59S",9001,4152,16159,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2157,"IRENET95 / Irish Transverse Mercator",9001,4173,19962,9807,8801,53.3,9110,8802,-8.0,9110,8805,0.99982,9201,8806,600000.0,9001,8807,750000.0,9001,,,,,,
+2158,"IRENET95 / UTM zone 29N",9001,4173,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2159,"Sierra Leone 1924 / New Colony Grid",9094,4174,19963,9807,8801,6.4,9110,8802,-12.0,9110,8805,1.0,9201,8806,500000.0,9094,8807,0.0,9094,,,,,,
+2160,"Sierra Leone 1924 / New War Office Grid",9094,4174,19964,9807,8801,6.4,9110,8802,-12.0,9110,8805,1.0,9201,8806,800000.0,9094,8807,600000.0,9094,,,,,,
+2161,"Sierra Leone 1968 / UTM zone 28N",9001,4175,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2162,"Sierra Leone 1968 / UTM zone 29N",9001,4175,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2163,US National Atlas Equal Area,9001,4047,19965,9821,8806,0.0,9001,8807,0.0,9001,8828,45.0,9102,8829,-100.0,9102,,,,,,,,,
+2164,"Locodjo 1965 / TM 5 NW",9001,4142,17005,9807,8801,0.0,9102,8802,-5.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2165,"Abidjan 1987 / TM 5 NW",9001,4143,17005,9807,8801,0.0,9102,8802,-5.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2166,"Pulkovo 1942(83) / Gauss Kruger zone 3",9001,4178,16263,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+2167,"Pulkovo 1942(83) / Gauss Kruger zone 4",9001,4178,16264,9807,8801,0.0,9102,8802,12.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+2168,"Pulkovo 1942(83) / Gauss Kruger zone 5",9001,4178,16265,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+2169,"Luxembourg 1930 / Gauss",9001,4181,19966,9807,8801,49.5,9110,8802,6.1,9110,8805,1.0,9201,8806,80000.0,9001,8807,100000.0,9001,,,,,,
+2170,"MGI / Slovenia Grid",9001,4312,19967,9807,8801,0.0,9110,8802,15.0,9110,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2171,"Pulkovo 1942(58) / Poland zone I",9001,4179,18281,9809,8801,50.373,9110,8802,21.05,9110,8805,0.9998,9201,8806,4637000.0,9001,8807,5647000.0,9001,,,,,,
+2172,"Pulkovo 1942(58) / Poland zone II",9001,4179,18282,9809,8801,53.0007,9110,8802,21.301,9110,8805,0.9998,9201,8806,4603000.0,9001,8807,5806000.0,9001,,,,,,
+2173,"Pulkovo 1942(58) / Poland zone III",9001,4179,18283,9809,8801,53.35,9110,8802,17.003,9110,8805,0.9998,9201,8806,3501000.0,9001,8807,5999000.0,9001,,,,,,
+2174,"Pulkovo 1942(58) / Poland zone IV",9001,4179,18284,9809,8801,51.4015,9110,8802,16.402,9110,8805,0.9998,9201,8806,3703000.0,9001,8807,5627000.0,9001,,,,,,
+2175,"Pulkovo 1942(58) / Poland zone V",9001,4179,18285,9807,8801,0.0,9110,8802,18.573,9110,8805,0.999983,9201,8806,237000.0,9001,8807,-4700000.0,9001,,,,,,
+2176,"ETRS89 / Poland CS2000 zone 5",9001,4258,18305,9807,8801,0.0,9102,8802,15.0,9102,8805,0.999923,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+2177,"ETRS89 / Poland CS2000 zone 6",9001,4258,18306,9807,8801,0.0,9102,8802,18.0,9102,8805,0.999923,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+2178,"ETRS89 / Poland CS2000 zone 7",9001,4258,18307,9807,8801,0.0,9102,8802,21.0,9102,8805,0.999923,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+2179,"ETRS89 / Poland CS2000 zone 8",9001,4258,18308,9807,8801,0.0,9102,8802,24.0,9102,8805,0.999923,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+2180,"ETRS89 / Poland CS92",9001,4258,18300,9807,8801,0.0,9102,8802,19.0,9102,8805,0.9993,9201,8806,500000.0,9001,8807,-5300000.0,9001,,,,,,
+2188,"Azores Occidental 1939 / UTM zone 25N",9001,4182,16025,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2189,"Azores Central 1948 / UTM zone 26N",9001,4183,16026,9807,8801,0.0,9102,8802,-27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2190,"Azores Oriental 1940 / UTM zone 26N",9001,4184,16026,9807,8801,0.0,9102,8802,-27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2191,"Madeira 1936 / UTM zone 28N",9001,4185,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2192,"ED50 / France EuroLambert",9001,4230,18086,9801,8801,46.48,9110,8802,2.2014025,9110,8805,0.99987742,9201,8806,600000.0,9001,8807,2200000.0,9001,,,,,,
+2193,"NZGD2000 / New Zealand Transverse Mercator",9001,4167,19971,9807,8801,0.0,9102,8802,173.0,9102,8805,0.9996,9201,8806,1600000.0,9001,8807,10000000.0,9001,,,,,,
+2194,"American Samoa 1962 / American Samoa Lambert",9003,4169,15301,9801,8801,-14.16,9110,8802,-170.0,9110,8805,1.0,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+2195,"NAD83(HARN) / UTM zone 2S",9001,4152,16102,9807,8801,0.0,9102,8802,-171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2196,"ETRS89 / Kp2000 Jutland",9001,4258,18401,9807,8801,0.0,9110,8802,9.3,9110,8805,0.99995,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2197,"ETRS89 / Kp2000 Zealand",9001,4258,18402,9807,8801,0.0,9102,8802,12.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2198,"ETRS89 / Kp2000 Bornholm",9001,4258,18403,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,900000.0,9001,8807,0.0,9001,,,,,,
+2199,"Albanian 1987 / Gauss Kruger zone 4",9001,4191,16204,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+2200,"ATS77 / New Brunswick Stereographic (ATS77)",9001,4122,19945,9809,8801,46.3,9110,8802,-66.3,9110,8805,0.999912,9201,8806,300000.0,9001,8807,800000.0,9001,,,,,,
+2201,"REGVEN / UTM zone 18N",9001,4189,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2202,"REGVEN / UTM zone 19N",9001,4189,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2203,"REGVEN / UTM zone 20N",9001,4189,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2204,"NAD27 / Tennessee",9003,4267,15302,9802,8821,34.4,9110,8822,-86.0,9110,8823,35.15,9110,8824,36.25,9110,8826,2000000.0,9003,8827,100000.0,9003,,,
+2205,"NAD83 / Kentucky North",9001,4269,15303,9802,8821,37.3,9110,8822,-84.15,9110,8823,37.58,9110,8824,38.58,9110,8826,500000.0,9001,8827,0.0,9001,,,
+2206,"ED50 / 3-degree Gauss-Kruger zone 9",9001,4230,16269,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,9500000.0,9001,8807,0.0,9001,,,,,,
+2207,"ED50 / 3-degree Gauss-Kruger zone 10",9001,4230,16270,9807,8801,0.0,9102,8802,30.0,9102,8805,1.0,9201,8806,10500000.0,9001,8807,0.0,9001,,,,,,
+2208,"ED50 / 3-degree Gauss-Kruger zone 11",9001,4230,16271,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,11500000.0,9001,8807,0.0,9001,,,,,,
+2209,"ED50 / 3-degree Gauss-Kruger zone 12",9001,4230,16272,9807,8801,0.0,9102,8802,36.0,9102,8805,1.0,9201,8806,12500000.0,9001,8807,0.0,9001,,,,,,
+2210,"ED50 / 3-degree Gauss-Kruger zone 13",9001,4230,16273,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,13500000.0,9001,8807,0.0,9001,,,,,,
+2211,"ED50 / 3-degree Gauss-Kruger zone 14",9001,4230,16274,9807,8801,0.0,9102,8802,42.0,9102,8805,1.0,9201,8806,14500000.0,9001,8807,0.0,9001,,,,,,
+2212,"ED50 / 3-degree Gauss-Kruger zone 15",9001,4230,16275,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,15500000.0,9001,8807,0.0,9001,,,,,,
+2213,"ETRS89 / TM 30 NE",9001,4258,16430,9807,8801,0.0,9102,8802,30.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2214,"Douala 1948 / AOF west",9001,4192,18415,9807,8801,0.0,9110,8802,10.3,9110,8805,0.999,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+2215,"Manoca 1962 / UTM zone 32N",9001,4193,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2216,"Qornoq 1927 / UTM zone 22N",9001,4194,16022,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2217,"Qornoq 1927 / UTM zone 23N",9001,4194,16023,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2218,"Scoresbysund 1952 / Greenland zone 5 east",9001,4195,18425,9826,8801,70.3,9110,8802,-24.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2219,"ATS77 / UTM zone 19N",9001,4122,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2220,"ATS77 / UTM zone 20N",9001,4122,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2221,"Scoresbysund 1952 / Greenland zone 6 east",9001,4195,18426,9826,8801,67.3,9110,8802,-32.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2222,"NAD83 / Arizona East (ft)",9002,4269,15304,9807,8801,31.0,9110,8802,-110.1,9110,8805,0.9999,9201,8806,700000.0,9002,8807,0.0,9002,,,,,,
+2223,"NAD83 / Arizona Central (ft)",9002,4269,15305,9807,8801,31.0,9110,8802,-111.55,9110,8805,0.9999,9201,8806,700000.0,9002,8807,0.0,9002,,,,,,
+2224,"NAD83 / Arizona West (ft)",9002,4269,15306,9807,8801,31.0,9110,8802,-113.45,9110,8805,0.999933333,9201,8806,700000.0,9002,8807,0.0,9002,,,,,,
+2225,"NAD83 / California zone 1 (ftUS)",9003,4269,15307,9802,8821,39.2,9110,8822,-122.0,9110,8823,41.4,9110,8824,40.0,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2226,"NAD83 / California zone 2 (ftUS)",9003,4269,15308,9802,8821,37.4,9110,8822,-122.0,9110,8823,39.5,9110,8824,38.2,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2227,"NAD83 / California zone 3 (ftUS)",9003,4269,15309,9802,8821,36.3,9110,8822,-120.3,9110,8823,38.26,9110,8824,37.04,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2228,"NAD83 / California zone 4 (ftUS)",9003,4269,15310,9802,8821,35.2,9110,8822,-119.0,9110,8823,37.15,9110,8824,36.0,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2229,"NAD83 / California zone 5 (ftUS)",9003,4269,15311,9802,8821,33.3,9110,8822,-118.0,9110,8823,35.28,9110,8824,34.02,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2230,"NAD83 / California zone 6 (ftUS)",9003,4269,15312,9802,8821,32.1,9110,8822,-116.15,9110,8823,33.53,9110,8824,32.47,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2231,"NAD83 / Colorado North (ftUS)",9003,4269,15313,9802,8821,39.2,9110,8822,-105.3,9110,8823,40.47,9110,8824,39.43,9110,8826,3000000.0,9003,8827,1000000.0,9003,,,
+2232,"NAD83 / Colorado Central (ftUS)",9003,4269,15314,9802,8821,37.5,9110,8822,-105.3,9110,8823,39.45,9110,8824,38.27,9110,8826,3000000.0,9003,8827,1000000.0,9003,,,
+2233,"NAD83 / Colorado South (ftUS)",9003,4269,15315,9802,8821,36.4,9110,8822,-105.3,9110,8823,38.26,9110,8824,37.14,9110,8826,3000000.0,9003,8827,1000000.0,9003,,,
+2234,"NAD83 / Connecticut (ftUS)",9003,4269,15316,9802,8821,40.5,9110,8822,-72.45,9110,8823,41.52,9110,8824,41.12,9110,8826,1000000.0,9003,8827,500000.0,9003,,,
+2235,"NAD83 / Delaware (ftUS)",9003,4269,15317,9807,8801,38.0,9110,8802,-75.25,9110,8805,0.999995,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+2236,"NAD83 / Florida East (ftUS)",9003,4269,15318,9807,8801,24.2,9110,8802,-81.0,9110,8805,0.999941177,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+2237,"NAD83 / Florida West (ftUS)",9003,4269,15319,9807,8801,24.2,9110,8802,-82.0,9110,8805,0.999941177,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+2238,"NAD83 / Florida North (ftUS)",9003,4269,15320,9802,8821,29.0,9110,8822,-84.3,9110,8823,30.45,9110,8824,29.35,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2239,"NAD83 / Georgia East (ftUS)",9003,4269,15321,9807,8801,30.0,9110,8802,-82.1,9110,8805,0.9999,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+2240,"NAD83 / Georgia West (ftUS)",9003,4269,15322,9807,8801,30.0,9110,8802,-84.1,9110,8805,0.9999,9201,8806,2296583.333,9003,8807,0.0,9003,,,,,,
+2241,"NAD83 / Idaho East (ftUS)",9003,4269,15323,9807,8801,41.4,9110,8802,-112.1,9110,8805,0.999947368,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+2242,"NAD83 / Idaho Central (ftUS)",9003,4269,15324,9807,8801,41.4,9110,8802,-114.0,9110,8805,0.999947368,9201,8806,1640416.667,9003,8807,0.0,9003,,,,,,
+2243,"NAD83 / Idaho West (ftUS)",9003,4269,15325,9807,8801,41.4,9110,8802,-115.45,9110,8805,0.999933333,9201,8806,2624666.667,9003,8807,0.0,9003,,,,,,
+2244,"NAD83 / Indiana East (ftUS)",9003,4269,15326,9807,8801,37.3,9110,8802,-85.4,9110,8805,0.999966667,9201,8806,328083.333,9003,8807,818125.0,9003,,,,,,
+2245,"NAD83 / Indiana West (ftUS)",9003,4269,15327,9807,8801,37.3,9110,8802,-87.05,9110,8805,0.999966667,9201,8806,2952750.0,9003,8807,818125.0,9003,,,,,,
+2246,"NAD83 / Kentucky North (ftUS)",9003,4269,15328,9802,8821,37.3,9110,8822,-84.15,9110,8823,37.58,9110,8824,38.58,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+2247,"NAD83 / Kentucky South (ftUS)",9003,4269,15329,9802,8821,36.2,9110,8822,-85.45,9110,8823,37.56,9110,8824,36.44,9110,8826,1640416.667,9003,8827,1640416.667,9003,,,
+2248,"NAD83 / Maryland (ftUS)",9003,4269,15330,9802,8821,37.4,9110,8822,-77.0,9110,8823,39.27,9110,8824,38.18,9110,8826,1312333.333,9003,8827,0.0,9003,,,
+2249,"NAD83 / Massachusetts Mainland (ftUS)",9003,4269,15331,9802,8821,41.0,9110,8822,-71.3,9110,8823,42.41,9110,8824,41.43,9110,8826,656166.667,9003,8827,2460625.0,9003,,,
+2250,"NAD83 / Massachusetts Island (ftUS)",9003,4269,15332,9802,8821,41.0,9110,8822,-70.3,9110,8823,41.29,9110,8824,41.17,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+2251,"NAD83 / Michigan North (ft)",9002,4269,15333,9802,8821,44.47,9110,8822,-87.0,9110,8823,47.05,9110,8824,45.29,9110,8826,26246719.16,9002,8827,0.0,9002,,,
+2252,"NAD83 / Michigan Central (ft)",9002,4269,15334,9802,8821,43.19,9110,8822,-84.22,9110,8823,45.42,9110,8824,44.11,9110,8826,19685039.37,9002,8827,0.0,9002,,,
+2253,"NAD83 / Michigan South (ft)",9002,4269,15335,9802,8821,41.3,9110,8822,-84.22,9110,8823,43.4,9110,8824,42.06,9110,8826,13123359.58,9002,8827,0.0,9002,,,
+2254,"NAD83 / Mississippi East (ftUS)",9003,4269,15336,9807,8801,29.3,9110,8802,-88.5,9110,8805,0.99995,9201,8806,984250.0,9003,8807,0.0,9003,,,,,,
+2255,"NAD83 / Mississippi West (ftUS)",9003,4269,15337,9807,8801,29.3,9110,8802,-90.2,9110,8805,0.99995,9201,8806,2296583.333,9003,8807,0.0,9003,,,,,,
+2256,"NAD83 / Montana (ft)",9002,4269,15338,9802,8821,44.15,9110,8822,-109.3,9110,8823,49.0,9110,8824,45.0,9110,8826,1968503.937,9002,8827,0.0,9002,,,
+2257,"NAD83 / New Mexico East (ftUS)",9003,4269,15339,9807,8801,31.0,9110,8802,-104.2,9110,8805,0.999909091,9201,8806,541337.5,9003,8807,0.0,9003,,,,,,
+2258,"NAD83 / New Mexico Central (ftUS)",9003,4269,15340,9807,8801,31.0,9110,8802,-106.15,9110,8805,0.9999,9201,8806,1640416.667,9003,8807,0.0,9003,,,,,,
+2259,"NAD83 / New Mexico West (ftUS)",9003,4269,15341,9807,8801,31.0,9110,8802,-107.5,9110,8805,0.999916667,9201,8806,2723091.667,9003,8807,0.0,9003,,,,,,
+2260,"NAD83 / New York East (ftUS)",9003,4269,15342,9807,8801,38.5,9110,8802,-74.3,9110,8805,0.9999,9201,8806,492125.0,9003,8807,0.0,9003,,,,,,
+2261,"NAD83 / New York Central (ftUS)",9003,4269,15343,9807,8801,40.0,9110,8802,-76.35,9110,8805,0.9999375,9201,8806,820208.333,9003,8807,0.0,9003,,,,,,
+2262,"NAD83 / New York West (ftUS)",9003,4269,15344,9807,8801,40.0,9110,8802,-78.35,9110,8805,0.9999375,9201,8806,1148291.667,9003,8807,0.0,9003,,,,,,
+2263,"NAD83 / New York Long Island (ftUS)",9003,4269,15345,9802,8821,40.1,9110,8822,-74.0,9110,8823,41.02,9110,8824,40.4,9110,8826,984250.0,9003,8827,0.0,9003,,,
+2264,"NAD83 / North Carolina (ftUS)",9003,4269,15346,9802,8821,33.45,9110,8822,-79.0,9110,8823,36.1,9110,8824,34.2,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+2265,"NAD83 / North Dakota North (ft)",9002,4269,15347,9802,8821,47.0,9110,8822,-100.3,9110,8823,48.44,9110,8824,47.26,9110,8826,1968503.937,9002,8827,0.0,9002,,,
+2266,"NAD83 / North Dakota South (ft)",9002,4269,15348,9802,8821,45.4,9110,8822,-100.3,9110,8823,47.29,9110,8824,46.11,9110,8826,1968503.937,9002,8827,0.0,9002,,,
+2267,"NAD83 / Oklahoma North (ftUS)",9003,4269,15349,9802,8821,35.0,9110,8822,-98.0,9110,8823,36.46,9110,8824,35.34,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2268,"NAD83 / Oklahoma South (ftUS)",9003,4269,15350,9802,8821,33.2,9110,8822,-98.0,9110,8823,35.14,9110,8824,33.56,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2269,"NAD83 / Oregon North (ft)",9002,4269,15351,9802,8821,43.4,9110,8822,-120.3,9110,8823,46.0,9110,8824,44.2,9110,8826,8202099.738,9002,8827,0.0,9002,,,
+2270,"NAD83 / Oregon South (ft)",9002,4269,15352,9802,8821,41.4,9110,8822,-120.3,9110,8823,44.0,9110,8824,42.2,9110,8826,4921259.843,9002,8827,0.0,9002,,,
+2271,"NAD83 / Pennsylvania North (ftUS)",9003,4269,15353,9802,8821,40.1,9110,8822,-77.45,9110,8823,41.57,9110,8824,40.53,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2272,"NAD83 / Pennsylvania South (ftUS)",9003,4269,15354,9802,8821,39.2,9110,8822,-77.45,9110,8823,40.58,9110,8824,39.56,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2273,"NAD83 / South Carolina (ft)",9002,4269,15355,9802,8821,31.5,9110,8822,-81.0,9110,8823,34.5,9110,8824,32.3,9110,8826,2000000.0,9002,8827,0.0,9002,,,
+2274,"NAD83 / Tennessee (ftUS)",9003,4269,15356,9802,8821,34.2,9110,8822,-86.0,9110,8823,36.25,9110,8824,35.15,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2275,"NAD83 / Texas North (ftUS)",9003,4269,15357,9802,8821,34.0,9110,8822,-101.3,9110,8823,36.11,9110,8824,34.39,9110,8826,656166.667,9003,8827,3280833.333,9003,,,
+2276,"NAD83 / Texas North Central (ftUS)",9003,4269,15358,9802,8821,31.4,9110,8822,-98.3,9110,8823,33.58,9110,8824,32.08,9110,8826,1968500.0,9003,8827,6561666.667,9003,,,
+2277,"NAD83 / Texas Central (ftUS)",9003,4269,15359,9802,8821,29.4,9110,8822,-100.2,9110,8823,31.53,9110,8824,30.07,9110,8826,2296583.333,9003,8827,9842500.0,9003,,,
+2278,"NAD83 / Texas South Central (ftUS)",9003,4269,15360,9802,8821,27.5,9110,8822,-99.0,9110,8823,30.17,9110,8824,28.23,9110,8826,1968500.0,9003,8827,13123333.333,9003,,,
+2279,"NAD83 / Texas South (ftUS)",9003,4269,15361,9802,8821,25.4,9110,8822,-98.3,9110,8823,27.5,9110,8824,26.1,9110,8826,984250.0,9003,8827,16404166.667,9003,,,
+2280,"NAD83 / Utah North (ft)",9002,4269,15362,9802,8821,40.2,9110,8822,-111.3,9110,8823,41.47,9110,8824,40.43,9110,8826,1640419.948,9002,8827,3280839.895,9002,,,
+2281,"NAD83 / Utah Central (ft)",9002,4269,15363,9802,8821,38.2,9110,8822,-111.3,9110,8823,40.39,9110,8824,39.01,9110,8826,1640419.948,9002,8827,6561679.79,9002,,,
+2282,"NAD83 / Utah South (ft)",9002,4269,15364,9802,8821,36.4,9110,8822,-111.3,9110,8823,38.21,9110,8824,37.13,9110,8826,1640419.948,9002,8827,9842519.685,9002,,,
+2283,"NAD83 / Virginia North (ftUS)",9003,4269,15365,9802,8821,37.4,9110,8822,-78.3,9110,8823,39.12,9110,8824,38.02,9110,8826,11482916.667,9003,8827,6561666.667,9003,,,
+2284,"NAD83 / Virginia South (ftUS)",9003,4269,15366,9802,8821,36.2,9110,8822,-78.3,9110,8823,37.58,9110,8824,36.46,9110,8826,11482916.667,9003,8827,3280833.333,9003,,,
+2285,"NAD83 / Washington North (ftUS)",9003,4269,15367,9802,8821,47.0,9110,8822,-120.5,9110,8823,48.44,9110,8824,47.3,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+2286,"NAD83 / Washington South (ftUS)",9003,4269,15368,9802,8821,45.2,9110,8822,-120.3,9110,8823,47.2,9110,8824,45.5,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+2287,"NAD83 / Wisconsin North (ftUS)",9003,4269,15369,9802,8821,45.1,9110,8822,-90.0,9110,8823,46.46,9110,8824,45.34,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2288,"NAD83 / Wisconsin Central (ftUS)",9003,4269,15370,9802,8821,43.5,9110,8822,-90.0,9110,8823,45.3,9110,8824,44.15,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2289,"NAD83 / Wisconsin South (ftUS)",9003,4269,15371,9802,8821,42.0,9110,8822,-90.0,9110,8823,44.04,9110,8824,42.44,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2290,"ATS77 / Prince Edward Isl. Stereographic (ATS77)",9001,4122,19933,9809,8801,47.15,9110,8802,-63.0,9110,8805,0.999912,9201,8806,700000.0,9001,8807,400000.0,9001,,,,,,
+2291,"NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)",9001,4122,19960,9809,8801,47.15,9110,8802,-63.0,9110,8805,0.999912,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2292,"NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83)",9001,4140,19960,9809,8801,47.15,9110,8802,-63.0,9110,8805,0.999912,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2294,"ATS77 / MTM Nova Scotia zone 4",9001,4122,17794,9807,8801,0.0,9110,8802,-61.3,9110,8805,0.9999,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+2295,"ATS77 / MTM Nova Scotia zone 5",9001,4122,17795,9807,8801,0.0,9110,8802,-64.3,9110,8805,0.9999,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+2296,"Ammassalik 1958 / Greenland zone 7 east",9001,4196,18427,9826,8801,64.3,9110,8802,-40.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2297,"Qornoq 1927 / Greenland zone 1 east",9001,4194,18421,9826,8801,82.3,9110,8802,-40.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2298,"Qornoq 1927 / Greenland zone 2 east",9001,4194,18422,9826,8801,79.3,9110,8802,-24.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2299,"Qornoq 1927 / Greenland zone 2 west",9001,4194,18432,9826,8801,79.3,9110,8802,-64.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2300,"Qornoq 1927 / Greenland zone 3 east",9001,4194,18423,9826,8801,76.3,9110,8802,-20.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2301,"Qornoq 1927 / Greenland zone 3 west",9001,4194,18433,9826,8801,76.3,9110,8802,-64.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2302,"Qornoq 1927 / Greenland zone 4 east",9001,4194,18424,9826,8801,73.3,9110,8802,-24.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2303,"Qornoq 1927 / Greenland zone 4 west",9001,4194,18434,9826,8801,73.3,9110,8802,-52.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2304,"Qornoq 1927 / Greenland zone 5 west",9001,4194,18435,9826,8801,70.3,9110,8802,-52.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2305,"Qornoq 1927 / Greenland zone 6 west",9001,4194,18436,9826,8801,67.3,9110,8802,-52.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2306,"Qornoq 1927 / Greenland zone 7 west",9001,4194,18437,9826,8801,64.3,9110,8802,-52.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2307,"Qornoq 1927 / Greenland zone 8 east",9001,4194,18428,9826,8801,61.3,9110,8802,-48.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2308,"Batavia / TM 109 SE",9001,4211,16709,9807,8801,0.0,9102,8802,109.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2309,"WGS 84 / TM 116 SE",9001,4326,16716,9807,8801,0.0,9102,8802,116.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2310,"WGS 84 / TM 132 SE",9001,4326,16732,9807,8801,0.0,9102,8802,132.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2311,"WGS 84 / TM 6 NE",9001,4326,16406,9807,8801,0.0,9102,8802,6.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2312,"Garoua / UTM zone 33N",9001,4197,16033,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2313,"Kousseri / UTM zone 33N",9001,4198,16033,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2314,"Trinidad 1903 / Trinidad Grid (ftCla)",9005,4302,19975,9806,8801,10.263,9110,8802,-61.2,9110,8806,283800.0,9005,8807,214500.0,9005,,,,,,,,,
+2315,"Campo Inchauspe / UTM zone 19S",9001,4221,16119,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2316,"Campo Inchauspe / UTM zone 20S",9001,4221,16120,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2317,"PSAD56 / ICN Regional",9001,4248,19976,9802,8821,6.0,9102,8822,-66.0,9102,8823,9.0,9102,8824,3.0,9102,8826,1000000.0,9001,8827,1000000.0,9001,,,
+2318,"Ain el Abd / Aramco Lambert",9001,4204,19977,9802,8821,25.0522236,9110,8822,48.0,9102,8823,17.0,9102,8824,33.0,9102,8826,0.0,9001,8827,0.0,9001,,,
+2319,"ED50 / TM27",9001,4230,16369,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2320,"ED50 / TM30",9001,4230,16370,9807,8801,0.0,9102,8802,30.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2321,"ED50 / TM33",9001,4230,16371,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2322,"ED50 / TM36",9001,4230,16372,9807,8801,0.0,9102,8802,36.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2323,"ED50 / TM39",9001,4230,16373,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2324,"ED50 / TM42",9001,4230,16374,9807,8801,0.0,9102,8802,42.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2325,"ED50 / TM45",9001,4230,16375,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2326,Hong Kong 1980 Grid System,9001,4611,19978,9807,8801,22.184368,9110,8802,114.10428,9110,8805,1.0,9201,8806,836694.05,9001,8807,819069.8,9001,,,,,,
+2327,"Xian 1980 / Gauss-Kruger zone 13",9001,4610,16213,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,13500000.0,9001,8807,0.0,9001,,,,,,
+2328,"Xian 1980 / Gauss-Kruger zone 14",9001,4610,16214,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,14500000.0,9001,8807,0.0,9001,,,,,,
+2329,"Xian 1980 / Gauss-Kruger zone 15",9001,4610,16215,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,15500000.0,9001,8807,0.0,9001,,,,,,
+2330,"Xian 1980 / Gauss-Kruger zone 16",9001,4610,16216,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,16500000.0,9001,8807,0.0,9001,,,,,,
+2331,"Xian 1980 / Gauss-Kruger zone 17",9001,4610,16217,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,17500000.0,9001,8807,0.0,9001,,,,,,
+2332,"Xian 1980 / Gauss-Kruger zone 18",9001,4610,16218,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,18500000.0,9001,8807,0.0,9001,,,,,,
+2333,"Xian 1980 / Gauss-Kruger zone 19",9001,4610,16219,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,19500000.0,9001,8807,0.0,9001,,,,,,
+2334,"Xian 1980 / Gauss-Kruger zone 20",9001,4610,16220,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,20500000.0,9001,8807,0.0,9001,,,,,,
+2335,"Xian 1980 / Gauss-Kruger zone 21",9001,4610,16221,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,21500000.0,9001,8807,0.0,9001,,,,,,
+2336,"Xian 1980 / Gauss-Kruger zone 22",9001,4610,16222,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,22500000.0,9001,8807,0.0,9001,,,,,,
+2337,"Xian 1980 / Gauss-Kruger zone 23",9001,4610,16223,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,23500000.0,9001,8807,0.0,9001,,,,,,
+2338,"Xian 1980 / Gauss-Kruger CM 75E",9001,4610,16313,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2339,"Xian 1980 / Gauss-Kruger CM 81E",9001,4610,16314,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2340,"Xian 1980 / Gauss-Kruger CM 87E",9001,4610,16315,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2341,"Xian 1980 / Gauss-Kruger CM 93E",9001,4610,16316,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2342,"Xian 1980 / Gauss-Kruger CM 99E",9001,4610,16317,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2343,"Xian 1980 / Gauss-Kruger CM 105E",9001,4610,16318,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2344,"Xian 1980 / Gauss-Kruger CM 111E",9001,4610,16319,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2345,"Xian 1980 / Gauss-Kruger CM 117E",9001,4610,16320,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2346,"Xian 1980 / Gauss-Kruger CM 123E",9001,4610,16321,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2347,"Xian 1980 / Gauss-Kruger CM 129E",9001,4610,16322,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2348,"Xian 1980 / Gauss-Kruger CM 135E",9001,4610,16323,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2349,"Xian 1980 / 3-degree Gauss-Kruger zone 25",9001,4610,16285,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,25500000.0,9001,8807,0.0,9001,,,,,,
+2350,"Xian 1980 / 3-degree Gauss-Kruger zone 26",9001,4610,16286,9807,8801,0.0,9102,8802,78.0,9102,8805,1.0,9201,8806,26500000.0,9001,8807,0.0,9001,,,,,,
+2351,"Xian 1980 / 3-degree Gauss-Kruger zone 27",9001,4610,16287,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,27500000.0,9001,8807,0.0,9001,,,,,,
+2352,"Xian 1980 / 3-degree Gauss-Kruger zone 28",9001,4610,16288,9807,8801,0.0,9102,8802,84.0,9102,8805,1.0,9201,8806,28500000.0,9001,8807,0.0,9001,,,,,,
+2353,"Xian 1980 / 3-degree Gauss-Kruger zone 29",9001,4610,16289,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,29500000.0,9001,8807,0.0,9001,,,,,,
+2354,"Xian 1980 / 3-degree Gauss-Kruger zone 30",9001,4610,16290,9807,8801,0.0,9102,8802,90.0,9102,8805,1.0,9201,8806,30500000.0,9001,8807,0.0,9001,,,,,,
+2355,"Xian 1980 / 3-degree Gauss-Kruger zone 31",9001,4610,16291,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,31500000.0,9001,8807,0.0,9001,,,,,,
+2356,"Xian 1980 / 3-degree Gauss-Kruger zone 32",9001,4610,16292,9807,8801,0.0,9102,8802,96.0,9102,8805,1.0,9201,8806,32500000.0,9001,8807,0.0,9001,,,,,,
+2357,"Xian 1980 / 3-degree Gauss-Kruger zone 33",9001,4610,16293,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,33500000.0,9001,8807,0.0,9001,,,,,,
+2358,"Xian 1980 / 3-degree Gauss-Kruger zone 34",9001,4610,16294,9807,8801,0.0,9102,8802,102.0,9102,8805,1.0,9201,8806,34500000.0,9001,8807,0.0,9001,,,,,,
+2359,"Xian 1980 / 3-degree Gauss-Kruger zone 35",9001,4610,16295,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,35500000.0,9001,8807,0.0,9001,,,,,,
+2360,"Xian 1980 / 3-degree Gauss-Kruger zone 36",9001,4610,16296,9807,8801,0.0,9102,8802,108.0,9102,8805,1.0,9201,8806,36500000.0,9001,8807,0.0,9001,,,,,,
+2361,"Xian 1980 / 3-degree Gauss-Kruger zone 37",9001,4610,16297,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,37500000.0,9001,8807,0.0,9001,,,,,,
+2362,"Xian 1980 / 3-degree Gauss-Kruger zone 38",9001,4610,16298,9807,8801,0.0,9102,8802,114.0,9102,8805,1.0,9201,8806,38500000.0,9001,8807,0.0,9001,,,,,,
+2363,"Xian 1980 / 3-degree Gauss-Kruger zone 39",9001,4610,16299,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,39500000.0,9001,8807,0.0,9001,,,,,,
+2364,"Xian 1980 / 3-degree Gauss-Kruger zone 40",9001,4610,16070,9807,8801,0.0,9102,8802,120.0,9102,8805,1.0,9201,8806,40500000.0,9001,8807,0.0,9001,,,,,,
+2365,"Xian 1980 / 3-degree Gauss-Kruger zone 41",9001,4610,16071,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,41500000.0,9001,8807,0.0,9001,,,,,,
+2366,"Xian 1980 / 3-degree Gauss-Kruger zone 42",9001,4610,16072,9807,8801,0.0,9102,8802,126.0,9102,8805,1.0,9201,8806,42500000.0,9001,8807,0.0,9001,,,,,,
+2367,"Xian 1980 / 3-degree Gauss-Kruger zone 43",9001,4610,16073,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,43500000.0,9001,8807,0.0,9001,,,,,,
+2368,"Xian 1980 / 3-degree Gauss-Kruger zone 44",9001,4610,16074,9807,8801,0.0,9102,8802,132.0,9102,8805,1.0,9201,8806,44500000.0,9001,8807,0.0,9001,,,,,,
+2369,"Xian 1980 / 3-degree Gauss-Kruger zone 45",9001,4610,16075,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,45500000.0,9001,8807,0.0,9001,,,,,,
+2370,"Xian 1980 / 3-degree Gauss-Kruger CM 75E",9001,4610,16385,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2371,"Xian 1980 / 3-degree Gauss-Kruger CM 78E",9001,4610,16386,9807,8801,0.0,9102,8802,78.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2372,"Xian 1980 / 3-degree Gauss-Kruger CM 81E",9001,4610,16387,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2373,"Xian 1980 / 3-degree Gauss-Kruger CM 84E",9001,4610,16388,9807,8801,0.0,9102,8802,84.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2374,"Xian 1980 / 3-degree Gauss-Kruger CM 87E",9001,4610,16389,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2375,"Xian 1980 / 3-degree Gauss-Kruger CM 90E",9001,4610,16390,9807,8801,0.0,9102,8802,90.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2376,"Xian 1980 / 3-degree Gauss-Kruger CM 93E",9001,4610,16391,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2377,"Xian 1980 / 3-degree Gauss-Kruger CM 96E",9001,4610,16392,9807,8801,0.0,9102,8802,96.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2378,"Xian 1980 / 3-degree Gauss-Kruger CM 99E",9001,4610,16393,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2379,"Xian 1980 / 3-degree Gauss-Kruger CM 102E",9001,4610,16394,9807,8801,0.0,9102,8802,102.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2380,"Xian 1980 / 3-degree Gauss-Kruger CM 105E",9001,4610,16395,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2381,"Xian 1980 / 3-degree Gauss-Kruger CM 108E",9001,4610,16396,9807,8801,0.0,9102,8802,108.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2382,"Xian 1980 / 3-degree Gauss-Kruger CM 111E",9001,4610,16397,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2383,"Xian 1980 / 3-degree Gauss-Kruger CM 114E",9001,4610,16398,9807,8801,0.0,9102,8802,114.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2384,"Xian 1980 / 3-degree Gauss-Kruger CM 117E",9001,4610,16399,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2385,"Xian 1980 / 3-degree Gauss-Kruger CM 120E",9001,4610,16170,9807,8801,0.0,9102,8802,120.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2386,"Xian 1980 / 3-degree Gauss-Kruger CM 123E",9001,4610,16171,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2387,"Xian 1980 / 3-degree Gauss-Kruger CM 126E",9001,4610,16172,9807,8801,0.0,9102,8802,126.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2388,"Xian 1980 / 3-degree Gauss-Kruger CM 129E",9001,4610,16173,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2389,"Xian 1980 / 3-degree Gauss-Kruger CM 132E",9001,4610,16174,9807,8801,0.0,9102,8802,132.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2390,"Xian 1980 / 3-degree Gauss-Kruger CM 135E",9001,4610,16175,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2391,"KKJ / Finland zone 1",9001,4123,18191,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+2392,"KKJ / Finland zone 2",9001,4123,18192,9807,8801,0.0,9102,8802,24.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+2393,"KKJ / Finland Uniform Coordinate System",9001,4123,18193,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+2394,"KKJ / Finland zone 4",9001,4123,18194,9807,8801,0.0,9102,8802,30.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+2395,"South Yemen / Gauss-Kruger zone 8",9001,4164,16208,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+2396,"South Yemen / Gauss-Kruger zone 9",9001,4164,16209,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,9500000.0,9001,8807,0.0,9001,,,,,,
+2397,"Pulkovo 1942(83) / Gauss-Kruger zone 3",9001,4178,16263,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+2398,"Pulkovo 1942(83) / Gauss-Kruger zone 4",9001,4178,16264,9807,8801,0.0,9102,8802,12.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+2399,"Pulkovo 1942(83) / Gauss-Kruger zone 5",9001,4178,16265,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+2400,RT90 2.5 gon W,9001,4124,19929,9807,8801,0.0,9110,8802,15.48298,9110,8805,1.0,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+2401,"Beijing 1954 / 3-degree Gauss-Kruger zone 25",9001,4214,16285,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,25500000.0,9001,8807,0.0,9001,,,,,,
+2402,"Beijing 1954 / 3-degree Gauss-Kruger zone 26",9001,4214,16286,9807,8801,0.0,9102,8802,78.0,9102,8805,1.0,9201,8806,26500000.0,9001,8807,0.0,9001,,,,,,
+2403,"Beijing 1954 / 3-degree Gauss-Kruger zone 27",9001,4214,16287,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,27500000.0,9001,8807,0.0,9001,,,,,,
+2404,"Beijing 1954 / 3-degree Gauss-Kruger zone 28",9001,4214,16288,9807,8801,0.0,9102,8802,84.0,9102,8805,1.0,9201,8806,28500000.0,9001,8807,0.0,9001,,,,,,
+2405,"Beijing 1954 / 3-degree Gauss-Kruger zone 29",9001,4214,16289,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,29500000.0,9001,8807,0.0,9001,,,,,,
+2406,"Beijing 1954 / 3-degree Gauss-Kruger zone 30",9001,4214,16290,9807,8801,0.0,9102,8802,90.0,9102,8805,1.0,9201,8806,30500000.0,9001,8807,0.0,9001,,,,,,
+2407,"Beijing 1954 / 3-degree Gauss-Kruger zone 31",9001,4214,16291,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,31500000.0,9001,8807,0.0,9001,,,,,,
+2408,"Beijing 1954 / 3-degree Gauss-Kruger zone 32",9001,4214,16292,9807,8801,0.0,9102,8802,96.0,9102,8805,1.0,9201,8806,32500000.0,9001,8807,0.0,9001,,,,,,
+2409,"Beijing 1954 / 3-degree Gauss-Kruger zone 33",9001,4214,16293,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,33500000.0,9001,8807,0.0,9001,,,,,,
+2410,"Beijing 1954 / 3-degree Gauss-Kruger zone 34",9001,4214,16294,9807,8801,0.0,9102,8802,102.0,9102,8805,1.0,9201,8806,34500000.0,9001,8807,0.0,9001,,,,,,
+2411,"Beijing 1954 / 3-degree Gauss-Kruger zone 35",9001,4214,16295,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,35500000.0,9001,8807,0.0,9001,,,,,,
+2412,"Beijing 1954 / 3-degree Gauss-Kruger zone 36",9001,4214,16296,9807,8801,0.0,9102,8802,108.0,9102,8805,1.0,9201,8806,36500000.0,9001,8807,0.0,9001,,,,,,
+2413,"Beijing 1954 / 3-degree Gauss-Kruger zone 37",9001,4214,16297,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,37500000.0,9001,8807,0.0,9001,,,,,,
+2414,"Beijing 1954 / 3-degree Gauss-Kruger zone 38",9001,4214,16298,9807,8801,0.0,9102,8802,114.0,9102,8805,1.0,9201,8806,38500000.0,9001,8807,0.0,9001,,,,,,
+2415,"Beijing 1954 / 3-degree Gauss-Kruger zone 39",9001,4214,16299,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,39500000.0,9001,8807,0.0,9001,,,,,,
+2416,"Beijing 1954 / 3-degree Gauss-Kruger zone 40",9001,4214,16070,9807,8801,0.0,9102,8802,120.0,9102,8805,1.0,9201,8806,40500000.0,9001,8807,0.0,9001,,,,,,
+2417,"Beijing 1954 / 3-degree Gauss-Kruger zone 41",9001,4214,16071,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,41500000.0,9001,8807,0.0,9001,,,,,,
+2418,"Beijing 1954 / 3-degree Gauss-Kruger zone 42",9001,4214,16072,9807,8801,0.0,9102,8802,126.0,9102,8805,1.0,9201,8806,42500000.0,9001,8807,0.0,9001,,,,,,
+2419,"Beijing 1954 / 3-degree Gauss-Kruger zone 43",9001,4214,16073,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,43500000.0,9001,8807,0.0,9001,,,,,,
+2420,"Beijing 1954 / 3-degree Gauss-Kruger zone 44",9001,4214,16074,9807,8801,0.0,9102,8802,132.0,9102,8805,1.0,9201,8806,44500000.0,9001,8807,0.0,9001,,,,,,
+2421,"Beijing 1954 / 3-degree Gauss-Kruger zone 45",9001,4214,16075,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,45500000.0,9001,8807,0.0,9001,,,,,,
+2422,"Beijing 1954 / 3-degree Gauss-Kruger CM 75E",9001,4214,16385,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2423,"Beijing 1954 / 3-degree Gauss-Kruger CM 78E",9001,4214,16386,9807,8801,0.0,9102,8802,78.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2424,"Beijing 1954 / 3-degree Gauss-Kruger CM 81E",9001,4214,16387,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2425,"Beijing 1954 / 3-degree Gauss-Kruger CM 84E",9001,4214,16388,9807,8801,0.0,9102,8802,84.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2426,"Beijing 1954 / 3-degree Gauss-Kruger CM 87E",9001,4214,16389,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2427,"Beijing 1954 / 3-degree Gauss-Kruger CM 90E",9001,4214,16390,9807,8801,0.0,9102,8802,90.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2428,"Beijing 1954 / 3-degree Gauss-Kruger CM 93E",9001,4214,16391,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2429,"Beijing 1954 / 3-degree Gauss-Kruger CM 96E",9001,4214,16392,9807,8801,0.0,9102,8802,96.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2430,"Beijing 1954 / 3-degree Gauss-Kruger CM 99E",9001,4214,16393,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2431,"Beijing 1954 / 3-degree Gauss-Kruger CM 102E",9001,4214,16394,9807,8801,0.0,9102,8802,102.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2432,"Beijing 1954 / 3-degree Gauss-Kruger CM 105E",9001,4214,16395,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2433,"Beijing 1954 / 3-degree Gauss-Kruger CM 108E",9001,4214,16396,9807,8801,0.0,9102,8802,108.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2434,"Beijing 1954 / 3-degree Gauss-Kruger CM 111E",9001,4214,16397,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2435,"Beijing 1954 / 3-degree Gauss-Kruger CM 114E",9001,4214,16398,9807,8801,0.0,9102,8802,114.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2436,"Beijing 1954 / 3-degree Gauss-Kruger CM 117E",9001,4214,16399,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2437,"Beijing 1954 / 3-degree Gauss-Kruger CM 120E",9001,4214,16170,9807,8801,0.0,9102,8802,120.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2438,"Beijing 1954 / 3-degree Gauss-Kruger CM 123E",9001,4214,16171,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2439,"Beijing 1954 / 3-degree Gauss-Kruger CM 126E",9001,4214,16172,9807,8801,0.0,9102,8802,126.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2440,"Beijing 1954 / 3-degree Gauss-Kruger CM 129E",9001,4214,16173,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2441,"Beijing 1954 / 3-degree Gauss-Kruger CM 132E",9001,4214,16174,9807,8801,0.0,9102,8802,132.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2442,"Beijing 1954 / 3-degree Gauss-Kruger CM 135E",9001,4214,16175,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2443,"JGD2000 / Japan Plane Rectangular CS I",9001,4612,17801,9807,8801,33.0,9110,8802,129.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2444,"JGD2000 / Japan Plane Rectangular CS II",9001,4612,17802,9807,8801,33.0,9110,8802,131.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2445,"JGD2000 / Japan Plane Rectangular CS III",9001,4612,17803,9807,8801,36.0,9110,8802,132.1,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2446,"JGD2000 / Japan Plane Rectangular CS IV",9001,4612,17804,9807,8801,33.0,9110,8802,133.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2447,"JGD2000 / Japan Plane Rectangular CS V",9001,4612,17805,9807,8801,36.0,9110,8802,134.2,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2448,"JGD2000 / Japan Plane Rectangular CS VI",9001,4612,17806,9807,8801,36.0,9110,8802,136.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2449,"JGD2000 / Japan Plane Rectangular CS VII",9001,4612,17807,9807,8801,36.0,9110,8802,137.1,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2450,"JGD2000 / Japan Plane Rectangular CS VIII",9001,4612,17808,9807,8801,36.0,9110,8802,138.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2451,"JGD2000 / Japan Plane Rectangular CS IX",9001,4612,17809,9807,8801,36.0,9110,8802,139.5,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2452,"JGD2000 / Japan Plane Rectangular CS X",9001,4612,17810,9807,8801,40.0,9110,8802,140.5,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2453,"JGD2000 / Japan Plane Rectangular CS XI",9001,4612,17811,9807,8801,44.0,9110,8802,140.15,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2454,"JGD2000 / Japan Plane Rectangular CS XII",9001,4612,17812,9807,8801,44.0,9110,8802,142.15,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2455,"JGD2000 / Japan Plane Rectangular CS XIII",9001,4612,17813,9807,8801,44.0,9110,8802,144.15,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2456,"JGD2000 / Japan Plane Rectangular CS XIV",9001,4612,17814,9807,8801,26.0,9110,8802,142.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2457,"JGD2000 / Japan Plane Rectangular CS XV",9001,4612,17815,9807,8801,26.0,9110,8802,127.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2458,"JGD2000 / Japan Plane Rectangular CS XVI",9001,4612,17816,9807,8801,26.0,9110,8802,124.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2459,"JGD2000 / Japan Plane Rectangular CS XVII",9001,4612,17817,9807,8801,26.0,9110,8802,131.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2460,"JGD2000 / Japan Plane Rectangular CS XVIII",9001,4612,17818,9807,8801,20.0,9110,8802,136.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2461,"JGD2000 / Japan Plane Rectangular CS XIX",9001,4612,17819,9807,8801,26.0,9110,8802,154.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+2462,"Albanian 1987 / Gauss-Kruger zone 4",9001,4191,16204,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+2463,"Pulkovo 1995 / Gauss-Kruger CM 21E",9001,4200,16304,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2464,"Pulkovo 1995 / Gauss-Kruger CM 27E",9001,4200,16305,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2465,"Pulkovo 1995 / Gauss-Kruger CM 33E",9001,4200,16306,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2466,"Pulkovo 1995 / Gauss-Kruger CM 39E",9001,4200,16307,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2467,"Pulkovo 1995 / Gauss-Kruger CM 45E",9001,4200,16308,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2468,"Pulkovo 1995 / Gauss-Kruger CM 51E",9001,4200,16309,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2469,"Pulkovo 1995 / Gauss-Kruger CM 57E",9001,4200,16310,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2470,"Pulkovo 1995 / Gauss-Kruger CM 63E",9001,4200,16311,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2471,"Pulkovo 1995 / Gauss-Kruger CM 69E",9001,4200,16312,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2472,"Pulkovo 1995 / Gauss-Kruger CM 75E",9001,4200,16313,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2473,"Pulkovo 1995 / Gauss-Kruger CM 81E",9001,4200,16314,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2474,"Pulkovo 1995 / Gauss-Kruger CM 87E",9001,4200,16315,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2475,"Pulkovo 1995 / Gauss-Kruger CM 93E",9001,4200,16316,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2476,"Pulkovo 1995 / Gauss-Kruger CM 99E",9001,4200,16317,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2477,"Pulkovo 1995 / Gauss-Kruger CM 105E",9001,4200,16318,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2478,"Pulkovo 1995 / Gauss-Kruger CM 111E",9001,4200,16319,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2479,"Pulkovo 1995 / Gauss-Kruger CM 117E",9001,4200,16320,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2480,"Pulkovo 1995 / Gauss-Kruger CM 123E",9001,4200,16321,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2481,"Pulkovo 1995 / Gauss-Kruger CM 129E",9001,4200,16322,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2482,"Pulkovo 1995 / Gauss-Kruger CM 135E",9001,4200,16323,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2483,"Pulkovo 1995 / Gauss-Kruger CM 141E",9001,4200,16324,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2484,"Pulkovo 1995 / Gauss-Kruger CM 147E",9001,4200,16325,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2485,"Pulkovo 1995 / Gauss-Kruger CM 153E",9001,4200,16326,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2486,"Pulkovo 1995 / Gauss-Kruger CM 159E",9001,4200,16327,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2487,"Pulkovo 1995 / Gauss-Kruger CM 165E",9001,4200,16328,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2488,"Pulkovo 1995 / Gauss-Kruger CM 171E",9001,4200,16329,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2489,"Pulkovo 1995 / Gauss-Kruger CM 177E",9001,4200,16330,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2490,"Pulkovo 1995 / Gauss-Kruger CM 177W",9001,4200,16331,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2491,"Pulkovo 1995 / Gauss-Kruger CM 171W",9001,4200,16332,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2492,"Pulkovo 1942 / Gauss-Kruger CM 9E",9001,4284,16302,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2493,"Pulkovo 1942 / Gauss-Kruger CM 15E",9001,4284,16303,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2494,"Pulkovo 1942 / Gauss-Kruger CM 21E",9001,4284,16304,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2495,"Pulkovo 1942 / Gauss-Kruger CM 27E",9001,4284,16305,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2496,"Pulkovo 1942 / Gauss-Kruger CM 33E",9001,4284,16306,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2497,"Pulkovo 1942 / Gauss-Kruger CM 39E",9001,4284,16307,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2498,"Pulkovo 1942 / Gauss-Kruger CM 45E",9001,4284,16308,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2499,"Pulkovo 1942 / Gauss-Kruger CM 51E",9001,4284,16309,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2500,"Pulkovo 1942 / Gauss-Kruger CM 57E",9001,4284,16310,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2501,"Pulkovo 1942 / Gauss-Kruger CM 63E",9001,4284,16311,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2502,"Pulkovo 1942 / Gauss-Kruger CM 69E",9001,4284,16312,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2503,"Pulkovo 1942 / Gauss-Kruger CM 75E",9001,4284,16313,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2504,"Pulkovo 1942 / Gauss-Kruger CM 81E",9001,4284,16314,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2505,"Pulkovo 1942 / Gauss-Kruger CM 87E",9001,4284,16315,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2506,"Pulkovo 1942 / Gauss-Kruger CM 93E",9001,4284,16316,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2507,"Pulkovo 1942 / Gauss-Kruger CM 99E",9001,4284,16317,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2508,"Pulkovo 1942 / Gauss-Kruger CM 105E",9001,4284,16318,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2509,"Pulkovo 1942 / Gauss-Kruger CM 111E",9001,4284,16319,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2510,"Pulkovo 1942 / Gauss-Kruger CM 117E",9001,4284,16320,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2511,"Pulkovo 1942 / Gauss-Kruger CM 123E",9001,4284,16321,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2512,"Pulkovo 1942 / Gauss-Kruger CM 129E",9001,4284,16322,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2513,"Pulkovo 1942 / Gauss-Kruger CM 135E",9001,4284,16323,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2514,"Pulkovo 1942 / Gauss-Kruger CM 141E",9001,4284,16324,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2515,"Pulkovo 1942 / Gauss-Kruger CM 147E",9001,4284,16325,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2516,"Pulkovo 1942 / Gauss-Kruger CM 153E",9001,4284,16326,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2517,"Pulkovo 1942 / Gauss-Kruger CM 159E",9001,4284,16327,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2518,"Pulkovo 1942 / Gauss-Kruger CM 165E",9001,4284,16328,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2519,"Pulkovo 1942 / Gauss-Kruger CM 171E",9001,4284,16329,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2520,"Pulkovo 1942 / Gauss-Kruger CM 177E",9001,4284,16330,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2521,"Pulkovo 1942 / Gauss-Kruger CM 177W",9001,4284,16331,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2522,"Pulkovo 1942 / Gauss-Kruger CM 171W",9001,4284,16332,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2523,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 7",9001,4284,16267,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+2524,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 8",9001,4284,16268,9807,8801,0.0,9102,8802,24.0,9102,8805,1.0,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+2525,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 9",9001,4284,16269,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,9500000.0,9001,8807,0.0,9001,,,,,,
+2526,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 10",9001,4284,16270,9807,8801,0.0,9102,8802,30.0,9102,8805,1.0,9201,8806,10500000.0,9001,8807,0.0,9001,,,,,,
+2527,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 11",9001,4284,16271,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,11500000.0,9001,8807,0.0,9001,,,,,,
+2528,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 12",9001,4284,16272,9807,8801,0.0,9102,8802,36.0,9102,8805,1.0,9201,8806,12500000.0,9001,8807,0.0,9001,,,,,,
+2529,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 13",9001,4284,16273,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,13500000.0,9001,8807,0.0,9001,,,,,,
+2530,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 14",9001,4284,16274,9807,8801,0.0,9102,8802,42.0,9102,8805,1.0,9201,8806,14500000.0,9001,8807,0.0,9001,,,,,,
+2531,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 15",9001,4284,16275,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,15500000.0,9001,8807,0.0,9001,,,,,,
+2532,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 16",9001,4284,16276,9807,8801,0.0,9102,8802,48.0,9102,8805,1.0,9201,8806,16500000.0,9001,8807,0.0,9001,,,,,,
+2533,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 17",9001,4284,16277,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,17500000.0,9001,8807,0.0,9001,,,,,,
+2534,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 18",9001,4284,16278,9807,8801,0.0,9102,8802,54.0,9102,8805,1.0,9201,8806,18500000.0,9001,8807,0.0,9001,,,,,,
+2535,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 19",9001,4284,16279,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,19500000.0,9001,8807,0.0,9001,,,,,,
+2536,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 20",9001,4284,16280,9807,8801,0.0,9102,8802,60.0,9102,8805,1.0,9201,8806,20500000.0,9001,8807,0.0,9001,,,,,,
+2537,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 21",9001,4284,16281,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,21500000.0,9001,8807,0.0,9001,,,,,,
+2538,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 22",9001,4284,16282,9807,8801,0.0,9102,8802,66.0,9102,8805,1.0,9201,8806,22500000.0,9001,8807,0.0,9001,,,,,,
+2539,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 23",9001,4284,16283,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,23500000.0,9001,8807,0.0,9001,,,,,,
+2540,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 24",9001,4284,16284,9807,8801,0.0,9102,8802,72.0,9102,8805,1.0,9201,8806,24500000.0,9001,8807,0.0,9001,,,,,,
+2541,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 25",9001,4284,16285,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,25500000.0,9001,8807,0.0,9001,,,,,,
+2542,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 26",9001,4284,16286,9807,8801,0.0,9102,8802,78.0,9102,8805,1.0,9201,8806,26500000.0,9001,8807,0.0,9001,,,,,,
+2543,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 27",9001,4284,16287,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,27500000.0,9001,8807,0.0,9001,,,,,,
+2544,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 28",9001,4284,16288,9807,8801,0.0,9102,8802,84.0,9102,8805,1.0,9201,8806,28500000.0,9001,8807,0.0,9001,,,,,,
+2545,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 29",9001,4284,16289,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,29500000.0,9001,8807,0.0,9001,,,,,,
+2546,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 30",9001,4284,16290,9807,8801,0.0,9102,8802,90.0,9102,8805,1.0,9201,8806,30500000.0,9001,8807,0.0,9001,,,,,,
+2547,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 31",9001,4284,16291,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,31500000.0,9001,8807,0.0,9001,,,,,,
+2548,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 32",9001,4284,16292,9807,8801,0.0,9102,8802,96.0,9102,8805,1.0,9201,8806,32500000.0,9001,8807,0.0,9001,,,,,,
+2549,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 33",9001,4284,16293,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,33500000.0,9001,8807,0.0,9001,,,,,,
+2550,"Samboja / UTM zone 50S",9001,4125,16150,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2551,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 34",9001,4284,16294,9807,8801,0.0,9102,8802,102.0,9102,8805,1.0,9201,8806,34500000.0,9001,8807,0.0,9001,,,,,,
+2552,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 35",9001,4284,16295,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,35500000.0,9001,8807,0.0,9001,,,,,,
+2553,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 36",9001,4284,16296,9807,8801,0.0,9102,8802,108.0,9102,8805,1.0,9201,8806,36500000.0,9001,8807,0.0,9001,,,,,,
+2554,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 37",9001,4284,16297,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,37500000.0,9001,8807,0.0,9001,,,,,,
+2555,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 38",9001,4284,16298,9807,8801,0.0,9102,8802,114.0,9102,8805,1.0,9201,8806,38500000.0,9001,8807,0.0,9001,,,,,,
+2556,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 39",9001,4284,16299,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,39500000.0,9001,8807,0.0,9001,,,,,,
+2557,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 40",9001,4284,16070,9807,8801,0.0,9102,8802,120.0,9102,8805,1.0,9201,8806,40500000.0,9001,8807,0.0,9001,,,,,,
+2558,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 41",9001,4284,16071,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,41500000.0,9001,8807,0.0,9001,,,,,,
+2559,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 42",9001,4284,16072,9807,8801,0.0,9102,8802,126.0,9102,8805,1.0,9201,8806,42500000.0,9001,8807,0.0,9001,,,,,,
+2560,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 43",9001,4284,16073,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,43500000.0,9001,8807,0.0,9001,,,,,,
+2561,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 44",9001,4284,16074,9807,8801,0.0,9102,8802,132.0,9102,8805,1.0,9201,8806,44500000.0,9001,8807,0.0,9001,,,,,,
+2562,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 45",9001,4284,16075,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,45500000.0,9001,8807,0.0,9001,,,,,,
+2563,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 46",9001,4284,16076,9807,8801,0.0,9102,8802,138.0,9102,8805,1.0,9201,8806,46500000.0,9001,8807,0.0,9001,,,,,,
+2564,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 47",9001,4284,16077,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,47500000.0,9001,8807,0.0,9001,,,,,,
+2565,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 48",9001,4284,16078,9807,8801,0.0,9102,8802,144.0,9102,8805,1.0,9201,8806,48500000.0,9001,8807,0.0,9001,,,,,,
+2566,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 49",9001,4284,16079,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,49500000.0,9001,8807,0.0,9001,,,,,,
+2567,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 50",9001,4284,16080,9807,8801,0.0,9102,8802,150.0,9102,8805,1.0,9201,8806,50500000.0,9001,8807,0.0,9001,,,,,,
+2568,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 51",9001,4284,16081,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,51500000.0,9001,8807,0.0,9001,,,,,,
+2569,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 52",9001,4284,16082,9807,8801,0.0,9102,8802,156.0,9102,8805,1.0,9201,8806,52500000.0,9001,8807,0.0,9001,,,,,,
+2570,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 53",9001,4284,16083,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,53500000.0,9001,8807,0.0,9001,,,,,,
+2571,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 54",9001,4284,16084,9807,8801,0.0,9102,8802,162.0,9102,8805,1.0,9201,8806,54500000.0,9001,8807,0.0,9001,,,,,,
+2572,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 55",9001,4284,16085,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,55500000.0,9001,8807,0.0,9001,,,,,,
+2573,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 56",9001,4284,16086,9807,8801,0.0,9102,8802,168.0,9102,8805,1.0,9201,8806,56500000.0,9001,8807,0.0,9001,,,,,,
+2574,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 57",9001,4284,16087,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,57500000.0,9001,8807,0.0,9001,,,,,,
+2575,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 58",9001,4284,16088,9807,8801,0.0,9102,8802,174.0,9102,8805,1.0,9201,8806,58500000.0,9001,8807,0.0,9001,,,,,,
+2576,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 59",9001,4284,16089,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,59500000.0,9001,8807,0.0,9001,,,,,,
+2577,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 60",9001,4284,16090,9807,8801,0.0,9102,8802,180.0,9102,8805,1.0,9201,8806,60000000.0,9001,8807,0.0,9001,,,,,,
+2578,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 61",9001,4284,16091,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,61500000.0,9001,8807,0.0,9001,,,,,,
+2579,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 62",9001,4284,16092,9807,8801,0.0,9102,8802,-174.0,9102,8805,1.0,9201,8806,62500000.0,9001,8807,0.0,9001,,,,,,
+2580,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 63",9001,4284,16093,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,63500000.0,9001,8807,0.0,9001,,,,,,
+2581,"Pulkovo 1942 / 3-degree Gauss-Kruger zone 64",9001,4284,16094,9807,8801,0.0,9102,8802,-168.0,9102,8805,1.0,9201,8806,64500000.0,9001,8807,0.0,9001,,,,,,
+2582,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E",9001,4284,16367,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2583,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E",9001,4284,16368,9807,8801,0.0,9102,8802,24.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2584,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E",9001,4284,16369,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2585,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E",9001,4284,16370,9807,8801,0.0,9102,8802,30.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2586,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E",9001,4284,16371,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2587,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E",9001,4284,16372,9807,8801,0.0,9102,8802,36.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2588,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E",9001,4284,16373,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2589,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E",9001,4284,16374,9807,8801,0.0,9102,8802,42.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2590,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E",9001,4284,16375,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2591,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E",9001,4284,16376,9807,8801,0.0,9102,8802,48.0,9102,8805,1.0,9001,8806,500000.0,9001,8807,0.0,9201,,,,,,
+2592,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E",9001,4284,16377,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2593,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E",9001,4284,16378,9807,8801,0.0,9102,8802,54.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2594,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E",9001,4284,16379,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2595,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E",9001,4284,16380,9807,8801,0.0,9102,8802,60.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2596,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E",9001,4284,16381,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2597,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E",9001,4284,16382,9807,8801,0.0,9102,8802,66.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2598,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E",9001,4284,16383,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2599,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E",9001,4284,16384,9807,8801,0.0,9102,8802,72.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2600,Lietuvos Koordinoei Sistema 1994,9001,4126,19934,9807,8801,0.0,9102,8802,24.0,9102,8805,0.9998,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2601,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E",9001,4284,16385,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2602,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E",9001,4284,16386,9807,8801,0.0,9102,8802,78.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2603,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E",9001,4284,16387,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2604,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E",9001,4284,16388,9807,8801,0.0,9102,8802,84.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2605,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E",9001,4284,16389,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2606,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E",9001,4284,16390,9807,8801,0.0,9102,8802,90.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2607,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E",9001,4284,16391,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2608,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E",9001,4284,16392,9807,8801,0.0,9102,8802,96.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2609,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E",9001,4284,16393,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2610,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E",9001,4284,16394,9807,8801,0.0,9102,8802,102.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2611,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E",9001,4284,16395,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2612,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E",9001,4284,16396,9807,8801,0.0,9102,8802,108.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2613,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E",9001,4284,16397,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2614,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E",9001,4284,16398,9807,8801,0.0,9102,8802,114.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2615,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E",9001,4284,16399,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2616,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E",9001,4284,16170,9807,8801,0.0,9102,8802,120.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2617,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E",9001,4284,16171,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2618,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E",9001,4284,16172,9807,8801,0.0,9102,8802,126.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2619,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E",9001,4284,16173,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2620,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E",9001,4284,16174,9807,8801,0.0,9102,8802,132.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2621,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E",9001,4284,16175,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2622,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E",9001,4284,16176,9807,8801,0.0,9102,8802,138.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2623,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E",9001,4284,16177,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2624,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E",9001,4284,16178,9807,8801,0.0,9102,8802,144.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2625,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E",9001,4284,16179,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2626,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E",9001,4284,16180,9807,8801,0.0,9102,8802,150.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2627,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E",9001,4284,16181,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2628,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E",9001,4284,16182,9807,8801,0.0,9102,8802,156.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2629,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E",9001,4284,16183,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2630,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E",9001,4284,16184,9807,8801,0.0,9102,8802,162.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2631,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E",9001,4284,16185,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2632,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E",9001,4284,16186,9807,8801,0.0,9102,8802,168.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2633,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E",9001,4284,16187,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2634,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E",9001,4284,16188,9807,8801,0.0,9102,8802,174.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2635,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E",9001,4284,16189,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2636,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E",9001,4284,16190,9807,8801,0.0,9102,8802,180.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2637,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W",9001,4284,16191,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2638,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W",9001,4284,16192,9807,8801,0.0,9102,8802,-174.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2639,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W",9001,4284,16193,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2640,"Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W",9001,4284,16194,9807,8801,0.0,9102,8802,-168.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2641,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 7",9001,4284,16267,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+2642,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 8",9001,4284,16268,9807,8801,0.0,9102,8802,24.0,9102,8805,1.0,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+2643,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 9",9001,4284,16269,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,9500000.0,9001,8807,0.0,9001,,,,,,
+2644,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 10",9001,4284,16270,9807,8801,0.0,9102,8802,30.0,9102,8805,1.0,9201,8806,10500000.0,9001,8807,0.0,9001,,,,,,
+2645,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 11",9001,4284,16271,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,11500000.0,9001,8807,0.0,9001,,,,,,
+2646,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 12",9001,4284,16272,9807,8801,0.0,9102,8802,36.0,9102,8805,1.0,9201,8806,12500000.0,9001,8807,0.0,9001,,,,,,
+2647,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 13",9001,4284,16273,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,13500000.0,9001,8807,0.0,9001,,,,,,
+2648,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 14",9001,4284,16274,9807,8801,0.0,9102,8802,42.0,9102,8805,1.0,9201,8806,14500000.0,9001,8807,0.0,9001,,,,,,
+2649,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 15",9001,4284,16275,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,15500000.0,9001,8807,0.0,9001,,,,,,
+2650,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 16",9001,4284,16276,9807,8801,0.0,9102,8802,48.0,9102,8805,1.0,9201,8806,16500000.0,9001,8807,0.0,9001,,,,,,
+2651,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 17",9001,4284,16277,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,17500000.0,9001,8807,0.0,9001,,,,,,
+2652,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 18",9001,4284,16278,9807,8801,0.0,9102,8802,54.0,9102,8805,1.0,9201,8806,18500000.0,9001,8807,0.0,9001,,,,,,
+2653,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 19",9001,4284,16279,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,19500000.0,9001,8807,0.0,9001,,,,,,
+2654,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 20",9001,4284,16280,9807,8801,0.0,9102,8802,60.0,9102,8805,1.0,9201,8806,20500000.0,9001,8807,0.0,9001,,,,,,
+2655,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 21",9001,4284,16281,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,21500000.0,9001,8807,0.0,9001,,,,,,
+2656,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 22",9001,4284,16282,9807,8801,0.0,9102,8802,66.0,9102,8805,1.0,9201,8806,22500000.0,9001,8807,0.0,9001,,,,,,
+2657,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 23",9001,4284,16283,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,23500000.0,9001,8807,0.0,9001,,,,,,
+2658,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 24",9001,4284,16284,9807,8801,0.0,9102,8802,72.0,9102,8805,1.0,9201,8806,24500000.0,9001,8807,0.0,9001,,,,,,
+2659,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 25",9001,4284,16285,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,25500000.0,9001,8807,0.0,9001,,,,,,
+2660,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 26",9001,4284,16286,9807,8801,0.0,9102,8802,78.0,9102,8805,1.0,9201,8806,26500000.0,9001,8807,0.0,9001,,,,,,
+2661,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 27",9001,4284,16287,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,27500000.0,9001,8807,0.0,9001,,,,,,
+2662,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 28",9001,4284,16288,9807,8801,0.0,9102,8802,84.0,9102,8805,1.0,9201,8806,28500000.0,9001,8807,0.0,9001,,,,,,
+2663,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 29",9001,4284,16289,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,29500000.0,9001,8807,0.0,9001,,,,,,
+2664,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 30",9001,4284,16290,9807,8801,0.0,9102,8802,90.0,9102,8805,1.0,9201,8806,30500000.0,9001,8807,0.0,9001,,,,,,
+2665,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 31",9001,4284,16291,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,31500000.0,9001,8807,0.0,9001,,,,,,
+2666,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 32",9001,4284,16292,9807,8801,0.0,9102,8802,96.0,9102,8805,1.0,9201,8806,32500000.0,9001,8807,0.0,9001,,,,,,
+2667,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 33",9001,4284,16293,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,33500000.0,9001,8807,0.0,9001,,,,,,
+2668,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 34",9001,4284,16294,9807,8801,0.0,9102,8802,102.0,9102,8805,1.0,9201,8806,34500000.0,9001,8807,0.0,9001,,,,,,
+2669,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 35",9001,4284,16295,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,35500000.0,9001,8807,0.0,9001,,,,,,
+2670,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 36",9001,4284,16296,9807,8801,0.0,9102,8802,108.0,9102,8805,1.0,9201,8806,36500000.0,9001,8807,0.0,9001,,,,,,
+2671,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 37",9001,4284,16297,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,37500000.0,9001,8807,0.0,9001,,,,,,
+2672,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 38",9001,4284,16298,9807,8801,0.0,9102,8802,114.0,9102,8805,1.0,9201,8806,38500000.0,9001,8807,0.0,9001,,,,,,
+2673,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 39",9001,4284,16299,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,39500000.0,9001,8807,0.0,9001,,,,,,
+2674,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 40",9001,4284,16070,9807,8801,0.0,9102,8802,120.0,9102,8805,1.0,9201,8806,40500000.0,9001,8807,0.0,9001,,,,,,
+2675,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 41",9001,4284,16071,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,41500000.0,9001,8807,0.0,9001,,,,,,
+2676,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 42",9001,4284,16072,9807,8801,0.0,9102,8802,126.0,9102,8805,1.0,9201,8806,42500000.0,9001,8807,0.0,9001,,,,,,
+2677,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 43",9001,4284,16073,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,43500000.0,9001,8807,0.0,9001,,,,,,
+2678,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 44",9001,4284,16074,9807,8801,0.0,9102,8802,132.0,9102,8805,1.0,9201,8806,44500000.0,9001,8807,0.0,9001,,,,,,
+2679,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 45",9001,4284,16075,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,45500000.0,9001,8807,0.0,9001,,,,,,
+2680,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 46",9001,4284,16076,9807,8801,0.0,9102,8802,138.0,9102,8805,1.0,9201,8806,46500000.0,9001,8807,0.0,9001,,,,,,
+2681,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 47",9001,4284,16077,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,47500000.0,9001,8807,0.0,9001,,,,,,
+2682,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 48",9001,4284,16078,9807,8801,0.0,9102,8802,144.0,9102,8805,1.0,9201,8806,48500000.0,9001,8807,0.0,9001,,,,,,
+2683,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 49",9001,4284,16079,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,49500000.0,9001,8807,0.0,9001,,,,,,
+2684,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 50",9001,4284,16080,9807,8801,0.0,9102,8802,150.0,9102,8805,1.0,9201,8806,50500000.0,9001,8807,0.0,9001,,,,,,
+2685,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 51",9001,4284,16081,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,51500000.0,9001,8807,0.0,9001,,,,,,
+2686,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 52",9001,4284,16082,9807,8801,0.0,9102,8802,156.0,9102,8805,1.0,9201,8806,52500000.0,9001,8807,0.0,9001,,,,,,
+2687,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 53",9001,4284,16083,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,53500000.0,9001,8807,0.0,9001,,,,,,
+2688,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 54",9001,4284,16084,9807,8801,0.0,9102,8802,162.0,9102,8805,1.0,9201,8806,54500000.0,9001,8807,0.0,9001,,,,,,
+2689,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 55",9001,4284,16085,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,55500000.0,9001,8807,0.0,9001,,,,,,
+2690,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 56",9001,4284,16086,9807,8801,0.0,9102,8802,168.0,9102,8805,1.0,9201,8806,56500000.0,9001,8807,0.0,9001,,,,,,
+2691,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 57",9001,4284,16087,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,57500000.0,9001,8807,0.0,9001,,,,,,
+2692,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 58",9001,4284,16088,9807,8801,0.0,9102,8802,174.0,9102,8805,1.0,9201,8806,58500000.0,9001,8807,0.0,9001,,,,,,
+2693,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 59",9001,4284,16089,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,59500000.0,9001,8807,0.0,9001,,,,,,
+2694,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 60",9001,4284,16090,9807,8801,0.0,9102,8802,180.0,9102,8805,1.0,9201,8806,60000000.0,9001,8807,0.0,9001,,,,,,
+2695,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 61",9001,4284,16091,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,61500000.0,9001,8807,0.0,9001,,,,,,
+2696,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 62",9001,4284,16092,9807,8801,0.0,9102,8802,-174.0,9102,8805,1.0,9201,8806,62500000.0,9001,8807,0.0,9001,,,,,,
+2697,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 63",9001,4284,16093,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,63500000.0,9001,8807,0.0,9001,,,,,,
+2698,"Pulkovo 1995 / 3-degree Gauss-Kruger zone 64",9001,4284,16094,9807,8801,0.0,9102,8802,-168.0,9102,8805,1.0,9201,8806,64500000.0,9001,8807,0.0,9001,,,,,,
+2699,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E",9001,4284,16367,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2700,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E",9001,4284,16368,9807,8801,0.0,9102,8802,24.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2701,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E",9001,4284,16369,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2702,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E",9001,4284,16370,9807,8801,0.0,9102,8802,30.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2703,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E",9001,4284,16371,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2704,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E",9001,4284,16372,9807,8801,0.0,9102,8802,36.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2705,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E",9001,4284,16373,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2706,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E",9001,4284,16374,9807,8801,0.0,9102,8802,42.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2707,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E",9001,4284,16375,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2708,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E",9001,4284,16376,9807,8801,0.0,9102,8802,48.0,9102,8805,1.0,9001,8806,500000.0,9001,8807,0.0,9201,,,,,,
+2709,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E",9001,4284,16377,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2710,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E",9001,4284,16378,9807,8801,0.0,9102,8802,54.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2711,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E",9001,4284,16379,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2712,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E",9001,4284,16380,9807,8801,0.0,9102,8802,60.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2713,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E",9001,4284,16381,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2714,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E",9001,4284,16382,9807,8801,0.0,9102,8802,66.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2715,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E",9001,4284,16383,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2716,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E",9001,4284,16384,9807,8801,0.0,9102,8802,72.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2717,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E",9001,4284,16385,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2718,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E",9001,4284,16386,9807,8801,0.0,9102,8802,78.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2719,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E",9001,4284,16387,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2720,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E",9001,4284,16388,9807,8801,0.0,9102,8802,84.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2721,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E",9001,4284,16389,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2722,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E",9001,4284,16390,9807,8801,0.0,9102,8802,90.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2723,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E",9001,4284,16391,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2724,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E",9001,4284,16392,9807,8801,0.0,9102,8802,96.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2725,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E",9001,4284,16393,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2726,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E",9001,4284,16394,9807,8801,0.0,9102,8802,102.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2727,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E",9001,4284,16395,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2728,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E",9001,4284,16396,9807,8801,0.0,9102,8802,108.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2729,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E",9001,4284,16397,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2730,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E",9001,4284,16398,9807,8801,0.0,9102,8802,114.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2731,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E",9001,4284,16399,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2732,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E",9001,4284,16170,9807,8801,0.0,9102,8802,120.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2733,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E",9001,4284,16171,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2734,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E",9001,4284,16172,9807,8801,0.0,9102,8802,126.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2735,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E",9001,4284,16173,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2736,"Tete / UTM zone 36S",9001,4127,16136,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2737,"Tete / UTM zone 37S",9001,4127,16137,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2738,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E",9001,4284,16174,9807,8801,0.0,9102,8802,132.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2739,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E",9001,4284,16175,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2740,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E",9001,4284,16176,9807,8801,0.0,9102,8802,138.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2741,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E",9001,4284,16177,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2742,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E",9001,4284,16178,9807,8801,0.0,9102,8802,144.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2743,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E",9001,4284,16179,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2744,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E",9001,4284,16180,9807,8801,0.0,9102,8802,150.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2745,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E",9001,4284,16181,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2746,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E",9001,4284,16182,9807,8801,0.0,9102,8802,156.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2747,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E",9001,4284,16183,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2748,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E",9001,4284,16184,9807,8801,0.0,9102,8802,162.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2749,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E",9001,4284,16185,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2750,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E",9001,4284,16186,9807,8801,0.0,9102,8802,168.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2751,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E",9001,4284,16187,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2752,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E",9001,4284,16188,9807,8801,0.0,9102,8802,174.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2753,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E",9001,4284,16189,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2754,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E",9001,4284,16190,9807,8801,0.0,9102,8802,180.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2755,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W",9001,4284,16191,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2756,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W",9001,4284,16192,9807,8801,0.0,9102,8802,-174.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2757,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W",9001,4284,16193,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2758,"Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W",9001,4284,16194,9807,8801,0.0,9102,8802,-168.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2759,"NAD83(HARN) / Alabama East",9001,4152,10131,9807,8801,30.3,9110,8802,-85.5,9110,8805,0.99996,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2760,"NAD83(HARN) / Alabama West",9001,4152,10132,9807,8801,30.0,9110,8802,-87.3,9110,8805,0.999933333,9201,8806,600000.0,9001,8807,0.0,9001,,,,,,
+2761,"NAD83(HARN) / Arizona East",9001,4152,10231,9807,8801,31.0,9110,8802,-110.1,9110,8805,0.9999,9201,8806,213360.0,9001,8807,0.0,9001,,,,,,
+2762,"NAD83(HARN) / Arizona Central",9001,4152,10232,9807,8801,31.0,9110,8802,-111.55,9110,8805,0.9999,9201,8806,213360.0,9001,8807,0.0,9001,,,,,,
+2763,"NAD83(HARN) / Arizona West",9001,4152,10233,9807,8801,31.0,9110,8802,-113.45,9110,8805,0.999933333,9201,8806,213360.0,9001,8807,0.0,9001,,,,,,
+2764,"NAD83(HARN) / Arkansas North",9001,4152,10331,9802,8821,34.2,9110,8822,-92.0,9110,8823,36.14,9110,8824,34.56,9110,8826,400000.0,9001,8827,0.0,9001,,,
+2765,"NAD83(HARN) / Arkansas South",9001,4152,10332,9802,8821,32.4,9110,8822,-92.0,9110,8823,34.46,9110,8824,33.18,9110,8826,400000.0,9001,8827,400000.0,9001,,,
+2766,"NAD83(HARN) / California zone 1",9001,4152,10431,9802,8821,39.2,9110,8822,-122.0,9110,8823,41.4,9110,8824,40.0,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+2767,"NAD83(HARN) / California zone 2",9001,4152,10432,9802,8821,37.4,9110,8822,-122.0,9110,8823,39.5,9110,8824,38.2,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+2768,"NAD83(HARN) / California zone 3",9001,4152,10433,9802,8821,36.3,9110,8822,-120.3,9110,8823,38.26,9110,8824,37.04,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+2769,"NAD83(HARN) / California zone 4",9001,4152,10434,9802,8821,35.2,9110,8822,-119.0,9110,8823,37.15,9110,8824,36.0,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+2770,"NAD83(HARN) / California zone 5",9001,4152,10435,9802,8821,33.3,9110,8822,-118.0,9110,8823,35.28,9110,8824,34.02,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+2771,"NAD83(HARN) / California zone 6",9001,4152,10436,9802,8821,32.1,9110,8822,-116.15,9110,8823,33.53,9110,8824,32.47,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+2772,"NAD83(HARN) / Colorado North",9001,4152,10531,9802,8821,39.2,9110,8822,-105.3,9110,8823,40.47,9110,8824,39.43,9110,8826,914401.8289,9001,8827,304800.6096,9001,,,
+2773,"NAD83(HARN) / Colorado Central",9001,4152,10532,9802,8821,37.5,9110,8822,-105.3,9110,8823,39.45,9110,8824,38.27,9110,8826,914401.8289,9001,8827,304800.6096,9001,,,
+2774,"NAD83(HARN) / Colorado South",9001,4152,10533,9802,8821,36.4,9110,8822,-105.3,9110,8823,38.26,9110,8824,37.14,9110,8826,914401.8289,9001,8827,304800.6096,9001,,,
+2775,"NAD83(HARN) / Connecticut",9001,4152,10630,9802,8821,40.5,9110,8822,-72.45,9110,8823,41.52,9110,8824,41.12,9110,8826,304800.6096,9001,8827,152400.3048,9001,,,
+2776,"NAD83(HARN) / Delaware",9001,4152,10730,9807,8801,38.0,9110,8802,-75.25,9110,8805,0.999995,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2777,"NAD83(HARN) / Florida East",9001,4152,10931,9807,8801,24.2,9110,8802,-81.0,9110,8805,0.999941177,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2778,"NAD83(HARN) / Florida West",9001,4152,10932,9807,8801,24.2,9110,8802,-82.0,9110,8805,0.999941177,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2779,"NAD83(HARN) / Florida North",9001,4152,10933,9802,8821,29.0,9110,8822,-84.3,9110,8823,30.45,9110,8824,29.35,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2780,"NAD83(HARN) / Georgia East",9001,4152,11031,9807,8801,30.0,9110,8802,-82.1,9110,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2781,"NAD83(HARN) / Georgia West",9001,4152,11032,9807,8801,30.0,9110,8802,-84.1,9110,8805,0.9999,9201,8806,700000.0,9001,8807,0.0,9001,,,,,,
+2782,"NAD83(HARN) / Hawaii zone 1",9001,4152,15131,9807,8801,18.5,9110,8802,-155.3,9110,8805,0.999966667,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2783,"NAD83(HARN) / Hawaii zone 2",9001,4152,15132,9807,8801,20.2,9110,8802,-156.4,9110,8805,0.999966667,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2784,"NAD83(HARN) / Hawaii zone 3",9001,4152,15133,9807,8801,21.1,9110,8802,-158.0,9110,8805,0.99999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2785,"NAD83(HARN) / Hawaii zone 4",9001,4152,15134,9807,8801,21.5,9110,8802,-159.3,9110,8805,0.99999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2786,"NAD83(HARN) / Hawaii zone 5",9001,4152,15135,9807,8801,21.4,9110,8802,-160.1,9110,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2787,"NAD83(HARN) / Idaho East",9001,4152,11131,9807,8801,41.4,9110,8802,-112.1,9110,8805,0.999947368,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2788,"NAD83(HARN) / Idaho Central",9001,4152,11132,9807,8801,41.4,9110,8802,-114.0,9110,8805,0.999947368,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2789,"NAD83(HARN) / Idaho West",9001,4152,11133,9807,8801,41.4,9110,8802,-115.45,9110,8805,0.999933333,9201,8806,800000.0,9001,8807,0.0,9001,,,,,,
+2790,"NAD83(HARN) / Illinois East",9001,4152,11231,9807,8801,36.4,9110,8802,-88.2,9110,8805,0.999975,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+2791,"NAD83(HARN) / Illinois West",9001,4152,11232,9807,8801,36.4,9110,8802,-90.1,9110,8805,0.999941177,9201,8806,700000.0,9001,8807,0.0,9001,,,,,,
+2792,"NAD83(HARN) / Indiana East",9001,4152,11331,9807,8801,37.3,9110,8802,-85.4,9110,8805,0.999966667,9201,8806,100000.0,9001,8807,250000.0,9001,,,,,,
+2793,"NAD83(HARN) / Indiana West",9001,4152,11332,9807,8801,37.3,9110,8802,-87.05,9110,8805,0.999966667,9201,8806,900000.0,9001,8807,250000.0,9001,,,,,,
+2794,"NAD83(HARN) / Iowa North",9001,4152,11431,9802,8821,41.3,9110,8822,-93.3,9110,8823,43.16,9110,8824,42.04,9110,8826,1500000.0,9001,8827,1000000.0,9001,,,
+2795,"NAD83(HARN) / Iowa South",9001,4152,11432,9802,8821,40.0,9110,8822,-93.3,9110,8823,41.47,9110,8824,40.37,9110,8826,500000.0,9001,8827,0.0,9001,,,
+2796,"NAD83(HARN) / Kansas North",9001,4152,11531,9802,8821,38.2,9110,8822,-98.0,9110,8823,39.47,9110,8824,38.43,9110,8826,400000.0,9001,8827,0.0,9001,,,
+2797,"NAD83(HARN) / Kansas South",9001,4152,11532,9802,8821,36.4,9110,8822,-98.3,9110,8823,38.34,9110,8824,37.16,9110,8826,400000.0,9001,8827,400000.0,9001,,,
+2798,"NAD83(HARN) / Kentucky North",9001,4152,15303,9802,8821,37.3,9110,8822,-84.15,9110,8823,37.58,9110,8824,38.58,9110,8826,500000.0,9001,8827,0.0,9001,,,
+2799,"NAD83(HARN) / Kentucky South",9001,4152,11632,9802,8821,36.2,9110,8822,-85.45,9110,8823,37.56,9110,8824,36.44,9110,8826,500000.0,9001,8827,500000.0,9001,,,
+2800,"NAD83(HARN) / Louisiana North",9001,4152,11731,9802,8821,30.3,9110,8822,-92.3,9110,8823,32.4,9110,8824,31.1,9110,8826,1000000.0,9001,8827,0.0,9001,,,
+2801,"NAD83(HARN) / Louisiana South",9001,4152,11732,9802,8821,28.3,9110,8822,-91.2,9110,8823,30.42,9110,8824,29.18,9110,8826,1000000.0,9001,8827,0.0,9001,,,
+2802,"NAD83(HARN) / Maine East",9001,4152,11831,9807,8801,43.4,9110,8802,-68.3,9110,8805,0.9999,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+2803,"NAD83(HARN) / Maine West",9001,4152,11832,9807,8801,42.5,9110,8802,-70.1,9110,8805,0.999966667,9201,8806,900000.0,9001,8807,0.0,9001,,,,,,
+2804,"NAD83(HARN) / Maryland",9001,4152,11930,9802,8821,37.4,9110,8822,-77.0,9110,8823,39.27,9110,8824,38.18,9110,8826,400000.0,9001,8827,0.0,9001,,,
+2805,"NAD83(HARN) / Massachusetts Mainland",9001,4152,12031,9802,8821,41.0,9110,8822,-71.3,9110,8823,42.41,9110,8824,41.43,9110,8826,200000.0,9001,8827,750000.0,9001,,,
+2806,"NAD83(HARN) / Massachusetts Island",9001,4152,12032,9802,8821,41.0,9110,8822,-70.3,9110,8823,41.29,9110,8824,41.17,9110,8826,500000.0,9001,8827,0.0,9001,,,
+2807,"NAD83(HARN) / Michigan North",9001,4152,12141,9802,8821,44.47,9110,8822,-87.0,9110,8823,47.05,9110,8824,45.29,9110,8826,8000000.0,9001,8827,0.0,9001,,,
+2808,"NAD83(HARN) / Michigan Central",9001,4152,12142,9802,8821,43.19,9110,8822,-84.22,9110,8823,45.42,9110,8824,44.11,9110,8826,6000000.0,9001,8827,0.0,9001,,,
+2809,"NAD83(HARN) / Michigan South",9001,4152,12143,9802,8821,41.3,9110,8822,-84.22,9110,8823,43.4,9110,8824,42.06,9110,8826,4000000.0,9001,8827,0.0,9001,,,
+2810,"NAD83(HARN) / Minnesota North",9001,4152,12231,9802,8821,46.3,9110,8822,-93.06,9110,8823,48.38,9110,8824,47.02,9110,8826,800000.0,9001,8827,100000.0,9001,,,
+2811,"NAD83(HARN) / Minnesota Central",9001,4152,12232,9802,8821,45.0,9110,8822,-94.15,9110,8823,47.03,9110,8824,45.37,9110,8826,800000.0,9001,8827,100000.0,9001,,,
+2812,"NAD83(HARN) / Minnesota South",9001,4152,12233,9802,8821,43.0,9110,8822,-94.0,9110,8823,45.13,9110,8824,43.47,9110,8826,800000.0,9001,8827,100000.0,9001,,,
+2813,"NAD83(HARN) / Mississippi East",9001,4152,12331,9807,8801,29.3,9110,8802,-88.5,9110,8805,0.99995,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+2814,"NAD83(HARN) / Mississippi West",9001,4152,12332,9807,8801,29.3,9110,8802,-90.2,9110,8805,0.99995,9201,8806,700000.0,9001,8807,0.0,9001,,,,,,
+2815,"NAD83(HARN) / Missouri East",9001,4152,12431,9807,8801,35.5,9110,8802,-90.3,9110,8805,0.999933333,9201,8806,250000.0,9001,8807,0.0,9001,,,,,,
+2816,"NAD83(HARN) / Missouri Central",9001,4152,12432,9807,8801,35.5,9110,8802,-92.3,9110,8805,0.999933333,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2817,"NAD83(HARN) / Missouri West",9001,4152,12433,9807,8801,36.1,9110,8802,-94.3,9110,8805,0.999941177,9201,8806,850000.0,9001,8807,0.0,9001,,,,,,
+2818,"NAD83(HARN) / Montana",9001,4152,12530,9802,8821,44.15,9110,8822,-109.3,9110,8823,49.0,9110,8824,45.0,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2819,"NAD83(HARN) / Nebraska",9001,4152,12630,9802,8821,39.5,9110,8822,-100.0,9110,8823,43.0,9110,8824,40.0,9110,8826,500000.0,9001,8827,0.0,9001,,,
+2820,"NAD83(HARN) / Nevada East",9001,4152,12731,9807,8801,34.45,9110,8802,-115.35,9110,8805,0.9999,9201,8806,200000.0,9001,8807,8000000.0,9001,,,,,,
+2821,"NAD83(HARN) / Nevada Central",9001,4152,12732,9807,8801,34.45,9110,8802,-116.4,9110,8805,0.9999,9201,8806,500000.0,9001,8807,6000000.0,9001,,,,,,
+2822,"NAD83(HARN) / Nevada West",9001,4152,12733,9807,8801,34.45,9110,8802,-118.35,9110,8805,0.9999,9201,8806,800000.0,9001,8807,4000000.0,9001,,,,,,
+2823,"NAD83(HARN) / New Hampshire",9001,4152,12830,9807,8801,42.3,9110,8802,-71.4,9110,8805,0.999966667,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+2824,"NAD83(HARN) / New Jersey",9001,4152,12930,9807,8801,38.5,9110,8802,-74.3,9110,8805,0.9999,9201,8806,150000.0,9001,8807,0.0,9001,,,,,,
+2825,"NAD83(HARN) / New Mexico East",9001,4152,13031,9807,8801,31.0,9110,8802,-104.2,9110,8805,0.999909091,9201,8806,165000.0,9001,8807,0.0,9001,,,,,,
+2826,"NAD83(HARN) / New Mexico Central",9001,4152,13032,9807,8801,31.0,9110,8802,-106.15,9110,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2827,"NAD83(HARN) / New Mexico West",9001,4152,13033,9807,8801,31.0,9110,8802,-107.5,9110,8805,0.999916667,9201,8806,830000.0,9001,8807,0.0,9001,,,,,,
+2828,"NAD83(HARN) / New York East",9001,4152,13131,9807,8801,38.5,9110,8802,-74.3,9110,8805,0.9999,9201,8806,150000.0,9001,8807,0.0,9001,,,,,,
+2829,"NAD83(HARN) / New York Central",9001,4152,13132,9807,8801,40.0,9110,8802,-76.35,9110,8805,0.9999375,9201,8806,250000.0,9001,8807,0.0,9001,,,,,,
+2830,"NAD83(HARN) / New York West",9001,4152,13133,9807,8801,40.0,9110,8802,-78.35,9110,8805,0.9999375,9201,8806,350000.0,9001,8807,0.0,9001,,,,,,
+2831,"NAD83(HARN) / New York Long Island",9001,4152,13134,9802,8821,40.1,9110,8822,-74.0,9110,8823,41.02,9110,8824,40.4,9110,8826,300000.0,9001,8827,0.0,9001,,,
+2832,"NAD83(HARN) / North Dakota North",9001,4152,13331,9802,8821,47.0,9110,8822,-100.3,9110,8823,48.44,9110,8824,47.26,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2833,"NAD83(HARN) / North Dakota South",9001,4152,13332,9802,8821,45.4,9110,8822,-100.3,9110,8823,47.29,9110,8824,46.11,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2834,"NAD83(HARN) / Ohio North",9001,4152,13431,9802,8821,39.4,9110,8822,-82.3,9110,8823,41.42,9110,8824,40.26,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2835,"NAD83(HARN) / Ohio South",9001,4152,13432,9802,8821,38.0,9110,8822,-82.3,9110,8823,40.02,9110,8824,38.44,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2836,"NAD83(HARN) / Oklahoma North",9001,4152,13531,9802,8821,35.0,9110,8822,-98.0,9110,8823,36.46,9110,8824,35.34,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2837,"NAD83(HARN) / Oklahoma South",9001,4152,13532,9802,8821,33.2,9110,8822,-98.0,9110,8823,35.14,9110,8824,33.56,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2838,"NAD83(HARN) / Oregon North",9001,4152,13631,9802,8821,43.4,9110,8822,-120.3,9110,8823,46.0,9110,8824,44.2,9110,8826,2500000.0,9001,8827,0.0,9001,,,
+2839,"NAD83(HARN) / Oregon South",9001,4152,13632,9802,8821,41.4,9110,8822,-120.3,9110,8823,44.0,9110,8824,42.2,9110,8826,1500000.0,9001,8827,0.0,9001,,,
+2840,"NAD83(HARN) / Rhode Island",9001,4152,13830,9807,8801,41.05,9110,8802,-71.3,9110,8805,0.99999375,9201,8806,100000.0,9001,8807,0.0,9001,,,,,,
+2841,"NAD83(HARN) / South Dakota North",9001,4152,14031,9802,8821,43.5,9110,8822,-100.0,9110,8823,45.41,9110,8824,44.25,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2842,"NAD83(HARN) / South Dakota South",9001,4152,14032,9802,8821,42.2,9110,8822,-100.2,9110,8823,44.24,9110,8824,42.5,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2843,"NAD83(HARN) / Tennessee",9001,4152,14130,9802,8821,34.2,9110,8822,-86.0,9110,8823,36.25,9110,8824,35.15,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2844,"NAD83(HARN) / Texas North",9001,4152,14231,9802,8821,34.0,9110,8822,-101.3,9110,8823,36.11,9110,8824,34.39,9110,8826,200000.0,9001,8827,1000000.0,9001,,,
+2845,"NAD83(HARN) / Texas North Central",9001,4152,14232,9802,8821,31.4,9110,8822,-98.3,9110,8823,33.58,9110,8824,32.08,9110,8826,600000.0,9001,8827,2000000.0,9001,,,
+2846,"NAD83(HARN) / Texas Central",9001,4152,14233,9802,8821,29.4,9110,8822,-100.2,9110,8823,31.53,9110,8824,30.07,9110,8826,700000.0,9001,8827,3000000.0,9001,,,
+2847,"NAD83(HARN) / Texas South Central",9001,4152,14234,9802,8821,27.5,9110,8822,-99.0,9110,8823,30.17,9110,8824,28.23,9110,8826,600000.0,9001,8827,4000000.0,9001,,,
+2848,"NAD83(HARN) / Texas South",9001,4152,14235,9802,8821,25.4,9110,8822,-98.3,9110,8823,27.5,9110,8824,26.1,9110,8826,300000.0,9001,8827,5000000.0,9001,,,
+2849,"NAD83(HARN) / Utah North",9001,4152,14331,9802,8821,40.2,9110,8822,-111.3,9110,8823,41.47,9110,8824,40.43,9110,8826,500000.0,9001,8827,1000000.0,9001,,,
+2850,"NAD83(HARN) / Utah Central",9001,4152,14332,9802,8821,38.2,9110,8822,-111.3,9110,8823,40.39,9110,8824,39.01,9110,8826,500000.0,9001,8827,2000000.0,9001,,,
+2851,"NAD83(HARN) / Utah South",9001,4152,14333,9802,8821,36.4,9110,8822,-111.3,9110,8823,38.21,9110,8824,37.13,9110,8826,500000.0,9001,8827,3000000.0,9001,,,
+2852,"NAD83(HARN) / Vermont",9001,4152,14430,9807,8801,42.3,9110,8802,-72.3,9110,8805,0.999964286,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2853,"NAD83(HARN) / Virginia North",9001,4152,14531,9802,8821,37.4,9110,8822,-78.3,9110,8823,39.12,9110,8824,38.02,9110,8826,3500000.0,9001,8827,2000000.0,9001,,,
+2854,"NAD83(HARN) / Virginia South",9001,4152,14532,9802,8821,36.2,9110,8822,-78.3,9110,8823,37.58,9110,8824,36.46,9110,8826,3500000.0,9001,8827,1000000.0,9001,,,
+2855,"NAD83(HARN) / Washington North",9001,4152,14631,9802,8821,47.0,9110,8822,-120.5,9110,8823,48.44,9110,8824,47.3,9110,8826,500000.0,9001,8827,0.0,9001,,,
+2856,"NAD83(HARN) / Washington South",9001,4152,14632,9802,8821,45.2,9110,8822,-120.3,9110,8823,47.2,9110,8824,45.5,9110,8826,500000.0,9001,8827,0.0,9001,,,
+2857,"NAD83(HARN) / West Virginia North",9001,4152,14731,9802,8821,38.3,9110,8822,-79.3,9110,8823,40.15,9110,8824,39.0,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2858,"NAD83(HARN) / West Virginia South",9001,4152,14732,9802,8821,37.0,9110,8822,-81.0,9110,8823,38.53,9110,8824,37.29,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2859,"NAD83(HARN) / Wisconsin North",9001,4152,14831,9802,8821,45.1,9110,8822,-90.0,9110,8823,46.46,9110,8824,45.34,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2860,"NAD83(HARN) / Wisconsin Central",9001,4152,14832,9802,8821,43.5,9110,8822,-90.0,9110,8823,45.3,9110,8824,44.15,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2861,"NAD83(HARN) / Wisconsin South",9001,4152,14833,9802,8821,42.0,9110,8822,-90.0,9110,8823,44.04,9110,8824,42.44,9110,8826,600000.0,9001,8827,0.0,9001,,,
+2862,"NAD83(HARN) / Wyoming East",9001,4152,14931,9807,8801,40.3,9110,8802,-105.1,9110,8805,0.9999375,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+2863,"NAD83(HARN) / Wyoming East Central",9001,4152,14932,9807,8801,40.3,9110,8802,-107.2,9110,8805,0.9999375,9201,8806,400000.0,9001,8807,100000.0,9001,,,,,,
+2864,"NAD83(HARN) / Wyoming West Central",9001,4152,14933,9807,8801,40.3,9110,8802,-108.45,9110,8805,0.9999375,9201,8806,600000.0,9001,8807,0.0,9001,,,,,,
+2865,"NAD83(HARN) / Wyoming West",9001,4152,14934,9807,8801,40.3,9110,8802,-110.05,9110,8805,0.9999375,9201,8806,800000.0,9001,8807,100000.0,9001,,,,,,
+2866,"NAD83(HARN) / Puerto Rico & Virgin Is.",9001,4152,15230,9802,8821,17.5,9110,8822,-66.26,9110,8823,18.26,9110,8824,18.02,9110,8826,200000.0,9001,8827,200000.0,9001,,,
+2867,"NAD83(HARN) / Arizona East (ft)",9002,4152,15304,9807,8801,31.0,9110,8802,-110.1,9110,8805,0.9999,9201,8806,700000.0,9002,8807,0.0,9002,,,,,,
+2868,"NAD83(HARN) / Arizona Central (ft)",9002,4152,15305,9807,8801,31.0,9110,8802,-111.55,9110,8805,0.9999,9201,8806,700000.0,9002,8807,0.0,9002,,,,,,
+2869,"NAD83(HARN) / Arizona West (ft)",9002,4152,15306,9807,8801,31.0,9110,8802,-113.45,9110,8805,0.999933333,9201,8806,700000.0,9002,8807,0.0,9002,,,,,,
+2870,"NAD83(HARN) / California zone 1 (ftUS)",9003,4152,15307,9802,8821,39.2,9110,8822,-122.0,9110,8823,41.4,9110,8824,40.0,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2871,"NAD83(HARN) / California zone 2 (ftUS)",9003,4152,15308,9802,8821,37.4,9110,8822,-122.0,9110,8823,39.5,9110,8824,38.2,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2872,"NAD83(HARN) / California zone 3 (ftUS)",9003,4152,15309,9802,8821,36.3,9110,8822,-120.3,9110,8823,38.26,9110,8824,37.04,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2873,"NAD83(HARN) / California zone 4 (ftUS)",9003,4152,15310,9802,8821,35.2,9110,8822,-119.0,9110,8823,37.15,9110,8824,36.0,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2874,"NAD83(HARN) / California zone 5 (ftUS)",9003,4152,15311,9802,8821,33.3,9110,8822,-118.0,9110,8823,35.28,9110,8824,34.02,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2875,"NAD83(HARN) / California zone 6 (ftUS)",9003,4152,15312,9802,8821,32.1,9110,8822,-116.15,9110,8823,33.53,9110,8824,32.47,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+2876,"NAD83(HARN) / Colorado North (ftUS)",9003,4152,15313,9802,8821,39.2,9110,8822,-105.3,9110,8823,40.47,9110,8824,39.43,9110,8826,3000000.0,9003,8827,1000000.0,9003,,,
+2877,"NAD83(HARN) / Colorado Central (ftUS)",9003,4152,15314,9802,8821,37.5,9110,8822,-105.3,9110,8823,39.45,9110,8824,38.27,9110,8826,3000000.0,9003,8827,1000000.0,9003,,,
+2878,"NAD83(HARN) / Colorado South (ftUS)",9003,4152,15315,9802,8821,36.4,9110,8822,-105.3,9110,8823,38.26,9110,8824,37.14,9110,8826,3000000.0,9003,8827,1000000.0,9003,,,
+2879,"NAD83(HARN) / Connecticut (ftUS)",9003,4152,15316,9802,8821,40.5,9110,8822,-72.45,9110,8823,41.52,9110,8824,41.12,9110,8826,1000000.0,9003,8827,500000.0,9003,,,
+2880,"NAD83(HARN) / Delaware (ftUS)",9003,4152,15317,9807,8801,38.0,9110,8802,-75.25,9110,8805,0.999995,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+2881,"NAD83(HARN) / Florida East (ftUS)",9003,4152,15318,9807,8801,24.2,9110,8802,-81.0,9110,8805,0.999941177,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+2882,"NAD83(HARN) / Florida West (ftUS)",9003,4152,15319,9807,8801,24.2,9110,8802,-82.0,9110,8805,0.999941177,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+2883,"NAD83(HARN) / Florida North (ftUS)",9003,4152,15320,9802,8821,29.0,9110,8822,-84.3,9110,8823,30.45,9110,8824,29.35,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2884,"NAD83(HARN) / Georgia East (ftUS)",9003,4152,15321,9807,8801,30.0,9110,8802,-82.1,9110,8805,0.9999,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+2885,"NAD83(HARN) / Georgia West (ftUS)",9003,4152,15322,9807,8801,30.0,9110,8802,-84.1,9110,8805,0.9999,9201,8806,2296583.333,9003,8807,0.0,9003,,,,,,
+2886,"NAD83(HARN) / Idaho East (ftUS)",9003,4152,15323,9807,8801,41.4,9110,8802,-112.1,9110,8805,0.999947368,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+2887,"NAD83(HARN) / Idaho Central (ftUS)",9003,4152,15324,9807,8801,41.4,9110,8802,-114.0,9110,8805,0.999947368,9201,8806,1640416.667,9003,8807,0.0,9003,,,,,,
+2888,"NAD83(HARN) / Idaho West (ftUS)",9003,4152,15325,9807,8801,41.4,9110,8802,-115.45,9110,8805,0.999933333,9201,8806,2624666.667,9003,8807,0.0,9003,,,,,,
+2889,"NAD83(HARN) / Indiana East (ftUS)",9003,4152,15326,9807,8801,37.3,9110,8802,-85.4,9110,8805,0.999966667,9201,8806,328083.333,9003,8807,818125.0,9003,,,,,,
+2890,"NAD83(HARN) / Indiana West (ftUS)",9003,4152,15327,9807,8801,37.3,9110,8802,-87.05,9110,8805,0.999966667,9201,8806,2952750.0,9003,8807,818125.0,9003,,,,,,
+2891,"NAD83(HARN) / Kentucky North (ftUS)",9003,4152,15328,9802,8821,37.3,9110,8822,-84.15,9110,8823,37.58,9110,8824,38.58,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+2892,"NAD83(HARN) / Kentucky South (ftUS)",9003,4152,15329,9802,8821,36.2,9110,8822,-85.45,9110,8823,37.56,9110,8824,36.44,9110,8826,1640416.667,9003,8827,1640416.667,9003,,,
+2893,"NAD83(HARN) / Maryland (ftUS)",9003,4152,15330,9802,8821,37.4,9110,8822,-77.0,9110,8823,39.27,9110,8824,38.18,9110,8826,1312333.333,9003,8827,0.0,9003,,,
+2894,"NAD83(HARN) / Massachusetts Mainland (ftUS)",9003,4152,15331,9802,8821,41.0,9110,8822,-71.3,9110,8823,42.41,9110,8824,41.43,9110,8826,656166.667,9003,8827,2460625.0,9003,,,
+2895,"NAD83(HARN) / Massachusetts Island (ftUS)",9003,4152,15332,9802,8821,41.0,9110,8822,-70.3,9110,8823,41.29,9110,8824,41.17,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+2896,"NAD83(HARN) / Michigan North (ft)",9002,4152,15333,9802,8821,44.47,9110,8822,-87.0,9110,8823,47.05,9110,8824,45.29,9110,8826,26246719.16,9002,8827,0.0,9002,,,
+2897,"NAD83(HARN) / Michigan Central (ft)",9002,4152,15334,9802,8821,43.19,9110,8822,-84.22,9110,8823,45.42,9110,8824,44.11,9110,8826,19685039.37,9002,8827,0.0,9002,,,
+2898,"NAD83(HARN) / Michigan South (ft)",9002,4152,15335,9802,8821,41.3,9110,8822,-84.22,9110,8823,43.4,9110,8824,42.06,9110,8826,13123359.58,9002,8827,0.0,9002,,,
+2899,"NAD83(HARN) / Mississippi East (ftUS)",9003,4152,15336,9807,8801,29.3,9110,8802,-88.5,9110,8805,0.99995,9201,8806,984250.0,9003,8807,0.0,9003,,,,,,
+2900,"NAD83(HARN) / Mississippi West (ftUS)",9003,4152,15337,9807,8801,29.3,9110,8802,-90.2,9110,8805,0.99995,9201,8806,2296583.333,9003,8807,0.0,9003,,,,,,
+2901,"NAD83(HARN) / Montana (ft)",9002,4152,15338,9802,8821,44.15,9110,8822,-109.3,9110,8823,49.0,9110,8824,45.0,9110,8826,1968503.937,9002,8827,0.0,9002,,,
+2902,"NAD83(HARN) / New Mexico East (ftUS)",9003,4152,15339,9807,8801,31.0,9110,8802,-104.2,9110,8805,0.999909091,9201,8806,541337.5,9003,8807,0.0,9003,,,,,,
+2903,"NAD83(HARN) / New Mexico Central (ftUS)",9003,4152,15340,9807,8801,31.0,9110,8802,-106.15,9110,8805,0.9999,9201,8806,1640416.667,9003,8807,0.0,9003,,,,,,
+2904,"NAD83(HARN) / New Mexico West (ftUS)",9003,4152,15341,9807,8801,31.0,9110,8802,-107.5,9110,8805,0.999916667,9201,8806,2723091.667,9003,8807,0.0,9003,,,,,,
+2905,"NAD83(HARN) / New York East (ftUS)",9003,4152,15342,9807,8801,38.5,9110,8802,-74.3,9110,8805,0.9999,9201,8806,492125.0,9003,8807,0.0,9003,,,,,,
+2906,"NAD83(HARN) / New York Central (ftUS)",9003,4152,15343,9807,8801,40.0,9110,8802,-76.35,9110,8805,0.9999375,9201,8806,820208.333,9003,8807,0.0,9003,,,,,,
+2907,"NAD83(HARN) / New York West (ftUS)",9003,4152,15344,9807,8801,40.0,9110,8802,-78.35,9110,8805,0.9999375,9201,8806,1148291.667,9003,8807,0.0,9003,,,,,,
+2908,"NAD83(HARN) / New York Long Island (ftUS)",9003,4152,15345,9802,8821,40.1,9110,8822,-74.0,9110,8823,41.02,9110,8824,40.4,9110,8826,984250.0,9003,8827,0.0,9003,,,
+2909,"NAD83(HARN) / North Dakota North (ft)",9002,4152,15347,9802,8821,47.0,9110,8822,-100.3,9110,8823,48.44,9110,8824,47.26,9110,8826,1968503.937,9002,8827,0.0,9002,,,
+2910,"NAD83(HARN) / North Dakota South (ft)",9002,4152,15348,9802,8821,45.4,9110,8822,-100.3,9110,8823,47.29,9110,8824,46.11,9110,8826,1968503.937,9002,8827,0.0,9002,,,
+2911,"NAD83(HARN) / Oklahoma North (ftUS)",9003,4152,15349,9802,8821,35.0,9110,8822,-98.0,9110,8823,36.46,9110,8824,35.34,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2912,"NAD83(HARN) / Oklahoma South (ftUS)",9003,4152,15350,9802,8821,33.2,9110,8822,-98.0,9110,8823,35.14,9110,8824,33.56,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2913,"NAD83(HARN) / Oregon North (ft)",9002,4152,15351,9802,8821,43.4,9110,8822,-120.3,9110,8823,46.0,9110,8824,44.2,9110,8826,8202099.738,9002,8827,0.0,9002,,,
+2914,"NAD83(HARN) / Oregon South (ft)",9002,4152,15352,9802,8821,41.4,9110,8822,-120.3,9110,8823,44.0,9110,8824,42.2,9110,8826,4921259.843,9002,8827,0.0,9002,,,
+2915,"NAD83(HARN) / Tennessee (ftUS)",9003,4152,15356,9802,8821,34.2,9110,8822,-86.0,9110,8823,36.25,9110,8824,35.15,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2916,"NAD83(HARN) / Texas North (ftUS)",9003,4152,15357,9802,8821,34.0,9110,8822,-101.3,9110,8823,36.11,9110,8824,34.39,9110,8826,656166.667,9003,8827,3280833.333,9003,,,
+2917,"NAD83(HARN) / Texas North Central (ftUS)",9003,4152,15358,9802,8821,31.4,9110,8822,-98.3,9110,8823,33.58,9110,8824,32.08,9110,8826,1968500.0,9003,8827,6561666.667,9003,,,
+2918,"NAD83(HARN) / Texas Central (ftUS)",9003,4152,15359,9802,8821,29.4,9110,8822,-100.2,9110,8823,31.53,9110,8824,30.07,9110,8826,2296583.333,9003,8827,9842500.0,9003,,,
+2919,"NAD83(HARN) / Texas South Central (ftUS)",9003,4152,15360,9802,8821,27.5,9110,8822,-99.0,9110,8823,30.17,9110,8824,28.23,9110,8826,1968500.0,9003,8827,13123333.333,9003,,,
+2920,"NAD83(HARN) / Texas South (ftUS)",9003,4152,15361,9802,8821,25.4,9110,8822,-98.3,9110,8823,27.5,9110,8824,26.1,9110,8826,984250.0,9003,8827,16404166.667,9003,,,
+2921,"NAD83(HARN) / Utah North (ft)",9002,4152,15362,9802,8821,40.2,9110,8822,-111.3,9110,8823,41.47,9110,8824,40.43,9110,8826,1640419.948,9002,8827,3280839.895,9002,,,
+2922,"NAD83(HARN) / Utah Central (ft)",9002,4152,15363,9802,8821,38.2,9110,8822,-111.3,9110,8823,40.39,9110,8824,39.01,9110,8826,1640419.948,9002,8827,6561679.79,9002,,,
+2923,"NAD83(HARN) / Utah South (ft)",9002,4152,15364,9802,8821,36.4,9110,8822,-111.3,9110,8823,38.21,9110,8824,37.13,9110,8826,1640419.948,9002,8827,9842519.685,9002,,,
+2924,"NAD83(HARN) / Virginia North (ftUS)",9003,4152,15365,9802,8821,37.4,9110,8822,-78.3,9110,8823,39.12,9110,8824,38.02,9110,8826,11482916.667,9003,8827,6561666.667,9003,,,
+2925,"NAD83(HARN) / Virginia South (ftUS)",9003,4152,15366,9802,8821,36.2,9110,8822,-78.3,9110,8823,37.58,9110,8824,36.46,9110,8826,11482916.667,9003,8827,3280833.333,9003,,,
+2926,"NAD83(HARN) / Washington North (ftUS)",9003,4152,15367,9802,8821,47.0,9110,8822,-120.5,9110,8823,48.44,9110,8824,47.3,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+2927,"NAD83(HARN) / Washington South (ftUS)",9003,4152,15368,9802,8821,45.2,9110,8822,-120.3,9110,8823,47.2,9110,8824,45.5,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+2928,"NAD83(HARN) / Wisconsin North (ftUS)",9003,4152,15369,9802,8821,45.1,9110,8822,-90.0,9110,8823,46.46,9110,8824,45.34,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2929,"NAD83(HARN) / Wisconsin Central (ftUS)",9003,4152,15370,9802,8821,43.5,9110,8822,-90.0,9110,8823,45.3,9110,8824,44.15,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2930,"NAD83(HARN) / Wisconsin South (ftUS)",9003,4152,15371,9802,8821,42.0,9110,8822,-90.0,9110,8823,44.04,9110,8824,42.44,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+2931,"Beduaram / TM 13 NE",9003,4213,16413,9807,8801,0.0,9102,8802,13.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2932,"QND95 / Qatar National Grid",9001,4614,19919,9807,8801,24.27,9110,8802,51.13,9110,8805,0.99999,9201,8806,200000.0,9001,8807,300000.0,9001,,,,,,
+2933,"Segara / UTM zone 50S",9001,4613,16150,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+2934,"Segara (Jakarta) / NEIEZ",9001,4820,19905,9804,8801,0.0,9102,8802,110.0,9102,8805,0.997,9201,8806,3900000.0,9001,8807,900000.0,9001,,,,,,
+2935,"Pulkovo 1942 / CS63 zone A1",9001,4284,18441,9807,8801,0.07,9110,8802,41.32,9110,8805,1.0,9003,8806,1300000.0,9001,8807,0.0,9001,,,,,,
+2936,"Pulkovo 1942 / CS63 zone A2",9001,4284,18442,9807,8801,0.07,9110,8802,44.32,9110,8805,1.0,9003,8806,2300000.0,9001,8807,0.0,9001,,,,,,
+2937,"Pulkovo 1942 / CS63 zone A3",9001,4284,18443,9807,8801,0.07,9110,8802,47.32,9110,8805,1.0,9201,8806,3300000.0,9001,8807,0.0,9001,,,,,,
+2938,"Pulkovo 1942 / CS63 zone A4",9001,4284,18444,9807,8801,0.07,9110,8802,50.32,9110,8805,1.0,9201,8806,4300000.0,9001,8807,0.0,9001,,,,,,
+2939,"Pulkovo 1942 / CS63 zone K2",9001,4284,18446,9807,8801,0.08,9110,8802,50.46,9110,8805,1.0,9201,8806,2300000.0,9001,8807,0.0,9001,,,,,,
+2940,"Pulkovo 1942 / CS63 zone K3",9001,4284,18447,9807,8801,0.08,9110,8802,53.46,9110,8805,1.0,9201,8806,3300000.0,9001,8807,0.0,9001,,,,,,
+2941,"Pulkovo 1942 / CS63 zone K4",9001,4284,18448,9807,8801,0.08,9110,8802,56.46,9110,8805,1.0,9201,8806,4300000.0,9001,8807,0.0,9001,,,,,,
+2942,"Porto Santo / UTM zone 28N",9001,4615,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2943,"Selvagem Grande / UTM zone 28N",9001,4616,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2944,"NAD83(CSRS) / SCoPQ zone 2",9001,4617,17700,9807,8801,0.0,9110,8802,-55.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2945,"NAD83(CSRS) / MTM zone 3",9001,4617,17703,9807,8801,0.0,9110,8802,-58.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2946,"NAD83(CSRS) / MTM zone 4",9001,4617,17704,9807,8801,0.0,9110,8802,-61.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2947,"NAD83(CSRS) / MTM zone 5",9001,4617,17705,9807,8801,0.0,9110,8802,-64.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2948,"NAD83(CSRS) / MTM zone 6",9001,4617,17706,9807,8801,0.0,9110,8802,-67.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2949,"NAD83(CSRS) / MTM zone 7",9001,4617,17707,9807,8801,0.0,9110,8802,-70.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2950,"NAD83(CSRS) / MTM zone 8",9001,4617,17708,9807,8801,0.0,9110,8802,-73.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2951,"NAD83(CSRS) / MTM zone 9",9001,4617,17709,9807,8801,0.0,9110,8802,-76.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2952,"NAD83(CSRS) / MTM zone 10",9001,4617,17710,9807,8801,0.0,9110,8802,-79.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+2953,"NAD83(CSRS) / New Brunswick Stereo",9001,4617,19946,9809,8801,46.3,9110,8802,-66.3,9110,8805,0.999912,9201,8806,2500000.0,9001,8807,7500000.0,9001,,,,,,
+2954,"NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)",9001,4617,19960,9809,8801,47.15,9110,8802,-63.0,9110,8805,0.999912,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+2955,"NAD83(CSRS) / UTM zone 11N",9001,4617,16011,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2956,"NAD83(CSRS) / UTM zone 12N",9001,4617,16012,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2957,"NAD83(CSRS) / UTM zone 13N",9001,4617,16013,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2958,"NAD83(CSRS) / UTM zone 17N",9001,4617,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2959,"NAD83(CSRS) / UTM zone 18N",9001,4617,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2960,"NAD83(CSRS) / UTM zone 19N",9001,4617,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2961,"NAD83(CSRS) / UTM zone 20N",9001,4617,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2962,"NAD83(CSRS) / UTM zone 21N",9001,4617,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+2963,"Lisbon 1890 (Lisbon) / Portugal Bonne",9001,4904,19979,9828,8801,39.4,9110,8802,1.0,9110,8806,0.0,9001,8807,0.0,9001,,,,,,,,,
+3036,"Moznet / UTM zone 36S",9001,4130,16136,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+3037,"Moznet / UTM zone 37S",9001,4130,16137,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+3148,"Indian 1960 / UTM zone 48N",9001,4131,16048,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+3149,"Indian 1960 / UTM zone 49N",9001,4131,16049,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+3176,"Indian 1960 / TM 106 NE",9001,4131,16506,9807,8801,0.0,9102,8802,106.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+3200,"FD58 / Iraq zone",9001,4132,19906,9801,8801,32.3,9110,8802,45.0,9110,8805,0.9987864078,9201,8806,1500000.0,9001,8807,1166200.0,9001,,,,,,
+3300,Estonian Coordinate System of 1992,9001,4133,19938,9802,8821,57.310319415,9110,8822,24.0,9110,8823,59.2,9110,8824,58.0,9110,8826,500000.0,9001,8827,6375000.0,9001,,,
+3301,Estonian Coordinate System of 1997,9001,4180,19938,9802,8821,57.310319415,9110,8822,24.0,9110,8823,59.2,9110,8824,58.0,9110,8826,500000.0,9001,8827,6375000.0,9001,,,
+3439,"PSD93 / UTM zone 39N",9001,4134,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+3440,"PSD93 / UTM zone 40N",9001,4134,16040,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+3561,"Old Hawaiian / Hawaii zone 1",9003,4135,15101,9807,8801,18.5,9110,8802,-155.3,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+3562,"Old Hawaiian / Hawaii zone 2",9003,4135,15102,9807,8801,20.2,9110,8802,-156.4,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+3563,"Old Hawaiian / Hawaii zone 3",9003,4135,15103,9807,8801,21.1,9110,8802,-158.0,9110,8805,0.99999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+3564,"Old Hawaiian / Hawaii zone 4",9003,4135,15104,9807,8801,21.5,9110,8802,-159.3,9110,8805,0.99999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+3565,"Old Hawaiian / Hawaii zone 5",9003,4135,15105,9807,8801,21.4,9110,8802,-160.1,9110,8805,1.0,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+3920,"Puerto Rico / UTM zone 20N",9001,4139,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+3991,Puerto Rico State Plane CS of 1927,9003,4139,15201,9802,8821,17.5,9110,8822,-66.26,9110,8823,18.26,9110,8824,18.02,9110,8826,500000.0,9003,8827,0.0,9003,,,
+3992,"Puerto Rico / St. Croix",9003,4139,15202,9802,8821,17.5,9110,8822,-66.26,9110,8823,18.26,9110,8824,18.02,9110,8826,500000.0,9003,8827,100000.0,9003,,,
+20004,"Pulkovo 1995 / Gauss-Kruger zone 4",9001,4200,16204,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+20005,"Pulkovo 1995 / Gauss-Kruger zone 5",9001,4200,16205,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+20006,"Pulkovo 1995 / Gauss-Kruger zone 6",9001,4200,16206,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+20007,"Pulkovo 1995 / Gauss-Kruger zone 7",9001,4200,16207,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+20008,"Pulkovo 1995 / Gauss-Kruger zone 8",9001,4200,16208,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+20009,"Pulkovo 1995 / Gauss-Kruger zone 9",9001,4200,16209,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,9500000.0,9001,8807,0.0,9001,,,,,,
+20010,"Pulkovo 1995 / Gauss-Kruger zone 10",9001,4200,16210,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,10500000.0,9001,8807,0.0,9001,,,,,,
+20011,"Pulkovo 1995 / Gauss-Kruger zone 11",9001,4200,16211,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,11500000.0,9001,8807,0.0,9001,,,,,,
+20012,"Pulkovo 1995 / Gauss-Kruger zone 12",9001,4200,16212,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,12500000.0,9001,8807,0.0,9001,,,,,,
+20013,"Pulkovo 1995 / Gauss-Kruger zone 13",9001,4200,16213,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,13500000.0,9001,8807,0.0,9001,,,,,,
+20014,"Pulkovo 1995 / Gauss-Kruger zone 14",9001,4200,16214,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,14500000.0,9001,8807,0.0,9001,,,,,,
+20015,"Pulkovo 1995 / Gauss-Kruger zone 15",9001,4200,16215,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,15500000.0,9001,8807,0.0,9001,,,,,,
+20016,"Pulkovo 1995 / Gauss-Kruger zone 16",9001,4200,16216,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,16500000.0,9001,8807,0.0,9001,,,,,,
+20017,"Pulkovo 1995 / Gauss-Kruger zone 17",9001,4200,16217,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,17500000.0,9001,8807,0.0,9001,,,,,,
+20018,"Pulkovo 1995 / Gauss-Kruger zone 18",9001,4200,16218,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,18500000.0,9001,8807,0.0,9001,,,,,,
+20019,"Pulkovo 1995 / Gauss-Kruger zone 19",9001,4200,16219,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,19500000.0,9001,8807,0.0,9001,,,,,,
+20020,"Pulkovo 1995 / Gauss-Kruger zone 20",9001,4200,16220,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,20500000.0,9001,8807,0.0,9001,,,,,,
+20021,"Pulkovo 1995 / Gauss-Kruger zone 21",9001,4200,16221,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,21500000.0,9001,8807,0.0,9001,,,,,,
+20022,"Pulkovo 1995 / Gauss-Kruger zone 22",9001,4200,16222,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,22500000.0,9001,8807,0.0,9001,,,,,,
+20023,"Pulkovo 1995 / Gauss-Kruger zone 23",9001,4200,16223,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,23500000.0,9001,8807,0.0,9001,,,,,,
+20024,"Pulkovo 1995 / Gauss-Kruger zone 24",9001,4200,16224,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,24500000.0,9001,8807,0.0,9001,,,,,,
+20025,"Pulkovo 1995 / Gauss-Kruger zone 25",9001,4200,16225,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,25500000.0,9001,8807,0.0,9001,,,,,,
+20026,"Pulkovo 1995 / Gauss-Kruger zone 26",9001,4200,16226,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,26500000.0,9001,8807,0.0,9001,,,,,,
+20027,"Pulkovo 1995 / Gauss-Kruger zone 27",9001,4200,16227,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,27500000.0,9001,8807,0.0,9001,,,,,,
+20028,"Pulkovo 1995 / Gauss-Kruger zone 28",9001,4200,16228,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,28500000.0,9001,8807,0.0,9001,,,,,,
+20029,"Pulkovo 1995 / Gauss-Kruger zone 29",9001,4200,16229,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,29500000.0,9001,8807,0.0,9001,,,,,,
+20030,"Pulkovo 1995 / Gauss-Kruger zone 30",9001,4200,16230,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,30500000.0,9001,8807,0.0,9001,,,,,,
+20031,"Pulkovo 1995 / Gauss-Kruger zone 31",9001,4200,16231,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,31500000.0,9001,8807,0.0,9001,,,,,,
+20032,"Pulkovo 1995 / Gauss-Kruger zone 32",9001,4200,16232,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,32500000.0,9001,8807,0.0,9001,,,,,,
+20064,"Pulkovo 1995 / Gauss-Kruger 4N",9001,4200,16304,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20065,"Pulkovo 1995 / Gauss-Kruger 5N",9001,4200,16305,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20066,"Pulkovo 1995 / Gauss-Kruger 6N",9001,4200,16306,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20067,"Pulkovo 1995 / Gauss-Kruger 7N",9001,4200,16307,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20068,"Pulkovo 1995 / Gauss-Kruger 8N",9001,4200,16308,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20069,"Pulkovo 1995 / Gauss-Kruger 9N",9001,4200,16309,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20070,"Pulkovo 1995 / Gauss-Kruger 10N",9001,4200,16310,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20071,"Pulkovo 1995 / Gauss-Kruger 11N",9001,4200,16311,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20072,"Pulkovo 1995 / Gauss-Kruger 12N",9001,4200,16312,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20073,"Pulkovo 1995 / Gauss-Kruger 13N",9001,4200,16313,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20074,"Pulkovo 1995 / Gauss-Kruger 14N",9001,4200,16314,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20075,"Pulkovo 1995 / Gauss-Kruger 15N",9001,4200,16315,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20076,"Pulkovo 1995 / Gauss-Kruger 16N",9001,4200,16316,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20077,"Pulkovo 1995 / Gauss-Kruger 17N",9001,4200,16317,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20078,"Pulkovo 1995 / Gauss-Kruger 18N",9001,4200,16318,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20079,"Pulkovo 1995 / Gauss-Kruger 19N",9001,4200,16319,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20080,"Pulkovo 1995 / Gauss-Kruger 20N",9001,4200,16320,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20081,"Pulkovo 1995 / Gauss-Kruger 21N",9001,4200,16321,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20082,"Pulkovo 1995 / Gauss-Kruger 22N",9001,4200,16322,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20083,"Pulkovo 1995 / Gauss-Kruger 23N",9001,4200,16323,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20084,"Pulkovo 1995 / Gauss-Kruger 24N",9001,4200,16324,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20085,"Pulkovo 1995 / Gauss-Kruger 25N",9001,4200,16325,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20086,"Pulkovo 1995 / Gauss-Kruger 26N",9001,4200,16326,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20087,"Pulkovo 1995 / Gauss-Kruger 27N",9001,4200,16327,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20088,"Pulkovo 1995 / Gauss-Kruger 28N",9001,4200,16328,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20089,"Pulkovo 1995 / Gauss-Kruger 29N",9001,4200,16329,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20090,"Pulkovo 1995 / Gauss-Kruger 30N",9001,4200,16330,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20091,"Pulkovo 1995 / Gauss-Kruger 31N",9001,4200,16331,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20092,"Pulkovo 1995 / Gauss-Kruger 32N",9001,4200,16332,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20137,"Adindan / UTM zone 37N",9001,4201,16037,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20138,"Adindan / UTM zone 38N",9001,4201,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20248,"AGD66 / AMG zone 48",9001,4202,17448,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20249,"AGD66 / AMG zone 49",9001,4202,17449,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20250,"AGD66 / AMG zone 50",9001,4202,17450,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20251,"AGD66 / AMG zone 51",9001,4202,17451,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20252,"AGD66 / AMG zone 52",9001,4202,17452,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20253,"AGD66 / AMG zone 53",9001,4202,17453,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20254,"AGD66 / AMG zone 54",9001,4202,17454,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20255,"AGD66 / AMG zone 55",9001,4202,17455,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20256,"AGD66 / AMG zone 56",9001,4202,17456,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20257,"AGD66 / AMG zone 57",9001,4202,17457,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20258,"AGD66 / AMG zone 58",9001,4202,17458,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20348,"AGD84 / AMG zone 48",9001,4203,17448,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20349,"AGD84 / AMG zone 49",9001,4203,17449,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20350,"AGD84 / AMG zone 50",9001,4203,17450,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20351,"AGD84 / AMG zone 51",9001,4203,17451,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20352,"AGD84 / AMG zone 52",9001,4203,17452,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20353,"AGD84 / AMG zone 53",9001,4203,17453,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20354,"AGD84 / AMG zone 54",9001,4203,17454,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20355,"AGD84 / AMG zone 55",9001,4203,17455,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20356,"AGD84 / AMG zone 56",9001,4203,17456,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20357,"AGD84 / AMG zone 57",9001,4203,17457,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20358,"AGD84 / AMG zone 58",9001,4203,17458,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20437,"Ain el Abd / UTM zone 37N",9001,4204,16037,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20438,"Ain el Abd / UTM zone 38N",9001,4204,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20439,"Ain el Abd / UTM zone 39N",9001,4204,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20499,"Ain el Abd / Bahrain Grid",9001,4204,19900,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20538,"Afgooye / UTM zone 38N",9001,4205,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20539,"Afgooye / UTM zone 39N",9001,4205,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+20790,"Lisbon (Lisbon)/Portuguese National Grid",9001,4803,19936,9807,8801,39.4,9110,8802,1.0,9110,8805,1.0,9201,8806,200000.0,9001,8807,300000.0,9001,,,,,,
+20791,"Lisbon (Lisbon)/Portuguese Grid",9001,4803,19969,9807,8801,39.4,9110,8802,1.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+20822,"Aratu / UTM zone 22S",9001,4208,16122,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20823,"Aratu / UTM zone 23S",9001,4208,16123,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20824,"Aratu / UTM zone 24S",9001,4208,16124,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20934,"Arc 1950 / UTM zone 34S",9001,4209,16134,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20935,"Arc 1950 / UTM zone 35S",9001,4209,16135,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+20936,"Arc 1950 / UTM zone 36S",9001,4209,16136,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+21035,"Arc 1960 / UTM zone 35S",9001,4210,16135,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+21036,"Arc 1960 / UTM zone 36S",9001,4210,16136,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+21037,"Arc 1960 / UTM zone 37S",9001,4210,16137,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+21095,"Arc 1960 / UTM zone 35N",9001,4210,16035,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21096,"Arc 1960 / UTM zone 36N",9001,4210,16036,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21097,"Arc 1960 / UTM zone 37N",9001,4210,16037,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21100,"Batavia (Jakarta) / NEIEZ",9001,4813,19905,9804,8801,0.0,9102,8802,110.0,9102,8805,0.997,9201,8806,3900000.0,9001,8807,900000.0,9001,,,,,,
+21148,"Batavia / UTM zone 48S",9001,4211,16148,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+21149,"Batavia / UTM zone 49S",9001,4211,16149,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+21150,"Batavia / UTM zone 50S",9001,4211,16150,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+21291,"Barbados 1938 / British West Indies Grid",9001,4212,19942,9807,8801,0.0,9102,8802,-62.0,9102,8805,0.9995,9201,8806,400000.0,9001,8807,0.0,9001,,,,,,
+21292,"Barbados 1938 / Barbados National Grid",9001,4212,19943,9807,8801,13.1035,9110,8802,-59.3335,9110,8805,0.9999986,9201,8806,30000.0,9001,8807,75000.0,9001,,,,,,
+21413,"Beijing 1954 / Gauss-Kruger zone 13",9001,4214,16213,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,13500000.0,9001,8807,0.0,9001,,,,,,
+21414,"Beijing 1954 / Gauss-Kruger zone 14",9001,4214,16214,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,14500000.0,9001,8807,0.0,9001,,,,,,
+21415,"Beijing 1954 / Gauss-Kruger zone 15",9001,4214,16215,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,15500000.0,9001,8807,0.0,9001,,,,,,
+21416,"Beijing 1954 / Gauss-Kruger zone 16",9001,4214,16216,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,16500000.0,9001,8807,0.0,9001,,,,,,
+21417,"Beijing 1954 / Gauss-Kruger zone 17",9001,4214,16217,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,17500000.0,9001,8807,0.0,9001,,,,,,
+21418,"Beijing 1954 / Gauss-Kruger zone 18",9001,4214,16218,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,18500000.0,9001,8807,0.0,9001,,,,,,
+21419,"Beijing 1954 / Gauss-Kruger zone 19",9001,4214,16219,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,19500000.0,9001,8807,0.0,9001,,,,,,
+21420,"Beijing 1954 / Gauss-Kruger zone 20",9001,4214,16220,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,20500000.0,9001,8807,0.0,9001,,,,,,
+21421,"Beijing 1954 / Gauss-Kruger zone 21",9001,4214,16221,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,21500000.0,9001,8807,0.0,9001,,,,,,
+21422,"Beijing 1954 / Gauss-Kruger zone 22",9001,4214,16222,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,22500000.0,9001,8807,0.0,9001,,,,,,
+21423,"Beijing 1954 / Gauss-Kruger zone 23",9001,4214,16223,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,23500000.0,9001,8807,0.0,9001,,,,,,
+21453,"Beijing 1954 / Gauss-Kruger CM 75E",9001,4214,16313,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21454,"Beijing 1954 / Gauss-Kruger CM 81E",9001,4214,16314,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21455,"Beijing 1954 / Gauss-Kruger CM 87E",9001,4214,16315,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21456,"Beijing 1954 / Gauss-Kruger CM 93E",9001,4214,16316,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21457,"Beijing 1954 / Gauss-Kruger CM 99E",9001,4214,16317,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21458,"Beijing 1954 / Gauss-Kruger CM 105E",9001,4214,16318,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21459,"Beijing 1954 / Gauss-Kruger CM 111E",9001,4214,16319,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21460,"Beijing 1954 / Gauss-Kruger CM 117E",9001,4214,16320,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21461,"Beijing 1954 / Gauss-Kruger CM 123E",9001,4214,16321,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21462,"Beijing 1954 / Gauss-Kruger CM 129E",9001,4214,16322,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21463,"Beijing 1954 / Gauss-Kruger CM 135E",9001,4214,16323,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21473,"Beijing 1954 / Gauss-Kruger 13N",9001,4214,16313,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21474,"Beijing 1954 / Gauss-Kruger 14N",9001,4214,16314,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21475,"Beijing 1954 / Gauss-Kruger 15N",9001,4214,16315,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21476,"Beijing 1954 / Gauss-Kruger 16N",9001,4214,16316,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21477,"Beijing 1954 / Gauss-Kruger 17N",9001,4214,16317,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21478,"Beijing 1954 / Gauss-Kruger 18N",9001,4214,16318,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21479,"Beijing 1954 / Gauss-Kruger 19N",9001,4214,16319,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21480,"Beijing 1954 / Gauss-Kruger 20N",9001,4214,16320,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21481,"Beijing 1954 / Gauss-Kruger 21N",9001,4214,16321,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21482,"Beijing 1954 / Gauss-Kruger 22N",9001,4214,16322,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21483,"Beijing 1954 / Gauss-Kruger 23N",9001,4214,16323,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21500,"Belge 1950 (Brussels) / Belge Lambert 50",9001,4809,19901,9802,8821,90.0,9110,8822,0.0,9110,8823,49.5,9110,8824,51.1,9110,8826,150000.0,9001,8827,5400000.0,9001,,,
+21780,"Bern 1898 (Bern) / LV03C",9001,4801,19923,9815,8811,46.570866,9110,8812,0.0,9110,8813,90.0,9110,8814,90.0,9110,8815,1.0,9201,8816,0.0,9001,8817,0.0,9001
+21781,"CH1903 / LV03",9001,4149,19922,9815,8811,46.570866,9110,8812,7.26225,9110,8813,90.0,9110,8814,90.0,9110,8815,1.0,9201,8816,600000.0,9001,8817,200000.0,9001
+21817,"Bogota 1975 / UTM zone 17N",9001,4218,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21818,"Bogota 1975 / UTM zone 18N",9001,4218,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+21891,"Bogota 1975 / Colombia West zone",9001,4218,18051,9807,8801,4.355657,9110,8802,-77.04513,9110,8805,1.0,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+21892,"Bogota 1975 / Colombia Bogota zone",9001,4218,18052,9807,8801,4.355657,9110,8802,-74.04513,9110,8805,1.0,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+21893,"Bogota 1975 / Colombia East Central zone",9001,4218,18053,9807,8801,4.355657,9110,8802,-71.04513,9110,8805,1.0,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+21894,"Bogota 1975 / Colombia East",9001,4218,18054,9807,8801,4.355657,9110,8802,-68.04513,9110,8805,1.0,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+22032,"Camacupa / UTM zone 32S",9001,4220,16132,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+22033,"Camacupa / UTM zone 33S",9001,4220,16133,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+22091,"Camacupa / TM 11.30 SE",9001,4220,16611,9807,8801,0.0,9110,8802,11.3,9110,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+22092,"Camacupa / TM 12 SE",9001,4220,16612,9807,8801,0.0,9102,8802,12.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+22191,"Campo Inchauspe / Argentina 1",9001,4221,18031,9807,8801,-90.0,9102,8802,-72.0,9102,8805,1.0,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+22192,"Campo Inchauspe / Argentina 2",9001,4221,18032,9807,8801,-90.0,9102,8802,-69.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+22193,"Campo Inchauspe / Argentina 3",9001,4221,18033,9807,8801,-90.0,9102,8802,-66.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+22194,"Campo Inchauspe / Argentina 4",9001,4221,18034,9807,8801,-90.0,9102,8802,-63.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+22195,"Campo Inchauspe / Argentina 5",9001,4221,18035,9807,8801,-90.0,9102,8802,-60.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+22196,"Campo Inchauspe / Argentina 6",9001,4221,18036,9807,8801,-90.0,9102,8802,-57.0,9102,8805,1.0,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+22197,"Campo Inchauspe / Argentina 7",9001,4221,18037,9807,8801,-90.0,9102,8802,-54.0,9102,8805,1.0,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+22234,"Cape / UTM zone 34S",9001,4222,16134,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+22235,"Cape / UTM zone 35S",9001,4222,16135,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+22236,"Cape / UTM zone 36S",9001,4222,16136,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+22275,South African Coordinate System zone 15,9001,4222,17515,9808,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22277,South African Coordinate System zone 17,9001,4222,17517,9808,8801,0.0,9102,8802,17.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22279,South African Coordinate System zone 19,9001,4222,17519,9808,8801,0.0,9102,8802,19.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22281,South African Coordinate System zone 21,9001,4222,17521,9808,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22283,South African Coordinate System zone 23,9001,4222,17523,9808,8801,0.0,9102,8802,23.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22285,South African Coordinate System zone 25,9001,4222,17525,9808,8801,0.0,9102,8802,25.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22287,South African Coordinate System zone 27,9001,4222,17527,9808,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22289,South African Coordinate System zone 29,9001,4222,17529,9808,8801,0.0,9102,8802,29.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22291,South African Coordinate System zone 31,9001,4222,17531,9808,8801,0.0,9102,8802,31.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22293,South African Coordinate System zone 33,9001,4222,17533,9808,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22300,"Carthage (Paris) / Tunisia Mining Grid",9036,4816,19937,9816,8821,38.81973,9105,8822,7.83445,9105,8826,270.0,9036,8827,582.0,9036,,,,,,,,,
+22332,"Carthage / UTM zone 32N",9001,4223,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+22391,"Carthage / Nord Tunisie",9001,4223,18181,9801,8801,40.0,9105,8802,11.0,9105,8805,0.999625544,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+22392,"Carthage / Sud Tunisie",9001,4223,18182,9801,8801,37.0,9105,8802,11.0,9105,8805,0.999625769,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+22523,"Corrego Alegre / UTM zone 23S",9001,4225,16123,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+22524,"Corrego Alegre / UTM zone 24S",9001,4225,16124,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+22700,"Deir ez Zor / Levant Zone",9001,4227,19940,9817,8801,34.39,9110,8802,37.21,9110,8805,0.9996256,9201,8806,300000.0,9001,8807,300000.0,9001,,,,,,
+22770,"Deir ez Zor / Syria Lambert",9001,4227,19948,9801,8801,34.39,9110,8802,37.21,9110,8805,0.9996256,9201,8806,300000.0,9001,8807,300000.0,9001,,,,,,
+22780,"Deir ez Zor / Levant Stereographic",9001,4227,19949,9809,8801,38.0,9105,8802,43.5,9105,8805,0.9995341,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+22832,"Douala / UTM zone 32N",9001,4228,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+22991,"Egypt 1907 / Blue Belt",9001,4229,18071,9807,8801,30.0,9102,8802,35.0,9102,8805,1.0,9201,8806,300000.0,9001,8807,1100000.0,9001,,,,,,
+22992,"Egypt 1907 / Red Belt",9001,4229,18072,9807,8801,30.0,9102,8802,31.0,9102,8805,1.0,9201,8806,615000.0,9001,8807,810000.0,9001,,,,,,
+22993,"Egypt 1907 / Purple Belt",9001,4229,18073,9807,8801,30.0,9102,8802,27.0,9102,8805,1.0,9201,8806,700000.0,9001,8807,200000.0,9001,,,,,,
+22994,"Egypt 1907 / Extended Purple Belt",9001,4229,18074,9807,8801,30.0,9102,8802,27.0,9102,8805,1.0,9201,8806,700000.0,9001,8807,1200000.0,9001,,,,,,
+23028,"ED50 / UTM zone 28N",9001,4230,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23029,"ED50 / UTM zone 29N",9001,4230,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23030,"ED50 / UTM zone 30N",9001,4230,16030,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23031,"ED50 / UTM zone 31N",9001,4230,16031,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23032,"ED50 / UTM zone 32N",9001,4230,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23033,"ED50 / UTM zone 33N",9001,4230,16033,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23034,"ED50 / UTM zone 34N",9001,4230,16034,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23035,"ED50 / UTM zone 35N",9001,4230,16035,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23036,"ED50 / UTM zone 36N",9001,4230,16036,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23037,"ED50 / UTM zone 37N",9001,4230,16037,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23038,"ED50 / UTM zone 38N",9001,4230,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23090,"ED50 / TM 0 N",9001,4230,16400,9807,8801,0.0,9102,8802,0.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23095,"ED50 / TM 5 NE",9001,4230,16405,9807,8801,0.0,9102,8802,5.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23239,"Fahud / UTM zone 39N",9001,4232,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23240,"Fahud / UTM zone 40N",9001,4232,16040,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23433,"Garoua / UTM zone 33N",9001,4234,16033,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23700,"HD72 / EOV",9001,4237,19931,9815,8811,47.08398174,9110,8812,19.02548584,9110,8813,90.0,9110,8814,90.0,9110,8815,0.99993,9201,8816,650000.0,9001,8817,200000.0,9001
+23846,"ID74 / UTM zone 46N",9001,4238,16046,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23847,"ID74 / UTM zone 47N",9001,4238,16047,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23848,"ID74 / UTM zone 48N",9001,4238,16048,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23849,"ID74 / UTM zone 49N",9001,4238,16049,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23850,"ID74 / UTM zone 50N",9001,4238,16050,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23851,"ID74 / UTM zone 51N",9001,4238,16051,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23852,"ID74 / UTM zone 52N",9001,4238,16052,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23853,"ID74 / UTM zone 53N",9001,4238,16053,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23886,"ID74 / UTM zone 46S",9001,4238,16146,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+23887,"ID74 / UTM zone 47S",9001,4238,16147,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+23888,"ID74 / UTM zone 48S",9001,4238,16148,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+23889,"ID74 / UTM zone 49S",9001,4238,16149,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+23890,"ID74 / UTM zone 50S",9001,4238,16150,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+23891,"ID74 / UTM zone 51S",9001,4238,16151,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+23892,"ID74 / UTM zone 52S",9001,4238,16152,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+23893,"ID74 / UTM zone 53S",9001,4238,16153,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+23894,"ID74 / UTM zone 54S",9001,4238,16154,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+23946,"Indian 1954 / UTM zone 46N",9001,4239,16046,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23947,"Indian 1954 / UTM zone 47N",9001,4239,16047,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+23948,"Indian 1954 / UTM zone 48N",9001,4239,16048,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24047,"Indian 1975 / UTM zone 47N",9001,4240,16047,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24048,"Indian 1975 / UTM zone 48N",9001,4240,16048,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24100,"Jamaica 1875 / Jamaica (Old Grid)",9005,4241,19909,9801,8801,18.0,9102,8802,-77.0,9102,8805,1.0,9201,8806,550000.0,9005,8807,400000.0,9005,,,,,,
+24200,"JAD69 / Jamaica National Grid",9001,4242,19910,9801,8801,18.0,9102,8802,-77.0,9102,8805,1.0,9201,8806,250000.0,9001,8807,150000.0,9001,,,,,,
+24305,"Kalianpur 1937 / UTM zone 45N",9001,4144,16045,9807,8801,0.0,9102,8802,87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24306,"Kalianpur 1937 / UTM zone 46N",9001,4144,16046,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24311,"Kalianpur 1962 / UTM zone 41N",9001,4145,16041,9807,8801,0.0,9102,8802,63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24312,"Kalianpur 1962 / UTM zone 42N",9001,4145,16042,9807,8801,0.0,9102,8802,69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24313,"Kalianpur 1962 / UTM zone 43N",9001,4145,16043,9807,8801,0.0,9102,8802,75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24342,"Kalianpur 1975 / UTM zone 42N",9001,4146,16042,9807,8801,0.0,9102,8802,69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24343,"Kalianpur 1975 / UTM zone 43N",9001,4146,16043,9807,8801,0.0,9102,8802,75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24344,"Kalianpur 1975 / UTM zone 44N",9001,4146,16044,9807,8801,0.0,9102,8802,81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24345,"Kalianpur 1975 / UTM zone 45N",9001,4146,16045,9807,8801,0.0,9102,8802,87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24346,"Kalianpur 1975 / UTM zone 46N",9001,4146,16046,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24347,"Kalianpur 1975 / UTM zone 47N",9001,4146,16047,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24370,"Kalianpur 1880 / India zone 0",9084,4243,18110,9801,8801,39.3,9110,8802,68.0,9110,8805,0.99846154,9201,8806,2355500.0,9084,8807,2590000.0,9084,,,,,,
+24371,"Kalianpur 1880 / India zone I",9084,4243,18111,9801,8801,32.3,9110,8802,68.0,9110,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+24372,"Kalianpur 1880 / India zone IIa",9084,4243,18112,9801,8801,26.0,9102,8802,74.0,9102,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+24373,"Kalianpur 1880 / India zone III",9084,4243,18114,9801,8801,19.0,9102,8802,80.0,9102,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+24374,"Kalianpur 1880 / India zone IV",9084,4243,18116,9801,8801,12.0,9102,8802,80.0,9102,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+24375,"Kalianpur 1937 / India zone IIb",9001,4144,18238,9801,8801,26.0,9102,8802,90.0,9102,8805,0.99878641,9201,8806,2743185.69,9001,8807,914395.23,9001,,,,,,
+24376,"Kalianpur 1962 / India zone I",9001,4145,18236,9801,8801,32.3,9110,8802,68.0,9110,8805,0.99878641,9201,8806,2743196.4,9001,8807,914398.8,9001,,,,,,
+24377,"Kalianpur 1962 / India zone IIa",9001,4145,18237,9801,8801,26.0,9102,8802,74.0,9102,8805,0.99878641,9201,8806,2743196.4,9001,8807,914398.8,9001,,,,,,
+24378,"Kalianpur 1975 / India zone I",9001,4146,18231,9801,8801,32.3,9110,8802,68.0,9110,8805,0.99878641,9201,8806,2743195.5,9001,8807,914398.5,9001,,,,,,
+24379,"Kalianpur 1975 / India zone IIa",9001,4146,18232,9801,8801,26.0,9102,8802,74.0,9102,8805,0.99878641,9201,8806,2743195.5,9001,8807,914398.5,9001,,,,,,
+24380,"Kalianpur 1975 / India zone IIb",9001,4146,18235,9801,8801,26.0,9102,8802,90.0,9102,8805,0.99878641,9201,8806,2743195.5,9001,8807,914398.5,9001,,,,,,
+24381,"Kalianpur 1975 / India zone III",9001,4146,18233,9801,8801,19.0,9102,8802,80.0,9102,8805,0.99878641,9201,8806,2743195.5,9001,8807,914398.5,9001,,,,,,
+24382,"Kalianpur 1880 / India zone IIb",9084,4243,18113,9801,8801,26.0,9102,8802,90.0,9102,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+24383,"Kalianpur 1975 / India zone IV",9001,4146,18234,9801,8801,12.0,9102,8802,80.0,9102,8805,0.99878641,9201,8806,2743195.5,9001,8807,914398.5,9001,,,,,,
+24500,"Kertau / Singapore Grid",9001,4245,19920,9806,8801,1.1715528,9110,8802,103.5110808,9110,8806,30000.0,9001,8807,30000.0,9001,,,,,,,,,
+24547,"Kertau / UTM zone 47N",9001,4245,16047,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24548,"Kertau / UTM zone 48N",9001,4245,16048,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24571,"Kertau / R.S.O. Malaya (ch)",9062,4245,19935,9812,8806,40000.0,9062,8807,0.0,9062,8811,4.0,9110,8812,102.15,9110,8813,323.01328458,9110,8814,323.07483685,9110,8815,0.99984,9201
+24600,KOC Lambert,9001,4246,19906,9801,8801,32.3,9110,8802,45.0,9110,8805,0.9987864078,9201,8806,1500000.0,9001,8807,1166200.0,9001,,,,,,
+24718,"La Canoa / UTM zone 18N",9001,4247,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24719,"La Canoa / UTM zone 19N",9001,4247,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24720,"La Canoa / UTM zone 20N",9001,4247,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24818,"PSAD56 / UTM zone 18N",9001,4248,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24819,"PSAD56 / UTM zone 19N",9001,4248,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24820,"PSAD56 / UTM zone 20N",9001,4248,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24821,"PSAD56 / UTM zone 21N",9001,4248,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+24877,"PSAD56 / UTM zone 17S",9001,4248,16117,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+24878,"PSAD56 / UTM zone 18S",9001,4248,16118,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+24879,"PSAD56 / UTM zone 19S",9001,4248,16119,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+24880,"PSAD56 / UTM zone 20S",9001,4248,16120,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+24882,"PSAD56 / UTM zone 22S",9001,4248,16122,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+24891,"PSAD56 / Peru west zone",9001,4248,18161,9807,8801,-6.0,9110,8802,-80.3,9110,8805,0.99983008,9201,8806,222000.0,9001,8807,1426834.743,9001,,,,,,
+24892,"PSAD56 / Peru central zone",9001,4248,18162,9807,8801,-9.3,9110,8802,-76.0,9110,8805,0.99932994,9201,8806,720000.0,9001,8807,1039979.159,9001,,,,,,
+24893,"PSAD56 / Peru east zone",9001,4248,18163,9807,8801,-9.3,9110,8802,-70.3,9110,8805,0.99952992,9201,8806,1324000.0,9001,8807,1040084.558,9001,,,,,,
+25000,"Leigon / Ghana Metre Grid",9001,4250,19904,9807,8801,4.4,9110,8802,-1.0,9110,8805,0.99975,9201,8806,274319.51,9001,8807,0.0,9001,,,,,,
+25231,"Lome / UTM zone 31N",9001,4252,16031,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25391,"Luzon 1911 / Philippines zone I",9001,4253,18171,9807,8801,0.0,9102,8802,117.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25392,"Luzon 1911 / Philippines zone II",9001,4253,18172,9807,8801,0.0,9102,8802,119.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25393,"Luzon 1911 / Philippines zone III",9001,4253,18173,9807,8801,0.0,9102,8802,121.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25394,"Luzon 1911 / Philippines zone IV",9001,4253,18174,9807,8801,0.0,9102,8802,123.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25395,"Luzon 1911 / Philippines zone V",9001,4253,18175,9807,8801,0.0,9102,8802,125.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25700,"Makassar (Jakarta) / NEIEZ",9001,4804,19905,9804,8801,0.0,9102,8802,110.0,9102,8805,0.997,9201,8806,3900000.0,9001,8807,900000.0,9001,,,,,,
+25828,"ETRS89 / UTM zone 28N",9001,4258,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25829,"ETRS89 / UTM zone 29N",9001,4258,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25830,"ETRS89 / UTM zone 30N",9001,4258,16030,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25831,"ETRS89 / UTM zone 31N",9001,4258,16031,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25832,"ETRS89 / UTM zone 32N",9001,4258,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25833,"ETRS89 / UTM zone 33N",9001,4258,16033,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25834,"ETRS89 / UTM zone 34N",9001,4258,16034,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25835,"ETRS89 / UTM zone 35N",9001,4258,16035,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25836,"ETRS89 / UTM zone 36N",9001,4258,16036,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25837,"ETRS89 / UTM zone 37N",9001,4258,16037,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25838,"ETRS89 / UTM zone 38N",9001,4258,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25884,"ETRS89 / TM Baltic93",9001,4258,19939,9807,8801,0.0,9102,8802,24.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+25932,"Malongo 1987 / UTM zone 32S",9001,4259,16132,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+26191,"Merchich / Nord Maroc",9001,4261,18131,9801,8801,37.0,9105,8802,-6.0,9105,8805,0.999625769,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+26192,"Merchich / Sud Maroc",9001,4261,18132,9801,8801,33.0,9105,8802,-6.0,9105,8805,0.999615596,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+26193,"Merchich / Sahara",9001,4261,18133,9801,8801,29.0,9105,8802,-6.0,9105,8805,0.9996,9201,8806,1200000.0,9001,8807,400000.0,9001,,,,,,
+26237,"Massawa / UTM zone 37N",9001,4262,16037,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26331,"Minna / UTM zone 31N",9001,4263,16031,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26332,"Minna / UTM zone 32N",9001,4263,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26391,"Minna / Nigeria West Belt",9001,4263,18151,9807,8801,4.0,9110,8802,4.3,9110,8805,0.99975,9201,8806,230738.26,9001,8807,0.0,9001,,,,,,
+26392,"Minna / Nigeria Mid Belt",9001,4263,18152,9807,8801,4.0,9110,8802,8.3,9110,8805,0.99975,9201,8806,670553.98,9001,8807,0.0,9001,,,,,,
+26393,"Minna / Nigeria East Belt",9001,4263,18153,9807,8801,4.0,9110,8802,12.3,9110,8805,0.99975,9201,8806,1110369.7,9001,8807,0.0,9001,,,,,,
+26432,"Mhast / UTM zone 32S",9001,4264,16132,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+26591,"Monte Mario (Rome) / Italy zone 1",9001,4806,18121,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+26592,"Monte Mario (Rome) / Italy zone 2",9001,4806,18122,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,2520000.0,9001,8807,0.0,9001,,,,,,
+26632,"M'poraloko / UTM zone 32N",9001,4266,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26692,"M'poraloko / UTM zone 32S",9001,4266,16132,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+26703,"NAD27 / UTM zone 3N",9001,4267,16003,9807,8801,0.0,9102,8802,-165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26704,"NAD27 / UTM zone 4N",9001,4267,16004,9807,8801,0.0,9102,8802,-159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26705,"NAD27 / UTM zone 5N",9001,4267,16005,9807,8801,0.0,9102,8802,-153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26706,"NAD27 / UTM zone 6N",9001,4267,16006,9807,8801,0.0,9102,8802,-147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26707,"NAD27 / UTM zone 7N",9001,4267,16007,9807,8801,0.0,9102,8802,-141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26708,"NAD27 / UTM zone 8N",9001,4267,16008,9807,8801,0.0,9102,8802,-135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26709,"NAD27 / UTM zone 9N",9001,4267,16009,9807,8801,0.0,9102,8802,-129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26710,"NAD27 / UTM zone 10N",9001,4267,16010,9807,8801,0.0,9102,8802,-123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26711,"NAD27 / UTM zone 11N",9001,4267,16011,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26712,"NAD27 / UTM zone 12N",9001,4267,16012,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26713,"NAD27 / UTM zone 13N",9001,4267,16013,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26714,"NAD27 / UTM zone 14N",9001,4267,16014,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26715,"NAD27 / UTM zone 15N",9001,4267,16015,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26716,"NAD27 / UTM zone 16N",9001,4267,16016,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26717,"NAD27 / UTM zone 17N",9001,4267,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26718,"NAD27 / UTM zone 18N",9001,4267,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26719,"NAD27 / UTM zone 19N",9001,4267,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26720,"NAD27 / UTM zone 20N",9001,4267,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26721,"NAD27 / UTM zone 21N",9001,4267,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26722,"NAD27 / UTM zone 22N",9001,4267,16022,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26729,"NAD27 / Alabama East",9003,4267,10101,9807,8801,30.3,9110,8802,-85.5,9110,8805,0.99996,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26730,"NAD27 / Alabama West",9003,4267,10102,9807,8801,30.0,9110,8802,-87.3,9110,8805,0.999933333,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26731,"NAD27 / Alaska zone 1",9003,4267,15001,9812,8806,16404166.67,9003,8807,-16404166.67,9003,8811,57.0,9110,8812,-133.4,9110,8813,323.07483685,9110,8814,323.07483685,9110,8815,0.9999,9201
+26732,"NAD27 / Alaska zone 2",9003,4267,15002,9807,8801,54.0,9102,8802,-142.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26733,"NAD27 / Alaska zone 3",9003,4267,15003,9807,8801,54.0,9102,8802,-146.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26734,"NAD27 / Alaska zone 4",9003,4267,15004,9807,8801,54.0,9102,8802,-150.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26735,"NAD27 / Alaska zone 5",9003,4267,15005,9807,8801,54.0,9102,8802,-154.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26736,"NAD27 / Alaska zone 6",9003,4267,15006,9807,8801,54.0,9102,8802,-158.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26737,"NAD27 / Alaska zone 7",9003,4267,15007,9807,8801,54.0,9102,8802,-162.0,9102,8805,0.9999,9201,8806,700000.0,9003,8807,0.0,9003,,,,,,
+26738,"NAD27 / Alaska zone 8",9003,4267,15008,9807,8801,54.0,9102,8802,-166.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26739,"NAD27 / Alaska zone 9",9003,4267,15009,9807,8801,54.0,9102,8802,-170.0,9102,8805,0.9999,9201,8806,600000.0,9003,8807,0.0,9003,,,,,,
+26740,"NAD27 / Alaska zone 10",9003,4267,15010,9802,8821,51.0,9110,8822,-176.0,9110,8823,53.5,9110,8824,51.5,9110,8826,3000000.0,9003,8827,0.0,9003,,,
+26741,"NAD27 / California zone I",9003,4267,10401,9802,8821,39.2,9110,8822,-122.0,9110,8823,41.4,9110,8824,40.0,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26742,"NAD27 / California zone II",9003,4267,10402,9802,8821,37.4,9110,8822,-122.0,9110,8823,39.5,9110,8824,38.2,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26743,"NAD27 / California zone III",9003,4267,10403,9802,8821,36.3,9110,8822,-120.3,9110,8823,38.26,9110,8824,37.04,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26744,"NAD27 / California zone IV",9003,4267,10404,9802,8821,35.2,9110,8822,-119.0,9110,8823,37.15,9110,8824,36.0,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26745,"NAD27 / California zone V",9003,4267,10405,9802,8821,33.3,9110,8822,-118.0,9110,8823,35.28,9110,8824,34.02,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26746,"NAD27 / California zone VI",9003,4267,10406,9802,8821,32.1,9110,8822,-116.15,9110,8823,33.53,9110,8824,32.47,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26747,"NAD27 / California zone VII",9003,4267,10407,9802,8821,34.08,9110,8822,-118.2,9110,8823,34.25,9110,8824,33.52,9110,8826,4186692.58,9003,8827,416926.74,9003,,,
+26748,"NAD27 / Arizona East",9003,4267,10201,9807,8801,31.0,9110,8802,-110.1,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26749,"NAD27 / Arizona Central",9003,4267,10202,9807,8801,31.0,9110,8802,-111.55,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26750,"NAD27 / Arizona West",9003,4267,10203,9807,8801,31.0,9110,8802,-113.45,9110,8805,0.999933333,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26751,"NAD27 / Arkansas North",9003,4267,10301,9802,8821,34.2,9110,8822,-92.0,9110,8823,36.14,9110,8824,34.56,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26752,"NAD27 / Arkansas South",9003,4267,10302,9802,8821,32.4,9110,8822,-92.0,9110,8823,34.46,9110,8824,33.18,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26753,"NAD27 / Colorado North",9003,4267,10501,9802,8821,39.2,9110,8822,-105.3,9110,8823,39.43,9110,8824,40.47,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26754,"NAD27 / Colorado Central",9003,4267,10502,9802,8821,37.5,9110,8822,-105.3,9110,8823,39.45,9110,8824,38.27,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26755,"NAD27 / Colorado South",9003,4267,10503,9802,8821,36.4,9110,8822,-105.3,9110,8823,38.26,9110,8824,37.14,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26756,"NAD27 / Connecticut",9003,4267,10600,9802,8821,40.5,9110,8822,-72.45,9110,8823,41.52,9110,8824,41.12,9110,8826,600000.0,9003,8827,0.0,9003,,,
+26757,"NAD27 / Delaware",9003,4267,10700,9807,8801,38.0,9110,8802,-75.25,9110,8805,0.999995,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26758,"NAD27 / Florida East",9003,4267,10901,9807,8801,24.2,9110,8802,-81.0,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26759,"NAD27 / Florida West",9003,4267,10902,9807,8801,24.2,9110,8802,-82.0,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26760,"NAD27 / Florida North",9003,4267,10903,9802,8821,29.0,9110,8822,-84.3,9110,8823,30.45,9110,8824,29.35,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26766,"NAD27 / Georgia East",9003,4267,11001,9807,8801,30.0,9110,8802,-82.1,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26767,"NAD27 / Georgia West",9003,4267,11002,9807,8801,30.0,9110,8802,-84.1,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26768,"NAD27 / Idaho East",9003,4267,11101,9807,8801,41.4,9110,8802,-112.1,9110,8805,0.999947368,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26769,"NAD27 / Idaho Central",9003,4267,11102,9807,8801,41.4,9110,8802,-114.0,9110,8805,0.999947368,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26770,"NAD27 / Idaho West",9003,4267,11103,9807,8801,41.4,9110,8802,-115.45,9110,8805,0.999933333,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26771,"NAD27 / Illinois East",9003,4267,11201,9807,8801,36.4,9110,8802,-88.2,9110,8805,0.999975,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26772,"NAD27 / Illinois West",9003,4267,11202,9807,8801,36.4,9110,8802,-90.1,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26773,"NAD27 / Indiana East",9003,4267,11301,9807,8801,37.3,9110,8802,-85.4,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26774,"NAD27 / Indiana West",9003,4267,11302,9807,8801,37.3,9110,8802,-87.05,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26775,"NAD27 / Iowa North",9003,4267,11401,9802,8821,41.3,9110,8822,-93.3,9110,8823,43.16,9110,8824,42.04,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26776,"NAD27 / Iowa South",9003,4267,11402,9802,8821,40.0,9110,8822,-93.3,9110,8823,41.47,9110,8824,40.37,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26777,"NAD27 / Kansas North",9003,4267,11501,9802,8821,38.2,9110,8822,-98.0,9110,8823,39.47,9110,8824,38.43,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26778,"NAD27 / Kansas South",9003,4267,11502,9802,8821,36.4,9110,8822,-98.3,9110,8823,38.34,9110,8824,37.16,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26779,"NAD27 / Kentucky North",9003,4267,11601,9802,8821,37.3,9110,8822,-84.15,9110,8823,37.58,9110,8824,38.58,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26780,"NAD27 / Kentucky South",9003,4267,11602,9802,8821,36.2,9110,8822,-85.45,9110,8823,36.44,9110,8824,37.56,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26781,"NAD27 / Louisiana North",9003,4267,11701,9802,8821,30.4,9110,8822,-92.3,9110,8823,31.1,9110,8824,32.4,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26782,"NAD27 / Louisiana South",9003,4267,11702,9802,8821,28.4,9110,8822,-91.2,9110,8823,29.18,9110,8824,30.42,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26783,"NAD27 / Maine East",9003,4267,11801,9807,8801,43.5,9110,8802,-68.3,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26784,"NAD27 / Maine West",9003,4267,11802,9807,8801,42.5,9110,8802,-70.1,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26785,"NAD27 / Maryland",9003,4267,11900,9802,8821,37.5,9110,8822,-77.0,9110,8823,38.18,9110,8824,39.27,9110,8826,800000.0,9003,8827,0.0,9003,,,
+26786,"NAD27 / Massachusetts Mainland",9003,4267,12001,9802,8821,41.0,9110,8822,-71.3,9110,8823,41.43,9110,8824,42.41,9110,8826,600000.0,9003,8827,0.0,9003,,,
+26787,"NAD27 / Massachusetts Island",9003,4267,12002,9802,8821,41.0,9110,8822,-70.3,9110,8823,41.17,9110,8824,41.29,9110,8826,200000.0,9003,8827,0.0,9003,,,
+26791,"NAD27 / Minnesota North",9003,4267,12201,9802,8821,46.3,9110,8822,-93.06,9110,8823,47.02,9110,8824,48.38,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26792,"NAD27 / Minnesota Central",9003,4267,12202,9802,8821,45.0,9110,8822,-94.15,9110,8823,45.37,9110,8824,47.03,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26793,"NAD27 / Minnesota South",9003,4267,12203,9802,8821,43.0,9110,8822,-94.0,9110,8823,43.47,9110,8824,45.13,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26794,"NAD27 / Mississippi East",9003,4267,12301,9807,8801,29.4,9110,8802,-88.5,9110,8805,0.99996,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26795,"NAD27 / Mississippi West",9003,4267,12302,9807,8801,30.3,9110,8802,-90.2,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26796,"NAD27 / Missouri East",9003,4267,12401,9807,8801,35.5,9110,8802,-90.3,9110,8805,0.999933333,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26797,"NAD27 / Missouri Central",9003,4267,12402,9807,8801,35.5,9110,8802,-92.3,9110,8805,0.999933333,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26798,"NAD27 / Missouri West",9003,4267,12403,9807,8801,36.1,9110,8802,-94.3,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26801,"NAD Michigan / Michigan East",9003,4268,12101,9807,8801,41.3,9110,8802,-83.4,9110,8805,0.999942857,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26802,"NAD Michigan / Michigan Old Central",9003,4268,12102,9807,8801,41.3,9110,8802,-85.45,9110,8805,0.999909091,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26803,"NAD Michigan / Michigan West",9003,4268,12103,9807,8801,41.3,9110,8802,-88.45,9110,8805,0.999909091,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+26811,"NAD Michigan / Michigan North",9003,4268,12111,9802,8821,44.47,9110,8822,-87.0,9110,8823,45.29,9110,8824,47.05,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26812,"NAD Michigan / Michigan Central",9003,4268,12112,9802,8821,43.19,9110,8822,-84.2,9110,8823,44.11,9110,8824,45.42,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26813,"NAD Michigan / Michigan South",9003,4268,12113,9802,8821,41.3,9110,8822,-84.2,9110,8823,42.06,9110,8824,43.4,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+26903,"NAD83 / UTM zone 3N",9001,4269,16003,9807,8801,0.0,9102,8802,-165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26904,"NAD83 / UTM zone 4N",9001,4269,16004,9807,8801,0.0,9102,8802,-159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26905,"NAD83 / UTM zone 5N",9001,4269,16005,9807,8801,0.0,9102,8802,-153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26906,"NAD83 / UTM zone 6N",9001,4269,16006,9807,8801,0.0,9102,8802,-147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26907,"NAD83 / UTM zone 7N",9001,4269,16007,9807,8801,0.0,9102,8802,-141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26908,"NAD83 / UTM zone 8N",9001,4269,16008,9807,8801,0.0,9102,8802,-135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26909,"NAD83 / UTM zone 9N",9001,4269,16009,9807,8801,0.0,9102,8802,-129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26910,"NAD83 / UTM zone 10N",9001,4269,16010,9807,8801,0.0,9102,8802,-123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26911,"NAD83 / UTM zone 11N",9001,4269,16011,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26912,"NAD83 / UTM zone 12N",9001,4269,16012,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26913,"NAD83 / UTM zone 13N",9001,4269,16013,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26914,"NAD83 / UTM zone 14N",9001,4269,16014,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26915,"NAD83 / UTM zone 15N",9001,4269,16015,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26916,"NAD83 / UTM zone 16N",9001,4269,16016,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26917,"NAD83 / UTM zone 17N",9001,4269,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26918,"NAD83 / UTM zone 18N",9001,4269,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26919,"NAD83 / UTM zone 19N",9001,4269,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26920,"NAD83 / UTM zone 20N",9001,4269,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26921,"NAD83 / UTM zone 21N",9001,4269,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26922,"NAD83 / UTM zone 22N",9001,4269,16022,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26923,"NAD83 / UTM zone 23N",9001,4269,16023,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26929,"NAD83 / Alabama East",9001,4269,10131,9807,8801,30.3,9110,8802,-85.5,9110,8805,0.99996,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+26930,"NAD83 / Alabama West",9001,4269,10132,9807,8801,30.0,9110,8802,-87.3,9110,8805,0.999933333,9201,8806,600000.0,9001,8807,0.0,9001,,,,,,
+26931,"NAD83 / Alaska zone 1",9001,4269,15031,9812,8806,5000000.0,9001,8807,-5000000.0,9001,8811,57.0,9110,8812,-133.4,9110,8813,323.07483685,9110,8814,323.07483685,9110,8815,0.9999,9201
+26932,"NAD83 / Alaska zone 2",9001,4269,15032,9807,8801,54.0,9102,8802,-142.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26933,"NAD83 / Alaska zone 3",9001,4269,15033,9807,8801,54.0,9102,8802,-146.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26934,"NAD83 / Alaska zone 4",9001,4269,15034,9807,8801,54.0,9102,8802,-150.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26935,"NAD83 / Alaska zone 5",9001,4269,15035,9807,8801,54.0,9102,8802,-154.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26936,"NAD83 / Alaska zone 6",9001,4269,15036,9807,8801,54.0,9102,8802,-158.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26937,"NAD83 / Alaska zone 7",9001,4269,15037,9807,8801,54.0,9102,8802,-162.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26938,"NAD83 / Alaska zone 8",9001,4269,15038,9807,8801,54.0,9102,8802,-166.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26939,"NAD83 / Alaska zone 9",9001,4269,15039,9807,8801,54.0,9102,8802,-170.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26940,"NAD83 / Alaska zone 10",9001,4269,15040,9802,8821,51.0,9110,8822,-176.0,9110,8823,53.5,9110,8824,51.5,9110,8826,1000000.0,9001,8827,0.0,9001,,,
+26941,"NAD83 / California zone 1",9001,4269,10431,9802,8821,39.2,9110,8822,-122.0,9110,8823,41.4,9110,8824,40.0,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+26942,"NAD83 / California zone 2",9001,4269,10432,9802,8821,37.4,9110,8822,-122.0,9110,8823,39.5,9110,8824,38.2,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+26943,"NAD83 / California zone 3",9001,4269,10433,9802,8821,36.3,9110,8822,-120.3,9110,8823,38.26,9110,8824,37.04,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+26944,"NAD83 / California zone 4",9001,4269,10434,9802,8821,35.2,9110,8822,-119.0,9110,8823,37.15,9110,8824,36.0,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+26945,"NAD83 / California zone 5",9001,4269,10435,9802,8821,33.3,9110,8822,-118.0,9110,8823,35.28,9110,8824,34.02,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+26946,"NAD83 / California zone 6",9001,4269,10436,9802,8821,32.1,9110,8822,-116.15,9110,8823,33.53,9110,8824,32.47,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+26948,"NAD83 / Arizona East",9001,4269,10231,9807,8801,31.0,9110,8802,-110.1,9110,8805,0.9999,9201,8806,213360.0,9001,8807,0.0,9001,,,,,,
+26949,"NAD83 / Arizona Central",9001,4269,10232,9807,8801,31.0,9110,8802,-111.55,9110,8805,0.9999,9201,8806,213360.0,9001,8807,0.0,9001,,,,,,
+26950,"NAD83 / Arizona West",9001,4269,10233,9807,8801,31.0,9110,8802,-113.45,9110,8805,0.999933333,9201,8806,213360.0,9001,8807,0.0,9001,,,,,,
+26951,"NAD83 / Arkansas North",9001,4269,10331,9802,8821,34.2,9110,8822,-92.0,9110,8823,36.14,9110,8824,34.56,9110,8826,400000.0,9001,8827,0.0,9001,,,
+26952,"NAD83 / Arkansas South",9001,4269,10332,9802,8821,32.4,9110,8822,-92.0,9110,8823,34.46,9110,8824,33.18,9110,8826,400000.0,9001,8827,400000.0,9001,,,
+26953,"NAD83 / Colorado North",9001,4269,10531,9802,8821,39.2,9110,8822,-105.3,9110,8823,40.47,9110,8824,39.43,9110,8826,914401.8289,9001,8827,304800.6096,9001,,,
+26954,"NAD83 / Colorado Central",9001,4269,10532,9802,8821,37.5,9110,8822,-105.3,9110,8823,39.45,9110,8824,38.27,9110,8826,914401.8289,9001,8827,304800.6096,9001,,,
+26955,"NAD83 / Colorado South",9001,4269,10533,9802,8821,36.4,9110,8822,-105.3,9110,8823,38.26,9110,8824,37.14,9110,8826,914401.8289,9001,8827,304800.6096,9001,,,
+26956,"NAD83 / Connecticut",9001,4269,10630,9802,8821,40.5,9110,8822,-72.45,9110,8823,41.52,9110,8824,41.12,9110,8826,304800.6096,9001,8827,152400.3048,9001,,,
+26957,"NAD83 / Delaware",9001,4269,10730,9807,8801,38.0,9110,8802,-75.25,9110,8805,0.999995,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+26958,"NAD83 / Florida East",9001,4269,10931,9807,8801,24.2,9110,8802,-81.0,9110,8805,0.999941177,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+26959,"NAD83 / Florida West",9001,4269,10932,9807,8801,24.2,9110,8802,-82.0,9110,8805,0.999941177,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+26960,"NAD83 / Florida North",9001,4269,10933,9802,8821,29.0,9110,8822,-84.3,9110,8823,30.45,9110,8824,29.35,9110,8826,600000.0,9001,8827,0.0,9001,,,
+26961,"NAD83 / Hawaii zone 1",9001,4269,15131,9807,8801,18.5,9110,8802,-155.3,9110,8805,0.999966667,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26962,"NAD83 / Hawaii zone 2",9001,4269,15132,9807,8801,20.2,9110,8802,-156.4,9110,8805,0.999966667,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26963,"NAD83 / Hawaii zone 3",9001,4269,15133,9807,8801,21.1,9110,8802,-158.0,9110,8805,0.99999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26964,"NAD83 / Hawaii zone 4",9001,4269,15134,9807,8801,21.5,9110,8802,-159.3,9110,8805,0.99999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26965,"NAD83 / Hawaii zone 5",9001,4269,15135,9807,8801,21.4,9110,8802,-160.1,9110,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26966,"NAD83 / Georgia East",9001,4269,11031,9807,8801,30.0,9110,8802,-82.1,9110,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+26967,"NAD83 / Georgia West",9001,4269,11032,9807,8801,30.0,9110,8802,-84.1,9110,8805,0.9999,9201,8806,700000.0,9001,8807,0.0,9001,,,,,,
+26968,"NAD83 / Idaho East",9001,4269,11131,9807,8801,41.4,9110,8802,-112.1,9110,8805,0.999947368,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+26969,"NAD83 / Idaho Central",9001,4269,11132,9807,8801,41.4,9110,8802,-114.0,9110,8805,0.999947368,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26970,"NAD83 / Idaho West",9001,4269,11133,9807,8801,41.4,9110,8802,-115.45,9110,8805,0.999933333,9201,8806,800000.0,9001,8807,0.0,9001,,,,,,
+26971,"NAD83 / Illinois East",9001,4269,11231,9807,8801,36.4,9110,8802,-88.2,9110,8805,0.999975,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+26972,"NAD83 / Illinois West",9001,4269,11232,9807,8801,36.4,9110,8802,-90.1,9110,8805,0.999941177,9201,8806,700000.0,9001,8807,0.0,9001,,,,,,
+26973,"NAD83 / Indiana East",9001,4269,11331,9807,8801,37.3,9110,8802,-85.4,9110,8805,0.999966667,9201,8806,100000.0,9001,8807,250000.0,9001,,,,,,
+26974,"NAD83 / Indiana West",9001,4269,11332,9807,8801,37.3,9110,8802,-87.05,9110,8805,0.999966667,9201,8806,900000.0,9001,8807,250000.0,9001,,,,,,
+26975,"NAD83 / Iowa North",9001,4269,11431,9802,8821,41.3,9110,8822,-93.3,9110,8823,43.16,9110,8824,42.04,9110,8826,1500000.0,9001,8827,1000000.0,9001,,,
+26976,"NAD83 / Iowa South",9001,4269,11432,9802,8821,40.0,9110,8822,-93.3,9110,8823,41.47,9110,8824,40.37,9110,8826,500000.0,9001,8827,0.0,9001,,,
+26977,"NAD83 / Kansas North",9001,4269,11531,9802,8821,38.2,9110,8822,-98.0,9110,8823,39.47,9110,8824,38.43,9110,8826,400000.0,9001,8827,0.0,9001,,,
+26978,"NAD83 / Kansas South",9001,4269,11532,9802,8821,36.4,9110,8822,-98.3,9110,8823,38.34,9110,8824,37.16,9110,8826,400000.0,9001,8827,400000.0,9001,,,
+26979,"NAD83 / Kentucky North",9001,4269,11631,9802,8821,37.3,9110,8822,-84.15,9110,8823,37.58,9110,8824,37.58,9110,8826,500000.0,9001,8827,0.0,9001,,,
+26980,"NAD83 / Kentucky South",9001,4269,11632,9802,8821,36.2,9110,8822,-85.45,9110,8823,37.56,9110,8824,36.44,9110,8826,500000.0,9001,8827,500000.0,9001,,,
+26981,"NAD83 / Louisiana North",9001,4269,11731,9802,8821,30.3,9110,8822,-92.3,9110,8823,32.4,9110,8824,31.1,9110,8826,1000000.0,9001,8827,0.0,9001,,,
+26982,"NAD83 / Louisiana South",9001,4269,11732,9802,8821,28.3,9110,8822,-91.2,9110,8823,30.42,9110,8824,29.18,9110,8826,1000000.0,9001,8827,0.0,9001,,,
+26983,"NAD83 / Maine East",9001,4269,11831,9807,8801,43.4,9110,8802,-68.3,9110,8805,0.9999,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+26984,"NAD83 / Maine West",9001,4269,11832,9807,8801,42.5,9110,8802,-70.1,9110,8805,0.999966667,9201,8806,900000.0,9001,8807,0.0,9001,,,,,,
+26985,"NAD83 / Maryland",9001,4269,11930,9802,8821,37.4,9110,8822,-77.0,9110,8823,39.27,9110,8824,38.18,9110,8826,400000.0,9001,8827,0.0,9001,,,
+26986,"NAD83 / Massachusetts Mainland",9001,4269,12031,9802,8821,41.0,9110,8822,-71.3,9110,8823,42.41,9110,8824,41.43,9110,8826,200000.0,9001,8827,750000.0,9001,,,
+26987,"NAD83 / Massachusetts Island",9001,4269,12032,9802,8821,41.0,9110,8822,-70.3,9110,8823,41.29,9110,8824,41.17,9110,8826,500000.0,9001,8827,0.0,9001,,,
+26988,"NAD83 / Michigan North",9001,4269,12141,9802,8821,44.47,9110,8822,-87.0,9110,8823,47.05,9110,8824,45.29,9110,8826,8000000.0,9001,8827,0.0,9001,,,
+26989,"NAD83 / Michigan Central",9001,4269,12142,9802,8821,43.19,9110,8822,-84.22,9110,8823,45.42,9110,8824,44.11,9110,8826,6000000.0,9001,8827,0.0,9001,,,
+26990,"NAD83 / Michigan South",9001,4269,12143,9802,8821,41.3,9110,8822,-84.22,9110,8823,43.4,9110,8824,42.06,9110,8826,4000000.0,9001,8827,0.0,9001,,,
+26991,"NAD83 / Minnesota North",9001,4269,12231,9802,8821,46.3,9110,8822,-93.06,9110,8823,48.38,9110,8824,47.02,9110,8826,800000.0,9001,8827,100000.0,9001,,,
+26992,"NAD83 / Minnesota Central",9001,4269,12232,9802,8821,45.0,9110,8822,-94.15,9110,8823,47.03,9110,8824,45.37,9110,8826,800000.0,9001,8827,100000.0,9001,,,
+26993,"NAD83 / Minnesota South",9001,4269,12233,9802,8821,43.0,9110,8822,-94.0,9110,8823,45.13,9110,8824,43.47,9110,8826,800000.0,9001,8827,100000.0,9001,,,
+26994,"NAD83 / Mississippi East",9001,4269,12331,9807,8801,29.3,9110,8802,-88.5,9110,8805,0.99995,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+26995,"NAD83 / Mississippi West",9001,4269,12332,9807,8801,29.3,9110,8802,-90.2,9110,8805,0.99995,9201,8806,700000.0,9001,8807,0.0,9001,,,,,,
+26996,"NAD83 / Missouri East",9001,4269,12431,9807,8801,35.5,9110,8802,-90.3,9110,8805,0.999933333,9201,8806,250000.0,9001,8807,0.0,9001,,,,,,
+26997,"NAD83 / Missouri Central",9001,4269,12432,9807,8801,35.5,9110,8802,-92.3,9110,8805,0.999933333,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+26998,"NAD83 / Missouri West",9001,4269,12433,9807,8801,36.1,9110,8802,-94.3,9110,8805,0.999941177,9201,8806,850000.0,9001,8807,0.0,9001,,,,,,
+27038,"Nahrwan 1967 / UTM zone 38N",9001,4270,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+27039,"Nahrwan 1967 / UTM zone 39N",9001,4270,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+27040,"Nahrwan 1967 / UTM zone 40N",9001,4270,16040,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+27120,"Naparima 1972 / UTM zone 20N",9001,4271,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+27200,"NZGD49 / New Zealand Map Grid",9001,4272,19917,9811,8801,-41.0,9102,8802,173.0,9102,8806,2510000.0,9001,8807,6023150.0,9001,,,,,,,,,
+27205,"NZGD49 / Mount Eden Circuit",9001,4272,17901,9807,8801,-36.5247515,9110,8802,174.45516217,9110,8805,0.9999,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27206,"NZGD49 / Bay of Plenty Circuit",9001,4272,17902,9807,8801,-37.45404993,9110,8802,176.27583101,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27207,"NZGD49 / Poverty Bay Circuit",9001,4272,17903,9807,8801,-38.372893,9110,8802,177.53082906,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27208,"NZGD49 / Hawkes Bay Circuit",9001,4272,17904,9807,8801,-39.39033455,9110,8802,176.40252499,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27209,"NZGD49 / Taranaki Circuit",9001,4272,17905,9807,8801,-39.08087299,9110,8802,174.13408423,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27210,"NZGD49 / Tuhirangi Circuit",9001,4272,17906,9807,8801,-39.30448934,9110,8802,175.38241325,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27211,"NZGD49 / Wanganui Circuit",9001,4272,17907,9807,8801,-40.14310097,9110,8802,175.29171586,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27212,"NZGD49 / Wairarapa Circuit",9001,4272,17908,9807,8801,-40.55319175,9110,8802,175.38504588,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27213,"NZGD49 / Wellington Circuit",9001,4272,17909,9807,8801,-41.18047507,9110,8802,174.46358432,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27214,"NZGD49 / Collingwood Circuit",9001,4272,17910,9807,8801,-40.42531326,9110,8802,172.40193674,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27215,"NZGD49 / Nelson Circuit",9001,4272,17911,9807,8801,-41.1628361,9110,8802,173.17575405,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27216,"NZGD49 / Karamea Circuit",9001,4272,17912,9807,8801,-41.17236815,9110,8802,172.06325015,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27217,"NZGD49 / Buller Circuit",9001,4272,17913,9807,8801,-41.48388903,9110,8802,171.34525362,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27218,"NZGD49 / Grey Circuit",9001,4272,17914,9807,8801,-42.20012994,9110,8802,171.32591767,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27219,"NZGD49 / Amuri Circuit",9001,4272,17915,9807,8801,-42.41208197,9110,8802,173.00364802,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27220,"NZGD49 / Marlborough Circuit",9001,4272,17916,9807,8801,-41.3240152,9110,8802,173.48074668,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27221,"NZGD49 / Hokitika Circuit",9001,4272,17917,9807,8801,-42.53107605,9110,8802,170.58479766,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27222,"NZGD49 / Okarito Circuit",9001,4272,17918,9807,8801,-43.06364613,9110,8802,170.1539333,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27223,"NZGD49 / Jacksons Bay Circuit",9001,4272,17919,9807,8801,-43.58400904,9110,8802,168.36225612,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27224,"NZGD49 / Mount Pleasant Circuit",9001,4272,17920,9807,8801,-43.35262953,9110,8802,172.43378969,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27225,"NZGD49 / Gawler Circuit",9001,4272,17921,9807,8801,-43.44553616,9110,8802,171.21386945,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27226,"NZGD49 / Timaru Circuit",9001,4272,17922,9807,8801,-44.24079933,9110,8802,171.0326103,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27227,"NZGD49 / Lindis Peak Circuit",9001,4272,17923,9807,8801,-44.44069647,9110,8802,169.28039183,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27228,"NZGD49 / Mount Nicholas Circuit",9001,4272,17924,9807,8801,-45.07584493,9110,8802,168.23551083,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27229,"NZGD49 / Mount York Circuit",9001,4272,17925,9807,8801,-45.33494142,9110,8802,167.44199024,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27230,"NZGD49 / Observation Point Circuit",9001,4272,17926,9807,8801,-45.48583078,9110,8802,170.37429426,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27231,"NZGD49 / North Taieri Circuit",9001,4272,17927,9807,8801,-45.51414481,9110,8802,170.16573208,9110,8805,0.99996,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+27232,"NZGD49 / Bluff Circuit",9001,4272,17928,9807,8801,-46.36000346,9110,8802,168.20343392,9110,8805,1.0,9201,8806,300002.66,9001,8807,699999.58,9001,,,,,,
+27258,"NZGD49 / UTM zone 58S",9001,4272,16158,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+27259,"NZGD49 / UTM zone 59S",9001,4272,16159,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+27260,"NZGD49 / UTM zone 60S",9001,4272,16160,9807,8801,0.0,9102,8802,177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+27291,"NZGD49 / North Island Grid",9040,4272,18141,9807,8801,-39.0,9110,8802,175.3,9110,8805,1.0,9201,8806,300000.0,9040,8807,400000.0,9040,,,,,,
+27292,"NZGD49 / South Island Grid",9040,4272,18142,9807,8801,-44.0,9110,8802,171.3,9110,8805,1.0,9201,8806,500000.0,9040,8807,500000.0,9040,,,,,,
+27391,"NGO 1948 (Oslo) / NGO zone I",9001,4817,18221,9807,8801,58.0,9110,8802,-4.4,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+27392,"NGO 1948 (Oslo) / NGO zone II",9001,4817,18222,9807,8801,58.0,9110,8802,-2.2,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+27393,"NGO 1948 (Oslo) / NGO zone III",9001,4817,18223,9807,8801,58.0,9110,8802,0.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+27394,"NGO 1948 (Oslo) / NGO zone IV",9001,4817,18224,9807,8801,58.0,9110,8802,2.3,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+27395,"NGO 1948 (Oslo) / NGO zone V",9001,4817,18225,9807,8801,58.0,9110,8802,6.1,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+27396,"NGO 1948 (Oslo) / NGO zone VI",9001,4817,18226,9807,8801,58.0,9110,8802,10.1,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+27397,"NGO 1948 (Oslo) / NGO zone VII",9001,4817,18227,9807,8801,58.0,9110,8802,14.1,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+27398,"NGO 1948 (Oslo) / NGO zone VIII",9001,4817,18228,9807,8801,58.0,9110,8802,18.2,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+27429,"Datum 73 / UTM zone 29N",9001,4274,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+27492,"Datum 73 / Modified Portuguese Grid",9001,4274,19974,9807,8801,39.4,9110,8802,-8.0754862,9110,8805,1.0,9201,8806,180.598,9001,8807,-86.99,9001,,,,,,
+27500,"ATF (Paris) / Nord de Guerre",9001,4901,19903,9801,8801,55.0,9105,8802,6.0,9105,8805,0.99950908,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+27561,"NTF (Paris) / Lambert Nord France",9001,4807,18091,9801,8801,55.0,9105,8802,0.0,9105,8805,0.999877341,9201,8806,600000.0,9001,8807,200000.0,9001,,,,,,
+27562,"NTF (Paris) / Lambert Centre France",9001,4807,18092,9801,8801,52.0,9105,8802,0.0,9105,8805,0.99987742,9201,8806,600000.0,9001,8807,200000.0,9001,,,,,,
+27563,"NTF (Paris) / Lambert Sud France",9001,4807,18093,9801,8801,49.0,9105,8802,0.0,9105,8805,0.999877499,9201,8806,600000.0,9001,8807,200000.0,9001,,,,,,
+27564,"NTF (Paris) / Lambert Corse",9001,4807,18094,9801,8801,46.85,9105,8802,0.0,9105,8805,0.99994471,9201,8806,234.358,9001,8807,185861.369,9001,,,,,,
+27571,"NTF (Paris) / Lambert zone I",9001,4807,18081,9801,8801,55.0,9105,8802,0.0,9105,8805,0.999877341,9201,8806,600000.0,9001,8807,1200000.0,9001,,,,,,
+27572,"NTF (Paris) / Lambert zone II",9001,4807,18082,9801,8801,52.0,9105,8802,0.0,9105,8805,0.99987742,9201,8806,600000.0,9001,8807,2200000.0,9001,,,,,,
+27573,"NTF (Paris) / Lambert zone III",9001,4807,18083,9801,8801,49.0,9105,8802,0.0,9105,8805,0.999877499,9201,8806,600000.0,9001,8807,3200000.0,9001,,,,,,
+27574,"NTF (Paris) / Lambert zone IV",9001,4807,18084,9801,8801,46.85,9105,8802,0.0,9105,8805,0.99994471,9201,8806,234.358,9001,8807,4185861.369,9001,,,,,,
+27581,"NTF (Paris) / France I",9001,4807,18081,9801,8801,55.0,9105,8802,0.0,9105,8805,0.999877341,9201,8806,600000.0,9001,8807,1200000.0,9001,,,,,,
+27582,"NTF (Paris) / France II",9001,4807,18082,9801,8801,52.0,9105,8802,0.0,9105,8805,0.99987742,9201,8806,600000.0,9001,8807,2200000.0,9001,,,,,,
+27583,"NTF (Paris) / France III",9001,4807,18083,9801,8801,49.0,9105,8802,0.0,9105,8805,0.999877499,9201,8806,600000.0,9001,8807,3200000.0,9001,,,,,,
+27584,"NTF (Paris) / France IV",9001,4807,18084,9801,8801,46.85,9105,8802,0.0,9105,8805,0.99994471,9201,8806,234.358,9001,8807,4185861.369,9001,,,,,,
+27591,"NTF (Paris) / Nord France",9001,4807,18091,9801,8801,55.0,9105,8802,0.0,9105,8805,0.999877341,9201,8806,600000.0,9001,8807,200000.0,9001,,,,,,
+27592,"NTF (Paris) / Centre France",9001,4807,18092,9801,8801,52.0,9105,8802,0.0,9105,8805,0.99987742,9201,8806,600000.0,9001,8807,200000.0,9001,,,,,,
+27593,"NTF (Paris) / Sud France",9001,4807,18093,9801,8801,49.0,9105,8802,0.0,9105,8805,0.999877499,9201,8806,600000.0,9001,8807,200000.0,9001,,,,,,
+27594,"NTF (Paris) / Corse",9001,4807,18094,9801,8801,46.85,9105,8802,0.0,9105,8805,0.99994471,9201,8806,234.358,9001,8807,185861.369,9001,,,,,,
+27700,"OSGB 1936 / British National Grid",9001,4277,19916,9807,8801,49.0,9102,8802,-2.0,9102,8805,0.999601272,9201,8806,400000.0,9001,8807,-100000.0,9001,,,,,,
+28191,"Palestine 1923 / Palestine Grid",9001,4281,18201,9806,8801,31.4402749,9110,8802,35.124349,9110,8806,170251.555,9001,8807,126867.909,9001,,,,,,,,,
+28192,"Palestine 1923 / Palestine Belt",9001,4281,18202,9807,8801,31.4402749,9110,8802,35.124349,9110,8805,1.0,9201,8806,170251.555,9001,8807,1126867.909,9001,,,,,,
+28193,"Palestine 1923 / Israeli CS Grid",9001,4281,18203,9806,8801,31.4402749,9110,8802,35.124349,9110,8806,170251.555,9001,8807,1126867.909,9001,,,,,,,,,
+28232,"Pointe Noire / UTM zone 32S",9001,4282,16132,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28348,"GDA94 / MGA zone 48",9001,4283,17348,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28349,"GDA94 / MGA zone 49",9001,4283,17349,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28350,"GDA94 / MGA zone 50",9001,4283,17350,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28351,"GDA94 / MGA zone 51",9001,4283,17351,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28352,"GDA94 / MGA zone 52",9001,4283,17352,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28353,"GDA94 / MGA zone 53",9001,4283,17353,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28354,"GDA94 / MGA zone 54",9001,4283,17354,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28355,"GDA94 / MGA zone 55",9001,4283,17355,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28356,"GDA94 / MGA zone 56",9001,4283,17356,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28357,"GDA94 / MGA zone 57",9001,4283,17357,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28358,"GDA94 / MGA zone 58",9001,4283,17358,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+28402,"Pulkovo 1942 / Gauss-Kruger zone 2",9001,4284,16202,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+28403,"Pulkovo 1942 / Gauss-Kruger zone 3",9001,4284,16203,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+28404,"Pulkovo 1942 / Gauss-Kruger zone 4",9001,4284,16204,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+28405,"Pulkovo 1942 / Gauss-Kruger zone 5",9001,4284,16205,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+28406,"Pulkovo 1942 / Gauss-Kruger zone 6",9001,4284,16206,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+28407,"Pulkovo 1942 / Gauss-Kruger zone 7",9001,4284,16207,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+28408,"Pulkovo 1942 / Gauss-Kruger zone 8",9001,4284,16208,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+28409,"Pulkovo 1942 / Gauss-Kruger zone 9",9001,4284,16209,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,9500000.0,9001,8807,0.0,9001,,,,,,
+28410,"Pulkovo 1942 / Gauss-Kruger zone 10",9001,4284,16210,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,10500000.0,9001,8807,0.0,9001,,,,,,
+28411,"Pulkovo 1942 / Gauss-Kruger zone 11",9001,4284,16211,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,11500000.0,9001,8807,0.0,9001,,,,,,
+28412,"Pulkovo 1942 / Gauss-Kruger zone 12",9001,4284,16212,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,12500000.0,9001,8807,0.0,9001,,,,,,
+28413,"Pulkovo 1942 / Gauss-Kruger zone 13",9001,4284,16213,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,13500000.0,9001,8807,0.0,9001,,,,,,
+28414,"Pulkovo 1942 / Gauss-Kruger zone 14",9001,4284,16214,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,14500000.0,9001,8807,0.0,9001,,,,,,
+28415,"Pulkovo 1942 / Gauss-Kruger zone 15",9001,4284,16215,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,15500000.0,9001,8807,0.0,9001,,,,,,
+28416,"Pulkovo 1942 / Gauss-Kruger zone 16",9001,4284,16216,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,16500000.0,9001,8807,0.0,9001,,,,,,
+28417,"Pulkovo 1942 / Gauss-Kruger zone 17",9001,4284,16217,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,17500000.0,9001,8807,0.0,9001,,,,,,
+28418,"Pulkovo 1942 / Gauss-Kruger zone 18",9001,4284,16218,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,18500000.0,9001,8807,0.0,9001,,,,,,
+28419,"Pulkovo 1942 / Gauss-Kruger zone 19",9001,4284,16219,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,19500000.0,9001,8807,0.0,9001,,,,,,
+28420,"Pulkovo 1942 / Gauss-Kruger zone 20",9001,4284,16220,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,20500000.0,9001,8807,0.0,9001,,,,,,
+28421,"Pulkovo 1942 / Gauss-Kruger zone 21",9001,4284,16221,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,21500000.0,9001,8807,0.0,9001,,,,,,
+28422,"Pulkovo 1942 / Gauss-Kruger zone 22",9001,4284,16222,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,22500000.0,9001,8807,0.0,9001,,,,,,
+28423,"Pulkovo 1942 / Gauss-Kruger zone 23",9001,4284,16223,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,23500000.0,9001,8807,0.0,9001,,,,,,
+28424,"Pulkovo 1942 / Gauss-Kruger zone 24",9001,4284,16224,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,24500000.0,9001,8807,0.0,9001,,,,,,
+28425,"Pulkovo 1942 / Gauss-Kruger zone 25",9001,4284,16225,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,25500000.0,9001,8807,0.0,9001,,,,,,
+28426,"Pulkovo 1942 / Gauss-Kruger zone 26",9001,4284,16226,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,26500000.0,9001,8807,0.0,9001,,,,,,
+28427,"Pulkovo 1942 / Gauss-Kruger zone 27",9001,4284,16227,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,27500000.0,9001,8807,0.0,9001,,,,,,
+28428,"Pulkovo 1942 / Gauss-Kruger zone 28",9001,4284,16228,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,28500000.0,9001,8807,0.0,9001,,,,,,
+28429,"Pulkovo 1942 / Gauss-Kruger zone 29",9001,4284,16229,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,29500000.0,9001,8807,0.0,9001,,,,,,
+28430,"Pulkovo 1942 / Gauss-Kruger zone 30",9001,4284,16230,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,30500000.0,9001,8807,0.0,9001,,,,,,
+28431,"Pulkovo 1942 / Gauss-Kruger zone 31",9001,4284,16231,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,31500000.0,9001,8807,0.0,9001,,,,,,
+28432,"Pulkovo 1942 / Gauss-Kruger zone 32",9001,4284,16232,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,32500000.0,9001,8807,0.0,9001,,,,,,
+28462,"Pulkovo 1942 / Gauss-Kruger 2N",9001,4284,16302,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28463,"Pulkovo 1942 / Gauss-Kruger 3N",9001,4284,16303,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28464,"Pulkovo 1942 / Gauss-Kruger 4N",9001,4284,16304,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28465,"Pulkovo 1942 / Gauss-Kruger 5N",9001,4284,16305,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28466,"Pulkovo 1942 / Gauss-Kruger 6N",9001,4284,16306,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28467,"Pulkovo 1942 / Gauss-Kruger 7N",9001,4284,16307,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28468,"Pulkovo 1942 / Gauss-Kruger 8N",9001,4284,16308,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28469,"Pulkovo 1942 / Gauss-Kruger 9N",9001,4284,16309,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28470,"Pulkovo 1942 / Gauss-Kruger 10N",9001,4284,16310,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28471,"Pulkovo 1942 / Gauss-Kruger 11N",9001,4284,16311,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28472,"Pulkovo 1942 / Gauss-Kruger 12N",9001,4284,16312,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28473,"Pulkovo 1942 / Gauss-Kruger 13N",9001,4284,16313,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28474,"Pulkovo 1942 / Gauss-Kruger 14N",9001,4284,16314,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28475,"Pulkovo 1942 / Gauss-Kruger 15N",9001,4284,16315,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28476,"Pulkovo 1942 / Gauss-Kruger 16N",9001,4284,16316,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28477,"Pulkovo 1942 / Gauss-Kruger 17N",9001,4284,16317,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28478,"Pulkovo 1942 / Gauss-Kruger 18N",9001,4284,16318,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28479,"Pulkovo 1942 / Gauss-Kruger 19N",9001,4284,16319,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28480,"Pulkovo 1942 / Gauss-Kruger 20N",9001,4284,16320,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28481,"Pulkovo 1942 / Gauss-Kruger 21N",9001,4284,16321,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28482,"Pulkovo 1942 / Gauss-Kruger 22N",9001,4284,16322,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28483,"Pulkovo 1942 / Gauss-Kruger 23N",9001,4284,16323,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28484,"Pulkovo 1942 / Gauss-Kruger 24N",9001,4284,16324,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28485,"Pulkovo 1942 / Gauss-Kruger 25N",9001,4284,16325,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28486,"Pulkovo 1942 / Gauss-Kruger 26N",9001,4284,16326,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28487,"Pulkovo 1942 / Gauss-Kruger 27N",9001,4284,16327,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28488,"Pulkovo 1942 / Gauss-Kruger 28N",9001,4284,16328,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28489,"Pulkovo 1942 / Gauss-Kruger 29N",9001,4284,16329,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28490,"Pulkovo 1942 / Gauss-Kruger 30N",9001,4284,16330,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28491,"Pulkovo 1942 / Gauss-Kruger 31N",9001,4284,16331,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28492,"Pulkovo 1942 / Gauss-Kruger 32N",9001,4284,16332,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+28600,"Qatar 1974 / Qatar National Grid",9001,4285,19919,9807,8801,24.27,9110,8802,51.13,9110,8805,0.99999,9201,8806,200000.0,9001,8807,300000.0,9001,,,,,,
+28991,"Amersfoort / RD Old",9001,4289,19913,9809,8801,52.0922178,9110,8802,5.23155,9110,8805,0.9999079,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+28992,"Amersfoort / RD New",9001,4289,19914,9809,8801,52.0922178,9110,8802,5.23155,9110,8805,0.9999079,9201,8806,155000.0,9001,8807,463000.0,9001,,,,,,
+29100,"SAD69 / Brazil Polyconic",9001,4291,19941,9818,8801,0.0,9102,8802,-54.0,9102,8806,5000000.0,9001,8807,10000000.0,9001,,,,,,,,,
+29118,"SAD69 / UTM zone 18N",9001,4291,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+29119,"SAD69 / UTM zone 19N",9001,4291,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+29120,"SAD69 / UTM zone 20N",9001,4291,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+29121,"SAD69 / UTM zone 21N",9001,4291,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+29122,"SAD69 / UTM zone 22N",9001,4291,16022,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+29177,"SAD69 / UTM zone 17S",9001,4291,16117,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29178,"SAD69 / UTM zone 18S",9001,4291,16118,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29179,"SAD69 / UTM zone 19S",9001,4291,16119,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29180,"SAD69 / UTM zone 20S",9001,4291,16120,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29181,"SAD69 / UTM zone 21S",9001,4291,16121,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29182,"SAD69 / UTM zone 22S",9001,4291,16122,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29183,"SAD69 / UTM zone 23S",9001,4291,16123,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29184,"SAD69 / UTM zone 24S",9001,4291,16124,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29185,"SAD69 / UTM zone 25S",9001,4291,16125,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29220,"Sapper Hill 1943 / UTM zone 20S",9001,4292,16120,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29221,"Sapper Hill 1943 / UTM zone 21S",9001,4292,16121,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29333,"Schwarzeck / UTM zone 33S",9001,4293,16133,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29371,South West African Coord. System zone 11,9031,4293,17611,9808,8801,-22.0,9102,8802,11.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+29373,South West African Coord. System zone 13,9031,4293,17613,9808,8801,-22.0,9102,8802,13.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+29375,South West African Coord. System zone 15,9031,4293,17615,9808,8801,-22.0,9102,8802,15.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+29377,South West African Coord. System zone 17,9031,4293,17617,9808,8801,-22.0,9102,8802,17.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+29379,South West African Coord. System zone 19,9031,4293,17619,9808,8801,-22.0,9102,8802,19.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+29381,South West African Coord. System zone 21,9031,4293,17621,9808,8801,-22.0,9102,8802,21.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+29383,South West African Coord. System zone 23,9031,4293,17623,9808,8801,-22.0,9102,8802,23.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+29385,South West African Coord. System zone 25,9031,4293,17625,9808,8801,-22.0,9102,8802,25.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+29635,"Sudan / UTM zone 35N",9001,4296,16035,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+29636,"Sudan / UTM zone 36N",9001,4296,16036,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+29700,"Tananarive (Paris) / Laborde Grid",9001,4810,19911,9815,8811,-21.0,9105,8812,49.0,9105,8813,21.0,9105,8814,21.0,9105,8815,0.9995,9201,8816,400000.0,9001,8817,800000.0,9001
+29738,"Tananarive / UTM zone 38S",9001,4297,16138,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29739,"Tananarive / UTM zone 39S",9001,4297,16139,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+29849,"Timbalai 1948 / UTM zone 49N",9001,4298,16049,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+29850,"Timbalai 1948 / UTM zone 50N",9001,4298,16050,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+29871,"Timbalai 1948 / R.S.O. Borneo (ch)",9042,4298,19956,9815,8811,4.0,9110,8812,115.0,9110,8813,53.18569537,9110,8814,53.07483685,9110,8815,0.99984,9201,8816,29352.4763,9042,8817,22014.3572,9042
+29872,"Timbalai 1948 / R.S.O. Borneo (ft)",9041,4298,19957,9815,8811,4.0,9110,8812,115.0,9110,8813,53.18569537,9110,8814,53.07483685,9110,8815,0.99984,9201,8816,1937263.44,9041,8817,1452947.58,9041
+29873,"Timbalai 1948 / R.S.O. Borneo (m)",9001,4298,19958,9815,8811,4.0,9110,8812,115.0,9110,8813,53.18569537,9110,8814,53.07483685,9110,8815,0.99984,9201,8816,590476.87,9001,8817,442857.65,9001
+29900,"TM65 / Irish National Grid",9001,4299,19908,9807,8801,53.3,9110,8802,-8.0,9110,8805,1.000035,9201,8806,200000.0,9001,8807,250000.0,9001,,,,,,
+29901,"OSNI 1952 / Irish National Grid",9001,4188,19973,9807,8801,53.3,9110,8802,-8.0,9110,8805,1.0,9201,8806,200000.0,9001,8807,250000.0,9001,,,,,,
+29902,"TM65 / Irish Grid",9001,4299,19972,9807,8801,53.3,9110,8802,-8.0,9110,8805,1.000035,9201,8806,200000.0,9001,8807,250000.0,9001,,,,,,
+29903,"TM75 / Irish Grid",9001,4300,19972,9807,8801,53.3,9110,8802,-8.0,9110,8805,1.000035,9201,8806,200000.0,9001,8807,250000.0,9001,,,,,,
+30161,"Tokyo / Japan Plane Rectangular CS I",9001,4301,17801,9807,8801,33.0,9110,8802,129.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30162,"Tokyo / Japan Plane Rectangular CS II",9001,4301,17802,9807,8801,33.0,9110,8802,131.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30163,"Tokyo / Japan Plane Rectangular CS III",9001,4301,17803,9807,8801,36.0,9110,8802,132.1,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30164,"Tokyo / Japan Plane Rectangular CS IV",9001,4301,17804,9807,8801,33.0,9110,8802,133.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30165,"Tokyo / Japan Plane Rectangular CS V",9001,4301,17805,9807,8801,36.0,9110,8802,134.2,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30166,"Tokyo / Japan Plane Rectangular CS VI",9001,4301,17806,9807,8801,36.0,9110,8802,136.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30167,"Tokyo / Japan Plane Rectangular CS VII",9001,4301,17807,9807,8801,36.0,9110,8802,137.1,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30168,"Tokyo / Japan Plane Rectangular CS VIII",9001,4301,17808,9807,8801,36.0,9110,8802,138.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30169,"Tokyo / Japan Plane Rectangular CS IX",9001,4301,17809,9807,8801,36.0,9110,8802,139.5,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30170,"Tokyo / Japan Plane Rectangular CS X",9001,4301,17810,9807,8801,40.0,9110,8802,140.5,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30171,"Tokyo / Japan Plane Rectangular CS XI",9001,4301,17811,9807,8801,44.0,9110,8802,140.15,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30172,"Tokyo / Japan Plane Rectangular CS XII",9001,4301,17812,9807,8801,44.0,9110,8802,142.15,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30173,"Tokyo / Japan Plane Rectangular CS XIII",9001,4301,17813,9807,8801,44.0,9110,8802,144.15,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30174,"Tokyo / Japan Plane Rectangular CS XIV",9001,4301,17814,9807,8801,26.0,9110,8802,142.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30175,"Tokyo / Japan Plane Rectangular CS XV",9001,4301,17815,9807,8801,26.0,9110,8802,127.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30176,"Tokyo / Japan Plane Rectangular CS XVI",9001,4301,17816,9807,8801,26.0,9110,8802,124.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30177,"Tokyo / Japan Plane Rectangular CS XVII",9001,4301,17817,9807,8801,26.0,9110,8802,131.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30178,"Tokyo / Japan Plane Rectangular CS XVIII",9001,4301,17818,9807,8801,20.0,9110,8802,136.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30179,"Tokyo / Japan Plane Rectangular CS XIX",9001,4301,17819,9807,8801,26.0,9110,8802,154.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+30200,"Trinidad 1903 / Trinidad Grid",9039,4302,19925,9806,8801,10.263,9110,8802,-61.2,9110,8806,430000.0,9039,8807,325000.0,9039,,,,,,,,,
+30339,"TC(1948) / UTM zone 39N",9001,4303,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+30340,"TC(1948) / UTM zone 40N",9001,4303,16040,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+30491,"Voirol 1875 / Nord Algerie (ancienne)",9001,4304,18011,9801,8801,40.0,9105,8802,3.0,9105,8805,0.999625544,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+30492,"Voirol 1875 / Sud Algerie (ancienne)",9001,4304,18012,9801,8801,37.0,9105,8802,3.0,9105,8805,0.999625769,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+30729,"Nord Sahara 1959 / UTM zone 29N",9001,4307,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+30730,"Nord Sahara 1959 / UTM zone 30N",9001,4307,16030,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+30731,"Nord Sahara 1959 / UTM zone 31N",9001,4307,16031,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+30732,"Nord Sahara 1959 / UTM zone 32N",9001,4307,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+30791,"Nord Sahara 1959 / Voirol Unifie Nord",9001,4307,18021,9801,8801,40.0,9105,8802,3.0,9105,8805,0.999625544,9201,8806,500135.0,9001,8807,300090.0,9001,,,,,,
+30792,"Nord Sahara 1959 / Voirol Unifie Sud",9001,4307,18022,9801,8801,37.0,9105,8802,3.0,9105,8805,0.999625769,9201,8806,500135.0,9001,8807,300090.0,9001,,,,,,
+30800,RT38 2.5 gon W,9001,4308,19929,9807,8801,0.0,9110,8802,15.48298,9110,8805,1.0,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+31028,"Yoff / UTM zone 28N",9001,4310,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31121,"Zanderij / UTM zone 21N",9001,4311,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31154,"Zanderij / TM 54 NW",9001,4311,17054,9807,8801,0.0,9102,8802,-54.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31170,"Zanderij / Suriname Old TM",9001,4311,19954,9807,8801,0.0,9110,8802,-55.41,9110,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31171,"Zanderij / Suriname TM",9001,4311,19955,9807,8801,0.0,9110,8802,-55.41,9110,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31265,"MGI / 3-degree Gauss zone 5",9001,4312,16265,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+31266,"MGI / 3-degree Gauss zone 6",9001,4312,16266,9807,8801,0.0,9102,8802,18.0,9102,8805,1.0,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+31267,"MGI / 3-degree Gauss zone 7",9001,4312,16267,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+31268,"MGI / 3-degree Gauss zone 8",9001,4312,16268,9807,8801,0.0,9102,8802,24.0,9102,8805,1.0,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+31275,"MGI / Balkans zone 5",9001,4312,18275,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9999,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+31276,"MGI / Balkans zone 6",9001,4312,18276,9807,8801,0.0,9102,8802,18.0,9102,8805,0.9999,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+31277,"MGI / Balkans zone 7",9001,4312,18277,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9999,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+31278,"MGI / Balkans zone 8",9001,4312,18277,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9999,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+31279,"MGI / Balkans zone 8",9001,4312,18278,9807,8801,0.0,9102,8802,24.0,9102,8805,0.9999,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+31281,"MGI (Ferro) / Austria West Zone",9001,4805,18041,9807,8801,0.0,9102,8802,28.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+31282,"MGI (Ferro) / Austria Central Zone",9001,4805,18042,9807,8801,0.0,9102,8802,31.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+31283,"MGI (Ferro) / Austria East Zone",9001,4805,18043,9807,8801,0.0,9102,8802,34.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+31284,"MGI / M28",9001,4312,18044,9807,8801,0.0,9110,8802,10.2,9110,8805,1.0,9201,8806,150000.0,9001,8807,0.0,9001,,,,,,
+31285,"MGI / M31",9001,4312,18045,9807,8801,0.0,9110,8802,13.2,9110,8805,1.0,9201,8806,450000.0,9001,8807,0.0,9001,,,,,,
+31286,"MGI / M34",9001,4312,18046,9807,8801,0.0,9110,8802,16.2,9110,8805,1.0,9201,8806,750000.0,9001,8807,0.0,9001,,,,,,
+31287,"MGI / Austria Lambert",9001,4312,19947,9802,8821,47.3,9110,8822,13.2,9110,8823,49.0,9110,8824,46.0,9110,8826,400000.0,9001,8827,400000.0,9001,,,
+31291,"MGI (Ferro) / Austria West Zone",9001,4805,18041,9807,8801,0.0,9102,8802,28.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+31292,"MGI (Ferro) / Austria Central Zone",9001,4805,18042,9807,8801,0.0,9102,8802,31.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+31293,"MGI (Ferro) / Austria East Zone",9001,4805,18043,9807,8801,0.0,9102,8802,34.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+31294,"MGI / M28",9001,4312,18044,9807,8801,0.0,9110,8802,10.2,9110,8805,1.0,9201,8806,150000.0,9001,8807,0.0,9001,,,,,,
+31295,"MGI / M31",9001,4312,18045,9807,8801,0.0,9110,8802,13.2,9110,8805,1.0,9201,8806,450000.0,9001,8807,0.0,9001,,,,,,
+31296,"MGI / M34",9001,4312,18046,9807,8801,0.0,9110,8802,16.2,9110,8805,1.0,9201,8806,750000.0,9001,8807,0.0,9001,,,,,,
+31297,"MGI / Austria Lambert",9001,4312,19947,9802,8821,47.3,9110,8822,13.2,9110,8823,49.0,9110,8824,46.0,9110,8826,400000.0,9001,8827,400000.0,9001,,,
+31300,"Belge 1972 / Belge Lambert 72",9001,4313,19902,9803,8821,90.0,9110,8822,4.2124983,9110,8823,49.5,9110,8824,51.1,9110,8826,150000.01256,9001,8827,5400088.4378,9001,,,
+31370,"Belge 1972 / Belgian Lambert 72",9001,4313,19961,9802,8821,90.0,9110,8822,4.2202952,9110,8823,51.100000204,9110,8824,49.500000204,9110,8826,150000.013,9001,8827,5400088.438,9001,,,
+31461,"DHDN / 3-degree Gauss zone 1",9001,4314,16261,9807,8801,0.0,9102,8802,3.0,9102,8805,1.0,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+31462,"DHDN / 3-degree Gauss zone 2",9001,4314,16262,9807,8801,0.0,9102,8802,6.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+31463,"DHDN / 3-degree Gauss zone 3",9001,4314,16263,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+31464,"DHDN / 3-degree Gauss zone 4",9001,4314,16264,9807,8801,0.0,9102,8802,12.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+31465,"DHDN / 3-degree Gauss zone 5",9001,4314,16265,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+31466,"DHDN / Gauss-Kruger zone 2",9001,4314,16262,9807,8801,0.0,9102,8802,6.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+31467,"DHDN / Gauss-Kruger zone 3",9001,4314,16263,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+31468,"DHDN / Gauss-Kruger zone 4",9001,4314,16264,9807,8801,0.0,9102,8802,12.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+31469,"DHDN / Gauss-Kruger zone 5",9001,4314,16265,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+31528,"Conakry 1905 / UTM zone 28N",9001,4315,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31529,"Conakry 1905 / UTM zone 29N",9001,4315,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31600,"Dealul Piscului 1933/ Stereo 33",9001,4316,19927,9809,8801,45.54,9110,8802,25.23328772,9110,8805,0.9996667,9201,8806,500000.0,9001,8807,500000.0,9001,,,,,,
+31700,"Dealul Piscului 1970/ Stereo 70",9001,4317,19926,9809,8801,46.0,9102,8802,25.0,9102,8805,0.99975,9201,8806,500000.0,9001,8807,500000.0,9001,,,,,,
+31838,"NGN / UTM zone 38N",9001,4318,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31839,"NGN / UTM zone 39N",9001,4318,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31900,"KUDAMS / KTM",9001,4319,19928,9807,8801,0.0,9102,8802,48.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31986,"SIRGAS / UTM zone 17N",9001,4170,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31987,"SIRGAS / UTM zone 18N",9001,4170,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31988,"SIRGAS / UTM zone 19N",9001,4170,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31989,"SIRGAS / UTM zone 20N",9001,4170,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31990,"SIRGAS / UTM zone 21N",9001,4170,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31991,"SIRGAS / UTM zone 22N",9001,4170,16022,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+31992,"SIRGAS / UTM zone 17S",9001,4170,16117,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+31993,"SIRGAS / UTM zone 18S",9001,4170,16118,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+31994,"SIRGAS / UTM zone 19S",9001,4170,16119,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+31995,"SIRGAS / UTM zone 20S",9001,4170,16120,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+31996,"SIRGAS / UTM zone 21S",9001,4170,16121,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+31997,"SIRGAS / UTM zone 22S",9001,4170,16122,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+31998,"SIRGAS / UTM zone 23S",9001,4170,16123,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+31999,"SIRGAS / UTM zone 24S",9001,4170,16124,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32000,"SIRGAS / UTM zone 25S",9001,4170,16125,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32001,"NAD27 / Montana North",9003,4267,12501,9802,8821,47.0,9110,8822,-109.3,9110,8823,48.43,9110,8824,47.51,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32002,"NAD27 / Montana Central",9003,4267,12502,9802,8821,45.5,9110,8822,-109.3,9110,8823,47.53,9110,8824,46.27,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32003,"NAD27 / Montana South",9003,4267,12503,9802,8821,44.0,9110,8822,-109.3,9110,8823,46.24,9110,8824,44.52,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32005,"NAD27 / Nebraska North",9003,4267,12601,9802,8821,41.2,9110,8822,-100.0,9110,8823,41.51,9110,8824,42.49,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32006,"NAD27 / Nebraska South",9003,4267,12602,9802,8821,39.4,9110,8822,-99.3,9110,8823,40.17,9110,8824,41.43,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32007,"NAD27 / Nevada East",9003,4267,12701,9807,8801,34.45,9110,8802,-115.35,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32008,"NAD27 / Nevada Central",9003,4267,12702,9807,8801,34.45,9110,8802,-116.4,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32009,"NAD27 / Nevada West",9003,4267,12703,9807,8801,34.45,9110,8802,-118.35,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32010,"NAD27 / New Hampshire",9003,4267,12800,9807,8801,42.3,9110,8802,-71.4,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32011,"NAD27 / New Jersey",9003,4267,12900,9807,8801,38.5,9110,8802,-74.4,9110,8805,0.999975,9201,8806,2000000.0,9003,8807,0.0,9003,,,,,,
+32012,"NAD27 / New Mexico East",9003,4267,13001,9807,8801,31.0,9110,8802,-104.2,9110,8805,0.999909091,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32013,"NAD27 / New Mexico Central",9003,4267,13002,9807,8801,31.0,9110,8802,-106.15,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32014,"NAD27 / New Mexico West",9003,4267,13003,9807,8801,31.0,9110,8802,-107.5,9110,8805,0.999916667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32015,"NAD27 / New York East",9003,4267,13101,9807,8801,40.0,9110,8802,-74.2,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32016,"NAD27 / New York Central",9003,4267,13102,9807,8801,40.0,9110,8802,-76.35,9110,8805,0.9999375,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32017,"NAD27 / New York West",9003,4267,13103,9807,8801,40.0,9110,8802,-78.35,9110,8805,0.9999375,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32018,"NAD27 / New York Long Island",9003,4267,13104,9802,8821,40.3,9110,8822,-74.0,9110,8823,41.02,9110,8824,40.4,9110,8826,1000000.0,9003,8827,0.0,9003,,,
+32019,"NAD27 / North Carolina",9003,4267,13200,9802,8821,33.45,9110,8822,-79.0,9110,8823,34.2,9110,8824,36.1,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32020,"NAD27 / North Dakota North",9003,4267,13301,9802,8821,47.0,9110,8822,-100.3,9110,8823,47.26,9110,8824,48.44,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32021,"NAD27 / North Dakota South",9003,4267,13302,9802,8821,45.4,9110,8822,-100.3,9110,8823,46.11,9110,8824,47.29,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32022,"NAD27 / Ohio North",9003,4267,13401,9802,8821,39.4,9110,8822,-82.3,9110,8823,40.26,9110,8824,41.42,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32023,"NAD27 / Ohio South",9003,4267,13402,9802,8821,38.0,9110,8822,-82.3,9110,8823,38.44,9110,8824,40.02,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32024,"NAD27 / Oklahoma North",9003,4267,13501,9802,8821,35.0,9110,8822,-98.0,9110,8823,35.34,9110,8824,36.46,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32025,"NAD27 / Oklahoma South",9003,4267,13502,9802,8821,33.2,9110,8822,-98.0,9110,8823,33.56,9110,8824,35.14,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32026,"NAD27 / Oregon North",9003,4267,13601,9802,8821,43.4,9110,8822,-120.3,9110,8823,44.2,9110,8824,46.0,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32027,"NAD27 / Oregon South",9003,4267,13602,9802,8821,41.4,9110,8822,-120.3,9110,8823,42.2,9110,8824,44.0,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32028,"NAD27 / Pennsylvania North",9003,4267,13701,9802,8821,40.1,9110,8822,-77.45,9110,8823,40.53,9110,8824,41.57,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32029,"NAD27 / Pennsylvania South",9003,4267,13702,9802,8821,39.2,9110,8822,-77.45,9110,8823,39.56,9110,8824,40.48,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32030,"NAD27 / Rhode Island",9003,4267,13800,9807,8801,41.05,9110,8802,-71.3,9110,8805,0.9999938,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32031,"NAD27 / South Carolina North",9003,4267,13901,9802,8821,33.0,9110,8822,-81.0,9110,8823,33.46,9110,8824,34.58,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32033,"NAD27 / South Carolina South",9003,4267,13902,9802,8821,31.5,9110,8822,-81.0,9110,8823,32.2,9110,8824,33.4,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32034,"NAD27 / South Dakota North",9003,4267,14001,9802,8821,43.5,9110,8822,-100.0,9110,8823,44.25,9110,8824,45.41,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32035,"NAD27 / South Dakota South",9003,4267,14002,9802,8821,42.2,9110,8822,-100.2,9110,8823,42.5,9110,8824,44.24,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32036,"NAD27 / Tennessee",9003,4267,14100,9802,8821,34.4,9110,8822,-86.0,9110,8823,35.15,9110,8824,36.25,9110,8826,100000.0,9003,8827,0.0,9003,,,
+32037,"NAD27 / Texas North",9003,4267,14201,9802,8821,34.0,9110,8822,-101.3,9110,8823,34.39,9110,8824,36.11,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32038,"NAD27 / Texas North Central",9003,4267,14202,9802,8821,31.4,9110,8822,-97.3,9110,8823,32.08,9110,8824,33.58,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32039,"NAD27 / Texas Central",9003,4267,14203,9802,8821,29.4,9110,8822,-100.2,9110,8823,30.07,9110,8824,31.53,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32040,"NAD27 / Texas South Central",9003,4267,14204,9802,8821,27.5,9110,8822,-99.0,9110,8823,28.23,9110,8824,30.17,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32041,"NAD27 / Texas South",9003,4267,14205,9802,8821,25.4,9110,8822,-98.3,9110,8823,26.1,9110,8824,27.5,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32042,"NAD27 / Utah North",9003,4267,14301,9802,8821,40.2,9110,8822,-111.3,9110,8823,40.43,9110,8824,41.47,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32043,"NAD27 / Utah Central",9003,4267,14302,9802,8821,38.2,9110,8822,-111.3,9110,8823,39.01,9110,8824,40.39,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32044,"NAD27 / Utah South",9003,4267,14303,9802,8821,36.4,9110,8822,-111.3,9110,8823,37.13,9110,8824,38.21,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32045,"NAD27 / Vermont",9003,4267,14400,9807,8801,42.3,9110,8802,-72.3,9110,8805,0.999964286,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32046,"NAD27 / Virginia North",9003,4267,14501,9802,8821,37.4,9110,8822,-78.3,9110,8823,38.02,9110,8824,39.12,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32047,"NAD27 / Virginia South",9003,4267,14502,9802,8821,36.2,9110,8822,-78.3,9110,8823,36.46,9110,8824,37.58,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32048,"NAD27 / Washington North",9003,4267,14601,9802,8821,47.0,9110,8822,-120.5,9110,8823,47.3,9110,8824,48.44,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32049,"NAD27 / Washington South",9003,4267,14602,9802,8821,45.2,9110,8822,-120.3,9110,8823,45.5,9110,8824,47.2,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32050,"NAD27 / West Virginia North",9003,4267,14701,9802,8821,38.3,9110,8822,-79.3,9110,8823,39.0,9110,8824,40.15,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32051,"NAD27 / West Virginia South",9003,4267,14702,9802,8821,37.0,9110,8822,-81.0,9110,8823,37.29,9110,8824,38.53,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32052,"NAD27 / Wisconsin North",9003,4267,14801,9802,8821,45.1,9110,8822,-90.0,9110,8823,45.34,9110,8824,46.46,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32053,"NAD27 / Wisconsin Central",9003,4267,14802,9802,8821,43.5,9110,8822,-90.0,9110,8823,44.15,9110,8824,45.3,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32054,"NAD27 / Wisconsin South",9003,4267,14803,9802,8821,42.0,9110,8822,-90.0,9110,8823,42.44,9110,8824,44.04,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+32055,"NAD27 / Wyoming East",9003,4267,14901,9807,8801,40.4,9110,8802,-105.1,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32056,"NAD27 / Wyoming East Central",9003,4267,14902,9807,8801,40.4,9110,8802,-107.2,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32057,"NAD27 / Wyoming West Central",9003,4267,14903,9807,8801,40.4,9110,8802,-108.45,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32058,"NAD27 / Wyoming West",9003,4267,14904,9807,8801,40.4,9110,8802,-110.05,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+32061,"NAD27 / Guatemala Norte",9001,4267,18211,9801,8801,16.49,9110,8802,-90.2,9110,8805,0.99992226,9201,8806,500000.0,9001,8807,292209.579,9001,,,,,,
+32062,"NAD27 / Guatemala Sur",9001,4267,18212,9801,8801,14.54,9110,8802,-90.2,9110,8805,0.99989906,9201,8806,500000.0,9001,8807,325992.681,9001,,,,,,
+32064,"NAD27 / BLM 14N (ftUS)",9003,4267,15914,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+32065,"NAD27 / BLM 15N (ftUS)",9003,4267,15915,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+32066,"NAD27 / BLM 16N (ftUS)",9003,4267,15916,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+32067,"NAD27 / BLM 17N (ftUS)",9003,4267,15917,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+32074,"NAD27 / BLM 14N (feet)",9003,4267,15914,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+32075,"NAD27 / BLM 15N (feet)",9003,4267,15915,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+32076,"NAD27 / BLM 16N (feet)",9003,4267,15916,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+32077,"NAD27 / BLM 17N (feet)",9003,4267,15917,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+32081,"NAD27 / MTM zone 1",9001,4267,17701,9807,8801,0.0,9102,8802,-53.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32082,"NAD27 / MTM zone 2",9001,4267,17702,9807,8801,0.0,9102,8802,-56.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32083,"NAD27 / MTM zone 3",9001,4267,17703,9807,8801,0.0,9110,8802,-58.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32084,"NAD27 / MTM zone 4",9001,4267,17704,9807,8801,0.0,9110,8802,-61.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32085,"NAD27 / MTM zone 5",9001,4267,17705,9807,8801,0.0,9110,8802,-64.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32086,"NAD27 / MTM zone 6",9001,4267,17706,9807,8801,0.0,9110,8802,-67.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32098,"NAD27 / Quebec Lambert",9001,4267,19944,9802,8821,44.0,9110,8822,-68.3,9110,8823,60.0,9110,8824,46.0,9110,8826,0.0,9001,8827,0.0,9001,,,
+32100,"NAD83 / Montana",9001,4269,12530,9802,8821,44.15,9110,8822,-109.3,9110,8823,49.0,9110,8824,45.0,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32104,"NAD83 / Nebraska",9001,4269,12630,9802,8821,39.5,9110,8822,-100.0,9110,8823,43.0,9110,8824,40.0,9110,8826,500000.0,9001,8827,0.0,9001,,,
+32107,"NAD83 / Nevada East",9001,4269,12731,9807,8801,34.45,9110,8802,-115.35,9110,8805,0.9999,9201,8806,200000.0,9001,8807,8000000.0,9001,,,,,,
+32108,"NAD83 / Nevada Central",9001,4269,12732,9807,8801,34.45,9110,8802,-116.4,9110,8805,0.9999,9201,8806,500000.0,9001,8807,6000000.0,9001,,,,,,
+32109,"NAD83 / Nevada West",9001,4269,12733,9807,8801,34.45,9110,8802,-118.35,9110,8805,0.9999,9201,8806,800000.0,9001,8807,4000000.0,9001,,,,,,
+32110,"NAD83 / New Hampshire",9001,4269,12830,9807,8801,42.3,9110,8802,-71.4,9110,8805,0.999966667,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+32111,"NAD83 / New Jersey",9001,4269,12930,9807,8801,38.5,9110,8802,-74.3,9110,8805,0.9999,9201,8806,150000.0,9001,8807,0.0,9001,,,,,,
+32112,"NAD83 / New Mexico East",9001,4269,13031,9807,8801,31.0,9110,8802,-104.2,9110,8805,0.999909091,9201,8806,165000.0,9001,8807,0.0,9001,,,,,,
+32113,"NAD83 / New Mexico Central",9001,4269,13032,9807,8801,31.0,9110,8802,-106.15,9110,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32114,"NAD83 / New Mexico West",9001,4269,13033,9807,8801,31.0,9110,8802,-107.5,9110,8805,0.999916667,9201,8806,830000.0,9001,8807,0.0,9001,,,,,,
+32115,"NAD83 / New York East",9001,4269,13131,9807,8801,38.5,9110,8802,-74.3,9110,8805,0.9999,9201,8806,150000.0,9001,8807,0.0,9001,,,,,,
+32116,"NAD83 / New York Central",9001,4269,13132,9807,8801,40.0,9110,8802,-76.35,9110,8805,0.9999375,9201,8806,250000.0,9001,8807,0.0,9001,,,,,,
+32117,"NAD83 / New York West",9001,4269,13133,9807,8801,40.0,9110,8802,-78.35,9110,8805,0.9999375,9201,8806,350000.0,9001,8807,0.0,9001,,,,,,
+32118,"NAD83 / New York Long Island",9001,4269,13134,9802,8821,40.1,9110,8822,-74.0,9110,8823,41.02,9110,8824,40.4,9110,8826,300000.0,9001,8827,0.0,9001,,,
+32119,"NAD83 / North Carolina",9001,4269,13230,9802,8821,33.45,9110,8822,-79.0,9110,8823,36.1,9110,8824,34.2,9110,8826,609601.22,9001,8827,0.0,9001,,,
+32120,"NAD83 / North Dakota North",9001,4269,13331,9802,8821,47.0,9110,8822,-100.3,9110,8823,48.44,9110,8824,47.26,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32121,"NAD83 / North Dakota South",9001,4269,13332,9802,8821,45.4,9110,8822,-100.3,9110,8823,47.29,9110,8824,46.11,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32122,"NAD83 / Ohio North",9001,4269,13431,9802,8821,39.4,9110,8822,-82.3,9110,8823,41.42,9110,8824,40.26,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32123,"NAD83 / Ohio South",9001,4269,13432,9802,8821,38.0,9110,8822,-82.3,9110,8823,40.02,9110,8824,38.44,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32124,"NAD83 / Oklahoma North",9001,4269,13531,9802,8821,35.0,9110,8822,-98.0,9110,8823,36.46,9110,8824,35.34,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32125,"NAD83 / Oklahoma South",9001,4269,13532,9802,8821,33.2,9110,8822,-98.0,9110,8823,35.14,9110,8824,33.56,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32126,"NAD83 / Oregon North",9001,4269,13631,9802,8821,43.4,9110,8822,-120.3,9110,8823,46.0,9110,8824,44.2,9110,8826,2500000.0,9001,8827,0.0,9001,,,
+32127,"NAD83 / Oregon South",9001,4269,13632,9802,8821,41.4,9110,8822,-120.3,9110,8823,44.0,9110,8824,42.2,9110,8826,1500000.0,9001,8827,0.0,9001,,,
+32128,"NAD83 / Pennsylvania North",9001,4269,13731,9802,8821,40.1,9110,8822,-77.45,9110,8823,41.57,9110,8824,40.53,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32129,"NAD83 / Pennsylvania South",9001,4269,13732,9802,8821,39.2,9110,8822,-77.45,9110,8823,40.58,9110,8824,39.56,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32130,"NAD83 / Rhode Island",9001,4269,13830,9807,8801,41.05,9110,8802,-71.3,9110,8805,0.99999375,9201,8806,100000.0,9001,8807,0.0,9001,,,,,,
+32133,"NAD83 / South Carolina",9001,4269,13930,9802,8821,31.5,9110,8822,-81.0,9110,8823,34.5,9110,8824,32.3,9110,8826,609600.0,9001,8827,0.0,9001,,,
+32134,"NAD83 / South Dakota North",9001,4269,14031,9802,8821,43.5,9110,8822,-100.0,9110,8823,45.41,9110,8824,44.25,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32135,"NAD83 / South Dakota South",9001,4269,14032,9802,8821,42.2,9110,8822,-100.2,9110,8823,44.24,9110,8824,42.5,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32136,"NAD83 / Tennessee",9001,4269,14130,9802,8821,34.2,9110,8822,-86.0,9110,8823,36.25,9110,8824,35.15,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32137,"NAD83 / Texas North",9001,4269,14231,9802,8821,34.0,9110,8822,-101.3,9110,8823,36.11,9110,8824,34.39,9110,8826,200000.0,9001,8827,1000000.0,9001,,,
+32138,"NAD83 / Texas North Central",9001,4269,14232,9802,8821,31.4,9110,8822,-98.3,9110,8823,33.58,9110,8824,32.08,9110,8826,600000.0,9001,8827,2000000.0,9001,,,
+32139,"NAD83 / Texas Central",9001,4269,14233,9802,8821,29.4,9110,8822,-100.2,9110,8823,31.53,9110,8824,30.07,9110,8826,700000.0,9001,8827,3000000.0,9001,,,
+32140,"NAD83 / Texas South Central",9001,4269,14234,9802,8821,27.5,9110,8822,-99.0,9110,8823,30.17,9110,8824,28.23,9110,8826,600000.0,9001,8827,4000000.0,9001,,,
+32141,"NAD83 / Texas South",9001,4269,14235,9802,8821,25.4,9110,8822,-98.3,9110,8823,27.5,9110,8824,26.1,9110,8826,300000.0,9001,8827,5000000.0,9001,,,
+32142,"NAD83 / Utah North",9001,4269,14331,9802,8821,40.2,9110,8822,-111.3,9110,8823,41.47,9110,8824,40.43,9110,8826,500000.0,9001,8827,1000000.0,9001,,,
+32143,"NAD83 / Utah Central",9001,4269,14332,9802,8821,38.2,9110,8822,-111.3,9110,8823,40.39,9110,8824,39.01,9110,8826,500000.0,9001,8827,2000000.0,9001,,,
+32144,"NAD83 / Utah South",9001,4269,14333,9802,8821,36.4,9110,8822,-111.3,9110,8823,38.21,9110,8824,37.13,9110,8826,500000.0,9001,8827,3000000.0,9001,,,
+32145,"NAD83 / Vermont",9001,4269,14430,9807,8801,42.3,9110,8802,-72.3,9110,8805,0.999964286,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32146,"NAD83 / Virginia North",9001,4269,14531,9802,8821,37.4,9110,8822,-78.3,9110,8823,39.12,9110,8824,38.02,9110,8826,3500000.0,9001,8827,2000000.0,9001,,,
+32147,"NAD83 / Virginia South",9001,4269,14532,9802,8821,36.2,9110,8822,-78.3,9110,8823,37.58,9110,8824,36.46,9110,8826,3500000.0,9001,8827,1000000.0,9001,,,
+32148,"NAD83 / Washington North",9001,4269,14631,9802,8821,47.0,9110,8822,-120.5,9110,8823,48.44,9110,8824,47.3,9110,8826,500000.0,9001,8827,0.0,9001,,,
+32149,"NAD83 / Washington South",9001,4269,14632,9802,8821,45.2,9110,8822,-120.3,9110,8823,47.2,9110,8824,45.5,9110,8826,500000.0,9001,8827,0.0,9001,,,
+32150,"NAD83 / West Virginia North",9001,4269,14731,9802,8821,38.3,9110,8822,-79.3,9110,8823,40.15,9110,8824,39.0,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32151,"NAD83 / West Virginia South",9001,4269,14732,9802,8821,37.0,9110,8822,-81.0,9110,8823,38.53,9110,8824,37.29,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32152,"NAD83 / Wisconsin North",9001,4269,14831,9802,8821,45.1,9110,8822,-90.0,9110,8823,46.46,9110,8824,45.34,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32153,"NAD83 / Wisconsin Central",9001,4269,14832,9802,8821,43.5,9110,8822,-90.0,9110,8823,45.3,9110,8824,44.15,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32154,"NAD83 / Wisconsin South",9001,4269,14833,9802,8821,42.0,9110,8822,-90.0,9110,8823,44.04,9110,8824,42.44,9110,8826,600000.0,9001,8827,0.0,9001,,,
+32155,"NAD83 / Wyoming East",9001,4269,14931,9807,8801,40.3,9110,8802,-105.1,9110,8805,0.9999375,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+32156,"NAD83 / Wyoming East Central",9001,4269,14932,9807,8801,40.3,9110,8802,-107.2,9110,8805,0.9999375,9201,8806,400000.0,9001,8807,100000.0,9001,,,,,,
+32157,"NAD83 / Wyoming West Central",9001,4269,14933,9807,8801,40.3,9110,8802,-108.45,9110,8805,0.9999375,9201,8806,600000.0,9001,8807,0.0,9001,,,,,,
+32158,"NAD83 / Wyoming West",9001,4269,14934,9807,8801,40.3,9110,8802,-110.05,9110,8805,0.9999375,9201,8806,800000.0,9001,8807,100000.0,9001,,,,,,
+32161,"NAD83 / Puerto Rico & Virgin Is.",9001,4269,15230,9802,8821,17.5,9110,8822,-66.26,9110,8823,18.26,9110,8824,18.02,9110,8826,200000.0,9001,8827,200000.0,9001,,,
+32180,"NAD83 / SCoPQ zone 2",9001,4269,17700,9807,8801,0.0,9110,8802,-55.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32181,"NAD83 / MTM zone 1",9001,4269,17701,9807,8801,0.0,9102,8802,-53.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32182,"NAD83 / MTM zone 2",9001,4269,17702,9807,8801,0.0,9102,8802,-56.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32183,"NAD83 / MTM zone 3",9001,4269,17703,9807,8801,0.0,9110,8802,-58.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32184,"NAD83 / MTM zone 4",9001,4269,17704,9807,8801,0.0,9110,8802,-61.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32185,"NAD83 / MTM zone 5",9001,4269,17705,9807,8801,0.0,9110,8802,-64.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32186,"NAD83 / MTM zone 6",9001,4269,17706,9807,8801,0.0,9110,8802,-67.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32187,"NAD83 / MTM zone 7",9001,4269,17707,9807,8801,0.0,9110,8802,-70.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32188,"NAD83 / MTM zone 8",9001,4269,17708,9807,8801,0.0,9110,8802,-73.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32189,"NAD83 / MTM zone 9",9001,4269,17709,9807,8801,0.0,9110,8802,-76.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32190,"NAD83 / MTM zone 10",9001,4269,17710,9807,8801,0.0,9110,8802,-79.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32191,"NAD83 / MTM zone 11",9001,4269,17711,9807,8801,0.0,9110,8802,-82.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32192,"NAD83 / MTM zone 12",9001,4269,17712,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32193,"NAD83 / MTM zone 13",9001,4269,17713,9807,8801,0.0,9102,8802,-84.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32194,"NAD83 / MTM zone 14",9001,4269,17714,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32195,"NAD83 / MTM zone 15",9001,4269,17715,9807,8801,0.0,9102,8802,-90.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32196,"NAD83 / MTM zone 16",9001,4269,17716,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32197,"NAD83 / MTM zone 17",9001,4269,17717,9807,8801,0.0,9102,8802,-96.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+32198,"NAD83 / Quebec Lambert",9001,4269,19944,9802,8821,44.0,9110,8822,-68.3,9110,8823,60.0,9110,8824,46.0,9110,8826,0.0,9001,8827,0.0,9001,,,
+32201,"WGS 72 / UTM zone 1N",9001,4322,16001,9807,8801,0.0,9102,8802,-177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32202,"WGS 72 / UTM zone 2N",9001,4322,16002,9807,8801,0.0,9102,8802,-171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32203,"WGS 72 / UTM zone 3N",9001,4322,16003,9807,8801,0.0,9102,8802,-165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32204,"WGS 72 / UTM zone 4N",9001,4322,16004,9807,8801,0.0,9102,8802,-159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32205,"WGS 72 / UTM zone 5N",9001,4322,16005,9807,8801,0.0,9102,8802,-153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32206,"WGS 72 / UTM zone 6N",9001,4322,16006,9807,8801,0.0,9102,8802,-147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32207,"WGS 72 / UTM zone 7N",9001,4322,16007,9807,8801,0.0,9102,8802,-141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32208,"WGS 72 / UTM zone 8N",9001,4322,16008,9807,8801,0.0,9102,8802,-135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32209,"WGS 72 / UTM zone 9N",9001,4322,16009,9807,8801,0.0,9102,8802,-129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32210,"WGS 72 / UTM zone 10N",9001,4322,16010,9807,8801,0.0,9102,8802,-123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32211,"WGS 72 / UTM zone 11N",9001,4322,16011,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32212,"WGS 72 / UTM zone 12N",9001,4322,16012,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32213,"WGS 72 / UTM zone 13N",9001,4322,16013,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32214,"WGS 72 / UTM zone 14N",9001,4322,16014,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32215,"WGS 72 / UTM zone 15N",9001,4322,16015,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32216,"WGS 72 / UTM zone 16N",9001,4322,16016,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32217,"WGS 72 / UTM zone 17N",9001,4322,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32218,"WGS 72 / UTM zone 18N",9001,4322,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32219,"WGS 72 / UTM zone 19N",9001,4322,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32220,"WGS 72 / UTM zone 20N",9001,4322,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32221,"WGS 72 / UTM zone 21N",9001,4322,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32222,"WGS 72 / UTM zone 22N",9001,4322,16022,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32223,"WGS 72 / UTM zone 23N",9001,4322,16023,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32224,"WGS 72 / UTM zone 24N",9001,4322,16024,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32225,"WGS 72 / UTM zone 25N",9001,4322,16025,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32226,"WGS 72 / UTM zone 26N",9001,4322,16026,9807,8801,0.0,9102,8802,-27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32227,"WGS 72 / UTM zone 27N",9001,4322,16027,9807,8801,0.0,9102,8802,-21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32228,"WGS 72 / UTM zone 28N",9001,4322,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32229,"WGS 72 / UTM zone 29N",9001,4322,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32230,"WGS 72 / UTM zone 30N",9001,4322,16030,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32231,"WGS 72 / UTM zone 31N",9001,4322,16031,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32232,"WGS 72 / UTM zone 32N",9001,4322,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32233,"WGS 72 / UTM zone 33N",9001,4322,16033,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32234,"WGS 72 / UTM zone 34N",9001,4322,16034,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32235,"WGS 72 / UTM zone 35N",9001,4322,16035,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32236,"WGS 72 / UTM zone 36N",9001,4322,16036,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32237,"WGS 72 / UTM zone 37N",9001,4322,16037,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32238,"WGS 72 / UTM zone 38N",9001,4322,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32239,"WGS 72 / UTM zone 39N",9001,4322,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32240,"WGS 72 / UTM zone 40N",9001,4322,16040,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32241,"WGS 72 / UTM zone 41N",9001,4322,16041,9807,8801,0.0,9102,8802,63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32242,"WGS 72 / UTM zone 42N",9001,4322,16042,9807,8801,0.0,9102,8802,69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32243,"WGS 72 / UTM zone 43N",9001,4322,16043,9807,8801,0.0,9102,8802,75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32244,"WGS 72 / UTM zone 44N",9001,4322,16044,9807,8801,0.0,9102,8802,81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32245,"WGS 72 / UTM zone 45N",9001,4322,16045,9807,8801,0.0,9102,8802,87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32246,"WGS 72 / UTM zone 46N",9001,4322,16046,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32247,"WGS 72 / UTM zone 47N",9001,4322,16047,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32248,"WGS 72 / UTM zone 48N",9001,4322,16048,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32249,"WGS 72 / UTM zone 49N",9001,4322,16049,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32250,"WGS 72 / UTM zone 50N",9001,4322,16050,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32251,"WGS 72 / UTM zone 51N",9001,4322,16051,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32252,"WGS 72 / UTM zone 52N",9001,4322,16052,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32253,"WGS 72 / UTM zone 53N",9001,4322,16053,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32254,"WGS 72 / UTM zone 54N",9001,4322,16054,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32255,"WGS 72 / UTM zone 55N",9001,4322,16055,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32256,"WGS 72 / UTM zone 56N",9001,4322,16056,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32257,"WGS 72 / UTM zone 57N",9001,4322,16057,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32258,"WGS 72 / UTM zone 58N",9001,4322,16058,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32259,"WGS 72 / UTM zone 59N",9001,4322,16059,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32260,"WGS 72 / UTM zone 60N",9001,4322,16060,9807,8801,0.0,9102,8802,177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32301,"WGS 72 / UTM zone 1S",9001,4322,16101,9807,8801,0.0,9102,8802,-177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32302,"WGS 72 / UTM zone 2S",9001,4322,16102,9807,8801,0.0,9102,8802,-171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32303,"WGS 72 / UTM zone 3S",9001,4322,16103,9807,8801,0.0,9102,8802,-165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32304,"WGS 72 / UTM zone 4S",9001,4322,16104,9807,8801,0.0,9102,8802,-159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32305,"WGS 72 / UTM zone 5S",9001,4322,16105,9807,8801,0.0,9102,8802,-153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32306,"WGS 72 / UTM zone 6S",9001,4322,16106,9807,8801,0.0,9102,8802,-147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32307,"WGS 72 / UTM zone 7S",9001,4322,16107,9807,8801,0.0,9102,8802,-141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32308,"WGS 72 / UTM zone 8S",9001,4322,16108,9807,8801,0.0,9102,8802,-135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32309,"WGS 72 / UTM zone 9S",9001,4322,16109,9807,8801,0.0,9102,8802,-129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32310,"WGS 72 / UTM zone 10S",9001,4322,16110,9807,8801,0.0,9102,8802,-123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32311,"WGS 72 / UTM zone 11S",9001,4322,16111,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32312,"WGS 72 / UTM zone 12S",9001,4322,16112,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32313,"WGS 72 / UTM zone 13S",9001,4322,16113,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32314,"WGS 72 / UTM zone 14S",9001,4322,16114,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32315,"WGS 72 / UTM zone 15S",9001,4322,16115,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32316,"WGS 72 / UTM zone 16S",9001,4322,16116,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32317,"WGS 72 / UTM zone 17S",9001,4322,16117,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32318,"WGS 72 / UTM zone 18S",9001,4322,16118,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32319,"WGS 72 / UTM zone 19S",9001,4322,16119,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32320,"WGS 72 / UTM zone 20S",9001,4322,16120,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32321,"WGS 72 / UTM zone 21S",9001,4322,16121,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32322,"WGS 72 / UTM zone 22S",9001,4322,16122,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32323,"WGS 72 / UTM zone 23S",9001,4322,16123,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32324,"WGS 72 / UTM zone 24S",9001,4322,16124,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32325,"WGS 72 / UTM zone 25S",9001,4322,16125,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32326,"WGS 72 / UTM zone 26S",9001,4322,16126,9807,8801,0.0,9102,8802,-27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32327,"WGS 72 / UTM zone 27S",9001,4322,16127,9807,8801,0.0,9102,8802,-21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32328,"WGS 72 / UTM zone 28S",9001,4322,16128,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32329,"WGS 72 / UTM zone 29S",9001,4322,16129,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32330,"WGS 72 / UTM zone 30S",9001,4322,16130,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32331,"WGS 72 / UTM zone 31S",9001,4322,16131,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32332,"WGS 72 / UTM zone 32S",9001,4322,16132,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32333,"WGS 72 / UTM zone 33S",9001,4322,16133,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32334,"WGS 72 / UTM zone 34S",9001,4322,16134,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32335,"WGS 72 / UTM zone 35S",9001,4322,16135,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32336,"WGS 72 / UTM zone 36S",9001,4322,16136,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32337,"WGS 72 / UTM zone 37S",9001,4322,16137,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32338,"WGS 72 / UTM zone 38S",9001,4322,16138,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32339,"WGS 72 / UTM zone 39S",9001,4322,16139,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32340,"WGS 72 / UTM zone 40S",9001,4322,16140,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32341,"WGS 72 / UTM zone 41S",9001,4322,16141,9807,8801,0.0,9102,8802,63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32342,"WGS 72 / UTM zone 42S",9001,4322,16142,9807,8801,0.0,9102,8802,69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32343,"WGS 72 / UTM zone 43S",9001,4322,16143,9807,8801,0.0,9102,8802,75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32344,"WGS 72 / UTM zone 44S",9001,4322,16144,9807,8801,0.0,9102,8802,81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32345,"WGS 72 / UTM zone 45S",9001,4322,16145,9807,8801,0.0,9102,8802,87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32346,"WGS 72 / UTM zone 46S",9001,4322,16146,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32347,"WGS 72 / UTM zone 47S",9001,4322,16147,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32348,"WGS 72 / UTM zone 48S",9001,4322,16148,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32349,"WGS 72 / UTM zone 49S",9001,4322,16149,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32350,"WGS 72 / UTM zone 50S",9001,4322,16150,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32351,"WGS 72 / UTM zone 51S",9001,4322,16151,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32352,"WGS 72 / UTM zone 52S",9001,4322,16152,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32353,"WGS 72 / UTM zone 53S",9001,4322,16153,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32354,"WGS 72 / UTM zone 54S",9001,4322,16154,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32355,"WGS 72 / UTM zone 55S",9001,4322,16155,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32356,"WGS 72 / UTM zone 56S",9001,4322,16156,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32357,"WGS 72 / UTM zone 57S",9001,4322,16157,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32358,"WGS 72 / UTM zone 58S",9001,4322,16158,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32359,"WGS 72 / UTM zone 59S",9001,4322,16159,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32360,"WGS 72 / UTM zone 60S",9001,4322,16160,9807,8801,0.0,9102,8802,177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32401,"WGS 72BE / UTM zone 1N",9001,4324,16001,9807,8801,0.0,9102,8802,-177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32402,"WGS 72BE / UTM zone 2N",9001,4324,16002,9807,8801,0.0,9102,8802,-171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32403,"WGS 72BE / UTM zone 3N",9001,4324,16003,9807,8801,0.0,9102,8802,-165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32404,"WGS 72BE / UTM zone 4N",9001,4324,16004,9807,8801,0.0,9102,8802,-159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32405,"WGS 72BE / UTM zone 5N",9001,4324,16005,9807,8801,0.0,9102,8802,-153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32406,"WGS 72BE / UTM zone 6N",9001,4324,16006,9807,8801,0.0,9102,8802,-147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32407,"WGS 72BE / UTM zone 7N",9001,4324,16007,9807,8801,0.0,9102,8802,-141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32408,"WGS 72BE / UTM zone 8N",9001,4324,16008,9807,8801,0.0,9102,8802,-135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32409,"WGS 72BE / UTM zone 9N",9001,4324,16009,9807,8801,0.0,9102,8802,-129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32410,"WGS 72BE / UTM zone 10N",9001,4324,16010,9807,8801,0.0,9102,8802,-123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32411,"WGS 72BE / UTM zone 11N",9001,4324,16011,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32412,"WGS 72BE / UTM zone 12N",9001,4324,16012,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32413,"WGS 72BE / UTM zone 13N",9001,4324,16013,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32414,"WGS 72BE / UTM zone 14N",9001,4324,16014,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32415,"WGS 72BE / UTM zone 15N",9001,4324,16015,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32416,"WGS 72BE / UTM zone 16N",9001,4324,16016,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32417,"WGS 72BE / UTM zone 17N",9001,4324,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32418,"WGS 72BE / UTM zone 18N",9001,4324,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32419,"WGS 72BE / UTM zone 19N",9001,4324,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32420,"WGS 72BE / UTM zone 20N",9001,4324,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32421,"WGS 72BE / UTM zone 21N",9001,4324,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32422,"WGS 72BE / UTM zone 22N",9001,4324,16022,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32423,"WGS 72BE / UTM zone 23N",9001,4324,16023,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32424,"WGS 72BE / UTM zone 24N",9001,4324,16024,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32425,"WGS 72BE / UTM zone 25N",9001,4324,16025,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32426,"WGS 72BE / UTM zone 26N",9001,4324,16026,9807,8801,0.0,9102,8802,-27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32427,"WGS 72BE / UTM zone 27N",9001,4324,16027,9807,8801,0.0,9102,8802,-21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32428,"WGS 72BE / UTM zone 28N",9001,4324,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32429,"WGS 72BE / UTM zone 29N",9001,4324,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32430,"WGS 72BE / UTM zone 30N",9001,4324,16030,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32431,"WGS 72BE / UTM zone 31N",9001,4324,16031,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32432,"WGS 72BE / UTM zone 32N",9001,4324,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32433,"WGS 72BE / UTM zone 33N",9001,4324,16033,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32434,"WGS 72BE / UTM zone 34N",9001,4324,16034,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32435,"WGS 72BE / UTM zone 35N",9001,4324,16035,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32436,"WGS 72BE / UTM zone 36N",9001,4324,16036,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32437,"WGS 72BE / UTM zone 37N",9001,4324,16037,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32438,"WGS 72BE / UTM zone 38N",9001,4324,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32439,"WGS 72BE / UTM zone 39N",9001,4324,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32440,"WGS 72BE / UTM zone 40N",9001,4324,16040,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32441,"WGS 72BE / UTM zone 41N",9001,4324,16041,9807,8801,0.0,9102,8802,63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32442,"WGS 72BE / UTM zone 42N",9001,4324,16042,9807,8801,0.0,9102,8802,69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32443,"WGS 72BE / UTM zone 43N",9001,4324,16043,9807,8801,0.0,9102,8802,75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32444,"WGS 72BE / UTM zone 44N",9001,4324,16044,9807,8801,0.0,9102,8802,81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32445,"WGS 72BE / UTM zone 45N",9001,4324,16045,9807,8801,0.0,9102,8802,87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32446,"WGS 72BE / UTM zone 46N",9001,4324,16046,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32447,"WGS 72BE / UTM zone 47N",9001,4324,16047,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32448,"WGS 72BE / UTM zone 48N",9001,4324,16048,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32449,"WGS 72BE / UTM zone 49N",9001,4324,16049,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32450,"WGS 72BE / UTM zone 50N",9001,4324,16050,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32451,"WGS 72BE / UTM zone 51N",9001,4324,16051,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32452,"WGS 72BE / UTM zone 52N",9001,4324,16052,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32453,"WGS 72BE / UTM zone 53N",9001,4324,16053,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32454,"WGS 72BE / UTM zone 54N",9001,4324,16054,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32455,"WGS 72BE / UTM zone 55N",9001,4324,16055,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32456,"WGS 72BE / UTM zone 56N",9001,4324,16056,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32457,"WGS 72BE / UTM zone 57N",9001,4324,16057,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32458,"WGS 72BE / UTM zone 58N",9001,4324,16058,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32459,"WGS 72BE / UTM zone 59N",9001,4324,16059,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32460,"WGS 72BE / UTM zone 60N",9001,4324,16060,9807,8801,0.0,9102,8802,177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32501,"WGS 72BE / UTM zone 1S",9001,4324,16101,9807,8801,0.0,9102,8802,-177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32502,"WGS 72BE / UTM zone 2S",9001,4324,16102,9807,8801,0.0,9102,8802,-171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32503,"WGS 72BE / UTM zone 3S",9001,4324,16103,9807,8801,0.0,9102,8802,-165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32504,"WGS 72BE / UTM zone 4S",9001,4324,16104,9807,8801,0.0,9102,8802,-159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32505,"WGS 72BE / UTM zone 5S",9001,4324,16105,9807,8801,0.0,9102,8802,-153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32506,"WGS 72BE / UTM zone 6S",9001,4324,16106,9807,8801,0.0,9102,8802,-147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32507,"WGS 72BE / UTM zone 7S",9001,4324,16107,9807,8801,0.0,9102,8802,-141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32508,"WGS 72BE / UTM zone 8S",9001,4324,16108,9807,8801,0.0,9102,8802,-135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32509,"WGS 72BE / UTM zone 9S",9001,4324,16109,9807,8801,0.0,9102,8802,-129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32510,"WGS 72BE / UTM zone 10S",9001,4324,16110,9807,8801,0.0,9102,8802,-123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32511,"WGS 72BE / UTM zone 11S",9001,4324,16111,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32512,"WGS 72BE / UTM zone 12S",9001,4324,16112,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32513,"WGS 72BE / UTM zone 13S",9001,4324,16113,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32514,"WGS 72BE / UTM zone 14S",9001,4324,16114,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32515,"WGS 72BE / UTM zone 15S",9001,4324,16115,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32516,"WGS 72BE / UTM zone 16S",9001,4324,16116,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32517,"WGS 72BE / UTM zone 17S",9001,4324,16117,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32518,"WGS 72BE / UTM zone 18S",9001,4324,16118,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32519,"WGS 72BE / UTM zone 19S",9001,4324,16119,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32520,"WGS 72BE / UTM zone 20S",9001,4324,16120,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32521,"WGS 72BE / UTM zone 21S",9001,4324,16121,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32522,"WGS 72BE / UTM zone 22S",9001,4324,16122,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32523,"WGS 72BE / UTM zone 23S",9001,4324,16123,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32524,"WGS 72BE / UTM zone 24S",9001,4324,16124,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32525,"WGS 72BE / UTM zone 25S",9001,4324,16125,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32526,"WGS 72BE / UTM zone 26S",9001,4324,16126,9807,8801,0.0,9102,8802,-27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32527,"WGS 72BE / UTM zone 27S",9001,4324,16127,9807,8801,0.0,9102,8802,-21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32528,"WGS 72BE / UTM zone 28S",9001,4324,16128,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32529,"WGS 72BE / UTM zone 29S",9001,4324,16129,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32530,"WGS 72BE / UTM zone 30S",9001,4324,16130,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32531,"WGS 72BE / UTM zone 31S",9001,4324,16131,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32532,"WGS 72BE / UTM zone 32S",9001,4324,16132,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32533,"WGS 72BE / UTM zone 33S",9001,4324,16133,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32534,"WGS 72BE / UTM zone 34S",9001,4324,16134,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32535,"WGS 72BE / UTM zone 35S",9001,4324,16135,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32536,"WGS 72BE / UTM zone 36S",9001,4324,16136,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32537,"WGS 72BE / UTM zone 37S",9001,4324,16137,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32538,"WGS 72BE / UTM zone 38S",9001,4324,16138,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32539,"WGS 72BE / UTM zone 39S",9001,4324,16139,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32540,"WGS 72BE / UTM zone 40S",9001,4324,16140,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32541,"WGS 72BE / UTM zone 41S",9001,4324,16141,9807,8801,0.0,9102,8802,63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32542,"WGS 72BE / UTM zone 42S",9001,4324,16142,9807,8801,0.0,9102,8802,69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32543,"WGS 72BE / UTM zone 43S",9001,4324,16143,9807,8801,0.0,9102,8802,75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32544,"WGS 72BE / UTM zone 44S",9001,4324,16144,9807,8801,0.0,9102,8802,81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32545,"WGS 72BE / UTM zone 45S",9001,4324,16145,9807,8801,0.0,9102,8802,87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32546,"WGS 72BE / UTM zone 46S",9001,4324,16146,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32547,"WGS 72BE / UTM zone 47S",9001,4324,16147,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32548,"WGS 72BE / UTM zone 48S",9001,4324,16148,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32549,"WGS 72BE / UTM zone 49S",9001,4324,16149,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32550,"WGS 72BE / UTM zone 50S",9001,4324,16150,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32551,"WGS 72BE / UTM zone 51S",9001,4324,16151,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32552,"WGS 72BE / UTM zone 52S",9001,4324,16152,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32553,"WGS 72BE / UTM zone 53S",9001,4324,16153,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32554,"WGS 72BE / UTM zone 54S",9001,4324,16154,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32555,"WGS 72BE / UTM zone 55S",9001,4324,16155,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32556,"WGS 72BE / UTM zone 56S",9001,4324,16156,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32557,"WGS 72BE / UTM zone 57S",9001,4324,16157,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32558,"WGS 72BE / UTM zone 58S",9001,4324,16158,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32559,"WGS 72BE / UTM zone 59S",9001,4324,16159,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32560,"WGS 72BE / UTM zone 60S",9001,4324,16160,9807,8801,0.0,9102,8802,177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32600,"WGS 84 / UTM grid system (northern hemisphere)",9001,4326,16000,9824,8801,0.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,8830,-180.0,9102,8831,6.0,9102,,,
+32601,"WGS 84 / UTM zone 1N",9001,4326,16001,9807,8801,0.0,9102,8802,-177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32602,"WGS 84 / UTM zone 2N",9001,4326,16002,9807,8801,0.0,9102,8802,-171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32603,"WGS 84 / UTM zone 3N",9001,4326,16003,9807,8801,0.0,9102,8802,-165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32604,"WGS 84 / UTM zone 4N",9001,4326,16004,9807,8801,0.0,9102,8802,-159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32605,"WGS 84 / UTM zone 5N",9001,4326,16005,9807,8801,0.0,9102,8802,-153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32606,"WGS 84 / UTM zone 6N",9001,4326,16006,9807,8801,0.0,9102,8802,-147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32607,"WGS 84 / UTM zone 7N",9001,4326,16007,9807,8801,0.0,9102,8802,-141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32608,"WGS 84 / UTM zone 8N",9001,4326,16008,9807,8801,0.0,9102,8802,-135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32609,"WGS 84 / UTM zone 9N",9001,4326,16009,9807,8801,0.0,9102,8802,-129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32610,"WGS 84 / UTM zone 10N",9001,4326,16010,9807,8801,0.0,9102,8802,-123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32611,"WGS 84 / UTM zone 11N",9001,4326,16011,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32612,"WGS 84 / UTM zone 12N",9001,4326,16012,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32613,"WGS 84 / UTM zone 13N",9001,4326,16013,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32614,"WGS 84 / UTM zone 14N",9001,4326,16014,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32615,"WGS 84 / UTM zone 15N",9001,4326,16015,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32616,"WGS 84 / UTM zone 16N",9001,4326,16016,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32617,"WGS 84 / UTM zone 17N",9001,4326,16017,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32618,"WGS 84 / UTM zone 18N",9001,4326,16018,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32619,"WGS 84 / UTM zone 19N",9001,4326,16019,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32620,"WGS 84 / UTM zone 20N",9001,4326,16020,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32621,"WGS 84 / UTM zone 21N",9001,4326,16021,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32622,"WGS 84 / UTM zone 22N",9001,4326,16022,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32623,"WGS 84 / UTM zone 23N",9001,4326,16023,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32624,"WGS 84 / UTM zone 24N",9001,4326,16024,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32625,"WGS 84 / UTM zone 25N",9001,4326,16025,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32626,"WGS 84 / UTM zone 26N",9001,4326,16026,9807,8801,0.0,9102,8802,-27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32627,"WGS 84 / UTM zone 27N",9001,4326,16027,9807,8801,0.0,9102,8802,-21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32628,"WGS 84 / UTM zone 28N",9001,4326,16028,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32629,"WGS 84 / UTM zone 29N",9001,4326,16029,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32630,"WGS 84 / UTM zone 30N",9001,4326,16030,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32631,"WGS 84 / UTM zone 31N",9001,4326,16031,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32632,"WGS 84 / UTM zone 32N",9001,4326,16032,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32633,"WGS 84 / UTM zone 33N",9001,4326,16033,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32634,"WGS 84 / UTM zone 34N",9001,4326,16034,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32635,"WGS 84 / UTM zone 35N",9001,4326,16035,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32636,"WGS 84 / UTM zone 36N",9001,4326,16036,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32637,"WGS 84 / UTM zone 37N",9001,4326,16037,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32638,"WGS 84 / UTM zone 38N",9001,4326,16038,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32639,"WGS 84 / UTM zone 39N",9001,4326,16039,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32640,"WGS 84 / UTM zone 40N",9001,4326,16040,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32641,"WGS 84 / UTM zone 41N",9001,4326,16041,9807,8801,0.0,9102,8802,63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32642,"WGS 84 / UTM zone 42N",9001,4326,16042,9807,8801,0.0,9102,8802,69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32643,"WGS 84 / UTM zone 43N",9001,4326,16043,9807,8801,0.0,9102,8802,75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32644,"WGS 84 / UTM zone 44N",9001,4326,16044,9807,8801,0.0,9102,8802,81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32645,"WGS 84 / UTM zone 45N",9001,4326,16045,9807,8801,0.0,9102,8802,87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32646,"WGS 84 / UTM zone 46N",9001,4326,16046,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32647,"WGS 84 / UTM zone 47N",9001,4326,16047,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32648,"WGS 84 / UTM zone 48N",9001,4326,16048,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32649,"WGS 84 / UTM zone 49N",9001,4326,16049,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32650,"WGS 84 / UTM zone 50N",9001,4326,16050,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32651,"WGS 84 / UTM zone 51N",9001,4326,16051,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32652,"WGS 84 / UTM zone 52N",9001,4326,16052,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32653,"WGS 84 / UTM zone 53N",9001,4326,16053,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32654,"WGS 84 / UTM zone 54N",9001,4326,16054,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32655,"WGS 84 / UTM zone 55N",9001,4326,16055,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32656,"WGS 84 / UTM zone 56N",9001,4326,16056,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32657,"WGS 84 / UTM zone 57N",9001,4326,16057,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32658,"WGS 84 / UTM zone 58N",9001,4326,16058,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32659,"WGS 84 / UTM zone 59N",9001,4326,16059,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32660,"WGS 84 / UTM zone 60N",9001,4326,16060,9807,8801,0.0,9102,8802,177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+32661,"WGS 84 / UPS North",9001,4326,16061,9810,8801,90.0,9102,8802,0.0,9102,8805,0.994,9201,8806,2000000.0,9001,8807,2000000.0,9001,,,,,,
+32662,"WGS 84 / Plate Carree",9001,4326,19968,9823,8801,0.0,9102,8802,0.0,9102,,,,,,,,,,,,,,,
+32700,"WGS 84 / UTM grid system (southern hemisphere)",9001,4326,16100,9824,8801,0.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,8830,-180.0,9102,8831,6.0,9102,,,
+32701,"WGS 84 / UTM zone 1S",9001,4326,16101,9807,8801,0.0,9102,8802,-177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32702,"WGS 84 / UTM zone 2S",9001,4326,16102,9807,8801,0.0,9102,8802,-171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32703,"WGS 84 / UTM zone 3S",9001,4326,16103,9807,8801,0.0,9102,8802,-165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32704,"WGS 84 / UTM zone 4S",9001,4326,16104,9807,8801,0.0,9102,8802,-159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32705,"WGS 84 / UTM zone 5S",9001,4326,16105,9807,8801,0.0,9102,8802,-153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32706,"WGS 84 / UTM zone 6S",9001,4326,16106,9807,8801,0.0,9102,8802,-147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32707,"WGS 84 / UTM zone 7S",9001,4326,16107,9807,8801,0.0,9102,8802,-141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32708,"WGS 84 / UTM zone 8S",9001,4326,16108,9807,8801,0.0,9102,8802,-135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32709,"WGS 84 / UTM zone 9S",9001,4326,16109,9807,8801,0.0,9102,8802,-129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32710,"WGS 84 / UTM zone 10S",9001,4326,16110,9807,8801,0.0,9102,8802,-123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32711,"WGS 84 / UTM zone 11S",9001,4326,16111,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32712,"WGS 84 / UTM zone 12S",9001,4326,16112,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32713,"WGS 84 / UTM zone 13S",9001,4326,16113,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32714,"WGS 84 / UTM zone 14S",9001,4326,16114,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32715,"WGS 84 / UTM zone 15S",9001,4326,16115,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32716,"WGS 84 / UTM zone 16S",9001,4326,16116,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32717,"WGS 84 / UTM zone 17S",9001,4326,16117,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32718,"WGS 84 / UTM zone 18S",9001,4326,16118,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32719,"WGS 84 / UTM zone 19S",9001,4326,16119,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32720,"WGS 84 / UTM zone 20S",9001,4326,16120,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32721,"WGS 84 / UTM zone 21S",9001,4326,16121,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32722,"WGS 84 / UTM zone 22S",9001,4326,16122,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32723,"WGS 84 / UTM zone 23S",9001,4326,16123,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32724,"WGS 84 / UTM zone 24S",9001,4326,16124,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32725,"WGS 84 / UTM zone 25S",9001,4326,16125,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32726,"WGS 84 / UTM zone 26S",9001,4326,16126,9807,8801,0.0,9102,8802,-27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32727,"WGS 84 / UTM zone 27S",9001,4326,16127,9807,8801,0.0,9102,8802,-21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32728,"WGS 84 / UTM zone 28S",9001,4326,16128,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32729,"WGS 84 / UTM zone 29S",9001,4326,16129,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32730,"WGS 84 / UTM zone 30S",9001,4326,16130,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32731,"WGS 84 / UTM zone 31S",9001,4326,16131,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32732,"WGS 84 / UTM zone 32S",9001,4326,16132,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32733,"WGS 84 / UTM zone 33S",9001,4326,16133,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32734,"WGS 84 / UTM zone 34S",9001,4326,16134,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32735,"WGS 84 / UTM zone 35S",9001,4326,16135,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32736,"WGS 84 / UTM zone 36S",9001,4326,16136,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32737,"WGS 84 / UTM zone 37S",9001,4326,16137,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32738,"WGS 84 / UTM zone 38S",9001,4326,16138,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32739,"WGS 84 / UTM zone 39S",9001,4326,16139,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32740,"WGS 84 / UTM zone 40S",9001,4326,16140,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32741,"WGS 84 / UTM zone 41S",9001,4326,16141,9807,8801,0.0,9102,8802,63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32742,"WGS 84 / UTM zone 42S",9001,4326,16142,9807,8801,0.0,9102,8802,69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32743,"WGS 84 / UTM zone 43S",9001,4326,16143,9807,8801,0.0,9102,8802,75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32744,"WGS 84 / UTM zone 44S",9001,4326,16144,9807,8801,0.0,9102,8802,81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32745,"WGS 84 / UTM zone 45S",9001,4326,16145,9807,8801,0.0,9102,8802,87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32746,"WGS 84 / UTM zone 46S",9001,4326,16146,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32747,"WGS 84 / UTM zone 47S",9001,4326,16147,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32748,"WGS 84 / UTM zone 48S",9001,4326,16148,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32749,"WGS 84 / UTM zone 49S",9001,4326,16149,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32750,"WGS 84 / UTM zone 50S",9001,4326,16150,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32751,"WGS 84 / UTM zone 51S",9001,4326,16151,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32752,"WGS 84 / UTM zone 52S",9001,4326,16152,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32753,"WGS 84 / UTM zone 53S",9001,4326,16153,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32754,"WGS 84 / UTM zone 54S",9001,4326,16154,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32755,"WGS 84 / UTM zone 55S",9001,4326,16155,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32756,"WGS 84 / UTM zone 56S",9001,4326,16156,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32757,"WGS 84 / UTM zone 57S",9001,4326,16157,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32758,"WGS 84 / UTM zone 58S",9001,4326,16158,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32759,"WGS 84 / UTM zone 59S",9001,4326,16159,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32760,"WGS 84 / UTM zone 60S",9001,4326,16160,9807,8801,0.0,9102,8802,177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+32761,"WGS 84 / UPS South",9001,4326,16161,9810,8801,-90.0,9102,8802,0.0,9102,8805,0.994,9201,8806,2000000.0,9001,8807,2000000.0,9001,,,,,,
+32766,"WGS 84 / TM 36 SE",9001,4326,16636,9807,8801,0.0,9102,8802,36.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
diff --git a/src/tiff/csv/prime_meridian.csv b/src/tiff/csv/prime_meridian.csv
new file mode 100644
index 0000000..bde10d2
--- /dev/null
+++ b/src/tiff/csv/prime_meridian.csv
@@ -0,0 +1,14 @@
+"PRIME_MERIDIAN_CODE","PRIME_MERIDIAN_NAME","GREENWICH_LONGITUDE","UOM_CODE","REMARKS","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","DEPRECATED"
+8901,Greenwich,0.0,9110,,,EPSG,1995-06-02 00:00:00,96.29,0
+8902,Lisbon,-9.0754862,9110,,Instituto Geografico e Cadastral; Lisbon,EPSG,1995-06-02 00:00:00,96.29,0
+8903,Paris,2.5969213,9105,Value adopted by IGN (Paris) in 1936. Equivalent to 2 deg 20min 14.025sec. Preferred by EPSG to earlier value of 2deg 20min 13.95sec (2.596898 grads) used by RGS London.,Institut Geographique National (IGN); Paris,EPSG,1995-06-02 00:00:00,,0
+8904,Bogota,-74.04513,9110,,"Instituto Geografico ""Augustin Cadazzi"" (IGAC); Bogota",EPSG,1995-06-02 00:00:00,96.29,0
+8905,Madrid,-3.411658,9110,,,EPSG,1995-06-02 00:00:00,96.29,0
+8906,Rome,12.27084,9110,,,EPSG,1995-06-02 00:00:00,96.29,0
+8907,Bern,7.26225,9110,1895 value.  Newer value of 7 deg 26 min 22.335 sec E determined in 1938.,Bundesamt f�r Landestopographie,EPSG,1995-06-02 00:00:00,96.29,0
+8908,Jakarta,106.482779,9110,,,EPSG,1995-06-02 00:00:00,96.29,0
+8909,Ferro,-17.4,9110,Used in Austria and former Czechoslovakia.,,EPSG,1995-06-02 00:00:00,96.29,0
+8910,Brussels,4.220471,9110,,,EPSG,1995-06-02 00:00:00,96.29,0
+8911,Stockholm,18.03298,9110,,,EPSG,1995-06-02 00:00:00,96.29,0
+8912,Athens,23.4258815,9110,Used in Greece for older mapping based on Hatt projection.,Topography Department; National Technical University of Athens.,EPSG,1997-06-16 00:00:00,,0
+8913,Oslo,10.43225,9110,Formerly known as Kristiania or Christiania.,Statens Kartverk - Geodesidivisjonen,EPSG,1999-10-20 00:00:00,,0
diff --git a/src/tiff/csv/projop_wparm.csv b/src/tiff/csv/projop_wparm.csv
new file mode 100644
index 0000000..9cc3e0c
--- /dev/null
+++ b/src/tiff/csv/projop_wparm.csv
@@ -0,0 +1,1083 @@
+"COORD_OP_CODE","COORD_OP_NAME","COORD_OP_METHOD_CODE","PARAMETER_CODE_1","PARAMETER_VALUE_1","PARAMETER_UOM_1","PARAMETER_CODE_2","PARAMETER_VALUE_2","PARAMETER_UOM_2","PARAMETER_CODE_3","PARAMETER_VALUE_3","PARAMETER_UOM_3","PARAMETER_CODE_4","PARAMETER_VALUE_4","PARAMETER_UOM_4","PARAMETER_CODE_5","PARAMETER_VALUE_5","PARAMETER_UOM_5","PARAMETER_CODE_6","PARAMETER_VALUE_6","PARAMETER_UOM_6","PARAMETER_CODE_7","PARAMETER_VALUE_7","PARAMETER_UOM_7"
+10101,Alabama CS27 East zone,9807,8801,30.3,9110,8802,-85.5,9110,8805,0.99996,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+10102,Alabama CS27 West zone,9807,8801,30.0,9110,8802,-87.3,9110,8805,0.999933333,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+10131,"SPCS83 Alabama East zone (meters)",9807,8801,30.3,9110,8802,-85.5,9110,8805,0.99996,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+10132,"SPCS83 Alabama West zone (meters)",9807,8801,30.0,9110,8802,-87.3,9110,8805,0.999933333,9201,8806,600000.0,9001,8807,0.0,9001,,,,,,
+10201,Arizona Coordinate System East zone,9807,8801,31.0,9110,8802,-110.1,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+10202,Arizona Coordinate System Central zone,9807,8801,31.0,9110,8802,-111.55,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+10203,Arizona Coordinate System West zone,9807,8801,31.0,9110,8802,-113.45,9110,8805,0.999933333,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+10231,"SPCS83 Arizona East zone (meters)",9807,8801,31.0,9110,8802,-110.1,9110,8805,0.9999,9201,8806,213360.0,9001,8807,0.0,9001,,,,,,
+10232,"SPCS83 Arizona Central zone (meters)",9807,8801,31.0,9110,8802,-111.55,9110,8805,0.9999,9201,8806,213360.0,9001,8807,0.0,9001,,,,,,
+10233,"SPCS83 Arizona West zone (meters)",9807,8801,31.0,9110,8802,-113.45,9110,8805,0.999933333,9201,8806,213360.0,9001,8807,0.0,9001,,,,,,
+10301,Arkansas CS27 North,9802,8821,34.2,9110,8822,-92.0,9110,8823,36.14,9110,8824,34.56,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10302,Arkansas CS27 South,9802,8821,32.4,9110,8822,-92.0,9110,8823,34.46,9110,8824,33.18,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10331,"SPCS83 Arkansas North zone (meters)",9802,8821,34.2,9110,8822,-92.0,9110,8823,36.14,9110,8824,34.56,9110,8826,400000.0,9001,8827,0.0,9001,,,
+10332,"SPCS83 Arkansas South zone (meters)",9802,8821,32.4,9110,8822,-92.0,9110,8823,34.46,9110,8824,33.18,9110,8826,400000.0,9001,8827,400000.0,9001,,,
+10401,California CS27 zone I,9802,8821,39.2,9110,8822,-122.0,9110,8823,41.4,9110,8824,40.0,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10402,California CS27 zone II,9802,8821,37.4,9110,8822,-122.0,9110,8823,39.5,9110,8824,38.2,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10403,California CS27 zone III,9802,8821,36.3,9110,8822,-120.3,9110,8823,38.26,9110,8824,37.04,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10404,California CS27 zone IV,9802,8821,35.2,9110,8822,-119.0,9110,8823,37.15,9110,8824,36.0,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10405,California CS27 zone V,9802,8821,33.3,9110,8822,-118.0,9110,8823,35.28,9110,8824,34.02,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10406,California CS27 zone VI,9802,8821,32.1,9110,8822,-116.15,9110,8823,33.53,9110,8824,32.47,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10407,California CS27 zone VII,9802,8821,34.08,9110,8822,-118.2,9110,8823,34.25,9110,8824,33.52,9110,8826,4186692.58,9003,8827,416926.74,9003,,,
+10431,"SPCS83 California zone 1 (meters)",9802,8821,39.2,9110,8822,-122.0,9110,8823,41.4,9110,8824,40.0,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+10432,"SPCS83 California zone 2 (meters)",9802,8821,37.4,9110,8822,-122.0,9110,8823,39.5,9110,8824,38.2,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+10433,"SPCS83 California zone 3 (meters)",9802,8821,36.3,9110,8822,-120.3,9110,8823,38.26,9110,8824,37.04,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+10434,"SPCS83 California zone 4 (meters)",9802,8821,35.2,9110,8822,-119.0,9110,8823,37.15,9110,8824,36.0,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+10435,"SPCS83 California zone 5 (meters)",9802,8821,33.3,9110,8822,-118.0,9110,8823,35.28,9110,8824,34.02,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+10436,"SPCS83 California zone 6 (meters)",9802,8821,32.1,9110,8822,-116.15,9110,8823,33.53,9110,8824,32.47,9110,8826,2000000.0,9001,8827,500000.0,9001,,,
+10501,Colorado CS27 North zone,9802,8821,39.2,9110,8822,-105.3,9110,8823,39.43,9110,8824,40.47,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10502,Colorado CS27 Central zone,9802,8821,37.5,9110,8822,-105.3,9110,8823,39.45,9110,8824,38.27,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10503,Colorado CS27 South zone,9802,8821,36.4,9110,8822,-105.3,9110,8823,38.26,9110,8824,37.14,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10531,"SPCS83 Colorado North zone (meters)",9802,8821,39.2,9110,8822,-105.3,9110,8823,40.47,9110,8824,39.43,9110,8826,914401.8289,9001,8827,304800.6096,9001,,,
+10532,"SPCS83 Colorado Central zone (meters)",9802,8821,37.5,9110,8822,-105.3,9110,8823,39.45,9110,8824,38.27,9110,8826,914401.8289,9001,8827,304800.6096,9001,,,
+10533,"SPCS83 Colorado South zone (meters)",9802,8821,36.4,9110,8822,-105.3,9110,8823,38.26,9110,8824,37.14,9110,8826,914401.8289,9001,8827,304800.6096,9001,,,
+10600,Connecticut CS27,9802,8821,40.5,9110,8822,-72.45,9110,8823,41.52,9110,8824,41.12,9110,8826,600000.0,9003,8827,0.0,9003,,,
+10630,"SPCS83 Connecticut zone (meters)",9802,8821,40.5,9110,8822,-72.45,9110,8823,41.52,9110,8824,41.12,9110,8826,304800.6096,9001,8827,152400.3048,9001,,,
+10700,Delaware CS27,9807,8801,38.0,9110,8802,-75.25,9110,8805,0.999995,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+10730,"SPCS83 Delaware zone (meters)",9807,8801,38.0,9110,8802,-75.25,9110,8805,0.999995,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+10901,Florida CS27 East zone,9807,8801,24.2,9110,8802,-81.0,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+10902,Florida CS27 West zone,9807,8801,24.2,9110,8802,-82.0,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+10903,Florida CS27 North zone,9802,8821,29.0,9110,8822,-84.3,9110,8823,30.45,9110,8824,29.35,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+10931,"SPCS83 Florida East zone (meters)",9807,8801,24.2,9110,8802,-81.0,9110,8805,0.999941177,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+10932,"SPCS83 Florida West zone (meters)",9807,8801,24.2,9110,8802,-82.0,9110,8805,0.999941177,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+10933,"SPCS83 Florida North zone (meters)",9802,8821,29.0,9110,8822,-84.3,9110,8823,30.45,9110,8824,29.35,9110,8826,600000.0,9001,8827,0.0,9001,,,
+11001,Georgia CS27 East zone,9807,8801,30.0,9110,8802,-82.1,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11002,Georgia CS27 West zone,9807,8801,30.0,9110,8802,-84.1,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11031,"SPCS83 Georgia East zone (meters)",9807,8801,30.0,9110,8802,-82.1,9110,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+11032,"SPCS83 Georgia West zone (meters)",9807,8801,30.0,9110,8802,-84.1,9110,8805,0.9999,9201,8806,700000.0,9001,8807,0.0,9001,,,,,,
+11101,Idaho CS27 East zone,9807,8801,41.4,9110,8802,-112.1,9110,8805,0.999947368,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11102,Idaho CS27 Central zone,9807,8801,41.4,9110,8802,-114.0,9110,8805,0.999947368,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11103,Idaho CS27 West zone,9807,8801,41.4,9110,8802,-115.45,9110,8805,0.999933333,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11131,"SPCS83 Idaho East zone (meters)",9807,8801,41.4,9110,8802,-112.1,9110,8805,0.999947368,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+11132,"SPCS83 Idaho Central zone (meters)",9807,8801,41.4,9110,8802,-114.0,9110,8805,0.999947368,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+11133,"SPCS83 Idaho West zone (meters)",9807,8801,41.4,9110,8802,-115.45,9110,8805,0.999933333,9201,8806,800000.0,9001,8807,0.0,9001,,,,,,
+11201,Illinois CS27 East zone,9807,8801,36.4,9110,8802,-88.2,9110,8805,0.999975,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11202,Illinois CS27 West zone,9807,8801,36.4,9110,8802,-90.1,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11231,"SPCS83 Illinois East zone (meters)",9807,8801,36.4,9110,8802,-88.2,9110,8805,0.999975,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+11232,"SPCS83 Illinois West zone (meters)",9807,8801,36.4,9110,8802,-90.1,9110,8805,0.999941177,9201,8806,700000.0,9001,8807,0.0,9001,,,,,,
+11301,Indiana CS27 East zone,9807,8801,37.3,9110,8802,-85.4,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11302,Indiana CS27 West zone,9807,8801,37.3,9110,8802,-87.05,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11331,"SPCS83 Indiana East zone (meters)",9807,8801,37.3,9110,8802,-85.4,9110,8805,0.999966667,9201,8806,100000.0,9001,8807,250000.0,9001,,,,,,
+11332,"SPCS83 Indiana West zone (meters)",9807,8801,37.3,9110,8802,-87.05,9110,8805,0.999966667,9201,8806,900000.0,9001,8807,250000.0,9001,,,,,,
+11401,Iowa CS27 North zone,9802,8821,41.3,9110,8822,-93.3,9110,8823,43.16,9110,8824,42.04,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+11402,Iowa CS27 South zone,9802,8821,40.0,9110,8822,-93.3,9110,8823,41.47,9110,8824,40.37,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+11431,"SPCS83 Iowa North zone (meters)",9802,8821,41.3,9110,8822,-93.3,9110,8823,43.16,9110,8824,42.04,9110,8826,1500000.0,9001,8827,1000000.0,9001,,,
+11432,"SPCS83 Iowa South zone (meters)",9802,8821,40.0,9110,8822,-93.3,9110,8823,41.47,9110,8824,40.37,9110,8826,500000.0,9001,8827,0.0,9001,,,
+11501,Kansas CS27 North zone,9802,8821,38.2,9110,8822,-98.0,9110,8823,39.47,9110,8824,38.43,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+11502,Kansas CS27 South zone,9802,8821,36.4,9110,8822,-98.3,9110,8823,38.34,9110,8824,37.16,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+11531,"SPCS83 Kansas North zone (meters)",9802,8821,38.2,9110,8822,-98.0,9110,8823,39.47,9110,8824,38.43,9110,8826,400000.0,9001,8827,0.0,9001,,,
+11532,"SPCS83 Kansas South zone (meters)",9802,8821,36.4,9110,8822,-98.3,9110,8823,38.34,9110,8824,37.16,9110,8826,400000.0,9001,8827,400000.0,9001,,,
+11601,Kentucky CS27 North zone,9802,8821,37.3,9110,8822,-84.15,9110,8823,37.58,9110,8824,38.58,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+11602,Kentucky CS27 South zone,9802,8821,36.2,9110,8822,-85.45,9110,8823,36.44,9110,8824,37.56,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+11631,Kentucky CS83 North zone,9802,8821,37.3,9110,8822,-84.15,9110,8823,37.58,9110,8824,37.58,9110,8826,500000.0,9001,8827,0.0,9001,,,
+11632,"SPCS83 Kentucky South zone (meters)",9802,8821,36.2,9110,8822,-85.45,9110,8823,37.56,9110,8824,36.44,9110,8826,500000.0,9001,8827,500000.0,9001,,,
+11701,Louisiana CS27 North zone,9802,8821,30.4,9110,8822,-92.3,9110,8823,31.1,9110,8824,32.4,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+11702,Louisiana CS27 South zone,9802,8821,28.4,9110,8822,-91.2,9110,8823,29.18,9110,8824,30.42,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+11731,"SPCS83 Louisiana North zone (meters)",9802,8821,30.3,9110,8822,-92.3,9110,8823,32.4,9110,8824,31.1,9110,8826,1000000.0,9001,8827,0.0,9001,,,
+11732,"SPCS83 Louisiana South zone (meters)",9802,8821,28.3,9110,8822,-91.2,9110,8823,30.42,9110,8824,29.18,9110,8826,1000000.0,9001,8827,0.0,9001,,,
+11801,Maine CS27 East zone,9807,8801,43.5,9110,8802,-68.3,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11802,Maine CS27 West zone,9807,8801,42.5,9110,8802,-70.1,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+11831,"SPCS83 Maine East zone (meters)",9807,8801,43.4,9110,8802,-68.3,9110,8805,0.9999,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+11832,"SPCS83 Maine West zone (meters)",9807,8801,42.5,9110,8802,-70.1,9110,8805,0.999966667,9201,8806,900000.0,9001,8807,0.0,9001,,,,,,
+11900,Maryland CS27,9802,8821,37.5,9110,8822,-77.0,9110,8823,38.18,9110,8824,39.27,9110,8826,800000.0,9003,8827,0.0,9003,,,
+11930,"SPCS83 Maryland zone (meters)",9802,8821,37.4,9110,8822,-77.0,9110,8823,39.27,9110,8824,38.18,9110,8826,400000.0,9001,8827,0.0,9001,,,
+12001,Massachusetts CS27 Mainland zone,9802,8821,41.0,9110,8822,-71.3,9110,8823,41.43,9110,8824,42.41,9110,8826,600000.0,9003,8827,0.0,9003,,,
+12002,Massachusetts CS27 Island zone,9802,8821,41.0,9110,8822,-70.3,9110,8823,41.17,9110,8824,41.29,9110,8826,200000.0,9003,8827,0.0,9003,,,
+12031,"SPCS83 Massachusetts Mainland zone (meters)",9802,8821,41.0,9110,8822,-71.3,9110,8823,42.41,9110,8824,41.43,9110,8826,200000.0,9001,8827,750000.0,9001,,,
+12032,"SPCS83 Massachusetts Island zone (meters)",9802,8821,41.0,9110,8822,-70.3,9110,8823,41.29,9110,8824,41.17,9110,8826,500000.0,9001,8827,0.0,9001,,,
+12101,Michigan State Plane East zone,9807,8801,41.3,9110,8802,-83.4,9110,8805,0.999942857,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12102,Michigan State Plane Old Central zone,9807,8801,41.3,9110,8802,-85.45,9110,8805,0.999909091,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12103,Michigan State Plane West zone,9807,8801,41.3,9110,8802,-88.45,9110,8805,0.999909091,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12111,Michigan CS27 North zone,9802,8821,44.47,9110,8822,-87.0,9110,8823,45.29,9110,8824,47.05,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12112,Michigan CS27 Central zone,9802,8821,43.19,9110,8822,-84.2,9110,8823,44.11,9110,8824,45.42,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12113,Michigan CS27 South zone,9802,8821,41.3,9110,8822,-84.2,9110,8823,42.06,9110,8824,43.4,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12141,"SPCS83 Michigan North zone (meters)",9802,8821,44.47,9110,8822,-87.0,9110,8823,47.05,9110,8824,45.29,9110,8826,8000000.0,9001,8827,0.0,9001,,,
+12142,"SPCS83 Michigan Central zone (meters)",9802,8821,43.19,9110,8822,-84.22,9110,8823,45.42,9110,8824,44.11,9110,8826,6000000.0,9001,8827,0.0,9001,,,
+12143,"SPCS83 Michigan South zone (meters)",9802,8821,41.3,9110,8822,-84.22,9110,8823,43.4,9110,8824,42.06,9110,8826,4000000.0,9001,8827,0.0,9001,,,
+12201,Minnesota CS27 North zone,9802,8821,46.3,9110,8822,-93.06,9110,8823,47.02,9110,8824,48.38,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12202,Minnesota CS27 Central zone,9802,8821,45.0,9110,8822,-94.15,9110,8823,45.37,9110,8824,47.03,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12203,Minnesota CS27 South zone,9802,8821,43.0,9110,8822,-94.0,9110,8823,43.47,9110,8824,45.13,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12231,"SPCS83 Minnesota North zone (meters)",9802,8821,46.3,9110,8822,-93.06,9110,8823,48.38,9110,8824,47.02,9110,8826,800000.0,9001,8827,100000.0,9001,,,
+12232,"SPCS83 Minnesota Central zone (meters)",9802,8821,45.0,9110,8822,-94.15,9110,8823,47.03,9110,8824,45.37,9110,8826,800000.0,9001,8827,100000.0,9001,,,
+12233,"SPCS83 Minnesota South zone (meters)",9802,8821,43.0,9110,8822,-94.0,9110,8823,45.13,9110,8824,43.47,9110,8826,800000.0,9001,8827,100000.0,9001,,,
+12301,Mississippi CS27 East zone,9807,8801,29.4,9110,8802,-88.5,9110,8805,0.99996,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12302,Mississippi CS27 West zone,9807,8801,30.3,9110,8802,-90.2,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12331,"SPCS83 Mississippi East zone (meters)",9807,8801,29.3,9110,8802,-88.5,9110,8805,0.99995,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+12332,"SPCS83 Mississippi West zone (meters)",9807,8801,29.3,9110,8802,-90.2,9110,8805,0.99995,9201,8806,700000.0,9001,8807,0.0,9001,,,,,,
+12401,Missouri CS27 East zone,9807,8801,35.5,9110,8802,-90.3,9110,8805,0.999933333,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12402,Missouri CS27 Central zone,9807,8801,35.5,9110,8802,-92.3,9110,8805,0.999933333,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12403,Missouri CS27 West zone,9807,8801,36.1,9110,8802,-94.3,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12431,"SPCS83 Missouri East zone (meters)",9807,8801,35.5,9110,8802,-90.3,9110,8805,0.999933333,9201,8806,250000.0,9001,8807,0.0,9001,,,,,,
+12432,"SPCS83 Missouri Central zone (meters)",9807,8801,35.5,9110,8802,-92.3,9110,8805,0.999933333,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+12433,"SPCS83 Missouri West zone (meters)",9807,8801,36.1,9110,8802,-94.3,9110,8805,0.999941177,9201,8806,850000.0,9001,8807,0.0,9001,,,,,,
+12501,Montana CS27 North zone,9802,8821,47.0,9110,8822,-109.3,9110,8823,48.43,9110,8824,47.51,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12502,Montana CS27 Central zone,9802,8821,45.5,9110,8822,-109.3,9110,8823,47.53,9110,8824,46.27,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12503,Montana CS27 South zone,9802,8821,44.0,9110,8822,-109.3,9110,8823,46.24,9110,8824,44.52,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12530,"SPCS83 Montana zone (meters)",9802,8821,44.15,9110,8822,-109.3,9110,8823,49.0,9110,8824,45.0,9110,8826,600000.0,9001,8827,0.0,9001,,,
+12601,Nebraska CS27 North zone,9802,8821,41.2,9110,8822,-100.0,9110,8823,41.51,9110,8824,42.49,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12602,Nebraska CS27 South zone,9802,8821,39.4,9110,8822,-99.3,9110,8823,40.17,9110,8824,41.43,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+12630,"SPCS83 Nebraska zone (meters)",9802,8821,39.5,9110,8822,-100.0,9110,8823,43.0,9110,8824,40.0,9110,8826,500000.0,9001,8827,0.0,9001,,,
+12701,Nevada CS27 East zone,9807,8801,34.45,9110,8802,-115.35,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12702,Nevada CS27 Central zone,9807,8801,34.45,9110,8802,-116.4,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12703,Nevada CS27 West zone,9807,8801,34.45,9110,8802,-118.35,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12731,"SPCS83 Nevada East zone (meters)",9807,8801,34.45,9110,8802,-115.35,9110,8805,0.9999,9201,8806,200000.0,9001,8807,8000000.0,9001,,,,,,
+12732,"SPCS83 Nevada Central zone (meters)",9807,8801,34.45,9110,8802,-116.4,9110,8805,0.9999,9201,8806,500000.0,9001,8807,6000000.0,9001,,,,,,
+12733,"SPCS83 Nevada West zone (meters)",9807,8801,34.45,9110,8802,-118.35,9110,8805,0.9999,9201,8806,800000.0,9001,8807,4000000.0,9001,,,,,,
+12800,New Hampshire CS27,9807,8801,42.3,9110,8802,-71.4,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+12830,"SPCS83 New Hampshire zone (meters)",9807,8801,42.3,9110,8802,-71.4,9110,8805,0.999966667,9201,8806,300000.0,9001,8807,0.0,9001,,,,,,
+12900,New Jersey CS27,9807,8801,38.5,9110,8802,-74.4,9110,8805,0.999975,9201,8806,2000000.0,9003,8807,0.0,9003,,,,,,
+12930,"SPCS83 New Jersey zone (meters)",9807,8801,38.5,9110,8802,-74.3,9110,8805,0.9999,9201,8806,150000.0,9001,8807,0.0,9001,,,,,,
+13001,New Mexico CS27 East zone,9807,8801,31.0,9110,8802,-104.2,9110,8805,0.999909091,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+13002,New Mexico CS27 Central zone,9807,8801,31.0,9110,8802,-106.15,9110,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+13003,New Mexico CS27 West zone,9807,8801,31.0,9110,8802,-107.5,9110,8805,0.999916667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+13031,"SPCS83 New Mexico East zone (meters)",9807,8801,31.0,9110,8802,-104.2,9110,8805,0.999909091,9201,8806,165000.0,9001,8807,0.0,9001,,,,,,
+13032,"SPCS83 New Mexico Central zone (meters)",9807,8801,31.0,9110,8802,-106.15,9110,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+13033,"SPCS83 New Mexico West zone (meters)",9807,8801,31.0,9110,8802,-107.5,9110,8805,0.999916667,9201,8806,830000.0,9001,8807,0.0,9001,,,,,,
+13101,New York CS27 East zone,9807,8801,40.0,9110,8802,-74.2,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+13102,New York CS27 Central zone,9807,8801,40.0,9110,8802,-76.35,9110,8805,0.9999375,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+13103,New York CS27 West zone,9807,8801,40.0,9110,8802,-78.35,9110,8805,0.9999375,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+13104,New York CS27 Long Island zone,9802,8821,40.3,9110,8822,-74.0,9110,8823,41.02,9110,8824,40.4,9110,8826,1000000.0,9003,8827,0.0,9003,,,
+13131,"SPCS83 New York East zone (meters)",9807,8801,38.5,9110,8802,-74.3,9110,8805,0.9999,9201,8806,150000.0,9001,8807,0.0,9001,,,,,,
+13132,"SPCS83 New York Central zone (meters)",9807,8801,40.0,9110,8802,-76.35,9110,8805,0.9999375,9201,8806,250000.0,9001,8807,0.0,9001,,,,,,
+13133,"SPCS83 New York West zone (meters)",9807,8801,40.0,9110,8802,-78.35,9110,8805,0.9999375,9201,8806,350000.0,9001,8807,0.0,9001,,,,,,
+13134,"SPCS83 New York Long Island zone (meters)",9802,8821,40.1,9110,8822,-74.0,9110,8823,41.02,9110,8824,40.4,9110,8826,300000.0,9001,8827,0.0,9001,,,
+13200,North Carolina CS27,9802,8821,33.45,9110,8822,-79.0,9110,8823,34.2,9110,8824,36.1,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13230,"SPCS83 North Carolina zone (meters)",9802,8821,33.45,9110,8822,-79.0,9110,8823,36.1,9110,8824,34.2,9110,8826,609601.22,9001,8827,0.0,9001,,,
+13301,North Dakota CS27 North zone,9802,8821,47.0,9110,8822,-100.3,9110,8823,47.26,9110,8824,48.44,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13302,North Dakota CS27 South zone,9802,8821,45.4,9110,8822,-100.3,9110,8823,46.11,9110,8824,47.29,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13331,"SPCS83 North Dakota North zone (meters)",9802,8821,47.0,9110,8822,-100.3,9110,8823,48.44,9110,8824,47.26,9110,8826,600000.0,9001,8827,0.0,9001,,,
+13332,"SPCS83 North Dakota South zone (meters)",9802,8821,45.4,9110,8822,-100.3,9110,8823,47.29,9110,8824,46.11,9110,8826,600000.0,9001,8827,0.0,9001,,,
+13401,Ohio CS27 North zone,9802,8821,39.4,9110,8822,-82.3,9110,8823,40.26,9110,8824,41.42,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13402,Ohio CS27 South zone,9802,8821,38.0,9110,8822,-82.3,9110,8823,38.44,9110,8824,40.02,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13431,"SPCS83 Ohio North zone (meters)",9802,8821,39.4,9110,8822,-82.3,9110,8823,41.42,9110,8824,40.26,9110,8826,600000.0,9001,8827,0.0,9001,,,
+13432,"SPCS83 Ohio South zone (meters)",9802,8821,38.0,9110,8822,-82.3,9110,8823,40.02,9110,8824,38.44,9110,8826,600000.0,9001,8827,0.0,9001,,,
+13501,Oklahoma CS27 North zone,9802,8821,35.0,9110,8822,-98.0,9110,8823,35.34,9110,8824,36.46,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13502,Oklahoma CS27 South zone,9802,8821,33.2,9110,8822,-98.0,9110,8823,33.56,9110,8824,35.14,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13531,"SPCS83 Oklahoma North zone (meters)",9802,8821,35.0,9110,8822,-98.0,9110,8823,36.46,9110,8824,35.34,9110,8826,600000.0,9001,8827,0.0,9001,,,
+13532,"SPCS83 Oklahoma South zone (meters)",9802,8821,33.2,9110,8822,-98.0,9110,8823,35.14,9110,8824,33.56,9110,8826,600000.0,9001,8827,0.0,9001,,,
+13601,Oregon CS27 North zone,9802,8821,43.4,9110,8822,-120.3,9110,8823,44.2,9110,8824,46.0,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13602,Oregon CS27 South zone,9802,8821,41.4,9110,8822,-120.3,9110,8823,42.2,9110,8824,44.0,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13631,"SPCS83 Oregon North zone (meters)",9802,8821,43.4,9110,8822,-120.3,9110,8823,46.0,9110,8824,44.2,9110,8826,2500000.0,9001,8827,0.0,9001,,,
+13632,"SPCS83 Oregon South zone (meters)",9802,8821,41.4,9110,8822,-120.3,9110,8823,44.0,9110,8824,42.2,9110,8826,1500000.0,9001,8827,0.0,9001,,,
+13701,Pennsylvania CS27 North zone,9802,8821,40.1,9110,8822,-77.45,9110,8823,40.53,9110,8824,41.57,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13702,Pennsylvania CS27 South zone,9802,8821,39.2,9110,8822,-77.45,9110,8823,39.56,9110,8824,40.48,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13731,"SPCS83 Pennsylvania North zone (meters)",9802,8821,40.1,9110,8822,-77.45,9110,8823,41.57,9110,8824,40.53,9110,8826,600000.0,9001,8827,0.0,9001,,,
+13732,"SPCS83 Pennsylvania South zone (meters)",9802,8821,39.2,9110,8822,-77.45,9110,8823,40.58,9110,8824,39.56,9110,8826,600000.0,9001,8827,0.0,9001,,,
+13800,Rhode Island CS27,9807,8801,41.05,9110,8802,-71.3,9110,8805,0.9999938,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+13830,"SPCS83 Rhode Island zone (meters)",9807,8801,41.05,9110,8802,-71.3,9110,8805,0.99999375,9201,8806,100000.0,9001,8807,0.0,9001,,,,,,
+13901,South Carolina CS27 North zone,9802,8821,33.0,9110,8822,-81.0,9110,8823,33.46,9110,8824,34.58,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13902,South Carolina CS27 South zone,9802,8821,31.5,9110,8822,-81.0,9110,8823,32.2,9110,8824,33.4,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+13930,"SPCS83 South Carolina zone (meters)",9802,8821,31.5,9110,8822,-81.0,9110,8823,34.5,9110,8824,32.3,9110,8826,609600.0,9001,8827,0.0,9001,,,
+14001,South Dakota CS27 North zone,9802,8821,43.5,9110,8822,-100.0,9110,8823,44.25,9110,8824,45.41,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14002,South Dakota CS27 South zone,9802,8821,42.2,9110,8822,-100.2,9110,8823,42.5,9110,8824,44.24,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14031,"SPCS83 South Dakota North zone (meters)",9802,8821,43.5,9110,8822,-100.0,9110,8823,45.41,9110,8824,44.25,9110,8826,600000.0,9001,8827,0.0,9001,,,
+14032,"SPCS83 South Dakota South zone (meters)",9802,8821,42.2,9110,8822,-100.2,9110,8823,44.24,9110,8824,42.5,9110,8826,600000.0,9001,8827,0.0,9001,,,
+14100,Tennessee CS27,9802,8821,34.4,9110,8822,-86.0,9110,8823,35.15,9110,8824,36.25,9110,8826,100000.0,9003,8827,0.0,9003,,,
+14130,"SPCS83 Tennessee zone (meters)",9802,8821,34.2,9110,8822,-86.0,9110,8823,36.25,9110,8824,35.15,9110,8826,600000.0,9001,8827,0.0,9001,,,
+14201,Texas CS27 North zone,9802,8821,34.0,9110,8822,-101.3,9110,8823,34.39,9110,8824,36.11,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14202,Texas CS27 North Central zone,9802,8821,31.4,9110,8822,-97.3,9110,8823,32.08,9110,8824,33.58,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14203,Texas CS27 Central zone,9802,8821,29.4,9110,8822,-100.2,9110,8823,30.07,9110,8824,31.53,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14204,Texas CS27 South Central zone,9802,8821,27.5,9110,8822,-99.0,9110,8823,28.23,9110,8824,30.17,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14205,Texas CS27 South zone,9802,8821,25.4,9110,8822,-98.3,9110,8823,26.1,9110,8824,27.5,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14231,"SPCS83 Texas North zone (meters)",9802,8821,34.0,9110,8822,-101.3,9110,8823,36.11,9110,8824,34.39,9110,8826,200000.0,9001,8827,1000000.0,9001,,,
+14232,"SPCS83 Texas North Central zone (meters)",9802,8821,31.4,9110,8822,-98.3,9110,8823,33.58,9110,8824,32.08,9110,8826,600000.0,9001,8827,2000000.0,9001,,,
+14233,"SPCS83 Texas Central zone (meters)",9802,8821,29.4,9110,8822,-100.2,9110,8823,31.53,9110,8824,30.07,9110,8826,700000.0,9001,8827,3000000.0,9001,,,
+14234,"SPCS83 Texas South Central zone (meters)",9802,8821,27.5,9110,8822,-99.0,9110,8823,30.17,9110,8824,28.23,9110,8826,600000.0,9001,8827,4000000.0,9001,,,
+14235,"SPCS83 Texas South zone (meters)",9802,8821,25.4,9110,8822,-98.3,9110,8823,27.5,9110,8824,26.1,9110,8826,300000.0,9001,8827,5000000.0,9001,,,
+14301,Utah CS27 North zone,9802,8821,40.2,9110,8822,-111.3,9110,8823,40.43,9110,8824,41.47,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14302,Utah CS27 Central zone,9802,8821,38.2,9110,8822,-111.3,9110,8823,39.01,9110,8824,40.39,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14303,Utah CS27 South zone,9802,8821,36.4,9110,8822,-111.3,9110,8823,37.13,9110,8824,38.21,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14331,"SPCS83 Utah North zone (meters)",9802,8821,40.2,9110,8822,-111.3,9110,8823,41.47,9110,8824,40.43,9110,8826,500000.0,9001,8827,1000000.0,9001,,,
+14332,"SPCS83 Utah Central zone (meters)",9802,8821,38.2,9110,8822,-111.3,9110,8823,40.39,9110,8824,39.01,9110,8826,500000.0,9001,8827,2000000.0,9001,,,
+14333,"SPCS83 Utah South zone (meters)",9802,8821,36.4,9110,8822,-111.3,9110,8823,38.21,9110,8824,37.13,9110,8826,500000.0,9001,8827,3000000.0,9001,,,
+14400,Vermont CS27,9807,8801,42.3,9110,8802,-72.3,9110,8805,0.999964286,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+14430,"SPCS83 Vermont zone (meters)",9807,8801,42.3,9110,8802,-72.3,9110,8805,0.999964286,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+14501,Virginia CS27 North zone,9802,8821,37.4,9110,8822,-78.3,9110,8823,38.02,9110,8824,39.12,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14502,Virginia CS27 South zone,9802,8821,36.2,9110,8822,-78.3,9110,8823,36.46,9110,8824,37.58,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14531,"SPCS83 Virginia North zone (meters)",9802,8821,37.4,9110,8822,-78.3,9110,8823,39.12,9110,8824,38.02,9110,8826,3500000.0,9001,8827,2000000.0,9001,,,
+14532,"SPCS83 Virginia South zone (meters)",9802,8821,36.2,9110,8822,-78.3,9110,8823,37.58,9110,8824,36.46,9110,8826,3500000.0,9001,8827,1000000.0,9001,,,
+14601,Washington CS27 North zone,9802,8821,47.0,9110,8822,-120.5,9110,8823,47.3,9110,8824,48.44,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14602,Washington CS27 South zone,9802,8821,45.2,9110,8822,-120.3,9110,8823,45.5,9110,8824,47.2,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14631,"SPCS83 Washington North zone (meters)",9802,8821,47.0,9110,8822,-120.5,9110,8823,48.44,9110,8824,47.3,9110,8826,500000.0,9001,8827,0.0,9001,,,
+14632,"SPCS83 Washington South zone (meters)",9802,8821,45.2,9110,8822,-120.3,9110,8823,47.2,9110,8824,45.5,9110,8826,500000.0,9001,8827,0.0,9001,,,
+14701,West Virginia CS27 North zone,9802,8821,38.3,9110,8822,-79.3,9110,8823,39.0,9110,8824,40.15,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14702,West Virginia CS27 South zone,9802,8821,37.0,9110,8822,-81.0,9110,8823,37.29,9110,8824,38.53,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14731,"SPCS83 West Virginia North zone (meters)",9802,8821,38.3,9110,8822,-79.3,9110,8823,40.15,9110,8824,39.0,9110,8826,600000.0,9001,8827,0.0,9001,,,
+14732,"SPCS83 West Virginia South zone (meters)",9802,8821,37.0,9110,8822,-81.0,9110,8823,38.53,9110,8824,37.29,9110,8826,600000.0,9001,8827,0.0,9001,,,
+14801,Wisconsin CS27 North zone,9802,8821,45.1,9110,8822,-90.0,9110,8823,45.34,9110,8824,46.46,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14802,Wisconsin CS27 Central zone,9802,8821,43.5,9110,8822,-90.0,9110,8823,44.15,9110,8824,45.3,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14803,Wisconsin CS27 South zone,9802,8821,42.0,9110,8822,-90.0,9110,8823,42.44,9110,8824,44.04,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+14831,"SPCS83 Wisconsin North zone (meters)",9802,8821,45.1,9110,8822,-90.0,9110,8823,46.46,9110,8824,45.34,9110,8826,600000.0,9001,8827,0.0,9001,,,
+14832,"SPCS83 Wisconsin Central zone (meters)",9802,8821,43.5,9110,8822,-90.0,9110,8823,45.3,9110,8824,44.15,9110,8826,600000.0,9001,8827,0.0,9001,,,
+14833,"SPCS83 Wisconsin South zone (meters)",9802,8821,42.0,9110,8822,-90.0,9110,8823,44.04,9110,8824,42.44,9110,8826,600000.0,9001,8827,0.0,9001,,,
+14901,Wyoming CS27 East zone,9807,8801,40.4,9110,8802,-105.1,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+14902,Wyoming CS27 East Central zone,9807,8801,40.4,9110,8802,-107.2,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+14903,Wyoming CS27 West Central zone,9807,8801,40.4,9110,8802,-108.45,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+14904,Wyoming CS27 West zone,9807,8801,40.4,9110,8802,-110.05,9110,8805,0.999941177,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+14931,"SPCS83 Wyoming East zone (meters)",9807,8801,40.3,9110,8802,-105.1,9110,8805,0.9999375,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+14932,"SPCS83 Wyoming East Central zone (meters)",9807,8801,40.3,9110,8802,-107.2,9110,8805,0.9999375,9201,8806,400000.0,9001,8807,100000.0,9001,,,,,,
+14933,"SPCS83 Wyoming West Central zone (meters)",9807,8801,40.3,9110,8802,-108.45,9110,8805,0.9999375,9201,8806,600000.0,9001,8807,0.0,9001,,,,,,
+14934,"SPCS83 Wyoming West zone (meters)",9807,8801,40.3,9110,8802,-110.05,9110,8805,0.9999375,9201,8806,800000.0,9001,8807,100000.0,9001,,,,,,
+15001,Alaska CS27 zone 1,9812,8806,16404166.67,9003,8807,-16404166.67,9003,8811,57.0,9110,8812,-133.4,9110,8813,323.07483685,9110,8814,323.07483685,9110,8815,0.9999,9201
+15002,Alaska CS27 zone 2,9807,8801,54.0,9102,8802,-142.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15003,Alaska CS27 zone 3,9807,8801,54.0,9102,8802,-146.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15004,Alaska CS27 zone 4,9807,8801,54.0,9102,8802,-150.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15005,Alaska CS27 zone 5,9807,8801,54.0,9102,8802,-154.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15006,Alaska CS27 zone 6,9807,8801,54.0,9102,8802,-158.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15007,Alaska CS27 zone 7,9807,8801,54.0,9102,8802,-162.0,9102,8805,0.9999,9201,8806,700000.0,9003,8807,0.0,9003,,,,,,
+15008,Alaska CS27 zone 8,9807,8801,54.0,9102,8802,-166.0,9102,8805,0.9999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15009,Alaska CS27 zone 9,9807,8801,54.0,9102,8802,-170.0,9102,8805,0.9999,9201,8806,600000.0,9003,8807,0.0,9003,,,,,,
+15010,Alaska CS27 zone 10,9802,8821,51.0,9110,8822,-176.0,9110,8823,53.5,9110,8824,51.5,9110,8826,3000000.0,9003,8827,0.0,9003,,,
+15031,"SPCS83 Alaska zone 1 (meters)",9812,8806,5000000.0,9001,8807,-5000000.0,9001,8811,57.0,9110,8812,-133.4,9110,8813,323.07483685,9110,8814,323.07483685,9110,8815,0.9999,9201
+15032,"SPCS83 Alaska zone 2 (meters)",9807,8801,54.0,9102,8802,-142.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15033,"SPCS83 Alaska zone 3 (meters)",9807,8801,54.0,9102,8802,-146.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15034,"SPCS83 Alaska zone 4 (meters)",9807,8801,54.0,9102,8802,-150.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15035,"SPCS83 Alaska zone 5 (meters)",9807,8801,54.0,9102,8802,-154.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15036,"SPCS83 Alaska zone 6 (meters)",9807,8801,54.0,9102,8802,-158.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15037,"SPCS83 Alaska zone 7 (meters)",9807,8801,54.0,9102,8802,-162.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15038,"SPCS83 Alaska zone 8 (meters)",9807,8801,54.0,9102,8802,-166.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15039,"SPCS83 Alaska zone 9 (meters)",9807,8801,54.0,9102,8802,-170.0,9102,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15040,"SPCS83 Alaska zone 10 (meters)",9802,8821,51.0,9110,8822,-176.0,9110,8823,53.5,9110,8824,51.5,9110,8826,1000000.0,9001,8827,0.0,9001,,,
+15101,Hawaii CS27 zone 1,9807,8801,18.5,9110,8802,-155.3,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15102,Hawaii CS27 zone 2,9807,8801,20.2,9110,8802,-156.4,9110,8805,0.999966667,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15103,Hawaii CS27 zone 3,9807,8801,21.1,9110,8802,-158.0,9110,8805,0.99999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15104,Hawaii CS27 zone 4,9807,8801,21.5,9110,8802,-159.3,9110,8805,0.99999,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15105,Hawaii CS27 zone 5,9807,8801,21.4,9110,8802,-160.1,9110,8805,1.0,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15131,"SPCS83 Hawaii zone 1 (meters)",9807,8801,18.5,9110,8802,-155.3,9110,8805,0.999966667,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15132,"SPCS83 Hawaii zone 2 (meters)",9807,8801,20.2,9110,8802,-156.4,9110,8805,0.999966667,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15133,"SPCS83 Hawaii zone 3 (meters)",9807,8801,21.1,9110,8802,-158.0,9110,8805,0.99999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15134,"SPCS83 Hawaii zone 4 (meters)",9807,8801,21.5,9110,8802,-159.3,9110,8805,0.99999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15135,"SPCS83 Hawaii zone 5 (meters)",9807,8801,21.4,9110,8802,-160.1,9110,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+15201,Puerto Rico CS27,9802,8821,17.5,9110,8822,-66.26,9110,8823,18.26,9110,8824,18.02,9110,8826,500000.0,9003,8827,0.0,9003,,,
+15202,St. Croix CS27,9802,8821,17.5,9110,8822,-66.26,9110,8823,18.26,9110,8824,18.02,9110,8826,500000.0,9003,8827,100000.0,9003,,,
+15230,"SPCS83 Puerto Rico & Virgin Islands zone (meters)",9802,8821,17.5,9110,8822,-66.26,9110,8823,18.26,9110,8824,18.02,9110,8826,200000.0,9001,8827,200000.0,9001,,,
+15300,American Samoa Lambert,9801,8801,-14.16,9110,8802,170.0,9110,8805,1.0,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15301,American Samoa Lambert,9801,8801,-14.16,9110,8802,-170.0,9110,8805,1.0,9201,8806,500000.0,9003,8807,0.0,9003,,,,,,
+15302,Tennessee CS27,9802,8821,34.4,9110,8822,-86.0,9110,8823,35.15,9110,8824,36.25,9110,8826,2000000.0,9003,8827,100000.0,9003,,,
+15303,"SPCS83 Kentucky North zone (meters)",9802,8821,37.3,9110,8822,-84.15,9110,8823,37.58,9110,8824,38.58,9110,8826,500000.0,9001,8827,0.0,9001,,,
+15304,"SPCS83 Arizona East zone (International feet)",9807,8801,31.0,9110,8802,-110.1,9110,8805,0.9999,9201,8806,700000.0,9002,8807,0.0,9002,,,,,,
+15305,"SPCS83 Arizona Central zone (International feet)",9807,8801,31.0,9110,8802,-111.55,9110,8805,0.9999,9201,8806,700000.0,9002,8807,0.0,9002,,,,,,
+15306,"SPCS83 Arizona West zone (International feet)",9807,8801,31.0,9110,8802,-113.45,9110,8805,0.999933333,9201,8806,700000.0,9002,8807,0.0,9002,,,,,,
+15307,"SPCS83 California zone 1 (US Survey feet)",9802,8821,39.2,9110,8822,-122.0,9110,8823,41.4,9110,8824,40.0,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+15308,"SPCS83 California zone 2 (US Survey feet)",9802,8821,37.4,9110,8822,-122.0,9110,8823,39.5,9110,8824,38.2,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+15309,"SPCS83 California zone 3 (US Survey feet)",9802,8821,36.3,9110,8822,-120.3,9110,8823,38.26,9110,8824,37.04,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+15310,"SPCS83 California zone 4 (US Survey feet)",9802,8821,35.2,9110,8822,-119.0,9110,8823,37.15,9110,8824,36.0,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+15311,"SPCS83 California zone 5 (US Survey feet)",9802,8821,33.3,9110,8822,-118.0,9110,8823,35.28,9110,8824,34.02,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+15312,"SPCS83 California zone 6 (US Survey feet)",9802,8821,32.1,9110,8822,-116.15,9110,8823,33.53,9110,8824,32.47,9110,8826,6561666.667,9003,8827,1640416.667,9003,,,
+15313,"SPCS83 Colorado North zone (US Survey feet)",9802,8821,39.2,9110,8822,-105.3,9110,8823,40.47,9110,8824,39.43,9110,8826,3000000.0,9003,8827,1000000.0,9003,,,
+15314,"SPCS83 Colorado Central zone (US Survey feet)",9802,8821,37.5,9110,8822,-105.3,9110,8823,39.45,9110,8824,38.27,9110,8826,3000000.0,9003,8827,1000000.0,9003,,,
+15315,"SPCS83 Colorado South zone (US Survey feet)",9802,8821,36.4,9110,8822,-105.3,9110,8823,38.26,9110,8824,37.14,9110,8826,3000000.0,9003,8827,1000000.0,9003,,,
+15316,"SPCS83 Connecticut zone (US Survey feet)",9802,8821,40.5,9110,8822,-72.45,9110,8823,41.52,9110,8824,41.12,9110,8826,1000000.0,9003,8827,500000.0,9003,,,
+15317,"SPCS83 Delaware zone (US Survey feet)",9807,8801,38.0,9110,8802,-75.25,9110,8805,0.999995,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+15318,"SPCS83 Florida East zone (US Survey feet)",9807,8801,24.2,9110,8802,-81.0,9110,8805,0.999941177,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+15319,"SPCS83 Florida West zone (US Survey feet)",9807,8801,24.2,9110,8802,-82.0,9110,8805,0.999941177,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+15320,"SPCS83 Florida North zone (US Survey feet)",9802,8821,29.0,9110,8822,-84.3,9110,8823,30.45,9110,8824,29.35,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+15321,"SPCS83 Georgia East zone (US Survey feet)",9807,8801,30.0,9110,8802,-82.1,9110,8805,0.9999,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+15322,"SPCS83 Georgia West zone (US Survey feet)",9807,8801,30.0,9110,8802,-84.1,9110,8805,0.9999,9201,8806,2296583.333,9003,8807,0.0,9003,,,,,,
+15323,"SPCS83 Idaho East zone (US Survey feet)",9807,8801,41.4,9110,8802,-112.1,9110,8805,0.999947368,9201,8806,656166.667,9003,8807,0.0,9003,,,,,,
+15324,"SPCS83 Idaho Central zone (US Survey feet)",9807,8801,41.4,9110,8802,-114.0,9110,8805,0.999947368,9201,8806,1640416.667,9003,8807,0.0,9003,,,,,,
+15325,"SPCS83 Idaho West zone (US Survey feet)",9807,8801,41.4,9110,8802,-115.45,9110,8805,0.999933333,9201,8806,2624666.667,9003,8807,0.0,9003,,,,,,
+15326,"SPCS83 Indiana East zone (US Survey feet)",9807,8801,37.3,9110,8802,-85.4,9110,8805,0.999966667,9201,8806,328083.333,9003,8807,818125.0,9003,,,,,,
+15327,"SPCS83 Indiana West zone (US Survey feet)",9807,8801,37.3,9110,8802,-87.05,9110,8805,0.999966667,9201,8806,2952750.0,9003,8807,818125.0,9003,,,,,,
+15328,"SPCS83 Kentucky North zone (US Survey feet)",9802,8821,37.3,9110,8822,-84.15,9110,8823,37.58,9110,8824,38.58,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+15329,"SPCS83 Kentucky South zone (US Survey feet)",9802,8821,36.2,9110,8822,-85.45,9110,8823,37.56,9110,8824,36.44,9110,8826,1640416.667,9003,8827,1640416.667,9003,,,
+15330,"SPCS83 Maryland zone (US Survey feet)",9802,8821,37.4,9110,8822,-77.0,9110,8823,39.27,9110,8824,38.18,9110,8826,1312333.333,9003,8827,0.0,9003,,,
+15331,"SPCS83 Massachusetts Mainland zone (US Survey feet)",9802,8821,41.0,9110,8822,-71.3,9110,8823,42.41,9110,8824,41.43,9110,8826,656166.667,9003,8827,2460625.0,9003,,,
+15332,"SPCS83 Massachusetts Island zone (US Survey feet)",9802,8821,41.0,9110,8822,-70.3,9110,8823,41.29,9110,8824,41.17,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+15333,"SPCS83 Michigan North zone (International feet)",9802,8821,44.47,9110,8822,-87.0,9110,8823,47.05,9110,8824,45.29,9110,8826,26246719.16,9002,8827,0.0,9002,,,
+15334,"SPCS83 Michigan Central zone (International feet)",9802,8821,43.19,9110,8822,-84.22,9110,8823,45.42,9110,8824,44.11,9110,8826,19685039.37,9002,8827,0.0,9002,,,
+15335,"SPCS83 Michigan South zone (International feet)",9802,8821,41.3,9110,8822,-84.22,9110,8823,43.4,9110,8824,42.06,9110,8826,13123359.58,9002,8827,0.0,9002,,,
+15336,"SPCS83 Mississippi East zone (US Survey feet)",9807,8801,29.3,9110,8802,-88.5,9110,8805,0.99995,9201,8806,984250.0,9003,8807,0.0,9003,,,,,,
+15337,"SPCS83 Mississippi West zone (US Survey feet)",9807,8801,29.3,9110,8802,-90.2,9110,8805,0.99995,9201,8806,2296583.333,9003,8807,0.0,9003,,,,,,
+15338,"SPCS83 Montana zone (International feet)",9802,8821,44.15,9110,8822,-109.3,9110,8823,49.0,9110,8824,45.0,9110,8826,1968503.937,9002,8827,0.0,9002,,,
+15339,"SPCS83 New Mexico East zone (US Survey feet)",9807,8801,31.0,9110,8802,-104.2,9110,8805,0.999909091,9201,8806,541337.5,9003,8807,0.0,9003,,,,,,
+15340,"SPCS83 New Mexico Central zone (US Survey feet)",9807,8801,31.0,9110,8802,-106.15,9110,8805,0.9999,9201,8806,1640416.667,9003,8807,0.0,9003,,,,,,
+15341,"SPCS83 New Mexico West zone (US Survey feet)",9807,8801,31.0,9110,8802,-107.5,9110,8805,0.999916667,9201,8806,2723091.667,9003,8807,0.0,9003,,,,,,
+15342,"SPCS83 New York East zone (US Survey feet)",9807,8801,38.5,9110,8802,-74.3,9110,8805,0.9999,9201,8806,492125.0,9003,8807,0.0,9003,,,,,,
+15343,"SPCS83 New York Central zone (US Survey feet)",9807,8801,40.0,9110,8802,-76.35,9110,8805,0.9999375,9201,8806,820208.333,9003,8807,0.0,9003,,,,,,
+15344,"SPCS83 New York West zone (US Survey feet)",9807,8801,40.0,9110,8802,-78.35,9110,8805,0.9999375,9201,8806,1148291.667,9003,8807,0.0,9003,,,,,,
+15345,"SPCS83 New York Long Island zone (US Survey feet)",9802,8821,40.1,9110,8822,-74.0,9110,8823,41.02,9110,8824,40.4,9110,8826,984250.0,9003,8827,0.0,9003,,,
+15346,"SPCS83 North Carolina zone (US Survey feet)",9802,8821,33.45,9110,8822,-79.0,9110,8823,36.1,9110,8824,34.2,9110,8826,2000000.0,9003,8827,0.0,9003,,,
+15347,"SPCS83 North Dakota North zone (International feet)",9802,8821,47.0,9110,8822,-100.3,9110,8823,48.44,9110,8824,47.26,9110,8826,1968503.937,9002,8827,0.0,9002,,,
+15348,"SPCS83 North Dakota South zone (International feet)",9802,8821,45.4,9110,8822,-100.3,9110,8823,47.29,9110,8824,46.11,9110,8826,1968503.937,9002,8827,0.0,9002,,,
+15349,"SPCS83 Oklahoma North zone (US Survey feet)",9802,8821,35.0,9110,8822,-98.0,9110,8823,36.46,9110,8824,35.34,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+15350,"SPCS83 Oklahoma South zone (US Survey feet)",9802,8821,33.2,9110,8822,-98.0,9110,8823,35.14,9110,8824,33.56,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+15351,"SPCS83 Oregon North zone (International feet)",9802,8821,43.4,9110,8822,-120.3,9110,8823,46.0,9110,8824,44.2,9110,8826,8202099.738,9002,8827,0.0,9002,,,
+15352,"SPCS83 Oregon South zone (International feet)",9802,8821,41.4,9110,8822,-120.3,9110,8823,44.0,9110,8824,42.2,9110,8826,4921259.843,9002,8827,0.0,9002,,,
+15353,"SPCS83 Pennsylvania North zone (US Survey feet)",9802,8821,40.1,9110,8822,-77.45,9110,8823,41.57,9110,8824,40.53,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+15354,"SPCS83 Pennsylvania South zone (US Survey feet)",9802,8821,39.2,9110,8822,-77.45,9110,8823,40.58,9110,8824,39.56,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+15355,"SPCS83 South Carolina zone (International feet)",9802,8821,31.5,9110,8822,-81.0,9110,8823,34.5,9110,8824,32.3,9110,8826,2000000.0,9002,8827,0.0,9002,,,
+15356,"SPCS83 Tennessee zone (US Survey feet)",9802,8821,34.2,9110,8822,-86.0,9110,8823,36.25,9110,8824,35.15,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+15357,"SPCS83 Texas North zone (US Survey feet)",9802,8821,34.0,9110,8822,-101.3,9110,8823,36.11,9110,8824,34.39,9110,8826,656166.667,9003,8827,3280833.333,9003,,,
+15358,"SPCS83 Texas North Central zone (US Survey feet)",9802,8821,31.4,9110,8822,-98.3,9110,8823,33.58,9110,8824,32.08,9110,8826,1968500.0,9003,8827,6561666.667,9003,,,
+15359,"SPCS83 Texas Central zone (US Survey feet)",9802,8821,29.4,9110,8822,-100.2,9110,8823,31.53,9110,8824,30.07,9110,8826,2296583.333,9003,8827,9842500.0,9003,,,
+15360,"SPCS83 Texas South Central zone (US Survey feet)",9802,8821,27.5,9110,8822,-99.0,9110,8823,30.17,9110,8824,28.23,9110,8826,1968500.0,9003,8827,13123333.333,9003,,,
+15361,"SPCS83 Texas South zone (US Survey feet)",9802,8821,25.4,9110,8822,-98.3,9110,8823,27.5,9110,8824,26.1,9110,8826,984250.0,9003,8827,16404166.667,9003,,,
+15362,"SPCS83 Utah North zone (International feet)",9802,8821,40.2,9110,8822,-111.3,9110,8823,41.47,9110,8824,40.43,9110,8826,1640419.948,9002,8827,3280839.895,9002,,,
+15363,"SPCS83 Utah Central zone (International feet)",9802,8821,38.2,9110,8822,-111.3,9110,8823,40.39,9110,8824,39.01,9110,8826,1640419.948,9002,8827,6561679.79,9002,,,
+15364,"SPCS83 Utah South zone (International feet)",9802,8821,36.4,9110,8822,-111.3,9110,8823,38.21,9110,8824,37.13,9110,8826,1640419.948,9002,8827,9842519.685,9002,,,
+15365,"SPCS83 Virginia North zone (US Survey feet)",9802,8821,37.4,9110,8822,-78.3,9110,8823,39.12,9110,8824,38.02,9110,8826,11482916.667,9003,8827,6561666.667,9003,,,
+15366,"SPCS83 Virginia South zone (US Survey feet)",9802,8821,36.2,9110,8822,-78.3,9110,8823,37.58,9110,8824,36.46,9110,8826,11482916.667,9003,8827,3280833.333,9003,,,
+15367,"SPCS83 Washington North zone (US Survey feet)",9802,8821,47.0,9110,8822,-120.5,9110,8823,48.44,9110,8824,47.3,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+15368,"SPCS83 Washington South zone (US Survey feet)",9802,8821,45.2,9110,8822,-120.3,9110,8823,47.2,9110,8824,45.5,9110,8826,1640416.667,9003,8827,0.0,9003,,,
+15369,"SPCS83 Wisconsin North zone (US Survey feet)",9802,8821,45.1,9110,8822,-90.0,9110,8823,46.46,9110,8824,45.34,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+15370,"SPCS83 Wisconsin Central zone (US Survey feet)",9802,8821,43.5,9110,8822,-90.0,9110,8823,45.3,9110,8824,44.15,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+15371,"SPCS83 Wisconsin South zone (US Survey feet)",9802,8821,42.0,9110,8822,-90.0,9110,8823,44.04,9110,8824,42.44,9110,8826,1968500.0,9003,8827,0.0,9003,,,
+15914,"BLM zone 14N (US survey feet)",9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+15915,"BLM zone 15N (US survey feet)",9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+15916,"BLM zone 16N (US survey feet)",9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+15917,"BLM zone 17N (US survey feet)",9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,1640416.67,9003,8807,0.0,9003,,,,,,
+16000,"UTM grid system (northern hemisphere)",9824,8801,0.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,8830,-180.0,9102,8831,6.0,9102,,,
+16001,UTM zone 1N,9807,8801,0.0,9102,8802,-177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16002,UTM zone 2N,9807,8801,0.0,9102,8802,-171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16003,UTM zone 3N,9807,8801,0.0,9102,8802,-165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16004,UTM zone 4N,9807,8801,0.0,9102,8802,-159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16005,UTM zone 5N,9807,8801,0.0,9102,8802,-153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16006,UTM zone 6N,9807,8801,0.0,9102,8802,-147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16007,UTM zone 7N,9807,8801,0.0,9102,8802,-141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16008,UTM zone 8N,9807,8801,0.0,9102,8802,-135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16009,UTM zone 9N,9807,8801,0.0,9102,8802,-129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16010,UTM zone 10N,9807,8801,0.0,9102,8802,-123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16011,UTM zone 11N,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16012,UTM zone 12N,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16013,UTM zone 13N,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16014,UTM zone 14N,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16015,UTM zone 15N,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16016,UTM zone 16N,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16017,UTM zone 17N,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16018,UTM zone 18N,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16019,UTM zone 19N,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16020,UTM zone 20N,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16021,UTM zone 21N,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16022,UTM zone 22N,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16023,UTM zone 23N,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16024,UTM zone 24N,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16025,UTM zone 25N,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16026,UTM zone 26N,9807,8801,0.0,9102,8802,-27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16027,UTM zone 27N,9807,8801,0.0,9102,8802,-21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16028,UTM zone 28N,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16029,UTM zone 29N,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16030,UTM zone 30N,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16031,UTM zone 31N,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16032,UTM zone 32N,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16033,UTM zone 33N,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16034,UTM zone 34N,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16035,UTM zone 35N,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16036,UTM zone 36N,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16037,UTM zone 37N,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16038,UTM zone 38N,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16039,UTM zone 39N,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16040,UTM zone 40N,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16041,UTM zone 41N,9807,8801,0.0,9102,8802,63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16042,UTM zone 42N,9807,8801,0.0,9102,8802,69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16043,UTM zone 43N,9807,8801,0.0,9102,8802,75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16044,UTM zone 44N,9807,8801,0.0,9102,8802,81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16045,UTM zone 45N,9807,8801,0.0,9102,8802,87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16046,UTM zone 46N,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16047,UTM zone 47N,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16048,UTM zone 48N,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16049,UTM zone 49N,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16050,UTM zone 50N,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16051,UTM zone 51N,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16052,UTM zone 52N,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16053,UTM zone 53N,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16054,UTM zone 54N,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16055,UTM zone 55N,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16056,UTM zone 56N,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16057,UTM zone 57N,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16058,UTM zone 58N,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16059,UTM zone 59N,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16060,UTM zone 60N,9807,8801,0.0,9102,8802,177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16061,Universal Polar Stereographic North,9810,8801,90.0,9102,8802,0.0,9102,8805,0.994,9201,8806,2000000.0,9001,8807,2000000.0,9001,,,,,,
+16070,3-degree Gauss-Kruger zone 40,9807,8801,0.0,9102,8802,120.0,9102,8805,1.0,9201,8806,40500000.0,9001,8807,0.0,9001,,,,,,
+16071,3-degree Gauss-Kruger zone 41,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,41500000.0,9001,8807,0.0,9001,,,,,,
+16072,3-degree Gauss-Kruger zone 42,9807,8801,0.0,9102,8802,126.0,9102,8805,1.0,9201,8806,42500000.0,9001,8807,0.0,9001,,,,,,
+16073,3-degree Gauss-Kruger zone 43,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,43500000.0,9001,8807,0.0,9001,,,,,,
+16074,3-degree Gauss-Kruger zone 44,9807,8801,0.0,9102,8802,132.0,9102,8805,1.0,9201,8806,44500000.0,9001,8807,0.0,9001,,,,,,
+16075,3-degree Gauss-Kruger zone 45,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,45500000.0,9001,8807,0.0,9001,,,,,,
+16076,3-degree Gauss-Kruger zone 46,9807,8801,0.0,9102,8802,138.0,9102,8805,1.0,9201,8806,46500000.0,9001,8807,0.0,9001,,,,,,
+16077,3-degree Gauss-Kruger zone 47,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,47500000.0,9001,8807,0.0,9001,,,,,,
+16078,3-degree Gauss-Kruger zone 48,9807,8801,0.0,9102,8802,144.0,9102,8805,1.0,9201,8806,48500000.0,9001,8807,0.0,9001,,,,,,
+16079,3-degree Gauss-Kruger zone 49,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,49500000.0,9001,8807,0.0,9001,,,,,,
+16080,3-degree Gauss-Kruger zone 50,9807,8801,0.0,9102,8802,150.0,9102,8805,1.0,9201,8806,50500000.0,9001,8807,0.0,9001,,,,,,
+16081,3-degree Gauss-Kruger zone 51,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,51500000.0,9001,8807,0.0,9001,,,,,,
+16082,3-degree Gauss-Kruger zone 52,9807,8801,0.0,9102,8802,156.0,9102,8805,1.0,9201,8806,52500000.0,9001,8807,0.0,9001,,,,,,
+16083,3-degree Gauss-Kruger zone 53,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,53500000.0,9001,8807,0.0,9001,,,,,,
+16084,3-degree Gauss-Kruger zone 54,9807,8801,0.0,9102,8802,162.0,9102,8805,1.0,9201,8806,54500000.0,9001,8807,0.0,9001,,,,,,
+16085,3-degree Gauss-Kruger zone 55,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,55500000.0,9001,8807,0.0,9001,,,,,,
+16086,3-degree Gauss-Kruger zone 56,9807,8801,0.0,9102,8802,168.0,9102,8805,1.0,9201,8806,56500000.0,9001,8807,0.0,9001,,,,,,
+16087,3-degree Gauss-Kruger zone 57,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,57500000.0,9001,8807,0.0,9001,,,,,,
+16088,3-degree Gauss-Kruger zone 58,9807,8801,0.0,9102,8802,174.0,9102,8805,1.0,9201,8806,58500000.0,9001,8807,0.0,9001,,,,,,
+16089,3-degree Gauss-Kruger zone 59,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,59500000.0,9001,8807,0.0,9001,,,,,,
+16090,3-degree Gauss-Kruger zone 60,9807,8801,0.0,9102,8802,180.0,9102,8805,1.0,9201,8806,60000000.0,9001,8807,0.0,9001,,,,,,
+16091,3-degree Gauss-Kruger zone 61,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,61500000.0,9001,8807,0.0,9001,,,,,,
+16092,3-degree Gauss-Kruger zone 62,9807,8801,0.0,9102,8802,-174.0,9102,8805,1.0,9201,8806,62500000.0,9001,8807,0.0,9001,,,,,,
+16093,3-degree Gauss-Kruger zone 63,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,63500000.0,9001,8807,0.0,9001,,,,,,
+16094,3-degree Gauss-Kruger zone 64,9807,8801,0.0,9102,8802,-168.0,9102,8805,1.0,9201,8806,64500000.0,9001,8807,0.0,9001,,,,,,
+16100,"UTM grid system (southern hemisphere)",9824,8801,0.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,8830,-180.0,9102,8831,6.0,9102,,,
+16101,UTM zone 1S,9807,8801,0.0,9102,8802,-177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16102,UTM zone 2S,9807,8801,0.0,9102,8802,-171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16103,UTM zone 3S,9807,8801,0.0,9102,8802,-165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16104,UTM zone 4S,9807,8801,0.0,9102,8802,-159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16105,UTM zone 5S,9807,8801,0.0,9102,8802,-153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16106,UTM zone 6S,9807,8801,0.0,9102,8802,-147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16107,UTM zone 7S,9807,8801,0.0,9102,8802,-141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16108,UTM zone 8S,9807,8801,0.0,9102,8802,-135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16109,UTM zone 9S,9807,8801,0.0,9102,8802,-129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16110,UTM zone 10S,9807,8801,0.0,9102,8802,-123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16111,UTM zone 11S,9807,8801,0.0,9102,8802,-117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16112,UTM zone 12S,9807,8801,0.0,9102,8802,-111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16113,UTM zone 13S,9807,8801,0.0,9102,8802,-105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16114,UTM zone 14S,9807,8801,0.0,9102,8802,-99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16115,UTM zone 15S,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16116,UTM zone 16S,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16117,UTM zone 17S,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16118,UTM zone 18S,9807,8801,0.0,9102,8802,-75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16119,UTM zone 19S,9807,8801,0.0,9102,8802,-69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16120,UTM zone 20S,9807,8801,0.0,9102,8802,-63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16121,UTM zone 21S,9807,8801,0.0,9102,8802,-57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16122,UTM zone 22S,9807,8801,0.0,9102,8802,-51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16123,UTM zone 23S,9807,8801,0.0,9102,8802,-45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16124,UTM zone 24S,9807,8801,0.0,9102,8802,-39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16125,UTM zone 25S,9807,8801,0.0,9102,8802,-33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16126,UTM zone 26S,9807,8801,0.0,9102,8802,-27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16127,UTM zone 27S,9807,8801,0.0,9102,8802,-21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16128,UTM zone 28S,9807,8801,0.0,9102,8802,-15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16129,UTM zone 29S,9807,8801,0.0,9102,8802,-9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16130,UTM zone 30S,9807,8801,0.0,9102,8802,-3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16131,UTM zone 31S,9807,8801,0.0,9102,8802,3.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16132,UTM zone 32S,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16133,UTM zone 33S,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16134,UTM zone 34S,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16135,UTM zone 35S,9807,8801,0.0,9102,8802,27.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16136,UTM zone 36S,9807,8801,0.0,9102,8802,33.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16137,UTM zone 37S,9807,8801,0.0,9102,8802,39.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16138,UTM zone 38S,9807,8801,0.0,9102,8802,45.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16139,UTM zone 39S,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16140,UTM zone 40S,9807,8801,0.0,9102,8802,57.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16141,UTM zone 41S,9807,8801,0.0,9102,8802,63.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16142,UTM zone 42S,9807,8801,0.0,9102,8802,69.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16143,UTM zone 43S,9807,8801,0.0,9102,8802,75.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16144,UTM zone 44S,9807,8801,0.0,9102,8802,81.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16145,UTM zone 45S,9807,8801,0.0,9102,8802,87.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16146,UTM zone 46S,9807,8801,0.0,9102,8802,93.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16147,UTM zone 47S,9807,8801,0.0,9102,8802,99.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16148,UTM zone 48S,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16149,UTM zone 49S,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16150,UTM zone 50S,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16151,UTM zone 51S,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16152,UTM zone 52S,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16153,UTM zone 53S,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16154,UTM zone 54S,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16155,UTM zone 55S,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16156,UTM zone 56S,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16157,UTM zone 57S,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16158,UTM zone 58S,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16159,UTM zone 59S,9807,8801,0.0,9102,8802,171.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16160,UTM zone 60S,9807,8801,0.0,9102,8802,177.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16161,Universal Polar Stereographic South,9810,8801,-90.0,9102,8802,0.0,9102,8805,0.994,9201,8806,2000000.0,9001,8807,2000000.0,9001,,,,,,
+16170,3-degree Gauss-Kruger CM 120E,9807,8801,0.0,9102,8802,120.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16171,3-degree Gauss-Kruger CM 123E,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16172,3-degree Gauss-Kruger CM 126E,9807,8801,0.0,9102,8802,126.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16173,3-degree Gauss-Kruger CM 129E,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16174,3-degree Gauss-Kruger CM 132E,9807,8801,0.0,9102,8802,132.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16175,3-degree Gauss-Kruger CM 135E,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16176,3-degree Gauss-Kruger CM 138E,9807,8801,0.0,9102,8802,138.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16177,3-degree Gauss-Kruger CM 141E,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16178,3-degree Gauss-Kruger CM 144E,9807,8801,0.0,9102,8802,144.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16179,3-degree Gauss-Kruger CM 147E,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16180,3-degree Gauss-Kruger CM 150E,9807,8801,0.0,9102,8802,150.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16181,3-degree Gauss-Kruger CM 153E,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16182,3-degree Gauss-Kruger CM 156E,9807,8801,0.0,9102,8802,156.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16183,3-degree Gauss-Kruger CM 159E,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16184,3-degree Gauss-Kruger CM 162E,9807,8801,0.0,9102,8802,162.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16185,3-degree Gauss-Kruger CM 165E,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16186,3-degree Gauss-Kruger CM 168E,9807,8801,0.0,9102,8802,168.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16187,3-degree Gauss-Kruger CM 171E,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16188,3-degree Gauss-Kruger CM 174E,9807,8801,0.0,9102,8802,174.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16189,3-degree Gauss-Kruger CM 177E,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16190,3-degree Gauss-Kruger CM 180,9807,8801,0.0,9102,8802,180.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16191,3-degree Gauss-Kruger CM 177W,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16192,3-degree Gauss-Kruger CM 174W,9807,8801,0.0,9102,8802,-174.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16193,3-degree Gauss-Kruger CM 171W,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16194,3-degree Gauss-Kruger CM 168W,9807,8801,0.0,9102,8802,-168.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16201,6-degree Gauss-Kruger zone 1,9807,8801,0.0,9102,8802,3.0,9102,8805,1.0,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+16202,6-degree Gauss-Kruger zone 2,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+16203,6-degree Gauss-Kruger zone 3,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+16204,6-degree Gauss-Kruger zone 4,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+16205,6-degree Gauss-Kruger zone 5,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+16206,6-degree Gauss-Kruger zone 6,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+16207,6-degree Gauss-Kruger zone 7,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+16208,6-degree Gauss-Kruger zone 8,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+16209,6-degree Gauss-Kruger zone 9,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,9500000.0,9001,8807,0.0,9001,,,,,,
+16210,6-degree Gauss-Kruger zone 10,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,10500000.0,9001,8807,0.0,9001,,,,,,
+16211,6-degree Gauss-Kruger zone 11,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,11500000.0,9001,8807,0.0,9001,,,,,,
+16212,6-degree Gauss-Kruger zone 12,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,12500000.0,9001,8807,0.0,9001,,,,,,
+16213,6-degree Gauss-Kruger zone 13,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,13500000.0,9001,8807,0.0,9001,,,,,,
+16214,6-degree Gauss-Kruger zone 14,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,14500000.0,9001,8807,0.0,9001,,,,,,
+16215,6-degree Gauss-Kruger zone 15,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,15500000.0,9001,8807,0.0,9001,,,,,,
+16216,6-degree Gauss-Kruger zone 16,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,16500000.0,9001,8807,0.0,9001,,,,,,
+16217,6-degree Gauss-Kruger zone 17,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,17500000.0,9001,8807,0.0,9001,,,,,,
+16218,6-degree Gauss-Kruger zone 18,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,18500000.0,9001,8807,0.0,9001,,,,,,
+16219,6-degree Gauss-Kruger zone 19,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,19500000.0,9001,8807,0.0,9001,,,,,,
+16220,6-degree Gauss-Kruger zone 20,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,20500000.0,9001,8807,0.0,9001,,,,,,
+16221,6-degree Gauss-Kruger zone 21,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,21500000.0,9001,8807,0.0,9001,,,,,,
+16222,6-degree Gauss-Kruger zone 22,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,22500000.0,9001,8807,0.0,9001,,,,,,
+16223,6-degree Gauss-Kruger zone 23,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,23500000.0,9001,8807,0.0,9001,,,,,,
+16224,6-degree Gauss-Kruger zone 24,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,24500000.0,9001,8807,0.0,9001,,,,,,
+16225,6-degree Gauss-Kruger zone 25,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,25500000.0,9001,8807,0.0,9001,,,,,,
+16226,6-degree Gauss-Kruger zone 26,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,26500000.0,9001,8807,0.0,9001,,,,,,
+16227,6-degree Gauss-Kruger zone 27,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,27500000.0,9001,8807,0.0,9001,,,,,,
+16228,6-degree Gauss-Kruger zone 28,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,28500000.0,9001,8807,0.0,9001,,,,,,
+16229,6-degree Gauss-Kruger zone 29,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,29500000.0,9001,8807,0.0,9001,,,,,,
+16230,6-degree Gauss-Kruger zone 30,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,30500000.0,9001,8807,0.0,9001,,,,,,
+16231,6-degree Gauss-Kruger zone 31,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,31500000.0,9001,8807,0.0,9001,,,,,,
+16232,6-degree Gauss-Kruger zone 32,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,32500000.0,9001,8807,0.0,9001,,,,,,
+16233,6-degree Gauss-Kruger zone 33,9807,8801,0.0,9102,8802,-165.0,9102,8805,1.0,9201,8806,33500000.0,9001,8807,0.0,9001,,,,,,
+16234,6-degree Gauss-Kruger zone 34,9807,8801,0.0,9102,8802,-159.0,9102,8805,1.0,9201,8806,34500000.0,9001,8807,0.0,9001,,,,,,
+16235,6-degree Gauss-Kruger zone 35,9807,8801,0.0,9102,8802,-153.0,9102,8805,1.0,9201,8806,35500000.0,9001,8807,0.0,9001,,,,,,
+16236,6-degree Gauss-Kruger zone 36,9807,8801,0.0,9102,8802,-147.0,9102,8805,1.0,9201,8806,36500000.0,9001,8807,0.0,9001,,,,,,
+16237,6-degree Gauss-Kruger zone 37,9807,8801,0.0,9102,8802,-141.0,9102,8805,1.0,9201,8806,37500000.0,9001,8807,0.0,9001,,,,,,
+16238,6-degree Gauss-Kruger zone 38,9807,8801,0.0,9102,8802,-135.0,9102,8805,1.0,9201,8806,38500000.0,9001,8807,0.0,9001,,,,,,
+16239,6-degree Gauss-Kruger zone 39,9807,8801,0.0,9102,8802,-129.0,9102,8805,1.0,9201,8806,39500000.0,9001,8807,0.0,9001,,,,,,
+16240,6-degree Gauss-Kruger zone 40,9807,8801,0.0,9102,8802,-123.0,9102,8805,1.0,9201,8806,40500000.0,9001,8807,0.0,9001,,,,,,
+16241,6-degree Gauss-Kruger zone 41,9807,8801,0.0,9102,8802,-117.0,9102,8805,1.0,9201,8806,41500000.0,9001,8807,0.0,9001,,,,,,
+16242,6-degree Gauss-Kruger zone 42,9807,8801,0.0,9102,8802,-111.0,9102,8805,1.0,9201,8806,42500000.0,9001,8807,0.0,9001,,,,,,
+16243,6-degree Gauss-Kruger zone 43,9807,8801,0.0,9102,8802,-105.0,9102,8805,1.0,9201,8806,43500000.0,9001,8807,0.0,9001,,,,,,
+16244,6-degree Gauss-Kruger zone 44,9807,8801,0.0,9102,8802,-99.0,9102,8805,1.0,9201,8806,44500000.0,9001,8807,0.0,9001,,,,,,
+16245,6-degree Gauss-Kruger zone 45,9807,8801,0.0,9102,8802,-93.0,9102,8805,1.0,9201,8806,45500000.0,9001,8807,0.0,9001,,,,,,
+16246,6-degree Gauss-Kruger zone 46,9807,8801,0.0,9102,8802,-87.0,9102,8805,1.0,9201,8806,46500000.0,9001,8807,0.0,9001,,,,,,
+16247,6-degree Gauss-Kruger zone 47,9807,8801,0.0,9102,8802,-81.0,9102,8805,1.0,9201,8806,47500000.0,9001,8807,0.0,9001,,,,,,
+16248,6-degree Gauss-Kruger zone 48,9807,8801,0.0,9102,8802,-75.0,9102,8805,1.0,9201,8806,48500000.0,9001,8807,0.0,9001,,,,,,
+16249,6-degree Gauss-Kruger zone 49,9807,8801,0.0,9102,8802,-69.0,9102,8805,1.0,9201,8806,49500000.0,9001,8807,0.0,9001,,,,,,
+16250,6-degree Gauss-Kruger zone 50,9807,8801,0.0,9102,8802,-63.0,9102,8805,1.0,9201,8806,50500000.0,9001,8807,0.0,9001,,,,,,
+16251,6-degree Gauss-Kruger zone 51,9807,8801,0.0,9102,8802,-57.0,9102,8805,1.0,9201,8806,51500000.0,9001,8807,0.0,9001,,,,,,
+16252,6-degree Gauss-Kruger zone 52,9807,8801,0.0,9102,8802,-51.0,9102,8805,1.0,9201,8806,52500000.0,9001,8807,0.0,9001,,,,,,
+16253,6-degree Gauss-Kruger zone 53,9807,8801,0.0,9102,8802,-45.0,9102,8805,1.0,9201,8806,53500000.0,9001,8807,0.0,9001,,,,,,
+16254,6-degree Gauss-Kruger zone 54,9807,8801,0.0,9102,8802,-39.0,9102,8805,1.0,9201,8806,54500000.0,9001,8807,0.0,9001,,,,,,
+16255,6-degree Gauss-Kruger zone 55,9807,8801,0.0,9102,8802,-33.0,9102,8805,1.0,9201,8806,55500000.0,9001,8807,0.0,9001,,,,,,
+16256,6-degree Gauss-Kruger zone 56,9807,8801,0.0,9102,8802,-27.0,9102,8805,1.0,9201,8806,56500000.0,9001,8807,0.0,9001,,,,,,
+16257,6-degree Gauss-Kruger zone 57,9807,8801,0.0,9102,8802,-21.0,9102,8805,1.0,9201,8806,57500000.0,9001,8807,0.0,9001,,,,,,
+16258,6-degree Gauss-Kruger zone 58,9807,8801,0.0,9102,8802,-15.0,9102,8805,1.0,9201,8806,58500000.0,9001,8807,0.0,9001,,,,,,
+16259,6-degree Gauss-Kruger zone 59,9807,8801,0.0,9102,8802,-9.0,9102,8805,1.0,9201,8806,59500000.0,9001,8807,0.0,9001,,,,,,
+16260,6-degree Gauss-Kruger zone 60,9807,8801,0.0,9102,8802,-3.0,9102,8805,1.0,9201,8806,60500000.0,9001,8807,0.0,9001,,,,,,
+16261,3-degree Gauss-Kruger zone 1,9807,8801,0.0,9102,8802,3.0,9102,8805,1.0,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+16262,3-degree Gauss-Kruger zone 2,9807,8801,0.0,9102,8802,6.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+16263,3-degree Gauss-Kruger zone 3,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+16264,3-degree Gauss-Kruger zone 4,9807,8801,0.0,9102,8802,12.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+16265,3-degree Gauss-Kruger zone 5,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+16266,3-degree Gauss-Kruger zone 6,9807,8801,0.0,9102,8802,18.0,9102,8805,1.0,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+16267,3-degree Gauss-Kruger zone 7,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+16268,3-degree Gauss-Kruger zone 8,9807,8801,0.0,9102,8802,24.0,9102,8805,1.0,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+16269,3-degree Gauss-Kruger zone 9,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,9500000.0,9001,8807,0.0,9001,,,,,,
+16270,3-degree Gauss-Kruger zone 10,9807,8801,0.0,9102,8802,30.0,9102,8805,1.0,9201,8806,10500000.0,9001,8807,0.0,9001,,,,,,
+16271,3-degree Gauss-Kruger zone 11,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,11500000.0,9001,8807,0.0,9001,,,,,,
+16272,3-degree Gauss-Kruger zone 12,9807,8801,0.0,9102,8802,36.0,9102,8805,1.0,9201,8806,12500000.0,9001,8807,0.0,9001,,,,,,
+16273,3-degree Gauss-Kruger zone 13,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,13500000.0,9001,8807,0.0,9001,,,,,,
+16274,3-degree Gauss-Kruger zone 14,9807,8801,0.0,9102,8802,42.0,9102,8805,1.0,9201,8806,14500000.0,9001,8807,0.0,9001,,,,,,
+16275,3-degree Gauss-Kruger zone 15,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,15500000.0,9001,8807,0.0,9001,,,,,,
+16276,3-degree Gauss-Kruger zone 16,9807,8801,0.0,9102,8802,48.0,9102,8805,1.0,9201,8806,16500000.0,9001,8807,0.0,9001,,,,,,
+16277,3-degree Gauss-Kruger zone 17,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,17500000.0,9001,8807,0.0,9001,,,,,,
+16278,3-degree Gauss-Kruger zone 18,9807,8801,0.0,9102,8802,54.0,9102,8805,1.0,9201,8806,18500000.0,9001,8807,0.0,9001,,,,,,
+16279,3-degree Gauss-Kruger zone 19,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,19500000.0,9001,8807,0.0,9001,,,,,,
+16280,3-degree Gauss-Kruger zone 20,9807,8801,0.0,9102,8802,60.0,9102,8805,1.0,9201,8806,20500000.0,9001,8807,0.0,9001,,,,,,
+16281,3-degree Gauss-Kruger zone 21,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,21500000.0,9001,8807,0.0,9001,,,,,,
+16282,3-degree Gauss-Kruger zone 22,9807,8801,0.0,9102,8802,66.0,9102,8805,1.0,9201,8806,22500000.0,9001,8807,0.0,9001,,,,,,
+16283,3-degree Gauss-Kruger zone 23,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,23500000.0,9001,8807,0.0,9001,,,,,,
+16284,3-degree Gauss-Kruger zone 24,9807,8801,0.0,9102,8802,72.0,9102,8805,1.0,9201,8806,24500000.0,9001,8807,0.0,9001,,,,,,
+16285,3-degree Gauss-Kruger zone 25,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,25500000.0,9001,8807,0.0,9001,,,,,,
+16286,3-degree Gauss-Kruger zone 26,9807,8801,0.0,9102,8802,78.0,9102,8805,1.0,9201,8806,26500000.0,9001,8807,0.0,9001,,,,,,
+16287,3-degree Gauss-Kruger zone 27,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,27500000.0,9001,8807,0.0,9001,,,,,,
+16288,3-degree Gauss-Kruger zone 28,9807,8801,0.0,9102,8802,84.0,9102,8805,1.0,9201,8806,28500000.0,9001,8807,0.0,9001,,,,,,
+16289,3-degree Gauss-Kruger zone 29,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,29500000.0,9001,8807,0.0,9001,,,,,,
+16290,3-degree Gauss-Kruger zone 30,9807,8801,0.0,9102,8802,90.0,9102,8805,1.0,9201,8806,30500000.0,9001,8807,0.0,9001,,,,,,
+16291,3-degree Gauss-Kruger zone 31,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,31500000.0,9001,8807,0.0,9001,,,,,,
+16292,3-degree Gauss-Kruger zone 32,9807,8801,0.0,9102,8802,96.0,9102,8805,1.0,9201,8806,32500000.0,9001,8807,0.0,9001,,,,,,
+16293,3-degree Gauss-Kruger zone 33,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,33500000.0,9001,8807,0.0,9001,,,,,,
+16294,3-degree Gauss-Kruger zone 34,9807,8801,0.0,9102,8802,102.0,9102,8805,1.0,9201,8806,34500000.0,9001,8807,0.0,9001,,,,,,
+16295,3-degree Gauss-Kruger zone 35,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,35500000.0,9001,8807,0.0,9001,,,,,,
+16296,3-degree Gauss-Kruger zone 36,9807,8801,0.0,9102,8802,108.0,9102,8805,1.0,9201,8806,36500000.0,9001,8807,0.0,9001,,,,,,
+16297,3-degree Gauss-Kruger zone 37,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,37500000.0,9001,8807,0.0,9001,,,,,,
+16298,3-degree Gauss-Kruger zone 38,9807,8801,0.0,9102,8802,114.0,9102,8805,1.0,9201,8806,38500000.0,9001,8807,0.0,9001,,,,,,
+16299,3-degree Gauss-Kruger zone 39,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,39500000.0,9001,8807,0.0,9001,,,,,,
+16301,6-degree Gauss-Kruger CM 3E,9807,8801,0.0,9102,8802,3.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16302,6-degree Gauss-Kruger CM 9E,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16303,6-degree Gauss-Kruger CM 15E,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16304,6-degree Gauss-Kruger CM 21E,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16305,6-degree Gauss-Kruger CM 27E,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16306,6-degree Gauss-Kruger CM 33E,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16307,6-degree Gauss-Kruger CM 39E,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16308,6-degree Gauss-Kruger CM 45E,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16309,6-degree Gauss-Kruger CM 51E,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16310,6-degree Gauss-Kruger CM 57E,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16311,6-degree Gauss-Kruger CM 63E,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16312,6-degree Gauss-Kruger CM 69E,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16313,6-degree Gauss-Kruger CM 75E,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16314,6-degree Gauss-Kruger CM 81E,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16315,6-degree Gauss-Kruger CM 87E,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16316,6-degree Gauss-Kruger CM 93E,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16317,6-degree Gauss-Kruger CM 99E,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16318,6-degree Gauss-Kruger CM 105E,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16319,6-degree Gauss-Kruger CM 111E,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16320,6-degree Gauss-Kruger CM 117E,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16321,6-degree Gauss-Kruger CM 123E,9807,8801,0.0,9102,8802,123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16322,6-degree Gauss-Kruger CM 129E,9807,8801,0.0,9102,8802,129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16323,6-degree Gauss-Kruger CM 135E,9807,8801,0.0,9102,8802,135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16324,6-degree Gauss-Kruger CM 141E,9807,8801,0.0,9102,8802,141.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16325,6-degree Gauss-Kruger CM 147E,9807,8801,0.0,9102,8802,147.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16326,6-degree Gauss-Kruger CM 153E,9807,8801,0.0,9102,8802,153.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16327,6-degree Gauss-Kruger CM 159E,9807,8801,0.0,9102,8802,159.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16328,6-degree Gauss-Kruger CM 165E,9807,8801,0.0,9102,8802,165.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16329,6-degree Gauss-Kruger CM 171E,9807,8801,0.0,9102,8802,171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16330,6-degree Gauss-Kruger CM 177E,9807,8801,0.0,9102,8802,177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16331,6-degree Gauss-Kruger CM 177W,9807,8801,0.0,9102,8802,-177.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16332,6-degree Gauss-Kruger CM 171W,9807,8801,0.0,9102,8802,-171.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16333,6-degree Gauss-Kruger CM 165W,9807,8801,0.0,9102,8802,-165.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16334,6-degree Gauss-Kruger CM 159W,9807,8801,0.0,9102,8802,-159.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16335,6-degree Gauss-Kruger CM 153W,9807,8801,0.0,9102,8802,-153.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16336,6-degree Gauss-Kruger CM 147W,9807,8801,0.0,9102,8802,-147.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16337,6-degree Gauss-Kruger CM 141W,9807,8801,0.0,9102,8802,-141.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16338,6-degree Gauss-Kruger CM 135W,9807,8801,0.0,9102,8802,-135.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16339,6-degree Gauss-Kruger CM 129W,9807,8801,0.0,9102,8802,-129.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16340,6-degree Gauss-Kruger CM 123W,9807,8801,0.0,9102,8802,-123.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16341,6-degree Gauss-Kruger CM 117W,9807,8801,0.0,9102,8802,-117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16342,6-degree Gauss-Kruger CM 111W,9807,8801,0.0,9102,8802,-111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16343,6-degree Gauss-Kruger CM 105W,9807,8801,0.0,9102,8802,-105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16344,6-degree Gauss-Kruger CM 99W,9807,8801,0.0,9102,8802,-99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16345,6-degree Gauss-Kruger CM 93W,9807,8801,0.0,9102,8802,-93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16346,6-degree Gauss-Kruger CM 87W,9807,8801,0.0,9102,8802,-87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16347,6-degree Gauss-Kruger CM 81W,9807,8801,0.0,9102,8802,-81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16348,6-degree Gauss-Kruger CM 75W,9807,8801,0.0,9102,8802,-75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16349,6-degree Gauss-Kruger CM 69W,9807,8801,0.0,9102,8802,-69.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16350,6-degree Gauss-Kruger CM 63W,9807,8801,0.0,9102,8802,-63.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16351,6-degree Gauss-Kruger CM 57W,9807,8801,0.0,9102,8802,-57.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16352,6-degree Gauss-Kruger CM 51W,9807,8801,0.0,9102,8802,-51.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16353,6-degree Gauss-Kruger CM 45W,9807,8801,0.0,9102,8802,-45.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16354,6-degree Gauss-Kruger CM 39W,9807,8801,0.0,9102,8802,-39.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16355,6-degree Gauss-Kruger CM 33W,9807,8801,0.0,9102,8802,-33.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16356,6-degree Gauss-Kruger CM 27W,9807,8801,0.0,9102,8802,-27.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16357,6-degree Gauss-Kruger CM 21W,9807,8801,0.0,9102,8802,-21.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16358,6-degree Gauss-Kruger CM 15W,9807,8801,0.0,9102,8802,-15.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16359,6-degree Gauss-Kruger CM 9W,9807,8801,0.0,9102,8802,-9.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16360,6-degree Gauss-Kruger CM 3W,9807,8801,0.0,9102,8802,-3.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16361,3-degree Gauss-Kruger CM 3E,9807,8801,0.0,9102,8802,3.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16362,3-degree Gauss-Kruger CM 6E,9807,8801,0.0,9102,8802,6.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16363,3-degree Gauss-Kruger CM 9E,9807,8801,0.0,9102,8802,9.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16364,3-degree Gauss-Kruger CM 12E,9807,8801,0.0,9102,8802,12.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16365,3-degree Gauss-Kruger CM 15E,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16366,3-degree Gauss-Kruger CM 18E,9807,8801,0.0,9102,8802,18.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16367,3-degree Gauss-Kruger CM 21E,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16368,3-degree Gauss-Kruger CM 24E,9807,8801,0.0,9102,8802,24.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16369,3-degree Gauss-Kruger CM 27E,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16370,3-degree Gauss-Kruger CM 30E,9807,8801,0.0,9102,8802,30.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16371,3-degree Gauss-Kruger CM 33E,9807,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16372,3-degree Gauss-Kruger CM 36E,9807,8801,0.0,9102,8802,36.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16373,3-degree Gauss-Kruger CM 39E,9807,8801,0.0,9102,8802,39.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16374,3-degree Gauss-Kruger CM 42E,9807,8801,0.0,9102,8802,42.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16375,3-degree Gauss-Kruger CM 45E,9807,8801,0.0,9102,8802,45.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16376,3-degree Gauss-Kruger CM 48E,9807,8801,0.0,9102,8802,48.0,9102,8805,1.0,9001,8806,500000.0,9001,8807,0.0,9201,,,,,,
+16377,3-degree Gauss-Kruger CM 51E,9807,8801,0.0,9102,8802,51.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16378,3-degree Gauss-Kruger CM 54E,9807,8801,0.0,9102,8802,54.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16379,3-degree Gauss-Kruger CM 57E,9807,8801,0.0,9102,8802,57.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16380,3-degree Gauss-Kruger CM 60E,9807,8801,0.0,9102,8802,60.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16381,3-degree Gauss-Kruger CM 63E,9807,8801,0.0,9102,8802,63.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16382,3-degree Gauss-Kruger CM 66E,9807,8801,0.0,9102,8802,66.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16383,3-degree Gauss-Kruger CM 69E,9807,8801,0.0,9102,8802,69.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16384,3-degree Gauss-Kruger CM 72E,9807,8801,0.0,9102,8802,72.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16385,3-degree Gauss-Kruger CM 75E,9807,8801,0.0,9102,8802,75.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16386,3-degree Gauss-Kruger CM 78E,9807,8801,0.0,9102,8802,78.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16387,3-degree Gauss-Kruger CM 81E,9807,8801,0.0,9102,8802,81.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16388,3-degree Gauss-Kruger CM 84E,9807,8801,0.0,9102,8802,84.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16389,3-degree Gauss-Kruger CM 87E,9807,8801,0.0,9102,8802,87.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16390,3-degree Gauss-Kruger CM 90E,9807,8801,0.0,9102,8802,90.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16391,3-degree Gauss-Kruger CM 93E,9807,8801,0.0,9102,8802,93.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16392,3-degree Gauss-Kruger CM 96E,9807,8801,0.0,9102,8802,96.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16393,3-degree Gauss-Kruger CM 99E,9807,8801,0.0,9102,8802,99.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16394,3-degree Gauss-Kruger CM 102E,9807,8801,0.0,9102,8802,102.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16395,3-degree Gauss-Kruger CM 105E,9807,8801,0.0,9102,8802,105.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16396,3-degree Gauss-Kruger CM 108E,9807,8801,0.0,9102,8802,108.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16397,3-degree Gauss-Kruger CM 111E,9807,8801,0.0,9102,8802,111.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16398,3-degree Gauss-Kruger CM 114E,9807,8801,0.0,9102,8802,114.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16399,3-degree Gauss-Kruger CM 117E,9807,8801,0.0,9102,8802,117.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16400,TM 0 N,9807,8801,0.0,9102,8802,0.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16405,TM 5 NE,9807,8801,0.0,9102,8802,5.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16406,TM 6 NE,9807,8801,0.0,9102,8802,6.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16411,TM 11 NE,9807,8801,0.0,9102,8802,11.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16412,TM 12 NE,9807,8801,0.0,9102,8802,12.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16413,TM 13 NE,9807,8801,0.0,9102,8802,13.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16430,TM 30 NE,9807,8801,0.0,9102,8802,30.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16506,TM 106 NE,9807,8801,0.0,9102,8802,106.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16586,GK 106 NE,9807,8801,0.0,9102,8802,106.0,9102,8805,1.0,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+16611,TM 11.30 SE,9807,8801,0.0,9110,8802,11.3,9110,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16612,TM 12 SE,9807,8801,0.0,9102,8802,12.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16636,TM 36 SE,9807,8801,0.0,9102,8802,36.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16709,TM 109 SE,9807,8801,0.0,9102,8802,109.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16716,TM 116 SE,9807,8801,0.0,9102,8802,116.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+16732,TM 132 SE,9807,8801,0.0,9102,8802,132.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17001,TM 1 NW,9807,8801,0.0,9102,8802,-1.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+17005,TM 5 NW,9807,8801,0.0,9102,8802,-5.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+17054,TM 54 NW,9807,8801,0.0,9102,8802,-54.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+17348,Map Grid of Australia zone 48,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17349,Map Grid of Australia zone 49,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17350,Map Grid of Australia zone 50,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17351,Map Grid of Australia zone 51,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17352,Map Grid of Australia zone 52,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17353,Map Grid of Australia zone 53,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17354,Map Grid of Australia zone 54,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17355,Map Grid of Australia zone 55,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17356,Map Grid of Australia zone 56,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17357,Map Grid of Australia zone 57,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17358,Map Grid of Australia zone 58,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17448,Australian Map Grid zone 48,9807,8801,0.0,9102,8802,105.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17449,Australian Map Grid zone 49,9807,8801,0.0,9102,8802,111.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17450,Australian Map Grid zone 50,9807,8801,0.0,9102,8802,117.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17451,Australian Map Grid zone 51,9807,8801,0.0,9102,8802,123.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17452,Australian Map Grid zone 52,9807,8801,0.0,9102,8802,129.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17453,Australian Map Grid zone 53,9807,8801,0.0,9102,8802,135.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17454,Australian Map Grid zone 54,9807,8801,0.0,9102,8802,141.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17455,Australian Map Grid zone 55,9807,8801,0.0,9102,8802,147.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17456,Australian Map Grid zone 56,9807,8801,0.0,9102,8802,153.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17457,Australian Map Grid zone 57,9807,8801,0.0,9102,8802,159.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17458,Australian Map Grid zone 58,9807,8801,0.0,9102,8802,165.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,10000000.0,9001,,,,,,
+17515,South African Survey Grid zone 15,9808,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17517,South African Survey Grid zone 17,9808,8801,0.0,9102,8802,17.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17519,South African Survey Grid zone 19,9808,8801,0.0,9102,8802,19.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17521,South African Survey Grid zone 21,9808,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17523,South African Survey Grid zone 23,9808,8801,0.0,9102,8802,23.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17525,South African Survey Grid zone 25,9808,8801,0.0,9102,8802,25.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17527,South African Survey Grid zone 27,9808,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17529,South African Survey Grid zone 29,9808,8801,0.0,9102,8802,29.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17531,South African Survey Grid zone 31,9808,8801,0.0,9102,8802,31.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17533,South African Survey Grid zone 33,9808,8801,0.0,9102,8802,33.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17611,South West African Survey Grid zone 11,9808,8801,-22.0,9102,8802,11.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+17613,South West African Survey Grid zone 13,9808,8801,-22.0,9102,8802,13.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+17615,South West African Survey Grid zone 15,9808,8801,-22.0,9102,8802,15.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+17617,South West African Survey Grid zone 17,9808,8801,-22.0,9102,8802,17.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+17619,South West African Survey Grid zone 19,9808,8801,-22.0,9102,8802,19.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+17621,South West African Survey Grid zone 21,9808,8801,-22.0,9102,8802,21.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+17623,South West African Survey Grid zone 23,9808,8801,-22.0,9102,8802,23.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+17625,South West African Survey Grid zone 25,9808,8801,-22.0,9102,8802,25.0,9102,8805,1.0,9201,8806,0.0,9031,8807,0.0,9031,,,,,,
+17700,MTM Quebec zone 2,9807,8801,0.0,9110,8802,-55.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17701,MTM zone 1,9807,8801,0.0,9102,8802,-53.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17702,MTM Newfoundland zone 2,9807,8801,0.0,9102,8802,-56.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17703,MTM zone 3,9807,8801,0.0,9110,8802,-58.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17704,MTM zone 4,9807,8801,0.0,9110,8802,-61.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17705,MTM zone 5,9807,8801,0.0,9110,8802,-64.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17706,MTM zone 6,9807,8801,0.0,9110,8802,-67.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17707,MTM zone 7,9807,8801,0.0,9110,8802,-70.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17708,MTM zone 8,9807,8801,0.0,9110,8802,-73.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17709,MTM zone 9,9807,8801,0.0,9110,8802,-76.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17710,MTM zone 10,9807,8801,0.0,9110,8802,-79.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17711,MTM zone 11,9807,8801,0.0,9110,8802,-82.3,9110,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17712,MTM zone 12,9807,8801,0.0,9102,8802,-81.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17713,MTM zone 13,9807,8801,0.0,9102,8802,-84.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17714,MTM zone 14,9807,8801,0.0,9102,8802,-87.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17715,MTM zone 15,9807,8801,0.0,9102,8802,-90.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17716,MTM zone 16,9807,8801,0.0,9102,8802,-93.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17717,MTM zone 17,9807,8801,0.0,9102,8802,-96.0,9102,8805,0.9999,9201,8806,304800.0,9001,8807,0.0,9001,,,,,,
+17794,MTM Nova Scotia zone 4,9807,8801,0.0,9110,8802,-61.3,9110,8805,0.9999,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+17795,MTM Nova Scotia zone 5,9807,8801,0.0,9110,8802,-64.3,9110,8805,0.9999,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+17801,Japan Plane Rectangular CS zone I,9807,8801,33.0,9110,8802,129.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17802,Japan Plane Rectangular CS zone II,9807,8801,33.0,9110,8802,131.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17803,Japan Plane Rectangular CS zone III,9807,8801,36.0,9110,8802,132.1,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17804,Japan Plane Rectangular CS zone IV,9807,8801,33.0,9110,8802,133.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17805,Japan Plane Rectangular CS zone V,9807,8801,36.0,9110,8802,134.2,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17806,Japan Plane Rectangular CS zone VI,9807,8801,36.0,9110,8802,136.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17807,Japan Plane Rectangular CS zone VII,9807,8801,36.0,9110,8802,137.1,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17808,Japan Plane Rectangular CS zone VIII,9807,8801,36.0,9110,8802,138.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17809,Japan Plane Rectangular CS zone IX,9807,8801,36.0,9110,8802,139.5,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17810,Japan Plane Rectangular CS zone X,9807,8801,40.0,9110,8802,140.5,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17811,Japan Plane Rectangular CS zone XI,9807,8801,44.0,9110,8802,140.15,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17812,Japan Plane Rectangular CS zone XII,9807,8801,44.0,9110,8802,142.15,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17813,Japan Plane Rectangular CS zone XIII,9807,8801,44.0,9110,8802,144.15,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17814,Japan Plane Rectangular CS zone XIV,9807,8801,26.0,9110,8802,142.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17815,Japan Plane Rectangular CS zone XV,9807,8801,26.0,9110,8802,127.3,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17816,Japan Plane Rectangular CS zone XVI,9807,8801,26.0,9110,8802,124.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17817,Japan Plane Rectangular CS zone XVII,9807,8801,26.0,9110,8802,131.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17818,Japan Plane Rectangular CS zone XVIII,9807,8801,20.0,9110,8802,136.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17819,Japan Plane Rectangular CS zone XIX,9807,8801,26.0,9110,8802,154.0,9110,8805,0.9999,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+17901,Mount Eden Circuit,9807,8801,-36.5247515,9110,8802,174.45516217,9110,8805,0.9999,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17902,Bay of Plenty Circuit,9807,8801,-37.45404993,9110,8802,176.27583101,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17903,Poverty Bay Circuit,9807,8801,-38.372893,9110,8802,177.53082906,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17904,Hawkes Bay Circuit,9807,8801,-39.39033455,9110,8802,176.40252499,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17905,Taranaki Circuit,9807,8801,-39.08087299,9110,8802,174.13408423,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17906,Tuhirangi Circuit,9807,8801,-39.30448934,9110,8802,175.38241325,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17907,Wanganui Circuit,9807,8801,-40.14310097,9110,8802,175.29171586,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17908,Wairarapa Circuit,9807,8801,-40.55319175,9110,8802,175.38504588,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17909,Wellington Circuit,9807,8801,-41.18047507,9110,8802,174.46358432,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17910,Collingwood Circuit,9807,8801,-40.42531326,9110,8802,172.40193674,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17911,Nelson Circuit,9807,8801,-41.1628361,9110,8802,173.17575405,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17912,Karamea Circuit,9807,8801,-41.17236815,9110,8802,172.06325015,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17913,Buller Circuit,9807,8801,-41.48388903,9110,8802,171.34525362,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17914,Grey Circuit,9807,8801,-42.20012994,9110,8802,171.32591767,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17915,Amuri Circuit,9807,8801,-42.41208197,9110,8802,173.00364802,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17916,Marlborough Circuit,9807,8801,-41.3240152,9110,8802,173.48074668,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17917,Hokitika Circuit,9807,8801,-42.53107605,9110,8802,170.58479766,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17918,Okarito Circuit,9807,8801,-43.06364613,9110,8802,170.1539333,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17919,Jacksons Bay Circuit,9807,8801,-43.58400904,9110,8802,168.36225612,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17920,Mount Pleasant Circuit,9807,8801,-43.35262953,9110,8802,172.43378969,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17921,Gawler Circuit,9807,8801,-43.44553616,9110,8802,171.21386945,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17922,Timaru Circuit,9807,8801,-44.24079933,9110,8802,171.0326103,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17923,Lindis Peak Circuit,9807,8801,-44.44069647,9110,8802,169.28039183,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17924,Mount Nicholas Circuit,9807,8801,-45.07584493,9110,8802,168.23551083,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17925,Mount York Circuit,9807,8801,-45.33494142,9110,8802,167.44199024,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17926,Observation Point Circuit,9807,8801,-45.48583078,9110,8802,170.37429426,9110,8805,1.0,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17927,North Taieri Circuit,9807,8801,-45.51414481,9110,8802,170.16573208,9110,8805,0.99996,9201,8806,300000.0,9001,8807,700000.0,9001,,,,,,
+17928,Bluff Circuit,9807,8801,-46.36000346,9110,8802,168.20343392,9110,8805,1.0,9201,8806,300002.66,9001,8807,699999.58,9001,,,,,,
+17931,Mount Eden Circuit 2000,9807,8801,-36.5247,9110,8802,174.4551,9110,8805,0.9999,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17932,Bay of Plenty Circuit 2000,9807,8801,-37.454,9110,8802,176.2758,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17933,Poverty Bay Circuit 2000,9807,8801,-38.3728,9110,8802,177.5308,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17934,Hawkes Bay Circuit 2000,9807,8801,-39.3903,9110,8802,176.4025,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17935,Taranaki Circuit 2000,9807,8801,-39.0808,9110,8802,174.134,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17936,Tuhirangi Circuit 2000,9807,8801,-39.3044,9110,8802,175.3824,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17937,Wanganui Circuit 2000,9807,8801,-40.1431,9110,8802,175.2917,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17938,Wairarapa Circuit 2000,9807,8801,-40.5531,9110,8802,175.385,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17939,Wellington Circuit 2000,9807,8801,-41.1804,9110,8802,174.4635,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17940,Collingwood Circuit 2000,9807,8801,-40.4253,9110,8802,172.4019,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17941,Nelson Circuit 2000,9807,8801,-41.1628,9110,8802,173.1757,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17942,Karamea Circuit 2000,9807,8801,-41.1723,9110,8802,172.0632,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17943,Buller Circuit 2000,9807,8801,-41.4838,9110,8802,171.3452,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17944,Grey Circuit 2000,9807,8801,-42.2001,9110,8802,171.3259,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17945,Amuri Circuit 2000,9807,8801,-42.412,9110,8802,173.0036,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17946,Marlborough Circuit 2000,9807,8801,-41.324,9110,8802,173.4807,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17947,Hokitika Circuit 2000,9807,8801,-42.531,9110,8802,170.5847,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17948,Okarito Circuit 2000,9807,8801,-43.0636,9110,8802,170.1539,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17949,Jacksons Bay Circuit 2000,9807,8801,-43.584,9110,8802,168.3622,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17950,Mount Pleasant Circuit 2000,9807,8801,-43.3526,9110,8802,172.4337,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17951,Gawler Circuit 2000,9807,8801,-43.4455,9110,8802,171.2138,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17952,Timaru Circuit 2000,9807,8801,-44.2407,9110,8802,171.0326,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17953,Lindis Peak Circuit 2000,9807,8801,-44.4406,9110,8802,169.2803,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17954,Mount Nicholas Circuit 2000,9807,8801,-45.0758,9110,8802,168.2355,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17955,Mount York Circuit 2000,9807,8801,-45.3349,9110,8802,167.4419,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17956,Observation Point Circuit 2000,9807,8801,-45.4858,9110,8802,170.3742,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17957,North Taieri Circuit 2000,9807,8801,-45.5141,9110,8802,170.1657,9110,8805,0.99996,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+17958,Bluff Circuit 2000,9807,8801,-46.36,9110,8802,168.2034,9110,8805,1.0,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+18011,"Nord Algerie (ancienne)",9801,8801,40.0,9105,8802,3.0,9105,8805,0.999625544,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+18012,"Sud Algerie (ancienne)",9801,8801,37.0,9105,8802,3.0,9105,8805,0.999625769,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+18021,Nord Algerie,9801,8801,40.0,9105,8802,3.0,9105,8805,0.999625544,9201,8806,500135.0,9001,8807,300090.0,9001,,,,,,
+18022,Sud Algerie,9801,8801,37.0,9105,8802,3.0,9105,8805,0.999625769,9201,8806,500135.0,9001,8807,300090.0,9001,,,,,,
+18031,Argentina zone 1,9807,8801,-90.0,9102,8802,-72.0,9102,8805,1.0,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+18032,Argentina zone 2,9807,8801,-90.0,9102,8802,-69.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+18033,Argentina zone 3,9807,8801,-90.0,9102,8802,-66.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+18034,Argentina zone 4,9807,8801,-90.0,9102,8802,-63.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+18035,Argentina zone 5,9807,8801,-90.0,9102,8802,-60.0,9102,8805,1.0,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+18036,Argentina zone 6,9807,8801,-90.0,9102,8802,-57.0,9102,8805,1.0,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+18037,Argentina zone 7,9807,8801,-90.0,9102,8802,-54.0,9102,8805,1.0,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+18041,Austria West Zone,9807,8801,0.0,9102,8802,28.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18042,Austria Central Zone,9807,8801,0.0,9102,8802,31.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18043,Austria East Zone,9807,8801,0.0,9102,8802,34.0,9102,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18044,Austria M28,9807,8801,0.0,9110,8802,10.2,9110,8805,1.0,9201,8806,150000.0,9001,8807,0.0,9001,,,,,,
+18045,Austria M31,9807,8801,0.0,9110,8802,13.2,9110,8805,1.0,9201,8806,450000.0,9001,8807,0.0,9001,,,,,,
+18046,Austria M34,9807,8801,0.0,9110,8802,16.2,9110,8805,1.0,9201,8806,750000.0,9001,8807,0.0,9001,,,,,,
+18051,Colombia West zone,9807,8801,4.355657,9110,8802,-77.04513,9110,8805,1.0,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18052,Colombia Bogota zone,9807,8801,4.355657,9110,8802,-74.04513,9110,8805,1.0,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18053,Colombia East Central zone,9807,8801,4.355657,9110,8802,-71.04513,9110,8805,1.0,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18054,Colombia East zone,9807,8801,4.355657,9110,8802,-68.04513,9110,8805,1.0,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18061,Cuba Norte,9801,8801,22.21,9110,8802,-81.0,9110,8805,0.99993602,9201,8806,500000.0,9001,8807,280296.016,9001,,,,,,
+18062,Cuba Sur,9801,8801,20.43,9110,8802,-76.5,9110,8805,0.99994848,9201,8806,500000.0,9001,8807,229126.939,9001,,,,,,
+18071,Egypt Blue Belt,9807,8801,30.0,9102,8802,35.0,9102,8805,1.0,9201,8806,300000.0,9001,8807,1100000.0,9001,,,,,,
+18072,Egypt Red Belt,9807,8801,30.0,9102,8802,31.0,9102,8805,1.0,9201,8806,615000.0,9001,8807,810000.0,9001,,,,,,
+18073,Egypt Purple Belt,9807,8801,30.0,9102,8802,27.0,9102,8805,1.0,9201,8806,700000.0,9001,8807,200000.0,9001,,,,,,
+18074,Egypt Extended Purple Belt,9807,8801,30.0,9102,8802,27.0,9102,8805,1.0,9201,8806,700000.0,9001,8807,1200000.0,9001,,,,,,
+18081,Lambert zone I,9801,8801,55.0,9105,8802,0.0,9105,8805,0.999877341,9201,8806,600000.0,9001,8807,1200000.0,9001,,,,,,
+18082,Lambert zone II,9801,8801,52.0,9105,8802,0.0,9105,8805,0.99987742,9201,8806,600000.0,9001,8807,2200000.0,9001,,,,,,
+18083,Lambert zone III,9801,8801,49.0,9105,8802,0.0,9105,8805,0.999877499,9201,8806,600000.0,9001,8807,3200000.0,9001,,,,,,
+18084,Lambert zone IV,9801,8801,46.85,9105,8802,0.0,9105,8805,0.99994471,9201,8806,234.358,9001,8807,4185861.369,9001,,,,,,
+18085,Lambert-93,9802,8821,46.3,9110,8822,3.0,9110,8823,49.0,9110,8824,44.0,9110,8826,700000.0,9001,8827,6600000.0,9001,,,
+18086,France EuroLambert,9801,8801,46.48,9110,8802,2.2014025,9110,8805,0.99987742,9201,8806,600000.0,9001,8807,2200000.0,9001,,,,,,
+18091,Lambert Nord France,9801,8801,55.0,9105,8802,0.0,9105,8805,0.999877341,9201,8806,600000.0,9001,8807,200000.0,9001,,,,,,
+18092,Lambert Centre France,9801,8801,52.0,9105,8802,0.0,9105,8805,0.99987742,9201,8806,600000.0,9001,8807,200000.0,9001,,,,,,
+18093,Lambert Sud France,9801,8801,49.0,9105,8802,0.0,9105,8805,0.999877499,9201,8806,600000.0,9001,8807,200000.0,9001,,,,,,
+18094,Lambert Corse,9801,8801,46.85,9105,8802,0.0,9105,8805,0.99994471,9201,8806,234.358,9001,8807,185861.369,9001,,,,,,
+18110,India zone 0,9801,8801,39.3,9110,8802,68.0,9110,8805,0.99846154,9201,8806,2355500.0,9084,8807,2590000.0,9084,,,,,,
+18111,India zone I,9801,8801,32.3,9110,8802,68.0,9110,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+18112,India zone IIa,9801,8801,26.0,9102,8802,74.0,9102,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+18113,India zone IIb,9801,8801,26.0,9102,8802,90.0,9102,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+18114,India zone IIIa,9801,8801,19.0,9102,8802,80.0,9102,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+18115,India zone IIIb,9801,8801,19.0,9102,8802,100.0,9102,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+18116,India zone IVa,9801,8801,12.0,9102,8802,80.0,9102,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+18117,India zone IVb,9801,8801,12.0,9102,8802,100.0,9102,8805,0.99878641,9201,8806,3000000.0,9084,8807,1000000.0,9084,,,,,,
+18121,Italy zone 1,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9996,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+18122,Italy zone 2,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9996,9201,8806,2520000.0,9001,8807,0.0,9001,,,,,,
+18131,Nord Maroc,9801,8801,37.0,9105,8802,-6.0,9105,8805,0.999625769,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+18132,Sud Maroc,9801,8801,33.0,9105,8802,-6.0,9105,8805,0.999615596,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+18133,Sahara,9801,8801,29.0,9105,8802,-6.0,9105,8805,0.9996,9201,8806,1200000.0,9001,8807,400000.0,9001,,,,,,
+18141,New Zealand North Island National Grid,9807,8801,-39.0,9110,8802,175.3,9110,8805,1.0,9201,8806,300000.0,9040,8807,400000.0,9040,,,,,,
+18142,New Zealand South Island National Grid,9807,8801,-44.0,9110,8802,171.3,9110,8805,1.0,9201,8806,500000.0,9040,8807,500000.0,9040,,,,,,
+18151,Nigeria West Belt,9807,8801,4.0,9110,8802,4.3,9110,8805,0.99975,9201,8806,230738.26,9001,8807,0.0,9001,,,,,,
+18152,Nigeria Mid Belt,9807,8801,4.0,9110,8802,8.3,9110,8805,0.99975,9201,8806,670553.98,9001,8807,0.0,9001,,,,,,
+18153,Nigeria East Belt,9807,8801,4.0,9110,8802,12.3,9110,8805,0.99975,9201,8806,1110369.7,9001,8807,0.0,9001,,,,,,
+18161,Peru west zone,9807,8801,-6.0,9110,8802,-80.3,9110,8805,0.99983008,9201,8806,222000.0,9001,8807,1426834.743,9001,,,,,,
+18162,Peru central zone,9807,8801,-9.3,9110,8802,-76.0,9110,8805,0.99932994,9201,8806,720000.0,9001,8807,1039979.159,9001,,,,,,
+18163,Peru east zone,9807,8801,-9.3,9110,8802,-70.3,9110,8805,0.99952992,9201,8806,1324000.0,9001,8807,1040084.558,9001,,,,,,
+18171,Philippines zone I,9807,8801,0.0,9102,8802,117.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+18172,Philippines zone II,9807,8801,0.0,9102,8802,119.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+18173,Philippines zone III,9807,8801,0.0,9102,8802,121.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+18174,Philippines zone IV,9807,8801,0.0,9102,8802,123.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+18175,Philippines zone V,9807,8801,0.0,9102,8802,125.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+18181,Nord Tunisie,9801,8801,40.0,9105,8802,11.0,9105,8805,0.999625544,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+18182,Sud Tunisie,9801,8801,37.0,9105,8802,11.0,9105,8805,0.999625769,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+18191,Finland zone 1,9807,8801,0.0,9102,8802,21.0,9102,8805,1.0,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+18192,Finland zone 2,9807,8801,0.0,9102,8802,24.0,9102,8805,1.0,9201,8806,2500000.0,9001,8807,0.0,9001,,,,,,
+18193,Finland Uniform Coordinate System,9807,8801,0.0,9102,8802,27.0,9102,8805,1.0,9201,8806,3500000.0,9001,8807,0.0,9001,,,,,,
+18194,Finland zone 4,9807,8801,0.0,9102,8802,30.0,9102,8805,1.0,9201,8806,4500000.0,9001,8807,0.0,9001,,,,,,
+18201,Palestine Grid,9806,8801,31.4402749,9110,8802,35.124349,9110,8806,170251.555,9001,8807,126867.909,9001,,,,,,,,,
+18202,Palestine Belt,9807,8801,31.4402749,9110,8802,35.124349,9110,8805,1.0,9201,8806,170251.555,9001,8807,1126867.909,9001,,,,,,
+18203,Israeli CS,9806,8801,31.4402749,9110,8802,35.124349,9110,8806,170251.555,9001,8807,1126867.909,9001,,,,,,,,,
+18204,Israeli TM,9807,8801,31.4403817,9110,8802,35.1216261,9110,8805,1.0000067,9201,8806,219529.584,9001,8807,626907.39,9001,,,,,,
+18211,Guatemala Norte,9801,8801,16.49,9110,8802,-90.2,9110,8805,0.99992226,9201,8806,500000.0,9001,8807,292209.579,9001,,,,,,
+18212,Guatemala Sur,9801,8801,14.54,9110,8802,-90.2,9110,8805,0.99989906,9201,8806,500000.0,9001,8807,325992.681,9001,,,,,,
+18221,NGO zone I,9807,8801,58.0,9110,8802,-4.4,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18222,NGO zone II,9807,8801,58.0,9110,8802,-2.2,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18223,NGO zone III,9807,8801,58.0,9110,8802,0.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18224,NGO zone IV,9807,8801,58.0,9110,8802,2.3,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18225,NGO zone V,9807,8801,58.0,9110,8802,6.1,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18226,NGO zone VI,9807,8801,58.0,9110,8802,10.1,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18227,NGO zone VII,9807,8801,58.0,9110,8802,14.1,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18228,NGO zone VIII,9807,8801,58.0,9110,8802,18.2,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18231,"India zone I (1975 metres)",9801,8801,32.3,9110,8802,68.0,9110,8805,0.99878641,9201,8806,2743195.5,9001,8807,914398.5,9001,,,,,,
+18232,"India zone IIa (1975 metres)",9801,8801,26.0,9102,8802,74.0,9102,8805,0.99878641,9201,8806,2743195.5,9001,8807,914398.5,9001,,,,,,
+18233,"India zone IIIa (1975 metres)",9801,8801,19.0,9102,8802,80.0,9102,8805,0.99878641,9201,8806,2743195.5,9001,8807,914398.5,9001,,,,,,
+18234,"India zone IVa (1975 metres)",9801,8801,12.0,9102,8802,80.0,9102,8805,0.99878641,9201,8806,2743195.5,9001,8807,914398.5,9001,,,,,,
+18235,"India zone IIb (1975 metres)",9801,8801,26.0,9102,8802,90.0,9102,8805,0.99878641,9201,8806,2743195.5,9001,8807,914398.5,9001,,,,,,
+18236,"India zone I (1962 metres)",9801,8801,32.3,9110,8802,68.0,9110,8805,0.99878641,9201,8806,2743196.4,9001,8807,914398.8,9001,,,,,,
+18237,"India zone IIa (1962 metres)",9801,8801,26.0,9102,8802,74.0,9102,8805,0.99878641,9201,8806,2743196.4,9001,8807,914398.8,9001,,,,,,
+18238,"India zone IIb (1937 metres)",9801,8801,26.0,9102,8802,90.0,9102,8805,0.99878641,9201,8806,2743185.69,9001,8807,914395.23,9001,,,,,,
+18240,Libya zone 5,9807,8801,0.0,9102,8802,9.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+18241,Libya zone 6,9807,8801,0.0,9102,8802,11.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+18242,Libya zone 7,9807,8801,0.0,9102,8802,13.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+18243,Libya zone 8,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+18244,Libya zone 9,9807,8801,0.0,9102,8802,17.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+18245,Libya zone 10,9807,8801,0.0,9102,8802,19.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+18246,Libya zone 11,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+18247,Libya zone 12,9807,8801,0.0,9102,8802,23.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+18248,Libya zone 13,9807,8801,0.0,9102,8802,25.0,9102,8805,0.9999,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+18251,Korea East Belt,9807,8801,38.0,9102,8802,129.0,9102,8805,1.0,9201,8806,200000.0,9001,8807,500000.0,9001,,,,,,
+18252,Korea Central Belt,9807,8801,38.0,9102,8802,127.0,9102,8805,1.0,9201,8806,200000.0,9001,8807,500000.0,9001,,,,,,
+18253,Korea West Belt,9807,8801,38.0,9102,8802,125.0,9102,8805,1.0,9201,8806,200000.0,9001,8807,500000.0,9001,,,,,,
+18260,"Maracaibo Grid (M1)",9801,8801,10.1,9110,8802,-71.3620224,9110,8805,1.0,9201,8806,0.0,9001,8807,-52684.972,9001,,,,,,
+18261,Maracaibo Grid,9801,8801,10.1,9110,8802,-71.3620224,9110,8805,1.0,9201,8806,200000.0,9001,8807,147315.028,9001,,,,,,
+18262,"Maracaibo Grid (M3)",9801,8801,10.1,9110,8802,-71.3620224,9110,8805,1.0,9201,8806,500000.0,9001,8807,447315.028,9001,,,,,,
+18263,Maracaibo La Rosa Grid,9801,8801,10.1,9110,8802,-71.3620224,9110,8805,1.0,9201,8806,-17044.0,9001,8807,-23139.97,9001,,,,,,
+18275,Balkans zone 5,9807,8801,0.0,9102,8802,15.0,9102,8805,0.9999,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+18276,Balkans zone 6,9807,8801,0.0,9102,8802,18.0,9102,8805,0.9999,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+18277,Balkans zone 7,9807,8801,0.0,9102,8802,21.0,9102,8805,0.9999,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+18278,Balkans zone 8,9807,8801,0.0,9102,8802,24.0,9102,8805,0.9999,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+18281,Poland zone I,9809,8801,50.373,9110,8802,21.05,9110,8805,0.9998,9201,8806,4637000.0,9001,8807,5647000.0,9001,,,,,,
+18282,Poland zone II,9809,8801,53.0007,9110,8802,21.301,9110,8805,0.9998,9201,8806,4603000.0,9001,8807,5806000.0,9001,,,,,,
+18283,Poland zone III,9809,8801,53.35,9110,8802,17.003,9110,8805,0.9998,9201,8806,3501000.0,9001,8807,5999000.0,9001,,,,,,
+18284,Poland zone IV,9809,8801,51.4015,9110,8802,16.402,9110,8805,0.9998,9201,8806,3703000.0,9001,8807,5627000.0,9001,,,,,,
+18285,Poland zone V,9807,8801,0.0,9110,8802,18.573,9110,8805,0.999983,9201,8806,237000.0,9001,8807,-4700000.0,9001,,,,,,
+18300,Poland CS92,9807,8801,0.0,9102,8802,19.0,9102,8805,0.9993,9201,8806,500000.0,9001,8807,-5300000.0,9001,,,,,,
+18305,Poland CS2000 zone 5,9807,8801,0.0,9102,8802,15.0,9102,8805,0.999923,9201,8806,5500000.0,9001,8807,0.0,9001,,,,,,
+18306,Poland CS2000 zone 6,9807,8801,0.0,9102,8802,18.0,9102,8805,0.999923,9201,8806,6500000.0,9001,8807,0.0,9001,,,,,,
+18307,Poland CS2000 zone 7,9807,8801,0.0,9102,8802,21.0,9102,8805,0.999923,9201,8806,7500000.0,9001,8807,0.0,9001,,,,,,
+18308,Poland CS2000 zone 8,9807,8801,0.0,9102,8802,24.0,9102,8805,0.999923,9201,8806,8500000.0,9001,8807,0.0,9001,,,,,,
+18401,Kp2000 Jylland og Fyn,9807,8801,0.0,9110,8802,9.3,9110,8805,0.99995,9201,8806,200000.0,9001,8807,0.0,9001,,,,,,
+18402,Kp2000 Sjaelland,9807,8801,0.0,9102,8802,12.0,9102,8805,0.99995,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+18403,Kp2000 Bornholm,9807,8801,0.0,9102,8802,15.0,9102,8805,1.0,9201,8806,900000.0,9001,8807,0.0,9001,,,,,,
+18411,French West Africa Senegal zone,9807,8801,0.0,9110,8802,-13.3,9110,8805,0.999,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18412,French West Africa Ivory Coast zone,9807,8801,0.0,9110,8802,-6.3,9110,8805,0.999,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18413,French West Africa Dahomey zone,9807,8801,0.0,9110,8802,0.3,9110,8805,0.999,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18414,French West Africa Niger zone,9807,8801,0.0,9110,8802,7.3,9110,8805,0.999,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18415,French Equatorial Africa west zone,9807,8801,0.0,9110,8802,10.3,9110,8805,0.999,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18416,French Equatorial Africa central zone,9807,8801,0.0,9110,8802,17.4,9110,8805,0.999,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18417,French Equatorial Africa east zone,9807,8801,0.0,9110,8802,24.3,9110,8805,0.999,9201,8806,1000000.0,9001,8807,1000000.0,9001,,,,,,
+18421,Greenland zone 1 east,9826,8801,82.3,9110,8802,-40.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18422,Greenland zone 2 east,9826,8801,79.3,9110,8802,-24.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18423,Greenland zone 3 east,9826,8801,76.3,9110,8802,-20.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18424,Greenland zone 4 east,9826,8801,73.3,9110,8802,-24.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18425,Greenland zone 5 east,9826,8801,70.3,9110,8802,-24.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18426,Greenland zone 6 east,9826,8801,67.3,9110,8802,-32.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18427,Greenland zone 7 east,9826,8801,64.3,9110,8802,-40.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18428,Greenland zone 8 east,9826,8801,61.3,9110,8802,-48.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18432,Greenland zone 2 west,9826,8801,79.3,9110,8802,-64.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18433,Greenland zone 3 west,9826,8801,76.3,9110,8802,-64.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18434,Greenland zone 4 west,9826,8801,73.3,9110,8802,-52.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18435,Greenland zone 5 west,9826,8801,70.3,9110,8802,-52.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18436,Greenland zone 6 west,9826,8801,67.3,9110,8802,-52.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18437,Greenland zone 7 west,9826,8801,64.3,9110,8802,-52.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+18441,CS63 zone A1,9807,8801,0.07,9110,8802,41.32,9110,8805,1.0,9003,8806,1300000.0,9001,8807,0.0,9001,,,,,,
+18442,CS63 zone A2,9807,8801,0.07,9110,8802,44.32,9110,8805,1.0,9003,8806,2300000.0,9001,8807,0.0,9001,,,,,,
+18443,CS63 zone A3,9807,8801,0.07,9110,8802,47.32,9110,8805,1.0,9201,8806,3300000.0,9001,8807,0.0,9001,,,,,,
+18444,CS63 zone A4,9807,8801,0.07,9110,8802,50.32,9110,8805,1.0,9201,8806,4300000.0,9001,8807,0.0,9001,,,,,,
+18446,CS63 zone K2,9807,8801,0.08,9110,8802,50.46,9110,8805,1.0,9201,8806,2300000.0,9001,8807,0.0,9001,,,,,,
+18447,CS63 zone K3,9807,8801,0.08,9110,8802,53.46,9110,8805,1.0,9201,8806,3300000.0,9001,8807,0.0,9001,,,,,,
+18448,CS63 zone K4,9807,8801,0.08,9110,8802,56.46,9110,8805,1.0,9201,8806,4300000.0,9001,8807,0.0,9001,,,,,,
+19900,Bahrain State Grid,9807,8801,0.0,9102,8802,51.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+19901,Belge Lambert 50,9802,8821,90.0,9110,8822,0.0,9110,8823,49.5,9110,8824,51.1,9110,8826,150000.0,9001,8827,5400000.0,9001,,,
+19902,Belge Lambert 72,9803,8821,90.0,9110,8822,4.2124983,9110,8823,49.5,9110,8824,51.1,9110,8826,150000.01256,9001,8827,5400088.4378,9001,,,
+19903,Nord de Guerre,9801,8801,55.0,9105,8802,6.0,9105,8805,0.99950908,9201,8806,500000.0,9001,8807,300000.0,9001,,,,,,
+19904,Ghana Metre Grid,9807,8801,4.4,9110,8802,-1.0,9110,8805,0.99975,9201,8806,274319.51,9001,8807,0.0,9001,,,,,,
+19905,Netherlands East Indies Equatorial Zone,9804,8801,0.0,9102,8802,110.0,9102,8805,0.997,9201,8806,3900000.0,9001,8807,900000.0,9001,,,,,,
+19906,Iraq zone,9801,8801,32.3,9110,8802,45.0,9110,8805,0.9987864078,9201,8806,1500000.0,9001,8807,1166200.0,9001,,,,,,
+19907,Iraq National Grid,9807,8801,29.0134566,9110,8802,46.3,9110,8805,0.9994,9201,8806,800000.0,9001,8807,0.0,9001,,,,,,
+19908,Irish National Grid,9807,8801,53.3,9110,8802,-8.0,9110,8805,1.000035,9201,8806,200000.0,9001,8807,250000.0,9001,,,,,,
+19909,"Jamaica (Old Grid)",9801,8801,18.0,9102,8802,-77.0,9102,8805,1.0,9201,8806,550000.0,9005,8807,400000.0,9005,,,,,,
+19910,Jamaica National Grid,9801,8801,18.0,9102,8802,-77.0,9102,8805,1.0,9201,8806,250000.0,9001,8807,150000.0,9001,,,,,,
+19911,Laborde Grid,9815,8811,-21.0,9105,8812,49.0,9105,8813,21.0,9105,8814,21.0,9105,8815,0.9995,9201,8816,400000.0,9001,8817,800000.0,9001
+19913,RD Old,9809,8801,52.0922178,9110,8802,5.23155,9110,8805,0.9999079,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+19914,RD New,9809,8801,52.0922178,9110,8802,5.23155,9110,8805,0.9999079,9201,8806,155000.0,9001,8807,463000.0,9001,,,,,,
+19915,Aden Zone,9801,8801,15.0,9102,8802,45.0,9102,8805,0.999365678,9201,8806,1500000.0,9001,8807,1000000.0,9001,,,,,,
+19916,British National Grid,9807,8801,49.0,9102,8802,-2.0,9102,8805,0.999601272,9201,8806,400000.0,9001,8807,-100000.0,9001,,,,,,
+19917,New Zealand Map Grid,9811,8801,-41.0,9102,8802,173.0,9102,8806,2510000.0,9001,8807,6023150.0,9001,,,,,,,,,
+19919,Qatar National Grid,9807,8801,24.27,9110,8802,51.13,9110,8805,0.99999,9201,8806,200000.0,9001,8807,300000.0,9001,,,,,,
+19920,Singapore Grid,9806,8801,1.1715528,9110,8802,103.5110808,9110,8806,30000.0,9001,8807,30000.0,9001,,,,,,,,,
+19921,Spain,9801,8801,40.0,9102,8802,0.0,9102,8805,0.9988085293,9201,8806,600000.0,9001,8807,600000.0,9001,,,,,,
+19922,Swiss New Grid,9815,8811,46.570866,9110,8812,7.26225,9110,8813,90.0,9110,8814,90.0,9110,8815,1.0,9201,8816,600000.0,9001,8817,200000.0,9001
+19923,Swiss Old Grid,9815,8811,46.570866,9110,8812,0.0,9110,8813,90.0,9110,8814,90.0,9110,8815,1.0,9201,8816,0.0,9001,8817,0.0,9001
+19924,Tobago Grid,9806,8801,11.1507843,9110,8802,-60.4109632,9110,8806,187500.0,9039,8807,180000.0,9039,,,,,,,,,
+19925,Trinidad Grid,9806,8801,10.263,9110,8802,-61.2,9110,8806,430000.0,9039,8807,325000.0,9039,,,,,,,,,
+19926,Stereo 70,9809,8801,46.0,9102,8802,25.0,9102,8805,0.99975,9201,8806,500000.0,9001,8807,500000.0,9001,,,,,,
+19927,Stereo 33,9809,8801,45.54,9110,8802,25.23328772,9110,8805,0.9996667,9201,8806,500000.0,9001,8807,500000.0,9001,,,,,,
+19928,Kuwait TM,9807,8801,0.0,9102,8802,48.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+19929,Swedish National Projection,9807,8801,0.0,9110,8802,15.48298,9110,8805,1.0,9201,8806,1500000.0,9001,8807,0.0,9001,,,,,,
+19930,Greek Grid,9807,8801,0.0,9102,8802,24.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+19931,Egyseges Orszagos Vetuleti,9815,8811,47.08398174,9110,8812,19.02548584,9110,8813,90.0,9110,8814,90.0,9110,8815,0.99993,9201,8816,650000.0,9001,8817,200000.0,9001
+19933,"Prince Edward Island Stereographic (ATS77)",9809,8801,47.15,9110,8802,-63.0,9110,8805,0.999912,9201,8806,700000.0,9001,8807,400000.0,9001,,,,,,
+19934,Lithuania 1994,9807,8801,0.0,9102,8802,24.0,9102,8805,0.9998,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+19935,Rectified Skew Orthomorphic Malaya Grid,9812,8806,40000.0,9062,8807,0.0,9062,8811,4.0,9110,8812,102.15,9110,8813,323.01328458,9110,8814,323.07483685,9110,8815,0.99984,9201
+19936,Portuguese National Grid,9807,8801,39.4,9110,8802,1.0,9110,8805,1.0,9201,8806,200000.0,9001,8807,300000.0,9001,,,,,,
+19937,Tunisia Mining Grid,9816,8821,38.81973,9105,8822,7.83445,9105,8826,270.0,9036,8827,582.0,9036,,,,,,,,,
+19938,Estonian National Grid,9802,8821,57.310319415,9110,8822,24.0,9110,8823,59.2,9110,8824,58.0,9110,8826,500000.0,9001,8827,6375000.0,9001,,,
+19939,TM Baltic 93,9807,8801,0.0,9102,8802,24.0,9102,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+19940,Levant Zone,9817,8801,34.39,9110,8802,37.21,9110,8805,0.9996256,9201,8806,300000.0,9001,8807,300000.0,9001,,,,,,
+19941,Brazil Polyconic,9818,8801,0.0,9102,8802,-54.0,9102,8806,5000000.0,9001,8807,10000000.0,9001,,,,,,,,,
+19942,British West Indies Grid,9807,8801,0.0,9102,8802,-62.0,9102,8805,0.9995,9201,8806,400000.0,9001,8807,0.0,9001,,,,,,
+19943,Barbados National Grid,9807,8801,13.1035,9110,8802,-59.3335,9110,8805,0.9999986,9201,8806,30000.0,9001,8807,75000.0,9001,,,,,,
+19944,Quebec Lambert Projection,9802,8821,44.0,9110,8822,-68.3,9110,8823,60.0,9110,8824,46.0,9110,8826,0.0,9001,8827,0.0,9001,,,
+19945,"New Brunswick Stereographic (ATS77)",9809,8801,46.3,9110,8802,-66.3,9110,8805,0.999912,9201,8806,300000.0,9001,8807,800000.0,9001,,,,,,
+19946,"New Brunswick Stereographic (NAD83)",9809,8801,46.3,9110,8802,-66.3,9110,8805,0.999912,9201,8806,2500000.0,9001,8807,7500000.0,9001,,,,,,
+19947,Austria Lambert,9802,8821,47.3,9110,8822,13.2,9110,8823,49.0,9110,8824,46.0,9110,8826,400000.0,9001,8827,400000.0,9001,,,
+19948,Syria Lambert,9801,8801,34.39,9110,8802,37.21,9110,8805,0.9996256,9201,8806,300000.0,9001,8807,300000.0,9001,,,,,,
+19949,Levant Stereographic,9809,8801,38.0,9105,8802,43.5,9105,8805,0.9995341,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+19950,Landesvermessung 1995,9815,8811,46.570866,9110,8812,7.26225,9110,8813,90.0,9110,8814,90.0,9110,8815,1.0,9201,8816,2600000.0,9001,8817,1200000.0,9001
+19951,Nakhl e Taqi Oblique Mercator,9815,8811,27.31077837,9110,8812,52.3612741,9110,8813,0.34179803,9110,8814,0.34179803,9110,8815,0.999895934,9201,8816,658377.437,9001,8817,3044969.194,9001
+19952,Krovak,9819,8811,49.3,9110,8812,42.3,9110,8813,30.1717303,9110,8816,0.0,9001,8817,0.0,9001,8818,78.3,9110,8819,0.9999,9201
+19953,Qatar Grid,9806,8801,25.22565,9110,8802,50.4541,9110,8806,100000.0,9001,8807,100000.0,9001,,,,,,,,,
+19954,Suriname Old TM,9807,8801,0.0,9110,8802,-55.41,9110,8805,0.9996,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+19955,Suriname TM,9807,8801,0.0,9110,8802,-55.41,9110,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+19956,"Rectified Skew Orthomorphic Borneo Grid (chains)",9815,8811,4.0,9110,8812,115.0,9110,8813,53.18569537,9110,8814,53.07483685,9110,8815,0.99984,9201,8816,29352.4763,9042,8817,22014.3572,9042
+19957,"Rectified Skew Orthomorphic Borneo Grid (feet)",9815,8811,4.0,9110,8812,115.0,9110,8813,53.18569537,9110,8814,53.07483685,9110,8815,0.99984,9201,8816,1937263.44,9041,8817,1452947.58,9041
+19958,"Rectified Skew Orthomorphic Borneo Grid (metres)",9815,8811,4.0,9110,8812,115.0,9110,8813,53.18569537,9110,8814,53.07483685,9110,8815,0.99984,9201,8816,590476.87,9001,8817,442857.65,9001
+19959,Ghana National Grid,9807,8801,4.4,9110,8802,-1.0,9110,8805,0.99975,9201,8806,900000.0,9094,8807,0.0,9094,,,,,,
+19960,"Prince Edward Isl. Stereographic (NAD83)",9809,8801,47.15,9110,8802,-63.0,9110,8805,0.999912,9201,8806,400000.0,9001,8807,800000.0,9001,,,,,,
+19961,Belgian Lambert 72,9802,8821,90.0,9110,8822,4.2202952,9110,8823,51.100000204,9110,8824,49.500000204,9110,8826,150000.013,9001,8827,5400088.438,9001,,,
+19962,Irish Transverse Mercator,9807,8801,53.3,9110,8802,-8.0,9110,8805,0.99982,9201,8806,600000.0,9001,8807,750000.0,9001,,,,,,
+19963,Sierra Leone New Colony Grid,9807,8801,6.4,9110,8802,-12.0,9110,8805,1.0,9201,8806,500000.0,9094,8807,0.0,9094,,,,,,
+19964,New War Office Sierra Leone Grid,9807,8801,6.4,9110,8802,-12.0,9110,8805,1.0,9201,8806,800000.0,9094,8807,600000.0,9094,,,,,,
+19965,US National Atlas Equal Area,9821,8806,0.0,9001,8807,0.0,9001,8828,45.0,9102,8829,-100.0,9102,,,,,,,,,
+19966,Luxembourg Gauss,9807,8801,49.5,9110,8802,6.1,9110,8805,1.0,9201,8806,80000.0,9001,8807,100000.0,9001,,,,,,
+19967,Slovenia Grid,9807,8801,0.0,9110,8802,15.0,9110,8805,0.9999,9201,8806,500000.0,9001,8807,0.0,9001,,,,,,
+19968,Plate Carree,9823,8801,0.0,9102,8802,0.0,9102,,,,,,,,,,,,,,,
+19969,Portuguese Grid,9807,8801,39.4,9110,8802,1.0,9110,8805,1.0,9201,8806,0.0,9001,8807,0.0,9001,,,,,,
+19971,New Zealand Transverse Mercator,9807,8801,0.0,9102,8802,173.0,9102,8805,0.9996,9201,8806,1600000.0,9001,8807,10000000.0,9001,,,,,,
+19972,Irish Grid,9807,8801,53.3,9110,8802,-8.0,9110,8805,1.000035,9201,8806,200000.0,9001,8807,250000.0,9001,,,,,,
+19973,Irish National Grid,9807,8801,53.3,9110,8802,-8.0,9110,8805,1.0,9201,8806,200000.0,9001,8807,250000.0,9001,,,,,,
+19974,Modified Portuguese Grid,9807,8801,39.4,9110,8802,-8.0754862,9110,8805,1.0,9201,8806,180.598,9001,8807,-86.99,9001,,,,,,
+19975,"Trinidad Grid (Clarke's feet)",9806,8801,10.263,9110,8802,-61.2,9110,8806,283800.0,9005,8807,214500.0,9005,,,,,,,,,
+19976,ICN Regional,9802,8821,6.0,9102,8822,-66.0,9102,8823,9.0,9102,8824,3.0,9102,8826,1000000.0,9001,8827,1000000.0,9001,,,
+19977,Aramco Lambert,9802,8821,25.0522236,9110,8822,48.0,9102,8823,17.0,9102,8824,33.0,9102,8826,0.0,9001,8827,0.0,9001,,,
+19978,Hong Kong 1980 Grid,9807,8801,22.184368,9110,8802,114.10428,9110,8805,1.0,9201,8806,836694.05,9001,8807,819069.8,9001,,,,,,
+19979,Portugal Bonne,9828,8801,39.4,9110,8802,1.0,9110,8806,0.0,9001,8807,0.0,9001,,,,,,,,,
diff --git a/src/tiff/csv/stateplane.csv b/src/tiff/csv/stateplane.csv
new file mode 100644
index 0000000..020f150
--- /dev/null
+++ b/src/tiff/csv/stateplane.csv
@@ -0,0 +1,258 @@
+"ID","STATE","ZONE","PROJ_METHOD","DATUM","USGS_CODE","EPSG_PCS_CODE"
+101,ALABAMA,EAST,1,NAD83,101,26929
+102,ALABAMA,WEST,1,NAD83,102,26930
+201,ARIZONA,EAST,1,NAD83,201,26948
+202,ARIZONA,CENTRAL,1,NAD83,202,26949
+203,ARIZONA,WEST,1,NAD83,203,26950
+301,ARKANSAS,NORTH,2,NAD83,301,26951
+302,ARKANSAS,SOUTH,2,NAD83,302,26952
+401,CALIFORNIA,I,2,NAD83,401,26941
+402,CALIFORNIA,II,2,NAD83,402,26942
+403,CALIFORNIA,III,2,NAD83,403,26943
+404,CALIFORNIA,IV,2,NAD83,404,26944
+405,CALIFORNIA,V,2,NAD83,405,26945
+406,CALIFORNIA,VI,2,NAD83,406,26946
+501,COLORADO,NORTH,2,NAD83,501,26953
+502,COLORADO,CENTRAL,2,NAD83,502,26954
+503,COLORADO,SOUTH,2,NAD83,503,26955
+600,CONNECTICUT,,2,NAD83,600,26956
+700,DELAWARE,,1,NAD83,700,26957
+901,FLORIDA,EAST,1,NAD83,901,26958
+902,FLORIDA,WEST,1,NAD83,902,26959
+903,FLORIDA,NORTH,2,NAD83,903,26960
+1001,GEORGIA,EAST,1,NAD83,1001,26966
+1002,GEORGIA,WEST,1,NAD83,1002,26967
+1101,IDAHO,EAST,1,NAD83,1101,26968
+1102,IDAHO,CENTRAL,1,NAD83,1102,26969
+1103,IDAHO,WEST,1,NAD83,1103,26970
+1201,ILLINOIS,EAST,1,NAD83,1201,26971
+1202,ILLINOIS,WEST,1,NAD83,1202,26972
+1301,INDIANA,EAST,1,NAD83,1301,26973
+1302,INDIANA,WEST,1,NAD83,1302,26974
+1401,IOWA,NORTH,2,NAD83,1401,26975
+1402,IOWA,SOUTH,2,NAD83,1402,26976
+1501,KANSAS,NORTH,2,NAD83,1501,26977
+1502,KANSAS,SOUTH,2,NAD83,1502,26978
+1601,KENTUCKY,NORTH,2,NAD83,1601,2205
+1602,KENTUCKY,SOUTH,2,NAD83,1602,26980
+1701,LOUISIANA,NORTH,2,NAD83,1701,26981
+1702,LOUISIANA,SOUTH,2,NAD83,1702,26982
+1703,LOUISIANA,OFFSHORE,2,NAD83,1703,
+1801,MAINE,EAST,1,NAD83,1801,26983
+1802,MAINE,WEST,1,NAD83,1802,26984
+1900,MARYLAND,,2,NAD83,1900,26985
+2001,MASSACHUSETTS,MAINLAND,2,NAD83,2001,26986
+2002,MASSACHUSETTS,ISLAND,2,NAD83,2002,26987
+2111,MICHIGAN,NORTH,2,NAD83,2111,26988
+2112,MICHIGAN,CENTRAL,2,NAD83,2112,26989
+2113,MICHIGAN,SOUTH,2,NAD83,2113,26990
+2201,MINNESOTA,NORTH,2,NAD83,2201,26991
+2202,MINNESOTA,CENTRAL,2,NAD83,2202,26992
+2203,MINNESOTA,SOUTH,2,NAD83,2203,26993
+2301,MISSISSIPPI,EAST,1,NAD83,2301,26994
+2302,MISSISSIPPI,WEST,1,NAD83,2302,26995
+2401,MISSOURI,EAST,1,NAD83,2401,26996
+2402,MISSOURI,CENTRAL,1,NAD83,2402,26997
+2403,MISSOURI,WEST,1,NAD83,2403,26998
+2500,MONTANA,,2,NAD83,2500,32100
+2600,NEBRASKA,,2,NAD83,2600,32104
+2701,NEVADA,EAST,1,NAD83,2701,32107
+2702,NEVADA,CENTRAL,1,NAD83,2702,32108
+2703,NEVADA,WEST,1,NAD83,2703,32109
+2800,"NEW HAMPSHIRE",,1,NAD83,2800,32110
+2900,"NEW JERSEY",,1,NAD83,2900,32111
+3001,"NEW MEXICO",EAST,1,NAD83,3001,32112
+3002,"NEW MEXICO",CENTRAL,1,NAD83,3002,32113
+3003,"NEW MEXICO",WEST,1,NAD83,3003,32114
+3101,"NEW YORK",EAST,1,NAD83,3101,32115
+3102,"NEW YORK",CENTRAL,1,NAD83,3102,32116
+3103,"NEW YORK",WEST,1,NAD83,3103,32117
+3104,"NEW YORK","LONG ISLAND",2,NAD83,3104,32118
+3200,"NORTH CAROLINA",,2,NAD83,3200,32119
+3301,"NORTH DAKOTA",NORTH,2,NAD83,3301,32120
+3302,"NORTH DAKOTA",SOUTH,2,NAD83,3302,32121
+3401,OHIO,NORTH,2,NAD83,3401,32122
+3402,OHIO,SOUTH,2,NAD83,3402,32123
+3501,OKLAHOMA,NORTH,2,NAD83,3501,32124
+3502,OKLAHOMA,SOUTH,2,NAD83,3502,32125
+3601,OREGON,NORTH,2,NAD83,3601,32126
+3602,OREGON,SOUTH,2,NAD83,3602,32127
+3701,PENNSYLVANIA,NORTH,2,NAD83,3701,32128
+3702,PENNSYLVANIA,SOUTH,2,NAD83,3702,32129
+3800,"RHODE ISLAND",,1,NAD83,3800,32130
+3900,"SOUTH CAROLINA",,2,NAD83,3900,32133
+4001,"SOUTH DAKOTA",NORTH,2,NAD83,4001,32134
+4002,"SOUTH DAKOTA",SOUTH,2,NAD83,4002,32135
+4100,TENNESSEE,,2,NAD83,4100,32136
+4201,TEXAS,NORTH,2,NAD83,4201,32137
+4202,TEXAS,"NORTH CENTRAL",2,NAD83,4202,32138
+4203,TEXAS,CENTRAL,2,NAD83,4203,32139
+4204,TEXAS,"SOUTH CENTRAL",2,NAD83,4204,32140
+4205,TEXAS,SOUTH,2,NAD83,4205,32141
+4301,UTAH,NORTH,2,NAD83,4301,32142
+4302,UTAH,CENTRAL,2,NAD83,4302,32143
+4303,UTAH,SOUTH,2,NAD83,4303,32144
+4400,VERMONT,,1,NAD83,4400,32145
+4501,VIRGINIA,NORTH,2,NAD83,4501,32146
+4502,VIRGINIA,SOUTH,2,NAD83,4502,32147
+4601,WASHINGTON,NORTH,2,NAD83,4601,32148
+4602,WASHINGTON,SOUTH,2,NAD83,4602,32149
+4701,"WEST VIRGINIA",NORTH,2,NAD83,4701,32150
+4702,"WEST VIRGINIA",SOUTH,2,NAD83,4702,32151
+4801,WISCONSIN,NORTH,2,NAD83,4801,32152
+4802,WISCONSIN,CENTRAL,2,NAD83,4802,32153
+4803,WISCONSIN,SOUTH,2,NAD83,4803,32154
+4901,WYOMING,EAST,1,NAD83,4901,32155
+4902,WYOMING,"EAST CENTRAL",1,NAD83,4902,32156
+4903,WYOMING,"WEST CENTRAL",1,NAD83,4903,32157
+4904,WYOMING,WEST,1,NAD83,4904,32158
+5001,ALASKA,"ZONE NO. 1",4,NAD83,5001,26931
+5002,ALASKA,"ZONE NO. 2",1,NAD83,5002,26932
+5003,ALASKA,"ZONE NO. 3",1,NAD83,5003,26933
+5004,ALASKA,"ZONE NO. 4",1,NAD83,5004,26934
+5005,ALASKA,"ZONE NO. 5",1,NAD83,5005,26935
+5006,ALASKA,"ZONE NO. 6",1,NAD83,5006,26936
+5007,ALASKA,"ZONE NO. 7",1,NAD83,5007,26937
+5008,ALASKA,"ZONE NO. 8",1,NAD83,5008,26938
+5009,ALASKA,"ZONE NO. 9",1,NAD83,5009,26939
+5010,ALASKA,"ZONE NO. 10",2,NAD83,5010,26940
+5101,HAWAII,1,1,NAD83,5101,26961
+5102,HAWAII,2,1,NAD83,5102,26962
+5103,HAWAII,3,1,NAD83,5103,26963
+5104,HAWAII,4,1,NAD83,5104,26964
+5105,HAWAII,5,1,NAD83,5105,26965
+5200,"PUERTO RICO AND","VIRGIN ISLANDS",2,NAD83,5200,32161
+10101,ALABAMA,EAST,1,NAD27,101,26729
+10102,ALABAMA,WEST,1,NAD27,102,26730
+10201,ARIZONA,EAST,1,NAD27,201,26748
+10202,ARIZONA,CENTRAL,1,NAD27,202,26749
+10203,ARIZONA,WEST,1,NAD27,203,26750
+10301,ARKANSAS,NORTH,2,NAD27,301,26751
+10302,ARKANSAS,SOUTH,2,NAD27,302,26752
+10401,CALIFORNIA,I,2,NAD27,401,26741
+10402,CALIFORNIA,II,2,NAD27,402,26742
+10403,CALIFORNIA,III,2,NAD27,403,26743
+10404,CALIFORNIA,IV,2,NAD27,404,26744
+10405,CALIFORNIA,V,2,NAD27,405,26745
+10406,CALIFORNIA,VI,2,NAD27,406,26746
+10407,CALIFORNIA,VII,2,NAD27,407,26747
+10501,COLORADO,NORTH,2,NAD27,501,26753
+10502,COLORADO,CENTRAL,2,NAD27,502,26754
+10503,COLORADO,SOUTH,2,NAD27,503,26755
+10600,CONNECTICUT,,2,NAD27,600,26756
+10700,DELAWARE,,1,NAD27,700,26757
+10901,FLORIDA,EAST,1,NAD27,901,26758
+10902,FLORIDA,WEST,1,NAD27,902,26759
+10903,FLORIDA,NORTH,2,NAD27,903,26760
+11001,GEORGIA,EAST,1,NAD27,1001,26766
+11002,GEORGIA,WEST,1,NAD27,1002,26767
+11101,IDAHO,EAST,1,NAD27,1101,26768
+11102,IDAHO,CENTRAL,1,NAD27,1102,26769
+11103,IDAHO,WEST,1,NAD27,1103,26770
+11201,ILLINOIS,EAST,1,NAD27,1201,26771
+11202,ILLINOIS,WEST,1,NAD27,1202,26772
+11301,INDIANA,EAST,1,NAD27,1301,26773
+11302,INDIANA,WEST,1,NAD27,1302,26774
+11401,IOWA,NORTH,2,NAD27,1401,26775
+11402,IOWA,SOUTH,2,NAD27,1402,26776
+11501,KANSAS,NORTH,2,NAD27,1501,26777
+11502,KANSAS,SOUTH,2,NAD27,1502,26778
+11601,KENTUCKY,NORTH,2,NAD27,1601,26779
+11602,KENTUCKY,SOUTH,2,NAD27,1602,26780
+11701,LOUISIANA,NORTH,2,NAD27,1701,26781
+11702,LOUISIANA,SOUTH,2,NAD27,1702,26782
+11703,LOUISIANA,OFFSHORE,2,NAD27,1703,
+11801,MAINE,EAST,1,NAD27,1801,26783
+11802,MAINE,WEST,1,NAD27,1802,26784
+11900,MARYLAND,,2,NAD27,1900,26785
+12001,MASSACHUSETTS,MAINLAND,2,NAD27,2001,26786
+12002,MASSACHUSETTS,ISLAND,2,NAD27,2002,26787
+12101,MICHIGAN,EAST,1,NAD27,2101,26801
+12102,MICHIGAN,"CENTRAL/M",1,NAD27,2102,26802
+12103,MICHIGAN,WEST,1,NAD27,2103,26803
+12111,MICHIGAN,NORTH,2,NAD27,2111,26811
+12112,MICHIGAN,"CENTRAL/L",2,NAD27,2112,26812
+12113,MICHIGAN,SOUTH,2,NAD27,2113,26813
+12201,MINNESOTA,NORTH,2,NAD27,2201,26791
+12202,MINNESOTA,CENTRAL,2,NAD27,2202,26792
+12203,MINNESOTA,SOUTH,2,NAD27,2203,26793
+12301,MISSISSIPPI,EAST,1,NAD27,2301,26794
+12302,MISSISSIPPI,WEST,1,NAD27,2302,26795
+12401,MISSOURI,EAST,1,NAD27,2401,26796
+12402,MISSOURI,CENTRAL,1,NAD27,2402,26797
+12403,MISSOURI,WEST,1,NAD27,2403,26798
+12501,MONTANA,NORTH,2,NAD27,2501,32001
+12502,MONTANA,CENTRAL,2,NAD27,2502,32002
+12503,MONTANA,SOUTH,2,NAD27,2503,32003
+12601,NEBRASKA,NORTH,2,NAD27,2601,32005
+12602,NEBRASKA,SOUTH,2,NAD27,2602,32006
+12701,NEVADA,EAST,1,NAD27,2701,32007
+12702,NEVADA,CENTRAL,1,NAD27,2702,32008
+12703,NEVADA,WEST,1,NAD27,2703,32009
+12800,"NEW HAMPSHIRE",,1,NAD27,2800,32010
+12900,"NEW JERSEY",,1,NAD27,2900,32011
+13001,"NEW MEXICO",EAST,1,NAD27,3001,32012
+13002,"NEW MEXICO",CENTRAL,1,NAD27,3002,32013
+13003,"NEW MEXICO",WEST,1,NAD27,3003,32014
+13101,"NEW YORK",EAST,1,NAD27,3101,32015
+13102,"NEW YORK",CENTRAL,1,NAD27,3102,32016
+13103,"NEW YORK",WEST,1,NAD27,3103,32017
+13104,"NEW YORK","LONG ISLAND",2,NAD27,3104,32018
+13200,"NORTH CAROLINA",,2,NAD27,3200,32019
+13301,"NORTH DAKOTA",NORTH,2,NAD27,3301,32020
+13302,"NORTH DAKOTA",SOUTH,2,NAD27,3302,32021
+13401,OHIO,NORTH,2,NAD27,3401,32022
+13402,OHIO,SOUTH,2,NAD27,3402,32023
+13501,OKLAHOMA,NORTH,2,NAD27,3501,32024
+13502,OKLAHOMA,SOUTH,2,NAD27,3502,32025
+13601,OREGON,NORTH,2,NAD27,3601,32026
+13602,OREGON,SOUTH,2,NAD27,3602,32027
+13701,PENNSYLVANIA,NORTH,2,NAD27,3701,32028
+13702,PENNSYLVANIA,SOUTH,2,NAD27,3702,32029
+13800,"RHODE ISLAND",,1,NAD27,3800,32030
+13901,"SOUTH CAROLINA",NORTH,2,NAD27,3901,32031
+13902,"SOUTH CAROLINA",SOUTH,2,NAD27,3902,32033
+14001,"SOUTH DAKOTA",NORTH,2,NAD27,4001,32034
+14002,"SOUTH DAKOTA",SOUTH,2,NAD27,4002,32035
+14100,TENNESSEE,,2,NAD27,4100,2204
+14201,TEXAS,NORTH,2,NAD27,4201,32037
+14202,TEXAS,"NORTH CENTRAL",2,NAD27,4202,32038
+14203,TEXAS,CENTRAL,2,NAD27,4203,32039
+14204,TEXAS,"SOUTH CENTRAL",2,NAD27,4204,32040
+14205,TEXAS,SOUTH,2,NAD27,4205,32041
+14301,UTAH,NORTH,2,NAD27,4301,32042
+14302,UTAH,CENTRAL,2,NAD27,4302,32043
+14303,UTAH,SOUTH,2,NAD27,4303,32044
+14400,VERMONT,,1,NAD27,4400,32045
+14501,VIRGINIA,NORTH,2,NAD27,4501,32046
+14502,VIRGINIA,SOUTH,2,NAD27,4502,32047
+14601,WASHINGTON,NORTH,2,NAD27,4601,32048
+14602,WASHINGTON,SOUTH,2,NAD27,4602,32049
+14701,"WEST VIRGINIA",NORTH,2,NAD27,4701,32050
+14702,"WEST VIRGINIA",SOUTH,2,NAD27,4702,32051
+14801,WISCONSIN,NORTH,2,NAD27,4801,32052
+14802,WISCONSIN,CENTRAL,2,NAD27,4802,32053
+14803,WISCONSIN,SOUTH,2,NAD27,4803,32054
+14901,WYOMING,EAST,1,NAD27,4901,32055
+14902,WYOMING,"EAST CENTRAL",1,NAD27,4902,32056
+14903,WYOMING,"WEST CENTRAL",1,NAD27,4903,32057
+14904,WYOMING,WEST,1,NAD27,4904,32058
+15001,ALASKA,"ZONE NO. 1",4,NAD27,5001,26731
+15002,ALASKA,"ZONE NO. 2",1,NAD27,5002,26732
+15003,ALASKA,"ZONE NO. 3",1,NAD27,5003,26733
+15004,ALASKA,"ZONE NO. 4",1,NAD27,5004,26734
+15005,ALASKA,"ZONE NO. 5",1,NAD27,5005,26735
+15006,ALASKA,"ZONE NO. 6",1,NAD27,5006,26736
+15007,ALASKA,"ZONE NO. 7",1,NAD27,5007,26737
+15008,ALASKA,"ZONE NO. 8",1,NAD27,5008,26738
+15009,ALASKA,"ZONE NO. 9",1,NAD27,5009,26739
+15010,ALASKA,"ZONE NO. 10",2,NAD27,5010,26740
+15101,HAWAII,1,1,NAD27,5101,3561
+15102,HAWAII,2,1,NAD27,5102,3562
+15103,HAWAII,3,1,NAD27,5103,3563
+15104,HAWAII,4,1,NAD27,5104,3564
+15105,HAWAII,5,1,NAD27,5105,3565
+15201,"PUERTO RICO AND VIRGIN ISLANDS",,2,NAD27,5201,3991
+15202,"VIRGIN ISLANDS","ST. CROIX",2,NAD27,5202,3992
+15300,"AMERICAN SAMOA",,2,NAD27,5300,2155
+15400,"GUAM ISLAND",,3,NAD27,5400,
diff --git a/src/tiff/csv/trf_method.c b/src/tiff/csv/trf_method.c
new file mode 100644
index 0000000..7331e1d
--- /dev/null
+++ b/src/tiff/csv/trf_method.c
@@ -0,0 +1,205 @@
+#include "defs.h"
+datafile_rows_t trf_method_row_1[] = {"COORD_TRF_METHOD_CODE","CTRF_METHOD_EPSG_NAME","CTRF_METHOD_USER_NAME","DESCRIPTION","PARAM_1_NAME","PARAM_2_NAME","PARAM_3_NAME","PARAM_4_NAME","PARAM_5_NAME","PARAM_6_NAME","PARAM_7_NAME","PARAM_8_NAME","PARAM_9_NAME","PARAM_10_NAME","PARAM_11_NAME","PARAM_12_NAME","PARAM_13_NAME","PARAM_14_NAME","PARAM_15_NAME","PARAM_16_NAME","PARAM_17_NAME","PARAM_18_NAME","PARAM_19_NAME","PARAM_20_NAME","PARAM_21_NAME","PARAM_22_NAME","PARAM_23_NAME","PARAM_24 [...]
+datafile_rows_t trf_method_row_2[] = {"9601","Longitude rotation","","This transformation allows calculation of coordinates in the target system by adding the parameter value to the coordinate values of the point in the source system.","Longitude rotation","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Lon2 = Lon1 + longitude_rotation.","","1999-11-12 00:00:00","","EPSG","","99.79",NULL};
+datafile_rows_t trf_method_row_3[] = {"9602","Geodetic/geocentric conversions","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Latitude, P, and Longitude, L, in terms of Geographic Coordinate System (GCS) A may \
+be expressed in terms of a geocentric (earth centred) cartesian coordinate system X, Y, Z \
+with the Z axis corresponding with the Polar axis positive northwards, the X a","Consider a North Sea point with coordinates derived by GPS satellite in the WGS84 geographical coordinate system with coordinates of:\
+\
+           latitude    53 deg 48 min 33.82 sec N, \
+           longitude 02 deg 07 min 46.38 sec E, \
+    and ellipsoid","1996-09-18 00:00:00","\"Transformation from spatial to geographical coordinates\"; B. R. Bowring; Survey Review number 181; July 1976.","EPSG","","97.29",NULL};
+datafile_rows_t trf_method_row_4[] = {"9603","Geocentric translations","","","X-axis translation","Y-axis translation","Z-axis translation","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","If  we may assume that the minor axes of the ellipsoids are parallel, then shifts dX, dY, dZ \
+in the sense from datum A to datum B may then be applied as\
+\
+   XB = XA + dX \
+   YB = YA + dY\
+   ZB = ZA + dZ","Given a three parameter datum shift from WGS84 to ED50 for this North Sea area is given as \
+dX = +84.87m, dY = +96.49m, dZ = +116.95m. \
+\
+The WGS84 geographical coordinates convert to the following GS84 geocentric values using \
+the above formulas for X,","1996-09-18 00:00:00","POSC Epicentre 2.2.1","EPSG","","",NULL};
+datafile_rows_t trf_method_row_5[] = {"9604","Molodenski","","","X-axis translation","Y-axis translation","Z-axis translation","Semi-major axis length difference","Flattening difference","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1996-09-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_method_row_6[] = {"9605","Abridged Molodenski","","","X-axis translation","Y-axis translation","Z-axis translation","Semi-major axis length difference","Flattening difference","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","As an alternative to the computation of the new latitude, longitude and height above ellipsoid in discrete steps through geocentric coordinates, the changes in these coordinates may be derived direct [...]
+datafile_rows_t trf_method_row_7[] = {"9606","Position Vector 7-param. transformation","","","X-axis translation","Y-axis translation","Z-axis translation","X-axis rotation","Y-axis rotation","Z-axis rotation","Scale difference","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Transformation of coordinates from one geographic coordinate system into another (also known as a \"datum transformation\") is usually carried out as an implicit concatenat [...]
+[geographical to geocentric >> geocentric to geocentric","Input point: \
+Coordinate system: WGS72 (geographic 3D)\
+  Latitude =   55 deg 00 min 00 sec \
+  Longitude =  4 deg 00 min 00 sec \
+  Ellipsoidal height =  0 m\
+This transforms to cartesian geocentric coords:\
+    X = 3 657 660.66 (m)  \
+    Y =    255 768","1996-09-18 00:00:00","","EPSG","","98.16",NULL};
+datafile_rows_t trf_method_row_8[] = {"9607","Coordinate Frame rotation","","","X-axis translation","Y-axis translation","Z-axis translation","X-axis rotation","Y-axis rotation","Z-axis rotation","Scale difference","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","<<<<<This text is continued from the description of the Position Vector Transformation formula>>>>>\
+\
+Although being common practice in particularly the European E&P industry Position Vector Transformation sign convention is not universally accepted.  A v","The same example as for the Position Vector Transformation can be calculated, however the following transformation parameters have to be applied to achieve the same input and output in terms of coordinate values:\
+\
+Transformation parameters Coordinate Fra","1996-09-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_method_row_9[] = {"9608","Similarity transform","","","A1","A2 * m","A3 * n","B1","B2 * m","B3 * n","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1996-09-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_method_row_10[] = {"9609","2-dimensional Affine transformation","","","A1","A2 * m","A3 * n","B1","B2 * m","B3 * n","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1996-09-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_method_row_11[] = {"9610","2nd-order Polynomial function","","","Ordinate 1 of source evaluation point","Ordinate 2 of source evaluation point","Ordinate 1 of target evaluation point","Ordinate 2 of target evaluation point","A1","A2 * m","A3 * n","A4 * mm","A5 * mn","A6 * nn","B1","B2 * m","B3 * n","B4 * mm","B5 * mn","B6 * nn","","","","","","","","","","","","","","","","","","","","","","","","1996-09-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_method_row_12[] = {"9611","3rd-order Polynomial function","","","Ordinate 1 of source evaluation point","Ordinate 2 of source evaluation point","Ordinate 1 of target evaluation point","Ordinate 2 of target evaluation point","A1","A2 * m","A3 * n","A4 * mm","A5 * mn","A6 * nn","A7 * mmm","A8 * mmn","A9 * mnn","A10 * nnn","B1","B2 * m","B3 * n","B4 * mm","B5 * mn","B6 * nn","B7 * mmm","B8 * mmn","B9 * mnn","B10 * nnn","","","","","","","","","","","","","","","","1996-0 [...]
+datafile_rows_t trf_method_row_13[] = {"9612","4th-order Polynomial function","","","Ordinate 1 of source evaluation point","Ordinate 2 of source evaluation point","Ordinate 1 of target evaluation point","Ordinate 2 of target evaluation point","A1","A2 * m","A3 * n","A4 * mm","A5 * mn","A6 * nn","A7 * mmm","A8 * mmn","A9 * mnn","A10 * nnn","A11 * mmmm","A12 * mmmn","A13 * mmnn","A14 * mnnn","A15 * nnnn","B1","B2 * m","B3 * n","B4 * mm","B5 * mn","B6 * nn","B7 * mmm","B8 * mmn","B9 * mnn" [...]
+datafile_rows_t trf_method_row_14[] = {"9613","NADCON","","Geodetic transformation operating on geographic coordinate differences by bi-linear interpolation.  Used specifically for some NAD27<->NAD83 transformations in USA.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Latitude difference gridded binary file","Longitude difference gridded binary file","","","","1996-09-18 00:00:00","US Coast and geodetic Survey - http://www.ngs.no [...]
+datafile_rows_t trf_method_row_15[] = {"9614","NTv1","","Geodetic transformation operating on geographic coordinate differences by bi-linear interpolation.  Used specifically for some NAD27<->NAD83 transformations in Canada.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Latitude and longitude difference file","","","","","1997-11-13 00:00:00","Geomatics Canada - Geodetic Survey Division.","EPSG","Superceded in 1997 by NTv2 (transf [...]
+datafile_rows_t trf_method_row_16[] = {"9615","NTv2","","Geodetic transformation operating on geographic coordinate differences by bi-linear interpolation.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Latitude and longitude difference file","","","","","1997-11-13 00:00:00","http://www.geod.nrcan.gc.ca/products/html-public/GSDapps/English/NTv2_Fact_Sheet.html","EPSG","Supercedes  NTv1 (transformation method code 9614).  Input exp [...]
+datafile_rows_t trf_method_row_17[] = {"9616","Vertical Offset","","This transformation allows calculation of ordinate in the target system by adding the parameter value to the ordinate value of the point in the source system.","Vertical offset","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","V2 = [(V1 * U1) + (O12 * Uoff)] * (m / U2) where V2 = value in second vertical coordinate system; V1 = value in first system; O12 is the  [...]
+datafile_rows_t trf_method_row_18[] = {"9617","Madrid to ED50","","","","","","","A","B","C","D","E","F","G","H","J","","","","","","","","","","","","","","","","","","","","","","","","","The original geographic coordinate system for the Spanish mainland was based on Madrid 1870 datum, Struve 1860 ellipsoid, with longitudes related to the Madrid meridian.  Three polynomial expressions have been empirically derived by El Servicio Geogr�fico ","Input point coordinate system: Madrid 1870  [...]
+   Latitude    =  42 deg 38 min 52.77 sec N = 42.647992 degrees\
+   Longitude  =    3 deg 39 min 34.57 sec E of Madrid	\
+                         = +3.659603 degrees from the Madrid merid","1999-11-15 00:00:00","Institut de Geomatica; Barcelona","EPSG","","99.284  99.82",NULL};
+datafile_rows_t trf_method_row_19[] = {"9618","Geographical and Height Offsets","","This transformation allows calculation of coordinates in the target system by adding the parameter value to the coordinate values of the point in the source system.","Latitude offset","Longitude offset","Gravity-related to ellipsoid height","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Lat2 = Lat1 + latitude_offset;  Lon2 = Lon1 + longitude_offset;  [...]
+datafile_rows_t trf_method_row_20[] = {"9619","Geographical Offsets","","This transformation allows calculation of coordinates in the target system by adding the parameter value to the coordinate values of the point in the source system.","Latitude offset","Longitude offset","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Lat2 = Lat1 + latitude_offset;  Lon2 = Lon1 + longitude_offset.","","1999-11-12 00:00:00","","EPSG","","99.79" [...]
+datafile_rows_t trf_method_row_21[] = {"9620","Norway Offshore Interpolation","","","","","","","","Geod. tfm. code for northern boundary","Geod. tfm. code for southern boundary","","","","","","","","","","","","","","","","","","","","","","","","","","","","Geod. tfm. name for northern boundary","Geod. tfm. name for southern boundary","","","","1999-04-22 00:00:00","Norwegian Mapping Authority note of 13-Feb-1991 \"Om Transformasjon mellom Geodetiske Datum i Norge\".","EPSG","","",NULL};
+datafile_rows_t trf_method_row_22[] = {"9801","Lambert Conic Conformal (1SP)","","","Latitude of natural origin","Longitude of natural origin","","","Scale factor at natural origin","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","To derive the projected Easting and Northing coordinates of a point with geographical coordinates (lat,lon) the formulas for the one standard parallel case are:\
+\
+E = FE + r sin(theta)\
+N = FN + r0 - r cos(theta)\
+where\
+n = sin lat0\
+r = a F t^n k0     f","For Projected Coordinate System JAD69 / Jamaica National Grid\
+\
+Parameters:\
+Ellipsoid:  Clarke 1866, a = 6378206.400 m., 1/f = 294.97870\
+                                   then  e = 0.08227185 and e^2 = 0.00676866\
+\
+Latitude Natural Origin         18 d","1996-09-18 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.1","EPSG","","",NULL};
+datafile_rows_t trf_method_row_23[] = {"9802","Lambert Conic Conformal (2SP)","","","Latitude of false origin","Longitude of false origin","Latitude of 1st standard parallel","Latitude of 2nd standard parallel","","Easting at false origin","Northing at false origin","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","To derive the projected Easting and Northing coordinates of a point with geographical coordinates (lat,lon) the formulas for the one s [...]
+\
+E = EF + r sin(theta)\
+N = NF + rF - r cos(theta)\
+where\
+m = cos(lat)/(1 - e^2 sin^2(lat))^","For Projected Coordinate System NAD27 / Texas South Central\
+\
+Parameters:\
+Ellipsoid  Clarke 1866, a = 6378206.400 metres = 20925832.16 US survey feet\
+                                   1/f = 294.97870\
+then e = 0.08227185 and e^2 = 0.00676866\
+\
+First S","1999-04-22 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.1","EPSG","","99.281",NULL};
+datafile_rows_t trf_method_row_24[] = {"9803","Lambert Conic Conformal (2SP Belgium)","","","Latitude of false origin","Longitude of false origin","Latitude of 1st standard parallel","Latitude of 2nd standard parallel","","Easting at false origin","Northing at false origin","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Since 1972 a modified form of the two standard parallel case has been used in Belgium.  For the Lambert Conic Conformal (2 SP  [...]
+Easting, E = EF + r sin (theta - alpha)","For Projected Coordinate System Belge l972 / Belge Lambert 72\
+\
+Parameters:\
+Ellipsoid  International 1924,  a = 6378388 metres\
+                                              1/f = 297\
+then e = 0.08199189 and e^2 = 0.006722670\
+\
+First Standard Parallel ","1999-04-22 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.1","EPSG","","99.281",NULL};
+datafile_rows_t trf_method_row_25[] = {"9804","Mercator (1SP)","","","Latitude of natural origin","Longitude of natural origin","","","Scale factor at natural origin","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The formulas to derive projected Easting and Northing coordinates are:\
+\
+E = FE + a*k0(lon - lon0)              \
+N = FN + a*k0* ln{tan(pi/4 + lat/2)[(1 - esin(lat))(1 + esin(lat))]^e/2} where symbols are as listed above and logarithms are natural.\
+\
+The","For Projected Coordinate System Makassar / NEIEZ\
+\
+Parameters:\
+Ellipsoid   Bessel 1841  a = 6377397.155 m   1/f = 299.15281\
+then e = 0.08169683\
+\
+Latitude Natural Origin         00o00'00\"N  = 0.0000000 rad\
+Longitude Natural Origin    110o00'00\"E  = 1.","1996-09-18 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.2","EPSG","","",NULL};
+datafile_rows_t trf_method_row_26[] = {"9805","Mercator (2SP)","","","Latitude of 1st standard parallel","Longitude of natural origin","","","","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The formulas to derive projected Easting and Northing coordinates are:\
+\
+For the two standard parallel case, k0 is first calculated from\
+\
+k0 = cos(latSP1)/(1 - e^2*sin^2(latSP1))^0.5 \
+ \
+where latSP1 is the absolute value of the first standard parallel","For Projected Coordinate System Pulkovo 1942 / Mercator Caspian Sea\
+\
+Parameters:\
+Ellipsoid  Krassowski 1940   a = 6378245.00m   1/f = 298.300\
+then e = 0.08181333 and e^2 = 0.00669342\
+\
+Latitude first SP                             42o00'00\"N = 0.73303","1996-09-18 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.2","EPSG","","",NULL};
+datafile_rows_t trf_method_row_27[] = {"9806","Cassini-Soldner","","","Latitude of natural origin","Longitude of natural origin","","","","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The formulas to derive projected Easting and Northing coordinates are:\
+\
+Easting E = FE + nu[A - TA^3/6 -(8 - T + 8C)TA^5/120]\
+\
+Northing N = FN + M - M0 + nu*tan(lat)*[A^2/2 + (5 - T + 6C)A^4/24]\
+\
+where A = (lon - lon0)cos(lat)\
+T = tan^2(lat)\
+C = e2","For Projected Coordinate System Trinidad 1903 / Trinidad Grid \
+Parameters:\
+Ellipsoid   Clarke 1858     a = 20926348 ft    = 31706587.88 links\
+                                        b = 20855233 ft\
+\
+then 1/f = 294.97870 and e^2 = 0.00676866\
+\
+Latitud","1996-09-18 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.3","EPSG","","",NULL};
+datafile_rows_t trf_method_row_28[] = {"9807","Transverse Mercator","","","Latitude of natural origin","Longitude of natural origin","","","Scale factor at natural origin","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The formulas to derive the projected Easting and Northing coordinates are in the form of a series as follows:\
+\
+Easting, E =  FE + k0*nu[A + (1 - T + C)A^3/6 + (5 - 18T + T^2 + 72C - 58e'sq)A^5/120]	\
+\
+Northing, N =  FN + k0{M - M0 + nu*tan(lat)[A^2/2 + ","For Projected Coordinate System OSGB 1936 / British National Grid\
+\
+Parameters:\
+Ellipsoid  Airy 1830  a = 6377563.396 m  1/f = 299.32496\
+then e'^2 = 0.00671534 and e^2 = 0.00667054\
+\
+Latitude Natural Origin         49o00'00\"N   = 0.85521133 rad\
+Longit","1996-09-18 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.4","EPSG","","",NULL};
+datafile_rows_t trf_method_row_29[] = {"9808","Transverse Mercator (South Orientated)","","","Latitude of natural origin","Longitude of natural origin","","","Scale factor at natural origin","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","For the mapping of southern Africa a south oriented Transverse Mercator projection is used. Here the coordinate axes are called Westings and Southings and increment to the West  [...]
+datafile_rows_t trf_method_row_30[] = {"9809","Oblique Stereographic","","","Latitude of natural origin","Longitude of natural origin","","","Scale factor at natural origin","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The coordinate transformation from geographical to projected coordinates is executed via the distance and azimuth of the point from the centre point or origin. For a sphere the formulas are rela [...]
+\
+Parameters:\
+Ellipsoid   Bessel 1841    a = 6377397.155 m    1/f = 299.15281\
+then e = 0.08169683\
+\
+Latitude Natural Origin      52o09'22.178\"N  = 0.910296727 rad\
+Longitude Natural Origin     5o23'1","1999-11-15 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.6","EPSG","","99.811",NULL};
+datafile_rows_t trf_method_row_31[] = {"9810","Polar Stereographic","","","Latitude of natural origin","Longitude of natural origin","","","Scale factor at natural origin","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","For the forward transformation from latitude and longitude,\
+\
+E = FE + rho sin(lon - lon0)\
+N = FN - rho cos(lon - lon0)\
+where\
+rho = 2 a ko t /{[((1+e)^(1+e)) ((1-e)^(1-e))]^0.5}\
+t = tan (pi/4 - lat/2) / [(1-esin(lat) ) / (1 + e sin(lat))]^(e/2)\
+\
+For","","1996-09-18 00:00:00","US Geological Survey Professional Paper 1395; \"Map Projections - A Working Manual\";  J. Snyder","EPSG","","",NULL};
+datafile_rows_t trf_method_row_32[] = {"9811","New Zealand Map Grid","","","Latitude of natural origin","Longitude of natural origin","","","","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1996-09-18 00:00:00","New Zealand Department of Lands technical circular 1973/32","EPSG","","",NULL};
+datafile_rows_t trf_method_row_33[] = {"9812","Hotine Oblique Mercator","","","Latitude of projection centre","Longitude of projection centre","Azimuth of initial line","Angle from Rectified to Skew Grid","Scale factor on initial line","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The following constants for the projection may be calculated :\
+\
+B = (1 + esq * cos^4(latc) / (1 - esq ))^0.5\
+A = a * B * kc *(1 - esq )^0.5 / ( 1 - esq * sin^2(latc))\
+t0 = tan(pi/4 - latc/2) / ((1 - e*sin(latc)) / (1 + e*sin(latc)))^(e/2)\
+D = B (1 - e","For Projected Coordinate System  Timbalai 1948 / R.S.O. Borneo (m)\
+\
+Parameters:\
+	Ellipsoid:  Everest 1830 (1967 Definition)\
+				a = 6377298.556 metres 	1/f = 300.8017\
+				then	e = 0.081472981	e2 = 0.006637847\
+					\
+	Latitude Projection Centre	fc  	4","1999-11-15 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.5","EPSG","","97.62  99.811",NULL};
+datafile_rows_t trf_method_row_34[] = {"9813","Laborde Oblique Mercator","","","Latitude of projection centre","Longitude of projection centre","Azimuth of initial line","","Scale factor on initial line","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1996-09-18 00:00:00","\"La nouvelle projection du Service Geographique de Madagascar\"; J. Laborde; 1928","EPSG","Can be accomodated by Oblique Mercator metho [...]
+datafile_rows_t trf_method_row_35[] = {"9814","Swiss Oblique Cylindrical","","","Latitude of projection centre","Longitude of projection centre","","","","Easting at projection centre","Northing at projection centre","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1996-09-18 00:00:00","\"Die projecktionen der Schweizerischen Plan und Kartenwerke\"; J Bollinger; 1967","EPSG","Can be accomodated by Oblique Mercator method (code 9815).","97.6 [...]
+datafile_rows_t trf_method_row_36[] = {"9815","Oblique Mercator","","","Latitude of projection centre","Longitude of projection centre","Azimuth of initial line","Angle from Rectified to Skew Grid","Scale factor on initial line","Easting at projection centre","Northing at projection centre","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The following constants for the projection may be calculated :\
+\
+B = (1 + esq * cos^4(latc) / (1 - esq ))^0.5\
+A = a * B * kc *(1 - esq )^0.5 / ( 1 - esq * sin^2(latc))\
+t0 = tan(pi/4 - latc/2) / ((1 - e*sin(latc)) / (1 + e*sin(latc)))^(e/2)\
+D = B (1 - e","","1999-11-15 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.5","EPSG","","99.811",NULL};
+datafile_rows_t trf_method_row_37[] = {"9816","Tunisia Mining Grid","","","Latitude of origin","Longitude of origin","","","","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","This grid is used as the basis for mineral leasing in Tunsia.  Lease areas are approximately 2 x 2 km or 400 hectares.  The corners of these blocks are defined through a six figure grid reference where the first three digits are an easting in [...]
+Latitude = 36.5964 + [(598 - 360) * A].  As N > 360, A = 0.010015.\
+Latitude = 38.97997 grads = 35.08197 degrees.\
+\
+Longitude  = 7.83445 + [(E - 270) * 0.012185, where E = 302.\
+Longitude  = 8.22437 grads east of Paris = 9.73916","1999-11-15 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.8","EPSG","","99.811",NULL};
+datafile_rows_t trf_method_row_38[] = {"9817","Lambert Conic Near-Conformal","","","Latitude of natural origin","Longitude of natural origin","","","Scale factor at natural origin","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","To compute the Lambert Conic Near-Conformal the following formulae are used;\
+\
+E = FE + r sin(theta)\
+N = FN + M + r sin(theta) tan(theta/2) using the natural origin rather than the false origin.\
+\
+Compute constants for the ellipse:\
+\
+n = (a-b)/(a+b)  ","For Projected Coordinate System: Deir ez Zor / Levant Zone\
+\
+Parameters:\
+Ellipsoid  Clarke 1880 (IGN)  a = 6378249.2 m  1/f = 293.46602\
+then b = 6356515.000    n = 0.001706682563\
+\
+Latitude Natural Origin  = 34o 39'00\" N = 0.604756586 rad\
+Longitude Na","1999-11-15 00:00:00","EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.1.1","EPSG","","99.811",NULL};
+datafile_rows_t trf_method_row_39[] = {"9818","American Polyconic","","","Latitude of natural origin","Longitude of natural origin","","","","False easting","False northing","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1999-10-20 00:00:00","US Geological Survey Professional Paper 1395; \"Map Projections - A Working Manual\";  J. Snyder","EPSG","","99.55",NULL};
+
+datafile_rows_t *trf_method_rows[] = {trf_method_row_1,trf_method_row_2,trf_method_row_3,trf_method_row_4,trf_method_row_5,trf_method_row_6,trf_method_row_7,trf_method_row_8,trf_method_row_9,trf_method_row_10,trf_method_row_11,trf_method_row_12,trf_method_row_13,trf_method_row_14,trf_method_row_15,trf_method_row_16,trf_method_row_17,trf_method_row_18,trf_method_row_19,trf_method_row_20,trf_method_row_21,trf_method_row_22,trf_method_row_23,trf_method_row_24,trf_method_row_25,trf_method_ro [...]
diff --git a/src/tiff/csv/trf_method.csv b/src/tiff/csv/trf_method.csv
new file mode 100644
index 0000000..62ef996
--- /dev/null
+++ b/src/tiff/csv/trf_method.csv
@@ -0,0 +1,984 @@
+"COORD_TRF_METHOD_CODE","CTRF_METHOD_EPSG_NAME","CTRF_METHOD_USER_NAME","DESCRIPTION","PARAM_1_NAME","PARAM_2_NAME","PARAM_3_NAME","PARAM_4_NAME","PARAM_5_NAME","PARAM_6_NAME","PARAM_7_NAME","PARAM_8_NAME","PARAM_9_NAME","PARAM_10_NAME","PARAM_11_NAME","PARAM_12_NAME","PARAM_13_NAME","PARAM_14_NAME","PARAM_15_NAME","PARAM_16_NAME","PARAM_17_NAME","PARAM_18_NAME","PARAM_19_NAME","PARAM_20_NAME","PARAM_21_NAME","PARAM_22_NAME","PARAM_23_NAME","PARAM_24_NAME","PARAM_25_NAME","PARAM_26_NAME" [...]
+9601,Longitude rotation,,This transformation allows calculation of coordinates in the target system by adding the parameter value to the coordinate values of the point in the source system.,Longitude rotation,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Lon2 = Lon1 + longitude_rotation.,,1999-11-12 00:00:00,,EPSG,,99.79
+9602,Geodetic/geocentric conversions,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Latitude, P, and Longitude, L, in terms of Geographic Coordinate System (GCS) A may \
+be expressed in terms of a geocentric (earth centred) cartesian coordinate system X, Y, Z \
+with the Z axis corresponding with the Polar axis positive northwards, the X axis through \
+the intersection of the Greenwich meridian and equator, and the Y axis through the \
+intersection of the equator with longitude 90 degrees E. If the GCS's prime meridian is not \
+Greewich, longitudes must first be converted to their Greenwich equivalent. If the earth's \
+spheroidal semi major axis is a, semi minor axis  b, and inverse flattening 1/f,  then\
+\
+   XA=   (nu + hA) cos P cos L\
+   YA=   (nu + hA) cos P sin L\
+   ZA=  ((1 - e^2) nu + hA) sin P\
+\
+where nu is the prime vertical radius of curvature at latitude P and is equal to \
+   nu = a /(1 - e^2*sin^2(P))^0.5,\
+   P and L are respectively the latitude and longitude (related to Greenwich) of the \
+point \
+   h is height above the ellipsoid, (topographic height plus geoidal height), and\
+   e is the eccentricity of the ellipsoid where e^2 = (a^2 -b^2)/a^2 = 2f -f^2\
+                                                                                                                                                   Cartesian coordinates in geocentric coordinate system  B may be used \
+to derive geographical coordinates in terms of geographic coordinate system B by:\
+   P   =  arctan (ZB + e^2* nu*sin P) / (XB^2 + YB^2)^0.5 by iteration\
+   L   = arctan YB/XB\
+   hB  =  XB sec L sec P  - nu\
+\
+where LB is relative to Greenwich. If the geographic system has a non Greenwich prime \
+meridian, the Greenwich value of the local prime meridian should be applied to longitude.\
+\
+(Note that h is the height above the ellipsoid. This is the height value which is \
+delivered by Transit and GPS satellite observations but is not the topographic \
+height value which is normally used for national mapping and levelling operations. \
+The topographic height is usually the height above mean sea level or an alternative \
+level reference for the country. If one starts with a topographic height,  it will be \
+necessary to convert it to an ellipsoid height before using the above transformation \
+formulas. h = N + H, where N is the geoid height above the ellipsoid at the point \
+and is sometimes negative, and H is the height of the point above the geoid. The \
+height above the geoid is often taken to be that above mean sea level, perhaps with \
+a constant correction applied. Geoid heights of points above the nationally used \
+ellipsoid may not be readily available. For the WGS84 ellipsoid the value of N, \
+representing the height of the geoid relative to the ellipsoid, can vary between \
+values of -100m in the Sri Lanka area to +60m in the North Atlantic.)","Consider a North Sea point with coordinates derived by GPS satellite in the WGS84 geographical coordinate system with coordinates of:\
+\
+           latitude    53 deg 48 min 33.82 sec N, \
+           longitude 02 deg 07 min 46.38 sec E, \
+    and ellipsoidal height 73.0m, \
+\
+whose coordinates are required in terms of the ED50 geographical coordinate system which takes the International 1924 ellipsoid. The three parameter datum shift from WGS84 to ED50 for this North Sea area is given as dX = +84.87m, dY = +96.49m, dZ = +116.95m. \
+\
+The WGS84 geographical coordinates convert to the following geocentric values using the above formulas for X, Y, Z:\
+\
+   XA = 3771 793.97m\
+   YA =   140 253.34m\
+   ZA = 5124 304.35m\
+\
+Applying the quoted datum shifts to these, we obtain new geocentric values now related to ED50:\
+\
+   XB = 3771 878.84m\
+   YB =   140 349.83m\
+   ZB = 5124 421.30m\
+\
+These convert to ED50 values on the International 1924 ellipsoid as:\
+           latitude    53 deg 48 min 36.565 sec N, \
+           longitude 02 deg 07 min 51.477 sec E, \
+    and ellipsoidal height 28.02 m, \
+\
+Note that the derived height is referred to the International 1924 ellipsoidal surface and will need a further correction for the height of the geoid at this point in order to relate it to Mean Sea Level.",1996-09-18 00:00:00,"\"Transformation from spatial to geographical coordinates\"; B. R. Bowring; Survey Review number 181; July 1976.",EPSG,,97.29
+9603,Geocentric translations,,,X-axis translation,Y-axis translation,Z-axis translation,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"If  we may assume that the minor axes of the ellipsoids are parallel, then shifts dX, dY, dZ \
+in the sense from datum A to datum B may then be applied as\
+\
+   XB = XA + dX \
+   YB = YA + dY\
+   ZB = ZA + dZ","Given a three parameter datum shift from WGS84 to ED50 for this North Sea area is given as \
+dX = +84.87m, dY = +96.49m, dZ = +116.95m. \
+\
+The WGS84 geographical coordinates convert to the following GS84 geocentric values using \
+the above formulas for X, Y, Z:\
+\
+   XA = 3771 793.97m\
+   YA =   140 253.34m\
+   ZA = 5124 304.35m\
+\
+Applying the given datum shifts to these, we obtain new geocentric values now related \
+to ED50:\
+\
+   XB = 3771 878.84m\
+   YB =   140 349.83m\
+   ZB = 5124 421.30m",1996-09-18 00:00:00,POSC Epicentre 2.2.1,EPSG,,
+9604,Molodenski,,,X-axis translation,Y-axis translation,Z-axis translation,Semi-major axis length difference,Flattening difference,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1996-09-18 00:00:00,,EPSG,,
+9605,Abridged Molodenski,,,X-axis translation,Y-axis translation,Z-axis translation,Semi-major axis length difference,Flattening difference,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"As an alternative to the computation of the new latitude, longitude and height above ellipsoid in discrete steps through geocentric coordinates, the changes in these coordinates may be derived directly by formulas derived by Molodenski. Abridged versions of these formulas, which are quite satisfactory for three parame [...]
+\
+Dlat \" = [(-dX*sin(lat)*cos(lon)) - (dY*sin(lat)*sin(lon)) + (dZ*cos(lat)) + (((a*Df) + (f*Da))*sin(2*lat))] / (rho * sin(1\"))\
+\
+Dlon \" = (-dX*sin(lon) + dY*cos(lon)) / ((nu*cos(lat)) * sin(1\"))\
+\
+Dh = (dX*cos(lat)*cos(lon)) + (dY*cos(lat)*sin(lon)) + (dZ*sin(lat)) + ((a*Df + f*Da)*(sin(lat)^2)) - Da\
+\
+where the dX, dY and dZ terms are as before, and rho and nu are the meridian and prime vertical radii of curvature at the given latitude (lat) on the first ellipsoid (see section 1.4), Da is the difference in the semi-major axes (a1 - a2) of the first and second ellipsoids and Df  is the difference in the flattening of the two ellipsoids.\
+\
+The formulas for Dlat and Dlon indicate changes in latitude and longitude in arc-seconds.",,1999-04-22 00:00:00,,EPSG,,99.01
+9606,Position Vector 7-param. transformation,,,X-axis translation,Y-axis translation,Z-axis translation,X-axis rotation,Y-axis rotation,Z-axis rotation,Scale difference,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Transformation of coordinates from one geographic coordinate system into another (also known as a \"datum transformation\") is usually carried out as an implicit concatenation of three transformations:\
+[geographical to geocentric >> geocentric to geocentric >> geocentric to geographic]\
+\
+The middle part of the concatenated transformation, from geocentric to geocentric, is usually described as a simplified 7-parameter Helmert transformation, expressed in matrix form with 7 parameters, in what is known as the \"Bursa-Wolf\" formula:\
+\
+   (X�)             (  1       -Rz    +Ry)      (X)     (dX)\
+   (Y�)  =  M * ( +Rz     1      -Rx)  *  (Y)  + (dY)\
+   (Z�)              ( -Ry   +Rx       1 )      (Z)      (dZ)\
+\
+The parameters are commonly referred to defining the datum transformation \"from Datum 'A' to Datum 'B'\", whereby (X, Y, Z) are the geocentric coordinates of the point on Datum �A� and (X�, Y�, Z�) are the geocentric coordinates of the point on Datum �B�.  However, that does not define the parameters uniquely; neither is the definition of the parameters implied in the formula, as is often believed.  However, the following definition, which is consistent witth the \"Position Vector Trans [...]
+\
+(dX, dY, dZ)   :Translation vector, to be added to the point's position vector in coordinate system 'A' in order to transform from system 'A' to system 'B'; also: the coordinates of the origin of system 'A' in the 'B' frame.\
+\
+(Rx, Ry, Rz)   :Rotations to be applied to the point's vector.  The sign convention is such that a positive rotation about an axis is defined as a clockwise rotation of the position vector when viewed from the origin of the Cartesian coordinate system in the positive direction of that axis. E.g. a positive rotation about the Z-axis only from system 'A' to system 'B' will result in a larger longitude value for the point in system 'B'.\
+\
+M                  :	The scale correction to be made to the position vector in coordinate system 'A' in order to obtain the correct scale of coordinate system 'B'. M = (1+S*10 6), whereby S is the scale correction expressed in parts per million.  \
+\
+<<<<<This text continues in the description of the Coordinate Frame Rotation formula>>>>>","Input point: \
+Coordinate system: WGS72 (geographic 3D)\
+  Latitude =   55 deg 00 min 00 sec \
+  Longitude =  4 deg 00 min 00 sec \
+  Ellipsoidal height =  0 m\
+This transforms to cartesian geocentric coords:\
+    X = 3 657 660.66 (m)  \
+    Y =    255 768.55 (m)\
+    Z = 5 201 382.11 (m)\
+\
+Transformation parameters WGS72 to WGS84:\
+   dX (m) = 0.000 \
+   dY (m) = 0.000 \
+   dZ (m) = +4.5\
+   RX (\") = 0.000 \
+   RY (\") = 0.000\
+   RZ (\") = +0.554\
+   Scale (ppm) = +0.219\
+\
+Application of the 7 parameter Position Vector Transformation results in WGS 84 coordinates of:\
+   X = 3 657 660.78 (m)\
+   Y =    255 778.43 (m)\
+   Z = 5 201 387.75 (m)\
+This converts into:\
+   Latitude =   55 deg 00 min 00.090 sec\
+   Longitude =  4 deg 00 min 00.554 sec\
+   Ellipsoidal height =  +3.22 m",1996-09-18 00:00:00,,EPSG,,98.16
+9607,Coordinate Frame rotation,,,X-axis translation,Y-axis translation,Z-axis translation,X-axis rotation,Y-axis rotation,Z-axis rotation,Scale difference,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"<<<<<This text is continued from the description of the Position Vector Transformation formula>>>>>\
+\
+Although being common practice in particularly the European E&P industry Position Vector Transformation sign convention is not universally accepted.  A variation on this formula is also used, particularly in the USA E&P industry.  That formula is based on the same definition of translation and scale parameters, but a different definition of the rotation parameters.  The associated convention is known as the \"Coordinate Frame Rotation\" convention. \
+The formula is:\
+\
+   (X�)             (  1      +Rz      -Ry)    (X)      (dX)\
+   (Y�)  =  M * ( -Rz      1      +Rx) * (Y)  +  (dY)\
+   (Z�)              ( +Ry   -Rx        1 )    (Z)       (dZ)\
+\
+and the parameters are defined as:\
+\
+(dX, dY, dZ)   : Translation vector, to be added to the point's position vector in coordinate system 'A' in order to transform from system 'A' to system 'B'; also: the coordinates of the origin of system 'A' in the 'B' frame.\
+\
+(Rx, Ry, Rz)   : Rotations to be applied to the coordinate frame.  The sign convention is such that a positive rotation of the frame about an axis is defined as a clockwise rotation of the coordinate frame when viewed from the origin of the Cartesian coordinate system in the positive direction of that axis, that is a positive rotation about the Z-axis only from system 'A' to system 'B' will result in a smaller longitude value for the point in system 'B'.\
+\
+M                  : The scale factor to be applied to the position vector in coordinate system 'A' in order to obtain the correct scale of coordinate system 'B'. M = (1+S*10 6), whereby S is the scale correction expressed in parts per million.\
+\
+In the absence of rotations the two formulas are identical; the difference is solely in the rotations. The name of the second method reflects this.\
+\
+Note that the same rotation that is defined as positive in the first method is consequently negative in the second and vice versa.  It is therefore crucial that the convention underlying the definition of the rotation parameters is clearly understood and is communicated when exchanging datum transformation parameters, so that the parameters may be associated with the correct coordinate transformation method (algorithm).","The same example as for the Position Vector Transformation can be  [...]
+\
+Transformation parameters Coordinate Frame Rotation convention:\
+dX (m) = 0.000 \
+dY (m) = 0.000 \
+dZ (m) = +4.5 \
+RX (\") = 0.000\
+RY (\") = 0.000\
+RZ (\") = -0.554\
+Scale (ppm) = +0.219\
+\
+Please note that only the rotation has changed sign as compared to the Position Vector Transformation.",1996-09-18 00:00:00,,EPSG,,
+9608,Similarity transform,,,A1,A2 * m,A3 * n,B1,B2 * m,B3 * n,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1996-09-18 00:00:00,,EPSG,,
+9609,2-dimensional Affine transformation,,,A1,A2 * m,A3 * n,B1,B2 * m,B3 * n,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1996-09-18 00:00:00,,EPSG,,
+9610,2nd-order Polynomial function,,,Ordinate 1 of source evaluation point,Ordinate 2 of source evaluation point,Ordinate 1 of target evaluation point,Ordinate 2 of target evaluation point,A1,A2 * m,A3 * n,A4 * mm,A5 * mn,A6 * nn,B1,B2 * m,B3 * n,B4 * mm,B5 * mn,B6 * nn,,,,,,,,,,,,,,,,,,,,,,,,1996-09-18 00:00:00,,EPSG,,
+9611,3rd-order Polynomial function,,,Ordinate 1 of source evaluation point,Ordinate 2 of source evaluation point,Ordinate 1 of target evaluation point,Ordinate 2 of target evaluation point,A1,A2 * m,A3 * n,A4 * mm,A5 * mn,A6 * nn,A7 * mmm,A8 * mmn,A9 * mnn,A10 * nnn,B1,B2 * m,B3 * n,B4 * mm,B5 * mn,B6 * nn,B7 * mmm,B8 * mmn,B9 * mnn,B10 * nnn,,,,,,,,,,,,,,,,1996-09-18 00:00:00,,EPSG,,
+9612,4th-order Polynomial function,,,Ordinate 1 of source evaluation point,Ordinate 2 of source evaluation point,Ordinate 1 of target evaluation point,Ordinate 2 of target evaluation point,A1,A2 * m,A3 * n,A4 * mm,A5 * mn,A6 * nn,A7 * mmm,A8 * mmn,A9 * mnn,A10 * nnn,A11 * mmmm,A12 * mmmn,A13 * mmnn,A14 * mnnn,A15 * nnnn,B1,B2 * m,B3 * n,B4 * mm,B5 * mn,B6 * nn,B7 * mmm,B8 * mmn,B9 * mnn,B10 * nnn,B11 * mmmm,B12 * mmmn,B13 * mmnn,B14 * mnnn,B15 * nnnn,,,,"For TRF_POLYNOMIAL 1000, m=Latitu [...]
+9613,NADCON,,Geodetic transformation operating on geographic coordinate differences by bi-linear interpolation.  Used specifically for some NAD27<->NAD83 transformations in USA.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Latitude difference gridded binary file,Longitude difference gridded binary file,,,,1996-09-18 00:00:00,US Coast and geodetic Survey - http://www.ngs.noaa.gov,EPSG,Input expects longitudes to be positive west.,
+9614,NTv1,,Geodetic transformation operating on geographic coordinate differences by bi-linear interpolation.  Used specifically for some NAD27<->NAD83 transformations in Canada.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Latitude and longitude difference file,,,,,1997-11-13 00:00:00,Geomatics Canada - Geodetic Survey Division.,EPSG,Superceded in 1997 by NTv2 (transformation method code 9615).   Input expects longitudes to be positive west.,
+9615,NTv2,,Geodetic transformation operating on geographic coordinate differences by bi-linear interpolation.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Latitude and longitude difference file,,,,,1997-11-13 00:00:00,http://www.geod.nrcan.gc.ca/products/html-public/GSDapps/English/NTv2_Fact_Sheet.html,EPSG,Supercedes  NTv1 (transformation method code 9614).  Input expects longitudes to be positive west.,
+9616,Vertical Offset,,This transformation allows calculation of ordinate in the target system by adding the parameter value to the ordinate value of the point in the source system.,Vertical offset,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,V2 = [(V1 * U1) + (O12 * Uoff)] * (m / U2) where V2 = value in second vertical coordinate system; V1 = value in first system; O12 is the value of the the origin of system 2 in system 1; m is unit direction multiplier (m=1 if both systems are height or both ar [...]
+9617,Madrid to ED50,,,,,,,A,B,C,D,E,F,G,H,J,,,,,,,,,,,,,,,,,,,,,,,,,"The original geographic coordinate system for the Spanish mainland was based on Madrid 1870 datum, Struve 1860 ellipsoid, with longitudes related to the Madrid meridian.  Three polynomial expressions have been empirically derived by El Servicio Geogr�fico del Ej�rcito to convert geographical coordinates based on this system to equivalent values based on the European Datum of 1950 (ED50).  The polynomial coefficients der [...]
+\
+The polynomial expressions transformations are:\
+\
+      dLat seconds = A + (B*lon) + (C*lat) + (D*h)\
+      dLon seconds =  (E+F) + (G*lon) + (H*lat) + (J*h)\
+\
+where latitude lat and longitude lon are in decimal degrees referred to the Madrid 1870 (Madrid) geographic coordinate system and h in metres.  E is the longitude (in seconds) of the Madrid meridian measured from the Greenwich meridian; it is the value to be applied to a longitude relative to the Madrid meridian to transform it to a longitude relative to the Greenwich meridan.\
+\
+The results of these expressions are applied through the formulae:\
+Lat(ED50) = Lat(M1870(M))  + dLat\
+and Lon(ED50) = Lon(M1870(M))  + dLon.","Input point coordinate system: Madrid 1870 (Madrid) (geographic 3D)\
+   Latitude    =  42 deg 38 min 52.77 sec N = 42.647992 degrees\
+   Longitude  =    3 deg 39 min 34.57 sec E of Madrid	\
+                         = +3.659603 degrees from the Madrid meridian.\
+   Height =  0 m\
+\
+For the north zone transformation:\
+A = 11.3287790\
+B = -0.0385200\
+C = -0.1674000\
+D = 0.0000379\
+E = -13276.58\
+F = 2.5079425\
+G = -0.0086400\
+H = 0.835200\
+J = -0.0000038\
+\
+dLat = +4.05 seconds\
+\
+Then ED50 latitude = 42 deg 38 min 52.77 sec N + 4.05sec\
+= 42 deg 38 min 56.82 sec N\
+\
+\
+dLon = -13270.54 seconds  = -3 deg 41 min 10.54 sec\
+\
+Then ED50 longitude = 3 deg 39 min 34.57 sec E - 3 deg 41 min 10.54 sec\
+= 0 deg 01 min 35.97 sec W of Greenwich.",1999-11-15 00:00:00,Institut de Geomatica; Barcelona,EPSG,,99.284  99.82
+9618,Geographical and Height Offsets,,This transformation allows calculation of coordinates in the target system by adding the parameter value to the coordinate values of the point in the source system.,Latitude offset,Longitude offset,Gravity-related to ellipsoid height,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Lat2 = Lat1 + latitude_offset;  Lon2 = Lon1 + longitude_offset; EllipsoidHeight2 = GravityHeight1 + gravity-related_to_ellipsoid_height.,,1999-11-12 00:00:00,,EPSG,,99.79
+9619,Geographical Offsets,,This transformation allows calculation of coordinates in the target system by adding the parameter value to the coordinate values of the point in the source system.,Latitude offset,Longitude offset,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Lat2 = Lat1 + latitude_offset;  Lon2 = Lon1 + longitude_offset.,,1999-11-12 00:00:00,,EPSG,,99.79
+9620,Norway Offshore Interpolation,,,,,,,,Geod. tfm. code for northern boundary,Geod. tfm. code for southern boundary,,,,,,,,,,,,,,,,,,,,,,,,,,,,Geod. tfm. name for northern boundary,Geod. tfm. name for southern boundary,,,,1999-04-22 00:00:00,"Norwegian Mapping Authority note of 13-Feb-1991 \"Om Transformasjon mellom Geodetiske Datum i Norge\".",EPSG,,
+9801,Lambert Conic Conformal (1SP),,,Latitude of natural origin,Longitude of natural origin,,,Scale factor at natural origin,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"To derive the projected Easting and Northing coordinates of a point with geographical coordinates (lat,lon) the formulas for the one standard parallel case are:\
+\
+E = FE + r sin(theta)\
+N = FN + r0 - r cos(theta)\
+where\
+n = sin lat0\
+r = a F t^n k0     for r0, and r\
+m = cos(lat)/(1 - e^2 sin^2(lat))^0.5     for m0, lat0, and m2, lat2 where lat1 and lat2 are the latitudes of the standard parallels.\
+t  = tan(pi/4 - lat/2)/[(1 - e sin(lat))/(1 + e sin(lat))]^(e/2)   for t0 and t using lat0 and lat respectively.\
+F = m0/(n  t1^n)\
+theta = n(lon - lon0)\
+\
+The reverse formulas to derive the latitude and longitude of a point from its Easting and Northing values are:\
+\
+lat = pi/2 - 2arctan{t'[(1 - esin(lat))/(1 + esin(lat))]^(e/2)}\
+lon = theta'/n +lon0\
+where\
+theta' = arctan[(E - FE)/{r0 -(N - FN)}]\
+r' = +/-[(E - FE)^2 + {r0 - (N - FN)}^2]^0.5\
+t' = (r'/a k0 F)^(1/n)\
+and n, F, and rF are derived as for the forward calculation.","For Projected Coordinate System JAD69 / Jamaica National Grid\
+\
+Parameters:\
+Ellipsoid:  Clarke 1866, a = 6378206.400 m., 1/f = 294.97870\
+                                   then  e = 0.08227185 and e^2 = 0.00676866\
+\
+Latitude Natural Origin         18 deg 00 min 00 sec N  =  0.31415927 rad\
+Longitude Natural Origin     77 deg 00 min 00 sec W = -1.34390352 rad\
+Scale factor at origin            1.000000\
+False Eastings  FE               250000.00 m\
+False Northings FN              150000.00 m\
+\
+Forward calculation for: \
+Latitude:     17 deg 55 min 55.80 sec N  =  0.31297535 rad\
+Longitude:  76 deg 56 min 37.26 sec W = -1.34292061 rad\
+first gives\
+m0    =  0.95136402        t0 =  0.72806411\
+F       =  3.39591092        n  =  0.30901699\
+r        =  19643955.26     r0  =  19636447.86\
+theta =  0.00030374        t   =  0.728965259\
+\
+Then Easting E   =     255966.58 m\
+         Northing N =      142493.51 m\
+\
+Reverse calculation for the same easting and northing first gives\
+\
+theta' =  0.000303736\
+t'        =  0.728965259\
+m0     =  0.95136402\
+r'        =  19643955.26\
+\
+Then Latitude     = 17 deg 55 min 55.800 sec N\
+         Longitude  = 76 deg 56 min 37.260 sec W",1996-09-18 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.1",EPSG,,
+9802,Lambert Conic Conformal (2SP),,,Latitude of false origin,Longitude of false origin,Latitude of 1st standard parallel,Latitude of 2nd standard parallel,,Easting at false origin,Northing at false origin,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"To derive the projected Easting and Northing coordinates of a point with geographical coordinates (lat,lon) the formulas for the one standard parallel case are:\
+\
+E = EF + r sin(theta)\
+N = NF + rF - r cos(theta)\
+where\
+m = cos(lat)/(1 - e^2 sin^2(lat))^0.5     for m1, lat1, and m2, lat2 where lat1 and lat2 are the latitudes of the standard parallels.\
+t  = tan(pi/4 - lat/2)/[(1 - e sin(lat))/(1 + e sin(lat))]^(e/2)   for t1, t2, tF and t using lat1, lat2, latF and lat respectively.\
+n = (loge(m1) - loge(m2))/(loge(t1) - loge(t2))\
+F = m1/(n  t1^n)\
+r =  a F t^n         for rF and r, where rF is the radius of the parallel of latitude of the false origin.\
+theta = n(lon - lon0)\
+\
+The reverse formulas to derive the latitude and longitude of a point from its Easting and Northing values are:\
+\
+lat = pi/2 - 2arctan{t'[(1 - esin(lat))/(1 + esin(lat))]^(e/2)}\
+lon = theta'/n +lon0\
+where\
+r' = +/-[(E - EF)^2 + {rF - (N - NF)}^2]^0.5 , taking the sign of n\
+t' = (r'/aF)^(1/n)\
+theta' = arctan [(E- EF)/(rF - (N- NF))]\
+and n, F, and rF are derived as for the forward calculation.","For Projected Coordinate System NAD27 / Texas South Central\
+\
+Parameters:\
+Ellipsoid  Clarke 1866, a = 6378206.400 metres = 20925832.16 US survey feet\
+                                   1/f = 294.97870\
+then e = 0.08227185 and e^2 = 0.00676866\
+\
+First Standard Parallel          28o23'00\"N  =   0.49538262 rad\
+Second Standard Parallel    30o17'00\"N  =   0.52854388 rad\
+Latitude False Origin            27o50'00\"N  =   0.48578331 rad\
+Longitude False Origin         99o00'00\"W = -1.72787596 rad\
+Easting at false origin           2000000.00  US survey feet\
+Northing at false origin          0.00  US survey feet\
+\
+Forward calculation for: \
+Latitude       28o30'00.00\"N  =  0.49741884 rad\
+Longitude    96o00'00.00\"W = -1.67551608 rad\
+\
+first gives :\
+m1    = 0.88046050      m2 = 0.86428642\
+t        = 0.59686306      tF  = 0.60475101\
+t1      = 0.59823957      t2 = 0.57602212\
+n       = 0.48991263       F = 2.31154807\
+r        = 37565039.86    rF = 37807441.20\
+theta = 0.02565177\
+\
+Then Easting E =      2963503.91 US survey feet\
+         Northing N =      254759.80 US survey feet\
+\
+Reverse calculation for same easting and northing first gives:\
+theta' = 0.025651765     r' = 37565039.86\
+t'        = 0.59686306\
+\
+Then Latitude     	= 28o30'00.000\"N\
+         Longitude   = 96o00'00.000\"W",1999-04-22 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.1",EPSG,,99.281
+9803,Lambert Conic Conformal (2SP Belgium),,,Latitude of false origin,Longitude of false origin,Latitude of 1st standard parallel,Latitude of 2nd standard parallel,,Easting at false origin,Northing at false origin,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Since 1972 a modified form of the two standard parallel case has been used in Belgium.  For the Lambert Conic Conformal (2 SP Belgium), the formulas for the standard two standard parallel case are used except for: \
+Easting, E = EF + r sin (theta - alpha)\
+Northing, N = NF + rF - r cos (theta - alpha)\
+and for the reverse formulas\
+lon = ((theta' + alpha)/n) +lon0\
+where alpha = 29.2985 seconds.","For Projected Coordinate System Belge l972 / Belge Lambert 72\
+\
+Parameters:\
+Ellipsoid  International 1924,  a = 6378388 metres\
+                                              1/f = 297\
+then e = 0.08199189 and e^2 = 0.006722670\
+\
+First Standard Parallel        49o50'00\"N       =   0.86975574 rad\
+Second Standard Parallel  51o10'00\"N       =   0.89302680 rad\
+Latitude False Origin          90o00'00\"N       =   1.57079633 rad\
+Longitude False Origin         4o21'24.983\"E = 0.07604294 rad\
+Easting at false origin EF        150000.01  metres\
+Northing at false origin NF    5400088.44  metres\
+\
+Forward calculation for: \
+Latitude        50o40'46.461\"N  =  0.88452540 rad\
+Longitude       5o48'26.533\"E   = 0.10135773 rad\
+\
+first gives :\
+m1     = 0.64628304         m2 = 0.62834001\
+t        = 0.59686306          tF  = 0.00000000\
+t1      = 0.36750382           t2 = 0.35433583\
+n       = 0.77164219            F = 1.81329763\
+r        = 37565039.86         rF = 0.00\
+alpha =	0.00014204     theta = 0.01953396\
+\
+Then Easting E  =      251763.20 metres\
+         Northing N =      153034.13 metres\
+\
+Reverse calculation for same easting and northing first gives:\
+theta' = 0.01939192      r' = 548041.03\
+t' = 0.35913403\
+Then Latitude   =    50o40'46.461\"N\
+         Longitude =     5o48'26.533\"E",1999-04-22 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.1",EPSG,,99.281
+9804,Mercator (1SP),,,Latitude of natural origin,Longitude of natural origin,,,Scale factor at natural origin,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"The formulas to derive projected Easting and Northing coordinates are:\
+\
+E = FE + a*k0(lon - lon0)              \
+N = FN + a*k0* ln{tan(pi/4 + lat/2)[(1 - esin(lat))(1 + esin(lat))]^e/2} where symbols are as listed above and logarithms are natural.\
+\
+The reverse formulas to derive latitude and longitude from E and N values are:\
+\
+lat = chi + (esq/2 + 5e^4/24 + e^6/12 + 13e^8/360) sin(2chi) \
++ (7e^4/48 + 29e^6/240 + 811e^8/11520) sin(4chi)\
++ (7e^6/120 +  81e^8/1120) sin(6chi)  + (4279e^8/161280) sin(8chi)\
+\
+where chi = pi/2 - 2 arctan t\
+t = B^((FN-N)/a*k0) \
+B = base of the natural logarithm, 2.7182818...\
+and  for the 2 SP Case, k0 is calculated as for the forward transformation above.\
+lon  =  ((E - FE)/a*k0)  + lon0","For Projected Coordinate System Makassar / NEIEZ\
+\
+Parameters:\
+Ellipsoid   Bessel 1841  a = 6377397.155 m   1/f = 299.15281\
+then e = 0.08169683\
+\
+Latitude Natural Origin         00o00'00\"N  = 0.0000000 rad\
+Longitude Natural Origin    110o00'00\"E  = 1.91986218 rad\
+Scale factor ko                  0.997\
+False Eastings FE              3900000.00 m\
+False Northings FN              900000.00 m\
+\
+Forward calculation for: \
+Latitude            3o00'00.00\"S   = -0.05235988 rad\
+Longitude     120o00'00.00\"E   =  2.09439510 rad\
+gives\
+Easting  E   =      5009726.58 m\
+Northing N  =        569150.82 m\
+\
+Reverse calculation for same easting and northing first gives :\
+t    = 1.0534121\
+chi = -0.0520110\
+\
+Then Latitude     =   3o00'00.000\"S\
+         Longitude  = 120o00'00.000\"E",1996-09-18 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.2",EPSG,,
+9805,Mercator (2SP),,,Latitude of 1st standard parallel,Longitude of natural origin,,,,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"The formulas to derive projected Easting and Northing coordinates are:\
+\
+For the two standard parallel case, k0 is first calculated from\
+\
+k0 = cos(latSP1)/(1 - e^2*sin^2(latSP1))^0.5 \
+ \
+where latSP1 is the absolute value of the first standard parallel (i.e. positive).  \
+\
+Then, for both one and two standard parallel cases, \
+\
+E = FE + a*k0(lon - lon0)              \
+N = FN + a*k0* ln{tan(pi/4 + lat/2)[(1 - esin(lat))(1 + esin(lat))]^e/2} where symbols are as listed above and logarithms are natural.\
+\
+The reverse formulas to derive latitude and longitude from E and N values are:\
+\
+lat = chi + (esq/2 + 5e^4/24 + e^6/12 + 13e^8/360) sin(2chi) \
++ (7e^4/48 + 29e^6/240 + 811e^8/11520) sin(4chi)\
++ (7e^6/120 +  81e^8/1120) sin(6chi)  + (4279e^8/161280) sin(8chi)\
+\
+where chi = pi/2 - 2 arctan t\
+t = B^((FN-N)/a*k0) \
+B = base of the natural logarithm, 2.7182818...\
+and  for the 2 SP Case, k0 is calculated as for the forward transformation above.\
+lon  =  ((E - FE)/a*k0)  + lon0","For Projected Coordinate System Pulkovo 1942 / Mercator Caspian Sea\
+\
+Parameters:\
+Ellipsoid  Krassowski 1940   a = 6378245.00m   1/f = 298.300\
+then e = 0.08181333 and e^2 = 0.00669342\
+\
+Latitude first SP                             42o00'00\"N = 0.73303829 rad\
+Longitude Natural Origin                51o00'00\"E = 0.89011792 rad\
+False Eastings FE                          0.00 m\
+False Northings (at equator) FN     0.00 m\
+  \
+then natural origin at latitude of 0oN has scale factor k0=  0.74426089\
+\
+Forward calculation for: \
+Latitude        53o00'00.00\"N = 0.9250245 rad\
+Longitude     53o00'00.00\"E  = 0.9250245 rad\
+\
+gives Easting E   =     165704.29 m \
+          Northing N =   5171848.07 m\
+\
+Reverse calculation for same easting and northing first gives :\
+t = 0.33639129    chi = 0.92179596\
+\
+Then Latitude     =  53o00'00.000\"N\
+          Longitude  =  53o00'00.000\"E",1996-09-18 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.2",EPSG,,
+9806,Cassini-Soldner,,,Latitude of natural origin,Longitude of natural origin,,,,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"The formulas to derive projected Easting and Northing coordinates are:\
+\
+Easting E = FE + nu[A - TA^3/6 -(8 - T + 8C)TA^5/120]\
+\
+Northing N = FN + M - M0 + nu*tan(lat)*[A^2/2 + (5 - T + 6C)A^4/24]\
+\
+where A = (lon - lon0)cos(lat)\
+T = tan^2(lat)\
+C = e2 cos2*/(1 - e2)        nu = a /(1 - esq*sin^2(lat))^0.5 \
+and M, the distance along the meridian from equator to latitude lat, is given by\
+M = a[1 - e^2/4 - 3e^4/64 - 5e^6/256 -....)*lat - (3e^2/8 + 3e^4/32 + 45e^6/1024 +....)sin(2*lat) + (15e^4/256 + 45e^6/1024 +.....)sin(4*lat) - (35e^6/3072 + ....)sin(6*lat) + .....]\
+with lat in radians.\
+\
+M0 is the value of M calculated for the latitude of the chosen origin. This may not necessarily be chosen as the equator.\
+\
+To compute latitude and longitude from Easting and Northing the reverse formulas are:\
+lat = lat1 - (nu1tan(lat1)/rho1)[D2/2 - (1 + 3*T1)D^4/24]\
+lon =  lon0 + [D - T1*D^3/3 + (1 + 3*T1)T1*D^5/15]/cos(lat1)\
+\
+where lat1 is the latitude of the point on the central meridian which has the same Northing as the point whose coordinates are sought, and is found from:\
+lat1 = mu1 + (3*e1/2 - 27*e1^3/32 +.....)sin(2*mu1) + (21*e1^2/16 - 55*e1^4/32 + ....)sin(4*mu1)+ (151*e1^3/96 +.....)sin(6*mu1) + (1097*e1^4/512 - ....)sin(8*mu1) + ......\
+where\
+e1 = [1- (1 - esq)^0.5]/[1 + (1 - esq)^0.5]\
+mu1 = M1/[a(1 - esq/4 - 3e^4/64 - 5e^6/256 - ....)]\
+M1 = M0 + (N - FN)\
+T1 = tan^2(lat1)\
+D = (E - FE)/nu1","For Projected Coordinate System Trinidad 1903 / Trinidad Grid \
+Parameters:\
+Ellipsoid   Clarke 1858     a = 20926348 ft    = 31706587.88 links\
+                                        b = 20855233 ft\
+\
+then 1/f = 294.97870 and e^2 = 0.00676866\
+\
+Latitude Natural Origin       10o26'30\"N  =  0.182241463 rad\
+Longitude Natural Origin    61o20'00\"W = -1.07046861 rad\
+False Eastings FE              430000.00 links\
+False Northings FN            325000.00 links\
+\
+Forward calculation for: \
+Latitude       10o00'00.00\" N = 0.17453293 rad\
+Longitude    62o00'00.00\"W = -1.08210414 rad\
+\
+A = -0.01145876      C = 0.00662550\
+T = 0.03109120      M = 5496860.24    nu = 31709831.92     M0 = 5739691.12\
+\
+Then Easting E    =  66644.94 links\
+          Northing N =  82536.22 links\
+\
+Reverse calculation for same easting and northing first gives :\
+e1    =   0.00170207       D  =     -0.01145875\
+T1   = 0.03109544         M1 =      5497227.34\
+nu1  = 31709832.34       mu1 =    0.17367306\
+phi1 = 0.17454458         rho1 =    31501122.40\
+\
+\
+Then Latitude     = 10o00'00.000\"N\
+         Longitude  =  62o00'00.000\"W",1996-09-18 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.3",EPSG,,
+9807,Transverse Mercator,,,Latitude of natural origin,Longitude of natural origin,,,Scale factor at natural origin,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"The formulas to derive the projected Easting and Northing coordinates are in the form of a series as follows:\
+\
+Easting, E =  FE + k0*nu[A + (1 - T + C)A^3/6 + (5 - 18T + T^2 + 72C - 58e'sq)A^5/120]	\
+\
+Northing, N =  FN + k0{M - M0 + nu*tan(lat)[A^2/2 + (5 - T + 9C + 4C^2)A^4/24 + (61 - 58T + T^2 + 600C - 330e'sq)A^6/720]} \
+where T = tan^2(lat)                nu = a /(1 - esq*sin^2(lat))^0.5\
+C = esq*cos^2(lat)/(1 - esq)\
+A = (lon - lon0)cos(lat), with lon and lon0 in radians.\
+M = a[(1 - esq/4 - 3e^4/64 - 5e^6/256 -....)lat - (3esq/8 + 3e^4/32 + 45e^6/1024+....)sin(2*lat) + (15e^4/256 + 45e^6/1024 +.....)sin(4*lat) - (35e^6/3072 + ....)sin(6*lat) + .....]\
+with lat in radians and M0 for lat0, the latitude of the origin, derived in the same way.\
+\
+The reverse formulas to convert Easting and Northing projected coordinates to latitude and longitude are:\
+\
+lat = lat1 - (nu1*tan(lat1)/rho1)[D^2/2 - (5 + 3*T1 + 10*C1 - 4*C1^2 - 9*e'^2)D^4/24 + (61 + 90*T1 + 298*C1 + 45*T1^2 - 252*e'^2 - 3*C1^2)D^6/720]\
+lon = lon0 + [D - (1 + 2*T1 + C1)D^3/6 + (5 - 2*C1 + 28*T1 - 3*C1^2 + 8*e'^2 + 24*T1^2)D^5/120] / cos(lat1)\
+where lat1 may be found as for the Cassini projection from:\
+\
+lat1 = mu1 + ((3*e1)/2 - 27*e1^3/32 +.....)sin(2*lat1) + (21*e1^2/16 -55*e1^4/32 + ....)sin(4*lat1)+ (151*e1^3/96 +.....)sin(6*lat1) + (1097*e1^4/512 - ....)sin(8*lat1) + ......\
+and where  nu1 = a /(1 - esq*sin^2(lat1))^0.5                                     rho1 = a(1 - esq)/(1 - esq*sin^2(lat1))^1.5\
+e1 = [1- (1 - esq)^0.5]/[1 + (1 - esq)^0.5]\
+mu1 = M1/[a(1 - esq/4 - 3e^4/64 - 5e^6/256 - ....)]\
+M1 = M0 + (N - FN)/k0\
+T1 = tan^2(lat1)\
+C1 = e'^2*cos^2(lat1)\
+D = (E - FE)/(nu1*k0), with nu1 = nu for lat1\
+\
+For areas south of the equator the value of latitude lat will be negative and the formulas above, to compute the E and N,  will automatically result in the correct values. Note that the false northings of the origin, if the equator, will need to be large to avoid negative northings and for the UTM projection is in fact 10,000,000m. Alternatively, as in the case of Argentina's Transverse Mercator (Gauss-Kruger) zones, the origin is at the south pole with a northings of zero. However each  [...]
+different zones having the same eastings, every point in the country, irrespective of its projection zone, will have a unique set of projected system coordinates. Strict application of the above formulas, with south latitudes negative, will result in the derivation of the correct Eastings and Northings. \
+\
+Similarly, in applying the reverse formulas to determine a latitude south of the equator, a negative sign for lat results from a negative lat1 which in turn results from a negative M1.","For Projected Coordinate System OSGB 1936 / British National Grid\
+\
+Parameters:\
+Ellipsoid  Airy 1830  a = 6377563.396 m  1/f = 299.32496\
+then e'^2 = 0.00671534 and e^2 = 0.00667054\
+\
+Latitude Natural Origin         49o00'00\"N   = 0.85521133 rad\
+Longitude Natural Origin        2o00'00\"W  = -0.03490659 rad\
+Scale factor ko                     0.9996013                                                                                              False Eastings FE                 400000.00 m\
+False Northings FN              -100000.00 m\
+\
+Forward calculation for: \
+Latitude       50o30'00.00\"N  = 0.88139127 rad\
+Longitude    00o30'00.00\"E  = 0.00872665 rad\
+A  = 0.02775415       C = 0.00271699\
+T =  1.47160434       M = 5596050.46\
+M0 = 5429228.60     nu  = 6390266.03\
+\
+Then Easting E =        577274.99 m\
+          Northing N =       69740.50 m\
+\
+Reverse calculations for same easting and northing first gives :\
+e1 =    0.00167322      mu1 = 0.87939562\
+M1 = 5599036.80        nu1 = 6390275.88\
+phi1  = 0.88185987      D = 0.02775243\
+rho1 =6372980.21       C1 =  0.00271391\
+T1 = 1.47441726\
+\
+Then Latitude       = 50o30'00.000\"N\
+         Longitude    = 00o30'00.000\"E",1996-09-18 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.4",EPSG,,
+9808,Transverse Mercator (South Orientated),,,Latitude of natural origin,Longitude of natural origin,,,Scale factor at natural origin,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"For the mapping of southern Africa a south oriented Transverse Mercator projection is used. Here the coordinate axes are called Westings and Southings and increment to the West and South from the origin respectively.  The Transverse Mercator formulas need to \
+be modified to cope with this arrangement with\
+\
+Westing, W = k0 nu[A + (1 - T + C)A^3/6 + (5 - 18*T + T^2 + 72*C - 58*e'^2)A^5/120] - FE\
+\
+Southing, S = k0{M - M0 + nu*tan(lat)*[A^2/2 + (5 - T + 9*C + 4*C^2)A^4/24 + (61 - 58*T + T^2 + 600*C - 330*e'^2)A^6/720]}- FN\
+\
+In these formulas the terms FE and FN have been retained for consistency of the terminology.  For the reverse formulas, those for the standard Transverse Mercator above apply, with the exception that:\
+\
+M1 = M0 + (S + FN)/k0\
+and D = (W + FE)/(nu1*k0), with nu1 = nu for lat1",,1996-09-18 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.4",EPSG,,
+9809,Oblique Stereographic,,,Latitude of natural origin,Longitude of natural origin,,,Scale factor at natural origin,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"The coordinate transformation from geographical to projected coordinates is executed via the distance and azimuth of the point from the centre point or origin. For a sphere the formulas are relatively simple. For the ellipsoid the parameters defining the conformal sphere at the tangent point as origin are first de [...]
+\
+Oblique and Equatorial Stereographic Formula\
+\
+Given the geodetic origin of the projection at the tangent point (lat0, lon0), the parameters defining the conformal sphere are:\
+\
+R= sqrt( rho0 * nu0)\
+n=  sqrt{1+[(e2*cos^4(lat0))/(1-e2)}\
+c=  [(n+sin(lat0)) (1-sin(chi0))]/[(n-sin(lat0)) (1+sin(chi0))]\
+\
+where:	sin(chi0) = (w1-1)/(w1+1)\
+w1 = (S1.(S2)^e)^n\
+S1 = (1+sin(lat0))/(1-sin(lat0))\
+S2 = (1-e sin(lat0))/(1+e sin(lat0))\
+\
+The conformal latitude and longitude (chi0,lambda0) of the origin are then computed from :\
+\
+chi0 = asin[(w2-1)/(w2+1)]\
+\
+where S1 and S2 are as above and  w2 = c (S1(S2)^e)^n\
+ \
+lambda0  = lon0\
+\
+For any point with geodetic coordinates (lat, lon) the equivalent conformal latitude and longitude (chi, lambda) are computed from \
+lambda = n(lon-lambda0) + lambda0\
+chi = asin[(w-1)/(w+1)]\
+\
+where w = c (Ss (Sb)^e)^n\
+Sa = (1+sin(lat))/(1-sin(lat))\
+Sb = (1-e.sin(lat))/(1+e.sin(lat))\
+ \
+Then B = [1+sin(chi) sin(chi0) + cos(chi) cos(chi0) cos(lambda-lambda0)]\
+\
+N = FN + 2 R k0 [sin(chi) cos(chi0) - cos(chi) sin(chi0) cos(lambda-lambda0)] / B\
+\
+E = FE + 2 R k0 cos(chi) sin(lambda-lambda0) / B\
+\
+\
+The reverse formulae to compute the geodetic coordinates from the grid coordinates involves computing the conformal values, then the isometric latitude and finally the geodetic values.\
+\
+The parameters of the conformal sphere and conformal latitude and longitude at the origin are computed as above. Then for any point with Stereographic grid coordinates (E,N) :\
+\
+chi = chi0 + 2 atan[{(N-FN)-(E-FE) tan (j/2)} / (2 R k0)]\
+\
+lambda = j + 2 i + lambda0\
+\
+where g = 2 R k0 tan(pi/4 - chi0/2)\
+h = 4 R k0 tan(chi0) + g\
+i = atan[(E-FE) / {h+(N-FN)}]\
+j = atan[(E-FE) / (g-(N-FN)] - i\
+\
+Geodetic longitude lon = (lambda-lambda0 ) / n +  lambda0\
+\
+Isometric latitude psi = 0.5 ln [(1+ sin(chi)) / { c (1-  sin(chi))}] / n\
+\
+First approximation lat1 = 2 atan(e^psi)  - pi/2  where e=base of natural logarithms.\
+\
+psii = isometric latitude at lati\
+\
+where psii= ln[{tan(lati/2 + pi/4}  {(1-e sin(lati))/(1+e sin(lati))}^(e/2)]\
+ \
+Then iterate lat(i+1) = lati - ( psii - psi ) cos(lati) (1 -e^2 sin^2(lati)) / (1 - e^2)\
+\
+until the change in lat is sufficiently small.\
+\
+\
+For Oblique Stereographic projections centred on points in the southern hemisphere,  the signs of E, N, lon0, lon,  must be reversed to be used in the equations and lat will be negative anyway as a southerly latitude.\
+\
+An alternative approach is given by Snyder, where, instead of defining a single conformal sphere at the origin point, the conformal latitude at each point on the ellipsoid is computed. The conformal longitude is then always equivalent to the geodetic longitude. This approach is a valid alternative to the above, but gives slightly different results away from the origin point.  It is therefore considered to be a different projection method.","For Projected Coordinate System RD / Netherlands New\
+\
+Parameters:\
+Ellipsoid   Bessel 1841    a = 6377397.155 m    1/f = 299.15281\
+then e = 0.08169683\
+\
+Latitude Natural Origin      52o09'22.178\"N  = 0.910296727 rad\
+Longitude Natural Origin     5o23'15.500\"E  =  0.094032038 rad\
+Scale factor k0                 0.9999079\
+False Eastings FE             155000.00 m\
+False Northings FN           463000.00 m\
+\
+Forward calculation for: \
+\
+Latitude    53oN = 0.925024504 rad\
+Longitude   6oE = 0.104719755 rad\
+\
+first gives the conformal sphere constants:\
+\
+rho0 = 6374588.71    nu0 = 6390710.613\
+R = 6382644.571    n = 1.000475857    c  = 1.007576465\
+\
+where S1 = 8.509582274  S2 = 0.878790173  w1 = 8.428769183\
+sin chi0 = 0.787883237\
+\
+w   = 8.492629457   chi0 = 0.909684757      D0 = d0 \
+\
+for the point  chi  = 0.924394997    D = 0.104724841\
+\
+hence B = 1.999870665    N = 557057.739    E = 196105.283\
+\
+reverse calculation for the same Easting and Northing first gives:\
+\
+g = 4379954.188    h = 37197327.96   i = 0.001102255   j = 0.008488122\
+\
+then  D = 0.10472467  Longitude = 0.104719584 rad =  6 deg E\
+\
+chi  = 0.924394767    psi = 1.089495123\
+phi1 = 0.921804948       psi1 = 1.084170164\
+phi2 = 0.925031162       psi2 = 1.089506925\
+phi3 = 0.925024504       psi3 = 1.089495505\
+phi4 = 0.925024504\
+\
+Then Latitude      = 53o00'00.000\"N\
+          Longitude   =   6o00'00.000\"E",1999-11-15 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.6",EPSG,,99.811
+9810,Polar Stereographic,,,Latitude of natural origin,Longitude of natural origin,,,Scale factor at natural origin,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"For the forward transformation from latitude and longitude,\
+\
+E = FE + rho sin(lon - lon0)\
+N = FN - rho cos(lon - lon0)\
+where\
+rho = 2 a ko t /{[((1+e)^(1+e)) ((1-e)^(1-e))]^0.5}\
+t = tan (pi/4 - lat/2) / [(1-esin(lat) ) / (1 + e sin(lat))]^(e/2)\
+\
+For the reverse transformation,\
+\
+lat = chi+ (e^2/2 + 5e^4/24 + e^6/12 + 13e^8/360) sin(2 chi) \
++ (7e^4/48 + 29e^6/240 + 811e^8/11520) sin(4 chi)\
++ (7e^6/120 +  81e^8/1120) sin(6 chi)  + (4279e^8/161280) sin(8 chi)\
+\
+lon = lon0+ arctan [(E-FE) / (FN-N)]\
+\
+where chi  = pi/2 - 2 arctan t\
+t   =  rho [((1+e)^(1+e)) ((1-e)^(1-e))]^0.5} / 2 a ko\
+rho = [(E-FE)^2  + (N - FN)^2]^0.5",,1996-09-18 00:00:00,"US Geological Survey Professional Paper 1395; \"Map Projections - A Working Manual\";  J. Snyder",EPSG,,
+9811,New Zealand Map Grid,,,Latitude of natural origin,Longitude of natural origin,,,,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1996-09-18 00:00:00,New Zealand Department of Lands technical circular 1973/32,EPSG,,
+9812,Hotine Oblique Mercator,,,Latitude of projection centre,Longitude of projection centre,Azimuth of initial line,Angle from Rectified to Skew Grid,Scale factor on initial line,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"The following constants for the projection may be calculated :\
+\
+B = (1 + esq * cos^4(latc) / (1 - esq ))^0.5\
+A = a * B * kc *(1 - esq )^0.5 / ( 1 - esq * sin^2(latc))\
+t0 = tan(pi/4 - latc/2) / ((1 - e*sin(latc)) / (1 + e*sin(latc)))^(e/2)\
+D = B (1 - esq)^0.5  / (cos(latc) * ( 1 - esq*sin^2(latc))^0.5)\
+if D < 1 to avoid problems with computation of F make D^2  = 1 \
+F = D + (D^2 - 1)^0.5  * SIGN(latc)\
+H = F* t0*B\
+G = (F - 1/F) / 2\
+gamma0 = asin(sin(alphac) / D)\
+lon0 = lonc - (asin(G*tan(gamma0))) / B\
+\
+Then compute the (uc , vc) co-ordinates for the centre point (fc , lc).\
+vc =0\
+In general: uc = (A / B) atan((Dsq - 1)^0.5 / cos (alphac) ) * SIGN(latc)\
+\
+but for the special cases where alphac = 90 degrees (e.g. Hungary, Switzerland) then \
+uc = A*(lonc - lon0)  \
+\
+ \
+Forward case: To compute (E,N) from a given (lat,lon) :\
+\
+t = tan(pi/4 - lat/2) / ((1 - e sin (lat)) / (1 + e sin (lat)))^(e/2)\
+Q = H / t^B\
+S = (Q - 1 / Q) / 2\
+T = (Q + 1 / Q) / 2\
+V = sin(B (lon - lon0))\
+U = (- V cos(gamma0) + S sin(gamma0)) / T\
+v = A ln((1 - U) / (1 + U)) / 2 B\
+u = A atan((S cos(gamma0) + V sin(gamma0)) / cos(B (lon - lon0 ))) / B\
+\
+\
+The rectified skew co-ordinates are then derived from:\
+\
+E = v cos(gammac) + u sin(gammac) + FE\
+N = u cos(gammac) - v sin(gammac) + FN\
+\
+Reverse case: Compute (lat,lon)  from a given (E,N)  :\
+\
+v� = (E - FE) cos(gammac) - (N - FN) sin(gammac)\
+u� = (N - FN) cos(gammac) + (E - FE) sin(gammac)\
+\
+Q� = e- (B v �/ A)  where e is the base of natural logarithms.\
+S' = (Q� - 1 / Q�) / 2\
+T� = (Q� + 1 / Q�) / 2\
+V� = sin (B u� / A)\
+U� = (V� cos(gammac) + S� sin(gammac)) / T�\
+t� = (H / ((1 + U�) / (1 - U�))^0.5)^(1 / B)\
+\
+chi = pi / 2 - 2 atan(t�)\
+\
+lat = chi + sin(2chi).( e^2 / 2 + 5*e^4 / 24 + e^6 / 12 + 13*e^8 / 360) +  sin(4*chi).( 7*e^4 /48 + 29*e^6 / 240 + 811*e8 / 11520) +  sin(6chi).( 7*e^6 / 120 + 81*e8 / 1120) +  sin(8chi).(4279 e^8 / 161280)\
+\
+lon=  lon0  - atan ((S� cos(gammac) - V� sin(gammac)) / cos(B*u� / A)) / B","For Projected Coordinate System  Timbalai 1948 / R.S.O. Borneo (m)\
+\
+Parameters:\
+	Ellipsoid:  Everest 1830 (1967 Definition)\
+				a = 6377298.556 metres 	1/f = 300.8017\
+				then	e = 0.081472981	e2 = 0.006637847\
+					\
+	Latitude Projection Centre	fc  	4o00'00\"N		=	0.069813170 rad\
+	Longitude Projection Centre	lc  	115o00'00\"E	=	2.007128640 rad\
+	Azimuth of central line	ac	53o18'56.9537\"	=	0.930536611 rad\
+	Rectified to skew	gc	53o07'48.3685\"	=	0.927295218 rad\
+	Scale factor	ko	 0.99984\
+	False Eastings	FE	 0.00 m\
+	False Northings	FN	 0.00 m\
+\
+Forward calculation for: \
+	Latitude		f	4o39'20.783\"N		=	0.081258569 rad\
+	Longitude		l	114o28'10.539\"E	=	1.997871312 rad\
+		\
+B = 	1.003303209		F =	1.07212156\
+A =	6376278.686		H = 	1.00000299\
+		to = 	0.932946976		g0 = 	0.92729522\
+		D = 	1.002425787		l0 = 	1.91437347\
+		D2 =	1.004857458\
+	\
+		uc =	738096.09		vc =	0.00\
+		t =	0.922369529		Q =	1.084456854\
+		S =	0.081168129		T = 	1.003288725\
+		V =	0.83675700		U =	0.014680803\
+		v =	-93307.40		u =	734236.558\
+						u-uc =	-3859.536\
+\
+	Then	Easting		E =  	531404.81 m\
+		Northing	N =      515187.85 m\
+\
+Reverse calculations for same easting and northing first gives :\
+		v� =   	-93307.40		u� =	734236.558\
+		u�+uc = 1472332.652		Q� =	1.014790165\
+		S�  =	0.014682385		T� =	1.000107780	\
+		V� =	0.115274794		U� = 	0.080902065\
+		t� = 	0.922369529		c =	0.080721539		\
+				\
+Then	Latitude    	 f  =	4o39'20.783\"N		\
+	Longitude	l   =	114o28'10.539\"E",1999-11-15 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.5",EPSG,,97.62  99.811
+9813,Laborde Oblique Mercator,,,Latitude of projection centre,Longitude of projection centre,Azimuth of initial line,,Scale factor on initial line,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1996-09-18 00:00:00,"\"La nouvelle projection du Service Geographique de Madagascar\"; J. Laborde; 1928",EPSG,Can be accomodated by Oblique Mercator method (code 9815).,97.613
+9814,Swiss Oblique Cylindrical,,,Latitude of projection centre,Longitude of projection centre,,,,Easting at projection centre,Northing at projection centre,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1996-09-18 00:00:00,"\"Die projecktionen der Schweizerischen Plan und Kartenwerke\"; J Bollinger; 1967",EPSG,Can be accomodated by Oblique Mercator method (code 9815).,97.612
+9815,Oblique Mercator,,,Latitude of projection centre,Longitude of projection centre,Azimuth of initial line,Angle from Rectified to Skew Grid,Scale factor on initial line,Easting at projection centre,Northing at projection centre,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"The following constants for the projection may be calculated :\
+\
+B = (1 + esq * cos^4(latc) / (1 - esq ))^0.5\
+A = a * B * kc *(1 - esq )^0.5 / ( 1 - esq * sin^2(latc))\
+t0 = tan(pi/4 - latc/2) / ((1 - e*sin(latc)) / (1 + e*sin(latc)))^(e/2)\
+D = B (1 - esq)^0.5  / (cos(latc) * ( 1 - esq*sin^2(latc))^0.5)\
+if D < 1 to avoid problems with computation of F make D^2  = 1 \
+F = D + (D^2 - 1)^0.5  * SIGN(latc)\
+H = F* t0*B\
+G = (F - 1/F) / 2\
+gamma0 = asin(sin(alphac) / D)\
+lon0 = lonc - (asin(G*tan(gamma0))) / B\
+\
+Then compute the (uc , vc) co-ordinates for the centre point (fc , lc).\
+vc =0\
+In general: uc = (A / B) atan((Dsq - 1)^0.5 / cos (alphac) ) * SIGN(latc)\
+\
+but for the special cases where alphac = 90 degrees (e.g. Hungary, Switzerland) then \
+uc = A*(lonc - lon0)  \
+\
+ \
+Forward case: To compute (E,N) from a given (lat,lon) :\
+\
+t = tan(pi/4 - lat/2) / ((1 - e sin (lat)) / (1 + e sin (lat)))^(e/2)\
+Q = H / t^B\
+S = (Q - 1 / Q) / 2\
+T = (Q + 1 / Q) / 2\
+V = sin(B (lon - lon0))\
+U = (- V cos(gamma0) + S sin(gamma0)) / T\
+v = A ln((1 - U) / (1 + U)) / 2 B\
+u = (A atan((S cos(gamma0) + V sin(gamma0)) / cos(B (lon - lon0 ))) / B) + (uc . SIGN (lon - lonC))\
+\
+\
+The rectified skew co-ordinates are then derived from:\
+\
+E = v cos(gammac) + u sin(gammac) + Ec\
+N = u cos(gammac) - v sin(gammac) + Nc\
+\
+Reverse case: Compute (lat,lon)  from a given (E,N)  :\
+\
+v� = (E - Ec) cos(gammac) - (N - Nc) sin(gammac)\
+u� = (N - Nc) cos(gammac) + (E - Ec) sin(gammac) + uc\
+\
+Q� = e- (B v �/ A)  where e is the base of natural logarithms.\
+S' = (Q� - 1 / Q�) / 2\
+T� = (Q� + 1 / Q�) / 2\
+V� = sin (B u� / A)\
+U� = (V� cos(gammac) + S� sin(gammac)) / T�\
+t� = (H / ((1 + U�) / (1 - U�))^0.5)^(1 / B)\
+\
+chi = pi / 2 - 2 atan(t�)\
+\
+lat = chi + sin(2chi).( e^2 / 2 + 5*e^4 / 24 + e^6 / 12 + 13*e^8 / 360) +  sin(4*chi).( 7*e^4 /48 + 29*e^6 / 240 + 811*e8 / 11520) +  sin(6chi).( 7*e^6 / 120 + 81*e8 / 1120) +  sin(8chi).(4279 e^8 / 161280)\
+\
+lon=  lon0  - atan ((S� cos(gammac) - V� sin(gammac)) / cos(B*u� / A)) / B",,1999-11-15 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.5",EPSG,,99.811
+9816,Tunisia Mining Grid,,,Latitude of origin,Longitude of origin,,,,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"This grid is used as the basis for mineral leasing in Tunsia.  Lease areas are approximately 2 x 2 km or 400 hectares.  The corners of these blocks are defined through a six figure grid reference where the first three digits are an easting in kilometres and the last three digits are a northing.  The latitudes and longitudes for block corners at 2 km intervals a [...]
+a)  the minimum easting is 94 km, on which the longitude is 5.68989 grads east of Paris.\
+b)  the maximum easting is 490 km, on which the longitude is 10.51515 grads east of Paris.\
+c)  each 2 km grid easting interval equals 0.02437 grads.\
+d)  the minimum northing is 40 km, on which the latitude is 33.39 grads.\
+e)  the maximum northing is 860 km, on which the latitude is 41.6039 grads.\
+f)  between 40 km N and 360 km N, each 2 km grid northing interval equals 0.02004 grads.\
+g)  between 360 km N and 860 km N, each 2 km grid northing interval equals 0.02003 grads.\
+\
+Formulae are:\
+\
+Grads from Paris\
+\
+Lat (grads) = 36.5964 + [(N - 360) * A] \
+where N is in kilometres and A = 0.010015 if N > 360, else A = 0.01002.\
+\
+LonParis (grads) = 7.83445 + [(E - 270) * 0.012185], where E is in kilometres.\
+\
+The reverse formulae are:\
+\
+E (km) = 270 + [(LonParis - 7.83445) / 0.012185] where LonParis is in grads.\
+\
+N (km) = 360 + [(Lat - 36.5964) / B] \
+where Lat is in grads and B = 0.010015  if  lat>36.5964, else B = 0.01002.\
+\
+Degrees from Greenwich.\
+\
+Modern practice in Tunisia is to quote latitude and longitude in degrees with longitudes referenced to the Greenwich meridian.  The formulae required in addition to the above are:\
+\
+Lat (degrees) =  (Latg * 0.9) where Latg is in grads.\
+LonGreenwich (degrees) = [(LonParis + 2.5969213) * 0.9] where LonParis is in grads.\
+\
+\
+Lat (grads) =  (Latd / 0.9) where Latd is in decimal degrees.\
+LonParis (grads) = [(LonGreenwich / 0.9) - 2.5969213)] where LonGreenwich is in decimal degrees.","For grid location 302598,\
+Latitude = 36.5964 + [(598 - 360) * A].  As N > 360, A = 0.010015.\
+Latitude = 38.97997 grads = 35.08197 degrees.\
+\
+Longitude  = 7.83445 + [(E - 270) * 0.012185, where E = 302.\
+Longitude  = 8.22437 grads east of Paris = 9.73916 degrees east of Greenwich.",1999-11-15 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.8",EPSG,,99.811
+9817,Lambert Conic Near-Conformal,,,Latitude of natural origin,Longitude of natural origin,,,Scale factor at natural origin,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"To compute the Lambert Conic Near-Conformal the following formulae are used;\
+\
+E = FE + r sin(theta)\
+N = FN + M + r sin(theta) tan(theta/2) using the natural origin rather than the false origin.\
+\
+Compute constants for the ellipse:\
+\
+n = (a-b)/(a+b)  \
+A� = a [ 1- n + 5 (n^2 - n^3 ) / 4 + 81 ( n^4 - n^5 ) / 64]*pi /180 \
+B� = 3 a [ n - n^2 + 7 ( n^3 - n^4 ) / 8 + 55 n^5 / 64] / 2\
+C� = 15 a [ n^2 -n^3 + 3 ( n^4 - n^5 ) / 4 ] / 16\
+D� = 35 a [ n^3 - n^4 + 11 n^5 / 16 ] / 48\
+E� = 315 a [ n^4 - n^5 ] / 512\
+\
+Then compute the meridional arc from the equator to the parallel.\
+s0 = A� lat0 - B� sin(2 lat0) + C� sin(4 lat0) - D� sin(6 lat0) + E� sin(8 lat0) where lat0 in the first term is in degrees\
+s0 = A� lat - B� sin(2 lat) + C� sin(4 lat) - D� sin(6 lat) + E� sin(8 lat) where lat0 in the first term is in degrees\
+m = s - s0\
+A = 1 / (6 rho0 nu0) \
+M = ko ( m + A m^3.  This is the term that is truncated to the third order.\
+Ms = M per second of arc = M / ((lat - lat0) * 3600)\
+\
+theta = (lon - lon0) sin(lat0)\
+ro = ko nu0 / tan(lat0)\
+r = ro - M\
+\
+The reverse formulas for lat and lon  from E and N with r0 and Ms as above:\
+\
+lat  = M�/ (Ms * 3600) + lat0   where lat0 and lat are in degrees\
+lon  =  lon0 + theta� / sin(lat0)  where lont0 and lon are in radians\
+\
+where\
+E� = E - FE              N� = N - FN\
+theta� = arctan [E� / (r0 - N�)]\
+r� = E� / sin(theta�) \
+M� = r0 - r'","For Projected Coordinate System: Deir ez Zor / Levant Zone\
+\
+Parameters:\
+Ellipsoid  Clarke 1880 (IGN)  a = 6378249.2 m  1/f = 293.46602\
+then b = 6356515.000    n = 0.001706682563\
+\
+Latitude Natural Origin  = 34o 39'00\" N = 0.604756586 rad\
+Longitude Natural Origin = 37o 21'00\" E=  0.651880476 rad\
+Scale factor at origin ko = 0.99962560\
+False Eastings FE  = 300000.00 m\
+False Northings FN  = 300000.00 m\
+\
+Forward calculation for: \
+Latitude of 37d 31' 17.625\" N = 0.654874806 rad\
+Longitude of 34d 08' 11.291\" E = 0.595793792 rad\
+first gives\
+A = 4.1067494 * 10e-15      A�=111131.8633\
+B�= 16300.64407     C�= 17.38751     D�= 0.02308      E�= 0.000033\
+so = 3835482.233    s  = 4154101.458     m = 318619.225\
+M = 318632.72         Ms = 30.82262319\
+q = -0.03188875       ro = 9235264.405     r = 8916631.685\
+\
+Then Easting E =   15707.96 m (c.f. E =   15708.00 using full formulae)\
+         Northing N =      623165.96 m (c.f. N = 623167.20 using full formulae)\
+\
+Reverse calculation for the same easting and northing first gives\
+\
+q' = -0.03188875\
+r�  =  8916631.685\
+M�= 318632.72 \
+\
+Latitude =      0.654874806 rad = 37d 31' 17.625\" N\
+Longitude = 0.595793792 rad =  34d 08' 11.291\" E",1999-11-15 00:00:00,"EPSG Guidance note #7; \"Geographic and Projected Coordinate System Transformations\"; section 1.4.1.1",EPSG,,99.811
+9818,American Polyconic,,,Latitude of natural origin,Longitude of natural origin,,,,False easting,False northing,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1999-10-20 00:00:00,"US Geological Survey Professional Paper 1395; \"Map Projections - A Working Manual\";  J. Snyder",EPSG,,99.55
diff --git a/src/tiff/csv/trf_nonpolynomial.c b/src/tiff/csv/trf_nonpolynomial.c
new file mode 100644
index 0000000..7418100
--- /dev/null
+++ b/src/tiff/csv/trf_nonpolynomial.c
@@ -0,0 +1,1082 @@
+#include "defs.h"
+datafile_rows_t trf_nonpolynomial_row_1[] = {"COORD_TRF_CODE","COORD_TRF_EPSG_NAME","COORD_TRF_EPSG_ABBR","COORD_TRF_USER_NAME","DESCRIPTION","AREA_OF_USE","COORD_TRF_METHOD_CODE","PARAMETER_1","PARAMETER_2","PARAMETER_3","PARAMETER_4","PARAMETER_5","PARAMETER_6","PARAMETER_7","UOM_LENGTH_CODE","UOM_ANGLE_CODE","PRIME_MERIDIAN_CODE","UOM_SCALE_CODE","PARAMETER_35","PARAMETER_36","PARAMETER_37","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t trf_nonpolynomial_row_2[] = {"1100","Adindan to WGS 84 (1)","","","","MEAN FOR Ethiopia; Sudan.","9603","-166.0","-15.0","204.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_3[] = {"1101","Adindan to WGS 84 (2)","","","","Burkina Faso.","9603","-118.0","-14.0","218.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_4[] = {"1102","Adindan to WGS 84 (3)","","","","Cameroon.","9603","-134.0","-2.0","210.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_5[] = {"1103","Adindan to WGS 84 (4)","","","","Ethiopia.","9603","-165.0","-11.0","206.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_6[] = {"1104","Adindan to WGS 84 (5)","","","","Mali.","9603","-123.0","-20.0","220.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_7[] = {"1105","Adindan to WGS 84 (6)","","","","Senegal.","9603","-128.0","-18.0","224.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_8[] = {"1106","Adindan to WGS 84 (7)","","","","Sudan.","9603","-161.0","-14.0","205.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_9[] = {"1107","Afgooye to WGS 84 (1)","","","","Somalia.","9603","-43.0","-163.0","45.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_10[] = {"1108","AGD66 to WGS 84 (1)","","","","Australia.","9603","-133.0","-48.0","148.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_11[] = {"1109","AGD84 to WGS 84 (1)","","","","Australia.","9603","-134.0","-48.0","149.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_12[] = {"1110","Ain el Abd to WGS 84 (1)","","","","Bahrain.","9603","-150.0","-250.0","-1.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","97.06",NULL};
+datafile_rows_t trf_nonpolynomial_row_13[] = {"1111","Ain el Abd to WGS 84 (2)","","","","Saudi Arabia.","9603","-143.0","-236.0","7.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_14[] = {"1112","Amersfoort to WGS 84 (1)","","","","Netherlands.","9606","593.16","26.15","478.54","-6.3239","-0.5008","-5.5487","4.0775","9001","9109","","9202","","","","1997-04-11 00:00:00","Nederlandse Commissie voor Geodesie publication 30; 1993.","EPSG","","97.07",NULL};
+datafile_rows_t trf_nonpolynomial_row_15[] = {"1113","Arc 1950 to WGS 84 (1)","","","","MEAN FOR Botswana; Lesotho; Malawi; Swaziland; Zaire; Zambia; Zimbabwe.","9603","-143.0","-90.0","-294.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_16[] = {"1114","Arc 1950 to WGS 84 (2)","","","","Botswana.","9603","-138.0","-105.0","-289.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_17[] = {"1115","Arc 1950 to WGS 84 (3)","","","","Burundi.","9603","-153.0","-5.0","-292.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_18[] = {"1116","Arc 1950 to WGS 84 (4)","","","","Lesotho.","9603","-125.0","-108.0","-295.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_19[] = {"1117","Arc 1950 to WGS 84 (5)","","","","Malawi.","9603","-161.0","-73.0","-317.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_20[] = {"1118","Arc 1950 to WGS 84 (6)","","","","Swaziland.","9603","-134.0","-105.0","-295.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_21[] = {"1119","Arc 1950 to WGS 84 (7)","","","","Zaire.","9603","-169.0","-19.0","-278.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_22[] = {"1120","Arc 1950 to WGS 84 (8)","","","","Zambia.","9603","-147.0","-74.0","-283.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_23[] = {"1121","Arc 1950 to WGS 84 (9)","","","","Zimbabwe.","9603","-142.0","-96.0","-293.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_24[] = {"1122","Arc 1960 to WGS 84 (1)","","","","MEAN FOR Kenya; Tanzania.","9603","-160.0","-6.0","-302.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_25[] = {"1123","Batavia to WGS 84 (1)","","","","Indonesia (Sumatra).","9603","-377.0","681.0","-50.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_26[] = {"1124","Bermuda 1957 to WGS 84 (1)","","","","Bermuda.","9603","-73.0","213.0","296.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_27[] = {"1125","Bogota to WGS 84 (1)","","","","Colombia.","9603","307.0","304.0","-318.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_28[] = {"1126","Bukit Rimpah to WGS 84 (1)","","","","Indonesia (Bangka & Belitung Islands).","9603","-384.0","664.0","-48.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_29[] = {"1127","Campo Inchauspe to WGS 84 (1)","","","","Argentina.","9603","-148.0","136.0","90.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_30[] = {"1128","Cape to WGS 84 (1)","","","","South Africa.","9603","-136.0","-108.0","-292.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_31[] = {"1129","Cape to WGS 84 (2)","","","","South Africa.","9603","-134.73","-110.92","-292.66","","","","","9001","","","","","","","1996-10-18 00:00:00","Private Communication, Directorate of Surveys and Land Information, Cape Town.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_32[] = {"1130","Carthage to WGS 84 (1)","","","","Tunisia.","9603","-263.0","6.0","431.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_33[] = {"1131","Chua to WGS 84 (1)","","","","Paraguay.","9603","-134.0","229.0","-29.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_34[] = {"1132","Corrego Alegre to WGS 84 (1)","","","","Brazil.","9603","-206.0","172.0","-6.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_35[] = {"1133","ED50 to WGS 84 (1)","","","","MEAN FOR Austria; Belgium; Denmark; Finland;  France; Germany (west); Gibraltar; Greece;  Italy; Luxembourg; Netherlands; Norway;  Portugal; Spain; Sweden; Switzerland.","9603","-87.0","-98.0","-121.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","97.02",NULL};
+datafile_rows_t trf_nonpolynomial_row_36[] = {"1134","ED50 to WGS 84 (2)","","","","MEAN FOR Austria; Denmark; France; Germany (west); Netherlands; Switzerland.","9603","-87.0","-96.0","-120.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_37[] = {"1135","ED50 to WGS 84 (3)","","","","MEAN FOR Iraq; Israel; Jordan; Lebanon;  Kuwait; Saudi Arabia; Syria.","9603","-103.0","-106.0","-141.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_38[] = {"1136","ED50 to WGS 84 (4)","","","","Cyprus.","9603","-104.0","-101.0","-140.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_39[] = {"1137","ED50 to WGS 84 (5)","","","","Egypt.","9603","-130.0","-117.0","-151.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_40[] = {"1138","ED50 to WGS 84 (6)","","","","Ireland; United Kingdom (UK).","9603","-86.0","-96.0","-120.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_41[] = {"1139","ED50 to WGS 84 (7)","","","","Finland; Norway.","9603","-87.0","-95.0","-120.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_42[] = {"1140","ED50 to WGS 84 (8)","","","","Greece.","9603","-84.0","-95.0","-130.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_43[] = {"1141","ED50 to WGS 84 (9)","","","","Iran.","9603","-117.0","-132.0","-164.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_44[] = {"1142","ED50 to WGS 84 (10)","","","","Italy (Sardinia).","9603","-97.0","-103.0","-120.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_45[] = {"1143","ED50 to WGS 84 (11)","","","","Italy (Sicily).","9603","-97.0","-88.0","-135.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_46[] = {"1144","ED50 to WGS 84 (12)","","","","Malta.","9603","-107.0","-88.0","-149.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_47[] = {"1145","ED50 to WGS 84 (13)","","","","Portugal; Spain.","9603","-84.0","-107.0","-120.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_48[] = {"1146","ED87 to WGS 84 (1)","","","","Denmark - North Sea;  Germany - North Sea;  Netherlands - offshore;  Norway; United Kingdom (UKCS) - North Sea south of 62 deg N.","9606","-82.981","-99.719","-110.709","-0.5076","0.1503","0.3898","-0.3143","9001","9109","","9202","","","","1997-04-11 00:00:00","Norwegian Mapping Authority publication 1990:1 and note of 13-Feb-1991 \"Om Transformasjon mellom Geodetiske Datum i Norge\"","EPSG","","97.03  9 [...]
+datafile_rows_t trf_nonpolynomial_row_49[] = {"1147","ED50 to ED87 (2)","","","","Norway - offshore north of 65 deg N.","9606","-1.51","-0.84","-3.5","-1.893","-0.687","-2.764","0.609","9001","9109","","9202","","","","1997-04-11 00:00:00","Norwegian Mapping Authority note of 13-Feb-1991 \"Om Transformasjon mellom Geodetiske Datum i Norge\"","EPSG","","97.04",NULL};
+datafile_rows_t trf_nonpolynomial_row_50[] = {"1148","Egypt 1907 to WGS 84 (1)","","","","Egypt.","9603","-130.0","110.0","-13.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_51[] = {"1149","ETRF89 to WGS 84 (1)","","","","Europe.","9603","0.0","0.0","0.0","","","","","9001","","","","","","","1997-06-16 00:00:00","EPSG","EPSG","ETRF89 is a realisation of WGS84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.","97.24",NULL};
+datafile_rows_t trf_nonpolynomial_row_52[] = {"1150","GDA94 to WGS 84 (1)","","","","Australia.","9603","0.0","0.0","0.0","","","","","9001","","","","","","","1996-10-18 00:00:00","EPSG","EPSG","GDA94 is a realisation of WGS84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_53[] = {"1151","GD49 to WGS 84 (1)","","","","New Zealand.","9603","84.0","-22.0","209.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_54[] = {"1152","Hu Tzu Shan to WGS 84 (1)","","","","Taiwan.","9603","-637.0","-549.0","-203.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_55[] = {"1153","Indian 1954 to WGS 84 (1)","","","","Thailand.","9603","217.0","823.0","299.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","97.06",NULL};
+datafile_rows_t trf_nonpolynomial_row_56[] = {"1154","Indian 1975 to WGS 84 (1)","","","","Thailand.","9603","209.0","818.0","290.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 second edition September 1991","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_57[] = {"1155","Kalianpur 1937 to WGS 84 (1)","","","","Bangladesh.","9603","282.0","726.0","254.0","","","","","9001","","","","","","","1999-10-20 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","97.235",NULL};
+datafile_rows_t trf_nonpolynomial_row_58[] = {"1156","Kalianpur 1975 to WGS 84 (1)","","","","India; Nepal.","9603","295.0","736.0","257.0","","","","","9001","","","","","","","1999-10-20 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","Care!  DMA ellipsoid is inconsistent with EPSG ellipsoid - transformation parameter values may not be appropriate.","97.235",NULL};
+datafile_rows_t trf_nonpolynomial_row_59[] = {"1157","Kandawala to WGS 84 (1)","","","","Sri Lanka.","9603","-97.0","787.0","86.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_60[] = {"1158","Kertau to WGS 84 (1)","","","","Malaysia - West Malaysia; Singapore.","9603","-11.0","851.0","5.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_61[] = {"1159","Leigon to WGS 84 (1)","","","","Ghana.","9603","-130.0","29.0","364.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_62[] = {"1160","Liberia 1964 to WGS 84 (1)","","","","Liberia.","9603","-90.0","40.0","88.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_63[] = {"1161","Luzon 1911 to WGS 84 (1)","","","","Philippines (excluding Mindanao).","9603","-133.0","-77.0","-51.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_64[] = {"1162","Luzon 1911 to WGS 84 (2)","","","","Philippines (Mindanao).","9603","-133.0","-79.0","-72.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_65[] = {"1163","M'poraloko to WGS 84 (1)","","","","Gabon.","9603","-74.0","-130.0","42.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_66[] = {"1164","Mahe 1971 to WGS 84 (1)","","","","Seychelles - Mahe Island.","9603","41.0","-220.0","-134.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_67[] = {"1165","Massawa to WGS 84 (1)","","","","Ethiopia (Eritrea).","9603","639.0","405.0","60.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_68[] = {"1166","Merchich to WGS 84 (1)","","","","Morocco.","9603","31.0","146.0","47.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_69[] = {"1167","Minna to WGS 84 (1)","","","","Cameroon.","9603","-81.0","-84.0","115.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_70[] = {"1168","Minna to WGS 84 (2)","","","","Nigeria.","9603","-92.0","-93.0","122.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_71[] = {"1169","Monte Mario to WGS 84 (1)","","","","Italy (Sardinia).","9603","-225.0","-65.0","9.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_72[] = {"1170","NAD27 to WGS 84 (1)","","","","MEAN FOR Antigua; Barbados; Barbuda;  Caicos Islands; Cuba; Dominican Republic;  Grand Cayman; Jamaica; Turks Islands.","9603","-3.0","142.0","183.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_73[] = {"1171","NAD27 to WGS 84 (2)","","","","MEAN FOR Belize; Costa Rica; El Salvador;  Guatemala; Honduras; Nicaragua.","9603","0.0","125.0","194.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_74[] = {"1172","NAD27 to WGS 84 (3)","","","","MEAN FOR Canada.","9603","-10.0","158.0","187.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_75[] = {"1173","NAD27 to WGS 84 (4)","","","","MEAN FOR United States (USA) (CONUS).","9603","-8.0","160.0","176.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_76[] = {"1174","NAD27 to WGS 84 (5)","","","","MEAN FOR United States (USA) (CONUS East of Mississippi River  including Louisiana; Missouri; Minnesota).","9603","-9.0","161.0","179.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_77[] = {"1175","NAD27 to WGS 84 (6)","","","","MEAN FOR United States (USA) (CONUS West of Mississippi River).","9603","-8.0","159.0","175.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_78[] = {"1176","NAD27 to WGS 84 (7)","","","","United States (USA) - Alaska (Excluding Aleutian Islands).","9603","-5.0","135.0","172.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_79[] = {"1177","NAD27 to WGS 84 (8)","","","","Bahamas (Except San Salvador Island).","9603","-4.0","154.0","178.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_80[] = {"1178","NAD27 to WGS 84 (9)","","","","Bahamas (San Salvador Island).","9603","1.0","140.0","165.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_81[] = {"1179","NAD27 to WGS 84 (10)","","","","Canada (Alberta; British Columbia).","9603","-7.0","162.0","188.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_82[] = {"1180","NAD27 to WGS 84 (11)","","","","Canada (Manitoba; Ontario).","9603","-9.0","157.0","184.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_83[] = {"1181","NAD27 to WGS 84 (12)","","","","Canada (New Brunswick; Newfoundland; Nova Scotia; Quebec).","9603","-22.0","160.0","190.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_84[] = {"1182","NAD27 to WGS 84 (13)","","","","Canada (Northwest Territories; Nunavut; Saskatchewan).","9603","4.0","159.0","188.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_85[] = {"1183","NAD27 to WGS 84 (14)","","","","Canada (Yukon).","9603","-7.0","139.0","181.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_86[] = {"1184","NAD27 to WGS 84 (15)","","","","Panama - Canal Zone.","9603","0.0","125.0","201.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_87[] = {"1185","NAD27 to WGS 84 (16)","","","","Cuba.","9603","-9.0","152.0","178.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_88[] = {"1186","NAD27 to WGS 84 (17)","","","","Greenland (Hayes Peninsula).","9603","11.0","114.0","195.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_89[] = {"1187","NAD27 to WGS 84 (18)","","","","Mexico.","9603","-12.0","130.0","190.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_90[] = {"1188","NAD83 to WGS 84 (1)","","","","Canada; Central America; Mexico; United States (USA) (Alaska (excluding Aleutian Islands); CONUS).","9603","0.0","0.0","0.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","NAD83 is a realisation of WGS84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.","97.06",NULL};
+datafile_rows_t trf_nonpolynomial_row_91[] = {"1189","Nahrwan 1967 to WGS 84 (1)","","","","Oman (Masirah Island).","9603","-247.0","-148.0","369.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_92[] = {"1190","Nahrwan 1967 to WGS 84 (2)","","","","Saudi Arabia.","9603","-243.0","-192.0","477.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_93[] = {"1191","Nahrwan 1967 to WGS 84 (3)","","","","United Arab Emirates (UAE).","9603","-249.0","-156.0","381.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_94[] = {"1192","Naparima 1972 to WGS 84 (1)","","","","Trinidad and Tobago.","9603","-10.0","375.0","165.0","","","","","9001","","","","","","","1998-06-30 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","CAUTION: EPSG believes that these parameter values include a blunder and that if NIMA transformation parameters are to be used the 1987 version (EPSG code 1307) be used.","98.102",NULL};
+datafile_rows_t trf_nonpolynomial_row_95[] = {"1193","NTF to WGS 84 (1)","","","","France.","9603","-168.0","-60.0","320.0","","","","","9001","","","","","","","1996-10-18 00:00:00","IGN technical report RT/G 14; January 1988.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_96[] = {"1195","OSGB 1936 to WGS 84 (1)","","","","MEAN FOR United Kingdom (UK) - Great Britain (England; Scotland; Wales); Isle of Man.","9603","375.0","-111.0","431.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_97[] = {"1196","OSGB 1936 to WGS 84 (2)","","","","United Kingdom (UK) - England.","9603","371.0","-112.0","434.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_98[] = {"1197","OSGB 1936 to WGS 84 (3)","","","","United Kingdom (UK) - England; Wales; Isle of Man.","9603","371.0","-111.0","434.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_99[] = {"1198","OSGB 1936 to WGS 84 (4)","","","","United Kingdom (UK) - Scotland (including Shetland Islands).","9603","384.0","-111.0","425.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_100[] = {"1199","OSGB 1936 to WGS 84 (5)","","","","United Kingdom (UK) - Wales.","9603","370.0","-108.0","434.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_101[] = {"1200","Pointe Noire to WGS 84 (1)","","","","Congo.","9603","-148.0","51.0","-291.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_102[] = {"1201","PSAD56 to WGS 84 (1)","","","","MEAN FOR Bolivia; Chile; Colombia;  Ecuador; Guyana; Peru; Venezuela.","9603","-288.0","175.0","-376.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_103[] = {"1202","PSAD56 to WGS 84 (2)","","","","Bolivia.","9603","-270.0","188.0","-388.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_104[] = {"1203","PSAD56 to WGS 84 (3)","","","","Chile (Northern; near 19 deg S).","9603","-270.0","183.0","-390.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_105[] = {"1204","PSAD56 to WGS 84 (4)","","","","Chile (Southern; near 43 deg S).","9603","-305.0","243.0","-442.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_106[] = {"1205","PSAD56 to WGS 84 (5)","","","","Colombia.","9603","-282.0","169.0","-371.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_107[] = {"1206","PSAD56 to WGS 84 (6)","","","","Ecuador.","9603","-278.0","171.0","-367.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_108[] = {"1207","PSAD56 to WGS 84 (7)","","","","Guyana.","9603","-298.0","159.0","-369.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_109[] = {"1208","PSAD56 to WGS 84 (8)","","","","Peru.","9603","-279.0","175.0","-379.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_110[] = {"1209","PSAD56 to WGS 84 (9)","","","","Venezuela.","9603","-295.0","173.0","-371.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_111[] = {"1210","Qatar to WGS 84 (1)","","","","Qatar.","9603","-128.0","-283.0","22.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_112[] = {"1211","Qornoq to WGS 84 (1)","","","","Greenland (South).","9603","164.0","138.0","-189.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_113[] = {"1212","SAD69 to WGS 84 (1)","","","","MEAN FOR Argentina; Bolivia; Brazil; Chile;  Colombia; Ecuador; Guyana; Paraguay;  Peru; Trinidad & Tobago; Venezuela.","9603","-57.0","1.0","-41.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_114[] = {"1213","SAD69 to WGS 84 (2)","","","","Argentina.","9603","-62.0","-1.0","-37.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_115[] = {"1214","SAD69 to WGS 84 (3)","","","","Bolivia.","9603","-61.0","2.0","-48.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_116[] = {"1215","SAD69 to WGS 84 (4)","","","","Brazil.","9603","-60.0","-2.0","-41.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_117[] = {"1216","SAD69 to WGS 84 (5)","","","","Chile.","9603","-75.0","-1.0","-44.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_118[] = {"1217","SAD69 to WGS 84 (6)","","","","Colombia.","9603","-44.0","6.0","-36.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_119[] = {"1218","SAD69 to WGS 84 (7)","","","","Ecuador.","9603","-48.0","3.0","-44.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_120[] = {"1219","SAD69 to WGS 84 (8)","","","","Ecuador (Baltra; Galapagos).","9603","-47.0","26.0","-42.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_121[] = {"1220","SAD69 to WGS 84 (9)","","","","Guyana.","9603","-53.0","3.0","-47.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_122[] = {"1221","SAD69 to WGS 84 (10)","","","","Paraguay.","9603","-61.0","2.0","-33.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_123[] = {"1222","SAD69 to WGS 84 (11)","","","","Peru.","9603","-58.0","0.0","-44.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_124[] = {"1223","SAD69 to WGS 84 (12)","","","","Trinidad and Tobago.","9603","-45.0","12.0","-33.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_125[] = {"1224","SAD69 to WGS 84 (13)","","","","Venezuela.","9603","-45.0","8.0","-33.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_126[] = {"1225","Sapper Hill 1943 to WGS 84 (1)","","","","Falkland Islands - East Falkland Island.","9603","-355.0","21.0","72.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_127[] = {"1226","Schwarzeck to WGS 84 (1)","","","","Namibia.","9603","616.0","97.0","-251.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_128[] = {"1227","Tananarive to WGS 84 (1)","","","","Madagascar.","9603","-189.0","-242.0","-91.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_129[] = {"1228","Timbalai 1948 to WGS 84 (1)","","","","Brunei; Malaysia (Sabah; Sarawak).","9603","-679.0","669.0","-48.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_130[] = {"1229","TM65 to WGS 84 (1)","","","","Ireland.","9603","506.0","-122.0","611.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_131[] = {"1230","Tokyo to WGS 84 (1)","","","","MEAN FOR Japan; South Korea; Okinawa.","9603","-148.0","507.0","685.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","97.06",NULL};
+datafile_rows_t trf_nonpolynomial_row_132[] = {"1231","Tokyo to WGS 84 (2)","","","","Japan.","9603","-148.0","507.0","685.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_133[] = {"1232","Tokyo to WGS 84 (3)","","","","South Korea.","9603","-146.0","507.0","687.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","97.06",NULL};
+datafile_rows_t trf_nonpolynomial_row_134[] = {"1233","Tokyo to WGS 84 (4)","","","","Japan (Okinawa).","9603","-158.0","507.0","676.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_135[] = {"1234","Yacare to WGS 84 (1)","","","","Uruguay.","9603","-155.0","171.0","37.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_136[] = {"1235","Zanderij to WGS 84 (1)","","","","Suriname.","9603","-265.0","120.0","-358.0","","","","","9001","","","","","","","1996-10-18 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_137[] = {"1236","AGD84 to WGS 84 (2)","","","","Australia.","9607","-116.0","-50.47","141.69","-0.23","-0.39","-0.344","0.0983","9001","9104","","9202","","","","1997-11-13 00:00:00","Australian Surveying and Land Information Group - www.auslig.gov.au/geodesy","EPSG","Superseded by AGD84 to GDA94 (2) (code 1280).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_138[] = {"1237","WGS 72 to WGS 84 (1)","","","","World.","9606","0.0","0.0","4.5","0.0","0.0","0.554","0.2263","9001","9104","","9202","","","","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_139[] = {"1238","WGS 72 to WGS 84 (2)","","","","World.","9606","0.0","0.0","4.5","0.0","0.0","0.554","0.219","9001","9104","","9202","","","","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_140[] = {"1239","WGS 72BE to WGS 72 (1)","","","","World.","9606","0.0","0.0","-2.6","0.0","0.0","0.26","-0.6063","9001","9104","","9202","","","","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_141[] = {"1240","WGS 72BE to WGS 84 (1)","","","","World.","9606","0.0","0.0","1.9","0.0","0.0","0.814","-0.38","9001","9104","","9202","","","","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_142[] = {"1241","NAD27 to NAD83 (1)","","","","United States (USA) - lower 48 states including EEZ.","9613","","","","","","","","","9104","","","conus.las","conus.los","","1999-04-22 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.","98.201  98.53",NULL};
+datafile_rows_t trf_nonpolynomial_row_143[] = {"1243","NAD27 to NAD83 (2)","","","","United States (USA) - Alaska including EEZ.","9613","","","","","","","","","9104","","","alaska.las","alaska.los","","1999-04-22 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.","98.201  98.53",NULL};
+datafile_rows_t trf_nonpolynomial_row_144[] = {"1245","ED50 to WGS 84 (16)","","","","Tunisia.","9603","-112.0","-77.0","-145.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","98.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_145[] = {"1246","Herat North to WGS 84 (1)","","","","Afghanistan.","9603","-333.0","-222.0","114.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_146[] = {"1247","Kalianpur 1962 to WGS 84 (1)","","","","Pakistan.","9603","283.0","682.0","231.0","","","","","9001","","","","","","","1999-10-20 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","Care!  DMA ellipsoid is inconsistent with EPSG ellipsoid - transformation parameter values may not be appropriate.","97.235",NULL};
+datafile_rows_t trf_nonpolynomial_row_147[] = {"1248","ID74 to WGS 84 (1)","","","","Indonesia.","9603","-24.0","-15.0","5.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_148[] = {"1249","NAD27 to WGS 84 (21)","","","","United States (USA) - Alaska - Aleutian Islands east of 180 deg.","9603","-2.0","152.0","149.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_149[] = {"1250","NAD27 to WGS 84 (22)","","","","United States (USA) - Alaska - Aleutian Islands west of 180 deg.","9603","2.0","204.0","105.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_150[] = {"1251","NAD83 to WGS 84 (2)","","","","United States (USA) - Alaska - Aleutian Islands.","9603","-2.0","0.0","4.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_151[] = {"1252","NAD83 to WGS 84 (3)","","","","United States (USA) - Hawaii.","9603","1.0","1.0","-1.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_152[] = {"1253","Nord Sahara 1959 to WGS 84 (1)","","","","Algeria.","9603","-186.0","-93.0","310.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_153[] = {"1254","Pulkovo 1942 to WGS 84 (1)","","","","Russia.","9603","28.0","-130.0","-95.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_154[] = {"1255","Voirol Unifie to WGS 84 (1)","","","","Algeria - north of 35g (31 deg 30 min) North.","9603","-123.0","-206.0","219.0","","","","","9001","","","","","","","1998-06-30 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","CAUTION:   EPSG believes that the data used in the derivation of these parameters contains a blunder.  We recommend using transformation 1253 [North Sahara 1959 to WGS84 (1)] as Voirol 1 [...]
+datafile_rows_t trf_nonpolynomial_row_155[] = {"1256","Fahud to WGS 84 (1)","","","","Oman.","9603","-346.0","-1.0","224.0","","","","","9001","","","","","","","1997-04-11 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_156[] = {"1257","Bern 1898 (Bern) to Bern 1898","","","","Liechtenstein;  Switzerland.","9601","7.26225","","","","","","","","9110","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_157[] = {"1258","Bogota (Bogota) to Bogota","","","","Colombia.","9601","-74.04513","","","","","","","","9110","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_158[] = {"1259","Lisbon (Lisbon) to Lisbon","","","","Portugal - onshore.","9601","-9.0754862","","","","","","","","9110","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_159[] = {"1260","Makassar (Jakarta) to Makassar","","","","Indonesia - south west Sulawesi.","9601","106.482779","","","","","","","","9110","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_160[] = {"1261","MGI (Ferro) to MGI","","","","Austria.","9601","-17.4","","","","","","","","9110","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_161[] = {"1262","Monte Mario (Rome) to Monte Mario","","","","Italy.","9601","12.27084","","","","","","","","9110","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","98.37  99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_162[] = {"1263","Padang (Jakarta) to Padang","","","","Indonesia - Sumatra.","9601","106.482779","","","","","","","","9110","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_163[] = {"1264","Belge 1950 (Brussels) to Belge 1950","","","","Belgium - onshore.","9601","4.220471","","","","","","","","9110","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_164[] = {"1265","Tananarive (Paris) to Tananarive","","","","Madagascar.","9601","2.5969213","","","","","","","","9105","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_165[] = {"1266","Voirol 1875 (Paris) to Voirol 1875","","","","Algeria - north of 32 deg N.","9601","2.5969213","","","","","","","","9105","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_166[] = {"1267","Voirol Unifie (Paris) to Voirol Unifie","","","","Algeria - north of 32 deg N.","9601","2.5969213","","","","","","","","9105","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_167[] = {"1268","Batavia (Jakarta) to Batavia","","","","Indonesia - Java.","9601","106.482779","","","","","","","","9110","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_168[] = {"1269","RT38 (Stockholm) to RT38","","","","Sweden.","9601","18.03298","","","","","","","","9110","","","","","","1999-11-12 00:00:00","EPSG","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_169[] = {"1270","Greek (Athens) to Greek","","","","Greece - onshore.","9601","23.4258815","","","","","","","","9110","","","","","","1999-11-12 00:00:00","Topography Department; National Technical University of Athens.","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_170[] = {"1271","Schwarzeck to WGS 84 (2)","","","","Namibia.","9603","615.64","102.08","-255.81","","","","","9001","","","","","","","1997-11-13 00:00:00","Chief Directorate Surveys and Land Information; Mowbray; South Africa.","EPSG","Beware !   Schwarzeck CS uses German legal metres.  Example:  Schwarzeck Lat 19d 35m 46.952s S Long 20d 41m 50.649s E; X=5623409.40 Y=2124618.00 Z=-2125847.62 GLM; X=5623485.86 Y=2124646.89 Z=-2125876.53 m; WGS84 X=5 [...]
+datafile_rows_t trf_nonpolynomial_row_171[] = {"1272","GGRS87 to WGS 84 (1)","","","","Greece.","9603","-199.87","74.79","246.62","","","","","9001","","","","","","","1997-06-16 00:00:00","Geodesy Department; Public Petroleum Corporation of Greece.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_172[] = {"1273","HD72 to ETRF89 (1)","","","","Hungary.","9607","-56.0","75.77","15.31","-0.37","-0.2","-0.21","-1.01","9001","9104","","9202","","","","1997-11-13 00:00:00","http://lazarus.elte.hu/gb/geodez/geod5.htm","EPSG","","97.47",NULL};
+datafile_rows_t trf_nonpolynomial_row_173[] = {"1274","Pulkovo 1942 to LKS94(ETRS89) (1)","CS42 to LKS94 (1)","","","Lithuania.","9607","-40.595","-18.55","-69.339","-2.508","-1.832","2.611","-4.299","9001","9104","","9202","","","","1998-03-12 00:00:00","HNIT-BALTIC GeoInfoServisas.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_174[] = {"1275","ED50 to WGS 84 (17)","","","","France.","9603","-84.0","-97.0","-117.0","","","","","9001","","","","","","","1998-04-16 00:00:00","IGN technical report 14 (January 1988).","EPSG","","98.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_175[] = {"1276","NTF to ED50 (1)","","","","France.","9603","-84.0","37.0","437.0","","","","","9001","","","","","","","1997-11-13 00:00:00","IGN technical report 7 (October 1981).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_176[] = {"1277","NTF to WGS 72 (1)","","","","France.","9603","-168.0","-72.0","314.0","","","","","9001","","","","","","","1997-11-13 00:00:00","IGN technical report 7 (October 1981).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_177[] = {"1278","AGD66 to GDA94 (1)","","","","Australia.","9603","-127.8","-52.3","152.9","","","","","9001","","","","","","","1997-11-13 00:00:00","http://www.anzlic.org.au/icsm/gdatm/molodens.htm","EPSG","5m accuracy.  Parameter values are given to greater precision but no better accuracy at http://www.dehaa.sa.gov.au/res_inform/sicom/where/geobas14.html","",NULL};
+datafile_rows_t trf_nonpolynomial_row_178[] = {"1279","AGD84 to GDA94 (1)","","","","Australia.","9603","-128.5","-53.0","153.4","","","","","9001","","","","","","","1997-11-13 00:00:00","http://www.anzlic.org.au/icsm/gdatm/molodens.htm","EPSG","5m accuracy.  Parameter values are given to greater precision but no better accuracy at http://www.dehaa.sa.gov.au/res_inform/sicom/where/geobas14.html","",NULL};
+datafile_rows_t trf_nonpolynomial_row_179[] = {"1280","AGD84 to GDA94 (2)","","","","Australia.","9607","-117.763","-51.51","139.061","-0.292","-0.443","-0.277","-0.191","9001","9104","","9202","","","","1997-11-13 00:00:00","http://www.anzlic.org.au/icsm/gdatm/simil.htm","EPSG","1m accuracy.  Supersedes AGD84 to WGS 84 (2) (code 1236).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_180[] = {"1282","Samboja to WGS 84 (1)","","","","Indonesia - east Kalimantan - Mahakam delta area.","9603","-404.78","-685.68","-45.47","","","","","9001","","","","","","","1997-11-13 00:00:00","Total Indonesia.","EPSG","Datum shift derived through ITRF93.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_181[] = {"1283","LKS94(ETRS89) to WGS 84 (1)","LKS94 to WGS 84 (1)","","","Lithuania.","9603","0.0","0.0","0.0","","","","","9001","","","","","","","1998-03-12 00:00:00","HNIT-BALTIC GeoInfoServisas.","EPSG","LKS94 is a realisation of WGS84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.","98.13",NULL};
+datafile_rows_t trf_nonpolynomial_row_182[] = {"1284","Arc 1960 to WGS 84 (2)","","","","Kenya.","9603","-157.0","-2.0","-299.0","","","","","9001","","","","","","","1998-03-12 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_183[] = {"1285","Arc 1960 to WGS 84 (3)","","","","Tanzania.","9603","-175.0","-23.0","-303.0","","","","","9001","","","","","","","1998-03-12 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_184[] = {"1286","Segora to WGS 84 (1)","","","","Indonesia - Kalimantan.","9603","-403.0","684.0","41.0","","","","","9001","","","","","","","1998-03-12 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_185[] = {"1287","Pulkovo 1942 to WGS 84 (3)","","","","Hungary.","9603","28.0","-121.0","-77.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","98.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_186[] = {"1288","Pulkovo 1942 to WGS 84 (4)","","","","Poland.","9603","23.0","-124.0","-82.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","98.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_187[] = {"1289","Pulkovo 1942 to WGS 84 (5)","","","","Czech Republic.","9603","26.0","-121.0","-78.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","98.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_188[] = {"1290","Pulkovo 1942 to WGS 84 (6)","","","","Latvia.","9603","24.0","-124.0","-82.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","98.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_189[] = {"1291","Pulkovo 1942 to WGS 84 (7)","","","","Kazakstan.","9603","15.0","-130.0","-84.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","98.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_190[] = {"1292","Pulkovo 1942 to WGS 84 (8)","","","","Albania.","9603","24.0","-130.0","-92.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","98.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_191[] = {"1293","Pulkovo 1942 to WGS 84 (9)","","","","Romania.","9603","28.0","-121.0","-77.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","98.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_192[] = {"1294","Voirol 1875 to WGS 84 (1)","","","","Algeria - north of 35g (31 deg 30 min) North.","9603","-73.0","-247.0","227.0","","","","","9001","","","","","","","1998-03-12 00:00:00","U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_193[] = {"1295","Naparima 1972 to WGS 84 (2)","","","","Trinidad and Tobago.","9603","-0.465","372.095","171.736","","","","","9001","","","","","","","1998-11-11 00:00:00","Trinidad Ministry of Energy and Energy Industries.","EPSG","","98/38",NULL};
+datafile_rows_t trf_nonpolynomial_row_194[] = {"1296","Trinidad 1903 to WGS 84 (1)","","","","Trinidad.","9603","-61.702","284.488","472.052","","","","","9001","","","","","","","1998-11-11 00:00:00","Trinidad Ministry of Energy and Energy Industries.","EPSG","","98/38",NULL};
+datafile_rows_t trf_nonpolynomial_row_195[] = {"1297","Tete to Moznet (1)","","","","Mozambique.","9607","-115.064","-87.39","-101.716","0.058","-4.001","2.062","9.366","9001","9104","","9202","","","","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","Mean of 32 stations. Residuals as high as 30 metres. To reduce the size of the residuals; four regional parameter sets (codes 1298-1301) were developed.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_196[] = {"1298","Tete to Moznet (2)","","","","Mozambique - Maputo province and southern part of Gaza province; i.e. south of approximately 24 deg S.","9607","-82.875","-57.097","-156.768","2.158","-1.524","0.982","-0.359","9001","9104","","9202","","","","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","Mean of 9 stations; residuals are generally under 1 metre.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_197[] = {"1299","Tete to Moznet (3)","","","","Mozambique - provinces of Gaza; Inhambane and southern parts of Sofala and Manhica; i.e. between approximately 24 and 20 deg South.","9607","-138.527","-91.999","-114.591","0.14","-3.363","2.217","11.748","9001","9104","","9202","","","","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","Mean of 6 stations; residuals are generally under 4 metres.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_198[] = {"1300","Tete to Moznet (4)","","","","Mozambique - provinces of Sofala north of Beira corridor; Manhica; Tete and Zambezia; i.e. between approximately 20 and 16 deg South.","9607","-73.472","-51.66","-112.482","-0.953","-4.6","2.368","0.586","9001","9104","","9202","","","","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","Mean of 11 stations; residuals are generally under 3 metres.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_199[] = {"1301","Tete to Moznet (5)","","","","Mozambique - provinces of Nampula; Niassa; Cabo Delgado; i.e. north of approximately 16 deg S.","9607","219.315","168.975","-166.145","-0.198","-5.926","2.356","-57.104","9001","9104","","9202","","","","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","Mean of 7 stations; residuals are 5-10 metres.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_200[] = {"1302","Moznet to WGS 84 (1)","","","","Mozambique.","9607","0.0","0.0","0.0","0.0","0.0","0.0","0.0","9001","9104","","9202","","","","1998-04-16 00:00:00","EPSG","EPSG","For many purposes Moznet can be considered to be coincident with WGS 84. Accuracy better than 1 metre.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_201[] = {"1303","Pulkovo 1942 to WGS 84 (10)","","","","Kazakstan - Caspian.","9606","43.661","-103.342","-124.117","1.659","-0.824","0.653","0.59","9001","9104","","9202","","","","1998-04-16 00:00:00","KazakCaspiShelf consortium.","EPSG","Mean of 13 stations along entire Kazak coastline; residuals under 2 m.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_202[] = {"1304","Indian 1975 to WGS 84 (2)","","","","Thailand.","9603","210.0","814.0","289.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_203[] = {"1305","Tokyo to WGS 84 (5)","","","","South Korea.","9603","-147.0","506.0","687.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_204[] = {"1306","MGI to WGS 84 (1)","","","","MEAN FOR Boznia and Herzegovina; Croatia; Serbia; Slovenia.","9603","682.0","-203.0","480.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_205[] = {"1307","Naparima 1972 to WGS 84 (3)","","","","Trinidad & Tobago.","9603","-2.0","374.0","172.0","","","","","9001","","","","","","","1998-04-16 00:00:00","U.S. Defense Mapping Agency  TR8350.2 December 1987.","EPSG","See remarks for code 1192.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_206[] = {"1308","NAD83 to WGS 84 (4)","","","","United States (USA)","9607","-0.9738","1.9453","0.5486","-0.00000013357","-0.00000004872","-0.00000005507","0.0","9001","9101","","9202","","","","1999-04-22 00:00:00"," http://www.ngs.noaa.gov/CORS/Derivation.html","EPSG","Strictly between NAD83 and ITRF94(1996.0).  Superseded by NAD83 to WGS 84 (5) (code 1515).","99.12  99.38",NULL};
+datafile_rows_t trf_nonpolynomial_row_207[] = {"1309","DHDN to ETRF89 (1)","","","","Germany - former west Germany.","9607","582.0","105.0","414.0","-1.04","-0.35","3.08","8.3","9001","9104","","9202","","","","1998-06-30 00:00:00","Institute for Cartography and Geodesy; Leipzig.","EPSG","Mean of 69 stations; residuals under 5 m.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_208[] = {"1310","Pulkovo 1942 to ETRF89 (1)","","","","Germany - former east Germany - Brandenburg; Mecklenburg-Vorpommern; Sachsen-Anhalt.","9607","24.0","-123.0","-94.0","-0.02","0.25","0.13","1.1","9001","9104","","9202","","","","1998-06-30 00:00:00","Institute for Cartography and Geodesy; Leipzig.","EPSG","Mean of 20 stations; residuals under 2 m.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_209[] = {"1311","ED50 to WGS 84 (Common Offshore)","ED50 to WGS 84 (18)","","","United Kingdom - UKCS offshore east of 6 deg west.","9606","-89.5","-93.8","-123.1","0.0","0.0","-0.156","1.2","9001","9104","","9202","","","","1998-06-30 00:00:00","The Hydrographic Journal; vol 52 page 50.","EPSG","Recommended transformation for UKCS petroleum purposes.  Based on ED50 to WGS72 (precise ephemeris) 6-nations agreement of 1981 to which precise to broadcas [...]
+datafile_rows_t trf_nonpolynomial_row_210[] = {"1312","NAD27 to NAD83 (3)","","","","Canada.","9614","","","","","","","","","9104","","","NTv1_0.gsb","","","1999-04-22 00:00:00","Geomatics Canada - Geodetic Survey Division.","EPSG","Uses NTv1 method.  Superseded in 1997 by NTv2 (non-poly transformation code 1313) except in Quebec.   Input expects longitudes to be positive west; EPSG GeogCS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_211[] = {"1313","NAD27 to NAD83 (4)","","","","Canada.","9615","","","","","","","","","9104","","","NTv2_0.gsb","","","1999-04-22 00:00:00","http://www.geod.nrcan.gc.ca/products/html-public/GSDapps/English/NTv2_Fact_Sheet.html","EPSG","Uses NTv2 data files.  Supersedes  NTv1 (non-poly transformation code 1312) except in Quebec.  Input expects longitudes to be positive west; EPSG GeogCS NAD27 (code 4267) and (code 4269) have longitudes positive east. [...]
+datafile_rows_t trf_nonpolynomial_row_212[] = {"1314","OSGB 1936 to WGS 84 (Petroleum)","","","","United Kingdom (UKCS) - Great Britain (GB) - England; Scotland; Wales; - North Sea.","9606","446.448","-125.157","542.06","0.15","0.247","0.842","-20.489","9001","9104","","9202","","","","1998-11-11 00:00:00","UK Offshore Operators Association.","EPSG","Accuracy better than 4m and generally better than 2m.  For a more accurate transformation contact the Ordnance Survey of Great Britain.","" [...]
+datafile_rows_t trf_nonpolynomial_row_213[] = {"1315","OSGB 1936 to ED50 (UKOOA)","","","","United Kingdom (UKCS) - Great Britain (GB) - England; Scotland; Wales; - North Sea.","9606","535.948","-31.357","665.16","0.15","0.247","0.998","-21.689","9001","9104","","9202","","","","1998-11-11 00:00:00","UK Offshore Operators Association.","EPSG","This transformation is concatenated from OSGB36 to WGS 84 (Petroleum) (code 1314) minus ED50 to WGS 84 (Common Offshore) (code 1311).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_214[] = {"1316","Manoca to WGS 84 (1)","","","","Cameroon.","9603","-70.9","-151.8","-41.4","","","","","9001","","","","","","","1998-11-11 00:00:00","Stolt Comex Seaway and Geoid for Elf.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_215[] = {"1317","Camacupa to WGS 72BE (1)","","","","Angola - offshore.","9603","-37.2","-370.6","-228.5","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Derived by Geophysical Services Inc. in 1979 from mean of Transit results at 7 stations.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_216[] = {"1318","Camacupa to WGS 84 (1)","","","","Angola - offshore block 5.","9603","-42.01","-332.21","-229.75","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Used by Conoco.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_217[] = {"1319","Camacupa to WGS 84 (2)","","","","Angola - offshore block 2.","9603","-40.0","-354.0","-224.0","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Used by Texaco.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_218[] = {"1320","Camacupa to WGS 84 (3)","","","","Angola - offshore blocks 1 and 16.","9606","-37.2","-370.6","-224.0","0.0","0.0","0.554","0.219","9001","9104","8901","9202","","","","1998-12-14 00:00:00","EPSG","EPSG","Used by Shell prior to 1994.  Superseded by Camacupa to WGS 84 (9).","98.56",NULL};
+datafile_rows_t trf_nonpolynomial_row_219[] = {"1321","Camacupa to WGS 84 (4)","","","","Angola - offshore blocks 7 and 8.  Also used rounded to integer metre for GSI/HGS/Western Geophysical speculative seismic data.","9603","-42.5","-342.5","-228.1","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Derived as mean of 123 Transit passes at station Cabo Ledo NE base in January 1989.  Used by Total for block 8. Used by Elf for block 7 up to December 1992 then supers [...]
+datafile_rows_t trf_nonpolynomial_row_220[] = {"1322","Camacupa to WGS 84 (5)","","","","Angola - offshore block 3.","9603","-55.5","-348.0","-229.2","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Derived at station Djeno during coordination of platform PAL F2 in February 1992. Used by Elf for block 3 up to December 1992 then superseded by Camacupa to WGS 84 (7).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_221[] = {"1323","Camacupa to WGS 84 (6)","","","","Angola - offshore block 7.","9603","-43.0","-337.0","-233.0","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Derived at Luanda observatory December 1992.  Used by Elf for 1993 block 7 shallow water survey.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_222[] = {"1324","Camacupa to WGS 84 (7)","","","","Angola - offshore blocks 3  7  15 and 17.","9603","-48.0","-345.0","-231.0","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Derived at platform PAL F2 in December 1992.  Used by Elf for blocks 3, 7 and 17 between December 1992 and 1994 then superseded by Camacupa to WGS 84 (10).  Used by Exxon for block 15 since 1993.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_223[] = {"1325","Camacupa to WGS 84 (8)","","","","Angola - offshore block 2.","9603","-48.6","-345.1","-230.8","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Derived at platform PAL F2 in December 1992. Used by Total for block 2 between December 1992 and 1994 then superseded by Camacupa to WGS 84 (10).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_224[] = {"1326","Camacupa to WGS 84 (9)","","","","Angola - offshore blocks 1 16 and 18.","9606","-41.057","-374.564","-226.287","0.0","0.0","0.554","0.219","9001","9104","8901","9202","","","","1998-12-14 00:00:00","EPSG","EPSG","Used by Shell since 1994.  Supersedes Camacupa to WGS 84 (3).","98.56",NULL};
+datafile_rows_t trf_nonpolynomial_row_225[] = {"1327","Camacupa to WGS 84 (10)","","","","Angola - offshore blocks 2  3 17 and 31-33.","9603","-50.9","-347.6","-231.0","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Derived at platform PAL F2 in 1994 by Topnav using Doris.  Used by Elf in blocks 3 and 17 since 1994.  Used by Total in block 2 since 1994. Adopted by BP-Amoco Elf and Exxon for blocks 31-33.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_226[] = {"1328","Malongo 1987 to Mhast (1)","","","","Angola - Cabinda offshore.","9603","0.0","0.0","0.0","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Malongo 1987 is an offshore extension of Mhast adopted by Chevron in 1987.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_227[] = {"1329","Mhast to WGS 84 (1)","","","","Angola - Cabinda offshore.","9603","-252.95","-4.11","-96.38","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_228[] = {"1330","Malongo 1987 to WGS 84 (1)","","","","Angola - Cabinda offshore.","9603","-252.95","-4.11","-96.38","","","","","9001","","","","","","","1998-11-11 00:00:00","EPSG","EPSG","Used by Chevron.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_229[] = {"1331","EST92 to ETRF89 (1)","","","","Estonia","9607","0.0","0.0","0.0","0.0","0.0","0.0","0.0","9001","9104","","9202","","","","1998-12-14 00:00:00","http://www.geo.ut.ee/~raivo/estcoord.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_230[] = {"1332","Pulkovo 1942 to EST92 (1)","","","","Estonia.","9607","21.53219","-97.00027","-60.74046","-0.99548","-0.58147","-0.2418","-4.5981","9001","9104","","9202","","","","1998-12-14 00:00:00","http://www.geo.ut.ee/~raivo/estcoord.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_231[] = {"1333","EST92 to WGS84 (1)","","","","Estonia.","9607","0.055","-0.541","-0.185","-0.0183","0.0003","0.007","-0.014","9001","9104","","9202","","","","1998-12-14 00:00:00","http://www.geo.ut.ee/~raivo/estcoord.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_232[] = {"1334","Pulkovo 1942 to WGS84 (12)","","","","Estonia.","9607","21.58719","-97.54127","-60.92546","-1.01378","-0.58117","-0.2348","-4.6121","9001","9104","","9202","","","","1998-12-14 00:00:00","http://www.geo.ut.ee/~raivo/estcoord.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_233[] = {"1335","Tokyo to WGS 84 (6)","","","","Japan - 45d 20m to 46d N; 141d to 142d E.","9618","7.92","-13.88","26.1","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_234[] = {"1336","Tokyo to WGS 84 (7)","","","","Japan - 45d 20m to 46d N; 142d to 143d E.","9618","7.94","-13.97","26.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_235[] = {"1337","Tokyo to WGS 84 (8)","","","","Japan - 44deg 40min to 45deg 20min N; 141deg to 142deg E.","9618","8.1","-13.81","27.2","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_236[] = {"1338","Tokyo to WGS 84 (9)","","","","Japan - 44deg 40min to 45deg 20min N; 142deg to 143deg E.","9618","8.15","-13.95","28.4","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_237[] = {"1339","Tokyo to WGS 84 (10)","","","","Japan - 44deg to 44deg 40min N; 141deg to 142deg E.","9618","8.37","-13.65","29.0","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_238[] = {"1340","Tokyo to WGS 84 (11)","","","","Japan - 44deg to 44deg 40min N; 142deg to 143deg E.","9618","8.44","-13.87","30.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_239[] = {"1341","Tokyo to WGS 84 (12)","","","","Japan - 44deg to 44deg 40min N; 143deg to 144deg E.","9618","8.61","-14.08","30.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_240[] = {"1342","Tokyo to WGS 84 (13)","","","","Japan - 44deg to 44deg 40min N; 144deg to 145deg E.","9618","8.73","-14.3","30.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_241[] = {"1343","Tokyo to WGS 84 (14)","","","","Japan - 43deg 20min to 44deg N; 141deg to 142deg E.","9618","8.63","-13.49","30.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_242[] = {"1344","Tokyo to WGS 84 (15)","","","","Japan - 43deg 20min to 44deg N; 142deg to 143deg E.","9618","8.71","-13.73","31.6","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_243[] = {"1345","Tokyo to WGS 84 (16)","","","","Japan - 43deg 20min to 44deg N; 143deg to 144deg E.","9618","8.84","-14.03","31.2","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_244[] = {"1346","Tokyo to WGS 84 (17)","","","","Japan - 43deg 20min to 44deg N; 144deg to 145deg E.","9618","8.98","-14.33","32.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_245[] = {"1347","Tokyo to WGS 84 (18)","","","","Japan - 43deg 20min to 44deg N; 145deg to 146deg E.","9618","9.1","-14.56","32.6","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_246[] = {"1348","Tokyo to WGS 84 (19)","","","","Japan - 42deg 40min to 43deg 20min N; 140deg to 141deg E.","9618","8.79","-13.0","33.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_247[] = {"1349","Tokyo to WGS 84 (20)","","","","Japan - 42deg 40min to 43deg 20min N; 141deg to 142deg E.","9618","8.84","-13.31","31.4","","","","","9001","9104","","","","","","1999-11-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","99.77",NULL};
+datafile_rows_t trf_nonpolynomial_row_248[] = {"1350","Tokyo to WGS 84 (21)","","","","Japan - 42deg 40min to 43deg 20min N; 142deg to 143deg E.","9618","8.98","-13.59","30.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_249[] = {"1351","Tokyo to WGS 84 (22)","","","","Japan - 42deg 40min to 43deg 20min N; 143deg to 144deg E.","9618","9.1","-13.91","29.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_250[] = {"1352","Tokyo to WGS 84 (23)","","","","Japan - 42deg 40min to 43deg 20min N; 144deg to 145deg E.","9618","9.17","-14.27","31.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_251[] = {"1353","Tokyo to WGS 84 (24)","","","","Japan - 42deg 40min to 43deg 20min N; 145deg to 146deg E.","9618","9.23","-14.52","31.4","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_252[] = {"1354","Tokyo to WGS 84 (25)","","","","Japan - 42deg to 42deg 40min N; 139deg to 140deg E.","9618","8.9","-12.68","34.4","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_253[] = {"1355","Tokyo to WGS 84 (26)","","","","Japan - 42deg to 42deg 40min N; 140deg to 141deg E.","9618","8.99","-12.8","34.2","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_254[] = {"1356","Tokyo to WGS 84 (27)","","","","Japan - 42deg to 42deg 40min N; 141deg to 142deg E.","9618","9.0","-13.07","31.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_255[] = {"1357","Tokyo to WGS 84 (28)","","","","Japan - 42deg to 42deg 40min N; 142deg to 143deg E.","9618","9.21","-13.51","27.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_256[] = {"1358","Tokyo to WGS 84 (29)","","","","Japan - 42deg to 42deg 40min N; 143deg to 144deg E.","9618","9.33","-13.66","23.8","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_257[] = {"1359","Tokyo to WGS 84 (30)","","","","Japan - 41deg 20min to 42deg N; 140deg to 141deg E.","9618","9.25","-12.72","34.2","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_258[] = {"1360","Tokyo to WGS 84 (31)","","","","Japan - 41deg 20min to 42deg N; 141deg to 142deg E.","9618","9.39","-12.91","31.8","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_259[] = {"1361","Tokyo to WGS 84 (32)","","","","Japan - 40deg 40min to 41deg 20min N; 140deg to 141deg E.","9618","9.55","-12.63","35.6","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_260[] = {"1362","Tokyo to WGS 84 (33)","","","","Japan - 40deg 40min to 41deg 20min N; 141deg to 142deg E.","9618","9.62","-12.82","34.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_261[] = {"1363","Tokyo to WGS 84 (34)","","","","Japan - 40deg to 40deg 40min N; 139deg to 140deg E.","9618","9.81","-12.29","36.6","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_262[] = {"1364","Tokyo to WGS 84 (35)","","","","Japan - 40deg to 40deg 40min N; 140deg to 141deg E.","9618","9.81","-12.45","37.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_263[] = {"1365","Tokyo to WGS 84 (36)","","","","Japan - 40deg to 40deg 40min N; 141deg to 142deg E.","9618","9.92","-12.79","38.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_264[] = {"1366","Tokyo to WGS 84 (37)","","","","Japan - 39deg 20min to 40deg N; 139deg to 140deg E.","9618","9.91","-12.21","36.6","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_265[] = {"1367","Tokyo to WGS 84 (38)","","","","Japan - 39deg 20min to 40deg N; 140deg to 141deg E.","9618","10.08","-12.35","39.0","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_266[] = {"1368","Tokyo to WGS 84 (39)","","","","Japan - 39deg 20min to 40deg N; 141deg to 142deg E.","9618","10.19","-12.74","40.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_267[] = {"1369","Tokyo to WGS 84 (40)","","","","Japan - 38deg 40min to 39deg 20min N; 139deg to 140deg E.","9618","10.29","-12.13","38.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_268[] = {"1370","Tokyo to WGS 84 (41)","","","","Japan - 38deg 40min to 39deg 20min N; 140deg to 141deg E.","9618","10.33","-12.27","40.1","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_269[] = {"1371","Tokyo to WGS 84 (42)","","","","Japan - 38deg 40min to 39deg 20min N; 141deg to 142deg E.","9618","10.45","-12.61","41.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_270[] = {"1372","Tokyo to WGS 84 (43)","","","","Japan - 38deg to 38deg 40min N; 139deg to 140deg E.","9618","10.54","-11.96","39.1","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_271[] = {"1373","Tokyo to WGS 84 (44)","","","","Japan - 38deg to 38deg 40min N; 140deg to 141deg E.","9618","10.65","-12.27","41.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_272[] = {"1374","Tokyo to WGS 84 (45)","","","","Japan - 38deg to 38deg 40min N; 141deg to 142deg E.","9618","10.67","-12.5","41.1","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_273[] = {"1375","Tokyo to WGS 84 (46)","","","","Japan - 37deg 20min to 38deg N; 136deg to 137deg E.","9618","10.67","-10.86","38.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_274[] = {"1376","Tokyo to WGS 84 (47)","","","","Japan - 37deg 20min to 38deg N; 137deg to 138deg E.","9618","10.68","-10.97","36.0","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_275[] = {"1377","Tokyo to WGS 84 (48)","","","","Japan - 37deg 20min to 38deg N; 138deg to 139deg E.","9618","10.8","-11.53","39.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_276[] = {"1378","Tokyo to WGS 84 (49)","","","","Japan - 37deg 20min to 38deg N; 139deg to 140deg E.","9618","10.8","-11.73","40.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_277[] = {"1379","Tokyo to WGS 84 (50)","","","","Japan - 37deg 20min to 38deg N; 140deg to 141deg E.","9618","10.92","-12.16","42.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_278[] = {"1380","Tokyo to WGS 84 (51)","","","","Japan - 37deg 20min to 38deg N; 141deg to 142deg E.","9618","11.0","-12.25","41.2","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_279[] = {"1381","Tokyo to WGS 84 (52)","","","","Japan - 36deg 40min to 37deg 20min N; 136deg to 137deg E.","9618","10.83","-10.77","36.2","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_280[] = {"1382","Tokyo to WGS 84 (53)","","","","Japan - 36deg 40min to 37deg 20min N; 137deg to 138deg E.","9618","10.95","-11.0","38.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_281[] = {"1383","Tokyo to WGS 84 (54)","","","","Japan - 36deg 40min to 37deg 20min N; 138deg to 139deg E.","9618","10.97","-11.34","40.8","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_282[] = {"1384","Tokyo to WGS 84 (55)","","","","Japan - 36deg 40min to 37deg 20min N; 139deg to 140deg E.","9618","11.04","-11.69","43.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_283[] = {"1385","Tokyo to WGS 84 (56)","","","","Japan - 36deg 40min to 37deg 20min N; 140deg to 141deg E.","9618","11.17","-12.05","42.6","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_284[] = {"1386","Tokyo to WGS 84 (57)","","","","Japan - 36deg to 37deg 40min N; 136deg to 137deg E.","9618","11.11","-10.59","37.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_285[] = {"1387","Tokyo to WGS 84 (58)","","","","Japan - 36deg to 37deg 40min N; 137deg to 138deg E.","9618","11.16","-10.97","40.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_286[] = {"1388","Tokyo to WGS 84 (59)","","","","Japan - 36deg to 37deg 40min N; 138deg to 139deg E.","9618","11.29","-11.23","42.4","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_287[] = {"1389","Tokyo to WGS 84 (60)","","","","Japan - 36deg to 37deg 40min N; 139deg to 140deg E.","9618","11.36","-11.59","42.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_288[] = {"1390","Tokyo to WGS 84 (61)","","","","Japan - 36deg to 37deg 40min N; 140deg to 141deg E.","9618","11.44","-11.88","40.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_289[] = {"1391","Tokyo to WGS 84 (62)","","","","Japan - 35deg 20min to 36deg N; 132deg to 133deg E.","9618","11.27","-9.31","30.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_290[] = {"1392","Tokyo to WGS 84 (63)","","","","Japan - 35deg 20min to 36deg N; 133deg to 134deg E.","9618","11.33","-9.52","33.8","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_291[] = {"1393","Tokyo to WGS 84 (64)","","","","Japan - 35deg 20min to 36deg N; 134deg to 135deg E.","9618","11.38","-9.86","34.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_292[] = {"1394","Tokyo to WGS 84 (65)","","","","Japan - 35deg 20min to 36deg N; 135deg to 136deg E.","9618","11.41","-10.14","35.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_293[] = {"1395","Tokyo to WGS 84 (66)","","","","Japan - 35deg 20min to 36deg N; 136deg to 137deg E.","9618","11.39","-10.52","37.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_294[] = {"1396","Tokyo to WGS 84 (67)","","","","Japan - 35deg 20min to 36deg N; 137deg to 138deg E.","9618","11.49","-10.83","39.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_295[] = {"1397","Tokyo to WGS 84 (68)","","","","Japan - 35deg 20min to 36deg N; 138deg to 139deg E.","9618","11.58","-11.21","41.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_296[] = {"1398","Tokyo to WGS 84 (69)","","","","Japan - 35deg 20min to 36deg N; 139deg to 140deg E.","9618","11.65","-11.53","38.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_297[] = {"1399","Tokyo to WGS 84 (70)","","","","Japan - 35deg 20min to 36deg N; 140deg to 141deg E.","9618","11.72","-11.8","34.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_298[] = {"1400","Tokyo to WGS 84 (71)","","","","Japan - 34deg 40min to 35deg 20min N; 132deg to 133deg E.","9618","11.44","-9.21","32.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_299[] = {"1401","Tokyo to WGS 84 (72)","","","","Japan - 34deg 40min to 35deg 20min N; 133deg to 134deg E.","9618","11.47","-9.52","35.2","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_300[] = {"1402","Tokyo to WGS 84 (73)","","","","Japan - 34deg 40min to 35deg 20min N; 134deg to 135deg E.","9618","11.55","-9.8","35.4","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_301[] = {"1403","Tokyo to WGS 84 (74)","","","","Japan - 34deg 40min to 35deg 20min N; 135deg to 136deg E.","9618","11.61","-10.12","35.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_302[] = {"1404","Tokyo to WGS 84 (75)","","","","Japan - 34deg 40min to 35deg 20min N; 136deg to 137deg E.","9618","11.66","-10.47","37.0","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_303[] = {"1405","Tokyo to WGS 84 (76)","","","","Japan - 34deg 40min to 35deg 20min N; 137deg to 138deg E.","9618","11.78","-10.79","39.8","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_304[] = {"1406","Tokyo to WGS 84 (77)","","","","Japan - 34deg 40min to 35deg 20min N; 138deg to 139deg E.","9618","11.85","-11.13","39.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_305[] = {"1407","Tokyo to WGS 84 (78)","","","","Japan - 34deg 40min to 35deg 20min N; 139deg to 140deg E.","9618","11.9","-11.47","36.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_306[] = {"1408","Tokyo to WGS 84 (79)","","","","Japan - 34deg 40min to 35deg 20min N; 140deg to 141deg E.","9618","11.91","-11.69","33.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_307[] = {"1409","Tokyo to WGS 84 (80)","","","","Japan - 34deg to 34deg 40min N; 130deg to 131deg E.","9618","11.65","-8.59","29.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_308[] = {"1410","Tokyo to WGS 84 (81)","","","","Japan - 34deg to 34deg 40min N; 131deg to 132deg E.","9618","11.68","-8.8","30.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_309[] = {"1411","Tokyo to WGS 84 (82)","","","","Japan - 34deg to 34deg 40min N; 132deg to 133deg E.","9618","11.73","-9.04","30.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_310[] = {"1412","Tokyo to WGS 84 (83)","","","","Japan - 34deg to 34deg 40min N; 133deg to 134deg E.","9618","11.72","-9.48","35.1","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_311[] = {"1413","Tokyo to WGS 84 (84)","","","","Japan - 34deg to 34deg 40min N; 134deg to 135deg E.","9618","11.81","9.74","35.8","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_312[] = {"1414","Tokyo to WGS 84 (85)","","","","Japan - 34deg to 34deg 40min N; 135deg to 136deg E.","9618","11.88","-10.1","37.1","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_313[] = {"1415","Tokyo to WGS 84 (86)","","","","Japan - 34deg to 34deg 40min N; 136deg to 137deg E.","9618","11.91","-10.35","37.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_314[] = {"1416","Tokyo to WGS 84 (87)","","","","Japan - 34deg to 34deg 40min N; 137deg to 138deg E.","9618","11.9","-10.7","39.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_315[] = {"1417","Tokyo to WGS 84 (88)","","","","Japan - 34deg to 34deg 40min N; 138deg to 139deg E.","9618","12.02","-11.09","38.2","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_316[] = {"1418","Tokyo to WGS 84 (89)","","","","Japan - 33deg 20min to 34deg N; 129deg to 130deg E.","9618","11.87","-8.23","29.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_317[] = {"1419","Tokyo to WGS 84 (90)","","","","Japan - 33deg 20min to 34deg N; 130deg to 131deg E.","9618","11.84","-8.44","30.6","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_318[] = {"1420","Tokyo to WGS 84 (91)","","","","Japan - 33deg 20min to 34deg N; 131deg to 132deg E.","9618","11.94","-8.71","30.2","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_319[] = {"1421","Tokyo to WGS 84 (92)","","","","Japan - 33deg 20min to 34deg N; 132deg to 133deg E.","9618","11.99","-9.02","30.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_320[] = {"1422","Tokyo to WGS 84 (93)","","","","Japan - 33deg 20min to 34deg N; 133deg to 134deg E.","9618","12.05","-9.36","35.0","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_321[] = {"1423","Tokyo to WGS 84 (94)","","","","Japan - 33deg 20min to 34deg N; 134deg to 135deg E.","9618","12.1","-9.64","35.5","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_322[] = {"1424","Tokyo to WGS 84 (95)","","","","Japan - 33deg 20min to 34deg N; 135deg to 136deg E.","9618","12.1","-10.08","37.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_323[] = {"1425","Tokyo to WGS 84 (96)","","","","Japan - 33deg 20min to 34deg N; 136deg to 137deg E.","9618","12.07","-10.25","37.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_324[] = {"1426","Tokyo to WGS 84 (97)","","","","Japan - 32deg 40min to 33deg 20min N; 129deg to 130deg E.","9618","12.0","-8.15","32.1","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_325[] = {"1427","Tokyo to WGS 84 (98)","","","","Japan - 32deg 40min to 33deg 20min N; 130deg to 131deg E.","9618","12.06","-8.38","31.0","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_326[] = {"1428","Tokyo to WGS 84 (99)","","","","Japan - 32deg 40min to 33deg 20min N; 131deg to 132deg E.","9618","12.17","-8.69","30.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_327[] = {"1429","Tokyo to WGS 84 (100)","","","","Japan - 32deg 40min to 33deg 20min N; 132deg to 133deg E.","9618","12.23","-8.99","31.7","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_328[] = {"1430","Tokyo to WGS 84 (101)","","","","Japan - 32deg 40min to 33deg 20min N; 133deg to 134deg E.","9618","12.21","-9.21","34.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_329[] = {"1431","Tokyo to WGS 84 (102)","","","","Japan - 32deg 40min to 33deg 20min N; 134deg to 135deg E.","9618","12.28","-9.6","33.3","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_330[] = {"1432","Tokyo to WGS 84 (103)","","","","Japan - 32deg to 32deg 40min N; 130deg to 131deg E.","9618","12.28","-8.25","31.0","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_331[] = {"1433","Tokyo to WGS 84 (104)","","","","Japan - 32deg to 32deg 40min N; 131deg to 132deg E.","9618","12.37","-8.55","29.1","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_332[] = {"1434","Tokyo to WGS 84 (105)","","","","Japan - 31deg 20min to 32deg N; 130deg to 131deg E.","9618","12.53","-8.21","31.0","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_333[] = {"1435","Tokyo to WGS 84 (106)","","","","Japan - 31deg 20min to 32deg N; 131deg to 132deg E.","9618","12.57","-8.4","28.4","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_334[] = {"1436","Tokyo to WGS 84 (107)","","","","Japan - 30deg 40min to 31deg 20min N; 130deg to 131deg E.","9618","12.71","-8.17","29.9","","","","","9001","9104","","","","","","1998-12-12 00:00:00","http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_335[] = {"1437","RT90 to ETRF89 (1)","","","","Sweden","9607","419.3836","99.3335","591.3451","-0.850389","-1.817277","7.862238","-0.99496","9001","9104","","9202","","","","1999-04-22 00:00:00","National Land Survey of Sweden.","EPSG","This transformation is actually between ETRF89 and RR92.  RR92 is a geographic 3D coordinate system where the horizontal component is RT90.","99.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_336[] = {"1438","Fahud to WGS 84 (2)","","","","Oman.","9606","-333.102","-11.02","230.69","0.0","0.0","0.554","0.219","9001","9104","","9202","","","","1999-04-22 00:00:00","Petroleum Development Oman","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_337[] = {"1439","PSD93 to WGS 84 (1)","","","","Oman.","9606","-180.624","-225.516","173.919","-0.81","-1.898","8.336","16.71006","9001","9104","","9202","","","","1999-04-22 00:00:00","Petroleum Development Oman","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_338[] = {"1440","ED50 to WGS 84 (19)","","","","Greece.","9603","-86.0","-92.2","-127.5","","","","","9001","","","","","","","1999-04-22 00:00:00","Geodesy Department; Hellenic Petroleum s.a.","EPSG","Used in oil industry.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_339[] = {"1441","Antigua 1943 to WGS 84 (1)","","","","Antigua.","9603","-255.0","-15.0","71.0","","","","","9001","","","","","","","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_340[] = {"1442","Dominica 1945 to WGS 84 (1)","","","","Dominica.","9603","725.0","685.0","536.0","","","","","9001","","","","","","","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_341[] = {"1443","Grenada 1953 to WGS 84 (1)","","","","Grenada.","9603","72.0","213.7","93.0","","","","","9001","","","","","","","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_342[] = {"1444","Montserrat 1958 to WGS 84 (1)","","","","Montserrat.","9603","174.0","359.0","365.0","","","","","9001","","","","","","","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_343[] = {"1445","St. Kitts 1955 to WGS 84 (1)","","","","Saint Kitts and Nevis.","9603","9.0","183.0","236.0","","","","","9001","","","","","","","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_344[] = {"1446","St. Lucia 1955 to WGS 84 (1)","","","","Saint Lucia.","9603","-149.0","128.0","296.0","","","","","9001","","","","","","","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_345[] = {"1447","Anguilla 1957 to WGS 84 (1)","","","","Anguilla.","9619","-18.0","4.4","","","","","","","9104","","","","","","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_346[] = {"1450","ED50 to WGS 84 (20)","","","","Norway - offshore between 62 and 65 deg North and west of 5 deg East.","9620","","","","","","8047.0","8046.0","","9102","","","ED50 to WGS 84 (15)","ED50 to WGS 84 (14)","","1999-04-22 00:00:00","Norwegian Mapping Authority note of 13-Feb-1991 \"Om Transformasjon mellom Geodetiske Datum i Norge\"","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_347[] = {"1451","NAD27(CGQ77) to NAD83 (1)","","","","Canada - Quebec","9614","","","","","","","","","9104","","","PQV4.DAC","","","1999-05-15 00:00:00","Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca","EPSG","Uses NT method which expects longitudes positive west; EPSG GeogCSs CGQ77 (code 4609) and NAD83 (code 4269) have longitudes positive east.  Supersedes NAD27 to NAD83 (5) (code xxxx).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_348[] = {"1454","Old Hawaiian to NAD83 (1)","","","","United States (USA) - Hawaii including EEZ.","9613","","","","","","","","","9104","","","hawaii.las","hawaii.los","","1999-05-15 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs Old Hawaiian (code 4135) and NAD83 (code 4269) have longitudes positive east.  NADCON data converts from Old Hawaiian Datum to but ma [...]
+datafile_rows_t trf_nonpolynomial_row_349[] = {"1455","St. Lawrence Island to NAD83 (1)","","","","United States (USA) - Alaska - St. Lawrence Island.","9613","","","","","","","","","9104","","","stlrnc.las","stlrnc.los","","1999-05-15 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs St. Lawrence (code 4136) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from St. Lawrence D [...]
+datafile_rows_t trf_nonpolynomial_row_350[] = {"1456","St. Paul Island to NAD83 (1)","","","","United States (USA) - Alaska - St. Paul Island.","9613","","","","","","","","","9104","","","stpaul.las","stpaul.los","","1999-05-15 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs St. Paul (code 4137) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from St. Paul Datum to but make [...]
+datafile_rows_t trf_nonpolynomial_row_351[] = {"1457","St. George Island to NAD83 (1)","","","","United States (USA) - Alaska - St. George Island.","9613","","","","","","","","","9104","","","stgeorge.las","stgeorge.los","","1999-05-15 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs St. George (code 4138) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from St. George Datum [...]
+datafile_rows_t trf_nonpolynomial_row_352[] = {"1458","AGD66 to GDA94 (2)","","","","Australia - ACT.","9607","-129.193","-41.212","130.73","-0.246","-0.374","-0.329","-2.955","9001","9104","","9202","","","","1999-05-25 00:00:00","http://www.anzlic.org.au/icsm/gdatm/regional.htm","EPSG","1m accuracy.  Recommended for mid-accuracy use in A.C.T.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_353[] = {"1459","AGD66 to GDA94 (3)","","","","Australia - Tasmania.","9607","-120.695","-62.73","165.46","-0.109","0.141","0.116","2.733","9001","9104","","9202","","","","1999-05-25 00:00:00","http://www.anzlic.org.au/icsm/gdatm/regional.htm","EPSG","1m accuracy.  Recommended for mid-accuracy use in Tasmania.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_354[] = {"1460","AGD66 to GDA94 (4)","","","","Australia - New South Wales (NSW) and Victoria.","9607","-119.353","-48.301","139.484","-0.415","-0.26","-0.437","-0.613","9001","9104","","9202","","","","1999-05-25 00:00:00","http://www.anzlic.org.au/icsm/gdatm/regional.htm","EPSG","1m accuracy.  Recommended for mid-accuracy use in NSW and Victoria.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_355[] = {"1461","Puerto Rico to NAD83 (1)","","","","Puerto Rico; Virgin Islands (U.S.); Virgin Islands (British).","9613","","","","","","","","","9104","","","prvi.las","prvi.los","","1999-05-24 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs Puerto Rico (code 4139) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from Puerto Rico Datum [...]
+datafile_rows_t trf_nonpolynomial_row_356[] = {"1462","NAD27 to NAD83 (5)","","","","Canada - Quebec","9614","","","","","","","","","9104","","","GS2783v1.QUE","","","1999-05-24 00:00:00","Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca","EPSG","Uses NT method which expects longitudes positive west; EPSG GeogCSs NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.  Superseded by NAD27(CGQ77) to NAD83 (1) (code 1451).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_357[] = {"1463","NAD27(76) to NAD83 (1)","","","","Canada - Ontario","9615","","","","","","","","","9104","","","May76v20.gsb","","","1999-05-24 00:00:00","Geodetic Survey of Canada   http://www.geod.emr.ca/html-public/GSDapps/English/NTv2_Fact_Sheet.html","EPSG","Uses NT method which expects longitudes positive west; EPSG GeogCSs NAD27(76) (code 4608) and NAD83 (code 4269) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_358[] = {"1464","AGD66 to GDA94 (5)","","","","Australia - Victoria.","9615","","","","","","","","","9104","","","vic_0799.gsb","","","1999-10-20 00:00:00","http://www.osg.vic.gov.au/tools.htm","EPSG","0.1m accuracy.  Input expects longitudes to be positive west; EPSG GeogCS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.","99.67",NULL};
+datafile_rows_t trf_nonpolynomial_row_359[] = {"1466","NGO 1948 (Oslo) to NGO1948","","","","Norway - onshore.","9601","10.43225","","","","","","","","9110","","","","","","1999-11-12 00:00:00","J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.","EPSG","Change of prime meridian.","99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_360[] = {"1467","NTF (Paris) to NTF (1)","","","","France - onshore.","9601","2.5969213","","","","","","","","9105","","","","","","1999-11-12 00:00:00","IGN Paris.","EPSG","Change of prime meridian.","99.63  99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_361[] = {"1468","NTF (Paris) to NTF (2)","","","","France - onshore.","9601","2.201395","","","","","","","","9110","","","","","","1999-11-12 00:00:00","Royal Geographic Society; London","EPSG","Change of prime meridian.  EPSG prefers value from IGN Paris (code 1467).","99.63  99.79",NULL};
+datafile_rows_t trf_nonpolynomial_row_362[] = {"1469","Locodjo 1965 to WGS 84 (1)","","","","Cote D'Ivoire (Ivory Coast)","9603","-125.0","53.0","467.0","","","","","9001","","","","","","","1999-10-20 00:00:00","IGN Paris","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_363[] = {"1470","Abidjan 1987 to WGS 84 (1)","","","","Cote D'Ivoire (Ivory Coast)","9603","-124.76","53.0","466.79","","","","","9001","","","","","","","1999-10-20 00:00:00","IGN Paris","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_364[] = {"1471","MGI to WGS 84 (2)","","","","Austria","9606","-577.326","-90.129","-463.919","-15.8537","-4.55","-16.3489","-2.4232","9001","9113","","9202","","","","1999-10-20 00:00:00","Bundesamt f�r Eich- und Vermessungswesen","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_365[] = {"1472","ATS77 to NAD83(CSRS98) (1)","","","","Canada - New Brunswick","9615","","","","","","","","","9104","","","NT7783v2.gsb","","","1999-10-20 00:00:00","New Brunswick Geographic Information Corporation land and water information standards manual.","EPSG","Introduced in 1999.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_366[] = {"1473","NAD83(CSRS98) to WGS 84 (1)","","","","Canada - New Brunswick","9603","0.0","0.0","0.0","","","","","9001","","","","","","","1999-10-20 00:00:00","EPSG","EPSG","For many purposes NAD83 can be considered to be coincident with WGS 84.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_367[] = {"1474","NAD83 to NAD83(HARN) (1)","","","","United States (USA) - Alabama.","9613","","","","","","","","","9104","","","alhpgn.las","alhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_368[] = {"1475","NAD83 to NAD83(HARN) (2)","","","","United States (USA) - Arizona.","9613","","","","","","","","","9104","","","azhpgn.las","azhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_369[] = {"1476","NAD83 to NAD83(HARN) (3)","","","","United States (USA) - California north of 38 deg N.","9613","","","","","","","","","9104","","","cnhpgn.las","cnhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_370[] = {"1477","NAD83 to NAD83(HARN) (4)","","","","United States (USA) - California south of 38 deg N.","9613","","","","","","","","","9104","","","cshpgn.las","cshpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_371[] = {"1478","NAD83 to NAD83(HARN) (5)","","","","United States (USA) - Colorado.","9613","","","","","","","","","9104","","","cohpgn.las","cohpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_372[] = {"1479","NAD83 to NAD83(HARN) (6)","","","","United States (USA) - Georgia.","9613","","","","","","","","","9104","","","gahpgn.las","gahpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_373[] = {"1480","NAD83 to NAD83(HARN) (7)","","","","United States (USA) - Florida.","9613","","","","","","","","","9104","","","flhpgn.las","flhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_374[] = {"1481","NAD83 to NAD83(HARN) (8)","","","","United States (USA) - Idaho and Montana - east of 113 deg W.","9613","","","","","","","","","9104","","","emhpgn.las","emhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_375[] = {"1482","NAD83 to NAD83(HARN) (9)","","","","United States (USA) - Idaho and Montana - west of 113 deg W.","9613","","","","","","","","","9104","","","wmhpgn.las","wmhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_376[] = {"1483","NAD83 to NAD83(HARN) (10)","","","","United States (USA) - Kentucky.","9613","","","","","","","","","9104","","","kyhpgn.las","kyhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_377[] = {"1484","NAD83 to NAD83(HARN) (11)","","","","United States (USA) - Louisiana.","9613","","","","","","","","","9104","","","lahpgn.las","lahpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_378[] = {"1485","NAD83 to NAD83(HARN) (12)","","","","United States (USA) - Delaware and Maryland.","9613","","","","","","","","","9104","","","mdhpgn.las","mdhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_379[] = {"1486","NAD83 to NAD83(HARN) (13)","","","","United States (USA) - Maine.","9613","","","","","","","","","9104","","","mehpgn.las","mehpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_380[] = {"1487","NAD83 to NAD83(HARN) (14)","","","","United States (USA) - Michigan.","9613","","","","","","","","","9104","","","mihpgn.las","mihpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_381[] = {"1488","NAD83 to NAD83(HARN) (15)","","","","United States (USA) - Mississippi.","9613","","","","","","","","","9104","","","mshpgn.las","mshpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_382[] = {"1489","NAD83 to NAD83(HARN) (16)","","","","United States (USA) - Nebraska.","9613","","","","","","","","","9104","","","nbhpgn.las","nbhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_383[] = {"1490","NAD83 to NAD83(HARN) (17)","","","","United States (USA) - Connecticut; Massachusetts; New Hampshire; Rhode Island; Vermont.","9613","","","","","","","","","9104","","","nehpgn.las","nehpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positiv [...]
+datafile_rows_t trf_nonpolynomial_row_384[] = {"1491","NAD83 to NAD83(HARN) (18)","","","","United States (USA) - New Mexico.","9613","","","","","","","","","9104","","","nmhpgn.las","nmhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_385[] = {"1492","NAD83 to NAD83(HARN) (19)","","","","United States (USA) - New York.","9613","","","","","","","","","9104","","","nyhpgn.las","nyhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_386[] = {"1493","NAD83 to NAD83(HARN) (20)","","","","United States (USA) - North Dakota.","9613","","","","","","","","","9104","","","ndhpgn.las","ndhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_387[] = {"1494","NAD83 to NAD83(HARN) (21)","","","","United States (USA) - Oklahoma.","9613","","","","","","","","","9104","","","okhpgn.las","okhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_388[] = {"1495","NAD83 to NAD83(HARN) (22)","","","","United States (USA) - Puerto Rico and the Virgin Islands.","9613","","","","","","","","","9104","","","pvhpgn.las","pvhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_389[] = {"1496","NAD83 to NAD83(HARN) (23)","","","","United States (USA) - South Dakota.","9613","","","","","","","","","9104","","","sdhpgn.las","sdhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_390[] = {"1497","NAD83 to NAD83(HARN) (24)","","","","United States (USA) - Tennessee","9613","","","","","","","","","9104","","","tnhpgn.las","tnhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_391[] = {"1498","NAD83 to NAD83(HARN) (25)","","","","United States (USA) - Texas east of 100deg West.","9613","","","","","","","","","9104","","","ethpgn.las","ethpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_392[] = {"1499","NAD83 to NAD83(HARN) (26)","","","","United States (USA) - Texas west of 100deg West.","9613","","","","","","","","","9104","","","wthpgn.las","wthpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_393[] = {"1500","NAD83 to NAD83(HARN) (27)","","","","United States (USA) - Virginia.","9613","","","","","","","","","9104","","","vahpgn.las","vahpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_394[] = {"1501","NAD83 to NAD83(HARN) (28)","","","","United States (USA) - Oregan; Washington.","9613","","","","","","","","","9104","","","wohpgn.las","wohpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_395[] = {"1502","NAD83 to NAD83(HARN) (29)","","","","United States (USA) - Wisconsin.","9613","","","","","","","","","9104","","","wihpgn.las","wihpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_396[] = {"1503","NAD83 to NAD83(HARN) (30)","","","","United States (USA) - Wyoming.","9613","","","","","","","","","9104","","","wyhpgn.las","wyhpgn.los","","1999-10-20 00:00:00","US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file","EPSG","Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_397[] = {"1504","Cape to Hartbeesthoek94 (1)","","","","South Africa.","9603","-134.73","-110.92","-292.66","","","","","9001","","","","","","","1999-10-20 00:00:00","Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_398[] = {"1505","Hartbeesthoek94 to WGS 84 (1)","","","","South Africa.","9603","0.0","0.0","0.0","","","","","9001","","","","","","","1999-10-20 00:00:00","EPSG","EPSG","For many purposes Hartbeesthoek94 datum can be considered to be coincident with WGS 84.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_399[] = {"1506","AGD66 to GDA94 (6)","","","","Australia - Tasmania.","9615","","","","","","","","","9104","","","tas_1098.gsb","","","1999-10-20 00:00:00","http://www.delm.tas.gov.au/osg/Geodetic_transform.htm","EPSG","0.1m accuracy.  Input expects longitudes to be positive west; EPSG GeogCS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_400[] = {"1507","AGD66 to GDA94 (7)","","","","Australia - Northern Territory.","9615","","","","","","","","","9104","","","nt_0599.gsb","","","1999-10-20 00:00:00","http://www.anzlic.org.au/icsm/gdatm/chapter7.htm#high","EPSG","0.1m accuracy.  Input expects longitudes to be positive west; EPSG GeogCS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_401[] = {"1508","CH1903 to WGS 84 (1)","","","","Liechtenstein;  Switzerland.","9607","660.077","13.551","369.344","2.484","1.783","2.939","5.66","9001","9113","","9202","","","","1999-10-20 00:00:00","Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.","EPSG","Implemented in Bundesamt f�r Landestopographie programme GRANIT.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_402[] = {"1509","CH1903+ to CHTRF95 (1)","","","","Liechtenstein;  Switzerland.","9603","674.374","15.056","405.346","","","","","9001","","","","","","","1999-10-20 00:00:00","Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_403[] = {"1510","CH1903 to WGS 84 (2)","","","","Liechtenstein;  Switzerland.","9603","674.374","15.056","405.346","","","","","9001","","","","","","","1999-10-20 00:00:00","Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.","EPSG","These parameters are strictly between CH1903+ and CHTRF95 but are used from CH1903 as an approximation which is within the ac [...]
+datafile_rows_t trf_nonpolynomial_row_404[] = {"1511","CHTRF95 to WGS 84 (1)","","","","Liechtenstein;  Switzerland.","9603","0.0","0.0","0.0","","","","","9001","","","","","","","1999-10-20 00:00:00","EPSG","EPSG","For many purposes CHTRF95 can be considered to be coincident with WGS 84.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_405[] = {"1512","Rassadiran to WGS 84 (1)","","","","Iran - Taheri refinery site only.","9603","-133.63","-157.5","-158.62","","","","","9001","","","","","","","1999-10-20 00:00:00","Total-Fina","EPSG","Used only for terminal site.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_406[] = {"1513","FD58 to WGS 84 (1)","","","","Iran - Kangan district.","9603","-241.54","-163.64","396.06","","","","","9001","","","","","","","1999-10-20 00:00:00","Total-Fina","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_407[] = {"1514","ED50(ED77) to WGS 84 (1)","","","","Iran","9606","-110.33","-97.73","-119.85","0.3423","1.1634","0.2715","0.063","9001","9104","","9202","","","","1999-10-20 00:00:00","National Cartographic Centre of Iran","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_408[] = {"1515","NAD83 to WGS 84 (5)","","","","United States (USA)","9607","-0.991","1.9072","0.5129","-0.000000125033","-0.000000046785","-0.000000056529","0.0","9001","9101","","9202","","","","1999-11-05 00:00:00"," http://www.ngs.noaa.gov/CORS/Derivation.html","EPSG","Strictly between NAD83 and ITRF96(1997.0).  Supersedes NAD83 to WGS 84 (4) (code 1308).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_409[] = {"1516","La Canoa to WGS 84 (1)","","","","Venezuela east - Delta Amacuro; Anzoategui; Bolivar; Monagas; Sucre states.","9603","-273.5","110.6","-357.9","","","","","9001","","","","","","","1999-11-05 00:00:00","Lagoven; Gonzalez Losano y Rodriguez; \"Determination de los Parametros de Transformacion para el Oriente del Pais\"; VII Venezuelan Geophysical Congress; September 1994.","EPSG","Also used for PSAD56 to WGS 84 transformations.  Para [...]
+datafile_rows_t trf_nonpolynomial_row_410[] = {"10101","Alabama CS27 East zone","Alabama East","","","United States (USA) - Alabama - Counties east of 86d 37m West.","9807","30.3","-85.5","","","0.99996","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_411[] = {"10102","Alabama CS27 West zone","Alabama West","","","United States (USA) - Alabama - Counties east of 86d 37m West.","9807","30.0","-87.3","","","0.999933333","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_412[] = {"10131","Alabama CS83 East zone","Alabama East","","","United States (USA) - Alabama - Counties east of 86d 37m West.","9807","30.3","-85.5","","","0.99996","200000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_413[] = {"10132","Alabama CS83 West zone","Alabama West","","","United States (USA) - Alabama - Counties east of 86d 37m West.","9807","30.0","-87.3","","","0.999933333","600000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_414[] = {"10201","Arizona Coordinate System  east zone","Arizona East","","","United States (USA) - Arizona - Apache; Cochise; Gila; Graham; Greenlee and Navajo counties; i.e. east of about 110d 45m West.","9807","31.0","-110.1","","","0.9999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_415[] = {"10202","Arizona Coordinate System Central zone","Arizona Central","","","United States (USA) - Arizona - Coconino; Maricopa; Pima; Pinal; Santa Cruz and Yavapai counties; i.e between about 110d 45m & 113d 20m west","9807","31.0","-111.55","","","0.9999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_416[] = {"10203","Arizona Coordinate System  west zone","Arizona West","","","United States (USA) - Arizona - La Paz; Mohave and Yuma counties; i.e west of about 113d 20m","9807","31.0","-113.45","","","0.999933333","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_417[] = {"10231","Arizona CS83  east zone","Arizona  East","","","United States (USA) - Arizona - counties east of 110d 45m West","9807","31.0","-110.1","","","0.9999","213360.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","State law defines origin in International feet. FE = 700000ft.","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_418[] = {"10232","Arizona CS83 Central zone","Arizona Central","","","United States (USA) - Arizona - Coconino; Maricopa; Pima; Pinal; Santa Cruz and Yavapai counties; i.e between about 110d 45m & 113d 20m west","9807","31.0","-111.55","","","0.9999","213360.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","State law defines origin in International feet. FE = 700000ft.","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_419[] = {"10233","Arizona CS83  west zone","Arizona West","","","United States (USA) - Arizona - La Paz; Mohave and Yuma counties; i.e west of about 113d 20m","9807","31.0","-113.45","","","0.999933333","213360.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","State law defines origin in International feet. FE = 700000ft.","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_420[] = {"10301","Arkansas CS27 North","Arkansas North","","","United States (USA) - Arkansas - counties north of 34d 50m North.","9802","34.2","-92.0","36.14","34.56","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_421[] = {"10302","Arkansas CS27 South","Arkansas South","","","United States (USA) - Arkansas - counties south of 34d 50m North.","9802","32.4","-92.0","34.46","33.18","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_422[] = {"10331","Arkansas CS83 North zone","Arkansas North","","","United States (USA) - Arkansas - counties north of 34d 50m North.","9802","34.2","-92.0","36.14","34.56","","400000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_423[] = {"10332","Arkansas CS83 South zone","Arkansas South","","","United States (USA) - Arkansas - counties south of 34d 50m North.","9802","32.4","-92.0","34.46","33.18","","400000.0","400000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_424[] = {"10401","California CS27 zone I","California zone I","","","United States (USA) - California - counties north of 40deg North.","9802","39.2","-122.0","41.4","40.0","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_425[] = {"10402","California CS27 zone II","California zone II","","","United States (USA) - California - counties between 40d & 38d 15m North.","9802","37.4","-122.0","39.5","38.2","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_426[] = {"10403","California CS27 zone III","California zone III","","","United States (USA) - California - counties between 38d 15m & 37d North.","9802","36.3","-120.3","38.26","37.04","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_427[] = {"10404","California CS27 zone IV","California zone IV","","","United States (USA) - California - counties between 37d & 35d 30m North.","9802","35.2","-119.0","37.15","36.0","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_428[] = {"10405","California CS27 zone V","California zone V","","","United States (USA) - California - counties between 35d 50m & 34d North.","9802","33.3","-118.0","35.28","34.02","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_429[] = {"10406","California CS27 zone VI","California zone VI","","","United States (USA) - California - counties south of 34deg North.","9802","32.1","-116.15","33.53","32.47","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_430[] = {"10407","California CS27 zone VII","California zone VII","","","United States (USA) - California - Los Angeles.","9802","34.08","-118.2","34.25","33.52","","4186692.58","416926.74","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_431[] = {"10431","California CS83 zone 1","California zone 1","","","United States (USA) - California - counties north of 40deg North.","9802","39.2","-122.0","41.4","40.0","","2000000.0","500000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_432[] = {"10432","California CS83 zone 2","California zone 2","","","United States (USA) - California - counties between 40d & 38d 15m North.","9802","37.4","-122.0","39.5","38.2","","2000000.0","500000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_433[] = {"10433","California CS83 zone 3","California zone 3","","","United States (USA) - California - counties between 38d 15m & 37d North.","9802","36.3","-120.3","38.26","37.04","","2000000.0","500000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_434[] = {"10434","California CS83 zone 4","California zone 4","","","United States (USA) - California - counties between 37d & 35d 30m North.","9802","35.2","-119.0","37.15","36.0","","2000000.0","500000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_435[] = {"10435","California CS83 zone 5","California zone 5","","","United States (USA) - California - counties between 35d 50m & 34d North.","9802","33.3","-118.0","35.28","34.02","","2000000.0","500000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_436[] = {"10436","California CS83 zone 6","California zone 6","","","United States (USA) - California - counties south of 34deg North.","9802","32.1","-116.15","33.53","32.47","","2000000.0","500000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_437[] = {"10501","Colorado CS27 North zone","Colorado North","","","United States (USA) - Colorado - counties north of 39d 50m North.","9802","39.2","-105.3","39.43","40.47","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_438[] = {"10502","Colorado CS27 Central zone","Colorado Central","","","United States (USA) - Colorado - counties between 39d 50m & 38d 30m North.","9802","37.5","-105.3","39.45","38.27","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_439[] = {"10503","Colorado CS27 South zone","Colorado South","","","United States (USA) - Colorado - counties south of 38d 30m North.","9802","36.4","-105.3","38.26","37.14","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_440[] = {"10531","Colorado CS83 North zone","Colorado North","","","United States (USA) - Colorado - counties north of 39d 50m North.","9802","39.2","-105.3","40.47","39.43","","914401.8289","304800.6096","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_441[] = {"10532","Colorado CS83 Central zone","Colorado Central","","","United States (USA) - Colorado - counties between 39d 50m & 38d 30m North.","9802","37.5","-105.3","39.45","38.27","","914401.8289","304800.6096","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_442[] = {"10533","Colorado CS83 South zone","Colorado South","","","United States (USA) - Colorado - counties south of 38d 30m North.","9802","36.4","-105.3","38.26","37.14","","914401.8289","304800.6096","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_443[] = {"10600","Connecticut CS27","Connecticut","","","United States (USA) - Connecticut.","9802","40.5","-72.45","41.52","41.12","","600000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_444[] = {"10630","Connecticut CS83","Connecticut","","","United States (USA) - Connecticut.","9802","40.5","-72.45","41.52","41.12","","304800.6096","152400.3048","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_445[] = {"10700","Delaware CS27","Delaware","","","United States (USA) - Delaware.","9807","38.0","-75.25","","","0.999995","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_446[] = {"10730","Delaware CS83","Delaware","","","United States (USA) - Delaware.","9807","38.0","-75.25","","","0.999995","200000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_447[] = {"10901","Florida CS27 East zone","Florida East","","","United States (USA) - Florida - counties east of 81d 45m West.","9807","24.2","-81.0","","","0.999941177","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_448[] = {"10902","Florida CS27 West zone","Florida West","","","United States (USA) - Florida - counties west of 81d 45m West & south of 29d 30m North.","9807","24.2","-82.0","","","0.999941177","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_449[] = {"10903","Florida CS27 North zone","Florida North","","","United States (USA) - Florida - north of 29d 30m North & west of 82d West.","9802","29.0","-84.3","30.45","29.35","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_450[] = {"10931","Florida CS83 East zone","Florida  East","","","United States (USA) - Florida - counties east of 81d 45m West.","9807","24.2","-81.0","","","0.999941177","200000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_451[] = {"10932","Florida CS83 West zone","Florida  West","","","United States (USA) - Florida - counties west of 81d 45m West & south of 29d 30m North.","9807","24.2","-82.0","","","0.999941177","200000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_452[] = {"10933","Florida CS83 North zone","Florida North","","","United States (USA) - Florida - north of 29d 30m North & west of 82d West.","9802","29.0","-84.3","30.45","29.35","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_453[] = {"11001","Georgia CS27 East zone","Georgia East","","","United States (USA) - Georgia - counties east of 83d 15m West.","9807","30.0","-82.1","","","0.9999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_454[] = {"11002","Georgia CS27 West zone","Georgia West","","","United States (USA) - Georgia - counties west of 83d 15m West.","9807","30.0","-84.1","","","0.9999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_455[] = {"11031","Georgia CS83 East zone","Georgia  East","","","United States (USA) - Georgia - counties east of 83d 15m West.","9807","30.0","-82.1","","","0.9999","200000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_456[] = {"11032","Georgia CS83 West zone","Georgia West","","","United States (USA) - Georgia - counties west of 83d 15m West.","9807","30.0","-84.1","","","0.9999","700000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_457[] = {"11101","Idaho CS27 East zone","Idaho East","","","United States (USA) - Idaho - counties east of 113d West.","9807","41.4","-112.1","","","0.999947368","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_458[] = {"11102","Idaho CS27 Central zone","Idaho Central","","","United States (USA) - Idaho - counties between 113d & 115d West.","9807","41.4","-114.0","","","0.999947368","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_459[] = {"11103","Idaho CS27 West zone","Idaho West","","","United States (USA) - Idaho - counties west of 115d West.","9807","41.4","-115.45","","","0.999933333","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_460[] = {"11131","Idaho CS83 East zone","Idaho  East","","","United States (USA) - Idaho - counties east of 113d West.","9807","41.4","-112.1","","","0.999947368","200000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_461[] = {"11132","Idaho CS83 Central zone","Idaho  Central","","","United States (USA) - Idaho - counties between 113d & 115d West.","9807","41.4","-114.0","","","0.999947368","500000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_462[] = {"11133","Idaho CS83 West zone","Idaho  West","","","United States (USA) - Idaho - counties west of 115d West.","9807","41.4","-115.45","","","0.999933333","800000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_463[] = {"11201","Illinois CS27 East zone","Illinois East","","","United States (USA) - Illinois - counties east of 89d 05m West.","9807","36.4","-88.2","","","0.999975","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_464[] = {"11202","Illinois CS27 West zone","Illinois West","","","United States (USA) - Illinois - counties west of 89d 05m West.","9807","36.4","-90.1","","","0.999941177","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_465[] = {"11231","Illinois CS83 East zone","Illinois  East","","","United States (USA) - Illinois - counties east of 89d 05m West.","9807","36.4","-88.2","","","0.999975","300000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_466[] = {"11232","Illinois CS83 West zone","Illinois  West","","","United States (USA) - Illinois - counties west of 89d 05m West.","9807","36.4","-90.1","","","0.999941177","700000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_467[] = {"11301","Indiana CS27 East zone","Indiana East","","","United States (USA) - Indiana - counties east of 86d 25m West.","9807","37.3","-85.4","","","0.999966667","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_468[] = {"11302","Indiana CS27 West zone","Indiana West","","","United States (USA) - Indiana - counties west of 86d 25m West.","9807","37.3","-87.05","","","0.999966667","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_469[] = {"11331","Indiana CS83 East zone","Indiana  East","","","United States (USA) - Indiana - counties east of 86d 25m West.","9807","37.3","-85.4","","","0.999966667","100000.0","250000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_470[] = {"11332","Indiana CS83 West zone","Indiana  West","","","United States (USA) - Indiana - counties west of 86d 25m West.","9807","37.3","-87.05","","","0.999966667","900000.0","250000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_471[] = {"11401","Iowa CS27 North zone","Iowa North","","","United States (USA) - Iowa - counties north of 42deg North.","9802","41.3","-93.3","43.16","42.04","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_472[] = {"11402","Iowa CS27 South zone","Iowa South","","","United States (USA) - Iowa - counties south of 42deg North.","9802","40.0","-93.3","41.47","40.37","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_473[] = {"11431","Iowa CS83 North zone","Iowa North","","","United States (USA) - Iowa - counties north of 42deg North.","9802","41.3","-93.3","43.16","42.04","","1500000.0","1000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_474[] = {"11432","Iowa CS83 South zone","Iowa South","","","United States (USA) - Iowa - counties south of 42deg North.","9802","40.0","-93.3","41.47","40.37","","500000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_475[] = {"11501","Kansas CS27 North zone","Kansas North","","","United States (USA) - Kansas - counties north of 38d 45m North.","9802","38.2","-98.0","39.47","38.43","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_476[] = {"11502","Kansas CS27 South zone","Kansas South","","","United States (USA) - Kansas - counties south of 38d 45m North.","9802","36.4","-98.3","38.34","37.16","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_477[] = {"11531","Kansas CS83 North zone","Kansas North","","","United States (USA) - Kansas - counties north of 38d 45m North.","9802","38.2","-98.0","39.47","38.43","","400000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_478[] = {"11532","Kansas CS83 South zone","Kansas South","","","United States (USA) - Kansas - counties south of 38d 45m North.","9802","36.4","-98.3","38.34","37.16","","400000.0","400000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_479[] = {"11601","Kentucky CS27 North zone","Kentucky North","","","United States (USA) - Kentucky - counties north of 37d 55m North.","9802","37.3","-84.15","37.58","38.58","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_480[] = {"11602","Kentucky CS27 South zone","Kentucky South","","","United States (USA) - Kentucky - counties south of 37d 55m North.","9802","36.2","-85.45","36.44","37.56","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_481[] = {"11631","Kentucky CS83 North zone","Kentucky North","","","United States (USA) - Kentucky - counties north of 37d 55m North.","9802","37.3","-84.15","37.58","37.58","","500000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_482[] = {"11632","Kentucky CS83 South zone","Kentucky South","","","United States (USA) - Kentucky - counties south of 37d 55m North.","9802","36.2","-85.45","37.56","36.44","","500000.0","500000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_483[] = {"11701","Louisiana CS27 North zone","Louisiana North","","","United States (USA) - Louisiana - counties north of 30d 55m North.","9802","30.4","-92.3","31.1","32.4","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_484[] = {"11702","Louisiana CS27 South zone","Louisiana South","","","United States (USA) - Louisiana - counties south of 30d 55m North. Also Gulf of Mexico LA shelf.","9802","28.4","-91.2","29.18","30.42","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_485[] = {"11731","Louisiana CS83 North zone","Louisiana North","","","United States (USA) - Louisiana - counties north of 30d 55m North.","9802","30.3","-92.3","32.4","31.1","","1000000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_486[] = {"11732","Louisiana CS83 South zone","Louisiana South","","","United States (USA) - Louisiana - counties south of 30d 55m North.","9802","28.3","-91.2","30.42","29.18","","1000000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_487[] = {"11801","Maine CS27 East zone","Maine East","","","United States (USA) - Maine - counties east of 69d 30m West.","9807","43.5","-68.3","","","0.9999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_488[] = {"11802","Maine CS27 West zone","Maine West","","","United States (USA) - Maine - counties west of 69d 30m West.","9807","42.5","-70.1","","","0.999966667","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_489[] = {"11831","Maine CS83 East zone","Maine  East","","","United States (USA) - Maine - counties east of 69d 30m West.","9807","43.4","-68.3","","","0.9999","300000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_490[] = {"11832","Maine CS83 West zone","Maine  West","","","United States (USA) - Maine - counties west of 69d 30m West.","9807","42.5","-70.1","","","0.999966667","900000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_491[] = {"11900","Maryland CS27","Maryland","","","United States (USA) - Maryland.","9802","37.5","-77.0","38.18","39.27","","800000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_492[] = {"11930","Maryland CS83","Maryland","","","United States (USA) - Maryland.","9802","37.4","-77.0","39.27","38.18","","400000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_493[] = {"12001","Massachusetts CS27 Mainland zone","Massachusetts Mainland","","","United States (USA) - Massachusetts onshore.","9802","41.0","-71.3","41.43","42.41","","600000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_494[] = {"12002","Massachusetts CS27 Island zone","Massachusetts Island","","","United States (USA) - Massachusetts islands.","9802","41.0","-70.3","41.17","41.29","","200000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_495[] = {"12031","Massachusetts CS83 Mainland zone","Massachusetts Mainland","","","United States (USA) - Massachusetts onshore.","9802","41.0","-71.3","42.41","41.43","","200000.0","750000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_496[] = {"12032","Massachusetts CS83 Island zone","Massachusetts Island","","","United States (USA) - Massachusetts islands.","9802","41.0","-70.3","41.29","41.17","","500000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_497[] = {"12101","Michigan State Plane East zone","Michigan East","","","United States (USA) - Michigan.","9807","41.3","-83.4","","","0.999942857","500000.0","0.0","9003","9110","8901","","","","","1998-11-11 00:00:00","USGS Professional Paper #1395","EPSG","Obsolete. Superseded by north central and south zones.","95.30  96.29  98.22",NULL};
+datafile_rows_t trf_nonpolynomial_row_498[] = {"12102","Michigan State Plane Old Central zone","Michigan Old Central","","","United States (USA) - Michigan.","9807","41.3","-85.45","","","0.999909091","500000.0","0.0","9003","9110","8901","","","","","1998-11-11 00:00:00","USGS Professional Paper #1395","EPSG","Obsolete. Superseded by north central and south zones.","95.30  96.29  98.22",NULL};
+datafile_rows_t trf_nonpolynomial_row_499[] = {"12103","Michigan State Plane West zone","Michigan West","","","United States (USA) - Michigan.","9807","41.3","-88.45","","","0.999909091","500000.0","0.0","9003","9110","8901","","","","","1998-11-11 00:00:00","USGS Professional Paper #1395","EPSG","Obsolete. Superseded by north central and south zones.","95.30  96.29  98.22",NULL};
+datafile_rows_t trf_nonpolynomial_row_500[] = {"12111","Michigan CS27 North zone","Michigan North","","","United States (USA) - Michigan - counties north of 45d 45m North.","9802","44.47","-87.0","45.29","47.05","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.28  96.29  98.22  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_501[] = {"12112","Michigan CS27 Central zone","Michigan Central","","","United States (USA) - Michigan - counties between 45d 45m & 43d 55m North.","9802","43.19","-84.2","44.11","45.42","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.28  96.29  98.22  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_502[] = {"12113","Michigan CS27 South zone","Michigan South","","","United States (USA) - Michigan - counties south of 43d 55m North.","9802","41.3","-84.2","42.06","43.4","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.28  96.29  98.22  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_503[] = {"12141","Michigan CS83 North zone","Michigan North","","","United States (USA) - Michigan - counties north of 45d 45m North.","9802","44.47","-87.0","47.05","45.29","","8000000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_504[] = {"12142","Michigan CS83 Central zone","Michigan Central","","","United States (USA) - Michigan - counties between 45d 45m & 43d 55m North.","9802","43.19","-84.22","45.42","44.11","","6000000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_505[] = {"12143","Michigan CS83 South zone","Michigan South","","","United States (USA) - Michigan - counties south of 43d 55m North.","9802","41.3","-84.22","43.4","42.06","","4000000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_506[] = {"12201","Minnesota CS27 North zone","Minnesota North","","","United States (USA) - Minnesota - counties north of 47d 10m North.","9802","46.3","-93.06","47.02","48.38","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_507[] = {"12202","Minnesota CS27 Central zone","Minnesota Central","","","United States (USA) - Minnesota - counties between 47d 10m & 45d 30m North.","9802","45.0","-94.15","45.37","47.03","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_508[] = {"12203","Minnesota CS27 South zone","Minnesota South","","","United States (USA) - Minnesota - counties south of 45d 30m North.","9802","43.0","-94.0","43.47","45.13","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_509[] = {"12231","Minnesota CS83 North zone","Minnesota North","","","United States (USA) - Minnesota - counties north of 47d 10m North.","9802","46.3","-93.06","48.38","47.02","","800000.0","100000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_510[] = {"12232","Minnesota CS83 Central zone","Minnesota Central","","","United States (USA) - Minnesota - counties between 47d 10m & 45d 30m North.","9802","45.0","-94.15","47.03","45.37","","800000.0","100000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_511[] = {"12233","Minnesota CS83 South zone","Minnesota South","","","United States (USA) - Minnesota - counties south of 45d 30m North.","9802","43.0","-94.0","45.13","43.47","","800000.0","100000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_512[] = {"12301","Mississippi CS27 East zone","Mississippi East","","","United States (USA) - Mississippi - counties east of 89d 40m West.","9807","29.4","-88.5","","","0.99996","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_513[] = {"12302","Mississippi CS27 West zone","Mississippi West","","","United States (USA) - Mississippi - counties west of 89d 40m West.","9807","30.3","-90.2","","","0.999941177","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_514[] = {"12331","Mississippi CS83 East zone","Mississippi East","","","United States (USA) - Mississippi - counties east of 89d 40m West.","9807","29.3","-88.5","","","0.99995","300000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_515[] = {"12332","Mississippi CS83 West zone","Mississippi West","","","United States (USA) - Mississippi - counties west of 89d 40m West.","9807","29.3","-90.2","","","0.99995","700000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_516[] = {"12401","Missouri CS27 East zone","Missouri East","","","United States (USA) - Missouri - counties east of 91d 45m West.","9807","35.5","-90.3","","","0.999933333","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.18  95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_517[] = {"12402","Missouri CS27 Central zone","Missouri Central","","","United States (USA) - Missouri - counties between 91d 45m & 93d 35m West.","9807","35.5","-92.3","","","0.999933333","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_518[] = {"12403","Missouri CS27 West zone","Missouri West","","","United States (USA) - Missouri - counties west of 93d 35m West.","9807","36.1","-94.3","","","0.999941177","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_519[] = {"12431","Missouri CS83 East zone","Missouri  East","","","United States (USA) - Missouri - counties east of 91d 45m West..","9807","35.5","-90.3","","","0.999933333","250000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_520[] = {"12432","Missouri CS83 Central zone","Missouri Central","","","United States (USA) - Missouri - counties between 91d 45m & 93d 35m West","9807","35.5","-92.3","","","0.999933333","500000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_521[] = {"12433","Missouri CS83 West zone","Missouri  West","","","United States (USA) - Missouri - counties west of 93d 35m West.","9807","36.1","-94.3","","","0.999941177","850000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_522[] = {"12501","Montana CS27 North zone","Montana North","","","United States (USA) - Montana - counties north of 47d 50m North.","9802","47.0","-109.3","48.43","47.51","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_523[] = {"12502","Montana CS27 Central zone","Montana Central","","","United States (USA) - Montana - counties between 47d 50m & 46d 40m North.","9802","45.5","-109.3","47.53","46.27","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_524[] = {"12503","Montana CS27 South zone","Montana South","","","United States (USA) - Montana - counties south of 46d 40m North.","9802","44.0","-109.3","46.24","44.52","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_525[] = {"12530","Montana CS83","Montana","","","United States (USA) - Montana.","9802","44.15","-109.3","49.0","45.0","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_526[] = {"12601","Nebraska CS27 North zone","Nebraska North","","","United States - Nebraska -Antelope; Blaine; Box Butte; Boyd; Brown; Burt; Cedar; Cherry; Cuming; Dakota; Dawes; Dixon; Garfield; Grant; Holt; Hooker; Keya Paha; Knox; Loup; Madison; Pierce; Rock; Sheridan; Sioux; Stanton; Thomas; Thurston; Wayne; Wheeler","9802","41.2","-100.0","41.51","42.49","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professio [...]
+datafile_rows_t trf_nonpolynomial_row_527[] = {"12602","Nebraska CS27 South zone","Nebraska South","","","United States (USA) - Nebraska - counties south of and including Scotts Bluff; Morrill; Garden; Arthur; McPherson; Logan; Custer; Valley; Greeley; Boome, Platte; Colfax; Dodge; Washington.","9802","39.4","-99.3","40.17","41.43","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_528[] = {"12630","Nebraska CS83","Nebraska","","","United States (USA) - Nebraska.","9802","39.5","-100.0","43.0","40.0","","500000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_529[] = {"12701","Nevada CS27 East zone","Nevada East","","","United States (USA) - Nevada - counties east of 116d  West & Eureka county.","9807","34.45","-115.35","","","0.9999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_530[] = {"12702","Nevada CS27 Central zone","Nevada Central","","","United States (USA) - Nevada - Lander & Nye counties.","9807","34.45","-116.4","","","0.9999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_531[] = {"12703","Nevada CS27 West zone","Nevada West","","","United States (USA) - Nevada - counties west of 117d 15m West.","9807","34.45","-118.35","","","0.9999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_532[] = {"12731","Nevada CS83 East zone","Nevada  East","","","United States (USA) - Nevada - counties east of 116d  West & Eureka county.","9807","34.45","-115.35","","","0.9999","200000.0","8000000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_533[] = {"12732","Nevada CS83 Central zone","Nevada Central","","","United States (USA) - Nevada - Lander & Nye counties.","9807","34.45","-116.4","","","0.9999","500000.0","6000000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_534[] = {"12733","Nevada CS83 West zone","Nevada West","","","United States (USA) - Nevada - counties west of 117d 15m West.","9807","34.45","-118.35","","","0.9999","800000.0","4000000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_535[] = {"12800","New Hampshire CS27","New Hampshire","","","United States (USA) - New Hampshire.","9807","42.3","-71.4","","","0.999966667","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_536[] = {"12830","New Hampshire CS83","New Hampshire","","","United States (USA) - New Hampshire.","9807","42.3","-71.4","","","0.999966667","300000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_537[] = {"12900","New Jersey CS27","New Jersey","","","United States (USA) - New Jersey.","9807","38.5","-74.4","","","0.999975","2000000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_538[] = {"12930","New Jersey CS83","New Jersey","","","United States (USA) - New Jersey.","9807","38.5","-74.3","","","0.9999","150000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_539[] = {"13001","New Mexico CS27 East zone","New Mexico East","","","United States (USA) - New Mexico - counties east of 105d West.","9807","31.0","-104.2","","","0.999909091","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_540[] = {"13002","New Mexico CS27 Central zone","New Mexico Central","","","United States (USA) - New Mexico - counties between 105d & 107d 15m West.","9807","31.0","-106.15","","","0.9999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_541[] = {"13003","New Mexico CS27 West zone","New Mexico West","","","United States (USA) - New Mexico - counties west of 107d 15m West.","9807","31.0","-107.5","","","0.999916667","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_542[] = {"13031","New Mexico CS83 East zone","New Mexico East","","","United States (USA) - New Mexico - counties east of 105d West.","9807","31.0","-104.2","","","0.999909091","165000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_543[] = {"13032","New Mexico CS83 Central zone","New Mexico Central","","","United States (USA) - New Mexico - counties between 105d & 107d 15m West.","9807","31.0","-106.15","","","0.9999","500000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_544[] = {"13033","New Mexico CS83 West zone","New Mexico West","","","United States (USA) - New Mexico - counties west of 107d 15m West.","9807","31.0","-107.5","","","0.999916667","830000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_545[] = {"13101","New York CS27 East zone","New York East","","","United States (USA) - New York - counties east of 75d 15m West excluding Long Island.","9807","40.0","-74.2","","","0.999966667","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.18  95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_546[] = {"13102","New York CS27 Central zone","New York Central","","","United States (USA) - New York - counties between 75d 15m & 77d 30m West.","9807","40.0","-76.35","","","0.9999375","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_547[] = {"13103","New York CS27 West zone","New York West","","","United States (USA) - New York - counties west of 77d 30m West.","9807","40.0","-78.35","","","0.9999375","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_548[] = {"13104","New York CS27 Long Island zone","New York Long Island","","","United States (USA) - New York - Long Island.","9802","40.3","-74.0","41.02","40.4","","1000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_549[] = {"13131","New York CS83 East zone","New York  East","","","United States (USA) - New York - counties east of 75d 15m West excluding Long Island.","9807","38.5","-74.3","","","0.9999","150000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_550[] = {"13132","New York CS83 Central zone","New York Central","","","United States (USA) - New York - counties between 75d 15m & 77d 30m West.","9807","40.0","-76.35","","","0.9999375","250000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_551[] = {"13133","New York CS83 West zone","New York  West","","","United States (USA) - New York - counties west of 77d 30m West.","9807","40.0","-78.35","","","0.9999375","350000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_552[] = {"13134","New York CS83 Long Island zone","New York Long Island","","","United States (USA) - New York - Long Island.","9802","40.1","-74.0","41.02","40.4","","300000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_553[] = {"13200","North Carolina CS27","North Carolina","","","United States (USA) - North Carolina.","9802","33.45","-79.0","34.2","36.1","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_554[] = {"13230","North Carolina CS83","North Carolina","","","United States (USA) - North Carolina.","9802","33.45","-79.0","36.1","34.2","","609601.22","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_555[] = {"13301","North Dakota CS27 North zone","North Dakota North","","","United States (USA) - North Dakota - counties north of 47d 25m North.","9802","47.0","-100.3","47.26","48.44","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_556[] = {"13302","North Dakota CS27 South zone","North Dakota South","","","United States (USA) - North Dakota - counties south of 47d 25m North.","9802","45.4","-100.3","46.11","47.29","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_557[] = {"13331","North Dakota CS83 North zone","North Dakota North","","","United States (USA) - North Dakota - counties north of 47d 25m North.","9802","47.0","-100.3","48.44","47.26","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_558[] = {"13332","North Dakota CS83 South zone","North Dakota South","","","United States (USA) - North Dakota - counties south of 47d 25m North.","9802","45.4","-100.3","47.29","46.11","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_559[] = {"13401","Ohio CS27 North zone","Ohio North","","","United States (USA) - Ohio - counties north of 40d 15m North.","9802","39.4","-82.3","40.26","41.42","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_560[] = {"13402","Ohio CS27 South zone","Ohio South","","","United States (USA) - Ohio - counties south of 40d 15m North.","9802","38.0","-82.3","38.44","40.02","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_561[] = {"13431","Ohio CS83 North zone","Ohio North","","","United States (USA) - Ohio - counties north of 40d 15m North.","9802","39.4","-82.3","41.42","40.26","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_562[] = {"13432","Ohio CS83 South zone","Ohio South","","","United States (USA) - Ohio - counties south of 40d 15m North.","9802","38.0","-82.3","40.02","38.44","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_563[] = {"13501","Oklahoma CS27 North zone","Oklahoma North","","","United States (USA) - Oklahoma - counties north of 35d 20m North.","9802","35.0","-98.0","35.34","36.46","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_564[] = {"13502","Oklahoma CS27 South zone","Oklahoma South","","","United States (USA) - Oklahoma - counties south of 35d 20m North.","9802","33.2","-98.0","33.56","35.14","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_565[] = {"13531","Oklahoma CS83 North zone","Oklahoma North","","","United States (USA) - Oklahoma - counties north of 35d 20m North.","9802","35.0","-98.0","36.46","35.34","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_566[] = {"13532","Oklahoma CS83 South zone","Oklahoma South","","","United States (USA) - Oklahoma - counties south of 35d 20m North.","9802","33.2","-98.0","35.14","33.56","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_567[] = {"13601","Oregon CS27 North zone","Oregon North","","","United States (USA) - Oregon - counties north of 44d 15m North.","9802","43.4","-120.3","44.2","46.0","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_568[] = {"13602","Oregon CS27 South zone","Oregon South","","","United States (USA) - Oregon - counties south of 44d 15m North.","9802","41.4","-120.3","42.2","44.0","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_569[] = {"13631","Oregon CS83 North zone","Oregon North","","","United States (USA) - Oregon - counties north of 44d 15m North.","9802","43.4","-120.3","46.0","44.2","","2500000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_570[] = {"13632","Oregon CS83 South zone","Oregon South","","","United States (USA) - Oregon - counties south of 44d 15m North.","9802","41.4","-120.3","44.0","42.2","","1500000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_571[] = {"13701","Pennsylvania CS27 North zone","Pennsylvania North","","","United States (USA) - Pennsylvania - counties north of 40d 50m North.","9802","40.1","-77.45","40.53","41.57","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_572[] = {"13702","Pennsylvania CS27 South zone","Pennsylvania South","","","United States (USA) - Pennsylvania - counties south of 40d 50m North.","9802","39.2","-77.45","39.56","40.48","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_573[] = {"13731","Pennsylvania CS83 North zone","Pennsylvania North","","","United States (USA) - Pennsylvania - counties north of 40d 50m North.","9802","40.1","-77.45","41.57","40.53","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_574[] = {"13732","Pennsylvania CS83 South zone","Pennsylvania South","","","United States (USA) - Pennsylvania - counties south of 40d 50m North.","9802","39.2","-77.45","40.58","39.56","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_575[] = {"13800","Rhode Island CS27","Rhode Island","","","United States (USA) - Rhode Island.","9807","41.05","-71.3","","","0.9999938","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_576[] = {"13830","Rhode Island CS83","Rhode Island","","","United States (USA) - Rhode Island.","9807","41.05","-71.3","","","0.99999375","100000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_577[] = {"13901","South Carolina CS27 North zone","South Carolina North","","","United States (USA) - South Carolina counties north of and including Edgefield; Saluda; Lexington; Calhoun; Sumter; Florence; Marion & Horry.","9802","33.0","-81.0","33.46","34.58","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_578[] = {"13902","South Carolina CS27 South zone","South Carolina South","","","United States (USA) - South Carolina - Aiken; Allendale; Bamberg; Barnwell; Beaufort; Berkeley; Charleston; Clarendon; Colleton; Dorchester; Georgetown; Hampton; Jasper; Orangeburg & Williamsburg counties.","9802","31.5","-81.0","32.2","33.4","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29 [...]
+datafile_rows_t trf_nonpolynomial_row_579[] = {"13930","South Carolina CS83","South Carolina","","","United States (USA) - South Carolina.","9802","31.5","-81.0","34.5","32.3","","609600.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_580[] = {"14001","South Dakota CS27 North zone","South Dakota North","","","United States (USA) - South Dakota - counties north of 44d 20m North.","9802","43.5","-100.0","44.25","45.41","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_581[] = {"14002","South Dakota CS27 South zone","South Dakota South","","","United States (USA) - South Dakota - counties south of 44d 20m North.","9802","42.2","-100.2","42.5","44.24","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_582[] = {"14031","South Dakota CS83 North zone","South Dakota North","","","United States (USA) - South Dakota - counties north of 44d 20m North.","9802","43.5","-100.0","45.41","44.25","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_583[] = {"14032","South Dakota CS83 South zone","South Dakota South","","","United States (USA) - South Dakota - counties south of 44d 20m North.","9802","42.2","-100.2","44.24","42.5","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_584[] = {"14100","Tennessee CS27","Tennessee","","","United States (USA) - Tennessee.","9802","34.4","-86.0","35.15","36.25","","100000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_585[] = {"14130","Tennessee CS83","Tennessee","","","United States (USA) - Tennessee.","9802","34.2","-86.0","36.25","35.15","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_586[] = {"14201","Texas CS27 North zone","Texas North","","","United States (USA) - Texas - counties north of 34d 20m North.","9802","34.0","-101.3","34.39","36.11","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_587[] = {"14202","Texas CS27 North Central zone","Texas North Central","","","United States (USA) - Texas - counties between 34d 20m & 32deg North.","9802","31.4","-97.3","32.08","33.58","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_588[] = {"14203","Texas CS27 Central zone","Texas Central","","","United States (USA) - Texas - counties between 32deg & 30d 10m North.","9802","29.4","-100.2","30.07","31.53","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_589[] = {"14204","Texas CS27 South Central zone","Texas South Central","","","United States (USA) - Texas - counties between 30d 10m & 28d 05m North.","9802","27.5","-99.0","28.23","30.17","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_590[] = {"14205","Texas CS27 South zone","Texas South","","","United States (USA) - Texas - counties south of 28d 05m North.","9802","25.4","-98.3","26.1","27.5","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_591[] = {"14231","Texas CS83 North zone","Texas North","","","United States (USA) - Texas - counties north of 34d 20m North.","9802","34.0","-101.3","36.11","34.39","","200000.0","1000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_592[] = {"14232","Texas CS83 North Central zone","Texas North Central","","","United States (USA) - Texas - counties between 34d 20m & 32deg North.","9802","31.4","-98.3","33.58","32.08","","600000.0","2000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_593[] = {"14233","Texas CS83 Central zone","Texas Central","","","United States (USA) - Texas - counties between 32deg & 30d 10m North.","9802","29.4","-100.2","31.53","30.07","","700000.0","3000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_594[] = {"14234","Texas CS83 South Central zone","Texas South Central","","","United States (USA) - Texas - counties between 30d 10m & 28d 05m North.","9802","27.5","-99.0","30.17","28.23","","600000.0","4000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_595[] = {"14235","Texas CS83 South zone","Texas South","","","United States (USA) - Texas - counties south of 28d 05m North.","9802","25.4","-98.3","27.5","26.1","","300000.0","5000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_596[] = {"14301","Utah CS27 North zone","Utah North","","","United States (USA) - Utah - counties north of 40d 50m North.","9802","40.2","-111.3","40.43","41.47","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_597[] = {"14302","Utah CS27 Central zone","Utah Central","","","United States (USA) - Utah - counties between 40d 50m & 38d 30m North.","9802","38.2","-111.3","39.01","40.39","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_598[] = {"14303","Utah CS27 South zone","Utah South","","","United States (USA) - Utah - counties south of 38d 30m North.","9802","36.4","-111.3","37.13","38.21","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_599[] = {"14331","Utah CS83 North zone","Utah North","","","United States (USA) - Utah - counties north of 40d 50m North.","9802","40.2","-111.3","41.47","40.43","","500000.0","1000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_600[] = {"14332","Utah CS83 Central zone","Utah Central","","","United States (USA) - Utah - counties between 40d 50m & 38d 30m North.","9802","38.2","-111.3","40.39","39.01","","500000.0","2000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_601[] = {"14333","Utah CS83 South zone","Utah South","","","United States (USA) - Utah - counties south of 38d 30m North.","9802","36.4","-111.3","38.21","37.13","","500000.0","3000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_602[] = {"14400","Vermont CS27","Vermont","","","United States (USA) - Vermont.","9807","42.3","-72.3","","","0.999964286","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_603[] = {"14430","Vermont CS83","Vermont","","","United States (USA) - Vermont.","9807","42.3","-72.3","","","0.999964286","500000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_604[] = {"14501","Virginia CS27 North zone","Virginia North","","","United States (USA) - Virginia - counties north of 38d 05m North.","9802","37.4","-78.3","38.02","39.12","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_605[] = {"14502","Virginia CS27 South zone","Virginia South","","","United States (USA) - Virginia - counties south of 38d 05m North.","9802","36.2","-78.3","36.46","37.58","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_606[] = {"14531","Virginia CS83 North zone","Virginia North","","","United States (USA) - Virginia - counties north of 38d 05m North.","9802","37.4","-78.3","39.12","38.02","","3500000.0","2000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_607[] = {"14532","Virginia CS83 South zone","Virginia South","","","United States (USA) - Virginia - counties south of 38d 05m North.","9802","36.2","-78.3","37.58","36.46","","3500000.0","1000000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_608[] = {"14601","Washington CS27 North zone","Washington North","","","United States (USA) - Washington - counties north of 47d 30m North.","9802","47.0","-120.5","47.3","48.44","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_609[] = {"14602","Washington CS27 South zone","Washington South","","","United States (USA) - Washington - counties south of 47d 30m North.","9802","45.2","-120.3","45.5","47.2","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_610[] = {"14631","Washington CS83 North zone","Washington North","","","United States (USA) - Washington - counties north of 47d 30m North.","9802","47.0","-120.5","48.44","47.3","","500000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_611[] = {"14632","Washington CS83 South zone","Washington South","","","United States (USA) - Washington - counties south of 47d 30m North.","9802","45.2","-120.3","47.2","45.5","","500000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_612[] = {"14701","West Virginia CS27 North zone","West Virginia North","","","United States (USA) - West Virginia - counties north of 39deg North.","9802","38.3","-79.3","39.0","40.15","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_613[] = {"14702","West Virginia CS27 South zone","West Virginia South","","","United States (USA) - West Virginia - counties south of 39deg North.","9802","37.0","-81.0","37.29","38.53","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_614[] = {"14731","West Virginia CS83 North zone","West Virginia North","","","United States (USA) - West Virginia - counties north of 39deg North.","9802","38.3","-79.3","40.15","39.0","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_615[] = {"14732","West Virginia CS83 South zone","West Virginia South","","","United States (USA) - West Virginia - counties south of 39deg North.","9802","37.0","-81.0","38.53","37.29","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_616[] = {"14801","Wisconsin CS27 North zone","Wisconsin North","","","United States (USA) - Wisconsin - counties north of 45d 35m North.","9802","45.1","-90.0","45.34","46.46","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_617[] = {"14802","Wisconsin CS27 Central zone","Wisconsin Central","","","United States (USA) - Wisconsin - counties between 45d 35m & 44d 15m North.","9802","43.5","-90.0","44.15","45.3","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_618[] = {"14803","Wisconsin CS27 South zone","Wisconsin South","","","United States (USA) - Wisconsin - counties south of 44d 15m North.","9802","42.0","-90.0","42.44","44.04","","2000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_619[] = {"14831","Wisconsin CS83 North zone","Wisconsin North","","","United States (USA) - Wisconsin - counties north of 45d 35m North.","9802","45.1","-90.0","46.46","45.34","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_620[] = {"14832","Wisconsin CS83 Central zone","Wisconsin Central","","","United States (USA) - Wisconsin - counties between 45d 35m & 44d 15m North.","9802","43.5","-90.0","45.3","44.15","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_621[] = {"14833","Wisconsin CS83 South zone","Wisconsin South","","","United States (USA) - Wisconsin - counties south of 44d 15m North.","9802","42.0","-90.0","44.04","42.44","","600000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_622[] = {"14901","Wyoming CS27 East zone","Wyoming East","","","United States (USA) - Wyoming - counties east of 106d West.","9807","40.4","-105.1","","","0.999941177","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_623[] = {"14902","Wyoming CS27 East Central zone","Wyoming East Central","","","United States (USA) - Wyoming - counties between 106d & 108d 10m West.","9807","40.4","-107.2","","","0.999941177","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_624[] = {"14903","Wyoming CS27 West Central zone","Wyoming West Central","","","United States (USA) - Wyoming - counties between 108d 10m & 109d 40m West.","9807","40.4","-108.45","","","0.999941177","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_625[] = {"14904","Wyoming CS27 West zone","Wyoming West","","","United States (USA) - Wyoming - counties west of 109d 40m West.","9807","40.4","-110.05","","","0.999941177","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_626[] = {"14931","Wyoming CS83 East zone","Wyoming East","","","United States (USA) - Wyoming - counties east of 106d West.","9807","40.3","-105.1","","","0.9999375","200000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_627[] = {"14932","Wyoming CS83 East Central zone","Wyoming East Central","","","United States (USA) - Wyoming - counties between 106d & 108d 10m West.","9807","40.3","-107.2","","","0.9999375","400000.0","100000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_628[] = {"14933","Wyoming CS83 West Central zone","Wyoming West Central","","","United States (USA) - Wyoming - counties between 108d 10m & 109d 40m West.","9807","40.3","-108.45","","","0.9999375","600000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_629[] = {"14934","Wyoming CS83 West zone","Wyoming West","","","United States (USA) - Wyoming - counties west of 109d 40m West.","9807","40.3","-110.05","","","0.9999375","800000.0","100000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_630[] = {"15001","Alaska CS27 zone 1","Alaska zone 1","","","United States (USA) - Alaska - east of 141 deg West; i.e. Panhandle.","9812","57.0","-133.4","323.07483685","323.07483685","0.9999","16404166.67","-16404166.67","9003","9110","8901","","","","","1997-04-11 00:00:00","USGS Professional Paper #1395","EPSG","","96.29  97.08",NULL};
+datafile_rows_t trf_nonpolynomial_row_631[] = {"15002","Alaska CS27 zone 2","Alaska zone 2","","","United States (USA) - Alaska - 141deg to 144deg West.","9807","54.0","-142.0","","","0.9999","500000.0","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_632[] = {"15003","Alaska CS27 zone 3","Alaska zone 3","","","United States (USA) - Alaska - 144deg to 148deg West excluding Kenai Peninsula; Perry Is. and Esther Is.","9807","54.0","-146.0","","","0.9999","500000.0","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_633[] = {"15004","Alaska CS27 zone 4","Alaska zone 4","","","United States (USA) - Alaska - 148deg to 152deg West.","9807","54.0","-150.0","","","0.9999","500000.0","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_634[] = {"15005","Alaska CS27 zone 5","Alaska zone 5","","","United States (USA) - Alaska - 152deg to 156deg West.","9807","54.0","-154.0","","","0.9999","500000.0","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_635[] = {"15006","Alaska CS27 zone 6","Alaska zone 6","","","United States (USA) - Alaska - 156deg to 160deg West.","9807","54.0","-158.0","","","0.9999","500000.0","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_636[] = {"15007","Alaska CS27 zone 7","Alaska zone 7","","","United States (USA) - Alaska - 160deg to 164deg West.","9807","54.0","-162.0","","","0.9999","700000.0","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_637[] = {"15008","Alaska CS27 zone 8","Alaska zone 8","","","United States (USA) - Alaska - 164deg to 168deg West north of 54d 30m North.","9807","54.0","-166.0","","","0.9999","500000.0","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_638[] = {"15009","Alaska CS27 zone 9","Alaska zone 9","","","United States (USA) - Alaska - west of 168deg West and north of 54d 30m North.","9807","54.0","-170.0","","","0.9999","600000.0","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_639[] = {"15010","Alaska CS27 zone 10","Alaska zone 10","","","United States (USA) - Alaska - Aleutian Islands.","9802","51.0","-176.0","53.5","51.5","","3000000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_640[] = {"15031","Alaska CS83 zone 1","Alaska zone 1","","","United States (USA) - Alaska - east of 141 deg West; i.e. Panhandle.","9812","57.0","-133.4","323.07483685","323.07483685","0.9999","5000000.0","-5000000.0","9001","9110","8901","","","","","1996-09-12 00:00:00","NOAA manual NOS NGS 5","EPSG","","96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_641[] = {"15032","Alaska CS83 zone 2","Alaska zone 2","","","United States (USA) - Alaska - 141deg to 144deg West.","9807","54.0","-142.0","","","0.9999","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_642[] = {"15033","Alaska CS83 zone 3","Alaska zone 3","","","United States (USA) - Alaska - 144deg to 148deg West excluding Kenai Peninsula; Perry Is. and Esther Is.","9807","54.0","-146.0","","","0.9999","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_643[] = {"15034","Alaska CS83 zone 4","Alaska zone 4","","","United States (USA) - Alaska - 148deg to 152deg West.","9807","54.0","-150.0","","","0.9999","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_644[] = {"15035","Alaska CS83 zone 5","Alaska zone 5","","","United States (USA) - Alaska - 152deg to 156deg West.","9807","54.0","-154.0","","","0.9999","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_645[] = {"15036","Alaska CS83 zone 6","Alaska zone 6","","","United States (USA) - Alaska - 156deg to 160deg West.","9807","54.0","-158.0","","","0.9999","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_646[] = {"15037","Alaska CS83 zone 7","Alaska zone 7","","","United States (USA) - Alaska - 160deg to 164deg West.","9807","54.0","-162.0","","","0.9999","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_647[] = {"15038","Alaska CS83 zone 8","Alaska zone 8","","","United States (USA) - Alaska - 164deg to 168deg West north of 54d 30m North.","9807","54.0","-166.0","","","0.9999","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_648[] = {"15039","Alaska CS83 zone 9","Alaska zone 9","","","United States (USA) - Alaska - west of 168deg West and north of 54d 30m North.","9807","54.0","-170.0","","","0.9999","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_649[] = {"15040","Alaska CS83 zone 10","Alaska zone 10","","","United States (USA) - Alaska - Aleutian Islands.","9802","51.0","-176.0","53.5","51.5","","1000000.0","0.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_650[] = {"15101","Hawaii CS27 zone 1","Hawaii zone 1","","","United States (USA) - Hawaii - island of Hawaii.","9807","18.5","-155.3","","","0.999966667","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_651[] = {"15102","Hawaii CS27 zone 2","Hawaii zone 2","","","United States (USA) - Hawaii - Maui; Kahoolawe; Lanai; Molokai.","9807","20.2","-156.4","","","0.999966667","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_652[] = {"15103","Hawaii CS27 zone 3","Hawaii zone 3","","","United States (USA) - Hawaii - Oahu.","9807","21.1","-158.0","","","0.99999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_653[] = {"15104","Hawaii CS27 zone 4","Hawaii zone 4","","","United States (USA) - Hawaii - Kauai.","9807","21.5","-159.3","","","0.99999","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_654[] = {"15105","Hawaii CS27 zone 5","Hawaii zone 5","","","United States (USA) - Hawaii - Niihau.","9807","21.4","-160.1","","","1.0","500000.0","0.0","9003","9110","8901","","","","","1995-12-02 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_655[] = {"15131","Hawaii CS83 zone 1","Hawaii  zone 1","","","United States (USA) - Hawaii - island of Hawaii.","9807","18.5","-155.3","","","0.999966667","500000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_656[] = {"15132","Hawaii CS83 zone 2","Hawaii  zone 2","","","United States (USA) - Hawaii - Maui; Kahoolawe; Lanai; Molokai.","9807","20.2","-156.4","","","0.999966667","500000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_657[] = {"15133","Hawaii CS83 zone 3","Hawaii  zone 3","","","United States (USA) - Hawaii - Oahu.","9807","21.1","-158.0","","","0.99999","500000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_658[] = {"15134","Hawaii CS83 zone 4","Hawaii  zone 4","","","United States (USA) - Hawaii - Kauai.","9807","21.5","-159.3","","","0.99999","500000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_659[] = {"15135","Hawaii CS83 zone 5","Hawaii  zone 5","","","United States (USA) - Hawaii - Niihau.","9807","21.4","-160.1","","","1.0","500000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_660[] = {"15201","Puerto Rico CS27","Puerto Rico","","","Puerto Rico.","9802","17.5","-66.26","18.26","18.02","","500000.0","0.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_661[] = {"15202","St. Croix CS27","St. Croix","","","Virgin Islands of US - St. Croix.","9802","17.5","-66.26","18.26","18.02","","500000.0","100000.0","9003","9110","8901","","","","","1999-04-22 00:00:00","USGS Professional Paper #1395","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_662[] = {"15230","Puerto Rico & Virgin Islands CS83","Puerto Rico & Virgin Is.","","","Puerto Rico & Virgin Islands of US","9802","17.5","-66.26","18.26","18.02","","200000.0","200000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","NOAA manual NOS NGS 5","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_663[] = {"15914","BLM zone 14N in feet","BLM 14N (feet)","","","United States (USA) - Gulf of Mexico - west of 96 deg West approximately.","9807","0.0","-99.0","","","0.9996","1640416.67","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","Minerals Management Service offshore protraction diagrams.","EPSG","Sometimes locally referred to as \"UTM zone 14\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_664[] = {"15915","BLM zone 15N in feet","BLM 15N (feet)","","","United States (USA) - Gulf of Mexico - 96 deg to 90 deg West approximately.","9807","0.0","-93.0","","","0.9996","1640416.67","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","Minerals Management Service offshore protraction diagrams.","EPSG","Sometimes locally referred to as \"UTM zone 15\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_665[] = {"15916","BLM zone 16N in feet","BLM 16N (feet)","","","United States (USA) - Gulf of Mexico - 90 deg to 84 deg West approximately.","9807","0.0","-87.0","","","0.9996","1640416.67","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","Minerals Management Service offshore protraction diagrams.","EPSG","Sometimes locally referred to as \"UTM zone 16\".","95.27  95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_666[] = {"15917","BLM zone 17N in feet","BLM 17N (feet)","","","United States (USA) - Gulf of Mexico - east of 84 deg West approximately.","9807","0.0","-81.0","","","0.9996","1640416.67","0.0","9003","9102","8901","","","","","1995-12-02 00:00:00","Minerals Management Service offshore protraction diagrams.","EPSG","Sometimes locally referred to as \"UTM zone 17\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_667[] = {"16001","UTM zone 1N","","","","180deg to 174deg West; northern hemisphere.","9807","0.0","-177.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_668[] = {"16002","UTM zone 2N","","","","174deg West to 168deg West; northern hemisphere.","9807","0.0","-171.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_669[] = {"16003","UTM zone 3N","","","","168deg West to 162deg West; northern hemisphere.","9807","0.0","-165.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_670[] = {"16004","UTM zone 4N","","","","162deg West to 156deg West; northern hemisphere.","9807","0.0","-159.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_671[] = {"16005","UTM zone 5N","","","","156deg West to 150deg West; northern hemisphere.","9807","0.0","-153.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_672[] = {"16006","UTM zone 6N","","","","150deg West to 144deg West; northern hemisphere.","9807","0.0","-147.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_673[] = {"16007","UTM zone 7N","","","","144deg West to 138deg West; northern hemisphere.","9807","0.0","-141.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_674[] = {"16008","UTM zone 8N","","","","138deg West to 132deg West; northern hemisphere.","9807","0.0","-135.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_675[] = {"16009","UTM zone 9N","","","","132deg West to 126deg West; northern hemisphere.","9807","0.0","-129.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_676[] = {"16010","UTM zone 10N","","","","130deg West to 120deg West; northern hemisphere.","9807","0.0","-123.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_677[] = {"16011","UTM zone 11N","","","","120deg West to 114deg West; northern hemisphere.","9807","0.0","-117.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_678[] = {"16012","UTM zone 12N","","","","114deg West to 108deg West; northern hemisphere.","9807","0.0","-111.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_679[] = {"16013","UTM zone 13N","","","","108deg West to 102deg West; northern hemisphere.","9807","0.0","-105.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_680[] = {"16014","UTM zone 14N","","","","102deg West to 96deg West; northern hemisphere.","9807","0.0","-99.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_681[] = {"16015","UTM zone 15N","","","","96deg West to 90deg West; northern hemisphere.","9807","0.0","-93.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_682[] = {"16016","UTM zone 16N","","","","90deg West to 84deg West; northern hemisphere.","9807","0.0","-87.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_683[] = {"16017","UTM zone 17N","","","","84deg West to 78deg West; northern hemisphere.","9807","0.0","-81.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_684[] = {"16018","UTM zone 18N","","","","78deg West to 72deg West; northern hemisphere.","9807","0.0","-75.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_685[] = {"16019","UTM zone 19N","","","","72deg West to 66deg West; northern hemisphere.","9807","0.0","-69.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_686[] = {"16020","UTM zone 20N","","","","66deg West to 60deg West; northern hemisphere.","9807","0.0","-63.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_687[] = {"16021","UTM zone 21N","","","","60deg West to 54deg West; northern hemisphere.","9807","0.0","-57.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_688[] = {"16022","UTM zone 22N","","","","54deg West to 48deg West; northern hemisphere.","9807","0.0","-51.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_689[] = {"16023","UTM zone 23N","","","","48deg West to 42deg West; northern hemisphere.","9807","0.0","-45.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_690[] = {"16024","UTM zone 24N","","","","42deg West to 36deg West; northern hemisphere.","9807","0.0","-39.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_691[] = {"16025","UTM zone 25N","","","","36deg West to 30deg West; northern hemisphere.","9807","0.0","-33.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_692[] = {"16026","UTM zone 26N","","","","30deg West to 24deg West; northern hemisphere.","9807","0.0","-27.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_693[] = {"16027","UTM zone 27N","","","","24deg West to 18deg West; northern hemisphere.","9807","0.0","-21.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_694[] = {"16028","UTM zone 28N","","","","18deg West to 12deg West; northern hemisphere.","9807","0.0","-15.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_695[] = {"16029","UTM zone 29N","","","","12deg West to 6deg West; northern hemisphere.","9807","0.0","-9.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_696[] = {"16030","UTM zone 30N","","","","6deg West to 0deg; northern hemisphere.","9807","0.0","-3.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_697[] = {"16031","UTM zone 31N","","","","0deg to 6deg East; northern hemisphere.","9807","0.0","3.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_698[] = {"16032","UTM zone 32N","","","","6deg East to 12deg East; northern hemisphere.","9807","0.0","9.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_699[] = {"16033","UTM zone 33N","","","","12deg East to 18deg East; northern hemisphere.","9807","0.0","15.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_700[] = {"16034","UTM zone 34N","","","","18deg East to 24deg East; northern hemisphere.","9807","0.0","21.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_701[] = {"16035","UTM zone 35N","","","","24deg East to 30deg East; northern hemisphere.","9807","0.0","27.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_702[] = {"16036","UTM zone 36N","","","","30deg East to 36deg East; northern hemisphere.","9807","0.0","33.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_703[] = {"16037","UTM zone 37N","","","","36deg East to 42deg East; northern hemisphere.","9807","0.0","39.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_704[] = {"16038","UTM zone 38N","","","","42deg East to 48deg East; northern hemisphere.","9807","0.0","45.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_705[] = {"16039","UTM zone 39N","","","","48deg East to 54deg East; northern hemisphere.","9807","0.0","51.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_706[] = {"16040","UTM zone 40N","","","","54deg East to 60deg East; northern hemisphere.","9807","0.0","57.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_707[] = {"16041","UTM zone 41N","","","","60deg East to 66deg East; northern hemisphere.","9807","0.0","63.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_708[] = {"16042","UTM zone 42N","","","","66deg East to 72deg East; northern hemisphere.","9807","0.0","69.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_709[] = {"16043","UTM zone 43N","","","","72deg East to 78deg East; northern hemisphere.","9807","0.0","75.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_710[] = {"16044","UTM zone 44N","","","","78deg East to 84deg East; northern hemisphere.","9807","0.0","81.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_711[] = {"16045","UTM zone 45N","","","","84deg East to 90deg East; northern hemisphere.","9807","0.0","87.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_712[] = {"16046","UTM zone 46N","","","","90deg East to 96deg East; northern hemisphere.","9807","0.0","93.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_713[] = {"16047","UTM zone 47N","","","","96deg East to 102eg East; northern hemisphere.","9807","0.0","99.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_714[] = {"16048","UTM zone 48N","","","","102deg East to 108deg East; northern hemisphere.","9807","0.0","105.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_715[] = {"16049","UTM zone 49N","","","","108deg East to 114deg East; northern hemisphere.","9807","0.0","111.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_716[] = {"16050","UTM zone 50N","","","","114deg East to 120deg East; northern hemisphere.","9807","0.0","117.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_717[] = {"16051","UTM zone 51N","","","","120deg East to 126deg East; northern hemisphere.","9807","0.0","123.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_718[] = {"16052","UTM zone 52N","","","","126deg East to 132deg East; northern hemisphere.","9807","0.0","129.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_719[] = {"16053","UTM zone 53N","","","","132deg East to 138deg East; northern hemisphere.","9807","0.0","135.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_720[] = {"16054","UTM zone 54N","","","","138deg East to 144deg East; northern hemisphere.","9807","0.0","141.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_721[] = {"16055","UTM zone 55N","","","","144deg East to 150deg East; northern hemisphere.","9807","0.0","147.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_722[] = {"16056","UTM zone 56N","","","","150deg East to 156deg East; northern hemisphere.","9807","0.0","153.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_723[] = {"16057","UTM zone 57N","","","","156deg East to 162deg East; northern hemisphere.","9807","0.0","159.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_724[] = {"16058","UTM zone 58N","","","","162deg East to 168deg East; northern hemisphere.","9807","0.0","165.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_725[] = {"16059","UTM zone 59N","","","","168deg East to 174deg East; northern hemisphere.","9807","0.0","171.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_726[] = {"16060","UTM zone 60N","","","","174deg East to 180deg; northern hemisphere.","9807","0.0","177.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_727[] = {"16061","Universal Polar Stereographic North","UPS North","","","Northern hemisphere polar area.","9810","90.0","0.0","","","0.994","2000000.0","2000000.0","9001","9102","8901","","","","","1997-06-16 00:00:00","","EPSG","","97.18",NULL};
+datafile_rows_t trf_nonpolynomial_row_728[] = {"16101","UTM zone 1S","","","","180deg to 174deg West; southern hemisphere.","9807","0.0","-177.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_729[] = {"16102","UTM zone 2S","","","","174deg West to 168deg West; southern hemisphere.","9807","0.0","-171.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_730[] = {"16103","UTM zone 3S","","","","168deg West to 162deg West; southern hemisphere.","9807","0.0","-165.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_731[] = {"16104","UTM zone 4S","","","","162deg West to 156deg West; southern hemisphere.","9807","0.0","-159.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_732[] = {"16105","UTM zone 5S","","","","156deg West to 150deg West; southern hemisphere.","9807","0.0","-153.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_733[] = {"16106","UTM zone 6S","","","","150deg West to 144deg West; southern hemisphere.","9807","0.0","-147.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_734[] = {"16107","UTM zone 7S","","","","144deg West to 138deg West; southern hemisphere.","9807","0.0","-141.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_735[] = {"16108","UTM zone 8S","","","","138deg West to 132deg West; southern hemisphere.","9807","0.0","-135.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_736[] = {"16109","UTM zone 9S","","","","132deg West to 126deg West; southern hemisphere.","9807","0.0","-129.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_737[] = {"16110","UTM zone 10S","","","","130deg West to 120deg West; southern hemisphere.","9807","0.0","-123.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_738[] = {"16111","UTM zone 11S","","","","120deg West to 114deg West; southern hemisphere.","9807","0.0","-117.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_739[] = {"16112","UTM zone 12S","","","","114deg West to 108deg West; southern hemisphere.","9807","0.0","-111.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_740[] = {"16113","UTM zone 13S","","","","108deg West to 102deg West; southern hemisphere.","9807","0.0","-105.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_741[] = {"16114","UTM zone 14S","","","","102deg West to 96deg West; southern hemisphere.","9807","0.0","-99.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_742[] = {"16115","UTM zone 15S","","","","96deg West to 90deg West; southern hemisphere.","9807","0.0","-93.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_743[] = {"16116","UTM zone 16S","","","","90deg West to 84deg West; southern hemisphere.","9807","0.0","-87.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_744[] = {"16117","UTM zone 17S","","","","84deg West to 78deg West; southern hemisphere.","9807","0.0","-81.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_745[] = {"16118","UTM zone 18S","","","","78deg West to 72deg West; southern hemisphere.","9807","0.0","-75.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_746[] = {"16119","UTM zone 19S","","","","72deg West to 66deg West; southern hemisphere.","9807","0.0","-69.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_747[] = {"16120","UTM zone 20S","","","","66deg West to 60deg West; southern hemisphere.","9807","0.0","-63.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_748[] = {"16121","UTM zone 21S","","","","60deg West to 54deg West; southern hemisphere.","9807","0.0","-57.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_749[] = {"16122","UTM zone 22S","","","","54deg West to 48deg West; southern hemisphere.","9807","0.0","-51.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_750[] = {"16123","UTM zone 23S","","","","48deg West to 42deg West; southern hemisphere.","9807","0.0","-45.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_751[] = {"16124","UTM zone 24S","","","","42deg West to 36deg West; southern hemisphere.","9807","0.0","-39.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_752[] = {"16125","UTM zone 25S","","","","36deg West to 30deg West; southern hemisphere.","9807","0.0","-33.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_753[] = {"16126","UTM zone 26S","","","","30deg West to 24deg West; southern hemisphere.","9807","0.0","-27.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_754[] = {"16127","UTM zone 27S","","","","24deg West to 18deg West; southern hemisphere.","9807","0.0","-21.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_755[] = {"16128","UTM zone 28S","","","","18deg West to 12deg West; southern hemisphere.","9807","0.0","-15.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_756[] = {"16129","UTM zone 29S","","","","12deg West to 6deg West; southern hemisphere.","9807","0.0","-9.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_757[] = {"16130","UTM zone 30S","","","","6deg West to 0deg; southern hemisphere.","9807","0.0","-3.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_758[] = {"16131","UTM zone 31S","","","","0deg to 6deg East; southern hemisphere.","9807","0.0","3.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_759[] = {"16132","UTM zone 32S","","","","6deg East to 12deg East; southern hemisphere.","9807","0.0","9.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_760[] = {"16133","UTM zone 33S","","","","12deg East to 18deg East; southern hemisphere.","9807","0.0","15.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_761[] = {"16134","UTM zone 34S","","","","18deg East to 24deg East; southern hemisphere.","9807","0.0","21.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_762[] = {"16135","UTM zone 35S","","","","24deg East to 30deg East; southern hemisphere.","9807","0.0","27.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_763[] = {"16136","UTM zone 36S","","","","30deg East to 36deg East; southern hemisphere.","9807","0.0","33.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_764[] = {"16137","UTM zone 37S","","","","36deg East to 42deg East; southern hemisphere.","9807","0.0","39.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_765[] = {"16138","UTM zone 38S","","","","42deg East to 48deg East; southern hemisphere.","9807","0.0","45.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_766[] = {"16139","UTM zone 39S","","","","48deg East to 54deg East; southern hemisphere.","9807","0.0","51.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_767[] = {"16140","UTM zone 40S","","","","54deg East to 60deg East; southern hemisphere.","9807","0.0","57.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_768[] = {"16141","UTM zone 41S","","","","60deg East to 66deg East; southern hemisphere.","9807","0.0","63.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_769[] = {"16142","UTM zone 42S","","","","66deg East to 72deg East; southern hemisphere.","9807","0.0","69.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_770[] = {"16143","UTM zone 43S","","","","72deg East to 78deg East; southern hemisphere.","9807","0.0","75.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_771[] = {"16144","UTM zone 44S","","","","78deg East to 84deg East; southern hemisphere.","9807","0.0","81.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_772[] = {"16145","UTM zone 45S","","","","84deg East to 90deg East; southern hemisphere.","9807","0.0","87.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_773[] = {"16146","UTM zone 46S","","","","90deg East to 96deg East; southern hemisphere.","9807","0.0","93.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_774[] = {"16147","UTM zone 47S","","","","96deg East to 102eg East; southern hemisphere.","9807","0.0","99.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_775[] = {"16148","UTM zone 48S","","","","102deg East to 108deg East; southern hemisphere.","9807","0.0","105.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_776[] = {"16149","UTM zone 49S","","","","108deg East to 114deg East; southern hemisphere.","9807","0.0","111.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_777[] = {"16150","UTM zone 50S","","","","114deg East to 120deg East; southern hemisphere.","9807","0.0","117.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_778[] = {"16151","UTM zone 51S","","","","120deg East to 126deg East; southern hemisphere.","9807","0.0","123.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_779[] = {"16152","UTM zone 52S","","","","126deg East to 132deg East; southern hemisphere.","9807","0.0","129.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_780[] = {"16153","UTM zone 53S","","","","132deg East to 138deg East; southern hemisphere.","9807","0.0","135.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_781[] = {"16154","UTM zone 54S","","","","138deg East to 144deg East; southern hemisphere.","9807","0.0","141.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_782[] = {"16155","UTM zone 55S","","","","144deg East to 150deg East; southern hemisphere.","9807","0.0","147.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_783[] = {"16156","UTM zone 56S","","","","150deg East to 156deg East; southern hemisphere.","9807","0.0","153.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_784[] = {"16157","UTM zone 57S","","","","156deg East to 162deg East; southern hemisphere.","9807","0.0","159.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_785[] = {"16158","UTM zone 58S","","","","162deg East to 168deg East; southern hemisphere.","9807","0.0","165.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_786[] = {"16159","UTM zone 59S","","","","168deg East to 174deg East; southern hemisphere.","9807","0.0","171.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_787[] = {"16160","UTM zone 60S","","","","174deg East to 180deg; southern hemisphere.","9807","0.0","177.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_788[] = {"16161","Universal Polar Stereographic South","UPS South","","","Southern hemisphere polar area.","9810","-90.0","0.0","","","0.994","2000000.0","2000000.0","9001","9102","8901","","","","","1997-06-16 00:00:00","","EPSG","","97.18",NULL};
+datafile_rows_t trf_nonpolynomial_row_789[] = {"16202","Gauss-Kruger zone 2","","","","6deg East to 12deg East; northern hemisphere.","9807","0.0","9.0","","","1.0","2500000.0","0.0","9001","9102","8901","","","","","1998-06-30 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_790[] = {"16203","Gauss-Kruger zone 3","","","","12deg East to 18deg East; northern hemisphere.","9807","0.0","15.0","","","1.0","3500000.0","0.0","9001","9102","8901","","","","","1998-06-30 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_791[] = {"16204","Gauss-Kruger zone 4","","","","18deg East to 24deg East; northern hemisphere.","9807","0.0","21.0","","","1.0","4500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_792[] = {"16205","Gauss-Kruger zone 5","","","","24deg East to 30deg East; northern hemisphere.","9807","0.0","27.0","","","1.0","5500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_793[] = {"16206","Gauss-Kruger zone 6","","","","30deg East to 36deg East; northern hemisphere.","9807","0.0","33.0","","","1.0","6500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_794[] = {"16207","Gauss-Kruger zone 7","","","","36deg East to 42deg East; northern hemisphere.","9807","0.0","39.0","","","1.0","7500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_795[] = {"16208","Gauss-Kruger zone 8","","","","42deg East to 48deg East; northern hemisphere.","9807","0.0","45.0","","","1.0","8500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_796[] = {"16209","Gauss-Kruger zone 9","","","","48deg East to 54deg East; northern hemisphere.","9807","0.0","51.0","","","1.0","9500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_797[] = {"16210","Gauss-Kruger zone 10","","","","54deg East to 60deg East; northern hemisphere.","9807","0.0","57.0","","","1.0","10500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_798[] = {"16211","Gauss-Kruger zone 11","","","","60deg East to 66deg East; northern hemisphere.","9807","0.0","63.0","","","1.0","11500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_799[] = {"16212","Gauss-Kruger zone 12","","","","66deg East to 72deg East; northern hemisphere.","9807","0.0","69.0","","","1.0","12500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_800[] = {"16213","Gauss-Kruger zone 13","","","","72deg East to 78deg East; northern hemisphere.","9807","0.0","75.0","","","1.0","13500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_801[] = {"16214","Gauss-Kruger zone 14","","","","78deg East to 84deg East; northern hemisphere.","9807","0.0","81.0","","","1.0","14500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_802[] = {"16215","Gauss-Kruger zone 15","","","","84deg East to 90deg East; northern hemisphere.","9807","0.0","87.0","","","1.0","15500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_803[] = {"16216","Gauss-Kruger zone 16","","","","90deg East to 96deg East; northern hemisphere.","9807","0.0","93.0","","","1.0","16500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_804[] = {"16217","Gauss-Kruger zone 17","","","","96deg East to 102eg East; northern hemisphere.","9807","0.0","99.0","","","1.0","17500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_805[] = {"16218","Gauss-Kruger zone 18","","","","102deg East to 108deg East; northern hemisphere.","9807","0.0","105.0","","","1.0","18500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_806[] = {"16219","Gauss-Kruger zone 19","","","","108deg East to 114deg East; northern hemisphere.","9807","0.0","111.0","","","1.0","19500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_807[] = {"16220","Gauss-Kruger zone 20","","","","114deg East to 120deg East; northern hemisphere.","9807","0.0","117.0","","","1.0","20500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_808[] = {"16221","Gauss-Kruger zone 21","","","","120deg East to 126deg East; northern hemisphere.","9807","0.0","123.0","","","1.0","21500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_809[] = {"16222","Gauss-Kruger zone 22","","","","126deg East to 132deg East; northern hemisphere.","9807","0.0","129.0","","","1.0","22500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_810[] = {"16223","Gauss-Kruger zone 23","","","","132deg East to 138deg East; northern hemisphere.","9807","0.0","135.0","","","1.0","23500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_811[] = {"16224","Gauss-Kruger zone 24","","","","138deg East to 144deg East; northern hemisphere.","9807","0.0","141.0","","","1.0","24500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_812[] = {"16225","Gauss-Kruger zone 25","","","","144deg East to 150deg East; northern hemisphere.","9807","0.0","147.0","","","1.0","25500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_813[] = {"16226","Gauss-Kruger zone 26","","","","150deg East to 156deg East; northern hemisphere.","9807","0.0","153.0","","","1.0","26500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_814[] = {"16227","Gauss-Kruger zone 27","","","","156deg East to 162deg East; northern hemisphere.","9807","0.0","159.0","","","1.0","27500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_815[] = {"16228","Gauss-Kruger zone 28","","","","162deg East to 168deg East; northern hemisphere.","9807","0.0","165.0","","","1.0","28500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_816[] = {"16229","Gauss-Kruger zone 29","","","","168deg East to 174deg East; northern hemisphere.","9807","0.0","171.0","","","1.0","29500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_817[] = {"16230","Gauss-Kruger zone 30","","","","174deg East to 180deg; northern hemisphere.","9807","0.0","177.0","","","1.0","30500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_818[] = {"16231","Gauss-Kruger zone 31","","","","180deg to 174deg West; northern hemisphere.","9807","0.0","-177.0","","","1.0","31500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_819[] = {"16232","Gauss-Kruger zone 32","","","","174deg West to 168deg West; northern hemisphere.","9807","0.0","-171.0","","","1.0","32500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_820[] = {"16302","Gauss-Kruger 2N","","","","6deg East to 12deg East; northern hemisphere.","9807","0.0","9.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1998-06-30 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_821[] = {"16303","Gauss-Kruger 3N","","","","12deg East to 18deg East; northern hemisphere.","9807","0.0","15.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1998-06-30 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_822[] = {"16304","Gauss-Kruger 4N","","","","18deg East to 24deg East; northern hemisphere.","9807","0.0","21.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_823[] = {"16305","Gauss-Kruger 5N","","","","24deg East to 30deg East; northern hemisphere.","9807","0.0","27.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_824[] = {"16306","Gauss-Kruger 6N","","","","30deg East to 36deg East; northern hemisphere.","9807","0.0","33.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_825[] = {"16307","Gauss-Kruger 7N","","","","36deg East to 42deg East; northern hemisphere.","9807","0.0","39.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_826[] = {"16308","Gauss-Kruger 8N","","","","42deg East to 48deg East; northern hemisphere.","9807","0.0","45.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_827[] = {"16309","Gauss-Kruger 9N","","","","48deg East to 54deg East; northern hemisphere.","9807","0.0","51.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_828[] = {"16310","Gauss-Kruger 10N","","","","54deg East to 60deg East; northern hemisphere.","9807","0.0","57.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_829[] = {"16311","Gauss-Kruger 11N","","","","60deg East to 66deg East; northern hemisphere.","9807","0.0","63.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_830[] = {"16312","Gauss-Kruger 12N","","","","66deg East to 72deg East; northern hemisphere.","9807","0.0","69.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_831[] = {"16313","Gauss-Kruger 13N","","","","72deg East to 78deg East; northern hemisphere.","9807","0.0","75.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_832[] = {"16314","Gauss-Kruger 14N","","","","78deg East to 84deg East; northern hemisphere.","9807","0.0","81.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_833[] = {"16315","Gauss-Kruger 15N","","","","84deg East to 90deg East; northern hemisphere.","9807","0.0","87.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_834[] = {"16316","Gauss-Kruger 16N","","","","90deg East to 96deg East; northern hemisphere.","9807","0.0","93.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_835[] = {"16317","Gauss-Kruger 17N","","","","96deg East to 102eg East; northern hemisphere.","9807","0.0","99.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_836[] = {"16318","Gauss-Kruger 18N","","","","102deg East to 108deg East; northern hemisphere.","9807","0.0","105.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_837[] = {"16319","Gauss-Kruger 19N","","","","108deg East to 114deg East; northern hemisphere.","9807","0.0","111.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_838[] = {"16320","Gauss-Kruger 20N","","","","114deg East to 120deg East; northern hemisphere.","9807","0.0","117.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_839[] = {"16321","Gauss-Kruger 21N","","","","120deg East to 126deg East; northern hemisphere.","9807","0.0","123.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_840[] = {"16322","Gauss-Kruger 22N","","","","126deg East to 132deg East; northern hemisphere.","9807","0.0","129.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_841[] = {"16323","Gauss-Kruger 23N","","","","132deg East to 138deg East; northern hemisphere.","9807","0.0","135.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_842[] = {"16324","Gauss-Kruger 24N","","","","138deg East to 144deg East; northern hemisphere.","9807","0.0","141.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_843[] = {"16325","Gauss-Kruger 25N","","","","144deg East to 150deg East; northern hemisphere.","9807","0.0","147.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_844[] = {"16326","Gauss-Kruger 26N","","","","150deg East to 156deg East; northern hemisphere.","9807","0.0","153.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_845[] = {"16327","Gauss-Kruger 27N","","","","156deg East to 162deg East; northern hemisphere.","9807","0.0","159.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_846[] = {"16328","Gauss-Kruger 28N","","","","162deg East to 168deg East; northern hemisphere.","9807","0.0","165.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_847[] = {"16329","Gauss-Kruger 29N","","","","168deg East to 174deg East; northern hemisphere.","9807","0.0","171.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_848[] = {"16330","Gauss-Kruger 30N","","","","174deg East to 180deg; northern hemisphere.","9807","0.0","177.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_849[] = {"16331","Gauss-Kruger 31N","","","","180deg to 174deg West; northern hemisphere.","9807","0.0","-177.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_850[] = {"16332","Gauss-Kruger 32N","","","","174deg West to 168deg West; northern hemisphere.","9807","0.0","-171.0","","","1.0","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_851[] = {"16400","TM 0 N","","","","United Kingdom (UKCS) - offshore North Sea.","9807","0.0","0.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1998-11-11 00:00:00","Shell UK","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_852[] = {"16405","TM 5 NE","","","","Netherlands - offshore.","9807","0.0","5.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1998-11-11 00:00:00","NAM","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_853[] = {"16506","TM 106 NE","","","","Vietnam - offshore.","9807","0.0","106.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1998-11-11 00:00:00","PetroVietnam","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_854[] = {"16611","TM 11.30 SE","","","","Angola - offshore.","9807","0.0","11.3","","","0.9996","500000.0","10000000.0","9001","9110","8901","","","","","1998-11-11 00:00:00","Esso Angola","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_855[] = {"16612","TM 12 SE","","","","Angola - offshore.","9807","0.0","12.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1998-11-11 00:00:00","Shell Angola","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_856[] = {"16636","TM 36 SE","","","","Mozambique - offshore.","9807","0.0","36.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1998-11-11 00:00:00","BP Mozambique","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_857[] = {"17348","Map Grid of Australia zone 48","MGA zone 48","","","Australia 102deg East  to 108deg East.","9807","0.0","105.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_858[] = {"17349","Map Grid of Australia zone 49","MGA zone 49","","","Australia 108deg East  to 114deg East.","9807","0.0","111.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_859[] = {"17350","Map Grid of Australia zone 50","MGA zone 50","","","Australia 114deg East  to 120deg East.","9807","0.0","117.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_860[] = {"17351","Map Grid of Australia zone 51","MGA zone 51","","","Australia 120deg East  to 126deg East.","9807","0.0","123.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_861[] = {"17352","Map Grid of Australia zone 52","MGA zone 52","","","Australia 126deg East  to 132deg East.","9807","0.0","129.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_862[] = {"17353","Map Grid of Australia zone 53","MGA zone 53","","","Australia 132deg East  to 138deg East.","9807","0.0","135.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_863[] = {"17354","Map Grid of Australia zone 54","MGA zone 54","","","Australia 138deg East  to 144deg East.","9807","0.0","141.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_864[] = {"17355","Map Grid of Australia zone 55","MGA zone 55","","","Australia 144deg East  to 150deg East.","9807","0.0","147.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_865[] = {"17356","Map Grid of Australia zone 56","MGA zone 56","","","Australia 150deg East  to 156deg East.","9807","0.0","153.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_866[] = {"17357","Map Grid of Australia zone 57","MGA zone 57","","","Australia 156deg East  to 162deg East.","9807","0.0","159.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_867[] = {"17358","Map Grid of Australia zone 58","MGA zone 58","","","Australia 162deg East  to 168deg East.","9807","0.0","165.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Australian Surveying and Land Information Group Internet WWW page.","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_868[] = {"17448","Australian Map Grid zone 48","AMG zone 48","","","Australia 102deg East  to 108deg East.","9807","0.0","105.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_869[] = {"17449","Australian Map Grid zone 49","AMG zone 49","","","Australia 108deg East  to 114deg East.","9807","0.0","111.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_870[] = {"17450","Australian Map Grid zone 50","AMG zone 50","","","Australia 114deg East  to 120deg East.","9807","0.0","117.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_871[] = {"17451","Australian Map Grid zone 51","AMG zone 51","","","Australia 120deg East  to 126deg East.","9807","0.0","123.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_872[] = {"17452","Australian Map Grid zone 52","AMG zone 52","","","Australia 126deg East  to 132deg East.","9807","0.0","129.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_873[] = {"17453","Australian Map Grid zone 53","AMG zone 53","","","Australia 132deg East  to 138deg East.","9807","0.0","135.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_874[] = {"17454","Australian Map Grid zone 54","AMG zone 54","","","Australia 138deg East  to 144deg East.  Papua New Guinea west of 144 deg East.","9807","0.0","141.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_875[] = {"17455","Australian Map Grid zone 55","AMG zone 55","","","Australia 144deg East  to 150deg East.  Papua New Guinea 144deg East  to 150deg East.","9807","0.0","147.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_876[] = {"17456","Australian Map Grid zone 56","AMG zone 56","","","Australia 150deg East  to 156deg East.","9807","0.0","153.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_877[] = {"17457","Australian Map Grid zone 57","AMG zone 57","","","Australia 156deg East  to 162deg East.","9807","0.0","159.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_878[] = {"17458","Australian Map Grid zone 58","AMG zone 58","","","Australia 162deg East  to 168deg East.","9807","0.0","165.0","","","0.9996","500000.0","10000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972","EPSG","Grid convergence uses opposite sign convention to UTM","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_879[] = {"17515","South African Survey Grid zone 15","S. African Grid zone 15","","","South Africa - Walvis Bay.","9808","0.0","15.0","","","1.0","0.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_880[] = {"17517","South African Survey Grid zone 17","S. African Grid zone 17","","","South Africa - west of 18 deg East.","9808","0.0","17.0","","","1.0","0.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_881[] = {"17519","South African Survey Grid zone 19","S. African Grid zone 19","","","South Africa - 18 to 20 deg East.","9808","0.0","19.0","","","1.0","0.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_882[] = {"17521","South African Survey Grid zone 21","S. African Grid zone 21","","","South Africa - 20 to 22 deg East.","9808","0.0","21.0","","","1.0","0.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_883[] = {"17523","South African Survey Grid zone 23","S. African Grid zone 23","","","South Africa - 22 to 24 deg East.","9808","0.0","23.0","","","1.0","0.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_884[] = {"17525","South African Survey Grid zone 25","S. African Grid zone 25","","","Lestho  - west of 26 deg East; South Africa - 24 to 26 deg East.","9808","0.0","25.0","","","1.0","0.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_885[] = {"17527","South African Survey Grid zone 27","S. African Grid zone 27","","","Lestho  - east of 26 deg East;  South Africa - 26 to 28 deg East.","9808","0.0","27.0","","","1.0","0.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_886[] = {"17529","South African Survey Grid zone 29","S. African Grid zone 29","","","South Africa - 28 to 30 deg East.","9808","0.0","29.0","","","1.0","0.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_887[] = {"17531","South African Survey Grid zone 31","S. African Grid zone 31","","","South Africa - 30 to 32 deg East;  Swaziland.","9808","0.0","31.0","","","1.0","0.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_888[] = {"17533","South African Survey Grid zone 33","S. African Grid zone 33","","","South Africa - east of 32 deg East.","9808","0.0","33.0","","","1.0","0.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_889[] = {"17611","South West African Survey Grid zone 11","SW African Grid zone 11","","","Namibia - west of 12 deg East.","9808","-22.0","11.0","","","1.0","0.0","0.0","9031","9102","8901","","","","","1997-06-16 00:00:00","Chief Directorate Surveys and Land Information; Mowbray; South Africa.","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29  97.16",NULL};
+datafile_rows_t trf_nonpolynomial_row_890[] = {"17613","South West African Survey Grid zone 13","SW African Grid zone 13","","","Namibia - 12 to 14 deg East.","9808","-22.0","13.0","","","1.0","0.0","0.0","9031","9102","8901","","","","","1997-06-16 00:00:00","Chief Directorate Surveys and Land Information; Mowbray; South Africa.","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29  97.16",NULL};
+datafile_rows_t trf_nonpolynomial_row_891[] = {"17615","South West African Survey Grid zone 15","SW African Grid zone 15","","","Namibia - 14 to 16 deg East.","9808","-22.0","15.0","","","1.0","0.0","0.0","9031","9102","8901","","","","","1997-06-16 00:00:00","Chief Directorate Surveys and Land Information; Mowbray; South Africa.","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29  97.16",NULL};
+datafile_rows_t trf_nonpolynomial_row_892[] = {"17617","South West African Survey Grid zone 17","SW African Grid zone 17","","","Namibia - 16 to 18 deg East.","9808","-22.0","17.0","","","1.0","0.0","0.0","9031","9102","8901","","","","","1997-06-16 00:00:00","Chief Directorate Surveys and Land Information; Mowbray; South Africa.","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29  97.16",NULL};
+datafile_rows_t trf_nonpolynomial_row_893[] = {"17619","South West African Survey Grid zone 19","SW African Grid zone 19","","","Namibia - 18 to 20 deg East.","9808","-22.0","19.0","","","1.0","0.0","0.0","9031","9102","8901","","","","","1997-06-16 00:00:00","Chief Directorate Surveys and Land Information; Mowbray; South Africa.","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29  97.16",NULL};
+datafile_rows_t trf_nonpolynomial_row_894[] = {"17621","South West African Survey Grid zone 21","SW African Grid zone 21","","","Namibia - 20 to 22 deg East.","9808","-22.0","21.0","","","1.0","0.0","0.0","9031","9102","8901","","","","","1997-06-16 00:00:00","Chief Directorate Surveys and Land Information; Mowbray; South Africa.","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29  97.16",NULL};
+datafile_rows_t trf_nonpolynomial_row_895[] = {"17623","South West African Survey Grid zone 23","SW African Grid zone 23","","","Namibia - 22 to 24 deg East.","9808","-22.0","23.0","","","1.0","0.0","0.0","9031","9102","8901","","","","","1997-06-16 00:00:00","Chief Directorate Surveys and Land Information; Mowbray; South Africa.","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29  97.16",NULL};
+datafile_rows_t trf_nonpolynomial_row_896[] = {"17625","South West African Survey Grid zone 25","SW African Grid zone 25","","","Namibia - east of 24 deg East.","9808","-22.0","25.0","","","1.0","0.0","0.0","9031","9102","8901","","","","","1997-06-16 00:00:00","Chief Directorate Surveys and Land Information; Mowbray; South Africa.","EPSG","Transformation method sometimes described as \"Gauss conform\".","95.30  96.29  97.16",NULL};
+datafile_rows_t trf_nonpolynomial_row_897[] = {"17700","MTM Quebec zone 2","","","","Canada - Quebec - east of 57 deg East.","9807","0.0","-55.3","","","0.9999","304800.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_898[] = {"17701","MTM zone 1","","","","Canada - Newfoundland - east of 54 deg 30 min West.","9807","0.0","-53.0","","","0.9999","304800.0","0.0","9001","9102","8901","","","","","1997-11-13 00:00:00","Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_899[] = {"17702","MTM Newfoundland zone 2","MTM zone 2","","","Canada - Newfoundland and Labrador between 57 deg 30 min and 54 de 30 min West.","9807","0.0","-56.0","","","0.9999","304800.0","0.0","9001","9102","8901","","","","","1997-11-13 00:00:00","Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_900[] = {"17703","MTM zone 3","","","","Canada - Newfoundland and Labrador between 60 deg and 57 deg 30 min West; Canada - Quebec between 60 deg and 57 deg West.","9807","0.0","-58.3","","","0.9999","304800.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_901[] = {"17704","MTM zone 4","","","","Canada - Quebec and Newfoundland (Labrador) between 63 deg and 60 deg West.","9807","0.0","-61.3","","","0.9999","304800.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_902[] = {"17705","MTM zone 5","","","","Canada - Quebec and Newfoundland (Labrador) between 66 deg and 63 deg West.","9807","0.0","-64.3","","","0.9999","304800.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_903[] = {"17706","MTM zone 6","","","","Canada - Quebec and Newfoundland (Labrador) between 69 deg and  66 deg West.","9807","0.0","-67.3","","","0.9999","304800.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_904[] = {"17707","MTM zone 7","","","","Canada - Quebec between 72 deg and 69 deg West.","9807","0.0","-70.3","","","0.9999","304800.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Topographic Mapping Section; Quebec Ministry of Natural Resources.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_905[] = {"17708","MTM zone 8","","","","Canada - Quebec between 75 deg and 72 deg West.; Canada - Ontario - east of 75 deg West.","9807","0.0","-73.3","","","0.9999","304800.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_906[] = {"17709","MTM zone 9","","","","Canada - Quebec and Ontario - between 78 deg and 75 deg West.","9807","0.0","-76.3","","","0.9999","304800.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_907[] = {"17710","MTM zone 10","","","","Canada - Quebec west of 78 deg West; Canada - Ontario - between 79 deg 30 min and 78 deg W in area to north of 47 deg N; between 80 deg 15 min and 78 deg W in area between 46 deg and 47 deg N; between 81 deg and 78 deg W in area south of 46 deg N.","9807","0.0","-79.3","","","0.9999","304800.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transp [...]
+datafile_rows_t trf_nonpolynomial_row_908[] = {"17711","MTM zone 11","","","","Canada - Ontario - south of 46 deg N and west of 81 deg West.","9807","0.0","-82.3","","","0.9999","304800.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_909[] = {"17712","MTM zone 12","","","","Canada - Ontario - between 82 deg 30 min and 79 deg 30 min W in area to north of 47 deg N; between 82 deg 30 min and 80 deg 15 min W in area between 46 deg and 47 deg N; between 82 deg 30 min and 79 deg 30 min W in area north of 47 deg N.","9807","0.0","-81.0","","","0.9999","304800.0","0.0","9001","9102","8901","","","","","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation. [...]
+datafile_rows_t trf_nonpolynomial_row_910[] = {"17713","MTM zone 13","","","","Canada - Ontario - between 85 deg 30 min and 82 deg 30 min West and north of 46 deg North.","9807","0.0","-84.0","","","0.9999","304800.0","0.0","9001","9102","8901","","","","","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_911[] = {"17714","MTM zone 14","","","","Canada - Ontario - between 88 deg 30 min and 85 deg 30 min West.","9807","0.0","-87.0","","","0.9999","304800.0","0.0","9001","9102","8901","","","","","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_912[] = {"17715","MTM zone 15","","","","Canada - Ontario - between 91 deg 30 min and 88 deg 30 min West.","9807","0.0","-90.0","","","0.9999","304800.0","0.0","9001","9102","8901","","","","","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_913[] = {"17716","MTM zone 16","","","","Canada - Ontario - between 94 deg 30 min and 91 deg 30 min West.","9807","0.0","-93.0","","","0.9999","304800.0","0.0","9001","9102","8901","","","","","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_914[] = {"17717","MTM zone 17","","","","Canada - Ontario - west of 94 deg 30 min West.","9807","0.0","-96.0","","","0.9999","304800.0","0.0","9001","9102","8901","","","","","1997-11-13 00:00:00","Surveys and Mapping Section; Ontario Ministry of Transportation.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_915[] = {"17794","MTM Nova Scotia zone 4","","","","Canada - Nova Scotia - east of 63 deg West.","9807","0.0","-61.3","","","0.9999","4500000.0","0.0","9001","9110","8901","","","","","1999-05-24 00:00:00","Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.","EPSG","","99.042",NULL};
+datafile_rows_t trf_nonpolynomial_row_916[] = {"17795","MTM Nova Scotia zone 5","","","","Canada - Nova Scotia - west of 63 deg West.","9807","0.0","-64.3","","","0.9999","5500000.0","0.0","9001","9110","8901","","","","","1999-05-24 00:00:00","Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.","EPSG","","99.042",NULL};
+datafile_rows_t trf_nonpolynomial_row_917[] = {"17801","Japan Plane Rectangular CS zone I","Japan zone I","","","Japan - Kyushu - Nagasaki-ken; islands of Kagoshima-ken between 27 and 32 deg N and between 128 deg 18 min and 130 deg E (between 128 deg 18 min and 30 deg 13 min E for Amami islands).","9807","33.0","129.3","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2 [...]
+datafile_rows_t trf_nonpolynomial_row_918[] = {"17802","Japan Plane Rectangular CS zone II","Japan zone II","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","9807","33.0","131.0","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","O [...]
+datafile_rows_t trf_nonpolynomial_row_919[] = {"17803","Japan Plane Rectangular CS zone III","Japan zone III","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","9807","36.0","132.1","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG", [...]
+datafile_rows_t trf_nonpolynomial_row_920[] = {"17804","Japan Plane Rectangular CS zone IV","Japan zone IV","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","9807","33.0","133.3","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","O [...]
+datafile_rows_t trf_nonpolynomial_row_921[] = {"17805","Japan Plane Rectangular CS zone V","Japan zone V","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","9807","36.0","134.2","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","Ori [...]
+datafile_rows_t trf_nonpolynomial_row_922[] = {"17806","Japan Plane Rectangular CS zone VI","Japan zone VI","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","9807","36.0","136.0","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","O [...]
+datafile_rows_t trf_nonpolynomial_row_923[] = {"17807","Japan Plane Rectangular CS zone VII","Japan zone VII","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","9807","36.0","137.1","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG", [...]
+datafile_rows_t trf_nonpolynomial_row_924[] = {"17808","Japan Plane Rectangular CS zone VIII","Japan zone VIII","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","9807","36.0","138.3","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG [...]
+datafile_rows_t trf_nonpolynomial_row_925[] = {"17809","Japan Plane Rectangular CS zone IX","Japan zone IX","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","9807","36.0","139.5","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","O [...]
+datafile_rows_t trf_nonpolynomial_row_926[] = {"17810","Japan Plane Rectangular CS zone X","Japan zone X","","","Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).","9807","40.0","140.5","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","Ori [...]
+datafile_rows_t trf_nonpolynomial_row_927[] = {"17811","Japan Plane Rectangular CS zone XI","Japan zone XI","","","Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.","9807","44.0","140.15","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/ima [...]
+datafile_rows_t trf_nonpolynomial_row_928[] = {"17812","Japan Plane Rectangular CS zone XII","Japan zone XII","","","Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.","9807","44.0","142.15","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/i [...]
+datafile_rows_t trf_nonpolynomial_row_929[] = {"17813","Japan Plane Rectangular CS zone XIII","Japan zone XIII","","","Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.","9807","44.0","144.15","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum [...]
+datafile_rows_t trf_nonpolynomial_row_930[] = {"17814","Japan Plane Rectangular CS zone XIV","Japan zone XIV","","","Japan - Tokyo-to south of 28 deg N & between 140 deg 30 min & 143 deg E.","9807","26.0","142.0","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","Original transformation by Gauss-Kruger formula.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_931[] = {"17815","Japan Plane Rectangular CS zone XV","Japan zone XV","","","Japan - Okinawa-ken between 126 deg &130 deg E.","9807","26.0","127.3","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","Original transformation by Gauss-Kruger formula.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_932[] = {"17816","Japan Plane Rectangular CS zone XVI","Japan zone XVI","","","Japan - Okinawa-ken west of 126 deg E.","9807","26.0","124.0","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","Original transformation by Gauss-Kruger formula.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_933[] = {"17817","Japan Plane Rectangular CS zone XVII","Japan zone XVII","","","Japan - Okinawa-ken east of 130 deg E.","9807","26.0","131.0","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","Original transformation by Gauss-Kruger formula.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_934[] = {"17818","Japan Plane Rectangular CS zone XVIII","Japan zone XVIII","","","Japan - Tokyo-to south of 28 N & west of 140 deg 30 min E.","9807","20.0","136.0","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","Original transformation by Gauss-Kruger formula.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_935[] = {"17819","Japan Plane Rectangular CS zone XIX","Japan zone XIX","","","Japan - Tokyo-to south of 28 N & east of 143 deg E.","9807","26.0","154.0","","","0.9999","0.0","0.0","9001","9110","8901","","","","","1998-12-12 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","Original transformation by Gauss-Kruger formula.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_936[] = {"18011","Nord Algerie (ancienne)","","","","Algeria north of 38.5g (34 deg 39 min) North.","9801","40.0","3.0","","","0.999625544","500000.0","300000.0","9001","9105","8901","","","","","1996-09-12 00:00:00","","EPSG","Used with Voirol 1875 datum - now superseded.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_937[] = {"18012","Sud Algerie (ancienne)","","","","Algeria 35g to 38.5g (31 deg 30 min to 34 deg 39 min) North.","9801","37.0","3.0","","","0.999625769","500000.0","300000.0","9001","9105","8901","","","","","1996-09-12 00:00:00","","EPSG","Used with Voirol 1875 datum - now superseded.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_938[] = {"18021","Nord Algerie","","","","Algeria north of 38.5g (34 deg 39 min) North.","9801","40.0","3.0","","","0.999625544","500135.0","300090.0","9001","9105","8901","","","","","1996-09-12 00:00:00","","EPSG","Use with Voirol Unifie 1960 datum.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_939[] = {"18022","Sud Algerie","","","","Algeria 35g to 38.5g (31 deg 30 min to 34 deg 39 min) North.","9801","37.0","3.0","","","0.999625769","500135.0","300090.0","9001","9105","8901","","","","","1996-09-12 00:00:00","","EPSG","Use with Voirol Unifie 1960 datum.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_940[] = {"18031","Argentina zone 1","Argentina 1","","","Argentina west of 70 deg 30 min West.","9807","-90.0","-72.0","","","1.0","1500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_941[] = {"18032","Argentina zone 2","Argentina 2","","","Argentina between 70 deg 30 min and 67 deg 30 min West.","9807","-90.0","-69.0","","","1.0","2500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_942[] = {"18033","Argentina zone 3","Argentina 3","","","Argentina between 67 deg 30 min and 64 deg 30 min West.","9807","-90.0","-66.0","","","1.0","3500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_943[] = {"18034","Argentina zone 4","Argentina 4","","","Argentina between 64 deg 30 min and 61 deg 30 min West.","9807","-90.0","-63.0","","","1.0","4500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_944[] = {"18035","Argentina zone 5","Argentina 5","","","Argentina between 61 deg 30 min and 58 deg 30 min West.","9807","-90.0","-60.0","","","1.0","5500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_945[] = {"18036","Argentina zone 6","Argentina 6","","","Argentina between 58 deg 30 min and 55 deg 30 min West.","9807","-90.0","-57.0","","","1.0","6500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_946[] = {"18037","Argentina zone 7","Argentina 7","","","Argentina east of 55 deg 30 min West.","9807","-90.0","-54.0","","","1.0","7500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_947[] = {"18041","Austria West Zone","","","","Austria west of 11deg 50min East of Greenwich (29deg 30min E of Ferro).","9807","0.0","28.0","","","1.0","0.0","0.0","9001","9102","8909","","","","","1997-04-11 00:00:00","","EPSG","Superseded by M28 (EPSG code 18044).","95.30  96.29  97.01  98.48",NULL};
+datafile_rows_t trf_nonpolynomial_row_948[] = {"18042","Austria Central Zone","","","","Austria between 11deg 50min and 14deg 50min East of Greenwich (29deg 30min and 32deg 30min East of Ferro).","9807","0.0","31.0","","","1.0","0.0","0.0","9001","9102","8909","","","","","1997-04-11 00:00:00","","EPSG","Superseded by M31 (EPSG code 18045).","95.30  96.29  97.01  98.48",NULL};
+datafile_rows_t trf_nonpolynomial_row_949[] = {"18043","Austria East Zone","","","","Austria east of 14deg 50min East of Greenwich (32deg 30min East of Ferro).","9807","0.0","34.0","","","1.0","0.0","0.0","9001","9102","8909","","","","","1997-04-11 00:00:00","","EPSG","Superseded by M34 (EPSG code 18046).","95.30  96.29  97.01  98.48",NULL};
+datafile_rows_t trf_nonpolynomial_row_950[] = {"18044","Austria M28","M28","","","Austria west of 11deg 50min East of Greenwich (29deg 30min E of Ferro).","9807","0.0","10.2","","","1.0","150000.0","0.0","9001","9110","8901","","","","","1999-10-20 00:00:00","Bundesamt f�r Eich- und Vermessungswesen","EPSG","Supersedes Austria West zone (EPSG code 18041).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_951[] = {"18045","Austria M31","M31","","","Austria between 11deg 50min and 14deg 50min East of Greenwich (29deg 30min and 32deg 30min East of Ferro).","9807","0.0","13.2","","","1.0","450000.0","0.0","9001","9110","8901","","","","","1999-10-20 00:00:00","Bundesamt f�r Eich- und Vermessungswesen","EPSG","Supersedes Austria Central zone (EPSG code 18042).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_952[] = {"18046","Austria M34","M34","","","Austria east of 14deg 50min East of Greenwich (32deg 30min East of Ferro).","9807","0.0","16.2","","","1.0","750000.0","0.0","9001","9110","8901","","","","","1999-10-20 00:00:00","Bundesamt f�r Eich- und Vermessungswesen","EPSG","Supersedes Austria East zone (EPSG code 18043).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_953[] = {"18051","Colombia West zone","Colombia 3W","","","Colombia west of 1 deg 30 min W of Bogota (75d 34m 51.30s W of Greenwich).","9807","4.355657","-77.04513","","","1.0","1000000.0","1000000.0","9001","9110","8901","","","","","1997-04-11 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.  Zone name sometimes referred to as \"6 west\".","95.30  96.29  97.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_954[] = {"18052","Colombia Bogota zone","Colombia Bogota","","","Colombia 1 deg 30 min W to 1 deg 30 min E of Bogota (75d 35m W to 72d 35m W of Greenwich).","9807","4.355657","-74.04513","","","1.0","1000000.0","1000000.0","9001","9110","8901","","","","","1997-04-11 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30  96.29  97.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_955[] = {"18053","Colombia East Central zone","Colombia 3E","","","Colombia 1 deg 30 min to 4 deg 30 min E of Bogota (72d 35m to 69d 34m W of Greenwich).","9807","4.355657","-71.04513","","","1.0","1000000.0","1000000.0","9001","9110","8901","","","","","1997-04-11 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.  Zone name sometimes referred to as \"3 east\".","95.30  96.29  97.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_956[] = {"18054","Colombia East zone","Colombia 6E","","","Colombia east of 4 deg 30 min E of Bogota (69d 34m 51.3s W of Greenwich).","9807","4.355657","-68.04513","","","1.0","1000000.0","1000000.0","9001","9110","8901","","","","","1997-04-11 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.  Zone name sometimes referred to as \"6 east\".","95.30  96.29  97.11",NULL};
+datafile_rows_t trf_nonpolynomial_row_957[] = {"18061","Cuba Norte","","","","Cuba","9801","22.21","-81.0","","","0.99993602","500000.0","280296.016","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_958[] = {"18062","Cuba Sur","","","","Cuba","9801","20.43","-76.5","","","0.99994848","500000.0","229126.939","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_959[] = {"18071","Egypt Blue Belt","Blue Belt","","","Egypt  - Sinai peninsula.","9807","30.0","35.0","","","1.0","300000.0","1100000.0","9001","9102","8901","","","","","1999-04-22 00:00:00","","EPSG","Also known as Green Belt.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_960[] = {"18072","Egypt Red Belt","Red Belt","","","Egypt  east of 29 deg East.","9807","30.0","31.0","","","1.0","615000.0","810000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_961[] = {"18073","Egypt Purple Belt","Purple Belt","","","Egypt  west of 29 deg East; north of approx 28 deg 11 min North.","9807","30.0","27.0","","","1.0","700000.0","200000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_962[] = {"18074","Egypt Extended Purple Belt","Extended Purple Belt","","","Egypt  west of 29 deg East; south of approx 28 deg 11 min North.","9807","30.0","27.0","","","1.0","700000.0","1200000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_963[] = {"18081","France I","","","","France north of 53.5 grads (48 deg 09 min) North.","9801","55.0","0.0","","","0.999877341","600000.0","1200000.0","9001","9105","8903","","","","","1996-09-12 00:00:00","IGN Paris.","EPSG","Introduced 1972. See 18091.","95.26",NULL};
+datafile_rows_t trf_nonpolynomial_row_964[] = {"18082","France II","","","","France 50.5 to 53.5 grads (45 deg 27 min to 48 deg 09 min) North.","9801","52.0","0.0","","","0.99987742","600000.0","2200000.0","9001","9105","8903","","","","","1996-09-12 00:00:00","IGN Paris.","EPSG","Introduced 1972. See 18092.","95.26",NULL};
+datafile_rows_t trf_nonpolynomial_row_965[] = {"18083","France III","","","","France south of 50.5 grads (45 deg 27 min) North.","9801","49.0","0.0","","","0.999877499","600000.0","3200000.0","9001","9105","8903","","","","","1996-09-12 00:00:00","IGN Paris.","EPSG","Introduced 1972. See 18093.","95.26",NULL};
+datafile_rows_t trf_nonpolynomial_row_966[] = {"18084","France IV","","","","France - Corsica.","9801","46.85","0.0","","","0.99994471","234.358","4185861.369","9001","9105","8903","","","","","1996-09-12 00:00:00","IGN Paris.","EPSG","Introduced 1972. See 18094.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_967[] = {"18091","Nord France","","","","France north of 53.5 grads (48 deg 09 min) North.","9801","55.0","0.0","","","0.999877341","600000.0","200000.0","9001","9105","8903","","","","","1996-09-12 00:00:00","IGN Paris.","EPSG","Superseded by 18081 from 1972.","95.26",NULL};
+datafile_rows_t trf_nonpolynomial_row_968[] = {"18092","Centre France","","","","France 50.5 to 53.5 grads (45 deg 27 min to 48 deg 09 min) North.","9801","52.0","0.0","","","0.99987742","600000.0","200000.0","9001","9105","8903","","","","","1996-09-12 00:00:00","IGN Paris.","EPSG","Superseded by 18082 from 1972.","95.26",NULL};
+datafile_rows_t trf_nonpolynomial_row_969[] = {"18093","Sud France","","","","France south of 50.5 grads (45 deg 27 min) North.","9801","49.0","0.0","","","0.999877499","600000.0","200000.0","9001","9105","8903","","","","","1996-09-12 00:00:00","IGN Paris.","EPSG","Superseded by 18083 from 1972.","95.26",NULL};
+datafile_rows_t trf_nonpolynomial_row_970[] = {"18094","Corse","","","","France - Corsica.","9801","46.85","0.0","","","0.99994471","234.358","185861.369","9001","9105","8903","","","","","1996-09-12 00:00:00","IGN Paris.","EPSG","Superseded by 18084 from 1972.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_971[] = {"18101","Germany zone 1","","","","Germany - onshore west of 4 deg 30 min East.","9807","0.0","3.0","","","1.0","1500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_972[] = {"18102","Germany zone 2","","","","Germany - onshore between 4 deg 30 min and 7 deg 30 min East.","9807","0.0","6.0","","","1.0","2500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_973[] = {"18103","Germany zone 3","","","","Germany - onshore between 7 deg 30 min and 10 deg 30 min East.","9807","0.0","9.0","","","1.0","3500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_974[] = {"18104","Germany zone 4","","","","Germany - onshore between 10 deg 30 min and 13 deg 30 min East.","9807","0.0","12.0","","","1.0","4500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_975[] = {"18105","Germany zone 5","","","","Germany - onshore between 13 deg 30 min and 16 deg 30 min East.","9807","0.0","15.0","","","1.0","5500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_976[] = {"18110","India zone 0","","","","Pakistan north of 35 deg 35 min North.","9801","39.3","68.0","","","0.99846154","2355500.0","2590000.0","9084","9110","8901","","","","","1999-10-20 00:00:00","US Army Map Service projection tables; 1943.","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","95.30  96.01  96.02  96.29  97.23",NULL};
+datafile_rows_t trf_nonpolynomial_row_977[] = {"18111","India zone I","","","","India north of 28 deg North. Pakistan 28 deg to 35 deg 35 min North.","9801","32.3","68.0","","","0.99878641","3000000.0","1000000.0","9084","9110","8901","","","","","1999-10-20 00:00:00","US Army Map Service projection tables; 1943.","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","95.30  96.02  [...]
+datafile_rows_t trf_nonpolynomial_row_978[] = {"18112","India zone IIa","","","","India - between 21 deg and 28 deg North and  west of 82 deg East; Pakistan - south of 28 deg North.","9801","26.0","74.0","","","0.99878641","3000000.0","1000000.0","9084","9102","8901","","","","","1999-10-20 00:00:00","US Army Map Service projection tables; 1943.","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion [...]
+datafile_rows_t trf_nonpolynomial_row_979[] = {"18113","India zone IIb","India zone II b","","","Bangladesh; India - north of 21 deg North and east of 82 deg East; Myanmar (Burma) - north of 21 deg North.","9801","26.0","90.0","","","0.99878641","3000000.0","1000000.0","9084","9102","8901","","","","","1999-10-20 00:00:00","US Army Map Service projection tables; 1943.","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas  [...]
+datafile_rows_t trf_nonpolynomial_row_980[] = {"18114","India zone IIIa","India zone IIIa","","","India - between 15 deg and 21 deg North.","9801","19.0","80.0","","","0.99878641","3000000.0","1000000.0","9084","9102","8901","","","","","1999-10-20 00:00:00","US Army Map Service projection tables; 1943.","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","95.28  96.02  97.23",NULL};
+datafile_rows_t trf_nonpolynomial_row_981[] = {"18115","India zone IIIb","","","","Myanmar (Burma) - between 15 deg and 21 deg North.","9801","19.0","100.0","","","0.99878641","3000000.0","1000000.0","9084","9102","8901","","","","","1999-10-20 00:00:00","US Army Map Service projection tables; 1943.","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","95.28  96.02  97.23",NULL};
+datafile_rows_t trf_nonpolynomial_row_982[] = {"18116","India zone IVa","India zone Iva","","","India - south of 15 deg North.","9801","12.0","80.0","","","0.99878641","3000000.0","1000000.0","9084","9102","8901","","","","","1999-10-20 00:00:00","US Army Map Service projection tables; 1943.","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","95.28  96.02  97.23",NULL};
+datafile_rows_t trf_nonpolynomial_row_983[] = {"18117","India zone IVb","","","","Myanmar - south of 15 deg North.","9801","12.0","100.0","","","0.99878641","3000000.0","1000000.0","9084","9102","8901","","","","","1999-10-20 00:00:00","US Army Map Service projection tables; 1943.","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","95.28  96.02  97.23",NULL};
+datafile_rows_t trf_nonpolynomial_row_984[] = {"18121","Italy zone 1","","","","Italy west of 12 deg East (of Greenwich).","9807","0.0","9.0","","","0.9996","1500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Boaga formula","",NULL};
+datafile_rows_t trf_nonpolynomial_row_985[] = {"18122","Italy zone 2","","","","Italy east of 12 deg East (of Greenwich).","9807","0.0","15.0","","","0.9996","2520000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Original transformation by Gauss-Boaga formula","",NULL};
+datafile_rows_t trf_nonpolynomial_row_986[] = {"18131","Nord Maroc","","","","Morocco north of 35 grads (31 deg 30 min) North.","9801","37.0","-6.0","","","0.999625769","500000.0","300000.0","9001","9105","8901","","","","","1996-09-12 00:00:00","IGN Paris.","EPSG","A projection with the same parameter values used the Lambert Conic Near-Conformal method (EPSG code 9817) prior to 1953.","99.203",NULL};
+datafile_rows_t trf_nonpolynomial_row_987[] = {"18132","Sud Maroc","","","","Morocco 31gr to 35gr  (27 deg 54 min to 31 deg 30 min) North.","9801","33.0","-6.0","","","0.999615596","500000.0","300000.0","9001","9105","8901","","","","","1996-09-12 00:00:00","","EPSG","A projection with the same parameter values used the Lambert Conic Near-Conformal method (EPSG code 9817) prior to 1953.","99.203",NULL};
+datafile_rows_t trf_nonpolynomial_row_988[] = {"18133","Sahara","","","","Morocco south of 31gr  (27 deg 54 min) North.","9801","29.0","-6.0","","","0.9996","1200000.0","400000.0","9001","9105","8901","","","","","1996-09-12 00:00:00","IGN Paris","EPSG","Created in 1977 to cover Sahara Marocain (ex Spanish Sahara)","",NULL};
+datafile_rows_t trf_nonpolynomial_row_989[] = {"18141","New Zealand North Island National Grid","North Island Grid","","","New Zealand - North Island.","9807","-39.0","175.3","","","1.0","300000.0","400000.0","9040","9110","8901","","","","","1999-10-20 00:00:00","","EPSG","Superseded by New Zealand Map Grid.","95.30  96.29  97.231",NULL};
+datafile_rows_t trf_nonpolynomial_row_990[] = {"18142","New Zealand South Island National Grid","South Island Grid","","","New Zealand - South Island.","9807","-44.0","171.3","","","1.0","500000.0","500000.0","9040","9110","8901","","","","","1999-10-20 00:00:00","","EPSG","Superseded by New Zealand Map Grid.","95.30  96.29  97.231",NULL};
+datafile_rows_t trf_nonpolynomial_row_991[] = {"18151","Nigeria West Belt","","","","Nigeria west of 6 deg 30 min East.","9807","4.0","4.3","","","0.99975","230738.26","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_992[] = {"18152","Nigeria Mid Belt","","","","Nigeria between 6 deg 30 min and 10 deg 30 min East.","9807","4.0","8.3","","","0.99975","670553.98","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_993[] = {"18153","Nigeria East Belt","","","","Nigeria east of 10 deg 30 min East.","9807","4.0","12.3","","","0.99975","1110369.7","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_994[] = {"18161","Peru west zone","","","","Peru west of 79 deg West.","9807","-6.0","-80.3","","","0.99983008","222000.0","1426834.743","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_995[] = {"18162","Peru central zone","","","","Peru 79 to 73 deg West.","9807","-9.3","-76.0","","","0.99932994","720000.0","1039979.159","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_996[] = {"18163","Peru east zone","","","","Peru east of 73 deg West.","9807","-9.3","-70.3","","","0.99952992","1324000.0","1040084.558","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_997[] = {"18171","Philippines zone  I","","","","Philippines - west of 118 deg East.","9807","0.0","117.0","","","0.99995","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_998[] = {"18172","Philippines zone  II","","","","Philippines - Palawan; Calamian Islands.","9807","0.0","119.0","","","0.99995","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_999[] = {"18173","Philippines zone  III","","","","Philippines - Luzon (except SE part); Mindoro.","9807","0.0","121.0","","","0.99995","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_1000[] = {"18174","Philippines zone  IV","","","","Philippines - SE Luzon; Tablas; Masbate; Panay; Cebu; Negros; W. Mindanao.","9807","0.0","123.0","","","0.99995","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_1001[] = {"18175","Philippines zone  V","","","","Philippines - E. Mindanao; Bohol; Samar.","9807","0.0","125.0","","","0.99995","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_1002[] = {"18181","Nord Tunisie","","","","Tunisia north of 38.5 grads (34 deg 39 min) North.","9801","40.0","11.0","","","0.999625544","500000.0","300000.0","9001","9105","8901","","","","","1996-09-12 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_1003[] = {"18182","Sud Tunisie","","","","Tunisia south of 38.5 grads (34 deg 39 min) North.","9801","37.0","11.0","","","0.999625769","500000.0","300000.0","9001","9105","8901","","","","","1996-09-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1004[] = {"18191","Finland zone 1","","","","Finland - west of 22deg 30min E.","9807","0.0","21.0","","","1.0","1500000.0","0.0","9001","9102","8901","","","","","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1005[] = {"18192","Finland zone 2","","","","Finland - 22deg 30 min to 25deg 30min E.","9807","0.0","24.0","","","1.0","2500000.0","0.0","9001","9102","8901","","","","","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1006[] = {"18193","Finland Uniform Coordinate System","Finland zone 3","","","Finland; Finland - 25 deg 30min E to 28deg 30min E.","9807","0.0","27.0","","","1.0","3500000.0","0.0","9001","9102","8901","","","","","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","Used by Uniform Coordinate System over all country and also by zone 3 of Basic Coordinate System at larger scales.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1007[] = {"18194","Finland zone 4","","","","Finland - east of 28deg 30 min E.","9807","0.0","30.0","","","1.0","4500000.0","0.0","9001","9102","8901","","","","","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1008[] = {"18201","Palestine Grid","","","","Israel;  Jordan","9806","31.4402749","35.124349","","","","170251.555","126867.909","9001","9110","8901","","","","","1999-04-22 00:00:00","","EPSG","Also encountered as a Transverse Mercator projection with scale factor of 1.  The difference in conversion caused by the change of formula does not exceed 2m within Israel.  Within the State of Israel superseded by the Israeli CS Grid (EPSG code 18203).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1009[] = {"18202","Palestine Belt","","","","Israel;  Jordan","9807","31.4402749","35.124349","","","1.0","170251.555","1126867.909","9001","9110","8901","","","","","1999-04-22 00:00:00","","EPSG","Originally constructed as the Palestine Grid - EPSG code 18201. Adopted by the US Army Map Service as \"Palestine Belt\" with change of projection method and false northing (FN). Sometimes seen with unchanged FN of 126867.909.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1010[] = {"18203","Israeli CS","ICS","","","Israel","9806","31.4402749","35.124349","","","","170251.555","1126867.909","9001","9110","8901","","","","","1999-10-20 00:00:00","Survey of Israel   ftp://ftp.rd.soi.gov.il/doc","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1011[] = {"18204","Israeli TM","ITM","","","Israel","9807","31.4403817","35.1216261","","","1.0000067","219529.584","626907.39","9001","9110","8901","","","","","1999-10-20 00:00:00","Survey of Israel   ftp://ftp.rd.soi.gov.il/doc","EPSG","Designed to approximate Israeli CS grid in north-central Israel.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1012[] = {"18211","Guatemala Norte","","","","Guatemala north of 15 deg 50 min North.","9801","16.49","-90.2","","","0.99992226","500000.0","292209.579","9001","9110","8901","","","","","1999-08-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1013[] = {"18212","Guatemala Sud","","","","Guatemala south of 15 deg 50 min North.","9801","14.54","-90.2","","","0.99989906","500000.0","325992.681","9001","9110","8901","","","","","1999-08-16 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1014[] = {"18221","NGO zone I","","","","Norway - west of 3deg 30min W of Oslo (7deg 13min 22.5sec E of Greenwich).","9807","58.0","-4.4","","","1.0","0.0","0.0","9001","9110","8913","","","","","1999-10-20 00:00:00","J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1015[] = {"18222","NGO zone II","","","","Norway - between 3deg 30min W and 1deg 10min W of Oslo (7deg 13min 22.5sec E  and 9deg 33min 22.5sec E of Greenwich).","9807","58.0","-2.2","","","1.0","0.0","0.0","9001","9110","8913","","","","","1999-10-20 00:00:00","J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1016[] = {"18223","NGO zone III","","","","Norway - between 1deg 10min W and 1deg 15min E of Oslo (9deg 33min 22.5sec E and 11deg 58min 22.5sec E of Greenwich).","9807","58.0","0.0","","","1.0","0.0","0.0","9001","9110","8913","","","","","1999-10-20 00:00:00","J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1017[] = {"18224","NGO zone IV","","","","Norway - between 1deg 15min E and 4deg 20min E of Oslo (11deg 58min 22.5sec E and 15deg 03min 22.5sec E of Greenwich).","9807","58.0","2.3","","","1.0","0.0","0.0","9001","9110","8913","","","","","1999-10-20 00:00:00","J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1018[] = {"18225","NGO zone V","","","","Norway - between 4deg 20min E and 8deg 10min E of Oslo (15deg 03min 22.5sec E and 18deg 53min 22.5sec E of Greenwich).","9807","58.0","6.1","","","1.0","0.0","0.0","9001","9110","8913","","","","","1999-10-20 00:00:00","J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1019[] = {"18226","NGO zone VI","","","","Norway - between 8deg 10min E and 12deg 10min E of Oslo (18deg 53min 22.5sec E and 22deg 53min 22.5sec E of Greenwich).","9807","58.0","10.1","","","1.0","0.0","0.0","9001","9110","8913","","","","","1999-10-20 00:00:00","J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1020[] = {"18227","NGO zone VII","","","","Norway - between 12deg 10min E and 16deg 15min E of Oslo (22deg 53min 22.5sec E and 26deg 58min 22.5sec E of Greenwich).","9807","58.0","14.1","","","1.0","0.0","0.0","9001","9110","8913","","","","","1999-10-20 00:00:00","J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1021[] = {"18228","NGO zone VIII","","","","Norway - east of 16deg 15min E of Oslo (26deg 58min 22.5sec E of Greenwich).","9807","58.0","18.2","","","1.0","0.0","0.0","9001","9110","8913","","","","","1999-10-20 00:00:00","J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1022[] = {"18231","India zone I (1975 metres)","India zone I","","","India north of 28 deg North.","9801","32.3","68.0","","","0.99878641","2743185.69","914395.23","9001","9110","8901","","","","","1999-10-20 00:00:00","","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1023[] = {"18232","India zone IIa (1975 metres)","India zone II a","","","India - between 21 deg and 28 deg North and  west of 82 deg East.","9801","26.0","74.0","","","0.99878641","2743185.69","914395.23","9001","9102","8901","","","","","1999-10-20 00:00:00","","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1024[] = {"18233","India zone IIIa (1975 metres)","India zone IIIa","","","India - between 15 deg and 21 deg North.","9801","19.0","80.0","","","0.99878641","2743185.69","914395.23","9001","9102","8901","","","","","1999-10-20 00:00:00","","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1025[] = {"18234","India zone IVa (1975 metres)","India zone IV a","","","India - south of 15 deg North.","9801","12.0","80.0","","","0.99878641","2743185.69","914395.23","9001","9102","8901","","","","","1999-10-20 00:00:00","","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1026[] = {"18235","India zone IIb (1975 metres)","India zone II b","","","India - north of 21 deg North and east of 82 deg East.","9801","26.0","90.0","","","0.99878641","2743185.69","914395.23","9001","9102","8901","","","","","1999-10-20 00:00:00","","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1027[] = {"18236","India zone I (1962 metres)","India zone I","","","Pakistan - north of 28 deg North.","9801","32.3","68.0","","","0.99878641","2743196.4","914398.8","9001","9110","8901","","","","","1999-10-20 00:00:00","","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1028[] = {"18237","India zone IIa (1962 metres)","India zone II a","","","Pakistan - south of 28 deg North.","9801","26.0","74.0","","","0.99878641","2743196.4","914398.8","9001","9102","8901","","","","","1999-10-20 00:00:00","","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1029[] = {"18238","India zone IIb (1937 metres)","India zone II b","","","Bangladesh.","9801","26.0","90.0","","","0.99878641","2743195.5","914398.5","9001","9102","8901","","","","","1999-10-20 00:00:00","US Army Map Service projection tables; 1943.","EPSG","BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1030[] = {"19900","Bahrain State Grid","Bahrain Grid","","","Bahrain.","9807","0.0","51.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_1031[] = {"19901","Belge Lambert 50","","","","Belgium - onshore.","9802","90.0","0.0","49.5","51.1","","150000.0","5400000.0","9001","9110","8910","","","","","1999-04-22 00:00:00","\"Systemes de reference et formules de transformation en usage en Belgique\"; IGN Brussels","EPSG","","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_1032[] = {"19902","Belge Lambert 72","","","","Belgium - onshore.","9803","90.0","4.2124983","49.5","51.1","","150000.01256","5400088.4378","9001","9110","8901","","","","","1999-04-22 00:00:00","\"Systemes de reference et formules de transformation en usage en Belgique\"; IGN Brussels","EPSG","Rotation from Belge Lambert 50 to Belge Lambert 72 is +29.2985sec.","95.30  96.29  99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_1033[] = {"19903","Nord de Guerre","","","","France - Alsace.","9801","55.0","6.0","","","0.99950908","500000.0","300000.0","9001","9105","8903","","","","","1996-09-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1034[] = {"19904","Ghana Metre Grid","","","","Ghana.","9807","4.4","-1.0","","","0.99975","274319.51","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_1035[] = {"19905","Netherlands East Indies Equatorial Zone","NEIEZ","","","Indonesia.","9804","0.0","110.0","","","0.997","3900000.0","900000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","US Army Map Service projection tables; 1943.","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_1036[] = {"19906","Iraq zone","","","","Iran -south of 36 deg North; Iraq;  Kuwait.","9801","32.3","45.0","","","0.99878640776699","1500000.0","1166200.0","9001","9110","8901","","","","","1996-04-12 00:00:00","US Army Map Service projection tables; 1943.","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_1037[] = {"19907","Iraq National Grid","","","","Iraq.","9807","29.0134566","46.3","","","0.9994","800000.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_1038[] = {"19908","Irish National Grid","","","","Ireland - onshore.  United Kingdom (UK) - Northern Ireland onshore.","9807","53.3","-8.0","","","1.000035","200000.0","250000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_1039[] = {"19909","Jamaica (Old Grid)","","","","Jamaica.","9801","18.0","-77.0","","","1.0","550000.0","400000.0","9005","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Superseded by Jamaica (New Grid).","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_1040[] = {"19910","Jamaica National Grid","","","","Jamaica.","9801","18.0","-77.0","","","1.0","250000.0","150000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","Supersedes Jamaica (Old Grid).","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_1041[] = {"19911","Laborde Grid","","","","Madagascar.","9815","-21.0","49.0","21.0","21.0","0.9995","400000.0","800000.0","9001","9105","8903","","","","","1997-11-13 00:00:00","","EPSG","Can also use transformation method 9813.","97.613",NULL};
+datafile_rows_t trf_nonpolynomial_row_1042[] = {"19912","Rectified Skew Orthomorphic Borneo Grid","R.S.O. Borneo","","","Brunei;  Malaysia - East Malaysia (Sabah; Sarawak).","9812","4.0","115.0","53.18569537","53.07483685","0.99984","0.0","0.0","9042","9110","8901","","","","","1999-10-20 00:00:00","","EPSG","","95.30  96.29  97.231",NULL};
+datafile_rows_t trf_nonpolynomial_row_1043[] = {"19913","RD Old","","","","Netherlands - onshore.","9809","52.0922178","5.23155","","","0.9999079","0.0","0.0","9001","9110","8901","","","","","1995-12-02 00:00:00","Nederlandse Commissie voor Geodesie publication 30.","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_1044[] = {"19914","RD New","","","","Netherlands - onshore.","9809","52.0922178","5.23155","","","0.9999079","155000.0","463000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","Nederlandse Commissie voor Geodesie publication 30.","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_1045[] = {"19915","Aden Zone","","","","Yemen.","9801","15.0","45.0","","","0.999365678","1500000.0","1000000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","US Army Map Service projection tables; 1943.","EPSG","","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_1046[] = {"19916","British National Grid","","","","United Kingdom (UK) - onshore England; Scotland; Wales; Isle of Man.","9807","49.0","-2.0","","","0.999601272","400000.0","-100000.0","9001","9102","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30",NULL};
+datafile_rows_t trf_nonpolynomial_row_1047[] = {"19917","New Zealand Map Grid","","","","New Zealand.","9811","-41.0","173.0","","","","2510000.0","6023150.0","9001","9102","8901","","","","","1995-12-02 00:00:00","Dept. of Lands and Surveys Technical Circular 1973/32; 23 Nov 1973.","EPSG","Supersedes North and South Island National Grids.","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_1048[] = {"19919","Qatar National Grid","","","","Qatar.","9807","24.27","51.13","","","0.99999","200000.0","300000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_1049[] = {"19920","Singapore Grid","","","","Singapore.","9806","1.1715528","103.5110808","","","","30000.0","30000.0","9001","9110","8901","","","","","1995-12-02 00:00:00","","EPSG","","95.30  96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_1050[] = {"19921","Spain","","","","Spain.","9801","40.0","0.0","","","0.9988085293","600000.0","600000.0","9001","9102","8905","","","","","1995-12-02 00:00:00","","EPSG","Superseded by UTM","95.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_1051[] = {"19922","Swiss New Grid","LV03","","","Liechtenstein;  Switzerland.","9815","46.570866","7.26225","90.0","90.0","1.0","600000.0","200000.0","9001","9110","8901","","","","","1997-11-13 00:00:00","\"Die Projektionen der schweizerischen Plan- und Kartenwerke\"; J. Bolliger 1967","EPSG","","95.30  96.29  97.27  97.612  97.62",NULL};
+datafile_rows_t trf_nonpolynomial_row_1052[] = {"19923","Swiss Old Grid","LV03C","","","Liechtenstein;  Switzerland.","9815","46.570866","0.0","90.0","90.0","1.0","0.0","0.0","9001","9110","8907","","","","","1997-11-13 00:00:00","\"Die Projektionen der schweizerischen Plan- und Kartenwerke\"; J. Bolliger 1967","EPSG","Superseded by LV03 (19922).","95.30  96.29  97.612  97.62",NULL};
+datafile_rows_t trf_nonpolynomial_row_1053[] = {"19924","Tobago Grid","","","","Trinidad and Tobago - Tobago.","9806","11.1507843","-60.4109632","","","","187500.0","180000.0","9039","9110","8901","","","","","1999-10-20 00:00:00","","EPSG","","95.30  96.29  97.231",NULL};
+datafile_rows_t trf_nonpolynomial_row_1054[] = {"19925","Trinidad Grid","","","","Trinidad and Tobago - Trinidad.","9806","10.263","-61.2","","","","430000.0","325000.0","9039","9110","8901","","","","","1999-10-20 00:00:00","","EPSG","","95.30  96.29  97.231",NULL};
+datafile_rows_t trf_nonpolynomial_row_1055[] = {"19926","Stereo 70","","","","Romania.","9809","46.0","25.0","","","0.99975","500000.0","500000.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","Supersedes Stereo 33 (code 19927).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1056[] = {"19927","Stereo 33","","","","Romania.","9809","45.54","25.23328772","","","0.9996667","500000.0","500000.0","9001","9110","8901","","","","","1996-04-12 00:00:00","","EPSG","Superseded by Stereo 70 (code 19926)","96.29",NULL};
+datafile_rows_t trf_nonpolynomial_row_1057[] = {"19928","Kuwait TM","KTM","","","Kuwait - Kuwait City.","9807","0.0","48.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1996-04-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1058[] = {"19929","Swedish National Projection","2.5 gon West","","","Sweden.","9807","0.0","15.48298","","","1.0","1500000.0","0.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Lantmateriet of Sweden; private communication.","EPSG","Used since 1938 superseding 6 old zones.  Longitude of natural origin is 2.5 gon west of Stockholm prime meridian; transformation is also known as \"2.5 gon West of old Stockholm observatory\".","96.29  97.39" [...]
+datafile_rows_t trf_nonpolynomial_row_1059[] = {"19930","Greek Grid","","","","Greece","9807","0.0","24.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1997-06-16 00:00:00","Geodesy Department; Public Petroleum Corporation of Greece.","EPSG","Created for use with GGRS87.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1060[] = {"19931","Egyseges Orszagos Vetuleti","EOV","","","Hungary","9815","47.08398174","19.02548584","90.0","90.0","0.99993","650000.0","200000.0","9001","9110","8901","","","","","1997-07-22 00:00:00","http://lazarus.elte.hu/gb/geodez/geod2.htm","EPSG","EOV = Uniform National Projection","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1061[] = {"19933","Prince Edward Island Stereographic","PEI Stereographic","","","Canada - Prince Edward Island","9809","47.15","-63.0","","","0.999912","700000.0","400000.0","9001","9110","8901","","","","","1997-11-13 00:00:00","Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.","EPSG","In use from 1979.  To be phased out in late 1990's.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1062[] = {"19934","Lithuania 1994","","","","Lithuania","9807","0.0","24.0","","","0.9998","500000.0","0.0","9001","9102","8901","","","","","1998-03-12 00:00:00","HNIT-BALTIC GeoInfoServisas","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1063[] = {"19935","Rectified Skew Orthomorphic Malaya Grid","R.S.O. Malaya","","","Malaysia - West Malaysia","9812","4.0","102.15","323.01328458","323.07483685","0.99984","40000.0","0.0","9062","9110","8901","","","","","1999-10-20 00:00:00","UK Directorate of Overseas Surveys paper","EPSG","","97.231",NULL};
+datafile_rows_t trf_nonpolynomial_row_1064[] = {"19936","Portuguese National Grid","","","","Portugal onshore.","9807","39.4","1.0","","","1.0","200000.0","300000.0","9001","9110","8902","","","","","1998-11-11 00:00:00","","EPSG","Original transformation by Gauss-Kruger formula.","95.30  96.29  98.42",NULL};
+datafile_rows_t trf_nonpolynomial_row_1065[] = {"19937","Tunisia Mining Grid","","","","Tunisia - onshore","9816","38.81973","7.83445","","","","270.0","582.0","9036","9105","8903","","","","","1999-11-15 00:00:00","Mining decree of 1st January 1953","EPSG","Origin: Djebel Kebar","99.81",NULL};
+datafile_rows_t trf_nonpolynomial_row_1066[] = {"19938","Estonian National Grid","","","","Estonia","9802","57.310319415","24.0","59.2","58.0","","500000.0","6375000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","http://www.geo.ut.ee/~raivo/estcoord.html","EPSG","Coordinates at the projection origin match those of TM Baltic 93.","99.28",NULL};
+datafile_rows_t trf_nonpolynomial_row_1067[] = {"19939","TM Baltic 93","","","","Estonia; Latvia; Lithuania.","9807","0.0","24.0","","","0.9996","500000.0","0.0","9001","9102","8901","","","","","1998-12-14 00:00:00","http://www.geo.ut.ee/~raivo/estcoord.html","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1068[] = {"19940","Levant Zone","","","","Syrian Arab Republic west of 39 deg E.","9817","34.39","37.21","","","0.9996256","300000.0","300000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","US Army Map Service projection tables; 1943.","EPSG","Superseded by projection using full Lambert formula from 1973. (EPSG code 19948).","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1069[] = {"19941","Brazil Polyconic","","","","Brazil","9818","0.0","-54.0","","","","5000000.0","10000000.0","9001","9102","8901","","","","","1999-10-20 00:00:00","PetroBras","EPSG","","99.55",NULL};
+datafile_rows_t trf_nonpolynomial_row_1070[] = {"19942","British West Indies Grid","","","","Windward Islands - Dominica  Grenada  Saint Lucia  Saint Vincent;  Leeward Islands - Anguilla   Antigua (excluding Barbuda)  Montserrat   Saint Kitts and Nevis; Barbados.","9807","0.0","-62.0","","","0.9995","400000.0","0.0","9001","9102","8901","","","","","1999-04-22 00:00:00","UK Royal Engineers projection tables P10/25, 1943.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1071[] = {"19943","Barbados National Grid","","","","Barbados","9807","13.1035","-59.3335","","","0.9999986","30000.0","75000.0","9001","9110","8901","","","","","1999-04-22 00:00:00","Ordnance Survey of Great Britain","EPSG","Superseded British West Indies Grid (19942) after 1983.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1072[] = {"19944","Quebec Lambert Projection","","","","Canada - Quebec","9802","44.0","-68.3","60.0","46.0","","0.0","0.0","9001","9110","8901","","","","","1999-10-22 00:00:00","Service de la Cartographie; Minist�re des Ressources Naturelles; Quebec","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1073[] = {"19945","New Brunswick Stereographic (ATS77)","NB Stereographic ATS77","","","Canada - New Brunswick - onshore","9809","46.3","-66.3","","","0.999912","300000.0","800000.0","9001","9110","8901","","","","","1999-10-20 00:00:00","New Brunswick Geographic Information Corporation land and water information standards manual.","EPSG","In use from 1979.  To be phased out in late 1990's.","99.61",NULL};
+datafile_rows_t trf_nonpolynomial_row_1074[] = {"19946","New Brunswick Stereographic (NAD83)","NB Stereographic NAD83","","","Canada - New Brunswick - onshore","9809","46.3","-66.3","","","0.999912","2500000.0","7500000.0","9001","9110","8901","","","","","1999-10-20 00:00:00","New Brunswick Geographic Information Corporation land and water information standards manual.","EPSG","In use from 1999.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1075[] = {"19947","Austria Lambert","","","","Austria","9802","13.2","47.3","49.0","46.0","","400000.0","400000.0","9001","9110","8901","","","","","1999-10-20 00:00:00","Bundesamt f�r Eich- und Vermessungswesen","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1076[] = {"19948","Syria Lambert","","","","Syrian Arab Republic","9801","34.39","37.21","","","0.9996256","300000.0","300000.0","9001","9110","8901","","","","","1999-10-20 00:00:00","IGN Paris","EPSG","Superseded Levant zone (same parameters but using truncated near-conformal method) from 1973.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1077[] = {"19949","Levant Stereographic","","","","Lebanon","9809","38.0","43.5","","","0.9995341","0.0","0.0","9001","9105","8901","","","","","1999-10-20 00:00:00","IGN Paris","EPSG","Used prior to World War II for cadastral and large scale topographic mapping.","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1078[] = {"19950","Landesvermessung 1995","LV95","","","Liechtenstein;  Switzerland.","9815","46.570866","7.26225","90.0","90.0","1.0","2600000.0","1200000.0","9001","9110","8901","","","","","1999-10-20 00:00:00","Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.","EPSG","","",NULL};
+datafile_rows_t trf_nonpolynomial_row_1079[] = {"19951","Nakhl e Taqi Oblique Mercator","Nakhl e Taqi","","","Iran - Taheri refinery site only.","9815","27.31077837","52.3612741","0.34179803","0.34179803","0.999895934","658377.437","3044969.194","9001","9110","8901","","","","","1999-10-20 00:00:00","Total-Fina","EPSG","Used only for terminal site.","",NULL};
+
+datafile_rows_t *trf_nonpolynomial_rows[] = {trf_nonpolynomial_row_1,trf_nonpolynomial_row_2,trf_nonpolynomial_row_3,trf_nonpolynomial_row_4,trf_nonpolynomial_row_5,trf_nonpolynomial_row_6,trf_nonpolynomial_row_7,trf_nonpolynomial_row_8,trf_nonpolynomial_row_9,trf_nonpolynomial_row_10,trf_nonpolynomial_row_11,trf_nonpolynomial_row_12,trf_nonpolynomial_row_13,trf_nonpolynomial_row_14,trf_nonpolynomial_row_15,trf_nonpolynomial_row_16,trf_nonpolynomial_row_17,trf_nonpolynomial_row_18,trf_no [...]
diff --git a/src/tiff/csv/trf_nonpolynomial.csv b/src/tiff/csv/trf_nonpolynomial.csv
new file mode 100644
index 0000000..53123a9
--- /dev/null
+++ b/src/tiff/csv/trf_nonpolynomial.csv
@@ -0,0 +1,1079 @@
+"COORD_TRF_CODE","COORD_TRF_EPSG_NAME","COORD_TRF_EPSG_ABBR","COORD_TRF_USER_NAME","DESCRIPTION","AREA_OF_USE","COORD_TRF_METHOD_CODE","PARAMETER_1","PARAMETER_2","PARAMETER_3","PARAMETER_4","PARAMETER_5","PARAMETER_6","PARAMETER_7","UOM_LENGTH_CODE","UOM_ANGLE_CODE","PRIME_MERIDIAN_CODE","UOM_SCALE_CODE","PARAMETER_35","PARAMETER_36","PARAMETER_37","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+1100,Adindan to WGS 84 (1),,,,MEAN FOR Ethiopia; Sudan.,9603,-166.0,-15.0,204.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1101,Adindan to WGS 84 (2),,,,Burkina Faso.,9603,-118.0,-14.0,218.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1102,Adindan to WGS 84 (3),,,,Cameroon.,9603,-134.0,-2.0,210.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1103,Adindan to WGS 84 (4),,,,Ethiopia.,9603,-165.0,-11.0,206.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1104,Adindan to WGS 84 (5),,,,Mali.,9603,-123.0,-20.0,220.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1105,Adindan to WGS 84 (6),,,,Senegal.,9603,-128.0,-18.0,224.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1106,Adindan to WGS 84 (7),,,,Sudan.,9603,-161.0,-14.0,205.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1107,Afgooye to WGS 84 (1),,,,Somalia.,9603,-43.0,-163.0,45.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1108,AGD66 to WGS 84 (1),,,,Australia.,9603,-133.0,-48.0,148.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1109,AGD84 to WGS 84 (1),,,,Australia.,9603,-134.0,-48.0,149.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1110,Ain el Abd to WGS 84 (1),,,,Bahrain.,9603,-150.0,-250.0,-1.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,97.06
+1111,Ain el Abd to WGS 84 (2),,,,Saudi Arabia.,9603,-143.0,-236.0,7.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1112,Amersfoort to WGS 84 (1),,,,Netherlands.,9606,593.16,26.15,478.54,-6.3239,-0.5008,-5.5487,4.0775,9001,9109,,9202,,,,1997-04-11 00:00:00,Nederlandse Commissie voor Geodesie publication 30; 1993.,EPSG,,97.07
+1113,Arc 1950 to WGS 84 (1),,,,MEAN FOR Botswana; Lesotho; Malawi; Swaziland; Zaire; Zambia; Zimbabwe.,9603,-143.0,-90.0,-294.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1114,Arc 1950 to WGS 84 (2),,,,Botswana.,9603,-138.0,-105.0,-289.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1115,Arc 1950 to WGS 84 (3),,,,Burundi.,9603,-153.0,-5.0,-292.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1116,Arc 1950 to WGS 84 (4),,,,Lesotho.,9603,-125.0,-108.0,-295.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1117,Arc 1950 to WGS 84 (5),,,,Malawi.,9603,-161.0,-73.0,-317.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1118,Arc 1950 to WGS 84 (6),,,,Swaziland.,9603,-134.0,-105.0,-295.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1119,Arc 1950 to WGS 84 (7),,,,Zaire.,9603,-169.0,-19.0,-278.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1120,Arc 1950 to WGS 84 (8),,,,Zambia.,9603,-147.0,-74.0,-283.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1121,Arc 1950 to WGS 84 (9),,,,Zimbabwe.,9603,-142.0,-96.0,-293.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1122,Arc 1960 to WGS 84 (1),,,,MEAN FOR Kenya; Tanzania.,9603,-160.0,-6.0,-302.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1123,Batavia to WGS 84 (1),,,,Indonesia (Sumatra).,9603,-377.0,681.0,-50.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1124,Bermuda 1957 to WGS 84 (1),,,,Bermuda.,9603,-73.0,213.0,296.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1125,Bogota to WGS 84 (1),,,,Colombia.,9603,307.0,304.0,-318.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1126,Bukit Rimpah to WGS 84 (1),,,,Indonesia (Bangka & Belitung Islands).,9603,-384.0,664.0,-48.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1127,Campo Inchauspe to WGS 84 (1),,,,Argentina.,9603,-148.0,136.0,90.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1128,Cape to WGS 84 (1),,,,South Africa.,9603,-136.0,-108.0,-292.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1129,Cape to WGS 84 (2),,,,South Africa.,9603,-134.73,-110.92,-292.66,,,,,9001,,,,,,,1996-10-18 00:00:00,"Private Communication, Directorate of Surveys and Land Information, Cape Town.",EPSG,,
+1130,Carthage to WGS 84 (1),,,,Tunisia.,9603,-263.0,6.0,431.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1131,Chua to WGS 84 (1),,,,Paraguay.,9603,-134.0,229.0,-29.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1132,Corrego Alegre to WGS 84 (1),,,,Brazil.,9603,-206.0,172.0,-6.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1133,ED50 to WGS 84 (1),,,,MEAN FOR Austria; Belgium; Denmark; Finland;  France; Germany (west); Gibraltar; Greece;  Italy; Luxembourg; Netherlands; Norway;  Portugal; Spain; Sweden; Switzerland.,9603,-87.0,-98.0,-121.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,97.02
+1134,ED50 to WGS 84 (2),,,,MEAN FOR Austria; Denmark; France; Germany (west); Netherlands; Switzerland.,9603,-87.0,-96.0,-120.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1135,ED50 to WGS 84 (3),,,,MEAN FOR Iraq; Israel; Jordan; Lebanon;  Kuwait; Saudi Arabia; Syria.,9603,-103.0,-106.0,-141.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1136,ED50 to WGS 84 (4),,,,Cyprus.,9603,-104.0,-101.0,-140.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1137,ED50 to WGS 84 (5),,,,Egypt.,9603,-130.0,-117.0,-151.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1138,ED50 to WGS 84 (6),,,,Ireland; United Kingdom (UK).,9603,-86.0,-96.0,-120.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1139,ED50 to WGS 84 (7),,,,Finland; Norway.,9603,-87.0,-95.0,-120.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1140,ED50 to WGS 84 (8),,,,Greece.,9603,-84.0,-95.0,-130.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1141,ED50 to WGS 84 (9),,,,Iran.,9603,-117.0,-132.0,-164.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1142,ED50 to WGS 84 (10),,,,Italy (Sardinia).,9603,-97.0,-103.0,-120.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1143,ED50 to WGS 84 (11),,,,Italy (Sicily).,9603,-97.0,-88.0,-135.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1144,ED50 to WGS 84 (12),,,,Malta.,9603,-107.0,-88.0,-149.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1145,ED50 to WGS 84 (13),,,,Portugal; Spain.,9603,-84.0,-107.0,-120.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1146,ED87 to WGS 84 (1),,,,Denmark - North Sea;  Germany - North Sea;  Netherlands - offshore;  Norway; United Kingdom (UKCS) - North Sea south of 62 deg N.,9606,-82.981,-99.719,-110.709,-0.5076,0.1503,0.3898,-0.3143,9001,9109,,9202,,,,1997-04-11 00:00:00,"Norwegian Mapping Authority publication 1990:1 and note of 13-Feb-1991 \"Om Transformasjon mellom Geodetiske Datum i Norge\"",EPSG,,97.03  97.04
+1147,ED50 to ED87 (2),,,,Norway - offshore north of 65 deg N.,9606,-1.51,-0.84,-3.5,-1.893,-0.687,-2.764,0.609,9001,9109,,9202,,,,1997-04-11 00:00:00,"Norwegian Mapping Authority note of 13-Feb-1991 \"Om Transformasjon mellom Geodetiske Datum i Norge\"",EPSG,,97.04
+1148,Egypt 1907 to WGS 84 (1),,,,Egypt.,9603,-130.0,110.0,-13.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1149,ETRF89 to WGS 84 (1),,,,Europe.,9603,0.0,0.0,0.0,,,,,9001,,,,,,,1997-06-16 00:00:00,EPSG,EPSG,ETRF89 is a realisation of WGS84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.,97.24
+1150,GDA94 to WGS 84 (1),,,,Australia.,9603,0.0,0.0,0.0,,,,,9001,,,,,,,1996-10-18 00:00:00,EPSG,EPSG,GDA94 is a realisation of WGS84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.,
+1151,GD49 to WGS 84 (1),,,,New Zealand.,9603,84.0,-22.0,209.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1152,Hu Tzu Shan to WGS 84 (1),,,,Taiwan.,9603,-637.0,-549.0,-203.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1153,Indian 1954 to WGS 84 (1),,,,Thailand.,9603,217.0,823.0,299.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,97.06
+1154,Indian 1975 to WGS 84 (1),,,,Thailand.,9603,209.0,818.0,290.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 second edition September 1991,EPSG,,
+1155,Kalianpur 1937 to WGS 84 (1),,,,Bangladesh.,9603,282.0,726.0,254.0,,,,,9001,,,,,,,1999-10-20 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,97.235
+1156,Kalianpur 1975 to WGS 84 (1),,,,India; Nepal.,9603,295.0,736.0,257.0,,,,,9001,,,,,,,1999-10-20 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,Care!  DMA ellipsoid is inconsistent with EPSG ellipsoid - transformation parameter values may not be appropriate.,97.235
+1157,Kandawala to WGS 84 (1),,,,Sri Lanka.,9603,-97.0,787.0,86.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1158,Kertau to WGS 84 (1),,,,Malaysia - West Malaysia; Singapore.,9603,-11.0,851.0,5.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1159,Leigon to WGS 84 (1),,,,Ghana.,9603,-130.0,29.0,364.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1160,Liberia 1964 to WGS 84 (1),,,,Liberia.,9603,-90.0,40.0,88.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1161,Luzon 1911 to WGS 84 (1),,,,Philippines (excluding Mindanao).,9603,-133.0,-77.0,-51.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1162,Luzon 1911 to WGS 84 (2),,,,Philippines (Mindanao).,9603,-133.0,-79.0,-72.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1163,M'poraloko to WGS 84 (1),,,,Gabon.,9603,-74.0,-130.0,42.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1164,Mahe 1971 to WGS 84 (1),,,,Seychelles - Mahe Island.,9603,41.0,-220.0,-134.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1165,Massawa to WGS 84 (1),,,,Ethiopia (Eritrea).,9603,639.0,405.0,60.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1166,Merchich to WGS 84 (1),,,,Morocco.,9603,31.0,146.0,47.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1167,Minna to WGS 84 (1),,,,Cameroon.,9603,-81.0,-84.0,115.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1168,Minna to WGS 84 (2),,,,Nigeria.,9603,-92.0,-93.0,122.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1169,Monte Mario to WGS 84 (1),,,,Italy (Sardinia).,9603,-225.0,-65.0,9.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1170,NAD27 to WGS 84 (1),,,,MEAN FOR Antigua; Barbados; Barbuda;  Caicos Islands; Cuba; Dominican Republic;  Grand Cayman; Jamaica; Turks Islands.,9603,-3.0,142.0,183.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1171,NAD27 to WGS 84 (2),,,,MEAN FOR Belize; Costa Rica; El Salvador;  Guatemala; Honduras; Nicaragua.,9603,0.0,125.0,194.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1172,NAD27 to WGS 84 (3),,,,MEAN FOR Canada.,9603,-10.0,158.0,187.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1173,NAD27 to WGS 84 (4),,,,MEAN FOR United States (USA) (CONUS).,9603,-8.0,160.0,176.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1174,NAD27 to WGS 84 (5),,,,MEAN FOR United States (USA) (CONUS East of Mississippi River  including Louisiana; Missouri; Minnesota).,9603,-9.0,161.0,179.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1175,NAD27 to WGS 84 (6),,,,MEAN FOR United States (USA) (CONUS West of Mississippi River).,9603,-8.0,159.0,175.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1176,NAD27 to WGS 84 (7),,,,United States (USA) - Alaska (Excluding Aleutian Islands).,9603,-5.0,135.0,172.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1177,NAD27 to WGS 84 (8),,,,Bahamas (Except San Salvador Island).,9603,-4.0,154.0,178.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1178,NAD27 to WGS 84 (9),,,,Bahamas (San Salvador Island).,9603,1.0,140.0,165.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1179,NAD27 to WGS 84 (10),,,,Canada (Alberta; British Columbia).,9603,-7.0,162.0,188.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1180,NAD27 to WGS 84 (11),,,,Canada (Manitoba; Ontario).,9603,-9.0,157.0,184.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1181,NAD27 to WGS 84 (12),,,,Canada (New Brunswick; Newfoundland; Nova Scotia; Quebec).,9603,-22.0,160.0,190.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1182,NAD27 to WGS 84 (13),,,,Canada (Northwest Territories; Nunavut; Saskatchewan).,9603,4.0,159.0,188.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1183,NAD27 to WGS 84 (14),,,,Canada (Yukon).,9603,-7.0,139.0,181.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1184,NAD27 to WGS 84 (15),,,,Panama - Canal Zone.,9603,0.0,125.0,201.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1185,NAD27 to WGS 84 (16),,,,Cuba.,9603,-9.0,152.0,178.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1186,NAD27 to WGS 84 (17),,,,Greenland (Hayes Peninsula).,9603,11.0,114.0,195.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1187,NAD27 to WGS 84 (18),,,,Mexico.,9603,-12.0,130.0,190.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1188,NAD83 to WGS 84 (1),,,,Canada; Central America; Mexico; United States (USA) (Alaska (excluding Aleutian Islands); CONUS).,9603,0.0,0.0,0.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,NAD83 is a realisation of WGS84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.,97.06
+1189,Nahrwan 1967 to WGS 84 (1),,,,Oman (Masirah Island).,9603,-247.0,-148.0,369.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1190,Nahrwan 1967 to WGS 84 (2),,,,Saudi Arabia.,9603,-243.0,-192.0,477.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1191,Nahrwan 1967 to WGS 84 (3),,,,United Arab Emirates (UAE).,9603,-249.0,-156.0,381.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1192,Naparima 1972 to WGS 84 (1),,,,Trinidad and Tobago.,9603,-10.0,375.0,165.0,,,,,9001,,,,,,,1998-06-30 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,CAUTION: EPSG believes that these parameter values include a blunder and that if NIMA transformation parameters are to be used the 1987 version (EPSG code 1307) be used.,98.102
+1193,NTF to WGS 84 (1),,,,France.,9603,-168.0,-60.0,320.0,,,,,9001,,,,,,,1996-10-18 00:00:00,IGN technical report RT/G 14; January 1988.,EPSG,,
+1195,OSGB 1936 to WGS 84 (1),,,,MEAN FOR United Kingdom (UK) - Great Britain (England; Scotland; Wales); Isle of Man.,9603,375.0,-111.0,431.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1196,OSGB 1936 to WGS 84 (2),,,,United Kingdom (UK) - England.,9603,371.0,-112.0,434.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1197,OSGB 1936 to WGS 84 (3),,,,United Kingdom (UK) - England; Wales; Isle of Man.,9603,371.0,-111.0,434.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1198,OSGB 1936 to WGS 84 (4),,,,United Kingdom (UK) - Scotland (including Shetland Islands).,9603,384.0,-111.0,425.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1199,OSGB 1936 to WGS 84 (5),,,,United Kingdom (UK) - Wales.,9603,370.0,-108.0,434.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1200,Pointe Noire to WGS 84 (1),,,,Congo.,9603,-148.0,51.0,-291.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1201,PSAD56 to WGS 84 (1),,,,MEAN FOR Bolivia; Chile; Colombia;  Ecuador; Guyana; Peru; Venezuela.,9603,-288.0,175.0,-376.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1202,PSAD56 to WGS 84 (2),,,,Bolivia.,9603,-270.0,188.0,-388.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1203,PSAD56 to WGS 84 (3),,,,Chile (Northern; near 19 deg S).,9603,-270.0,183.0,-390.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1204,PSAD56 to WGS 84 (4),,,,Chile (Southern; near 43 deg S).,9603,-305.0,243.0,-442.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1205,PSAD56 to WGS 84 (5),,,,Colombia.,9603,-282.0,169.0,-371.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1206,PSAD56 to WGS 84 (6),,,,Ecuador.,9603,-278.0,171.0,-367.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1207,PSAD56 to WGS 84 (7),,,,Guyana.,9603,-298.0,159.0,-369.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1208,PSAD56 to WGS 84 (8),,,,Peru.,9603,-279.0,175.0,-379.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1209,PSAD56 to WGS 84 (9),,,,Venezuela.,9603,-295.0,173.0,-371.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1210,Qatar to WGS 84 (1),,,,Qatar.,9603,-128.0,-283.0,22.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1211,Qornoq to WGS 84 (1),,,,Greenland (South).,9603,164.0,138.0,-189.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1212,SAD69 to WGS 84 (1),,,,MEAN FOR Argentina; Bolivia; Brazil; Chile;  Colombia; Ecuador; Guyana; Paraguay;  Peru; Trinidad & Tobago; Venezuela.,9603,-57.0,1.0,-41.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1213,SAD69 to WGS 84 (2),,,,Argentina.,9603,-62.0,-1.0,-37.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1214,SAD69 to WGS 84 (3),,,,Bolivia.,9603,-61.0,2.0,-48.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1215,SAD69 to WGS 84 (4),,,,Brazil.,9603,-60.0,-2.0,-41.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1216,SAD69 to WGS 84 (5),,,,Chile.,9603,-75.0,-1.0,-44.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1217,SAD69 to WGS 84 (6),,,,Colombia.,9603,-44.0,6.0,-36.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1218,SAD69 to WGS 84 (7),,,,Ecuador.,9603,-48.0,3.0,-44.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1219,SAD69 to WGS 84 (8),,,,Ecuador (Baltra; Galapagos).,9603,-47.0,26.0,-42.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1220,SAD69 to WGS 84 (9),,,,Guyana.,9603,-53.0,3.0,-47.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1221,SAD69 to WGS 84 (10),,,,Paraguay.,9603,-61.0,2.0,-33.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1222,SAD69 to WGS 84 (11),,,,Peru.,9603,-58.0,0.0,-44.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1223,SAD69 to WGS 84 (12),,,,Trinidad and Tobago.,9603,-45.0,12.0,-33.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1224,SAD69 to WGS 84 (13),,,,Venezuela.,9603,-45.0,8.0,-33.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1225,Sapper Hill 1943 to WGS 84 (1),,,,Falkland Islands - East Falkland Island.,9603,-355.0,21.0,72.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1226,Schwarzeck to WGS 84 (1),,,,Namibia.,9603,616.0,97.0,-251.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1227,Tananarive to WGS 84 (1),,,,Madagascar.,9603,-189.0,-242.0,-91.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1228,Timbalai 1948 to WGS 84 (1),,,,Brunei; Malaysia (Sabah; Sarawak).,9603,-679.0,669.0,-48.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1229,TM65 to WGS 84 (1),,,,Ireland.,9603,506.0,-122.0,611.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1230,Tokyo to WGS 84 (1),,,,MEAN FOR Japan; South Korea; Okinawa.,9603,-148.0,507.0,685.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,97.06
+1231,Tokyo to WGS 84 (2),,,,Japan.,9603,-148.0,507.0,685.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1232,Tokyo to WGS 84 (3),,,,South Korea.,9603,-146.0,507.0,687.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,97.06
+1233,Tokyo to WGS 84 (4),,,,Japan (Okinawa).,9603,-158.0,507.0,676.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1234,Yacare to WGS 84 (1),,,,Uruguay.,9603,-155.0,171.0,37.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1235,Zanderij to WGS 84 (1),,,,Suriname.,9603,-265.0,120.0,-358.0,,,,,9001,,,,,,,1996-10-18 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,,
+1236,AGD84 to WGS 84 (2),,,,Australia.,9607,-116.0,-50.47,141.69,-0.23,-0.39,-0.344,0.0983,9001,9104,,9202,,,,1997-11-13 00:00:00,Australian Surveying and Land Information Group - www.auslig.gov.au/geodesy,EPSG,Superseded by AGD84 to GDA94 (2) (code 1280).,
+1237,WGS 72 to WGS 84 (1),,,,World.,9606,0.0,0.0,4.5,0.0,0.0,0.554,0.2263,9001,9104,,9202,,,,1996-12-12 00:00:00,,EPSG,,
+1238,WGS 72 to WGS 84 (2),,,,World.,9606,0.0,0.0,4.5,0.0,0.0,0.554,0.219,9001,9104,,9202,,,,1996-12-12 00:00:00,,EPSG,,
+1239,WGS 72BE to WGS 72 (1),,,,World.,9606,0.0,0.0,-2.6,0.0,0.0,0.26,-0.6063,9001,9104,,9202,,,,1996-12-12 00:00:00,,EPSG,,
+1240,WGS 72BE to WGS 84 (1),,,,World.,9606,0.0,0.0,1.9,0.0,0.0,0.814,-0.38,9001,9104,,9202,,,,1996-12-12 00:00:00,,EPSG,,
+1241,NAD27 to NAD83 (1),,,,United States (USA) - lower 48 states including EEZ.,9613,,,,,,,,,9104,,,conus.las,conus.los,,1999-04-22 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.,98.201  98.53
+1243,NAD27 to NAD83 (2),,,,United States (USA) - Alaska including EEZ.,9613,,,,,,,,,9104,,,alaska.las,alaska.los,,1999-04-22 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.,98.201  98.53
+1245,ED50 to WGS 84 (16),,,,Tunisia.,9603,-112.0,-77.0,-145.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,98.11
+1246,Herat North to WGS 84 (1),,,,Afghanistan.,9603,-333.0,-222.0,114.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1247,Kalianpur 1962 to WGS 84 (1),,,,Pakistan.,9603,283.0,682.0,231.0,,,,,9001,,,,,,,1999-10-20 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,Care!  DMA ellipsoid is inconsistent with EPSG ellipsoid - transformation parameter values may not be appropriate.,97.235
+1248,ID74 to WGS 84 (1),,,,Indonesia.,9603,-24.0,-15.0,5.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1249,NAD27 to WGS 84 (21),,,,United States (USA) - Alaska - Aleutian Islands east of 180 deg.,9603,-2.0,152.0,149.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1250,NAD27 to WGS 84 (22),,,,United States (USA) - Alaska - Aleutian Islands west of 180 deg.,9603,2.0,204.0,105.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1251,NAD83 to WGS 84 (2),,,,United States (USA) - Alaska - Aleutian Islands.,9603,-2.0,0.0,4.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1252,NAD83 to WGS 84 (3),,,,United States (USA) - Hawaii.,9603,1.0,1.0,-1.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1253,Nord Sahara 1959 to WGS 84 (1),,,,Algeria.,9603,-186.0,-93.0,310.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1254,Pulkovo 1942 to WGS 84 (1),,,,Russia.,9603,28.0,-130.0,-95.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1255,Voirol Unifie to WGS 84 (1),,,,Algeria - north of 35g (31 deg 30 min) North.,9603,-123.0,-206.0,219.0,,,,,9001,,,,,,,1998-06-30 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,CAUTION:   EPSG believes that the data used in the derivation of these parameters contains a blunder.  We recommend using transformation 1253 [North Sahara 1959 to WGS84 (1)] as Voirol 1960 geographical coordinates are the same as Nord Sahara 1959 geogs.,98.15
+1256,Fahud to WGS 84 (1),,,,Oman.,9603,-346.0,-1.0,224.0,,,,,9001,,,,,,,1997-04-11 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1257,Bern 1898 (Bern) to Bern 1898,,,,Liechtenstein;  Switzerland.,9601,7.26225,,,,,,,,9110,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1258,Bogota (Bogota) to Bogota,,,,Colombia.,9601,-74.04513,,,,,,,,9110,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1259,Lisbon (Lisbon) to Lisbon,,,,Portugal - onshore.,9601,-9.0754862,,,,,,,,9110,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1260,Makassar (Jakarta) to Makassar,,,,Indonesia - south west Sulawesi.,9601,106.482779,,,,,,,,9110,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1261,MGI (Ferro) to MGI,,,,Austria.,9601,-17.4,,,,,,,,9110,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1262,Monte Mario (Rome) to Monte Mario,,,,Italy.,9601,12.27084,,,,,,,,9110,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,98.37  99.79
+1263,Padang (Jakarta) to Padang,,,,Indonesia - Sumatra.,9601,106.482779,,,,,,,,9110,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1264,Belge 1950 (Brussels) to Belge 1950,,,,Belgium - onshore.,9601,4.220471,,,,,,,,9110,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1265,Tananarive (Paris) to Tananarive,,,,Madagascar.,9601,2.5969213,,,,,,,,9105,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1266,Voirol 1875 (Paris) to Voirol 1875,,,,Algeria - north of 32 deg N.,9601,2.5969213,,,,,,,,9105,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1267,Voirol Unifie (Paris) to Voirol Unifie,,,,Algeria - north of 32 deg N.,9601,2.5969213,,,,,,,,9105,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1268,Batavia (Jakarta) to Batavia,,,,Indonesia - Java.,9601,106.482779,,,,,,,,9110,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1269,RT38 (Stockholm) to RT38,,,,Sweden.,9601,18.03298,,,,,,,,9110,,,,,,1999-11-12 00:00:00,EPSG,EPSG,Change of prime meridian.,99.79
+1270,Greek (Athens) to Greek,,,,Greece - onshore.,9601,23.4258815,,,,,,,,9110,,,,,,1999-11-12 00:00:00,Topography Department; National Technical University of Athens.,EPSG,Change of prime meridian.,99.79
+1271,Schwarzeck to WGS 84 (2),,,,Namibia.,9603,615.64,102.08,-255.81,,,,,9001,,,,,,,1997-11-13 00:00:00,Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,Beware !   Schwarzeck CS uses German legal metres.  Example:  Schwarzeck Lat 19d 35m 46.952s S Long 20d 41m 50.649s E; X=5623409.40 Y=2124618.00 Z=-2125847.62 GLM; X=5623485.86 Y=2124646.89 Z=-2125876.53 m; WGS84 X=5624101.50 Y=2124748.97 Z=2126132.34 m.,97.48
+1272,GGRS87 to WGS 84 (1),,,,Greece.,9603,-199.87,74.79,246.62,,,,,9001,,,,,,,1997-06-16 00:00:00,Geodesy Department; Public Petroleum Corporation of Greece.,EPSG,,
+1273,HD72 to ETRF89 (1),,,,Hungary.,9607,-56.0,75.77,15.31,-0.37,-0.2,-0.21,-1.01,9001,9104,,9202,,,,1997-11-13 00:00:00,http://lazarus.elte.hu/gb/geodez/geod5.htm,EPSG,,97.47
+1274,Pulkovo 1942 to LKS94(ETRS89) (1),CS42 to LKS94 (1),,,Lithuania.,9607,-40.595,-18.55,-69.339,-2.508,-1.832,2.611,-4.299,9001,9104,,9202,,,,1998-03-12 00:00:00,HNIT-BALTIC GeoInfoServisas.,EPSG,,
+1275,ED50 to WGS 84 (17),,,,France.,9603,-84.0,-97.0,-117.0,,,,,9001,,,,,,,1998-04-16 00:00:00,IGN technical report 14 (January 1988).,EPSG,,98.11
+1276,NTF to ED50 (1),,,,France.,9603,-84.0,37.0,437.0,,,,,9001,,,,,,,1997-11-13 00:00:00,IGN technical report 7 (October 1981).,EPSG,,
+1277,NTF to WGS 72 (1),,,,France.,9603,-168.0,-72.0,314.0,,,,,9001,,,,,,,1997-11-13 00:00:00,IGN technical report 7 (October 1981).,EPSG,,
+1278,AGD66 to GDA94 (1),,,,Australia.,9603,-127.8,-52.3,152.9,,,,,9001,,,,,,,1997-11-13 00:00:00,http://www.anzlic.org.au/icsm/gdatm/molodens.htm,EPSG,5m accuracy.  Parameter values are given to greater precision but no better accuracy at http://www.dehaa.sa.gov.au/res_inform/sicom/where/geobas14.html,
+1279,AGD84 to GDA94 (1),,,,Australia.,9603,-128.5,-53.0,153.4,,,,,9001,,,,,,,1997-11-13 00:00:00,http://www.anzlic.org.au/icsm/gdatm/molodens.htm,EPSG,5m accuracy.  Parameter values are given to greater precision but no better accuracy at http://www.dehaa.sa.gov.au/res_inform/sicom/where/geobas14.html,
+1280,AGD84 to GDA94 (2),,,,Australia.,9607,-117.763,-51.51,139.061,-0.292,-0.443,-0.277,-0.191,9001,9104,,9202,,,,1997-11-13 00:00:00,http://www.anzlic.org.au/icsm/gdatm/simil.htm,EPSG,1m accuracy.  Supersedes AGD84 to WGS 84 (2) (code 1236).,
+1282,Samboja to WGS 84 (1),,,,Indonesia - east Kalimantan - Mahakam delta area.,9603,-404.78,-685.68,-45.47,,,,,9001,,,,,,,1997-11-13 00:00:00,Total Indonesia.,EPSG,Datum shift derived through ITRF93.,
+1283,LKS94(ETRS89) to WGS 84 (1),LKS94 to WGS 84 (1),,,Lithuania.,9603,0.0,0.0,0.0,,,,,9001,,,,,,,1998-03-12 00:00:00,HNIT-BALTIC GeoInfoServisas.,EPSG,LKS94 is a realisation of WGS84 coincident to within 1.5 metres.  This transformation has an accuracy equal to the coincidence figure.,98.13
+1284,Arc 1960 to WGS 84 (2),,,,Kenya.,9603,-157.0,-2.0,-299.0,,,,,9001,,,,,,,1998-03-12 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,
+1285,Arc 1960 to WGS 84 (3),,,,Tanzania.,9603,-175.0,-23.0,-303.0,,,,,9001,,,,,,,1998-03-12 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,
+1286,Segora to WGS 84 (1),,,,Indonesia - Kalimantan.,9603,-403.0,684.0,41.0,,,,,9001,,,,,,,1998-03-12 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,
+1287,Pulkovo 1942 to WGS 84 (3),,,,Hungary.,9603,28.0,-121.0,-77.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,98.11
+1288,Pulkovo 1942 to WGS 84 (4),,,,Poland.,9603,23.0,-124.0,-82.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,98.11
+1289,Pulkovo 1942 to WGS 84 (5),,,,Czech Republic.,9603,26.0,-121.0,-78.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,98.11
+1290,Pulkovo 1942 to WGS 84 (6),,,,Latvia.,9603,24.0,-124.0,-82.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,98.11
+1291,Pulkovo 1942 to WGS 84 (7),,,,Kazakstan.,9603,15.0,-130.0,-84.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,98.11
+1292,Pulkovo 1942 to WGS 84 (8),,,,Albania.,9603,24.0,-130.0,-92.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,98.11
+1293,Pulkovo 1942 to WGS 84 (9),,,,Romania.,9603,28.0,-121.0,-77.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,98.11
+1294,Voirol 1875 to WGS 84 (1),,,,Algeria - north of 35g (31 deg 30 min) North.,9603,-73.0,-247.0,227.0,,,,,9001,,,,,,,1998-03-12 00:00:00,U.S. Defense Mapping Agency  TR8350.2 revision of August 1993.,EPSG,,
+1295,Naparima 1972 to WGS 84 (2),,,,Trinidad and Tobago.,9603,-0.465,372.095,171.736,,,,,9001,,,,,,,1998-11-11 00:00:00,Trinidad Ministry of Energy and Energy Industries.,EPSG,,98/38
+1296,Trinidad 1903 to WGS 84 (1),,,,Trinidad.,9603,-61.702,284.488,472.052,,,,,9001,,,,,,,1998-11-11 00:00:00,Trinidad Ministry of Energy and Energy Industries.,EPSG,,98/38
+1297,Tete to Moznet (1),,,,Mozambique.,9607,-115.064,-87.39,-101.716,0.058,-4.001,2.062,9.366,9001,9104,,9202,,,,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,Mean of 32 stations. Residuals as high as 30 metres. To reduce the size of the residuals; four regional parameter sets (codes 1298-1301) were developed.,
+1298,Tete to Moznet (2),,,,Mozambique - Maputo province and southern part of Gaza province; i.e. south of approximately 24 deg S.,9607,-82.875,-57.097,-156.768,2.158,-1.524,0.982,-0.359,9001,9104,,9202,,,,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,Mean of 9 stations; residuals are generally under 1 metre.,
+1299,Tete to Moznet (3),,,,Mozambique - provinces of Gaza; Inhambane and southern parts of Sofala and Manhica; i.e. between approximately 24 and 20 deg South.,9607,-138.527,-91.999,-114.591,0.14,-3.363,2.217,11.748,9001,9104,,9202,,,,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,Mean of 6 stations; residuals are generally under 4 metres.,
+1300,Tete to Moznet (4),,,,Mozambique - provinces of Sofala north of Beira corridor; Manhica; Tete and Zambezia; i.e. between approximately 20 and 16 deg South.,9607,-73.472,-51.66,-112.482,-0.953,-4.6,2.368,0.586,9001,9104,,9202,,,,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,Mean of 11 stations; residuals are generally under 3 metres.,
+1301,Tete to Moznet (5),,,,Mozambique - provinces of Nampula; Niassa; Cabo Delgado; i.e. north of approximately 16 deg S.,9607,219.315,168.975,-166.145,-0.198,-5.926,2.356,-57.104,9001,9104,,9202,,,,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,Mean of 7 stations; residuals are 5-10 metres.,
+1302,Moznet to WGS 84 (1),,,,Mozambique.,9607,0.0,0.0,0.0,0.0,0.0,0.0,0.0,9001,9104,,9202,,,,1998-04-16 00:00:00,EPSG,EPSG,For many purposes Moznet can be considered to be coincident with WGS 84. Accuracy better than 1 metre.,
+1303,Pulkovo 1942 to WGS 84 (10),,,,Kazakstan - Caspian.,9606,43.661,-103.342,-124.117,1.659,-0.824,0.653,0.59,9001,9104,,9202,,,,1998-04-16 00:00:00,KazakCaspiShelf consortium.,EPSG,Mean of 13 stations along entire Kazak coastline; residuals under 2 m.,
+1304,Indian 1975 to WGS 84 (2),,,,Thailand.,9603,210.0,814.0,289.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,
+1305,Tokyo to WGS 84 (5),,,,South Korea.,9603,-147.0,506.0,687.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,
+1306,MGI to WGS 84 (1),,,,MEAN FOR Boznia and Herzegovina; Croatia; Serbia; Slovenia.,9603,682.0,-203.0,480.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. National Imagery and Mapping Agency  TR8350.2 revision of October 1997; http://164.214.2.59/geospatial/products/GandG/tr83502b/toc.html,EPSG,,
+1307,Naparima 1972 to WGS 84 (3),,,,Trinidad & Tobago.,9603,-2.0,374.0,172.0,,,,,9001,,,,,,,1998-04-16 00:00:00,U.S. Defense Mapping Agency  TR8350.2 December 1987.,EPSG,See remarks for code 1192.,
+1308,NAD83 to WGS 84 (4),,,,United States (USA),9607,-0.9738,1.9453,0.5486,-0.00000013357,-0.00000004872,-0.00000005507,0.0,9001,9101,,9202,,,,1999-04-22 00:00:00, http://www.ngs.noaa.gov/CORS/Derivation.html,EPSG,Strictly between NAD83 and ITRF94(1996.0).  Superseded by NAD83 to WGS 84 (5) (code 1515).,99.12  99.38
+1309,DHDN to ETRF89 (1),,,,Germany - former west Germany.,9607,582.0,105.0,414.0,-1.04,-0.35,3.08,8.3,9001,9104,,9202,,,,1998-06-30 00:00:00,Institute for Cartography and Geodesy; Leipzig.,EPSG,Mean of 69 stations; residuals under 5 m.,
+1310,Pulkovo 1942 to ETRF89 (1),,,,Germany - former east Germany - Brandenburg; Mecklenburg-Vorpommern; Sachsen-Anhalt.,9607,24.0,-123.0,-94.0,-0.02,0.25,0.13,1.1,9001,9104,,9202,,,,1998-06-30 00:00:00,Institute for Cartography and Geodesy; Leipzig.,EPSG,Mean of 20 stations; residuals under 2 m.,
+1311,ED50 to WGS 84 (Common Offshore),ED50 to WGS 84 (18),,,United Kingdom - UKCS offshore east of 6 deg west.,9606,-89.5,-93.8,-123.1,0.0,0.0,-0.156,1.2,9001,9104,,9202,,,,1998-06-30 00:00:00,The Hydrographic Journal; vol 52 page 50.,EPSG,Recommended transformation for UKCS petroleum purposes.  Based on ED50 to WGS72 (precise ephemeris) 6-nations agreement of 1981 to which precise to broadcast and broadcast to WGS 84 transformations have been concatenated.,98.27
+1312,NAD27 to NAD83 (3),,,,Canada.,9614,,,,,,,,,9104,,,NTv1_0.gsb,,,1999-04-22 00:00:00,Geomatics Canada - Geodetic Survey Division.,EPSG,Uses NTv1 method.  Superseded in 1997 by NTv2 (non-poly transformation code 1313) except in Quebec.   Input expects longitudes to be positive west; EPSG GeogCS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.,
+1313,NAD27 to NAD83 (4),,,,Canada.,9615,,,,,,,,,9104,,,NTv2_0.gsb,,,1999-04-22 00:00:00,http://www.geod.nrcan.gc.ca/products/html-public/GSDapps/English/NTv2_Fact_Sheet.html,EPSG,Uses NTv2 data files.  Supersedes  NTv1 (non-poly transformation code 1312) except in Quebec.  Input expects longitudes to be positive west; EPSG GeogCS NAD27 (code 4267) and (code 4269) have longitudes positive east.,
+1314,OSGB 1936 to WGS 84 (Petroleum),,,,United Kingdom (UKCS) - Great Britain (GB) - England; Scotland; Wales; - North Sea.,9606,446.448,-125.157,542.06,0.15,0.247,0.842,-20.489,9001,9104,,9202,,,,1998-11-11 00:00:00,UK Offshore Operators Association.,EPSG,Accuracy better than 4m and generally better than 2m.  For a more accurate transformation contact the Ordnance Survey of Great Britain.,
+1315,OSGB 1936 to ED50 (UKOOA),,,,United Kingdom (UKCS) - Great Britain (GB) - England; Scotland; Wales; - North Sea.,9606,535.948,-31.357,665.16,0.15,0.247,0.998,-21.689,9001,9104,,9202,,,,1998-11-11 00:00:00,UK Offshore Operators Association.,EPSG,This transformation is concatenated from OSGB36 to WGS 84 (Petroleum) (code 1314) minus ED50 to WGS 84 (Common Offshore) (code 1311).,
+1316,Manoca to WGS 84 (1),,,,Cameroon.,9603,-70.9,-151.8,-41.4,,,,,9001,,,,,,,1998-11-11 00:00:00,Stolt Comex Seaway and Geoid for Elf.,EPSG,,
+1317,Camacupa to WGS 72BE (1),,,,Angola - offshore.,9603,-37.2,-370.6,-228.5,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,Derived by Geophysical Services Inc. in 1979 from mean of Transit results at 7 stations.,
+1318,Camacupa to WGS 84 (1),,,,Angola - offshore block 5.,9603,-42.01,-332.21,-229.75,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,Used by Conoco.,
+1319,Camacupa to WGS 84 (2),,,,Angola - offshore block 2.,9603,-40.0,-354.0,-224.0,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,Used by Texaco.,
+1320,Camacupa to WGS 84 (3),,,,Angola - offshore blocks 1 and 16.,9606,-37.2,-370.6,-224.0,0.0,0.0,0.554,0.219,9001,9104,8901,9202,,,,1998-12-14 00:00:00,EPSG,EPSG,Used by Shell prior to 1994.  Superseded by Camacupa to WGS 84 (9).,98.56
+1321,Camacupa to WGS 84 (4),,,,Angola - offshore blocks 7 and 8.  Also used rounded to integer metre for GSI/HGS/Western Geophysical speculative seismic data.,9603,-42.5,-342.5,-228.1,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,Derived as mean of 123 Transit passes at station Cabo Ledo NE base in January 1989.  Used by Total for block 8. Used by Elf for block 7 up to December 1992 then superseded by Camacupa to WGS 84 (7).,
+1322,Camacupa to WGS 84 (5),,,,Angola - offshore block 3.,9603,-55.5,-348.0,-229.2,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,Derived at station Djeno during coordination of platform PAL F2 in February 1992. Used by Elf for block 3 up to December 1992 then superseded by Camacupa to WGS 84 (7).,
+1323,Camacupa to WGS 84 (6),,,,Angola - offshore block 7.,9603,-43.0,-337.0,-233.0,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,Derived at Luanda observatory December 1992.  Used by Elf for 1993 block 7 shallow water survey.,
+1324,Camacupa to WGS 84 (7),,,,Angola - offshore blocks 3  7  15 and 17.,9603,-48.0,-345.0,-231.0,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,"Derived at platform PAL F2 in December 1992.  Used by Elf for blocks 3, 7 and 17 between December 1992 and 1994 then superseded by Camacupa to WGS 84 (10).  Used by Exxon for block 15 since 1993.",
+1325,Camacupa to WGS 84 (8),,,,Angola - offshore block 2.,9603,-48.6,-345.1,-230.8,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,Derived at platform PAL F2 in December 1992. Used by Total for block 2 between December 1992 and 1994 then superseded by Camacupa to WGS 84 (10).,
+1326,Camacupa to WGS 84 (9),,,,Angola - offshore blocks 1 16 and 18.,9606,-41.057,-374.564,-226.287,0.0,0.0,0.554,0.219,9001,9104,8901,9202,,,,1998-12-14 00:00:00,EPSG,EPSG,Used by Shell since 1994.  Supersedes Camacupa to WGS 84 (3).,98.56
+1327,Camacupa to WGS 84 (10),,,,Angola - offshore blocks 2  3 17 and 31-33.,9603,-50.9,-347.6,-231.0,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,Derived at platform PAL F2 in 1994 by Topnav using Doris.  Used by Elf in blocks 3 and 17 since 1994.  Used by Total in block 2 since 1994. Adopted by BP-Amoco Elf and Exxon for blocks 31-33.,
+1328,Malongo 1987 to Mhast (1),,,,Angola - Cabinda offshore.,9603,0.0,0.0,0.0,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,Malongo 1987 is an offshore extension of Mhast adopted by Chevron in 1987.,
+1329,Mhast to WGS 84 (1),,,,Angola - Cabinda offshore.,9603,-252.95,-4.11,-96.38,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,,
+1330,Malongo 1987 to WGS 84 (1),,,,Angola - Cabinda offshore.,9603,-252.95,-4.11,-96.38,,,,,9001,,,,,,,1998-11-11 00:00:00,EPSG,EPSG,Used by Chevron.,
+1331,EST92 to ETRF89 (1),,,,Estonia,9607,0.0,0.0,0.0,0.0,0.0,0.0,0.0,9001,9104,,9202,,,,1998-12-14 00:00:00,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,,
+1332,Pulkovo 1942 to EST92 (1),,,,Estonia.,9607,21.53219,-97.00027,-60.74046,-0.99548,-0.58147,-0.2418,-4.5981,9001,9104,,9202,,,,1998-12-14 00:00:00,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,,
+1333,EST92 to WGS84 (1),,,,Estonia.,9607,0.055,-0.541,-0.185,-0.0183,0.0003,0.007,-0.014,9001,9104,,9202,,,,1998-12-14 00:00:00,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,,
+1334,Pulkovo 1942 to WGS84 (12),,,,Estonia.,9607,21.58719,-97.54127,-60.92546,-1.01378,-0.58117,-0.2348,-4.6121,9001,9104,,9202,,,,1998-12-14 00:00:00,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,,
+1335,Tokyo to WGS 84 (6),,,,Japan - 45d 20m to 46d N; 141d to 142d E.,9618,7.92,-13.88,26.1,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1336,Tokyo to WGS 84 (7),,,,Japan - 45d 20m to 46d N; 142d to 143d E.,9618,7.94,-13.97,26.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1337,Tokyo to WGS 84 (8),,,,Japan - 44deg 40min to 45deg 20min N; 141deg to 142deg E.,9618,8.1,-13.81,27.2,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1338,Tokyo to WGS 84 (9),,,,Japan - 44deg 40min to 45deg 20min N; 142deg to 143deg E.,9618,8.15,-13.95,28.4,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1339,Tokyo to WGS 84 (10),,,,Japan - 44deg to 44deg 40min N; 141deg to 142deg E.,9618,8.37,-13.65,29.0,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1340,Tokyo to WGS 84 (11),,,,Japan - 44deg to 44deg 40min N; 142deg to 143deg E.,9618,8.44,-13.87,30.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1341,Tokyo to WGS 84 (12),,,,Japan - 44deg to 44deg 40min N; 143deg to 144deg E.,9618,8.61,-14.08,30.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1342,Tokyo to WGS 84 (13),,,,Japan - 44deg to 44deg 40min N; 144deg to 145deg E.,9618,8.73,-14.3,30.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1343,Tokyo to WGS 84 (14),,,,Japan - 43deg 20min to 44deg N; 141deg to 142deg E.,9618,8.63,-13.49,30.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1344,Tokyo to WGS 84 (15),,,,Japan - 43deg 20min to 44deg N; 142deg to 143deg E.,9618,8.71,-13.73,31.6,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1345,Tokyo to WGS 84 (16),,,,Japan - 43deg 20min to 44deg N; 143deg to 144deg E.,9618,8.84,-14.03,31.2,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1346,Tokyo to WGS 84 (17),,,,Japan - 43deg 20min to 44deg N; 144deg to 145deg E.,9618,8.98,-14.33,32.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1347,Tokyo to WGS 84 (18),,,,Japan - 43deg 20min to 44deg N; 145deg to 146deg E.,9618,9.1,-14.56,32.6,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1348,Tokyo to WGS 84 (19),,,,Japan - 42deg 40min to 43deg 20min N; 140deg to 141deg E.,9618,8.79,-13.0,33.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1349,Tokyo to WGS 84 (20),,,,Japan - 42deg 40min to 43deg 20min N; 141deg to 142deg E.,9618,8.84,-13.31,31.4,,,,,9001,9104,,,,,,1999-11-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,99.77
+1350,Tokyo to WGS 84 (21),,,,Japan - 42deg 40min to 43deg 20min N; 142deg to 143deg E.,9618,8.98,-13.59,30.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1351,Tokyo to WGS 84 (22),,,,Japan - 42deg 40min to 43deg 20min N; 143deg to 144deg E.,9618,9.1,-13.91,29.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1352,Tokyo to WGS 84 (23),,,,Japan - 42deg 40min to 43deg 20min N; 144deg to 145deg E.,9618,9.17,-14.27,31.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1353,Tokyo to WGS 84 (24),,,,Japan - 42deg 40min to 43deg 20min N; 145deg to 146deg E.,9618,9.23,-14.52,31.4,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1354,Tokyo to WGS 84 (25),,,,Japan - 42deg to 42deg 40min N; 139deg to 140deg E.,9618,8.9,-12.68,34.4,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1355,Tokyo to WGS 84 (26),,,,Japan - 42deg to 42deg 40min N; 140deg to 141deg E.,9618,8.99,-12.8,34.2,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1356,Tokyo to WGS 84 (27),,,,Japan - 42deg to 42deg 40min N; 141deg to 142deg E.,9618,9.0,-13.07,31.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1357,Tokyo to WGS 84 (28),,,,Japan - 42deg to 42deg 40min N; 142deg to 143deg E.,9618,9.21,-13.51,27.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1358,Tokyo to WGS 84 (29),,,,Japan - 42deg to 42deg 40min N; 143deg to 144deg E.,9618,9.33,-13.66,23.8,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1359,Tokyo to WGS 84 (30),,,,Japan - 41deg 20min to 42deg N; 140deg to 141deg E.,9618,9.25,-12.72,34.2,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1360,Tokyo to WGS 84 (31),,,,Japan - 41deg 20min to 42deg N; 141deg to 142deg E.,9618,9.39,-12.91,31.8,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1361,Tokyo to WGS 84 (32),,,,Japan - 40deg 40min to 41deg 20min N; 140deg to 141deg E.,9618,9.55,-12.63,35.6,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1362,Tokyo to WGS 84 (33),,,,Japan - 40deg 40min to 41deg 20min N; 141deg to 142deg E.,9618,9.62,-12.82,34.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1363,Tokyo to WGS 84 (34),,,,Japan - 40deg to 40deg 40min N; 139deg to 140deg E.,9618,9.81,-12.29,36.6,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1364,Tokyo to WGS 84 (35),,,,Japan - 40deg to 40deg 40min N; 140deg to 141deg E.,9618,9.81,-12.45,37.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1365,Tokyo to WGS 84 (36),,,,Japan - 40deg to 40deg 40min N; 141deg to 142deg E.,9618,9.92,-12.79,38.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1366,Tokyo to WGS 84 (37),,,,Japan - 39deg 20min to 40deg N; 139deg to 140deg E.,9618,9.91,-12.21,36.6,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1367,Tokyo to WGS 84 (38),,,,Japan - 39deg 20min to 40deg N; 140deg to 141deg E.,9618,10.08,-12.35,39.0,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1368,Tokyo to WGS 84 (39),,,,Japan - 39deg 20min to 40deg N; 141deg to 142deg E.,9618,10.19,-12.74,40.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1369,Tokyo to WGS 84 (40),,,,Japan - 38deg 40min to 39deg 20min N; 139deg to 140deg E.,9618,10.29,-12.13,38.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1370,Tokyo to WGS 84 (41),,,,Japan - 38deg 40min to 39deg 20min N; 140deg to 141deg E.,9618,10.33,-12.27,40.1,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1371,Tokyo to WGS 84 (42),,,,Japan - 38deg 40min to 39deg 20min N; 141deg to 142deg E.,9618,10.45,-12.61,41.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1372,Tokyo to WGS 84 (43),,,,Japan - 38deg to 38deg 40min N; 139deg to 140deg E.,9618,10.54,-11.96,39.1,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1373,Tokyo to WGS 84 (44),,,,Japan - 38deg to 38deg 40min N; 140deg to 141deg E.,9618,10.65,-12.27,41.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1374,Tokyo to WGS 84 (45),,,,Japan - 38deg to 38deg 40min N; 141deg to 142deg E.,9618,10.67,-12.5,41.1,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1375,Tokyo to WGS 84 (46),,,,Japan - 37deg 20min to 38deg N; 136deg to 137deg E.,9618,10.67,-10.86,38.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1376,Tokyo to WGS 84 (47),,,,Japan - 37deg 20min to 38deg N; 137deg to 138deg E.,9618,10.68,-10.97,36.0,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1377,Tokyo to WGS 84 (48),,,,Japan - 37deg 20min to 38deg N; 138deg to 139deg E.,9618,10.8,-11.53,39.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1378,Tokyo to WGS 84 (49),,,,Japan - 37deg 20min to 38deg N; 139deg to 140deg E.,9618,10.8,-11.73,40.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1379,Tokyo to WGS 84 (50),,,,Japan - 37deg 20min to 38deg N; 140deg to 141deg E.,9618,10.92,-12.16,42.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1380,Tokyo to WGS 84 (51),,,,Japan - 37deg 20min to 38deg N; 141deg to 142deg E.,9618,11.0,-12.25,41.2,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1381,Tokyo to WGS 84 (52),,,,Japan - 36deg 40min to 37deg 20min N; 136deg to 137deg E.,9618,10.83,-10.77,36.2,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1382,Tokyo to WGS 84 (53),,,,Japan - 36deg 40min to 37deg 20min N; 137deg to 138deg E.,9618,10.95,-11.0,38.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1383,Tokyo to WGS 84 (54),,,,Japan - 36deg 40min to 37deg 20min N; 138deg to 139deg E.,9618,10.97,-11.34,40.8,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1384,Tokyo to WGS 84 (55),,,,Japan - 36deg 40min to 37deg 20min N; 139deg to 140deg E.,9618,11.04,-11.69,43.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1385,Tokyo to WGS 84 (56),,,,Japan - 36deg 40min to 37deg 20min N; 140deg to 141deg E.,9618,11.17,-12.05,42.6,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1386,Tokyo to WGS 84 (57),,,,Japan - 36deg to 37deg 40min N; 136deg to 137deg E.,9618,11.11,-10.59,37.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1387,Tokyo to WGS 84 (58),,,,Japan - 36deg to 37deg 40min N; 137deg to 138deg E.,9618,11.16,-10.97,40.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1388,Tokyo to WGS 84 (59),,,,Japan - 36deg to 37deg 40min N; 138deg to 139deg E.,9618,11.29,-11.23,42.4,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1389,Tokyo to WGS 84 (60),,,,Japan - 36deg to 37deg 40min N; 139deg to 140deg E.,9618,11.36,-11.59,42.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1390,Tokyo to WGS 84 (61),,,,Japan - 36deg to 37deg 40min N; 140deg to 141deg E.,9618,11.44,-11.88,40.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1391,Tokyo to WGS 84 (62),,,,Japan - 35deg 20min to 36deg N; 132deg to 133deg E.,9618,11.27,-9.31,30.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1392,Tokyo to WGS 84 (63),,,,Japan - 35deg 20min to 36deg N; 133deg to 134deg E.,9618,11.33,-9.52,33.8,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1393,Tokyo to WGS 84 (64),,,,Japan - 35deg 20min to 36deg N; 134deg to 135deg E.,9618,11.38,-9.86,34.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1394,Tokyo to WGS 84 (65),,,,Japan - 35deg 20min to 36deg N; 135deg to 136deg E.,9618,11.41,-10.14,35.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1395,Tokyo to WGS 84 (66),,,,Japan - 35deg 20min to 36deg N; 136deg to 137deg E.,9618,11.39,-10.52,37.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1396,Tokyo to WGS 84 (67),,,,Japan - 35deg 20min to 36deg N; 137deg to 138deg E.,9618,11.49,-10.83,39.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1397,Tokyo to WGS 84 (68),,,,Japan - 35deg 20min to 36deg N; 138deg to 139deg E.,9618,11.58,-11.21,41.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1398,Tokyo to WGS 84 (69),,,,Japan - 35deg 20min to 36deg N; 139deg to 140deg E.,9618,11.65,-11.53,38.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1399,Tokyo to WGS 84 (70),,,,Japan - 35deg 20min to 36deg N; 140deg to 141deg E.,9618,11.72,-11.8,34.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1400,Tokyo to WGS 84 (71),,,,Japan - 34deg 40min to 35deg 20min N; 132deg to 133deg E.,9618,11.44,-9.21,32.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1401,Tokyo to WGS 84 (72),,,,Japan - 34deg 40min to 35deg 20min N; 133deg to 134deg E.,9618,11.47,-9.52,35.2,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1402,Tokyo to WGS 84 (73),,,,Japan - 34deg 40min to 35deg 20min N; 134deg to 135deg E.,9618,11.55,-9.8,35.4,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1403,Tokyo to WGS 84 (74),,,,Japan - 34deg 40min to 35deg 20min N; 135deg to 136deg E.,9618,11.61,-10.12,35.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1404,Tokyo to WGS 84 (75),,,,Japan - 34deg 40min to 35deg 20min N; 136deg to 137deg E.,9618,11.66,-10.47,37.0,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1405,Tokyo to WGS 84 (76),,,,Japan - 34deg 40min to 35deg 20min N; 137deg to 138deg E.,9618,11.78,-10.79,39.8,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1406,Tokyo to WGS 84 (77),,,,Japan - 34deg 40min to 35deg 20min N; 138deg to 139deg E.,9618,11.85,-11.13,39.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1407,Tokyo to WGS 84 (78),,,,Japan - 34deg 40min to 35deg 20min N; 139deg to 140deg E.,9618,11.9,-11.47,36.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1408,Tokyo to WGS 84 (79),,,,Japan - 34deg 40min to 35deg 20min N; 140deg to 141deg E.,9618,11.91,-11.69,33.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1409,Tokyo to WGS 84 (80),,,,Japan - 34deg to 34deg 40min N; 130deg to 131deg E.,9618,11.65,-8.59,29.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1410,Tokyo to WGS 84 (81),,,,Japan - 34deg to 34deg 40min N; 131deg to 132deg E.,9618,11.68,-8.8,30.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1411,Tokyo to WGS 84 (82),,,,Japan - 34deg to 34deg 40min N; 132deg to 133deg E.,9618,11.73,-9.04,30.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1412,Tokyo to WGS 84 (83),,,,Japan - 34deg to 34deg 40min N; 133deg to 134deg E.,9618,11.72,-9.48,35.1,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1413,Tokyo to WGS 84 (84),,,,Japan - 34deg to 34deg 40min N; 134deg to 135deg E.,9618,11.81,9.74,35.8,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1414,Tokyo to WGS 84 (85),,,,Japan - 34deg to 34deg 40min N; 135deg to 136deg E.,9618,11.88,-10.1,37.1,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1415,Tokyo to WGS 84 (86),,,,Japan - 34deg to 34deg 40min N; 136deg to 137deg E.,9618,11.91,-10.35,37.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1416,Tokyo to WGS 84 (87),,,,Japan - 34deg to 34deg 40min N; 137deg to 138deg E.,9618,11.9,-10.7,39.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1417,Tokyo to WGS 84 (88),,,,Japan - 34deg to 34deg 40min N; 138deg to 139deg E.,9618,12.02,-11.09,38.2,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1418,Tokyo to WGS 84 (89),,,,Japan - 33deg 20min to 34deg N; 129deg to 130deg E.,9618,11.87,-8.23,29.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1419,Tokyo to WGS 84 (90),,,,Japan - 33deg 20min to 34deg N; 130deg to 131deg E.,9618,11.84,-8.44,30.6,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1420,Tokyo to WGS 84 (91),,,,Japan - 33deg 20min to 34deg N; 131deg to 132deg E.,9618,11.94,-8.71,30.2,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1421,Tokyo to WGS 84 (92),,,,Japan - 33deg 20min to 34deg N; 132deg to 133deg E.,9618,11.99,-9.02,30.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1422,Tokyo to WGS 84 (93),,,,Japan - 33deg 20min to 34deg N; 133deg to 134deg E.,9618,12.05,-9.36,35.0,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1423,Tokyo to WGS 84 (94),,,,Japan - 33deg 20min to 34deg N; 134deg to 135deg E.,9618,12.1,-9.64,35.5,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1424,Tokyo to WGS 84 (95),,,,Japan - 33deg 20min to 34deg N; 135deg to 136deg E.,9618,12.1,-10.08,37.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1425,Tokyo to WGS 84 (96),,,,Japan - 33deg 20min to 34deg N; 136deg to 137deg E.,9618,12.07,-10.25,37.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1426,Tokyo to WGS 84 (97),,,,Japan - 32deg 40min to 33deg 20min N; 129deg to 130deg E.,9618,12.0,-8.15,32.1,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1427,Tokyo to WGS 84 (98),,,,Japan - 32deg 40min to 33deg 20min N; 130deg to 131deg E.,9618,12.06,-8.38,31.0,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1428,Tokyo to WGS 84 (99),,,,Japan - 32deg 40min to 33deg 20min N; 131deg to 132deg E.,9618,12.17,-8.69,30.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1429,Tokyo to WGS 84 (100),,,,Japan - 32deg 40min to 33deg 20min N; 132deg to 133deg E.,9618,12.23,-8.99,31.7,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1430,Tokyo to WGS 84 (101),,,,Japan - 32deg 40min to 33deg 20min N; 133deg to 134deg E.,9618,12.21,-9.21,34.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1431,Tokyo to WGS 84 (102),,,,Japan - 32deg 40min to 33deg 20min N; 134deg to 135deg E.,9618,12.28,-9.6,33.3,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1432,Tokyo to WGS 84 (103),,,,Japan - 32deg to 32deg 40min N; 130deg to 131deg E.,9618,12.28,-8.25,31.0,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1433,Tokyo to WGS 84 (104),,,,Japan - 32deg to 32deg 40min N; 131deg to 132deg E.,9618,12.37,-8.55,29.1,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1434,Tokyo to WGS 84 (105),,,,Japan - 31deg 20min to 32deg N; 130deg to 131deg E.,9618,12.53,-8.21,31.0,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1435,Tokyo to WGS 84 (106),,,,Japan - 31deg 20min to 32deg N; 131deg to 132deg E.,9618,12.57,-8.4,28.4,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1436,Tokyo to WGS 84 (107),,,,Japan - 30deg 40min to 31deg 20min N; 130deg to 131deg E.,9618,12.71,-8.17,29.9,,,,,9001,9104,,,,,,1998-12-12 00:00:00,http://vldb.gsi-mc.go.jp/sokuchi/coordinates/localtrans.html   (Geographical Survey Institute).,EPSG,,
+1437,RT90 to ETRF89 (1),,,,Sweden,9607,419.3836,99.3335,591.3451,-0.850389,-1.817277,7.862238,-0.99496,9001,9104,,9202,,,,1999-04-22 00:00:00,National Land Survey of Sweden.,EPSG,This transformation is actually between ETRF89 and RR92.  RR92 is a geographic 3D coordinate system where the horizontal component is RT90.,99.11
+1438,Fahud to WGS 84 (2),,,,Oman.,9606,-333.102,-11.02,230.69,0.0,0.0,0.554,0.219,9001,9104,,9202,,,,1999-04-22 00:00:00,Petroleum Development Oman,EPSG,,
+1439,PSD93 to WGS 84 (1),,,,Oman.,9606,-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006,9001,9104,,9202,,,,1999-04-22 00:00:00,Petroleum Development Oman,EPSG,,
+1440,ED50 to WGS 84 (19),,,,Greece.,9603,-86.0,-92.2,-127.5,,,,,9001,,,,,,,1999-04-22 00:00:00,Geodesy Department; Hellenic Petroleum s.a.,EPSG,Used in oil industry.,
+1441,Antigua 1943 to WGS 84 (1),,,,Antigua.,9603,-255.0,-15.0,71.0,,,,,9001,,,,,,,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+1442,Dominica 1945 to WGS 84 (1),,,,Dominica.,9603,725.0,685.0,536.0,,,,,9001,,,,,,,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+1443,Grenada 1953 to WGS 84 (1),,,,Grenada.,9603,72.0,213.7,93.0,,,,,9001,,,,,,,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+1444,Montserrat 1958 to WGS 84 (1),,,,Montserrat.,9603,174.0,359.0,365.0,,,,,9001,,,,,,,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+1445,St. Kitts 1955 to WGS 84 (1),,,,Saint Kitts and Nevis.,9603,9.0,183.0,236.0,,,,,9001,,,,,,,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+1446,St. Lucia 1955 to WGS 84 (1),,,,Saint Lucia.,9603,-149.0,128.0,296.0,,,,,9001,,,,,,,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+1447,Anguilla 1957 to WGS 84 (1),,,,Anguilla.,9619,-18.0,4.4,,,,,,,9104,,,,,,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,,
+1450,ED50 to WGS 84 (20),,,,Norway - offshore between 62 and 65 deg North and west of 5 deg East.,9620,,,,,,8047.0,8046.0,,9102,,,ED50 to WGS 84 (15),ED50 to WGS 84 (14),,1999-04-22 00:00:00,"Norwegian Mapping Authority note of 13-Feb-1991 \"Om Transformasjon mellom Geodetiske Datum i Norge\"",EPSG,,
+1451,NAD27(CGQ77) to NAD83 (1),,,,Canada - Quebec,9614,,,,,,,,,9104,,,PQV4.DAC,,,1999-05-15 00:00:00,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,Uses NT method which expects longitudes positive west; EPSG GeogCSs CGQ77 (code 4609) and NAD83 (code 4269) have longitudes positive east.  Supersedes NAD27 to NAD83 (5) (code xxxx).,
+1454,Old Hawaiian to NAD83 (1),,,,United States (USA) - Hawaii including EEZ.,9613,,,,,,,,,9104,,,hawaii.las,hawaii.los,,1999-05-15 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs Old Hawaiian (code 4135) and NAD83 (code 4269) have longitudes positive east.  NADCON data converts from Old Hawaiian Datum to but makes the transformation appear to be from NAD27.,
+1455,St. Lawrence Island to NAD83 (1),,,,United States (USA) - Alaska - St. Lawrence Island.,9613,,,,,,,,,9104,,,stlrnc.las,stlrnc.los,,1999-05-15 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs St. Lawrence (code 4136) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from St. Lawrence Datum to but makes the transformation appear to be from NAD27.,
+1456,St. Paul Island to NAD83 (1),,,,United States (USA) - Alaska - St. Paul Island.,9613,,,,,,,,,9104,,,stpaul.las,stpaul.los,,1999-05-15 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs St. Paul (code 4137) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from St. Paul Datum to but makes the transformation appear to be from NAD27.,
+1457,St. George Island to NAD83 (1),,,,United States (USA) - Alaska - St. George Island.,9613,,,,,,,,,9104,,,stgeorge.las,stgeorge.los,,1999-05-15 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs St. George (code 4138) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from St. George Datum to but makes the transformation appear to be from NAD27.,
+1458,AGD66 to GDA94 (2),,,,Australia - ACT.,9607,-129.193,-41.212,130.73,-0.246,-0.374,-0.329,-2.955,9001,9104,,9202,,,,1999-05-25 00:00:00,http://www.anzlic.org.au/icsm/gdatm/regional.htm,EPSG,1m accuracy.  Recommended for mid-accuracy use in A.C.T.,
+1459,AGD66 to GDA94 (3),,,,Australia - Tasmania.,9607,-120.695,-62.73,165.46,-0.109,0.141,0.116,2.733,9001,9104,,9202,,,,1999-05-25 00:00:00,http://www.anzlic.org.au/icsm/gdatm/regional.htm,EPSG,1m accuracy.  Recommended for mid-accuracy use in Tasmania.,
+1460,AGD66 to GDA94 (4),,,,Australia - New South Wales (NSW) and Victoria.,9607,-119.353,-48.301,139.484,-0.415,-0.26,-0.437,-0.613,9001,9104,,9202,,,,1999-05-25 00:00:00,http://www.anzlic.org.au/icsm/gdatm/regional.htm,EPSG,1m accuracy.  Recommended for mid-accuracy use in NSW and Victoria.,
+1461,Puerto Rico to NAD83 (1),,,,Puerto Rico; Virgin Islands (U.S.); Virgin Islands (British).,9613,,,,,,,,,9104,,,prvi.las,prvi.los,,1999-05-24 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs Puerto Rico (code 4139) and NAD83 (code 4269) have longitudes positive east. NADCON data converts from Puerto Rico Datum to but makes the transformation appear to be from NAD27.,
+1462,NAD27 to NAD83 (5),,,,Canada - Quebec,9614,,,,,,,,,9104,,,GS2783v1.QUE,,,1999-05-24 00:00:00,Geodetic Service of Quebec.  Contact alain.bernard at mrn.gouv.qc.ca,EPSG,Uses NT method which expects longitudes positive west; EPSG GeogCSs NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east.  Superseded by NAD27(CGQ77) to NAD83 (1) (code 1451).,
+1463,NAD27(76) to NAD83 (1),,,,Canada - Ontario,9615,,,,,,,,,9104,,,May76v20.gsb,,,1999-05-24 00:00:00,Geodetic Survey of Canada   http://www.geod.emr.ca/html-public/GSDapps/English/NTv2_Fact_Sheet.html,EPSG,Uses NT method which expects longitudes positive west; EPSG GeogCSs NAD27(76) (code 4608) and NAD83 (code 4269) have longitudes positive east.,
+1464,AGD66 to GDA94 (5),,,,Australia - Victoria.,9615,,,,,,,,,9104,,,vic_0799.gsb,,,1999-10-20 00:00:00,http://www.osg.vic.gov.au/tools.htm,EPSG,0.1m accuracy.  Input expects longitudes to be positive west; EPSG GeogCS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.,99.67
+1466,NGO 1948 (Oslo) to NGO1948,,,,Norway - onshore.,9601,10.43225,,,,,,,,9110,,,,,,1999-11-12 00:00:00,"J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.",EPSG,Change of prime meridian.,99.79
+1467,NTF (Paris) to NTF (1),,,,France - onshore.,9601,2.5969213,,,,,,,,9105,,,,,,1999-11-12 00:00:00,IGN Paris.,EPSG,Change of prime meridian.,99.63  99.79
+1468,NTF (Paris) to NTF (2),,,,France - onshore.,9601,2.201395,,,,,,,,9110,,,,,,1999-11-12 00:00:00,Royal Geographic Society; London,EPSG,Change of prime meridian.  EPSG prefers value from IGN Paris (code 1467).,99.63  99.79
+1469,Locodjo 1965 to WGS 84 (1),,,,Cote D'Ivoire (Ivory Coast),9603,-125.0,53.0,467.0,,,,,9001,,,,,,,1999-10-20 00:00:00,IGN Paris,EPSG,,
+1470,Abidjan 1987 to WGS 84 (1),,,,Cote D'Ivoire (Ivory Coast),9603,-124.76,53.0,466.79,,,,,9001,,,,,,,1999-10-20 00:00:00,IGN Paris,EPSG,,
+1471,MGI to WGS 84 (2),,,,Austria,9606,-577.326,-90.129,-463.919,-15.8537,-4.55,-16.3489,-2.4232,9001,9113,,9202,,,,1999-10-20 00:00:00,Bundesamt f�r Eich- und Vermessungswesen,EPSG,,
+1472,ATS77 to NAD83(CSRS98) (1),,,,Canada - New Brunswick,9615,,,,,,,,,9104,,,NT7783v2.gsb,,,1999-10-20 00:00:00,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,Introduced in 1999.,
+1473,NAD83(CSRS98) to WGS 84 (1),,,,Canada - New Brunswick,9603,0.0,0.0,0.0,,,,,9001,,,,,,,1999-10-20 00:00:00,EPSG,EPSG,For many purposes NAD83 can be considered to be coincident with WGS 84.,
+1474,NAD83 to NAD83(HARN) (1),,,,United States (USA) - Alabama.,9613,,,,,,,,,9104,,,alhpgn.las,alhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1475,NAD83 to NAD83(HARN) (2),,,,United States (USA) - Arizona.,9613,,,,,,,,,9104,,,azhpgn.las,azhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1476,NAD83 to NAD83(HARN) (3),,,,United States (USA) - California north of 38 deg N.,9613,,,,,,,,,9104,,,cnhpgn.las,cnhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1477,NAD83 to NAD83(HARN) (4),,,,United States (USA) - California south of 38 deg N.,9613,,,,,,,,,9104,,,cshpgn.las,cshpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1478,NAD83 to NAD83(HARN) (5),,,,United States (USA) - Colorado.,9613,,,,,,,,,9104,,,cohpgn.las,cohpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1479,NAD83 to NAD83(HARN) (6),,,,United States (USA) - Georgia.,9613,,,,,,,,,9104,,,gahpgn.las,gahpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1480,NAD83 to NAD83(HARN) (7),,,,United States (USA) - Florida.,9613,,,,,,,,,9104,,,flhpgn.las,flhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1481,NAD83 to NAD83(HARN) (8),,,,United States (USA) - Idaho and Montana - east of 113 deg W.,9613,,,,,,,,,9104,,,emhpgn.las,emhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1482,NAD83 to NAD83(HARN) (9),,,,United States (USA) - Idaho and Montana - west of 113 deg W.,9613,,,,,,,,,9104,,,wmhpgn.las,wmhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1483,NAD83 to NAD83(HARN) (10),,,,United States (USA) - Kentucky.,9613,,,,,,,,,9104,,,kyhpgn.las,kyhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1484,NAD83 to NAD83(HARN) (11),,,,United States (USA) - Louisiana.,9613,,,,,,,,,9104,,,lahpgn.las,lahpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1485,NAD83 to NAD83(HARN) (12),,,,United States (USA) - Delaware and Maryland.,9613,,,,,,,,,9104,,,mdhpgn.las,mdhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1486,NAD83 to NAD83(HARN) (13),,,,United States (USA) - Maine.,9613,,,,,,,,,9104,,,mehpgn.las,mehpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1487,NAD83 to NAD83(HARN) (14),,,,United States (USA) - Michigan.,9613,,,,,,,,,9104,,,mihpgn.las,mihpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1488,NAD83 to NAD83(HARN) (15),,,,United States (USA) - Mississippi.,9613,,,,,,,,,9104,,,mshpgn.las,mshpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1489,NAD83 to NAD83(HARN) (16),,,,United States (USA) - Nebraska.,9613,,,,,,,,,9104,,,nbhpgn.las,nbhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1490,NAD83 to NAD83(HARN) (17),,,,United States (USA) - Connecticut; Massachusetts; New Hampshire; Rhode Island; Vermont.,9613,,,,,,,,,9104,,,nehpgn.las,nehpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1491,NAD83 to NAD83(HARN) (18),,,,United States (USA) - New Mexico.,9613,,,,,,,,,9104,,,nmhpgn.las,nmhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1492,NAD83 to NAD83(HARN) (19),,,,United States (USA) - New York.,9613,,,,,,,,,9104,,,nyhpgn.las,nyhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1493,NAD83 to NAD83(HARN) (20),,,,United States (USA) - North Dakota.,9613,,,,,,,,,9104,,,ndhpgn.las,ndhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1494,NAD83 to NAD83(HARN) (21),,,,United States (USA) - Oklahoma.,9613,,,,,,,,,9104,,,okhpgn.las,okhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1495,NAD83 to NAD83(HARN) (22),,,,United States (USA) - Puerto Rico and the Virgin Islands.,9613,,,,,,,,,9104,,,pvhpgn.las,pvhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1496,NAD83 to NAD83(HARN) (23),,,,United States (USA) - South Dakota.,9613,,,,,,,,,9104,,,sdhpgn.las,sdhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1497,NAD83 to NAD83(HARN) (24),,,,United States (USA) - Tennessee,9613,,,,,,,,,9104,,,tnhpgn.las,tnhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1498,NAD83 to NAD83(HARN) (25),,,,United States (USA) - Texas east of 100deg West.,9613,,,,,,,,,9104,,,ethpgn.las,ethpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1499,NAD83 to NAD83(HARN) (26),,,,United States (USA) - Texas west of 100deg West.,9613,,,,,,,,,9104,,,wthpgn.las,wthpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1500,NAD83 to NAD83(HARN) (27),,,,United States (USA) - Virginia.,9613,,,,,,,,,9104,,,vahpgn.las,vahpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1501,NAD83 to NAD83(HARN) (28),,,,United States (USA) - Oregan; Washington.,9613,,,,,,,,,9104,,,wohpgn.las,wohpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1502,NAD83 to NAD83(HARN) (29),,,,United States (USA) - Wisconsin.,9613,,,,,,,,,9104,,,wihpgn.las,wihpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1503,NAD83 to NAD83(HARN) (30),,,,United States (USA) - Wyoming.,9613,,,,,,,,,9104,,,wyhpgn.las,wyhpgn.los,,1999-10-20 00:00:00,US Coast & Geodetic Survey  www.ngs.noaa.gov  NADCON readme file,EPSG,Uses NADCON method which expects longitudes positive west; EPSG GeogCSs NAD83 (code 4269) and NAD83(HARN) (code 4140) have longitudes positive east.,
+1504,Cape to Hartbeesthoek94 (1),,,,South Africa.,9603,-134.73,-110.92,-292.66,,,,,9001,,,,,,,1999-10-20 00:00:00,Directorate of Surveys and Mapping; http://w3sli.wcape.gov.za/surveys/mapping/wgs84.htm,EPSG,,
+1505,Hartbeesthoek94 to WGS 84 (1),,,,South Africa.,9603,0.0,0.0,0.0,,,,,9001,,,,,,,1999-10-20 00:00:00,EPSG,EPSG,For many purposes Hartbeesthoek94 datum can be considered to be coincident with WGS 84.,
+1506,AGD66 to GDA94 (6),,,,Australia - Tasmania.,9615,,,,,,,,,9104,,,tas_1098.gsb,,,1999-10-20 00:00:00,http://www.delm.tas.gov.au/osg/Geodetic_transform.htm,EPSG,0.1m accuracy.  Input expects longitudes to be positive west; EPSG GeogCS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.,
+1507,AGD66 to GDA94 (7),,,,Australia - Northern Territory.,9615,,,,,,,,,9104,,,nt_0599.gsb,,,1999-10-20 00:00:00,http://www.anzlic.org.au/icsm/gdatm/chapter7.htm#high,EPSG,0.1m accuracy.  Input expects longitudes to be positive west; EPSG GeogCS AGD66 (code 4202) and GDA94 (code 4283) both have longitudes positive east.,
+1508,CH1903 to WGS 84 (1),,,,Liechtenstein;  Switzerland.,9607,660.077,13.551,369.344,2.484,1.783,2.939,5.66,9001,9113,,9202,,,,1999-10-20 00:00:00,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,Implemented in Bundesamt f�r Landestopographie programme GRANIT.,
+1509,CH1903+ to CHTRF95 (1),,,,Liechtenstein;  Switzerland.,9603,674.374,15.056,405.346,,,,,9001,,,,,,,1999-10-20 00:00:00,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,,
+1510,CH1903 to WGS 84 (2),,,,Liechtenstein;  Switzerland.,9603,674.374,15.056,405.346,,,,,9001,,,,,,,1999-10-20 00:00:00,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,These parameters are strictly between CH1903+ and CHTRF95 but are used from CH1903 as an approximation which is within the accuracy of the distortions within the CH1903 network.,
+1511,CHTRF95 to WGS 84 (1),,,,Liechtenstein;  Switzerland.,9603,0.0,0.0,0.0,,,,,9001,,,,,,,1999-10-20 00:00:00,EPSG,EPSG,For many purposes CHTRF95 can be considered to be coincident with WGS 84.,
+1512,Rassadiran to WGS 84 (1),,,,Iran - Taheri refinery site only.,9603,-133.63,-157.5,-158.62,,,,,9001,,,,,,,1999-10-20 00:00:00,Total-Fina,EPSG,Used only for terminal site.,
+1513,FD58 to WGS 84 (1),,,,Iran - Kangan district.,9603,-241.54,-163.64,396.06,,,,,9001,,,,,,,1999-10-20 00:00:00,Total-Fina,EPSG,,
+1514,ED50(ED77) to WGS 84 (1),,,,Iran,9606,-110.33,-97.73,-119.85,0.3423,1.1634,0.2715,0.063,9001,9104,,9202,,,,1999-10-20 00:00:00,National Cartographic Centre of Iran,EPSG,,
+1515,NAD83 to WGS 84 (5),,,,United States (USA),9607,-0.991,1.9072,0.5129,-0.000000125033,-0.000000046785,-0.000000056529,0.0,9001,9101,,9202,,,,1999-11-05 00:00:00, http://www.ngs.noaa.gov/CORS/Derivation.html,EPSG,Strictly between NAD83 and ITRF96(1997.0).  Supersedes NAD83 to WGS 84 (4) (code 1308).,
+1516,La Canoa to WGS 84 (1),,,,Venezuela east - Delta Amacuro; Anzoategui; Bolivar; Monagas; Sucre states.,9603,-273.5,110.6,-357.9,,,,,9001,,,,,,,1999-11-05 00:00:00,"Lagoven; Gonzalez Losano y Rodriguez; \"Determination de los Parametros de Transformacion para el Oriente del Pais\"; VII Venezuelan Geophysical Congress; September 1994.",EPSG,Also used for PSAD56 to WGS 84 transformations.  Parameter values estimated accuracy: � 2.0m;  � 2.7m;  � 1.3m respectively.,
+10101,Alabama CS27 East zone,Alabama East,,,United States (USA) - Alabama - Counties east of 86d 37m West.,9807,30.3,-85.5,,,0.99996,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+10102,Alabama CS27 West zone,Alabama West,,,United States (USA) - Alabama - Counties east of 86d 37m West.,9807,30.0,-87.3,,,0.999933333,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+10131,Alabama CS83 East zone,Alabama East,,,United States (USA) - Alabama - Counties east of 86d 37m West.,9807,30.3,-85.5,,,0.99996,200000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+10132,Alabama CS83 West zone,Alabama West,,,United States (USA) - Alabama - Counties east of 86d 37m West.,9807,30.0,-87.3,,,0.999933333,600000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+10201,Arizona Coordinate System  east zone,Arizona East,,,United States (USA) - Arizona - Apache; Cochise; Gila; Graham; Greenlee and Navajo counties; i.e. east of about 110d 45m West.,9807,31.0,-110.1,,,0.9999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+10202,Arizona Coordinate System Central zone,Arizona Central,,,United States (USA) - Arizona - Coconino; Maricopa; Pima; Pinal; Santa Cruz and Yavapai counties; i.e between about 110d 45m & 113d 20m west,9807,31.0,-111.55,,,0.9999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+10203,Arizona Coordinate System  west zone,Arizona West,,,United States (USA) - Arizona - La Paz; Mohave and Yuma counties; i.e west of about 113d 20m,9807,31.0,-113.45,,,0.999933333,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+10231,Arizona CS83  east zone,Arizona  East,,,United States (USA) - Arizona - counties east of 110d 45m West,9807,31.0,-110.1,,,0.9999,213360.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,State law defines origin in International feet. FE = 700000ft.,95.30  96.29
+10232,Arizona CS83 Central zone,Arizona Central,,,United States (USA) - Arizona - Coconino; Maricopa; Pima; Pinal; Santa Cruz and Yavapai counties; i.e between about 110d 45m & 113d 20m west,9807,31.0,-111.55,,,0.9999,213360.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,State law defines origin in International feet. FE = 700000ft.,95.30  96.29
+10233,Arizona CS83  west zone,Arizona West,,,United States (USA) - Arizona - La Paz; Mohave and Yuma counties; i.e west of about 113d 20m,9807,31.0,-113.45,,,0.999933333,213360.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,State law defines origin in International feet. FE = 700000ft.,95.30  96.29
+10301,Arkansas CS27 North,Arkansas North,,,United States (USA) - Arkansas - counties north of 34d 50m North.,9802,34.2,-92.0,36.14,34.56,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10302,Arkansas CS27 South,Arkansas South,,,United States (USA) - Arkansas - counties south of 34d 50m North.,9802,32.4,-92.0,34.46,33.18,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10331,Arkansas CS83 North zone,Arkansas North,,,United States (USA) - Arkansas - counties north of 34d 50m North.,9802,34.2,-92.0,36.14,34.56,,400000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10332,Arkansas CS83 South zone,Arkansas South,,,United States (USA) - Arkansas - counties south of 34d 50m North.,9802,32.4,-92.0,34.46,33.18,,400000.0,400000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10401,California CS27 zone I,California zone I,,,United States (USA) - California - counties north of 40deg North.,9802,39.2,-122.0,41.4,40.0,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10402,California CS27 zone II,California zone II,,,United States (USA) - California - counties between 40d & 38d 15m North.,9802,37.4,-122.0,39.5,38.2,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10403,California CS27 zone III,California zone III,,,United States (USA) - California - counties between 38d 15m & 37d North.,9802,36.3,-120.3,38.26,37.04,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10404,California CS27 zone IV,California zone IV,,,United States (USA) - California - counties between 37d & 35d 30m North.,9802,35.2,-119.0,37.15,36.0,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10405,California CS27 zone V,California zone V,,,United States (USA) - California - counties between 35d 50m & 34d North.,9802,33.3,-118.0,35.28,34.02,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10406,California CS27 zone VI,California zone VI,,,United States (USA) - California - counties south of 34deg North.,9802,32.1,-116.15,33.53,32.47,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10407,California CS27 zone VII,California zone VII,,,United States (USA) - California - Los Angeles.,9802,34.08,-118.2,34.25,33.52,,4186692.58,416926.74,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10431,California CS83 zone 1,California zone 1,,,United States (USA) - California - counties north of 40deg North.,9802,39.2,-122.0,41.4,40.0,,2000000.0,500000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10432,California CS83 zone 2,California zone 2,,,United States (USA) - California - counties between 40d & 38d 15m North.,9802,37.4,-122.0,39.5,38.2,,2000000.0,500000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10433,California CS83 zone 3,California zone 3,,,United States (USA) - California - counties between 38d 15m & 37d North.,9802,36.3,-120.3,38.26,37.04,,2000000.0,500000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10434,California CS83 zone 4,California zone 4,,,United States (USA) - California - counties between 37d & 35d 30m North.,9802,35.2,-119.0,37.15,36.0,,2000000.0,500000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10435,California CS83 zone 5,California zone 5,,,United States (USA) - California - counties between 35d 50m & 34d North.,9802,33.3,-118.0,35.28,34.02,,2000000.0,500000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10436,California CS83 zone 6,California zone 6,,,United States (USA) - California - counties south of 34deg North.,9802,32.1,-116.15,33.53,32.47,,2000000.0,500000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10501,Colorado CS27 North zone,Colorado North,,,United States (USA) - Colorado - counties north of 39d 50m North.,9802,39.2,-105.3,39.43,40.47,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10502,Colorado CS27 Central zone,Colorado Central,,,United States (USA) - Colorado - counties between 39d 50m & 38d 30m North.,9802,37.5,-105.3,39.45,38.27,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10503,Colorado CS27 South zone,Colorado South,,,United States (USA) - Colorado - counties south of 38d 30m North.,9802,36.4,-105.3,38.26,37.14,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10531,Colorado CS83 North zone,Colorado North,,,United States (USA) - Colorado - counties north of 39d 50m North.,9802,39.2,-105.3,40.47,39.43,,914401.8289,304800.6096,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10532,Colorado CS83 Central zone,Colorado Central,,,United States (USA) - Colorado - counties between 39d 50m & 38d 30m North.,9802,37.5,-105.3,39.45,38.27,,914401.8289,304800.6096,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10533,Colorado CS83 South zone,Colorado South,,,United States (USA) - Colorado - counties south of 38d 30m North.,9802,36.4,-105.3,38.26,37.14,,914401.8289,304800.6096,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10600,Connecticut CS27,Connecticut,,,United States (USA) - Connecticut.,9802,40.5,-72.45,41.52,41.12,,600000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10630,Connecticut CS83,Connecticut,,,United States (USA) - Connecticut.,9802,40.5,-72.45,41.52,41.12,,304800.6096,152400.3048,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+10700,Delaware CS27,Delaware,,,United States (USA) - Delaware.,9807,38.0,-75.25,,,0.999995,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+10730,Delaware CS83,Delaware,,,United States (USA) - Delaware.,9807,38.0,-75.25,,,0.999995,200000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+10901,Florida CS27 East zone,Florida East,,,United States (USA) - Florida - counties east of 81d 45m West.,9807,24.2,-81.0,,,0.999941177,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+10902,Florida CS27 West zone,Florida West,,,United States (USA) - Florida - counties west of 81d 45m West & south of 29d 30m North.,9807,24.2,-82.0,,,0.999941177,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+10903,Florida CS27 North zone,Florida North,,,United States (USA) - Florida - north of 29d 30m North & west of 82d West.,9802,29.0,-84.3,30.45,29.35,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+10931,Florida CS83 East zone,Florida  East,,,United States (USA) - Florida - counties east of 81d 45m West.,9807,24.2,-81.0,,,0.999941177,200000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+10932,Florida CS83 West zone,Florida  West,,,United States (USA) - Florida - counties west of 81d 45m West & south of 29d 30m North.,9807,24.2,-82.0,,,0.999941177,200000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+10933,Florida CS83 North zone,Florida North,,,United States (USA) - Florida - north of 29d 30m North & west of 82d West.,9802,29.0,-84.3,30.45,29.35,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+11001,Georgia CS27 East zone,Georgia East,,,United States (USA) - Georgia - counties east of 83d 15m West.,9807,30.0,-82.1,,,0.9999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11002,Georgia CS27 West zone,Georgia West,,,United States (USA) - Georgia - counties west of 83d 15m West.,9807,30.0,-84.1,,,0.9999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11031,Georgia CS83 East zone,Georgia  East,,,United States (USA) - Georgia - counties east of 83d 15m West.,9807,30.0,-82.1,,,0.9999,200000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11032,Georgia CS83 West zone,Georgia West,,,United States (USA) - Georgia - counties west of 83d 15m West.,9807,30.0,-84.1,,,0.9999,700000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11101,Idaho CS27 East zone,Idaho East,,,United States (USA) - Idaho - counties east of 113d West.,9807,41.4,-112.1,,,0.999947368,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11102,Idaho CS27 Central zone,Idaho Central,,,United States (USA) - Idaho - counties between 113d & 115d West.,9807,41.4,-114.0,,,0.999947368,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11103,Idaho CS27 West zone,Idaho West,,,United States (USA) - Idaho - counties west of 115d West.,9807,41.4,-115.45,,,0.999933333,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11131,Idaho CS83 East zone,Idaho  East,,,United States (USA) - Idaho - counties east of 113d West.,9807,41.4,-112.1,,,0.999947368,200000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11132,Idaho CS83 Central zone,Idaho  Central,,,United States (USA) - Idaho - counties between 113d & 115d West.,9807,41.4,-114.0,,,0.999947368,500000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11133,Idaho CS83 West zone,Idaho  West,,,United States (USA) - Idaho - counties west of 115d West.,9807,41.4,-115.45,,,0.999933333,800000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11201,Illinois CS27 East zone,Illinois East,,,United States (USA) - Illinois - counties east of 89d 05m West.,9807,36.4,-88.2,,,0.999975,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11202,Illinois CS27 West zone,Illinois West,,,United States (USA) - Illinois - counties west of 89d 05m West.,9807,36.4,-90.1,,,0.999941177,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11231,Illinois CS83 East zone,Illinois  East,,,United States (USA) - Illinois - counties east of 89d 05m West.,9807,36.4,-88.2,,,0.999975,300000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11232,Illinois CS83 West zone,Illinois  West,,,United States (USA) - Illinois - counties west of 89d 05m West.,9807,36.4,-90.1,,,0.999941177,700000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11301,Indiana CS27 East zone,Indiana East,,,United States (USA) - Indiana - counties east of 86d 25m West.,9807,37.3,-85.4,,,0.999966667,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11302,Indiana CS27 West zone,Indiana West,,,United States (USA) - Indiana - counties west of 86d 25m West.,9807,37.3,-87.05,,,0.999966667,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11331,Indiana CS83 East zone,Indiana  East,,,United States (USA) - Indiana - counties east of 86d 25m West.,9807,37.3,-85.4,,,0.999966667,100000.0,250000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11332,Indiana CS83 West zone,Indiana  West,,,United States (USA) - Indiana - counties west of 86d 25m West.,9807,37.3,-87.05,,,0.999966667,900000.0,250000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11401,Iowa CS27 North zone,Iowa North,,,United States (USA) - Iowa - counties north of 42deg North.,9802,41.3,-93.3,43.16,42.04,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+11402,Iowa CS27 South zone,Iowa South,,,United States (USA) - Iowa - counties south of 42deg North.,9802,40.0,-93.3,41.47,40.37,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+11431,Iowa CS83 North zone,Iowa North,,,United States (USA) - Iowa - counties north of 42deg North.,9802,41.3,-93.3,43.16,42.04,,1500000.0,1000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+11432,Iowa CS83 South zone,Iowa South,,,United States (USA) - Iowa - counties south of 42deg North.,9802,40.0,-93.3,41.47,40.37,,500000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+11501,Kansas CS27 North zone,Kansas North,,,United States (USA) - Kansas - counties north of 38d 45m North.,9802,38.2,-98.0,39.47,38.43,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+11502,Kansas CS27 South zone,Kansas South,,,United States (USA) - Kansas - counties south of 38d 45m North.,9802,36.4,-98.3,38.34,37.16,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+11531,Kansas CS83 North zone,Kansas North,,,United States (USA) - Kansas - counties north of 38d 45m North.,9802,38.2,-98.0,39.47,38.43,,400000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+11532,Kansas CS83 South zone,Kansas South,,,United States (USA) - Kansas - counties south of 38d 45m North.,9802,36.4,-98.3,38.34,37.16,,400000.0,400000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+11601,Kentucky CS27 North zone,Kentucky North,,,United States (USA) - Kentucky - counties north of 37d 55m North.,9802,37.3,-84.15,37.58,38.58,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+11602,Kentucky CS27 South zone,Kentucky South,,,United States (USA) - Kentucky - counties south of 37d 55m North.,9802,36.2,-85.45,36.44,37.56,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+11631,Kentucky CS83 North zone,Kentucky North,,,United States (USA) - Kentucky - counties north of 37d 55m North.,9802,37.3,-84.15,37.58,37.58,,500000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+11632,Kentucky CS83 South zone,Kentucky South,,,United States (USA) - Kentucky - counties south of 37d 55m North.,9802,36.2,-85.45,37.56,36.44,,500000.0,500000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+11701,Louisiana CS27 North zone,Louisiana North,,,United States (USA) - Louisiana - counties north of 30d 55m North.,9802,30.4,-92.3,31.1,32.4,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+11702,Louisiana CS27 South zone,Louisiana South,,,United States (USA) - Louisiana - counties south of 30d 55m North. Also Gulf of Mexico LA shelf.,9802,28.4,-91.2,29.18,30.42,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+11731,Louisiana CS83 North zone,Louisiana North,,,United States (USA) - Louisiana - counties north of 30d 55m North.,9802,30.3,-92.3,32.4,31.1,,1000000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+11732,Louisiana CS83 South zone,Louisiana South,,,United States (USA) - Louisiana - counties south of 30d 55m North.,9802,28.3,-91.2,30.42,29.18,,1000000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+11801,Maine CS27 East zone,Maine East,,,United States (USA) - Maine - counties east of 69d 30m West.,9807,43.5,-68.3,,,0.9999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11802,Maine CS27 West zone,Maine West,,,United States (USA) - Maine - counties west of 69d 30m West.,9807,42.5,-70.1,,,0.999966667,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+11831,Maine CS83 East zone,Maine  East,,,United States (USA) - Maine - counties east of 69d 30m West.,9807,43.4,-68.3,,,0.9999,300000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11832,Maine CS83 West zone,Maine  West,,,United States (USA) - Maine - counties west of 69d 30m West.,9807,42.5,-70.1,,,0.999966667,900000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+11900,Maryland CS27,Maryland,,,United States (USA) - Maryland.,9802,37.5,-77.0,38.18,39.27,,800000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+11930,Maryland CS83,Maryland,,,United States (USA) - Maryland.,9802,37.4,-77.0,39.27,38.18,,400000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12001,Massachusetts CS27 Mainland zone,Massachusetts Mainland,,,United States (USA) - Massachusetts onshore.,9802,41.0,-71.3,41.43,42.41,,600000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+12002,Massachusetts CS27 Island zone,Massachusetts Island,,,United States (USA) - Massachusetts islands.,9802,41.0,-70.3,41.17,41.29,,200000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+12031,Massachusetts CS83 Mainland zone,Massachusetts Mainland,,,United States (USA) - Massachusetts onshore.,9802,41.0,-71.3,42.41,41.43,,200000.0,750000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12032,Massachusetts CS83 Island zone,Massachusetts Island,,,United States (USA) - Massachusetts islands.,9802,41.0,-70.3,41.29,41.17,,500000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12101,Michigan State Plane East zone,Michigan East,,,United States (USA) - Michigan.,9807,41.3,-83.4,,,0.999942857,500000.0,0.0,9003,9110,8901,,,,,1998-11-11 00:00:00,USGS Professional Paper #1395,EPSG,Obsolete. Superseded by north central and south zones.,95.30  96.29  98.22
+12102,Michigan State Plane Old Central zone,Michigan Old Central,,,United States (USA) - Michigan.,9807,41.3,-85.45,,,0.999909091,500000.0,0.0,9003,9110,8901,,,,,1998-11-11 00:00:00,USGS Professional Paper #1395,EPSG,Obsolete. Superseded by north central and south zones.,95.30  96.29  98.22
+12103,Michigan State Plane West zone,Michigan West,,,United States (USA) - Michigan.,9807,41.3,-88.45,,,0.999909091,500000.0,0.0,9003,9110,8901,,,,,1998-11-11 00:00:00,USGS Professional Paper #1395,EPSG,Obsolete. Superseded by north central and south zones.,95.30  96.29  98.22
+12111,Michigan CS27 North zone,Michigan North,,,United States (USA) - Michigan - counties north of 45d 45m North.,9802,44.47,-87.0,45.29,47.05,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.28  96.29  98.22  99.28
+12112,Michigan CS27 Central zone,Michigan Central,,,United States (USA) - Michigan - counties between 45d 45m & 43d 55m North.,9802,43.19,-84.2,44.11,45.42,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.28  96.29  98.22  99.28
+12113,Michigan CS27 South zone,Michigan South,,,United States (USA) - Michigan - counties south of 43d 55m North.,9802,41.3,-84.2,42.06,43.4,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.28  96.29  98.22  99.28
+12141,Michigan CS83 North zone,Michigan North,,,United States (USA) - Michigan - counties north of 45d 45m North.,9802,44.47,-87.0,47.05,45.29,,8000000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12142,Michigan CS83 Central zone,Michigan Central,,,United States (USA) - Michigan - counties between 45d 45m & 43d 55m North.,9802,43.19,-84.22,45.42,44.11,,6000000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12143,Michigan CS83 South zone,Michigan South,,,United States (USA) - Michigan - counties south of 43d 55m North.,9802,41.3,-84.22,43.4,42.06,,4000000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12201,Minnesota CS27 North zone,Minnesota North,,,United States (USA) - Minnesota - counties north of 47d 10m North.,9802,46.3,-93.06,47.02,48.38,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+12202,Minnesota CS27 Central zone,Minnesota Central,,,United States (USA) - Minnesota - counties between 47d 10m & 45d 30m North.,9802,45.0,-94.15,45.37,47.03,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+12203,Minnesota CS27 South zone,Minnesota South,,,United States (USA) - Minnesota - counties south of 45d 30m North.,9802,43.0,-94.0,43.47,45.13,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+12231,Minnesota CS83 North zone,Minnesota North,,,United States (USA) - Minnesota - counties north of 47d 10m North.,9802,46.3,-93.06,48.38,47.02,,800000.0,100000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12232,Minnesota CS83 Central zone,Minnesota Central,,,United States (USA) - Minnesota - counties between 47d 10m & 45d 30m North.,9802,45.0,-94.15,47.03,45.37,,800000.0,100000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12233,Minnesota CS83 South zone,Minnesota South,,,United States (USA) - Minnesota - counties south of 45d 30m North.,9802,43.0,-94.0,45.13,43.47,,800000.0,100000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12301,Mississippi CS27 East zone,Mississippi East,,,United States (USA) - Mississippi - counties east of 89d 40m West.,9807,29.4,-88.5,,,0.99996,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+12302,Mississippi CS27 West zone,Mississippi West,,,United States (USA) - Mississippi - counties west of 89d 40m West.,9807,30.3,-90.2,,,0.999941177,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+12331,Mississippi CS83 East zone,Mississippi East,,,United States (USA) - Mississippi - counties east of 89d 40m West.,9807,29.3,-88.5,,,0.99995,300000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+12332,Mississippi CS83 West zone,Mississippi West,,,United States (USA) - Mississippi - counties west of 89d 40m West.,9807,29.3,-90.2,,,0.99995,700000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+12401,Missouri CS27 East zone,Missouri East,,,United States (USA) - Missouri - counties east of 91d 45m West.,9807,35.5,-90.3,,,0.999933333,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.18  95.30  96.29
+12402,Missouri CS27 Central zone,Missouri Central,,,United States (USA) - Missouri - counties between 91d 45m & 93d 35m West.,9807,35.5,-92.3,,,0.999933333,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+12403,Missouri CS27 West zone,Missouri West,,,United States (USA) - Missouri - counties west of 93d 35m West.,9807,36.1,-94.3,,,0.999941177,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+12431,Missouri CS83 East zone,Missouri  East,,,United States (USA) - Missouri - counties east of 91d 45m West..,9807,35.5,-90.3,,,0.999933333,250000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+12432,Missouri CS83 Central zone,Missouri Central,,,United States (USA) - Missouri - counties between 91d 45m & 93d 35m West,9807,35.5,-92.3,,,0.999933333,500000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+12433,Missouri CS83 West zone,Missouri  West,,,United States (USA) - Missouri - counties west of 93d 35m West.,9807,36.1,-94.3,,,0.999941177,850000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+12501,Montana CS27 North zone,Montana North,,,United States (USA) - Montana - counties north of 47d 50m North.,9802,47.0,-109.3,48.43,47.51,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+12502,Montana CS27 Central zone,Montana Central,,,United States (USA) - Montana - counties between 47d 50m & 46d 40m North.,9802,45.5,-109.3,47.53,46.27,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+12503,Montana CS27 South zone,Montana South,,,United States (USA) - Montana - counties south of 46d 40m North.,9802,44.0,-109.3,46.24,44.52,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+12530,Montana CS83,Montana,,,United States (USA) - Montana.,9802,44.15,-109.3,49.0,45.0,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12601,Nebraska CS27 North zone,Nebraska North,,,United States - Nebraska -Antelope; Blaine; Box Butte; Boyd; Brown; Burt; Cedar; Cherry; Cuming; Dakota; Dawes; Dixon; Garfield; Grant; Holt; Hooker; Keya Paha; Knox; Loup; Madison; Pierce; Rock; Sheridan; Sioux; Stanton; Thomas; Thurston; Wayne; Wheeler,9802,41.2,-100.0,41.51,42.49,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+12602,Nebraska CS27 South zone,Nebraska South,,,"United States (USA) - Nebraska - counties south of and including Scotts Bluff; Morrill; Garden; Arthur; McPherson; Logan; Custer; Valley; Greeley; Boome, Platte; Colfax; Dodge; Washington.",9802,39.4,-99.3,40.17,41.43,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+12630,Nebraska CS83,Nebraska,,,United States (USA) - Nebraska.,9802,39.5,-100.0,43.0,40.0,,500000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+12701,Nevada CS27 East zone,Nevada East,,,United States (USA) - Nevada - counties east of 116d  West & Eureka county.,9807,34.45,-115.35,,,0.9999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+12702,Nevada CS27 Central zone,Nevada Central,,,United States (USA) - Nevada - Lander & Nye counties.,9807,34.45,-116.4,,,0.9999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+12703,Nevada CS27 West zone,Nevada West,,,United States (USA) - Nevada - counties west of 117d 15m West.,9807,34.45,-118.35,,,0.9999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+12731,Nevada CS83 East zone,Nevada  East,,,United States (USA) - Nevada - counties east of 116d  West & Eureka county.,9807,34.45,-115.35,,,0.9999,200000.0,8000000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+12732,Nevada CS83 Central zone,Nevada Central,,,United States (USA) - Nevada - Lander & Nye counties.,9807,34.45,-116.4,,,0.9999,500000.0,6000000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+12733,Nevada CS83 West zone,Nevada West,,,United States (USA) - Nevada - counties west of 117d 15m West.,9807,34.45,-118.35,,,0.9999,800000.0,4000000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+12800,New Hampshire CS27,New Hampshire,,,United States (USA) - New Hampshire.,9807,42.3,-71.4,,,0.999966667,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+12830,New Hampshire CS83,New Hampshire,,,United States (USA) - New Hampshire.,9807,42.3,-71.4,,,0.999966667,300000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+12900,New Jersey CS27,New Jersey,,,United States (USA) - New Jersey.,9807,38.5,-74.4,,,0.999975,2000000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+12930,New Jersey CS83,New Jersey,,,United States (USA) - New Jersey.,9807,38.5,-74.3,,,0.9999,150000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+13001,New Mexico CS27 East zone,New Mexico East,,,United States (USA) - New Mexico - counties east of 105d West.,9807,31.0,-104.2,,,0.999909091,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+13002,New Mexico CS27 Central zone,New Mexico Central,,,United States (USA) - New Mexico - counties between 105d & 107d 15m West.,9807,31.0,-106.15,,,0.9999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+13003,New Mexico CS27 West zone,New Mexico West,,,United States (USA) - New Mexico - counties west of 107d 15m West.,9807,31.0,-107.5,,,0.999916667,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+13031,New Mexico CS83 East zone,New Mexico East,,,United States (USA) - New Mexico - counties east of 105d West.,9807,31.0,-104.2,,,0.999909091,165000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+13032,New Mexico CS83 Central zone,New Mexico Central,,,United States (USA) - New Mexico - counties between 105d & 107d 15m West.,9807,31.0,-106.15,,,0.9999,500000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+13033,New Mexico CS83 West zone,New Mexico West,,,United States (USA) - New Mexico - counties west of 107d 15m West.,9807,31.0,-107.5,,,0.999916667,830000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+13101,New York CS27 East zone,New York East,,,United States (USA) - New York - counties east of 75d 15m West excluding Long Island.,9807,40.0,-74.2,,,0.999966667,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.18  95.30  96.29
+13102,New York CS27 Central zone,New York Central,,,United States (USA) - New York - counties between 75d 15m & 77d 30m West.,9807,40.0,-76.35,,,0.9999375,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+13103,New York CS27 West zone,New York West,,,United States (USA) - New York - counties west of 77d 30m West.,9807,40.0,-78.35,,,0.9999375,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+13104,New York CS27 Long Island zone,New York Long Island,,,United States (USA) - New York - Long Island.,9802,40.3,-74.0,41.02,40.4,,1000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13131,New York CS83 East zone,New York  East,,,United States (USA) - New York - counties east of 75d 15m West excluding Long Island.,9807,38.5,-74.3,,,0.9999,150000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+13132,New York CS83 Central zone,New York Central,,,United States (USA) - New York - counties between 75d 15m & 77d 30m West.,9807,40.0,-76.35,,,0.9999375,250000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+13133,New York CS83 West zone,New York  West,,,United States (USA) - New York - counties west of 77d 30m West.,9807,40.0,-78.35,,,0.9999375,350000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+13134,New York CS83 Long Island zone,New York Long Island,,,United States (USA) - New York - Long Island.,9802,40.1,-74.0,41.02,40.4,,300000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13200,North Carolina CS27,North Carolina,,,United States (USA) - North Carolina.,9802,33.45,-79.0,34.2,36.1,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13230,North Carolina CS83,North Carolina,,,United States (USA) - North Carolina.,9802,33.45,-79.0,36.1,34.2,,609601.22,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13301,North Dakota CS27 North zone,North Dakota North,,,United States (USA) - North Dakota - counties north of 47d 25m North.,9802,47.0,-100.3,47.26,48.44,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13302,North Dakota CS27 South zone,North Dakota South,,,United States (USA) - North Dakota - counties south of 47d 25m North.,9802,45.4,-100.3,46.11,47.29,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13331,North Dakota CS83 North zone,North Dakota North,,,United States (USA) - North Dakota - counties north of 47d 25m North.,9802,47.0,-100.3,48.44,47.26,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13332,North Dakota CS83 South zone,North Dakota South,,,United States (USA) - North Dakota - counties south of 47d 25m North.,9802,45.4,-100.3,47.29,46.11,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13401,Ohio CS27 North zone,Ohio North,,,United States (USA) - Ohio - counties north of 40d 15m North.,9802,39.4,-82.3,40.26,41.42,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13402,Ohio CS27 South zone,Ohio South,,,United States (USA) - Ohio - counties south of 40d 15m North.,9802,38.0,-82.3,38.44,40.02,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13431,Ohio CS83 North zone,Ohio North,,,United States (USA) - Ohio - counties north of 40d 15m North.,9802,39.4,-82.3,41.42,40.26,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13432,Ohio CS83 South zone,Ohio South,,,United States (USA) - Ohio - counties south of 40d 15m North.,9802,38.0,-82.3,40.02,38.44,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13501,Oklahoma CS27 North zone,Oklahoma North,,,United States (USA) - Oklahoma - counties north of 35d 20m North.,9802,35.0,-98.0,35.34,36.46,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13502,Oklahoma CS27 South zone,Oklahoma South,,,United States (USA) - Oklahoma - counties south of 35d 20m North.,9802,33.2,-98.0,33.56,35.14,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13531,Oklahoma CS83 North zone,Oklahoma North,,,United States (USA) - Oklahoma - counties north of 35d 20m North.,9802,35.0,-98.0,36.46,35.34,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13532,Oklahoma CS83 South zone,Oklahoma South,,,United States (USA) - Oklahoma - counties south of 35d 20m North.,9802,33.2,-98.0,35.14,33.56,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13601,Oregon CS27 North zone,Oregon North,,,United States (USA) - Oregon - counties north of 44d 15m North.,9802,43.4,-120.3,44.2,46.0,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13602,Oregon CS27 South zone,Oregon South,,,United States (USA) - Oregon - counties south of 44d 15m North.,9802,41.4,-120.3,42.2,44.0,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13631,Oregon CS83 North zone,Oregon North,,,United States (USA) - Oregon - counties north of 44d 15m North.,9802,43.4,-120.3,46.0,44.2,,2500000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13632,Oregon CS83 South zone,Oregon South,,,United States (USA) - Oregon - counties south of 44d 15m North.,9802,41.4,-120.3,44.0,42.2,,1500000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13701,Pennsylvania CS27 North zone,Pennsylvania North,,,United States (USA) - Pennsylvania - counties north of 40d 50m North.,9802,40.1,-77.45,40.53,41.57,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13702,Pennsylvania CS27 South zone,Pennsylvania South,,,United States (USA) - Pennsylvania - counties south of 40d 50m North.,9802,39.2,-77.45,39.56,40.48,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13731,Pennsylvania CS83 North zone,Pennsylvania North,,,United States (USA) - Pennsylvania - counties north of 40d 50m North.,9802,40.1,-77.45,41.57,40.53,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13732,Pennsylvania CS83 South zone,Pennsylvania South,,,United States (USA) - Pennsylvania - counties south of 40d 50m North.,9802,39.2,-77.45,40.58,39.56,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+13800,Rhode Island CS27,Rhode Island,,,United States (USA) - Rhode Island.,9807,41.05,-71.3,,,0.9999938,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+13830,Rhode Island CS83,Rhode Island,,,United States (USA) - Rhode Island.,9807,41.05,-71.3,,,0.99999375,100000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+13901,South Carolina CS27 North zone,South Carolina North,,,United States (USA) - South Carolina counties north of and including Edgefield; Saluda; Lexington; Calhoun; Sumter; Florence; Marion & Horry.,9802,33.0,-81.0,33.46,34.58,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13902,South Carolina CS27 South zone,South Carolina South,,,United States (USA) - South Carolina - Aiken; Allendale; Bamberg; Barnwell; Beaufort; Berkeley; Charleston; Clarendon; Colleton; Dorchester; Georgetown; Hampton; Jasper; Orangeburg & Williamsburg counties.,9802,31.5,-81.0,32.2,33.4,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+13930,South Carolina CS83,South Carolina,,,United States (USA) - South Carolina.,9802,31.5,-81.0,34.5,32.3,,609600.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14001,South Dakota CS27 North zone,South Dakota North,,,United States (USA) - South Dakota - counties north of 44d 20m North.,9802,43.5,-100.0,44.25,45.41,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14002,South Dakota CS27 South zone,South Dakota South,,,United States (USA) - South Dakota - counties south of 44d 20m North.,9802,42.2,-100.2,42.5,44.24,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14031,South Dakota CS83 North zone,South Dakota North,,,United States (USA) - South Dakota - counties north of 44d 20m North.,9802,43.5,-100.0,45.41,44.25,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14032,South Dakota CS83 South zone,South Dakota South,,,United States (USA) - South Dakota - counties south of 44d 20m North.,9802,42.2,-100.2,44.24,42.5,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14100,Tennessee CS27,Tennessee,,,United States (USA) - Tennessee.,9802,34.4,-86.0,35.15,36.25,,100000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14130,Tennessee CS83,Tennessee,,,United States (USA) - Tennessee.,9802,34.2,-86.0,36.25,35.15,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14201,Texas CS27 North zone,Texas North,,,United States (USA) - Texas - counties north of 34d 20m North.,9802,34.0,-101.3,34.39,36.11,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14202,Texas CS27 North Central zone,Texas North Central,,,United States (USA) - Texas - counties between 34d 20m & 32deg North.,9802,31.4,-97.3,32.08,33.58,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14203,Texas CS27 Central zone,Texas Central,,,United States (USA) - Texas - counties between 32deg & 30d 10m North.,9802,29.4,-100.2,30.07,31.53,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14204,Texas CS27 South Central zone,Texas South Central,,,United States (USA) - Texas - counties between 30d 10m & 28d 05m North.,9802,27.5,-99.0,28.23,30.17,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14205,Texas CS27 South zone,Texas South,,,United States (USA) - Texas - counties south of 28d 05m North.,9802,25.4,-98.3,26.1,27.5,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14231,Texas CS83 North zone,Texas North,,,United States (USA) - Texas - counties north of 34d 20m North.,9802,34.0,-101.3,36.11,34.39,,200000.0,1000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14232,Texas CS83 North Central zone,Texas North Central,,,United States (USA) - Texas - counties between 34d 20m & 32deg North.,9802,31.4,-98.3,33.58,32.08,,600000.0,2000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14233,Texas CS83 Central zone,Texas Central,,,United States (USA) - Texas - counties between 32deg & 30d 10m North.,9802,29.4,-100.2,31.53,30.07,,700000.0,3000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14234,Texas CS83 South Central zone,Texas South Central,,,United States (USA) - Texas - counties between 30d 10m & 28d 05m North.,9802,27.5,-99.0,30.17,28.23,,600000.0,4000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14235,Texas CS83 South zone,Texas South,,,United States (USA) - Texas - counties south of 28d 05m North.,9802,25.4,-98.3,27.5,26.1,,300000.0,5000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14301,Utah CS27 North zone,Utah North,,,United States (USA) - Utah - counties north of 40d 50m North.,9802,40.2,-111.3,40.43,41.47,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14302,Utah CS27 Central zone,Utah Central,,,United States (USA) - Utah - counties between 40d 50m & 38d 30m North.,9802,38.2,-111.3,39.01,40.39,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14303,Utah CS27 South zone,Utah South,,,United States (USA) - Utah - counties south of 38d 30m North.,9802,36.4,-111.3,37.13,38.21,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14331,Utah CS83 North zone,Utah North,,,United States (USA) - Utah - counties north of 40d 50m North.,9802,40.2,-111.3,41.47,40.43,,500000.0,1000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14332,Utah CS83 Central zone,Utah Central,,,United States (USA) - Utah - counties between 40d 50m & 38d 30m North.,9802,38.2,-111.3,40.39,39.01,,500000.0,2000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14333,Utah CS83 South zone,Utah South,,,United States (USA) - Utah - counties south of 38d 30m North.,9802,36.4,-111.3,38.21,37.13,,500000.0,3000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14400,Vermont CS27,Vermont,,,United States (USA) - Vermont.,9807,42.3,-72.3,,,0.999964286,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+14430,Vermont CS83,Vermont,,,United States (USA) - Vermont.,9807,42.3,-72.3,,,0.999964286,500000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+14501,Virginia CS27 North zone,Virginia North,,,United States (USA) - Virginia - counties north of 38d 05m North.,9802,37.4,-78.3,38.02,39.12,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14502,Virginia CS27 South zone,Virginia South,,,United States (USA) - Virginia - counties south of 38d 05m North.,9802,36.2,-78.3,36.46,37.58,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14531,Virginia CS83 North zone,Virginia North,,,United States (USA) - Virginia - counties north of 38d 05m North.,9802,37.4,-78.3,39.12,38.02,,3500000.0,2000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14532,Virginia CS83 South zone,Virginia South,,,United States (USA) - Virginia - counties south of 38d 05m North.,9802,36.2,-78.3,37.58,36.46,,3500000.0,1000000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14601,Washington CS27 North zone,Washington North,,,United States (USA) - Washington - counties north of 47d 30m North.,9802,47.0,-120.5,47.3,48.44,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14602,Washington CS27 South zone,Washington South,,,United States (USA) - Washington - counties south of 47d 30m North.,9802,45.2,-120.3,45.5,47.2,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14631,Washington CS83 North zone,Washington North,,,United States (USA) - Washington - counties north of 47d 30m North.,9802,47.0,-120.5,48.44,47.3,,500000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14632,Washington CS83 South zone,Washington South,,,United States (USA) - Washington - counties south of 47d 30m North.,9802,45.2,-120.3,47.2,45.5,,500000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14701,West Virginia CS27 North zone,West Virginia North,,,United States (USA) - West Virginia - counties north of 39deg North.,9802,38.3,-79.3,39.0,40.15,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14702,West Virginia CS27 South zone,West Virginia South,,,United States (USA) - West Virginia - counties south of 39deg North.,9802,37.0,-81.0,37.29,38.53,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14731,West Virginia CS83 North zone,West Virginia North,,,United States (USA) - West Virginia - counties north of 39deg North.,9802,38.3,-79.3,40.15,39.0,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14732,West Virginia CS83 South zone,West Virginia South,,,United States (USA) - West Virginia - counties south of 39deg North.,9802,37.0,-81.0,38.53,37.29,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14801,Wisconsin CS27 North zone,Wisconsin North,,,United States (USA) - Wisconsin - counties north of 45d 35m North.,9802,45.1,-90.0,45.34,46.46,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14802,Wisconsin CS27 Central zone,Wisconsin Central,,,United States (USA) - Wisconsin - counties between 45d 35m & 44d 15m North.,9802,43.5,-90.0,44.15,45.3,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14803,Wisconsin CS27 South zone,Wisconsin South,,,United States (USA) - Wisconsin - counties south of 44d 15m North.,9802,42.0,-90.0,42.44,44.04,,2000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+14831,Wisconsin CS83 North zone,Wisconsin North,,,United States (USA) - Wisconsin - counties north of 45d 35m North.,9802,45.1,-90.0,46.46,45.34,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14832,Wisconsin CS83 Central zone,Wisconsin Central,,,United States (USA) - Wisconsin - counties between 45d 35m & 44d 15m North.,9802,43.5,-90.0,45.3,44.15,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14833,Wisconsin CS83 South zone,Wisconsin South,,,United States (USA) - Wisconsin - counties south of 44d 15m North.,9802,42.0,-90.0,44.04,42.44,,600000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+14901,Wyoming CS27 East zone,Wyoming East,,,United States (USA) - Wyoming - counties east of 106d West.,9807,40.4,-105.1,,,0.999941177,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+14902,Wyoming CS27 East Central zone,Wyoming East Central,,,United States (USA) - Wyoming - counties between 106d & 108d 10m West.,9807,40.4,-107.2,,,0.999941177,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+14903,Wyoming CS27 West Central zone,Wyoming West Central,,,United States (USA) - Wyoming - counties between 108d 10m & 109d 40m West.,9807,40.4,-108.45,,,0.999941177,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+14904,Wyoming CS27 West zone,Wyoming West,,,United States (USA) - Wyoming - counties west of 109d 40m West.,9807,40.4,-110.05,,,0.999941177,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+14931,Wyoming CS83 East zone,Wyoming East,,,United States (USA) - Wyoming - counties east of 106d West.,9807,40.3,-105.1,,,0.9999375,200000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+14932,Wyoming CS83 East Central zone,Wyoming East Central,,,United States (USA) - Wyoming - counties between 106d & 108d 10m West.,9807,40.3,-107.2,,,0.9999375,400000.0,100000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+14933,Wyoming CS83 West Central zone,Wyoming West Central,,,United States (USA) - Wyoming - counties between 108d 10m & 109d 40m West.,9807,40.3,-108.45,,,0.9999375,600000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+14934,Wyoming CS83 West zone,Wyoming West,,,United States (USA) - Wyoming - counties west of 109d 40m West.,9807,40.3,-110.05,,,0.9999375,800000.0,100000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15001,Alaska CS27 zone 1,Alaska zone 1,,,United States (USA) - Alaska - east of 141 deg West; i.e. Panhandle.,9812,57.0,-133.4,323.07483685,323.07483685,0.9999,16404166.67,-16404166.67,9003,9110,8901,,,,,1997-04-11 00:00:00,USGS Professional Paper #1395,EPSG,,96.29  97.08
+15002,Alaska CS27 zone 2,Alaska zone 2,,,United States (USA) - Alaska - 141deg to 144deg West.,9807,54.0,-142.0,,,0.9999,500000.0,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15003,Alaska CS27 zone 3,Alaska zone 3,,,United States (USA) - Alaska - 144deg to 148deg West excluding Kenai Peninsula; Perry Is. and Esther Is.,9807,54.0,-146.0,,,0.9999,500000.0,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15004,Alaska CS27 zone 4,Alaska zone 4,,,United States (USA) - Alaska - 148deg to 152deg West.,9807,54.0,-150.0,,,0.9999,500000.0,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15005,Alaska CS27 zone 5,Alaska zone 5,,,United States (USA) - Alaska - 152deg to 156deg West.,9807,54.0,-154.0,,,0.9999,500000.0,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15006,Alaska CS27 zone 6,Alaska zone 6,,,United States (USA) - Alaska - 156deg to 160deg West.,9807,54.0,-158.0,,,0.9999,500000.0,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15007,Alaska CS27 zone 7,Alaska zone 7,,,United States (USA) - Alaska - 160deg to 164deg West.,9807,54.0,-162.0,,,0.9999,700000.0,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15008,Alaska CS27 zone 8,Alaska zone 8,,,United States (USA) - Alaska - 164deg to 168deg West north of 54d 30m North.,9807,54.0,-166.0,,,0.9999,500000.0,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15009,Alaska CS27 zone 9,Alaska zone 9,,,United States (USA) - Alaska - west of 168deg West and north of 54d 30m North.,9807,54.0,-170.0,,,0.9999,600000.0,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15010,Alaska CS27 zone 10,Alaska zone 10,,,United States (USA) - Alaska - Aleutian Islands.,9802,51.0,-176.0,53.5,51.5,,3000000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+15031,Alaska CS83 zone 1,Alaska zone 1,,,United States (USA) - Alaska - east of 141 deg West; i.e. Panhandle.,9812,57.0,-133.4,323.07483685,323.07483685,0.9999,5000000.0,-5000000.0,9001,9110,8901,,,,,1996-09-12 00:00:00,NOAA manual NOS NGS 5,EPSG,,96.29
+15032,Alaska CS83 zone 2,Alaska zone 2,,,United States (USA) - Alaska - 141deg to 144deg West.,9807,54.0,-142.0,,,0.9999,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15033,Alaska CS83 zone 3,Alaska zone 3,,,United States (USA) - Alaska - 144deg to 148deg West excluding Kenai Peninsula; Perry Is. and Esther Is.,9807,54.0,-146.0,,,0.9999,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15034,Alaska CS83 zone 4,Alaska zone 4,,,United States (USA) - Alaska - 148deg to 152deg West.,9807,54.0,-150.0,,,0.9999,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15035,Alaska CS83 zone 5,Alaska zone 5,,,United States (USA) - Alaska - 152deg to 156deg West.,9807,54.0,-154.0,,,0.9999,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15036,Alaska CS83 zone 6,Alaska zone 6,,,United States (USA) - Alaska - 156deg to 160deg West.,9807,54.0,-158.0,,,0.9999,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15037,Alaska CS83 zone 7,Alaska zone 7,,,United States (USA) - Alaska - 160deg to 164deg West.,9807,54.0,-162.0,,,0.9999,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15038,Alaska CS83 zone 8,Alaska zone 8,,,United States (USA) - Alaska - 164deg to 168deg West north of 54d 30m North.,9807,54.0,-166.0,,,0.9999,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15039,Alaska CS83 zone 9,Alaska zone 9,,,United States (USA) - Alaska - west of 168deg West and north of 54d 30m North.,9807,54.0,-170.0,,,0.9999,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15040,Alaska CS83 zone 10,Alaska zone 10,,,United States (USA) - Alaska - Aleutian Islands.,9802,51.0,-176.0,53.5,51.5,,1000000.0,0.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+15101,Hawaii CS27 zone 1,Hawaii zone 1,,,United States (USA) - Hawaii - island of Hawaii.,9807,18.5,-155.3,,,0.999966667,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15102,Hawaii CS27 zone 2,Hawaii zone 2,,,United States (USA) - Hawaii - Maui; Kahoolawe; Lanai; Molokai.,9807,20.2,-156.4,,,0.999966667,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15103,Hawaii CS27 zone 3,Hawaii zone 3,,,United States (USA) - Hawaii - Oahu.,9807,21.1,-158.0,,,0.99999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15104,Hawaii CS27 zone 4,Hawaii zone 4,,,United States (USA) - Hawaii - Kauai.,9807,21.5,-159.3,,,0.99999,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15105,Hawaii CS27 zone 5,Hawaii zone 5,,,United States (USA) - Hawaii - Niihau.,9807,21.4,-160.1,,,1.0,500000.0,0.0,9003,9110,8901,,,,,1995-12-02 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29
+15131,Hawaii CS83 zone 1,Hawaii  zone 1,,,United States (USA) - Hawaii - island of Hawaii.,9807,18.5,-155.3,,,0.999966667,500000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15132,Hawaii CS83 zone 2,Hawaii  zone 2,,,United States (USA) - Hawaii - Maui; Kahoolawe; Lanai; Molokai.,9807,20.2,-156.4,,,0.999966667,500000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15133,Hawaii CS83 zone 3,Hawaii  zone 3,,,United States (USA) - Hawaii - Oahu.,9807,21.1,-158.0,,,0.99999,500000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15134,Hawaii CS83 zone 4,Hawaii  zone 4,,,United States (USA) - Hawaii - Kauai.,9807,21.5,-159.3,,,0.99999,500000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15135,Hawaii CS83 zone 5,Hawaii  zone 5,,,United States (USA) - Hawaii - Niihau.,9807,21.4,-160.1,,,1.0,500000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29
+15201,Puerto Rico CS27,Puerto Rico,,,Puerto Rico.,9802,17.5,-66.26,18.26,18.02,,500000.0,0.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+15202,St. Croix CS27,St. Croix,,,Virgin Islands of US - St. Croix.,9802,17.5,-66.26,18.26,18.02,,500000.0,100000.0,9003,9110,8901,,,,,1999-04-22 00:00:00,USGS Professional Paper #1395,EPSG,,95.30  96.29  99.28
+15230,Puerto Rico & Virgin Islands CS83,Puerto Rico & Virgin Is.,,,Puerto Rico & Virgin Islands of US,9802,17.5,-66.26,18.26,18.02,,200000.0,200000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,NOAA manual NOS NGS 5,EPSG,,95.30  96.29  99.28
+15914,BLM zone 14N in feet,BLM 14N (feet),,,United States (USA) - Gulf of Mexico - west of 96 deg West approximately.,9807,0.0,-99.0,,,0.9996,1640416.67,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,Minerals Management Service offshore protraction diagrams.,EPSG,"Sometimes locally referred to as \"UTM zone 14\".",95.30  96.29
+15915,BLM zone 15N in feet,BLM 15N (feet),,,United States (USA) - Gulf of Mexico - 96 deg to 90 deg West approximately.,9807,0.0,-93.0,,,0.9996,1640416.67,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,Minerals Management Service offshore protraction diagrams.,EPSG,"Sometimes locally referred to as \"UTM zone 15\".",95.30  96.29
+15916,BLM zone 16N in feet,BLM 16N (feet),,,United States (USA) - Gulf of Mexico - 90 deg to 84 deg West approximately.,9807,0.0,-87.0,,,0.9996,1640416.67,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,Minerals Management Service offshore protraction diagrams.,EPSG,"Sometimes locally referred to as \"UTM zone 16\".",95.27  95.30  96.29
+15917,BLM zone 17N in feet,BLM 17N (feet),,,United States (USA) - Gulf of Mexico - east of 84 deg West approximately.,9807,0.0,-81.0,,,0.9996,1640416.67,0.0,9003,9102,8901,,,,,1995-12-02 00:00:00,Minerals Management Service offshore protraction diagrams.,EPSG,"Sometimes locally referred to as \"UTM zone 17\".",95.30  96.29
+16001,UTM zone 1N,,,,180deg to 174deg West; northern hemisphere.,9807,0.0,-177.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16002,UTM zone 2N,,,,174deg West to 168deg West; northern hemisphere.,9807,0.0,-171.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16003,UTM zone 3N,,,,168deg West to 162deg West; northern hemisphere.,9807,0.0,-165.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16004,UTM zone 4N,,,,162deg West to 156deg West; northern hemisphere.,9807,0.0,-159.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16005,UTM zone 5N,,,,156deg West to 150deg West; northern hemisphere.,9807,0.0,-153.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16006,UTM zone 6N,,,,150deg West to 144deg West; northern hemisphere.,9807,0.0,-147.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16007,UTM zone 7N,,,,144deg West to 138deg West; northern hemisphere.,9807,0.0,-141.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16008,UTM zone 8N,,,,138deg West to 132deg West; northern hemisphere.,9807,0.0,-135.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16009,UTM zone 9N,,,,132deg West to 126deg West; northern hemisphere.,9807,0.0,-129.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16010,UTM zone 10N,,,,130deg West to 120deg West; northern hemisphere.,9807,0.0,-123.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16011,UTM zone 11N,,,,120deg West to 114deg West; northern hemisphere.,9807,0.0,-117.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16012,UTM zone 12N,,,,114deg West to 108deg West; northern hemisphere.,9807,0.0,-111.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16013,UTM zone 13N,,,,108deg West to 102deg West; northern hemisphere.,9807,0.0,-105.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16014,UTM zone 14N,,,,102deg West to 96deg West; northern hemisphere.,9807,0.0,-99.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16015,UTM zone 15N,,,,96deg West to 90deg West; northern hemisphere.,9807,0.0,-93.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16016,UTM zone 16N,,,,90deg West to 84deg West; northern hemisphere.,9807,0.0,-87.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16017,UTM zone 17N,,,,84deg West to 78deg West; northern hemisphere.,9807,0.0,-81.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16018,UTM zone 18N,,,,78deg West to 72deg West; northern hemisphere.,9807,0.0,-75.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16019,UTM zone 19N,,,,72deg West to 66deg West; northern hemisphere.,9807,0.0,-69.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16020,UTM zone 20N,,,,66deg West to 60deg West; northern hemisphere.,9807,0.0,-63.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16021,UTM zone 21N,,,,60deg West to 54deg West; northern hemisphere.,9807,0.0,-57.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16022,UTM zone 22N,,,,54deg West to 48deg West; northern hemisphere.,9807,0.0,-51.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16023,UTM zone 23N,,,,48deg West to 42deg West; northern hemisphere.,9807,0.0,-45.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16024,UTM zone 24N,,,,42deg West to 36deg West; northern hemisphere.,9807,0.0,-39.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16025,UTM zone 25N,,,,36deg West to 30deg West; northern hemisphere.,9807,0.0,-33.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16026,UTM zone 26N,,,,30deg West to 24deg West; northern hemisphere.,9807,0.0,-27.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16027,UTM zone 27N,,,,24deg West to 18deg West; northern hemisphere.,9807,0.0,-21.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16028,UTM zone 28N,,,,18deg West to 12deg West; northern hemisphere.,9807,0.0,-15.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16029,UTM zone 29N,,,,12deg West to 6deg West; northern hemisphere.,9807,0.0,-9.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16030,UTM zone 30N,,,,6deg West to 0deg; northern hemisphere.,9807,0.0,-3.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16031,UTM zone 31N,,,,0deg to 6deg East; northern hemisphere.,9807,0.0,3.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16032,UTM zone 32N,,,,6deg East to 12deg East; northern hemisphere.,9807,0.0,9.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16033,UTM zone 33N,,,,12deg East to 18deg East; northern hemisphere.,9807,0.0,15.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16034,UTM zone 34N,,,,18deg East to 24deg East; northern hemisphere.,9807,0.0,21.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16035,UTM zone 35N,,,,24deg East to 30deg East; northern hemisphere.,9807,0.0,27.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16036,UTM zone 36N,,,,30deg East to 36deg East; northern hemisphere.,9807,0.0,33.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16037,UTM zone 37N,,,,36deg East to 42deg East; northern hemisphere.,9807,0.0,39.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16038,UTM zone 38N,,,,42deg East to 48deg East; northern hemisphere.,9807,0.0,45.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16039,UTM zone 39N,,,,48deg East to 54deg East; northern hemisphere.,9807,0.0,51.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16040,UTM zone 40N,,,,54deg East to 60deg East; northern hemisphere.,9807,0.0,57.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16041,UTM zone 41N,,,,60deg East to 66deg East; northern hemisphere.,9807,0.0,63.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16042,UTM zone 42N,,,,66deg East to 72deg East; northern hemisphere.,9807,0.0,69.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16043,UTM zone 43N,,,,72deg East to 78deg East; northern hemisphere.,9807,0.0,75.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16044,UTM zone 44N,,,,78deg East to 84deg East; northern hemisphere.,9807,0.0,81.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16045,UTM zone 45N,,,,84deg East to 90deg East; northern hemisphere.,9807,0.0,87.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16046,UTM zone 46N,,,,90deg East to 96deg East; northern hemisphere.,9807,0.0,93.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16047,UTM zone 47N,,,,96deg East to 102eg East; northern hemisphere.,9807,0.0,99.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16048,UTM zone 48N,,,,102deg East to 108deg East; northern hemisphere.,9807,0.0,105.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16049,UTM zone 49N,,,,108deg East to 114deg East; northern hemisphere.,9807,0.0,111.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16050,UTM zone 50N,,,,114deg East to 120deg East; northern hemisphere.,9807,0.0,117.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16051,UTM zone 51N,,,,120deg East to 126deg East; northern hemisphere.,9807,0.0,123.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16052,UTM zone 52N,,,,126deg East to 132deg East; northern hemisphere.,9807,0.0,129.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16053,UTM zone 53N,,,,132deg East to 138deg East; northern hemisphere.,9807,0.0,135.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16054,UTM zone 54N,,,,138deg East to 144deg East; northern hemisphere.,9807,0.0,141.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16055,UTM zone 55N,,,,144deg East to 150deg East; northern hemisphere.,9807,0.0,147.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16056,UTM zone 56N,,,,150deg East to 156deg East; northern hemisphere.,9807,0.0,153.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16057,UTM zone 57N,,,,156deg East to 162deg East; northern hemisphere.,9807,0.0,159.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16058,UTM zone 58N,,,,162deg East to 168deg East; northern hemisphere.,9807,0.0,165.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16059,UTM zone 59N,,,,168deg East to 174deg East; northern hemisphere.,9807,0.0,171.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16060,UTM zone 60N,,,,174deg East to 180deg; northern hemisphere.,9807,0.0,177.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16061,Universal Polar Stereographic North,UPS North,,,Northern hemisphere polar area.,9810,90.0,0.0,,,0.994,2000000.0,2000000.0,9001,9102,8901,,,,,1997-06-16 00:00:00,,EPSG,,97.18
+16101,UTM zone 1S,,,,180deg to 174deg West; southern hemisphere.,9807,0.0,-177.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16102,UTM zone 2S,,,,174deg West to 168deg West; southern hemisphere.,9807,0.0,-171.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16103,UTM zone 3S,,,,168deg West to 162deg West; southern hemisphere.,9807,0.0,-165.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16104,UTM zone 4S,,,,162deg West to 156deg West; southern hemisphere.,9807,0.0,-159.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16105,UTM zone 5S,,,,156deg West to 150deg West; southern hemisphere.,9807,0.0,-153.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16106,UTM zone 6S,,,,150deg West to 144deg West; southern hemisphere.,9807,0.0,-147.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16107,UTM zone 7S,,,,144deg West to 138deg West; southern hemisphere.,9807,0.0,-141.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16108,UTM zone 8S,,,,138deg West to 132deg West; southern hemisphere.,9807,0.0,-135.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16109,UTM zone 9S,,,,132deg West to 126deg West; southern hemisphere.,9807,0.0,-129.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16110,UTM zone 10S,,,,130deg West to 120deg West; southern hemisphere.,9807,0.0,-123.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16111,UTM zone 11S,,,,120deg West to 114deg West; southern hemisphere.,9807,0.0,-117.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16112,UTM zone 12S,,,,114deg West to 108deg West; southern hemisphere.,9807,0.0,-111.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16113,UTM zone 13S,,,,108deg West to 102deg West; southern hemisphere.,9807,0.0,-105.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16114,UTM zone 14S,,,,102deg West to 96deg West; southern hemisphere.,9807,0.0,-99.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16115,UTM zone 15S,,,,96deg West to 90deg West; southern hemisphere.,9807,0.0,-93.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16116,UTM zone 16S,,,,90deg West to 84deg West; southern hemisphere.,9807,0.0,-87.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16117,UTM zone 17S,,,,84deg West to 78deg West; southern hemisphere.,9807,0.0,-81.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16118,UTM zone 18S,,,,78deg West to 72deg West; southern hemisphere.,9807,0.0,-75.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16119,UTM zone 19S,,,,72deg West to 66deg West; southern hemisphere.,9807,0.0,-69.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16120,UTM zone 20S,,,,66deg West to 60deg West; southern hemisphere.,9807,0.0,-63.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16121,UTM zone 21S,,,,60deg West to 54deg West; southern hemisphere.,9807,0.0,-57.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16122,UTM zone 22S,,,,54deg West to 48deg West; southern hemisphere.,9807,0.0,-51.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16123,UTM zone 23S,,,,48deg West to 42deg West; southern hemisphere.,9807,0.0,-45.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16124,UTM zone 24S,,,,42deg West to 36deg West; southern hemisphere.,9807,0.0,-39.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16125,UTM zone 25S,,,,36deg West to 30deg West; southern hemisphere.,9807,0.0,-33.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16126,UTM zone 26S,,,,30deg West to 24deg West; southern hemisphere.,9807,0.0,-27.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16127,UTM zone 27S,,,,24deg West to 18deg West; southern hemisphere.,9807,0.0,-21.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16128,UTM zone 28S,,,,18deg West to 12deg West; southern hemisphere.,9807,0.0,-15.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16129,UTM zone 29S,,,,12deg West to 6deg West; southern hemisphere.,9807,0.0,-9.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16130,UTM zone 30S,,,,6deg West to 0deg; southern hemisphere.,9807,0.0,-3.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16131,UTM zone 31S,,,,0deg to 6deg East; southern hemisphere.,9807,0.0,3.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16132,UTM zone 32S,,,,6deg East to 12deg East; southern hemisphere.,9807,0.0,9.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16133,UTM zone 33S,,,,12deg East to 18deg East; southern hemisphere.,9807,0.0,15.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16134,UTM zone 34S,,,,18deg East to 24deg East; southern hemisphere.,9807,0.0,21.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16135,UTM zone 35S,,,,24deg East to 30deg East; southern hemisphere.,9807,0.0,27.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16136,UTM zone 36S,,,,30deg East to 36deg East; southern hemisphere.,9807,0.0,33.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16137,UTM zone 37S,,,,36deg East to 42deg East; southern hemisphere.,9807,0.0,39.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16138,UTM zone 38S,,,,42deg East to 48deg East; southern hemisphere.,9807,0.0,45.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16139,UTM zone 39S,,,,48deg East to 54deg East; southern hemisphere.,9807,0.0,51.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16140,UTM zone 40S,,,,54deg East to 60deg East; southern hemisphere.,9807,0.0,57.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16141,UTM zone 41S,,,,60deg East to 66deg East; southern hemisphere.,9807,0.0,63.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16142,UTM zone 42S,,,,66deg East to 72deg East; southern hemisphere.,9807,0.0,69.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16143,UTM zone 43S,,,,72deg East to 78deg East; southern hemisphere.,9807,0.0,75.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16144,UTM zone 44S,,,,78deg East to 84deg East; southern hemisphere.,9807,0.0,81.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16145,UTM zone 45S,,,,84deg East to 90deg East; southern hemisphere.,9807,0.0,87.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16146,UTM zone 46S,,,,90deg East to 96deg East; southern hemisphere.,9807,0.0,93.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16147,UTM zone 47S,,,,96deg East to 102eg East; southern hemisphere.,9807,0.0,99.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16148,UTM zone 48S,,,,102deg East to 108deg East; southern hemisphere.,9807,0.0,105.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16149,UTM zone 49S,,,,108deg East to 114deg East; southern hemisphere.,9807,0.0,111.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16150,UTM zone 50S,,,,114deg East to 120deg East; southern hemisphere.,9807,0.0,117.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16151,UTM zone 51S,,,,120deg East to 126deg East; southern hemisphere.,9807,0.0,123.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16152,UTM zone 52S,,,,126deg East to 132deg East; southern hemisphere.,9807,0.0,129.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16153,UTM zone 53S,,,,132deg East to 138deg East; southern hemisphere.,9807,0.0,135.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16154,UTM zone 54S,,,,138deg East to 144deg East; southern hemisphere.,9807,0.0,141.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16155,UTM zone 55S,,,,144deg East to 150deg East; southern hemisphere.,9807,0.0,147.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16156,UTM zone 56S,,,,150deg East to 156deg East; southern hemisphere.,9807,0.0,153.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16157,UTM zone 57S,,,,156deg East to 162deg East; southern hemisphere.,9807,0.0,159.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16158,UTM zone 58S,,,,162deg East to 168deg East; southern hemisphere.,9807,0.0,165.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16159,UTM zone 59S,,,,168deg East to 174deg East; southern hemisphere.,9807,0.0,171.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16160,UTM zone 60S,,,,174deg East to 180deg; southern hemisphere.,9807,0.0,177.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.28
+16161,Universal Polar Stereographic South,UPS South,,,Southern hemisphere polar area.,9810,-90.0,0.0,,,0.994,2000000.0,2000000.0,9001,9102,8901,,,,,1997-06-16 00:00:00,,EPSG,,97.18
+16202,Gauss-Kruger zone 2,,,,6deg East to 12deg East; northern hemisphere.,9807,0.0,9.0,,,1.0,2500000.0,0.0,9001,9102,8901,,,,,1998-06-30 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,
+16203,Gauss-Kruger zone 3,,,,12deg East to 18deg East; northern hemisphere.,9807,0.0,15.0,,,1.0,3500000.0,0.0,9001,9102,8901,,,,,1998-06-30 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,
+16204,Gauss-Kruger zone 4,,,,18deg East to 24deg East; northern hemisphere.,9807,0.0,21.0,,,1.0,4500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16205,Gauss-Kruger zone 5,,,,24deg East to 30deg East; northern hemisphere.,9807,0.0,27.0,,,1.0,5500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16206,Gauss-Kruger zone 6,,,,30deg East to 36deg East; northern hemisphere.,9807,0.0,33.0,,,1.0,6500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16207,Gauss-Kruger zone 7,,,,36deg East to 42deg East; northern hemisphere.,9807,0.0,39.0,,,1.0,7500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16208,Gauss-Kruger zone 8,,,,42deg East to 48deg East; northern hemisphere.,9807,0.0,45.0,,,1.0,8500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16209,Gauss-Kruger zone 9,,,,48deg East to 54deg East; northern hemisphere.,9807,0.0,51.0,,,1.0,9500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16210,Gauss-Kruger zone 10,,,,54deg East to 60deg East; northern hemisphere.,9807,0.0,57.0,,,1.0,10500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16211,Gauss-Kruger zone 11,,,,60deg East to 66deg East; northern hemisphere.,9807,0.0,63.0,,,1.0,11500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16212,Gauss-Kruger zone 12,,,,66deg East to 72deg East; northern hemisphere.,9807,0.0,69.0,,,1.0,12500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16213,Gauss-Kruger zone 13,,,,72deg East to 78deg East; northern hemisphere.,9807,0.0,75.0,,,1.0,13500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16214,Gauss-Kruger zone 14,,,,78deg East to 84deg East; northern hemisphere.,9807,0.0,81.0,,,1.0,14500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16215,Gauss-Kruger zone 15,,,,84deg East to 90deg East; northern hemisphere.,9807,0.0,87.0,,,1.0,15500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16216,Gauss-Kruger zone 16,,,,90deg East to 96deg East; northern hemisphere.,9807,0.0,93.0,,,1.0,16500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16217,Gauss-Kruger zone 17,,,,96deg East to 102eg East; northern hemisphere.,9807,0.0,99.0,,,1.0,17500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16218,Gauss-Kruger zone 18,,,,102deg East to 108deg East; northern hemisphere.,9807,0.0,105.0,,,1.0,18500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16219,Gauss-Kruger zone 19,,,,108deg East to 114deg East; northern hemisphere.,9807,0.0,111.0,,,1.0,19500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16220,Gauss-Kruger zone 20,,,,114deg East to 120deg East; northern hemisphere.,9807,0.0,117.0,,,1.0,20500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16221,Gauss-Kruger zone 21,,,,120deg East to 126deg East; northern hemisphere.,9807,0.0,123.0,,,1.0,21500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16222,Gauss-Kruger zone 22,,,,126deg East to 132deg East; northern hemisphere.,9807,0.0,129.0,,,1.0,22500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16223,Gauss-Kruger zone 23,,,,132deg East to 138deg East; northern hemisphere.,9807,0.0,135.0,,,1.0,23500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16224,Gauss-Kruger zone 24,,,,138deg East to 144deg East; northern hemisphere.,9807,0.0,141.0,,,1.0,24500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16225,Gauss-Kruger zone 25,,,,144deg East to 150deg East; northern hemisphere.,9807,0.0,147.0,,,1.0,25500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16226,Gauss-Kruger zone 26,,,,150deg East to 156deg East; northern hemisphere.,9807,0.0,153.0,,,1.0,26500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16227,Gauss-Kruger zone 27,,,,156deg East to 162deg East; northern hemisphere.,9807,0.0,159.0,,,1.0,27500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16228,Gauss-Kruger zone 28,,,,162deg East to 168deg East; northern hemisphere.,9807,0.0,165.0,,,1.0,28500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16229,Gauss-Kruger zone 29,,,,168deg East to 174deg East; northern hemisphere.,9807,0.0,171.0,,,1.0,29500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16230,Gauss-Kruger zone 30,,,,174deg East to 180deg; northern hemisphere.,9807,0.0,177.0,,,1.0,30500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16231,Gauss-Kruger zone 31,,,,180deg to 174deg West; northern hemisphere.,9807,0.0,-177.0,,,1.0,31500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16232,Gauss-Kruger zone 32,,,,174deg West to 168deg West; northern hemisphere.,9807,0.0,-171.0,,,1.0,32500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16302,Gauss-Kruger 2N,,,,6deg East to 12deg East; northern hemisphere.,9807,0.0,9.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1998-06-30 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,
+16303,Gauss-Kruger 3N,,,,12deg East to 18deg East; northern hemisphere.,9807,0.0,15.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1998-06-30 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,
+16304,Gauss-Kruger 4N,,,,18deg East to 24deg East; northern hemisphere.,9807,0.0,21.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16305,Gauss-Kruger 5N,,,,24deg East to 30deg East; northern hemisphere.,9807,0.0,27.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16306,Gauss-Kruger 6N,,,,30deg East to 36deg East; northern hemisphere.,9807,0.0,33.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16307,Gauss-Kruger 7N,,,,36deg East to 42deg East; northern hemisphere.,9807,0.0,39.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16308,Gauss-Kruger 8N,,,,42deg East to 48deg East; northern hemisphere.,9807,0.0,45.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16309,Gauss-Kruger 9N,,,,48deg East to 54deg East; northern hemisphere.,9807,0.0,51.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16310,Gauss-Kruger 10N,,,,54deg East to 60deg East; northern hemisphere.,9807,0.0,57.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16311,Gauss-Kruger 11N,,,,60deg East to 66deg East; northern hemisphere.,9807,0.0,63.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16312,Gauss-Kruger 12N,,,,66deg East to 72deg East; northern hemisphere.,9807,0.0,69.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16313,Gauss-Kruger 13N,,,,72deg East to 78deg East; northern hemisphere.,9807,0.0,75.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16314,Gauss-Kruger 14N,,,,78deg East to 84deg East; northern hemisphere.,9807,0.0,81.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16315,Gauss-Kruger 15N,,,,84deg East to 90deg East; northern hemisphere.,9807,0.0,87.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16316,Gauss-Kruger 16N,,,,90deg East to 96deg East; northern hemisphere.,9807,0.0,93.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16317,Gauss-Kruger 17N,,,,96deg East to 102eg East; northern hemisphere.,9807,0.0,99.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16318,Gauss-Kruger 18N,,,,102deg East to 108deg East; northern hemisphere.,9807,0.0,105.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16319,Gauss-Kruger 19N,,,,108deg East to 114deg East; northern hemisphere.,9807,0.0,111.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16320,Gauss-Kruger 20N,,,,114deg East to 120deg East; northern hemisphere.,9807,0.0,117.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16321,Gauss-Kruger 21N,,,,120deg East to 126deg East; northern hemisphere.,9807,0.0,123.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16322,Gauss-Kruger 22N,,,,126deg East to 132deg East; northern hemisphere.,9807,0.0,129.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16323,Gauss-Kruger 23N,,,,132deg East to 138deg East; northern hemisphere.,9807,0.0,135.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16324,Gauss-Kruger 24N,,,,138deg East to 144deg East; northern hemisphere.,9807,0.0,141.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16325,Gauss-Kruger 25N,,,,144deg East to 150deg East; northern hemisphere.,9807,0.0,147.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16326,Gauss-Kruger 26N,,,,150deg East to 156deg East; northern hemisphere.,9807,0.0,153.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16327,Gauss-Kruger 27N,,,,156deg East to 162deg East; northern hemisphere.,9807,0.0,159.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16328,Gauss-Kruger 28N,,,,162deg East to 168deg East; northern hemisphere.,9807,0.0,165.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16329,Gauss-Kruger 29N,,,,168deg East to 174deg East; northern hemisphere.,9807,0.0,171.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16330,Gauss-Kruger 30N,,,,174deg East to 180deg; northern hemisphere.,9807,0.0,177.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16331,Gauss-Kruger 31N,,,,180deg to 174deg West; northern hemisphere.,9807,0.0,-177.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16332,Gauss-Kruger 32N,,,,174deg West to 168deg West; northern hemisphere.,9807,0.0,-171.0,,,1.0,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.28
+16400,TM 0 N,,,,United Kingdom (UKCS) - offshore North Sea.,9807,0.0,0.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1998-11-11 00:00:00,Shell UK,EPSG,,
+16405,TM 5 NE,,,,Netherlands - offshore.,9807,0.0,5.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1998-11-11 00:00:00,NAM,EPSG,,
+16506,TM 106 NE,,,,Vietnam - offshore.,9807,0.0,106.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1998-11-11 00:00:00,PetroVietnam,EPSG,,
+16611,TM 11.30 SE,,,,Angola - offshore.,9807,0.0,11.3,,,0.9996,500000.0,10000000.0,9001,9110,8901,,,,,1998-11-11 00:00:00,Esso Angola,EPSG,,
+16612,TM 12 SE,,,,Angola - offshore.,9807,0.0,12.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1998-11-11 00:00:00,Shell Angola,EPSG,,
+16636,TM 36 SE,,,,Mozambique - offshore.,9807,0.0,36.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1998-11-11 00:00:00,BP Mozambique,EPSG,,
+17348,Map Grid of Australia zone 48,MGA zone 48,,,Australia 102deg East  to 108deg East.,9807,0.0,105.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17349,Map Grid of Australia zone 49,MGA zone 49,,,Australia 108deg East  to 114deg East.,9807,0.0,111.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17350,Map Grid of Australia zone 50,MGA zone 50,,,Australia 114deg East  to 120deg East.,9807,0.0,117.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17351,Map Grid of Australia zone 51,MGA zone 51,,,Australia 120deg East  to 126deg East.,9807,0.0,123.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17352,Map Grid of Australia zone 52,MGA zone 52,,,Australia 126deg East  to 132deg East.,9807,0.0,129.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17353,Map Grid of Australia zone 53,MGA zone 53,,,Australia 132deg East  to 138deg East.,9807,0.0,135.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17354,Map Grid of Australia zone 54,MGA zone 54,,,Australia 138deg East  to 144deg East.,9807,0.0,141.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17355,Map Grid of Australia zone 55,MGA zone 55,,,Australia 144deg East  to 150deg East.,9807,0.0,147.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17356,Map Grid of Australia zone 56,MGA zone 56,,,Australia 150deg East  to 156deg East.,9807,0.0,153.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17357,Map Grid of Australia zone 57,MGA zone 57,,,Australia 156deg East  to 162deg East.,9807,0.0,159.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17358,Map Grid of Australia zone 58,MGA zone 58,,,Australia 162deg East  to 168deg East.,9807,0.0,165.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Australian Surveying and Land Information Group Internet WWW page.,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17448,Australian Map Grid zone 48,AMG zone 48,,,Australia 102deg East  to 108deg East.,9807,0.0,105.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17449,Australian Map Grid zone 49,AMG zone 49,,,Australia 108deg East  to 114deg East.,9807,0.0,111.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17450,Australian Map Grid zone 50,AMG zone 50,,,Australia 114deg East  to 120deg East.,9807,0.0,117.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17451,Australian Map Grid zone 51,AMG zone 51,,,Australia 120deg East  to 126deg East.,9807,0.0,123.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17452,Australian Map Grid zone 52,AMG zone 52,,,Australia 126deg East  to 132deg East.,9807,0.0,129.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17453,Australian Map Grid zone 53,AMG zone 53,,,Australia 132deg East  to 138deg East.,9807,0.0,135.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17454,Australian Map Grid zone 54,AMG zone 54,,,Australia 138deg East  to 144deg East.  Papua New Guinea west of 144 deg East.,9807,0.0,141.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17455,Australian Map Grid zone 55,AMG zone 55,,,Australia 144deg East  to 150deg East.  Papua New Guinea 144deg East  to 150deg East.,9807,0.0,147.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17456,Australian Map Grid zone 56,AMG zone 56,,,Australia 150deg East  to 156deg East.,9807,0.0,153.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17457,Australian Map Grid zone 57,AMG zone 57,,,Australia 156deg East  to 162deg East.,9807,0.0,159.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17458,Australian Map Grid zone 58,AMG zone 58,,,Australia 162deg East  to 168deg East.,9807,0.0,165.0,,,0.9996,500000.0,10000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,The Australian Map Grid Technical Manual; National Mapping Council of Australia; 1972,EPSG,Grid convergence uses opposite sign convention to UTM,95.30  96.29
+17515,South African Survey Grid zone 15,S. African Grid zone 15,,,South Africa - Walvis Bay.,9808,0.0,15.0,,,1.0,0.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29
+17517,South African Survey Grid zone 17,S. African Grid zone 17,,,South Africa - west of 18 deg East.,9808,0.0,17.0,,,1.0,0.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29
+17519,South African Survey Grid zone 19,S. African Grid zone 19,,,South Africa - 18 to 20 deg East.,9808,0.0,19.0,,,1.0,0.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29
+17521,South African Survey Grid zone 21,S. African Grid zone 21,,,South Africa - 20 to 22 deg East.,9808,0.0,21.0,,,1.0,0.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29
+17523,South African Survey Grid zone 23,S. African Grid zone 23,,,South Africa - 22 to 24 deg East.,9808,0.0,23.0,,,1.0,0.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29
+17525,South African Survey Grid zone 25,S. African Grid zone 25,,,Lestho  - west of 26 deg East; South Africa - 24 to 26 deg East.,9808,0.0,25.0,,,1.0,0.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29
+17527,South African Survey Grid zone 27,S. African Grid zone 27,,,Lestho  - east of 26 deg East;  South Africa - 26 to 28 deg East.,9808,0.0,27.0,,,1.0,0.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29
+17529,South African Survey Grid zone 29,S. African Grid zone 29,,,South Africa - 28 to 30 deg East.,9808,0.0,29.0,,,1.0,0.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29
+17531,South African Survey Grid zone 31,S. African Grid zone 31,,,South Africa - 30 to 32 deg East;  Swaziland.,9808,0.0,31.0,,,1.0,0.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29
+17533,South African Survey Grid zone 33,S. African Grid zone 33,,,South Africa - east of 32 deg East.,9808,0.0,33.0,,,1.0,0.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29
+17611,South West African Survey Grid zone 11,SW African Grid zone 11,,,Namibia - west of 12 deg East.,9808,-22.0,11.0,,,1.0,0.0,0.0,9031,9102,8901,,,,,1997-06-16 00:00:00,Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29  97.16
+17613,South West African Survey Grid zone 13,SW African Grid zone 13,,,Namibia - 12 to 14 deg East.,9808,-22.0,13.0,,,1.0,0.0,0.0,9031,9102,8901,,,,,1997-06-16 00:00:00,Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29  97.16
+17615,South West African Survey Grid zone 15,SW African Grid zone 15,,,Namibia - 14 to 16 deg East.,9808,-22.0,15.0,,,1.0,0.0,0.0,9031,9102,8901,,,,,1997-06-16 00:00:00,Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29  97.16
+17617,South West African Survey Grid zone 17,SW African Grid zone 17,,,Namibia - 16 to 18 deg East.,9808,-22.0,17.0,,,1.0,0.0,0.0,9031,9102,8901,,,,,1997-06-16 00:00:00,Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29  97.16
+17619,South West African Survey Grid zone 19,SW African Grid zone 19,,,Namibia - 18 to 20 deg East.,9808,-22.0,19.0,,,1.0,0.0,0.0,9031,9102,8901,,,,,1997-06-16 00:00:00,Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29  97.16
+17621,South West African Survey Grid zone 21,SW African Grid zone 21,,,Namibia - 20 to 22 deg East.,9808,-22.0,21.0,,,1.0,0.0,0.0,9031,9102,8901,,,,,1997-06-16 00:00:00,Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29  97.16
+17623,South West African Survey Grid zone 23,SW African Grid zone 23,,,Namibia - 22 to 24 deg East.,9808,-22.0,23.0,,,1.0,0.0,0.0,9031,9102,8901,,,,,1997-06-16 00:00:00,Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29  97.16
+17625,South West African Survey Grid zone 25,SW African Grid zone 25,,,Namibia - east of 24 deg East.,9808,-22.0,25.0,,,1.0,0.0,0.0,9031,9102,8901,,,,,1997-06-16 00:00:00,Chief Directorate Surveys and Land Information; Mowbray; South Africa.,EPSG,"Transformation method sometimes described as \"Gauss conform\".",95.30  96.29  97.16
+17700,MTM Quebec zone 2,,,,Canada - Quebec - east of 57 deg East.,9807,0.0,-55.3,,,0.9999,304800.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,,
+17701,MTM zone 1,,,,Canada - Newfoundland - east of 54 deg 30 min West.,9807,0.0,-53.0,,,0.9999,304800.0,0.0,9001,9102,8901,,,,,1997-11-13 00:00:00,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+17702,MTM Newfoundland zone 2,MTM zone 2,,,Canada - Newfoundland and Labrador between 57 deg 30 min and 54 de 30 min West.,9807,0.0,-56.0,,,0.9999,304800.0,0.0,9001,9102,8901,,,,,1997-11-13 00:00:00,Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+17703,MTM zone 3,,,,Canada - Newfoundland and Labrador between 60 deg and 57 deg 30 min West; Canada - Quebec between 60 deg and 57 deg West.,9807,0.0,-58.3,,,0.9999,304800.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+17704,MTM zone 4,,,,Canada - Quebec and Newfoundland (Labrador) between 63 deg and 60 deg West.,9807,0.0,-61.3,,,0.9999,304800.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+17705,MTM zone 5,,,,Canada - Quebec and Newfoundland (Labrador) between 66 deg and 63 deg West.,9807,0.0,-64.3,,,0.9999,304800.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+17706,MTM zone 6,,,,Canada - Quebec and Newfoundland (Labrador) between 69 deg and  66 deg West.,9807,0.0,-67.3,,,0.9999,304800.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources. Also Geodetic Surveys Section; Newfoundland Department of Government Services and Lands.,EPSG,,
+17707,MTM zone 7,,,,Canada - Quebec between 72 deg and 69 deg West.,9807,0.0,-70.3,,,0.9999,304800.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Topographic Mapping Section; Quebec Ministry of Natural Resources.,EPSG,,
+17708,MTM zone 8,,,,Canada - Quebec between 75 deg and 72 deg West.; Canada - Ontario - east of 75 deg West.,9807,0.0,-73.3,,,0.9999,304800.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+17709,MTM zone 9,,,,Canada - Quebec and Ontario - between 78 deg and 75 deg West.,9807,0.0,-76.3,,,0.9999,304800.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+17710,MTM zone 10,,,,Canada - Quebec west of 78 deg West; Canada - Ontario - between 79 deg 30 min and 78 deg W in area to north of 47 deg N; between 80 deg 15 min and 78 deg W in area between 46 deg and 47 deg N; between 81 deg and 78 deg W in area south of 46 deg N.,9807,0.0,-79.3,,,0.9999,304800.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+17711,MTM zone 11,,,,Canada - Ontario - south of 46 deg N and west of 81 deg West.,9807,0.0,-82.3,,,0.9999,304800.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+17712,MTM zone 12,,,,Canada - Ontario - between 82 deg 30 min and 79 deg 30 min W in area to north of 47 deg N; between 82 deg 30 min and 80 deg 15 min W in area between 46 deg and 47 deg N; between 82 deg 30 min and 79 deg 30 min W in area north of 47 deg N.,9807,0.0,-81.0,,,0.9999,304800.0,0.0,9001,9102,8901,,,,,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+17713,MTM zone 13,,,,Canada - Ontario - between 85 deg 30 min and 82 deg 30 min West and north of 46 deg North.,9807,0.0,-84.0,,,0.9999,304800.0,0.0,9001,9102,8901,,,,,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+17714,MTM zone 14,,,,Canada - Ontario - between 88 deg 30 min and 85 deg 30 min West.,9807,0.0,-87.0,,,0.9999,304800.0,0.0,9001,9102,8901,,,,,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+17715,MTM zone 15,,,,Canada - Ontario - between 91 deg 30 min and 88 deg 30 min West.,9807,0.0,-90.0,,,0.9999,304800.0,0.0,9001,9102,8901,,,,,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+17716,MTM zone 16,,,,Canada - Ontario - between 94 deg 30 min and 91 deg 30 min West.,9807,0.0,-93.0,,,0.9999,304800.0,0.0,9001,9102,8901,,,,,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+17717,MTM zone 17,,,,Canada - Ontario - west of 94 deg 30 min West.,9807,0.0,-96.0,,,0.9999,304800.0,0.0,9001,9102,8901,,,,,1997-11-13 00:00:00,Surveys and Mapping Section; Ontario Ministry of Transportation.,EPSG,,
+17794,MTM Nova Scotia zone 4,,,,Canada - Nova Scotia - east of 63 deg West.,9807,0.0,-61.3,,,0.9999,4500000.0,0.0,9001,9110,8901,,,,,1999-05-24 00:00:00,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,,99.042
+17795,MTM Nova Scotia zone 5,,,,Canada - Nova Scotia - west of 63 deg West.,9807,0.0,-64.3,,,0.9999,5500000.0,0.0,9001,9110,8901,,,,,1999-05-24 00:00:00,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,,99.042
+17801,Japan Plane Rectangular CS zone I,Japan zone I,,,Japan - Kyushu - Nagasaki-ken; islands of Kagoshima-ken between 27 and 32 deg N and between 128 deg 18 min and 130 deg E (between 128 deg 18 min and 30 deg 13 min E for Amami islands).,9807,33.0,129.3,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17802,Japan Plane Rectangular CS zone II,Japan zone II,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,9807,33.0,131.0,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17803,Japan Plane Rectangular CS zone III,Japan zone III,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,9807,36.0,132.1,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17804,Japan Plane Rectangular CS zone IV,Japan zone IV,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,9807,33.0,133.3,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17805,Japan Plane Rectangular CS zone V,Japan zone V,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,9807,36.0,134.2,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17806,Japan Plane Rectangular CS zone VI,Japan zone VI,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,9807,36.0,136.0,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17807,Japan Plane Rectangular CS zone VII,Japan zone VII,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,9807,36.0,137.1,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17808,Japan Plane Rectangular CS zone VIII,Japan zone VIII,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,9807,36.0,138.3,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17809,Japan Plane Rectangular CS zone IX,Japan zone IX,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,9807,36.0,139.5,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17810,Japan Plane Rectangular CS zone X,Japan zone X,,,Japan - Kyushu - Fukuoka-ken; Saga-ken; Kumamoto-ken; Oita-ken; Miyazaki-ken; Kagoshima-ken (except for area within Japan Plane Rectangular Coordinates System zone I).,9807,40.0,140.5,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17811,Japan Plane Rectangular CS zone XI,Japan zone XI,,,Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.,9807,44.0,140.15,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17812,Japan Plane Rectangular CS zone XII,Japan zone XII,,,Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.,9807,44.0,142.15,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17813,Japan Plane Rectangular CS zone XIII,Japan zone XIII,,,Japan - Hokkaido west of 141 deg 15 min E approx. - Otaru city; Hakodate city; Date city; Usu-gun and Abuta-gun of Iburi-shicyo; area of Hiyama-shicyo; area of Shiribeshi-shicyo; Oshima-shicyo.,9807,44.0,144.15,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17814,Japan Plane Rectangular CS zone XIV,Japan zone XIV,,,Japan - Tokyo-to south of 28 deg N & between 140 deg 30 min & 143 deg E.,9807,26.0,142.0,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17815,Japan Plane Rectangular CS zone XV,Japan zone XV,,,Japan - Okinawa-ken between 126 deg &130 deg E.,9807,26.0,127.3,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17816,Japan Plane Rectangular CS zone XVI,Japan zone XVI,,,Japan - Okinawa-ken west of 126 deg E.,9807,26.0,124.0,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17817,Japan Plane Rectangular CS zone XVII,Japan zone XVII,,,Japan - Okinawa-ken east of 130 deg E.,9807,26.0,131.0,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17818,Japan Plane Rectangular CS zone XVIII,Japan zone XVIII,,,Japan - Tokyo-to south of 28 N & west of 140 deg 30 min E.,9807,20.0,136.0,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+17819,Japan Plane Rectangular CS zone XIX,Japan zone XIX,,,Japan - Tokyo-to south of 28 N & east of 143 deg E.,9807,26.0,154.0,,,0.9999,0.0,0.0,9001,9110,8901,,,,,1998-12-12 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,Original transformation by Gauss-Kruger formula.,
+18011,Nord Algerie (ancienne),,,,Algeria north of 38.5g (34 deg 39 min) North.,9801,40.0,3.0,,,0.999625544,500000.0,300000.0,9001,9105,8901,,,,,1996-09-12 00:00:00,,EPSG,Used with Voirol 1875 datum - now superseded.,
+18012,Sud Algerie (ancienne),,,,Algeria 35g to 38.5g (31 deg 30 min to 34 deg 39 min) North.,9801,37.0,3.0,,,0.999625769,500000.0,300000.0,9001,9105,8901,,,,,1996-09-12 00:00:00,,EPSG,Used with Voirol 1875 datum - now superseded.,
+18021,Nord Algerie,,,,Algeria north of 38.5g (34 deg 39 min) North.,9801,40.0,3.0,,,0.999625544,500135.0,300090.0,9001,9105,8901,,,,,1996-09-12 00:00:00,,EPSG,Use with Voirol Unifie 1960 datum.,
+18022,Sud Algerie,,,,Algeria 35g to 38.5g (31 deg 30 min to 34 deg 39 min) North.,9801,37.0,3.0,,,0.999625769,500135.0,300090.0,9001,9105,8901,,,,,1996-09-12 00:00:00,,EPSG,Use with Voirol Unifie 1960 datum.,
+18031,Argentina zone 1,Argentina 1,,,Argentina west of 70 deg 30 min West.,9807,-90.0,-72.0,,,1.0,1500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18032,Argentina zone 2,Argentina 2,,,Argentina between 70 deg 30 min and 67 deg 30 min West.,9807,-90.0,-69.0,,,1.0,2500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18033,Argentina zone 3,Argentina 3,,,Argentina between 67 deg 30 min and 64 deg 30 min West.,9807,-90.0,-66.0,,,1.0,3500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18034,Argentina zone 4,Argentina 4,,,Argentina between 64 deg 30 min and 61 deg 30 min West.,9807,-90.0,-63.0,,,1.0,4500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18035,Argentina zone 5,Argentina 5,,,Argentina between 61 deg 30 min and 58 deg 30 min West.,9807,-90.0,-60.0,,,1.0,5500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18036,Argentina zone 6,Argentina 6,,,Argentina between 58 deg 30 min and 55 deg 30 min West.,9807,-90.0,-57.0,,,1.0,6500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18037,Argentina zone 7,Argentina 7,,,Argentina east of 55 deg 30 min West.,9807,-90.0,-54.0,,,1.0,7500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18041,Austria West Zone,,,,Austria west of 11deg 50min East of Greenwich (29deg 30min E of Ferro).,9807,0.0,28.0,,,1.0,0.0,0.0,9001,9102,8909,,,,,1997-04-11 00:00:00,,EPSG,Superseded by M28 (EPSG code 18044).,95.30  96.29  97.01  98.48
+18042,Austria Central Zone,,,,Austria between 11deg 50min and 14deg 50min East of Greenwich (29deg 30min and 32deg 30min East of Ferro).,9807,0.0,31.0,,,1.0,0.0,0.0,9001,9102,8909,,,,,1997-04-11 00:00:00,,EPSG,Superseded by M31 (EPSG code 18045).,95.30  96.29  97.01  98.48
+18043,Austria East Zone,,,,Austria east of 14deg 50min East of Greenwich (32deg 30min East of Ferro).,9807,0.0,34.0,,,1.0,0.0,0.0,9001,9102,8909,,,,,1997-04-11 00:00:00,,EPSG,Superseded by M34 (EPSG code 18046).,95.30  96.29  97.01  98.48
+18044,Austria M28,M28,,,Austria west of 11deg 50min East of Greenwich (29deg 30min E of Ferro).,9807,0.0,10.2,,,1.0,150000.0,0.0,9001,9110,8901,,,,,1999-10-20 00:00:00,Bundesamt f�r Eich- und Vermessungswesen,EPSG,Supersedes Austria West zone (EPSG code 18041).,
+18045,Austria M31,M31,,,Austria between 11deg 50min and 14deg 50min East of Greenwich (29deg 30min and 32deg 30min East of Ferro).,9807,0.0,13.2,,,1.0,450000.0,0.0,9001,9110,8901,,,,,1999-10-20 00:00:00,Bundesamt f�r Eich- und Vermessungswesen,EPSG,Supersedes Austria Central zone (EPSG code 18042).,
+18046,Austria M34,M34,,,Austria east of 14deg 50min East of Greenwich (32deg 30min East of Ferro).,9807,0.0,16.2,,,1.0,750000.0,0.0,9001,9110,8901,,,,,1999-10-20 00:00:00,Bundesamt f�r Eich- und Vermessungswesen,EPSG,Supersedes Austria East zone (EPSG code 18043).,
+18051,Colombia West zone,Colombia 3W,,,Colombia west of 1 deg 30 min W of Bogota (75d 34m 51.30s W of Greenwich).,9807,4.355657,-77.04513,,,1.0,1000000.0,1000000.0,9001,9110,8901,,,,,1997-04-11 00:00:00,,EPSG,"Original transformation by Gauss-Kruger formula.  Zone name sometimes referred to as \"6 west\".",95.30  96.29  97.11
+18052,Colombia Bogota zone,Colombia Bogota,,,Colombia 1 deg 30 min W to 1 deg 30 min E of Bogota (75d 35m W to 72d 35m W of Greenwich).,9807,4.355657,-74.04513,,,1.0,1000000.0,1000000.0,9001,9110,8901,,,,,1997-04-11 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30  96.29  97.11
+18053,Colombia East Central zone,Colombia 3E,,,Colombia 1 deg 30 min to 4 deg 30 min E of Bogota (72d 35m to 69d 34m W of Greenwich).,9807,4.355657,-71.04513,,,1.0,1000000.0,1000000.0,9001,9110,8901,,,,,1997-04-11 00:00:00,,EPSG,"Original transformation by Gauss-Kruger formula.  Zone name sometimes referred to as \"3 east\".",95.30  96.29  97.11
+18054,Colombia East zone,Colombia 6E,,,Colombia east of 4 deg 30 min E of Bogota (69d 34m 51.3s W of Greenwich).,9807,4.355657,-68.04513,,,1.0,1000000.0,1000000.0,9001,9110,8901,,,,,1997-04-11 00:00:00,,EPSG,"Original transformation by Gauss-Kruger formula.  Zone name sometimes referred to as \"6 east\".",95.30  96.29  97.11
+18061,Cuba Norte,,,,Cuba,9801,22.21,-81.0,,,0.99993602,500000.0,280296.016,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+18062,Cuba Sur,,,,Cuba,9801,20.43,-76.5,,,0.99994848,500000.0,229126.939,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+18071,Egypt Blue Belt,Blue Belt,,,Egypt  - Sinai peninsula.,9807,30.0,35.0,,,1.0,300000.0,1100000.0,9001,9102,8901,,,,,1999-04-22 00:00:00,,EPSG,Also known as Green Belt.,
+18072,Egypt Red Belt,Red Belt,,,Egypt  east of 29 deg East.,9807,30.0,31.0,,,1.0,615000.0,810000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30
+18073,Egypt Purple Belt,Purple Belt,,,Egypt  west of 29 deg East; north of approx 28 deg 11 min North.,9807,30.0,27.0,,,1.0,700000.0,200000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30
+18074,Egypt Extended Purple Belt,Extended Purple Belt,,,Egypt  west of 29 deg East; south of approx 28 deg 11 min North.,9807,30.0,27.0,,,1.0,700000.0,1200000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30
+18081,France I,,,,France north of 53.5 grads (48 deg 09 min) North.,9801,55.0,0.0,,,0.999877341,600000.0,1200000.0,9001,9105,8903,,,,,1996-09-12 00:00:00,IGN Paris.,EPSG,Introduced 1972. See 18091.,95.26
+18082,France II,,,,France 50.5 to 53.5 grads (45 deg 27 min to 48 deg 09 min) North.,9801,52.0,0.0,,,0.99987742,600000.0,2200000.0,9001,9105,8903,,,,,1996-09-12 00:00:00,IGN Paris.,EPSG,Introduced 1972. See 18092.,95.26
+18083,France III,,,,France south of 50.5 grads (45 deg 27 min) North.,9801,49.0,0.0,,,0.999877499,600000.0,3200000.0,9001,9105,8903,,,,,1996-09-12 00:00:00,IGN Paris.,EPSG,Introduced 1972. See 18093.,95.26
+18084,France IV,,,,France - Corsica.,9801,46.85,0.0,,,0.99994471,234.358,4185861.369,9001,9105,8903,,,,,1996-09-12 00:00:00,IGN Paris.,EPSG,Introduced 1972. See 18094.,
+18091,Nord France,,,,France north of 53.5 grads (48 deg 09 min) North.,9801,55.0,0.0,,,0.999877341,600000.0,200000.0,9001,9105,8903,,,,,1996-09-12 00:00:00,IGN Paris.,EPSG,Superseded by 18081 from 1972.,95.26
+18092,Centre France,,,,France 50.5 to 53.5 grads (45 deg 27 min to 48 deg 09 min) North.,9801,52.0,0.0,,,0.99987742,600000.0,200000.0,9001,9105,8903,,,,,1996-09-12 00:00:00,IGN Paris.,EPSG,Superseded by 18082 from 1972.,95.26
+18093,Sud France,,,,France south of 50.5 grads (45 deg 27 min) North.,9801,49.0,0.0,,,0.999877499,600000.0,200000.0,9001,9105,8903,,,,,1996-09-12 00:00:00,IGN Paris.,EPSG,Superseded by 18083 from 1972.,95.26
+18094,Corse,,,,France - Corsica.,9801,46.85,0.0,,,0.99994471,234.358,185861.369,9001,9105,8903,,,,,1996-09-12 00:00:00,IGN Paris.,EPSG,Superseded by 18084 from 1972.,
+18101,Germany zone 1,,,,Germany - onshore west of 4 deg 30 min East.,9807,0.0,3.0,,,1.0,1500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18102,Germany zone 2,,,,Germany - onshore between 4 deg 30 min and 7 deg 30 min East.,9807,0.0,6.0,,,1.0,2500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18103,Germany zone 3,,,,Germany - onshore between 7 deg 30 min and 10 deg 30 min East.,9807,0.0,9.0,,,1.0,3500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18104,Germany zone 4,,,,Germany - onshore between 10 deg 30 min and 13 deg 30 min East.,9807,0.0,12.0,,,1.0,4500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18105,Germany zone 5,,,,Germany - onshore between 13 deg 30 min and 16 deg 30 min East.,9807,0.0,15.0,,,1.0,5500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula,95.30
+18110,India zone 0,,,,Pakistan north of 35 deg 35 min North.,9801,39.3,68.0,,,0.99846154,2355500.0,2590000.0,9084,9110,8901,,,,,1999-10-20 00:00:00,US Army Map Service projection tables; 1943.,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,95.30  96.01  96.02  96.29  97.23
+18111,India zone I,,,,India north of 28 deg North. Pakistan 28 deg to 35 deg 35 min North.,9801,32.3,68.0,,,0.99878641,3000000.0,1000000.0,9084,9110,8901,,,,,1999-10-20 00:00:00,US Army Map Service projection tables; 1943.,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,95.30  96.02  96.29  97.23
+18112,India zone IIa,,,,India - between 21 deg and 28 deg North and  west of 82 deg East; Pakistan - south of 28 deg North.,9801,26.0,74.0,,,0.99878641,3000000.0,1000000.0,9084,9102,8901,,,,,1999-10-20 00:00:00,US Army Map Service projection tables; 1943.,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,95.28  96.02  97.23
+18113,India zone IIb,India zone II b,,,Bangladesh; India - north of 21 deg North and east of 82 deg East; Myanmar (Burma) - north of 21 deg North.,9801,26.0,90.0,,,0.99878641,3000000.0,1000000.0,9084,9102,8901,,,,,1999-10-20 00:00:00,US Army Map Service projection tables; 1943.,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,95.28  96.02  97.23
+18114,India zone IIIa,India zone IIIa,,,India - between 15 deg and 21 deg North.,9801,19.0,80.0,,,0.99878641,3000000.0,1000000.0,9084,9102,8901,,,,,1999-10-20 00:00:00,US Army Map Service projection tables; 1943.,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,95.28  96.02  97.23
+18115,India zone IIIb,,,,Myanmar (Burma) - between 15 deg and 21 deg North.,9801,19.0,100.0,,,0.99878641,3000000.0,1000000.0,9084,9102,8901,,,,,1999-10-20 00:00:00,US Army Map Service projection tables; 1943.,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,95.28  96.02  97.23
+18116,India zone IVa,India zone Iva,,,India - south of 15 deg North.,9801,12.0,80.0,,,0.99878641,3000000.0,1000000.0,9084,9102,8901,,,,,1999-10-20 00:00:00,US Army Map Service projection tables; 1943.,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,95.28  96.02  97.23
+18117,India zone IVb,,,,Myanmar - south of 15 deg North.,9801,12.0,100.0,,,0.99878641,3000000.0,1000000.0,9084,9102,8901,,,,,1999-10-20 00:00:00,US Army Map Service projection tables; 1943.,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,95.28  96.02  97.23
+18121,Italy zone 1,,,,Italy west of 12 deg East (of Greenwich).,9807,0.0,9.0,,,0.9996,1500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Boaga formula,
+18122,Italy zone 2,,,,Italy east of 12 deg East (of Greenwich).,9807,0.0,15.0,,,0.9996,2520000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Original transformation by Gauss-Boaga formula,
+18131,Nord Maroc,,,,Morocco north of 35 grads (31 deg 30 min) North.,9801,37.0,-6.0,,,0.999625769,500000.0,300000.0,9001,9105,8901,,,,,1996-09-12 00:00:00,IGN Paris.,EPSG,A projection with the same parameter values used the Lambert Conic Near-Conformal method (EPSG code 9817) prior to 1953.,99.203
+18132,Sud Maroc,,,,Morocco 31gr to 35gr  (27 deg 54 min to 31 deg 30 min) North.,9801,33.0,-6.0,,,0.999615596,500000.0,300000.0,9001,9105,8901,,,,,1996-09-12 00:00:00,,EPSG,A projection with the same parameter values used the Lambert Conic Near-Conformal method (EPSG code 9817) prior to 1953.,99.203
+18133,Sahara,,,,Morocco south of 31gr  (27 deg 54 min) North.,9801,29.0,-6.0,,,0.9996,1200000.0,400000.0,9001,9105,8901,,,,,1996-09-12 00:00:00,IGN Paris,EPSG,Created in 1977 to cover Sahara Marocain (ex Spanish Sahara),
+18141,New Zealand North Island National Grid,North Island Grid,,,New Zealand - North Island.,9807,-39.0,175.3,,,1.0,300000.0,400000.0,9040,9110,8901,,,,,1999-10-20 00:00:00,,EPSG,Superseded by New Zealand Map Grid.,95.30  96.29  97.231
+18142,New Zealand South Island National Grid,South Island Grid,,,New Zealand - South Island.,9807,-44.0,171.3,,,1.0,500000.0,500000.0,9040,9110,8901,,,,,1999-10-20 00:00:00,,EPSG,Superseded by New Zealand Map Grid.,95.30  96.29  97.231
+18151,Nigeria West Belt,,,,Nigeria west of 6 deg 30 min East.,9807,4.0,4.3,,,0.99975,230738.26,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+18152,Nigeria Mid Belt,,,,Nigeria between 6 deg 30 min and 10 deg 30 min East.,9807,4.0,8.3,,,0.99975,670553.98,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+18153,Nigeria East Belt,,,,Nigeria east of 10 deg 30 min East.,9807,4.0,12.3,,,0.99975,1110369.7,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+18161,Peru west zone,,,,Peru west of 79 deg West.,9807,-6.0,-80.3,,,0.99983008,222000.0,1426834.743,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+18162,Peru central zone,,,,Peru 79 to 73 deg West.,9807,-9.3,-76.0,,,0.99932994,720000.0,1039979.159,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+18163,Peru east zone,,,,Peru east of 73 deg West.,9807,-9.3,-70.3,,,0.99952992,1324000.0,1040084.558,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+18171,Philippines zone  I,,,,Philippines - west of 118 deg East.,9807,0.0,117.0,,,0.99995,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30
+18172,Philippines zone  II,,,,Philippines - Palawan; Calamian Islands.,9807,0.0,119.0,,,0.99995,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30
+18173,Philippines zone  III,,,,Philippines - Luzon (except SE part); Mindoro.,9807,0.0,121.0,,,0.99995,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30
+18174,Philippines zone  IV,,,,Philippines - SE Luzon; Tablas; Masbate; Panay; Cebu; Negros; W. Mindanao.,9807,0.0,123.0,,,0.99995,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30
+18175,Philippines zone  V,,,,Philippines - E. Mindanao; Bohol; Samar.,9807,0.0,125.0,,,0.99995,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30
+18181,Nord Tunisie,,,,Tunisia north of 38.5 grads (34 deg 39 min) North.,9801,40.0,11.0,,,0.999625544,500000.0,300000.0,9001,9105,8901,,,,,1996-09-12 00:00:00,,EPSG,,95.30
+18182,Sud Tunisie,,,,Tunisia south of 38.5 grads (34 deg 39 min) North.,9801,37.0,11.0,,,0.999625769,500000.0,300000.0,9001,9105,8901,,,,,1996-09-12 00:00:00,,EPSG,,
+18191,Finland zone 1,,,,Finland - west of 22deg 30min E.,9807,0.0,21.0,,,1.0,1500000.0,0.0,9001,9102,8901,,,,,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,,
+18192,Finland zone 2,,,,Finland - 22deg 30 min to 25deg 30min E.,9807,0.0,24.0,,,1.0,2500000.0,0.0,9001,9102,8901,,,,,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,,
+18193,Finland Uniform Coordinate System,Finland zone 3,,,Finland; Finland - 25 deg 30min E to 28deg 30min E.,9807,0.0,27.0,,,1.0,3500000.0,0.0,9001,9102,8901,,,,,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,Used by Uniform Coordinate System over all country and also by zone 3 of Basic Coordinate System at larger scales.,
+18194,Finland zone 4,,,,Finland - east of 28deg 30 min E.,9807,0.0,30.0,,,1.0,4500000.0,0.0,9001,9102,8901,,,,,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,,
+18201,Palestine Grid,,,,Israel;  Jordan,9806,31.4402749,35.124349,,,,170251.555,126867.909,9001,9110,8901,,,,,1999-04-22 00:00:00,,EPSG,Also encountered as a Transverse Mercator projection with scale factor of 1.  The difference in conversion caused by the change of formula does not exceed 2m within Israel.  Within the State of Israel superseded by the Israeli CS Grid (EPSG code 18203).,
+18202,Palestine Belt,,,,Israel;  Jordan,9807,31.4402749,35.124349,,,1.0,170251.555,1126867.909,9001,9110,8901,,,,,1999-04-22 00:00:00,,EPSG,"Originally constructed as the Palestine Grid - EPSG code 18201. Adopted by the US Army Map Service as \"Palestine Belt\" with change of projection method and false northing (FN). Sometimes seen with unchanged FN of 126867.909.",
+18203,Israeli CS,ICS,,,Israel,9806,31.4402749,35.124349,,,,170251.555,1126867.909,9001,9110,8901,,,,,1999-10-20 00:00:00,Survey of Israel   ftp://ftp.rd.soi.gov.il/doc,EPSG,,
+18204,Israeli TM,ITM,,,Israel,9807,31.4403817,35.1216261,,,1.0000067,219529.584,626907.39,9001,9110,8901,,,,,1999-10-20 00:00:00,Survey of Israel   ftp://ftp.rd.soi.gov.il/doc,EPSG,Designed to approximate Israeli CS grid in north-central Israel.,
+18211,Guatemala Norte,,,,Guatemala north of 15 deg 50 min North.,9801,16.49,-90.2,,,0.99992226,500000.0,292209.579,9001,9110,8901,,,,,1999-08-16 00:00:00,,EPSG,,
+18212,Guatemala Sud,,,,Guatemala south of 15 deg 50 min North.,9801,14.54,-90.2,,,0.99989906,500000.0,325992.681,9001,9110,8901,,,,,1999-08-16 00:00:00,,EPSG,,
+18221,NGO zone I,,,,Norway - west of 3deg 30min W of Oslo (7deg 13min 22.5sec E of Greenwich).,9807,58.0,-4.4,,,1.0,0.0,0.0,9001,9110,8913,,,,,1999-10-20 00:00:00,"J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.",EPSG,,
+18222,NGO zone II,,,,Norway - between 3deg 30min W and 1deg 10min W of Oslo (7deg 13min 22.5sec E  and 9deg 33min 22.5sec E of Greenwich).,9807,58.0,-2.2,,,1.0,0.0,0.0,9001,9110,8913,,,,,1999-10-20 00:00:00,"J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.",EPSG,,
+18223,NGO zone III,,,,Norway - between 1deg 10min W and 1deg 15min E of Oslo (9deg 33min 22.5sec E and 11deg 58min 22.5sec E of Greenwich).,9807,58.0,0.0,,,1.0,0.0,0.0,9001,9110,8913,,,,,1999-10-20 00:00:00,"J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.",EPSG,,
+18224,NGO zone IV,,,,Norway - between 1deg 15min E and 4deg 20min E of Oslo (11deg 58min 22.5sec E and 15deg 03min 22.5sec E of Greenwich).,9807,58.0,2.3,,,1.0,0.0,0.0,9001,9110,8913,,,,,1999-10-20 00:00:00,"J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.",EPSG,,
+18225,NGO zone V,,,,Norway - between 4deg 20min E and 8deg 10min E of Oslo (15deg 03min 22.5sec E and 18deg 53min 22.5sec E of Greenwich).,9807,58.0,6.1,,,1.0,0.0,0.0,9001,9110,8913,,,,,1999-10-20 00:00:00,"J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.",EPSG,,
+18226,NGO zone VI,,,,Norway - between 8deg 10min E and 12deg 10min E of Oslo (18deg 53min 22.5sec E and 22deg 53min 22.5sec E of Greenwich).,9807,58.0,10.1,,,1.0,0.0,0.0,9001,9110,8913,,,,,1999-10-20 00:00:00,"J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.",EPSG,,
+18227,NGO zone VII,,,,Norway - between 12deg 10min E and 16deg 15min E of Oslo (22deg 53min 22.5sec E and 26deg 58min 22.5sec E of Greenwich).,9807,58.0,14.1,,,1.0,0.0,0.0,9001,9110,8913,,,,,1999-10-20 00:00:00,"J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.",EPSG,,
+18228,NGO zone VIII,,,,Norway - east of 16deg 15min E of Oslo (26deg 58min 22.5sec E of Greenwich).,9807,58.0,18.2,,,1.0,0.0,0.0,9001,9110,8913,,,,,1999-10-20 00:00:00,"J. Danielsen; \"Transformasjoner ved Norges Geografiske Oppm�ling\"; Kart Og Plan nr 1; 1982.",EPSG,,
+18231,India zone I (1975 metres),India zone I,,,India north of 28 deg North.,9801,32.3,68.0,,,0.99878641,2743185.69,914395.23,9001,9110,8901,,,,,1999-10-20 00:00:00,,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,
+18232,India zone IIa (1975 metres),India zone II a,,,India - between 21 deg and 28 deg North and  west of 82 deg East.,9801,26.0,74.0,,,0.99878641,2743185.69,914395.23,9001,9102,8901,,,,,1999-10-20 00:00:00,,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,
+18233,India zone IIIa (1975 metres),India zone IIIa,,,India - between 15 deg and 21 deg North.,9801,19.0,80.0,,,0.99878641,2743185.69,914395.23,9001,9102,8901,,,,,1999-10-20 00:00:00,,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,
+18234,India zone IVa (1975 metres),India zone IV a,,,India - south of 15 deg North.,9801,12.0,80.0,,,0.99878641,2743185.69,914395.23,9001,9102,8901,,,,,1999-10-20 00:00:00,,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,
+18235,India zone IIb (1975 metres),India zone II b,,,India - north of 21 deg North and east of 82 deg East.,9801,26.0,90.0,,,0.99878641,2743185.69,914395.23,9001,9102,8901,,,,,1999-10-20 00:00:00,,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,
+18236,India zone I (1962 metres),India zone I,,,Pakistan - north of 28 deg North.,9801,32.3,68.0,,,0.99878641,2743196.4,914398.8,9001,9110,8901,,,,,1999-10-20 00:00:00,,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,
+18237,India zone IIa (1962 metres),India zone II a,,,Pakistan - south of 28 deg North.,9801,26.0,74.0,,,0.99878641,2743196.4,914398.8,9001,9102,8901,,,,,1999-10-20 00:00:00,,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,
+18238,India zone IIb (1937 metres),India zone II b,,,Bangladesh.,9801,26.0,90.0,,,0.99878641,2743195.5,914398.5,9001,9102,8901,,,,,1999-10-20 00:00:00,US Army Map Service projection tables; 1943.,EPSG,BEWARE !  Different yard to metre conversion values have been used in different parts of south Asia. Some areas have changed conversion value with time.,
+19900,Bahrain State Grid,Bahrain Grid,,,Bahrain.,9807,0.0,51.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30
+19901,Belge Lambert 50,,,,Belgium - onshore.,9802,90.0,0.0,49.5,51.1,,150000.0,5400000.0,9001,9110,8910,,,,,1999-04-22 00:00:00,"\"Systemes de reference et formules de transformation en usage en Belgique\"; IGN Brussels",EPSG,,95.30  96.29  99.28
+19902,Belge Lambert 72,,,,Belgium - onshore.,9803,90.0,4.2124983,49.5,51.1,,150000.01256,5400088.4378,9001,9110,8901,,,,,1999-04-22 00:00:00,"\"Systemes de reference et formules de transformation en usage en Belgique\"; IGN Brussels",EPSG,Rotation from Belge Lambert 50 to Belge Lambert 72 is +29.2985sec.,95.30  96.29  99.28
+19903,Nord de Guerre,,,,France - Alsace.,9801,55.0,6.0,,,0.99950908,500000.0,300000.0,9001,9105,8903,,,,,1996-09-12 00:00:00,,EPSG,,
+19904,Ghana Metre Grid,,,,Ghana.,9807,4.4,-1.0,,,0.99975,274319.51,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+19905,Netherlands East Indies Equatorial Zone,NEIEZ,,,Indonesia.,9804,0.0,110.0,,,0.997,3900000.0,900000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,US Army Map Service projection tables; 1943.,EPSG,,95.30
+19906,Iraq zone,,,,Iran -south of 36 deg North; Iraq;  Kuwait.,9801,32.3,45.0,,,0.99878640776699,1500000.0,1166200.0,9001,9110,8901,,,,,1996-04-12 00:00:00,US Army Map Service projection tables; 1943.,EPSG,,95.30  96.29
+19907,Iraq National Grid,,,,Iraq.,9807,29.0134566,46.3,,,0.9994,800000.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+19908,Irish National Grid,,,,Ireland - onshore.  United Kingdom (UK) - Northern Ireland onshore.,9807,53.3,-8.0,,,1.000035,200000.0,250000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+19909,Jamaica (Old Grid),,,,Jamaica.,9801,18.0,-77.0,,,1.0,550000.0,400000.0,9005,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Superseded by Jamaica (New Grid).,95.28
+19910,Jamaica National Grid,,,,Jamaica.,9801,18.0,-77.0,,,1.0,250000.0,150000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,Supersedes Jamaica (Old Grid).,95.28
+19911,Laborde Grid,,,,Madagascar.,9815,-21.0,49.0,21.0,21.0,0.9995,400000.0,800000.0,9001,9105,8903,,,,,1997-11-13 00:00:00,,EPSG,Can also use transformation method 9813.,97.613
+19912,Rectified Skew Orthomorphic Borneo Grid,R.S.O. Borneo,,,Brunei;  Malaysia - East Malaysia (Sabah; Sarawak).,9812,4.0,115.0,53.18569537,53.07483685,0.99984,0.0,0.0,9042,9110,8901,,,,,1999-10-20 00:00:00,,EPSG,,95.30  96.29  97.231
+19913,RD Old,,,,Netherlands - onshore.,9809,52.0922178,5.23155,,,0.9999079,0.0,0.0,9001,9110,8901,,,,,1995-12-02 00:00:00,Nederlandse Commissie voor Geodesie publication 30.,EPSG,,95.30  96.29
+19914,RD New,,,,Netherlands - onshore.,9809,52.0922178,5.23155,,,0.9999079,155000.0,463000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,Nederlandse Commissie voor Geodesie publication 30.,EPSG,,95.30  96.29
+19915,Aden Zone,,,,Yemen.,9801,15.0,45.0,,,0.999365678,1500000.0,1000000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,US Army Map Service projection tables; 1943.,EPSG,,95.28
+19916,British National Grid,,,,United Kingdom (UK) - onshore England; Scotland; Wales; Isle of Man.,9807,49.0,-2.0,,,0.999601272,400000.0,-100000.0,9001,9102,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30
+19917,New Zealand Map Grid,,,,New Zealand.,9811,-41.0,173.0,,,,2510000.0,6023150.0,9001,9102,8901,,,,,1995-12-02 00:00:00,Dept. of Lands and Surveys Technical Circular 1973/32; 23 Nov 1973.,EPSG,Supersedes North and South Island National Grids.,95.28
+19919,Qatar National Grid,,,,Qatar.,9807,24.27,51.13,,,0.99999,200000.0,300000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+19920,Singapore Grid,,,,Singapore.,9806,1.1715528,103.5110808,,,,30000.0,30000.0,9001,9110,8901,,,,,1995-12-02 00:00:00,,EPSG,,95.30  96.29
+19921,Spain,,,,Spain.,9801,40.0,0.0,,,0.9988085293,600000.0,600000.0,9001,9102,8905,,,,,1995-12-02 00:00:00,,EPSG,Superseded by UTM,95.28
+19922,Swiss New Grid,LV03,,,Liechtenstein;  Switzerland.,9815,46.570866,7.26225,90.0,90.0,1.0,600000.0,200000.0,9001,9110,8901,,,,,1997-11-13 00:00:00,"\"Die Projektionen der schweizerischen Plan- und Kartenwerke\"; J. Bolliger 1967",EPSG,,95.30  96.29  97.27  97.612  97.62
+19923,Swiss Old Grid,LV03C,,,Liechtenstein;  Switzerland.,9815,46.570866,0.0,90.0,90.0,1.0,0.0,0.0,9001,9110,8907,,,,,1997-11-13 00:00:00,"\"Die Projektionen der schweizerischen Plan- und Kartenwerke\"; J. Bolliger 1967",EPSG,Superseded by LV03 (19922).,95.30  96.29  97.612  97.62
+19924,Tobago Grid,,,,Trinidad and Tobago - Tobago.,9806,11.1507843,-60.4109632,,,,187500.0,180000.0,9039,9110,8901,,,,,1999-10-20 00:00:00,,EPSG,,95.30  96.29  97.231
+19925,Trinidad Grid,,,,Trinidad and Tobago - Trinidad.,9806,10.263,-61.2,,,,430000.0,325000.0,9039,9110,8901,,,,,1999-10-20 00:00:00,,EPSG,,95.30  96.29  97.231
+19926,Stereo 70,,,,Romania.,9809,46.0,25.0,,,0.99975,500000.0,500000.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,Supersedes Stereo 33 (code 19927).,
+19927,Stereo 33,,,,Romania.,9809,45.54,25.23328772,,,0.9996667,500000.0,500000.0,9001,9110,8901,,,,,1996-04-12 00:00:00,,EPSG,Superseded by Stereo 70 (code 19926),96.29
+19928,Kuwait TM,KTM,,,Kuwait - Kuwait City.,9807,0.0,48.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1996-04-12 00:00:00,,EPSG,,
+19929,Swedish National Projection,2.5 gon West,,,Sweden.,9807,0.0,15.48298,,,1.0,1500000.0,0.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Lantmateriet of Sweden; private communication.,EPSG,"Used since 1938 superseding 6 old zones.  Longitude of natural origin is 2.5 gon west of Stockholm prime meridian; transformation is also known as \"2.5 gon West of old Stockholm observatory\".",96.29  97.39
+19930,Greek Grid,,,,Greece,9807,0.0,24.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1997-06-16 00:00:00,Geodesy Department; Public Petroleum Corporation of Greece.,EPSG,Created for use with GGRS87.,
+19931,Egyseges Orszagos Vetuleti,EOV,,,Hungary,9815,47.08398174,19.02548584,90.0,90.0,0.99993,650000.0,200000.0,9001,9110,8901,,,,,1997-07-22 00:00:00,http://lazarus.elte.hu/gb/geodez/geod2.htm,EPSG,EOV = Uniform National Projection,
+19933,Prince Edward Island Stereographic,PEI Stereographic,,,Canada - Prince Edward Island,9809,47.15,-63.0,,,0.999912,700000.0,400000.0,9001,9110,8901,,,,,1997-11-13 00:00:00,Geomatics Centre; Nova Scotia Ministry of Housing and Municipal Affairs.,EPSG,In use from 1979.  To be phased out in late 1990's.,
+19934,Lithuania 1994,,,,Lithuania,9807,0.0,24.0,,,0.9998,500000.0,0.0,9001,9102,8901,,,,,1998-03-12 00:00:00,HNIT-BALTIC GeoInfoServisas,EPSG,,
+19935,Rectified Skew Orthomorphic Malaya Grid,R.S.O. Malaya,,,Malaysia - West Malaysia,9812,4.0,102.15,323.01328458,323.07483685,0.99984,40000.0,0.0,9062,9110,8901,,,,,1999-10-20 00:00:00,UK Directorate of Overseas Surveys paper,EPSG,,97.231
+19936,Portuguese National Grid,,,,Portugal onshore.,9807,39.4,1.0,,,1.0,200000.0,300000.0,9001,9110,8902,,,,,1998-11-11 00:00:00,,EPSG,Original transformation by Gauss-Kruger formula.,95.30  96.29  98.42
+19937,Tunisia Mining Grid,,,,Tunisia - onshore,9816,38.81973,7.83445,,,,270.0,582.0,9036,9105,8903,,,,,1999-11-15 00:00:00,Mining decree of 1st January 1953,EPSG,Origin: Djebel Kebar,99.81
+19938,Estonian National Grid,,,,Estonia,9802,57.310319415,24.0,59.2,58.0,,500000.0,6375000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,Coordinates at the projection origin match those of TM Baltic 93.,99.28
+19939,TM Baltic 93,,,,Estonia; Latvia; Lithuania.,9807,0.0,24.0,,,0.9996,500000.0,0.0,9001,9102,8901,,,,,1998-12-14 00:00:00,http://www.geo.ut.ee/~raivo/estcoord.html,EPSG,,
+19940,Levant Zone,,,,Syrian Arab Republic west of 39 deg E.,9817,34.39,37.21,,,0.9996256,300000.0,300000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,US Army Map Service projection tables; 1943.,EPSG,Superseded by projection using full Lambert formula from 1973. (EPSG code 19948).,
+19941,Brazil Polyconic,,,,Brazil,9818,0.0,-54.0,,,,5000000.0,10000000.0,9001,9102,8901,,,,,1999-10-20 00:00:00,PetroBras,EPSG,,99.55
+19942,British West Indies Grid,,,,Windward Islands - Dominica  Grenada  Saint Lucia  Saint Vincent;  Leeward Islands - Anguilla   Antigua (excluding Barbuda)  Montserrat   Saint Kitts and Nevis; Barbados.,9807,0.0,-62.0,,,0.9995,400000.0,0.0,9001,9102,8901,,,,,1999-04-22 00:00:00,"UK Royal Engineers projection tables P10/25, 1943.",EPSG,,
+19943,Barbados National Grid,,,,Barbados,9807,13.1035,-59.3335,,,0.9999986,30000.0,75000.0,9001,9110,8901,,,,,1999-04-22 00:00:00,Ordnance Survey of Great Britain,EPSG,Superseded British West Indies Grid (19942) after 1983.,
+19944,Quebec Lambert Projection,,,,Canada - Quebec,9802,44.0,-68.3,60.0,46.0,,0.0,0.0,9001,9110,8901,,,,,1999-10-22 00:00:00,Service de la Cartographie; Minist�re des Ressources Naturelles; Quebec,EPSG,,
+19945,New Brunswick Stereographic (ATS77),NB Stereographic ATS77,,,Canada - New Brunswick - onshore,9809,46.3,-66.3,,,0.999912,300000.0,800000.0,9001,9110,8901,,,,,1999-10-20 00:00:00,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,In use from 1979.  To be phased out in late 1990's.,99.61
+19946,New Brunswick Stereographic (NAD83),NB Stereographic NAD83,,,Canada - New Brunswick - onshore,9809,46.3,-66.3,,,0.999912,2500000.0,7500000.0,9001,9110,8901,,,,,1999-10-20 00:00:00,New Brunswick Geographic Information Corporation land and water information standards manual.,EPSG,In use from 1999.,
+19947,Austria Lambert,,,,Austria,9802,13.2,47.3,49.0,46.0,,400000.0,400000.0,9001,9110,8901,,,,,1999-10-20 00:00:00,Bundesamt f�r Eich- und Vermessungswesen,EPSG,,
+19948,Syria Lambert,,,,Syrian Arab Republic,9801,34.39,37.21,,,0.9996256,300000.0,300000.0,9001,9110,8901,,,,,1999-10-20 00:00:00,IGN Paris,EPSG,Superseded Levant zone (same parameters but using truncated near-conformal method) from 1973.,
+19949,Levant Stereographic,,,,Lebanon,9809,38.0,43.5,,,0.9995341,0.0,0.0,9001,9105,8901,,,,,1999-10-20 00:00:00,IGN Paris,EPSG,Used prior to World War II for cadastral and large scale topographic mapping.,
+19950,Landesvermessung 1995,LV95,,,Liechtenstein;  Switzerland.,9815,46.570866,7.26225,90.0,90.0,1.0,2600000.0,1200000.0,9001,9110,8901,,,,,1999-10-20 00:00:00,Bundesamt f�r Landestopographie.  Aufbau der Landesvermessung der Schweiz 'LV95' Teil 3: Terrestrische Bezugssysteme und Bezugsrahmen. L+T 1999.,EPSG,,
+19951,Nakhl e Taqi Oblique Mercator,Nakhl e Taqi,,,Iran - Taheri refinery site only.,9815,27.31077837,52.3612741,0.34179803,0.34179803,0.999895934,658377.437,3044969.194,9001,9110,8901,,,,,1999-10-20 00:00:00,Total-Fina,EPSG,Used only for terminal site.,
diff --git a/src/tiff/csv/trf_path.c b/src/tiff/csv/trf_path.c
new file mode 100644
index 0000000..2514d84
--- /dev/null
+++ b/src/tiff/csv/trf_path.c
@@ -0,0 +1,568 @@
+#include "defs.h"
+datafile_rows_t trf_path_row_1[] = {"TRF_PATH_CODE","TRF_STEP_CODE","SOURCE_HORIZCS_CODE","TARGET_HORIZCS_CODE","POLYN_TRF_CODE","NONPOLYN_TRF_CODE","CHANGE_ID",NULL};
+datafile_rows_t trf_path_row_2[] = {"8400","1","4201","4326","","1100","",NULL};
+datafile_rows_t trf_path_row_3[] = {"8401","1","4201","4326","","1101","",NULL};
+datafile_rows_t trf_path_row_4[] = {"8402","1","4201","4326","","1102","",NULL};
+datafile_rows_t trf_path_row_5[] = {"8403","1","4201","4326","","1103","",NULL};
+datafile_rows_t trf_path_row_6[] = {"8404","1","4201","4326","","1104","",NULL};
+datafile_rows_t trf_path_row_7[] = {"8405","1","4201","4326","","1105","",NULL};
+datafile_rows_t trf_path_row_8[] = {"8406","1","4201","4326","","1106","",NULL};
+datafile_rows_t trf_path_row_9[] = {"8407","1","4205","4326","","1107","",NULL};
+datafile_rows_t trf_path_row_10[] = {"8408","1","4202","4326","","1108","",NULL};
+datafile_rows_t trf_path_row_11[] = {"8409","1","4203","4326","","1109","",NULL};
+datafile_rows_t trf_path_row_12[] = {"8410","1","4204","4326","","1110","",NULL};
+datafile_rows_t trf_path_row_13[] = {"8411","1","4204","4326","","1111","",NULL};
+datafile_rows_t trf_path_row_14[] = {"8412","1","4289","4326","","1112","",NULL};
+datafile_rows_t trf_path_row_15[] = {"8413","1","4209","4326","","1113","",NULL};
+datafile_rows_t trf_path_row_16[] = {"8414","1","4209","4326","","1114","",NULL};
+datafile_rows_t trf_path_row_17[] = {"8415","1","4209","4326","","1115","",NULL};
+datafile_rows_t trf_path_row_18[] = {"8416","1","4209","4326","","1116","",NULL};
+datafile_rows_t trf_path_row_19[] = {"8417","1","4209","4326","","1117","",NULL};
+datafile_rows_t trf_path_row_20[] = {"8418","1","4209","4326","","1118","",NULL};
+datafile_rows_t trf_path_row_21[] = {"8419","1","4209","4326","","1119","",NULL};
+datafile_rows_t trf_path_row_22[] = {"8420","1","4209","4326","","1120","",NULL};
+datafile_rows_t trf_path_row_23[] = {"8421","1","4209","4326","","1121","",NULL};
+datafile_rows_t trf_path_row_24[] = {"8422","1","4210","4326","","1122","",NULL};
+datafile_rows_t trf_path_row_25[] = {"8423","1","4211","4326","","1123","",NULL};
+datafile_rows_t trf_path_row_26[] = {"8424","1","4216","4326","","1124","",NULL};
+datafile_rows_t trf_path_row_27[] = {"8425","1","4218","4326","","1125","",NULL};
+datafile_rows_t trf_path_row_28[] = {"8426","1","4219","4326","","1126","",NULL};
+datafile_rows_t trf_path_row_29[] = {"8427","1","4221","4326","","1127","",NULL};
+datafile_rows_t trf_path_row_30[] = {"8428","1","4222","4326","","1128","",NULL};
+datafile_rows_t trf_path_row_31[] = {"8429","1","4222","4326","","1129","",NULL};
+datafile_rows_t trf_path_row_32[] = {"8430","1","4223","4326","","1130","",NULL};
+datafile_rows_t trf_path_row_33[] = {"8431","1","4224","4326","","1131","",NULL};
+datafile_rows_t trf_path_row_34[] = {"8432","1","4225","4326","","1132","",NULL};
+datafile_rows_t trf_path_row_35[] = {"8433","1","4230","4326","","1133","",NULL};
+datafile_rows_t trf_path_row_36[] = {"8434","1","4230","4326","","1134","",NULL};
+datafile_rows_t trf_path_row_37[] = {"8435","1","4230","4326","","1135","",NULL};
+datafile_rows_t trf_path_row_38[] = {"8436","1","4230","4326","","1136","",NULL};
+datafile_rows_t trf_path_row_39[] = {"8437","1","4230","4326","","1137","",NULL};
+datafile_rows_t trf_path_row_40[] = {"8438","1","4230","4326","","1138","",NULL};
+datafile_rows_t trf_path_row_41[] = {"8439","1","4230","4326","","1139","",NULL};
+datafile_rows_t trf_path_row_42[] = {"8440","1","4230","4326","","1140","",NULL};
+datafile_rows_t trf_path_row_43[] = {"8441","1","4230","4326","","1141","",NULL};
+datafile_rows_t trf_path_row_44[] = {"8442","1","4230","4326","","1142","",NULL};
+datafile_rows_t trf_path_row_45[] = {"8443","1","4230","4326","","1143","",NULL};
+datafile_rows_t trf_path_row_46[] = {"8444","1","4230","4326","","1144","",NULL};
+datafile_rows_t trf_path_row_47[] = {"8445","1","4230","4326","","1145","",NULL};
+datafile_rows_t trf_path_row_48[] = {"8446","1","4230","4231","1000","","",NULL};
+datafile_rows_t trf_path_row_49[] = {"8446","2","4231","4326","","1146","",NULL};
+datafile_rows_t trf_path_row_50[] = {"8447","1","4230","4231","","1147","",NULL};
+datafile_rows_t trf_path_row_51[] = {"8447","2","4231","4326","","1146","",NULL};
+datafile_rows_t trf_path_row_52[] = {"8448","1","4229","4326","","1148","",NULL};
+datafile_rows_t trf_path_row_53[] = {"8449","1","4258","4326","","1149","",NULL};
+datafile_rows_t trf_path_row_54[] = {"8450","1","4283","4326","","1150","",NULL};
+datafile_rows_t trf_path_row_55[] = {"8451","1","4272","4326","","1151","",NULL};
+datafile_rows_t trf_path_row_56[] = {"8452","1","4236","4326","","1152","",NULL};
+datafile_rows_t trf_path_row_57[] = {"8453","1","4239","4326","","1153","",NULL};
+datafile_rows_t trf_path_row_58[] = {"8454","1","4240","4326","","1154","",NULL};
+datafile_rows_t trf_path_row_59[] = {"8455","1","4144","4326","","1155","97.235",NULL};
+datafile_rows_t trf_path_row_60[] = {"8456","1","4146","4326","","1156","97.235",NULL};
+datafile_rows_t trf_path_row_61[] = {"8457","1","4244","4326","","1157","",NULL};
+datafile_rows_t trf_path_row_62[] = {"8458","1","4245","4326","","1158","",NULL};
+datafile_rows_t trf_path_row_63[] = {"8459","1","4250","4326","","1159","",NULL};
+datafile_rows_t trf_path_row_64[] = {"8460","1","4251","4326","","1160","",NULL};
+datafile_rows_t trf_path_row_65[] = {"8461","1","4253","4326","","1161","",NULL};
+datafile_rows_t trf_path_row_66[] = {"8462","1","4253","4326","","1162","",NULL};
+datafile_rows_t trf_path_row_67[] = {"8463","1","4266","4326","","1163","",NULL};
+datafile_rows_t trf_path_row_68[] = {"8464","1","4256","4326","","1164","",NULL};
+datafile_rows_t trf_path_row_69[] = {"8465","1","4262","4326","","1165","",NULL};
+datafile_rows_t trf_path_row_70[] = {"8466","1","4261","4326","","1166","",NULL};
+datafile_rows_t trf_path_row_71[] = {"8467","1","4263","4326","","1167","",NULL};
+datafile_rows_t trf_path_row_72[] = {"8468","1","4263","4326","","1168","",NULL};
+datafile_rows_t trf_path_row_73[] = {"8469","1","4265","4326","","1169","",NULL};
+datafile_rows_t trf_path_row_74[] = {"8470","1","4267","4326","","1170","",NULL};
+datafile_rows_t trf_path_row_75[] = {"8471","1","4267","4326","","1171","",NULL};
+datafile_rows_t trf_path_row_76[] = {"8472","1","4267","4326","","1172","",NULL};
+datafile_rows_t trf_path_row_77[] = {"8473","1","4267","4326","","1173","",NULL};
+datafile_rows_t trf_path_row_78[] = {"8474","1","4267","4326","","1174","",NULL};
+datafile_rows_t trf_path_row_79[] = {"8475","1","4267","4326","","1175","",NULL};
+datafile_rows_t trf_path_row_80[] = {"8476","1","4267","4326","","1176","",NULL};
+datafile_rows_t trf_path_row_81[] = {"8477","1","4267","4326","","1177","",NULL};
+datafile_rows_t trf_path_row_82[] = {"8478","1","4267","4326","","1178","",NULL};
+datafile_rows_t trf_path_row_83[] = {"8479","1","4267","4326","","1179","",NULL};
+datafile_rows_t trf_path_row_84[] = {"8480","1","4267","4326","","1180","",NULL};
+datafile_rows_t trf_path_row_85[] = {"8481","1","4267","4326","","1181","",NULL};
+datafile_rows_t trf_path_row_86[] = {"8482","1","4267","4326","","1182","",NULL};
+datafile_rows_t trf_path_row_87[] = {"8483","1","4267","4326","","1183","",NULL};
+datafile_rows_t trf_path_row_88[] = {"8484","1","4267","4326","","1184","",NULL};
+datafile_rows_t trf_path_row_89[] = {"8485","1","4267","4326","","1185","",NULL};
+datafile_rows_t trf_path_row_90[] = {"8486","1","4267","4326","","1186","",NULL};
+datafile_rows_t trf_path_row_91[] = {"8487","1","4267","4326","","1187","",NULL};
+datafile_rows_t trf_path_row_92[] = {"8488","1","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_93[] = {"8489","1","4270","4326","","1189","",NULL};
+datafile_rows_t trf_path_row_94[] = {"8490","1","4270","4326","","1190","",NULL};
+datafile_rows_t trf_path_row_95[] = {"8491","1","4270","4326","","1191","",NULL};
+datafile_rows_t trf_path_row_96[] = {"8492","1","4271","4326","","1192","",NULL};
+datafile_rows_t trf_path_row_97[] = {"8493","1","4275","4326","","1193","",NULL};
+datafile_rows_t trf_path_row_98[] = {"8494","1","4807","4275","","1467","97.05",NULL};
+datafile_rows_t trf_path_row_99[] = {"8494","2","4275","4326","","1193","",NULL};
+datafile_rows_t trf_path_row_100[] = {"8495","1","4277","4326","","1195","",NULL};
+datafile_rows_t trf_path_row_101[] = {"8496","1","4277","4326","","1196","",NULL};
+datafile_rows_t trf_path_row_102[] = {"8497","1","4277","4326","","1197","",NULL};
+datafile_rows_t trf_path_row_103[] = {"8498","1","4277","4326","","1198","",NULL};
+datafile_rows_t trf_path_row_104[] = {"8499","1","4277","4326","","1199","",NULL};
+datafile_rows_t trf_path_row_105[] = {"8500","1","4282","4326","","1200","",NULL};
+datafile_rows_t trf_path_row_106[] = {"8501","1","4248","4326","","1201","",NULL};
+datafile_rows_t trf_path_row_107[] = {"8502","1","4248","4326","","1202","",NULL};
+datafile_rows_t trf_path_row_108[] = {"8503","1","4248","4326","","1203","",NULL};
+datafile_rows_t trf_path_row_109[] = {"8504","1","4248","4326","","1204","",NULL};
+datafile_rows_t trf_path_row_110[] = {"8505","1","4248","4326","","1205","",NULL};
+datafile_rows_t trf_path_row_111[] = {"8506","1","4248","4326","","1206","",NULL};
+datafile_rows_t trf_path_row_112[] = {"8507","1","4248","4326","","1207","",NULL};
+datafile_rows_t trf_path_row_113[] = {"8508","1","4248","4326","","1208","",NULL};
+datafile_rows_t trf_path_row_114[] = {"8509","1","4248","4326","","1209","",NULL};
+datafile_rows_t trf_path_row_115[] = {"8510","1","4285","4326","","1210","",NULL};
+datafile_rows_t trf_path_row_116[] = {"8511","1","4287","4326","","1211","",NULL};
+datafile_rows_t trf_path_row_117[] = {"8512","1","4291","4326","","1212","",NULL};
+datafile_rows_t trf_path_row_118[] = {"8513","1","4291","4326","","1213","",NULL};
+datafile_rows_t trf_path_row_119[] = {"8514","1","4291","4326","","1214","",NULL};
+datafile_rows_t trf_path_row_120[] = {"8515","1","4291","4326","","1215","",NULL};
+datafile_rows_t trf_path_row_121[] = {"8516","1","4291","4326","","1216","",NULL};
+datafile_rows_t trf_path_row_122[] = {"8517","1","4291","4326","","1217","",NULL};
+datafile_rows_t trf_path_row_123[] = {"8518","1","4291","4326","","1218","",NULL};
+datafile_rows_t trf_path_row_124[] = {"8519","1","4291","4326","","1219","",NULL};
+datafile_rows_t trf_path_row_125[] = {"8520","1","4291","4326","","1220","",NULL};
+datafile_rows_t trf_path_row_126[] = {"8521","1","4291","4326","","1221","",NULL};
+datafile_rows_t trf_path_row_127[] = {"8522","1","4291","4326","","1222","",NULL};
+datafile_rows_t trf_path_row_128[] = {"8523","1","4291","4326","","1223","",NULL};
+datafile_rows_t trf_path_row_129[] = {"8524","1","4291","4326","","1224","",NULL};
+datafile_rows_t trf_path_row_130[] = {"8525","1","4292","4326","","1225","",NULL};
+datafile_rows_t trf_path_row_131[] = {"8526","1","4293","4326","","1226","",NULL};
+datafile_rows_t trf_path_row_132[] = {"8527","1","4297","4326","","1227","",NULL};
+datafile_rows_t trf_path_row_133[] = {"8528","1","4298","4326","","1228","",NULL};
+datafile_rows_t trf_path_row_134[] = {"8529","1","4299","4326","","1229","",NULL};
+datafile_rows_t trf_path_row_135[] = {"8530","1","4301","4326","","1230","",NULL};
+datafile_rows_t trf_path_row_136[] = {"8531","1","4301","4326","","1231","",NULL};
+datafile_rows_t trf_path_row_137[] = {"8532","1","4301","4326","","1232","",NULL};
+datafile_rows_t trf_path_row_138[] = {"8533","1","4301","4326","","1233","",NULL};
+datafile_rows_t trf_path_row_139[] = {"8534","1","4309","4326","","1234","",NULL};
+datafile_rows_t trf_path_row_140[] = {"8535","1","4311","4326","","1235","",NULL};
+datafile_rows_t trf_path_row_141[] = {"8536","1","4230","4231","1000","","",NULL};
+datafile_rows_t trf_path_row_142[] = {"8537","1","4231","4326","","1146","",NULL};
+datafile_rows_t trf_path_row_143[] = {"8538","1","4230","4231","","1147","",NULL};
+datafile_rows_t trf_path_row_144[] = {"8539","1","4203","4326","","1236","",NULL};
+datafile_rows_t trf_path_row_145[] = {"8540","1","4322","4326","","1237","",NULL};
+datafile_rows_t trf_path_row_146[] = {"8541","1","4322","4326","","1238","",NULL};
+datafile_rows_t trf_path_row_147[] = {"8542","1","4324","4322","","1239","",NULL};
+datafile_rows_t trf_path_row_148[] = {"8543","1","4324","4326","","1240","",NULL};
+datafile_rows_t trf_path_row_149[] = {"8544","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_150[] = {"8546","1","4267","4269","","1243","",NULL};
+datafile_rows_t trf_path_row_151[] = {"8548","1","4230","4326","","1245","",NULL};
+datafile_rows_t trf_path_row_152[] = {"8549","1","4255","4326","","1246","",NULL};
+datafile_rows_t trf_path_row_153[] = {"8550","1","4145","4326","","1247","97.235",NULL};
+datafile_rows_t trf_path_row_154[] = {"8551","1","4238","4326","","1248","",NULL};
+datafile_rows_t trf_path_row_155[] = {"8552","1","4267","4326","","1249","",NULL};
+datafile_rows_t trf_path_row_156[] = {"8553","1","4267","4326","","1250","",NULL};
+datafile_rows_t trf_path_row_157[] = {"8554","1","4269","4326","","1251","",NULL};
+datafile_rows_t trf_path_row_158[] = {"8555","1","4269","4326","","1252","",NULL};
+datafile_rows_t trf_path_row_159[] = {"8556","1","4307","4326","","1253","",NULL};
+datafile_rows_t trf_path_row_160[] = {"8557","1","4284","4326","","1254","",NULL};
+datafile_rows_t trf_path_row_161[] = {"8558","1","4305","4326","","1255","",NULL};
+datafile_rows_t trf_path_row_162[] = {"8559","1","4232","4326","","1256","",NULL};
+datafile_rows_t trf_path_row_163[] = {"8560","1","4807","4275","","1467","99.63",NULL};
+datafile_rows_t trf_path_row_164[] = {"8561","1","4801","4217","","1257","",NULL};
+datafile_rows_t trf_path_row_165[] = {"8562","1","4802","4218","","1258","",NULL};
+datafile_rows_t trf_path_row_166[] = {"8563","1","4802","4218","","1258","",NULL};
+datafile_rows_t trf_path_row_167[] = {"8563","2","4218","4326","","1125","",NULL};
+datafile_rows_t trf_path_row_168[] = {"8564","1","4803","4207","","1259","",NULL};
+datafile_rows_t trf_path_row_169[] = {"8565","1","4804","4257","","1260","",NULL};
+datafile_rows_t trf_path_row_170[] = {"8566","1","4805","4312","","1261","",NULL};
+datafile_rows_t trf_path_row_171[] = {"8567","1","4806","4265","","1262","",NULL};
+datafile_rows_t trf_path_row_172[] = {"8568","1","4806","4265","","1262","",NULL};
+datafile_rows_t trf_path_row_173[] = {"8568","2","4265","4326","","1169","",NULL};
+datafile_rows_t trf_path_row_174[] = {"8569","1","4808","4280","","1263","",NULL};
+datafile_rows_t trf_path_row_175[] = {"8570","1","4809","4215","","1264","",NULL};
+datafile_rows_t trf_path_row_176[] = {"8571","1","4810","4297","","1265","",NULL};
+datafile_rows_t trf_path_row_177[] = {"8572","1","4810","4297","","1265","",NULL};
+datafile_rows_t trf_path_row_178[] = {"8572","2","4297","4326","","1227","",NULL};
+datafile_rows_t trf_path_row_179[] = {"8573","1","4811","4304","","1266","",NULL};
+datafile_rows_t trf_path_row_180[] = {"8574","1","4812","4305","","1267","",NULL};
+datafile_rows_t trf_path_row_181[] = {"8575","1","4812","4305","","1267","",NULL};
+datafile_rows_t trf_path_row_182[] = {"8575","2","4305","4326","","1255","",NULL};
+datafile_rows_t trf_path_row_183[] = {"8576","1","4813","4211","","1268","",NULL};
+datafile_rows_t trf_path_row_184[] = {"8577","1","4813","4211","","1268","",NULL};
+datafile_rows_t trf_path_row_185[] = {"8577","2","4211","4326","","1123","",NULL};
+datafile_rows_t trf_path_row_186[] = {"8578","1","4814","4308","","1269","98.51",NULL};
+datafile_rows_t trf_path_row_187[] = {"8579","1","4815","4120","","1270","",NULL};
+datafile_rows_t trf_path_row_188[] = {"8580","1","4293","4326","","1271","",NULL};
+datafile_rows_t trf_path_row_189[] = {"8581","1","4121","4326","","1272","",NULL};
+datafile_rows_t trf_path_row_190[] = {"8582","1","4237","4258","","1273","",NULL};
+datafile_rows_t trf_path_row_191[] = {"8583","1","4237","4258","","1273","",NULL};
+datafile_rows_t trf_path_row_192[] = {"8583","2","4258","4326","","1149","",NULL};
+datafile_rows_t trf_path_row_193[] = {"8584","1","4230","4326","","1275","",NULL};
+datafile_rows_t trf_path_row_194[] = {"8585","1","4275","4230","","1276","",NULL};
+datafile_rows_t trf_path_row_195[] = {"8586","1","4807","4275","","1467","",NULL};
+datafile_rows_t trf_path_row_196[] = {"8586","2","4275","4230","","1276","",NULL};
+datafile_rows_t trf_path_row_197[] = {"8587","1","4275","4322","","1277","",NULL};
+datafile_rows_t trf_path_row_198[] = {"8588","1","4807","4275","","1467","",NULL};
+datafile_rows_t trf_path_row_199[] = {"8588","2","4275","4322","","1277","",NULL};
+datafile_rows_t trf_path_row_200[] = {"8589","1","4202","4283","","1278","",NULL};
+datafile_rows_t trf_path_row_201[] = {"8590","1","4202","4283","","1278","",NULL};
+datafile_rows_t trf_path_row_202[] = {"8590","2","4283","4326","","1150","98.50",NULL};
+datafile_rows_t trf_path_row_203[] = {"8591","1","4203","4283","","1279","",NULL};
+datafile_rows_t trf_path_row_204[] = {"8592","1","4203","4283","","1279","",NULL};
+datafile_rows_t trf_path_row_205[] = {"8592","2","4283","4326","","1150","98.50",NULL};
+datafile_rows_t trf_path_row_206[] = {"8593","1","4203","4283","","1280","",NULL};
+datafile_rows_t trf_path_row_207[] = {"8594","1","4203","4283","","1280","",NULL};
+datafile_rows_t trf_path_row_208[] = {"8594","2","4283","4326","","1150","98.50",NULL};
+datafile_rows_t trf_path_row_209[] = {"8595","1","4124","4258","","1437","99.11",NULL};
+datafile_rows_t trf_path_row_210[] = {"8595","2","4258","4326","","1149","99.11",NULL};
+datafile_rows_t trf_path_row_211[] = {"8596","1","4125","4326","","1282","",NULL};
+datafile_rows_t trf_path_row_212[] = {"8597","1","4284","4126","","1274","",NULL};
+datafile_rows_t trf_path_row_213[] = {"8598","1","4126","4326","","1283","",NULL};
+datafile_rows_t trf_path_row_214[] = {"8599","1","4210","4326","","1284","",NULL};
+datafile_rows_t trf_path_row_215[] = {"8600","1","4210","4326","","1285","",NULL};
+datafile_rows_t trf_path_row_216[] = {"8601","1","4294","4326","","1286","",NULL};
+datafile_rows_t trf_path_row_217[] = {"8602","1","4284","4326","","1287","",NULL};
+datafile_rows_t trf_path_row_218[] = {"8603","1","4284","4326","","1288","",NULL};
+datafile_rows_t trf_path_row_219[] = {"8604","1","4284","4326","","1289","",NULL};
+datafile_rows_t trf_path_row_220[] = {"8605","1","4284","4326","","1290","",NULL};
+datafile_rows_t trf_path_row_221[] = {"8606","1","4284","4326","","1291","",NULL};
+datafile_rows_t trf_path_row_222[] = {"8607","1","4284","4326","","1292","",NULL};
+datafile_rows_t trf_path_row_223[] = {"8608","1","4284","4326","","1293","",NULL};
+datafile_rows_t trf_path_row_224[] = {"8609","1","4284","4126","","1274","",NULL};
+datafile_rows_t trf_path_row_225[] = {"8609","2","4126","4326","","1283","",NULL};
+datafile_rows_t trf_path_row_226[] = {"8610","1","4304","4326","","1294","",NULL};
+datafile_rows_t trf_path_row_227[] = {"8611","1","4811","4304","","1266","",NULL};
+datafile_rows_t trf_path_row_228[] = {"8611","2","4304","4326","","1294","",NULL};
+datafile_rows_t trf_path_row_229[] = {"8612","1","4271","4326","","1295","",NULL};
+datafile_rows_t trf_path_row_230[] = {"8613","1","4302","4326","","1296","",NULL};
+datafile_rows_t trf_path_row_231[] = {"8614","1","4127","4130","","1297","",NULL};
+datafile_rows_t trf_path_row_232[] = {"8615","1","4127","4130","","1297","",NULL};
+datafile_rows_t trf_path_row_233[] = {"8615","2","4130","4326","","1302","",NULL};
+datafile_rows_t trf_path_row_234[] = {"8616","1","4127","4130","","1298","",NULL};
+datafile_rows_t trf_path_row_235[] = {"8617","1","4127","4130","","1298","",NULL};
+datafile_rows_t trf_path_row_236[] = {"8617","2","4130","4326","","1302","",NULL};
+datafile_rows_t trf_path_row_237[] = {"8618","1","4127","4130","","1299","",NULL};
+datafile_rows_t trf_path_row_238[] = {"8619","1","4127","4130","","1299","",NULL};
+datafile_rows_t trf_path_row_239[] = {"8619","2","4130","4326","","1302","",NULL};
+datafile_rows_t trf_path_row_240[] = {"8620","1","4127","4130","","1300","",NULL};
+datafile_rows_t trf_path_row_241[] = {"8621","1","4127","4130","","1300","",NULL};
+datafile_rows_t trf_path_row_242[] = {"8621","2","4130","4326","","1302","",NULL};
+datafile_rows_t trf_path_row_243[] = {"8622","1","4127","4130","","1301","",NULL};
+datafile_rows_t trf_path_row_244[] = {"8623","1","4127","4130","","1301","",NULL};
+datafile_rows_t trf_path_row_245[] = {"8623","2","4130","4326","","1302","",NULL};
+datafile_rows_t trf_path_row_246[] = {"8624","1","4130","4326","","1302","",NULL};
+datafile_rows_t trf_path_row_247[] = {"8625","1","4284","4326","","1303","",NULL};
+datafile_rows_t trf_path_row_248[] = {"8626","1","4240","4326","","1304","",NULL};
+datafile_rows_t trf_path_row_249[] = {"8627","1","4301","4326","","1305","",NULL};
+datafile_rows_t trf_path_row_250[] = {"8628","1","4312","4326","","1306","",NULL};
+datafile_rows_t trf_path_row_251[] = {"8629","1","4271","4326","","1307","",NULL};
+datafile_rows_t trf_path_row_252[] = {"8633","1","4314","4258","","1309","",NULL};
+datafile_rows_t trf_path_row_253[] = {"8634","1","4314","4258","","1309","",NULL};
+datafile_rows_t trf_path_row_254[] = {"8634","2","4258","4326","","1149","",NULL};
+datafile_rows_t trf_path_row_255[] = {"8635","1","4284","4258","","1310","",NULL};
+datafile_rows_t trf_path_row_256[] = {"8636","1","4284","4258","","1310","",NULL};
+datafile_rows_t trf_path_row_257[] = {"8636","2","4258","4326","","1149","",NULL};
+datafile_rows_t trf_path_row_258[] = {"8637","1","4230","4326","","1311","",NULL};
+datafile_rows_t trf_path_row_259[] = {"8638","1","4903","4230","1001","","",NULL};
+datafile_rows_t trf_path_row_260[] = {"8639","1","4903","4230","1002","","",NULL};
+datafile_rows_t trf_path_row_261[] = {"8640","1","4903","4230","1003","","",NULL};
+datafile_rows_t trf_path_row_262[] = {"8641","1","4903","4230","1001","","",NULL};
+datafile_rows_t trf_path_row_263[] = {"8641","2","4230","4326","","1145","",NULL};
+datafile_rows_t trf_path_row_264[] = {"8642","1","4267","4269","","1312","",NULL};
+datafile_rows_t trf_path_row_265[] = {"8643","1","4267","4269","","1312","",NULL};
+datafile_rows_t trf_path_row_266[] = {"8643","2","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_267[] = {"8644","1","4267","4269","","1313","",NULL};
+datafile_rows_t trf_path_row_268[] = {"8645","1","4267","4269","","1313","",NULL};
+datafile_rows_t trf_path_row_269[] = {"8645","2","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_270[] = {"8646","1","4277","4326","","1314","",NULL};
+datafile_rows_t trf_path_row_271[] = {"8647","1","4277","4230","","1315","",NULL};
+datafile_rows_t trf_path_row_272[] = {"8648","1","4260","4326","","1316","",NULL};
+datafile_rows_t trf_path_row_273[] = {"8649","1","4220","4324","","1317","",NULL};
+datafile_rows_t trf_path_row_274[] = {"8650","1","4220","4326","","1318","",NULL};
+datafile_rows_t trf_path_row_275[] = {"8651","1","4220","4326","","1319","",NULL};
+datafile_rows_t trf_path_row_276[] = {"8652","1","4220","4326","","1320","",NULL};
+datafile_rows_t trf_path_row_277[] = {"8653","1","4220","4326","","1321","",NULL};
+datafile_rows_t trf_path_row_278[] = {"8654","1","4220","4326","","1322","",NULL};
+datafile_rows_t trf_path_row_279[] = {"8655","1","4220","4326","","1323","",NULL};
+datafile_rows_t trf_path_row_280[] = {"8656","1","4220","4326","","1324","",NULL};
+datafile_rows_t trf_path_row_281[] = {"8657","1","4220","4326","","1325","",NULL};
+datafile_rows_t trf_path_row_282[] = {"8658","1","4220","4326","","1326","",NULL};
+datafile_rows_t trf_path_row_283[] = {"8659","1","4220","4326","","1327","",NULL};
+datafile_rows_t trf_path_row_284[] = {"8660","1","4259","4264","","1328","",NULL};
+datafile_rows_t trf_path_row_285[] = {"8661","1","4264","4326","","1329","",NULL};
+datafile_rows_t trf_path_row_286[] = {"8662","1","4259","4326","","1330","",NULL};
+datafile_rows_t trf_path_row_287[] = {"8663","1","4805","4312","","1261","",NULL};
+datafile_rows_t trf_path_row_288[] = {"8663","2","4312","4326","","1306","",NULL};
+datafile_rows_t trf_path_row_289[] = {"8664","1","4133","4258","","1331","",NULL};
+datafile_rows_t trf_path_row_290[] = {"8665","1","4284","4133","","1332","",NULL};
+datafile_rows_t trf_path_row_291[] = {"8666","1","4133","4326","","1333","",NULL};
+datafile_rows_t trf_path_row_292[] = {"8667","1","4284","4326","","1334","",NULL};
+datafile_rows_t trf_path_row_293[] = {"8668","1","4301","4326","","1335","",NULL};
+datafile_rows_t trf_path_row_294[] = {"8669","1","4301","4326","","1336","",NULL};
+datafile_rows_t trf_path_row_295[] = {"8670","1","4301","4326","","1337","",NULL};
+datafile_rows_t trf_path_row_296[] = {"8671","1","4301","4326","","1338","",NULL};
+datafile_rows_t trf_path_row_297[] = {"8672","1","4301","4326","","1339","",NULL};
+datafile_rows_t trf_path_row_298[] = {"8673","1","4301","4326","","1340","",NULL};
+datafile_rows_t trf_path_row_299[] = {"8674","1","4301","4326","","1341","",NULL};
+datafile_rows_t trf_path_row_300[] = {"8675","1","4301","4326","","1342","",NULL};
+datafile_rows_t trf_path_row_301[] = {"8676","1","4301","4326","","1343","",NULL};
+datafile_rows_t trf_path_row_302[] = {"8677","1","4301","4326","","1344","",NULL};
+datafile_rows_t trf_path_row_303[] = {"8678","1","4301","4326","","1345","",NULL};
+datafile_rows_t trf_path_row_304[] = {"8679","1","4301","4326","","1346","",NULL};
+datafile_rows_t trf_path_row_305[] = {"8680","1","4301","4326","","1347","",NULL};
+datafile_rows_t trf_path_row_306[] = {"8681","1","4301","4326","","1348","",NULL};
+datafile_rows_t trf_path_row_307[] = {"8682","1","4301","4326","","1349","",NULL};
+datafile_rows_t trf_path_row_308[] = {"8683","1","4301","4326","","1350","",NULL};
+datafile_rows_t trf_path_row_309[] = {"8684","1","4301","4326","","1351","",NULL};
+datafile_rows_t trf_path_row_310[] = {"8685","1","4301","4326","","1352","",NULL};
+datafile_rows_t trf_path_row_311[] = {"8686","1","4301","4326","","1353","",NULL};
+datafile_rows_t trf_path_row_312[] = {"8687","1","4301","4326","","1354","",NULL};
+datafile_rows_t trf_path_row_313[] = {"8688","1","4301","4326","","1355","",NULL};
+datafile_rows_t trf_path_row_314[] = {"8689","1","4301","4326","","1356","",NULL};
+datafile_rows_t trf_path_row_315[] = {"8690","1","4301","4326","","1357","",NULL};
+datafile_rows_t trf_path_row_316[] = {"8691","1","4301","4326","","1358","",NULL};
+datafile_rows_t trf_path_row_317[] = {"8692","1","4301","4326","","1359","",NULL};
+datafile_rows_t trf_path_row_318[] = {"8693","1","4301","4326","","1360","",NULL};
+datafile_rows_t trf_path_row_319[] = {"8694","1","4301","4326","","1361","",NULL};
+datafile_rows_t trf_path_row_320[] = {"8695","1","4301","4326","","1362","",NULL};
+datafile_rows_t trf_path_row_321[] = {"8696","1","4301","4326","","1363","",NULL};
+datafile_rows_t trf_path_row_322[] = {"8697","1","4301","4326","","1364","",NULL};
+datafile_rows_t trf_path_row_323[] = {"8698","1","4301","4326","","1365","",NULL};
+datafile_rows_t trf_path_row_324[] = {"8699","1","4301","4326","","1366","",NULL};
+datafile_rows_t trf_path_row_325[] = {"8700","1","4301","4326","","1367","",NULL};
+datafile_rows_t trf_path_row_326[] = {"8701","1","4301","4326","","1368","",NULL};
+datafile_rows_t trf_path_row_327[] = {"8702","1","4301","4326","","1369","",NULL};
+datafile_rows_t trf_path_row_328[] = {"8703","1","4301","4326","","1370","",NULL};
+datafile_rows_t trf_path_row_329[] = {"8704","1","4301","4326","","1371","",NULL};
+datafile_rows_t trf_path_row_330[] = {"8705","1","4301","4326","","1372","",NULL};
+datafile_rows_t trf_path_row_331[] = {"8706","1","4301","4326","","1373","",NULL};
+datafile_rows_t trf_path_row_332[] = {"8707","1","4301","4326","","1374","",NULL};
+datafile_rows_t trf_path_row_333[] = {"8708","1","4301","4326","","1375","",NULL};
+datafile_rows_t trf_path_row_334[] = {"8709","1","4301","4326","","1376","",NULL};
+datafile_rows_t trf_path_row_335[] = {"8710","1","4301","4326","","1377","",NULL};
+datafile_rows_t trf_path_row_336[] = {"8711","1","4301","4326","","1378","",NULL};
+datafile_rows_t trf_path_row_337[] = {"8712","1","4301","4326","","1379","",NULL};
+datafile_rows_t trf_path_row_338[] = {"8713","1","4301","4326","","1380","",NULL};
+datafile_rows_t trf_path_row_339[] = {"8714","1","4301","4326","","1381","",NULL};
+datafile_rows_t trf_path_row_340[] = {"8715","1","4301","4326","","1382","",NULL};
+datafile_rows_t trf_path_row_341[] = {"8716","1","4301","4326","","1383","",NULL};
+datafile_rows_t trf_path_row_342[] = {"8717","1","4301","4326","","1384","",NULL};
+datafile_rows_t trf_path_row_343[] = {"8718","1","4301","4326","","1385","",NULL};
+datafile_rows_t trf_path_row_344[] = {"8719","1","4301","4326","","1386","",NULL};
+datafile_rows_t trf_path_row_345[] = {"8720","1","4301","4326","","1387","",NULL};
+datafile_rows_t trf_path_row_346[] = {"8721","1","4301","4326","","1388","",NULL};
+datafile_rows_t trf_path_row_347[] = {"8722","1","4301","4326","","1389","",NULL};
+datafile_rows_t trf_path_row_348[] = {"8723","1","4301","4326","","1390","",NULL};
+datafile_rows_t trf_path_row_349[] = {"8724","1","4301","4326","","1391","",NULL};
+datafile_rows_t trf_path_row_350[] = {"8725","1","4301","4326","","1392","",NULL};
+datafile_rows_t trf_path_row_351[] = {"8726","1","4301","4326","","1393","",NULL};
+datafile_rows_t trf_path_row_352[] = {"8727","1","4301","4326","","1394","",NULL};
+datafile_rows_t trf_path_row_353[] = {"8728","1","4301","4326","","1395","",NULL};
+datafile_rows_t trf_path_row_354[] = {"8729","1","4301","4326","","1396","",NULL};
+datafile_rows_t trf_path_row_355[] = {"8730","1","4301","4326","","1397","",NULL};
+datafile_rows_t trf_path_row_356[] = {"8731","1","4301","4326","","1398","",NULL};
+datafile_rows_t trf_path_row_357[] = {"8732","1","4301","4326","","1399","",NULL};
+datafile_rows_t trf_path_row_358[] = {"8733","1","4301","4326","","1400","",NULL};
+datafile_rows_t trf_path_row_359[] = {"8734","1","4301","4326","","1401","",NULL};
+datafile_rows_t trf_path_row_360[] = {"8735","1","4301","4326","","1402","",NULL};
+datafile_rows_t trf_path_row_361[] = {"8736","1","4301","4326","","1403","",NULL};
+datafile_rows_t trf_path_row_362[] = {"8737","1","4301","4326","","1404","",NULL};
+datafile_rows_t trf_path_row_363[] = {"8738","1","4301","4326","","1405","",NULL};
+datafile_rows_t trf_path_row_364[] = {"8739","1","4301","4326","","1406","",NULL};
+datafile_rows_t trf_path_row_365[] = {"8740","1","4301","4326","","1407","",NULL};
+datafile_rows_t trf_path_row_366[] = {"8741","1","4301","4326","","1408","",NULL};
+datafile_rows_t trf_path_row_367[] = {"8742","1","4301","4326","","1409","",NULL};
+datafile_rows_t trf_path_row_368[] = {"8743","1","4301","4326","","1410","",NULL};
+datafile_rows_t trf_path_row_369[] = {"8744","1","4301","4326","","1411","",NULL};
+datafile_rows_t trf_path_row_370[] = {"8745","1","4301","4326","","1412","",NULL};
+datafile_rows_t trf_path_row_371[] = {"8746","1","4301","4326","","1413","",NULL};
+datafile_rows_t trf_path_row_372[] = {"8747","1","4301","4326","","1414","",NULL};
+datafile_rows_t trf_path_row_373[] = {"8748","1","4301","4326","","1415","",NULL};
+datafile_rows_t trf_path_row_374[] = {"8749","1","4301","4326","","1416","",NULL};
+datafile_rows_t trf_path_row_375[] = {"8750","1","4301","4326","","1417","",NULL};
+datafile_rows_t trf_path_row_376[] = {"8751","1","4301","4326","","1418","",NULL};
+datafile_rows_t trf_path_row_377[] = {"8752","1","4301","4326","","1419","",NULL};
+datafile_rows_t trf_path_row_378[] = {"8753","1","4301","4326","","1420","",NULL};
+datafile_rows_t trf_path_row_379[] = {"8754","1","4301","4326","","1421","",NULL};
+datafile_rows_t trf_path_row_380[] = {"8755","1","4301","4326","","1422","",NULL};
+datafile_rows_t trf_path_row_381[] = {"8756","1","4301","4326","","1423","",NULL};
+datafile_rows_t trf_path_row_382[] = {"8757","1","4301","4326","","1424","",NULL};
+datafile_rows_t trf_path_row_383[] = {"8758","1","4301","4326","","1425","",NULL};
+datafile_rows_t trf_path_row_384[] = {"8759","1","4301","4326","","1426","",NULL};
+datafile_rows_t trf_path_row_385[] = {"8760","1","4301","4326","","1427","",NULL};
+datafile_rows_t trf_path_row_386[] = {"8761","1","4301","4326","","1428","",NULL};
+datafile_rows_t trf_path_row_387[] = {"8762","1","4301","4326","","1429","",NULL};
+datafile_rows_t trf_path_row_388[] = {"8763","1","4301","4326","","1430","",NULL};
+datafile_rows_t trf_path_row_389[] = {"8764","1","4301","4326","","1431","",NULL};
+datafile_rows_t trf_path_row_390[] = {"8765","1","4301","4326","","1432","",NULL};
+datafile_rows_t trf_path_row_391[] = {"8766","1","4301","4326","","1433","",NULL};
+datafile_rows_t trf_path_row_392[] = {"8767","1","4301","4326","","1434","",NULL};
+datafile_rows_t trf_path_row_393[] = {"8768","1","4301","4326","","1435","",NULL};
+datafile_rows_t trf_path_row_394[] = {"8769","1","4301","4326","","1436","",NULL};
+datafile_rows_t trf_path_row_395[] = {"8770","1","4232","4326","","1438","",NULL};
+datafile_rows_t trf_path_row_396[] = {"8771","1","4134","4326","","1439","",NULL};
+datafile_rows_t trf_path_row_397[] = {"8772","1","4230","4326","","1440","",NULL};
+datafile_rows_t trf_path_row_398[] = {"8773","1","4601","4326","","1441","",NULL};
+datafile_rows_t trf_path_row_399[] = {"8774","1","4602","4326","","1442","",NULL};
+datafile_rows_t trf_path_row_400[] = {"8775","1","4603","4326","","1443","",NULL};
+datafile_rows_t trf_path_row_401[] = {"8776","1","4604","4326","","1444","",NULL};
+datafile_rows_t trf_path_row_402[] = {"8777","1","4605","4326","","1445","",NULL};
+datafile_rows_t trf_path_row_403[] = {"8778","1","4606","4326","","1446","",NULL};
+datafile_rows_t trf_path_row_404[] = {"8779","1","4600","4326","","1447","",NULL};
+datafile_rows_t trf_path_row_405[] = {"8780","1","4124","4258","","1437","",NULL};
+datafile_rows_t trf_path_row_406[] = {"8784","1","4230","4326","","1450","",NULL};
+datafile_rows_t trf_path_row_407[] = {"8785","1","4135","4269","","1454","",NULL};
+datafile_rows_t trf_path_row_408[] = {"8786","1","4135","4269","","1454","",NULL};
+datafile_rows_t trf_path_row_409[] = {"8786","2","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_410[] = {"8787","1","4136","4269","","1455","",NULL};
+datafile_rows_t trf_path_row_411[] = {"8788","1","4136","4269","","1455","",NULL};
+datafile_rows_t trf_path_row_412[] = {"8788","2","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_413[] = {"8789","1","4137","4269","","1456","",NULL};
+datafile_rows_t trf_path_row_414[] = {"8790","1","4137","4269","","1456","",NULL};
+datafile_rows_t trf_path_row_415[] = {"8790","2","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_416[] = {"8791","1","4138","4269","","1457","",NULL};
+datafile_rows_t trf_path_row_417[] = {"8792","1","4138","4269","","1457","",NULL};
+datafile_rows_t trf_path_row_418[] = {"8792","2","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_419[] = {"8793","1","4609","4269","","1451","",NULL};
+datafile_rows_t trf_path_row_420[] = {"8794","1","4609","4269","","1451","",NULL};
+datafile_rows_t trf_path_row_421[] = {"8794","2","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_422[] = {"8795","1","4202","4283","","1458","",NULL};
+datafile_rows_t trf_path_row_423[] = {"8796","1","4202","4283","","1458","",NULL};
+datafile_rows_t trf_path_row_424[] = {"8796","2","4283","4326","","1150","",NULL};
+datafile_rows_t trf_path_row_425[] = {"8797","1","4202","4283","","1459","",NULL};
+datafile_rows_t trf_path_row_426[] = {"8798","1","4202","4283","","1459","",NULL};
+datafile_rows_t trf_path_row_427[] = {"8798","2","4283","4326","","1150","",NULL};
+datafile_rows_t trf_path_row_428[] = {"8799","1","4202","4283","","1460","",NULL};
+datafile_rows_t trf_path_row_429[] = {"8800","1","4202","4283","","1460","",NULL};
+datafile_rows_t trf_path_row_430[] = {"8800","2","4283","4326","","1150","",NULL};
+datafile_rows_t trf_path_row_431[] = {"8801","1","4139","4269","","1461","",NULL};
+datafile_rows_t trf_path_row_432[] = {"8802","1","4139","4269","","1461","",NULL};
+datafile_rows_t trf_path_row_433[] = {"8802","2","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_434[] = {"8803","1","4267","4269","","1462","",NULL};
+datafile_rows_t trf_path_row_435[] = {"8804","1","4267","4269","","1462","",NULL};
+datafile_rows_t trf_path_row_436[] = {"8804","2","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_437[] = {"8805","1","4608","4269","","1463","",NULL};
+datafile_rows_t trf_path_row_438[] = {"8806","1","4608","4269","","1463","",NULL};
+datafile_rows_t trf_path_row_439[] = {"8806","2","4269","4326","","1188","",NULL};
+datafile_rows_t trf_path_row_440[] = {"8807","1","4202","4283","","1464","",NULL};
+datafile_rows_t trf_path_row_441[] = {"8808","1","4202","4283","","1464","",NULL};
+datafile_rows_t trf_path_row_442[] = {"8808","2","4283","4326","","1150","",NULL};
+datafile_rows_t trf_path_row_443[] = {"8811","1","4817","4273","","1466","",NULL};
+datafile_rows_t trf_path_row_444[] = {"8812","1","4807","4275","","1468","",NULL};
+datafile_rows_t trf_path_row_445[] = {"8813","1","4142","4326","","1469","",NULL};
+datafile_rows_t trf_path_row_446[] = {"8814","1","4143","4326","","1470","",NULL};
+datafile_rows_t trf_path_row_447[] = {"8815","1","4312","4326","","1471","",NULL};
+datafile_rows_t trf_path_row_448[] = {"8816","1","4122","4140","","1472","",NULL};
+datafile_rows_t trf_path_row_449[] = {"8817","1","4140","4326","","1473","",NULL};
+datafile_rows_t trf_path_row_450[] = {"8818","1","4122","4140","","1472","",NULL};
+datafile_rows_t trf_path_row_451[] = {"8818","2","4140","4326","","1473","",NULL};
+datafile_rows_t trf_path_row_452[] = {"8819","1","4269","4152","","1474","",NULL};
+datafile_rows_t trf_path_row_453[] = {"8820","1","4269","4152","","1475","",NULL};
+datafile_rows_t trf_path_row_454[] = {"8821","1","4269","4152","","1476","",NULL};
+datafile_rows_t trf_path_row_455[] = {"8822","1","4269","4152","","1477","",NULL};
+datafile_rows_t trf_path_row_456[] = {"8823","1","4269","4152","","1478","",NULL};
+datafile_rows_t trf_path_row_457[] = {"8824","1","4269","4152","","1479","",NULL};
+datafile_rows_t trf_path_row_458[] = {"8825","1","4269","4152","","1480","",NULL};
+datafile_rows_t trf_path_row_459[] = {"8826","1","4269","4152","","1481","",NULL};
+datafile_rows_t trf_path_row_460[] = {"8827","1","4269","4152","","1482","",NULL};
+datafile_rows_t trf_path_row_461[] = {"8828","1","4269","4152","","1483","",NULL};
+datafile_rows_t trf_path_row_462[] = {"8829","1","4269","4152","","1484","",NULL};
+datafile_rows_t trf_path_row_463[] = {"8830","1","4269","4152","","1485","",NULL};
+datafile_rows_t trf_path_row_464[] = {"8831","1","4269","4152","","1486","",NULL};
+datafile_rows_t trf_path_row_465[] = {"8832","1","4269","4152","","1487","",NULL};
+datafile_rows_t trf_path_row_466[] = {"8833","1","4269","4152","","1488","",NULL};
+datafile_rows_t trf_path_row_467[] = {"8834","1","4269","4152","","1489","",NULL};
+datafile_rows_t trf_path_row_468[] = {"8835","1","4269","4152","","1490","",NULL};
+datafile_rows_t trf_path_row_469[] = {"8836","1","4269","4152","","1491","",NULL};
+datafile_rows_t trf_path_row_470[] = {"8837","1","4269","4152","","1492","",NULL};
+datafile_rows_t trf_path_row_471[] = {"8838","1","4269","4152","","1493","",NULL};
+datafile_rows_t trf_path_row_472[] = {"8839","1","4269","4152","","1494","",NULL};
+datafile_rows_t trf_path_row_473[] = {"8840","1","4269","4152","","1495","",NULL};
+datafile_rows_t trf_path_row_474[] = {"8841","1","4269","4152","","1496","",NULL};
+datafile_rows_t trf_path_row_475[] = {"8842","1","4269","4152","","1497","",NULL};
+datafile_rows_t trf_path_row_476[] = {"8843","1","4269","4152","","1498","",NULL};
+datafile_rows_t trf_path_row_477[] = {"8844","1","4269","4152","","1499","",NULL};
+datafile_rows_t trf_path_row_478[] = {"8845","1","4269","4152","","1500","",NULL};
+datafile_rows_t trf_path_row_479[] = {"8846","1","4269","4152","","1501","",NULL};
+datafile_rows_t trf_path_row_480[] = {"8847","1","4269","4152","","1502","",NULL};
+datafile_rows_t trf_path_row_481[] = {"8848","1","4269","4152","","1503","",NULL};
+datafile_rows_t trf_path_row_482[] = {"8849","1","4222","4148","","1504","",NULL};
+datafile_rows_t trf_path_row_483[] = {"8850","1","4148","4326","","1505","",NULL};
+datafile_rows_t trf_path_row_484[] = {"8851","1","4202","4283","","1506","",NULL};
+datafile_rows_t trf_path_row_485[] = {"8852","1","4202","4283","","1507","",NULL};
+datafile_rows_t trf_path_row_486[] = {"8853","1","4202","4283","","1506","",NULL};
+datafile_rows_t trf_path_row_487[] = {"8853","2","4283","4326","","1150","",NULL};
+datafile_rows_t trf_path_row_488[] = {"8854","1","4202","4283","","1507","",NULL};
+datafile_rows_t trf_path_row_489[] = {"8854","2","4283","4326","","1150","",NULL};
+datafile_rows_t trf_path_row_490[] = {"8855","1","4149","4326","","1508","",NULL};
+datafile_rows_t trf_path_row_491[] = {"8856","1","4150","4151","","1509","",NULL};
+datafile_rows_t trf_path_row_492[] = {"8857","1","4150","4151","","1509","",NULL};
+datafile_rows_t trf_path_row_493[] = {"8857","2","4151","4326","","1511","",NULL};
+datafile_rows_t trf_path_row_494[] = {"8858","1","4149","4326","","1510","",NULL};
+datafile_rows_t trf_path_row_495[] = {"8859","1","4151","4326","","1511","",NULL};
+datafile_rows_t trf_path_row_496[] = {"8860","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_497[] = {"8860","2","4269","4152","","1474","",NULL};
+datafile_rows_t trf_path_row_498[] = {"8861","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_499[] = {"8861","2","4269","4152","","1475","",NULL};
+datafile_rows_t trf_path_row_500[] = {"8862","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_501[] = {"8862","2","4269","4152","","1476","",NULL};
+datafile_rows_t trf_path_row_502[] = {"8863","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_503[] = {"8863","2","4269","4152","","1477","",NULL};
+datafile_rows_t trf_path_row_504[] = {"8864","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_505[] = {"8864","2","4269","4152","","1478","",NULL};
+datafile_rows_t trf_path_row_506[] = {"8865","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_507[] = {"8865","2","4269","4152","","1479","",NULL};
+datafile_rows_t trf_path_row_508[] = {"8866","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_509[] = {"8866","2","4269","4152","","1480","",NULL};
+datafile_rows_t trf_path_row_510[] = {"8867","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_511[] = {"8867","2","4269","4152","","1481","",NULL};
+datafile_rows_t trf_path_row_512[] = {"8868","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_513[] = {"8868","2","4269","4152","","1482","",NULL};
+datafile_rows_t trf_path_row_514[] = {"8869","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_515[] = {"8869","2","4269","4152","","1483","",NULL};
+datafile_rows_t trf_path_row_516[] = {"8870","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_517[] = {"8870","2","4269","4152","","1484","",NULL};
+datafile_rows_t trf_path_row_518[] = {"8871","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_519[] = {"8871","2","4269","4152","","1485","",NULL};
+datafile_rows_t trf_path_row_520[] = {"8872","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_521[] = {"8872","2","4269","4152","","1486","",NULL};
+datafile_rows_t trf_path_row_522[] = {"8873","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_523[] = {"8873","2","4269","4152","","1487","",NULL};
+datafile_rows_t trf_path_row_524[] = {"8874","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_525[] = {"8874","2","4269","4152","","1488","",NULL};
+datafile_rows_t trf_path_row_526[] = {"8875","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_527[] = {"8875","2","4269","4152","","1489","",NULL};
+datafile_rows_t trf_path_row_528[] = {"8876","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_529[] = {"8876","2","4269","4152","","1490","",NULL};
+datafile_rows_t trf_path_row_530[] = {"8877","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_531[] = {"8877","2","4269","4152","","1491","",NULL};
+datafile_rows_t trf_path_row_532[] = {"8878","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_533[] = {"8878","2","4269","4152","","1492","",NULL};
+datafile_rows_t trf_path_row_534[] = {"8879","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_535[] = {"8879","2","4269","4152","","1493","",NULL};
+datafile_rows_t trf_path_row_536[] = {"8880","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_537[] = {"8880","2","4269","4152","","1494","",NULL};
+datafile_rows_t trf_path_row_538[] = {"8881","1","4139","4269","","1461","",NULL};
+datafile_rows_t trf_path_row_539[] = {"8881","2","4269","4152","","1495","",NULL};
+datafile_rows_t trf_path_row_540[] = {"8882","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_541[] = {"8882","2","4269","4152","","1496","",NULL};
+datafile_rows_t trf_path_row_542[] = {"8883","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_543[] = {"8883","2","4269","4152","","1497","",NULL};
+datafile_rows_t trf_path_row_544[] = {"8884","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_545[] = {"8884","2","4269","4152","","1498","",NULL};
+datafile_rows_t trf_path_row_546[] = {"8885","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_547[] = {"8885","2","4269","4152","","1499","",NULL};
+datafile_rows_t trf_path_row_548[] = {"8886","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_549[] = {"8886","2","4269","4152","","1500","",NULL};
+datafile_rows_t trf_path_row_550[] = {"8887","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_551[] = {"8887","2","4269","4152","","1501","",NULL};
+datafile_rows_t trf_path_row_552[] = {"8888","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_553[] = {"8888","2","4269","4152","","1502","",NULL};
+datafile_rows_t trf_path_row_554[] = {"8889","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_555[] = {"8889","2","4269","4152","","1503","",NULL};
+datafile_rows_t trf_path_row_556[] = {"8890","1","4153","4326","","1512","",NULL};
+datafile_rows_t trf_path_row_557[] = {"8891","1","4132","4326","","1513","",NULL};
+datafile_rows_t trf_path_row_558[] = {"8892","1","4154","4326","","1514","",NULL};
+datafile_rows_t trf_path_row_559[] = {"8893","1","4269","4326","","1308","",NULL};
+datafile_rows_t trf_path_row_560[] = {"8894","1","4269","4326","","1515","",NULL};
+datafile_rows_t trf_path_row_561[] = {"8895","1","4247","4326","","1516","",NULL};
+datafile_rows_t trf_path_row_562[] = {"8896","1","4267","4269","","1241","",NULL};
+datafile_rows_t trf_path_row_563[] = {"8896","2","4269","4326","","1515","",NULL};
+datafile_rows_t trf_path_row_564[] = {"8897","1","4267","4269","","1243","",NULL};
+datafile_rows_t trf_path_row_565[] = {"8897","2","4269","4326","","1515","",NULL};
+
+datafile_rows_t *trf_path_rows[] = {trf_path_row_1,trf_path_row_2,trf_path_row_3,trf_path_row_4,trf_path_row_5,trf_path_row_6,trf_path_row_7,trf_path_row_8,trf_path_row_9,trf_path_row_10,trf_path_row_11,trf_path_row_12,trf_path_row_13,trf_path_row_14,trf_path_row_15,trf_path_row_16,trf_path_row_17,trf_path_row_18,trf_path_row_19,trf_path_row_20,trf_path_row_21,trf_path_row_22,trf_path_row_23,trf_path_row_24,trf_path_row_25,trf_path_row_26,trf_path_row_27,trf_path_row_28,trf_path_row_29,t [...]
diff --git a/src/tiff/csv/trf_path.csv b/src/tiff/csv/trf_path.csv
new file mode 100644
index 0000000..d522f3f
--- /dev/null
+++ b/src/tiff/csv/trf_path.csv
@@ -0,0 +1,565 @@
+"TRF_PATH_CODE","TRF_STEP_CODE","SOURCE_HORIZCS_CODE","TARGET_HORIZCS_CODE","POLYN_TRF_CODE","NONPOLYN_TRF_CODE","CHANGE_ID"
+8400,1,4201,4326,,1100,
+8401,1,4201,4326,,1101,
+8402,1,4201,4326,,1102,
+8403,1,4201,4326,,1103,
+8404,1,4201,4326,,1104,
+8405,1,4201,4326,,1105,
+8406,1,4201,4326,,1106,
+8407,1,4205,4326,,1107,
+8408,1,4202,4326,,1108,
+8409,1,4203,4326,,1109,
+8410,1,4204,4326,,1110,
+8411,1,4204,4326,,1111,
+8412,1,4289,4326,,1112,
+8413,1,4209,4326,,1113,
+8414,1,4209,4326,,1114,
+8415,1,4209,4326,,1115,
+8416,1,4209,4326,,1116,
+8417,1,4209,4326,,1117,
+8418,1,4209,4326,,1118,
+8419,1,4209,4326,,1119,
+8420,1,4209,4326,,1120,
+8421,1,4209,4326,,1121,
+8422,1,4210,4326,,1122,
+8423,1,4211,4326,,1123,
+8424,1,4216,4326,,1124,
+8425,1,4218,4326,,1125,
+8426,1,4219,4326,,1126,
+8427,1,4221,4326,,1127,
+8428,1,4222,4326,,1128,
+8429,1,4222,4326,,1129,
+8430,1,4223,4326,,1130,
+8431,1,4224,4326,,1131,
+8432,1,4225,4326,,1132,
+8433,1,4230,4326,,1133,
+8434,1,4230,4326,,1134,
+8435,1,4230,4326,,1135,
+8436,1,4230,4326,,1136,
+8437,1,4230,4326,,1137,
+8438,1,4230,4326,,1138,
+8439,1,4230,4326,,1139,
+8440,1,4230,4326,,1140,
+8441,1,4230,4326,,1141,
+8442,1,4230,4326,,1142,
+8443,1,4230,4326,,1143,
+8444,1,4230,4326,,1144,
+8445,1,4230,4326,,1145,
+8446,1,4230,4231,1000,,
+8446,2,4231,4326,,1146,
+8447,1,4230,4231,,1147,
+8447,2,4231,4326,,1146,
+8448,1,4229,4326,,1148,
+8449,1,4258,4326,,1149,
+8450,1,4283,4326,,1150,
+8451,1,4272,4326,,1151,
+8452,1,4236,4326,,1152,
+8453,1,4239,4326,,1153,
+8454,1,4240,4326,,1154,
+8455,1,4144,4326,,1155,97.235
+8456,1,4146,4326,,1156,97.235
+8457,1,4244,4326,,1157,
+8458,1,4245,4326,,1158,
+8459,1,4250,4326,,1159,
+8460,1,4251,4326,,1160,
+8461,1,4253,4326,,1161,
+8462,1,4253,4326,,1162,
+8463,1,4266,4326,,1163,
+8464,1,4256,4326,,1164,
+8465,1,4262,4326,,1165,
+8466,1,4261,4326,,1166,
+8467,1,4263,4326,,1167,
+8468,1,4263,4326,,1168,
+8469,1,4265,4326,,1169,
+8470,1,4267,4326,,1170,
+8471,1,4267,4326,,1171,
+8472,1,4267,4326,,1172,
+8473,1,4267,4326,,1173,
+8474,1,4267,4326,,1174,
+8475,1,4267,4326,,1175,
+8476,1,4267,4326,,1176,
+8477,1,4267,4326,,1177,
+8478,1,4267,4326,,1178,
+8479,1,4267,4326,,1179,
+8480,1,4267,4326,,1180,
+8481,1,4267,4326,,1181,
+8482,1,4267,4326,,1182,
+8483,1,4267,4326,,1183,
+8484,1,4267,4326,,1184,
+8485,1,4267,4326,,1185,
+8486,1,4267,4326,,1186,
+8487,1,4267,4326,,1187,
+8488,1,4269,4326,,1188,
+8489,1,4270,4326,,1189,
+8490,1,4270,4326,,1190,
+8491,1,4270,4326,,1191,
+8492,1,4271,4326,,1192,
+8493,1,4275,4326,,1193,
+8494,1,4807,4275,,1467,97.05
+8494,2,4275,4326,,1193,
+8495,1,4277,4326,,1195,
+8496,1,4277,4326,,1196,
+8497,1,4277,4326,,1197,
+8498,1,4277,4326,,1198,
+8499,1,4277,4326,,1199,
+8500,1,4282,4326,,1200,
+8501,1,4248,4326,,1201,
+8502,1,4248,4326,,1202,
+8503,1,4248,4326,,1203,
+8504,1,4248,4326,,1204,
+8505,1,4248,4326,,1205,
+8506,1,4248,4326,,1206,
+8507,1,4248,4326,,1207,
+8508,1,4248,4326,,1208,
+8509,1,4248,4326,,1209,
+8510,1,4285,4326,,1210,
+8511,1,4287,4326,,1211,
+8512,1,4291,4326,,1212,
+8513,1,4291,4326,,1213,
+8514,1,4291,4326,,1214,
+8515,1,4291,4326,,1215,
+8516,1,4291,4326,,1216,
+8517,1,4291,4326,,1217,
+8518,1,4291,4326,,1218,
+8519,1,4291,4326,,1219,
+8520,1,4291,4326,,1220,
+8521,1,4291,4326,,1221,
+8522,1,4291,4326,,1222,
+8523,1,4291,4326,,1223,
+8524,1,4291,4326,,1224,
+8525,1,4292,4326,,1225,
+8526,1,4293,4326,,1226,
+8527,1,4297,4326,,1227,
+8528,1,4298,4326,,1228,
+8529,1,4299,4326,,1229,
+8530,1,4301,4326,,1230,
+8531,1,4301,4326,,1231,
+8532,1,4301,4326,,1232,
+8533,1,4301,4326,,1233,
+8534,1,4309,4326,,1234,
+8535,1,4311,4326,,1235,
+8536,1,4230,4231,1000,,
+8537,1,4231,4326,,1146,
+8538,1,4230,4231,,1147,
+8539,1,4203,4326,,1236,
+8540,1,4322,4326,,1237,
+8541,1,4322,4326,,1238,
+8542,1,4324,4322,,1239,
+8543,1,4324,4326,,1240,
+8544,1,4267,4269,,1241,
+8546,1,4267,4269,,1243,
+8548,1,4230,4326,,1245,
+8549,1,4255,4326,,1246,
+8550,1,4145,4326,,1247,97.235
+8551,1,4238,4326,,1248,
+8552,1,4267,4326,,1249,
+8553,1,4267,4326,,1250,
+8554,1,4269,4326,,1251,
+8555,1,4269,4326,,1252,
+8556,1,4307,4326,,1253,
+8557,1,4284,4326,,1254,
+8558,1,4305,4326,,1255,
+8559,1,4232,4326,,1256,
+8560,1,4807,4275,,1467,99.63
+8561,1,4801,4217,,1257,
+8562,1,4802,4218,,1258,
+8563,1,4802,4218,,1258,
+8563,2,4218,4326,,1125,
+8564,1,4803,4207,,1259,
+8565,1,4804,4257,,1260,
+8566,1,4805,4312,,1261,
+8567,1,4806,4265,,1262,
+8568,1,4806,4265,,1262,
+8568,2,4265,4326,,1169,
+8569,1,4808,4280,,1263,
+8570,1,4809,4215,,1264,
+8571,1,4810,4297,,1265,
+8572,1,4810,4297,,1265,
+8572,2,4297,4326,,1227,
+8573,1,4811,4304,,1266,
+8574,1,4812,4305,,1267,
+8575,1,4812,4305,,1267,
+8575,2,4305,4326,,1255,
+8576,1,4813,4211,,1268,
+8577,1,4813,4211,,1268,
+8577,2,4211,4326,,1123,
+8578,1,4814,4308,,1269,98.51
+8579,1,4815,4120,,1270,
+8580,1,4293,4326,,1271,
+8581,1,4121,4326,,1272,
+8582,1,4237,4258,,1273,
+8583,1,4237,4258,,1273,
+8583,2,4258,4326,,1149,
+8584,1,4230,4326,,1275,
+8585,1,4275,4230,,1276,
+8586,1,4807,4275,,1467,
+8586,2,4275,4230,,1276,
+8587,1,4275,4322,,1277,
+8588,1,4807,4275,,1467,
+8588,2,4275,4322,,1277,
+8589,1,4202,4283,,1278,
+8590,1,4202,4283,,1278,
+8590,2,4283,4326,,1150,98.50
+8591,1,4203,4283,,1279,
+8592,1,4203,4283,,1279,
+8592,2,4283,4326,,1150,98.50
+8593,1,4203,4283,,1280,
+8594,1,4203,4283,,1280,
+8594,2,4283,4326,,1150,98.50
+8595,1,4124,4258,,1437,99.11
+8595,2,4258,4326,,1149,99.11
+8596,1,4125,4326,,1282,
+8597,1,4284,4126,,1274,
+8598,1,4126,4326,,1283,
+8599,1,4210,4326,,1284,
+8600,1,4210,4326,,1285,
+8601,1,4294,4326,,1286,
+8602,1,4284,4326,,1287,
+8603,1,4284,4326,,1288,
+8604,1,4284,4326,,1289,
+8605,1,4284,4326,,1290,
+8606,1,4284,4326,,1291,
+8607,1,4284,4326,,1292,
+8608,1,4284,4326,,1293,
+8609,1,4284,4126,,1274,
+8609,2,4126,4326,,1283,
+8610,1,4304,4326,,1294,
+8611,1,4811,4304,,1266,
+8611,2,4304,4326,,1294,
+8612,1,4271,4326,,1295,
+8613,1,4302,4326,,1296,
+8614,1,4127,4130,,1297,
+8615,1,4127,4130,,1297,
+8615,2,4130,4326,,1302,
+8616,1,4127,4130,,1298,
+8617,1,4127,4130,,1298,
+8617,2,4130,4326,,1302,
+8618,1,4127,4130,,1299,
+8619,1,4127,4130,,1299,
+8619,2,4130,4326,,1302,
+8620,1,4127,4130,,1300,
+8621,1,4127,4130,,1300,
+8621,2,4130,4326,,1302,
+8622,1,4127,4130,,1301,
+8623,1,4127,4130,,1301,
+8623,2,4130,4326,,1302,
+8624,1,4130,4326,,1302,
+8625,1,4284,4326,,1303,
+8626,1,4240,4326,,1304,
+8627,1,4301,4326,,1305,
+8628,1,4312,4326,,1306,
+8629,1,4271,4326,,1307,
+8633,1,4314,4258,,1309,
+8634,1,4314,4258,,1309,
+8634,2,4258,4326,,1149,
+8635,1,4284,4258,,1310,
+8636,1,4284,4258,,1310,
+8636,2,4258,4326,,1149,
+8637,1,4230,4326,,1311,
+8638,1,4903,4230,1001,,
+8639,1,4903,4230,1002,,
+8640,1,4903,4230,1003,,
+8641,1,4903,4230,1001,,
+8641,2,4230,4326,,1145,
+8642,1,4267,4269,,1312,
+8643,1,4267,4269,,1312,
+8643,2,4269,4326,,1188,
+8644,1,4267,4269,,1313,
+8645,1,4267,4269,,1313,
+8645,2,4269,4326,,1188,
+8646,1,4277,4326,,1314,
+8647,1,4277,4230,,1315,
+8648,1,4260,4326,,1316,
+8649,1,4220,4324,,1317,
+8650,1,4220,4326,,1318,
+8651,1,4220,4326,,1319,
+8652,1,4220,4326,,1320,
+8653,1,4220,4326,,1321,
+8654,1,4220,4326,,1322,
+8655,1,4220,4326,,1323,
+8656,1,4220,4326,,1324,
+8657,1,4220,4326,,1325,
+8658,1,4220,4326,,1326,
+8659,1,4220,4326,,1327,
+8660,1,4259,4264,,1328,
+8661,1,4264,4326,,1329,
+8662,1,4259,4326,,1330,
+8663,1,4805,4312,,1261,
+8663,2,4312,4326,,1306,
+8664,1,4133,4258,,1331,
+8665,1,4284,4133,,1332,
+8666,1,4133,4326,,1333,
+8667,1,4284,4326,,1334,
+8668,1,4301,4326,,1335,
+8669,1,4301,4326,,1336,
+8670,1,4301,4326,,1337,
+8671,1,4301,4326,,1338,
+8672,1,4301,4326,,1339,
+8673,1,4301,4326,,1340,
+8674,1,4301,4326,,1341,
+8675,1,4301,4326,,1342,
+8676,1,4301,4326,,1343,
+8677,1,4301,4326,,1344,
+8678,1,4301,4326,,1345,
+8679,1,4301,4326,,1346,
+8680,1,4301,4326,,1347,
+8681,1,4301,4326,,1348,
+8682,1,4301,4326,,1349,
+8683,1,4301,4326,,1350,
+8684,1,4301,4326,,1351,
+8685,1,4301,4326,,1352,
+8686,1,4301,4326,,1353,
+8687,1,4301,4326,,1354,
+8688,1,4301,4326,,1355,
+8689,1,4301,4326,,1356,
+8690,1,4301,4326,,1357,
+8691,1,4301,4326,,1358,
+8692,1,4301,4326,,1359,
+8693,1,4301,4326,,1360,
+8694,1,4301,4326,,1361,
+8695,1,4301,4326,,1362,
+8696,1,4301,4326,,1363,
+8697,1,4301,4326,,1364,
+8698,1,4301,4326,,1365,
+8699,1,4301,4326,,1366,
+8700,1,4301,4326,,1367,
+8701,1,4301,4326,,1368,
+8702,1,4301,4326,,1369,
+8703,1,4301,4326,,1370,
+8704,1,4301,4326,,1371,
+8705,1,4301,4326,,1372,
+8706,1,4301,4326,,1373,
+8707,1,4301,4326,,1374,
+8708,1,4301,4326,,1375,
+8709,1,4301,4326,,1376,
+8710,1,4301,4326,,1377,
+8711,1,4301,4326,,1378,
+8712,1,4301,4326,,1379,
+8713,1,4301,4326,,1380,
+8714,1,4301,4326,,1381,
+8715,1,4301,4326,,1382,
+8716,1,4301,4326,,1383,
+8717,1,4301,4326,,1384,
+8718,1,4301,4326,,1385,
+8719,1,4301,4326,,1386,
+8720,1,4301,4326,,1387,
+8721,1,4301,4326,,1388,
+8722,1,4301,4326,,1389,
+8723,1,4301,4326,,1390,
+8724,1,4301,4326,,1391,
+8725,1,4301,4326,,1392,
+8726,1,4301,4326,,1393,
+8727,1,4301,4326,,1394,
+8728,1,4301,4326,,1395,
+8729,1,4301,4326,,1396,
+8730,1,4301,4326,,1397,
+8731,1,4301,4326,,1398,
+8732,1,4301,4326,,1399,
+8733,1,4301,4326,,1400,
+8734,1,4301,4326,,1401,
+8735,1,4301,4326,,1402,
+8736,1,4301,4326,,1403,
+8737,1,4301,4326,,1404,
+8738,1,4301,4326,,1405,
+8739,1,4301,4326,,1406,
+8740,1,4301,4326,,1407,
+8741,1,4301,4326,,1408,
+8742,1,4301,4326,,1409,
+8743,1,4301,4326,,1410,
+8744,1,4301,4326,,1411,
+8745,1,4301,4326,,1412,
+8746,1,4301,4326,,1413,
+8747,1,4301,4326,,1414,
+8748,1,4301,4326,,1415,
+8749,1,4301,4326,,1416,
+8750,1,4301,4326,,1417,
+8751,1,4301,4326,,1418,
+8752,1,4301,4326,,1419,
+8753,1,4301,4326,,1420,
+8754,1,4301,4326,,1421,
+8755,1,4301,4326,,1422,
+8756,1,4301,4326,,1423,
+8757,1,4301,4326,,1424,
+8758,1,4301,4326,,1425,
+8759,1,4301,4326,,1426,
+8760,1,4301,4326,,1427,
+8761,1,4301,4326,,1428,
+8762,1,4301,4326,,1429,
+8763,1,4301,4326,,1430,
+8764,1,4301,4326,,1431,
+8765,1,4301,4326,,1432,
+8766,1,4301,4326,,1433,
+8767,1,4301,4326,,1434,
+8768,1,4301,4326,,1435,
+8769,1,4301,4326,,1436,
+8770,1,4232,4326,,1438,
+8771,1,4134,4326,,1439,
+8772,1,4230,4326,,1440,
+8773,1,4601,4326,,1441,
+8774,1,4602,4326,,1442,
+8775,1,4603,4326,,1443,
+8776,1,4604,4326,,1444,
+8777,1,4605,4326,,1445,
+8778,1,4606,4326,,1446,
+8779,1,4600,4326,,1447,
+8780,1,4124,4258,,1437,
+8784,1,4230,4326,,1450,
+8785,1,4135,4269,,1454,
+8786,1,4135,4269,,1454,
+8786,2,4269,4326,,1188,
+8787,1,4136,4269,,1455,
+8788,1,4136,4269,,1455,
+8788,2,4269,4326,,1188,
+8789,1,4137,4269,,1456,
+8790,1,4137,4269,,1456,
+8790,2,4269,4326,,1188,
+8791,1,4138,4269,,1457,
+8792,1,4138,4269,,1457,
+8792,2,4269,4326,,1188,
+8793,1,4609,4269,,1451,
+8794,1,4609,4269,,1451,
+8794,2,4269,4326,,1188,
+8795,1,4202,4283,,1458,
+8796,1,4202,4283,,1458,
+8796,2,4283,4326,,1150,
+8797,1,4202,4283,,1459,
+8798,1,4202,4283,,1459,
+8798,2,4283,4326,,1150,
+8799,1,4202,4283,,1460,
+8800,1,4202,4283,,1460,
+8800,2,4283,4326,,1150,
+8801,1,4139,4269,,1461,
+8802,1,4139,4269,,1461,
+8802,2,4269,4326,,1188,
+8803,1,4267,4269,,1462,
+8804,1,4267,4269,,1462,
+8804,2,4269,4326,,1188,
+8805,1,4608,4269,,1463,
+8806,1,4608,4269,,1463,
+8806,2,4269,4326,,1188,
+8807,1,4202,4283,,1464,
+8808,1,4202,4283,,1464,
+8808,2,4283,4326,,1150,
+8811,1,4817,4273,,1466,
+8812,1,4807,4275,,1468,
+8813,1,4142,4326,,1469,
+8814,1,4143,4326,,1470,
+8815,1,4312,4326,,1471,
+8816,1,4122,4140,,1472,
+8817,1,4140,4326,,1473,
+8818,1,4122,4140,,1472,
+8818,2,4140,4326,,1473,
+8819,1,4269,4152,,1474,
+8820,1,4269,4152,,1475,
+8821,1,4269,4152,,1476,
+8822,1,4269,4152,,1477,
+8823,1,4269,4152,,1478,
+8824,1,4269,4152,,1479,
+8825,1,4269,4152,,1480,
+8826,1,4269,4152,,1481,
+8827,1,4269,4152,,1482,
+8828,1,4269,4152,,1483,
+8829,1,4269,4152,,1484,
+8830,1,4269,4152,,1485,
+8831,1,4269,4152,,1486,
+8832,1,4269,4152,,1487,
+8833,1,4269,4152,,1488,
+8834,1,4269,4152,,1489,
+8835,1,4269,4152,,1490,
+8836,1,4269,4152,,1491,
+8837,1,4269,4152,,1492,
+8838,1,4269,4152,,1493,
+8839,1,4269,4152,,1494,
+8840,1,4269,4152,,1495,
+8841,1,4269,4152,,1496,
+8842,1,4269,4152,,1497,
+8843,1,4269,4152,,1498,
+8844,1,4269,4152,,1499,
+8845,1,4269,4152,,1500,
+8846,1,4269,4152,,1501,
+8847,1,4269,4152,,1502,
+8848,1,4269,4152,,1503,
+8849,1,4222,4148,,1504,
+8850,1,4148,4326,,1505,
+8851,1,4202,4283,,1506,
+8852,1,4202,4283,,1507,
+8853,1,4202,4283,,1506,
+8853,2,4283,4326,,1150,
+8854,1,4202,4283,,1507,
+8854,2,4283,4326,,1150,
+8855,1,4149,4326,,1508,
+8856,1,4150,4151,,1509,
+8857,1,4150,4151,,1509,
+8857,2,4151,4326,,1511,
+8858,1,4149,4326,,1510,
+8859,1,4151,4326,,1511,
+8860,1,4267,4269,,1241,
+8860,2,4269,4152,,1474,
+8861,1,4267,4269,,1241,
+8861,2,4269,4152,,1475,
+8862,1,4267,4269,,1241,
+8862,2,4269,4152,,1476,
+8863,1,4267,4269,,1241,
+8863,2,4269,4152,,1477,
+8864,1,4267,4269,,1241,
+8864,2,4269,4152,,1478,
+8865,1,4267,4269,,1241,
+8865,2,4269,4152,,1479,
+8866,1,4267,4269,,1241,
+8866,2,4269,4152,,1480,
+8867,1,4267,4269,,1241,
+8867,2,4269,4152,,1481,
+8868,1,4267,4269,,1241,
+8868,2,4269,4152,,1482,
+8869,1,4267,4269,,1241,
+8869,2,4269,4152,,1483,
+8870,1,4267,4269,,1241,
+8870,2,4269,4152,,1484,
+8871,1,4267,4269,,1241,
+8871,2,4269,4152,,1485,
+8872,1,4267,4269,,1241,
+8872,2,4269,4152,,1486,
+8873,1,4267,4269,,1241,
+8873,2,4269,4152,,1487,
+8874,1,4267,4269,,1241,
+8874,2,4269,4152,,1488,
+8875,1,4267,4269,,1241,
+8875,2,4269,4152,,1489,
+8876,1,4267,4269,,1241,
+8876,2,4269,4152,,1490,
+8877,1,4267,4269,,1241,
+8877,2,4269,4152,,1491,
+8878,1,4267,4269,,1241,
+8878,2,4269,4152,,1492,
+8879,1,4267,4269,,1241,
+8879,2,4269,4152,,1493,
+8880,1,4267,4269,,1241,
+8880,2,4269,4152,,1494,
+8881,1,4139,4269,,1461,
+8881,2,4269,4152,,1495,
+8882,1,4267,4269,,1241,
+8882,2,4269,4152,,1496,
+8883,1,4267,4269,,1241,
+8883,2,4269,4152,,1497,
+8884,1,4267,4269,,1241,
+8884,2,4269,4152,,1498,
+8885,1,4267,4269,,1241,
+8885,2,4269,4152,,1499,
+8886,1,4267,4269,,1241,
+8886,2,4269,4152,,1500,
+8887,1,4267,4269,,1241,
+8887,2,4269,4152,,1501,
+8888,1,4267,4269,,1241,
+8888,2,4269,4152,,1502,
+8889,1,4267,4269,,1241,
+8889,2,4269,4152,,1503,
+8890,1,4153,4326,,1512,
+8891,1,4132,4326,,1513,
+8892,1,4154,4326,,1514,
+8893,1,4269,4326,,1308,
+8894,1,4269,4326,,1515,
+8895,1,4247,4326,,1516,
+8896,1,4267,4269,,1241,
+8896,2,4269,4326,,1515,
+8897,1,4267,4269,,1243,
+8897,2,4269,4326,,1515,
diff --git a/src/tiff/csv/unit_of_measure.csv b/src/tiff/csv/unit_of_measure.csv
new file mode 100644
index 0000000..a34e40a
--- /dev/null
+++ b/src/tiff/csv/unit_of_measure.csv
@@ -0,0 +1,64 @@
+"UOM_CODE","UNIT_OF_MEAS_NAME","UNIT_OF_MEAS_TYPE","TARGET_UOM_CODE","FACTOR_B","FACTOR_C","REMARKS","INFORMATION_SOURCE","DATA_SOURCE","REVISION_DATE","CHANGE_ID","DEPRECATED"
+9001,metre,length,9001,1.0,1.0,Also known as International metre.,ISO 1000.,EPSG,1995-06-02 00:00:00,,0
+9002,foot,length,9001,0.3048,1.0,,ISO; 1958,EPSG,1995-06-02 00:00:00,,0
+9003,US survey foot,length,9001,12.0,39.37,Used in USA.,EPSG,EPSG,2000-05-07 00:00:00,99.99,0
+9005,Clarke's foot,length,9001,0.304797265,1.0,"Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.",Australian Land Information Group  www.auslig.gov.au/geodesy/histry.htm,EPSG,2001-01-21 00:00:00,97.234 99.99  2000.05,0
+9014,fathom,length,9001,1.8288,1.0,= 6 feet.,,EPSG,1995-06-02 00:00:00,,0
+9030,nautical mile,length,9001,1852.0,1.0,,,EPSG,1996-10-18 00:00:00,96.24,0
+9031,German legal metre,length,9001,1.0000135965,1.0,Used in Namibia.,Chief Directorate Surveys and Land Information; Mowbray; South Africa,EPSG,1997-06-16 00:00:00,,0
+9033,US survey chain,length,9001,792.0,39.37,Used in USA primarily for public lands cadastral work.,Bureau of Land Management technical bulletin 6 (1973) and Standard Field Tables 8th edition (1956).,EPSG,2000-05-07 00:00:00,99.99,0
+9034,US survey link,length,9001,7.92,39.37,Used in USA primarily for public lands cadastral work.,Bureau of Land Management technical bulletin 6 (1973) and Standard Field Tables 8th edition (1956).,EPSG,2000-05-07 00:00:00,99.99,0
+9035,US survey mile,length,9001,63360.0,39.37,Used in USA primarily for public lands cadastral work.,Bureau of Land Management technical bulletin 6 (1973) and Standard Field Tables 8th edition (1956).,EPSG,2000-05-07 00:00:00,99.99,0
+9036,kilometre,length,9001,1000.0,1.0,,ISO 1000.,EPSG,1998-11-11 00:00:00,,0
+9037,Clarke's yard,length,9001,0.914391795,1.0,"=3 Clarke's feet.  Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.",Australian Land Information Group  www.auslig.gov.au/geodesy/histry.htm,EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9038,Clarke's chain,length,9001,20.11661949,1.0,"=22 Clarke's yards.  Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.",Australian Land Information Group  www.auslig.gov.au/geodesy/histry.htm,EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9039,Clarke's link,length,9001,0.2011661949,1.0,"=1/100 Clarke's chain. Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.",Australian Land Information Group  www.auslig.gov.au/geodesy/histry.htm,EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9040,British yard (Sears 1922),length,9001,36.0,39.370147,Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.,"G. Bomford ""Geodesy"" 2nd edition 1962; after J.S.Clark ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9041,British foot (Sears 1922),length,9001,12.0,39.370147,Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.,"G. Bomford ""Geodesy"" 2nd edition 1962; after J.S.Clark ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9042,British chain (Sears 1922),length,9001,792.0,39.370147,Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.,"G. Bomford ""Geodesy"" 2nd edition 1962; after J.S.Clark ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9043,British link (Sears 1922),length,9001,7.92,39.370147,Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.,"G. Bomford ""Geodesy"" 2nd edition 1962; after J.S.Clark ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9050,British yard (Benoit 1895 A),length,9001,0.9143992,1.0,Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.,"J.S.Clark; ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9051,British foot (Benoit 1895 A),length,9001,0.9143992,3.0,Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.,"J.S.Clark; ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9052,British chain (Benoit 1895 A),length,9001,20.1167824,1.0,Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.,"J.S.Clark; ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9053,British link (Benoit 1895 A),length,9001,0.201167824,1.0,Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.,"J.S.Clark; ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9060,British yard (Benoit 1895 B),length,9001,36.0,39.370113,"G. Bomford ""Geodesy"" 2nd edition 1962; after J.S.Clark ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.","G. Bomford ""Geodesy"" 2nd edition 1962; after J.S.Clark ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9061,British foot (Benoit 1895 B),length,9001,12.0,39.370113,Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.,"G. Bomford ""Geodesy"" 2nd edition 1962; after J.S.Clark ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9062,British chain (Benoit 1895 B),length,9001,792.0,39.370113,Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.,"G. Bomford ""Geodesy"" 2nd edition 1962; after J.S.Clark ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9063,British link (Benoit 1895 B),length,9001,7.92,39.370113,Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.,"G. Bomford; ""Geodesy""; 3rd edition 1975",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9070,British foot (1865),length,9001,0.9144025,3.0,Uses Clark's estimate of 1853-1865 British foot-metre ratio of 0.9144025 metres per yard.  Used in 1962 and 1975 estimates of Indian foot.,"J.S.Clark; ""Remeasurement of the Old Length Standards""; Empire Survey Review no. 90; 1953.",EPSG,2000-05-07 00:00:00,97.233  99.99,0
+9080,Indian foot,length,9001,12.0,39.370142,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (= 3 British feet) taken to be J.S.Clark's 1865 value of 0.9144025 metres.,"G. Bomford; ""The Re-adjustment of the Indian Triangulation""; Survey of India Professional Paper 28; 1939.",EPSG,2000-05-07 00:00:00,97.231  99.99,0
+9081,Indian foot (1937),length,9001,0.30479841,1.0,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British foot taken to be 1895 Benoit value of 12/39.370113m.  Rounded to 8 decimal places as 0.30479841. Used from Bangladesh to Vietnam.  Previously used in India and Pakistan but superseded.,"G. Bomford; ""The Re-adjustment of the Indian Triangulation""; Survey of India Professional Paper 28; 1939.",EPSG,2000-05-07 00:00:00,97.231  99.99,0
+9082,Indian foot (1962),length,9001,0.3047996,1.0,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures with a small error as 1 Ind ft=0.3048996m.  Used in Pakistan since metrication.,"G. Bomford; ""Geodesy""; 2nd edition 1962",EPSG,2000-05-07 00:00:00,97.231  99.99,0
+9083,Indian foot (1975),length,9001,0.3047995,1.0,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures as 1 Ind ft=0.3048995m.  Used in India since metrication.,"G. Bomford; ""Geodesy""; 3rd edition 1975",EPSG,2000-05-07 00:00:00,97.231  99.99,0
+9084,Indian yard,length,9001,36.0,39.370142,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (= 3 British feet) taken to be J.S.Clark's 1865 value of 0.9144025 metres.,"G. Bomford; ""The Re-adjustment of the Indian Triangulation""; Survey of India Professional Paper 28; 1939.",EPSG,2000-05-07 00:00:00,97.231  99.99,0
+9085,Indian yard (1937),length,9001,0.91439523,1.0,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British foot taken to be 1895 Benoit value of 12/39.370113m.  Rounded to 8 decimal places as 0.30479841. Used from Bangladesh to Vietnam.  Previously used in India and Pakistan but superseded.,"G. Bomford; ""The Re-adjustment of the Indian Triangulation""; Survey of India Professional Paper 28; 1939.",EPSG,2000-05-07 00:00:00,97.231  99.99,0
+9086,Indian yard (1962),length,9001,0.9143988,1.0,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures with a small error as 1 Ind ft=0.3048996m.  Used in Pakistan since metrication.,"G. Bomford; ""Geodesy""; 2nd edition 1962",EPSG,2000-05-07 00:00:00,97.231  99.99,0
+9087,Indian yard (1975),length,9001,0.9143985,1.0,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures as 1 Ind ft=0.3048995m.  Used in India since metrication.,"G. Bomford; ""Geodesy""; 3rd edition 1975",EPSG,2000-05-07 00:00:00,97.231  99.99,0
+9093,Statute mile,length,9001,1609.344,1.0,=5280 feet,EPSG,EPSG,2000-03-07 00:00:00,,0
+9094,Gold Coast foot,length,9001,6378300.0,20926201.0,"Used in Ghana and some adjacent parts of British west Africa prior to metrication, except for the metrication of projection defining parameters when British foot (Sears 1922) used.",Ordnance Survey International,EPSG,2001-01-21 00:00:00,2000.86,0
+9101,radian,angle,9101,1.0,1.0,SI standard unit.,ISO 1000.,EPSG,1995-06-02 00:00:00,,0
+9102,degree,angle,9101,3.14159265358979,180.0,=pi/180,,EPSG,1996-10-18 00:00:00,96.22,0
+9103,arc-minute,angle,9101,3.14159265358979,10800.0,1/60th degree.  =(pi/180) / 60,,EPSG,1996-10-18 00:00:00,96.22,0
+9104,arc-second,angle,9101,3.14159265358979,648000.0,1/60th arc-minute.  =(pi/180) / 3600,,EPSG,1996-10-18 00:00:00,96.22,0
+9105,grad,angle,9101,3.14159265358979,200.0,"=pi/200.  In France also abbreviated as ""gr"".",,EPSG,1996-10-18 00:00:00,96.22  99.05,0
+9106,gon,angle,9101,3.14159265358979,200.0,=pi/200,,EPSG,1996-10-18 00:00:00,96.22,0
+9107,degree minute second,angle,9101,,,"Format: sign - degrees (integer) - symbol - arc-minutes (integer) - symbol - arc-seconds (real, any precision). Different symbol sets are in use as separators for example � ' "". Convert to degrees using formula. Not recommended for data storage.",EPSG,EPSG,2002-07-13 00:00:00,96.19 2002.07,0
+9108,degree minute second hemisphere,angle,9101,,,Format: degrees (integer) - symbol - arc-minutes (integer) - symbol - arc-seconds (real) - symbol - hemisphere (single character N S E or W). Different symbol sets are in use as separators. Convert to deg using formula. Not recommended for data storage.,EPSG,EPSG,2002-07-13 00:00:00,96.19 2002.07,0
+9109,microradian,angle,9101,1.0,1000000.0,rad * 10E-6,ISO 1000.,EPSG,1996-10-18 00:00:00,99.05,0
+9110,sexagesimal DMS,angle,9101,,,Format: sign - degrees - decimal point - minutes (two digits) - integer seconds (two digits) - fraction of seconds (any precision). Must include leading zero in minutes and seconds and exclude decimal point for seconds. Convert to degrees using formula.,EPSG,EPSG,2002-07-13 00:00:00,2002.27,0
+9111,sexagesimal DM,angle,9101,,,Format: sign - degrees - decimal point - integer minutes (two digits) - fraction of minutes (any precision).  Must include leading zero in integer minutes.  Must exclude decimal point for minutes.  Convert to degrees using formula.  Not recommended.,EPSG,EPSG,2002-06-22 00:00:00,2002.07,0
+9112,centesimal minute,angle,9101,3.14159265358979,20000.0,1/100 of a grad and gon.  =(pi/200) / 100,http://www.geodesy.matav.hu/xgonmil.htm,EPSG,1999-10-20 00:00:00,98.48  99.51,0
+9113,centesimal second,angle,9101,3.14159265358979,2000000.0,"1/100 of a centesimal minute or 1/10,000th of a grad and gon.  =(pi/200) / 10000",http://www.geodesy.matav.hu/xgonmil.htm,EPSG,1999-10-20 00:00:00,99.51,0
+9114,mil_6400,angle,9101,3.14159265358979,3200.0,Angle subtended by 1/6400 part of a circle.  Approximates to 1/1000th radian.  Note that other approximations (notably 1/6300 circle and 1/6000 circle) also exist.,http://www.geodesy.matav.hu/xgonmil.htm,EPSG,1999-10-20 00:00:00,99.51,0
+9115,degree minute,angle,9101,,,"Format: sign - degrees (integer) - symbol - arc-minutes (real, any precision) - symbol. Different symbol sets are in use as separators for example � '. Convert to degrees using formula. Not recommended for data storage.",EPSG,EPSG,2002-07-13 00:00:00,,0
+9201,unity,scale,9201,1.0,1.0,,,EPSG,1996-09-12 00:00:00,,0
+9202,parts per million,scale,9201,1.0,1000000.0,,,EPSG,1996-09-12 00:00:00,,0
+9203,coefficient,scale,9201,,,Used when parameters are coefficients.  They inherently take the units which depend upon the term to which the coefficient applies.,EPSG,EPSG,2000-03-07 00:00:00,,0
+9204,Bin width 330 US survey feet,length,9001,3960.0,39.37,,EPSG,EPSG,2000-10-19 00:00:00,2000.59,0
+9205,Bin width 165 US survey feet,length,9001,1980.0,39.37,,EPSG,EPSG,2000-10-19 00:00:00,2000.59,0
+9206,Bin width 82.5 US survey feet,length,9001,990.0,39.37,,EPSG,EPSG,2000-10-19 00:00:00,2000.59,0
+9207,Bin width 37.5 metres,length,9001,37.5,1.0,,EPSG,EPSG,2000-10-19 00:00:00,2000.59,0
+9208,Bin width 25 metres,length,9001,25.0,1.0,,EPSG,EPSG,2000-10-19 00:00:00,2000.59,0
+9209,Bin width 12.5 metres,length,9001,12.5,1.0,,EPSG,EPSG,2000-10-19 00:00:00,2000.59,0
+9210,Bin width 6.25 metres,length,9001,6.25,1.0,,EPSG,EPSG,2000-10-19 00:00:00,2000.59,0
+9211,Bin width 3.125 metres,length,9001,3.125,1.0,,EPSG,EPSG,2000-10-19 00:00:00,2000.59,0
diff --git a/src/tiff/csv/uom_an_alias.c b/src/tiff/csv/uom_an_alias.c
new file mode 100644
index 0000000..0a181da
--- /dev/null
+++ b/src/tiff/csv/uom_an_alias.c
@@ -0,0 +1,5 @@
+#include "defs.h"
+datafile_rows_t uom_an_alias_row_1[] = {"UOM_A_ALIAS_CODE","UOM_A_ALIAS_NAME","UOM_ANGLE_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t uom_an_alias_row_2[] = {"9115","mil","9114","1999-04-22 00:00:00","http://www.geodesy.matav.hu/xgonmil.htm","EPSG","Alias also applies to other variations of a mil, especially mil_6300 and mil_6000.","",NULL};
+
+datafile_rows_t *uom_an_alias_rows[] = {uom_an_alias_row_1,uom_an_alias_row_2,NULL};
diff --git a/src/tiff/csv/uom_an_alias.csv b/src/tiff/csv/uom_an_alias.csv
new file mode 100644
index 0000000..f590c58
--- /dev/null
+++ b/src/tiff/csv/uom_an_alias.csv
@@ -0,0 +1,2 @@
+"UOM_A_ALIAS_CODE","UOM_A_ALIAS_NAME","UOM_ANGLE_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+9115,mil,9114,1999-04-22 00:00:00,http://www.geodesy.matav.hu/xgonmil.htm,EPSG,"Alias also applies to other variations of a mil, especially mil_6300 and mil_6000.",
diff --git a/src/tiff/csv/uom_angle.c b/src/tiff/csv/uom_angle.c
new file mode 100644
index 0000000..b066249
--- /dev/null
+++ b/src/tiff/csv/uom_angle.c
@@ -0,0 +1,18 @@
+#include "defs.h"
+datafile_rows_t uom_angle_row_1[] = {"UOM_ANGLE_CODE","UNIT_OF_MEAS_EPSG_NAME","UNIT_OF_MEAS_USER_NAME","ABBREVIATION","DESCRIPTION","TARGET_UOM_ANGLE_CODE","FACTOR_B","FACTOR_C","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t uom_angle_row_2[] = {"9101","radian","","rad","","9101","1.0","1.0","1995-06-02 00:00:00","ISO 1000.","EPSG","SI standard unit.","",NULL};
+datafile_rows_t uom_angle_row_3[] = {"9102","degree","","deg","","9101","3.14159265358979","180.0","1996-10-18 00:00:00","","EPSG","=pi/180","96.22",NULL};
+datafile_rows_t uom_angle_row_4[] = {"9103","arc-minute","","min","","9101","3.14159265358979","10800.0","1996-10-18 00:00:00","","EPSG","1/60th degree.  =(pi/180) / 60","96.22",NULL};
+datafile_rows_t uom_angle_row_5[] = {"9104","arc-second","","sec","","9101","3.14159265358979","648000.0","1996-10-18 00:00:00","","EPSG","1/60th arc-minute.  =(pi/180) / 3600","96.22",NULL};
+datafile_rows_t uom_angle_row_6[] = {"9105","grad","","g","","9101","3.14159265358979","200.0","1996-10-18 00:00:00","","EPSG","=pi/200.  In France also abbreviated as \"gr\".","96.22  99.05",NULL};
+datafile_rows_t uom_angle_row_7[] = {"9106","gon","","","","9101","3.14159265358979","200.0","1996-10-18 00:00:00","","EPSG","=pi/200","96.22",NULL};
+datafile_rows_t uom_angle_row_8[] = {"9107","DMS","","","degree minute second","9101","","","1996-10-18 00:00:00","","EPSG","Format: degrees (integer) - space - arc-minutes (integer) - space - arc-seconds (real).  Convert to degees using formula.","96.19",NULL};
+datafile_rows_t uom_angle_row_9[] = {"9108","DMSH","","","degree minute second hemisphere","9101","","","1996-10-18 00:00:00","","EPSG","Format: degrees (integer) - space - arc-minutes (integer) - space - arc-seconds (real) - hemisphere (single character N S E or W).  Convert to degrees using formula.","96.19",NULL};
+datafile_rows_t uom_angle_row_10[] = {"9109","microradian","","�rad","rad * 10E-6","9101","1.0","1000000.0","1996-10-18 00:00:00","ISO 1000.","EPSG","","99.05",NULL};
+datafile_rows_t uom_angle_row_11[] = {"9110","DDD.MMSSsss","","","sexagesimal degrees","9101","","","1996-10-18 00:00:00","","EPSG","Format: degrees - decimal point - minutes (two digits) - integer seconds (two digits) - fraction of seconds (any precision).  Must include leading zero in minutes and seconds.  Must exclude decimal point for seconds.  Convert to degrees using formula.","",NULL};
+datafile_rows_t uom_angle_row_12[] = {"9111","DDD.MMm","","","degrees and decimal minutes","9101","","","1999-04-22 00:00:00","","EPSG","Format: degrees - decimal point - integer minutes (two digits) - fraction of minutes.  Must include leading zero in integer minutes.  Must exclude decimal point for minutes.  Any precision of minutes are allowed.  Convert to degrees using formula.","",NULL};
+datafile_rows_t uom_angle_row_13[] = {"9112","centesimal minute","","c","","9101","3.14159265358979","20000.0","1999-10-20 00:00:00","http://www.geodesy.matav.hu/xgonmil.htm","EPSG","1/100 of a grad and gon.  =(pi/200) / 100","98.48  99.51",NULL};
+datafile_rows_t uom_angle_row_14[] = {"9113","centesimal second","","cc","","9101","3.14159265358979","2000000.0","1999-10-20 00:00:00","http://www.geodesy.matav.hu/xgonmil.htm","EPSG","1/100 of a centesimal minute or 1/10,000th of a grad and gon.  =(pi/200) / 10000","99.51",NULL};
+datafile_rows_t uom_angle_row_15[] = {"9114","mil_6400","","mil","Angle subtended by 1/6400 part of a circle","9101","3.14159265358979","3200.0","1999-10-20 00:00:00","http://www.geodesy.matav.hu/xgonmil.htm","EPSG","Angle subtended by 1/6400 part of a circle.  Approximates to 1/1000th radian.  Note that other approximations (notably 1/6300 circle and 1/6000 circle) also exist.","99.51",NULL};
+
+datafile_rows_t *uom_angle_rows[] = {uom_angle_row_1,uom_angle_row_2,uom_angle_row_3,uom_angle_row_4,uom_angle_row_5,uom_angle_row_6,uom_angle_row_7,uom_angle_row_8,uom_angle_row_9,uom_angle_row_10,uom_angle_row_11,uom_angle_row_12,uom_angle_row_13,uom_angle_row_14,uom_angle_row_15,NULL};
diff --git a/src/tiff/csv/uom_angle.csv b/src/tiff/csv/uom_angle.csv
new file mode 100644
index 0000000..9b2e72e
--- /dev/null
+++ b/src/tiff/csv/uom_angle.csv
@@ -0,0 +1,15 @@
+"UOM_ANGLE_CODE","UNIT_OF_MEAS_EPSG_NAME","UNIT_OF_MEAS_USER_NAME","ABBREVIATION","DESCRIPTION","TARGET_UOM_ANGLE_CODE","FACTOR_B","FACTOR_C","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+9101,radian,,rad,,9101,1.0,1.0,1995-06-02 00:00:00,ISO 1000.,EPSG,SI standard unit.,
+9102,degree,,deg,,9101,3.14159265358979,180.0,1996-10-18 00:00:00,,EPSG,=pi/180,96.22
+9103,arc-minute,,min,,9101,3.14159265358979,10800.0,1996-10-18 00:00:00,,EPSG,1/60th degree.  =(pi/180) / 60,96.22
+9104,arc-second,,sec,,9101,3.14159265358979,648000.0,1996-10-18 00:00:00,,EPSG,1/60th arc-minute.  =(pi/180) / 3600,96.22
+9105,grad,,g,,9101,3.14159265358979,200.0,1996-10-18 00:00:00,,EPSG,"=pi/200.  In France also abbreviated as \"gr\".",96.22  99.05
+9106,gon,,,,9101,3.14159265358979,200.0,1996-10-18 00:00:00,,EPSG,=pi/200,96.22
+9107,DMS,,,degree minute second,9101,,,1996-10-18 00:00:00,,EPSG,Format: degrees (integer) - space - arc-minutes (integer) - space - arc-seconds (real).  Convert to degees using formula.,96.19
+9108,DMSH,,,degree minute second hemisphere,9101,,,1996-10-18 00:00:00,,EPSG,Format: degrees (integer) - space - arc-minutes (integer) - space - arc-seconds (real) - hemisphere (single character N S E or W).  Convert to degrees using formula.,96.19
+9109,microradian,,�rad,rad * 10E-6,9101,1.0,1000000.0,1996-10-18 00:00:00,ISO 1000.,EPSG,,99.05
+9110,DDD.MMSSsss,,,sexagesimal degrees,9101,,,1996-10-18 00:00:00,,EPSG,Format: degrees - decimal point - minutes (two digits) - integer seconds (two digits) - fraction of seconds (any precision).  Must include leading zero in minutes and seconds.  Must exclude decimal point for seconds.  Convert to degrees using formula.,
+9111,DDD.MMm,,,degrees and decimal minutes,9101,,,1999-04-22 00:00:00,,EPSG,Format: degrees - decimal point - integer minutes (two digits) - fraction of minutes.  Must include leading zero in integer minutes.  Must exclude decimal point for minutes.  Any precision of minutes are allowed.  Convert to degrees using formula.,
+9112,centesimal minute,,c,,9101,3.14159265358979,20000.0,1999-10-20 00:00:00,http://www.geodesy.matav.hu/xgonmil.htm,EPSG,1/100 of a grad and gon.  =(pi/200) / 100,98.48  99.51
+9113,centesimal second,,cc,,9101,3.14159265358979,2000000.0,1999-10-20 00:00:00,http://www.geodesy.matav.hu/xgonmil.htm,EPSG,"1/100 of a centesimal minute or 1/10,000th of a grad and gon.  =(pi/200) / 10000",99.51
+9114,mil_6400,,mil,Angle subtended by 1/6400 part of a circle,9101,3.14159265358979,3200.0,1999-10-20 00:00:00,http://www.geodesy.matav.hu/xgonmil.htm,EPSG,Angle subtended by 1/6400 part of a circle.  Approximates to 1/1000th radian.  Note that other approximations (notably 1/6300 circle and 1/6000 circle) also exist.,99.51
diff --git a/src/tiff/csv/uom_le_alias.c b/src/tiff/csv/uom_le_alias.c
new file mode 100644
index 0000000..49c3a1e
--- /dev/null
+++ b/src/tiff/csv/uom_le_alias.c
@@ -0,0 +1,27 @@
+#include "defs.h"
+datafile_rows_t uom_le_alias_row_1[] = {"UOM_L_ALIAS_CODE","UOM_L_ALIAS_NAME","UOM_LENGTH_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t uom_le_alias_row_2[] = {"9015","International nautical mile","9030","1996-10-18 00:00:00","","EPSG","","9624",NULL};
+datafile_rows_t uom_le_alias_row_3[] = {"9016","meter","9001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t uom_le_alias_row_4[] = {"9018","International foot","9002","1995-06-02 00:00:00","ISO 1958.","EPSG","","",NULL};
+datafile_rows_t uom_le_alias_row_5[] = {"9019","American foot","9003","1995-06-02 00:00:00","","EPSG","Used in USA.","",NULL};
+datafile_rows_t uom_le_alias_row_6[] = {"9020","Cape foot","9005","1995-06-02 00:00:00","","EPSG","Assumes Clarke's 1865 ratio of 1 French legal metre = 39.370432 imperial inches applies to the international metre.   Used in southern African & Jamaica mapping.","",NULL};
+datafile_rows_t uom_le_alias_row_7[] = {"9022","Indian geodetic foot","9080","1995-06-02 00:00:00","","EPSG","Indian Foot = 0.9999566 British feet (A.R.Clarke). British yard (=3 feet) taken to be J.S.Clarke 1865 value of 0.9144025 metres.","97.23",NULL};
+datafile_rows_t uom_le_alias_row_8[] = {"9023","link (Clarke's ratio)","9039","1999-10-20 00:00:00","","EPSG","Assumes Clarke's 1865 ratio of 1 French legal metre = 39.370432 imperial inches applies to the international metre.  Used in Trinidad and Tobago mapping.","97.231",NULL};
+datafile_rows_t uom_le_alias_row_9[] = {"9024","link","9063","1999-10-20 00:00:00","","EPSG","Used in West Malaysian mapping.","97.231",NULL};
+datafile_rows_t uom_le_alias_row_10[] = {"9025","link","9043","1999-10-20 00:00:00","","EPSG","Used in East Malaysian mapping.","97.231",NULL};
+datafile_rows_t uom_le_alias_row_11[] = {"9026","chain","9062","1999-10-20 00:00:00","","EPSG","Used in West Malaysian mapping.","97.231",NULL};
+datafile_rows_t uom_le_alias_row_12[] = {"9027","chain","9042","1999-10-20 00:00:00","","EPSG","Used in East Malaysian mapping.","97.231",NULL};
+datafile_rows_t uom_le_alias_row_13[] = {"9028","yard","9040","1999-10-20 00:00:00","","EPSG","Used in older New Zealand mapping.","97.231",NULL};
+datafile_rows_t uom_le_alias_row_14[] = {"9029","yard","9085","1999-10-20 00:00:00","","EPSG","= 3 Indian feet.","97.23",NULL};
+datafile_rows_t uom_le_alias_row_15[] = {"9044","foot","9041","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t uom_le_alias_row_16[] = {"9054","chain","9052","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t uom_le_alias_row_17[] = {"9055","foot","9051","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t uom_le_alias_row_18[] = {"9056","link","9053","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t uom_le_alias_row_19[] = {"9057","yard","9050","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t uom_le_alias_row_20[] = {"9064","foot","9061","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t uom_le_alias_row_21[] = {"9065","yard","9060","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t uom_le_alias_row_22[] = {"9071","foot","9070","1999-10-20 00:00:00","","EPSG","","",NULL};
+datafile_rows_t uom_le_alias_row_23[] = {"9088","Indian geodetic foot","9081","1999-10-20 00:00:00","","EPSG","Indian Foot = 0.9999566 British feet (A.R.Clarke). British yard (=3 feet) taken to be Benoit's 1885 value of 0.9144992 metres.","",NULL};
+datafile_rows_t uom_le_alias_row_24[] = {"9090","yard","9084","1999-10-20 00:00:00","","EPSG","= 3 Indian feet.","97.23",NULL};
+
+datafile_rows_t *uom_le_alias_rows[] = {uom_le_alias_row_1,uom_le_alias_row_2,uom_le_alias_row_3,uom_le_alias_row_4,uom_le_alias_row_5,uom_le_alias_row_6,uom_le_alias_row_7,uom_le_alias_row_8,uom_le_alias_row_9,uom_le_alias_row_10,uom_le_alias_row_11,uom_le_alias_row_12,uom_le_alias_row_13,uom_le_alias_row_14,uom_le_alias_row_15,uom_le_alias_row_16,uom_le_alias_row_17,uom_le_alias_row_18,uom_le_alias_row_19,uom_le_alias_row_20,uom_le_alias_row_21,uom_le_alias_row_22,uom_le_alias_row_23,u [...]
diff --git a/src/tiff/csv/uom_le_alias.csv b/src/tiff/csv/uom_le_alias.csv
new file mode 100644
index 0000000..c00a10e
--- /dev/null
+++ b/src/tiff/csv/uom_le_alias.csv
@@ -0,0 +1,24 @@
+"UOM_L_ALIAS_CODE","UOM_L_ALIAS_NAME","UOM_LENGTH_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+9015,International nautical mile,9030,1996-10-18 00:00:00,,EPSG,,9624
+9016,meter,9001,1995-06-02 00:00:00,,EPSG,,
+9018,International foot,9002,1995-06-02 00:00:00,ISO 1958.,EPSG,,
+9019,American foot,9003,1995-06-02 00:00:00,,EPSG,Used in USA.,
+9020,Cape foot,9005,1995-06-02 00:00:00,,EPSG,Assumes Clarke's 1865 ratio of 1 French legal metre = 39.370432 imperial inches applies to the international metre.   Used in southern African & Jamaica mapping.,
+9022,Indian geodetic foot,9080,1995-06-02 00:00:00,,EPSG,Indian Foot = 0.9999566 British feet (A.R.Clarke). British yard (=3 feet) taken to be J.S.Clarke 1865 value of 0.9144025 metres.,97.23
+9023,link (Clarke's ratio),9039,1999-10-20 00:00:00,,EPSG,Assumes Clarke's 1865 ratio of 1 French legal metre = 39.370432 imperial inches applies to the international metre.  Used in Trinidad and Tobago mapping.,97.231
+9024,link,9063,1999-10-20 00:00:00,,EPSG,Used in West Malaysian mapping.,97.231
+9025,link,9043,1999-10-20 00:00:00,,EPSG,Used in East Malaysian mapping.,97.231
+9026,chain,9062,1999-10-20 00:00:00,,EPSG,Used in West Malaysian mapping.,97.231
+9027,chain,9042,1999-10-20 00:00:00,,EPSG,Used in East Malaysian mapping.,97.231
+9028,yard,9040,1999-10-20 00:00:00,,EPSG,Used in older New Zealand mapping.,97.231
+9029,yard,9085,1999-10-20 00:00:00,,EPSG,= 3 Indian feet.,97.23
+9044,foot,9041,1999-10-20 00:00:00,,EPSG,,
+9054,chain,9052,1999-10-20 00:00:00,,EPSG,,
+9055,foot,9051,1999-10-20 00:00:00,,EPSG,,
+9056,link,9053,1999-10-20 00:00:00,,EPSG,,
+9057,yard,9050,1999-10-20 00:00:00,,EPSG,,
+9064,foot,9061,1999-10-20 00:00:00,,EPSG,,
+9065,yard,9060,1999-10-20 00:00:00,,EPSG,,
+9071,foot,9070,1999-10-20 00:00:00,,EPSG,,
+9088,Indian geodetic foot,9081,1999-10-20 00:00:00,,EPSG,Indian Foot = 0.9999566 British feet (A.R.Clarke). British yard (=3 feet) taken to be Benoit's 1885 value of 0.9144992 metres.,
+9090,yard,9084,1999-10-20 00:00:00,,EPSG,= 3 Indian feet.,97.23
diff --git a/src/tiff/csv/uom_length.c b/src/tiff/csv/uom_length.c
new file mode 100644
index 0000000..78541da
--- /dev/null
+++ b/src/tiff/csv/uom_length.c
@@ -0,0 +1,39 @@
+#include "defs.h"
+datafile_rows_t uom_length_row_1[] = {"UOM_LENGTH_CODE","UNIT_OF_MEAS_EPSG_NAME","UNIT_OF_MEAS_USER_NAME","ABBREVIATION","DESCRIPTION","TARGET_UOM_LENGTH_CODE","FACTOR_B","FACTOR_C","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t uom_length_row_2[] = {"9001","metre","","m","","9001","1.0","1.0","1995-06-02 00:00:00","ISO 1000.","EPSG","Also known as International metre.","",NULL};
+datafile_rows_t uom_length_row_3[] = {"9002","foot","","ft","","9001","0.3048","1.0","1995-06-02 00:00:00","ISO; 1958","EPSG","","",NULL};
+datafile_rows_t uom_length_row_4[] = {"9003","US survey foot","","ft US","","9001","12.0","39.37","1995-06-02 00:00:00","","EPSG","Used in USA.","",NULL};
+datafile_rows_t uom_length_row_5[] = {"9005","Clarke's foot","","ft (Cla)","","9001","0.304797265","1.0","1999-10-20 00:00:00","Australian Land Information Group  www.auslig.gov/au/geodesy/histry.htm","EPSG","Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.","97.234",NULL};
+datafile_rows_t uom_length_row_6[] = {"9014","fathom","","f","","9001","1.8288","1.0","1999-10-20 00:00:00","","EPSG","= 6 feet.","",NULL};
+datafile_rows_t uom_length_row_7[] = {"9030","nautical mile","","NM","","9001","1852.0","1.0","1996-10-18 00:00:00","","EPSG","","96.24",NULL};
+datafile_rows_t uom_length_row_8[] = {"9031","German legal metre","","GLM","","9001","1.0000135965","1.0","1997-06-16 00:00:00","Chief Directorate Surveys and Land Information; Mowbray; South Africa","EPSG","Used in Namibia.","",NULL};
+datafile_rows_t uom_length_row_9[] = {"9033","US survey chain","","ch US","","9001","792.0","39.37","1998-03-12 00:00:00","Bureau of Land Management technical bulletin 6 (1973) and Standard Field Tables 8th edition (1956).","EPSG","Used in USA primarily for public lands cadastral work.","",NULL};
+datafile_rows_t uom_length_row_10[] = {"9034","US survey link","","lk US","","9001","7.92","39.37","1998-03-12 00:00:00","Bureau of Land Management technical bulletin 6 (1973) and Standard Field Tables 8th edition (1956).","EPSG","Used in USA primarily for public lands cadastral work.","",NULL};
+datafile_rows_t uom_length_row_11[] = {"9035","US survey mile","","mile US","","9001","63360.0","39.37","1998-03-12 00:00:00","Bureau of Land Management technical bulletin 6 (1973) and Standard Field Tables 8th edition (1956).","EPSG","Used in USA primarily for public lands cadastral work.","",NULL};
+datafile_rows_t uom_length_row_12[] = {"9036","kilometre","","km","","9001","1000.0","1.0","1998-11-11 00:00:00","ISO 1000.","EPSG","","",NULL};
+datafile_rows_t uom_length_row_13[] = {"9037","Clarke's yard","","yd (Cla)","","9001","0.914391795","1.0","1999-10-20 00:00:00","Australian Land Information Group  www.auslig.gov/au/geodesy/histry.htm","EPSG","=3 Clarke's feet.  Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_14[] = {"9038","Clarke's chain","","ch (Cla)","","9001","20.11661949","1.0","1999-10-20 00:00:00","Australian Land Information Group  www.auslig.gov/au/geodesy/histry.htm","EPSG","=22 Clarke's yards.  Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_15[] = {"9039","Clarke's link","","lk (Cla)","","9001","0.2011661949","1.0","1999-10-20 00:00:00","Australian Land Information Group  www.auslig.gov/au/geodesy/histry.htm","EPSG","=1/100 Clarke's chain. Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_16[] = {"9040","British yard (Sears 1922)","","yd (Sears)","","9001","36.0","39.370147","1999-10-20 00:00:00","G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_17[] = {"9041","British foot (Sears 1922)","","ft (Sears)","","9001","12.0","39.370147","1999-10-20 00:00:00","G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_18[] = {"9042","British chain (Sears 1922)","","ch (Sears)","","9001","792.0","39.370147","1999-10-20 00:00:00","\"Geodesy\"; G. Bomford.","EPSG","Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_19[] = {"9043","British link (Sears 1922)","","lk (Sears)","","9001","7.92","39.370147","1999-10-20 00:00:00","G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_20[] = {"9050","British yard (Benoit 1895 A)","","yd (Ben A)","","9001","0.9143992","1.0","1999-10-20 00:00:00","J.S.Clark; \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.","97.233",NULL};
+datafile_rows_t uom_length_row_21[] = {"9051","British foot (Benoit 1895 A)","","ft (Ben A)","","9001","0.9143992","3.0","1999-10-20 00:00:00","J.S.Clark; \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.","97.233",NULL};
+datafile_rows_t uom_length_row_22[] = {"9052","British chain (Benoit 1895 A)","","ch (Ben A)","","9001","20.1167824","1.0","1999-10-20 00:00:00","J.S.Clark; \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.","97.233",NULL};
+datafile_rows_t uom_length_row_23[] = {"9053","British link (Benoit 1895 A)","","lk (Ben A)","","9001","0.201167824","1.0","1999-10-20 00:00:00","J.S.Clark; \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.","97.233",NULL};
+datafile_rows_t uom_length_row_24[] = {"9060","British yard (Benoit 1895 B)","","yd (Ben B)","","9001","36.0","39.370113","1999-10-20 00:00:00","G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_25[] = {"9061","British foot (Benoit 1895 B)","","ft (Ben B)","","9001","12.0","39.370113","1999-10-20 00:00:00","G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_26[] = {"9062","British chain (Benoit 1895 B)","","ch (Ben B)","","9001","792.0","39.370113","1999-10-20 00:00:00","G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_27[] = {"9063","British link (Benoit 1895 B)","","lk (Ben B)","","9001","7.92","39.370113","1999-10-20 00:00:00","\"Geodesy\"; G. Bomford.","EPSG","Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.","97.233",NULL};
+datafile_rows_t uom_length_row_28[] = {"9070","British foot (1865)","","ft (1865)","","9001","0.9144025","3.0","1999-10-20 00:00:00","J.S.Clark; \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.","EPSG","Uses Clark's estimate of 1853-1865 British foot-metre ratio of 0.9144025 metres per yard.  Used in 1962 and 1975 estimates of Indian foot.","97.233",NULL};
+datafile_rows_t uom_length_row_29[] = {"9080","Indian foot","","Ind ft (Cla)","","9001","12.0","39.370142","1999-10-20 00:00:00","G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.","EPSG","Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (= 3 British feet) taken to be J.S.Clark's 1865 value of 0.9144025 metres.","97.231",NULL};
+datafile_rows_t uom_length_row_30[] = {"9081","Indian foot (1937)","","Ind ft (37)","","9001","0.30479841","1.0","1999-10-20 00:00:00","G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.","EPSG","Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British foot taken to be 1895 Benoit value of 12/39.370113m.  Rounded to 8 decimal places as 0.30479841. Used from Bangladesh to Vietnam.  Previously used in India and Pakistan but  [...]
+datafile_rows_t uom_length_row_31[] = {"9082","Indian foot (1962)","","Ind ft (62)","","9001","0.3047996","1.0","1999-10-20 00:00:00","G. Bomford; \"Geodesy\"; 2nd edition 1962","EPSG","Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures with a small error as 1 Ind ft=0.3048996m.  Used in Pakistan since metrication.","97.231",NULL};
+datafile_rows_t uom_length_row_32[] = {"9083","Indian foot (1975)","","Ind ft (75)","","9001","0.3047995","1.0","1999-10-20 00:00:00","G. Bomford; \"Geodesy\"; 3rd edition 1975","EPSG","Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures as 1 Ind ft=0.3048995m.  Used in India since metrication.","97.231",NULL};
+datafile_rows_t uom_length_row_33[] = {"9084","Indian yard","","Ind yd (Cla)","","9001","36.0","39.370142","1999-10-20 00:00:00","G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.","EPSG","Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (= 3 British feet) taken to be J.S.Clark's 1865 value of 0.9144025 metres.","97.231",NULL};
+datafile_rows_t uom_length_row_34[] = {"9085","Indian yard (1937)","","Ind yd (37)","","9001","0.91439523","1.0","1999-10-20 00:00:00","G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.","EPSG","Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British foot taken to be 1895 Benoit value of 12/39.370113m.  Rounded to 8 decimal places as 0.30479841. Used from Bangladesh to Vietnam.  Previously used in India and Pakistan but  [...]
+datafile_rows_t uom_length_row_35[] = {"9086","Indian yard (1962)","","Ind yd (62)","","9001","0.9143988","1.0","1999-10-20 00:00:00","G. Bomford; \"Geodesy\"; 2nd edition 1962","EPSG","Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures with a small error as 1 Ind ft=0.3048996m.  Used in Pakistan since metrication.","97.231",NULL};
+datafile_rows_t uom_length_row_36[] = {"9087","Indian yard (1975)","","Ind yd (75)","","9001","0.9143985","1.0","1999-10-20 00:00:00","G. Bomford; \"Geodesy\"; 3rd edition 1975","EPSG","Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures as 1 Ind ft=0.3048995m.  Used in India since metrication.","97.231",NULL};
+
+datafile_rows_t *uom_length_rows[] = {uom_length_row_1,uom_length_row_2,uom_length_row_3,uom_length_row_4,uom_length_row_5,uom_length_row_6,uom_length_row_7,uom_length_row_8,uom_length_row_9,uom_length_row_10,uom_length_row_11,uom_length_row_12,uom_length_row_13,uom_length_row_14,uom_length_row_15,uom_length_row_16,uom_length_row_17,uom_length_row_18,uom_length_row_19,uom_length_row_20,uom_length_row_21,uom_length_row_22,uom_length_row_23,uom_length_row_24,uom_length_row_25,uom_length_ro [...]
diff --git a/src/tiff/csv/uom_length.csv b/src/tiff/csv/uom_length.csv
new file mode 100644
index 0000000..76c873e
--- /dev/null
+++ b/src/tiff/csv/uom_length.csv
@@ -0,0 +1,36 @@
+"UOM_LENGTH_CODE","UNIT_OF_MEAS_EPSG_NAME","UNIT_OF_MEAS_USER_NAME","ABBREVIATION","DESCRIPTION","TARGET_UOM_LENGTH_CODE","FACTOR_B","FACTOR_C","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+9001,metre,,m,,9001,1.0,1.0,1995-06-02 00:00:00,ISO 1000.,EPSG,Also known as International metre.,
+9002,foot,,ft,,9001,0.3048,1.0,1995-06-02 00:00:00,ISO; 1958,EPSG,,
+9003,US survey foot,,ft US,,9001,12.0,39.37,1995-06-02 00:00:00,,EPSG,Used in USA.,
+9005,Clarke's foot,,ft (Cla),,9001,0.304797265,1.0,1999-10-20 00:00:00,Australian Land Information Group  www.auslig.gov/au/geodesy/histry.htm,EPSG,"Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.",97.234
+9014,fathom,,f,,9001,1.8288,1.0,1999-10-20 00:00:00,,EPSG,= 6 feet.,
+9030,nautical mile,,NM,,9001,1852.0,1.0,1996-10-18 00:00:00,,EPSG,,96.24
+9031,German legal metre,,GLM,,9001,1.0000135965,1.0,1997-06-16 00:00:00,Chief Directorate Surveys and Land Information; Mowbray; South Africa,EPSG,Used in Namibia.,
+9033,US survey chain,,ch US,,9001,792.0,39.37,1998-03-12 00:00:00,Bureau of Land Management technical bulletin 6 (1973) and Standard Field Tables 8th edition (1956).,EPSG,Used in USA primarily for public lands cadastral work.,
+9034,US survey link,,lk US,,9001,7.92,39.37,1998-03-12 00:00:00,Bureau of Land Management technical bulletin 6 (1973) and Standard Field Tables 8th edition (1956).,EPSG,Used in USA primarily for public lands cadastral work.,
+9035,US survey mile,,mile US,,9001,63360.0,39.37,1998-03-12 00:00:00,Bureau of Land Management technical bulletin 6 (1973) and Standard Field Tables 8th edition (1956).,EPSG,Used in USA primarily for public lands cadastral work.,
+9036,kilometre,,km,,9001,1000.0,1.0,1998-11-11 00:00:00,ISO 1000.,EPSG,,
+9037,Clarke's yard,,yd (Cla),,9001,0.914391795,1.0,1999-10-20 00:00:00,Australian Land Information Group  www.auslig.gov/au/geodesy/histry.htm,EPSG,"=3 Clarke's feet.  Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.",97.233
+9038,Clarke's chain,,ch (Cla),,9001,20.11661949,1.0,1999-10-20 00:00:00,Australian Land Information Group  www.auslig.gov/au/geodesy/histry.htm,EPSG,"=22 Clarke's yards.  Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.",97.233
+9039,Clarke's link,,lk (Cla),,9001,0.2011661949,1.0,1999-10-20 00:00:00,Australian Land Information Group  www.auslig.gov/au/geodesy/histry.htm,EPSG,"=1/100 Clarke's chain. Assumes Clarke's 1865 ratio of 1 British foot = 0.304797265 French legal metres applies to the international metre.   Used in older Australian, southern African & British West Indian mapping.",97.233
+9040,British yard (Sears 1922),,yd (Sears),,9001,36.0,39.370147,1999-10-20 00:00:00,"G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.,97.233
+9041,British foot (Sears 1922),,ft (Sears),,9001,12.0,39.370147,1999-10-20 00:00:00,"G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.,97.233
+9042,British chain (Sears 1922),,ch (Sears),,9001,792.0,39.370147,1999-10-20 00:00:00,"\"Geodesy\"; G. Bomford.",EPSG,Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.,97.233
+9043,British link (Sears 1922),,lk (Sears),,9001,7.92,39.370147,1999-10-20 00:00:00,"G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.  Used in East Malaysian and older New Zealand mapping.,97.233
+9050,British yard (Benoit 1895 A),,yd (Ben A),,9001,0.9143992,1.0,1999-10-20 00:00:00,"J.S.Clark; \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.,97.233
+9051,British foot (Benoit 1895 A),,ft (Ben A),,9001,0.9143992,3.0,1999-10-20 00:00:00,"J.S.Clark; \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.,97.233
+9052,British chain (Benoit 1895 A),,ch (Ben A),,9001,20.1167824,1.0,1999-10-20 00:00:00,"J.S.Clark; \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.,97.233
+9053,British link (Benoit 1895 A),,lk (Ben A),,9001,0.201167824,1.0,1999-10-20 00:00:00,"J.S.Clark; \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Benoit's 1895 British yard-metre ratio as given by Clark as 0.9144992 metres per yard.  Used for deriving metric size of ellipsoid in Palestine.,97.233
+9060,British yard (Benoit 1895 B),,yd (Ben B),,9001,36.0,39.370113,1999-10-20 00:00:00,"G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.,97.233
+9061,British foot (Benoit 1895 B),,ft (Ben B),,9001,12.0,39.370113,1999-10-20 00:00:00,"G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.,97.233
+9062,British chain (Benoit 1895 B),,ch (Ben B),,9001,792.0,39.370113,1999-10-20 00:00:00,"G. Bomford \"Geodesy\" 2nd edition 1962; after J.S.Clark \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.,97.233
+9063,British link (Benoit 1895 B),,lk (Ben B),,9001,7.92,39.370113,1999-10-20 00:00:00,"\"Geodesy\"; G. Bomford.",EPSG,Uses Benoit's 1895 British yard-metre ratio as given by Bomford as 39.370113 inches per metre.  Used in West Malaysian mapping.,97.233
+9070,British foot (1865),,ft (1865),,9001,0.9144025,3.0,1999-10-20 00:00:00,"J.S.Clark; \"Remeasurement of the Old Length Standards\"; Empire Survey Review no. 90; 1953.",EPSG,Uses Clark's estimate of 1853-1865 British foot-metre ratio of 0.9144025 metres per yard.  Used in 1962 and 1975 estimates of Indian foot.,97.233
+9080,Indian foot,,Ind ft (Cla),,9001,12.0,39.370142,1999-10-20 00:00:00,"G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.",EPSG,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (= 3 British feet) taken to be J.S.Clark's 1865 value of 0.9144025 metres.,97.231
+9081,Indian foot (1937),,Ind ft (37),,9001,0.30479841,1.0,1999-10-20 00:00:00,"G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.",EPSG,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British foot taken to be 1895 Benoit value of 12/39.370113m.  Rounded to 8 decimal places as 0.30479841. Used from Bangladesh to Vietnam.  Previously used in India and Pakistan but superseded.,97.231
+9082,Indian foot (1962),,Ind ft (62),,9001,0.3047996,1.0,1999-10-20 00:00:00,"G. Bomford; \"Geodesy\"; 2nd edition 1962",EPSG,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures with a small error as 1 Ind ft=0.3048996m.  Used in Pakistan since metrication.,97.231
+9083,Indian foot (1975),,Ind ft (75),,9001,0.3047995,1.0,1999-10-20 00:00:00,"G. Bomford; \"Geodesy\"; 3rd edition 1975",EPSG,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures as 1 Ind ft=0.3048995m.  Used in India since metrication.,97.231
+9084,Indian yard,,Ind yd (Cla),,9001,36.0,39.370142,1999-10-20 00:00:00,"G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.",EPSG,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (= 3 British feet) taken to be J.S.Clark's 1865 value of 0.9144025 metres.,97.231
+9085,Indian yard (1937),,Ind yd (37),,9001,0.91439523,1.0,1999-10-20 00:00:00,"G. Bomford; \"The Re-adjustment of the Indian Triangulation\"; Survey of India Professional Paper 28; 1939.",EPSG,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British foot taken to be 1895 Benoit value of 12/39.370113m.  Rounded to 8 decimal places as 0.30479841. Used from Bangladesh to Vietnam.  Previously used in India and Pakistan but superseded.,97.231
+9086,Indian yard (1962),,Ind yd (62),,9001,0.9143988,1.0,1999-10-20 00:00:00,"G. Bomford; \"Geodesy\"; 2nd edition 1962",EPSG,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures with a small error as 1 Ind ft=0.3048996m.  Used in Pakistan since metrication.,97.231
+9087,Indian yard (1975),,Ind yd (75),,9001,0.9143985,1.0,1999-10-20 00:00:00,"G. Bomford; \"Geodesy\"; 3rd edition 1975",EPSG,Indian Foot = 0.99999566 British feet (A.R.Clarke 1865).  British yard (3 feet) taken to be J.S. Clark's 1865 value of 0.9144025m. Rounded to 8 significant figures as 1 Ind ft=0.3048995m.  Used in India since metrication.,97.231
diff --git a/src/tiff/csv/uom_sc_alias.c b/src/tiff/csv/uom_sc_alias.c
new file mode 100644
index 0000000..3d15565
--- /dev/null
+++ b/src/tiff/csv/uom_sc_alias.c
@@ -0,0 +1,4 @@
+#include "defs.h"
+datafile_rows_t uom_sc_alias_row_1[] = {"UOM_S_ALIAS_CODE","UOM_S_ALIAS_NAME","UOM_SCALE_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+
+datafile_rows_t *uom_sc_alias_rows[] = {uom_sc_alias_row_1,NULL};
diff --git a/src/tiff/csv/uom_sc_alias.csv b/src/tiff/csv/uom_sc_alias.csv
new file mode 100644
index 0000000..1624600
--- /dev/null
+++ b/src/tiff/csv/uom_sc_alias.csv
@@ -0,0 +1 @@
+"UOM_S_ALIAS_CODE","UOM_S_ALIAS_NAME","UOM_SCALE_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
diff --git a/src/tiff/csv/uom_scale.c b/src/tiff/csv/uom_scale.c
new file mode 100644
index 0000000..cdc8376
--- /dev/null
+++ b/src/tiff/csv/uom_scale.c
@@ -0,0 +1,6 @@
+#include "defs.h"
+datafile_rows_t uom_scale_row_1[] = {"UOM_SCALE_CODE","UNIT_OF_MEAS_EPSG_NAME","UNIT_OF_MEAS_USER_NAME","ABBREVIATION","DESCRIPTION","TARGET_UOM_SCALE_CODE","FACTOR_B","FACTOR_C","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t uom_scale_row_2[] = {"9201","unity","","","","9201","1.0","1.0","1996-09-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t uom_scale_row_3[] = {"9202","parts per million","","ppm","","9201","1.0","1000000.0","1996-09-12 00:00:00","","EPSG","","",NULL};
+
+datafile_rows_t *uom_scale_rows[] = {uom_scale_row_1,uom_scale_row_2,uom_scale_row_3,NULL};
diff --git a/src/tiff/csv/uom_scale.csv b/src/tiff/csv/uom_scale.csv
new file mode 100644
index 0000000..c2a7728
--- /dev/null
+++ b/src/tiff/csv/uom_scale.csv
@@ -0,0 +1,3 @@
+"UOM_SCALE_CODE","UNIT_OF_MEAS_EPSG_NAME","UNIT_OF_MEAS_USER_NAME","ABBREVIATION","DESCRIPTION","TARGET_UOM_SCALE_CODE","FACTOR_B","FACTOR_C","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+9201,unity,,,,9201,1.0,1.0,1996-09-12 00:00:00,,EPSG,,
+9202,parts per million,,ppm,,9201,1.0,1000000.0,1996-09-12 00:00:00,,EPSG,,
diff --git a/src/tiff/csv/version_history.csv b/src/tiff/csv/version_history.csv
new file mode 100644
index 0000000..6912bb9
--- /dev/null
+++ b/src/tiff/csv/version_history.csv
@@ -0,0 +1,23 @@
+"VERSION_DATE","VERSION_NUMBER","VERSION_REMARKS","SUPERCEDED_BY","SUPERCEDES"
+1999-11-19 00:00:00,4.4,Version 4.4 release.,5.0,4.3
+1999-07-26 00:00:00,4.3,Version 4.3 release.,4.4,4.2
+1998-11-25 00:00:00,4.2,Version 4.2 release.,4.3,4.1
+1998-09-29 00:00:00,4.1,Version 4.1 release.,4.2,4.0
+1998-03-24 00:00:00,4.0,Version 4.0 release.  Access v7.,4.1,3.2
+1997-08-28 00:00:00,3.2,Version 3.2 release.,4.0,3.1
+1997-04-11 00:00:00,3.1,Version 3.1 release.,3.2,3.0
+1996-12-12 00:00:00,3.0,Version 3.0 release.  Access v2.,3.1,2.1
+1996-06-02 00:00:00,2.1,Version 2.1 release.  Excel v4.,3.0,
+2000-06-29 00:00:00,4.5,Version 4.5 release.,5.1,4.4
+2000-06-29 00:00:00,5.0,Version 5.0 release.  Access97,5.01,4.4
+2000-12-31 00:00:00,5.1,Version 5.1 release.,5.2,5.01
+2001-06-11 00:00:00,5.2,Version 5.2 release.,5.21,5.1
+2001-09-03 00:00:00,6.02,v6.02 release to EPSG wg and ISO 1927 project team.,6.1,
+1994-06-01 00:00:00,1.0,Version 1.0 release.  Excel v2.,,
+2000-07-09 00:00:00,5.01,Version 5.01 release.,5.1,5.0
+2001-06-26 00:00:00,5.21,Version 5.21 release.,6.1,5.2
+2002-02-21 00:00:00,5.3,Version 5.3 release. Same data as v6.1.,6.1,5.21
+2002-02-25 00:00:00,6.1,Version 6.1 release. ISO 19111 compliant data model and terminology.,6.2,5.21  6.02
+2002-07-31 00:00:00,6.2,Version 6.2 release.,6.2.1,5.3  6.1
+2002-09-05 00:00:00,6.2.1,v6.2 data; purged redundant Visual Basic code behind forms.,6.2.2,6.2
+2002-09-16 00:00:00,6.2.2,v6.2 data; purged further redundant Visual Basic code behind forms.,,6.2.1
diff --git a/src/tiff/csv/vert_cs.c b/src/tiff/csv/vert_cs.c
new file mode 100644
index 0000000..8bfd014
--- /dev/null
+++ b/src/tiff/csv/vert_cs.c
@@ -0,0 +1,31 @@
+#include "defs.h"
+datafile_rows_t vert_cs_row_1[] = {"VERTCS_CODE","VERTCS_EPSG_NAME","VERTCS_EPSG_ABBR","VERTCS_USER_NAME","DESCRIPTION","AREA_OF_USE","VERTCS_TYPE","VERTICAL_DATUM_CODE","VERTCS_AXIS_NAME","VERTCS_AXIS_ABBREV","VERTCS_AXIS_UOM_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t vert_cs_row_2[] = {"5701","Newlyn","ODN","","","United Kingdom (UK) - Great Britain.","height system","5101","height","","9001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_3[] = {"5702","National Geodetic Vertical Datum of 1929","NGVD29","","","United States (USA).","height system","5102","height","","9003","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_4[] = {"5703","North American Vertical Datum of 1988","NAVD88","","","Canada;  United States (USA).","height system","5103","height","","9001","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_5[] = {"5704","Yellow Sea","","","","China.","height system","5104","height","","9001","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_6[] = {"5705","Baltic","","","","Armenia;  Azerbaijan;  Belorus;  Estonia;  Georgia;  Kazakstan;  Kirgizstan;  Latvia;  Lithuania;  Moldavia;  Russia;  Tadzhikistan;  Turkmenistan;  Ukraine;  Uzbekistan.","height system","5105","height","","9001","1996-09-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_7[] = {"5706","Caspian","","","","Azerbaijan - offshore; Kazakhstan - offshore;  Russia - Caspian Sea;  Turkmenistan - offshore.","depth system","5106","depth","","9001","1996-09-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_8[] = {"5709","Noormal Amsterdams Piel","NAP","","","Netherlands.","height system","5109","height","","9001","1996-09-12 00:00:00","Nederlandse Commissie voor Geodesie publication 30; 1993","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_9[] = {"5710","Oostende","","","","Belgium.","height system","5110","height","","9001","1996-09-12 00:00:00","Nederlandse Commissie voor Geodesie publication 30; 1993","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_10[] = {"5711","Australian Height Datum","AHD","","","Australia (New South Wales; Northern Territories; Queensland; South Australia; Western Australia; Victoria).","height system","5111","height","","9001","1996-09-12 00:00:00","http://www.auslig.gov.au/geodesy","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_11[] = {"5712","Australian Height Datum (Tasmania)","AHD (Tasmania)","","","Australia - Tasmania.","height system","5112","height","","9001","1996-09-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_12[] = {"5713","Canadian Vertical Datum of 1928","CVD28","","","Canada.","height system","5114","height","","9001","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_13[] = {"5714","mean sea level height","msl height","","","","height system","5100","height","","9001","1996-04-12 00:00:00","","EPSG","Approximates geoid.  Not specific to any location or epoch.","",NULL};
+datafile_rows_t vert_cs_row_14[] = {"5715","mean sea level depth","msl depth","","","","depth system","5100","depth","","9001","1996-10-18 00:00:00","","EPSG","Approximates geoid.  Not specific to any location or epoch.","",NULL};
+datafile_rows_t vert_cs_row_15[] = {"5716","Piraeus","","","","Greece.","height system","5115","height","","9001","1997-06-16 00:00:00","Geodesy Department; Public Petroleum Corporation of Greece.","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_16[] = {"5717","N60","","","","Finland.","height system","5116","height","","9001","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","In use since 1968.","",NULL};
+datafile_rows_t vert_cs_row_17[] = {"5718","RH70","","","","Sweden","height system","5117","height","","9001","1997-11-13 00:00:00","National and Survey of Sweden","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_18[] = {"5719","NGF Lallemand","","","","France - mainland.","height system","5118","height","","9001","1997-11-13 00:00:00","Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994","EPSG","Generally but not entirely superceded by NGF IGN69 (code 5720).","",NULL};
+datafile_rows_t vert_cs_row_19[] = {"5720","NGF IGN69","","","","France - mainland.","height system","5119","height","","9001","1997-11-13 00:00:00","Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_20[] = {"5721","NGF IGN78","","","","France - Corsica.","height system","5120","height","","9001","1997-11-13 00:00:00","Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_21[] = {"5722","Maputo","","","","Mozambique.","height system","5121","height","","9001","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_22[] = {"5723","Japanese Standard Levelling Datum","Japan Levelling Datum","","","Japan","height system","5122","height","","9001","1999-04-22 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif","EPSG","","",NULL};
+datafile_rows_t vert_cs_row_23[] = {"5724","PDO Height Datum 1993","PHD93","","","Oman","height system","5123","height","","9001","1999-04-22 00:00:00","Petroleum Development Oman","EPSG","Supersedes Fahud vertical datum (code 5725) from 1993.","",NULL};
+datafile_rows_t vert_cs_row_24[] = {"5725","Fahud Height Datum 1993","","","","Oman","height system","5124","height","","9001","1999-04-22 00:00:00","Petroleum Development Oman","EPSG","Superseded by PHD93 (code 5724)  from 1993.","",NULL};
+datafile_rows_t vert_cs_row_25[] = {"5726","Ha Tien 1960","","","","Cambodia; Vietnam","height system","5125","height","","9001","1999-10-20 00:00:00","","EPSG","In Vietnam superseded by Hon Dau from 1992.","",NULL};
+datafile_rows_t vert_cs_row_26[] = {"5727","Hon Dau 1992","","","","Vietnam","height system","5126","height","","9001","1999-10-20 00:00:00","","EPSG","In Vietnam supersedes Ha Tien from 1992.","",NULL};
+datafile_rows_t vert_cs_row_27[] = {"5728","Landesnivellement 1902","LN02","","","Liechtenstein;  Switzerland.","height system","5127","height","","9001","1999-10-20 00:00:00","Bundesamt f�r Landestopographie","EPSG","To be superseded by LHN95 (code 5729).","",NULL};
+datafile_rows_t vert_cs_row_28[] = {"5729","Landeshohennetz 1995","LHN95","","","Liechtenstein;  Switzerland.","height system","5128","height","","9001","1999-10-20 00:00:00","Bundesamt f�r Landestopographie","EPSG","To supersede LN02 (code 5728).","",NULL};
+
+datafile_rows_t *vert_cs_rows[] = {vert_cs_row_1,vert_cs_row_2,vert_cs_row_3,vert_cs_row_4,vert_cs_row_5,vert_cs_row_6,vert_cs_row_7,vert_cs_row_8,vert_cs_row_9,vert_cs_row_10,vert_cs_row_11,vert_cs_row_12,vert_cs_row_13,vert_cs_row_14,vert_cs_row_15,vert_cs_row_16,vert_cs_row_17,vert_cs_row_18,vert_cs_row_19,vert_cs_row_20,vert_cs_row_21,vert_cs_row_22,vert_cs_row_23,vert_cs_row_24,vert_cs_row_25,vert_cs_row_26,vert_cs_row_27,vert_cs_row_28,NULL};
diff --git a/src/tiff/csv/vert_cs.csv b/src/tiff/csv/vert_cs.csv
new file mode 100644
index 0000000..11b5057
--- /dev/null
+++ b/src/tiff/csv/vert_cs.csv
@@ -0,0 +1,28 @@
+"VERTCS_CODE","VERTCS_EPSG_NAME","VERTCS_EPSG_ABBR","VERTCS_USER_NAME","DESCRIPTION","AREA_OF_USE","VERTCS_TYPE","VERTICAL_DATUM_CODE","VERTCS_AXIS_NAME","VERTCS_AXIS_ABBREV","VERTCS_AXIS_UOM_CODE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+5701,Newlyn,ODN,,,United Kingdom (UK) - Great Britain.,height system,5101,height,,9001,1995-06-02 00:00:00,,EPSG,,
+5702,National Geodetic Vertical Datum of 1929,NGVD29,,,United States (USA).,height system,5102,height,,9003,1996-10-18 00:00:00,,EPSG,,
+5703,North American Vertical Datum of 1988,NAVD88,,,Canada;  United States (USA).,height system,5103,height,,9001,1996-10-18 00:00:00,,EPSG,,
+5704,Yellow Sea,,,,China.,height system,5104,height,,9001,1995-06-02 00:00:00,,EPSG,,
+5705,Baltic,,,,Armenia;  Azerbaijan;  Belorus;  Estonia;  Georgia;  Kazakstan;  Kirgizstan;  Latvia;  Lithuania;  Moldavia;  Russia;  Tadzhikistan;  Turkmenistan;  Ukraine;  Uzbekistan.,height system,5105,height,,9001,1996-09-12 00:00:00,,EPSG,,
+5706,Caspian,,,,Azerbaijan - offshore; Kazakhstan - offshore;  Russia - Caspian Sea;  Turkmenistan - offshore.,depth system,5106,depth,,9001,1996-09-12 00:00:00,,EPSG,,
+5709,Noormal Amsterdams Piel,NAP,,,Netherlands.,height system,5109,height,,9001,1996-09-12 00:00:00,Nederlandse Commissie voor Geodesie publication 30; 1993,EPSG,,
+5710,Oostende,,,,Belgium.,height system,5110,height,,9001,1996-09-12 00:00:00,Nederlandse Commissie voor Geodesie publication 30; 1993,EPSG,,
+5711,Australian Height Datum,AHD,,,Australia (New South Wales; Northern Territories; Queensland; South Australia; Western Australia; Victoria).,height system,5111,height,,9001,1996-09-12 00:00:00,http://www.auslig.gov.au/geodesy,EPSG,,
+5712,Australian Height Datum (Tasmania),AHD (Tasmania),,,Australia - Tasmania.,height system,5112,height,,9001,1996-09-12 00:00:00,,EPSG,,
+5713,Canadian Vertical Datum of 1928,CVD28,,,Canada.,height system,5114,height,,9001,1996-12-12 00:00:00,,EPSG,,
+5714,mean sea level height,msl height,,,,height system,5100,height,,9001,1996-04-12 00:00:00,,EPSG,Approximates geoid.  Not specific to any location or epoch.,
+5715,mean sea level depth,msl depth,,,,depth system,5100,depth,,9001,1996-10-18 00:00:00,,EPSG,Approximates geoid.  Not specific to any location or epoch.,
+5716,Piraeus,,,,Greece.,height system,5115,height,,9001,1997-06-16 00:00:00,Geodesy Department; Public Petroleum Corporation of Greece.,EPSG,,
+5717,N60,,,,Finland.,height system,5116,height,,9001,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,In use since 1968.,
+5718,RH70,,,,Sweden,height system,5117,height,,9001,1997-11-13 00:00:00,National and Survey of Sweden,EPSG,,
+5719,NGF Lallemand,,,,France - mainland.,height system,5118,height,,9001,1997-11-13 00:00:00,"Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994",EPSG,Generally but not entirely superceded by NGF IGN69 (code 5720).,
+5720,NGF IGN69,,,,France - mainland.,height system,5119,height,,9001,1997-11-13 00:00:00,"Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994",EPSG,,
+5721,NGF IGN78,,,,France - Corsica.,height system,5120,height,,9001,1997-11-13 00:00:00,"Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994",EPSG,,
+5722,Maputo,,,,Mozambique.,height system,5121,height,,9001,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,,
+5723,Japanese Standard Levelling Datum,Japan Levelling Datum,,,Japan,height system,5122,height,,9001,1999-04-22 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/image/heichoku2.gif,EPSG,,
+5724,PDO Height Datum 1993,PHD93,,,Oman,height system,5123,height,,9001,1999-04-22 00:00:00,Petroleum Development Oman,EPSG,Supersedes Fahud vertical datum (code 5725) from 1993.,
+5725,Fahud Height Datum 1993,,,,Oman,height system,5124,height,,9001,1999-04-22 00:00:00,Petroleum Development Oman,EPSG,Superseded by PHD93 (code 5724)  from 1993.,
+5726,Ha Tien 1960,,,,Cambodia; Vietnam,height system,5125,height,,9001,1999-10-20 00:00:00,,EPSG,In Vietnam superseded by Hon Dau from 1992.,
+5727,Hon Dau 1992,,,,Vietnam,height system,5126,height,,9001,1999-10-20 00:00:00,,EPSG,In Vietnam supersedes Ha Tien from 1992.,
+5728,Landesnivellement 1902,LN02,,,Liechtenstein;  Switzerland.,height system,5127,height,,9001,1999-10-20 00:00:00,Bundesamt f�r Landestopographie,EPSG,To be superseded by LHN95 (code 5729).,
+5729,Landeshohennetz 1995,LHN95,,,Liechtenstein;  Switzerland.,height system,5128,height,,9001,1999-10-20 00:00:00,Bundesamt f�r Landestopographie,EPSG,To supersede LN02 (code 5728).,
diff --git a/src/tiff/csv/vert_datum.c b/src/tiff/csv/vert_datum.c
new file mode 100644
index 0000000..779f3fe
--- /dev/null
+++ b/src/tiff/csv/vert_datum.c
@@ -0,0 +1,32 @@
+#include "defs.h"
+datafile_rows_t vert_datum_row_1[] = {"VERTICAL_DATUM_CODE","VERT_DAT_EPSG_NAME","VERT_DAT_EPSG_ABBREV","VERT_DAT_USER_NAME","DESCRIPTION","VERT_DAT_TYPE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t vert_datum_row_2[] = {"5100","Mean Sea Level","msl","","","geoidal","1996-04-12 00:00:00","","EPSG","msl has geographic and temporal components.  Users are advised to not use this generic vertical datum but to define specific instances of msl based on knowledge of these components; for instance \"msl at xxx during 19yy\".","",NULL};
+datafile_rows_t vert_datum_row_3[] = {"5101","Ordnance Datum Newlyn","ODN","","","geoidal","1996-10-18 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_datum_row_4[] = {"5102","National Geodetic Vertical Datum 1929","NGVD29","","","geoidal","1996-09-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_datum_row_5[] = {"5103","North American Vertical Datum 1988","NAVD88","","","geoidal","1996-09-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_datum_row_6[] = {"5104","Yellow Sea 1956","Yellow Sea","","","geoidal","1995-06-02 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_datum_row_7[] = {"5105","Baltic Sea","Baltic","","","geoidal","1996-09-12 00:00:00","","EPSG","Average water level at Kronshtadt","",NULL};
+datafile_rows_t vert_datum_row_8[] = {"5106","Caspian Sea","Caspian","","","geoidal","1996-09-12 00:00:00","","EPSG","Defined as -28.0m Baltic datum","",NULL};
+datafile_rows_t vert_datum_row_9[] = {"5107","Nivellement general de la France","NGF","","","geoidal","1996-04-12 00:00:00","","EPSG","Mean sea level at Marseille","",NULL};
+datafile_rows_t vert_datum_row_10[] = {"5109","Normaal Amsterdams Peil","NAP","","","geoidal","1996-09-12 00:00:00","Nederlandse Commissie voor Geodesie publication 30; 1993","EPSG","","",NULL};
+datafile_rows_t vert_datum_row_11[] = {"5110","Oostende","","","","geoidal","1996-09-12 00:00:00","Nederlandse Commissie voor Geodesie publication 30; 1993","EPSG","Mean low water during 1958","",NULL};
+datafile_rows_t vert_datum_row_12[] = {"5111","Australian Height Datum","AHD","","","geoidal","1996-09-12 00:00:00","http://www.auslig.gov.au/geodesy","EPSG","MSL 1966-68 at 30 gauges around coast.","",NULL};
+datafile_rows_t vert_datum_row_13[] = {"5112","Australian Height Datum (Tasmania)","AHD (Tasmania)","","","geoidal","1996-09-12 00:00:00","","EPSG","MSL 1972 at Hobart and Burnie.","",NULL};
+datafile_rows_t vert_datum_row_14[] = {"5113","Sea Level","","","","geoidal","1996-09-12 00:00:00","","EPSG","An unspecified local vertical datum not recommended for use.","",NULL};
+datafile_rows_t vert_datum_row_15[] = {"5114","Canadian Vertical Datum of 1928","CVD28","","","geoidal","1996-12-12 00:00:00","","EPSG","","",NULL};
+datafile_rows_t vert_datum_row_16[] = {"5115","Piraeus Harbour 1986","Piraeus86","","","geoidal","1997-06-16 00:00:00","Geodesy Department; Public Pertoleum Corporation of Greece","EPSG","MSL determined during 1986.","",NULL};
+datafile_rows_t vert_datum_row_17[] = {"5116","Helsinki 1960","N60","","","geoidal","1997-07-22 00:00:00","www.nls.fi/maa/papers/kkj.html","EPSG","MSL at Helsinki during 1960.","",NULL};
+datafile_rows_t vert_datum_row_18[] = {"5117","Rikets hoghtsystem 1970","RH70","","","geoidal","1997-11-13 00:00:00","National Land Survey of Sweden","EPSG","","",NULL};
+datafile_rows_t vert_datum_row_19[] = {"5118","Nivellement general de la France - Lalle","NGF - Lallemand","","","geoidal","1997-11-13 00:00:00","Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994","EPSG","Mean sea level at Marseille.","",NULL};
+datafile_rows_t vert_datum_row_20[] = {"5119","Nivellement general de la France - IGN69","NGF - IGN69","","","geoidal","1997-11-13 00:00:00","Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994","EPSG","Mean sea level at Marseille.","",NULL};
+datafile_rows_t vert_datum_row_21[] = {"5120","Nivellement general de la France - IGN78","NGF - IGN78","","","geoidal","1997-11-13 00:00:00","Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994","EPSG","","",NULL};
+datafile_rows_t vert_datum_row_22[] = {"5121","Maputo","","","","geoidal","1998-04-16 00:00:00","Direc��o Nacional de Geografia e Cadastral (DINAGECA).","EPSG","Mean sea level at Maputo.","",NULL};
+datafile_rows_t vert_datum_row_23[] = {"5122","Japanese Standard Levelling Datum 1949","JapanVD","","","geoidal","1999-04-22 00:00:00","Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/tokyodatum.html","EPSG","24.4140 metres above mean sea level Tokyo Bay.","",NULL};
+datafile_rows_t vert_datum_row_24[] = {"5123","PDO Height Datum 1993","PHD93","","","geoidal","1999-04-22 00:00:00","Petroleum Development Oman","EPSG","Misclosure between Muscat and Salalah less than .5 meters with differences from of up to 5 meters from old Fahud Datum.  The PHD93 adjustment was initially known as the Spine.  Supercedes Fahud Vertical Datum (Code 5124) from 1993.","",NULL};
+datafile_rows_t vert_datum_row_25[] = {"5124","Fahud Height Datum","","","","geoidal","1999-04-22 00:00:00","Petroleum Development Oman","EPSG","Superceded by PHD93 Datum (Code 5123) in 1993.  Based on reciprocal trigonometric heighting based on single MSL determination at Mina Al Fahal.","",NULL};
+datafile_rows_t vert_datum_row_26[] = {"5125","Ha Tien 1960","","","","geoidal","1999-10-20 00:00:00","","EPSG","In Vietnam replaced by Hon Dau in 1992.","",NULL};
+datafile_rows_t vert_datum_row_27[] = {"5126","Hon Dau 1992","","","","geoidal","1999-10-20 00:00:00","","EPSG","Supersedes Ha Tien in Vietnam.","",NULL};
+datafile_rows_t vert_datum_row_28[] = {"5127","Landesnivellement 1902","LN02","","","geoidal","1999-10-20 00:00:00","Bundesamt f�r Landestopographie","EPSG","Origin at Repere Pierre du Niton (RPN) 373.6 metres above msl derived at Marseille.","",NULL};
+datafile_rows_t vert_datum_row_29[] = {"5128","Landeshohennetz 1995","LHN95","","","geoidal","1999-10-20 00:00:00","Bundesamt f�r Landestopographie","EPSG","Origin at Repere Pierre du Niton (RPN) 373.6 metres above msl derived at Marseille.","",NULL};
+
+datafile_rows_t *vert_datum_rows[] = {vert_datum_row_1,vert_datum_row_2,vert_datum_row_3,vert_datum_row_4,vert_datum_row_5,vert_datum_row_6,vert_datum_row_7,vert_datum_row_8,vert_datum_row_9,vert_datum_row_10,vert_datum_row_11,vert_datum_row_12,vert_datum_row_13,vert_datum_row_14,vert_datum_row_15,vert_datum_row_16,vert_datum_row_17,vert_datum_row_18,vert_datum_row_19,vert_datum_row_20,vert_datum_row_21,vert_datum_row_22,vert_datum_row_23,vert_datum_row_24,vert_datum_row_25,vert_datum_ro [...]
diff --git a/src/tiff/csv/vert_datum.csv b/src/tiff/csv/vert_datum.csv
new file mode 100644
index 0000000..852029e
--- /dev/null
+++ b/src/tiff/csv/vert_datum.csv
@@ -0,0 +1,29 @@
+"VERTICAL_DATUM_CODE","VERT_DAT_EPSG_NAME","VERT_DAT_EPSG_ABBREV","VERT_DAT_USER_NAME","DESCRIPTION","VERT_DAT_TYPE","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+5100,Mean Sea Level,msl,,,geoidal,1996-04-12 00:00:00,,EPSG,"msl has geographic and temporal components.  Users are advised to not use this generic vertical datum but to define specific instances of msl based on knowledge of these components; for instance \"msl at xxx during 19yy\".",
+5101,Ordnance Datum Newlyn,ODN,,,geoidal,1996-10-18 00:00:00,,EPSG,,
+5102,National Geodetic Vertical Datum 1929,NGVD29,,,geoidal,1996-09-12 00:00:00,,EPSG,,
+5103,North American Vertical Datum 1988,NAVD88,,,geoidal,1996-09-12 00:00:00,,EPSG,,
+5104,Yellow Sea 1956,Yellow Sea,,,geoidal,1995-06-02 00:00:00,,EPSG,,
+5105,Baltic Sea,Baltic,,,geoidal,1996-09-12 00:00:00,,EPSG,Average water level at Kronshtadt,
+5106,Caspian Sea,Caspian,,,geoidal,1996-09-12 00:00:00,,EPSG,Defined as -28.0m Baltic datum,
+5107,Nivellement general de la France,NGF,,,geoidal,1996-04-12 00:00:00,,EPSG,Mean sea level at Marseille,
+5109,Normaal Amsterdams Peil,NAP,,,geoidal,1996-09-12 00:00:00,Nederlandse Commissie voor Geodesie publication 30; 1993,EPSG,,
+5110,Oostende,,,,geoidal,1996-09-12 00:00:00,Nederlandse Commissie voor Geodesie publication 30; 1993,EPSG,Mean low water during 1958,
+5111,Australian Height Datum,AHD,,,geoidal,1996-09-12 00:00:00,http://www.auslig.gov.au/geodesy,EPSG,MSL 1966-68 at 30 gauges around coast.,
+5112,Australian Height Datum (Tasmania),AHD (Tasmania),,,geoidal,1996-09-12 00:00:00,,EPSG,MSL 1972 at Hobart and Burnie.,
+5113,Sea Level,,,,geoidal,1996-09-12 00:00:00,,EPSG,An unspecified local vertical datum not recommended for use.,
+5114,Canadian Vertical Datum of 1928,CVD28,,,geoidal,1996-12-12 00:00:00,,EPSG,,
+5115,Piraeus Harbour 1986,Piraeus86,,,geoidal,1997-06-16 00:00:00,Geodesy Department; Public Pertoleum Corporation of Greece,EPSG,MSL determined during 1986.,
+5116,Helsinki 1960,N60,,,geoidal,1997-07-22 00:00:00,www.nls.fi/maa/papers/kkj.html,EPSG,MSL at Helsinki during 1960.,
+5117,Rikets hoghtsystem 1970,RH70,,,geoidal,1997-11-13 00:00:00,National Land Survey of Sweden,EPSG,,
+5118,Nivellement general de la France - Lalle,NGF - Lallemand,,,geoidal,1997-11-13 00:00:00,"Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994",EPSG,Mean sea level at Marseille.,
+5119,Nivellement general de la France - IGN69,NGF - IGN69,,,geoidal,1997-11-13 00:00:00,"Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994",EPSG,Mean sea level at Marseille.,
+5120,Nivellement general de la France - IGN78,NGF - IGN78,,,geoidal,1997-11-13 00:00:00,"Conseil National de l'Information Geographique groupe de travail \"Reseaux de Nivellement\" recommendations v5.1 April 1994",EPSG,,
+5121,Maputo,,,,geoidal,1998-04-16 00:00:00,Direc��o Nacional de Geografia e Cadastral (DINAGECA).,EPSG,Mean sea level at Maputo.,
+5122,Japanese Standard Levelling Datum 1949,JapanVD,,,geoidal,1999-04-22 00:00:00,Ministry of Construction; Japan.  http://vldb.gsi-mc.go.jp/sokuchi/datum/tokyodatum.html,EPSG,24.4140 metres above mean sea level Tokyo Bay.,
+5123,PDO Height Datum 1993,PHD93,,,geoidal,1999-04-22 00:00:00,Petroleum Development Oman,EPSG,Misclosure between Muscat and Salalah less than .5 meters with differences from of up to 5 meters from old Fahud Datum.  The PHD93 adjustment was initially known as the Spine.  Supercedes Fahud Vertical Datum (Code 5124) from 1993.,
+5124,Fahud Height Datum,,,,geoidal,1999-04-22 00:00:00,Petroleum Development Oman,EPSG,Superceded by PHD93 Datum (Code 5123) in 1993.  Based on reciprocal trigonometric heighting based on single MSL determination at Mina Al Fahal.,
+5125,Ha Tien 1960,,,,geoidal,1999-10-20 00:00:00,,EPSG,In Vietnam replaced by Hon Dau in 1992.,
+5126,Hon Dau 1992,,,,geoidal,1999-10-20 00:00:00,,EPSG,Supersedes Ha Tien in Vietnam.,
+5127,Landesnivellement 1902,LN02,,,geoidal,1999-10-20 00:00:00,Bundesamt f�r Landestopographie,EPSG,Origin at Repere Pierre du Niton (RPN) 373.6 metres above msl derived at Marseille.,
+5128,Landeshohennetz 1995,LHN95,,,geoidal,1999-10-20 00:00:00,Bundesamt f�r Landestopographie,EPSG,Origin at Repere Pierre du Niton (RPN) 373.6 metres above msl derived at Marseille.,
diff --git a/src/tiff/csv/vert_offset.c b/src/tiff/csv/vert_offset.c
new file mode 100644
index 0000000..555fedb
--- /dev/null
+++ b/src/tiff/csv/vert_offset.c
@@ -0,0 +1,5 @@
+#include "defs.h"
+datafile_rows_t vert_offset_row_1[] = {"OFFSET_CODE","INITIAL_VERTCS_CODE","TERMINAL_VERTCS_CODE","COORD_TRF_METHOD_CODE","OFFSET_VALUE","OFFSET_UOM_CODE","AREA_OF_USE","DESCRIPTION","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID",NULL};
+datafile_rows_t vert_offset_row_2[] = {"5400","5705","5706","9616","28.0","9001","Azerbaijan; Kazakstan; Russia; Turkmenistan - Caspian Sea","","1999-11-12 00:00:00","","EPSG","","97.61  99.79",NULL};
+
+datafile_rows_t *vert_offset_rows[] = {vert_offset_row_1,vert_offset_row_2,NULL};
diff --git a/src/tiff/csv/vert_offset.csv b/src/tiff/csv/vert_offset.csv
new file mode 100644
index 0000000..88f9cc0
--- /dev/null
+++ b/src/tiff/csv/vert_offset.csv
@@ -0,0 +1,2 @@
+"OFFSET_CODE","INITIAL_VERTCS_CODE","TERMINAL_VERTCS_CODE","COORD_TRF_METHOD_CODE","OFFSET_VALUE","OFFSET_UOM_CODE","AREA_OF_USE","DESCRIPTION","REVISION_DATE","INFORMATION_SOURCE","DATA_SOURCE","REMARKS","CHANGE_ID"
+5400,5705,5706,9616,28.0,9001,Azerbaijan; Kazakstan; Russia; Turkmenistan - Caspian Sea,,1999-11-12 00:00:00,,EPSG,,97.61  99.79
diff --git a/src/tiff/epsg_datum.inc b/src/tiff/epsg_datum.inc
new file mode 100644
index 0000000..43d6d79
--- /dev/null
+++ b/src/tiff/epsg_datum.inc
@@ -0,0 +1,174 @@
+/*
+ *  EPSG/POSC Datum database -- GeoTIFF Rev. 0.2
+ */
+ 
+/* C database for Geotiff include files.   */
+/* the macro ValuePair() must be defined   */
+/* by the enclosing include file           */
+
+#ifdef INCLUDE_OLD_CODES
+#include old_datum.inc
+#endif /* OLD Codes */
+
+/* New datums */
+ValuePair(Datum_Dealul_Piscului_1970,6317)
+
+/* Datums for which only the ellipsoid is known */
+ValuePair(DatumE_Airy1830,	6001)
+ValuePair(DatumE_AiryModified1849,	6002)
+ValuePair(DatumE_AustralianNationalSpheroid,	6003)
+ValuePair(DatumE_Bessel1841,	6004)
+ValuePair(DatumE_BesselModified,	6005)
+ValuePair(DatumE_BesselNamibia,	6006)
+ValuePair(DatumE_Clarke1858,	6007)
+ValuePair(DatumE_Clarke1866,	6008)
+ValuePair(DatumE_Clarke1866Michigan,	6009)
+ValuePair(DatumE_Clarke1880_Benoit,	6010)
+ValuePair(DatumE_Clarke1880_IGN,	6011)
+ValuePair(DatumE_Clarke1880_RGS,	6012)
+ValuePair(DatumE_Clarke1880_Arc,	6013)
+ValuePair(DatumE_Clarke1880_SGA1922,	6014)
+ValuePair(DatumE_Everest1830_1937Adjustment,	6015)
+ValuePair(DatumE_Everest1830_1967Definition,	6016)
+ValuePair(DatumE_Everest1830_1975Definition,	6017)
+ValuePair(DatumE_Everest1830Modified,	6018)
+ValuePair(DatumE_GRS1980,	6019)
+ValuePair(DatumE_Helmert1906,	6020)
+ValuePair(DatumE_IndonesianNationalSpheroid,	6021)
+ValuePair(DatumE_International1924,	6022)
+ValuePair(DatumE_International1967,	6023)
+ValuePair(DatumE_Krassowsky1960,	6024)
+ValuePair(DatumE_NWL9D,	6025)
+ValuePair(DatumE_NWL10D,	6026)
+ValuePair(DatumE_Plessis1817,	6027)
+ValuePair(DatumE_Struve1860,	6028)
+ValuePair(DatumE_WarOffice,	6029)
+ValuePair(DatumE_WGS84,	6030)
+ValuePair(DatumE_GEM10C,	6031)
+ValuePair(DatumE_OSU86F,	6032)
+ValuePair(DatumE_OSU91A,	6033)
+ValuePair(DatumE_Clarke1880,	6034)
+ValuePair(DatumE_Sphere,	6035)
+
+/* standard datums */
+ValuePair(Datum_Adindan,	6201)
+ValuePair(Datum_Australian_Geodetic_Datum_1966,	6202)
+ValuePair(Datum_Australian_Geodetic_Datum_1984,	6203)
+ValuePair(Datum_Ain_el_Abd_1970,	6204)
+ValuePair(Datum_Afgooye,	6205)
+ValuePair(Datum_Agadez,	6206)
+ValuePair(Datum_Lisbon,	6207)
+ValuePair(Datum_Aratu,	6208)
+ValuePair(Datum_Arc_1950,	6209)
+ValuePair(Datum_Arc_1960,	6210)
+ValuePair(Datum_Batavia,	6211)
+ValuePair(Datum_Barbados,	6212)
+ValuePair(Datum_Beduaram,	6213)
+ValuePair(Datum_Beijing_1954,	6214)
+ValuePair(Datum_Reseau_National_Belge_1950,	6215)
+ValuePair(Datum_Bermuda_1957,	6216)
+ValuePair(Datum_Bern_1898,	6217)
+ValuePair(Datum_Bogota,	6218)
+ValuePair(Datum_Bukit_Rimpah,	6219)
+ValuePair(Datum_Camacupa,	6220)
+ValuePair(Datum_Campo_Inchauspe,	6221)
+ValuePair(Datum_Cape,	6222)
+ValuePair(Datum_Carthage,	6223)
+ValuePair(Datum_Chua,	6224)
+ValuePair(Datum_Corrego_Alegre,	6225)
+ValuePair(Datum_Cote_d_Ivoire,	6226)
+ValuePair(Datum_Deir_ez_Zor,	6227)
+ValuePair(Datum_Douala,	6228)
+ValuePair(Datum_Egypt_1907,	6229)
+ValuePair(Datum_European_Datum_1950,	6230)
+ValuePair(Datum_European_Datum_1987,	6231)
+ValuePair(Datum_Fahud,	6232)
+ValuePair(Datum_Gandajika_1970,	6233)
+ValuePair(Datum_Garoua,	6234)
+ValuePair(Datum_Guyane_Francaise,	6235)
+ValuePair(Datum_Hu_Tzu_Shan,	6236)
+ValuePair(Datum_Hungarian_Datum_1972,	6237)
+ValuePair(Datum_Indonesian_Datum_1974,	6238)
+ValuePair(Datum_Indian_1954,	6239)
+ValuePair(Datum_Indian_1975,	6240)
+ValuePair(Datum_Jamaica_1875,	6241)
+ValuePair(Datum_Jamaica_1969,	6242)
+ValuePair(Datum_Kalianpur,	6243)
+ValuePair(Datum_Kandawala,	6244)
+ValuePair(Datum_Kertau,	6245)
+ValuePair(Datum_Kuwait_Oil_Company,	6246)
+ValuePair(Datum_La_Canoa,	6247)
+ValuePair(Datum_Provisional_S_American_Datum_1956,	6248)
+ValuePair(Datum_Lake,	6249)
+ValuePair(Datum_Leigon,	6250)
+ValuePair(Datum_Liberia_1964,	6251)
+ValuePair(Datum_Lome,	6252)
+ValuePair(Datum_Luzon_1911,	6253)
+ValuePair(Datum_Hito_XVIII_1963,	6254)
+ValuePair(Datum_Herat_North,	6255)
+ValuePair(Datum_Mahe_1971,	6256)
+ValuePair(Datum_Makassar,	6257)
+ValuePair(Datum_European_Reference_System_1989,	6258)
+ValuePair(Datum_Malongo_1987,	6259)
+ValuePair(Datum_Manoca,	6260)
+ValuePair(Datum_Merchich,	6261)
+ValuePair(Datum_Massawa,	6262)
+ValuePair(Datum_Minna,	6263)
+ValuePair(Datum_Mhast,	6264)
+ValuePair(Datum_Monte_Mario,	6265)
+ValuePair(Datum_M_poraloko,	6266)
+ValuePair(Datum_North_American_Datum_1927,	6267)
+ValuePair(Datum_NAD_Michigan,	6268)
+ValuePair(Datum_North_American_Datum_1983,	6269)
+ValuePair(Datum_Nahrwan_1967,	6270)
+ValuePair(Datum_Naparima_1972,	6271)
+ValuePair(Datum_New_Zealand_Geodetic_Datum_1949,	6272)
+ValuePair(Datum_NGO_1948,	6273)
+ValuePair(Datum_Datum_73,	6274)
+ValuePair(Datum_Nouvelle_Triangulation_Francaise,	6275)
+ValuePair(Datum_NSWC_9Z_2,	6276)
+ValuePair(Datum_OSGB_1936,	6277)
+ValuePair(Datum_OSGB_1970_SN,	6278)
+ValuePair(Datum_OS_SN_1980,	6279)
+ValuePair(Datum_Padang_1884,	6280)
+ValuePair(Datum_Palestine_1923,	6281)
+ValuePair(Datum_Pointe_Noire,	6282)
+ValuePair(Datum_Geocentric_Datum_of_Australia_1994,	6283)
+ValuePair(Datum_Pulkovo_1942,	6284)
+ValuePair(Datum_Qatar,	6285)
+ValuePair(Datum_Qatar_1948,	6286)
+ValuePair(Datum_Qornoq,	6287)
+ValuePair(Datum_Loma_Quintana,	6288)
+ValuePair(Datum_Amersfoort,	6289)
+ValuePair(Datum_RT38,	6290)
+ValuePair(Datum_South_American_Datum_1969,	6291)
+ValuePair(Datum_Sapper_Hill_1943,	6292)
+ValuePair(Datum_Schwarzeck,	6293)
+ValuePair(Datum_Segora,	6294)
+ValuePair(Datum_Serindung,	6295)
+ValuePair(Datum_Sudan,	6296)
+ValuePair(Datum_Tananarive_1925,	6297)
+ValuePair(Datum_Timbalai_1948,	6298)
+ValuePair(Datum_TM65,	6299)
+ValuePair(Datum_TM75,	6300)
+ValuePair(Datum_Tokyo,	6301)
+ValuePair(Datum_Trinidad_1903,	6302)
+ValuePair(Datum_Trucial_Coast_1948,	6303)
+ValuePair(Datum_Voirol_1875,	6304)
+ValuePair(Datum_Voirol_Unifie_1960,	6305)
+ValuePair(Datum_Bern_1938,	6306)
+ValuePair(Datum_Nord_Sahara_1959,	6307)
+ValuePair(Datum_Stockholm_1938,	6308)
+ValuePair(Datum_Yacare,	6309)
+ValuePair(Datum_Yoff,	6310)
+ValuePair(Datum_Zanderij,	6311)
+ValuePair(Datum_Militar_Geographische_Institut,	6312)
+ValuePair(Datum_Reseau_National_Belge_1972,	6313)
+ValuePair(Datum_Deutsche_Hauptdreiecksnetz,	6314)
+ValuePair(Datum_Conakry_1905,	6315)
+ValuePair(Datum_WGS72,	6322)
+ValuePair(Datum_WGS72_Transit_Broadcast_Ephemeris,	6324)
+ValuePair(Datum_WGS84,	6326)
+ValuePair(Datum_Ancienne_Triangulation_Francaise,	6901)
+ValuePair(Datum_Nord_de_Guerre,	6902)
+/* end of list */
diff --git a/src/tiff/epsg_ellipse.inc b/src/tiff/epsg_ellipse.inc
new file mode 100644
index 0000000..2a05b6a
--- /dev/null
+++ b/src/tiff/epsg_ellipse.inc
@@ -0,0 +1,48 @@
+/*
+ *  GeoTIFF Rev. 0.2  Ellipsoids
+ */
+
+/* C database for Geotiff include files.   */
+/* the macro ValuePair() must be defined   */
+/* by the enclosing include file           */
+
+#ifdef INCLUDE_OLD_CODES
+#include old_ellipse.inc
+#endif /* OLD Codes */
+
+ValuePair(Ellipse_Airy_1830,	7001)
+ValuePair(Ellipse_Airy_Modified_1849,	7002)
+ValuePair(Ellipse_Australian_National_Spheroid,	7003)
+ValuePair(Ellipse_Bessel_1841,	7004)
+ValuePair(Ellipse_Bessel_Modified,	7005)
+ValuePair(Ellipse_Bessel_Namibia,	7006)
+ValuePair(Ellipse_Clarke_1858,	7007)
+ValuePair(Ellipse_Clarke_1866,	7008)
+ValuePair(Ellipse_Clarke_1866_Michigan,	7009)
+ValuePair(Ellipse_Clarke_1880_Benoit,	7010)
+ValuePair(Ellipse_Clarke_1880_IGN,	7011)
+ValuePair(Ellipse_Clarke_1880_RGS,	7012)
+ValuePair(Ellipse_Clarke_1880_Arc,	7013)
+ValuePair(Ellipse_Clarke_1880_SGA_1922,	7014)
+ValuePair(Ellipse_Everest_1830_1937_Adjustment,	7015)
+ValuePair(Ellipse_Everest_1830_1967_Definition,	7016)
+ValuePair(Ellipse_Everest_1830_1975_Definition,	7017)
+ValuePair(Ellipse_Everest_1830_Modified,	7018)
+ValuePair(Ellipse_GRS_1980,	7019)
+ValuePair(Ellipse_Helmert_1906,	7020)
+ValuePair(Ellipse_Indonesian_National_Spheroid,	7021)
+ValuePair(Ellipse_International_1924,	7022)
+ValuePair(Ellipse_International_1967,	7023)
+ValuePair(Ellipse_Krassowsky_1940,	7024)
+ValuePair(Ellipse_NWL_9D,	7025)
+ValuePair(Ellipse_NWL_10D,	7026)
+ValuePair(Ellipse_Plessis_1817,	7027)
+ValuePair(Ellipse_Struve_1860,	7028)
+ValuePair(Ellipse_War_Office,	7029)
+ValuePair(Ellipse_WGS_84,	7030)
+ValuePair(Ellipse_GEM_10C,	7031)
+ValuePair(Ellipse_OSU86F,	7032)
+ValuePair(Ellipse_OSU91A,	7033)
+ValuePair(Ellipse_Clarke_1880,	7034)
+ValuePair(Ellipse_Sphere,	7035)
+/* end of list */
diff --git a/src/tiff/epsg_gcs.inc b/src/tiff/epsg_gcs.inc
new file mode 100644
index 0000000..d351c24
--- /dev/null
+++ b/src/tiff/epsg_gcs.inc
@@ -0,0 +1,193 @@
+/*
+ *  EPSG/POSC GCS Codes -- GeoTIFF Rev. 0.2
+ */
+
+/* C database for Geotiff include files.   */
+/* the macro ValuePair() must be defined   */
+/* by the enclosing include file           */
+
+#ifdef INCLUDE_OLD_CODES
+#include old_gcs.inc
+#endif /* OLD Codes */
+
+/* Unspecified GCS based on ellipsoid */
+ValuePair(GCSE_Airy1830,	4001)
+ValuePair(GCSE_AiryModified1849,	4002)
+ValuePair(GCSE_AustralianNationalSpheroid,	4003)
+ValuePair(GCSE_Bessel1841,	4004)
+ValuePair(GCSE_BesselModified,	4005)
+ValuePair(GCSE_BesselNamibia,	4006)
+ValuePair(GCSE_Clarke1858,	4007)
+ValuePair(GCSE_Clarke1866,	4008)
+ValuePair(GCSE_Clarke1866Michigan,	4009)
+ValuePair(GCSE_Clarke1880_Benoit,	4010)
+ValuePair(GCSE_Clarke1880_IGN,	4011)
+ValuePair(GCSE_Clarke1880_RGS,	4012)
+ValuePair(GCSE_Clarke1880_Arc,	4013)
+ValuePair(GCSE_Clarke1880_SGA1922,	4014)
+ValuePair(GCSE_Everest1830_1937Adjustment,	4015)
+ValuePair(GCSE_Everest1830_1967Definition,	4016)
+ValuePair(GCSE_Everest1830_1975Definition,	4017)
+ValuePair(GCSE_Everest1830Modified,	4018)
+ValuePair(GCSE_GRS1980,	4019)
+ValuePair(GCSE_Helmert1906,	4020)
+ValuePair(GCSE_IndonesianNationalSpheroid,	4021)
+ValuePair(GCSE_International1924,	4022)
+ValuePair(GCSE_International1967,	4023)
+ValuePair(GCSE_Krassowsky1940,	4024)
+ValuePair(GCSE_NWL9D,	4025)
+ValuePair(GCSE_NWL10D,	4026)
+ValuePair(GCSE_Plessis1817,	4027)
+ValuePair(GCSE_Struve1860,	4028)
+ValuePair(GCSE_WarOffice,	4029)
+ValuePair(GCSE_WGS84,	4030)
+ValuePair(GCSE_GEM10C,	4031)
+ValuePair(GCSE_OSU86F,	4032)
+ValuePair(GCSE_OSU91A,	4033)
+ValuePair(GCSE_Clarke1880,	4034)
+ValuePair(GCSE_Sphere,	4035)
+
+/* New GCS */
+ValuePair(GCS_Greek,4120)
+ValuePair(GCS_GGRS87,4121)
+ValuePair(GCS_KKJ,4123)
+ValuePair(GCS_RT90,4124)
+ValuePair(GCS_EST92,4133)
+ValuePair(GCS_Dealul_Piscului_1970,4317)
+ValuePair(GCS_Greek_Athens,4815)
+
+/* Standard GCS */
+ValuePair(GCS_Adindan,	4201)
+ValuePair(GCS_AGD66,	4202)
+ValuePair(GCS_AGD84,	4203)
+ValuePair(GCS_Ain_el_Abd,	4204)
+ValuePair(GCS_Afgooye,	4205)
+ValuePair(GCS_Agadez,	4206)
+ValuePair(GCS_Lisbon,	4207)
+ValuePair(GCS_Aratu,	4208)
+ValuePair(GCS_Arc_1950,	4209)
+ValuePair(GCS_Arc_1960,	4210)
+ValuePair(GCS_Batavia,	4211)
+ValuePair(GCS_Barbados,	4212)
+ValuePair(GCS_Beduaram,	4213)
+ValuePair(GCS_Beijing_1954,	4214)
+ValuePair(GCS_Belge_1950,	4215)
+ValuePair(GCS_Bermuda_1957,	4216)
+ValuePair(GCS_Bern_1898,	4217)
+ValuePair(GCS_Bogota,	4218)
+ValuePair(GCS_Bukit_Rimpah,	4219)
+ValuePair(GCS_Camacupa,	4220)
+ValuePair(GCS_Campo_Inchauspe,	4221)
+ValuePair(GCS_Cape,	4222)
+ValuePair(GCS_Carthage,	4223)
+ValuePair(GCS_Chua,	4224)
+ValuePair(GCS_Corrego_Alegre,	4225)
+ValuePair(GCS_Cote_d_Ivoire,	4226)
+ValuePair(GCS_Deir_ez_Zor,	4227)
+ValuePair(GCS_Douala,	4228)
+ValuePair(GCS_Egypt_1907,	4229)
+ValuePair(GCS_ED50,	4230)
+ValuePair(GCS_ED87,	4231)
+ValuePair(GCS_Fahud,	4232)
+ValuePair(GCS_Gandajika_1970,	4233)
+ValuePair(GCS_Garoua,	4234)
+ValuePair(GCS_Guyane_Francaise,	4235)
+ValuePair(GCS_Hu_Tzu_Shan,	4236)
+ValuePair(GCS_HD72,	4237)
+ValuePair(GCS_ID74,	4238)
+ValuePair(GCS_Indian_1954,	4239)
+ValuePair(GCS_Indian_1975,	4240)
+ValuePair(GCS_Jamaica_1875,	4241)
+ValuePair(GCS_JAD69,	4242)
+ValuePair(GCS_Kalianpur,	4243)
+ValuePair(GCS_Kandawala,	4244)
+ValuePair(GCS_Kertau,	4245)
+ValuePair(GCS_KOC,	4246)
+ValuePair(GCS_La_Canoa,	4247)
+ValuePair(GCS_PSAD56,	4248)
+ValuePair(GCS_Lake,	4249)
+ValuePair(GCS_Leigon,	4250)
+ValuePair(GCS_Liberia_1964,	4251)
+ValuePair(GCS_Lome,	4252)
+ValuePair(GCS_Luzon_1911,	4253)
+ValuePair(GCS_Hito_XVIII_1963,	4254)
+ValuePair(GCS_Herat_North,	4255)
+ValuePair(GCS_Mahe_1971,	4256)
+ValuePair(GCS_Makassar,	4257)
+ValuePair(GCS_EUREF89,	4258)
+ValuePair(GCS_Malongo_1987,	4259)
+ValuePair(GCS_Manoca,	4260)
+ValuePair(GCS_Merchich,	4261)
+ValuePair(GCS_Massawa,	4262)
+ValuePair(GCS_Minna,	4263)
+ValuePair(GCS_Mhast,	4264)
+ValuePair(GCS_Monte_Mario,	4265)
+ValuePair(GCS_M_poraloko,	4266)
+ValuePair(GCS_NAD27,	4267)
+ValuePair(GCS_NAD_Michigan,	4268)
+ValuePair(GCS_NAD83,	4269)
+ValuePair(GCS_Nahrwan_1967,	4270)
+ValuePair(GCS_Naparima_1972,	4271)
+ValuePair(GCS_GD49,	4272)
+ValuePair(GCS_NGO_1948,	4273)
+ValuePair(GCS_Datum_73,	4274)
+ValuePair(GCS_NTF,	4275)
+ValuePair(GCS_NSWC_9Z_2,	4276)
+ValuePair(GCS_OSGB_1936,	4277)
+ValuePair(GCS_OSGB70,	4278)
+ValuePair(GCS_OS_SN80,	4279)
+ValuePair(GCS_Padang,	4280)
+ValuePair(GCS_Palestine_1923,	4281)
+ValuePair(GCS_Pointe_Noire,	4282)
+ValuePair(GCS_GDA94,	4283)
+ValuePair(GCS_Pulkovo_1942,	4284)
+ValuePair(GCS_Qatar,	4285)
+ValuePair(GCS_Qatar_1948,	4286)
+ValuePair(GCS_Qornoq,	4287)
+ValuePair(GCS_Loma_Quintana,	4288)
+ValuePair(GCS_Amersfoort,	4289)
+ValuePair(GCS_RT38,	4290)
+ValuePair(GCS_SAD69,	4291)
+ValuePair(GCS_Sapper_Hill_1943,	4292)
+ValuePair(GCS_Schwarzeck,	4293)
+ValuePair(GCS_Segora,	4294)
+ValuePair(GCS_Serindung,	4295)
+ValuePair(GCS_Sudan,	4296)
+ValuePair(GCS_Tananarive,	4297)
+ValuePair(GCS_Timbalai_1948,	4298)
+ValuePair(GCS_TM65,	4299)
+ValuePair(GCS_TM75,	4300)
+ValuePair(GCS_Tokyo,	4301)
+ValuePair(GCS_Trinidad_1903,	4302)
+ValuePair(GCS_TC_1948,	4303)
+ValuePair(GCS_Voirol_1875,	4304)
+ValuePair(GCS_Voirol_Unifie,	4305)
+ValuePair(GCS_Bern_1938,	4306)
+ValuePair(GCS_Nord_Sahara_1959,	4307)
+ValuePair(GCS_Stockholm_1938,	4308)
+ValuePair(GCS_Yacare,	4309)
+ValuePair(GCS_Yoff,	4310)
+ValuePair(GCS_Zanderij,	4311)
+ValuePair(GCS_MGI,	4312)
+ValuePair(GCS_Belge_1972,	4313)
+ValuePair(GCS_DHDN,	4314)
+ValuePair(GCS_Conakry_1905,	4315)
+ValuePair(GCS_WGS_72,	4322)
+ValuePair(GCS_WGS_72BE,	4324)
+ValuePair(GCS_WGS_84,	4326)
+ValuePair(GCS_Bern_1898_Bern,	4801)
+ValuePair(GCS_Bogota_Bogota,	4802)
+ValuePair(GCS_Lisbon_Lisbon,	4803)
+ValuePair(GCS_Makassar_Jakarta,	4804)
+ValuePair(GCS_MGI_Ferro,	4805)
+ValuePair(GCS_Monte_Mario_Rome,	4806)
+ValuePair(GCS_NTF_Paris,	4807)
+ValuePair(GCS_Padang_Jakarta,	4808)
+ValuePair(GCS_Belge_1950_Brussels,	4809)
+ValuePair(GCS_Tananarive_Paris,	4810)
+ValuePair(GCS_Voirol_1875_Paris,	4811)
+ValuePair(GCS_Voirol_Unifie_Paris,	4812)
+ValuePair(GCS_Batavia_Jakarta,	4813)
+ValuePair(GCS_ATF_Paris,	4901)
+ValuePair(GCS_NDG_Paris,	4902)
+/* End of list */
diff --git a/src/tiff/epsg_pcs.inc b/src/tiff/epsg_pcs.inc
new file mode 100644
index 0000000..bca0f0d
--- /dev/null
+++ b/src/tiff/epsg_pcs.inc
@@ -0,0 +1,1012 @@
+/*
+ *  EPSG PCS Codes - GeoTIFF Rev 0.2
+ */
+
+/* C database for Geotiff include files.   */
+/* the macro ValuePair() must be defined   */
+/* by the enclosing include file           */
+
+#ifdef INCLUDE_OLD_CODES
+#include old_pcs.inc
+#endif /* OLD Codes */
+
+/* Newer PCS */
+ValuePair(PCS_Hjorsey_1955_Lambert, 3053)
+ValuePair(PCS_ISN93_Lambert_1993, 3057)
+ValuePair(PCS_ETRS89_Poland_CS2000_zone_5,2176)
+ValuePair(PCS_ETRS89_Poland_CS2000_zone_6,2177)
+ValuePair(PCS_ETRS89_Poland_CS2000_zone_7,2177)
+ValuePair(PCS_ETRS89_Poland_CS2000_zone_8,2178)
+ValuePair(PCS_ETRS89_Poland_CS92,2180)
+
+/* New PCS */
+ValuePair(PCS_GGRS87_Greek_Grid,2100)
+ValuePair(PCS_KKJ_Finland_zone_1,2391)
+ValuePair(PCS_KKJ_Finland_zone_2,2392)
+ValuePair(PCS_KKJ_Finland_zone_3,2393)
+ValuePair(PCS_KKJ_Finland_zone_4,2394)
+ValuePair(PCS_RT90_2_5_gon_W,2400)
+ValuePair(PCS_Lietuvos_Koordinoei_Sistema_1994,2600)
+ValuePair(PCS_Estonian_Coordinate_System_of_1992,3300)
+ValuePair(PCS_HD72_EOV,23700)
+ValuePair(PCS_Dealul_Piscului_1970_Stereo_70,31700)
+
+ValuePair(PCS_Adindan_UTM_zone_37N,	20137)
+ValuePair(PCS_Adindan_UTM_zone_38N,	20138)
+ValuePair(PCS_AGD66_AMG_zone_48,	20248)
+ValuePair(PCS_AGD66_AMG_zone_49,	20249)
+ValuePair(PCS_AGD66_AMG_zone_50,	20250)
+ValuePair(PCS_AGD66_AMG_zone_51,	20251)
+ValuePair(PCS_AGD66_AMG_zone_52,	20252)
+ValuePair(PCS_AGD66_AMG_zone_53,	20253)
+ValuePair(PCS_AGD66_AMG_zone_54,	20254)
+ValuePair(PCS_AGD66_AMG_zone_55,	20255)
+ValuePair(PCS_AGD66_AMG_zone_56,	20256)
+ValuePair(PCS_AGD66_AMG_zone_57,	20257)
+ValuePair(PCS_AGD66_AMG_zone_58,	20258)
+ValuePair(PCS_AGD84_AMG_zone_48,	20348)
+ValuePair(PCS_AGD84_AMG_zone_49,	20349)
+ValuePair(PCS_AGD84_AMG_zone_50,	20350)
+ValuePair(PCS_AGD84_AMG_zone_51,	20351)
+ValuePair(PCS_AGD84_AMG_zone_52,	20352)
+ValuePair(PCS_AGD84_AMG_zone_53,	20353)
+ValuePair(PCS_AGD84_AMG_zone_54,	20354)
+ValuePair(PCS_AGD84_AMG_zone_55,	20355)
+ValuePair(PCS_AGD84_AMG_zone_56,	20356)
+ValuePair(PCS_AGD84_AMG_zone_57,	20357)
+ValuePair(PCS_AGD84_AMG_zone_58,	20358)
+ValuePair(PCS_Ain_el_Abd_UTM_zone_37N,	20437)
+ValuePair(PCS_Ain_el_Abd_UTM_zone_38N,	20438)
+ValuePair(PCS_Ain_el_Abd_UTM_zone_39N,	20439)
+ValuePair(PCS_Ain_el_Abd_Bahrain_Grid,	20499)
+ValuePair(PCS_Afgooye_UTM_zone_38N,	20538)
+ValuePair(PCS_Afgooye_UTM_zone_39N,	20539)
+ValuePair(PCS_Lisbon_Portugese_Grid,	20700)
+ValuePair(PCS_Aratu_UTM_zone_22S,	20822)
+ValuePair(PCS_Aratu_UTM_zone_23S,	20823)
+ValuePair(PCS_Aratu_UTM_zone_24S,	20824)
+ValuePair(PCS_Arc_1950_Lo13,	20973)
+ValuePair(PCS_Arc_1950_Lo15,	20975)
+ValuePair(PCS_Arc_1950_Lo17,	20977)
+ValuePair(PCS_Arc_1950_Lo19,	20979)
+ValuePair(PCS_Arc_1950_Lo21,	20981)
+ValuePair(PCS_Arc_1950_Lo23,	20983)
+ValuePair(PCS_Arc_1950_Lo25,	20985)
+ValuePair(PCS_Arc_1950_Lo27,	20987)
+ValuePair(PCS_Arc_1950_Lo29,	20989)
+ValuePair(PCS_Arc_1950_Lo31,	20991)
+ValuePair(PCS_Arc_1950_Lo33,	20993)
+ValuePair(PCS_Arc_1950_Lo35,	20995)
+ValuePair(PCS_Batavia_NEIEZ,	21100)
+ValuePair(PCS_Batavia_UTM_zone_48S,	21148)
+ValuePair(PCS_Batavia_UTM_zone_49S,	21149)
+ValuePair(PCS_Batavia_UTM_zone_50S,	21150)
+ValuePair(PCS_Beijing_Gauss_zone_13,	21413)
+ValuePair(PCS_Beijing_Gauss_zone_14,	21414)
+ValuePair(PCS_Beijing_Gauss_zone_15,	21415)
+ValuePair(PCS_Beijing_Gauss_zone_16,	21416)
+ValuePair(PCS_Beijing_Gauss_zone_17,	21417)
+ValuePair(PCS_Beijing_Gauss_zone_18,	21418)
+ValuePair(PCS_Beijing_Gauss_zone_19,	21419)
+ValuePair(PCS_Beijing_Gauss_zone_20,	21420)
+ValuePair(PCS_Beijing_Gauss_zone_21,	21421)
+ValuePair(PCS_Beijing_Gauss_zone_22,	21422)
+ValuePair(PCS_Beijing_Gauss_zone_23,	21423)
+ValuePair(PCS_Beijing_Gauss_13N,	21473)
+ValuePair(PCS_Beijing_Gauss_14N,	21474)
+ValuePair(PCS_Beijing_Gauss_15N,	21475)
+ValuePair(PCS_Beijing_Gauss_16N,	21476)
+ValuePair(PCS_Beijing_Gauss_17N,	21477)
+ValuePair(PCS_Beijing_Gauss_18N,	21478)
+ValuePair(PCS_Beijing_Gauss_19N,	21479)
+ValuePair(PCS_Beijing_Gauss_20N,	21480)
+ValuePair(PCS_Beijing_Gauss_21N,	21481)
+ValuePair(PCS_Beijing_Gauss_22N,	21482)
+ValuePair(PCS_Beijing_Gauss_23N,	21483)
+ValuePair(PCS_Belge_Lambert_50,	21500)
+ValuePair(PCS_Bern_1898_Swiss_Old,	21790)
+ValuePair(PCS_Bogota_UTM_zone_17N,	21817)
+ValuePair(PCS_Bogota_UTM_zone_18N,	21818)
+ValuePair(PCS_Bogota_Colombia_3W,	21891)
+ValuePair(PCS_Bogota_Colombia_Bogota,	21892)
+ValuePair(PCS_Bogota_Colombia_3E,	21893)
+ValuePair(PCS_Bogota_Colombia_6E,	21894)
+ValuePair(PCS_Camacupa_UTM_32S,	22032)
+ValuePair(PCS_Camacupa_UTM_33S,	22033)
+ValuePair(PCS_C_Inchauspe_Argentina_1,	22191)
+ValuePair(PCS_C_Inchauspe_Argentina_2,	22192)
+ValuePair(PCS_C_Inchauspe_Argentina_3,	22193)
+ValuePair(PCS_C_Inchauspe_Argentina_4,	22194)
+ValuePair(PCS_C_Inchauspe_Argentina_5,	22195)
+ValuePair(PCS_C_Inchauspe_Argentina_6,	22196)
+ValuePair(PCS_C_Inchauspe_Argentina_7,	22197)
+ValuePair(PCS_Carthage_UTM_zone_32N,	22332)
+ValuePair(PCS_Carthage_Nord_Tunisie,	22391)
+ValuePair(PCS_Carthage_Sud_Tunisie,	22392)
+ValuePair(PCS_Corrego_Alegre_UTM_23S,	22523)
+ValuePair(PCS_Corrego_Alegre_UTM_24S,	22524)
+ValuePair(PCS_Douala_UTM_zone_32N,	22832)
+ValuePair(PCS_Egypt_1907_Red_Belt,	22992)
+ValuePair(PCS_Egypt_1907_Purple_Belt,	22993)
+ValuePair(PCS_Egypt_1907_Ext_Purple,	22994)
+ValuePair(PCS_ED50_UTM_zone_28N,	23028)
+ValuePair(PCS_ED50_UTM_zone_29N,	23029)
+ValuePair(PCS_ED50_UTM_zone_30N,	23030)
+ValuePair(PCS_ED50_UTM_zone_31N,	23031)
+ValuePair(PCS_ED50_UTM_zone_32N,	23032)
+ValuePair(PCS_ED50_UTM_zone_33N,	23033)
+ValuePair(PCS_ED50_UTM_zone_34N,	23034)
+ValuePair(PCS_ED50_UTM_zone_35N,	23035)
+ValuePair(PCS_ED50_UTM_zone_36N,	23036)
+ValuePair(PCS_ED50_UTM_zone_37N,	23037)
+ValuePair(PCS_ED50_UTM_zone_38N,	23038)
+ValuePair(PCS_Fahud_UTM_zone_39N,	23239)
+ValuePair(PCS_Fahud_UTM_zone_40N,	23240)
+ValuePair(PCS_Garoua_UTM_zone_33N,	23433)
+ValuePair(PCS_ID74_UTM_zone_46N,	23846)
+ValuePair(PCS_ID74_UTM_zone_47N,	23847)
+ValuePair(PCS_ID74_UTM_zone_48N,	23848)
+ValuePair(PCS_ID74_UTM_zone_49N,	23849)
+ValuePair(PCS_ID74_UTM_zone_50N,	23850)
+ValuePair(PCS_ID74_UTM_zone_51N,	23851)
+ValuePair(PCS_ID74_UTM_zone_52N,	23852)
+ValuePair(PCS_ID74_UTM_zone_53N,	23853)
+ValuePair(PCS_ID74_UTM_zone_46S,	23886)
+ValuePair(PCS_ID74_UTM_zone_47S,	23887)
+ValuePair(PCS_ID74_UTM_zone_48S,	23888)
+ValuePair(PCS_ID74_UTM_zone_49S,	23889)
+ValuePair(PCS_ID74_UTM_zone_50S,	23890)
+ValuePair(PCS_ID74_UTM_zone_51S,	23891)
+ValuePair(PCS_ID74_UTM_zone_52S,	23892)
+ValuePair(PCS_ID74_UTM_zone_53S,	23893)
+ValuePair(PCS_ID74_UTM_zone_54S,	23894)
+ValuePair(PCS_Indian_1954_UTM_47N,	23947)
+ValuePair(PCS_Indian_1954_UTM_48N,	23948)
+ValuePair(PCS_Indian_1975_UTM_47N,	24047)
+ValuePair(PCS_Indian_1975_UTM_48N,	24048)
+ValuePair(PCS_Jamaica_1875_Old_Grid,	24100)
+ValuePair(PCS_JAD69_Jamaica_Grid,	24200)
+ValuePair(PCS_Kalianpur_India_0,	24370)
+ValuePair(PCS_Kalianpur_India_I,	24371)
+ValuePair(PCS_Kalianpur_India_IIa,	24372)
+ValuePair(PCS_Kalianpur_India_IIIa,	24373)
+ValuePair(PCS_Kalianpur_India_IVa,	24374)
+ValuePair(PCS_Kalianpur_India_IIb,	24382)
+ValuePair(PCS_Kalianpur_India_IIIb,	24383)
+ValuePair(PCS_Kalianpur_India_IVb,	24384)
+ValuePair(PCS_Kertau_Singapore_Grid,	24500)
+ValuePair(PCS_Kertau_UTM_zone_47N,	24547)
+ValuePair(PCS_Kertau_UTM_zone_48N,	24548)
+ValuePair(PCS_La_Canoa_UTM_zone_20N,	24720)
+ValuePair(PCS_La_Canoa_UTM_zone_21N,	24721)
+ValuePair(PCS_PSAD56_UTM_zone_18N,	24818)
+ValuePair(PCS_PSAD56_UTM_zone_19N,	24819)
+ValuePair(PCS_PSAD56_UTM_zone_20N,	24820)
+ValuePair(PCS_PSAD56_UTM_zone_21N,	24821)
+ValuePair(PCS_PSAD56_UTM_zone_17S,	24877)
+ValuePair(PCS_PSAD56_UTM_zone_18S,	24878)
+ValuePair(PCS_PSAD56_UTM_zone_19S,	24879)
+ValuePair(PCS_PSAD56_UTM_zone_20S,	24880)
+ValuePair(PCS_PSAD56_Peru_west_zone,	24891)
+ValuePair(PCS_PSAD56_Peru_central,	24892)
+ValuePair(PCS_PSAD56_Peru_east_zone,	24893)
+ValuePair(PCS_Leigon_Ghana_Grid,	25000)
+ValuePair(PCS_Lome_UTM_zone_31N,	25231)
+ValuePair(PCS_Luzon_Philippines_I,	25391)
+ValuePair(PCS_Luzon_Philippines_II,	25392)
+ValuePair(PCS_Luzon_Philippines_III,	25393)
+ValuePair(PCS_Luzon_Philippines_IV,	25394)
+ValuePair(PCS_Luzon_Philippines_V,	25395)
+ValuePair(PCS_Makassar_NEIEZ,	25700)
+ValuePair(PCS_Malongo_1987_UTM_32S,	25932)
+ValuePair(PCS_Merchich_Nord_Maroc,	26191)
+ValuePair(PCS_Merchich_Sud_Maroc,	26192)
+ValuePair(PCS_Merchich_Sahara,	26193)
+ValuePair(PCS_Massawa_UTM_zone_37N,	26237)
+ValuePair(PCS_Minna_UTM_zone_31N,	26331)
+ValuePair(PCS_Minna_UTM_zone_32N,	26332)
+ValuePair(PCS_Minna_Nigeria_West,	26391)
+ValuePair(PCS_Minna_Nigeria_Mid_Belt,	26392)
+ValuePair(PCS_Minna_Nigeria_East,	26393)
+ValuePair(PCS_Mhast_UTM_zone_32S,	26432)
+ValuePair(PCS_Monte_Mario_Italy_1,	26591)
+ValuePair(PCS_Monte_Mario_Italy_2,	26592)
+ValuePair(PCS_M_poraloko_UTM_32N,	26632)
+ValuePair(PCS_M_poraloko_UTM_32S,	26692)
+ValuePair(PCS_NAD27_UTM_zone_3N,	26703)
+ValuePair(PCS_NAD27_UTM_zone_4N,	26704)
+ValuePair(PCS_NAD27_UTM_zone_5N,	26705)
+ValuePair(PCS_NAD27_UTM_zone_6N,	26706)
+ValuePair(PCS_NAD27_UTM_zone_7N,	26707)
+ValuePair(PCS_NAD27_UTM_zone_8N,	26708)
+ValuePair(PCS_NAD27_UTM_zone_9N,	26709)
+ValuePair(PCS_NAD27_UTM_zone_10N,	26710)
+ValuePair(PCS_NAD27_UTM_zone_11N,	26711)
+ValuePair(PCS_NAD27_UTM_zone_12N,	26712)
+ValuePair(PCS_NAD27_UTM_zone_13N,	26713)
+ValuePair(PCS_NAD27_UTM_zone_14N,	26714)
+ValuePair(PCS_NAD27_UTM_zone_15N,	26715)
+ValuePair(PCS_NAD27_UTM_zone_16N,	26716)
+ValuePair(PCS_NAD27_UTM_zone_17N,	26717)
+ValuePair(PCS_NAD27_UTM_zone_18N,	26718)
+ValuePair(PCS_NAD27_UTM_zone_19N,	26719)
+ValuePair(PCS_NAD27_UTM_zone_20N,	26720)
+ValuePair(PCS_NAD27_UTM_zone_21N,	26721)
+ValuePair(PCS_NAD27_UTM_zone_22N,	26722)
+ValuePair(PCS_NAD27_Alabama_East,	26729)
+ValuePair(PCS_NAD27_Alabama_West,	26730)
+ValuePair(PCS_NAD27_Alaska_zone_1,	26731)
+ValuePair(PCS_NAD27_Alaska_zone_2,	26732)
+ValuePair(PCS_NAD27_Alaska_zone_3,	26733)
+ValuePair(PCS_NAD27_Alaska_zone_4,	26734)
+ValuePair(PCS_NAD27_Alaska_zone_5,	26735)
+ValuePair(PCS_NAD27_Alaska_zone_6,	26736)
+ValuePair(PCS_NAD27_Alaska_zone_7,	26737)
+ValuePair(PCS_NAD27_Alaska_zone_8,	26738)
+ValuePair(PCS_NAD27_Alaska_zone_9,	26739)
+ValuePair(PCS_NAD27_Alaska_zone_10,	26740)
+ValuePair(PCS_NAD27_California_I,	26741)
+ValuePair(PCS_NAD27_California_II,	26742)
+ValuePair(PCS_NAD27_California_III,	26743)
+ValuePair(PCS_NAD27_California_IV,	26744)
+ValuePair(PCS_NAD27_California_V,	26745)
+ValuePair(PCS_NAD27_California_VI,	26746)
+ValuePair(PCS_NAD27_California_VII,	26747)
+ValuePair(PCS_NAD27_Arizona_East,	26748)
+ValuePair(PCS_NAD27_Arizona_Central,	26749)
+ValuePair(PCS_NAD27_Arizona_West,	26750)
+ValuePair(PCS_NAD27_Arkansas_North,	26751)
+ValuePair(PCS_NAD27_Arkansas_South,	26752)
+ValuePair(PCS_NAD27_Colorado_North,	26753)
+ValuePair(PCS_NAD27_Colorado_Central,	26754)
+ValuePair(PCS_NAD27_Colorado_South,	26755)
+ValuePair(PCS_NAD27_Connecticut,	26756)
+ValuePair(PCS_NAD27_Delaware,	26757)
+ValuePair(PCS_NAD27_Florida_East,	26758)
+ValuePair(PCS_NAD27_Florida_West,	26759)
+ValuePair(PCS_NAD27_Florida_North,	26760)
+ValuePair(PCS_NAD27_Hawaii_zone_1,	26761)
+ValuePair(PCS_NAD27_Hawaii_zone_2,	26762)
+ValuePair(PCS_NAD27_Hawaii_zone_3,	26763)
+ValuePair(PCS_NAD27_Hawaii_zone_4,	26764)
+ValuePair(PCS_NAD27_Hawaii_zone_5,	26765)
+ValuePair(PCS_NAD27_Georgia_East,	26766)
+ValuePair(PCS_NAD27_Georgia_West,	26767)
+ValuePair(PCS_NAD27_Idaho_East,	26768)
+ValuePair(PCS_NAD27_Idaho_Central,	26769)
+ValuePair(PCS_NAD27_Idaho_West,	26770)
+ValuePair(PCS_NAD27_Illinois_East,	26771)
+ValuePair(PCS_NAD27_Illinois_West,	26772)
+ValuePair(PCS_NAD27_Indiana_East,	26773)
+ValuePair(PCS_NAD27_BLM_14N_feet,	26774)
+ValuePair(PCS_NAD27_Indiana_West,	26774)
+ValuePair(PCS_NAD27_BLM_15N_feet,	26775)
+ValuePair(PCS_NAD27_Iowa_North,	26775)
+ValuePair(PCS_NAD27_BLM_16N_feet,	26776)
+ValuePair(PCS_NAD27_Iowa_South,	26776)
+ValuePair(PCS_NAD27_BLM_17N_feet,	26777)
+ValuePair(PCS_NAD27_Kansas_North,	26777)
+ValuePair(PCS_NAD27_Kansas_South,	26778)
+ValuePair(PCS_NAD27_Kentucky_North,	26779)
+ValuePair(PCS_NAD27_Kentucky_South,	26780)
+ValuePair(PCS_NAD27_Louisiana_North,	26781)
+ValuePair(PCS_NAD27_Louisiana_South,	26782)
+ValuePair(PCS_NAD27_Maine_East,	26783)
+ValuePair(PCS_NAD27_Maine_West,	26784)
+ValuePair(PCS_NAD27_Maryland,	26785)
+ValuePair(PCS_NAD27_Massachusetts,	26786)
+ValuePair(PCS_NAD27_Massachusetts_Is,	26787)
+ValuePair(PCS_NAD27_Michigan_North,	26788)
+ValuePair(PCS_NAD27_Michigan_Central,	26789)
+ValuePair(PCS_NAD27_Michigan_South,	26790)
+ValuePair(PCS_NAD27_Minnesota_North,	26791)
+ValuePair(PCS_NAD27_Minnesota_Cent,	26792)
+ValuePair(PCS_NAD27_Minnesota_South,	26793)
+ValuePair(PCS_NAD27_Mississippi_East,	26794)
+ValuePair(PCS_NAD27_Mississippi_West,	26795)
+ValuePair(PCS_NAD27_Missouri_East,	26796)
+ValuePair(PCS_NAD27_Missouri_Central,	26797)
+ValuePair(PCS_NAD27_Missouri_West,	26798)
+ValuePair(PCS_NAD_Michigan_Michigan_East,	26801)
+ValuePair(PCS_NAD_Michigan_Michigan_Old_Central,	26802)
+ValuePair(PCS_NAD_Michigan_Michigan_West,	26803)
+ValuePair(PCS_NAD83_UTM_zone_3N,	26903)
+ValuePair(PCS_NAD83_UTM_zone_4N,	26904)
+ValuePair(PCS_NAD83_UTM_zone_5N,	26905)
+ValuePair(PCS_NAD83_UTM_zone_6N,	26906)
+ValuePair(PCS_NAD83_UTM_zone_7N,	26907)
+ValuePair(PCS_NAD83_UTM_zone_8N,	26908)
+ValuePair(PCS_NAD83_UTM_zone_9N,	26909)
+ValuePair(PCS_NAD83_UTM_zone_10N,	26910)
+ValuePair(PCS_NAD83_UTM_zone_11N,	26911)
+ValuePair(PCS_NAD83_UTM_zone_12N,	26912)
+ValuePair(PCS_NAD83_UTM_zone_13N,	26913)
+ValuePair(PCS_NAD83_UTM_zone_14N,	26914)
+ValuePair(PCS_NAD83_UTM_zone_15N,	26915)
+ValuePair(PCS_NAD83_UTM_zone_16N,	26916)
+ValuePair(PCS_NAD83_UTM_zone_17N,	26917)
+ValuePair(PCS_NAD83_UTM_zone_18N,	26918)
+ValuePair(PCS_NAD83_UTM_zone_19N,	26919)
+ValuePair(PCS_NAD83_UTM_zone_20N,	26920)
+ValuePair(PCS_NAD83_UTM_zone_21N,	26921)
+ValuePair(PCS_NAD83_UTM_zone_22N,	26922)
+ValuePair(PCS_NAD83_UTM_zone_23N,	26923)
+ValuePair(PCS_NAD83_Alabama_East,	26929)
+ValuePair(PCS_NAD83_Alabama_West,	26930)
+ValuePair(PCS_NAD83_Alaska_zone_1,	26931)
+ValuePair(PCS_NAD83_Alaska_zone_2,	26932)
+ValuePair(PCS_NAD83_Alaska_zone_3,	26933)
+ValuePair(PCS_NAD83_Alaska_zone_4,	26934)
+ValuePair(PCS_NAD83_Alaska_zone_5,	26935)
+ValuePair(PCS_NAD83_Alaska_zone_6,	26936)
+ValuePair(PCS_NAD83_Alaska_zone_7,	26937)
+ValuePair(PCS_NAD83_Alaska_zone_8,	26938)
+ValuePair(PCS_NAD83_Alaska_zone_9,	26939)
+ValuePair(PCS_NAD83_Alaska_zone_10,	26940)
+ValuePair(PCS_NAD83_California_1,	26941)
+ValuePair(PCS_NAD83_California_2,	26942)
+ValuePair(PCS_NAD83_California_3,	26943)
+ValuePair(PCS_NAD83_California_4,	26944)
+ValuePair(PCS_NAD83_California_5,	26945)
+ValuePair(PCS_NAD83_California_6,	26946)
+ValuePair(PCS_NAD83_Arizona_East,	26948)
+ValuePair(PCS_NAD83_Arizona_Central,	26949)
+ValuePair(PCS_NAD83_Arizona_West,	26950)
+ValuePair(PCS_NAD83_Arkansas_North,	26951)
+ValuePair(PCS_NAD83_Arkansas_South,	26952)
+ValuePair(PCS_NAD83_Colorado_North,	26953)
+ValuePair(PCS_NAD83_Colorado_Central,	26954)
+ValuePair(PCS_NAD83_Colorado_South,	26955)
+ValuePair(PCS_NAD83_Connecticut,	26956)
+ValuePair(PCS_NAD83_Delaware,	26957)
+ValuePair(PCS_NAD83_Florida_East,	26958)
+ValuePair(PCS_NAD83_Florida_West,	26959)
+ValuePair(PCS_NAD83_Florida_North,	26960)
+ValuePair(PCS_NAD83_Hawaii_zone_1,	26961)
+ValuePair(PCS_NAD83_Hawaii_zone_2,	26962)
+ValuePair(PCS_NAD83_Hawaii_zone_3,	26963)
+ValuePair(PCS_NAD83_Hawaii_zone_4,	26964)
+ValuePair(PCS_NAD83_Hawaii_zone_5,	26965)
+ValuePair(PCS_NAD83_Georgia_East,	26966)
+ValuePair(PCS_NAD83_Georgia_West,	26967)
+ValuePair(PCS_NAD83_Idaho_East,	26968)
+ValuePair(PCS_NAD83_Idaho_Central,	26969)
+ValuePair(PCS_NAD83_Idaho_West,	26970)
+ValuePair(PCS_NAD83_Illinois_East,	26971)
+ValuePair(PCS_NAD83_Illinois_West,	26972)
+ValuePair(PCS_NAD83_Indiana_East,	26973)
+ValuePair(PCS_NAD83_Indiana_West,	26974)
+ValuePair(PCS_NAD83_Iowa_North,	26975)
+ValuePair(PCS_NAD83_Iowa_South,	26976)
+ValuePair(PCS_NAD83_Kansas_North,	26977)
+ValuePair(PCS_NAD83_Kansas_South,	26978)
+ValuePair(PCS_NAD83_Kentucky_North,	2205)
+ValuePair(PCS_NAD83_Kentucky_South,	26980)
+ValuePair(PCS_NAD83_Louisiana_North,	26981)
+ValuePair(PCS_NAD83_Louisiana_South,	26982)
+ValuePair(PCS_NAD83_Maine_East,	26983)
+ValuePair(PCS_NAD83_Maine_West,	26984)
+ValuePair(PCS_NAD83_Maryland,	26985)
+ValuePair(PCS_NAD83_Massachusetts,	26986)
+ValuePair(PCS_NAD83_Massachusetts_Is,	26987)
+ValuePair(PCS_NAD83_Michigan_North,	26988)
+ValuePair(PCS_NAD83_Michigan_Central,	26989)
+ValuePair(PCS_NAD83_Michigan_South,	26990)
+ValuePair(PCS_NAD83_Minnesota_North,	26991)
+ValuePair(PCS_NAD83_Minnesota_Cent,	26992)
+ValuePair(PCS_NAD83_Minnesota_South,	26993)
+ValuePair(PCS_NAD83_Mississippi_East,	26994)
+ValuePair(PCS_NAD83_Mississippi_West,	26995)
+ValuePair(PCS_NAD83_Missouri_East,	26996)
+ValuePair(PCS_NAD83_Missouri_Central,	26997)
+ValuePair(PCS_NAD83_Missouri_West,	26998)
+ValuePair(PCS_Nahrwan_1967_UTM_38N,	27038)
+ValuePair(PCS_Nahrwan_1967_UTM_39N,	27039)
+ValuePair(PCS_Nahrwan_1967_UTM_40N,	27040)
+ValuePair(PCS_Naparima_UTM_20N,	27120)
+ValuePair(PCS_GD49_NZ_Map_Grid,	27200)
+ValuePair(PCS_GD49_North_Island_Grid,	27291)
+ValuePair(PCS_GD49_South_Island_Grid,	27292)
+ValuePair(PCS_Datum_73_UTM_zone_29N,	27429)
+ValuePair(PCS_ATF_Nord_de_Guerre,	27500)
+ValuePair(PCS_NTF_France_I,	27581)
+ValuePair(PCS_NTF_France_II,	27582)
+ValuePair(PCS_NTF_France_III,	27583)
+ValuePair(PCS_NTF_Nord_France,	27591)
+ValuePair(PCS_NTF_Centre_France,	27592)
+ValuePair(PCS_NTF_Sud_France,	27593)
+ValuePair(PCS_British_National_Grid,	27700)
+ValuePair(PCS_Point_Noire_UTM_32S,	28232)
+ValuePair(PCS_GDA94_MGA_zone_48,	28348)
+ValuePair(PCS_GDA94_MGA_zone_49,	28349)
+ValuePair(PCS_GDA94_MGA_zone_50,	28350)
+ValuePair(PCS_GDA94_MGA_zone_51,	28351)
+ValuePair(PCS_GDA94_MGA_zone_52,	28352)
+ValuePair(PCS_GDA94_MGA_zone_53,	28353)
+ValuePair(PCS_GDA94_MGA_zone_54,	28354)
+ValuePair(PCS_GDA94_MGA_zone_55,	28355)
+ValuePair(PCS_GDA94_MGA_zone_56,	28356)
+ValuePair(PCS_GDA94_MGA_zone_57,	28357)
+ValuePair(PCS_GDA94_MGA_zone_58,	28358)
+ValuePair(PCS_Pulkovo_Gauss_zone_4,	28404)
+ValuePair(PCS_Pulkovo_Gauss_zone_5,	28405)
+ValuePair(PCS_Pulkovo_Gauss_zone_6,	28406)
+ValuePair(PCS_Pulkovo_Gauss_zone_7,	28407)
+ValuePair(PCS_Pulkovo_Gauss_zone_8,	28408)
+ValuePair(PCS_Pulkovo_Gauss_zone_9,	28409)
+ValuePair(PCS_Pulkovo_Gauss_zone_10,	28410)
+ValuePair(PCS_Pulkovo_Gauss_zone_11,	28411)
+ValuePair(PCS_Pulkovo_Gauss_zone_12,	28412)
+ValuePair(PCS_Pulkovo_Gauss_zone_13,	28413)
+ValuePair(PCS_Pulkovo_Gauss_zone_14,	28414)
+ValuePair(PCS_Pulkovo_Gauss_zone_15,	28415)
+ValuePair(PCS_Pulkovo_Gauss_zone_16,	28416)
+ValuePair(PCS_Pulkovo_Gauss_zone_17,	28417)
+ValuePair(PCS_Pulkovo_Gauss_zone_18,	28418)
+ValuePair(PCS_Pulkovo_Gauss_zone_19,	28419)
+ValuePair(PCS_Pulkovo_Gauss_zone_20,	28420)
+ValuePair(PCS_Pulkovo_Gauss_zone_21,	28421)
+ValuePair(PCS_Pulkovo_Gauss_zone_22,	28422)
+ValuePair(PCS_Pulkovo_Gauss_zone_23,	28423)
+ValuePair(PCS_Pulkovo_Gauss_zone_24,	28424)
+ValuePair(PCS_Pulkovo_Gauss_zone_25,	28425)
+ValuePair(PCS_Pulkovo_Gauss_zone_26,	28426)
+ValuePair(PCS_Pulkovo_Gauss_zone_27,	28427)
+ValuePair(PCS_Pulkovo_Gauss_zone_28,	28428)
+ValuePair(PCS_Pulkovo_Gauss_zone_29,	28429)
+ValuePair(PCS_Pulkovo_Gauss_zone_30,	28430)
+ValuePair(PCS_Pulkovo_Gauss_zone_31,	28431)
+ValuePair(PCS_Pulkovo_Gauss_zone_32,	28432)
+ValuePair(PCS_Pulkovo_Gauss_4N,	28464)
+ValuePair(PCS_Pulkovo_Gauss_5N,	28465)
+ValuePair(PCS_Pulkovo_Gauss_6N,	28466)
+ValuePair(PCS_Pulkovo_Gauss_7N,	28467)
+ValuePair(PCS_Pulkovo_Gauss_8N,	28468)
+ValuePair(PCS_Pulkovo_Gauss_9N,	28469)
+ValuePair(PCS_Pulkovo_Gauss_10N,	28470)
+ValuePair(PCS_Pulkovo_Gauss_11N,	28471)
+ValuePair(PCS_Pulkovo_Gauss_12N,	28472)
+ValuePair(PCS_Pulkovo_Gauss_13N,	28473)
+ValuePair(PCS_Pulkovo_Gauss_14N,	28474)
+ValuePair(PCS_Pulkovo_Gauss_15N,	28475)
+ValuePair(PCS_Pulkovo_Gauss_16N,	28476)
+ValuePair(PCS_Pulkovo_Gauss_17N,	28477)
+ValuePair(PCS_Pulkovo_Gauss_18N,	28478)
+ValuePair(PCS_Pulkovo_Gauss_19N,	28479)
+ValuePair(PCS_Pulkovo_Gauss_20N,	28480)
+ValuePair(PCS_Pulkovo_Gauss_21N,	28481)
+ValuePair(PCS_Pulkovo_Gauss_22N,	28482)
+ValuePair(PCS_Pulkovo_Gauss_23N,	28483)
+ValuePair(PCS_Pulkovo_Gauss_24N,	28484)
+ValuePair(PCS_Pulkovo_Gauss_25N,	28485)
+ValuePair(PCS_Pulkovo_Gauss_26N,	28486)
+ValuePair(PCS_Pulkovo_Gauss_27N,	28487)
+ValuePair(PCS_Pulkovo_Gauss_28N,	28488)
+ValuePair(PCS_Pulkovo_Gauss_29N,	28489)
+ValuePair(PCS_Pulkovo_Gauss_30N,	28490)
+ValuePair(PCS_Pulkovo_Gauss_31N,	28491)
+ValuePair(PCS_Pulkovo_Gauss_32N,	28492)
+ValuePair(PCS_Qatar_National_Grid,	28600)
+ValuePair(PCS_RD_Netherlands_Old,	28991)
+ValuePair(PCS_RD_Netherlands_New,	28992)
+ValuePair(PCS_SAD69_UTM_zone_18N,	29118)
+ValuePair(PCS_SAD69_UTM_zone_19N,	29119)
+ValuePair(PCS_SAD69_UTM_zone_20N,	29120)
+ValuePair(PCS_SAD69_UTM_zone_21N,	29121)
+ValuePair(PCS_SAD69_UTM_zone_22N,	29122)
+ValuePair(PCS_SAD69_UTM_zone_17S,	29177)
+ValuePair(PCS_SAD69_UTM_zone_18S,	29178)
+ValuePair(PCS_SAD69_UTM_zone_19S,	29179)
+ValuePair(PCS_SAD69_UTM_zone_20S,	29180)
+ValuePair(PCS_SAD69_UTM_zone_21S,	29181)
+ValuePair(PCS_SAD69_UTM_zone_22S,	29182)
+ValuePair(PCS_SAD69_UTM_zone_23S,	29183)
+ValuePair(PCS_SAD69_UTM_zone_24S,	29184)
+ValuePair(PCS_SAD69_UTM_zone_25S,	29185)
+ValuePair(PCS_Sapper_Hill_UTM_20S,	29220)
+ValuePair(PCS_Sapper_Hill_UTM_21S,	29221)
+ValuePair(PCS_Schwarzeck_UTM_33S,	29333)
+ValuePair(PCS_Sudan_UTM_zone_35N,	29635)
+ValuePair(PCS_Sudan_UTM_zone_36N,	29636)
+ValuePair(PCS_Tananarive_Laborde,	29700)
+ValuePair(PCS_Tananarive_UTM_38S,	29738)
+ValuePair(PCS_Tananarive_UTM_39S,	29739)
+ValuePair(PCS_Timbalai_1948_Borneo,	29800)
+ValuePair(PCS_Timbalai_1948_UTM_49N,	29849)
+ValuePair(PCS_Timbalai_1948_UTM_50N,	29850)
+ValuePair(PCS_TM65_Irish_Nat_Grid,	29900)
+ValuePair(PCS_Trinidad_1903_Trinidad,	30200)
+ValuePair(PCS_TC_1948_UTM_zone_39N,	30339)
+ValuePair(PCS_TC_1948_UTM_zone_40N,	30340)
+ValuePair(PCS_Voirol_N_Algerie_ancien,	30491)
+ValuePair(PCS_Voirol_S_Algerie_ancien,	30492)
+ValuePair(PCS_Voirol_Unifie_N_Algerie,	30591)
+ValuePair(PCS_Voirol_Unifie_S_Algerie,	30592)
+ValuePair(PCS_Bern_1938_Swiss_New,	30600)
+ValuePair(PCS_Nord_Sahara_UTM_29N,	30729)
+ValuePair(PCS_Nord_Sahara_UTM_30N,	30730)
+ValuePair(PCS_Nord_Sahara_UTM_31N,	30731)
+ValuePair(PCS_Nord_Sahara_UTM_32N,	30732)
+ValuePair(PCS_Yoff_UTM_zone_28N,	31028)
+ValuePair(PCS_Zanderij_UTM_zone_21N,	31121)
+ValuePair(PCS_MGI_Austria_West,	31291)
+ValuePair(PCS_MGI_Austria_Central,	31292)
+ValuePair(PCS_MGI_Austria_East,	31293)
+ValuePair(PCS_Belge_Lambert_72,	31300)
+ValuePair(PCS_DHDN_Germany_zone_1,	31491)
+ValuePair(PCS_DHDN_Germany_zone_2,	31492)
+ValuePair(PCS_DHDN_Germany_zone_3,	31493)
+ValuePair(PCS_DHDN_Germany_zone_4,	31494)
+ValuePair(PCS_DHDN_Germany_zone_5,	31495)
+ValuePair(PCS_NAD27_Montana_North,	32001)
+ValuePair(PCS_NAD27_Montana_Central,	32002)
+ValuePair(PCS_NAD27_Montana_South,	32003)
+ValuePair(PCS_NAD27_Nebraska_North,	32005)
+ValuePair(PCS_NAD27_Nebraska_South,	32006)
+ValuePair(PCS_NAD27_Nevada_East,	32007)
+ValuePair(PCS_NAD27_Nevada_Central,	32008)
+ValuePair(PCS_NAD27_Nevada_West,	32009)
+ValuePair(PCS_NAD27_New_Hampshire,	32010)
+ValuePair(PCS_NAD27_New_Jersey,	32011)
+ValuePair(PCS_NAD27_New_Mexico_East,	32012)
+ValuePair(PCS_NAD27_New_Mexico_Cent,	32013)
+ValuePair(PCS_NAD27_New_Mexico_West,	32014)
+ValuePair(PCS_NAD27_New_York_East,	32015)
+ValuePair(PCS_NAD27_New_York_Central,	32016)
+ValuePair(PCS_NAD27_New_York_West,	32017)
+ValuePair(PCS_NAD27_New_York_Long_Is,	32018)
+ValuePair(PCS_NAD27_North_Carolina,	32019)
+ValuePair(PCS_NAD27_North_Dakota_N,	32020)
+ValuePair(PCS_NAD27_North_Dakota_S,	32021)
+ValuePair(PCS_NAD27_Ohio_North,	32022)
+ValuePair(PCS_NAD27_Ohio_South,	32023)
+ValuePair(PCS_NAD27_Oklahoma_North,	32024)
+ValuePair(PCS_NAD27_Oklahoma_South,	32025)
+ValuePair(PCS_NAD27_Oregon_North,	32026)
+ValuePair(PCS_NAD27_Oregon_South,	32027)
+ValuePair(PCS_NAD27_Pennsylvania_N,	32028)
+ValuePair(PCS_NAD27_Pennsylvania_S,	32029)
+ValuePair(PCS_NAD27_Rhode_Island,	32030)
+ValuePair(PCS_NAD27_South_Carolina_N,	32031)
+ValuePair(PCS_NAD27_South_Carolina_S,	32033)
+ValuePair(PCS_NAD27_South_Dakota_N,	32034)
+ValuePair(PCS_NAD27_South_Dakota_S,	32035)
+ValuePair(PCS_NAD27_Tennessee,		2204)
+ValuePair(PCS_NAD27_Texas_North,	32037)
+ValuePair(PCS_NAD27_Texas_North_Cen,	32038)
+ValuePair(PCS_NAD27_Texas_Central,	32039)
+ValuePair(PCS_NAD27_Texas_South_Cen,	32040)
+ValuePair(PCS_NAD27_Texas_South,	32041)
+ValuePair(PCS_NAD27_Utah_North,	32042)
+ValuePair(PCS_NAD27_Utah_Central,	32043)
+ValuePair(PCS_NAD27_Utah_South,	32044)
+ValuePair(PCS_NAD27_Vermont,	32045)
+ValuePair(PCS_NAD27_Virginia_North,	32046)
+ValuePair(PCS_NAD27_Virginia_South,	32047)
+ValuePair(PCS_NAD27_Washington_North,	32048)
+ValuePair(PCS_NAD27_Washington_South,	32049)
+ValuePair(PCS_NAD27_West_Virginia_N,	32050)
+ValuePair(PCS_NAD27_West_Virginia_S,	32051)
+ValuePair(PCS_NAD27_Wisconsin_North,	32052)
+ValuePair(PCS_NAD27_Wisconsin_Cen,	32053)
+ValuePair(PCS_NAD27_Wisconsin_South,	32054)
+ValuePair(PCS_NAD27_Wyoming_East,	32055)
+ValuePair(PCS_NAD27_Wyoming_E_Cen,	32056)
+ValuePair(PCS_NAD27_Wyoming_W_Cen,	32057)
+ValuePair(PCS_NAD27_Wyoming_West,	32058)
+ValuePair(PCS_NAD27_Puerto_Rico,	32059)
+ValuePair(PCS_NAD27_St_Croix,	32060)
+ValuePair(PCS_NAD83_Montana,	32100)
+ValuePair(PCS_NAD83_Nebraska,	32104)
+ValuePair(PCS_NAD83_Nevada_East,	32107)
+ValuePair(PCS_NAD83_Nevada_Central,	32108)
+ValuePair(PCS_NAD83_Nevada_West,	32109)
+ValuePair(PCS_NAD83_New_Hampshire,	32110)
+ValuePair(PCS_NAD83_New_Jersey,	32111)
+ValuePair(PCS_NAD83_New_Mexico_East,	32112)
+ValuePair(PCS_NAD83_New_Mexico_Cent,	32113)
+ValuePair(PCS_NAD83_New_Mexico_West,	32114)
+ValuePair(PCS_NAD83_New_York_East,	32115)
+ValuePair(PCS_NAD83_New_York_Central,	32116)
+ValuePair(PCS_NAD83_New_York_West,	32117)
+ValuePair(PCS_NAD83_New_York_Long_Is,	32118)
+ValuePair(PCS_NAD83_North_Carolina,	32119)
+ValuePair(PCS_NAD83_North_Dakota_N,	32120)
+ValuePair(PCS_NAD83_North_Dakota_S,	32121)
+ValuePair(PCS_NAD83_Ohio_North,	32122)
+ValuePair(PCS_NAD83_Ohio_South,	32123)
+ValuePair(PCS_NAD83_Oklahoma_North,	32124)
+ValuePair(PCS_NAD83_Oklahoma_South,	32125)
+ValuePair(PCS_NAD83_Oregon_North,	32126)
+ValuePair(PCS_NAD83_Oregon_South,	32127)
+ValuePair(PCS_NAD83_Pennsylvania_N,	32128)
+ValuePair(PCS_NAD83_Pennsylvania_S,	32129)
+ValuePair(PCS_NAD83_Rhode_Island,	32130)
+ValuePair(PCS_NAD83_South_Carolina,	32133)
+ValuePair(PCS_NAD83_South_Dakota_N,	32134)
+ValuePair(PCS_NAD83_South_Dakota_S,	32135)
+ValuePair(PCS_NAD83_Tennessee,	32136)
+ValuePair(PCS_NAD83_Texas_North,	32137)
+ValuePair(PCS_NAD83_Texas_North_Cen,	32138)
+ValuePair(PCS_NAD83_Texas_Central,	32139)
+ValuePair(PCS_NAD83_Texas_South_Cen,	32140)
+ValuePair(PCS_NAD83_Texas_South,	32141)
+ValuePair(PCS_NAD83_Utah_North,	32142)
+ValuePair(PCS_NAD83_Utah_Central,	32143)
+ValuePair(PCS_NAD83_Utah_South,	32144)
+ValuePair(PCS_NAD83_Vermont,	32145)
+ValuePair(PCS_NAD83_Virginia_North,	32146)
+ValuePair(PCS_NAD83_Virginia_South,	32147)
+ValuePair(PCS_NAD83_Washington_North,	32148)
+ValuePair(PCS_NAD83_Washington_South,	32149)
+ValuePair(PCS_NAD83_West_Virginia_N,	32150)
+ValuePair(PCS_NAD83_West_Virginia_S,	32151)
+ValuePair(PCS_NAD83_Wisconsin_North,	32152)
+ValuePair(PCS_NAD83_Wisconsin_Cen,	32153)
+ValuePair(PCS_NAD83_Wisconsin_South,	32154)
+ValuePair(PCS_NAD83_Wyoming_East,	32155)
+ValuePair(PCS_NAD83_Wyoming_E_Cen,	32156)
+ValuePair(PCS_NAD83_Wyoming_W_Cen,	32157)
+ValuePair(PCS_NAD83_Wyoming_West,	32158)
+ValuePair(PCS_NAD83_Puerto_Rico_Virgin_Is,	32161)
+ValuePair(PCS_WGS72_UTM_zone_1N,	32201)
+ValuePair(PCS_WGS72_UTM_zone_2N,	32202)
+ValuePair(PCS_WGS72_UTM_zone_3N,	32203)
+ValuePair(PCS_WGS72_UTM_zone_4N,	32204)
+ValuePair(PCS_WGS72_UTM_zone_5N,	32205)
+ValuePair(PCS_WGS72_UTM_zone_6N,	32206)
+ValuePair(PCS_WGS72_UTM_zone_7N,	32207)
+ValuePair(PCS_WGS72_UTM_zone_8N,	32208)
+ValuePair(PCS_WGS72_UTM_zone_9N,	32209)
+ValuePair(PCS_WGS72_UTM_zone_10N,	32210)
+ValuePair(PCS_WGS72_UTM_zone_11N,	32211)
+ValuePair(PCS_WGS72_UTM_zone_12N,	32212)
+ValuePair(PCS_WGS72_UTM_zone_13N,	32213)
+ValuePair(PCS_WGS72_UTM_zone_14N,	32214)
+ValuePair(PCS_WGS72_UTM_zone_15N,	32215)
+ValuePair(PCS_WGS72_UTM_zone_16N,	32216)
+ValuePair(PCS_WGS72_UTM_zone_17N,	32217)
+ValuePair(PCS_WGS72_UTM_zone_18N,	32218)
+ValuePair(PCS_WGS72_UTM_zone_19N,	32219)
+ValuePair(PCS_WGS72_UTM_zone_20N,	32220)
+ValuePair(PCS_WGS72_UTM_zone_21N,	32221)
+ValuePair(PCS_WGS72_UTM_zone_22N,	32222)
+ValuePair(PCS_WGS72_UTM_zone_23N,	32223)
+ValuePair(PCS_WGS72_UTM_zone_24N,	32224)
+ValuePair(PCS_WGS72_UTM_zone_25N,	32225)
+ValuePair(PCS_WGS72_UTM_zone_26N,	32226)
+ValuePair(PCS_WGS72_UTM_zone_27N,	32227)
+ValuePair(PCS_WGS72_UTM_zone_28N,	32228)
+ValuePair(PCS_WGS72_UTM_zone_29N,	32229)
+ValuePair(PCS_WGS72_UTM_zone_30N,	32230)
+ValuePair(PCS_WGS72_UTM_zone_31N,	32231)
+ValuePair(PCS_WGS72_UTM_zone_32N,	32232)
+ValuePair(PCS_WGS72_UTM_zone_33N,	32233)
+ValuePair(PCS_WGS72_UTM_zone_34N,	32234)
+ValuePair(PCS_WGS72_UTM_zone_35N,	32235)
+ValuePair(PCS_WGS72_UTM_zone_36N,	32236)
+ValuePair(PCS_WGS72_UTM_zone_37N,	32237)
+ValuePair(PCS_WGS72_UTM_zone_38N,	32238)
+ValuePair(PCS_WGS72_UTM_zone_39N,	32239)
+ValuePair(PCS_WGS72_UTM_zone_40N,	32240)
+ValuePair(PCS_WGS72_UTM_zone_41N,	32241)
+ValuePair(PCS_WGS72_UTM_zone_42N,	32242)
+ValuePair(PCS_WGS72_UTM_zone_43N,	32243)
+ValuePair(PCS_WGS72_UTM_zone_44N,	32244)
+ValuePair(PCS_WGS72_UTM_zone_45N,	32245)
+ValuePair(PCS_WGS72_UTM_zone_46N,	32246)
+ValuePair(PCS_WGS72_UTM_zone_47N,	32247)
+ValuePair(PCS_WGS72_UTM_zone_48N,	32248)
+ValuePair(PCS_WGS72_UTM_zone_49N,	32249)
+ValuePair(PCS_WGS72_UTM_zone_50N,	32250)
+ValuePair(PCS_WGS72_UTM_zone_51N,	32251)
+ValuePair(PCS_WGS72_UTM_zone_52N,	32252)
+ValuePair(PCS_WGS72_UTM_zone_53N,	32253)
+ValuePair(PCS_WGS72_UTM_zone_54N,	32254)
+ValuePair(PCS_WGS72_UTM_zone_55N,	32255)
+ValuePair(PCS_WGS72_UTM_zone_56N,	32256)
+ValuePair(PCS_WGS72_UTM_zone_57N,	32257)
+ValuePair(PCS_WGS72_UTM_zone_58N,	32258)
+ValuePair(PCS_WGS72_UTM_zone_59N,	32259)
+ValuePair(PCS_WGS72_UTM_zone_60N,	32260)
+ValuePair(PCS_WGS72_UTM_zone_1S,	32301)
+ValuePair(PCS_WGS72_UTM_zone_2S,	32302)
+ValuePair(PCS_WGS72_UTM_zone_3S,	32303)
+ValuePair(PCS_WGS72_UTM_zone_4S,	32304)
+ValuePair(PCS_WGS72_UTM_zone_5S,	32305)
+ValuePair(PCS_WGS72_UTM_zone_6S,	32306)
+ValuePair(PCS_WGS72_UTM_zone_7S,	32307)
+ValuePair(PCS_WGS72_UTM_zone_8S,	32308)
+ValuePair(PCS_WGS72_UTM_zone_9S,	32309)
+ValuePair(PCS_WGS72_UTM_zone_10S,	32310)
+ValuePair(PCS_WGS72_UTM_zone_11S,	32311)
+ValuePair(PCS_WGS72_UTM_zone_12S,	32312)
+ValuePair(PCS_WGS72_UTM_zone_13S,	32313)
+ValuePair(PCS_WGS72_UTM_zone_14S,	32314)
+ValuePair(PCS_WGS72_UTM_zone_15S,	32315)
+ValuePair(PCS_WGS72_UTM_zone_16S,	32316)
+ValuePair(PCS_WGS72_UTM_zone_17S,	32317)
+ValuePair(PCS_WGS72_UTM_zone_18S,	32318)
+ValuePair(PCS_WGS72_UTM_zone_19S,	32319)
+ValuePair(PCS_WGS72_UTM_zone_20S,	32320)
+ValuePair(PCS_WGS72_UTM_zone_21S,	32321)
+ValuePair(PCS_WGS72_UTM_zone_22S,	32322)
+ValuePair(PCS_WGS72_UTM_zone_23S,	32323)
+ValuePair(PCS_WGS72_UTM_zone_24S,	32324)
+ValuePair(PCS_WGS72_UTM_zone_25S,	32325)
+ValuePair(PCS_WGS72_UTM_zone_26S,	32326)
+ValuePair(PCS_WGS72_UTM_zone_27S,	32327)
+ValuePair(PCS_WGS72_UTM_zone_28S,	32328)
+ValuePair(PCS_WGS72_UTM_zone_29S,	32329)
+ValuePair(PCS_WGS72_UTM_zone_30S,	32330)
+ValuePair(PCS_WGS72_UTM_zone_31S,	32331)
+ValuePair(PCS_WGS72_UTM_zone_32S,	32332)
+ValuePair(PCS_WGS72_UTM_zone_33S,	32333)
+ValuePair(PCS_WGS72_UTM_zone_34S,	32334)
+ValuePair(PCS_WGS72_UTM_zone_35S,	32335)
+ValuePair(PCS_WGS72_UTM_zone_36S,	32336)
+ValuePair(PCS_WGS72_UTM_zone_37S,	32337)
+ValuePair(PCS_WGS72_UTM_zone_38S,	32338)
+ValuePair(PCS_WGS72_UTM_zone_39S,	32339)
+ValuePair(PCS_WGS72_UTM_zone_40S,	32340)
+ValuePair(PCS_WGS72_UTM_zone_41S,	32341)
+ValuePair(PCS_WGS72_UTM_zone_42S,	32342)
+ValuePair(PCS_WGS72_UTM_zone_43S,	32343)
+ValuePair(PCS_WGS72_UTM_zone_44S,	32344)
+ValuePair(PCS_WGS72_UTM_zone_45S,	32345)
+ValuePair(PCS_WGS72_UTM_zone_46S,	32346)
+ValuePair(PCS_WGS72_UTM_zone_47S,	32347)
+ValuePair(PCS_WGS72_UTM_zone_48S,	32348)
+ValuePair(PCS_WGS72_UTM_zone_49S,	32349)
+ValuePair(PCS_WGS72_UTM_zone_50S,	32350)
+ValuePair(PCS_WGS72_UTM_zone_51S,	32351)
+ValuePair(PCS_WGS72_UTM_zone_52S,	32352)
+ValuePair(PCS_WGS72_UTM_zone_53S,	32353)
+ValuePair(PCS_WGS72_UTM_zone_54S,	32354)
+ValuePair(PCS_WGS72_UTM_zone_55S,	32355)
+ValuePair(PCS_WGS72_UTM_zone_56S,	32356)
+ValuePair(PCS_WGS72_UTM_zone_57S,	32357)
+ValuePair(PCS_WGS72_UTM_zone_58S,	32358)
+ValuePair(PCS_WGS72_UTM_zone_59S,	32359)
+ValuePair(PCS_WGS72_UTM_zone_60S,	32360)
+ValuePair(PCS_WGS72BE_UTM_zone_1N,	32401)
+ValuePair(PCS_WGS72BE_UTM_zone_2N,	32402)
+ValuePair(PCS_WGS72BE_UTM_zone_3N,	32403)
+ValuePair(PCS_WGS72BE_UTM_zone_4N,	32404)
+ValuePair(PCS_WGS72BE_UTM_zone_5N,	32405)
+ValuePair(PCS_WGS72BE_UTM_zone_6N,	32406)
+ValuePair(PCS_WGS72BE_UTM_zone_7N,	32407)
+ValuePair(PCS_WGS72BE_UTM_zone_8N,	32408)
+ValuePair(PCS_WGS72BE_UTM_zone_9N,	32409)
+ValuePair(PCS_WGS72BE_UTM_zone_10N,	32410)
+ValuePair(PCS_WGS72BE_UTM_zone_11N,	32411)
+ValuePair(PCS_WGS72BE_UTM_zone_12N,	32412)
+ValuePair(PCS_WGS72BE_UTM_zone_13N,	32413)
+ValuePair(PCS_WGS72BE_UTM_zone_14N,	32414)
+ValuePair(PCS_WGS72BE_UTM_zone_15N,	32415)
+ValuePair(PCS_WGS72BE_UTM_zone_16N,	32416)
+ValuePair(PCS_WGS72BE_UTM_zone_17N,	32417)
+ValuePair(PCS_WGS72BE_UTM_zone_18N,	32418)
+ValuePair(PCS_WGS72BE_UTM_zone_19N,	32419)
+ValuePair(PCS_WGS72BE_UTM_zone_20N,	32420)
+ValuePair(PCS_WGS72BE_UTM_zone_21N,	32421)
+ValuePair(PCS_WGS72BE_UTM_zone_22N,	32422)
+ValuePair(PCS_WGS72BE_UTM_zone_23N,	32423)
+ValuePair(PCS_WGS72BE_UTM_zone_24N,	32424)
+ValuePair(PCS_WGS72BE_UTM_zone_25N,	32425)
+ValuePair(PCS_WGS72BE_UTM_zone_26N,	32426)
+ValuePair(PCS_WGS72BE_UTM_zone_27N,	32427)
+ValuePair(PCS_WGS72BE_UTM_zone_28N,	32428)
+ValuePair(PCS_WGS72BE_UTM_zone_29N,	32429)
+ValuePair(PCS_WGS72BE_UTM_zone_30N,	32430)
+ValuePair(PCS_WGS72BE_UTM_zone_31N,	32431)
+ValuePair(PCS_WGS72BE_UTM_zone_32N,	32432)
+ValuePair(PCS_WGS72BE_UTM_zone_33N,	32433)
+ValuePair(PCS_WGS72BE_UTM_zone_34N,	32434)
+ValuePair(PCS_WGS72BE_UTM_zone_35N,	32435)
+ValuePair(PCS_WGS72BE_UTM_zone_36N,	32436)
+ValuePair(PCS_WGS72BE_UTM_zone_37N,	32437)
+ValuePair(PCS_WGS72BE_UTM_zone_38N,	32438)
+ValuePair(PCS_WGS72BE_UTM_zone_39N,	32439)
+ValuePair(PCS_WGS72BE_UTM_zone_40N,	32440)
+ValuePair(PCS_WGS72BE_UTM_zone_41N,	32441)
+ValuePair(PCS_WGS72BE_UTM_zone_42N,	32442)
+ValuePair(PCS_WGS72BE_UTM_zone_43N,	32443)
+ValuePair(PCS_WGS72BE_UTM_zone_44N,	32444)
+ValuePair(PCS_WGS72BE_UTM_zone_45N,	32445)
+ValuePair(PCS_WGS72BE_UTM_zone_46N,	32446)
+ValuePair(PCS_WGS72BE_UTM_zone_47N,	32447)
+ValuePair(PCS_WGS72BE_UTM_zone_48N,	32448)
+ValuePair(PCS_WGS72BE_UTM_zone_49N,	32449)
+ValuePair(PCS_WGS72BE_UTM_zone_50N,	32450)
+ValuePair(PCS_WGS72BE_UTM_zone_51N,	32451)
+ValuePair(PCS_WGS72BE_UTM_zone_52N,	32452)
+ValuePair(PCS_WGS72BE_UTM_zone_53N,	32453)
+ValuePair(PCS_WGS72BE_UTM_zone_54N,	32454)
+ValuePair(PCS_WGS72BE_UTM_zone_55N,	32455)
+ValuePair(PCS_WGS72BE_UTM_zone_56N,	32456)
+ValuePair(PCS_WGS72BE_UTM_zone_57N,	32457)
+ValuePair(PCS_WGS72BE_UTM_zone_58N,	32458)
+ValuePair(PCS_WGS72BE_UTM_zone_59N,	32459)
+ValuePair(PCS_WGS72BE_UTM_zone_60N,	32460)
+ValuePair(PCS_WGS72BE_UTM_zone_1S,	32501)
+ValuePair(PCS_WGS72BE_UTM_zone_2S,	32502)
+ValuePair(PCS_WGS72BE_UTM_zone_3S,	32503)
+ValuePair(PCS_WGS72BE_UTM_zone_4S,	32504)
+ValuePair(PCS_WGS72BE_UTM_zone_5S,	32505)
+ValuePair(PCS_WGS72BE_UTM_zone_6S,	32506)
+ValuePair(PCS_WGS72BE_UTM_zone_7S,	32507)
+ValuePair(PCS_WGS72BE_UTM_zone_8S,	32508)
+ValuePair(PCS_WGS72BE_UTM_zone_9S,	32509)
+ValuePair(PCS_WGS72BE_UTM_zone_10S,	32510)
+ValuePair(PCS_WGS72BE_UTM_zone_11S,	32511)
+ValuePair(PCS_WGS72BE_UTM_zone_12S,	32512)
+ValuePair(PCS_WGS72BE_UTM_zone_13S,	32513)
+ValuePair(PCS_WGS72BE_UTM_zone_14S,	32514)
+ValuePair(PCS_WGS72BE_UTM_zone_15S,	32515)
+ValuePair(PCS_WGS72BE_UTM_zone_16S,	32516)
+ValuePair(PCS_WGS72BE_UTM_zone_17S,	32517)
+ValuePair(PCS_WGS72BE_UTM_zone_18S,	32518)
+ValuePair(PCS_WGS72BE_UTM_zone_19S,	32519)
+ValuePair(PCS_WGS72BE_UTM_zone_20S,	32520)
+ValuePair(PCS_WGS72BE_UTM_zone_21S,	32521)
+ValuePair(PCS_WGS72BE_UTM_zone_22S,	32522)
+ValuePair(PCS_WGS72BE_UTM_zone_23S,	32523)
+ValuePair(PCS_WGS72BE_UTM_zone_24S,	32524)
+ValuePair(PCS_WGS72BE_UTM_zone_25S,	32525)
+ValuePair(PCS_WGS72BE_UTM_zone_26S,	32526)
+ValuePair(PCS_WGS72BE_UTM_zone_27S,	32527)
+ValuePair(PCS_WGS72BE_UTM_zone_28S,	32528)
+ValuePair(PCS_WGS72BE_UTM_zone_29S,	32529)
+ValuePair(PCS_WGS72BE_UTM_zone_30S,	32530)
+ValuePair(PCS_WGS72BE_UTM_zone_31S,	32531)
+ValuePair(PCS_WGS72BE_UTM_zone_32S,	32532)
+ValuePair(PCS_WGS72BE_UTM_zone_33S,	32533)
+ValuePair(PCS_WGS72BE_UTM_zone_34S,	32534)
+ValuePair(PCS_WGS72BE_UTM_zone_35S,	32535)
+ValuePair(PCS_WGS72BE_UTM_zone_36S,	32536)
+ValuePair(PCS_WGS72BE_UTM_zone_37S,	32537)
+ValuePair(PCS_WGS72BE_UTM_zone_38S,	32538)
+ValuePair(PCS_WGS72BE_UTM_zone_39S,	32539)
+ValuePair(PCS_WGS72BE_UTM_zone_40S,	32540)
+ValuePair(PCS_WGS72BE_UTM_zone_41S,	32541)
+ValuePair(PCS_WGS72BE_UTM_zone_42S,	32542)
+ValuePair(PCS_WGS72BE_UTM_zone_43S,	32543)
+ValuePair(PCS_WGS72BE_UTM_zone_44S,	32544)
+ValuePair(PCS_WGS72BE_UTM_zone_45S,	32545)
+ValuePair(PCS_WGS72BE_UTM_zone_46S,	32546)
+ValuePair(PCS_WGS72BE_UTM_zone_47S,	32547)
+ValuePair(PCS_WGS72BE_UTM_zone_48S,	32548)
+ValuePair(PCS_WGS72BE_UTM_zone_49S,	32549)
+ValuePair(PCS_WGS72BE_UTM_zone_50S,	32550)
+ValuePair(PCS_WGS72BE_UTM_zone_51S,	32551)
+ValuePair(PCS_WGS72BE_UTM_zone_52S,	32552)
+ValuePair(PCS_WGS72BE_UTM_zone_53S,	32553)
+ValuePair(PCS_WGS72BE_UTM_zone_54S,	32554)
+ValuePair(PCS_WGS72BE_UTM_zone_55S,	32555)
+ValuePair(PCS_WGS72BE_UTM_zone_56S,	32556)
+ValuePair(PCS_WGS72BE_UTM_zone_57S,	32557)
+ValuePair(PCS_WGS72BE_UTM_zone_58S,	32558)
+ValuePair(PCS_WGS72BE_UTM_zone_59S,	32559)
+ValuePair(PCS_WGS72BE_UTM_zone_60S,	32560)
+ValuePair(PCS_WGS84_UTM_zone_1N,	32601)
+ValuePair(PCS_WGS84_UTM_zone_2N,	32602)
+ValuePair(PCS_WGS84_UTM_zone_3N,	32603)
+ValuePair(PCS_WGS84_UTM_zone_4N,	32604)
+ValuePair(PCS_WGS84_UTM_zone_5N,	32605)
+ValuePair(PCS_WGS84_UTM_zone_6N,	32606)
+ValuePair(PCS_WGS84_UTM_zone_7N,	32607)
+ValuePair(PCS_WGS84_UTM_zone_8N,	32608)
+ValuePair(PCS_WGS84_UTM_zone_9N,	32609)
+ValuePair(PCS_WGS84_UTM_zone_10N,	32610)
+ValuePair(PCS_WGS84_UTM_zone_11N,	32611)
+ValuePair(PCS_WGS84_UTM_zone_12N,	32612)
+ValuePair(PCS_WGS84_UTM_zone_13N,	32613)
+ValuePair(PCS_WGS84_UTM_zone_14N,	32614)
+ValuePair(PCS_WGS84_UTM_zone_15N,	32615)
+ValuePair(PCS_WGS84_UTM_zone_16N,	32616)
+ValuePair(PCS_WGS84_UTM_zone_17N,	32617)
+ValuePair(PCS_WGS84_UTM_zone_18N,	32618)
+ValuePair(PCS_WGS84_UTM_zone_19N,	32619)
+ValuePair(PCS_WGS84_UTM_zone_20N,	32620)
+ValuePair(PCS_WGS84_UTM_zone_21N,	32621)
+ValuePair(PCS_WGS84_UTM_zone_22N,	32622)
+ValuePair(PCS_WGS84_UTM_zone_23N,	32623)
+ValuePair(PCS_WGS84_UTM_zone_24N,	32624)
+ValuePair(PCS_WGS84_UTM_zone_25N,	32625)
+ValuePair(PCS_WGS84_UTM_zone_26N,	32626)
+ValuePair(PCS_WGS84_UTM_zone_27N,	32627)
+ValuePair(PCS_WGS84_UTM_zone_28N,	32628)
+ValuePair(PCS_WGS84_UTM_zone_29N,	32629)
+ValuePair(PCS_WGS84_UTM_zone_30N,	32630)
+ValuePair(PCS_WGS84_UTM_zone_31N,	32631)
+ValuePair(PCS_WGS84_UTM_zone_32N,	32632)
+ValuePair(PCS_WGS84_UTM_zone_33N,	32633)
+ValuePair(PCS_WGS84_UTM_zone_34N,	32634)
+ValuePair(PCS_WGS84_UTM_zone_35N,	32635)
+ValuePair(PCS_WGS84_UTM_zone_36N,	32636)
+ValuePair(PCS_WGS84_UTM_zone_37N,	32637)
+ValuePair(PCS_WGS84_UTM_zone_38N,	32638)
+ValuePair(PCS_WGS84_UTM_zone_39N,	32639)
+ValuePair(PCS_WGS84_UTM_zone_40N,	32640)
+ValuePair(PCS_WGS84_UTM_zone_41N,	32641)
+ValuePair(PCS_WGS84_UTM_zone_42N,	32642)
+ValuePair(PCS_WGS84_UTM_zone_43N,	32643)
+ValuePair(PCS_WGS84_UTM_zone_44N,	32644)
+ValuePair(PCS_WGS84_UTM_zone_45N,	32645)
+ValuePair(PCS_WGS84_UTM_zone_46N,	32646)
+ValuePair(PCS_WGS84_UTM_zone_47N,	32647)
+ValuePair(PCS_WGS84_UTM_zone_48N,	32648)
+ValuePair(PCS_WGS84_UTM_zone_49N,	32649)
+ValuePair(PCS_WGS84_UTM_zone_50N,	32650)
+ValuePair(PCS_WGS84_UTM_zone_51N,	32651)
+ValuePair(PCS_WGS84_UTM_zone_52N,	32652)
+ValuePair(PCS_WGS84_UTM_zone_53N,	32653)
+ValuePair(PCS_WGS84_UTM_zone_54N,	32654)
+ValuePair(PCS_WGS84_UTM_zone_55N,	32655)
+ValuePair(PCS_WGS84_UTM_zone_56N,	32656)
+ValuePair(PCS_WGS84_UTM_zone_57N,	32657)
+ValuePair(PCS_WGS84_UTM_zone_58N,	32658)
+ValuePair(PCS_WGS84_UTM_zone_59N,	32659)
+ValuePair(PCS_WGS84_UTM_zone_60N,	32660)
+ValuePair(PCS_WGS84_UTM_zone_1S,	32701)
+ValuePair(PCS_WGS84_UTM_zone_2S,	32702)
+ValuePair(PCS_WGS84_UTM_zone_3S,	32703)
+ValuePair(PCS_WGS84_UTM_zone_4S,	32704)
+ValuePair(PCS_WGS84_UTM_zone_5S,	32705)
+ValuePair(PCS_WGS84_UTM_zone_6S,	32706)
+ValuePair(PCS_WGS84_UTM_zone_7S,	32707)
+ValuePair(PCS_WGS84_UTM_zone_8S,	32708)
+ValuePair(PCS_WGS84_UTM_zone_9S,	32709)
+ValuePair(PCS_WGS84_UTM_zone_10S,	32710)
+ValuePair(PCS_WGS84_UTM_zone_11S,	32711)
+ValuePair(PCS_WGS84_UTM_zone_12S,	32712)
+ValuePair(PCS_WGS84_UTM_zone_13S,	32713)
+ValuePair(PCS_WGS84_UTM_zone_14S,	32714)
+ValuePair(PCS_WGS84_UTM_zone_15S,	32715)
+ValuePair(PCS_WGS84_UTM_zone_16S,	32716)
+ValuePair(PCS_WGS84_UTM_zone_17S,	32717)
+ValuePair(PCS_WGS84_UTM_zone_18S,	32718)
+ValuePair(PCS_WGS84_UTM_zone_19S,	32719)
+ValuePair(PCS_WGS84_UTM_zone_20S,	32720)
+ValuePair(PCS_WGS84_UTM_zone_21S,	32721)
+ValuePair(PCS_WGS84_UTM_zone_22S,	32722)
+ValuePair(PCS_WGS84_UTM_zone_23S,	32723)
+ValuePair(PCS_WGS84_UTM_zone_24S,	32724)
+ValuePair(PCS_WGS84_UTM_zone_25S,	32725)
+ValuePair(PCS_WGS84_UTM_zone_26S,	32726)
+ValuePair(PCS_WGS84_UTM_zone_27S,	32727)
+ValuePair(PCS_WGS84_UTM_zone_28S,	32728)
+ValuePair(PCS_WGS84_UTM_zone_29S,	32729)
+ValuePair(PCS_WGS84_UTM_zone_30S,	32730)
+ValuePair(PCS_WGS84_UTM_zone_31S,	32731)
+ValuePair(PCS_WGS84_UTM_zone_32S,	32732)
+ValuePair(PCS_WGS84_UTM_zone_33S,	32733)
+ValuePair(PCS_WGS84_UTM_zone_34S,	32734)
+ValuePair(PCS_WGS84_UTM_zone_35S,	32735)
+ValuePair(PCS_WGS84_UTM_zone_36S,	32736)
+ValuePair(PCS_WGS84_UTM_zone_37S,	32737)
+ValuePair(PCS_WGS84_UTM_zone_38S,	32738)
+ValuePair(PCS_WGS84_UTM_zone_39S,	32739)
+ValuePair(PCS_WGS84_UTM_zone_40S,	32740)
+ValuePair(PCS_WGS84_UTM_zone_41S,	32741)
+ValuePair(PCS_WGS84_UTM_zone_42S,	32742)
+ValuePair(PCS_WGS84_UTM_zone_43S,	32743)
+ValuePair(PCS_WGS84_UTM_zone_44S,	32744)
+ValuePair(PCS_WGS84_UTM_zone_45S,	32745)
+ValuePair(PCS_WGS84_UTM_zone_46S,	32746)
+ValuePair(PCS_WGS84_UTM_zone_47S,	32747)
+ValuePair(PCS_WGS84_UTM_zone_48S,	32748)
+ValuePair(PCS_WGS84_UTM_zone_49S,	32749)
+ValuePair(PCS_WGS84_UTM_zone_50S,	32750)
+ValuePair(PCS_WGS84_UTM_zone_51S,	32751)
+ValuePair(PCS_WGS84_UTM_zone_52S,	32752)
+ValuePair(PCS_WGS84_UTM_zone_53S,	32753)
+ValuePair(PCS_WGS84_UTM_zone_54S,	32754)
+ValuePair(PCS_WGS84_UTM_zone_55S,	32755)
+ValuePair(PCS_WGS84_UTM_zone_56S,	32756)
+ValuePair(PCS_WGS84_UTM_zone_57S,	32757)
+ValuePair(PCS_WGS84_UTM_zone_58S,	32758)
+ValuePair(PCS_WGS84_UTM_zone_59S,	32759)
+ValuePair(PCS_WGS84_UTM_zone_60S,	32760)
+/* end of list */
diff --git a/src/tiff/epsg_pm.inc b/src/tiff/epsg_pm.inc
new file mode 100644
index 0000000..6eedf76
--- /dev/null
+++ b/src/tiff/epsg_pm.inc
@@ -0,0 +1,22 @@
+/* EPSG/GeoTIFF Rev 0.2 Prime Meridian Database */
+
+/* C database for Geotiff include files.   */
+/* the macro ValuePair() must be defined   */
+/* by the enclosing include file           */
+
+#ifdef INCLUDE_OLD_CODES
+#include old_pm.inc
+#endif /* OLD Codes */
+
+ValuePair(PM_Greenwich,	8901)
+ValuePair(PM_Lisbon,	8902)
+ValuePair(PM_Paris,	8903)
+ValuePair(PM_Bogota,	8904)
+ValuePair(PM_Madrid,	8905)
+ValuePair(PM_Rome,	8906)
+ValuePair(PM_Bern,	8907)
+ValuePair(PM_Jakarta,	8908)
+ValuePair(PM_Ferro,	8909)
+ValuePair(PM_Brussels,	8910)
+ValuePair(PM_Stockholm,	8911)
+/* end of list */
diff --git a/src/tiff/epsg_proj.inc b/src/tiff/epsg_proj.inc
new file mode 100644
index 0000000..ac4f603
--- /dev/null
+++ b/src/tiff/epsg_proj.inc
@@ -0,0 +1,443 @@
+/*
+ *  EPSG/POSC Projection Codes - GeoTIFF Rev 0.2
+ */
+
+/* C database for Geotiff include files.   */
+/* the macro ValuePair() must be defined   */
+/* by the enclosing include file           */
+
+#ifdef INCLUDE_OLD_CODES
+#include old_proj.inc
+#endif /* OLD Codes */
+
+/* New codes */
+
+ValuePair(Proj_Stereo_70,19926)
+
+/* old codes */
+
+ValuePair(Proj_Alabama_CS27_East,	10101)
+ValuePair(Proj_Alabama_CS27_West,	10102)
+ValuePair(Proj_Alabama_CS83_East,	10131)
+ValuePair(Proj_Alabama_CS83_West,	10132)
+ValuePair(Proj_Arizona_Coordinate_System_east,	10201)
+ValuePair(Proj_Arizona_Coordinate_System_Central,	10202)
+ValuePair(Proj_Arizona_Coordinate_System_west,	10203)
+ValuePair(Proj_Arizona_CS83_east,	10231)
+ValuePair(Proj_Arizona_CS83_Central,	10232)
+ValuePair(Proj_Arizona_CS83_west,	10233)
+ValuePair(Proj_Arkansas_CS27_North,	10301)
+ValuePair(Proj_Arkansas_CS27_South,	10302)
+ValuePair(Proj_Arkansas_CS83_North,	10331)
+ValuePair(Proj_Arkansas_CS83_South,	10332)
+ValuePair(Proj_California_CS27_I,	10401)
+ValuePair(Proj_California_CS27_II,	10402)
+ValuePair(Proj_California_CS27_III,	10403)
+ValuePair(Proj_California_CS27_IV,	10404)
+ValuePair(Proj_California_CS27_V,	10405)
+ValuePair(Proj_California_CS27_VI,	10406)
+ValuePair(Proj_California_CS27_VII,	10407)
+ValuePair(Proj_California_CS83_1,	10431)
+ValuePair(Proj_California_CS83_2,	10432)
+ValuePair(Proj_California_CS83_3,	10433)
+ValuePair(Proj_California_CS83_4,	10434)
+ValuePair(Proj_California_CS83_5,	10435)
+ValuePair(Proj_California_CS83_6,	10436)
+ValuePair(Proj_Colorado_CS27_North,	10501)
+ValuePair(Proj_Colorado_CS27_Central,	10502)
+ValuePair(Proj_Colorado_CS27_South,	10503)
+ValuePair(Proj_Colorado_CS83_North,	10531)
+ValuePair(Proj_Colorado_CS83_Central,	10532)
+ValuePair(Proj_Colorado_CS83_South,	10533)
+ValuePair(Proj_Connecticut_CS27,	10600)
+ValuePair(Proj_Connecticut_CS83,	10630)
+ValuePair(Proj_Delaware_CS27,	10700)
+ValuePair(Proj_Delaware_CS83,	10730)
+ValuePair(Proj_Florida_CS27_East,	10901)
+ValuePair(Proj_Florida_CS27_West,	10902)
+ValuePair(Proj_Florida_CS27_North,	10903)
+ValuePair(Proj_Florida_CS83_East,	10931)
+ValuePair(Proj_Florida_CS83_West,	10932)
+ValuePair(Proj_Florida_CS83_North,	10933)
+ValuePair(Proj_Georgia_CS27_East,	11001)
+ValuePair(Proj_Georgia_CS27_West,	11002)
+ValuePair(Proj_Georgia_CS83_East,	11031)
+ValuePair(Proj_Georgia_CS83_West,	11032)
+ValuePair(Proj_Idaho_CS27_East,	11101)
+ValuePair(Proj_Idaho_CS27_Central,	11102)
+ValuePair(Proj_Idaho_CS27_West,	11103)
+ValuePair(Proj_Idaho_CS83_East,	11131)
+ValuePair(Proj_Idaho_CS83_Central,	11132)
+ValuePair(Proj_Idaho_CS83_West,	11133)
+ValuePair(Proj_Illinois_CS27_East,	11201)
+ValuePair(Proj_Illinois_CS27_West,	11202)
+ValuePair(Proj_Illinois_CS83_East,	11231)
+ValuePair(Proj_Illinois_CS83_West,	11232)
+ValuePair(Proj_Indiana_CS27_East,	11301)
+ValuePair(Proj_Indiana_CS27_West,	11302)
+ValuePair(Proj_Indiana_CS83_East,	11331)
+ValuePair(Proj_Indiana_CS83_West,	11332)
+ValuePair(Proj_Iowa_CS27_North,	11401)
+ValuePair(Proj_Iowa_CS27_South,	11402)
+ValuePair(Proj_Iowa_CS83_North,	11431)
+ValuePair(Proj_Iowa_CS83_South,	11432)
+ValuePair(Proj_Kansas_CS27_North,	11501)
+ValuePair(Proj_Kansas_CS27_South,	11502)
+ValuePair(Proj_Kansas_CS83_North,	11531)
+ValuePair(Proj_Kansas_CS83_South,	11532)
+ValuePair(Proj_Kentucky_CS27_North,	11601)
+ValuePair(Proj_Kentucky_CS27_South,	11602)
+ValuePair(Proj_Kentucky_CS83_North,	15303)
+ValuePair(Proj_Kentucky_CS83_South,	11632)
+ValuePair(Proj_Louisiana_CS27_North,	11701)
+ValuePair(Proj_Louisiana_CS27_South,	11702)
+ValuePair(Proj_Louisiana_CS83_North,	11731)
+ValuePair(Proj_Louisiana_CS83_South,	11732)
+ValuePair(Proj_Maine_CS27_East,	11801)
+ValuePair(Proj_Maine_CS27_West,	11802)
+ValuePair(Proj_Maine_CS83_East,	11831)
+ValuePair(Proj_Maine_CS83_West,	11832)
+ValuePair(Proj_Maryland_CS27,	11900)
+ValuePair(Proj_Maryland_CS83,	11930)
+ValuePair(Proj_Massachusetts_CS27_Mainland,	12001)
+ValuePair(Proj_Massachusetts_CS27_Island,	12002)
+ValuePair(Proj_Massachusetts_CS83_Mainland,	12031)
+ValuePair(Proj_Massachusetts_CS83_Island,	12032)
+ValuePair(Proj_Michigan_State_Plane_East,	12101)
+ValuePair(Proj_Michigan_State_Plane_Old_Central,	12102)
+ValuePair(Proj_Michigan_State_Plane_West,	12103)
+ValuePair(Proj_Michigan_CS27_North,	12111)
+ValuePair(Proj_Michigan_CS27_Central,	12112)
+ValuePair(Proj_Michigan_CS27_South,	12113)
+ValuePair(Proj_Michigan_CS83_North,	12141)
+ValuePair(Proj_Michigan_CS83_Central,	12142)
+ValuePair(Proj_Michigan_CS83_South,	12143)
+ValuePair(Proj_Minnesota_CS27_North,	12201)
+ValuePair(Proj_Minnesota_CS27_Central,	12202)
+ValuePair(Proj_Minnesota_CS27_South,	12203)
+ValuePair(Proj_Minnesota_CS83_North,	12231)
+ValuePair(Proj_Minnesota_CS83_Central,	12232)
+ValuePair(Proj_Minnesota_CS83_South,	12233)
+ValuePair(Proj_Mississippi_CS27_East,	12301)
+ValuePair(Proj_Mississippi_CS27_West,	12302)
+ValuePair(Proj_Mississippi_CS83_East,	12331)
+ValuePair(Proj_Mississippi_CS83_West,	12332)
+ValuePair(Proj_Missouri_CS27_East,	12401)
+ValuePair(Proj_Missouri_CS27_Central,	12402)
+ValuePair(Proj_Missouri_CS27_West,	12403)
+ValuePair(Proj_Missouri_CS83_East,	12431)
+ValuePair(Proj_Missouri_CS83_Central,	12432)
+ValuePair(Proj_Missouri_CS83_West,	12433)
+ValuePair(Proj_Montana_CS27_North,	12501)
+ValuePair(Proj_Montana_CS27_Central,	12502)
+ValuePair(Proj_Montana_CS27_South,	12503)
+ValuePair(Proj_Montana_CS83,	12530)
+ValuePair(Proj_Nebraska_CS27_North,	12601)
+ValuePair(Proj_Nebraska_CS27_South,	12602)
+ValuePair(Proj_Nebraska_CS83,	12630)
+ValuePair(Proj_Nevada_CS27_East,	12701)
+ValuePair(Proj_Nevada_CS27_Central,	12702)
+ValuePair(Proj_Nevada_CS27_West,	12703)
+ValuePair(Proj_Nevada_CS83_East,	12731)
+ValuePair(Proj_Nevada_CS83_Central,	12732)
+ValuePair(Proj_Nevada_CS83_West,	12733)
+ValuePair(Proj_New_Hampshire_CS27,	12800)
+ValuePair(Proj_New_Hampshire_CS83,	12830)
+ValuePair(Proj_New_Jersey_CS27,	12900)
+ValuePair(Proj_New_Jersey_CS83,	12930)
+ValuePair(Proj_New_Mexico_CS27_East,	13001)
+ValuePair(Proj_New_Mexico_CS27_Central,	13002)
+ValuePair(Proj_New_Mexico_CS27_West,	13003)
+ValuePair(Proj_New_Mexico_CS83_East,	13031)
+ValuePair(Proj_New_Mexico_CS83_Central,	13032)
+ValuePair(Proj_New_Mexico_CS83_West,	13033)
+ValuePair(Proj_New_York_CS27_East,	13101)
+ValuePair(Proj_New_York_CS27_Central,	13102)
+ValuePair(Proj_New_York_CS27_West,	13103)
+ValuePair(Proj_New_York_CS27_Long_Island,	13104)
+ValuePair(Proj_New_York_CS83_East,	13131)
+ValuePair(Proj_New_York_CS83_Central,	13132)
+ValuePair(Proj_New_York_CS83_West,	13133)
+ValuePair(Proj_New_York_CS83_Long_Island,	13134)
+ValuePair(Proj_North_Carolina_CS27,	13200)
+ValuePair(Proj_North_Carolina_CS83,	13230)
+ValuePair(Proj_North_Dakota_CS27_North,	13301)
+ValuePair(Proj_North_Dakota_CS27_South,	13302)
+ValuePair(Proj_North_Dakota_CS83_North,	13331)
+ValuePair(Proj_North_Dakota_CS83_South,	13332)
+ValuePair(Proj_Ohio_CS27_North,	13401)
+ValuePair(Proj_Ohio_CS27_South,	13402)
+ValuePair(Proj_Ohio_CS83_North,	13431)
+ValuePair(Proj_Ohio_CS83_South,	13432)
+ValuePair(Proj_Oklahoma_CS27_North,	13501)
+ValuePair(Proj_Oklahoma_CS27_South,	13502)
+ValuePair(Proj_Oklahoma_CS83_North,	13531)
+ValuePair(Proj_Oklahoma_CS83_South,	13532)
+ValuePair(Proj_Oregon_CS27_North,	13601)
+ValuePair(Proj_Oregon_CS27_South,	13602)
+ValuePair(Proj_Oregon_CS83_North,	13631)
+ValuePair(Proj_Oregon_CS83_South,	13632)
+ValuePair(Proj_Pennsylvania_CS27_North,	13701)
+ValuePair(Proj_Pennsylvania_CS27_South,	13702)
+ValuePair(Proj_Pennsylvania_CS83_North,	13731)
+ValuePair(Proj_Pennsylvania_CS83_South,	13732)
+ValuePair(Proj_Rhode_Island_CS27,	13800)
+ValuePair(Proj_Rhode_Island_CS83,	13830)
+ValuePair(Proj_South_Carolina_CS27_North,	13901)
+ValuePair(Proj_South_Carolina_CS27_South,	13902)
+ValuePair(Proj_South_Carolina_CS83,	13930)
+ValuePair(Proj_South_Dakota_CS27_North,	14001)
+ValuePair(Proj_South_Dakota_CS27_South,	14002)
+ValuePair(Proj_South_Dakota_CS83_North,	14031)
+ValuePair(Proj_South_Dakota_CS83_South,	14032)
+ValuePair(Proj_Tennessee_CS27,	15302)
+ValuePair(Proj_Tennessee_CS83,	14130)
+ValuePair(Proj_Texas_CS27_North,	14201)
+ValuePair(Proj_Texas_CS27_North_Central,	14202)
+ValuePair(Proj_Texas_CS27_Central,	14203)
+ValuePair(Proj_Texas_CS27_South_Central,	14204)
+ValuePair(Proj_Texas_CS27_South,	14205)
+ValuePair(Proj_Texas_CS83_North,	14231)
+ValuePair(Proj_Texas_CS83_North_Central,	14232)
+ValuePair(Proj_Texas_CS83_Central,	14233)
+ValuePair(Proj_Texas_CS83_South_Central,	14234)
+ValuePair(Proj_Texas_CS83_South,	14235)
+ValuePair(Proj_Utah_CS27_North,	14301)
+ValuePair(Proj_Utah_CS27_Central,	14302)
+ValuePair(Proj_Utah_CS27_South,	14303)
+ValuePair(Proj_Utah_CS83_North,	14331)
+ValuePair(Proj_Utah_CS83_Central,	14332)
+ValuePair(Proj_Utah_CS83_South,	14333)
+ValuePair(Proj_Vermont_CS27,	14400)
+ValuePair(Proj_Vermont_CS83,	14430)
+ValuePair(Proj_Virginia_CS27_North,	14501)
+ValuePair(Proj_Virginia_CS27_South,	14502)
+ValuePair(Proj_Virginia_CS83_North,	14531)
+ValuePair(Proj_Virginia_CS83_South,	14532)
+ValuePair(Proj_Washington_CS27_North,	14601)
+ValuePair(Proj_Washington_CS27_South,	14602)
+ValuePair(Proj_Washington_CS83_North,	14631)
+ValuePair(Proj_Washington_CS83_South,	14632)
+ValuePair(Proj_West_Virginia_CS27_North,	14701)
+ValuePair(Proj_West_Virginia_CS27_South,	14702)
+ValuePair(Proj_West_Virginia_CS83_North,	14731)
+ValuePair(Proj_West_Virginia_CS83_South,	14732)
+ValuePair(Proj_Wisconsin_CS27_North,	14801)
+ValuePair(Proj_Wisconsin_CS27_Central,	14802)
+ValuePair(Proj_Wisconsin_CS27_South,	14803)
+ValuePair(Proj_Wisconsin_CS83_North,	14831)
+ValuePair(Proj_Wisconsin_CS83_Central,	14832)
+ValuePair(Proj_Wisconsin_CS83_South,	14833)
+ValuePair(Proj_Wyoming_CS27_East,	14901)
+ValuePair(Proj_Wyoming_CS27_East_Central,	14902)
+ValuePair(Proj_Wyoming_CS27_West_Central,	14903)
+ValuePair(Proj_Wyoming_CS27_West,	14904)
+ValuePair(Proj_Wyoming_CS83_East,	14931)
+ValuePair(Proj_Wyoming_CS83_East_Central,	14932)
+ValuePair(Proj_Wyoming_CS83_West_Central,	14933)
+ValuePair(Proj_Wyoming_CS83_West,	14934)
+ValuePair(Proj_Alaska_CS27_1,	15001)
+ValuePair(Proj_Alaska_CS27_2,	15002)
+ValuePair(Proj_Alaska_CS27_3,	15003)
+ValuePair(Proj_Alaska_CS27_4,	15004)
+ValuePair(Proj_Alaska_CS27_5,	15005)
+ValuePair(Proj_Alaska_CS27_6,	15006)
+ValuePair(Proj_Alaska_CS27_7,	15007)
+ValuePair(Proj_Alaska_CS27_8,	15008)
+ValuePair(Proj_Alaska_CS27_9,	15009)
+ValuePair(Proj_Alaska_CS27_10,	15010)
+ValuePair(Proj_Alaska_CS83_1,	15031)
+ValuePair(Proj_Alaska_CS83_2,	15032)
+ValuePair(Proj_Alaska_CS83_3,	15033)
+ValuePair(Proj_Alaska_CS83_4,	15034)
+ValuePair(Proj_Alaska_CS83_5,	15035)
+ValuePair(Proj_Alaska_CS83_6,	15036)
+ValuePair(Proj_Alaska_CS83_7,	15037)
+ValuePair(Proj_Alaska_CS83_8,	15038)
+ValuePair(Proj_Alaska_CS83_9,	15039)
+ValuePair(Proj_Alaska_CS83_10,	15040)
+ValuePair(Proj_Hawaii_CS27_1,	15101)
+ValuePair(Proj_Hawaii_CS27_2,	15102)
+ValuePair(Proj_Hawaii_CS27_3,	15103)
+ValuePair(Proj_Hawaii_CS27_4,	15104)
+ValuePair(Proj_Hawaii_CS27_5,	15105)
+ValuePair(Proj_Hawaii_CS83_1,	15131)
+ValuePair(Proj_Hawaii_CS83_2,	15132)
+ValuePair(Proj_Hawaii_CS83_3,	15133)
+ValuePair(Proj_Hawaii_CS83_4,	15134)
+ValuePair(Proj_Hawaii_CS83_5,	15135)
+ValuePair(Proj_Puerto_Rico_CS27,	15201)
+ValuePair(Proj_St_Croix,	15202)
+ValuePair(Proj_Puerto_Rico_Virgin_Is,	15230)
+ValuePair(Proj_BLM_14N_feet,	15914)
+ValuePair(Proj_BLM_15N_feet,	15915)
+ValuePair(Proj_BLM_16N_feet,	15916)
+ValuePair(Proj_BLM_17N_feet,	15917)
+ValuePair(Proj_UTM_zone_1N,  16001)
+ValuePair(Proj_UTM_zone_2N,  16002)
+ValuePair(Proj_UTM_zone_3N,  16003)
+ValuePair(Proj_UTM_zone_4N,  16004)
+ValuePair(Proj_UTM_zone_5N,  16005)
+ValuePair(Proj_UTM_zone_6N,  16006)
+ValuePair(Proj_UTM_zone_7N,  16007)
+ValuePair(Proj_UTM_zone_8N,  16008)
+ValuePair(Proj_UTM_zone_9N,  16009)
+ValuePair(Proj_UTM_zone_10N, 16010)
+ValuePair(Proj_UTM_zone_11N, 16011)
+ValuePair(Proj_UTM_zone_12N, 16012)
+ValuePair(Proj_UTM_zone_13N, 16013)
+ValuePair(Proj_UTM_zone_14N, 16014)
+ValuePair(Proj_UTM_zone_15N, 16015)
+ValuePair(Proj_UTM_zone_16N, 16016)
+ValuePair(Proj_UTM_zone_17N, 16017)
+ValuePair(Proj_UTM_zone_18N, 16018)
+ValuePair(Proj_UTM_zone_19N, 16019)
+ValuePair(Proj_UTM_zone_20N, 16020)
+ValuePair(Proj_UTM_zone_21N, 16021)
+ValuePair(Proj_UTM_zone_22N, 16022)
+ValuePair(Proj_UTM_zone_23N, 16023)
+ValuePair(Proj_UTM_zone_24N, 16024)
+ValuePair(Proj_UTM_zone_25N, 16025)
+ValuePair(Proj_UTM_zone_26N, 16026)
+ValuePair(Proj_UTM_zone_27N, 16027)
+ValuePair(Proj_UTM_zone_28N, 16028)
+ValuePair(Proj_UTM_zone_29N, 16029)
+ValuePair(Proj_UTM_zone_30N, 16030)
+ValuePair(Proj_UTM_zone_31N, 16031)
+ValuePair(Proj_UTM_zone_32N, 16032)
+ValuePair(Proj_UTM_zone_33N, 16033)
+ValuePair(Proj_UTM_zone_34N, 16034)
+ValuePair(Proj_UTM_zone_35N, 16035)
+ValuePair(Proj_UTM_zone_36N, 16036)
+ValuePair(Proj_UTM_zone_37N, 16037)
+ValuePair(Proj_UTM_zone_38N, 16038)
+ValuePair(Proj_UTM_zone_39N, 16039)
+ValuePair(Proj_UTM_zone_40N, 16040)
+ValuePair(Proj_UTM_zone_41N, 16041)
+ValuePair(Proj_UTM_zone_42N, 16042)
+ValuePair(Proj_UTM_zone_43N, 16043)
+ValuePair(Proj_UTM_zone_44N, 16044)
+ValuePair(Proj_UTM_zone_45N, 16045)
+ValuePair(Proj_UTM_zone_46N, 16046)
+ValuePair(Proj_UTM_zone_47N, 16047)
+ValuePair(Proj_UTM_zone_48N, 16048)
+ValuePair(Proj_UTM_zone_49N, 16049)
+ValuePair(Proj_UTM_zone_50N, 16050)
+ValuePair(Proj_UTM_zone_51N, 16051)
+ValuePair(Proj_UTM_zone_52N, 16052)
+ValuePair(Proj_UTM_zone_53N, 16053)
+ValuePair(Proj_UTM_zone_54N, 16054)
+ValuePair(Proj_UTM_zone_55N, 16055)
+ValuePair(Proj_UTM_zone_56N, 16056)
+ValuePair(Proj_UTM_zone_57N, 16057)
+ValuePair(Proj_UTM_zone_58N, 16058)
+ValuePair(Proj_UTM_zone_59N, 16059)
+ValuePair(Proj_UTM_zone_60N, 16060)
+ValuePair(Proj_UTM_zone_1S,  16101)
+ValuePair(Proj_UTM_zone_2S,  16102)
+ValuePair(Proj_UTM_zone_3S,  16103)
+ValuePair(Proj_UTM_zone_4S,  16104)
+ValuePair(Proj_UTM_zone_5S,  16105)
+ValuePair(Proj_UTM_zone_6S,  16106)
+ValuePair(Proj_UTM_zone_7S,  16107)
+ValuePair(Proj_UTM_zone_8S,  16108)
+ValuePair(Proj_UTM_zone_9S,  16109)
+ValuePair(Proj_UTM_zone_10S, 16110)
+ValuePair(Proj_UTM_zone_11S, 16111)
+ValuePair(Proj_UTM_zone_12S, 16112)
+ValuePair(Proj_UTM_zone_13S, 16113)
+ValuePair(Proj_UTM_zone_14S, 16114)
+ValuePair(Proj_UTM_zone_15S, 16115)
+ValuePair(Proj_UTM_zone_16S, 16116)
+ValuePair(Proj_UTM_zone_17S, 16117)
+ValuePair(Proj_UTM_zone_18S, 16118)
+ValuePair(Proj_UTM_zone_19S, 16119)
+ValuePair(Proj_UTM_zone_20S, 16120)
+ValuePair(Proj_UTM_zone_21S, 16121)
+ValuePair(Proj_UTM_zone_22S, 16122)
+ValuePair(Proj_UTM_zone_23S, 16123)
+ValuePair(Proj_UTM_zone_24S, 16124)
+ValuePair(Proj_UTM_zone_25S, 16125)
+ValuePair(Proj_UTM_zone_26S, 16126)
+ValuePair(Proj_UTM_zone_27S, 16127)
+ValuePair(Proj_UTM_zone_28S, 16128)
+ValuePair(Proj_UTM_zone_29S, 16129)
+ValuePair(Proj_UTM_zone_30S, 16130)
+ValuePair(Proj_UTM_zone_31S, 16131)
+ValuePair(Proj_UTM_zone_32S, 16132)
+ValuePair(Proj_UTM_zone_33S, 16133)
+ValuePair(Proj_UTM_zone_34S, 16134)
+ValuePair(Proj_UTM_zone_35S, 16135)
+ValuePair(Proj_UTM_zone_36S, 16136)
+ValuePair(Proj_UTM_zone_37S, 16137)
+ValuePair(Proj_UTM_zone_38S, 16138)
+ValuePair(Proj_UTM_zone_39S, 16139)
+ValuePair(Proj_UTM_zone_40S, 16140)
+ValuePair(Proj_UTM_zone_41S, 16141)
+ValuePair(Proj_UTM_zone_42S, 16142)
+ValuePair(Proj_UTM_zone_43S, 16143)
+ValuePair(Proj_UTM_zone_44S, 16144)
+ValuePair(Proj_UTM_zone_45S, 16145)
+ValuePair(Proj_UTM_zone_46S, 16146)
+ValuePair(Proj_UTM_zone_47S, 16147)
+ValuePair(Proj_UTM_zone_48S, 16148)
+ValuePair(Proj_UTM_zone_49S, 16149)
+ValuePair(Proj_UTM_zone_50S, 16150)
+ValuePair(Proj_UTM_zone_51S, 16151)
+ValuePair(Proj_UTM_zone_52S, 16152)
+ValuePair(Proj_UTM_zone_53S, 16153)
+ValuePair(Proj_UTM_zone_54S, 16154)
+ValuePair(Proj_UTM_zone_55S, 16155)
+ValuePair(Proj_UTM_zone_56S, 16156)
+ValuePair(Proj_UTM_zone_57S, 16157)
+ValuePair(Proj_UTM_zone_58S, 16158)
+ValuePair(Proj_UTM_zone_59S, 16159)
+ValuePair(Proj_UTM_zone_60S, 16160)
+ValuePair(Proj_Gauss_Kruger_zone_0, 16200)
+ValuePair(Proj_Gauss_Kruger_zone_1, 16201)
+ValuePair(Proj_Gauss_Kruger_zone_2, 16202)
+ValuePair(Proj_Gauss_Kruger_zone_3, 16203)
+ValuePair(Proj_Gauss_Kruger_zone_4, 16204)
+ValuePair(Proj_Gauss_Kruger_zone_5, 16205)
+ValuePair(Proj_Map_Grid_of_Australia_48,	17348)
+ValuePair(Proj_Map_Grid_of_Australia_49,	17349)
+ValuePair(Proj_Map_Grid_of_Australia_50,	17350)
+ValuePair(Proj_Map_Grid_of_Australia_51,	17351)
+ValuePair(Proj_Map_Grid_of_Australia_52,	17352)
+ValuePair(Proj_Map_Grid_of_Australia_53,	17353)
+ValuePair(Proj_Map_Grid_of_Australia_54,	17354)
+ValuePair(Proj_Map_Grid_of_Australia_55,	17355)
+ValuePair(Proj_Map_Grid_of_Australia_56,	17356)
+ValuePair(Proj_Map_Grid_of_Australia_57,	17357)
+ValuePair(Proj_Map_Grid_of_Australia_58,	17358)
+ValuePair(Proj_Australian_Map_Grid_48,	17448)
+ValuePair(Proj_Australian_Map_Grid_49,	17449)
+ValuePair(Proj_Australian_Map_Grid_50,	17450)
+ValuePair(Proj_Australian_Map_Grid_51,	17451)
+ValuePair(Proj_Australian_Map_Grid_52,	17452)
+ValuePair(Proj_Australian_Map_Grid_53,	17453)
+ValuePair(Proj_Australian_Map_Grid_54,	17454)
+ValuePair(Proj_Australian_Map_Grid_55,	17455)
+ValuePair(Proj_Australian_Map_Grid_56,	17456)
+ValuePair(Proj_Australian_Map_Grid_57,	17457)
+ValuePair(Proj_Australian_Map_Grid_58,	17458)
+ValuePair(Proj_Argentina_1,	18031)
+ValuePair(Proj_Argentina_2,	18032)
+ValuePair(Proj_Argentina_3,	18033)
+ValuePair(Proj_Argentina_4,	18034)
+ValuePair(Proj_Argentina_5,	18035)
+ValuePair(Proj_Argentina_6,	18036)
+ValuePair(Proj_Argentina_7,	18037)
+ValuePair(Proj_Colombia_3W,	18051)
+ValuePair(Proj_Colombia_Bogota,	18052)
+ValuePair(Proj_Colombia_3E,	18053)
+ValuePair(Proj_Colombia_6E,	18054)
+ValuePair(Proj_Egypt_Red_Belt,	18072)
+ValuePair(Proj_Egypt_Purple_Belt,	18073)
+ValuePair(Proj_Extended_Purple_Belt,	18074)
+ValuePair(Proj_New_Zealand_North_Island_Nat_Grid,	18141)
+ValuePair(Proj_New_Zealand_South_Island_Nat_Grid,	18142)
+ValuePair(Proj_Bahrain_Grid,	19900)
+ValuePair(Proj_Netherlands_E_Indies_Equatorial,	19905)
+ValuePair(Proj_RSO_Borneo,	19912)
+/* end of list */
diff --git a/src/tiff/epsg_units.inc b/src/tiff/epsg_units.inc
new file mode 100644
index 0000000..9aef060
--- /dev/null
+++ b/src/tiff/epsg_units.inc
@@ -0,0 +1,35 @@
+/*
+ * Rev. 0.2 EPSG/POSC Units Database.
+ */
+ 
+#ifdef INCLUDE_OLD_CODES
+#include geo_units.inc
+#endif /* OLD Codes */
+
+ValuePair(Linear_Meter,	9001)
+ValuePair(Linear_Foot,	9002)
+ValuePair(Linear_Foot_US_Survey,	9003)
+ValuePair(Linear_Foot_Modified_American,	9004)
+ValuePair(Linear_Foot_Clarke,	9005)
+ValuePair(Linear_Foot_Indian,	9006)
+ValuePair(Linear_Link,	9007)
+ValuePair(Linear_Link_Benoit,	9008)
+ValuePair(Linear_Link_Sears,	9009)
+ValuePair(Linear_Chain_Benoit,	9010)
+ValuePair(Linear_Chain_Sears,	9011)
+ValuePair(Linear_Yard_Sears,	9012)
+ValuePair(Linear_Yard_Indian,	9013)
+ValuePair(Linear_Fathom,	9014)
+ValuePair(Linear_Mile_International_Nautical,	9015)
+/*
+ *  Angular Units
+ */
+ValuePair(Angular_Radian,	9101)
+ValuePair(Angular_Degree,	9102)
+ValuePair(Angular_Arc_Minute,	9103)
+ValuePair(Angular_Arc_Second,	9104)
+ValuePair(Angular_Grad,	9105)
+ValuePair(Angular_Gon,	9106)
+ValuePair(Angular_DMS,	9107)
+ValuePair(Angular_DMS_Hemisphere,	9108)
+/* end of list */
diff --git a/src/tiff/epsg_vertcs.inc b/src/tiff/epsg_vertcs.inc
new file mode 100644
index 0000000..89e3255
--- /dev/null
+++ b/src/tiff/epsg_vertcs.inc
@@ -0,0 +1,46 @@
+/*
+ *  EPSG/POSC Ellipsoid-referenced Vertical CS
+ *   Note: these should correspond exactly with the Ellipsoid database.
+ */
+ValuePair(VertCS_Airy_1830_ellipsoid,	5001)
+ValuePair(VertCS_Airy_Modified_1849_ellipsoid,	5002)
+ValuePair(VertCS_ANS_ellipsoid,	5003)
+ValuePair(VertCS_Bessel_1841_ellipsoid,	5004)
+ValuePair(VertCS_Bessel_Modified_ellipsoid,	5005)
+ValuePair(VertCS_Bessel_Namibia_ellipsoid,	5006)
+ValuePair(VertCS_Clarke_1858_ellipsoid,	5007)
+ValuePair(VertCS_Clarke_1866_ellipsoid,	5008)
+ValuePair(VertCS_Clarke_1880_Benoit_ellipsoid,	5010)
+ValuePair(VertCS_Clarke_1880_IGN_ellipsoid,	5011)
+ValuePair(VertCS_Clarke_1880_RGS_ellipsoid,	5012)
+ValuePair(VertCS_Clarke_1880_Arc_ellipsoid,	5013)
+ValuePair(VertCS_Clarke_1880_SGA_1922_ellipsoid,	5014)
+ValuePair(VertCS_Everest_1830_1937_Adjustment_ellipsoid,	5015)
+ValuePair(VertCS_Everest_1830_1967_Definition_ellipsoid,	5016)
+ValuePair(VertCS_Everest_1830_1975_Definition_ellipsoid,	5017)
+ValuePair(VertCS_Everest_1830_Modified_ellipsoid,	5018)
+ValuePair(VertCS_GRS_1980_ellipsoid,	5019)
+ValuePair(VertCS_Helmert_1906_ellipsoid,	5020)
+ValuePair(VertCS_INS_ellipsoid,	5021)
+ValuePair(VertCS_International_1924_ellipsoid,	5022)
+ValuePair(VertCS_International_1967_ellipsoid,	5023)
+ValuePair(VertCS_Krassowsky_1940_ellipsoid,	5024)
+ValuePair(VertCS_NWL_9D_ellipsoid,	5025)
+ValuePair(VertCS_NWL_10D_ellipsoid,	5026)
+ValuePair(VertCS_Plessis_1817_ellipsoid,	5027)
+ValuePair(VertCS_Struve_1860_ellipsoid,	5028)
+ValuePair(VertCS_War_Office_ellipsoid,	5029)
+ValuePair(VertCS_WGS_84_ellipsoid,	5030)
+ValuePair(VertCS_GEM_10C_ellipsoid,	5031)
+ValuePair(VertCS_OSU86F_ellipsoid,	5032)
+ValuePair(VertCS_OSU91A_ellipsoid,	5033)
+/*
+ *  Other established Vertical CS
+ */
+ValuePair(VertCS_Newlyn,	5101)
+ValuePair(VertCS_North_American_Vertical_Datum_1929,	5102)
+ValuePair(VertCS_North_American_Vertical_Datum_1988,	5103)
+ValuePair(VertCS_Yellow_Sea_1956,	5104)
+ValuePair(VertCS_Baltic_Sea,	5105)
+ValuePair(VertCS_Caspian_Sea,	5106)
+/* end of list */
diff --git a/src/tiff/fax3sm.c b/src/tiff/fax3sm.c
new file mode 100644
index 0000000..1d0f34a
--- /dev/null
+++ b/src/tiff/fax3sm.c
@@ -0,0 +1,1046 @@
+/* WARNING, this file was automatically generated by the
+    mkg3states program */
+#include "tiff.h"
+#include "tif_fax3.h"
+ const  TIFFFaxTabEnt TIFFFaxMainTable[128] = {
+12,7,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0,
+2,3,0,3,1,0,4,3,1,3,1,0,5,6,2,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,
+1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,5,7,3,3,1,0,5,3,1,3,1,0,
+2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,
+4,6,2,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0,
+2,3,0,3,1,0,4,3,1,3,1,0,6,7,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,
+1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,5,6,2,3,1,0,5,3,1,3,1,0,
+2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,
+4,7,3,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0,
+2,3,0,3,1,0,4,3,1,3,1,0,4,6,2,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,
+1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0
+};
+const TIFFFaxTabEnt TIFFFaxWhiteTable[4096] = {
+12,11,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,
+7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,
+7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,
+7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,
+9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,11,1792,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,
+7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,
+7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,
+7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,
+7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,
+7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,
+7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,
+7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,
+7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,
+7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+11,11,1856,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,
+7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,
+7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,
+7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,
+9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,
+7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5,
+7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,
+7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6,
+7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,11,12,2112,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,
+7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,
+7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,
+7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,
+7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,
+7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,
+7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,
+7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,
+7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,
+9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2368,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,
+7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5,
+7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,
+7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6,
+7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,
+7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,
+7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,
+7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,
+7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,
+7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+11,12,1984,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,
+7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,
+7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,
+7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,
+9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,
+7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,
+7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,
+7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,
+7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,11,11,1920,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,
+7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,
+7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,
+7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,
+7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,
+7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,
+7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,
+7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,
+7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,
+9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2240,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,
+7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,
+7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,
+7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,
+7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,
+7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,
+7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,
+7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,
+7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,
+7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+11,12,2496,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,
+7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,
+7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,
+7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,
+9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,12,11,0,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,
+7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5,
+7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,
+7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6,
+7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,11,11,1792,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,
+7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,
+7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,
+7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,
+7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,
+7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,
+7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,
+7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,
+7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,
+9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,11,1856,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,
+7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5,
+7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,
+7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6,
+7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,
+7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,
+7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,
+7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,
+7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,
+7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+11,12,2176,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,
+7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,
+7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,
+7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,
+9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,
+7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,
+7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,
+7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,
+7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,11,12,2432,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,
+7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,
+7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,
+7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,
+7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,
+7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,
+7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,
+7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,
+7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,
+9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2048,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,
+7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,
+7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,
+7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,
+7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,
+7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,
+7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,
+7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,
+7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,
+7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+11,11,1920,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,
+7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,
+7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,
+7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,
+9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,
+7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5,
+7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,
+7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6,
+7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,11,12,2304,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,
+7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,
+7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,
+7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,
+7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,
+7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,
+7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,
+7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,
+7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,
+7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,
+7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,
+9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,
+7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2560,7,4,3,7,5,11,7,4,5,
+7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,
+7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,
+7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5,
+7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,
+7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,
+7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6,
+7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,
+7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,
+7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,
+7,5,10,7,4,4,7,4,2,7,4,7
+};
+const  TIFFFaxTabEnt TIFFFaxBlackTable[8192] = {
+12,11,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1792,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,11,23,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,20,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,11,25,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,12,128,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,56,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,30,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,11,1856,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,57,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,11,21,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,54,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,52,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,48,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,11,12,2112,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,44,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,36,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,384,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,28,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,60,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,40,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2368,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,12,1984,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,50,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,34,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,13,1664,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,26,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,13,1408,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,32,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,11,11,1920,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,61,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,42,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1024,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,13,768,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,62,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2240,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,46,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,38,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,13,512,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,11,19,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,24,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,11,22,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,12,2496,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,12,11,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,11,11,1792,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,11,23,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,11,20,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,25,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,12,192,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,13,1280,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,31,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1856,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,58,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,21,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,13,896,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,640,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,49,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,12,2176,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,45,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,37,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,12,448,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,29,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,13,1536,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,41,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,11,12,2432,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2048,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,51,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,35,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,12,320,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,27,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,59,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,33,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,11,1920,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,256,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,43,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,13,1152,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,55,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,63,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,11,12,2304,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,47,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,39,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,53,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,11,19,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,11,24,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,11,22,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2560,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,12,11,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,11,1792,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,23,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,11,20,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,11,25,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,128,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,56,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,30,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,11,11,1856,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,57,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,11,21,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,54,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,52,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,48,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2112,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,44,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,36,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,12,384,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,28,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,60,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,40,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,12,2368,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,11,12,1984,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,50,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,34,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1728,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,26,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,13,1472,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,32,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1920,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,61,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,42,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,13,1088,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,832,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,62,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,12,2240,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,46,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,38,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,13,576,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,19,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,11,24,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,22,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,11,12,2496,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+12,11,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1792,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,11,23,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,20,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,11,25,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,12,192,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1344,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,31,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,11,1856,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,58,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,11,21,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,13,960,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,13,704,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,49,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,11,12,2176,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,45,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,37,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,448,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,29,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,13,1600,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,41,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2432,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,12,2048,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,51,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,35,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,12,320,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,27,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,59,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,33,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,11,11,1920,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+10,12,256,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,43,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1216,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,55,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,63,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2304,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,12,47,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,39,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,12,53,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,11,19,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,24,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,11,22,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+11,12,2560,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,
+8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,
+8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,
+8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,
+8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2
+};
diff --git a/src/tiff/geo_config.h b/src/tiff/geo_config.h
new file mode 100644
index 0000000..0c7a7eb
--- /dev/null
+++ b/src/tiff/geo_config.h
@@ -0,0 +1,24 @@
+/* geo_config.h.  Generated automatically by configure.  */
+#ifndef GEO_CONFIG_H
+#define GEO_CONFIG_H
+
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
+
+/* Define if your processor stores words with the most significant
+   byte first (like Motorola and SPARC, unlike Intel and VAX).  */
+/* #undef WORDS_BIGENDIAN */
+
+/* Define if you have the <stdlib.h> header file.  */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the <string.h> header file.  */
+#define HAVE_STRING_H 1
+
+/* Define if you have the <strings.h> header file.  */
+#define HAVE_STRINGS_H 1
+
+/* Build as DLL */
+#define BUILD_AS_DLL      1
+
+#endif /* ndef GEO_CONFIG_H */
diff --git a/src/tiff/geo_ctrans.inc b/src/tiff/geo_ctrans.inc
new file mode 100644
index 0000000..7414280
--- /dev/null
+++ b/src/tiff/geo_ctrans.inc
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * $Id: geo_ctrans.inc 4825 2006-08-16 13:01:53Z lubia $
+ *
+ * Project:  libgeotiff
+ * Purpose:  GeoTIFF Projection Method codes. 
+ * Author:   Frank Warmerdam, warmerdam at pobox.com
+ *
+ ******************************************************************************
+ * Copyright (c) 2005, Frank Warmerdam <warmerdam at pobox.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log$
+ * Revision 1.3  2005/03/04 03:59:11  fwarmerdam
+ * Added header.
+ *
+ */
+
+/* C database for Geotiff include files.   */
+/* the macro ValuePair() must be defined   */
+/* by the enclosing include file           */
+
+/*
+ *  Revised 12 Jul 1995   NDR -- changed South Oriented to a code 
+ *  Revised 28 Sep 1995   NDR -- Added Rev. 1.0 aliases. 
+ */
+
+ValuePair(CT_TransverseMercator,	1)
+ValuePair(CT_TransvMercator_Modified_Alaska, 2)
+ValuePair(CT_ObliqueMercator,	3)
+ValuePair(CT_ObliqueMercator_Laborde,	4)
+ValuePair(CT_ObliqueMercator_Rosenmund,	5)
+ValuePair(CT_ObliqueMercator_Spherical,	6)   /* not advisable */
+ValuePair(CT_Mercator,	7)
+ValuePair(CT_LambertConfConic_2SP,	8)
+ValuePair(CT_LambertConfConic,CT_LambertConfConic_2SP)         /* Alias */
+ValuePair(CT_LambertConfConic_1SP,	9)
+ValuePair(CT_LambertConfConic_Helmert,CT_LambertConfConic_1SP) /* alias */
+ValuePair(CT_LambertAzimEqualArea,	10)
+ValuePair(CT_AlbersEqualArea,	11)
+ValuePair(CT_AzimuthalEquidistant,	12)
+ValuePair(CT_EquidistantConic,	13)
+ValuePair(CT_Stereographic,	14)
+ValuePair(CT_PolarStereographic,	15)
+ValuePair(CT_ObliqueStereographic,	16)   /* not advisable */
+ValuePair(CT_Equirectangular,	17)
+ValuePair(CT_CassiniSoldner,	18)
+ValuePair(CT_Gnomonic,	19)
+ValuePair(CT_MillerCylindrical,	20)
+ValuePair(CT_Orthographic,	21)
+ValuePair(CT_Polyconic,	22)
+ValuePair(CT_Robinson,	23)
+ValuePair(CT_Sinusoidal,	24)
+ValuePair(CT_VanDerGrinten,	25)
+ValuePair(CT_NewZealandMapGrid,	26)
+/* Added for 1.0 */
+ValuePair(CT_TransvMercator_SouthOrientated, 27)
+
+/* Added Feb 2005 */
+ValuePair(CT_CylindricalEqualArea, 28)
+
+
+/* Aliases */
+
+ValuePair(CT_SouthOrientedGaussConformal,CT_TransvMercator_SouthOrientated)
+ValuePair(CT_AlaskaConformal,	CT_TransvMercator_Modified_Alaska)
+ValuePair(CT_TransvEquidistCylindrical,	CT_CassiniSoldner)
+ValuePair(CT_ObliqueMercator_Hotine,	CT_ObliqueMercator)
+ValuePair(CT_SwissObliqueCylindrical,	CT_ObliqueMercator_Rosenmund)
+ValuePair(CT_GaussBoaga,	CT_TransverseMercator)
+ValuePair(CT_GaussKruger,	CT_TransverseMercator)
+ValuePair(CT_TransvMercator_SouthOriented, CT_TransvMercator_SouthOrientated)
+
+
diff --git a/src/tiff/geo_extra.c b/src/tiff/geo_extra.c
new file mode 100644
index 0000000..9e95387
--- /dev/null
+++ b/src/tiff/geo_extra.c
@@ -0,0 +1,747 @@
+/******************************************************************************
+ * $Id: geo_extra.c 4825 2006-08-16 13:01:53Z lubia $
+ *
+ * Project:  libgeotiff
+ * Purpose:  Code to normalize a few common PCS values without use of CSV
+ *           files.
+ * Author:   Frank Warmerdam, warmerda at home.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log$
+ * Revision 1.4  2002/12/01 23:44:34  warmerda
+ * Fixed typo in last fix.
+ *
+ * Revision 1.3  2002/12/01 23:42:06  warmerda
+ * added overrides for two deprecated stateplane zones
+ *
+ * Revision 1.2  1999/05/04 03:09:33  warmerda
+ * avoid warnings
+ *
+ * Revision 1.1  1999/04/28 20:01:29  warmerda
+ * new
+ *
+ */
+
+/*
+#include "geotiff.h"
+#include "geo_tiffp.h"
+#include "geo_keyp.h"
+*/
+
+#include "geo_normalize.h"
+#include "geovalues.h"
+
+static int StatePlaneTable[] = 
+{
+    PCS_NAD83_Alabama_East,		Proj_Alabama_CS83_East,
+    PCS_NAD83_Alabama_West,		Proj_Alabama_CS83_West,
+
+    PCS_NAD83_Alaska_zone_1,		Proj_Alaska_CS83_1,
+    PCS_NAD83_Alaska_zone_2,		Proj_Alaska_CS83_2,
+    PCS_NAD83_Alaska_zone_3,		Proj_Alaska_CS83_3,
+    PCS_NAD83_Alaska_zone_4,		Proj_Alaska_CS83_4,
+    PCS_NAD83_Alaska_zone_5,		Proj_Alaska_CS83_5,
+    PCS_NAD83_Alaska_zone_6,		Proj_Alaska_CS83_6,
+    PCS_NAD83_Alaska_zone_7,		Proj_Alaska_CS83_7,
+    PCS_NAD83_Alaska_zone_8,		Proj_Alaska_CS83_8,
+    PCS_NAD83_Alaska_zone_9,		Proj_Alaska_CS83_9,
+    PCS_NAD83_Alaska_zone_10,		Proj_Alaska_CS83_10,
+
+    PCS_NAD83_California_1,		Proj_California_CS83_1,
+    PCS_NAD83_California_2,		Proj_California_CS83_2,
+    PCS_NAD83_California_3,		Proj_California_CS83_3,
+    PCS_NAD83_California_4,		Proj_California_CS83_4,
+    PCS_NAD83_California_5,		Proj_California_CS83_5,
+    PCS_NAD83_California_6,		Proj_California_CS83_6,
+
+    PCS_NAD83_Arizona_East,		Proj_Arizona_CS83_east,
+    PCS_NAD83_Arizona_Central,		Proj_Arizona_CS83_Central,
+    PCS_NAD83_Arizona_West,		Proj_Arizona_CS83_west,
+
+    PCS_NAD83_Arkansas_North,		Proj_Arkansas_CS83_North,
+    PCS_NAD83_Arkansas_South,		Proj_Arkansas_CS83_South,
+
+    PCS_NAD83_Colorado_North,		Proj_Colorado_CS83_North,
+    PCS_NAD83_Colorado_Central,		Proj_Colorado_CS83_Central,
+    PCS_NAD83_Colorado_South,		Proj_Colorado_CS83_South,
+
+    PCS_NAD83_Connecticut,		Proj_Connecticut_CS83,
+
+    PCS_NAD83_Delaware,			Proj_Delaware_CS83,
+
+    PCS_NAD83_Florida_East,		Proj_Florida_CS83_East,
+    PCS_NAD83_Florida_North,		Proj_Florida_CS83_North,
+    PCS_NAD83_Florida_West,		Proj_Florida_CS83_West,
+
+    PCS_NAD83_Hawaii_zone_1,		Proj_Hawaii_CS83_1,
+    PCS_NAD83_Hawaii_zone_2,		Proj_Hawaii_CS83_2,
+    PCS_NAD83_Hawaii_zone_3,		Proj_Hawaii_CS83_3,
+    PCS_NAD83_Hawaii_zone_4,		Proj_Hawaii_CS83_4,
+    PCS_NAD83_Hawaii_zone_5,		Proj_Hawaii_CS83_5,
+
+    PCS_NAD83_Georgia_East,		Proj_Georgia_CS83_East,
+    PCS_NAD83_Georgia_West,		Proj_Georgia_CS83_West,
+
+    PCS_NAD83_Idaho_East,		Proj_Idaho_CS83_East,
+    PCS_NAD83_Idaho_Central,		Proj_Idaho_CS83_Central,
+    PCS_NAD83_Idaho_West,		Proj_Idaho_CS83_West,
+
+    PCS_NAD83_Illinois_East,		Proj_Illinois_CS83_East,
+    PCS_NAD83_Illinois_West,		Proj_Illinois_CS83_West,
+
+    PCS_NAD83_Indiana_East,		Proj_Indiana_CS83_East,
+    PCS_NAD83_Indiana_West,		Proj_Indiana_CS83_West,
+
+    PCS_NAD83_Iowa_North,      		Proj_Iowa_CS83_North,
+    PCS_NAD83_Iowa_South,      		Proj_Iowa_CS83_South,
+
+    PCS_NAD83_Kansas_North,		Proj_Kansas_CS83_North,
+    PCS_NAD83_Kansas_South,		Proj_Kansas_CS83_South,
+
+    PCS_NAD83_Kentucky_North,		Proj_Kentucky_CS83_North,
+    PCS_NAD83_Kentucky_South,		Proj_Kentucky_CS83_South,
+
+    PCS_NAD83_Louisiana_North,		Proj_Louisiana_CS83_North,
+    PCS_NAD83_Louisiana_South,		Proj_Louisiana_CS83_South,
+
+    PCS_NAD83_Maine_East,		Proj_Maine_CS83_East,
+    PCS_NAD83_Maine_West,		Proj_Maine_CS83_West,
+
+    PCS_NAD83_Maryland,			Proj_Maryland_CS83,
+
+    PCS_NAD83_Massachusetts,		Proj_Massachusetts_CS83_Mainland,
+    PCS_NAD83_Massachusetts_Is,		Proj_Massachusetts_CS83_Island,
+
+    PCS_NAD83_Michigan_North,		Proj_Michigan_CS83_North,
+    PCS_NAD83_Michigan_Central,		Proj_Michigan_CS83_Central,
+    PCS_NAD83_Michigan_South,		Proj_Michigan_CS83_South,
+
+    PCS_NAD83_Minnesota_North,		Proj_Minnesota_CS83_North,
+    PCS_NAD83_Minnesota_Cent,		Proj_Minnesota_CS83_Central,
+    PCS_NAD83_Minnesota_South,		Proj_Minnesota_CS83_South,
+
+    PCS_NAD83_Mississippi_East,		Proj_Mississippi_CS83_East,
+    PCS_NAD83_Mississippi_West,		Proj_Mississippi_CS83_West,
+
+    PCS_NAD83_Missouri_East,		Proj_Missouri_CS83_East,
+    PCS_NAD83_Missouri_Central,		Proj_Missouri_CS83_Central,
+    PCS_NAD83_Missouri_West,		Proj_Missouri_CS83_West,
+
+    PCS_NAD83_Montana,			Proj_Montana_CS83,
+
+    PCS_NAD83_Nebraska,			Proj_Nebraska_CS83,
+
+    PCS_NAD83_Nevada_East,		Proj_Nevada_CS83_East,
+    PCS_NAD83_Nevada_Central,		Proj_Nevada_CS83_Central,
+    PCS_NAD83_Nevada_West,		Proj_Nevada_CS83_West,
+
+    PCS_NAD83_New_Hampshire,		Proj_New_Hampshire_CS83,
+
+    PCS_NAD83_New_Jersey,		Proj_New_Jersey_CS83,
+
+    PCS_NAD83_New_Mexico_East,		Proj_New_Mexico_CS83_East,
+    PCS_NAD83_New_Mexico_Cent,		Proj_New_Mexico_CS83_Central,
+    PCS_NAD83_New_Mexico_West,		Proj_New_Mexico_CS83_West,
+
+    PCS_NAD83_New_York_East,		Proj_New_York_CS83_East,
+    PCS_NAD83_New_York_Central,		Proj_New_York_CS83_Central,
+    PCS_NAD83_New_York_West,		Proj_New_York_CS83_West,
+    PCS_NAD83_New_York_Long_Is,		Proj_New_York_CS83_Long_Island,
+
+    PCS_NAD83_North_Carolina,	       	Proj_North_Carolina_CS83,
+
+    PCS_NAD83_North_Dakota_N,		Proj_North_Dakota_CS83_North,
+    PCS_NAD83_North_Dakota_S,		Proj_North_Dakota_CS83_South,
+
+    PCS_NAD83_Ohio_North,		Proj_Ohio_CS83_North,
+    PCS_NAD83_Ohio_South,		Proj_Ohio_CS83_South,
+
+    PCS_NAD83_Oklahoma_North,		Proj_Oklahoma_CS83_North,
+    PCS_NAD83_Oklahoma_South,		Proj_Oklahoma_CS83_South,
+
+    PCS_NAD83_Oregon_North,		Proj_Oregon_CS83_North,
+    PCS_NAD83_Oregon_South,		Proj_Oregon_CS83_South,
+
+    PCS_NAD83_Pennsylvania_N,		Proj_Pennsylvania_CS83_North,
+    PCS_NAD83_Pennsylvania_S,		Proj_Pennsylvania_CS83_South,
+
+    PCS_NAD83_Rhode_Island,		Proj_Rhode_Island_CS83,
+
+    PCS_NAD83_South_Carolina,		Proj_South_Carolina_CS83,
+
+    PCS_NAD83_South_Dakota_N,		Proj_South_Dakota_CS83_North,
+    PCS_NAD83_South_Dakota_S,		Proj_South_Dakota_CS83_South,
+
+    PCS_NAD83_Tennessee,		Proj_Tennessee_CS83,
+
+    PCS_NAD83_Texas_North,		Proj_Texas_CS83_North,
+    PCS_NAD83_Texas_North_Cen,		Proj_Texas_CS83_North_Central,
+    PCS_NAD83_Texas_Central,		Proj_Texas_CS83_Central,
+    PCS_NAD83_Texas_South_Cen,		Proj_Texas_CS83_South_Central,
+    PCS_NAD83_Texas_South,		Proj_Texas_CS83_South,
+
+    PCS_NAD83_Utah_North,		Proj_Utah_CS83_North,
+    PCS_NAD83_Utah_Central,		Proj_Utah_CS83_Central,
+    PCS_NAD83_Utah_South,		Proj_Utah_CS83_South,
+
+    PCS_NAD83_Vermont,			Proj_Vermont_CS83,
+
+    PCS_NAD83_Virginia_North,		Proj_Virginia_CS83_North,
+    PCS_NAD83_Virginia_South,		Proj_Virginia_CS83_South,
+
+    PCS_NAD83_Washington_North,		Proj_Washington_CS83_North,
+    PCS_NAD83_Washington_South,		Proj_Washington_CS83_South,
+
+    PCS_NAD83_West_Virginia_N,		Proj_West_Virginia_CS83_North,
+    PCS_NAD83_West_Virginia_S,		Proj_West_Virginia_CS83_South,
+
+    PCS_NAD83_Wisconsin_North,		Proj_Wisconsin_CS83_North,
+    PCS_NAD83_Wisconsin_Cen,		Proj_Wisconsin_CS83_Central,
+    PCS_NAD83_Wisconsin_South,		Proj_Wisconsin_CS83_South,
+
+    PCS_NAD83_Wyoming_East,		Proj_Wyoming_CS83_East,
+    PCS_NAD83_Wyoming_E_Cen,		Proj_Wyoming_CS83_East_Central,
+    PCS_NAD83_Wyoming_W_Cen,		Proj_Wyoming_CS83_West_Central,
+    PCS_NAD83_Wyoming_West,		Proj_Wyoming_CS83_West,
+    
+    PCS_NAD83_Puerto_Rico_Virgin_Is,	Proj_Puerto_Rico_Virgin_Is,
+
+    PCS_NAD27_Alabama_East,		Proj_Alabama_CS27_East,
+    PCS_NAD27_Alabama_West,		Proj_Alabama_CS27_West,
+
+    PCS_NAD27_Alaska_zone_1,		Proj_Alaska_CS27_1,
+    PCS_NAD27_Alaska_zone_2,		Proj_Alaska_CS27_2,
+    PCS_NAD27_Alaska_zone_3,		Proj_Alaska_CS27_3,
+    PCS_NAD27_Alaska_zone_4,		Proj_Alaska_CS27_4,
+    PCS_NAD27_Alaska_zone_5,		Proj_Alaska_CS27_5,
+    PCS_NAD27_Alaska_zone_6,		Proj_Alaska_CS27_6,
+    PCS_NAD27_Alaska_zone_7,		Proj_Alaska_CS27_7,
+    PCS_NAD27_Alaska_zone_8,		Proj_Alaska_CS27_8,
+    PCS_NAD27_Alaska_zone_9,		Proj_Alaska_CS27_9,
+    PCS_NAD27_Alaska_zone_10,		Proj_Alaska_CS27_10,
+
+    PCS_NAD27_California_I,		Proj_California_CS27_I,
+    PCS_NAD27_California_II,		Proj_California_CS27_II,
+    PCS_NAD27_California_III,		Proj_California_CS27_III,
+    PCS_NAD27_California_IV,		Proj_California_CS27_IV,
+    PCS_NAD27_California_V,		Proj_California_CS27_V,
+    PCS_NAD27_California_VI,		Proj_California_CS27_VI,
+    PCS_NAD27_California_VII,		Proj_California_CS27_VII,
+
+    PCS_NAD27_Arizona_East,		Proj_Arizona_Coordinate_System_east,
+    PCS_NAD27_Arizona_Central,		Proj_Arizona_Coordinate_System_Central,
+    PCS_NAD27_Arizona_West,		Proj_Arizona_Coordinate_System_west,
+
+    PCS_NAD27_Arkansas_North,		Proj_Arkansas_CS27_North,
+    PCS_NAD27_Arkansas_South,		Proj_Arkansas_CS27_South,
+
+    PCS_NAD27_Colorado_North,		Proj_Colorado_CS27_North,
+    PCS_NAD27_Colorado_Central,		Proj_Colorado_CS27_Central,
+    PCS_NAD27_Colorado_South,		Proj_Colorado_CS27_South,
+
+    PCS_NAD27_Connecticut,		Proj_Connecticut_CS27,
+
+    PCS_NAD27_Delaware,			Proj_Delaware_CS27,
+
+    PCS_NAD27_Florida_East,		Proj_Florida_CS27_East,
+    PCS_NAD27_Florida_North,		Proj_Florida_CS27_North,
+    PCS_NAD27_Florida_West,		Proj_Florida_CS27_West,
+
+    PCS_NAD27_Hawaii_zone_1,		Proj_Hawaii_CS27_1,
+    PCS_NAD27_Hawaii_zone_2,		Proj_Hawaii_CS27_2,
+    PCS_NAD27_Hawaii_zone_3,		Proj_Hawaii_CS27_3,
+    PCS_NAD27_Hawaii_zone_4,		Proj_Hawaii_CS27_4,
+    PCS_NAD27_Hawaii_zone_5,		Proj_Hawaii_CS27_5,
+
+    PCS_NAD27_Georgia_East,		Proj_Georgia_CS27_East,
+    PCS_NAD27_Georgia_West,		Proj_Georgia_CS27_West,
+
+    PCS_NAD27_Idaho_East,		Proj_Idaho_CS27_East,
+    PCS_NAD27_Idaho_Central,		Proj_Idaho_CS27_Central,
+    PCS_NAD27_Idaho_West,		Proj_Idaho_CS27_West,
+
+    PCS_NAD27_Illinois_East,		Proj_Illinois_CS27_East,
+    PCS_NAD27_Illinois_West,		Proj_Illinois_CS27_West,
+
+    PCS_NAD27_Indiana_East,		Proj_Indiana_CS27_East,
+    PCS_NAD27_Indiana_West,		Proj_Indiana_CS27_West,
+
+    PCS_NAD27_Iowa_North,      		Proj_Iowa_CS27_North,
+    PCS_NAD27_Iowa_South,      		Proj_Iowa_CS27_South,
+
+    PCS_NAD27_Kansas_North,		Proj_Kansas_CS27_North,
+    PCS_NAD27_Kansas_South,		Proj_Kansas_CS27_South,
+
+    PCS_NAD27_Kentucky_North,		Proj_Kentucky_CS27_North,
+    PCS_NAD27_Kentucky_South,		Proj_Kentucky_CS27_South,
+
+    PCS_NAD27_Louisiana_North,		Proj_Louisiana_CS27_North,
+    PCS_NAD27_Louisiana_South,		Proj_Louisiana_CS27_South,
+
+    PCS_NAD27_Maine_East,		Proj_Maine_CS27_East,
+    PCS_NAD27_Maine_West,		Proj_Maine_CS27_West,
+
+    PCS_NAD27_Maryland,			Proj_Maryland_CS27,
+
+    PCS_NAD27_Massachusetts,		Proj_Massachusetts_CS27_Mainland,
+    PCS_NAD27_Massachusetts_Is,		Proj_Massachusetts_CS27_Island,
+
+    PCS_NAD27_Michigan_North,		Proj_Michigan_CS27_North,
+    PCS_NAD27_Michigan_Central,		Proj_Michigan_CS27_Central,
+    PCS_NAD27_Michigan_South,		Proj_Michigan_CS27_South,
+
+    PCS_NAD27_Minnesota_North,		Proj_Minnesota_CS27_North,
+    PCS_NAD27_Minnesota_Cent,		Proj_Minnesota_CS27_Central,
+    PCS_NAD27_Minnesota_South,		Proj_Minnesota_CS27_South,
+
+    PCS_NAD27_Mississippi_East,		Proj_Mississippi_CS27_East,
+    PCS_NAD27_Mississippi_West,		Proj_Mississippi_CS27_West,
+
+    PCS_NAD27_Missouri_East,		Proj_Missouri_CS27_East,
+    PCS_NAD27_Missouri_Central,		Proj_Missouri_CS27_Central,
+    PCS_NAD27_Missouri_West,		Proj_Missouri_CS27_West,
+
+    PCS_NAD27_Montana_North,		Proj_Montana_CS27_North,
+    PCS_NAD27_Montana_Central,		Proj_Montana_CS27_Central,
+    PCS_NAD27_Montana_South,		Proj_Montana_CS27_South,
+
+    PCS_NAD27_Nebraska_North,		Proj_Nebraska_CS27_North,
+    PCS_NAD27_Nebraska_South,		Proj_Nebraska_CS27_South,
+
+    PCS_NAD27_Nevada_East,		Proj_Nevada_CS27_East,
+    PCS_NAD27_Nevada_Central,		Proj_Nevada_CS27_Central,
+    PCS_NAD27_Nevada_West,		Proj_Nevada_CS27_West,
+
+    PCS_NAD27_New_Hampshire,		Proj_New_Hampshire_CS27,
+
+    PCS_NAD27_New_Jersey,		Proj_New_Jersey_CS27,
+
+    PCS_NAD27_New_Mexico_East,		Proj_New_Mexico_CS27_East,
+    PCS_NAD27_New_Mexico_Cent,		Proj_New_Mexico_CS27_Central,
+    PCS_NAD27_New_Mexico_West,		Proj_New_Mexico_CS27_West,
+
+    PCS_NAD27_New_York_East,		Proj_New_York_CS27_East,
+    PCS_NAD27_New_York_Central,		Proj_New_York_CS27_Central,
+    PCS_NAD27_New_York_West,		Proj_New_York_CS27_West,
+    PCS_NAD27_New_York_Long_Is,		Proj_New_York_CS27_Long_Island,
+
+    PCS_NAD27_North_Carolina,	       	Proj_North_Carolina_CS27,
+
+    PCS_NAD27_North_Dakota_N,		Proj_North_Dakota_CS27_North,
+    PCS_NAD27_North_Dakota_S,		Proj_North_Dakota_CS27_South,
+
+    PCS_NAD27_Ohio_North,		Proj_Ohio_CS27_North,
+    PCS_NAD27_Ohio_South,		Proj_Ohio_CS27_South,
+
+    PCS_NAD27_Oklahoma_North,		Proj_Oklahoma_CS27_North,
+    PCS_NAD27_Oklahoma_South,		Proj_Oklahoma_CS27_South,
+
+    PCS_NAD27_Oregon_North,		Proj_Oregon_CS27_North,
+    PCS_NAD27_Oregon_South,		Proj_Oregon_CS27_South,
+
+    PCS_NAD27_Pennsylvania_N,		Proj_Pennsylvania_CS27_North,
+    PCS_NAD27_Pennsylvania_S,		Proj_Pennsylvania_CS27_South,
+
+    PCS_NAD27_Rhode_Island,		Proj_Rhode_Island_CS27,
+
+    PCS_NAD27_South_Carolina_N,		Proj_South_Carolina_CS27_North,
+    PCS_NAD27_South_Carolina_S,		Proj_South_Carolina_CS27_South,
+
+    PCS_NAD27_South_Dakota_N,		Proj_South_Dakota_CS27_North,
+    PCS_NAD27_South_Dakota_S,		Proj_South_Dakota_CS27_South,
+
+    PCS_NAD27_Tennessee,		Proj_Tennessee_CS27,
+
+    PCS_NAD27_Texas_North,		Proj_Texas_CS27_North,
+    PCS_NAD27_Texas_North_Cen,		Proj_Texas_CS27_North_Central,
+    PCS_NAD27_Texas_Central,		Proj_Texas_CS27_Central,
+    PCS_NAD27_Texas_South_Cen,		Proj_Texas_CS27_South_Central,
+    PCS_NAD27_Texas_South,		Proj_Texas_CS27_South,
+
+    PCS_NAD27_Utah_North,		Proj_Utah_CS27_North,
+    PCS_NAD27_Utah_Central,		Proj_Utah_CS27_Central,
+    PCS_NAD27_Utah_South,		Proj_Utah_CS27_South,
+
+    PCS_NAD27_Vermont,			Proj_Vermont_CS27,
+
+    PCS_NAD27_Virginia_North,		Proj_Virginia_CS27_North,
+    PCS_NAD27_Virginia_South,		Proj_Virginia_CS27_South,
+
+    PCS_NAD27_Washington_North,		Proj_Washington_CS27_North,
+    PCS_NAD27_Washington_South,		Proj_Washington_CS27_South,
+
+    PCS_NAD27_West_Virginia_N,		Proj_West_Virginia_CS27_North,
+    PCS_NAD27_West_Virginia_S,		Proj_West_Virginia_CS27_South,
+
+    PCS_NAD27_Wisconsin_North,		Proj_Wisconsin_CS27_North,
+    PCS_NAD27_Wisconsin_Cen,		Proj_Wisconsin_CS27_Central,
+    PCS_NAD27_Wisconsin_South,		Proj_Wisconsin_CS27_South,
+
+    PCS_NAD27_Wyoming_East,		Proj_Wyoming_CS27_East,
+    PCS_NAD27_Wyoming_E_Cen,		Proj_Wyoming_CS27_East_Central,
+    PCS_NAD27_Wyoming_W_Cen,		Proj_Wyoming_CS27_West_Central,
+    PCS_NAD27_Wyoming_West,		Proj_Wyoming_CS27_West,
+    
+    PCS_NAD27_Puerto_Rico,		Proj_Puerto_Rico_CS27,
+
+    KvUserDefined
+};
+
+/************************************************************************/
+/*                          GTIFMapSysToPCS()                           */
+/*                                                                      */
+/*      Given a Datum, MapSys and zone value generate the best PCS      */
+/*      code possible.                                                  */
+/************************************************************************/
+
+int	GTIFMapSysToPCS( int MapSys, int Datum, int nZone )
+
+{
+    int		PCSCode = KvUserDefined;
+
+    if( MapSys == MapSys_UTM_North )
+    {
+	if( Datum == GCS_NAD27 )
+	    PCSCode = PCS_NAD27_UTM_zone_3N + nZone - 3;
+	else if( Datum == GCS_NAD83 )
+	    PCSCode = PCS_NAD83_UTM_zone_3N + nZone - 3;
+	else if( Datum == GCS_WGS_72 )
+	    PCSCode = PCS_WGS72_UTM_zone_1N + nZone - 1;
+	else if( Datum == GCS_WGS_72BE )
+	    PCSCode = PCS_WGS72BE_UTM_zone_1N + nZone - 1;
+	else if( Datum == GCS_WGS_84 )
+	    PCSCode = PCS_WGS84_UTM_zone_1N + nZone - 1;
+    }
+    else if( MapSys == MapSys_UTM_South )
+    {
+	if( Datum == GCS_WGS_72 )
+	    PCSCode = PCS_WGS72_UTM_zone_1S + nZone - 1;
+	else if( Datum == GCS_WGS_72BE )
+	    PCSCode = PCS_WGS72BE_UTM_zone_1S + nZone - 1;
+	else if( Datum == GCS_WGS_84 )
+	    PCSCode = PCS_WGS84_UTM_zone_1S + nZone - 1;
+    }
+    else if( MapSys == MapSys_State_Plane_27 )
+    {
+	int		i;
+
+        PCSCode = 10000 + nZone;
+	for( i = 0; StatePlaneTable[i] != KvUserDefined; i += 2 )
+	{
+	    if( StatePlaneTable[i+1] == PCSCode )
+	        PCSCode = StatePlaneTable[i];
+	}
+
+        /* Old EPSG code was in error for Tennesse CS27, override */
+        if( nZone == 4100 )
+            PCSCode = 2204;
+    }
+    else if( MapSys == MapSys_State_Plane_83 )
+    {
+	int		i;
+
+        PCSCode = 10000 + nZone + 30;
+
+	for( i = 0; StatePlaneTable[i] != KvUserDefined; i += 2 )
+	{
+	    if( StatePlaneTable[i+1] == PCSCode )
+	        PCSCode = StatePlaneTable[i];
+	}
+
+        /* Old EPSG code was in error for Kentucky North CS83, override */
+        if( nZone == 1601 )
+            PCSCode = 2205;
+    }
+
+    return( PCSCode );
+}
+
+/************************************************************************/
+/*                          GTIFMapSysToProj()                          */
+/*                                                                      */
+/*      Given a MapSys and zone value generate the best Proj_           */
+/*      code possible.                                                  */
+/************************************************************************/
+
+int	GTIFMapSysToProj( int MapSys, int nZone )
+
+{
+    int		ProjCode = KvUserDefined;
+
+    if( MapSys == MapSys_UTM_North )
+    {
+        ProjCode = Proj_UTM_zone_1N + nZone - 1;
+    }
+    else if( MapSys == MapSys_UTM_South )
+    {
+        ProjCode = Proj_UTM_zone_1S + nZone - 1;
+    }
+    else if( MapSys == MapSys_State_Plane_27 )
+    {
+        ProjCode = 10000 + nZone;
+
+        /* Tennesse override */
+        if( nZone == 4100 )
+            ProjCode = 15302;
+    }
+    else if( MapSys == MapSys_State_Plane_83 )
+    {
+        ProjCode = 10000 + nZone + 30;
+
+        /* Kentucky North override */
+        if( nZone == 1601 )
+            ProjCode = 15303;
+    }
+
+    return( ProjCode );
+}
+
+/************************************************************************/
+/*                          GTIFPCSToMapSys()                           */
+/************************************************************************/
+
+/**
+ * Translate a PCS_ code into a UTM or State Plane map system, a datum,
+ * and a zone if possible.
+ *
+ * @param PCSCode The projection code (PCS_*) as would be stored in the
+ * ProjectedCSTypeGeoKey of a GeoTIFF file.
+ *
+ * @param pDatum Pointer to an integer into which the datum code (GCS_*)
+ * is put if the function succeeds.
+ *
+ * @param pZone Pointer to an integer into which the zone will be placed
+ * if the function is successful.
+ *
+ * @return Returns either MapSys_UTM_North, MapSys_UTM_South,
+ * MapSys_State_Plane_83, MapSys_State_Plane_27 or KvUserDefined.
+ * KvUserDefined indicates that the
+ * function failed to recognise the projection as UTM or State Plane.
+ *
+ * The zone value is only set if the return code is other than KvUserDefined.
+ * For utm map system the returned zone will be between 1 and 60.  For
+ * State Plane, the USGS state plane zone number is returned.  For instance,
+ * Alabama East is zone 101.
+ *
+ * The datum (really this is the GCS) is set to a GCS_ value such as GCS_NAD27.
+ *
+ * This function is useful to recognise (most) UTM and State Plane coordinate
+ * systems, even if CSV files aren't available to translate them automatically.
+ * It is used as a fallback mechanism by GTIFGetDefn() for normalization when
+ * CSV files aren't found. 
+ */
+
+int GTIFPCSToMapSys( int PCSCode, int * pDatum, int * pZone )
+
+{
+    int		Datum = KvUserDefined, Proj = KvUserDefined;
+    int		nZone = KvUserDefined, i;
+
+/* -------------------------------------------------------------------- */
+/*      UTM with various datums.  Note there are lots of PCS UTM        */
+/*      codes not done yet which use strange datums.                    */
+/* -------------------------------------------------------------------- */
+    if( PCSCode >= PCS_NAD27_UTM_zone_3N && PCSCode <= PCS_NAD27_UTM_zone_22N )
+    {
+	Datum = GCS_NAD27;
+	Proj = MapSys_UTM_North;
+	nZone = PCSCode - PCS_NAD27_UTM_zone_3N + 3;
+    }
+    else if( PCSCode >= PCS_NAD83_UTM_zone_3N 
+	     && PCSCode <= PCS_NAD83_UTM_zone_23N )
+    {
+	Datum = GCS_NAD83;
+	Proj = MapSys_UTM_North;
+	nZone = PCSCode - PCS_NAD83_UTM_zone_3N + 3;
+    }
+
+    else if( PCSCode >= PCS_WGS72_UTM_zone_1N
+	     && PCSCode <= PCS_WGS72_UTM_zone_60N )
+    {
+	Datum = GCS_WGS_72;
+	Proj = MapSys_UTM_North;
+	nZone = PCSCode - PCS_WGS72_UTM_zone_1N + 1;
+    }
+    else if( PCSCode >= PCS_WGS72_UTM_zone_1S
+	     && PCSCode <= PCS_WGS72_UTM_zone_60S )
+    {
+	Datum = GCS_WGS_72;
+	Proj = MapSys_UTM_South;
+	nZone = PCSCode - PCS_WGS72_UTM_zone_1S + 1;
+    }
+
+    else if( PCSCode >= PCS_WGS72BE_UTM_zone_1N
+	     && PCSCode <= PCS_WGS72BE_UTM_zone_60N )
+    {
+	Datum = GCS_WGS_72BE;
+	Proj = MapSys_UTM_North;
+	nZone = PCSCode - PCS_WGS72BE_UTM_zone_1N + 1;
+    }
+    else if( PCSCode >= PCS_WGS72BE_UTM_zone_1S
+	     && PCSCode <= PCS_WGS72BE_UTM_zone_60S )
+    {
+	Datum = GCS_WGS_72BE;
+	Proj = MapSys_UTM_South;
+	nZone = PCSCode - PCS_WGS72BE_UTM_zone_1S + 1;
+    }
+
+    else if( PCSCode >= PCS_WGS84_UTM_zone_1N
+	     && PCSCode <= PCS_WGS84_UTM_zone_60N )
+    {
+	Datum = GCS_WGS_84;
+	Proj = MapSys_UTM_North;
+	nZone = PCSCode - PCS_WGS84_UTM_zone_1N + 1;
+    }
+    else if( PCSCode >= PCS_WGS84_UTM_zone_1S
+	     && PCSCode <= PCS_WGS84_UTM_zone_60S )
+    {
+	Datum = GCS_WGS_84;
+	Proj = MapSys_UTM_South;
+	nZone = PCSCode - PCS_WGS84_UTM_zone_1S + 1;
+    }
+    else if( PCSCode >= PCS_SAD69_UTM_zone_18N 
+	     && PCSCode <= PCS_SAD69_UTM_zone_22N )
+    {
+	Datum = KvUserDefined;
+	Proj = MapSys_UTM_North;
+	nZone = PCSCode - PCS_SAD69_UTM_zone_18N + 18;
+    }
+    else if( PCSCode >= PCS_SAD69_UTM_zone_17S
+	     && PCSCode <= PCS_SAD69_UTM_zone_25S )
+    {
+	Datum = KvUserDefined;
+	Proj = MapSys_UTM_South;
+	nZone = PCSCode - PCS_SAD69_UTM_zone_17S + 17;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      State Plane zones, first we translate any PCS_ codes to		*/
+/*	a Proj_ code that we can get a handle on.			*/
+/* -------------------------------------------------------------------- */
+    for( i = 0; StatePlaneTable[i] != KvUserDefined; i += 2 )
+    {
+	if( StatePlaneTable[i] == PCSCode )
+	    PCSCode = StatePlaneTable[i+1];
+    }
+
+    if( PCSCode <= 15900 && PCSCode >= 10000 )
+    {
+	if( (PCSCode % 100) >= 30 )
+        {
+            Proj = MapSys_State_Plane_83;
+	    Datum = GCS_NAD83;
+        }
+	else
+        {
+            Proj = MapSys_State_Plane_27;
+	    Datum = GCS_NAD27;
+        }
+	
+	nZone = PCSCode - 10000;
+	if( Datum == GCS_NAD83 )
+	    nZone -= 30;
+    }
+
+    if( pDatum != NULL )
+        *pDatum = Datum;
+
+    if( pZone != NULL )
+        *pZone = nZone;
+
+    return( Proj );
+}
+
+/************************************************************************/
+/*                          GTIFProjToMapSys()                          */
+/************************************************************************/
+
+/**
+ * Translate a Proj_ code into a UTM or State Plane map system, and a zone
+ * if possible.
+ *
+ * @param ProjCode The projection code (Proj_*) as would be stored in the
+ * ProjectionGeoKey of a GeoTIFF file.
+ * @param pZone Pointer to an integer into which the zone will be placed
+ * if the function is successful.
+ *
+ * @return Returns either MapSys_UTM_North, MapSys_UTM_South,
+ * MapSys_State_Plane_27, MapSys_State_Plane_83 or KvUserDefined.
+ * KvUserDefined indicates that the
+ * function failed to recognise the projection as UTM or State Plane.
+ *
+ * The zone value is only set if the return code is other than KvUserDefined.
+ * For utm map system the returned zone will be between 1 and 60.  For
+ * State Plane, the USGS state plane zone number is returned.  For instance,
+ * Alabama East is zone 101.
+ *
+ * This function is useful to recognise UTM and State Plane coordinate
+ * systems, and to extract zone numbers so the projections can be
+ * represented as UTM rather than as the underlying projection method such
+ * Transverse Mercator for instance.
+ */
+
+int GTIFProjToMapSys( int ProjCode, int * pZone )
+
+{
+    int		nZone = KvUserDefined;
+    int		MapSys = KvUserDefined;
+
+/* -------------------------------------------------------------------- */
+/*      Handle UTM.                                                     */
+/* -------------------------------------------------------------------- */
+    if( ProjCode >= Proj_UTM_zone_1N && ProjCode <= Proj_UTM_zone_60N )
+    {
+	MapSys = MapSys_UTM_North;
+	nZone = ProjCode - Proj_UTM_zone_1N + 1;
+    }
+    else if( ProjCode >= Proj_UTM_zone_1S && ProjCode <= Proj_UTM_zone_60S )
+    {
+	MapSys = MapSys_UTM_South;
+	nZone = ProjCode - Proj_UTM_zone_1S + 1;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Handle State Plane.  I think there are some anomolies in        */
+/*      here, so this is a bit risky.                                   */
+/* -------------------------------------------------------------------- */
+    else if( ProjCode >= 10101 && ProjCode <= 15299 )
+    {
+        if( ProjCode % 100 >= 30 )
+        {
+            MapSys = MapSys_State_Plane_83;
+            nZone = ProjCode - 10000 - 30;
+        }
+        else
+        {
+            MapSys = MapSys_State_Plane_27;
+            nZone = ProjCode - 10000;
+        }
+    }
+    
+    if( pZone != NULL )
+        *pZone = nZone;
+
+    return( MapSys );
+}
+
diff --git a/src/tiff/geo_free.c b/src/tiff/geo_free.c
new file mode 100644
index 0000000..5618d43
--- /dev/null
+++ b/src/tiff/geo_free.c
@@ -0,0 +1,62 @@
+/**********************************************************************
+ *
+ *  geo_free.c  -- Public routines for GEOTIFF GeoKey access.
+ *
+ *    Written By: Niles D. Ritter.
+ *
+ *  copyright (c) 1995   Niles D. Ritter
+ *
+ *  Permission granted to use this software, so long as this copyright
+ *  notice accompanies any products derived therefrom.
+ *
+ **********************************************************************/
+
+#include "geotiff.h"   /* public interface        */
+#include "geo_tiffp.h" /* external TIFF interface */
+#include "geo_keyp.h"  /* private interface       */
+
+
+/**********************************************************************
+ *
+ *                        Public Routines
+ *
+ **********************************************************************/
+
+/**
+  
+This function deallocates an existing GeoTIFF access handle previously
+created with GTIFNew().  If the handle was
+used to write GeoTIFF keys to the TIFF file, the 
+GTIFWriteKeys() function should be used
+to flush results to the file before calling GTIFFree().  GTIFFree()
+should be called before XTIFFClose() is
+called on the corresponding TIFF file handle.<p>
+
+*/
+
+void GTIFFree(GTIF* gtif)
+{
+    int     i;
+	
+    if (!gtif) return;
+	
+    /* Free parameter arrays */
+    if (gtif->gt_double) _GTIFFree (gtif->gt_double);
+    if (gtif->gt_short) _GTIFFree (gtif->gt_short);
+	
+    /* Free GeoKey arrays */
+    if (gtif->gt_keys)
+    {
+        for (i = 0; i < MAX_KEYS; i++)
+        {
+            if (gtif->gt_keys[i].gk_type == TYPE_ASCII)
+            {
+                _GTIFFree (gtif->gt_keys[i].gk_data);
+            }
+        }
+        _GTIFFree (gtif->gt_keys);
+    }
+    if (gtif->gt_keyindex) _GTIFFree (gtif->gt_keyindex);
+	
+    _GTIFFree (gtif);
+}
diff --git a/src/tiff/geo_get.c b/src/tiff/geo_get.c
new file mode 100644
index 0000000..61f560b
--- /dev/null
+++ b/src/tiff/geo_get.c
@@ -0,0 +1,176 @@
+/**********************************************************************
+ *
+ *  geo_get.c  -- Public routines for GEOTIFF GeoKey access.
+ *
+ *    Written By: Niles D. Ritter.
+ *
+ *  copyright (c) 1995   Niles D. Ritter
+ *
+ *  Permission granted to use this software, so long as this copyright
+ *  notice accompanies any products derived therefrom.
+ *
+ *  Revision History;
+ *
+ *    20 June, 1995      Niles D. Ritter         New
+ *    3 July,  1995      Greg Martin             Fix strings and index
+ *    6 July,  1995      Niles D. Ritter         Unfix indexing.
+ *
+ **********************************************************************/
+
+#include "geotiff.h"   /* public interface        */
+#include "geo_tiffp.h" /* external TIFF interface */
+#include "geo_keyp.h"  /* private interface       */
+
+/* return the Header info of this geotiff file */
+
+void GTIFDirectoryInfo(GTIF *gtif, int version[3], int *keycount)
+{
+        if (version)
+        {
+                version[0]  = gtif->gt_version;
+                version[1]  = gtif->gt_rev_major;
+                version[2]  = gtif->gt_rev_minor;
+        }
+        if (keycount) *keycount = gtif->gt_num_keys;
+}
+
+
+int GTIFKeyInfo(GTIF *gtif, geokey_t key, int *size, tagtype_t* type)
+{
+        int index = gtif->gt_keyindex[ key ];
+        GeoKey *keyptr;
+
+        if (!index) return 0;
+
+        keyptr = gtif->gt_keys + index;
+        if (size) *size = (int) keyptr->gk_size;
+        if (type) *type = keyptr->gk_type;
+
+        return keyptr->gk_count;
+}
+
+/** 
+
+This function reads the value of a single GeoKey from a GeoTIFF file.
+
+ at param gtif The geotiff information handle from GTIFNew().
+
+ at param thekey The geokey_t name (such as ProjectedCSTypeGeoKey).
+This must come from the list of legal geokey_t values
+(an enumeration) listed below.
+
+ at param val The <b>val</b> argument is a pointer to the
+variable into which the value should be read.  The type of the variable
+varies depending on the geokey_t given.  While there is no ready mapping
+of geokey_t values onto types, in general code values are of type <i>short</i>,
+citations are strings, and everything else is of type <i>double</i>.  Note
+that pointer's to <i>int</i> should never be passed to GTIFKeyGet() for
+integer values as they will be shorts, and the int's may not be properly
+initialized (and will be grossly wrong on MSB systems).
+
+ at param index Indicates how far into the list of values
+for this geokey to offset. Should normally be zero.
+
+ at param count Indicates how many values
+to read.  At this time all keys except for strings have only one value,
+so <b>index</b> should be zero, and <b>count</b> should be one.
+
+ at return The GTIFKeyGet() function returns the number of values read.  Normally
+this would be one if successful or zero if the key doesn't exist for this
+file.
+
+From geokeys.inc we see the following geokey_t values are possible:<p>
+
+<pre>
+-- 6.2.1 GeoTIFF Configuration Keys --
+
+ValuePair(  GTModelTypeGeoKey,	1024) -- Section 6.3.1.1 Codes       --
+ValuePair(  GTRasterTypeGeoKey,	1025) -- Section 6.3.1.2 Codes       --
+ValuePair(  GTCitationGeoKey,	1026) -- documentation --
+
+-- 6.2.2 Geographic CS Parameter Keys --
+
+ValuePair(  GeographicTypeGeoKey,	2048) -- Section 6.3.2.1 Codes     --
+ValuePair(  GeogCitationGeoKey,	2049) -- documentation             --
+ValuePair(  GeogGeodeticDatumGeoKey,	2050) -- Section 6.3.2.2 Codes     --
+ValuePair(  GeogPrimeMeridianGeoKey,	2051) -- Section 6.3.2.4 codes     --
+ValuePair(  GeogLinearUnitsGeoKey,	2052) -- Section 6.3.1.3 Codes     --
+ValuePair(  GeogLinearUnitSizeGeoKey,	2053) -- meters                    --
+ValuePair(  GeogAngularUnitsGeoKey,	2054) -- Section 6.3.1.4 Codes     --
+ValuePair(  GeogAngularUnitSizeGeoKey,	2055) -- radians                   --
+ValuePair(  GeogEllipsoidGeoKey,	2056) -- Section 6.3.2.3 Codes     --
+ValuePair(  GeogSemiMajorAxisGeoKey,	2057) -- GeogLinearUnits           --
+ValuePair(  GeogSemiMinorAxisGeoKey,	2058) -- GeogLinearUnits           --
+ValuePair(  GeogInvFlatteningGeoKey,	2059) -- ratio                     --
+ValuePair(  GeogAzimuthUnitsGeoKey,	2060) -- Section 6.3.1.4 Codes     --
+ValuePair(  GeogPrimeMeridianLongGeoKey,	2061) -- GeoAngularUnit            --
+
+-- 6.2.3 Projected CS Parameter Keys --
+--    Several keys have been renamed,--
+--    and the deprecated names aliased for backward compatibility --
+
+ValuePair(  ProjectedCSTypeGeoKey,	3072)     -- Section 6.3.3.1 codes   --
+ValuePair(  PCSCitationGeoKey,	3073)     -- documentation           --
+ValuePair(  ProjectionGeoKey,	3074)     -- Section 6.3.3.2 codes   --
+ValuePair(  ProjCoordTransGeoKey,	3075)     -- Section 6.3.3.3 codes   --
+ValuePair(  ProjLinearUnitsGeoKey,	3076)     -- Section 6.3.1.3 codes   --
+ValuePair(  ProjLinearUnitSizeGeoKey,	3077)     -- meters                  --
+ValuePair(  ProjStdParallel1GeoKey,	3078)     -- GeogAngularUnit --
+ValuePair(  ProjStdParallelGeoKey,ProjStdParallel1GeoKey) -- ** alias **   --
+ValuePair(  ProjStdParallel2GeoKey,	3079)     -- GeogAngularUnit --
+ValuePair(  ProjNatOriginLongGeoKey,	3080)     -- GeogAngularUnit --
+ValuePair(  ProjOriginLongGeoKey,ProjNatOriginLongGeoKey) -- ** alias **     --
+ValuePair(  ProjNatOriginLatGeoKey,	3081)     -- GeogAngularUnit --
+ValuePair(  ProjOriginLatGeoKey,ProjNatOriginLatGeoKey)   -- ** alias **     --
+ValuePair(  ProjFalseEastingGeoKey,	3082)     -- ProjLinearUnits --
+ValuePair(  ProjFalseNorthingGeoKey,	3083)     -- ProjLinearUnits --
+ValuePair(  ProjFalseOriginLongGeoKey,	3084)     -- GeogAngularUnit --
+ValuePair(  ProjFalseOriginLatGeoKey,	3085)     -- GeogAngularUnit --
+ValuePair(  ProjFalseOriginEastingGeoKey,	3086)     -- ProjLinearUnits --
+ValuePair(  ProjFalseOriginNorthingGeoKey,	3087)     -- ProjLinearUnits --
+ValuePair(  ProjCenterLongGeoKey,	3088)     -- GeogAngularUnit --
+ValuePair(  ProjCenterLatGeoKey,	3089)     -- GeogAngularUnit --
+ValuePair(  ProjCenterEastingGeoKey,	3090)     -- ProjLinearUnits --
+ValuePair(  ProjCenterNorthingGeoKey,	3091)     -- ProjLinearUnits --
+ValuePair(  ProjScaleAtNatOriginGeoKey,	3092)     -- ratio   --
+ValuePair(  ProjScaleAtOriginGeoKey,ProjScaleAtNatOriginGeoKey)  -- ** alias **   --
+ValuePair(  ProjScaleAtCenterGeoKey,	3093)     -- ratio   --
+ValuePair(  ProjAzimuthAngleGeoKey,	3094)     -- GeogAzimuthUnit --
+ValuePair(  ProjStraightVertPoleLongGeoKey,	3095)     -- GeogAngularUnit --
+
+ 6.2.4 Vertical CS Keys 
+   
+ValuePair(  VerticalCSTypeGeoKey,	4096)  -- Section 6.3.4.1 codes   --
+ValuePair(  VerticalCitationGeoKey,	4097)  -- documentation --
+ValuePair(  VerticalDatumGeoKey,	4098)  -- Section 6.3.4.2 codes   --
+ValuePair(  VerticalUnitsGeoKey,	4099)  -- Section 6.3.1 (.x) codes   --
+</pre>
+*/
+
+int GTIFKeyGet(GTIF *gtif, geokey_t thekey, void *val, int index, int count)
+{
+        int kindex = gtif->gt_keyindex[ thekey ];
+        GeoKey *key;
+        gsize_t size;
+        char *data;
+        tagtype_t type;
+
+        if (!kindex) return 0;
+
+        key = gtif->gt_keys+kindex;
+        if (!count) count = key->gk_count - index;
+        if (count <=0) return 0;
+        if (count > key->gk_count) count = key->gk_count;
+        size = key->gk_size;
+        type = key->gk_type;
+
+        if (count==1 && type==TYPE_SHORT) data = (char *)&key->gk_data;
+        else data = key->gk_data;
+
+        _GTIFmemcpy( val, data + index*size, count*size );
+
+        if (type==TYPE_ASCII)
+           ((char *)val)[count-1] = '\0'; /* replace last char with NULL */
+
+        return count;
+}
diff --git a/src/tiff/geo_keyp.h b/src/tiff/geo_keyp.h
new file mode 100644
index 0000000..0cdb9a6
--- /dev/null
+++ b/src/tiff/geo_keyp.h
@@ -0,0 +1,98 @@
+/**********************************************************************
+ *
+ *  geo_keyp.h - private interface for GeoTIFF geokey tag parsing
+ *
+ *     Written by: Niles D. Ritter
+ *
+ **********************************************************************/
+
+#ifndef __geo_keyp_h_
+#define __geo_keyp_h_
+
+#include <stdlib.h> /* for size_t */
+
+/*
+ * This structure contains the internal program
+ * representation of the key entry.
+ */
+struct GeoKey {
+	int       gk_key;    /* GeoKey ID        */
+	size_t    gk_size;   /* data byte size   */
+	tagtype_t gk_type;   /* TIFF data type   */
+	long      gk_count;  /* number of values */
+	char*     gk_data;   /* pointer to data, or value */
+};
+typedef struct GeoKey GeoKey;
+
+/*
+ *  This structure represents the file-organization of
+ *  the key entry. Note that it assumes that short entries
+ *  are aligned along 2-byte boundaries.
+ */
+struct KeyEntry {
+	pinfo_t ent_key;        /* GeoKey ID            */
+	pinfo_t ent_location;   /* TIFF Tag ID or 0     */
+	pinfo_t ent_count;      /* GeoKey value count   */
+	pinfo_t ent_val_offset; /* value or tag offset  */
+};
+typedef struct KeyEntry KeyEntry;
+
+/*
+ * This is the header of the CoordSystemInfoTag. The 'Version'
+ *  will only change if the CoorSystemInfoTag structure changes;
+ *  The Major Revision will be incremented whenever a new set of
+ *  Keys is added or changed, while the Minor revision will be
+ *  incremented when only the set of Key-values is increased.
+ */
+struct KeyHeader{
+	pinfo_t hdr_version;      /* GeoTIFF Version          */
+	pinfo_t hdr_rev_major;    /* GeoKey Major Revision #  */
+	pinfo_t hdr_rev_minor;    /* GeoKey Minor Revision #  */
+	pinfo_t hdr_num_keys;     /* Number of GeoKeys        */
+};
+typedef struct KeyHeader KeyHeader;
+
+/*
+ * This structure holds temporary data while reading or writing
+ *  the tags.
+ */
+struct TempKeyData {
+    char   *tk_asciiParams;
+    int     tk_asciiParamsLength;
+    int     tk_asciiParamsOffset;
+};
+typedef struct TempKeyData TempKeyData;
+
+
+struct gtiff {
+   tiff_t*    gt_tif;      /* TIFF file descriptor  */
+   TIFFMethod gt_methods;  /* TIFF i/o methods      */
+   int        gt_flags;    /* file flags            */
+   
+   pinfo_t    gt_version;  /* GeoTIFF Version       */
+   pinfo_t    gt_rev_major;/* GeoKey Key Revision   */
+   pinfo_t    gt_rev_minor;/* GeoKey Code Revision  */
+   
+   int        gt_num_keys; /* number of keys        */
+   GeoKey*    gt_keys;     /* array of keys         */
+   int*       gt_keyindex; /* index of a key, if set*/
+   int        gt_keymin;   /* smallest key set      */
+   int        gt_keymax;   /* largest key set       */
+   
+   pinfo_t*   gt_short;    /* array of SHORT vals   */
+   double*    gt_double;   /* array of DOUBLE vals  */
+   int        gt_nshorts;  /* number of SHORT vals  */
+   int        gt_ndoubles; /* number of DOUBLE vals */
+};  
+
+typedef enum {
+	FLAG_FILE_OPEN=1,
+	FLAG_FILE_MODIFIED=2
+} gtiff_flags;
+
+#define MAX_KEYINDEX 65535   /* largest possible key    */
+#define MAX_KEYS 100         /* maximum keys in a file  */
+#define MAX_VALUES 1000      /* maximum values in a tag */
+
+#endif /* __geo_keyp_h_ */
+
diff --git a/src/tiff/geo_names.c b/src/tiff/geo_names.c
new file mode 100644
index 0000000..0e4c652
--- /dev/null
+++ b/src/tiff/geo_names.c
@@ -0,0 +1,175 @@
+/*
+ * geo_names.c
+ *
+ *  This encapsulates all of the value-naming mechanism of 
+ *  libgeotiff. 
+ *
+ *  Written By: Niles Ritter
+ */
+
+#include "geotiffio.h"
+#include "geonames.h"
+#include "geo_tiffp.h" /* for tag names */
+
+static KeyInfo _formatInfo[] =  {
+   {TYPE_BYTE,    "Byte"},
+   {TYPE_SHORT,   "Short"},
+   {TYPE_LONG,    "Long"},
+   {TYPE_RATIONAL,"Rational"},
+   {TYPE_ASCII,   "Ascii"},
+   {TYPE_FLOAT,   "Float"},
+   {TYPE_DOUBLE,  "Double"},
+   {TYPE_SBYTE,   "SignedByte"},
+   {TYPE_SSHORT,  "SignedShort"},
+   {TYPE_SLONG,  "SignedLong"},
+   {TYPE_UNKNOWN, "Unknown"},
+    END_LIST
+};
+
+static KeyInfo _tagInfo[] =  {
+    {GTIFF_PIXELSCALE,  "ModelPixelScaleTag"},
+    {GTIFF_TRANSMATRIX, "ModelTransformationTag"},
+    {GTIFF_TIEPOINTS,   "ModelTiepointTag"},
+     /* This alias maps the Intergraph symbol to the current tag */
+    {GTIFF_TRANSMATRIX, "IntergraphMatrixTag"},
+    END_LIST
+};
+
+static char *FindName(KeyInfo *info,int key)
+{
+   static char errmsg[80];
+   
+   while (info->ki_key>=0 && info->ki_key != key) info++;
+
+   if (info->ki_key<0)
+   {
+	   sprintf(errmsg,"Unknown-%d", key );
+	   return errmsg;
+   }
+   return info->ki_name;
+}
+
+char *GTIFKeyName(geokey_t key)
+{
+   return FindName( &_keyInfo[0],key);
+}
+
+char *GTIFTypeName(tagtype_t type)
+{
+   return FindName( &_formatInfo[0],type);
+}
+
+char *GTIFTagName(int tag)
+{
+   return FindName( &_tagInfo[0],tag);
+}
+
+char *GTIFValueName(geokey_t key, int value)
+{
+   KeyInfo *info;
+   
+   switch (key)
+   {
+	/* All codes using linear/angular/whatever units */
+	case GeogLinearUnitsGeoKey: 
+	case ProjLinearUnitsGeoKey: 
+	case GeogAngularUnitsGeoKey: 
+	case GeogAzimuthUnitsGeoKey: 
+		                      info=_geounitsValue; break;
+
+   	/* put other key-dependent lists here */
+	case GTModelTypeGeoKey:       info=_modeltypeValue; break;
+	case GTRasterTypeGeoKey:      info=_rastertypeValue; break;
+	case GeographicTypeGeoKey:    info=_geographicValue; break;
+	case GeogGeodeticDatumGeoKey: info=_geodeticdatumValue; break;
+	case GeogEllipsoidGeoKey:     info=_ellipsoidValue; break;
+	case GeogPrimeMeridianGeoKey: info=_primemeridianValue; break;
+	case ProjectedCSTypeGeoKey:   info=_pcstypeValue; break;
+	case ProjectionGeoKey:        info=_projectionValue; break;
+	case ProjCoordTransGeoKey:    info=_coordtransValue; break;
+	case VerticalCSTypeGeoKey:    info=_vertcstypeValue; break;
+	case VerticalDatumGeoKey:     info=_vdatumValue; break;
+
+	/* And if all else fails... */
+   	default:                      info = _csdefaultValue;break;
+   }
+   
+   return FindName( info,value);
+}
+
+/* 
+ * Inverse Utilities (name->code) 
+ */
+
+
+static int FindCode(KeyInfo *info,char *key)
+{
+   while (info->ki_key>=0 && strcmp(info->ki_name,key) ) info++;
+
+   if (info->ki_key<0)
+   {
+	/* not a registered key; might be generic code */
+	if (!strncmp(key,"Unknown-",8))
+	{
+		int code=-1;
+		sscanf(key,"Unknown-%d",&code);
+		return code;
+	}
+	else return -1;
+   }
+   return info->ki_key;
+}
+
+int GTIFKeyCode(char *key)
+{
+   return FindCode( &_keyInfo[0],key);
+}
+
+int GTIFTypeCode(char *type)
+{
+   return FindCode( &_formatInfo[0],type);
+}
+
+int GTIFTagCode(char *tag)
+{
+   return FindCode( &_tagInfo[0],tag);
+}
+
+
+/*
+ *  The key must be determined with GTIFKeyCode() before
+ *  the name can be encoded.
+ */
+int GTIFValueCode(geokey_t key, char *name)
+{
+   KeyInfo *info;
+   
+   switch (key)
+   {
+	/* All codes using linear/angular/whatever units */
+	case GeogLinearUnitsGeoKey: 
+	case ProjLinearUnitsGeoKey: 
+	case GeogAngularUnitsGeoKey: 
+	case GeogAzimuthUnitsGeoKey: 
+		                      info=_geounitsValue; break;
+
+   	/* put other key-dependent lists here */
+	case GTModelTypeGeoKey:       info=_modeltypeValue; break;
+	case GTRasterTypeGeoKey:      info=_rastertypeValue; break;
+	case GeographicTypeGeoKey:    info=_geographicValue; break;
+	case GeogGeodeticDatumGeoKey: info=_geodeticdatumValue; break;
+	case GeogEllipsoidGeoKey:     info=_ellipsoidValue; break;
+	case GeogPrimeMeridianGeoKey: info=_primemeridianValue; break;
+	case ProjectedCSTypeGeoKey:   info=_pcstypeValue; break;
+	case ProjectionGeoKey:        info=_projectionValue; break;
+	case ProjCoordTransGeoKey:    info=_coordtransValue; break;
+	case VerticalCSTypeGeoKey:    info=_vertcstypeValue; break;
+	case VerticalDatumGeoKey:     info=_vdatumValue; break;
+
+	/* And if all else fails... */
+   	default:                      info = _csdefaultValue;break;
+   }
+   
+   return FindCode( info,name);
+}
+
diff --git a/src/tiff/geo_new.c b/src/tiff/geo_new.c
new file mode 100644
index 0000000..25579c1
--- /dev/null
+++ b/src/tiff/geo_new.c
@@ -0,0 +1,242 @@
+/**********************************************************************
+ *
+ *  geo_new.c  -- Public routines for GEOTIFF GeoKey access.
+ *
+ *    Written By: Niles D. Ritter.
+ *
+ *  copyright (c) 1995   Niles D. Ritter
+ *
+ *  Permission granted to use this software, so long as this copyright
+ *  notice accompanies any products derived therefrom.
+ *
+ *    20 June, 1995      Niles D. Ritter         New
+ *    7 July,  1995      Greg Martin             Fix index
+ *
+ * $Log$
+ * Revision 1.11  2004/04/27 21:32:08  warmerda
+ * Allow GTIFNew(NULL) to work
+ *
+ * Revision 1.10  2003/09/02 13:52:17  warmerda
+ * various hacks to support improperly terminated asciiparms
+ *
+ * Revision 1.9  2003/06/19 20:04:11  warmerda
+ * fix memory underwrite if ascii parameter string is zero length
+ *
+ * Revision 1.8  2003/06/05 14:20:45  warmerda
+ * cosmetic formatting changes
+ *
+ **********************************************************************/
+
+#include "geotiffio.h"   /* public interface        */
+#include "geo_tiffp.h" /* external TIFF interface */
+#include "geo_keyp.h"  /* private interface       */
+
+/* private local routines */
+static int ReadKey(GTIF* gt, TempKeyData* tempData,
+                   KeyEntry* entptr, GeoKey* keyptr);
+
+
+/**********************************************************************
+ *
+ *                        Public Routines
+ *
+ **********************************************************************/
+
+
+/**
+ * Given an open TIFF file, look for GTIF keys and 
+ *  values and return GTIF structure.
+
+This function creates a GeoTIFF information interpretation handle
+(GTIF *) based on a passed in TIFF handle originally from 
+XTIFFOpen().  Even though the argument 
+(<b>tif</b>) is shown as type <tt>void *</tt>, it is really normally
+of type <tt>TIFF *</tt>.<p>
+
+The returned GTIF handle can be used to read or write GeoTIFF tags 
+using the various GTIF functions.  The handle should be destroyed using
+GTIFFree() before the file is closed with TIFFClose().<p>
+
+If the file accessed has no GeoTIFF keys, an valid (but empty) GTIF is
+still returned.  GTIFNew() is used both for existing files being read, and
+for new TIFF files that will have GeoTIFF tags written to them.<p>
+
+ */
+ 
+GTIF* GTIFNew(void *tif)
+{
+    GTIF* gt=(GTIF*)0;
+    int count,bufcount,index;
+    GeoKey *keyptr;
+    pinfo_t *data;
+    KeyEntry *entptr;
+    KeyHeader *header;
+    TempKeyData tempData;
+	
+    gt = (GTIF*)_GTIFcalloc( sizeof(GTIF));
+    if (!gt) goto failure;	
+	
+    /* install TIFF file and I/O methods */
+    gt->gt_tif = (tiff_t *)tif;
+    _GTIFSetDefaultTIFF(&gt->gt_methods);
+
+    tempData.tk_asciiParams = 0;
+    tempData.tk_asciiParamsLength = 0;
+    tempData.tk_asciiParamsOffset = 0;
+	
+    /* since this is an array, GTIF will allocate the memory */
+    if ( tif == NULL 
+         || !(gt->gt_methods.get)(tif, GTIFF_GEOKEYDIRECTORY, &gt->gt_nshorts, &data ))
+    {
+        /* No ProjectionInfo, create a blank one */
+        data=(pinfo_t*)_GTIFcalloc((4+MAX_VALUES)*sizeof(pinfo_t));
+        if (!data) goto failure;	
+        header = (KeyHeader *)data;
+        header->hdr_version = GvCurrentVersion;
+        header->hdr_rev_major = GvCurrentRevision;
+        header->hdr_rev_minor = GvCurrentMinorRev;
+        gt->gt_nshorts=sizeof(KeyHeader)/sizeof(pinfo_t);
+    }
+    gt->gt_short = data;
+    header = (KeyHeader *)data;
+	
+    if (header->hdr_version > GvCurrentVersion) goto failure;
+    if (header->hdr_rev_major > GvCurrentRevision)
+    {
+        /* issue warning */
+    }
+	
+    /* If we got here, then the geokey can be parsed */
+    count = header->hdr_num_keys;
+    gt->gt_num_keys = count;
+    gt->gt_version  = header->hdr_version;
+    gt->gt_rev_major  = header->hdr_rev_major;
+    gt->gt_rev_minor  = header->hdr_rev_minor;
+
+    bufcount = count+MAX_KEYS; /* allow for expansion */
+
+    /* Get the PARAMS Tags, if any */
+    if (tif == NULL
+        || !(gt->gt_methods.get)(tif, GTIFF_DOUBLEPARAMS,
+                                 &gt->gt_ndoubles, &gt->gt_double ))
+    {
+        gt->gt_double=(double*)_GTIFcalloc(MAX_VALUES*sizeof(double));
+        if (!gt->gt_double) goto failure;	
+    }
+    if ( tif == NULL
+         || !(gt->gt_methods.get)(tif, GTIFF_ASCIIPARAMS,
+                                  &tempData.tk_asciiParamsLength,
+                                  &tempData.tk_asciiParams ))
+    {
+        tempData.tk_asciiParams         = 0;
+        tempData.tk_asciiParamsLength   = 0;
+    }
+    else
+    {
+        /* last NULL doesn't count; "|" used for delimiter */
+        --tempData.tk_asciiParamsLength;
+    }
+
+    /* allocate space for GeoKey array and its index */
+    gt->gt_keys = (GeoKey *)_GTIFcalloc( sizeof(GeoKey)*bufcount);
+    if (!gt->gt_keys) goto failure;
+    gt->gt_keyindex = (int *)_GTIFcalloc( sizeof(int)*(MAX_KEYINDEX+1));
+    if (!gt->gt_keyindex) goto failure;
+	
+    /*  Loop to get all GeoKeys */
+    entptr = ((KeyEntry *)data) + 1;
+    keyptr = gt->gt_keys;
+    gt->gt_keymin = MAX_KEYINDEX;
+    gt->gt_keymax = 0;
+    for (index=1; index<=count; index++,entptr++)
+    {
+        if (!ReadKey(gt, &tempData, entptr, ++keyptr))
+            goto failure;
+			
+        /* Set up the index (start at 1, since 0=unset) */
+        gt->gt_keyindex[entptr->ent_key] = index;		
+    }
+
+    if( tempData.tk_asciiParams != NULL )
+        _GTIFFree( tempData.tk_asciiParams );
+	
+    return gt;
+	
+  failure:
+    /* Notify of error */
+    GTIFFree (gt);
+    return (GTIF *)0;
+}
+
+/**********************************************************************
+ *
+ *                        Private Routines
+ *
+ **********************************************************************/
+
+/*
+ * Given KeyEntry, read in the GeoKey value location and set up
+ *  the Key structure, returning 0 if failure.
+ */
+
+static int ReadKey(GTIF* gt, TempKeyData* tempData,
+                   KeyEntry* entptr, GeoKey* keyptr)
+{
+    int offset,count;
+	
+    keyptr->gk_key = entptr->ent_key;
+    keyptr->gk_count = entptr->ent_count;
+    count = entptr->ent_count;
+    offset = entptr->ent_val_offset;
+    if (gt->gt_keymin > keyptr->gk_key)  gt->gt_keymin=keyptr->gk_key;
+    if (gt->gt_keymax < keyptr->gk_key)  gt->gt_keymax=keyptr->gk_key;
+	
+    if (entptr->ent_location)
+        keyptr->gk_type = (gt->gt_methods.type)(gt->gt_tif,entptr->ent_location);
+    else
+        keyptr->gk_type = (gt->gt_methods.type)(gt->gt_tif,GTIFF_GEOKEYDIRECTORY);
+	  
+    switch (entptr->ent_location)
+    {
+        case GTIFF_LOCAL:
+            /* store value into data value */
+            *(pinfo_t *)(&keyptr->gk_data) = entptr->ent_val_offset;
+            break;
+        case GTIFF_GEOKEYDIRECTORY:
+            keyptr->gk_data = (char *)(gt->gt_short+offset);
+            if (gt->gt_nshorts < offset+count)
+                gt->gt_nshorts = offset+count;
+            break;
+        case GTIFF_DOUBLEPARAMS:
+            keyptr->gk_data = (char *)(gt->gt_double+offset);
+            if (gt->gt_ndoubles < offset+count)
+                gt->gt_ndoubles = offset+count;
+            break;
+        case GTIFF_ASCIIPARAMS:
+            if( offset + count == tempData->tk_asciiParamsLength + 1 
+                && count > 0 )
+            {
+                /* some vendors seem to feel they should not use the 
+                   terminating '|' char, but do include a terminating '\0'
+                   which we lose in the low level reading code.  
+                   If this is the case, drop the extra character */
+                count--;
+            }
+            else if (offset + count > tempData->tk_asciiParamsLength)
+                return (0);
+
+            keyptr->gk_data = (char *) _GTIFcalloc (MAX(1,count+1));
+            _GTIFmemcpy (keyptr->gk_data,
+                         tempData->tk_asciiParams + offset, count);
+            if( keyptr->gk_data[MAX(0,count-1)] == '|' )
+                keyptr->gk_data[MAX(0,count-1)] = '\0';
+            else
+                keyptr->gk_data[MAX(0,count)] = '\0';
+            break;
+        default:
+            return 0; /* failure */
+    }
+    keyptr->gk_size = _gtiff_size[keyptr->gk_type];
+	
+    return 1; /* success */
+}
diff --git a/src/tiff/geo_normalize.c b/src/tiff/geo_normalize.c
new file mode 100644
index 0000000..152ff6d
--- /dev/null
+++ b/src/tiff/geo_normalize.c
@@ -0,0 +1,2402 @@
+/******************************************************************************
+ * $Id: geo_normalize.c 4825 2006-08-16 13:01:53Z lubia $
+ *
+ * Project:  libgeotiff
+ * Purpose:  Code to normalize PCS and other composite codes in a GeoTIFF file.
+ * Author:   Frank Warmerdam, warmerda at home.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log$
+ * Revision 1.45  2005/03/15 16:01:18  fwarmerdam
+ * zero inv flattening interpreted as sphere
+ *
+ * Revision 1.44  2005/03/04 04:32:37  fwarmerdam
+ * added cylindricalequalarea support
+ *
+ * Revision 1.43  2005/03/04 04:02:40  fwarmerdam
+ * Fixed initialization of dfStdParallel2 for AEA and EC.
+ *
+ * Revision 1.42  2005/02/17 01:21:38  fwarmerdam
+ * fixed handling of ProjFalseOrigin{Easting,Northing}GeoKey
+ *
+ * Revision 1.41  2004/12/01 22:06:42  fwarmerdam
+ * bug 698: GTIFGetGCSInfo should not fail on missing pm if pm info not req.
+ *
+ * Revision 1.40  2004/07/09 17:27:37  warmerda
+ * Added 9122 as an alias for simple degrees.
+ *
+ * Revision 1.39  2004/06/07 12:57:13  warmerda
+ * fallback to using gdal_datum.csv if datum.csv not found
+ *
+ * Revision 1.38  2004/03/19 12:20:40  dron
+ * Initialize projection parameters in GTIFFetchProjParms() before using.
+ *
+ * Revision 1.37  2003/07/08 17:31:30  warmerda
+ * cleanup various warnings
+ *
+ * Revision 1.36  2003/01/28 18:31:58  warmerda
+ * Default dfInDegrees in GTIFAngleToDD().
+ *
+ * Revision 1.35  2003/01/15 04:39:16  warmerda
+ * Added GTIFDeaccessCSV
+ *
+ * Revision 1.34  2003/01/15 03:37:40  warmerda
+ * added GTIFFreeMemory()
+ *
+ * Revision 1.33  2002/12/05 19:21:01  warmerda
+ * fixed dfInDegrees to actually be in degrees, not radians!
+ *
+ * Revision 1.32  2002/11/30 16:01:11  warmerda
+ * fixed some problems in GTIFGetUOMAngleInfo
+ *
+ * Revision 1.31  2002/11/30 15:44:35  warmerda
+ * fixed GetCTParms EPSG code mappings
+ *
+ * Revision 1.30  2002/11/28 22:27:42  warmerda
+ * preliminary upgrade to EPSG 6.2.2 tables
+ *
+ * Revision 1.29  2002/06/19 03:51:15  warmerda
+ * migrated cpl_csv.h into cpl_serv.h
+ *
+ * Revision 1.28  2002/01/03 21:28:25  warmerda
+ * call CSVDeaccess(NULL) at end of GTIFPrintDefn()
+ *
+ * Revision 1.27  2001/04/17 13:41:10  warmerda
+ * fix memory leaks in GTIFPrintDefn()
+ *
+ * Revision 1.26  2001/04/17 13:23:07  warmerda
+ * added support for reading custom ellipsoid definitions
+ *
+ * Revision 1.25  2001/03/05 04:55:26  warmerda
+ * CVSDeaccess at end of GTIFGetDefn to avoid file leak
+ *
+ * Revision 1.24  2001/03/05 03:26:29  warmerda
+ * fixed memory leaks in GTIFPrintDefn()
+ *
+ * Revision 1.23  2001/02/23 13:49:48  warmerda
+ * Fixed GTIFPrintDefn() to use fprintf( fp ), instead of printf().
+ *
+ * Revision 1.22  2000/10/13 14:30:57  warmerda
+ * fixed LCC parm order when parameters read directly from geotiff file
+ *
+ * Revision 1.21  2000/09/15 19:30:14  warmerda
+ * report units of linear proj parms
+ *
+ * Revision 1.20  2000/09/15 18:21:07  warmerda
+ * Fixed order of parameters for LCC 2SP.  When parameters
+ * were read from EPSG CSV files the standard parallels and origin
+ * were mixed up.  This affects alot of state plane zones!
+ *
+ * Revision 1.19  2000/06/09 14:05:43  warmerda
+ * added default knowledge of NAD27/NAD83/WGS72/WGS84
+ *
+ * Revision 1.18  1999/12/10 21:28:12  warmerda
+ * fixed Stereographic to look for ProjCenterLat/Long
+ *
+ * Revision 1.17  1999/12/10 20:06:58  warmerda
+ * fixed up scale geokey used for a couple of projections
+ *
+ * Revision 1.16  1999/12/10 19:50:21  warmerda
+ * Added EquidistantConic support, fixed return of StdParallel2GeoKey for
+ * LCC2, and Albers.
+ *
+ * Revision 1.15  1999/12/10 19:39:26  warmerda
+ * Fixed bug setting the false northing for files with
+ * ProjCenterNorthingGeoKey set in GTIFGetDefn().
+ *
+ * Revision 1.14  1999/09/17 14:58:37  warmerda
+ * Added ProjRectifiedGridAngleGeoKey(3096) and support for it's
+ * use with Oblique Mercator in geo_normalize.c.
+ *
+ * Revision 1.13  1999/09/17 00:55:26  warmerda
+ * added GTIFGetUOMAngleInfo(), and UOMAngle in GTIFDefn
+ *
+ * Revision 1.12  1999/09/15 18:51:31  warmerda
+ * Map 9808 to TM South Oriented, not TM Modified Alaska.
+ *
+ * Revision 1.11  1999/09/15 16:44:06  warmerda
+ * Change meter to metre to match EPSG database in GTIFGetUOMLengthInfo()
+ * shortcut.
+ *
+ * Revision 1.10  1999/09/15 16:35:15  warmerda
+ * Fixed the fractions of second handling properly in GTIFAngleStringToDD().
+ *
+ * Revision 1.9  1999/09/15 14:24:17  warmerda
+ * Fixed serious bug in geo_normalize.c with translation of
+ * DD.MMSSsss values.  Return value was seriously off if any
+ * fraction of a second was included in the string.
+ *
+ * Revision 1.8  1999/07/13 03:12:52  warmerda
+ * Make scale a parameter of CT_Stereographic.
+ *
+ * Revision 1.7  1999/05/04 03:13:22  warmerda
+ * fixed a serious bug in parsing DMSmmss.sss values, and a bug in forming DMS strings
+ *
+ * Revision 1.6  1999/05/03 17:50:31  warmerda
+ * avoid warnings on IRIX
+ *
+ * Revision 1.5  1999/04/28 20:04:51  warmerda
+ * Added doxygen style documentation.
+ * Use GTIFPCSToMapSys() and related functions to partially normalize
+ * projections when we don't have the CSV files.
+ *
+ * Revision 1.4  1999/03/18 21:34:59  geotiff
+ * added GTIFDecToDMS
+ *
+ * Revision 1.3  1999/03/17 19:53:15  geotiff
+ * sys includes moved to cpl_serv.h
+ *
+ * Revision 1.2  1999/03/10 18:24:06  geotiff
+ * corrected to use int'
+ *
+ * Revision 1.1  1999/03/09 15:57:04  geotiff
+ * New
+ *
+ * Revision 1.4  1999/03/03 02:29:38  warmerda
+ * Define PI if not already defined.
+ *
+ * Revision 1.3  1999/03/02 21:10:57  warmerda
+ * added lots of projections
+ *
+ * Revision 1.2  1999/02/24 16:24:15  warmerda
+ * Continuing to evolve
+ *
+ * Revision 1.1  1999/02/22 18:51:08  warmerda
+ * New
+ *
+ */
+ 
+#include "cpl_serv.h"
+#include "geo_tiffp.h"
+#include "geovalues.h"
+#include "geo_normalize.h"
+
+#ifndef KvUserDefined
+#  define KvUserDefined 32767
+#endif
+
+#ifndef PI
+#  define PI 3.14159265358979323846
+#endif
+
+/* EPSG Codes for projection parameters.  Unfortunately, these bear no
+   relationship to the GeoTIFF codes even though the names are so similar. */
+
+#define EPSGNatOriginLat         8801
+#define EPSGNatOriginLong        8802
+#define EPSGNatOriginScaleFactor 8805
+#define EPSGFalseEasting         8806
+#define EPSGFalseNorthing        8807
+#define EPSGProjCenterLat        8811
+#define EPSGProjCenterLong       8812
+#define EPSGAzimuth              8813
+#define EPSGAngleRectifiedToSkewedGrid 8814
+#define EPSGInitialLineScaleFactor 8815
+#define EPSGProjCenterEasting    8816
+#define EPSGProjCenterNorthing   8817
+#define EPSGPseudoStdParallelLat 8818
+#define EPSGPseudoStdParallelScaleFactor 8819
+#define EPSGFalseOriginLat       8821
+#define EPSGFalseOriginLong      8822
+#define EPSGStdParallel1Lat      8823
+#define EPSGStdParallel2Lat      8824
+#define EPSGFalseOriginEasting   8826
+#define EPSGFalseOriginNorthing  8827
+#define EPSGSphericalOriginLat   8828
+#define EPSGSphericalOriginLong  8829
+#define EPSGInitialLongitude     8830
+#define EPSGZoneWidth            8831
+
+/************************************************************************/
+/*                           GTIFGetPCSInfo()                           */
+/************************************************************************/
+
+int GTIFGetPCSInfo( int nPCSCode, char **ppszEPSGName, 
+                    short *pnProjOp, short *pnUOMLengthCode, 
+                    short *pnGeogCS )
+
+{
+    char	**papszRecord;
+    char	szSearchKey[24];
+    const char	*pszFilename = CSVFilename( "pcs.csv" );
+    
+/* -------------------------------------------------------------------- */
+/*      Search the units database for this unit.  If we don't find      */
+/*      it return failure.                                              */
+/* -------------------------------------------------------------------- */
+    sprintf( szSearchKey, "%d", nPCSCode );
+    papszRecord = CSVScanFileByName( pszFilename, "COORD_REF_SYS_CODE",
+                                     szSearchKey, CC_Integer );
+
+    if( papszRecord == NULL )
+        return FALSE;
+
+/* -------------------------------------------------------------------- */
+/*      Get the name, if requested.                                     */
+/* -------------------------------------------------------------------- */
+    if( ppszEPSGName != NULL )
+    {
+        *ppszEPSGName =
+            CPLStrdup( CSLGetField( papszRecord,
+                                    CSVGetFileFieldId(pszFilename,
+                                                      "COORD_REF_SYS_NAME") ));
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Get the UOM Length code, if requested.                          */
+/* -------------------------------------------------------------------- */
+    if( pnUOMLengthCode != NULL )
+    {
+        const char	*pszValue;
+
+        pszValue =
+            CSLGetField( papszRecord,
+                         CSVGetFileFieldId(pszFilename,"UOM_CODE"));
+        if( atoi(pszValue) > 0 )
+            *pnUOMLengthCode = (short) atoi(pszValue);
+        else
+            *pnUOMLengthCode = KvUserDefined;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Get the UOM Length code, if requested.                          */
+/* -------------------------------------------------------------------- */
+    if( pnProjOp != NULL )
+    {
+        const char	*pszValue;
+
+        pszValue =
+            CSLGetField( papszRecord,
+                         CSVGetFileFieldId(pszFilename,"COORD_OP_CODE"));
+        if( atoi(pszValue) > 0 )
+            *pnProjOp = (short) atoi(pszValue);
+        else
+            *pnUOMLengthCode = KvUserDefined;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Get the GeogCS (Datum with PM) code, if requested.		*/
+/* -------------------------------------------------------------------- */
+    if( pnGeogCS != NULL )
+    {
+        const char	*pszValue;
+
+        pszValue =
+            CSLGetField( papszRecord,
+                         CSVGetFileFieldId(pszFilename,"SOURCE_GEOGCRS_CODE"));
+        if( atoi(pszValue) > 0 )
+            *pnGeogCS = (short) atoi(pszValue);
+        else
+            *pnGeogCS = KvUserDefined;
+    }
+
+    return TRUE;
+}
+
+/************************************************************************/
+/*                           GTIFAngleToDD()                            */
+/*                                                                      */
+/*      Convert a numeric angle to decimal degress.                     */
+/************************************************************************/
+
+double GTIFAngleToDD( double dfAngle, int nUOMAngle )
+
+{
+    if( nUOMAngle == 9110 )		/* DDD.MMSSsss */
+    {
+        char	szAngleString[32];
+
+        sprintf( szAngleString, "%12.7f", dfAngle );
+        dfAngle = GTIFAngleStringToDD( szAngleString, nUOMAngle );
+    }
+    else
+    {
+        double		dfInDegrees = 1.0;
+        
+        GTIFGetUOMAngleInfo( nUOMAngle, NULL, &dfInDegrees );
+        dfAngle = dfAngle * dfInDegrees;
+    }
+
+    return( dfAngle );
+}
+
+/************************************************************************/
+/*                        GTIFAngleStringToDD()                         */
+/*                                                                      */
+/*      Convert an angle in the specified units to decimal degrees.     */
+/************************************************************************/
+
+double GTIFAngleStringToDD( const char * pszAngle, int nUOMAngle )
+
+{
+    double	dfAngle;
+    
+    if( nUOMAngle == 9110 )		/* DDD.MMSSsss */
+    {
+        char	*pszDecimal;
+        
+        dfAngle = ABS(atoi(pszAngle));
+        pszDecimal = strchr(pszAngle,'.');
+        if( pszDecimal != NULL && strlen(pszDecimal) > 1 )
+        {
+            char	szMinutes[3];
+            char	szSeconds[64];
+
+            szMinutes[0] = pszDecimal[1];
+            if( pszDecimal[2] >= '0' && pszDecimal[2] <= '9' )
+                szMinutes[1] = pszDecimal[2];
+            else
+                szMinutes[1] = '0';
+            
+            szMinutes[2] = '\0';
+            dfAngle += atoi(szMinutes) / 60.0;
+
+            if( strlen(pszDecimal) > 3 )
+            {
+                szSeconds[0] = pszDecimal[3];
+                if( pszDecimal[4] >= '0' && pszDecimal[4] <= '9' )
+                {
+                    szSeconds[1] = pszDecimal[4];
+                    szSeconds[2] = '.';
+                    strcpy( szSeconds+3, pszDecimal + 5 );
+                }
+                else
+                {
+                    szSeconds[1] = '0';
+                    szSeconds[2] = '\0';
+                }
+                dfAngle += atof(szSeconds) / 3600.0;
+            }
+        }
+
+        if( pszAngle[0] == '-' )
+            dfAngle *= -1;
+    }
+    else if( nUOMAngle == 9105 || nUOMAngle == 9106 )	/* grad */
+    {
+        dfAngle = 180 * (atof(pszAngle ) / 200);
+    }
+    else if( nUOMAngle == 9101 )			/* radians */
+    {
+        dfAngle = 180 * (atof(pszAngle ) / PI);
+    }
+    else if( nUOMAngle == 9103 )			/* arc-minute */
+    {
+        dfAngle = atof(pszAngle) / 60;
+    }
+    else if( nUOMAngle == 9104 )			/* arc-second */
+    {
+        dfAngle = atof(pszAngle) / 3600;
+    }
+    else /* decimal degrees ... some cases missing but seeminly never used */
+    {
+        CPLAssert( nUOMAngle == 9102 || nUOMAngle == KvUserDefined
+                   || nUOMAngle == 0 );
+        
+        dfAngle = atof(pszAngle );
+    }
+
+    return( dfAngle );
+}
+
+/************************************************************************/
+/*                           GTIFGetGCSInfo()                           */
+/*                                                                      */
+/*      Fetch the datum, and prime meridian related to a particular     */
+/*      GCS.                                                            */
+/************************************************************************/
+
+int GTIFGetGCSInfo( int nGCSCode, char ** ppszName,
+                    short * pnDatum, short * pnPM, short *pnUOMAngle )
+
+{
+    char	szSearchKey[24];
+    int		nDatum, nPM, nUOMAngle;
+
+/* -------------------------------------------------------------------- */
+/*      Search the database for the corresponding datum code.           */
+/* -------------------------------------------------------------------- */
+    sprintf( szSearchKey, "%d", nGCSCode );
+
+    nDatum = atoi(CSVGetField( CSVFilename("gcs.csv" ),
+                               "COORD_REF_SYS_CODE", szSearchKey, CC_Integer,
+                               "DATUM_CODE" ) );
+
+/* -------------------------------------------------------------------- */
+/*      Handle some "well known" GCS codes directly if the table        */
+/*      wasn't found.                                                   */
+/* -------------------------------------------------------------------- */
+    if( nDatum < 1 )
+    {
+        const char * pszName = NULL;
+        nPM = PM_Greenwich;
+        nUOMAngle = Angular_DMS_Hemisphere; 
+        if( nGCSCode == GCS_NAD27 )
+        {
+            nDatum = Datum_North_American_Datum_1927;
+            pszName = "NAD27";
+        }
+        else if( nGCSCode == GCS_NAD83 )
+        {
+            nDatum = Datum_North_American_Datum_1983;
+            pszName = "NAD83";
+        }
+        else if( nGCSCode == GCS_WGS_84 )
+        {
+            nDatum = Datum_WGS84;
+            pszName = "WGS 84";
+        }
+        else if( nGCSCode == GCS_WGS_72 )
+        {
+            nDatum = Datum_WGS72;
+            pszName = "WGS 82";
+        }
+        else
+            return FALSE;
+
+        if( ppszName != NULL )
+            *ppszName = CPLStrdup( pszName );
+        if( pnDatum != NULL )
+            *pnDatum = (short) nDatum;
+        if( pnPM != NULL )
+            *pnPM = (short) nPM;
+        if( pnUOMAngle != NULL )
+            *pnUOMAngle = (short) nUOMAngle;
+
+        return TRUE;
+    }
+
+    if( pnDatum != NULL )
+        *pnDatum = (short) nDatum;
+    
+/* -------------------------------------------------------------------- */
+/*      Get the PM.                                                     */
+/* -------------------------------------------------------------------- */
+    if( pnPM != NULL )
+    {
+        nPM = atoi(CSVGetField( CSVFilename("gcs.csv" ),
+                            "COORD_REF_SYS_CODE", szSearchKey, CC_Integer,
+                            "PRIME_MERIDIAN_CODE" ) );
+
+        if( nPM < 1 )
+            return FALSE;
+
+        *pnPM = (short) nPM;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Get the angular units.                                          */
+/* -------------------------------------------------------------------- */
+    nUOMAngle = atoi(CSVGetField( CSVFilename("gcs.csv" ),
+                                  "COORD_REF_SYS_CODE",szSearchKey, CC_Integer,
+                                  "UOM_CODE" ) );
+
+    if( nUOMAngle < 1 )
+        return FALSE;
+
+    if( pnUOMAngle != NULL )
+        *pnUOMAngle = (short) nUOMAngle;
+
+/* -------------------------------------------------------------------- */
+/*      Get the name, if requested.                                     */
+/* -------------------------------------------------------------------- */
+    if( ppszName != NULL )
+        *ppszName =
+            CPLStrdup(CSVGetField( CSVFilename("gcs.csv" ),
+                                   "COORD_REF_SYS_CODE",szSearchKey,CC_Integer,
+                                   "COORD_REF_SYS_NAME" ));
+    
+    return( TRUE );
+}
+
+/************************************************************************/
+/*                        GTIFGetEllipsoidInfo()                        */
+/*                                                                      */
+/*      Fetch info about an ellipsoid.  Axes are always returned in     */
+/*      meters.  SemiMajor computed based on inverse flattening         */
+/*      where that is provided.                                         */
+/************************************************************************/
+
+int GTIFGetEllipsoidInfo( int nEllipseCode, char ** ppszName,
+                          double * pdfSemiMajor, double * pdfSemiMinor )
+
+{
+    char	szSearchKey[24];
+    double	dfSemiMajor, dfToMeters = 1.0;
+    int		nUOMLength;
+    
+/* -------------------------------------------------------------------- */
+/*      Get the semi major axis.                                        */
+/* -------------------------------------------------------------------- */
+    sprintf( szSearchKey, "%d", nEllipseCode );
+
+    dfSemiMajor =
+        atof(CSVGetField( CSVFilename("ellipsoid.csv" ),
+                          "ELLIPSOID_CODE", szSearchKey, CC_Integer,
+                          "SEMI_MAJOR_AXIS" ) );
+
+/* -------------------------------------------------------------------- */
+/*      Try some well known ellipsoids.                                 */
+/* -------------------------------------------------------------------- */
+    if( dfSemiMajor == 0.0 )
+    {
+        double     dfInvFlattening, dfSemiMinor;
+        const char *pszName = NULL;
+        
+        if( nEllipseCode == Ellipse_Clarke_1866 )
+        {
+            pszName = "Clarke 1866";
+            dfSemiMajor = 6378206.4;
+            dfSemiMinor = 6356583.8;
+            dfInvFlattening = 0.0;
+        }
+        else if( nEllipseCode == Ellipse_GRS_1980 )
+        {
+            pszName = "GRS 1980";
+            dfSemiMajor = 6378137.0;
+            dfSemiMinor = 0.0;
+            dfInvFlattening = 298.257222101;
+        }
+        else if( nEllipseCode == Ellipse_WGS_84 )
+        {
+            pszName = "WGS 84";
+            dfSemiMajor = 6378137.0;
+            dfSemiMinor = 0.0;
+            dfInvFlattening = 298.257223563;
+        }
+        else if( nEllipseCode == 7043 )
+        {
+            pszName = "WGS 72";
+            dfSemiMajor = 6378135.0;
+            dfSemiMinor = 0.0;
+            dfInvFlattening = 298.26;
+        }
+        else
+            return FALSE;
+
+        if( dfSemiMinor == 0.0 )
+            dfSemiMinor = dfSemiMajor * (1 - 1.0/dfInvFlattening);
+
+        if( pdfSemiMinor != NULL )
+            *pdfSemiMinor = dfSemiMinor;
+        if( pdfSemiMajor != NULL )
+            *pdfSemiMajor = dfSemiMajor;
+        if( ppszName != NULL )
+            *ppszName = CPLStrdup( pszName );
+
+        return TRUE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*	Get the translation factor into meters.				*/
+/* -------------------------------------------------------------------- */
+    nUOMLength = atoi(CSVGetField( CSVFilename("ellipsoid.csv" ),
+                                   "ELLIPSOID_CODE", szSearchKey, CC_Integer,
+                                   "UOM_CODE" ));
+    GTIFGetUOMLengthInfo( nUOMLength, NULL, &dfToMeters );
+
+    dfSemiMajor *= dfToMeters;
+    
+    if( pdfSemiMajor != NULL )
+        *pdfSemiMajor = dfSemiMajor;
+    
+/* -------------------------------------------------------------------- */
+/*      Get the semi-minor if requested.  If the Semi-minor axis        */
+/*      isn't available, compute it based on the inverse flattening.    */
+/* -------------------------------------------------------------------- */
+    if( pdfSemiMinor != NULL )
+    {
+        *pdfSemiMinor =
+            atof(CSVGetField( CSVFilename("ellipsoid.csv" ),
+                              "ELLIPSOID_CODE", szSearchKey, CC_Integer,
+                              "SEMI_MINOR_AXIS" )) * dfToMeters;
+
+        if( *pdfSemiMinor == 0.0 )
+        {
+            double	dfInvFlattening;
+            
+            dfInvFlattening = 
+                atof(CSVGetField( CSVFilename("ellipsoid.csv" ),
+                                  "ELLIPSOID_CODE", szSearchKey, CC_Integer,
+                                  "INV_FLATTENING" ));
+            *pdfSemiMinor = dfSemiMajor * (1 - 1.0/dfInvFlattening);
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Get the name, if requested.                                     */
+/* -------------------------------------------------------------------- */
+    if( ppszName != NULL )
+        *ppszName =
+            CPLStrdup(CSVGetField( CSVFilename("ellipsoid.csv" ),
+                                   "ELLIPSOID_CODE", szSearchKey, CC_Integer,
+                                   "ELLIPSOID_NAME" ));
+    
+    return( TRUE );
+}
+
+/************************************************************************/
+/*                           GTIFGetPMInfo()                            */
+/*                                                                      */
+/*      Get the offset between a given prime meridian and Greenwich     */
+/*      in degrees.                                                     */
+/************************************************************************/
+
+int GTIFGetPMInfo( int nPMCode, char ** ppszName, double *pdfOffset )
+
+{
+    char	szSearchKey[24];
+    int		nUOMAngle;
+    const char *pszFilename = CSVFilename("prime_meridian.csv");
+
+/* -------------------------------------------------------------------- */
+/*      Use a special short cut for Greenwich, since it is so common.   */
+/* -------------------------------------------------------------------- */
+    if( nPMCode == PM_Greenwich )
+    {
+        if( pdfOffset != NULL )
+            *pdfOffset = 0.0;
+        if( ppszName != NULL )
+            *ppszName = CPLStrdup( "Greenwich" );
+        return TRUE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Search the database for the corresponding datum code.           */
+/* -------------------------------------------------------------------- */
+    sprintf( szSearchKey, "%d", nPMCode );
+
+    nUOMAngle =
+        atoi(CSVGetField( pszFilename, 
+                          "PRIME_MERIDIAN_CODE", szSearchKey, CC_Integer,
+                          "UOM_CODE" ) );
+    if( nUOMAngle < 1 )
+        return FALSE;
+
+/* -------------------------------------------------------------------- */
+/*      Get the PM offset.                                              */
+/* -------------------------------------------------------------------- */
+    if( pdfOffset != NULL )
+    {
+        *pdfOffset =
+            GTIFAngleStringToDD(
+                CSVGetField( pszFilename, 
+                             "PRIME_MERIDIAN_CODE", szSearchKey, CC_Integer,
+                             "GREENWICH_LONGITUDE" ),
+                nUOMAngle );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Get the name, if requested.                                     */
+/* -------------------------------------------------------------------- */
+    if( ppszName != NULL )
+        *ppszName =
+            CPLStrdup(
+                CSVGetField( pszFilename, 
+                             "PRIME_MERIDIAN_CODE", szSearchKey, CC_Integer,
+                             "PRIME_MERIDIAN_NAME" ));
+    
+    return( TRUE );
+}
+
+/************************************************************************/
+/*                          GTIFGetDatumInfo()                          */
+/*                                                                      */
+/*      Fetch the ellipsoid, and name for a datum.                      */
+/************************************************************************/
+
+int GTIFGetDatumInfo( int nDatumCode, char ** ppszName, short * pnEllipsoid )
+
+{
+    char	szSearchKey[24];
+    int		nEllipsoid;
+    const char *pszFilename = CSVFilename( "datum.csv" );
+    FILE       *fp;
+
+/* -------------------------------------------------------------------- */
+/*      If we can't find datum.csv then gdal_datum.csv is an            */
+/*      acceptable fallback.  Mostly this is for GDAL.                  */
+/* -------------------------------------------------------------------- */
+    if( (fp = VSIFOpen(pszFilename,"r")) == NULL )
+        pszFilename = CSVFilename( "gdal_datum.csv" );
+    else
+        VSIFClose( fp );
+
+/* -------------------------------------------------------------------- */
+/*      Search the database for the corresponding datum code.           */
+/* -------------------------------------------------------------------- */
+    sprintf( szSearchKey, "%d", nDatumCode );
+
+    nEllipsoid = atoi(CSVGetField( pszFilename,
+                                   "DATUM_CODE", szSearchKey, CC_Integer,
+                                   "ELLIPSOID_CODE" ) );
+
+    if( pnEllipsoid != NULL )
+        *pnEllipsoid = (short) nEllipsoid;
+    
+/* -------------------------------------------------------------------- */
+/*      Handle a few built-in datums.                                   */
+/* -------------------------------------------------------------------- */
+    if( nEllipsoid < 1 )
+    {
+        const char *pszName = NULL;
+        
+        if( nDatumCode == Datum_North_American_Datum_1927 )
+        {
+            nEllipsoid = Ellipse_Clarke_1866;
+            pszName = "North American Datum 1927";
+        }
+        else if( nDatumCode == Datum_North_American_Datum_1983 )
+        {
+            nEllipsoid = Ellipse_GRS_1980;
+            pszName = "North American Datum 1983";
+        }
+        else if( nDatumCode == Datum_WGS84 )
+        {
+            nEllipsoid = Ellipse_WGS_84;
+            pszName = "World Geodetic System 1984";
+        }
+        else if( nDatumCode == Datum_WGS72 )
+        {
+            nEllipsoid = 7043; /* WGS7 */
+            pszName = "World Geodetic System 1972";
+        }
+        else
+            return FALSE;
+
+        if( pnEllipsoid != NULL )
+            *pnEllipsoid = (short) nEllipsoid;
+
+        if( ppszName != NULL )
+            *ppszName = CPLStrdup( pszName );
+
+        return TRUE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Get the name, if requested.                                     */
+/* -------------------------------------------------------------------- */
+    if( ppszName != NULL )
+        *ppszName =
+            CPLStrdup(CSVGetField( pszFilename,
+                                   "DATUM_CODE", szSearchKey, CC_Integer,
+                                   "DATUM_NAME" ));
+    
+    return( TRUE );
+}
+
+
+/************************************************************************/
+/*                        GTIFGetUOMLengthInfo()                        */
+/*                                                                      */
+/*      Note: This function should eventually also know how to          */
+/*      lookup length aliases in the UOM_LE_ALIAS table.                */
+/************************************************************************/
+
+int GTIFGetUOMLengthInfo( int nUOMLengthCode,
+                          char **ppszUOMName,
+                          double * pdfInMeters )
+
+{
+    char	**papszUnitsRecord;
+    char	szSearchKey[24];
+    int		iNameField;
+    const char *pszFilename;
+
+/* -------------------------------------------------------------------- */
+/*      We short cut meter to save work in the most common case.        */
+/* -------------------------------------------------------------------- */
+    if( nUOMLengthCode == 9001 )
+    {
+        if( ppszUOMName != NULL )
+            *ppszUOMName = CPLStrdup( "metre" );
+        if( pdfInMeters != NULL )
+            *pdfInMeters = 1.0;
+
+        return TRUE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Search the units database for this unit.  If we don't find      */
+/*      it return failure.                                              */
+/* -------------------------------------------------------------------- */
+    pszFilename = CSVFilename( "unit_of_measure.csv" );
+
+    sprintf( szSearchKey, "%d", nUOMLengthCode );
+    papszUnitsRecord =
+        CSVScanFileByName( pszFilename,
+                           "UOM_CODE", szSearchKey, CC_Integer );
+
+    if( papszUnitsRecord == NULL )
+        return FALSE;
+
+/* -------------------------------------------------------------------- */
+/*      Get the name, if requested.                                     */
+/* -------------------------------------------------------------------- */
+    if( ppszUOMName != NULL )
+    {
+        iNameField = CSVGetFileFieldId( pszFilename,
+                                        "UNIT_OF_MEAS_NAME" );
+        *ppszUOMName = CPLStrdup( CSLGetField(papszUnitsRecord, iNameField) );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Get the A and B factor fields, and create the multiplicative    */
+/*      factor.                                                         */
+/* -------------------------------------------------------------------- */
+    if( pdfInMeters != NULL )
+    {
+        int	iBFactorField, iCFactorField;
+        
+        iBFactorField = CSVGetFileFieldId( pszFilename, "FACTOR_B" );
+        iCFactorField = CSVGetFileFieldId( pszFilename, "FACTOR_C" );
+
+        if( atof(CSLGetField(papszUnitsRecord, iCFactorField)) > 0.0 )
+            *pdfInMeters = atof(CSLGetField(papszUnitsRecord, iBFactorField))
+                / atof(CSLGetField(papszUnitsRecord, iCFactorField));
+        else
+            *pdfInMeters = 0.0;
+    }
+    
+    return( TRUE );
+}
+
+/************************************************************************/
+/*                        GTIFGetUOMAngleInfo()                         */
+/************************************************************************/
+
+int GTIFGetUOMAngleInfo( int nUOMAngleCode,
+                         char **ppszUOMName,
+                         double * pdfInDegrees )
+
+{
+    const char	*pszUOMName = NULL;
+    double	dfInDegrees = 1.0;
+    const char *pszFilename = CSVFilename( "unit_of_measure.csv" );
+    char	szSearchKey[24];
+
+    sprintf( szSearchKey, "%d", nUOMAngleCode );
+    pszUOMName = CSVGetField( pszFilename,
+                              "UOM_CODE", szSearchKey, CC_Integer,
+                              "UNIT_OF_MEAS_NAME" );
+
+/* -------------------------------------------------------------------- */
+/*      If the file is found, read from there.  Note that FactorC is    */
+/*      an empty field for any of the DMS style formats, and in this    */
+/*      case we really want to return the default InDegrees value       */
+/*      (1.0) from above.                                               */
+/* -------------------------------------------------------------------- */
+    if( pszUOMName != NULL )
+    {
+        double dfFactorB, dfFactorC, dfInRadians;
+        
+        dfFactorB = 
+            atof(CSVGetField( pszFilename,
+                              "UOM_CODE", szSearchKey, CC_Integer,
+                              "FACTOR_B" ));
+        
+        dfFactorC = 
+            atof(CSVGetField( pszFilename,
+                              "UOM_CODE", szSearchKey, CC_Integer,
+                              "FACTOR_C" ));
+
+        if( dfFactorC != 0.0 )
+        {
+            dfInRadians = (dfFactorB / dfFactorC);
+            dfInDegrees = dfInRadians * 180.0 / PI;
+        }
+                          
+
+        /* We do a special override of some of the DMS formats name */
+        if( nUOMAngleCode == 9102 || nUOMAngleCode == 9107
+            || nUOMAngleCode == 9108 || nUOMAngleCode == 9110
+            || nUOMAngleCode == 9122 )
+        {
+            dfInDegrees = 1.0;
+            pszUOMName = "degree";
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Otherwise handle a few well known units directly.               */
+/* -------------------------------------------------------------------- */
+    else
+    {
+        switch( nUOMAngleCode )
+        {
+          case 9101:
+            pszUOMName = "radian";
+            dfInDegrees = 180.0 / PI;
+            break;
+        
+          case 9102:
+          case 9107:
+          case 9108:
+          case 9110:
+            pszUOMName = "degree";
+            dfInDegrees = 1.0;
+            break;
+
+          case 9103:
+            pszUOMName = "arc-minute";
+            dfInDegrees = 1 / 60.0;
+            break;
+
+          case 9104:
+            pszUOMName = "arc-second";
+            dfInDegrees = 1 / 3600.0;
+            break;
+        
+          case 9105:
+            pszUOMName = "grad";
+            dfInDegrees = 180.0 / 200.0;
+            break;
+
+          case 9106:
+            pszUOMName = "gon";
+            dfInDegrees = 180.0 / 200.0;
+            break;
+        
+          case 9109:
+            pszUOMName = "microradian";
+            dfInDegrees = 180.0 / (PI * 1000000.0);
+            break;
+
+          default:
+            return FALSE;
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Return to caller.                                               */
+/* -------------------------------------------------------------------- */
+    if( ppszUOMName != NULL )
+    {
+        if( pszUOMName != NULL )
+            *ppszUOMName = CPLStrdup( pszUOMName );
+        else
+            *ppszUOMName = NULL;
+    }
+
+    if( pdfInDegrees != NULL )
+        *pdfInDegrees = dfInDegrees;
+
+    return( TRUE );
+}
+
+/************************************************************************/
+/*                    EPSGProjMethodToCTProjMethod()                    */
+/*                                                                      */
+/*      Convert between the EPSG enumeration for projection methods,    */
+/*      and the GeoTIFF CT codes.                                       */
+/************************************************************************/
+
+static int EPSGProjMethodToCTProjMethod( int nEPSG )
+
+{
+    /* see trf_method.csv for list of EPSG codes */
+    
+    switch( nEPSG )
+    {
+      case 9801:
+        return( CT_LambertConfConic_1SP );
+
+      case 9802:
+        return( CT_LambertConfConic_2SP );
+
+      case 9803:
+        return( CT_LambertConfConic_2SP ); /* Belgian variant not supported */
+
+      case 9804:
+        return( CT_Mercator );  /* 1SP and 2SP not differentiated */
+
+      case 9805:
+        return( CT_Mercator );  /* 1SP and 2SP not differentiated */
+
+      case 9806:
+        return( CT_CassiniSoldner );
+
+      case 9807:
+        return( CT_TransverseMercator );
+
+      case 9808:
+        return( CT_TransvMercator_SouthOriented );
+
+      case 9809:
+        return( CT_ObliqueStereographic );
+
+      case 9810:
+        return( CT_PolarStereographic );
+
+      case 9811:
+        return( CT_NewZealandMapGrid );
+
+      case 9812:
+        return( CT_ObliqueMercator ); /* is hotine actually different? */
+
+      case 9813:
+        return( CT_ObliqueMercator_Laborde );
+
+      case 9814:
+        return( CT_ObliqueMercator_Rosenmund ); /* swiss  */
+
+      case 9815:
+        return( CT_ObliqueMercator );
+
+      case 9816: /* tunesia mining grid has no counterpart */
+        return( KvUserDefined );
+    }
+
+    return( KvUserDefined );
+}
+
+/************************************************************************/
+/*                            SetGTParmIds()                            */
+/*                                                                      */
+/*      This is hardcoded logic to set the GeoTIFF parmaeter            */
+/*      identifiers for all the EPSG supported projections.  As the     */
+/*      trf_method.csv table grows with new projections, this code      */
+/*      will need to be updated.                                        */
+/************************************************************************/
+
+static int SetGTParmIds( int nCTProjection, 
+                         int *panProjParmId, 
+                         int *panEPSGCodes )
+
+{
+    int anWorkingDummy[7];
+
+    if( panEPSGCodes == NULL )
+        panEPSGCodes = anWorkingDummy;
+    if( panProjParmId == NULL )
+        panProjParmId = anWorkingDummy;
+
+    memset( panEPSGCodes, 0, sizeof(int) * 7 );
+
+    /* psDefn->nParms = 7; */
+    
+    switch( nCTProjection )
+    {
+      case CT_CassiniSoldner:
+      case CT_NewZealandMapGrid:
+        panProjParmId[0] = ProjNatOriginLatGeoKey;
+        panProjParmId[1] = ProjNatOriginLongGeoKey;
+        panProjParmId[5] = ProjFalseEastingGeoKey;
+        panProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        panEPSGCodes[0] = EPSGNatOriginLat;
+        panEPSGCodes[1] = EPSGNatOriginLong;
+        panEPSGCodes[5] = EPSGFalseEasting;
+        panEPSGCodes[6] = EPSGFalseNorthing;
+        return TRUE;
+
+      case CT_ObliqueMercator:
+        panProjParmId[0] = ProjCenterLatGeoKey;
+        panProjParmId[1] = ProjCenterLongGeoKey;
+        panProjParmId[2] = ProjAzimuthAngleGeoKey;
+        panProjParmId[3] = ProjRectifiedGridAngleGeoKey;
+        panProjParmId[4] = ProjScaleAtCenterGeoKey;
+        panProjParmId[5] = ProjFalseEastingGeoKey;
+        panProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        panEPSGCodes[0] = EPSGProjCenterLat;
+        panEPSGCodes[1] = EPSGProjCenterLong;
+        panEPSGCodes[2] = EPSGAzimuth;
+        panEPSGCodes[3] = EPSGAngleRectifiedToSkewedGrid;
+        panEPSGCodes[4] = EPSGInitialLineScaleFactor;
+        panEPSGCodes[5] = EPSGProjCenterEasting;
+        panEPSGCodes[6] = EPSGProjCenterNorthing;
+        return TRUE;
+
+      case CT_ObliqueMercator_Laborde:
+        panProjParmId[0] = ProjCenterLatGeoKey;
+        panProjParmId[1] = ProjCenterLongGeoKey;
+        panProjParmId[2] = ProjAzimuthAngleGeoKey;
+        panProjParmId[4] = ProjScaleAtCenterGeoKey;
+        panProjParmId[5] = ProjFalseEastingGeoKey;
+        panProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        panEPSGCodes[0] = EPSGProjCenterLat;
+        panEPSGCodes[1] = EPSGProjCenterLong;
+        panEPSGCodes[2] = EPSGAzimuth;
+        panEPSGCodes[4] = EPSGInitialLineScaleFactor;
+        panEPSGCodes[5] = EPSGProjCenterEasting;
+        panEPSGCodes[6] = EPSGProjCenterNorthing;
+        return TRUE;
+        
+      case CT_LambertConfConic_1SP:
+      case CT_Mercator:
+      case CT_ObliqueStereographic:
+      case CT_PolarStereographic:
+      case CT_TransverseMercator:
+      case CT_TransvMercator_SouthOriented:
+        panProjParmId[0] = ProjNatOriginLatGeoKey;
+        panProjParmId[1] = ProjNatOriginLongGeoKey;
+        panProjParmId[4] = ProjScaleAtNatOriginGeoKey;
+        panProjParmId[5] = ProjFalseEastingGeoKey;
+        panProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        panEPSGCodes[0] = EPSGNatOriginLat;
+        panEPSGCodes[1] = EPSGNatOriginLong;
+        panEPSGCodes[4] = EPSGNatOriginScaleFactor;
+        panEPSGCodes[5] = EPSGFalseEasting;
+        panEPSGCodes[6] = EPSGFalseNorthing;
+        return TRUE;
+
+      case CT_LambertConfConic_2SP:
+        panProjParmId[0] = ProjFalseOriginLatGeoKey;
+        panProjParmId[1] = ProjFalseOriginLongGeoKey;
+        panProjParmId[2] = ProjStdParallel1GeoKey;
+        panProjParmId[3] = ProjStdParallel2GeoKey;
+        panProjParmId[5] = ProjFalseEastingGeoKey;
+        panProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        panEPSGCodes[0] = EPSGFalseOriginLat;
+        panEPSGCodes[1] = EPSGFalseOriginLong;
+        panEPSGCodes[2] = EPSGStdParallel1Lat;
+        panEPSGCodes[3] = EPSGStdParallel2Lat;
+        panEPSGCodes[5] = EPSGFalseOriginEasting;
+        panEPSGCodes[6] = EPSGFalseOriginNorthing;
+        return TRUE;
+
+      case CT_SwissObliqueCylindrical:
+        panProjParmId[0] = ProjCenterLatGeoKey;
+        panProjParmId[1] = ProjCenterLongGeoKey;
+        panProjParmId[5] = ProjFalseEastingGeoKey;
+        panProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        /* EPSG codes? */
+        return TRUE;
+
+      default:
+        return( FALSE );
+    }
+}
+
+/************************************************************************/
+/*                         GTIFGetProjTRFInfo()                         */
+/*                                                                      */
+/*      Transform a PROJECTION_TRF_CODE into a projection method,       */
+/*      and a set of parameters.  The parameters identify will          */
+/*      depend on the returned method, but they will all have been      */
+/*      normalized into degrees and meters.                             */
+/************************************************************************/
+
+int GTIFGetProjTRFInfo( /* COORD_OP_CODE from coordinate_operation.csv */
+                        int nProjTRFCode, 
+                        char **ppszProjTRFName,
+                        short * pnProjMethod,
+                        double * padfProjParms )
+
+{
+    int		nProjMethod, i, anEPSGCodes[7];
+    double	adfProjParms[7];
+    char	szTRFCode[16];
+    int         nCTProjMethod;
+    char       *pszFilename = CPLStrdup(CSVFilename("projop_wparm.csv"));
+
+/* -------------------------------------------------------------------- */
+/*      Get the proj method.  If this fails to return a meaningful      */
+/*      number, then the whole function fails.                          */
+/* -------------------------------------------------------------------- */
+    sprintf( szTRFCode, "%d", nProjTRFCode );
+    nProjMethod =
+        atoi( CSVGetField( pszFilename,
+                           "COORD_OP_CODE", szTRFCode, CC_Integer,
+                           "COORD_OP_METHOD_CODE" ) );
+    if( nProjMethod == 0 )
+    {
+        CPLFree( pszFilename );
+        return FALSE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Initialize a definition of what EPSG codes need to be loaded    */
+/*      into what fields in adfProjParms.                               */
+/* -------------------------------------------------------------------- */
+    nCTProjMethod = EPSGProjMethodToCTProjMethod( nProjMethod );
+    SetGTParmIds( nCTProjMethod, NULL, anEPSGCodes );
+
+/* -------------------------------------------------------------------- */
+/*      Get the parameters for this projection.  For the time being     */
+/*      I am assuming the first four parameters are angles, the         */
+/*      fifth is unitless (normally scale), and the remainder are       */
+/*      linear measures.  This works fine for the existing              */
+/*      projections, but is a pretty fragile approach.                  */
+/* -------------------------------------------------------------------- */
+
+    for( i = 0; i < 7; i++ )
+    {
+        char    szParamUOMID[32], szParamValueID[32], szParamCodeID[32];
+        const char *pszValue;
+        int     nUOM;
+        int     nEPSGCode = anEPSGCodes[i];
+        int     iEPSG;
+
+        /* Establish default */
+        if( nEPSGCode == EPSGAngleRectifiedToSkewedGrid )
+            adfProjParms[i] = 90.0;
+        else if( nEPSGCode == EPSGNatOriginScaleFactor
+                 || nEPSGCode == EPSGInitialLineScaleFactor
+                 || nEPSGCode == EPSGPseudoStdParallelScaleFactor )
+            adfProjParms[i] = 1.0;
+        else
+            adfProjParms[i] = 0.0;
+
+        /* If there is no parameter, skip */
+        if( nEPSGCode == 0 )
+            continue;
+
+        /* Find the matching parameter */
+        for( iEPSG = 0; iEPSG < 7; iEPSG++ )
+        {
+            sprintf( szParamCodeID, "PARAMETER_CODE_%d", iEPSG+1 );
+
+            if( atoi(CSVGetField( pszFilename,
+                                  "COORD_OP_CODE", szTRFCode, CC_Integer, 
+                                  szParamCodeID )) == nEPSGCode )
+                break;
+        }
+
+        /* not found, accept the default */
+        if( iEPSG == 7 )
+            continue;
+
+        /* Get the value, and UOM */
+        sprintf( szParamUOMID, "PARAMETER_UOM_%d", iEPSG+1 );
+        sprintf( szParamValueID, "PARAMETER_VALUE_%d", iEPSG+1 );
+
+        nUOM = atoi(CSVGetField( pszFilename,
+                                 "COORD_OP_CODE", szTRFCode, CC_Integer, 
+                                 szParamUOMID ));
+        pszValue = CSVGetField( pszFilename,
+                                "COORD_OP_CODE", szTRFCode, CC_Integer, 
+                                szParamValueID );
+
+        /* Transform according to the UOM */
+        if( nUOM >= 9100 && nUOM < 9200 )
+            adfProjParms[i] = GTIFAngleStringToDD( pszValue, nUOM );
+        else if( nUOM > 9000 && nUOM < 9100 )
+        {
+            double dfInMeters;
+
+            if( !GTIFGetUOMLengthInfo( nUOM, NULL, &dfInMeters ) )
+                dfInMeters = 1.0;
+            adfProjParms[i] = atof(pszValue) * dfInMeters;
+        }
+        else
+            adfProjParms[i] = atof(pszValue);
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Get the name, if requested.                                     */
+/* -------------------------------------------------------------------- */
+    if( ppszProjTRFName != NULL )
+    {
+        *ppszProjTRFName =
+            CPLStrdup(CSVGetField( pszFilename,
+                                   "COORD_OP_CODE", szTRFCode, CC_Integer,
+                                   "COORD_OP_NAME" ));
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Transfer requested data into passed variables.                  */
+/* -------------------------------------------------------------------- */
+    if( pnProjMethod != NULL )
+        *pnProjMethod = (short) nProjMethod;
+
+    if( padfProjParms != NULL )
+    {
+        for( i = 0; i < 7; i++ )
+            padfProjParms[i] = adfProjParms[i];
+    }
+
+    CPLFree( pszFilename );
+
+    return TRUE;
+}
+
+/************************************************************************/
+/*                         GTIFFetchProjParms()                         */
+/*                                                                      */
+/*      Fetch the projection parameters for a particular projection     */
+/*      from a GeoTIFF file, and fill the GTIFDefn structure out        */
+/*      with them.                                                      */
+/************************************************************************/
+
+static void GTIFFetchProjParms( GTIF * psGTIF, GTIFDefn * psDefn )
+
+{
+    double dfNatOriginLong = 0.0, dfNatOriginLat = 0.0, dfRectGridAngle = 0.0;
+    double dfFalseEasting = 0.0, dfFalseNorthing = 0.0, dfNatOriginScale = 1.0;
+    double dfStdParallel1 = 0.0, dfStdParallel2 = 0.0, dfAzimuth = 0.0;
+
+/* -------------------------------------------------------------------- */
+/*      Get the false easting, and northing if available.               */
+/* -------------------------------------------------------------------- */
+    if( !GTIFKeyGet(psGTIF, ProjFalseEastingGeoKey, &dfFalseEasting, 0, 1)
+        && !GTIFKeyGet(psGTIF, ProjCenterEastingGeoKey,
+                       &dfFalseEasting, 0, 1) 
+        && !GTIFKeyGet(psGTIF, ProjFalseOriginEastingGeoKey,
+                       &dfFalseEasting, 0, 1) )
+        dfFalseEasting = 0.0;
+        
+    if( !GTIFKeyGet(psGTIF, ProjFalseNorthingGeoKey, &dfFalseNorthing,0,1)
+        && !GTIFKeyGet(psGTIF, ProjCenterNorthingGeoKey,
+                       &dfFalseNorthing, 0, 1)
+        && !GTIFKeyGet(psGTIF, ProjFalseOriginNorthingGeoKey,
+                       &dfFalseNorthing, 0, 1) )
+        dfFalseNorthing = 0.0;
+        
+    switch( psDefn->CTProjection )
+    {
+/* -------------------------------------------------------------------- */
+      case CT_Stereographic:
+/* -------------------------------------------------------------------- */
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLongGeoKey, 
+                       &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0 )
+            dfNatOriginLong = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLatGeoKey, 
+                       &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0 )
+            dfNatOriginLat = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjScaleAtNatOriginGeoKey,
+                       &dfNatOriginScale, 0, 1 ) == 0 )
+            dfNatOriginScale = 1.0;
+            
+        /* notdef: should transform to decimal degrees at this point */
+
+        psDefn->ProjParm[0] = dfNatOriginLat;
+        psDefn->ProjParmId[0] = ProjCenterLatGeoKey;
+        psDefn->ProjParm[1] = dfNatOriginLong;
+        psDefn->ProjParmId[1] = ProjCenterLongGeoKey;
+        psDefn->ProjParm[4] = dfNatOriginScale;
+        psDefn->ProjParmId[4] = ProjScaleAtNatOriginGeoKey;
+        psDefn->ProjParm[5] = dfFalseEasting;
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[6] = dfFalseNorthing;
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        psDefn->nParms = 7;
+        break;
+
+/* -------------------------------------------------------------------- */
+      case CT_LambertConfConic_1SP:
+      case CT_Mercator:
+      case CT_ObliqueStereographic:
+      case CT_TransverseMercator:
+      case CT_TransvMercator_SouthOriented:
+/* -------------------------------------------------------------------- */
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLongGeoKey, 
+                       &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0 )
+            dfNatOriginLong = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLatGeoKey, 
+                       &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0 )
+            dfNatOriginLat = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjScaleAtNatOriginGeoKey,
+                       &dfNatOriginScale, 0, 1 ) == 0 )
+            dfNatOriginScale = 1.0;
+            
+        /* notdef: should transform to decimal degrees at this point */
+
+        psDefn->ProjParm[0] = dfNatOriginLat;
+        psDefn->ProjParmId[0] = ProjNatOriginLatGeoKey;
+        psDefn->ProjParm[1] = dfNatOriginLong;
+        psDefn->ProjParmId[1] = ProjNatOriginLongGeoKey;
+        psDefn->ProjParm[4] = dfNatOriginScale;
+        psDefn->ProjParmId[4] = ProjScaleAtNatOriginGeoKey;
+        psDefn->ProjParm[5] = dfFalseEasting;
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[6] = dfFalseNorthing;
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        psDefn->nParms = 7;
+        break;
+
+/* -------------------------------------------------------------------- */
+      case CT_ObliqueMercator: /* hotine */
+/* -------------------------------------------------------------------- */
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLongGeoKey, 
+                       &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0 )
+            dfNatOriginLong = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLatGeoKey, 
+                       &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0 )
+            dfNatOriginLat = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjAzimuthAngleGeoKey, 
+                       &dfAzimuth, 0, 1 ) == 0 )
+            dfAzimuth = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjRectifiedGridAngleGeoKey,
+                       &dfRectGridAngle, 0, 1 ) == 0 )
+            dfRectGridAngle = 90.0;
+
+        if( GTIFKeyGet(psGTIF, ProjScaleAtNatOriginGeoKey,
+                       &dfNatOriginScale, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjScaleAtCenterGeoKey,
+                          &dfNatOriginScale, 0, 1 ) == 0 )
+            dfNatOriginScale = 1.0;
+            
+        /* notdef: should transform to decimal degrees at this point */
+
+        psDefn->ProjParm[0] = dfNatOriginLat;
+        psDefn->ProjParmId[0] = ProjCenterLatGeoKey;
+        psDefn->ProjParm[1] = dfNatOriginLong;
+        psDefn->ProjParmId[1] = ProjCenterLongGeoKey;
+        psDefn->ProjParm[2] = dfAzimuth;
+        psDefn->ProjParmId[2] = ProjAzimuthAngleGeoKey;
+        psDefn->ProjParm[3] = dfRectGridAngle;
+        psDefn->ProjParmId[3] = ProjRectifiedGridAngleGeoKey;
+        psDefn->ProjParm[4] = dfNatOriginScale;
+        psDefn->ProjParmId[4] = ProjScaleAtCenterGeoKey;
+        psDefn->ProjParm[5] = dfFalseEasting;
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[6] = dfFalseNorthing;
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        psDefn->nParms = 7;
+        break;
+
+/* -------------------------------------------------------------------- */
+      case CT_CassiniSoldner:
+      case CT_Polyconic:
+/* -------------------------------------------------------------------- */
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLongGeoKey, 
+                       &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0 )
+            dfNatOriginLong = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLatGeoKey, 
+                       &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0 )
+            dfNatOriginLat = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjScaleAtNatOriginGeoKey,
+                       &dfNatOriginScale, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjScaleAtCenterGeoKey,
+                          &dfNatOriginScale, 0, 1 ) == 0 )
+            dfNatOriginScale = 1.0;
+            
+        /* notdef: should transform to decimal degrees at this point */
+
+        psDefn->ProjParm[0] = dfNatOriginLat;
+        psDefn->ProjParmId[0] = ProjNatOriginLatGeoKey;
+        psDefn->ProjParm[1] = dfNatOriginLong;
+        psDefn->ProjParmId[1] = ProjNatOriginLongGeoKey;
+        psDefn->ProjParm[4] = dfNatOriginScale;
+        psDefn->ProjParmId[4] = ProjScaleAtNatOriginGeoKey;
+        psDefn->ProjParm[5] = dfFalseEasting;
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[6] = dfFalseNorthing;
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        psDefn->nParms = 7;
+        break;
+
+/* -------------------------------------------------------------------- */
+      case CT_AzimuthalEquidistant:
+      case CT_MillerCylindrical:
+      case CT_Equirectangular:
+      case CT_Gnomonic:
+      case CT_LambertAzimEqualArea:
+      case CT_Orthographic:
+/* -------------------------------------------------------------------- */
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLongGeoKey, 
+                       &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0 )
+            dfNatOriginLong = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLatGeoKey, 
+                       &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0 )
+            dfNatOriginLat = 0.0;
+
+        /* notdef: should transform to decimal degrees at this point */
+
+        psDefn->ProjParm[0] = dfNatOriginLat;
+        psDefn->ProjParmId[0] = ProjCenterLatGeoKey;
+        psDefn->ProjParm[1] = dfNatOriginLong;
+        psDefn->ProjParmId[1] = ProjCenterLongGeoKey;
+        psDefn->ProjParm[5] = dfFalseEasting;
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[6] = dfFalseNorthing;
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        psDefn->nParms = 7;
+        break;
+
+/* -------------------------------------------------------------------- */
+      case CT_Robinson:
+      case CT_Sinusoidal:
+      case CT_VanDerGrinten:
+/* -------------------------------------------------------------------- */
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLongGeoKey, 
+                       &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0 )
+            dfNatOriginLong = 0.0;
+
+        /* notdef: should transform to decimal degrees at this point */
+
+        psDefn->ProjParm[1] = dfNatOriginLong;
+        psDefn->ProjParmId[1] = ProjCenterLongGeoKey;
+        psDefn->ProjParm[5] = dfFalseEasting;
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[6] = dfFalseNorthing;
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        psDefn->nParms = 7;
+        break;
+
+/* -------------------------------------------------------------------- */
+      case CT_PolarStereographic:
+/* -------------------------------------------------------------------- */
+        if( GTIFKeyGet(psGTIF, ProjStraightVertPoleLongGeoKey, 
+                       &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjNatOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0 )
+            dfNatOriginLong = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLatGeoKey, 
+                       &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0 )
+            dfNatOriginLat = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjScaleAtNatOriginGeoKey,
+                       &dfNatOriginScale, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjScaleAtCenterGeoKey,
+                          &dfNatOriginScale, 0, 1 ) == 0 )
+            dfNatOriginScale = 1.0;
+            
+        /* notdef: should transform to decimal degrees at this point */
+
+        psDefn->ProjParm[0] = dfNatOriginLat;
+        psDefn->ProjParmId[0] = ProjNatOriginLatGeoKey;;
+        psDefn->ProjParm[1] = dfNatOriginLong;
+        psDefn->ProjParmId[1] = ProjStraightVertPoleLongGeoKey;
+        psDefn->ProjParm[4] = dfNatOriginScale;
+        psDefn->ProjParmId[4] = ProjScaleAtNatOriginGeoKey;
+        psDefn->ProjParm[5] = dfFalseEasting;
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[6] = dfFalseNorthing;
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        psDefn->nParms = 7;
+        break;
+
+/* -------------------------------------------------------------------- */
+      case CT_LambertConfConic_2SP:
+/* -------------------------------------------------------------------- */
+        if( GTIFKeyGet(psGTIF, ProjStdParallel1GeoKey, 
+                       &dfStdParallel1, 0, 1 ) == 0 )
+            dfStdParallel1 = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjStdParallel2GeoKey, 
+                       &dfStdParallel2, 0, 1 ) == 0 )
+            dfStdParallel1 = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLongGeoKey, 
+                       &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0 )
+            dfNatOriginLong = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLatGeoKey, 
+                       &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0 )
+            dfNatOriginLat = 0.0;
+
+        /* notdef: should transform to decimal degrees at this point */
+
+        psDefn->ProjParm[0] = dfNatOriginLat;
+        psDefn->ProjParmId[0] = ProjFalseOriginLatGeoKey;
+        psDefn->ProjParm[1] = dfNatOriginLong;
+        psDefn->ProjParmId[1] = ProjFalseOriginLongGeoKey;
+        psDefn->ProjParm[2] = dfStdParallel1;
+        psDefn->ProjParmId[2] = ProjStdParallel1GeoKey;
+        psDefn->ProjParm[3] = dfStdParallel2;
+        psDefn->ProjParmId[3] = ProjStdParallel2GeoKey;
+        psDefn->ProjParm[5] = dfFalseEasting;
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[6] = dfFalseNorthing;
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        psDefn->nParms = 7;
+        break;
+
+/* -------------------------------------------------------------------- */
+      case CT_AlbersEqualArea:
+      case CT_EquidistantConic:
+/* -------------------------------------------------------------------- */
+        if( GTIFKeyGet(psGTIF, ProjStdParallel1GeoKey, 
+                       &dfStdParallel1, 0, 1 ) == 0 )
+            dfStdParallel1 = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjStdParallel2GeoKey, 
+                       &dfStdParallel2, 0, 1 ) == 0 )
+            dfStdParallel2 = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLongGeoKey, 
+                       &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0 )
+            dfNatOriginLong = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLatGeoKey, 
+                       &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLatGeoKey, 
+                          &dfNatOriginLat, 0, 1 ) == 0 )
+            dfNatOriginLat = 0.0;
+
+        /* notdef: should transform to decimal degrees at this point */
+
+        psDefn->ProjParm[0] = dfStdParallel1;
+        psDefn->ProjParmId[0] = ProjStdParallel1GeoKey;
+        psDefn->ProjParm[1] = dfStdParallel2;
+        psDefn->ProjParmId[1] = ProjStdParallel2GeoKey;
+        psDefn->ProjParm[2] = dfNatOriginLat;
+        psDefn->ProjParmId[2] = ProjNatOriginLatGeoKey;
+        psDefn->ProjParm[3] = dfNatOriginLong;
+        psDefn->ProjParmId[3] = ProjNatOriginLongGeoKey;
+        psDefn->ProjParm[5] = dfFalseEasting;
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[6] = dfFalseNorthing;
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        psDefn->nParms = 7;
+        break;
+
+/* -------------------------------------------------------------------- */
+      case CT_CylindricalEqualArea:
+/* -------------------------------------------------------------------- */
+        if( GTIFKeyGet(psGTIF, ProjStdParallel1GeoKey, 
+                       &dfStdParallel1, 0, 1 ) == 0 )
+            dfStdParallel1 = 0.0;
+
+        if( GTIFKeyGet(psGTIF, ProjNatOriginLongGeoKey, 
+                       &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjFalseOriginLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0
+            && GTIFKeyGet(psGTIF, ProjCenterLongGeoKey, 
+                          &dfNatOriginLong, 0, 1 ) == 0 )
+            dfNatOriginLong = 0.0;
+
+        /* notdef: should transform to decimal degrees at this point */
+
+        psDefn->ProjParm[0] = dfStdParallel1;
+        psDefn->ProjParmId[0] = ProjStdParallel1GeoKey;
+        psDefn->ProjParm[1] = dfNatOriginLong;
+        psDefn->ProjParmId[1] = ProjNatOriginLongGeoKey;
+        psDefn->ProjParm[5] = dfFalseEasting;
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[6] = dfFalseNorthing;
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        psDefn->nParms = 7;
+        break;
+    }
+}
+
+/************************************************************************/
+/*                            GTIFGetDefn()                             */
+/************************************************************************/
+
+/**
+ at param psGTIF GeoTIFF information handle as returned by GTIFNew.
+ at param psDefn Pointer to an existing GTIFDefn structure.  This structure
+does not need to have been pre-initialized at all.
+
+ at return TRUE if the function has been successful, otherwise FALSE.
+
+This function reads the coordinate system definition from a GeoTIFF file,
+and <i>normalizes</i> it into a set of component information using 
+definitions from CSV (Comma Seperated Value ASCII) files derived from 
+EPSG tables.  This function is intended to simplify correct support for
+reading files with defined PCS (Projected Coordinate System) codes that
+wouldn't otherwise be directly known by application software by reducing
+it to the underlying projection method, parameters, datum, ellipsoid, 
+prime meridian and units.<p>
+
+The application should pass a pointer to an existing uninitialized 
+GTIFDefn structure, and GTIFGetDefn() will fill it in.  The fuction 
+currently always returns TRUE but in the future will return FALSE if 
+CSV files are not found.  In any event, all geokeys actually found in the
+file will be copied into the GTIFDefn.  However, if the CSV files aren't
+found codes implied by other codes will not be set properly.<p>
+
+GTIFGetDefn() will not generally work if the EPSG derived CSV files cannot
+be found.  By default a modest attempt will be made to find them, but 
+in general it is necessary for the calling application to override the
+logic to find them.  This can be done by calling the 
+SetCSVFilenameHook() function to
+override the search method based on application knowledge of where they are
+found.<p>
+
+The normalization methodology operates by fetching tags from the GeoTIFF
+file, and then setting all other tags implied by them in the structure.  The
+implied relationships are worked out by reading definitions from the 
+various EPSG derived CSV tables.<p>
+
+For instance, if a PCS (ProjectedCSTypeGeoKey) is found in the GeoTIFF file
+this code is used to lookup a record in the <tt>horiz_cs.csv</tt> CSV
+file.  For example given the PCS 26746 we can find the name
+(NAD27 / California zone VI), the GCS 4257 (NAD27), and the ProjectionCode
+10406 (California CS27 zone VI).  The GCS, and ProjectionCode can in turn
+be looked up in other tables until all the details of units, ellipsoid, 
+prime meridian, datum, projection (LambertConfConic_2SP) and projection
+parameters are established.  A full listgeo dump of a file 
+for this result might look like the following, all based on a single PCS
+value:<p>
+
+<pre>
+% listgeo -norm ~/data/geotiff/pci_eg/spaf27.tif
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 1.0
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         1577139.71       634349.176       0                
+      ModelPixelScaleTag (1,3):
+         195.509321       198.32184        0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_NAD27_California_VI
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 26746 (NAD27 / California zone VI)
+Projection = 10406 (California CS27 zone VI)
+Projection Method: CT_LambertConfConic_2SP
+   ProjStdParallel1GeoKey: 33.883333
+   ProjStdParallel2GeoKey: 32.766667
+   ProjFalseOriginLatGeoKey: 32.166667
+   ProjFalseOriginLongGeoKey: -116.233333
+   ProjFalseEastingGeoKey: 609601.219202
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4267/NAD27
+Datum: 6267/North American Datum 1927
+Ellipsoid: 7008/Clarke 1866 (6378206.40,6356583.80)
+Prime Meridian: 8901/Greenwich (0.000000)
+Projection Linear Units: 9003/US survey foot (0.304801m)
+</pre>
+
+Note that GTIFGetDefn() does not inspect or return the tiepoints and scale.
+This must be handled seperately as it normally would.  It is intended to
+simplify capture and normalization of the coordinate system definition.  
+Note that GTIFGetDefn() also does the following things:
+
+<ol>
+<li> Convert all angular values to decimal degrees.
+<li> Convert all linear values to meters. 
+<li> Return the linear units and conversion to meters for the tiepoints and
+scale (though the tiepoints and scale remain in their native units). 
+<li> When reading projection parameters a variety of differences between
+different GeoTIFF generators are handled, and a normalized set of parameters
+for each projection are always returned.
+</ol>
+
+Code fields in the GTIFDefn are filled with KvUserDefined if there is not
+value to assign.  The parameter lists for each of the underlying projection
+transform methods can be found at the
+<a href="http://www.remotesensing.org/geotiff/proj_list">Projections</a>
+page.  Note that nParms will be set based on the maximum parameter used.
+Some of the parameters may not be used in which case the
+GTIFDefn::ProjParmId[] will
+be zero.  This is done to retain correspondence to the EPSG parameter
+numbering scheme.<p>
+
+The 
+<a href="http://www.remotesensing.org/cgi-bin/cvsweb.cgi/~checkout~/osrs/geotiff/libgeotiff/geotiff_proj4.c">geotiff_proj4.c</a> module distributed with libgeotiff can 
+be used as an example of code that converts a GTIFDefn into another projection
+system.<p>
+
+ at see GTIFKeySet(), SetCSVFilenameHook()
+
+*/
+
+int GTIFGetDefn( GTIF * psGTIF, GTIFDefn * psDefn )
+
+{
+    int		i;
+    short	nGeogUOMLinear;
+    double	dfInvFlattening;
+    
+/* -------------------------------------------------------------------- */
+/*      Initially we default all the information we can.                */
+/* -------------------------------------------------------------------- */
+    psDefn->Model = KvUserDefined;
+    psDefn->PCS = KvUserDefined;
+    psDefn->GCS = KvUserDefined;
+    psDefn->UOMLength = KvUserDefined;
+    psDefn->UOMLengthInMeters = 1.0;
+    psDefn->UOMAngle = KvUserDefined;
+    psDefn->UOMAngleInDegrees = 1.0;
+    psDefn->Datum = KvUserDefined;
+    psDefn->Ellipsoid = KvUserDefined;
+    psDefn->SemiMajor = 0.0;
+    psDefn->SemiMinor = 0.0;
+    psDefn->PM = KvUserDefined;
+    psDefn->PMLongToGreenwich = 0.0;
+
+    psDefn->ProjCode = KvUserDefined;
+    psDefn->Projection = KvUserDefined;
+    psDefn->CTProjection = KvUserDefined;
+
+    psDefn->nParms = 0;
+    for( i = 0; i < MAX_GTIF_PROJPARMS; i++ )
+    {
+        psDefn->ProjParm[i] = 0.0;
+        psDefn->ProjParmId[i] = 0;
+    }
+
+    psDefn->MapSys = KvUserDefined;
+    psDefn->Zone = 0;
+
+/* -------------------------------------------------------------------- */
+/*	Try to get the overall model type.				*/
+/* -------------------------------------------------------------------- */
+    GTIFKeyGet(psGTIF,GTModelTypeGeoKey,&(psDefn->Model),0,1);
+
+/* -------------------------------------------------------------------- */
+/*	Extract the Geog units.  					*/
+/* -------------------------------------------------------------------- */
+    nGeogUOMLinear = 9001; /* Linear_Meter */
+    GTIFKeyGet(psGTIF, GeogLinearUnitsGeoKey, &nGeogUOMLinear, 0, 1 );
+
+/* -------------------------------------------------------------------- */
+/*      Try to get a PCS.                                               */
+/* -------------------------------------------------------------------- */
+    if( GTIFKeyGet(psGTIF,ProjectedCSTypeGeoKey, &(psDefn->PCS),0,1) == 1
+        && psDefn->PCS != KvUserDefined )
+    {
+        /*
+         * Translate this into useful information.
+         */
+        GTIFGetPCSInfo( psDefn->PCS, NULL, &(psDefn->ProjCode),
+                        &(psDefn->UOMLength), &(psDefn->GCS) );
+    }
+
+/* -------------------------------------------------------------------- */
+/*       If we have the PCS code, but didn't find it in the CSV files   */
+/*      (likely because we can't find them) we will try some ``jiffy    */
+/*      rules'' for UTM and state plane.                                */
+/* -------------------------------------------------------------------- */
+    if( psDefn->PCS != KvUserDefined && psDefn->ProjCode == KvUserDefined )
+    {
+        int	nMapSys, nZone;
+        int	nGCS = psDefn->GCS;
+
+        nMapSys = GTIFPCSToMapSys( psDefn->PCS, &nGCS, &nZone );
+        if( nMapSys != KvUserDefined )
+        {
+            psDefn->ProjCode = (short) GTIFMapSysToProj( nMapSys, nZone );
+            psDefn->GCS = (short) nGCS;
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      If the Proj_ code is specified directly, use that.              */
+/* -------------------------------------------------------------------- */
+    if( psDefn->ProjCode == KvUserDefined )
+        GTIFKeyGet(psGTIF, ProjectionGeoKey, &(psDefn->ProjCode), 0, 1 );
+    
+    if( psDefn->ProjCode != KvUserDefined )
+    {
+        /*
+         * We have an underlying projection transformation value.  Look
+         * this up.  For a PCS of ``WGS 84 / UTM 11'' the transformation
+         * would be Transverse Mercator, with a particular set of options.
+         * The nProjTRFCode itself would correspond to the name
+         * ``UTM zone 11N'', and doesn't include datum info.
+         */
+        GTIFGetProjTRFInfo( psDefn->ProjCode, NULL, &(psDefn->Projection),
+                            psDefn->ProjParm );
+        
+        /*
+         * Set the GeoTIFF identity of the parameters.
+         */
+        psDefn->CTProjection = (short) 
+            EPSGProjMethodToCTProjMethod( psDefn->Projection );
+
+        SetGTParmIds( psDefn->CTProjection, psDefn->ProjParmId, NULL);
+        psDefn->nParms = 7;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Try to get a GCS.  If found, it will override any implied by    */
+/*      the PCS.                                                        */
+/* -------------------------------------------------------------------- */
+    GTIFKeyGet(psGTIF, GeographicTypeGeoKey, &(psDefn->GCS), 0, 1 );
+
+/* -------------------------------------------------------------------- */
+/*      Derive the datum, and prime meridian from the GCS.              */
+/* -------------------------------------------------------------------- */
+    if( psDefn->GCS != KvUserDefined )
+    {
+        GTIFGetGCSInfo( psDefn->GCS, NULL, &(psDefn->Datum), &(psDefn->PM),
+                        &(psDefn->UOMAngle) );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Handle the GCS angular units.  GeogAngularUnitsGeoKey           */
+/*      overrides the GCS or PCS setting.                               */
+/* -------------------------------------------------------------------- */
+    GTIFKeyGet(psGTIF, GeogAngularUnitsGeoKey, &(psDefn->UOMAngle), 0, 1 );
+    if( psDefn->UOMAngle != KvUserDefined )
+    {
+        GTIFGetUOMAngleInfo( psDefn->UOMAngle, NULL,
+                             &(psDefn->UOMAngleInDegrees) );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Check for a datum setting, and then use the datum to derive     */
+/*      an ellipsoid.                                                   */
+/* -------------------------------------------------------------------- */
+    GTIFKeyGet(psGTIF, GeogGeodeticDatumGeoKey, &(psDefn->Datum), 0, 1 );
+
+    if( psDefn->Datum != KvUserDefined )
+    {
+        GTIFGetDatumInfo( psDefn->Datum, NULL, &(psDefn->Ellipsoid) );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Check for an explicit ellipsoid.  Use the ellipsoid to          */
+/*      derive the ellipsoid characteristics, if possible.              */
+/* -------------------------------------------------------------------- */
+    GTIFKeyGet(psGTIF, GeogEllipsoidGeoKey, &(psDefn->Ellipsoid), 0, 1 );
+
+    if( psDefn->Ellipsoid != KvUserDefined )
+    {
+        GTIFGetEllipsoidInfo( psDefn->Ellipsoid, NULL,
+                              &(psDefn->SemiMajor), &(psDefn->SemiMinor) );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Check for overridden ellipsoid parameters.  It would be nice    */
+/*      to warn if they conflict with provided information, but for     */
+/*      now we just override.                                           */
+/* -------------------------------------------------------------------- */
+    GTIFKeyGet(psGTIF, GeogSemiMajorAxisGeoKey, &(psDefn->SemiMajor), 0, 1 );
+    GTIFKeyGet(psGTIF, GeogSemiMinorAxisGeoKey, &(psDefn->SemiMinor), 0, 1 );
+    
+    if( GTIFKeyGet(psGTIF, GeogInvFlatteningGeoKey, &dfInvFlattening, 
+                   0, 1 ) == 1 )
+    {
+        if( dfInvFlattening != 0.0 )
+            psDefn->SemiMinor = 
+                psDefn->SemiMajor * (1 - 1.0/dfInvFlattening);
+        else
+            psDefn->SemiMinor = psDefn->SemiMajor;
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Get the prime meridian info.                                    */
+/* -------------------------------------------------------------------- */
+    GTIFKeyGet(psGTIF, GeogPrimeMeridianGeoKey, &(psDefn->PM), 0, 1 );
+
+    if( psDefn->PM != KvUserDefined )
+    {
+        GTIFGetPMInfo( psDefn->PM, NULL, &(psDefn->PMLongToGreenwich) );
+    }
+    else
+    {
+        GTIFKeyGet(psGTIF, GeogPrimeMeridianLongGeoKey,
+                   &(psDefn->PMLongToGreenwich), 0, 1 );
+
+        psDefn->PMLongToGreenwich =
+            GTIFAngleToDD( psDefn->PMLongToGreenwich,
+                           psDefn->UOMAngle );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Have the projection units of measure been overridden?  We       */
+/*      should likely be doing something about angular units too,       */
+/*      but these are very rarely not decimal degrees for actual        */
+/*      file coordinates.                                               */
+/* -------------------------------------------------------------------- */
+    GTIFKeyGet(psGTIF,ProjLinearUnitsGeoKey,&(psDefn->UOMLength),0,1);
+
+    if( psDefn->UOMLength != KvUserDefined )
+    {
+        GTIFGetUOMLengthInfo( psDefn->UOMLength, NULL,
+                              &(psDefn->UOMLengthInMeters) );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Handle a variety of user defined transform types.               */
+/* -------------------------------------------------------------------- */
+    if( GTIFKeyGet(psGTIF,ProjCoordTransGeoKey,
+                   &(psDefn->CTProjection),0,1) == 1)
+    {
+        GTIFFetchProjParms( psGTIF, psDefn );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Try to set the zoned map system information.                    */
+/* -------------------------------------------------------------------- */
+    psDefn->MapSys = GTIFProjToMapSys( psDefn->ProjCode, &(psDefn->Zone) );
+
+/* -------------------------------------------------------------------- */
+/*      If this is UTM, and we were unable to extract the projection    */
+/*      parameters from the CSV file, just set them directly now,       */
+/*      since it's pretty easy, and a common case.                      */
+/* -------------------------------------------------------------------- */
+    if( (psDefn->MapSys == MapSys_UTM_North
+         || psDefn->MapSys == MapSys_UTM_South)
+        && psDefn->CTProjection == KvUserDefined )
+    {
+        psDefn->CTProjection = CT_TransverseMercator;
+        psDefn->nParms = 7;
+        psDefn->ProjParmId[0] = ProjNatOriginLatGeoKey;
+        psDefn->ProjParm[0] = 0.0;
+            
+        psDefn->ProjParmId[1] = ProjNatOriginLongGeoKey;
+        psDefn->ProjParm[1] = psDefn->Zone*6 - 183.0;
+        
+        psDefn->ProjParmId[4] = ProjScaleAtNatOriginGeoKey;
+        psDefn->ProjParm[4] = 0.9996;
+        
+        psDefn->ProjParmId[5] = ProjFalseEastingGeoKey;
+        psDefn->ProjParm[5] = 500000.0;
+        
+        psDefn->ProjParmId[6] = ProjFalseNorthingGeoKey;
+
+        if( psDefn->MapSys == MapSys_UTM_North )
+            psDefn->ProjParm[6] = 0.0;
+        else
+            psDefn->ProjParm[6] = 10000000.0;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      For now we forceable deaccess all CSV files to reduce the       */
+/*      chance of "leakage".  Really, this should be application        */
+/*      controlled.                                                     */
+/* -------------------------------------------------------------------- */
+    CSVDeaccess( NULL );
+
+    return TRUE;
+}
+
+/************************************************************************/
+/*                            GTIFDecToDMS()                            */
+/*                                                                      */
+/*      Convenient function to translate decimal degrees to DMS         */
+/*      format for reporting to a user.                                 */
+/************************************************************************/
+
+const char *GTIFDecToDMS( double dfAngle, const char * pszAxis,
+                          int nPrecision )
+
+{
+    int		nDegrees, nMinutes;
+    double	dfSeconds;
+    char	szFormat[30];
+    static char szBuffer[50];
+    const char	*pszHemisphere = NULL;
+    double	dfRound;
+    int		i;
+
+    dfRound = 0.5/60;
+    for( i = 0; i < nPrecision; i++ )
+        dfRound = dfRound * 0.1;
+
+    nDegrees = (int) ABS(dfAngle);
+    nMinutes = (int) ((ABS(dfAngle) - nDegrees) * 60 + dfRound);
+    dfSeconds = ABS((ABS(dfAngle) * 3600 - nDegrees*3600 - nMinutes*60));
+
+    if( EQUAL(pszAxis,"Long") && dfAngle < 0.0 )
+        pszHemisphere = "W";
+    else if( EQUAL(pszAxis,"Long") )
+        pszHemisphere = "E";
+    else if( dfAngle < 0.0 )
+        pszHemisphere = "S";
+    else
+        pszHemisphere = "N";
+
+    sprintf( szFormat, "%%3dd%%2d\'%%%d.%df\"%s",
+             nPrecision+3, nPrecision, pszHemisphere );
+    sprintf( szBuffer, szFormat, nDegrees, nMinutes, dfSeconds );
+
+    return( szBuffer );
+}
+
+/************************************************************************/
+/*                           GTIFPrintDefn()                            */
+/*                                                                      */
+/*      Report the contents of a GTIFDefn structure ... mostly for      */
+/*      debugging.                                                      */
+/************************************************************************/
+
+void GTIFPrintDefn( GTIFDefn * psDefn, FILE * fp )
+
+{
+/* -------------------------------------------------------------------- */
+/*      Get the PCS name if possible.                                   */
+/* -------------------------------------------------------------------- */
+    if( psDefn->PCS != KvUserDefined )
+    {
+        char	*pszPCSName = NULL;
+    
+        GTIFGetPCSInfo( psDefn->PCS, &pszPCSName, NULL, NULL, NULL );
+        if( pszPCSName == NULL )
+            pszPCSName = CPLStrdup("name unknown");
+        
+        fprintf( fp, "PCS = %d (%s)\n", psDefn->PCS, pszPCSName );
+        CPLFree( pszPCSName );
+    }
+
+/* -------------------------------------------------------------------- */
+/*	Dump the projection code if possible.				*/
+/* -------------------------------------------------------------------- */
+    if( psDefn->ProjCode != KvUserDefined )
+    {
+        char	*pszTRFName = NULL;
+
+        GTIFGetProjTRFInfo( psDefn->ProjCode, &pszTRFName, NULL, NULL );
+        if( pszTRFName == NULL )
+            pszTRFName = CPLStrdup("");
+                
+        fprintf( fp, "Projection = %d (%s)\n",
+                 psDefn->ProjCode, pszTRFName );
+
+        CPLFree( pszTRFName );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Try to dump the projection method name, and parameters if possible.*/
+/* -------------------------------------------------------------------- */
+    if( psDefn->CTProjection != KvUserDefined )
+    {
+        char	*pszName = GTIFValueName(ProjCoordTransGeoKey,
+                                         psDefn->CTProjection);
+        int     i;
+
+        if( pszName == NULL )
+            pszName = "(unknown)";
+            
+        fprintf( fp, "Projection Method: %s\n", pszName );
+
+        for( i = 0; i < psDefn->nParms; i++ )
+        {
+            if( psDefn->ProjParmId[i] == 0 )
+                continue;
+
+            pszName = GTIFKeyName((geokey_t) psDefn->ProjParmId[i]);
+            if( pszName == NULL )
+                pszName = "(unknown)";
+
+            if( i < 4 )
+            {
+                char	*pszAxisName;
+                
+                if( strstr(pszName,"Long") != NULL )
+                    pszAxisName = "Long";
+                else if( strstr(pszName,"Lat") != NULL )
+                    pszAxisName = "Lat";
+                else
+                    pszAxisName = "?";
+                
+                fprintf( fp, "   %s: %f (%s)\n",
+                         pszName, psDefn->ProjParm[i],
+                         GTIFDecToDMS( psDefn->ProjParm[i], pszAxisName, 2 ) );
+            }
+            else if( i == 4 )
+                fprintf( fp, "   %s: %f\n", pszName, psDefn->ProjParm[i] );
+            else
+                fprintf( fp, "   %s: %f m\n", pszName, psDefn->ProjParm[i] );
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Report the GCS name, and number.                                */
+/* -------------------------------------------------------------------- */
+    if( psDefn->GCS != KvUserDefined )
+    {
+        char	*pszName = NULL;
+
+        GTIFGetGCSInfo( psDefn->GCS, &pszName, NULL, NULL, NULL );
+        if( pszName == NULL )
+            pszName = CPLStrdup("(unknown)");
+        
+        fprintf( fp, "GCS: %d/%s\n", psDefn->GCS, pszName );
+        CPLFree( pszName );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Report the datum name.                                          */
+/* -------------------------------------------------------------------- */
+    if( psDefn->Datum != KvUserDefined )
+    {
+        char	*pszName = NULL;
+
+        GTIFGetDatumInfo( psDefn->Datum, &pszName, NULL );
+        if( pszName == NULL )
+            pszName = CPLStrdup("(unknown)");
+        
+        fprintf( fp, "Datum: %d/%s\n", psDefn->Datum, pszName );
+        CPLFree( pszName );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Report the ellipsoid.                                           */
+/* -------------------------------------------------------------------- */
+    if( psDefn->Ellipsoid != KvUserDefined )
+    {
+        char	*pszName = NULL;
+
+        GTIFGetEllipsoidInfo( psDefn->Ellipsoid, &pszName, NULL, NULL );
+        if( pszName == NULL )
+            pszName = CPLStrdup("(unknown)");
+        
+        fprintf( fp, "Ellipsoid: %d/%s (%.2f,%.2f)\n",
+                 psDefn->Ellipsoid, pszName,
+                 psDefn->SemiMajor, psDefn->SemiMinor );
+        CPLFree( pszName );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Report the prime meridian.                                      */
+/* -------------------------------------------------------------------- */
+    if( psDefn->PM != KvUserDefined )
+    {
+        char	*pszName = NULL;
+
+        GTIFGetPMInfo( psDefn->PM, &pszName, NULL );
+
+        if( pszName == NULL )
+            pszName = CPLStrdup("(unknown)");
+        
+        fprintf( fp, "Prime Meridian: %d/%s (%f/%s)\n",
+                 psDefn->PM, pszName,
+                 psDefn->PMLongToGreenwich,
+                 GTIFDecToDMS( psDefn->PMLongToGreenwich, "Long", 2 ) );
+        CPLFree( pszName );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Report the projection units of measure (currently just          */
+/*      linear).                                                        */
+/* -------------------------------------------------------------------- */
+    if( psDefn->UOMLength != KvUserDefined )
+    {
+        char	*pszName = NULL;
+
+        GTIFGetUOMLengthInfo( psDefn->UOMLength, &pszName, NULL );
+        if( pszName == NULL )
+            pszName = CPLStrdup( "(unknown)" );
+        
+        fprintf( fp, "Projection Linear Units: %d/%s (%fm)\n",
+                 psDefn->UOMLength, pszName, psDefn->UOMLengthInMeters );
+        CPLFree( pszName );
+    }
+
+    CSVDeaccess( NULL );
+}
+
+/************************************************************************/
+/*                           GTIFFreeMemory()                           */
+/*                                                                      */
+/*      Externally visible function to free memory allocated within     */
+/*      geo_normalize.c.                                                */
+/************************************************************************/
+
+void GTIFFreeMemory( char * pMemory )
+
+{
+    if( pMemory != NULL )
+        VSIFree( pMemory );
+}
+
+/************************************************************************/
+/*                          GTIFDeaccessCSV()                           */
+/*                                                                      */
+/*      Free all cached CSV info.                                       */
+/************************************************************************/
+
+void GTIFDeaccessCSV()
+
+{
+    CSVDeaccess( NULL );
+}
diff --git a/src/tiff/geo_normalize.h b/src/tiff/geo_normalize.h
new file mode 100644
index 0000000..332b389
--- /dev/null
+++ b/src/tiff/geo_normalize.h
@@ -0,0 +1,238 @@
+/******************************************************************************
+ * $Id: geo_normalize.h 4825 2006-08-16 13:01:53Z lubia $
+ *
+ * Project:  libgeotiff
+ * Purpose:  Include file related to geo_normalize.c containing Code to
+ *           normalize PCS and other composite codes in a GeoTIFF file.
+ * Author:   Frank Warmerdam, warmerda at home.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log$
+ * Revision 1.12  2005/08/26 16:08:14  fwarmerdam
+ * Include void in empty argument list for prototype.
+ *
+ * Revision 1.11  2004/02/03 17:19:50  warmerda
+ * export GTIFAngleToDD() - used by GDAL mrsiddataset.cpp
+ *
+ * Revision 1.10  2003/01/15 04:39:16  warmerda
+ * Added GTIFDeaccessCSV
+ *
+ * Revision 1.9  2003/01/15 03:37:40  warmerda
+ * added GTIFFreeMemory()
+ *
+ * Revision 1.8  2002/11/28 22:27:42  warmerda
+ * preliminary upgrade to EPSG 6.2.2 tables
+ *
+ * Revision 1.7  1999/09/17 00:55:26  warmerda
+ * added GTIFGetUOMAngleInfo(), and UOMAngle in GTIFDefn
+ *
+ * Revision 1.6  1999/05/04 03:13:42  warmerda
+ * Added prototype
+ *
+ * Revision 1.5  1999/04/29 23:02:55  warmerda
+ * added docs, and MapSys related stuff
+ *
+ * Revision 1.4  1999/03/18 21:35:19  geotiff
+ * Added PROJ.4 related stuff
+ *
+ * Revision 1.3  1999/03/17 20:44:04  geotiff
+ * added CPL_DLL related support
+ *
+ * Revision 1.2  1999/03/10 18:24:06  geotiff
+ * corrected to use int'
+ *
+ */
+
+#ifndef GEO_NORMALIZE_H_INCLUDED
+#define GEO_NORMALIZE_H_INCLUDED
+
+#include <stdio.h>
+#include "geotiff.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \file geo_normalize.h
+ *
+ * Include file for extended projection definition normalization api.
+ */
+    
+#define MAX_GTIF_PROJPARMS 	10
+
+/**
+ * Holds a definition of a coordinate system in normalized form.
+ */
+
+typedef struct {
+    /** From GTModelTypeGeoKey tag.  Can have the values ModelTypeGeographic
+        or ModelTypeProjected. */
+    short	Model;
+
+    /** From ProjectedCSTypeGeoKey tag.  For example PCS_NAD27_UTM_zone_3N.*/
+    short	PCS;
+
+    /** From GeographicTypeGeoKey tag.  For example GCS_WGS_84 or
+        GCS_Voirol_1875_Paris.  Includes datum and prime meridian value. */
+    short	GCS;	      
+
+    /** From ProjLinearUnitsGeoKey.  For example Linear_Meter. */
+    short	UOMLength;
+
+    /** One UOMLength = UOMLengthInMeters meters. */
+    double	UOMLengthInMeters;
+
+    /** The angular units of the GCS. */
+    short       UOMAngle;
+
+    /** One UOMAngle = UOMLengthInDegrees degrees. */
+    double      UOMAngleInDegrees;
+    
+    /** Datum from GeogGeodeticDatumGeoKey tag. For example Datum_WGS84 */
+    short	Datum;
+
+    /** Prime meridian from GeogPrimeMeridianGeoKey.  For example PM_Greenwich
+        or PM_Paris. */
+    short	PM;
+
+    /** Decimal degrees of longitude between this prime meridian and
+        Greenwich.  Prime meridians to the west of Greenwich are negative. */
+    double	PMLongToGreenwich;
+
+    /** Ellipsoid identifier from GeogELlipsoidGeoKey.  For example
+        Ellipse_Clarke_1866. */
+    short	Ellipsoid;
+
+    /** The length of the semi major ellipse axis in meters. */
+    double	SemiMajor;
+
+    /** The length of the semi minor ellipse axis in meters. */
+    double	SemiMinor;
+
+    /** Projection id from ProjectionGeoKey.  For example Proj_UTM_11S. */
+    short	ProjCode;
+
+    /** EPSG identifier for underlying projection method.  From the EPSG
+        TRF_METHOD table.  */
+    short	Projection;
+
+    /** GeoTIFF identifier for underlying projection method.  While some of
+      these values have corresponding vlaues in EPSG (Projection field),
+      others do not.  For example CT_TransverseMercator. */
+    short	CTProjection;   
+
+    /** Number of projection parameters in ProjParm and ProjParmId. */
+    int		nParms;
+
+    /** Projection parameter value.  The identify of this parameter
+        is established from the corresponding entry in ProjParmId.  The
+        value will be measured in meters, or decimal degrees if it is a
+        linear or angular measure. */
+    double	ProjParm[MAX_GTIF_PROJPARMS];
+
+    /** Projection parameter identifier.  For example ProjFalseEastingGeoKey.
+        The value will be 0 for unused table entries. */
+    int		ProjParmId[MAX_GTIF_PROJPARMS]; /* geokey identifier,
+                                                   eg. ProjFalseEastingGeoKey*/
+
+    /** Special zone map system code (MapSys_UTM_South, MapSys_UTM_North,
+        MapSys_State_Plane or KvUserDefined if none apply. */
+    int		MapSys;
+
+    /** UTM, or State Plane Zone number, zero if not known. */
+    int		Zone;
+
+} GTIFDefn;
+
+int CPL_DLL GTIFGetPCSInfo( int nPCSCode, char **ppszEPSGName,
+                            short *pnProjOp, 
+                            short *pnUOMLengthCode, short *pnGeogCS );
+int CPL_DLL GTIFGetProjTRFInfo( int nProjTRFCode,
+                                char ** ppszProjTRFName,
+                                short * pnProjMethod,
+                                double * padfProjParms );
+int CPL_DLL GTIFGetGCSInfo( int nGCSCode, char **ppszName,
+                            short *pnDatum, short *pnPM, short *pnUOMAngle );
+int CPL_DLL GTIFGetDatumInfo( int nDatumCode, char **ppszName,
+                              short * pnEllipsoid );
+int CPL_DLL GTIFGetEllipsoidInfo( int nEllipsoid, char ** ppszName,
+                                  double * pdfSemiMajor,
+                                  double * pdfSemiMinor );
+int CPL_DLL GTIFGetPMInfo( int nPM, char **ppszName,
+                           double * pdfLongToGreenwich );
+
+double CPL_DLL GTIFAngleStringToDD( const char *pszAngle, int nUOMAngle );
+int CPL_DLL GTIFGetUOMLengthInfo( int nUOMLengthCode,
+                                  char **ppszUOMName,
+                                  double * pdfInMeters );
+int CPL_DLL GTIFGetUOMAngleInfo( int nUOMAngleCode,
+                                 char **ppszUOMName,
+                                 double * pdfInDegrees );
+double CPL_DLL GTIFAngleToDD( double dfAngle, int nUOMAngle );
+    
+
+/* this should be used to free strings returned by GTIFGet... funcs */
+void CPL_DLL GTIFFreeMemory( char * );
+void CPL_DLL GTIFDeaccessCSV( void );
+
+int CPL_DLL GTIFGetDefn( GTIF *psGTIF, GTIFDefn * psDefn );
+void CPL_DLL GTIFPrintDefn( GTIFDefn *, FILE * );
+void CPL_DLL GTIFFreeDefn( GTIF * );
+
+void CPL_DLL SetCSVFilenameHook( const char *(*CSVFileOverride)(const char *) );
+
+const char CPL_DLL *GTIFDecToDMS( double, const char *, int );
+
+/*
+ * These are useful for recognising UTM and State Plane, with or without
+ * CSV files being found.
+ */
+
+#define MapSys_UTM_North	-9001
+#define MapSys_UTM_South	-9002
+#define MapSys_State_Plane_27	-9003
+#define MapSys_State_Plane_83	-9004
+
+int CPL_DLL   GTIFMapSysToPCS( int MapSys, int Datum, int nZone );
+int CPL_DLL   GTIFMapSysToProj( int MapSys, int nZone );
+int CPL_DLL   GTIFPCSToMapSys( int PCSCode, int * pDatum, int * pZone );
+int CPL_DLL   GTIFProjToMapSys( int ProjCode, int * pZone );
+
+/*
+ * These are only useful if using libgeotiff with libproj (PROJ.4+).
+ */
+char CPL_DLL *GTIFGetProj4Defn( GTIFDefn * );
+int  CPL_DLL  GTIFProj4ToLatLong( GTIFDefn *, int, double *, double * );
+int  CPL_DLL  GTIFProj4FromLatLong( GTIFDefn *, int, double *, double * );
+
+#if defined(HAVE_LIBPROJ) && defined(HAVE_PROJECTS_H)
+#  define HAVE_GTIFPROJ4
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+    
+#endif /* ndef GEO_NORMALIZE_H_INCLUDED */
diff --git a/src/tiff/geo_print.c b/src/tiff/geo_print.c
new file mode 100644
index 0000000..d8e1c1b
--- /dev/null
+++ b/src/tiff/geo_print.c
@@ -0,0 +1,517 @@
+/**********************************************************************
+ *
+ *  geo_print.c  -- Key-dumping routines for GEOTIFF files.
+ *
+ *    Written By: Niles D. Ritter.
+ *
+ *  copyright (c) 1995   Niles D. Ritter
+ *
+ *  Permission granted to use this software, so long as this copyright
+ *  notice accompanies any products derived therefrom.
+ *
+ *  Revision History;
+ *
+ *    20 June,  1995      Niles D. Ritter      New
+ *     7 July,  1995      NDR                  Fix indexing
+ *    27 July,  1995      NDR                  Added Import utils
+ *    28 July,  1995      NDR                  Made parser more strict.
+ *    29  Sep,  1995      NDR                  Fixed matrix printing.
+ *
+ * $Log$
+ * Revision 1.9  2004/10/19 14:24:09  fwarmerdam
+ * dynamically allocate tag list so large lists work: Oliver Colin
+ *
+ * Revision 1.8  2004/04/27 21:31:31  warmerda
+ * avoid crash if gt_tif is NULL
+ *
+ * Revision 1.7  2003/10/21 19:19:53  warmerda
+ * fixed bug with large message texts sometimes causing a crash
+ *
+ * Revision 1.6  2003/09/23 18:27:30  warmerda
+ * fixed bug with long datum names: bug 399
+ *
+ * Revision 1.5  2003/07/08 17:31:30  warmerda
+ * cleanup various warnings
+ *
+ * Revision 1.4  2002/05/31 14:27:26  warmerda
+ * added escaping in metadata for string key values
+ *
+ * Revision 1.3  1999/05/04 03:14:35  warmerda
+ * avoid warnings
+ *
+ * Revision 1.2  1999/05/03 17:50:31  warmerda
+ * avoid warnings on IRIX
+ *
+ *
+ **********************************************************************/
+
+#include "geotiff.h"   /* public interface        */
+#include "geo_tiffp.h" /* external TIFF interface */
+#include "geo_keyp.h"  /* private interface       */
+#include "geokeys.h"
+
+#include <stdio.h>     /* for sprintf             */
+
+#define FMT_GEOTIFF "Geotiff_Information:"
+#define FMT_VERSION "Version: %hd"
+#define FMT_REV     "Key_Revision: %1hd.%hd"
+#define FMT_TAGS    "Tagged_Information:"
+#define FMT_TAGEND  "End_Of_Tags."
+#define FMT_KEYS    "Keyed_Information:"
+#define FMT_KEYEND  "End_Of_Keys."
+#define FMT_GEOEND  "End_Of_Geotiff."
+#define FMT_DOUBLE  "%-17.9g"
+#define FMT_SHORT   "%-11hd"
+
+static void DefaultPrint(char *string, void *aux);
+static void PrintKey(GeoKey *key, GTIFPrintMethod print,void *aux);
+static void PrintGeoTags(GTIF *gtif,GTIFReadMethod scan,void *aux);
+static void PrintTag(int tag, int nrows, double *data, int ncols, 
+					GTIFPrintMethod print,void *aux);
+static void DefaultRead(char *string, void *aux);
+static int  ReadKey(GTIF *gt, GTIFReadMethod scan, void *aux);
+static int  ReadTag(GTIF *gt,GTIFReadMethod scan,void *aux);
+
+/*
+ * Print off the directory info, using whatever method is specified
+ * (defaults to fprintf if null). The "aux" parameter is provided for user
+ * defined method for passing parameters or whatever.
+ *
+ * The output format is a "GeoTIFF meta-data" file, which may be
+ * used to import information with the GTIFFImport() routine.
+ */
+ 
+void GTIFPrint(GTIF *gtif, GTIFPrintMethod print,void *aux)
+{
+    int i;
+    int numkeys = gtif->gt_num_keys;
+    GeoKey *key = gtif->gt_keys;
+    char message[1024];
+	
+    if (!print) print = (GTIFPrintMethod) &DefaultPrint;
+    if (!aux) aux=stdout;	
+
+    sprintf(message,FMT_GEOTIFF "\n"); 
+    print(message,aux);
+    sprintf(message, "Version: %hd" ,gtif->gt_version);
+    sprintf(message, FMT_VERSION,gtif->gt_version);
+    print("   ",aux); print(message,aux); print("\n",aux);
+    sprintf(message, FMT_REV,gtif->gt_rev_major,
+            gtif->gt_rev_minor); 
+    print("   ",aux); print(message,aux); print("\n",aux);
+
+    sprintf(message,"   %s\n",FMT_TAGS); print(message,aux);
+    PrintGeoTags(gtif,print,aux);
+    sprintf(message,"      %s\n",FMT_TAGEND); print(message,aux);
+
+    sprintf(message,"   %s\n",FMT_KEYS); print(message,aux);
+    for (i=0; i<numkeys; i++)
+        PrintKey(++key,print,aux);
+    sprintf(message,"      %s\n",FMT_KEYEND); print(message,aux);
+
+    sprintf(message,"   %s\n",FMT_GEOEND); print(message,aux);
+}
+
+static void PrintGeoTags(GTIF *gt, GTIFPrintMethod print,void *aux)
+{
+	double *data;
+	int count;
+	tiff_t *tif=gt->gt_tif;
+
+        if( tif == NULL )
+            return;
+
+	if ((gt->gt_methods.get)(tif, GTIFF_TIEPOINTS, &count, &data ))
+		PrintTag(GTIFF_TIEPOINTS,count/3, data, 3, print, aux);
+	if ((gt->gt_methods.get)(tif, GTIFF_PIXELSCALE, &count, &data ))
+		PrintTag(GTIFF_PIXELSCALE,count/3, data, 3, print, aux);
+	if ((gt->gt_methods.get)(tif, GTIFF_TRANSMATRIX, &count, &data ))
+		PrintTag(GTIFF_TRANSMATRIX,count/4, data, 4, print, aux);
+}
+
+static void PrintTag(int tag, int nrows, double *dptr, int ncols, 
+					GTIFPrintMethod print,void *aux)
+{
+	int i,j;
+	double *data=dptr;
+        char message[1024];
+
+	print("      ",aux);
+	print(GTIFTagName(tag),aux);
+	sprintf(message," (%d,%d):\n",nrows,ncols);
+	print(message,aux);
+	for (i=0;i<nrows;i++)
+	{
+		print("         ",aux);
+		for (j=0;j<ncols;j++)
+		{
+			sprintf(message,FMT_DOUBLE,*data++);
+			print(message,aux);
+		}
+		print("\n",aux);
+	}
+	_GTIFFree(dptr); /* free up the allocated memory */
+}
+
+
+static void PrintKey(GeoKey *key, GTIFPrintMethod print, void *aux)
+{
+    char *data;
+    geokey_t keyid = (geokey_t) key->gk_key;
+    int count = key->gk_count;
+    int vals_now,i;
+    pinfo_t *sptr;
+    double *dptr;
+    char message[40];
+
+    print("      ",aux);
+    print(GTIFKeyName(keyid),aux);
+	
+    sprintf(message," (%s,%d): ",GTIFTypeName(key->gk_type),count);
+    print(message,aux);
+	
+    if (key->gk_type==TYPE_SHORT && count==1)
+        data = (char *)&key->gk_data;
+    else
+        data = key->gk_data;
+		
+    switch (key->gk_type)
+    {
+      case TYPE_ASCII: 
+      {
+          int  in_char, out_char;
+
+          print("\"",aux);
+
+          in_char = 0;
+          out_char = 0;
+          while( in_char < count-1 )
+          {
+              char ch = ((char *) data)[in_char++];
+
+              if( ch == '\n' )
+              {
+                  message[out_char++] = '\\';
+                  message[out_char++] = 'n';
+              }
+              else if( ch == '\\' )
+              {
+                  message[out_char++] = '\\';
+                  message[out_char++] = '\\';
+              }
+              else
+                  message[out_char++] = ch;
+
+              /* flush message if buffer full */
+              if( out_char >= sizeof(message)-3 )
+              {
+                  message[out_char] = '\0';
+                  print(message,aux);
+                  out_char = 0;
+              }
+          }
+
+          message[out_char]='\0';
+          print(message,aux);
+
+          print("\"\n",aux);
+      }
+      break;
+        
+      case TYPE_DOUBLE: 
+        for (dptr = (double *)data; count > 0; count-= vals_now)
+        {
+            vals_now = count > 3? 3: count;
+            for (i=0; i<vals_now; i++,dptr++)
+            {
+                sprintf(message,FMT_DOUBLE ,*dptr);
+                print(message,aux);
+            }
+            print("\n",aux);
+        }
+        break;
+        
+      case TYPE_SHORT: 
+        sptr = (pinfo_t *)data;
+        if (count==1)
+        {
+            print( GTIFValueName(keyid,*sptr), aux );
+            print( "\n", aux );
+        }
+        else
+            for (; count > 0; count-= vals_now)
+            {
+                vals_now = count > 3? 3: count;
+                for (i=0; i<vals_now; i++,sptr++)
+                {
+                    sprintf(message,FMT_SHORT,*sptr);
+                    print(message,aux);
+                }
+                print("\n",aux);
+            }
+        break;
+        
+      default: 
+        sprintf(message, "Unknown Type (%d)\n",key->gk_type);
+        print(message,aux);
+        break;
+    }
+}
+
+static void DefaultPrint(char *string, void *aux)
+{
+    /* Pretty boring */
+    fprintf((FILE *)aux,string);
+}
+
+
+/*
+ *  Importing metadata file
+ */
+
+/*
+ * Import the directory info, using whatever method is specified
+ * (defaults to fscanf if null). The "aux" parameter is provided for user
+ * defined method for passing file or whatever.
+ *
+ * The input format is a "GeoTIFF meta-data" file, which may be
+ * generated by the GTIFFPrint() routine.
+ */
+ 
+int GTIFImport(GTIF *gtif, GTIFReadMethod scan,void *aux)
+{
+    int status;
+    char message[1024];
+	
+    if (!scan) scan = (GTIFReadMethod) &DefaultRead;
+    if (!aux) aux=stdin;	
+	
+    scan(message,aux);
+    if (strncmp(message,FMT_GEOTIFF,8)) return 0; 
+    scan(message,aux);
+    if (!sscanf(message,FMT_VERSION,&gtif->gt_version)) return 0;
+    scan(message,aux);
+    if (sscanf(message,FMT_REV,&gtif->gt_rev_major,
+               &gtif->gt_rev_minor) !=2) return 0;
+
+    scan(message,aux);
+    if (strncmp(message,FMT_TAGS,8)) return 0;
+    while ((status=ReadTag(gtif,scan,aux))>0);
+    if (status < 0) return 0;
+
+    scan(message,aux);
+    if (strncmp(message,FMT_KEYS,8)) return 0;
+    while ((status=ReadKey(gtif,scan,aux))>0);
+	
+    return (status==0); /* success */
+}
+
+static int StringError(char *string)
+{
+    fprintf(stderr,"Parsing Error at \'%s\'\n",string);
+    return -1;
+}
+
+#define SKIPWHITE(vptr) \
+  while (*vptr && (*vptr==' '||*vptr=='\t')) vptr++
+#define FINDCHAR(vptr,c) \
+  while (*vptr && *vptr!=(c)) vptr++
+
+static int ReadTag(GTIF *gt,GTIFReadMethod scan,void *aux)
+{
+    int i,j,tag;
+    char *vptr;
+    char tagname[100];
+    double *data,*dptr;
+    int count,nrows,ncols,num;
+    char message[1024];
+
+    scan(message,aux);
+    if (!strncmp(message,FMT_TAGEND,8)) return 0;
+
+    num=sscanf(message,"%[^( ] (%d,%d):\n",tagname,&nrows,&ncols);
+    if (num!=3) return StringError(message);
+	
+    tag = GTIFTagCode(tagname);
+    if (tag < 0) return StringError(tagname);
+
+    count = nrows*ncols;
+
+    data = (double *) _GTIFcalloc(count * sizeof(double));
+    dptr = data;
+	
+    for (i=0;i<nrows;i++)
+    {
+        scan(message,aux);
+        vptr = message;
+        for (j=0;j<ncols;j++)
+        {
+            if (!sscanf(vptr,"%lg",dptr++))
+                return StringError(vptr);
+            FINDCHAR(vptr,' ');
+            SKIPWHITE(vptr);
+        }
+    }	
+    (gt->gt_methods.set)(gt->gt_tif, (pinfo_t) tag, count, data );	
+
+    _GTIFFree( data );
+
+    return 1;
+}
+
+
+static int ReadKey(GTIF *gt, GTIFReadMethod scan, void *aux)
+{
+    tagtype_t ktype;
+    int count,outcount;
+    int vals_now,i;
+    geokey_t key;
+    int icode;
+    pinfo_t code;
+    short  *sptr;
+    char name[1000];
+    char type[20];
+    double data[100];
+    double *dptr;
+    char *vptr;
+    int num;
+    char message[2048];
+
+    scan(message,aux); 
+    if (!strncmp(message,FMT_KEYEND,8)) return 0;
+
+    num=sscanf(message,"%[^( ] (%[^,],%d):\n",name,type,&count);
+    if (num!=3) return StringError(message);
+
+    vptr = message;
+    FINDCHAR(vptr,':'); 
+    if (!*vptr) return StringError(message);
+    vptr+=2;
+
+    if( GTIFKeyCode(name) < 0 )
+        return StringError(name);
+    else
+        key = (geokey_t) GTIFKeyCode(name);
+
+    if( GTIFTypeCode(type) < 0 )
+        return StringError(type);
+    else
+        ktype = (tagtype_t) GTIFTypeCode(type);
+
+    /* skip white space */
+    SKIPWHITE(vptr);
+    if (!*vptr) return StringError(message);
+			
+    switch (ktype)
+    {
+      case TYPE_ASCII: 
+      {
+          char *cdata;
+          int out_char = 0;
+
+          FINDCHAR(vptr,'"');
+          if (!*vptr) return StringError(message);
+
+          cdata = (char *) _GTIFcalloc( count+1 );
+
+          vptr++;
+          while( out_char < count-1 )
+          {
+              if( *vptr == '\0' )
+                  break;
+
+              else if( vptr[0] == '\\' && vptr[1] == 'n' )
+              {
+                  cdata[out_char++] = '\n';
+                  vptr += 2;
+              }
+              else if( vptr[0] == '\\' && vptr[1] == '\\' )
+              {
+                  cdata[out_char++] = '\\';
+                  vptr += 2;
+              }
+              else
+                  cdata[out_char++] = *(vptr++);
+          }
+
+          if( out_char < count-1 ) return StringError(message);
+          if( *vptr != '"' ) return StringError(message);
+
+          cdata[count-1] = '\0';
+          GTIFKeySet(gt,key,ktype,count,cdata);
+
+          _GTIFFree( cdata );
+      }
+      break;
+        
+      case TYPE_DOUBLE: 
+        outcount = count;
+        for (dptr = data; count > 0; count-= vals_now)
+        {
+            vals_now = count > 3? 3: count;
+            for (i=0; i<vals_now; i++,dptr++)
+            {
+                if (!sscanf(vptr,"%lg" ,dptr))
+                    StringError(vptr);
+                FINDCHAR(vptr,' ');
+                SKIPWHITE(vptr);
+            }
+            if (vals_now<count)
+            {
+                scan(message,aux);
+                vptr = message;
+            }
+        }
+        if (outcount==1)
+            GTIFKeySet(gt,key,ktype,outcount,data[0]);
+        else
+            GTIFKeySet(gt,key,ktype,outcount,data);
+        break;
+        
+      case TYPE_SHORT: 
+        if (count==1)
+        {
+            icode = GTIFValueCode(key,vptr);
+            if (icode < 0) return StringError(vptr);
+            code = (pinfo_t) icode;
+            GTIFKeySet(gt,key,ktype,count,code);
+        }
+        else  /* multi-valued short - no such thing yet */
+        {
+            sptr = (short *)data;
+            outcount = count;
+            for (; count > 0; count-= vals_now)
+            {
+                vals_now = count > 3? 3: count;
+                for (i=0; i<vals_now; i++,sptr++)
+                {
+                    int		work_int;
+
+                    /* note: FMT_SHORT (%11hd) not supported on IRIX */
+                    sscanf(message,"%11d",&work_int);
+                    *sptr = (short) work_int;
+                    scan(message,aux);
+                }
+                if (vals_now<count)
+                {
+                    scan(message,aux);
+                    vptr = message;
+                }
+            }
+            GTIFKeySet(gt,key,ktype,outcount,sptr);			
+        }
+        break;
+        
+      default: 
+        return -1;
+    }
+    return 1;
+}
+
+
+static void DefaultRead(char *string, void *aux)
+{
+	/* Pretty boring */
+	fscanf((FILE *)aux,"%[^\n]\n",string);
+}
+
diff --git a/src/tiff/geo_set.c b/src/tiff/geo_set.c
new file mode 100644
index 0000000..86d1d63
--- /dev/null
+++ b/src/tiff/geo_set.c
@@ -0,0 +1,262 @@
+/**********************************************************************
+ *
+ *  geo_set.c  -- Public routines for GEOTIFF GeoKey access.
+ *
+ *    Written By: Niles D. Ritter.
+ *
+ *  copyright (c) 1995   Niles D. Ritter
+ *
+ *  Permission granted to use this software, so long as this copyright
+ *  notice accompanies any products derived therefrom.
+ *
+ * $Log$
+ * Revision 1.11  2004/04/27 21:32:33  warmerda
+ * reformat for clarity
+ *
+ * Revision 1.10  2003/07/08 17:31:30  warmerda
+ * cleanup various warnings
+ *
+ * Revision 1.9  2003/01/15 03:37:19  warmerda
+ * avoid warning
+ *
+ * Revision 1.8  2002/09/27 13:05:33  warmerda
+ * allow dynamic set/delete of ASCII tags. ASCIIPARAMS now kept split
+ *
+ * Revision 1.7  2001/05/02 16:48:22  warmerda
+ * fixed a couple bugs in delete code
+ *
+ * Revision 1.6  2001/05/02 13:54:34  warmerda
+ * updated geo_set.c to support deleting tags
+ *
+ * Revision 1.5  1999/05/04 03:09:33  warmerda
+ * avoid warnings
+ *
+ * Revision 1.4  1999/05/03 17:50:31  warmerda
+ * avoid warnings on IRIX
+ *
+ * Revision 1.3  1999/04/28 19:59:38  warmerda
+ * added some doxygen style documentation
+ *
+ * Revision 1.2  1999/03/11 17:39:38  geotiff
+ * Added fix for case where a key is being overwritten.
+ *
+ **********************************************************************/
+
+#include "geotiff.h"   /* public interface        */
+#include "geo_tiffp.h" /* external TIFF interface */
+#include "geo_keyp.h"  /* private interface       */
+
+#include <assert.h>
+
+/**
+This function writes a geokey_t value to a GeoTIFF file.
+
+ at param gtif The geotiff information handle from GTIFNew().
+
+ at param keyID The geokey_t name (such as ProjectedCSTypeGeoKey).
+This must come from the list of legal geokey_t values
+(an enumeration) listed below.
+
+ at param val The <b>val</b> argument is a pointer to the
+variable into which the value should be read.  The type of the variable
+varies depending on the geokey_t given.  While there is no ready mapping
+of geokey_t values onto types, in general code values are of type <i>short</i>,
+citations are strings, and everything else is of type <i>double</i>.  Note
+that pointer's to <i>int</i> should never be passed to GTIFKeyGet() for
+integer values as they will be shorts, and the int's may not be properly
+initialized (and will be grossly wrong on MSB systems).
+
+ at param index Indicates how far into the list of values
+for this geokey to offset. Should normally be zero.
+
+ at param count Indicates how many values
+to read.  At this time all keys except for strings have only one value,
+so <b>index</b> should be zero, and <b>count</b> should be one.<p>
+
+The <b>key</b> indicates the key name to be written to the
+file and should from the geokey_t enumeration 
+(eg. <tt>ProjectedCSTypeGeoKey</tt>).  The full list of possible geokey_t
+values can be found in geokeys.inc, or in the online documentation for
+GTIFKeyGet().<p>
+
+The <b>type</b> should be one of TYPE_SHORT, TYPE_ASCII, or TYPE_DOUBLE and
+will indicate the type of value being passed at the end of the argument
+list (the key value).  The <b>count</b> should be one except for strings
+when it should be the length of the string (or zero to for this to be
+computed internally).  As a special case a <b>count</b> of -1 can be
+used to request an existing key be deleted, in which no value is passed.<p>
+
+The actual value is passed at the end of the argument list, and should be
+a short, a double, or a char * value.  Note that short and double values
+are passed as is, not as pointers.<p>
+
+Note that key values aren't actually flushed to the file until
+GTIFWriteKeys() is called.  Till then 
+the new values are just kept with the GTIF structure.<p>
+
+<b>Example:</b><p>
+
+<pre>
+    GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, 
+               RasterPixelIsArea);
+    GTIFKeySet(gtif, GTCitationGeoKey, TYPE_ASCII, 0, 
+               "UTM 11 North / NAD27" );
+</pre>
+
+ */
+
+int GTIFKeySet(GTIF *gtif, geokey_t keyID, tagtype_t type, int count,...)
+{
+    va_list ap;
+    int index = gtif->gt_keyindex[ keyID ];
+    int newvalues = 0;
+    GeoKey *key;
+    char *data = NULL;
+    char *val = NULL;
+    pinfo_t sval;
+    double dval;
+
+    va_start(ap, count);
+    /* pass singleton keys by value */
+    if (count>1 && type!=TYPE_ASCII) 
+    {
+        val = va_arg(ap, char*);
+    }
+    else if( count == -1 )
+    {
+        /* delete the indicated tag */
+        va_end(ap);
+
+        if( index < 1 )
+            return 0;
+
+        if (gtif->gt_keys[index].gk_type == TYPE_ASCII)
+        {
+            _GTIFFree (gtif->gt_keys[index].gk_data);
+        }
+
+        while( index < gtif->gt_num_keys )
+        {
+            _GTIFmemcpy( gtif->gt_keys + index, 
+                         gtif->gt_keys + index + 1, 
+                         sizeof(GeoKey) );
+            gtif->gt_keyindex[gtif->gt_keys[index].gk_key] = index;
+            index++;
+        }
+
+        gtif->gt_num_keys--;
+        gtif->gt_nshorts -= sizeof(KeyEntry)/sizeof(pinfo_t);
+        gtif->gt_keyindex[keyID] = 0;
+        gtif->gt_flags |= FLAG_FILE_MODIFIED;
+
+        return 1;
+    }
+    else switch (type)
+    {
+      case TYPE_SHORT:  sval=(pinfo_t) va_arg(ap, int); val=(char *)&sval;     break;
+      case TYPE_DOUBLE: dval=va_arg(ap, dblparam_t); val=(char *)&dval;  break;
+      case TYPE_ASCII: 
+        val=va_arg(ap, char*);
+        count = strlen(val) + 1; /* force = string length */
+        break;
+      default:
+        assert( FALSE );
+        break;
+    }
+    va_end(ap);
+    
+    /* We assume here that there are no multi-valued SHORTS ! */
+    if (index)
+    {
+        /* Key already exists */
+        key = gtif->gt_keys+index;
+        if (type!=key->gk_type || count > key->gk_count)
+        {
+            /* need to reset data pointer */
+            key->gk_type = type;
+            key->gk_count = count;
+            key->gk_size = _gtiff_size[ type ];
+            newvalues = 1;
+        }
+    }
+    else
+    {
+        /* We need to create the key */
+        if (gtif->gt_num_keys == MAX_KEYS) return 0;
+        key = gtif->gt_keys + ++gtif->gt_num_keys;
+        index = gtif->gt_num_keys;
+        gtif->gt_keyindex[ keyID ] = index;
+        key->gk_key = keyID;
+        key->gk_type = type;
+        key->gk_count = count;
+        key->gk_size = _gtiff_size[ type ];
+        if (gtif->gt_keymin > keyID)  gtif->gt_keymin=keyID;
+        if (gtif->gt_keymax < keyID)  gtif->gt_keymax=keyID;
+        newvalues = 1;
+    }
+
+    if (newvalues)
+    {
+        switch (type)
+        {
+          case TYPE_SHORT:  
+            if (count > 1) return 0;
+            data = (char *)&key->gk_data; /* store value *in* data */
+            break;
+          case TYPE_DOUBLE:
+            key->gk_data = (char *)(gtif->gt_double + gtif->gt_ndoubles);
+            data = key->gk_data;
+            gtif->gt_ndoubles += count;
+            break;
+          case TYPE_ASCII:
+            break;
+          default:
+            va_end(ap);
+            return 0;
+        }
+        gtif->gt_nshorts += sizeof(KeyEntry)/sizeof(pinfo_t);
+    }
+
+    /* this fixes a bug where if a request is made to write a duplicate
+       key, we must initialize the data to a valid value.
+       Bryan Wells (bryan at athena.bangor.autometric.com) */
+        
+    else /* no new values, but still have something to write */
+    {
+        switch (type)
+        {
+          case TYPE_SHORT:  
+            if (count > 1) return 0;
+            data = (char *)&key->gk_data; /* store value *in* data */
+            break;
+          case TYPE_DOUBLE:
+            data = key->gk_data;
+            break;
+          case TYPE_ASCII:
+            break;
+          default:
+            return 0;
+        }
+    }
+        
+    switch (type)
+    {
+      case TYPE_ASCII:
+        /* throw away existing data and allocate room for new data */
+        if (key->gk_data != 0)
+        {
+            _GTIFFree(key->gk_data);
+        }
+        key->gk_data = (char *)_GTIFcalloc(count);
+        key->gk_count = count;
+        data = key->gk_data;
+        break;
+      default:
+        break;
+    }
+
+    _GTIFmemcpy(data, val, count*key->gk_size);
+    
+    gtif->gt_flags |= FLAG_FILE_MODIFIED;
+    return 1;
+}
diff --git a/src/tiff/geo_tiffp.c b/src/tiff/geo_tiffp.c
new file mode 100644
index 0000000..989227b
--- /dev/null
+++ b/src/tiff/geo_tiffp.c
@@ -0,0 +1,140 @@
+/**********************************************************************
+ *
+ *  geo_tiffp.c  Private TIFF interface module for GEOTIFF
+ *
+ *    This module implements the interface between the GEOTIFF
+ *    tag parser and the TIFF i/o module. The current setup
+ *    relies on the "libtiff" code, but if you use your own
+ *    TIFF reader software, you may replace the module implementations
+ *    here with your own calls. No "libtiff" dependencies occur
+ *    anywhere else in this code.
+ *
+ **********************************************************************/
+ 
+#include "geotiff.h"    /* public GTIFF interface */
+
+#include "geo_tiffp.h"  /* Private TIFF interface */
+#include "geo_keyp.h"   /* Private GTIFF interface */
+
+/* tiff size array global */
+gsize_t _gtiff_size[] = { 0, 1, 2, 4, 8, 1, 4, 8, 1, 2, 4, 1 };
+
+static int        _GTIFGetField (tiff_t *tif, pinfo_t tag, int *count, void *value );
+static int        _GTIFSetField (tiff_t *tif, pinfo_t tag, int  count, void *value );
+static tagtype_t  _GTIFTagType  (tiff_t *tif, pinfo_t tag);
+
+/*
+ * Set up default TIFF handlers. 
+ */
+void _GTIFSetDefaultTIFF(TIFFMethod *method)
+{
+	if (!method) return;
+	
+	method->get = _GTIFGetField;
+	method->set = _GTIFSetField;
+	method->type = _GTIFTagType;
+}
+
+gdata_t _GTIFcalloc(gsize_t size)
+{
+    gdata_t data=(gdata_t)_TIFFmalloc((tsize_t)size);
+	if (data) _TIFFmemset((tdata_t)data,0,(tsize_t)size);
+	return data;
+}
+
+gdata_t _GTIFrealloc(gdata_t ptr, gsize_t size)
+{
+    return( _TIFFrealloc((tdata_t)ptr, (tsize_t) size) );
+}
+
+void _GTIFmemcpy(gdata_t out,gdata_t in,gsize_t size)
+{
+	_TIFFmemcpy((tdata_t)out,(tdata_t)in,(tsize_t)size);
+}
+
+void _GTIFFree(gdata_t data)
+{
+	if (data) _TIFFfree((tdata_t)data);
+}
+
+
+
+/* returns the value of TIFF tag <tag>, or if
+ * the value is an array, returns an allocated buffer
+ * containing the values. Allocate a copy of the actual
+ * buffer, sized up for updating.
+ */
+static int _GTIFGetField (tiff_t *tif, pinfo_t tag, int *count, void *val )
+{
+	int status;
+	unsigned short scount=0;
+	char *tmp;
+	char *value;
+	gsize_t size = _gtiff_size[_GTIFTagType (tif,tag)];
+	
+	if (_GTIFTagType(tif,  tag) == TYPE_ASCII)
+	{
+		status = TIFFGetField((TIFF *)tif,tag,&tmp);
+		if (!status) return status;
+		scount = (unsigned short) (strlen(tmp)+1);
+	}
+	else status = TIFFGetField((TIFF *)tif,tag,&scount,&tmp);
+	if (!status) return status;
+	
+	*count = scount;
+
+	value = (char *)_GTIFcalloc( (scount+MAX_VALUES)*size);
+	if (!value) return 0;
+	
+	_TIFFmemcpy( value, tmp,  size * scount);
+	
+	*(char **)val = value;
+	return status;
+}
+
+/* 
+ * Set a GeoTIFF TIFF field.
+ */
+static int _GTIFSetField (tiff_t *tif, pinfo_t tag, int count, void *value )
+{
+	int status;
+	unsigned short scount = (unsigned short) count;
+
+	/* libtiff ASCII uses null-delimiter */
+	if (_GTIFTagType(tif,  tag) == TYPE_ASCII)
+		status = TIFFSetField((TIFF *)tif,tag,value);
+	else 
+		status = TIFFSetField((TIFF *)tif,tag,scount,value);
+	return status;
+}
+
+
+/*
+ *  This routine is supposed to return the TagType of the <tag>
+ *  TIFF tag. Unfortunately, "libtiff" does not provide this
+ *  service by default, so we just have to "know" what type of tags
+ *  we've got, and how many. We only define the ones Geotiff
+ *  uses here, and others return UNKNOWN. The "tif" parameter
+ *  is provided for those TIFF implementations that provide
+ *  for tag-type queries.
+ */
+static tagtype_t  _GTIFTagType  (tiff_t *tif, pinfo_t tag)
+{
+	tagtype_t ttype;
+
+	(void) tif; /* dummy reference */
+	
+	switch (tag)
+	{
+		case GTIFF_ASCIIPARAMS:    ttype=TYPE_ASCII; break;
+		case GTIFF_PIXELSCALE:
+		case GTIFF_TRANSMATRIX:
+		case GTIFF_TIEPOINTS:
+		case GTIFF_DOUBLEPARAMS:   ttype=TYPE_DOUBLE; break;
+		case GTIFF_GEOKEYDIRECTORY: ttype=TYPE_SHORT; break;
+		default: ttype = TYPE_UNKNOWN;
+	}
+	
+	return ttype;
+}
+
diff --git a/src/tiff/geo_tiffp.h b/src/tiff/geo_tiffp.h
new file mode 100644
index 0000000..57802f2
--- /dev/null
+++ b/src/tiff/geo_tiffp.h
@@ -0,0 +1,114 @@
+/**********************************************************************
+ *
+ *  geo_tiffp.h - Private interface for TIFF tag parsing.
+ *
+ *   Written by: Niles D. Ritter
+ *
+ *   This interface file encapsulates the interface to external TIFF
+ *   file-io routines and definitions. The current configuration
+ *   assumes that the "libtiff" module is used, but if you have your
+ *   own TIFF reader, you may replace the definitions with your own
+ *   here, and replace the implementations in geo_tiffp.c. No other
+ *   modules have any explicit dependence on external TIFF modules.
+ *
+ *  Revision History;
+ *
+ *    20 June, 1995      Niles D. Ritter         New
+ *    6 July,  1995      Niles D. Ritter         Fix prototypes
+ *
+ **********************************************************************/
+
+#ifndef __geo_tiffp_h_
+#define __geo_tiffp_h_
+
+/**********************************************************************
+ *
+ *                        Private includes
+ *
+ *   If you are not using libtiff and XTIFF, replace this include file
+ *    with the appropriate one for your own TIFF parsing routines.
+ *
+ *   Revision History
+ * 
+ *      19 September 1995   ndr    Demoted Intergraph trans matrix.
+ *
+ **********************************************************************/
+
+#include "geotiff.h"
+#include "xtiffio.h"
+#include "cpl_serv.h"
+
+/*
+ * dblparam_t is the type that a double precision
+ * floating point value will have on the parameter
+ * stack (when coerced by the compiler). You shouldn't
+ * have to change this.
+ */
+#ifdef applec
+typedef extended dblparam_t;
+#else
+typedef double dblparam_t;
+#endif
+
+
+/**********************************************************************
+ *
+ *                        Private defines
+ *
+ *   If you are not using "libtiff"/LIBXTIFF, replace these definitions
+ *   with the appropriate definitions to access the geo-tags
+ *
+ **********************************************************************/
+ 
+typedef unsigned short pinfo_t;    /* SHORT ProjectionInfo tag type */
+typedef TIFF    tiff_t;            /* TIFF file descriptor          */
+typedef tdata_t  gdata_t;          /* pointer to data */
+typedef tsize_t  gsize_t;          /* data allocation size */
+ 
+#define GTIFF_GEOKEYDIRECTORY   TIFFTAG_GEOKEYDIRECTORY /* from xtiffio.h */
+#define GTIFF_DOUBLEPARAMS      TIFFTAG_GEODOUBLEPARAMS
+#define GTIFF_ASCIIPARAMS       TIFFTAG_GEOASCIIPARAMS
+#define GTIFF_PIXELSCALE        TIFFTAG_GEOPIXELSCALE
+#define GTIFF_TRANSMATRIX       TIFFTAG_GEOTRANSMATRIX
+#define GTIFF_INTERGRAPH_MATRIX TIFFTAG_INTERGRAPH_MATRIX
+#define GTIFF_TIEPOINTS         TIFFTAG_GEOTIEPOINTS
+#define GTIFF_LOCAL          0
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*
+ * Method function pointer types
+ */
+typedef int        (*GTGetFunction) (tiff_t *tif, pinfo_t tag, int *count, void *value );
+typedef int        (*GTSetFunction) (tiff_t *tif, pinfo_t tag, int  count, void *value );
+typedef tagtype_t  (*GTTypeFunction) (tiff_t *tif, pinfo_t tag);
+typedef struct     _TIFFMethod {
+	GTGetFunction get;
+	GTSetFunction set;
+	GTTypeFunction type;
+} TIFFMethod;
+
+/**********************************************************************
+ *
+ *               Protected Function Declarations  
+ *
+ *   These routines are exposed implementations, and should not
+ *   be used by external GEOTIFF client programs.
+ *
+ **********************************************************************/
+
+extern gsize_t _gtiff_size[]; /* TIFF data sizes */
+extern void CPL_DLL _GTIFSetDefaultTIFF(TIFFMethod *method);
+extern gdata_t CPL_DLL _GTIFcalloc(gsize_t);
+extern gdata_t CPL_DLL _GTIFrealloc(gdata_t,gsize_t);
+extern void CPL_DLL _GTIFFree(gdata_t data);
+extern void CPL_DLL _GTIFmemcpy(gdata_t out,gdata_t in,gsize_t size);
+
+#if defined(__cplusplus)
+} 
+#endif
+
+
+#endif /* __geo_tiffp_h_ */
diff --git a/src/tiff/geo_trans.c b/src/tiff/geo_trans.c
new file mode 100644
index 0000000..6956277
--- /dev/null
+++ b/src/tiff/geo_trans.c
@@ -0,0 +1,334 @@
+/******************************************************************************
+ * $Id: geo_trans.c 4825 2006-08-16 13:01:53Z lubia $
+ *
+ * Project:  libgeotiff
+ * Purpose:  Code to abstract translation between pixel/line and PCS
+ *           coordinates.
+ * Author:   Frank Warmerdam, warmerda at home.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log$
+ * Revision 1.10  2003/07/08 17:31:30  warmerda
+ * cleanup various warnings
+ *
+ * Revision 1.9  2001/11/28 14:20:30  warmerda
+ * fixed transform memory leak in GTIFPCSToImage
+ *
+ * Revision 1.8  2001/04/06 16:56:22  warmerda
+ * added support for PCSToImage with matrix
+ *
+ * Revision 1.7  2001/03/05 03:25:23  warmerda
+ * restructure cleanup, and apply to GTIFPCSToImage()
+ *
+ * Revision 1.6  2001/03/04 22:37:39  warmerda
+ * fixed memory leak for fields fetched with gt_methods.get - Alan Gray
+ *
+ * Revision 1.5  2000/08/22 03:32:46  warmerda
+ * removed GTIFTiepointTranslate code
+ *
+ * Revision 1.4  1999/09/17 01:19:51  warmerda
+ * Fixed bug in use of transform matrix.
+ *
+ * Revision 1.3  1999/09/16 21:25:40  warmerda
+ * Added tiepoint, and transformation matrix based translation.  Note
+ * that we don't try to invert the transformation matrix for
+ * GTIFPCSToImage().
+ *
+ * Revision 1.2  1999/09/07 20:00:40  warmerda
+ * Fixed count/tiepoint_count bug in GTIFPCSToImage().
+ *
+ * Revision 1.1  1999/05/04 03:07:57  warmerda
+ * New
+ *
+ */
+ 
+#include "geotiff.h"
+#include "geo_tiffp.h" /* external TIFF interface */
+#include "geo_keyp.h"  /* private interface       */
+#include "geokeys.h"
+
+/************************************************************************/
+/*                          inv_geotransform()                          */
+/*                                                                      */
+/*      Invert a 6 term geotransform style matrix.                      */
+/************************************************************************/
+
+static int inv_geotransform( double *gt_in, double *gt_out )
+
+{
+    double	det, inv_det;
+
+    /* we assume a 3rd row that is [0 0 1] */
+
+    /* Compute determinate */
+
+    det = gt_in[0] * gt_in[4] - gt_in[1] * gt_in[3];
+
+    if( fabs(det) < 0.000000000000001 )
+        return 0;
+
+    inv_det = 1.0 / det;
+
+    /* compute adjoint, and devide by determinate */
+
+    gt_out[0] =  gt_in[4] * inv_det;
+    gt_out[3] = -gt_in[3] * inv_det;
+
+    gt_out[1] = -gt_in[1] * inv_det;
+    gt_out[4] =  gt_in[0] * inv_det;
+
+    gt_out[2] = ( gt_in[1] * gt_in[5] - gt_in[2] * gt_in[4]) * inv_det;
+    gt_out[5] = (-gt_in[0] * gt_in[5] + gt_in[2] * gt_in[3]) * inv_det;
+
+    return 1;
+}
+
+/************************************************************************/
+/*                       GTIFTiepointTranslate()                        */
+/************************************************************************/
+
+int GTIFTiepointTranslate( int gcp_count, double * gcps_in, double * gcps_out,
+                           double x_in, double y_in,
+                           double *x_out, double *y_out )
+
+{
+    (void) gcp_count;
+    (void) gcps_in;
+    (void) gcps_out;
+    (void) x_in;
+    (void) y_in;
+    (void) x_out;
+    (void) y_out;
+    
+    /* I would appreciate a _brief_ block of code for doing second order
+       polynomial regression here! */
+    return FALSE;
+}
+
+
+/************************************************************************/
+/*                           GTIFImageToPCS()                           */
+/************************************************************************/
+
+/**
+ * Translate a pixel/line coordinate to projection coordinates.
+ *
+ * At this time this function does not support image to PCS translations for
+ * tiepoints-only definitions,  only pixelscale and transformation matrix
+ * formulations.
+ *
+ * @param gtif The handle from GTIFNew() indicating the target file.
+ * @param x A pointer to the double containing the pixel offset on input,
+ * and into which the easting/longitude will be put on completion.
+ * @param y A pointer to the double containing the line offset on input,
+ * and into which the northing/latitude will be put on completion.
+ *
+ * @return TRUE if the transformation succeeds, or FALSE if it fails.  It may
+ * fail if the file doesn't have properly setup transformation information,
+ * or it is in a form unsupported by this function.
+ */
+
+int GTIFImageToPCS( GTIF *gtif, double *x, double *y )
+
+{
+    int     res = FALSE;
+    int     tiepoint_count, count, transform_count;
+    tiff_t *tif=gtif->gt_tif;
+    double *tiepoints   = 0;
+    double *pixel_scale = 0;
+    double *transform   = 0;
+
+
+    if (!(gtif->gt_methods.get)(tif, GTIFF_TIEPOINTS,
+                              &tiepoint_count, &tiepoints ))
+        tiepoint_count = 0;
+
+    if (!(gtif->gt_methods.get)(tif, GTIFF_PIXELSCALE, &count, &pixel_scale ))
+        count = 0;
+
+    if (!(gtif->gt_methods.get)(tif, GTIFF_TRANSMATRIX,
+                                &transform_count, &transform ))
+        transform_count = 0;
+
+/* -------------------------------------------------------------------- */
+/*      If the pixelscale count is zero, but we have tiepoints use      */
+/*      the tiepoint based approach.                                    */
+/* -------------------------------------------------------------------- */
+    if( tiepoint_count > 6 && count == 0 ) 
+    {
+        res = GTIFTiepointTranslate( tiepoint_count / 6,
+                                     tiepoints, tiepoints + 3,
+                                     *x, *y, x, y );
+    }
+
+/* -------------------------------------------------------------------- */
+/*	If we have a transformation matrix, use it. 			*/
+/* -------------------------------------------------------------------- */
+    else if( transform_count == 16 ) 
+    {
+        double x_in = *x, y_in = *y;
+
+        *x = x_in * transform[0] + y_in * transform[1] + transform[3];
+        *y = x_in * transform[4] + y_in * transform[5] + transform[7];
+        
+        res = TRUE;
+    } 
+
+/* -------------------------------------------------------------------- */
+/*      For now we require one tie point, and a valid pixel scale.      */
+/* -------------------------------------------------------------------- */
+    else if( count < 3 || tiepoint_count < 6 ) 
+    {
+        res = FALSE;
+    } 
+
+    else 
+    {
+        *x = (*x - tiepoints[0]) * pixel_scale[0] + tiepoints[3];
+        *y = (*y - tiepoints[1]) * (-1 * pixel_scale[1]) + tiepoints[4];
+
+        res = TRUE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Cleanup                                                         */
+/* -------------------------------------------------------------------- */
+    if(tiepoints)   
+        _GTIFFree(tiepoints);
+    if(pixel_scale)
+        _GTIFFree(pixel_scale);
+    if(transform)  
+        _GTIFFree(transform);
+
+    return res;
+}
+
+/************************************************************************/
+/*                           GTIFPCSToImage()                           */
+/************************************************************************/
+
+/**
+ * Translate a projection coordinate to pixel/line coordinates.
+ *
+ * At this time this function does not support PCS to image translations for
+ * tiepoints-only based definitions, only matrix and pixelscale/tiepoints 
+ * formulations are supposed.
+ *
+ * @param gtif The handle from GTIFNew() indicating the target file.
+ * @param x A pointer to the double containing the pixel offset on input,
+ * and into which the easting/longitude will be put on completion.
+ * @param y A pointer to the double containing the line offset on input,
+ * and into which the northing/latitude will be put on completion.
+ *
+ * @return TRUE if the transformation succeeds, or FALSE if it fails.  It may
+ * fail if the file doesn't have properly setup transformation information,
+ * or it is in a form unsupported by this function.
+ */
+
+int GTIFPCSToImage( GTIF *gtif, double *x, double *y )
+
+{
+    double 	*tiepoints = NULL;
+    int 	tiepoint_count, count, transform_count = 0;
+    double	*pixel_scale = NULL;
+    double 	*transform   = NULL;
+    tiff_t 	*tif=gtif->gt_tif;
+    int		result = FALSE;
+
+/* -------------------------------------------------------------------- */
+/*      Fetch tiepoints and pixel scale.                                */
+/* -------------------------------------------------------------------- */
+    if (!(gtif->gt_methods.get)(tif, GTIFF_TIEPOINTS,
+                              &tiepoint_count, &tiepoints ))
+        tiepoint_count = 0;
+
+    if (!(gtif->gt_methods.get)(tif, GTIFF_PIXELSCALE, &count, &pixel_scale ))
+        count = 0;
+
+    if (!(gtif->gt_methods.get)(tif, GTIFF_TRANSMATRIX,
+                                &transform_count, &transform ))
+        transform_count = 0;
+
+/* -------------------------------------------------------------------- */
+/*      If the pixelscale count is zero, but we have tiepoints use      */
+/*      the tiepoint based approach.                                    */
+/* -------------------------------------------------------------------- */
+    if( tiepoint_count > 6 && count == 0 )
+    {
+        result = GTIFTiepointTranslate( tiepoint_count / 6,
+                                        tiepoints + 3, tiepoints,
+                                        *x, *y, x, y );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Handle matrix - convert to "geotransform" format, invert and    */
+/*      apply.                                                          */
+/* -------------------------------------------------------------------- */
+    else if( transform_count == 16 )
+    {
+        double  x_in = *x, y_in = *y;
+        double	gt_in[6], gt_out[6];
+        
+        gt_in[0] = transform[0];
+        gt_in[1] = transform[1];
+        gt_in[2] = transform[3];
+        gt_in[3] = transform[4];
+        gt_in[4] = transform[5];
+        gt_in[5] = transform[7];
+
+        if( !inv_geotransform( gt_in, gt_out ) )
+            result = FALSE;
+        else
+        {
+            *x = x_in * gt_out[0] + y_in * gt_out[1] + gt_out[2];
+            *y = x_in * gt_out[3] + y_in * gt_out[4] + gt_out[5];
+            
+            result = TRUE;
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      For now we require one tie point, and a valid pixel scale.      */
+/* -------------------------------------------------------------------- */
+    else if( count >= 3 && tiepoint_count >= 6 )
+    {
+        *x = (*x - tiepoints[3]) / pixel_scale[0] + tiepoints[0];
+        *y = (*y - tiepoints[4]) / (-1 * pixel_scale[1]) + tiepoints[1];
+
+        result = TRUE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Cleanup.                                                        */
+/* -------------------------------------------------------------------- */
+    if(tiepoints)   
+        _GTIFFree(tiepoints);
+    if(pixel_scale)
+        _GTIFFree(pixel_scale);
+    if(transform)  
+        _GTIFFree(transform);
+
+    return result;
+}
+
diff --git a/src/tiff/geo_write.c b/src/tiff/geo_write.c
new file mode 100644
index 0000000..817f6ce
--- /dev/null
+++ b/src/tiff/geo_write.c
@@ -0,0 +1,193 @@
+/**********************************************************************
+ *
+ *  geo_write.c  -- Public routines for GEOTIFF GeoKey access.
+ *
+ *    Written By: Niles D. Ritter.
+ *
+ *  copyright (c) 1995   Niles D. Ritter
+ *
+ *  Permission granted to use this software, so long as this copyright
+ *  notice accompanies any source code derived therefrom.
+ *
+ **********************************************************************/
+
+#include "geotiffio.h"   /* public interface        */
+#include "geo_tiffp.h" /* external TIFF interface */
+#include "geo_keyp.h"  /* private interface       */
+
+static int WriteKey(GTIF* gt, TempKeyData* tempData,
+                    KeyEntry* entptr, GeoKey* keyptr);
+static int SortKeys(GTIF* gt,int *sortkeys);
+
+
+/**
+This function flushes all the GeoTIFF keys that have been set with the 
+GTIFKeySet() function into the associated 
+TIFF file.
+
+ at param gt The GeoTIFF handle returned by GTIFNew.
+
+GTIFWriteKeys() should be called before 
+GTIFFree() is used to deallocate a GeoTIFF access handle.
+ */
+
+int GTIFWriteKeys(GTIF *gt)
+{
+    int i;
+    GeoKey *keyptr;
+    KeyEntry *entptr;
+    KeyHeader *header;
+    TempKeyData tempData;
+    int sortkeys[MAX_KEYS];
+	
+    if (!(gt->gt_flags & FLAG_FILE_MODIFIED)) return 1;
+
+    if( gt->gt_tif == NULL )
+        return 0;
+	
+    tempData.tk_asciiParams = 0;
+    tempData.tk_asciiParamsLength = 0;
+    tempData.tk_asciiParamsOffset = 0;
+
+    /*  Sort the Keys into numerical order */
+    if (!SortKeys(gt,sortkeys))
+    {
+        /* XXX error: a key was not recognized */
+    }
+	
+    /* Set up header of ProjectionInfo tag */
+    header = (KeyHeader *)gt->gt_short;
+    header->hdr_num_keys = (pinfo_t) gt->gt_num_keys;
+    header->hdr_version  = GvCurrentVersion;
+    header->hdr_rev_major  = GvCurrentRevision;
+    header->hdr_rev_minor  = GvCurrentMinorRev;
+	
+    /* Sum up the ASCII tag lengths */
+    for (i = 0; i < gt->gt_num_keys; i++)
+    {
+        keyptr = gt->gt_keys + sortkeys[i];
+        if (keyptr->gk_type == TYPE_ASCII)
+        {
+            tempData.tk_asciiParamsLength += keyptr->gk_count;
+        }
+    }
+    if (tempData.tk_asciiParamsLength > 0)
+    {
+        tempData.tk_asciiParams =
+            (char *)_GTIFcalloc(tempData.tk_asciiParamsLength + 1);
+        tempData.tk_asciiParams[tempData.tk_asciiParamsLength] = '\0';
+    }
+
+    /* Set up the rest of SHORT array properly */
+    keyptr = gt->gt_keys;
+    entptr = (KeyEntry*)(gt->gt_short + 4);
+    for (i=0; i< gt->gt_num_keys; i++,entptr++)
+    {
+        if (!WriteKey(gt,&tempData,entptr,keyptr+sortkeys[i])) return 0;
+    }	
+	
+    /* Write out the Key Directory */
+    (gt->gt_methods.set)(gt->gt_tif, GTIFF_GEOKEYDIRECTORY, gt->gt_nshorts, gt->gt_short );	
+	
+    /* Write out the params directories */
+    if (gt->gt_ndoubles)
+        (gt->gt_methods.set)(gt->gt_tif, GTIFF_DOUBLEPARAMS, gt->gt_ndoubles, gt->gt_double );
+    if (tempData.tk_asciiParamsLength > 0)
+    {
+        /* just to be safe */
+        tempData.tk_asciiParams[tempData.tk_asciiParamsLength] = '\0';
+        (gt->gt_methods.set)(gt->gt_tif,
+                             GTIFF_ASCIIPARAMS, 0, tempData.tk_asciiParams);
+    }
+	
+    gt->gt_flags &= ~FLAG_FILE_MODIFIED;
+
+    if (tempData.tk_asciiParamsLength > 0)
+    {
+        _GTIFFree (tempData.tk_asciiParams);
+    }
+    return 1;
+}
+
+/**********************************************************************
+ *
+ *                        Private Routines
+ *
+ **********************************************************************/
+ 
+/*
+ * Given GeoKey, write out the KeyEntry entries, returning 0 if failure.
+ *  This is the exact complement of ReadKey().
+ */
+
+static int WriteKey(GTIF* gt, TempKeyData* tempData,
+                    KeyEntry* entptr, GeoKey* keyptr)
+{
+    int count;
+	
+    entptr->ent_key = (pinfo_t) keyptr->gk_key;
+    entptr->ent_count = (pinfo_t) keyptr->gk_count;
+    count = entptr->ent_count;
+	
+    if (count==1 && keyptr->gk_type==TYPE_SHORT)
+    {
+        entptr->ent_location = GTIFF_LOCAL;
+        entptr->ent_val_offset = *(pinfo_t*)&keyptr->gk_data;
+        return 1;
+    }
+		  
+    switch (keyptr->gk_type)
+    {
+      case TYPE_SHORT:
+        entptr->ent_location = GTIFF_GEOKEYDIRECTORY;
+        entptr->ent_val_offset = (pinfo_t)
+            ((pinfo_t*)keyptr->gk_data - gt->gt_short);
+        break;
+      case TYPE_DOUBLE:
+        entptr->ent_location = GTIFF_DOUBLEPARAMS;
+        entptr->ent_val_offset = (pinfo_t) 
+            ((double*)keyptr->gk_data - gt->gt_double);
+        break;
+      case TYPE_ASCII:
+        entptr->ent_location = GTIFF_ASCIIPARAMS;
+        entptr->ent_val_offset = (pinfo_t) tempData->tk_asciiParamsOffset;
+        _GTIFmemcpy (tempData->tk_asciiParams + tempData->tk_asciiParamsOffset
+                     , keyptr->gk_data, keyptr->gk_count);
+        tempData->tk_asciiParams[tempData->tk_asciiParamsOffset+keyptr->gk_count-1] = '|';
+        tempData->tk_asciiParamsOffset += keyptr->gk_count;
+        break;
+      default:
+        return 0; /* failure */
+    }
+	
+    return 1; /* success */
+}
+
+
+/* 
+ * Numerically sort the GeoKeys.
+ * We just do a linear search through
+ * the list and pull out the keys that were set.
+ */
+
+static int SortKeys(GTIF* gt,int *sortkeys)
+{
+    int loc;
+    int nkeys=0;
+    geokey_t key,kmin,kmax;
+    int *index = gt->gt_keyindex;
+	
+    kmin = (geokey_t) gt->gt_keymin;
+    kmax = (geokey_t) gt->gt_keymax;
+    for (key=kmin; key<=kmax; key++)
+    {
+        if ( (loc=index[key]) != 0 )
+        {
+            sortkeys[nkeys] = loc;
+            nkeys++;
+        }
+    }
+	
+    return nkeys==gt->gt_num_keys;
+}
+
diff --git a/src/tiff/geokeys.h b/src/tiff/geokeys.h
new file mode 100644
index 0000000..97c5327
--- /dev/null
+++ b/src/tiff/geokeys.h
@@ -0,0 +1,54 @@
+/**********************************************************************
+ *
+ *  geokeys.h - Public registry for valid GEOTIFF GeoKeys.
+ *
+ *   Written By: Niles D. Ritter
+ *
+ *  Revision History:
+ *
+ *     Rev.#  Author  M/D/Y Date     Key Changes/Additions
+ *     -----  ------  ----------  -------------------------------------
+ *       0      ndr    06/10/95      Inital Beta Release
+ *       1      ndr    09/18/95      Final 1.0 Release
+ *
+ **********************************************************************/
+
+#ifndef __geokeys_h_
+#define __geokeys_h_
+
+/* The GvCurrentRevision number should be incremented whenever a 
+ * new set of Keys are defined or modified in "geokeys.inc", and comments 
+ * added to the "Revision History" section above. If only code
+ * _values_ are augmented, the "GvCurrentMinorRev" number should
+ * be incremented instead (see "geovalues.h"). Whenever the 
+ * GvCurrentRevision is incremented, the GvCurrentMinorRev should
+ * be reset to zero.
+ *
+ *
+ * The Section Numbers below refer to the GeoTIFF Spec sections
+ * in which these values are documented.
+ *
+ */
+#define GvCurrentRevision  1  /* Final 1.0 Release */
+
+#ifdef ValuePair
+#  undef ValuePair
+#endif
+#define ValuePair(name,value)    name = value,
+
+typedef enum {
+   BaseGeoKey   =  1024,               /* First valid code */
+
+#  include "geokeys.inc"         /* geokey database */
+
+   ReservedEndGeoKey  =  32767,
+   
+   /* Key space available for Private or internal use */
+   PrivateBaseGeoKey = 32768,    /* Consistent with TIFF Private tags */
+   PrivateEndGeoKey  = 65535,    
+   
+   EndGeoKey = 65535             /* Largest Possible GeoKey ID */
+} geokey_t;
+
+
+#endif /* __geokeys_h_ */
diff --git a/src/tiff/geokeys.inc b/src/tiff/geokeys.inc
new file mode 100644
index 0000000..cfccb86
--- /dev/null
+++ b/src/tiff/geokeys.inc
@@ -0,0 +1,76 @@
+/* GeoTIFF GeoKey Database */
+
+/* Note: Any changes/additions to this database require */
+/* a change in the revision value in geokeys.h          */
+
+/* C database for Geotiff include files.   */
+/* the macro ValuePair() must be defined   */
+/* by the enclosing include file           */
+
+/*  Revised 28 Sep 1995   NDR -- Added Rev. 1.0 aliases. */
+
+/* 6.2.1 GeoTIFF Configuration Keys */
+
+ValuePair(  GTModelTypeGeoKey,	1024) /* Section 6.3.1.1 Codes       */
+ValuePair(  GTRasterTypeGeoKey,	1025) /* Section 6.3.1.2 Codes       */
+ValuePair(  GTCitationGeoKey,	1026) /* documentation */
+
+/* 6.2.2 Geographic CS Parameter Keys */
+
+ValuePair(  GeographicTypeGeoKey,	2048) /* Section 6.3.2.1 Codes     */
+ValuePair(  GeogCitationGeoKey,	2049) /* documentation             */
+ValuePair(  GeogGeodeticDatumGeoKey,	2050) /* Section 6.3.2.2 Codes     */
+ValuePair(  GeogPrimeMeridianGeoKey,	2051) /* Section 6.3.2.4 codes     */
+ValuePair(  GeogLinearUnitsGeoKey,	2052) /* Section 6.3.1.3 Codes     */
+ValuePair(  GeogLinearUnitSizeGeoKey,	2053) /* meters                    */
+ValuePair(  GeogAngularUnitsGeoKey,	2054) /* Section 6.3.1.4 Codes     */
+ValuePair(  GeogAngularUnitSizeGeoKey,	2055) /* radians                   */
+ValuePair(  GeogEllipsoidGeoKey,	2056) /* Section 6.3.2.3 Codes     */
+ValuePair(  GeogSemiMajorAxisGeoKey,	2057) /* GeogLinearUnits           */
+ValuePair(  GeogSemiMinorAxisGeoKey,	2058) /* GeogLinearUnits           */
+ValuePair(  GeogInvFlatteningGeoKey,	2059) /* ratio                     */
+ValuePair(  GeogAzimuthUnitsGeoKey,	2060) /* Section 6.3.1.4 Codes     */
+ValuePair(  GeogPrimeMeridianLongGeoKey,	2061) /* GeoAngularUnit            */
+
+/* 6.2.3 Projected CS Parameter Keys */
+/*    Several keys have been renamed,*/
+/*    and the deprecated names aliased for backward compatibility */
+
+ValuePair(  ProjectedCSTypeGeoKey,	3072)     /* Section 6.3.3.1 codes   */
+ValuePair(  PCSCitationGeoKey,	3073)     /* documentation           */
+ValuePair(  ProjectionGeoKey,	3074)     /* Section 6.3.3.2 codes   */
+ValuePair(  ProjCoordTransGeoKey,	3075)     /* Section 6.3.3.3 codes   */
+ValuePair(  ProjLinearUnitsGeoKey,	3076)     /* Section 6.3.1.3 codes   */
+ValuePair(  ProjLinearUnitSizeGeoKey,	3077)     /* meters                  */
+ValuePair(  ProjStdParallel1GeoKey,	3078)     /* GeogAngularUnit */
+ValuePair(  ProjStdParallelGeoKey,ProjStdParallel1GeoKey) /* ** alias **   */
+ValuePair(  ProjStdParallel2GeoKey,	3079)     /* GeogAngularUnit */
+ValuePair(  ProjNatOriginLongGeoKey,	3080)     /* GeogAngularUnit */
+ValuePair(  ProjOriginLongGeoKey,ProjNatOriginLongGeoKey) /* ** alias **     */
+ValuePair(  ProjNatOriginLatGeoKey,	3081)     /* GeogAngularUnit */
+ValuePair(  ProjOriginLatGeoKey,ProjNatOriginLatGeoKey)   /* ** alias **     */
+ValuePair(  ProjFalseEastingGeoKey,	3082)     /* ProjLinearUnits */
+ValuePair(  ProjFalseNorthingGeoKey,	3083)     /* ProjLinearUnits */
+ValuePair(  ProjFalseOriginLongGeoKey,	3084)     /* GeogAngularUnit */
+ValuePair(  ProjFalseOriginLatGeoKey,	3085)     /* GeogAngularUnit */
+ValuePair(  ProjFalseOriginEastingGeoKey,	3086)     /* ProjLinearUnits */
+ValuePair(  ProjFalseOriginNorthingGeoKey,	3087)     /* ProjLinearUnits */
+ValuePair(  ProjCenterLongGeoKey,	3088)     /* GeogAngularUnit */
+ValuePair(  ProjCenterLatGeoKey,	3089)     /* GeogAngularUnit */
+ValuePair(  ProjCenterEastingGeoKey,	3090)     /* ProjLinearUnits */
+ValuePair(  ProjCenterNorthingGeoKey,	3091)     /* ProjLinearUnits */
+ValuePair(  ProjScaleAtNatOriginGeoKey,	3092)     /* ratio   */
+ValuePair(  ProjScaleAtOriginGeoKey,ProjScaleAtNatOriginGeoKey)  /* ** alias **   */
+ValuePair(  ProjScaleAtCenterGeoKey,	3093)     /* ratio   */
+ValuePair(  ProjAzimuthAngleGeoKey,	3094)     /* GeogAzimuthUnit */
+ValuePair(  ProjStraightVertPoleLongGeoKey, 3095) /* GeogAngularUnit */
+ValuePair(  ProjRectifiedGridAngleGeoKey, 3096)   /* GeogAngularUnit */
+
+/* 6.2.4 Vertical CS Keys */
+   
+ValuePair(  VerticalCSTypeGeoKey,	4096)  /* Section 6.3.4.1 codes   */
+ValuePair(  VerticalCitationGeoKey,	4097)  /* documentation */
+ValuePair(  VerticalDatumGeoKey,	4098)  /* Section 6.3.4.2 codes   */
+ValuePair(  VerticalUnitsGeoKey,	4099)  /* Section 6.3.1 (.x) codes   */
+
+/* End of Data base */
diff --git a/src/tiff/geonames.h b/src/tiff/geonames.h
new file mode 100644
index 0000000..dc1b016
--- /dev/null
+++ b/src/tiff/geonames.h
@@ -0,0 +1,146 @@
+/*
+ * geonames.h
+ *
+ *  This encapsulates all of the value-naming mechanism of 
+ *  libgeotiff. 
+ *
+ *  Written By: Niles Ritter
+ *
+ *  Revision History:
+ *
+ *      Author     Date     Key Changes/Additions
+ *      ------  ----------  -------------------------------------
+ *      ndr    10 Jun 95     Inital Beta Release
+ *      ndr    28 Jul 95     Added ModelType aliases, Kv aliases.
+ */
+
+#ifndef __geonames_h
+#define __geonames_h
+
+struct _KeyInfo {
+	int ki_key;
+	char *ki_name;
+};
+typedef struct _KeyInfo KeyInfo;
+
+/* If memory is a premium, then omitting the 
+ * long name lists may save some space; simply 
+ * #define OMIT_GEOTIFF_NAMES in the compile statement
+ * to remove all key->string translation.
+ */
+#ifdef ValuePair
+#  undef ValuePair
+#endif
+
+#ifndef OMIT_GEOTIFF_NAMES
+#define ValuePair(token,value)  {token,#token},
+#else
+#define ValuePair(token,value)
+#endif
+
+#define END_LIST { -1, (char *)0}
+
+/************************************************************
+ *         6.2.x GeoTIFF Keys
+ ************************************************************/
+
+static KeyInfo _keyInfo[] =  {
+#   include "geokeys.inc"   /* geokey database */
+    END_LIST
+};
+
+#define COMMON_VALUES \
+   {KvUndefined, "Undefined"}, \
+   {KvUserDefined,"User-Defined"}, \
+   ValuePair(KvUndefined,KvUndefined) \
+   ValuePair(KvUserDefined,KvUserDefined) 
+
+static KeyInfo _csdefaultValue[] = {
+   COMMON_VALUES
+   END_LIST  
+};
+
+/************************************************************
+ *         6.3.x GeoTIFF Key Values
+ ************************************************************/
+
+static KeyInfo _modeltypeValue[] = {
+   COMMON_VALUES
+    ValuePair(ModelTypeProjected,1)
+    ValuePair(ModelTypeGeographic,2)
+    ValuePair(ModelTypeGeocentric,3)
+    ValuePair(ModelProjected,1)     /* aliases */
+    ValuePair(ModelGeographic,2)    /* aliases */
+    ValuePair(ModelGeocentric,3)    /* aliases */
+   END_LIST  
+};
+
+static KeyInfo _rastertypeValue[] = {
+   COMMON_VALUES
+    ValuePair(RasterPixelIsArea,1)
+    ValuePair(RasterPixelIsPoint,2)
+   END_LIST  
+};
+
+static KeyInfo _geounitsValue[] = {
+   COMMON_VALUES
+#  include "epsg_units.inc"
+   END_LIST  
+};
+
+static KeyInfo _geographicValue[] = {
+   COMMON_VALUES
+#  include "epsg_gcs.inc"
+   END_LIST  
+};
+
+static KeyInfo _geodeticdatumValue[] = {
+   COMMON_VALUES
+#  include "epsg_datum.inc"
+   END_LIST  
+};
+
+static KeyInfo _ellipsoidValue[] = {
+   COMMON_VALUES
+#  include "epsg_ellipse.inc"
+   END_LIST  
+};
+
+static KeyInfo _primemeridianValue[] = {
+   COMMON_VALUES
+#  include "epsg_pm.inc"
+   END_LIST  
+};
+
+static KeyInfo _pcstypeValue[] = {
+   COMMON_VALUES
+#  include "epsg_pcs.inc"
+   END_LIST  
+};
+
+static KeyInfo _projectionValue[] = {
+   COMMON_VALUES
+#  include "epsg_proj.inc"
+   END_LIST  
+};
+
+static KeyInfo _coordtransValue[] = {
+   COMMON_VALUES
+#  include "geo_ctrans.inc"
+   END_LIST  
+};
+
+static KeyInfo _vertcstypeValue[] = {
+   COMMON_VALUES
+#  include "epsg_vertcs.inc"
+   END_LIST  
+};
+
+static KeyInfo _vdatumValue[] = {
+   COMMON_VALUES
+    ValuePair(VDatumBase,1)
+   END_LIST  
+};
+
+#endif /* __geonames_h */
+
diff --git a/src/tiff/geotiff.h b/src/tiff/geotiff.h
new file mode 100644
index 0000000..088e504
--- /dev/null
+++ b/src/tiff/geotiff.h
@@ -0,0 +1,117 @@
+/**********************************************************************
+ *
+ *  geotiff.h - Public interface for Geotiff tag parsing.
+ *
+ *
+ *   Written By: Niles D. Ritter
+ *
+ **********************************************************************/
+
+#ifndef __geotiff_h_
+#define __geotiff_h_
+
+/**
+ * \file geotiff.h
+ *
+ * Primary libgeotiff include file.
+ *
+ * This is the defacto registry for valid GEOTIFF GeoKeys
+ * and their associated symbolic values. This is also the only file
+ * of the GeoTIFF library which needs to be included in client source
+ * code.
+ */
+
+/* This Version code should only change if a drastic
+ * alteration is made to the GeoTIFF key structure. Readers
+ * encountering a larger value should give up gracefully.
+ */
+#define GvCurrentVersion   1
+
+#define LIBGEOTIFF_VERSION 1230
+
+#include "geo_config.h"
+#include "geokeys.h"
+
+/**********************************************************************
+ * Do we want to build as a DLL on windows?
+ **********************************************************************/
+#if !defined(CPL_DLL)
+#  if defined(_WIN32) && defined(BUILD_AS_DLL)
+#    define CPL_DLL     __declspec(dllexport)
+#  else
+#    define CPL_DLL
+#  endif
+#endif
+
+/**********************************************************************
+ *
+ *                 Public Structures & Definitions
+ *
+ **********************************************************************/
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+typedef struct gtiff GTIF;   /* struct gtiff is private */
+typedef unsigned short tifftag_t;
+typedef unsigned short geocode_t;
+typedef int (*GTIFPrintMethod)(char *string, void *aux);
+typedef int (*GTIFReadMethod)(char *string, void *aux);
+
+typedef enum {
+   TYPE_BYTE=1,
+   TYPE_SHORT=2,
+   TYPE_LONG=3,
+   TYPE_RATIONAL=4,
+   TYPE_ASCII=5,
+   TYPE_FLOAT=6,
+   TYPE_DOUBLE=7,
+   TYPE_SBYTE=8,
+   TYPE_SSHORT=9,
+   TYPE_SLONG=10,
+   TYPE_UNKNOWN=11
+} tagtype_t;
+
+
+/**********************************************************************
+ *
+ *                 Public Function Declarations
+ *
+ **********************************************************************/
+
+/* TIFF-level interface */
+GTIF CPL_DLL *GTIFNew(void *tif);
+void CPL_DLL  GTIFFree(GTIF *gtif);
+int  CPL_DLL  GTIFWriteKeys(GTIF *gtif);
+void CPL_DLL  GTIFDirectoryInfo(GTIF *gtif, int *versions, int *keycount);
+
+/* GeoKey Access */
+int  CPL_DLL  GTIFKeyInfo(GTIF *gtif, geokey_t key, int *size, tagtype_t* type);
+int  CPL_DLL  GTIFKeyGet(GTIF *gtif, geokey_t key, void *val, int index,
+                         int count);
+int  CPL_DLL  GTIFKeySet(GTIF *gtif, geokey_t keyID, tagtype_t type,
+                         int count,...);
+
+/* Metadata Import-Export utilities */
+void  CPL_DLL  GTIFPrint(GTIF *gtif, GTIFPrintMethod print, void *aux);
+int   CPL_DLL  GTIFImport(GTIF *gtif, GTIFReadMethod scan, void *aux);
+char  CPL_DLL *GTIFKeyName(geokey_t key);
+char  CPL_DLL *GTIFValueName(geokey_t key,int value);
+char  CPL_DLL *GTIFTypeName(tagtype_t type);
+char  CPL_DLL *GTIFTagName(int tag);
+int   CPL_DLL  GTIFKeyCode(char * key);
+int   CPL_DLL  GTIFValueCode(geokey_t key,char *value);
+int   CPL_DLL  GTIFTypeCode(char *type);
+int   CPL_DLL  GTIFTagCode(char *tag);
+
+/* Translation between image/PCS space */
+
+int CPL_DLL    GTIFImageToPCS( GTIF *gtif, double *x, double *y );
+int CPL_DLL    GTIFPCSToImage( GTIF *gtif, double *x, double *y );
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* __geotiff_h_ */
diff --git a/src/tiff/geotiff_proj4.c b/src/tiff/geotiff_proj4.c
new file mode 100644
index 0000000..e5e8e3b
--- /dev/null
+++ b/src/tiff/geotiff_proj4.c
@@ -0,0 +1,716 @@
+/******************************************************************************
+ * $Id: geotiff_proj4.c 4825 2006-08-16 13:01:53Z lubia $
+ *
+ * Project:  libgeotiff
+ * Purpose:  Code to convert a normalized GeoTIFF definition into a PROJ.4
+ *           (OGDI) compatible projection string.
+ * Author:   Frank Warmerdam, warmerda at home.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log$
+ * Revision 1.22  2005/03/04 04:32:37  fwarmerdam
+ * added cylindricalequalarea support
+ *
+ * Revision 1.21  2003/08/21 18:42:39  warmerda
+ * fixed support for ModelTypeGeographic as per email from Young Su, Cha
+ *
+ * Revision 1.20  2003/07/08 17:31:30  warmerda
+ * cleanup various warnings
+ *
+ * Revision 1.19  2002/11/29 20:57:09  warmerda
+ * added LCC1SP mapping
+ *
+ * Revision 1.18  2002/07/09 14:47:53  warmerda
+ * fixed translation of polar stereographic
+ *
+ * Revision 1.17  2001/11/23 19:53:56  warmerda
+ * free PROJ.4 definitions after use
+ *
+ * Revision 1.16  2000/12/05 19:21:45  warmerda
+ * added cassini support
+ *
+ * Revision 1.15  2000/12/05 17:44:41  warmerda
+ * Use +R_A for Miller and VanDerGrinten
+ *
+ * Revision 1.14  2000/10/13 18:06:51  warmerda
+ * added econic support for PROJ.4 translation
+ *
+ * Revision 1.13  2000/09/15 19:30:48  warmerda
+ * *** empty log message ***
+ *
+ * Revision 1.12  2000/09/15 18:21:07  warmerda
+ * Fixed order of parameters for LCC 2SP.  When parameters
+ * were read from EPSG CSV files the standard parallels and origin
+ * were mixed up.  This affects alot of state plane zones!
+ *
+ * Revision 1.11  2000/06/06 17:39:45  warmerda
+ * Modify to work with projUV version of library.
+ *
+ * Revision 1.10  1999/07/06 15:05:51  warmerda
+ * Fixed up LCC_1SP notes.
+ *
+ * Revision 1.9  1999/05/04 16:24:49  warmerda
+ * Fixed projection string formating with zones.
+ *
+ * Revision 1.8  1999/05/04 12:27:01  geotiff
+ * only emit proj unsupported warning if DEBUG defined
+ *
+ * Revision 1.7  1999/05/04 03:14:59  warmerda
+ * fixed use of foot instead of ft for units
+ *
+ * Revision 1.6  1999/05/03 17:50:31  warmerda
+ * avoid warnings on IRIX
+ *
+ * Revision 1.5  1999/04/29 23:02:24  warmerda
+ * added mapsys utm test.
+ *
+ * Revision 1.4  1999/03/18 21:35:42  geotiff
+ * Added reprojection functions
+ *
+ * Revision 1.3  1999/03/10 18:11:17  geotiff
+ * Removed comment about this not being the master ... now it is.
+ *
+ * Revision 1.2  1999/03/10 18:10:27  geotiff
+ * Avoid use of cpl_serv.h and CPLStrdup().
+ *
+ * Revision 1.1  1999/03/10 15:20:43  geotiff
+ * New
+ *
+ */
+
+#include "cpl_serv.h"
+#include "geotiff.h"
+#include "geo_normalize.h"
+#include "geovalues.h"
+
+/************************************************************************/
+/*                          GTIFGetProj4Defn()                          */
+/************************************************************************/
+
+char * GTIFGetProj4Defn( GTIFDefn * psDefn )
+
+{
+    char	szProjection[512];
+    char	szUnits[24];
+    double      dfFalseEasting, dfFalseNorthing;
+
+    szProjection[0] = '\0';
+    
+/* ==================================================================== */
+/*      Translate the units of measure.                                 */
+/*                                                                      */
+/*      Note that even with a +units, or +to_meter in effect, it is     */
+/*      still assumed that all the projection parameters are in         */
+/*      meters.                                                         */
+/* ==================================================================== */
+    if( psDefn->UOMLength == Linear_Meter )
+    {
+        strcpy( szUnits, "+units=m " ); 
+    }
+    else if( psDefn->UOMLength == Linear_Foot )
+    {
+        strcpy( szUnits, "+units=ft " );
+    }
+    else if( psDefn->UOMLength == Linear_Foot_US_Survey )
+    {
+        strcpy( szUnits, "+units=us-ft " );
+    }
+    else if( psDefn->UOMLength == Linear_Foot_Indian )
+    {
+        strcpy( szUnits, "+units=ind-ft " );
+    }
+    else if( psDefn->UOMLength == Linear_Link )
+    {
+        strcpy( szUnits, "+units=link " );
+    }
+    else if( psDefn->UOMLength == Linear_Yard_Indian)
+    {
+        strcpy( szUnits, "+units=ind-yd " );
+    }
+    else if( psDefn->UOMLength == Linear_Fathom )
+    {
+        strcpy( szUnits, "+units=fath " );
+    }
+    else if( psDefn->UOMLength == Linear_Mile_International_Nautical )
+    {
+        strcpy( szUnits, "+units=kmi " );
+    }
+    else
+    {
+        sprintf( szUnits, "+to_meter=%.10f", psDefn->UOMLengthInMeters );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      false easting and northing are in meters and that is what       */
+/*      PROJ.4 wants regardless of the linear units.                    */
+/* -------------------------------------------------------------------- */
+    dfFalseEasting = psDefn->ProjParm[5];
+    dfFalseNorthing = psDefn->ProjParm[6];
+    
+/* ==================================================================== */
+/*      Handle general projection methods.                              */
+/* ==================================================================== */
+ 
+/* -------------------------------------------------------------------- */
+/*      Geographic.                                                     */
+/* -------------------------------------------------------------------- */
+    if(psDefn->Model==ModelTypeGeographic)
+    {
+        sprintf(szProjection+strlen(szProjection),"+proj=latlong ");
+        
+    }
+ 
+/* -------------------------------------------------------------------- */
+/*      UTM - special case override on transverse mercator so things    */
+/*      will be more meaningful to the user.                            */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->MapSys == MapSys_UTM_North )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=utm +zone=%d ",
+                 psDefn->Zone );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Transverse Mercator                                             */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_TransverseMercator )
+    {
+        sprintf( szProjection+strlen(szProjection),
+           "+proj=tmerc +lat_0=%.9f +lon_0=%.9f +k=%f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 psDefn->ProjParm[4],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Mercator							*/
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_Mercator )
+    {
+        sprintf( szProjection+strlen(szProjection),
+           "+proj=merc +lat_ts=%.9f +lon_0=%.9f +k=%f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 psDefn->ProjParm[4],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Cassini/Soldner                                                 */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_CassiniSoldner )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=cass +lat_0=%.9f +lon_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Oblique Stereographic - Should this really map onto             */
+/*      Stereographic?                                                  */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_ObliqueStereographic )
+    {
+        sprintf( szProjection+strlen(szProjection),
+           "+proj=stere +lat_0=%.9f +lon_0=%.9f +k=%f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 psDefn->ProjParm[4],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Stereographic                                                   */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_Stereographic )
+    {
+        sprintf( szProjection+strlen(szProjection),
+           "+proj=stere +lat_0=%.9f +lon_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Polar Stereographic                                             */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_PolarStereographic )
+    {
+        if( psDefn->ProjParm[0] > 0.0 )
+            sprintf( szProjection+strlen(szProjection),
+                     "+proj=stere +lat_0=90 +lat_ts=%.9f +lon_0=%.9f "
+                     "+k=%.9f +x_0=%.3f +y_0=%.3f ",
+                     psDefn->ProjParm[0],
+                     psDefn->ProjParm[1],
+                     psDefn->ProjParm[4],
+                     dfFalseEasting,
+                     dfFalseNorthing );
+        else
+            sprintf( szProjection+strlen(szProjection),
+                     "+proj=stere +lat_0=-90 +lat_ts=%.9f +lon_0=%.9f "
+                     "+k=%.9f +x_0=%.3f +y_0=%.3f ",
+                     psDefn->ProjParm[0],
+                     psDefn->ProjParm[1],
+                     psDefn->ProjParm[4],
+                     dfFalseEasting,
+                     dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Equirectangular                                                 */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_Equirectangular )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=eqc +lat_ts=%.9f +lon_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Gnomonic                                                        */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_Gnomonic )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=gnom +lat_0=%.9f +lon_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Orthographic                                                    */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_Orthographic )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=ortho +lat_0=%.9f +lon_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Lambert Azimuthal Equal Area                                    */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_LambertAzimEqualArea )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=laea +lat_0=%.9f +lon_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Azimuthal Equidistant                                           */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_AzimuthalEquidistant )
+    {
+        sprintf( szProjection+strlen(szProjection),
+           "+proj=aeqd +lat_0=%.9f +lon_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Miller Cylindrical                                              */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_MillerCylindrical )
+    {
+        sprintf( szProjection+strlen(szProjection),
+           "+proj=mill +lat_0=%.9f +lon_0=%.9f +x_0=%.3f +y_0=%.3f +R_A ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Polyconic                                                       */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_Polyconic )
+    {
+        sprintf( szProjection+strlen(szProjection),
+           "+proj=poly +lat_0=%.9f +lon_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      AlbersEqualArea                                                 */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_AlbersEqualArea )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=aea +lat_1=%.9f +lat_2=%.9f +lat_0=%.9f +lon_0=%.9f"
+                 " +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 psDefn->ProjParm[2],
+                 psDefn->ProjParm[3],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      EquidistantConic                                                */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_EquidistantConic )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=eqdc +lat_1=%.9f +lat_2=%.9f +lat_0=%.9f +lon_0=%.9f"
+                 " +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 psDefn->ProjParm[2],
+                 psDefn->ProjParm[3],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Robinson                                                        */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_Robinson )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=robin +lon_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      VanDerGrinten                                                   */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_VanDerGrinten )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=vandg +lon_0=%.9f +x_0=%.3f +y_0=%.3f +R_A ",
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Sinusoidal                                                      */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_Sinusoidal )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=sinu +lon_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[1],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      LambertConfConic_2SP                                            */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_LambertConfConic_2SP )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=lcc +lat_0=%.9f +lon_0=%.9f +lat_1=%.9f +lat_2=%.9f "
+                 " +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 psDefn->ProjParm[2],
+                 psDefn->ProjParm[3],
+                 dfFalseEasting,
+                 dfFalseNorthing );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      LambertConfConic_1SP                                            */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_LambertConfConic_1SP )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=lcc +lat_0=%.9f +lat_1=%.9f +lon_0=%.9f"
+                 " +k_0=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 psDefn->ProjParm[4],
+                 psDefn->ProjParm[5],
+                 psDefn->ProjParm[6] );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      CT_CylindricalEqualArea                                         */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_CylindricalEqualArea )
+    {
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=cea +lat_ts=%.9f +lon_0=%.9f "
+                 " +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 psDefn->ProjParm[5],
+                 psDefn->ProjParm[6] );
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      NewZealandMapGrid                                               */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_NewZealandMapGrid )
+    {
+        /* this appears to be an unsupported formulation with PROJ.4 */
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      Transverse Mercator - south oriented.                           */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_TransvMercator_SouthOriented )
+    {
+        /* this appears to be an unsupported formulation with PROJ.4 */
+    }
+    
+/* -------------------------------------------------------------------- */
+/*      ObliqueMercator (Hotine)                                        */
+/* -------------------------------------------------------------------- */
+    else if( psDefn->CTProjection == CT_ObliqueMercator )
+    {
+        /* not clear how ProjParm[3] - angle from rectified to skewed grid -
+           should be applied ... see the +not_rot flag for PROJ.4.
+           Just ignoring for now. */
+
+        sprintf( szProjection+strlen(szProjection),
+                 "+proj=omerc +lat_0=%.9f +lonc=%.9f +alpha=%.9f"
+                 " +k=%.9f +x_0=%.3f +y_0=%.3f ",
+                 psDefn->ProjParm[0],
+                 psDefn->ProjParm[1],
+                 psDefn->ProjParm[2],
+                 psDefn->ProjParm[4],
+                 psDefn->ProjParm[5],
+                 psDefn->ProjParm[6] );
+    }
+
+/* ==================================================================== */
+/*      Handle ellipsoid information.                                   */
+/* ==================================================================== */
+    if( psDefn->Ellipsoid == Ellipse_WGS_84 )
+        strcat( szProjection, "+ellps=WGS84 " );
+    else if( psDefn->Ellipsoid == Ellipse_Clarke_1866 )
+        strcat( szProjection, "+ellps=clrk66 " );
+    else if( psDefn->Ellipsoid == Ellipse_Clarke_1880 )
+        strcat( szProjection, "+ellps=clrk80 " );
+    else if( psDefn->Ellipsoid == Ellipse_GRS_1980 )
+        strcat( szProjection, "+ellps=GRS80 " );
+    else
+    {
+        if( psDefn->SemiMajor != 0.0 && psDefn->SemiMinor != 0.0 )
+        {
+            sprintf( szProjection+strlen(szProjection),
+                     "+a=%.3f +b=%.3f ",
+                     psDefn->SemiMajor,
+                     psDefn->SemiMinor );
+        }
+    }
+
+    strcat( szProjection, szUnits );
+
+    return( strdup( szProjection ) );
+}
+
+#if !defined(HAVE_LIBPROJ) || !defined(HAVE_PROJECTS_H)
+
+int GTIFProj4ToLatLong( GTIFDefn * psDefn, int nPoints,
+                        double *padfX, double *padfY )
+{
+    (void) psDefn;
+    (void) nPoints;
+    (void) padfX;
+    (void) padfY;
+#ifdef DEBUG    
+    fprintf( stderr,
+             "GTIFProj4ToLatLong() - PROJ.4 support not compiled in.\n" );
+#endif    
+    return FALSE;
+}
+
+int GTIFProj4FromLatLong( GTIFDefn * psDefn, int nPoints,
+                          double *padfX, double *padfY )
+{
+    (void) psDefn;
+    (void) nPoints;
+    (void) padfX;
+    (void) padfY;
+#ifdef DEBUG    
+    fprintf( stderr,
+             "GTIFProj4FromLatLong() - PROJ.4 support not compiled in.\n" );
+#endif    
+    return FALSE;
+}
+#else
+
+#include "projects.h"
+
+#ifdef USE_PROJUV
+#  define UV projUV
+#endif
+
+/************************************************************************/
+/*                        GTIFProj4FromLatLong()                        */
+/*                                                                      */
+/*      Convert lat/long values to projected coordinate for a           */
+/*      particular definition.                                          */
+/************************************************************************/
+
+int GTIFProj4FromLatLong( GTIFDefn * psDefn, int nPoints,
+                          double *padfX, double *padfY )
+
+{
+    char	*pszProjection, **papszArgs;
+    PJ		*psPJ;
+    int		i;
+    
+/* -------------------------------------------------------------------- */
+/*      Get a projection definition.                                    */
+/* -------------------------------------------------------------------- */
+    pszProjection = GTIFGetProj4Defn( psDefn );
+
+    if( pszProjection == NULL )
+        return FALSE;
+
+/* -------------------------------------------------------------------- */
+/*      Parse into tokens for pj_init(), and initialize the projection. */
+/* -------------------------------------------------------------------- */
+    
+    papszArgs = CSLTokenizeStringComplex( pszProjection, " +", TRUE, FALSE );
+    free( pszProjection );
+
+    psPJ = pj_init( CSLCount(papszArgs), papszArgs );
+
+    CSLDestroy( papszArgs );
+
+    if( psPJ == NULL )
+    {
+        return FALSE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Process each of the points.                                     */
+/* -------------------------------------------------------------------- */
+    for( i = 0; i < nPoints; i++ )
+    {
+        UV	sUV;
+
+        sUV.u = padfX[i] * DEG_TO_RAD;
+        sUV.v = padfY[i] * DEG_TO_RAD;
+
+        sUV = pj_fwd( sUV, psPJ );
+
+        padfX[i] = sUV.u;
+        padfY[i] = sUV.v;
+    }
+
+    pj_free( psPJ );
+
+    return TRUE;
+}
+
+/************************************************************************/
+/*                         GTIFProj4ToLatLong()                         */
+/*                                                                      */
+/*      Convert projection coordinates to lat/long for a particular     */
+/*      definition.                                                     */
+/************************************************************************/
+
+int GTIFProj4ToLatLong( GTIFDefn * psDefn, int nPoints,
+                        double *padfX, double *padfY )
+
+{
+    char	*pszProjection, **papszArgs;
+    PJ		*psPJ;
+    int		i;
+    
+/* -------------------------------------------------------------------- */
+/*      Get a projection definition.                                    */
+/* -------------------------------------------------------------------- */
+    pszProjection = GTIFGetProj4Defn( psDefn );
+
+    if( pszProjection == NULL )
+        return FALSE;
+
+/* -------------------------------------------------------------------- */
+/*      Parse into tokens for pj_init(), and initialize the projection. */
+/* -------------------------------------------------------------------- */
+    
+    papszArgs = CSLTokenizeStringComplex( pszProjection, " +", TRUE, FALSE );
+    free( pszProjection );
+
+    psPJ = pj_init( CSLCount(papszArgs), papszArgs );
+
+    CSLDestroy( papszArgs );
+
+    if( psPJ == NULL )
+    {
+        return FALSE;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Process each of the points.                                     */
+/* -------------------------------------------------------------------- */
+    for( i = 0; i < nPoints; i++ )
+    {
+        UV	sUV;
+
+        sUV.u = padfX[i];
+        sUV.v = padfY[i];
+
+        sUV = pj_inv( sUV, psPJ );
+
+        padfX[i] = sUV.u * RAD_TO_DEG;
+        padfY[i] = sUV.v * RAD_TO_DEG;
+    }
+
+    pj_free( psPJ );
+
+    return TRUE;
+}
+
+
+#endif /* has projects.h and -lproj */
+
diff --git a/src/tiff/geotiffio.h b/src/tiff/geotiffio.h
new file mode 100644
index 0000000..5880664
--- /dev/null
+++ b/src/tiff/geotiffio.h
@@ -0,0 +1,16 @@
+/* 
+ * geotiffio.h
+ * 
+ * Standard include file for geotiff, including all
+ *  key and code definitions.
+ */
+
+
+#ifndef __geotiffio_h
+#define __geotiffio_h
+
+#include "geotiff.h"  /* public key interface */
+#include "geovalues.h" /* key code definitions */
+
+#endif /* __geotiffio_h */
+
diff --git a/src/tiff/geovalues.h b/src/tiff/geovalues.h
new file mode 100644
index 0000000..9834534
--- /dev/null
+++ b/src/tiff/geovalues.h
@@ -0,0 +1,120 @@
+/**********************************************************************
+ *
+ *  geovalues.h - Public registry for valid GEOTIFF  key-values.
+ *
+ *   Written By: Niles D. Ritter
+ *
+ *  Revision History:
+ *
+ *     Rev.#  Author     Date     Key Changes/Additions
+ *     -----  ------  ----------  -------------------------------------
+ *      0.1     ndr    10 Jun 95     Inital Beta Release
+ *      0.2     ndr    12 Jul 95     New EPSG Tables installed.
+ *      0.2.1   ndr    28 Jul 95     Added ModelType aliases to Model's
+ *      1.0     ndr    18 Sep 95     Promoted to Revision 1.0
+ *
+ **********************************************************************/
+
+#ifndef __geovalues_h_
+#define __geovalues_h_
+
+/* If code values are added or modified, the "GvCurrentMinorRev" 
+ * number should be incremented here. If new Keys are added, then the
+ * GvCurrentRevision number should be incremented instead, and the
+ * GvCurrentMinorRev should be reset to zero (see "geokeys.h").
+ *
+ * In addition, any changes here should be reflected in "geo_names.c"
+ *
+ */
+ 
+#define GvCurrentMinorRev  0  /* First Major Rev EPSG Code Release  */
+
+
+/*
+ * Universal key values -- defined for consistency
+ */
+#define KvUndefined         0
+#define KvUserDefined   32767
+
+#ifdef ValuePair
+#  undef ValuePair
+#endif
+#define ValuePair(name,value)    name = value,
+
+/*
+ * The section numbers refer to the GeoTIFF Specification section
+ * in which the code values are documented.
+ */
+ 
+/************************************************************
+ *         6.3.1 GeoTIFF General Codes
+ ************************************************************/
+
+/* 6.3.1.1 Model Type Codes */
+typedef enum {
+	ModelTypeProjected  = 1,  /* Projection Coordinate System */
+	ModelTypeGeographic = 2,  /* Geographic latitude-longitude System */
+	ModelTypeGeocentric = 3,   /* Geocentric (X,Y,Z) Coordinate System */
+	ModelProjected  = ModelTypeProjected,   /* alias */
+	ModelGeographic = ModelTypeGeographic,  /* alias */
+	ModelGeocentric = ModelTypeGeocentric   /* alias */
+} modeltype_t;
+
+/* 6.3.1.2 Raster Type Codes */
+typedef enum {
+	RasterPixelIsArea   = 1,  /* Standard pixel-fills-grid-cell */
+	RasterPixelIsPoint  = 2   /* Pixel-at-grid-vertex */
+} rastertype_t;
+
+typedef enum {
+#  include "epsg_gcs.inc"
+  geographic_end
+} geographic_t;
+
+typedef enum {
+#  include "epsg_datum.inc"
+   geodeticdatum_end
+} geodeticdatum_t;
+
+typedef enum {
+#  include "epsg_units.inc"
+   Unit_End
+} geounits_t;
+
+typedef enum {
+#  include "epsg_ellipse.inc"
+    ellipsoid_end
+} ellipsoid_t;
+
+typedef enum {
+#  include "epsg_pm.inc"
+   primemeridian_end
+} primemeridian_t;
+
+typedef enum {
+#  include "epsg_pcs.inc"
+   pcstype_end
+} pcstype_t;
+
+typedef enum {
+#  include "epsg_proj.inc"
+   projection_end
+} projection_t;
+
+typedef enum {
+#  include "geo_ctrans.inc"
+   coordtrans_end
+} coordtrans_t;
+
+typedef enum {
+#  include "epsg_vertcs.inc"
+   vertcs_end
+} vertcstype_t;
+
+
+typedef enum {
+	VDatumBase = 1
+} vdatum_t;
+
+#endif /* __geovalues_h_ */
+
diff --git a/src/tiff/port.h b/src/tiff/port.h
new file mode 100644
index 0000000..293ad05
--- /dev/null
+++ b/src/tiff/port.h
@@ -0,0 +1,32 @@
+/*
+ * Warning, this file was automatically created by the TIFF configure script
+ * VERSION:	 v3.4033
+ * DATE:	 Fri Dec 12 17:10:08 EDT 1997
+ * TARGET:	 sparc-sun-solaris2.5.1
+ * CCOMPILER:	 /usr/local/bin/gcc-2.7.2
+ */
+#ifndef _PORT_
+#define _PORT_ 1
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <sys/types.h>
+#define HOST_FILLORDER FILLORDER_LSB2MSB
+#define HOST_BIGENDIAN	0
+#define HAVE_MMAP 1
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <fcntl.h>
+typedef double dblparam_t;
+#ifdef __STRICT_ANSI__
+#define	INLINE	__inline__
+#else
+#define	INLINE	inline
+#endif
+#define GLOBALDATA(TYPE,NAME)	extern TYPE NAME
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/tiff/t4.h b/src/tiff/t4.h
new file mode 100644
index 0000000..e358233
--- /dev/null
+++ b/src/tiff/t4.h
@@ -0,0 +1,285 @@
+/* $Id: t4.h 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _T4_
+#define	_T4_
+/*
+ * CCITT T.4 1D Huffman runlength codes and
+ * related definitions.  Given the small sizes
+ * of these tables it does not seem
+ * worthwhile to make code & length 8 bits.
+ */
+typedef struct tableentry {
+    unsigned short length;	/* bit length of g3 code */
+    unsigned short code;	/* g3 code */
+    short	runlen;		/* run length in bits */
+} tableentry;
+
+#define	EOL	0x001	/* EOL code value - 0000 0000 0000 1 */
+
+/* status values returned instead of a run length */
+#define	G3CODE_EOL	-1	/* NB: ACT_EOL - ACT_WRUNT */
+#define	G3CODE_INVALID	-2	/* NB: ACT_INVALID - ACT_WRUNT */
+#define	G3CODE_EOF	-3	/* end of input data */
+#define	G3CODE_INCOMP	-4	/* incomplete run code */
+
+/*
+ * Note that these tables are ordered such that the
+ * index into the table is known to be either the
+ * run length, or (run length / 64) + a fixed offset.
+ *
+ * NB: The G3CODE_INVALID entries are only used
+ *     during state generation (see mkg3states.c).
+ */
+#ifdef G3CODES
+const tableentry TIFFFaxWhiteCodes[] = {
+    { 8, 0x35, 0 },	/* 0011 0101 */
+    { 6, 0x7, 1 },	/* 0001 11 */
+    { 4, 0x7, 2 },	/* 0111 */
+    { 4, 0x8, 3 },	/* 1000 */
+    { 4, 0xB, 4 },	/* 1011 */
+    { 4, 0xC, 5 },	/* 1100 */
+    { 4, 0xE, 6 },	/* 1110 */
+    { 4, 0xF, 7 },	/* 1111 */
+    { 5, 0x13, 8 },	/* 1001 1 */
+    { 5, 0x14, 9 },	/* 1010 0 */
+    { 5, 0x7, 10 },	/* 0011 1 */
+    { 5, 0x8, 11 },	/* 0100 0 */
+    { 6, 0x8, 12 },	/* 0010 00 */
+    { 6, 0x3, 13 },	/* 0000 11 */
+    { 6, 0x34, 14 },	/* 1101 00 */
+    { 6, 0x35, 15 },	/* 1101 01 */
+    { 6, 0x2A, 16 },	/* 1010 10 */
+    { 6, 0x2B, 17 },	/* 1010 11 */
+    { 7, 0x27, 18 },	/* 0100 111 */
+    { 7, 0xC, 19 },	/* 0001 100 */
+    { 7, 0x8, 20 },	/* 0001 000 */
+    { 7, 0x17, 21 },	/* 0010 111 */
+    { 7, 0x3, 22 },	/* 0000 011 */
+    { 7, 0x4, 23 },	/* 0000 100 */
+    { 7, 0x28, 24 },	/* 0101 000 */
+    { 7, 0x2B, 25 },	/* 0101 011 */
+    { 7, 0x13, 26 },	/* 0010 011 */
+    { 7, 0x24, 27 },	/* 0100 100 */
+    { 7, 0x18, 28 },	/* 0011 000 */
+    { 8, 0x2, 29 },	/* 0000 0010 */
+    { 8, 0x3, 30 },	/* 0000 0011 */
+    { 8, 0x1A, 31 },	/* 0001 1010 */
+    { 8, 0x1B, 32 },	/* 0001 1011 */
+    { 8, 0x12, 33 },	/* 0001 0010 */
+    { 8, 0x13, 34 },	/* 0001 0011 */
+    { 8, 0x14, 35 },	/* 0001 0100 */
+    { 8, 0x15, 36 },	/* 0001 0101 */
+    { 8, 0x16, 37 },	/* 0001 0110 */
+    { 8, 0x17, 38 },	/* 0001 0111 */
+    { 8, 0x28, 39 },	/* 0010 1000 */
+    { 8, 0x29, 40 },	/* 0010 1001 */
+    { 8, 0x2A, 41 },	/* 0010 1010 */
+    { 8, 0x2B, 42 },	/* 0010 1011 */
+    { 8, 0x2C, 43 },	/* 0010 1100 */
+    { 8, 0x2D, 44 },	/* 0010 1101 */
+    { 8, 0x4, 45 },	/* 0000 0100 */
+    { 8, 0x5, 46 },	/* 0000 0101 */
+    { 8, 0xA, 47 },	/* 0000 1010 */
+    { 8, 0xB, 48 },	/* 0000 1011 */
+    { 8, 0x52, 49 },	/* 0101 0010 */
+    { 8, 0x53, 50 },	/* 0101 0011 */
+    { 8, 0x54, 51 },	/* 0101 0100 */
+    { 8, 0x55, 52 },	/* 0101 0101 */
+    { 8, 0x24, 53 },	/* 0010 0100 */
+    { 8, 0x25, 54 },	/* 0010 0101 */
+    { 8, 0x58, 55 },	/* 0101 1000 */
+    { 8, 0x59, 56 },	/* 0101 1001 */
+    { 8, 0x5A, 57 },	/* 0101 1010 */
+    { 8, 0x5B, 58 },	/* 0101 1011 */
+    { 8, 0x4A, 59 },	/* 0100 1010 */
+    { 8, 0x4B, 60 },	/* 0100 1011 */
+    { 8, 0x32, 61 },	/* 0011 0010 */
+    { 8, 0x33, 62 },	/* 0011 0011 */
+    { 8, 0x34, 63 },	/* 0011 0100 */
+    { 5, 0x1B, 64 },	/* 1101 1 */
+    { 5, 0x12, 128 },	/* 1001 0 */
+    { 6, 0x17, 192 },	/* 0101 11 */
+    { 7, 0x37, 256 },	/* 0110 111 */
+    { 8, 0x36, 320 },	/* 0011 0110 */
+    { 8, 0x37, 384 },	/* 0011 0111 */
+    { 8, 0x64, 448 },	/* 0110 0100 */
+    { 8, 0x65, 512 },	/* 0110 0101 */
+    { 8, 0x68, 576 },	/* 0110 1000 */
+    { 8, 0x67, 640 },	/* 0110 0111 */
+    { 9, 0xCC, 704 },	/* 0110 0110 0 */
+    { 9, 0xCD, 768 },	/* 0110 0110 1 */
+    { 9, 0xD2, 832 },	/* 0110 1001 0 */
+    { 9, 0xD3, 896 },	/* 0110 1001 1 */
+    { 9, 0xD4, 960 },	/* 0110 1010 0 */
+    { 9, 0xD5, 1024 },	/* 0110 1010 1 */
+    { 9, 0xD6, 1088 },	/* 0110 1011 0 */
+    { 9, 0xD7, 1152 },	/* 0110 1011 1 */
+    { 9, 0xD8, 1216 },	/* 0110 1100 0 */
+    { 9, 0xD9, 1280 },	/* 0110 1100 1 */
+    { 9, 0xDA, 1344 },	/* 0110 1101 0 */
+    { 9, 0xDB, 1408 },	/* 0110 1101 1 */
+    { 9, 0x98, 1472 },	/* 0100 1100 0 */
+    { 9, 0x99, 1536 },	/* 0100 1100 1 */
+    { 9, 0x9A, 1600 },	/* 0100 1101 0 */
+    { 6, 0x18, 1664 },	/* 0110 00 */
+    { 9, 0x9B, 1728 },	/* 0100 1101 1 */
+    { 11, 0x8, 1792 },	/* 0000 0001 000 */
+    { 11, 0xC, 1856 },	/* 0000 0001 100 */
+    { 11, 0xD, 1920 },	/* 0000 0001 101 */
+    { 12, 0x12, 1984 },	/* 0000 0001 0010 */
+    { 12, 0x13, 2048 },	/* 0000 0001 0011 */
+    { 12, 0x14, 2112 },	/* 0000 0001 0100 */
+    { 12, 0x15, 2176 },	/* 0000 0001 0101 */
+    { 12, 0x16, 2240 },	/* 0000 0001 0110 */
+    { 12, 0x17, 2304 },	/* 0000 0001 0111 */
+    { 12, 0x1C, 2368 },	/* 0000 0001 1100 */
+    { 12, 0x1D, 2432 },	/* 0000 0001 1101 */
+    { 12, 0x1E, 2496 },	/* 0000 0001 1110 */
+    { 12, 0x1F, 2560 },	/* 0000 0001 1111 */
+    { 12, 0x1, G3CODE_EOL },	/* 0000 0000 0001 */
+    { 9, 0x1, G3CODE_INVALID },	/* 0000 0000 1 */
+    { 10, 0x1, G3CODE_INVALID },	/* 0000 0000 01 */
+    { 11, 0x1, G3CODE_INVALID },	/* 0000 0000 001 */
+    { 12, 0x0, G3CODE_INVALID },	/* 0000 0000 0000 */
+};
+
+const tableentry TIFFFaxBlackCodes[] = {
+    { 10, 0x37, 0 },	/* 0000 1101 11 */
+    { 3, 0x2, 1 },	/* 010 */
+    { 2, 0x3, 2 },	/* 11 */
+    { 2, 0x2, 3 },	/* 10 */
+    { 3, 0x3, 4 },	/* 011 */
+    { 4, 0x3, 5 },	/* 0011 */
+    { 4, 0x2, 6 },	/* 0010 */
+    { 5, 0x3, 7 },	/* 0001 1 */
+    { 6, 0x5, 8 },	/* 0001 01 */
+    { 6, 0x4, 9 },	/* 0001 00 */
+    { 7, 0x4, 10 },	/* 0000 100 */
+    { 7, 0x5, 11 },	/* 0000 101 */
+    { 7, 0x7, 12 },	/* 0000 111 */
+    { 8, 0x4, 13 },	/* 0000 0100 */
+    { 8, 0x7, 14 },	/* 0000 0111 */
+    { 9, 0x18, 15 },	/* 0000 1100 0 */
+    { 10, 0x17, 16 },	/* 0000 0101 11 */
+    { 10, 0x18, 17 },	/* 0000 0110 00 */
+    { 10, 0x8, 18 },	/* 0000 0010 00 */
+    { 11, 0x67, 19 },	/* 0000 1100 111 */
+    { 11, 0x68, 20 },	/* 0000 1101 000 */
+    { 11, 0x6C, 21 },	/* 0000 1101 100 */
+    { 11, 0x37, 22 },	/* 0000 0110 111 */
+    { 11, 0x28, 23 },	/* 0000 0101 000 */
+    { 11, 0x17, 24 },	/* 0000 0010 111 */
+    { 11, 0x18, 25 },	/* 0000 0011 000 */
+    { 12, 0xCA, 26 },	/* 0000 1100 1010 */
+    { 12, 0xCB, 27 },	/* 0000 1100 1011 */
+    { 12, 0xCC, 28 },	/* 0000 1100 1100 */
+    { 12, 0xCD, 29 },	/* 0000 1100 1101 */
+    { 12, 0x68, 30 },	/* 0000 0110 1000 */
+    { 12, 0x69, 31 },	/* 0000 0110 1001 */
+    { 12, 0x6A, 32 },	/* 0000 0110 1010 */
+    { 12, 0x6B, 33 },	/* 0000 0110 1011 */
+    { 12, 0xD2, 34 },	/* 0000 1101 0010 */
+    { 12, 0xD3, 35 },	/* 0000 1101 0011 */
+    { 12, 0xD4, 36 },	/* 0000 1101 0100 */
+    { 12, 0xD5, 37 },	/* 0000 1101 0101 */
+    { 12, 0xD6, 38 },	/* 0000 1101 0110 */
+    { 12, 0xD7, 39 },	/* 0000 1101 0111 */
+    { 12, 0x6C, 40 },	/* 0000 0110 1100 */
+    { 12, 0x6D, 41 },	/* 0000 0110 1101 */
+    { 12, 0xDA, 42 },	/* 0000 1101 1010 */
+    { 12, 0xDB, 43 },	/* 0000 1101 1011 */
+    { 12, 0x54, 44 },	/* 0000 0101 0100 */
+    { 12, 0x55, 45 },	/* 0000 0101 0101 */
+    { 12, 0x56, 46 },	/* 0000 0101 0110 */
+    { 12, 0x57, 47 },	/* 0000 0101 0111 */
+    { 12, 0x64, 48 },	/* 0000 0110 0100 */
+    { 12, 0x65, 49 },	/* 0000 0110 0101 */
+    { 12, 0x52, 50 },	/* 0000 0101 0010 */
+    { 12, 0x53, 51 },	/* 0000 0101 0011 */
+    { 12, 0x24, 52 },	/* 0000 0010 0100 */
+    { 12, 0x37, 53 },	/* 0000 0011 0111 */
+    { 12, 0x38, 54 },	/* 0000 0011 1000 */
+    { 12, 0x27, 55 },	/* 0000 0010 0111 */
+    { 12, 0x28, 56 },	/* 0000 0010 1000 */
+    { 12, 0x58, 57 },	/* 0000 0101 1000 */
+    { 12, 0x59, 58 },	/* 0000 0101 1001 */
+    { 12, 0x2B, 59 },	/* 0000 0010 1011 */
+    { 12, 0x2C, 60 },	/* 0000 0010 1100 */
+    { 12, 0x5A, 61 },	/* 0000 0101 1010 */
+    { 12, 0x66, 62 },	/* 0000 0110 0110 */
+    { 12, 0x67, 63 },	/* 0000 0110 0111 */
+    { 10, 0xF, 64 },	/* 0000 0011 11 */
+    { 12, 0xC8, 128 },	/* 0000 1100 1000 */
+    { 12, 0xC9, 192 },	/* 0000 1100 1001 */
+    { 12, 0x5B, 256 },	/* 0000 0101 1011 */
+    { 12, 0x33, 320 },	/* 0000 0011 0011 */
+    { 12, 0x34, 384 },	/* 0000 0011 0100 */
+    { 12, 0x35, 448 },	/* 0000 0011 0101 */
+    { 13, 0x6C, 512 },	/* 0000 0011 0110 0 */
+    { 13, 0x6D, 576 },	/* 0000 0011 0110 1 */
+    { 13, 0x4A, 640 },	/* 0000 0010 0101 0 */
+    { 13, 0x4B, 704 },	/* 0000 0010 0101 1 */
+    { 13, 0x4C, 768 },	/* 0000 0010 0110 0 */
+    { 13, 0x4D, 832 },	/* 0000 0010 0110 1 */
+    { 13, 0x72, 896 },	/* 0000 0011 1001 0 */
+    { 13, 0x73, 960 },	/* 0000 0011 1001 1 */
+    { 13, 0x74, 1024 },	/* 0000 0011 1010 0 */
+    { 13, 0x75, 1088 },	/* 0000 0011 1010 1 */
+    { 13, 0x76, 1152 },	/* 0000 0011 1011 0 */
+    { 13, 0x77, 1216 },	/* 0000 0011 1011 1 */
+    { 13, 0x52, 1280 },	/* 0000 0010 1001 0 */
+    { 13, 0x53, 1344 },	/* 0000 0010 1001 1 */
+    { 13, 0x54, 1408 },	/* 0000 0010 1010 0 */
+    { 13, 0x55, 1472 },	/* 0000 0010 1010 1 */
+    { 13, 0x5A, 1536 },	/* 0000 0010 1101 0 */
+    { 13, 0x5B, 1600 },	/* 0000 0010 1101 1 */
+    { 13, 0x64, 1664 },	/* 0000 0011 0010 0 */
+    { 13, 0x65, 1728 },	/* 0000 0011 0010 1 */
+    { 11, 0x8, 1792 },	/* 0000 0001 000 */
+    { 11, 0xC, 1856 },	/* 0000 0001 100 */
+    { 11, 0xD, 1920 },	/* 0000 0001 101 */
+    { 12, 0x12, 1984 },	/* 0000 0001 0010 */
+    { 12, 0x13, 2048 },	/* 0000 0001 0011 */
+    { 12, 0x14, 2112 },	/* 0000 0001 0100 */
+    { 12, 0x15, 2176 },	/* 0000 0001 0101 */
+    { 12, 0x16, 2240 },	/* 0000 0001 0110 */
+    { 12, 0x17, 2304 },	/* 0000 0001 0111 */
+    { 12, 0x1C, 2368 },	/* 0000 0001 1100 */
+    { 12, 0x1D, 2432 },	/* 0000 0001 1101 */
+    { 12, 0x1E, 2496 },	/* 0000 0001 1110 */
+    { 12, 0x1F, 2560 },	/* 0000 0001 1111 */
+    { 12, 0x1, G3CODE_EOL },	/* 0000 0000 0001 */
+    { 9, 0x1, G3CODE_INVALID },	/* 0000 0000 1 */
+    { 10, 0x1, G3CODE_INVALID },	/* 0000 0000 01 */
+    { 11, 0x1, G3CODE_INVALID },	/* 0000 0000 001 */
+    { 12, 0x0, G3CODE_INVALID },	/* 0000 0000 0000 */
+};
+#else
+extern	const tableentry TIFFFaxWhiteCodes[];
+extern	const tableentry TIFFFaxBlackCodes[];
+#endif
+#endif /* _T4_ */
diff --git a/src/tiff/tif_aux.c b/src/tiff/tif_aux.c
new file mode 100644
index 0000000..db7caeb
--- /dev/null
+++ b/src/tiff/tif_aux.c
@@ -0,0 +1,267 @@
+/* $Id: tif_aux.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1991-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Auxiliary Support Routines.
+ */
+#include "tiffiop.h"
+#include "tif_predict.h"
+#include <math.h>
+
+tdata_t
+_TIFFCheckMalloc(TIFF* tif, size_t nmemb, size_t elem_size, const char* what)
+{
+	tdata_t cp = NULL;
+	tsize_t	bytes = nmemb * elem_size;
+
+	/*
+	 * XXX: Check for integer overflow.
+	 */
+	if (nmemb && elem_size && bytes / elem_size == nmemb)
+		cp = _TIFFmalloc(bytes);
+
+	if (cp == NULL)
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "No space %s", what);
+
+	return (cp);
+}
+
+static int
+TIFFDefaultTransferFunction(TIFFDirectory* td)
+{
+	uint16 **tf = td->td_transferfunction;
+	tsize_t i, n, nbytes;
+
+	tf[0] = tf[1] = tf[2] = 0;
+	if (td->td_bitspersample >= sizeof(tsize_t) * 8 - 2)
+		return 0;
+
+	n = 1<<td->td_bitspersample;
+	nbytes = n * sizeof (uint16);
+	if (!(tf[0] = (uint16 *)_TIFFmalloc(nbytes)))
+		return 0;
+	tf[0][0] = 0;
+	for (i = 1; i < n; i++) {
+		double t = (double)i/((double) n-1.);
+		tf[0][i] = (uint16)floor(65535.*pow(t, 2.2) + .5);
+	}
+
+	if (td->td_samplesperpixel - td->td_extrasamples > 1) {
+		if (!(tf[1] = (uint16 *)_TIFFmalloc(nbytes)))
+			goto bad;
+		_TIFFmemcpy(tf[1], tf[0], nbytes);
+		if (!(tf[2] = (uint16 *)_TIFFmalloc(nbytes)))
+			goto bad;
+		_TIFFmemcpy(tf[2], tf[0], nbytes);
+	}
+	return 1;
+
+bad:
+	if (tf[0])
+		_TIFFfree(tf[0]);
+	if (tf[1])
+		_TIFFfree(tf[1]);
+	if (tf[2])
+		_TIFFfree(tf[2]);
+	tf[0] = tf[1] = tf[2] = 0;
+	return 0;
+}
+
+/*
+ * Like TIFFGetField, but return any default
+ * value if the tag is not present in the directory.
+ *
+ * NB:	We use the value in the directory, rather than
+ *	explcit values so that defaults exist only one
+ *	place in the library -- in TIFFDefaultDirectory.
+ */
+int
+TIFFVGetFieldDefaulted(TIFF* tif, ttag_t tag, va_list ap)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+
+	if (TIFFVGetField(tif, tag, ap))
+		return (1);
+	switch (tag) {
+	case TIFFTAG_SUBFILETYPE:
+		*va_arg(ap, uint32 *) = td->td_subfiletype;
+		return (1);
+	case TIFFTAG_BITSPERSAMPLE:
+		*va_arg(ap, uint16 *) = td->td_bitspersample;
+		return (1);
+	case TIFFTAG_THRESHHOLDING:
+		*va_arg(ap, uint16 *) = td->td_threshholding;
+		return (1);
+	case TIFFTAG_FILLORDER:
+		*va_arg(ap, uint16 *) = td->td_fillorder;
+		return (1);
+	case TIFFTAG_ORIENTATION:
+		*va_arg(ap, uint16 *) = td->td_orientation;
+		return (1);
+	case TIFFTAG_SAMPLESPERPIXEL:
+		*va_arg(ap, uint16 *) = td->td_samplesperpixel;
+		return (1);
+	case TIFFTAG_ROWSPERSTRIP:
+		*va_arg(ap, uint32 *) = td->td_rowsperstrip;
+		return (1);
+	case TIFFTAG_MINSAMPLEVALUE:
+		*va_arg(ap, uint16 *) = td->td_minsamplevalue;
+		return (1);
+	case TIFFTAG_MAXSAMPLEVALUE:
+		*va_arg(ap, uint16 *) = td->td_maxsamplevalue;
+		return (1);
+	case TIFFTAG_PLANARCONFIG:
+		*va_arg(ap, uint16 *) = td->td_planarconfig;
+		return (1);
+	case TIFFTAG_RESOLUTIONUNIT:
+		*va_arg(ap, uint16 *) = td->td_resolutionunit;
+		return (1);
+	case TIFFTAG_PREDICTOR:
+                {
+			TIFFPredictorState* sp = (TIFFPredictorState*) tif->tif_data;
+			*va_arg(ap, uint16*) = (uint16) sp->predictor;
+			return 1;
+                }
+	case TIFFTAG_DOTRANGE:
+		*va_arg(ap, uint16 *) = 0;
+		*va_arg(ap, uint16 *) = (1<<td->td_bitspersample)-1;
+		return (1);
+	case TIFFTAG_INKSET:
+		*va_arg(ap, uint16 *) = INKSET_CMYK;
+		return 1;
+	case TIFFTAG_NUMBEROFINKS:
+		*va_arg(ap, uint16 *) = 4;
+		return (1);
+	case TIFFTAG_EXTRASAMPLES:
+		*va_arg(ap, uint16 *) = td->td_extrasamples;
+		*va_arg(ap, uint16 **) = td->td_sampleinfo;
+		return (1);
+	case TIFFTAG_MATTEING:
+		*va_arg(ap, uint16 *) =
+		    (td->td_extrasamples == 1 &&
+		     td->td_sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA);
+		return (1);
+	case TIFFTAG_TILEDEPTH:
+		*va_arg(ap, uint32 *) = td->td_tiledepth;
+		return (1);
+	case TIFFTAG_DATATYPE:
+		*va_arg(ap, uint16 *) = td->td_sampleformat-1;
+		return (1);
+	case TIFFTAG_SAMPLEFORMAT:
+		*va_arg(ap, uint16 *) = td->td_sampleformat;
+                return(1);
+	case TIFFTAG_IMAGEDEPTH:
+		*va_arg(ap, uint32 *) = td->td_imagedepth;
+		return (1);
+	case TIFFTAG_YCBCRCOEFFICIENTS:
+		{
+			/* defaults are from CCIR Recommendation 601-1 */
+			static float ycbcrcoeffs[] = { 0.299f, 0.587f, 0.114f };
+			*va_arg(ap, float **) = ycbcrcoeffs;
+			return 1;
+		}
+	case TIFFTAG_YCBCRSUBSAMPLING:
+		*va_arg(ap, uint16 *) = td->td_ycbcrsubsampling[0];
+		*va_arg(ap, uint16 *) = td->td_ycbcrsubsampling[1];
+		return (1);
+	case TIFFTAG_YCBCRPOSITIONING:
+		*va_arg(ap, uint16 *) = td->td_ycbcrpositioning;
+		return (1);
+	case TIFFTAG_WHITEPOINT:
+		{
+			static float whitepoint[2];
+
+			/* TIFF 6.0 specification tells that it is no default
+			   value for the WhitePoint, but AdobePhotoshop TIFF
+			   Technical Note tells that it should be CIE D50. */
+			whitepoint[0] =	D50_X0 / (D50_X0 + D50_Y0 + D50_Z0);
+			whitepoint[1] =	D50_Y0 / (D50_X0 + D50_Y0 + D50_Z0);
+			*va_arg(ap, float **) = whitepoint;
+			return 1;
+		}
+	case TIFFTAG_TRANSFERFUNCTION:
+		if (!td->td_transferfunction[0] &&
+		    !TIFFDefaultTransferFunction(td)) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "No space for \"TransferFunction\" tag");
+			return (0);
+		}
+		*va_arg(ap, uint16 **) = td->td_transferfunction[0];
+		if (td->td_samplesperpixel - td->td_extrasamples > 1) {
+			*va_arg(ap, uint16 **) = td->td_transferfunction[1];
+			*va_arg(ap, uint16 **) = td->td_transferfunction[2];
+		}
+		return (1);
+	case TIFFTAG_REFERENCEBLACKWHITE:
+		{
+			int i;
+			static float ycbcr_refblackwhite[] = 
+			{ 0.0F, 255.0F, 128.0F, 255.0F, 128.0F, 255.0F };
+			static float rgb_refblackwhite[6];
+
+			for (i = 0; i < 3; i++) {
+				rgb_refblackwhite[2 * i + 0] = 0.0F;
+				rgb_refblackwhite[2 * i + 1] =
+					(float)((1L<<td->td_bitspersample)-1L);
+			}
+			
+			if (td->td_photometric == PHOTOMETRIC_YCBCR) {
+				/*
+				 * YCbCr (Class Y) images must have the
+				 * ReferenceBlackWhite tag set. Fix the
+				 * broken images, which lacks that tag.
+				 */
+				*va_arg(ap, float **) = ycbcr_refblackwhite;
+			} else {
+				/*
+				 * Assume RGB (Class R)
+				 */
+				*va_arg(ap, float **) = rgb_refblackwhite;
+			}
+			return 1;
+		}
+	}
+	return 0;
+}
+
+/*
+ * Like TIFFGetField, but return any default
+ * value if the tag is not present in the directory.
+ */
+int
+TIFFGetFieldDefaulted(TIFF* tif, ttag_t tag, ...)
+{
+	int ok;
+	va_list ap;
+
+	va_start(ap, tag);
+	ok =  TIFFVGetFieldDefaulted(tif, tag, ap);
+	va_end(ap);
+	return (ok);
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_close.c b/src/tiff/tif_close.c
new file mode 100644
index 0000000..070deb6
--- /dev/null
+++ b/src/tiff/tif_close.c
@@ -0,0 +1,119 @@
+/* $Id: tif_close.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ */
+#include "tiffiop.h"
+
+/************************************************************************/
+/*                            TIFFCleanup()                             */
+/************************************************************************/
+
+/**
+ * Auxiliary function to free the TIFF structure. Given structure will be
+ * completetly freed, so you should save opened file handle and pointer
+ * to the close procedure in external variables before calling
+ * _TIFFCleanup(), if you will need these ones to close the file.
+ * 
+ * @param tif A TIFF pointer.
+ */
+
+void
+TIFFCleanup(TIFF* tif)
+{
+	if (tif->tif_mode != O_RDONLY)
+	    /*
+	     * Flush buffered data and directory (if dirty).
+	     */
+	    TIFFFlush(tif);
+	(*tif->tif_cleanup)(tif);
+	TIFFFreeDirectory(tif);
+
+	if (tif->tif_dirlist)
+	    _TIFFfree(tif->tif_dirlist);
+	    
+	/* Clean up client info links */
+	while( tif->tif_clientinfo )
+	{
+	    TIFFClientInfoLink *link = tif->tif_clientinfo;
+
+	    tif->tif_clientinfo = link->next;
+	    _TIFFfree( link->name );
+	    _TIFFfree( link );
+	}
+
+	if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER))
+	    _TIFFfree(tif->tif_rawdata);
+	if (isMapped(tif))
+	    TIFFUnmapFileContents(tif, tif->tif_base, tif->tif_size);
+
+	/* Clean up custom fields */
+	if (tif->tif_nfields > 0) 
+	{
+	    size_t  i;
+
+	    for (i = 0; i < tif->tif_nfields; i++) 
+	    {
+		TIFFFieldInfo *fld = tif->tif_fieldinfo[i];
+		if (fld->field_bit == FIELD_CUSTOM && 
+		    strncmp("Tag ", fld->field_name, 4) == 0) 
+		{
+		    _TIFFfree(fld->field_name);
+		    _TIFFfree(fld);
+		}
+	    }   
+	  
+	    _TIFFfree(tif->tif_fieldinfo);
+	}
+
+	_TIFFfree(tif);
+}
+
+/************************************************************************/
+/*                            TIFFClose()                               */
+/************************************************************************/
+
+/**
+ * Close a previously opened TIFF file.
+ *
+ * TIFFClose closes a file that was previously opened with TIFFOpen().
+ * Any buffered data are flushed to the file, including the contents of
+ * the current directory (if modified); and all resources are reclaimed.
+ * 
+ * @param tif A TIFF pointer.
+ */
+
+void
+TIFFClose(TIFF* tif)
+{
+	TIFFCloseProc closeproc = tif->tif_closeproc;
+	thandle_t fd = tif->tif_clientdata;
+
+	TIFFCleanup(tif);
+	(void) (*closeproc)(fd);
+}
+
diff --git a/src/tiff/tif_codec.c b/src/tiff/tif_codec.c
new file mode 100644
index 0000000..a5b718f
--- /dev/null
+++ b/src/tiff/tif_codec.c
@@ -0,0 +1,150 @@
+/* $Id: tif_codec.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library
+ *
+ * Builtin Compression Scheme Configuration Support.
+ */
+#include "tiffiop.h"
+
+static	int NotConfigured(TIFF*, int);
+
+#ifndef	LZW_SUPPORT
+#define	TIFFInitLZW		NotConfigured
+#endif
+#ifndef	PACKBITS_SUPPORT
+#define	TIFFInitPackBits	NotConfigured
+#endif
+#ifndef	THUNDER_SUPPORT
+#define	TIFFInitThunderScan	NotConfigured
+#endif
+#ifndef	NEXT_SUPPORT
+#define	TIFFInitNeXT		NotConfigured
+#endif
+#ifndef	JPEG_SUPPORT
+#define	TIFFInitJPEG		NotConfigured
+#endif
+#ifndef	OJPEG_SUPPORT
+#define	TIFFInitOJPEG		NotConfigured
+#endif
+#ifndef	CCITT_SUPPORT
+#define	TIFFInitCCITTRLE	NotConfigured
+#define	TIFFInitCCITTRLEW	NotConfigured
+#define	TIFFInitCCITTFax3	NotConfigured
+#define	TIFFInitCCITTFax4	NotConfigured
+#endif
+#ifndef JBIG_SUPPORT
+#define	TIFFInitJBIG		NotConfigured
+#endif
+#ifndef	ZIP_SUPPORT
+#define	TIFFInitZIP		NotConfigured
+#endif
+#ifndef	PIXARLOG_SUPPORT
+#define	TIFFInitPixarLog	NotConfigured
+#endif
+#ifndef LOGLUV_SUPPORT
+#define TIFFInitSGILog		NotConfigured
+#endif
+
+/*
+ * Compression schemes statically built into the library.
+ */
+#ifdef VMS
+const TIFFCodec _TIFFBuiltinCODECS[] = {
+#else
+TIFFCodec _TIFFBuiltinCODECS[] = {
+#endif
+    { "None",		COMPRESSION_NONE,	TIFFInitDumpMode },
+    { "LZW",		COMPRESSION_LZW,	TIFFInitLZW },
+    { "PackBits",	COMPRESSION_PACKBITS,	TIFFInitPackBits },
+    { "ThunderScan",	COMPRESSION_THUNDERSCAN,TIFFInitThunderScan },
+    { "NeXT",		COMPRESSION_NEXT,	TIFFInitNeXT },
+    { "JPEG",		COMPRESSION_JPEG,	TIFFInitJPEG },
+    { "Old-style JPEG",	COMPRESSION_OJPEG,	TIFFInitOJPEG },
+    { "CCITT RLE",	COMPRESSION_CCITTRLE,	TIFFInitCCITTRLE },
+    { "CCITT RLE/W",	COMPRESSION_CCITTRLEW,	TIFFInitCCITTRLEW },
+    { "CCITT Group 3",	COMPRESSION_CCITTFAX3,	TIFFInitCCITTFax3 },
+    { "CCITT Group 4",	COMPRESSION_CCITTFAX4,	TIFFInitCCITTFax4 },
+    { "ISO JBIG",	COMPRESSION_JBIG,	TIFFInitJBIG },
+    { "Deflate",	COMPRESSION_DEFLATE,	TIFFInitZIP },
+    { "AdobeDeflate",   COMPRESSION_ADOBE_DEFLATE , TIFFInitZIP }, 
+    { "PixarLog",	COMPRESSION_PIXARLOG,	TIFFInitPixarLog },
+    { "SGILog",		COMPRESSION_SGILOG,	TIFFInitSGILog },
+    { "SGILog24",	COMPRESSION_SGILOG24,	TIFFInitSGILog },
+    { NULL,             0,                      NULL }
+};
+
+static int
+_notConfigured(TIFF* tif)
+{
+	const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
+
+	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+	    "%s compression support is not configured", c->name);
+	return (0);
+}
+
+static int
+NotConfigured(TIFF* tif, int scheme)
+{
+    (void) scheme;
+    
+    tif->tif_decodestatus = FALSE;
+    tif->tif_setupdecode = _notConfigured;
+    tif->tif_encodestatus = FALSE;
+    tif->tif_setupencode = _notConfigured;
+    return (1);
+}
+
+/************************************************************************/
+/*                       TIFFIsCODECConfigured()                        */
+/************************************************************************/
+
+/**
+ * Check whether we have working codec for the specific coding scheme.
+ * 
+ * @return returns 1 if the codec is configured and working. Otherwise
+ * 0 will be returned.
+ */
+
+int
+TIFFIsCODECConfigured(uint16 scheme)
+{
+	const TIFFCodec* codec = TIFFFindCODEC(scheme);
+
+	if(codec == NULL) {
+            return 0;
+        }
+        if(codec->init == NULL) {
+            return 0;
+        }
+	if(codec->init != NotConfigured){
+            return 1;
+        }
+	return 0;
+}
+
diff --git a/src/tiff/tif_color.c b/src/tiff/tif_color.c
new file mode 100644
index 0000000..8aa0bdd
--- /dev/null
+++ b/src/tiff/tif_color.c
@@ -0,0 +1,275 @@
+/* $Id: tif_color.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * CIE L*a*b* to CIE XYZ and CIE XYZ to RGB conversion routines are taken
+ * from the VIPS library (http://www.vips.ecs.soton.ac.uk) with
+ * the permission of John Cupitt, the VIPS author.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Color space conversion routines.
+ */
+
+#include "tiffiop.h"
+#include <math.h>
+
+/*
+ * Convert color value from the CIE L*a*b* 1976 space to CIE XYZ.
+ */
+void
+TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32 l, int32 a, int32 b,
+		float *X, float *Y, float *Z)
+{
+	float L = (float)l * 100.0F / 255.0F;
+	float cby, tmp;
+
+	if( L < 8.856F ) {
+		*Y = (L * cielab->Y0) / 903.292F;
+		cby = 7.787F * (*Y / cielab->Y0) + 16.0F / 116.0F;
+	} else {
+		cby = (L + 16.0F) / 116.0F;
+		*Y = cielab->Y0 * cby * cby * cby;
+	}
+
+	tmp = (float)a / 500.0F + cby;
+	if( tmp < 0.2069F )
+		*X = cielab->X0 * (tmp - 0.13793F) / 7.787F;
+	else    
+		*X = cielab->X0 * tmp * tmp * tmp;
+
+	tmp = cby - (float)b / 200.0F;
+	if( tmp < 0.2069F )
+		*Z = cielab->Z0 * (tmp - 0.13793F) / 7.787F;
+	else    
+		*Z = cielab->Z0 * tmp * tmp * tmp;
+}
+
+#define RINT(R) ((uint32)((R)>0?((R)+0.5):((R)-0.5)))
+/*
+ * Convert color value from the XYZ space to RGB.
+ */
+void
+TIFFXYZToRGB(TIFFCIELabToRGB *cielab, float X, float Y, float Z,
+	     uint32 *r, uint32 *g, uint32 *b)
+{
+	int i;
+	float Yr, Yg, Yb;
+	float *matrix = &cielab->display.d_mat[0][0];
+
+	/* Multiply through the matrix to get luminosity values. */
+	Yr =  matrix[0] * X + matrix[1] * Y + matrix[2] * Z;
+	Yg =  matrix[3] * X + matrix[4] * Y + matrix[5] * Z;
+	Yb =  matrix[6] * X + matrix[7] * Y + matrix[8] * Z;
+
+	/* Clip input */
+	Yr = TIFFmax(Yr, cielab->display.d_Y0R);
+	Yg = TIFFmax(Yg, cielab->display.d_Y0G);
+	Yb = TIFFmax(Yb, cielab->display.d_Y0B);
+
+	/* Avoid overflow in case of wrong input values */
+	Yr = TIFFmin(Yr, cielab->display.d_YCR);
+	Yg = TIFFmin(Yg, cielab->display.d_YCG);
+	Yb = TIFFmin(Yb, cielab->display.d_YCB);
+
+	/* Turn luminosity to colour value. */
+	i = (int)((Yr - cielab->display.d_Y0R) / cielab->rstep);
+	i = TIFFmin(cielab->range, i);
+	*r = RINT(cielab->Yr2r[i]);
+
+	i = (int)((Yg - cielab->display.d_Y0G) / cielab->gstep);
+	i = TIFFmin(cielab->range, i);
+	*g = RINT(cielab->Yg2g[i]);
+
+	i = (int)((Yb - cielab->display.d_Y0B) / cielab->bstep);
+	i = TIFFmin(cielab->range, i);
+	*b = RINT(cielab->Yb2b[i]);
+
+	/* Clip output. */
+	*r = TIFFmin(*r, cielab->display.d_Vrwr);
+	*g = TIFFmin(*g, cielab->display.d_Vrwg);
+	*b = TIFFmin(*b, cielab->display.d_Vrwb);
+}
+#undef RINT
+
+/* 
+ * Allocate conversion state structures and make look_up tables for
+ * the Yr,Yb,Yg <=> r,g,b conversions.
+ */
+int
+TIFFCIELabToRGBInit(TIFFCIELabToRGB* cielab,
+		    TIFFDisplay *display, float *refWhite)
+{
+	int i;
+	double gamma;
+
+	cielab->range = CIELABTORGB_TABLE_RANGE;
+
+	_TIFFmemcpy(&cielab->display, display, sizeof(TIFFDisplay));
+
+	/* Red */
+	gamma = 1.0 / cielab->display.d_gammaR ;
+	cielab->rstep =
+		(cielab->display.d_YCR - cielab->display.d_Y0R)	/ cielab->range;
+	for(i = 0; i <= cielab->range; i++) {
+		cielab->Yr2r[i] = cielab->display.d_Vrwr
+		    * ((float)pow((double)i / cielab->range, gamma));
+	}
+
+	/* Green */
+	gamma = 1.0 / cielab->display.d_gammaG ;
+	cielab->gstep =
+	    (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range;
+	for(i = 0; i <= cielab->range; i++) {
+		cielab->Yg2g[i] = cielab->display.d_Vrwg
+		    * ((float)pow((double)i / cielab->range, gamma));
+	}
+
+	/* Blue */
+	gamma = 1.0 / cielab->display.d_gammaB ;
+	cielab->bstep =
+	    (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range;
+	for(i = 0; i <= cielab->range; i++) {
+		cielab->Yb2b[i] = cielab->display.d_Vrwb
+		    * ((float)pow((double)i / cielab->range, gamma));
+	}
+
+	/* Init reference white point */
+	cielab->X0 = refWhite[0];
+	cielab->Y0 = refWhite[1];
+	cielab->Z0 = refWhite[2];
+
+	return 0;
+}
+
+/* 
+ * Convert color value from the YCbCr space to CIE XYZ.
+ * The colorspace conversion algorithm comes from the IJG v5a code;
+ * see below for more information on how it works.
+ */
+#define	SHIFT			16
+#define	FIX(x)			((int32)((x) * (1L<<SHIFT) + 0.5))
+#define	ONE_HALF		((int32)(1<<(SHIFT-1)))
+#define	Code2V(c, RB, RW, CR)	((((c)-(int32)(RB))*(float)(CR))/(float)(((RW)-(RB)) ? ((RW)-(RB)) : 1))
+#define	CLAMP(f,min,max)	((f)<(min)?(min):(f)>(max)?(max):(f))
+#define HICLAMP(f,max)		((f)>(max)?(max):(f))
+
+void
+TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32 Y, int32 Cb, int32 Cr,
+	       uint32 *r, uint32 *g, uint32 *b)
+{
+	/* XXX: Only 8-bit YCbCr input supported for now */
+	Y = HICLAMP(Y, 255), Cb = CLAMP(Cb, 0, 255), Cr = CLAMP(Cr, 0, 255);
+
+	*r = ycbcr->clamptab[ycbcr->Y_tab[Y] + ycbcr->Cr_r_tab[Cr]];
+	*g = ycbcr->clamptab[ycbcr->Y_tab[Y]
+	    + (int)((ycbcr->Cb_g_tab[Cb] + ycbcr->Cr_g_tab[Cr]) >> SHIFT)];
+	*b = ycbcr->clamptab[ycbcr->Y_tab[Y] + ycbcr->Cb_b_tab[Cb]];
+}
+
+/*
+ * Initialize the YCbCr->RGB conversion tables.  The conversion
+ * is done according to the 6.0 spec:
+ *
+ *    R = Y + Cr*(2 - 2*LumaRed)
+ *    B = Y + Cb*(2 - 2*LumaBlue)
+ *    G =   Y
+ *        - LumaBlue*Cb*(2-2*LumaBlue)/LumaGreen
+ *        - LumaRed*Cr*(2-2*LumaRed)/LumaGreen
+ *
+ * To avoid floating point arithmetic the fractional constants that
+ * come out of the equations are represented as fixed point values
+ * in the range 0...2^16.  We also eliminate multiplications by
+ * pre-calculating possible values indexed by Cb and Cr (this code
+ * assumes conversion is being done for 8-bit samples).
+ */
+int
+TIFFYCbCrToRGBInit(TIFFYCbCrToRGB* ycbcr, float *luma, float *refBlackWhite)
+{
+    TIFFRGBValue* clamptab;
+    int i;
+    
+#define LumaRed	    luma[0]
+#define LumaGreen   luma[1]
+#define LumaBlue    luma[2]
+
+    clamptab = (TIFFRGBValue*)(
+	(tidata_t) ycbcr+TIFFroundup(sizeof (TIFFYCbCrToRGB), sizeof (long)));
+    _TIFFmemset(clamptab, 0, 256);		/* v < 0 => 0 */
+    ycbcr->clamptab = (clamptab += 256);
+    for (i = 0; i < 256; i++)
+	clamptab[i] = (TIFFRGBValue) i;
+    _TIFFmemset(clamptab+256, 255, 2*256);	/* v > 255 => 255 */
+    ycbcr->Cr_r_tab = (int*) (clamptab + 3*256);
+    ycbcr->Cb_b_tab = ycbcr->Cr_r_tab + 256;
+    ycbcr->Cr_g_tab = (int32*) (ycbcr->Cb_b_tab + 256);
+    ycbcr->Cb_g_tab = ycbcr->Cr_g_tab + 256;
+    ycbcr->Y_tab = ycbcr->Cb_g_tab + 256;
+
+    { float f1 = 2-2*LumaRed;		int32 D1 = FIX(f1);
+      float f2 = LumaRed*f1/LumaGreen;	int32 D2 = -FIX(f2);
+      float f3 = 2-2*LumaBlue;		int32 D3 = FIX(f3);
+      float f4 = LumaBlue*f3/LumaGreen;	int32 D4 = -FIX(f4);
+      int x;
+
+#undef LumaBlue
+#undef LumaGreen
+#undef LumaRed
+      
+      /*
+       * i is the actual input pixel value in the range 0..255
+       * Cb and Cr values are in the range -128..127 (actually
+       * they are in a range defined by the ReferenceBlackWhite
+       * tag) so there is some range shifting to do here when
+       * constructing tables indexed by the raw pixel data.
+       */
+      for (i = 0, x = -128; i < 256; i++, x++) {
+	    int32 Cr = (int32)Code2V(x, refBlackWhite[4] - 128.0F,
+			    refBlackWhite[5] - 128.0F, 127);
+	    int32 Cb = (int32)Code2V(x, refBlackWhite[2] - 128.0F,
+			    refBlackWhite[3] - 128.0F, 127);
+
+	    ycbcr->Cr_r_tab[i] = (int32)((D1*Cr + ONE_HALF)>>SHIFT);
+	    ycbcr->Cb_b_tab[i] = (int32)((D3*Cb + ONE_HALF)>>SHIFT);
+	    ycbcr->Cr_g_tab[i] = D2*Cr;
+	    ycbcr->Cb_g_tab[i] = D4*Cb + ONE_HALF;
+	    ycbcr->Y_tab[i] =
+		    (int32)Code2V(x + 128, refBlackWhite[0], refBlackWhite[1], 255);
+      }
+    }
+
+    return 0;
+}
+#undef	HICLAMP
+#undef	CLAMP
+#undef	Code2V
+#undef	SHIFT
+#undef	ONE_HALF
+#undef	FIX
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_compress.c b/src/tiff/tif_compress.c
new file mode 100644
index 0000000..86c300c
--- /dev/null
+++ b/src/tiff/tif_compress.c
@@ -0,0 +1,286 @@
+/* $Id: tif_compress.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library
+ *
+ * Compression Scheme Configuration Support.
+ */
+#include "tiffiop.h"
+
+static int
+TIFFNoEncode(TIFF* tif, const char* method)
+{
+	const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
+
+	if (c) { 
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%s %s encoding is not implemented",
+                          c->name, method);
+	} else { 
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			  "Compression scheme %u %s encoding is not implemented",
+		    tif->tif_dir.td_compression, method);
+	}
+	return (-1);
+}
+
+int
+_TIFFNoRowEncode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s)
+{
+	(void) pp; (void) cc; (void) s;
+	return (TIFFNoEncode(tif, "scanline"));
+}
+
+int
+_TIFFNoStripEncode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s)
+{
+	(void) pp; (void) cc; (void) s;
+	return (TIFFNoEncode(tif, "strip"));
+}
+
+int
+_TIFFNoTileEncode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s)
+{
+	(void) pp; (void) cc; (void) s;
+	return (TIFFNoEncode(tif, "tile"));
+}
+
+static int
+TIFFNoDecode(TIFF* tif, const char* method)
+{
+	const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
+
+	if (c)
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%s %s decoding is not implemented",
+		    c->name, method);
+	else
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "Compression scheme %u %s decoding is not implemented",
+		    tif->tif_dir.td_compression, method);
+	return (-1);
+}
+
+int
+_TIFFNoRowDecode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s)
+{
+	(void) pp; (void) cc; (void) s;
+	return (TIFFNoDecode(tif, "scanline"));
+}
+
+int
+_TIFFNoStripDecode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s)
+{
+	(void) pp; (void) cc; (void) s;
+	return (TIFFNoDecode(tif, "strip"));
+}
+
+int
+_TIFFNoTileDecode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s)
+{
+	(void) pp; (void) cc; (void) s;
+	return (TIFFNoDecode(tif, "tile"));
+}
+
+int
+_TIFFNoSeek(TIFF* tif, uint32 off)
+{
+	(void) off;
+	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+	    "Compression algorithm does not support random access");
+	return (0);
+}
+
+int
+_TIFFNoPreCode(TIFF* tif, tsample_t s)
+{
+	(void) tif; (void) s;
+	return (1);
+}
+
+static int _TIFFtrue(TIFF* tif) { (void) tif; return (1); }
+static void _TIFFvoid(TIFF* tif) { (void) tif; }
+
+void
+_TIFFSetDefaultCompressionState(TIFF* tif)
+{
+	tif->tif_decodestatus = TRUE;
+	tif->tif_setupdecode = _TIFFtrue;
+	tif->tif_predecode = _TIFFNoPreCode;
+	tif->tif_decoderow = _TIFFNoRowDecode;
+	tif->tif_decodestrip = _TIFFNoStripDecode;
+	tif->tif_decodetile = _TIFFNoTileDecode;
+	tif->tif_encodestatus = TRUE;
+	tif->tif_setupencode = _TIFFtrue;
+	tif->tif_preencode = _TIFFNoPreCode;
+	tif->tif_postencode = _TIFFtrue;
+	tif->tif_encoderow = _TIFFNoRowEncode;
+	tif->tif_encodestrip = _TIFFNoStripEncode;
+	tif->tif_encodetile = _TIFFNoTileEncode;
+	tif->tif_close = _TIFFvoid;
+	tif->tif_seek = _TIFFNoSeek;
+	tif->tif_cleanup = _TIFFvoid;
+	tif->tif_defstripsize = _TIFFDefaultStripSize;
+	tif->tif_deftilesize = _TIFFDefaultTileSize;
+	tif->tif_flags &= ~TIFF_NOBITREV;
+}
+
+int
+TIFFSetCompressionScheme(TIFF* tif, int scheme)
+{
+	const TIFFCodec *c = TIFFFindCODEC((uint16) scheme);
+
+	_TIFFSetDefaultCompressionState(tif);
+	/*
+	 * Don't treat an unknown compression scheme as an error.
+	 * This permits applications to open files with data that
+	 * the library does not have builtin support for, but which
+	 * may still be meaningful.
+	 */
+	return (c ? (*c->init)(tif, scheme) : 1);
+}
+
+/*
+ * Other compression schemes may be registered.  Registered
+ * schemes can also override the builtin versions provided
+ * by this library.
+ */
+typedef struct _codec {
+	struct _codec*	next;
+	TIFFCodec*	info;
+} codec_t;
+static	codec_t* registeredCODECS = NULL;
+
+const TIFFCodec*
+TIFFFindCODEC(uint16 scheme)
+{
+	const TIFFCodec* c;
+	codec_t* cd;
+
+	for (cd = registeredCODECS; cd; cd = cd->next)
+		if (cd->info->scheme == scheme)
+			return ((const TIFFCodec*) cd->info);
+	for (c = _TIFFBuiltinCODECS; c->name; c++)
+		if (c->scheme == scheme)
+			return (c);
+	return ((const TIFFCodec*) 0);
+}
+
+TIFFCodec*
+TIFFRegisterCODEC(uint16 scheme, const char* name, TIFFInitMethod init)
+{
+	codec_t* cd = (codec_t*)
+	    _TIFFmalloc(sizeof (codec_t) + sizeof (TIFFCodec) + strlen(name)+1);
+
+	if (cd != NULL) {
+		cd->info = (TIFFCodec*) ((tidata_t) cd + sizeof (codec_t));
+		cd->info->name = (char*)
+		    ((tidata_t) cd->info + sizeof (TIFFCodec));
+		strcpy(cd->info->name, name);
+		cd->info->scheme = scheme;
+		cd->info->init = init;
+		cd->next = registeredCODECS;
+		registeredCODECS = cd;
+	} else {
+		TIFFErrorExt(0, "TIFFRegisterCODEC",
+		    "No space to register compression scheme %s", name);
+		return NULL;
+	}
+	return (cd->info);
+}
+
+void
+TIFFUnRegisterCODEC(TIFFCodec* c)
+{
+	codec_t* cd;
+	codec_t** pcd;
+
+	for (pcd = ®isteredCODECS; (cd = *pcd); pcd = &cd->next)
+		if (cd->info == c) {
+			*pcd = cd->next;
+			_TIFFfree(cd);
+			return;
+		}
+	TIFFErrorExt(0, "TIFFUnRegisterCODEC",
+	    "Cannot remove compression scheme %s; not registered", c->name);
+}
+
+/************************************************************************/
+/*                       TIFFGetConfisuredCODECs()                      */
+/************************************************************************/
+
+/**
+ * Get list of configured codecs, both built-in and registered by user.
+ * Caller is responsible to free this structure.
+ * 
+ * @return returns array of TIFFCodec records (the last record should be NULL)
+ * or NULL if function failed.
+ */
+
+TIFFCodec*
+TIFFGetConfiguredCODECs()
+{
+	int		i = 1;
+        codec_t		*cd;
+        const TIFFCodec	*c;
+	TIFFCodec	*codecs = NULL, *new_codecs;
+
+        for (cd = registeredCODECS; cd; cd = cd->next) {
+                new_codecs = (TIFFCodec *)
+			_TIFFrealloc(codecs, i * sizeof(TIFFCodec));
+		if (!new_codecs) {
+			_TIFFfree (codecs);
+			return NULL;
+		}
+		codecs = new_codecs;
+		_TIFFmemcpy(codecs + i - 1, cd, sizeof(TIFFCodec));
+		i++;
+	}
+        for (c = _TIFFBuiltinCODECS; c->name; c++) {
+                if (TIFFIsCODECConfigured(c->scheme)) {
+                        new_codecs = (TIFFCodec *)
+				_TIFFrealloc(codecs, i * sizeof(TIFFCodec));
+			if (!new_codecs) {
+				_TIFFfree (codecs);
+				return NULL;
+			}
+			codecs = new_codecs;
+			_TIFFmemcpy(codecs + i - 1, (const tdata_t)c, sizeof(TIFFCodec));
+			i++;
+		}
+	}
+
+	new_codecs = (TIFFCodec *) _TIFFrealloc(codecs, i * sizeof(TIFFCodec));
+	if (!new_codecs) {
+		_TIFFfree (codecs);
+		return NULL;
+	}
+	codecs = new_codecs;
+	_TIFFmemset(codecs + i - 1, 0, sizeof(TIFFCodec));
+
+        return codecs;
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_config.h b/src/tiff/tif_config.h
new file mode 100644
index 0000000..39253ca
--- /dev/null
+++ b/src/tiff/tif_config.h
@@ -0,0 +1,45 @@
+/* Define to 1 if you have the <assert.h> header file. */
+#define HAVE_ASSERT_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define as 0 or 1 according to the floating point format suported by the
+   machine */
+#define HAVE_IEEEFP 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <io.h> header file. */
+#define HAVE_IO_H 1
+
+/* Define to 1 if you have the <search.h> header file. */
+#define HAVE_SEARCH_H 1
+
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of a `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* Set the native cpu bit order */
+#define HOST_FILLORDER FILLORDER_LSB2MSB
+
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
+/* #undef WORDS_BIGENDIAN */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+# ifndef inline
+#  define inline __inline
+# endif
+#endif
+
+// Comented due undefined reference to `_lfind' on linux
+//#define lfind _lfind
diff --git a/src/tiff/tif_dir.c b/src/tiff/tif_dir.c
new file mode 100644
index 0000000..2b55d5b
--- /dev/null
+++ b/src/tiff/tif_dir.c
@@ -0,0 +1,1350 @@
+/* $Id: tif_dir.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Directory Tag Get & Set Routines.
+ * (and also some miscellaneous stuff)
+ */
+#include "tiffiop.h"
+
+/*
+ * These are used in the backwards compatibility code...
+ */
+#define DATATYPE_VOID		0       /* !untyped data */
+#define DATATYPE_INT		1       /* !signed integer data */
+#define DATATYPE_UINT		2       /* !unsigned integer data */
+#define DATATYPE_IEEEFP		3       /* !IEEE floating point data */
+
+static void
+setByteArray(void** vpp, void* vp, size_t nmemb, size_t elem_size)
+{
+	if (*vpp)
+		_TIFFfree(*vpp), *vpp = 0;
+	if (vp) {
+		tsize_t	bytes = nmemb * elem_size;
+		if (elem_size && bytes / elem_size == nmemb)
+			*vpp = (void*) _TIFFmalloc(bytes);
+		if (*vpp)
+			_TIFFmemcpy(*vpp, vp, bytes);
+	}
+}
+void _TIFFsetByteArray(void** vpp, void* vp, uint32 n)
+    { setByteArray(vpp, vp, n, 1); }
+void _TIFFsetString(char** cpp, char* cp)
+    { setByteArray((void**) cpp, (void*) cp, strlen(cp)+1, 1); }
+void _TIFFsetNString(char** cpp, char* cp, uint32 n)
+    { setByteArray((void**) cpp, (void*) cp, n, 1); }
+void _TIFFsetShortArray(uint16** wpp, uint16* wp, uint32 n)
+    { setByteArray((void**) wpp, (void*) wp, n, sizeof (uint16)); }
+void _TIFFsetLongArray(uint32** lpp, uint32* lp, uint32 n)
+    { setByteArray((void**) lpp, (void*) lp, n, sizeof (uint32)); }
+void _TIFFsetFloatArray(float** fpp, float* fp, uint32 n)
+    { setByteArray((void**) fpp, (void*) fp, n, sizeof (float)); }
+void _TIFFsetDoubleArray(double** dpp, double* dp, uint32 n)
+    { setByteArray((void**) dpp, (void*) dp, n, sizeof (double)); }
+
+/*
+ * Install extra samples information.
+ */
+static int
+setExtraSamples(TIFFDirectory* td, va_list ap, uint32* v)
+{
+	uint16* va;
+	uint32 i;
+
+	*v = va_arg(ap, uint32);
+	if ((uint16) *v > td->td_samplesperpixel)
+		return (0);
+	va = va_arg(ap, uint16*);
+	if (*v > 0 && va == NULL)		/* typically missing param */
+		return (0);
+	for (i = 0; i < *v; i++)
+		if (va[i] > EXTRASAMPLE_UNASSALPHA)
+			return (0);
+	td->td_extrasamples = (uint16) *v;
+	_TIFFsetShortArray(&td->td_sampleinfo, va, td->td_extrasamples);
+	return (1);
+}
+
+static uint32
+checkInkNamesString(TIFF* tif, uint32 slen, const char* s)
+{
+	TIFFDirectory* td = &tif->tif_dir;
+	uint16 i = td->td_samplesperpixel;
+
+	if (slen > 0) {
+		const char* ep = s+slen;
+		const char* cp = s;
+		for (; i > 0; i--) {
+			for (; *cp != '\0'; cp++)
+				if (cp >= ep)
+					goto bad;
+			cp++;				/* skip \0 */
+		}
+		return (cp-s);
+	}
+bad:
+	TIFFErrorExt(tif->tif_clientdata, "TIFFSetField",
+	    "%s: Invalid InkNames value; expecting %d names, found %d",
+	    tif->tif_name,
+	    td->td_samplesperpixel,
+	    td->td_samplesperpixel-i);
+	return (0);
+}
+
+static int
+_TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	static const char module[] = "_TIFFVSetField";
+	
+	TIFFDirectory* td = &tif->tif_dir;
+	int status = 1;
+	uint32 v32, i, v;
+	char* s;
+
+	switch (tag) {
+	case TIFFTAG_SUBFILETYPE:
+		td->td_subfiletype = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_IMAGEWIDTH:
+		td->td_imagewidth = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_IMAGELENGTH:
+		td->td_imagelength = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_BITSPERSAMPLE:
+		td->td_bitspersample = (uint16) va_arg(ap, int);
+		/*
+		 * If the data require post-decoding processing to byte-swap
+		 * samples, set it up here.  Note that since tags are required
+		 * to be ordered, compression code can override this behaviour
+		 * in the setup method if it wants to roll the post decoding
+		 * work in with its normal work.
+		 */
+		if (tif->tif_flags & TIFF_SWAB) {
+			if (td->td_bitspersample == 16)
+				tif->tif_postdecode = _TIFFSwab16BitData;
+			else if (td->td_bitspersample == 24)
+				tif->tif_postdecode = _TIFFSwab24BitData;
+			else if (td->td_bitspersample == 32)
+				tif->tif_postdecode = _TIFFSwab32BitData;
+			else if (td->td_bitspersample == 64)
+				tif->tif_postdecode = _TIFFSwab64BitData;
+			else if (td->td_bitspersample == 128) /* two 64's */
+				tif->tif_postdecode = _TIFFSwab64BitData;
+		}
+		break;
+	case TIFFTAG_COMPRESSION:
+		v = va_arg(ap, uint32) & 0xffff;
+		/*
+		 * If we're changing the compression scheme, the notify the
+		 * previous module so that it can cleanup any state it's
+		 * setup.
+		 */
+		if (TIFFFieldSet(tif, FIELD_COMPRESSION)) {
+			if (td->td_compression == v)
+				break;
+			(*tif->tif_cleanup)(tif);
+			tif->tif_flags &= ~TIFF_CODERSETUP;
+		}
+		/*
+		 * Setup new compression routine state.
+		 */
+		if( (status = TIFFSetCompressionScheme(tif, v)) != 0 )
+                    td->td_compression = (uint16) v;
+                else
+                    status = 0;
+		break;
+	case TIFFTAG_PHOTOMETRIC:
+		td->td_photometric = (uint16) va_arg(ap, int);
+		break;
+	case TIFFTAG_THRESHHOLDING:
+		td->td_threshholding = (uint16) va_arg(ap, int);
+		break;
+	case TIFFTAG_FILLORDER:
+		v = va_arg(ap, uint32);
+		if (v != FILLORDER_LSB2MSB && v != FILLORDER_MSB2LSB)
+			goto badvalue;
+		td->td_fillorder = (uint16) v;
+		break;
+		break;
+	case TIFFTAG_ORIENTATION:
+		v = va_arg(ap, uint32);
+		if (v < ORIENTATION_TOPLEFT || ORIENTATION_LEFTBOT < v) {
+			TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+			    "Bad value %lu for \"%s\" tag ignored",
+			    v, _TIFFFieldWithTag(tif, tag)->field_name);
+		} else
+			td->td_orientation = (uint16) v;
+		break;
+	case TIFFTAG_SAMPLESPERPIXEL:
+		/* XXX should cross check -- e.g. if pallette, then 1 */
+		v = va_arg(ap, uint32);
+		if (v == 0)
+			goto badvalue;
+		td->td_samplesperpixel = (uint16) v;
+		break;
+	case TIFFTAG_ROWSPERSTRIP:
+		v32 = va_arg(ap, uint32);
+		if (v32 == 0)
+			goto badvalue32;
+		td->td_rowsperstrip = v32;
+		if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS)) {
+			td->td_tilelength = v32;
+			td->td_tilewidth = td->td_imagewidth;
+		}
+		break;
+	case TIFFTAG_MINSAMPLEVALUE:
+		td->td_minsamplevalue = (uint16) va_arg(ap, int);
+		break;
+	case TIFFTAG_MAXSAMPLEVALUE:
+		td->td_maxsamplevalue = (uint16) va_arg(ap, int);
+		break;
+	case TIFFTAG_SMINSAMPLEVALUE:
+		td->td_sminsamplevalue = va_arg(ap, double);
+		break;
+	case TIFFTAG_SMAXSAMPLEVALUE:
+		td->td_smaxsamplevalue = va_arg(ap, double);
+		break;
+	case TIFFTAG_XRESOLUTION:
+		td->td_xresolution = (float) va_arg(ap, double);
+		break;
+	case TIFFTAG_YRESOLUTION:
+		td->td_yresolution = (float) va_arg(ap, double);
+		break;
+	case TIFFTAG_PLANARCONFIG:
+		v = va_arg(ap, uint32);
+		if (v != PLANARCONFIG_CONTIG && v != PLANARCONFIG_SEPARATE)
+			goto badvalue;
+		td->td_planarconfig = (uint16) v;
+		break;
+	case TIFFTAG_XPOSITION:
+		td->td_xposition = (float) va_arg(ap, double);
+		break;
+	case TIFFTAG_YPOSITION:
+		td->td_yposition = (float) va_arg(ap, double);
+		break;
+	case TIFFTAG_RESOLUTIONUNIT:
+		v = va_arg(ap, uint32);
+		if (v < RESUNIT_NONE || RESUNIT_CENTIMETER < v)
+			goto badvalue;
+		td->td_resolutionunit = (uint16) v;
+		break;
+	case TIFFTAG_PAGENUMBER:
+		td->td_pagenumber[0] = (uint16) va_arg(ap, int);
+		td->td_pagenumber[1] = (uint16) va_arg(ap, int);
+		break;
+	case TIFFTAG_HALFTONEHINTS:
+		td->td_halftonehints[0] = (uint16) va_arg(ap, int);
+		td->td_halftonehints[1] = (uint16) va_arg(ap, int);
+		break;
+	case TIFFTAG_COLORMAP:
+		v32 = (uint32)(1L<<td->td_bitspersample);
+		_TIFFsetShortArray(&td->td_colormap[0], va_arg(ap, uint16*), v32);
+		_TIFFsetShortArray(&td->td_colormap[1], va_arg(ap, uint16*), v32);
+		_TIFFsetShortArray(&td->td_colormap[2], va_arg(ap, uint16*), v32);
+		break;
+	case TIFFTAG_EXTRASAMPLES:
+		if (!setExtraSamples(td, ap, &v))
+			goto badvalue;
+		break;
+	case TIFFTAG_MATTEING:
+		td->td_extrasamples = (uint16) (va_arg(ap, int) != 0);
+		if (td->td_extrasamples) {
+			uint16 sv = EXTRASAMPLE_ASSOCALPHA;
+			_TIFFsetShortArray(&td->td_sampleinfo, &sv, 1);
+		}
+		break;
+	case TIFFTAG_TILEWIDTH:
+		v32 = va_arg(ap, uint32);
+		if (v32 % 16) {
+			if (tif->tif_mode != O_RDONLY)
+				goto badvalue32;
+			TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+				"Nonstandard tile width %d, convert file", v32);
+		}
+		td->td_tilewidth = v32;
+		tif->tif_flags |= TIFF_ISTILED;
+		break;
+	case TIFFTAG_TILELENGTH:
+		v32 = va_arg(ap, uint32);
+		if (v32 % 16) {
+			if (tif->tif_mode != O_RDONLY)
+				goto badvalue32;
+			TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+			    "Nonstandard tile length %d, convert file", v32);
+		}
+		td->td_tilelength = v32;
+		tif->tif_flags |= TIFF_ISTILED;
+		break;
+	case TIFFTAG_TILEDEPTH:
+		v32 = va_arg(ap, uint32);
+		if (v32 == 0)
+			goto badvalue32;
+		td->td_tiledepth = v32;
+		break;
+	case TIFFTAG_DATATYPE:
+		v = va_arg(ap, uint32);
+		switch (v) {
+		case DATATYPE_VOID:	v = SAMPLEFORMAT_VOID;	break;
+		case DATATYPE_INT:	v = SAMPLEFORMAT_INT;	break;
+		case DATATYPE_UINT:	v = SAMPLEFORMAT_UINT;	break;
+		case DATATYPE_IEEEFP:	v = SAMPLEFORMAT_IEEEFP;break;
+		default:		goto badvalue;
+		}
+		td->td_sampleformat = (uint16) v;
+		break;
+	case TIFFTAG_SAMPLEFORMAT:
+		v = va_arg(ap, uint32);
+		if (v < SAMPLEFORMAT_UINT || SAMPLEFORMAT_COMPLEXIEEEFP < v)
+			goto badvalue;
+		td->td_sampleformat = (uint16) v;
+
+                /*  Try to fix up the SWAB function for complex data. */
+                if( td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT 
+                    && td->td_bitspersample == 32
+                    && tif->tif_postdecode == _TIFFSwab32BitData )
+                    tif->tif_postdecode = _TIFFSwab16BitData;
+                else if( (td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT 
+                          || td->td_sampleformat == SAMPLEFORMAT_COMPLEXIEEEFP)
+                         && td->td_bitspersample == 64
+                         && tif->tif_postdecode == _TIFFSwab64BitData )
+                    tif->tif_postdecode = _TIFFSwab32BitData;
+		break;
+	case TIFFTAG_IMAGEDEPTH:
+		td->td_imagedepth = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_SUBIFD:
+		if ((tif->tif_flags & TIFF_INSUBIFD) == 0) {
+			td->td_nsubifd = (uint16) va_arg(ap, int);
+			_TIFFsetLongArray(&td->td_subifd, va_arg(ap, uint32*),
+			    (long) td->td_nsubifd);
+		} else {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: Sorry, cannot nest SubIFDs",
+				  tif->tif_name);
+			status = 0;
+		}
+		break;
+	case TIFFTAG_YCBCRPOSITIONING:
+		td->td_ycbcrpositioning = (uint16) va_arg(ap, int);
+		break;
+	case TIFFTAG_YCBCRSUBSAMPLING:
+		td->td_ycbcrsubsampling[0] = (uint16) va_arg(ap, int);
+		td->td_ycbcrsubsampling[1] = (uint16) va_arg(ap, int);
+		break;
+	case TIFFTAG_TRANSFERFUNCTION:
+		v = (td->td_samplesperpixel - td->td_extrasamples) > 1 ? 3 : 1;
+		for (i = 0; i < v; i++)
+			_TIFFsetShortArray(&td->td_transferfunction[i],
+			    va_arg(ap, uint16*), 1L<<td->td_bitspersample);
+		break;
+	case TIFFTAG_INKNAMES:
+		v = va_arg(ap, uint32);
+		s = va_arg(ap, char*);
+		v = checkInkNamesString(tif, v, s);
+                status = v > 0;
+		if( v > 0 ) {
+			_TIFFsetNString(&td->td_inknames, s, v);
+			td->td_inknameslen = v;
+		}
+		break;
+        default: {
+            const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
+            TIFFTagValue *tv;
+            int tv_size, iCustom;
+
+            /*
+	     * This can happen if multiple images are open with different
+	     * codecs which have private tags.  The global tag information
+	     * table may then have tags that are valid for one file but not
+	     * the other. If the client tries to set a tag that is not valid
+	     * for the image's codec then we'll arrive here.  This
+	     * happens, for example, when tiffcp is used to convert between
+	     * compression schemes and codec-specific tags are blindly copied.
+             */
+            if(fip == NULL || fip->field_bit != FIELD_CUSTOM) {
+		TIFFErrorExt(tif->tif_clientdata, module,
+		    "%s: Invalid %stag \"%s\" (not supported by codec)",
+		    tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "",
+		    _TIFFFieldWithTag(tif, tag)->field_name);
+		status = 0;
+		break;
+            }
+
+            /*
+             * Find the existing entry for this custom value.
+             */
+            tv = NULL;
+            for(iCustom = 0; iCustom < td->td_customValueCount; iCustom++) {
+                if(td->td_customValues[iCustom].info == fip) {
+                    tv = td->td_customValues + iCustom;
+                    if(tv->value != NULL)
+                    {
+                        _TIFFfree(tv->value);
+                        tv->value = NULL;
+                    }
+                    break;
+                }
+            }
+
+            /*
+             * Grow the custom list if the entry was not found.
+             */
+            if(tv == NULL) {
+		TIFFTagValue	*new_customValues;
+		
+		td->td_customValueCount++;
+		new_customValues = (TIFFTagValue *)
+			_TIFFrealloc(td->td_customValues,
+				     sizeof(TIFFTagValue) * td->td_customValueCount);
+		if (!new_customValues) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+		"%s: Failed to allocate space for list of custom values",
+				  tif->tif_name);
+			status = 0;
+			goto end;
+		}
+
+		td->td_customValues = new_customValues;
+
+                tv = td->td_customValues + (td->td_customValueCount-1);
+                tv->info = fip;
+                tv->value = NULL;
+                tv->count = 0;
+            }
+
+            /*
+             * Set custom value ... save a copy of the custom tag value.
+             */
+	    tv_size = _TIFFDataSize(fip->field_type);
+	    if (tv_size == 0) {
+		    status = 0;
+		    TIFFErrorExt(tif->tif_clientdata, module,
+				 "%s: Bad field type %d for \"%s\"",
+				 tif->tif_name, fip->field_type,
+				 fip->field_name);
+		    goto end;
+	    }
+           
+            if(fip->field_passcount) {
+		    if (fip->field_writecount == TIFF_VARIABLE2)
+			tv->count = (uint32) va_arg(ap, uint32);
+		    else
+			tv->count = (int) va_arg(ap, int);
+	    } else if (fip->field_writecount == TIFF_VARIABLE
+		       || fip->field_writecount == TIFF_VARIABLE2)
+		tv->count = 1;
+	    else if (fip->field_writecount == TIFF_SPP)
+		tv->count = td->td_samplesperpixel;
+	    else
+                tv->count = fip->field_writecount;
+            
+    
+	    if (fip->field_type == TIFF_ASCII)
+		    _TIFFsetString((char **)&tv->value, va_arg(ap, char *));
+	    else {
+                tv->value = _TIFFmalloc(tv_size * tv->count);
+		if (!tv->value) {
+		    status = 0;
+		    goto end;
+		}
+
+		if ((fip->field_passcount
+		    || fip->field_writecount == TIFF_VARIABLE
+		    || fip->field_writecount == TIFF_VARIABLE2
+		    || fip->field_writecount == TIFF_SPP
+		    || tv->count > 1)
+		    && fip->field_tag != TIFFTAG_PAGENUMBER
+		    && fip->field_tag != TIFFTAG_HALFTONEHINTS
+		    && fip->field_tag != TIFFTAG_YCBCRSUBSAMPLING
+		    && fip->field_tag != TIFFTAG_DOTRANGE) {
+                    _TIFFmemcpy(tv->value, va_arg(ap, void *),
+				tv->count * tv_size);
+		} else {
+		    /*
+		     * XXX: The following loop required to handle
+		     * TIFFTAG_PAGENUMBER, TIFFTAG_HALFTONEHINTS,
+		     * TIFFTAG_YCBCRSUBSAMPLING and TIFFTAG_DOTRANGE tags.
+		     * These tags are actually arrays and should be passed as
+		     * array pointers to TIFFSetField() function, but actually
+		     * passed as a list of separate values. This behaviour
+		     * must be changed in the future!
+		     */
+		    int i;
+		    char *val = (char *)tv->value;
+
+		    for (i = 0; i < tv->count; i++, val += tv_size) {
+			    switch (fip->field_type) {
+				case TIFF_BYTE:
+				case TIFF_UNDEFINED:
+				    {
+					uint8 v = (uint8)va_arg(ap, int);
+					_TIFFmemcpy(val, &v, tv_size);
+				    }
+				    break;
+				case TIFF_SBYTE:
+				    {
+					int8 v = (int8)va_arg(ap, int);
+					_TIFFmemcpy(val, &v, tv_size);
+				    }
+				    break;
+				case TIFF_SHORT:
+				    {
+					uint16 v = (uint16)va_arg(ap, int);
+					_TIFFmemcpy(val, &v, tv_size);
+				    }
+				    break;
+				case TIFF_SSHORT:
+				    {
+					int16 v = (int16)va_arg(ap, int);
+					_TIFFmemcpy(val, &v, tv_size);
+				    }
+				    break;
+				case TIFF_LONG:
+				case TIFF_IFD:
+				    {
+					uint32 v = va_arg(ap, uint32);
+					_TIFFmemcpy(val, &v, tv_size);
+				    }
+				    break;
+				case TIFF_SLONG:
+				    {
+					int32 v = va_arg(ap, int32);
+					_TIFFmemcpy(val, &v, tv_size);
+				    }
+				    break;
+				case TIFF_RATIONAL:
+				case TIFF_SRATIONAL:
+				case TIFF_FLOAT:
+				    {
+					float v = (float)va_arg(ap, double);
+					_TIFFmemcpy(val, &v, tv_size);
+				    }
+				    break;
+				case TIFF_DOUBLE:
+				    {
+					double v = va_arg(ap, double);
+					_TIFFmemcpy(val, &v, tv_size);
+				    }
+				    break;
+				default:
+				    _TIFFmemset(val, 0, tv_size);
+				    status = 0;
+				    break;
+			    }
+		    }
+		}
+	    }
+          }
+	}
+	if (status) {
+		TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit);
+		tif->tif_flags |= TIFF_DIRTYDIRECT;
+	}
+
+end:
+	va_end(ap);
+	return (status);
+badvalue:
+	TIFFErrorExt(tif->tif_clientdata, module, "%s: Bad value %d for \"%s\"",
+		  tif->tif_name, v, _TIFFFieldWithTag(tif, tag)->field_name);
+	va_end(ap);
+	return (0);
+badvalue32:
+	TIFFErrorExt(tif->tif_clientdata, module, "%s: Bad value %ld for \"%s\"",
+		   tif->tif_name, v32, _TIFFFieldWithTag(tif, tag)->field_name);
+	va_end(ap);
+	return (0);
+}
+
+/*
+ * Return 1/0 according to whether or not
+ * it is permissible to set the tag's value.
+ * Note that we allow ImageLength to be changed
+ * so that we can append and extend to images.
+ * Any other tag may not be altered once writing
+ * has commenced, unless its value has no effect
+ * on the format of the data that is written.
+ */
+static int
+OkToChangeTag(TIFF* tif, ttag_t tag)
+{
+	const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
+	if (!fip) {			/* unknown tag */
+		TIFFErrorExt(tif->tif_clientdata, "TIFFSetField", "%s: Unknown %stag %u",
+		    tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", tag);
+		return (0);
+	}
+	if (tag != TIFFTAG_IMAGELENGTH && (tif->tif_flags & TIFF_BEENWRITING) &&
+	    !fip->field_oktochange) {
+		/*
+		 * Consult info table to see if tag can be changed
+		 * after we've started writing.  We only allow changes
+		 * to those tags that don't/shouldn't affect the
+		 * compression and/or format of the data.
+		 */
+		TIFFErrorExt(tif->tif_clientdata, "TIFFSetField",
+		    "%s: Cannot modify tag \"%s\" while writing",
+		    tif->tif_name, fip->field_name);
+		return (0);
+	}
+	return (1);
+}
+
+/*
+ * Record the value of a field in the
+ * internal directory structure.  The
+ * field will be written to the file
+ * when/if the directory structure is
+ * updated.
+ */
+int
+TIFFSetField(TIFF* tif, ttag_t tag, ...)
+{
+	va_list ap;
+	int status;
+
+	va_start(ap, tag);
+	status = TIFFVSetField(tif, tag, ap);
+	va_end(ap);
+	return (status);
+}
+
+/*
+ * Like TIFFSetField, but taking a varargs
+ * parameter list.  This routine is useful
+ * for building higher-level interfaces on
+ * top of the library.
+ */
+int
+TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	return OkToChangeTag(tif, tag) ?
+	    (*tif->tif_tagmethods.vsetfield)(tif, tag, ap) : 0;
+}
+
+static int
+_TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+    TIFFDirectory* td = &tif->tif_dir;
+    int            ret_val = 1;
+
+    switch (tag) {
+	case TIFFTAG_SUBFILETYPE:
+            *va_arg(ap, uint32*) = td->td_subfiletype;
+            break;
+	case TIFFTAG_IMAGEWIDTH:
+            *va_arg(ap, uint32*) = td->td_imagewidth;
+            break;
+	case TIFFTAG_IMAGELENGTH:
+            *va_arg(ap, uint32*) = td->td_imagelength;
+            break;
+	case TIFFTAG_BITSPERSAMPLE:
+            *va_arg(ap, uint16*) = td->td_bitspersample;
+            break;
+	case TIFFTAG_COMPRESSION:
+            *va_arg(ap, uint16*) = td->td_compression;
+            break;
+	case TIFFTAG_PHOTOMETRIC:
+            *va_arg(ap, uint16*) = td->td_photometric;
+            break;
+	case TIFFTAG_THRESHHOLDING:
+            *va_arg(ap, uint16*) = td->td_threshholding;
+            break;
+	case TIFFTAG_FILLORDER:
+            *va_arg(ap, uint16*) = td->td_fillorder;
+            break;
+	case TIFFTAG_ORIENTATION:
+            *va_arg(ap, uint16*) = td->td_orientation;
+            break;
+	case TIFFTAG_SAMPLESPERPIXEL:
+            *va_arg(ap, uint16*) = td->td_samplesperpixel;
+            break;
+	case TIFFTAG_ROWSPERSTRIP:
+            *va_arg(ap, uint32*) = td->td_rowsperstrip;
+            break;
+	case TIFFTAG_MINSAMPLEVALUE:
+            *va_arg(ap, uint16*) = td->td_minsamplevalue;
+            break;
+	case TIFFTAG_MAXSAMPLEVALUE:
+            *va_arg(ap, uint16*) = td->td_maxsamplevalue;
+            break;
+	case TIFFTAG_SMINSAMPLEVALUE:
+            *va_arg(ap, double*) = td->td_sminsamplevalue;
+            break;
+	case TIFFTAG_SMAXSAMPLEVALUE:
+            *va_arg(ap, double*) = td->td_smaxsamplevalue;
+            break;
+	case TIFFTAG_XRESOLUTION:
+            *va_arg(ap, float*) = td->td_xresolution;
+            break;
+	case TIFFTAG_YRESOLUTION:
+            *va_arg(ap, float*) = td->td_yresolution;
+            break;
+	case TIFFTAG_PLANARCONFIG:
+            *va_arg(ap, uint16*) = td->td_planarconfig;
+            break;
+	case TIFFTAG_XPOSITION:
+            *va_arg(ap, float*) = td->td_xposition;
+            break;
+	case TIFFTAG_YPOSITION:
+            *va_arg(ap, float*) = td->td_yposition;
+            break;
+	case TIFFTAG_RESOLUTIONUNIT:
+            *va_arg(ap, uint16*) = td->td_resolutionunit;
+            break;
+	case TIFFTAG_PAGENUMBER:
+            *va_arg(ap, uint16*) = td->td_pagenumber[0];
+            *va_arg(ap, uint16*) = td->td_pagenumber[1];
+            break;
+	case TIFFTAG_HALFTONEHINTS:
+            *va_arg(ap, uint16*) = td->td_halftonehints[0];
+            *va_arg(ap, uint16*) = td->td_halftonehints[1];
+            break;
+	case TIFFTAG_COLORMAP:
+            *va_arg(ap, uint16**) = td->td_colormap[0];
+            *va_arg(ap, uint16**) = td->td_colormap[1];
+            *va_arg(ap, uint16**) = td->td_colormap[2];
+            break;
+	case TIFFTAG_STRIPOFFSETS:
+	case TIFFTAG_TILEOFFSETS:
+            *va_arg(ap, uint32**) = td->td_stripoffset;
+            break;
+	case TIFFTAG_STRIPBYTECOUNTS:
+	case TIFFTAG_TILEBYTECOUNTS:
+            *va_arg(ap, uint32**) = td->td_stripbytecount;
+            break;
+	case TIFFTAG_MATTEING:
+            *va_arg(ap, uint16*) =
+                (td->td_extrasamples == 1 &&
+                 td->td_sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA);
+            break;
+	case TIFFTAG_EXTRASAMPLES:
+            *va_arg(ap, uint16*) = td->td_extrasamples;
+            *va_arg(ap, uint16**) = td->td_sampleinfo;
+            break;
+	case TIFFTAG_TILEWIDTH:
+            *va_arg(ap, uint32*) = td->td_tilewidth;
+            break;
+	case TIFFTAG_TILELENGTH:
+            *va_arg(ap, uint32*) = td->td_tilelength;
+            break;
+	case TIFFTAG_TILEDEPTH:
+            *va_arg(ap, uint32*) = td->td_tiledepth;
+            break;
+	case TIFFTAG_DATATYPE:
+            switch (td->td_sampleformat) {
+		case SAMPLEFORMAT_UINT:
+                    *va_arg(ap, uint16*) = DATATYPE_UINT;
+                    break;
+		case SAMPLEFORMAT_INT:
+                    *va_arg(ap, uint16*) = DATATYPE_INT;
+                    break;
+		case SAMPLEFORMAT_IEEEFP:
+                    *va_arg(ap, uint16*) = DATATYPE_IEEEFP;
+                    break;
+		case SAMPLEFORMAT_VOID:
+                    *va_arg(ap, uint16*) = DATATYPE_VOID;
+                    break;
+            }
+            break;
+	case TIFFTAG_SAMPLEFORMAT:
+            *va_arg(ap, uint16*) = td->td_sampleformat;
+            break;
+	case TIFFTAG_IMAGEDEPTH:
+            *va_arg(ap, uint32*) = td->td_imagedepth;
+            break;
+	case TIFFTAG_SUBIFD:
+            *va_arg(ap, uint16*) = td->td_nsubifd;
+            *va_arg(ap, uint32**) = td->td_subifd;
+            break;
+	case TIFFTAG_YCBCRPOSITIONING:
+            *va_arg(ap, uint16*) = td->td_ycbcrpositioning;
+            break;
+	case TIFFTAG_YCBCRSUBSAMPLING:
+            *va_arg(ap, uint16*) = td->td_ycbcrsubsampling[0];
+            *va_arg(ap, uint16*) = td->td_ycbcrsubsampling[1];
+            break;
+	case TIFFTAG_TRANSFERFUNCTION:
+            *va_arg(ap, uint16**) = td->td_transferfunction[0];
+            if (td->td_samplesperpixel - td->td_extrasamples > 1) {
+                *va_arg(ap, uint16**) = td->td_transferfunction[1];
+                *va_arg(ap, uint16**) = td->td_transferfunction[2];
+            }
+            break;
+	case TIFFTAG_INKNAMES:
+            *va_arg(ap, char**) = td->td_inknames;
+            break;
+        default:
+        {
+            const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
+            int           i;
+            
+            /*
+             * This can happen if multiple images are open with
+             * different codecs which have private tags.  The
+             * global tag information table may then have tags
+             * that are valid for one file but not the other. 
+             * If the client tries to get a tag that is not valid
+             * for the image's codec then we'll arrive here.
+             */
+            if( fip == NULL || fip->field_bit != FIELD_CUSTOM )
+            {
+				TIFFErrorExt(tif->tif_clientdata, "_TIFFVGetField",
+                          "%s: Invalid %stag \"%s\" (not supported by codec)",
+                          tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "",
+                          _TIFFFieldWithTag(tif, tag)->field_name);
+                ret_val = 0;
+                break;
+            }
+
+            /*
+	     * Do we have a custom value?
+	     */
+            ret_val = 0;
+            for (i = 0; i < td->td_customValueCount; i++) {
+		TIFFTagValue *tv = td->td_customValues + i;
+
+		if (tv->info->field_tag != tag)
+			continue;
+                
+		if (fip->field_passcount) {
+			if (fip->field_readcount == TIFF_VARIABLE2) 
+				*va_arg(ap, uint32*) = (uint32)tv->count;
+			else	/* Assume TIFF_VARIABLE */
+				*va_arg(ap, uint16*) = (uint16)tv->count;
+			*va_arg(ap, void **) = tv->value;
+			ret_val = 1;
+                } else {
+			if ((fip->field_type == TIFF_ASCII
+			    || fip->field_readcount == TIFF_VARIABLE
+			    || fip->field_readcount == TIFF_VARIABLE2
+			    || fip->field_readcount == TIFF_SPP
+			    || tv->count > 1)
+			    && fip->field_tag != TIFFTAG_PAGENUMBER
+			    && fip->field_tag != TIFFTAG_HALFTONEHINTS
+			    && fip->field_tag != TIFFTAG_YCBCRSUBSAMPLING
+			    && fip->field_tag != TIFFTAG_DOTRANGE) {
+				*va_arg(ap, void **) = tv->value;
+				ret_val = 1;
+			} else {
+			    int j;
+			    char *val = (char *)tv->value;
+
+			    for (j = 0; j < tv->count;
+				 j++, val += _TIFFDataSize(tv->info->field_type)) {
+				switch (fip->field_type) {
+					case TIFF_BYTE:
+					case TIFF_UNDEFINED:
+						*va_arg(ap, uint8*) =
+							*(uint8 *)val;
+						ret_val = 1;
+						break;
+					case TIFF_SBYTE:
+						*va_arg(ap, int8*) =
+							*(int8 *)val;
+						ret_val = 1;
+						break;
+					case TIFF_SHORT:
+						*va_arg(ap, uint16*) =
+							*(uint16 *)val;
+						ret_val = 1;
+						break;
+					case TIFF_SSHORT:
+						*va_arg(ap, int16*) =
+							*(int16 *)val;
+						ret_val = 1;
+						break;
+					case TIFF_LONG:
+					case TIFF_IFD:
+						*va_arg(ap, uint32*) =
+							*(uint32 *)val;
+						ret_val = 1;
+						break;
+					case TIFF_SLONG:
+						*va_arg(ap, int32*) =
+							*(int32 *)val;
+						ret_val = 1;
+						break;
+					case TIFF_RATIONAL:
+					case TIFF_SRATIONAL:
+					case TIFF_FLOAT:
+						*va_arg(ap, float*) =
+							*(float *)val;
+						ret_val = 1;
+						break;
+					case TIFF_DOUBLE:
+						*va_arg(ap, double*) =
+							*(double *)val;
+						ret_val = 1;
+						break;
+					default:
+						ret_val = 0;
+						break;
+				}
+			    }
+			}
+                }
+		break;
+            }
+        }
+    }
+    return(ret_val);
+}
+
+/*
+ * Return the value of a field in the
+ * internal directory structure.
+ */
+int
+TIFFGetField(TIFF* tif, ttag_t tag, ...)
+{
+	int status;
+	va_list ap;
+
+	va_start(ap, tag);
+	status = TIFFVGetField(tif, tag, ap);
+	va_end(ap);
+	return (status);
+}
+
+/*
+ * Like TIFFGetField, but taking a varargs
+ * parameter list.  This routine is useful
+ * for building higher-level interfaces on
+ * top of the library.
+ */
+int
+TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
+	return (fip && (isPseudoTag(tag) || TIFFFieldSet(tif, fip->field_bit)) ?
+	    (*tif->tif_tagmethods.vgetfield)(tif, tag, ap) : 0);
+}
+
+#define	CleanupField(member) {		\
+    if (td->member) {			\
+	_TIFFfree(td->member);		\
+	td->member = 0;			\
+    }					\
+}
+
+/*
+ * Release storage associated with a directory.
+ */
+void
+TIFFFreeDirectory(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	int            i;
+
+	_TIFFmemset(td->td_fieldsset, 0, FIELD_SETLONGS);
+	CleanupField(td_colormap[0]);
+	CleanupField(td_colormap[1]);
+	CleanupField(td_colormap[2]);
+	CleanupField(td_sampleinfo);
+	CleanupField(td_subifd);
+	CleanupField(td_inknames);
+	CleanupField(td_transferfunction[0]);
+	CleanupField(td_transferfunction[1]);
+	CleanupField(td_transferfunction[2]);
+	CleanupField(td_stripoffset);
+	CleanupField(td_stripbytecount);
+	TIFFClrFieldBit(tif, FIELD_YCBCRSUBSAMPLING);
+	TIFFClrFieldBit(tif, FIELD_YCBCRPOSITIONING);
+
+	/* Cleanup custom tag values */
+	for( i = 0; i < td->td_customValueCount; i++ ) {
+		if (td->td_customValues[i].value)
+			_TIFFfree(td->td_customValues[i].value);
+	}
+
+	td->td_customValueCount = 0;
+	CleanupField(td_customValues);
+}
+#undef CleanupField
+
+/*
+ * Client Tag extension support (from Niles Ritter).
+ */
+static TIFFExtendProc _TIFFextender = (TIFFExtendProc) NULL;
+
+TIFFExtendProc
+TIFFSetTagExtender(TIFFExtendProc extender)
+{
+	TIFFExtendProc prev = _TIFFextender;
+	_TIFFextender = extender;
+	return (prev);
+}
+
+/*
+ * Setup for a new directory.  Should we automatically call
+ * TIFFWriteDirectory() if the current one is dirty?
+ *
+ * The newly created directory will not exist on the file till
+ * TIFFWriteDirectory(), TIFFFlush() or TIFFClose() is called.
+ */
+int
+TIFFCreateDirectory(TIFF* tif)
+{
+    TIFFDefaultDirectory(tif);
+    tif->tif_diroff = 0;
+    tif->tif_nextdiroff = 0;
+    tif->tif_curoff = 0;
+    tif->tif_row = (uint32) -1;
+    tif->tif_curstrip = (tstrip_t) -1;
+
+    return 0;
+}
+
+/*
+ * Setup a default directory structure.
+ */
+int
+TIFFDefaultDirectory(TIFF* tif)
+{
+	register TIFFDirectory* td = &tif->tif_dir;
+
+	size_t tiffFieldInfoCount;
+	const TIFFFieldInfo *tiffFieldInfo =
+		_TIFFGetFieldInfo(&tiffFieldInfoCount);
+	_TIFFSetupFieldInfo(tif, tiffFieldInfo, tiffFieldInfoCount);
+
+	_TIFFmemset(td, 0, sizeof (*td));
+	td->td_fillorder = FILLORDER_MSB2LSB;
+	td->td_bitspersample = 1;
+	td->td_threshholding = THRESHHOLD_BILEVEL;
+	td->td_orientation = ORIENTATION_TOPLEFT;
+	td->td_samplesperpixel = 1;
+	td->td_rowsperstrip = (uint32) -1;
+	td->td_tilewidth = 0;
+	td->td_tilelength = 0;
+	td->td_tiledepth = 1;
+	td->td_stripbytecountsorted = 1; /* Our own arrays always sorted. */
+	td->td_resolutionunit = RESUNIT_INCH;
+	td->td_sampleformat = SAMPLEFORMAT_UINT;
+	td->td_imagedepth = 1;
+	td->td_ycbcrsubsampling[0] = 2;
+	td->td_ycbcrsubsampling[1] = 2;
+	td->td_ycbcrpositioning = YCBCRPOSITION_CENTERED;
+	tif->tif_postdecode = _TIFFNoPostDecode;
+        tif->tif_foundfield = NULL;
+	tif->tif_tagmethods.vsetfield = _TIFFVSetField;
+	tif->tif_tagmethods.vgetfield = _TIFFVGetField;
+	tif->tif_tagmethods.printdir = NULL;
+	/*
+	 *  Give client code a chance to install their own
+	 *  tag extensions & methods, prior to compression overloads.
+	 */
+	if (_TIFFextender)
+		(*_TIFFextender)(tif);
+	(void) TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+	/*
+	 * NB: The directory is marked dirty as a result of setting
+	 * up the default compression scheme.  However, this really
+	 * isn't correct -- we want TIFF_DIRTYDIRECT to be set only
+	 * if the user does something.  We could just do the setup
+	 * by hand, but it seems better to use the normal mechanism
+	 * (i.e. TIFFSetField).
+	 */
+	tif->tif_flags &= ~TIFF_DIRTYDIRECT;
+
+        /*
+         * As per http://bugzilla.remotesensing.org/show_bug.cgi?id=19
+         * we clear the ISTILED flag when setting up a new directory.
+         * Should we also be clearing stuff like INSUBIFD?
+         */
+        tif->tif_flags &= ~TIFF_ISTILED;
+
+	return (1);
+}
+
+static int
+TIFFAdvanceDirectory(TIFF* tif, uint32* nextdir, toff_t* off)
+{
+    static const char module[] = "TIFFAdvanceDirectory";
+    uint16 dircount;
+    if (isMapped(tif))
+    {
+        toff_t poff=*nextdir;
+        if (poff+sizeof(uint16) > tif->tif_size)
+        {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory count",
+                      tif->tif_name);
+            return (0);
+        }
+        _TIFFmemcpy(&dircount, tif->tif_base+poff, sizeof (uint16));
+        if (tif->tif_flags & TIFF_SWAB)
+            TIFFSwabShort(&dircount);
+        poff+=sizeof (uint16)+dircount*sizeof (TIFFDirEntry);
+        if (off != NULL)
+            *off = poff;
+        if (((toff_t) (poff+sizeof (uint32))) > tif->tif_size)
+        {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory link",
+                      tif->tif_name);
+            return (0);
+        }
+        _TIFFmemcpy(nextdir, tif->tif_base+poff, sizeof (uint32));
+        if (tif->tif_flags & TIFF_SWAB)
+            TIFFSwabLong(nextdir);
+        return (1);
+    }
+    else
+    {
+        if (!SeekOK(tif, *nextdir) ||
+            !ReadOK(tif, &dircount, sizeof (uint16))) {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory count",
+                      tif->tif_name);
+            return (0);
+        }
+        if (tif->tif_flags & TIFF_SWAB)
+            TIFFSwabShort(&dircount);
+        if (off != NULL)
+            *off = TIFFSeekFile(tif,
+                                dircount*sizeof (TIFFDirEntry), SEEK_CUR);
+        else
+            (void) TIFFSeekFile(tif,
+                                dircount*sizeof (TIFFDirEntry), SEEK_CUR);
+        if (!ReadOK(tif, nextdir, sizeof (uint32))) {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory link",
+                      tif->tif_name);
+            return (0);
+        }
+        if (tif->tif_flags & TIFF_SWAB)
+            TIFFSwabLong(nextdir);
+        return (1);
+    }
+}
+
+/*
+ * Count the number of directories in a file.
+ */
+tdir_t
+TIFFNumberOfDirectories(TIFF* tif)
+{
+    toff_t nextdir = tif->tif_header.tiff_diroff;
+    tdir_t n = 0;
+    
+    while (nextdir != 0 && TIFFAdvanceDirectory(tif, &nextdir, NULL))
+        n++;
+    return (n);
+}
+
+/*
+ * Set the n-th directory as the current directory.
+ * NB: Directories are numbered starting at 0.
+ */
+int
+TIFFSetDirectory(TIFF* tif, tdir_t dirn)
+{
+	toff_t nextdir;
+	tdir_t n;
+
+	nextdir = tif->tif_header.tiff_diroff;
+	for (n = dirn; n > 0 && nextdir != 0; n--)
+		if (!TIFFAdvanceDirectory(tif, &nextdir, NULL))
+			return (0);
+	tif->tif_nextdiroff = nextdir;
+	/*
+	 * Set curdir to the actual directory index.  The
+	 * -1 is because TIFFReadDirectory will increment
+	 * tif_curdir after successfully reading the directory.
+	 */
+	tif->tif_curdir = (dirn - n) - 1;
+	/*
+	 * Reset tif_dirnumber counter and start new list of seen directories.
+	 * We need this to prevent IFD loops.
+	 */
+	tif->tif_dirnumber = 0;
+	return (TIFFReadDirectory(tif));
+}
+
+/*
+ * Set the current directory to be the directory
+ * located at the specified file offset.  This interface
+ * is used mainly to access directories linked with
+ * the SubIFD tag (e.g. thumbnail images).
+ */
+int
+TIFFSetSubDirectory(TIFF* tif, uint32 diroff)
+{
+	tif->tif_nextdiroff = diroff;
+	/*
+	 * Reset tif_dirnumber counter and start new list of seen directories.
+	 * We need this to prevent IFD loops.
+	 */
+	tif->tif_dirnumber = 0;
+	return (TIFFReadDirectory(tif));
+}
+
+/*
+ * Return file offset of the current directory.
+ */
+uint32
+TIFFCurrentDirOffset(TIFF* tif)
+{
+	return (tif->tif_diroff);
+}
+
+/*
+ * Return an indication of whether or not we are
+ * at the last directory in the file.
+ */
+int
+TIFFLastDirectory(TIFF* tif)
+{
+	return (tif->tif_nextdiroff == 0);
+}
+
+/*
+ * Unlink the specified directory from the directory chain.
+ */
+int
+TIFFUnlinkDirectory(TIFF* tif, tdir_t dirn)
+{
+	static const char module[] = "TIFFUnlinkDirectory";
+	toff_t nextdir;
+	toff_t off;
+	tdir_t n;
+
+	if (tif->tif_mode == O_RDONLY) {
+		TIFFErrorExt(tif->tif_clientdata, module,
+                             "Can not unlink directory in read-only file");
+		return (0);
+	}
+	/*
+	 * Go to the directory before the one we want
+	 * to unlink and nab the offset of the link
+	 * field we'll need to patch.
+	 */
+	nextdir = tif->tif_header.tiff_diroff;
+	off = sizeof (uint16) + sizeof (uint16);
+	for (n = dirn-1; n > 0; n--) {
+		if (nextdir == 0) {
+			TIFFErrorExt(tif->tif_clientdata, module, "Directory %d does not exist", dirn);
+			return (0);
+		}
+		if (!TIFFAdvanceDirectory(tif, &nextdir, &off))
+			return (0);
+	}
+	/*
+	 * Advance to the directory to be unlinked and fetch
+	 * the offset of the directory that follows.
+	 */
+	if (!TIFFAdvanceDirectory(tif, &nextdir, NULL))
+		return (0);
+	/*
+	 * Go back and patch the link field of the preceding
+	 * directory to point to the offset of the directory
+	 * that follows.
+	 */
+	(void) TIFFSeekFile(tif, off, SEEK_SET);
+	if (tif->tif_flags & TIFF_SWAB)
+		TIFFSwabLong(&nextdir);
+	if (!WriteOK(tif, &nextdir, sizeof (uint32))) {
+		TIFFErrorExt(tif->tif_clientdata, module, "Error writing directory link");
+		return (0);
+	}
+	/*
+	 * Leave directory state setup safely.  We don't have
+	 * facilities for doing inserting and removing directories,
+	 * so it's safest to just invalidate everything.  This
+	 * means that the caller can only append to the directory
+	 * chain.
+	 */
+	(*tif->tif_cleanup)(tif);
+	if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) {
+		_TIFFfree(tif->tif_rawdata);
+		tif->tif_rawdata = NULL;
+		tif->tif_rawcc = 0;
+	}
+	tif->tif_flags &= ~(TIFF_BEENWRITING|TIFF_BUFFERSETUP|TIFF_POSTENCODE);
+	TIFFFreeDirectory(tif);
+	TIFFDefaultDirectory(tif);
+	tif->tif_diroff = 0;			/* force link on next write */
+	tif->tif_nextdiroff = 0;		/* next write must be at end */
+	tif->tif_curoff = 0;
+	tif->tif_row = (uint32) -1;
+	tif->tif_curstrip = (tstrip_t) -1;
+	return (1);
+}
+
+/*			[BFC]
+ *
+ * Author: Bruce Cameron <cameron at petris.com>
+ *
+ * Set a table of tags that are to be replaced during directory process by the
+ * 'IGNORE' state - or return TRUE/FALSE for the requested tag such that
+ * 'ReadDirectory' can use the stored information.
+ *
+ * FIXME: this is never used properly. Should be removed in the future.
+ */
+int
+TIFFReassignTagToIgnore (enum TIFFIgnoreSense task, int TIFFtagID)
+{
+    static int TIFFignoretags [FIELD_LAST];
+    static int tagcount = 0 ;
+    int		i;					/* Loop index */
+    int		j;					/* Loop index */
+
+    switch (task)
+    {
+      case TIS_STORE:
+        if ( tagcount < (FIELD_LAST - 1) )
+        {
+            for ( j = 0 ; j < tagcount ; ++j )
+            {					/* Do not add duplicate tag */
+                if ( TIFFignoretags [j] == TIFFtagID )
+                    return (TRUE) ;
+            }
+            TIFFignoretags [tagcount++] = TIFFtagID ;
+            return (TRUE) ;
+        }
+        break ;
+        
+      case TIS_EXTRACT:
+        for ( i = 0 ; i < tagcount ; ++i )
+        {
+            if ( TIFFignoretags [i] == TIFFtagID )
+                return (TRUE) ;
+        }
+        break;
+        
+      case TIS_EMPTY:
+        tagcount = 0 ;			/* Clear the list */
+        return (TRUE) ;
+        
+      default:
+        break;
+    }
+    
+    return (FALSE);
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_dir.h b/src/tiff/tif_dir.h
new file mode 100644
index 0000000..1be56ec
--- /dev/null
+++ b/src/tiff/tif_dir.h
@@ -0,0 +1,199 @@
+/* $Id: tif_dir.h 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _TIFFDIR_
+#define	_TIFFDIR_
+/*
+ * ``Library-private'' Directory-related Definitions.
+ */
+
+/*
+ * Internal format of a TIFF directory entry.
+ */
+typedef	struct {
+#define	FIELD_SETLONGS	4
+	/* bit vector of fields that are set */
+	unsigned long	td_fieldsset[FIELD_SETLONGS];
+
+	uint32	td_imagewidth, td_imagelength, td_imagedepth;
+	uint32	td_tilewidth, td_tilelength, td_tiledepth;
+	uint32	td_subfiletype;
+	uint16	td_bitspersample;
+	uint16	td_sampleformat;
+	uint16	td_compression;
+	uint16	td_photometric;
+	uint16	td_threshholding;
+	uint16	td_fillorder;
+	uint16	td_orientation;
+	uint16	td_samplesperpixel;
+	uint32	td_rowsperstrip;
+	uint16	td_minsamplevalue, td_maxsamplevalue;
+	double	td_sminsamplevalue, td_smaxsamplevalue;
+	float	td_xresolution, td_yresolution;
+	uint16	td_resolutionunit;
+	uint16	td_planarconfig;
+	float	td_xposition, td_yposition;
+	uint16	td_pagenumber[2];
+	uint16*	td_colormap[3];
+	uint16	td_halftonehints[2];
+	uint16	td_extrasamples;
+	uint16*	td_sampleinfo;
+	tstrip_t td_stripsperimage;
+	tstrip_t td_nstrips;		/* size of offset & bytecount arrays */
+	uint32*	td_stripoffset;
+	uint32*	td_stripbytecount;
+	int	td_stripbytecountsorted; /* is the bytecount array sorted ascending? */
+	uint16	td_nsubifd;
+	uint32*	td_subifd;
+	/* YCbCr parameters */
+	uint16	td_ycbcrsubsampling[2];
+	uint16	td_ycbcrpositioning;
+	/* Colorimetry parameters */
+	uint16*	td_transferfunction[3];
+	/* CMYK parameters */
+	int	td_inknameslen;
+	char*	td_inknames;
+
+	int     td_customValueCount;
+        TIFFTagValue *td_customValues;
+} TIFFDirectory;
+
+/*
+ * Field flags used to indicate fields that have
+ * been set in a directory, and to reference fields
+ * when manipulating a directory.
+ */
+
+/*
+ * FIELD_IGNORE is used to signify tags that are to
+ * be processed but otherwise ignored.  This permits
+ * antiquated tags to be quietly read and discarded.
+ * Note that a bit *is* allocated for ignored tags;
+ * this is understood by the directory reading logic
+ * which uses this fact to avoid special-case handling
+ */ 
+#define	FIELD_IGNORE			0
+
+/* multi-item fields */
+#define	FIELD_IMAGEDIMENSIONS		1
+#define FIELD_TILEDIMENSIONS		2
+#define	FIELD_RESOLUTION		3
+#define	FIELD_POSITION			4
+
+/* single-item fields */
+#define	FIELD_SUBFILETYPE		5
+#define	FIELD_BITSPERSAMPLE		6
+#define	FIELD_COMPRESSION		7
+#define	FIELD_PHOTOMETRIC		8
+#define	FIELD_THRESHHOLDING		9
+#define	FIELD_FILLORDER			10
+#define	FIELD_ORIENTATION		15
+#define	FIELD_SAMPLESPERPIXEL		16
+#define	FIELD_ROWSPERSTRIP		17
+#define	FIELD_MINSAMPLEVALUE		18
+#define	FIELD_MAXSAMPLEVALUE		19
+#define	FIELD_PLANARCONFIG		20
+#define	FIELD_RESOLUTIONUNIT		22
+#define	FIELD_PAGENUMBER		23
+#define	FIELD_STRIPBYTECOUNTS		24
+#define	FIELD_STRIPOFFSETS		25
+#define	FIELD_COLORMAP			26
+#define	FIELD_EXTRASAMPLES		31
+#define FIELD_SAMPLEFORMAT		32
+#define	FIELD_SMINSAMPLEVALUE		33
+#define	FIELD_SMAXSAMPLEVALUE		34
+#define FIELD_IMAGEDEPTH		35
+#define FIELD_TILEDEPTH			36
+#define	FIELD_HALFTONEHINTS		37
+#define FIELD_YCBCRSUBSAMPLING		39
+#define FIELD_YCBCRPOSITIONING		40
+#define	FIELD_TRANSFERFUNCTION		44
+#define	FIELD_INKNAMES			46
+#define	FIELD_SUBIFD			49
+/*      FIELD_CUSTOM (see tiffio.h)     65 */
+/* end of support for well-known tags; codec-private tags follow */
+#define	FIELD_CODEC			66	/* base of codec-private tags */
+
+
+/*
+ * Pseudo-tags don't normally need field bits since they
+ * are not written to an output file (by definition).
+ * The library also has express logic to always query a
+ * codec for a pseudo-tag so allocating a field bit for
+ * one is a waste.   If codec wants to promote the notion
+ * of a pseudo-tag being ``set'' or ``unset'' then it can
+ * do using internal state flags without polluting the
+ * field bit space defined for real tags.
+ */
+#define	FIELD_PSEUDO			0
+
+#define	FIELD_LAST			(32*FIELD_SETLONGS-1)
+
+#define	TIFFExtractData(tif, type, v) \
+    ((uint32) ((tif)->tif_header.tiff_magic == TIFF_BIGENDIAN ? \
+        ((v) >> (tif)->tif_typeshift[type]) & (tif)->tif_typemask[type] : \
+	(v) & (tif)->tif_typemask[type]))
+#define	TIFFInsertData(tif, type, v) \
+    ((uint32) ((tif)->tif_header.tiff_magic == TIFF_BIGENDIAN ? \
+        ((v) & (tif)->tif_typemask[type]) << (tif)->tif_typeshift[type] : \
+	(v) & (tif)->tif_typemask[type]))
+
+
+#define BITn(n)				(((unsigned long)1L)<<((n)&0x1f)) 
+#define BITFIELDn(tif, n)		((tif)->tif_dir.td_fieldsset[(n)/32]) 
+#define TIFFFieldSet(tif, field)	(BITFIELDn(tif, field) & BITn(field)) 
+#define TIFFSetFieldBit(tif, field)	(BITFIELDn(tif, field) |= BITn(field))
+#define TIFFClrFieldBit(tif, field)	(BITFIELDn(tif, field) &= ~BITn(field))
+
+#define	FieldSet(fields, f)		(fields[(f)/32] & BITn(f))
+#define	ResetFieldBit(fields, f)	(fields[(f)/32] &= ~BITn(f))
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+extern	const TIFFFieldInfo *_TIFFGetFieldInfo(size_t *);
+extern	const TIFFFieldInfo *_TIFFGetExifFieldInfo(size_t *);
+extern	void _TIFFSetupFieldInfo(TIFF*, const TIFFFieldInfo[], size_t);
+extern	void _TIFFPrintFieldInfo(TIFF*, FILE*);
+extern	TIFFDataType _TIFFSampleToTagType(TIFF*);
+extern  const TIFFFieldInfo* _TIFFFindOrRegisterFieldInfo( TIFF *tif,
+							   ttag_t tag,
+							   TIFFDataType dt );
+extern  TIFFFieldInfo* _TIFFCreateAnonFieldInfo( TIFF *tif, ttag_t tag,
+                                                 TIFFDataType dt );
+
+#define _TIFFMergeFieldInfo	    TIFFMergeFieldInfo
+#define _TIFFFindFieldInfo	    TIFFFindFieldInfo
+#define _TIFFFindFieldInfoByName    TIFFFindFieldInfoByName
+#define _TIFFFieldWithTag	    TIFFFieldWithTag
+#define _TIFFFieldWithName	    TIFFFieldWithName
+
+#if defined(__cplusplus)
+}
+#endif
+#endif /* _TIFFDIR_ */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_dirinfo.c b/src/tiff/tif_dirinfo.c
new file mode 100644
index 0000000..4c940e8
--- /dev/null
+++ b/src/tiff/tif_dirinfo.c
@@ -0,0 +1,846 @@
+/* $Id: tif_dirinfo.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Core Directory Tag Support.
+ */
+#include "tiffiop.h"
+#include <stdlib.h>
+
+/*
+ * NB: NB: THIS ARRAY IS ASSUMED TO BE SORTED BY TAG.
+ *       If a tag can have both LONG and SHORT types then the LONG must be
+ *       placed before the SHORT for writing to work properly.
+ *
+ * NOTE: The second field (field_readcount) and third field (field_writecount)
+ *       sometimes use the values TIFF_VARIABLE (-1), TIFF_VARIABLE2 (-3)
+ *       and TIFFTAG_SPP (-2). The macros should be used but would throw off 
+ *       the formatting of the code, so please interprete the -1, -2 and -3 
+ *       values accordingly.
+ */
+static const TIFFFieldInfo
+tiffFieldInfo[] = {
+    { TIFFTAG_SUBFILETYPE,	 1, 1,	TIFF_LONG,	FIELD_SUBFILETYPE,
+      1,	0,	"SubfileType" },
+/* XXX SHORT for compatibility w/ old versions of the library */
+    { TIFFTAG_SUBFILETYPE,	 1, 1,	TIFF_SHORT,	FIELD_SUBFILETYPE,
+      1,	0,	"SubfileType" },
+    { TIFFTAG_OSUBFILETYPE,	 1, 1,	TIFF_SHORT,	FIELD_SUBFILETYPE,
+      1,	0,	"OldSubfileType" },
+    { TIFFTAG_IMAGEWIDTH,	 1, 1,	TIFF_LONG,	FIELD_IMAGEDIMENSIONS,
+      0,	0,	"ImageWidth" },
+    { TIFFTAG_IMAGEWIDTH,	 1, 1,	TIFF_SHORT,	FIELD_IMAGEDIMENSIONS,
+      0,	0,	"ImageWidth" },
+    { TIFFTAG_IMAGELENGTH,	 1, 1,	TIFF_LONG,	FIELD_IMAGEDIMENSIONS,
+      1,	0,	"ImageLength" },
+    { TIFFTAG_IMAGELENGTH,	 1, 1,	TIFF_SHORT,	FIELD_IMAGEDIMENSIONS,
+      1,	0,	"ImageLength" },
+    { TIFFTAG_BITSPERSAMPLE,	-1,-1,	TIFF_SHORT,	FIELD_BITSPERSAMPLE,
+      0,	0,	"BitsPerSample" },
+/* XXX LONG for compatibility with some broken TIFF writers */
+    { TIFFTAG_BITSPERSAMPLE,	-1,-1,	TIFF_LONG,	FIELD_BITSPERSAMPLE,
+      0,	0,	"BitsPerSample" },
+    { TIFFTAG_COMPRESSION,	-1, 1,	TIFF_SHORT,	FIELD_COMPRESSION,
+      0,	0,	"Compression" },
+/* XXX LONG for compatibility with some broken TIFF writers */
+    { TIFFTAG_COMPRESSION,	-1, 1,	TIFF_LONG,	FIELD_COMPRESSION,
+      0,	0,	"Compression" },
+    { TIFFTAG_PHOTOMETRIC,	 1, 1,	TIFF_SHORT,	FIELD_PHOTOMETRIC,
+      0,	0,	"PhotometricInterpretation" },
+/* XXX LONG for compatibility with some broken TIFF writers */
+    { TIFFTAG_PHOTOMETRIC,	 1, 1,	TIFF_LONG,	FIELD_PHOTOMETRIC,
+      0,	0,	"PhotometricInterpretation" },
+    { TIFFTAG_THRESHHOLDING,	 1, 1,	TIFF_SHORT,	FIELD_THRESHHOLDING,
+      1,	0,	"Threshholding" },
+    { TIFFTAG_CELLWIDTH,	 1, 1,	TIFF_SHORT,	FIELD_IGNORE,
+      1,	0,	"CellWidth" },
+    { TIFFTAG_CELLLENGTH,	 1, 1,	TIFF_SHORT,	FIELD_IGNORE,
+      1,	0,	"CellLength" },
+    { TIFFTAG_FILLORDER,	 1, 1,	TIFF_SHORT,	FIELD_FILLORDER,
+      0,	0,	"FillOrder" },
+    { TIFFTAG_DOCUMENTNAME,	-1,-1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"DocumentName" },
+    { TIFFTAG_IMAGEDESCRIPTION,	-1,-1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"ImageDescription" },
+    { TIFFTAG_MAKE,		-1,-1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"Make" },
+    { TIFFTAG_MODEL,		-1,-1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"Model" },
+    { TIFFTAG_STRIPOFFSETS,	-1,-1,	TIFF_LONG,	FIELD_STRIPOFFSETS,
+      0,	0,	"StripOffsets" },
+    { TIFFTAG_STRIPOFFSETS,	-1,-1,	TIFF_SHORT,	FIELD_STRIPOFFSETS,
+      0,	0,	"StripOffsets" },
+    { TIFFTAG_ORIENTATION,	 1, 1,	TIFF_SHORT,	FIELD_ORIENTATION,
+      0,	0,	"Orientation" },
+    { TIFFTAG_SAMPLESPERPIXEL,	 1, 1,	TIFF_SHORT,	FIELD_SAMPLESPERPIXEL,
+      0,	0,	"SamplesPerPixel" },
+    { TIFFTAG_ROWSPERSTRIP,	 1, 1,	TIFF_LONG,	FIELD_ROWSPERSTRIP,
+      0,	0,	"RowsPerStrip" },
+    { TIFFTAG_ROWSPERSTRIP,	 1, 1,	TIFF_SHORT,	FIELD_ROWSPERSTRIP,
+      0,	0,	"RowsPerStrip" },
+    { TIFFTAG_STRIPBYTECOUNTS,	-1,-1,	TIFF_LONG,	FIELD_STRIPBYTECOUNTS,
+      0,	0,	"StripByteCounts" },
+    { TIFFTAG_STRIPBYTECOUNTS,	-1,-1,	TIFF_SHORT,	FIELD_STRIPBYTECOUNTS,
+      0,	0,	"StripByteCounts" },
+    { TIFFTAG_MINSAMPLEVALUE,	-2,-1,	TIFF_SHORT,	FIELD_MINSAMPLEVALUE,
+      1,	0,	"MinSampleValue" },
+    { TIFFTAG_MAXSAMPLEVALUE,	-2,-1,	TIFF_SHORT,	FIELD_MAXSAMPLEVALUE,
+      1,	0,	"MaxSampleValue" },
+    { TIFFTAG_XRESOLUTION,	 1, 1,	TIFF_RATIONAL,	FIELD_RESOLUTION,
+      1,	0,	"XResolution" },
+    { TIFFTAG_YRESOLUTION,	 1, 1,	TIFF_RATIONAL,	FIELD_RESOLUTION,
+      1,	0,	"YResolution" },
+    { TIFFTAG_PLANARCONFIG,	 1, 1,	TIFF_SHORT,	FIELD_PLANARCONFIG,
+      0,	0,	"PlanarConfiguration" },
+    { TIFFTAG_PAGENAME,		-1,-1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"PageName" },
+    { TIFFTAG_XPOSITION,	 1, 1,	TIFF_RATIONAL,	FIELD_POSITION,
+      1,	0,	"XPosition" },
+    { TIFFTAG_YPOSITION,	 1, 1,	TIFF_RATIONAL,	FIELD_POSITION,
+      1,	0,	"YPosition" },
+    { TIFFTAG_FREEOFFSETS,	-1,-1,	TIFF_LONG,	FIELD_IGNORE,
+      0,	0,	"FreeOffsets" },
+    { TIFFTAG_FREEBYTECOUNTS,	-1,-1,	TIFF_LONG,	FIELD_IGNORE,
+      0,	0,	"FreeByteCounts" },
+    { TIFFTAG_GRAYRESPONSEUNIT,	 1, 1,	TIFF_SHORT,	FIELD_IGNORE,
+      1,	0,	"GrayResponseUnit" },
+    { TIFFTAG_GRAYRESPONSECURVE,-1,-1,	TIFF_SHORT,	FIELD_IGNORE,
+      1,	0,	"GrayResponseCurve" },
+    { TIFFTAG_RESOLUTIONUNIT,	 1, 1,	TIFF_SHORT,	FIELD_RESOLUTIONUNIT,
+      1,	0,	"ResolutionUnit" },
+    { TIFFTAG_PAGENUMBER,	 2, 2,	TIFF_SHORT,	FIELD_PAGENUMBER,
+      1,	0,	"PageNumber" },
+    { TIFFTAG_COLORRESPONSEUNIT, 1, 1,	TIFF_SHORT,	FIELD_IGNORE,
+      1,	0,	"ColorResponseUnit" },
+    { TIFFTAG_TRANSFERFUNCTION,	-1,-1,	TIFF_SHORT,	FIELD_TRANSFERFUNCTION,
+      1,	0,	"TransferFunction" },
+    { TIFFTAG_SOFTWARE,		-1,-1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"Software" },
+    { TIFFTAG_DATETIME,		20,20,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"DateTime" },
+    { TIFFTAG_ARTIST,		-1,-1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"Artist" },
+    { TIFFTAG_HOSTCOMPUTER,	-1,-1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"HostComputer" },
+    { TIFFTAG_WHITEPOINT,	 2, 2,	TIFF_RATIONAL,	FIELD_CUSTOM,
+      1,	0,	"WhitePoint" },
+    { TIFFTAG_PRIMARYCHROMATICITIES,6,6,TIFF_RATIONAL,	FIELD_CUSTOM,
+      1,	0,	"PrimaryChromaticities" },
+    { TIFFTAG_COLORMAP,		-1,-1,	TIFF_SHORT,	FIELD_COLORMAP,
+      1,	0,	"ColorMap" },
+    { TIFFTAG_HALFTONEHINTS,	 2, 2,	TIFF_SHORT,	FIELD_HALFTONEHINTS,
+      1,	0,	"HalftoneHints" },
+    { TIFFTAG_TILEWIDTH,	 1, 1,	TIFF_LONG,	FIELD_TILEDIMENSIONS,
+      0,	0,	"TileWidth" },
+    { TIFFTAG_TILEWIDTH,	 1, 1,	TIFF_SHORT,	FIELD_TILEDIMENSIONS,
+      0,	0,	"TileWidth" },
+    { TIFFTAG_TILELENGTH,	 1, 1,	TIFF_LONG,	FIELD_TILEDIMENSIONS,
+      0,	0,	"TileLength" },
+    { TIFFTAG_TILELENGTH,	 1, 1,	TIFF_SHORT,	FIELD_TILEDIMENSIONS,
+      0,	0,	"TileLength" },
+    { TIFFTAG_TILEOFFSETS,	-1, 1,	TIFF_LONG,	FIELD_STRIPOFFSETS,
+      0,	0,	"TileOffsets" },
+    { TIFFTAG_TILEBYTECOUNTS,	-1, 1,	TIFF_LONG,	FIELD_STRIPBYTECOUNTS,
+      0,	0,	"TileByteCounts" },
+    { TIFFTAG_TILEBYTECOUNTS,	-1, 1,	TIFF_SHORT,	FIELD_STRIPBYTECOUNTS,
+      0,	0,	"TileByteCounts" },
+    { TIFFTAG_SUBIFD,		-1,-1,	TIFF_IFD,	FIELD_SUBIFD,
+      1,	1,	"SubIFD" },
+    { TIFFTAG_SUBIFD,		-1,-1,	TIFF_LONG,	FIELD_SUBIFD,
+      1,	1,	"SubIFD" },
+    { TIFFTAG_INKSET,		 1, 1,	TIFF_SHORT,	FIELD_CUSTOM,
+      0,	0,	"InkSet" },
+    { TIFFTAG_INKNAMES,		-1,-1,	TIFF_ASCII,	FIELD_INKNAMES,
+      1,	1,	"InkNames" },
+    { TIFFTAG_NUMBEROFINKS,	 1, 1,	TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"NumberOfInks" },
+    { TIFFTAG_DOTRANGE,		 2, 2,	TIFF_SHORT,	FIELD_CUSTOM,
+      0,	0,	"DotRange" },
+    { TIFFTAG_DOTRANGE,		 2, 2,	TIFF_BYTE,	FIELD_CUSTOM,
+      0,	0,	"DotRange" },
+    { TIFFTAG_TARGETPRINTER,	-1,-1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"TargetPrinter" },
+    { TIFFTAG_EXTRASAMPLES,	-1,-1,	TIFF_SHORT,	FIELD_EXTRASAMPLES,
+      0,	1,	"ExtraSamples" },
+/* XXX for bogus Adobe Photoshop v2.5 files */
+    { TIFFTAG_EXTRASAMPLES,	-1,-1,	TIFF_BYTE,	FIELD_EXTRASAMPLES,
+      0,	1,	"ExtraSamples" },
+    { TIFFTAG_SAMPLEFORMAT,	-1,-1,	TIFF_SHORT,	FIELD_SAMPLEFORMAT,
+      0,	0,	"SampleFormat" },
+    { TIFFTAG_SMINSAMPLEVALUE,	-2,-1,	TIFF_ANY,	FIELD_SMINSAMPLEVALUE,
+      1,	0,	"SMinSampleValue" },
+    { TIFFTAG_SMAXSAMPLEVALUE,	-2,-1,	TIFF_ANY,	FIELD_SMAXSAMPLEVALUE,
+      1,	0,	"SMaxSampleValue" },
+    { TIFFTAG_CLIPPATH,		-1, -3, TIFF_BYTE,	FIELD_CUSTOM,
+      0,	1,	"ClipPath" },
+    { TIFFTAG_XCLIPPATHUNITS,	 1, 1,	TIFF_SLONG,	FIELD_CUSTOM,
+      0,	0,	"XClipPathUnits" },
+    { TIFFTAG_XCLIPPATHUNITS,	 1, 1,	TIFF_SSHORT,	FIELD_CUSTOM,
+      0,	0,	"XClipPathUnits" },
+    { TIFFTAG_XCLIPPATHUNITS,	 1, 1,	TIFF_SBYTE,	FIELD_CUSTOM,
+      0,	0,	"XClipPathUnits" },
+    { TIFFTAG_YCLIPPATHUNITS,	 1, 1,	TIFF_SLONG,	FIELD_CUSTOM,
+      0,	0,	"YClipPathUnits" },
+    { TIFFTAG_YCLIPPATHUNITS,	 1, 1,	TIFF_SSHORT,	FIELD_CUSTOM,
+      0,	0,	"YClipPathUnits" },
+    { TIFFTAG_YCLIPPATHUNITS,	 1, 1,	TIFF_SBYTE,	FIELD_CUSTOM,
+      0,	0,	"YClipPathUnits" },
+    { TIFFTAG_YCBCRCOEFFICIENTS, 3, 3,	TIFF_RATIONAL,	FIELD_CUSTOM,
+      0,	0,	"YCbCrCoefficients" },
+    { TIFFTAG_YCBCRSUBSAMPLING,	 2, 2,	TIFF_SHORT,	FIELD_YCBCRSUBSAMPLING,
+      0,	0,	"YCbCrSubsampling" },
+    { TIFFTAG_YCBCRPOSITIONING,	 1, 1,	TIFF_SHORT,	FIELD_YCBCRPOSITIONING,
+      0,	0,	"YCbCrPositioning" },
+    { TIFFTAG_REFERENCEBLACKWHITE, 6, 6, TIFF_RATIONAL,	FIELD_CUSTOM,
+      1,	0,	"ReferenceBlackWhite" },
+/* XXX temporarily accept LONG for backwards compatibility */
+    { TIFFTAG_REFERENCEBLACKWHITE, 6, 6, TIFF_LONG,	FIELD_CUSTOM,
+      1,	0,	"ReferenceBlackWhite" },
+    { TIFFTAG_XMLPACKET,	-3,-3,	TIFF_BYTE,	FIELD_CUSTOM,
+      0,	1,	"XMLPacket" },
+/* begin SGI tags */
+    { TIFFTAG_MATTEING,		 1, 1,	TIFF_SHORT,	FIELD_EXTRASAMPLES,
+      0,	0,	"Matteing" },
+    { TIFFTAG_DATATYPE,		-2,-1,	TIFF_SHORT,	FIELD_SAMPLEFORMAT,
+      0,	0,	"DataType" },
+    { TIFFTAG_IMAGEDEPTH,	 1, 1,	TIFF_LONG,	FIELD_IMAGEDEPTH,
+      0,	0,	"ImageDepth" },
+    { TIFFTAG_IMAGEDEPTH,	 1, 1,	TIFF_SHORT,	FIELD_IMAGEDEPTH,
+      0,	0,	"ImageDepth" },
+    { TIFFTAG_TILEDEPTH,	 1, 1,	TIFF_LONG,	FIELD_TILEDEPTH,
+      0,	0,	"TileDepth" },
+    { TIFFTAG_TILEDEPTH,	 1, 1,	TIFF_SHORT,	FIELD_TILEDEPTH,
+      0,	0,	"TileDepth" },
+/* end SGI tags */
+/* begin Pixar tags */
+    { TIFFTAG_PIXAR_IMAGEFULLWIDTH,  1, 1, TIFF_LONG,	FIELD_CUSTOM,
+      1,	0,	"ImageFullWidth" },
+    { TIFFTAG_PIXAR_IMAGEFULLLENGTH, 1, 1, TIFF_LONG,	FIELD_CUSTOM,
+      1,	0,	"ImageFullLength" },
+    { TIFFTAG_PIXAR_TEXTUREFORMAT,  -1, -1, TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"TextureFormat" },
+    { TIFFTAG_PIXAR_WRAPMODES,	    -1, -1, TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"TextureWrapModes" },
+    { TIFFTAG_PIXAR_FOVCOT,	     1, 1, TIFF_FLOAT,	FIELD_CUSTOM,
+      1,	0,	"FieldOfViewCotangent" },
+    { TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN,	16,16,	TIFF_FLOAT,
+      FIELD_CUSTOM,	1,	0,	"MatrixWorldToScreen" },
+    { TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA,	16,16,	TIFF_FLOAT,
+       FIELD_CUSTOM,	1,	0,	"MatrixWorldToCamera" },
+    { TIFFTAG_COPYRIGHT,	-1, -1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"Copyright" },
+/* end Pixar tags */
+    { TIFFTAG_RICHTIFFIPTC, -3, -3,	TIFF_LONG,	FIELD_CUSTOM, 
+      0,    1,   "RichTIFFIPTC" },
+    { TIFFTAG_PHOTOSHOP,    -3, -3,	TIFF_BYTE,	FIELD_CUSTOM, 
+      0,    1,   "Photoshop" },
+    { TIFFTAG_EXIFIFD,		1, 1,	TIFF_LONG,	FIELD_CUSTOM,
+      0,	0,	"EXIFIFDOffset" },
+    { TIFFTAG_ICCPROFILE,	-3, -3,	TIFF_UNDEFINED,	FIELD_CUSTOM,
+      0,	1,	"ICC Profile" },
+    { TIFFTAG_GPSIFD,		1, 1,	TIFF_LONG,	FIELD_CUSTOM,
+      0,	0,	"GPSIFDOffset" },
+    { TIFFTAG_STONITS,		 1, 1,	TIFF_DOUBLE,	FIELD_CUSTOM,
+      0,	0,	"StoNits" },
+    { TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_LONG,	FIELD_CUSTOM,
+      0,	0,	"InteroperabilityIFDOffset" },
+/* begin DNG tags */
+    { TIFFTAG_DNGVERSION,	4, 4,	TIFF_BYTE,	FIELD_CUSTOM, 
+      0,	0,	"DNGVersion" },
+    { TIFFTAG_DNGBACKWARDVERSION, 4, 4,	TIFF_BYTE,	FIELD_CUSTOM, 
+      0,	0,	"DNGBackwardVersion" },
+    { TIFFTAG_UNIQUECAMERAMODEL,    -1, -1, TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"UniqueCameraModel" },
+    { TIFFTAG_LOCALIZEDCAMERAMODEL, -1, -1, TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"LocalizedCameraModel" },
+    { TIFFTAG_LOCALIZEDCAMERAMODEL, -1, -1, TIFF_BYTE,	FIELD_CUSTOM,
+      1,	1,	"LocalizedCameraModel" },
+    { TIFFTAG_CFAPLANECOLOR,	-1, -1,	TIFF_BYTE,	FIELD_CUSTOM, 
+      0,	1,	"CFAPlaneColor" },
+    { TIFFTAG_CFALAYOUT,	1, 1,	TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	0,	"CFALayout" },
+    { TIFFTAG_LINEARIZATIONTABLE, -1, -1, TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	1,	"LinearizationTable" },
+    { TIFFTAG_BLACKLEVELREPEATDIM, 2, 2, TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	0,	"BlackLevelRepeatDim" },
+    { TIFFTAG_BLACKLEVEL,	-1, -1,	TIFF_LONG,	FIELD_CUSTOM, 
+      0,	1,	"BlackLevel" },
+    { TIFFTAG_BLACKLEVEL,	-1, -1,	TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	1,	"BlackLevel" },
+    { TIFFTAG_BLACKLEVEL,	-1, -1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"BlackLevel" },
+    { TIFFTAG_BLACKLEVELDELTAH,	-1, -1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"BlackLevelDeltaH" },
+    { TIFFTAG_BLACKLEVELDELTAV,	-1, -1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"BlackLevelDeltaV" },
+    { TIFFTAG_WHITELEVEL,	-2, -2,	TIFF_LONG,	FIELD_CUSTOM, 
+      0,	0,	"WhiteLevel" },
+    { TIFFTAG_WHITELEVEL,	-2, -2,	TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	0,	"WhiteLevel" },
+    { TIFFTAG_DEFAULTSCALE,	2, 2,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"DefaultScale" },
+    { TIFFTAG_BESTQUALITYSCALE,	1, 1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"BestQualityScale" },
+    { TIFFTAG_DEFAULTCROPORIGIN,	2, 2,	TIFF_LONG,	FIELD_CUSTOM, 
+      0,	0,	"DefaultCropOrigin" },
+    { TIFFTAG_DEFAULTCROPORIGIN,	2, 2,	TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	0,	"DefaultCropOrigin" },
+    { TIFFTAG_DEFAULTCROPORIGIN,	2, 2,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"DefaultCropOrigin" },
+    { TIFFTAG_DEFAULTCROPSIZE,	2, 2,	TIFF_LONG,	FIELD_CUSTOM, 
+      0,	0,	"DefaultCropSize" },
+    { TIFFTAG_DEFAULTCROPSIZE,	2, 2,	TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	0,	"DefaultCropSize" },
+    { TIFFTAG_DEFAULTCROPSIZE,	2, 2,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"DefaultCropSize" },
+    { TIFFTAG_COLORMATRIX1,	-1, -1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"ColorMatrix1" },
+    { TIFFTAG_COLORMATRIX2,	-1, -1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"ColorMatrix2" },
+    { TIFFTAG_CAMERACALIBRATION1,	-1, -1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"CameraCalibration1" },
+    { TIFFTAG_CAMERACALIBRATION2,	-1, -1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"CameraCalibration2" },
+    { TIFFTAG_REDUCTIONMATRIX1,	-1, -1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"ReductionMatrix1" },
+    { TIFFTAG_REDUCTIONMATRIX2,	-1, -1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"ReductionMatrix2" },
+    { TIFFTAG_ANALOGBALANCE,	-1, -1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"AnalogBalance" },
+    { TIFFTAG_ASSHOTNEUTRAL,	-1, -1,	TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	1,	"AsShotNeutral" },
+    { TIFFTAG_ASSHOTNEUTRAL,	-1, -1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"AsShotNeutral" },
+    { TIFFTAG_ASSHOTWHITEXY,	2, 2,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"AsShotWhiteXY" },
+    { TIFFTAG_BASELINEEXPOSURE,	1, 1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"BaselineExposure" },
+    { TIFFTAG_BASELINENOISE,	1, 1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"BaselineNoise" },
+    { TIFFTAG_BASELINESHARPNESS,	1, 1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"BaselineSharpness" },
+    { TIFFTAG_BAYERGREENSPLIT,	1, 1,	TIFF_LONG,	FIELD_CUSTOM, 
+      0,	0,	"BayerGreenSplit" },
+    { TIFFTAG_LINEARRESPONSELIMIT,	1, 1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"LinearResponseLimit" },
+    { TIFFTAG_CAMERASERIALNUMBER,    -1, -1, TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"CameraSerialNumber" },
+    { TIFFTAG_LENSINFO,	4, 4,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"LensInfo" },
+    { TIFFTAG_CHROMABLURRADIUS,	1, 1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"ChromaBlurRadius" },
+    { TIFFTAG_ANTIALIASSTRENGTH,	1, 1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"AntiAliasStrength" },
+    { TIFFTAG_SHADOWSCALE,	1, 1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      0,	0,	"ShadowScale" },
+    { TIFFTAG_DNGPRIVATEDATA,    -1, -1, TIFF_BYTE,	FIELD_CUSTOM,
+      0,	1,	"DNGPrivateData" },
+    { TIFFTAG_MAKERNOTESAFETY,	1, 1,	TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	0,	"MakerNoteSafety" },
+    { TIFFTAG_CALIBRATIONILLUMINANT1,	1, 1,	TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	0,	"CalibrationIlluminant1" },
+    { TIFFTAG_CALIBRATIONILLUMINANT2,	1, 1,	TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	0,	"CalibrationIlluminant2" },
+    { TIFFTAG_RAWDATAUNIQUEID,	16, 16,	TIFF_BYTE,	FIELD_CUSTOM, 
+      0,	0,	"RawDataUniqueID" },
+    { TIFFTAG_ORIGINALRAWFILENAME,    -1, -1, TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"OriginalRawFileName" },
+    { TIFFTAG_ORIGINALRAWFILENAME,    -1, -1, TIFF_BYTE,	FIELD_CUSTOM,
+      1,	1,	"OriginalRawFileName" },
+    { TIFFTAG_ORIGINALRAWFILEDATA,    -1, -1, TIFF_UNDEFINED,	FIELD_CUSTOM,
+      0,	1,	"OriginalRawFileData" },
+    { TIFFTAG_ACTIVEAREA,	4, 4,	TIFF_LONG,	FIELD_CUSTOM, 
+      0,	0,	"ActiveArea" },
+    { TIFFTAG_ACTIVEAREA,	4, 4,	TIFF_SHORT,	FIELD_CUSTOM, 
+      0,	0,	"ActiveArea" },
+    { TIFFTAG_MASKEDAREAS,	-1, -1,	TIFF_LONG,	FIELD_CUSTOM, 
+      0,	1,	"MaskedAreas" },
+    { TIFFTAG_ASSHOTICCPROFILE,    -1, -1, TIFF_UNDEFINED,	FIELD_CUSTOM,
+      0,	1,	"AsShotICCProfile" },
+    { TIFFTAG_ASSHOTPREPROFILEMATRIX,	-1, -1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"AsShotPreProfileMatrix" },
+    { TIFFTAG_CURRENTICCPROFILE,    -1, -1, TIFF_UNDEFINED,	FIELD_CUSTOM,
+      0,	1,	"CurrentICCProfile" },
+    { TIFFTAG_CURRENTPREPROFILEMATRIX,	-1, -1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      0,	1,	"CurrentPreProfileMatrix" },
+/* end DNG tags */
+};
+
+static const TIFFFieldInfo
+exifFieldInfo[] = {
+    { EXIFTAG_EXPOSURETIME,	1, 1,		TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"ExposureTime" },
+    { EXIFTAG_FNUMBER,		1, 1,		TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"FNumber" },
+    { EXIFTAG_EXPOSUREPROGRAM,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"ExposureProgram" },
+    { EXIFTAG_SPECTRALSENSITIVITY,    -1, -1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"SpectralSensitivity" },
+    { EXIFTAG_ISOSPEEDRATINGS,  -1, -1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	1,	"ISOSpeedRatings" },
+    { EXIFTAG_OECF,	-1, -1,			TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	1,	"OptoelectricConversionFactor" },
+    { EXIFTAG_EXIFVERSION,	4, 4,		TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	0,	"ExifVersion" },
+    { EXIFTAG_DATETIMEORIGINAL,	20, 20,		TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"DateTimeOriginal" },
+    { EXIFTAG_DATETIMEDIGITIZED, 20, 20,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"DateTimeDigitized" },
+    { EXIFTAG_COMPONENTSCONFIGURATION,	 4, 4,	TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	0,	"ComponentsConfiguration" },
+    { EXIFTAG_COMPRESSEDBITSPERPIXEL,	 1, 1,	TIFF_RATIONAL,	FIELD_CUSTOM,
+      1,	0,	"CompressedBitsPerPixel" },
+    { EXIFTAG_SHUTTERSPEEDVALUE,	1, 1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"ShutterSpeedValue" },
+    { EXIFTAG_APERTUREVALUE,	1, 1,		TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"ApertureValue" },
+    { EXIFTAG_BRIGHTNESSVALUE,	1, 1,		TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"BrightnessValue" },
+    { EXIFTAG_EXPOSUREBIASVALUE,	1, 1,	TIFF_SRATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"ExposureBiasValue" },
+    { EXIFTAG_MAXAPERTUREVALUE,	1, 1,		TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"MaxApertureValue" },
+    { EXIFTAG_SUBJECTDISTANCE,	1, 1,		TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"SubjectDistance" },
+    { EXIFTAG_METERINGMODE,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"MeteringMode" },
+    { EXIFTAG_LIGHTSOURCE,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"LightSource" },
+    { EXIFTAG_FLASH,	1, 1,			TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"Flash" },
+    { EXIFTAG_FOCALLENGTH,	1, 1,		TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"FocalLength" },
+    { EXIFTAG_SUBJECTAREA,	-1, -1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	1,	"SubjectArea" },
+    { EXIFTAG_MAKERNOTE,	-1, -1,		TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	1,	"MakerNote" },
+    { EXIFTAG_USERCOMMENT,	-1, -1,		TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	1,	"UserComment" },
+    { EXIFTAG_SUBSECTIME,    -1, -1,		TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"SubSecTime" },
+    { EXIFTAG_SUBSECTIMEORIGINAL, -1, -1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"SubSecTimeOriginal" },
+    { EXIFTAG_SUBSECTIMEDIGITIZED,-1, -1,	TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"SubSecTimeDigitized" },
+    { EXIFTAG_FLASHPIXVERSION,	4, 4,		TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	0,	"FlashpixVersion" },
+    { EXIFTAG_PIXELXDIMENSION,	1, 1,		TIFF_LONG,	FIELD_CUSTOM,
+      1,	0,	"PixelXDimension" },
+    { EXIFTAG_PIXELXDIMENSION,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"PixelXDimension" },
+    { EXIFTAG_PIXELYDIMENSION,	1, 1,		TIFF_LONG,	FIELD_CUSTOM,
+      1,	0,	"PixelYDimension" },
+    { EXIFTAG_PIXELYDIMENSION,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"PixelYDimension" },
+    { EXIFTAG_RELATEDSOUNDFILE,	13, 13,		TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"RelatedSoundFile" },
+    { EXIFTAG_FLASHENERGY,	1, 1,		TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"FlashEnergy" },
+    { EXIFTAG_SPATIALFREQUENCYRESPONSE,	-1, -1,	TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	1,	"SpatialFrequencyResponse" },
+    { EXIFTAG_FOCALPLANEXRESOLUTION,	1, 1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"FocalPlaneXResolution" },
+    { EXIFTAG_FOCALPLANEYRESOLUTION,	1, 1,	TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"FocalPlaneYResolution" },
+    { EXIFTAG_FOCALPLANERESOLUTIONUNIT,	1, 1,	TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"FocalPlaneResolutionUnit" },
+    { EXIFTAG_SUBJECTLOCATION,	2, 2,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"SubjectLocation" },
+    { EXIFTAG_EXPOSUREINDEX,	1, 1,		TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"ExposureIndex" },
+    { EXIFTAG_SENSINGMETHOD,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"SensingMethod" },
+    { EXIFTAG_FILESOURCE,	1, 1,		TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	0,	"FileSource" },
+    { EXIFTAG_SCENETYPE,	1, 1,		TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	0,	"SceneType" },
+    { EXIFTAG_CFAPATTERN,	-1, -1,		TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	1,	"CFAPattern" },
+    { EXIFTAG_CUSTOMRENDERED,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"CustomRendered" },
+    { EXIFTAG_EXPOSUREMODE,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"ExposureMode" },
+    { EXIFTAG_WHITEBALANCE,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"WhiteBalance" },
+    { EXIFTAG_DIGITALZOOMRATIO,	1, 1,		TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"DigitalZoomRatio" },
+    { EXIFTAG_FOCALLENGTHIN35MMFILM, 1, 1,	TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"FocalLengthIn35mmFilm" },
+    { EXIFTAG_SCENECAPTURETYPE,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"SceneCaptureType" },
+    { EXIFTAG_GAINCONTROL,	1, 1,		TIFF_RATIONAL,	FIELD_CUSTOM, 
+      1,	0,	"GainControl" },
+    { EXIFTAG_CONTRAST,		1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"Contrast" },
+    { EXIFTAG_SATURATION,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"Saturation" },
+    { EXIFTAG_SHARPNESS,	1, 1,		TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"Sharpness" },
+    { EXIFTAG_DEVICESETTINGDESCRIPTION,	-1, -1,	TIFF_UNDEFINED,	FIELD_CUSTOM,
+      1,	1,	"DeviceSettingDescription" },
+    { EXIFTAG_SUBJECTDISTANCERANGE, 1, 1,	TIFF_SHORT,	FIELD_CUSTOM,
+      1,	0,	"SubjectDistanceRange" },
+    { EXIFTAG_IMAGEUNIQUEID,	33, 33,		TIFF_ASCII,	FIELD_CUSTOM,
+      1,	0,	"ImageUniqueID" }
+};
+
+const TIFFFieldInfo *
+_TIFFGetFieldInfo(size_t *size)
+{
+	*size = TIFFArrayCount(tiffFieldInfo);
+	return tiffFieldInfo;
+}
+
+const TIFFFieldInfo *
+_TIFFGetExifFieldInfo(size_t *size)
+{
+	*size = TIFFArrayCount(exifFieldInfo);
+	return exifFieldInfo;
+}
+
+void
+_TIFFSetupFieldInfo(TIFF* tif, const TIFFFieldInfo info[], size_t n)
+{
+	if (tif->tif_fieldinfo) {
+		size_t  i;
+
+		for (i = 0; i < tif->tif_nfields; i++) 
+		{
+			TIFFFieldInfo *fld = tif->tif_fieldinfo[i];
+			if (fld->field_bit == FIELD_CUSTOM && 
+				strncmp("Tag ", fld->field_name, 4) == 0) {
+					_TIFFfree(fld->field_name);
+					_TIFFfree(fld);
+				}
+		}   
+      
+		_TIFFfree(tif->tif_fieldinfo);
+		tif->tif_nfields = 0;
+	}
+	_TIFFMergeFieldInfo(tif, info, n);
+}
+
+static int
+tagCompare(const void* a, const void* b)
+{
+	const TIFFFieldInfo* ta = *(const TIFFFieldInfo**) a;
+	const TIFFFieldInfo* tb = *(const TIFFFieldInfo**) b;
+	/* NB: be careful of return values for 16-bit platforms */
+	if (ta->field_tag != tb->field_tag)
+		return (ta->field_tag < tb->field_tag ? -1 : 1);
+	else
+		return ((int)tb->field_type - (int)ta->field_type);
+}
+
+static int
+tagNameCompare(const void* a, const void* b)
+{
+	const TIFFFieldInfo* ta = *(const TIFFFieldInfo**) a;
+	const TIFFFieldInfo* tb = *(const TIFFFieldInfo**) b;
+
+        return strcmp(ta->field_name, tb->field_name);
+}
+
+void
+_TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], int n)
+{
+	TIFFFieldInfo** tp;
+	int i;
+
+        tif->tif_foundfield = NULL;
+
+	if (tif->tif_nfields > 0) {
+		tif->tif_fieldinfo = (TIFFFieldInfo**)
+		    _TIFFrealloc(tif->tif_fieldinfo,
+			(tif->tif_nfields+n) * sizeof (TIFFFieldInfo*));
+	} else {
+		tif->tif_fieldinfo = (TIFFFieldInfo**)
+		    _TIFFmalloc(n * sizeof (TIFFFieldInfo*));
+	}
+	assert(tif->tif_fieldinfo != NULL);
+	tp = tif->tif_fieldinfo + tif->tif_nfields;
+	for (i = 0; i < n; i++)
+		*tp++ = (TIFFFieldInfo*) (info + i);	/* XXX */
+
+        /* Sort the field info by tag number */
+        qsort(tif->tif_fieldinfo, tif->tif_nfields += n,
+	      sizeof (TIFFFieldInfo*), tagCompare);
+}
+
+void
+_TIFFPrintFieldInfo(TIFF* tif, FILE* fd)
+{
+	size_t i;
+
+	fprintf(fd, "%s: \n", tif->tif_name);
+	for (i = 0; i < tif->tif_nfields; i++) {
+		const TIFFFieldInfo* fip = tif->tif_fieldinfo[i];
+		fprintf(fd, "field[%2d] %5lu, %2d, %2d, %d, %2d, %5s, %5s, %s\n"
+			, (int)i
+			, (unsigned long) fip->field_tag
+			, fip->field_readcount, fip->field_writecount
+			, fip->field_type
+			, fip->field_bit
+			, fip->field_oktochange ? "TRUE" : "FALSE"
+			, fip->field_passcount ? "TRUE" : "FALSE"
+			, fip->field_name
+		);
+	}
+}
+
+/*
+ * Return size of TIFFDataType in bytes
+ */
+int
+TIFFDataWidth(TIFFDataType type)
+{
+	switch(type)
+	{
+	case 0:  /* nothing */
+	case 1:  /* TIFF_BYTE */
+	case 2:  /* TIFF_ASCII */
+	case 6:  /* TIFF_SBYTE */
+	case 7:  /* TIFF_UNDEFINED */
+		return 1;
+	case 3:  /* TIFF_SHORT */
+	case 8:  /* TIFF_SSHORT */
+		return 2;
+	case 4:  /* TIFF_LONG */
+	case 9:  /* TIFF_SLONG */
+	case 11: /* TIFF_FLOAT */
+        case 13: /* TIFF_IFD */
+		return 4;
+	case 5:  /* TIFF_RATIONAL */
+	case 10: /* TIFF_SRATIONAL */
+	case 12: /* TIFF_DOUBLE */
+		return 8;
+	default:
+		return 0; /* will return 0 for unknown types */
+	}
+}
+
+/*
+ * Return size of TIFFDataType in bytes.
+ *
+ * XXX: We need a separate function to determine the space needed
+ * to store the value. For TIFF_RATIONAL values TIFFDataWidth() returns 8,
+ * but we use 4-byte float to represent rationals.
+ */
+int
+_TIFFDataSize(TIFFDataType type)
+{
+	switch (type) {
+		case TIFF_BYTE:
+		case TIFF_SBYTE:
+		case TIFF_ASCII:
+		case TIFF_UNDEFINED:
+		    return 1;
+		case TIFF_SHORT:
+		case TIFF_SSHORT:
+		    return 2;
+		case TIFF_LONG:
+		case TIFF_SLONG:
+		case TIFF_FLOAT:
+		case TIFF_IFD:
+		case TIFF_RATIONAL:
+		case TIFF_SRATIONAL:
+		    return 4;
+		case TIFF_DOUBLE:
+		    return 8;
+		default:
+		    return 0;
+	}
+}
+
+/*
+ * Return nearest TIFFDataType to the sample type of an image.
+ */
+TIFFDataType
+_TIFFSampleToTagType(TIFF* tif)
+{
+	uint32 bps = TIFFhowmany8(tif->tif_dir.td_bitspersample);
+
+	switch (tif->tif_dir.td_sampleformat) {
+	case SAMPLEFORMAT_IEEEFP:
+		return (bps == 4 ? TIFF_FLOAT : TIFF_DOUBLE);
+	case SAMPLEFORMAT_INT:
+		return (bps <= 1 ? TIFF_SBYTE :
+		    bps <= 2 ? TIFF_SSHORT : TIFF_SLONG);
+	case SAMPLEFORMAT_UINT:
+		return (bps <= 1 ? TIFF_BYTE :
+		    bps <= 2 ? TIFF_SHORT : TIFF_LONG);
+	case SAMPLEFORMAT_VOID:
+		return (TIFF_UNDEFINED);
+	}
+	/*NOTREACHED*/
+	return (TIFF_UNDEFINED);
+}
+
+const TIFFFieldInfo*
+_TIFFFindFieldInfo(TIFF* tif, ttag_t tag, TIFFDataType dt)
+{
+	int i, n;
+
+	if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&
+	    (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
+		return (tif->tif_foundfield);
+	/* NB: use sorted search (e.g. binary search) */
+	if(dt != TIFF_ANY) {
+            TIFFFieldInfo key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0};
+	    TIFFFieldInfo* pkey = &key;
+	    const TIFFFieldInfo **ret;
+
+	    key.field_tag = tag;
+            key.field_type = dt;
+
+	    ret = (const TIFFFieldInfo **) bsearch(&pkey,
+						   tif->tif_fieldinfo, 
+						   tif->tif_nfields,
+						   sizeof(TIFFFieldInfo *), 
+						   tagCompare);
+	    return (ret) ? (*ret) : NULL;
+        } else for (i = 0, n = tif->tif_nfields; i < n; i++) {
+		const TIFFFieldInfo* fip = tif->tif_fieldinfo[i];
+		if (fip->field_tag == tag &&
+		    (dt == TIFF_ANY || fip->field_type == dt))
+			return (tif->tif_foundfield = fip);
+	}
+	return ((const TIFFFieldInfo *)0);
+}
+
+const TIFFFieldInfo*
+_TIFFFindFieldInfoByName(TIFF* tif, const char *field_name, TIFFDataType dt)
+{
+	int i, n;
+
+	if (tif->tif_foundfield
+	    && streq(tif->tif_foundfield->field_name, field_name)
+	    && (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
+		return (tif->tif_foundfield);
+	/* NB: use sorted search (e.g. binary search) */
+	if(dt != TIFF_ANY) {
+            TIFFFieldInfo key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0};
+	    TIFFFieldInfo* pkey = &key;
+	    const TIFFFieldInfo **ret;
+
+            key.field_name = (char *)field_name;
+            key.field_type = dt;
+
+            ret = (const TIFFFieldInfo **) lfind(&pkey,
+						 tif->tif_fieldinfo, 
+						 &tif->tif_nfields,
+						 sizeof(TIFFFieldInfo *),
+						 tagNameCompare);
+	    return (ret) ? (*ret) : NULL;
+        } else
+		for (i = 0, n = tif->tif_nfields; i < n; i++) {
+			const TIFFFieldInfo* fip = tif->tif_fieldinfo[i];
+			if (streq(fip->field_name, field_name) &&
+			    (dt == TIFF_ANY || fip->field_type == dt))
+				return (tif->tif_foundfield = fip);
+		}
+	return ((const TIFFFieldInfo *)0);
+}
+
+const TIFFFieldInfo*
+_TIFFFieldWithTag(TIFF* tif, ttag_t tag)
+{
+	const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
+	if (!fip) {
+		TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithTag",
+			  "Internal error, unknown tag 0x%x",
+                          (unsigned int) tag);
+		assert(fip != NULL);
+		/*NOTREACHED*/
+	}
+	return (fip);
+}
+
+const TIFFFieldInfo*
+_TIFFFieldWithName(TIFF* tif, const char *field_name)
+{
+	const TIFFFieldInfo* fip =
+		_TIFFFindFieldInfoByName(tif, field_name, TIFF_ANY);
+	if (!fip) {
+		TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithName",
+			  "Internal error, unknown tag %s", field_name);
+		assert(fip != NULL);
+		/*NOTREACHED*/
+	}
+	return (fip);
+}
+
+const TIFFFieldInfo*
+_TIFFFindOrRegisterFieldInfo( TIFF *tif, ttag_t tag, TIFFDataType dt )
+
+{
+    const TIFFFieldInfo *fld;
+
+    fld = _TIFFFindFieldInfo( tif, tag, dt );
+    if( fld == NULL )
+    {
+        fld = _TIFFCreateAnonFieldInfo( tif, tag, dt );
+        _TIFFMergeFieldInfo( tif, fld, 1 );
+    }
+
+    return fld;
+}
+
+TIFFFieldInfo*
+_TIFFCreateAnonFieldInfo(TIFF *tif, ttag_t tag, TIFFDataType field_type)
+{
+	TIFFFieldInfo *fld;
+	(void) tif;
+
+	fld = (TIFFFieldInfo *) _TIFFmalloc(sizeof (TIFFFieldInfo));
+	if (fld == NULL)
+	    return NULL;
+	_TIFFmemset( fld, 0, sizeof(TIFFFieldInfo) );
+
+	fld->field_tag = tag;
+	fld->field_readcount = TIFF_VARIABLE;
+	fld->field_writecount = TIFF_VARIABLE;
+	fld->field_type = field_type;
+	fld->field_bit = FIELD_CUSTOM;
+	fld->field_oktochange = TRUE;
+	fld->field_passcount = TRUE;
+	fld->field_name = (char *) _TIFFmalloc(32);
+	if (fld->field_name == NULL) {
+	    _TIFFfree(fld);
+	    return NULL;
+	}
+
+	/* note that this name is a special sign to TIFFClose() and
+	 * _TIFFSetupFieldInfo() to free the field
+	 */
+	sprintf(fld->field_name, "Tag %d", (int) tag);
+
+	return fld;    
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_dirread.c b/src/tiff/tif_dirread.c
new file mode 100644
index 0000000..f88d9db
--- /dev/null
+++ b/src/tiff/tif_dirread.c
@@ -0,0 +1,1789 @@
+/* $Id: tif_dirread.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Directory Read Support Routines.
+ */
+#include "tiffiop.h"
+
+#define	IGNORE	0		/* tag placeholder used below */
+
+#ifdef HAVE_IEEEFP
+# define	TIFFCvtIEEEFloatToNative(tif, n, fp)
+# define	TIFFCvtIEEEDoubleToNative(tif, n, dp)
+#else
+extern	void TIFFCvtIEEEFloatToNative(TIFF*, uint32, float*);
+extern	void TIFFCvtIEEEDoubleToNative(TIFF*, uint32, double*);
+#endif
+
+static	int EstimateStripByteCounts(TIFF*, TIFFDirEntry*, uint16);
+static	void MissingRequired(TIFF*, const char*);
+static	int CheckDirCount(TIFF*, TIFFDirEntry*, uint32);
+static	tsize_t TIFFFetchData(TIFF*, TIFFDirEntry*, char*);
+static	tsize_t TIFFFetchString(TIFF*, TIFFDirEntry*, char*);
+static	float TIFFFetchRational(TIFF*, TIFFDirEntry*);
+static	int TIFFFetchNormalTag(TIFF*, TIFFDirEntry*);
+static	int TIFFFetchPerSampleShorts(TIFF*, TIFFDirEntry*, uint16*);
+static	int TIFFFetchPerSampleLongs(TIFF*, TIFFDirEntry*, uint32*);
+static	int TIFFFetchPerSampleAnys(TIFF*, TIFFDirEntry*, double*);
+static	int TIFFFetchShortArray(TIFF*, TIFFDirEntry*, uint16*);
+static	int TIFFFetchStripThing(TIFF*, TIFFDirEntry*, long, uint32**);
+static	int TIFFFetchRefBlackWhite(TIFF*, TIFFDirEntry*);
+static	float TIFFFetchFloat(TIFF*, TIFFDirEntry*);
+static	int TIFFFetchFloatArray(TIFF*, TIFFDirEntry*, float*);
+static	int TIFFFetchDoubleArray(TIFF*, TIFFDirEntry*, double*);
+static	int TIFFFetchAnyArray(TIFF*, TIFFDirEntry*, double*);
+static	int TIFFFetchShortPair(TIFF*, TIFFDirEntry*);
+static	void ChopUpSingleUncompressedStrip(TIFF*);
+
+/*
+ * Read the next TIFF directory from a file
+ * and convert it to the internal format.
+ * We read directories sequentially.
+ */
+int
+TIFFReadDirectory(TIFF* tif)
+{
+	static const char module[] = "TIFFReadDirectory";
+
+	int n;
+	TIFFDirectory* td;
+	TIFFDirEntry *dp, *dir = NULL;
+	uint16 iv;
+	uint32 v;
+	const TIFFFieldInfo* fip;
+	size_t fix;
+	uint16 dircount;
+	toff_t nextdiroff;
+	int diroutoforderwarning = 0;
+	toff_t* new_dirlist;
+
+	tif->tif_diroff = tif->tif_nextdiroff;
+	if (tif->tif_diroff == 0)		/* no more directories */
+		return (0);
+
+	/*
+	 * XXX: Trick to prevent IFD looping. The one can create TIFF file
+	 * with looped directory pointers. We will maintain a list of already
+	 * seen directories and check every IFD offset against this list.
+	 */
+	for (n = 0; n < tif->tif_dirnumber; n++) {
+		if (tif->tif_dirlist[n] == tif->tif_diroff)
+			return (0);
+	}
+	tif->tif_dirnumber++;
+	new_dirlist = (toff_t *)_TIFFrealloc(tif->tif_dirlist,
+					tif->tif_dirnumber * sizeof(toff_t));
+	if (!new_dirlist) {
+		TIFFErrorExt(tif->tif_clientdata, module,
+			  "%s: Failed to allocate space for IFD list",
+			  tif->tif_name);
+		return (0);
+	}
+	tif->tif_dirlist = new_dirlist;
+	tif->tif_dirlist[tif->tif_dirnumber - 1] = tif->tif_diroff;
+
+	/*
+	 * Cleanup any previous compression state.
+	 */
+	(*tif->tif_cleanup)(tif);
+	tif->tif_curdir++;
+	nextdiroff = 0;
+	if (!isMapped(tif)) {
+		if (!SeekOK(tif, tif->tif_diroff)) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Seek error accessing TIFF directory",
+                            tif->tif_name);
+			return (0);
+		}
+		if (!ReadOK(tif, &dircount, sizeof (uint16))) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Can not read TIFF directory count",
+                            tif->tif_name);
+			return (0);
+		}
+		if (tif->tif_flags & TIFF_SWAB)
+			TIFFSwabShort(&dircount);
+		dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dircount,
+						       sizeof (TIFFDirEntry),
+						"to read TIFF directory");
+		if (dir == NULL)
+			return (0);
+		if (!ReadOK(tif, dir, dircount*sizeof (TIFFDirEntry))) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+                                  "%.100s: Can not read TIFF directory",
+                                  tif->tif_name);
+			goto bad;
+		}
+		/*
+		 * Read offset to next directory for sequential scans.
+		 */
+		(void) ReadOK(tif, &nextdiroff, sizeof (uint32));
+	} else {
+		toff_t off = tif->tif_diroff;
+
+		if (off + sizeof (uint16) > tif->tif_size) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Can not read TIFF directory count",
+                            tif->tif_name);
+			return (0);
+		} else
+			_TIFFmemcpy(&dircount, tif->tif_base + off, sizeof (uint16));
+		off += sizeof (uint16);
+		if (tif->tif_flags & TIFF_SWAB)
+			TIFFSwabShort(&dircount);
+		dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dircount,
+						       sizeof (TIFFDirEntry),
+						"to read TIFF directory");
+		if (dir == NULL)
+			return (0);
+		if (off + dircount*sizeof (TIFFDirEntry) > tif->tif_size) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+                                  "%s: Can not read TIFF directory",
+                                  tif->tif_name);
+			goto bad;
+		} else {
+			_TIFFmemcpy(dir, tif->tif_base + off,
+				    dircount*sizeof (TIFFDirEntry));
+		}
+		off += dircount* sizeof (TIFFDirEntry);
+		if (off + sizeof (uint32) <= tif->tif_size)
+			_TIFFmemcpy(&nextdiroff, tif->tif_base+off, sizeof (uint32));
+	}
+	if (tif->tif_flags & TIFF_SWAB)
+		TIFFSwabLong(&nextdiroff);
+	tif->tif_nextdiroff = nextdiroff;
+
+	tif->tif_flags &= ~TIFF_BEENWRITING;	/* reset before new dir */
+	/*
+	 * Setup default value and then make a pass over
+	 * the fields to check type and tag information,
+	 * and to extract info required to size data
+	 * structures.  A second pass is made afterwards
+	 * to read in everthing not taken in the first pass.
+	 */
+	td = &tif->tif_dir;
+	/* free any old stuff and reinit */
+	TIFFFreeDirectory(tif);
+	TIFFDefaultDirectory(tif);
+	/*
+	 * Electronic Arts writes gray-scale TIFF files
+	 * without a PlanarConfiguration directory entry.
+	 * Thus we setup a default value here, even though
+	 * the TIFF spec says there is no default value.
+	 */
+	TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+
+	/*
+	 * Sigh, we must make a separate pass through the
+	 * directory for the following reason:
+	 *
+	 * We must process the Compression tag in the first pass
+	 * in order to merge in codec-private tag definitions (otherwise
+	 * we may get complaints about unknown tags).  However, the
+	 * Compression tag may be dependent on the SamplesPerPixel
+	 * tag value because older TIFF specs permited Compression
+	 * to be written as a SamplesPerPixel-count tag entry.
+	 * Thus if we don't first figure out the correct SamplesPerPixel
+	 * tag value then we may end up ignoring the Compression tag
+	 * value because it has an incorrect count value (if the
+	 * true value of SamplesPerPixel is not 1).
+	 *
+	 * It sure would have been nice if Aldus had really thought
+	 * this stuff through carefully.
+	 */ 
+	for (dp = dir, n = dircount; n > 0; n--, dp++) {
+		if (tif->tif_flags & TIFF_SWAB) {
+			TIFFSwabArrayOfShort(&dp->tdir_tag, 2);
+			TIFFSwabArrayOfLong(&dp->tdir_count, 2);
+		}
+		if (dp->tdir_tag == TIFFTAG_SAMPLESPERPIXEL) {
+			if (!TIFFFetchNormalTag(tif, dp))
+				goto bad;
+			dp->tdir_tag = IGNORE;
+		}
+	}
+	/*
+	 * First real pass over the directory.
+	 */
+	fix = 0;
+	for (dp = dir, n = dircount; n > 0; n--, dp++) {
+
+		if (fix >= tif->tif_nfields || dp->tdir_tag == IGNORE)
+			continue;
+               
+		/*
+		 * Silicon Beach (at least) writes unordered
+		 * directory tags (violating the spec).  Handle
+		 * it here, but be obnoxious (maybe they'll fix it?).
+		 */
+		if (dp->tdir_tag < tif->tif_fieldinfo[fix]->field_tag) {
+			if (!diroutoforderwarning) {
+				TIFFWarningExt(tif->tif_clientdata, module,
+	"%s: invalid TIFF directory; tags are not sorted in ascending order",
+					       tif->tif_name);
+				diroutoforderwarning = 1;
+			}
+			fix = 0;			/* O(n^2) */
+		}
+		while (fix < tif->tif_nfields &&
+		       tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
+			fix++;
+		if (fix >= tif->tif_nfields ||
+		    tif->tif_fieldinfo[fix]->field_tag != dp->tdir_tag) {
+
+					TIFFWarningExt(tif->tif_clientdata,
+						       module,
+                        "%s: unknown field with tag %d (0x%x) encountered",
+						       tif->tif_name,
+						       dp->tdir_tag,
+						       dp->tdir_tag,
+						       dp->tdir_type);
+
+                    TIFFMergeFieldInfo(tif,
+                                       _TIFFCreateAnonFieldInfo(tif,
+						dp->tdir_tag,
+						(TIFFDataType) dp->tdir_type),
+				       1 );
+                    fix = 0;
+                    while (fix < tif->tif_nfields &&
+                           tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
+			fix++;
+		}
+		/*
+		 * Null out old tags that we ignore.
+		 */
+		if (tif->tif_fieldinfo[fix]->field_bit == FIELD_IGNORE) {
+	ignore:
+			dp->tdir_tag = IGNORE;
+			continue;
+		}
+		/*
+		 * Check data type.
+		 */
+		fip = tif->tif_fieldinfo[fix];
+		while (dp->tdir_type != (unsigned short) fip->field_type
+                       && fix < tif->tif_nfields) {
+			if (fip->field_type == TIFF_ANY)	/* wildcard */
+				break;
+                        fip = tif->tif_fieldinfo[++fix];
+			if (fix >= tif->tif_nfields ||
+			    fip->field_tag != dp->tdir_tag) {
+				TIFFWarningExt(tif->tif_clientdata, module,
+			"%s: wrong data type %d for \"%s\"; tag ignored",
+					    tif->tif_name, dp->tdir_type,
+					    tif->tif_fieldinfo[fix-1]->field_name);
+				goto ignore;
+			}
+		}
+		/*
+		 * Check count if known in advance.
+		 */
+		if (fip->field_readcount != TIFF_VARIABLE
+		    && fip->field_readcount != TIFF_VARIABLE2) {
+			uint32 expected = (fip->field_readcount == TIFF_SPP) ?
+			    (uint32) td->td_samplesperpixel :
+			    (uint32) fip->field_readcount;
+			if (!CheckDirCount(tif, dp, expected))
+				goto ignore;
+		}
+
+		switch (dp->tdir_tag) {
+		case TIFFTAG_COMPRESSION:
+			/*
+			 * The 5.0 spec says the Compression tag has
+			 * one value, while earlier specs say it has
+			 * one value per sample.  Because of this, we
+			 * accept the tag if one value is supplied.
+			 */
+			if (dp->tdir_count == 1) {
+				v = TIFFExtractData(tif,
+				    dp->tdir_type, dp->tdir_offset);
+				if (!TIFFSetField(tif, dp->tdir_tag, (uint16)v))
+					goto bad;
+				break;
+			/* XXX: workaround for broken TIFFs */
+			} else if (dp->tdir_type == TIFF_LONG) {
+				if (!TIFFFetchPerSampleLongs(tif, dp, &v) ||
+				    !TIFFSetField(tif, dp->tdir_tag, (uint16)v))
+					goto bad;
+			} else {
+				if (!TIFFFetchPerSampleShorts(tif, dp, &iv)
+				    || !TIFFSetField(tif, dp->tdir_tag, iv))
+					goto bad;
+			}
+			dp->tdir_tag = IGNORE;
+			break;
+		case TIFFTAG_STRIPOFFSETS:
+		case TIFFTAG_STRIPBYTECOUNTS:
+		case TIFFTAG_TILEOFFSETS:
+		case TIFFTAG_TILEBYTECOUNTS:
+			TIFFSetFieldBit(tif, fip->field_bit);
+			break;
+		case TIFFTAG_IMAGEWIDTH:
+		case TIFFTAG_IMAGELENGTH:
+		case TIFFTAG_IMAGEDEPTH:
+		case TIFFTAG_TILELENGTH:
+		case TIFFTAG_TILEWIDTH:
+		case TIFFTAG_TILEDEPTH:
+		case TIFFTAG_PLANARCONFIG:
+		case TIFFTAG_ROWSPERSTRIP:
+		case TIFFTAG_EXTRASAMPLES:
+			if (!TIFFFetchNormalTag(tif, dp))
+				goto bad;
+			dp->tdir_tag = IGNORE;
+			break;
+		}
+	}
+
+	/*
+	 * Allocate directory structure and setup defaults.
+	 */
+	if (!TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS)) {
+		MissingRequired(tif, "ImageLength");
+		goto bad;
+	}
+	/* 
+ 	 * Setup appropriate structures (by strip or by tile)
+	 */
+	if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS)) {
+		td->td_nstrips = TIFFNumberOfStrips(tif);
+		td->td_tilewidth = td->td_imagewidth;
+		td->td_tilelength = td->td_rowsperstrip;
+		td->td_tiledepth = td->td_imagedepth;
+		tif->tif_flags &= ~TIFF_ISTILED;
+	} else {
+		td->td_nstrips = TIFFNumberOfTiles(tif);
+		tif->tif_flags |= TIFF_ISTILED;
+	}
+	if (!td->td_nstrips) {
+		TIFFErrorExt(tif->tif_clientdata, module,
+			     "%s: cannot handle zero number of %s",
+			     tif->tif_name, isTiled(tif) ? "tiles" : "strips");
+		goto bad;
+	}
+	td->td_stripsperimage = td->td_nstrips;
+	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
+		td->td_stripsperimage /= td->td_samplesperpixel;
+	if (!TIFFFieldSet(tif, FIELD_STRIPOFFSETS)) {
+		MissingRequired(tif,
+				isTiled(tif) ? "TileOffsets" : "StripOffsets");
+		goto bad;
+	}
+
+	/*
+	 * Second pass: extract other information.
+	 */
+	for (dp = dir, n = dircount; n > 0; n--, dp++) {
+		if (dp->tdir_tag == IGNORE)
+			continue;
+		switch (dp->tdir_tag) {
+		case TIFFTAG_MINSAMPLEVALUE:
+		case TIFFTAG_MAXSAMPLEVALUE:
+		case TIFFTAG_BITSPERSAMPLE:
+		case TIFFTAG_DATATYPE:
+		case TIFFTAG_SAMPLEFORMAT:
+			/*
+			 * The 5.0 spec says the Compression tag has
+			 * one value, while earlier specs say it has
+			 * one value per sample.  Because of this, we
+			 * accept the tag if one value is supplied.
+			 *
+                         * The MinSampleValue, MaxSampleValue, BitsPerSample
+                         * DataType and SampleFormat tags are supposed to be
+                         * written as one value/sample, but some vendors
+                         * incorrectly write one value only -- so we accept
+                         * that as well (yech). Other vendors write correct
+			 * value for NumberOfSamples, but incorrect one for
+			 * BitsPerSample and friends, and we will read this
+			 * too.
+			 */
+			if (dp->tdir_count == 1) {
+				v = TIFFExtractData(tif,
+				    dp->tdir_type, dp->tdir_offset);
+				if (!TIFFSetField(tif, dp->tdir_tag, (uint16)v))
+					goto bad;
+			/* XXX: workaround for broken TIFFs */
+			} else if (dp->tdir_tag == TIFFTAG_BITSPERSAMPLE
+				   && dp->tdir_type == TIFF_LONG) {
+				if (!TIFFFetchPerSampleLongs(tif, dp, &v) ||
+				    !TIFFSetField(tif, dp->tdir_tag, (uint16)v))
+					goto bad;
+			} else {
+				if (!TIFFFetchPerSampleShorts(tif, dp, &iv) ||
+				    !TIFFSetField(tif, dp->tdir_tag, iv))
+					goto bad;
+			}
+			break;
+		case TIFFTAG_SMINSAMPLEVALUE:
+		case TIFFTAG_SMAXSAMPLEVALUE:
+			{
+				double dv = 0.0;
+				if (!TIFFFetchPerSampleAnys(tif, dp, &dv) ||
+				    !TIFFSetField(tif, dp->tdir_tag, dv))
+					goto bad;
+			}
+			break;
+		case TIFFTAG_STRIPOFFSETS:
+		case TIFFTAG_TILEOFFSETS:
+			if (!TIFFFetchStripThing(tif, dp,
+			    td->td_nstrips, &td->td_stripoffset))
+				goto bad;
+			break;
+		case TIFFTAG_STRIPBYTECOUNTS:
+		case TIFFTAG_TILEBYTECOUNTS:
+			if (!TIFFFetchStripThing(tif, dp,
+			    td->td_nstrips, &td->td_stripbytecount))
+				goto bad;
+			break;
+		case TIFFTAG_COLORMAP:
+		case TIFFTAG_TRANSFERFUNCTION:
+			{
+				char* cp;
+				/*
+				 * TransferFunction can have either 1x or 3x
+				 * data values; Colormap can have only 3x
+				 * items.
+				 */
+				v = 1L<<td->td_bitspersample;
+				if (dp->tdir_tag == TIFFTAG_COLORMAP ||
+				    dp->tdir_count != v) {
+					if (!CheckDirCount(tif, dp, 3 * v))
+						break;
+				}
+				v *= sizeof(uint16);
+				cp = (char *)_TIFFCheckMalloc(tif,
+							      dp->tdir_count,
+							      sizeof (uint16),
+					"to read \"TransferFunction\" tag");
+				if (cp != NULL) {
+					if (TIFFFetchData(tif, dp, cp)) {
+						/*
+						 * This deals with there being
+						 * only one array to apply to
+						 * all samples.
+						 */
+						uint32 c = 1L << td->td_bitspersample;
+						if (dp->tdir_count == c)
+							v = 0L;
+						TIFFSetField(tif, dp->tdir_tag,
+						    cp, cp+v, cp+2*v);
+					}
+					_TIFFfree(cp);
+				}
+				break;
+			}
+		case TIFFTAG_PAGENUMBER:
+		case TIFFTAG_HALFTONEHINTS:
+		case TIFFTAG_YCBCRSUBSAMPLING:
+		case TIFFTAG_DOTRANGE:
+			(void) TIFFFetchShortPair(tif, dp);
+			break;
+		case TIFFTAG_REFERENCEBLACKWHITE:
+			(void) TIFFFetchRefBlackWhite(tif, dp);
+			break;
+/* BEGIN REV 4.0 COMPATIBILITY */
+		case TIFFTAG_OSUBFILETYPE:
+			v = 0L;
+			switch (TIFFExtractData(tif, dp->tdir_type,
+			    dp->tdir_offset)) {
+			case OFILETYPE_REDUCEDIMAGE:
+				v = FILETYPE_REDUCEDIMAGE;
+				break;
+			case OFILETYPE_PAGE:
+				v = FILETYPE_PAGE;
+				break;
+			}
+			if (v)
+				TIFFSetField(tif, TIFFTAG_SUBFILETYPE, v);
+			break;
+/* END REV 4.0 COMPATIBILITY */
+		default:
+			(void) TIFFFetchNormalTag(tif, dp);
+			break;
+		}
+	}
+	/*
+	 * Verify Palette image has a Colormap.
+	 */
+	if (td->td_photometric == PHOTOMETRIC_PALETTE &&
+	    !TIFFFieldSet(tif, FIELD_COLORMAP)) {
+		MissingRequired(tif, "Colormap");
+		goto bad;
+	}
+	/*
+	 * Attempt to deal with a missing StripByteCounts tag.
+	 */
+	if (!TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS)) {
+		/*
+		 * Some manufacturers violate the spec by not giving
+		 * the size of the strips.  In this case, assume there
+		 * is one uncompressed strip of data.
+		 */
+		if ((td->td_planarconfig == PLANARCONFIG_CONTIG &&
+		    td->td_nstrips > 1) ||
+		    (td->td_planarconfig == PLANARCONFIG_SEPARATE &&
+		     td->td_nstrips != td->td_samplesperpixel)) {
+		    MissingRequired(tif, "StripByteCounts");
+		    goto bad;
+		}
+		TIFFWarningExt(tif->tif_clientdata, module,
+			"%s: TIFF directory is missing required "
+			"\"%s\" field, calculating from imagelength",
+			tif->tif_name,
+		        _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
+		if (EstimateStripByteCounts(tif, dir, dircount) < 0)
+		    goto bad;
+/* 
+ * Assume we have wrong StripByteCount value (in case of single strip) in
+ * following cases:
+ *   - it is equal to zero along with StripOffset;
+ *   - it is larger than file itself (in case of uncompressed image);
+ *   - it is smaller than the size of the bytes per row multiplied on the
+ *     number of rows.  The last case should not be checked in the case of
+ *     writing new image, because we may do not know the exact strip size
+ *     until the whole image will be written and directory dumped out.
+ */
+#define	BYTECOUNTLOOKSBAD \
+    ( (td->td_stripbytecount[0] == 0 && td->td_stripoffset[0] != 0) || \
+      (td->td_compression == COMPRESSION_NONE && \
+       td->td_stripbytecount[0] > TIFFGetFileSize(tif) - td->td_stripoffset[0]) || \
+      (tif->tif_mode == O_RDONLY && \
+       td->td_compression == COMPRESSION_NONE && \
+       td->td_stripbytecount[0] < TIFFScanlineSize(tif) * td->td_imagelength) )
+
+	} else if (td->td_nstrips == 1 
+                   && td->td_stripoffset[0] != 0 
+                   && BYTECOUNTLOOKSBAD) {
+		/*
+		 * XXX: Plexus (and others) sometimes give a value of zero for
+		 * a tag when they don't know what the correct value is!  Try
+		 * and handle the simple case of estimating the size of a one
+		 * strip image.
+		 */
+		TIFFWarningExt(tif->tif_clientdata, module,
+	"%s: Bogus \"%s\" field, ignoring and calculating from imagelength",
+                            tif->tif_name,
+		            _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
+		if(EstimateStripByteCounts(tif, dir, dircount) < 0)
+		    goto bad;
+	} else if (td->td_planarconfig == PLANARCONFIG_CONTIG
+		   && td->td_nstrips > 2
+		   && td->td_compression == COMPRESSION_NONE
+		   && td->td_stripbytecount[0] != td->td_stripbytecount[1]) {
+		/*
+		 * XXX: Some vendors fill StripByteCount array with absolutely
+		 * wrong values (it can be equal to StripOffset array, for
+		 * example). Catch this case here.
+		 */
+		TIFFWarningExt(tif->tif_clientdata, module,
+	"%s: Wrong \"%s\" field, ignoring and calculating from imagelength",
+                            tif->tif_name,
+		            _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
+		if (EstimateStripByteCounts(tif, dir, dircount) < 0)
+		    goto bad;
+	}
+	if (dir) {
+		_TIFFfree((char *)dir);
+		dir = NULL;
+	}
+	if (!TIFFFieldSet(tif, FIELD_MAXSAMPLEVALUE))
+		td->td_maxsamplevalue = (uint16)((1L<<td->td_bitspersample)-1);
+	/*
+	 * Setup default compression scheme.
+	 */
+
+	/*
+	 * XXX: We can optimize checking for the strip bounds using the sorted
+	 * bytecounts array. See also comments for TIFFAppendToStrip()
+	 * function in tif_write.c.
+	 */
+	if (td->td_nstrips > 1) {
+		tstrip_t strip;
+
+		td->td_stripbytecountsorted = 1;
+		for (strip = 1; strip < td->td_nstrips; strip++) {
+			if (td->td_stripoffset[strip - 1] >
+			    td->td_stripoffset[strip]) {
+				td->td_stripbytecountsorted = 0;
+				break;
+			}
+		}
+	}
+
+	if (!TIFFFieldSet(tif, FIELD_COMPRESSION))
+		TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+        /*
+         * Some manufacturers make life difficult by writing
+	 * large amounts of uncompressed data as a single strip.
+	 * This is contrary to the recommendations of the spec.
+         * The following makes an attempt at breaking such images
+	 * into strips closer to the recommended 8k bytes.  A
+	 * side effect, however, is that the RowsPerStrip tag
+	 * value may be changed.
+         */
+	if (td->td_nstrips == 1 && td->td_compression == COMPRESSION_NONE &&
+	    (tif->tif_flags & (TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP)
+		ChopUpSingleUncompressedStrip(tif);
+
+	/*
+	 * Reinitialize i/o since we are starting on a new directory.
+	 */
+	tif->tif_row = (uint32) -1;
+	tif->tif_curstrip = (tstrip_t) -1;
+	tif->tif_col = (uint32) -1;
+	tif->tif_curtile = (ttile_t) -1;
+	tif->tif_tilesize = (tsize_t) -1;
+
+	tif->tif_scanlinesize = TIFFScanlineSize(tif);
+	if (!tif->tif_scanlinesize) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: cannot handle zero scanline size",
+			  tif->tif_name);
+		return (0);
+	}
+
+	if (isTiled(tif)) {
+		tif->tif_tilesize = TIFFTileSize(tif);
+		if (!tif->tif_tilesize) {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: cannot handle zero tile size",
+				  tif->tif_name);
+			return (0);
+		}
+	} else {
+		if (!TIFFStripSize(tif)) {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: cannot handle zero strip size",
+				  tif->tif_name);
+			return (0);
+		}
+	}
+	return (1);
+bad:
+	if (dir)
+		_TIFFfree(dir);
+	return (0);
+}
+
+/* 
+ * Read custom directory from the arbitarry offset.
+ * The code is very similar to TIFFReadDirectory().
+ */
+int
+TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
+			const TIFFFieldInfo info[], size_t n)
+{
+	static const char module[] = "TIFFReadCustomDirectory";
+
+	TIFFDirectory* td = &tif->tif_dir;
+	TIFFDirEntry *dp, *dir = NULL;
+	const TIFFFieldInfo* fip;
+	size_t fix;
+	uint16 i, dircount;
+
+	_TIFFSetupFieldInfo(tif, info, n);
+
+	tif->tif_diroff = diroff;
+
+	if (!isMapped(tif)) {
+		if (!SeekOK(tif, diroff)) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Seek error accessing TIFF directory",
+                            tif->tif_name);
+			return (0);
+		}
+		if (!ReadOK(tif, &dircount, sizeof (uint16))) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Can not read TIFF directory count",
+                            tif->tif_name);
+			return (0);
+		}
+		if (tif->tif_flags & TIFF_SWAB)
+			TIFFSwabShort(&dircount);
+		dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dircount,
+						       sizeof (TIFFDirEntry),
+					"to read TIFF custom directory");
+		if (dir == NULL)
+			return (0);
+		if (!ReadOK(tif, dir, dircount * sizeof (TIFFDirEntry))) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+                                  "%.100s: Can not read TIFF directory",
+                                  tif->tif_name);
+			goto bad;
+		}
+	} else {
+		toff_t off = diroff;
+
+		if (off + sizeof (uint16) > tif->tif_size) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Can not read TIFF directory count",
+                            tif->tif_name);
+			return (0);
+		} else
+			_TIFFmemcpy(&dircount, tif->tif_base + off, sizeof (uint16));
+		off += sizeof (uint16);
+		if (tif->tif_flags & TIFF_SWAB)
+			TIFFSwabShort(&dircount);
+		dir = (TIFFDirEntry *)_TIFFCheckMalloc(tif, dircount,
+						       sizeof (TIFFDirEntry),
+					"to read TIFF custom directory");
+		if (dir == NULL)
+			return (0);
+		if (off + dircount * sizeof (TIFFDirEntry) > tif->tif_size) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+                                  "%s: Can not read TIFF directory",
+                                  tif->tif_name);
+			goto bad;
+		} else {
+			_TIFFmemcpy(dir, tif->tif_base + off,
+				    dircount * sizeof (TIFFDirEntry));
+		}
+	}
+
+	TIFFFreeDirectory(tif);
+
+	fix = 0;
+	for (dp = dir, i = dircount; i > 0; i--, dp++) {
+		if (tif->tif_flags & TIFF_SWAB) {
+			TIFFSwabArrayOfShort(&dp->tdir_tag, 2);
+			TIFFSwabArrayOfLong(&dp->tdir_count, 2);
+		}
+
+		if (fix >= tif->tif_nfields || dp->tdir_tag == IGNORE)
+			continue;
+
+		while (fix < tif->tif_nfields &&
+		       tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
+			fix++;
+
+		if (fix >= tif->tif_nfields ||
+		    tif->tif_fieldinfo[fix]->field_tag != dp->tdir_tag) {
+
+			TIFFWarningExt(tif->tif_clientdata, module,
+                        "%s: unknown field with tag %d (0x%x) encountered",
+				    tif->tif_name, dp->tdir_tag, dp->tdir_tag,
+				    dp->tdir_type);
+
+			TIFFMergeFieldInfo(tif,
+					   _TIFFCreateAnonFieldInfo(tif,
+						dp->tdir_tag,
+						(TIFFDataType)dp->tdir_type),
+					   1);
+
+			fix = 0;
+			while (fix < tif->tif_nfields &&
+			       tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
+				fix++;
+		}
+		/*
+		 * Null out old tags that we ignore.
+		 */
+		if (tif->tif_fieldinfo[fix]->field_bit == FIELD_IGNORE) {
+	ignore:
+			dp->tdir_tag = IGNORE;
+			continue;
+		}
+		/*
+		 * Check data type.
+		 */
+		fip = tif->tif_fieldinfo[fix];
+		while (dp->tdir_type != (unsigned short) fip->field_type
+                       && fix < tif->tif_nfields) {
+			if (fip->field_type == TIFF_ANY)	/* wildcard */
+				break;
+                        fip = tif->tif_fieldinfo[++fix];
+			if (fix >= tif->tif_nfields ||
+			    fip->field_tag != dp->tdir_tag) {
+				TIFFWarningExt(tif->tif_clientdata, module,
+			"%s: wrong data type %d for \"%s\"; tag ignored",
+					    tif->tif_name, dp->tdir_type,
+					    tif->tif_fieldinfo[fix-1]->field_name);
+				goto ignore;
+			}
+		}
+		/*
+		 * Check count if known in advance.
+		 */
+		if (fip->field_readcount != TIFF_VARIABLE
+		    && fip->field_readcount != TIFF_VARIABLE2) {
+			uint32 expected = (fip->field_readcount == TIFF_SPP) ?
+			    (uint32) td->td_samplesperpixel :
+			    (uint32) fip->field_readcount;
+			if (!CheckDirCount(tif, dp, expected))
+				goto ignore;
+		}
+
+		(void) TIFFFetchNormalTag(tif, dp);
+	}
+	
+	if (dir)
+		_TIFFfree(dir);
+	return 1;
+
+bad:
+	if (dir)
+		_TIFFfree(dir);
+	return 0;
+}
+
+/*
+ * EXIF is important special case of custom IFD, so we have a special
+ * function to read it.
+ */
+int
+TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff)
+{
+	size_t exifFieldInfoCount;
+	const TIFFFieldInfo *exifFieldInfo =
+		_TIFFGetExifFieldInfo(&exifFieldInfoCount);
+	return TIFFReadCustomDirectory(tif, diroff, exifFieldInfo,
+				       exifFieldInfoCount);
+}
+
+static int
+EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
+{
+	static const char module[] = "EstimateStripByteCounts";
+
+	register TIFFDirEntry *dp;
+	register TIFFDirectory *td = &tif->tif_dir;
+	uint16 i;
+
+	if (td->td_stripbytecount)
+		_TIFFfree(td->td_stripbytecount);
+	td->td_stripbytecount = (uint32*)
+	    _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint32),
+		"for \"StripByteCounts\" array");
+	if (td->td_compression != COMPRESSION_NONE) {
+		uint32 space = (uint32)(sizeof (TIFFHeader)
+		    + sizeof (uint16)
+		    + (dircount * sizeof (TIFFDirEntry))
+		    + sizeof (uint32));
+		toff_t filesize = TIFFGetFileSize(tif);
+		uint16 n;
+
+		/* calculate amount of space used by indirect values */
+		for (dp = dir, n = dircount; n > 0; n--, dp++)
+		{
+			uint32 cc = TIFFDataWidth((TIFFDataType) dp->tdir_type);
+			if (cc == 0) {
+				TIFFErrorExt(tif->tif_clientdata, module,
+			"%s: Cannot determine size of unknown tag type %d",
+					  tif->tif_name, dp->tdir_type);
+				return -1;
+			}
+			cc = cc * dp->tdir_count;
+			if (cc > sizeof (uint32))
+				space += cc;
+		}
+		space = filesize - space;
+		if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
+			space /= td->td_samplesperpixel;
+		for (i = 0; i < td->td_nstrips; i++)
+			td->td_stripbytecount[i] = space;
+		/*
+		 * This gross hack handles the case were the offset to
+		 * the last strip is past the place where we think the strip
+		 * should begin.  Since a strip of data must be contiguous,
+		 * it's safe to assume that we've overestimated the amount
+		 * of data in the strip and trim this number back accordingly.
+		 */ 
+		i--;
+		if (((toff_t)(td->td_stripoffset[i]+td->td_stripbytecount[i]))
+                                                               > filesize)
+			td->td_stripbytecount[i] =
+			    filesize - td->td_stripoffset[i];
+	} else {
+		uint32 rowbytes = TIFFScanlineSize(tif);
+		uint32 rowsperstrip = td->td_imagelength/td->td_stripsperimage;
+		for (i = 0; i < td->td_nstrips; i++)
+			td->td_stripbytecount[i] = rowbytes*rowsperstrip;
+	}
+	TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS);
+	if (!TIFFFieldSet(tif, FIELD_ROWSPERSTRIP))
+		td->td_rowsperstrip = td->td_imagelength;
+	return 1;
+}
+
+static void
+MissingRequired(TIFF* tif, const char* tagname)
+{
+	static const char module[] = "MissingRequired";
+
+	TIFFErrorExt(tif->tif_clientdata, module,
+		  "%s: TIFF directory is missing required \"%s\" field",
+		  tif->tif_name, tagname);
+}
+
+/*
+ * Check the count field of a directory
+ * entry against a known value.  The caller
+ * is expected to skip/ignore the tag if
+ * there is a mismatch.
+ */
+static int
+CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count)
+{
+	if (count > dir->tdir_count) {
+		TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+	"incorrect count for field \"%s\" (%lu, expecting %lu); tag ignored",
+		    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
+		    dir->tdir_count, count);
+		return (0);
+	} else if (count < dir->tdir_count) {
+		TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+	"incorrect count for field \"%s\" (%lu, expecting %lu); tag trimmed",
+		    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
+		    dir->tdir_count, count);
+		return (1);
+	}
+	return (1);
+}
+
+/*
+ * Fetch a contiguous directory item.
+ */
+static tsize_t
+TIFFFetchData(TIFF* tif, TIFFDirEntry* dir, char* cp)
+{
+	int w = TIFFDataWidth((TIFFDataType) dir->tdir_type);
+	tsize_t cc = dir->tdir_count * w;
+
+	/* Check for overflow. */
+	if (!dir->tdir_count || !w || cc / w != (tsize_t)dir->tdir_count)
+		goto bad;
+
+	if (!isMapped(tif)) {
+		if (!SeekOK(tif, dir->tdir_offset))
+			goto bad;
+		if (!ReadOK(tif, cp, cc))
+			goto bad;
+	} else {
+		/* Check for overflow. */
+		if ((tsize_t)dir->tdir_offset + cc < (tsize_t)dir->tdir_offset
+		    || (tsize_t)dir->tdir_offset + cc < cc
+		    || (tsize_t)dir->tdir_offset + cc > (tsize_t)tif->tif_size)
+			goto bad;
+		_TIFFmemcpy(cp, tif->tif_base + dir->tdir_offset, cc);
+	}
+	if (tif->tif_flags & TIFF_SWAB) {
+		switch (dir->tdir_type) {
+		case TIFF_SHORT:
+		case TIFF_SSHORT:
+			TIFFSwabArrayOfShort((uint16*) cp, dir->tdir_count);
+			break;
+		case TIFF_LONG:
+		case TIFF_SLONG:
+		case TIFF_FLOAT:
+			TIFFSwabArrayOfLong((uint32*) cp, dir->tdir_count);
+			break;
+		case TIFF_RATIONAL:
+		case TIFF_SRATIONAL:
+			TIFFSwabArrayOfLong((uint32*) cp, 2*dir->tdir_count);
+			break;
+		case TIFF_DOUBLE:
+			TIFFSwabArrayOfDouble((double*) cp, dir->tdir_count);
+			break;
+		}
+	}
+	return (cc);
+bad:
+	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		     "Error fetching data for field \"%s\"",
+		     _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
+	return (tsize_t) 0;
+}
+
+/*
+ * Fetch an ASCII item from the file.
+ */
+static tsize_t
+TIFFFetchString(TIFF* tif, TIFFDirEntry* dir, char* cp)
+{
+	if (dir->tdir_count <= 4) {
+		uint32 l = dir->tdir_offset;
+		if (tif->tif_flags & TIFF_SWAB)
+			TIFFSwabLong(&l);
+		_TIFFmemcpy(cp, &l, dir->tdir_count);
+		return (1);
+	}
+	return (TIFFFetchData(tif, dir, cp));
+}
+
+/*
+ * Convert numerator+denominator to float.
+ */
+static int
+cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv)
+{
+	if (denom == 0) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "%s: Rational with zero denominator (num = %lu)",
+		    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, num);
+		return (0);
+	} else {
+		if (dir->tdir_type == TIFF_RATIONAL)
+			*rv = ((float)num / (float)denom);
+		else
+			*rv = ((float)(int32)num / (float)(int32)denom);
+		return (1);
+	}
+}
+
+/*
+ * Fetch a rational item from the file
+ * at offset off and return the value
+ * as a floating point number.
+ */
+static float
+TIFFFetchRational(TIFF* tif, TIFFDirEntry* dir)
+{
+	uint32 l[2];
+	float v;
+
+	return (!TIFFFetchData(tif, dir, (char *)l) ||
+	    !cvtRational(tif, dir, l[0], l[1], &v) ? 1.0f : v);
+}
+
+/*
+ * Fetch a single floating point value
+ * from the offset field and return it
+ * as a native float.
+ */
+static float
+TIFFFetchFloat(TIFF* tif, TIFFDirEntry* dir)
+{
+	float v;
+	int32 l = TIFFExtractData(tif, dir->tdir_type, dir->tdir_offset);
+        _TIFFmemcpy(&v, &l, sizeof(float));
+	TIFFCvtIEEEFloatToNative(tif, 1, &v);
+	return (v);
+}
+
+/*
+ * Fetch an array of BYTE or SBYTE values.
+ */
+static int
+TIFFFetchByteArray(TIFF* tif, TIFFDirEntry* dir, uint8* v)
+{
+    if (dir->tdir_count <= 4) {
+        /*
+         * Extract data from offset field.
+         */
+        if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) {
+	    if (dir->tdir_type == TIFF_SBYTE)
+                switch (dir->tdir_count) {
+                    case 4: v[3] = dir->tdir_offset & 0xff;
+                    case 3: v[2] = (dir->tdir_offset >> 8) & 0xff;
+                    case 2: v[1] = (dir->tdir_offset >> 16) & 0xff;
+		    case 1: v[0] = dir->tdir_offset >> 24;
+                }
+	    else
+                switch (dir->tdir_count) {
+                    case 4: v[3] = dir->tdir_offset & 0xff;
+                    case 3: v[2] = (dir->tdir_offset >> 8) & 0xff;
+                    case 2: v[1] = (dir->tdir_offset >> 16) & 0xff;
+		    case 1: v[0] = dir->tdir_offset >> 24;
+                }
+	} else {
+	    if (dir->tdir_type == TIFF_SBYTE)
+                switch (dir->tdir_count) {
+                    case 4: v[3] = dir->tdir_offset >> 24;
+                    case 3: v[2] = (dir->tdir_offset >> 16) & 0xff;
+                    case 2: v[1] = (dir->tdir_offset >> 8) & 0xff;
+                    case 1: v[0] = dir->tdir_offset & 0xff;
+		}
+	    else
+                switch (dir->tdir_count) {
+                    case 4: v[3] = dir->tdir_offset >> 24;
+                    case 3: v[2] = (dir->tdir_offset >> 16) & 0xff;
+                    case 2: v[1] = (dir->tdir_offset >> 8) & 0xff;
+                    case 1: v[0] = dir->tdir_offset & 0xff;
+		}
+	}
+        return (1);
+    } else
+        return (TIFFFetchData(tif, dir, (char*) v) != 0);	/* XXX */
+}
+
+/*
+ * Fetch an array of SHORT or SSHORT values.
+ */
+static int
+TIFFFetchShortArray(TIFF* tif, TIFFDirEntry* dir, uint16* v)
+{
+	if (dir->tdir_count <= 2) {
+		if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) {
+			switch (dir->tdir_count) {
+			case 2: v[1] = (uint16) (dir->tdir_offset & 0xffff);
+			case 1: v[0] = (uint16) (dir->tdir_offset >> 16);
+			}
+		} else {
+			switch (dir->tdir_count) {
+			case 2: v[1] = (uint16) (dir->tdir_offset >> 16);
+			case 1: v[0] = (uint16) (dir->tdir_offset & 0xffff);
+			}
+		}
+		return (1);
+	} else
+		return (TIFFFetchData(tif, dir, (char *)v) != 0);
+}
+
+/*
+ * Fetch a pair of SHORT or BYTE values. Some tags may have either BYTE
+ * or SHORT type and this function works with both ones.
+ */
+static int
+TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir)
+{
+	switch (dir->tdir_type) {
+		case TIFF_BYTE:
+		case TIFF_SBYTE:
+			{
+			uint8 v[4];
+			return TIFFFetchByteArray(tif, dir, v)
+				&& TIFFSetField(tif, dir->tdir_tag, v[0], v[1]);
+			}
+		case TIFF_SHORT:
+		case TIFF_SSHORT:
+			{
+			uint16 v[2];
+			return TIFFFetchShortArray(tif, dir, v)
+				&& TIFFSetField(tif, dir->tdir_tag, v[0], v[1]);
+			}
+		default:
+			return 0;
+	}
+}
+
+/*
+ * Fetch an array of LONG or SLONG values.
+ */
+static int
+TIFFFetchLongArray(TIFF* tif, TIFFDirEntry* dir, uint32* v)
+{
+	if (dir->tdir_count == 1) {
+		v[0] = dir->tdir_offset;
+		return (1);
+	} else
+		return (TIFFFetchData(tif, dir, (char*) v) != 0);
+}
+
+/*
+ * Fetch an array of RATIONAL or SRATIONAL values.
+ */
+static int
+TIFFFetchRationalArray(TIFF* tif, TIFFDirEntry* dir, float* v)
+{
+	int ok = 0;
+	uint32* l;
+
+	l = (uint32*)_TIFFCheckMalloc(tif,
+	    dir->tdir_count, TIFFDataWidth((TIFFDataType) dir->tdir_type),
+	    "to fetch array of rationals");
+	if (l) {
+		if (TIFFFetchData(tif, dir, (char *)l)) {
+			uint32 i;
+			for (i = 0; i < dir->tdir_count; i++) {
+				ok = cvtRational(tif, dir,
+				    l[2*i+0], l[2*i+1], &v[i]);
+				if (!ok)
+					break;
+			}
+		}
+		_TIFFfree((char *)l);
+	}
+	return (ok);
+}
+
+/*
+ * Fetch an array of FLOAT values.
+ */
+static int
+TIFFFetchFloatArray(TIFF* tif, TIFFDirEntry* dir, float* v)
+{
+
+	if (dir->tdir_count == 1) {
+		v[0] = *(float*) &dir->tdir_offset;
+		TIFFCvtIEEEFloatToNative(tif, dir->tdir_count, v);
+		return (1);
+	} else	if (TIFFFetchData(tif, dir, (char*) v)) {
+		TIFFCvtIEEEFloatToNative(tif, dir->tdir_count, v);
+		return (1);
+	} else
+		return (0);
+}
+
+/*
+ * Fetch an array of DOUBLE values.
+ */
+static int
+TIFFFetchDoubleArray(TIFF* tif, TIFFDirEntry* dir, double* v)
+{
+	if (TIFFFetchData(tif, dir, (char*) v)) {
+		TIFFCvtIEEEDoubleToNative(tif, dir->tdir_count, v);
+		return (1);
+	} else
+		return (0);
+}
+
+/*
+ * Fetch an array of ANY values.  The actual values are
+ * returned as doubles which should be able hold all the
+ * types.  Yes, there really should be an tany_t to avoid
+ * this potential non-portability ...  Note in particular
+ * that we assume that the double return value vector is
+ * large enough to read in any fundamental type.  We use
+ * that vector as a buffer to read in the base type vector
+ * and then convert it in place to double (from end
+ * to front of course).
+ */
+static int
+TIFFFetchAnyArray(TIFF* tif, TIFFDirEntry* dir, double* v)
+{
+	int i;
+
+	switch (dir->tdir_type) {
+	case TIFF_BYTE:
+	case TIFF_SBYTE:
+		if (!TIFFFetchByteArray(tif, dir, (uint8*) v))
+			return (0);
+		if (dir->tdir_type == TIFF_BYTE) {
+			uint8* vp = (uint8*) v;
+			for (i = dir->tdir_count-1; i >= 0; i--)
+				v[i] = vp[i];
+		} else {
+			int8* vp = (int8*) v;
+			for (i = dir->tdir_count-1; i >= 0; i--)
+				v[i] = vp[i];
+		}
+		break;
+	case TIFF_SHORT:
+	case TIFF_SSHORT:
+		if (!TIFFFetchShortArray(tif, dir, (uint16*) v))
+			return (0);
+		if (dir->tdir_type == TIFF_SHORT) {
+			uint16* vp = (uint16*) v;
+			for (i = dir->tdir_count-1; i >= 0; i--)
+				v[i] = vp[i];
+		} else {
+			int16* vp = (int16*) v;
+			for (i = dir->tdir_count-1; i >= 0; i--)
+				v[i] = vp[i];
+		}
+		break;
+	case TIFF_LONG:
+	case TIFF_SLONG:
+		if (!TIFFFetchLongArray(tif, dir, (uint32*) v))
+			return (0);
+		if (dir->tdir_type == TIFF_LONG) {
+			uint32* vp = (uint32*) v;
+			for (i = dir->tdir_count-1; i >= 0; i--)
+				v[i] = vp[i];
+		} else {
+			int32* vp = (int32*) v;
+			for (i = dir->tdir_count-1; i >= 0; i--)
+				v[i] = vp[i];
+		}
+		break;
+	case TIFF_RATIONAL:
+	case TIFF_SRATIONAL:
+		if (!TIFFFetchRationalArray(tif, dir, (float*) v))
+			return (0);
+		{ float* vp = (float*) v;
+		  for (i = dir->tdir_count-1; i >= 0; i--)
+			v[i] = vp[i];
+		}
+		break;
+	case TIFF_FLOAT:
+		if (!TIFFFetchFloatArray(tif, dir, (float*) v))
+			return (0);
+		{ float* vp = (float*) v;
+		  for (i = dir->tdir_count-1; i >= 0; i--)
+			v[i] = vp[i];
+		}
+		break;
+	case TIFF_DOUBLE:
+		return (TIFFFetchDoubleArray(tif, dir, (double*) v));
+	default:
+		/* TIFF_NOTYPE */
+		/* TIFF_ASCII */
+		/* TIFF_UNDEFINED */
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			     "cannot read TIFF_ANY type %d for field \"%s\"",
+			     dir->tdir_type,
+			     _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
+		return (0);
+	}
+	return (1);
+}
+
+/*
+ * Fetch a tag that is not handled by special case code.
+ */
+static int
+TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
+{
+	static const char mesg[] = "to fetch tag value";
+	int ok = 0;
+	const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dp->tdir_tag);
+
+	if (dp->tdir_count > 1) {		/* array of values */
+		char* cp = NULL;
+
+		switch (dp->tdir_type) {
+		case TIFF_BYTE:
+		case TIFF_SBYTE:
+			cp = (char *)_TIFFCheckMalloc(tif,
+			    dp->tdir_count, sizeof (uint8), mesg);
+			ok = cp && TIFFFetchByteArray(tif, dp, (uint8*) cp);
+			break;
+		case TIFF_SHORT:
+		case TIFF_SSHORT:
+			cp = (char *)_TIFFCheckMalloc(tif,
+			    dp->tdir_count, sizeof (uint16), mesg);
+			ok = cp && TIFFFetchShortArray(tif, dp, (uint16*) cp);
+			break;
+		case TIFF_LONG:
+		case TIFF_SLONG:
+			cp = (char *)_TIFFCheckMalloc(tif,
+			    dp->tdir_count, sizeof (uint32), mesg);
+			ok = cp && TIFFFetchLongArray(tif, dp, (uint32*) cp);
+			break;
+		case TIFF_RATIONAL:
+		case TIFF_SRATIONAL:
+			cp = (char *)_TIFFCheckMalloc(tif,
+			    dp->tdir_count, sizeof (float), mesg);
+			ok = cp && TIFFFetchRationalArray(tif, dp, (float*) cp);
+			break;
+		case TIFF_FLOAT:
+			cp = (char *)_TIFFCheckMalloc(tif,
+			    dp->tdir_count, sizeof (float), mesg);
+			ok = cp && TIFFFetchFloatArray(tif, dp, (float*) cp);
+			break;
+		case TIFF_DOUBLE:
+			cp = (char *)_TIFFCheckMalloc(tif,
+			    dp->tdir_count, sizeof (double), mesg);
+			ok = cp && TIFFFetchDoubleArray(tif, dp, (double*) cp);
+			break;
+		case TIFF_ASCII:
+		case TIFF_UNDEFINED:		/* bit of a cheat... */
+			/*
+			 * Some vendors write strings w/o the trailing
+			 * NULL byte, so always append one just in case.
+			 */
+			cp = (char *)_TIFFCheckMalloc(tif, dp->tdir_count + 1,
+						      1, mesg);
+			if( (ok = (cp && TIFFFetchString(tif, dp, cp))) != 0 )
+				cp[dp->tdir_count] = '\0';	/* XXX */
+			break;
+		}
+		if (ok) {
+			ok = (fip->field_passcount ?
+			    TIFFSetField(tif, dp->tdir_tag, dp->tdir_count, cp)
+			  : TIFFSetField(tif, dp->tdir_tag, cp));
+		}
+		if (cp != NULL)
+			_TIFFfree(cp);
+	} else if (CheckDirCount(tif, dp, 1)) {	/* singleton value */
+		switch (dp->tdir_type) {
+		case TIFF_BYTE:
+		case TIFF_SBYTE:
+		case TIFF_SHORT:
+		case TIFF_SSHORT:
+			/*
+			 * If the tag is also acceptable as a LONG or SLONG
+			 * then TIFFSetField will expect an uint32 parameter
+			 * passed to it (through varargs).  Thus, for machines
+			 * where sizeof (int) != sizeof (uint32) we must do
+			 * a careful check here.  It's hard to say if this
+			 * is worth optimizing.
+			 *
+			 * NB: We use TIFFFieldWithTag here knowing that
+			 *     it returns us the first entry in the table
+			 *     for the tag and that that entry is for the
+			 *     widest potential data type the tag may have.
+			 */
+			{ TIFFDataType type = fip->field_type;
+			  if (type != TIFF_LONG && type != TIFF_SLONG) {
+				uint16 v = (uint16)
+			   TIFFExtractData(tif, dp->tdir_type, dp->tdir_offset);
+				ok = (fip->field_passcount ?
+				    TIFFSetField(tif, dp->tdir_tag, 1, &v)
+				  : TIFFSetField(tif, dp->tdir_tag, v));
+				break;
+			  }
+			}
+			/* fall thru... */
+		case TIFF_LONG:
+		case TIFF_SLONG:
+			{ uint32 v32 =
+		    TIFFExtractData(tif, dp->tdir_type, dp->tdir_offset);
+			  ok = (fip->field_passcount ? 
+			      TIFFSetField(tif, dp->tdir_tag, 1, &v32)
+			    : TIFFSetField(tif, dp->tdir_tag, v32));
+			}
+			break;
+		case TIFF_RATIONAL:
+		case TIFF_SRATIONAL:
+		case TIFF_FLOAT:
+			{ float v = (dp->tdir_type == TIFF_FLOAT ? 
+			      TIFFFetchFloat(tif, dp)
+			    : TIFFFetchRational(tif, dp));
+			  ok = (fip->field_passcount ?
+			      TIFFSetField(tif, dp->tdir_tag, 1, &v)
+			    : TIFFSetField(tif, dp->tdir_tag, v));
+			}
+			break;
+		case TIFF_DOUBLE:
+			{ double v;
+			  ok = (TIFFFetchDoubleArray(tif, dp, &v) &&
+			    (fip->field_passcount ?
+			      TIFFSetField(tif, dp->tdir_tag, 1, &v)
+			    : TIFFSetField(tif, dp->tdir_tag, v))
+			  );
+			}
+			break;
+		case TIFF_ASCII:
+		case TIFF_UNDEFINED:		/* bit of a cheat... */
+			{ char c[2];
+			  if( (ok = (TIFFFetchString(tif, dp, c) != 0)) != 0 ) {
+				c[1] = '\0';		/* XXX paranoid */
+				ok = (fip->field_passcount ?
+					TIFFSetField(tif, dp->tdir_tag, 1, c)
+				      : TIFFSetField(tif, dp->tdir_tag, c));
+			  }
+			}
+			break;
+		}
+	}
+	return (ok);
+}
+
+#define	NITEMS(x)	(sizeof (x) / sizeof (x[0]))
+/*
+ * Fetch samples/pixel short values for 
+ * the specified tag and verify that
+ * all values are the same.
+ */
+static int
+TIFFFetchPerSampleShorts(TIFF* tif, TIFFDirEntry* dir, uint16* pl)
+{
+    uint16 samples = tif->tif_dir.td_samplesperpixel;
+    int status = 0;
+
+    if (CheckDirCount(tif, dir, (uint32) samples)) {
+        uint16 buf[10];
+        uint16* v = buf;
+
+        if (dir->tdir_count > NITEMS(buf))
+            v = (uint16*) _TIFFCheckMalloc(tif, dir->tdir_count, sizeof(uint16),
+                                      "to fetch per-sample values");
+        if (v && TIFFFetchShortArray(tif, dir, v)) {
+            uint16 i;
+            int check_count = dir->tdir_count;
+            if( samples < check_count )
+                check_count = samples;
+
+            for (i = 1; i < check_count; i++)
+                if (v[i] != v[0]) {
+					TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+                              "Cannot handle different per-sample values for field \"%s\"",
+                              _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
+                    goto bad;
+                }
+            *pl = v[0];
+            status = 1;
+        }
+      bad:
+        if (v && v != buf)
+            _TIFFfree(v);
+    }
+    return (status);
+}
+
+/*
+ * Fetch samples/pixel long values for 
+ * the specified tag and verify that
+ * all values are the same.
+ */
+static int
+TIFFFetchPerSampleLongs(TIFF* tif, TIFFDirEntry* dir, uint32* pl)
+{
+    uint16 samples = tif->tif_dir.td_samplesperpixel;
+    int status = 0;
+
+    if (CheckDirCount(tif, dir, (uint32) samples)) {
+        uint32 buf[10];
+        uint32* v = buf;
+
+        if (dir->tdir_count > NITEMS(buf))
+            v = (uint32*) _TIFFCheckMalloc(tif, dir->tdir_count, sizeof(uint32),
+                                      "to fetch per-sample values");
+        if (v && TIFFFetchLongArray(tif, dir, v)) {
+            uint16 i;
+            int check_count = dir->tdir_count;
+
+            if( samples < check_count )
+                check_count = samples;
+            for (i = 1; i < check_count; i++)
+                if (v[i] != v[0]) {
+					TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+                              "Cannot handle different per-sample values for field \"%s\"",
+                              _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
+                    goto bad;
+                }
+            *pl = v[0];
+            status = 1;
+        }
+      bad:
+        if (v && v != buf)
+            _TIFFfree(v);
+    }
+    return (status);
+}
+
+/*
+ * Fetch samples/pixel ANY values for the specified tag and verify that all
+ * values are the same.
+ */
+static int
+TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl)
+{
+    uint16 samples = tif->tif_dir.td_samplesperpixel;
+    int status = 0;
+
+    if (CheckDirCount(tif, dir, (uint32) samples)) {
+        double buf[10];
+        double* v = buf;
+
+        if (dir->tdir_count > NITEMS(buf))
+            v = (double*) _TIFFCheckMalloc(tif, dir->tdir_count, sizeof (double),
+                                      "to fetch per-sample values");
+        if (v && TIFFFetchAnyArray(tif, dir, v)) {
+            uint16 i;
+            int check_count = dir->tdir_count;
+            if( samples < check_count )
+                check_count = samples;
+
+            for (i = 1; i < check_count; i++)
+                if (v[i] != v[0]) {
+                    TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+                              "Cannot handle different per-sample values for field \"%s\"",
+                              _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
+                    goto bad;
+                }
+            *pl = v[0];
+            status = 1;
+        }
+      bad:
+        if (v && v != buf)
+            _TIFFfree(v);
+    }
+    return (status);
+}
+#undef NITEMS
+
+/*
+ * Fetch a set of offsets or lengths.
+ * While this routine says "strips", in fact it's also used for tiles.
+ */
+static int
+TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp)
+{
+	register uint32* lp;
+	int status;
+
+        CheckDirCount(tif, dir, (uint32) nstrips);
+
+	/*
+	 * Allocate space for strip information.
+	 */
+	if (*lpp == NULL &&
+	    (*lpp = (uint32 *)_TIFFCheckMalloc(tif,
+	      nstrips, sizeof (uint32), "for strip array")) == NULL)
+		return (0);
+	lp = *lpp;
+        _TIFFmemset( lp, 0, sizeof(uint32) * nstrips );
+
+	if (dir->tdir_type == (int)TIFF_SHORT) {
+		/*
+		 * Handle uint16->uint32 expansion.
+		 */
+		uint16* dp = (uint16*) _TIFFCheckMalloc(tif,
+		    dir->tdir_count, sizeof (uint16), "to fetch strip tag");
+		if (dp == NULL)
+			return (0);
+		if( (status = TIFFFetchShortArray(tif, dir, dp)) != 0 ) {
+                    int i;
+                    
+                    for( i = 0; i < nstrips && i < (int) dir->tdir_count; i++ )
+                    {
+                        lp[i] = dp[i];
+                    }
+		}
+		_TIFFfree((char*) dp);
+
+        } else if( nstrips != (int) dir->tdir_count ) {
+            /* Special case to correct length */
+
+            uint32* dp = (uint32*) _TIFFCheckMalloc(tif,
+		    dir->tdir_count, sizeof (uint32), "to fetch strip tag");
+            if (dp == NULL)
+                return (0);
+
+            status = TIFFFetchLongArray(tif, dir, dp);
+            if( status != 0 ) {
+                int i;
+
+                for( i = 0; i < nstrips && i < (int) dir->tdir_count; i++ )
+                {
+                    lp[i] = dp[i];
+                }
+            }
+
+            _TIFFfree( (char *) dp );
+	} else
+            status = TIFFFetchLongArray(tif, dir, lp);
+        
+	return (status);
+}
+
+/*
+ * Fetch and set the RefBlackWhite tag.
+ */
+static int
+TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir)
+{
+	static const char mesg[] = "for \"ReferenceBlackWhite\" array";
+	char* cp;
+	int ok;
+
+	if (dir->tdir_type == TIFF_RATIONAL)
+		return (TIFFFetchNormalTag(tif, dir));
+	/*
+	 * Handle LONG's for backward compatibility.
+	 */
+	cp = (char *)_TIFFCheckMalloc(tif, dir->tdir_count,
+				      sizeof (uint32), mesg);
+	if( (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32*) cp))) != 0) {
+		float* fp = (float*)
+		    _TIFFCheckMalloc(tif, dir->tdir_count, sizeof (float), mesg);
+		if( (ok = (fp != NULL)) != 0 ) {
+			uint32 i;
+			for (i = 0; i < dir->tdir_count; i++)
+				fp[i] = (float)((uint32*) cp)[i];
+			ok = TIFFSetField(tif, dir->tdir_tag, fp);
+			_TIFFfree((char*) fp);
+		}
+	}
+	if (cp)
+		_TIFFfree(cp);
+	return (ok);
+}
+
+/*
+ * Replace a single strip (tile) of uncompressed data by
+ * multiple strips (tiles), each approximately 8Kbytes.
+ * This is useful for dealing with large images or
+ * for dealing with machines with a limited amount
+ * memory.
+ */
+static void
+ChopUpSingleUncompressedStrip(TIFF* tif)
+{
+	register TIFFDirectory *td = &tif->tif_dir;
+	uint32 bytecount = td->td_stripbytecount[0];
+	uint32 offset = td->td_stripoffset[0];
+	tsize_t rowbytes = TIFFVTileSize(tif, 1), stripbytes;
+	tstrip_t strip, nstrips, rowsperstrip;
+	uint32* newcounts;
+	uint32* newoffsets;
+
+	/*
+	 * Make the rows hold at least one scanline, but fill specified amount
+	 * of data if possible.
+	 */
+	if (rowbytes > STRIP_SIZE_DEFAULT) {
+		stripbytes = rowbytes;
+		rowsperstrip = 1;
+	} else if (rowbytes > 0 ) {
+		rowsperstrip = STRIP_SIZE_DEFAULT / rowbytes;
+		stripbytes = rowbytes * rowsperstrip;
+	}
+        else
+            return;
+
+	/* 
+	 * never increase the number of strips in an image
+	 */
+	if (rowsperstrip >= td->td_rowsperstrip)
+		return;
+	nstrips = (tstrip_t) TIFFhowmany(bytecount, stripbytes);
+        if( nstrips == 0 ) /* something is wonky, do nothing. */
+            return;
+
+	newcounts = (uint32*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint32),
+				"for chopped \"StripByteCounts\" array");
+	newoffsets = (uint32*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint32),
+				"for chopped \"StripOffsets\" array");
+	if (newcounts == NULL || newoffsets == NULL) {
+	        /*
+		 * Unable to allocate new strip information, give
+		 * up and use the original one strip information.
+		 */
+		if (newcounts != NULL)
+			_TIFFfree(newcounts);
+		if (newoffsets != NULL)
+			_TIFFfree(newoffsets);
+		return;
+	}
+	/*
+	 * Fill the strip information arrays with new bytecounts and offsets
+	 * that reflect the broken-up format.
+	 */
+	for (strip = 0; strip < nstrips; strip++) {
+		if (stripbytes > (tsize_t) bytecount)
+			stripbytes = bytecount;
+		newcounts[strip] = stripbytes;
+		newoffsets[strip] = offset;
+		offset += stripbytes;
+		bytecount -= stripbytes;
+	}
+	/*
+	 * Replace old single strip info with multi-strip info.
+	 */
+	td->td_stripsperimage = td->td_nstrips = nstrips;
+	TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
+
+	_TIFFfree(td->td_stripbytecount);
+	_TIFFfree(td->td_stripoffset);
+	td->td_stripbytecount = newcounts;
+	td->td_stripoffset = newoffsets;
+	td->td_stripbytecountsorted = 1;
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_dirwrite.c b/src/tiff/tif_dirwrite.c
new file mode 100644
index 0000000..928a862
--- /dev/null
+++ b/src/tiff/tif_dirwrite.c
@@ -0,0 +1,1243 @@
+/* $Id: tif_dirwrite.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Directory Write Support Routines.
+ */
+#include "tiffiop.h"
+
+#ifdef HAVE_IEEEFP
+# define	TIFFCvtNativeToIEEEFloat(tif, n, fp)
+# define	TIFFCvtNativeToIEEEDouble(tif, n, dp)
+#else
+extern	void TIFFCvtNativeToIEEEFloat(TIFF*, uint32, float*);
+extern	void TIFFCvtNativeToIEEEDouble(TIFF*, uint32, double*);
+#endif
+
+static	int TIFFWriteNormalTag(TIFF*, TIFFDirEntry*, const TIFFFieldInfo*);
+static	void TIFFSetupShortLong(TIFF*, ttag_t, TIFFDirEntry*, uint32);
+static	void TIFFSetupShort(TIFF*, ttag_t, TIFFDirEntry*, uint16);
+static	int TIFFSetupShortPair(TIFF*, ttag_t, TIFFDirEntry*);
+static	int TIFFWritePerSampleShorts(TIFF*, ttag_t, TIFFDirEntry*);
+static	int TIFFWritePerSampleAnys(TIFF*, TIFFDataType, ttag_t, TIFFDirEntry*);
+static	int TIFFWriteShortTable(TIFF*, ttag_t, TIFFDirEntry*, uint32, uint16**);
+static	int TIFFWriteShortArray(TIFF*, TIFFDirEntry*, uint16*);
+static	int TIFFWriteLongArray(TIFF *, TIFFDirEntry*, uint32*);
+static	int TIFFWriteRationalArray(TIFF *, TIFFDirEntry*, float*);
+static	int TIFFWriteFloatArray(TIFF *, TIFFDirEntry*, float*);
+static	int TIFFWriteDoubleArray(TIFF *, TIFFDirEntry*, double*);
+static	int TIFFWriteByteArray(TIFF*, TIFFDirEntry*, char*);
+static	int TIFFWriteAnyArray(TIFF*,
+	    TIFFDataType, ttag_t, TIFFDirEntry*, uint32, double*);
+static	int TIFFWriteTransferFunction(TIFF*, TIFFDirEntry*);
+static	int TIFFWriteInkNames(TIFF*, TIFFDirEntry*);
+static	int TIFFWriteData(TIFF*, TIFFDirEntry*, char*);
+static	int TIFFLinkDirectory(TIFF*);
+
+#define	WriteRationalPair(type, tag1, v1, tag2, v2) {		\
+	TIFFWriteRational((tif), (type), (tag1), (dir), (v1))	\
+	TIFFWriteRational((tif), (type), (tag2), (dir)+1, (v2))	\
+	(dir)++;						\
+}
+#define	TIFFWriteRational(tif, type, tag, dir, v)		\
+	(dir)->tdir_tag = (tag);				\
+	(dir)->tdir_type = (type);				\
+	(dir)->tdir_count = 1;					\
+	if (!TIFFWriteRationalArray((tif), (dir), &(v)))	\
+		goto bad;
+
+/*
+ * Write the contents of the current directory
+ * to the specified file.  This routine doesn't
+ * handle overwriting a directory with auxiliary
+ * storage that's been changed.
+ */
+static int
+_TIFFWriteDirectory(TIFF* tif, int done)
+{
+	uint16 dircount;
+	toff_t diroff;
+	ttag_t tag;
+	uint32 nfields;
+	tsize_t dirsize;
+	char* data;
+	TIFFDirEntry* dir;
+	TIFFDirectory* td;
+	unsigned long b, fields[FIELD_SETLONGS];
+	int fi, nfi;
+
+	if (tif->tif_mode == O_RDONLY)
+		return (1);
+	/*
+	 * Clear write state so that subsequent images with
+	 * different characteristics get the right buffers
+	 * setup for them.
+	 */
+	if (done)
+	{
+	    if (tif->tif_flags & TIFF_POSTENCODE) {
+		    tif->tif_flags &= ~TIFF_POSTENCODE;
+		    if (!(*tif->tif_postencode)(tif)) {
+				TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+				"Error post-encoding before directory write");
+			    return (0);
+		    }
+	    }
+	    (*tif->tif_close)(tif);		/* shutdown encoder */
+	    /*
+	     * Flush any data that might have been written
+	     * by the compression close+cleanup routines.
+	     */
+	    if (tif->tif_rawcc > 0 && !TIFFFlushData1(tif)) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			"Error flushing data before directory write");
+		    return (0);
+	    }
+	    if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) {
+		    _TIFFfree(tif->tif_rawdata);
+		    tif->tif_rawdata = NULL;
+		    tif->tif_rawcc = 0;
+		    tif->tif_rawdatasize = 0;
+	    }
+	    tif->tif_flags &= ~(TIFF_BEENWRITING|TIFF_BUFFERSETUP);
+	}
+
+	td = &tif->tif_dir;
+	/*
+	 * Size the directory so that we can calculate
+	 * offsets for the data items that aren't kept
+	 * in-place in each field.
+	 */
+	nfields = 0;
+	for (b = 0; b <= FIELD_LAST; b++)
+		if (TIFFFieldSet(tif, b) && b != FIELD_CUSTOM)
+			nfields += (b < FIELD_SUBFILETYPE ? 2 : 1);
+        nfields += td->td_customValueCount;
+	dirsize = nfields * sizeof (TIFFDirEntry);
+	data = (char*) _TIFFmalloc(dirsize);
+	if (data == NULL) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "Cannot write directory, out of space");
+		return (0);
+	}
+	/*
+	 * Directory hasn't been placed yet, put
+	 * it at the end of the file and link it
+	 * into the existing directory structure.
+	 */
+	if (tif->tif_diroff == 0 && !TIFFLinkDirectory(tif))
+		goto bad;
+	tif->tif_dataoff = (toff_t)(
+	    tif->tif_diroff + sizeof (uint16) + dirsize + sizeof (toff_t));
+	if (tif->tif_dataoff & 1)
+		tif->tif_dataoff++;
+	(void) TIFFSeekFile(tif, tif->tif_dataoff, SEEK_SET);
+	tif->tif_curdir++;
+	dir = (TIFFDirEntry*) data;
+	/*
+	 * Setup external form of directory
+	 * entries and write data items.
+	 */
+	_TIFFmemcpy(fields, td->td_fieldsset, sizeof (fields));
+	/*
+	 * Write out ExtraSamples tag only if
+	 * extra samples are present in the data.
+	 */
+	if (FieldSet(fields, FIELD_EXTRASAMPLES) && !td->td_extrasamples) {
+		ResetFieldBit(fields, FIELD_EXTRASAMPLES);
+		nfields--;
+		dirsize -= sizeof (TIFFDirEntry);
+	}								/*XXX*/
+	for (fi = 0, nfi = tif->tif_nfields; nfi > 0; nfi--, fi++) {
+		const TIFFFieldInfo* fip = tif->tif_fieldinfo[fi];
+
+                /*
+                ** For custom fields, we test to see if the custom field
+                ** is set or not.  For normal fields, we just use the
+                ** FieldSet test. 
+                */
+                if( fip->field_bit == FIELD_CUSTOM )
+                {
+                    int ci, is_set = FALSE;
+
+                    for( ci = 0; ci < td->td_customValueCount; ci++ )
+                        is_set |= (td->td_customValues[ci].info == fip);
+
+                    if( !is_set )
+                        continue;
+                }
+		else if (!FieldSet(fields, fip->field_bit))
+                    continue;
+
+
+                /*
+                ** Handle other fields.
+                */
+		switch (fip->field_bit)
+                {
+		case FIELD_STRIPOFFSETS:
+			/*
+			 * We use one field bit for both strip and tile
+
+			 * offsets, and so must be careful in selecting
+			 * the appropriate field descriptor (so that tags
+			 * are written in sorted order).
+			 */
+			tag = isTiled(tif) ?
+			    TIFFTAG_TILEOFFSETS : TIFFTAG_STRIPOFFSETS;
+			if (tag != fip->field_tag)
+				continue;
+			
+			dir->tdir_tag = (uint16) tag;
+			dir->tdir_type = (uint16) TIFF_LONG;
+			dir->tdir_count = (uint32) td->td_nstrips;
+			if (!TIFFWriteLongArray(tif, dir, td->td_stripoffset))
+				goto bad;
+			break;
+		case FIELD_STRIPBYTECOUNTS:
+			/*
+			 * We use one field bit for both strip and tile
+			 * byte counts, and so must be careful in selecting
+			 * the appropriate field descriptor (so that tags
+			 * are written in sorted order).
+			 */
+			tag = isTiled(tif) ?
+			    TIFFTAG_TILEBYTECOUNTS : TIFFTAG_STRIPBYTECOUNTS;
+			if (tag != fip->field_tag)
+				continue;
+			
+			dir->tdir_tag = (uint16) tag;
+			dir->tdir_type = (uint16) TIFF_LONG;
+			dir->tdir_count = (uint32) td->td_nstrips;
+			if (!TIFFWriteLongArray(tif, dir,
+						td->td_stripbytecount))
+				goto bad;
+			break;
+		case FIELD_ROWSPERSTRIP:
+			TIFFSetupShortLong(tif, TIFFTAG_ROWSPERSTRIP,
+			    dir, td->td_rowsperstrip);
+			break;
+		case FIELD_COLORMAP:
+			if (!TIFFWriteShortTable(tif, TIFFTAG_COLORMAP, dir,
+			    3, td->td_colormap))
+				goto bad;
+			break;
+		case FIELD_IMAGEDIMENSIONS:
+			TIFFSetupShortLong(tif, TIFFTAG_IMAGEWIDTH,
+			    dir++, td->td_imagewidth);
+			TIFFSetupShortLong(tif, TIFFTAG_IMAGELENGTH,
+			    dir, td->td_imagelength);
+			break;
+		case FIELD_TILEDIMENSIONS:
+			TIFFSetupShortLong(tif, TIFFTAG_TILEWIDTH,
+			    dir++, td->td_tilewidth);
+			TIFFSetupShortLong(tif, TIFFTAG_TILELENGTH,
+			    dir, td->td_tilelength);
+			break;
+		case FIELD_COMPRESSION:
+			TIFFSetupShort(tif, TIFFTAG_COMPRESSION,
+			    dir, td->td_compression);
+			break;
+		case FIELD_PHOTOMETRIC:
+			TIFFSetupShort(tif, TIFFTAG_PHOTOMETRIC,
+			    dir, td->td_photometric);
+			break;
+		case FIELD_POSITION:
+			WriteRationalPair(TIFF_RATIONAL,
+			    TIFFTAG_XPOSITION, td->td_xposition,
+			    TIFFTAG_YPOSITION, td->td_yposition);
+			break;
+		case FIELD_RESOLUTION:
+			WriteRationalPair(TIFF_RATIONAL,
+			    TIFFTAG_XRESOLUTION, td->td_xresolution,
+			    TIFFTAG_YRESOLUTION, td->td_yresolution);
+			break;
+		case FIELD_BITSPERSAMPLE:
+		case FIELD_MINSAMPLEVALUE:
+		case FIELD_MAXSAMPLEVALUE:
+		case FIELD_SAMPLEFORMAT:
+			if (!TIFFWritePerSampleShorts(tif, fip->field_tag, dir))
+				goto bad;
+			break;
+		case FIELD_SMINSAMPLEVALUE:
+		case FIELD_SMAXSAMPLEVALUE:
+			if (!TIFFWritePerSampleAnys(tif,
+			    _TIFFSampleToTagType(tif), fip->field_tag, dir))
+				goto bad;
+			break;
+		case FIELD_PAGENUMBER:
+		case FIELD_HALFTONEHINTS:
+		case FIELD_YCBCRSUBSAMPLING:
+			if (!TIFFSetupShortPair(tif, fip->field_tag, dir))
+				goto bad;
+			break;
+		case FIELD_INKNAMES:
+			if (!TIFFWriteInkNames(tif, dir))
+				goto bad;
+			break;
+		case FIELD_TRANSFERFUNCTION:
+			if (!TIFFWriteTransferFunction(tif, dir))
+				goto bad;
+			break;
+		case FIELD_SUBIFD:
+			/*
+			 * XXX: Always write this field using LONG type
+			 * for backward compatibility.
+			 */
+			dir->tdir_tag = (uint16) fip->field_tag;
+			dir->tdir_type = (uint16) TIFF_LONG;
+			dir->tdir_count = (uint32) td->td_nsubifd;
+			if (!TIFFWriteLongArray(tif, dir, td->td_subifd))
+				goto bad;
+			/*
+			 * Total hack: if this directory includes a SubIFD
+			 * tag then force the next <n> directories to be
+			 * written as ``sub directories'' of this one.  This
+			 * is used to write things like thumbnails and
+			 * image masks that one wants to keep out of the
+			 * normal directory linkage access mechanism.
+			 */
+			if (dir->tdir_count > 0) {
+				tif->tif_flags |= TIFF_INSUBIFD;
+				tif->tif_nsubifd = (uint16) dir->tdir_count;
+				if (dir->tdir_count > 1)
+					tif->tif_subifdoff = dir->tdir_offset;
+				else
+					tif->tif_subifdoff = (uint32)(
+					      tif->tif_diroff
+					    + sizeof (uint16)
+					    + ((char*)&dir->tdir_offset-data));
+			}
+			break;
+		default:
+			/* XXX: Should be fixed and removed. */
+			if (fip->field_tag == TIFFTAG_DOTRANGE) {
+				if (!TIFFSetupShortPair(tif, fip->field_tag, dir))
+					goto bad;
+			}
+			else if (!TIFFWriteNormalTag(tif, dir, fip))
+				goto bad;
+			break;
+		}
+		dir++;
+                
+                if( fip->field_bit != FIELD_CUSTOM )
+                    ResetFieldBit(fields, fip->field_bit);
+	}
+
+	/*
+	 * Write directory.
+	 */
+	dircount = (uint16) nfields;
+	diroff = (uint32) tif->tif_nextdiroff;
+	if (tif->tif_flags & TIFF_SWAB) {
+		/*
+		 * The file's byte order is opposite to the
+		 * native machine architecture.  We overwrite
+		 * the directory information with impunity
+		 * because it'll be released below after we
+		 * write it to the file.  Note that all the
+		 * other tag construction routines assume that
+		 * we do this byte-swapping; i.e. they only
+		 * byte-swap indirect data.
+		 */
+		for (dir = (TIFFDirEntry*) data; dircount; dir++, dircount--) {
+			TIFFSwabArrayOfShort(&dir->tdir_tag, 2);
+			TIFFSwabArrayOfLong(&dir->tdir_count, 2);
+		}
+		dircount = (uint16) nfields;
+		TIFFSwabShort(&dircount);
+		TIFFSwabLong(&diroff);
+	}
+	(void) TIFFSeekFile(tif, tif->tif_diroff, SEEK_SET);
+	if (!WriteOK(tif, &dircount, sizeof (dircount))) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing directory count");
+		goto bad;
+	}
+	if (!WriteOK(tif, data, dirsize)) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing directory contents");
+		goto bad;
+	}
+	if (!WriteOK(tif, &diroff, sizeof (diroff))) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing directory link");
+		goto bad;
+	}
+	if (done) {
+		TIFFFreeDirectory(tif);
+		tif->tif_flags &= ~TIFF_DIRTYDIRECT;
+		(*tif->tif_cleanup)(tif);
+
+		/*
+		* Reset directory-related state for subsequent
+		* directories.
+		*/
+		TIFFCreateDirectory(tif);
+	}
+	_TIFFfree(data);
+	return (1);
+bad:
+	_TIFFfree(data);
+	return (0);
+}
+#undef WriteRationalPair
+
+int
+TIFFWriteDirectory(TIFF* tif)
+{
+	return _TIFFWriteDirectory(tif, TRUE);
+}
+
+/*
+ * Similar to TIFFWriteDirectory(), writes the directory out
+ * but leaves all data structures in memory so that it can be
+ * written again.  This will make a partially written TIFF file
+ * readable before it is successfully completed/closed.
+ */ 
+int
+TIFFCheckpointDirectory(TIFF* tif)
+{
+	int rc;
+	/* Setup the strips arrays, if they haven't already been. */
+	if (tif->tif_dir.td_stripoffset == NULL)
+	    (void) TIFFSetupStrips(tif);
+	rc = _TIFFWriteDirectory(tif, FALSE);
+	(void) TIFFSetWriteOffset(tif, TIFFSeekFile(tif, 0, SEEK_END));
+	return rc;
+}
+
+/*
+ * Process tags that are not special cased.
+ */
+static int
+TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
+{
+	uint16 wc = (uint16) fip->field_writecount;
+	uint32 wc2;
+
+	dir->tdir_tag = (uint16) fip->field_tag;
+	dir->tdir_type = (uint16) fip->field_type;
+	dir->tdir_count = wc;
+	
+	switch (fip->field_type) {
+	case TIFF_SHORT:
+	case TIFF_SSHORT:
+		if (fip->field_passcount) {
+			uint16* wp;
+			if (wc == (uint16) TIFF_VARIABLE2) {
+				TIFFGetField(tif, fip->field_tag, &wc2, &wp);
+				dir->tdir_count = wc2;
+			} else {	/* Assume TIFF_VARIABLE */
+				TIFFGetField(tif, fip->field_tag, &wc, &wp);
+				dir->tdir_count = wc;
+			}
+			if (!TIFFWriteShortArray(tif, dir, wp))
+				return 0;
+		} else {
+			if (wc == 1) {
+				uint16 sv;
+				TIFFGetField(tif, fip->field_tag, &sv);
+				dir->tdir_offset =
+					TIFFInsertData(tif, dir->tdir_type, sv);
+			} else {
+				uint16* wp;
+				TIFFGetField(tif, fip->field_tag, &wp);
+				if (!TIFFWriteShortArray(tif, dir, wp))
+					return 0;
+			}
+		}
+		break;
+	case TIFF_LONG:
+	case TIFF_SLONG:
+	case TIFF_IFD:
+		if (fip->field_passcount) {
+			uint32* lp;
+			if (wc == (uint16) TIFF_VARIABLE2) {
+				TIFFGetField(tif, fip->field_tag, &wc2, &lp);
+				dir->tdir_count = wc2;
+			} else {	/* Assume TIFF_VARIABLE */
+				TIFFGetField(tif, fip->field_tag, &wc, &lp);
+				dir->tdir_count = wc;
+			}
+			if (!TIFFWriteLongArray(tif, dir, lp))
+				return 0;
+		} else {
+			if (wc == 1) {
+				/* XXX handle LONG->SHORT conversion */
+				TIFFGetField(tif, fip->field_tag,
+					     &dir->tdir_offset);
+			} else {
+				uint32* lp;
+				TIFFGetField(tif, fip->field_tag, &lp);
+				if (!TIFFWriteLongArray(tif, dir, lp))
+					return 0;
+			}
+		}
+		break;
+	case TIFF_RATIONAL:
+	case TIFF_SRATIONAL:
+		if (fip->field_passcount) {
+			float* fp;
+			if (wc == (uint16) TIFF_VARIABLE2) {
+				TIFFGetField(tif, fip->field_tag, &wc2, &fp);
+				dir->tdir_count = wc2;
+			} else {	/* Assume TIFF_VARIABLE */
+				TIFFGetField(tif, fip->field_tag, &wc, &fp);
+				dir->tdir_count = wc;
+			}
+			if (!TIFFWriteRationalArray(tif, dir, fp))
+				return 0;
+		} else {
+			if (wc == 1) {
+				float fv;
+				TIFFGetField(tif, fip->field_tag, &fv);
+				if (!TIFFWriteRationalArray(tif, dir, &fv))
+					return 0;
+			} else {
+				float* fp;
+				TIFFGetField(tif, fip->field_tag, &fp);
+				if (!TIFFWriteRationalArray(tif, dir, fp))
+					return 0;
+			}
+		}
+		break;
+	case TIFF_FLOAT:
+		if (fip->field_passcount) {
+			float* fp;
+			if (wc == (uint16) TIFF_VARIABLE2) {
+				TIFFGetField(tif, fip->field_tag, &wc2, &fp);
+				dir->tdir_count = wc2;
+			} else {	/* Assume TIFF_VARIABLE */
+				TIFFGetField(tif, fip->field_tag, &wc, &fp);
+				dir->tdir_count = wc;
+			}
+			if (!TIFFWriteFloatArray(tif, dir, fp))
+				return 0;
+		} else {
+			if (wc == 1) {
+				float fv;
+				TIFFGetField(tif, fip->field_tag, &fv);
+				if (!TIFFWriteFloatArray(tif, dir, &fv))
+					return 0;
+			} else {
+				float* fp;
+				TIFFGetField(tif, fip->field_tag, &fp);
+				if (!TIFFWriteFloatArray(tif, dir, fp))
+					return 0;
+			}
+		}
+		break;
+	case TIFF_DOUBLE:
+		if (fip->field_passcount) {
+			double* dp;
+			if (wc == (uint16) TIFF_VARIABLE2) {
+				TIFFGetField(tif, fip->field_tag, &wc2, &dp);
+				dir->tdir_count = wc2;
+			} else {	/* Assume TIFF_VARIABLE */
+				TIFFGetField(tif, fip->field_tag, &wc, &dp);
+				dir->tdir_count = wc;
+			}
+			if (!TIFFWriteDoubleArray(tif, dir, dp))
+				return 0;
+		} else {
+			if (wc == 1) {
+				double dv;
+				TIFFGetField(tif, fip->field_tag, &dv);
+				if (!TIFFWriteDoubleArray(tif, dir, &dv))
+					return 0;
+			} else {
+				double* dp;
+				TIFFGetField(tif, fip->field_tag, &dp);
+				if (!TIFFWriteDoubleArray(tif, dir, dp))
+					return 0;
+			}
+		}
+		break;
+	case TIFF_ASCII:
+		{ 
+                    char* cp;
+                    if (fip->field_passcount)
+                        TIFFGetField(tif, fip->field_tag, &wc, &cp);
+                    else
+                        TIFFGetField(tif, fip->field_tag, &cp);
+
+                    dir->tdir_count = (uint32) (strlen(cp) + 1);
+                    if (!TIFFWriteByteArray(tif, dir, cp))
+                        return (0);
+		}
+		break;
+
+        case TIFF_BYTE:
+        case TIFF_SBYTE:          
+		if (fip->field_passcount) {
+			char* cp;
+			if (wc == (uint16) TIFF_VARIABLE2) {
+				TIFFGetField(tif, fip->field_tag, &wc2, &cp);
+				dir->tdir_count = wc2;
+			} else {	/* Assume TIFF_VARIABLE */
+				TIFFGetField(tif, fip->field_tag, &wc, &cp);
+				dir->tdir_count = wc;
+			}
+			if (!TIFFWriteByteArray(tif, dir, cp))
+				return 0;
+		} else {
+			if (wc == 1) {
+				char cv;
+				TIFFGetField(tif, fip->field_tag, &cv);
+				if (!TIFFWriteByteArray(tif, dir, &cv))
+					return 0;
+			} else {
+				char* cp;
+				TIFFGetField(tif, fip->field_tag, &cp);
+				if (!TIFFWriteByteArray(tif, dir, cp))
+					return 0;
+			}
+		}
+                break;
+
+	case TIFF_UNDEFINED:
+		{ char* cp;
+		  if (wc == (unsigned short) TIFF_VARIABLE) {
+			TIFFGetField(tif, fip->field_tag, &wc, &cp);
+			dir->tdir_count = wc;
+		  } else if (wc == (unsigned short) TIFF_VARIABLE2) {
+			TIFFGetField(tif, fip->field_tag, &wc2, &cp);
+			dir->tdir_count = wc2;
+		  } else 
+			TIFFGetField(tif, fip->field_tag, &cp);
+		  if (!TIFFWriteByteArray(tif, dir, cp))
+			return (0);
+		}
+		break;
+
+        case TIFF_NOTYPE:
+                break;
+	}
+	return (1);
+}
+
+/*
+ * Setup a directory entry with either a SHORT
+ * or LONG type according to the value.
+ */
+static void
+TIFFSetupShortLong(TIFF* tif, ttag_t tag, TIFFDirEntry* dir, uint32 v)
+{
+	dir->tdir_tag = (uint16) tag;
+	dir->tdir_count = 1;
+	if (v > 0xffffL) {
+		dir->tdir_type = (short) TIFF_LONG;
+		dir->tdir_offset = v;
+	} else {
+		dir->tdir_type = (short) TIFF_SHORT;
+		dir->tdir_offset = TIFFInsertData(tif, (int) TIFF_SHORT, v);
+	}
+}
+
+/*
+ * Setup a SHORT directory entry
+ */
+static void
+TIFFSetupShort(TIFF* tif, ttag_t tag, TIFFDirEntry* dir, uint16 v)
+{
+	dir->tdir_tag = (uint16) tag;
+	dir->tdir_count = 1;
+	dir->tdir_type = (short) TIFF_SHORT;
+	dir->tdir_offset = TIFFInsertData(tif, (int) TIFF_SHORT, v);
+}
+#undef MakeShortDirent
+
+#define	NITEMS(x)	(sizeof (x) / sizeof (x[0]))
+/*
+ * Setup a directory entry that references a
+ * samples/pixel array of SHORT values and
+ * (potentially) write the associated indirect
+ * values.
+ */
+static int
+TIFFWritePerSampleShorts(TIFF* tif, ttag_t tag, TIFFDirEntry* dir)
+{
+	uint16 buf[10], v;
+	uint16* w = buf;
+	uint16 i, samples = tif->tif_dir.td_samplesperpixel;
+	int status;
+
+	if (samples > NITEMS(buf)) {
+		w = (uint16*) _TIFFmalloc(samples * sizeof (uint16));
+		if (w == NULL) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			    "No space to write per-sample shorts");
+			return (0);
+		}
+	}
+	TIFFGetField(tif, tag, &v);
+	for (i = 0; i < samples; i++)
+		w[i] = v;
+	
+	dir->tdir_tag = (uint16) tag;
+	dir->tdir_type = (uint16) TIFF_SHORT;
+	dir->tdir_count = samples;
+	status = TIFFWriteShortArray(tif, dir, w);
+	if (w != buf)
+		_TIFFfree((char*) w);
+	return (status);
+}
+
+/*
+ * Setup a directory entry that references a samples/pixel array of ``type''
+ * values and (potentially) write the associated indirect values.  The source
+ * data from TIFFGetField() for the specified tag must be returned as double.
+ */
+static int
+TIFFWritePerSampleAnys(TIFF* tif,
+    TIFFDataType type, ttag_t tag, TIFFDirEntry* dir)
+{
+	double buf[10], v;
+	double* w = buf;
+	uint16 i, samples = tif->tif_dir.td_samplesperpixel;
+	int status;
+
+	if (samples > NITEMS(buf)) {
+		w = (double*) _TIFFmalloc(samples * sizeof (double));
+		if (w == NULL) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			    "No space to write per-sample values");
+			return (0);
+		}
+	}
+	TIFFGetField(tif, tag, &v);
+	for (i = 0; i < samples; i++)
+		w[i] = v;
+	status = TIFFWriteAnyArray(tif, type, tag, dir, samples, w);
+	if (w != buf)
+		_TIFFfree(w);
+	return (status);
+}
+#undef NITEMS
+
+/*
+ * Setup a pair of shorts that are returned by
+ * value, rather than as a reference to an array.
+ */
+static int
+TIFFSetupShortPair(TIFF* tif, ttag_t tag, TIFFDirEntry* dir)
+{
+	uint16 v[2];
+
+	TIFFGetField(tif, tag, &v[0], &v[1]);
+
+	dir->tdir_tag = (uint16) tag;
+	dir->tdir_type = (uint16) TIFF_SHORT;
+	dir->tdir_count = 2;
+	return (TIFFWriteShortArray(tif, dir, v));
+}
+
+/*
+ * Setup a directory entry for an NxM table of shorts,
+ * where M is known to be 2**bitspersample, and write
+ * the associated indirect data.
+ */
+static int
+TIFFWriteShortTable(TIFF* tif,
+    ttag_t tag, TIFFDirEntry* dir, uint32 n, uint16** table)
+{
+	uint32 i, off;
+
+	dir->tdir_tag = (uint16) tag;
+	dir->tdir_type = (short) TIFF_SHORT;
+	/* XXX -- yech, fool TIFFWriteData */
+	dir->tdir_count = (uint32) (1L<<tif->tif_dir.td_bitspersample);
+	off = tif->tif_dataoff;
+	for (i = 0; i < n; i++)
+		if (!TIFFWriteData(tif, dir, (char *)table[i]))
+			return (0);
+	dir->tdir_count *= n;
+	dir->tdir_offset = off;
+	return (1);
+}
+
+/*
+ * Write/copy data associated with an ASCII or opaque tag value.
+ */
+static int
+TIFFWriteByteArray(TIFF* tif, TIFFDirEntry* dir, char* cp)
+{
+	if (dir->tdir_count > 4) {
+		if (!TIFFWriteData(tif, dir, cp))
+			return (0);
+	} else
+		_TIFFmemcpy(&dir->tdir_offset, cp, dir->tdir_count);
+	return (1);
+}
+
+/*
+ * Setup a directory entry of an array of SHORT
+ * or SSHORT and write the associated indirect values.
+ */
+static int
+TIFFWriteShortArray(TIFF* tif, TIFFDirEntry* dir, uint16* v)
+{
+	if (dir->tdir_count <= 2) {
+		if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) {
+			dir->tdir_offset = (uint32) ((long) v[0] << 16);
+			if (dir->tdir_count == 2)
+				dir->tdir_offset |= v[1] & 0xffff;
+		} else {
+			dir->tdir_offset = v[0] & 0xffff;
+			if (dir->tdir_count == 2)
+				dir->tdir_offset |= (long) v[1] << 16;
+		}
+		return (1);
+	} else
+		return (TIFFWriteData(tif, dir, (char*) v));
+}
+
+/*
+ * Setup a directory entry of an array of LONG
+ * or SLONG and write the associated indirect values.
+ */
+static int
+TIFFWriteLongArray(TIFF* tif, TIFFDirEntry* dir, uint32* v)
+{
+	if (dir->tdir_count == 1) {
+		dir->tdir_offset = v[0];
+		return (1);
+	} else
+		return (TIFFWriteData(tif, dir, (char*) v));
+}
+
+/*
+ * Setup a directory entry of an array of RATIONAL
+ * or SRATIONAL and write the associated indirect values.
+ */
+static int
+TIFFWriteRationalArray(TIFF* tif, TIFFDirEntry* dir, float* v)
+{
+	uint32 i;
+	uint32* t;
+	int status;
+
+	t = (uint32*) _TIFFmalloc(2 * dir->tdir_count * sizeof (uint32));
+	if (t == NULL) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "No space to write RATIONAL array");
+		return (0);
+	}
+	for (i = 0; i < dir->tdir_count; i++) {
+		float fv = v[i];
+		int sign = 1;
+		uint32 den;
+
+		if (fv < 0) {
+			if (dir->tdir_type == TIFF_RATIONAL) {
+				TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+	"\"%s\": Information lost writing value (%g) as (unsigned) RATIONAL",
+				_TIFFFieldWithTag(tif,dir->tdir_tag)->field_name,
+				fv);
+				fv = 0;
+			} else
+				fv = -fv, sign = -1;
+		}
+		den = 1L;
+		if (fv > 0) {
+			while (fv < 1L<<(31-3) && den < 1L<<(31-3))
+				fv *= 1<<3, den *= 1L<<3;
+		}
+		t[2*i+0] = (uint32) (sign * (fv + 0.5));
+		t[2*i+1] = den;
+	}
+	status = TIFFWriteData(tif, dir, (char *)t);
+	_TIFFfree((char*) t);
+	return (status);
+}
+
+static int
+TIFFWriteFloatArray(TIFF* tif, TIFFDirEntry* dir, float* v)
+{
+	TIFFCvtNativeToIEEEFloat(tif, dir->tdir_count, v);
+	if (dir->tdir_count == 1) {
+		dir->tdir_offset = *(uint32*) &v[0];
+		return (1);
+	} else
+		return (TIFFWriteData(tif, dir, (char*) v));
+}
+
+static int
+TIFFWriteDoubleArray(TIFF* tif, TIFFDirEntry* dir, double* v)
+{
+	TIFFCvtNativeToIEEEDouble(tif, dir->tdir_count, v);
+	return (TIFFWriteData(tif, dir, (char*) v));
+}
+
+/*
+ * Write an array of ``type'' values for a specified tag (i.e. this is a tag
+ * which is allowed to have different types, e.g. SMaxSampleType).
+ * Internally the data values are represented as double since a double can
+ * hold any of the TIFF tag types (yes, this should really be an abstract
+ * type tany_t for portability).  The data is converted into the specified
+ * type in a temporary buffer and then handed off to the appropriate array
+ * writer.
+ */
+static int
+TIFFWriteAnyArray(TIFF* tif,
+    TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, double* v)
+{
+	char buf[10 * sizeof(double)];
+	char* w = buf;
+	int i, status = 0;
+
+	if (n * TIFFDataWidth(type) > sizeof buf) {
+		w = (char*) _TIFFmalloc(n * TIFFDataWidth(type));
+		if (w == NULL) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			    "No space to write array");
+			return (0);
+		}
+	}
+
+	dir->tdir_tag = (uint16) tag;
+	dir->tdir_type = (uint16) type;
+	dir->tdir_count = n;
+
+	switch (type) {
+	case TIFF_BYTE:
+		{ 
+			uint8* bp = (uint8*) w;
+			for (i = 0; i < (int) n; i++)
+				bp[i] = (uint8) v[i];
+			if (!TIFFWriteByteArray(tif, dir, (char*) bp))
+				goto out;
+		}
+		break;
+	case TIFF_SBYTE:
+		{ 
+			int8* bp = (int8*) w;
+			for (i = 0; i < (int) n; i++)
+				bp[i] = (int8) v[i];
+			if (!TIFFWriteByteArray(tif, dir, (char*) bp))
+				goto out;
+		}
+		break;
+	case TIFF_SHORT:
+		{
+			uint16* bp = (uint16*) w;
+			for (i = 0; i < (int) n; i++)
+				bp[i] = (uint16) v[i];
+			if (!TIFFWriteShortArray(tif, dir, (uint16*)bp))
+				goto out;
+		}
+		break;
+	case TIFF_SSHORT:
+		{ 
+			int16* bp = (int16*) w;
+			for (i = 0; i < (int) n; i++)
+				bp[i] = (int16) v[i];
+			if (!TIFFWriteShortArray(tif, dir, (uint16*)bp))
+				goto out;
+		}
+		break;
+	case TIFF_LONG:
+		{
+			uint32* bp = (uint32*) w;
+			for (i = 0; i < (int) n; i++)
+				bp[i] = (uint32) v[i];
+			if (!TIFFWriteLongArray(tif, dir, bp))
+				goto out;
+		}
+		break;
+	case TIFF_SLONG:
+		{
+			int32* bp = (int32*) w;
+			for (i = 0; i < (int) n; i++)
+				bp[i] = (int32) v[i];
+			if (!TIFFWriteLongArray(tif, dir, (uint32*) bp))
+				goto out;
+		}
+		break;
+	case TIFF_FLOAT:
+		{ 
+			float* bp = (float*) w;
+			for (i = 0; i < (int) n; i++)
+				bp[i] = (float) v[i];
+			if (!TIFFWriteFloatArray(tif, dir, bp))
+				goto out;
+		}
+		break;
+	case TIFF_DOUBLE:
+		return (TIFFWriteDoubleArray(tif, dir, v));
+	default:
+		/* TIFF_NOTYPE */
+		/* TIFF_ASCII */
+		/* TIFF_UNDEFINED */
+		/* TIFF_RATIONAL */
+		/* TIFF_SRATIONAL */
+		goto out;
+	}
+	status = 1;
+ out:
+	if (w != buf)
+		_TIFFfree(w);
+	return (status);
+}
+
+static int
+TIFFWriteTransferFunction(TIFF* tif, TIFFDirEntry* dir)
+{
+	TIFFDirectory* td = &tif->tif_dir;
+	tsize_t n = (1L<<td->td_bitspersample) * sizeof (uint16);
+	uint16** tf = td->td_transferfunction;
+	int ncols;
+
+	/*
+	 * Check if the table can be written as a single column,
+	 * or if it must be written as 3 columns.  Note that we
+	 * write a 3-column tag if there are 2 samples/pixel and
+	 * a single column of data won't suffice--hmm.
+	 */
+	switch (td->td_samplesperpixel - td->td_extrasamples) {
+	default:	if (_TIFFmemcmp(tf[0], tf[2], n)) { ncols = 3; break; }
+	case 2:		if (_TIFFmemcmp(tf[0], tf[1], n)) { ncols = 3; break; }
+	case 1: case 0:	ncols = 1;
+	}
+	return (TIFFWriteShortTable(tif,
+	    TIFFTAG_TRANSFERFUNCTION, dir, ncols, tf));
+}
+
+static int
+TIFFWriteInkNames(TIFF* tif, TIFFDirEntry* dir)
+{
+	TIFFDirectory* td = &tif->tif_dir;
+
+	dir->tdir_tag = TIFFTAG_INKNAMES;
+	dir->tdir_type = (short) TIFF_ASCII;
+	dir->tdir_count = td->td_inknameslen;
+	return (TIFFWriteByteArray(tif, dir, td->td_inknames));
+}
+
+/*
+ * Write a contiguous directory item.
+ */
+static int
+TIFFWriteData(TIFF* tif, TIFFDirEntry* dir, char* cp)
+{
+	tsize_t cc;
+
+	if (tif->tif_flags & TIFF_SWAB) {
+		switch (dir->tdir_type) {
+		case TIFF_SHORT:
+		case TIFF_SSHORT:
+			TIFFSwabArrayOfShort((uint16*) cp, dir->tdir_count);
+			break;
+		case TIFF_LONG:
+		case TIFF_SLONG:
+		case TIFF_FLOAT:
+			TIFFSwabArrayOfLong((uint32*) cp, dir->tdir_count);
+			break;
+		case TIFF_RATIONAL:
+		case TIFF_SRATIONAL:
+			TIFFSwabArrayOfLong((uint32*) cp, 2*dir->tdir_count);
+			break;
+		case TIFF_DOUBLE:
+			TIFFSwabArrayOfDouble((double*) cp, dir->tdir_count);
+			break;
+		}
+	}
+	dir->tdir_offset = tif->tif_dataoff;
+	cc = dir->tdir_count * TIFFDataWidth((TIFFDataType) dir->tdir_type);
+	if (SeekOK(tif, dir->tdir_offset) &&
+	    WriteOK(tif, cp, cc)) {
+		tif->tif_dataoff += (cc + 1) & ~1;
+		return (1);
+	}
+	TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing data for field \"%s\"",
+	    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
+	return (0);
+}
+
+/*
+ * Similar to TIFFWriteDirectory(), but if the directory has already
+ * been written once, it is relocated to the end of the file, in case it
+ * has changed in size.  Note that this will result in the loss of the 
+ * previously used directory space. 
+ */ 
+
+int 
+TIFFRewriteDirectory( TIFF *tif )
+{
+    static const char module[] = "TIFFRewriteDirectory";
+
+    /* We don't need to do anything special if it hasn't been written. */
+    if( tif->tif_diroff == 0 )
+        return TIFFWriteDirectory( tif );
+
+    /*
+    ** Find and zero the pointer to this directory, so that TIFFLinkDirectory
+    ** will cause it to be added after this directories current pre-link.
+    */
+    
+    /* Is it the first directory in the file? */
+    if (tif->tif_header.tiff_diroff == tif->tif_diroff) 
+    {
+        tif->tif_header.tiff_diroff = 0;
+        tif->tif_diroff = 0;
+
+        TIFFSeekFile(tif, (toff_t)(TIFF_MAGIC_SIZE+TIFF_VERSION_SIZE),
+		     SEEK_SET);
+        if (!WriteOK(tif, &(tif->tif_header.tiff_diroff), 
+                     sizeof (tif->tif_diroff))) 
+        {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error updating TIFF header");
+            return (0);
+        }
+    }
+    else
+    {
+        toff_t  nextdir, off;
+
+	nextdir = tif->tif_header.tiff_diroff;
+	do {
+		uint16 dircount;
+
+		if (!SeekOK(tif, nextdir) ||
+		    !ReadOK(tif, &dircount, sizeof (dircount))) {
+			TIFFErrorExt(tif->tif_clientdata, module, "Error fetching directory count");
+			return (0);
+		}
+		if (tif->tif_flags & TIFF_SWAB)
+			TIFFSwabShort(&dircount);
+		(void) TIFFSeekFile(tif,
+		    dircount * sizeof (TIFFDirEntry), SEEK_CUR);
+		if (!ReadOK(tif, &nextdir, sizeof (nextdir))) {
+			TIFFErrorExt(tif->tif_clientdata, module, "Error fetching directory link");
+			return (0);
+		}
+		if (tif->tif_flags & TIFF_SWAB)
+			TIFFSwabLong(&nextdir);
+	} while (nextdir != tif->tif_diroff && nextdir != 0);
+        off = TIFFSeekFile(tif, 0, SEEK_CUR); /* get current offset */
+        (void) TIFFSeekFile(tif, off - (toff_t)sizeof(nextdir), SEEK_SET);
+        tif->tif_diroff = 0;
+	if (!WriteOK(tif, &(tif->tif_diroff), sizeof (nextdir))) {
+		TIFFErrorExt(tif->tif_clientdata, module, "Error writing directory link");
+		return (0);
+	}
+    }
+
+    /*
+    ** Now use TIFFWriteDirectory() normally.
+    */
+
+    return TIFFWriteDirectory( tif );
+}
+
+
+/*
+ * Link the current directory into the
+ * directory chain for the file.
+ */
+static int
+TIFFLinkDirectory(TIFF* tif)
+{
+	static const char module[] = "TIFFLinkDirectory";
+	toff_t nextdir;
+	toff_t diroff, off;
+
+	tif->tif_diroff = (TIFFSeekFile(tif, (toff_t) 0, SEEK_END)+1) &~ 1;
+	diroff = tif->tif_diroff;
+	if (tif->tif_flags & TIFF_SWAB)
+		TIFFSwabLong(&diroff);
+
+	/*
+	 * Handle SubIFDs
+	 */
+        if (tif->tif_flags & TIFF_INSUBIFD) {
+		(void) TIFFSeekFile(tif, tif->tif_subifdoff, SEEK_SET);
+		if (!WriteOK(tif, &diroff, sizeof (diroff))) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Error writing SubIFD directory link",
+			    tif->tif_name);
+			return (0);
+		}
+		/*
+		 * Advance to the next SubIFD or, if this is
+		 * the last one configured, revert back to the
+		 * normal directory linkage.
+		 */
+		if (--tif->tif_nsubifd)
+			tif->tif_subifdoff += sizeof (diroff);
+		else
+			tif->tif_flags &= ~TIFF_INSUBIFD;
+		return (1);
+	}
+
+	if (tif->tif_header.tiff_diroff == 0) {
+		/*
+		 * First directory, overwrite offset in header.
+		 */
+		tif->tif_header.tiff_diroff = tif->tif_diroff;
+		(void) TIFFSeekFile(tif,
+				    (toff_t)(TIFF_MAGIC_SIZE+TIFF_VERSION_SIZE),
+                                    SEEK_SET);
+		if (!WriteOK(tif, &diroff, sizeof (diroff))) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing TIFF header");
+			return (0);
+		}
+		return (1);
+	}
+	/*
+	 * Not the first directory, search to the last and append.
+	 */
+	nextdir = tif->tif_header.tiff_diroff;
+	do {
+		uint16 dircount;
+
+		if (!SeekOK(tif, nextdir) ||
+		    !ReadOK(tif, &dircount, sizeof (dircount))) {
+			TIFFErrorExt(tif->tif_clientdata, module, "Error fetching directory count");
+			return (0);
+		}
+		if (tif->tif_flags & TIFF_SWAB)
+			TIFFSwabShort(&dircount);
+		(void) TIFFSeekFile(tif,
+		    dircount * sizeof (TIFFDirEntry), SEEK_CUR);
+		if (!ReadOK(tif, &nextdir, sizeof (nextdir))) {
+			TIFFErrorExt(tif->tif_clientdata, module, "Error fetching directory link");
+			return (0);
+		}
+		if (tif->tif_flags & TIFF_SWAB)
+			TIFFSwabLong(&nextdir);
+	} while (nextdir != 0);
+        off = TIFFSeekFile(tif, 0, SEEK_CUR); /* get current offset */
+        (void) TIFFSeekFile(tif, off - (toff_t)sizeof(nextdir), SEEK_SET);
+	if (!WriteOK(tif, &diroff, sizeof (diroff))) {
+		TIFFErrorExt(tif->tif_clientdata, module, "Error writing directory link");
+		return (0);
+	}
+	return (1);
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_dumpmode.c b/src/tiff/tif_dumpmode.c
new file mode 100644
index 0000000..480f6f4
--- /dev/null
+++ b/src/tiff/tif_dumpmode.c
@@ -0,0 +1,117 @@
+/* $Header$ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * "Null" Compression Algorithm Support.
+ */
+#include "tiffiop.h"
+
+/*
+ * Encode a hunk of pixels.
+ */
+static int
+DumpModeEncode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s)
+{
+	(void) s;
+	while (cc > 0) {
+		tsize_t n;
+
+		n = cc;
+		if (tif->tif_rawcc + n > tif->tif_rawdatasize)
+			n = tif->tif_rawdatasize - tif->tif_rawcc;
+
+                assert( n > 0 );
+                
+		/*
+		 * Avoid copy if client has setup raw
+		 * data buffer to avoid extra copy.
+		 */
+		if (tif->tif_rawcp != pp)
+			_TIFFmemcpy(tif->tif_rawcp, pp, n);
+		tif->tif_rawcp += n;
+		tif->tif_rawcc += n;
+		pp += n;
+		cc -= n;
+		if (tif->tif_rawcc >= tif->tif_rawdatasize &&
+		    !TIFFFlushData1(tif))
+			return (-1);
+	}
+	return (1);
+}
+
+/*
+ * Decode a hunk of pixels.
+ */
+static int
+DumpModeDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
+{
+	(void) s;
+	if (tif->tif_rawcc < cc) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "DumpModeDecode: Not enough data for scanline %d",
+		    tif->tif_row);
+		return (0);
+	}
+	/*
+	 * Avoid copy if client has setup raw
+	 * data buffer to avoid extra copy.
+	 */
+	if (tif->tif_rawcp != buf)
+		_TIFFmemcpy(buf, tif->tif_rawcp, cc);
+	tif->tif_rawcp += cc;
+	tif->tif_rawcc -= cc;
+	return (1);
+}
+
+/*
+ * Seek forwards nrows in the current strip.
+ */
+static int
+DumpModeSeek(TIFF* tif, uint32 nrows)
+{
+	tif->tif_rawcp += nrows * tif->tif_scanlinesize;
+	tif->tif_rawcc -= nrows * tif->tif_scanlinesize;
+	return (1);
+}
+
+/*
+ * Initialize dump mode.
+ */
+int
+TIFFInitDumpMode(TIFF* tif, int scheme)
+{
+	(void) scheme;
+	tif->tif_decoderow = DumpModeDecode;
+	tif->tif_decodestrip = DumpModeDecode;
+	tif->tif_decodetile = DumpModeDecode;
+	tif->tif_encoderow = DumpModeEncode;
+	tif->tif_encodestrip = DumpModeEncode;
+	tif->tif_encodetile = DumpModeEncode;
+	tif->tif_seek = DumpModeSeek;
+	return (1);
+}
diff --git a/src/tiff/tif_error.c b/src/tiff/tif_error.c
new file mode 100644
index 0000000..0b8b39d
--- /dev/null
+++ b/src/tiff/tif_error.c
@@ -0,0 +1,73 @@
+/* $Header$ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ */
+#include "tiffiop.h"
+
+TIFFErrorHandlerExt _TIFFerrorHandlerExt = NULL;
+
+TIFFErrorHandler
+TIFFSetErrorHandler(TIFFErrorHandler handler)
+{
+	TIFFErrorHandler prev = _TIFFerrorHandler;
+	_TIFFerrorHandler = handler;
+	return (prev);
+}
+
+TIFFErrorHandlerExt
+TIFFSetErrorHandlerExt(TIFFErrorHandlerExt handler)
+{
+	TIFFErrorHandlerExt prev = _TIFFerrorHandlerExt;
+	_TIFFerrorHandlerExt = handler;
+	return (prev);
+}
+
+void
+TIFFError(const char* module, const char* fmt, ...)
+{
+	va_list ap;
+	va_start(ap, fmt);
+	if (_TIFFerrorHandler)
+		(*_TIFFerrorHandler)(module, fmt, ap);
+	if (_TIFFerrorHandlerExt)
+		(*_TIFFerrorHandlerExt)(0, module, fmt, ap);
+	va_end(ap);
+}
+
+void
+TIFFErrorExt(thandle_t fd, const char* module, const char* fmt, ...)
+{
+	va_list ap;
+	va_start(ap, fmt);
+	if (_TIFFerrorHandler)
+		(*_TIFFerrorHandler)(module, fmt, ap);
+	if (_TIFFerrorHandlerExt)
+		(*_TIFFerrorHandlerExt)(fd, module, fmt, ap);
+	va_end(ap);
+}
+
diff --git a/src/tiff/tif_extension.c b/src/tiff/tif_extension.c
new file mode 100644
index 0000000..41ff707
--- /dev/null
+++ b/src/tiff/tif_extension.c
@@ -0,0 +1,111 @@
+/* $Header$ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Various routines support external extension of the tag set, and other
+ * application extension capabilities. 
+ */
+
+#include "tiffiop.h"
+
+int TIFFGetTagListCount( TIFF *tif )
+
+{
+    TIFFDirectory* td = &tif->tif_dir;
+    
+    return td->td_customValueCount;
+}
+
+ttag_t TIFFGetTagListEntry( TIFF *tif, int tag_index )
+
+{
+    TIFFDirectory* td = &tif->tif_dir;
+
+    if( tag_index < 0 || tag_index >= td->td_customValueCount )
+        return (ttag_t) -1;
+    else
+        return td->td_customValues[tag_index].info->field_tag;
+}
+
+/*
+** This provides read/write access to the TIFFTagMethods within the TIFF
+** structure to application code without giving access to the private
+** TIFF structure.
+*/
+TIFFTagMethods *TIFFAccessTagMethods( TIFF *tif )
+
+{
+    return &(tif->tif_tagmethods);
+}
+
+void *TIFFGetClientInfo( TIFF *tif, const char *name )
+
+{
+    TIFFClientInfoLink *link = tif->tif_clientinfo;
+
+    while( link != NULL && strcmp(link->name,name) != 0 )
+        link = link->next;
+
+    if( link != NULL )
+        return link->data;
+    else
+        return NULL;
+}
+
+void TIFFSetClientInfo( TIFF *tif, void *data, const char *name )
+
+{
+    TIFFClientInfoLink *link = tif->tif_clientinfo;
+
+    /*
+    ** Do we have an existing link with this name?  If so, just
+    ** set it.
+    */
+    while( link != NULL && strcmp(link->name,name) != 0 )
+        link = link->next;
+
+    if( link != NULL )
+    {
+        link->data = data;
+        return;
+    }
+
+    /*
+    ** Create a new link.
+    */
+
+    link = (TIFFClientInfoLink *) _TIFFmalloc(sizeof(TIFFClientInfoLink));
+    assert (link != NULL);
+    link->next = tif->tif_clientinfo;
+    link->name = (char *) _TIFFmalloc(strlen(name)+1);
+    assert (link->name != NULL);
+    strcpy(link->name, name);
+    link->data = data;
+
+    tif->tif_clientinfo = link;
+}
diff --git a/src/tiff/tif_fax3.c b/src/tiff/tif_fax3.c
new file mode 100644
index 0000000..58dd7eb
--- /dev/null
+++ b/src/tiff/tif_fax3.c
@@ -0,0 +1,1566 @@
+/* $Id: tif_fax3.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1990-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#include "tiffiop.h"
+#ifdef CCITT_SUPPORT
+/*
+ * TIFF Library.
+ *
+ * CCITT Group 3 (T.4) and Group 4 (T.6) Compression Support.
+ *
+ * This file contains support for decoding and encoding TIFF
+ * compression algorithms 2, 3, 4, and 32771.
+ *
+ * Decoder support is derived, with permission, from the code
+ * in Frank Cringle's viewfax program;
+ *      Copyright (C) 1990, 1995  Frank D. Cringle.
+ */
+#include "tif_fax3.h"
+#define	G3CODES
+#include "t4.h"
+#include <stdio.h>
+
+/*
+ * Compression+decompression state blocks are
+ * derived from this ``base state'' block.
+ */
+typedef struct {
+        int     rw_mode;                /* O_RDONLY for decode, else encode */
+	int	mode;			/* operating mode */
+	uint32	rowbytes;		/* bytes in a decoded scanline */
+	uint32	rowpixels;		/* pixels in a scanline */
+
+	uint16	cleanfaxdata;		/* CleanFaxData tag */
+	uint32	badfaxrun;		/* BadFaxRun tag */
+	uint32	badfaxlines;		/* BadFaxLines tag */
+	uint32	groupoptions;		/* Group 3/4 options tag */
+	uint32	recvparams;		/* encoded Class 2 session params */
+	char*	subaddress;		/* subaddress string */
+	uint32	recvtime;		/* time spent receiving (secs) */
+	char*	faxdcs;			/* Table 2/T.30 encoded session params */
+	TIFFVGetMethod vgetparent;	/* super-class method */
+	TIFFVSetMethod vsetparent;	/* super-class method */
+} Fax3BaseState;
+#define	Fax3State(tif)		((Fax3BaseState*) (tif)->tif_data)
+
+typedef enum { G3_1D, G3_2D } Ttag;
+typedef struct {
+	Fax3BaseState b;
+
+	/* Decoder state info */
+	const unsigned char* bitmap;	/* bit reversal table */
+	uint32	data;			/* current i/o byte/word */
+	int	bit;			/* current i/o bit in byte */
+	int	EOLcnt;			/* count of EOL codes recognized */
+	TIFFFaxFillFunc fill;		/* fill routine */
+	uint32*	runs;			/* b&w runs for current/previous row */
+	uint32*	refruns;		/* runs for reference line */
+	uint32*	curruns;		/* runs for current line */
+
+	/* Encoder state info */
+	Ttag    tag;			/* encoding state */
+	unsigned char*	refline;	/* reference line for 2d decoding */
+	int	k;			/* #rows left that can be 2d encoded */
+	int	maxk;			/* max #rows that can be 2d encoded */
+} Fax3CodecState;
+#define	DecoderState(tif)	((Fax3CodecState*) Fax3State(tif))
+#define	EncoderState(tif)	((Fax3CodecState*) Fax3State(tif))
+
+#define	is2DEncoding(sp) \
+	(sp->b.groupoptions & GROUP3OPT_2DENCODING)
+#define	isAligned(p,t)	((((unsigned long)(p)) & (sizeof (t)-1)) == 0)
+
+/*
+ * Group 3 and Group 4 Decoding.
+ */
+
+/*
+ * These macros glue the TIFF library state to
+ * the state expected by Frank's decoder.
+ */
+#define	DECLARE_STATE(tif, sp, mod)					\
+    static const char module[] = mod;					\
+    Fax3CodecState* sp = DecoderState(tif);				\
+    int a0;				/* reference element */		\
+    int lastx = sp->b.rowpixels;	/* last element in row */	\
+    uint32 BitAcc;			/* bit accumulator */		\
+    int BitsAvail;			/* # valid bits in BitAcc */	\
+    int RunLength;			/* length of current run */	\
+    unsigned char* cp;			/* next byte of input data */	\
+    unsigned char* ep;			/* end of input data */		\
+    uint32* pa;				/* place to stuff next run */	\
+    uint32* thisrun;			/* current row's run array */	\
+    int EOLcnt;				/* # EOL codes recognized */	\
+    const unsigned char* bitmap = sp->bitmap;	/* input data bit reverser */	\
+    const TIFFFaxTabEnt* TabEnt
+#define	DECLARE_STATE_2D(tif, sp, mod)					\
+    DECLARE_STATE(tif, sp, mod);					\
+    int b1;				/* next change on prev line */	\
+    uint32* pb				/* next run in reference line */\
+/*
+ * Load any state that may be changed during decoding.
+ */
+#define	CACHE_STATE(tif, sp) do {					\
+    BitAcc = sp->data;							\
+    BitsAvail = sp->bit;						\
+    EOLcnt = sp->EOLcnt;						\
+    cp = (unsigned char*) tif->tif_rawcp;				\
+    ep = cp + tif->tif_rawcc;						\
+} while (0)
+/*
+ * Save state possibly changed during decoding.
+ */
+#define	UNCACHE_STATE(tif, sp) do {					\
+    sp->bit = BitsAvail;						\
+    sp->data = BitAcc;							\
+    sp->EOLcnt = EOLcnt;						\
+    tif->tif_rawcc -= (tidata_t) cp - tif->tif_rawcp;			\
+    tif->tif_rawcp = (tidata_t) cp;					\
+} while (0)
+
+/*
+ * Setup state for decoding a strip.
+ */
+static int
+Fax3PreDecode(TIFF* tif, tsample_t s)
+{
+	Fax3CodecState* sp = DecoderState(tif);
+
+	(void) s;
+	assert(sp != NULL);
+	sp->bit = 0;			/* force initial read */
+	sp->data = 0;
+	sp->EOLcnt = 0;			/* force initial scan for EOL */
+	/*
+	 * Decoder assumes lsb-to-msb bit order.  Note that we select
+	 * this here rather than in Fax3SetupState so that viewers can
+	 * hold the image open, fiddle with the FillOrder tag value,
+	 * and then re-decode the image.  Otherwise they'd need to close
+	 * and open the image to get the state reset.
+	 */
+	sp->bitmap =
+	    TIFFGetBitRevTable(tif->tif_dir.td_fillorder != FILLORDER_LSB2MSB);
+	if (sp->refruns) {		/* init reference line to white */
+		sp->refruns[0] = (uint32) sp->b.rowpixels;
+		sp->refruns[1] = 0;
+	}
+	return (1);
+}
+
+/*
+ * Routine for handling various errors/conditions.
+ * Note how they are "glued into the decoder" by
+ * overriding the definitions used by the decoder.
+ */
+
+static void
+Fax3Unexpected(const char* module, TIFF* tif, uint32 line, uint32 a0)
+{
+	TIFFErrorExt(tif->tif_clientdata, module, "%s: Bad code word at line %lu of %s %lu (x %lu)",
+		tif->tif_name, (unsigned long) line, isTiled(tif) ? "tile" : "strip",
+	   (unsigned long) (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
+	   (unsigned long) a0);
+}
+#define	unexpected(table, a0)	Fax3Unexpected(module, tif, line, a0)
+
+static void
+Fax3Extension(const char* module, TIFF* tif, uint32 line, uint32 a0)
+{
+	TIFFErrorExt(tif->tif_clientdata, module,
+	    "%s: Uncompressed data (not supported) at line %lu of %s %lu (x %lu)",
+	    tif->tif_name, (unsigned long) line, isTiled(tif) ? "tile" : "strip",
+       (unsigned long) (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
+       (unsigned long) a0);
+}
+#define	extension(a0)	Fax3Extension(module, tif, line, a0)
+
+static void
+Fax3BadLength(const char* module, TIFF* tif, uint32 line, uint32 a0, uint32 lastx)
+{
+	TIFFWarningExt(tif->tif_clientdata, module, "%s: %s at line %lu of %s %lu (got %lu, expected %lu)",
+	    tif->tif_name,
+	    a0 < lastx ? "Premature EOL" : "Line length mismatch",
+	    (unsigned long) line, isTiled(tif) ? "tile" : "strip",
+        (unsigned long) (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
+        (unsigned long) a0, lastx);
+}
+#define	badlength(a0,lastx)	Fax3BadLength(module, tif, line, a0, lastx)
+
+static void
+Fax3PrematureEOF(const char* module, TIFF* tif, uint32 line, uint32 a0)
+{
+	TIFFWarningExt(tif->tif_clientdata, module, "%s: Premature EOF at line %lu of %s %lu (x %lu)",
+	    tif->tif_name,
+	    (unsigned long) line, isTiled(tif) ? "tile" : "strip",
+        (unsigned long) (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
+        (unsigned long) a0);
+}
+#define	prematureEOF(a0)	Fax3PrematureEOF(module, tif, line, a0)
+
+#define	Nop
+
+/*
+ * Decode the requested amount of G3 1D-encoded data.
+ */
+static int
+Fax3Decode1D(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
+{
+	DECLARE_STATE(tif, sp, "Fax3Decode1D");
+        int line = 0;
+
+	(void) s;
+	CACHE_STATE(tif, sp);
+	thisrun = sp->curruns;
+	while ((long)occ > 0) {
+		a0 = 0;
+		RunLength = 0;
+		pa = thisrun;
+#ifdef FAX3_DEBUG
+		printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail);
+		printf("-------------------- %d\n", tif->tif_row);
+		fflush(stdout);
+#endif
+		SYNC_EOL(EOF1D);
+		EXPAND1D(EOF1Da);
+		(*sp->fill)(buf, thisrun, pa, lastx);
+		buf += sp->b.rowbytes;
+		occ -= sp->b.rowbytes;
+                line++;
+		continue;
+	EOF1D:				/* premature EOF */
+		CLEANUP_RUNS();
+	EOF1Da:				/* premature EOF */
+		(*sp->fill)(buf, thisrun, pa, lastx);
+		UNCACHE_STATE(tif, sp);
+		return (-1);
+	}
+	UNCACHE_STATE(tif, sp);
+	return (1);
+}
+
+#define	SWAP(t,a,b)	{ t x; x = (a); (a) = (b); (b) = x; }
+/*
+ * Decode the requested amount of G3 2D-encoded data.
+ */
+static int
+Fax3Decode2D(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
+{
+	DECLARE_STATE_2D(tif, sp, "Fax3Decode2D");
+        int line = 0;
+	int is1D;			/* current line is 1d/2d-encoded */
+
+	(void) s;
+	CACHE_STATE(tif, sp);
+	while ((long)occ > 0) {
+		a0 = 0;
+		RunLength = 0;
+		pa = thisrun = sp->curruns;
+#ifdef FAX3_DEBUG
+		printf("\nBitAcc=%08X, BitsAvail = %d EOLcnt = %d",
+		    BitAcc, BitsAvail, EOLcnt);
+#endif
+		SYNC_EOL(EOF2D);
+		NeedBits8(1, EOF2D);
+		is1D = GetBits(1);	/* 1D/2D-encoding tag bit */
+		ClrBits(1);
+#ifdef FAX3_DEBUG
+		printf(" %s\n-------------------- %d\n",
+		    is1D ? "1D" : "2D", tif->tif_row);
+		fflush(stdout);
+#endif
+		pb = sp->refruns;
+		b1 = *pb++;
+		if (is1D)
+			EXPAND1D(EOF2Da);
+		else
+			EXPAND2D(EOF2Da);
+		(*sp->fill)(buf, thisrun, pa, lastx);
+		SETVALUE(0);		/* imaginary change for reference */
+		SWAP(uint32*, sp->curruns, sp->refruns);
+		buf += sp->b.rowbytes;
+		occ -= sp->b.rowbytes;
+                line++;
+		continue;
+	EOF2D:				/* premature EOF */
+		CLEANUP_RUNS();
+	EOF2Da:				/* premature EOF */
+		(*sp->fill)(buf, thisrun, pa, lastx);
+		UNCACHE_STATE(tif, sp);
+		return (-1);
+	}
+	UNCACHE_STATE(tif, sp);
+	return (1);
+}
+#undef SWAP
+
+/*
+ * The ZERO & FILL macros must handle spans < 2*sizeof(long) bytes.
+ * For machines with 64-bit longs this is <16 bytes; otherwise
+ * this is <8 bytes.  We optimize the code here to reflect the
+ * machine characteristics.
+ */
+#if SIZEOF_LONG == 8
+# define FILL(n, cp)							    \
+    switch (n) {							    \
+    case 15:(cp)[14] = 0xff; case 14:(cp)[13] = 0xff; case 13: (cp)[12] = 0xff;\
+    case 12:(cp)[11] = 0xff; case 11:(cp)[10] = 0xff; case 10: (cp)[9] = 0xff;\
+    case  9: (cp)[8] = 0xff; case  8: (cp)[7] = 0xff; case  7: (cp)[6] = 0xff;\
+    case  6: (cp)[5] = 0xff; case  5: (cp)[4] = 0xff; case  4: (cp)[3] = 0xff;\
+    case  3: (cp)[2] = 0xff; case  2: (cp)[1] = 0xff;			      \
+    case  1: (cp)[0] = 0xff; (cp) += (n); case 0:  ;			      \
+    }
+# define ZERO(n, cp)							\
+    switch (n) {							\
+    case 15:(cp)[14] = 0; case 14:(cp)[13] = 0; case 13: (cp)[12] = 0;	\
+    case 12:(cp)[11] = 0; case 11:(cp)[10] = 0; case 10: (cp)[9] = 0;	\
+    case  9: (cp)[8] = 0; case  8: (cp)[7] = 0; case  7: (cp)[6] = 0;	\
+    case  6: (cp)[5] = 0; case  5: (cp)[4] = 0; case  4: (cp)[3] = 0;	\
+    case  3: (cp)[2] = 0; case  2: (cp)[1] = 0;				\
+    case  1: (cp)[0] = 0; (cp) += (n); case 0:  ;			\
+    }
+#else
+# define FILL(n, cp)							    \
+    switch (n) {							    \
+    case 7: (cp)[6] = 0xff; case 6: (cp)[5] = 0xff; case 5: (cp)[4] = 0xff; \
+    case 4: (cp)[3] = 0xff; case 3: (cp)[2] = 0xff; case 2: (cp)[1] = 0xff; \
+    case 1: (cp)[0] = 0xff; (cp) += (n); case 0:  ;			    \
+    }
+# define ZERO(n, cp)							\
+    switch (n) {							\
+    case 7: (cp)[6] = 0; case 6: (cp)[5] = 0; case 5: (cp)[4] = 0;	\
+    case 4: (cp)[3] = 0; case 3: (cp)[2] = 0; case 2: (cp)[1] = 0;	\
+    case 1: (cp)[0] = 0; (cp) += (n); case 0:  ;			\
+    }
+#endif
+
+/*
+ * Bit-fill a row according to the white/black
+ * runs generated during G3/G4 decoding.
+ */
+void
+_TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
+{
+	static const unsigned char _fillmasks[] =
+	    { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff };
+	unsigned char* cp;
+	uint32 x, bx, run;
+	int32 n, nw;
+	long* lp;
+
+	if ((erun-runs)&1)
+	    *erun++ = 0;
+	x = 0;
+	for (; runs < erun; runs += 2) {
+	    run = runs[0];
+	    if (x+run > lastx || run > lastx )
+		run = runs[0] = (uint32) (lastx - x);
+	    if (run) {
+		cp = buf + (x>>3);
+		bx = x&7;
+		if (run > 8-bx) {
+		    if (bx) {			/* align to byte boundary */
+			*cp++ &= 0xff << (8-bx);
+			run -= 8-bx;
+		    }
+		    if( (n = run >> 3) != 0 ) {	/* multiple bytes to fill */
+			if ((n/sizeof (long)) > 1) {
+			    /*
+			     * Align to longword boundary and fill.
+			     */
+			    for (; n && !isAligned(cp, long); n--)
+				    *cp++ = 0x00;
+			    lp = (long*) cp;
+			    nw = (int32)(n / sizeof (long));
+			    n -= nw * sizeof (long);
+			    do {
+				    *lp++ = 0L;
+			    } while (--nw);
+			    cp = (unsigned char*) lp;
+			}
+			ZERO(n, cp);
+			run &= 7;
+		    }
+		    if (run)
+			cp[0] &= 0xff >> run;
+		} else
+		    cp[0] &= ~(_fillmasks[run]>>bx);
+		x += runs[0];
+	    }
+	    run = runs[1];
+	    if (x+run > lastx || run > lastx )
+		run = runs[1] = lastx - x;
+	    if (run) {
+		cp = buf + (x>>3);
+		bx = x&7;
+		if (run > 8-bx) {
+		    if (bx) {			/* align to byte boundary */
+			*cp++ |= 0xff >> bx;
+			run -= 8-bx;
+		    }
+		    if( (n = run>>3) != 0 ) {	/* multiple bytes to fill */
+			if ((n/sizeof (long)) > 1) {
+			    /*
+			     * Align to longword boundary and fill.
+			     */
+			    for (; n && !isAligned(cp, long); n--)
+				*cp++ = 0xff;
+			    lp = (long*) cp;
+			    nw = (int32)(n / sizeof (long));
+			    n -= nw * sizeof (long);
+			    do {
+				*lp++ = -1L;
+			    } while (--nw);
+			    cp = (unsigned char*) lp;
+			}
+			FILL(n, cp);
+			run &= 7;
+		    }
+		    if (run)
+			cp[0] |= 0xff00 >> run;
+		} else
+		    cp[0] |= _fillmasks[run]>>bx;
+		x += runs[1];
+	    }
+	}
+	assert(x == lastx);
+}
+#undef	ZERO
+#undef	FILL
+
+/*
+ * Setup G3/G4-related compression/decompression state
+ * before data is processed.  This routine is called once
+ * per image -- it sets up different state based on whether
+ * or not decoding or encoding is being done and whether
+ * 1D- or 2D-encoded data is involved.
+ */
+static int
+Fax3SetupState(TIFF* tif)
+{
+	TIFFDirectory* td = &tif->tif_dir;
+	Fax3BaseState* sp = Fax3State(tif);
+	int needsRefLine;
+	Fax3CodecState* dsp = (Fax3CodecState*) Fax3State(tif);
+	uint32 rowbytes, rowpixels, nruns;
+
+	if (td->td_bitspersample != 1) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "Bits/sample must be 1 for Group 3/4 encoding/decoding");
+		return (0);
+	}
+	/*
+	 * Calculate the scanline/tile widths.
+	 */
+	if (isTiled(tif)) {
+		rowbytes = TIFFTileRowSize(tif);
+		rowpixels = td->td_tilewidth;
+	} else {
+		rowbytes = TIFFScanlineSize(tif);
+		rowpixels = td->td_imagewidth;
+	}
+	sp->rowbytes = (uint32) rowbytes;
+	sp->rowpixels = (uint32) rowpixels;
+	/*
+	 * Allocate any additional space required for decoding/encoding.
+	 */
+	needsRefLine = (
+	    (sp->groupoptions & GROUP3OPT_2DENCODING) ||
+	    td->td_compression == COMPRESSION_CCITTFAX4
+	);
+
+	nruns = needsRefLine ? 2*TIFFroundup(rowpixels,32) : rowpixels;
+
+	dsp->runs = (uint32*) _TIFFCheckMalloc(tif, 2*nruns+3, sizeof (uint32),
+					  "for Group 3/4 run arrays");
+	if (dsp->runs == NULL)
+		return (0);
+	dsp->curruns = dsp->runs;
+	if (needsRefLine)
+		dsp->refruns = dsp->runs + (nruns>>1);
+	else
+		dsp->refruns = NULL;
+	if (td->td_compression == COMPRESSION_CCITTFAX3
+	    && is2DEncoding(dsp)) {	/* NB: default is 1D routine */
+		tif->tif_decoderow = Fax3Decode2D;
+		tif->tif_decodestrip = Fax3Decode2D;
+		tif->tif_decodetile = Fax3Decode2D;
+	}
+
+	if (needsRefLine) {		/* 2d encoding */
+		Fax3CodecState* esp = EncoderState(tif);
+		/*
+		 * 2d encoding requires a scanline
+		 * buffer for the ``reference line''; the
+		 * scanline against which delta encoding
+		 * is referenced.  The reference line must
+		 * be initialized to be ``white'' (done elsewhere).
+		 */
+		esp->refline = (unsigned char*) _TIFFmalloc(rowbytes);
+		if (esp->refline == NULL) {
+			TIFFErrorExt(tif->tif_clientdata, "Fax3SetupState",
+			    "%s: No space for Group 3/4 reference line",
+			    tif->tif_name);
+			return (0);
+		}
+	} else					/* 1d encoding */
+		EncoderState(tif)->refline = NULL;
+
+	return (1);
+}
+
+/*
+ * CCITT Group 3 FAX Encoding.
+ */
+
+#define	Fax3FlushBits(tif, sp) {				\
+	if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize)		\
+		(void) TIFFFlushData1(tif);			\
+	*(tif)->tif_rawcp++ = (tidataval_t) (sp)->data;		\
+	(tif)->tif_rawcc++;					\
+	(sp)->data = 0, (sp)->bit = 8;				\
+}
+#define	_FlushBits(tif) {					\
+	if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize)		\
+		(void) TIFFFlushData1(tif);			\
+	*(tif)->tif_rawcp++ = (tidataval_t) data;		\
+	(tif)->tif_rawcc++;					\
+	data = 0, bit = 8;					\
+}
+static const int _msbmask[9] =
+    { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
+#define	_PutBits(tif, bits, length) {				\
+	while (length > bit) {					\
+		data |= bits >> (length - bit);			\
+		length -= bit;					\
+		_FlushBits(tif);				\
+	}							\
+	data |= (bits & _msbmask[length]) << (bit - length);	\
+	bit -= length;						\
+	if (bit == 0)						\
+		_FlushBits(tif);				\
+}
+	
+/*
+ * Write a variable-length bit-value to
+ * the output stream.  Values are
+ * assumed to be at most 16 bits.
+ */
+static void
+Fax3PutBits(TIFF* tif, unsigned int bits, unsigned int length)
+{
+	Fax3CodecState* sp = EncoderState(tif);
+	unsigned int bit = sp->bit;
+	int data = sp->data;
+
+	_PutBits(tif, bits, length);
+
+	sp->data = data;
+	sp->bit = bit;
+}
+
+/*
+ * Write a code to the output stream.
+ */
+#define putcode(tif, te)	Fax3PutBits(tif, (te)->code, (te)->length)
+
+#ifdef FAX3_DEBUG
+#define	DEBUG_COLOR(w) (tab == TIFFFaxWhiteCodes ? w "W" : w "B")
+#define	DEBUG_PRINT(what,len) {						\
+    int t;								\
+    printf("%08X/%-2d: %s%5d\t", data, bit, DEBUG_COLOR(what), len);	\
+    for (t = length-1; t >= 0; t--)					\
+	putchar(code & (1<<t) ? '1' : '0');				\
+    putchar('\n');							\
+}
+#endif
+
+/*
+ * Write the sequence of codes that describes
+ * the specified span of zero's or one's.  The
+ * appropriate table that holds the make-up and
+ * terminating codes is supplied.
+ */
+static void
+putspan(TIFF* tif, int32 span, const tableentry* tab)
+{
+	Fax3CodecState* sp = EncoderState(tif);
+	unsigned int bit = sp->bit;
+	int data = sp->data;
+	unsigned int code, length;
+
+	while (span >= 2624) {
+		const tableentry* te = &tab[63 + (2560>>6)];
+		code = te->code, length = te->length;
+#ifdef FAX3_DEBUG
+		DEBUG_PRINT("MakeUp", te->runlen);
+#endif
+		_PutBits(tif, code, length);
+		span -= te->runlen;
+	}
+	if (span >= 64) {
+		const tableentry* te = &tab[63 + (span>>6)];
+		assert(te->runlen == 64*(span>>6));
+		code = te->code, length = te->length;
+#ifdef FAX3_DEBUG
+		DEBUG_PRINT("MakeUp", te->runlen);
+#endif
+		_PutBits(tif, code, length);
+		span -= te->runlen;
+	}
+	code = tab[span].code, length = tab[span].length;
+#ifdef FAX3_DEBUG
+	DEBUG_PRINT("  Term", tab[span].runlen);
+#endif
+	_PutBits(tif, code, length);
+
+	sp->data = data;
+	sp->bit = bit;
+}
+
+/*
+ * Write an EOL code to the output stream.  The zero-fill
+ * logic for byte-aligning encoded scanlines is handled
+ * here.  We also handle writing the tag bit for the next
+ * scanline when doing 2d encoding.
+ */
+static void
+Fax3PutEOL(TIFF* tif)
+{
+	Fax3CodecState* sp = EncoderState(tif);
+	unsigned int bit = sp->bit;
+	int data = sp->data;
+	unsigned int code, length, tparm;
+
+	if (sp->b.groupoptions & GROUP3OPT_FILLBITS) {
+		/*
+		 * Force bit alignment so EOL will terminate on
+		 * a byte boundary.  That is, force the bit alignment
+		 * to 16-12 = 4 before putting out the EOL code.
+		 */
+		int align = 8 - 4;
+		if (align != sp->bit) {
+			if (align > sp->bit)
+				align = sp->bit + (8 - align);
+			else
+				align = sp->bit - align;
+			code = 0;
+			tparm=align; 
+			_PutBits(tif, 0, tparm);
+		}
+	}
+	code = EOL, length = 12;
+	if (is2DEncoding(sp))
+		code = (code<<1) | (sp->tag == G3_1D), length++;
+	_PutBits(tif, code, length);
+
+	sp->data = data;
+	sp->bit = bit;
+}
+
+/*
+ * Reset encoding state at the start of a strip.
+ */
+static int
+Fax3PreEncode(TIFF* tif, tsample_t s)
+{
+	Fax3CodecState* sp = EncoderState(tif);
+
+	(void) s;
+	assert(sp != NULL);
+	sp->bit = 8;
+	sp->data = 0;
+	sp->tag = G3_1D;
+	/*
+	 * This is necessary for Group 4; otherwise it isn't
+	 * needed because the first scanline of each strip ends
+	 * up being copied into the refline.
+	 */
+	if (sp->refline)
+		_TIFFmemset(sp->refline, 0x00, sp->b.rowbytes);
+	if (is2DEncoding(sp)) {
+		float res = tif->tif_dir.td_yresolution;
+		/*
+		 * The CCITT spec says that when doing 2d encoding, you
+		 * should only do it on K consecutive scanlines, where K
+		 * depends on the resolution of the image being encoded
+		 * (2 for <= 200 lpi, 4 for > 200 lpi).  Since the directory
+		 * code initializes td_yresolution to 0, this code will
+		 * select a K of 2 unless the YResolution tag is set
+		 * appropriately.  (Note also that we fudge a little here
+		 * and use 150 lpi to avoid problems with units conversion.)
+		 */
+		if (tif->tif_dir.td_resolutionunit == RESUNIT_CENTIMETER)
+			res *= 2.54f;		/* convert to inches */
+		sp->maxk = (res > 150 ? 4 : 2);
+		sp->k = sp->maxk-1;
+	} else
+		sp->k = sp->maxk = 0;
+	return (1);
+}
+
+static const unsigned char zeroruns[256] = {
+    8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,	/* 0x00 - 0x0f */
+    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,	/* 0x10 - 0x1f */
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,	/* 0x20 - 0x2f */
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,	/* 0x30 - 0x3f */
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	/* 0x40 - 0x4f */
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	/* 0x50 - 0x5f */
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	/* 0x60 - 0x6f */
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	/* 0x70 - 0x7f */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0x80 - 0x8f */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0x90 - 0x9f */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0xa0 - 0xaf */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0xb0 - 0xbf */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0xc0 - 0xcf */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0xd0 - 0xdf */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0xe0 - 0xef */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0xf0 - 0xff */
+};
+static const unsigned char oneruns[256] = {
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0x00 - 0x0f */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0x10 - 0x1f */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0x20 - 0x2f */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0x30 - 0x3f */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0x40 - 0x4f */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0x50 - 0x5f */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0x60 - 0x6f */
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 0x70 - 0x7f */
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	/* 0x80 - 0x8f */
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	/* 0x90 - 0x9f */
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	/* 0xa0 - 0xaf */
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	/* 0xb0 - 0xbf */
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,	/* 0xc0 - 0xcf */
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,	/* 0xd0 - 0xdf */
+    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,	/* 0xe0 - 0xef */
+    4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8,	/* 0xf0 - 0xff */
+};
+
+/*
+ * On certain systems it pays to inline
+ * the routines that find pixel spans.
+ */
+#ifdef VAXC
+static	int32 find0span(unsigned char*, int32, int32);
+static	int32 find1span(unsigned char*, int32, int32);
+#pragma inline(find0span,find1span)
+#endif
+
+/*
+ * Find a span of ones or zeros using the supplied
+ * table.  The ``base'' of the bit string is supplied
+ * along with the start+end bit indices.
+ */
+inline static int32
+find0span(unsigned char* bp, int32 bs, int32 be)
+{
+	int32 bits = be - bs;
+	int32 n, span;
+
+	bp += bs>>3;
+	/*
+	 * Check partial byte on lhs.
+	 */
+	if (bits > 0 && (n = (bs & 7))) {
+		span = zeroruns[(*bp << n) & 0xff];
+		if (span > 8-n)		/* table value too generous */
+			span = 8-n;
+		if (span > bits)	/* constrain span to bit range */
+			span = bits;
+		if (n+span < 8)		/* doesn't extend to edge of byte */
+			return (span);
+		bits -= span;
+		bp++;
+	} else
+		span = 0;
+	if (bits >= (int32)(2 * 8 * sizeof(long))) {
+		long* lp;
+		/*
+		 * Align to longword boundary and check longwords.
+		 */
+		while (!isAligned(bp, long)) {
+			if (*bp != 0x00)
+				return (span + zeroruns[*bp]);
+			span += 8, bits -= 8;
+			bp++;
+		}
+		lp = (long*) bp;
+		while ((bits >= (int32)(8 * sizeof(long))) && (0 == *lp)) {
+			span += 8*sizeof (long), bits -= 8*sizeof (long);
+			lp++;
+		}
+		bp = (unsigned char*) lp;
+	}
+	/*
+	 * Scan full bytes for all 0's.
+	 */
+	while (bits >= 8) {
+		if (*bp != 0x00)	/* end of run */
+			return (span + zeroruns[*bp]);
+		span += 8, bits -= 8;
+		bp++;
+	}
+	/*
+	 * Check partial byte on rhs.
+	 */
+	if (bits > 0) {
+		n = zeroruns[*bp];
+		span += (n > bits ? bits : n);
+	}
+	return (span);
+}
+
+inline static int32
+find1span(unsigned char* bp, int32 bs, int32 be)
+{
+	int32 bits = be - bs;
+	int32 n, span;
+
+	bp += bs>>3;
+	/*
+	 * Check partial byte on lhs.
+	 */
+	if (bits > 0 && (n = (bs & 7))) {
+		span = oneruns[(*bp << n) & 0xff];
+		if (span > 8-n)		/* table value too generous */
+			span = 8-n;
+		if (span > bits)	/* constrain span to bit range */
+			span = bits;
+		if (n+span < 8)		/* doesn't extend to edge of byte */
+			return (span);
+		bits -= span;
+		bp++;
+	} else
+		span = 0;
+	if (bits >= (int32)(2 * 8 * sizeof(long))) {
+		long* lp;
+		/*
+		 * Align to longword boundary and check longwords.
+		 */
+		while (!isAligned(bp, long)) {
+			if (*bp != 0xff)
+				return (span + oneruns[*bp]);
+			span += 8, bits -= 8;
+			bp++;
+		}
+		lp = (long*) bp;
+		while ((bits >= (int32)(8 * sizeof(long))) && (~0 == *lp)) {
+			span += 8*sizeof (long), bits -= 8*sizeof (long);
+			lp++;
+		}
+		bp = (unsigned char*) lp;
+	}
+	/*
+	 * Scan full bytes for all 1's.
+	 */
+	while (bits >= 8) {
+		if (*bp != 0xff)	/* end of run */
+			return (span + oneruns[*bp]);
+		span += 8, bits -= 8;
+		bp++;
+	}
+	/*
+	 * Check partial byte on rhs.
+	 */
+	if (bits > 0) {
+		n = oneruns[*bp];
+		span += (n > bits ? bits : n);
+	}
+	return (span);
+}
+
+/*
+ * Return the offset of the next bit in the range
+ * [bs..be] that is different from the specified
+ * color.  The end, be, is returned if no such bit
+ * exists.
+ */
+#define	finddiff(_cp, _bs, _be, _color)	\
+	(_bs + (_color ? find1span(_cp,_bs,_be) : find0span(_cp,_bs,_be)))
+/*
+ * Like finddiff, but also check the starting bit
+ * against the end in case start > end.
+ */
+#define	finddiff2(_cp, _bs, _be, _color) \
+	(_bs < _be ? finddiff(_cp,_bs,_be,_color) : _be)
+
+/*
+ * 1d-encode a row of pixels.  The encoding is
+ * a sequence of all-white or all-black spans
+ * of pixels encoded with Huffman codes.
+ */
+static int
+Fax3Encode1DRow(TIFF* tif, unsigned char* bp, uint32 bits)
+{
+	Fax3CodecState* sp = EncoderState(tif);
+	int32 span;
+        uint32 bs = 0;
+
+	for (;;) {
+		span = find0span(bp, bs, bits);		/* white span */
+		putspan(tif, span, TIFFFaxWhiteCodes);
+		bs += span;
+		if (bs >= bits)
+			break;
+		span = find1span(bp, bs, bits);		/* black span */
+		putspan(tif, span, TIFFFaxBlackCodes);
+		bs += span;
+		if (bs >= bits)
+			break;
+	}
+	if (sp->b.mode & (FAXMODE_BYTEALIGN|FAXMODE_WORDALIGN)) {
+		if (sp->bit != 8)			/* byte-align */
+			Fax3FlushBits(tif, sp);
+		if ((sp->b.mode&FAXMODE_WORDALIGN) &&
+		    !isAligned(tif->tif_rawcp, uint16))
+			Fax3FlushBits(tif, sp);
+	}
+	return (1);
+}
+
+static const tableentry horizcode =
+    { 3, 0x1, 0 };	/* 001 */
+static const tableentry passcode =
+    { 4, 0x1, 0 };	/* 0001 */
+static const tableentry vcodes[7] = {
+    { 7, 0x03, 0 },	/* 0000 011 */
+    { 6, 0x03, 0 },	/* 0000 11 */
+    { 3, 0x03, 0 },	/* 011 */
+    { 1, 0x1, 0 },	/* 1 */
+    { 3, 0x2, 0 },	/* 010 */
+    { 6, 0x02, 0 },	/* 0000 10 */
+    { 7, 0x02, 0 }	/* 0000 010 */
+};
+
+/*
+ * 2d-encode a row of pixels.  Consult the CCITT
+ * documentation for the algorithm.
+ */
+static int
+Fax3Encode2DRow(TIFF* tif, unsigned char* bp, unsigned char* rp, uint32 bits)
+{
+#define	PIXEL(buf,ix)	((((buf)[(ix)>>3]) >> (7-((ix)&7))) & 1)
+        uint32 a0 = 0;
+	uint32 a1 = (PIXEL(bp, 0) != 0 ? 0 : finddiff(bp, 0, bits, 0));
+	uint32 b1 = (PIXEL(rp, 0) != 0 ? 0 : finddiff(rp, 0, bits, 0));
+	uint32 a2, b2;
+
+	for (;;) {
+		b2 = finddiff2(rp, b1, bits, PIXEL(rp,b1));
+		if (b2 >= a1) {
+			int32 d = b1 - a1;
+			if (!(-3 <= d && d <= 3)) {	/* horizontal mode */
+				a2 = finddiff2(bp, a1, bits, PIXEL(bp,a1));
+				putcode(tif, &horizcode);
+				if (a0+a1 == 0 || PIXEL(bp, a0) == 0) {
+					putspan(tif, a1-a0, TIFFFaxWhiteCodes);
+					putspan(tif, a2-a1, TIFFFaxBlackCodes);
+				} else {
+					putspan(tif, a1-a0, TIFFFaxBlackCodes);
+					putspan(tif, a2-a1, TIFFFaxWhiteCodes);
+				}
+				a0 = a2;
+			} else {			/* vertical mode */
+				putcode(tif, &vcodes[d+3]);
+				a0 = a1;
+			}
+		} else {				/* pass mode */
+			putcode(tif, &passcode);
+			a0 = b2;
+		}
+		if (a0 >= bits)
+			break;
+		a1 = finddiff(bp, a0, bits, PIXEL(bp,a0));
+		b1 = finddiff(rp, a0, bits, !PIXEL(bp,a0));
+		b1 = finddiff(rp, b1, bits, PIXEL(bp,a0));
+	}
+	return (1);
+#undef PIXEL
+}
+
+/*
+ * Encode a buffer of pixels.
+ */
+static int
+Fax3Encode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	Fax3CodecState* sp = EncoderState(tif);
+
+	(void) s;
+	while ((long)cc > 0) {
+		if ((sp->b.mode & FAXMODE_NOEOL) == 0)
+			Fax3PutEOL(tif);
+		if (is2DEncoding(sp)) {
+			if (sp->tag == G3_1D) {
+				if (!Fax3Encode1DRow(tif, bp, sp->b.rowpixels))
+					return (0);
+				sp->tag = G3_2D;
+			} else {
+				if (!Fax3Encode2DRow(tif, bp, sp->refline,
+                                                     sp->b.rowpixels))
+					return (0);
+				sp->k--;
+			}
+			if (sp->k == 0) {
+				sp->tag = G3_1D;
+				sp->k = sp->maxk-1;
+			} else
+				_TIFFmemcpy(sp->refline, bp, sp->b.rowbytes);
+		} else {
+			if (!Fax3Encode1DRow(tif, bp, sp->b.rowpixels))
+				return (0);
+		}
+		bp += sp->b.rowbytes;
+		cc -= sp->b.rowbytes;
+	}
+	return (1);
+}
+
+static int
+Fax3PostEncode(TIFF* tif)
+{
+	Fax3CodecState* sp = EncoderState(tif);
+
+	if (sp->bit != 8)
+		Fax3FlushBits(tif, sp);
+	return (1);
+}
+
+static void
+Fax3Close(TIFF* tif)
+{
+	if ((Fax3State(tif)->mode & FAXMODE_NORTC) == 0) {
+		Fax3CodecState* sp = EncoderState(tif);
+		unsigned int code = EOL;
+		unsigned int length = 12;
+		int i;
+
+		if (is2DEncoding(sp))
+			code = (code<<1) | (sp->tag == G3_1D), length++;
+		for (i = 0; i < 6; i++)
+			Fax3PutBits(tif, code, length);
+		Fax3FlushBits(tif, sp);
+	}
+}
+
+static void
+Fax3Cleanup(TIFF* tif)
+{
+	Fax3CodecState* sp = DecoderState(tif);
+	
+	assert(sp != 0);
+
+	tif->tif_tagmethods.vgetfield = sp->b.vgetparent;
+	tif->tif_tagmethods.vsetfield = sp->b.vsetparent;
+
+	if (sp->runs)
+		_TIFFfree(sp->runs);
+	if (sp->refline)
+		_TIFFfree(sp->refline);
+
+	if (Fax3State(tif)->subaddress)
+		_TIFFfree(Fax3State(tif)->subaddress);
+	_TIFFfree(tif->tif_data);
+	tif->tif_data = NULL;
+
+	_TIFFSetDefaultCompressionState(tif);
+}
+
+#define	FIELD_BADFAXLINES	(FIELD_CODEC+0)
+#define	FIELD_CLEANFAXDATA	(FIELD_CODEC+1)
+#define	FIELD_BADFAXRUN		(FIELD_CODEC+2)
+#define	FIELD_RECVPARAMS	(FIELD_CODEC+3)
+#define	FIELD_SUBADDRESS	(FIELD_CODEC+4)
+#define	FIELD_RECVTIME		(FIELD_CODEC+5)
+#define	FIELD_FAXDCS		(FIELD_CODEC+6)
+
+#define	FIELD_OPTIONS		(FIELD_CODEC+7)
+
+static const TIFFFieldInfo faxFieldInfo[] = {
+    { TIFFTAG_FAXMODE,		 0, 0,	TIFF_ANY,	FIELD_PSEUDO,
+      FALSE,	FALSE,	"FaxMode" },
+    { TIFFTAG_FAXFILLFUNC,	 0, 0,	TIFF_ANY,	FIELD_PSEUDO,
+      FALSE,	FALSE,	"FaxFillFunc" },
+    { TIFFTAG_BADFAXLINES,	 1, 1,	TIFF_LONG,	FIELD_BADFAXLINES,
+      TRUE,	FALSE,	"BadFaxLines" },
+    { TIFFTAG_BADFAXLINES,	 1, 1,	TIFF_SHORT,	FIELD_BADFAXLINES,
+      TRUE,	FALSE,	"BadFaxLines" },
+    { TIFFTAG_CLEANFAXDATA,	 1, 1,	TIFF_SHORT,	FIELD_CLEANFAXDATA,
+      TRUE,	FALSE,	"CleanFaxData" },
+    { TIFFTAG_CONSECUTIVEBADFAXLINES,1,1, TIFF_LONG,	FIELD_BADFAXRUN,
+      TRUE,	FALSE,	"ConsecutiveBadFaxLines" },
+    { TIFFTAG_CONSECUTIVEBADFAXLINES,1,1, TIFF_SHORT,	FIELD_BADFAXRUN,
+      TRUE,	FALSE,	"ConsecutiveBadFaxLines" },
+    { TIFFTAG_FAXRECVPARAMS,	 1, 1, TIFF_LONG,	FIELD_RECVPARAMS,
+      TRUE,	FALSE,	"FaxRecvParams" },
+    { TIFFTAG_FAXSUBADDRESS,	-1,-1, TIFF_ASCII,	FIELD_SUBADDRESS,
+      TRUE,	FALSE,	"FaxSubAddress" },
+    { TIFFTAG_FAXRECVTIME,	 1, 1, TIFF_LONG,	FIELD_RECVTIME,
+      TRUE,	FALSE,	"FaxRecvTime" },
+    { TIFFTAG_FAXDCS,		-1,-1, TIFF_ASCII,	FIELD_FAXDCS,
+      TRUE,	FALSE,	"FaxDcs" },
+};
+static const TIFFFieldInfo fax3FieldInfo[] = {
+    { TIFFTAG_GROUP3OPTIONS,	 1, 1,	TIFF_LONG,	FIELD_OPTIONS,
+      FALSE,	FALSE,	"Group3Options" },
+};
+static const TIFFFieldInfo fax4FieldInfo[] = {
+    { TIFFTAG_GROUP4OPTIONS,	 1, 1,	TIFF_LONG,	FIELD_OPTIONS,
+      FALSE,	FALSE,	"Group4Options" },
+};
+#define	N(a)	(sizeof (a) / sizeof (a[0]))
+
+static int
+Fax3VSetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	Fax3BaseState* sp = Fax3State(tif);
+
+	assert(sp != 0);
+	assert(sp->vsetparent != 0);
+
+	switch (tag) {
+	case TIFFTAG_FAXMODE:
+		sp->mode = va_arg(ap, int);
+		return (1);			/* NB: pseudo tag */
+	case TIFFTAG_FAXFILLFUNC:
+		DecoderState(tif)->fill = va_arg(ap, TIFFFaxFillFunc);
+		return (1);			/* NB: pseudo tag */
+	case TIFFTAG_GROUP3OPTIONS:
+		/* XXX: avoid reading options if compression mismatches. */
+		if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX3)
+			sp->groupoptions = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_GROUP4OPTIONS:
+		/* XXX: avoid reading options if compression mismatches. */
+		if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4)
+			sp->groupoptions = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_BADFAXLINES:
+		sp->badfaxlines = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_CLEANFAXDATA:
+		sp->cleanfaxdata = (uint16) va_arg(ap, int);
+		break;
+	case TIFFTAG_CONSECUTIVEBADFAXLINES:
+		sp->badfaxrun = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_FAXRECVPARAMS:
+		sp->recvparams = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_FAXSUBADDRESS:
+		_TIFFsetString(&sp->subaddress, va_arg(ap, char*));
+		break;
+	case TIFFTAG_FAXRECVTIME:
+		sp->recvtime = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_FAXDCS:
+		_TIFFsetString(&sp->faxdcs, va_arg(ap, char*));
+		break;
+	default:
+		return (*sp->vsetparent)(tif, tag, ap);
+	}
+	TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit);
+	tif->tif_flags |= TIFF_DIRTYDIRECT;
+	return (1);
+}
+
+static int
+Fax3VGetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	Fax3BaseState* sp = Fax3State(tif);
+
+	switch (tag) {
+	case TIFFTAG_FAXMODE:
+		*va_arg(ap, int*) = sp->mode;
+		break;
+	case TIFFTAG_FAXFILLFUNC:
+		*va_arg(ap, TIFFFaxFillFunc*) = DecoderState(tif)->fill;
+		break;
+	case TIFFTAG_GROUP3OPTIONS:
+	case TIFFTAG_GROUP4OPTIONS:
+		*va_arg(ap, uint32*) = sp->groupoptions;
+		break;
+	case TIFFTAG_BADFAXLINES:
+		*va_arg(ap, uint32*) = sp->badfaxlines;
+		break;
+	case TIFFTAG_CLEANFAXDATA:
+		*va_arg(ap, uint16*) = sp->cleanfaxdata;
+		break;
+	case TIFFTAG_CONSECUTIVEBADFAXLINES:
+		*va_arg(ap, uint32*) = sp->badfaxrun;
+		break;
+	case TIFFTAG_FAXRECVPARAMS:
+		*va_arg(ap, uint32*) = sp->recvparams;
+		break;
+	case TIFFTAG_FAXSUBADDRESS:
+		*va_arg(ap, char**) = sp->subaddress;
+		break;
+	case TIFFTAG_FAXRECVTIME:
+		*va_arg(ap, uint32*) = sp->recvtime;
+		break;
+	case TIFFTAG_FAXDCS:
+		*va_arg(ap, char**) = sp->faxdcs;
+		break;
+	default:
+		return (*sp->vgetparent)(tif, tag, ap);
+	}
+	return (1);
+}
+
+static void
+Fax3PrintDir(TIFF* tif, FILE* fd, long flags)
+{
+	Fax3BaseState* sp = Fax3State(tif);
+
+	(void) flags;
+	if (TIFFFieldSet(tif,FIELD_OPTIONS)) {
+		const char* sep = " ";
+		if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4) {
+			fprintf(fd, "  Group 4 Options:");
+			if (sp->groupoptions & GROUP4OPT_UNCOMPRESSED)
+				fprintf(fd, "%suncompressed data", sep);
+		} else {
+
+			fprintf(fd, "  Group 3 Options:");
+			if (sp->groupoptions & GROUP3OPT_2DENCODING)
+				fprintf(fd, "%s2-d encoding", sep), sep = "+";
+			if (sp->groupoptions & GROUP3OPT_FILLBITS)
+				fprintf(fd, "%sEOL padding", sep), sep = "+";
+			if (sp->groupoptions & GROUP3OPT_UNCOMPRESSED)
+				fprintf(fd, "%suncompressed data", sep);
+		}
+		fprintf(fd, " (%lu = 0x%lx)\n",
+                        (unsigned long) sp->groupoptions,
+                        (unsigned long) sp->groupoptions);
+	}
+	if (TIFFFieldSet(tif,FIELD_CLEANFAXDATA)) {
+		fprintf(fd, "  Fax Data:");
+		switch (sp->cleanfaxdata) {
+		case CLEANFAXDATA_CLEAN:
+			fprintf(fd, " clean");
+			break;
+		case CLEANFAXDATA_REGENERATED:
+			fprintf(fd, " receiver regenerated");
+			break;
+		case CLEANFAXDATA_UNCLEAN:
+			fprintf(fd, " uncorrected errors");
+			break;
+		}
+		fprintf(fd, " (%u = 0x%x)\n",
+		    sp->cleanfaxdata, sp->cleanfaxdata);
+	}
+	if (TIFFFieldSet(tif,FIELD_BADFAXLINES))
+		fprintf(fd, "  Bad Fax Lines: %lu\n",
+                        (unsigned long) sp->badfaxlines);
+	if (TIFFFieldSet(tif,FIELD_BADFAXRUN))
+		fprintf(fd, "  Consecutive Bad Fax Lines: %lu\n",
+		    (unsigned long) sp->badfaxrun);
+	if (TIFFFieldSet(tif,FIELD_RECVPARAMS))
+		fprintf(fd, "  Fax Receive Parameters: %08lx\n",
+		   (unsigned long) sp->recvparams);
+	if (TIFFFieldSet(tif,FIELD_SUBADDRESS))
+		fprintf(fd, "  Fax SubAddress: %s\n", sp->subaddress);
+	if (TIFFFieldSet(tif,FIELD_RECVTIME))
+		fprintf(fd, "  Fax Receive Time: %lu secs\n",
+		    (unsigned long) sp->recvtime);
+	if (TIFFFieldSet(tif,FIELD_FAXDCS))
+		fprintf(fd, "  Fax DCS: %s\n", sp->faxdcs);
+}
+
+static int
+InitCCITTFax3(TIFF* tif)
+{
+	Fax3BaseState* sp;
+
+	/*
+	 * Allocate state block so tag methods have storage to record values.
+	 */
+	tif->tif_data = (tidata_t)
+		_TIFFmalloc(sizeof (Fax3CodecState));
+
+	if (tif->tif_data == NULL) {
+		TIFFErrorExt(tif->tif_clientdata, "TIFFInitCCITTFax3",
+		    "%s: No space for state block", tif->tif_name);
+		return (0);
+	}
+
+	sp = Fax3State(tif);
+        sp->rw_mode = tif->tif_mode;
+
+	/*
+	 * Merge codec-specific tag information and
+	 * override parent get/set field methods.
+	 */
+	_TIFFMergeFieldInfo(tif, faxFieldInfo, N(faxFieldInfo));
+	sp->vgetparent = tif->tif_tagmethods.vgetfield;
+	tif->tif_tagmethods.vgetfield = Fax3VGetField; /* hook for codec tags */
+	sp->vsetparent = tif->tif_tagmethods.vsetfield;
+	tif->tif_tagmethods.vsetfield = Fax3VSetField; /* hook for codec tags */
+	tif->tif_tagmethods.printdir = Fax3PrintDir;   /* hook for codec tags */
+	sp->groupoptions = 0;	
+	sp->recvparams = 0;
+	sp->subaddress = NULL;
+	sp->faxdcs = NULL;
+
+	if (sp->rw_mode == O_RDONLY) /* FIXME: improve for in place update */
+		tif->tif_flags |= TIFF_NOBITREV; /* decoder does bit reversal */
+	DecoderState(tif)->runs = NULL;
+	TIFFSetField(tif, TIFFTAG_FAXFILLFUNC, _TIFFFax3fillruns);
+	EncoderState(tif)->refline = NULL;
+
+	/*
+	 * Install codec methods.
+	 */
+	tif->tif_setupdecode = Fax3SetupState;
+	tif->tif_predecode = Fax3PreDecode;
+	tif->tif_decoderow = Fax3Decode1D;
+	tif->tif_decodestrip = Fax3Decode1D;
+	tif->tif_decodetile = Fax3Decode1D;
+	tif->tif_setupencode = Fax3SetupState;
+	tif->tif_preencode = Fax3PreEncode;
+	tif->tif_postencode = Fax3PostEncode;
+	tif->tif_encoderow = Fax3Encode;
+	tif->tif_encodestrip = Fax3Encode;
+	tif->tif_encodetile = Fax3Encode;
+	tif->tif_close = Fax3Close;
+	tif->tif_cleanup = Fax3Cleanup;
+
+	return (1);
+}
+
+int
+TIFFInitCCITTFax3(TIFF* tif, int scheme)
+{
+	(void) scheme;
+	if (InitCCITTFax3(tif)) {
+		_TIFFMergeFieldInfo(tif, fax3FieldInfo, N(fax3FieldInfo));
+
+		/*
+		 * The default format is Class/F-style w/o RTC.
+		 */
+		return TIFFSetField(tif, TIFFTAG_FAXMODE, FAXMODE_CLASSF);
+	} else
+		return (0);
+}
+
+/*
+ * CCITT Group 4 (T.6) Facsimile-compatible
+ * Compression Scheme Support.
+ */
+
+#define	SWAP(t,a,b)	{ t x; x = (a); (a) = (b); (b) = x; }
+/*
+ * Decode the requested amount of G4-encoded data.
+ */
+static int
+Fax4Decode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
+{
+	DECLARE_STATE_2D(tif, sp, "Fax4Decode");
+        int line = 0;
+
+	(void) s;
+	CACHE_STATE(tif, sp);
+	while ((long)occ > 0) {
+		a0 = 0;
+		RunLength = 0;
+		pa = thisrun = sp->curruns;
+		pb = sp->refruns;
+		b1 = *pb++;
+#ifdef FAX3_DEBUG
+		printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail);
+		printf("-------------------- %d\n", tif->tif_row);
+		fflush(stdout);
+#endif
+		EXPAND2D(EOFG4);
+                if (EOLcnt)
+                    goto EOFG4;
+		(*sp->fill)(buf, thisrun, pa, lastx);
+		SETVALUE(0);		/* imaginary change for reference */
+		SWAP(uint32*, sp->curruns, sp->refruns);
+		buf += sp->b.rowbytes;
+		occ -= sp->b.rowbytes;
+                line++;
+		continue;
+	EOFG4:
+                NeedBits16( 13, BADG4 );
+        BADG4:
+#ifdef FAX3_DEBUG
+                if( GetBits(13) != 0x1001 )
+                    fputs( "Bad RTC\n", stderr );
+#endif                
+                ClrBits( 13 );
+		(*sp->fill)(buf, thisrun, pa, lastx);
+		UNCACHE_STATE(tif, sp);
+		return (-1);
+	}
+	UNCACHE_STATE(tif, sp);
+	return (1);
+}
+#undef	SWAP
+
+/*
+ * Encode the requested amount of data.
+ */
+static int
+Fax4Encode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	Fax3CodecState *sp = EncoderState(tif);
+
+	(void) s;
+	while ((long)cc > 0) {
+		if (!Fax3Encode2DRow(tif, bp, sp->refline, sp->b.rowpixels))
+			return (0);
+		_TIFFmemcpy(sp->refline, bp, sp->b.rowbytes);
+		bp += sp->b.rowbytes;
+		cc -= sp->b.rowbytes;
+	}
+	return (1);
+}
+
+static int
+Fax4PostEncode(TIFF* tif)
+{
+	Fax3CodecState *sp = EncoderState(tif);
+
+	/* terminate strip w/ EOFB */
+	Fax3PutBits(tif, EOL, 12);
+	Fax3PutBits(tif, EOL, 12);
+	if (sp->bit != 8)
+		Fax3FlushBits(tif, sp);
+	return (1);
+}
+
+int
+TIFFInitCCITTFax4(TIFF* tif, int scheme)
+{
+	(void) scheme;
+	if (InitCCITTFax3(tif)) {		/* reuse G3 support */
+		_TIFFMergeFieldInfo(tif, fax4FieldInfo, N(fax4FieldInfo));
+
+		tif->tif_decoderow = Fax4Decode;
+		tif->tif_decodestrip = Fax4Decode;
+		tif->tif_decodetile = Fax4Decode;
+		tif->tif_encoderow = Fax4Encode;
+		tif->tif_encodestrip = Fax4Encode;
+		tif->tif_encodetile = Fax4Encode;
+		tif->tif_postencode = Fax4PostEncode;
+		/*
+		 * Suppress RTC at the end of each strip.
+		 */
+		return TIFFSetField(tif, TIFFTAG_FAXMODE, FAXMODE_NORTC);
+	} else
+		return (0);
+}
+
+/*
+ * CCITT Group 3 1-D Modified Huffman RLE Compression Support.
+ * (Compression algorithms 2 and 32771)
+ */
+
+/*
+ * Decode the requested amount of RLE-encoded data.
+ */
+static int
+Fax3DecodeRLE(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
+{
+	DECLARE_STATE(tif, sp, "Fax3DecodeRLE");
+	int mode = sp->b.mode;
+        int line = 0;
+
+	(void) s;
+	CACHE_STATE(tif, sp);
+	thisrun = sp->curruns;
+	while ((long)occ > 0) {
+		a0 = 0;
+		RunLength = 0;
+		pa = thisrun;
+#ifdef FAX3_DEBUG
+		printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail);
+		printf("-------------------- %d\n", tif->tif_row);
+		fflush(stdout);
+#endif
+		EXPAND1D(EOFRLE);
+		(*sp->fill)(buf, thisrun, pa, lastx);
+		/*
+		 * Cleanup at the end of the row.
+		 */
+		if (mode & FAXMODE_BYTEALIGN) {
+			int n = BitsAvail - (BitsAvail &~ 7);
+			ClrBits(n);
+		} else if (mode & FAXMODE_WORDALIGN) {
+			int n = BitsAvail - (BitsAvail &~ 15);
+			ClrBits(n);
+			if (BitsAvail == 0 && !isAligned(cp, uint16))
+			    cp++;
+		}
+		buf += sp->b.rowbytes;
+		occ -= sp->b.rowbytes;
+                line++;
+		continue;
+	EOFRLE:				/* premature EOF */
+		(*sp->fill)(buf, thisrun, pa, lastx);
+		UNCACHE_STATE(tif, sp);
+		return (-1);
+	}
+	UNCACHE_STATE(tif, sp);
+	return (1);
+}
+
+int
+TIFFInitCCITTRLE(TIFF* tif, int scheme)
+{
+	(void) scheme;
+	if (InitCCITTFax3(tif)) {		/* reuse G3 support */
+		tif->tif_decoderow = Fax3DecodeRLE;
+		tif->tif_decodestrip = Fax3DecodeRLE;
+		tif->tif_decodetile = Fax3DecodeRLE;
+		/*
+		 * Suppress RTC+EOLs when encoding and byte-align data.
+		 */
+		return TIFFSetField(tif, TIFFTAG_FAXMODE,
+		    FAXMODE_NORTC|FAXMODE_NOEOL|FAXMODE_BYTEALIGN);
+	} else
+		return (0);
+}
+
+int
+TIFFInitCCITTRLEW(TIFF* tif, int scheme)
+{
+	(void) scheme;
+	if (InitCCITTFax3(tif)) {		/* reuse G3 support */
+		tif->tif_decoderow = Fax3DecodeRLE;
+		tif->tif_decodestrip = Fax3DecodeRLE;
+		tif->tif_decodetile = Fax3DecodeRLE;
+		/*
+		 * Suppress RTC+EOLs when encoding and word-align data.
+		 */
+		return TIFFSetField(tif, TIFFTAG_FAXMODE,
+		    FAXMODE_NORTC|FAXMODE_NOEOL|FAXMODE_WORDALIGN);
+	} else
+		return (0);
+}
+#endif /* CCITT_SUPPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_fax3.h b/src/tiff/tif_fax3.h
new file mode 100644
index 0000000..e5e1b80
--- /dev/null
+++ b/src/tiff/tif_fax3.h
@@ -0,0 +1,525 @@
+/* $Id: tif_fax3.h 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1990-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _FAX3_
+#define	_FAX3_
+/*
+ * TIFF Library.
+ *
+ * CCITT Group 3 (T.4) and Group 4 (T.6) Decompression Support.
+ *
+ * Decoder support is derived, with permission, from the code
+ * in Frank Cringle's viewfax program;
+ *      Copyright (C) 1990, 1995  Frank D. Cringle.
+ */
+#include "tiff.h"
+
+/*
+ * To override the default routine used to image decoded
+ * spans one can use the pseduo tag TIFFTAG_FAXFILLFUNC.
+ * The routine must have the type signature given below;
+ * for example:
+ *
+ * fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
+ *
+ * where buf is place to set the bits, runs is the array of b&w run
+ * lengths (white then black), erun is the last run in the array, and
+ * lastx is the width of the row in pixels.  Fill routines can assume
+ * the run array has room for at least lastx runs and can overwrite
+ * data in the run array as needed (e.g. to append zero runs to bring
+ * the count up to a nice multiple).
+ */
+typedef	void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);
+
+/*
+ * The default run filler; made external for other decoders.
+ */
+#if defined(__cplusplus)
+extern "C" {
+#endif
+extern	void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
+#if defined(__cplusplus)
+}
+#endif
+
+
+/* finite state machine codes */
+#define S_Null		0
+#define S_Pass		1
+#define S_Horiz		2
+#define S_V0		3
+#define S_VR		4
+#define S_VL		5
+#define S_Ext		6
+#define S_TermW		7
+#define S_TermB		8
+#define S_MakeUpW	9
+#define S_MakeUpB	10
+#define S_MakeUp	11
+#define S_EOL		12
+
+typedef struct {		/* state table entry */
+	unsigned char State;	/* see above */
+	unsigned char Width;	/* width of code in bits */
+	uint32	Param;		/* unsigned 32-bit run length in bits */
+} TIFFFaxTabEnt;
+
+extern	const TIFFFaxTabEnt TIFFFaxMainTable[];
+extern	const TIFFFaxTabEnt TIFFFaxWhiteTable[];
+extern	const TIFFFaxTabEnt TIFFFaxBlackTable[];
+
+/*
+ * The following macros define the majority of the G3/G4 decoder
+ * algorithm using the state tables defined elsewhere.  To build
+ * a decoder you need some setup code and some glue code. Note
+ * that you may also need/want to change the way the NeedBits*
+ * macros get input data if, for example, you know the data to be
+ * decoded is properly aligned and oriented (doing so before running
+ * the decoder can be a big performance win).
+ *
+ * Consult the decoder in the TIFF library for an idea of what you
+ * need to define and setup to make use of these definitions.
+ *
+ * NB: to enable a debugging version of these macros define FAX3_DEBUG
+ *     before including this file.  Trace output goes to stdout.
+ */
+
+#ifndef EndOfData
+#define EndOfData()	(cp >= ep)
+#endif
+/*
+ * Need <=8 or <=16 bits of input data.  Unlike viewfax we
+ * cannot use/assume a word-aligned, properly bit swizzled
+ * input data set because data may come from an arbitrarily
+ * aligned, read-only source such as a memory-mapped file.
+ * Note also that the viewfax decoder does not check for
+ * running off the end of the input data buffer.  This is
+ * possible for G3-encoded data because it prescans the input
+ * data to count EOL markers, but can cause problems for G4
+ * data.  In any event, we don't prescan and must watch for
+ * running out of data since we can't permit the library to
+ * scan past the end of the input data buffer.
+ *
+ * Finally, note that we must handle remaindered data at the end
+ * of a strip specially.  The coder asks for a fixed number of
+ * bits when scanning for the next code.  This may be more bits
+ * than are actually present in the data stream.  If we appear
+ * to run out of data but still have some number of valid bits
+ * remaining then we makeup the requested amount with zeros and
+ * return successfully.  If the returned data is incorrect then
+ * we should be called again and get a premature EOF error;
+ * otherwise we should get the right answer.
+ */
+#ifndef NeedBits8
+#define NeedBits8(n,eoflab) do {					\
+    if (BitsAvail < (n)) {						\
+	if (EndOfData()) {						\
+	    if (BitsAvail == 0)			/* no valid bits */	\
+		goto eoflab;						\
+	    BitsAvail = (n);			/* pad with zeros */	\
+	} else {							\
+	    BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;		\
+	    BitsAvail += 8;						\
+	}								\
+    }									\
+} while (0)
+#endif
+#ifndef NeedBits16
+#define NeedBits16(n,eoflab) do {					\
+    if (BitsAvail < (n)) {						\
+	if (EndOfData()) {						\
+	    if (BitsAvail == 0)			/* no valid bits */	\
+		goto eoflab;						\
+	    BitsAvail = (n);			/* pad with zeros */	\
+	} else {							\
+	    BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;		\
+	    if ((BitsAvail += 8) < (n)) {				\
+		if (EndOfData()) {					\
+		    /* NB: we know BitsAvail is non-zero here */	\
+		    BitsAvail = (n);		/* pad with zeros */	\
+		} else {						\
+		    BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;	\
+		    BitsAvail += 8;					\
+		}							\
+	    }								\
+	}								\
+    }									\
+} while (0)
+#endif
+#define GetBits(n)	(BitAcc & ((1<<(n))-1))
+#define ClrBits(n) do {							\
+    BitsAvail -= (n);							\
+    BitAcc >>= (n);							\
+} while (0)
+
+#ifdef FAX3_DEBUG
+static const char* StateNames[] = {
+    "Null   ",
+    "Pass   ",
+    "Horiz  ",
+    "V0     ",
+    "VR     ",
+    "VL     ",
+    "Ext    ",
+    "TermW  ",
+    "TermB  ",
+    "MakeUpW",
+    "MakeUpB",
+    "MakeUp ",
+    "EOL    ",
+};
+#define DEBUG_SHOW putchar(BitAcc & (1 << t) ? '1' : '0')
+#define LOOKUP8(wid,tab,eoflab) do {					\
+    int t;								\
+    NeedBits8(wid,eoflab);						\
+    TabEnt = tab + GetBits(wid);					\
+    printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail,		\
+	   StateNames[TabEnt->State], TabEnt->Param);			\
+    for (t = 0; t < TabEnt->Width; t++)					\
+	DEBUG_SHOW;							\
+    putchar('\n');							\
+    fflush(stdout);							\
+    ClrBits(TabEnt->Width);						\
+} while (0)
+#define LOOKUP16(wid,tab,eoflab) do {					\
+    int t;								\
+    NeedBits16(wid,eoflab);						\
+    TabEnt = tab + GetBits(wid);					\
+    printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail,		\
+	   StateNames[TabEnt->State], TabEnt->Param);			\
+    for (t = 0; t < TabEnt->Width; t++)					\
+	DEBUG_SHOW;							\
+    putchar('\n');							\
+    fflush(stdout);							\
+    ClrBits(TabEnt->Width);						\
+} while (0)
+
+#define SETVALUE(x) do {							\
+    *pa++ = RunLength + (x);						\
+    printf("SETVALUE: %d\t%d\n", RunLength + (x), a0);			\
+    a0 += x;								\
+    RunLength = 0;							\
+} while (0)
+#else
+#define LOOKUP8(wid,tab,eoflab) do {					\
+    NeedBits8(wid,eoflab);						\
+    TabEnt = tab + GetBits(wid);					\
+    ClrBits(TabEnt->Width);						\
+} while (0)
+#define LOOKUP16(wid,tab,eoflab) do {					\
+    NeedBits16(wid,eoflab);						\
+    TabEnt = tab + GetBits(wid);					\
+    ClrBits(TabEnt->Width);						\
+} while (0)
+
+/*
+ * Append a run to the run length array for the
+ * current row and reset decoding state.
+ */
+#define SETVALUE(x) do {							\
+    *pa++ = RunLength + (x);						\
+    a0 += (x);								\
+    RunLength = 0;							\
+} while (0)
+#endif
+
+/*
+ * Synchronize input decoding at the start of each
+ * row by scanning for an EOL (if appropriate) and
+ * skipping any trash data that might be present
+ * after a decoding error.  Note that the decoding
+ * done elsewhere that recognizes an EOL only consumes
+ * 11 consecutive zero bits.  This means that if EOLcnt
+ * is non-zero then we still need to scan for the final flag
+ * bit that is part of the EOL code.
+ */
+#define	SYNC_EOL(eoflab) do {						\
+    if (EOLcnt == 0) {							\
+	for (;;) {							\
+	    NeedBits16(11,eoflab);					\
+	    if (GetBits(11) == 0)					\
+		break;							\
+	    ClrBits(1);							\
+	}								\
+    }									\
+    for (;;) {								\
+	NeedBits8(8,eoflab);						\
+	if (GetBits(8))							\
+	    break;							\
+	ClrBits(8);							\
+    }									\
+    while (GetBits(1) == 0)						\
+	ClrBits(1);							\
+    ClrBits(1);				/* EOL bit */			\
+    EOLcnt = 0;				/* reset EOL counter/flag */	\
+} while (0)
+
+/*
+ * Cleanup the array of runs after decoding a row.
+ * We adjust final runs to insure the user buffer is not
+ * overwritten and/or undecoded area is white filled.
+ */
+#define	CLEANUP_RUNS() do {						\
+    if (RunLength)							\
+	SETVALUE(0);							\
+    if (a0 != lastx) {							\
+	badlength(a0, lastx);						\
+	while (a0 > lastx && pa > thisrun)				\
+	    a0 -= *--pa;						\
+	if (a0 < lastx) {						\
+	    if (a0 < 0)							\
+		a0 = 0;							\
+	    if ((pa-thisrun)&1)						\
+		SETVALUE(0);						\
+	    SETVALUE(lastx - a0);						\
+	} else if (a0 > lastx) {					\
+	    SETVALUE(lastx);						\
+	    SETVALUE(0);							\
+	}								\
+    }									\
+} while (0)
+
+/*
+ * Decode a line of 1D-encoded data.
+ *
+ * The line expanders are written as macros so that they can be reused
+ * but still have direct access to the local variables of the "calling"
+ * function.
+ *
+ * Note that unlike the original version we have to explicitly test for
+ * a0 >= lastx after each black/white run is decoded.  This is because
+ * the original code depended on the input data being zero-padded to
+ * insure the decoder recognized an EOL before running out of data.
+ */
+#define EXPAND1D(eoflab) do {						\
+    for (;;) {								\
+	for (;;) {							\
+	    LOOKUP16(12, TIFFFaxWhiteTable, eof1d);			\
+	    switch (TabEnt->State) {					\
+	    case S_EOL:							\
+		EOLcnt = 1;						\
+		goto done1d;						\
+	    case S_TermW:						\
+		SETVALUE(TabEnt->Param);					\
+		goto doneWhite1d;					\
+	    case S_MakeUpW:						\
+	    case S_MakeUp:						\
+		a0 += TabEnt->Param;					\
+		RunLength += TabEnt->Param;				\
+		break;							\
+	    default:							\
+		unexpected("WhiteTable", a0);				\
+		goto done1d;						\
+	    }								\
+	}								\
+    doneWhite1d:							\
+	if (a0 >= lastx)						\
+	    goto done1d;						\
+	for (;;) {							\
+	    LOOKUP16(13, TIFFFaxBlackTable, eof1d);			\
+	    switch (TabEnt->State) {					\
+	    case S_EOL:							\
+		EOLcnt = 1;						\
+		goto done1d;						\
+	    case S_TermB:						\
+		SETVALUE(TabEnt->Param);					\
+		goto doneBlack1d;					\
+	    case S_MakeUpB:						\
+	    case S_MakeUp:						\
+		a0 += TabEnt->Param;					\
+		RunLength += TabEnt->Param;				\
+		break;							\
+	    default:							\
+		unexpected("BlackTable", a0);				\
+		goto done1d;						\
+	    }								\
+	}								\
+    doneBlack1d:							\
+	if (a0 >= lastx)						\
+	    goto done1d;						\
+        if( *(pa-1) == 0 && *(pa-2) == 0 )				\
+            pa -= 2;                                                    \
+    }									\
+eof1d:									\
+    prematureEOF(a0);							\
+    CLEANUP_RUNS();							\
+    goto eoflab;							\
+done1d:									\
+    CLEANUP_RUNS();							\
+} while (0)
+
+/*
+ * Update the value of b1 using the array
+ * of runs for the reference line.
+ */
+#define CHECK_b1 do {							\
+    if (pa != thisrun) while (b1 <= a0 && b1 < lastx) {			\
+	b1 += pb[0] + pb[1];						\
+	pb += 2;							\
+    }									\
+} while (0)
+
+/*
+ * Expand a row of 2D-encoded data.
+ */
+#define EXPAND2D(eoflab) do {						\
+    while (a0 < lastx) {						\
+	LOOKUP8(7, TIFFFaxMainTable, eof2d);				\
+	switch (TabEnt->State) {					\
+	case S_Pass:							\
+	    CHECK_b1;							\
+	    b1 += *pb++;						\
+	    RunLength += b1 - a0;					\
+	    a0 = b1;							\
+	    b1 += *pb++;						\
+	    break;							\
+	case S_Horiz:							\
+	    if ((pa-thisrun)&1) {					\
+		for (;;) {	/* black first */			\
+		    LOOKUP16(13, TIFFFaxBlackTable, eof2d);		\
+		    switch (TabEnt->State) {				\
+		    case S_TermB:					\
+			SETVALUE(TabEnt->Param);				\
+			goto doneWhite2da;				\
+		    case S_MakeUpB:					\
+		    case S_MakeUp:					\
+			a0 += TabEnt->Param;				\
+			RunLength += TabEnt->Param;			\
+			break;						\
+		    default:						\
+			goto badBlack2d;				\
+		    }							\
+		}							\
+	    doneWhite2da:;						\
+		for (;;) {	/* then white */			\
+		    LOOKUP16(12, TIFFFaxWhiteTable, eof2d);		\
+		    switch (TabEnt->State) {				\
+		    case S_TermW:					\
+			SETVALUE(TabEnt->Param);				\
+			goto doneBlack2da;				\
+		    case S_MakeUpW:					\
+		    case S_MakeUp:					\
+			a0 += TabEnt->Param;				\
+			RunLength += TabEnt->Param;			\
+			break;						\
+		    default:						\
+			goto badWhite2d;				\
+		    }							\
+		}							\
+	    doneBlack2da:;						\
+	    } else {							\
+		for (;;) {	/* white first */			\
+		    LOOKUP16(12, TIFFFaxWhiteTable, eof2d);		\
+		    switch (TabEnt->State) {				\
+		    case S_TermW:					\
+			SETVALUE(TabEnt->Param);				\
+			goto doneWhite2db;				\
+		    case S_MakeUpW:					\
+		    case S_MakeUp:					\
+			a0 += TabEnt->Param;				\
+			RunLength += TabEnt->Param;			\
+			break;						\
+		    default:						\
+			goto badWhite2d;				\
+		    }							\
+		}							\
+	    doneWhite2db:;						\
+		for (;;) {	/* then black */			\
+		    LOOKUP16(13, TIFFFaxBlackTable, eof2d);		\
+		    switch (TabEnt->State) {				\
+		    case S_TermB:					\
+			SETVALUE(TabEnt->Param);				\
+			goto doneBlack2db;				\
+		    case S_MakeUpB:					\
+		    case S_MakeUp:					\
+			a0 += TabEnt->Param;				\
+			RunLength += TabEnt->Param;			\
+			break;						\
+		    default:						\
+			goto badBlack2d;				\
+		    }							\
+		}							\
+	    doneBlack2db:;						\
+	    }								\
+	    CHECK_b1;							\
+	    break;							\
+	case S_V0:							\
+	    CHECK_b1;							\
+	    SETVALUE(b1 - a0);						\
+	    b1 += *pb++;						\
+	    break;							\
+	case S_VR:							\
+	    CHECK_b1;							\
+	    SETVALUE(b1 - a0 + TabEnt->Param);				\
+	    b1 += *pb++;						\
+	    break;							\
+	case S_VL:							\
+	    CHECK_b1;							\
+	    SETVALUE(b1 - a0 - TabEnt->Param);				\
+	    b1 -= *--pb;						\
+	    break;							\
+	case S_Ext:							\
+	    *pa++ = lastx - a0;						\
+	    extension(a0);						\
+	    goto eol2d;							\
+	case S_EOL:							\
+	    *pa++ = lastx - a0;						\
+	    NeedBits8(4,eof2d);						\
+	    if (GetBits(4))						\
+		unexpected("EOL", a0);					\
+            ClrBits(4);                                                 \
+	    EOLcnt = 1;							\
+	    goto eol2d;							\
+	default:							\
+	badMain2d:							\
+	    unexpected("MainTable", a0);				\
+	    goto eol2d;							\
+	badBlack2d:							\
+	    unexpected("BlackTable", a0);				\
+	    goto eol2d;							\
+	badWhite2d:							\
+	    unexpected("WhiteTable", a0);				\
+	    goto eol2d;							\
+	eof2d:								\
+	    prematureEOF(a0);						\
+	    CLEANUP_RUNS();						\
+	    goto eoflab;						\
+	}								\
+    }									\
+    if (RunLength) {							\
+	if (RunLength + a0 < lastx) {					\
+	    /* expect a final V0 */					\
+	    NeedBits8(1,eof2d);						\
+	    if (!GetBits(1))						\
+		goto badMain2d;						\
+	    ClrBits(1);							\
+	}								\
+	SETVALUE(0);							\
+    }									\
+eol2d:									\
+    CLEANUP_RUNS();							\
+} while (0)
+#endif /* _FAX3_ */
diff --git a/src/tiff/tif_fax3sm.c b/src/tiff/tif_fax3sm.c
new file mode 100644
index 0000000..5f9bf3f
--- /dev/null
+++ b/src/tiff/tif_fax3sm.c
@@ -0,0 +1,1253 @@
+/* WARNING, this file was automatically generated by the
+    mkg3states program */
+#include "tiff.h"
+#include "tif_fax3.h"
+ const TIFFFaxTabEnt TIFFFaxMainTable[128] = {
+{12,7,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0},
+{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{5,6,2},{3,1,0},{5,3,1},{3,1,0},
+{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},
+{4,3,1},{3,1,0},{5,7,3},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},
+{1,4,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{4,6,2},{3,1,0},
+{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0},{5,3,1},{3,1,0},
+{2,3,0},{3,1,0},{4,3,1},{3,1,0},{6,7,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},
+{4,3,1},{3,1,0},{1,4,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},
+{5,6,2},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0},
+{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{4,7,3},{3,1,0},{5,3,1},{3,1,0},
+{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},
+{4,3,1},{3,1,0},{4,6,2},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},
+{1,4,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0}
+};
+ const TIFFFaxTabEnt TIFFFaxWhiteTable[4096] = {
+{12,11,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},
+{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},
+{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},
+{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},
+{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,960},{7,4,6},{7,8,31},{7,5,8},
+{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},
+{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,11,1792},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},
+{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},
+{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},
+{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1600},{7,4,5},
+{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},
+{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},
+{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},
+{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},
+{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},
+{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},
+{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1536},{7,4,5},{7,8,43},{7,6,17},
+{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},
+{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},
+{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,768},{7,4,6},
+{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,11,1856},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},
+{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,896},{7,4,6},{7,7,19},{7,5,8},
+{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},
+{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5},{7,8,44},{7,6,17},{9,9,1408},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},
+{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},
+{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},
+{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},
+{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},
+{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},
+{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},
+{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,960},{7,4,6},
+{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},
+{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},
+{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},
+{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{11,12,2112},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},
+{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},
+{7,8,40},{7,6,16},{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},
+{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{9,9,1600},{7,4,5},{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},
+{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6},{7,8,32},{7,5,8},
+{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},
+{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},
+{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},
+{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},
+{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1536},{7,4,5},
+{7,8,43},{7,6,17},{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},
+{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},
+{9,9,768},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,12,2368},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},
+{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,896},{7,4,6},
+{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},
+{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},
+{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5},{7,8,44},{7,6,17},
+{9,9,1408},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},
+{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},
+{7,8,42},{7,6,16},{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},
+{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},
+{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},
+{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},
+{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},
+{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},
+{9,9,960},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128},
+{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},
+{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{11,12,1984},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},
+{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},
+{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{9,9,1600},{7,4,5},{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},
+{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6},
+{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},
+{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},
+{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},
+{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},
+{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},
+{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},
+{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{9,9,1536},{7,4,5},{7,8,43},{7,6,17},{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},
+{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8},
+{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},
+{7,7,26},{7,5,9},{9,9,768},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,11,1920},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},
+{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},
+{9,9,896},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},
+{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5},
+{7,8,44},{7,6,17},{9,9,1408},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},
+{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},
+{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},
+{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},
+{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},
+{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},
+{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1472},{7,4,5},{7,8,43},{7,6,17},
+{9,9,1216},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},
+{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},
+{7,8,41},{7,6,16},{9,9,960},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,704},{7,4,6},
+{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,12,2240},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},
+{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,832},{7,4,6},{7,7,19},{7,5,8},
+{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},
+{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1600},{7,4,5},{7,8,44},{7,6,17},{9,9,1344},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},
+{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},
+{9,9,1088},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},
+{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},
+{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},
+{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},
+{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{9,9,1536},{7,4,5},{7,8,43},{7,6,17},{9,9,1280},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},
+{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,1024},{7,4,6},
+{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},
+{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,768},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},
+{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},
+{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{11,12,2496},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},
+{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},
+{7,8,40},{7,6,16},{9,9,896},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},
+{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{9,9,1728},{7,4,5},{7,8,44},{7,6,17},{9,9,1408},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},
+{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1152},{7,4,6},{7,8,32},{7,5,8},
+{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},
+{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{12,11,0},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},
+{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},
+{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},
+{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1472},{7,4,5},
+{7,8,43},{7,6,17},{9,9,1216},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},
+{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,960},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},
+{9,9,704},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,11,1792},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},
+{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,832},{7,4,6},
+{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},
+{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},
+{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1600},{7,4,5},{7,8,44},{7,6,17},
+{9,9,1344},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},
+{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},
+{7,8,42},{7,6,16},{9,9,1088},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},
+{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},
+{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},
+{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},
+{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1536},{7,4,5},{7,8,43},{7,6,17},{9,9,1280},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},
+{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},
+{9,9,1024},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,768},{7,4,6},{7,8,37},{9,5,128},
+{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},
+{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{11,11,1856},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},
+{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,896},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},
+{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{9,9,1728},{7,4,5},{7,8,44},{7,6,17},{9,9,1408},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},
+{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1152},{7,4,6},
+{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},
+{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},
+{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},
+{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},
+{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},
+{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},
+{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},
+{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,960},{7,4,6},{7,8,31},{7,5,8},
+{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},
+{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,12,2176},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},
+{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},
+{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},
+{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1600},{7,4,5},
+{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},
+{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},
+{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},
+{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},
+{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},
+{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},
+{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1536},{7,4,5},{7,8,43},{7,6,17},
+{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},
+{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},
+{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,768},{7,4,6},
+{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,12,2432},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},
+{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,896},{7,4,6},{7,7,19},{7,5,8},
+{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},
+{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5},{7,8,44},{7,6,17},{9,9,1408},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},
+{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},
+{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},
+{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},
+{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},
+{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},
+{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},
+{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,960},{7,4,6},
+{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},
+{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},
+{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},
+{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{11,12,2048},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},
+{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},
+{7,8,40},{7,6,16},{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},
+{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{9,9,1600},{7,4,5},{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},
+{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6},{7,8,32},{7,5,8},
+{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},
+{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},
+{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},
+{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},
+{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1536},{7,4,5},
+{7,8,43},{7,6,17},{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},
+{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},
+{9,9,768},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,11,1920},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},
+{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,896},{7,4,6},
+{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},
+{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},
+{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5},{7,8,44},{7,6,17},
+{9,9,1408},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},
+{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},
+{7,8,42},{7,6,16},{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},
+{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},
+{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},
+{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},
+{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},
+{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},
+{9,9,960},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128},
+{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},
+{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{11,12,2304},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},
+{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},
+{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{9,9,1600},{7,4,5},{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},
+{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},
+{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6},
+{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},
+{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},
+{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},
+{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},
+{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},
+{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},
+{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},
+{9,9,1536},{7,4,5},{7,8,43},{7,6,17},{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},
+{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},
+{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8},
+{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},
+{7,7,26},{7,5,9},{9,9,768},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},
+{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},
+{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,12,2560},{7,4,3},
+{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},
+{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},
+{9,9,896},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},
+{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},
+{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5},
+{7,8,44},{7,6,17},{9,9,1408},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},
+{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},
+{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},
+{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},
+{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},
+{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},
+{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},
+{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}
+};
+ const TIFFFaxTabEnt TIFFFaxBlackTable[8192] = {
+{12,11,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,18},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,17},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1792},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,11,23},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,20},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,11,25},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,128},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,56},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,30},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1856},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,57},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,11,21},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,54},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,52},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,48},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{11,12,2112},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,44},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,36},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,384},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,28},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,60},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,40},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2368},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,16},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{10,10,64},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,18},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,10,17},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{11,12,1984},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,50},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,34},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1664},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,26},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1408},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,32},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1920},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,61},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,42},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{10,13,1024},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{10,13,768},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,62},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2240},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,46},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,38},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,512},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,11,19},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,24},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,22},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{11,12,2496},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,10,16},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,0},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,10,64},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{12,11,0},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,10,18},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,17},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1792},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,23},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,20},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,11,25},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{10,12,192},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1280},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,31},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{11,11,1856},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,58},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,11,21},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,896},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,640},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,49},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2176},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,45},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,37},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{10,12,448},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,29},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{10,13,1536},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,41},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2432},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,16},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,10,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,10,64},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,18},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,17},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{11,12,2048},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,51},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,35},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,320},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,27},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,59},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,33},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1920},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,256},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,43},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{10,13,1152},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,55},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,63},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{11,12,2304},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,47},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,39},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,53},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,19},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,24},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,22},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2560},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,10,16},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,0},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{10,10,64},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{12,11,0},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,10,18},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,10,17},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1792},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,23},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,11,20},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,25},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{10,12,128},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,56},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,30},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{11,11,1856},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,57},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,21},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,54},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,52},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,48},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2112},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,44},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,36},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{10,12,384},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,28},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,60},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,40},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{11,12,2368},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,16},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,10,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,10,64},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,18},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,17},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,1984},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,50},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,34},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{10,13,1728},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,26},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{10,13,1472},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,32},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1920},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,61},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,42},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1088},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,832},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,62},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{11,12,2240},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,46},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,38},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,576},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,19},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,11,24},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,22},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2496},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,16},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{10,10,64},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{12,11,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,18},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,10,17},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{11,11,1792},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,23},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,11,20},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,25},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,192},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1344},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,31},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1856},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,58},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,21},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{10,13,960},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{10,13,704},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,49},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2176},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,45},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,37},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,448},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,29},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1600},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,41},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{11,12,2432},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,10,16},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,0},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,10,64},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,10,18},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,17},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2048},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,51},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,35},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{10,12,320},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,27},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,59},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,33},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{11,11,1920},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,256},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,43},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1216},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,55},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,63},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2304},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,12,47},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,39},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,12,53},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,19},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,11,24},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,11,22},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2560},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,16},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2},{8,10,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},
+{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,10,64},{8,2,3},
+{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},
+{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},
+{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},
+{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},
+{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},
+{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},
+{8,3,4},{8,2,2}
+};
diff --git a/src/tiff/tif_flush.c b/src/tiff/tif_flush.c
new file mode 100644
index 0000000..f6bd33f
--- /dev/null
+++ b/src/tiff/tif_flush.c
@@ -0,0 +1,67 @@
+/* $Header$ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ */
+#include "tiffiop.h"
+
+int
+TIFFFlush(TIFF* tif)
+{
+
+	if (tif->tif_mode != O_RDONLY) {
+		if (!TIFFFlushData(tif))
+			return (0);
+		if ((tif->tif_flags & TIFF_DIRTYDIRECT) &&
+		    !TIFFWriteDirectory(tif))
+			return (0);
+	}
+	return (1);
+}
+
+/*
+ * Flush buffered data to the file.
+ *
+ * Frank Warmerdam'2000: I modified this to return 1 if TIFF_BEENWRITING
+ * is not set, so that TIFFFlush() will proceed to write out the directory.
+ * The documentation says returning 1 is an error indicator, but not having
+ * been writing isn't exactly a an error.  Hopefully this doesn't cause
+ * problems for other people. 
+ */
+int
+TIFFFlushData(TIFF* tif)
+{
+	if ((tif->tif_flags & TIFF_BEENWRITING) == 0)
+		return (0);
+	if (tif->tif_flags & TIFF_POSTENCODE) {
+		tif->tif_flags &= ~TIFF_POSTENCODE;
+		if (!(*tif->tif_postencode)(tif))
+			return (0);
+	}
+	return (TIFFFlushData1(tif));
+}
+
diff --git a/src/tiff/tif_getimage.c b/src/tiff/tif_getimage.c
new file mode 100644
index 0000000..acc7ebb
--- /dev/null
+++ b/src/tiff/tif_getimage.c
@@ -0,0 +1,2598 @@
+/* $Id: tif_getimage.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1991-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library
+ *
+ * Read and return a packed RGBA image.
+ */
+#include "tiffiop.h"
+#include <stdio.h>
+
+static	int gtTileContig(TIFFRGBAImage*, uint32*, uint32, uint32);
+static	int gtTileSeparate(TIFFRGBAImage*, uint32*, uint32, uint32);
+static	int gtStripContig(TIFFRGBAImage*, uint32*, uint32, uint32);
+static	int gtStripSeparate(TIFFRGBAImage*, uint32*, uint32, uint32);
+static	int pickTileContigCase(TIFFRGBAImage*);
+static	int pickTileSeparateCase(TIFFRGBAImage*);
+
+static	const char photoTag[] = "PhotometricInterpretation";
+
+/* 
+ * Helper constants used in Orientation tag handling
+ */
+#define FLIP_VERTICALLY 0x01
+#define FLIP_HORIZONTALLY 0x02
+
+/*
+ * Color conversion constants. We will define display types here.
+ */
+
+TIFFDisplay display_sRGB = {
+	{			/* XYZ -> luminance matrix */
+		{  3.2410F, -1.5374F, -0.4986F },
+		{  -0.9692F, 1.8760F, 0.0416F },
+		{  0.0556F, -0.2040F, 1.0570F }
+	},	
+	100.0F, 100.0F, 100.0F,	/* Light o/p for reference white */
+	255, 255, 255,		/* Pixel values for ref. white */
+	1.0F, 1.0F, 1.0F,	/* Residual light o/p for black pixel */
+	2.4F, 2.4F, 2.4F,	/* Gamma values for the three guns */
+};
+
+/*
+ * Check the image to see if TIFFReadRGBAImage can deal with it.
+ * 1/0 is returned according to whether or not the image can
+ * be handled.  If 0 is returned, emsg contains the reason
+ * why it is being rejected.
+ */
+int
+TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
+{
+    TIFFDirectory* td = &tif->tif_dir;
+    uint16 photometric;
+    int colorchannels;
+
+    if (!tif->tif_decodestatus) {
+	sprintf(emsg, "Sorry, requested compression method is not configured");
+	return (0);
+    }
+    switch (td->td_bitspersample) {
+    case 1: case 2: case 4:
+    case 8: case 16:
+	break;
+    default:
+	sprintf(emsg, "Sorry, can not handle images with %d-bit samples",
+	    td->td_bitspersample);
+	return (0);
+    }
+    colorchannels = td->td_samplesperpixel - td->td_extrasamples;
+    if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric)) {
+	switch (colorchannels) {
+	case 1:
+	    photometric = PHOTOMETRIC_MINISBLACK;
+	    break;
+	case 3:
+	    photometric = PHOTOMETRIC_RGB;
+	    break;
+	default:
+	    sprintf(emsg, "Missing needed %s tag", photoTag);
+	    return (0);
+	}
+    }
+    switch (photometric) {
+    case PHOTOMETRIC_MINISWHITE:
+    case PHOTOMETRIC_MINISBLACK:
+    case PHOTOMETRIC_PALETTE:
+	if (td->td_planarconfig == PLANARCONFIG_CONTIG 
+            && td->td_samplesperpixel != 1
+            && td->td_bitspersample < 8 ) {
+	    sprintf(emsg,
+                    "Sorry, can not handle contiguous data with %s=%d, "
+                    "and %s=%d and Bits/Sample=%d",
+                    photoTag, photometric,
+                    "Samples/pixel", td->td_samplesperpixel,
+                    td->td_bitspersample);
+	    return (0);
+	}
+        /*
+        ** We should likely validate that any extra samples are either
+        ** to be ignored, or are alpha, and if alpha we should try to use
+        ** them.  But for now we won't bother with this. 
+        */
+	break;
+    case PHOTOMETRIC_YCBCR:
+	if (td->td_planarconfig != PLANARCONFIG_CONTIG) {
+	    sprintf(emsg, "Sorry, can not handle YCbCr images with %s=%d",
+		"Planarconfiguration", td->td_planarconfig);
+	    return (0);
+	}
+	break;
+    case PHOTOMETRIC_RGB: 
+	if (colorchannels < 3) {
+	    sprintf(emsg, "Sorry, can not handle RGB image with %s=%d",
+		"Color channels", colorchannels);
+	    return (0);
+	}
+	break;
+    case PHOTOMETRIC_SEPARATED:
+	{
+		uint16 inkset;
+		TIFFGetFieldDefaulted(tif, TIFFTAG_INKSET, &inkset);
+		if (inkset != INKSET_CMYK) {
+		    sprintf(emsg,
+			    "Sorry, can not handle separated image with %s=%d",
+			    "InkSet", inkset);
+		    return 0;
+		}
+		if (td->td_samplesperpixel < 4) {
+		    sprintf(emsg,
+			    "Sorry, can not handle separated image with %s=%d",
+			    "Samples/pixel", td->td_samplesperpixel);
+		    return 0;
+		}
+		break;
+	}
+    case PHOTOMETRIC_LOGL:
+	if (td->td_compression != COMPRESSION_SGILOG) {
+	    sprintf(emsg, "Sorry, LogL data must have %s=%d",
+		"Compression", COMPRESSION_SGILOG);
+	    return (0);
+	}
+	break;
+    case PHOTOMETRIC_LOGLUV:
+	if (td->td_compression != COMPRESSION_SGILOG &&
+		td->td_compression != COMPRESSION_SGILOG24) {
+	    sprintf(emsg, "Sorry, LogLuv data must have %s=%d or %d",
+		"Compression", COMPRESSION_SGILOG, COMPRESSION_SGILOG24);
+	    return (0);
+	}
+	if (td->td_planarconfig != PLANARCONFIG_CONTIG) {
+	    sprintf(emsg, "Sorry, can not handle LogLuv images with %s=%d",
+		"Planarconfiguration", td->td_planarconfig);
+	    return (0);
+	}
+	break;
+    case PHOTOMETRIC_CIELAB:
+	break;
+    default:
+	sprintf(emsg, "Sorry, can not handle image with %s=%d",
+	    photoTag, photometric);
+	return (0);
+    }
+    return (1);
+}
+
+void
+TIFFRGBAImageEnd(TIFFRGBAImage* img)
+{
+	if (img->Map)
+		_TIFFfree(img->Map), img->Map = NULL;
+	if (img->BWmap)
+		_TIFFfree(img->BWmap), img->BWmap = NULL;
+	if (img->PALmap)
+		_TIFFfree(img->PALmap), img->PALmap = NULL;
+	if (img->ycbcr)
+		_TIFFfree(img->ycbcr), img->ycbcr = NULL;
+	if (img->cielab)
+		_TIFFfree(img->cielab), img->cielab = NULL;
+
+	if( img->redcmap ) {
+		_TIFFfree( img->redcmap );
+		_TIFFfree( img->greencmap );
+		_TIFFfree( img->bluecmap );
+	}
+}
+
+static int
+isCCITTCompression(TIFF* tif)
+{
+    uint16 compress;
+    TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress);
+    return (compress == COMPRESSION_CCITTFAX3 ||
+	    compress == COMPRESSION_CCITTFAX4 ||
+	    compress == COMPRESSION_CCITTRLE ||
+	    compress == COMPRESSION_CCITTRLEW);
+}
+
+int
+TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
+{
+    uint16* sampleinfo;
+    uint16 extrasamples;
+    uint16 planarconfig;
+    uint16 compress;
+    int colorchannels;
+    uint16 *red_orig, *green_orig, *blue_orig;
+    int n_color;
+
+    /* Initialize to normal values */
+    img->row_offset = 0;
+    img->col_offset = 0;
+    img->redcmap = NULL;
+    img->greencmap = NULL;
+    img->bluecmap = NULL;
+    img->req_orientation = ORIENTATION_BOTLEFT;	    /* It is the default */
+    
+    img->tif = tif;
+    img->stoponerr = stop;
+    TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &img->bitspersample);
+    switch (img->bitspersample) {
+    case 1: case 2: case 4:
+    case 8: case 16:
+	break;
+    default:
+	sprintf(emsg, "Sorry, can not handle images with %d-bit samples",
+	    img->bitspersample);
+	return (0);
+    }
+    img->alpha = 0;
+    TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &img->samplesperpixel);
+    TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES,
+	&extrasamples, &sampleinfo);
+    if (extrasamples >= 1)
+    {
+	switch (sampleinfo[0]) {
+	case EXTRASAMPLE_UNSPECIFIED:	/* Workaround for some images without */
+		if (img->samplesperpixel > 3)	/* correct info about alpha channel */
+			img->alpha = EXTRASAMPLE_ASSOCALPHA;
+		break;
+	case EXTRASAMPLE_ASSOCALPHA:	/* data is pre-multiplied */
+	case EXTRASAMPLE_UNASSALPHA:	/* data is not pre-multiplied */
+		img->alpha = sampleinfo[0];
+		break;
+	}
+    }
+
+#ifdef DEFAULT_EXTRASAMPLE_AS_ALPHA
+    if( !TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &img->photometric))
+        img->photometric = PHOTOMETRIC_MINISWHITE;
+
+    if( extrasamples == 0 
+        && img->samplesperpixel == 4 
+        && img->photometric == PHOTOMETRIC_RGB )
+    {
+        img->alpha = EXTRASAMPLE_ASSOCALPHA;
+        extrasamples = 1;
+    }
+#endif
+
+    colorchannels = img->samplesperpixel - extrasamples;
+    TIFFGetFieldDefaulted(tif, TIFFTAG_COMPRESSION, &compress);
+    TIFFGetFieldDefaulted(tif, TIFFTAG_PLANARCONFIG, &planarconfig);
+    if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &img->photometric)) {
+	switch (colorchannels) {
+	case 1:
+	    if (isCCITTCompression(tif))
+		img->photometric = PHOTOMETRIC_MINISWHITE;
+	    else
+		img->photometric = PHOTOMETRIC_MINISBLACK;
+	    break;
+	case 3:
+	    img->photometric = PHOTOMETRIC_RGB;
+	    break;
+	default:
+	    sprintf(emsg, "Missing needed %s tag", photoTag);
+	    return (0);
+	}
+    }
+    switch (img->photometric) {
+    case PHOTOMETRIC_PALETTE:
+	if (!TIFFGetField(tif, TIFFTAG_COLORMAP,
+	    &red_orig, &green_orig, &blue_orig)) {
+	    sprintf(emsg, "Missing required \"Colormap\" tag");
+	    return (0);
+	}
+
+        /* copy the colormaps so we can modify them */
+        n_color = (1L << img->bitspersample);
+        img->redcmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
+        img->greencmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
+        img->bluecmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
+        if( !img->redcmap || !img->greencmap || !img->bluecmap ) {
+	    sprintf(emsg, "Out of memory for colormap copy");
+	    return (0);
+        }
+
+        _TIFFmemcpy( img->redcmap, red_orig, n_color * 2 );
+        _TIFFmemcpy( img->greencmap, green_orig, n_color * 2 );
+        _TIFFmemcpy( img->bluecmap, blue_orig, n_color * 2 );
+        
+	/* fall thru... */
+    case PHOTOMETRIC_MINISWHITE:
+    case PHOTOMETRIC_MINISBLACK:
+	if (planarconfig == PLANARCONFIG_CONTIG 
+            && img->samplesperpixel != 1
+            && img->bitspersample < 8 ) {
+	    sprintf(emsg,
+                    "Sorry, can not handle contiguous data with %s=%d, "
+                    "and %s=%d and Bits/Sample=%d",
+                    photoTag, img->photometric,
+                    "Samples/pixel", img->samplesperpixel,
+                    img->bitspersample);
+	    return (0);
+	}
+	break;
+    case PHOTOMETRIC_YCBCR:
+	if (planarconfig != PLANARCONFIG_CONTIG) {
+	    sprintf(emsg, "Sorry, can not handle YCbCr images with %s=%d",
+		"Planarconfiguration", planarconfig);
+	    return (0);
+	}
+	/* It would probably be nice to have a reality check here. */
+	if (planarconfig == PLANARCONFIG_CONTIG)
+	    /* can rely on libjpeg to convert to RGB */
+	    /* XXX should restore current state on exit */
+	    switch (compress) {
+		case COMPRESSION_OJPEG:
+		case COMPRESSION_JPEG:
+		    TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB);
+		    img->photometric = PHOTOMETRIC_RGB;
+                    break;
+
+                default:
+                    /* do nothing */;
+                    break;
+	    }
+	break;
+    case PHOTOMETRIC_RGB: 
+	if (colorchannels < 3) {
+	    sprintf(emsg, "Sorry, can not handle RGB image with %s=%d",
+		"Color channels", colorchannels);
+	    return (0);
+	}
+	break;
+    case PHOTOMETRIC_SEPARATED: {
+	uint16 inkset;
+	TIFFGetFieldDefaulted(tif, TIFFTAG_INKSET, &inkset);
+	if (inkset != INKSET_CMYK) {
+	    sprintf(emsg, "Sorry, can not handle separated image with %s=%d",
+		"InkSet", inkset);
+	    return (0);
+	}
+	if (img->samplesperpixel < 4) {
+	    sprintf(emsg, "Sorry, can not handle separated image with %s=%d",
+		"Samples/pixel", img->samplesperpixel);
+	    return (0);
+	}
+	break;
+    }
+    case PHOTOMETRIC_LOGL:
+	if (compress != COMPRESSION_SGILOG) {
+	    sprintf(emsg, "Sorry, LogL data must have %s=%d",
+		"Compression", COMPRESSION_SGILOG);
+	    return (0);
+	}
+	TIFFSetField(tif, TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_8BIT);
+	img->photometric = PHOTOMETRIC_MINISBLACK;	/* little white lie */
+	img->bitspersample = 8;
+	break;
+    case PHOTOMETRIC_LOGLUV:
+	if (compress != COMPRESSION_SGILOG && compress != COMPRESSION_SGILOG24) {
+	    sprintf(emsg, "Sorry, LogLuv data must have %s=%d or %d",
+		"Compression", COMPRESSION_SGILOG, COMPRESSION_SGILOG24);
+	    return (0);
+	}
+	if (planarconfig != PLANARCONFIG_CONTIG) {
+	    sprintf(emsg, "Sorry, can not handle LogLuv images with %s=%d",
+		"Planarconfiguration", planarconfig);
+	    return (0);
+	}
+	TIFFSetField(tif, TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_8BIT);
+	img->photometric = PHOTOMETRIC_RGB;		/* little white lie */
+	img->bitspersample = 8;
+	break;
+    case PHOTOMETRIC_CIELAB:
+	break;
+    default:
+	sprintf(emsg, "Sorry, can not handle image with %s=%d",
+	    photoTag, img->photometric);
+	return (0);
+    }
+    img->Map = NULL;
+    img->BWmap = NULL;
+    img->PALmap = NULL;
+    img->ycbcr = NULL;
+    img->cielab = NULL;
+    TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &img->width);
+    TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &img->height);
+    TIFFGetFieldDefaulted(tif, TIFFTAG_ORIENTATION, &img->orientation);
+    img->isContig =
+	!(planarconfig == PLANARCONFIG_SEPARATE && colorchannels > 1);
+    if (img->isContig) {
+	img->get = TIFFIsTiled(tif) ? gtTileContig : gtStripContig;
+	if (!pickTileContigCase(img)) {
+		sprintf(emsg, "Sorry, can not handle image");
+		return 0;
+	}
+    } else {
+	img->get = TIFFIsTiled(tif) ? gtTileSeparate : gtStripSeparate;
+	if (!pickTileSeparateCase(img)) {
+		sprintf(emsg, "Sorry, can not handle image");
+		return 0;
+	}
+    }
+    return 1;
+}
+
+int
+TIFFRGBAImageGet(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+{
+    if (img->get == NULL) {
+		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No \"get\" routine setup");
+		return (0);
+	}
+	if (img->put.any == NULL) {
+		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif),
+		"No \"put\" routine setupl; probably can not handle image format");
+		return (0);
+    }
+    return (*img->get)(img, raster, w, h);
+}
+
+/*
+ * Read the specified image into an ABGR-format rastertaking in account
+ * specified orientation.
+ */
+int
+TIFFReadRGBAImageOriented(TIFF* tif,
+			  uint32 rwidth, uint32 rheight, uint32* raster,
+			  int orientation, int stop)
+{
+    char emsg[1024] = "";
+    TIFFRGBAImage img;
+    int ok;
+
+	if (TIFFRGBAImageOK(tif, emsg) && TIFFRGBAImageBegin(&img, tif, stop, emsg)) {
+		img.req_orientation = orientation;
+		/* XXX verify rwidth and rheight against width and height */
+		ok = TIFFRGBAImageGet(&img, raster+(rheight-img.height)*rwidth,
+			rwidth, img.height);
+		TIFFRGBAImageEnd(&img);
+	} else {
+		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), emsg);
+		ok = 0;
+    }
+    return (ok);
+}
+
+/*
+ * Read the specified image into an ABGR-format raster. Use bottom left
+ * origin for raster by default.
+ */
+int
+TIFFReadRGBAImage(TIFF* tif,
+		  uint32 rwidth, uint32 rheight, uint32* raster, int stop)
+{
+	return TIFFReadRGBAImageOriented(tif, rwidth, rheight, raster,
+					 ORIENTATION_BOTLEFT, stop);
+}
+
+static int 
+setorientation(TIFFRGBAImage* img)
+{
+	switch (img->orientation) {
+		case ORIENTATION_TOPLEFT:
+		case ORIENTATION_LEFTTOP:
+			if (img->req_orientation == ORIENTATION_TOPRIGHT ||
+			    img->req_orientation == ORIENTATION_RIGHTTOP)
+				return FLIP_HORIZONTALLY;
+			else if (img->req_orientation == ORIENTATION_BOTRIGHT ||
+			    img->req_orientation == ORIENTATION_RIGHTBOT)
+				return FLIP_HORIZONTALLY | FLIP_VERTICALLY;
+			else if (img->req_orientation == ORIENTATION_BOTLEFT ||
+			    img->req_orientation == ORIENTATION_LEFTBOT)
+				return FLIP_VERTICALLY;
+			else
+				return 0;
+		case ORIENTATION_TOPRIGHT:
+		case ORIENTATION_RIGHTTOP:
+			if (img->req_orientation == ORIENTATION_TOPLEFT ||
+			    img->req_orientation == ORIENTATION_LEFTTOP)
+				return FLIP_HORIZONTALLY;
+			else if (img->req_orientation == ORIENTATION_BOTRIGHT ||
+			    img->req_orientation == ORIENTATION_RIGHTBOT)
+				return FLIP_VERTICALLY;
+			else if (img->req_orientation == ORIENTATION_BOTLEFT ||
+			    img->req_orientation == ORIENTATION_LEFTBOT)
+				return FLIP_HORIZONTALLY | FLIP_VERTICALLY;
+			else
+				return 0;
+		case ORIENTATION_BOTRIGHT:
+		case ORIENTATION_RIGHTBOT:
+			if (img->req_orientation == ORIENTATION_TOPLEFT ||
+			    img->req_orientation == ORIENTATION_LEFTTOP)
+				return FLIP_HORIZONTALLY | FLIP_VERTICALLY;
+			else if (img->req_orientation == ORIENTATION_TOPRIGHT ||
+			    img->req_orientation == ORIENTATION_RIGHTTOP)
+				return FLIP_VERTICALLY;
+			else if (img->req_orientation == ORIENTATION_BOTLEFT ||
+			    img->req_orientation == ORIENTATION_LEFTBOT)
+				return FLIP_HORIZONTALLY;
+			else
+				return 0;
+		case ORIENTATION_BOTLEFT:
+		case ORIENTATION_LEFTBOT:
+			if (img->req_orientation == ORIENTATION_TOPLEFT ||
+			    img->req_orientation == ORIENTATION_LEFTTOP)
+				return FLIP_VERTICALLY;
+			else if (img->req_orientation == ORIENTATION_TOPRIGHT ||
+			    img->req_orientation == ORIENTATION_RIGHTTOP)
+				return FLIP_HORIZONTALLY | FLIP_VERTICALLY;
+			else if (img->req_orientation == ORIENTATION_BOTRIGHT ||
+			    img->req_orientation == ORIENTATION_RIGHTBOT)
+				return FLIP_HORIZONTALLY;
+			else
+				return 0;
+		default:	/* NOTREACHED */
+			return 0;
+	}
+}
+
+/*
+ * Get an tile-organized image that has
+ *	PlanarConfiguration contiguous if SamplesPerPixel > 1
+ * or
+ *	SamplesPerPixel == 1
+ */	
+static int
+gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+{
+    TIFF* tif = img->tif;
+    tileContigRoutine put = img->put.contig;
+    uint32 col, row, y, rowstoread;
+    uint32 pos;
+    uint32 tw, th;
+    unsigned char* buf;
+    int32 fromskew, toskew;
+    uint32 nrow;
+    int ret = 1, flip;
+
+    buf = (unsigned char*) _TIFFmalloc(TIFFTileSize(tif));
+    if (buf == 0) {
+		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer");
+		return (0);
+    }
+    _TIFFmemset(buf, 0, TIFFTileSize(tif));
+    TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw);
+    TIFFGetField(tif, TIFFTAG_TILELENGTH, &th);
+
+    flip = setorientation(img);
+    if (flip & FLIP_VERTICALLY) {
+	    y = h - 1;
+	    toskew = -(int32)(tw + w);
+    }
+    else {
+	    y = 0;
+	    toskew = -(int32)(tw - w);
+    }
+     
+    for (row = 0; row < h; row += nrow)
+    {
+        rowstoread = th - (row + img->row_offset) % th;
+    	nrow = (row + rowstoread > h ? h - row : rowstoread);
+	for (col = 0; col < w; col += tw) 
+        {
+            if (TIFFReadTile(tif, buf, col+img->col_offset,
+                             row+img->row_offset, 0, 0) < 0 && img->stoponerr)
+            {
+                ret = 0;
+                break;
+            }
+	    
+            pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif);
+
+    	    if (col + tw > w) 
+            {
+                /*
+                 * Tile is clipped horizontally.  Calculate
+                 * visible portion and skewing factors.
+                 */
+                uint32 npix = w - col;
+                fromskew = tw - npix;
+                (*put)(img, raster+y*w+col, col, y,
+                       npix, nrow, fromskew, toskew + fromskew, buf + pos);
+            }
+            else 
+            {
+                (*put)(img, raster+y*w+col, col, y, tw, nrow, 0, toskew, buf + pos);
+            }
+        }
+
+        y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow);
+    }
+    _TIFFfree(buf);
+
+    if (flip & FLIP_HORIZONTALLY) {
+	    uint32 line;
+
+	    for (line = 0; line < h; line++) {
+		    uint32 *left = raster + (line * w);
+		    uint32 *right = left + w - 1;
+		    
+		    while ( left < right ) {
+			    uint32 temp = *left;
+			    *left = *right;
+			    *right = temp;
+			    left++, right--;
+		    }
+	    }
+    }
+
+    return (ret);
+}
+
+/*
+ * Get an tile-organized image that has
+ *	 SamplesPerPixel > 1
+ *	 PlanarConfiguration separated
+ * We assume that all such images are RGB.
+ */	
+static int
+gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+{
+    TIFF* tif = img->tif;
+    tileSeparateRoutine put = img->put.separate;
+    uint32 col, row, y, rowstoread;
+    uint32 pos;
+    uint32 tw, th;
+    unsigned char* buf;
+    unsigned char* r;
+    unsigned char* g;
+    unsigned char* b;
+    unsigned char* a;
+    tsize_t tilesize;
+    int32 fromskew, toskew;
+    int alpha = img->alpha;
+    uint32 nrow;
+    int ret = 1, flip;
+
+    tilesize = TIFFTileSize(tif);
+    buf = (unsigned char*) _TIFFmalloc(4*tilesize);
+    if (buf == 0) {
+		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer");
+		return (0);
+    }
+    _TIFFmemset(buf, 0, 4*tilesize);
+    r = buf;
+    g = r + tilesize;
+    b = g + tilesize;
+    a = b + tilesize;
+    if (!alpha)
+	_TIFFmemset(a, 0xff, tilesize);
+    TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw);
+    TIFFGetField(tif, TIFFTAG_TILELENGTH, &th);
+
+    flip = setorientation(img);
+    if (flip & FLIP_VERTICALLY) {
+	    y = h - 1;
+	    toskew = -(int32)(tw + w);
+    }
+    else {
+	    y = 0;
+	    toskew = -(int32)(tw - w);
+    }
+
+    for (row = 0; row < h; row += nrow) 
+    {
+        rowstoread = th - (row + img->row_offset) % th;
+    	nrow = (row + rowstoread > h ? h - row : rowstoread);
+        for (col = 0; col < w; col += tw) 
+        {
+            if (TIFFReadTile(tif, r, col+img->col_offset,
+                             row+img->row_offset,0,0) < 0 && img->stoponerr)
+            {
+                ret = 0;
+                break;
+            }
+            if (TIFFReadTile(tif, g, col+img->col_offset,
+                             row+img->row_offset,0,1) < 0 && img->stoponerr)
+            {
+                ret = 0;
+                break;
+            }
+            if (TIFFReadTile(tif, b, col+img->col_offset,
+                             row+img->row_offset,0,2) < 0 && img->stoponerr)
+            {
+                ret = 0;
+                break;
+            }
+            if (alpha && TIFFReadTile(tif,a,col+img->col_offset,
+                                      row+img->row_offset,0,3) < 0 && img->stoponerr)
+            {
+                ret = 0;
+                break;
+            }
+
+            pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif);
+
+            if (col + tw > w) 
+            {
+                /*
+                 * Tile is clipped horizontally.  Calculate
+                 * visible portion and skewing factors.
+                 */
+                uint32 npix = w - col;
+                fromskew = tw - npix;
+                (*put)(img, raster+y*w+col, col, y,
+                       npix, nrow, fromskew, toskew + fromskew, 
+                       r + pos, g + pos, b + pos, a + pos);
+            } else {
+                (*put)(img, raster+y*w+col, col, y,
+                       tw, nrow, 0, toskew, r + pos, g + pos, b + pos, a + pos);
+            }
+        }
+
+        y += (flip & FLIP_VERTICALLY ?-(int32) nrow : (int32) nrow);
+    }
+
+    if (flip & FLIP_HORIZONTALLY) {
+	    uint32 line;
+
+	    for (line = 0; line < h; line++) {
+		    uint32 *left = raster + (line * w);
+		    uint32 *right = left + w - 1;
+		    
+		    while ( left < right ) {
+			    uint32 temp = *left;
+			    *left = *right;
+			    *right = temp;
+			    left++, right--;
+		    }
+	    }
+    }
+
+    _TIFFfree(buf);
+    return (ret);
+}
+
+/*
+ * Get a strip-organized image that has
+ *	PlanarConfiguration contiguous if SamplesPerPixel > 1
+ * or
+ *	SamplesPerPixel == 1
+ */	
+static int
+gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+{
+    TIFF* tif = img->tif;
+    tileContigRoutine put = img->put.contig;
+    uint32 row, y, nrow, rowstoread;
+    uint32 pos;
+    unsigned char* buf;
+    uint32 rowsperstrip;
+    uint32 imagewidth = img->width;
+    tsize_t scanline;
+    int32 fromskew, toskew;
+    int ret = 1, flip;
+
+    buf = (unsigned char*) _TIFFmalloc(TIFFStripSize(tif));
+    if (buf == 0) {
+		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer");
+		return (0);
+    }
+    _TIFFmemset(buf, 0, TIFFStripSize(tif));
+
+    flip = setorientation(img);
+    if (flip & FLIP_VERTICALLY) {
+	    y = h - 1;
+	    toskew = -(int32)(w + w);
+    } else {
+	    y = 0;
+	    toskew = -(int32)(w - w);
+    }
+
+    TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
+    scanline = TIFFScanlineSize(tif);
+    fromskew = (w < imagewidth ? imagewidth - w : 0);
+    for (row = 0; row < h; row += nrow) 
+    {
+        rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip;
+        nrow = (row + rowstoread > h ? h - row : rowstoread);
+        if (TIFFReadEncodedStrip(tif,
+                                 TIFFComputeStrip(tif,row+img->row_offset, 0),
+                                 buf, 
+                                 ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0
+            && img->stoponerr)
+        {
+            ret = 0;
+            break;
+        }
+
+        pos = ((row + img->row_offset) % rowsperstrip) * scanline;
+        (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, buf + pos);
+        y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow);
+    }
+
+    if (flip & FLIP_HORIZONTALLY) {
+	    uint32 line;
+
+	    for (line = 0; line < h; line++) {
+		    uint32 *left = raster + (line * w);
+		    uint32 *right = left + w - 1;
+		    
+		    while ( left < right ) {
+			    uint32 temp = *left;
+			    *left = *right;
+			    *right = temp;
+			    left++, right--;
+		    }
+	    }
+    }
+
+    _TIFFfree(buf);
+    return (ret);
+}
+
+/*
+ * Get a strip-organized image with
+ *	 SamplesPerPixel > 1
+ *	 PlanarConfiguration separated
+ * We assume that all such images are RGB.
+ */
+static int
+gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+{
+    TIFF* tif = img->tif;
+    tileSeparateRoutine put = img->put.separate;
+    unsigned char *buf;
+    unsigned char *r, *g, *b, *a;
+    uint32 row, y, nrow, rowstoread;
+    uint32 pos;
+    tsize_t scanline;
+    uint32 rowsperstrip, offset_row;
+    uint32 imagewidth = img->width;
+    tsize_t stripsize;
+    int32 fromskew, toskew;
+    int alpha = img->alpha;
+    int	ret = 1, flip;
+
+    stripsize = TIFFStripSize(tif);
+    r = buf = (unsigned char *)_TIFFmalloc(4*stripsize);
+    if (buf == 0) {
+		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer");
+		return (0);
+    }
+    _TIFFmemset(buf, 0, 4*stripsize);
+    g = r + stripsize;
+    b = g + stripsize;
+    a = b + stripsize;
+    if (!alpha)
+	_TIFFmemset(a, 0xff, stripsize);
+
+    flip = setorientation(img);
+    if (flip & FLIP_VERTICALLY) {
+	    y = h - 1;
+	    toskew = -(int32)(w + w);
+    }
+    else {
+	    y = 0;
+	    toskew = -(int32)(w - w);
+    }
+
+    TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
+    scanline = TIFFScanlineSize(tif);
+    fromskew = (w < imagewidth ? imagewidth - w : 0);
+    for (row = 0; row < h; row += nrow) 
+    {
+        rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip;    	
+        nrow = (row + rowstoread > h ? h - row : rowstoread);
+        offset_row = row + img->row_offset;
+    	if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0),
+                                 r, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 
+            && img->stoponerr)
+        {
+            ret = 0;
+            break;
+        }
+        if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 1),
+                                 g, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 
+            && img->stoponerr)
+        {
+            ret = 0;
+            break;
+        }
+        if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 2),
+                                 b, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 
+            && img->stoponerr)
+        {
+            ret = 0;
+            break;
+        }
+        if (alpha &&
+            (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 3),
+                                  a, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 
+             && img->stoponerr))
+        {
+            ret = 0;
+            break;
+        }
+
+        pos = ((row + img->row_offset) % rowsperstrip) * scanline;
+        (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, r + pos, g + pos, 
+               b + pos, a + pos);
+        y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow);
+    }
+
+    if (flip & FLIP_HORIZONTALLY) {
+	    uint32 line;
+
+	    for (line = 0; line < h; line++) {
+		    uint32 *left = raster + (line * w);
+		    uint32 *right = left + w - 1;
+		    
+		    while ( left < right ) {
+			    uint32 temp = *left;
+			    *left = *right;
+			    *right = temp;
+			    left++, right--;
+		    }
+	    }
+    }
+
+    _TIFFfree(buf);
+    return (ret);
+}
+
+/*
+ * The following routines move decoded data returned
+ * from the TIFF library into rasters filled with packed
+ * ABGR pixels (i.e. suitable for passing to lrecwrite.)
+ *
+ * The routines have been created according to the most
+ * important cases and optimized.  pickTileContigCase and
+ * pickTileSeparateCase analyze the parameters and select
+ * the appropriate "put" routine to use.
+ */
+#define	REPEAT8(op)	REPEAT4(op); REPEAT4(op)
+#define	REPEAT4(op)	REPEAT2(op); REPEAT2(op)
+#define	REPEAT2(op)	op; op
+#define	CASE8(x,op)			\
+    switch (x) {			\
+    case 7: op; case 6: op; case 5: op;	\
+    case 4: op; case 3: op; case 2: op;	\
+    case 1: op;				\
+    }
+#define	CASE4(x,op)	switch (x) { case 3: op; case 2: op; case 1: op; }
+#define	NOP
+
+#define	UNROLL8(w, op1, op2) {		\
+    uint32 _x;				\
+    for (_x = w; _x >= 8; _x -= 8) {	\
+	op1;				\
+	REPEAT8(op2);			\
+    }					\
+    if (_x > 0) {			\
+	op1;				\
+	CASE8(_x,op2);			\
+    }					\
+}
+#define	UNROLL4(w, op1, op2) {		\
+    uint32 _x;				\
+    for (_x = w; _x >= 4; _x -= 4) {	\
+	op1;				\
+	REPEAT4(op2);			\
+    }					\
+    if (_x > 0) {			\
+	op1;				\
+	CASE4(_x,op2);			\
+    }					\
+}
+#define	UNROLL2(w, op1, op2) {		\
+    uint32 _x;				\
+    for (_x = w; _x >= 2; _x -= 2) {	\
+	op1;				\
+	REPEAT2(op2);			\
+    }					\
+    if (_x) {				\
+	op1;				\
+	op2;				\
+    }					\
+}
+    
+#define	SKEW(r,g,b,skew)	{ r += skew; g += skew; b += skew; }
+#define	SKEW4(r,g,b,a,skew)	{ r += skew; g += skew; b += skew; a+= skew; }
+
+#define A1 (((uint32)0xffL)<<24)
+#define	PACK(r,g,b)	\
+	((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|A1)
+#define	PACK4(r,g,b,a)	\
+	((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|((uint32)(a)<<24))
+#define W2B(v) (((v)>>8)&0xff)
+#define	PACKW(r,g,b)	\
+	((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|A1)
+#define	PACKW4(r,g,b,a)	\
+	((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|((uint32)W2B(a)<<24))
+
+#define	DECLAREContigPutFunc(name) \
+static void name(\
+    TIFFRGBAImage* img, \
+    uint32* cp, \
+    uint32 x, uint32 y, \
+    uint32 w, uint32 h, \
+    int32 fromskew, int32 toskew, \
+    unsigned char* pp \
+)
+
+/*
+ * 8-bit palette => colormap/RGB
+ */
+DECLAREContigPutFunc(put8bitcmaptile)
+{
+    uint32** PALmap = img->PALmap;
+    int samplesperpixel = img->samplesperpixel;
+
+    (void) y;
+    while (h-- > 0) {
+	for (x = w; x-- > 0;)
+        {
+	    *cp++ = PALmap[*pp][0];
+            pp += samplesperpixel;
+        }
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 4-bit palette => colormap/RGB
+ */
+DECLAREContigPutFunc(put4bitcmaptile)
+{
+    uint32** PALmap = img->PALmap;
+
+    (void) x; (void) y;
+    fromskew /= 2;
+    while (h-- > 0) {
+	uint32* bw;
+	UNROLL2(w, bw = PALmap[*pp++], *cp++ = *bw++);
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 2-bit palette => colormap/RGB
+ */
+DECLAREContigPutFunc(put2bitcmaptile)
+{
+    uint32** PALmap = img->PALmap;
+
+    (void) x; (void) y;
+    fromskew /= 4;
+    while (h-- > 0) {
+	uint32* bw;
+	UNROLL4(w, bw = PALmap[*pp++], *cp++ = *bw++);
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 1-bit palette => colormap/RGB
+ */
+DECLAREContigPutFunc(put1bitcmaptile)
+{
+    uint32** PALmap = img->PALmap;
+
+    (void) x; (void) y;
+    fromskew /= 8;
+    while (h-- > 0) {
+	uint32* bw;
+	UNROLL8(w, bw = PALmap[*pp++], *cp++ = *bw++);
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 8-bit greyscale => colormap/RGB
+ */
+DECLAREContigPutFunc(putgreytile)
+{
+    int samplesperpixel = img->samplesperpixel;
+    uint32** BWmap = img->BWmap;
+
+    (void) y;
+    while (h-- > 0) {
+	for (x = w; x-- > 0;)
+        {
+	    *cp++ = BWmap[*pp][0];
+            pp += samplesperpixel;
+        }
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 16-bit greyscale => colormap/RGB
+ */
+DECLAREContigPutFunc(put16bitbwtile)
+{
+    int samplesperpixel = img->samplesperpixel;
+    uint32** BWmap = img->BWmap;
+
+    (void) y;
+    while (h-- > 0) {
+        uint16 *wp = (uint16 *) pp;
+
+	for (x = w; x-- > 0;)
+        {
+            /* use high order byte of 16bit value */
+
+	    *cp++ = BWmap[*wp >> 8][0];
+            pp += 2 * samplesperpixel;
+            wp += samplesperpixel;
+        }
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 1-bit bilevel => colormap/RGB
+ */
+DECLAREContigPutFunc(put1bitbwtile)
+{
+    uint32** BWmap = img->BWmap;
+
+    (void) x; (void) y;
+    fromskew /= 8;
+    while (h-- > 0) {
+	uint32* bw;
+	UNROLL8(w, bw = BWmap[*pp++], *cp++ = *bw++);
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 2-bit greyscale => colormap/RGB
+ */
+DECLAREContigPutFunc(put2bitbwtile)
+{
+    uint32** BWmap = img->BWmap;
+
+    (void) x; (void) y;
+    fromskew /= 4;
+    while (h-- > 0) {
+	uint32* bw;
+	UNROLL4(w, bw = BWmap[*pp++], *cp++ = *bw++);
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 4-bit greyscale => colormap/RGB
+ */
+DECLAREContigPutFunc(put4bitbwtile)
+{
+    uint32** BWmap = img->BWmap;
+
+    (void) x; (void) y;
+    fromskew /= 2;
+    while (h-- > 0) {
+	uint32* bw;
+	UNROLL2(w, bw = BWmap[*pp++], *cp++ = *bw++);
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 8-bit packed samples, no Map => RGB
+ */
+DECLAREContigPutFunc(putRGBcontig8bittile)
+{
+    int samplesperpixel = img->samplesperpixel;
+
+    (void) x; (void) y;
+    fromskew *= samplesperpixel;
+    while (h-- > 0) {
+	UNROLL8(w, NOP,
+	    *cp++ = PACK(pp[0], pp[1], pp[2]);
+	    pp += samplesperpixel);
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 8-bit packed samples, w/ Map => RGB
+ */
+DECLAREContigPutFunc(putRGBcontig8bitMaptile)
+{
+    TIFFRGBValue* Map = img->Map;
+    int samplesperpixel = img->samplesperpixel;
+
+    (void) y;
+    fromskew *= samplesperpixel;
+    while (h-- > 0) {
+	for (x = w; x-- > 0;) {
+	    *cp++ = PACK(Map[pp[0]], Map[pp[1]], Map[pp[2]]);
+	    pp += samplesperpixel;
+	}
+	pp += fromskew;
+	cp += toskew;
+    }
+}
+
+/*
+ * 8-bit packed samples => RGBA w/ associated alpha
+ * (known to have Map == NULL)
+ */
+DECLAREContigPutFunc(putRGBAAcontig8bittile)
+{
+    int samplesperpixel = img->samplesperpixel;
+
+    (void) x; (void) y;
+    fromskew *= samplesperpixel;
+    while (h-- > 0) {
+	UNROLL8(w, NOP,
+	    *cp++ = PACK4(pp[0], pp[1], pp[2], pp[3]);
+	    pp += samplesperpixel);
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 8-bit packed samples => RGBA w/ unassociated alpha
+ * (known to have Map == NULL)
+ */
+DECLAREContigPutFunc(putRGBUAcontig8bittile)
+{
+    int samplesperpixel = img->samplesperpixel;
+
+    (void) y;
+    fromskew *= samplesperpixel;
+    while (h-- > 0) {
+	uint32 r, g, b, a;
+	for (x = w; x-- > 0;) {
+	    a = pp[3];
+	    r = (pp[0] * a) / 255;
+	    g = (pp[1] * a) / 255;
+	    b = (pp[2] * a) / 255;
+	    *cp++ = PACK4(r,g,b,a);
+	    pp += samplesperpixel;
+	}
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 16-bit packed samples => RGB
+ */
+DECLAREContigPutFunc(putRGBcontig16bittile)
+{
+    int samplesperpixel = img->samplesperpixel;
+    uint16 *wp = (uint16 *)pp;
+
+    (void) y;
+    fromskew *= samplesperpixel;
+    while (h-- > 0) {
+	for (x = w; x-- > 0;) {
+	    *cp++ = PACKW(wp[0], wp[1], wp[2]);
+	    wp += samplesperpixel;
+	}
+	cp += toskew;
+	wp += fromskew;
+    }
+}
+
+/*
+ * 16-bit packed samples => RGBA w/ associated alpha
+ * (known to have Map == NULL)
+ */
+DECLAREContigPutFunc(putRGBAAcontig16bittile)
+{
+    int samplesperpixel = img->samplesperpixel;
+    uint16 *wp = (uint16 *)pp;
+
+    (void) y;
+    fromskew *= samplesperpixel;
+    while (h-- > 0) {
+	for (x = w; x-- > 0;) {
+	    *cp++ = PACKW4(wp[0], wp[1], wp[2], wp[3]);
+	    wp += samplesperpixel;
+	}
+	cp += toskew;
+	wp += fromskew;
+    }
+}
+
+/*
+ * 16-bit packed samples => RGBA w/ unassociated alpha
+ * (known to have Map == NULL)
+ */
+DECLAREContigPutFunc(putRGBUAcontig16bittile)
+{
+    int samplesperpixel = img->samplesperpixel;
+    uint16 *wp = (uint16 *)pp;
+
+    (void) y;
+    fromskew *= samplesperpixel;
+    while (h-- > 0) {
+	uint32 r,g,b,a;
+	/*
+	 * We shift alpha down four bits just in case unsigned
+	 * arithmetic doesn't handle the full range.
+	 * We still have plenty of accuracy, since the output is 8 bits.
+	 * So we have (r * 0xffff) * (a * 0xfff)) = r*a * (0xffff*0xfff)
+	 * Since we want r*a * 0xff for eight bit output,
+	 * we divide by (0xffff * 0xfff) / 0xff == 0x10eff.
+	 */
+	for (x = w; x-- > 0;) {
+	    a = wp[3] >> 4; 
+	    r = (wp[0] * a) / 0x10eff;
+	    g = (wp[1] * a) / 0x10eff;
+	    b = (wp[2] * a) / 0x10eff;
+	    *cp++ = PACK4(r,g,b,a);
+	    wp += samplesperpixel;
+	}
+	cp += toskew;
+	wp += fromskew;
+    }
+}
+
+/*
+ * 8-bit packed CMYK samples w/o Map => RGB
+ *
+ * NB: The conversion of CMYK->RGB is *very* crude.
+ */
+DECLAREContigPutFunc(putRGBcontig8bitCMYKtile)
+{
+    int samplesperpixel = img->samplesperpixel;
+    uint16 r, g, b, k;
+
+    (void) x; (void) y;
+    fromskew *= samplesperpixel;
+    while (h-- > 0) {
+	UNROLL8(w, NOP,
+	    k = 255 - pp[3];
+	    r = (k*(255-pp[0]))/255;
+	    g = (k*(255-pp[1]))/255;
+	    b = (k*(255-pp[2]))/255;
+	    *cp++ = PACK(r, g, b);
+	    pp += samplesperpixel);
+	cp += toskew;
+	pp += fromskew;
+    }
+}
+
+/*
+ * 8-bit packed CMYK samples w/Map => RGB
+ *
+ * NB: The conversion of CMYK->RGB is *very* crude.
+ */
+DECLAREContigPutFunc(putRGBcontig8bitCMYKMaptile)
+{
+    int samplesperpixel = img->samplesperpixel;
+    TIFFRGBValue* Map = img->Map;
+    uint16 r, g, b, k;
+
+    (void) y;
+    fromskew *= samplesperpixel;
+    while (h-- > 0) {
+	for (x = w; x-- > 0;) {
+	    k = 255 - pp[3];
+	    r = (k*(255-pp[0]))/255;
+	    g = (k*(255-pp[1]))/255;
+	    b = (k*(255-pp[2]))/255;
+	    *cp++ = PACK(Map[r], Map[g], Map[b]);
+	    pp += samplesperpixel;
+	}
+	pp += fromskew;
+	cp += toskew;
+    }
+}
+
+#define	DECLARESepPutFunc(name) \
+static void name(\
+    TIFFRGBAImage* img,\
+    uint32* cp,\
+    uint32 x, uint32 y, \
+    uint32 w, uint32 h,\
+    int32 fromskew, int32 toskew,\
+    unsigned char* r, unsigned char* g, unsigned char* b, unsigned char* a\
+)
+
+/*
+ * 8-bit unpacked samples => RGB
+ */
+DECLARESepPutFunc(putRGBseparate8bittile)
+{
+    (void) img; (void) x; (void) y; (void) a;
+    while (h-- > 0) {
+	UNROLL8(w, NOP, *cp++ = PACK(*r++, *g++, *b++));
+	SKEW(r, g, b, fromskew);
+	cp += toskew;
+    }
+}
+
+/*
+ * 8-bit unpacked samples => RGB
+ */
+DECLARESepPutFunc(putRGBseparate8bitMaptile)
+{
+    TIFFRGBValue* Map = img->Map;
+
+    (void) y; (void) a;
+    while (h-- > 0) {
+	for (x = w; x > 0; x--)
+	    *cp++ = PACK(Map[*r++], Map[*g++], Map[*b++]);
+	SKEW(r, g, b, fromskew);
+	cp += toskew;
+    }
+}
+
+/*
+ * 8-bit unpacked samples => RGBA w/ associated alpha
+ */
+DECLARESepPutFunc(putRGBAAseparate8bittile)
+{
+    (void) img; (void) x; (void) y;
+    while (h-- > 0) {
+	UNROLL8(w, NOP, *cp++ = PACK4(*r++, *g++, *b++, *a++));
+	SKEW4(r, g, b, a, fromskew);
+	cp += toskew;
+    }
+}
+
+/*
+ * 8-bit unpacked samples => RGBA w/ unassociated alpha
+ */
+DECLARESepPutFunc(putRGBUAseparate8bittile)
+{
+    (void) img; (void) y;
+    while (h-- > 0) {
+	uint32 rv, gv, bv, av;
+	for (x = w; x-- > 0;) {
+	    av = *a++;
+	    rv = (*r++ * av) / 255;
+	    gv = (*g++ * av) / 255;
+	    bv = (*b++ * av) / 255;
+	    *cp++ = PACK4(rv,gv,bv,av);
+	}
+	SKEW4(r, g, b, a, fromskew);
+	cp += toskew;
+    }
+}
+
+/*
+ * 16-bit unpacked samples => RGB
+ */
+DECLARESepPutFunc(putRGBseparate16bittile)
+{
+    uint16 *wr = (uint16*) r;
+    uint16 *wg = (uint16*) g;
+    uint16 *wb = (uint16*) b;
+
+    (void) img; (void) y; (void) a;
+    while (h-- > 0) {
+	for (x = 0; x < w; x++)
+	    *cp++ = PACKW(*wr++, *wg++, *wb++);
+	SKEW(wr, wg, wb, fromskew);
+	cp += toskew;
+    }
+}
+
+/*
+ * 16-bit unpacked samples => RGBA w/ associated alpha
+ */
+DECLARESepPutFunc(putRGBAAseparate16bittile)
+{
+    uint16 *wr = (uint16*) r;
+    uint16 *wg = (uint16*) g;
+    uint16 *wb = (uint16*) b;
+    uint16 *wa = (uint16*) a;
+
+    (void) img; (void) y;
+    while (h-- > 0) {
+	for (x = 0; x < w; x++)
+	    *cp++ = PACKW4(*wr++, *wg++, *wb++, *wa++);
+	SKEW4(wr, wg, wb, wa, fromskew);
+	cp += toskew;
+    }
+}
+
+/*
+ * 16-bit unpacked samples => RGBA w/ unassociated alpha
+ */
+DECLARESepPutFunc(putRGBUAseparate16bittile)
+{
+    uint16 *wr = (uint16*) r;
+    uint16 *wg = (uint16*) g;
+    uint16 *wb = (uint16*) b;
+    uint16 *wa = (uint16*) a;
+
+    (void) img; (void) y;
+    while (h-- > 0) {
+	uint32 r,g,b,a;
+	/*
+	 * We shift alpha down four bits just in case unsigned
+	 * arithmetic doesn't handle the full range.
+	 * We still have plenty of accuracy, since the output is 8 bits.
+	 * So we have (r * 0xffff) * (a * 0xfff)) = r*a * (0xffff*0xfff)
+	 * Since we want r*a * 0xff for eight bit output,
+	 * we divide by (0xffff * 0xfff) / 0xff == 0x10eff.
+	 */
+	for (x = w; x-- > 0;) {
+	    a = *wa++ >> 4; 
+	    r = (*wr++ * a) / 0x10eff;
+	    g = (*wg++ * a) / 0x10eff;
+	    b = (*wb++ * a) / 0x10eff;
+	    *cp++ = PACK4(r,g,b,a);
+	}
+	SKEW4(wr, wg, wb, wa, fromskew);
+	cp += toskew;
+    }
+}
+
+/*
+ * 8-bit packed CIE L*a*b 1976 samples => RGB
+ */
+DECLAREContigPutFunc(putcontig8bitCIELab)
+{
+	float X, Y, Z;
+	uint32 r, g, b;
+	(void) y;
+	fromskew *= 3;
+	while (h-- > 0) {
+		for (x = w; x-- > 0;) {
+			TIFFCIELabToXYZ(img->cielab,
+					(unsigned char)pp[0],
+					(signed char)pp[1],
+					(signed char)pp[2],
+					&X, &Y, &Z);
+			TIFFXYZToRGB(img->cielab, X, Y, Z, &r, &g, &b);
+			*cp++ = PACK(r, g, b);
+			pp += 3;
+		}
+		cp += toskew;
+		pp += fromskew;
+	}
+}
+
+/*
+ * YCbCr -> RGB conversion and packing routines.
+ */
+
+#define	YCbCrtoRGB(dst, Y) {						\
+	uint32 r, g, b;							\
+	TIFFYCbCrtoRGB(img->ycbcr, (Y), Cb, Cr, &r, &g, &b);		\
+	dst = PACK(r, g, b);						\
+}
+
+/*
+ * 8-bit packed YCbCr samples => RGB 
+ * This function is generic for different sampling sizes, 
+ * and can handle blocks sizes that aren't multiples of the
+ * sampling size.  However, it is substantially less optimized
+ * than the specific sampling cases.  It is used as a fallback
+ * for difficult blocks.
+ */
+#ifdef notdef
+static void putcontig8bitYCbCrGenericTile( 
+    TIFFRGBAImage* img, 
+    uint32* cp, 
+    uint32 x, uint32 y, 
+    uint32 w, uint32 h, 
+    int32 fromskew, int32 toskew, 
+    unsigned char* pp,
+    int h_group, 
+    int v_group )
+
+{
+    uint32* cp1 = cp+w+toskew;
+    uint32* cp2 = cp1+w+toskew;
+    uint32* cp3 = cp2+w+toskew;
+    int32 incr = 3*w+4*toskew;
+    int32   Cb, Cr;
+    int     group_size = v_group * h_group + 2;
+
+    (void) y;
+    fromskew = (fromskew * group_size) / h_group;
+
+    for( yy = 0; yy < h; yy++ )
+    {
+        unsigned char *pp_line;
+        int     y_line_group = yy / v_group;
+        int     y_remainder = yy - y_line_group * v_group;
+
+        pp_line = pp + v_line_group * 
+
+        
+        for( xx = 0; xx < w; xx++ )
+        {
+            Cb = pp
+        }
+    }
+    for (; h >= 4; h -= 4) {
+	x = w>>2;
+	do {
+	    Cb = pp[16];
+	    Cr = pp[17];
+
+	    YCbCrtoRGB(cp [0], pp[ 0]);
+	    YCbCrtoRGB(cp [1], pp[ 1]);
+	    YCbCrtoRGB(cp [2], pp[ 2]);
+	    YCbCrtoRGB(cp [3], pp[ 3]);
+	    YCbCrtoRGB(cp1[0], pp[ 4]);
+	    YCbCrtoRGB(cp1[1], pp[ 5]);
+	    YCbCrtoRGB(cp1[2], pp[ 6]);
+	    YCbCrtoRGB(cp1[3], pp[ 7]);
+	    YCbCrtoRGB(cp2[0], pp[ 8]);
+	    YCbCrtoRGB(cp2[1], pp[ 9]);
+	    YCbCrtoRGB(cp2[2], pp[10]);
+	    YCbCrtoRGB(cp2[3], pp[11]);
+	    YCbCrtoRGB(cp3[0], pp[12]);
+	    YCbCrtoRGB(cp3[1], pp[13]);
+	    YCbCrtoRGB(cp3[2], pp[14]);
+	    YCbCrtoRGB(cp3[3], pp[15]);
+
+	    cp += 4, cp1 += 4, cp2 += 4, cp3 += 4;
+	    pp += 18;
+	} while (--x);
+	cp += incr, cp1 += incr, cp2 += incr, cp3 += incr;
+	pp += fromskew;
+    }
+}
+#endif
+
+/*
+ * 8-bit packed YCbCr samples w/ 4,4 subsampling => RGB
+ */
+DECLAREContigPutFunc(putcontig8bitYCbCr44tile)
+{
+    uint32* cp1 = cp+w+toskew;
+    uint32* cp2 = cp1+w+toskew;
+    uint32* cp3 = cp2+w+toskew;
+    int32 incr = 3*w+4*toskew;
+
+    (void) y;
+    /* adjust fromskew */
+    fromskew = (fromskew * 18) / 4;
+    if ((h & 3) == 0 && (w & 3) == 0) {				        
+        for (; h >= 4; h -= 4) {
+            x = w>>2;
+            do {
+                int32 Cb = pp[16];
+                int32 Cr = pp[17];
+
+                YCbCrtoRGB(cp [0], pp[ 0]);
+                YCbCrtoRGB(cp [1], pp[ 1]);
+                YCbCrtoRGB(cp [2], pp[ 2]);
+                YCbCrtoRGB(cp [3], pp[ 3]);
+                YCbCrtoRGB(cp1[0], pp[ 4]);
+                YCbCrtoRGB(cp1[1], pp[ 5]);
+                YCbCrtoRGB(cp1[2], pp[ 6]);
+                YCbCrtoRGB(cp1[3], pp[ 7]);
+                YCbCrtoRGB(cp2[0], pp[ 8]);
+                YCbCrtoRGB(cp2[1], pp[ 9]);
+                YCbCrtoRGB(cp2[2], pp[10]);
+                YCbCrtoRGB(cp2[3], pp[11]);
+                YCbCrtoRGB(cp3[0], pp[12]);
+                YCbCrtoRGB(cp3[1], pp[13]);
+                YCbCrtoRGB(cp3[2], pp[14]);
+                YCbCrtoRGB(cp3[3], pp[15]);
+
+                cp += 4, cp1 += 4, cp2 += 4, cp3 += 4;
+                pp += 18;
+            } while (--x);
+            cp += incr, cp1 += incr, cp2 += incr, cp3 += incr;
+            pp += fromskew;
+        }
+    } else {
+        while (h > 0) {
+            for (x = w; x > 0;) {
+                int32 Cb = pp[16];
+                int32 Cr = pp[17];
+                switch (x) {
+                default:
+                    switch (h) {
+                    default: YCbCrtoRGB(cp3[3], pp[15]); /* FALLTHROUGH */
+                    case 3:  YCbCrtoRGB(cp2[3], pp[11]); /* FALLTHROUGH */
+                    case 2:  YCbCrtoRGB(cp1[3], pp[ 7]); /* FALLTHROUGH */
+                    case 1:  YCbCrtoRGB(cp [3], pp[ 3]); /* FALLTHROUGH */
+                    }                                    /* FALLTHROUGH */
+                case 3:
+                    switch (h) {
+                    default: YCbCrtoRGB(cp3[2], pp[14]); /* FALLTHROUGH */
+                    case 3:  YCbCrtoRGB(cp2[2], pp[10]); /* FALLTHROUGH */
+                    case 2:  YCbCrtoRGB(cp1[2], pp[ 6]); /* FALLTHROUGH */
+                    case 1:  YCbCrtoRGB(cp [2], pp[ 2]); /* FALLTHROUGH */
+                    }                                    /* FALLTHROUGH */
+                case 2:
+                    switch (h) {
+                    default: YCbCrtoRGB(cp3[1], pp[13]); /* FALLTHROUGH */
+                    case 3:  YCbCrtoRGB(cp2[1], pp[ 9]); /* FALLTHROUGH */
+                    case 2:  YCbCrtoRGB(cp1[1], pp[ 5]); /* FALLTHROUGH */
+                    case 1:  YCbCrtoRGB(cp [1], pp[ 1]); /* FALLTHROUGH */
+                    }                                    /* FALLTHROUGH */
+                case 1:
+                    switch (h) {
+                    default: YCbCrtoRGB(cp3[0], pp[12]); /* FALLTHROUGH */
+                    case 3:  YCbCrtoRGB(cp2[0], pp[ 8]); /* FALLTHROUGH */
+                    case 2:  YCbCrtoRGB(cp1[0], pp[ 4]); /* FALLTHROUGH */
+                    case 1:  YCbCrtoRGB(cp [0], pp[ 0]); /* FALLTHROUGH */
+                    }                                    /* FALLTHROUGH */
+                }
+                if (x < 4) {
+                    cp += x; cp1 += x; cp2 += x; cp3 += x;
+                    x = 0;
+                }
+                else {
+                    cp += 4; cp1 += 4; cp2 += 4; cp3 += 4;
+                    x -= 4;
+                }
+                pp += 18;
+            }
+            if (h <= 4)
+                break;
+            h -= 4;
+            cp += incr, cp1 += incr, cp2 += incr, cp3 += incr;
+            pp += fromskew;
+        }
+    }
+}
+
+/*
+ * 8-bit packed YCbCr samples w/ 4,2 subsampling => RGB
+ */
+DECLAREContigPutFunc(putcontig8bitYCbCr42tile)
+{
+    uint32* cp1 = cp+w+toskew;
+    int32 incr = 2*toskew+w;
+
+    (void) y;
+    fromskew = (fromskew * 10) / 4;
+    if ((h & 3) == 0 && (w & 1) == 0) {
+        for (; h >= 2; h -= 2) {
+            x = w>>2;
+            do {
+                int32 Cb = pp[8];
+                int32 Cr = pp[9];
+                
+                YCbCrtoRGB(cp [0], pp[0]);
+                YCbCrtoRGB(cp [1], pp[1]);
+                YCbCrtoRGB(cp [2], pp[2]);
+                YCbCrtoRGB(cp [3], pp[3]);
+                YCbCrtoRGB(cp1[0], pp[4]);
+                YCbCrtoRGB(cp1[1], pp[5]);
+                YCbCrtoRGB(cp1[2], pp[6]);
+                YCbCrtoRGB(cp1[3], pp[7]);
+                
+                cp += 4, cp1 += 4;
+                pp += 10;
+            } while (--x);
+            cp += incr, cp1 += incr;
+            pp += fromskew;
+        }
+    } else {
+        while (h > 0) {
+            for (x = w; x > 0;) {
+                int32 Cb = pp[8];
+                int32 Cr = pp[9];
+                switch (x) {
+                default:
+                    switch (h) {
+                    default: YCbCrtoRGB(cp1[3], pp[ 7]); /* FALLTHROUGH */
+                    case 1:  YCbCrtoRGB(cp [3], pp[ 3]); /* FALLTHROUGH */
+                    }                                    /* FALLTHROUGH */
+                case 3:
+                    switch (h) {
+                    default: YCbCrtoRGB(cp1[2], pp[ 6]); /* FALLTHROUGH */
+                    case 1:  YCbCrtoRGB(cp [2], pp[ 2]); /* FALLTHROUGH */
+                    }                                    /* FALLTHROUGH */
+                case 2:
+                    switch (h) {
+                    default: YCbCrtoRGB(cp1[1], pp[ 5]); /* FALLTHROUGH */
+                    case 1:  YCbCrtoRGB(cp [1], pp[ 1]); /* FALLTHROUGH */
+                    }                                    /* FALLTHROUGH */
+                case 1:
+                    switch (h) {
+                    default: YCbCrtoRGB(cp1[0], pp[ 4]); /* FALLTHROUGH */
+                    case 1:  YCbCrtoRGB(cp [0], pp[ 0]); /* FALLTHROUGH */
+                    }                                    /* FALLTHROUGH */
+                }
+                if (x < 4) {
+                    cp += x; cp1 += x;
+                    x = 0;
+                }
+                else {
+                    cp += 4; cp1 += 4;
+                    x -= 4;
+                }
+                pp += 10;
+            }
+            if (h <= 2)
+                break;
+            h -= 2;
+            cp += incr, cp1 += incr;
+            pp += fromskew;
+        }
+    }
+}
+
+/*
+ * 8-bit packed YCbCr samples w/ 4,1 subsampling => RGB
+ */
+DECLAREContigPutFunc(putcontig8bitYCbCr41tile)
+{
+    (void) y;
+    /* XXX adjust fromskew */
+    do {
+	x = w>>2;
+	do {
+	    int32 Cb = pp[4];
+	    int32 Cr = pp[5];
+
+	    YCbCrtoRGB(cp [0], pp[0]);
+	    YCbCrtoRGB(cp [1], pp[1]);
+	    YCbCrtoRGB(cp [2], pp[2]);
+	    YCbCrtoRGB(cp [3], pp[3]);
+
+	    cp += 4;
+	    pp += 6;
+	} while (--x);
+
+        if( (w&3) != 0 )
+        {
+	    int32 Cb = pp[4];
+	    int32 Cr = pp[5];
+
+            switch( (w&3) ) {
+              case 3: YCbCrtoRGB(cp [2], pp[2]);
+              case 2: YCbCrtoRGB(cp [1], pp[1]);
+              case 1: YCbCrtoRGB(cp [0], pp[0]);
+              case 0: break;
+            }
+
+            cp += (w&3);
+            pp += 6;
+        }
+
+	cp += toskew;
+	pp += fromskew;
+    } while (--h);
+
+}
+
+/*
+ * 8-bit packed YCbCr samples w/ 2,2 subsampling => RGB
+ */
+DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
+{
+    uint32* cp1 = cp+w+toskew;
+    int32 incr = 2*toskew+w;
+
+    (void) y;
+    fromskew = (fromskew * 6) / 2;
+    if ((h & 1) == 0 && (w & 1) == 0) {
+        for (; h >= 2; h -= 2) {
+            x = w>>1;
+            do {
+                int32 Cb = pp[4];
+                int32 Cr = pp[5];
+
+                YCbCrtoRGB(cp [0], pp[0]);
+                YCbCrtoRGB(cp [1], pp[1]);
+                YCbCrtoRGB(cp1[0], pp[2]);
+                YCbCrtoRGB(cp1[1], pp[3]);
+
+                cp += 2, cp1 += 2;
+                pp += 6;
+            } while (--x);
+            cp += incr, cp1 += incr;
+            pp += fromskew;
+        }
+    } else {
+        while (h > 0) {
+            for (x = w; x > 0;) {
+                int32 Cb = pp[4];
+                int32 Cr = pp[5];
+                switch (x) {
+                default:
+                    switch (h) {
+                    default: YCbCrtoRGB(cp1[1], pp[ 3]); /* FALLTHROUGH */
+                    case 1:  YCbCrtoRGB(cp [1], pp[ 1]); /* FALLTHROUGH */
+                    }                                    /* FALLTHROUGH */
+                case 1:
+                    switch (h) {
+                    default: YCbCrtoRGB(cp1[0], pp[ 2]); /* FALLTHROUGH */
+                    case 1:  YCbCrtoRGB(cp [0], pp[ 0]); /* FALLTHROUGH */
+                    }                                    /* FALLTHROUGH */
+                }
+                if (x < 2) {
+                    cp += x; cp1 += x;
+                    x = 0;
+                }
+                else {
+                    cp += 2; cp1 += 2;
+                    x -= 2;
+                }
+                pp += 6;
+            }
+            if (h <= 2)
+                break;
+            h -= 2;
+            cp += incr, cp1 += incr;
+            pp += fromskew;
+        }
+    }
+}
+
+/*
+ * 8-bit packed YCbCr samples w/ 2,1 subsampling => RGB
+ */
+DECLAREContigPutFunc(putcontig8bitYCbCr21tile)
+{
+    (void) y;
+    fromskew = (fromskew * 4) / 2;
+    do {
+	x = w>>1;
+	do {
+	    int32 Cb = pp[2];
+	    int32 Cr = pp[3];
+
+	    YCbCrtoRGB(cp[0], pp[0]); 
+	    YCbCrtoRGB(cp[1], pp[1]);
+
+	    cp += 2;
+	    pp += 4;
+	} while (--x);
+
+        if( (w&1) != 0 )
+        {
+	    int32 Cb = pp[2];
+	    int32 Cr = pp[3];
+            
+            YCbCrtoRGB(cp [0], pp[0]);
+
+	    cp += 1;
+	    pp += 4;
+        }
+
+	cp += toskew;
+	pp += fromskew;
+    } while (--h);
+}
+
+/*
+ * 8-bit packed YCbCr samples w/ no subsampling => RGB
+ */
+DECLAREContigPutFunc(putcontig8bitYCbCr11tile)
+{
+    (void) y;
+    fromskew *= 3;
+    do {
+        x = w; /* was x = w>>1; patched 2000/09/25 warmerda at home.com */ 
+	do {
+	    int32 Cb = pp[1];
+	    int32 Cr = pp[2];
+
+	    YCbCrtoRGB(*cp++, pp[0]);
+
+	    pp += 3;
+	} while (--x);
+	cp += toskew;
+	pp += fromskew;
+    } while (--h);
+}
+#undef	YCbCrtoRGB
+
+static tileContigRoutine
+initYCbCrConversion(TIFFRGBAImage* img)
+{
+	static char module[] = "initCIELabConversion";
+
+	float *luma, *refBlackWhite;
+	uint16 hs, vs;
+
+	if (img->ycbcr == NULL) {
+	    img->ycbcr = (TIFFYCbCrToRGB*) _TIFFmalloc(
+		    TIFFroundup(sizeof (TIFFYCbCrToRGB), sizeof (long))
+		    + 4*256*sizeof (TIFFRGBValue)
+		    + 2*256*sizeof (int)
+		    + 3*256*sizeof (int32)
+	    );
+	    if (img->ycbcr == NULL) {
+			TIFFErrorExt(img->tif->tif_clientdata, module,
+			      "No space for YCbCr->RGB conversion state");
+		    return (NULL);
+	    }
+	}
+
+	TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRCOEFFICIENTS, &luma);
+	TIFFGetFieldDefaulted(img->tif, TIFFTAG_REFERENCEBLACKWHITE,
+			      &refBlackWhite);
+	if (TIFFYCbCrToRGBInit(img->ycbcr, luma, refBlackWhite) < 0)
+		return NULL;
+
+	/*
+	 * The 6.0 spec says that subsampling must be
+	 * one of 1, 2, or 4, and that vertical subsampling
+	 * must always be <= horizontal subsampling; so
+	 * there are only a few possibilities and we just
+	 * enumerate the cases.
+	 */
+	TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &hs, &vs);
+	switch ((hs<<4)|vs) {
+		case 0x44: return (putcontig8bitYCbCr44tile);
+		case 0x42: return (putcontig8bitYCbCr42tile);
+		case 0x41: return (putcontig8bitYCbCr41tile);
+		case 0x22: return (putcontig8bitYCbCr22tile);
+		case 0x21: return (putcontig8bitYCbCr21tile);
+		case 0x11: return (putcontig8bitYCbCr11tile);
+	}
+
+	return (NULL);
+}
+
+static tileContigRoutine
+initCIELabConversion(TIFFRGBAImage* img)
+{
+	static char module[] = "initCIELabConversion";
+
+	float   *whitePoint;
+	float   refWhite[3];
+
+	if (!img->cielab) {
+		img->cielab = (TIFFCIELabToRGB *)
+			_TIFFmalloc(sizeof(TIFFCIELabToRGB));
+		if (!img->cielab) {
+			TIFFErrorExt(img->tif->tif_clientdata, module,
+			    "No space for CIE L*a*b*->RGB conversion state.");
+			return NULL;
+		}
+	}
+
+	TIFFGetFieldDefaulted(img->tif, TIFFTAG_WHITEPOINT, &whitePoint);
+	refWhite[1] = 100.0F;
+	refWhite[0] = whitePoint[0] / whitePoint[1] * refWhite[1];
+	refWhite[2] = (1.0F - whitePoint[0] - whitePoint[1])
+		      / whitePoint[1] * refWhite[1];
+	if (TIFFCIELabToRGBInit(img->cielab, &display_sRGB, refWhite) < 0) {
+		TIFFErrorExt(img->tif->tif_clientdata, module,
+		    "Failed to initialize CIE L*a*b*->RGB conversion state.");
+		_TIFFfree(img->cielab);
+		return NULL;
+	}
+
+	return putcontig8bitCIELab;
+}
+
+/*
+ * Greyscale images with less than 8 bits/sample are handled
+ * with a table to avoid lots of shifts and masks.  The table
+ * is setup so that put*bwtile (below) can retrieve 8/bitspersample
+ * pixel values simply by indexing into the table with one
+ * number.
+ */
+static int
+makebwmap(TIFFRGBAImage* img)
+{
+    TIFFRGBValue* Map = img->Map;
+    int bitspersample = img->bitspersample;
+    int nsamples = 8 / bitspersample;
+    int i;
+    uint32* p;
+
+    if( nsamples == 0 )
+        nsamples = 1;
+
+    img->BWmap = (uint32**) _TIFFmalloc(
+	256*sizeof (uint32 *)+(256*nsamples*sizeof(uint32)));
+    if (img->BWmap == NULL) {
+		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No space for B&W mapping table");
+		return (0);
+    }
+    p = (uint32*)(img->BWmap + 256);
+    for (i = 0; i < 256; i++) {
+	TIFFRGBValue c;
+	img->BWmap[i] = p;
+	switch (bitspersample) {
+#define	GREY(x)	c = Map[x]; *p++ = PACK(c,c,c);
+	case 1:
+	    GREY(i>>7);
+	    GREY((i>>6)&1);
+	    GREY((i>>5)&1);
+	    GREY((i>>4)&1);
+	    GREY((i>>3)&1);
+	    GREY((i>>2)&1);
+	    GREY((i>>1)&1);
+	    GREY(i&1);
+	    break;
+	case 2:
+	    GREY(i>>6);
+	    GREY((i>>4)&3);
+	    GREY((i>>2)&3);
+	    GREY(i&3);
+	    break;
+	case 4:
+	    GREY(i>>4);
+	    GREY(i&0xf);
+	    break;
+	case 8:
+        case 16:
+	    GREY(i);
+	    break;
+	}
+#undef	GREY
+    }
+    return (1);
+}
+
+/*
+ * Construct a mapping table to convert from the range
+ * of the data samples to [0,255] --for display.  This
+ * process also handles inverting B&W images when needed.
+ */ 
+static int
+setupMap(TIFFRGBAImage* img)
+{
+    int32 x, range;
+
+    range = (int32)((1L<<img->bitspersample)-1);
+    
+    /* treat 16 bit the same as eight bit */
+    if( img->bitspersample == 16 )
+        range = (int32) 255;
+
+    img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
+    if (img->Map == NULL) {
+		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif),
+			"No space for photometric conversion table");
+		return (0);
+    }
+    if (img->photometric == PHOTOMETRIC_MINISWHITE) {
+	for (x = 0; x <= range; x++)
+	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
+    } else {
+	for (x = 0; x <= range; x++)
+	    img->Map[x] = (TIFFRGBValue) ((x * 255) / range);
+    }
+    if (img->bitspersample <= 16 &&
+	(img->photometric == PHOTOMETRIC_MINISBLACK ||
+	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
+	/*
+	 * Use photometric mapping table to construct
+	 * unpacking tables for samples <= 8 bits.
+	 */
+	if (!makebwmap(img))
+	    return (0);
+	/* no longer need Map, free it */
+	_TIFFfree(img->Map), img->Map = NULL;
+    }
+    return (1);
+}
+
+static int
+checkcmap(TIFFRGBAImage* img)
+{
+    uint16* r = img->redcmap;
+    uint16* g = img->greencmap;
+    uint16* b = img->bluecmap;
+    long n = 1L<<img->bitspersample;
+
+    while (n-- > 0)
+	if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256)
+	    return (16);
+    return (8);
+}
+
+static void
+cvtcmap(TIFFRGBAImage* img)
+{
+    uint16* r = img->redcmap;
+    uint16* g = img->greencmap;
+    uint16* b = img->bluecmap;
+    long i;
+
+    for (i = (1L<<img->bitspersample)-1; i >= 0; i--) {
+#define	CVT(x)		((uint16)((x)>>8))
+	r[i] = CVT(r[i]);
+	g[i] = CVT(g[i]);
+	b[i] = CVT(b[i]);
+#undef	CVT
+    }
+}
+
+/*
+ * Palette images with <= 8 bits/sample are handled
+ * with a table to avoid lots of shifts and masks.  The table
+ * is setup so that put*cmaptile (below) can retrieve 8/bitspersample
+ * pixel values simply by indexing into the table with one
+ * number.
+ */
+static int
+makecmap(TIFFRGBAImage* img)
+{
+    int bitspersample = img->bitspersample;
+    int nsamples = 8 / bitspersample;
+    uint16* r = img->redcmap;
+    uint16* g = img->greencmap;
+    uint16* b = img->bluecmap;
+    uint32 *p;
+    int i;
+
+    img->PALmap = (uint32**) _TIFFmalloc(
+	256*sizeof (uint32 *)+(256*nsamples*sizeof(uint32)));
+    if (img->PALmap == NULL) {
+		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No space for Palette mapping table");
+		return (0);
+	}
+    p = (uint32*)(img->PALmap + 256);
+    for (i = 0; i < 256; i++) {
+	TIFFRGBValue c;
+	img->PALmap[i] = p;
+#define	CMAP(x)	c = (TIFFRGBValue) x; *p++ = PACK(r[c]&0xff, g[c]&0xff, b[c]&0xff);
+	switch (bitspersample) {
+	case 1:
+	    CMAP(i>>7);
+	    CMAP((i>>6)&1);
+	    CMAP((i>>5)&1);
+	    CMAP((i>>4)&1);
+	    CMAP((i>>3)&1);
+	    CMAP((i>>2)&1);
+	    CMAP((i>>1)&1);
+	    CMAP(i&1);
+	    break;
+	case 2:
+	    CMAP(i>>6);
+	    CMAP((i>>4)&3);
+	    CMAP((i>>2)&3);
+	    CMAP(i&3);
+	    break;
+	case 4:
+	    CMAP(i>>4);
+	    CMAP(i&0xf);
+	    break;
+	case 8:
+	    CMAP(i);
+	    break;
+	}
+#undef CMAP
+    }
+    return (1);
+}
+
+/* 
+ * Construct any mapping table used
+ * by the associated put routine.
+ */
+static int
+buildMap(TIFFRGBAImage* img)
+{
+    switch (img->photometric) {
+    case PHOTOMETRIC_RGB:
+    case PHOTOMETRIC_YCBCR:
+    case PHOTOMETRIC_SEPARATED:
+	if (img->bitspersample == 8)
+	    break;
+	/* fall thru... */
+    case PHOTOMETRIC_MINISBLACK:
+    case PHOTOMETRIC_MINISWHITE:
+	if (!setupMap(img))
+	    return (0);
+	break;
+    case PHOTOMETRIC_PALETTE:
+	/*
+	 * Convert 16-bit colormap to 8-bit (unless it looks
+	 * like an old-style 8-bit colormap).
+	 */
+	if (checkcmap(img) == 16)
+	    cvtcmap(img);
+	else
+	    TIFFWarningExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "Assuming 8-bit colormap");
+	/*
+	 * Use mapping table and colormap to construct
+	 * unpacking tables for samples < 8 bits.
+	 */
+	if (img->bitspersample <= 8 && !makecmap(img))
+	    return (0);
+	break;
+    }
+    return (1);
+}
+
+/*
+ * Select the appropriate conversion routine for packed data.
+ */
+static int
+pickTileContigCase(TIFFRGBAImage* img)
+{
+    tileContigRoutine put = 0;
+
+    if (buildMap(img)) {
+	switch (img->photometric) {
+	case PHOTOMETRIC_RGB:
+	    switch (img->bitspersample) {
+	    case 8:
+		if (!img->Map) {
+		    if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
+			put = putRGBAAcontig8bittile;
+		    else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
+			put = putRGBUAcontig8bittile;
+		    else
+			put = putRGBcontig8bittile;
+		} else
+		    put = putRGBcontig8bitMaptile;
+		break;
+	    case 16:
+		put = putRGBcontig16bittile;
+		if (!img->Map) {
+		    if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
+			put = putRGBAAcontig16bittile;
+		    else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
+			put = putRGBUAcontig16bittile;
+		}
+		break;
+	    }
+	    break;
+	case PHOTOMETRIC_SEPARATED:
+	    if (img->bitspersample == 8) {
+		if (!img->Map)
+		    put = putRGBcontig8bitCMYKtile;
+		else
+		    put = putRGBcontig8bitCMYKMaptile;
+	    }
+	    break;
+	case PHOTOMETRIC_PALETTE:
+	    switch (img->bitspersample) {
+	    case 8:	put = put8bitcmaptile; break;
+	    case 4: put = put4bitcmaptile; break;
+	    case 2: put = put2bitcmaptile; break;
+	    case 1: put = put1bitcmaptile; break;
+	    }
+	    break;
+	case PHOTOMETRIC_MINISWHITE:
+	case PHOTOMETRIC_MINISBLACK:
+	    switch (img->bitspersample) {
+            case 16: put = put16bitbwtile; break;
+	    case 8:  put = putgreytile; break;
+	    case 4:  put = put4bitbwtile; break;
+	    case 2:  put = put2bitbwtile; break;
+	    case 1:  put = put1bitbwtile; break;
+	    }
+	    break;
+	case PHOTOMETRIC_YCBCR:
+	    if (img->bitspersample == 8)
+		put = initYCbCrConversion(img);
+	    break;
+	case PHOTOMETRIC_CIELAB:
+	    if (img->bitspersample == 8)
+		put = initCIELabConversion(img);
+	    break;
+	}
+    }
+    return ((img->put.contig = put) != 0);
+}
+
+/*
+ * Select the appropriate conversion routine for unpacked data.
+ *
+ * NB: we assume that unpacked single channel data is directed
+ *	 to the "packed routines.
+ */
+static int
+pickTileSeparateCase(TIFFRGBAImage* img)
+{
+    tileSeparateRoutine put = 0;
+
+    if (buildMap(img)) {
+	switch (img->photometric) {
+	case PHOTOMETRIC_RGB:
+	    switch (img->bitspersample) {
+	    case 8:
+		if (!img->Map) {
+		    if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
+			put = putRGBAAseparate8bittile;
+		    else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
+			put = putRGBUAseparate8bittile;
+		    else
+			put = putRGBseparate8bittile;
+		} else
+		    put = putRGBseparate8bitMaptile;
+		break;
+	    case 16:
+		put = putRGBseparate16bittile;
+		if (!img->Map) {
+		    if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
+			put = putRGBAAseparate16bittile;
+		    else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
+			put = putRGBUAseparate16bittile;
+		}
+		break;
+	    }
+	    break;
+	}
+    }
+    return ((img->put.separate = put) != 0);
+}
+
+/*
+ * Read a whole strip off data from the file, and convert to RGBA form.
+ * If this is the last strip, then it will only contain the portion of
+ * the strip that is actually within the image space.  The result is
+ * organized in bottom to top form.
+ */
+
+
+int
+TIFFReadRGBAStrip(TIFF* tif, uint32 row, uint32 * raster )
+
+{
+    char 	emsg[1024] = "";
+    TIFFRGBAImage img;
+    int 	ok;
+    uint32	rowsperstrip, rows_to_read;
+
+    if( TIFFIsTiled( tif ) )
+    {
+		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
+                  "Can't use TIFFReadRGBAStrip() with tiled file.");
+	return (0);
+    }
+    
+    TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
+    if( (row % rowsperstrip) != 0 )
+    {
+		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
+				"Row passed to TIFFReadRGBAStrip() must be first in a strip.");
+		return (0);
+    }
+
+    if (TIFFRGBAImageOK(tif, emsg) && TIFFRGBAImageBegin(&img, tif, 0, emsg)) {
+
+        img.row_offset = row;
+        img.col_offset = 0;
+
+        if( row + rowsperstrip > img.height )
+            rows_to_read = img.height - row;
+        else
+            rows_to_read = rowsperstrip;
+        
+	ok = TIFFRGBAImageGet(&img, raster, img.width, rows_to_read );
+        
+	TIFFRGBAImageEnd(&img);
+    } else {
+		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), emsg);
+		ok = 0;
+    }
+    
+    return (ok);
+}
+
+/*
+ * Read a whole tile off data from the file, and convert to RGBA form.
+ * The returned RGBA data is organized from bottom to top of tile,
+ * and may include zeroed areas if the tile extends off the image.
+ */
+
+int
+TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
+
+{
+    char 	emsg[1024] = "";
+    TIFFRGBAImage img;
+    int 	ok;
+    uint32	tile_xsize, tile_ysize;
+    uint32	read_xsize, read_ysize;
+    uint32	i_row;
+
+    /*
+     * Verify that our request is legal - on a tile file, and on a
+     * tile boundary.
+     */
+    
+    if( !TIFFIsTiled( tif ) )
+    {
+		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
+				  "Can't use TIFFReadRGBATile() with stripped file.");
+		return (0);
+    }
+    
+    TIFFGetFieldDefaulted(tif, TIFFTAG_TILEWIDTH, &tile_xsize);
+    TIFFGetFieldDefaulted(tif, TIFFTAG_TILELENGTH, &tile_ysize);
+    if( (col % tile_xsize) != 0 || (row % tile_ysize) != 0 )
+    {
+		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
+                  "Row/col passed to TIFFReadRGBATile() must be top"
+                  "left corner of a tile.");
+	return (0);
+    }
+
+    /*
+     * Setup the RGBA reader.
+     */
+    
+    if (!TIFFRGBAImageOK(tif, emsg) 
+	|| !TIFFRGBAImageBegin(&img, tif, 0, emsg)) {
+	    TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), emsg);
+	    return( 0 );
+    }
+
+    /*
+     * The TIFFRGBAImageGet() function doesn't allow us to get off the
+     * edge of the image, even to fill an otherwise valid tile.  So we
+     * figure out how much we can read, and fix up the tile buffer to
+     * a full tile configuration afterwards.
+     */
+
+    if( row + tile_ysize > img.height )
+        read_ysize = img.height - row;
+    else
+        read_ysize = tile_ysize;
+    
+    if( col + tile_xsize > img.width )
+        read_xsize = img.width - col;
+    else
+        read_xsize = tile_xsize;
+
+    /*
+     * Read the chunk of imagery.
+     */
+    
+    img.row_offset = row;
+    img.col_offset = col;
+
+    ok = TIFFRGBAImageGet(&img, raster, read_xsize, read_ysize );
+        
+    TIFFRGBAImageEnd(&img);
+
+    /*
+     * If our read was incomplete we will need to fix up the tile by
+     * shifting the data around as if a full tile of data is being returned.
+     *
+     * This is all the more complicated because the image is organized in
+     * bottom to top format. 
+     */
+
+    if( read_xsize == tile_xsize && read_ysize == tile_ysize )
+        return( ok );
+
+    for( i_row = 0; i_row < read_ysize; i_row++ ) {
+        memmove( raster + (tile_ysize - i_row - 1) * tile_xsize,
+                 raster + (read_ysize - i_row - 1) * read_xsize,
+                 read_xsize * sizeof(uint32) );
+        _TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize+read_xsize,
+                     0, sizeof(uint32) * (tile_xsize - read_xsize) );
+    }
+
+    for( i_row = read_ysize; i_row < tile_ysize; i_row++ ) {
+        _TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize,
+                     0, sizeof(uint32) * tile_xsize );
+    }
+
+    return (ok);
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_jpeg.c b/src/tiff/tif_jpeg.c
new file mode 100644
index 0000000..6d7ecc5
--- /dev/null
+++ b/src/tiff/tif_jpeg.c
@@ -0,0 +1,1942 @@
+/* $Id: tif_jpeg.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1994-1997 Sam Leffler
+ * Copyright (c) 1994-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#define WIN32_LEAN_AND_MEAN
+#define VC_EXTRALEAN
+
+#include "tiffiop.h"
+#ifdef JPEG_SUPPORT
+
+/*
+ * TIFF Library
+ *
+ * JPEG Compression support per TIFF Technical Note #2
+ * (*not* per the original TIFF 6.0 spec).
+ *
+ * This file is simply an interface to the libjpeg library written by
+ * the Independent JPEG Group.  You need release 5 or later of the IJG
+ * code, which you can find on the Internet at ftp.uu.net:/graphics/jpeg/.
+ *
+ * Contributed by Tom Lane <tgl at sss.pgh.pa.us>.
+ */
+#include <setjmp.h>
+
+int TIFFFillStrip(TIFF*, tstrip_t);
+int TIFFFillTile(TIFF*, ttile_t);
+
+/* We undefine FAR to avoid conflict with JPEG definition */
+
+#ifdef FAR
+#undef FAR
+#endif
+
+/*
+  Libjpeg's jmorecfg.h defines INT16 and INT32, but only if XMD_H is
+  not defined.  Unfortunately, the MinGW and Borland compilers include
+  a typedef for INT32, which causes a conflict.  MSVC does not include
+  a conficting typedef given the headers which are included.
+*/
+#if defined(__BORLANDC__) || defined(__MINGW32__)
+# define XMD_H 1
+#endif
+
+/*
+   The windows RPCNDR.H file defines boolean, but defines it with the
+   unsigned char size.  You should compile JPEG library using appropriate
+   definitions in jconfig.h header, but many users compile library in wrong
+   way. That causes errors of the following type:
+
+   "JPEGLib: JPEG parameter struct mismatch: library thinks size is 432,
+   caller expects 464"
+
+   For such users we wil fix the problem here. See install.doc file from
+   the JPEG library distribution for details.
+*/
+
+/* Define "boolean" as unsigned char, not int, per Windows custom. */
+#if defined(WIN32) && !defined(__MINGW32__)
+# ifndef __RPCNDR_H__            /* don't conflict if rpcndr.h already read */
+   typedef unsigned char boolean;
+# endif
+# define HAVE_BOOLEAN            /* prevent jmorecfg.h from redefining it */
+#endif
+
+#include "jpeglib.h"
+#include "jerror.h"
+
+/*
+ * We are using width_in_blocks which is supposed to be private to
+ * libjpeg. Unfortunately, the libjpeg delivered with Cygwin has
+ * renamed this member to width_in_data_units.  Since the header has
+ * also renamed a define, use that unique define name in order to
+ * detect the problem header and adjust to suit.
+ */
+#if defined(D_MAX_DATA_UNITS_IN_MCU)
+#define width_in_blocks width_in_data_units
+#endif
+
+/*
+ * On some machines it may be worthwhile to use _setjmp or sigsetjmp
+ * in place of plain setjmp.  These macros will make it easier.
+ */
+#define SETJMP(jbuf)		setjmp(jbuf)
+#define LONGJMP(jbuf,code)	longjmp(jbuf,code)
+#define JMP_BUF			jmp_buf
+
+typedef struct jpeg_destination_mgr jpeg_destination_mgr;
+typedef struct jpeg_source_mgr jpeg_source_mgr;
+typedef	struct jpeg_error_mgr jpeg_error_mgr;
+
+/*
+ * State block for each open TIFF file using
+ * libjpeg to do JPEG compression/decompression.
+ *
+ * libjpeg's visible state is either a jpeg_compress_struct
+ * or jpeg_decompress_struct depending on which way we
+ * are going.  comm can be used to refer to the fields
+ * which are common to both.
+ *
+ * NB: cinfo is required to be the first member of JPEGState,
+ *     so we can safely cast JPEGState* -> jpeg_xxx_struct*
+ *     and vice versa!
+ */
+typedef	struct {
+	union {
+		struct jpeg_compress_struct c;
+		struct jpeg_decompress_struct d;
+		struct jpeg_common_struct comm;
+	} cinfo;			/* NB: must be first */
+        int             cinfo_initialized;
+
+	jpeg_error_mgr	err;		/* libjpeg error manager */
+	JMP_BUF		exit_jmpbuf;	/* for catching libjpeg failures */
+	/*
+	 * The following two members could be a union, but
+	 * they're small enough that it's not worth the effort.
+	 */
+	jpeg_destination_mgr dest;	/* data dest for compression */
+	jpeg_source_mgr	src;		/* data source for decompression */
+					/* private state */
+	TIFF*		tif;		/* back link needed by some code */
+	uint16		photometric;	/* copy of PhotometricInterpretation */
+	uint16		h_sampling;	/* luminance sampling factors */
+	uint16		v_sampling;
+	tsize_t		bytesperline;	/* decompressed bytes per scanline */
+	/* pointers to intermediate buffers when processing downsampled data */
+	JSAMPARRAY	ds_buffer[MAX_COMPONENTS];
+	int		scancount;	/* number of "scanlines" accumulated */
+	int		samplesperclump;
+
+	TIFFVGetMethod	vgetparent;	/* super-class method */
+	TIFFVSetMethod	vsetparent;	/* super-class method */
+	TIFFStripMethod	defsparent;	/* super-class method */
+	TIFFTileMethod	deftparent;	/* super-class method */
+					/* pseudo-tag fields */
+	void*		jpegtables;	/* JPEGTables tag value, or NULL */
+	uint32		jpegtables_length; /* number of bytes in same */
+	int		jpegquality;	/* Compression quality level */
+	int		jpegcolormode;	/* Auto RGB<=>YCbCr convert? */
+	int		jpegtablesmode;	/* What to put in JPEGTables */
+
+        int             ycbcrsampling_fetched;
+	uint32		recvparams;	/* encoded Class 2 session params */
+	char*		subaddress;	/* subaddress string */
+	uint32		recvtime;	/* time spent receiving (secs) */
+	char*		faxdcs;		/* encoded fax parameters (DCS, Table 2/T.30) */
+} JPEGState;
+
+#define	JState(tif)	((JPEGState*)(tif)->tif_data)
+
+static	int JPEGDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+static	int JPEGDecodeRaw(TIFF*, tidata_t, tsize_t, tsample_t);
+static	int JPEGEncode(TIFF*, tidata_t, tsize_t, tsample_t);
+static	int JPEGEncodeRaw(TIFF*, tidata_t, tsize_t, tsample_t);
+static  int JPEGInitializeLibJPEG( TIFF * tif,
+								   int force_encode, int force_decode );
+
+#define	FIELD_JPEGTABLES	(FIELD_CODEC+0)
+#define	FIELD_RECVPARAMS	(FIELD_CODEC+1)
+#define	FIELD_SUBADDRESS	(FIELD_CODEC+2)
+#define	FIELD_RECVTIME		(FIELD_CODEC+3)
+#define	FIELD_FAXDCS		(FIELD_CODEC+4)
+
+static const TIFFFieldInfo jpegFieldInfo[] = {
+    { TIFFTAG_JPEGTABLES,	 -3,-3,	TIFF_UNDEFINED,	FIELD_JPEGTABLES,
+      FALSE,	TRUE,	"JPEGTables" },
+    { TIFFTAG_JPEGQUALITY,	 0, 0,	TIFF_ANY,	FIELD_PSEUDO,
+      TRUE,	FALSE,	"" },
+    { TIFFTAG_JPEGCOLORMODE,	 0, 0,	TIFF_ANY,	FIELD_PSEUDO,
+      FALSE,	FALSE,	"" },
+    { TIFFTAG_JPEGTABLESMODE,	 0, 0,	TIFF_ANY,	FIELD_PSEUDO,
+      FALSE,	FALSE,	"" },
+    /* Specific for JPEG in faxes */
+    { TIFFTAG_FAXRECVPARAMS,	 1, 1, TIFF_LONG,	FIELD_RECVPARAMS,
+      TRUE,	FALSE,	"FaxRecvParams" },
+    { TIFFTAG_FAXSUBADDRESS,	-1,-1, TIFF_ASCII,	FIELD_SUBADDRESS,
+      TRUE,	FALSE,	"FaxSubAddress" },
+    { TIFFTAG_FAXRECVTIME,	 1, 1, TIFF_LONG,	FIELD_RECVTIME,
+      TRUE,	FALSE,	"FaxRecvTime" },
+    { TIFFTAG_FAXDCS,		-1, -1, TIFF_ASCII,	FIELD_FAXDCS,
+	  TRUE,	FALSE,	"FaxDcs" },
+};
+#define	N(a)	(sizeof (a) / sizeof (a[0]))
+
+/*
+ * libjpeg interface layer.
+ *
+ * We use setjmp/longjmp to return control to libtiff
+ * when a fatal error is encountered within the JPEG
+ * library.  We also direct libjpeg error and warning
+ * messages through the appropriate libtiff handlers.
+ */
+
+/*
+ * Error handling routines (these replace corresponding
+ * IJG routines from jerror.c).  These are used for both
+ * compression and decompression.
+ */
+static void
+TIFFjpeg_error_exit(j_common_ptr cinfo)
+{
+	JPEGState *sp = (JPEGState *) cinfo;	/* NB: cinfo assumed first */
+	char buffer[JMSG_LENGTH_MAX];
+
+	(*cinfo->err->format_message) (cinfo, buffer);
+	TIFFErrorExt(sp->tif->tif_clientdata, "JPEGLib", buffer);		/* display the error message */
+	jpeg_abort(cinfo);			/* clean up libjpeg state */
+	LONGJMP(sp->exit_jmpbuf, 1);		/* return to libtiff caller */
+}
+
+/*
+ * This routine is invoked only for warning messages,
+ * since error_exit does its own thing and trace_level
+ * is never set > 0.
+ */
+static void
+TIFFjpeg_output_message(j_common_ptr cinfo)
+{
+	char buffer[JMSG_LENGTH_MAX];
+
+	(*cinfo->err->format_message) (cinfo, buffer);
+	TIFFWarningExt(((JPEGState *) cinfo)->tif->tif_clientdata, "JPEGLib", buffer);
+}
+
+/*
+ * Interface routines.  This layer of routines exists
+ * primarily to limit side-effects from using setjmp.
+ * Also, normal/error returns are converted into return
+ * values per libtiff practice.
+ */
+#define	CALLJPEG(sp, fail, op)	(SETJMP((sp)->exit_jmpbuf) ? (fail) : (op))
+#define	CALLVJPEG(sp, op)	CALLJPEG(sp, 0, ((op),1))
+
+static int
+TIFFjpeg_create_compress(JPEGState* sp)
+{
+	/* initialize JPEG error handling */
+	sp->cinfo.c.err = jpeg_std_error(&sp->err);
+	sp->err.error_exit = TIFFjpeg_error_exit;
+	sp->err.output_message = TIFFjpeg_output_message;
+
+	return CALLVJPEG(sp, jpeg_create_compress(&sp->cinfo.c));
+}
+
+static int
+TIFFjpeg_create_decompress(JPEGState* sp)
+{
+	/* initialize JPEG error handling */
+	sp->cinfo.d.err = jpeg_std_error(&sp->err);
+	sp->err.error_exit = TIFFjpeg_error_exit;
+	sp->err.output_message = TIFFjpeg_output_message;
+
+	return CALLVJPEG(sp, jpeg_create_decompress(&sp->cinfo.d));
+}
+
+static int
+TIFFjpeg_set_defaults(JPEGState* sp)
+{
+	return CALLVJPEG(sp, jpeg_set_defaults(&sp->cinfo.c));
+}
+
+static int
+TIFFjpeg_set_colorspace(JPEGState* sp, J_COLOR_SPACE colorspace)
+{
+	return CALLVJPEG(sp, jpeg_set_colorspace(&sp->cinfo.c, colorspace));
+}
+
+static int
+TIFFjpeg_set_quality(JPEGState* sp, int quality, boolean force_baseline)
+{
+	return CALLVJPEG(sp,
+	    jpeg_set_quality(&sp->cinfo.c, quality, force_baseline));
+}
+
+static int
+TIFFjpeg_suppress_tables(JPEGState* sp, boolean suppress)
+{
+	return CALLVJPEG(sp, jpeg_suppress_tables(&sp->cinfo.c, suppress));
+}
+
+static int
+TIFFjpeg_start_compress(JPEGState* sp, boolean write_all_tables)
+{
+	return CALLVJPEG(sp,
+	    jpeg_start_compress(&sp->cinfo.c, write_all_tables));
+}
+
+static int
+TIFFjpeg_write_scanlines(JPEGState* sp, JSAMPARRAY scanlines, int num_lines)
+{
+	return CALLJPEG(sp, -1, (int) jpeg_write_scanlines(&sp->cinfo.c,
+	    scanlines, (JDIMENSION) num_lines));
+}
+
+static int
+TIFFjpeg_write_raw_data(JPEGState* sp, JSAMPIMAGE data, int num_lines)
+{
+	return CALLJPEG(sp, -1, (int) jpeg_write_raw_data(&sp->cinfo.c,
+	    data, (JDIMENSION) num_lines));
+}
+
+static int
+TIFFjpeg_finish_compress(JPEGState* sp)
+{
+	return CALLVJPEG(sp, jpeg_finish_compress(&sp->cinfo.c));
+}
+
+static int
+TIFFjpeg_write_tables(JPEGState* sp)
+{
+	return CALLVJPEG(sp, jpeg_write_tables(&sp->cinfo.c));
+}
+
+static int
+TIFFjpeg_read_header(JPEGState* sp, boolean require_image)
+{
+	return CALLJPEG(sp, -1, jpeg_read_header(&sp->cinfo.d, require_image));
+}
+
+static int
+TIFFjpeg_start_decompress(JPEGState* sp)
+{
+	return CALLVJPEG(sp, jpeg_start_decompress(&sp->cinfo.d));
+}
+
+static int
+TIFFjpeg_read_scanlines(JPEGState* sp, JSAMPARRAY scanlines, int max_lines)
+{
+	return CALLJPEG(sp, -1, (int) jpeg_read_scanlines(&sp->cinfo.d,
+	    scanlines, (JDIMENSION) max_lines));
+}
+
+static int
+TIFFjpeg_read_raw_data(JPEGState* sp, JSAMPIMAGE data, int max_lines)
+{
+	return CALLJPEG(sp, -1, (int) jpeg_read_raw_data(&sp->cinfo.d,
+	    data, (JDIMENSION) max_lines));
+}
+
+static int
+TIFFjpeg_finish_decompress(JPEGState* sp)
+{
+	return CALLJPEG(sp, -1, (int) jpeg_finish_decompress(&sp->cinfo.d));
+}
+
+static int
+TIFFjpeg_abort(JPEGState* sp)
+{
+	return CALLVJPEG(sp, jpeg_abort(&sp->cinfo.comm));
+}
+
+static int
+TIFFjpeg_destroy(JPEGState* sp)
+{
+	return CALLVJPEG(sp, jpeg_destroy(&sp->cinfo.comm));
+}
+
+static JSAMPARRAY
+TIFFjpeg_alloc_sarray(JPEGState* sp, int pool_id,
+		      JDIMENSION samplesperrow, JDIMENSION numrows)
+{
+	return CALLJPEG(sp, (JSAMPARRAY) NULL,
+	    (*sp->cinfo.comm.mem->alloc_sarray)
+		(&sp->cinfo.comm, pool_id, samplesperrow, numrows));
+}
+
+/*
+ * JPEG library destination data manager.
+ * These routines direct compressed data from libjpeg into the
+ * libtiff output buffer.
+ */
+
+static void
+std_init_destination(j_compress_ptr cinfo)
+{
+	JPEGState* sp = (JPEGState*) cinfo;
+	TIFF* tif = sp->tif;
+
+	sp->dest.next_output_byte = (JOCTET*) tif->tif_rawdata;
+	sp->dest.free_in_buffer = (size_t) tif->tif_rawdatasize;
+}
+
+static boolean
+std_empty_output_buffer(j_compress_ptr cinfo)
+{
+	JPEGState* sp = (JPEGState*) cinfo;
+	TIFF* tif = sp->tif;
+
+	/* the entire buffer has been filled */
+	tif->tif_rawcc = tif->tif_rawdatasize;
+	TIFFFlushData1(tif);
+	sp->dest.next_output_byte = (JOCTET*) tif->tif_rawdata;
+	sp->dest.free_in_buffer = (size_t) tif->tif_rawdatasize;
+
+	return (TRUE);
+}
+
+static void
+std_term_destination(j_compress_ptr cinfo)
+{
+	JPEGState* sp = (JPEGState*) cinfo;
+	TIFF* tif = sp->tif;
+
+	tif->tif_rawcp = (tidata_t) sp->dest.next_output_byte;
+	tif->tif_rawcc =
+	    tif->tif_rawdatasize - (tsize_t) sp->dest.free_in_buffer;
+	/* NB: libtiff does the final buffer flush */
+}
+
+static void
+TIFFjpeg_data_dest(JPEGState* sp, TIFF* tif)
+{
+	(void) tif;
+	sp->cinfo.c.dest = &sp->dest;
+	sp->dest.init_destination = std_init_destination;
+	sp->dest.empty_output_buffer = std_empty_output_buffer;
+	sp->dest.term_destination = std_term_destination;
+}
+
+/*
+ * Alternate destination manager for outputting to JPEGTables field.
+ */
+
+static void
+tables_init_destination(j_compress_ptr cinfo)
+{
+	JPEGState* sp = (JPEGState*) cinfo;
+
+	/* while building, jpegtables_length is allocated buffer size */
+	sp->dest.next_output_byte = (JOCTET*) sp->jpegtables;
+	sp->dest.free_in_buffer = (size_t) sp->jpegtables_length;
+}
+
+static boolean
+tables_empty_output_buffer(j_compress_ptr cinfo)
+{
+	JPEGState* sp = (JPEGState*) cinfo;
+	void* newbuf;
+
+	/* the entire buffer has been filled; enlarge it by 1000 bytes */
+	newbuf = _TIFFrealloc((tdata_t) sp->jpegtables,
+			      (tsize_t) (sp->jpegtables_length + 1000));
+	if (newbuf == NULL)
+		ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 100);
+	sp->dest.next_output_byte = (JOCTET*) newbuf + sp->jpegtables_length;
+	sp->dest.free_in_buffer = (size_t) 1000;
+	sp->jpegtables = newbuf;
+	sp->jpegtables_length += 1000;
+	return (TRUE);
+}
+
+static void
+tables_term_destination(j_compress_ptr cinfo)
+{
+	JPEGState* sp = (JPEGState*) cinfo;
+
+	/* set tables length to number of bytes actually emitted */
+	sp->jpegtables_length -= sp->dest.free_in_buffer;
+}
+
+static int
+TIFFjpeg_tables_dest(JPEGState* sp, TIFF* tif)
+{
+	(void) tif;
+	/*
+	 * Allocate a working buffer for building tables.
+	 * Initial size is 1000 bytes, which is usually adequate.
+	 */
+	if (sp->jpegtables)
+		_TIFFfree(sp->jpegtables);
+	sp->jpegtables_length = 1000;
+	sp->jpegtables = (void*) _TIFFmalloc((tsize_t) sp->jpegtables_length);
+	if (sp->jpegtables == NULL) {
+		sp->jpegtables_length = 0;
+		TIFFErrorExt(sp->tif->tif_clientdata, "TIFFjpeg_tables_dest", "No space for JPEGTables");
+		return (0);
+	}
+	sp->cinfo.c.dest = &sp->dest;
+	sp->dest.init_destination = tables_init_destination;
+	sp->dest.empty_output_buffer = tables_empty_output_buffer;
+	sp->dest.term_destination = tables_term_destination;
+	return (1);
+}
+
+/*
+ * JPEG library source data manager.
+ * These routines supply compressed data to libjpeg.
+ */
+
+static void
+std_init_source(j_decompress_ptr cinfo)
+{
+	JPEGState* sp = (JPEGState*) cinfo;
+	TIFF* tif = sp->tif;
+
+	sp->src.next_input_byte = (const JOCTET*) tif->tif_rawdata;
+	sp->src.bytes_in_buffer = (size_t) tif->tif_rawcc;
+}
+
+static boolean
+std_fill_input_buffer(j_decompress_ptr cinfo)
+{
+	JPEGState* sp = (JPEGState* ) cinfo;
+	static const JOCTET dummy_EOI[2] = { 0xFF, JPEG_EOI };
+
+	/*
+	 * Should never get here since entire strip/tile is
+	 * read into memory before the decompressor is called,
+	 * and thus was supplied by init_source.
+	 */
+	WARNMS(cinfo, JWRN_JPEG_EOF);
+	/* insert a fake EOI marker */
+	sp->src.next_input_byte = dummy_EOI;
+	sp->src.bytes_in_buffer = 2;
+	return (TRUE);
+}
+
+static void
+std_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
+{
+	JPEGState* sp = (JPEGState*) cinfo;
+
+	if (num_bytes > 0) {
+		if (num_bytes > (long) sp->src.bytes_in_buffer) {
+			/* oops, buffer overrun */
+			(void) std_fill_input_buffer(cinfo);
+		} else {
+			sp->src.next_input_byte += (size_t) num_bytes;
+			sp->src.bytes_in_buffer -= (size_t) num_bytes;
+		}
+	}
+}
+
+static void
+std_term_source(j_decompress_ptr cinfo)
+{
+	/* No work necessary here */
+	/* Or must we update tif->tif_rawcp, tif->tif_rawcc ??? */
+	/* (if so, need empty tables_term_source!) */
+	(void) cinfo;
+}
+
+static void
+TIFFjpeg_data_src(JPEGState* sp, TIFF* tif)
+{
+	(void) tif;
+	sp->cinfo.d.src = &sp->src;
+	sp->src.init_source = std_init_source;
+	sp->src.fill_input_buffer = std_fill_input_buffer;
+	sp->src.skip_input_data = std_skip_input_data;
+	sp->src.resync_to_restart = jpeg_resync_to_restart;
+	sp->src.term_source = std_term_source;
+	sp->src.bytes_in_buffer = 0;		/* for safety */
+	sp->src.next_input_byte = NULL;
+}
+
+/*
+ * Alternate source manager for reading from JPEGTables.
+ * We can share all the code except for the init routine.
+ */
+
+static void
+tables_init_source(j_decompress_ptr cinfo)
+{
+	JPEGState* sp = (JPEGState*) cinfo;
+
+	sp->src.next_input_byte = (const JOCTET*) sp->jpegtables;
+	sp->src.bytes_in_buffer = (size_t) sp->jpegtables_length;
+}
+
+static void
+TIFFjpeg_tables_src(JPEGState* sp, TIFF* tif)
+{
+	TIFFjpeg_data_src(sp, tif);
+	sp->src.init_source = tables_init_source;
+}
+
+/*
+ * Allocate downsampled-data buffers needed for downsampled I/O.
+ * We use values computed in jpeg_start_compress or jpeg_start_decompress.
+ * We use libjpeg's allocator so that buffers will be released automatically
+ * when done with strip/tile.
+ * This is also a handy place to compute samplesperclump, bytesperline.
+ */
+static int
+alloc_downsampled_buffers(TIFF* tif, jpeg_component_info* comp_info,
+			  int num_components)
+{
+	JPEGState* sp = JState(tif);
+	int ci;
+	jpeg_component_info* compptr;
+	JSAMPARRAY buf;
+	int samples_per_clump = 0;
+
+	for (ci = 0, compptr = comp_info; ci < num_components;
+	     ci++, compptr++) {
+		samples_per_clump += compptr->h_samp_factor *
+			compptr->v_samp_factor;
+		buf = TIFFjpeg_alloc_sarray(sp, JPOOL_IMAGE,
+				compptr->width_in_blocks * DCTSIZE,
+				(JDIMENSION) (compptr->v_samp_factor*DCTSIZE));
+		if (buf == NULL)
+			return (0);
+		sp->ds_buffer[ci] = buf;
+	}
+	sp->samplesperclump = samples_per_clump;
+	return (1);
+}
+
+
+/*
+ * JPEG Decoding.
+ */
+
+static int
+JPEGSetupDecode(TIFF* tif)
+{
+	JPEGState* sp = JState(tif);
+	TIFFDirectory *td = &tif->tif_dir;
+
+        JPEGInitializeLibJPEG( tif, 0, 1 );
+
+	assert(sp != NULL);
+	assert(sp->cinfo.comm.is_decompressor);
+
+	/* Read JPEGTables if it is present */
+	if (TIFFFieldSet(tif,FIELD_JPEGTABLES)) {
+		TIFFjpeg_tables_src(sp, tif);
+		if(TIFFjpeg_read_header(sp,FALSE) != JPEG_HEADER_TABLES_ONLY) {
+			TIFFErrorExt(tif->tif_clientdata, "JPEGSetupDecode", "Bogus JPEGTables field");
+			return (0);
+		}
+	}
+
+	/* Grab parameters that are same for all strips/tiles */
+	sp->photometric = td->td_photometric;
+	switch (sp->photometric) {
+	case PHOTOMETRIC_YCBCR:
+		sp->h_sampling = td->td_ycbcrsubsampling[0];
+		sp->v_sampling = td->td_ycbcrsubsampling[1];
+		break;
+	default:
+		/* TIFF 6.0 forbids subsampling of all other color spaces */
+		sp->h_sampling = 1;
+		sp->v_sampling = 1;
+		break;
+	}
+
+	/* Set up for reading normal data */
+	TIFFjpeg_data_src(sp, tif);
+	tif->tif_postdecode = _TIFFNoPostDecode; /* override byte swapping */
+	return (1);
+}
+
+/*
+ * Set up for decoding a strip or tile.
+ */
+static int
+JPEGPreDecode(TIFF* tif, tsample_t s)
+{
+	JPEGState *sp = JState(tif);
+	TIFFDirectory *td = &tif->tif_dir;
+	static const char module[] = "JPEGPreDecode";
+	uint32 segment_width, segment_height;
+	int downsampled_output;
+	int ci;
+
+	assert(sp != NULL);
+	assert(sp->cinfo.comm.is_decompressor);
+	/*
+	 * Reset decoder state from any previous strip/tile,
+	 * in case application didn't read the whole strip.
+	 */
+	if (!TIFFjpeg_abort(sp))
+		return (0);
+	/*
+	 * Read the header for this strip/tile.
+	 */
+	if (TIFFjpeg_read_header(sp, TRUE) != JPEG_HEADER_OK)
+		return (0);
+	/*
+	 * Check image parameters and set decompression parameters.
+	 */
+	segment_width = td->td_imagewidth;
+	segment_height = td->td_imagelength - tif->tif_row;
+	if (isTiled(tif)) {
+                segment_width = td->td_tilewidth;
+                segment_height = td->td_tilelength;
+		sp->bytesperline = TIFFTileRowSize(tif);
+	} else {
+		if (segment_height > td->td_rowsperstrip)
+			segment_height = td->td_rowsperstrip;
+		sp->bytesperline = TIFFScanlineSize(tif);
+	}
+	if (td->td_planarconfig == PLANARCONFIG_SEPARATE && s > 0) {
+		/*
+		 * For PC 2, scale down the expected strip/tile size
+		 * to match a downsampled component
+		 */
+		segment_width = TIFFhowmany(segment_width, sp->h_sampling);
+		segment_height = TIFFhowmany(segment_height, sp->v_sampling);
+	}
+	if (sp->cinfo.d.image_width != segment_width ||
+	    sp->cinfo.d.image_height != segment_height) {
+		TIFFWarningExt(tif->tif_clientdata, module,
+                 "Improper JPEG strip/tile size, expected %dx%d, got %dx%d",
+                          segment_width, 
+                          segment_height,
+                          sp->cinfo.d.image_width, 
+                          sp->cinfo.d.image_height);
+	}
+	if (sp->cinfo.d.num_components !=
+	    (td->td_planarconfig == PLANARCONFIG_CONTIG ?
+	     td->td_samplesperpixel : 1)) {
+		TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG component count");
+		return (0);
+	}
+#ifdef JPEG_LIB_MK1
+	if (12 != td->td_bitspersample && 8 != td->td_bitspersample) {
+			TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG data precision");
+            return (0);
+	}
+        sp->cinfo.d.data_precision = td->td_bitspersample;
+        sp->cinfo.d.bits_in_jsample = td->td_bitspersample;
+#else
+	if (sp->cinfo.d.data_precision != td->td_bitspersample) {
+			TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG data precision");
+            return (0);
+	}
+#endif
+	if (td->td_planarconfig == PLANARCONFIG_CONTIG) {
+		/* Component 0 should have expected sampling factors */
+		if (sp->cinfo.d.comp_info[0].h_samp_factor != sp->h_sampling ||
+		    sp->cinfo.d.comp_info[0].v_samp_factor != sp->v_sampling) {
+				TIFFWarningExt(tif->tif_clientdata, module,
+                                    "Improper JPEG sampling factors %d,%d\n"
+                                    "Apparently should be %d,%d.",
+                                    sp->cinfo.d.comp_info[0].h_samp_factor,
+                                    sp->cinfo.d.comp_info[0].v_samp_factor,
+                                    sp->h_sampling, sp->v_sampling);
+
+			    /*
+			     * XXX: Files written by the Intergraph software
+			     * has different sampling factors stored in the
+			     * TIFF tags and in the JPEG structures. We will
+			     * try to deduce Intergraph files by the presense
+			     * of the tag 33918.
+			     */
+			    if (!_TIFFFindFieldInfo(tif, 33918, TIFF_ANY)) {
+					TIFFWarningExt(tif->tif_clientdata, module,
+					"Decompressor will try reading with "
+					"sampling %d,%d.",
+					sp->cinfo.d.comp_info[0].h_samp_factor,
+					sp->cinfo.d.comp_info[0].v_samp_factor);
+
+				    sp->h_sampling = (uint16)
+					sp->cinfo.d.comp_info[0].h_samp_factor;
+				    sp->v_sampling = (uint16)
+					sp->cinfo.d.comp_info[0].v_samp_factor;
+			    }
+		}
+		/* Rest should have sampling factors 1,1 */
+		for (ci = 1; ci < sp->cinfo.d.num_components; ci++) {
+			if (sp->cinfo.d.comp_info[ci].h_samp_factor != 1 ||
+			    sp->cinfo.d.comp_info[ci].v_samp_factor != 1) {
+				TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG sampling factors");
+				return (0);
+			}
+		}
+	} else {
+		/* PC 2's single component should have sampling factors 1,1 */
+		if (sp->cinfo.d.comp_info[0].h_samp_factor != 1 ||
+		    sp->cinfo.d.comp_info[0].v_samp_factor != 1) {
+			TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG sampling factors");
+			return (0);
+		}
+	}
+	downsampled_output = FALSE;
+	if (td->td_planarconfig == PLANARCONFIG_CONTIG &&
+	    sp->photometric == PHOTOMETRIC_YCBCR &&
+	    sp->jpegcolormode == JPEGCOLORMODE_RGB) {
+	/* Convert YCbCr to RGB */
+		sp->cinfo.d.jpeg_color_space = JCS_YCbCr;
+		sp->cinfo.d.out_color_space = JCS_RGB;
+	} else {
+			/* Suppress colorspace handling */
+		sp->cinfo.d.jpeg_color_space = JCS_UNKNOWN;
+		sp->cinfo.d.out_color_space = JCS_UNKNOWN;
+		if (td->td_planarconfig == PLANARCONFIG_CONTIG &&
+		    (sp->h_sampling != 1 || sp->v_sampling != 1))
+			downsampled_output = TRUE;
+		/* XXX what about up-sampling? */
+	}
+	if (downsampled_output) {
+		/* Need to use raw-data interface to libjpeg */
+		sp->cinfo.d.raw_data_out = TRUE;
+		tif->tif_decoderow = JPEGDecodeRaw;
+		tif->tif_decodestrip = JPEGDecodeRaw;
+		tif->tif_decodetile = JPEGDecodeRaw;
+	} else {
+		/* Use normal interface to libjpeg */
+		sp->cinfo.d.raw_data_out = FALSE;
+		tif->tif_decoderow = JPEGDecode;
+		tif->tif_decodestrip = JPEGDecode;
+		tif->tif_decodetile = JPEGDecode;
+	}
+	/* Start JPEG decompressor */
+	if (!TIFFjpeg_start_decompress(sp))
+		return (0);
+	/* Allocate downsampled-data buffers if needed */
+	if (downsampled_output) {
+		if (!alloc_downsampled_buffers(tif, sp->cinfo.d.comp_info,
+					       sp->cinfo.d.num_components))
+			return (0);
+		sp->scancount = DCTSIZE;	/* mark buffer empty */
+	}
+	return (1);
+}
+
+/*
+ * Decode a chunk of pixels.
+ * "Standard" case: returned data is not downsampled.
+ */
+/*ARGSUSED*/ static int
+JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
+{
+    JPEGState *sp = JState(tif);
+    tsize_t nrows;
+    (void) s;
+
+    nrows = cc / sp->bytesperline;
+    if (cc % sp->bytesperline)
+		TIFFWarningExt(tif->tif_clientdata, tif->tif_name, "fractional scanline not read");
+
+    if( nrows > (int) sp->cinfo.d.image_height )
+        nrows = sp->cinfo.d.image_height;
+
+    /* data is expected to be read in multiples of a scanline */
+    if (nrows)
+    {
+        JSAMPROW line_work_buf = NULL;
+
+        /*
+        ** For 6B, only use temporary buffer for 12 bit imagery. 
+        ** For Mk1 always use it. 
+        */
+#if !defined(JPEG_LIB_MK1)        
+        if( sp->cinfo.d.data_precision == 12 )
+#endif
+        {
+            line_work_buf = (JSAMPROW) 
+                _TIFFmalloc(sizeof(short) * sp->cinfo.d.output_width 
+                            * sp->cinfo.d.num_components );
+        }
+
+        do {
+            if( line_work_buf != NULL )
+            {
+                /* 
+                ** In the MK1 case, we aways read into a 16bit buffer, and then
+                ** pack down to 12bit or 8bit.  In 6B case we only read into 16
+                ** bit buffer for 12bit data, which we need to repack. 
+                */
+                if (TIFFjpeg_read_scanlines(sp, &line_work_buf, 1) != 1)
+                    return (0);
+
+                if( sp->cinfo.d.data_precision == 12 )
+                {
+                    int value_pairs = (sp->cinfo.d.output_width 
+                                       * sp->cinfo.d.num_components) / 2;
+                    int iPair;
+
+                    for( iPair = 0; iPair < value_pairs; iPair++ )
+                    {
+                        unsigned char *out_ptr = 
+                            ((unsigned char *) buf) + iPair * 3;
+                        JSAMPLE *in_ptr = line_work_buf + iPair * 2;
+
+                        out_ptr[0] = (in_ptr[0] & 0xff0) >> 4;
+                        out_ptr[1] = ((in_ptr[0] & 0xf) << 4)
+                            | ((in_ptr[1] & 0xf00) >> 8);
+                        out_ptr[2] = ((in_ptr[1] & 0xff) >> 0);
+                    }
+                }
+                else if( sp->cinfo.d.data_precision == 8 )
+                {
+                    int value_count = (sp->cinfo.d.output_width 
+                                       * sp->cinfo.d.num_components);
+                    int iValue;
+
+                    for( iValue = 0; iValue < value_count; iValue++ )
+                    {
+                        ((unsigned char *) buf)[iValue] = 
+                            line_work_buf[iValue] & 0xff;
+                    }
+                }
+            }
+            else
+            {
+                /*
+                ** In the libjpeg6b 8bit case.  We read directly into the 
+                ** TIFF buffer.
+                */
+                JSAMPROW bufptr = (JSAMPROW)buf;
+  
+                if (TIFFjpeg_read_scanlines(sp, &bufptr, 1) != 1)
+                    return (0);
+            }
+
+            ++tif->tif_row;
+            buf += sp->bytesperline;
+            cc -= sp->bytesperline;
+        } while (--nrows > 0);
+
+        if( line_work_buf != NULL )
+            _TIFFfree( line_work_buf );
+    }
+
+    /* Close down the decompressor if we've finished the strip or tile. */
+    return sp->cinfo.d.output_scanline < sp->cinfo.d.output_height
+        || TIFFjpeg_finish_decompress(sp);
+}
+
+/*
+ * Decode a chunk of pixels.
+ * Returned data is downsampled per sampling factors.
+ */
+/*ARGSUSED*/ static int
+JPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
+{
+    JPEGState *sp = JState(tif);
+    tsize_t nrows;
+    (void) s;
+
+    /* data is expected to be read in multiples of a scanline */
+    if ( (nrows = sp->cinfo.d.image_height) ) {
+        /* Cb,Cr both have sampling factors 1, so this is correct */
+        JDIMENSION clumps_per_line = sp->cinfo.d.comp_info[1].downsampled_width;
+        int samples_per_clump = sp->samplesperclump;
+	
+#ifdef JPEG_LIB_MK1
+        unsigned short* tmpbuf = _TIFFmalloc(sizeof(unsigned short) *
+                                             sp->cinfo.d.output_width *
+                                             sp->cinfo.d.num_components);
+#endif
+ 
+        do {
+            jpeg_component_info *compptr;
+            int ci, clumpoffset;
+
+            /* Reload downsampled-data buffer if needed */
+            if (sp->scancount >= DCTSIZE) {
+                int n = sp->cinfo.d.max_v_samp_factor * DCTSIZE;
+                if (TIFFjpeg_read_raw_data(sp, sp->ds_buffer, n)
+                    != n)
+                    return (0);
+                sp->scancount = 0;
+            }
+            /*
+             * Fastest way to unseparate data is to make one pass
+             * over the scanline for each row of each component.
+             */
+            clumpoffset = 0;	/* first sample in clump */
+            for (ci = 0, compptr = sp->cinfo.d.comp_info;
+                 ci < sp->cinfo.d.num_components;
+                 ci++, compptr++) {
+                int hsamp = compptr->h_samp_factor;
+                int vsamp = compptr->v_samp_factor;
+                int ypos;
+
+                for (ypos = 0; ypos < vsamp; ypos++) {
+                    JSAMPLE *inptr = sp->ds_buffer[ci][sp->scancount*vsamp + ypos];
+#ifdef JPEG_LIB_MK1
+                    JSAMPLE *outptr = (JSAMPLE*)tmpbuf + clumpoffset;
+#else
+                    JSAMPLE *outptr = (JSAMPLE*)buf + clumpoffset;
+#endif
+                    JDIMENSION nclump;
+
+                    if (hsamp == 1) {
+                        /* fast path for at least Cb and Cr */
+                        for (nclump = clumps_per_line; nclump-- > 0; ) {
+                            outptr[0] = *inptr++;
+                            outptr += samples_per_clump;
+                        }
+                    } else {
+                        int xpos;
+
+                        /* general case */
+                        for (nclump = clumps_per_line; nclump-- > 0; ) {
+                            for (xpos = 0; xpos < hsamp; xpos++)
+                                outptr[xpos] = *inptr++;
+                            outptr += samples_per_clump;
+                        }
+                    }
+                    clumpoffset += hsamp;
+                }
+            }
+
+#ifdef JPEG_LIB_MK1
+            {
+                if (sp->cinfo.d.data_precision == 8)
+                {
+                    int i=0;
+                    int len = sp->cinfo.d.output_width * sp->cinfo.d.num_components;
+                    for (i=0; i<len; i++)
+                    {
+                        ((unsigned char*)buf)[i] = tmpbuf[i] & 0xff;
+                    }
+                }
+                else
+                {         // 12-bit
+                    int value_pairs = (sp->cinfo.d.output_width
+                                       * sp->cinfo.d.num_components) / 2;
+                    int iPair;
+                    for( iPair = 0; iPair < value_pairs; iPair++ )
+                    {
+                        unsigned char *out_ptr = ((unsigned char *) buf) + iPair * 3;
+                        JSAMPLE *in_ptr = tmpbuf + iPair * 2;
+                        out_ptr[0] = (in_ptr[0] & 0xff0) >> 4;
+                        out_ptr[1] = ((in_ptr[0] & 0xf) << 4)
+                            | ((in_ptr[1] & 0xf00) >> 8);
+                        out_ptr[2] = ((in_ptr[1] & 0xff) >> 0);
+                    }
+                }
+            }
+#endif
+
+            ++sp->scancount;
+            ++tif->tif_row;
+            buf += sp->bytesperline;
+            cc -= sp->bytesperline;
+        } while (--nrows > 0);
+  
+#ifdef JPEG_LIB_MK1
+        _TIFFfree(tmpbuf);
+#endif
+
+    }
+
+    /* Close down the decompressor if done. */
+    return sp->cinfo.d.output_scanline < sp->cinfo.d.output_height
+        || TIFFjpeg_finish_decompress(sp);
+}
+
+
+/*
+ * JPEG Encoding.
+ */
+
+static void
+unsuppress_quant_table (JPEGState* sp, int tblno)
+{
+	JQUANT_TBL* qtbl;
+
+	if ((qtbl = sp->cinfo.c.quant_tbl_ptrs[tblno]) != NULL)
+		qtbl->sent_table = FALSE;
+}
+
+static void
+unsuppress_huff_table (JPEGState* sp, int tblno)
+{
+	JHUFF_TBL* htbl;
+
+	if ((htbl = sp->cinfo.c.dc_huff_tbl_ptrs[tblno]) != NULL)
+		htbl->sent_table = FALSE;
+	if ((htbl = sp->cinfo.c.ac_huff_tbl_ptrs[tblno]) != NULL)
+		htbl->sent_table = FALSE;
+}
+
+static int
+prepare_JPEGTables(TIFF* tif)
+{
+	JPEGState* sp = JState(tif);
+
+        JPEGInitializeLibJPEG( tif, 0, 0 );
+
+	/* Initialize quant tables for current quality setting */
+	if (!TIFFjpeg_set_quality(sp, sp->jpegquality, FALSE))
+		return (0);
+	/* Mark only the tables we want for output */
+	/* NB: chrominance tables are currently used only with YCbCr */
+	if (!TIFFjpeg_suppress_tables(sp, TRUE))
+		return (0);
+	if (sp->jpegtablesmode & JPEGTABLESMODE_QUANT) {
+		unsuppress_quant_table(sp, 0);
+		if (sp->photometric == PHOTOMETRIC_YCBCR)
+			unsuppress_quant_table(sp, 1);
+	}
+	if (sp->jpegtablesmode & JPEGTABLESMODE_HUFF) {
+		unsuppress_huff_table(sp, 0);
+		if (sp->photometric == PHOTOMETRIC_YCBCR)
+			unsuppress_huff_table(sp, 1);
+	}
+	/* Direct libjpeg output into jpegtables */
+	if (!TIFFjpeg_tables_dest(sp, tif))
+		return (0);
+	/* Emit tables-only datastream */
+	if (!TIFFjpeg_write_tables(sp))
+		return (0);
+
+	return (1);
+}
+
+static int
+JPEGSetupEncode(TIFF* tif)
+{
+	JPEGState* sp = JState(tif);
+	TIFFDirectory *td = &tif->tif_dir;
+	static const char module[] = "JPEGSetupEncode";
+
+        JPEGInitializeLibJPEG( tif, 1, 0 );
+
+	assert(sp != NULL);
+	assert(!sp->cinfo.comm.is_decompressor);
+
+	/*
+	 * Initialize all JPEG parameters to default values.
+	 * Note that jpeg_set_defaults needs legal values for
+	 * in_color_space and input_components.
+	 */
+	sp->cinfo.c.in_color_space = JCS_UNKNOWN;
+	sp->cinfo.c.input_components = 1;
+	if (!TIFFjpeg_set_defaults(sp))
+		return (0);
+	/* Set per-file parameters */
+	sp->photometric = td->td_photometric;
+	switch (sp->photometric) {
+	case PHOTOMETRIC_YCBCR:
+		sp->h_sampling = td->td_ycbcrsubsampling[0];
+		sp->v_sampling = td->td_ycbcrsubsampling[1];
+		/*
+		 * A ReferenceBlackWhite field *must* be present since the
+		 * default value is inappropriate for YCbCr.  Fill in the
+		 * proper value if application didn't set it.
+		 */
+		{
+			float *ref;
+			if (!TIFFGetField(tif, TIFFTAG_REFERENCEBLACKWHITE,
+					  &ref)) {
+				float refbw[6];
+				long top = 1L << td->td_bitspersample;
+				refbw[0] = 0;
+				refbw[1] = (float)(top-1L);
+				refbw[2] = (float)(top>>1);
+				refbw[3] = refbw[1];
+				refbw[4] = refbw[2];
+				refbw[5] = refbw[1];
+				TIFFSetField(tif, TIFFTAG_REFERENCEBLACKWHITE,
+					     refbw);
+			}
+		}
+		break;
+	case PHOTOMETRIC_PALETTE:		/* disallowed by Tech Note */
+	case PHOTOMETRIC_MASK:
+		TIFFErrorExt(tif->tif_clientdata, module,
+			  "PhotometricInterpretation %d not allowed for JPEG",
+			  (int) sp->photometric);
+		return (0);
+	default:
+		/* TIFF 6.0 forbids subsampling of all other color spaces */
+		sp->h_sampling = 1;
+		sp->v_sampling = 1;
+		break;
+	}
+
+	/* Verify miscellaneous parameters */
+
+	/*
+	 * This would need work if libtiff ever supports different
+	 * depths for different components, or if libjpeg ever supports
+	 * run-time selection of depth.  Neither is imminent.
+	 */
+#ifdef JPEG_LIB_MK1
+        /* BITS_IN_JSAMPLE now permits 8 and 12 --- dgilbert */
+	if (td->td_bitspersample != 8 && td->td_bitspersample != 12) 
+#else
+	if (td->td_bitspersample != BITS_IN_JSAMPLE ) 
+#endif
+        {
+		TIFFErrorExt(tif->tif_clientdata, module, "BitsPerSample %d not allowed for JPEG",
+			  (int) td->td_bitspersample);
+		return (0);
+	}
+	sp->cinfo.c.data_precision = td->td_bitspersample;
+#ifdef JPEG_LIB_MK1
+        sp->cinfo.c.bits_in_jsample = td->td_bitspersample;
+#endif
+	if (isTiled(tif)) {
+		if ((td->td_tilelength % (sp->v_sampling * DCTSIZE)) != 0) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+				  "JPEG tile height must be multiple of %d",
+				  sp->v_sampling * DCTSIZE);
+			return (0);
+		}
+		if ((td->td_tilewidth % (sp->h_sampling * DCTSIZE)) != 0) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+				  "JPEG tile width must be multiple of %d",
+				  sp->h_sampling * DCTSIZE);
+			return (0);
+		}
+	} else {
+		if (td->td_rowsperstrip < td->td_imagelength &&
+		    (td->td_rowsperstrip % (sp->v_sampling * DCTSIZE)) != 0) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+				  "RowsPerStrip must be multiple of %d for JPEG",
+				  sp->v_sampling * DCTSIZE);
+			return (0);
+		}
+	}
+
+	/* Create a JPEGTables field if appropriate */
+	if (sp->jpegtablesmode & (JPEGTABLESMODE_QUANT|JPEGTABLESMODE_HUFF)) {
+		if (!prepare_JPEGTables(tif))
+			return (0);
+		/* Mark the field present */
+		/* Can't use TIFFSetField since BEENWRITING is already set! */
+		TIFFSetFieldBit(tif, FIELD_JPEGTABLES);
+		tif->tif_flags |= TIFF_DIRTYDIRECT;
+	} else {
+		/* We do not support application-supplied JPEGTables, */
+		/* so mark the field not present */
+		TIFFClrFieldBit(tif, FIELD_JPEGTABLES);
+	}
+
+	/* Direct libjpeg output to libtiff's output buffer */
+	TIFFjpeg_data_dest(sp, tif);
+
+	return (1);
+}
+
+/*
+ * Set encoding state at the start of a strip or tile.
+ */
+static int
+JPEGPreEncode(TIFF* tif, tsample_t s)
+{
+	JPEGState *sp = JState(tif);
+	TIFFDirectory *td = &tif->tif_dir;
+	static const char module[] = "JPEGPreEncode";
+	uint32 segment_width, segment_height;
+	int downsampled_input;
+
+	assert(sp != NULL);
+	assert(!sp->cinfo.comm.is_decompressor);
+	/*
+	 * Set encoding parameters for this strip/tile.
+	 */
+	if (isTiled(tif)) {
+		segment_width = td->td_tilewidth;
+		segment_height = td->td_tilelength;
+		sp->bytesperline = TIFFTileRowSize(tif);
+	} else {
+		segment_width = td->td_imagewidth;
+		segment_height = td->td_imagelength - tif->tif_row;
+		if (segment_height > td->td_rowsperstrip)
+			segment_height = td->td_rowsperstrip;
+		sp->bytesperline = TIFFScanlineSize(tif);
+	}
+	if (td->td_planarconfig == PLANARCONFIG_SEPARATE && s > 0) {
+		/* for PC 2, scale down the strip/tile size
+		 * to match a downsampled component
+		 */
+		segment_width = TIFFhowmany(segment_width, sp->h_sampling);
+		segment_height = TIFFhowmany(segment_height, sp->v_sampling);
+	}
+	if (segment_width > 65535 || segment_height > 65535) {
+		TIFFErrorExt(tif->tif_clientdata, module, "Strip/tile too large for JPEG");
+		return (0);
+	}
+	sp->cinfo.c.image_width = segment_width;
+	sp->cinfo.c.image_height = segment_height;
+	downsampled_input = FALSE;
+	if (td->td_planarconfig == PLANARCONFIG_CONTIG) {
+		sp->cinfo.c.input_components = td->td_samplesperpixel;
+		if (sp->photometric == PHOTOMETRIC_YCBCR) {
+			if (sp->jpegcolormode == JPEGCOLORMODE_RGB) {
+				sp->cinfo.c.in_color_space = JCS_RGB;
+			} else {
+				sp->cinfo.c.in_color_space = JCS_YCbCr;
+				if (sp->h_sampling != 1 || sp->v_sampling != 1)
+					downsampled_input = TRUE;
+			}
+			if (!TIFFjpeg_set_colorspace(sp, JCS_YCbCr))
+				return (0);
+			/*
+			 * Set Y sampling factors;
+			 * we assume jpeg_set_colorspace() set the rest to 1
+			 */
+			sp->cinfo.c.comp_info[0].h_samp_factor = sp->h_sampling;
+			sp->cinfo.c.comp_info[0].v_samp_factor = sp->v_sampling;
+		} else {
+			sp->cinfo.c.in_color_space = JCS_UNKNOWN;
+			if (!TIFFjpeg_set_colorspace(sp, JCS_UNKNOWN))
+				return (0);
+			/* jpeg_set_colorspace set all sampling factors to 1 */
+		}
+	} else {
+		sp->cinfo.c.input_components = 1;
+		sp->cinfo.c.in_color_space = JCS_UNKNOWN;
+		if (!TIFFjpeg_set_colorspace(sp, JCS_UNKNOWN))
+			return (0);
+		sp->cinfo.c.comp_info[0].component_id = s;
+		/* jpeg_set_colorspace() set sampling factors to 1 */
+		if (sp->photometric == PHOTOMETRIC_YCBCR && s > 0) {
+			sp->cinfo.c.comp_info[0].quant_tbl_no = 1;
+			sp->cinfo.c.comp_info[0].dc_tbl_no = 1;
+			sp->cinfo.c.comp_info[0].ac_tbl_no = 1;
+		}
+	}
+	/* ensure libjpeg won't write any extraneous markers */
+	sp->cinfo.c.write_JFIF_header = FALSE;
+	sp->cinfo.c.write_Adobe_marker = FALSE;
+	/* set up table handling correctly */
+	if (! (sp->jpegtablesmode & JPEGTABLESMODE_QUANT)) {
+		if (!TIFFjpeg_set_quality(sp, sp->jpegquality, FALSE))
+			return (0);
+		unsuppress_quant_table(sp, 0);
+		unsuppress_quant_table(sp, 1);
+	}
+	if (sp->jpegtablesmode & JPEGTABLESMODE_HUFF)
+		sp->cinfo.c.optimize_coding = FALSE;
+	else
+		sp->cinfo.c.optimize_coding = TRUE;
+	if (downsampled_input) {
+		/* Need to use raw-data interface to libjpeg */
+		sp->cinfo.c.raw_data_in = TRUE;
+		tif->tif_encoderow = JPEGEncodeRaw;
+		tif->tif_encodestrip = JPEGEncodeRaw;
+		tif->tif_encodetile = JPEGEncodeRaw;
+	} else {
+		/* Use normal interface to libjpeg */
+		sp->cinfo.c.raw_data_in = FALSE;
+		tif->tif_encoderow = JPEGEncode;
+		tif->tif_encodestrip = JPEGEncode;
+		tif->tif_encodetile = JPEGEncode;
+	}
+	/* Start JPEG compressor */
+	if (!TIFFjpeg_start_compress(sp, FALSE))
+		return (0);
+	/* Allocate downsampled-data buffers if needed */
+	if (downsampled_input) {
+		if (!alloc_downsampled_buffers(tif, sp->cinfo.c.comp_info,
+					       sp->cinfo.c.num_components))
+			return (0);
+	}
+	sp->scancount = 0;
+
+	return (1);
+}
+
+/*
+ * Encode a chunk of pixels.
+ * "Standard" case: incoming data is not downsampled.
+ */
+static int
+JPEGEncode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
+{
+	JPEGState *sp = JState(tif);
+	tsize_t nrows;
+	JSAMPROW bufptr[1];
+
+	(void) s;
+	assert(sp != NULL);
+	/* data is expected to be supplied in multiples of a scanline */
+	nrows = cc / sp->bytesperline;
+	if (cc % sp->bytesperline)
+		TIFFWarningExt(tif->tif_clientdata, tif->tif_name, "fractional scanline discarded");
+
+	while (nrows-- > 0) {
+		bufptr[0] = (JSAMPROW) buf;
+		if (TIFFjpeg_write_scanlines(sp, bufptr, 1) != 1)
+			return (0);
+		if (nrows > 0)
+			tif->tif_row++;
+		buf += sp->bytesperline;
+	}
+	return (1);
+}
+
+/*
+ * Encode a chunk of pixels.
+ * Incoming data is expected to be downsampled per sampling factors.
+ */
+static int
+JPEGEncodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
+{
+	JPEGState *sp = JState(tif);
+	JSAMPLE* inptr;
+	JSAMPLE* outptr;
+	tsize_t nrows;
+	JDIMENSION clumps_per_line, nclump;
+	int clumpoffset, ci, xpos, ypos;
+	jpeg_component_info* compptr;
+	int samples_per_clump = sp->samplesperclump;
+
+	(void) s;
+	assert(sp != NULL);
+	/* data is expected to be supplied in multiples of a scanline */
+	nrows = cc / sp->bytesperline;
+	if (cc % sp->bytesperline)
+		TIFFWarningExt(tif->tif_clientdata, tif->tif_name, "fractional scanline discarded");
+
+	/* Cb,Cr both have sampling factors 1, so this is correct */
+	clumps_per_line = sp->cinfo.c.comp_info[1].downsampled_width;
+
+	while (nrows-- > 0) {
+		/*
+		 * Fastest way to separate the data is to make one pass
+		 * over the scanline for each row of each component.
+		 */
+		clumpoffset = 0;		/* first sample in clump */
+		for (ci = 0, compptr = sp->cinfo.c.comp_info;
+		     ci < sp->cinfo.c.num_components;
+		     ci++, compptr++) {
+		    int hsamp = compptr->h_samp_factor;
+		    int vsamp = compptr->v_samp_factor;
+		    int padding = (int) (compptr->width_in_blocks * DCTSIZE -
+					 clumps_per_line * hsamp);
+		    for (ypos = 0; ypos < vsamp; ypos++) {
+			inptr = ((JSAMPLE*) buf) + clumpoffset;
+			outptr = sp->ds_buffer[ci][sp->scancount*vsamp + ypos];
+			if (hsamp == 1) {
+			    /* fast path for at least Cb and Cr */
+			    for (nclump = clumps_per_line; nclump-- > 0; ) {
+				*outptr++ = inptr[0];
+				inptr += samples_per_clump;
+			    }
+			} else {
+			    /* general case */
+			    for (nclump = clumps_per_line; nclump-- > 0; ) {
+				for (xpos = 0; xpos < hsamp; xpos++)
+				    *outptr++ = inptr[xpos];
+				inptr += samples_per_clump;
+			    }
+			}
+			/* pad each scanline as needed */
+			for (xpos = 0; xpos < padding; xpos++) {
+			    *outptr = outptr[-1];
+			    outptr++;
+			}
+			clumpoffset += hsamp;
+		    }
+		}
+		sp->scancount++;
+		if (sp->scancount >= DCTSIZE) {
+			int n = sp->cinfo.c.max_v_samp_factor * DCTSIZE;
+			if (TIFFjpeg_write_raw_data(sp, sp->ds_buffer, n) != n)
+				return (0);
+			sp->scancount = 0;
+		}
+		if (nrows > 0)
+			tif->tif_row++;
+		buf += sp->bytesperline;
+	}
+	return (1);
+}
+
+/*
+ * Finish up at the end of a strip or tile.
+ */
+static int
+JPEGPostEncode(TIFF* tif)
+{
+	JPEGState *sp = JState(tif);
+
+	if (sp->scancount > 0) {
+		/*
+		 * Need to emit a partial bufferload of downsampled data.
+		 * Pad the data vertically.
+		 */
+		int ci, ypos, n;
+		jpeg_component_info* compptr;
+
+		for (ci = 0, compptr = sp->cinfo.c.comp_info;
+		     ci < sp->cinfo.c.num_components;
+		     ci++, compptr++) {
+			int vsamp = compptr->v_samp_factor;
+			tsize_t row_width = compptr->width_in_blocks * DCTSIZE
+				* sizeof(JSAMPLE);
+			for (ypos = sp->scancount * vsamp;
+			     ypos < DCTSIZE * vsamp; ypos++) {
+				_TIFFmemcpy((tdata_t)sp->ds_buffer[ci][ypos],
+					    (tdata_t)sp->ds_buffer[ci][ypos-1],
+					    row_width);
+
+			}
+		}
+		n = sp->cinfo.c.max_v_samp_factor * DCTSIZE;
+		if (TIFFjpeg_write_raw_data(sp, sp->ds_buffer, n) != n)
+			return (0);
+	}
+
+	return (TIFFjpeg_finish_compress(JState(tif)));
+}
+
+static void
+JPEGCleanup(TIFF* tif)
+{
+	JPEGState *sp = JState(tif);
+	
+	assert(sp != 0);
+
+	tif->tif_tagmethods.vgetfield = sp->vgetparent;
+	tif->tif_tagmethods.vsetfield = sp->vsetparent;
+
+	if( sp->cinfo_initialized )
+	    TIFFjpeg_destroy(sp);	/* release libjpeg resources */
+	if (sp->jpegtables)		/* tag value */
+		_TIFFfree(sp->jpegtables);
+	_TIFFfree(tif->tif_data);	/* release local state */
+	tif->tif_data = NULL;
+
+	_TIFFSetDefaultCompressionState(tif);
+}
+
+static int
+JPEGVSetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	JPEGState* sp = JState(tif);
+	TIFFDirectory* td = &tif->tif_dir;
+	uint32 v32;
+
+	assert(sp != NULL);
+
+	switch (tag) {
+	case TIFFTAG_JPEGTABLES:
+		v32 = va_arg(ap, uint32);
+		if (v32 == 0) {
+			/* XXX */
+			return (0);
+		}
+		_TIFFsetByteArray(&sp->jpegtables, va_arg(ap, void*),
+		    (long) v32);
+		sp->jpegtables_length = v32;
+		TIFFSetFieldBit(tif, FIELD_JPEGTABLES);
+		break;
+	case TIFFTAG_JPEGQUALITY:
+		sp->jpegquality = va_arg(ap, int);
+		return (1);			/* pseudo tag */
+	case TIFFTAG_JPEGCOLORMODE:
+		sp->jpegcolormode = va_arg(ap, int);
+		/*
+		 * Mark whether returned data is up-sampled or not
+		 * so TIFFStripSize and TIFFTileSize return values
+		 * that reflect the true amount of data.
+		 */
+		tif->tif_flags &= ~TIFF_UPSAMPLED;
+		if (td->td_planarconfig == PLANARCONFIG_CONTIG) {
+		    if (td->td_photometric == PHOTOMETRIC_YCBCR &&
+		      sp->jpegcolormode == JPEGCOLORMODE_RGB) {
+			tif->tif_flags |= TIFF_UPSAMPLED;
+		    } else {
+			if (td->td_ycbcrsubsampling[0] != 1 ||
+			    td->td_ycbcrsubsampling[1] != 1)
+			    ; /* XXX what about up-sampling? */
+		    }
+		}
+		/*
+		 * Must recalculate cached tile size
+		 * in case sampling state changed.
+		 */
+		tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (tsize_t) -1;
+		return (1);			/* pseudo tag */
+	case TIFFTAG_JPEGTABLESMODE:
+		sp->jpegtablesmode = va_arg(ap, int);
+		return (1);			/* pseudo tag */
+	case TIFFTAG_YCBCRSUBSAMPLING:
+                /* mark the fact that we have a real ycbcrsubsampling! */
+		sp->ycbcrsampling_fetched = 1;
+		return (*sp->vsetparent)(tif, tag, ap);
+	case TIFFTAG_FAXRECVPARAMS:
+		sp->recvparams = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_FAXSUBADDRESS:
+		_TIFFsetString(&sp->subaddress, va_arg(ap, char*));
+		break;
+	case TIFFTAG_FAXRECVTIME:
+		sp->recvtime = va_arg(ap, uint32);
+		break;
+	case TIFFTAG_FAXDCS:
+		_TIFFsetString(&sp->faxdcs, va_arg(ap, char*));
+		break;
+	default:
+		return (*sp->vsetparent)(tif, tag, ap);
+	}
+	TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit);
+	tif->tif_flags |= TIFF_DIRTYDIRECT;
+	return (1);
+}
+
+/*
+ * Some JPEG-in-TIFF produces do not emit the YCBCRSUBSAMPLING values in
+ * the TIFF tags, but still use non-default (2,2) values within the jpeg
+ * data stream itself.  In order for TIFF applications to work properly
+ * - for instance to get the strip buffer size right - it is imperative
+ * that the subsampling be available before we start reading the image
+ * data normally.  This function will attempt to load the first strip in
+ * order to get the sampling values from the jpeg data stream.  Various
+ * hacks are various places are done to ensure this function gets called
+ * before the td_ycbcrsubsampling values are used from the directory structure,
+ * including calling TIFFGetField() for the YCBCRSUBSAMPLING field from 
+ * TIFFStripSize(), and the printing code in tif_print.c. 
+ *
+ * Note that JPEGPreDeocode() will produce a fairly loud warning when the
+ * discovered sampling does not match the default sampling (2,2) or whatever
+ * was actually in the tiff tags. 
+ *
+ * Problems:
+ *  o This code will cause one whole strip/tile of compressed data to be
+ *    loaded just to get the tags right, even if the imagery is never read.
+ *    It would be more efficient to just load a bit of the header, and
+ *    initialize things from that. 
+ *
+ * See the bug in bugzilla for details:
+ *
+ * http://bugzilla.remotesensing.org/show_bug.cgi?id=168
+ *
+ * Frank Warmerdam, July 2002
+ */
+
+static void 
+JPEGFixupTestSubsampling( TIFF * tif )
+{
+#ifdef CHECK_JPEG_YCBCR_SUBSAMPLING
+    JPEGState *sp = JState(tif);
+    TIFFDirectory *td = &tif->tif_dir;
+
+    JPEGInitializeLibJPEG( tif, 0, 0 );
+
+    /*
+     * Some JPEG-in-TIFF files don't provide the ycbcrsampling tags, 
+     * and use a sampling schema other than the default 2,2.  To handle
+     * this we actually have to scan the header of a strip or tile of
+     * jpeg data to get the sampling.  
+     */
+    if( !sp->cinfo.comm.is_decompressor 
+        || sp->ycbcrsampling_fetched  
+        || td->td_photometric != PHOTOMETRIC_YCBCR )
+        return;
+
+    sp->ycbcrsampling_fetched = 1;
+    if( TIFFIsTiled( tif ) )
+    {
+        if( !TIFFFillTile( tif, 0 ) )
+			return;
+    }
+    else
+	{
+        if( !TIFFFillStrip( tif, 0 ) )
+            return;
+    }
+
+    TIFFSetField( tif, TIFFTAG_YCBCRSUBSAMPLING, 
+                  (uint16) sp->h_sampling, (uint16) sp->v_sampling );
+#endif /* CHECK_JPEG_YCBCR_SUBSAMPLING */
+}
+
+static int
+JPEGVGetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	JPEGState* sp = JState(tif);
+
+	assert(sp != NULL);
+
+	switch (tag) {
+		case TIFFTAG_JPEGTABLES:
+			*va_arg(ap, uint32*) = sp->jpegtables_length;
+			*va_arg(ap, void**) = sp->jpegtables;
+			break;
+		case TIFFTAG_JPEGQUALITY:
+			*va_arg(ap, int*) = sp->jpegquality;
+			break;
+		case TIFFTAG_JPEGCOLORMODE:
+			*va_arg(ap, int*) = sp->jpegcolormode;
+			break;
+		case TIFFTAG_JPEGTABLESMODE:
+			*va_arg(ap, int*) = sp->jpegtablesmode;
+			break;
+		case TIFFTAG_YCBCRSUBSAMPLING:
+			JPEGFixupTestSubsampling( tif );
+			return (*sp->vgetparent)(tif, tag, ap);
+			break;
+		case TIFFTAG_FAXRECVPARAMS:
+			*va_arg(ap, uint32*) = sp->recvparams;
+			break;
+		case TIFFTAG_FAXSUBADDRESS:
+			*va_arg(ap, char**) = sp->subaddress;
+			break;
+		case TIFFTAG_FAXRECVTIME:
+			*va_arg(ap, uint32*) = sp->recvtime;
+			break;
+		case TIFFTAG_FAXDCS:
+			*va_arg(ap, char**) = sp->faxdcs;
+			break;
+		default:
+			return (*sp->vgetparent)(tif, tag, ap);
+	}
+	return (1);
+}
+
+static void
+JPEGPrintDir(TIFF* tif, FILE* fd, long flags)
+{
+	JPEGState* sp = JState(tif);
+
+	assert(sp != NULL);
+
+	(void) flags;
+	if (TIFFFieldSet(tif,FIELD_JPEGTABLES))
+		fprintf(fd, "  JPEG Tables: (%lu bytes)\n",
+			(unsigned long) sp->jpegtables_length);
+        if (TIFFFieldSet(tif,FIELD_RECVPARAMS))
+                fprintf(fd, "  Fax Receive Parameters: %08lx\n",
+                   (unsigned long) sp->recvparams);
+        if (TIFFFieldSet(tif,FIELD_SUBADDRESS))
+                fprintf(fd, "  Fax SubAddress: %s\n", sp->subaddress);
+        if (TIFFFieldSet(tif,FIELD_RECVTIME))
+                fprintf(fd, "  Fax Receive Time: %lu secs\n",
+                    (unsigned long) sp->recvtime);
+        if (TIFFFieldSet(tif,FIELD_FAXDCS))
+                fprintf(fd, "  Fax DCS: %s\n", sp->faxdcs);
+}
+
+static uint32
+JPEGDefaultStripSize(TIFF* tif, uint32 s)
+{
+	JPEGState* sp = JState(tif);
+	TIFFDirectory *td = &tif->tif_dir;
+
+	s = (*sp->defsparent)(tif, s);
+	if (s < td->td_imagelength)
+		s = TIFFroundup(s, td->td_ycbcrsubsampling[1] * DCTSIZE);
+	return (s);
+}
+
+static void
+JPEGDefaultTileSize(TIFF* tif, uint32* tw, uint32* th)
+{
+	JPEGState* sp = JState(tif);
+	TIFFDirectory *td = &tif->tif_dir;
+
+	(*sp->deftparent)(tif, tw, th);
+	*tw = TIFFroundup(*tw, td->td_ycbcrsubsampling[0] * DCTSIZE);
+	*th = TIFFroundup(*th, td->td_ycbcrsubsampling[1] * DCTSIZE);
+}
+
+/*
+ * The JPEG library initialized used to be done in TIFFInitJPEG(), but
+ * now that we allow a TIFF file to be opened in update mode it is necessary
+ * to have some way of deciding whether compression or decompression is
+ * desired other than looking at tif->tif_mode.  We accomplish this by 
+ * examining {TILE/STRIP}BYTECOUNTS to see if there is a non-zero entry.
+ * If so, we assume decompression is desired. 
+ *
+ * This is tricky, because TIFFInitJPEG() is called while the directory is
+ * being read, and generally speaking the BYTECOUNTS tag won't have been read
+ * at that point.  So we try to defer jpeg library initialization till we
+ * do have that tag ... basically any access that might require the compressor
+ * or decompressor that occurs after the reading of the directory. 
+ *
+ * In an ideal world compressors or decompressors would be setup
+ * at the point where a single tile or strip was accessed (for read or write)
+ * so that stuff like update of missing tiles, or replacement of tiles could
+ * be done. However, we aren't trying to crack that nut just yet ...
+ *
+ * NFW, Feb 3rd, 2003.
+ */
+
+static int JPEGInitializeLibJPEG( TIFF * tif, int force_encode, int force_decode )
+{
+    JPEGState* sp = JState(tif);
+    uint32 *byte_counts = NULL;
+    int     data_is_empty = TRUE;
+    int     decompress;
+
+    if( sp->cinfo_initialized )
+        return 1;
+
+    /*
+     * Do we have tile data already?  Make sure we initialize the
+     * the state in decompressor mode if we have tile data, even if we
+     * are not in read-only file access mode. 
+     */
+    if( TIFFIsTiled( tif ) 
+        && TIFFGetField( tif, TIFFTAG_TILEBYTECOUNTS, &byte_counts ) 
+        && byte_counts != NULL )
+    {
+        data_is_empty = byte_counts[0] == 0;
+    }
+    if( !TIFFIsTiled( tif ) 
+        && TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &byte_counts) 
+        && byte_counts != NULL )
+    {
+        data_is_empty = byte_counts[0] == 0;
+    }
+
+    if( force_decode )
+        decompress = 1;
+    else if( force_encode )
+        decompress = 0;
+    else if( tif->tif_mode == O_RDONLY )
+        decompress = 1;
+    else if( data_is_empty )
+        decompress = 0;
+    else
+        decompress = 1;
+
+    /*
+     * Initialize libjpeg.
+     */
+    if ( decompress ) {
+        if (!TIFFjpeg_create_decompress(sp))
+            return (0);
+
+    } else {
+        if (!TIFFjpeg_create_compress(sp))
+            return (0);
+    }
+
+    sp->cinfo_initialized = TRUE;
+
+    return 1;
+}
+
+int
+TIFFInitJPEG(TIFF* tif, int scheme)
+{
+	JPEGState* sp;
+
+	assert(scheme == COMPRESSION_JPEG);
+
+	/*
+	 * Allocate state block so tag methods have storage to record values.
+	 */
+	tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (JPEGState));
+
+	if (tif->tif_data == NULL) {
+		TIFFErrorExt(tif->tif_clientdata, "TIFFInitJPEG", "No space for JPEG state block");
+		return (0);
+	}
+        _TIFFmemset( tif->tif_data, 0, sizeof(JPEGState));
+
+	sp = JState(tif);
+	sp->tif = tif;				/* back link */
+
+	/*
+	 * Merge codec-specific tag information and override parent get/set
+	 * field methods.
+	 */
+	_TIFFMergeFieldInfo(tif, jpegFieldInfo, N(jpegFieldInfo));
+	sp->vgetparent = tif->tif_tagmethods.vgetfield;
+	tif->tif_tagmethods.vgetfield = JPEGVGetField; /* hook for codec tags */
+	sp->vsetparent = tif->tif_tagmethods.vsetfield;
+	tif->tif_tagmethods.vsetfield = JPEGVSetField; /* hook for codec tags */
+	tif->tif_tagmethods.printdir = JPEGPrintDir;   /* hook for codec tags */
+
+	/* Default values for codec-specific fields */
+	sp->jpegtables = NULL;
+	sp->jpegtables_length = 0;
+	sp->jpegquality = 75;			/* Default IJG quality */
+	sp->jpegcolormode = JPEGCOLORMODE_RAW;
+	sp->jpegtablesmode = JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF;
+
+        sp->recvparams = 0;
+        sp->subaddress = NULL;
+        sp->faxdcs = NULL;
+
+        sp->ycbcrsampling_fetched = 0;
+
+	/*
+	 * Install codec methods.
+	 */
+	tif->tif_setupdecode = JPEGSetupDecode;
+	tif->tif_predecode = JPEGPreDecode;
+	tif->tif_decoderow = JPEGDecode;
+	tif->tif_decodestrip = JPEGDecode;
+	tif->tif_decodetile = JPEGDecode;
+	tif->tif_setupencode = JPEGSetupEncode;
+	tif->tif_preencode = JPEGPreEncode;
+	tif->tif_postencode = JPEGPostEncode;
+	tif->tif_encoderow = JPEGEncode;
+	tif->tif_encodestrip = JPEGEncode;
+	tif->tif_encodetile = JPEGEncode;
+	tif->tif_cleanup = JPEGCleanup;
+	sp->defsparent = tif->tif_defstripsize;
+	tif->tif_defstripsize = JPEGDefaultStripSize;
+	sp->deftparent = tif->tif_deftilesize;
+	tif->tif_deftilesize = JPEGDefaultTileSize;
+	tif->tif_flags |= TIFF_NOBITREV;	/* no bit reversal, please */
+
+        sp->cinfo_initialized = FALSE;
+
+	/*
+        ** Create a JPEGTables field if no directory has yet been created. 
+        ** We do this just to ensure that sufficient space is reserved for
+        ** the JPEGTables field.  It will be properly created the right
+        ** size later. 
+        */
+        if( tif->tif_diroff == 0 )
+        {
+#define SIZE_OF_JPEGTABLES 2000
+            TIFFSetFieldBit(tif, FIELD_JPEGTABLES);
+            sp->jpegtables_length = SIZE_OF_JPEGTABLES;
+            sp->jpegtables = (void *) _TIFFmalloc(sp->jpegtables_length);
+	    _TIFFmemset(sp->jpegtables, 0, SIZE_OF_JPEGTABLES);
+#undef SIZE_OF_JPEGTABLES
+        }
+
+        /*
+         * Mark the TIFFTAG_YCBCRSAMPLES as present even if it is not
+         * see: JPEGFixupTestSubsampling().
+         */
+        TIFFSetFieldBit( tif, FIELD_YCBCRSUBSAMPLING );
+
+	return 1;
+}
+#endif /* JPEG_SUPPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_luv.c b/src/tiff/tif_luv.c
new file mode 100644
index 0000000..73f40b8
--- /dev/null
+++ b/src/tiff/tif_luv.c
@@ -0,0 +1,1606 @@
+/* $Id: tif_luv.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1997 Greg Ward Larson
+ * Copyright (c) 1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler, Greg Larson and Silicon Graphics may not be used in any
+ * advertising or publicity relating to the software without the specific,
+ * prior written permission of Sam Leffler, Greg Larson and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER, GREG LARSON OR SILICON GRAPHICS BE LIABLE
+ * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#include "tiffiop.h"
+#ifdef LOGLUV_SUPPORT
+
+/*
+ * TIFF Library.
+ * LogLuv compression support for high dynamic range images.
+ *
+ * Contributed by Greg Larson.
+ *
+ * LogLuv image support uses the TIFF library to store 16 or 10-bit
+ * log luminance values with 8 bits each of u and v or a 14-bit index.
+ *
+ * The codec can take as input and produce as output 32-bit IEEE float values 
+ * as well as 16-bit integer values.  A 16-bit luminance is interpreted
+ * as a sign bit followed by a 15-bit integer that is converted
+ * to and from a linear magnitude using the transformation:
+ *
+ *	L = 2^( (Le+.5)/256 - 64 )		# real from 15-bit
+ *
+ *	Le = floor( 256*(log2(L) + 64) )	# 15-bit from real
+ *
+ * The actual conversion to world luminance units in candelas per sq. meter
+ * requires an additional multiplier, which is stored in the TIFFTAG_STONITS.
+ * This value is usually set such that a reasonable exposure comes from
+ * clamping decoded luminances above 1 to 1 in the displayed image.
+ *
+ * The 16-bit values for u and v may be converted to real values by dividing
+ * each by 32768.  (This allows for negative values, which aren't useful as
+ * far as we know, but are left in case of future improvements in human
+ * color vision.)
+ *
+ * Conversion from (u,v), which is actually the CIE (u',v') system for
+ * you color scientists, is accomplished by the following transformation:
+ *
+ *	u = 4*x / (-2*x + 12*y + 3)
+ *	v = 9*y / (-2*x + 12*y + 3)
+ *
+ *	x = 9*u / (6*u - 16*v + 12)
+ *	y = 4*v / (6*u - 16*v + 12)
+ *
+ * This process is greatly simplified by passing 32-bit IEEE floats
+ * for each of three CIE XYZ coordinates.  The codec then takes care
+ * of conversion to and from LogLuv, though the application is still
+ * responsible for interpreting the TIFFTAG_STONITS calibration factor.
+ *
+ * By definition, a CIE XYZ vector of [1 1 1] corresponds to a neutral white
+ * point of (x,y)=(1/3,1/3).  However, most color systems assume some other
+ * white point, such as D65, and an absolute color conversion to XYZ then
+ * to another color space with a different white point may introduce an
+ * unwanted color cast to the image.  It is often desirable, therefore, to
+ * perform a white point conversion that maps the input white to [1 1 1]
+ * in XYZ, then record the original white point using the TIFFTAG_WHITEPOINT
+ * tag value.  A decoder that demands absolute color calibration may use
+ * this white point tag to get back the original colors, but usually it
+ * will be ignored and the new white point will be used instead that
+ * matches the output color space.
+ *
+ * Pixel information is compressed into one of two basic encodings, depending
+ * on the setting of the compression tag, which is one of COMPRESSION_SGILOG
+ * or COMPRESSION_SGILOG24.  For COMPRESSION_SGILOG, greyscale data is
+ * stored as:
+ *
+ *	 1       15
+ *	|-+---------------|
+ *
+ * COMPRESSION_SGILOG color data is stored as:
+ *
+ *	 1       15           8        8
+ *	|-+---------------|--------+--------|
+ *	 S       Le           ue       ve
+ *
+ * For the 24-bit COMPRESSION_SGILOG24 color format, the data is stored as:
+ *
+ *	     10           14
+ *	|----------|--------------|
+ *	     Le'          Ce
+ *
+ * There is no sign bit in the 24-bit case, and the (u,v) chromaticity is
+ * encoded as an index for optimal color resolution.  The 10 log bits are
+ * defined by the following conversions:
+ *
+ *	L = 2^((Le'+.5)/64 - 12)		# real from 10-bit
+ *
+ *	Le' = floor( 64*(log2(L) + 12) )	# 10-bit from real
+ *
+ * The 10 bits of the smaller format may be converted into the 15 bits of
+ * the larger format by multiplying by 4 and adding 13314.  Obviously,
+ * a smaller range of magnitudes is covered (about 5 orders of magnitude
+ * instead of 38), and the lack of a sign bit means that negative luminances
+ * are not allowed.  (Well, they aren't allowed in the real world, either,
+ * but they are useful for certain types of image processing.)
+ *
+ * The desired user format is controlled by the setting the internal
+ * pseudo tag TIFFTAG_SGILOGDATAFMT to one of:
+ *  SGILOGDATAFMT_FLOAT       = IEEE 32-bit float XYZ values
+ *  SGILOGDATAFMT_16BIT	      = 16-bit integer encodings of logL, u and v
+ * Raw data i/o is also possible using:
+ *  SGILOGDATAFMT_RAW         = 32-bit unsigned integer with encoded pixel
+ * In addition, the following decoding is provided for ease of display:
+ *  SGILOGDATAFMT_8BIT        = 8-bit default RGB gamma-corrected values
+ *
+ * For grayscale images, we provide the following data formats:
+ *  SGILOGDATAFMT_FLOAT       = IEEE 32-bit float Y values
+ *  SGILOGDATAFMT_16BIT       = 16-bit integer w/ encoded luminance
+ *  SGILOGDATAFMT_8BIT        = 8-bit gray monitor values
+ *
+ * Note that the COMPRESSION_SGILOG applies a simple run-length encoding
+ * scheme by separating the logL, u and v bytes for each row and applying
+ * a PackBits type of compression.  Since the 24-bit encoding is not
+ * adaptive, the 32-bit color format takes less space in many cases.
+ *
+ * Further control is provided over the conversion from higher-resolution
+ * formats to final encoded values through the pseudo tag
+ * TIFFTAG_SGILOGENCODE:
+ *  SGILOGENCODE_NODITHER     = do not dither encoded values
+ *  SGILOGENCODE_RANDITHER    = apply random dithering during encoding
+ *
+ * The default value of this tag is SGILOGENCODE_NODITHER for
+ * COMPRESSION_SGILOG to maximize run-length encoding and
+ * SGILOGENCODE_RANDITHER for COMPRESSION_SGILOG24 to turn
+ * quantization errors into noise.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+/*
+ * State block for each open TIFF
+ * file using LogLuv compression/decompression.
+ */
+typedef	struct logLuvState LogLuvState;
+
+struct logLuvState {
+	int			user_datafmt;	/* user data format */
+	int			encode_meth;	/* encoding method */
+	int			pixel_size;	/* bytes per pixel */
+
+	tidata_t*		tbuf;		/* translation buffer */
+	int			tbuflen;	/* buffer length */
+	void (*tfunc)(LogLuvState*, tidata_t, int);
+
+	TIFFVSetMethod		vgetparent;	/* super-class method */
+	TIFFVSetMethod		vsetparent;	/* super-class method */
+};
+
+#define	DecoderState(tif)	((LogLuvState*) (tif)->tif_data)
+#define	EncoderState(tif)	((LogLuvState*) (tif)->tif_data)
+
+#define SGILOGDATAFMT_UNKNOWN	-1
+
+#define MINRUN		4	/* minimum run length */
+
+/*
+ * Decode a string of 16-bit gray pixels.
+ */
+static int
+LogL16Decode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
+{
+	LogLuvState* sp = DecoderState(tif);
+	int shft, i, npixels;
+	unsigned char* bp;
+	int16* tp;
+	int16 b;
+	int cc, rc;
+
+	assert(s == 0);
+	assert(sp != NULL);
+
+	npixels = occ / sp->pixel_size;
+
+	if (sp->user_datafmt == SGILOGDATAFMT_16BIT)
+		tp = (int16*) op;
+	else {
+		assert(sp->tbuflen >= npixels);
+		tp = (int16*) sp->tbuf;
+	}
+	_TIFFmemset((tdata_t) tp, 0, npixels*sizeof (tp[0]));
+
+	bp = (unsigned char*) tif->tif_rawcp;
+	cc = tif->tif_rawcc;
+					/* get each byte string */
+	for (shft = 2*8; (shft -= 8) >= 0; ) {
+		for (i = 0; i < npixels && cc > 0; )
+			if (*bp >= 128) {		/* run */
+				rc = *bp++ + (2-128);
+				b = (int16)(*bp++ << shft);
+				cc -= 2;
+				while (rc-- && i < npixels)
+					tp[i++] |= b;
+			} else {			/* non-run */
+				rc = *bp++;		/* nul is noop */
+				while (--cc && rc-- && i < npixels)
+					tp[i++] |= (int16)*bp++ << shft;
+			}
+		if (i != npixels) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		"LogL16Decode: Not enough data at row %d (short %d pixels)",
+			    tif->tif_row, npixels - i);
+			tif->tif_rawcp = (tidata_t) bp;
+			tif->tif_rawcc = cc;
+			return (0);
+		}
+	}
+	(*sp->tfunc)(sp, op, npixels);
+	tif->tif_rawcp = (tidata_t) bp;
+	tif->tif_rawcc = cc;
+	return (1);
+}
+
+/*
+ * Decode a string of 24-bit pixels.
+ */
+static int
+LogLuvDecode24(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
+{
+	LogLuvState* sp = DecoderState(tif);
+	int cc, i, npixels;
+	unsigned char* bp;
+	uint32* tp;
+
+	assert(s == 0);
+	assert(sp != NULL);
+
+	npixels = occ / sp->pixel_size;
+
+	if (sp->user_datafmt == SGILOGDATAFMT_RAW)
+		tp = (uint32 *)op;
+	else {
+		assert(sp->tbuflen >= npixels);
+		tp = (uint32 *) sp->tbuf;
+	}
+					/* copy to array of uint32 */
+	bp = (unsigned char*) tif->tif_rawcp;
+	cc = tif->tif_rawcc;
+	for (i = 0; i < npixels && cc > 0; i++) {
+		tp[i] = bp[0] << 16 | bp[1] << 8 | bp[2];
+		bp += 3;
+		cc -= 3;
+	}
+	tif->tif_rawcp = (tidata_t) bp;
+	tif->tif_rawcc = cc;
+	if (i != npixels) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+	    "LogLuvDecode24: Not enough data at row %d (short %d pixels)",
+		    tif->tif_row, npixels - i);
+		return (0);
+	}
+	(*sp->tfunc)(sp, op, npixels);
+	return (1);
+}
+
+/*
+ * Decode a string of 32-bit pixels.
+ */
+static int
+LogLuvDecode32(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
+{
+	LogLuvState* sp;
+	int shft, i, npixels;
+	unsigned char* bp;
+	uint32* tp;
+	uint32 b;
+	int cc, rc;
+
+	assert(s == 0);
+	sp = DecoderState(tif);
+	assert(sp != NULL);
+
+	npixels = occ / sp->pixel_size;
+
+	if (sp->user_datafmt == SGILOGDATAFMT_RAW)
+		tp = (uint32*) op;
+	else {
+		assert(sp->tbuflen >= npixels);
+		tp = (uint32*) sp->tbuf;
+	}
+	_TIFFmemset((tdata_t) tp, 0, npixels*sizeof (tp[0]));
+
+	bp = (unsigned char*) tif->tif_rawcp;
+	cc = tif->tif_rawcc;
+					/* get each byte string */
+	for (shft = 4*8; (shft -= 8) >= 0; ) {
+		for (i = 0; i < npixels && cc > 0; )
+			if (*bp >= 128) {		/* run */
+				rc = *bp++ + (2-128);
+				b = (uint32)*bp++ << shft;
+				cc -= 2;
+				while (rc-- && i < npixels)
+					tp[i++] |= b;
+			} else {			/* non-run */
+				rc = *bp++;		/* nul is noop */
+				while (--cc && rc-- && i < npixels)
+					tp[i++] |= (uint32)*bp++ << shft;
+			}
+		if (i != npixels) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		"LogLuvDecode32: Not enough data at row %d (short %d pixels)",
+			    tif->tif_row, npixels - i);
+			tif->tif_rawcp = (tidata_t) bp;
+			tif->tif_rawcc = cc;
+			return (0);
+		}
+	}
+	(*sp->tfunc)(sp, op, npixels);
+	tif->tif_rawcp = (tidata_t) bp;
+	tif->tif_rawcc = cc;
+	return (1);
+}
+
+/*
+ * Decode a strip of pixels.  We break it into rows to
+ * maintain synchrony with the encode algorithm, which
+ * is row by row.
+ */
+static int
+LogLuvDecodeStrip(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	tsize_t rowlen = TIFFScanlineSize(tif);
+
+	assert(cc%rowlen == 0);
+	while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s))
+		bp += rowlen, cc -= rowlen;
+	return (cc == 0);
+}
+
+/*
+ * Decode a tile of pixels.  We break it into rows to
+ * maintain synchrony with the encode algorithm, which
+ * is row by row.
+ */
+static int
+LogLuvDecodeTile(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	tsize_t rowlen = TIFFTileRowSize(tif);
+
+	assert(cc%rowlen == 0);
+	while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s))
+		bp += rowlen, cc -= rowlen;
+	return (cc == 0);
+}
+
+/*
+ * Encode a row of 16-bit pixels.
+ */
+static int
+LogL16Encode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	LogLuvState* sp = EncoderState(tif);
+	int shft, i, j, npixels;
+	tidata_t op;
+	int16* tp;
+	int16 b;
+	int occ, rc=0, mask, beg;
+
+	assert(s == 0);
+	assert(sp != NULL);
+	npixels = cc / sp->pixel_size;
+
+	if (sp->user_datafmt == SGILOGDATAFMT_16BIT)
+		tp = (int16*) bp;
+	else {
+		tp = (int16*) sp->tbuf;
+		assert(sp->tbuflen >= npixels);
+		(*sp->tfunc)(sp, bp, npixels);
+	}
+					/* compress each byte string */
+	op = tif->tif_rawcp;
+	occ = tif->tif_rawdatasize - tif->tif_rawcc;
+	for (shft = 2*8; (shft -= 8) >= 0; )
+		for (i = 0; i < npixels; i += rc) {
+			if (occ < 4) {
+				tif->tif_rawcp = op;
+				tif->tif_rawcc = tif->tif_rawdatasize - occ;
+				if (!TIFFFlushData1(tif))
+					return (-1);
+				op = tif->tif_rawcp;
+				occ = tif->tif_rawdatasize - tif->tif_rawcc;
+			}
+			mask = 0xff << shft;		/* find next run */
+			for (beg = i; beg < npixels; beg += rc) {
+				b = (int16) (tp[beg] & mask);
+				rc = 1;
+				while (rc < 127+2 && beg+rc < npixels &&
+						(tp[beg+rc] & mask) == b)
+					rc++;
+				if (rc >= MINRUN)
+					break;		/* long enough */
+			}
+			if (beg-i > 1 && beg-i < MINRUN) {
+				b = (int16) (tp[i] & mask);/*check short run */
+				j = i+1;
+				while ((tp[j++] & mask) == b)
+                                    if (j == beg) {
+                                        *op++ = (tidataval_t)(128-2+j-i);
+                                        *op++ = (tidataval_t) (b >> shft);
+                                        occ -= 2;
+                                        i = beg;
+                                        break;
+                                    }
+			}
+			while (i < beg) {		/* write out non-run */
+				if ((j = beg-i) > 127) j = 127;
+				if (occ < j+3) {
+                                    tif->tif_rawcp = op;
+                                    tif->tif_rawcc = tif->tif_rawdatasize - occ;
+                                    if (!TIFFFlushData1(tif))
+                                        return (-1);
+                                    op = tif->tif_rawcp;
+                                    occ = tif->tif_rawdatasize - tif->tif_rawcc;
+				}
+				*op++ = (tidataval_t) j; occ--;
+				while (j--) {
+					*op++ = (tidataval_t) (tp[i++] >> shft & 0xff);
+					occ--;
+				}
+			}
+			if (rc >= MINRUN) {		/* write out run */
+				*op++ = (tidataval_t) (128-2+rc);
+				*op++ = (tidataval_t) (tp[beg] >> shft & 0xff);
+				occ -= 2;
+			} else
+				rc = 0;
+		}
+	tif->tif_rawcp = op;
+	tif->tif_rawcc = tif->tif_rawdatasize - occ;
+
+	return (0);
+}
+
+/*
+ * Encode a row of 24-bit pixels.
+ */
+static int
+LogLuvEncode24(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	LogLuvState* sp = EncoderState(tif);
+	int i, npixels, occ;
+	tidata_t op;
+	uint32* tp;
+
+	assert(s == 0);
+	assert(sp != NULL);
+	npixels = cc / sp->pixel_size;
+
+	if (sp->user_datafmt == SGILOGDATAFMT_RAW)
+		tp = (uint32*) bp;
+	else {
+		tp = (uint32*) sp->tbuf;
+		assert(sp->tbuflen >= npixels);
+		(*sp->tfunc)(sp, bp, npixels);
+	}
+					/* write out encoded pixels */
+	op = tif->tif_rawcp;
+	occ = tif->tif_rawdatasize - tif->tif_rawcc;
+	for (i = npixels; i--; ) {
+		if (occ < 3) {
+			tif->tif_rawcp = op;
+			tif->tif_rawcc = tif->tif_rawdatasize - occ;
+			if (!TIFFFlushData1(tif))
+				return (-1);
+			op = tif->tif_rawcp;
+			occ = tif->tif_rawdatasize - tif->tif_rawcc;
+		}
+		*op++ = (tidataval_t)(*tp >> 16);
+		*op++ = (tidataval_t)(*tp >> 8 & 0xff);
+		*op++ = (tidataval_t)(*tp++ & 0xff);
+		occ -= 3;
+	}
+	tif->tif_rawcp = op;
+	tif->tif_rawcc = tif->tif_rawdatasize - occ;
+
+	return (0);
+}
+
+/*
+ * Encode a row of 32-bit pixels.
+ */
+static int
+LogLuvEncode32(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	LogLuvState* sp = EncoderState(tif);
+	int shft, i, j, npixels;
+	tidata_t op;
+	uint32* tp;
+	uint32 b;
+	int occ, rc=0, mask, beg;
+
+	assert(s == 0);
+	assert(sp != NULL);
+
+	npixels = cc / sp->pixel_size;
+
+	if (sp->user_datafmt == SGILOGDATAFMT_RAW)
+		tp = (uint32*) bp;
+	else {
+		tp = (uint32*) sp->tbuf;
+		assert(sp->tbuflen >= npixels);
+		(*sp->tfunc)(sp, bp, npixels);
+	}
+					/* compress each byte string */
+	op = tif->tif_rawcp;
+	occ = tif->tif_rawdatasize - tif->tif_rawcc;
+	for (shft = 4*8; (shft -= 8) >= 0; )
+		for (i = 0; i < npixels; i += rc) {
+			if (occ < 4) {
+				tif->tif_rawcp = op;
+				tif->tif_rawcc = tif->tif_rawdatasize - occ;
+				if (!TIFFFlushData1(tif))
+					return (-1);
+				op = tif->tif_rawcp;
+				occ = tif->tif_rawdatasize - tif->tif_rawcc;
+			}
+			mask = 0xff << shft;		/* find next run */
+			for (beg = i; beg < npixels; beg += rc) {
+				b = tp[beg] & mask;
+				rc = 1;
+				while (rc < 127+2 && beg+rc < npixels &&
+						(tp[beg+rc] & mask) == b)
+					rc++;
+				if (rc >= MINRUN)
+					break;		/* long enough */
+			}
+			if (beg-i > 1 && beg-i < MINRUN) {
+				b = tp[i] & mask;	/* check short run */
+				j = i+1;
+				while ((tp[j++] & mask) == b)
+					if (j == beg) {
+						*op++ = (tidataval_t)(128-2+j-i);
+						*op++ = (tidataval_t)(b >> shft);
+						occ -= 2;
+						i = beg;
+						break;
+					}
+			}
+			while (i < beg) {		/* write out non-run */
+				if ((j = beg-i) > 127) j = 127;
+				if (occ < j+3) {
+					tif->tif_rawcp = op;
+					tif->tif_rawcc = tif->tif_rawdatasize - occ;
+					if (!TIFFFlushData1(tif))
+						return (-1);
+					op = tif->tif_rawcp;
+					occ = tif->tif_rawdatasize - tif->tif_rawcc;
+				}
+				*op++ = (tidataval_t) j; occ--;
+				while (j--) {
+					*op++ = (tidataval_t)(tp[i++] >> shft & 0xff);
+					occ--;
+				}
+			}
+			if (rc >= MINRUN) {		/* write out run */
+				*op++ = (tidataval_t) (128-2+rc);
+				*op++ = (tidataval_t)(tp[beg] >> shft & 0xff);
+				occ -= 2;
+			} else
+				rc = 0;
+		}
+	tif->tif_rawcp = op;
+	tif->tif_rawcc = tif->tif_rawdatasize - occ;
+
+	return (0);
+}
+
+/*
+ * Encode a strip of pixels.  We break it into rows to
+ * avoid encoding runs across row boundaries.
+ */
+static int
+LogLuvEncodeStrip(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	tsize_t rowlen = TIFFScanlineSize(tif);
+
+	assert(cc%rowlen == 0);
+	while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 0)
+		bp += rowlen, cc -= rowlen;
+	return (cc == 0);
+}
+
+/*
+ * Encode a tile of pixels.  We break it into rows to
+ * avoid encoding runs across row boundaries.
+ */
+static int
+LogLuvEncodeTile(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	tsize_t rowlen = TIFFTileRowSize(tif);
+
+	assert(cc%rowlen == 0);
+	while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 0)
+		bp += rowlen, cc -= rowlen;
+	return (cc == 0);
+}
+
+/*
+ * Encode/Decode functions for converting to and from user formats.
+ */
+
+#include "uvcode.h"
+
+#ifndef UVSCALE
+#define U_NEU		0.210526316
+#define V_NEU		0.473684211
+#define UVSCALE		410.
+#endif
+
+#ifndef	M_LN2
+#define M_LN2		0.69314718055994530942
+#endif
+#ifndef M_PI
+#define M_PI		3.14159265358979323846
+#endif
+#define log2(x)		((1./M_LN2)*log(x))
+#define exp2(x)		exp(M_LN2*(x))
+
+#define itrunc(x,m)	((m)==SGILOGENCODE_NODITHER ? \
+				(int)(x) : \
+				(int)((x) + rand()*(1./RAND_MAX) - .5))
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+double
+LogL16toY(int p16)		/* compute luminance from 16-bit LogL */
+{
+	int	Le = p16 & 0x7fff;
+	double	Y;
+
+	if (!Le)
+		return (0.);
+	Y = exp(M_LN2/256.*(Le+.5) - M_LN2*64.);
+	return (!(p16 & 0x8000) ? Y : -Y);
+}
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+int
+LogL16fromY(double Y, int em)	/* get 16-bit LogL from Y */
+{
+	if (Y >= 1.8371976e19)
+		return (0x7fff);
+	if (Y <= -1.8371976e19)
+		return (0xffff);
+	if (Y > 5.4136769e-20)
+		return itrunc(256.*(log2(Y) + 64.), em);
+	if (Y < -5.4136769e-20)
+		return (~0x7fff | itrunc(256.*(log2(-Y) + 64.), em));
+	return (0);
+}
+
+static void
+L16toY(LogLuvState* sp, tidata_t op, int n)
+{
+	int16* l16 = (int16*) sp->tbuf;
+	float* yp = (float*) op;
+
+	while (n-- > 0)
+		*yp++ = (float)LogL16toY(*l16++);
+}
+
+static void
+L16toGry(LogLuvState* sp, tidata_t op, int n)
+{
+	int16* l16 = (int16*) sp->tbuf;
+	uint8* gp = (uint8*) op;
+
+	while (n-- > 0) {
+		double Y = LogL16toY(*l16++);
+		*gp++ = (uint8) ((Y <= 0.) ? 0 : (Y >= 1.) ? 255 : (int)(256.*sqrt(Y)));
+	}
+}
+
+static void
+L16fromY(LogLuvState* sp, tidata_t op, int n)
+{
+	int16* l16 = (int16*) sp->tbuf;
+	float* yp = (float*) op;
+
+	while (n-- > 0)
+		*l16++ = (int16) (LogL16fromY(*yp++, sp->encode_meth));
+}
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+void
+XYZtoRGB24(float xyz[3], uint8 rgb[3])
+{
+	double	r, g, b;
+					/* assume CCIR-709 primaries */
+	r =  2.690*xyz[0] + -1.276*xyz[1] + -0.414*xyz[2];
+	g = -1.022*xyz[0] +  1.978*xyz[1] +  0.044*xyz[2];
+	b =  0.061*xyz[0] + -0.224*xyz[1] +  1.163*xyz[2];
+					/* assume 2.0 gamma for speed */
+	/* could use integer sqrt approx., but this is probably faster */
+	rgb[0] = (uint8)((r<=0.) ? 0 : (r >= 1.) ? 255 : (int)(256.*sqrt(r)));
+	rgb[1] = (uint8)((g<=0.) ? 0 : (g >= 1.) ? 255 : (int)(256.*sqrt(g)));
+	rgb[2] = (uint8)((b<=0.) ? 0 : (b >= 1.) ? 255 : (int)(256.*sqrt(b)));
+}
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+double
+LogL10toY(int p10)		/* compute luminance from 10-bit LogL */
+{
+	if (p10 == 0)
+		return (0.);
+	return (exp(M_LN2/64.*(p10+.5) - M_LN2*12.));
+}
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+int
+LogL10fromY(double Y, int em)	/* get 10-bit LogL from Y */
+{
+	if (Y >= 15.742)
+		return (0x3ff);
+	else if (Y <= .00024283)
+		return (0);
+	else
+		return itrunc(64.*(log2(Y) + 12.), em);
+}
+
+#define NANGLES		100
+#define uv2ang(u, v)	( (NANGLES*.499999999/M_PI) \
+				* atan2((v)-V_NEU,(u)-U_NEU) + .5*NANGLES )
+
+static int
+oog_encode(double u, double v)		/* encode out-of-gamut chroma */
+{
+	static int	oog_table[NANGLES];
+	static int	initialized = 0;
+	register int	i;
+	
+	if (!initialized) {		/* set up perimeter table */
+		double	eps[NANGLES], ua, va, ang, epsa;
+		int	ui, vi, ustep;
+		for (i = NANGLES; i--; )
+			eps[i] = 2.;
+		for (vi = UV_NVS; vi--; ) {
+			va = UV_VSTART + (vi+.5)*UV_SQSIZ;
+			ustep = uv_row[vi].nus-1;
+			if (vi == UV_NVS-1 || vi == 0 || ustep <= 0)
+				ustep = 1;
+			for (ui = uv_row[vi].nus-1; ui >= 0; ui -= ustep) {
+				ua = uv_row[vi].ustart + (ui+.5)*UV_SQSIZ;
+				ang = uv2ang(ua, va);
+                                i = (int) ang;
+				epsa = fabs(ang - (i+.5));
+				if (epsa < eps[i]) {
+					oog_table[i] = uv_row[vi].ncum + ui;
+					eps[i] = epsa;
+				}
+			}
+		}
+		for (i = NANGLES; i--; )	/* fill any holes */
+			if (eps[i] > 1.5) {
+				int	i1, i2;
+				for (i1 = 1; i1 < NANGLES/2; i1++)
+					if (eps[(i+i1)%NANGLES] < 1.5)
+						break;
+				for (i2 = 1; i2 < NANGLES/2; i2++)
+					if (eps[(i+NANGLES-i2)%NANGLES] < 1.5)
+						break;
+				if (i1 < i2)
+					oog_table[i] =
+						oog_table[(i+i1)%NANGLES];
+				else
+					oog_table[i] =
+						oog_table[(i+NANGLES-i2)%NANGLES];
+			}
+		initialized = 1;
+	}
+	i = (int) uv2ang(u, v);		/* look up hue angle */
+	return (oog_table[i]);
+}
+
+#undef uv2ang
+#undef NANGLES
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+int
+uv_encode(double u, double v, int em)	/* encode (u',v') coordinates */
+{
+	register int	vi, ui;
+
+	if (v < UV_VSTART)
+		return oog_encode(u, v);
+	vi = itrunc((v - UV_VSTART)*(1./UV_SQSIZ), em);
+	if (vi >= UV_NVS)
+		return oog_encode(u, v);
+	if (u < uv_row[vi].ustart)
+		return oog_encode(u, v);
+	ui = itrunc((u - uv_row[vi].ustart)*(1./UV_SQSIZ), em);
+	if (ui >= uv_row[vi].nus)
+		return oog_encode(u, v);
+
+	return (uv_row[vi].ncum + ui);
+}
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+int
+uv_decode(double *up, double *vp, int c)	/* decode (u',v') index */
+{
+	int	upper, lower;
+	register int	ui, vi;
+
+	if (c < 0 || c >= UV_NDIVS)
+		return (-1);
+	lower = 0;				/* binary search */
+	upper = UV_NVS;
+	while (upper - lower > 1) {
+		vi = (lower + upper) >> 1;
+		ui = c - uv_row[vi].ncum;
+		if (ui > 0)
+			lower = vi;
+		else if (ui < 0)
+			upper = vi;
+		else {
+			lower = vi;
+			break;
+		}
+	}
+	vi = lower;
+	ui = c - uv_row[vi].ncum;
+	*up = uv_row[vi].ustart + (ui+.5)*UV_SQSIZ;
+	*vp = UV_VSTART + (vi+.5)*UV_SQSIZ;
+	return (0);
+}
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+void
+LogLuv24toXYZ(uint32 p, float XYZ[3])
+{
+	int	Ce;
+	double	L, u, v, s, x, y;
+					/* decode luminance */
+	L = LogL10toY(p>>14 & 0x3ff);
+	if (L <= 0.) {
+		XYZ[0] = XYZ[1] = XYZ[2] = 0.;
+		return;
+	}
+					/* decode color */
+	Ce = p & 0x3fff;
+	if (uv_decode(&u, &v, Ce) < 0) {
+		u = U_NEU; v = V_NEU;
+	}
+	s = 1./(6.*u - 16.*v + 12.);
+	x = 9.*u * s;
+	y = 4.*v * s;
+					/* convert to XYZ */
+	XYZ[0] = (float)(x/y * L);
+	XYZ[1] = (float)L;
+	XYZ[2] = (float)((1.-x-y)/y * L);
+}
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+uint32
+LogLuv24fromXYZ(float XYZ[3], int em)
+{
+	int	Le, Ce;
+	double	u, v, s;
+					/* encode luminance */
+	Le = LogL10fromY(XYZ[1], em);
+					/* encode color */
+	s = XYZ[0] + 15.*XYZ[1] + 3.*XYZ[2];
+	if (!Le || s <= 0.) {
+		u = U_NEU;
+		v = V_NEU;
+	} else {
+		u = 4.*XYZ[0] / s;
+		v = 9.*XYZ[1] / s;
+	}
+	Ce = uv_encode(u, v, em);
+	if (Ce < 0)			/* never happens */
+		Ce = uv_encode(U_NEU, V_NEU, SGILOGENCODE_NODITHER);
+					/* combine encodings */
+	return (Le << 14 | Ce);
+}
+
+static void
+Luv24toXYZ(LogLuvState* sp, tidata_t op, int n)
+{
+	uint32* luv = (uint32*) sp->tbuf;
+	float* xyz = (float*) op;
+
+	while (n-- > 0) {
+		LogLuv24toXYZ(*luv, xyz);
+		xyz += 3;
+		luv++;
+	}
+}
+
+static void
+Luv24toLuv48(LogLuvState* sp, tidata_t op, int n)
+{
+	uint32* luv = (uint32*) sp->tbuf;
+	int16* luv3 = (int16*) op;
+
+	while (n-- > 0) {
+		double u, v;
+
+		*luv3++ = (int16)((*luv >> 12 & 0xffd) + 13314);
+		if (uv_decode(&u, &v, *luv&0x3fff) < 0) {
+			u = U_NEU;
+			v = V_NEU;
+		}
+		*luv3++ = (int16)(u * (1L<<15));
+		*luv3++ = (int16)(v * (1L<<15));
+		luv++;
+	}
+}
+
+static void
+Luv24toRGB(LogLuvState* sp, tidata_t op, int n)
+{
+	uint32* luv = (uint32*) sp->tbuf;
+	uint8* rgb = (uint8*) op;
+
+	while (n-- > 0) {
+		float xyz[3];
+
+		LogLuv24toXYZ(*luv++, xyz);
+		XYZtoRGB24(xyz, rgb);
+		rgb += 3;
+	}
+}
+
+static void
+Luv24fromXYZ(LogLuvState* sp, tidata_t op, int n)
+{
+	uint32* luv = (uint32*) sp->tbuf;
+	float* xyz = (float*) op;
+
+	while (n-- > 0) {
+		*luv++ = LogLuv24fromXYZ(xyz, sp->encode_meth);
+		xyz += 3;
+	}
+}
+
+static void
+Luv24fromLuv48(LogLuvState* sp, tidata_t op, int n)
+{
+	uint32* luv = (uint32*) sp->tbuf;
+	int16* luv3 = (int16*) op;
+
+	while (n-- > 0) {
+		int Le, Ce;
+
+		if (luv3[0] <= 0)
+			Le = 0;
+		else if (luv3[0] >= (1<<12)+3314)
+			Le = (1<<10) - 1;
+		else if (sp->encode_meth == SGILOGENCODE_NODITHER)
+			Le = (luv3[0]-3314) >> 2;
+		else
+			Le = itrunc(.25*(luv3[0]-3314.), sp->encode_meth);
+
+		Ce = uv_encode((luv3[1]+.5)/(1<<15), (luv3[2]+.5)/(1<<15),
+					sp->encode_meth);
+		if (Ce < 0)	/* never happens */
+			Ce = uv_encode(U_NEU, V_NEU, SGILOGENCODE_NODITHER);
+		*luv++ = (uint32)Le << 14 | Ce;
+		luv3 += 3;
+	}
+}
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+void
+LogLuv32toXYZ(uint32 p, float XYZ[3])
+{
+	double	L, u, v, s, x, y;
+					/* decode luminance */
+	L = LogL16toY((int)p >> 16);
+	if (L <= 0.) {
+		XYZ[0] = XYZ[1] = XYZ[2] = 0.;
+		return;
+	}
+					/* decode color */
+	u = 1./UVSCALE * ((p>>8 & 0xff) + .5);
+	v = 1./UVSCALE * ((p & 0xff) + .5);
+	s = 1./(6.*u - 16.*v + 12.);
+	x = 9.*u * s;
+	y = 4.*v * s;
+					/* convert to XYZ */
+	XYZ[0] = (float)(x/y * L);
+	XYZ[1] = (float)L;
+	XYZ[2] = (float)((1.-x-y)/y * L);
+}
+
+#if !LOGLUV_PUBLIC
+static
+#endif
+uint32
+LogLuv32fromXYZ(float XYZ[3], int em)
+{
+	unsigned int	Le, ue, ve;
+	double	u, v, s;
+					/* encode luminance */
+	Le = (unsigned int)LogL16fromY(XYZ[1], em);
+					/* encode color */
+	s = XYZ[0] + 15.*XYZ[1] + 3.*XYZ[2];
+	if (!Le || s <= 0.) {
+		u = U_NEU;
+		v = V_NEU;
+	} else {
+		u = 4.*XYZ[0] / s;
+		v = 9.*XYZ[1] / s;
+	}
+	if (u <= 0.) ue = 0;
+	else ue = itrunc(UVSCALE*u, em);
+	if (ue > 255) ue = 255;
+	if (v <= 0.) ve = 0;
+	else ve = itrunc(UVSCALE*v, em);
+	if (ve > 255) ve = 255;
+					/* combine encodings */
+	return (Le << 16 | ue << 8 | ve);
+}
+
+static void
+Luv32toXYZ(LogLuvState* sp, tidata_t op, int n)
+{
+	uint32* luv = (uint32*) sp->tbuf;
+	float* xyz = (float*) op;
+
+	while (n-- > 0) {
+		LogLuv32toXYZ(*luv++, xyz);
+		xyz += 3;
+	}
+}
+
+static void
+Luv32toLuv48(LogLuvState* sp, tidata_t op, int n)
+{
+	uint32* luv = (uint32*) sp->tbuf;
+	int16* luv3 = (int16*) op;
+
+	while (n-- > 0) {
+		double u, v;
+
+		*luv3++ = (int16)(*luv >> 16);
+		u = 1./UVSCALE * ((*luv>>8 & 0xff) + .5);
+		v = 1./UVSCALE * ((*luv & 0xff) + .5);
+		*luv3++ = (int16)(u * (1L<<15));
+		*luv3++ = (int16)(v * (1L<<15));
+		luv++;
+	}
+}
+
+static void
+Luv32toRGB(LogLuvState* sp, tidata_t op, int n)
+{
+	uint32* luv = (uint32*) sp->tbuf;
+	uint8* rgb = (uint8*) op;
+
+	while (n-- > 0) {
+		float xyz[3];
+
+		LogLuv32toXYZ(*luv++, xyz);
+		XYZtoRGB24(xyz, rgb);
+		rgb += 3;
+	}
+}
+
+static void
+Luv32fromXYZ(LogLuvState* sp, tidata_t op, int n)
+{
+	uint32* luv = (uint32*) sp->tbuf;
+	float* xyz = (float*) op;
+
+	while (n-- > 0) {
+		*luv++ = LogLuv32fromXYZ(xyz, sp->encode_meth);
+		xyz += 3;
+	}
+}
+
+static void
+Luv32fromLuv48(LogLuvState* sp, tidata_t op, int n)
+{
+	uint32* luv = (uint32*) sp->tbuf;
+	int16* luv3 = (int16*) op;
+
+	if (sp->encode_meth == SGILOGENCODE_NODITHER) {
+		while (n-- > 0) {
+			*luv++ = (uint32)luv3[0] << 16 |
+				(luv3[1]*(uint32)(UVSCALE+.5) >> 7 & 0xff00) |
+				(luv3[2]*(uint32)(UVSCALE+.5) >> 15 & 0xff);
+			luv3 += 3;
+		}
+		return;
+	}
+	while (n-- > 0) {
+		*luv++ = (uint32)luv3[0] << 16 |
+	(itrunc(luv3[1]*(UVSCALE/(1<<15)), sp->encode_meth) << 8 & 0xff00) |
+		(itrunc(luv3[2]*(UVSCALE/(1<<15)), sp->encode_meth) & 0xff);
+		luv3 += 3;
+	}
+}
+
+static void
+_logLuvNop(LogLuvState* sp, tidata_t op, int n)
+{
+	(void) sp; (void) op; (void) n;
+}
+
+static int
+LogL16GuessDataFmt(TIFFDirectory *td)
+{
+#define	PACK(s,b,f)	(((b)<<6)|((s)<<3)|(f))
+	switch (PACK(td->td_samplesperpixel, td->td_bitspersample, td->td_sampleformat)) {
+	case PACK(1, 32, SAMPLEFORMAT_IEEEFP):
+		return (SGILOGDATAFMT_FLOAT);
+	case PACK(1, 16, SAMPLEFORMAT_VOID):
+	case PACK(1, 16, SAMPLEFORMAT_INT):
+	case PACK(1, 16, SAMPLEFORMAT_UINT):
+		return (SGILOGDATAFMT_16BIT);
+	case PACK(1,  8, SAMPLEFORMAT_VOID):
+	case PACK(1,  8, SAMPLEFORMAT_UINT):
+		return (SGILOGDATAFMT_8BIT);
+	}
+#undef PACK
+	return (SGILOGDATAFMT_UNKNOWN);
+}
+
+static uint32
+multiply(size_t m1, size_t m2)
+{
+	uint32	bytes = m1 * m2;
+
+	if (m1 && bytes / m1 != m2)
+		bytes = 0;
+
+	return bytes;
+}
+
+static int
+LogL16InitState(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	LogLuvState* sp = DecoderState(tif);
+	static const char module[] = "LogL16InitState";
+
+	assert(sp != NULL);
+	assert(td->td_photometric == PHOTOMETRIC_LOGL);
+
+	/* for some reason, we can't do this in TIFFInitLogL16 */
+	if (sp->user_datafmt == SGILOGDATAFMT_UNKNOWN)
+		sp->user_datafmt = LogL16GuessDataFmt(td);
+	switch (sp->user_datafmt) {
+	case SGILOGDATAFMT_FLOAT:
+		sp->pixel_size = sizeof (float);
+		break;
+	case SGILOGDATAFMT_16BIT:
+		sp->pixel_size = sizeof (int16);
+		break;
+	case SGILOGDATAFMT_8BIT:
+		sp->pixel_size = sizeof (uint8);
+		break;
+	default:
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "No support for converting user data format to LogL");
+		return (0);
+	}
+	sp->tbuflen = multiply(td->td_imagewidth, td->td_rowsperstrip);
+	if (multiply(sp->tbuflen, sizeof (int16)) == 0 ||
+	    (sp->tbuf = (tidata_t*) _TIFFmalloc(sp->tbuflen * sizeof (int16))) == NULL) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: No space for SGILog translation buffer",
+		    tif->tif_name);
+		return (0);
+	}
+	return (1);
+}
+
+static int
+LogLuvGuessDataFmt(TIFFDirectory *td)
+{
+	int guess;
+
+	/*
+	 * If the user didn't tell us their datafmt,
+	 * take our best guess from the bitspersample.
+	 */
+#define	PACK(a,b)	(((a)<<3)|(b))
+	switch (PACK(td->td_bitspersample, td->td_sampleformat)) {
+	case PACK(32, SAMPLEFORMAT_IEEEFP):
+		guess = SGILOGDATAFMT_FLOAT;
+		break;
+	case PACK(32, SAMPLEFORMAT_VOID):
+	case PACK(32, SAMPLEFORMAT_UINT):
+	case PACK(32, SAMPLEFORMAT_INT):
+		guess = SGILOGDATAFMT_RAW;
+		break;
+	case PACK(16, SAMPLEFORMAT_VOID):
+	case PACK(16, SAMPLEFORMAT_INT):
+	case PACK(16, SAMPLEFORMAT_UINT):
+		guess = SGILOGDATAFMT_16BIT;
+		break;
+	case PACK( 8, SAMPLEFORMAT_VOID):
+	case PACK( 8, SAMPLEFORMAT_UINT):
+		guess = SGILOGDATAFMT_8BIT;
+		break;
+	default:
+		guess = SGILOGDATAFMT_UNKNOWN;
+		break;
+#undef PACK
+	}
+	/*
+	 * Double-check samples per pixel.
+	 */
+	switch (td->td_samplesperpixel) {
+	case 1:
+		if (guess != SGILOGDATAFMT_RAW)
+			guess = SGILOGDATAFMT_UNKNOWN;
+		break;
+	case 3:
+		if (guess == SGILOGDATAFMT_RAW)
+			guess = SGILOGDATAFMT_UNKNOWN;
+		break;
+	default:
+		guess = SGILOGDATAFMT_UNKNOWN;
+		break;
+	}
+	return (guess);
+}
+
+static int
+LogLuvInitState(TIFF* tif)
+{
+	TIFFDirectory* td = &tif->tif_dir;
+	LogLuvState* sp = DecoderState(tif);
+	static const char module[] = "LogLuvInitState";
+
+	assert(sp != NULL);
+	assert(td->td_photometric == PHOTOMETRIC_LOGLUV);
+
+	/* for some reason, we can't do this in TIFFInitLogLuv */
+	if (td->td_planarconfig != PLANARCONFIG_CONTIG) {
+		TIFFErrorExt(tif->tif_clientdata, module,
+		    "SGILog compression cannot handle non-contiguous data");
+		return (0);
+	}
+	if (sp->user_datafmt == SGILOGDATAFMT_UNKNOWN)
+		sp->user_datafmt = LogLuvGuessDataFmt(td);
+	switch (sp->user_datafmt) {
+	case SGILOGDATAFMT_FLOAT:
+		sp->pixel_size = 3*sizeof (float);
+		break;
+	case SGILOGDATAFMT_16BIT:
+		sp->pixel_size = 3*sizeof (int16);
+		break;
+	case SGILOGDATAFMT_RAW:
+		sp->pixel_size = sizeof (uint32);
+		break;
+	case SGILOGDATAFMT_8BIT:
+		sp->pixel_size = 3*sizeof (uint8);
+		break;
+	default:
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "No support for converting user data format to LogLuv");
+		return (0);
+	}
+	sp->tbuflen = multiply(td->td_imagewidth, td->td_rowsperstrip);
+	if (multiply(sp->tbuflen, sizeof (uint32)) == 0 ||
+	    (sp->tbuf = (tidata_t*) _TIFFmalloc(sp->tbuflen * sizeof (uint32))) == NULL) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: No space for SGILog translation buffer",
+		    tif->tif_name);
+		return (0);
+	}
+	return (1);
+}
+
+static int
+LogLuvSetupDecode(TIFF* tif)
+{
+	LogLuvState* sp = DecoderState(tif);
+	TIFFDirectory* td = &tif->tif_dir;
+
+	tif->tif_postdecode = _TIFFNoPostDecode;
+	switch (td->td_photometric) {
+	case PHOTOMETRIC_LOGLUV:
+		if (!LogLuvInitState(tif))
+			break;
+		if (td->td_compression == COMPRESSION_SGILOG24) {
+			tif->tif_decoderow = LogLuvDecode24;
+			switch (sp->user_datafmt) {
+			case SGILOGDATAFMT_FLOAT:
+				sp->tfunc = Luv24toXYZ;
+				break;
+			case SGILOGDATAFMT_16BIT:
+				sp->tfunc = Luv24toLuv48;
+				break;
+			case SGILOGDATAFMT_8BIT:
+				sp->tfunc = Luv24toRGB;
+				break;
+			}
+		} else {
+			tif->tif_decoderow = LogLuvDecode32;
+			switch (sp->user_datafmt) {
+			case SGILOGDATAFMT_FLOAT:
+				sp->tfunc = Luv32toXYZ;
+				break;
+			case SGILOGDATAFMT_16BIT:
+				sp->tfunc = Luv32toLuv48;
+				break;
+			case SGILOGDATAFMT_8BIT:
+				sp->tfunc = Luv32toRGB;
+				break;
+			}
+		}
+		return (1);
+	case PHOTOMETRIC_LOGL:
+		if (!LogL16InitState(tif))
+			break;
+		tif->tif_decoderow = LogL16Decode;
+		switch (sp->user_datafmt) {
+		case SGILOGDATAFMT_FLOAT:
+			sp->tfunc = L16toY;
+			break;
+		case SGILOGDATAFMT_8BIT:
+			sp->tfunc = L16toGry;
+			break;
+		}
+		return (1);
+	default:
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+    "Inappropriate photometric interpretation %d for SGILog compression; %s",
+		    td->td_photometric, "must be either LogLUV or LogL");
+		break;
+	}
+	return (0);
+}
+
+static int
+LogLuvSetupEncode(TIFF* tif)
+{
+	LogLuvState* sp = EncoderState(tif);
+	TIFFDirectory* td = &tif->tif_dir;
+
+	switch (td->td_photometric) {
+	case PHOTOMETRIC_LOGLUV:
+		if (!LogLuvInitState(tif))
+			break;
+		if (td->td_compression == COMPRESSION_SGILOG24) {
+			tif->tif_encoderow = LogLuvEncode24;
+			switch (sp->user_datafmt) {
+			case SGILOGDATAFMT_FLOAT:
+				sp->tfunc = Luv24fromXYZ;
+				break;
+			case SGILOGDATAFMT_16BIT:
+				sp->tfunc = Luv24fromLuv48;
+				break;
+			case SGILOGDATAFMT_RAW:
+				break;
+			default:
+				goto notsupported;
+			}
+		} else {
+			tif->tif_encoderow = LogLuvEncode32;
+			switch (sp->user_datafmt) {
+			case SGILOGDATAFMT_FLOAT:
+				sp->tfunc = Luv32fromXYZ;
+				break;
+			case SGILOGDATAFMT_16BIT:
+				sp->tfunc = Luv32fromLuv48;
+				break;
+			case SGILOGDATAFMT_RAW:
+				break;
+			default:
+				goto notsupported;
+			}
+		}
+		break;
+	case PHOTOMETRIC_LOGL:
+		if (!LogL16InitState(tif))
+			break;
+		tif->tif_encoderow = LogL16Encode;
+		switch (sp->user_datafmt) {
+		case SGILOGDATAFMT_FLOAT:
+			sp->tfunc = L16fromY;
+			break;
+		case SGILOGDATAFMT_16BIT:
+			break;
+		default:
+			goto notsupported;
+		}
+		break;
+	default:
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+    "Inappropriate photometric interpretation %d for SGILog compression; %s",
+    		    td->td_photometric, "must be either LogLUV or LogL");
+		break;
+	}
+	return (1);
+notsupported:
+	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+	    "SGILog compression supported only for %s, or raw data",
+	    td->td_photometric == PHOTOMETRIC_LOGL ? "Y, L" : "XYZ, Luv");
+	return (0);
+}
+
+static void
+LogLuvClose(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+
+	/*
+	 * For consistency, we always want to write out the same
+	 * bitspersample and sampleformat for our TIFF file,
+	 * regardless of the data format being used by the application.
+	 * Since this routine is called after tags have been set but
+	 * before they have been recorded in the file, we reset them here.
+	 */
+	td->td_samplesperpixel =
+	    (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3;
+	td->td_bitspersample = 16;
+	td->td_sampleformat = SAMPLEFORMAT_INT;
+}
+
+static void
+LogLuvCleanup(TIFF* tif)
+{
+	LogLuvState* sp = (LogLuvState *)tif->tif_data;
+
+	assert(sp != 0);
+
+	tif->tif_tagmethods.vgetfield = sp->vgetparent;
+	tif->tif_tagmethods.vsetfield = sp->vsetparent;
+
+	if (sp->tbuf)
+		_TIFFfree(sp->tbuf);
+	_TIFFfree(sp);
+	tif->tif_data = NULL;
+
+	_TIFFSetDefaultCompressionState(tif);
+}
+
+static int
+LogLuvVSetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	LogLuvState* sp = DecoderState(tif);
+	int bps, fmt;
+
+	switch (tag) {
+	case TIFFTAG_SGILOGDATAFMT:
+		sp->user_datafmt = va_arg(ap, int);
+		/*
+		 * Tweak the TIFF header so that the rest of libtiff knows what
+		 * size of data will be passed between app and library, and
+		 * assume that the app knows what it is doing and is not
+		 * confused by these header manipulations...
+		 */
+		switch (sp->user_datafmt) {
+		case SGILOGDATAFMT_FLOAT:
+			bps = 32, fmt = SAMPLEFORMAT_IEEEFP;
+			break;
+		case SGILOGDATAFMT_16BIT:
+			bps = 16, fmt = SAMPLEFORMAT_INT;
+			break;
+		case SGILOGDATAFMT_RAW:
+			bps = 32, fmt = SAMPLEFORMAT_UINT;
+			TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
+			break;
+		case SGILOGDATAFMT_8BIT:
+			bps = 8, fmt = SAMPLEFORMAT_UINT;
+			break;
+		default:
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			    "Unknown data format %d for LogLuv compression",
+			    sp->user_datafmt);
+			return (0);
+		}
+		TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps);
+		TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, fmt);
+		/*
+		 * Must recalculate sizes should bits/sample change.
+		 */
+		tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (tsize_t) -1;
+		tif->tif_scanlinesize = TIFFScanlineSize(tif);
+		return (1);
+	case TIFFTAG_SGILOGENCODE:
+		sp->encode_meth = va_arg(ap, int);
+		if (sp->encode_meth != SGILOGENCODE_NODITHER &&
+				sp->encode_meth != SGILOGENCODE_RANDITHER) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+				"Unknown encoding %d for LogLuv compression",
+				sp->encode_meth);
+			return (0);
+		}
+		return (1);
+	default:
+		return (*sp->vsetparent)(tif, tag, ap);
+	}
+}
+
+static int
+LogLuvVGetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	LogLuvState *sp = (LogLuvState *)tif->tif_data;
+
+	switch (tag) {
+	case TIFFTAG_SGILOGDATAFMT:
+		*va_arg(ap, int*) = sp->user_datafmt;
+		return (1);
+	default:
+		return (*sp->vgetparent)(tif, tag, ap);
+	}
+}
+
+static const TIFFFieldInfo LogLuvFieldInfo[] = {
+    { TIFFTAG_SGILOGDATAFMT,	  0, 0,	TIFF_SHORT,	FIELD_PSEUDO,
+      TRUE,	FALSE,	"SGILogDataFmt"},
+    { TIFFTAG_SGILOGENCODE,	  0, 0, TIFF_SHORT,	FIELD_PSEUDO,
+      TRUE,	FALSE,	"SGILogEncode"}
+};
+
+int
+TIFFInitSGILog(TIFF* tif, int scheme)
+{
+	static const char module[] = "TIFFInitSGILog";
+	LogLuvState* sp;
+
+	assert(scheme == COMPRESSION_SGILOG24 || scheme == COMPRESSION_SGILOG);
+
+	/*
+	 * Allocate state block so tag methods have storage to record values.
+	 */
+	tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (LogLuvState));
+	if (tif->tif_data == NULL)
+		goto bad;
+	sp = (LogLuvState*) tif->tif_data;
+	_TIFFmemset((tdata_t)sp, 0, sizeof (*sp));
+	sp->user_datafmt = SGILOGDATAFMT_UNKNOWN;
+	sp->encode_meth = (scheme == COMPRESSION_SGILOG24) ?
+				SGILOGENCODE_RANDITHER : SGILOGENCODE_NODITHER;
+	sp->tfunc = _logLuvNop;
+
+	/*
+	 * Install codec methods.
+	 * NB: tif_decoderow & tif_encoderow are filled
+	 *     in at setup time.
+	 */
+	tif->tif_setupdecode = LogLuvSetupDecode;
+	tif->tif_decodestrip = LogLuvDecodeStrip;
+	tif->tif_decodetile = LogLuvDecodeTile;
+	tif->tif_setupencode = LogLuvSetupEncode;
+	tif->tif_encodestrip = LogLuvEncodeStrip;
+	tif->tif_encodetile = LogLuvEncodeTile;
+	tif->tif_close = LogLuvClose;
+	tif->tif_cleanup = LogLuvCleanup;
+
+	/* override SetField so we can handle our private pseudo-tag */
+	_TIFFMergeFieldInfo(tif, LogLuvFieldInfo,
+			    TIFFArrayCount(LogLuvFieldInfo));
+	sp->vgetparent = tif->tif_tagmethods.vgetfield;
+	tif->tif_tagmethods.vgetfield = LogLuvVGetField;   /* hook for codec tags */
+	sp->vsetparent = tif->tif_tagmethods.vsetfield;
+	tif->tif_tagmethods.vsetfield = LogLuvVSetField;   /* hook for codec tags */
+
+	return (1);
+bad:
+	TIFFErrorExt(tif->tif_clientdata, module,
+		     "%s: No space for LogLuv state block", tif->tif_name);
+	return (0);
+}
+#endif /* LOGLUV_SUPPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_lzw.c b/src/tiff/tif_lzw.c
new file mode 100644
index 0000000..ad525cc
--- /dev/null
+++ b/src/tiff/tif_lzw.c
@@ -0,0 +1,1084 @@
+/* $Id: tif_lzw.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#include "tiffiop.h"
+#ifdef LZW_SUPPORT
+/*
+ * TIFF Library.
+ * Rev 5.0 Lempel-Ziv & Welch Compression Support
+ *
+ * This code is derived from the compress program whose code is
+ * derived from software contributed to Berkeley by James A. Woods,
+ * derived from original work by Spencer Thomas and Joseph Orost.
+ *
+ * The original Berkeley copyright notice appears below in its entirety.
+ */
+#include "tif_predict.h"
+
+#include <stdio.h>
+
+/*
+ * NB: The 5.0 spec describes a different algorithm than Aldus
+ *     implements.  Specifically, Aldus does code length transitions
+ *     one code earlier than should be done (for real LZW).
+ *     Earlier versions of this library implemented the correct
+ *     LZW algorithm, but emitted codes in a bit order opposite
+ *     to the TIFF spec.  Thus, to maintain compatibility w/ Aldus
+ *     we interpret MSB-LSB ordered codes to be images written w/
+ *     old versions of this library, but otherwise adhere to the
+ *     Aldus "off by one" algorithm.
+ *
+ * Future revisions to the TIFF spec are expected to "clarify this issue".
+ */
+#define	LZW_COMPAT		/* include backwards compatibility code */
+/*
+ * Each strip of data is supposed to be terminated by a CODE_EOI.
+ * If the following #define is included, the decoder will also
+ * check for end-of-strip w/o seeing this code.  This makes the
+ * library more robust, but also slower.
+ */
+#define	LZW_CHECKEOS		/* include checks for strips w/o EOI code */
+
+#define MAXCODE(n)	((1L<<(n))-1)
+/*
+ * The TIFF spec specifies that encoded bit
+ * strings range from 9 to 12 bits.
+ */
+#define	BITS_MIN	9		/* start with 9 bits */
+#define	BITS_MAX	12		/* max of 12 bit strings */
+/* predefined codes */
+#define	CODE_CLEAR	256		/* code to clear string table */
+#define	CODE_EOI	257		/* end-of-information code */
+#define CODE_FIRST	258		/* first free code entry */
+#define	CODE_MAX	MAXCODE(BITS_MAX)
+#define	HSIZE		9001L		/* 91% occupancy */
+#define	HSHIFT		(13-8)
+#ifdef LZW_COMPAT
+/* NB: +1024 is for compatibility with old files */
+#define	CSIZE		(MAXCODE(BITS_MAX)+1024L)
+#else
+#define	CSIZE		(MAXCODE(BITS_MAX)+1L)
+#endif
+
+/*
+ * State block for each open TIFF file using LZW
+ * compression/decompression.  Note that the predictor
+ * state block must be first in this data structure.
+ */
+typedef	struct {
+	TIFFPredictorState predict;	/* predictor super class */
+
+	unsigned short	nbits;		/* # of bits/code */
+	unsigned short	maxcode;	/* maximum code for lzw_nbits */
+	unsigned short	free_ent;	/* next free entry in hash table */
+	long		nextdata;	/* next bits of i/o */
+	long		nextbits;	/* # of valid bits in lzw_nextdata */
+
+        int             rw_mode;        /* preserve rw_mode from init */
+} LZWBaseState;
+
+#define	lzw_nbits	base.nbits
+#define	lzw_maxcode	base.maxcode
+#define	lzw_free_ent	base.free_ent
+#define	lzw_nextdata	base.nextdata
+#define	lzw_nextbits	base.nextbits
+
+/*
+ * Encoding-specific state.
+ */
+typedef uint16 hcode_t;			/* codes fit in 16 bits */
+typedef struct {
+	long	hash;
+	hcode_t	code;
+} hash_t;
+
+/*
+ * Decoding-specific state.
+ */
+typedef struct code_ent {
+	struct code_ent *next;
+	unsigned short	length;		/* string len, including this token */
+	unsigned char	value;		/* data value */
+	unsigned char	firstchar;	/* first token of string */
+} code_t;
+
+typedef	int (*decodeFunc)(TIFF*, tidata_t, tsize_t, tsample_t);
+
+typedef struct {
+	LZWBaseState base;
+
+	/* Decoding specific data */
+	long	dec_nbitsmask;		/* lzw_nbits 1 bits, right adjusted */
+	long	dec_restart;		/* restart count */
+#ifdef LZW_CHECKEOS
+	long	dec_bitsleft;		/* available bits in raw data */
+#endif
+	decodeFunc dec_decode;		/* regular or backwards compatible */
+	code_t*	dec_codep;		/* current recognized code */
+	code_t*	dec_oldcodep;		/* previously recognized code */
+	code_t*	dec_free_entp;		/* next free entry */
+	code_t*	dec_maxcodep;		/* max available entry */
+	code_t*	dec_codetab;		/* kept separate for small machines */
+
+	/* Encoding specific data */
+	int	enc_oldcode;		/* last code encountered */
+	long	enc_checkpoint;		/* point at which to clear table */
+#define CHECK_GAP	10000		/* enc_ratio check interval */
+	long	enc_ratio;		/* current compression ratio */
+	long	enc_incount;		/* (input) data bytes encoded */
+	long	enc_outcount;		/* encoded (output) bytes */
+	tidata_t enc_rawlimit;		/* bound on tif_rawdata buffer */
+	hash_t*	enc_hashtab;		/* kept separate for small machines */
+} LZWCodecState;
+
+#define	LZWState(tif)		((LZWBaseState*) (tif)->tif_data)
+#define	DecoderState(tif)	((LZWCodecState*) LZWState(tif))
+#define	EncoderState(tif)	((LZWCodecState*) LZWState(tif))
+
+static	int LZWDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+#ifdef LZW_COMPAT
+static	int LZWDecodeCompat(TIFF*, tidata_t, tsize_t, tsample_t);
+#endif
+static  void cl_hash(LZWCodecState*);
+
+/*
+ * LZW Decoder.
+ */
+
+#ifdef LZW_CHECKEOS
+/*
+ * This check shouldn't be necessary because each
+ * strip is suppose to be terminated with CODE_EOI.
+ */
+#define	NextCode(_tif, _sp, _bp, _code, _get) {				\
+	if ((_sp)->dec_bitsleft < nbits) {				\
+		TIFFWarningExt(_tif->tif_clientdata, _tif->tif_name,				\
+		    "LZWDecode: Strip %d not terminated with EOI code", \
+		    _tif->tif_curstrip);				\
+		_code = CODE_EOI;					\
+	} else {							\
+		_get(_sp,_bp,_code);					\
+		(_sp)->dec_bitsleft -= nbits;				\
+	}								\
+}
+#else
+#define	NextCode(tif, sp, bp, code, get) get(sp, bp, code)
+#endif
+
+static int
+LZWSetupDecode(TIFF* tif)
+{
+	LZWCodecState* sp = DecoderState(tif);
+	static const char module[] = " LZWSetupDecode";
+	int code;
+
+        if( sp == NULL )
+        {
+            /*
+             * Allocate state block so tag methods have storage to record 
+			 * values.
+             */
+            tif->tif_data = (tidata_t) _TIFFmalloc(sizeof(LZWCodecState));
+            if (tif->tif_data == NULL)
+            {
+				TIFFErrorExt(tif->tif_clientdata, "LZWPreDecode", "No space for LZW state block");
+                return (0);
+            }
+
+            DecoderState(tif)->dec_codetab = NULL;
+            DecoderState(tif)->dec_decode = NULL;
+            
+            /*
+             * Setup predictor setup.
+             */
+            (void) TIFFPredictorInit(tif);
+
+            sp = DecoderState(tif);
+        }
+            
+	assert(sp != NULL);
+
+	if (sp->dec_codetab == NULL) {
+		sp->dec_codetab = (code_t*)_TIFFmalloc(CSIZE*sizeof (code_t));
+		if (sp->dec_codetab == NULL) {
+			TIFFErrorExt(tif->tif_clientdata, module, "No space for LZW code table");
+			return (0);
+		}
+		/*
+		 * Pre-load the table.
+		 */
+                code = 255;
+                do {
+                    sp->dec_codetab[code].value = code;
+                    sp->dec_codetab[code].firstchar = code;
+                    sp->dec_codetab[code].length = 1;
+                    sp->dec_codetab[code].next = NULL;
+                } while (code--);
+	}
+	return (1);
+}
+
+/*
+ * Setup state for decoding a strip.
+ */
+static int
+LZWPreDecode(TIFF* tif, tsample_t s)
+{
+	LZWCodecState *sp = DecoderState(tif);
+
+	(void) s;
+	assert(sp != NULL);
+	/*
+	 * Check for old bit-reversed codes.
+	 */
+	if (tif->tif_rawdata[0] == 0 && (tif->tif_rawdata[1] & 0x1)) {
+#ifdef LZW_COMPAT
+		if (!sp->dec_decode) {
+			TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+			    "Old-style LZW codes, convert file");
+			/*
+			 * Override default decoding methods with
+			 * ones that deal with the old coding.
+			 * Otherwise the predictor versions set
+			 * above will call the compatibility routines
+			 * through the dec_decode method.
+			 */
+			tif->tif_decoderow = LZWDecodeCompat;
+			tif->tif_decodestrip = LZWDecodeCompat;
+			tif->tif_decodetile = LZWDecodeCompat;
+			/*
+			 * If doing horizontal differencing, must
+			 * re-setup the predictor logic since we
+			 * switched the basic decoder methods...
+			 */
+			(*tif->tif_setupdecode)(tif);
+			sp->dec_decode = LZWDecodeCompat;
+		}
+		sp->lzw_maxcode = MAXCODE(BITS_MIN);
+#else /* !LZW_COMPAT */
+		if (!sp->dec_decode) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			    "Old-style LZW codes not supported");
+			sp->dec_decode = LZWDecode;
+		}
+		return (0);
+#endif/* !LZW_COMPAT */
+	} else {
+		sp->lzw_maxcode = MAXCODE(BITS_MIN)-1;
+		sp->dec_decode = LZWDecode;
+	}
+	sp->lzw_nbits = BITS_MIN;
+	sp->lzw_nextbits = 0;
+	sp->lzw_nextdata = 0;
+
+	sp->dec_restart = 0;
+	sp->dec_nbitsmask = MAXCODE(BITS_MIN);
+#ifdef LZW_CHECKEOS
+	sp->dec_bitsleft = tif->tif_rawcc << 3;
+#endif
+	sp->dec_free_entp = sp->dec_codetab + CODE_FIRST;
+	/*
+	 * Zero entries that are not yet filled in.  We do
+	 * this to guard against bogus input data that causes
+	 * us to index into undefined entries.  If you can
+	 * come up with a way to safely bounds-check input codes
+	 * while decoding then you can remove this operation.
+	 */
+	_TIFFmemset(sp->dec_free_entp, 0, (CSIZE-CODE_FIRST)*sizeof (code_t));
+	sp->dec_oldcodep = &sp->dec_codetab[-1];
+	sp->dec_maxcodep = &sp->dec_codetab[sp->dec_nbitsmask-1];
+	return (1);
+}
+
+/*
+ * Decode a "hunk of data".
+ */
+#define	GetNextCode(sp, bp, code) {				\
+	nextdata = (nextdata<<8) | *(bp)++;			\
+	nextbits += 8;						\
+	if (nextbits < nbits) {					\
+		nextdata = (nextdata<<8) | *(bp)++;		\
+		nextbits += 8;					\
+	}							\
+	code = (hcode_t)((nextdata >> (nextbits-nbits)) & nbitsmask);	\
+	nextbits -= nbits;					\
+}
+
+static void
+codeLoop(TIFF* tif)
+{
+	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+	    "LZWDecode: Bogus encoding, loop in the code table; scanline %d",
+	    tif->tif_row);
+}
+
+static int
+LZWDecode(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s)
+{
+	LZWCodecState *sp = DecoderState(tif);
+	char *op = (char*) op0;
+	long occ = (long) occ0;
+	char *tp;
+	unsigned char *bp;
+	hcode_t code;
+	int len;
+	long nbits, nextbits, nextdata, nbitsmask;
+	code_t *codep, *free_entp, *maxcodep, *oldcodep;
+
+	(void) s;
+	assert(sp != NULL);
+	/*
+	 * Restart interrupted output operation.
+	 */
+	if (sp->dec_restart) {
+		long residue;
+
+		codep = sp->dec_codep;
+		residue = codep->length - sp->dec_restart;
+		if (residue > occ) {
+			/*
+			 * Residue from previous decode is sufficient
+			 * to satisfy decode request.  Skip to the
+			 * start of the decoded string, place decoded
+			 * values in the output buffer, and return.
+			 */
+			sp->dec_restart += occ;
+			do {
+				codep = codep->next;
+			} while (--residue > occ && codep);
+			if (codep) {
+				tp = op + occ;
+				do {
+					*--tp = codep->value;
+					codep = codep->next;
+				} while (--occ && codep);
+			}
+			return (1);
+		}
+		/*
+		 * Residue satisfies only part of the decode request.
+		 */
+		op += residue, occ -= residue;
+		tp = op;
+		do {
+			int t;
+			--tp;
+			t = codep->value;
+			codep = codep->next;
+			*tp = t;
+		} while (--residue && codep);
+		sp->dec_restart = 0;
+	}
+
+	bp = (unsigned char *)tif->tif_rawcp;
+	nbits = sp->lzw_nbits;
+	nextdata = sp->lzw_nextdata;
+	nextbits = sp->lzw_nextbits;
+	nbitsmask = sp->dec_nbitsmask;
+	oldcodep = sp->dec_oldcodep;
+	free_entp = sp->dec_free_entp;
+	maxcodep = sp->dec_maxcodep;
+
+	while (occ > 0) {
+		NextCode(tif, sp, bp, code, GetNextCode);
+		if (code == CODE_EOI)
+			break;
+		if (code == CODE_CLEAR) {
+			free_entp = sp->dec_codetab + CODE_FIRST;
+			nbits = BITS_MIN;
+			nbitsmask = MAXCODE(BITS_MIN);
+			maxcodep = sp->dec_codetab + nbitsmask-1;
+			NextCode(tif, sp, bp, code, GetNextCode);
+			if (code == CODE_EOI)
+				break;
+			*op++ = (char)code, occ--;
+			oldcodep = sp->dec_codetab + code;
+			continue;
+		}
+		codep = sp->dec_codetab + code;
+
+		/*
+	 	 * Add the new entry to the code table.
+	 	 */
+		if (free_entp < &sp->dec_codetab[0] ||
+			free_entp >= &sp->dec_codetab[CSIZE]) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			"LZWDecode: Corrupted LZW table at scanline %d",
+			tif->tif_row);
+			return (0);
+		}
+
+		free_entp->next = oldcodep;
+		if (free_entp->next < &sp->dec_codetab[0] ||
+			free_entp->next >= &sp->dec_codetab[CSIZE]) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			"LZWDecode: Corrupted LZW table at scanline %d",
+			tif->tif_row);
+			return (0);
+		}
+		free_entp->firstchar = free_entp->next->firstchar;
+		free_entp->length = free_entp->next->length+1;
+		free_entp->value = (codep < free_entp) ?
+		    codep->firstchar : free_entp->firstchar;
+		if (++free_entp > maxcodep) {
+			if (++nbits > BITS_MAX)		/* should not happen */
+				nbits = BITS_MAX;
+			nbitsmask = MAXCODE(nbits);
+			maxcodep = sp->dec_codetab + nbitsmask-1;
+		}
+		oldcodep = codep;
+		if (code >= 256) {
+			/*
+		 	 * Code maps to a string, copy string
+			 * value to output (written in reverse).
+		 	 */
+			if(codep->length == 0) {
+				TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+	    		    "LZWDecode: Wrong length of decoded string: "
+			    "data probably corrupted at scanline %d",
+			    tif->tif_row);	
+			    return (0);
+			}
+			if (codep->length > occ) {
+				/*
+				 * String is too long for decode buffer,
+				 * locate portion that will fit, copy to
+				 * the decode buffer, and setup restart
+				 * logic for the next decoding call.
+				 */
+				sp->dec_codep = codep;
+				do {
+					codep = codep->next;
+				} while (codep && codep->length > occ);
+				if (codep) {
+					sp->dec_restart = occ;
+					tp = op + occ;
+					do  {
+						*--tp = codep->value;
+						codep = codep->next;
+					}  while (--occ && codep);
+					if (codep)
+						codeLoop(tif);
+				}
+				break;
+			}
+			len = codep->length;
+			tp = op + len;
+			do {
+				int t;
+				--tp;
+				t = codep->value;
+				codep = codep->next;
+				*tp = t;
+			} while (codep && tp > op);
+			if (codep) {
+			    codeLoop(tif);
+			    break;
+			}
+			op += len, occ -= len;
+		} else
+			*op++ = (char)code, occ--;
+	}
+
+	tif->tif_rawcp = (tidata_t) bp;
+	sp->lzw_nbits = (unsigned short) nbits;
+	sp->lzw_nextdata = nextdata;
+	sp->lzw_nextbits = nextbits;
+	sp->dec_nbitsmask = nbitsmask;
+	sp->dec_oldcodep = oldcodep;
+	sp->dec_free_entp = free_entp;
+	sp->dec_maxcodep = maxcodep;
+
+	if (occ > 0) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		"LZWDecode: Not enough data at scanline %d (short %d bytes)",
+		    tif->tif_row, occ);
+		return (0);
+	}
+	return (1);
+}
+
+#ifdef LZW_COMPAT
+/*
+ * Decode a "hunk of data" for old images.
+ */
+#define	GetNextCodeCompat(sp, bp, code) {			\
+	nextdata |= (unsigned long) *(bp)++ << nextbits;	\
+	nextbits += 8;						\
+	if (nextbits < nbits) {					\
+		nextdata |= (unsigned long) *(bp)++ << nextbits;\
+		nextbits += 8;					\
+	}							\
+	code = (hcode_t)(nextdata & nbitsmask);			\
+	nextdata >>= nbits;					\
+	nextbits -= nbits;					\
+}
+
+static int
+LZWDecodeCompat(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s)
+{
+	LZWCodecState *sp = DecoderState(tif);
+	char *op = (char*) op0;
+	long occ = (long) occ0;
+	char *tp;
+	unsigned char *bp;
+	int code, nbits;
+	long nextbits, nextdata, nbitsmask;
+	code_t *codep, *free_entp, *maxcodep, *oldcodep;
+
+	(void) s;
+	assert(sp != NULL);
+	/*
+	 * Restart interrupted output operation.
+	 */
+	if (sp->dec_restart) {
+		long residue;
+
+		codep = sp->dec_codep;
+		residue = codep->length - sp->dec_restart;
+		if (residue > occ) {
+			/*
+			 * Residue from previous decode is sufficient
+			 * to satisfy decode request.  Skip to the
+			 * start of the decoded string, place decoded
+			 * values in the output buffer, and return.
+			 */
+			sp->dec_restart += occ;
+			do {
+				codep = codep->next;
+			} while (--residue > occ);
+			tp = op + occ;
+			do {
+				*--tp = codep->value;
+				codep = codep->next;
+			} while (--occ);
+			return (1);
+		}
+		/*
+		 * Residue satisfies only part of the decode request.
+		 */
+		op += residue, occ -= residue;
+		tp = op;
+		do {
+			*--tp = codep->value;
+			codep = codep->next;
+		} while (--residue);
+		sp->dec_restart = 0;
+	}
+
+	bp = (unsigned char *)tif->tif_rawcp;
+	nbits = sp->lzw_nbits;
+	nextdata = sp->lzw_nextdata;
+	nextbits = sp->lzw_nextbits;
+	nbitsmask = sp->dec_nbitsmask;
+	oldcodep = sp->dec_oldcodep;
+	free_entp = sp->dec_free_entp;
+	maxcodep = sp->dec_maxcodep;
+
+	while (occ > 0) {
+		NextCode(tif, sp, bp, code, GetNextCodeCompat);
+		if (code == CODE_EOI)
+			break;
+		if (code == CODE_CLEAR) {
+			free_entp = sp->dec_codetab + CODE_FIRST;
+			nbits = BITS_MIN;
+			nbitsmask = MAXCODE(BITS_MIN);
+			maxcodep = sp->dec_codetab + nbitsmask;
+			NextCode(tif, sp, bp, code, GetNextCodeCompat);
+			if (code == CODE_EOI)
+				break;
+			*op++ = code, occ--;
+			oldcodep = sp->dec_codetab + code;
+			continue;
+		}
+		codep = sp->dec_codetab + code;
+
+		/*
+	 	 * Add the new entry to the code table.
+	 	 */
+		if (free_entp < &sp->dec_codetab[0] ||
+			free_entp >= &sp->dec_codetab[CSIZE]) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			"LZWDecodeCompat: Corrupted LZW table at scanline %d",
+			tif->tif_row);
+			return (0);
+		}
+
+		free_entp->next = oldcodep;
+		if (free_entp->next < &sp->dec_codetab[0] ||
+			free_entp->next >= &sp->dec_codetab[CSIZE]) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			"LZWDecodeCompat: Corrupted LZW table at scanline %d",
+			tif->tif_row);
+			return (0);
+		}
+		free_entp->firstchar = free_entp->next->firstchar;
+		free_entp->length = free_entp->next->length+1;
+		free_entp->value = (codep < free_entp) ?
+		    codep->firstchar : free_entp->firstchar;
+		if (++free_entp > maxcodep) {
+			if (++nbits > BITS_MAX)		/* should not happen */
+				nbits = BITS_MAX;
+			nbitsmask = MAXCODE(nbits);
+			maxcodep = sp->dec_codetab + nbitsmask;
+		}
+		oldcodep = codep;
+		if (code >= 256) {
+			/*
+		 	 * Code maps to a string, copy string
+			 * value to output (written in reverse).
+		 	 */
+			if(codep->length == 0) {
+				TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+	    		    "LZWDecodeCompat: Wrong length of decoded "
+			    "string: data probably corrupted at scanline %d",
+			    tif->tif_row);	
+			    return (0);
+			}
+			if (codep->length > occ) {
+				/*
+				 * String is too long for decode buffer,
+				 * locate portion that will fit, copy to
+				 * the decode buffer, and setup restart
+				 * logic for the next decoding call.
+				 */
+				sp->dec_codep = codep;
+				do {
+					codep = codep->next;
+				} while (codep->length > occ);
+				sp->dec_restart = occ;
+				tp = op + occ;
+				do  {
+					*--tp = codep->value;
+					codep = codep->next;
+				}  while (--occ);
+				break;
+			}
+			op += codep->length, occ -= codep->length;
+			tp = op;
+			do {
+				*--tp = codep->value;
+			} while( (codep = codep->next) != NULL);
+		} else
+			*op++ = code, occ--;
+	}
+
+	tif->tif_rawcp = (tidata_t) bp;
+	sp->lzw_nbits = nbits;
+	sp->lzw_nextdata = nextdata;
+	sp->lzw_nextbits = nextbits;
+	sp->dec_nbitsmask = nbitsmask;
+	sp->dec_oldcodep = oldcodep;
+	sp->dec_free_entp = free_entp;
+	sp->dec_maxcodep = maxcodep;
+
+	if (occ > 0) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+	    "LZWDecodeCompat: Not enough data at scanline %d (short %d bytes)",
+		    tif->tif_row, occ);
+		return (0);
+	}
+	return (1);
+}
+#endif /* LZW_COMPAT */
+
+/*
+ * LZW Encoding.
+ */
+
+static int
+LZWSetupEncode(TIFF* tif)
+{
+	LZWCodecState* sp = EncoderState(tif);
+	static const char module[] = "LZWSetupEncode";
+
+	assert(sp != NULL);
+	sp->enc_hashtab = (hash_t*) _TIFFmalloc(HSIZE*sizeof (hash_t));
+	if (sp->enc_hashtab == NULL) {
+		TIFFErrorExt(tif->tif_clientdata, module, "No space for LZW hash table");
+		return (0);
+	}
+	return (1);
+}
+
+/*
+ * Reset encoding state at the start of a strip.
+ */
+static int
+LZWPreEncode(TIFF* tif, tsample_t s)
+{
+	LZWCodecState *sp = EncoderState(tif);
+
+	(void) s;
+	assert(sp != NULL);
+	sp->lzw_nbits = BITS_MIN;
+	sp->lzw_maxcode = MAXCODE(BITS_MIN);
+	sp->lzw_free_ent = CODE_FIRST;
+	sp->lzw_nextbits = 0;
+	sp->lzw_nextdata = 0;
+	sp->enc_checkpoint = CHECK_GAP;
+	sp->enc_ratio = 0;
+	sp->enc_incount = 0;
+	sp->enc_outcount = 0;
+	/*
+	 * The 4 here insures there is space for 2 max-sized
+	 * codes in LZWEncode and LZWPostDecode.
+	 */
+	sp->enc_rawlimit = tif->tif_rawdata + tif->tif_rawdatasize-1 - 4;
+	cl_hash(sp);		/* clear hash table */
+	sp->enc_oldcode = (hcode_t) -1;	/* generates CODE_CLEAR in LZWEncode */
+	return (1);
+}
+
+#define	CALCRATIO(sp, rat) {					\
+	if (incount > 0x007fffff) { /* NB: shift will overflow */\
+		rat = outcount >> 8;				\
+		rat = (rat == 0 ? 0x7fffffff : incount/rat);	\
+	} else							\
+		rat = (incount<<8) / outcount;			\
+}
+#define	PutNextCode(op, c) {					\
+	nextdata = (nextdata << nbits) | c;			\
+	nextbits += nbits;					\
+	*op++ = (unsigned char)(nextdata >> (nextbits-8));		\
+	nextbits -= 8;						\
+	if (nextbits >= 8) {					\
+		*op++ = (unsigned char)(nextdata >> (nextbits-8));	\
+		nextbits -= 8;					\
+	}							\
+	outcount += nbits;					\
+}
+
+/*
+ * Encode a chunk of pixels.
+ *
+ * Uses an open addressing double hashing (no chaining) on the 
+ * prefix code/next character combination.  We do a variant of
+ * Knuth's algorithm D (vol. 3, sec. 6.4) along with G. Knott's
+ * relatively-prime secondary probe.  Here, the modular division
+ * first probe is gives way to a faster exclusive-or manipulation. 
+ * Also do block compression with an adaptive reset, whereby the
+ * code table is cleared when the compression ratio decreases,
+ * but after the table fills.  The variable-length output codes
+ * are re-sized at this point, and a CODE_CLEAR is generated
+ * for the decoder. 
+ */
+static int
+LZWEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	register LZWCodecState *sp = EncoderState(tif);
+	register long fcode;
+	register hash_t *hp;
+	register int h, c;
+	hcode_t ent;
+	long disp;
+	long incount, outcount, checkpoint;
+	long nextdata, nextbits;
+	int free_ent, maxcode, nbits;
+	tidata_t op, limit;
+
+	(void) s;
+	if (sp == NULL)
+		return (0);
+	/*
+	 * Load local state.
+	 */
+	incount = sp->enc_incount;
+	outcount = sp->enc_outcount;
+	checkpoint = sp->enc_checkpoint;
+	nextdata = sp->lzw_nextdata;
+	nextbits = sp->lzw_nextbits;
+	free_ent = sp->lzw_free_ent;
+	maxcode = sp->lzw_maxcode;
+	nbits = sp->lzw_nbits;
+	op = tif->tif_rawcp;
+	limit = sp->enc_rawlimit;
+	ent = sp->enc_oldcode;
+
+	if (ent == (hcode_t) -1 && cc > 0) {
+		/*
+		 * NB: This is safe because it can only happen
+		 *     at the start of a strip where we know there
+		 *     is space in the data buffer.
+		 */
+		PutNextCode(op, CODE_CLEAR);
+		ent = *bp++; cc--; incount++;
+	}
+	while (cc > 0) {
+		c = *bp++; cc--; incount++;
+		fcode = ((long)c << BITS_MAX) + ent;
+		h = (c << HSHIFT) ^ ent;	/* xor hashing */
+#ifdef _WINDOWS
+		/*
+		 * Check hash index for an overflow.
+		 */
+		if (h >= HSIZE)
+			h -= HSIZE;
+#endif
+		hp = &sp->enc_hashtab[h];
+		if (hp->hash == fcode) {
+			ent = hp->code;
+			continue;
+		}
+		if (hp->hash >= 0) {
+			/*
+			 * Primary hash failed, check secondary hash.
+			 */
+			disp = HSIZE - h;
+			if (h == 0)
+				disp = 1;
+			do {
+				/*
+				 * Avoid pointer arithmetic 'cuz of
+				 * wraparound problems with segments.
+				 */
+				if ((h -= disp) < 0)
+					h += HSIZE;
+				hp = &sp->enc_hashtab[h];
+				if (hp->hash == fcode) {
+					ent = hp->code;
+					goto hit;
+				}
+			} while (hp->hash >= 0);
+		}
+		/*
+		 * New entry, emit code and add to table.
+		 */
+		/*
+		 * Verify there is space in the buffer for the code
+		 * and any potential Clear code that might be emitted
+		 * below.  The value of limit is setup so that there
+		 * are at least 4 bytes free--room for 2 codes.
+		 */
+		if (op > limit) {
+			tif->tif_rawcc = (tsize_t)(op - tif->tif_rawdata);
+			TIFFFlushData1(tif);
+			op = tif->tif_rawdata;
+		}
+		PutNextCode(op, ent);
+		ent = c;
+		hp->code = free_ent++;
+		hp->hash = fcode;
+		if (free_ent == CODE_MAX-1) {
+			/* table is full, emit clear code and reset */
+			cl_hash(sp);
+			sp->enc_ratio = 0;
+			incount = 0;
+			outcount = 0;
+			free_ent = CODE_FIRST;
+			PutNextCode(op, CODE_CLEAR);
+			nbits = BITS_MIN;
+			maxcode = MAXCODE(BITS_MIN);
+		} else {
+			/*
+			 * If the next entry is going to be too big for
+			 * the code size, then increase it, if possible.
+			 */
+			if (free_ent > maxcode) {
+				nbits++;
+				assert(nbits <= BITS_MAX);
+				maxcode = (int) MAXCODE(nbits);
+			} else if (incount >= checkpoint) {
+				long rat;
+				/*
+				 * Check compression ratio and, if things seem
+				 * to be slipping, clear the hash table and
+				 * reset state.  The compression ratio is a
+				 * 24+8-bit fractional number.
+				 */
+				checkpoint = incount+CHECK_GAP;
+				CALCRATIO(sp, rat);
+				if (rat <= sp->enc_ratio) {
+					cl_hash(sp);
+					sp->enc_ratio = 0;
+					incount = 0;
+					outcount = 0;
+					free_ent = CODE_FIRST;
+					PutNextCode(op, CODE_CLEAR);
+					nbits = BITS_MIN;
+					maxcode = MAXCODE(BITS_MIN);
+				} else
+					sp->enc_ratio = rat;
+			}
+		}
+	hit:
+		;
+	}
+
+	/*
+	 * Restore global state.
+	 */
+	sp->enc_incount = incount;
+	sp->enc_outcount = outcount;
+	sp->enc_checkpoint = checkpoint;
+	sp->enc_oldcode = ent;
+	sp->lzw_nextdata = nextdata;
+	sp->lzw_nextbits = nextbits;
+	sp->lzw_free_ent = free_ent;
+	sp->lzw_maxcode = maxcode;
+	sp->lzw_nbits = nbits;
+	tif->tif_rawcp = op;
+	return (1);
+}
+
+/*
+ * Finish off an encoded strip by flushing the last
+ * string and tacking on an End Of Information code.
+ */
+static int
+LZWPostEncode(TIFF* tif)
+{
+	register LZWCodecState *sp = EncoderState(tif);
+	tidata_t op = tif->tif_rawcp;
+	long nextbits = sp->lzw_nextbits;
+	long nextdata = sp->lzw_nextdata;
+	long outcount = sp->enc_outcount;
+	int nbits = sp->lzw_nbits;
+
+	if (op > sp->enc_rawlimit) {
+		tif->tif_rawcc = (tsize_t)(op - tif->tif_rawdata);
+		TIFFFlushData1(tif);
+		op = tif->tif_rawdata;
+	}
+	if (sp->enc_oldcode != (hcode_t) -1) {
+		PutNextCode(op, sp->enc_oldcode);
+		sp->enc_oldcode = (hcode_t) -1;
+	}
+	PutNextCode(op, CODE_EOI);
+	if (nextbits > 0) 
+		*op++ = (unsigned char)(nextdata << (8-nextbits));
+	tif->tif_rawcc = (tsize_t)(op - tif->tif_rawdata);
+	return (1);
+}
+
+/*
+ * Reset encoding hash table.
+ */
+static void
+cl_hash(LZWCodecState* sp)
+{
+	register hash_t *hp = &sp->enc_hashtab[HSIZE-1];
+	register long i = HSIZE-8;
+
+ 	do {
+		i -= 8;
+		hp[-7].hash = -1;
+		hp[-6].hash = -1;
+		hp[-5].hash = -1;
+		hp[-4].hash = -1;
+		hp[-3].hash = -1;
+		hp[-2].hash = -1;
+		hp[-1].hash = -1;
+		hp[ 0].hash = -1;
+		hp -= 8;
+	} while (i >= 0);
+    	for (i += 8; i > 0; i--, hp--)
+		hp->hash = -1;
+}
+
+static void
+LZWCleanup(TIFF* tif)
+{
+	(void)TIFFPredictorCleanup(tif);
+
+	assert(tif->tif_data != 0);
+
+	if (DecoderState(tif)->dec_codetab)
+		_TIFFfree(DecoderState(tif)->dec_codetab);
+
+	if (EncoderState(tif)->enc_hashtab)
+		_TIFFfree(EncoderState(tif)->enc_hashtab);
+
+	_TIFFfree(tif->tif_data);
+	tif->tif_data = NULL;
+
+	_TIFFSetDefaultCompressionState(tif);
+}
+
+int
+TIFFInitLZW(TIFF* tif, int scheme)
+{
+	assert(scheme == COMPRESSION_LZW);
+	/*
+	 * Allocate state block so tag methods have storage to record values.
+	 */
+	tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (LZWCodecState));
+	if (tif->tif_data == NULL)
+		goto bad;
+	DecoderState(tif)->dec_codetab = NULL;
+	DecoderState(tif)->dec_decode = NULL;
+	EncoderState(tif)->enc_hashtab = NULL;
+        LZWState(tif)->rw_mode = tif->tif_mode;
+
+	/*
+	 * Install codec methods.
+	 */
+	tif->tif_setupdecode = LZWSetupDecode;
+	tif->tif_predecode = LZWPreDecode;
+	tif->tif_decoderow = LZWDecode;
+	tif->tif_decodestrip = LZWDecode;
+	tif->tif_decodetile = LZWDecode;
+	tif->tif_setupencode = LZWSetupEncode;
+	tif->tif_preencode = LZWPreEncode;
+	tif->tif_postencode = LZWPostEncode;
+	tif->tif_encoderow = LZWEncode;
+	tif->tif_encodestrip = LZWEncode;
+	tif->tif_encodetile = LZWEncode;
+	tif->tif_cleanup = LZWCleanup;
+	/*
+	 * Setup predictor setup.
+	 */
+	(void) TIFFPredictorInit(tif);
+	return (1);
+bad:
+	TIFFErrorExt(tif->tif_clientdata, "TIFFInitLZW", 
+		     "No space for LZW state block");
+	return (0);
+}
+
+/*
+ * Copyright (c) 1985, 1986 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * James A. Woods, derived from original work by Spencer Thomas
+ * and Joseph Orost.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+#endif /* LZW_SUPPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_machdep.c b/src/tiff/tif_machdep.c
new file mode 100644
index 0000000..b824281
--- /dev/null
+++ b/src/tiff/tif_machdep.c
@@ -0,0 +1,186 @@
+#ifndef lint
+static char rcsid[] = "$Header$";
+#endif
+
+/*
+ * Copyright (c) 1992 Sam Leffler
+ * Copyright (c) 1992 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library Machine Dependent Routines.
+ */
+#include "tiffiop.h"
+
+#ifdef tahoe
+typedef	struct ieeedouble {
+	u_long	sign	: 1,
+		exp	: 11,
+		mant	: 20;
+	u_long	mant2;
+} ieeedouble;
+typedef	struct ieeefloat {
+	u_long	sign	: 1,
+		exp	: 8,
+		mant	: 23;
+} ieeefloat;
+
+typedef	struct {
+	u_long	sign	: 1,
+		exp	: 8,
+		mant	: 23;
+	u_long	mant2;
+} nativedouble;
+typedef	struct {
+	u_long	sign	: 1,
+		exp	: 8,
+		mant	: 23;
+} nativefloat;
+/*
+ * Beware, over/under-flow in conversions will
+ * result in garbage values -- handling it would
+ * require a subroutine call or lots more code.
+ */
+#define	NATIVE2IEEEFLOAT(fp) { \
+    if ((fp)->native.exp) \
+        (fp)->ieee.exp = (fp)->native.exp - 129 + 127;	/* alter bias */\
+}
+#define	IEEEFLOAT2NATIVE(fp) { \
+    if ((fp)->ieee.exp) \
+        (fp)->native.exp = (fp)->ieee.exp - 127 + 129; 	/* alter bias */\
+}
+#define	IEEEDOUBLE2NATIVE(dp) { \
+    if ((dp)->native.exp = (dp)->ieee.exp) \
+	(dp)->native.exp += -1023 + 129; \
+    (dp)->native.mant = ((dp)->ieee.mant<<3)|((dp)->native.mant2>>29); \
+    (dp)->native.mant2 <<= 3; \
+}
+#endif /* tahoe */
+
+#ifdef vax
+typedef	struct ieeedouble {
+	u_long	mant	: 20,
+		exp	: 11,
+		sign	: 1;
+	u_long	mant2;
+} ieeedouble;
+typedef	struct ieeefloat {
+	u_long	mant	: 23,
+		exp	: 8,
+		sign	: 1;
+} ieeefloat;
+
+typedef	struct {
+	u_long	mant1	: 7,
+		exp	: 8,
+		sign	: 1,
+		mant2	: 16;
+	u_long	mant3;
+} nativedouble;
+typedef	struct {
+	u_long	mant1	: 7,
+		exp	: 8,
+		sign	: 1,
+		mant2	: 16;
+} nativefloat;
+/*
+ * Beware, these do not handle over/under-flow
+ * during conversion from ieee to native format.
+ */
+#define	NATIVE2IEEEFLOAT(fp) { \
+    float_t t; \
+    if (t.ieee.exp = (fp)->native.exp) \
+	t.ieee.exp += -129 + 127; \
+    t.ieee.sign = (fp)->native.sign; \
+    t.ieee.mant = ((fp)->native.mant1<<16)|(fp)->native.mant2; \
+    *(fp) = t; \
+}
+#define	IEEEFLOAT2NATIVE(fp) { \
+    float_t t; int v = (fp)->ieee.exp; \
+    if (v) v += -127 + 129;		/* alter bias of exponent */\
+    t.native.exp = v;			/* implicit truncation of exponent */\
+    t.native.sign = (fp)->ieee.sign; \
+    v = (fp)->ieee.mant; \
+    t.native.mant1 = v >> 16; \
+    t.native.mant2 = v;\
+    *(fp) = t; \
+}
+#define	IEEEDOUBLE2NATIVE(dp) { \
+    double_t t; int v = (dp)->ieee.exp; \
+    if (v) v += -1023 + 1025; 		/* if can alter bias of exponent */\
+    t.native.exp = v;			/* implicit truncation of exponent */\
+    v = (dp)->ieee.mant; \
+    t.native.sign = (dp)->ieee.sign; \
+    t.native.mant1 = v >> 16; \
+    t.native.mant2 = v;\
+    t.native.mant3 = (dp)->mant2; \
+    *(dp) = t; \
+}
+#endif /* vax */
+
+#if !HAVE_IEEEFP
+#if !defined(IEEEFLOAT2NATIVE) || !defined(NATIVE2IEEEFLOAT)
+"Help, you've configured the library to not have IEEE floating point,\
+but not defined how to convert between IEEE and native formats!"
+#endif
+
+/*
+ * These unions are used during floating point
+ * conversions.  The above macros define the
+ * conversion operations.
+ */
+typedef	union {
+	ieeedouble	ieee;
+	nativedouble	native;
+	char		b[8];
+	double		d;
+} double_t;
+
+typedef	union {
+	ieeefloat	ieee;
+	nativefloat	native;
+	char		b[4];
+	float		f;
+} float_t;
+
+void
+TIFFCvtIEEEFloatToNative(TIFF* tif, u_int n, float* f)
+{
+	float_t *fp = (float_t *)f;
+
+	while (n-- > 0) {
+		IEEEFLOAT2NATIVE(fp);
+		fp++;
+	}
+}
+
+void
+TIFFCvtNativeToIEEEFloat(TIFF* tif, u_int n, float* f)
+{
+	float_t *fp = (float_t *)f;
+
+	while (n-- > 0) {
+		NATIVE2IEEEFLOAT(fp);
+		fp++;
+	}
+}
+#endif
diff --git a/src/tiff/tif_next.c b/src/tiff/tif_next.c
new file mode 100644
index 0000000..aa82055
--- /dev/null
+++ b/src/tiff/tif_next.c
@@ -0,0 +1,144 @@
+/* $Id: tif_next.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#include "tiffiop.h"
+#ifdef NEXT_SUPPORT
+/*
+ * TIFF Library.
+ *
+ * NeXT 2-bit Grey Scale Compression Algorithm Support
+ */
+
+#define SETPIXEL(op, v) {			\
+	switch (npixels++ & 3) {		\
+	case 0:	op[0]  = (unsigned char) ((v) << 6); break;	\
+	case 1:	op[0] |= (v) << 4; break;	\
+	case 2:	op[0] |= (v) << 2; break;	\
+	case 3:	*op++ |= (v);	   break;	\
+	}					\
+}
+
+#define LITERALROW	0x00
+#define LITERALSPAN	0x40
+#define WHITE   	((1<<2)-1)
+
+static int
+NeXTDecode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
+{
+	register unsigned char *bp, *op;
+	register tsize_t cc;
+	register int n;
+	tidata_t row;
+	tsize_t scanline;
+
+	(void) s;
+	/*
+	 * Each scanline is assumed to start off as all
+	 * white (we assume a PhotometricInterpretation
+	 * of ``min-is-black'').
+	 */
+	for (op = buf, cc = occ; cc-- > 0;)
+		*op++ = 0xff;
+
+	bp = (unsigned char *)tif->tif_rawcp;
+	cc = tif->tif_rawcc;
+	scanline = tif->tif_scanlinesize;
+	for (row = buf; (long)occ > 0; occ -= scanline, row += scanline) {
+		n = *bp++, cc--;
+		switch (n) {
+		case LITERALROW:
+			/*
+			 * The entire scanline is given as literal values.
+			 */
+			if (cc < scanline)
+				goto bad;
+			_TIFFmemcpy(row, bp, scanline);
+			bp += scanline;
+			cc -= scanline;
+			break;
+		case LITERALSPAN: {
+			int off;
+			/*
+			 * The scanline has a literal span
+			 * that begins at some offset.
+			 */
+			off = (bp[0] * 256) + bp[1];
+			n = (bp[2] * 256) + bp[3];
+			if (cc < 4+n || off+n > scanline)
+				goto bad;
+			_TIFFmemcpy(row+off, bp+4, n);
+			bp += 4+n;
+			cc -= 4+n;
+			break;
+		}
+		default: {
+			register int npixels = 0, grey;
+			unsigned long imagewidth = tif->tif_dir.td_imagewidth;
+
+			/*
+			 * The scanline is composed of a sequence
+			 * of constant color ``runs''.  We shift
+			 * into ``run mode'' and interpret bytes
+			 * as codes of the form <color><npixels>
+			 * until we've filled the scanline.
+			 */
+			op = row;
+			for (;;) {
+				grey = (n>>6) & 0x3;
+				n &= 0x3f;
+				while (n-- > 0)
+					SETPIXEL(op, grey);
+				if (npixels >= (int) imagewidth)
+					break;
+				if (cc == 0)
+					goto bad;
+				n = *bp++, cc--;
+			}
+			break;
+		}
+		}
+	}
+	tif->tif_rawcp = (tidata_t) bp;
+	tif->tif_rawcc = cc;
+	return (1);
+bad:
+	TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "NeXTDecode: Not enough data for scanline %ld",
+	    (long) tif->tif_row);
+	return (0);
+}
+
+int
+TIFFInitNeXT(TIFF* tif, int scheme)
+{
+	(void) scheme;
+	tif->tif_decoderow = NeXTDecode;
+	tif->tif_decodestrip = NeXTDecode;
+	tif->tif_decodetile = NeXTDecode;
+	return (1);
+}
+#endif /* NEXT_SUPPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_open.c b/src/tiff/tif_open.c
new file mode 100644
index 0000000..f222a33
--- /dev/null
+++ b/src/tiff/tif_open.c
@@ -0,0 +1,683 @@
+/* $Id: tif_open.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ */
+#include "tiffiop.h"
+
+static const long typemask[13] = {
+	(long)0L,		/* TIFF_NOTYPE */
+	(long)0x000000ffL,	/* TIFF_BYTE */
+	(long)0xffffffffL,	/* TIFF_ASCII */
+	(long)0x0000ffffL,	/* TIFF_SHORT */
+	(long)0xffffffffL,	/* TIFF_LONG */
+	(long)0xffffffffL,	/* TIFF_RATIONAL */
+	(long)0x000000ffL,	/* TIFF_SBYTE */
+	(long)0x000000ffL,	/* TIFF_UNDEFINED */
+	(long)0x0000ffffL,	/* TIFF_SSHORT */
+	(long)0xffffffffL,	/* TIFF_SLONG */
+	(long)0xffffffffL,	/* TIFF_SRATIONAL */
+	(long)0xffffffffL,	/* TIFF_FLOAT */
+	(long)0xffffffffL,	/* TIFF_DOUBLE */
+};
+static const int bigTypeshift[13] = {
+	0,		/* TIFF_NOTYPE */
+	24,		/* TIFF_BYTE */
+	0,		/* TIFF_ASCII */
+	16,		/* TIFF_SHORT */
+	0,		/* TIFF_LONG */
+	0,		/* TIFF_RATIONAL */
+	24,		/* TIFF_SBYTE */
+	24,		/* TIFF_UNDEFINED */
+	16,		/* TIFF_SSHORT */
+	0,		/* TIFF_SLONG */
+	0,		/* TIFF_SRATIONAL */
+	0,		/* TIFF_FLOAT */
+	0,		/* TIFF_DOUBLE */
+};
+static const int litTypeshift[13] = {
+	0,		/* TIFF_NOTYPE */
+	0,		/* TIFF_BYTE */
+	0,		/* TIFF_ASCII */
+	0,		/* TIFF_SHORT */
+	0,		/* TIFF_LONG */
+	0,		/* TIFF_RATIONAL */
+	0,		/* TIFF_SBYTE */
+	0,		/* TIFF_UNDEFINED */
+	0,		/* TIFF_SSHORT */
+	0,		/* TIFF_SLONG */
+	0,		/* TIFF_SRATIONAL */
+	0,		/* TIFF_FLOAT */
+	0,		/* TIFF_DOUBLE */
+};
+
+/*
+ * Dummy functions to fill the omitted client procedures.
+ */
+static int
+_tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
+{
+	(void) fd; (void) pbase; (void) psize;
+	return (0);
+}
+
+static void
+_tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size)
+{
+	(void) fd; (void) base; (void) size;
+}
+
+/*
+ * Initialize the shift & mask tables, and the
+ * byte swapping state according to the file
+ * contents and the machine architecture.
+ */
+static void
+TIFFInitOrder(TIFF* tif, int magic)
+{
+	tif->tif_typemask = typemask;
+	if (magic == TIFF_BIGENDIAN) {
+		tif->tif_typeshift = bigTypeshift;
+#ifndef WORDS_BIGENDIAN
+		tif->tif_flags |= TIFF_SWAB;
+#endif
+	} else {
+		tif->tif_typeshift = litTypeshift;
+#ifdef WORDS_BIGENDIAN
+		tif->tif_flags |= TIFF_SWAB;
+#endif
+	}
+}
+
+int
+_TIFFgetMode(const char* mode, const char* module)
+{
+	int m = -1;
+
+	switch (mode[0]) {
+	case 'r':
+		m = O_RDONLY;
+		if (mode[1] == '+')
+			m = O_RDWR;
+		break;
+	case 'w':
+	case 'a':
+		m = O_RDWR|O_CREAT;
+		if (mode[0] == 'w')
+			m |= O_TRUNC;
+		break;
+	default:
+		TIFFErrorExt(0, module, "\"%s\": Bad mode", mode);
+		break;
+	}
+	return (m);
+}
+
+TIFF*
+TIFFClientOpen(
+	const char* name, const char* mode,
+	thandle_t clientdata,
+	TIFFReadWriteProc readproc,
+	TIFFReadWriteProc writeproc,
+	TIFFSeekProc seekproc,
+	TIFFCloseProc closeproc,
+	TIFFSizeProc sizeproc,
+	TIFFMapFileProc mapproc,
+	TIFFUnmapFileProc unmapproc
+)
+{
+	static const char module[] = "TIFFClientOpen";
+	TIFF *tif;
+	int m;
+	const char* cp;
+
+	m = _TIFFgetMode(mode, module);
+	if (m == -1)
+		goto bad2;
+	tif = (TIFF *)_TIFFmalloc(sizeof (TIFF) + strlen(name) + 1);
+	if (tif == NULL) {
+		TIFFErrorExt(clientdata, module, "%s: Out of memory (TIFF structure)", name);
+		goto bad2;
+	}
+	_TIFFmemset(tif, 0, sizeof (*tif));
+	tif->tif_name = (char *)tif + sizeof (TIFF);
+	strcpy(tif->tif_name, name);
+	tif->tif_mode = m &~ (O_CREAT|O_TRUNC);
+	tif->tif_curdir = (tdir_t) -1;		/* non-existent directory */
+	tif->tif_curoff = 0;
+	tif->tif_curstrip = (tstrip_t) -1;	/* invalid strip */
+	tif->tif_row = (uint32) -1;		/* read/write pre-increment */
+	tif->tif_clientdata = clientdata;
+	if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) {
+		TIFFErrorExt(clientdata, module,
+			  "One of the client procedures is NULL pointer.");
+		goto bad2;
+	}
+	tif->tif_readproc = readproc;
+	tif->tif_writeproc = writeproc;
+	tif->tif_seekproc = seekproc;
+	tif->tif_closeproc = closeproc;
+	tif->tif_sizeproc = sizeproc;
+        if (mapproc)
+		tif->tif_mapproc = mapproc;
+	else
+		tif->tif_mapproc = _tiffDummyMapProc;
+	if (unmapproc)
+		tif->tif_unmapproc = unmapproc;
+	else
+		tif->tif_unmapproc = _tiffDummyUnmapProc;
+	_TIFFSetDefaultCompressionState(tif);	/* setup default state */
+	/*
+	 * Default is to return data MSB2LSB and enable the
+	 * use of memory-mapped files and strip chopping when
+	 * a file is opened read-only.
+	 */
+	tif->tif_flags = FILLORDER_MSB2LSB;
+	if (m == O_RDONLY )
+            tif->tif_flags |= TIFF_MAPPED;
+
+#ifdef STRIPCHOP_DEFAULT
+	if (m == O_RDONLY || m == O_RDWR)
+		tif->tif_flags |= STRIPCHOP_DEFAULT;
+#endif
+
+	/*
+	 * Process library-specific flags in the open mode string.
+	 * The following flags may be used to control intrinsic library
+	 * behaviour that may or may not be desirable (usually for
+	 * compatibility with some application that claims to support
+	 * TIFF but only supports some braindead idea of what the
+	 * vendor thinks TIFF is):
+	 *
+	 * 'l'		use little-endian byte order for creating a file
+	 * 'b'		use big-endian byte order for creating a file
+	 * 'L'		read/write information using LSB2MSB bit order
+	 * 'B'		read/write information using MSB2LSB bit order
+	 * 'H'		read/write information using host bit order
+	 * 'M'		enable use of memory-mapped files when supported
+	 * 'm'		disable use of memory-mapped files
+	 * 'C'		enable strip chopping support when reading
+	 * 'c'		disable strip chopping support
+	 * 'h'		read TIFF header only, do not load the first IFD
+	 *
+	 * The use of the 'l' and 'b' flags is strongly discouraged.
+	 * These flags are provided solely because numerous vendors,
+	 * typically on the PC, do not correctly support TIFF; they
+	 * only support the Intel little-endian byte order.  This
+	 * support is not configured by default because it supports
+	 * the violation of the TIFF spec that says that readers *MUST*
+	 * support both byte orders.  It is strongly recommended that
+	 * you not use this feature except to deal with busted apps
+	 * that write invalid TIFF.  And even in those cases you should
+	 * bang on the vendors to fix their software.
+	 *
+	 * The 'L', 'B', and 'H' flags are intended for applications
+	 * that can optimize operations on data by using a particular
+	 * bit order.  By default the library returns data in MSB2LSB
+	 * bit order for compatibiltiy with older versions of this
+	 * library.  Returning data in the bit order of the native cpu
+	 * makes the most sense but also requires applications to check
+	 * the value of the FillOrder tag; something they probably do
+	 * not do right now.
+	 *
+	 * The 'M' and 'm' flags are provided because some virtual memory
+	 * systems exhibit poor behaviour when large images are mapped.
+	 * These options permit clients to control the use of memory-mapped
+	 * files on a per-file basis.
+	 *
+	 * The 'C' and 'c' flags are provided because the library support
+	 * for chopping up large strips into multiple smaller strips is not
+	 * application-transparent and as such can cause problems.  The 'c'
+	 * option permits applications that only want to look at the tags,
+	 * for example, to get the unadulterated TIFF tag information.
+	 */
+	for (cp = mode; *cp; cp++)
+		switch (*cp) {
+		case 'b':
+#ifndef WORDS_BIGENDIAN
+		    if (m&O_CREAT)
+				tif->tif_flags |= TIFF_SWAB;
+#endif
+			break;
+		case 'l':
+#ifdef WORDS_BIGENDIAN
+			if ((m&O_CREAT))
+				tif->tif_flags |= TIFF_SWAB;
+#endif
+			break;
+		case 'B':
+			tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
+			    FILLORDER_MSB2LSB;
+			break;
+		case 'L':
+			tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
+			    FILLORDER_LSB2MSB;
+			break;
+		case 'H':
+			tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
+			    HOST_FILLORDER;
+			break;
+		case 'M':
+			if (m == O_RDONLY)
+				tif->tif_flags |= TIFF_MAPPED;
+			break;
+		case 'm':
+			if (m == O_RDONLY)
+				tif->tif_flags &= ~TIFF_MAPPED;
+			break;
+		case 'C':
+			if (m == O_RDONLY)
+				tif->tif_flags |= TIFF_STRIPCHOP;
+			break;
+		case 'c':
+			if (m == O_RDONLY)
+				tif->tif_flags &= ~TIFF_STRIPCHOP;
+			break;
+		case 'h':
+			tif->tif_flags |= TIFF_HEADERONLY;
+			break;
+		}
+	/*
+	 * Read in TIFF header.
+	 */
+	if (tif->tif_mode & O_TRUNC ||
+	    !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeader))) {
+		if (tif->tif_mode == O_RDONLY) {
+			TIFFErrorExt(tif->tif_clientdata, name, "Cannot read TIFF header");
+			goto bad;
+		}
+		/*
+		 * Setup header and write.
+		 */
+#ifdef WORDS_BIGENDIAN
+		tif->tif_header.tiff_magic = tif->tif_flags & TIFF_SWAB
+		    ? TIFF_LITTLEENDIAN : TIFF_BIGENDIAN;
+#else
+		tif->tif_header.tiff_magic = tif->tif_flags & TIFF_SWAB
+		    ? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN;
+#endif
+		tif->tif_header.tiff_version = TIFF_VERSION;
+		if (tif->tif_flags & TIFF_SWAB)
+			TIFFSwabShort(&tif->tif_header.tiff_version);
+		tif->tif_header.tiff_diroff = 0;	/* filled in later */
+
+
+                /*
+                 * The doc for "fopen" for some STD_C_LIBs says that if you 
+                 * open a file for modify ("+"), then you must fseek (or 
+                 * fflush?) between any freads and fwrites.  This is not
+                 * necessary on most systems, but has been shown to be needed
+                 * on Solaris. 
+                 */
+                TIFFSeekFile( tif, 0, SEEK_SET );
+               
+		if (!WriteOK(tif, &tif->tif_header, sizeof (TIFFHeader))) {
+			TIFFErrorExt(tif->tif_clientdata, name, "Error writing TIFF header");
+			goto bad;
+		}
+		/*
+		 * Setup the byte order handling.
+		 */
+		TIFFInitOrder(tif, tif->tif_header.tiff_magic);
+		/*
+		 * Setup default directory.
+		 */
+		if (!TIFFDefaultDirectory(tif))
+			goto bad;
+		tif->tif_diroff = 0;
+		tif->tif_dirlist = NULL;
+		tif->tif_dirnumber = 0;
+		return (tif);
+	}
+	/*
+	 * Setup the byte order handling.
+	 */
+	if (tif->tif_header.tiff_magic != TIFF_BIGENDIAN &&
+	    tif->tif_header.tiff_magic != TIFF_LITTLEENDIAN
+#if MDI_SUPPORT
+	    &&
+#if HOST_BIGENDIAN
+	    tif->tif_header.tiff_magic != MDI_BIGENDIAN
+#else
+	    tif->tif_header.tiff_magic != MDI_LITTLEENDIAN
+#endif
+	    ) {
+		TIFFErrorExt(tif->tif_clientdata, name,  "Not a TIFF or MDI file, bad magic number %d (0x%x)",
+#else
+	    ) {
+		TIFFErrorExt(tif->tif_clientdata, name,  "Not a TIFF file, bad magic number %d (0x%x)",
+#endif
+		    tif->tif_header.tiff_magic,
+		    tif->tif_header.tiff_magic);
+		goto bad;
+	}
+	TIFFInitOrder(tif, tif->tif_header.tiff_magic);
+	/*
+	 * Swap header if required.
+	 */
+	if (tif->tif_flags & TIFF_SWAB) {
+		TIFFSwabShort(&tif->tif_header.tiff_version);
+		TIFFSwabLong(&tif->tif_header.tiff_diroff);
+	}
+	/*
+	 * Now check version (if needed, it's been byte-swapped).
+	 * Note that this isn't actually a version number, it's a
+	 * magic number that doesn't change (stupid).
+	 */
+	if (tif->tif_header.tiff_version == TIFF_BIGTIFF_VERSION) {
+		TIFFErrorExt(tif->tif_clientdata, name,
+                          "This is a BigTIFF file.  This format not supported\n"
+                          "by this version of libtiff." );
+		goto bad;
+	}
+	if (tif->tif_header.tiff_version != TIFF_VERSION) {
+		TIFFErrorExt(tif->tif_clientdata, name,
+		    "Not a TIFF file, bad version number %d (0x%x)",
+		    tif->tif_header.tiff_version,
+		    tif->tif_header.tiff_version); 
+		goto bad;
+	}
+	tif->tif_flags |= TIFF_MYBUFFER;
+	tif->tif_rawcp = tif->tif_rawdata = 0;
+	tif->tif_rawdatasize = 0;
+
+	/*
+	 * Sometimes we do not want to read the first directory (for example,
+	 * it may be broken) and want to proceed to other directories. I this
+	 * case we use the TIFF_HEADERONLY flag to open file and return
+	 * immediately after reading TIFF header.
+	 */
+	if (tif->tif_flags & TIFF_HEADERONLY)
+		return (tif);
+
+	/*
+	 * Setup initial directory.
+	 */
+	switch (mode[0]) {
+	case 'r':
+		tif->tif_nextdiroff = tif->tif_header.tiff_diroff;
+		/*
+		 * Try to use a memory-mapped file if the client
+		 * has not explicitly suppressed usage with the
+		 * 'm' flag in the open mode (see above).
+		 */
+		if ((tif->tif_flags & TIFF_MAPPED) &&
+	!TIFFMapFileContents(tif, (tdata_t*) &tif->tif_base, &tif->tif_size))
+			tif->tif_flags &= ~TIFF_MAPPED;
+		if (TIFFReadDirectory(tif)) {
+			tif->tif_rawcc = -1;
+			tif->tif_flags |= TIFF_BUFFERSETUP;
+			return (tif);
+		}
+		break;
+	case 'a':
+		/*
+		 * New directories are automatically append
+		 * to the end of the directory chain when they
+		 * are written out (see TIFFWriteDirectory).
+		 */
+		if (!TIFFDefaultDirectory(tif))
+			goto bad;
+		return (tif);
+	}
+bad:
+	tif->tif_mode = O_RDONLY;	/* XXX avoid flush */
+        TIFFCleanup(tif);
+bad2:
+	return ((TIFF*)0);
+}
+
+/*
+ * Query functions to access private data.
+ */
+
+/*
+ * Return open file's name.
+ */
+const char *
+TIFFFileName(TIFF* tif)
+{
+	return (tif->tif_name);
+}
+
+/*
+ * Set the file name.
+ */
+const char *
+TIFFSetFileName(TIFF* tif, const char *name)
+{
+	const char* old_name = tif->tif_name;
+	tif->tif_name = (char *)name;
+	return (old_name);
+}
+
+/*
+ * Return open file's I/O descriptor.
+ */
+int
+TIFFFileno(TIFF* tif)
+{
+	return (tif->tif_fd);
+}
+
+/*
+ * Set open file's I/O descriptor, and return previous value.
+ */
+int
+TIFFSetFileno(TIFF* tif, int fd)
+{
+        int old_fd = tif->tif_fd;
+	tif->tif_fd = fd;
+	return old_fd;
+}
+
+/*
+ * Return open file's clientdata.
+ */
+thandle_t
+TIFFClientdata(TIFF* tif)
+{
+	return (tif->tif_clientdata);
+}
+
+/*
+ * Set open file's clientdata, and return previous value.
+ */
+thandle_t
+TIFFSetClientdata(TIFF* tif, thandle_t newvalue)
+{
+	thandle_t m = tif->tif_clientdata;
+	tif->tif_clientdata = newvalue;
+	return m;
+}
+
+/*
+ * Return read/write mode.
+ */
+int
+TIFFGetMode(TIFF* tif)
+{
+	return (tif->tif_mode);
+}
+
+/*
+ * Return read/write mode.
+ */
+int
+TIFFSetMode(TIFF* tif, int mode)
+{
+	int old_mode = tif->tif_mode;
+	tif->tif_mode = mode;
+	return (old_mode);
+}
+
+/*
+ * Return nonzero if file is organized in
+ * tiles; zero if organized as strips.
+ */
+int
+TIFFIsTiled(TIFF* tif)
+{
+	return (isTiled(tif));
+}
+
+/*
+ * Return current row being read/written.
+ */
+uint32
+TIFFCurrentRow(TIFF* tif)
+{
+	return (tif->tif_row);
+}
+
+/*
+ * Return index of the current directory.
+ */
+tdir_t
+TIFFCurrentDirectory(TIFF* tif)
+{
+	return (tif->tif_curdir);
+}
+
+/*
+ * Return current strip.
+ */
+tstrip_t
+TIFFCurrentStrip(TIFF* tif)
+{
+	return (tif->tif_curstrip);
+}
+
+/*
+ * Return current tile.
+ */
+ttile_t
+TIFFCurrentTile(TIFF* tif)
+{
+	return (tif->tif_curtile);
+}
+
+/*
+ * Return nonzero if the file has byte-swapped data.
+ */
+int
+TIFFIsByteSwapped(TIFF* tif)
+{
+	return ((tif->tif_flags & TIFF_SWAB) != 0);
+}
+
+/*
+ * Return nonzero if the data is returned up-sampled.
+ */
+int
+TIFFIsUpSampled(TIFF* tif)
+{
+	return (isUpSampled(tif));
+}
+
+/*
+ * Return nonzero if the data is returned in MSB-to-LSB bit order.
+ */
+int
+TIFFIsMSB2LSB(TIFF* tif)
+{
+	return (isFillOrder(tif, FILLORDER_MSB2LSB));
+}
+
+/*
+ * Return nonzero if given file was written in big-endian order.
+ */
+int
+TIFFIsBigEndian(TIFF* tif)
+{
+	return (tif->tif_header.tiff_magic == TIFF_BIGENDIAN);
+}
+
+/*
+ * Return pointer to file read method.
+ */
+TIFFReadWriteProc
+TIFFGetReadProc(TIFF* tif)
+{
+	return (tif->tif_readproc);
+}
+
+/*
+ * Return pointer to file write method.
+ */
+TIFFReadWriteProc
+TIFFGetWriteProc(TIFF* tif)
+{
+	return (tif->tif_writeproc);
+}
+
+/*
+ * Return pointer to file seek method.
+ */
+TIFFSeekProc
+TIFFGetSeekProc(TIFF* tif)
+{
+	return (tif->tif_seekproc);
+}
+
+/*
+ * Return pointer to file close method.
+ */
+TIFFCloseProc
+TIFFGetCloseProc(TIFF* tif)
+{
+	return (tif->tif_closeproc);
+}
+
+/*
+ * Return pointer to file size requesting method.
+ */
+TIFFSizeProc
+TIFFGetSizeProc(TIFF* tif)
+{
+	return (tif->tif_sizeproc);
+}
+
+/*
+ * Return pointer to memory mapping method.
+ */
+TIFFMapFileProc
+TIFFGetMapFileProc(TIFF* tif)
+{
+	return (tif->tif_mapproc);
+}
+
+/*
+ * Return pointer to memory unmapping method.
+ */
+TIFFUnmapFileProc
+TIFFGetUnmapFileProc(TIFF* tif)
+{
+	return (tif->tif_unmapproc);
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_packbits.c b/src/tiff/tif_packbits.c
new file mode 100644
index 0000000..13622e8
--- /dev/null
+++ b/src/tiff/tif_packbits.c
@@ -0,0 +1,293 @@
+/* $Id: tif_packbits.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#include "tiffiop.h"
+#ifdef PACKBITS_SUPPORT
+/*
+ * TIFF Library.
+ *
+ * PackBits Compression Algorithm Support
+ */
+#include <stdio.h>
+
+static int
+PackBitsPreEncode(TIFF* tif, tsample_t s)
+{
+	(void) s;
+
+        if (!(tif->tif_data = (tidata_t)_TIFFmalloc(sizeof(tsize_t))))
+		return (0);
+	/*
+	 * Calculate the scanline/tile-width size in bytes.
+	 */
+	if (isTiled(tif))
+		*(tsize_t*)tif->tif_data = TIFFTileRowSize(tif);
+	else
+		*(tsize_t*)tif->tif_data = TIFFScanlineSize(tif);
+	return (1);
+}
+
+static int
+PackBitsPostEncode(TIFF* tif)
+{
+        if (tif->tif_data)
+            _TIFFfree(tif->tif_data);
+	return (1);
+}
+
+/*
+ * NB: tidata is the type representing *(tidata_t);
+ *     if tidata_t is made signed then this type must
+ *     be adjusted accordingly.
+ */
+typedef unsigned char tidata;
+
+/*
+ * Encode a run of pixels.
+ */
+static int
+PackBitsEncode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
+{
+	unsigned char* bp = (unsigned char*) buf;
+	tidata_t op, ep, lastliteral;
+	long n, slop;
+	int b;
+	enum { BASE, LITERAL, RUN, LITERAL_RUN } state;
+
+	(void) s;
+	op = tif->tif_rawcp;
+	ep = tif->tif_rawdata + tif->tif_rawdatasize;
+	state = BASE;
+	lastliteral = 0;
+	while (cc > 0) {
+		/*
+		 * Find the longest string of identical bytes.
+		 */
+		b = *bp++, cc--, n = 1;
+		for (; cc > 0 && b == *bp; cc--, bp++)
+			n++;
+	again:
+		if (op + 2 >= ep) {		/* insure space for new data */
+			/*
+			 * Be careful about writing the last
+			 * literal.  Must write up to that point
+			 * and then copy the remainder to the
+			 * front of the buffer.
+			 */
+			if (state == LITERAL || state == LITERAL_RUN) {
+				slop = op - lastliteral;
+				tif->tif_rawcc += lastliteral - tif->tif_rawcp;
+				if (!TIFFFlushData1(tif))
+					return (-1);
+				op = tif->tif_rawcp;
+				while (slop-- > 0)
+					*op++ = *lastliteral++;
+				lastliteral = tif->tif_rawcp;
+			} else {
+				tif->tif_rawcc += op - tif->tif_rawcp;
+				if (!TIFFFlushData1(tif))
+					return (-1);
+				op = tif->tif_rawcp;
+			}
+		}
+		switch (state) {
+		case BASE:		/* initial state, set run/literal */
+			if (n > 1) {
+				state = RUN;
+				if (n > 128) {
+					*op++ = (tidata) -127;
+					*op++ = (tidataval_t) b;
+					n -= 128;
+					goto again;
+				}
+				*op++ = (tidataval_t)(-(n-1));
+				*op++ = (tidataval_t) b;
+			} else {
+				lastliteral = op;
+				*op++ = 0;
+				*op++ = (tidataval_t) b;
+				state = LITERAL;
+			}
+			break;
+		case LITERAL:		/* last object was literal string */
+			if (n > 1) {
+				state = LITERAL_RUN;
+				if (n > 128) {
+					*op++ = (tidata) -127;
+					*op++ = (tidataval_t) b;
+					n -= 128;
+					goto again;
+				}
+				*op++ = (tidataval_t)(-(n-1));	/* encode run */
+				*op++ = (tidataval_t) b;
+			} else {			/* extend literal */
+				if (++(*lastliteral) == 127)
+					state = BASE;
+				*op++ = (tidataval_t) b;
+			}
+			break;
+		case RUN:		/* last object was run */
+			if (n > 1) {
+				if (n > 128) {
+					*op++ = (tidata) -127;
+					*op++ = (tidataval_t) b;
+					n -= 128;
+					goto again;
+				}
+				*op++ = (tidataval_t)(-(n-1));
+				*op++ = (tidataval_t) b;
+			} else {
+				lastliteral = op;
+				*op++ = 0;
+				*op++ = (tidataval_t) b;
+				state = LITERAL;
+			}
+			break;
+		case LITERAL_RUN:	/* literal followed by a run */
+			/*
+			 * Check to see if previous run should
+			 * be converted to a literal, in which
+			 * case we convert literal-run-literal
+			 * to a single literal.
+			 */
+			if (n == 1 && op[-2] == (tidata) -1 &&
+			    *lastliteral < 126) {
+				state = (((*lastliteral) += 2) == 127 ?
+				    BASE : LITERAL);
+				op[-2] = op[-1];	/* replicate */
+			} else
+				state = RUN;
+			goto again;
+		}
+	}
+	tif->tif_rawcc += op - tif->tif_rawcp;
+	tif->tif_rawcp = op;
+	return (1);
+}
+
+/*
+ * Encode a rectangular chunk of pixels.  We break it up
+ * into row-sized pieces to insure that encoded runs do
+ * not span rows.  Otherwise, there can be problems with
+ * the decoder if data is read, for example, by scanlines
+ * when it was encoded by strips.
+ */
+static int
+PackBitsEncodeChunk(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	tsize_t rowsize = *(tsize_t*)tif->tif_data;
+
+	while ((long)cc > 0) {
+		int	chunk = rowsize;
+		
+		if( cc < chunk )
+		    chunk = cc;
+
+		if (PackBitsEncode(tif, bp, chunk, s) < 0)
+		    return (-1);
+		bp += chunk;
+		cc -= chunk;
+	}
+	return (1);
+}
+
+static int
+PackBitsDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
+{
+	char *bp;
+	tsize_t cc;
+	long n;
+	int b;
+
+	(void) s;
+	bp = (char*) tif->tif_rawcp;
+	cc = tif->tif_rawcc;
+	while (cc > 0 && (long)occ > 0) {
+		n = (long) *bp++, cc--;
+		/*
+		 * Watch out for compilers that
+		 * don't sign extend chars...
+		 */
+		if (n >= 128)
+			n -= 256;
+		if (n < 0) {		/* replicate next byte -n+1 times */
+			if (n == -128)	/* nop */
+				continue;
+                        n = -n + 1;
+                        if( occ < n )
+                        {
+							TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+                                        "PackBitsDecode: discarding %d bytes "
+                                        "to avoid buffer overrun",
+                                        n - occ);
+                            n = occ;
+                        }
+			occ -= n;
+			b = *bp++, cc--;
+			while (n-- > 0)
+				*op++ = (tidataval_t) b;
+		} else {		/* copy next n+1 bytes literally */
+			if (occ < n + 1)
+                        {
+                            TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+                                        "PackBitsDecode: discarding %d bytes "
+                                        "to avoid buffer overrun",
+                                        n - occ + 1);
+                            n = occ - 1;
+                        }
+                        _TIFFmemcpy(op, bp, ++n);
+			op += n; occ -= n;
+			bp += n; cc -= n;
+		}
+	}
+	tif->tif_rawcp = (tidata_t) bp;
+	tif->tif_rawcc = cc;
+	if (occ > 0) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "PackBitsDecode: Not enough data for scanline %ld",
+		    (long) tif->tif_row);
+		return (0);
+	}
+	return (1);
+}
+
+int
+TIFFInitPackBits(TIFF* tif, int scheme)
+{
+	(void) scheme;
+	tif->tif_decoderow = PackBitsDecode;
+	tif->tif_decodestrip = PackBitsDecode;
+	tif->tif_decodetile = PackBitsDecode;
+	tif->tif_preencode = PackBitsPreEncode;
+        tif->tif_postencode = PackBitsPostEncode;
+	tif->tif_encoderow = PackBitsEncode;
+	tif->tif_encodestrip = PackBitsEncodeChunk;
+	tif->tif_encodetile = PackBitsEncodeChunk;
+	return (1);
+}
+#endif /* PACKBITS_SUPPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_pixarlog.c b/src/tiff/tif_pixarlog.c
new file mode 100644
index 0000000..a35493a
--- /dev/null
+++ b/src/tiff/tif_pixarlog.c
@@ -0,0 +1,1342 @@
+/* $Id: tif_pixarlog.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1996-1997 Sam Leffler
+ * Copyright (c) 1996 Pixar
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Pixar, Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Pixar, Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL PIXAR, SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#include "tiffiop.h"
+#ifdef PIXARLOG_SUPPORT
+
+/*
+ * TIFF Library.
+ * PixarLog Compression Support
+ *
+ * Contributed by Dan McCoy.
+ *
+ * PixarLog film support uses the TIFF library to store companded
+ * 11 bit values into a tiff file, which are compressed using the 
+ * zip compressor.  
+ *
+ * The codec can take as input and produce as output 32-bit IEEE float values 
+ * as well as 16-bit or 8-bit unsigned integer values.
+ *
+ * On writing any of the above are converted into the internal
+ * 11-bit log format.   In the case of  8 and 16 bit values, the
+ * input is assumed to be unsigned linear color values that represent
+ * the range 0-1.  In the case of IEEE values, the 0-1 range is assumed to
+ * be the normal linear color range, in addition over 1 values are
+ * accepted up to a value of about 25.0 to encode "hot" hightlights and such.
+ * The encoding is lossless for 8-bit values, slightly lossy for the
+ * other bit depths.  The actual color precision should be better
+ * than the human eye can perceive with extra room to allow for
+ * error introduced by further image computation.  As with any quantized
+ * color format, it is possible to perform image calculations which
+ * expose the quantization error. This format should certainly be less 
+ * susceptable to such errors than standard 8-bit encodings, but more
+ * susceptable than straight 16-bit or 32-bit encodings.
+ *
+ * On reading the internal format is converted to the desired output format.
+ * The program can request which format it desires by setting the internal
+ * pseudo tag TIFFTAG_PIXARLOGDATAFMT to one of these possible values:
+ *  PIXARLOGDATAFMT_FLOAT     = provide IEEE float values.
+ *  PIXARLOGDATAFMT_16BIT     = provide unsigned 16-bit integer values
+ *  PIXARLOGDATAFMT_8BIT      = provide unsigned 8-bit integer values
+ *
+ * alternately PIXARLOGDATAFMT_8BITABGR provides unsigned 8-bit integer
+ * values with the difference that if there are exactly three or four channels
+ * (rgb or rgba) it swaps the channel order (bgr or abgr).
+ *
+ * PIXARLOGDATAFMT_11BITLOG provides the internal encoding directly
+ * packed in 16-bit values.   However no tools are supplied for interpreting
+ * these values.
+ *
+ * "hot" (over 1.0) areas written in floating point get clamped to
+ * 1.0 in the integer data types.
+ *
+ * When the file is closed after writing, the bit depth and sample format
+ * are set always to appear as if 8-bit data has been written into it.
+ * That way a naive program unaware of the particulars of the encoding
+ * gets the format it is most likely able to handle.
+ *
+ * The codec does it's own horizontal differencing step on the coded
+ * values so the libraries predictor stuff should be turned off.
+ * The codec also handle byte swapping the encoded values as necessary
+ * since the library does not have the information necessary
+ * to know the bit depth of the raw unencoded buffer.
+ * 
+ */
+
+#include "tif_predict.h"
+#include "zlib.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+/* Tables for converting to/from 11 bit coded values */
+
+#define  TSIZE	 2048		/* decode table size (11-bit tokens) */
+#define  TSIZEP1 2049		/* Plus one for slop */
+#define  ONE	 1250		/* token value of 1.0 exactly */
+#define  RATIO	 1.004		/* nominal ratio for log part */
+
+#define CODE_MASK 0x7ff         /* 11 bits. */
+
+static float  Fltsize;
+static float  LogK1, LogK2;
+
+#define REPEAT(n, op)   { int i; i=n; do { i--; op; } while (i>0); }
+
+static void
+horizontalAccumulateF(uint16 *wp, int n, int stride, float *op, 
+	float *ToLinearF)
+{
+    register unsigned int  cr, cg, cb, ca, mask;
+    register float  t0, t1, t2, t3;
+
+    if (n >= stride) {
+	mask = CODE_MASK;
+	if (stride == 3) {
+	    t0 = ToLinearF[cr = wp[0]];
+	    t1 = ToLinearF[cg = wp[1]];
+	    t2 = ToLinearF[cb = wp[2]];
+	    op[0] = t0;
+	    op[1] = t1;
+	    op[2] = t2;
+	    n -= 3;
+	    while (n > 0) {
+		wp += 3;
+		op += 3;
+		n -= 3;
+		t0 = ToLinearF[(cr += wp[0]) & mask];
+		t1 = ToLinearF[(cg += wp[1]) & mask];
+		t2 = ToLinearF[(cb += wp[2]) & mask];
+		op[0] = t0;
+		op[1] = t1;
+		op[2] = t2;
+	    }
+	} else if (stride == 4) {
+	    t0 = ToLinearF[cr = wp[0]];
+	    t1 = ToLinearF[cg = wp[1]];
+	    t2 = ToLinearF[cb = wp[2]];
+	    t3 = ToLinearF[ca = wp[3]];
+	    op[0] = t0;
+	    op[1] = t1;
+	    op[2] = t2;
+	    op[3] = t3;
+	    n -= 4;
+	    while (n > 0) {
+		wp += 4;
+		op += 4;
+		n -= 4;
+		t0 = ToLinearF[(cr += wp[0]) & mask];
+		t1 = ToLinearF[(cg += wp[1]) & mask];
+		t2 = ToLinearF[(cb += wp[2]) & mask];
+		t3 = ToLinearF[(ca += wp[3]) & mask];
+		op[0] = t0;
+		op[1] = t1;
+		op[2] = t2;
+		op[3] = t3;
+	    }
+	} else {
+	    REPEAT(stride, *op = ToLinearF[*wp&mask]; wp++; op++)
+	    n -= stride;
+	    while (n > 0) {
+		REPEAT(stride,
+		    wp[stride] += *wp; *op = ToLinearF[*wp&mask]; wp++; op++)
+		n -= stride;
+	    }
+	}
+    }
+}
+
+static void
+horizontalAccumulate12(uint16 *wp, int n, int stride, int16 *op,
+	float *ToLinearF)
+{
+    register unsigned int  cr, cg, cb, ca, mask;
+    register float  t0, t1, t2, t3;
+
+#define SCALE12 2048.0F
+#define CLAMP12(t) (((t) < 3071) ? (uint16) (t) : 3071)
+
+    if (n >= stride) {
+	mask = CODE_MASK;
+	if (stride == 3) {
+	    t0 = ToLinearF[cr = wp[0]] * SCALE12;
+	    t1 = ToLinearF[cg = wp[1]] * SCALE12;
+	    t2 = ToLinearF[cb = wp[2]] * SCALE12;
+	    op[0] = CLAMP12(t0);
+	    op[1] = CLAMP12(t1);
+	    op[2] = CLAMP12(t2);
+	    n -= 3;
+	    while (n > 0) {
+		wp += 3;
+		op += 3;
+		n -= 3;
+		t0 = ToLinearF[(cr += wp[0]) & mask] * SCALE12;
+		t1 = ToLinearF[(cg += wp[1]) & mask] * SCALE12;
+		t2 = ToLinearF[(cb += wp[2]) & mask] * SCALE12;
+		op[0] = CLAMP12(t0);
+		op[1] = CLAMP12(t1);
+		op[2] = CLAMP12(t2);
+	    }
+	} else if (stride == 4) {
+	    t0 = ToLinearF[cr = wp[0]] * SCALE12;
+	    t1 = ToLinearF[cg = wp[1]] * SCALE12;
+	    t2 = ToLinearF[cb = wp[2]] * SCALE12;
+	    t3 = ToLinearF[ca = wp[3]] * SCALE12;
+	    op[0] = CLAMP12(t0);
+	    op[1] = CLAMP12(t1);
+	    op[2] = CLAMP12(t2);
+	    op[3] = CLAMP12(t3);
+	    n -= 4;
+	    while (n > 0) {
+		wp += 4;
+		op += 4;
+		n -= 4;
+		t0 = ToLinearF[(cr += wp[0]) & mask] * SCALE12;
+		t1 = ToLinearF[(cg += wp[1]) & mask] * SCALE12;
+		t2 = ToLinearF[(cb += wp[2]) & mask] * SCALE12;
+		t3 = ToLinearF[(ca += wp[3]) & mask] * SCALE12;
+		op[0] = CLAMP12(t0);
+		op[1] = CLAMP12(t1);
+		op[2] = CLAMP12(t2);
+		op[3] = CLAMP12(t3);
+	    }
+	} else {
+	    REPEAT(stride, t0 = ToLinearF[*wp&mask] * SCALE12;
+                           *op = CLAMP12(t0); wp++; op++)
+	    n -= stride;
+	    while (n > 0) {
+		REPEAT(stride,
+		    wp[stride] += *wp; t0 = ToLinearF[wp[stride]&mask]*SCALE12;
+		    *op = CLAMP12(t0);  wp++; op++)
+		n -= stride;
+	    }
+	}
+    }
+}
+
+static void
+horizontalAccumulate16(uint16 *wp, int n, int stride, uint16 *op,
+	uint16 *ToLinear16)
+{
+    register unsigned int  cr, cg, cb, ca, mask;
+
+    if (n >= stride) {
+	mask = CODE_MASK;
+	if (stride == 3) {
+	    op[0] = ToLinear16[cr = wp[0]];
+	    op[1] = ToLinear16[cg = wp[1]];
+	    op[2] = ToLinear16[cb = wp[2]];
+	    n -= 3;
+	    while (n > 0) {
+		wp += 3;
+		op += 3;
+		n -= 3;
+		op[0] = ToLinear16[(cr += wp[0]) & mask];
+		op[1] = ToLinear16[(cg += wp[1]) & mask];
+		op[2] = ToLinear16[(cb += wp[2]) & mask];
+	    }
+	} else if (stride == 4) {
+	    op[0] = ToLinear16[cr = wp[0]];
+	    op[1] = ToLinear16[cg = wp[1]];
+	    op[2] = ToLinear16[cb = wp[2]];
+	    op[3] = ToLinear16[ca = wp[3]];
+	    n -= 4;
+	    while (n > 0) {
+		wp += 4;
+		op += 4;
+		n -= 4;
+		op[0] = ToLinear16[(cr += wp[0]) & mask];
+		op[1] = ToLinear16[(cg += wp[1]) & mask];
+		op[2] = ToLinear16[(cb += wp[2]) & mask];
+		op[3] = ToLinear16[(ca += wp[3]) & mask];
+	    }
+	} else {
+	    REPEAT(stride, *op = ToLinear16[*wp&mask]; wp++; op++)
+	    n -= stride;
+	    while (n > 0) {
+		REPEAT(stride,
+		    wp[stride] += *wp; *op = ToLinear16[*wp&mask]; wp++; op++)
+		n -= stride;
+	    }
+	}
+    }
+}
+
+/* 
+ * Returns the log encoded 11-bit values with the horizontal
+ * differencing undone.
+ */
+static void
+horizontalAccumulate11(uint16 *wp, int n, int stride, uint16 *op)
+{
+    register unsigned int  cr, cg, cb, ca, mask;
+
+    if (n >= stride) {
+	mask = CODE_MASK;
+	if (stride == 3) {
+	    op[0] = cr = wp[0];  op[1] = cg = wp[1];  op[2] = cb = wp[2];
+	    n -= 3;
+	    while (n > 0) {
+		wp += 3;
+		op += 3;
+		n -= 3;
+		op[0] = (cr += wp[0]) & mask;
+		op[1] = (cg += wp[1]) & mask;
+		op[2] = (cb += wp[2]) & mask;
+	    }
+	} else if (stride == 4) {
+	    op[0] = cr = wp[0];  op[1] = cg = wp[1];
+	    op[2] = cb = wp[2];  op[3] = ca = wp[3];
+	    n -= 4;
+	    while (n > 0) {
+		wp += 4;
+		op += 4;
+		n -= 4;
+		op[0] = (cr += wp[0]) & mask;
+		op[1] = (cg += wp[1]) & mask;
+		op[2] = (cb += wp[2]) & mask;
+		op[3] = (ca += wp[3]) & mask;
+	    } 
+	} else {
+	    REPEAT(stride, *op = *wp&mask; wp++; op++)
+	    n -= stride;
+	    while (n > 0) {
+		REPEAT(stride,
+		    wp[stride] += *wp; *op = *wp&mask; wp++; op++)
+	    	n -= stride;
+	    }
+	}
+    }
+}
+
+static void
+horizontalAccumulate8(uint16 *wp, int n, int stride, unsigned char *op,
+	unsigned char *ToLinear8)
+{
+    register unsigned int  cr, cg, cb, ca, mask;
+
+    if (n >= stride) {
+	mask = CODE_MASK;
+	if (stride == 3) {
+	    op[0] = ToLinear8[cr = wp[0]];
+	    op[1] = ToLinear8[cg = wp[1]];
+	    op[2] = ToLinear8[cb = wp[2]];
+	    n -= 3;
+	    while (n > 0) {
+		n -= 3;
+		wp += 3;
+		op += 3;
+		op[0] = ToLinear8[(cr += wp[0]) & mask];
+		op[1] = ToLinear8[(cg += wp[1]) & mask];
+		op[2] = ToLinear8[(cb += wp[2]) & mask];
+	    }
+	} else if (stride == 4) {
+	    op[0] = ToLinear8[cr = wp[0]];
+	    op[1] = ToLinear8[cg = wp[1]];
+	    op[2] = ToLinear8[cb = wp[2]];
+	    op[3] = ToLinear8[ca = wp[3]];
+	    n -= 4;
+	    while (n > 0) {
+		n -= 4;
+		wp += 4;
+		op += 4;
+		op[0] = ToLinear8[(cr += wp[0]) & mask];
+		op[1] = ToLinear8[(cg += wp[1]) & mask];
+		op[2] = ToLinear8[(cb += wp[2]) & mask];
+		op[3] = ToLinear8[(ca += wp[3]) & mask];
+	    }
+	} else {
+	    REPEAT(stride, *op = ToLinear8[*wp&mask]; wp++; op++)
+	    n -= stride;
+	    while (n > 0) {
+		REPEAT(stride,
+		    wp[stride] += *wp; *op = ToLinear8[*wp&mask]; wp++; op++)
+		n -= stride;
+	    }
+	}
+    }
+}
+
+
+static void
+horizontalAccumulate8abgr(uint16 *wp, int n, int stride, unsigned char *op,
+	unsigned char *ToLinear8)
+{
+    register unsigned int  cr, cg, cb, ca, mask;
+    register unsigned char  t0, t1, t2, t3;
+
+    if (n >= stride) {
+	mask = CODE_MASK;
+	if (stride == 3) {
+	    op[0] = 0;
+	    t1 = ToLinear8[cb = wp[2]];
+	    t2 = ToLinear8[cg = wp[1]];
+	    t3 = ToLinear8[cr = wp[0]];
+	    op[1] = t1;
+	    op[2] = t2;
+	    op[3] = t3;
+	    n -= 3;
+	    while (n > 0) {
+		n -= 3;
+		wp += 3;
+		op += 4;
+		op[0] = 0;
+		t1 = ToLinear8[(cb += wp[2]) & mask];
+		t2 = ToLinear8[(cg += wp[1]) & mask];
+		t3 = ToLinear8[(cr += wp[0]) & mask];
+		op[1] = t1;
+		op[2] = t2;
+		op[3] = t3;
+	    }
+	} else if (stride == 4) {
+	    t0 = ToLinear8[ca = wp[3]];
+	    t1 = ToLinear8[cb = wp[2]];
+	    t2 = ToLinear8[cg = wp[1]];
+	    t3 = ToLinear8[cr = wp[0]];
+	    op[0] = t0;
+	    op[1] = t1;
+	    op[2] = t2;
+	    op[3] = t3;
+	    n -= 4;
+	    while (n > 0) {
+		n -= 4;
+		wp += 4;
+		op += 4;
+		t0 = ToLinear8[(ca += wp[3]) & mask];
+		t1 = ToLinear8[(cb += wp[2]) & mask];
+		t2 = ToLinear8[(cg += wp[1]) & mask];
+		t3 = ToLinear8[(cr += wp[0]) & mask];
+		op[0] = t0;
+		op[1] = t1;
+		op[2] = t2;
+		op[3] = t3;
+	    }
+	} else {
+	    REPEAT(stride, *op = ToLinear8[*wp&mask]; wp++; op++)
+	    n -= stride;
+	    while (n > 0) {
+		REPEAT(stride,
+		    wp[stride] += *wp; *op = ToLinear8[*wp&mask]; wp++; op++)
+		n -= stride;
+	    }
+	}
+    }
+}
+
+/*
+ * State block for each open TIFF
+ * file using PixarLog compression/decompression.
+ */
+typedef	struct {
+	TIFFPredictorState	predict;
+	z_stream		stream;
+	uint16			*tbuf; 
+	uint16			stride;
+	int			state;
+	int			user_datafmt;
+	int			quality;
+#define PLSTATE_INIT 1
+
+	TIFFVSetMethod		vgetparent;	/* super-class method */
+	TIFFVSetMethod		vsetparent;	/* super-class method */
+
+	float *ToLinearF;
+	uint16 *ToLinear16;
+	unsigned char *ToLinear8;
+	uint16  *FromLT2;
+	uint16  *From14; /* Really for 16-bit data, but we shift down 2 */
+	uint16  *From8;
+	
+} PixarLogState;
+
+static int
+PixarLogMakeTables(PixarLogState *sp)
+{
+
+/*
+ *    We make several tables here to convert between various external
+ *    representations (float, 16-bit, and 8-bit) and the internal
+ *    11-bit companded representation.  The 11-bit representation has two
+ *    distinct regions.  A linear bottom end up through .018316 in steps
+ *    of about .000073, and a region of constant ratio up to about 25.
+ *    These floating point numbers are stored in the main table ToLinearF. 
+ *    All other tables are derived from this one.  The tables (and the
+ *    ratios) are continuous at the internal seam.
+ */
+
+    int  nlin, lt2size;
+    int  i, j;
+    double  b, c, linstep, v;
+    float *ToLinearF;
+    uint16 *ToLinear16;
+    unsigned char *ToLinear8;
+    uint16  *FromLT2;
+    uint16  *From14; /* Really for 16-bit data, but we shift down 2 */
+    uint16  *From8;
+
+    c = log(RATIO);	
+    nlin = (int)(1./c);	/* nlin must be an integer */
+    c = 1./nlin;
+    b = exp(-c*ONE);	/* multiplicative scale factor [b*exp(c*ONE) = 1] */
+    linstep = b*c*exp(1.);
+
+    LogK1 = (float)(1./c);	/* if (v >= 2)  token = k1*log(v*k2) */
+    LogK2 = (float)(1./b);
+    lt2size = (int)(2./linstep) + 1;
+    FromLT2 = (uint16 *)_TIFFmalloc(lt2size*sizeof(uint16));
+    From14 = (uint16 *)_TIFFmalloc(16384*sizeof(uint16));
+    From8 = (uint16 *)_TIFFmalloc(256*sizeof(uint16));
+    ToLinearF = (float *)_TIFFmalloc(TSIZEP1 * sizeof(float));
+    ToLinear16 = (uint16 *)_TIFFmalloc(TSIZEP1 * sizeof(uint16));
+    ToLinear8 = (unsigned char *)_TIFFmalloc(TSIZEP1 * sizeof(unsigned char));
+    if (FromLT2 == NULL || From14  == NULL || From8   == NULL ||
+	 ToLinearF == NULL || ToLinear16 == NULL || ToLinear8 == NULL) {
+	if (FromLT2) _TIFFfree(FromLT2);
+	if (From14) _TIFFfree(From14);
+	if (From8) _TIFFfree(From8);
+	if (ToLinearF) _TIFFfree(ToLinearF);
+	if (ToLinear16) _TIFFfree(ToLinear16);
+	if (ToLinear8) _TIFFfree(ToLinear8);
+	sp->FromLT2 = NULL;
+	sp->From14 = NULL;
+	sp->From8 = NULL;
+	sp->ToLinearF = NULL;
+	sp->ToLinear16 = NULL;
+	sp->ToLinear8 = NULL;
+	return 0;
+    }
+
+    j = 0;
+
+    for (i = 0; i < nlin; i++)  {
+	v = i * linstep;
+	ToLinearF[j++] = (float)v;
+    }
+
+    for (i = nlin; i < TSIZE; i++)
+	ToLinearF[j++] = (float)(b*exp(c*i));
+
+    ToLinearF[2048] = ToLinearF[2047];
+
+    for (i = 0; i < TSIZEP1; i++)  {
+	v = ToLinearF[i]*65535.0 + 0.5;
+	ToLinear16[i] = (v > 65535.0) ? 65535 : (uint16)v;
+	v = ToLinearF[i]*255.0  + 0.5;
+	ToLinear8[i]  = (v > 255.0) ? 255 : (unsigned char)v;
+    }
+
+    j = 0;
+    for (i = 0; i < lt2size; i++)  {
+	if ((i*linstep)*(i*linstep) > ToLinearF[j]*ToLinearF[j+1])
+	    j++;
+	FromLT2[i] = j;
+    }
+
+    /*
+     * Since we lose info anyway on 16-bit data, we set up a 14-bit
+     * table and shift 16-bit values down two bits on input.
+     * saves a little table space.
+     */
+    j = 0;
+    for (i = 0; i < 16384; i++)  {
+	while ((i/16383.)*(i/16383.) > ToLinearF[j]*ToLinearF[j+1])
+	    j++;
+	From14[i] = j;
+    }
+
+    j = 0;
+    for (i = 0; i < 256; i++)  {
+	while ((i/255.)*(i/255.) > ToLinearF[j]*ToLinearF[j+1])
+	    j++;
+	From8[i] = j;
+    }
+
+    Fltsize = (float)(lt2size/2);
+
+    sp->ToLinearF = ToLinearF;
+    sp->ToLinear16 = ToLinear16;
+    sp->ToLinear8 = ToLinear8;
+    sp->FromLT2 = FromLT2;
+    sp->From14 = From14;
+    sp->From8 = From8;
+
+    return 1;
+}
+
+#define	DecoderState(tif)	((PixarLogState*) (tif)->tif_data)
+#define	EncoderState(tif)	((PixarLogState*) (tif)->tif_data)
+
+static	int PixarLogEncode(TIFF*, tidata_t, tsize_t, tsample_t);
+static	int PixarLogDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+
+#define N(a)   (sizeof(a)/sizeof(a[0]))
+#define PIXARLOGDATAFMT_UNKNOWN	-1
+
+static int
+PixarLogGuessDataFmt(TIFFDirectory *td)
+{
+	int guess = PIXARLOGDATAFMT_UNKNOWN;
+	int format = td->td_sampleformat;
+
+	/* If the user didn't tell us his datafmt,
+	 * take our best guess from the bitspersample.
+	 */
+	switch (td->td_bitspersample) {
+	 case 32:
+		if (format == SAMPLEFORMAT_IEEEFP)
+			guess = PIXARLOGDATAFMT_FLOAT;
+		break;
+	 case 16:
+		if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT)
+			guess = PIXARLOGDATAFMT_16BIT;
+		break;
+	 case 12:
+		if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_INT)
+			guess = PIXARLOGDATAFMT_12BITPICIO;
+		break;
+	 case 11:
+		if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT)
+			guess = PIXARLOGDATAFMT_11BITLOG;
+		break;
+	 case 8:
+		if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT)
+			guess = PIXARLOGDATAFMT_8BIT;
+		break;
+	}
+
+	return guess;
+}
+
+static uint32
+multiply(size_t m1, size_t m2)
+{
+	uint32	bytes = m1 * m2;
+
+	if (m1 && bytes / m1 != m2)
+		bytes = 0;
+
+	return bytes;
+}
+
+static int
+PixarLogSetupDecode(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	PixarLogState* sp = DecoderState(tif);
+	tsize_t tbuf_size;
+	static const char module[] = "PixarLogSetupDecode";
+
+	assert(sp != NULL);
+
+	/* Make sure no byte swapping happens on the data
+	 * after decompression. */
+	tif->tif_postdecode = _TIFFNoPostDecode;
+
+	/* for some reason, we can't do this in TIFFInitPixarLog */
+
+	sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ?
+	    td->td_samplesperpixel : 1);
+	tbuf_size = multiply(multiply(multiply(sp->stride, td->td_imagewidth),
+				      td->td_rowsperstrip), sizeof(uint16));
+	if (tbuf_size == 0)
+		return (0);
+	sp->tbuf = (uint16 *) _TIFFmalloc(tbuf_size);
+	if (sp->tbuf == NULL)
+		return (0);
+	if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN)
+		sp->user_datafmt = PixarLogGuessDataFmt(td);
+	if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) {
+		TIFFErrorExt(tif->tif_clientdata, module,
+			"PixarLog compression can't handle bits depth/data format combination (depth: %d)", 
+			td->td_bitspersample);
+		return (0);
+	}
+
+	if (inflateInit(&sp->stream) != Z_OK) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: %s", tif->tif_name, sp->stream.msg);
+		return (0);
+	} else {
+		sp->state |= PLSTATE_INIT;
+		return (1);
+	}
+}
+
+/*
+ * Setup state for decoding a strip.
+ */
+static int
+PixarLogPreDecode(TIFF* tif, tsample_t s)
+{
+	PixarLogState* sp = DecoderState(tif);
+
+	(void) s;
+	assert(sp != NULL);
+	sp->stream.next_in = tif->tif_rawdata;
+	sp->stream.avail_in = tif->tif_rawcc;
+	return (inflateReset(&sp->stream) == Z_OK);
+}
+
+static int
+PixarLogDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	PixarLogState* sp = DecoderState(tif);
+	static const char module[] = "PixarLogDecode";
+	int i, nsamples, llen;
+	uint16 *up;
+
+	switch (sp->user_datafmt) {
+	case PIXARLOGDATAFMT_FLOAT:
+		nsamples = occ / sizeof(float);	/* XXX float == 32 bits */
+		break;
+	case PIXARLOGDATAFMT_16BIT:
+	case PIXARLOGDATAFMT_12BITPICIO:
+	case PIXARLOGDATAFMT_11BITLOG:
+		nsamples = occ / sizeof(uint16); /* XXX uint16 == 16 bits */
+		break;
+	case PIXARLOGDATAFMT_8BIT:
+	case PIXARLOGDATAFMT_8BITABGR:
+		nsamples = occ;
+		break;
+	default:
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			"%d bit input not supported in PixarLog",
+			td->td_bitspersample);
+		return 0;
+	}
+
+	llen = sp->stride * td->td_imagewidth;
+
+	(void) s;
+	assert(sp != NULL);
+	sp->stream.next_out = (unsigned char *) sp->tbuf;
+	sp->stream.avail_out = nsamples * sizeof(uint16);
+	do {
+		int state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
+		if (state == Z_STREAM_END) {
+			break;			/* XXX */
+		}
+		if (state == Z_DATA_ERROR) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Decoding error at scanline %d, %s",
+			    tif->tif_name, tif->tif_row, sp->stream.msg);
+			if (inflateSync(&sp->stream) != Z_OK)
+				return (0);
+			continue;
+		}
+		if (state != Z_OK) {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: zlib error: %s",
+			    tif->tif_name, sp->stream.msg);
+			return (0);
+		}
+	} while (sp->stream.avail_out > 0);
+
+	/* hopefully, we got all the bytes we needed */
+	if (sp->stream.avail_out != 0) {
+		TIFFErrorExt(tif->tif_clientdata, module,
+		    "%s: Not enough data at scanline %d (short %d bytes)",
+		    tif->tif_name, tif->tif_row, sp->stream.avail_out);
+		return (0);
+	}
+
+	up = sp->tbuf;
+	/* Swap bytes in the data if from a different endian machine. */
+	if (tif->tif_flags & TIFF_SWAB)
+		TIFFSwabArrayOfShort(up, nsamples);
+
+	for (i = 0; i < nsamples; i += llen, up += llen) {
+		switch (sp->user_datafmt)  {
+		case PIXARLOGDATAFMT_FLOAT:
+			horizontalAccumulateF(up, llen, sp->stride,
+					(float *)op, sp->ToLinearF);
+			op += llen * sizeof(float);
+			break;
+		case PIXARLOGDATAFMT_16BIT:
+			horizontalAccumulate16(up, llen, sp->stride,
+					(uint16 *)op, sp->ToLinear16);
+			op += llen * sizeof(uint16);
+			break;
+		case PIXARLOGDATAFMT_12BITPICIO:
+			horizontalAccumulate12(up, llen, sp->stride,
+					(int16 *)op, sp->ToLinearF);
+			op += llen * sizeof(int16);
+			break;
+		case PIXARLOGDATAFMT_11BITLOG:
+			horizontalAccumulate11(up, llen, sp->stride,
+					(uint16 *)op);
+			op += llen * sizeof(uint16);
+			break;
+		case PIXARLOGDATAFMT_8BIT:
+			horizontalAccumulate8(up, llen, sp->stride,
+					(unsigned char *)op, sp->ToLinear8);
+			op += llen * sizeof(unsigned char);
+			break;
+		case PIXARLOGDATAFMT_8BITABGR:
+			horizontalAccumulate8abgr(up, llen, sp->stride,
+					(unsigned char *)op, sp->ToLinear8);
+			op += llen * sizeof(unsigned char);
+			break;
+		default:
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+				  "PixarLogDecode: unsupported bits/sample: %d", 
+				  td->td_bitspersample);
+			return (0);
+		}
+	}
+
+	return (1);
+}
+
+static int
+PixarLogSetupEncode(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	PixarLogState* sp = EncoderState(tif);
+	tsize_t tbuf_size;
+	static const char module[] = "PixarLogSetupEncode";
+
+	assert(sp != NULL);
+
+	/* for some reason, we can't do this in TIFFInitPixarLog */
+
+	sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ?
+	    td->td_samplesperpixel : 1);
+	tbuf_size = multiply(multiply(multiply(sp->stride, td->td_imagewidth),
+				      td->td_rowsperstrip), sizeof(uint16));
+	if (tbuf_size == 0)
+		return (0);
+	sp->tbuf = (uint16 *) _TIFFmalloc(tbuf_size);
+	if (sp->tbuf == NULL)
+		return (0);
+	if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN)
+		sp->user_datafmt = PixarLogGuessDataFmt(td);
+	if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) {
+		TIFFErrorExt(tif->tif_clientdata, module, "PixarLog compression can't handle %d bit linear encodings", td->td_bitspersample);
+		return (0);
+	}
+
+	if (deflateInit(&sp->stream, sp->quality) != Z_OK) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: %s", tif->tif_name, sp->stream.msg);
+		return (0);
+	} else {
+		sp->state |= PLSTATE_INIT;
+		return (1);
+	}
+}
+
+/*
+ * Reset encoding state at the start of a strip.
+ */
+static int
+PixarLogPreEncode(TIFF* tif, tsample_t s)
+{
+	PixarLogState *sp = EncoderState(tif);
+
+	(void) s;
+	assert(sp != NULL);
+	sp->stream.next_out = tif->tif_rawdata;
+	sp->stream.avail_out = tif->tif_rawdatasize;
+	return (deflateReset(&sp->stream) == Z_OK);
+}
+
+static void
+horizontalDifferenceF(float *ip, int n, int stride, uint16 *wp, uint16 *FromLT2)
+{
+
+    int32 r1, g1, b1, a1, r2, g2, b2, a2, mask;
+    float fltsize = Fltsize;
+
+#define  CLAMP(v) ( (v<(float)0.)   ? 0				\
+		  : (v<(float)2.)   ? FromLT2[(int)(v*fltsize)]	\
+		  : (v>(float)24.2) ? 2047			\
+		  : LogK1*log(v*LogK2) + 0.5 )
+
+    mask = CODE_MASK;
+    if (n >= stride) {
+	if (stride == 3) {
+	    r2 = wp[0] = (uint16) CLAMP(ip[0]);
+	    g2 = wp[1] = (uint16) CLAMP(ip[1]);
+	    b2 = wp[2] = (uint16) CLAMP(ip[2]);
+	    n -= 3;
+	    while (n > 0) {
+		n -= 3;
+		wp += 3;
+		ip += 3;
+		r1 = (int32) CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1;
+		g1 = (int32) CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1;
+		b1 = (int32) CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1;
+	    }
+	} else if (stride == 4) {
+	    r2 = wp[0] = (uint16) CLAMP(ip[0]);
+	    g2 = wp[1] = (uint16) CLAMP(ip[1]);
+	    b2 = wp[2] = (uint16) CLAMP(ip[2]);
+	    a2 = wp[3] = (uint16) CLAMP(ip[3]);
+	    n -= 4;
+	    while (n > 0) {
+		n -= 4;
+		wp += 4;
+		ip += 4;
+		r1 = (int32) CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1;
+		g1 = (int32) CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1;
+		b1 = (int32) CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1;
+		a1 = (int32) CLAMP(ip[3]); wp[3] = (a1-a2) & mask; a2 = a1;
+	    }
+	} else {
+	    ip += n - 1;	/* point to last one */
+	    wp += n - 1;	/* point to last one */
+	    n -= stride;
+	    while (n > 0) {
+		REPEAT(stride, wp[0] = (uint16) CLAMP(ip[0]);
+				wp[stride] -= wp[0];
+				wp[stride] &= mask;
+				wp--; ip--)
+		n -= stride;
+	    }
+	    REPEAT(stride, wp[0] = (uint16) CLAMP(ip[0]); wp--; ip--)
+	}
+    }
+}
+
+static void
+horizontalDifference16(unsigned short *ip, int n, int stride, 
+	unsigned short *wp, uint16 *From14)
+{
+    register int  r1, g1, b1, a1, r2, g2, b2, a2, mask;
+
+/* assumption is unsigned pixel values */
+#undef   CLAMP
+#define  CLAMP(v) From14[(v) >> 2]
+
+    mask = CODE_MASK;
+    if (n >= stride) {
+	if (stride == 3) {
+	    r2 = wp[0] = CLAMP(ip[0]);  g2 = wp[1] = CLAMP(ip[1]);
+	    b2 = wp[2] = CLAMP(ip[2]);
+	    n -= 3;
+	    while (n > 0) {
+		n -= 3;
+		wp += 3;
+		ip += 3;
+		r1 = CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1;
+		g1 = CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1;
+		b1 = CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1;
+	    }
+	} else if (stride == 4) {
+	    r2 = wp[0] = CLAMP(ip[0]);  g2 = wp[1] = CLAMP(ip[1]);
+	    b2 = wp[2] = CLAMP(ip[2]);  a2 = wp[3] = CLAMP(ip[3]);
+	    n -= 4;
+	    while (n > 0) {
+		n -= 4;
+		wp += 4;
+		ip += 4;
+		r1 = CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1;
+		g1 = CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1;
+		b1 = CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1;
+		a1 = CLAMP(ip[3]); wp[3] = (a1-a2) & mask; a2 = a1;
+	    }
+	} else {
+	    ip += n - 1;	/* point to last one */
+	    wp += n - 1;	/* point to last one */
+	    n -= stride;
+	    while (n > 0) {
+		REPEAT(stride, wp[0] = CLAMP(ip[0]);
+				wp[stride] -= wp[0];
+				wp[stride] &= mask;
+				wp--; ip--)
+		n -= stride;
+	    }
+	    REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--)
+	}
+    }
+}
+
+
+static void
+horizontalDifference8(unsigned char *ip, int n, int stride, 
+	unsigned short *wp, uint16 *From8)
+{
+    register int  r1, g1, b1, a1, r2, g2, b2, a2, mask;
+
+#undef	 CLAMP
+#define  CLAMP(v) (From8[(v)])
+
+    mask = CODE_MASK;
+    if (n >= stride) {
+	if (stride == 3) {
+	    r2 = wp[0] = CLAMP(ip[0]);  g2 = wp[1] = CLAMP(ip[1]);
+	    b2 = wp[2] = CLAMP(ip[2]);
+	    n -= 3;
+	    while (n > 0) {
+		n -= 3;
+		r1 = CLAMP(ip[3]); wp[3] = (r1-r2) & mask; r2 = r1;
+		g1 = CLAMP(ip[4]); wp[4] = (g1-g2) & mask; g2 = g1;
+		b1 = CLAMP(ip[5]); wp[5] = (b1-b2) & mask; b2 = b1;
+		wp += 3;
+		ip += 3;
+	    }
+	} else if (stride == 4) {
+	    r2 = wp[0] = CLAMP(ip[0]);  g2 = wp[1] = CLAMP(ip[1]);
+	    b2 = wp[2] = CLAMP(ip[2]);  a2 = wp[3] = CLAMP(ip[3]);
+	    n -= 4;
+	    while (n > 0) {
+		n -= 4;
+		r1 = CLAMP(ip[4]); wp[4] = (r1-r2) & mask; r2 = r1;
+		g1 = CLAMP(ip[5]); wp[5] = (g1-g2) & mask; g2 = g1;
+		b1 = CLAMP(ip[6]); wp[6] = (b1-b2) & mask; b2 = b1;
+		a1 = CLAMP(ip[7]); wp[7] = (a1-a2) & mask; a2 = a1;
+		wp += 4;
+		ip += 4;
+	    }
+	} else {
+	    wp += n + stride - 1;	/* point to last one */
+	    ip += n + stride - 1;	/* point to last one */
+	    n -= stride;
+	    while (n > 0) {
+		REPEAT(stride, wp[0] = CLAMP(ip[0]);
+				wp[stride] -= wp[0];
+				wp[stride] &= mask;
+				wp--; ip--)
+		n -= stride;
+	    }
+	    REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--)
+	}
+    }
+}
+
+/*
+ * Encode a chunk of pixels.
+ */
+static int
+PixarLogEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	PixarLogState *sp = EncoderState(tif);
+	static const char module[] = "PixarLogEncode";
+	int 	i, n, llen;
+	unsigned short * up;
+
+	(void) s;
+
+	switch (sp->user_datafmt) {
+	case PIXARLOGDATAFMT_FLOAT:
+		n = cc / sizeof(float);		/* XXX float == 32 bits */
+		break;
+	case PIXARLOGDATAFMT_16BIT:
+	case PIXARLOGDATAFMT_12BITPICIO:
+	case PIXARLOGDATAFMT_11BITLOG:
+		n = cc / sizeof(uint16);	/* XXX uint16 == 16 bits */
+		break;
+	case PIXARLOGDATAFMT_8BIT:
+	case PIXARLOGDATAFMT_8BITABGR:
+		n = cc;
+		break;
+	default:
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			"%d bit input not supported in PixarLog",
+			td->td_bitspersample);
+		return 0;
+	}
+
+	llen = sp->stride * td->td_imagewidth;
+
+	for (i = 0, up = sp->tbuf; i < n; i += llen, up += llen) {
+		switch (sp->user_datafmt)  {
+		case PIXARLOGDATAFMT_FLOAT:
+			horizontalDifferenceF((float *)bp, llen, 
+				sp->stride, up, sp->FromLT2);
+			bp += llen * sizeof(float);
+			break;
+		case PIXARLOGDATAFMT_16BIT:
+			horizontalDifference16((uint16 *)bp, llen, 
+				sp->stride, up, sp->From14);
+			bp += llen * sizeof(uint16);
+			break;
+		case PIXARLOGDATAFMT_8BIT:
+			horizontalDifference8((unsigned char *)bp, llen, 
+				sp->stride, up, sp->From8);
+			bp += llen * sizeof(unsigned char);
+			break;
+		default:
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+				"%d bit input not supported in PixarLog",
+				td->td_bitspersample);
+			return 0;
+		}
+	}
+ 
+	sp->stream.next_in = (unsigned char *) sp->tbuf;
+	sp->stream.avail_in = n * sizeof(uint16);
+
+	do {
+		if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: Encoder error: %s",
+			    tif->tif_name, sp->stream.msg);
+			return (0);
+		}
+		if (sp->stream.avail_out == 0) {
+			tif->tif_rawcc = tif->tif_rawdatasize;
+			TIFFFlushData1(tif);
+			sp->stream.next_out = tif->tif_rawdata;
+			sp->stream.avail_out = tif->tif_rawdatasize;
+		}
+	} while (sp->stream.avail_in > 0);
+	return (1);
+}
+
+/*
+ * Finish off an encoded strip by flushing the last
+ * string and tacking on an End Of Information code.
+ */
+
+static int
+PixarLogPostEncode(TIFF* tif)
+{
+	PixarLogState *sp = EncoderState(tif);
+	static const char module[] = "PixarLogPostEncode";
+	int state;
+
+	sp->stream.avail_in = 0;
+
+	do {
+		state = deflate(&sp->stream, Z_FINISH);
+		switch (state) {
+		case Z_STREAM_END:
+		case Z_OK:
+		    if (sp->stream.avail_out != (uint32)tif->tif_rawdatasize) {
+			    tif->tif_rawcc =
+				tif->tif_rawdatasize - sp->stream.avail_out;
+			    TIFFFlushData1(tif);
+			    sp->stream.next_out = tif->tif_rawdata;
+			    sp->stream.avail_out = tif->tif_rawdatasize;
+		    }
+		    break;
+		default:
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: zlib error: %s",
+			tif->tif_name, sp->stream.msg);
+		    return (0);
+		}
+	} while (state != Z_STREAM_END);
+	return (1);
+}
+
+static void
+PixarLogClose(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+
+	/* In a really sneaky maneuver, on close, we covertly modify both
+	 * bitspersample and sampleformat in the directory to indicate
+	 * 8-bit linear.  This way, the decode "just works" even for
+	 * readers that don't know about PixarLog, or how to set
+	 * the PIXARLOGDATFMT pseudo-tag.
+	 */
+	td->td_bitspersample = 8;
+	td->td_sampleformat = SAMPLEFORMAT_UINT;
+}
+
+static void
+PixarLogCleanup(TIFF* tif)
+{
+	PixarLogState* sp = (PixarLogState*) tif->tif_data;
+
+	assert(sp != 0);
+
+	(void)TIFFPredictorCleanup(tif);
+
+	tif->tif_tagmethods.vgetfield = sp->vgetparent;
+	tif->tif_tagmethods.vsetfield = sp->vsetparent;
+
+	if (sp->FromLT2) _TIFFfree(sp->FromLT2);
+	if (sp->From14) _TIFFfree(sp->From14);
+	if (sp->From8) _TIFFfree(sp->From8);
+	if (sp->ToLinearF) _TIFFfree(sp->ToLinearF);
+	if (sp->ToLinear16) _TIFFfree(sp->ToLinear16);
+	if (sp->ToLinear8) _TIFFfree(sp->ToLinear8);
+	if (sp->state&PLSTATE_INIT) {
+		if (tif->tif_mode == O_RDONLY)
+			inflateEnd(&sp->stream);
+		else
+			deflateEnd(&sp->stream);
+	}
+	if (sp->tbuf)
+		_TIFFfree(sp->tbuf);
+	_TIFFfree(sp);
+	tif->tif_data = NULL;
+
+	_TIFFSetDefaultCompressionState(tif);
+}
+
+static int
+PixarLogVSetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+    PixarLogState *sp = (PixarLogState *)tif->tif_data;
+    int result;
+    static const char module[] = "PixarLogVSetField";
+
+    switch (tag) {
+     case TIFFTAG_PIXARLOGQUALITY:
+		sp->quality = va_arg(ap, int);
+		if (tif->tif_mode != O_RDONLY && (sp->state&PLSTATE_INIT)) {
+			if (deflateParams(&sp->stream,
+			    sp->quality, Z_DEFAULT_STRATEGY) != Z_OK) {
+				TIFFErrorExt(tif->tif_clientdata, module, "%s: zlib error: %s",
+					tif->tif_name, sp->stream.msg);
+				return (0);
+			}
+		}
+		return (1);
+     case TIFFTAG_PIXARLOGDATAFMT:
+	sp->user_datafmt = va_arg(ap, int);
+	/* Tweak the TIFF header so that the rest of libtiff knows what
+	 * size of data will be passed between app and library, and
+	 * assume that the app knows what it is doing and is not
+	 * confused by these header manipulations...
+	 */
+	switch (sp->user_datafmt) {
+	 case PIXARLOGDATAFMT_8BIT:
+	 case PIXARLOGDATAFMT_8BITABGR:
+	    TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
+	    TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
+	    break;
+	 case PIXARLOGDATAFMT_11BITLOG:
+	    TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 16);
+	    TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
+	    break;
+	 case PIXARLOGDATAFMT_12BITPICIO:
+	    TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 16);
+	    TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT);
+	    break;
+	 case PIXARLOGDATAFMT_16BIT:
+	    TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 16);
+	    TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
+	    break;
+	 case PIXARLOGDATAFMT_FLOAT:
+	    TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 32);
+	    TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP);
+	    break;
+	}
+	/*
+	 * Must recalculate sizes should bits/sample change.
+	 */
+	tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (tsize_t) -1;
+	tif->tif_scanlinesize = TIFFScanlineSize(tif);
+	result = 1;		/* NB: pseudo tag */
+	break;
+     default:
+	result = (*sp->vsetparent)(tif, tag, ap);
+    }
+    return (result);
+}
+
+static int
+PixarLogVGetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+    PixarLogState *sp = (PixarLogState *)tif->tif_data;
+
+    switch (tag) {
+     case TIFFTAG_PIXARLOGQUALITY:
+	*va_arg(ap, int*) = sp->quality;
+	break;
+     case TIFFTAG_PIXARLOGDATAFMT:
+	*va_arg(ap, int*) = sp->user_datafmt;
+	break;
+     default:
+	return (*sp->vgetparent)(tif, tag, ap);
+    }
+    return (1);
+}
+
+static const TIFFFieldInfo pixarlogFieldInfo[] = {
+    {TIFFTAG_PIXARLOGDATAFMT,0,0,TIFF_ANY,  FIELD_PSEUDO,FALSE,FALSE,""},
+    {TIFFTAG_PIXARLOGQUALITY,0,0,TIFF_ANY,  FIELD_PSEUDO,FALSE,FALSE,""}
+};
+
+int
+TIFFInitPixarLog(TIFF* tif, int scheme)
+{
+	PixarLogState* sp;
+
+	assert(scheme == COMPRESSION_PIXARLOG);
+
+	/*
+	 * Allocate state block so tag methods have storage to record values.
+	 */
+	tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (PixarLogState));
+	if (tif->tif_data == NULL)
+		goto bad;
+	sp = (PixarLogState*) tif->tif_data;
+	_TIFFmemset(sp, 0, sizeof (*sp));
+	sp->stream.data_type = Z_BINARY;
+	sp->user_datafmt = PIXARLOGDATAFMT_UNKNOWN;
+
+	/*
+	 * Install codec methods.
+	 */
+	tif->tif_setupdecode = PixarLogSetupDecode;
+	tif->tif_predecode = PixarLogPreDecode;
+	tif->tif_decoderow = PixarLogDecode;
+	tif->tif_decodestrip = PixarLogDecode;
+	tif->tif_decodetile = PixarLogDecode;
+	tif->tif_setupencode = PixarLogSetupEncode;
+	tif->tif_preencode = PixarLogPreEncode;
+	tif->tif_postencode = PixarLogPostEncode;
+	tif->tif_encoderow = PixarLogEncode;
+	tif->tif_encodestrip = PixarLogEncode;
+	tif->tif_encodetile = PixarLogEncode;
+	tif->tif_close = PixarLogClose;
+	tif->tif_cleanup = PixarLogCleanup;
+
+	/* Override SetField so we can handle our private pseudo-tag */
+	_TIFFMergeFieldInfo(tif, pixarlogFieldInfo, N(pixarlogFieldInfo));
+	sp->vgetparent = tif->tif_tagmethods.vgetfield;
+	tif->tif_tagmethods.vgetfield = PixarLogVGetField;   /* hook for codec tags */
+	sp->vsetparent = tif->tif_tagmethods.vsetfield;
+	tif->tif_tagmethods.vsetfield = PixarLogVSetField;   /* hook for codec tags */
+
+	/* Default values for codec-specific fields */
+	sp->quality = Z_DEFAULT_COMPRESSION; /* default comp. level */
+	sp->state = 0;
+
+	/* we don't wish to use the predictor, 
+	 * the default is none, which predictor value 1
+	 */
+	(void) TIFFPredictorInit(tif);
+
+	/*
+	 * build the companding tables 
+	 */
+	PixarLogMakeTables(sp);
+
+	return (1);
+bad:
+	TIFFErrorExt(tif->tif_clientdata, "TIFFInitPixarLog",
+		     "No space for PixarLog state block");
+	return (0);
+}
+#endif /* PIXARLOG_SUPPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_predict.c b/src/tiff/tif_predict.c
new file mode 100644
index 0000000..32b58cd
--- /dev/null
+++ b/src/tiff/tif_predict.c
@@ -0,0 +1,626 @@
+/* $Id: tif_predict.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Predictor Tag Support (used by multiple codecs).
+ */
+#include "tiffiop.h"
+#include "tif_predict.h"
+
+#define	PredictorState(tif)	((TIFFPredictorState*) (tif)->tif_data)
+
+static	void horAcc8(TIFF*, tidata_t, tsize_t);
+static	void horAcc16(TIFF*, tidata_t, tsize_t);
+static	void swabHorAcc16(TIFF*, tidata_t, tsize_t);
+static	void horDiff8(TIFF*, tidata_t, tsize_t);
+static	void horDiff16(TIFF*, tidata_t, tsize_t);
+static	void fpAcc(TIFF*, tidata_t, tsize_t);
+static	void fpDiff(TIFF*, tidata_t, tsize_t);
+static	int PredictorDecodeRow(TIFF*, tidata_t, tsize_t, tsample_t);
+static	int PredictorDecodeTile(TIFF*, tidata_t, tsize_t, tsample_t);
+static	int PredictorEncodeRow(TIFF*, tidata_t, tsize_t, tsample_t);
+static	int PredictorEncodeTile(TIFF*, tidata_t, tsize_t, tsample_t);
+
+static int
+PredictorSetup(TIFF* tif)
+{
+	static const char module[] = "PredictorSetup";
+
+	TIFFPredictorState* sp = PredictorState(tif);
+	TIFFDirectory* td = &tif->tif_dir;
+
+	switch (sp->predictor)		/* no differencing */
+	{
+		case PREDICTOR_NONE:
+			return 1;
+		case PREDICTOR_HORIZONTAL:
+			if (td->td_bitspersample != 8
+			    && td->td_bitspersample != 16) {
+				TIFFErrorExt(tif->tif_clientdata, module,
+    "Horizontal differencing \"Predictor\" not supported with %d-bit samples",
+					  td->td_bitspersample);
+				return 0;
+			}
+			break;
+		case PREDICTOR_FLOATINGPOINT:
+			if (td->td_sampleformat != SAMPLEFORMAT_IEEEFP) {
+				TIFFErrorExt(tif->tif_clientdata, module,
+	"Floating point \"Predictor\" not supported with %d data format",
+					  td->td_sampleformat);
+				return 0;
+			}
+			break;
+		default:
+			TIFFErrorExt(tif->tif_clientdata, module,
+				  "\"Predictor\" value %d not supported",
+				  sp->predictor);
+			return 0;
+	}
+	sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ?
+	    td->td_samplesperpixel : 1);
+	/*
+	 * Calculate the scanline/tile-width size in bytes.
+	 */
+	if (isTiled(tif))
+		sp->rowsize = TIFFTileRowSize(tif);
+	else
+		sp->rowsize = TIFFScanlineSize(tif);
+
+	return 1;
+}
+
+static int
+PredictorSetupDecode(TIFF* tif)
+{
+	TIFFPredictorState* sp = PredictorState(tif);
+	TIFFDirectory* td = &tif->tif_dir;
+
+	if (!(*sp->setupdecode)(tif) || !PredictorSetup(tif))
+		return 0;
+
+	if (sp->predictor == 2) {
+		switch (td->td_bitspersample) {
+			case 8:  sp->pfunc = horAcc8; break;
+			case 16: sp->pfunc = horAcc16; break;
+		}
+		/*
+		 * Override default decoding method with one that does the
+		 * predictor stuff.
+		 */
+		sp->coderow = tif->tif_decoderow;
+		tif->tif_decoderow = PredictorDecodeRow;
+		sp->codestrip = tif->tif_decodestrip;
+		tif->tif_decodestrip = PredictorDecodeTile;
+		sp->codetile = tif->tif_decodetile;
+		tif->tif_decodetile = PredictorDecodeTile;
+		/*
+		 * If the data is horizontally differenced 16-bit data that
+		 * requires byte-swapping, then it must be byte swapped before
+		 * the accumulation step.  We do this with a special-purpose
+		 * routine and override the normal post decoding logic that
+		 * the library setup when the directory was read.
+		 */
+		if (tif->tif_flags & TIFF_SWAB) {
+			if (sp->pfunc == horAcc16) {
+				sp->pfunc = swabHorAcc16;
+				tif->tif_postdecode = _TIFFNoPostDecode;
+			} /* else handle 32-bit case... */
+		}
+	}
+
+	else if (sp->predictor == 3) {
+		sp->pfunc = fpAcc;
+		/*
+		 * Override default decoding method with one that does the
+		 * predictor stuff.
+		 */
+		sp->coderow = tif->tif_decoderow;
+		tif->tif_decoderow = PredictorDecodeRow;
+		sp->codestrip = tif->tif_decodestrip;
+		tif->tif_decodestrip = PredictorDecodeTile;
+		sp->codetile = tif->tif_decodetile;
+		tif->tif_decodetile = PredictorDecodeTile;
+		/*
+		 * The data should not be swapped outside of the floating
+		 * point predictor, the accumulation routine should return
+		 * byres in the native order.
+		 */
+		if (tif->tif_flags & TIFF_SWAB) {
+			tif->tif_postdecode = _TIFFNoPostDecode;
+		}
+		/*
+		 * Allocate buffer to keep the decoded bytes before
+		 * rearranging in the ight order
+		 */
+	}
+
+	return 1;
+}
+
+static int
+PredictorSetupEncode(TIFF* tif)
+{
+	TIFFPredictorState* sp = PredictorState(tif);
+	TIFFDirectory* td = &tif->tif_dir;
+
+	if (!(*sp->setupencode)(tif) || !PredictorSetup(tif))
+		return 0;
+
+	if (sp->predictor == 2) {
+		switch (td->td_bitspersample) {
+			case 8:  sp->pfunc = horDiff8; break;
+			case 16: sp->pfunc = horDiff16; break;
+		}
+		/*
+		 * Override default encoding method with one that does the
+		 * predictor stuff.
+		 */
+		sp->coderow = tif->tif_encoderow;
+		tif->tif_encoderow = PredictorEncodeRow;
+		sp->codestrip = tif->tif_encodestrip;
+		tif->tif_encodestrip = PredictorEncodeTile;
+		sp->codetile = tif->tif_encodetile;
+		tif->tif_encodetile = PredictorEncodeTile;
+	}
+	
+	else if (sp->predictor == 3) {
+		sp->pfunc = fpDiff;
+		/*
+		 * Override default encoding method with one that does the
+		 * predictor stuff.
+		 */
+		sp->coderow = tif->tif_encoderow;
+		tif->tif_encoderow = PredictorEncodeRow;
+		sp->codestrip = tif->tif_encodestrip;
+		tif->tif_encodestrip = PredictorEncodeTile;
+		sp->codetile = tif->tif_encodetile;
+		tif->tif_encodetile = PredictorEncodeTile;
+	}
+
+	return 1;
+}
+
+#define REPEAT4(n, op)		\
+    switch (n) {		\
+    default: { int i; for (i = n-4; i > 0; i--) { op; } } \
+    case 4:  op;		\
+    case 3:  op;		\
+    case 2:  op;		\
+    case 1:  op;		\
+    case 0:  ;			\
+    }
+
+static void
+horAcc8(TIFF* tif, tidata_t cp0, tsize_t cc)
+{
+	tsize_t stride = PredictorState(tif)->stride;
+
+	char* cp = (char*) cp0;
+	if (cc > stride) {
+		cc -= stride;
+		/*
+		 * Pipeline the most common cases.
+		 */
+		if (stride == 3)  {
+			unsigned int cr = cp[0];
+			unsigned int cg = cp[1];
+			unsigned int cb = cp[2];
+			do {
+				cc -= 3, cp += 3;
+				cp[0] = (char) (cr += cp[0]);
+				cp[1] = (char) (cg += cp[1]);
+				cp[2] = (char) (cb += cp[2]);
+			} while ((int32) cc > 0);
+		} else if (stride == 4)  {
+			unsigned int cr = cp[0];
+			unsigned int cg = cp[1];
+			unsigned int cb = cp[2];
+			unsigned int ca = cp[3];
+			do {
+				cc -= 4, cp += 4;
+				cp[0] = (char) (cr += cp[0]);
+				cp[1] = (char) (cg += cp[1]);
+				cp[2] = (char) (cb += cp[2]);
+				cp[3] = (char) (ca += cp[3]);
+			} while ((int32) cc > 0);
+		} else  {
+			do {
+				REPEAT4(stride, cp[stride] =
+					(char) (cp[stride] + *cp); cp++)
+				cc -= stride;
+			} while ((int32) cc > 0);
+		}
+	}
+}
+
+static void
+swabHorAcc16(TIFF* tif, tidata_t cp0, tsize_t cc)
+{
+	tsize_t stride = PredictorState(tif)->stride;
+	uint16* wp = (uint16*) cp0;
+	tsize_t wc = cc / 2;
+
+	if (wc > stride) {
+		TIFFSwabArrayOfShort(wp, wc);
+		wc -= stride;
+		do {
+			REPEAT4(stride, wp[stride] += wp[0]; wp++)
+			wc -= stride;
+		} while ((int32) wc > 0);
+	}
+}
+
+static void
+horAcc16(TIFF* tif, tidata_t cp0, tsize_t cc)
+{
+	tsize_t stride = PredictorState(tif)->stride;
+	uint16* wp = (uint16*) cp0;
+	tsize_t wc = cc / 2;
+
+	if (wc > stride) {
+		wc -= stride;
+		do {
+			REPEAT4(stride, wp[stride] += wp[0]; wp++)
+			wc -= stride;
+		} while ((int32) wc > 0);
+	}
+}
+
+/*
+ * Floating point predictor accumulation routine.
+ */
+static void
+fpAcc(TIFF* tif, tidata_t cp0, tsize_t cc)
+{
+	tsize_t stride = PredictorState(tif)->stride;
+	uint32 bps = tif->tif_dir.td_bitspersample / 8;
+	tsize_t wc = cc / bps;
+	tsize_t count = cc;
+	uint8 *cp = (uint8 *) cp0;
+	uint8 *tmp = (uint8 *)_TIFFmalloc(cc);
+
+	if (!tmp)
+		return;
+
+	while (count > stride) {
+		REPEAT4(stride, cp[stride] += cp[0]; cp++)
+		count -= stride;
+	}
+
+	_TIFFmemcpy(tmp, cp0, cc);
+	cp = (uint8 *) cp0;
+	for (count = 0; count < wc; count++) {
+		uint32 byte;
+		for (byte = 0; byte < bps; byte++) {
+#if WORDS_BIGENDIAN
+			cp[bps * count + byte] = tmp[byte * wc + count];
+#else
+			cp[bps * count + byte] =
+				tmp[(bps - byte - 1) * wc + count];
+#endif
+		}
+	}
+	_TIFFfree(tmp);
+}
+
+/*
+ * Decode a scanline and apply the predictor routine.
+ */
+static int
+PredictorDecodeRow(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s)
+{
+	TIFFPredictorState *sp = PredictorState(tif);
+
+	assert(sp != NULL);
+	assert(sp->coderow != NULL);
+	assert(sp->pfunc != NULL);
+
+	if ((*sp->coderow)(tif, op0, occ0, s)) {
+		(*sp->pfunc)(tif, op0, occ0);
+		return 1;
+	} else
+		return 0;
+}
+
+/*
+ * Decode a tile/strip and apply the predictor routine.
+ * Note that horizontal differencing must be done on a
+ * row-by-row basis.  The width of a "row" has already
+ * been calculated at pre-decode time according to the
+ * strip/tile dimensions.
+ */
+static int
+PredictorDecodeTile(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s)
+{
+	TIFFPredictorState *sp = PredictorState(tif);
+
+	assert(sp != NULL);
+	assert(sp->codetile != NULL);
+
+	if ((*sp->codetile)(tif, op0, occ0, s)) {
+		tsize_t rowsize = sp->rowsize;
+		assert(rowsize > 0);
+		assert(sp->pfunc != NULL);
+		while ((long)occ0 > 0) {
+			(*sp->pfunc)(tif, op0, (tsize_t) rowsize);
+			occ0 -= rowsize;
+			op0 += rowsize;
+		}
+		return 1;
+	} else
+		return 0;
+}
+
+static void
+horDiff8(TIFF* tif, tidata_t cp0, tsize_t cc)
+{
+	TIFFPredictorState* sp = PredictorState(tif);
+	tsize_t stride = sp->stride;
+	char* cp = (char*) cp0;
+
+	if (cc > stride) {
+		cc -= stride;
+		/*
+		 * Pipeline the most common cases.
+		 */
+		if (stride == 3) {
+			int r1, g1, b1;
+			int r2 = cp[0];
+			int g2 = cp[1];
+			int b2 = cp[2];
+			do {
+				r1 = cp[3]; cp[3] = r1-r2; r2 = r1;
+				g1 = cp[4]; cp[4] = g1-g2; g2 = g1;
+				b1 = cp[5]; cp[5] = b1-b2; b2 = b1;
+				cp += 3;
+			} while ((int32)(cc -= 3) > 0);
+		} else if (stride == 4) {
+			int r1, g1, b1, a1;
+			int r2 = cp[0];
+			int g2 = cp[1];
+			int b2 = cp[2];
+			int a2 = cp[3];
+			do {
+				r1 = cp[4]; cp[4] = r1-r2; r2 = r1;
+				g1 = cp[5]; cp[5] = g1-g2; g2 = g1;
+				b1 = cp[6]; cp[6] = b1-b2; b2 = b1;
+				a1 = cp[7]; cp[7] = a1-a2; a2 = a1;
+				cp += 4;
+			} while ((int32)(cc -= 4) > 0);
+		} else {
+			cp += cc - 1;
+			do {
+				REPEAT4(stride, cp[stride] -= cp[0]; cp--)
+			} while ((int32)(cc -= stride) > 0);
+		}
+	}
+}
+
+static void
+horDiff16(TIFF* tif, tidata_t cp0, tsize_t cc)
+{
+	TIFFPredictorState* sp = PredictorState(tif);
+	tsize_t stride = sp->stride;
+	int16 *wp = (int16*) cp0;
+	tsize_t wc = cc/2;
+
+	if (wc > stride) {
+		wc -= stride;
+		wp += wc - 1;
+		do {
+			REPEAT4(stride, wp[stride] -= wp[0]; wp--)
+			wc -= stride;
+		} while ((int32) wc > 0);
+	}
+}
+
+/*
+ * Floating point predictor differencing routine.
+ */
+static void
+fpDiff(TIFF* tif, tidata_t cp0, tsize_t cc)
+{
+	tsize_t stride = PredictorState(tif)->stride;
+	uint32 bps = tif->tif_dir.td_bitspersample / 8;
+	tsize_t wc = cc / bps;
+	tsize_t count;
+	uint8 *cp = (uint8 *) cp0;
+	uint8 *tmp = (uint8 *)_TIFFmalloc(cc);
+
+	if (!tmp)
+		return;
+
+	_TIFFmemcpy(tmp, cp0, cc);
+	for (count = 0; count < wc; count++) {
+		uint32 byte;
+		for (byte = 0; byte < bps; byte++) {
+#if WORDS_BIGENDIAN
+			cp[byte * wc + count] =	tmp[bps * count + byte];
+#else
+			cp[(bps - byte - 1) * wc + count] =
+				tmp[bps * count + byte];
+#endif
+		}
+	}
+	_TIFFfree(tmp);
+
+	cp = (uint8 *) cp0;
+	cp += cc - stride - 1;
+	for (count = cc; count > stride; count -= stride)
+		REPEAT4(stride, cp[stride] -= cp[0]; cp--)
+}
+
+static int
+PredictorEncodeRow(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	TIFFPredictorState *sp = PredictorState(tif);
+
+	assert(sp != NULL);
+	assert(sp->pfunc != NULL);
+	assert(sp->coderow != NULL);
+
+	/* XXX horizontal differencing alters user's data XXX */
+	(*sp->pfunc)(tif, bp, cc);
+	return (*sp->coderow)(tif, bp, cc, s);
+}
+
+static int
+PredictorEncodeTile(TIFF* tif, tidata_t bp0, tsize_t cc0, tsample_t s)
+{
+	TIFFPredictorState *sp = PredictorState(tif);
+	tsize_t cc = cc0, rowsize;
+	unsigned char* bp = bp0;
+
+	assert(sp != NULL);
+	assert(sp->pfunc != NULL);
+	assert(sp->codetile != NULL);
+
+	rowsize = sp->rowsize;
+	assert(rowsize > 0);
+	while ((long)cc > 0) {
+		(*sp->pfunc)(tif, bp, (tsize_t) rowsize);
+		cc -= rowsize;
+		bp += rowsize;
+	}
+	return (*sp->codetile)(tif, bp0, cc0, s);
+}
+
+#define	FIELD_PREDICTOR	(FIELD_CODEC+0)		/* XXX */
+
+static const TIFFFieldInfo predictFieldInfo[] = {
+    { TIFFTAG_PREDICTOR,	 1, 1, TIFF_SHORT,	FIELD_PREDICTOR,
+      FALSE,	FALSE,	"Predictor" },
+};
+#define	N(a)	(sizeof (a) / sizeof (a[0]))
+
+static int
+PredictorVSetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	TIFFPredictorState *sp = PredictorState(tif);
+
+	assert(sp != NULL);
+	assert(sp->vsetparent != NULL);
+
+	switch (tag) {
+	case TIFFTAG_PREDICTOR:
+		sp->predictor = (uint16) va_arg(ap, int);
+		TIFFSetFieldBit(tif, FIELD_PREDICTOR);
+		break;
+	default:
+		return (*sp->vsetparent)(tif, tag, ap);
+	}
+	tif->tif_flags |= TIFF_DIRTYDIRECT;
+	return 1;
+}
+
+static int
+PredictorVGetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	TIFFPredictorState *sp = PredictorState(tif);
+
+	assert(sp != NULL);
+	assert(sp->vgetparent != NULL);
+
+	switch (tag) {
+	case TIFFTAG_PREDICTOR:
+		*va_arg(ap, uint16*) = sp->predictor;
+		break;
+	default:
+		return (*sp->vgetparent)(tif, tag, ap);
+	}
+	return 1;
+}
+
+static void
+PredictorPrintDir(TIFF* tif, FILE* fd, long flags)
+{
+	TIFFPredictorState* sp = PredictorState(tif);
+
+	(void) flags;
+	if (TIFFFieldSet(tif,FIELD_PREDICTOR)) {
+		fprintf(fd, "  Predictor: ");
+		switch (sp->predictor) {
+		case 1: fprintf(fd, "none "); break;
+		case 2: fprintf(fd, "horizontal differencing "); break;
+		case 3: fprintf(fd, "floating point predictor "); break;
+		}
+		fprintf(fd, "%u (0x%x)\n", sp->predictor, sp->predictor);
+	}
+	if (sp->printdir)
+		(*sp->printdir)(tif, fd, flags);
+}
+
+int
+TIFFPredictorInit(TIFF* tif)
+{
+	TIFFPredictorState* sp = PredictorState(tif);
+
+	assert(sp != 0);
+
+	/*
+	 * Merge codec-specific tag information and
+	 * override parent get/set field methods.
+	 */
+	_TIFFMergeFieldInfo(tif, predictFieldInfo, N(predictFieldInfo));
+	sp->vgetparent = tif->tif_tagmethods.vgetfield;
+	tif->tif_tagmethods.vgetfield =
+            PredictorVGetField;/* hook for predictor tag */
+	sp->vsetparent = tif->tif_tagmethods.vsetfield;
+	tif->tif_tagmethods.vsetfield =
+            PredictorVSetField;/* hook for predictor tag */
+	sp->printdir = tif->tif_tagmethods.printdir;
+	tif->tif_tagmethods.printdir =
+            PredictorPrintDir;	/* hook for predictor tag */
+
+	sp->setupdecode = tif->tif_setupdecode;
+	tif->tif_setupdecode = PredictorSetupDecode;
+	sp->setupencode = tif->tif_setupencode;
+	tif->tif_setupencode = PredictorSetupEncode;
+
+	sp->predictor = 1;			/* default value */
+	sp->pfunc = NULL;			/* no predictor routine */
+	return 1;
+}
+
+int
+TIFFPredictorCleanup(TIFF* tif)
+{
+	TIFFPredictorState* sp = PredictorState(tif);
+
+	assert(sp != 0);
+
+	tif->tif_tagmethods.vgetfield = sp->vgetparent;
+	tif->tif_tagmethods.vsetfield = sp->vsetparent;
+	tif->tif_tagmethods.printdir = sp->printdir;
+	tif->tif_setupdecode = sp->setupdecode;
+	tif->tif_setupencode = sp->setupencode;
+
+	return 1;
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_predict.h b/src/tiff/tif_predict.h
new file mode 100644
index 0000000..0860d51
--- /dev/null
+++ b/src/tiff/tif_predict.h
@@ -0,0 +1,64 @@
+/* $Id: tif_predict.h 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1995-1997 Sam Leffler
+ * Copyright (c) 1995-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _TIFFPREDICT_
+#define	_TIFFPREDICT_
+/*
+ * ``Library-private'' Support for the Predictor Tag
+ */
+
+/*
+ * Codecs that want to support the Predictor tag must place
+ * this structure first in their private state block so that
+ * the predictor code can cast tif_data to find its state.
+ */
+typedef struct {
+	int		predictor;	/* predictor tag value */
+	int		stride;		/* sample stride over data */
+	tsize_t		rowsize;	/* tile/strip row size */
+
+	TIFFPostMethod	pfunc;		/* horizontal differencer/accumulator */
+	TIFFCodeMethod	coderow;	/* parent codec encode/decode row */
+	TIFFCodeMethod	codestrip;	/* parent codec encode/decode strip */
+	TIFFCodeMethod	codetile;	/* parent codec encode/decode tile */
+	TIFFVGetMethod	vgetparent;	/* super-class method */
+	TIFFVSetMethod	vsetparent;	/* super-class method */
+	TIFFPrintMethod	printdir;	/* super-class method */
+	TIFFBoolMethod	setupdecode;	/* super-class method */
+	TIFFBoolMethod	setupencode;	/* super-class method */
+} TIFFPredictorState;
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+extern	int TIFFPredictorInit(TIFF*);
+extern	int TIFFPredictorCleanup(TIFF*);
+#if defined(__cplusplus)
+}
+#endif
+#endif /* _TIFFPREDICT_ */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_print.c b/src/tiff/tif_print.c
new file mode 100644
index 0000000..85c63af
--- /dev/null
+++ b/src/tiff/tif_print.c
@@ -0,0 +1,639 @@
+/* $Id: tif_print.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Directory Printing Support
+ */
+#include "tiffiop.h"
+#include <stdio.h>
+
+#include <ctype.h>
+
+static const char *photoNames[] = {
+    "min-is-white",				/* PHOTOMETRIC_MINISWHITE */
+    "min-is-black",				/* PHOTOMETRIC_MINISBLACK */
+    "RGB color",				/* PHOTOMETRIC_RGB */
+    "palette color (RGB from colormap)",	/* PHOTOMETRIC_PALETTE */
+    "transparency mask",			/* PHOTOMETRIC_MASK */
+    "separated",				/* PHOTOMETRIC_SEPARATED */
+    "YCbCr",					/* PHOTOMETRIC_YCBCR */
+    "7 (0x7)",
+    "CIE L*a*b*",				/* PHOTOMETRIC_CIELAB */
+};
+#define	NPHOTONAMES	(sizeof (photoNames) / sizeof (photoNames[0]))
+
+static const char *orientNames[] = {
+    "0 (0x0)",
+    "row 0 top, col 0 lhs",			/* ORIENTATION_TOPLEFT */
+    "row 0 top, col 0 rhs",			/* ORIENTATION_TOPRIGHT */
+    "row 0 bottom, col 0 rhs",			/* ORIENTATION_BOTRIGHT */
+    "row 0 bottom, col 0 lhs",			/* ORIENTATION_BOTLEFT */
+    "row 0 lhs, col 0 top",			/* ORIENTATION_LEFTTOP */
+    "row 0 rhs, col 0 top",			/* ORIENTATION_RIGHTTOP */
+    "row 0 rhs, col 0 bottom",			/* ORIENTATION_RIGHTBOT */
+    "row 0 lhs, col 0 bottom",			/* ORIENTATION_LEFTBOT */
+};
+#define	NORIENTNAMES	(sizeof (orientNames) / sizeof (orientNames[0]))
+
+static void
+_TIFFPrintField(FILE* fd, const TIFFFieldInfo *fip,
+		uint32 value_count, void *raw_data)
+{
+	uint32 j;
+		
+	fprintf(fd, "  %s: ", fip->field_name);
+
+	for(j = 0; j < value_count; j++) {
+		if(fip->field_type == TIFF_BYTE)
+			fprintf(fd, "%u", ((uint8 *) raw_data)[j]);
+		else if(fip->field_type == TIFF_UNDEFINED)
+			fprintf(fd, "0x%x",
+				(unsigned int) ((unsigned char *) raw_data)[j]);
+		else if(fip->field_type == TIFF_SBYTE)
+			fprintf(fd, "%d", ((int8 *) raw_data)[j]);
+		else if(fip->field_type == TIFF_SHORT)
+			fprintf(fd, "%u", ((uint16 *) raw_data)[j]);
+		else if(fip->field_type == TIFF_SSHORT)
+			fprintf(fd, "%d", ((int16 *) raw_data)[j]);
+		else if(fip->field_type == TIFF_LONG)
+			fprintf(fd, "%lu",
+				(unsigned long)((uint32 *) raw_data)[j]);
+		else if(fip->field_type == TIFF_SLONG)
+			fprintf(fd, "%ld", (long)((int32 *) raw_data)[j]);
+		else if(fip->field_type == TIFF_RATIONAL
+			|| fip->field_type == TIFF_SRATIONAL
+			|| fip->field_type == TIFF_FLOAT)
+			fprintf(fd, "%f", ((float *) raw_data)[j]);
+		else if(fip->field_type == TIFF_IFD)
+			fprintf(fd, "0x%ulx", ((uint32 *) raw_data)[j]);
+		else if(fip->field_type == TIFF_ASCII) {
+			fprintf(fd, "%s", (char *) raw_data);
+			break;
+		}
+		else if(fip->field_type == TIFF_DOUBLE)
+			fprintf(fd, "%f", ((double *) raw_data)[j]);
+		else if(fip->field_type == TIFF_FLOAT)
+			fprintf(fd, "%f", ((float *)raw_data)[j]);
+		else {
+			fprintf(fd, "<unsupported data type in TIFFPrint>");
+			break;
+		}
+
+		if(j < value_count - 1)
+			fprintf(fd, ",");
+	}
+
+	fprintf(fd, "\n");
+}
+
+static int
+_TIFFPrettyPrintField(TIFF* tif, FILE* fd, ttag_t tag,
+		      uint32 value_count, void *raw_data)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+
+	switch (tag)
+	{
+		case TIFFTAG_INKSET:
+			fprintf(fd, "  Ink Set: ");
+			switch (*((uint16*)raw_data)) {
+				case INKSET_CMYK:
+					fprintf(fd, "CMYK\n");
+					break;
+				default:
+					fprintf(fd, "%u (0x%x)\n",
+						*((uint16*)raw_data),
+						*((uint16*)raw_data));
+					break;
+			}
+			return 1;
+		case TIFFTAG_DOTRANGE:
+			fprintf(fd, "  Dot Range: %u-%u\n",
+				((uint16*)raw_data)[0], ((uint16*)raw_data)[1]);
+			return 1;
+		case TIFFTAG_WHITEPOINT:
+			fprintf(fd, "  White Point: %g-%g\n",
+				((float *)raw_data)[0], ((float *)raw_data)[1]);			return 1;
+		case TIFFTAG_REFERENCEBLACKWHITE:
+		{
+			uint16 i;
+
+			fprintf(fd, "  Reference Black/White:\n");
+			for (i = 0; i < td->td_samplesperpixel; i++)
+			fprintf(fd, "    %2d: %5g %5g\n", i,
+				((float *)raw_data)[2*i+0],
+				((float *)raw_data)[2*i+1]);
+			return 1;
+		}
+		case TIFFTAG_XMLPACKET:
+		{
+			uint32 i;
+			
+			fprintf(fd, "  XMLPacket (XMP Metadata):\n" );
+			for(i = 0; i < value_count; i++)
+				fputc(((char *)raw_data)[i], fd);
+			fprintf( fd, "\n" );
+			return 1;
+		}
+		case TIFFTAG_RICHTIFFIPTC:
+			/*
+			 * XXX: for some weird reason RichTIFFIPTC tag
+			 * defined as array of LONG values.
+			 */
+			fprintf(fd,
+				"  RichTIFFIPTC Data: <present>, %lu bytes\n",
+				(unsigned long) value_count * 4);
+			return 1;
+		case TIFFTAG_PHOTOSHOP:
+			fprintf(fd, "  Photoshop Data: <present>, %lu bytes\n",
+				(unsigned long) value_count);
+			return 1;
+		case TIFFTAG_ICCPROFILE:
+			fprintf(fd, "  ICC Profile: <present>, %lu bytes\n",
+				(unsigned long) value_count);
+			return 1;
+		case TIFFTAG_STONITS:
+			fprintf(fd,
+				"  Sample to Nits conversion factor: %.4e\n",
+				*((double*)raw_data));
+			return 1;
+        }
+
+	return 0;
+}
+
+/*
+ * Print the contents of the current directory
+ * to the specified stdio file stream.
+ */
+void
+TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	char *sep;
+	uint16 i;
+	long l, n;
+
+	fprintf(fd, "TIFF Directory at offset 0x%lx (%lu)\n",
+		(unsigned long)tif->tif_diroff, (unsigned long)tif->tif_diroff);
+	if (TIFFFieldSet(tif,FIELD_SUBFILETYPE)) {
+		fprintf(fd, "  Subfile Type:");
+		sep = " ";
+		if (td->td_subfiletype & FILETYPE_REDUCEDIMAGE) {
+			fprintf(fd, "%sreduced-resolution image", sep);
+			sep = "/";
+		}
+		if (td->td_subfiletype & FILETYPE_PAGE) {
+			fprintf(fd, "%smulti-page document", sep);
+			sep = "/";
+		}
+		if (td->td_subfiletype & FILETYPE_MASK)
+			fprintf(fd, "%stransparency mask", sep);
+		fprintf(fd, " (%lu = 0x%lx)\n",
+		    (long) td->td_subfiletype, (long) td->td_subfiletype);
+	}
+	if (TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) {
+		fprintf(fd, "  Image Width: %lu Image Length: %lu",
+		    (unsigned long) td->td_imagewidth, (unsigned long) td->td_imagelength);
+		if (TIFFFieldSet(tif,FIELD_IMAGEDEPTH))
+			fprintf(fd, " Image Depth: %lu",
+			    (unsigned long) td->td_imagedepth);
+		fprintf(fd, "\n");
+	}
+	if (TIFFFieldSet(tif,FIELD_TILEDIMENSIONS)) {
+		fprintf(fd, "  Tile Width: %lu Tile Length: %lu",
+		    (unsigned long) td->td_tilewidth, (unsigned long) td->td_tilelength);
+		if (TIFFFieldSet(tif,FIELD_TILEDEPTH))
+			fprintf(fd, " Tile Depth: %lu",
+			    (unsigned long) td->td_tiledepth);
+		fprintf(fd, "\n");
+	}
+	if (TIFFFieldSet(tif,FIELD_RESOLUTION)) {
+		fprintf(fd, "  Resolution: %g, %g",
+		    td->td_xresolution, td->td_yresolution);
+		if (TIFFFieldSet(tif,FIELD_RESOLUTIONUNIT)) {
+			switch (td->td_resolutionunit) {
+			case RESUNIT_NONE:
+				fprintf(fd, " (unitless)");
+				break;
+			case RESUNIT_INCH:
+				fprintf(fd, " pixels/inch");
+				break;
+			case RESUNIT_CENTIMETER:
+				fprintf(fd, " pixels/cm");
+				break;
+			default:
+				fprintf(fd, " (unit %u = 0x%x)",
+				    td->td_resolutionunit,
+				    td->td_resolutionunit);
+				break;
+			}
+		}
+		fprintf(fd, "\n");
+	}
+	if (TIFFFieldSet(tif,FIELD_POSITION))
+		fprintf(fd, "  Position: %g, %g\n",
+		    td->td_xposition, td->td_yposition);
+	if (TIFFFieldSet(tif,FIELD_BITSPERSAMPLE))
+		fprintf(fd, "  Bits/Sample: %u\n", td->td_bitspersample);
+	if (TIFFFieldSet(tif,FIELD_SAMPLEFORMAT)) {
+		fprintf(fd, "  Sample Format: ");
+		switch (td->td_sampleformat) {
+		case SAMPLEFORMAT_VOID:
+			fprintf(fd, "void\n");
+			break;
+		case SAMPLEFORMAT_INT:
+			fprintf(fd, "signed integer\n");
+			break;
+		case SAMPLEFORMAT_UINT:
+			fprintf(fd, "unsigned integer\n");
+			break;
+		case SAMPLEFORMAT_IEEEFP:
+			fprintf(fd, "IEEE floating point\n");
+			break;
+		case SAMPLEFORMAT_COMPLEXINT:
+			fprintf(fd, "complex signed integer\n");
+			break;
+		case SAMPLEFORMAT_COMPLEXIEEEFP:
+			fprintf(fd, "complex IEEE floating point\n");
+			break;
+		default:
+			fprintf(fd, "%u (0x%x)\n",
+			    td->td_sampleformat, td->td_sampleformat);
+			break;
+		}
+	}
+	if (TIFFFieldSet(tif,FIELD_COMPRESSION)) {
+		const TIFFCodec* c = TIFFFindCODEC(td->td_compression);
+		fprintf(fd, "  Compression Scheme: ");
+		if (c)
+			fprintf(fd, "%s\n", c->name);
+		else
+			fprintf(fd, "%u (0x%x)\n",
+			    td->td_compression, td->td_compression);
+	}
+	if (TIFFFieldSet(tif,FIELD_PHOTOMETRIC)) {
+		fprintf(fd, "  Photometric Interpretation: ");
+		if (td->td_photometric < NPHOTONAMES)
+			fprintf(fd, "%s\n", photoNames[td->td_photometric]);
+		else {
+			switch (td->td_photometric) {
+			case PHOTOMETRIC_LOGL:
+				fprintf(fd, "CIE Log2(L)\n");
+				break;
+			case PHOTOMETRIC_LOGLUV:
+				fprintf(fd, "CIE Log2(L) (u',v')\n");
+				break;
+			default:
+				fprintf(fd, "%u (0x%x)\n",
+				    td->td_photometric, td->td_photometric);
+				break;
+			}
+		}
+	}
+	if (TIFFFieldSet(tif,FIELD_EXTRASAMPLES) && td->td_extrasamples) {
+		fprintf(fd, "  Extra Samples: %u<", td->td_extrasamples);
+		sep = "";
+		for (i = 0; i < td->td_extrasamples; i++) {
+			switch (td->td_sampleinfo[i]) {
+			case EXTRASAMPLE_UNSPECIFIED:
+				fprintf(fd, "%sunspecified", sep);
+				break;
+			case EXTRASAMPLE_ASSOCALPHA:
+				fprintf(fd, "%sassoc-alpha", sep);
+				break;
+			case EXTRASAMPLE_UNASSALPHA:
+				fprintf(fd, "%sunassoc-alpha", sep);
+				break;
+			default:
+				fprintf(fd, "%s%u (0x%x)", sep,
+				    td->td_sampleinfo[i], td->td_sampleinfo[i]);
+				break;
+			}
+			sep = ", ";
+		}
+		fprintf(fd, ">\n");
+	}
+	if (TIFFFieldSet(tif,FIELD_INKNAMES)) {
+		char* cp;
+		fprintf(fd, "  Ink Names: ");
+		i = td->td_samplesperpixel;
+		sep = "";
+		for (cp = td->td_inknames; i > 0; cp = strchr(cp,'\0')+1, i--) {
+			fputs(sep, fd);
+			_TIFFprintAscii(fd, cp);
+			sep = ", ";
+		}
+                fputs("\n", fd);
+	}
+	if (TIFFFieldSet(tif,FIELD_THRESHHOLDING)) {
+		fprintf(fd, "  Thresholding: ");
+		switch (td->td_threshholding) {
+		case THRESHHOLD_BILEVEL:
+			fprintf(fd, "bilevel art scan\n");
+			break;
+		case THRESHHOLD_HALFTONE:
+			fprintf(fd, "halftone or dithered scan\n");
+			break;
+		case THRESHHOLD_ERRORDIFFUSE:
+			fprintf(fd, "error diffused\n");
+			break;
+		default:
+			fprintf(fd, "%u (0x%x)\n",
+			    td->td_threshholding, td->td_threshholding);
+			break;
+		}
+	}
+	if (TIFFFieldSet(tif,FIELD_FILLORDER)) {
+		fprintf(fd, "  FillOrder: ");
+		switch (td->td_fillorder) {
+		case FILLORDER_MSB2LSB:
+			fprintf(fd, "msb-to-lsb\n");
+			break;
+		case FILLORDER_LSB2MSB:
+			fprintf(fd, "lsb-to-msb\n");
+			break;
+		default:
+			fprintf(fd, "%u (0x%x)\n",
+			    td->td_fillorder, td->td_fillorder);
+			break;
+		}
+	}
+	if (TIFFFieldSet(tif,FIELD_YCBCRSUBSAMPLING))
+        {
+            /*
+             * For hacky reasons (see tif_jpeg.c - JPEGFixupTestSubsampling),
+             * we need to fetch this rather than trust what is in our
+             * structures.
+             */
+            uint16 subsampling[2];
+
+            TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING, 
+                          subsampling + 0, subsampling + 1 );
+		fprintf(fd, "  YCbCr Subsampling: %u, %u\n",
+                        subsampling[0], subsampling[1] );
+        }
+	if (TIFFFieldSet(tif,FIELD_YCBCRPOSITIONING)) {
+		fprintf(fd, "  YCbCr Positioning: ");
+		switch (td->td_ycbcrpositioning) {
+		case YCBCRPOSITION_CENTERED:
+			fprintf(fd, "centered\n");
+			break;
+		case YCBCRPOSITION_COSITED:
+			fprintf(fd, "cosited\n");
+			break;
+		default:
+			fprintf(fd, "%u (0x%x)\n",
+			    td->td_ycbcrpositioning, td->td_ycbcrpositioning);
+			break;
+		}
+	}
+	if (TIFFFieldSet(tif,FIELD_HALFTONEHINTS))
+		fprintf(fd, "  Halftone Hints: light %u dark %u\n",
+		    td->td_halftonehints[0], td->td_halftonehints[1]);
+	if (TIFFFieldSet(tif,FIELD_ORIENTATION)) {
+		fprintf(fd, "  Orientation: ");
+		if (td->td_orientation < NORIENTNAMES)
+			fprintf(fd, "%s\n", orientNames[td->td_orientation]);
+		else
+			fprintf(fd, "%u (0x%x)\n",
+			    td->td_orientation, td->td_orientation);
+	}
+	if (TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL))
+		fprintf(fd, "  Samples/Pixel: %u\n", td->td_samplesperpixel);
+	if (TIFFFieldSet(tif,FIELD_ROWSPERSTRIP)) {
+		fprintf(fd, "  Rows/Strip: ");
+		if (td->td_rowsperstrip == (uint32) -1)
+			fprintf(fd, "(infinite)\n");
+		else
+			fprintf(fd, "%lu\n", (unsigned long) td->td_rowsperstrip);
+	}
+	if (TIFFFieldSet(tif,FIELD_MINSAMPLEVALUE))
+		fprintf(fd, "  Min Sample Value: %u\n", td->td_minsamplevalue);
+	if (TIFFFieldSet(tif,FIELD_MAXSAMPLEVALUE))
+		fprintf(fd, "  Max Sample Value: %u\n", td->td_maxsamplevalue);
+	if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE))
+		fprintf(fd, "  SMin Sample Value: %g\n",
+		    td->td_sminsamplevalue);
+	if (TIFFFieldSet(tif,FIELD_SMAXSAMPLEVALUE))
+		fprintf(fd, "  SMax Sample Value: %g\n",
+		    td->td_smaxsamplevalue);
+	if (TIFFFieldSet(tif,FIELD_PLANARCONFIG)) {
+		fprintf(fd, "  Planar Configuration: ");
+		switch (td->td_planarconfig) {
+		case PLANARCONFIG_CONTIG:
+			fprintf(fd, "single image plane\n");
+			break;
+		case PLANARCONFIG_SEPARATE:
+			fprintf(fd, "separate image planes\n");
+			break;
+		default:
+			fprintf(fd, "%u (0x%x)\n",
+			    td->td_planarconfig, td->td_planarconfig);
+			break;
+		}
+	}
+	if (TIFFFieldSet(tif,FIELD_PAGENUMBER))
+		fprintf(fd, "  Page Number: %u-%u\n",
+		    td->td_pagenumber[0], td->td_pagenumber[1]);
+	if (TIFFFieldSet(tif,FIELD_COLORMAP)) {
+		fprintf(fd, "  Color Map: ");
+		if (flags & TIFFPRINT_COLORMAP) {
+			fprintf(fd, "\n");
+			n = 1L<<td->td_bitspersample;
+			for (l = 0; l < n; l++)
+				fprintf(fd, "   %5lu: %5u %5u %5u\n",
+				    l,
+				    td->td_colormap[0][l],
+				    td->td_colormap[1][l],
+				    td->td_colormap[2][l]);
+		} else
+			fprintf(fd, "(present)\n");
+	}
+	if (TIFFFieldSet(tif,FIELD_TRANSFERFUNCTION)) {
+		fprintf(fd, "  Transfer Function: ");
+		if (flags & TIFFPRINT_CURVES) {
+			fprintf(fd, "\n");
+			n = 1L<<td->td_bitspersample;
+			for (l = 0; l < n; l++) {
+				fprintf(fd, "    %2lu: %5u",
+				    l, td->td_transferfunction[0][l]);
+				for (i = 1; i < td->td_samplesperpixel; i++)
+					fprintf(fd, " %5u",
+					    td->td_transferfunction[i][l]);
+				fputc('\n', fd);
+			}
+		} else
+			fprintf(fd, "(present)\n");
+	}
+	if (TIFFFieldSet(tif, FIELD_SUBIFD)) {
+		fprintf(fd, "  SubIFD Offsets:");
+		for (i = 0; i < td->td_nsubifd; i++)
+			fprintf(fd, " %5lu", (long) td->td_subifd[i]);
+		fputc('\n', fd);
+	}
+
+        /*
+        ** Custom tag support.
+        */
+        {
+            int  i;
+            short count;
+
+            count = (short) TIFFGetTagListCount(tif);
+            for(i = 0; i < count; i++) {
+                ttag_t  tag = TIFFGetTagListEntry(tif, i);
+                const TIFFFieldInfo *fip;
+                uint16 value_count;
+                int mem_alloc = 0;
+                void *raw_data;
+
+                fip = TIFFFieldWithTag(tif, tag);
+                if(fip == NULL)
+			continue;
+
+		if(fip->field_passcount) {
+			if(TIFFGetField(tif, tag, &value_count, &raw_data) != 1)
+				continue;
+		} else {
+			if (fip->field_readcount == TIFF_VARIABLE
+			    || fip->field_readcount == TIFF_VARIABLE2)
+				value_count = 1;
+			else if (fip->field_readcount == TIFF_SPP)
+				value_count = td->td_samplesperpixel;
+			else
+				value_count = fip->field_readcount;
+			if ((fip->field_type == TIFF_ASCII
+			     || fip->field_readcount == TIFF_VARIABLE
+			     || fip->field_readcount == TIFF_VARIABLE2
+			     || fip->field_readcount == TIFF_SPP
+			     || value_count > 1)
+			    && fip->field_tag != TIFFTAG_PAGENUMBER
+			    && fip->field_tag != TIFFTAG_HALFTONEHINTS
+			    && fip->field_tag != TIFFTAG_YCBCRSUBSAMPLING
+			    && fip->field_tag != TIFFTAG_DOTRANGE) {
+				if(TIFFGetField(tif, tag, &raw_data) != 1)
+					continue;
+			} else if (fip->field_tag != TIFFTAG_PAGENUMBER
+				   && fip->field_tag != TIFFTAG_HALFTONEHINTS
+				   && fip->field_tag != TIFFTAG_YCBCRSUBSAMPLING
+				   && fip->field_tag != TIFFTAG_DOTRANGE) {
+				raw_data = _TIFFmalloc(
+					_TIFFDataSize(fip->field_type)
+					* value_count);
+				mem_alloc = 1;
+				if(TIFFGetField(tif, tag, raw_data) != 1) {
+					_TIFFfree(raw_data);
+					continue;
+				}
+			} else {
+				/* 
+				 * XXX: Should be fixed and removed, see the
+				 * notes related to TIFFTAG_PAGENUMBER,
+				 * TIFFTAG_HALFTONEHINTS,
+				 * TIFFTAG_YCBCRSUBSAMPLING and
+				 * TIFFTAG_DOTRANGE tags in tif_dir.c. */
+				char *tmp;
+				raw_data = _TIFFmalloc(
+					_TIFFDataSize(fip->field_type)
+					* value_count);
+				tmp = raw_data;
+				mem_alloc = 1;
+				if(TIFFGetField(tif, tag, tmp,
+				tmp + _TIFFDataSize(fip->field_type)) != 1) {
+					_TIFFfree(raw_data);
+					continue;
+				}
+			}
+		}
+
+		/*
+		 * Catch the tags which needs to be specially handled and
+		 * pretty print them. If tag not handled in
+		 * _TIFFPrettyPrintField() fall down and print it as any other
+		 * tag.
+		 */
+		if (_TIFFPrettyPrintField(tif, fd, tag, value_count, raw_data)) {
+			if(mem_alloc)
+				_TIFFfree(raw_data);
+			continue;
+		}
+		else
+			_TIFFPrintField(fd, fip, value_count, raw_data);
+
+		if(mem_alloc)
+			_TIFFfree(raw_data);
+            }
+        }
+        
+	if (tif->tif_tagmethods.printdir)
+		(*tif->tif_tagmethods.printdir)(tif, fd, flags);
+	if ((flags & TIFFPRINT_STRIPS) &&
+	    TIFFFieldSet(tif,FIELD_STRIPOFFSETS)) {
+		tstrip_t s;
+
+		fprintf(fd, "  %lu %s:\n",
+		    (long) td->td_nstrips,
+		    isTiled(tif) ? "Tiles" : "Strips");
+		for (s = 0; s < td->td_nstrips; s++)
+			fprintf(fd, "    %3lu: [%8lu, %8lu]\n",
+			    (unsigned long) s,
+			    (unsigned long) td->td_stripoffset[s],
+			    (unsigned long) td->td_stripbytecount[s]);
+	}
+}
+
+void
+_TIFFprintAscii(FILE* fd, const char* cp)
+{
+	for (; *cp != '\0'; cp++) {
+		const char* tp;
+
+		if (isprint((int)*cp)) {
+			fputc(*cp, fd);
+			continue;
+		}
+		for (tp = "\tt\bb\rr\nn\vv"; *tp; tp++)
+			if (*tp++ == *cp)
+				break;
+		if (*tp)
+			fprintf(fd, "\\%c", *tp);
+		else
+			fprintf(fd, "\\%03o", *cp & 0xff);
+	}
+}
+
+void
+_TIFFprintAsciiTag(FILE* fd, const char* name, const char* value)
+{
+	fprintf(fd, "  %s: \"", name);
+	_TIFFprintAscii(fd, value);
+	fprintf(fd, "\"\n");
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_read.c b/src/tiff/tif_read.c
new file mode 100644
index 0000000..48a3e27
--- /dev/null
+++ b/src/tiff/tif_read.c
@@ -0,0 +1,650 @@
+/* $Id: tif_read.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ * Scanline-oriented Read Support
+ */
+#include "tiffiop.h"
+#include <stdio.h>
+
+	int TIFFFillStrip(TIFF*, tstrip_t);
+	int TIFFFillTile(TIFF*, ttile_t);
+static	int TIFFStartStrip(TIFF*, tstrip_t);
+static	int TIFFStartTile(TIFF*, ttile_t);
+static	int TIFFCheckRead(TIFF*, int);
+
+#define	NOSTRIP	((tstrip_t) -1)			/* undefined state */
+#define	NOTILE	((ttile_t) -1)			/* undefined state */
+
+/*
+ * Seek to a random row+sample in a file.
+ */
+static int
+TIFFSeek(TIFF* tif, uint32 row, tsample_t sample)
+{
+	register TIFFDirectory *td = &tif->tif_dir;
+	tstrip_t strip;
+
+	if (row >= td->td_imagelength) {	/* out of range */
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%lu: Row out of range, max %lu",
+		    (unsigned long) row, (unsigned long) td->td_imagelength);
+		return (0);
+	}
+	if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
+		if (sample >= td->td_samplesperpixel) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			    "%lu: Sample out of range, max %lu",
+			    (unsigned long) sample, (unsigned long) td->td_samplesperpixel);
+			return (0);
+		}
+		strip = sample*td->td_stripsperimage + row/td->td_rowsperstrip;
+	} else
+		strip = row / td->td_rowsperstrip;
+	if (strip != tif->tif_curstrip) { 	/* different strip, refill */
+		if (!TIFFFillStrip(tif, strip))
+			return (0);
+	} else if (row < tif->tif_row) {
+		/*
+		 * Moving backwards within the same strip: backup
+		 * to the start and then decode forward (below).
+		 *
+		 * NB: If you're planning on lots of random access within a
+		 * strip, it's better to just read and decode the entire
+		 * strip, and then access the decoded data in a random fashion.
+		 */
+		if (!TIFFStartStrip(tif, strip))
+			return (0);
+	}
+	if (row != tif->tif_row) {
+		/*
+		 * Seek forward to the desired row.
+		 */
+		if (!(*tif->tif_seek)(tif, row - tif->tif_row))
+			return (0);
+		tif->tif_row = row;
+	}
+	return (1);
+}
+
+int
+TIFFReadScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t sample)
+{
+	int e;
+
+	if (!TIFFCheckRead(tif, 0))
+		return (-1);
+	if( (e = TIFFSeek(tif, row, sample)) != 0) {
+		/*
+		 * Decompress desired row into user buffer.
+		 */
+		e = (*tif->tif_decoderow)
+		    (tif, (tidata_t) buf, tif->tif_scanlinesize, sample);
+
+                /* we are now poised at the beginning of the next row */
+                tif->tif_row = row + 1;
+
+		if (e)
+			(*tif->tif_postdecode)(tif, (tidata_t) buf,
+			    tif->tif_scanlinesize);
+	}
+	return (e > 0 ? 1 : -1);
+}
+
+/*
+ * Read a strip of data and decompress the specified
+ * amount into the user-supplied buffer.
+ */
+tsize_t
+TIFFReadEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	uint32 nrows;
+	tsize_t stripsize;
+        tstrip_t sep_strip, strips_per_sep;
+
+	if (!TIFFCheckRead(tif, 0))
+		return (-1);
+	if (strip >= td->td_nstrips) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%ld: Strip out of range, max %ld",
+		    (long) strip, (long) td->td_nstrips);
+		return (-1);
+	}
+	/*
+	 * Calculate the strip size according to the number of
+	 * rows in the strip (check for truncated last strip on any
+         * of the separations).
+	 */
+        if( td->td_rowsperstrip >= td->td_imagelength )
+            strips_per_sep = 1;
+        else
+            strips_per_sep = (td->td_imagelength+td->td_rowsperstrip-1)
+                / td->td_rowsperstrip;
+
+        sep_strip = strip % strips_per_sep;
+
+	if (sep_strip != strips_per_sep-1 ||
+	    (nrows = td->td_imagelength % td->td_rowsperstrip) == 0)
+		nrows = td->td_rowsperstrip;
+
+	stripsize = TIFFVStripSize(tif, nrows);
+	if (size == (tsize_t) -1)
+		size = stripsize;
+	else if (size > stripsize)
+		size = stripsize;
+	if (TIFFFillStrip(tif, strip) 
+            && (*tif->tif_decodestrip)(tif, (tidata_t) buf, size, 
+                         (tsample_t)(strip / td->td_stripsperimage)) > 0 ) {
+		(*tif->tif_postdecode)(tif, (tidata_t) buf, size);
+		return (size);
+	} else
+		return ((tsize_t) -1);
+}
+
+static tsize_t
+TIFFReadRawStrip1(TIFF* tif,
+    tstrip_t strip, tdata_t buf, tsize_t size, const char* module)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+
+	if (!isMapped(tif)) {
+		tsize_t cc;
+
+		if (!SeekOK(tif, td->td_stripoffset[strip])) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Seek error at scanline %lu, strip %lu",
+			    tif->tif_name,
+			    (unsigned long) tif->tif_row, (unsigned long) strip);
+			return (-1);
+		}
+		cc = TIFFReadFile(tif, buf, size);
+		if (cc != size) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+		"%s: Read error at scanline %lu; got %lu bytes, expected %lu",
+			    tif->tif_name,
+			    (unsigned long) tif->tif_row,
+			    (unsigned long) cc,
+			    (unsigned long) size);
+			return (-1);
+		}
+	} else {
+		if (td->td_stripoffset[strip] + size > tif->tif_size) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+    "%s: Read error at scanline %lu, strip %lu; got %lu bytes, expected %lu",
+			    tif->tif_name,
+			    (unsigned long) tif->tif_row,
+			    (unsigned long) strip,
+			    (unsigned long) tif->tif_size - td->td_stripoffset[strip],
+			    (unsigned long) size);
+			return (-1);
+		}
+		_TIFFmemcpy(buf, tif->tif_base + td->td_stripoffset[strip],
+                            size);
+	}
+	return (size);
+}
+
+/*
+ * Read a strip of data from the file.
+ */
+tsize_t
+TIFFReadRawStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size)
+{
+	static const char module[] = "TIFFReadRawStrip";
+	TIFFDirectory *td = &tif->tif_dir;
+	tsize_t bytecount;
+
+	if (!TIFFCheckRead(tif, 0))
+		return ((tsize_t) -1);
+	if (strip >= td->td_nstrips) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%lu: Strip out of range, max %lu",
+		    (unsigned long) strip, (unsigned long) td->td_nstrips);
+		return ((tsize_t) -1);
+	}
+	bytecount = td->td_stripbytecount[strip];
+	if (bytecount <= 0) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "%lu: Invalid strip byte count, strip %lu",
+		    (unsigned long) bytecount, (unsigned long) strip);
+		return ((tsize_t) -1);
+	}
+	if (size != (tsize_t)-1 && size < bytecount)
+		bytecount = size;
+	return (TIFFReadRawStrip1(tif, strip, buf, bytecount, module));
+}
+
+/*
+ * Read the specified strip and setup for decoding. 
+ * The data buffer is expanded, as necessary, to
+ * hold the strip's data.
+ */
+int
+TIFFFillStrip(TIFF* tif, tstrip_t strip)
+{
+	static const char module[] = "TIFFFillStrip";
+	TIFFDirectory *td = &tif->tif_dir;
+	tsize_t bytecount;
+
+	bytecount = td->td_stripbytecount[strip];
+	if (bytecount <= 0) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "%lu: Invalid strip byte count, strip %lu",
+		    (unsigned long) bytecount, (unsigned long) strip);
+		return (0);
+	}
+	if (isMapped(tif) &&
+	    (isFillOrder(tif, td->td_fillorder)
+             || (tif->tif_flags & TIFF_NOBITREV))) {
+		/*
+		 * The image is mapped into memory and we either don't
+		 * need to flip bits or the compression routine is going
+		 * to handle this operation itself.  In this case, avoid
+		 * copying the raw data and instead just reference the
+		 * data from the memory mapped file image.  This assumes
+		 * that the decompression routines do not modify the
+		 * contents of the raw data buffer (if they try to,
+		 * the application will get a fault since the file is
+		 * mapped read-only).
+		 */
+		if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata)
+			_TIFFfree(tif->tif_rawdata);
+		tif->tif_flags &= ~TIFF_MYBUFFER;
+		if ( td->td_stripoffset[strip] + bytecount > tif->tif_size) {
+			/*
+			 * This error message might seem strange, but it's
+			 * what would happen if a read were done instead.
+			 */
+			TIFFErrorExt(tif->tif_clientdata, module,
+		    "%s: Read error on strip %lu; got %lu bytes, expected %lu",
+			    tif->tif_name,
+			    (unsigned long) strip,
+			    (unsigned long) tif->tif_size - td->td_stripoffset[strip],
+			    (unsigned long) bytecount);
+			tif->tif_curstrip = NOSTRIP;
+			return (0);
+		}
+		tif->tif_rawdatasize = bytecount;
+		tif->tif_rawdata = tif->tif_base + td->td_stripoffset[strip];
+	} else {
+		/*
+		 * Expand raw data buffer, if needed, to
+		 * hold data strip coming from file
+		 * (perhaps should set upper bound on
+		 *  the size of a buffer we'll use?).
+		 */
+		if (bytecount > tif->tif_rawdatasize) {
+			tif->tif_curstrip = NOSTRIP;
+			if ((tif->tif_flags & TIFF_MYBUFFER) == 0) {
+				TIFFErrorExt(tif->tif_clientdata, module,
+				"%s: Data buffer too small to hold strip %lu",
+				    tif->tif_name, (unsigned long) strip);
+				return (0);
+			}
+			if (!TIFFReadBufferSetup(tif, 0,
+			    TIFFroundup(bytecount, 1024)))
+				return (0);
+		}
+		if (TIFFReadRawStrip1(tif, strip, (unsigned char *)tif->tif_rawdata,
+		    bytecount, module) != bytecount)
+			return (0);
+		if (!isFillOrder(tif, td->td_fillorder) &&
+		    (tif->tif_flags & TIFF_NOBITREV) == 0)
+			TIFFReverseBits(tif->tif_rawdata, bytecount);
+	}
+	return (TIFFStartStrip(tif, strip));
+}
+
+/*
+ * Tile-oriented Read Support
+ * Contributed by Nancy Cam (Silicon Graphics).
+ */
+
+/*
+ * Read and decompress a tile of data.  The
+ * tile is selected by the (x,y,z,s) coordinates.
+ */
+tsize_t
+TIFFReadTile(TIFF* tif,
+    tdata_t buf, uint32 x, uint32 y, uint32 z, tsample_t s)
+{
+	if (!TIFFCheckRead(tif, 1) || !TIFFCheckTile(tif, x, y, z, s))
+		return (-1);
+	return (TIFFReadEncodedTile(tif,
+	    TIFFComputeTile(tif, x, y, z, s), buf, (tsize_t) -1));
+}
+
+/*
+ * Read a tile of data and decompress the specified
+ * amount into the user-supplied buffer.
+ */
+tsize_t
+TIFFReadEncodedTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	tsize_t tilesize = tif->tif_tilesize;
+
+	if (!TIFFCheckRead(tif, 1))
+		return (-1);
+	if (tile >= td->td_nstrips) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%ld: Tile out of range, max %ld",
+		    (long) tile, (unsigned long) td->td_nstrips);
+		return (-1);
+	}
+	if (size == (tsize_t) -1)
+		size = tilesize;
+	else if (size > tilesize)
+		size = tilesize;
+	if (TIFFFillTile(tif, tile) && (*tif->tif_decodetile)(tif,
+	    (tidata_t) buf, size, (tsample_t)(tile/td->td_stripsperimage))) {
+		(*tif->tif_postdecode)(tif, (tidata_t) buf, size);
+		return (size);
+	} else
+		return (-1);
+}
+
+static tsize_t
+TIFFReadRawTile1(TIFF* tif,
+    ttile_t tile, tdata_t buf, tsize_t size, const char* module)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+
+	if (!isMapped(tif)) {
+		tsize_t cc;
+
+		if (!SeekOK(tif, td->td_stripoffset[tile])) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Seek error at row %ld, col %ld, tile %ld",
+			    tif->tif_name,
+			    (long) tif->tif_row,
+			    (long) tif->tif_col,
+			    (long) tile);
+			return ((tsize_t) -1);
+		}
+		cc = TIFFReadFile(tif, buf, size);
+		if (cc != size) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+	    "%s: Read error at row %ld, col %ld; got %lu bytes, expected %lu",
+			    tif->tif_name,
+			    (long) tif->tif_row,
+			    (long) tif->tif_col,
+			    (unsigned long) cc,
+			    (unsigned long) size);
+			return ((tsize_t) -1);
+		}
+	} else {
+		if (td->td_stripoffset[tile] + size > tif->tif_size) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+    "%s: Read error at row %ld, col %ld, tile %ld; got %lu bytes, expected %lu",
+			    tif->tif_name,
+			    (long) tif->tif_row,
+			    (long) tif->tif_col,
+			    (long) tile,
+			    (unsigned long) tif->tif_size - td->td_stripoffset[tile],
+			    (unsigned long) size);
+			return ((tsize_t) -1);
+		}
+		_TIFFmemcpy(buf, tif->tif_base + td->td_stripoffset[tile], size);
+	}
+	return (size);
+}
+
+/*
+ * Read a tile of data from the file.
+ */
+tsize_t
+TIFFReadRawTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size)
+{
+	static const char module[] = "TIFFReadRawTile";
+	TIFFDirectory *td = &tif->tif_dir;
+	tsize_t bytecount;
+
+	if (!TIFFCheckRead(tif, 1))
+		return ((tsize_t) -1);
+	if (tile >= td->td_nstrips) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%lu: Tile out of range, max %lu",
+		    (unsigned long) tile, (unsigned long) td->td_nstrips);
+		return ((tsize_t) -1);
+	}
+	bytecount = td->td_stripbytecount[tile];
+	if (size != (tsize_t) -1 && size < bytecount)
+		bytecount = size;
+	return (TIFFReadRawTile1(tif, tile, buf, bytecount, module));
+}
+
+/*
+ * Read the specified tile and setup for decoding. 
+ * The data buffer is expanded, as necessary, to
+ * hold the tile's data.
+ */
+int
+TIFFFillTile(TIFF* tif, ttile_t tile)
+{
+	static const char module[] = "TIFFFillTile";
+	TIFFDirectory *td = &tif->tif_dir;
+	tsize_t bytecount;
+
+	bytecount = td->td_stripbytecount[tile];
+	if (bytecount <= 0) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "%lu: Invalid tile byte count, tile %lu",
+		    (unsigned long) bytecount, (unsigned long) tile);
+		return (0);
+	}
+	if (isMapped(tif) &&
+	    (isFillOrder(tif, td->td_fillorder)
+             || (tif->tif_flags & TIFF_NOBITREV))) {
+		/*
+		 * The image is mapped into memory and we either don't
+		 * need to flip bits or the compression routine is going
+		 * to handle this operation itself.  In this case, avoid
+		 * copying the raw data and instead just reference the
+		 * data from the memory mapped file image.  This assumes
+		 * that the decompression routines do not modify the
+		 * contents of the raw data buffer (if they try to,
+		 * the application will get a fault since the file is
+		 * mapped read-only).
+		 */
+		if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata)
+			_TIFFfree(tif->tif_rawdata);
+		tif->tif_flags &= ~TIFF_MYBUFFER;
+		if ( td->td_stripoffset[tile] + bytecount > tif->tif_size) {
+			tif->tif_curtile = NOTILE;
+			return (0);
+		}
+		tif->tif_rawdatasize = bytecount;
+		tif->tif_rawdata = tif->tif_base + td->td_stripoffset[tile];
+	} else {
+		/*
+		 * Expand raw data buffer, if needed, to
+		 * hold data tile coming from file
+		 * (perhaps should set upper bound on
+		 *  the size of a buffer we'll use?).
+		 */
+		if (bytecount > tif->tif_rawdatasize) {
+			tif->tif_curtile = NOTILE;
+			if ((tif->tif_flags & TIFF_MYBUFFER) == 0) {
+				TIFFErrorExt(tif->tif_clientdata, module,
+				"%s: Data buffer too small to hold tile %ld",
+				    tif->tif_name, (long) tile);
+				return (0);
+			}
+			if (!TIFFReadBufferSetup(tif, 0,
+			    TIFFroundup(bytecount, 1024)))
+				return (0);
+		}
+		if (TIFFReadRawTile1(tif, tile,
+                                     (unsigned char *)tif->tif_rawdata,
+                                     bytecount, module) != bytecount)
+			return (0);
+		if (!isFillOrder(tif, td->td_fillorder) &&
+		    (tif->tif_flags & TIFF_NOBITREV) == 0)
+			TIFFReverseBits(tif->tif_rawdata, bytecount);
+	}
+	return (TIFFStartTile(tif, tile));
+}
+
+/*
+ * Setup the raw data buffer in preparation for
+ * reading a strip of raw data.  If the buffer
+ * is specified as zero, then a buffer of appropriate
+ * size is allocated by the library.  Otherwise,
+ * the client must guarantee that the buffer is
+ * large enough to hold any individual strip of
+ * raw data.
+ */
+int
+TIFFReadBufferSetup(TIFF* tif, tdata_t bp, tsize_t size)
+{
+	static const char module[] = "TIFFReadBufferSetup";
+
+	if (tif->tif_rawdata) {
+		if (tif->tif_flags & TIFF_MYBUFFER)
+			_TIFFfree(tif->tif_rawdata);
+		tif->tif_rawdata = NULL;
+	}
+	if (bp) {
+		tif->tif_rawdatasize = size;
+		tif->tif_rawdata = (tidata_t) bp;
+		tif->tif_flags &= ~TIFF_MYBUFFER;
+	} else {
+		tif->tif_rawdatasize = TIFFroundup(size, 1024);
+		tif->tif_rawdata = (tidata_t) _TIFFmalloc(tif->tif_rawdatasize);
+		tif->tif_flags |= TIFF_MYBUFFER;
+	}
+	if (tif->tif_rawdata == NULL) {
+		TIFFErrorExt(tif->tif_clientdata, module,
+		    "%s: No space for data buffer at scanline %ld",
+		    tif->tif_name, (long) tif->tif_row);
+		tif->tif_rawdatasize = 0;
+		return (0);
+	}
+	return (1);
+}
+
+/*
+ * Set state to appear as if a
+ * strip has just been read in.
+ */
+static int
+TIFFStartStrip(TIFF* tif, tstrip_t strip)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+
+	if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
+		if (!(*tif->tif_setupdecode)(tif))
+			return (0);
+		tif->tif_flags |= TIFF_CODERSETUP;
+	}
+	tif->tif_curstrip = strip;
+	tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;
+	tif->tif_rawcp = tif->tif_rawdata;
+	tif->tif_rawcc = td->td_stripbytecount[strip];
+	return ((*tif->tif_predecode)(tif,
+			(tsample_t)(strip / td->td_stripsperimage)));
+}
+
+/*
+ * Set state to appear as if a
+ * tile has just been read in.
+ */
+static int
+TIFFStartTile(TIFF* tif, ttile_t tile)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+
+	if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
+		if (!(*tif->tif_setupdecode)(tif))
+			return (0);
+		tif->tif_flags |= TIFF_CODERSETUP;
+	}
+	tif->tif_curtile = tile;
+	tif->tif_row =
+	    (tile % TIFFhowmany(td->td_imagewidth, td->td_tilewidth)) *
+		td->td_tilelength;
+	tif->tif_col =
+	    (tile % TIFFhowmany(td->td_imagelength, td->td_tilelength)) *
+		td->td_tilewidth;
+	tif->tif_rawcp = tif->tif_rawdata;
+	tif->tif_rawcc = td->td_stripbytecount[tile];
+	return ((*tif->tif_predecode)(tif,
+			(tsample_t)(tile/td->td_stripsperimage)));
+}
+
+static int
+TIFFCheckRead(TIFF* tif, int tiles)
+{
+	if (tif->tif_mode == O_WRONLY) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "File not open for reading");
+		return (0);
+	}
+	if (tiles ^ isTiled(tif)) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, tiles ?
+		    "Can not read tiles from a stripped image" :
+		    "Can not read scanlines from a tiled image");
+		return (0);
+	}
+	return (1);
+}
+
+void
+_TIFFNoPostDecode(TIFF* tif, tidata_t buf, tsize_t cc)
+{
+    (void) tif; (void) buf; (void) cc;
+}
+
+void
+_TIFFSwab16BitData(TIFF* tif, tidata_t buf, tsize_t cc)
+{
+    (void) tif;
+    assert((cc & 1) == 0);
+    TIFFSwabArrayOfShort((uint16*) buf, cc/2);
+}
+
+void
+_TIFFSwab24BitData(TIFF* tif, tidata_t buf, tsize_t cc)
+{
+    (void) tif;
+    assert((cc % 3) == 0);
+    TIFFSwabArrayOfTriples((uint8*) buf, cc/3);
+}
+
+void
+_TIFFSwab32BitData(TIFF* tif, tidata_t buf, tsize_t cc)
+{
+    (void) tif;
+    assert((cc & 3) == 0);
+    TIFFSwabArrayOfLong((uint32*) buf, cc/4);
+}
+
+void
+_TIFFSwab64BitData(TIFF* tif, tidata_t buf, tsize_t cc)
+{
+    (void) tif;
+    assert((cc & 7) == 0);
+    TIFFSwabArrayOfDouble((double*) buf, cc/8);
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_strip.c b/src/tiff/tif_strip.c
new file mode 100644
index 0000000..799f5cf
--- /dev/null
+++ b/src/tiff/tif_strip.c
@@ -0,0 +1,294 @@
+/* $Id: tif_strip.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1991-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Strip-organized Image Support Routines.
+ */
+#include "tiffiop.h"
+
+static uint32
+summarize(TIFF* tif, size_t summand1, size_t summand2, const char* where)
+{
+	/*
+	 * XXX: We are using casting to uint32 here, bacause sizeof(size_t)
+	 * may be larger than sizeof(uint32) on 64-bit architectures.
+	 */
+	uint32	bytes = summand1 + summand2;
+
+	if (bytes - summand1 != summand2) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Integer overflow in %s", where);
+		bytes = 0;
+	}
+
+	return (bytes);
+}
+
+static uint32
+multiply(TIFF* tif, size_t nmemb, size_t elem_size, const char* where)
+{
+	uint32	bytes = nmemb * elem_size;
+
+	if (elem_size && bytes / elem_size != nmemb) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Integer overflow in %s", where);
+		bytes = 0;
+	}
+
+	return (bytes);
+}
+
+/*
+ * Compute which strip a (row,sample) value is in.
+ */
+tstrip_t
+TIFFComputeStrip(TIFF* tif, uint32 row, tsample_t sample)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	tstrip_t strip;
+
+	strip = row / td->td_rowsperstrip;
+	if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
+		if (sample >= td->td_samplesperpixel) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			    "%lu: Sample out of range, max %lu",
+			    (unsigned long) sample, (unsigned long) td->td_samplesperpixel);
+			return ((tstrip_t) 0);
+		}
+		strip += sample*td->td_stripsperimage;
+	}
+	return (strip);
+}
+
+/*
+ * Compute how many strips are in an image.
+ */
+tstrip_t
+TIFFNumberOfStrips(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	tstrip_t nstrips;
+
+	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
+	     TIFFhowmany(td->td_imagelength, td->td_rowsperstrip));
+	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
+		nstrips = multiply(tif, nstrips, td->td_samplesperpixel,
+				   "TIFFNumberOfStrips");
+	return (nstrips);
+}
+
+/*
+ * Compute the # bytes in a variable height, row-aligned strip.
+ */
+tsize_t
+TIFFVStripSize(TIFF* tif, uint32 nrows)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+
+	if (nrows == (uint32) -1)
+		nrows = td->td_imagelength;
+	if (td->td_planarconfig == PLANARCONFIG_CONTIG &&
+	    td->td_photometric == PHOTOMETRIC_YCBCR &&
+	    !isUpSampled(tif)) {
+		/*
+		 * Packed YCbCr data contain one Cb+Cr for every
+		 * HorizontalSampling*VerticalSampling Y values.
+		 * Must also roundup width and height when calculating
+		 * since images that are not a multiple of the
+		 * horizontal/vertical subsampling area include
+		 * YCbCr data for the extended image.
+		 */
+                uint16 ycbcrsubsampling[2];
+                tsize_t w, scanline, samplingarea;
+
+                TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING, 
+                              ycbcrsubsampling + 0, 
+                              ycbcrsubsampling + 1 );
+
+		samplingarea = ycbcrsubsampling[0]*ycbcrsubsampling[1];
+		if (samplingarea == 0) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+				     "Invalid YCbCr subsampling");
+			return 0;
+		}
+
+		w = TIFFroundup(td->td_imagewidth, ycbcrsubsampling[0]);
+		scanline = TIFFhowmany8(multiply(tif, w, td->td_bitspersample,
+						 "TIFFVStripSize"));
+		nrows = TIFFroundup(nrows, ycbcrsubsampling[1]);
+		/* NB: don't need TIFFhowmany here 'cuz everything is rounded */
+		scanline = multiply(tif, nrows, scanline, "TIFFVStripSize");
+		return ((tsize_t)
+		    summarize(tif, scanline,
+			      multiply(tif, 2, scanline / samplingarea,
+				       "TIFFVStripSize"), "TIFFVStripSize"));
+	} else
+		return ((tsize_t) multiply(tif, nrows, TIFFScanlineSize(tif),
+					   "TIFFVStripSize"));
+}
+
+
+/*
+ * Compute the # bytes in a raw strip.
+ */
+tsize_t
+TIFFRawStripSize(TIFF* tif, tstrip_t strip)
+{
+	TIFFDirectory* td = &tif->tif_dir;
+	tsize_t bytecount = td->td_stripbytecount[strip];
+
+	if (bytecount <= 0) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			  "%lu: Invalid strip byte count, strip %lu",
+			  (unsigned long) bytecount, (unsigned long) strip);
+		bytecount = (tsize_t) -1;
+	}
+
+	return bytecount;
+}
+
+/*
+ * Compute the # bytes in a (row-aligned) strip.
+ *
+ * Note that if RowsPerStrip is larger than the
+ * recorded ImageLength, then the strip size is
+ * truncated to reflect the actual space required
+ * to hold the strip.
+ */
+tsize_t
+TIFFStripSize(TIFF* tif)
+{
+	TIFFDirectory* td = &tif->tif_dir;
+	uint32 rps = td->td_rowsperstrip;
+	if (rps > td->td_imagelength)
+		rps = td->td_imagelength;
+	return (TIFFVStripSize(tif, rps));
+}
+
+/*
+ * Compute a default strip size based on the image
+ * characteristics and a requested value.  If the
+ * request is <1 then we choose a strip size according
+ * to certain heuristics.
+ */
+uint32
+TIFFDefaultStripSize(TIFF* tif, uint32 request)
+{
+	return (*tif->tif_defstripsize)(tif, request);
+}
+
+uint32
+_TIFFDefaultStripSize(TIFF* tif, uint32 s)
+{
+	if ((int32) s < 1) {
+		/*
+		 * If RowsPerStrip is unspecified, try to break the
+		 * image up into strips that are approximately
+		 * STRIP_SIZE_DEFAULT bytes long.
+		 */
+		tsize_t scanline = TIFFScanlineSize(tif);
+		s = (uint32)STRIP_SIZE_DEFAULT / (scanline == 0 ? 1 : scanline);
+		if (s == 0)		/* very wide images */
+			s = 1;
+	}
+	return (s);
+}
+
+/*
+ * Return the number of bytes to read/write in a call to
+ * one of the scanline-oriented i/o routines.  Note that
+ * this number may be 1/samples-per-pixel if data is
+ * stored as separate planes.
+ */
+tsize_t
+TIFFScanlineSize(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	tsize_t scanline;
+	
+	if (td->td_planarconfig == PLANARCONFIG_CONTIG) {
+		if (td->td_photometric == PHOTOMETRIC_YCBCR
+		    && !isUpSampled(tif)) {
+			uint16 ycbcrsubsampling[2];
+
+			TIFFGetField(tif, TIFFTAG_YCBCRSUBSAMPLING, 
+				     ycbcrsubsampling + 0,
+				     ycbcrsubsampling + 1);
+
+			if (ycbcrsubsampling[0] == 0) {
+				TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+					     "Invalid YCbCr subsampling");
+				return 0;
+			}
+
+			scanline = TIFFroundup(td->td_imagewidth,
+					       ycbcrsubsampling[0]);
+			scanline = TIFFhowmany8(multiply(tif, scanline,
+							 td->td_bitspersample,
+							 "TIFFScanlineSize"));
+			return ((tsize_t)
+				summarize(tif, scanline,
+					  multiply(tif, 2,
+						scanline / ycbcrsubsampling[0],
+						"TIFFVStripSize"),
+					  "TIFFVStripSize"));
+		} else {
+			scanline = multiply(tif, td->td_imagewidth,
+					    td->td_samplesperpixel,
+					    "TIFFScanlineSize");
+		}
+	} else
+		scanline = td->td_imagewidth;
+	return ((tsize_t) TIFFhowmany8(multiply(tif, scanline,
+						td->td_bitspersample,
+						"TIFFScanlineSize")));
+}
+
+/*
+ * Return the number of bytes required to store a complete
+ * decoded and packed raster scanline (as opposed to the
+ * I/O size returned by TIFFScanlineSize which may be less
+ * if data is store as separate planes).
+ */
+tsize_t
+TIFFRasterScanlineSize(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	tsize_t scanline;
+	
+	scanline = multiply (tif, td->td_bitspersample, td->td_imagewidth,
+			     "TIFFRasterScanlineSize");
+	if (td->td_planarconfig == PLANARCONFIG_CONTIG) {
+		scanline = multiply (tif, scanline, td->td_samplesperpixel,
+				     "TIFFRasterScanlineSize");
+		return ((tsize_t) TIFFhowmany8(scanline));
+	} else
+		return ((tsize_t) multiply (tif, TIFFhowmany8(scanline),
+					    td->td_samplesperpixel,
+					    "TIFFRasterScanlineSize"));
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_swab.c b/src/tiff/tif_swab.c
new file mode 100644
index 0000000..fb0d396
--- /dev/null
+++ b/src/tiff/tif_swab.c
@@ -0,0 +1,235 @@
+/* $Id: tif_swab.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library Bit & Byte Swapping Support.
+ *
+ * XXX We assume short = 16-bits and long = 32-bits XXX
+ */
+#include "tiffiop.h"
+
+#ifndef TIFFSwabShort
+void
+TIFFSwabShort(uint16* wp)
+{
+	register unsigned char* cp = (unsigned char*) wp;
+	unsigned char t;
+
+	t = cp[1]; cp[1] = cp[0]; cp[0] = t;
+}
+#endif
+
+#ifndef TIFFSwabLong
+void
+TIFFSwabLong(uint32* lp)
+{
+	register unsigned char* cp = (unsigned char*) lp;
+	unsigned char t;
+
+	t = cp[3]; cp[3] = cp[0]; cp[0] = t;
+	t = cp[2]; cp[2] = cp[1]; cp[1] = t;
+}
+#endif
+
+#ifndef TIFFSwabArrayOfShort
+void
+TIFFSwabArrayOfShort(uint16* wp, register unsigned long n)
+{
+	register unsigned char* cp;
+	register unsigned char t;
+
+	/* XXX unroll loop some */
+	while (n-- > 0) {
+		cp = (unsigned char*) wp;
+		t = cp[1]; cp[1] = cp[0]; cp[0] = t;
+		wp++;
+	}
+}
+#endif
+
+#ifndef TIFFSwabArrayOfTriples
+void
+TIFFSwabArrayOfTriples(uint8* tp, unsigned long n)
+{
+	unsigned char* cp;
+	unsigned char t;
+
+	/* XXX unroll loop some */
+	while (n-- > 0) {
+		cp = (unsigned char*) tp;
+		t = cp[2]; cp[2] = cp[0]; cp[0] = t;
+		tp += 3;
+	}
+}
+#endif
+
+#ifndef TIFFSwabArrayOfLong
+void
+TIFFSwabArrayOfLong(register uint32* lp, register unsigned long n)
+{
+	register unsigned char *cp;
+	register unsigned char t;
+
+	/* XXX unroll loop some */
+	while (n-- > 0) {
+		cp = (unsigned char *)lp;
+		t = cp[3]; cp[3] = cp[0]; cp[0] = t;
+		t = cp[2]; cp[2] = cp[1]; cp[1] = t;
+		lp++;
+	}
+}
+#endif
+
+#ifndef TIFFSwabDouble
+void
+TIFFSwabDouble(double *dp)
+{
+        register uint32* lp = (uint32*) dp;
+        uint32 t;
+
+	TIFFSwabArrayOfLong(lp, 2);
+	t = lp[0]; lp[0] = lp[1]; lp[1] = t;
+}
+#endif
+
+#ifndef TIFFSwabArrayOfDouble
+void
+TIFFSwabArrayOfDouble(double* dp, register unsigned long n)
+{
+	register uint32* lp = (uint32*) dp;
+        register uint32 t;
+
+	TIFFSwabArrayOfLong(lp, n + n);
+        while (n-- > 0) {
+		t = lp[0]; lp[0] = lp[1]; lp[1] = t;
+                lp += 2;
+        }
+}
+#endif
+
+/*
+ * Bit reversal tables.  TIFFBitRevTable[<byte>] gives
+ * the bit reversed value of <byte>.  Used in various
+ * places in the library when the FillOrder requires
+ * bit reversal of byte values (e.g. CCITT Fax 3
+ * encoding/decoding).  TIFFNoBitRevTable is provided
+ * for algorithms that want an equivalent table that
+ * do not reverse bit values.
+ */
+static const unsigned char TIFFBitRevTable[256] = {
+    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
+    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
+    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
+    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
+    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
+    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
+    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
+    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
+    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
+    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
+    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
+    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
+    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
+    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
+    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
+    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
+    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
+    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
+    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
+    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
+    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
+    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
+    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
+    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
+    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
+    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
+    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
+    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
+    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
+    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
+    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
+    0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
+};
+static const unsigned char TIFFNoBitRevTable[256] = {
+    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 
+    0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 
+    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 
+    0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 
+    0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 
+    0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 
+    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 
+    0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 
+    0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 
+    0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 
+    0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 
+    0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 
+    0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 
+    0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 
+    0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 
+    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 
+    0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 
+    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 
+    0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 
+    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 
+    0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 
+    0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 
+    0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 
+    0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 
+    0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 
+    0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 
+    0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 
+    0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 
+    0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 
+    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 
+    0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 
+};
+
+const unsigned char*
+TIFFGetBitRevTable(int reversed)
+{
+	return (reversed ? TIFFBitRevTable : TIFFNoBitRevTable);
+}
+
+void
+TIFFReverseBits(register unsigned char* cp, register unsigned long n)
+{
+	for (; n > 8; n -= 8) {
+		cp[0] = TIFFBitRevTable[cp[0]];
+		cp[1] = TIFFBitRevTable[cp[1]];
+		cp[2] = TIFFBitRevTable[cp[2]];
+		cp[3] = TIFFBitRevTable[cp[3]];
+		cp[4] = TIFFBitRevTable[cp[4]];
+		cp[5] = TIFFBitRevTable[cp[5]];
+		cp[6] = TIFFBitRevTable[cp[6]];
+		cp[7] = TIFFBitRevTable[cp[7]];
+		cp += 8;
+	}
+	while (n-- > 0)
+		*cp = TIFFBitRevTable[*cp], cp++;
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_thunder.c b/src/tiff/tif_thunder.c
new file mode 100644
index 0000000..8fd5578
--- /dev/null
+++ b/src/tiff/tif_thunder.c
@@ -0,0 +1,158 @@
+/* $Id: tif_thunder.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#include "tiffiop.h"
+#ifdef THUNDER_SUPPORT
+/*
+ * TIFF Library.
+ *
+ * ThunderScan 4-bit Compression Algorithm Support
+ */
+
+/*
+ * ThunderScan uses an encoding scheme designed for
+ * 4-bit pixel values.  Data is encoded in bytes, with
+ * each byte split into a 2-bit code word and a 6-bit
+ * data value.  The encoding gives raw data, runs of
+ * pixels, or pixel values encoded as a delta from the
+ * previous pixel value.  For the latter, either 2-bit
+ * or 3-bit delta values are used, with the deltas packed
+ * into a single byte.
+ */
+#define	THUNDER_DATA		0x3f	/* mask for 6-bit data */
+#define	THUNDER_CODE		0xc0	/* mask for 2-bit code word */
+/* code values */
+#define	THUNDER_RUN		0x00	/* run of pixels w/ encoded count */
+#define	THUNDER_2BITDELTAS	0x40	/* 3 pixels w/ encoded 2-bit deltas */
+#define	    DELTA2_SKIP		2	/* skip code for 2-bit deltas */
+#define	THUNDER_3BITDELTAS	0x80	/* 2 pixels w/ encoded 3-bit deltas */
+#define	    DELTA3_SKIP		4	/* skip code for 3-bit deltas */
+#define	THUNDER_RAW		0xc0	/* raw data encoded */
+
+static const int twobitdeltas[4] = { 0, 1, 0, -1 };
+static const int threebitdeltas[8] = { 0, 1, 2, 3, 0, -3, -2, -1 };
+
+#define	SETPIXEL(op, v) { \
+	lastpixel = (v) & 0xf; \
+	if (npixels++ & 1) \
+	    *op++ |= lastpixel; \
+	else \
+	    op[0] = (tidataval_t) (lastpixel << 4); \
+}
+
+static int
+ThunderDecode(TIFF* tif, tidata_t op, tsize_t maxpixels)
+{
+	register unsigned char *bp;
+	register tsize_t cc;
+	unsigned int lastpixel;
+	tsize_t npixels;
+
+	bp = (unsigned char *)tif->tif_rawcp;
+	cc = tif->tif_rawcc;
+	lastpixel = 0;
+	npixels = 0;
+	while (cc > 0 && npixels < maxpixels) {
+		int n, delta;
+
+		n = *bp++, cc--;
+		switch (n & THUNDER_CODE) {
+		case THUNDER_RUN:		/* pixel run */
+			/*
+			 * Replicate the last pixel n times,
+			 * where n is the lower-order 6 bits.
+			 */
+			if (npixels & 1) {
+				op[0] |= lastpixel;
+				lastpixel = *op++; npixels++; n--;
+			} else
+				lastpixel |= lastpixel << 4;
+			npixels += n;
+			if (npixels < maxpixels) {
+				for (; n > 0; n -= 2)
+					*op++ = (tidataval_t) lastpixel;
+			}
+			if (n == -1)
+				*--op &= 0xf0;
+			lastpixel &= 0xf;
+			break;
+		case THUNDER_2BITDELTAS:	/* 2-bit deltas */
+			if ((delta = ((n >> 4) & 3)) != DELTA2_SKIP)
+				SETPIXEL(op, lastpixel + twobitdeltas[delta]);
+			if ((delta = ((n >> 2) & 3)) != DELTA2_SKIP)
+				SETPIXEL(op, lastpixel + twobitdeltas[delta]);
+			if ((delta = (n & 3)) != DELTA2_SKIP)
+				SETPIXEL(op, lastpixel + twobitdeltas[delta]);
+			break;
+		case THUNDER_3BITDELTAS:	/* 3-bit deltas */
+			if ((delta = ((n >> 3) & 7)) != DELTA3_SKIP)
+				SETPIXEL(op, lastpixel + threebitdeltas[delta]);
+			if ((delta = (n & 7)) != DELTA3_SKIP)
+				SETPIXEL(op, lastpixel + threebitdeltas[delta]);
+			break;
+		case THUNDER_RAW:		/* raw data */
+			SETPIXEL(op, n);
+			break;
+		}
+	}
+	tif->tif_rawcp = (tidata_t) bp;
+	tif->tif_rawcc = cc;
+	if (npixels != maxpixels) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		    "ThunderDecode: %s data at scanline %ld (%lu != %lu)",
+		    npixels < maxpixels ? "Not enough" : "Too much",
+		    (long) tif->tif_row, (long) npixels, (long) maxpixels);
+		return (0);
+	}
+	return (1);
+}
+
+static int
+ThunderDecodeRow(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
+{
+	tidata_t row = buf;
+	
+	(void) s;
+	while ((long)occ > 0) {
+		if (!ThunderDecode(tif, row, tif->tif_dir.td_imagewidth))
+			return (0);
+		occ -= tif->tif_scanlinesize;
+		row += tif->tif_scanlinesize;
+	}
+	return (1);
+}
+
+int
+TIFFInitThunderScan(TIFF* tif, int scheme)
+{
+	(void) scheme;
+	tif->tif_decoderow = ThunderDecodeRow;
+	tif->tif_decodestrip = ThunderDecodeRow;
+	return (1);
+}
+#endif /* THUNDER_SUPPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_tile.c b/src/tiff/tif_tile.c
new file mode 100644
index 0000000..7dad377
--- /dev/null
+++ b/src/tiff/tif_tile.c
@@ -0,0 +1,273 @@
+/* $Id: tif_tile.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1991-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Tiled Image Support Routines.
+ */
+#include "tiffiop.h"
+
+static uint32
+summarize(TIFF* tif, size_t summand1, size_t summand2, const char* where)
+{
+	/*
+	 * XXX: We are using casting to uint32 here, because sizeof(size_t)
+	 * may be larger than sizeof(uint32) on 64-bit architectures.
+	 */
+	uint32	bytes = summand1 + summand2;
+
+	if (bytes - summand1 != summand2) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Integer overflow in %s", where);
+		bytes = 0;
+	}
+
+	return (bytes);
+}
+
+static uint32
+multiply(TIFF* tif, size_t nmemb, size_t elem_size, const char* where)
+{
+	uint32	bytes = nmemb * elem_size;
+
+	if (elem_size && bytes / elem_size != nmemb) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Integer overflow in %s", where);
+		bytes = 0;
+	}
+
+	return (bytes);
+}
+
+/*
+ * Compute which tile an (x,y,z,s) value is in.
+ */
+ttile_t
+TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, tsample_t s)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	uint32 dx = td->td_tilewidth;
+	uint32 dy = td->td_tilelength;
+	uint32 dz = td->td_tiledepth;
+	ttile_t tile = 1;
+
+	if (td->td_imagedepth == 1)
+		z = 0;
+	if (dx == (uint32) -1)
+		dx = td->td_imagewidth;
+	if (dy == (uint32) -1)
+		dy = td->td_imagelength;
+	if (dz == (uint32) -1)
+		dz = td->td_imagedepth;
+	if (dx != 0 && dy != 0 && dz != 0) {
+		uint32 xpt = TIFFhowmany(td->td_imagewidth, dx); 
+		uint32 ypt = TIFFhowmany(td->td_imagelength, dy); 
+		uint32 zpt = TIFFhowmany(td->td_imagedepth, dz); 
+
+		if (td->td_planarconfig == PLANARCONFIG_SEPARATE) 
+			tile = (xpt*ypt*zpt)*s +
+			     (xpt*ypt)*(z/dz) +
+			     xpt*(y/dy) +
+			     x/dx;
+		else
+			tile = (xpt*ypt)*(z/dz) + xpt*(y/dy) + x/dx;
+	}
+	return (tile);
+}
+
+/*
+ * Check an (x,y,z,s) coordinate
+ * against the image bounds.
+ */
+int
+TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, tsample_t s)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+
+	if (x >= td->td_imagewidth) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			     "%lu: Col out of range, max %lu",
+			     (unsigned long) x,
+			     (unsigned long) (td->td_imagewidth - 1));
+		return (0);
+	}
+	if (y >= td->td_imagelength) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			     "%lu: Row out of range, max %lu",
+			     (unsigned long) y,
+			     (unsigned long) (td->td_imagelength - 1));
+		return (0);
+	}
+	if (z >= td->td_imagedepth) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			     "%lu: Depth out of range, max %lu",
+			     (unsigned long) z,
+			     (unsigned long) (td->td_imagedepth - 1));
+		return (0);
+	}
+	if (td->td_planarconfig == PLANARCONFIG_SEPARATE &&
+	    s >= td->td_samplesperpixel) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			     "%lu: Sample out of range, max %lu",
+			     (unsigned long) s,
+			     (unsigned long) (td->td_samplesperpixel - 1));
+		return (0);
+	}
+	return (1);
+}
+
+/*
+ * Compute how many tiles are in an image.
+ */
+ttile_t
+TIFFNumberOfTiles(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	uint32 dx = td->td_tilewidth;
+	uint32 dy = td->td_tilelength;
+	uint32 dz = td->td_tiledepth;
+	ttile_t ntiles;
+
+	if (dx == (uint32) -1)
+		dx = td->td_imagewidth;
+	if (dy == (uint32) -1)
+		dy = td->td_imagelength;
+	if (dz == (uint32) -1)
+		dz = td->td_imagedepth;
+	ntiles = (dx == 0 || dy == 0 || dz == 0) ? 0 :
+	    multiply(tif, multiply(tif, TIFFhowmany(td->td_imagewidth, dx),
+				   TIFFhowmany(td->td_imagelength, dy),
+				   "TIFFNumberOfTiles"),
+		     TIFFhowmany(td->td_imagedepth, dz), "TIFFNumberOfTiles");
+	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
+		ntiles = multiply(tif, ntiles, td->td_samplesperpixel,
+				  "TIFFNumberOfTiles");
+	return (ntiles);
+}
+
+/*
+ * Compute the # bytes in each row of a tile.
+ */
+tsize_t
+TIFFTileRowSize(TIFF* tif)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	tsize_t rowsize;
+	
+	if (td->td_tilelength == 0 || td->td_tilewidth == 0)
+		return ((tsize_t) 0);
+	rowsize = multiply(tif, td->td_bitspersample, td->td_tilewidth,
+			   "TIFFTileRowSize");
+	if (td->td_planarconfig == PLANARCONFIG_CONTIG)
+		rowsize = multiply(tif, rowsize, td->td_samplesperpixel,
+				   "TIFFTileRowSize");
+	return ((tsize_t) TIFFhowmany8(rowsize));
+}
+
+/*
+ * Compute the # bytes in a variable length, row-aligned tile.
+ */
+tsize_t
+TIFFVTileSize(TIFF* tif, uint32 nrows)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	tsize_t tilesize;
+
+	if (td->td_tilelength == 0 || td->td_tilewidth == 0 ||
+	    td->td_tiledepth == 0)
+		return ((tsize_t) 0);
+	if (td->td_planarconfig == PLANARCONFIG_CONTIG &&
+	    td->td_photometric == PHOTOMETRIC_YCBCR &&
+	    !isUpSampled(tif)) {
+		/*
+		 * Packed YCbCr data contain one Cb+Cr for every
+		 * HorizontalSampling*VerticalSampling Y values.
+		 * Must also roundup width and height when calculating
+		 * since images that are not a multiple of the
+		 * horizontal/vertical subsampling area include
+		 * YCbCr data for the extended image.
+		 */
+		tsize_t w =
+		    TIFFroundup(td->td_tilewidth, td->td_ycbcrsubsampling[0]);
+		tsize_t rowsize =
+		    TIFFhowmany8(multiply(tif, w, td->td_bitspersample,
+					  "TIFFVTileSize"));
+		tsize_t samplingarea =
+		    td->td_ycbcrsubsampling[0]*td->td_ycbcrsubsampling[1];
+		if (samplingarea == 0) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Invalid YCbCr subsampling");
+			return 0;
+		}
+		nrows = TIFFroundup(nrows, td->td_ycbcrsubsampling[1]);
+		/* NB: don't need TIFFhowmany here 'cuz everything is rounded */
+		tilesize = multiply(tif, nrows, rowsize, "TIFFVTileSize");
+		tilesize = summarize(tif, tilesize,
+				     multiply(tif, 2, tilesize / samplingarea,
+					      "TIFFVTileSize"),
+				     "TIFFVTileSize");
+	} else
+		tilesize = multiply(tif, nrows, TIFFTileRowSize(tif),
+				    "TIFFVTileSize");
+	return ((tsize_t)
+	    multiply(tif, tilesize, td->td_tiledepth, "TIFFVTileSize"));
+}
+
+/*
+ * Compute the # bytes in a row-aligned tile.
+ */
+tsize_t
+TIFFTileSize(TIFF* tif)
+{
+	return (TIFFVTileSize(tif, tif->tif_dir.td_tilelength));
+}
+
+/*
+ * Compute a default tile size based on the image
+ * characteristics and a requested value.  If a
+ * request is <1 then we choose a size according
+ * to certain heuristics.
+ */
+void
+TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th)
+{
+	(*tif->tif_deftilesize)(tif, tw, th);
+}
+
+void
+_TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th)
+{
+	(void) tif;
+	if (*(int32*) tw < 1)
+		*tw = 256;
+	if (*(int32*) th < 1)
+		*th = 256;
+	/* roundup to a multiple of 16 per the spec */
+	if (*tw & 0xf)
+		*tw = TIFFroundup(*tw, 16);
+	if (*th & 0xf)
+		*th = TIFFroundup(*th, 16);
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_unix.c b/src/tiff/tif_unix.c
new file mode 100644
index 0000000..22b00d4
--- /dev/null
+++ b/src/tiff/tif_unix.c
@@ -0,0 +1,293 @@
+/* $Id: tif_unix.c 4831 2006-08-17 12:06:30Z castejon $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library UNIX-specific Routines. These are should also work with the
+ * Windows Common RunTime Library.
+ */
+#include "tif_config.h"
+
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#ifdef HAVE_IO_H
+# include <sys/io.h>
+#endif
+
+#include "tiffiop.h"
+
+static tsize_t
+_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size)
+{
+	return ((tsize_t) read((int) fd, buf, (size_t) size));
+}
+
+static tsize_t
+_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size)
+{
+	return ((tsize_t) write((int) fd, buf, (size_t) size));
+}
+
+static toff_t
+_tiffSeekProc(thandle_t fd, toff_t off, int whence)
+{
+	return ((toff_t) lseek((int) fd, (off_t) off, whence));
+}
+
+static int
+_tiffCloseProc(thandle_t fd)
+{
+	return (close((int) fd));
+}
+
+
+static toff_t
+_tiffSizeProc(thandle_t fd)
+{
+#ifdef _AM29K
+	long fsize;
+	return ((fsize = lseek((int) fd, 0, SEEK_END)) < 0 ? 0 : fsize);
+#else
+	struct stat sb;
+	return (toff_t) (fstat((int) fd, &sb) < 0 ? 0 : sb.st_size);
+#endif
+}
+
+#ifdef HAVE_MMAP
+#include <sys/mman.h>
+
+static int
+_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
+{
+	toff_t size = _tiffSizeProc(fd);
+	if (size != (toff_t) -1) {
+		*pbase = (tdata_t)
+		    mmap(0, size, PROT_READ, MAP_SHARED, (int) fd, 0);
+		if (*pbase != (tdata_t) -1) {
+			*psize = size;
+			return (1);
+		}
+	}
+	return (0);
+}
+
+static void
+_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size)
+{
+	(void) fd;
+	(void) munmap(base, (off_t) size);
+}
+#else /* !HAVE_MMAP */
+static int
+_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
+{
+	(void) fd; (void) pbase; (void) psize;
+	return (0);
+}
+
+static void
+_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size)
+{
+	(void) fd; (void) base; (void) size;
+}
+#endif /* !HAVE_MMAP */
+
+/*
+ * Open a TIFF file descriptor for read/writing.
+ */
+TIFF*
+TIFFFdOpen(int fd, const char* name, const char* mode)
+{
+	TIFF* tif;
+
+	tif = TIFFClientOpen(name, mode,
+	    (thandle_t) fd,
+	    _tiffReadProc, _tiffWriteProc,
+	    _tiffSeekProc, _tiffCloseProc, _tiffSizeProc,
+	    _tiffMapProc, _tiffUnmapProc);
+	if (tif)
+		tif->tif_fd = fd;
+	return (tif);
+}
+
+/*
+ * Open a TIFF file for read/writing.
+ */
+TIFF*
+TIFFOpen(const char* name, const char* mode)
+{
+	static const char module[] = "TIFFOpen";
+	int m, fd;
+        TIFF* tif;
+
+	m = _TIFFgetMode(mode, module);
+	if (m == -1)
+		return ((TIFF*)0);
+
+/* for cygwin and mingw */        
+#ifdef O_BINARY
+        m |= O_BINARY;
+#endif        
+        
+#ifdef _AM29K
+	fd = open(name, m);
+#else
+	fd = open(name, m, 0666);
+#endif
+	if (fd < 0) {
+		TIFFErrorExt(0, module, "%s: Cannot open", name);
+		return ((TIFF *)0);
+	}
+
+	tif = TIFFFdOpen((int)fd, name, mode);
+	if(!tif)
+		close(fd);
+	return tif;
+}
+
+#ifdef __WIN32__
+#include <windows.h>
+/*
+ * Open a TIFF file with a Unicode filename, for read/writing.
+ */
+TIFF*
+TIFFOpenW(const wchar_t* name, const char* mode)
+{
+	static const char module[] = "TIFFOpenW";
+	int m, fd;
+	int mbsize;
+	char *mbname;
+	TIFF* tif;
+
+	m = _TIFFgetMode(mode, module);
+	if (m == -1)
+		return ((TIFF*)0);
+
+/* for cygwin and mingw */        
+#ifdef O_BINARY
+        m |= O_BINARY;
+#endif        
+        
+	fd = _wopen(name, m, 0666);
+	if (fd < 0) {
+		TIFFErrorExt(0, module, "%s: Cannot open", name);
+		return ((TIFF *)0);
+	}
+
+	mbname = NULL;
+	mbsize = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL);
+	if (mbsize > 0) {
+		mbname = _TIFFmalloc(mbsize);
+		if (!mbname) {
+			TIFFErrorExt(0, module,
+			"Can't allocate space for filename conversion buffer");
+			return ((TIFF*)0);
+		}
+
+		WideCharToMultiByte(CP_ACP, 0, name, -1, mbname, mbsize,
+				    NULL, NULL);
+	}
+
+	tif = TIFFFdOpen((int)fd, (mbname != NULL) ? mbname : "<unknown>",
+			 mode);
+	
+	_TIFFfree(mbname);
+	
+	if(!tif)
+		close(fd);
+	return tif;
+}
+#endif
+
+void*
+_TIFFmalloc(tsize_t s)
+{
+	return (malloc((size_t) s));
+}
+
+void
+_TIFFfree(tdata_t p)
+{
+	free(p);
+}
+
+void*
+_TIFFrealloc(tdata_t p, tsize_t s)
+{
+	return (realloc(p, (size_t) s));
+}
+
+void
+_TIFFmemset(tdata_t p, int v, tsize_t c)
+{
+	memset(p, v, (size_t) c);
+}
+
+void
+_TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c)
+{
+	memcpy(d, s, (size_t) c);
+}
+
+int
+_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
+{
+	return (memcmp(p1, p2, (size_t) c));
+}
+
+static void
+unixWarningHandler(const char* module, const char* fmt, va_list ap)
+{
+	if (module != NULL)
+		fprintf(stderr, "%s: ", module);
+	fprintf(stderr, "Warning, ");
+	vfprintf(stderr, fmt, ap);
+	fprintf(stderr, ".\n");
+}
+TIFFErrorHandler _TIFFwarningHandler = unixWarningHandler;
+
+static void
+unixErrorHandler(const char* module, const char* fmt, va_list ap)
+{
+	if (module != NULL)
+		fprintf(stderr, "%s: ", module);
+	vfprintf(stderr, fmt, ap);
+	fprintf(stderr, ".\n");
+}
+TIFFErrorHandler _TIFFerrorHandler = unixErrorHandler;
diff --git a/src/tiff/tif_version.c b/src/tiff/tif_version.c
new file mode 100644
index 0000000..3c5819d
--- /dev/null
+++ b/src/tiff/tif_version.c
@@ -0,0 +1,33 @@
+/* $Header$ */
+/*
+ * Copyright (c) 1992-1997 Sam Leffler
+ * Copyright (c) 1992-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+#include "tiffiop.h"
+
+static const char TIFFVersion[] = TIFFLIB_VERSION_STR;
+
+const char*
+TIFFGetVersion(void)
+{
+	return (TIFFVersion);
+}
diff --git a/src/tiff/tif_warning.c b/src/tiff/tif_warning.c
new file mode 100644
index 0000000..569abbb
--- /dev/null
+++ b/src/tiff/tif_warning.c
@@ -0,0 +1,74 @@
+/* $Header$ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ */
+#include "tiffiop.h"
+
+TIFFErrorHandlerExt _TIFFwarningHandlerExt = NULL;
+
+TIFFErrorHandler
+TIFFSetWarningHandler(TIFFErrorHandler handler)
+{
+	TIFFErrorHandler prev = _TIFFwarningHandler;
+	_TIFFwarningHandler = handler;
+	return (prev);
+}
+
+TIFFErrorHandlerExt
+TIFFSetWarningHandlerExt(TIFFErrorHandlerExt handler)
+{
+	TIFFErrorHandlerExt prev = _TIFFwarningHandlerExt;
+	_TIFFwarningHandlerExt = handler;
+	return (prev);
+}
+
+void
+TIFFWarning(const char* module, const char* fmt, ...)
+{
+	va_list ap;
+	va_start(ap, fmt);
+	if (_TIFFwarningHandler)
+		(*_TIFFwarningHandler)(module, fmt, ap);
+	if (_TIFFwarningHandlerExt)
+		(*_TIFFwarningHandlerExt)(0, module, fmt, ap);
+	va_end(ap);
+}
+
+void
+TIFFWarningExt(thandle_t fd, const char* module, const char* fmt, ...)
+{
+	va_list ap;
+	va_start(ap, fmt);
+	if (_TIFFwarningHandler)
+		(*_TIFFwarningHandler)(module, fmt, ap);
+	if (_TIFFwarningHandlerExt)
+		(*_TIFFwarningHandlerExt)(fd, module, fmt, ap);
+	va_end(ap);
+}
+
+
diff --git a/src/tiff/tif_win32.c b/src/tiff/tif_win32.c
new file mode 100644
index 0000000..f6bbc84
--- /dev/null
+++ b/src/tiff/tif_win32.c
@@ -0,0 +1,393 @@
+/* $Id: tif_win32.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library Win32-specific Routines.  Adapted from tif_unix.c 4/5/95 by
+ * Scott Wagner (wagner at itek.com), Itek Graphix, Rochester, NY USA
+ */
+#include "tiffiop.h"
+#include "windows.h"
+
+static tsize_t
+_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size)
+{
+	DWORD dwSizeRead;
+	if (!ReadFile(fd, buf, size, &dwSizeRead, NULL))
+		return(0);
+	return ((tsize_t) dwSizeRead);
+}
+
+static tsize_t
+_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size)
+{
+	DWORD dwSizeWritten;
+	if (!WriteFile(fd, buf, size, &dwSizeWritten, NULL))
+		return(0);
+	return ((tsize_t) dwSizeWritten);
+}
+
+static toff_t
+_tiffSeekProc(thandle_t fd, toff_t off, int whence)
+{
+	DWORD dwMoveMethod, dwMoveHigh;
+
+        /* we use this as a special code, so avoid accepting it */
+        if( off == 0xFFFFFFFF )
+            return 0xFFFFFFFF;
+        
+	switch(whence)
+	{
+	case SEEK_SET:
+		dwMoveMethod = FILE_BEGIN;
+		break;
+	case SEEK_CUR:
+		dwMoveMethod = FILE_CURRENT;
+		break;
+	case SEEK_END:
+		dwMoveMethod = FILE_END;
+		break;
+	default:
+		dwMoveMethod = FILE_BEGIN;
+		break;
+	}
+        dwMoveHigh = 0;
+	return ((toff_t)SetFilePointer(fd, (LONG) off, (PLONG)&dwMoveHigh,
+                                       dwMoveMethod));
+}
+
+static int
+_tiffCloseProc(thandle_t fd)
+{
+	return (CloseHandle(fd) ? 0 : -1);
+}
+
+static toff_t
+_tiffSizeProc(thandle_t fd)
+{
+	return ((toff_t)GetFileSize(fd, NULL));
+}
+
+#ifdef __BORLANDC__
+#pragma argsused
+#endif
+static int
+_tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
+{
+	return (0);
+}
+
+/*
+ * From "Hermann Josef Hill" <lhill at rhein-zeitung.de>:
+ *
+ * Windows uses both a handle and a pointer for file mapping,
+ * but according to the SDK documentation and Richter's book
+ * "Advanced Windows Programming" it is safe to free the handle
+ * after obtaining the file mapping pointer
+ *
+ * This removes a nasty OS dependency and cures a problem
+ * with Visual C++ 5.0
+ */
+static int
+_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
+{
+	toff_t size;
+	HANDLE hMapFile;
+
+	if ((size = _tiffSizeProc(fd)) == 0xFFFFFFFF)
+		return (0);
+	hMapFile = CreateFileMapping(fd, NULL, PAGE_READONLY, 0, size, NULL);
+	if (hMapFile == NULL)
+		return (0);
+	*pbase = MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, 0);
+	CloseHandle(hMapFile);
+	if (*pbase == NULL)
+		return (0);
+	*psize = size;
+	return(1);
+}
+
+#ifdef __BORLANDC__
+#pragma argsused
+#endif
+static void
+_tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size)
+{
+}
+
+static void
+_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size)
+{
+	UnmapViewOfFile(base);
+}
+
+/*
+ * Open a TIFF file descriptor for read/writing.
+ * Note that TIFFFdOpen and TIFFOpen recognise the character 'u' in the mode
+ * string, which forces the file to be opened unmapped.
+ */
+TIFF*
+TIFFFdOpen(int ifd, const char* name, const char* mode)
+{
+	TIFF* tif;
+	BOOL fSuppressMap = (mode[1] == 'u' || (mode[1]!=0 && mode[2] == 'u'));
+
+	tif = TIFFClientOpen(name, mode, (thandle_t)ifd,
+			_tiffReadProc, _tiffWriteProc,
+			_tiffSeekProc, _tiffCloseProc, _tiffSizeProc,
+			fSuppressMap ? _tiffDummyMapProc : _tiffMapProc,
+			fSuppressMap ? _tiffDummyUnmapProc : _tiffUnmapProc);
+	if (tif)
+		tif->tif_fd = ifd;
+	return (tif);
+}
+
+/*
+ * Open a TIFF file for read/writing.
+ */
+TIFF*
+TIFFOpen(const char* name, const char* mode)
+{
+	static const char module[] = "TIFFOpen";
+	thandle_t fd;
+	int m;
+	DWORD dwMode;
+	TIFF* tif;
+
+	m = _TIFFgetMode(mode, module);
+
+	switch(m)
+	{
+	case O_RDONLY:
+		dwMode = OPEN_EXISTING;
+		break;
+	case O_RDWR:
+		dwMode = OPEN_ALWAYS;
+		break;
+	case O_RDWR|O_CREAT:
+		dwMode = OPEN_ALWAYS;
+		break;
+	case O_RDWR|O_TRUNC:
+		dwMode = CREATE_ALWAYS;
+		break;
+	case O_RDWR|O_CREAT|O_TRUNC:
+		dwMode = CREATE_ALWAYS;
+		break;
+	default:
+		return ((TIFF*)0);
+	}
+	fd = (thandle_t)CreateFileA(name,
+		(m == O_RDONLY)?GENERIC_READ:(GENERIC_READ | GENERIC_WRITE),
+		FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, dwMode,
+		(m == O_RDONLY)?FILE_ATTRIBUTE_READONLY:FILE_ATTRIBUTE_NORMAL,
+		NULL);
+	if (fd == INVALID_HANDLE_VALUE) {
+		TIFFErrorExt(0, module, "%s: Cannot open", name);
+		return ((TIFF *)0);
+	}
+
+	tif = TIFFFdOpen((int)fd, name, mode);
+	if(!tif)
+		CloseHandle(fd);
+	return tif;
+}
+
+/*
+ * Open a TIFF file with a Unicode filename, for read/writing.
+ */
+TIFF*
+TIFFOpenW(const wchar_t* name, const char* mode)
+{
+	static const char module[] = "TIFFOpenW";
+	thandle_t fd;
+	int m;
+	DWORD dwMode;
+	int mbsize;
+	char *mbname;
+	TIFF *tif;
+
+	m = _TIFFgetMode(mode, module);
+
+	switch(m) {
+		case O_RDONLY:			dwMode = OPEN_EXISTING; break;
+		case O_RDWR:			dwMode = OPEN_ALWAYS;   break;
+		case O_RDWR|O_CREAT:		dwMode = OPEN_ALWAYS;   break;
+		case O_RDWR|O_TRUNC:		dwMode = CREATE_ALWAYS; break;
+		case O_RDWR|O_CREAT|O_TRUNC:	dwMode = CREATE_ALWAYS; break;
+		default:			return ((TIFF*)0);
+	}
+
+	fd = (thandle_t)CreateFileW(name,
+		(m == O_RDONLY)?GENERIC_READ:(GENERIC_READ|GENERIC_WRITE),
+		FILE_SHARE_READ, NULL, dwMode,
+		(m == O_RDONLY)?FILE_ATTRIBUTE_READONLY:FILE_ATTRIBUTE_NORMAL,
+		NULL);
+	if (fd == INVALID_HANDLE_VALUE) {
+		TIFFErrorExt(0, module, "%S: Cannot open", name);
+		return ((TIFF *)0);
+	}
+
+	mbname = NULL;
+	mbsize = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL);
+	if (mbsize > 0) {
+		mbname = (char *)_TIFFmalloc(mbsize);
+		if (!mbname) {
+			TIFFErrorExt(0, module,
+			"Can't allocate space for filename conversion buffer");
+			return ((TIFF*)0);
+		}
+
+		WideCharToMultiByte(CP_ACP, 0, name, -1, mbname, mbsize,
+				    NULL, NULL);
+	}
+
+	tif = TIFFFdOpen((int)fd,
+			 (mbname != NULL) ? mbname : "<unknown>", mode);
+	if(!tif)
+		CloseHandle(fd);
+
+	_TIFFfree(mbname);
+
+	return tif;
+}
+
+tdata_t
+_TIFFmalloc(tsize_t s)
+{
+	return ((tdata_t)GlobalAlloc(GMEM_FIXED, s));
+}
+
+void
+_TIFFfree(tdata_t p)
+{
+	GlobalFree(p);
+	return;
+}
+
+tdata_t
+_TIFFrealloc(tdata_t p, tsize_t s)
+{
+        void* pvTmp;
+        tsize_t old;
+
+        if(p == NULL)
+                return ((tdata_t)GlobalAlloc(GMEM_FIXED, s));
+
+        old = GlobalSize(p);
+
+        if (old>=s) {
+                if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) {
+	                CopyMemory(pvTmp, p, s);
+	                GlobalFree(p);
+                }
+        } else {
+                if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) {
+	                CopyMemory(pvTmp, p, old);
+	                GlobalFree(p);
+                }
+        }
+        return ((tdata_t)pvTmp);
+}
+
+void
+_TIFFmemset(void* p, int v, tsize_t c)
+{
+	FillMemory(p, c, (BYTE)v);
+}
+
+void
+_TIFFmemcpy(void* d, const tdata_t s, tsize_t c)
+{
+	CopyMemory(d, s, c);
+}
+
+int
+_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
+{
+	register const BYTE *pb1 = (const BYTE *) p1;
+	register const BYTE *pb2 = (const BYTE *) p2;
+	register DWORD dwTmp = c;
+	register int iTmp;
+	for (iTmp = 0; dwTmp-- && !iTmp; iTmp = (int)*pb1++ - (int)*pb2++)
+		;
+	return (iTmp);
+}
+
+static void
+Win32WarningHandler(const char* module, const char* fmt, va_list ap)
+{
+#ifndef TIF_PLATFORM_CONSOLE
+	LPTSTR szTitle;
+	LPTSTR szTmp;
+	LPCTSTR szTitleText = "%s Warning";
+	LPCTSTR szDefaultModule = "LIBTIFF";
+	LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module;
+	if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, (strlen(szTmpModule) +
+		strlen(szTitleText) + strlen(fmt) + 128)*sizeof(char))) == NULL)
+		return;
+	sprintf(szTitle, szTitleText, szTmpModule);
+	szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char);
+	vsprintf(szTmp, fmt, ap);
+	MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION);
+	LocalFree(szTitle);
+	return;
+#else
+	if (module != NULL)
+		fprintf(stderr, "%s: ", module);
+	fprintf(stderr, "Warning, ");
+	vfprintf(stderr, fmt, ap);
+	fprintf(stderr, ".\n");
+#endif        
+}
+TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler;
+
+static void
+Win32ErrorHandler(const char* module, const char* fmt, va_list ap)
+{
+#ifndef TIF_PLATFORM_CONSOLE
+	LPTSTR szTitle;
+	LPTSTR szTmp;
+	LPCTSTR szTitleText = "%s Error";
+	LPCTSTR szDefaultModule = "LIBTIFF";
+	LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module;
+	if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, (strlen(szTmpModule) +
+		strlen(szTitleText) + strlen(fmt) + 128)*sizeof(char))) == NULL)
+		return;
+	sprintf(szTitle, szTitleText, szTmpModule);
+	szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char);
+	vsprintf(szTmp, fmt, ap);
+	MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONEXCLAMATION);
+	LocalFree(szTitle);
+	return;
+#else
+	if (module != NULL)
+		fprintf(stderr, "%s: ", module);
+	vfprintf(stderr, fmt, ap);
+	fprintf(stderr, ".\n");
+#endif        
+}
+TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_write.c b/src/tiff/tif_write.c
new file mode 100644
index 0000000..8858a8e
--- /dev/null
+++ b/src/tiff/tif_write.c
@@ -0,0 +1,725 @@
+/* $Id: tif_write.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+/*
+ * TIFF Library.
+ *
+ * Scanline-oriented Write Support
+ */
+#include "tiffiop.h"
+#include <stdio.h>
+
+#define	STRIPINCR	20		/* expansion factor on strip array */
+
+#define	WRITECHECKSTRIPS(tif, module)				\
+	(((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),0,module))
+#define	WRITECHECKTILES(tif, module)				\
+	(((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),1,module))
+#define	BUFFERCHECK(tif)					\
+	((((tif)->tif_flags & TIFF_BUFFERSETUP) && tif->tif_rawdata) ||	\
+	    TIFFWriteBufferSetup((tif), NULL, (tsize_t) -1))
+
+static	int TIFFGrowStrips(TIFF*, int, const char*);
+static	int TIFFAppendToStrip(TIFF*, tstrip_t, tidata_t, tsize_t);
+
+int
+TIFFWriteScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t sample)
+{
+	static const char module[] = "TIFFWriteScanline";
+	register TIFFDirectory *td;
+	int status, imagegrew = 0;
+	tstrip_t strip;
+
+	if (!WRITECHECKSTRIPS(tif, module))
+		return (-1);
+	/*
+	 * Handle delayed allocation of data buffer.  This
+	 * permits it to be sized more intelligently (using
+	 * directory information).
+	 */
+	if (!BUFFERCHECK(tif))
+		return (-1);
+	td = &tif->tif_dir;
+	/*
+	 * Extend image length if needed
+	 * (but only for PlanarConfig=1).
+	 */
+	if (row >= td->td_imagelength) {	/* extend image */
+		if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		"Can not change \"ImageLength\" when using separate planes");
+			return (-1);
+		}
+		td->td_imagelength = row+1;
+		imagegrew = 1;
+	}
+	/*
+	 * Calculate strip and check for crossings.
+	 */
+	if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
+		if (sample >= td->td_samplesperpixel) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+			    "%d: Sample out of range, max %d",
+			    sample, td->td_samplesperpixel);
+			return (-1);
+		}
+		strip = sample*td->td_stripsperimage + row/td->td_rowsperstrip;
+	} else
+		strip = row / td->td_rowsperstrip;
+	/*
+	 * Check strip array to make sure there's space. We don't support
+	 * dynamically growing files that have data organized in separate
+	 * bitplanes because it's too painful.  In that case we require that
+	 * the imagelength be set properly before the first write (so that the
+	 * strips array will be fully allocated above).
+	 */
+	if (strip >= td->td_nstrips && !TIFFGrowStrips(tif, 1, module))
+		return (-1);
+	if (strip != tif->tif_curstrip) {
+		/*
+		 * Changing strips -- flush any data present.
+		 */
+		if (!TIFFFlushData(tif))
+			return (-1);
+		tif->tif_curstrip = strip;
+		/*
+		 * Watch out for a growing image.  The value of strips/image
+		 * will initially be 1 (since it can't be deduced until the
+		 * imagelength is known).
+		 */
+		if (strip >= td->td_stripsperimage && imagegrew)
+			td->td_stripsperimage =
+			    TIFFhowmany(td->td_imagelength,td->td_rowsperstrip);
+		tif->tif_row =
+		    (strip % td->td_stripsperimage) * td->td_rowsperstrip;
+		if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
+			if (!(*tif->tif_setupencode)(tif))
+				return (-1);
+			tif->tif_flags |= TIFF_CODERSETUP;
+		}
+        
+		tif->tif_rawcc = 0;
+		tif->tif_rawcp = tif->tif_rawdata;
+
+		if( td->td_stripbytecount[strip] > 0 )
+		{
+			/* if we are writing over existing tiles, zero length */
+			td->td_stripbytecount[strip] = 0;
+
+			/* this forces TIFFAppendToStrip() to do a seek */
+			tif->tif_curoff = 0;
+		}
+
+		if (!(*tif->tif_preencode)(tif, sample))
+			return (-1);
+		tif->tif_flags |= TIFF_POSTENCODE;
+	}
+	/*
+	 * Ensure the write is either sequential or at the
+	 * beginning of a strip (or that we can randomly
+	 * access the data -- i.e. no encoding).
+	 */
+	if (row != tif->tif_row) {
+		if (row < tif->tif_row) {
+			/*
+			 * Moving backwards within the same strip:
+			 * backup to the start and then decode
+			 * forward (below).
+			 */
+			tif->tif_row = (strip % td->td_stripsperimage) *
+			    td->td_rowsperstrip;
+			tif->tif_rawcp = tif->tif_rawdata;
+		}
+		/*
+		 * Seek forward to the desired row.
+		 */
+		if (!(*tif->tif_seek)(tif, row - tif->tif_row))
+			return (-1);
+		tif->tif_row = row;
+	}
+
+        /* swab if needed - note that source buffer will be altered */
+        tif->tif_postdecode( tif, (tidata_t) buf, tif->tif_scanlinesize );
+
+	status = (*tif->tif_encoderow)(tif, (tidata_t) buf,
+	    tif->tif_scanlinesize, sample);
+
+        /* we are now poised at the beginning of the next row */
+	tif->tif_row = row + 1;
+	return (status);
+}
+
+/*
+ * Encode the supplied data and write it to the
+ * specified strip.
+ *
+ * NB: Image length must be setup before writing.
+ */
+tsize_t
+TIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc)
+{
+	static const char module[] = "TIFFWriteEncodedStrip";
+	TIFFDirectory *td = &tif->tif_dir;
+	tsample_t sample;
+
+	if (!WRITECHECKSTRIPS(tif, module))
+		return ((tsize_t) -1);
+	/*
+	 * Check strip array to make sure there's space.
+	 * We don't support dynamically growing files that
+	 * have data organized in separate bitplanes because
+	 * it's too painful.  In that case we require that
+	 * the imagelength be set properly before the first
+	 * write (so that the strips array will be fully
+	 * allocated above).
+	 */
+	if (strip >= td->td_nstrips) {
+		if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		"Can not grow image by strips when using separate planes");
+			return ((tsize_t) -1);
+		}
+		if (!TIFFGrowStrips(tif, 1, module))
+			return ((tsize_t) -1);
+		td->td_stripsperimage =
+		    TIFFhowmany(td->td_imagelength, td->td_rowsperstrip);
+	}
+	/*
+	 * Handle delayed allocation of data buffer.  This
+	 * permits it to be sized according to the directory
+	 * info.
+	 */
+	if (!BUFFERCHECK(tif))
+		return ((tsize_t) -1);
+	tif->tif_curstrip = strip;
+	tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;
+	if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
+		if (!(*tif->tif_setupencode)(tif))
+			return ((tsize_t) -1);
+		tif->tif_flags |= TIFF_CODERSETUP;
+	}
+        
+	tif->tif_rawcc = 0;
+	tif->tif_rawcp = tif->tif_rawdata;
+
+        if( td->td_stripbytecount[strip] > 0 )
+        {
+            /* if we are writing over existing tiles, zero length. */
+            td->td_stripbytecount[strip] = 0;
+
+            /* this forces TIFFAppendToStrip() to do a seek */
+            tif->tif_curoff = 0;
+        }
+        
+	tif->tif_flags &= ~TIFF_POSTENCODE;
+	sample = (tsample_t)(strip / td->td_stripsperimage);
+	if (!(*tif->tif_preencode)(tif, sample))
+		return ((tsize_t) -1);
+
+        /* swab if needed - note that source buffer will be altered */
+        tif->tif_postdecode( tif, (tidata_t) data, cc );
+
+	if (!(*tif->tif_encodestrip)(tif, (tidata_t) data, cc, sample))
+		return ((tsize_t) 0);
+	if (!(*tif->tif_postencode)(tif))
+		return ((tsize_t) -1);
+	if (!isFillOrder(tif, td->td_fillorder) &&
+	    (tif->tif_flags & TIFF_NOBITREV) == 0)
+		TIFFReverseBits(tif->tif_rawdata, tif->tif_rawcc);
+	if (tif->tif_rawcc > 0 &&
+	    !TIFFAppendToStrip(tif, strip, tif->tif_rawdata, tif->tif_rawcc))
+		return ((tsize_t) -1);
+	tif->tif_rawcc = 0;
+	tif->tif_rawcp = tif->tif_rawdata;
+	return (cc);
+}
+
+/*
+ * Write the supplied data to the specified strip.
+ *
+ * NB: Image length must be setup before writing.
+ */
+tsize_t
+TIFFWriteRawStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc)
+{
+	static const char module[] = "TIFFWriteRawStrip";
+	TIFFDirectory *td = &tif->tif_dir;
+
+	if (!WRITECHECKSTRIPS(tif, module))
+		return ((tsize_t) -1);
+	/*
+	 * Check strip array to make sure there's space.
+	 * We don't support dynamically growing files that
+	 * have data organized in separate bitplanes because
+	 * it's too painful.  In that case we require that
+	 * the imagelength be set properly before the first
+	 * write (so that the strips array will be fully
+	 * allocated above).
+	 */
+	if (strip >= td->td_nstrips) {
+		if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
+			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+		"Can not grow image by strips when using separate planes");
+			return ((tsize_t) -1);
+		}
+		/*
+		 * Watch out for a growing image.  The value of
+		 * strips/image will initially be 1 (since it
+		 * can't be deduced until the imagelength is known).
+		 */
+		if (strip >= td->td_stripsperimage)
+			td->td_stripsperimage =
+			    TIFFhowmany(td->td_imagelength,td->td_rowsperstrip);
+		if (!TIFFGrowStrips(tif, 1, module))
+			return ((tsize_t) -1);
+	}
+	tif->tif_curstrip = strip;
+	tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;
+	return (TIFFAppendToStrip(tif, strip, (tidata_t) data, cc) ?
+	    cc : (tsize_t) -1);
+}
+
+/*
+ * Write and compress a tile of data.  The
+ * tile is selected by the (x,y,z,s) coordinates.
+ */
+tsize_t
+TIFFWriteTile(TIFF* tif,
+    tdata_t buf, uint32 x, uint32 y, uint32 z, tsample_t s)
+{
+	if (!TIFFCheckTile(tif, x, y, z, s))
+		return (-1);
+	/*
+	 * NB: A tile size of -1 is used instead of tif_tilesize knowing
+	 *     that TIFFWriteEncodedTile will clamp this to the tile size.
+	 *     This is done because the tile size may not be defined until
+	 *     after the output buffer is setup in TIFFWriteBufferSetup.
+	 */
+	return (TIFFWriteEncodedTile(tif,
+	    TIFFComputeTile(tif, x, y, z, s), buf, (tsize_t) -1));
+}
+
+/*
+ * Encode the supplied data and write it to the
+ * specified tile.  There must be space for the
+ * data.  The function clamps individual writes
+ * to a tile to the tile size, but does not (and
+ * can not) check that multiple writes to the same
+ * tile do not write more than tile size data.
+ *
+ * NB: Image length must be setup before writing; this
+ *     interface does not support automatically growing
+ *     the image on each write (as TIFFWriteScanline does).
+ */
+tsize_t
+TIFFWriteEncodedTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc)
+{
+	static const char module[] = "TIFFWriteEncodedTile";
+	TIFFDirectory *td;
+	tsample_t sample;
+
+	if (!WRITECHECKTILES(tif, module))
+		return ((tsize_t) -1);
+	td = &tif->tif_dir;
+	if (tile >= td->td_nstrips) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: Tile %lu out of range, max %lu",
+		    tif->tif_name, (unsigned long) tile, (unsigned long) td->td_nstrips);
+		return ((tsize_t) -1);
+	}
+	/*
+	 * Handle delayed allocation of data buffer.  This
+	 * permits it to be sized more intelligently (using
+	 * directory information).
+	 */
+	if (!BUFFERCHECK(tif))
+		return ((tsize_t) -1);
+	tif->tif_curtile = tile;
+
+	tif->tif_rawcc = 0;
+	tif->tif_rawcp = tif->tif_rawdata;
+
+        if( td->td_stripbytecount[tile] > 0 )
+        {
+            /* if we are writing over existing tiles, zero length. */
+            td->td_stripbytecount[tile] = 0;
+
+            /* this forces TIFFAppendToStrip() to do a seek */
+            tif->tif_curoff = 0;
+        }
+        
+	/* 
+	 * Compute tiles per row & per column to compute
+	 * current row and column
+	 */
+	tif->tif_row = (tile % TIFFhowmany(td->td_imagelength, td->td_tilelength))
+		* td->td_tilelength;
+	tif->tif_col = (tile % TIFFhowmany(td->td_imagewidth, td->td_tilewidth))
+		* td->td_tilewidth;
+
+	if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
+		if (!(*tif->tif_setupencode)(tif))
+			return ((tsize_t) -1);
+		tif->tif_flags |= TIFF_CODERSETUP;
+	}
+	tif->tif_flags &= ~TIFF_POSTENCODE;
+	sample = (tsample_t)(tile/td->td_stripsperimage);
+	if (!(*tif->tif_preencode)(tif, sample))
+		return ((tsize_t) -1);
+	/*
+	 * Clamp write amount to the tile size.  This is mostly
+	 * done so that callers can pass in some large number
+	 * (e.g. -1) and have the tile size used instead.
+	 */
+	if ( cc < 1 || cc > tif->tif_tilesize)
+		cc = tif->tif_tilesize;
+
+        /* swab if needed - note that source buffer will be altered */
+        tif->tif_postdecode( tif, (tidata_t) data, cc );
+
+	if (!(*tif->tif_encodetile)(tif, (tidata_t) data, cc, sample))
+		return ((tsize_t) 0);
+	if (!(*tif->tif_postencode)(tif))
+		return ((tsize_t) -1);
+	if (!isFillOrder(tif, td->td_fillorder) &&
+	    (tif->tif_flags & TIFF_NOBITREV) == 0)
+		TIFFReverseBits((unsigned char *)tif->tif_rawdata, tif->tif_rawcc);
+	if (tif->tif_rawcc > 0 && !TIFFAppendToStrip(tif, tile,
+	    tif->tif_rawdata, tif->tif_rawcc))
+		return ((tsize_t) -1);
+	tif->tif_rawcc = 0;
+	tif->tif_rawcp = tif->tif_rawdata;
+	return (cc);
+}
+
+/*
+ * Write the supplied data to the specified strip.
+ * There must be space for the data; we don't check
+ * if strips overlap!
+ *
+ * NB: Image length must be setup before writing; this
+ *     interface does not support automatically growing
+ *     the image on each write (as TIFFWriteScanline does).
+ */
+tsize_t
+TIFFWriteRawTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc)
+{
+	static const char module[] = "TIFFWriteRawTile";
+
+	if (!WRITECHECKTILES(tif, module))
+		return ((tsize_t) -1);
+	if (tile >= tif->tif_dir.td_nstrips) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: Tile %lu out of range, max %lu",
+		    tif->tif_name, (unsigned long) tile,
+		    (unsigned long) tif->tif_dir.td_nstrips);
+		return ((tsize_t) -1);
+	}
+	return (TIFFAppendToStrip(tif, tile, (tidata_t) data, cc) ?
+	    cc : (tsize_t) -1);
+}
+
+#define	isUnspecified(tif, f) \
+    (TIFFFieldSet(tif,f) && (tif)->tif_dir.td_imagelength == 0)
+
+int
+TIFFSetupStrips(TIFF* tif)
+{
+	TIFFDirectory* td = &tif->tif_dir;
+
+	if (isTiled(tif))
+		td->td_stripsperimage =
+		    isUnspecified(tif, FIELD_TILEDIMENSIONS) ?
+			td->td_samplesperpixel : TIFFNumberOfTiles(tif);
+	else
+		td->td_stripsperimage =
+		    isUnspecified(tif, FIELD_ROWSPERSTRIP) ?
+			td->td_samplesperpixel : TIFFNumberOfStrips(tif);
+	td->td_nstrips = td->td_stripsperimage;
+	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
+		td->td_stripsperimage /= td->td_samplesperpixel;
+	td->td_stripoffset = (uint32 *)
+	    _TIFFmalloc(td->td_nstrips * sizeof (uint32));
+	td->td_stripbytecount = (uint32 *)
+	    _TIFFmalloc(td->td_nstrips * sizeof (uint32));
+	if (td->td_stripoffset == NULL || td->td_stripbytecount == NULL)
+		return (0);
+	/*
+	 * Place data at the end-of-file
+	 * (by setting offsets to zero).
+	 */
+	_TIFFmemset(td->td_stripoffset, 0, td->td_nstrips*sizeof (uint32));
+	_TIFFmemset(td->td_stripbytecount, 0, td->td_nstrips*sizeof (uint32));
+	TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
+	TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS);
+	return (1);
+}
+#undef isUnspecified
+
+/*
+ * Verify file is writable and that the directory
+ * information is setup properly.  In doing the latter
+ * we also "freeze" the state of the directory so
+ * that important information is not changed.
+ */
+int
+TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
+{
+	if (tif->tif_mode == O_RDONLY) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: File not open for writing",
+		    tif->tif_name);
+		return (0);
+	}
+	if (tiles ^ isTiled(tif)) {
+		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, tiles ?
+		    "Can not write tiles to a stripped image" :
+		    "Can not write scanlines to a tiled image");
+		return (0);
+	}
+        
+	/*
+	 * On the first write verify all the required information
+	 * has been setup and initialize any data structures that
+	 * had to wait until directory information was set.
+	 * Note that a lot of our work is assumed to remain valid
+	 * because we disallow any of the important parameters
+	 * from changing after we start writing (i.e. once
+	 * TIFF_BEENWRITING is set, TIFFSetField will only allow
+	 * the image's length to be changed).
+	 */
+	if (!TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS)) {
+		TIFFErrorExt(tif->tif_clientdata, module,
+		    "%s: Must set \"ImageWidth\" before writing data",
+		    tif->tif_name);
+		return (0);
+	}
+	if (tif->tif_dir.td_samplesperpixel == 1) {
+		/* 
+		 * Planarconfiguration is irrelevant in case of single band
+		 * images and need not be included. We will set it anyway,
+		 * because this field is used in other parts of library even
+		 * in the single band case.
+		 */
+		tif->tif_dir.td_planarconfig = PLANARCONFIG_CONTIG;
+	} else {
+		if (!TIFFFieldSet(tif, FIELD_PLANARCONFIG)) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+		    "%s: Must set \"PlanarConfiguration\" before writing data",
+			    tif->tif_name);
+			return (0);
+		}
+	}
+	if (tif->tif_dir.td_stripoffset == NULL && !TIFFSetupStrips(tif)) {
+		tif->tif_dir.td_nstrips = 0;
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: No space for %s arrays",
+		    tif->tif_name, isTiled(tif) ? "tile" : "strip");
+		return (0);
+	}
+	tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (tsize_t) -1;
+	tif->tif_scanlinesize = TIFFScanlineSize(tif);
+	tif->tif_flags |= TIFF_BEENWRITING;
+	return (1);
+}
+
+/*
+ * Setup the raw data buffer used for encoding.
+ */
+int
+TIFFWriteBufferSetup(TIFF* tif, tdata_t bp, tsize_t size)
+{
+	static const char module[] = "TIFFWriteBufferSetup";
+
+	if (tif->tif_rawdata) {
+		if (tif->tif_flags & TIFF_MYBUFFER) {
+			_TIFFfree(tif->tif_rawdata);
+			tif->tif_flags &= ~TIFF_MYBUFFER;
+		}
+		tif->tif_rawdata = NULL;
+	}
+	if (size == (tsize_t) -1) {
+		size = (isTiled(tif) ?
+		    tif->tif_tilesize : TIFFStripSize(tif));
+		/*
+		 * Make raw data buffer at least 8K
+		 */
+		if (size < 8*1024)
+			size = 8*1024;
+		bp = NULL;			/* NB: force malloc */
+	}
+	if (bp == NULL) {
+		bp = _TIFFmalloc(size);
+		if (bp == NULL) {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: No space for output buffer",
+			    tif->tif_name);
+			return (0);
+		}
+		tif->tif_flags |= TIFF_MYBUFFER;
+	} else
+		tif->tif_flags &= ~TIFF_MYBUFFER;
+	tif->tif_rawdata = (tidata_t) bp;
+	tif->tif_rawdatasize = size;
+	tif->tif_rawcc = 0;
+	tif->tif_rawcp = tif->tif_rawdata;
+	tif->tif_flags |= TIFF_BUFFERSETUP;
+	return (1);
+}
+
+/*
+ * Grow the strip data structures by delta strips.
+ */
+static int
+TIFFGrowStrips(TIFF* tif, int delta, const char* module)
+{
+	TIFFDirectory	*td = &tif->tif_dir;
+	uint32		*new_stripoffset, *new_stripbytecount;
+
+	assert(td->td_planarconfig == PLANARCONFIG_CONTIG);
+	new_stripoffset = (uint32*)_TIFFrealloc(td->td_stripoffset,
+		(td->td_nstrips + delta) * sizeof (uint32));
+	new_stripbytecount = (uint32*)_TIFFrealloc(td->td_stripbytecount,
+		(td->td_nstrips + delta) * sizeof (uint32));
+	if (new_stripoffset == NULL || new_stripbytecount == NULL) {
+		if (new_stripoffset)
+			_TIFFfree(new_stripoffset);
+		if (new_stripbytecount)
+			_TIFFfree(new_stripbytecount);
+		td->td_nstrips = 0;
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: No space to expand strip arrays",
+			  tif->tif_name);
+		return (0);
+	}
+	td->td_stripoffset = new_stripoffset;
+	td->td_stripbytecount = new_stripbytecount;
+	_TIFFmemset(td->td_stripoffset + td->td_nstrips,
+		    0, delta*sizeof (uint32));
+	_TIFFmemset(td->td_stripbytecount + td->td_nstrips,
+		    0, delta*sizeof (uint32));
+	td->td_nstrips += delta;
+	return (1);
+}
+
+/*
+ * Append the data to the specified strip.
+ */
+static int
+TIFFAppendToStrip(TIFF* tif, tstrip_t strip, tidata_t data, tsize_t cc)
+{
+	TIFFDirectory *td = &tif->tif_dir;
+	static const char module[] = "TIFFAppendToStrip";
+
+	if (td->td_stripoffset[strip] == 0 || tif->tif_curoff == 0) {
+		/*
+		 * No current offset, set the current strip.
+		 */
+		assert(td->td_nstrips > 0);
+		if (td->td_stripoffset[strip] != 0) {
+			/*
+			 * Prevent overlapping of the data chunks. We need
+                         * this to enable in place updating of the compressed
+                         * images. Larger blocks will be moved at the end of
+                         * the file without any optimization of the spare
+                         * space, so such scheme is not too much effective.
+			 */
+			if (td->td_stripbytecountsorted) {
+				if (strip == td->td_nstrips - 1
+				    || td->td_stripoffset[strip + 1] <
+					td->td_stripoffset[strip] + cc) {
+					td->td_stripoffset[strip] =
+						TIFFSeekFile(tif, (toff_t)0,
+							     SEEK_END);
+				}
+			} else {
+				tstrip_t i;
+				for (i = 0; i < td->td_nstrips; i++) {
+					if (td->td_stripoffset[i] > 
+						td->td_stripoffset[strip]
+					    && td->td_stripoffset[i] <
+						td->td_stripoffset[strip] + cc) {
+						td->td_stripoffset[strip] =
+							TIFFSeekFile(tif,
+								     (toff_t)0,
+								     SEEK_END);
+					}
+				}
+			}
+
+			if (!SeekOK(tif, td->td_stripoffset[strip])) {
+				TIFFErrorExt(tif->tif_clientdata, module,
+					  "%s: Seek error at scanline %lu",
+					  tif->tif_name,
+					  (unsigned long)tif->tif_row);
+				return (0);
+			}
+		} else
+			td->td_stripoffset[strip] =
+			    TIFFSeekFile(tif, (toff_t) 0, SEEK_END);
+		tif->tif_curoff = td->td_stripoffset[strip];
+	}
+
+	if (!WriteOK(tif, data, cc)) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: Write error at scanline %lu",
+		    tif->tif_name, (unsigned long) tif->tif_row);
+		return (0);
+	}
+	tif->tif_curoff += cc;
+	td->td_stripbytecount[strip] += cc;
+	return (1);
+}
+
+/*
+ * Internal version of TIFFFlushData that can be
+ * called by ``encodestrip routines'' w/o concern
+ * for infinite recursion.
+ */
+int
+TIFFFlushData1(TIFF* tif)
+{
+	if (tif->tif_rawcc > 0) {
+		if (!isFillOrder(tif, tif->tif_dir.td_fillorder) &&
+		    (tif->tif_flags & TIFF_NOBITREV) == 0)
+			TIFFReverseBits((unsigned char *)tif->tif_rawdata,
+			    tif->tif_rawcc);
+		if (!TIFFAppendToStrip(tif,
+		    isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip,
+		    tif->tif_rawdata, tif->tif_rawcc))
+			return (0);
+		tif->tif_rawcc = 0;
+		tif->tif_rawcp = tif->tif_rawdata;
+	}
+	return (1);
+}
+
+/*
+ * Set the current write offset.  This should only be
+ * used to set the offset to a known previous location
+ * (very carefully), or to 0 so that the next write gets
+ * appended to the end of the file.
+ */
+void
+TIFFSetWriteOffset(TIFF* tif, toff_t off)
+{
+	tif->tif_curoff = off;
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tif_zip.c b/src/tiff/tif_zip.c
new file mode 100644
index 0000000..1e05c4b
--- /dev/null
+++ b/src/tiff/tif_zip.c
@@ -0,0 +1,378 @@
+/* $Id: tif_zip.c 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1995-1997 Sam Leffler
+ * Copyright (c) 1995-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#include "tiffiop.h"
+#ifdef ZIP_SUPPORT
+/*
+ * TIFF Library.
+ *
+ * ZIP (aka Deflate) Compression Support
+ *
+ * This file is simply an interface to the zlib library written by
+ * Jean-loup Gailly and Mark Adler.  You must use version 1.0 or later
+ * of the library: this code assumes the 1.0 API and also depends on
+ * the ability to write the zlib header multiple times (one per strip)
+ * which was not possible with versions prior to 0.95.  Note also that
+ * older versions of this codec avoided this bug by supressing the header
+ * entirely.  This means that files written with the old library cannot
+ * be read; they should be converted to a different compression scheme
+ * and then reconverted.
+ *
+ * The data format used by the zlib library is described in the files
+ * zlib-3.1.doc, deflate-1.1.doc and gzip-4.1.doc, available in the
+ * directory ftp://ftp.uu.net/pub/archiving/zip/doc.  The library was
+ * last found at ftp://ftp.uu.net/pub/archiving/zip/zlib/zlib-0.99.tar.gz.
+ */
+#include "tif_predict.h"
+#include "zlib.h"
+
+#include <stdio.h>
+
+/*
+ * Sigh, ZLIB_VERSION is defined as a string so there's no
+ * way to do a proper check here.  Instead we guess based
+ * on the presence of #defines that were added between the
+ * 0.95 and 1.0 distributions.
+ */
+#if !defined(Z_NO_COMPRESSION) || !defined(Z_DEFLATED)
+#error "Antiquated ZLIB software; you must use version 1.0 or later"
+#endif
+
+/*
+ * State block for each open TIFF
+ * file using ZIP compression/decompression.
+ */
+typedef	struct {
+	TIFFPredictorState predict;
+	z_stream	stream;
+	int		zipquality;		/* compression level */
+	int		state;			/* state flags */
+#define	ZSTATE_INIT	0x1		/* zlib setup successfully */
+
+	TIFFVGetMethod	vgetparent;		/* super-class method */
+	TIFFVSetMethod	vsetparent;		/* super-class method */
+} ZIPState;
+
+#define	ZState(tif)		((ZIPState*) (tif)->tif_data)
+#define	DecoderState(tif)	ZState(tif)
+#define	EncoderState(tif)	ZState(tif)
+
+static	int ZIPEncode(TIFF*, tidata_t, tsize_t, tsample_t);
+static	int ZIPDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+
+static int
+ZIPSetupDecode(TIFF* tif)
+{
+	ZIPState* sp = DecoderState(tif);
+	static const char module[] = "ZIPSetupDecode";
+
+	assert(sp != NULL);
+	if (inflateInit(&sp->stream) != Z_OK) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: %s", tif->tif_name, sp->stream.msg);
+		return (0);
+	} else {
+		sp->state |= ZSTATE_INIT;
+		return (1);
+	}
+}
+
+/*
+ * Setup state for decoding a strip.
+ */
+static int
+ZIPPreDecode(TIFF* tif, tsample_t s)
+{
+	ZIPState* sp = DecoderState(tif);
+
+	(void) s;
+	assert(sp != NULL);
+	sp->stream.next_in = tif->tif_rawdata;
+	sp->stream.avail_in = tif->tif_rawcc;
+	return (inflateReset(&sp->stream) == Z_OK);
+}
+
+static int
+ZIPDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
+{
+	ZIPState* sp = DecoderState(tif);
+	static const char module[] = "ZIPDecode";
+
+	(void) s;
+	assert(sp != NULL);
+	sp->stream.next_out = op;
+	sp->stream.avail_out = occ;
+	do {
+		int state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
+		if (state == Z_STREAM_END)
+			break;
+		if (state == Z_DATA_ERROR) {
+			TIFFErrorExt(tif->tif_clientdata, module,
+			    "%s: Decoding error at scanline %d, %s",
+			    tif->tif_name, tif->tif_row, sp->stream.msg);
+			if (inflateSync(&sp->stream) != Z_OK)
+				return (0);
+			continue;
+		}
+		if (state != Z_OK) {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: zlib error: %s",
+			    tif->tif_name, sp->stream.msg);
+			return (0);
+		}
+	} while (sp->stream.avail_out > 0);
+	if (sp->stream.avail_out != 0) {
+		TIFFErrorExt(tif->tif_clientdata, module,
+		    "%s: Not enough data at scanline %d (short %d bytes)",
+		    tif->tif_name, tif->tif_row, sp->stream.avail_out);
+		return (0);
+	}
+	return (1);
+}
+
+static int
+ZIPSetupEncode(TIFF* tif)
+{
+	ZIPState* sp = EncoderState(tif);
+	static const char module[] = "ZIPSetupEncode";
+
+	assert(sp != NULL);
+	if (deflateInit(&sp->stream, sp->zipquality) != Z_OK) {
+		TIFFErrorExt(tif->tif_clientdata, module, "%s: %s", tif->tif_name, sp->stream.msg);
+		return (0);
+	} else {
+		sp->state |= ZSTATE_INIT;
+		return (1);
+	}
+}
+
+/*
+ * Reset encoding state at the start of a strip.
+ */
+static int
+ZIPPreEncode(TIFF* tif, tsample_t s)
+{
+	ZIPState *sp = EncoderState(tif);
+
+	(void) s;
+	assert(sp != NULL);
+	sp->stream.next_out = tif->tif_rawdata;
+	sp->stream.avail_out = tif->tif_rawdatasize;
+	return (deflateReset(&sp->stream) == Z_OK);
+}
+
+/*
+ * Encode a chunk of pixels.
+ */
+static int
+ZIPEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
+{
+	ZIPState *sp = EncoderState(tif);
+	static const char module[] = "ZIPEncode";
+
+	(void) s;
+	sp->stream.next_in = bp;
+	sp->stream.avail_in = cc;
+	do {
+		if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) {
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: Encoder error: %s",
+			    tif->tif_name, sp->stream.msg);
+			return (0);
+		}
+		if (sp->stream.avail_out == 0) {
+			tif->tif_rawcc = tif->tif_rawdatasize;
+			TIFFFlushData1(tif);
+			sp->stream.next_out = tif->tif_rawdata;
+			sp->stream.avail_out = tif->tif_rawdatasize;
+		}
+	} while (sp->stream.avail_in > 0);
+	return (1);
+}
+
+/*
+ * Finish off an encoded strip by flushing the last
+ * string and tacking on an End Of Information code.
+ */
+static int
+ZIPPostEncode(TIFF* tif)
+{
+	ZIPState *sp = EncoderState(tif);
+	static const char module[] = "ZIPPostEncode";
+	int state;
+
+	sp->stream.avail_in = 0;
+	do {
+		state = deflate(&sp->stream, Z_FINISH);
+		switch (state) {
+		case Z_STREAM_END:
+		case Z_OK:
+		    if ((int)sp->stream.avail_out != (int)tif->tif_rawdatasize)
+                    {
+			    tif->tif_rawcc =
+				tif->tif_rawdatasize - sp->stream.avail_out;
+			    TIFFFlushData1(tif);
+			    sp->stream.next_out = tif->tif_rawdata;
+			    sp->stream.avail_out = tif->tif_rawdatasize;
+		    }
+		    break;
+		default:
+			TIFFErrorExt(tif->tif_clientdata, module, "%s: zlib error: %s",
+			tif->tif_name, sp->stream.msg);
+		    return (0);
+		}
+	} while (state != Z_STREAM_END);
+	return (1);
+}
+
+static void
+ZIPCleanup(TIFF* tif)
+{
+	ZIPState* sp = ZState(tif);
+
+	assert(sp != 0);
+
+	(void)TIFFPredictorCleanup(tif);
+
+	tif->tif_tagmethods.vgetfield = sp->vgetparent;
+	tif->tif_tagmethods.vsetfield = sp->vsetparent;
+
+	if (sp->state&ZSTATE_INIT) {
+		/* NB: avoid problems in the library */
+		if (tif->tif_mode == O_RDONLY)
+			inflateEnd(&sp->stream);
+		else
+			deflateEnd(&sp->stream);
+	}
+	_TIFFfree(sp);
+	tif->tif_data = NULL;
+
+	_TIFFSetDefaultCompressionState(tif);
+}
+
+static int
+ZIPVSetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	ZIPState* sp = ZState(tif);
+	static const char module[] = "ZIPVSetField";
+
+	switch (tag) {
+	case TIFFTAG_ZIPQUALITY:
+		sp->zipquality = va_arg(ap, int);
+		if (tif->tif_mode != O_RDONLY && (sp->state&ZSTATE_INIT)) {
+			if (deflateParams(&sp->stream,
+			    sp->zipquality, Z_DEFAULT_STRATEGY) != Z_OK) {
+				TIFFErrorExt(tif->tif_clientdata, module, "%s: zlib error: %s",
+				    tif->tif_name, sp->stream.msg);
+				return (0);
+			}
+		}
+		return (1);
+	default:
+		return (*sp->vsetparent)(tif, tag, ap);
+	}
+	/*NOTREACHED*/
+}
+
+static int
+ZIPVGetField(TIFF* tif, ttag_t tag, va_list ap)
+{
+	ZIPState* sp = ZState(tif);
+
+	switch (tag) {
+	case TIFFTAG_ZIPQUALITY:
+		*va_arg(ap, int*) = sp->zipquality;
+		break;
+	default:
+		return (*sp->vgetparent)(tif, tag, ap);
+	}
+	return (1);
+}
+
+static const TIFFFieldInfo zipFieldInfo[] = {
+    { TIFFTAG_ZIPQUALITY,	 0, 0,	TIFF_ANY,	FIELD_PSEUDO,
+      TRUE,	FALSE,	"" },
+};
+
+int
+TIFFInitZIP(TIFF* tif, int scheme)
+{
+	ZIPState* sp;
+
+	assert( (scheme == COMPRESSION_DEFLATE)
+		|| (scheme == COMPRESSION_ADOBE_DEFLATE));
+
+	/*
+	 * Allocate state block so tag methods have storage to record values.
+	 */
+	tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (ZIPState));
+	if (tif->tif_data == NULL)
+		goto bad;
+	sp = ZState(tif);
+	sp->stream.zalloc = NULL;
+	sp->stream.zfree = NULL;
+	sp->stream.opaque = NULL;
+	sp->stream.data_type = Z_BINARY;
+
+	/*
+	 * Merge codec-specific tag information and
+	 * override parent get/set field methods.
+	 */
+	_TIFFMergeFieldInfo(tif, zipFieldInfo, TIFFArrayCount(zipFieldInfo));
+	sp->vgetparent = tif->tif_tagmethods.vgetfield;
+	tif->tif_tagmethods.vgetfield = ZIPVGetField; /* hook for codec tags */
+	sp->vsetparent = tif->tif_tagmethods.vsetfield;
+	tif->tif_tagmethods.vsetfield = ZIPVSetField; /* hook for codec tags */
+
+	/* Default values for codec-specific fields */
+	sp->zipquality = Z_DEFAULT_COMPRESSION;	/* default comp. level */
+	sp->state = 0;
+
+	/*
+	 * Install codec methods.
+	 */
+	tif->tif_setupdecode = ZIPSetupDecode;
+	tif->tif_predecode = ZIPPreDecode;
+	tif->tif_decoderow = ZIPDecode;
+	tif->tif_decodestrip = ZIPDecode;
+	tif->tif_decodetile = ZIPDecode;
+	tif->tif_setupencode = ZIPSetupEncode;
+	tif->tif_preencode = ZIPPreEncode;
+	tif->tif_postencode = ZIPPostEncode;
+	tif->tif_encoderow = ZIPEncode;
+	tif->tif_encodestrip = ZIPEncode;
+	tif->tif_encodetile = ZIPEncode;
+	tif->tif_cleanup = ZIPCleanup;
+	/*
+	 * Setup predictor setup.
+	 */
+	(void) TIFFPredictorInit(tif);
+	return (1);
+bad:
+	TIFFErrorExt(tif->tif_clientdata, "TIFFInitZIP",
+		     "No space for ZIP state block");
+	return (0);
+}
+#endif /* ZIP_SUPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tiff.h b/src/tiff/tiff.h
new file mode 100644
index 0000000..994eae3
--- /dev/null
+++ b/src/tiff/tiff.h
@@ -0,0 +1,647 @@
+/* $Id: tiff.h 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _TIFF_
+#define	_TIFF_
+
+#include "tiffconf.h"
+
+/*
+ * Tag Image File Format (TIFF)
+ *
+ * Based on Rev 6.0 from:
+ *    Developer's Desk
+ *    Aldus Corporation
+ *    411 First Ave. South
+ *    Suite 200
+ *    Seattle, WA  98104
+ *    206-622-5500
+ *    
+ *    (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf)
+ *
+ * For Big TIFF design notes see the following link
+ *    http://gdal.maptools.org/twiki/bin/view/libtiff/BigTIFFDesign
+ */
+#define	TIFF_VERSION	        42
+#define TIFF_BIGTIFF_VERSION    43
+
+#define	TIFF_BIGENDIAN		0x4d4d
+#define	TIFF_LITTLEENDIAN	0x4949
+#define	MDI_LITTLEENDIAN        0x5045
+#define	MDI_BIGENDIAN           0x4550
+/*
+ * Intrinsic data types required by the file format:
+ *
+ * 8-bit quantities	int8/uint8
+ * 16-bit quantities	int16/uint16
+ * 32-bit quantities	int32/uint32
+ * strings		unsigned char*
+ */
+
+#ifndef HAVE_INT8
+typedef	signed char int8;	/* NB: non-ANSI compilers may not grok */
+#endif
+typedef	unsigned char uint8;
+#ifndef HAVE_INT16
+typedef	short int16;
+#endif
+typedef	unsigned short uint16;	/* sizeof (uint16) must == 2 */
+#if SIZEOF_INT == 4
+#ifndef HAVE_INT32
+typedef	int int32;
+#endif
+typedef	unsigned int uint32;	/* sizeof (uint32) must == 4 */
+#elif SIZEOF_LONG == 4
+#ifndef HAVE_INT32
+typedef	long int32;
+#endif
+typedef	unsigned long uint32;	/* sizeof (uint32) must == 4 */
+#endif
+
+/* For TIFFReassignTagToIgnore */
+enum TIFFIgnoreSense /* IGNORE tag table */
+{
+	TIS_STORE,
+	TIS_EXTRACT,
+	TIS_EMPTY
+};
+
+/*
+ * TIFF header.
+ */
+typedef	struct {
+	uint16	tiff_magic;	/* magic number (defines byte order) */
+#define TIFF_MAGIC_SIZE		2
+	uint16	tiff_version;	/* TIFF version number */
+#define TIFF_VERSION_SIZE	2
+	uint32	tiff_diroff;	/* byte offset to first directory */
+#define TIFF_DIROFFSET_SIZE	4
+} TIFFHeader;
+
+
+/*
+ * TIFF Image File Directories are comprised of a table of field
+ * descriptors of the form shown below.  The table is sorted in
+ * ascending order by tag.  The values associated with each entry are
+ * disjoint and may appear anywhere in the file (so long as they are
+ * placed on a word boundary).
+ *
+ * If the value is 4 bytes or less, then it is placed in the offset
+ * field to save space.  If the value is less than 4 bytes, it is
+ * left-justified in the offset field.
+ */
+typedef	struct {
+	uint16		tdir_tag;	/* see below */
+	uint16		tdir_type;	/* data type; see below */
+	uint32		tdir_count;	/* number of items; length in spec */
+	uint32		tdir_offset;	/* byte offset to field data */
+} TIFFDirEntry;
+
+/*
+ * NB: In the comments below,
+ *  - items marked with a + are obsoleted by revision 5.0,
+ *  - items marked with a ! are introduced in revision 6.0.
+ *  - items marked with a % are introduced post revision 6.0.
+ *  - items marked with a $ are obsoleted by revision 6.0.
+ *  - items marked with a & are introduced by Adobe DNG specification.
+ */
+
+/*
+ * Tag data type information.
+ *
+ * Note: RATIONALs are the ratio of two 32-bit integer values.
+ */
+typedef	enum {
+	TIFF_NOTYPE	= 0,	/* placeholder */
+	TIFF_BYTE	= 1,	/* 8-bit unsigned integer */
+	TIFF_ASCII	= 2,	/* 8-bit bytes w/ last byte null */
+	TIFF_SHORT	= 3,	/* 16-bit unsigned integer */
+	TIFF_LONG	= 4,	/* 32-bit unsigned integer */
+	TIFF_RATIONAL	= 5,	/* 64-bit unsigned fraction */
+	TIFF_SBYTE	= 6,	/* !8-bit signed integer */
+	TIFF_UNDEFINED	= 7,	/* !8-bit untyped data */
+	TIFF_SSHORT	= 8,	/* !16-bit signed integer */
+	TIFF_SLONG	= 9,	/* !32-bit signed integer */
+	TIFF_SRATIONAL	= 10,	/* !64-bit signed fraction */
+	TIFF_FLOAT	= 11,	/* !32-bit IEEE floating point */
+	TIFF_DOUBLE	= 12,	/* !64-bit IEEE floating point */
+	TIFF_IFD	= 13	/* %32-bit unsigned integer (offset) */
+} TIFFDataType;
+
+/*
+ * TIFF Tag Definitions.
+ */
+#define	TIFFTAG_SUBFILETYPE		254	/* subfile data descriptor */
+#define	    FILETYPE_REDUCEDIMAGE	0x1	/* reduced resolution version */
+#define	    FILETYPE_PAGE		0x2	/* one page of many */
+#define	    FILETYPE_MASK		0x4	/* transparency mask */
+#define	TIFFTAG_OSUBFILETYPE		255	/* +kind of data in subfile */
+#define	    OFILETYPE_IMAGE		1	/* full resolution image data */
+#define	    OFILETYPE_REDUCEDIMAGE	2	/* reduced size image data */
+#define	    OFILETYPE_PAGE		3	/* one page of many */
+#define	TIFFTAG_IMAGEWIDTH		256	/* image width in pixels */
+#define	TIFFTAG_IMAGELENGTH		257	/* image height in pixels */
+#define	TIFFTAG_BITSPERSAMPLE		258	/* bits per channel (sample) */
+#define	TIFFTAG_COMPRESSION		259	/* data compression technique */
+#define	    COMPRESSION_NONE		1	/* dump mode */
+#define	    COMPRESSION_CCITTRLE	2	/* CCITT modified Huffman RLE */
+#define	    COMPRESSION_CCITTFAX3	3	/* CCITT Group 3 fax encoding */
+#define     COMPRESSION_CCITT_T4        3       /* CCITT T.4 (TIFF 6 name) */
+#define	    COMPRESSION_CCITTFAX4	4	/* CCITT Group 4 fax encoding */
+#define     COMPRESSION_CCITT_T6        4       /* CCITT T.6 (TIFF 6 name) */
+#define	    COMPRESSION_LZW		5       /* Lempel-Ziv  & Welch */
+#define	    COMPRESSION_OJPEG		6	/* !6.0 JPEG */
+#define	    COMPRESSION_JPEG		7	/* %JPEG DCT compression */
+#define	    COMPRESSION_NEXT		32766	/* NeXT 2-bit RLE */
+#define	    COMPRESSION_CCITTRLEW	32771	/* #1 w/ word alignment */
+#define	    COMPRESSION_PACKBITS	32773	/* Macintosh RLE */
+#define	    COMPRESSION_THUNDERSCAN	32809	/* ThunderScan RLE */
+/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly at apago.com) */
+#define	    COMPRESSION_IT8CTPAD	32895   /* IT8 CT w/padding */
+#define	    COMPRESSION_IT8LW		32896   /* IT8 Linework RLE */
+#define	    COMPRESSION_IT8MP		32897   /* IT8 Monochrome picture */
+#define	    COMPRESSION_IT8BL		32898   /* IT8 Binary line art */
+/* compression codes 32908-32911 are reserved for Pixar */
+#define     COMPRESSION_PIXARFILM	32908   /* Pixar companded 10bit LZW */
+#define	    COMPRESSION_PIXARLOG	32909   /* Pixar companded 11bit ZIP */
+#define	    COMPRESSION_DEFLATE		32946	/* Deflate compression */
+#define     COMPRESSION_ADOBE_DEFLATE   8       /* Deflate compression,
+						   as recognized by Adobe */
+/* compression code 32947 is reserved for Oceana Matrix <dev at oceana.com> */
+#define     COMPRESSION_DCS             32947   /* Kodak DCS encoding */
+#define	    COMPRESSION_JBIG		34661	/* ISO JBIG */
+#define     COMPRESSION_SGILOG		34676	/* SGI Log Luminance RLE */
+#define     COMPRESSION_SGILOG24	34677	/* SGI Log 24-bit packed */
+#define     COMPRESSION_JP2000          34712   /* Leadtools JPEG2000 */
+#define	TIFFTAG_PHOTOMETRIC		262	/* photometric interpretation */
+#define	    PHOTOMETRIC_MINISWHITE	0	/* min value is white */
+#define	    PHOTOMETRIC_MINISBLACK	1	/* min value is black */
+#define	    PHOTOMETRIC_RGB		2	/* RGB color model */
+#define	    PHOTOMETRIC_PALETTE		3	/* color map indexed */
+#define	    PHOTOMETRIC_MASK		4	/* $holdout mask */
+#define	    PHOTOMETRIC_SEPARATED	5	/* !color separations */
+#define	    PHOTOMETRIC_YCBCR		6	/* !CCIR 601 */
+#define	    PHOTOMETRIC_CIELAB		8	/* !1976 CIE L*a*b* */
+#define	    PHOTOMETRIC_ICCLAB		9	/* ICC L*a*b* [Adobe TIFF Technote 4] */
+#define	    PHOTOMETRIC_ITULAB		10	/* ITU L*a*b* */
+#define     PHOTOMETRIC_LOGL		32844	/* CIE Log2(L) */
+#define     PHOTOMETRIC_LOGLUV		32845	/* CIE Log2(L) (u',v') */
+#define	TIFFTAG_THRESHHOLDING		263	/* +thresholding used on data */
+#define	    THRESHHOLD_BILEVEL		1	/* b&w art scan */
+#define	    THRESHHOLD_HALFTONE		2	/* or dithered scan */
+#define	    THRESHHOLD_ERRORDIFFUSE	3	/* usually floyd-steinberg */
+#define	TIFFTAG_CELLWIDTH		264	/* +dithering matrix width */
+#define	TIFFTAG_CELLLENGTH		265	/* +dithering matrix height */
+#define	TIFFTAG_FILLORDER		266	/* data order within a byte */
+#define	    FILLORDER_MSB2LSB		1	/* most significant -> least */
+#define	    FILLORDER_LSB2MSB		2	/* least significant -> most */
+#define	TIFFTAG_DOCUMENTNAME		269	/* name of doc. image is from */
+#define	TIFFTAG_IMAGEDESCRIPTION	270	/* info about image */
+#define	TIFFTAG_MAKE			271	/* scanner manufacturer name */
+#define	TIFFTAG_MODEL			272	/* scanner model name/number */
+#define	TIFFTAG_STRIPOFFSETS		273	/* offsets to data strips */
+#define	TIFFTAG_ORIENTATION		274	/* +image orientation */
+#define	    ORIENTATION_TOPLEFT		1	/* row 0 top, col 0 lhs */
+#define	    ORIENTATION_TOPRIGHT	2	/* row 0 top, col 0 rhs */
+#define	    ORIENTATION_BOTRIGHT	3	/* row 0 bottom, col 0 rhs */
+#define	    ORIENTATION_BOTLEFT		4	/* row 0 bottom, col 0 lhs */
+#define	    ORIENTATION_LEFTTOP		5	/* row 0 lhs, col 0 top */
+#define	    ORIENTATION_RIGHTTOP	6	/* row 0 rhs, col 0 top */
+#define	    ORIENTATION_RIGHTBOT	7	/* row 0 rhs, col 0 bottom */
+#define	    ORIENTATION_LEFTBOT		8	/* row 0 lhs, col 0 bottom */
+#define	TIFFTAG_SAMPLESPERPIXEL		277	/* samples per pixel */
+#define	TIFFTAG_ROWSPERSTRIP		278	/* rows per strip of data */
+#define	TIFFTAG_STRIPBYTECOUNTS		279	/* bytes counts for strips */
+#define	TIFFTAG_MINSAMPLEVALUE		280	/* +minimum sample value */
+#define	TIFFTAG_MAXSAMPLEVALUE		281	/* +maximum sample value */
+#define	TIFFTAG_XRESOLUTION		282	/* pixels/resolution in x */
+#define	TIFFTAG_YRESOLUTION		283	/* pixels/resolution in y */
+#define	TIFFTAG_PLANARCONFIG		284	/* storage organization */
+#define	    PLANARCONFIG_CONTIG		1	/* single image plane */
+#define	    PLANARCONFIG_SEPARATE	2	/* separate planes of data */
+#define	TIFFTAG_PAGENAME		285	/* page name image is from */
+#define	TIFFTAG_XPOSITION		286	/* x page offset of image lhs */
+#define	TIFFTAG_YPOSITION		287	/* y page offset of image lhs */
+#define	TIFFTAG_FREEOFFSETS		288	/* +byte offset to free block */
+#define	TIFFTAG_FREEBYTECOUNTS		289	/* +sizes of free blocks */
+#define	TIFFTAG_GRAYRESPONSEUNIT	290	/* $gray scale curve accuracy */
+#define	    GRAYRESPONSEUNIT_10S	1	/* tenths of a unit */
+#define	    GRAYRESPONSEUNIT_100S	2	/* hundredths of a unit */
+#define	    GRAYRESPONSEUNIT_1000S	3	/* thousandths of a unit */
+#define	    GRAYRESPONSEUNIT_10000S	4	/* ten-thousandths of a unit */
+#define	    GRAYRESPONSEUNIT_100000S	5	/* hundred-thousandths */
+#define	TIFFTAG_GRAYRESPONSECURVE	291	/* $gray scale response curve */
+#define	TIFFTAG_GROUP3OPTIONS		292	/* 32 flag bits */
+#define	TIFFTAG_T4OPTIONS		292	/* TIFF 6.0 proper name alias */
+#define	    GROUP3OPT_2DENCODING	0x1	/* 2-dimensional coding */
+#define	    GROUP3OPT_UNCOMPRESSED	0x2	/* data not compressed */
+#define	    GROUP3OPT_FILLBITS		0x4	/* fill to byte boundary */
+#define	TIFFTAG_GROUP4OPTIONS		293	/* 32 flag bits */
+#define TIFFTAG_T6OPTIONS               293     /* TIFF 6.0 proper name */
+#define	    GROUP4OPT_UNCOMPRESSED	0x2	/* data not compressed */
+#define	TIFFTAG_RESOLUTIONUNIT		296	/* units of resolutions */
+#define	    RESUNIT_NONE		1	/* no meaningful units */
+#define	    RESUNIT_INCH		2	/* english */
+#define	    RESUNIT_CENTIMETER		3	/* metric */
+#define	TIFFTAG_PAGENUMBER		297	/* page numbers of multi-page */
+#define	TIFFTAG_COLORRESPONSEUNIT	300	/* $color curve accuracy */
+#define	    COLORRESPONSEUNIT_10S	1	/* tenths of a unit */
+#define	    COLORRESPONSEUNIT_100S	2	/* hundredths of a unit */
+#define	    COLORRESPONSEUNIT_1000S	3	/* thousandths of a unit */
+#define	    COLORRESPONSEUNIT_10000S	4	/* ten-thousandths of a unit */
+#define	    COLORRESPONSEUNIT_100000S	5	/* hundred-thousandths */
+#define	TIFFTAG_TRANSFERFUNCTION	301	/* !colorimetry info */
+#define	TIFFTAG_SOFTWARE		305	/* name & release */
+#define	TIFFTAG_DATETIME		306	/* creation date and time */
+#define	TIFFTAG_ARTIST			315	/* creator of image */
+#define	TIFFTAG_HOSTCOMPUTER		316	/* machine where created */
+#define	TIFFTAG_PREDICTOR		317	/* prediction scheme w/ LZW */
+#define     PREDICTOR_NONE		1	/* no prediction scheme used */
+#define     PREDICTOR_HORIZONTAL	2	/* horizontal differencing */
+#define     PREDICTOR_FLOATINGPOINT	3	/* floating point predictor */
+#define	TIFFTAG_WHITEPOINT		318	/* image white point */
+#define	TIFFTAG_PRIMARYCHROMATICITIES	319	/* !primary chromaticities */
+#define	TIFFTAG_COLORMAP		320	/* RGB map for pallette image */
+#define	TIFFTAG_HALFTONEHINTS		321	/* !highlight+shadow info */
+#define	TIFFTAG_TILEWIDTH		322	/* !tile width in pixels */
+#define	TIFFTAG_TILELENGTH		323	/* !tile height in pixels */
+#define TIFFTAG_TILEOFFSETS		324	/* !offsets to data tiles */
+#define TIFFTAG_TILEBYTECOUNTS		325	/* !byte counts for tiles */
+#define	TIFFTAG_BADFAXLINES		326	/* lines w/ wrong pixel count */
+#define	TIFFTAG_CLEANFAXDATA		327	/* regenerated line info */
+#define	    CLEANFAXDATA_CLEAN		0	/* no errors detected */
+#define	    CLEANFAXDATA_REGENERATED	1	/* receiver regenerated lines */
+#define	    CLEANFAXDATA_UNCLEAN	2	/* uncorrected errors exist */
+#define	TIFFTAG_CONSECUTIVEBADFAXLINES	328	/* max consecutive bad lines */
+#define	TIFFTAG_SUBIFD			330	/* subimage descriptors */
+#define	TIFFTAG_INKSET			332	/* !inks in separated image */
+#define	    INKSET_CMYK			1	/* !cyan-magenta-yellow-black color */
+#define	    INKSET_MULTIINK		2	/* !multi-ink or hi-fi color */
+#define	TIFFTAG_INKNAMES		333	/* !ascii names of inks */
+#define	TIFFTAG_NUMBEROFINKS		334	/* !number of inks */
+#define	TIFFTAG_DOTRANGE		336	/* !0% and 100% dot codes */
+#define	TIFFTAG_TARGETPRINTER		337	/* !separation target */
+#define	TIFFTAG_EXTRASAMPLES		338	/* !info about extra samples */
+#define	    EXTRASAMPLE_UNSPECIFIED	0	/* !unspecified data */
+#define	    EXTRASAMPLE_ASSOCALPHA	1	/* !associated alpha data */
+#define	    EXTRASAMPLE_UNASSALPHA	2	/* !unassociated alpha data */
+#define	TIFFTAG_SAMPLEFORMAT		339	/* !data sample format */
+#define	    SAMPLEFORMAT_UINT		1	/* !unsigned integer data */
+#define	    SAMPLEFORMAT_INT		2	/* !signed integer data */
+#define	    SAMPLEFORMAT_IEEEFP		3	/* !IEEE floating point data */
+#define	    SAMPLEFORMAT_VOID		4	/* !untyped data */
+#define	    SAMPLEFORMAT_COMPLEXINT	5	/* !complex signed int */
+#define	    SAMPLEFORMAT_COMPLEXIEEEFP	6	/* !complex ieee floating */
+#define	TIFFTAG_SMINSAMPLEVALUE		340	/* !variable MinSampleValue */
+#define	TIFFTAG_SMAXSAMPLEVALUE		341	/* !variable MaxSampleValue */
+#define	TIFFTAG_CLIPPATH		343	/* %ClipPath
+						   [Adobe TIFF technote 2] */
+#define	TIFFTAG_XCLIPPATHUNITS		344	/* %XClipPathUnits
+						   [Adobe TIFF technote 2] */
+#define	TIFFTAG_YCLIPPATHUNITS		345	/* %YClipPathUnits
+						   [Adobe TIFF technote 2] */
+#define	TIFFTAG_INDEXED			346	/* %Indexed
+						   [Adobe TIFF Technote 3] */
+#define	TIFFTAG_JPEGTABLES		347	/* %JPEG table stream */
+#define	TIFFTAG_OPIPROXY		351	/* %OPI Proxy [Adobe TIFF technote] */
+/*
+ * Tags 512-521 are obsoleted by Technical Note #2 which specifies a
+ * revised JPEG-in-TIFF scheme.
+ */
+#define	TIFFTAG_JPEGPROC		512	/* !JPEG processing algorithm */
+#define	    JPEGPROC_BASELINE		1	/* !baseline sequential */
+#define	    JPEGPROC_LOSSLESS		14	/* !Huffman coded lossless */
+#define	TIFFTAG_JPEGIFOFFSET		513	/* !pointer to SOI marker */
+#define	TIFFTAG_JPEGIFBYTECOUNT		514	/* !JFIF stream length */
+#define	TIFFTAG_JPEGRESTARTINTERVAL	515	/* !restart interval length */
+#define	TIFFTAG_JPEGLOSSLESSPREDICTORS	517	/* !lossless proc predictor */
+#define	TIFFTAG_JPEGPOINTTRANSFORM	518	/* !lossless point transform */
+#define	TIFFTAG_JPEGQTABLES		519	/* !Q matrice offsets */
+#define	TIFFTAG_JPEGDCTABLES		520	/* !DCT table offsets */
+#define	TIFFTAG_JPEGACTABLES		521	/* !AC coefficient offsets */
+#define	TIFFTAG_YCBCRCOEFFICIENTS	529	/* !RGB -> YCbCr transform */
+#define	TIFFTAG_YCBCRSUBSAMPLING	530	/* !YCbCr subsampling factors */
+#define	TIFFTAG_YCBCRPOSITIONING	531	/* !subsample positioning */
+#define	    YCBCRPOSITION_CENTERED	1	/* !as in PostScript Level 2 */
+#define	    YCBCRPOSITION_COSITED	2	/* !as in CCIR 601-1 */
+#define	TIFFTAG_REFERENCEBLACKWHITE	532	/* !colorimetry info */
+#define	TIFFTAG_XMLPACKET		700	/* %XML packet
+						   [Adobe XMP Specification,
+						   January 2004 */
+#define TIFFTAG_OPIIMAGEID		32781	/* %OPI ImageID
+						   [Adobe TIFF technote] */
+/* tags 32952-32956 are private tags registered to Island Graphics */
+#define TIFFTAG_REFPTS			32953	/* image reference points */
+#define TIFFTAG_REGIONTACKPOINT		32954	/* region-xform tack point */
+#define TIFFTAG_REGIONWARPCORNERS	32955	/* warp quadrilateral */
+#define TIFFTAG_REGIONAFFINE		32956	/* affine transformation mat */
+/* tags 32995-32999 are private tags registered to SGI */
+#define	TIFFTAG_MATTEING		32995	/* $use ExtraSamples */
+#define	TIFFTAG_DATATYPE		32996	/* $use SampleFormat */
+#define	TIFFTAG_IMAGEDEPTH		32997	/* z depth of image */
+#define	TIFFTAG_TILEDEPTH		32998	/* z depth/data tile */
+/* tags 33300-33309 are private tags registered to Pixar */
+/*
+ * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH
+ * are set when an image has been cropped out of a larger image.  
+ * They reflect the size of the original uncropped image.
+ * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used
+ * to determine the position of the smaller image in the larger one.
+ */
+#define TIFFTAG_PIXAR_IMAGEFULLWIDTH    33300   /* full image size in x */
+#define TIFFTAG_PIXAR_IMAGEFULLLENGTH   33301   /* full image size in y */
+ /* Tags 33302-33306 are used to identify special image modes and data
+  * used by Pixar's texture formats.
+  */
+#define TIFFTAG_PIXAR_TEXTUREFORMAT	33302	/* texture map format */
+#define TIFFTAG_PIXAR_WRAPMODES		33303	/* s & t wrap modes */
+#define TIFFTAG_PIXAR_FOVCOT		33304	/* cotan(fov) for env. maps */
+#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305
+#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306
+/* tag 33405 is a private tag registered to Eastman Kodak */
+#define TIFFTAG_WRITERSERIALNUMBER      33405   /* device serial number */
+/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */
+#define	TIFFTAG_COPYRIGHT		33432	/* copyright string */
+/* IPTC TAG from RichTIFF specifications */
+#define TIFFTAG_RICHTIFFIPTC		33723
+/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly at apago.com) */
+#define TIFFTAG_IT8SITE			34016	/* site name */
+#define TIFFTAG_IT8COLORSEQUENCE	34017	/* color seq. [RGB,CMYK,etc] */
+#define TIFFTAG_IT8HEADER		34018	/* DDES Header */
+#define TIFFTAG_IT8RASTERPADDING	34019	/* raster scanline padding */
+#define TIFFTAG_IT8BITSPERRUNLENGTH	34020	/* # of bits in short run */
+#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */
+#define TIFFTAG_IT8COLORTABLE		34022	/* LW colortable */
+#define TIFFTAG_IT8IMAGECOLORINDICATOR	34023	/* BP/BL image color switch */
+#define TIFFTAG_IT8BKGCOLORINDICATOR	34024	/* BP/BL bg color switch */
+#define TIFFTAG_IT8IMAGECOLORVALUE	34025	/* BP/BL image color value */
+#define TIFFTAG_IT8BKGCOLORVALUE	34026	/* BP/BL bg color value */
+#define TIFFTAG_IT8PIXELINTENSITYRANGE	34027	/* MP pixel intensity value */
+#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028	/* HC transparency switch */
+#define TIFFTAG_IT8COLORCHARACTERIZATION 34029	/* color character. table */
+#define TIFFTAG_IT8HCUSAGE		34030	/* HC usage indicator */
+#define TIFFTAG_IT8TRAPINDICATOR	34031	/* Trapping indicator
+						   (untrapped=0, trapped=1) */
+#define TIFFTAG_IT8CMYKEQUIVALENT	34032	/* CMYK color equivalents */
+/* tags 34232-34236 are private tags registered to Texas Instruments */
+#define TIFFTAG_FRAMECOUNT              34232   /* Sequence Frame Count */
+/* tag 34377 is private tag registered to Adobe for PhotoShop */
+#define TIFFTAG_PHOTOSHOP		34377 
+/* tags 34665, 34853 and 40965 are documented in EXIF specification */
+#define TIFFTAG_EXIFIFD			34665	/* Pointer to EXIF private directory */
+/* tag 34750 is a private tag registered to Adobe? */
+#define TIFFTAG_ICCPROFILE		34675	/* ICC profile data */
+/* tag 34750 is a private tag registered to Pixel Magic */
+#define	TIFFTAG_JBIGOPTIONS		34750	/* JBIG options */
+#define TIFFTAG_GPSIFD			34853	/* Pointer to GPS private directory */
+/* tags 34908-34914 are private tags registered to SGI */
+#define	TIFFTAG_FAXRECVPARAMS		34908	/* encoded Class 2 ses. parms */
+#define	TIFFTAG_FAXSUBADDRESS		34909	/* received SubAddr string */
+#define	TIFFTAG_FAXRECVTIME		34910	/* receive time (secs) */
+#define	TIFFTAG_FAXDCS			34911	/* encoded fax ses. params, Table 2/T.30 */
+/* tags 37439-37443 are registered to SGI <gregl at sgi.com> */
+#define TIFFTAG_STONITS			37439	/* Sample value to Nits */
+/* tag 34929 is a private tag registered to FedEx */
+#define	TIFFTAG_FEDEX_EDR		34929	/* unknown use */
+#define TIFFTAG_INTEROPERABILITYIFD	40965	/* Pointer to Interoperability private directory */
+/* Adobe Digital Negative (DNG) format tags */
+#define TIFFTAG_DNGVERSION		50706	/* &DNG version number */
+#define TIFFTAG_DNGBACKWARDVERSION	50707	/* &DNG compatibility version */
+#define TIFFTAG_UNIQUECAMERAMODEL	50708	/* &name for the camera model */
+#define TIFFTAG_LOCALIZEDCAMERAMODEL	50709	/* &localized camera model
+						   name */
+#define TIFFTAG_CFAPLANECOLOR		50710	/* &CFAPattern->LinearRaw space
+						   mapping */
+#define TIFFTAG_CFALAYOUT		50711	/* &spatial layout of the CFA */
+#define TIFFTAG_LINEARIZATIONTABLE	50712	/* &lookup table description */
+#define TIFFTAG_BLACKLEVELREPEATDIM	50713	/* &repeat pattern size for
+						   the BlackLevel tag */
+#define TIFFTAG_BLACKLEVEL		50714	/* &zero light encoding level */
+#define TIFFTAG_BLACKLEVELDELTAH	50715	/* &zero light encoding level
+						   differences (columns) */
+#define TIFFTAG_BLACKLEVELDELTAV	50716	/* &zero light encoding level
+						   differences (rows) */
+#define TIFFTAG_WHITELEVEL		50717	/* &fully saturated encoding
+						   level */
+#define TIFFTAG_DEFAULTSCALE		50718	/* &default scale factors */
+#define TIFFTAG_DEFAULTCROPORIGIN	50719	/* &origin of the final image
+						   area */
+#define TIFFTAG_DEFAULTCROPSIZE		50720	/* &size of the final image 
+						   area */
+#define TIFFTAG_COLORMATRIX1		50721	/* &XYZ->reference color space
+						   transformation matrix 1 */
+#define TIFFTAG_COLORMATRIX2		50722	/* &XYZ->reference color space
+						   transformation matrix 2 */
+#define TIFFTAG_CAMERACALIBRATION1	50723	/* &calibration matrix 1 */
+#define TIFFTAG_CAMERACALIBRATION2	50724	/* &calibration matrix 2 */
+#define TIFFTAG_REDUCTIONMATRIX1	50725	/* &dimensionality reduction
+						   matrix 1 */
+#define TIFFTAG_REDUCTIONMATRIX2	50726	/* &dimensionality reduction
+						   matrix 2 */
+#define TIFFTAG_ANALOGBALANCE		50727	/* &gain applied the stored raw
+						   values*/
+#define TIFFTAG_ASSHOTNEUTRAL		50728	/* &selected white balance in
+						   linear reference space */
+#define TIFFTAG_ASSHOTWHITEXY		50729	/* &selected white balance in
+						   x-y chromaticity
+						   coordinates */
+#define TIFFTAG_BASELINEEXPOSURE	50730	/* &how much to move the zero
+						   point */
+#define TIFFTAG_BASELINENOISE		50731	/* &relative noise level */
+#define TIFFTAG_BASELINESHARPNESS	50732	/* &relative amount of
+						   sharpening */
+#define TIFFTAG_BAYERGREENSPLIT		50733	/* &how closely the values of
+						   the green pixels in the
+						   blue/green rows track the
+						   values of the green pixels
+						   in the red/green rows */
+#define TIFFTAG_LINEARRESPONSELIMIT	50734	/* &non-linear encoding range */
+#define TIFFTAG_CAMERASERIALNUMBER	50735	/* &camera's serial number */
+#define TIFFTAG_LENSINFO		50736	/* info about the lens */
+#define TIFFTAG_CHROMABLURRADIUS	50737	/* &chroma blur radius */
+#define TIFFTAG_ANTIALIASSTRENGTH	50738	/* &relative strength of the
+						   camera's anti-alias filter */
+#define TIFFTAG_SHADOWSCALE		50739	/* &used by Adobe Camera Raw */
+#define TIFFTAG_DNGPRIVATEDATA		50740	/* &manufacturer's private data */
+#define TIFFTAG_MAKERNOTESAFETY		50741	/* &whether the EXIF MakerNote
+						   tag is safe to preserve
+						   along with the rest of the
+						   EXIF data */
+#define	TIFFTAG_CALIBRATIONILLUMINANT1	50778	/* &illuminant 1 */
+#define TIFFTAG_CALIBRATIONILLUMINANT2	50779	/* &illuminant 2 */
+#define TIFFTAG_BESTQUALITYSCALE	50780	/* &best quality multiplier */
+#define TIFFTAG_RAWDATAUNIQUEID		50781	/* &unique identifier for
+						   the raw image data */
+#define TIFFTAG_ORIGINALRAWFILENAME	50827	/* &file name of the original
+						   raw file */
+#define TIFFTAG_ORIGINALRAWFILEDATA	50828	/* &contents of the original
+						   raw file */
+#define TIFFTAG_ACTIVEAREA		50829	/* &active (non-masked) pixels
+						   of the sensor */
+#define TIFFTAG_MASKEDAREAS		50830	/* &list of coordinates
+						   of fully masked pixels */
+#define TIFFTAG_ASSHOTICCPROFILE	50831	/* &these two tags used to */
+#define TIFFTAG_ASSHOTPREPROFILEMATRIX	50832	/* map cameras's color space
+						   into ICC profile space */
+#define TIFFTAG_CURRENTICCPROFILE	50833	/* & */
+#define TIFFTAG_CURRENTPREPROFILEMATRIX	50834	/* & */
+/* tag 65535 is an undefined tag used by Eastman Kodak */
+#define TIFFTAG_DCSHUESHIFTVALUES       65535   /* hue shift correction data */
+
+/*
+ * The following are ``pseudo tags'' that can be used to control
+ * codec-specific functionality.  These tags are not written to file.
+ * Note that these values start at 0xffff+1 so that they'll never
+ * collide with Aldus-assigned tags.
+ *
+ * If you want your private pseudo tags ``registered'' (i.e. added to
+ * this file), please post a bug report via the tracking system at
+ * http://www.remotesensing.org/libtiff/bugs.html with the appropriate
+ * C definitions to add.
+ */
+#define	TIFFTAG_FAXMODE			65536	/* Group 3/4 format control */
+#define	    FAXMODE_CLASSIC	0x0000		/* default, include RTC */
+#define	    FAXMODE_NORTC	0x0001		/* no RTC at end of data */
+#define	    FAXMODE_NOEOL	0x0002		/* no EOL code at end of row */
+#define	    FAXMODE_BYTEALIGN	0x0004		/* byte align row */
+#define	    FAXMODE_WORDALIGN	0x0008		/* word align row */
+#define	    FAXMODE_CLASSF	FAXMODE_NORTC	/* TIFF Class F */
+#define	TIFFTAG_JPEGQUALITY		65537	/* Compression quality level */
+/* Note: quality level is on the IJG 0-100 scale.  Default value is 75 */
+#define	TIFFTAG_JPEGCOLORMODE		65538	/* Auto RGB<=>YCbCr convert? */
+#define	    JPEGCOLORMODE_RAW	0x0000		/* no conversion (default) */
+#define	    JPEGCOLORMODE_RGB	0x0001		/* do auto conversion */
+#define	TIFFTAG_JPEGTABLESMODE		65539	/* What to put in JPEGTables */
+#define	    JPEGTABLESMODE_QUANT 0x0001		/* include quantization tbls */
+#define	    JPEGTABLESMODE_HUFF	0x0002		/* include Huffman tbls */
+/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */
+#define	TIFFTAG_FAXFILLFUNC		65540	/* G3/G4 fill function */
+#define	TIFFTAG_PIXARLOGDATAFMT		65549	/* PixarLogCodec I/O data sz */
+#define	    PIXARLOGDATAFMT_8BIT	0	/* regular u_char samples */
+#define	    PIXARLOGDATAFMT_8BITABGR	1	/* ABGR-order u_chars */
+#define	    PIXARLOGDATAFMT_11BITLOG	2	/* 11-bit log-encoded (raw) */
+#define	    PIXARLOGDATAFMT_12BITPICIO	3	/* as per PICIO (1.0==2048) */
+#define	    PIXARLOGDATAFMT_16BIT	4	/* signed short samples */
+#define	    PIXARLOGDATAFMT_FLOAT	5	/* IEEE float samples */
+/* 65550-65556 are allocated to Oceana Matrix <dev at oceana.com> */
+#define TIFFTAG_DCSIMAGERTYPE           65550   /* imager model & filter */
+#define     DCSIMAGERMODEL_M3           0       /* M3 chip (1280 x 1024) */
+#define     DCSIMAGERMODEL_M5           1       /* M5 chip (1536 x 1024) */
+#define     DCSIMAGERMODEL_M6           2       /* M6 chip (3072 x 2048) */
+#define     DCSIMAGERFILTER_IR          0       /* infrared filter */
+#define     DCSIMAGERFILTER_MONO        1       /* monochrome filter */
+#define     DCSIMAGERFILTER_CFA         2       /* color filter array */
+#define     DCSIMAGERFILTER_OTHER       3       /* other filter */
+#define TIFFTAG_DCSINTERPMODE           65551   /* interpolation mode */
+#define     DCSINTERPMODE_NORMAL        0x0     /* whole image, default */
+#define     DCSINTERPMODE_PREVIEW       0x1     /* preview of image (384x256) */
+#define TIFFTAG_DCSBALANCEARRAY         65552   /* color balance values */
+#define TIFFTAG_DCSCORRECTMATRIX        65553   /* color correction values */
+#define TIFFTAG_DCSGAMMA                65554   /* gamma value */
+#define TIFFTAG_DCSTOESHOULDERPTS       65555   /* toe & shoulder points */
+#define TIFFTAG_DCSCALIBRATIONFD        65556   /* calibration file desc */
+/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */
+#define	TIFFTAG_ZIPQUALITY		65557	/* compression quality level */
+#define	TIFFTAG_PIXARLOGQUALITY		65558	/* PixarLog uses same scale */
+/* 65559 is allocated to Oceana Matrix <dev at oceana.com> */
+#define TIFFTAG_DCSCLIPRECTANGLE	65559	/* area of image to acquire */
+#define TIFFTAG_SGILOGDATAFMT		65560	/* SGILog user data format */
+#define     SGILOGDATAFMT_FLOAT		0	/* IEEE float samples */
+#define     SGILOGDATAFMT_16BIT		1	/* 16-bit samples */
+#define     SGILOGDATAFMT_RAW		2	/* uninterpreted data */
+#define     SGILOGDATAFMT_8BIT		3	/* 8-bit RGB monitor values */
+#define TIFFTAG_SGILOGENCODE		65561 /* SGILog data encoding control*/
+#define     SGILOGENCODE_NODITHER	0     /* do not dither encoded values*/
+#define     SGILOGENCODE_RANDITHER	1     /* randomly dither encd values */
+
+/*
+ * EXIF tags
+ */
+#define EXIFTAG_EXPOSURETIME		33434	/* Exposure time */
+#define EXIFTAG_FNUMBER			33437	/* F number */
+#define EXIFTAG_EXPOSUREPROGRAM		34850	/* Exposure program */
+#define EXIFTAG_SPECTRALSENSITIVITY	34852	/* Spectral sensitivity */
+#define EXIFTAG_ISOSPEEDRATINGS		34855	/* ISO speed rating */
+#define EXIFTAG_OECF			34856	/* Optoelectric conversion
+						   factor */
+#define EXIFTAG_EXIFVERSION		36864	/* Exif version */
+#define EXIFTAG_DATETIMEORIGINAL	36867	/* Date and time of original
+						   data generation */
+#define EXIFTAG_DATETIMEDIGITIZED	36868	/* Date and time of digital
+						   data generation */
+#define EXIFTAG_COMPONENTSCONFIGURATION	37121	/* Meaning of each component */
+#define EXIFTAG_COMPRESSEDBITSPERPIXEL	37122	/* Image compression mode */
+#define EXIFTAG_SHUTTERSPEEDVALUE	37377	/* Shutter speed */
+#define EXIFTAG_APERTUREVALUE		37378	/* Aperture */
+#define EXIFTAG_BRIGHTNESSVALUE		37379	/* Brightness */
+#define EXIFTAG_EXPOSUREBIASVALUE	37380	/* Exposure bias */
+#define EXIFTAG_MAXAPERTUREVALUE	37381	/* Maximum lens aperture */
+#define EXIFTAG_SUBJECTDISTANCE		37382	/* Subject distance */
+#define EXIFTAG_METERINGMODE		37383	/* Metering mode */
+#define EXIFTAG_LIGHTSOURCE		37384	/* Light source */
+#define EXIFTAG_FLASH			37385	/* Flash */
+#define EXIFTAG_FOCALLENGTH		37386	/* Lens focal length */
+#define EXIFTAG_SUBJECTAREA		37396	/* Subject area */
+#define EXIFTAG_MAKERNOTE		37500	/* Manufacturer notes */
+#define EXIFTAG_USERCOMMENT		37510	/* User comments */
+#define EXIFTAG_SUBSECTIME		37520	/* DateTime subseconds */
+#define EXIFTAG_SUBSECTIMEORIGINAL	37521	/* DateTimeOriginal subseconds */
+#define EXIFTAG_SUBSECTIMEDIGITIZED	37522	/* DateTimeDigitized subseconds */
+#define EXIFTAG_FLASHPIXVERSION		40960	/* Supported Flashpix version */
+#define EXIFTAG_COLORSPACE		40961	/* Color space information */
+#define EXIFTAG_PIXELXDIMENSION		40962	/* Valid image width */
+#define EXIFTAG_PIXELYDIMENSION		40963	/* Valid image height */
+#define EXIFTAG_RELATEDSOUNDFILE	40964	/* Related audio file */
+#define EXIFTAG_FLASHENERGY		41483	/* Flash energy */
+#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484	/* Spatial frequency response */
+#define EXIFTAG_FOCALPLANEXRESOLUTION	41486	/* Focal plane X resolution */
+#define EXIFTAG_FOCALPLANEYRESOLUTION	41487	/* Focal plane Y resolution */
+#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488	/* Focal plane resolution unit */
+#define EXIFTAG_SUBJECTLOCATION		41492	/* Subject location */
+#define EXIFTAG_EXPOSUREINDEX		41493	/* Exposure index */
+#define EXIFTAG_SENSINGMETHOD		41495	/* Sensing method */
+#define EXIFTAG_FILESOURCE		41728	/* File source */
+#define EXIFTAG_SCENETYPE		41729	/* Scene type */
+#define EXIFTAG_CFAPATTERN		41730	/* CFA pattern */
+#define EXIFTAG_CUSTOMRENDERED		41985	/* Custom image processing */
+#define EXIFTAG_EXPOSUREMODE		41986	/* Exposure mode */
+#define EXIFTAG_WHITEBALANCE		41987	/* White balance */
+#define EXIFTAG_DIGITALZOOMRATIO	41988	/* Digital zoom ratio */
+#define EXIFTAG_FOCALLENGTHIN35MMFILM	41989	/* Focal length in 35 mm film */
+#define EXIFTAG_SCENECAPTURETYPE	41990	/* Scene capture type */
+#define EXIFTAG_GAINCONTROL		41991	/* Gain control */
+#define EXIFTAG_CONTRAST		41992	/* Contrast */
+#define EXIFTAG_SATURATION		41993	/* Saturation */
+#define EXIFTAG_SHARPNESS		41994	/* Sharpness */
+#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995	/* Device settings description */
+#define EXIFTAG_SUBJECTDISTANCERANGE	41996	/* Subject distance range */
+#define EXIFTAG_GAINCONTROL		41991	/* Gain control */
+#define EXIFTAG_GAINCONTROL		41991	/* Gain control */
+#define EXIFTAG_IMAGEUNIQUEID		42016	/* Unique image ID */
+
+#endif /* _TIFF_ */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tiffcomp.h b/src/tiff/tiffcomp.h
new file mode 100644
index 0000000..5de3832
--- /dev/null
+++ b/src/tiff/tiffcomp.h
@@ -0,0 +1,221 @@
+/* $Header$ */
+
+/*
+ * Copyright (c) 1990-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _COMPAT_
+#define	_COMPAT_
+/*
+ * This file contains a hodgepodge of definitions and
+ * declarations that are needed to provide compatibility
+ * between the native system and the base implementation
+ * that the library assumes.
+ *
+ * NB: This file is a mess.
+ */
+
+/*
+ * Setup basic type definitions and function declaratations.
+ */
+
+/*
+ * Simplify Acorn RISC OS identifier (to avoid confusion with Acorn RISC iX
+ * and with defunct Unix Risc OS)
+ * No need to specify __arm - hey, Acorn might port the OS, no problem here!
+ */
+#ifdef __acornriscos
+#undef __acornriscos
+#endif
+#if defined(__acorn) && defined(__riscos)
+#define __acornriscos
+#endif
+
+#if defined(__MWERKS__) || defined(THINK_C)
+#include <unix.h>
+#include <math.h>
+#endif
+
+#include <stdio.h>
+
+#if defined(__PPCC__) || defined(__SC__) || defined(__MRC__)
+#include <types.h>
+#elif !defined(__MWERKS__) && !defined(THINK_C) && !defined(__acornriscos) && !defined(applec)
+#include <sys/types.h>
+#endif
+
+#if defined(VMS)
+#include <file.h>
+#include <unixio.h>
+#elif !defined(__acornriscos)
+#include <fcntl.h>
+#endif
+
+/*
+ * This maze of checks controls defines or not the
+ * target system has BSD-style typdedefs declared in
+ * an include file and/or whether or not to include
+ * <unistd.h> to get the SEEK_* definitions.  Some
+ * additional includes are also done to pull in the
+ * appropriate definitions we're looking for.
+ */
+#if defined(__MWERKS__) || defined(THINK_C) || defined(__PPCC__) || defined(__SC__) || defined(__MRC__)
+#include <stdlib.h>
+#define	BSDTYPES
+#define	HAVE_UNISTD_H	0
+#elif (defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows) || defined(_WIN32)) && !defined(unix)
+#undef BSDTYPES
+#define	BSDTYPES
+#elif defined(OS2_16) || defined(OS2_32)
+#define	BSDTYPES
+#elif defined(__acornriscos)
+#include <stdlib.h>
+#define	BSDTYPES
+#define	HAVE_UNISTD_H	0
+#elif defined(VMS)
+#define	HAVE_UNISTD_H	0
+#else
+#define	HAVE_UNISTD_H	1
+#endif
+
+/*
+ * The library uses the ANSI C/POSIX SEEK_*
+ * definitions that should be defined in unistd.h
+ * (except on system where they are in stdio.h and
+ * there is no unistd.h).
+ */
+#if !defined(SEEK_SET) && HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/*
+ * The library uses memset, memcpy, and memcmp.
+ * ANSI C and System V define these in string.h.
+ */
+#include <string.h>
+
+/*
+ * The BSD typedefs are used throughout the library.
+ * If your system doesn't have them in <sys/types.h>,
+ * then define BSDTYPES in your Makefile.
+ */
+#if defined(BSDTYPES)
+# ifndef _BSDTYPES_DEFINED
+#  ifndef __u_char_defined
+typedef	unsigned char u_char;
+typedef	unsigned short u_short;
+typedef	unsigned int u_int;
+typedef	unsigned long u_long;
+#   define __u_char_defined
+#  endif /* __u_char_defined */
+#  define _BSDTYPES_DEFINED
+# endif /* _BSDTYPES_DEFINED */
+#endif /* BSDTYPES */
+
+/*
+ * dblparam_t is the type that a double precision
+ * floating point value will have on the parameter
+ * stack (when coerced by the compiler).
+ */
+/* Note: on MacPowerPC "extended" is undefined. So only use it for 68K-Macs */
+#if defined(__SC__) || defined(THINK_C)
+typedef extended dblparam_t;
+#else
+typedef double dblparam_t;
+#endif
+
+/*
+ * If your compiler supports inline functions, then
+ * set INLINE appropriately to get the known hotspots
+ * in the library expanded inline.
+ */
+#if defined(__GNUC__)
+#if defined(__STRICT_ANSI__)
+#define	INLINE	__inline__
+#else
+#define	INLINE	inline
+#endif
+#else /* !__GNUC__ */
+#define	INLINE
+#endif
+
+/*
+ * GLOBALDATA is a macro that is used to define global variables
+ * private to the library.  We use this indirection to hide
+ * brain-damage in VAXC (and GCC) under VAX/VMS.  In these
+ * environments the macro places the variable in a non-shareable
+ * program section, which ought to be done by default (sigh!)
+ *
+ * Apparently DEC are aware of the problem as this behaviour is the
+ * default under VMS on AXP.
+ *
+ * The GNU C variant is untested.
+ */
+#if defined(VAX) && defined(VMS)
+#if defined(VAXC)
+#define GLOBALDATA(TYPE,NAME)	extern noshare TYPE NAME
+#endif
+#if defined(__GNUC__)
+#define GLOBALDATA(TYPE,NAME)	extern TYPE NAME \
+	asm("_$$PsectAttributes_NOSHR$$" #NAME)
+#endif
+#else	/* !VAX/VMS */
+#define GLOBALDATA(TYPE,NAME)	extern TYPE NAME
+#endif
+
+#if defined(__acornriscos)
+/*
+ * osfcn.h is part of C++Lib on Acorn C/C++, and as such can't be used
+ * on C alone. For that reason, the relevant functions are
+ * implemented in tif_acorn.c, and the elements from the header
+ * file are included here.
+ */
+#if defined(__cplusplus)
+#include <osfcn.h>
+#else
+#define	O_RDONLY	0
+#define	O_WRONLY	1
+#define	O_RDWR		2
+#define	O_APPEND	8
+#define	O_CREAT		0x200
+#define	O_TRUNC		0x400
+typedef long off_t;
+extern int open(const char *name, int flags, int mode);
+extern int close(int fd);
+extern int write(int fd, const char *buf, int nbytes);
+extern int read(int fd, char *buf, int nbytes);
+extern off_t lseek(int fd, off_t offset, int whence);
+extern int creat(const char *path, int mode);
+#endif /* __cplusplus */
+#endif /* __acornriscos */
+
+/* Bit and byte order, the default is MSB to LSB */
+#ifdef VMS
+#undef HOST_FILLORDER
+#undef HOST_BIGENDIAN
+#define HOST_FILLORDER FILLORDER_LSB2MSB
+#define HOST_BIGENDIAN	0
+#endif
+
+
+#endif /* _COMPAT_ */
diff --git a/src/tiff/tiffconf.h b/src/tiff/tiffconf.h
new file mode 100644
index 0000000..f5b16cb
--- /dev/null
+++ b/src/tiff/tiffconf.h
@@ -0,0 +1,101 @@
+/* libtiff/tiffconf.h.  Generated by configure.  */
+/*
+  Configuration defines for installed libtiff.
+  This file maintained for backward compatibility. Do not use definitions
+  from this file in your programs.
+*/
+
+#ifndef _TIFFCONF_
+#define _TIFFCONF_
+
+/* Define to 1 if the system has the type `int16'. */
+/* #undef HAVE_INT16 */
+
+/* Define to 1 if the system has the type `int32'. */
+/* #undef HAVE_INT32 */
+
+/* Define to 1 if the system has the type `int8'. */
+/* #undef HAVE_INT8 */
+
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of a `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* Compatibility stuff. */
+
+/* Define as 0 or 1 according to the floating point format suported by the
+   machine */
+#define HAVE_IEEEFP 1
+
+/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
+#define HOST_FILLORDER FILLORDER_LSB2MSB
+
+/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
+   (Intel) */
+#define HOST_BIGENDIAN 0
+
+/* Support CCITT Group 3 & 4 algorithms */
+#define CCITT_SUPPORT 1
+
+/* Support JPEG compression (requires IJG JPEG library) */
+#define JPEG_SUPPORT 1
+
+/* Support LogLuv high dynamic range encoding */
+#define LOGLUV_SUPPORT 1
+
+/* Support LZW algorithm */
+#define LZW_SUPPORT 1
+
+/* Support NeXT 2-bit RLE algorithm */
+#define NEXT_SUPPORT 1
+
+/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
+   fails with unpatched IJG JPEG library) */
+/* #undef OJPEG_SUPPORT */
+
+/* Support Macintosh PackBits algorithm */
+#define PACKBITS_SUPPORT 1
+
+/* Support Pixar log-format algorithm (requires Zlib) */
+#define PIXARLOG_SUPPORT 1
+
+/* Support ThunderScan 4-bit RLE algorithm */
+#define THUNDER_SUPPORT 1
+
+/* Support Deflate compression */
+#define ZIP_SUPPORT 1
+
+/* Support strip chopping (whether or not to convert single-strip uncompressed
+   images to mutiple strips of ~8Kb to reduce memory usage) */
+#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP
+
+/* Enable SubIFD tag (330) support */
+#define SUBIFD_SUPPORT 1
+
+/* Treat extra sample as alpha (default enabled). The RGBA interface will
+   treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
+   packages produce RGBA files but don't mark the alpha properly. */
+#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
+
+/* Pick up YCbCr subsampling info from the JPEG data stream to support files
+   lacking the tag (default enabled). */
+#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
+
+/* Support MS MDI magic number files as TIFF */
+#define MDI_SUPPORT 1
+
+/*
+ * Feature support definitions.
+ * XXX: These macros are obsoleted. Don't use them in your apps!
+ * Macros stays here for backward compatibility and should be always defined.
+ */
+#define COLORIMETRY_SUPPORT
+#define YCBCR_SUPPORT
+#define CMYK_SUPPORT
+#define ICC_SUPPORT
+#define PHOTOSHOP_SUPPORT
+#define IPTC_SUPPORT
+
+#endif /* _TIFFCONF_ */
diff --git a/src/tiff/tiffio.h b/src/tiff/tiffio.h
new file mode 100644
index 0000000..0fdccab
--- /dev/null
+++ b/src/tiff/tiffio.h
@@ -0,0 +1,517 @@
+/* $Id: tiffio.h 7870 2009-05-21 14:48:39Z castejon $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _TIFFIO_
+#define	_TIFFIO_
+
+#include "geotiff.h"
+
+/*
+ * TIFF I/O Library Definitions.
+ */
+#include "tiff.h"
+#include "tiffvers.h"
+
+/*
+ * TIFF is defined as an incomplete type to hide the
+ * library's internal data structures from clients.
+ */
+typedef	struct tiff TIFF;
+
+/*
+ * The following typedefs define the intrinsic size of
+ * data types used in the *exported* interfaces.  These
+ * definitions depend on the proper definition of types
+ * in tiff.h.  Note also that the varargs interface used
+ * to pass tag types and values uses the types defined in
+ * tiff.h directly.
+ *
+ * NB: ttag_t is unsigned int and not unsigned short because
+ *     ANSI C requires that the type before the ellipsis be a
+ *     promoted type (i.e. one of int, unsigned int, pointer,
+ *     or double) and because we defined pseudo-tags that are
+ *     outside the range of legal Aldus-assigned tags.
+ * NB: tsize_t is int32 and not uint32 because some functions
+ *     return -1.
+ * NB: toff_t is not off_t for many reasons; TIFFs max out at
+ *     32-bit file offsets being the most important, and to ensure
+ *     that it is unsigned, rather than signed.
+ */
+typedef	uint32 ttag_t;		/* directory tag */
+typedef	uint16 tdir_t;		/* directory index */
+typedef	uint16 tsample_t;	/* sample number */
+typedef	uint32 tstrip_t;	/* strip number */
+typedef uint32 ttile_t;		/* tile number */
+typedef	int32 tsize_t;		/* i/o size in bytes */
+typedef	void* tdata_t;		/* image data ref */
+typedef	uint32 toff_t;		/* file offset */
+
+#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))
+#define __WIN32__
+#endif
+
+/*
+ * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c
+ * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).
+ *
+ * By default tif_unix.c is assumed.
+ */
+
+#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)
+#  if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO)
+#    define AVOID_WIN32_FILEIO
+#  endif
+#endif
+
+#if defined(USE_WIN32_FILEIO)
+# define VC_EXTRALEAN
+# include <windows.h>
+# ifdef __WIN32__
+DECLARE_HANDLE(thandle_t);	/* Win32 file handle */
+# else
+typedef	HFILE thandle_t;	/* client data handle */
+# endif /* __WIN32__ */
+#else
+typedef	void* thandle_t;	/* client data handle */
+#endif /* USE_WIN32_FILEIO */
+
+#ifndef NULL
+# define NULL	(void *)0
+#endif
+
+/*
+ * Flags to pass to TIFFPrintDirectory to control
+ * printing of data structures that are potentially
+ * very large.   Bit-or these flags to enable printing
+ * multiple items.
+ */
+#define	TIFFPRINT_NONE		0x0		/* no extra info */
+#define	TIFFPRINT_STRIPS	0x1		/* strips/tiles info */
+#define	TIFFPRINT_CURVES	0x2		/* color/gray response curves */
+#define	TIFFPRINT_COLORMAP	0x4		/* colormap */
+#define	TIFFPRINT_JPEGQTABLES	0x100		/* JPEG Q matrices */
+#define	TIFFPRINT_JPEGACTABLES	0x200		/* JPEG AC tables */
+#define	TIFFPRINT_JPEGDCTABLES	0x200		/* JPEG DC tables */
+
+/* 
+ * Colour conversion stuff
+ */
+
+/* reference white */
+#define D65_X0 (95.0470F)
+#define D65_Y0 (100.0F)
+#define D65_Z0 (108.8827F)
+
+#define D50_X0 (96.4250F)
+#define D50_Y0 (100.0F)
+#define D50_Z0 (82.4680F)
+
+/* Structure for holding information about a display device. */
+
+typedef	unsigned char TIFFRGBValue;		/* 8-bit samples */
+
+typedef struct {
+	float d_mat[3][3]; 		/* XYZ -> luminance matrix */
+	float d_YCR;			/* Light o/p for reference white */
+	float d_YCG;
+	float d_YCB;
+	uint32 d_Vrwr;			/* Pixel values for ref. white */
+	uint32 d_Vrwg;
+	uint32 d_Vrwb;
+	float d_Y0R;			/* Residual light for black pixel */
+	float d_Y0G;
+	float d_Y0B;
+	float d_gammaR;			/* Gamma values for the three guns */
+	float d_gammaG;
+	float d_gammaB;
+} TIFFDisplay;
+
+typedef struct {				/* YCbCr->RGB support */
+	TIFFRGBValue* clamptab;			/* range clamping table */
+	int*	Cr_r_tab;
+	int*	Cb_b_tab;
+	int32*	Cr_g_tab;
+	int32*	Cb_g_tab;
+        int32*  Y_tab;
+} TIFFYCbCrToRGB;
+
+typedef struct {				/* CIE Lab 1976->RGB support */
+	int	range;				/* Size of conversion table */
+#define CIELABTORGB_TABLE_RANGE 1500
+	float	rstep, gstep, bstep;
+	float	X0, Y0, Z0;			/* Reference white point */
+	TIFFDisplay display;
+	float	Yr2r[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yr to r */
+	float	Yg2g[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yg to g */
+	float	Yb2b[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yb to b */
+} TIFFCIELabToRGB;
+
+/*
+ * RGBA-style image support.
+ */
+typedef struct _TIFFRGBAImage TIFFRGBAImage;
+/*
+ * The image reading and conversion routines invoke
+ * ``put routines'' to copy/image/whatever tiles of
+ * raw image data.  A default set of routines are 
+ * provided to convert/copy raw image data to 8-bit
+ * packed ABGR format rasters.  Applications can supply
+ * alternate routines that unpack the data into a
+ * different format or, for example, unpack the data
+ * and draw the unpacked raster on the display.
+ */
+typedef void (*tileContigRoutine)
+    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
+	unsigned char*);
+typedef void (*tileSeparateRoutine)
+    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
+	unsigned char*, unsigned char*, unsigned char*, unsigned char*);
+/*
+ * RGBA-reader state.
+ */
+struct _TIFFRGBAImage {
+	TIFF*	tif;				/* image handle */
+	int	stoponerr;			/* stop on read error */
+	int	isContig;			/* data is packed/separate */
+	int	alpha;				/* type of alpha data present */
+	uint32	width;				/* image width */
+	uint32	height;				/* image height */
+	uint16	bitspersample;			/* image bits/sample */
+	uint16	samplesperpixel;		/* image samples/pixel */
+	uint16	orientation;			/* image orientation */
+	uint16	req_orientation;		/* requested orientation */
+	uint16	photometric;			/* image photometric interp */
+	uint16*	redcmap;			/* colormap pallete */
+	uint16*	greencmap;
+	uint16*	bluecmap;
+						/* get image data routine */
+	int	(*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
+	union {
+	    void (*any)(TIFFRGBAImage*);
+	    tileContigRoutine	contig;
+	    tileSeparateRoutine	separate;
+	} put;					/* put decoded strip/tile */
+	TIFFRGBValue* Map;			/* sample mapping array */
+	uint32** BWmap;				/* black&white map */
+	uint32** PALmap;			/* palette image map */
+	TIFFYCbCrToRGB* ycbcr;			/* YCbCr conversion state */
+        TIFFCIELabToRGB* cielab;		/* CIE L*a*b conversion state */
+
+        int	row_offset;
+        int     col_offset;
+};
+
+/*
+ * Macros for extracting components from the
+ * packed ABGR form returned by TIFFReadRGBAImage.
+ */
+#define	TIFFGetR(abgr)	((abgr) & 0xff)
+#define	TIFFGetG(abgr)	(((abgr) >> 8) & 0xff)
+#define	TIFFGetB(abgr)	(((abgr) >> 16) & 0xff)
+#define	TIFFGetA(abgr)	(((abgr) >> 24) & 0xff)
+
+/*
+ * A CODEC is a software package that implements decoding,
+ * encoding, or decoding+encoding of a compression algorithm.
+ * The library provides a collection of builtin codecs.
+ * More codecs may be registered through calls to the library
+ * and/or the builtin implementations may be overridden.
+ */
+typedef	int (*TIFFInitMethod)(TIFF*, int);
+typedef struct {
+	char*		name;
+	uint16		scheme;
+	TIFFInitMethod	init;
+} TIFFCodec;
+
+#include <stdio.h>
+#include <stdarg.h>
+
+/* share internal LogLuv conversion routines? */
+#ifndef LOGLUV_PUBLIC
+#define LOGLUV_PUBLIC		1
+#endif
+
+#if defined(c_plusplus) || defined(__cplusplus)
+extern "C" {
+#endif
+typedef	void (*TIFFErrorHandler)(const char*, const char*, va_list);
+typedef	void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);
+typedef	tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t);
+typedef	toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
+typedef	int (*TIFFCloseProc)(thandle_t);
+typedef	toff_t (*TIFFSizeProc)(thandle_t);
+typedef	int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*);
+typedef	void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t);
+typedef	void (*TIFFExtendProc)(TIFF*); 
+
+extern	const char* TIFFGetVersion(void);
+
+extern	const TIFFCodec* TIFFFindCODEC(uint16);
+extern	TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
+extern	void CPL_DLL TIFFUnRegisterCODEC(TIFFCodec*);
+extern  int CPL_DLL TIFFIsCODECConfigured(uint16);
+extern	TIFFCodec* TIFFGetConfiguredCODECs(void);
+
+/*
+ * Auxiliary functions.
+ */
+
+extern	tdata_t CPL_DLL _TIFFmalloc(tsize_t);
+extern	tdata_t CPL_DLL _TIFFrealloc(tdata_t, tsize_t);
+extern	void CPL_DLL _TIFFmemset(tdata_t, int, tsize_t);
+extern	void CPL_DLL _TIFFmemcpy(tdata_t, const tdata_t, tsize_t);
+extern	int CPL_DLL _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t);
+extern	void CPL_DLL _TIFFfree(tdata_t);
+
+/*
+** Stuff, related to tag handling and creating custom tags.
+*/
+extern  int  TIFFGetTagListCount( TIFF * );
+extern  ttag_t TIFFGetTagListEntry( TIFF *, int tag_index );
+    
+#define	TIFF_ANY	TIFF_NOTYPE	/* for field descriptor searching */
+#define	TIFF_VARIABLE	-1		/* marker for variable length tags */
+#define	TIFF_SPP	-2		/* marker for SamplesPerPixel tags */
+#define	TIFF_VARIABLE2	-3		/* marker for uint32 var-length tags */
+
+#define FIELD_CUSTOM    65    
+
+typedef	struct {
+	ttag_t	field_tag;		/* field's tag */
+	short	field_readcount;	/* read count/TIFF_VARIABLE/TIFF_SPP */
+	short	field_writecount;	/* write count/TIFF_VARIABLE */
+	TIFFDataType field_type;	/* type of associated data */
+        unsigned short field_bit;	/* bit in fieldsset bit vector */
+	unsigned char field_oktochange;	/* if true, can change while writing */
+	unsigned char field_passcount;	/* if true, pass dir count on set */
+	char	*field_name;		/* ASCII name */
+} TIFFFieldInfo;
+
+typedef struct _TIFFTagValue {
+    const TIFFFieldInfo  *info;
+    int             count;
+    void           *value;
+} TIFFTagValue;
+
+extern	void CPL_DLL TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], int);
+extern	const TIFFFieldInfo* TIFFFindFieldInfo(TIFF*, ttag_t, TIFFDataType);
+extern  const TIFFFieldInfo* TIFFFindFieldInfoByName(TIFF* , const char *,
+						     TIFFDataType);
+extern	const TIFFFieldInfo* TIFFFieldWithTag(TIFF*, ttag_t);
+extern	const TIFFFieldInfo* TIFFFieldWithName(TIFF*, const char *);
+
+typedef	int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list);
+typedef	int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list);
+typedef	void (*TIFFPrintMethod)(TIFF*, FILE*, long);
+    
+typedef struct {
+    TIFFVSetMethod	vsetfield;	/* tag set routine */
+    TIFFVGetMethod	vgetfield;	/* tag get routine */
+    TIFFPrintMethod	printdir;	/* directory print routine */
+} TIFFTagMethods;
+        
+extern  TIFFTagMethods CPL_DLL *TIFFAccessTagMethods( TIFF * );
+extern  void CPL_DLL *TIFFGetClientInfo( TIFF *, const char * );
+extern  void CPL_DLL TIFFSetClientInfo( TIFF *, void *, const char * );
+
+extern	void CPL_DLL TIFFCleanup(TIFF*);
+extern	void CPL_DLL TIFFClose(TIFF*);
+extern	int CPL_DLL TIFFFlush(TIFF*);
+extern	int CPL_DLL TIFFFlushData(TIFF*);
+extern	int CPL_DLL TIFFGetField(TIFF*, ttag_t, ...);
+extern	int CPL_DLL TIFFVGetField(TIFF*, ttag_t, va_list);
+extern	int CPL_DLL TIFFGetFieldDefaulted(TIFF*, ttag_t, ...);
+extern	int CPL_DLL TIFFVGetFieldDefaulted(TIFF*, ttag_t, va_list);
+extern	int CPL_DLL TIFFReadDirectory(TIFF*);
+extern	int CPL_DLL TIFFReadCustomDirectory(TIFF*, toff_t, const TIFFFieldInfo[],
+				    size_t);
+extern	int CPL_DLL TIFFReadEXIFDirectory(TIFF*, toff_t);
+extern	tsize_t CPL_DLL TIFFScanlineSize(TIFF*);
+extern	tsize_t CPL_DLL TIFFRasterScanlineSize(TIFF*);
+extern	tsize_t CPL_DLL TIFFStripSize(TIFF*);
+extern	tsize_t CPL_DLL TIFFRawStripSize(TIFF*, tstrip_t);
+extern	tsize_t CPL_DLL TIFFVStripSize(TIFF*, uint32);
+extern	tsize_t CPL_DLL TIFFTileRowSize(TIFF*);
+extern	tsize_t CPL_DLL TIFFTileSize(TIFF*);
+extern	tsize_t CPL_DLL TIFFVTileSize(TIFF*, uint32);
+extern	uint32 CPL_DLL TIFFDefaultStripSize(TIFF*, uint32);
+extern	void CPL_DLL TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
+extern	int CPL_DLL TIFFFileno(TIFF*);
+extern  int CPL_DLL TIFFSetFileno(TIFF*, int);
+extern  thandle_t CPL_DLL TIFFClientdata(TIFF*);
+extern  thandle_t CPL_DLL TIFFSetClientdata(TIFF*, thandle_t);
+extern	int CPL_DLL TIFFGetMode(TIFF*);
+extern	int CPL_DLL TIFFSetMode(TIFF*, int);
+extern	int CPL_DLL TIFFIsTiled(TIFF*);
+extern	int CPL_DLL TIFFIsByteSwapped(TIFF*);
+extern	int CPL_DLL TIFFIsUpSampled(TIFF*);
+extern	int CPL_DLL TIFFIsMSB2LSB(TIFF*);
+extern	int CPL_DLL TIFFIsBigEndian(TIFF*);
+extern	TIFFReadWriteProc CPL_DLL TIFFGetReadProc(TIFF*);
+extern	TIFFReadWriteProc CPL_DLL TIFFGetWriteProc(TIFF*);
+extern	TIFFSeekProc CPL_DLL TIFFGetSeekProc(TIFF*);
+extern	TIFFCloseProc CPL_DLL TIFFGetCloseProc(TIFF*);
+extern	TIFFSizeProc CPL_DLL TIFFGetSizeProc(TIFF*);
+extern	TIFFMapFileProc CPL_DLL TIFFGetMapFileProc(TIFF*);
+extern	TIFFUnmapFileProc CPL_DLL TIFFGetUnmapFileProc(TIFF*);
+extern	uint32 CPL_DLL TIFFCurrentRow(TIFF*);
+extern	tdir_t CPL_DLL TIFFCurrentDirectory(TIFF*);
+extern	tdir_t CPL_DLL TIFFNumberOfDirectories(TIFF*);
+extern	uint32 CPL_DLL TIFFCurrentDirOffset(TIFF*);
+extern	tstrip_t CPL_DLL TIFFCurrentStrip(TIFF*);
+extern	ttile_t CPL_DLL TIFFCurrentTile(TIFF*);
+extern	int CPL_DLL TIFFReadBufferSetup(TIFF*, tdata_t, tsize_t);
+extern	int CPL_DLL TIFFWriteBufferSetup(TIFF*, tdata_t, tsize_t);
+extern	int CPL_DLL TIFFSetupStrips(TIFF *);
+extern  int CPL_DLL TIFFWriteCheck(TIFF*, int, const char *);
+extern	void CPL_DLL TIFFFreeDirectory(TIFF*);
+extern  int CPL_DLL TIFFCreateDirectory(TIFF*);
+extern	int CPL_DLL TIFFLastDirectory(TIFF*);
+extern	int CPL_DLL TIFFSetDirectory(TIFF*, tdir_t);
+extern	int CPL_DLL TIFFSetSubDirectory(TIFF*, uint32);
+extern	int CPL_DLL TIFFUnlinkDirectory(TIFF*, tdir_t);
+extern	int CPL_DLL TIFFSetField(TIFF*, ttag_t, ...);
+extern	int CPL_DLL TIFFVSetField(TIFF*, ttag_t, va_list);
+extern	int CPL_DLL TIFFWriteDirectory(TIFF *);
+extern	int CPL_DLL TIFFCheckpointDirectory(TIFF *);
+extern	int CPL_DLL TIFFRewriteDirectory(TIFF *);
+extern	int CPL_DLL TIFFReassignTagToIgnore(enum TIFFIgnoreSense, int);
+
+#if defined(c_plusplus) || defined(__cplusplus)
+extern	void CPL_DLL TIFFPrintDirectory(TIFF*, FILE*, long = 0);
+extern	int CPL_DLL TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
+extern	int CPL_DLL TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
+extern	int CPL_DLL TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
+extern	int CPL_DLL TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,
+				      int = ORIENTATION_BOTLEFT, int = 0);
+#else
+extern	void CPL_DLL TIFFPrintDirectory(TIFF*, FILE*, long);
+extern	int CPL_DLL TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t);
+extern	int CPL_DLL TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t);
+extern	int CPL_DLL TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
+extern	int CPL_DLL TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);
+#endif
+
+extern	int CPL_DLL TIFFReadRGBAStrip(TIFF*, tstrip_t, uint32 * );
+extern	int CPL_DLL TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
+extern	int CPL_DLL TIFFRGBAImageOK(TIFF*, char [1024]);
+extern	int CPL_DLL TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
+extern	int CPL_DLL TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
+extern	void CPL_DLL TIFFRGBAImageEnd(TIFFRGBAImage*);
+extern	TIFF* TIFFOpen(const char*, const char*);
+# ifdef __WIN32__
+extern	TIFF* TIFFOpenW(const wchar_t*, const char*);
+# endif /* __WIN32__ */
+extern	TIFF* TIFFFdOpen(int, const char*, const char*);
+extern	TIFF* TIFFClientOpen(const char*, const char*,
+	    thandle_t,
+	    TIFFReadWriteProc, TIFFReadWriteProc,
+	    TIFFSeekProc, TIFFCloseProc,
+	    TIFFSizeProc,
+	    TIFFMapFileProc, TIFFUnmapFileProc);
+extern	const char* TIFFFileName(TIFF*);
+extern	const char* TIFFSetFileName(TIFF*, const char *);
+extern	void CPL_DLL TIFFError(const char*, const char*, ...);
+extern	void CPL_DLL TIFFErrorExt(thandle_t, const char*, const char*, ...);
+extern	void CPL_DLL TIFFWarning(const char*, const char*, ...);
+extern	void CPL_DLL TIFFWarningExt(thandle_t, const char*, const char*, ...);
+extern	TIFFErrorHandler CPL_DLL TIFFSetErrorHandler(TIFFErrorHandler);
+extern	TIFFErrorHandlerExt CPL_DLL TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);
+extern	TIFFErrorHandler CPL_DLL TIFFSetWarningHandler(TIFFErrorHandler);
+extern	TIFFErrorHandlerExt CPL_DLL TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);
+extern	TIFFExtendProc CPL_DLL TIFFSetTagExtender(TIFFExtendProc);
+extern	ttile_t CPL_DLL TIFFComputeTile(TIFF*, uint32, uint32, uint32, tsample_t);
+extern	int CPL_DLL TIFFCheckTile(TIFF*, uint32, uint32, uint32, tsample_t);
+extern	ttile_t CPL_DLL TIFFNumberOfTiles(TIFF*);
+extern	tsize_t CPL_DLL TIFFReadTile(TIFF*,
+	    tdata_t, uint32, uint32, uint32, tsample_t);
+extern	tsize_t CPL_DLL TIFFWriteTile(TIFF*,
+	    tdata_t, uint32, uint32, uint32, tsample_t);
+extern	tstrip_t CPL_DLL TIFFComputeStrip(TIFF*, uint32, tsample_t);
+extern	tstrip_t CPL_DLL TIFFNumberOfStrips(TIFF*);
+extern	tsize_t  CPL_DLL TIFFReadEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
+extern	tsize_t CPL_DLL TIFFReadRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
+extern	tsize_t CPL_DLL TIFFReadEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
+extern	tsize_t CPL_DLL TIFFReadRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
+extern	tsize_t CPL_DLL TIFFWriteEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
+extern	tsize_t CPL_DLL TIFFWriteRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
+extern	tsize_t CPL_DLL TIFFWriteEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
+extern	tsize_t CPL_DLL TIFFWriteRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
+extern	int CPL_DLL TIFFDataWidth(TIFFDataType);    /* table of tag datatype widths */
+extern	void CPL_DLL TIFFSetWriteOffset(TIFF*, toff_t);
+extern	void CPL_DLL TIFFSwabShort(uint16*);
+extern	void CPL_DLL TIFFSwabLong(uint32*);
+extern	void CPL_DLL TIFFSwabDouble(double*);
+extern	void CPL_DLL TIFFSwabArrayOfShort(uint16*, unsigned long);
+extern	void CPL_DLL TIFFSwabArrayOfTriples(uint8*, unsigned long);
+extern	void CPL_DLL TIFFSwabArrayOfLong(uint32*, unsigned long);
+extern	void CPL_DLL TIFFSwabArrayOfDouble(double*, unsigned long);
+extern	void CPL_DLL TIFFReverseBits(unsigned char *, unsigned long);
+extern	const unsigned char* TIFFGetBitRevTable(int);
+
+#ifdef LOGLUV_PUBLIC
+#define U_NEU		0.210526316
+#define V_NEU		0.473684211
+#define UVSCALE		410.
+extern	double LogL16toY(int);
+extern	double LogL10toY(int);
+extern	void XYZtoRGB24(float*, uint8*);
+extern	int uv_decode(double*, double*, int);
+extern	void LogLuv24toXYZ(uint32, float*);
+extern	void LogLuv32toXYZ(uint32, float*);
+#if defined(c_plusplus) || defined(__cplusplus)
+extern	int LogL16fromY(double, int = SGILOGENCODE_NODITHER);
+extern	int LogL10fromY(double, int = SGILOGENCODE_NODITHER);
+extern	int uv_encode(double, double, int = SGILOGENCODE_NODITHER);
+extern	uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);
+extern	uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);
+#else
+extern	int LogL16fromY(double, int);
+extern	int LogL10fromY(double, int);
+extern	int uv_encode(double, double, int);
+extern	uint32 LogLuv24fromXYZ(float*, int);
+extern	uint32 LogLuv32fromXYZ(float*, int);
+#endif
+#endif /* LOGLUV_PUBLIC */
+    
+extern int CPL_DLL TIFFCIELabToRGBInit(TIFFCIELabToRGB*, TIFFDisplay *, float*);
+extern void CPL_DLL TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,
+			    float *, float *, float *);
+extern void CPL_DLL TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,
+			 uint32 *, uint32 *, uint32 *);
+
+extern int CPL_DLL TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);
+extern void CPL_DLL TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,
+			   uint32 *, uint32 *, uint32 *);
+
+#if defined(c_plusplus) || defined(__cplusplus)
+}
+#endif
+
+#endif /* _TIFFIO_ */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tiffiop.h b/src/tiff/tiffiop.h
new file mode 100644
index 0000000..182eed8
--- /dev/null
+++ b/src/tiff/tiffiop.h
@@ -0,0 +1,323 @@
+/* $Id: tiffiop.h 4825 2006-08-16 13:01:53Z lubia $ */
+
+/*
+ * Copyright (c) 1988-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and 
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ * 
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _TIFFIOP_
+#define	_TIFFIOP_
+/*
+ * ``Library-private'' definitions.
+ */
+
+#include "tif_config.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+#ifdef HAVE_ASSERT_H
+# include <assert.h>
+#else
+# define assert(x) 
+#endif
+
+#ifdef HAVE_SEARCH_H
+# include <search.h>
+#else
+extern void *lfind(const void *, const void *, size_t *, size_t,
+		   int (*)(const void *, const void *));
+#endif
+
+#include "tiffio.h"
+#include "tif_dir.h"
+
+#ifndef STRIP_SIZE_DEFAULT
+# define STRIP_SIZE_DEFAULT 8192
+#endif
+
+#define    streq(a,b)      (strcmp(a,b) == 0)
+
+#ifndef TRUE
+#define	TRUE	1
+#define	FALSE	0
+#endif
+
+typedef struct client_info {
+    struct client_info *next;
+    void      *data;
+    char      *name;
+} TIFFClientInfoLink;
+
+/*
+ * Typedefs for ``method pointers'' used internally.
+ */
+typedef	unsigned char tidataval_t;	/* internal image data value type */
+typedef	tidataval_t* tidata_t;		/* reference to internal image data */
+
+typedef	void (*TIFFVoidMethod)(TIFF*);
+typedef	int (*TIFFBoolMethod)(TIFF*);
+typedef	int (*TIFFPreMethod)(TIFF*, tsample_t);
+typedef	int (*TIFFCodeMethod)(TIFF*, tidata_t, tsize_t, tsample_t);
+typedef	int (*TIFFSeekMethod)(TIFF*, uint32);
+typedef	void (*TIFFPostMethod)(TIFF*, tidata_t, tsize_t);
+typedef	uint32 (*TIFFStripMethod)(TIFF*, uint32);
+typedef	void (*TIFFTileMethod)(TIFF*, uint32*, uint32*);
+
+struct tiff {
+	char*		tif_name;	/* name of open file */
+	int		tif_fd;		/* open file descriptor */
+	int		tif_mode;	/* open mode (O_*) */
+	uint32		tif_flags;
+#define	TIFF_FILLORDER		0x0003	/* natural bit fill order for machine */
+#define	TIFF_DIRTYHEADER	0x0004	/* header must be written on close */
+#define	TIFF_DIRTYDIRECT	0x0008	/* current directory must be written */
+#define	TIFF_BUFFERSETUP	0x0010	/* data buffers setup */
+#define	TIFF_CODERSETUP		0x0020	/* encoder/decoder setup done */
+#define	TIFF_BEENWRITING	0x0040	/* written 1+ scanlines to file */
+#define	TIFF_SWAB		0x0080	/* byte swap file information */
+#define	TIFF_NOBITREV		0x0100	/* inhibit bit reversal logic */
+#define	TIFF_MYBUFFER		0x0200	/* my raw data buffer; free on close */
+#define	TIFF_ISTILED		0x0400	/* file is tile, not strip- based */
+#define	TIFF_MAPPED		0x0800	/* file is mapped into memory */
+#define	TIFF_POSTENCODE		0x1000	/* need call to postencode routine */
+#define	TIFF_INSUBIFD		0x2000	/* currently writing a subifd */
+#define	TIFF_UPSAMPLED		0x4000	/* library is doing data up-sampling */ 
+#define	TIFF_STRIPCHOP		0x8000	/* enable strip chopping support */
+#define	TIFF_HEADERONLY		0x10000	/* read header only, do not process */
+					/* the first directory */
+	toff_t		tif_diroff;	/* file offset of current directory */
+	toff_t		tif_nextdiroff;	/* file offset of following directory */
+	toff_t*		tif_dirlist;	/* list of offsets to already seen */
+					/* directories to prevent IFD looping */
+	uint16		tif_dirnumber;  /* number of already seen directories */
+	TIFFDirectory	tif_dir;	/* internal rep of current directory */
+	TIFFHeader	tif_header;	/* file's header block */
+	const int*	tif_typeshift;	/* data type shift counts */
+	const long*	tif_typemask;	/* data type masks */
+	uint32		tif_row;	/* current scanline */
+	tdir_t		tif_curdir;	/* current directory (index) */
+	tstrip_t	tif_curstrip;	/* current strip for read/write */
+	toff_t		tif_curoff;	/* current offset for read/write */
+	toff_t		tif_dataoff;	/* current offset for writing dir */
+/* SubIFD support */
+	uint16		tif_nsubifd;	/* remaining subifds to write */
+	toff_t		tif_subifdoff;	/* offset for patching SubIFD link */
+/* tiling support */
+	uint32 		tif_col;	/* current column (offset by row too) */
+	ttile_t		tif_curtile;	/* current tile for read/write */
+	tsize_t		tif_tilesize;	/* # of bytes in a tile */
+/* compression scheme hooks */
+	int		tif_decodestatus;
+	TIFFBoolMethod	tif_setupdecode;/* called once before predecode */
+	TIFFPreMethod	tif_predecode;	/* pre- row/strip/tile decoding */
+	TIFFBoolMethod	tif_setupencode;/* called once before preencode */
+	int		tif_encodestatus;
+	TIFFPreMethod	tif_preencode;	/* pre- row/strip/tile encoding */
+	TIFFBoolMethod	tif_postencode;	/* post- row/strip/tile encoding */
+	TIFFCodeMethod	tif_decoderow;	/* scanline decoding routine */
+	TIFFCodeMethod	tif_encoderow;	/* scanline encoding routine */
+	TIFFCodeMethod	tif_decodestrip;/* strip decoding routine */
+	TIFFCodeMethod	tif_encodestrip;/* strip encoding routine */
+	TIFFCodeMethod	tif_decodetile;	/* tile decoding routine */
+	TIFFCodeMethod	tif_encodetile;	/* tile encoding routine */
+	TIFFVoidMethod	tif_close;	/* cleanup-on-close routine */
+	TIFFSeekMethod	tif_seek;	/* position within a strip routine */
+	TIFFVoidMethod	tif_cleanup;	/* cleanup state routine */
+	TIFFStripMethod	tif_defstripsize;/* calculate/constrain strip size */
+	TIFFTileMethod	tif_deftilesize;/* calculate/constrain tile size */
+	tidata_t	tif_data;	/* compression scheme private data */
+/* input/output buffering */
+	tsize_t		tif_scanlinesize;/* # of bytes in a scanline */
+	tsize_t		tif_scanlineskew;/* scanline skew for reading strips */
+	tidata_t	tif_rawdata;	/* raw data buffer */
+	tsize_t		tif_rawdatasize;/* # of bytes in raw data buffer */
+	tidata_t	tif_rawcp;	/* current spot in raw buffer */
+	tsize_t		tif_rawcc;	/* bytes unread from raw buffer */
+/* memory-mapped file support */
+	tidata_t	tif_base;	/* base of mapped file */
+	toff_t		tif_size;	/* size of mapped file region (bytes) */
+	TIFFMapFileProc	tif_mapproc;	/* map file method */
+	TIFFUnmapFileProc tif_unmapproc;/* unmap file method */
+/* input/output callback methods */
+	thandle_t	tif_clientdata;	/* callback parameter */
+	TIFFReadWriteProc tif_readproc;	/* read method */
+	TIFFReadWriteProc tif_writeproc;/* write method */
+	TIFFSeekProc	tif_seekproc;	/* lseek method */
+	TIFFCloseProc	tif_closeproc;	/* close method */
+	TIFFSizeProc	tif_sizeproc;	/* filesize method */
+/* post-decoding support */
+	TIFFPostMethod	tif_postdecode;	/* post decoding routine */
+/* tag support */
+	TIFFFieldInfo**	tif_fieldinfo;	/* sorted table of registered tags */
+	size_t		tif_nfields;	/* # entries in registered tag table */
+	const TIFFFieldInfo *tif_foundfield;/* cached pointer to already found tag */
+        TIFFTagMethods  tif_tagmethods; /* tag get/set/print routines */
+        TIFFClientInfoLink *tif_clientinfo; /* extra client information. */
+};
+
+#define	isPseudoTag(t)	(t > 0xffff)	/* is tag value normal or pseudo */
+
+#define	isTiled(tif)	(((tif)->tif_flags & TIFF_ISTILED) != 0)
+#define	isMapped(tif)	(((tif)->tif_flags & TIFF_MAPPED) != 0)
+#define	isFillOrder(tif, o)	(((tif)->tif_flags & (o)) != 0)
+#define	isUpSampled(tif)	(((tif)->tif_flags & TIFF_UPSAMPLED) != 0)
+#define	TIFFReadFile(tif, buf, size) \
+	((*(tif)->tif_readproc)((tif)->tif_clientdata,buf,size))
+#define	TIFFWriteFile(tif, buf, size) \
+	((*(tif)->tif_writeproc)((tif)->tif_clientdata,buf,size))
+#define	TIFFSeekFile(tif, off, whence) \
+	((*(tif)->tif_seekproc)((tif)->tif_clientdata,(toff_t)(off),whence))
+#define	TIFFCloseFile(tif) \
+	((*(tif)->tif_closeproc)((tif)->tif_clientdata))
+#define	TIFFGetFileSize(tif) \
+	((*(tif)->tif_sizeproc)((tif)->tif_clientdata))
+#define	TIFFMapFileContents(tif, paddr, psize) \
+	((*(tif)->tif_mapproc)((tif)->tif_clientdata,paddr,psize))
+#define	TIFFUnmapFileContents(tif, addr, size) \
+	((*(tif)->tif_unmapproc)((tif)->tif_clientdata,addr,size))
+
+/*
+ * Default Read/Seek/Write definitions.
+ */
+#ifndef ReadOK
+#define	ReadOK(tif, buf, size) \
+	(TIFFReadFile(tif, (tdata_t) buf, (tsize_t)(size)) == (tsize_t)(size))
+#endif
+#ifndef SeekOK
+#define	SeekOK(tif, off) \
+	(TIFFSeekFile(tif, (toff_t) off, SEEK_SET) == (toff_t) off)
+#endif
+#ifndef WriteOK
+#define	WriteOK(tif, buf, size) \
+	(TIFFWriteFile(tif, (tdata_t) buf, (tsize_t) size) == (tsize_t) size)
+#endif
+
+/* NB: the uint32 casts are to silence certain ANSI-C compilers */
+#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
+#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
+#define	TIFFroundup(x, y) (TIFFhowmany(x,y)*(y))
+
+#define TIFFmax(A,B) ((A)>(B)?(A):(B))
+#define TIFFmin(A,B) ((A)<(B)?(A):(B))
+
+#define TIFFArrayCount(a) (sizeof (a) / sizeof ((a)[0]))
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+extern	int _TIFFgetMode(const char*, const char*);
+extern	int _TIFFNoRowEncode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern	int _TIFFNoStripEncode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern	int _TIFFNoTileEncode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern	int _TIFFNoRowDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern	int _TIFFNoStripDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern	int _TIFFNoTileDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern	void _TIFFNoPostDecode(TIFF*, tidata_t, tsize_t);
+extern  int  _TIFFNoPreCode (TIFF*, tsample_t); 
+extern	int _TIFFNoSeek(TIFF*, uint32);
+extern	void _TIFFSwab16BitData(TIFF*, tidata_t, tsize_t);
+extern	void _TIFFSwab24BitData(TIFF*, tidata_t, tsize_t);
+extern	void _TIFFSwab32BitData(TIFF*, tidata_t, tsize_t);
+extern	void _TIFFSwab64BitData(TIFF*, tidata_t, tsize_t);
+extern	int TIFFFlushData1(TIFF*);
+extern	int TIFFDefaultDirectory(TIFF*);
+extern	void _TIFFSetDefaultCompressionState(TIFF*);
+extern	int TIFFSetCompressionScheme(TIFF*, int);
+extern	int TIFFSetDefaultCompressionState(TIFF*);
+extern	uint32 _TIFFDefaultStripSize(TIFF*, uint32);
+extern	void _TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
+extern	int _TIFFDataSize(TIFFDataType);
+
+extern	void _TIFFsetByteArray(void**, void*, uint32);
+extern	void _TIFFsetString(char**, char*);
+extern	void _TIFFsetShortArray(uint16**, uint16*, uint32);
+extern	void _TIFFsetLongArray(uint32**, uint32*, uint32);
+extern	void _TIFFsetFloatArray(float**, float*, uint32);
+extern	void _TIFFsetDoubleArray(double**, double*, uint32);
+
+extern	void _TIFFprintAscii(FILE*, const char*);
+extern	void _TIFFprintAsciiTag(FILE*, const char*, const char*);
+
+extern	TIFFErrorHandler _TIFFwarningHandler;
+extern	TIFFErrorHandler _TIFFerrorHandler;
+extern	TIFFErrorHandlerExt _TIFFwarningHandlerExt;
+extern	TIFFErrorHandlerExt _TIFFerrorHandlerExt;
+
+extern	tdata_t _TIFFCheckMalloc(TIFF*, size_t, size_t, const char*);
+
+extern	int TIFFInitDumpMode(TIFF*, int);
+#ifdef PACKBITS_SUPPORT
+extern	int TIFFInitPackBits(TIFF*, int);
+#endif
+#ifdef CCITT_SUPPORT
+extern	int TIFFInitCCITTRLE(TIFF*, int), TIFFInitCCITTRLEW(TIFF*, int);
+extern	int TIFFInitCCITTFax3(TIFF*, int), TIFFInitCCITTFax4(TIFF*, int);
+#endif
+#ifdef THUNDER_SUPPORT
+extern	int TIFFInitThunderScan(TIFF*, int);
+#endif
+#ifdef NEXT_SUPPORT
+extern	int TIFFInitNeXT(TIFF*, int);
+#endif
+#ifdef LZW_SUPPORT
+extern	int TIFFInitLZW(TIFF*, int);
+#endif
+#ifdef OJPEG_SUPPORT
+extern	int TIFFInitOJPEG(TIFF*, int);
+#endif
+#ifdef JPEG_SUPPORT
+extern	int TIFFInitJPEG(TIFF*, int);
+#endif
+#ifdef JBIG_SUPPORT
+extern	int TIFFInitJBIG(TIFF*, int);
+#endif
+#ifdef ZIP_SUPPORT
+extern	int TIFFInitZIP(TIFF*, int);
+#endif
+#ifdef PIXARLOG_SUPPORT
+extern	int TIFFInitPixarLog(TIFF*, int);
+#endif
+#ifdef LOGLUV_SUPPORT
+extern	int TIFFInitSGILog(TIFF*, int);
+#endif
+#ifdef VMS
+extern	const TIFFCodec _TIFFBuiltinCODECS[];
+#else
+extern	TIFFCodec _TIFFBuiltinCODECS[];
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+#endif /* _TIFFIOP_ */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/src/tiff/tiffvers.h b/src/tiff/tiffvers.h
new file mode 100644
index 0000000..deb6d97
--- /dev/null
+++ b/src/tiff/tiffvers.h
@@ -0,0 +1,9 @@
+#define TIFFLIB_VERSION_STR "LIBTIFF, Version 3.8.2\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
+/*
+ * This define can be used in code that requires
+ * compilation-related definitions specific to a
+ * version or versions of the library.  Runtime
+ * version checking should be done based on the
+ * string returned by TIFFGetVersion.
+ */
+#define TIFFLIB_VERSION 20060323
diff --git a/src/tiff/uvcode.h b/src/tiff/uvcode.h
new file mode 100644
index 0000000..68f9f18
--- /dev/null
+++ b/src/tiff/uvcode.h
@@ -0,0 +1,173 @@
+/* Version 1.0 generated April 7, 1997 by Greg Ward Larson, SGI */
+#define UV_SQSIZ	(float)0.003500
+#define UV_NDIVS	16289
+#define UV_VSTART	(float)0.016940
+#define UV_NVS		163
+static struct {
+	float	ustart;
+	short	nus, ncum;
+}	uv_row[UV_NVS] = {
+	{ (float)0.247663,	4,	0 },
+	{ (float)0.243779,	6,	4 },
+	{ (float)0.241684,	7,	10 },
+	{ (float)0.237874,	9,	17 },
+	{ (float)0.235906,	10,	26 },
+	{ (float)0.232153,	12,	36 },
+	{ (float)0.228352,	14,	48 },
+	{ (float)0.226259,	15,	62 },
+	{ (float)0.222371,	17,	77 },
+	{ (float)0.220410,	18,	94 },
+	{ (float)0.214710,	21,	112 },
+	{ (float)0.212714,	22,	133 },
+	{ (float)0.210721,	23,	155 },
+	{ (float)0.204976,	26,	178 },
+	{ (float)0.202986,	27,	204 },
+	{ (float)0.199245,	29,	231 },
+	{ (float)0.195525,	31,	260 },
+	{ (float)0.193560,	32,	291 },
+	{ (float)0.189878,	34,	323 },
+	{ (float)0.186216,	36,	357 },
+	{ (float)0.186216,	36,	393 },
+	{ (float)0.182592,	38,	429 },
+	{ (float)0.179003,	40,	467 },
+	{ (float)0.175466,	42,	507 },
+	{ (float)0.172001,	44,	549 },
+	{ (float)0.172001,	44,	593 },
+	{ (float)0.168612,	46,	637 },
+	{ (float)0.168612,	46,	683 },
+	{ (float)0.163575,	49,	729 },
+	{ (float)0.158642,	52,	778 },
+	{ (float)0.158642,	52,	830 },
+	{ (float)0.158642,	52,	882 },
+	{ (float)0.153815,	55,	934 },
+	{ (float)0.153815,	55,	989 },
+	{ (float)0.149097,	58,	1044 },
+	{ (float)0.149097,	58,	1102 },
+	{ (float)0.142746,	62,	1160 },
+	{ (float)0.142746,	62,	1222 },
+	{ (float)0.142746,	62,	1284 },
+	{ (float)0.138270,	65,	1346 },
+	{ (float)0.138270,	65,	1411 },
+	{ (float)0.138270,	65,	1476 },
+	{ (float)0.132166,	69,	1541 },
+	{ (float)0.132166,	69,	1610 },
+	{ (float)0.126204,	73,	1679 },
+	{ (float)0.126204,	73,	1752 },
+	{ (float)0.126204,	73,	1825 },
+	{ (float)0.120381,	77,	1898 },
+	{ (float)0.120381,	77,	1975 },
+	{ (float)0.120381,	77,	2052 },
+	{ (float)0.120381,	77,	2129 },
+	{ (float)0.112962,	82,	2206 },
+	{ (float)0.112962,	82,	2288 },
+	{ (float)0.112962,	82,	2370 },
+	{ (float)0.107450,	86,	2452 },
+	{ (float)0.107450,	86,	2538 },
+	{ (float)0.107450,	86,	2624 },
+	{ (float)0.107450,	86,	2710 },
+	{ (float)0.100343,	91,	2796 },
+	{ (float)0.100343,	91,	2887 },
+	{ (float)0.100343,	91,	2978 },
+	{ (float)0.095126,	95,	3069 },
+	{ (float)0.095126,	95,	3164 },
+	{ (float)0.095126,	95,	3259 },
+	{ (float)0.095126,	95,	3354 },
+	{ (float)0.088276,	100,	3449 },
+	{ (float)0.088276,	100,	3549 },
+	{ (float)0.088276,	100,	3649 },
+	{ (float)0.088276,	100,	3749 },
+	{ (float)0.081523,	105,	3849 },
+	{ (float)0.081523,	105,	3954 },
+	{ (float)0.081523,	105,	4059 },
+	{ (float)0.081523,	105,	4164 },
+	{ (float)0.074861,	110,	4269 },
+	{ (float)0.074861,	110,	4379 },
+	{ (float)0.074861,	110,	4489 },
+	{ (float)0.074861,	110,	4599 },
+	{ (float)0.068290,	115,	4709 },
+	{ (float)0.068290,	115,	4824 },
+	{ (float)0.068290,	115,	4939 },
+	{ (float)0.068290,	115,	5054 },
+	{ (float)0.063573,	119,	5169 },
+	{ (float)0.063573,	119,	5288 },
+	{ (float)0.063573,	119,	5407 },
+	{ (float)0.063573,	119,	5526 },
+	{ (float)0.057219,	124,	5645 },
+	{ (float)0.057219,	124,	5769 },
+	{ (float)0.057219,	124,	5893 },
+	{ (float)0.057219,	124,	6017 },
+	{ (float)0.050985,	129,	6141 },
+	{ (float)0.050985,	129,	6270 },
+	{ (float)0.050985,	129,	6399 },
+	{ (float)0.050985,	129,	6528 },
+	{ (float)0.050985,	129,	6657 },
+	{ (float)0.044859,	134,	6786 },
+	{ (float)0.044859,	134,	6920 },
+	{ (float)0.044859,	134,	7054 },
+	{ (float)0.044859,	134,	7188 },
+	{ (float)0.040571,	138,	7322 },
+	{ (float)0.040571,	138,	7460 },
+	{ (float)0.040571,	138,	7598 },
+	{ (float)0.040571,	138,	7736 },
+	{ (float)0.036339,	142,	7874 },
+	{ (float)0.036339,	142,	8016 },
+	{ (float)0.036339,	142,	8158 },
+	{ (float)0.036339,	142,	8300 },
+	{ (float)0.032139,	146,	8442 },
+	{ (float)0.032139,	146,	8588 },
+	{ (float)0.032139,	146,	8734 },
+	{ (float)0.032139,	146,	8880 },
+	{ (float)0.027947,	150,	9026 },
+	{ (float)0.027947,	150,	9176 },
+	{ (float)0.027947,	150,	9326 },
+	{ (float)0.023739,	154,	9476 },
+	{ (float)0.023739,	154,	9630 },
+	{ (float)0.023739,	154,	9784 },
+	{ (float)0.023739,	154,	9938 },
+	{ (float)0.019504,	158,	10092 },
+	{ (float)0.019504,	158,	10250 },
+	{ (float)0.019504,	158,	10408 },
+	{ (float)0.016976,	161,	10566 },
+	{ (float)0.016976,	161,	10727 },
+	{ (float)0.016976,	161,	10888 },
+	{ (float)0.016976,	161,	11049 },
+	{ (float)0.012639,	165,	11210 },
+	{ (float)0.012639,	165,	11375 },
+	{ (float)0.012639,	165,	11540 },
+	{ (float)0.009991,	168,	11705 },
+	{ (float)0.009991,	168,	11873 },
+	{ (float)0.009991,	168,	12041 },
+	{ (float)0.009016,	170,	12209 },
+	{ (float)0.009016,	170,	12379 },
+	{ (float)0.009016,	170,	12549 },
+	{ (float)0.006217,	173,	12719 },
+	{ (float)0.006217,	173,	12892 },
+	{ (float)0.005097,	175,	13065 },
+	{ (float)0.005097,	175,	13240 },
+	{ (float)0.005097,	175,	13415 },
+	{ (float)0.003909,	177,	13590 },
+	{ (float)0.003909,	177,	13767 },
+	{ (float)0.002340,	177,	13944 },
+	{ (float)0.002389,	170,	14121 },
+	{ (float)0.001068,	164,	14291 },
+	{ (float)0.001653,	157,	14455 },
+	{ (float)0.000717,	150,	14612 },
+	{ (float)0.001614,	143,	14762 },
+	{ (float)0.000270,	136,	14905 },
+	{ (float)0.000484,	129,	15041 },
+	{ (float)0.001103,	123,	15170 },
+	{ (float)0.001242,	115,	15293 },
+	{ (float)0.001188,	109,	15408 },
+	{ (float)0.001011,	103,	15517 },
+	{ (float)0.000709,	97,	15620 },
+	{ (float)0.000301,	89,	15717 },
+	{ (float)0.002416,	82,	15806 },
+	{ (float)0.003251,	76,	15888 },
+	{ (float)0.003246,	69,	15964 },
+	{ (float)0.004141,	62,	16033 },
+	{ (float)0.005963,	55,	16095 },
+	{ (float)0.008839,	47,	16150 },
+	{ (float)0.010490,	40,	16197 },
+	{ (float)0.016994,	31,	16237 },
+	{ (float)0.023659,	21,	16268 },
+};
diff --git a/src/tiff/xtiff.c b/src/tiff/xtiff.c
new file mode 100644
index 0000000..b826175
--- /dev/null
+++ b/src/tiff/xtiff.c
@@ -0,0 +1,198 @@
+/*
+ * xtiff.c
+ *
+ * Extended TIFF Directory GEO Tag Support.
+ *
+ *  You may use this file as a template to add your own
+ *  extended tags to the library. Only the parts of the code
+ *  marked with "XXX" require modification.
+ *
+ *  Author: Niles D. Ritter
+ *
+ *  Revisions:
+ *    18 Sep 1995   -- Deprecated Integraph Matrix tag with new one.
+ *                     Backward compatible support provided.  --NDR.
+ */
+ 
+#include "xtiffio.h"
+#include <stdio.h>
+
+/*  Tiff info structure.
+ *
+ *     Entry format:
+ *        { TAGNUMBER, ReadCount, WriteCount, DataType, FIELDNUM, 
+ *          OkToChange, PassDirCountOnSet, AsciiName }
+ *
+ *     For ReadCount, WriteCount, -1 = unknown.
+ */
+
+static const TIFFFieldInfo xtiffFieldInfo[] = {
+  
+  /* XXX Insert Your tags here */
+    { TIFFTAG_GEOPIXELSCALE,	-1,-1, TIFF_DOUBLE,	FIELD_CUSTOM,
+      TRUE,	TRUE,	"GeoPixelScale" },
+    { TIFFTAG_INTERGRAPH_MATRIX,-1,-1, TIFF_DOUBLE,	FIELD_CUSTOM,
+      TRUE,	TRUE,	"Intergraph TransformationMatrix" },
+    { TIFFTAG_GEOTRANSMATRIX,	-1,-1, TIFF_DOUBLE,	FIELD_CUSTOM,
+      TRUE,	TRUE,	"GeoTransformationMatrix" },
+    { TIFFTAG_GEOTIEPOINTS,	-1,-1, TIFF_DOUBLE,	FIELD_CUSTOM,
+      TRUE,	TRUE,	"GeoTiePoints" },
+    { TIFFTAG_GEOKEYDIRECTORY,-1,-1, TIFF_SHORT,	FIELD_CUSTOM,
+      TRUE,	TRUE,	"GeoKeyDirectory" },
+    { TIFFTAG_GEODOUBLEPARAMS,	-1,-1, TIFF_DOUBLE,	FIELD_CUSTOM,
+      TRUE,	TRUE,	"GeoDoubleParams" },
+    { TIFFTAG_GEOASCIIPARAMS,	-1,-1, TIFF_ASCII,	FIELD_CUSTOM,
+      TRUE,	FALSE,	"GeoASCIIParams" },
+#ifdef JPL_TAG_SUPPORT
+    { TIFFTAG_JPL_CARTO_IFD,	 1, 1, TIFF_LONG,	FIELD_CUSTOM,
+      TRUE,	TRUE,	"JPL Carto IFD offset" },  /** Don't use this! **/
+#endif
+};
+
+#define	N(a)	(sizeof (a) / sizeof (a[0]))
+static void _XTIFFLocalDefaultDirectory(TIFF *tif)
+{
+    /* Install the extended Tag field info */
+    TIFFMergeFieldInfo(tif, xtiffFieldInfo, N(xtiffFieldInfo));
+}
+
+
+/**********************************************************************
+ *    Nothing below this line should need to be changed.
+ **********************************************************************/
+
+static TIFFExtendProc _ParentExtender;
+
+/*
+ *  This is the callback procedure, and is
+ *  called by the DefaultDirectory method
+ *  every time a new TIFF directory is opened.
+ */
+
+static void
+_XTIFFDefaultDirectory(TIFF *tif)
+{
+    /* set up our own defaults */
+    _XTIFFLocalDefaultDirectory(tif);
+
+    /* Since an XTIFF client module may have overridden
+     * the default directory method, we call it now to
+     * allow it to set up the rest of its own methods.
+     */
+
+    if (_ParentExtender) 
+        (*_ParentExtender)(tif);
+}
+
+/*
+ *  XTIFF Initializer -- sets up the callback
+ *   procedure for the TIFF module.
+ */
+
+static
+void _XTIFFInitialize(void)
+{
+    static int first_time=1;
+	
+    if (! first_time) return; /* Been there. Done that. */
+    first_time = 0;
+	
+    /* Grab the inherited method and install */
+    _ParentExtender = TIFFSetTagExtender(_XTIFFDefaultDirectory);
+}
+
+
+/**
+ * GeoTIFF compatible TIFF file open function.
+ *
+ * @param name The filename of a TIFF file to open.
+ * @param mode The open mode ("r", "w" or "a").
+ *
+ * @return a TIFF * for the file, or NULL if the open failed.
+ *
+This function is used to open GeoTIFF files instead of TIFFOpen() from
+libtiff.  Internally it calls TIFFOpen(), but sets up some extra hooks
+so that GeoTIFF tags can be extracted from the file.  If XTIFFOpen() isn't
+used, GTIFNew() won't work properly.  Files opened
+with XTIFFOpen() should be closed with XTIFFClose().
+
+The name of the file to be opened should be passed as <b>name</b>, and an
+opening mode ("r", "w" or "a") acceptable to TIFFOpen() should be passed as the
+<b>mode</b>.<p>
+
+If XTIFFOpen() fails it will return NULL.  Otherwise, normal TIFFOpen()
+error reporting steps will have already taken place.<p>
+ */
+
+TIFF*
+XTIFFOpen(const char* name, const char* mode)
+{
+    TIFF *tif;
+
+    /* Set up the callback */
+    _XTIFFInitialize();	
+	
+    /* Open the file; the callback will set everything up
+     */
+    tif = TIFFOpen(name, mode);
+    if (!tif) return tif;
+	
+    return tif;
+}
+
+TIFF*
+XTIFFFdOpen(int fd, const char* name, const char* mode)
+{
+    TIFF *tif;
+
+    /* Set up the callback */
+    _XTIFFInitialize();	
+
+    /* Open the file; the callback will set everything up
+     */
+    tif = TIFFFdOpen(fd, name, mode);
+    if (!tif) return tif;
+	
+    return tif;
+}
+
+TIFF*
+XTIFFClientOpen(const char* name, const char* mode, thandle_t thehandle,
+	    TIFFReadWriteProc RWProc, TIFFReadWriteProc RWProc2,
+	    TIFFSeekProc SProc, TIFFCloseProc CProc,
+	    TIFFSizeProc SzProc,
+	    TIFFMapFileProc MFProvc, TIFFUnmapFileProc UMFProc )
+{
+    TIFF *tif;
+    
+    /* Set up the callback */
+    _XTIFFInitialize();	
+    
+    /* Open the file; the callback will set everything up
+     */
+    tif = TIFFClientOpen(name, mode, thehandle,
+                         RWProc, RWProc2,
+                         SProc, CProc,
+                         SzProc,
+                         MFProvc, UMFProc);
+    
+    if (!tif) return tif;
+    
+    return tif;
+}
+
+/**
+ * Close a file opened with XTIFFOpen().
+ *
+ * @param tif The file handle returned by XTIFFOpen().
+ * 
+ * If a GTIF structure was created with GTIFNew()
+ * for this file, it should be freed with GTIFFree()
+ * <i>before</i> calling XTIFFClose().
+*/
+
+void
+XTIFFClose(TIFF *tif)
+{
+    TIFFClose(tif);
+}
diff --git a/src/tiff/xtiffio.h b/src/tiff/xtiffio.h
new file mode 100644
index 0000000..f088c84
--- /dev/null
+++ b/src/tiff/xtiffio.h
@@ -0,0 +1,72 @@
+/*
+ *  xtiffio.h -- Public interface to Extended GEO TIFF tags
+ *
+ *    written by: Niles D. Ritter
+ */
+
+#ifndef __xtiffio_h
+#define __xtiffio_h
+
+#include "cpl_serv.h"
+#include "tiffio.h"
+
+/**
+ * \file xtiffio.h
+ *
+ * Definitions relating GeoTIFF functions from geotiff.h to the TIFF
+ * library (usually libtiff).
+ */
+
+/* 
+ *  Define public Tag names and values here 
+ */
+
+/* tags 33550 is a private tag registered to SoftDesk, Inc */
+#define TIFFTAG_GEOPIXELSCALE       33550
+/* tags 33920-33921 are private tags registered to Intergraph, Inc */
+#define TIFFTAG_INTERGRAPH_MATRIX    33920   /* $use TIFFTAG_GEOTRANSMATRIX ! */
+#define TIFFTAG_GEOTIEPOINTS         33922
+/* tags 34263-34264 are private tags registered to NASA-JPL Carto Group */
+#ifdef JPL_TAG_SUPPORT
+#define TIFFTAG_JPL_CARTO_IFD        34263    /* $use GeoProjectionInfo ! */
+#endif
+#define TIFFTAG_GEOTRANSMATRIX       34264    /* New Matrix Tag replaces 33920 */
+/* tags 34735-3438 are private tags registered to SPOT Image, Inc */
+#define TIFFTAG_GEOKEYDIRECTORY      34735
+#define TIFFTAG_GEODOUBLEPARAMS      34736
+#define TIFFTAG_GEOASCIIPARAMS       34737
+
+/* 
+ *  Define Printing method flags. These
+ *  flags may be passed in to TIFFPrintDirectory() to
+ *  indicate that those particular field values should
+ *  be printed out in full, rather than just an indicator
+ *  of whether they are present or not.
+ */
+#define	TIFFPRINT_GEOKEYDIRECTORY	0x80000000
+#define	TIFFPRINT_GEOKEYPARAMS		0x40000000
+
+/**********************************************************************
+ *    Nothing below this line should need to be changed by the user.
+ **********************************************************************/
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+extern TIFF CPL_DLL * XTIFFOpen(const char* name, const char* mode);
+extern TIFF CPL_DLL * XTIFFFdOpen(int fd, const char* name, const char* mode);
+extern void CPL_DLL XTIFFClose(TIFF *tif);
+
+extern TIFF CPL_DLL * XTIFFClientOpen(const char* name, const char* mode, 
+                                      thandle_t thehandle,
+                                      TIFFReadWriteProc, TIFFReadWriteProc,
+                                      TIFFSeekProc, TIFFCloseProc,
+                                      TIFFSizeProc,
+                                      TIFFMapFileProc, TIFFUnmapFileProc);
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* __xtiffio_h */
+
diff --git a/src/tiff/xtiffiop.h b/src/tiff/xtiffiop.h
new file mode 100644
index 0000000..1408bf5
--- /dev/null
+++ b/src/tiff/xtiffiop.h
@@ -0,0 +1,90 @@
+/*
+ * Private Extended TIFF library interface.
+ *
+ *  uses private LIBTIFF interface.
+ *
+ *  written by: Niles D. Ritter
+ *
+ *  Revisions:
+ *    18 Sep 1995   -- Deprecated Integraph Matrix tag with new one.
+ *                     Backward compatible support provided.  --NDR.
+ *
+ */
+
+#ifndef __xtiffiop_h
+#define __xtiffiop_h
+
+#include "tiffiop.h"
+#include "xtiffio.h"
+
+/**********************************************************************
+ *               User Configuration
+ **********************************************************************/
+
+/* Define number of extended tags here */
+#define NUM_XFIELD 8
+#define XFIELD_BASE (FIELD_LAST-NUM_XFIELD)
+
+/*  Define Fields here  */
+#define	FIELD_GEOPIXELSCALE     (XFIELD_BASE+0)
+#define	FIELD_INTERGRAPH_MATRIX (XFIELD_BASE+1)
+#define	FIELD_GEOTRANSMATRIX    (XFIELD_BASE+2)
+#define	FIELD_GEOTIEPOINTS      (XFIELD_BASE+3)
+#define	FIELD_GEOASCIIPARAMS    (XFIELD_BASE+4)
+#define	FIELD_GEOKEYDIRECTORY   (XFIELD_BASE+5)
+#define	FIELD_GEODOUBLEPARAMS   (XFIELD_BASE+6)
+#ifdef JPL_TAG_SUPPORT
+#define	FIELD_JPL_CARTO_IFD     (XFIELD_BASE+7)   /* unsupported */
+#endif
+
+/* Used for GEO tags having variable counts */
+typedef enum {
+	GEO_NUM_DIR=0,
+	GEO_NUM_DOUBLE,
+	GEO_NUM_TIEPOINT,
+	GEO_NUM_PIXELSCALE,
+	GEO_NUM_MATRIX,
+	GEO_NUM_IG_MATRIX,
+	GEO_NUM_TAGS
+} geo_count_t;
+
+/* Define Private directory structure here */
+struct XTIFFDirectory {
+	uint16	 xd_geodimensions[GEO_NUM_TAGS]; /* dir-count for the geo tags */
+	uint16*  xd_geokeydirectory;
+	double*  xd_geodoubleparams;
+	char*    xd_geoasciiparams;
+	double*  xd_geotiepoints;
+	double*  xd_geopixelscale;
+	double*  xd_geomatrix;
+	double*  xd_intergraph_matrix;
+#ifdef JPL_TAG_SUPPORT
+	uint32   xd_jpl_ifd_offset; /* dont use */
+#endif
+};
+typedef struct XTIFFDirectory XTIFFDirectory;
+
+/**********************************************************************
+ *    Nothing below this line should need to be changed by the user.
+ **********************************************************************/
+
+struct xtiff {
+	TIFF 		*xtif_tif;	/* parent TIFF pointer */
+	uint32		xtif_flags;
+#define       XTIFFP_PRINT   0x00000001
+	XTIFFDirectory	xtif_dir;	/* internal rep of current directory */
+	TIFFVSetMethod	xtif_vsetfield;	/* inherited tag set routine */
+	TIFFVGetMethod	xtif_vgetfield;	/* inherited tag get routine */
+	TIFFPrintMethod	xtif_printdir;  /* inherited dir print method */
+};
+typedef struct xtiff xtiff;
+
+
+#define PARENT(xt,pmember) ((xt)->xtif_ ## pmember) 
+#define TIFFMEMBER(tf,pmember) ((tf)->tif_ ## pmember) 
+#define XTIFFDIR(tif) ((xtiff *)TIFFMEMBER(tif,clientdir))
+	
+/* Extended TIFF flags */
+#define XTIFF_INITIALIZED 0x80000000
+	
+#endif /* __xtiffiop_h */
diff --git a/src/zlib/zconf.h b/src/zlib/zconf.h
new file mode 100644
index 0000000..dfe938f
--- /dev/null
+++ b/src/zlib/zconf.h
@@ -0,0 +1,332 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zconf.h 4826 2006-08-16 13:11:54Z lubia $ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ */
+#ifdef Z_PREFIX
+#  define deflateInit_          z_deflateInit_
+#  define deflate               z_deflate
+#  define deflateEnd            z_deflateEnd
+#  define inflateInit_          z_inflateInit_
+#  define inflate               z_inflate
+#  define inflateEnd            z_inflateEnd
+#  define deflateInit2_         z_deflateInit2_
+#  define deflateSetDictionary  z_deflateSetDictionary
+#  define deflateCopy           z_deflateCopy
+#  define deflateReset          z_deflateReset
+#  define deflateParams         z_deflateParams
+#  define deflateBound          z_deflateBound
+#  define deflatePrime          z_deflatePrime
+#  define inflateInit2_         z_inflateInit2_
+#  define inflateSetDictionary  z_inflateSetDictionary
+#  define inflateSync           z_inflateSync
+#  define inflateSyncPoint      z_inflateSyncPoint
+#  define inflateCopy           z_inflateCopy
+#  define inflateReset          z_inflateReset
+#  define inflateBack           z_inflateBack
+#  define inflateBackEnd        z_inflateBackEnd
+#  define compress              z_compress
+#  define compress2             z_compress2
+#  define compressBound         z_compressBound
+#  define uncompress            z_uncompress
+#  define adler32               z_adler32
+#  define crc32                 z_crc32
+#  define get_crc_table         z_get_crc_table
+#  define zError                z_zError
+
+#  define alloc_func            z_alloc_func
+#  define free_func             z_free_func
+#  define in_func               z_in_func
+#  define out_func              z_out_func
+#  define Byte                  z_Byte
+#  define uInt                  z_uInt
+#  define uLong                 z_uLong
+#  define Bytef                 z_Bytef
+#  define charf                 z_charf
+#  define intf                  z_intf
+#  define uIntf                 z_uIntf
+#  define uLongf                z_uLongf
+#  define voidpf                z_voidpf
+#  define voidp                 z_voidp
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+#  define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+#  define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+#  define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+#  ifndef WIN32
+#    define WIN32
+#  endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+#    ifndef SYS16BIT
+#      define SYS16BIT
+#    endif
+#  endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+#  define MAXSEG_64K
+#endif
+#ifdef MSDOS
+#  define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+#  ifndef STDC
+#    define STDC
+#  endif
+#  if __STDC_VERSION__ >= 199901L
+#    ifndef STDC99
+#      define STDC99
+#    endif
+#  endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+#  define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
+#  define STDC
+#endif
+
+#ifndef STDC
+#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+#    define const       /* note: need a more gentle solution here */
+#  endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+#  define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+#  ifdef MAXSEG_64K
+#    define MAX_MEM_LEVEL 8
+#  else
+#    define MAX_MEM_LEVEL 9
+#  endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+#  define MAX_WBITS   15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+            (1 << (windowBits+2)) +  (1 << (memLevel+9))
+ that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+   The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+                        /* Type declarations */
+
+#ifndef OF /* function prototypes */
+#  ifdef STDC
+#    define OF(args)  args
+#  else
+#    define OF(args)  ()
+#  endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+#  if defined(M_I86SM) || defined(M_I86MM)
+     /* MSC small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef _MSC_VER
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#  if (defined(__SMALL__) || defined(__MEDIUM__))
+     /* Turbo C small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef __BORLANDC__
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+   /* If building or using zlib as a DLL, define ZLIB_DLL.
+    * This is not mandatory, but it offers a little performance increase.
+    */
+#  ifdef ZLIB_DLL
+#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+#      ifdef ZLIB_INTERNAL
+#        define ZEXTERN extern __declspec(dllexport)
+#      else
+#        define ZEXTERN extern __declspec(dllimport)
+#      endif
+#    endif
+#  endif  /* ZLIB_DLL */
+   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+    * define ZLIB_WINAPI.
+    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+    */
+#  ifdef ZLIB_WINAPI
+#    ifdef FAR
+#      undef FAR
+#    endif
+#    include <windows.h>
+     /* No need for _export, use ZLIB.DEF instead. */
+     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+#    define ZEXPORT WINAPI
+#    ifdef WIN32
+#      define ZEXPORTVA WINAPIV
+#    else
+#      define ZEXPORTVA FAR CDECL
+#    endif
+#  endif
+#endif
+
+#if defined (__BEOS__)
+#  ifdef ZLIB_DLL
+#    ifdef ZLIB_INTERNAL
+#      define ZEXPORT   __declspec(dllexport)
+#      define ZEXPORTVA __declspec(dllexport)
+#    else
+#      define ZEXPORT   __declspec(dllimport)
+#      define ZEXPORTVA __declspec(dllimport)
+#    endif
+#  endif
+#endif
+
+#ifndef ZEXTERN
+#  define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+#  define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+#  define ZEXPORTVA
+#endif
+
+#ifndef FAR
+#  define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char  Byte;  /* 8 bits */
+#endif
+typedef unsigned int   uInt;  /* 16 bits or more */
+typedef unsigned long  uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+#  define Bytef Byte FAR
+#else
+   typedef Byte  FAR Bytef;
+#endif
+typedef char  FAR charf;
+typedef int   FAR intf;
+typedef uInt  FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+   typedef void const *voidpc;
+   typedef void FAR   *voidpf;
+   typedef void       *voidp;
+#else
+   typedef Byte const *voidpc;
+   typedef Byte FAR   *voidpf;
+   typedef Byte       *voidp;
+#endif
+
+#if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
+#  include <sys/types.h> /* for off_t */
+#  include <unistd.h>    /* for SEEK_* and off_t */
+#  ifdef VMS
+#    include <unixio.h>   /* for off_t */
+#  endif
+#  define z_off_t off_t
+#endif
+#ifndef SEEK_SET
+#  define SEEK_SET        0       /* Seek from beginning of file.  */
+#  define SEEK_CUR        1       /* Seek from current position.  */
+#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+#  define z_off_t long
+#endif
+
+#if defined(__OS400__)
+#  define NO_vsnprintf
+#endif
+
+#if defined(__MVS__)
+#  define NO_vsnprintf
+#  ifdef FAR
+#    undef FAR
+#  endif
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+#   pragma map(deflateInit_,"DEIN")
+#   pragma map(deflateInit2_,"DEIN2")
+#   pragma map(deflateEnd,"DEEND")
+#   pragma map(deflateBound,"DEBND")
+#   pragma map(inflateInit_,"ININ")
+#   pragma map(inflateInit2_,"ININ2")
+#   pragma map(inflateEnd,"INEND")
+#   pragma map(inflateSync,"INSY")
+#   pragma map(inflateSetDictionary,"INSEDI")
+#   pragma map(compressBound,"CMBND")
+#   pragma map(inflate_table,"INTABL")
+#   pragma map(inflate_fast,"INFA")
+#   pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/src/zlib/zlib.h b/src/zlib/zlib.h
new file mode 100644
index 0000000..62d0e46
--- /dev/null
+++ b/src/zlib/zlib.h
@@ -0,0 +1,1357 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.3, July 18th, 2005
+
+  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup at gzip.org          madler at alumni.caltech.edu
+
+
+  The data format used by the zlib library is described by RFCs (Request for
+  Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
+  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.3"
+#define ZLIB_VERNUM 0x1230
+
+/*
+     The 'zlib' compression library provides in-memory compression and
+  decompression functions, including integrity checks of the uncompressed
+  data.  This version of the library supports only one compression method
+  (deflation) but other algorithms will be added later and will have the same
+  stream interface.
+
+     Compression can be done in a single step if the buffers are large
+  enough (for example if an input file is mmap'ed), or can be done by
+  repeated calls of the compression function.  In the latter case, the
+  application must provide more input and/or consume the output
+  (providing more output space) before each call.
+
+     The compressed data format used by default by the in-memory functions is
+  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+  around a deflate stream, which is itself documented in RFC 1951.
+
+     The library also supports reading and writing files in gzip (.gz) format
+  with an interface similar to that of stdio using the functions that start
+  with "gz".  The gzip format is different from the zlib format.  gzip is a
+  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+     This library can optionally read and write gzip streams in memory as well.
+
+     The zlib format was designed to be compact and fast for use in memory
+  and on communications channels.  The gzip format was designed for single-
+  file compression on file systems, has a larger header than zlib to maintain
+  directory information, and uses a different, slower check method than zlib.
+
+     The library does not install any signal handler. The decoder checks
+  the consistency of the compressed data, so the library should never
+  crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+    Bytef    *next_in;  /* next input byte */
+    uInt     avail_in;  /* number of bytes available at next_in */
+    uLong    total_in;  /* total nb of input bytes read so far */
+
+    Bytef    *next_out; /* next output byte should be put there */
+    uInt     avail_out; /* remaining free space at next_out */
+    uLong    total_out; /* total nb of bytes output so far */
+
+    char     *msg;      /* last error message, NULL if no error */
+    struct internal_state FAR *state; /* not visible by applications */
+
+    alloc_func zalloc;  /* used to allocate the internal state */
+    free_func  zfree;   /* used to free the internal state */
+    voidpf     opaque;  /* private data object passed to zalloc and zfree */
+
+    int     data_type;  /* best guess about the data type: binary or text */
+    uLong   adler;      /* adler32 value of the uncompressed data */
+    uLong   reserved;   /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+     gzip header information passed to and from zlib routines.  See RFC 1952
+  for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+    int     text;       /* true if compressed data believed to be text */
+    uLong   time;       /* modification time */
+    int     xflags;     /* extra flags (not used when writing a gzip file) */
+    int     os;         /* operating system */
+    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
+    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
+    uInt    extra_max;  /* space at extra (only when reading header) */
+    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
+    uInt    name_max;   /* space at name (only when reading header) */
+    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
+    uInt    comm_max;   /* space at comment (only when reading header) */
+    int     hcrc;       /* true if there was or will be a header crc */
+    int     done;       /* true when done reading gzip header (not used
+                           when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+   The application must update next_in and avail_in when avail_in has
+   dropped to zero. It must update next_out and avail_out when avail_out
+   has dropped to zero. The application must initialize zalloc, zfree and
+   opaque before calling the init function. All other fields are set by the
+   compression library and must not be updated by the application.
+
+   The opaque value provided by the application will be passed as the first
+   parameter for calls of zalloc and zfree. This can be useful for custom
+   memory management. The compression library attaches no meaning to the
+   opaque value.
+
+   zalloc must return Z_NULL if there is not enough memory for the object.
+   If zlib is used in a multi-threaded application, zalloc and zfree must be
+   thread safe.
+
+   On 16-bit systems, the functions zalloc and zfree must be able to allocate
+   exactly 65536 bytes, but will not be required to allocate more than this
+   if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+   pointers returned by zalloc for objects of exactly 65536 bytes *must*
+   have their offset normalized to zero. The default allocation function
+   provided by this library ensures this (see zutil.c). To reduce memory
+   requirements and avoid any allocation of 64K objects, at the expense of
+   compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+   The fields total_in and total_out can be used for statistics or
+   progress reports. After compression, total_in holds the total size of
+   the uncompressed data and may be saved for use in the decompressor
+   (particularly if the decompressor wants to decompress everything in
+   a single step).
+*/
+
+                        /* constants */
+
+#define Z_NO_FLUSH      0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH    2
+#define Z_FULL_FLUSH    3
+#define Z_FINISH        4
+#define Z_BLOCK         5
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK            0
+#define Z_STREAM_END    1
+#define Z_NEED_DICT     2
+#define Z_ERRNO        (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR   (-3)
+#define Z_MEM_ERROR    (-4)
+#define Z_BUF_ERROR    (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION         0
+#define Z_BEST_SPEED             1
+#define Z_BEST_COMPRESSION       9
+#define Z_DEFAULT_COMPRESSION  (-1)
+/* compression levels */
+
+#define Z_FILTERED            1
+#define Z_HUFFMAN_ONLY        2
+#define Z_RLE                 3
+#define Z_FIXED               4
+#define Z_DEFAULT_STRATEGY    0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY   0
+#define Z_TEXT     1
+#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN  2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED   8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+                        /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+   If the first character differs, the library code actually used is
+   not compatible with the zlib.h header file used by the application.
+   This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+     Initializes the internal stream state for compression. The fields
+   zalloc, zfree and opaque must be initialized before by the caller.
+   If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+   use default allocation functions.
+
+     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+   1 gives best speed, 9 gives best compression, 0 gives no compression at
+   all (the input data is simply copied a block at a time).
+   Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+   compression (currently equivalent to level 6).
+
+     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+   with the version assumed by the caller (ZLIB_VERSION).
+   msg is set to null if there is no error message.  deflateInit does not
+   perform any compression: this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+    deflate compresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full. It may introduce some
+  output latency (reading input without producing any output) except when
+  forced to flush.
+
+    The detailed semantics are as follows. deflate performs one or both of the
+  following actions:
+
+  - Compress more input starting at next_in and update next_in and avail_in
+    accordingly. If not all input can be processed (because there is not
+    enough room in the output buffer), next_in and avail_in are updated and
+    processing will resume at this point for the next call of deflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly. This action is forced if the parameter flush is non zero.
+    Forcing flush frequently degrades the compression ratio, so this parameter
+    should be set only when necessary (in interactive applications).
+    Some output may be provided even if flush is not set.
+
+  Before the call of deflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming
+  more output, and updating avail_in or avail_out accordingly; avail_out
+  should never be zero before the call. The application can consume the
+  compressed output when it wants, for example when the output buffer is full
+  (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+  and with zero avail_out, it must be called again after making room in the
+  output buffer because there might be more output pending.
+
+    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+  decide how much data to accumualte before producing output, in order to
+  maximize compression.
+
+    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+  flushed to the output buffer and the output is aligned on a byte boundary, so
+  that the decompressor can get all input data available so far. (In particular
+  avail_in is zero after the call if enough output space has been provided
+  before the call.)  Flushing may degrade compression for some compression
+  algorithms and so it should be used only when necessary.
+
+    If flush is set to Z_FULL_FLUSH, all output is flushed as with
+  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+  restart from this point if previous compressed data has been damaged or if
+  random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+  compression.
+
+    If deflate returns with avail_out == 0, this function must be called again
+  with the same value of the flush parameter and more output space (updated
+  avail_out), until the flush is complete (deflate returns with non-zero
+  avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+  avail_out is greater than six to avoid repeated flush markers due to
+  avail_out == 0 on return.
+
+    If the parameter flush is set to Z_FINISH, pending input is processed,
+  pending output is flushed and deflate returns with Z_STREAM_END if there
+  was enough output space; if deflate returns with Z_OK, this function must be
+  called again with Z_FINISH and more output space (updated avail_out) but no
+  more input data, until it returns with Z_STREAM_END or an error. After
+  deflate has returned Z_STREAM_END, the only possible operations on the
+  stream are deflateReset or deflateEnd.
+
+    Z_FINISH can be used immediately after deflateInit if all the compression
+  is to be done in a single step. In this case, avail_out must be at least
+  the value returned by deflateBound (see below). If deflate does not return
+  Z_STREAM_END, then it must be called again as described above.
+
+    deflate() sets strm->adler to the adler32 checksum of all input read
+  so far (that is, total_in bytes).
+
+    deflate() may update strm->data_type if it can make a good guess about
+  the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
+  binary. This field is only for information purposes and does not affect
+  the compression algorithm in any manner.
+
+    deflate() returns Z_OK if some progress has been made (more input
+  processed or more output produced), Z_STREAM_END if all input has been
+  consumed and all output has been produced (only when flush is set to
+  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+  if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+  (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
+  fatal, and deflate() can be called again with more input and more output
+  space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any
+   pending output.
+
+     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+   prematurely (some input or output was discarded). In the error case,
+   msg may be set but then points to a static string (which must not be
+   deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+     Initializes the internal stream state for decompression. The fields
+   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+   the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+   value depends on the compression method), inflateInit determines the
+   compression method from the zlib header and allocates all data structures
+   accordingly; otherwise the allocation will be deferred to the first call of
+   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+   use default allocation functions.
+
+     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller.  msg is set to null if there is no error
+   message. inflateInit does not perform any decompression apart from reading
+   the zlib header if present: this will be done by inflate().  (So next_in and
+   avail_in may be modified, but next_out and avail_out are unchanged.)
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+    inflate decompresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full. It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+  The detailed semantics are as follows. inflate performs one or both of the
+  following actions:
+
+  - Decompress more input starting at next_in and update next_in and avail_in
+    accordingly. If not all input can be processed (because there is not
+    enough room in the output buffer), next_in is updated and processing
+    will resume at this point for the next call of inflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  inflate() provides as much output as possible, until there
+    is no more input data or no more space in the output buffer (see below
+    about the flush parameter).
+
+  Before the call of inflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming
+  more output, and updating the next_* and avail_* values accordingly.
+  The application can consume the uncompressed output when it wants, for
+  example when the output buffer is full (avail_out == 0), or after each
+  call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+  must be called again after making room in the output buffer because there
+  might be more output pending.
+
+    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
+  Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
+  output as possible to the output buffer. Z_BLOCK requests that inflate() stop
+  if and when it gets to the next deflate block boundary. When decoding the
+  zlib or gzip format, this will cause inflate() to return immediately after
+  the header and before the first block. When doing a raw inflate, inflate()
+  will go ahead and process the first block, and will return when it gets to
+  the end of that block, or when it runs out of data.
+
+    The Z_BLOCK option assists in appending to or combining deflate streams.
+  Also to assist in this, on return inflate() will set strm->data_type to the
+  number of unused bits in the last byte taken from strm->next_in, plus 64
+  if inflate() is currently decoding the last block in the deflate stream,
+  plus 128 if inflate() returned immediately after decoding an end-of-block
+  code or decoding the complete header up to just before the first byte of the
+  deflate stream. The end-of-block will not be indicated until all of the
+  uncompressed data from that block has been written to strm->next_out.  The
+  number of unused bits may in general be greater than seven, except when
+  bit 7 of data_type is set, in which case the number of unused bits will be
+  less than eight.
+
+    inflate() should normally be called until it returns Z_STREAM_END or an
+  error. However if all decompression is to be performed in a single step
+  (a single call of inflate), the parameter flush should be set to
+  Z_FINISH. In this case all pending input is processed and all pending
+  output is flushed; avail_out must be large enough to hold all the
+  uncompressed data. (The size of the uncompressed data may have been saved
+  by the compressor for this purpose.) The next operation on this stream must
+  be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+  is never required, but can be used to inform inflate that a faster approach
+  may be used for the single inflate() call.
+
+     In this implementation, inflate() always flushes as much output as
+  possible to the output buffer, and always uses the faster approach on the
+  first call. So the only effect of the flush parameter in this implementation
+  is on the return value of inflate(), as noted below, or when it returns early
+  because Z_BLOCK is used.
+
+     If a preset dictionary is needed after this call (see inflateSetDictionary
+  below), inflate sets strm->adler to the adler32 checksum of the dictionary
+  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+  strm->adler to the adler32 checksum of all output produced so far (that is,
+  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+  below. At the end of the stream, inflate() checks that its computed adler32
+  checksum is equal to that saved by the compressor and returns Z_STREAM_END
+  only if the checksum is correct.
+
+    inflate() will decompress and check either zlib-wrapped or gzip-wrapped
+  deflate data.  The header type is detected automatically.  Any information
+  contained in the gzip header is not retained, so applications that need that
+  information should instead use raw inflate, see inflateInit2() below, or
+  inflateBack() and perform their own processing of the gzip header and
+  trailer.
+
+    inflate() returns Z_OK if some progress has been made (more input processed
+  or more output produced), Z_STREAM_END if the end of the compressed data has
+  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+  corrupted (input stream not conforming to the zlib format or incorrect check
+  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+  if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
+  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+  output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
+  inflate() can be called again with more input and more output space to
+  continue decompressing. If Z_DATA_ERROR is returned, the application may then
+  call inflateSync() to look for a good compression block if a partial recovery
+  of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any
+   pending output.
+
+     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+   was inconsistent. In the error case, msg may be set but then points to a
+   static string (which must not be deallocated).
+*/
+
+                        /* Advanced functions */
+
+/*
+    The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+                                     int  level,
+                                     int  method,
+                                     int  windowBits,
+                                     int  memLevel,
+                                     int  strategy));
+
+     This is another version of deflateInit with more compression options. The
+   fields next_in, zalloc, zfree and opaque must be initialized before by
+   the caller.
+
+     The method parameter is the compression method. It must be Z_DEFLATED in
+   this version of the library.
+
+     The windowBits parameter is the base two logarithm of the window size
+   (the size of the history buffer). It should be in the range 8..15 for this
+   version of the library. Larger values of this parameter result in better
+   compression at the expense of memory usage. The default value is 15 if
+   deflateInit is used instead.
+
+     windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
+   determines the window size. deflate() will then generate raw deflate data
+   with no zlib header or trailer, and will not compute an adler32 check value.
+
+     windowBits can also be greater than 15 for optional gzip encoding. Add
+   16 to windowBits to write a simple gzip header and trailer around the
+   compressed data instead of a zlib wrapper. The gzip header will have no
+   file name, no extra data, no comment, no modification time (set to zero),
+   no header crc, and the operating system will be set to 255 (unknown).  If a
+   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+     The memLevel parameter specifies how much memory should be allocated
+   for the internal compression state. memLevel=1 uses minimum memory but
+   is slow and reduces compression ratio; memLevel=9 uses maximum memory
+   for optimal speed. The default value is 8. See zconf.h for total memory
+   usage as a function of windowBits and memLevel.
+
+     The strategy parameter is used to tune the compression algorithm. Use the
+   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+   string match), or Z_RLE to limit match distances to one (run-length
+   encoding). Filtered data consists mostly of small values with a somewhat
+   random distribution. In this case, the compression algorithm is tuned to
+   compress them better. The effect of Z_FILTERED is to force more Huffman
+   coding and less string matching; it is somewhat intermediate between
+   Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
+   Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
+   parameter only affects the compression ratio but not the correctness of the
+   compressed output even if it is not set appropriately.  Z_FIXED prevents the
+   use of dynamic Huffman codes, allowing for a simpler decoder for special
+   applications.
+
+      deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+   method). msg is set to null if there is no error message.  deflateInit2 does
+   not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the compression dictionary from the given byte sequence
+   without producing any compressed output. This function must be called
+   immediately after deflateInit, deflateInit2 or deflateReset, before any
+   call of deflate. The compressor and decompressor must use exactly the same
+   dictionary (see inflateSetDictionary).
+
+     The dictionary should consist of strings (byte sequences) that are likely
+   to be encountered later in the data to be compressed, with the most commonly
+   used strings preferably put towards the end of the dictionary. Using a
+   dictionary is most useful when the data to be compressed is short and can be
+   predicted with good accuracy; the data can then be compressed better than
+   with the default empty dictionary.
+
+     Depending on the size of the compression data structures selected by
+   deflateInit or deflateInit2, a part of the dictionary may in effect be
+   discarded, for example if the dictionary is larger than the window size in
+   deflate or deflate2. Thus the strings most likely to be useful should be
+   put at the end of the dictionary, not at the front. In addition, the
+   current implementation of deflate will use at most the window size minus
+   262 bytes of the provided dictionary.
+
+     Upon return of this function, strm->adler is set to the adler32 value
+   of the dictionary; the decompressor may later use this value to determine
+   which dictionary has been used by the compressor. (The adler32 value
+   applies to the whole dictionary even if only a subset of the dictionary is
+   actually used by the compressor.) If a raw deflate was requested, then the
+   adler32 value is not computed and strm->adler is not set.
+
+     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+   parameter is invalid (such as NULL dictionary) or the stream state is
+   inconsistent (for example if deflate has already been called for this stream
+   or if the compression method is bsort). deflateSetDictionary does not
+   perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when several compression strategies will be
+   tried, for example when there are several ways of pre-processing the input
+   data with a filter. The streams that will be discarded should then be freed
+   by calling deflateEnd.  Note that deflateCopy duplicates the internal
+   compression state which can be quite large, so this strategy is slow and
+   can consume lots of memory.
+
+     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being NULL). msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to deflateEnd followed by deflateInit,
+   but does not free and reallocate all the internal compression state.
+   The stream will keep the same compression level and any other attributes
+   that may have been set by deflateInit2.
+
+      deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+                                      int level,
+                                      int strategy));
+/*
+     Dynamically update the compression level and compression strategy.  The
+   interpretation of level and strategy is as in deflateInit2.  This can be
+   used to switch between compression and straight copy of the input data, or
+   to switch to a different kind of input data requiring a different
+   strategy. If the compression level is changed, the input available so far
+   is compressed with the old level (and may be flushed); the new level will
+   take effect only at the next call of deflate().
+
+     Before the call of deflateParams, the stream state must be set as for
+   a call of deflate(), since the currently available input may have to
+   be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+   if strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+                                    int good_length,
+                                    int max_lazy,
+                                    int nice_length,
+                                    int max_chain));
+/*
+     Fine tune deflate's internal compression parameters.  This should only be
+   used by someone who understands the algorithm used by zlib's deflate for
+   searching for the best matching string, and even then only by the most
+   fanatic optimizer trying to squeeze out the last compressed bit for their
+   specific input data.  Read the deflate.c source code for the meaning of the
+   max_lazy, good_length, nice_length, and max_chain parameters.
+
+     deflateTune() can be called after deflateInit() or deflateInit2(), and
+   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+                                       uLong sourceLen));
+/*
+     deflateBound() returns an upper bound on the compressed size after
+   deflation of sourceLen bytes.  It must be called after deflateInit()
+   or deflateInit2().  This would be used to allocate an output buffer
+   for deflation in a single pass, and so would be called before deflate().
+*/
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     deflatePrime() inserts bits in the deflate output stream.  The intent
+  is that this function is used to start off the deflate output with the
+  bits leftover from a previous deflate stream when appending to it.  As such,
+  this function can only be used for raw deflate, and must be used before the
+  first deflate() call after a deflateInit2() or deflateReset().  bits must be
+  less than or equal to 16, and that many of the least significant bits of
+  value will be inserted in the output.
+
+      deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+      deflateSetHeader() provides gzip header information for when a gzip
+   stream is requested by deflateInit2().  deflateSetHeader() may be called
+   after deflateInit2() or deflateReset() and before the first call of
+   deflate().  The text, time, os, extra field, name, and comment information
+   in the provided gz_header structure are written to the gzip header (xflag is
+   ignored -- the extra flags are set according to the compression level).  The
+   caller must assure that, if not Z_NULL, name and comment are terminated with
+   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+   available there.  If hcrc is true, a gzip header crc is included.  Note that
+   the current versions of the command-line version of gzip (up through version
+   1.3.x) do not support header crc's, and will report that it is a "multi-part
+   gzip file" and give up.
+
+      If deflateSetHeader is not used, the default gzip header has text false,
+   the time set to zero, and os set to 255, with no extra, name, or comment
+   fields.  The gzip header is returned to the default state by deflateReset().
+
+      deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+                                     int  windowBits));
+
+     This is another version of inflateInit with an extra parameter. The
+   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+   before by the caller.
+
+     The windowBits parameter is the base two logarithm of the maximum window
+   size (the size of the history buffer).  It should be in the range 8..15 for
+   this version of the library. The default value is 15 if inflateInit is used
+   instead. windowBits must be greater than or equal to the windowBits value
+   provided to deflateInit2() while compressing, or it must be equal to 15 if
+   deflateInit2() was not used. If a compressed stream with a larger window
+   size is given as input, inflate() will return with the error code
+   Z_DATA_ERROR instead of trying to allocate a larger window.
+
+     windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
+   determines the window size. inflate() will then process raw deflate data,
+   not looking for a zlib or gzip header, not generating a check value, and not
+   looking for any check values for comparison at the end of the stream. This
+   is for use with other formats that use the deflate compressed data format
+   such as zip.  Those formats provide their own check values. If a custom
+   format is developed using the raw deflate format for compressed data, it is
+   recommended that a check value such as an adler32 or a crc32 be applied to
+   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
+   most applications, the zlib format should be used as is. Note that comments
+   above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+     windowBits can also be greater than 15 for optional gzip decoding. Add
+   32 to windowBits to enable zlib and gzip decoding with automatic header
+   detection, or add 16 to decode only the gzip format (the zlib format will
+   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is
+   a crc32 instead of an adler32.
+
+     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
+   is set to null if there is no error message.  inflateInit2 does not perform
+   any decompression apart from reading the zlib header if present: this will
+   be done by inflate(). (So next_in and avail_in may be modified, but next_out
+   and avail_out are unchanged.)
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the decompression dictionary from the given uncompressed byte
+   sequence. This function must be called immediately after a call of inflate,
+   if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
+   can be determined from the adler32 value returned by that call of inflate.
+   The compressor and decompressor must use exactly the same dictionary (see
+   deflateSetDictionary).  For raw inflate, this function can be called
+   immediately after inflateInit2() or inflateReset() and before any call of
+   inflate() to set the dictionary.  The application must insure that the
+   dictionary that was used for compression is provided.
+
+     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+   parameter is invalid (such as NULL dictionary) or the stream state is
+   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+   expected one (incorrect adler32 value). inflateSetDictionary does not
+   perform any decompression: this will be done by subsequent calls of
+   inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+    Skips invalid compressed data until a full flush point (see above the
+  description of deflate with Z_FULL_FLUSH) can be found, or until all
+  available input is skipped. No output is provided.
+
+    inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+  if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+  or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+  case, the application may save the current current value of total_in which
+  indicates where valid compressed data was found. In the error case, the
+  application may repeatedly call inflateSync, providing more input each time,
+  until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when randomly accessing a large stream.  The
+   first pass through the stream can periodically record the inflate state,
+   allowing restarting inflate at those points when randomly accessing the
+   stream.
+
+     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being NULL). msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to inflateEnd followed by inflateInit,
+   but does not free and reallocate all the internal decompression state.
+   The stream will keep attributes that may have been set by inflateInit2.
+
+      inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     This function inserts bits in the inflate input stream.  The intent is
+  that this function is used to start inflating at a bit position in the
+  middle of a byte.  The provided bits will be used before any bytes are used
+  from next_in.  This function should only be used with raw inflate, and
+  should be used before the first inflate() call after inflateInit2() or
+  inflateReset().  bits must be less than or equal to 16, and that many of the
+  least significant bits of value will be inserted in the input.
+
+      inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+      inflateGetHeader() requests that gzip header information be stored in the
+   provided gz_header structure.  inflateGetHeader() may be called after
+   inflateInit2() or inflateReset(), and before the first call of inflate().
+   As inflate() processes the gzip stream, head->done is zero until the header
+   is completed, at which time head->done is set to one.  If a zlib stream is
+   being decoded, then head->done is set to -1 to indicate that there will be
+   no gzip header information forthcoming.  Note that Z_BLOCK can be used to
+   force inflate() to return immediately after header processing is complete
+   and before any actual data is decompressed.
+
+      The text, time, xflags, and os fields are filled in with the gzip header
+   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
+   was valid if done is set to one.)  If extra is not Z_NULL, then extra_max
+   contains the maximum number of bytes to write to extra.  Once done is true,
+   extra_len contains the actual extra field length, and extra contains the
+   extra field, or that field truncated if extra_max is less than extra_len.
+   If name is not Z_NULL, then up to name_max characters are written there,
+   terminated with a zero unless the length is greater than name_max.  If
+   comment is not Z_NULL, then up to comm_max characters are written there,
+   terminated with a zero unless the length is greater than comm_max.  When
+   any of extra, name, or comment are not Z_NULL and the respective field is
+   not present in the header, then that field is set to Z_NULL to signal its
+   absence.  This allows the use of deflateSetHeader() with the returned
+   structure to duplicate the header.  However if those fields are set to
+   allocated memory, then the application will need to save those pointers
+   elsewhere so that they can be eventually freed.
+
+      If inflateGetHeader is not used, then the header information is simply
+   discarded.  The header is always checked for validity, including the header
+   CRC if present.  inflateReset() will reset the process to discard the header
+   information.  The application would need to call inflateGetHeader() again to
+   retrieve the header from the next gzip stream.
+
+      inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+                                        unsigned char FAR *window));
+
+     Initialize the internal stream state for decompression using inflateBack()
+   calls.  The fields zalloc, zfree and opaque in strm must be initialized
+   before the call.  If zalloc and zfree are Z_NULL, then the default library-
+   derived memory allocation routines are used.  windowBits is the base two
+   logarithm of the window size, in the range 8..15.  window is a caller
+   supplied buffer of that size.  Except for special applications where it is
+   assured that deflate was used with small window sizes, windowBits must be 15
+   and a 32K byte window must be supplied to be able to decompress general
+   deflate streams.
+
+     See inflateBack() for the usage of these routines.
+
+     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+   the paramaters are invalid, Z_MEM_ERROR if the internal state could not
+   be allocated, or Z_VERSION_ERROR if the version of the library does not
+   match the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+                                    in_func in, void FAR *in_desc,
+                                    out_func out, void FAR *out_desc));
+/*
+     inflateBack() does a raw inflate with a single call using a call-back
+   interface for input and output.  This is more efficient than inflate() for
+   file i/o applications in that it avoids copying between the output and the
+   sliding window by simply making the window itself the output buffer.  This
+   function trusts the application to not change the output buffer passed by
+   the output function, at least until inflateBack() returns.
+
+     inflateBackInit() must be called first to allocate the internal state
+   and to initialize the state with the user-provided window buffer.
+   inflateBack() may then be used multiple times to inflate a complete, raw
+   deflate stream with each call.  inflateBackEnd() is then called to free
+   the allocated state.
+
+     A raw deflate stream is one with no zlib or gzip header or trailer.
+   This routine would normally be used in a utility that reads zip or gzip
+   files and writes out uncompressed files.  The utility would decode the
+   header and process the trailer on its own, hence this routine expects
+   only the raw deflate stream to decompress.  This is different from the
+   normal behavior of inflate(), which expects either a zlib or gzip header and
+   trailer around the deflate stream.
+
+     inflateBack() uses two subroutines supplied by the caller that are then
+   called by inflateBack() for input and output.  inflateBack() calls those
+   routines until it reads a complete deflate stream and writes out all of the
+   uncompressed data, or until it encounters an error.  The function's
+   parameters and return types are defined above in the in_func and out_func
+   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
+   number of bytes of provided input, and a pointer to that input in buf.  If
+   there is no input available, in() must return zero--buf is ignored in that
+   case--and inflateBack() will return a buffer error.  inflateBack() will call
+   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
+   should return zero on success, or non-zero on failure.  If out() returns
+   non-zero, inflateBack() will return with an error.  Neither in() nor out()
+   are permitted to change the contents of the window provided to
+   inflateBackInit(), which is also the buffer that out() uses to write from.
+   The length written by out() will be at most the window size.  Any non-zero
+   amount of input may be provided by in().
+
+     For convenience, inflateBack() can be provided input on the first call by
+   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
+   in() will be called.  Therefore strm->next_in must be initialized before
+   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
+   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
+   must also be initialized, and then if strm->avail_in is not zero, input will
+   initially be taken from strm->next_in[0 .. strm->avail_in - 1].
+
+     The in_desc and out_desc parameters of inflateBack() is passed as the
+   first parameter of in() and out() respectively when they are called.  These
+   descriptors can be optionally used to pass any information that the caller-
+   supplied in() and out() functions need to do their job.
+
+     On return, inflateBack() will set strm->next_in and strm->avail_in to
+   pass back any unused input that was provided by the last in() call.  The
+   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+   if in() or out() returned an error, Z_DATA_ERROR if there was a format
+   error in the deflate stream (in which case strm->msg is set to indicate the
+   nature of the error), or Z_STREAM_ERROR if the stream was not properly
+   initialized.  In the case of Z_BUF_ERROR, an input or output error can be
+   distinguished using strm->next_in which will be Z_NULL only if in() returned
+   an error.  If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
+   out() returning non-zero.  (in() will always be called before out(), so
+   strm->next_in is assured to be defined if out() returns non-zero.)  Note
+   that inflateBack() cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+     All memory allocated by inflateBackInit() is freed.
+
+     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+   state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+     1.0: size of uInt
+     3.2: size of uLong
+     5.4: size of voidpf (pointer)
+     7.6: size of z_off_t
+
+    Compiler, assembler, and debug options:
+     8: DEBUG
+     9: ASMV or ASMINF -- use ASM code
+     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+     11: 0 (reserved)
+
+    One-time table building (smaller code, but not thread-safe if true):
+     12: BUILDFIXED -- build static block decoding tables when needed
+     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+     14,15: 0 (reserved)
+
+    Library content (indicates missing functionality):
+     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+                          deflate code when not needed)
+     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+                    and decode gzip streams (to avoid linking crc code)
+     18-19: 0 (reserved)
+
+    Operation variations (changes in library functionality):
+     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+     21: FASTEST -- deflate algorithm with only one, lowest compression level
+     22,23: 0 (reserved)
+
+    The sprintf variant used by gzprintf (zero is best):
+     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+    Remainder:
+     27-31: 0 (reserved)
+ */
+
+
+                        /* utility functions */
+
+/*
+     The following utility functions are implemented on top of the
+   basic stream-oriented functions. To simplify the interface, some
+   default options are assumed (compression level and memory usage,
+   standard memory allocation functions). The source code of these
+   utility functions can easily be modified if you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
+                                 const Bytef *source, uLong sourceLen));
+/*
+     Compresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer. Upon entry, destLen is the total
+   size of the destination buffer, which must be at least the value returned
+   by compressBound(sourceLen). Upon exit, destLen is the actual size of the
+   compressed buffer.
+     This function can be used to compress a whole file at once if the
+   input file is mmap'ed.
+     compress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
+                                  const Bytef *source, uLong sourceLen,
+                                  int level));
+/*
+     Compresses the source buffer into the destination buffer. The level
+   parameter has the same meaning as in deflateInit.  sourceLen is the byte
+   length of the source buffer. Upon entry, destLen is the total size of the
+   destination buffer, which must be at least the value returned by
+   compressBound(sourceLen). Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+   Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+     compressBound() returns an upper bound on the compressed size after
+   compress() or compress2() on sourceLen bytes.  It would be used before
+   a compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
+                                   const Bytef *source, uLong sourceLen));
+/*
+     Decompresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer. Upon entry, destLen is the total
+   size of the destination buffer, which must be large enough to hold the
+   entire uncompressed data. (The size of the uncompressed data must have
+   been saved previously by the compressor and transmitted to the decompressor
+   by some mechanism outside the scope of this compression library.)
+   Upon exit, destLen is the actual size of the compressed buffer.
+     This function can be used to decompress a whole file at once if the
+   input file is mmap'ed.
+
+     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
+*/
+
+
+typedef voidp gzFile;
+
+ZEXTERN gzFile ZEXPORT gzopen  OF((const char *path, const char *mode));
+/*
+     Opens a gzip (.gz) file for reading or writing. The mode parameter
+   is as in fopen ("rb" or "wb") but can also include a compression level
+   ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+   Huffman only compression as in "wb1h", or 'R' for run-length encoding
+   as in "wb1R". (See the description of deflateInit2 for more information
+   about the strategy parameter.)
+
+     gzopen can be used to read a file which is not in gzip format; in this
+   case gzread will directly read from the file without decompression.
+
+     gzopen returns NULL if the file could not be opened or if there was
+   insufficient memory to allocate the (de)compression state; errno
+   can be checked to distinguish the two cases (if errno is zero, the
+   zlib error is Z_MEM_ERROR).  */
+
+ZEXTERN gzFile ZEXPORT gzdopen  OF((int fd, const char *mode));
+/*
+     gzdopen() associates a gzFile with the file descriptor fd.  File
+   descriptors are obtained from calls like open, dup, creat, pipe or
+   fileno (in the file has been previously opened with fopen).
+   The mode parameter is as in gzopen.
+     The next call of gzclose on the returned gzFile will also close the
+   file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
+   descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
+     gzdopen returns NULL if there was insufficient memory to allocate
+   the (de)compression state.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+     Dynamically update the compression level or strategy. See the description
+   of deflateInit2 for the meaning of these parameters.
+     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+   opened for writing.
+*/
+
+ZEXTERN int ZEXPORT    gzread  OF((gzFile file, voidp buf, unsigned len));
+/*
+     Reads the given number of uncompressed bytes from the compressed file.
+   If the input file was not in gzip format, gzread copies the given number
+   of bytes into the buffer.
+     gzread returns the number of uncompressed bytes actually read (0 for
+   end of file, -1 for error). */
+
+ZEXTERN int ZEXPORT    gzwrite OF((gzFile file,
+                                   voidpc buf, unsigned len));
+/*
+     Writes the given number of uncompressed bytes into the compressed file.
+   gzwrite returns the number of uncompressed bytes actually written
+   (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORTVA   gzprintf OF((gzFile file, const char *format, ...));
+/*
+     Converts, formats, and writes the args to the compressed file under
+   control of the format string, as in fprintf. gzprintf returns the number of
+   uncompressed bytes actually written (0 in case of error).  The number of
+   uncompressed bytes written is limited to 4095. The caller should assure that
+   this limit is not exceeded. If it is exceeded, then gzprintf() will return
+   return an error (0) with nothing written. In this case, there may also be a
+   buffer overflow with unpredictable consequences, which is possible only if
+   zlib was compiled with the insecure functions sprintf() or vsprintf()
+   because the secure snprintf() or vsnprintf() functions were not available.
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+      Writes the given null-terminated string to the compressed file, excluding
+   the terminating null character.
+      gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+      Reads bytes from the compressed file until len-1 characters are read, or
+   a newline character is read and transferred to buf, or an end-of-file
+   condition is encountered.  The string is then terminated with a null
+   character.
+      gzgets returns buf, or Z_NULL in case of error.
+*/
+
+ZEXTERN int ZEXPORT    gzputc OF((gzFile file, int c));
+/*
+      Writes c, converted to an unsigned char, into the compressed file.
+   gzputc returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT    gzgetc OF((gzFile file));
+/*
+      Reads one byte from the compressed file. gzgetc returns this byte
+   or -1 in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT    gzungetc OF((int c, gzFile file));
+/*
+      Push one character back onto the stream to be read again later.
+   Only one character of push-back is allowed.  gzungetc() returns the
+   character pushed, or -1 on failure.  gzungetc() will fail if a
+   character has been pushed but not read yet, or if c is -1. The pushed
+   character will be discarded if the stream is repositioned with gzseek()
+   or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT    gzflush OF((gzFile file, int flush));
+/*
+     Flushes all pending output into the compressed file. The parameter
+   flush is as in the deflate() function. The return value is the zlib
+   error number (see function gzerror below). gzflush returns Z_OK if
+   the flush parameter is Z_FINISH and all output could be flushed.
+     gzflush should be called only when strictly necessary because it can
+   degrade compression.
+*/
+
+ZEXTERN z_off_t ZEXPORT    gzseek OF((gzFile file,
+                                      z_off_t offset, int whence));
+/*
+      Sets the starting position for the next gzread or gzwrite on the
+   given compressed file. The offset represents a number of bytes in the
+   uncompressed data stream. The whence parameter is defined as in lseek(2);
+   the value SEEK_END is not supported.
+     If the file is opened for reading, this function is emulated but can be
+   extremely slow. If the file is opened for writing, only forward seeks are
+   supported; gzseek then compresses a sequence of zeroes up to the new
+   starting position.
+
+      gzseek returns the resulting offset location as measured in bytes from
+   the beginning of the uncompressed stream, or -1 in case of error, in
+   particular if the file is opened for writing and the new starting position
+   would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
+/*
+     Rewinds the given file. This function is supported only for reading.
+
+   gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
+/*
+     Returns the starting position for the next gzread or gzwrite on the
+   given compressed file. This position represents a number of bytes in the
+   uncompressed data stream.
+
+   gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+     Returns 1 when EOF has previously been detected reading the given
+   input stream, otherwise zero.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+     Returns 1 if file is being read directly without decompression, otherwise
+   zero.
+*/
+
+ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
+/*
+     Flushes all pending output if necessary, closes the compressed file
+   and deallocates all the (de)compression state. The return value is the zlib
+   error number (see function gzerror below).
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+     Returns the error message for the last error which occurred on the
+   given compressed file. errnum is set to zlib error number. If an
+   error occurred in the file system and not in the compression library,
+   errnum is set to Z_ERRNO and the application may consult errno
+   to get the exact error code.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+     Clears the error and end-of-file flags for file. This is analogous to the
+   clearerr() function in stdio. This is useful for continuing to read a gzip
+   file that is being written concurrently.
+*/
+
+                        /* checksum functions */
+
+/*
+     These functions are not related to compression but are exported
+   anyway because they might be useful in applications using the
+   compression library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+   return the updated checksum. If buf is NULL, this function returns
+   the required initial value for the checksum.
+   An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+   much faster. Usage example:
+
+     uLong adler = adler32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       adler = adler32(adler, buffer, length);
+     }
+     if (adler != original_adler) error();
+*/
+
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+                                          z_off_t len2));
+/*
+     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
+   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
+   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
+*/
+
+ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
+/*
+     Update a running CRC-32 with the bytes buf[0..len-1] and return the
+   updated CRC-32. If buf is NULL, this function returns the required initial
+   value for the for the crc. Pre- and post-conditioning (one's complement) is
+   performed within this function so it shouldn't be done by the application.
+   Usage example:
+
+     uLong crc = crc32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       crc = crc32(crc, buffer, length);
+     }
+     if (crc != original_crc) error();
+*/
+
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+/*
+     Combine two CRC-32 check values into one.  For two sequences of bytes,
+   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
+   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+   len2.
+*/
+
+
+                        /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
+                                      int windowBits, int memLevel,
+                                      int strategy, const char *version,
+                                      int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
+                                      const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+                                         unsigned char FAR *window,
+                                         const char *version,
+                                         int stream_size));
+#define deflateInit(strm, level) \
+        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+                      (strategy),           ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+        inflateBackInit_((strm), (windowBits), (window), \
+        ZLIB_VERSION, sizeof(z_stream))
+
+
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+    struct internal_state {int dummy;}; /* hack for buggy compilers */
+#endif
+
+ZEXTERN const char   * ZEXPORT zError           OF((int));
+ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
diff --git a/terralibx/image_processing/Makefile b/terralibx/image_processing/Makefile
deleted file mode 100755
index 12869e4..0000000
--- a/terralibx/image_processing/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-all: terralibpdi
-
-terralibpdi:
-	qmake -o makepdi terralibpdi.pro; make -f makepdi
-
-debug:
-	qmake -o makepdi.debug terralibpdi.pro TE_PROJECT_TYPE=DEBUG; make -f makepdi.debug
-
-clean:
-	if \
-	 test -f makepdi; \
-	then \
-		make -f makepdi distclean; rm -f makepdi; \
-	fi
-
-clean_debug:
-	if \
-	 test -f makepdi.debug; \
-	then \
-		make -f makepdi.debug distclean; rm -f makepdi.debug; \
-	fi
diff --git a/terralibx/image_processing/terralibpdi.pro b/terralibx/image_processing/terralibpdi.pro
deleted file mode 100755
index cc6e7f9..0000000
--- a/terralibx/image_processing/terralibpdi.pro
+++ /dev/null
@@ -1,264 +0,0 @@
-TEMPLATE = lib
-CONFIG = warn_on rtti exceptions dll
-TARGET  = terralibpdi
-
-TERRALIB_SRC_DIR = ../../src/
-LIBPDI_SRC_DIR = $$TERRALIB_SRC_DIR/terralib/image_processing/
-DEFINES += PDI_AS_DLL
-
-isEmpty(TE_PROJECT_TYPE) {
-  TE_PROJECT_TYPE=RELEASE
-}
-
-contains(TE_PROJECT_TYPE , DEBUG) {
-  CONFIG += debug
-}
-
-contains(TE_PROJECT_TYPE , RELEASE) {
-  CONFIG += release
-}
-
-unix {
-  release {
-    DEFINES += NDEBUG
-    OBJECTS_DIR = ../Release/.obj/libpdi
-    DESTDIR = ../Release
-    LIBS += -L../Release
-  }
-
-  debug {
-    DEFINES += _DEBUG
-    OBJECTS_DIR = ../Debug/.obj/libpdi
-    DESTDIR = ../Debug
-    LIBS += -L../Debug
-  }
-
-  LIBS += -lz -ljpeg -lterralibtiff -lpthread
-}
-
-INCLUDEPATH = \
-  $$TERRALIB_SRC_DIR/terralib/kernel \
-  $$TERRALIB_SRC_DIR/terralib/functions \
-  $$TERRALIB_SRC_DIR/tiff \
-  $$LIBPDI_SRC_DIR \
-  $$LIBPDI_SRC_DIR/data_structs
-
-HEADERS = \
-          $$LIBPDI_SRC_DIR/TePDIMatrix.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMatrixFunctions.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMathFunctions.hpp \
-          $$LIBPDI_SRC_DIR/TePDIUtils.hpp \
-          $$LIBPDI_SRC_DIR/TePDITypes.hpp \
-          $$LIBPDI_SRC_DIR/TePDIPIManager.hpp \
-          $$LIBPDI_SRC_DIR/TePDIHistogram.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRgbPaletteNode.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRgbPalette.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRgbPaletteFunctions.hpp \
-          $$LIBPDI_SRC_DIR/TePDIParameters.hpp \
-          $$LIBPDI_SRC_DIR/TePDIAlgorithm.hpp \
-          $$LIBPDI_SRC_DIR/TePDIAlgorithmFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIStatistic.hpp \
-          $$LIBPDI_SRC_DIR/TePDILevelRemap.hpp \
-          $$LIBPDI_SRC_DIR/TePDIContrast.hpp \
-          $$LIBPDI_SRC_DIR/TePDIContrastFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIFilterMask.hpp \
-          $$LIBPDI_SRC_DIR/TePDIBufferedFilter.hpp \
-          $$LIBPDI_SRC_DIR/TePDILinearFilter.hpp \
-          $$LIBPDI_SRC_DIR/TePDILinearFilterFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIBDFilter.hpp \
-          $$LIBPDI_SRC_DIR/TePDIBDFilterFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMorfFilter.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMorfFilterFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarFilter.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarLeeFilter.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarLeeFilterFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarKuanFilter.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarKuanFilterFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarFrostFilter.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarFrostFilterFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIArithmetic.hpp \
-          $$LIBPDI_SRC_DIR/TePDIArithmeticFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRaster2Vector.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRaster2VectorFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIColorTransform.hpp \
-          $$LIBPDI_SRC_DIR/TePDIColorTransformFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIPrincipalComponents.hpp \
-          $$LIBPDI_SRC_DIR/TePDIPrincipalComponentsFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMallatWavelets.hpp \
-          $$LIBPDI_SRC_DIR/TePDIFusion.hpp \
-          $$LIBPDI_SRC_DIR/TePDIFusionFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIGeoMosaic.hpp \
-          $$LIBPDI_SRC_DIR/TePDIGeoMosaicFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIBatchGeoMosaic.hpp \
-          $$LIBPDI_SRC_DIR/TePDIBatchGeoMosaicFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIStrategy.hpp \
-          $$LIBPDI_SRC_DIR/TePDIStrategyFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIBlendingStrategy.hpp \
-          $$LIBPDI_SRC_DIR/TePDIBlendStratFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIEuclidianBlendStrategy.hpp \
-          $$LIBPDI_SRC_DIR/TePDIEuclidianBlendSF.hpp \
-          $$LIBPDI_SRC_DIR/TePDINoBlendStrategy.hpp \
-          $$LIBPDI_SRC_DIR/TePDINoBlendSF.hpp \
-          $$LIBPDI_SRC_DIR/TePDIGarguetFusionSF.hpp \
-          $$LIBPDI_SRC_DIR/TePDIGarguetFusionStrategy.hpp \
-          $$LIBPDI_SRC_DIR/TePDIVenturaFusionSF.hpp \
-          $$LIBPDI_SRC_DIR/TePDIVenturaFusionStrategy.hpp \
-          $$LIBPDI_SRC_DIR/TePDIIHSFusionSF.hpp \
-          $$LIBPDI_SRC_DIR/TePDIIHSFusionStrategy.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRegGrowSeg.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRegGrowSegFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRegister.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRegisterFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIInterpolator.hpp \
-          $$LIBPDI_SRC_DIR/TePDIBlendingFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIBlending.hpp \
-          $$LIBPDI_SRC_DIR/TePDIEspecData.hpp \
-          $$LIBPDI_SRC_DIR/TePDIRegion.hpp \
-          $$LIBPDI_SRC_DIR/TePDICluster.hpp \
-          $$LIBPDI_SRC_DIR/TePDIIsosegClas.hpp \
-          $$LIBPDI_SRC_DIR/TePDIIsosegClasFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIHaralick.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelComponent.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelComponentList.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModel.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelSpectralBand.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelSpectralBandList.hpp \
-          $$LIBPDI_SRC_DIR/TePDIPrincoMixModelSF.hpp \
-          $$LIBPDI_SRC_DIR/TePDIPrincoMixModelStrategy.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelStrategy.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelStratFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIKMeansClas.hpp \
-          $$LIBPDI_SRC_DIR/TePDIKMeansClasFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDIEMClas.hpp \
-          $$LIBPDI_SRC_DIR/TePDIEMClasFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDISensorSimulatorFactory.hpp \
-          $$LIBPDI_SRC_DIR/TePDISensorSimulator.hpp \
-          $$LIBPDI_SRC_DIR/TePDIPIManagerGlobalSettings.hpp \
-          $$LIBPDI_SRC_DIR/TePDIOFMatching.hpp \
-          $$LIBPDI_SRC_DIR/TePDIPrincipalComponentsFusion.hpp \
-          $$LIBPDI_SRC_DIR/TePDIDecorrelationEnhancement.hpp \
-          $$LIBPDI_SRC_DIR/TePDICorrelationMatching.hpp \
-          $$LIBPDI_SRC_DIR/TePDIBaatz.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMIMatching.hpp \
-          $$LIBPDI_SRC_DIR/TePDIJointHistogram.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMtxDoubleAdpt.hpp \
-          $$LIBPDI_SRC_DIR/TePDIMMIOMatching.hpp
-
-SOURCES = \
-          $$LIBPDI_SRC_DIR/TePDIMathFunctions.cpp \
-          $$LIBPDI_SRC_DIR/TePDIUtils.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMatrixFunctions.cpp \
-          $$LIBPDI_SRC_DIR/TePDIPIManager.cpp \
-          $$LIBPDI_SRC_DIR/TePDIHistogram.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRgbPalette.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRgbPaletteFunctions.cpp \
-          $$LIBPDI_SRC_DIR/TePDIParameters.cpp \
-          $$LIBPDI_SRC_DIR/TePDIAlgorithm.cpp \
-          $$LIBPDI_SRC_DIR/TePDIAlgorithmFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIStatistic.cpp \
-          $$LIBPDI_SRC_DIR/TePDILevelRemap.cpp \
-          $$LIBPDI_SRC_DIR/TePDIContrast.cpp \
-          $$LIBPDI_SRC_DIR/TePDIContrastFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIFilterMask.cpp \
-          $$LIBPDI_SRC_DIR/TePDIBufferedFilter.cpp \
-          $$LIBPDI_SRC_DIR/TePDILinearFilter.cpp \
-          $$LIBPDI_SRC_DIR/TePDILinearFilterFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIBDFilter.cpp \
-          $$LIBPDI_SRC_DIR/TePDIBDFilterFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMorfFilter.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMorfFilterFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarFilter.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarLeeFilter.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarLeeFilterFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarKuanFilter.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarKuanFilterFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarFrostFilter.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRadarFrostFilterFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIArithmetic.cpp \
-          $$LIBPDI_SRC_DIR/TePDIArithmeticFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRaster2Vector.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRaster2VectorFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIColorTransform.cpp \
-          $$LIBPDI_SRC_DIR/TePDIColorTransformFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIPrincipalComponents.cpp \
-          $$LIBPDI_SRC_DIR/TePDIPrincipalComponentsFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMallatWavelets.cpp \
-          $$LIBPDI_SRC_DIR/TePDIFusion.cpp \
-          $$LIBPDI_SRC_DIR/TePDIFusionFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIGeoMosaic.cpp \
-          $$LIBPDI_SRC_DIR/TePDIGeoMosaicFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIBatchGeoMosaic.cpp \
-          $$LIBPDI_SRC_DIR/TePDIBatchGeoMosaicFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIStrategy.cpp \
-          $$LIBPDI_SRC_DIR/TePDIStrategyFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIBlendingStrategy.cpp \
-          $$LIBPDI_SRC_DIR/TePDIBlendStratFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIEuclidianBlendStrategy.cpp \
-          $$LIBPDI_SRC_DIR/TePDIEuclidianBlendSF.cpp \
-          $$LIBPDI_SRC_DIR/TePDINoBlendStrategy.cpp \
-          $$LIBPDI_SRC_DIR/TePDINoBlendSF.cpp \
-          $$LIBPDI_SRC_DIR/TePDIGarguetFusionSF.cpp \
-          $$LIBPDI_SRC_DIR/TePDIGarguetFusionStrategy.cpp \
-          $$LIBPDI_SRC_DIR/TePDIVenturaFusionSF.cpp \
-          $$LIBPDI_SRC_DIR/TePDIVenturaFusionStrategy.cpp \
-          $$LIBPDI_SRC_DIR/TePDIIHSFusionSF.cpp \
-          $$LIBPDI_SRC_DIR/TePDIIHSFusionStrategy.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRegGrowSeg.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRegGrowSegFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRegister.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRegisterFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIInterpolator.cpp \
-          $$LIBPDI_SRC_DIR/TePDIBlending.cpp \
-          $$LIBPDI_SRC_DIR/TePDIBlendingFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIEspecData.cpp \
-          $$LIBPDI_SRC_DIR/TePDIRegion.cpp \
-          $$LIBPDI_SRC_DIR/TePDICluster.cpp \
-          $$LIBPDI_SRC_DIR/TePDIIsosegClas.cpp \
-          $$LIBPDI_SRC_DIR/TePDIIsosegClasFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIHaralick.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelComponent.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelComponentList.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModel.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelSpectralBand.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelSpectralBandList.cpp \
-          $$LIBPDI_SRC_DIR/TePDIPrincoMixModelSF.cpp \
-          $$LIBPDI_SRC_DIR/TePDIPrincoMixModelStrategy.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelStrategy.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMixModelStratFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIKMeansClas.cpp \
-          $$LIBPDI_SRC_DIR/TePDIKMeansClasFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDIEMClas.cpp \
-          $$LIBPDI_SRC_DIR/TePDIEMClasFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDISensorSimulatorFactory.cpp \
-          $$LIBPDI_SRC_DIR/TePDISensorSimulator.cpp \
-          $$LIBPDI_SRC_DIR/TePDIOFMatching.cpp \
-          $$LIBPDI_SRC_DIR/TePDIPrincipalComponentsFusion.cpp \
-          $$LIBPDI_SRC_DIR/TePDIDecorrelationEnhancement.cpp \
-          $$LIBPDI_SRC_DIR/TePDICorrelationMatching.cpp \
-          $$LIBPDI_SRC_DIR/TePDIBaatz.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMIMatching.cpp \
-          $$LIBPDI_SRC_DIR/TePDIJointHistogram.cpp \
-          $$LIBPDI_SRC_DIR/TePDIMMIOMatching.cpp
-
-win32 {
-  CONFIG += staticlib console
-
-  DEFINES += WIN32 __WIN32__
-
-  TEMPLATE = vclib
-  
-  LIBS =
-  
-  USE_TERRALIB_STL = yes
-  contains( QMAKESPEC , win32-msvc.net ) {
-    USE_TERRALIB_STL = no
-  }
-  equals( USE_TERRALIB_STL , yes ) {
-    INCLUDEPATH = $$TERRALIB_SRC_DIR/STLport $$INCLUDEPATH
-    message( "TerraLib internal STL will be used" )
-  }    
-}
-
-
diff --git a/terralibx/stat/Makefile b/terralibx/stat/Makefile
deleted file mode 100755
index 641518f..0000000
--- a/terralibx/stat/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-all: stat
-
-stat:
-	qmake -o makeStat stat.pro; make -f makeStat
-
-debug:
-	qmake -o makeStat.debug stat.pro TE_PROJECT_TYPE=DEBUG; make -f makeStat.debug
-
-clean:
-	if \
-	 test -f makeStat; \
-	then \
-		make -f makeStat distclean; rm -f makeStat; \
-	fi
-
-clean_debug:
-	if \
-	 test -f makeStat.debug; \
-	then \
-		make -f makeStat.debug distclean; rm -f makeStat.debug; \
-	fi
diff --git a/terralibx/stat/stat.pro b/terralibx/stat/stat.pro
deleted file mode 100755
index 2a379a2..0000000
--- a/terralibx/stat/stat.pro
+++ /dev/null
@@ -1,67 +0,0 @@
-TEMPLATE = lib
-CONFIG	= warn_on dll
-
-isEmpty(TE_PROJECT_TYPE) {
-  TE_PROJECT_TYPE=RELEASE
-}
-
-contains(TE_PROJECT_TYPE , DEBUG) {
-  CONFIG += debug
-}
-
-contains(TE_PROJECT_TYPE , RELEASE) {
-  CONFIG += release
-}
-
-unix {
-  release {
-    DEFINES += NDEBUG
-    OBJECTS_DIR = ../Release/.obj/stat
-    DESTDIR = ../Release
-    LIBS += -L../Release
-  }
-
-  debug {
-    DEFINES += _DEBUG
-    OBJECTS_DIR = ../Debug/.obj/stat
-    DESTDIR = ../Debug
-    LIBS += -L../Debug
-  }
-
-  LIBS += -lterralib
-}
-
-SOURCES	+=	\
-			../../src/terralib/stat/filaDouble.cpp \
-			../../src/terralib/stat/filaInt.cpp \
-			../../src/terralib/stat/filaR.cpp \
-			../../src/terralib/stat/heap.cpp \
-			../../src/terralib/stat/lista.cpp \
-			../../src/terralib/stat/TeBayesFunctions.cpp \
-			../../src/terralib/stat/TeKernelFunctions.cpp \
-			../../src/terralib/stat/TeSkaterArvore.cpp \
-			../../src/terralib/stat/TeSkaterFunctions.cpp \
-			../../src/terralib/stat/TeSkaterGrafo.cpp \
-			../../src/terralib/stat/TeStatDataStructures.cpp
-
-HEADERS	+= 	\
-			../../src/terralib/stat/erro.h \
-			../../src/terralib/stat/filaDouble.h \
-			../../src/terralib/stat/filaInt.h \
-			../../src/terralib/stat/filaR.h \
-			../../src/terralib/stat/heap.h \
-			../../src/terralib/stat/lista.h \
-			../../src/terralib/stat/TeBayesFunctions.h \
-			../../src/terralib/stat/TeKernelFunctions.h \
-			../../src/terralib/stat/TeKernelParams.h \
-			../../src/terralib/stat/TeKMeansGrouping.h \
-			../../src/terralib/stat/TeSkaterArvore.h \
-			../../src/terralib/stat/TeSkaterFunctions.h \
-			../../src/terralib/stat/TeSkaterGrafo.h \
-			../../src/terralib/stat/TeSpatialStatistics.h \
-			../../src/terralib/stat/TeStatDataStructures.h
-
-INCLUDEPATH	+=	\
-				. \
-				../../src/terralib/kernel
-
diff --git a/terralibx/terralib/Makefile b/terralibx/terralib/Makefile
deleted file mode 100755
index fc13f5e..0000000
--- a/terralibx/terralib/Makefile
+++ /dev/null
@@ -1,44 +0,0 @@
-all: terralib
-
-tiff:
-	cd ../tiff; make
-
-tiff_debug:
-	cd ../tiff; make debug
-
-debug: tiff_debug te_debug copy_dlls
-
-terralib: tiff te_release copy_dlls
-
-te_release:
-	qmake -o makeTerralib terralib.pro; make -f makeTerralib
-
-te_debug:
-	qmake -o makeTerralib.debug terralib.pro TE_PROJECT_TYPE=DEBUG; make -f makeTerralib.debug
-
-copy_dlls:
-	rm -f ../Oracle/libclntsh.so ../Oracle/libclntsh.so.1 ../Oracle/libclntsh.so.1.0
-	rm -f ../Oracle/libnnz10.so.1 ../Oracle/libnnz10.so.1.0
-	ln -s ../Oracle/libclntsh.so.10.1 ../Oracle/libclntsh.so
-	ln -s ../Oracle/libclntsh.so.10.1 ../Oracle/libclntsh.so.1
-	ln -s ../Oracle/libclntsh.so.10.1 ../Oracle/libclntsh.so.1.0
-	ln -s ../Oracle/libnnz10.so ../Oracle/libnnz10.so.1
-	ln -s ../Oracle/libnnz10.so ../Oracle/libnnz10.so.1.0	
-
-clean:
-	rm -f ../Oracle/libclntsh.so ../Oracle/libclntsh.so.1 ../Oracle/libclntsh.so.1.0
-	rm -f ../Oracle/libnnz10.so.1 ../Oracle/libnnz10.so.1.0
-	if \
-	 test -f makeTerralib; \
-	then \
-		make -f makeTerralib distclean; rm -f makeTerralib; \
-	fi
-
-clean_debug:
-	rm -f ../Oracle/libclntsh.so ../Oracle/libclntsh.so.1 ../Oracle/libclntsh.so.1.0
-	rm -f ../Oracle/libnnz10.so.1 ../Oracle/libnnz10.so.1.0
-	if \
-	 test -f makeTerralib.debug; \
-	then \
-		make -f makeTerralib.debug distclean; rm -f makeTerralib.debug; \
-	fi
diff --git a/terralibx/terralib/terralib.pro b/terralibx/terralib/terralib.pro
deleted file mode 100755
index 2ead349..0000000
--- a/terralibx/terralib/terralib.pro
+++ /dev/null
@@ -1,270 +0,0 @@
-TEMPLATE = lib
-TARGET  = terralib
-CONFIG	= warn_on dll rtti
-
-isEmpty(TE_PROJECT_TYPE) {
-  TE_PROJECT_TYPE=RELEASE
-}
-
-contains(TE_PROJECT_TYPE , DEBUG) {
-  CONFIG += debug
-}
-
-contains(TE_PROJECT_TYPE , RELEASE) {
-  CONFIG += release
-}
-
-unix {
-  release {
-    DEFINES += NDEBUG
-    OBJECTS_DIR = ../Release/.obj/terralib
-    DESTDIR = ../Release
-    LIBS += -L../Release
-  }
-
-  debug {
-    DEFINES += _DEBUG
-    OBJECTS_DIR = ../Debug/.obj/terralib
-    DESTDIR = ../Debug
-    LIBS += -L../Debug
-  }
-
-  LIBS += -lpthread -lz -ljpeg -lterralibtiff
-}
-
-SOURCES	+=	\
-			../../src/terralib/kernel/lexTemporal.cpp \
-			../../src/terralib/kernel/TeAbstractTheme.cpp \
-			../../src/terralib/kernel/TeAffineGT.cpp \
-			../../src/terralib/kernel/TeAffineGTFactory.cpp \
-			../../src/terralib/kernel/TeAgnostic.cpp \
-			../../src/terralib/kernel/TeAsciiFile.cpp \
-			../../src/terralib/kernel/TeBox.cpp \
-			../../src/terralib/kernel/TeBufferRegion.cpp \
-			../../src/terralib/kernel/TeCentroid.cpp \
-			../../src/terralib/kernel/TeComputeAttributeStrategies.cpp \
-			../../src/terralib/kernel/TeDatabase.cpp \
-			../../src/terralib/kernel/TeDatabaseFactory.cpp \
-			../../src/terralib/kernel/TeDatum.cpp \
-			../../src/terralib/kernel/TeDBConnectionsPool.cpp \
-			../../src/terralib/kernel/TeDecoderASCIIGrid.cpp \
-			../../src/terralib/kernel/TeDecoderDatabase.cpp \
-			../../src/terralib/kernel/TeDecoderFile.cpp \
-			../../src/terralib/kernel/TeDecoderJPEG.cpp \
-			../../src/terralib/kernel/TeDecoderMemory.cpp \
-			../../src/terralib/kernel/TeDecoderMemoryMap.cpp \
-			../../src/terralib/kernel/TeDecoderSPR.cpp \
-			../../src/terralib/kernel/TeDecoderTIFF.cpp \
-			../../src/terralib/kernel/TeDecoderVirtualMemory.cpp \
-			../../src/terralib/kernel/TeDecoderSmartMem.cpp \
-			../../src/terralib/kernel/TeErrorLog.cpp \
-			../../src/terralib/kernel/TeErrorMessage.cpp \
-			../../src/terralib/kernel/TeException.cpp \
-			../../src/terralib/kernel/TeExternalTheme.cpp \
-			../../src/terralib/kernel/TeFragmentation.cpp \
-			../../src/terralib/kernel/TeFileTheme.cpp \	
-			../../src/terralib/kernel/TeGeometricTransformation.cpp \
-			../../src/terralib/kernel/TeGeometry.cpp \
-			../../src/terralib/kernel/TeGeometryAlgorithms.cpp \
-			../../src/terralib/kernel/TeGTParams.cpp \
-			../../src/terralib/kernel/TeGTFactory.cpp \
-			../../src/terralib/kernel/TeGroupingAlgorithms.cpp \
-			../../src/terralib/kernel/TeImportRaster.cpp \
-			../../src/terralib/kernel/TeInitRasterDecoders.cpp \
-			../../src/terralib/kernel/TeIntersector.cpp \
-			../../src/terralib/kernel/TeLayer.cpp \
-			../../src/terralib/kernel/TeLegendEntry.cpp \
-			../../src/terralib/kernel/TeMatrix.cpp \
-			../../src/terralib/kernel/TeMetaModelCache.cpp \
-			../../src/terralib/kernel/TeMultiGeometry.cpp \
-			../../src/terralib/kernel/TeNeighbours.cpp \
-			../../src/terralib/kernel/TeNetwork.cpp \
-			../../src/terralib/kernel/TeOverlay.cpp \
-			../../src/terralib/kernel/TeOverlayUtils.cpp \
-			../../src/terralib/kernel/TeProgress.cpp \
-			../../src/terralib/kernel/TeProject.cpp \
-			../../src/terralib/kernel/TeProjection.cpp \
-			../../src/terralib/kernel/TeProjectiveGT.cpp \
-			../../src/terralib/kernel/TeProjectiveGTFactory.cpp \
-			../../src/terralib/kernel/TeProxMatrixConstructionStrategy.cpp \
-			../../src/terralib/kernel/TeProxMatrixImplementation.cpp \
-			../../src/terralib/kernel/TeProxMatrixStrategies.cpp \
-			../../src/terralib/kernel/TeQuerier.cpp \
-			../../src/terralib/kernel/TeQuerierDB.cpp \
-			../../src/terralib/kernel/TeQuerierDBStr1.cpp \
-			../../src/terralib/kernel/TeQuerierDBStr2.cpp \
-			../../src/terralib/kernel/TeQuerierDBStr3.cpp \
-			../../src/terralib/kernel/TeQuerierImpl.cpp \
-			../../src/terralib/kernel/TeQuerierParams.cpp \
-			../../src/terralib/kernel/TeRaster.cpp \
-			../../src/terralib/kernel/TeRasterParams.cpp \
-			../../src/terralib/kernel/TeRasterRemap.cpp \
-			../../src/terralib/kernel/TeRasterTransform.cpp \
-			../../src/terralib/kernel/TeRepresentation.cpp \
-			../../src/terralib/kernel/TeSpatialOperations.cpp \
-			../../src/terralib/kernel/TeStdFile.cpp \
-			../../src/terralib/kernel/TeSTElementSet.cpp \
-			../../src/terralib/kernel/TeSTEvent.cpp \
-			../../src/terralib/kernel/TeSTInstance.cpp \
-			../../src/terralib/kernel/TeTable.cpp \
-			../../src/terralib/kernel/TeTemporalSeries.cpp \
-			../../src/terralib/kernel/TeTheme.cpp \
-			../../src/terralib/kernel/TeTime.cpp \
-			../../src/terralib/kernel/TeTimeInterval.cpp \
-			../../src/terralib/kernel/TeTin.cpp \
-			../../src/terralib/kernel/TeUtils.cpp \
-			../../src/terralib/kernel/TeVectorRemap.cpp \
-			../../src/terralib/kernel/TeViewNode.cpp \
-			../../src/terralib/kernel/TeVisual.cpp \
-			../../src/terralib/kernel/yyTemporal.cpp \
-			../../src/terralib/kernel/TeDatabaseFactoryParams.cpp \
-			../../src/terralib/kernel/TeMappedMemory.cpp \
-			../../src/terralib/kernel/TeRasterMemManager.cpp \
-			../../src/terralib/kernel/TeMutex.cpp \
-			../../src/terralib/kernel/TeThread.cpp \
-      ../../src/terralib/kernel/TeThreadFunctor.cpp \   
-      ../../src/terralib/kernel/TeThreadSignal.cpp \
-			../../src/terralib/drivers/libjpeg/TeLibJpegWrapper.cpp \
-			../../src/terralib/drivers/libjpeg/jmemdst.c \
-			../../src/terralib/drivers/libjpeg/jmemsrc.c \
-      ../../src/terralib/kernel/TeStdIOProgress.cpp \
-      ../../src/terralib/kernel/TeThreadJobsManager.cpp \
-      ../../src/terralib/kernel/TeThreadJob.cpp \
-      ../../src/terralib/kernel/TeFunctionCallThreadJob.cpp \
-      ../../src/terralib/kernel/TeTempFilesRemover.cpp
-
-HEADERS	+= 	../../src/terralib/kernel/checkvec.h \
-			../../src/terralib/kernel/dynpq.h \
-			../../src/terralib/kernel/Gra_algo.h \
-			../../src/terralib/kernel/graph.h \
-			../../src/terralib/kernel/TeAbstractFactory.h \
-			../../src/terralib/kernel/TeAbstractTheme.h \
-			../../src/terralib/kernel/TeAffineGT.h \
-			../../src/terralib/kernel/TeAffineGTFactory.h \
-			../../src/terralib/kernel/TeAgnostic.h \
-			../../src/terralib/kernel/TeAsciiFile.h \
-			../../src/terralib/kernel/TeAttribute.h \
-			../../src/terralib/kernel/TeBox.h \
-			../../src/terralib/kernel/TeBufferRegion.h \
-			../../src/terralib/kernel/TeComposite.h \
-			../../src/terralib/kernel/TeCommunicator.h \      
-			../../src/terralib/kernel/TeComputeAttributeStrategies.h \
-			../../src/terralib/kernel/TeCoord2D.h \
-			../../src/terralib/kernel/TeCounted.h \
-			../../src/terralib/kernel/TeDatabase.h \
-			../../src/terralib/kernel/TeDataTypes.h \
-			../../src/terralib/kernel/TeDatum.h \
-			../../src/terralib/kernel/TeDBConnectionsPool.h \
-			../../src/terralib/kernel/TeDecoder.h \
-			../../src/terralib/kernel/TeDecoderASCIIGrid.h \
-			../../src/terralib/kernel/TeDecoderDatabase.h \
-			../../src/terralib/kernel/TeDecoderFile.h \
-			../../src/terralib/kernel/TeDecoderJPEG.h \
-			../../src/terralib/kernel/TeDecoderMemory.h \
-			../../src/terralib/kernel/TeDecoderMemoryMap.h \
-			../../src/terralib/kernel/TeDecoderSPR.h \
-			../../src/terralib/kernel/TeDecoderTIFF.h \
-			../../src/terralib/kernel/TeDecoderVirtualMemory.h \
-			../../src/terralib/kernel/TeDecoderSmartMem.h \
-			../../src/terralib/kernel/TeDefines.h \
-			../../src/terralib/kernel/TeErrorLog.h \
-			../../src/terralib/kernel/TeErrorMessage.h \
-			../../src/terralib/kernel/TeException.h \
-			../../src/terralib/kernel/TeExternalTheme.h \
-			../../src/terralib/kernel/TeFactory.h \
-			../../src/terralib/kernel/TeFragmentation.h \
-			../../src/terralib/kernel/TeFileTheme.h \	
-			../../src/terralib/kernel/TeGeneralizedProxMatrix.h \
-			 ../../src/terralib/kernel/TeGeometricTransformation.h \
-			../../src/terralib/kernel/TeGeometry.h \
-			../../src/terralib/kernel/TeGeometryAlgorithms.h \
-			../../src/terralib/kernel/TeGTParams.h \
-			../../src/terralib/kernel/TeGTFactory.h \
-			../../src/terralib/kernel/TeGroupingAlgorithms.h \
-			../../src/terralib/kernel/TeImportRaster.h \
-			../../src/terralib/kernel/TeIntersector.h \
-			../../src/terralib/kernel/TeLayer.h \
-			../../src/terralib/kernel/TeLegendEntry.h \
-			../../src/terralib/kernel/TeMatrix.h \
-			../../src/terralib/kernel/TeMeasure.h \
-			../../src/terralib/kernel/TeMetaModelCache.h \
-			../../src/terralib/kernel/TeMultiGeometry.h \
-			../../src/terralib/kernel/TeNeighbours.h \
-			../../src/terralib/kernel/TeNetwork.h \
-			../../src/terralib/kernel/TeOverlay.h \
-			../../src/terralib/kernel/TeOverlayUtils.h \
-			../../src/terralib/kernel/TePrecision.h \
-			../../src/terralib/kernel/TeProgress.h \
-			../../src/terralib/kernel/TeProgressBase.h \
-			../../src/terralib/kernel/TeProject.h \
-			../../src/terralib/kernel/TeProjection.h \
-			../../src/terralib/kernel/TeProjectiveGT.h \
-			../../src/terralib/kernel/TeProjectiveGTFactory.h \
-			../../src/terralib/kernel/TePrototype.h \
-			../../src/terralib/kernel/TeProxMatrixConstructionStrategy.h \
-			../../src/terralib/kernel/TeProxMatrixImplementation.h \
-			../../src/terralib/kernel/TeProxMatrixSlicingStrategy.h \
-			../../src/terralib/kernel/TeProxMatrixWeightsStrategy.h \
-			../../src/terralib/kernel/TeQuerier.h\
-			../../src/terralib/kernel/TeQuerierDB.h\
-			../../src/terralib/kernel/TeQuerierDBStr1.h\
-			../../src/terralib/kernel/TeQuerierDBStr2.h\
-			../../src/terralib/kernel/TeQuerierDBStr3.h \
-			../../src/terralib/kernel/TeQuerierImpl.h\
-			../../src/terralib/kernel/TeQuerierParams.h\
-			../../src/terralib/kernel/TeRaster.h \
-			../../src/terralib/kernel/TeRasterParams.h \
-			../../src/terralib/kernel/TeRasterRemap.h \
-			../../src/terralib/kernel/TeRasterTransform.h \
-			../../src/terralib/kernel/TeRedBlackTree.h \
-			../../src/terralib/kernel/TeRepresentation.h \
-			../../src/terralib/kernel/TeSharedPtr.h \      
-			../../src/terralib/kernel/TeSingleton.h \
-			../../src/terralib/kernel/TeSlice.h \
-			../../src/terralib/kernel/TeSpatialOperations.h \
-			../../src/terralib/kernel/TeStatistics.h \
-			../../src/terralib/kernel/TeStdFile.h \
-			../../src/terralib/kernel/TeSTEFunctionsDB.h \
-			../../src/terralib/kernel/TeBaseSTInstance.h \
-			../../src/terralib/kernel/TeBaseSTInstanceSet.h \
-			../../src/terralib/kernel/TeSTElementSet.h \
-			../../src/terralib/kernel/TeSTEvent.h \
-			../../src/terralib/kernel/TeSTInstance.h\
-			../../src/terralib/kernel/TeTable.h \
-			../../src/terralib/kernel/TeTemporalSeries.h \
-			../../src/terralib/kernel/TeTheme.h \
-			../../src/terralib/kernel/TeTime.h \
-			../../src/terralib/kernel/TeTimeInterval.h \
-			../../src/terralib/kernel/TeTin.h \
-			../../src/terralib/kernel/TeUtils.h \
-			../../src/terralib/kernel/TeVectorRemap.h \
-			../../src/terralib/kernel/TeView.h \
-			../../src/terralib/kernel/TeViewNode.h \
-			../../src/terralib/kernel/TeVisual.h \
-			../../src/terralib/kernel/yyTemporal.h \
-			../../src/terralib/kernel/TeRasterMemManager.h \
-			../../src/terralib/kernel/TeMutex.h \
-			../../src/terralib/kernel/TeThreadParameters.h \
-			../../src/terralib/kernel/TeThread.h \
-      ../../src/terralib/kernel/TeThreadFunctor.h \   
-      ../../src/terralib/kernel/TeThreadSignal.h \
-			../../src/terralib/kernel/TeDatabaseFactoryParams.h \
-			../../src/terralib/kernel/TeMappedMemory.h \
-			../../src/terralib/drivers/libjpeg/TeLibJpegWrapper.h \
-			../../src/terralib/drivers/libjpeg/jmemdstsrc.h \
-			../../src/terralib/kernel/TeMultiContainer.h \
-      ../../src/terralib/kernel/TeStdIOProgress.h \
-      ../../src/terralib/kernel/TeThreadJobsManager.h \
-      ../../src/terralib/kernel/TeThreadJob.h \
-      ../../src/terralib/kernel/TeFunctionCallThreadJob.h \
-      ../../src/terralib/kernel/TeTempFilesRemover.h          
-
-INCLUDEPATH	= \
-      ../../src/terralib/kernel \
-			../../src/terralib/functions \
-			../../src/terralib/utils \
-			../../src/tiff \
-			../../src/zlib \
-			../../src/terralib/drivers/libjpeg \
-      $$INCLUDEPATH
-

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/libterralib.git



More information about the Pkg-grass-devel mailing list